Coq: Remove all (nested) parentheses from a sum
Suppose I've a sum like a + (b + (c + d)), which I wish to transform into a + b + c + d to apply a lemma. Doing this manually with Nat.add_assoc is extremly tedious. Is there a smarter way?
You can use the repeat tactical, which repeats some tactic until it cannot be applied anymore: repeat rewrite Nat.add_assoc. or a more concise version: rewrite !Nat.add_assoc. It works just the same as the variant with repeat. The downside of this approach is that it rewrites everywhere in the goal. So, you might want to select some part of your formula to do the rewrites on it only.
The 'easy but not nice' way I would use is replace (a + (b + (c + d)))) with (a + b + c + d) by now omega
Proving a theorem about ordered lists
Strong Induction on Lists
What does the simpl tactic do in COQ
Induction on predicates with product type arguments
Construct Sets in Coq
Is this relationship between forall and exists provable in Coq/intuitionistic logic?
Proof automation in Coq how to factorize a proof
How to use matched case and variable equivalence in coq
Proof with false hypothesis in Isabelle/HOL Isar
Is there a convention for the order of applying ssreflect tactic/taticals?
How to systematically normalize inequalities to < (lt) and <= (le) in Coq?
Inductive subset of an inductive set in Coq
How to find the source file for an identifier in Coq
Coq “Unknown interpretation for notation” error
How to switch the current goal in Coq?
Reasoning about lists in Coq