Аналіз I, Глава 3.5
Я (пр.перекл. Терренс Тао) намагався зробити переклад якомога точнішим перефразуванням оригінального тексту. Коли є вибір між більш ідіоматичним рішенням Lean та більш точним перекладом, я зазвичай обирав останній. Зокрема, будуть місця, де код Lean можна було б "підбуцнути", щоб зробити його більш елегантним та ідіоматичним, але я свідомо уникав цього вибору.
Основні конструкції та результати цього розділу:
-
Впорядковані пари та кортежі
-
Декартові добутки та n-кратні добутки
-
Зліченний вибіру
namespace Chapter3
export SetTheory (Set Object nat)
variable [SetTheory]
#check OrderedPair.ext
Chapter3.OrderedPair.ext {inst✝ : SetTheory} {x y : OrderedPair} (fst : x.fst = y.fst) (snd : x.snd = y.snd) : x = y
Визначення 3.5.1 (Впорядкована пара)
theorem OrderedPair.eq (x y x' y' : Object) :
(⟨ x, y ⟩ : OrderedPair) = (⟨ x', y' ⟩ : OrderedPair) ↔ x = x' ∧ y = y' := inst✝:SetTheoryx:Objecty:Objectx':Objecty':Object⊢ { fst := x, snd := y } = { fst := x', snd := y' } ↔ x = x' ∧ y = y' All goals completed! 🐙
Вправа 3.5.1
abbrev OrderedPair.toObject : OrderedPair ↪ Object where
toFun p := ({ (({p.fst}:Set):Object), (({p.fst, p.snd}:Set):Object) }:Set)
inj' := inst✝:SetTheory⊢ Function.Injective fun p =>
SetTheory.set_to_object {SetTheory.set_to_object {p.fst}, SetTheory.set_to_object {p.fst, p.snd}} All goals completed! 🐙
instance OrderedPair.inst_coeObject : Coe OrderedPair Object where
coe := OrderedPair.toObject
Технічна операція перетворююча об'єкт x
та множину Y
на множину {x} × Y
, необхідна для
визначення повного декартового добутку
abbrev SetTheory.Set.slice (x:Object) (Y:Set) : Set :=
Y.replace (P := fun y z ↦ z = (⟨x, y⟩:OrderedPair)) (inst✝:SetTheoryx:ObjectY:Set⊢ ∀ (x_1 : Y.toSubtype) (y y' : Object),
(fun y z => z = OrderedPair.toObject { fst := x, snd := ↑y }) x_1 y ∧
(fun y z => z = OrderedPair.toObject { fst := x, snd := ↑y }) x_1 y' →
y = y'
inst✝:SetTheoryx:ObjectY:Sety:Y.toSubtypez:Objectz':Objecthz:(fun y z => z = OrderedPair.toObject { fst := x, snd := ↑y }) y zhz':(fun y z => z = OrderedPair.toObject { fst := x, snd := ↑y }) y z'⊢ z = z'
inst✝:SetTheoryx:ObjectY:Sety:Y.toSubtypez:Objectz':Objecthz:z = set_to_object {set_to_object {x}, set_to_object {x, ↑y}}hz':z' = set_to_object {set_to_object {x}, set_to_object {x, ↑y}}⊢ z = z'
All goals completed! 🐙
)
theorem SetTheory.Set.mem_slice (x z:Object) (Y:Set) :
z ∈ (SetTheory.Set.slice x Y) ↔ ∃ y:Y, z = (⟨x, y⟩:OrderedPair) := replacement_axiom _ _
Визначення 3.5.2 (Декартовий добуток)
abbrev SetTheory.Set.cartesian (X Y:Set) : Set :=
union (X.replace (P := fun x z ↦ z = slice x Y) (inst✝:SetTheoryX:SetY:Set⊢ ∀ (x : X.toSubtype) (y y' : Object),
(fun x z => z = set_to_object (slice (↑x) Y)) x y ∧ (fun x z => z = set_to_object (slice (↑x) Y)) x y' → y = y'
inst✝:SetTheoryX:SetY:Setx:X.toSubtypez:Objectz':Objecthz:(fun x z => z = set_to_object (slice (↑x) Y)) x zhz':(fun x z => z = set_to_object (slice (↑x) Y)) x z'⊢ z = z'
inst✝:SetTheoryX:SetY:Setx:X.toSubtypez:Objectz':Objecthz:z = set_to_object (slice (↑x) Y)hz':z' = set_to_object (slice (↑x) Y)⊢ z = z'
All goals completed! 🐙
))
Цей екземпляр дозволяє використовувати позначення ×ˢ для декартового добутку.
instance SetTheory.Set.inst_SProd : SProd Set Set Set where
sprod := cartesian
theorem SetTheory.Set.mem_cartesian (z:Object) (X Y:Set) :
z ∈ X ×ˢ Y ↔ ∃ x:X, ∃ y:Y, z = (⟨x, y⟩:OrderedPair) := inst✝:SetTheoryz:ObjectX:SetY:Set⊢ z ∈ X ×ˢ Y ↔ ∃ x y, z = OrderedPair.toObject { fst := ↑x, snd := ↑y }
inst✝:SetTheoryz:ObjectX:SetY:Set⊢ (∃ S, z ∈ S ∧ set_to_object S ∈ X.replace ⋯) ↔ ∃ x y, z = OrderedPair.toObject { fst := ↑x, snd := ↑y }
inst✝:SetTheoryz:ObjectX:SetY:Set⊢ (∃ S, z ∈ S ∧ set_to_object S ∈ X.replace ⋯) → ∃ x y, z = OrderedPair.toObject { fst := ↑x, snd := ↑y }inst✝:SetTheoryz:ObjectX:SetY:Set⊢ (∃ x y, z = OrderedPair.toObject { fst := ↑x, snd := ↑y }) → ∃ S, z ∈ S ∧ set_to_object S ∈ X.replace ⋯
inst✝:SetTheoryz:ObjectX:SetY:Set⊢ (∃ S, z ∈ S ∧ set_to_object S ∈ X.replace ⋯) → ∃ x y, z = OrderedPair.toObject { fst := ↑x, snd := ↑y } inst✝:SetTheoryz:ObjectX:SetY:Seth:∃ S, z ∈ S ∧ set_to_object S ∈ X.replace ⋯⊢ ∃ x y, z = OrderedPair.toObject { fst := ↑x, snd := ↑y }
inst✝:SetTheoryz:ObjectX:SetY:SetS:Sethz:z ∈ ShS:set_to_object S ∈ X.replace ⋯⊢ ∃ x y, z = OrderedPair.toObject { fst := ↑x, snd := ↑y }
inst✝:SetTheoryz:ObjectX:SetY:SetS:Sethz:z ∈ ShS:∃ x, set_to_object S = set_to_object (slice (↑x) Y)⊢ ∃ x y, z = OrderedPair.toObject { fst := ↑x, snd := ↑y }
inst✝:SetTheoryz:ObjectX:SetY:SetS:Sethz:z ∈ Sx:X.toSubtypehx:set_to_object S = set_to_object (slice (↑x) Y)⊢ ∃ x y, z = OrderedPair.toObject { fst := ↑x, snd := ↑y }
inst✝:SetTheoryz:ObjectX:SetY:SetS:Sethz:z ∈ Sx:X.toSubtypehx:S = slice (↑x) Y⊢ ∃ x y, z = OrderedPair.toObject { fst := ↑x, snd := ↑y }
inst✝:SetTheoryz:ObjectX:SetY:SetS:Setx:X.toSubtypehz:z ∈ slice (↑x) Yhx:S = slice (↑x) Y⊢ ∃ x y, z = OrderedPair.toObject { fst := ↑x, snd := ↑y }
inst✝:SetTheoryz:ObjectX:SetY:SetS:Setx:X.toSubtypehz:∃ y, z = OrderedPair.toObject { fst := ↑x, snd := ↑y }hx:S = slice (↑x) Y⊢ ∃ x y, z = OrderedPair.toObject { fst := ↑x, snd := ↑y }
inst✝:SetTheoryX:SetY:SetS:Setx:X.toSubtypehx:S = slice (↑x) Yy:Y.toSubtype⊢ ∃ x_1 y_1, OrderedPair.toObject { fst := ↑x, snd := ↑y } = OrderedPair.toObject { fst := ↑x_1, snd := ↑y_1 }
All goals completed! 🐙
inst✝:SetTheoryz:ObjectX:SetY:Seth:∃ x y, z = OrderedPair.toObject { fst := ↑x, snd := ↑y }⊢ ∃ S, z ∈ S ∧ set_to_object S ∈ X.replace ⋯
inst✝:SetTheoryX:SetY:Setx:X.toSubtypey:Y.toSubtype⊢ ∃ S, OrderedPair.toObject { fst := ↑x, snd := ↑y } ∈ S ∧ set_to_object S ∈ X.replace ⋯
inst✝:SetTheoryX:SetY:Setx:X.toSubtypey:Y.toSubtype⊢ OrderedPair.toObject { fst := ↑x, snd := ↑y } ∈ slice (↑x) Y ∧ set_to_object (slice (↑x) Y) ∈ X.replace ⋯
inst✝:SetTheoryX:SetY:Setx:X.toSubtypey:Y.toSubtype⊢ OrderedPair.toObject { fst := ↑x, snd := ↑y } ∈ slice (↑x) Yinst✝:SetTheoryX:SetY:Setx:X.toSubtypey:Y.toSubtype⊢ set_to_object (slice (↑x) Y) ∈ X.replace ⋯
inst✝:SetTheoryX:SetY:Setx:X.toSubtypey:Y.toSubtype⊢ OrderedPair.toObject { fst := ↑x, snd := ↑y } ∈ slice (↑x) Y inst✝:SetTheoryX:SetY:Setx:X.toSubtypey:Y.toSubtype⊢ ∃ y_1, OrderedPair.toObject { fst := ↑x, snd := ↑y } = OrderedPair.toObject { fst := ↑x, snd := ↑y_1 }
All goals completed! 🐙
inst✝:SetTheoryX:SetY:Setx:X.toSubtypey:Y.toSubtype⊢ ∃ x_1, set_to_object (slice (↑x) Y) = set_to_object (slice (↑x_1) Y)
All goals completed! 🐙
abbrev SetTheory.Set.curry {X Y Z:Set} (f: X ×ˢ Y → Z) : X → Y → Z :=
fun x y ↦ f ⟨ (⟨ x, y ⟩:OrderedPair), inst✝:SetTheoryX:SetY:SetZ:Setf:(X ×ˢ Y).toSubtype → Z.toSubtypex:X.toSubtypey:Y.toSubtype⊢ OrderedPair.toObject { fst := ↑x, snd := ↑y } ∈ X ×ˢ Y inst✝:SetTheoryX:SetY:SetZ:Setf:(X ×ˢ Y).toSubtype → Z.toSubtypex:X.toSubtypey:Y.toSubtype⊢ ∃ x_1 y_1, OrderedPair.toObject { fst := ↑x, snd := ↑y } = OrderedPair.toObject { fst := ↑x_1, snd := ↑y_1 }; All goals completed! 🐙 ⟩
noncomputable abbrev SetTheory.Set.fst {X Y:Set} (z:X ×ˢ Y) : X :=
(show ∃ x:X, ∃ y:Y, z.val = (⟨ x, y ⟩:OrderedPair)
All goals completed! 🐙 All goals completed! 🐙).choose
noncomputable abbrev SetTheory.Set.snd {X Y:Set} (z:X ×ˢ Y) : Y :=
(show ∃ y:Y, ∃ x:X, z.val = (⟨ x, y ⟩:OrderedPair)
All goals completed! 🐙 inst✝:SetTheoryX:SetY:Setz:(X ×ˢ Y).toSubtype⊢ ∃ b a, ↑z = OrderedPair.toObject { fst := ↑b, snd := ↑a }; All goals completed! 🐙).choose
theorem SetTheory.Set.pair_eq_fst_snd {X Y:Set} (z:X ×ˢ Y) :
z.val = (⟨ fst z, snd z ⟩:OrderedPair) := inst✝:SetTheoryX:SetY:Setz:(X ×ˢ Y).toSubtype⊢ ↑z = OrderedPair.toObject { fst := ↑(fst z), snd := ↑(snd z) }
inst✝:SetTheoryX:SetY:Setz:(X ×ˢ Y).toSubtypey:Y.toSubtypehy:↑z = OrderedPair.toObject { fst := ↑⋯.choose, snd := ↑y }⊢ ↑z = OrderedPair.toObject { fst := ↑(fst z), snd := ↑(snd z) }
inst✝:SetTheoryX:SetY:Setz:(X ×ˢ Y).toSubtypey:Y.toSubtypehy:↑z = OrderedPair.toObject { fst := ↑⋯.choose, snd := ↑y }x:X.toSubtypehx:↑z = OrderedPair.toObject { fst := ↑x, snd := ↑⋯.choose }⊢ ↑z = OrderedPair.toObject { fst := ↑(fst z), snd := ↑(snd z) }
inst✝:SetTheoryX:SetY:Setz:(X ×ˢ Y).toSubtypey:Y.toSubtypex:X.toSubtypehx:↑z = OrderedPair.toObject { fst := ↑x, snd := ↑⋯.choose }hy:↑z = OrderedPair.toObject { fst := ↑(fst z), snd := ↑y }⊢ ↑z = OrderedPair.toObject { fst := ↑(fst z), snd := ↑(snd z) }
inst✝:SetTheoryX:SetY:Setz:(X ×ˢ Y).toSubtypey:Y.toSubtypex:X.toSubtypehy:↑z = OrderedPair.toObject { fst := ↑(fst z), snd := ↑y }hx:↑z = OrderedPair.toObject { fst := ↑x, snd := ↑(snd z) }⊢ ↑z = OrderedPair.toObject { fst := ↑(fst z), snd := ↑(snd z) }
inst✝:SetTheoryX:SetY:Setz:(X ×ˢ Y).toSubtypey:Y.toSubtypex:X.toSubtypehy:OrderedPair.toObject { fst := ↑x, snd := ↑(snd z) } = OrderedPair.toObject { fst := ↑(fst z), snd := ↑y }hx:↑z = OrderedPair.toObject { fst := ↑x, snd := ↑(snd z) }⊢ OrderedPair.toObject { fst := ↑x, snd := ↑(snd z) } = OrderedPair.toObject { fst := ↑(fst z), snd := ↑(snd z) }
inst✝:SetTheoryX:SetY:Setz:(X ×ˢ Y).toSubtypey:Y.toSubtypex:X.toSubtypehx:↑z = OrderedPair.toObject { fst := ↑x, snd := ↑(snd z) }hy:↑x = ↑(fst z) ∧ ↑(snd z) = ↑y⊢ ↑x = ↑(fst z) ∧ True
All goals completed! 🐙
noncomputable abbrev SetTheory.Set.uncurry {X Y Z:Set} (f: X → Y → Z) : X ×ˢ Y → Z :=
fun z ↦ f (fst z) (snd z)
theorem SetTheory.Set.curry_uncurry {X Y Z:Set} (f: X → Y → Z) : curry (uncurry f) = f := inst✝:SetTheoryX:SetY:SetZ:Setf:X.toSubtype → Y.toSubtype → Z.toSubtype⊢ curry (uncurry f) = f All goals completed! 🐙
theorem SetTheory.Set.uncurry_curry {X Y Z:Set} (f: X ×ˢ Y → Z) : uncurry (curry f) = f := inst✝:SetTheoryX:SetY:SetZ:Setf:(X ×ˢ Y).toSubtype → Z.toSubtype⊢ uncurry (curry f) = f All goals completed! 🐙
noncomputable abbrev SetTheory.Set.prod_commutator (X Y:Set) : X ×ˢ Y ≃ Y ×ˢ X where
toFun := sorry
invFun := sorry
left_inv := sorry
right_inv := sorry
noncomputable abbrev SetTheory.Set.prod_associator (X Y Z:Set) : (X ×ˢ Y) ×ˢ Z ≃ X ×ˢ (Y ×ˢ Z) where
toFun := sorry
invFun := sorry
left_inv := sorry
right_inv := sorry
Прив'язка до Mathlib-овського добутку множин
noncomputable abbrev SetTheory.Set.prod_equiv_prod (X Y:Set) :
((X ×ˢ Y):_root_.Set Object) ≃ (X:_root_.Set Object) ×ˢ (Y:_root_.Set Object) where
toFun := sorry
invFun := sorry
left_inv := sorry
right_inv := sorry
Визначення 3.5.7
abbrev SetTheory.Set.tuple {I:Set} {X: I → Set} (a: ∀ i, X i) : Object :=
object_of ((fun i ↦ ⟨ a i, inst✝:SetTheoryI:SetX:I.toSubtype → Seta:(i : I.toSubtype) → (X i).toSubtypei:I.toSubtype⊢ ↑(a i) ∈ I.iUnion X inst✝:SetTheoryI:SetX:I.toSubtype → Seta:(i : I.toSubtype) → (X i).toSubtypei:I.toSubtype⊢ ∃ α, ↑(a i) ∈ X α; inst✝:SetTheoryI:SetX:I.toSubtype → Seta:(i : I.toSubtype) → (X i).toSubtypei:I.toSubtype⊢ ↑(a i) ∈ X i; All goals completed! 🐙 ⟩):I → iUnion I X)
Визначення 3.5.7
abbrev SetTheory.Set.iProd {I: Set} (X: I → Set) : Set :=
((iUnion I X)^I).specify (fun t ↦ ∃ a : ∀ i, X i, t = tuple a)
Визначення 3.5.7
theorem SetTheory.Set.mem_iProd {I: Set} {X: I → Set} (t:Object) :
t ∈ iProd X ↔ ∃ a: ∀ i, X i, t = tuple a := inst✝:SetTheoryI:SetX:I.toSubtype → Sett:Object⊢ t ∈ iProd X ↔ ∃ a, t = tuple a
inst✝:SetTheoryI:SetX:I.toSubtype → Sett:Object⊢ (∃ (_ : t ∈ I.iUnion X ^ I), ∃ a, t = tuple a) ↔ ∃ a, t = tuple a
inst✝:SetTheoryI:SetX:I.toSubtype → Sett:Object⊢ (∃ (_ : t ∈ I.iUnion X ^ I), ∃ a, t = tuple a) → ∃ a, t = tuple ainst✝:SetTheoryI:SetX:I.toSubtype → Sett:Object⊢ (∃ a, t = tuple a) → ∃ (_ : t ∈ I.iUnion X ^ I), ∃ a, t = tuple a
inst✝:SetTheoryI:SetX:I.toSubtype → Sett:Object⊢ (∃ (_ : t ∈ I.iUnion X ^ I), ∃ a, t = tuple a) → ∃ a, t = tuple a inst✝:SetTheoryI:SetX:I.toSubtype → Sett:Objectht:t ∈ I.iUnion X ^ Ia:(i : I.toSubtype) → (X i).toSubtypeh:t = tuple a⊢ ∃ a, t = tuple a
All goals completed! 🐙
inst✝:SetTheoryI:SetX:I.toSubtype → Sett:Objecta:(i : I.toSubtype) → (X i).toSubtypeha:t = tuple a⊢ ∃ (_ : t ∈ I.iUnion X ^ I), ∃ a, t = tuple a
have h : t ∈ (I.iUnion X)^I := inst✝:SetTheoryI:SetX:I.toSubtype → Sett:Object⊢ t ∈ iProd X ↔ ∃ a, t = tuple a
inst✝:SetTheoryI:SetX:I.toSubtype → Sett:Objecta:(i : I.toSubtype) → (X i).toSubtypeha:t = tuple a⊢ ∃ f, object_of f = tuple a
use fun i ↦ ⟨ a i, inst✝:SetTheoryI:SetX:I.toSubtype → Sett:Objecta:(i : I.toSubtype) → (X i).toSubtypeha:t = tuple ai:I.toSubtype⊢ ↑(a i) ∈ I.iUnion X inst✝:SetTheoryI:SetX:I.toSubtype → Sett:Objecta:(i : I.toSubtype) → (X i).toSubtypeha:t = tuple ai:I.toSubtype⊢ ∃ α, ↑(a i) ∈ X α; inst✝:SetTheoryI:SetX:I.toSubtype → Sett:Objecta:(i : I.toSubtype) → (X i).toSubtypeha:t = tuple ai:I.toSubtype⊢ ↑(a i) ∈ X i; All goals completed! 🐙 ⟩
All goals completed! 🐙
theorem SetTheory.Set.tuple_mem_iProd {I: Set} {X: I → Set} (a: ∀ i, X i) :
tuple a ∈ iProd X := inst✝:SetTheoryI:SetX:I.toSubtype → Seta:(i : I.toSubtype) → (X i).toSubtype⊢ tuple a ∈ iProd X inst✝:SetTheoryI:SetX:I.toSubtype → Seta:(i : I.toSubtype) → (X i).toSubtype⊢ ∃ a_1, tuple a = tuple a_1; All goals completed! 🐙
@[simp]
theorem SetTheory.Set.tuple_inj {I:Set} {X: I → Set} (a b: ∀ i, X i) :
tuple a = tuple b ↔ a = b := inst✝:SetTheoryI:SetX:I.toSubtype → Seta:(i : I.toSubtype) → (X i).toSubtypeb:(i : I.toSubtype) → (X i).toSubtype⊢ tuple a = tuple b ↔ a = b All goals completed! 🐙
Приклад 3.5.11. Я підозрюю, що більшість еквівалентностей вимагатимуть класичних міркувань і будуть визначені лише необчислювально, але був би радий дізнатися про контрприклади.
noncomputable abbrev SetTheory.Set.singleton_iProd_equiv (i:Object) (X:Set) :
iProd (fun _:({i}:Set) ↦ X) ≃ X where
toFun := sorry
invFun := sorry
left_inv := sorry
right_inv := sorry
Приклад 3.5.11
noncomputable abbrev SetTheory.Set.empty_iProd_equiv (X: (∅:Set) → Set) : iProd X ≃ Unit where
toFun := sorry
invFun := sorry
left_inv := sorry
right_inv := sorry
Приклад 3.5.11
noncomputable abbrev SetTheory.Set.iProd_of_const_equiv (I:Set) (X: Set) :
iProd (fun i:I ↦ X) ≃ (I → X) where
toFun := sorry
invFun := sorry
left_inv := sorry
right_inv := sorry
noncomputable abbrev SetTheory.Set.iProd_equiv_prod (X: ({0,1}:Set) → Set) :
iProd X ≃ (X ⟨ 0, inst✝:SetTheoryX:{0, 1}.toSubtype → Set⊢ 0 ∈ {0, 1} All goals completed! 🐙 ⟩) ×ˢ (X ⟨ 1, inst✝:SetTheoryX:{0, 1}.toSubtype → Set⊢ 1 ∈ {0, 1} All goals completed! 🐙 ⟩) where
toFun := sorry
invFun := sorry
left_inv := sorry
right_inv := sorry
Приклад 3.5.9
noncomputable abbrev SetTheory.Set.iProd_equiv_prod_triple (X: ({0,1,2}:Set) → Set) :
iProd X ≃ (X ⟨ 0, inst✝:SetTheoryX:{0, 1, 2}.toSubtype → Set⊢ 0 ∈ {0, 1, 2} All goals completed! 🐙 ⟩) ×ˢ (X ⟨ 1, inst✝:SetTheoryX:{0, 1, 2}.toSubtype → Set⊢ 1 ∈ {0, 1, 2} All goals completed! 🐙 ⟩) ×ˢ (X ⟨ 2, inst✝:SetTheoryX:{0, 1, 2}.toSubtype → Set⊢ 2 ∈ {0, 1, 2} All goals completed! 🐙 ⟩) where
toFun := sorry
invFun := sorry
left_inv := sorry
right_inv := sorry
Зв'язки із Mathlib-овським Set.pi
noncomputable abbrev SetTheory.Set.iProd_equiv_pi (I:Set) (X: I → Set) :
iProd X ≃ Set.pi Set.univ (fun i:I ↦ ((X i):_root_.Set Object)) where
toFun := sorry
invFun := sorry
left_inv := sorry
right_inv := sorry
/-
Зауваження: між цими еквівалентностями також існують додаткові співвідношення, але це
починає переходити в область теорії категорій вищого порядку, яку ми тут не розглядатимемо.
-/
Тут ми створюємо аналог Mathlib-івських типів Fin n
в рамках теорії множин з Розділу 3,
із рудиментарним API.
abbrev SetTheory.Set.Fin (n:ℕ) : Set := nat.specify (fun m ↦ (m:ℕ) < n)
theorem SetTheory.Set.mem_Fin (n:ℕ) (x:Object) : x ∈ Fin n ↔ ∃ m, m < n ∧ x = m := inst✝:SetTheoryn:ℕx:Object⊢ x ∈ Fin n ↔ ∃ m < n, x = ↑m
inst✝:SetTheoryn:ℕx:Object⊢ (∃ (h : x ∈ nat), nat_equiv.symm ⟨x, h⟩ < n) ↔ ∃ m < n, x = ↑m
inst✝:SetTheoryn:ℕx:Object⊢ (∃ (h : x ∈ nat), nat_equiv.symm ⟨x, h⟩ < n) → ∃ m < n, x = ↑minst✝:SetTheoryn:ℕx:Object⊢ (∃ m < n, x = ↑m) → ∃ (h : x ∈ nat), nat_equiv.symm ⟨x, h⟩ < n
inst✝:SetTheoryn:ℕx:Object⊢ (∃ (h : x ∈ nat), nat_equiv.symm ⟨x, h⟩ < n) → ∃ m < n, x = ↑m inst✝:SetTheoryn:ℕx:Objecth1:x ∈ nath2:nat_equiv.symm ⟨x, h1⟩ < n⊢ ∃ m < n, x = ↑m
inst✝:SetTheoryn:ℕx:Objecth1:x ∈ nath2:nat_equiv.symm ⟨x, h1⟩ < n⊢ nat_equiv.symm ⟨x, h1⟩ < n ∧ x = ↑(nat_equiv.symm ⟨x, h1⟩)
inst✝:SetTheoryn:ℕx:Objecth1:x ∈ nath2:nat_equiv.symm ⟨x, h1⟩ < n⊢ x = ↑(nat_equiv.symm ⟨x, h1⟩)
calc
x = (⟨ x, h1 ⟩:nat) := inst✝:SetTheoryn:ℕx:Objecth1:x ∈ nath2:nat_equiv.symm ⟨x, h1⟩ < n⊢ x = ↑⟨x, h1⟩ All goals completed! 🐙
_ = _ := inst✝:SetTheoryn:ℕx:Objecth1:x ∈ nath2:nat_equiv.symm ⟨x, h1⟩ < n⊢ ↑⟨x, h1⟩ = ↑(nat_equiv.symm ⟨x, h1⟩) inst✝:SetTheoryn:ℕx:Objecth1:x ∈ nath2:nat_equiv.symm ⟨x, h1⟩ < n⊢ x = ↑(nat_equiv.1 (nat_equiv.symm ⟨x, h1⟩)); All goals completed! 🐙
inst✝:SetTheoryn:ℕx:Objectm:ℕhm:m < nh:x = ↑m⊢ ∃ (h : x ∈ nat), nat_equiv.symm ⟨x, h⟩ < n
have hn : x ∈ nat := inst✝:SetTheoryn:ℕx:Object⊢ x ∈ Fin n ↔ ∃ m < n, x = ↑m inst✝:SetTheoryn:ℕx:Objectm:ℕhm:m < nh:x = ↑m⊢ ↑↑m ∈ nat; All goals completed! 🐙
inst✝:SetTheoryn:ℕx:Objectm:ℕhm:m < nh:x = ↑mhn:x ∈ nat⊢ nat_equiv.symm ⟨x, hn⟩ < n
inst✝:SetTheoryn:ℕx:Objectm:ℕhm:m < nh:x = ↑mhn:x ∈ nat⊢ nat_equiv.symm ⟨x, hn⟩ = m
inst✝:SetTheoryn:ℕx:Objectm:ℕhm:m < nh:x = ↑mhn:x ∈ nat⊢ ⟨↑m, ⋯⟩ = nat_equiv m
All goals completed! 🐙
abbrev SetTheory.Set.Fin_mk (n m:ℕ) (h: m < n): Fin n := ⟨ m, inst✝:SetTheoryn:ℕm:ℕh:m < n⊢ ↑m ∈ Fin n inst✝:SetTheoryn:ℕm:ℕh:m < n⊢ ∃ m_1 < n, ↑m = ↑m_1; All goals completed! 🐙 ⟩
theorem SetTheory.Set.mem_Fin' {n:ℕ} (x:Fin n) : ∃ m, ∃ h : m < n, x = Fin_mk n m h := inst✝:SetTheoryn:ℕx:(Fin n).toSubtype⊢ ∃ m, ∃ (h : m < n), x = Fin_mk n m h
inst✝:SetTheoryn:ℕx:(Fin n).toSubtypethis:↑x ∈ Fin n⊢ ∃ m, ∃ (h : m < n), x = Fin_mk n m h
inst✝:SetTheoryn:ℕx:(Fin n).toSubtypethis:∃ m < n, ↑x = ↑m⊢ ∃ m, ∃ (h : m < n), x = Fin_mk n m h
inst✝:SetTheoryn:ℕx:(Fin n).toSubtypem:ℕhm:m < nthis:↑x = ↑m⊢ ∃ m, ∃ (h : m < n), x = Fin_mk n m h
inst✝:SetTheoryn:ℕx:(Fin n).toSubtypem:ℕhm:m < nthis:↑x = ↑m⊢ x = Fin_mk n m hm
All goals completed! 🐙
abbrev SetTheory.Set.Fin_embed (n N:ℕ) (h: n ≤ N) (i: Fin n) : Fin N := ⟨ i.val, inst✝:SetTheoryn:ℕN:ℕh:n ≤ Ni:(Fin n).toSubtype⊢ ↑i ∈ Fin N
inst✝:SetTheoryn:ℕN:ℕh:n ≤ Ni:(Fin n).toSubtypethis:↑i ∈ Fin n⊢ ↑i ∈ Fin N
inst✝:SetTheoryn:ℕN:ℕh:n ≤ Ni:(Fin n).toSubtypethis:∃ m < n, ↑i = ↑m⊢ ∃ m < N, ↑i = ↑m
inst✝:SetTheoryn:ℕN:ℕh:n ≤ Ni:(Fin n).toSubtypem:ℕhm:m < nim:↑i = ↑m⊢ ∃ m < N, ↑i = ↑m
use m, inst✝:SetTheoryn:ℕN:ℕh:n ≤ Ni:(Fin n).toSubtypem:ℕhm:m < nim:↑i = ↑m⊢ m < N All goals completed! 🐙
⟩
Я підозрюю, що ця еквівалентність необчислювана і вимагає класичної логіки, хіба що існує якийсь хитромудрий трюк.
noncomputable abbrev SetTheory.Set.Fin_equiv_Fin (n:ℕ) : Fin n ≃ _root_.Fin n where
toFun := sorry
invFun := sorry
left_inv := sorry
right_inv := sorry
Лема 3.5.12 (зліченний вибір)
theorem SetTheory.Set.finite_choice {n:ℕ} {X: Fin n → Set} (h: ∀ i, X i ≠ ∅) : iProd X ≠ ∅ := inst✝:SetTheoryn:ℕX:(Fin n).toSubtype → Seth:∀ (i : (Fin n).toSubtype), X i ≠ ∅⊢ iProd X ≠ ∅
-- Цей доказ загалом повторює доказ у тексті
-- (хоча зручніше проводити індукцію від 0, а не від 1)
inst✝:SetTheoryX:(Fin 0).toSubtype → Seth:∀ (i : (Fin 0).toSubtype), X i ≠ ∅⊢ iProd X ≠ ∅inst✝:SetTheoryn:ℕhn:∀ {X : (Fin n).toSubtype → Set}, (∀ (i : (Fin n).toSubtype), X i ≠ ∅) → iProd X ≠ ∅X:(Fin (n + 1)).toSubtype → Seth:∀ (i : (Fin (n + 1)).toSubtype), X i ≠ ∅⊢ iProd X ≠ ∅
inst✝:SetTheoryX:(Fin 0).toSubtype → Seth:∀ (i : (Fin 0).toSubtype), X i ≠ ∅⊢ iProd X ≠ ∅ have : Fin 0 = ∅ := inst✝:SetTheoryn:ℕX:(Fin n).toSubtype → Seth:∀ (i : (Fin n).toSubtype), X i ≠ ∅⊢ iProd X ≠ ∅
inst✝:SetTheoryX:(Fin 0).toSubtype → Seth:∀ (i : (Fin 0).toSubtype), X i ≠ ∅⊢ ∀ (x : Object), x ∉ Fin 0
inst✝:SetTheoryX:(Fin 0).toSubtype → Seth:∀ (i : (Fin 0).toSubtype), X i ≠ ∅x:Object⊢ x ∉ Fin 0
inst✝:SetTheoryX:(Fin 0).toSubtype → Seth✝:∀ (i : (Fin 0).toSubtype), X i ≠ ∅x:Objecth:x ∈ Fin 0⊢ False
inst✝:SetTheoryX:(Fin 0).toSubtype → Seth✝:∀ (i : (Fin 0).toSubtype), X i ≠ ∅x:Objecth:∃ (h : x ∈ nat), nat_equiv.symm ⟨x, h⟩ < 0⊢ False
All goals completed! 🐙
have empty (i:Fin 0) : X i := False.elim (inst✝:SetTheoryX:(Fin 0).toSubtype → Seth:∀ (i : (Fin 0).toSubtype), X i ≠ ∅this:Fin 0 = ∅i:(Fin 0).toSubtype⊢ False inst✝:SetTheoryX:(Fin 0).toSubtype → Seth:∀ (i : (Fin 0).toSubtype), X i ≠ ∅this:Fin 0 = ∅i:∅.toSubtype⊢ False; All goals completed! 🐙)
inst✝:SetTheoryX:(Fin 0).toSubtype → Seth:∀ (i : (Fin 0).toSubtype), X i ≠ ∅this:Fin 0 = ∅empty:(i : (Fin 0).toSubtype) → (X i).toSubtype⊢ tuple empty ∈ iProd X
inst✝:SetTheoryX:(Fin 0).toSubtype → Seth:∀ (i : (Fin 0).toSubtype), X i ≠ ∅this:Fin 0 = ∅empty:(i : (Fin 0).toSubtype) → (X i).toSubtype⊢ ∃ a, tuple empty = tuple a
All goals completed! 🐙
set X' : Fin n → Set := fun i ↦ X (Fin_embed n (n+1) (inst✝:SetTheoryn:ℕhn:∀ {X : (Fin n).toSubtype → Set}, (∀ (i : (Fin n).toSubtype), X i ≠ ∅) → iProd X ≠ ∅X:(Fin (n + 1)).toSubtype → Seth:∀ (i : (Fin (n + 1)).toSubtype), X i ≠ ∅i:(Fin n).toSubtype⊢ n ≤ n + 1 All goals completed! 🐙) i)
inst✝:SetTheoryn:ℕhn:∀ {X : (Fin n).toSubtype → Set}, (∀ (i : (Fin n).toSubtype), X i ≠ ∅) → iProd X ≠ ∅X:(Fin (n + 1)).toSubtype → Seth:∀ (i : (Fin (n + 1)).toSubtype), X i ≠ ∅X':(Fin n).toSubtype → Set := fun i => X (Fin_embed n (n + 1) ⋯ i)hX':∀ (i : (Fin n).toSubtype), X' i ≠ ∅⊢ iProd X ≠ ∅
inst✝:SetTheoryn:ℕX:(Fin (n + 1)).toSubtype → Seth:∀ (i : (Fin (n + 1)).toSubtype), X i ≠ ∅X':(Fin n).toSubtype → Set := fun i => X (Fin_embed n (n + 1) ⋯ i)hX':∀ (i : (Fin n).toSubtype), X' i ≠ ∅hn:iProd X' ≠ ∅⊢ iProd X ≠ ∅
inst✝:SetTheoryn:ℕX:(Fin (n + 1)).toSubtype → Seth:∀ (i : (Fin (n + 1)).toSubtype), X i ≠ ∅X':(Fin n).toSubtype → Set := fun i => X (Fin_embed n (n + 1) ⋯ i)hX':∀ (i : (Fin n).toSubtype), X' i ≠ ∅hn:iProd X' ≠ ∅x'_obj:Objecthx':x'_obj ∈ iProd X'⊢ iProd X ≠ ∅
inst✝:SetTheoryn:ℕX:(Fin (n + 1)).toSubtype → Seth:∀ (i : (Fin (n + 1)).toSubtype), X i ≠ ∅X':(Fin n).toSubtype → Set := fun i => X (Fin_embed n (n + 1) ⋯ i)hX':∀ (i : (Fin n).toSubtype), X' i ≠ ∅hn:iProd X' ≠ ∅x'_obj:Objecthx':∃ a, x'_obj = tuple a⊢ iProd X ≠ ∅
inst✝:SetTheoryn:ℕX:(Fin (n + 1)).toSubtype → Seth:∀ (i : (Fin (n + 1)).toSubtype), X i ≠ ∅X':(Fin n).toSubtype → Set := fun i => X (Fin_embed n (n + 1) ⋯ i)hX':∀ (i : (Fin n).toSubtype), X' i ≠ ∅hn:iProd X' ≠ ∅x':(i : (Fin n).toSubtype) → (X' i).toSubtype⊢ iProd X ≠ ∅
set last : Fin (n+1) := Fin_mk (n+1) n (inst✝:SetTheoryn:ℕX:(Fin (n + 1)).toSubtype → Seth:∀ (i : (Fin (n + 1)).toSubtype), X i ≠ ∅X':(Fin n).toSubtype → Set := fun i => X (Fin_embed n (n + 1) ⋯ i)hX':∀ (i : (Fin n).toSubtype), X' i ≠ ∅hn:iProd X' ≠ ∅x':(i : (Fin n).toSubtype) → (X' i).toSubtype⊢ n < n + 1 All goals completed! 🐙)
inst✝:SetTheoryn:ℕX:(Fin (n + 1)).toSubtype → Seth:∀ (i : (Fin (n + 1)).toSubtype), X i ≠ ∅X':(Fin n).toSubtype → Set := fun i => X (Fin_embed n (n + 1) ⋯ i)hX':∀ (i : (Fin n).toSubtype), X' i ≠ ∅hn:iProd X' ≠ ∅x':(i : (Fin n).toSubtype) → (X' i).toSubtypelast:(Fin (n + 1)).toSubtype := Fin_mk (n + 1) n ⋯a:Objectha:a ∈ X last⊢ iProd X ≠ ∅
set x : ∀ i, X i := inst✝:SetTheoryn:ℕX:(Fin (n + 1)).toSubtype → Seth:∀ (i : (Fin (n + 1)).toSubtype), X i ≠ ∅X':(Fin n).toSubtype → Set := fun i => X (Fin_embed n (n + 1) ⋯ i)hX':∀ (i : (Fin n).toSubtype), X' i ≠ ∅hn:iProd X' ≠ ∅x':(i : (Fin n).toSubtype) → (X' i).toSubtypelast:(Fin (n + 1)).toSubtype := Fin_mk (n + 1) n ⋯a:Objectha:a ∈ X last⊢ (i : (Fin (n + 1)).toSubtype) → (X i).toSubtype
inst✝:SetTheoryn:ℕX:(Fin (n + 1)).toSubtype → Seth:∀ (i : (Fin (n + 1)).toSubtype), X i ≠ ∅X':(Fin n).toSubtype → Set := fun i => X (Fin_embed n (n + 1) ⋯ i)hX':∀ (i : (Fin n).toSubtype), X' i ≠ ∅hn:iProd X' ≠ ∅x':(i : (Fin n).toSubtype) → (X' i).toSubtypelast:(Fin (n + 1)).toSubtype := Fin_mk (n + 1) n ⋯a:Objectha:a ∈ X lasti:(Fin (n + 1)).toSubtype⊢ (X i).toSubtype
inst✝:SetTheoryn:ℕX:(Fin (n + 1)).toSubtype → Seth:∀ (i : (Fin (n + 1)).toSubtype), X i ≠ ∅X':(Fin n).toSubtype → Set := fun i => X (Fin_embed n (n + 1) ⋯ i)hX':∀ (i : (Fin n).toSubtype), X' i ≠ ∅hn:iProd X' ≠ ∅x':(i : (Fin n).toSubtype) → (X' i).toSubtypelast:(Fin (n + 1)).toSubtype := Fin_mk (n + 1) n ⋯a:Objectha:a ∈ X lasti:(Fin (n + 1)).toSubtypethis:∃ m, ∃ (h : m < n + 1), i = Fin_mk (n + 1) m h⊢ (X i).toSubtype
classical
-- На жаль, для виконання цього склеювання потрібна класична логіка;
-- це тому, що `nat` технічно не є індуктивним типом. Повинно бути якесь обхідне рішення,
-- що включає еквівалентність між `nat` та `ℕ` (який є індуктивним типом).
cases decEq i last with
inst✝:SetTheoryn:ℕX:(Fin (n + 1)).toSubtype → Seth:∀ (i : (Fin (n + 1)).toSubtype), X i ≠ ∅X':(Fin n).toSubtype → Set := fun i => X (Fin_embed n (n + 1) ⋯ i)hX':∀ (i : (Fin n).toSubtype), X' i ≠ ∅hn:iProd X' ≠ ∅x':(i : (Fin n).toSubtype) → (X' i).toSubtypelast:(Fin (n + 1)).toSubtype := Fin_mk (n + 1) n ⋯a:Objectha:a ∈ X lasti:(Fin (n + 1)).toSubtypethis:∃ m, ∃ (h : m < n + 1), i = Fin_mk (n + 1) m hheq:i = last⊢ (X i).toSubtype
inst✝:SetTheoryn:ℕX:(Fin (n + 1)).toSubtype → Seth:∀ (i : (Fin (n + 1)).toSubtype), X i ≠ ∅X':(Fin n).toSubtype → Set := fun i => X (Fin_embed n (n + 1) ⋯ i)hX':∀ (i : (Fin n).toSubtype), X' i ≠ ∅hn:iProd X' ≠ ∅x':(i : (Fin n).toSubtype) → (X' i).toSubtypelast:(Fin (n + 1)).toSubtype := Fin_mk (n + 1) n ⋯a:Objectha:a ∈ X lasti:(Fin (n + 1)).toSubtypethis:∃ m, ∃ (h : m < n + 1), i = Fin_mk (n + 1) m hheq:i = last⊢ (X last).toSubtype
All goals completed! 🐙
inst✝:SetTheoryn:ℕX:(Fin (n + 1)).toSubtype → Seth:∀ (i : (Fin (n + 1)).toSubtype), X i ≠ ∅X':(Fin n).toSubtype → Set := fun i => X (Fin_embed n (n + 1) ⋯ i)hX':∀ (i : (Fin n).toSubtype), X' i ≠ ∅hn:iProd X' ≠ ∅x':(i : (Fin n).toSubtype) → (X' i).toSubtypelast:(Fin (n + 1)).toSubtype := Fin_mk (n + 1) n ⋯a:Objectha:a ∈ X lasti:(Fin (n + 1)).toSubtypethis:∃ m, ∃ (h : m < n + 1), i = Fin_mk (n + 1) m hheq:¬i = last⊢ (X i).toSubtype
have : ∃ m, ∃ h: m < n, X i = X' (Fin_mk n m h) := inst✝:SetTheoryn:ℕX:(Fin (n + 1)).toSubtype → Seth:∀ (i : (Fin (n + 1)).toSubtype), X i ≠ ∅X':(Fin n).toSubtype → Set := fun i => X (Fin_embed n (n + 1) ⋯ i)hX':∀ (i : (Fin n).toSubtype), X' i ≠ ∅hn:iProd X' ≠ ∅x':(i : (Fin n).toSubtype) → (X' i).toSubtypelast:(Fin (n + 1)).toSubtype := Fin_mk (n + 1) n ⋯a:Objectha:a ∈ X last⊢ (i : (Fin (n + 1)).toSubtype) → (X i).toSubtype
inst✝:SetTheoryn:ℕX:(Fin (n + 1)).toSubtype → Seth✝:∀ (i : (Fin (n + 1)).toSubtype), X i ≠ ∅X':(Fin n).toSubtype → Set := fun i => X (Fin_embed n (n + 1) ⋯ i)hX':∀ (i : (Fin n).toSubtype), X' i ≠ ∅hn:iProd X' ≠ ∅x':(i : (Fin n).toSubtype) → (X' i).toSubtypelast:(Fin (n + 1)).toSubtype := Fin_mk (n + 1) n ⋯a:Objectha:a ∈ X lasti:(Fin (n + 1)).toSubtypeheq:¬i = lastm:ℕh:m < n + 1this:i = Fin_mk (n + 1) m h⊢ ∃ m, ∃ (h : m < n), X i = X' (Fin_mk n m h)
have h' : m ≠ n := inst✝:SetTheoryn:ℕX:(Fin (n + 1)).toSubtype → Seth:∀ (i : (Fin (n + 1)).toSubtype), X i ≠ ∅X':(Fin n).toSubtype → Set := fun i => X (Fin_embed n (n + 1) ⋯ i)hX':∀ (i : (Fin n).toSubtype), X' i ≠ ∅hn:iProd X' ≠ ∅x':(i : (Fin n).toSubtype) → (X' i).toSubtypelast:(Fin (n + 1)).toSubtype := Fin_mk (n + 1) n ⋯a:Objectha:a ∈ X last⊢ (i : (Fin (n + 1)).toSubtype) → (X i).toSubtype
inst✝:SetTheoryn:ℕX:(Fin (n + 1)).toSubtype → Seth✝:∀ (i : (Fin (n + 1)).toSubtype), X i ≠ ∅X':(Fin n).toSubtype → Set := fun i => X (Fin_embed n (n + 1) ⋯ i)hX':∀ (i : (Fin n).toSubtype), X' i ≠ ∅hn:iProd X' ≠ ∅x':(i : (Fin n).toSubtype) → (X' i).toSubtypelast:(Fin (n + 1)).toSubtype := Fin_mk (n + 1) n ⋯a:Objectha:a ∈ X lasti:(Fin (n + 1)).toSubtypem:ℕh:m < n + 1this:i = Fin_mk (n + 1) m hheq:m = n⊢ i = last
All goals completed! 🐙
replace h' : m < n := inst✝:SetTheoryn:ℕX:(Fin (n + 1)).toSubtype → Seth:∀ (i : (Fin (n + 1)).toSubtype), X i ≠ ∅X':(Fin n).toSubtype → Set := fun i => X (Fin_embed n (n + 1) ⋯ i)hX':∀ (i : (Fin n).toSubtype), X' i ≠ ∅hn:iProd X' ≠ ∅x':(i : (Fin n).toSubtype) → (X' i).toSubtypelast:(Fin (n + 1)).toSubtype := Fin_mk (n + 1) n ⋯a:Objectha:a ∈ X last⊢ (i : (Fin (n + 1)).toSubtype) → (X i).toSubtype inst✝:SetTheoryn:ℕX:(Fin (n + 1)).toSubtype → Seth✝:∀ (i : (Fin (n + 1)).toSubtype), X i ≠ ∅X':(Fin n).toSubtype → Set := fun i => X (Fin_embed n (n + 1) ⋯ i)hX':∀ (i : (Fin n).toSubtype), X' i ≠ ∅hn:iProd X' ≠ ∅x':(i : (Fin n).toSubtype) → (X' i).toSubtypelast:(Fin (n + 1)).toSubtype := Fin_mk (n + 1) n ⋯a:Objectha:a ∈ X lasti:(Fin (n + 1)).toSubtypeheq:¬i = lastm:ℕh:m < n + 1this:i = Fin_mk (n + 1) m hh':n ≤ m⊢ m = n; All goals completed! 🐙
inst✝:SetTheoryn:ℕX:(Fin (n + 1)).toSubtype → Seth✝:∀ (i : (Fin (n + 1)).toSubtype), X i ≠ ∅X':(Fin n).toSubtype → Set := fun i => X (Fin_embed n (n + 1) ⋯ i)hX':∀ (i : (Fin n).toSubtype), X' i ≠ ∅hn:iProd X' ≠ ∅x':(i : (Fin n).toSubtype) → (X' i).toSubtypelast:(Fin (n + 1)).toSubtype := Fin_mk (n + 1) n ⋯a:Objectha:a ∈ X lasti:(Fin (n + 1)).toSubtypeheq:¬i = lastm:ℕh:m < n + 1this:i = Fin_mk (n + 1) m hh':m < n⊢ X i = X' (Fin_mk n m h')
inst✝:SetTheoryn:ℕX:(Fin (n + 1)).toSubtype → Seth✝:∀ (i : (Fin (n + 1)).toSubtype), X i ≠ ∅X':(Fin n).toSubtype → Set := fun i => X (Fin_embed n (n + 1) ⋯ i)hX':∀ (i : (Fin n).toSubtype), X' i ≠ ∅hn:iProd X' ≠ ∅x':(i : (Fin n).toSubtype) → (X' i).toSubtypelast:(Fin (n + 1)).toSubtype := Fin_mk (n + 1) n ⋯a:Objectha:a ∈ X lasti:(Fin (n + 1)).toSubtypeheq:¬i = lastm:ℕh:m < n + 1this:i = Fin_mk (n + 1) m hh':m < n⊢ X i = X (Fin_embed n (n + 1) ⋯ (Fin_mk n m h')); All goals completed! 🐙
inst✝:SetTheoryn:ℕX:(Fin (n + 1)).toSubtype → Seth:∀ (i : (Fin (n + 1)).toSubtype), X i ≠ ∅X':(Fin n).toSubtype → Set := fun i => X (Fin_embed n (n + 1) ⋯ i)hX':∀ (i : (Fin n).toSubtype), X' i ≠ ∅hn:iProd X' ≠ ∅x':(i : (Fin n).toSubtype) → (X' i).toSubtypelast:(Fin (n + 1)).toSubtype := Fin_mk (n + 1) n ⋯a:Objectha:a ∈ X lasti:(Fin (n + 1)).toSubtypethis✝:∃ m, ∃ (h : m < n + 1), i = Fin_mk (n + 1) m hheq:¬i = lastthis:∃ m, ∃ (h : m < n), X i = X' (Fin_mk n m h)⊢ (X' (Fin_mk n this.choose ⋯)).toSubtype
All goals completed! 🐙
All goals completed! 🐙
Вправа 3.5.1, друга частина (вимагає аксіоми регулярності)
abbrev OrderedPair.toObject' : OrderedPair ↪ Object where
toFun p := ({ p.fst, (({p.fst, p.snd}:Set):Object) }:Set)
inj' := inst✝:SetTheory⊢ Function.Injective fun p => SetTheory.set_to_object {p.fst, SetTheory.set_to_object {p.fst, p.snd}} All goals completed! 🐙
Альтернативне визначення кортежу, використане у Вправі 3.5.2
@[ext]
structure SetTheory.Set.Tuple (n:ℕ) where
X: Set
x: SetTheory.Set.Fin n → X
surj: Function.Surjective x
Вправа 3.5.2
theorem SetTheory.Set.Tuple.eq {n:ℕ} (t t':Tuple n) :
t = t' ↔ ∀ n : Fin n, ((t.x n):Object) = ((t'.x n):Object) := inst✝:SetTheoryn:ℕt:Tuple nt':Tuple n⊢ t = t' ↔ ∀ (n_1 : (Fin n).toSubtype), ↑(t.x n_1) = ↑(t'.x n_1) All goals completed! 🐙
noncomputable abbrev SetTheory.Set.iProd_equiv_tuples (n:ℕ) (X: Fin n → Set) :
iProd X ≃ { t:Tuple n // ∀ i, (t.x i:Object) ∈ X i } where
toFun := sorry
invFun := sorry
left_inv := sorry
right_inv := sorry
Вправа 3.5.3. Дух завдання полягає в тому, щоб уникнути прямих переписувань (які роблять
усі ці твердження тривіальними), а натомість використовувати OrderedPair.eq
або
SetTheory.Set.tuple_inj
theorem OrderedPair.refl (p: OrderedPair) : p = p := inst✝:SetTheoryp:OrderedPair⊢ p = p All goals completed! 🐙
theorem OrderedPair.symm (p q: OrderedPair) : p = q ↔ q = p := inst✝:SetTheoryp:OrderedPairq:OrderedPair⊢ p = q ↔ q = p All goals completed! 🐙
theorem OrderedPair.trans {p q r: OrderedPair} (hpq: p=q) (hqr: q=r) : p=r := inst✝:SetTheoryp:OrderedPairq:OrderedPairr:OrderedPairhpq:p = qhqr:q = r⊢ p = r All goals completed! 🐙
theorem SetTheory.Set.tuple_refl {I:Set} {X: I → Set} (a: ∀ i, X i) :
tuple a = tuple a := inst✝:SetTheoryI:SetX:I.toSubtype → Seta:(i : I.toSubtype) → (X i).toSubtype⊢ tuple a = tuple a All goals completed! 🐙
theorem SetTheory.Set.tuple_symm {I:Set} {X: I → Set} (a b: ∀ i, X i) :
tuple a = tuple b ↔ tuple b = tuple a := inst✝:SetTheoryI:SetX:I.toSubtype → Seta:(i : I.toSubtype) → (X i).toSubtypeb:(i : I.toSubtype) → (X i).toSubtype⊢ tuple a = tuple b ↔ tuple b = tuple a All goals completed! 🐙
theorem SetTheory.Set.tuple_trans {I:Set} {X: I → Set} {a b c: ∀ i, X i}
(hab: tuple a = tuple b) (hbc : tuple b = tuple c) :
tuple a = tuple c := inst✝:SetTheoryI:SetX:I.toSubtype → Seta:(i : I.toSubtype) → (X i).toSubtypeb:(i : I.toSubtype) → (X i).toSubtypec:(i : I.toSubtype) → (X i).toSubtypehab:tuple a = tuple bhbc:tuple b = tuple c⊢ tuple a = tuple c All goals completed! 🐙
Вправа 3.5.4
theorem SetTheory.Set.prod_union (A B C:Set) : A ×ˢ (B ∪ C) = (A ×ˢ B) ∪ (A ×ˢ C) := inst✝:SetTheoryA:SetB:SetC:Set⊢ A ×ˢ (B ∪ C) = A ×ˢ B ∪ A ×ˢ C All goals completed! 🐙
Вправа 3.5.4
theorem SetTheory.Set.prod_inter (A B C:Set) : A ×ˢ (B ∩ C) = (A ×ˢ B) ∩ (A ×ˢ C) := inst✝:SetTheoryA:SetB:SetC:Set⊢ A ×ˢ (B ∩ C) = A ×ˢ B ∩ A ×ˢ C All goals completed! 🐙
Вправа 3.5.4
theorem SetTheory.Set.prod_diff (A B C:Set) : A ×ˢ (B \ C) = (A ×ˢ B) \ (A ×ˢ C) := inst✝:SetTheoryA:SetB:SetC:Set⊢ A ×ˢ (B \ C) = A ×ˢ B \ A ×ˢ C All goals completed! 🐙
Вправа 3.5.4
theorem SetTheory.Set.union_prod (A B C:Set) : (A ∪ B) ×ˢ C = (A ×ˢ C) ∪ (B ×ˢ C) := inst✝:SetTheoryA:SetB:SetC:Set⊢ (A ∪ B) ×ˢ C = A ×ˢ C ∪ B ×ˢ C All goals completed! 🐙
Вправа 3.5.4
theorem SetTheory.Set.inter_prod (A B C:Set) : (A ∩ B) ×ˢ C = (A ×ˢ C) ∩ (B ×ˢ C) := inst✝:SetTheoryA:SetB:SetC:Set⊢ (A ∩ B) ×ˢ C = A ×ˢ C ∩ B ×ˢ C All goals completed! 🐙
Вправа 3.5.4
theorem SetTheory.Set.diff_prod (A B C:Set) : (A \ B) ×ˢ C = (A ×ˢ C) \ (A ×ˢ B) := inst✝:SetTheoryA:SetB:SetC:Set⊢ (A \ B) ×ˢ C = A ×ˢ C \ A ×ˢ B All goals completed! 🐙
Вправа 3.5.5
theorem SetTheory.Set.inter_of_prod (A B C D:Set) :
(A ×ˢ B) ∩ (C ×ˢ D) = (A ∩ C) ×ˢ (B ∩ D) := inst✝:SetTheoryA:SetB:SetC:SetD:Set⊢ A ×ˢ B ∩ C ×ˢ D = (A ∩ C) ×ˢ (B ∩ D) All goals completed! 🐙
/- Вправа 3.5.5 -/
def SetTheory.Set.union_of_prod :
Decidable (∀ (A B C D:Set), (A ×ˢ B) ∪ (C ×ˢ D) = (A ∪ C) ×ˢ (B ∪ D)) := inst✝:SetTheory⊢ Decidable (∀ (A B C D : Set), A ×ˢ B ∪ C ×ˢ D = (A ∪ C) ×ˢ (B ∪ D))
-- перший рядок цієї конструкції має бути `apply isTrue` або `apply isFalse`.
All goals completed! 🐙
/- Вправа 3.5.5 -/
def SetTheory.Set.diff_of_prod :
Decidable (∀ (A B C D:Set), (A ×ˢ B) \ (C ×ˢ D) = (A \ C) ×ˢ (B \ D)) := inst✝:SetTheory⊢ Decidable (∀ (A B C D : Set), A ×ˢ B \ C ×ˢ D = (A \ C) ×ˢ (B \ D))
-- перший рядок цієї конструкції має бути `apply isTrue` або `apply isFalse`.
All goals completed! 🐙
Вправа 3.5.6.
theorem SetTheory.Set.prod_subset_prod {A B C D:Set}
(hA: A ≠ ∅) (hB: B ≠ ∅) (hC: C ≠ ∅) (hD: D ≠ ∅) :
A ×ˢ B ⊆ C ×ˢ D ↔ A ⊆ C ∧ B ⊆ D := inst✝:SetTheoryA:SetB:SetC:SetD:SethA:A ≠ ∅hB:B ≠ ∅hC:C ≠ ∅hD:D ≠ ∅⊢ A ×ˢ B ⊆ C ×ˢ D ↔ A ⊆ C ∧ B ⊆ D All goals completed! 🐙
def SetTheory.Set.prod_subset_prod' :
Decidable (∀ (A B C D:Set), A ×ˢ B ⊆ C ×ˢ D ↔ A ⊆ C ∧ B ⊆ D) := inst✝:SetTheory⊢ Decidable (∀ (A B C D : Set), A ×ˢ B ⊆ C ×ˢ D ↔ A ⊆ C ∧ B ⊆ D)
-- перший рядок цієї конструкції має бути `apply isTrue` або `apply isFalse`.
All goals completed! 🐙
Вправа 3.5.7
theorem SetTheory.Set.direct_sum {X Y Z:Set} (f: Z → X) (g: Z → Y) :
∃! h: Z → X ×ˢ Y, fst ∘ h = f ∧ snd ∘ h = g := inst✝:SetTheoryX:SetY:SetZ:Setf:Z.toSubtype → X.toSubtypeg:Z.toSubtype → Y.toSubtype⊢ ∃! h, fst ∘ h = f ∧ snd ∘ h = g All goals completed! 🐙
Вправа 3.5.8
@[simp]
theorem SetTheory.Set.iProd_empty_iff {n:ℕ} {X: Fin n → Set} :
iProd X = ∅ ↔ ∀ i, X i = ∅ := inst✝:SetTheoryn:ℕX:(Fin n).toSubtype → Set⊢ iProd X = ∅ ↔ ∀ (i : (Fin n).toSubtype), X i = ∅ All goals completed! 🐙
Вправа 3.5.9
theorem SetTheory.Set.iUnion_inter_iUnion {I J: Set} (A: I → Set) (B: J → Set) :
(iUnion I A) ∩ (iUnion J B) = iUnion (I ×ˢ J) (fun p ↦ (A (fst p)) ∩ (B (snd p))) := inst✝:SetTheoryI:SetJ:SetA:I.toSubtype → SetB:J.toSubtype → Set⊢ I.iUnion A ∩ J.iUnion B = (I ×ˢ J).iUnion fun p => A (fst p) ∩ B (snd p) All goals completed! 🐙
abbrev SetTheory.Set.graph {X Y:Set} (f: X → Y) : Set :=
(X ×ˢ Y).specify (fun p ↦ (f (fst p) = snd p))
Вправа 3.5.10
theorem SetTheory.Set.graph_inj {X Y:Set} (f f': X → Y) :
graph f = graph f' ↔ f = f' := inst✝:SetTheoryX:SetY:Setf:X.toSubtype → Y.toSubtypef':X.toSubtype → Y.toSubtype⊢ graph f = graph f' ↔ f = f' All goals completed! 🐙
theorem SetTheory.Set.is_graph {X Y G:Set} (hG: G ⊆ X ×ˢ Y)
(hvert: ∀ x:X, ∃! y:Y, ((⟨x,y⟩:OrderedPair):Object) ∈ G) :
∃! f: X → Y, G = graph f := inst✝:SetTheoryX:SetY:SetG:SethG:G ⊆ X ×ˢ Yhvert:∀ (x : X.toSubtype), ∃! y, OrderedPair.toObject { fst := ↑x, snd := ↑y } ∈ G⊢ ∃! f, G = graph f All goals completed! 🐙
Вправа 3.5.11. Це тривіально випливає з SetTheory.Set.power_set_axiom'
, але вправа
полягає у виведенні твердження з SetTheory.Set.mem_powerset
.
theorem SetTheory.Set.power_set_axiom' (X Y:Set) :
∃! S:Set, ∀(F:Object), F ∈ S ↔ ∃ f: Y → X, object_of f = F := sorry
Вправа 3.5.12, з включеними помилками з веб-сайту
theorem SetTheory.Set.recursion (X: Type) (f: nat → X → X) (c:X) :
∃! a: nat → X, a 0 = c ∧ ∀ n, a (n + 1:ℕ) = f n (a n) := inst✝:SetTheoryX:Typef:nat.toSubtype → X → Xc:X⊢ ∃! a, a 0 = c ∧ ∀ (n : ℕ), a ↑(n + 1) = f (↑n) (a ↑n) All goals completed! 🐙
Вправа 3.5.13
theorem SetTheory.Set.nat_unique (nat':Set) (zero:nat') (succ:nat' → nat')
(succ_ne: ∀ n:nat', succ n ≠ zero) (succ_of_ne: ∀ n m:nat', n ≠ m → succ n ≠ succ m)
(ind: ∀ P: nat' → Prop, P zero → (∀ n, P n → P (succ n)) → ∀ n, P n) :
∃! f : nat → nat', Function.Bijective f ∧ f 0 = zero
∧ ∀ (n:nat) (n':nat'), f n = n' ↔ f (n+1:ℕ) = succ n' := inst✝:SetTheorynat':Setzero:nat'.toSubtypesucc:nat'.toSubtype → nat'.toSubtypesucc_ne:∀ (n : nat'.toSubtype), succ n ≠ zerosucc_of_ne:∀ (n m : nat'.toSubtype), n ≠ m → succ n ≠ succ mind:∀ (P : nat'.toSubtype → Prop), P zero → (∀ (n : nat'.toSubtype), P n → P (succ n)) → ∀ (n : nat'.toSubtype), P n⊢ ∃! f,
Function.Bijective f ∧
f 0 = zero ∧ ∀ (n : nat.toSubtype) (n' : nat'.toSubtype), f n = n' ↔ f ↑(nat_equiv.symm n + 1) = succ n' All goals completed! 🐙
end Chapter3