mirror of
https://github.com/leanprover/lean4.git
synced 2026-03-17 18:34:06 +00:00
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.
52 lines
2.1 KiB
Lean4
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
|