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.
37 lines
1.4 KiB
Lean4
37 lines
1.4 KiB
Lean4
/-!
|
||
# Tests of universe constraints for inductive types
|
||
|
||
https://github.com/leanprover/lean4/pull/2689 corrected the elaborator's `Level.geq`,
|
||
which was missing cases that the kernel `is_geq` could handle.
|
||
-/
|
||
|
||
/-!
|
||
This always worked. The universe level of `Trans₁` is inferred from the fields.
|
||
-/
|
||
structure Trans₁ {α : Sort a} {β : Sort b} {γ : Sort c}
|
||
(r : α → β → Sort u) (s : β → γ → Sort v) (t : outParam (α → γ → Sort w)) where
|
||
trans : r a b → s b c → t a c
|
||
|
||
/-!
|
||
Regression test: This was failing. An explicit universe invokes `Level.geq`.
|
||
-/
|
||
structure Trans₂ {α : Sort a} {β : Sort b} {γ : Sort c}
|
||
(r : α → β → Sort u) (s : β → γ → Sort v) (t : outParam (α → γ → Sort w)) :
|
||
Sort (max 1 a b c u v w) where
|
||
trans : r a b → s b c → t a c
|
||
|
||
/-!
|
||
Regression test: This was failing. An explicit universe invokes `Level.geq`.
|
||
-/
|
||
inductive Trans₃ {α : Sort a} {β : Sort b} {γ : Sort c}
|
||
(r : α → β → Sort u) (s : β → γ → Sort v) (t : outParam (α → γ → Sort w)) :
|
||
Sort (max 1 a b c u v w) where
|
||
| mk : (∀ a b c, r a b → s b c → t a c) → Trans₃ r s t
|
||
|
||
/-!
|
||
Regression test: This was failing due to the included `Type (max u v)`
|
||
even though this is the inferred universe.
|
||
-/
|
||
inductive I (α : Type u) (Hom : α → α → Sort v) : Type (max u v) where
|
||
| mk (id : ∀ X : α, Hom X X)
|