l3lab/ntp-mathlib huggingface dataset:
theorem append_succ_castAdd_aux (i : Fin m) (h : a (Fin.last _) = b 0) :
    Matrix.vecAppend (Nat.add_succ _ _).symm (a ∘ Fin.castSucc) b (Fin.castAdd n i).succ =
      a i.succ := by
  cases' i with i hi
  simp only [Matrix.vecAppend_eq_ite, hi, Fin.succ_mk, Function.comp_apply, Fin.castSucc_mk,
    Fin.val_mk, Fin.castAdd_mk]
  split_ifs with h_1
  · rfl
  · have : i + 1 = m := le_antisymm hi (le_of_not_gt h_1)
    

Proof state:
case neg
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
α : Type u_1
m n : ℕ
a : Fin (Nat.succ m) → α
b : Fin (Nat.succ n) → α
h : a (Fin.last m) = b 0
i : ℕ
hi : i < m
h_1 : ¬i + 1 < m
this : i + 1 = m
⊢ b
      { val := i + 1 - m,
        isLt := (_ : ↑{ val := i + 1, isLt := (_ : Nat.succ i < Nat.succ (m + n)) } - m < Nat.succ n) } =
    a { val := i + 1, isLt := (_ : Nat.succ i < Nat.succ m) }

Next tactic:
calc
      b ⟨i + 1 - m, by simp [this]⟩ = b 0 := congr_arg b (by simp [Fin.ext_iff, this])
      _ = a (Fin.last _) := h.symm
      _ = _ := congr_arg a (by simp [Fin.ext_iff, this])
theorem append_succ_castAdd_aux (i : Fin m) (h : a (Fin.last _) = b 0) :
    Matrix.vecAppend (Nat.add_succ _ _).symm (a ∘ Fin.castSucc) b (Fin.castAdd n i).succ =
      a i.succ := by
  cases' i with i hi
  simp only [Matrix.vecAppend_eq_ite, hi, Fin.succ_mk, Function.comp_apply, Fin.castSucc_mk,
    Fin.val_mk, Fin.castAdd_mk]
  split_ifs with h_1
  · rfl
  · have : i + 1 = m := le_antisymm hi (le_of_not_gt h_1)
    calc
      b ⟨i + 1 - m, by 

Proof state:
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
α : Type u_1
m n : ℕ
a : Fin (Nat.succ m) → α
b : Fin (Nat.succ n) → α
h : a (Fin.last m) = b 0
i : ℕ
hi : i < m
h_1 : ¬i + 1 < m
this : i + 1 = m
⊢ i + 1 - m < Nat.succ n

Next tactic:
simp [this]
theorem append_succ_castAdd_aux (i : Fin m) (h : a (Fin.last _) = b 0) :
    Matrix.vecAppend (Nat.add_succ _ _).symm (a ∘ Fin.castSucc) b (Fin.castAdd n i).succ =
      a i.succ := by
  cases' i with i hi
  simp only [Matrix.vecAppend_eq_ite, hi, Fin.succ_mk, Function.comp_apply, Fin.castSucc_mk,
    Fin.val_mk, Fin.castAdd_mk]
  split_ifs with h_1
  · rfl
  · have : i + 1 = m := le_antisymm hi (le_of_not_gt h_1)
    calc
      b ⟨i + 1 - m, by simp [this]⟩ = b 0 := congr_arg b (by 

Proof state:
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
α : Type u_1
m n : ℕ
a : Fin (Nat.succ m) → α
b : Fin (Nat.succ n) → α
h : a (Fin.last m) = b 0
i : ℕ
hi : i < m
h_1 : ¬i + 1 < m
this : i + 1 = m
⊢ { val := i + 1 - m, isLt := (_ : i + 1 - m < Nat.succ n) } = 0

Next tactic:
simp [Fin.ext_iff, this]
theorem append_succ_castAdd_aux (i : Fin m) (h : a (Fin.last _) = b 0) :
    Matrix.vecAppend (Nat.add_succ _ _).symm (a ∘ Fin.castSucc) b (Fin.castAdd n i).succ =
      a i.succ := by
  cases' i with i hi
  simp only [Matrix.vecAppend_eq_ite, hi, Fin.succ_mk, Function.comp_apply, Fin.castSucc_mk,
    Fin.val_mk, Fin.castAdd_mk]
  split_ifs with h_1
  · rfl
  · have : i + 1 = m := le_antisymm hi (le_of_not_gt h_1)
    calc
      b ⟨i + 1 - m, by simp [this]⟩ = b 0 := congr_arg b (by simp [Fin.ext_iff, this])
      _ = a (Fin.last _) := h.symm
      _ = _ := congr_arg a (by 

Proof state:
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
α : Type u_1
m n : ℕ
a : Fin (Nat.succ m) → α
b : Fin (Nat.succ n) → α
h : a (Fin.last m) = b 0
i : ℕ
hi : i < m
h_1 : ¬i + 1 < m
this : i + 1 = m
⊢ Fin.last m = { val := i + 1, isLt := (_ : Nat.succ i < Nat.succ m) }

Next tactic:
simp [Fin.ext_iff, this]
theorem append_natAdd_aux (i : Fin n) :
    Matrix.vecAppend (Nat.add_succ _ _).symm (a ∘ Fin.castSucc) b
      (Fin.castSucc <| Fin.natAdd m i) =
      b (Fin.castSucc i) := by
  

Proof state:
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
α : Type u_1
m n : ℕ
a : Fin (Nat.succ m) → α
b : Fin (Nat.succ n) → α
i : Fin n
⊢ Matrix.vecAppend (_ : Nat.succ (m + n) = m + Nat.succ n) (a ∘ Fin.castSucc) b (Fin.castSucc (Fin.natAdd m i)) =
    b (Fin.castSucc i)

Next tactic:
cases i
theorem append_natAdd_aux (i : Fin n) :
    Matrix.vecAppend (Nat.add_succ _ _).symm (a ∘ Fin.castSucc) b
      (Fin.castSucc <| Fin.natAdd m i) =
      b (Fin.castSucc i) := by
  cases i
  

Proof state:
case mk
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
α : Type u_1
m n : ℕ
a : Fin (Nat.succ m) → α
b : Fin (Nat.succ n) → α
val✝ : ℕ
isLt✝ : val✝ < n
⊢ Matrix.vecAppend (_ : Nat.succ (m + n) = m + Nat.succ n) (a ∘ Fin.castSucc) b
      (Fin.castSucc (Fin.natAdd m { val := val✝, isLt := isLt✝ })) =
    b (Fin.castSucc { val := val✝, isLt := isLt✝ })

Next tactic:
simp only [Matrix.vecAppend_eq_ite, Nat.not_lt_zero, Fin.natAdd_mk, add_lt_iff_neg_left,
    add_tsub_cancel_left, dif_neg, Fin.castSucc_mk, not_false_iff, Fin.val_mk]
theorem append_succ_natAdd_aux (i : Fin n) :
    Matrix.vecAppend (Nat.add_succ _ _).symm (a ∘ Fin.castSucc) b (Fin.natAdd m i).succ =
      b i.succ := by
  

Proof state:
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
α : Type u_1
m n : ℕ
a : Fin (Nat.succ m) → α
b : Fin (Nat.succ n) → α
i : Fin n
⊢ Matrix.vecAppend (_ : Nat.succ (m + n) = m + Nat.succ n) (a ∘ Fin.castSucc) b (Fin.succ (Fin.natAdd m i)) =
    b (Fin.succ i)

Next tactic:
cases' i with i hi
theorem append_succ_natAdd_aux (i : Fin n) :
    Matrix.vecAppend (Nat.add_succ _ _).symm (a ∘ Fin.castSucc) b (Fin.natAdd m i).succ =
      b i.succ := by
  cases' i with i hi
  

Proof state:
case mk
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
α : Type u_1
m n : ℕ
a : Fin (Nat.succ m) → α
b : Fin (Nat.succ n) → α
i : ℕ
hi : i < n
⊢ Matrix.vecAppend (_ : Nat.succ (m + n) = m + Nat.succ n) (a ∘ Fin.castSucc) b
      (Fin.succ (Fin.natAdd m { val := i, isLt := hi })) =
    b (Fin.succ { val := i, isLt := hi })

Next tactic:
simp only [Matrix.vecAppend_eq_ite, add_assoc, Nat.not_lt_zero, Fin.natAdd_mk,
    add_lt_iff_neg_left, add_tsub_cancel_left, Fin.succ_mk, dif_neg, not_false_iff, Fin.val_mk]
/-- Append two composition series `s₁` and `s₂` such that
the least element of `s₁` is the maximum element of `s₂`. -/
@[simps length]
def append (s₁ s₂ : CompositionSeries X) (h : s₁.top = s₂.bot) : CompositionSeries X where
  length := s₁.length + s₂.length
  series := Matrix.vecAppend (Nat.add_succ s₁.length s₂.length).symm (s₁ ∘ Fin.castSucc) s₂
  step' i := by
    

Proof state:
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s₁ s₂ : CompositionSeries X
h : top s₁ = bot s₂
i : Fin (s₁.length + s₂.length)
⊢ IsMaximal
    (Matrix.vecAppend (_ : Nat.succ (s₁.length + s₂.length) = s₁.length + Nat.succ s₂.length) (s₁.series ∘ Fin.castSucc)
      s₂.series (Fin.castSucc i))
    (Matrix.vecAppend (_ : Nat.succ (s₁.length + s₂.length) = s₁.length + Nat.succ s₂.length) (s₁.series ∘ Fin.castSucc)
      s₂.series (Fin.succ i))

Next tactic:
refine' Fin.addCases _ _ i
/-- Append two composition series `s₁` and `s₂` such that
the least element of `s₁` is the maximum element of `s₂`. -/
@[simps length]
def append (s₁ s₂ : CompositionSeries X) (h : s₁.top = s₂.bot) : CompositionSeries X where
  length := s₁.length + s₂.length
  series := Matrix.vecAppend (Nat.add_succ s₁.length s₂.length).symm (s₁ ∘ Fin.castSucc) s₂
  step' i := by
    refine' Fin.addCases _ _ i
    · 

Proof state:
case refine'_1
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s₁ s₂ : CompositionSeries X
h : top s₁ = bot s₂
i : Fin (s₁.length + s₂.length)
⊢ ∀ (i : Fin s₁.length),
    IsMaximal
      (Matrix.vecAppend (_ : Nat.succ (s₁.length + s₂.length) = s₁.length + Nat.succ s₂.length)
        (s₁.series ∘ Fin.castSucc) s₂.series (Fin.castSucc (Fin.castAdd s₂.length i)))
      (Matrix.vecAppend (_ : Nat.succ (s₁.length + s₂.length) = s₁.length + Nat.succ s₂.length)
        (s₁.series ∘ Fin.castSucc) s₂.series (Fin.succ (Fin.castAdd s₂.length i)))

Next tactic:
intro i
/-- Append two composition series `s₁` and `s₂` such that
the least element of `s₁` is the maximum element of `s₂`. -/
@[simps length]
def append (s₁ s₂ : CompositionSeries X) (h : s₁.top = s₂.bot) : CompositionSeries X where
  length := s₁.length + s₂.length
  series := Matrix.vecAppend (Nat.add_succ s₁.length s₂.length).symm (s₁ ∘ Fin.castSucc) s₂
  step' i := by
    refine' Fin.addCases _ _ i
    · intro i
      

Proof state:
case refine'_1
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s₁ s₂ : CompositionSeries X
h : top s₁ = bot s₂
i✝ : Fin (s₁.length + s₂.length)
i : Fin s₁.length
⊢ IsMaximal
    (Matrix.vecAppend (_ : Nat.succ (s₁.length + s₂.length) = s₁.length + Nat.succ s₂.length) (s₁.series ∘ Fin.castSucc)
      s₂.series (Fin.castSucc (Fin.castAdd s₂.length i)))
    (Matrix.vecAppend (_ : Nat.succ (s₁.length + s₂.length) = s₁.length + Nat.succ s₂.length) (s₁.series ∘ Fin.castSucc)
      s₂.series (Fin.succ (Fin.castAdd s₂.length i)))

Next tactic:
rw [append_succ_castAdd_aux _ _ _ h, append_castAdd_aux]
/-- Append two composition series `s₁` and `s₂` such that
the least element of `s₁` is the maximum element of `s₂`. -/
@[simps length]
def append (s₁ s₂ : CompositionSeries X) (h : s₁.top = s₂.bot) : CompositionSeries X where
  length := s₁.length + s₂.length
  series := Matrix.vecAppend (Nat.add_succ s₁.length s₂.length).symm (s₁ ∘ Fin.castSucc) s₂
  step' i := by
    refine' Fin.addCases _ _ i
    · intro i
      rw [append_succ_castAdd_aux _ _ _ h, append_castAdd_aux]
      

Proof state:
case refine'_1
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s₁ s₂ : CompositionSeries X
h : top s₁ = bot s₂
i✝ : Fin (s₁.length + s₂.length)
i : Fin s₁.length
⊢ IsMaximal (series s₁ (Fin.castSucc i)) (series s₁ (Fin.succ i))

Next tactic:
exact s₁.step i
/-- Append two composition series `s₁` and `s₂` such that
the least element of `s₁` is the maximum element of `s₂`. -/
@[simps length]
def append (s₁ s₂ : CompositionSeries X) (h : s₁.top = s₂.bot) : CompositionSeries X where
  length := s₁.length + s₂.length
  series := Matrix.vecAppend (Nat.add_succ s₁.length s₂.length).symm (s₁ ∘ Fin.castSucc) s₂
  step' i := by
    refine' Fin.addCases _ _ i
    · intro i
      rw [append_succ_castAdd_aux _ _ _ h, append_castAdd_aux]
      exact s₁.step i
    · 

Proof state:
case refine'_2
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s₁ s₂ : CompositionSeries X
h : top s₁ = bot s₂
i : Fin (s₁.length + s₂.length)
⊢ ∀ (i : Fin s₂.length),
    IsMaximal
      (Matrix.vecAppend (_ : Nat.succ (s₁.length + s₂.length) = s₁.length + Nat.succ s₂.length)
        (s₁.series ∘ Fin.castSucc) s₂.series (Fin.castSucc (Fin.natAdd s₁.length i)))
      (Matrix.vecAppend (_ : Nat.succ (s₁.length + s₂.length) = s₁.length + Nat.succ s₂.length)
        (s₁.series ∘ Fin.castSucc) s₂.series (Fin.succ (Fin.natAdd s₁.length i)))

Next tactic:
intro i
/-- Append two composition series `s₁` and `s₂` such that
the least element of `s₁` is the maximum element of `s₂`. -/
@[simps length]
def append (s₁ s₂ : CompositionSeries X) (h : s₁.top = s₂.bot) : CompositionSeries X where
  length := s₁.length + s₂.length
  series := Matrix.vecAppend (Nat.add_succ s₁.length s₂.length).symm (s₁ ∘ Fin.castSucc) s₂
  step' i := by
    refine' Fin.addCases _ _ i
    · intro i
      rw [append_succ_castAdd_aux _ _ _ h, append_castAdd_aux]
      exact s₁.step i
    · intro i
      

Proof state:
case refine'_2
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s₁ s₂ : CompositionSeries X
h : top s₁ = bot s₂
i✝ : Fin (s₁.length + s₂.length)
i : Fin s₂.length
⊢ IsMaximal
    (Matrix.vecAppend (_ : Nat.succ (s₁.length + s₂.length) = s₁.length + Nat.succ s₂.length) (s₁.series ∘ Fin.castSucc)
      s₂.series (Fin.castSucc (Fin.natAdd s₁.length i)))
    (Matrix.vecAppend (_ : Nat.succ (s₁.length + s₂.length) = s₁.length + Nat.succ s₂.length) (s₁.series ∘ Fin.castSucc)
      s₂.series (Fin.succ (Fin.natAdd s₁.length i)))

Next tactic:
rw [append_natAdd_aux, append_succ_natAdd_aux]
/-- Append two composition series `s₁` and `s₂` such that
the least element of `s₁` is the maximum element of `s₂`. -/
@[simps length]
def append (s₁ s₂ : CompositionSeries X) (h : s₁.top = s₂.bot) : CompositionSeries X where
  length := s₁.length + s₂.length
  series := Matrix.vecAppend (Nat.add_succ s₁.length s₂.length).symm (s₁ ∘ Fin.castSucc) s₂
  step' i := by
    refine' Fin.addCases _ _ i
    · intro i
      rw [append_succ_castAdd_aux _ _ _ h, append_castAdd_aux]
      exact s₁.step i
    · intro i
      rw [append_natAdd_aux, append_succ_natAdd_aux]
      

Proof state:
case refine'_2
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s₁ s₂ : CompositionSeries X
h : top s₁ = bot s₂
i✝ : Fin (s₁.length + s₂.length)
i : Fin s₂.length
⊢ IsMaximal (series s₂ (Fin.castSucc i)) (series s₂ (Fin.succ i))

Next tactic:
exact s₂.step i
@[simp]
theorem append_castAdd {s₁ s₂ : CompositionSeries X} (h : s₁.top = s₂.bot) (i : Fin s₁.length) :
    append s₁ s₂ h (Fin.castSucc <| Fin.castAdd s₂.length i) = s₁ (Fin.castSucc i) := by
  

Proof state:
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s₁ s₂ : CompositionSeries X
h : top s₁ = bot s₂
i : Fin s₁.length
⊢ series (append s₁ s₂ h) (Fin.castSucc (Fin.castAdd s₂.length i)) = series s₁ (Fin.castSucc i)

Next tactic:
rw [coe_append, append_castAdd_aux _ _ i]
@[simp]
theorem append_succ_castAdd {s₁ s₂ : CompositionSeries X} (h : s₁.top = s₂.bot)
    (i : Fin s₁.length) : append s₁ s₂ h (Fin.castAdd s₂.length i).succ = s₁ i.succ := by
  

Proof state:
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s₁ s₂ : CompositionSeries X
h : top s₁ = bot s₂
i : Fin s₁.length
⊢ series (append s₁ s₂ h) (Fin.succ (Fin.castAdd s₂.length i)) = series s₁ (Fin.succ i)

Next tactic:
rw [coe_append, append_succ_castAdd_aux _ _ _ h]
@[simp]
theorem append_natAdd {s₁ s₂ : CompositionSeries X} (h : s₁.top = s₂.bot) (i : Fin s₂.length) :
    append s₁ s₂ h (Fin.castSucc <| Fin.natAdd s₁.length i) = s₂ (Fin.castSucc i) := by
  

Proof state:
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s₁ s₂ : CompositionSeries X
h : top s₁ = bot s₂
i : Fin s₂.length
⊢ series (append s₁ s₂ h) (Fin.castSucc (Fin.natAdd s₁.length i)) = series s₂ (Fin.castSucc i)

Next tactic:
rw [coe_append, append_natAdd_aux _ _ i]
@[simp]
theorem append_succ_natAdd {s₁ s₂ : CompositionSeries X} (h : s₁.top = s₂.bot) (i : Fin s₂.length) :
    append s₁ s₂ h (Fin.natAdd s₁.length i).succ = s₂ i.succ := by
  

Proof state:
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s₁ s₂ : CompositionSeries X
h : top s₁ = bot s₂
i : Fin s₂.length
⊢ series (append s₁ s₂ h) (Fin.succ (Fin.natAdd s₁.length i)) = series s₂ (Fin.succ i)

Next tactic:
rw [coe_append, append_succ_natAdd_aux _ _ i]
/-- Add an element to the top of a `CompositionSeries` -/
@[simps length]
def snoc (s : CompositionSeries X) (x : X) (hsat : IsMaximal s.top x) : CompositionSeries X where
  length := s.length + 1
  series := Fin.snoc s x
  step' i := by
    

Proof state:
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x : X
hsat : IsMaximal (top s) x
i : Fin (s.length + 1)
⊢ IsMaximal (Fin.snoc s.series x (Fin.castSucc i)) (Fin.snoc s.series x (Fin.succ i))

Next tactic:
refine' Fin.lastCases _ _ i
/-- Add an element to the top of a `CompositionSeries` -/
@[simps length]
def snoc (s : CompositionSeries X) (x : X) (hsat : IsMaximal s.top x) : CompositionSeries X where
  length := s.length + 1
  series := Fin.snoc s x
  step' i := by
    refine' Fin.lastCases _ _ i
    · 

Proof state:
case refine'_1
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x : X
hsat : IsMaximal (top s) x
i : Fin (s.length + 1)
⊢ IsMaximal (Fin.snoc s.series x (Fin.castSucc (Fin.last s.length)))
    (Fin.snoc s.series x (Fin.succ (Fin.last s.length)))

Next tactic:
rwa [Fin.snoc_castSucc, Fin.succ_last, Fin.snoc_last, ← top]
/-- Add an element to the top of a `CompositionSeries` -/
@[simps length]
def snoc (s : CompositionSeries X) (x : X) (hsat : IsMaximal s.top x) : CompositionSeries X where
  length := s.length + 1
  series := Fin.snoc s x
  step' i := by
    refine' Fin.lastCases _ _ i
    · rwa [Fin.snoc_castSucc, Fin.succ_last, Fin.snoc_last, ← top]
    · 

Proof state:
case refine'_2
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x : X
hsat : IsMaximal (top s) x
i : Fin (s.length + 1)
⊢ ∀ (i : Fin s.length),
    IsMaximal (Fin.snoc s.series x (Fin.castSucc (Fin.castSucc i))) (Fin.snoc s.series x (Fin.succ (Fin.castSucc i)))

Next tactic:
intro i
/-- Add an element to the top of a `CompositionSeries` -/
@[simps length]
def snoc (s : CompositionSeries X) (x : X) (hsat : IsMaximal s.top x) : CompositionSeries X where
  length := s.length + 1
  series := Fin.snoc s x
  step' i := by
    refine' Fin.lastCases _ _ i
    · rwa [Fin.snoc_castSucc, Fin.succ_last, Fin.snoc_last, ← top]
    · intro i
      

Proof state:
case refine'_2
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x : X
hsat : IsMaximal (top s) x
i✝ : Fin (s.length + 1)
i : Fin s.length
⊢ IsMaximal (Fin.snoc s.series x (Fin.castSucc (Fin.castSucc i))) (Fin.snoc s.series x (Fin.succ (Fin.castSucc i)))

Next tactic:
rw [Fin.snoc_castSucc, ← Fin.castSucc_fin_succ, Fin.snoc_castSucc]
/-- Add an element to the top of a `CompositionSeries` -/
@[simps length]
def snoc (s : CompositionSeries X) (x : X) (hsat : IsMaximal s.top x) : CompositionSeries X where
  length := s.length + 1
  series := Fin.snoc s x
  step' i := by
    refine' Fin.lastCases _ _ i
    · rwa [Fin.snoc_castSucc, Fin.succ_last, Fin.snoc_last, ← top]
    · intro i
      rw [Fin.snoc_castSucc, ← Fin.castSucc_fin_succ, Fin.snoc_castSucc]
      

Proof state:
case refine'_2
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x : X
hsat : IsMaximal (top s) x
i✝ : Fin (s.length + 1)
i : Fin s.length
⊢ IsMaximal (series s (Fin.castSucc i)) (series s (Fin.succ i))

Next tactic:
exact s.step _
@[simp]
theorem bot_snoc (s : CompositionSeries X) (x : X) (hsat : IsMaximal s.top x) :
    (snoc s x hsat).bot = s.bot := by
  

Proof state:
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x : X
hsat : IsMaximal (top s) x
⊢ bot (snoc s x hsat) = bot s

Next tactic:
rw [bot, bot, ← snoc_castSucc s x hsat 0, Fin.castSucc_zero' (n := s.length + 1)]
theorem mem_snoc {s : CompositionSeries X} {x y : X} {hsat : IsMaximal s.top x} :
    y ∈ snoc s x hsat ↔ y ∈ s ∨ y = x := by
  

Proof state:
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x y : X
hsat : IsMaximal (top s) x
⊢ y ∈ snoc s x hsat ↔ y ∈ s ∨ y = x

Next tactic:
simp only [snoc, mem_def]
theorem mem_snoc {s : CompositionSeries X} {x y : X} {hsat : IsMaximal s.top x} :
    y ∈ snoc s x hsat ↔ y ∈ s ∨ y = x := by
  simp only [snoc, mem_def]
  

Proof state:
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x y : X
hsat : IsMaximal (top s) x
⊢ y ∈ range (Fin.snoc s.series x) ↔ y ∈ range s.series ∨ y = x

Next tactic:
constructor
theorem mem_snoc {s : CompositionSeries X} {x y : X} {hsat : IsMaximal s.top x} :
    y ∈ snoc s x hsat ↔ y ∈ s ∨ y = x := by
  simp only [snoc, mem_def]
  constructor
  · 

Proof state:
case mp
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x y : X
hsat : IsMaximal (top s) x
⊢ y ∈ range (Fin.snoc s.series x) → y ∈ range s.series ∨ y = x

Next tactic:
rintro ⟨i, rfl⟩
theorem mem_snoc {s : CompositionSeries X} {x y : X} {hsat : IsMaximal s.top x} :
    y ∈ snoc s x hsat ↔ y ∈ s ∨ y = x := by
  simp only [snoc, mem_def]
  constructor
  · rintro ⟨i, rfl⟩
    

Proof state:
case mp.intro
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x : X
hsat : IsMaximal (top s) x
i : Fin (s.length + 1 + 1)
⊢ Fin.snoc s.series x i ∈ range s.series ∨ Fin.snoc s.series x i = x

Next tactic:
refine' Fin.lastCases _ (fun i => _) i
theorem mem_snoc {s : CompositionSeries X} {x y : X} {hsat : IsMaximal s.top x} :
    y ∈ snoc s x hsat ↔ y ∈ s ∨ y = x := by
  simp only [snoc, mem_def]
  constructor
  · rintro ⟨i, rfl⟩
    refine' Fin.lastCases _ (fun i => _) i
    · 

Proof state:
case mp.intro.refine'_1
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x : X
hsat : IsMaximal (top s) x
i : Fin (s.length + 1 + 1)
⊢ Fin.snoc s.series x (Fin.last (s.length + 1)) ∈ range s.series ∨ Fin.snoc s.series x (Fin.last (s.length + 1)) = x

Next tactic:
right
theorem mem_snoc {s : CompositionSeries X} {x y : X} {hsat : IsMaximal s.top x} :
    y ∈ snoc s x hsat ↔ y ∈ s ∨ y = x := by
  simp only [snoc, mem_def]
  constructor
  · rintro ⟨i, rfl⟩
    refine' Fin.lastCases _ (fun i => _) i
    · right
      

Proof state:
case mp.intro.refine'_1.h
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x : X
hsat : IsMaximal (top s) x
i : Fin (s.length + 1 + 1)
⊢ Fin.snoc s.series x (Fin.last (s.length + 1)) = x

Next tactic:
simp
theorem mem_snoc {s : CompositionSeries X} {x y : X} {hsat : IsMaximal s.top x} :
    y ∈ snoc s x hsat ↔ y ∈ s ∨ y = x := by
  simp only [snoc, mem_def]
  constructor
  · rintro ⟨i, rfl⟩
    refine' Fin.lastCases _ (fun i => _) i
    · right
      simp
    · 

Proof state:
case mp.intro.refine'_2
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x : X
hsat : IsMaximal (top s) x
i✝ : Fin (s.length + 1 + 1)
i : Fin (s.length + 1)
⊢ Fin.snoc s.series x (Fin.castSucc i) ∈ range s.series ∨ Fin.snoc s.series x (Fin.castSucc i) = x

Next tactic:
left
theorem mem_snoc {s : CompositionSeries X} {x y : X} {hsat : IsMaximal s.top x} :
    y ∈ snoc s x hsat ↔ y ∈ s ∨ y = x := by
  simp only [snoc, mem_def]
  constructor
  · rintro ⟨i, rfl⟩
    refine' Fin.lastCases _ (fun i => _) i
    · right
      simp
    · left
      

Proof state:
case mp.intro.refine'_2.h
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x : X
hsat : IsMaximal (top s) x
i✝ : Fin (s.length + 1 + 1)
i : Fin (s.length + 1)
⊢ Fin.snoc s.series x (Fin.castSucc i) ∈ range s.series

Next tactic:
simp
theorem mem_snoc {s : CompositionSeries X} {x y : X} {hsat : IsMaximal s.top x} :
    y ∈ snoc s x hsat ↔ y ∈ s ∨ y = x := by
  simp only [snoc, mem_def]
  constructor
  · rintro ⟨i, rfl⟩
    refine' Fin.lastCases _ (fun i => _) i
    · right
      simp
    · left
      simp
  · 

Proof state:
case mpr
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x y : X
hsat : IsMaximal (top s) x
⊢ y ∈ range s.series ∨ y = x → y ∈ range (Fin.snoc s.series x)

Next tactic:
intro h
theorem mem_snoc {s : CompositionSeries X} {x y : X} {hsat : IsMaximal s.top x} :
    y ∈ snoc s x hsat ↔ y ∈ s ∨ y = x := by
  simp only [snoc, mem_def]
  constructor
  · rintro ⟨i, rfl⟩
    refine' Fin.lastCases _ (fun i => _) i
    · right
      simp
    · left
      simp
  · intro h
    

Proof state:
case mpr
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x y : X
hsat : IsMaximal (top s) x
h : y ∈ range s.series ∨ y = x
⊢ y ∈ range (Fin.snoc s.series x)

Next tactic:
rcases h with (⟨i, rfl⟩ | rfl)
theorem mem_snoc {s : CompositionSeries X} {x y : X} {hsat : IsMaximal s.top x} :
    y ∈ snoc s x hsat ↔ y ∈ s ∨ y = x := by
  simp only [snoc, mem_def]
  constructor
  · rintro ⟨i, rfl⟩
    refine' Fin.lastCases _ (fun i => _) i
    · right
      simp
    · left
      simp
  · intro h
    rcases h with (⟨i, rfl⟩ | rfl)
    · 

Proof state:
case mpr.inl.intro
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x : X
hsat : IsMaximal (top s) x
i : Fin (s.length + 1)
⊢ series s i ∈ range (Fin.snoc s.series x)

Next tactic:
use Fin.castSucc i
theorem mem_snoc {s : CompositionSeries X} {x y : X} {hsat : IsMaximal s.top x} :
    y ∈ snoc s x hsat ↔ y ∈ s ∨ y = x := by
  simp only [snoc, mem_def]
  constructor
  · rintro ⟨i, rfl⟩
    refine' Fin.lastCases _ (fun i => _) i
    · right
      simp
    · left
      simp
  · intro h
    rcases h with (⟨i, rfl⟩ | rfl)
    · use Fin.castSucc i
      

Proof state:
case h
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x : X
hsat : IsMaximal (top s) x
i : Fin (s.length + 1)
⊢ Fin.snoc s.series x (Fin.castSucc i) = series s i

Next tactic:
simp