Theorem: List.getElem?_zip_eq_some
File: Mathlib/Data/List/Zip.lean

tactic: cases z
state_before: α : Type u
β : Type u_1
γ : Type u_2
δ : Type u_3
ε : Type u_4
l₁ : List α
l₂ : List β
z : α × β
i : ℕ
⊢ (l₁.zip l₂)[i]? = some z ↔ l₁[i]? = some z.1 ∧ l₂[i]? = some z.2
state_after: case mk
α : Type u
β : Type u_1
γ : Type u_2
δ : Type u_3
ε : Type u_4
l₁ : List α
l₂ : List β
i : ℕ
fst✝ : α
snd✝ : β
⊢ (l₁.zip l₂)[i]? = some (fst✝, snd✝) ↔ l₁[i]? = some (fst✝, snd✝).1 ∧ l₂[i]? = some (fst✝, snd✝).2

tactic: rw [zip, getElem?_zip_with_eq_some]
state_before: case mk
α : Type u
β : Type u_1
γ : Type u_2
δ : Type u_3
ε : Type u_4
l₁ : List α
l₂ : List β
i : ℕ
fst✝ : α
snd✝ : β
⊢ (l₁.zip l₂)[i]? = some (fst✝, snd✝) ↔ l₁[i]? = some (fst✝, snd✝).1 ∧ l₂[i]? = some (fst✝, snd✝).2
state_after: case mk
α : Type u
β : Type u_1
γ : Type u_2
δ : Type u_3
ε : Type u_4
l₁ : List α
l₂ : List β
i : ℕ
fst✝ : α
snd✝ : β
⊢ (∃ x y, l₁[i]? = some x ∧ l₂[i]? = some y ∧ (x, y) = (fst✝, snd✝)) ↔
    l₁[i]? = some (fst✝, snd✝).1 ∧ l₂[i]? = some (fst✝, snd✝).2

tactic: constructor
state_before: case mk
α : Type u
β : Type u_1
γ : Type u_2
δ : Type u_3
ε : Type u_4
l₁ : List α
l₂ : List β
i : ℕ
fst✝ : α
snd✝ : β
⊢ (∃ x y, l₁[i]? = some x ∧ l₂[i]? = some y ∧ (x, y) = (fst✝, snd✝)) ↔
    l₁[i]? = some (fst✝, snd✝).1 ∧ l₂[i]? = some (fst✝, snd✝).2
state_after: case mk.mp
α : Type u
β : Type u_1
γ : Type u_2
δ : Type u_3
ε : Type u_4
l₁ : List α
l₂ : List β
i : ℕ
fst✝ : α
snd✝ : β
⊢ (∃ x y, l₁[i]? = some x ∧ l₂[i]? = some y ∧ (x, y) = (fst✝, snd✝)) →
    l₁[i]? = some (fst✝, snd✝).1 ∧ l₂[i]? = some (fst✝, snd✝).2

case mk.mpr
α : Type u
β : Type u_1
γ : Type u_2
δ : Type u_3
ε : Type u_4
l₁ : List α
l₂ : List β
i : ℕ
fst✝ : α
snd✝ : β
⊢ l₁[i]? = some (fst✝, snd✝).1 ∧ l₂[i]? = some (fst✝, snd✝).2 →
    ∃ x y, l₁[i]? = some x ∧ l₂[i]? = some y ∧ (x, y) = (fst✝, snd✝)

tactic: rintro ⟨x, y, h₀, h₁, h₂⟩
state_before: case mk.mp
α : Type u
β : Type u_1
γ : Type u_2
δ : Type u_3
ε : Type u_4
l₁ : List α
l₂ : List β
i : ℕ
fst✝ : α
snd✝ : β
⊢ (∃ x y, l₁[i]? = some x ∧ l₂[i]? = some y ∧ (x, y) = (fst✝, snd✝)) →
    l₁[i]? = some (fst✝, snd✝).1 ∧ l₂[i]? = some (fst✝, snd✝).2
state_after: case mk.mp.intro.intro.intro.intro
α : Type u
β : Type u_1
γ : Type u_2
δ : Type u_3
ε : Type u_4
l₁ : List α
l₂ : List β
i : ℕ
fst✝ : α
snd✝ : β
x : α
y : β
h₀ : l₁[i]? = some x
h₁ : l₂[i]? = some y
h₂ : (x, y) = (fst✝, snd✝)
⊢ l₁[i]? = some (fst✝, snd✝).1 ∧ l₂[i]? = some (fst✝, snd✝).2

tactic: simpa [h₀, h₁] using h₂
state_before: case mk.mp.intro.intro.intro.intro
α : Type u
β : Type u_1
γ : Type u_2
δ : Type u_3
ε : Type u_4
l₁ : List α
l₂ : List β
i : ℕ
fst✝ : α
snd✝ : β
x : α
y : β
h₀ : l₁[i]? = some x
h₁ : l₂[i]? = some y
h₂ : (x, y) = (fst✝, snd✝)
⊢ l₁[i]? = some (fst✝, snd✝).1 ∧ l₂[i]? = some (fst✝, snd✝).2
state_after: no goals

tactic: rintro ⟨h₀, h₁⟩
state_before: case mk.mpr
α : Type u
β : Type u_1
γ : Type u_2
δ : Type u_3
ε : Type u_4
l₁ : List α
l₂ : List β
i : ℕ
fst✝ : α
snd✝ : β
⊢ l₁[i]? = some (fst✝, snd✝).1 ∧ l₂[i]? = some (fst✝, snd✝).2 →
    ∃ x y, l₁[i]? = some x ∧ l₂[i]? = some y ∧ (x, y) = (fst✝, snd✝)
state_after: case mk.mpr.intro
α : Type u
β : Type u_1
γ : Type u_2
δ : Type u_3
ε : Type u_4
l₁ : List α
l₂ : List β
i : ℕ
fst✝ : α
snd✝ : β
h₀ : l₁[i]? = some (fst✝, snd✝).1
h₁ : l₂[i]? = some (fst✝, snd✝).2
⊢ ∃ x y, l₁[i]? = some x ∧ l₂[i]? = some y ∧ (x, y) = (fst✝, snd✝)

tactic: exact ⟨_, _, h₀, h₁, rfl⟩
state_before: case mk.mpr.intro
α : Type u
β : Type u_1
γ : Type u_2
δ : Type u_3
ε : Type u_4
l₁ : List α
l₂ : List β
i : ℕ
fst✝ : α
snd✝ : β
h₀ : l₁[i]? = some (fst✝, snd✝).1
h₁ : l₂[i]? = some (fst✝, snd✝).2
⊢ ∃ x y, l₁[i]? = some x ∧ l₂[i]? = some y ∧ (x, y) = (fst✝, snd✝)
state_after: no goals