l3lab/ntp-mathlib huggingface dataset:
@[elab_as_elim]
theorem head_induction_on {P : ∀ a : α, TransGen r a b → Prop} {a : α} (h : TransGen r a b)
    (base : ∀ {a} (h : r a b), P a (single h))
    (ih : ∀ {a c} (h' : r a c) (h : TransGen r c b), P c h → P a (h.head h')) : P a h := by
  induction h
  

Proof state:
case single
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a✝¹ b c d a b✝ : α
a✝ : r a b✝
P : (a : α) → TransGen r a b✝ → Prop
base : ∀ {a : α} (h : r a b✝), P a (_ : TransGen r a b✝)
ih : ∀ {a c : α} (h' : r a c) (h : TransGen r c b✝), P c h → P a (_ : TransGen r a b✝)
⊢ P a (_ : TransGen r a b✝)
case tail
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a✝² b c d a b✝ c✝ : α
a✝¹ : TransGen r a b✝
a✝ : r b✝ c✝
a_ih✝ :
  ∀ {P : (a : α) → TransGen r a b✝ → Prop},
    (∀ {a : α} (h : r a b✝), P a (_ : TransGen r a b✝)) →
      (∀ {a c : α} (h' : r a c) (h : TransGen r c b✝), P c h → P a (_ : TransGen r a b✝)) → P a a✝¹
P : (a : α) → TransGen r a c✝ → Prop
base : ∀ {a : α} (h : r a c✝), P a (_ : TransGen r a c✝)
ih : ∀ {a c : α} (h' : r a c) (h : TransGen r c c✝), P c h → P a (_ : TransGen r a c✝)
⊢ P a (_ : TransGen r a c✝)

Next tactic:
case single a h => exact base h
@[elab_as_elim]
theorem head_induction_on {P : ∀ a : α, TransGen r a b → Prop} {a : α} (h : TransGen r a b)
    (base : ∀ {a} (h : r a b), P a (single h))
    (ih : ∀ {a c} (h' : r a c) (h : TransGen r c b), P c h → P a (h.head h')) : P a h := by
  induction h
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a✝¹ b c d a✝ a : α
h : r a✝ a
P : (a_1 : α) → TransGen r a_1 a → Prop
base : ∀ {a_1 : α} (h : r a_1 a), P a_1 (_ : TransGen r a_1 a)
ih : ∀ {a_1 c : α} (h' : r a_1 c) (h : TransGen r c a), P c h → P a_1 (_ : TransGen r a_1 a)
⊢ P a✝ (_ : TransGen r a✝ a)

Next tactic:
case single a h => exact base h
@[elab_as_elim]
theorem head_induction_on {P : ∀ a : α, TransGen r a b → Prop} {a : α} (h : TransGen r a b)
    (base : ∀ {a} (h : r a b), P a (single h))
    (ih : ∀ {a c} (h' : r a c) (h : TransGen r c b), P c h → P a (h.head h')) : P a h := by
  induction h
  case single a h => 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a✝¹ b c d a✝ a : α
h : r a✝ a
P : (a_1 : α) → TransGen r a_1 a → Prop
base : ∀ {a_1 : α} (h : r a_1 a), P a_1 (_ : TransGen r a_1 a)
ih : ∀ {a_1 c : α} (h' : r a_1 c) (h : TransGen r c a), P c h → P a_1 (_ : TransGen r a_1 a)
⊢ P a✝ (_ : TransGen r a✝ a)

Next tactic:
exact base h
@[elab_as_elim]
theorem head_induction_on {P : ∀ a : α, TransGen r a b → Prop} {a : α} (h : TransGen r a b)
    (base : ∀ {a} (h : r a b), P a (single h))
    (ih : ∀ {a c} (h' : r a c) (h : TransGen r c b), P c h → P a (h.head h')) : P a h := by
  induction h
  case single a h => exact base h
  

Proof state:
case tail
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a✝² b c d a b✝ c✝ : α
a✝¹ : TransGen r a b✝
a✝ : r b✝ c✝
a_ih✝ :
  ∀ {P : (a : α) → TransGen r a b✝ → Prop},
    (∀ {a : α} (h : r a b✝), P a (_ : TransGen r a b✝)) →
      (∀ {a c : α} (h' : r a c) (h : TransGen r c b✝), P c h → P a (_ : TransGen r a b✝)) → P a a✝¹
P : (a : α) → TransGen r a c✝ → Prop
base : ∀ {a : α} (h : r a c✝), P a (_ : TransGen r a c✝)
ih : ∀ {a c : α} (h' : r a c) (h : TransGen r c c✝), P c h → P a (_ : TransGen r a c✝)
⊢ P a (_ : TransGen r a c✝)

Next tactic:
case tail b c _ hbc h_ih =>
  -- Lean 3 could figure out the motive and `apply h_ih` worked
  refine @h_ih (λ {a : α} (hab : @TransGen α r a b) => P a (TransGen.tail hab hbc)) ?_ ?_;
  exact fun h ↦ ih h (single hbc) (base hbc)
  exact fun hab hbc ↦ ih hab _
@[elab_as_elim]
theorem head_induction_on {P : ∀ a : α, TransGen r a b → Prop} {a : α} (h : TransGen r a b)
    (base : ∀ {a} (h : r a b), P a (single h))
    (ih : ∀ {a c} (h' : r a c) (h : TransGen r c b), P c h → P a (h.head h')) : P a h := by
  induction h
  case single a h => exact base h
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a✝¹ b✝ c✝ d a b c : α
a✝ : TransGen r a b
hbc : r b c
h_ih :
  ∀ {P : (a : α) → TransGen r a b → Prop},
    (∀ {a : α} (h : r a b), P a (_ : TransGen r a b)) →
      (∀ {a c : α} (h' : r a c) (h : TransGen r c b), P c h → P a (_ : TransGen r a b)) → P a a✝
P : (a : α) → TransGen r a c → Prop
base : ∀ {a : α} (h : r a c), P a (_ : TransGen r a c)
ih : ∀ {a c_1 : α} (h' : r a c_1) (h : TransGen r c_1 c), P c_1 h → P a (_ : TransGen r a c)
⊢ P a (_ : TransGen r a c)

Next tactic:
case tail b c _ hbc h_ih =>
  -- Lean 3 could figure out the motive and `apply h_ih` worked
  refine @h_ih (λ {a : α} (hab : @TransGen α r a b) => P a (TransGen.tail hab hbc)) ?_ ?_;
  exact fun h ↦ ih h (single hbc) (base hbc)
  exact fun hab hbc ↦ ih hab _
@[elab_as_elim]
theorem head_induction_on {P : ∀ a : α, TransGen r a b → Prop} {a : α} (h : TransGen r a b)
    (base : ∀ {a} (h : r a b), P a (single h))
    (ih : ∀ {a c} (h' : r a c) (h : TransGen r c b), P c h → P a (h.head h')) : P a h := by
  induction h
  case single a h => exact base h
  case tail b c _ hbc h_ih =>
  -- Lean 3 could figure out the motive and `apply h_ih` worked
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a✝¹ b✝ c✝ d a b c : α
a✝ : TransGen r a b
hbc : r b c
h_ih :
  ∀ {P : (a : α) → TransGen r a b → Prop},
    (∀ {a : α} (h : r a b), P a (_ : TransGen r a b)) →
      (∀ {a c : α} (h' : r a c) (h : TransGen r c b), P c h → P a (_ : TransGen r a b)) → P a a✝
P : (a : α) → TransGen r a c → Prop
base : ∀ {a : α} (h : r a c), P a (_ : TransGen r a c)
ih : ∀ {a c_1 : α} (h' : r a c_1) (h : TransGen r c_1 c), P c_1 h → P a (_ : TransGen r a c)
⊢ P a (_ : TransGen r a c)

Next tactic:
refine @h_ih (λ {a : α} (hab : @TransGen α r a b) => P a (TransGen.tail hab hbc)) ?_ ?_
@[elab_as_elim]
theorem head_induction_on {P : ∀ a : α, TransGen r a b → Prop} {a : α} (h : TransGen r a b)
    (base : ∀ {a} (h : r a b), P a (single h))
    (ih : ∀ {a c} (h' : r a c) (h : TransGen r c b), P c h → P a (h.head h')) : P a h := by
  induction h
  case single a h => exact base h
  case tail b c _ hbc h_ih =>
  -- Lean 3 could figure out the motive and `apply h_ih` worked
  refine @h_ih (λ {a : α} (hab : @TransGen α r a b) => P a (TransGen.tail hab hbc)) ?_ ?_;
  

Proof state:
case refine_1
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a✝¹ b✝ c✝ d a b c : α
a✝ : TransGen r a b
hbc : r b c
h_ih :
  ∀ {P : (a : α) → TransGen r a b → Prop},
    (∀ {a : α} (h : r a b), P a (_ : TransGen r a b)) →
      (∀ {a c : α} (h' : r a c) (h : TransGen r c b), P c h → P a (_ : TransGen r a b)) → P a a✝
P : (a : α) → TransGen r a c → Prop
base : ∀ {a : α} (h : r a c), P a (_ : TransGen r a c)
ih : ∀ {a c_1 : α} (h' : r a c_1) (h : TransGen r c_1 c), P c_1 h → P a (_ : TransGen r a c)
⊢ ∀ {a : α} (h : r a b), (fun {a} hab => P a (_ : TransGen r a c)) (_ : TransGen r a b)
case refine_2
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a✝¹ b✝ c✝ d a b c : α
a✝ : TransGen r a b
hbc : r b c
h_ih :
  ∀ {P : (a : α) → TransGen r a b → Prop},
    (∀ {a : α} (h : r a b), P a (_ : TransGen r a b)) →
      (∀ {a c : α} (h' : r a c) (h : TransGen r c b), P c h → P a (_ : TransGen r a b)) → P a a✝
P : (a : α) → TransGen r a c → Prop
base : ∀ {a : α} (h : r a c), P a (_ : TransGen r a c)
ih : ∀ {a c_1 : α} (h' : r a c_1) (h : TransGen r c_1 c), P c_1 h → P a (_ : TransGen r a c)
⊢ ∀ {a c_1 : α} (h' : r a c_1) (h : TransGen r c_1 b),
    (fun {a} hab => P a (_ : TransGen r a c)) h → (fun {a} hab => P a (_ : TransGen r a c)) (_ : TransGen r a b)

Next tactic:
exact fun h ↦ ih h (single hbc) (base hbc)
@[elab_as_elim]
theorem head_induction_on {P : ∀ a : α, TransGen r a b → Prop} {a : α} (h : TransGen r a b)
    (base : ∀ {a} (h : r a b), P a (single h))
    (ih : ∀ {a c} (h' : r a c) (h : TransGen r c b), P c h → P a (h.head h')) : P a h := by
  induction h
  case single a h => exact base h
  case tail b c _ hbc h_ih =>
  -- Lean 3 could figure out the motive and `apply h_ih` worked
  refine @h_ih (λ {a : α} (hab : @TransGen α r a b) => P a (TransGen.tail hab hbc)) ?_ ?_;
  exact fun h ↦ ih h (single hbc) (base hbc)
  

Proof state:
case refine_2
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a✝¹ b✝ c✝ d a b c : α
a✝ : TransGen r a b
hbc : r b c
h_ih :
  ∀ {P : (a : α) → TransGen r a b → Prop},
    (∀ {a : α} (h : r a b), P a (_ : TransGen r a b)) →
      (∀ {a c : α} (h' : r a c) (h : TransGen r c b), P c h → P a (_ : TransGen r a b)) → P a a✝
P : (a : α) → TransGen r a c → Prop
base : ∀ {a : α} (h : r a c), P a (_ : TransGen r a c)
ih : ∀ {a c_1 : α} (h' : r a c_1) (h : TransGen r c_1 c), P c_1 h → P a (_ : TransGen r a c)
⊢ ∀ {a c_1 : α} (h' : r a c_1) (h : TransGen r c_1 b),
    (fun {a} hab => P a (_ : TransGen r a c)) h → (fun {a} hab => P a (_ : TransGen r a c)) (_ : TransGen r a b)

Next tactic:
exact fun hab hbc ↦ ih hab _
@[elab_as_elim]
theorem trans_induction_on {P : ∀ {a b : α}, TransGen r a b → Prop} {a b : α} (h : TransGen r a b)
    (base : ∀ {a b} (h : r a b), P (single h))
    (ih : ∀ {a b c} (h₁ : TransGen r a b) (h₂ : TransGen r b c), P h₁ → P h₂ → P (h₁.trans h₂)) :
    P h := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a✝ b✝ c d : α
P : {a b : α} → TransGen r a b → Prop
a b : α
h : TransGen r a b
base : ∀ {a b : α} (h : r a b), P (_ : TransGen r a b)
ih : ∀ {a b c : α} (h₁ : TransGen r a b) (h₂ : TransGen r b c), P h₁ → P h₂ → P (_ : TransGen r a c)
⊢ P h

Next tactic:
induction h with
  | single h => exact base h
  | tail hab hbc h_ih => exact ih hab (single hbc) h_ih (base hbc)
@[elab_as_elim]
theorem trans_induction_on {P : ∀ {a b : α}, TransGen r a b → Prop} {a b : α} (h : TransGen r a b)
    (base : ∀ {a b} (h : r a b), P (single h))
    (ih : ∀ {a b c} (h₁ : TransGen r a b) (h₂ : TransGen r b c), P h₁ → P h₂ → P (h₁.trans h₂)) :
    P h := by
  induction h with
  

Proof state:
case single
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a✝ b✝¹ c d : α
P : {a b : α} → TransGen r a b → Prop
a b : α
base : ∀ {a b : α} (h : r a b), P (_ : TransGen r a b)
ih : ∀ {a b c : α} (h₁ : TransGen r a b) (h₂ : TransGen r b c), P h₁ → P h₂ → P (_ : TransGen r a c)
b✝ : α
h : r a b✝
⊢ P (_ : TransGen r a b✝)

Next tactic:
| single h => exact base h
@[elab_as_elim]
theorem trans_induction_on {P : ∀ {a b : α}, TransGen r a b → Prop} {a b : α} (h : TransGen r a b)
    (base : ∀ {a b} (h : r a b), P (single h))
    (ih : ∀ {a b c} (h₁ : TransGen r a b) (h₂ : TransGen r b c), P h₁ → P h₂ → P (h₁.trans h₂)) :
    P h := by
  induction h with
  | single h => 

Proof state:
case single
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a✝ b✝¹ c d : α
P : {a b : α} → TransGen r a b → Prop
a b : α
base : ∀ {a b : α} (h : r a b), P (_ : TransGen r a b)
ih : ∀ {a b c : α} (h₁ : TransGen r a b) (h₂ : TransGen r b c), P h₁ → P h₂ → P (_ : TransGen r a c)
b✝ : α
h : r a b✝
⊢ P (_ : TransGen r a b✝)

Next tactic:
exact base h
@[elab_as_elim]
theorem trans_induction_on {P : ∀ {a b : α}, TransGen r a b → Prop} {a b : α} (h : TransGen r a b)
    (base : ∀ {a b} (h : r a b), P (single h))
    (ih : ∀ {a b c} (h₁ : TransGen r a b) (h₂ : TransGen r b c), P h₁ → P h₂ → P (h₁.trans h₂)) :
    P h := by
  induction h with
  | single h => exact base h
  

Proof state:
case tail
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a✝ b✝¹ c d : α
P : {a b : α} → TransGen r a b → Prop
a b : α
base : ∀ {a b : α} (h : r a b), P (_ : TransGen r a b)
ih : ∀ {a b c : α} (h₁ : TransGen r a b) (h₂ : TransGen r b c), P h₁ → P h₂ → P (_ : TransGen r a c)
b✝ c✝ : α
hab : TransGen r a b✝
hbc : r b✝ c✝
h_ih : P hab
⊢ P (_ : TransGen r a c✝)

Next tactic:
| tail hab hbc h_ih => exact ih hab (single hbc) h_ih (base hbc)
@[elab_as_elim]
theorem trans_induction_on {P : ∀ {a b : α}, TransGen r a b → Prop} {a b : α} (h : TransGen r a b)
    (base : ∀ {a b} (h : r a b), P (single h))
    (ih : ∀ {a b c} (h₁ : TransGen r a b) (h₂ : TransGen r b c), P h₁ → P h₂ → P (h₁.trans h₂)) :
    P h := by
  induction h with
  | single h => exact base h
  | tail hab hbc h_ih => 

Proof state:
case tail
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a✝ b✝¹ c d : α
P : {a b : α} → TransGen r a b → Prop
a b : α
base : ∀ {a b : α} (h : r a b), P (_ : TransGen r a b)
ih : ∀ {a b c : α} (h₁ : TransGen r a b) (h₂ : TransGen r b c), P h₁ → P h₂ → P (_ : TransGen r a c)
b✝ c✝ : α
hab : TransGen r a b✝
hbc : r b✝ c✝
h_ih : P hab
⊢ P (_ : TransGen r a c✝)

Next tactic:
exact ih hab (single hbc) h_ih (base hbc)
theorem trans_right (hab : ReflTransGen r a b) (hbc : TransGen r b c) : TransGen r a c := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c d : α
hab : ReflTransGen r a b
hbc : TransGen r b c
⊢ TransGen r a c

Next tactic:
induction hbc
theorem trans_right (hab : ReflTransGen r a b) (hbc : TransGen r b c) : TransGen r a c := by
  induction hbc
  

Proof state:
case single
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c d : α
hab : ReflTransGen r a b
b✝ : α
a✝ : r b b✝
⊢ TransGen r a b✝
case tail
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c d : α
hab : ReflTransGen r a b
b✝ c✝ : α
a✝¹ : TransGen r b b✝
a✝ : r b✝ c✝
a_ih✝ : TransGen r a b✝
⊢ TransGen r a c✝

Next tactic:
case single c hbc => exact tail' hab hbc
theorem trans_right (hab : ReflTransGen r a b) (hbc : TransGen r b c) : TransGen r a c := by
  induction hbc
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c✝ d : α
hab : ReflTransGen r a b
c : α
hbc : r b c
⊢ TransGen r a c

Next tactic:
case single c hbc => exact tail' hab hbc
theorem trans_right (hab : ReflTransGen r a b) (hbc : TransGen r b c) : TransGen r a c := by
  induction hbc
  case single c hbc => 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c✝ d : α
hab : ReflTransGen r a b
c : α
hbc : r b c
⊢ TransGen r a c

Next tactic:
exact tail' hab hbc
theorem trans_right (hab : ReflTransGen r a b) (hbc : TransGen r b c) : TransGen r a c := by
  induction hbc
  case single c hbc => exact tail' hab hbc
  

Proof state:
case tail
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c d : α
hab : ReflTransGen r a b
b✝ c✝ : α
a✝¹ : TransGen r b b✝
a✝ : r b✝ c✝
a_ih✝ : TransGen r a b✝
⊢ TransGen r a c✝

Next tactic:
case tail c d _ hcd hac => exact hac.tail hcd
theorem trans_right (hab : ReflTransGen r a b) (hbc : TransGen r b c) : TransGen r a c := by
  induction hbc
  case single c hbc => exact tail' hab hbc
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c✝ d✝ : α
hab : ReflTransGen r a b
c d : α
a✝ : TransGen r b c
hcd : r c d
hac : TransGen r a c
⊢ TransGen r a d

Next tactic:
case tail c d _ hcd hac => exact hac.tail hcd
theorem trans_right (hab : ReflTransGen r a b) (hbc : TransGen r b c) : TransGen r a c := by
  induction hbc
  case single c hbc => exact tail' hab hbc
  case tail c d _ hcd hac => 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c✝ d✝ : α
hab : ReflTransGen r a b
c d : α
a✝ : TransGen r b c
hcd : r c d
hac : TransGen r a c
⊢ TransGen r a d

Next tactic:
exact hac.tail hcd
theorem tail'_iff : TransGen r a c ↔ ∃ b, ReflTransGen r a b ∧ r b c := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c d : α
⊢ TransGen r a c ↔ ∃ b, ReflTransGen r a b ∧ r b c

Next tactic:
refine' ⟨fun h ↦ _, fun ⟨b, hab, hbc⟩ ↦ tail' hab hbc⟩
theorem tail'_iff : TransGen r a c ↔ ∃ b, ReflTransGen r a b ∧ r b c := by
  refine' ⟨fun h ↦ _, fun ⟨b, hab, hbc⟩ ↦ tail' hab hbc⟩
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c d : α
h : TransGen r a c
⊢ ∃ b, ReflTransGen r a b ∧ r b c

Next tactic:
cases' h with _ hac b _ hab hbc
theorem tail'_iff : TransGen r a c ↔ ∃ b, ReflTransGen r a b ∧ r b c := by
  refine' ⟨fun h ↦ _, fun ⟨b, hab, hbc⟩ ↦ tail' hab hbc⟩
  cases' h with _ hac b _ hab hbc
  · 

Proof state:
case single
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c d : α
hac : r a c
⊢ ∃ b, ReflTransGen r a b ∧ r b c

Next tactic:
exact ⟨_, by rfl, hac⟩
theorem tail'_iff : TransGen r a c ↔ ∃ b, ReflTransGen r a b ∧ r b c := by
  refine' ⟨fun h ↦ _, fun ⟨b, hab, hbc⟩ ↦ tail' hab hbc⟩
  cases' h with _ hac b _ hab hbc
  · exact ⟨_, by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c d : α
hac : r a c
⊢ ReflTransGen r a a

Next tactic:
rfl
theorem tail'_iff : TransGen r a c ↔ ∃ b, ReflTransGen r a b ∧ r b c := by
  refine' ⟨fun h ↦ _, fun ⟨b, hab, hbc⟩ ↦ tail' hab hbc⟩
  cases' h with _ hac b _ hab hbc
  · exact ⟨_, by rfl, hac⟩
  · 

Proof state:
case tail
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b✝ c d b : α
hab : TransGen r a b
hbc : r b c
⊢ ∃ b, ReflTransGen r a b ∧ r b c

Next tactic:
exact ⟨_, hab.to_reflTransGen, hbc⟩
theorem head'_iff : TransGen r a c ↔ ∃ b, r a b ∧ ReflTransGen r b c := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c d : α
⊢ TransGen r a c ↔ ∃ b, r a b ∧ ReflTransGen r b c

Next tactic:
refine' ⟨fun h ↦ _, fun ⟨b, hab, hbc⟩ ↦ head' hab hbc⟩
theorem head'_iff : TransGen r a c ↔ ∃ b, r a b ∧ ReflTransGen r b c := by
  refine' ⟨fun h ↦ _, fun ⟨b, hab, hbc⟩ ↦ head' hab hbc⟩
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c d : α
h : TransGen r a c
⊢ ∃ b, r a b ∧ ReflTransGen r b c

Next tactic:
induction h
theorem head'_iff : TransGen r a c ↔ ∃ b, r a b ∧ ReflTransGen r b c := by
  refine' ⟨fun h ↦ _, fun ⟨b, hab, hbc⟩ ↦ head' hab hbc⟩
  induction h
  

Proof state:
case single
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c d b✝ : α
a✝ : r a b✝
⊢ ∃ b, r a b ∧ ReflTransGen r b b✝
case tail
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c d b✝ c✝ : α
a✝¹ : TransGen r a b✝
a✝ : r b✝ c✝
a_ih✝ : ∃ b, r a b ∧ ReflTransGen r b b✝
⊢ ∃ b, r a b ∧ ReflTransGen r b c✝

Next tactic:
case single c hac => exact ⟨_, hac, by rfl⟩
theorem head'_iff : TransGen r a c ↔ ∃ b, r a b ∧ ReflTransGen r b c := by
  refine' ⟨fun h ↦ _, fun ⟨b, hab, hbc⟩ ↦ head' hab hbc⟩
  induction h
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c✝ d c : α
hac : r a c
⊢ ∃ b, r a b ∧ ReflTransGen r b c

Next tactic:
case single c hac => exact ⟨_, hac, by rfl⟩
theorem head'_iff : TransGen r a c ↔ ∃ b, r a b ∧ ReflTransGen r b c := by
  refine' ⟨fun h ↦ _, fun ⟨b, hab, hbc⟩ ↦ head' hab hbc⟩
  induction h
  case single c hac => 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c✝ d c : α
hac : r a c
⊢ ∃ b, r a b ∧ ReflTransGen r b c

Next tactic:
exact ⟨_, hac, by rfl⟩
theorem head'_iff : TransGen r a c ↔ ∃ b, r a b ∧ ReflTransGen r b c := by
  refine' ⟨fun h ↦ _, fun ⟨b, hab, hbc⟩ ↦ head' hab hbc⟩
  induction h
  case single c hac => exact ⟨_, hac, by 

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c✝ d c : α
hac : r a c
⊢ ReflTransGen r c c

Next tactic:
rfl
theorem head'_iff : TransGen r a c ↔ ∃ b, r a b ∧ ReflTransGen r b c := by
  refine' ⟨fun h ↦ _, fun ⟨b, hab, hbc⟩ ↦ head' hab hbc⟩
  induction h
  case single c hac => exact ⟨_, hac, by rfl⟩
  

Proof state:
case tail
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c d b✝ c✝ : α
a✝¹ : TransGen r a b✝
a✝ : r b✝ c✝
a_ih✝ : ∃ b, r a b ∧ ReflTransGen r b b✝
⊢ ∃ b, r a b ∧ ReflTransGen r b c✝

Next tactic:
case tail b c _ hbc IH =>
  rcases IH with ⟨d, had, hdb⟩
  exact ⟨_, had, hdb.tail hbc⟩
theorem head'_iff : TransGen r a c ↔ ∃ b, r a b ∧ ReflTransGen r b c := by
  refine' ⟨fun h ↦ _, fun ⟨b, hab, hbc⟩ ↦ head' hab hbc⟩
  induction h
  case single c hac => exact ⟨_, hac, by rfl⟩
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b✝ c✝ d b c : α
a✝ : TransGen r a b
hbc : r b c
IH : ∃ b_1, r a b_1 ∧ ReflTransGen r b_1 b
⊢ ∃ b, r a b ∧ ReflTransGen r b c

Next tactic:
case tail b c _ hbc IH =>
  rcases IH with ⟨d, had, hdb⟩
  exact ⟨_, had, hdb.tail hbc⟩
theorem head'_iff : TransGen r a c ↔ ∃ b, r a b ∧ ReflTransGen r b c := by
  refine' ⟨fun h ↦ _, fun ⟨b, hab, hbc⟩ ↦ head' hab hbc⟩
  induction h
  case single c hac => exact ⟨_, hac, by rfl⟩
  case tail b c _ hbc IH =>
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b✝ c✝ d b c : α
a✝ : TransGen r a b
hbc : r b c
IH : ∃ b_1, r a b_1 ∧ ReflTransGen r b_1 b
⊢ ∃ b, r a b ∧ ReflTransGen r b c

Next tactic:
rcases IH with ⟨d, had, hdb⟩
theorem head'_iff : TransGen r a c ↔ ∃ b, r a b ∧ ReflTransGen r b c := by
  refine' ⟨fun h ↦ _, fun ⟨b, hab, hbc⟩ ↦ head' hab hbc⟩
  induction h
  case single c hac => exact ⟨_, hac, by rfl⟩
  case tail b c _ hbc IH =>
  rcases IH with ⟨d, had, hdb⟩
  

Proof state:
case intro.intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b✝ c✝ d✝ b c : α
a✝ : TransGen r a b
hbc : r b c
d : α
had : r a d
hdb : ReflTransGen r d b
⊢ ∃ b, r a b ∧ ReflTransGen r b c

Next tactic:
exact ⟨_, had, hdb.tail hbc⟩
theorem _root_.Acc.TransGen (h : Acc r a) : Acc (TransGen r) a := by
  

Proof state:
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c d : α
h : Acc r a
⊢ Acc (Relation.TransGen r) a

Next tactic:
induction' h with x _ H
theorem _root_.Acc.TransGen (h : Acc r a) : Acc (TransGen r) a := by
  induction' h with x _ H
  

Proof state:
case intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c d x : α
h✝ : ∀ (y : α), r y x → Acc r y
H : ∀ (y : α), r y x → Acc (Relation.TransGen r) y
⊢ Acc (Relation.TransGen r) x

Next tactic:
refine' Acc.intro x fun y hy ↦ _
theorem _root_.Acc.TransGen (h : Acc r a) : Acc (TransGen r) a := by
  induction' h with x _ H
  refine' Acc.intro x fun y hy ↦ _
  

Proof state:
case intro
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c d x : α
h✝ : ∀ (y : α), r y x → Acc r y
H : ∀ (y : α), r y x → Acc (Relation.TransGen r) y
y : α
hy : Relation.TransGen r y x
⊢ Acc (Relation.TransGen r) y

Next tactic:
cases' hy with _ hyx z _ hyz hzx
theorem _root_.Acc.TransGen (h : Acc r a) : Acc (TransGen r) a := by
  induction' h with x _ H
  refine' Acc.intro x fun y hy ↦ _
  cases' hy with _ hyx z _ hyz hzx
  

Proof state:
case intro.single
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c d x : α
h✝ : ∀ (y : α), r y x → Acc r y
H : ∀ (y : α), r y x → Acc (Relation.TransGen r) y
y : α
hyx : r y x
⊢ Acc (Relation.TransGen r) y
case intro.tail
α : Type u_1
β : Type u_2
γ : Type u_3
δ : Type u_4
ε : Type u_5
ζ : Type u_6
r : α → α → Prop
a b c d x : α
h✝ : ∀ (y : α), r y x → Acc r y
H : ∀ (y : α), r y x → Acc (Relation.TransGen r) y
y z : α
hyz : Relation.TransGen r y z
hzx : r z x
⊢ Acc (Relation.TransGen r) y

Next tactic:
exacts [H y hyx, (H z hzx).inv hyz]