lean4-htt/tests/lean/run/1841.lean
Leonardo de Moura edadd8c034 fix: fixes #1841
This commit adds the configuration option
`ApplyConfig.approx` (available in Lean 3), and sets it to true by
default like in Lean 3.
2022-11-16 14:46:05 -08:00

25 lines
846 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