Grace/Cumulus/LargeCardinal/Universe.g17

Open in Workbench Download source

Imports

Set.Function.Space · Set.Ordinal.Basic · Set.Function

Declarations

Source

1-- Grothendieck universes and their closure under the set-forming operations2-- Part of Cumulus, the Grace17 mathematics library.3-- Copyright (c) 2026 Grant Passmore.4-- Released under the Apache License 2.0. See LICENSE in the repository root.5-- Authors: Grant Passmore67module Grace.Cumulus.LargeCardinal.Universe8import Set.Function.Space9import Set.Ordinal.Basic10import Set.Function1112-- A Grothendieck universe is a transitive set containing ω and closed under13-- pairs, power sets, and unions of families indexed by its members: for14-- I ∈ U and a function f : I → U, the union of the values of f lies in U.15-- Requiring ω ∈ U excludes the degenerate universes ∅ and V(ω).16predicate GrothendieckUniverse (U : Set) :=17  Transitive(U) ∧ ω ∈ U ∧ (∀ x ∈ U, ∀ y ∈ U, {x, y} ∈ U) ∧18  (∀ x ∈ U, 𝒫(x) ∈ U) ∧19  (∀ I ∈ U, ∀ f, FunctionBetween(f, I, U) → ⋃(functionImage(f, I, U)) ∈ U)20register largecardinal GrothendieckUniverse "a Grothendieck universe"2122theorem GrothendieckUniverse.transitive (U : Set)23  requires universe : GrothendieckUniverse(U)24  shows Transitive(U)25proof26  simp [GrothendieckUniverse]2728theorem GrothendieckUniverse.omega (U : Set)29  requires universe : GrothendieckUniverse(U)30  shows ω ∈ U31proof32  simp [GrothendieckUniverse]3334theorem GrothendieckUniverse.pair (U x y : Set)35  requires universe : GrothendieckUniverse(U)36  requires hx : x ∈ U37  requires hy : y ∈ U38  shows {x, y} ∈ U39proof40  obtain ⟨_, _, pairs, _, _⟩ := universe41  exact pairs with x, hx, y, hy4243theorem GrothendieckUniverse.powerset (U x : Set)44  requires universe : GrothendieckUniverse(U)45  requires hx : x ∈ U46  shows 𝒫(x) ∈ U47proof48  obtain ⟨_, _, _, powersets, _⟩ := universe49  exact powersets with x, hx5051theorem GrothendieckUniverse.indexed_union (U I f : Set)52  requires universe : GrothendieckUniverse(U)53  requires hI : I ∈ U54  requires function : f : I → U55  shows ⋃(functionImage(f, I, U)) ∈ U56proof57  obtain ⟨_, _, _, _, unions⟩ := universe58  exact unions with I, hI, f, function5960theorem GrothendieckUniverse.member_subset (U x : Set)61  requires universe : GrothendieckUniverse(U)62  requires hx : x ∈ U63  shows x ⊆ U64proof65  have transitive := GrothendieckUniverse.transitive with universe66  exact transitive with x, hx6768theorem GrothendieckUniverse.member_of_member (U x y : Set)69  requires universe : GrothendieckUniverse(U)70  requires hx : x ∈ U71  requires hy : y ∈ x72  shows y ∈ U73proof74  have included := GrothendieckUniverse.member_subset with universe, hx75  exact included with y, hy7677theorem GrothendieckUniverse.subset (U x y : Set)78  requires universe : GrothendieckUniverse(U)79  requires hx : x ∈ U80  requires hy : y ⊆ x81  shows y ∈ U82proof83  have powerset := GrothendieckUniverse.powerset with universe, hx84  have inPowerset := set.powerset.backward with hy85  exact GrothendieckUniverse.member_of_member with universe, powerset, inPowerset8687theorem GrothendieckUniverse.empty (U : Set)88  requires universe : GrothendieckUniverse(U)89  shows ∅ ∈ U90proof91  have omega := GrothendieckUniverse.omega with universe92  exact GrothendieckUniverse.subset with universe, omega, (empty.subset at ω)9394theorem GrothendieckUniverse.singleton (U x : Set)95  requires universe : GrothendieckUniverse(U)96  requires hx : x ∈ U97  shows {x} ∈ U98proof99  have doubled := GrothendieckUniverse.pair with universe, hx, hx100  rwa pair.self at doubled101102theorem GrothendieckUniverse.orderedPair (U x y : Set)103  requires universe : GrothendieckUniverse(U)104  requires hx : x ∈ U105  requires hy : y ∈ U106  shows (x, y) ∈ U107proof108  unfold orderedPair109  have first := GrothendieckUniverse.pair with universe, hx, hx110  have second := GrothendieckUniverse.pair with universe, hx, hy111  exact GrothendieckUniverse.pair with universe, first, second112113theorem GrothendieckUniverse.union (U x : Set)114  requires universe : GrothendieckUniverse(U)115  requires hx : x ∈ U116  shows ⋃(x) ∈ U117proof118  have included := GrothendieckUniverse.member_subset with universe, hx119  have function := identity.inclusion with included120  have unions := GrothendieckUniverse.indexed_union with universe, hx, function121  rwa functionImage.identity with included at unions122123theorem GrothendieckUniverse.union2 (U x y : Set)124  requires universe : GrothendieckUniverse(U)125  requires hx : x ∈ U126  requires hy : y ∈ U127  shows x ∪ y ∈ U128proof129  have pair := GrothendieckUniverse.pair with universe, hx, hy130  have unions := GrothendieckUniverse.union with universe, pair131  rwa union.pair at unions132133theorem GrothendieckUniverse.intersection (U x y : Set)134  requires universe : GrothendieckUniverse(U)135  requires hx : x ∈ U136  shows x ∩ y ∈ U137proof138  exact GrothendieckUniverse.subset with universe, hx, (intersection.subset_left at x, y)139140theorem GrothendieckUniverse.difference (U x y : Set)141  requires universe : GrothendieckUniverse(U)142  requires hx : x ∈ U143  shows x ∖ y ∈ U144proof145  exact GrothendieckUniverse.subset with universe, hx, (difference.subset_left at x, y)146147theorem GrothendieckUniverse.product (U A B : Set)148  requires universe : GrothendieckUniverse(U)149  requires hA : A ∈ U150  requires hB : B ∈ U151  shows A × B ∈ U152proof153  have joined := GrothendieckUniverse.union2 with universe, hA, hB154  have once := GrothendieckUniverse.powerset with universe, joined155  have twice := GrothendieckUniverse.powerset with universe, once156  have bounded : A × B ⊆ productBound(A, B) by simp [product]157  unfold productBound at bounded158  exact GrothendieckUniverse.subset with universe, twice, bounded159160theorem GrothendieckUniverse.functionSpace (U A B : Set)161  requires universe : GrothendieckUniverse(U)162  requires hA : A ∈ U163  requires hB : B ∈ U164  shows functionSpace(A, B) ∈ U165proof166  have product := GrothendieckUniverse.product with universe, hA, hB167  have powerset := GrothendieckUniverse.powerset with universe, product168  exact GrothendieckUniverse.subset with universe, powerset, (functionSpace.subset_powerset at A, B)169170-- The image of a member under a function into the universe is a member:171-- every value is a subset of the union of the values.172theorem GrothendieckUniverse.functionImage (U I f : Set)173  requires universe : GrothendieckUniverse(U)174  requires hI : I ∈ U175  requires function : f : I → U176  shows functionImage(f, I, U) ∈ U177proof178  have unions := GrothendieckUniverse.indexed_union with universe, hI, function179  have powerset := GrothendieckUniverse.powerset with universe, unions180  have bounded : functionImage(f, I, U) ⊆ 𝒫(⋃(functionImage(f, I, U)))181  . intros y hy182    exact set.powerset.backward with (union.subset_of_member with hy)183  exact GrothendieckUniverse.subset with universe, powerset, bounded184185theorem GrothendieckUniverse.range (U I f : Set)186  requires universe : GrothendieckUniverse(U)187  requires hI : I ∈ U188  requires function : f : I → U189  shows range(f) ∈ U190proof191  have image := GrothendieckUniverse.functionImage with universe, hI, function192  have bounded : range(f) ⊆ functionImage(f, I, U)193  . intros y hy194    obtain ⟨_, x, mapped⟩ := range.membership.forward with hy195    obtain ⟨hx, value⟩ := FunctionBetween.bounds with function, mapped196    have applied := FunctionBetween.apply_value with function, hx, mapped197    have same : y = f(x) by rw applied198    exact functionImage.membership.backward with ⟨value, x, hx, same⟩199  exact GrothendieckUniverse.subset with universe, image, bounded200201-- A function from a member into the universe is itself a member.202theorem GrothendieckUniverse.function (U I f : Set)203  requires universe : GrothendieckUniverse(U)204  requires hI : I ∈ U205  requires function : f : I → U206  shows f ∈ U207proof208  have image := GrothendieckUniverse.functionImage with universe, hI, function209  have product := GrothendieckUniverse.product with universe, hI, image210  have corestricted := functionImage.corestrict with function211  have relation := FunctionBetween.relation with corestricted212  exact GrothendieckUniverse.subset with universe, product, relation213214theorem GrothendieckUniverse.omega_subset (U : Set)215  requires universe : GrothendieckUniverse(U)216  shows ω ⊆ U217proof218  exact GrothendieckUniverse.member_subset with universe, (GrothendieckUniverse.omega with universe)219220theorem GrothendieckUniverse.natural (U : Set, n : Nat)221  requires universe : GrothendieckUniverse(U)222  shows n ∈ U223proof224  have omega := GrothendieckUniverse.omega with universe225  have inOmega : n ∈ ω by simp [nat.omega]226  exact GrothendieckUniverse.member_of_member with universe, omega, inOmega227228theorem GrothendieckUniverse.next (U α : Set)229  requires universe : GrothendieckUniverse(U)230  requires hα : α ∈ U231  shows next(α) ∈ U232proof233  unfold next234  exact GrothendieckUniverse.union2 with universe, hα, (GrothendieckUniverse.singleton with universe, hα)235236-- The ordinals of a universe form an ordinal: a limit ordinal above ω.237theorem GrothendieckUniverse.ordinalsWithin (U : Set)238  requires universe : GrothendieckUniverse(U)239  shows ordinalsWithin(U) ∈ Ordinal240proof241  have transitive : Transitive(ordinalsWithin(U))242    intros α hα243    simp [ordinalsWithin.membership] at hα244    intros β hβ245    have ordinal := Ordinal.member with hα.right, hβ246    have member := GrothendieckUniverse.member_of_member with universe, hα.left, hβ247    simp [ordinalsWithin.membership]248  simp [Ordinal]249250theorem GrothendieckUniverse.ordinalsWithin_next (U α : Set)251  requires universe : GrothendieckUniverse(U)252  requires hα : α ∈ ordinalsWithin(U)253  shows next(α) ∈ ordinalsWithin(U)254proof255  obtain ⟨member, ordinal⟩ := ordinalsWithin.membership.forward with hα256  have nextMember := GrothendieckUniverse.next with universe, member257  have nextOrdinal := Ordinal.next with ordinal258  exact ordinalsWithin.membership.backward with ⟨nextMember, nextOrdinal⟩259260theorem GrothendieckUniverse.omega_ordinalsWithin (U : Set)261  requires universe : GrothendieckUniverse(U)262  shows ω ∈ ordinalsWithin(U)263proof264  have omega := GrothendieckUniverse.omega with universe265  exact ordinalsWithin.membership.backward with ⟨omega, Ordinal.omega⟩266267theorem GrothendieckUniverse.ordinalsWithin_limit (U : Set)268  requires universe : GrothendieckUniverse(U)269  shows Limit(ordinalsWithin(U))270proof271  have ordinal := GrothendieckUniverse.ordinalsWithin with universe272  have omega := GrothendieckUniverse.omega_ordinalsWithin with universe273  refine ⟨ordinal, ?_, ?_⟩274  . intro empty275    rw empty at omega276    exact set.empty with omega277  . intros α hα278    exact GrothendieckUniverse.ordinalsWithin_next with universe, hα279280theorem GrothendieckUniverse.ordinalsWithin_not_member (U : Set)281  requires universe : GrothendieckUniverse(U)282  shows ¬(ordinalsWithin(U) ∈ U)283proof284  intro member285  have ordinal := GrothendieckUniverse.ordinalsWithin with universe286  have self := ordinalsWithin.membership.backward at U, ordinalsWithin(U) with ⟨member, ordinal⟩287  exact Ordinal.not_member_self with self288