Theorem: List.length_injective_iff
File: Mathlib/Data/List/Basic.lean

tactic: constructor
state_before: ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
⊢ Injective length ↔ Subsingleton α
state_after: case mp
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
⊢ Injective length → Subsingleton α

case mpr
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
⊢ Subsingleton α → Injective length

tactic: intro h
state_before: case mp
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
⊢ Injective length → Subsingleton α
state_after: case mp
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
h : Injective length
⊢ Subsingleton α

tactic: refine ⟨fun x y => ?_⟩
state_before: case mp
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
h : Injective length
⊢ Subsingleton α
state_after: case mp
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
h : Injective length
x y : α
⊢ x = y

tactic: (suffices [x] = [y] by simpa using this)
state_before: case mp
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
h : Injective length
x y : α
⊢ x = y
state_after: case mp
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
h : Injective length
x y : α
⊢ [x] = [y]

tactic: apply h
state_before: case mp
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
h : Injective length
x y : α
⊢ [x] = [y]
state_after: case mp.a
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
h : Injective length
x y : α
⊢ [x].length = [y].length

tactic: rfl
state_before: case mp.a
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
h : Injective length
x y : α
⊢ [x].length = [y].length
state_after: no goals

tactic: suffices [x] = [y] by simpa using this
state_before: case mp
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
h : Injective length
x y : α
⊢ x = y
state_after: case mp
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
h : Injective length
x y : α
⊢ [x] = [y]

tactic: simpa using this
state_before: ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
h : Injective length
x y : α
this : [x] = [y]
⊢ x = y
state_after: no goals

tactic: intros hα l1 l2 hl
state_before: case mpr
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
⊢ Subsingleton α → Injective length
state_after: case mpr
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
hα : Subsingleton α
l1 l2 : List α
hl : l1.length = l2.length
⊢ l1 = l2

tactic: induction l1 generalizing l2 <;> cases l2
state_before: case mpr
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
hα : Subsingleton α
l1 l2 : List α
hl : l1.length = l2.length
⊢ l1 = l2
state_after: case mpr.nil.nil
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
hα : Subsingleton α
hl : [].length = [].length
⊢ [] = []

case mpr.nil.cons
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
hα : Subsingleton α
head✝ : α
tail✝ : List α
hl : [].length = (head✝ :: tail✝).length
⊢ [] = head✝ :: tail✝

case mpr.cons.nil
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
hα : Subsingleton α
head✝ : α
tail✝ : List α
tail_ih✝ : ∀ ⦃l2 : List α⦄, tail✝.length = l2.length → tail✝ = l2
hl : (head✝ :: tail✝).length = [].length
⊢ head✝ :: tail✝ = []

case mpr.cons.cons
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
hα : Subsingleton α
head✝¹ : α
tail✝¹ : List α
tail_ih✝ : ∀ ⦃l2 : List α⦄, tail✝¹.length = l2.length → tail✝¹ = l2
head✝ : α
tail✝ : List α
hl : (head✝¹ :: tail✝¹).length = (head✝ :: tail✝).length
⊢ head✝¹ :: tail✝¹ = head✝ :: tail✝

tactic: rfl
state_before: case mpr.nil.nil
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
hα : Subsingleton α
hl : [].length = [].length
⊢ [] = []
state_after: no goals

tactic: cases hl
state_before: case mpr.nil.cons
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
hα : Subsingleton α
head✝ : α
tail✝ : List α
hl : [].length = (head✝ :: tail✝).length
⊢ [] = head✝ :: tail✝
state_after: no goals

tactic: cases hl
state_before: case mpr.cons.nil
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
hα : Subsingleton α
head✝ : α
tail✝ : List α
tail_ih✝ : ∀ ⦃l2 : List α⦄, tail✝.length = l2.length → tail✝ = l2
hl : (head✝ :: tail✝).length = [].length
⊢ head✝ :: tail✝ = []
state_after: no goals

tactic: congr
state_before: ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
hα : Subsingleton α
head✝¹ : α
tail✝¹ : List α
ih : ∀ ⦃l2 : List α⦄, tail✝¹.length = l2.length → tail✝¹ = l2
head✝ : α
tail✝ : List α
hl : (head✝¹ :: tail✝¹).length = (head✝ :: tail✝).length
⊢ head✝¹ :: tail✝¹ = head✝ :: tail✝
state_after: case e_head
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
hα : Subsingleton α
head✝¹ : α
tail✝¹ : List α
ih : ∀ ⦃l2 : List α⦄, tail✝¹.length = l2.length → tail✝¹ = l2
head✝ : α
tail✝ : List α
hl : (head✝¹ :: tail✝¹).length = (head✝ :: tail✝).length
⊢ head✝¹ = head✝

case e_tail
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
hα : Subsingleton α
head✝¹ : α
tail✝¹ : List α
ih : ∀ ⦃l2 : List α⦄, tail✝¹.length = l2.length → tail✝¹ = l2
head✝ : α
tail✝ : List α
hl : (head✝¹ :: tail✝¹).length = (head✝ :: tail✝).length
⊢ tail✝¹ = tail✝

tactic: exact Subsingleton.elim _ _
state_before: case e_head
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
hα : Subsingleton α
head✝¹ : α
tail✝¹ : List α
ih : ∀ ⦃l2 : List α⦄, tail✝¹.length = l2.length → tail✝¹ = l2
head✝ : α
tail✝ : List α
hl : (head✝¹ :: tail✝¹).length = (head✝ :: tail✝).length
⊢ head✝¹ = head✝
state_after: no goals

tactic: apply ih
state_before: case e_tail
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
hα : Subsingleton α
head✝¹ : α
tail✝¹ : List α
ih : ∀ ⦃l2 : List α⦄, tail✝¹.length = l2.length → tail✝¹ = l2
head✝ : α
tail✝ : List α
hl : (head✝¹ :: tail✝¹).length = (head✝ :: tail✝).length
⊢ tail✝¹ = tail✝
state_after: case e_tail.hl
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
hα : Subsingleton α
head✝¹ : α
tail✝¹ : List α
ih : ∀ ⦃l2 : List α⦄, tail✝¹.length = l2.length → tail✝¹ = l2
head✝ : α
tail✝ : List α
hl : (head✝¹ :: tail✝¹).length = (head✝ :: tail✝).length
⊢ tail✝¹.length = tail✝.length

tactic: simpa using hl
state_before: case e_tail.hl
ι : Type u_1
α : Type u
β : Type v
γ : Type w
l₁ l₂ : List α
hα : Subsingleton α
head✝¹ : α
tail✝¹ : List α
ih : ∀ ⦃l2 : List α⦄, tail✝¹.length = l2.length → tail✝¹ = l2
head✝ : α
tail✝ : List α
hl : (head✝¹ :: tail✝¹).length = (head✝ :: tail✝).length
⊢ tail✝¹.length = tail✝.length
state_after: no goals