Skip to content

Commit 9035d15

Browse files
committed
feat: port itauto from lean 3 (#9398)
This tactic solves problems in intuitionistic propositional logic. It also produces nice proofs when doing so, so it is useful even for proving classical theorems (using the `itauto!` variant to enable EM) and observing the results with `#explode`. ```lean example (p : Prop) : ¬(p ↔ ¬p) := by itauto ``` Co-authored-by: Mario Carneiro <di.gama@gmail.com>
1 parent 9a5f5b6 commit 9035d15

File tree

6 files changed

+858
-6
lines changed

6 files changed

+858
-6
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3849,6 +3849,7 @@ import Mathlib.Tactic.HaveI
38493849
import Mathlib.Tactic.HelpCmd
38503850
import Mathlib.Tactic.HigherOrder
38513851
import Mathlib.Tactic.Hint
3852+
import Mathlib.Tactic.ITauto
38523853
import Mathlib.Tactic.InferParam
38533854
import Mathlib.Tactic.Inhabit
38543855
import Mathlib.Tactic.IntervalCases

Mathlib/Mathport/Syntax.lean

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ import Mathlib.Tactic.GeneralizeProofs
4747
import Mathlib.Tactic.Group
4848
import Mathlib.Tactic.GuardHypNums
4949
import Mathlib.Tactic.Hint
50+
import Mathlib.Tactic.ITauto
5051
import Mathlib.Tactic.InferParam
5152
import Mathlib.Tactic.IntervalCases
5253
import Mathlib.Tactic.Inhabit
@@ -185,10 +186,6 @@ syntax generalizingClause := " generalizing" (ppSpace ident)+
185186
/- S -/ syntax (name := induction'') "induction''" casesTarget
186187
(fixingClause <|> generalizingClause)? (" with" (ppSpace colGt withPattern)+)? : tactic
187188

188-
syntax termList := " [" term,* "]"
189-
/- B -/ syntax (name := itauto) "itauto" (" *" <|> termList)? : tactic
190-
/- B -/ syntax (name := itauto!) "itauto!" (" *" <|> termList)? : tactic
191-
192189
/- B -/ syntax (name := obviously) "obviously" : tactic
193190

194191
/- S -/ syntax (name := prettyCases) "pretty_cases" : tactic
@@ -221,8 +218,8 @@ syntax termList := " [" term,* "]"
221218

222219
/- M -/ syntax (name := unfoldCases) "unfold_cases " tacticSeq : tactic
223220

224-
/- B -/ syntax (name := equivRw) "equiv_rw" (config)? (termList <|> (ppSpace term)) (location)? :
225-
tactic
221+
/- B -/ syntax (name := equivRw) "equiv_rw" (config)?
222+
((" [" term,* "]") <|> (ppSpace term)) (location)? : tactic
226223
/- B -/ syntax (name := equivRwType) "equiv_rw_type" (config)? ppSpace term : tactic
227224

228225
/- E -/ syntax (name := nthRwLHS) "nth_rw_lhs " num rwRuleSeq (location)? : tactic

Mathlib/Tactic.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ import Mathlib.Tactic.HaveI
9191
import Mathlib.Tactic.HelpCmd
9292
import Mathlib.Tactic.HigherOrder
9393
import Mathlib.Tactic.Hint
94+
import Mathlib.Tactic.ITauto
9495
import Mathlib.Tactic.InferParam
9596
import Mathlib.Tactic.Inhabit
9697
import Mathlib.Tactic.IntervalCases

0 commit comments

Comments
 (0)