Theorem: Function.updateFinset_updateFinset
File: Mathlib/Data/Finset/Update.lean

tactic: set e := Equiv.Finset.union s t hst
state_before: ι : Type u_1
π : ι → Type u_2
x : (i : ι) → π i
inst✝ : DecidableEq ι
s t : Finset ι
hst : Disjoint s t
y : (i : { x // x ∈ s }) → π ↑i
z : (i : { x // x ∈ t }) → π ↑i
⊢ updateFinset (updateFinset x s y) t z = updateFinset x (s ∪ t) ((piFinsetUnion π hst) (y, z))
state_after: ι : Type u_1
π : ι → Type u_2
x : (i : ι) → π i
inst✝ : DecidableEq ι
s t : Finset ι
hst : Disjoint s t
y : (i : { x // x ∈ s }) → π ↑i
z : (i : { x // x ∈ t }) → π ↑i
e : { x // x ∈ s } ⊕ { x // x ∈ t } ≃ { x // x ∈ s ∪ t } := Finset.union s t hst
⊢ updateFinset (updateFinset x s y) t z = updateFinset x (s ∪ t) ((piFinsetUnion π hst) (y, z))

tactic: congr with i
state_before: ι : Type u_1
π : ι → Type u_2
x : (i : ι) → π i
inst✝ : DecidableEq ι
s t : Finset ι
hst : Disjoint s t
y : (i : { x // x ∈ s }) → π ↑i
z : (i : { x // x ∈ t }) → π ↑i
e : { x // x ∈ s } ⊕ { x // x ∈ t } ≃ { x // x ∈ s ∪ t } := Finset.union s t hst
⊢ updateFinset (updateFinset x s y) t z = updateFinset x (s ∪ t) ((piFinsetUnion π hst) (y, z))
state_after: case h
ι : Type u_1
π : ι → Type u_2
x : (i : ι) → π i
inst✝ : DecidableEq ι
s t : Finset ι
hst : Disjoint s t
y : (i : { x // x ∈ s }) → π ↑i
z : (i : { x // x ∈ t }) → π ↑i
e : { x // x ∈ s } ⊕ { x // x ∈ t } ≃ { x // x ∈ s ∪ t } := Finset.union s t hst
i : ι
⊢ updateFinset (updateFinset x s y) t z i = updateFinset x (s ∪ t) ((piFinsetUnion π hst) (y, z)) i

tactic: by_cases his : i ∈ s <;> by_cases hit : i ∈ t <;>
  simp only [updateFinset, his, hit, dif_pos, dif_neg, Finset.mem_union, true_or_iff,
    false_or_iff, not_false_iff]
state_before: case h
ι : Type u_1
π : ι → Type u_2
x : (i : ι) → π i
inst✝ : DecidableEq ι
s t : Finset ι
hst : Disjoint s t
y : (i : { x // x ∈ s }) → π ↑i
z : (i : { x // x ∈ t }) → π ↑i
e : { x // x ∈ s } ⊕ { x // x ∈ t } ≃ { x // x ∈ s ∪ t } := Finset.union s t hst
i : ι
⊢ updateFinset (updateFinset x s y) t z i = updateFinset x (s ∪ t) ((piFinsetUnion π hst) (y, z)) i
state_after: case pos
ι : Type u_1
π : ι → Type u_2
x : (i : ι) → π i
inst✝ : DecidableEq ι
s t : Finset ι
hst : Disjoint s t
y : (i : { x // x ∈ s }) → π ↑i
z : (i : { x // x ∈ t }) → π ↑i
e : { x // x ∈ s } ⊕ { x // x ∈ t } ≃ { x // x ∈ s ∪ t } := Finset.union s t hst
i : ι
his : i ∈ s
hit : i ∈ t
⊢ z ⟨i, ⋯⟩ = (piFinsetUnion π hst) (y, z) ⟨i, ⋯⟩

case neg
ι : Type u_1
π : ι → Type u_2
x : (i : ι) → π i
inst✝ : DecidableEq ι
s t : Finset ι
hst : Disjoint s t
y : (i : { x // x ∈ s }) → π ↑i
z : (i : { x // x ∈ t }) → π ↑i
e : { x // x ∈ s } ⊕ { x // x ∈ t } ≃ { x // x ∈ s ∪ t } := Finset.union s t hst
i : ι
his : i ∈ s
hit : i ∉ t
⊢ y ⟨i, ⋯⟩ = (piFinsetUnion π hst) (y, z) ⟨i, ⋯⟩

case pos
ι : Type u_1
π : ι → Type u_2
x : (i : ι) → π i
inst✝ : DecidableEq ι
s t : Finset ι
hst : Disjoint s t
y : (i : { x // x ∈ s }) → π ↑i
z : (i : { x // x ∈ t }) → π ↑i
e : { x // x ∈ s } ⊕ { x // x ∈ t } ≃ { x // x ∈ s ∪ t } := Finset.union s t hst
i : ι
his : i ∉ s
hit : i ∈ t
⊢ z ⟨i, ⋯⟩ = (piFinsetUnion π hst) (y, z) ⟨i, ⋯⟩

tactic: exfalso
state_before: case pos
ι : Type u_1
π : ι → Type u_2
x : (i : ι) → π i
inst✝ : DecidableEq ι
s t : Finset ι
hst : Disjoint s t
y : (i : { x // x ∈ s }) → π ↑i
z : (i : { x // x ∈ t }) → π ↑i
e : { x // x ∈ s } ⊕ { x // x ∈ t } ≃ { x // x ∈ s ∪ t } := Finset.union s t hst
i : ι
his : i ∈ s
hit : i ∈ t
⊢ z ⟨i, ⋯⟩ = (piFinsetUnion π hst) (y, z) ⟨i, ⋯⟩
state_after: case pos
ι : Type u_1
π : ι → Type u_2
x : (i : ι) → π i
inst✝ : DecidableEq ι
s t : Finset ι
hst : Disjoint s t
y : (i : { x // x ∈ s }) → π ↑i
z : (i : { x // x ∈ t }) → π ↑i
e : { x // x ∈ s } ⊕ { x // x ∈ t } ≃ { x // x ∈ s ∪ t } := Finset.union s t hst
i : ι
his : i ∈ s
hit : i ∈ t
⊢ False

tactic: exact Finset.disjoint_left.mp hst his hit
state_before: case pos
ι : Type u_1
π : ι → Type u_2
x : (i : ι) → π i
inst✝ : DecidableEq ι
s t : Finset ι
hst : Disjoint s t
y : (i : { x // x ∈ s }) → π ↑i
z : (i : { x // x ∈ t }) → π ↑i
e : { x // x ∈ s } ⊕ { x // x ∈ t } ≃ { x // x ∈ s ∪ t } := Finset.union s t hst
i : ι
his : i ∈ s
hit : i ∈ t
⊢ False
state_after: no goals

tactic: exact piCongrLeft_sum_inl (fun b : ↥(s ∪ t) => π b) e y z ⟨i, his⟩ |>.symm
state_before: case neg
ι : Type u_1
π : ι → Type u_2
x : (i : ι) → π i
inst✝ : DecidableEq ι
s t : Finset ι
hst : Disjoint s t
y : (i : { x // x ∈ s }) → π ↑i
z : (i : { x // x ∈ t }) → π ↑i
e : { x // x ∈ s } ⊕ { x // x ∈ t } ≃ { x // x ∈ s ∪ t } := Finset.union s t hst
i : ι
his : i ∈ s
hit : i ∉ t
⊢ y ⟨i, ⋯⟩ = (piFinsetUnion π hst) (y, z) ⟨i, ⋯⟩
state_after: no goals

tactic: exact piCongrLeft_sum_inr (fun b : ↥(s ∪ t) => π b) e y z ⟨i, hit⟩ |>.symm
state_before: case pos
ι : Type u_1
π : ι → Type u_2
x : (i : ι) → π i
inst✝ : DecidableEq ι
s t : Finset ι
hst : Disjoint s t
y : (i : { x // x ∈ s }) → π ↑i
z : (i : { x // x ∈ t }) → π ↑i
e : { x // x ∈ s } ⊕ { x // x ∈ t } ≃ { x // x ∈ s ∪ t } := Finset.union s t hst
i : ι
his : i ∉ s
hit : i ∈ t
⊢ z ⟨i, ⋯⟩ = (piFinsetUnion π hst) (y, z) ⟨i, ⋯⟩
state_after: no goals