1-- Set-sized selection from the axiom of choice, without global Choice.2-- 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 Passmore67-- Copyright (c) 2026 Grant Passmore. Apache License 2.0.8module Grace.Cumulus.Set.ChoiceFunctions9import Core1011def inhabitedSubsets (A : Set) : Set:= {S ∈𝒫(A) | Nonempty(S)}12predicate SubsetChoice (c A : Set) :=∀ S ∈𝒫(A), Nonempty(S) → c[S] ∈ S1314theorem SubsetChoice.exists (A : Set)15shows∃ c, SubsetChoice(c, A)16proof17have inhabited : ∀ S ∈ inhabitedSubsets(A), ∃ x, x ∈ S18intros S member19obtain⟨subset, nonempty⟩:= inhabitedSubsets.membership.forward with member20exact nonempty21obtain⟨c, function, selects⟩:=set.choice with inhabited22witness c23intros S subset nonempty24have member : S ∈ inhabitedSubsets(A) := inhabitedSubsets.membership.backward with⟨subset, nonempty⟩25exact selects with S, member2627theorem SubsetChoice.member (c A S : Set)28requires choice : SubsetChoice(c, A)29requires subset : S ⊆ A30requires inhabited : Nonempty(S)31shows c[S] ∈ S32proof33unfold Subset at subset34have bounded :=set.powerset.backward with subset35exact choice with S, bounded, inhabited36