lean4-htt/tests/lean/run/1841.lean
Kyle Miller 4575799f8e
chore: library style cleanup (#9654)
This PR cleans up the style of the library in anticipation of a future
PR that requires strict indentation for tactic sequences.
2025-07-31 21:28:59 +00:00

25 lines
852 B
Text
Raw 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.

variable {α : Type} {r : αα → Prop} {b : α}
inductive ReflTransGen (r : αα → Prop) (a : α) : α → Prop
| refl : ReflTransGen r a a
| tail {b c} : ReflTransGen r a b → r b c → ReflTransGen r a c
namespace ReflTransGen
theorem head (hab : r a b) (hbc : ReflTransGen r b c) : ReflTransGen r a c := by
induction hbc
case refl => exact refl.tail hab
case tail c d _ hcd hac => exact hac.tail hcd
@[elab_as_elim]
theorem head_induction_on {P : ∀ a : α, ReflTransGen r a b → Prop} {a : α} (h : ReflTransGen r a b)
(refl : P b refl)
(head : ∀ {a c} (h' : r a c) (h : ReflTransGen r c b), P c h → P a (h.head h')) : P a h := by
induction h
case refl => exact refl
case tail b c _ hbc ih =>
apply ih
{ exact head hbc _ refl }
{ exact fun h1 h2 => head h1 (h2.tail hbc) }
end ReflTransGen