English
A simplification of Exists Last Snoc Equivalence.
Русский
Упрощение эквивалентности после добавления через snoc.
LaTeX
$$$\\exists s\\_1\\ s\\_2\\; \\text{Exists Lemma for snoc equivalence (simp).}$$$
Lean4
/-- The **Jordan-Hölder** theorem, stated for any `JordanHolderLattice`.
If two composition series start and finish at the same place, they are equivalent. -/
theorem jordan_holder (s₁ s₂ : CompositionSeries X) (hb : s₁.head = s₂.head) (ht : s₁.last = s₂.last) :
Equivalent s₁ s₂ := by
induction hle : s₁.length generalizing s₁ s₂ with
| zero => rw [eq_of_head_eq_head_of_last_eq_last_of_length_eq_zero hb ht hle]
| succ n
ih =>
have h0s₂ : 0 < s₂.length :=
length_pos_of_head_eq_head_of_last_eq_last_of_length_pos hb ht (hle.symm ▸ Nat.succ_pos _)
rcases
exists_last_eq_snoc_equivalent s₁ s₂.eraseLast.last (ht.symm ▸ isMaximal_eraseLast_last h0s₂)
(hb.symm ▸ s₂.head_eraseLast ▸ head_le_of_mem (last_mem _)) with
⟨t, htb, htl, htt, hteq⟩
have := ih t s₂.eraseLast (by simp [htb, ← hb]) htt (Nat.succ_inj.1 (htl.trans hle))
refine hteq.trans ?_
conv_rhs => rw [eq_snoc_eraseLast h0s₂]
simp only [ht]
exact Equivalent.snoc this (by simpa [htt] using (isMaximal_eraseLast_last h0s₂).iso_refl)