-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from leanprover/replace_axiom
feat: add a test replacing an axiom
- Loading branch information
Showing
2 changed files
with
35 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import Lean4CheckerTests.OpenPrivate | ||
|
||
/- Redefine `propext : False`. -/ | ||
open Lean Elab Meta in | ||
open private Environment.mk from Lean.Environment in | ||
#eval modifyEnv (m := MetaM) fun env => | ||
let consts := | ||
{ env.constants with | ||
map₁ := env.constants.map₁.insert ``propext (.axiomInfo { | ||
name := ``propext | ||
type := .const ``False [] | ||
levelParams := [] | ||
isUnsafe := false | ||
}) | ||
} | ||
Environment.mk env.const2ModIdx consts env.extensions env.extraConstNames env.header | ||
|
||
theorem efsq : ∀ (x y z n : Nat), | ||
0 < x → 0 < y → 0 < z → 2 < n → | ||
x^n + y^n ≠ z^n := by | ||
exfalso | ||
exact propext | ||
|
||
/-- info: 'efsq' depends on axioms: [propext] -/ | ||
#guard_msgs in | ||
-- 'efsq' depends on axioms: [propext] | ||
#print axioms efsq |
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