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

111 lines
2.2 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.

/-!
# `Prop`-valued `inductive`/`structure` by default
When the inductive types are syntactic subsingletons and could be `Prop`,
they may as well be `Prop`.
Issue: https://github.com/leanprover/lean4/issues/2690
-/
/-!
Subsingleton, but no constructors. Type.
-/
inductive I0 where
/-- info: I0 : Type -/
#guard_msgs in #check I0
/-!
One constructor, has a Prop parameter. Prop.
-/
inductive I1 where
| a (h : True)
/-- info: I1 : Prop -/
#guard_msgs in #check I1
/-!
One constructor, no constructor parameters. Type.
-/
inductive I2 where
| a
/-- info: I2 : Type -/
#guard_msgs in #check I2
inductive I2' (_ : Nat) where
| a
/-- info: I2' : Nat → Type -/
#guard_msgs in #check I2'
/-!
Two constructors. Type
-/
inductive I3 where
| a | b
/-- info: I3 : Type -/
#guard_msgs in #check I3
/-!
Mutually inductives, both syntactic subsingletons,
even if one doesn't have a constructor,
and one has no parameters.
-/
mutual
inductive C1 where
inductive C2 where
| a (h : True)
inductive C3 where
| b
end
/-- info: C1 : Prop -/
#guard_msgs in #check C1
/-- info: C2 : Prop -/
#guard_msgs in #check C2
/-- info: C3 : Prop -/
#guard_msgs in #check C3
/-!
Type parameter (promoted from index), still Prop.
-/
inductive D : Nat → Sort _ where
| a (h : n = n) : D n
/-- info: D : Nat → Prop -/
#guard_msgs in #check D
/-!
Structure with no fields, Type.
-/
structure S1 where
/-- info: S1 : Type -/
#guard_msgs in #check S1
/-!
Structure with a Prop field, Prop.
-/
structure S2 where
h : True
/-- info: S2 : Prop -/
#guard_msgs in #check S2
/-!
Structure with parameter and a Prop field, Prop.
-/
structure S3 (α : Type) where
h : ∀ a : α, a = a
/-- info: S3 (α : Type) : Prop -/
#guard_msgs in #check S3
/-!
Verify: `Decidable` is a `Type`.
-/
class inductive Decidable' (p : Prop) where
| isFalse (h : Not p) : Decidable' p
| isTrue (h : p) : Decidable' p
/-- info: Decidable' (p : Prop) : Type -/
#guard_msgs in #check Decidable'
/-!
Verify: `WellFounded` is a `Prop`.
-/
inductive WellFounded' {α : Sort u} (r : αα → Prop) where
| intro (h : ∀ a, Acc r a) : WellFounded' r
/-- info: WellFounded'.{u} {α : Sort u} (r : αα → Prop) : Prop -/
#guard_msgs in #check WellFounded'