l3lab/ntp-mathlib huggingface dataset:
theorem pair_injective : Function.Injective2 pair := fun x x' y y' H => by
  have ae := ext_iff.1 H
  simp only [pair, mem_pair] at ae
  obtain rfl : x = x' := by
    cases' (ae {x}).1 (by simp) with h h
    · exact singleton_injective h
    · have m : x' ∈ ({x} : ZFSet) := by simp [h]
      rw [mem_singleton.mp m]
  

Proof state:
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 ∧ y = y'

Next tactic:
have he : x = y → y = y' := by
    rintro rfl
    cases' (ae {x, y'}).2 (by simp only [eq_self_iff_true, or_true_iff]) with xy'x xy'xx
    · rw [eq_comm, ← mem_singleton, ← xy'x, mem_pair]
      exact Or.inr rfl
    · simpa [eq_comm] using (ext_iff.1 xy'xx y').1 (by simp)
theorem pair_injective : Function.Injective2 pair := fun x x' y y' H => by
  have ae := ext_iff.1 H
  simp only [pair, mem_pair] at ae
  obtain rfl : x = x' := by
    cases' (ae {x}).1 (by simp) with h h
    · exact singleton_injective h
    · have m : x' ∈ ({x} : ZFSet) := by simp [h]
      rw [mem_singleton.mp m]
  have he : x = y → y = y' := by
    

Proof state:
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'

Next tactic:
rintro rfl
theorem pair_injective : Function.Injective2 pair := fun x x' y y' H => by
  have ae := ext_iff.1 H
  simp only [pair, mem_pair] at ae
  obtain rfl : x = x' := by
    cases' (ae {x}).1 (by simp) with h h
    · exact singleton_injective h
    · have m : x' ∈ ({x} : ZFSet) := by simp [h]
      rw [mem_singleton.mp m]
  have he : x = y → y = y' := by
    rintro rfl
    

Proof state:
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'

Next tactic:
cases' (ae {x, y'}).2 (by simp only [eq_self_iff_true, or_true_iff]) with xy'x xy'xx
theorem pair_injective : Function.Injective2 pair := fun x x' y y' H => by
  have ae := ext_iff.1 H
  simp only [pair, mem_pair] at ae
  obtain rfl : x = x' := by
    cases' (ae {x}).1 (by simp) with h h
    · exact singleton_injective h
    · have m : x' ∈ ({x} : ZFSet) := by simp [h]
      rw [mem_singleton.mp m]
  have he : x = y → y = y' := by
    rintro rfl
    cases' (ae {x, y'}).2 (by 

Proof state:
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'}

Next tactic:
simp only [eq_self_iff_true, or_true_iff]
theorem pair_injective : Function.Injective2 pair := fun x x' y y' H => by
  have ae := ext_iff.1 H
  simp only [pair, mem_pair] at ae
  obtain rfl : x = x' := by
    cases' (ae {x}).1 (by simp) with h h
    · exact singleton_injective h
    · have m : x' ∈ ({x} : ZFSet) := by simp [h]
      rw [mem_singleton.mp m]
  have he : x = y → y = y' := by
    rintro rfl
    cases' (ae {x, y'}).2 (by simp only [eq_self_iff_true, or_true_iff]) with xy'x xy'xx
    · 

Proof state:
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'

Next tactic:
rw [eq_comm, ← mem_singleton, ← xy'x, mem_pair]
theorem pair_injective : Function.Injective2 pair := fun x x' y y' H => by
  have ae := ext_iff.1 H
  simp only [pair, mem_pair] at ae
  obtain rfl : x = x' := by
    cases' (ae {x}).1 (by simp) with h h
    · exact singleton_injective h
    · have m : x' ∈ ({x} : ZFSet) := by simp [h]
      rw [mem_singleton.mp m]
  have he : x = y → y = y' := by
    rintro rfl
    cases' (ae {x, y'}).2 (by simp only [eq_self_iff_true, or_true_iff]) with xy'x xy'xx
    · rw [eq_comm, ← mem_singleton, ← xy'x, mem_pair]
      

Proof state:
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'

Next tactic:
exact Or.inr rfl
theorem pair_injective : Function.Injective2 pair := fun x x' y y' H => by
  have ae := ext_iff.1 H
  simp only [pair, mem_pair] at ae
  obtain rfl : x = x' := by
    cases' (ae {x}).1 (by simp) with h h
    · exact singleton_injective h
    · have m : x' ∈ ({x} : ZFSet) := by simp [h]
      rw [mem_singleton.mp m]
  have he : x = y → y = y' := by
    rintro rfl
    cases' (ae {x, y'}).2 (by simp only [eq_self_iff_true, or_true_iff]) with xy'x xy'xx
    · rw [eq_comm, ← mem_singleton, ← xy'x, mem_pair]
      exact Or.inr rfl
    · 

Proof state:
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'

Next tactic:
simpa [eq_comm] using (ext_iff.1 xy'xx y').1 (by simp)
theorem pair_injective : Function.Injective2 pair := fun x x' y y' H => by
  have ae := ext_iff.1 H
  simp only [pair, mem_pair] at ae
  obtain rfl : x = x' := by
    cases' (ae {x}).1 (by simp) with h h
    · exact singleton_injective h
    · have m : x' ∈ ({x} : ZFSet) := by simp [h]
      rw [mem_singleton.mp m]
  have he : x = y → y = y' := by
    rintro rfl
    cases' (ae {x, y'}).2 (by simp only [eq_self_iff_true, or_true_iff]) with xy'x xy'xx
    · rw [eq_comm, ← mem_singleton, ← xy'x, mem_pair]
      exact Or.inr rfl
    · simpa [eq_comm] using (ext_iff.1 xy'xx y').1 (by 

Proof state:
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'}

Next tactic:
simp
theorem pair_injective : Function.Injective2 pair := fun x x' y y' H => by
  have ae := ext_iff.1 H
  simp only [pair, mem_pair] at ae
  obtain rfl : x = x' := by
    cases' (ae {x}).1 (by simp) with h h
    · exact singleton_injective h
    · have m : x' ∈ ({x} : ZFSet) := by simp [h]
      rw [mem_singleton.mp m]
  have he : x = y → y = y' := by
    rintro rfl
    cases' (ae {x, y'}).2 (by simp only [eq_self_iff_true, or_true_iff]) with xy'x xy'xx
    · rw [eq_comm, ← mem_singleton, ← xy'x, mem_pair]
      exact Or.inr rfl
    · simpa [eq_comm] using (ext_iff.1 xy'xx y').1 (by simp)
  

Proof state:
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'

Next tactic:
obtain xyx | xyy' := (ae {x, y}).1 (by simp)
theorem pair_injective : Function.Injective2 pair := fun x x' y y' H => by
  have ae := ext_iff.1 H
  simp only [pair, mem_pair] at ae
  obtain rfl : x = x' := by
    cases' (ae {x}).1 (by simp) with h h
    · exact singleton_injective h
    · have m : x' ∈ ({x} : ZFSet) := by simp [h]
      rw [mem_singleton.mp m]
  have he : x = y → y = y' := by
    rintro rfl
    cases' (ae {x, y'}).2 (by simp only [eq_self_iff_true, or_true_iff]) with xy'x xy'xx
    · rw [eq_comm, ← mem_singleton, ← xy'x, mem_pair]
      exact Or.inr rfl
    · simpa [eq_comm] using (ext_iff.1 xy'xx y').1 (by simp)
  obtain xyx | xyy' := (ae {x, y}).1 (by 

Proof state:
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}

Next tactic:
simp
theorem pair_injective : Function.Injective2 pair := fun x x' y y' H => by
  have ae := ext_iff.1 H
  simp only [pair, mem_pair] at ae
  obtain rfl : x = x' := by
    cases' (ae {x}).1 (by simp) with h h
    · exact singleton_injective h
    · have m : x' ∈ ({x} : ZFSet) := by simp [h]
      rw [mem_singleton.mp m]
  have he : x = y → y = y' := by
    rintro rfl
    cases' (ae {x, y'}).2 (by simp only [eq_self_iff_true, or_true_iff]) with xy'x xy'xx
    · rw [eq_comm, ← mem_singleton, ← xy'x, mem_pair]
      exact Or.inr rfl
    · simpa [eq_comm] using (ext_iff.1 xy'xx y').1 (by simp)
  obtain xyx | xyy' := (ae {x, y}).1 (by simp)
  · 

Proof state:
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'

Next tactic:
obtain rfl := mem_singleton.mp ((ext_iff.1 xyx y).1 <| by simp)
theorem pair_injective : Function.Injective2 pair := fun x x' y y' H => by
  have ae := ext_iff.1 H
  simp only [pair, mem_pair] at ae
  obtain rfl : x = x' := by
    cases' (ae {x}).1 (by simp) with h h
    · exact singleton_injective h
    · have m : x' ∈ ({x} : ZFSet) := by simp [h]
      rw [mem_singleton.mp m]
  have he : x = y → y = y' := by
    rintro rfl
    cases' (ae {x, y'}).2 (by simp only [eq_self_iff_true, or_true_iff]) with xy'x xy'xx
    · rw [eq_comm, ← mem_singleton, ← xy'x, mem_pair]
      exact Or.inr rfl
    · simpa [eq_comm] using (ext_iff.1 xy'xx y').1 (by simp)
  obtain xyx | xyy' := (ae {x, y}).1 (by simp)
  · obtain rfl := mem_singleton.mp ((ext_iff.1 xyx y).1 <| by 

Proof state:
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}

Next tactic:
simp
theorem pair_injective : Function.Injective2 pair := fun x x' y y' H => by
  have ae := ext_iff.1 H
  simp only [pair, mem_pair] at ae
  obtain rfl : x = x' := by
    cases' (ae {x}).1 (by simp) with h h
    · exact singleton_injective h
    · have m : x' ∈ ({x} : ZFSet) := by simp [h]
      rw [mem_singleton.mp m]
  have he : x = y → y = y' := by
    rintro rfl
    cases' (ae {x, y'}).2 (by simp only [eq_self_iff_true, or_true_iff]) with xy'x xy'xx
    · rw [eq_comm, ← mem_singleton, ← xy'x, mem_pair]
      exact Or.inr rfl
    · simpa [eq_comm] using (ext_iff.1 xy'xx y').1 (by simp)
  obtain xyx | xyy' := (ae {x, y}).1 (by simp)
  · obtain rfl := mem_singleton.mp ((ext_iff.1 xyx y).1 <| by simp)
    

Proof state:
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'

Next tactic:
simp [he rfl]
theorem pair_injective : Function.Injective2 pair := fun x x' y y' H => by
  have ae := ext_iff.1 H
  simp only [pair, mem_pair] at ae
  obtain rfl : x = x' := by
    cases' (ae {x}).1 (by simp) with h h
    · exact singleton_injective h
    · have m : x' ∈ ({x} : ZFSet) := by simp [h]
      rw [mem_singleton.mp m]
  have he : x = y → y = y' := by
    rintro rfl
    cases' (ae {x, y'}).2 (by simp only [eq_self_iff_true, or_true_iff]) with xy'x xy'xx
    · rw [eq_comm, ← mem_singleton, ← xy'x, mem_pair]
      exact Or.inr rfl
    · simpa [eq_comm] using (ext_iff.1 xy'xx y').1 (by simp)
  obtain xyx | xyy' := (ae {x, y}).1 (by simp)
  · obtain rfl := mem_singleton.mp ((ext_iff.1 xyx y).1 <| by simp)
    simp [he rfl]
  · 

Proof state:
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'

Next tactic:
obtain rfl | yy' := mem_pair.mp ((ext_iff.1 xyy' y).1 <| by simp)
theorem pair_injective : Function.Injective2 pair := fun x x' y y' H => by
  have ae := ext_iff.1 H
  simp only [pair, mem_pair] at ae
  obtain rfl : x = x' := by
    cases' (ae {x}).1 (by simp) with h h
    · exact singleton_injective h
    · have m : x' ∈ ({x} : ZFSet) := by simp [h]
      rw [mem_singleton.mp m]
  have he : x = y → y = y' := by
    rintro rfl
    cases' (ae {x, y'}).2 (by simp only [eq_self_iff_true, or_true_iff]) with xy'x xy'xx
    · rw [eq_comm, ← mem_singleton, ← xy'x, mem_pair]
      exact Or.inr rfl
    · simpa [eq_comm] using (ext_iff.1 xy'xx y').1 (by simp)
  obtain xyx | xyy' := (ae {x, y}).1 (by simp)
  · obtain rfl := mem_singleton.mp ((ext_iff.1 xyx y).1 <| by simp)
    simp [he rfl]
  · obtain rfl | yy' := mem_pair.mp ((ext_iff.1 xyy' y).1 <| by 

Proof state:
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}

Next tactic:
simp
theorem pair_injective : Function.Injective2 pair := fun x x' y y' H => by
  have ae := ext_iff.1 H
  simp only [pair, mem_pair] at ae
  obtain rfl : x = x' := by
    cases' (ae {x}).1 (by simp) with h h
    · exact singleton_injective h
    · have m : x' ∈ ({x} : ZFSet) := by simp [h]
      rw [mem_singleton.mp m]
  have he : x = y → y = y' := by
    rintro rfl
    cases' (ae {x, y'}).2 (by simp only [eq_self_iff_true, or_true_iff]) with xy'x xy'xx
    · rw [eq_comm, ← mem_singleton, ← xy'x, mem_pair]
      exact Or.inr rfl
    · simpa [eq_comm] using (ext_iff.1 xy'xx y').1 (by simp)
  obtain xyx | xyy' := (ae {x, y}).1 (by simp)
  · obtain rfl := mem_singleton.mp ((ext_iff.1 xyx y).1 <| by simp)
    simp [he rfl]
  · obtain rfl | yy' := mem_pair.mp ((ext_iff.1 xyy' y).1 <| by simp)
    · 

Proof state:
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'

Next tactic:
simp [he rfl]
theorem pair_injective : Function.Injective2 pair := fun x x' y y' H => by
  have ae := ext_iff.1 H
  simp only [pair, mem_pair] at ae
  obtain rfl : x = x' := by
    cases' (ae {x}).1 (by simp) with h h
    · exact singleton_injective h
    · have m : x' ∈ ({x} : ZFSet) := by simp [h]
      rw [mem_singleton.mp m]
  have he : x = y → y = y' := by
    rintro rfl
    cases' (ae {x, y'}).2 (by simp only [eq_self_iff_true, or_true_iff]) with xy'x xy'xx
    · rw [eq_comm, ← mem_singleton, ← xy'x, mem_pair]
      exact Or.inr rfl
    · simpa [eq_comm] using (ext_iff.1 xy'xx y').1 (by simp)
  obtain xyx | xyy' := (ae {x, y}).1 (by simp)
  · obtain rfl := mem_singleton.mp ((ext_iff.1 xyx y).1 <| by simp)
    simp [he rfl]
  · obtain rfl | yy' := mem_pair.mp ((ext_iff.1 xyy' y).1 <| by simp)
    · simp [he rfl]
    · 

Proof state:
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'

Next tactic:
simp [yy']
@[simp]
theorem mem_prod {x y z : ZFSet.{u}} : z ∈ prod x y ↔ ∃ a ∈ x, ∃ b ∈ y, z = pair a b := by
  

Proof state:
x y z : ZFSet
⊢ z ∈ prod x y ↔ ∃ a ∈ x, ∃ b ∈ y, z = pair a b

Next tactic:
simp [prod]
theorem pair_mem_prod {x y a b : ZFSet.{u}} : pair a b ∈ prod x y ↔ a ∈ x ∧ b ∈ y := by
  

Proof state:
x y a b : ZFSet
⊢ pair a b ∈ prod x y ↔ a ∈ x ∧ b ∈ y

Next tactic:
simp
@[simp]
theorem mem_funs {x y f : ZFSet.{u}} : f ∈ funs x y ↔ IsFunc x y f := by 

Proof state:
x y f : ZFSet
⊢ f ∈ funs x y ↔ IsFunc x y f

Next tactic:
simp [funs, IsFunc]
theorem map_unique {f : ZFSet.{u} → ZFSet.{u}} [H : Definable 1 f] {x z : ZFSet.{u}}
    (zx : z ∈ x) : ∃! w, pair z w ∈ map f x :=
  ⟨f z, image.mk _ _ zx, fun y yx => by
    

Proof state:
f : ZFSet → ZFSet
H : Definable 1 f
x z : ZFSet
zx : z ∈ x
y : ZFSet
yx : (fun w => pair z w ∈ map f x) y
⊢ y = f z

Next tactic:
let ⟨w, _, we⟩ := mem_image.1 yx
theorem map_unique {f : ZFSet.{u} → ZFSet.{u}} [H : Definable 1 f] {x z : ZFSet.{u}}
    (zx : z ∈ x) : ∃! w, pair z w ∈ map f x :=
  ⟨f z, image.mk _ _ zx, fun y yx => by
    let ⟨w, _, we⟩ := mem_image.1 yx
    

Proof state:
f : ZFSet → ZFSet
H : Definable 1 f
x z : ZFSet
zx : z ∈ x
y : ZFSet
yx : (fun w => pair z w ∈ map f x) y
w : ZFSet
left✝ : w ∈ x
we : pair w (f w) = pair z y
⊢ y = f z

Next tactic:
let ⟨wz, fy⟩ := pair_injective we
theorem map_unique {f : ZFSet.{u} → ZFSet.{u}} [H : Definable 1 f] {x z : ZFSet.{u}}
    (zx : z ∈ x) : ∃! w, pair z w ∈ map f x :=
  ⟨f z, image.mk _ _ zx, fun y yx => by
    let ⟨w, _, we⟩ := mem_image.1 yx
    let ⟨wz, fy⟩ := pair_injective we
    

Proof state:
f : ZFSet → ZFSet
H : Definable 1 f
x z : ZFSet
zx : z ∈ x
y : ZFSet
yx : (fun w => pair z w ∈ map f x) y
w : ZFSet
left✝ : w ∈ x
we : pair w (f w) = pair z y
wz : w = z
fy : f w = y
⊢ y = f z

Next tactic:
rw [← fy, wz]
theorem hereditarily_iff : Hereditarily p x ↔ p x ∧ ∀ y ∈ x, Hereditarily p y := by
  

Proof state:
p : ZFSet → Prop
x y : ZFSet
⊢ Hereditarily p x ↔ p x ∧ ∀ y ∈ x, Hereditarily p y

Next tactic:
rw [← Hereditarily]
theorem Hereditarily.empty : Hereditarily p x → p ∅ := by
  

Proof state:
p : ZFSet → Prop
x y : ZFSet
⊢ Hereditarily p x → p ∅

Next tactic:
apply @ZFSet.inductionOn _ x
theorem Hereditarily.empty : Hereditarily p x → p ∅ := by
  apply @ZFSet.inductionOn _ x
  

Proof state:
p : ZFSet → Prop
x y : ZFSet
⊢ ∀ (x : ZFSet), (∀ y ∈ x, Hereditarily p y → p ∅) → Hereditarily p x → p ∅

Next tactic:
intro y IH h
theorem Hereditarily.empty : Hereditarily p x → p ∅ := by
  apply @ZFSet.inductionOn _ x
  intro y IH h
  

Proof state:
p : ZFSet → Prop
x y✝ y : ZFSet
IH : ∀ y_1 ∈ y, Hereditarily p y_1 → p ∅
h : Hereditarily p y
⊢ p ∅

Next tactic:
rcases ZFSet.eq_empty_or_nonempty y with (rfl | ⟨a, ha⟩)
theorem Hereditarily.empty : Hereditarily p x → p ∅ := by
  apply @ZFSet.inductionOn _ x
  intro y IH h
  rcases ZFSet.eq_empty_or_nonempty y with (rfl | ⟨a, ha⟩)
  · 

Proof state:
case inl
p : ZFSet → Prop
x y : ZFSet
IH : ∀ y ∈ ∅, Hereditarily p y → p ∅
h : Hereditarily p ∅
⊢ p ∅

Next tactic:
exact h.self
theorem Hereditarily.empty : Hereditarily p x → p ∅ := by
  apply @ZFSet.inductionOn _ x
  intro y IH h
  rcases ZFSet.eq_empty_or_nonempty y with (rfl | ⟨a, ha⟩)
  · exact h.self
  · 

Proof state:
case inr.intro
p : ZFSet → Prop
x y✝ y : ZFSet
IH : ∀ y_1 ∈ y, Hereditarily p y_1 → p ∅
h : Hereditarily p y
a : ZFSet
ha : a ∈ toSet y
⊢ p ∅

Next tactic:
exact IH a ha (h.mem ha)
theorem mem_wf : @WellFounded Class.{u} (· ∈ ·) :=
  ⟨by
    

Proof state:
⊢ ∀ (a : Class), Acc (fun x x_1 => x ∈ x_1) a

Next tactic:
have H : ∀ x : ZFSet.{u}, @Acc Class.{u} (· ∈ ·) ↑x := by
      refine' fun a => ZFSet.inductionOn a fun x IH => ⟨_, _⟩
      rintro A ⟨z, rfl, hz⟩
      exact IH z hz
theorem mem_wf : @WellFounded Class.{u} (· ∈ ·) :=
  ⟨by
    have H : ∀ x : ZFSet.{u}, @Acc Class.{u} (· ∈ ·) ↑x := by
      

Proof state:
⊢ ∀ (x : ZFSet), Acc (fun x x_1 => x ∈ x_1) ↑x

Next tactic:
refine' fun a => ZFSet.inductionOn a fun x IH => ⟨_, _⟩
theorem mem_wf : @WellFounded Class.{u} (· ∈ ·) :=
  ⟨by
    have H : ∀ x : ZFSet.{u}, @Acc Class.{u} (· ∈ ·) ↑x := by
      refine' fun a => ZFSet.inductionOn a fun x IH => ⟨_, _⟩
      

Proof state:
a x : ZFSet
IH : ∀ y ∈ x, Acc (fun x x_1 => x ∈ x_1) ↑y
⊢ ∀ y ∈ ↑x, Acc (fun x x_1 => x ∈ x_1) y

Next tactic:
rintro A ⟨z, rfl, hz⟩
theorem mem_wf : @WellFounded Class.{u} (· ∈ ·) :=
  ⟨by
    have H : ∀ x : ZFSet.{u}, @Acc Class.{u} (· ∈ ·) ↑x := by
      refine' fun a => ZFSet.inductionOn a fun x IH => ⟨_, _⟩
      rintro A ⟨z, rfl, hz⟩
      

Proof state:
case intro.intro
a x : ZFSet
IH : ∀ y ∈ x, Acc (fun x x_1 => x ∈ x_1) ↑y
z : ZFSet
hz : ↑x z
⊢ Acc (fun x x_1 => x ∈ x_1) ↑z

Next tactic:
exact IH z hz
theorem mem_wf : @WellFounded Class.{u} (· ∈ ·) :=
  ⟨by
    have H : ∀ x : ZFSet.{u}, @Acc Class.{u} (· ∈ ·) ↑x := by
      refine' fun a => ZFSet.inductionOn a fun x IH => ⟨_, _⟩
      rintro A ⟨z, rfl, hz⟩
      exact IH z hz
    · 

Proof state:
H : ∀ (x : ZFSet), Acc (fun x x_1 => x ∈ x_1) ↑x
⊢ ∀ (a : Class), Acc (fun x x_1 => x ∈ x_1) a

Next tactic:
refine' fun A => ⟨A, _⟩
theorem mem_wf : @WellFounded Class.{u} (· ∈ ·) :=
  ⟨by
    have H : ∀ x : ZFSet.{u}, @Acc Class.{u} (· ∈ ·) ↑x := by
      refine' fun a => ZFSet.inductionOn a fun x IH => ⟨_, _⟩
      rintro A ⟨z, rfl, hz⟩
      exact IH z hz
    · refine' fun A => ⟨A, _⟩
      

Proof state:
H : ∀ (x : ZFSet), Acc (fun x x_1 => x ∈ x_1) ↑x
A : Class
⊢ ∀ y ∈ A, Acc (fun x x_1 => x ∈ x_1) y

Next tactic:
rintro B ⟨x, rfl, _⟩
theorem mem_wf : @WellFounded Class.{u} (· ∈ ·) :=
  ⟨by
    have H : ∀ x : ZFSet.{u}, @Acc Class.{u} (· ∈ ·) ↑x := by
      refine' fun a => ZFSet.inductionOn a fun x IH => ⟨_, _⟩
      rintro A ⟨z, rfl, hz⟩
      exact IH z hz
    · refine' fun A => ⟨A, _⟩
      rintro B ⟨x, rfl, _⟩
      

Proof state:
case intro.intro
H : ∀ (x : ZFSet), Acc (fun x x_1 => x ∈ x_1) ↑x
A : Class
x : ZFSet
right✝ : A x
⊢ Acc (fun x x_1 => x ∈ x_1) ↑x

Next tactic:
exact H x
@[simp]
theorem congToClass_empty : congToClass ∅ = ∅ := by
  

Proof state:
⊢ congToClass ∅ = ∅

Next tactic:
ext z
@[simp]
theorem congToClass_empty : congToClass ∅ = ∅ := by
  ext z
  

Proof state:
case a
z : ZFSet
⊢ congToClass ∅ z ↔ ∅ z

Next tactic:
simp only [congToClass, not_empty_hom, iff_false_iff]
@[simp]
theorem congToClass_empty : congToClass ∅ = ∅ := by
  ext z
  simp only [congToClass, not_empty_hom, iff_false_iff]
  

Proof state:
case a
z : ZFSet
⊢ ¬setOf (fun y => ↑y ∈ ∅) z

Next tactic:
exact Set.not_mem_empty z
@[simp]
theorem classToCong_empty : classToCong ∅ = ∅ := by
  

Proof state:
⊢ classToCong ∅ = ∅

Next tactic:
ext
@[simp]
theorem classToCong_empty : classToCong ∅ = ∅ := by
  ext
  

Proof state:
case h
x✝ : Class
⊢ x✝ ∈ classToCong ∅ ↔ x✝ ∈ ∅

Next tactic:
simp [classToCong]
theorem ofSet.inj {x y : ZFSet.{u}} (h : (x : Class.{u}) = y) : x = y :=
  ZFSet.ext fun z => by
    

Proof state:
x y : ZFSet
h : ↑x = ↑y
z : ZFSet
⊢ z ∈ x ↔ z ∈ y

Next tactic:
change (x : Class.{u}) z ↔ (y : Class.{u}) z
theorem ofSet.inj {x y : ZFSet.{u}} (h : (x : Class.{u}) = y) : x = y :=
  ZFSet.ext fun z => by
    change (x : Class.{u}) z ↔ (y : Class.{u}) z
    

Proof state:
x y : ZFSet
h : ↑x = ↑y
z : ZFSet
⊢ ↑x z ↔ ↑y z

Next tactic:
rw [h]
@[simp]
theorem toSet_of_ZFSet (A : Class.{u}) (x : ZFSet.{u}) : ToSet A x ↔ A x :=
  ⟨fun ⟨y, yx, py⟩ => by 

Proof state:
A : Class
x : ZFSet
x✝ : ToSet A ↑x
y : ZFSet
yx : ↑y = ↑x
py : A y
⊢ A x

Next tactic:
rwa [ofSet.inj yx] at py
@[simp]
theorem sUnion_apply {x : Class} {y : ZFSet} : (⋃₀ x) y ↔ ∃ z : ZFSet, x z ∧ y ∈ z := by
  

Proof state:
x : Class
y : ZFSet
⊢ (⋃₀ x) y ↔ ∃ z, x z ∧ y ∈ z

Next tactic:
constructor
@[simp]
theorem sUnion_apply {x : Class} {y : ZFSet} : (⋃₀ x) y ↔ ∃ z : ZFSet, x z ∧ y ∈ z := by
  constructor
  · 

Proof state:
case mp
x : Class
y : ZFSet
⊢ (⋃₀ x) y → ∃ z, x z ∧ y ∈ z

Next tactic:
rintro ⟨-, ⟨z, rfl, hxz⟩, hyz⟩
@[simp]
theorem sUnion_apply {x : Class} {y : ZFSet} : (⋃₀ x) y ↔ ∃ z : ZFSet, x z ∧ y ∈ z := by
  constructor
  · rintro ⟨-, ⟨z, rfl, hxz⟩, hyz⟩
    

Proof state:
case mp.intro.intro.intro.intro
x : Class
y z : ZFSet
hxz : x z
hyz : y ∈ ↑z
⊢ ∃ z, x z ∧ y ∈ z

Next tactic:
exact ⟨z, hxz, hyz⟩
@[simp]
theorem sUnion_apply {x : Class} {y : ZFSet} : (⋃₀ x) y ↔ ∃ z : ZFSet, x z ∧ y ∈ z := by
  constructor
  · rintro ⟨-, ⟨z, rfl, hxz⟩, hyz⟩
    exact ⟨z, hxz, hyz⟩
  · 

Proof state:
case mpr
x : Class
y : ZFSet
⊢ (∃ z, x z ∧ y ∈ z) → (⋃₀ x) y

Next tactic:
exact fun ⟨z, hxz, hyz⟩ => ⟨_, coe_mem.2 hxz, hyz⟩
@[simp, norm_cast]
theorem coe_sUnion (x : ZFSet.{u}) : ↑(⋃₀ x : ZFSet) = ⋃₀ (x : Class.{u}) :=
  ext fun y =>
    ZFSet.mem_sUnion.trans (sUnion_apply.trans <| by 

Proof state:
x y : ZFSet
⊢ (∃ z, ↑x z ∧ y ∈ z) ↔ ∃ z ∈ x, y ∈ z

Next tactic:
rfl
@[simp]
theorem mem_sUnion {x y : Class.{u}} : y ∈ ⋃₀ x ↔ ∃ z, z ∈ x ∧ y ∈ z := by
  

Proof state:
x y : Class
⊢ y ∈ ⋃₀ x ↔ ∃ z ∈ x, y ∈ z

Next tactic:
constructor
@[simp]
theorem mem_sUnion {x y : Class.{u}} : y ∈ ⋃₀ x ↔ ∃ z, z ∈ x ∧ y ∈ z := by
  constructor
  · 

Proof state:
case mp
x y : Class
⊢ y ∈ ⋃₀ x → ∃ z ∈ x, y ∈ z

Next tactic:
rintro ⟨w, rfl, z, hzx, hwz⟩
@[simp]
theorem mem_sUnion {x y : Class.{u}} : y ∈ ⋃₀ x ↔ ∃ z, z ∈ x ∧ y ∈ z := by
  constructor
  · rintro ⟨w, rfl, z, hzx, hwz⟩
    

Proof state:
case mp.intro.intro.intro.intro
x : Class
w : ZFSet
z : Set ZFSet
hzx : z ∈ classToCong x
hwz : w ∈ z
⊢ ∃ z ∈ x, ↑w ∈ z

Next tactic:
exact ⟨z, hzx, coe_mem.2 hwz⟩
@[simp]
theorem mem_sUnion {x y : Class.{u}} : y ∈ ⋃₀ x ↔ ∃ z, z ∈ x ∧ y ∈ z := by
  constructor
  · rintro ⟨w, rfl, z, hzx, hwz⟩
    exact ⟨z, hzx, coe_mem.2 hwz⟩
  · 

Proof state:
case mpr
x y : Class
⊢ (∃ z ∈ x, y ∈ z) → y ∈ ⋃₀ x

Next tactic:
rintro ⟨w, hwx, z, rfl, hwz⟩
@[simp]
theorem mem_sUnion {x y : Class.{u}} : y ∈ ⋃₀ x ↔ ∃ z, z ∈ x ∧ y ∈ z := by
  constructor
  · rintro ⟨w, rfl, z, hzx, hwz⟩
    exact ⟨z, hzx, coe_mem.2 hwz⟩
  · rintro ⟨w, hwx, z, rfl, hwz⟩
    

Proof state:
case mpr.intro.intro.intro.intro
x w : Class
hwx : w ∈ x
z : ZFSet
hwz : w z
⊢ ↑z ∈ ⋃₀ x

Next tactic:
exact ⟨z, rfl, w, hwx, hwz⟩
theorem sInter_apply {x : Class.{u}} {y : ZFSet.{u}} : (⋂₀ x) y ↔ ∀ z : ZFSet.{u}, x z → y ∈ z := by
  

Proof state:
x : Class
y : ZFSet
⊢ (⋂₀ x) y ↔ ∀ (z : ZFSet), x z → y ∈ z

Next tactic:
refine' ⟨fun hxy z hxz => hxy _ ⟨z, rfl, hxz⟩, _⟩
theorem sInter_apply {x : Class.{u}} {y : ZFSet.{u}} : (⋂₀ x) y ↔ ∀ z : ZFSet.{u}, x z → y ∈ z := by
  refine' ⟨fun hxy z hxz => hxy _ ⟨z, rfl, hxz⟩, _⟩
  

Proof state:
x : Class
y : ZFSet
⊢ (∀ (z : ZFSet), x z → y ∈ z) → (⋂₀ x) y

Next tactic:
rintro H - ⟨z, rfl, hxz⟩