Imports
/-
Copyright (c) 2026 Terence Rokop. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Terence Rokop
-/
module
public import Mathlib.CategoryTheory.Limits.Shapes.Equalizers
public import Mathlib.CategoryTheory.EqToHom
public import Mathlib.Logic.Equiv.DefsPrototype: where the free coproduct completion sits inside presheaves
Throwaway exploration, not upstream-eligible content. Every declaration here is
Classical.choice-free.
Fam(C), the free set-indexed coproduct completion of C
(Remarks 2.3 of [GhaniNordvallForsbergMalatesta2015]), embeds into PSh(C) as
the coproducts of representables. Geb/Prototypes/FinCardUniverse/ works over
PSh(C), so the question is which presheaf polynomial functors carry Fam(C)
into itself β whether a universe built over presheaves can be read back as a
family of codes.
This module answers it, and the answer is not the one the value computation of
FinCardUniverse might suggest. Membership in Fam(C) is closed under
set-indexed coproducts, so a representable times a constant is still in Fam(C):
isFamPsh_praPsh shows that the shape of the p.r.a. formula's value β
a sum over shapes of a representable times the set of arity homs β is a family
presheaf whatever that set of arity homs is. So the functors do restrict, and the
coercion multiplicity the finite model exhibits is not an obstruction to
restricting: it lands in the code type, not in the decoding.
What does obstruct is the shape presheaf. Since Tβ = T(1), a functor restricts
only if the terminal presheaf's image does, and the terminal presheaf need not
itself lie in Fam(C): isFamPsh_topPsh_of_terminal shows it does when C has
a terminal object, and not_isFamPsh_topPsh shows it does not over the walking
parallel pair, which has none. The category of elements of the terminal presheaf
is C itself, so this is the general criterion β a presheaf lies in Fam(C)
exactly when every connected component of its category of elements has a
terminal object β read at the terminal presheaf. That general criterion is not
formalized here; the two brackets are.
Main definitions
famPsh β a family of objects as a presheaf, the coproduct of representables
Ξ£_u y(d u).
IsFamPsh β membership in the image, as an unbundled natural isomorphism.
praPsh β the shape of the p.r.a. formula's value: a sum over shapes of a
representable times a set.
topPsh β the terminal presheaf.
Main statements
isFamPsh_praPsh β the p.r.a. formula's value is a family presheaf, with the
codes the shapes paired with their arity homs and the decoding read off the
shape alone.
isFamPsh_topPsh_of_terminal β the terminal presheaf is a family presheaf
when the base has a terminal object.
not_isFamPsh_topPsh β and is not, over the walking parallel pair.
References
[GhaniNordvallForsbergMalatesta2015]
[Weber2007]
Tags
prototype, presheaf, free coproduct completion, parametric right adjoint, inductive-recursive
@[expose] public sectionopen CategoryTheory CategoryTheory.Limitsnamespace GebProto.FamBoundaryFamily presheaves
variable {C : Type} [SmallCategory C]
A family of objects as a presheaf: the coproduct of representables
Ξ£_u y(d u). This is the embedding of Fam(C) into PSh(C).
def famPsh (U : Type) (d : U β C) : Cα΅α΅ β₯€ Type where
obj c := Ξ£ u : U, (c.unop βΆ d u)
map f := βΎ fun x β¦ (β¨x.1, f.unop β« x.2β© : Ξ£ u : U, (_ βΆ d u))
map_id _ := C:Typeinstβ:SmallCategory CU:Typed:U β Cxβ:Cα΅α΅β’ (βΎfun x β¦ β¨x.fst, (π xβ).unop β« x.sndβ©) = π ((u : U) Γ (Opposite.unop xβ βΆ d u))
C:Typeinstβ:SmallCategory CU:Typed:U β Cxβ:Cα΅α΅x:(u : U) Γ (Opposite.unop xβ βΆ d u)β’ ((ConcreteCategory.hom (βΎfun x β¦ β¨x.fst, (π xβ).unop β« x.sndβ©)).toFun x).fst =
((ConcreteCategory.hom (π ((u : U) Γ (Opposite.unop xβ βΆ d u)))).toFun x).fstC:Typeinstβ:SmallCategory CU:Typed:U β Cxβ:Cα΅α΅x:(u : U) Γ (Opposite.unop xβ βΆ d u)β’ ((ConcreteCategory.hom (βΎfun x β¦ β¨x.fst, (π xβ).unop β« x.sndβ©)).toFun x).snd β
((ConcreteCategory.hom (π ((u : U) Γ (Opposite.unop xβ βΆ d u)))).toFun x).snd
C:Typeinstβ:SmallCategory CU:Typed:U β Cxβ:Cα΅α΅x:(u : U) Γ (Opposite.unop xβ βΆ d u)β’ ((ConcreteCategory.hom (βΎfun x β¦ β¨x.fst, (π xβ).unop β« x.sndβ©)).toFun x).fst =
((ConcreteCategory.hom (π ((u : U) Γ (Opposite.unop xβ βΆ d u)))).toFun x).fst All goals completed! π
C:Typeinstβ:SmallCategory CU:Typed:U β Cxβ:Cα΅α΅x:(u : U) Γ (Opposite.unop xβ βΆ d u)β’ ((ConcreteCategory.hom (βΎfun x β¦ β¨x.fst, (π xβ).unop β« x.sndβ©)).toFun x).snd β
((ConcreteCategory.hom (π ((u : U) Γ (Opposite.unop xβ βΆ d u)))).toFun x).snd All goals completed! π
map_comp _ _ := C:Typeinstβ:SmallCategory CU:Typed:U β CXβ:Cα΅α΅Yβ:Cα΅α΅Zβ:Cα΅α΅xβΒΉ:Xβ βΆ Yβxβ:Yβ βΆ Zββ’ (βΎfun x β¦ β¨x.fst, (xβΒΉ β« xβ).unop β« x.sndβ©) = (βΎfun x β¦ β¨x.fst, xβΒΉ.unop β« x.sndβ©) β« βΎfun x β¦ β¨x.fst, xβ.unop β« x.sndβ©
C:Typeinstβ:SmallCategory CU:Typed:U β CXβ:Cα΅α΅Yβ:Cα΅α΅Zβ:Cα΅α΅xβΒΉ:Xβ βΆ Yβxβ:Yβ βΆ Zβx:(u : U) Γ (Opposite.unop Xβ βΆ d u)β’ ((ConcreteCategory.hom (βΎfun x β¦ β¨x.fst, (xβΒΉ β« xβ).unop β« x.sndβ©)).toFun x).fst =
((ConcreteCategory.hom ((βΎfun x β¦ β¨x.fst, xβΒΉ.unop β« x.sndβ©) β« βΎfun x β¦ β¨x.fst, xβ.unop β« x.sndβ©)).toFun x).fstC:Typeinstβ:SmallCategory CU:Typed:U β CXβ:Cα΅α΅Yβ:Cα΅α΅Zβ:Cα΅α΅xβΒΉ:Xβ βΆ Yβxβ:Yβ βΆ Zβx:(u : U) Γ (Opposite.unop Xβ βΆ d u)β’ ((ConcreteCategory.hom (βΎfun x β¦ β¨x.fst, (xβΒΉ β« xβ).unop β« x.sndβ©)).toFun x).snd β
((ConcreteCategory.hom ((βΎfun x β¦ β¨x.fst, xβΒΉ.unop β« x.sndβ©) β« βΎfun x β¦ β¨x.fst, xβ.unop β« x.sndβ©)).toFun x).snd
C:Typeinstβ:SmallCategory CU:Typed:U β CXβ:Cα΅α΅Yβ:Cα΅α΅Zβ:Cα΅α΅xβΒΉ:Xβ βΆ Yβxβ:Yβ βΆ Zβx:(u : U) Γ (Opposite.unop Xβ βΆ d u)β’ ((ConcreteCategory.hom (βΎfun x β¦ β¨x.fst, (xβΒΉ β« xβ).unop β« x.sndβ©)).toFun x).fst =
((ConcreteCategory.hom ((βΎfun x β¦ β¨x.fst, xβΒΉ.unop β« x.sndβ©) β« βΎfun x β¦ β¨x.fst, xβ.unop β« x.sndβ©)).toFun x).fst All goals completed! π
C:Typeinstβ:SmallCategory CU:Typed:U β CXβ:Cα΅α΅Yβ:Cα΅α΅Zβ:Cα΅α΅xβΒΉ:Xβ βΆ Yβxβ:Yβ βΆ Zβx:(u : U) Γ (Opposite.unop Xβ βΆ d u)β’ ((ConcreteCategory.hom (βΎfun x β¦ β¨x.fst, (xβΒΉ β« xβ).unop β« x.sndβ©)).toFun x).snd β
((ConcreteCategory.hom ((βΎfun x β¦ β¨x.fst, xβΒΉ.unop β« x.sndβ©) β« βΎfun x β¦ β¨x.fst, xβ.unop β« x.sndβ©)).toFun x).snd All goals completed! π
A presheaf lies in the image of Fam(C): it is naturally isomorphic to a
family presheaf. The isomorphism is unbundled β a family of equivalences with
the naturality equation β so that no hom of a functor category is named and the
statement stays Classical.choice-free.
def IsFamPsh (Z : Cα΅α΅ β₯€ Type) : Prop :=
β (U : Type) (d : U β C) (e : β c, Z.obj c β (famPsh U d).obj c),
β β¦c c' : Cα΅α΅β¦ (f : c βΆ c') (x : Z.obj c),
e c' (Z.map f x) = (famPsh U d).map f (e c x)The p.r.a. formula's value
At a shape presheaf that is itself a family presheaf, and an arity assignment
depending only on the shape's index, the p.r.a. formula
T(Z)(j) = Ξ£_{a β Tβ(j)} Hom(E_a, Z) takes the form below: a sum over shapes of
a representable times the set of arity homs.
The p.r.a. formula's value: shapes S lying over objects o s, each
carrying a set A s of arity homs.
def praPsh (S : Type) (o : S β C) (A : S β Type) : Cα΅α΅ β₯€ Type where
obj c := Ξ£ s : S, (c.unop βΆ o s) Γ A s
map f := βΎ fun x β¦ (β¨x.1, f.unop β« x.2.1, x.2.2β© : Ξ£ s : S, (_ βΆ o s) Γ A s)
map_id _ := C:Typeinstβ:SmallCategory CS:Typeo:S β CA:S β Typexβ:Cα΅α΅β’ (βΎfun x β¦ β¨x.fst, ((π xβ).unop β« x.snd.1, x.snd.2)β©) = π ((s : S) Γ (Opposite.unop xβ βΆ o s) Γ A s)
C:Typeinstβ:SmallCategory CS:Typeo:S β CA:S β Typexβ:Cα΅α΅x:(s : S) Γ (Opposite.unop xβ βΆ o s) Γ A sβ’ ((ConcreteCategory.hom (βΎfun x β¦ β¨x.fst, ((π xβ).unop β« x.snd.1, x.snd.2)β©)).toFun x).fst =
((ConcreteCategory.hom (π ((s : S) Γ (Opposite.unop xβ βΆ o s) Γ A s))).toFun x).fstC:Typeinstβ:SmallCategory CS:Typeo:S β CA:S β Typexβ:Cα΅α΅x:(s : S) Γ (Opposite.unop xβ βΆ o s) Γ A sβ’ ((ConcreteCategory.hom (βΎfun x β¦ β¨x.fst, ((π xβ).unop β« x.snd.1, x.snd.2)β©)).toFun x).snd β
((ConcreteCategory.hom (π ((s : S) Γ (Opposite.unop xβ βΆ o s) Γ A s))).toFun x).snd
C:Typeinstβ:SmallCategory CS:Typeo:S β CA:S β Typexβ:Cα΅α΅x:(s : S) Γ (Opposite.unop xβ βΆ o s) Γ A sβ’ ((ConcreteCategory.hom (βΎfun x β¦ β¨x.fst, ((π xβ).unop β« x.snd.1, x.snd.2)β©)).toFun x).fst =
((ConcreteCategory.hom (π ((s : S) Γ (Opposite.unop xβ βΆ o s) Γ A s))).toFun x).fst All goals completed! π
C:Typeinstβ:SmallCategory CS:Typeo:S β CA:S β Typexβ:Cα΅α΅x:(s : S) Γ (Opposite.unop xβ βΆ o s) Γ A sβ’ ((ConcreteCategory.hom (βΎfun x β¦ β¨x.fst, ((π xβ).unop β« x.snd.1, x.snd.2)β©)).toFun x).snd β
((ConcreteCategory.hom (π ((s : S) Γ (Opposite.unop xβ βΆ o s) Γ A s))).toFun x).snd All goals completed! π
map_comp _ _ := C:Typeinstβ:SmallCategory CS:Typeo:S β CA:S β TypeXβ:Cα΅α΅Yβ:Cα΅α΅Zβ:Cα΅α΅xβΒΉ:Xβ βΆ Yβxβ:Yβ βΆ Zββ’ (βΎfun x β¦ β¨x.fst, ((xβΒΉ β« xβ).unop β« x.snd.1, x.snd.2)β©) =
(βΎfun x β¦ β¨x.fst, (xβΒΉ.unop β« x.snd.1, x.snd.2)β©) β« βΎfun x β¦ β¨x.fst, (xβ.unop β« x.snd.1, x.snd.2)β©
C:Typeinstβ:SmallCategory CS:Typeo:S β CA:S β TypeXβ:Cα΅α΅Yβ:Cα΅α΅Zβ:Cα΅α΅xβΒΉ:Xβ βΆ Yβxβ:Yβ βΆ Zβx:(s : S) Γ (Opposite.unop Xβ βΆ o s) Γ A sβ’ ((ConcreteCategory.hom (βΎfun x β¦ β¨x.fst, ((xβΒΉ β« xβ).unop β« x.snd.1, x.snd.2)β©)).toFun x).fst =
((ConcreteCategory.hom
((βΎfun x β¦ β¨x.fst, (xβΒΉ.unop β« x.snd.1, x.snd.2)β©) β« βΎfun x β¦ β¨x.fst, (xβ.unop β« x.snd.1, x.snd.2)β©)).toFun
x).fstC:Typeinstβ:SmallCategory CS:Typeo:S β CA:S β TypeXβ:Cα΅α΅Yβ:Cα΅α΅Zβ:Cα΅α΅xβΒΉ:Xβ βΆ Yβxβ:Yβ βΆ Zβx:(s : S) Γ (Opposite.unop Xβ βΆ o s) Γ A sβ’ ((ConcreteCategory.hom (βΎfun x β¦ β¨x.fst, ((xβΒΉ β« xβ).unop β« x.snd.1, x.snd.2)β©)).toFun x).snd β
((ConcreteCategory.hom
((βΎfun x β¦ β¨x.fst, (xβΒΉ.unop β« x.snd.1, x.snd.2)β©) β« βΎfun x β¦ β¨x.fst, (xβ.unop β« x.snd.1, x.snd.2)β©)).toFun
x).snd
C:Typeinstβ:SmallCategory CS:Typeo:S β CA:S β TypeXβ:Cα΅α΅Yβ:Cα΅α΅Zβ:Cα΅α΅xβΒΉ:Xβ βΆ Yβxβ:Yβ βΆ Zβx:(s : S) Γ (Opposite.unop Xβ βΆ o s) Γ A sβ’ ((ConcreteCategory.hom (βΎfun x β¦ β¨x.fst, ((xβΒΉ β« xβ).unop β« x.snd.1, x.snd.2)β©)).toFun x).fst =
((ConcreteCategory.hom
((βΎfun x β¦ β¨x.fst, (xβΒΉ.unop β« x.snd.1, x.snd.2)β©) β« βΎfun x β¦ β¨x.fst, (xβ.unop β« x.snd.1, x.snd.2)β©)).toFun
x).fst All goals completed! π
C:Typeinstβ:SmallCategory CS:Typeo:S β CA:S β TypeXβ:Cα΅α΅Yβ:Cα΅α΅Zβ:Cα΅α΅xβΒΉ:Xβ βΆ Yβxβ:Yβ βΆ Zβx:(s : S) Γ (Opposite.unop Xβ βΆ o s) Γ A sβ’ ((ConcreteCategory.hom (βΎfun x β¦ β¨x.fst, ((xβΒΉ β« xβ).unop β« x.snd.1, x.snd.2)β©)).toFun x).snd β
((ConcreteCategory.hom
((βΎfun x β¦ β¨x.fst, (xβΒΉ.unop β« x.snd.1, x.snd.2)β©) β« βΎfun x β¦ β¨x.fst, (xβ.unop β« x.snd.1, x.snd.2)β©)).toFun
x).snd All goals completed! πThe p.r.a. formula's value is a family presheaf: the codes are the shapes paired with their arity homs, and the decoding is read off the shape alone.
This is why the multiplicity of arity homs is no obstruction to restricting to
Fam(C): it is absorbed into the code type, the coproduct completion being
closed under set-indexed coproducts. It is also why restricting does not recover
an inductive-recursive interpretation β the decoding o s does not mention the
arity hom, so it does not depend on the codes the shape binds.
theorem isFamPsh_praPsh (S : Type) (o : S β C) (A : S β Type) :
IsFamPsh (praPsh S o A) :=
β¨Ξ£ s : S, A s, fun p β¦ o p.1,
fun _ β¦
{ toFun := fun x β¦ β¨β¨x.1, x.2.2β©, x.2.1β©
invFun := fun y β¦ β¨y.1.1, y.2, y.1.2β©
left_inv := fun _ β¦ rfl
right_inv := fun _ β¦ rfl },
fun _ _ _ _ β¦ rflβ©The terminal presheaf
Tβ = T(1), so a functor restricts only if the terminal presheaf's image does.
Whether the terminal presheaf is itself a family presheaf is a property of the
base.
The terminal presheaf.
def topPsh (C : Type) [SmallCategory C] : Cα΅α΅ β₯€ Type where
obj _ := PUnit
map _ := βΎ fun _ β¦ PUnit.unit
map_id _ := rfl
map_comp _ _ := rflOver a base with a terminal object, the terminal presheaf is the representable it represents, hence a family presheaf.
theorem isFamPsh_topPsh_of_terminal (t : C) (h : β c : C, Unique (c βΆ t)) :
IsFamPsh (topPsh C) :=
β¨PUnit, fun _ β¦ t,
fun c β¦
{ toFun := fun _ β¦ β¨PUnit.unit, (h c.unop).defaultβ©
invFun := fun _ β¦ PUnit.unit
left_inv := fun _ β¦ rfl
right_inv := fun y β¦ Sigma.ext rfl (heq_of_eq ((h c.unop).uniq y.2).symm) },
fun _ _ _ _ β¦ Sigma.ext rfl (heq_of_eq ((h _).uniq _).symm)β©A base where it fails
The walking parallel pair has no terminal object: zero is not terminal because
nothing maps from one to it, and one is not because two morphisms map into it
from zero.
Nothing maps from one to zero.
theorem isEmpty_one_to_zero :
IsEmpty (WalkingParallelPair.one βΆ WalkingParallelPair.zero) :=
β¨fun f β¦ f:WalkingParallelPair.one βΆ WalkingParallelPair.zeroβ’ False All goals completed! πβ©The two parallel morphisms are distinct.
theorem left_ne_right :
(WalkingParallelPairHom.left : WalkingParallelPair.zero βΆ WalkingParallelPair.one)
β WalkingParallelPairHom.right := β’ WalkingParallelPairHom.left β WalkingParallelPairHom.right
h:WalkingParallelPairHom.left = WalkingParallelPairHom.rightβ’ False
exact absurd h (h:WalkingParallelPairHom.left = WalkingParallelPairHom.rightβ’ Β¬WalkingParallelPairHom.left = WalkingParallelPairHom.right All goals completed! π)
Over the walking parallel pair the terminal presheaf is not a family
presheaf. A code would have to decode to one, since nothing maps from one to
zero; but then the two parallel morphisms give two elements over zero, where
a family presheaf isomorphic to the terminal one has exactly one.
theorem not_isFamPsh_topPsh : Β¬ IsFamPsh (topPsh WalkingParallelPair) := β’ Β¬IsFamPsh (topPsh WalkingParallelPair)
U:Typed:U β WalkingParallelPaire:(c : WalkingParallelPairα΅α΅) β (topPsh WalkingParallelPair).obj c β (famPsh U d).obj cβ’ False
U:Typed:U β WalkingParallelPaire:(c : WalkingParallelPairα΅α΅) β (topPsh WalkingParallelPair).obj c β (famPsh U d).obj cu:Uf:Opposite.unop (Opposite.op WalkingParallelPair.one) βΆ d uβ’ False
U:Typed:U β WalkingParallelPaire:(c : WalkingParallelPairα΅α΅) β (topPsh WalkingParallelPair).obj c β (famPsh U d).obj cu:Uf:Opposite.unop (Opposite.op WalkingParallelPair.one) βΆ d ukey:β (g h : WalkingParallelPair.zero βΆ d u), g = hβ’ False
generalize hdu : d u = X at f key U:Typed:U β WalkingParallelPaire:(c : WalkingParallelPairα΅α΅) β (topPsh WalkingParallelPair).obj c β (famPsh U d).obj cu:UX:WalkingParallelPairhdu:d u = Xf:Opposite.unop (Opposite.op WalkingParallelPair.one) βΆ Xkey:β (g h : WalkingParallelPair.zero βΆ X), g = hβ’ False
cases f id U:Typed:U β WalkingParallelPaire:(c : WalkingParallelPairα΅α΅) β (topPsh WalkingParallelPair).obj c β (famPsh U d).obj cu:Uhdu:d u = Opposite.unop (Opposite.op WalkingParallelPair.one)key:β (g h : WalkingParallelPair.zero βΆ Opposite.unop (Opposite.op WalkingParallelPair.one)), g = hβ’ False
exact left_ne_right (key _ _) All goals completed! πUniversal elements
A family presheaf's category of elements is a coproduct of slices, and a code is recovered as the terminal object of its component: the element carrying the identity β the universal element of that representable summand, in the sense of the Yoneda correspondence, and Lawvere's generic figure.
The word "generic" is avoided here. In the parametric-right-adjoint literature
this repository cites ([Weber2007], [nLabParametricRightAdjoint]) a morphism
f : B βΆ T A is T-generic when every commuting square over it has a unique
T-fill, and T is a parametric right adjoint exactly when every map into a
T-value factors as a generic followed by a T-image. Under that factorization
it is the coercion that is the generic part and the universal element that is
the trivially-factoring one, so calling the latter generic would invert the
established usage in the one setting where it is in play.
The universal element is what an inductive-recursive constraint on a direction
would ask for β asking for it says d u = i on the nose, where asking for an
arbitrary element says only i βΆ d u.
The constraint cannot be imposed while keeping every morphism of families,
because universality is not stable: a morphism sends the universal element of u to
its own decoding map, which is universal only when that map is a transport.
isUniversalElement_famMorApp is the stability on the morphisms that do preserve it β
the split cartesian fragment, which is Dybjer and Setzer's setting.
IsSplitCoercion weakens the constraint from "the coercion is a transport" to
"the coercion is a split epimorphism", and isSplitCoercion_famMorApp is the
corresponding stability: it holds on the morphisms whose decoding maps are split
epimorphisms. So there is a constraint strictly weaker than universality that
survives non-invertible morphisms, which is the setting
Geb/Prototypes/UniverseVariance/ shows both type formers act over.
The universal element of a code's component: the code with the identity.
def universalElement (U : Type) (d : U β C) (u : U) : (famPsh U d).obj β¨d uβ© :=
β¨u, π (d u)β©An element is universal when its coercion is a transport: the object it lies over is the code's decoding, on the nose.
def IsUniversalElement {U : Type} {d : U β C} {c : Cα΅α΅} (x : (famPsh U d).obj c) : Prop :=
β h : c.unop = d x.1, x.2 = eqToHom hA morphism of families: a map of codes and, for each code, a morphism of decodings.
The map of codes.
The comparison of decodings.
structure FamMor (U : Type) (d : U β C) (U' : Type) (d' : U' β C) where code : U β U' dec : β u, d u βΆ d' (code u)The action of a morphism of families on the family presheaves.
def famMorApp {U : Type} {d : U β C} {U' : Type} {d' : U' β C}
(m : FamMor U d U' d') {c : Cα΅α΅} (x : (famPsh U d).obj c) : (famPsh U' d').obj c :=
β¨m.code x.1, x.2 β« m.dec x.1β©The action is natural.
theorem famMorApp_natural {U : Type} {d : U β C} {U' : Type} {d' : U' β C}
(m : FamMor U d U' d') β¦c c' : Cα΅α΅β¦ (f : c βΆ c') (x : (famPsh U d).obj c) :
famMorApp m ((famPsh U d).map f x) = (famPsh U' d').map f (famMorApp m x) :=
congrArg (Sigma.mk (m.code x.1)) (Category.assoc _ _ _)
A morphism preserves universal elements when every decoding comparison is a
transport. These are the split cartesian morphisms, and Dybjer and Setzer's
Fam |C| is the fragment they span.
def PreservesUniversalElement {U : Type} {d : U β C} {U' : Type} {d' : U' β C}
(m : FamMor U d U' d') : Prop :=
β u, β h : d u = d' (m.code u), m.dec u = eqToHom hGenericity is stable under the morphisms that preserve it.
theorem isUniversalElement_famMorApp {U : Type} {d : U β C} {U' : Type} {d' : U' β C}
{m : FamMor U d U' d'} (hm : PreservesUniversalElement m) {c : Cα΅α΅}
{x : (famPsh U d).obj c} (hx : IsUniversalElement x) : IsUniversalElement (famMorApp m x) := by C:Typeinstβ:SmallCategory CU:Typed:U β CU':Typed':U' β Cm:FamMor U d U' d'hm:PreservesUniversalElement mc:Cα΅α΅x:(famPsh U d).obj chx:IsUniversalElement xβ’ IsUniversalElement (famMorApp m x)
obtain β¨hβ, hxββ© := hx C:Typeinstβ:SmallCategory CU:Typed:U β CU':Typed':U' β Cm:FamMor U d U' d'hm:PreservesUniversalElement mc:Cα΅α΅x:(famPsh U d).obj chβ:Opposite.unop c = d x.fsthxβ:x.snd = eqToHom hββ’ IsUniversalElement (famMorApp m x)
obtain β¨hβ, hmββ© := hm x.1 C:Typeinstβ:SmallCategory CU:Typed:U β CU':Typed':U' β Cm:FamMor U d U' d'hm:PreservesUniversalElement mc:Cα΅α΅x:(famPsh U d).obj chβ:Opposite.unop c = d x.fsthxβ:x.snd = eqToHom hβhβ:d x.fst = d' (m.code x.fst)hmβ:m.dec x.fst = eqToHom hββ’ IsUniversalElement (famMorApp m x)
refine β¨hβ.trans hβ, ?_β© C:Typeinstβ:SmallCategory CU:Typed:U β CU':Typed':U' β Cm:FamMor U d U' d'hm:PreservesUniversalElement mc:Cα΅α΅x:(famPsh U d).obj chβ:Opposite.unop c = d x.fsthxβ:x.snd = eqToHom hβhβ:d x.fst = d' (m.code x.fst)hmβ:m.dec x.fst = eqToHom hββ’ (famMorApp m x).snd = eqToHom β―
change x.2 β« m.dec x.1 = _ C:Typeinstβ:SmallCategory CU:Typed:U β CU':Typed':U' β Cm:FamMor U d U' d'hm:PreservesUniversalElement mc:Cα΅α΅x:(famPsh U d).obj chβ:Opposite.unop c = d x.fsthxβ:x.snd = eqToHom hβhβ:d x.fst = d' (m.code x.fst)hmβ:m.dec x.fst = eqToHom hββ’ x.snd β« m.dec x.fst = eqToHom β―
rw [hxβ, C:Typeinstβ:SmallCategory CU:Typed:U β CU':Typed':U' β Cm:FamMor U d U' d'hm:PreservesUniversalElement mc:Cα΅α΅x:(famPsh U d).obj chβ:Opposite.unop c = d x.fsthxβ:x.snd = eqToHom hβhβ:d x.fst = d' (m.code x.fst)hmβ:m.dec x.fst = eqToHom hββ’ eqToHom hβ β« m.dec x.fst = eqToHom β― hmβ, C:Typeinstβ:SmallCategory CU:Typed:U β CU':Typed':U' β Cm:FamMor U d U' d'hm:PreservesUniversalElement mc:Cα΅α΅x:(famPsh U d).obj chβ:Opposite.unop c = d x.fsthxβ:x.snd = eqToHom hβhβ:d x.fst = d' (m.code x.fst)hmβ:m.dec x.fst = eqToHom hββ’ eqToHom hβ β« eqToHom hβ = eqToHom β― eqToHom_trans C:Typeinstβ:SmallCategory CU:Typed:U β CU':Typed':U' β Cm:FamMor U d U' d'hm:PreservesUniversalElement mc:Cα΅α΅x:(famPsh U d).obj chβ:Opposite.unop c = d x.fsthxβ:x.snd = eqToHom hβhβ:d x.fst = d' (m.code x.fst)hmβ:m.dec x.fst = eqToHom hββ’ eqToHom β― = eqToHom β―] C:Typeinstβ:SmallCategory CU:Typed:U β CU':Typed':U' β Cm:FamMor U d U' d'hm:PreservesUniversalElement mc:Cα΅α΅x:(famPsh U d).obj chβ:Opposite.unop c = d x.fsthxβ:x.snd = eqToHom hβhβ:d x.fst = d' (m.code x.fst)hmβ:m.dec x.fst = eqToHom hββ’ eqToHom β― = eqToHom β―
rfl All goals completed! πThe weakened constraint: the coercion is a split epimorphism.
def IsSplitCoercion {U : Type} {d : U β C} {c : Cα΅α΅} (x : (famPsh U d).obj c) : Prop :=
β s : d x.1 βΆ c.unop, s β« x.2 = π (d x.1)A universal element satisfies the weakened constraint, so it is a genuine weakening.
theorem isSplitCoercion_of_isUniversalElement {U : Type} {d : U β C} {c : Cα΅α΅}
{x : (famPsh U d).obj c} (hx : IsUniversalElement x) : IsSplitCoercion x := by C:Typeinstβ:SmallCategory CU:Typed:U β Cc:Cα΅α΅x:(famPsh U d).obj chx:IsUniversalElement xβ’ IsSplitCoercion x
obtain β¨h, hxββ© := hx C:Typeinstβ:SmallCategory CU:Typed:U β Cc:Cα΅α΅x:(famPsh U d).obj ch:Opposite.unop c = d x.fsthxβ:x.snd = eqToHom hβ’ IsSplitCoercion x
refine β¨eqToHom h.symm, ?_β© C:Typeinstβ:SmallCategory CU:Typed:U β Cc:Cα΅α΅x:(famPsh U d).obj ch:Opposite.unop c = d x.fsthxβ:x.snd = eqToHom hβ’ eqToHom β― β« x.snd = π (d x.fst)
rw [hxβ, C:Typeinstβ:SmallCategory CU:Typed:U β Cc:Cα΅α΅x:(famPsh U d).obj ch:Opposite.unop c = d x.fsthxβ:x.snd = eqToHom hβ’ eqToHom β― β« eqToHom h = π (d x.fst) eqToHom_trans, C:Typeinstβ:SmallCategory CU:Typed:U β Cc:Cα΅α΅x:(famPsh U d).obj ch:Opposite.unop c = d x.fsthxβ:x.snd = eqToHom hβ’ eqToHom β― = π (d x.fst) eqToHom_refl C:Typeinstβ:SmallCategory CU:Typed:U β Cc:Cα΅α΅x:(famPsh U d).obj ch:Opposite.unop c = d x.fsthxβ:x.snd = eqToHom hβ’ π (d x.fst) = π (d x.fst)] All goals completed! πA morphism whose decoding comparisons are split epimorphisms.
def SplitDec {U : Type} {d : U β C} {U' : Type} {d' : U' β C}
(m : FamMor U d U' d') : Prop :=
β u, β t : d' (m.code u) βΆ d u, t β« m.dec u = π (d' (m.code u))The weakened constraint is stable under those morphisms: a constraint strictly weaker than universality survives morphisms that are not transports, and need not be invertible.
theorem isSplitCoercion_famMorApp {U : Type} {d : U β C} {U' : Type} {d' : U' β C}
{m : FamMor U d U' d'} (hm : SplitDec m) {c : Cα΅α΅}
{x : (famPsh U d).obj c} (hx : IsSplitCoercion x) :
IsSplitCoercion (famMorApp m x) := by C:Typeinstβ:SmallCategory CU:Typed:U β CU':Typed':U' β Cm:FamMor U d U' d'hm:SplitDec mc:Cα΅α΅x:(famPsh U d).obj chx:IsSplitCoercion xβ’ IsSplitCoercion (famMorApp m x)
obtain β¨s, hsβ© := hx C:Typeinstβ:SmallCategory CU:Typed:U β CU':Typed':U' β Cm:FamMor U d U' d'hm:SplitDec mc:Cα΅α΅x:(famPsh U d).obj cs:d x.fst βΆ Opposite.unop chs:s β« x.snd = π (d x.fst)β’ IsSplitCoercion (famMorApp m x)
obtain β¨t, htβ© := hm x.1 C:Typeinstβ:SmallCategory CU:Typed:U β CU':Typed':U' β Cm:FamMor U d U' d'hm:SplitDec mc:Cα΅α΅x:(famPsh U d).obj cs:d x.fst βΆ Opposite.unop chs:s β« x.snd = π (d x.fst)t:d' (m.code x.fst) βΆ d x.fstht:t β« m.dec x.fst = π (d' (m.code x.fst))β’ IsSplitCoercion (famMorApp m x)
refine β¨t β« s, ?_β© C:Typeinstβ:SmallCategory CU:Typed:U β CU':Typed':U' β Cm:FamMor U d U' d'hm:SplitDec mc:Cα΅α΅x:(famPsh U d).obj cs:d x.fst βΆ Opposite.unop chs:s β« x.snd = π (d x.fst)t:d' (m.code x.fst) βΆ d x.fstht:t β« m.dec x.fst = π (d' (m.code x.fst))β’ (t β« s) β« (famMorApp m x).snd = π (d' (famMorApp m x).fst)
change (t β« s) β« x.2 β« m.dec x.1 = _ C:Typeinstβ:SmallCategory CU:Typed:U β CU':Typed':U' β Cm:FamMor U d U' d'hm:SplitDec mc:Cα΅α΅x:(famPsh U d).obj cs:d x.fst βΆ Opposite.unop chs:s β« x.snd = π (d x.fst)t:d' (m.code x.fst) βΆ d x.fstht:t β« m.dec x.fst = π (d' (m.code x.fst))β’ (t β« s) β« x.snd β« m.dec x.fst = π (d' (famMorApp m x).fst)
rw [β Category.assoc, C:Typeinstβ:SmallCategory CU:Typed:U β CU':Typed':U' β Cm:FamMor U d U' d'hm:SplitDec mc:Cα΅α΅x:(famPsh U d).obj cs:d x.fst βΆ Opposite.unop chs:s β« x.snd = π (d x.fst)t:d' (m.code x.fst) βΆ d x.fstht:t β« m.dec x.fst = π (d' (m.code x.fst))β’ ((t β« s) β« x.snd) β« m.dec x.fst = π (d' (famMorApp m x).fst) Category.assoc t s x.2, C:Typeinstβ:SmallCategory CU:Typed:U β CU':Typed':U' β Cm:FamMor U d U' d'hm:SplitDec mc:Cα΅α΅x:(famPsh U d).obj cs:d x.fst βΆ Opposite.unop chs:s β« x.snd = π (d x.fst)t:d' (m.code x.fst) βΆ d x.fstht:t β« m.dec x.fst = π (d' (m.code x.fst))β’ (t β« s β« x.snd) β« m.dec x.fst = π (d' (famMorApp m x).fst) hs, C:Typeinstβ:SmallCategory CU:Typed:U β CU':Typed':U' β Cm:FamMor U d U' d'hm:SplitDec mc:Cα΅α΅x:(famPsh U d).obj cs:d x.fst βΆ Opposite.unop chs:s β« x.snd = π (d x.fst)t:d' (m.code x.fst) βΆ d x.fstht:t β« m.dec x.fst = π (d' (m.code x.fst))β’ (t β« π (d x.fst)) β« m.dec x.fst = π (d' (famMorApp m x).fst) Category.comp_id, C:Typeinstβ:SmallCategory CU:Typed:U β CU':Typed':U' β Cm:FamMor U d U' d'hm:SplitDec mc:Cα΅α΅x:(famPsh U d).obj cs:d x.fst βΆ Opposite.unop chs:s β« x.snd = π (d x.fst)t:d' (m.code x.fst) βΆ d x.fstht:t β« m.dec x.fst = π (d' (m.code x.fst))β’ t β« m.dec x.fst = π (d' (famMorApp m x).fst) ht C:Typeinstβ:SmallCategory CU:Typed:U β CU':Typed':U' β Cm:FamMor U d U' d'hm:SplitDec mc:Cα΅α΅x:(famPsh U d).obj cs:d x.fst βΆ Opposite.unop chs:s β« x.snd = π (d x.fst)t:d' (m.code x.fst) βΆ d x.fstht:t β« m.dec x.fst = π (d' (m.code x.fst))β’ π (d' (m.code x.fst)) = π (d' (famMorApp m x).fst)] C:Typeinstβ:SmallCategory CU:Typed:U β CU':Typed':U' β Cm:FamMor U d U' d'hm:SplitDec mc:Cα΅α΅x:(famPsh U d).obj cs:d x.fst βΆ Opposite.unop chs:s β« x.snd = π (d x.fst)t:d' (m.code x.fst) βΆ d x.fstht:t β« m.dec x.fst = π (d' (m.code x.fst))β’ π (d' (m.code x.fst)) = π (d' (famMorApp m x).fst)
rfl All goals completed! πend GebProto.FamBoundary