Disjoint sums and options over ZF sets #
This file defines the disjoint sum A ⊎ B of two ZFSets as a subtype, with
constructors, eliminators, and an equivalence to the type-level sum. It also develops
Option S together with bijections relating it to _root_.Option and a lifting of
functions to options.
Instances For
Equations
- ZFSet.«term_⊎_» = Lean.ParserDescr.trailingNode `ZFSet.«term_⊎_» 50 51 (Lean.ParserDescr.binary `andthen (Lean.ParserDescr.symbol " ⊎ ") (Lean.ParserDescr.cat `term 50))
Instances For
Equations
- ZFSet.Sum.inl a = ⟨(↑ZFSet.ZFBool.false).pair ↑a, ⋯⟩
Instances For
Equations
- ZFSet.Sum.inr b = ⟨(↑ZFSet.ZFBool.true).pair ↑b, ⋯⟩
Instances For
Uniqueness half of the universal property of the disjoint sum: casesOn is the only
family agreeing with inl_case along inl and with inr_case along inr.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Set-level universal property of the coproduct #
Everything above states the disjoint sum at the type level: A ⊎ B is a Lean subtype and
casesOn eliminates into a Lean family. This section states the same universal property
inside the model: the objects are ZFSets, the arrows are elements of funs, and
composition is ZFSet.composition.
An element of toZFSet A B tagged by false has its second projection in A.
An element of toZFSet A B not tagged by false has its second projection in B.
The left injection A → A ⊎ B, as a set-level function.
Equations
- ZFSet.Sum.inlFun A B = A.lambda (ZFSet.Sum.toZFSet A B) fun (a : ZFSet.{?u.1}) => (↑ZFSet.ZFBool.false).pair a
Instances For
The right injection B → A ⊎ B, as a set-level function.
Equations
- ZFSet.Sum.inrFun A B = B.lambda (ZFSet.Sum.toZFSet A B) fun (a : ZFSet.{?u.1}) => (↑ZFSet.ZFBool.true).pair a
Instances For
The mediating map [f, g] : A ⊎ B → X of the coproduct: it applies f to the elements
tagged by false and g to those tagged by true.
Equations
- One or more equations did not get rendered due to their size.
Instances For
[f, g] as a partial function, so that fapply can be applied to it without re-running the
zpfun search on the (large) body of coprod.
[f, g] computes with f on the left summand.
[f, g] computes with g on the right summand.
Set-level universal property of the coproduct. For f ∈ A.funs X and g ∈ B.funs X
there is a unique m ∈ (toZFSet A B).funs X whose restrictions along the two injections
inlFun/inrFun are f and g. The mediating map is coprod f g.
This is the statement of Sum.casesOn / Sum.casesOn_unique transported inside the model:
objects are ZFSets, arrows are elements of funs, composition is ZFSet.composition.
Instances For
Equations
Instances For
Cases elimination for Option, the data-level counterpart of the disjunction
Option.casesOn. It is Sum.casesOn on {∅} ⊎ S, using inl_eq_none to collapse the
left summand.
Equations
- ZFSet.Option.elim x none_case some_case = ZFSet.Sum.casesOn x (fun (a : ↥{∅}) => ⋯.mpr none_case) some_case
Instances For
Uniqueness half of the universal property of Option: elim is the only family
agreeing with none_case on none and with some_case along some.
Equations
- ZFSet.Option.the S_nemp x = if isNone : x = ZFSet.Option.none then ⟨(fun (x : ZFSet.{?u.1}) => Classical.epsilon fun (z : ZFSet.{?u.1}) => z ∈ x) S, ⋯⟩ else Classical.choose ⋯
Instances For
Equations
- ZFSet.Option.EmbeddingZFOptionOption = { toFun := ZFSet.Option.into✝, inj' := ⋯ }
Instances For
Equations
- ZFSet.Option.instEquivZFOptionOption = { toFun := ZFSet.Option.into✝, invFun := Function.invFun ZFSet.Option.into✝, left_inv := ⋯, right_inv := ⋯ }
Instances For
Equations
- ZFSet.Option.EmbeddingOptionZFOption = { toFun := ZFSet.Option.outof✝, inj' := ⋯ }
Instances For
Equations
- ZFSet.Option.instEquivOptionZFOption = { toFun := ZFSet.Option.outof✝, invFun := Function.invFun ZFSet.Option.outof✝, left_inv := ⋯, right_inv := ⋯ }
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.