enable ac_rfl
This commit is contained in:
16
Game/Tactic/ACRfl.lean
Normal file
16
Game/Tactic/ACRfl.lean
Normal 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
|
||||
@@ -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 _ =>
|
||||
|
||||
Reference in New Issue
Block a user