aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Algebra.v3
-rw-r--r--src/Util/Tactics.v14
2 files changed, 17 insertions, 0 deletions
diff --git a/src/Algebra.v b/src/Algebra.v
index f71807fff..153871d4c 100644
--- a/src/Algebra.v
+++ b/src/Algebra.v
@@ -1304,6 +1304,9 @@ Ltac only_two_square_roots :=
Require Import Coq.setoid_ring.Ring_tac.
Ltac ring_simplify_subterms := tac_on_subterms ltac:(fun t => ring_simplify t).
+Ltac ring_simplify_subterms_in_all :=
+ reverse_nondep; ring_simplify_subterms; intros.
+
Section Example.
Context {F zero one opp add sub mul inv div} `{F_field:field F eq zero one opp add sub mul inv div}.
Local Infix "+" := add. Local Infix "*" := mul. Local Infix "-" := sub. Local Infix "/" := div.
diff --git a/src/Util/Tactics.v b/src/Util/Tactics.v
index 5ff9d203c..aa8093308 100644
--- a/src/Util/Tactics.v
+++ b/src/Util/Tactics.v
@@ -308,3 +308,17 @@ Ltac tac_on_subterms tac :=
| [ |- context[?t] ]
=> progress tac t
end.
+
+(** Like [Coq.Program.Tactics.revert_last], but only for non-dependent hypotheses *)
+Ltac revert_last_nondep :=
+ match goal with
+ | [ H : _ |- _ ]
+ => lazymatch goal with
+ | [ H' : appcontext[H] |- _ ] => fail
+ | [ |- appcontext[H] ] => fail
+ | _ => idtac
+ end;
+ revert H
+ end.
+
+Ltac reverse_nondep := repeat revert_last_nondep.