···6060-/
6161theorem SetTheory.Set.emptyset_exists (h: axiom_of_universal_specification):
6262 ∃ (X:Set), ∀ x, x ∉ X := by
6363- sorry
6363+ let P : Object → Prop := fun _ ↦ False
6464+ obtain ⟨A, hA⟩ := h P
6565+ use A
6666+ intro x
6767+ rw [hA _]
6868+ unfold P
6969+ trivial
64706571/--
6672 Exercise 3.2.1. The spirit of the exercise is to establish these results without using either
···6874-/
6975theorem SetTheory.Set.singleton_exists (h: axiom_of_universal_specification) (x:Object):
7076 ∃ (X:Set), ∀ y, y ∈ X ↔ y = x := by
7171- sorry
7777+ let P : Object → Prop := fun y ↦ y = x
7878+ apply h
72797380/--
7481 Exercise 3.2.1. The spirit of the exercise is to establish these results without using either
···7683-/
7784theorem SetTheory.Set.pair_exists (h: axiom_of_universal_specification) (x₁ x₂:Object):
7885 ∃ (X:Set), ∀ y, y ∈ X ↔ y = x₁ ∨ y = x₂ := by
7979- sorry
8686+ let P : Object → Prop := fun y ↦ y = x₁ ∨ y = x₂
8787+ apply h
80888189/--
8290 Exercise 3.2.1. The spirit of the exercise is to establish these results without using either
···8492-/
8593theorem SetTheory.Set.union_exists (h: axiom_of_universal_specification) (A B:Set):
8694 ∃ (Z:Set), ∀ z, z ∈ Z ↔ z ∈ A ∨ z ∈ B := by
8787- sorry
9595+ let P : Object → Prop := fun z ↦ z ∈ A ∨ z ∈ B
9696+ apply h
88978998/--
9099 Exercise 3.2.1. The spirit of the exercise is to establish these results without using either
···92101-/
93102theorem SetTheory.Set.specify_exists (h: axiom_of_universal_specification) (A:Set) (P: A → Prop):
94103 ∃ (Z:Set), ∀ z, z ∈ Z ↔ ∃ h : z ∈ A, P ⟨ z, h ⟩ := by
9595- sorry
104104+ let P : Object → Prop := fun z ↦ ∃ h : z ∈ A, P ⟨ z, h ⟩
105105+ apply h
9610697107/--
98108 Exercise 3.2.1. The spirit of the exercise is to establish these results without using either
···101111theorem SetTheory.Set.replace_exists (h: axiom_of_universal_specification) (A:Set)
102112 (P: A → Object → Prop) (hP: ∀ x y y', P x y ∧ P x y' → y = y') :
103113 ∃ (Z:Set), ∀ y, y ∈ Z ↔ ∃ a : A, P a y := by
104104- sorry
114114+ let P : Object → Prop := fun y ↦ ∃ a : A, P a y
115115+ apply h
105116106117/-- Exercise 3.2.2 -/
107107-theorem SetTheory.Set.not_mem_self (A:Set) : (A:Object) ∉ A := by sorry
118118+theorem SetTheory.Set.not_mem_self (A:Set) : (A:Object) ∉ A := by
119119+ let B: Set := {(A: Object)}
120120+ have hB : B ≠ ∅ := by
121121+ unfold B
122122+ intro h
123123+ simp only [eq_empty_iff_forall_notMem, mem_singleton, forall_eq] at h
124124+ have ⟨x, hx⟩ := axiom_of_regularity hB
125125+ simp only [eq_empty_iff_forall_notMem, disjoint_iff] at hx
126126+ aesop
108127109128/-- Exercise 3.2.2 -/
110110-theorem SetTheory.Set.not_mem_mem (A B:Set) : (A:Object) ∉ B ∨ (B:Object) ∉ A := by sorry
129129+theorem SetTheory.Set.not_mem_mem (A B:Set) : (A:Object) ∉ B ∨ (B:Object) ∉ A := by
130130+ by_contra! h
131131+ obtain ⟨h1, h2⟩ := h
132132+ let C: Set := {(A: Object), (B: Object)}
133133+ have hC : C ≠ ∅ := by
134134+ unfold C
135135+ intro h
136136+ simp only [eq_empty_iff_forall_notMem, mem_pair, forall_eq] at h
137137+ specialize h A
138138+ simp only [true_or, not_true_eq_false] at h
139139+ have ⟨x, hx⟩ := axiom_of_regularity hC
140140+ simp only [eq_empty_iff_forall_notMem, disjoint_iff, mem_inter] at hx
141141+ have hxAB : x = (A: Object) ∨ x = (B: Object) := by aesop
142142+ rcases hxAB with hxA | hxB
143143+ · specialize hx A hxA B
144144+ aesop
145145+ specialize hx B hxB A
146146+ aesop
111147112148/-- Exercise 3.2.3 -/
113149theorem SetTheory.Set.univ_iff : axiom_of_universal_specification ↔
114114- ∃ (U:Set), ∀ x, x ∈ U := by sorry
150150+ ∃ (U:Set), ∀ x, x ∈ U := by
151151+ constructor
152152+ · intro h
153153+ set P : Object → Prop := fun x ↦ True
154154+ obtain ⟨U, hU⟩ := h P
155155+ use U
156156+ intro x
157157+ rw [hU]
158158+ tauto
159159+ rintro ⟨U, hU⟩
160160+ unfold axiom_of_universal_specification
161161+ intro P
162162+ use specify U fun x ↦ P x
163163+ intro x
164164+ rw [specification_axiom'']
165165+ aesop
115166116167/-- Exercise 3.2.3 -/
117117-theorem SetTheory.Set.no_univ : ¬ ∃ (U:Set), ∀ (x:Object), x ∈ U := by sorry
118118-168168+theorem SetTheory.Set.no_univ : ¬ ∃ (U:Set), ∀ (x:Object), x ∈ U := by
169169+ rintro ⟨U, hU⟩
170170+ have hU' := hU U
171171+ have := not_mem_self U
172172+ contradiction
119173120174end Chapter3