-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace recursive definitions of algebraic operations with axioms (#41)
change to axiom approach
- Loading branch information
Showing
10 changed files
with
84 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import Game.MyNat.DecidableEq | ||
import Game.MyNat.Power | ||
|
||
example : 4 = 4 := by | ||
decide | ||
|
||
example : 4 ≠ 5 := by | ||
decide | ||
|
||
example : (0 : ℕ) + 0 = 0 := by | ||
decide | ||
|
||
example : (2 : ℕ) + 2 = 4 := by | ||
decide | ||
|
||
example : (2 : ℕ) + 2 ≠ 5 := by | ||
decide | ||
|
||
example : (20 : ℕ) + 20 = 40 := by | ||
decide | ||
|
||
example : (2 : ℕ) * 2 = 4 := by | ||
decide | ||
|
||
example : (2 : ℕ) * 2 ≠ 5 := by | ||
decide | ||
|
||
example : (3 : ℕ) ^ 2 ≠ 37 := by | ||
decide |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import Std.Tactic.LabelAttr | ||
import Mathlib.Lean.Meta.Simp | ||
|
||
/-- Simp set for `functor_norm` -/ | ||
register_simp_attr MyNat_decide |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import Game.Tactic.LabelAttr | ||
import Game.MyNat.Definition | ||
|
||
-- to get numerals of type MyNat to reduce to MyNat.succ (MyNat.succ ...) | ||
@[MyNat_decide] | ||
theorem ofNat_succ : (OfNat.ofNat (Nat.succ n) : ℕ) = MyNat.succ (OfNat.ofNat n) := _root_.rfl | ||
|
||
|
||
/- modified `decide` tactic which first runs a custom | ||
simp call to reduce numerals like `1 + 1` to | ||
`MyNat.succ (MyNat.succ MyNat.zero) | ||
-/ | ||
macro "decide" : tactic => `(tactic|( | ||
try simp only [MyNat_decide] | ||
try decide | ||
)) |