Theorem: ZFSet.pair_injective
File: Mathlib/SetTheory/ZFC/Basic.lean

tactic: have ae := ext_iff.1 H
state_before: x x' y y' : ZFSet
H : x.pair y = x'.pair y'
⊢ x = x' ∧ y = y'
state_after: x x' y y' : ZFSet
H : x.pair y = x'.pair y'
ae : ∀ (z : ZFSet), z ∈ x.pair y ↔ z ∈ x'.pair y'
⊢ x = x' ∧ y = y'

tactic: simp only [pair, mem_pair] at ae
state_before: x x' y y' : ZFSet
H : x.pair y = x'.pair y'
ae : ∀ (z : ZFSet), z ∈ x.pair y ↔ z ∈ x'.pair y'
⊢ x = x' ∧ y = y'
state_after: x x' y y' : ZFSet
H : x.pair y = x'.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, y} ↔ z = {x'} ∨ z = {x', y'}
⊢ x = x' ∧ y = y'

tactic: obtain xyx | xyy' := (ae {x, y}).1 (by simp)
state_before: x y y' : ZFSet
H : x.pair y = x.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, y} ↔ z = {x} ∨ z = {x, y'}
he : x = y → y = y'
⊢ x = x ∧ y = y'
state_after: case inl
x y y' : ZFSet
H : x.pair y = x.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, y} ↔ z = {x} ∨ z = {x, y'}
he : x = y → y = y'
xyx : {x, y} = {x}
⊢ x = x ∧ y = y'

case inr
x y y' : ZFSet
H : x.pair y = x.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, y} ↔ z = {x} ∨ z = {x, y'}
he : x = y → y = y'
xyy' : {x, y} = {x, y'}
⊢ x = x ∧ y = y'

tactic: cases' (ae {x}).1 (by simp) with h h
state_before: x x' y y' : ZFSet
H : x.pair y = x'.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, y} ↔ z = {x'} ∨ z = {x', y'}
⊢ x = x'
state_after: case inl
x x' y y' : ZFSet
H : x.pair y = x'.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, y} ↔ z = {x'} ∨ z = {x', y'}
h : {x} = {x'}
⊢ x = x'

case inr
x x' y y' : ZFSet
H : x.pair y = x'.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, y} ↔ z = {x'} ∨ z = {x', y'}
h : {x} = {x', y'}
⊢ x = x'

tactic: simp
state_before: x x' y y' : ZFSet
H : x.pair y = x'.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, y} ↔ z = {x'} ∨ z = {x', y'}
⊢ {x} = {x} ∨ {x} = {x, y}
state_after: no goals

tactic: exact singleton_injective h
state_before: case inl
x x' y y' : ZFSet
H : x.pair y = x'.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, y} ↔ z = {x'} ∨ z = {x', y'}
h : {x} = {x'}
⊢ x = x'
state_after: no goals

tactic: have m : x' ∈ ({x} : ZFSet) := by simp [h]
state_before: case inr
x x' y y' : ZFSet
H : x.pair y = x'.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, y} ↔ z = {x'} ∨ z = {x', y'}
h : {x} = {x', y'}
⊢ x = x'
state_after: case inr
x x' y y' : ZFSet
H : x.pair y = x'.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, y} ↔ z = {x'} ∨ z = {x', y'}
h : {x} = {x', y'}
m : x' ∈ {x}
⊢ x = x'

tactic: rw [mem_singleton.mp m]
state_before: case inr
x x' y y' : ZFSet
H : x.pair y = x'.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, y} ↔ z = {x'} ∨ z = {x', y'}
h : {x} = {x', y'}
m : x' ∈ {x}
⊢ x = x'
state_after: no goals

tactic: simp [h]
state_before: x x' y y' : ZFSet
H : x.pair y = x'.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, y} ↔ z = {x'} ∨ z = {x', y'}
h : {x} = {x', y'}
⊢ x' ∈ {x}
state_after: no goals

tactic: rintro rfl
state_before: x y y' : ZFSet
H : x.pair y = x.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, y} ↔ z = {x} ∨ z = {x, y'}
⊢ x = y → y = y'
state_after: x y' : ZFSet
H : x.pair x = x.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, x} ↔ z = {x} ∨ z = {x, y'}
⊢ x = y'

tactic: cases' (ae {x, y'}).2 (by simp only [eq_self_iff_true, or_true_iff]) with xy'x xy'xx
state_before: x y' : ZFSet
H : x.pair x = x.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, x} ↔ z = {x} ∨ z = {x, y'}
⊢ x = y'
state_after: case inl
x y' : ZFSet
H : x.pair x = x.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, x} ↔ z = {x} ∨ z = {x, y'}
xy'x : {x, y'} = {x}
⊢ x = y'

case inr
x y' : ZFSet
H : x.pair x = x.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, x} ↔ z = {x} ∨ z = {x, y'}
xy'xx : {x, y'} = {x, x}
⊢ x = y'

tactic: simp only [eq_self_iff_true, or_true_iff]
state_before: x y' : ZFSet
H : x.pair x = x.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, x} ↔ z = {x} ∨ z = {x, y'}
⊢ {x, y'} = {x} ∨ {x, y'} = {x, y'}
state_after: no goals

tactic: rw [eq_comm, ← mem_singleton, ← xy'x, mem_pair]
state_before: case inl
x y' : ZFSet
H : x.pair x = x.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, x} ↔ z = {x} ∨ z = {x, y'}
xy'x : {x, y'} = {x}
⊢ x = y'
state_after: case inl
x y' : ZFSet
H : x.pair x = x.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, x} ↔ z = {x} ∨ z = {x, y'}
xy'x : {x, y'} = {x}
⊢ y' = x ∨ y' = y'

tactic: exact Or.inr rfl
state_before: case inl
x y' : ZFSet
H : x.pair x = x.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, x} ↔ z = {x} ∨ z = {x, y'}
xy'x : {x, y'} = {x}
⊢ y' = x ∨ y' = y'
state_after: no goals

tactic: simpa [eq_comm] using (ext_iff.1 xy'xx y').1 (by simp)
state_before: case inr
x y' : ZFSet
H : x.pair x = x.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, x} ↔ z = {x} ∨ z = {x, y'}
xy'xx : {x, y'} = {x, x}
⊢ x = y'
state_after: no goals

tactic: simp
state_before: x y' : ZFSet
H : x.pair x = x.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, x} ↔ z = {x} ∨ z = {x, y'}
xy'xx : {x, y'} = {x, x}
⊢ y' ∈ {x, y'}
state_after: no goals

tactic: simp
state_before: x y y' : ZFSet
H : x.pair y = x.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, y} ↔ z = {x} ∨ z = {x, y'}
he : x = y → y = y'
⊢ {x, y} = {x} ∨ {x, y} = {x, y}
state_after: no goals

tactic: obtain rfl := mem_singleton.mp ((ext_iff.1 xyx y).1 <| by simp)
state_before: case inl
x y y' : ZFSet
H : x.pair y = x.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, y} ↔ z = {x} ∨ z = {x, y'}
he : x = y → y = y'
xyx : {x, y} = {x}
⊢ x = x ∧ y = y'
state_after: case inl
y y' : ZFSet
H : y.pair y = y.pair y'
ae : ∀ (z : ZFSet), z = {y} ∨ z = {y, y} ↔ z = {y} ∨ z = {y, y'}
he : y = y → y = y'
xyx : {y, y} = {y}
⊢ y = y ∧ y = y'

tactic: simp [he rfl]
state_before: case inl
y y' : ZFSet
H : y.pair y = y.pair y'
ae : ∀ (z : ZFSet), z = {y} ∨ z = {y, y} ↔ z = {y} ∨ z = {y, y'}
he : y = y → y = y'
xyx : {y, y} = {y}
⊢ y = y ∧ y = y'
state_after: no goals

tactic: simp
state_before: x y y' : ZFSet
H : x.pair y = x.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, y} ↔ z = {x} ∨ z = {x, y'}
he : x = y → y = y'
xyx : {x, y} = {x}
⊢ y ∈ {x, y}
state_after: no goals

tactic: obtain rfl | yy' := mem_pair.mp ((ext_iff.1 xyy' y).1 <| by simp)
state_before: case inr
x y y' : ZFSet
H : x.pair y = x.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, y} ↔ z = {x} ∨ z = {x, y'}
he : x = y → y = y'
xyy' : {x, y} = {x, y'}
⊢ x = x ∧ y = y'
state_after: case inr.inl
y y' : ZFSet
H : y.pair y = y.pair y'
ae : ∀ (z : ZFSet), z = {y} ∨ z = {y, y} ↔ z = {y} ∨ z = {y, y'}
he : y = y → y = y'
xyy' : {y, y} = {y, y'}
⊢ y = y ∧ y = y'

case inr.inr
x y y' : ZFSet
H : x.pair y = x.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, y} ↔ z = {x} ∨ z = {x, y'}
he : x = y → y = y'
xyy' : {x, y} = {x, y'}
yy' : y = y'
⊢ x = x ∧ y = y'

tactic: simp
state_before: x y y' : ZFSet
H : x.pair y = x.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, y} ↔ z = {x} ∨ z = {x, y'}
he : x = y → y = y'
xyy' : {x, y} = {x, y'}
⊢ y ∈ {x, y}
state_after: no goals

tactic: simp [he rfl]
state_before: case inr.inl
y y' : ZFSet
H : y.pair y = y.pair y'
ae : ∀ (z : ZFSet), z = {y} ∨ z = {y, y} ↔ z = {y} ∨ z = {y, y'}
he : y = y → y = y'
xyy' : {y, y} = {y, y'}
⊢ y = y ∧ y = y'
state_after: no goals

tactic: simp [yy']
state_before: case inr.inr
x y y' : ZFSet
H : x.pair y = x.pair y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, y} ↔ z = {x} ∨ z = {x, y'}
he : x = y → y = y'
xyy' : {x, y} = {x, y'}
yy' : y = y'
⊢ x = x ∧ y = y'
state_after: no goals