Theorem: Dfinsupp.single_eq_single_iff
File: Mathlib/Data/Dfinsupp/Basic.lean

tactic: constructor
state_before: ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
inst✝ : (i : ι) → Zero (β i)
s : Finset ι
x : (i : ↑↑s) → β ↑i
i✝ i j : ι
xi : β i
xj : β j
⊢ single i xi = single j xj ↔ i = j ∧ HEq xi xj ∨ xi = 0 ∧ xj = 0

tactic: intro h
state_before: case mp
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
inst✝ : (i : ι) → Zero (β i)
s : Finset ι
x : (i : ↑↑s) → β ↑i
i✝ i j : ι
xi : β i
xj : β j
⊢ single i xi = single j xj → i = j ∧ HEq xi xj ∨ xi = 0 ∧ xj = 0

tactic: by_cases hij : i = j
state_before: case mp
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
inst✝ : (i : ι) → Zero (β i)
s : Finset ι
x : (i : ↑↑s) → β ↑i
i✝ i j : ι
xi : β i
xj : β j
h : single i xi = single j xj
⊢ i = j ∧ HEq xi xj ∨ xi = 0 ∧ xj = 0

tactic: subst hij
state_before: case pos
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
inst✝ : (i : ι) → Zero (β i)
s : Finset ι
x : (i : ↑↑s) → β ↑i
i✝ i j : ι
xi : β i
xj : β j
h : single i xi = single j xj
hij : i = j
⊢ i = j ∧ HEq xi xj ∨ xi = 0 ∧ xj = 0

tactic: exact Or.inl ⟨rfl, heq_of_eq (Dfinsupp.single_injective h)⟩
state_before: case pos
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
inst✝ : (i : ι) → Zero (β i)
s : Finset ι
x : (i : ↑↑s) → β ↑i
i✝ i : ι
xi xj : β i
h : single i xi = single i xj
⊢ i = i ∧ HEq xi xj ∨ xi = 0 ∧ xj = 0

tactic: have h_coe : ⇑(Dfinsupp.single i xi) = Dfinsupp.single j xj := congr_arg (⇑) h
state_before: case neg
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
inst✝ : (i : ι) → Zero (β i)
s : Finset ι
x : (i : ↑↑s) → β ↑i
i✝ i j : ι
xi : β i
xj : β j
h : single i xi = single j xj
hij : ¬i = j
⊢ i = j ∧ HEq xi xj ∨ xi = 0 ∧ xj = 0

tactic: have hci := congr_fun h_coe i
state_before: case neg
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
inst✝ : (i : ι) → Zero (β i)
s : Finset ι
x : (i : ↑↑s) → β ↑i
i✝ i j : ι
xi : β i
xj : β j
h : single i xi = single j xj
hij : ¬i = j
h_coe : ↑(single i xi) = ↑(single j xj)
⊢ i = j ∧ HEq xi xj ∨ xi = 0 ∧ xj = 0

tactic: have hcj := congr_fun h_coe j
state_before: case neg
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
inst✝ : (i : ι) → Zero (β i)
s : Finset ι
x : (i : ↑↑s) → β ↑i
i✝ i j : ι
xi : β i
xj : β j
h : single i xi = single j xj
hij : ¬i = j
h_coe : ↑(single i xi) = ↑(single j xj)
hci : ↑(single i xi) i = ↑(single j xj) i
⊢ i = j ∧ HEq xi xj ∨ xi = 0 ∧ xj = 0

tactic: rw [Dfinsupp.single_eq_same] at hci hcj
state_before: case neg
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
inst✝ : (i : ι) → Zero (β i)
s : Finset ι
x : (i : ↑↑s) → β ↑i
i✝ i j : ι
xi : β i
xj : β j
h : single i xi = single j xj
hij : ¬i = j
h_coe : ↑(single i xi) = ↑(single j xj)
hci : ↑(single i xi) i = ↑(single j xj) i
hcj : ↑(single i xi) j = ↑(single j xj) j
⊢ i = j ∧ HEq xi xj ∨ xi = 0 ∧ xj = 0

tactic: rw [Dfinsupp.single_eq_of_ne (Ne.symm hij)] at hci
state_before: case neg
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
inst✝ : (i : ι) → Zero (β i)
s : Finset ι
x : (i : ↑↑s) → β ↑i
i✝ i j : ι
xi : β i
xj : β j
h : single i xi = single j xj
hij : ¬i = j
h_coe : ↑(single i xi) = ↑(single j xj)
hci : xi = ↑(single j xj) i
hcj : ↑(single i xi) j = xj
⊢ i = j ∧ HEq xi xj ∨ xi = 0 ∧ xj = 0

tactic: rw [Dfinsupp.single_eq_of_ne hij] at hcj
state_before: case neg
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
inst✝ : (i : ι) → Zero (β i)
s : Finset ι
x : (i : ↑↑s) → β ↑i
i✝ i j : ι
xi : β i
xj : β j
h : single i xi = single j xj
hij : ¬i = j
h_coe : ↑(single i xi) = ↑(single j xj)
hci : xi = 0
hcj : ↑(single i xi) j = xj
⊢ i = j ∧ HEq xi xj ∨ xi = 0 ∧ xj = 0

tactic: exact Or.inr ⟨hci, hcj.symm⟩
state_before: case neg
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
inst✝ : (i : ι) → Zero (β i)
s : Finset ι
x : (i : ↑↑s) → β ↑i
i✝ i j : ι
xi : β i
xj : β j
h : single i xi = single j xj
hij : ¬i = j
h_coe : ↑(single i xi) = ↑(single j xj)
hci : xi = 0
hcj : 0 = xj
⊢ i = j ∧ HEq xi xj ∨ xi = 0 ∧ xj = 0

tactic: rintro (⟨rfl, hxi⟩ | ⟨hi, hj⟩)
state_before: case mpr
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
inst✝ : (i : ι) → Zero (β i)
s : Finset ι
x : (i : ↑↑s) → β ↑i
i✝ i j : ι
xi : β i
xj : β j
⊢ i = j ∧ HEq xi xj ∨ xi = 0 ∧ xj = 0 → single i xi = single j xj

tactic: rw [eq_of_heq hxi]
state_before: case mpr.inl.intro
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
inst✝ : (i : ι) → Zero (β i)
s : Finset ι
x : (i : ↑↑s) → β ↑i
i✝ i : ι
xi xj : β i
hxi : HEq xi xj
⊢ single i xi = single i xj

tactic: rw [hi, hj, Dfinsupp.single_zero, Dfinsupp.single_zero]
state_before: case mpr.inr.intro
ι : Type u
γ : Type w
β : ι → Type v
β₁ : ι → Type v₁
β₂ : ι → Type v₂
dec : DecidableEq ι
inst✝ : (i : ι) → Zero (β i)
s : Finset ι
x : (i : ↑↑s) → β ↑i
i✝ i j : ι
xi : β i
xj : β j
hi : xi = 0
hj : xj = 0
⊢ single i xi = single j xj