Theorem: List.tfae_of_cycle
File: Mathlib/Data/List/TFAE.lean

tactic: induction l generalizing a b with
| nil => simp_all [tfae_cons_cons, iff_def]
| cons c l IH =>
  simp only [tfae_cons_cons, getLastD_cons, tfae_singleton, and_true, chain_cons, Chain.nil] at *
  rcases h_chain with ⟨ab, ⟨bc, ch⟩⟩
  have := IH ⟨bc, ch⟩ (ab ∘ h_last)
  exact ⟨⟨ab, h_last ∘ (this.2 c (.head _) _ (getLastD_mem_cons _ _)).1 ∘ bc⟩, this⟩
state_before: a b : Prop
l : List Prop
h_chain : Chain (fun x x_1 => x → x_1) a (b :: l)
h_last : l.getLastD b → a
⊢ (a :: b :: l).TFAE
state_after: no goals

tactic: simp_all [tfae_cons_cons, iff_def]
state_before: case nil
a b : Prop
h_chain : Chain (fun x x_1 => x → x_1) a [b]
h_last : [].getLastD b → a
⊢ [a, b].TFAE
state_after: no goals

tactic: simp only [tfae_cons_cons, getLastD_cons, tfae_singleton, and_true, chain_cons, Chain.nil] at *
state_before: case cons
c : Prop
l : List Prop
IH : ∀ {a b : Prop}, Chain (fun x x_1 => x → x_1) a (b :: l) → (l.getLastD b → a) → (a :: b :: l).TFAE
a b : Prop
h_chain : Chain (fun x x_1 => x → x_1) a (b :: c :: l)
h_last : (c :: l).getLastD b → a
⊢ (a :: b :: c :: l).TFAE
state_after: case cons
c : Prop
l : List Prop
a b : Prop
IH : ∀ {a b : Prop}, (a → b) ∧ Chain (fun x x_1 => x → x_1) b l → (l.getLastD b → a) → (a ↔ b) ∧ (b :: l).TFAE
h_chain : (a → b) ∧ (b → c) ∧ Chain (fun x x_1 => x → x_1) c l
h_last : l.getLastD c → a
⊢ (a ↔ b) ∧ (b ↔ c) ∧ (c :: l).TFAE

tactic: rcases h_chain with ⟨ab, ⟨bc, ch⟩⟩
state_before: case cons
c : Prop
l : List Prop
a b : Prop
IH : ∀ {a b : Prop}, (a → b) ∧ Chain (fun x x_1 => x → x_1) b l → (l.getLastD b → a) → (a ↔ b) ∧ (b :: l).TFAE
h_chain : (a → b) ∧ (b → c) ∧ Chain (fun x x_1 => x → x_1) c l
h_last : l.getLastD c → a
⊢ (a ↔ b) ∧ (b ↔ c) ∧ (c :: l).TFAE
state_after: case cons.intro.intro
c : Prop
l : List Prop
a b : Prop
IH : ∀ {a b : Prop}, (a → b) ∧ Chain (fun x x_1 => x → x_1) b l → (l.getLastD b → a) → (a ↔ b) ∧ (b :: l).TFAE
h_last : l.getLastD c → a
ab : a → b
bc : b → c
ch : Chain (fun x x_1 => x → x_1) c l
⊢ (a ↔ b) ∧ (b ↔ c) ∧ (c :: l).TFAE

tactic: have := IH ⟨bc, ch⟩ (ab ∘ h_last)
state_before: case cons.intro.intro
c : Prop
l : List Prop
a b : Prop
IH : ∀ {a b : Prop}, (a → b) ∧ Chain (fun x x_1 => x → x_1) b l → (l.getLastD b → a) → (a ↔ b) ∧ (b :: l).TFAE
h_last : l.getLastD c → a
ab : a → b
bc : b → c
ch : Chain (fun x x_1 => x → x_1) c l
⊢ (a ↔ b) ∧ (b ↔ c) ∧ (c :: l).TFAE
state_after: case cons.intro.intro
c : Prop
l : List Prop
a b : Prop
IH : ∀ {a b : Prop}, (a → b) ∧ Chain (fun x x_1 => x → x_1) b l → (l.getLastD b → a) → (a ↔ b) ∧ (b :: l).TFAE
h_last : l.getLastD c → a
ab : a → b
bc : b → c
ch : Chain (fun x x_1 => x → x_1) c l
this : (b ↔ c) ∧ (c :: l).TFAE
⊢ (a ↔ b) ∧ (b ↔ c) ∧ (c :: l).TFAE

tactic: exact ⟨⟨ab, h_last ∘ (this.2 c (.head _) _ (getLastD_mem_cons _ _)).1 ∘ bc⟩, this⟩
state_before: case cons.intro.intro
c : Prop
l : List Prop
a b : Prop
IH : ∀ {a b : Prop}, (a → b) ∧ Chain (fun x x_1 => x → x_1) b l → (l.getLastD b → a) → (a ↔ b) ∧ (b :: l).TFAE
h_last : l.getLastD c → a
ab : a → b
bc : b → c
ch : Chain (fun x x_1 => x → x_1) c l
this : (b ↔ c) ∧ (c :: l).TFAE
⊢ (a ↔ b) ∧ (b ↔ c) ∧ (c :: l).TFAE
state_after: no goals