@@ -2327,86 +2327,6 @@ instance : Subsingleton (Squash α) where
23272327 trivial
23282328
23292329namespace Lean
2330- /-! # Kernel reduction hints -/
2331-
2332- /--
2333- Depends on the correctness of the Lean compiler, interpreter, and all `[implemented_by ...]` and `[extern ...]` annotations.
2334- -/
2335- @ [deprecated "in-kernel native reduction is deprecated; assert native evaluations with axioms instead" (since := "2026-02-01" )]
2336- axiom trustCompiler : True
2337-
2338- set_option linter.deprecated false in
2339- /--
2340- When the kernel tries to reduce a term `Lean.reduceBool c`, it will invoke the Lean interpreter to evaluate `c`.
2341- The kernel will not use the interpreter if `c` is not a constant.
2342- This feature is useful for performing proofs by reflection.
2343-
2344- Remark: the Lean frontend allows terms of the from `Lean.reduceBool t` where `t` is a term not containing
2345- free variables. The frontend automatically declares a fresh auxiliary constant `c` and replaces the term with
2346- `Lean.reduceBool c`. The main motivation is that the code for `t` will be pre-compiled.
2347-
2348- Warning: by using this feature, the Lean compiler and interpreter become part of your trusted code base.
2349- This is extra 30k lines of code. More importantly, you will probably not be able to check your development using
2350- external type checkers that do not implement this feature.
2351- Keep in mind that if you are using Lean as programming language, you are already trusting the Lean compiler and interpreter.
2352- So, you are mainly losing the capability of type checking your development using external checkers.
2353-
2354- Recall that the compiler trusts the correctness of all `[implemented_by ...]` and `[extern ...]` annotations.
2355- If an extern function is executed, then the trusted code base will also include the implementation of the associated
2356- foreign function.
2357- -/
2358- @ [deprecated "in-kernel native reduction is deprecated; assert native evaluations with axioms instead" (since := "2026-02-01" )]
2359- opaque reduceBool (b : Bool) : Bool :=
2360- -- This ensures that `#print axioms` will track use of `reduceBool`.
2361- have := trustCompiler
2362- b
2363-
2364- set_option linter.deprecated false in
2365- /--
2366- Similar to `Lean.reduceBool` for closed `Nat` terms.
2367-
2368- Remark: we do not have plans for supporting a generic `reduceValue {α} (a : α) : α := a`.
2369- The main issue is that it is non-trivial to convert an arbitrary runtime object back into a Lean expression.
2370- We believe `Lean.reduceBool` enables most interesting applications (e.g., proof by reflection).
2371- -/
2372- @ [deprecated "in-kernel native reduction is deprecated; assert native evaluations with axioms instead" (since := "2026-02-01" )]
2373- opaque reduceNat (n : Nat) : Nat :=
2374- -- This ensures that `#print axioms` will track use of `reduceNat`.
2375- have := trustCompiler
2376- n
2377-
2378-
2379- set_option linter.deprecated false in
2380- /--
2381- The axiom `ofReduceBool` is used to perform proofs by reflection. See `reduceBool`.
2382-
2383- This axiom is usually not used directly, because it has some syntactic restrictions.
2384- Instead, the `native_decide` tactic can be used to prove any proposition whose
2385- decidability instance can be evaluated to `true` using the lean compiler / interpreter.
2386-
2387- Warning: by using this feature, the Lean compiler and interpreter become part of your trusted code base.
2388- This is extra 30k lines of code. More importantly, you will probably not be able to check your development using
2389- external type checkers that do not implement this feature.
2390- Keep in mind that if you are using Lean as programming language, you are already trusting the Lean compiler and interpreter.
2391- So, you are mainly losing the capability of type checking your development using external checkers.
2392- -/
2393- @ [deprecated "in-kernel native reduction is deprecated; assert native evaluations with axioms instead" (since := "2026-02-01" )]
2394- axiom ofReduceBool (a b : Bool) (h : reduceBool a = b) : a = b
2395-
2396- set_option linter.deprecated false in
2397- /--
2398- The axiom `ofReduceNat` is used to perform proofs by reflection. See `reduceBool`.
2399-
2400- Warning: by using this feature, the Lean compiler and interpreter become part of your trusted code base.
2401- This is extra 30k lines of code. More importantly, you will probably not be able to check your development using
2402- external type checkers that do not implement this feature.
2403- Keep in mind that if you are using Lean as programming language, you are already trusting the Lean compiler and interpreter.
2404- So, you are mainly losing the capability of type checking your development using external checkers.
2405- -/
2406- @ [deprecated "in-kernel native reduction is deprecated; assert native evaluations with axioms instead" (since := "2026-02-01" )]
2407- axiom ofReduceNat (a b : Nat) (h : reduceNat a = b) : a = b
2408-
2409-
24102330/--
24112331The term `opaqueId x` will not be reduced by the kernel.
24122332-/
0 commit comments