Files
lean4/tests/elab/3943.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

52 lines
2.1 KiB
Lean4

example (f : Nat Nat) : (if f x = 0 then f x else f x + 1) + f x = y := by
simp (config := { contextual := true })
guard_target = (if f x = 0 then 0 else f x + 1) + f x = y
sorry
example (f : Nat Nat) : f x = 0 f x + 1 = y := by
simp (config := { contextual := true })
guard_target = f x = 0 1 = y
sorry
example (f : Nat Nat) : have _ : f x = 0 := sorryAx _ false; f x + 1 = y := by
simp (config := { contextual := true, zeta := false, zetaUnused := false })
guard_target = have _ : f x = 0 := sorryAx _ false; 1 = y
sorry
def overlap : Nat Nat
| 0 => 0
| 1 => 1
| n+1 => overlap n
example : (if (n = 0 False) then overlap (n+1) else overlap (n+1)) = overlap n := by
simp (config := { contextual := true }) only [overlap]
guard_target = (if (n = 0 False) then overlap n else overlap (n+1)) = overlap n
sorry
example : (if (n = 0 False) then overlap (n+1) else overlap (n+1)) = overlap n := by
-- The following tactic should because the default discharger only uses assumptions available
-- when `simp` was invoked unless `contextual := true`
fail_if_success simp only [overlap]
guard_target = (if (n = 0 False) then overlap (n+1) else overlap (n+1)) = overlap n
sorry
example : (if (n = 0 False) then overlap (n+1) else overlap (n+1)) = overlap n := by
-- assumption is not a well-behaved discharger, and the following should still work as expected
simp (discharger := assumption) only [overlap]
guard_target = (if (n = 0 False) then overlap n else overlap (n+1)) = overlap n
sorry
opaque p : Nat Bool
opaque g : Nat Nat
@[simp] theorem g_eq (h : p x) : g x = x := sorry
example : (if p x then g x else g x + 1) + g x = y := by
simp (discharger := assumption)
guard_target = (if p x then x else g x + 1) + g x = y
sorry
example : (have _ : p x := sorryAx _ false; g x + 1 = y) g x = y := by
simp (config := { zeta := false, zetaUnused := false }) (discharger := assumption)
guard_target = (have _ : p x := sorryAx _ false; x + 1 = y) g x = y
sorry