Files
lean4/tests/elab/safeExp.lean
Garmelon 08eb78a5b2 chore: switch to new test/bench suite (#12590)
This PR sets up the new integrated test/bench suite. It then migrates
all benchmarks and some related tests to the new suite. There's also
some documentation and some linting.

For now, a lot of the old tests are left alone so this PR doesn't become
even larger than it already is. Eventually, all tests should be migrated
to the new suite though so there isn't a confusing mix of two systems.
2026-02-25 13:51:53 +00:00

46 lines
1.2 KiB
Lean4

/--
warning: exponent 10000000 exceeds the threshold 256, exponentiation operation was not evaluated, use `set_option exponentiation.threshold <num>` to set a new threshold
---
error: maximum recursion depth has been reached
use `set_option maxRecDepth <num>` to increase limit
use `set_option diagnostics true` to get diagnostic information
-/
#guard_msgs in
example : 2^2^8000000 = 3^3^10000000 :=
rfl
/--
-/
#guard_msgs in
set_option exponentiation.threshold 258 in
example : 2^257 = 2*2^256 :=
rfl
/--
warning: exponent 2008 exceeds the threshold 256, exponentiation operation was not evaluated, use `set_option exponentiation.threshold <num>` to set a new threshold
---
trace: k : Nat
h : k = 2008 ^ 2 + 2 ^ 2008
⊢ ((4032064 + 2 ^ 2008) ^ 2 + 2 ^ (4032064 + 2 ^ 2008)) % 10 = 6
---
warning: declaration uses `sorry`
-/
#guard_msgs in
example (k : Nat) (h : k = 2008^2 + 2^2008) : (k^2 + 2^k)%10 = 6 := by
simp [h]
trace_state
sorry
/--
trace: k : Nat
h : k = 2008 ^ 2 + 2 ^ 2008
⊢ ((2008 ^ 2 + 2 ^ 2008) ^ 2 + 2 ^ (2008 ^ 2 + 2 ^ 2008)) % 10 = 6
---
warning: declaration uses `sorry`
-/
#guard_msgs in
example (k : Nat) (h : k = 2008^2 + 2^2008) : (k^2 + 2^k)%10 = 6 := by
rw [h]
trace_state
sorry