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

78 lines
1.5 KiB
Text
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/-!
# Regression tests for #2186
https://github.com/leanprover/lean4/issues/2186
-/
/-!
Minimization of the issue. The default value to `bar` wasn't working
because the default value of `bar` was `fun (_ : p) => trivial`,
and `p` (which in the default value itself appears as a projection) wasn't being reduced.
-/
namespace Test1
structure A (α : Type u) where
p : Prop
bar : p → True
structure B (α : Type _) extends A α where
bar _ := trivial
-- Previously this needed `bar` to be specified
example : B α where
p := False
end Test1
/-!
Tests from the issue.
-/
namespace Test2
variable (α : Type _)
-- First example
structure A extends LE α where
foo : True
structure B extends LE α where
bar : ∀ a b : α, a ≤ b → True
structure C extends A α, B α
structure D extends C α where
foo := trivial
structure E extends C α where
bar _ _ _ := trivial
-- Always worked
example : D α where
le := Eq
bar _ _ _ := trivial
-- Didn't work
example : E α where
le := Eq
foo := trivial
-- Second example
structure X where
transform : αα
structure A₁ extends X α where
foo : True
structure B₁ extends X α where
bar : ∀ a, transform a = transform (transform a) → True
structure C₁ extends A₁ α, B₁ α
structure D₁ extends C₁ α where
foo := trivial
structure E₁ extends C₁ α where
bar _ _ := trivial
-- Always worked
example : D₁ α where
transform := id
bar := fun _ _ => trivial
-- Didn't work
example : E₁ α where
transform := id
foo := trivial
end Test2