Theorem: Cycle.chain_iff_pairwise
File: Mathlib/Data/List/Cycle.lean

tactic: induction' s using Cycle.induction_on with a l _
state_before: α : Type u_1
r : α → α → Prop
s : Cycle α
inst✝ : IsTrans α r
⊢ Chain r s → ∀ (a : α), a ∈ s → ∀ (b : α), b ∈ s → r a b

tactic: intro hs b hb c hc
state_before: case HI
α : Type u_1
r : α → α → Prop
s : Cycle α
inst✝ : IsTrans α r
a : α
l : List α
a✝ : Chain r ↑l → ∀ (a : α), a ∈ ↑l → ∀ (b : α), b ∈ ↑l → r a b
⊢ Chain r ↑(a :: l) → ∀ (a_2 : α), a_2 ∈ ↑(a :: l) → ∀ (b : α), b ∈ ↑(a :: l) → r a_2 b

tactic: rw [Cycle.chain_coe_cons, List.chain_iff_pairwise] at hs
state_before: case HI
α : Type u_1
r : α → α → Prop
s : Cycle α
inst✝ : IsTrans α r
a : α
l : List α
a✝ : Chain r ↑l → ∀ (a : α), a ∈ ↑l → ∀ (b : α), b ∈ ↑l → r a b
hs : Chain r ↑(a :: l)
b : α
hb : b ∈ ↑(a :: l)
c : α
hc : c ∈ ↑(a :: l)
⊢ r b c

tactic: simp only [pairwise_append, pairwise_cons, mem_append, mem_singleton, List.not_mem_nil,
  IsEmpty.forall_iff, imp_true_iff, Pairwise.nil, forall_eq, true_and_iff] at hs
state_before: case HI
α : Type u_1
r : α → α → Prop
s : Cycle α
inst✝ : IsTrans α r
a : α
l : List α
a✝ : Chain r ↑l → ∀ (a : α), a ∈ ↑l → ∀ (b : α), b ∈ ↑l → r a b
hs : List.Pairwise r (a :: (l ++ [a]))
b : α
hb : b ∈ ↑(a :: l)
c : α
hc : c ∈ ↑(a :: l)
⊢ r b c

tactic: simp only [mem_coe_iff, mem_cons] at hb hc
state_before: case HI
α : Type u_1
r : α → α → Prop
s : Cycle α
inst✝ : IsTrans α r
a : α
l : List α
a✝ : Chain r ↑l → ∀ (a : α), a ∈ ↑l → ∀ (b : α), b ∈ ↑l → r a b
b : α
hb : b ∈ ↑(a :: l)
c : α
hc : c ∈ ↑(a :: l)
hs : (∀ (a' : α), a' ∈ l ∨ a' = a → r a a') ∧ List.Pairwise r l ∧ ∀ (a_1 : α), a_1 ∈ l → r a_1 a
⊢ r b c

tactic: rcases hb with (rfl | hb) <;> rcases hc with (rfl | hc)
state_before: case HI
α : Type u_1
r : α → α → Prop
s : Cycle α
inst✝ : IsTrans α r
a : α
l : List α
a✝ : Chain r ↑l → ∀ (a : α), a ∈ ↑l → ∀ (b : α), b ∈ ↑l → r a b
b c : α
hs : (∀ (a' : α), a' ∈ l ∨ a' = a → r a a') ∧ List.Pairwise r l ∧ ∀ (a_1 : α), a_1 ∈ l → r a_1 a
hb : b = a ∨ b ∈ l
hc : c = a ∨ c ∈ l
⊢ r b c

tactic: exact fun _ b hb => (not_mem_nil _ hb).elim
state_before: case H0
α : Type u_1
r : α → α → Prop
s : Cycle α
inst✝ : IsTrans α r
⊢ Chain r nil → ∀ (a : α), a ∈ nil → ∀ (b : α), b ∈ nil → r a b

tactic: exact hs.1 c (Or.inr rfl)
state_before: case HI.inl.inl
α : Type u_1
r : α → α → Prop
s : Cycle α
inst✝ : IsTrans α r
l : List α
a✝ : Chain r ↑l → ∀ (a : α), a ∈ ↑l → ∀ (b : α), b ∈ ↑l → r a b
c : α
hs : (∀ (a' : α), a' ∈ l ∨ a' = c → r c a') ∧ List.Pairwise r l ∧ ∀ (a : α), a ∈ l → r a c
⊢ r c c

tactic: exact hs.1 c (Or.inl hc)
state_before: case HI.inl.inr
α : Type u_1
r : α → α → Prop
s : Cycle α
inst✝ : IsTrans α r
l : List α
a✝ : Chain r ↑l → ∀ (a : α), a ∈ ↑l → ∀ (b : α), b ∈ ↑l → r a b
b c : α
hs : (∀ (a' : α), a' ∈ l ∨ a' = b → r b a') ∧ List.Pairwise r l ∧ ∀ (a : α), a ∈ l → r a b
hc : c ∈ l
⊢ r b c

tactic: exact hs.2.2 b hb
state_before: case HI.inr.inl
α : Type u_1
r : α → α → Prop
s : Cycle α
inst✝ : IsTrans α r
l : List α
a✝ : Chain r ↑l → ∀ (a : α), a ∈ ↑l → ∀ (b : α), b ∈ ↑l → r a b
b c : α
hb : b ∈ l
hs : (∀ (a' : α), a' ∈ l ∨ a' = c → r c a') ∧ List.Pairwise r l ∧ ∀ (a : α), a ∈ l → r a c
⊢ r b c

tactic: exact _root_.trans (hs.2.2 b hb) (hs.1 c (Or.inl hc))
state_before: case HI.inr.inr
α : Type u_1
r : α → α → Prop
s : Cycle α
inst✝ : IsTrans α r
a : α
l : List α
a✝ : Chain r ↑l → ∀ (a : α), a ∈ ↑l → ∀ (b : α), b ∈ ↑l → r a b
b c : α
hs : (∀ (a' : α), a' ∈ l ∨ a' = a → r a a') ∧ List.Pairwise r l ∧ ∀ (a_1 : α), a_1 ∈ l → r a_1 a
hb : b ∈ l
hc : c ∈ l
⊢ r b c