lean4-htt/tests/lean/run/5672.lean
Kyle Miller c10e4c2256
feat: prop instance yields theorems (#5856)
This PR adds a feature to the the mutual def elaborator where the
`instance` command yields theorems instead of definitions when the class
is a `Prop`.

Closes #5672
2024-11-08 18:18:10 +00:00

27 lines
382 B
Text

/-!
# `instance` creates a theorem if the class is a `Prop`
https://github.com/leanprover/lean4/issues/5672
-/
class A : Prop
instance a : A where
/--
info: theorem a : A :=
{ }
-/
#guard_msgs in #print a
/-!
Uses `def` variable inclusion rules
-/
section
variable (x : Nat)
instance b : A := by
cases x <;> exact {}
/-- info: b (x : Nat) : A -/
#guard_msgs in #check b
end