Theorem: CompositionSeries.mem_eraseLast
File: Mathlib/Order/JordanHolder.lean

tactic: simp only [RelSeries.mem_def, eraseLast]
state_before: X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x : X
h : 0 < s.length
⊢ x ∈ eraseLast s ↔ x ≠ last s ∧ x ∈ s
state_after: X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x : X
h : 0 < s.length
⊢ (x ∈ range fun i => s.toFun ⟨↑i, ⋯⟩) ↔ x ≠ last s ∧ x ∈ range s.toFun

tactic: constructor
state_before: X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x : X
h : 0 < s.length
⊢ (x ∈ range fun i => s.toFun ⟨↑i, ⋯⟩) ↔ x ≠ last s ∧ x ∈ range s.toFun
state_after: case mp
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x : X
h : 0 < s.length
⊢ (x ∈ range fun i => s.toFun ⟨↑i, ⋯⟩) → x ≠ last s ∧ x ∈ range s.toFun

case mpr
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x : X
h : 0 < s.length
⊢ x ≠ last s ∧ x ∈ range s.toFun → x ∈ range fun i => s.toFun ⟨↑i, ⋯⟩

tactic: rintro ⟨i, rfl⟩
state_before: case mp
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x : X
h : 0 < s.length
⊢ (x ∈ range fun i => s.toFun ⟨↑i, ⋯⟩) → x ≠ last s ∧ x ∈ range s.toFun
state_after: case mp.intro
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
h : 0 < s.length
i : Fin (s.length - 1 + 1)
⊢ (fun i => s.toFun ⟨↑i, ⋯⟩) i ≠ last s ∧ (fun i => s.toFun ⟨↑i, ⋯⟩) i ∈ range s.toFun

tactic: have hi : (i : ℕ) < s.length := by
  conv_rhs => rw [← Nat.add_one_sub_one s.length, Nat.succ_sub h]
  exact i.2
state_before: case mp.intro
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
h : 0 < s.length
i : Fin (s.length - 1 + 1)
⊢ (fun i => s.toFun ⟨↑i, ⋯⟩) i ≠ last s ∧ (fun i => s.toFun ⟨↑i, ⋯⟩) i ∈ range s.toFun
state_after: case mp.intro
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
h : 0 < s.length
i : Fin (s.length - 1 + 1)
hi : ↑i < s.length
⊢ (fun i => s.toFun ⟨↑i, ⋯⟩) i ≠ last s ∧ (fun i => s.toFun ⟨↑i, ⋯⟩) i ∈ range s.toFun

tactic: simp [last, Fin.ext_iff, ne_of_lt hi, -Set.mem_range, Set.mem_range_self]
state_before: case mp.intro
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
h : 0 < s.length
i : Fin (s.length - 1 + 1)
hi : ↑i < s.length
⊢ (fun i => s.toFun ⟨↑i, ⋯⟩) i ≠ last s ∧ (fun i => s.toFun ⟨↑i, ⋯⟩) i ∈ range s.toFun
state_after: no goals

tactic: conv_rhs => rw [← Nat.add_one_sub_one s.length, Nat.succ_sub h]
state_before: X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
h : 0 < s.length
i : Fin (s.length - 1 + 1)
⊢ ↑i < s.length
state_after: X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
h : 0 < s.length
i : Fin (s.length - 1 + 1)
⊢ ↑i < (s.length - Nat.succ 0).succ

tactic: exact i.2
state_before: X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
h : 0 < s.length
i : Fin (s.length - 1 + 1)
⊢ ↑i < (s.length - Nat.succ 0).succ
state_after: no goals

tactic: intro h
state_before: case mpr
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x : X
h : 0 < s.length
⊢ x ≠ last s ∧ x ∈ range s.toFun → x ∈ range fun i => s.toFun ⟨↑i, ⋯⟩
state_after: case mpr
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x : X
h✝ : 0 < s.length
h : x ≠ last s ∧ x ∈ range s.toFun
⊢ x ∈ range fun i => s.toFun ⟨↑i, ⋯⟩

tactic: exact mem_eraseLast_of_ne_of_mem h.1 h.2
state_before: case mpr
X : Type u
inst✝¹ : Lattice X
inst✝ : JordanHolderLattice X
s : CompositionSeries X
x : X
h✝ : 0 < s.length
h : x ≠ last s ∧ x ∈ range s.toFun
⊢ x ∈ range fun i => s.toFun ⟨↑i, ⋯⟩
state_after: no goals