enable ac_rfl

This commit is contained in:
Jon Eugster
2023-08-06 23:28:11 +02:00
parent df5efa7548
commit c80a695def
5 changed files with 25 additions and 1 deletions

16
Game/Tactic/ACRfl.lean Normal file
View File

@@ -0,0 +1,16 @@
import Lean
-- Note: to get `ac_rfl` working (which is in core), we just
-- need the two instances below in the files where
-- `add_assoc` and `add_comm` are proven.
-- This file is only for demonstration purpose.
import Game.Levels.Addition.Level_2 -- defines `MyNat.add_assoc`
import Game.Levels.Addition.Level_4 -- defines `MyNat.add_comm`
instance : Lean.IsAssociative (α := ) (·+·) := MyNat.add_assoc
instance : Lean.IsCommutative (α := ) (·+·) := MyNat.add_comm
example (a b c : ) : c + (b + a) = (a + b) + c := by
ac_rfl

View File

@@ -16,7 +16,7 @@ open Lean Meta Elab Tactic
`rfl` closes goals of the form `A = A`.
Note that teh version for this game is somewhat weaker than the real one. -/
Note that the version for this game is somewhat weaker than the real one. -/
syntax (name := rfl) "rfl" : tactic
@[tactic MyNat.rfl] def evalRfl : Tactic := fun _ =>