lean4-htt/tests/elab/openInScopeBug.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

39 lines
929 B
Text

opaque f : Nat → Nat
opaque g : Nat → Nat
namespace Foo
@[scoped simp] axiom ax1 (x : Nat) : f (g x) = x
@[scoped simp] axiom ax2 (x : Nat) : g (g x) = g x
end Foo
theorem ex1 : f (g (g (g x))) = x := by
fail_if_success simp -- does not use ax1 and ax2
simp [Foo.ax1, Foo.ax2]
theorem ex2 : f (g (g (g x))) = x :=
have h₁ : f (g (g (g x))) = f (g x) := by
fail_if_success simp
/- try again with `Foo` scoped lemmas -/
open Foo in simp
have h₂ : f (g x) = x := by
fail_if_success simp
open Foo in simp
Eq.trans h₁ h₂
-- open Foo in simp -- works
theorem ex3 : f (g (g (g x))) = x := by
fail_if_success simp
simp [Foo.ax1, Foo.ax2]
open Foo in
theorem ex4 : f (g (g (g x))) = x := by
simp
theorem ex5 : f (g (g (g x))) = x ∧ f (g x) = x := by
apply And.intro
{ fail_if_success simp
open Foo in simp }
{ fail_if_success simp
open Foo in simp }