-- Inaccessible cardinals as the heights of Grothendieck universes, and every -- universe as a stage V(κ) of the cumulative hierarchy -- Part of Cumulus, the Grace17 mathematics library. -- Copyright (c) 2026 Grant Passmore. -- Released under the Apache License 2.0. See LICENSE in the repository root. -- Authors: Grant Passmore module Grace.Cumulus.LargeCardinal.Inaccessible import Universe import Set.Hierarchy import Set.Ordinal.Basic -- κ is inaccessible when it is an ordinal above ω whose stage V(κ) is a -- Grothendieck universe. Under ZFC this is equivalent to κ being strongly -- inaccessible (uncountable, regular, and a strong limit); this module does -- not prove that equivalence. predicate Inaccessible (κ : Set) := κ ∈ Ordinal ∧ ω ∈ κ ∧ GrothendieckUniverse(V(κ)) register largecardinal Inaccessible "an inaccessible cardinal" theorem Inaccessible.ordinal (κ : Set) requires inaccessible : Inaccessible(κ) shows κ ∈ Ordinal proof obtain ⟨ordinal, _, _⟩ := inaccessible exact ordinal theorem Inaccessible.omega (κ : Set) requires inaccessible : Inaccessible(κ) shows ω ∈ κ proof obtain ⟨_, omega, _⟩ := inaccessible exact omega theorem Inaccessible.universe (κ : Set) requires inaccessible : Inaccessible(κ) shows GrothendieckUniverse(V(κ)) proof obtain ⟨_, _, universe⟩ := inaccessible exact universe -- Rank stays inside a universe: the ranks of the members of x form the -- range of a function from x into U. theorem GrothendieckUniverse.rank (U x : Set) requires universe : GrothendieckUniverse(U) requires hx : x ∈ U shows rank(x) ∈ U proof revert hx induction x using membership intros current ih hCurrent have values : ∀ y ∈ current, rank(y) ∈ U intros y hy exact ih with y, hy, (GrothendieckUniverse.member_of_member with universe, hCurrent, hy) have history : FunctionBetween(rank.history(current), current, U) refine ⟨?_, ?_, ?_⟩ . intros p hp obtain ⟨y, hy, shape⟩ := rank.history_characterization.forward with hp rw shape exact product.pair with hy, (values with y, hy) . intros a b hab c hac obtain ⟨y, _, first⟩ := rank.history_characterization.forward with hab obtain ⟨z, _, second⟩ := rank.history_characterization.forward with hac obtain ⟨ay, by⟩ := orderedPair.injective with first obtain ⟨az, cz⟩ := orderedPair.injective with second rw [by, cz, ← ay, ← az] . intros y hy refine ⟨rank(y), (values with y, hy), (rank.history.contains with hy)⟩ have ranks := GrothendieckUniverse.range with universe, hCurrent, history have supremum := GrothendieckUniverse.union with universe, ranks rw rank.unfold exact GrothendieckUniverse.next with universe, supremum -- At a limit λ in U whose earlier stages lie in U, the stage V(λ) lies in U: -- the earlier stages are the values of a function from λ into U. theorem GrothendieckUniverse.V_limit (U λ : Set) requires universe : GrothendieckUniverse(U) requires limit : Limit(λ) requires hλ : λ ∈ U requires earlier : ∀ β ∈ λ, V(β) ∈ U shows V(λ) ∈ U proof have history : FunctionBetween(V.history(λ), λ, U) refine ⟨?_, ?_, ?_⟩ . intros p hp obtain ⟨β, hβ, shape⟩ := V.history.membership.forward with hp rw shape exact product.pair with hβ, (earlier with β, hβ) . intros a b hab c hac obtain ⟨β, _, first⟩ := V.history.membership.forward with hab obtain ⟨γ, _, second⟩ := V.history.membership.forward with hac obtain ⟨aβ, bβ⟩ := orderedPair.injective with first obtain ⟨aγ, cγ⟩ := orderedPair.injective with second rw [bβ, cγ, ← aβ, ← aγ] . intros β hβ refine ⟨V(β), (earlier with β, hβ), (V.history.contains with hβ)⟩ have unions := GrothendieckUniverse.indexed_union with universe, hλ, history have bounded : V(λ) ⊆ ⋃(functionImage(V.history(λ), λ, U)) intros x hx have stages := V.limit_membership at x, λ with limit obtain ⟨β, hβ, hxβ⟩ := stages.forward with hx have mapped := V.history.contains with hβ have value := FunctionBetween.apply_value with history, hβ, mapped have image := functionImage.value with history, hβ rw value at image exact set.union.backward with ⟨V(β), image, hxβ⟩ exact GrothendieckUniverse.subset with universe, unions, bounded -- Every stage V(α) with α an ordinal of U lies in U. theorem GrothendieckUniverse.V (U α : Set) requires universe : GrothendieckUniverse(U) requires hα : α ∈ ordinalsWithin(U) shows V(α) ∈ U proof revert hα induction α using membership intros current ih hCurrent obtain ⟨member, ordinal⟩ := ordinalsWithin.membership.forward with hCurrent have earlier : ∀ β ∈ current, V(β) ∈ U intros β hβ have βMember := GrothendieckUniverse.member_of_member with universe, member, hβ have βOrdinal := Ordinal.member with ordinal, hβ exact ih with β, hβ, (ordinalsWithin.membership.backward with ⟨βMember, βOrdinal⟩) have cases := Ordinal.cases with ordinal cases cases with zero | positive . rw [zero, ← nat.zero, V.zero] exact GrothendieckUniverse.empty with universe . cases positive with successor | limit . obtain ⟨γ, hγ, step⟩ := successor have γOrdinal := Ordinal.member with ordinal, hγ rw [← step, V.next with γOrdinal] exact GrothendieckUniverse.powerset with universe, (earlier with γ, hγ) . exact GrothendieckUniverse.V_limit with universe, limit, member, earlier -- Williamson's theorem: every Grothendieck universe is the stage V(κ) at the -- ordinal κ of its ordinals. theorem GrothendieckUniverse.eq_V (U : Set) requires universe : GrothendieckUniverse(U) shows U = V(ordinalsWithin(U)) proof have limit := GrothendieckUniverse.ordinalsWithin_limit with universe ext x have stages := V.limit_membership at x, ordinalsWithin(U) with limit constructor . intro hx have rankMember := GrothendieckUniverse.rank with universe, hx have rankOrdinal := rank.ordinal at x have rankWithin := ordinalsWithin.membership.backward at U, rank(x) with ⟨rankMember, rankOrdinal⟩ exact stages.backward with ⟨rank(x), rankWithin, rank.membership at x⟩ . intro hx obtain ⟨β, hβ, hxβ⟩ := stages.forward with hx have stage := GrothendieckUniverse.V with universe, hβ exact GrothendieckUniverse.member_of_member with universe, stage, hxβ theorem GrothendieckUniverse.inaccessible (U : Set) requires universe : GrothendieckUniverse(U) shows Inaccessible(ordinalsWithin(U)) proof have ordinal := GrothendieckUniverse.ordinalsWithin with universe have omega := GrothendieckUniverse.omega_ordinalsWithin with universe have stage := GrothendieckUniverse.eq_V with universe rw stage at universe exact ⟨ordinal, omega, universe⟩