Theorem: DivisorChain.second_of_chain_is_irreducible
File: Mathlib/RingTheory/ChainOfDivisors.lean

Proof steps:
state_before: M : Type u_1
inst✝ : CancelCommMonoidWithZero M
q : Associates M
n : ℕ
hn : n ≠ 0
c : Fin (n + 1) → Associates M
h₁ : StrictMono c
h₂ : ∀ {r : Associates M}, r ≤ q ↔ ∃ i, r = c i
hq : q ≠ 0
⊢ Irreducible (c 1)
state_after: case zero
M : Type u_1
inst✝ : CancelCommMonoidWithZero M
q : Associates M
hq : q ≠ 0
hn : 0 ≠ 0
c : Fin (0 + 1) → Associates M
h₁ : StrictMono c
h₂ : ∀ {r : Associates M}, r ≤ q ↔ ∃ i, r = c i
⊢ Irreducible (c 1)

case succ
M : Type u_1
inst✝ : CancelCommMonoidWithZero M
q : Associates M
hq : q ≠ 0
n : ℕ
hn : n + 1 ≠ 0
c : Fin (n + 1 + 1) → Associates M
h₁ : StrictMono c
h₂ : ∀ {r : Associates M}, r ≤ q ↔ ∃ i, r = c i
⊢ Irreducible (c 1)
tactic: cases' n with n
state_before: case succ
M : Type u_1
inst✝ : CancelCommMonoidWithZero M
q : Associates M
hq : q ≠ 0
n : ℕ
hn : n + 1 ≠ 0
c : Fin (n + 1 + 1) → Associates M
h₁ : StrictMono c
h₂ : ∀ {r : Associates M}, r ≤ q ↔ ∃ i, r = c i
⊢ Irreducible (c 1)
state_after: case succ.refine_1
M : Type u_1
inst✝ : CancelCommMonoidWithZero M
q : Associates M
hq : q ≠ 0
n : ℕ
hn : n + 1 ≠ 0
c : Fin (n + 1 + 1) → Associates M
h₁ : StrictMono c
h₂ : ∀ {r : Associates M}, r ≤ q ↔ ∃ i, r = c i
⊢ c 1 ≠ ⊥

case succ.refine_2
M : Type u_1
inst✝ : CancelCommMonoidWithZero M
q : Associates M
hq : q ≠ 0
n : ℕ
hn : n + 1 ≠ 0
c : Fin (n + 1 + 1) → Associates M
h₁ : StrictMono c
h₂ : ∀ {r : Associates M}, r ≤ q ↔ ∃ i, r = c i
b : Associates M
hb : b < c 1
⊢ b = ⊥
tactic: refine (Associates.isAtom_iff (ne_zero_of_dvd_ne_zero hq (h₂.2 ⟨1, rfl⟩))).mp ⟨?_, fun b hb => ?_⟩
state_before: case succ.refine_2
M : Type u_1
inst✝ : CancelCommMonoidWithZero M
q : Associates M
hq : q ≠ 0
n : ℕ
hn : n + 1 ≠ 0
c : Fin (n + 1 + 1) → Associates M
h₁ : StrictMono c
h₂ : ∀ {r : Associates M}, r ≤ q ↔ ∃ i, r = c i
b : Associates M
hb : b < c 1
⊢ b = ⊥
state_after: case succ.refine_2.intro.mk
M : Type u_1
inst✝ : CancelCommMonoidWithZero M
q : Associates M
hq : q ≠ 0
n : ℕ
hn : n + 1 ≠ 0
c : Fin (n + 1 + 1) → Associates M
h₁ : StrictMono c
h₂ : ∀ {r : Associates M}, r ≤ q ↔ ∃ i, r = c i
i : ℕ
hi : i < n + 1 + 1
hb : c ⟨i, hi⟩ < c 1
⊢ c ⟨i, hi⟩ = ⊥
tactic: obtain ⟨⟨i, hi⟩, rfl⟩ := h₂.1 (hb.le.trans (h₂.2 ⟨1, rfl⟩))
state_before: case succ.refine_2.intro.mk
M : Type u_1
inst✝ : CancelCommMonoidWithZero M
q : Associates M
hq : q ≠ 0
n : ℕ
hn : n + 1 ≠ 0
c : Fin (n + 1 + 1) → Associates M
h₁ : StrictMono c
h₂ : ∀ {r : Associates M}, r ≤ q ↔ ∃ i, r = c i
i : ℕ
hi : i < n + 1 + 1
hb : c ⟨i, hi⟩ < c 1
⊢ c ⟨i, hi⟩ = ⊥
state_after: case succ.refine_2.intro.mk.zero
M : Type u_1
inst✝ : CancelCommMonoidWithZero M
q : Associates M
hq : q ≠ 0
n : ℕ
hn : n + 1 ≠ 0
c : Fin (n + 1 + 1) → Associates M
h₁ : StrictMono c
h₂ : ∀ {r : Associates M}, r ≤ q ↔ ∃ i, r = c i
hi : 0 < n + 1 + 1
hb : c ⟨0, hi⟩ < c 1
⊢ c ⟨0, hi⟩ = ⊥

case succ.refine_2.intro.mk.succ
M : Type u_1
inst✝ : CancelCommMonoidWithZero M
q : Associates M
hq : q ≠ 0
n : ℕ
hn : n + 1 ≠ 0
c : Fin (n + 1 + 1) → Associates M
h₁ : StrictMono c
h₂ : ∀ {r : Associates M}, r ≤ q ↔ ∃ i, r = c i
n✝ : ℕ
hi : n✝ + 1 < n + 1 + 1
hb : c ⟨n✝ + 1, hi⟩ < c 1
⊢ c ⟨n✝ + 1, hi⟩ = ⊥
tactic: cases i