Files
NNG/Game/Tactic/ACRfl.lean
2023-08-06 23:28:11 +02:00

17 lines
562 B
Lean4
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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