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 : pair x y = pair x' y'
⊢ x = x' ∧ y = y'

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

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

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

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

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

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

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

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

tactic: rintro rfl
state_before: x y y' : ZFSet
H : pair x y = pair x y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, y} ↔ z = {x} ∨ z = {x, y'}
⊢ x = y → y = 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 : pair x x = pair x y'
ae : ∀ (z : ZFSet), z = {x} ∨ z = {x, x} ↔ z = {x} ∨ z = {x, y'}
⊢ x = y'

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

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

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

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

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

tactic: simp
state_before: x y y' : ZFSet
H : pair x y = pair x 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}

tactic: obtain rfl := mem_singleton.mp ((ext_iff.1 xyx y).1 <| by simp)
state_before: case inl
x y y' : ZFSet
H : pair x y = pair x 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'

tactic: simp [he rfl]
state_before: case inl
y y' : ZFSet
H : pair y y = pair y 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
state_before: x y y' : ZFSet
H : pair x y = pair x 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}

tactic: obtain rfl | yy' := mem_pair.mp ((ext_iff.1 xyy' y).1 <| by simp)
state_before: case inr
x y y' : ZFSet
H : pair x y = pair x 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: simp
state_before: x y y' : ZFSet
H : pair x y = pair x 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}

tactic: simp [he rfl]
state_before: case inr.inl
y y' : ZFSet
H : pair y y = pair y 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'

tactic: simp [yy']
state_before: case inr.inr
x y y' : ZFSet
H : pair x y = pair x 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'