W-types of presheaf polynomial functors: hereditary naturality (constructive core)
For a presheaf polynomial endofunctor F : PresheafPFunctor I I, the W-type of
the underlying slice endofunctor F.toSlicePFunctor : SlicePFunctor I I carries
a tree-level naturality predicate. A slice W-tree assembles a shape with a
compatible family of child subtrees; the presheaf structure additionally acts on
directions contravariantly (directionRestr) and on the assignment of shapes to
output indices. A tree is hereditarily natural when, at every node, restricting a
child subtree along a morphism agrees with selecting the child at the reindexed
direction, hereditarily through the whole tree.
wRestrTree is the root-only restriction of a slice W-tree along a morphism: it
restricts the root shape and reindexes the direction-assignment via the
generalized PresheafPFunctor.objRestrElt, conjugated by the slice destructor
and constructor. IsHereditarilyNatural folds the local naturality equation
over the whole tree through the slice W-type's Prop-valued paramorphism
SlicePFunctor.W.RecProp; isHereditarilyNatural_mk is its one-level
computation rule.
Main definitions
PresheafPFunctor.wRestrTree — the root-only restriction of a slice W-tree
along a morphism, via the generalized objRestrElt at p := wIndex.
PresheafPFunctor.IsHereditarilyNatural — the tree-level naturality predicate
on slice W-trees, defined by SlicePFunctor.W.RecProp.
PresheafPFunctor.wRestr — restriction on the ULifted carrier fiber,
reindexing the underlying tree along a morphism while preserving the index and
hereditary naturality.
PresheafPFunctor.W — the carrier presheaf Iᵒᵖ ⥤ Type (max uI uA uB), whose
fiber over j is the ULift of the hereditarily-natural slice W-trees indexed
at j and whose restriction maps are wRestr.
PresheafPFunctor.W.forgetNode / PresheafPFunctor.W.rememberNode — the
mutually inverse translations between a presheaf node over the carrier
presheaf F.W and the underlying slice node over wIndex together with the
hereditary naturality of its children.
PresheafPFunctor.W.mk / PresheafPFunctor.W.dest — the fixed-point
constructor and destructor: mutually inverse fiberwise maps between the
objPresheaf-value at F.W and F.W, exhibiting F.W as a fixed point of
the objPresheaf-action at F.W.
PresheafPFunctor.W.PElimData / pElimStep / pElimData — the eliminator's
fold carrier, algebra, and fold (a WType.elim fold whose value is guarded by
hereditary naturality, since the presheaf algebra acts only on natural nodes):
the presheaf analogue of the slice ElimData machinery.
PresheafPFunctor.W.elimVal — the eliminator's value on a carrier element,
extracted from the fold given the tree's hereditary naturality.
PresheafPFunctor.W.elim — the eliminator into any presheaf algebra (Y, α),
a natural transformation F.W ⟶ Y.
PresheafPFunctor.MemW — membership of a raw W-tree in the carrier presheaf's
fiber over an index, stated on F.toPFunctor.W so that it can be decided by a
fold.
Main statements
PresheafPFunctor.isHereditarilyNatural_mk — the one-level unfolding of
IsHereditarilyNatural on a constructor SlicePFunctor.W.mk x: local
naturality at the root, together with hereditary naturality of every child.
PresheafPFunctor.wIndex_wRestrTree — the index of a root-restricted tree is
the restriction morphism's source.
PresheafPFunctor.isHereditarilyNatural_wRestrTree — hereditary naturality is
preserved by the root-only restriction, a one-level argument.
PresheafPFunctor.wRestrTree_id / PresheafPFunctor.wRestrTree_comp — the
functoriality of wRestrTree, from which W's functor laws transport.
PresheafPFunctor.W.dest_mk / PresheafPFunctor.W.mk_dest — mk and dest
are mutually inverse, so F.W is a fixed point of the objPresheaf-action at
F.W.
PresheafPFunctor.W.isHereditarilyNatural_mk_forgetNode — hereditary
naturality of the slice tree built from a presheaf node over F.W is exactly
the node's IsNatural datum; the correspondence underlying mk / dest and
the eliminator fold.
PresheafPFunctor.W.comp_elim — elim is a morphism of presheaves (its
NatTrans naturality), from elimVal_wRestr.
PresheafPFunctor.W.elim_mk — the computation rule: elim commutes with mk,
i.e. it is a morphism of presheaf algebras.
PresheafPFunctor.memW_iff_exists_obj — MemW holds exactly of the trees
underlying the carrier presheaf's fiber.
Implementation notes
This is the presheaf endofunctor case, I = J, so the slice endofunctor
F.toSlicePFunctor : SlicePFunctor I I has a W-type. wRestrTree and
IsHereditarilyNatural act on the un-lifted trees F.toSlicePFunctor.W of type
Type (max uA uB); the carrier presheaf WULifts the indexed subtype into
Type (max uI uA uB) so its fibers land in a single universe with the index
category I.
The recursion in IsHereditarilyNatural is confined to the slice W-type's
Prop-valued paramorphism SlicePFunctor.W.RecProp: no explicit self-recursion
and no induction tactic appear. The child-index witness required by
wRestrTree is discharged from the compatibility of the node's
direction-assignment (SliceDomPFunctor.compatible_iff) together with the
direction's fiber constraint, exactly as PresheafDomPFunctorData.value obtains
its index equality.
The eliminator elim folds the underlying slice tree into a target value with a
bespoke WType.elim fold (pElimData, carrier PElimData, algebra
pElimStep), the presheaf analogue of the slice elim's ElimData fold. The
presheaf algebra α acts only on natural nodes, so — unlike the slice elim,
whose algebra is total — the fold's value is a function of the subtree's
hereditary naturality, and the fold carries a naturality proxy (via the guard
P ∧ ∀ hp : P, Q hp, the standard And with Q proof-irrelevant in hp) letting
α apply at each node. The value fold is
a non-dependent WType.elim (code-generatable); the recursion in the
accompanying proofs (pElimData_valid, elimVal_wRestr) stays inside
WType.rec / SlicePFunctor.W.induction. Only the existence half of the
initial-algebra universal property is established — the carrier, its fixed-point
structure, and elim with its computation rule elim_mk and naturality law
comp_elim; uniqueness of elim is not formalized.
The root-only restriction of a slice W-tree z along a morphism g : j' ⟶ j
(where j is the index of z): restrict the root shape and reindex its
direction-assignment via the generalized objRestrElt at the projection
p := F.toSlicePFunctor.wIndex, conjugating by the slice destructor and
constructor. The head-index witness required by objRestrElt is the hypothesis
hq, the root's q-output index being read from PFunctor.W.head.
@[`@[expose]` has no effect outside a `module` fileexpose]defwRestrTree{I:TypeuI}[Category.{vI}I](F:PresheafPFunctor.{uI,uI,uA,uB,vI,vI}II)⦃jj':I⦄(g:j'⟶j)(z:F.toSlicePFunctor.W)(hq:F.q(PFunctor.W.headz.1)=j):F.toSlicePFunctor.W:=SlicePFunctor.W.mk(F.objRestrEltg(SlicePFunctor.W.destz)(I:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIj:Ij':Ig:j'⟶jz:F.toSlicePFunctor.Whq:F.q(↑z).head=j⊢ F.q(↑z.dest).fst=jI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIj:Ij':Ig:j'⟶jw:F.toSlicePFunctor.Whw:F.toSlicePFunctor.WValidwhq:F.q(↑⟨w,hw⟩).head=j⊢ F.q(↑(SlicePFunctor.W.dest⟨w,hw⟩)).fst=j;caseswwithI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIj:Ij':Ig:j'⟶ja:F.toSlicePFunctor.Af:F.toSlicePFunctor.Ba→WTypeF.toSlicePFunctor.Bhw:F.toSlicePFunctor.WValid(WType.mkaf)hq:F.q(↑⟨WType.mkaf,hw⟩).head=j⊢ F.q(↑(SlicePFunctor.W.dest⟨WType.mkaf,hw⟩)).fst=jAll goals completed! 🐙))
Hereditary naturality of a slice W-tree: at every node, restricting a child
subtree along a morphism g agrees with selecting the child at the reindexed
direction, hereditarily. The local conjunct is the tree analogue of
PresheafDomPFunctorData.IsNatural; the fold over the tree is carried by the
slice W-type's Prop-valued paramorphism SlicePFunctor.W.RecProp.
@[`@[expose]` has no effect outside a `module` fileexpose]defIsHereditarilyNatural{I:TypeuI}[Category.{vI}I](F:PresheafPFunctor.{uI,uI,uA,uB,vI,vI}II):F.toSlicePFunctor.W→Prop:=SlicePFunctor.W.RecProp(funxih↦(∀⦃ii':I⦄(g:i'⟶i)(b:F.toSliceDomPFunctor.Directionx.1.1i),x.1.2(F.directionRestrx.1.1gb).1=F.wRestrTreeg(x.1.2b.1)(((F.toSliceDomPFunctor.compatible_iffF.toSlicePFunctor.wIndexx.1.1x.1.2).mpx.2b.1).transb.2))∧∀b,ihb)
One-level unfolding of IsHereditarilyNatural on a constructor
SlicePFunctor.W.mk x: local naturality at the root together with hereditary
naturality of every child subtree. From SlicePFunctor.W.recProp_mk.
The child a root-restricted node assigns to a direction is the child the
original node assigns to the direction's reindex. The analogue of
value_objRestrElt for the raw child assignment; rfl after destructuring the
direction, matching objRestrElt's internal ⟨·, rfl⟩ reconstruction.
Hereditary naturality is preserved by the root-only restriction: the
children of wRestrTree g z are the original subtrees reindexed (each already
hereditarily natural), and its root's local naturality follows from z's own
root local naturality and reindex_naturality. A one-level argument, not a
recursion.
Restriction on the ULifted carrier fiber: apply wRestrTree to the
underlying tree of w along g, re-establishing the index (j', read from the
restricted root shape via shapeRestr) and hereditary naturality (preserved by
wRestrTree, a one-level consequence of isHereditarilyNatural_mk and
reindex_naturality).
The carrier presheaf W : Iᵒᵖ ⥤ Type of the presheaf polynomial endofunctor
F: its fiber over j is the ULift of the hereditarily-natural slice W-trees
indexed at j, and its restriction maps are wRestr. The functor laws transport
from objRestrElt_id / objRestrElt_comp through wRestrTree, ULift, and
Subtype.
@[`@[expose]` has no effect outside a `module` fileexpose]defW{I:TypeuI}[Category.{vI}I](F:PresheafPFunctor.{uI,uI,uA,uB,vI,vI}II):Iᵒᵖ⥤Type(maxuIuAuB)whereobjj:=ULift.{uI}{w:F.toSlicePFunctor.W//F.toSlicePFunctor.wIndexw=j.unop∧F.IsHereditarilyNaturalw}mapg:=↾(F.wRestrg.unop)map_idj:=byI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIj:Iᵒᵖ⊢ ↾F.wRestr(𝟙j).unop=𝟙(ULift.{uI, max uA uB}{w//F.toSlicePFunctor.wIndexw=Opposite.unopj∧F.IsHereditarilyNaturalw})extwI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIj:Iᵒᵖw:ULift.{uI, max uA uB}{w//F.toSlicePFunctor.wIndexw=Opposite.unopj∧F.IsHereditarilyNaturalw}⊢ ↑((ConcreteCategory.hom(↾F.wRestr(𝟙j).unop)).toFunw).down=↑((ConcreteCategory.hom(𝟙(ULift.{uI, max uA uB}{w//F.toSlicePFunctor.wIndexw=Opposite.unopj∧F.IsHereditarilyNaturalw}))).toFunw).downexactF.wRestrTree_idw.down.1w.down.2.1All goals completed! 🐙map_compgh:=byI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIX✝:IᵒᵖY✝:IᵒᵖZ✝:Iᵒᵖg:X✝⟶Y✝h:Y✝⟶Z✝⊢ ↾F.wRestr(g≫h).unop=↾F.wRestrg.unop≫↾F.wRestrh.unopextwI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIX✝:IᵒᵖY✝:IᵒᵖZ✝:Iᵒᵖg:X✝⟶Y✝h:Y✝⟶Z✝w:ULift.{uI, max uA uB}{w//F.toSlicePFunctor.wIndexw=Opposite.unopX✝∧F.IsHereditarilyNaturalw}⊢ ↑((ConcreteCategory.hom(↾F.wRestr(g≫h).unop)).toFunw).down=↑((ConcreteCategory.hom(↾F.wRestrg.unop≫↾F.wRestrh.unop)).toFunw).downexactF.wRestrTree_compg.unoph.unopw.down.1w.down.2.1(F.wIndex_wRestrTreeg.unopw.down.1w.down.2.1)All goals completed! 🐙
namespaceW
Casting a carrier fiber element along an index equality leaves its
underlying slice W-tree unchanged.
Rebuild a carrier fiber element from its underlying tree, its wIndex, and
its hereditary naturality: a total-space element over wIndex w.down.1 equal to
the original total-space element over i.
Forget a presheaf node over the carrier presheaf F.W to the underlying
slice node over wIndex: retain the shape, and send each direction to the
underlying slice W-tree of its carried fiber element.
Remember a slice node over wIndex whose children are hereditarily natural
as a presheaf node over the carrier presheaf F.W: retain the shape, and send
each direction to the carried fiber element built from the child tree, its index
wIndex, and its hereditary naturality.
The hereditary naturality of the slice tree built from a presheaf node over
F.W is exactly the naturality of the node: the recursive conjunct of
isHereditarilyNatural_mk is discharged by the carried hereditary naturality of
each child, and its local conjunct matches the node's IsNatural datum through
the underlying-tree correspondence.
The fixed-point constructor of the presheaf W-type: the objPresheaf-value
at the carrier presheaf F.W maps into F.W, fiberwise over I. It builds the
slice W-tree from the node (via forgetNode and the slice constructor
SlicePFunctor.W.mk), reads its index from the node's q-output index, and
supplies hereditary naturality via isHereditarilyNatural_mk_forgetNode.
The fixed-point destructor of the presheaf W-type, inverse to mk: the
underlying tree decomposes (via the slice destructor SlicePFunctor.W.dest) as
a shape with a family of hereditarily-natural subtrees, reassembled (via
rememberNode) into a natural node over F.W, and re-indexed at the root's
q-output index.
The carrier of the presheaf-W value fold: the slice WIndex (root index
and admissibility) together with a hereditary-naturality proxy H, a value
function producing a total-space element of Y once the subtree is admissible
and hereditarily natural, and a proof over that the value lies over the
index.
Hereditary naturality of the subtree, a fold-level proxy.
The subtree's contributed value, in the total space of Y, available once
the subtree is admissible and hereditarily natural.
The slice node over elemProj Y assembled from a shape a and the children
carriers' values: the direction assignment sends b to the child value
(c b).value, compatible with elemProj Y by the children's over and the
node's OverInput.
@[`@[expose]` has no effect outside a `module` fileexpose]defpNodeSlice{I:TypeuI}[Category.{vI}I]{F:PresheafPFunctor.{uI,uI,uA,uB,vI,vI}II}{Y:Iᵒᵖ⥤Type(maxuIuAuB)}{a:F.toPFunctor.A}(c:F.toPFunctor.Ba→PElimDataFY)(hv:F.toSlicePFunctor.NodeValida(funb↦(cb).toWIndex))(hc:∀b,(cb).H(hv.1b)):F.toSliceDomPFunctor.Obj(PresheafDomPFunctorData.elemProjY):=⟨⟨a,funb↦(cb).value(hv.1b)(hcb)⟩,(F.toSliceDomPFunctor.compatible_iff(PresheafDomPFunctorData.elemProjY)a_).mprfunb↦((cb).over(hv.1b)(hcb)).trans(congrFunhv.2b)⟩
The value-fold algebra step: index and admissibility as for wIndexStep; a
hereditary-naturality proxy H combining the children's proxies with the
naturality of the assembled node (pNodeSlice); and a value that applies the
presheaf algebra α to that node, packaged over the shape's q-output index.
@[`@[expose]` has no effect outside a `module` fileexpose]defpElimStep{I:TypeuI}[Category.{vI}I](F:PresheafPFunctor.{uI,uI,uA,uB,vI,vI}II)(Y:Iᵒᵖ⥤Type(maxuIuAuB))(α:NatTrans(F.objPresheafY)Y):F.toPFunctor.Obj(PElimDataFY)→PElimDataFY:=funx↦{index:=F.qx.1valid:=F.toSlicePFunctor.NodeValidx.1(funb↦(x.2b).toWIndex)H:=funhv↦(∀b,(x.2b).H(hv.1b))∧(∀hc:(∀b,(x.2b).H(hv.1b)),F.IsNatural(pNodeSlicex.2hvhc))value:=funhvhn↦⟨F.qx.1,α.app⟨F.qx.1⟩⟨⟨pNodeSlicex.2hvhn.1,hn.2hn.1⟩,rfl⟩⟩over:=fun__↦rfl}
The value fold: the F.toPFunctor-algebra morphism into
(PElimData F Y, pElimStep) given by WType.elim, a single non-dependent fold
with no explicit recursion.
@[`@[expose]` has no effect outside a `module` fileexpose]defpElimData{I:TypeuI}[Category.{vI}I](F:PresheafPFunctor.{uI,uI,uA,uB,vI,vI}II)(Y:Iᵒᵖ⥤Type(maxuIuAuB))(α:NatTrans(F.objPresheafY)Y):F.toPFunctor.W→PElimDataFY:=WType.elim(PElimDataFY)(pElimStepFYα)
The index-and-admissibility projection of pElimData agrees with the slice
fold wIndexValid: the value fold refines the slice fold, so admissibility and
the root index transport from the slice results. Proved by the dependent
recursor WType.rec.
Two fiber elements of objPresheaf Y over equal indices whose underlying
dom values are equal are heterogeneously equal.
privatetheoremobjPresheaf_obj_heq{I:TypeuI}[Category.{vI}I](F:PresheafPFunctor.{uI,uI,uA,uB,vI,vI}II)(Y:Iᵒᵖ⥤Type(maxuIuAuB)){kk':I}(hk:k=k'){u:(F.objPresheafY).obj⟨k⟩}{u':(F.objPresheafY).obj⟨k'⟩}(h:u.1=u'.1):u≍u':=byI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)k:Ik':Ihk:k=k'u:(F.objPresheafY).obj(Opposite.opk)u':(F.objPresheafY).obj(Opposite.opk')h:↑u=↑u'⊢ u≍u'caseshkreflI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)k:Iu:(F.objPresheafY).obj(Opposite.opk)u':(F.objPresheafY).obj(Opposite.opk)h:↑u=↑u'⊢ u≍u'exactheq_of_eq(Subtype.exth)All goals completed! 🐙
Value restriction coherence at the fold level: the fold value on the
root-restriction of a tree is the Y-restriction of the fold value. A one-level
argument: the restricted node's fold node is the objPresheaf-restriction of the
node, so α's naturality relates their α-images.
theoremvalue_wRestrTree{I:TypeuI}[Category.{vI}I](F:PresheafPFunctor.{uI,uI,uA,uB,vI,vI}II)(Y:Iᵒᵖ⥤Type(maxuIuAuB))(α:NatTrans(F.objPresheafY)Y)(t:F.toSlicePFunctor.W)⦃ii':I⦄(f:i'⟶i)(hqi:F.q(PFunctor.W.headt.1)=i)(hv:(pElimDataFYαt.1).valid)(hn:(pElimDataFYαt.1).Hhv)(hv':(pElimDataFYα(F.wRestrTreefthqi).1).valid)(hn':(pElimDataFYα(F.wRestrTreefthqi).1).Hhv'):(pElimDataFYα(F.wRestrTreefthqi).1).valuehv'hn'=⟨i',Y.mapf.op(cast(congrArg(funk:I↦Y.obj⟨k⟩)(((pElimDataFYαt.1).overhvhn).trans((pElimData_indexFYαt.1).transhqi)))((pElimDataFYαt.1).valuehvhn).2)⟩:=byI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yt:F.toSlicePFunctor.Wi:Ii':If:i'⟶ihqi:F.q(↑t).head=ihv:(pElimDataFYα↑t).validhn:(pElimDataFYα↑t).Hhvhv':(pElimDataFYα↑(F.wRestrTreefthqi)).validhn':(pElimDataFYα↑(F.wRestrTreefthqi)).Hhv'⊢ (pElimDataFYα↑(F.wRestrTreefthqi)).valuehv'hn'=⟨i',(ConcreteCategory.hom(Y.mapf.op))(cast⋯((pElimDataFYα↑t).valuehvhn).snd)⟩obtain⟨tree,hval⟩:=tI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yi:Ii':If:i'⟶itree:F.toSlicePFunctor.Whval:F.toSlicePFunctor.WValidtreehqi:F.q(↑⟨tree,hval⟩).head=ihv:(pElimDataFYα↑⟨tree,hval⟩).validhn:(pElimDataFYα↑⟨tree,hval⟩).Hhvhv':(pElimDataFYα↑(F.wRestrTreef⟨tree,hval⟩hqi)).validhn':(pElimDataFYα↑(F.wRestrTreef⟨tree,hval⟩hqi)).Hhv'⊢ (pElimDataFYα↑(F.wRestrTreef⟨tree,hval⟩hqi)).valuehv'hn'=⟨i',(ConcreteCategory.hom(Y.mapf.op))(cast⋯((pElimDataFYα↑⟨tree,hval⟩).valuehvhn).snd)⟩casestreewith|mkafchild=>mkI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yi:Ii':If:i'⟶ia:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.Ba→WTypeF.toSlicePFunctor.Bhval:F.toSlicePFunctor.WValid(WType.mkafchild)hqi:F.q(↑⟨WType.mkafchild,hval⟩).head=ihv:(pElimDataFYα↑⟨WType.mkafchild,hval⟩).validhn:(pElimDataFYα↑⟨WType.mkafchild,hval⟩).Hhvhv':(pElimDataFYα↑(F.wRestrTreef⟨WType.mkafchild,hval⟩hqi)).validhn':(pElimDataFYα↑(F.wRestrTreef⟨WType.mkafchild,hval⟩hqi)).Hhv'⊢ (pElimDataFYα↑(F.wRestrTreef⟨WType.mkafchild,hval⟩hqi)).valuehv'hn'=⟨i',(ConcreteCategory.hom(Y.mapf.op))(cast⋯((pElimDataFYα↑⟨WType.mkafchild,hval⟩).valuehvhn).snd)⟩refineSigma.ext(F.shapeRestrf⟨a,hqi⟩).2?_mkI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yi:Ii':If:i'⟶ia:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.Ba→WTypeF.toSlicePFunctor.Bhval:F.toSlicePFunctor.WValid(WType.mkafchild)hqi:F.q(↑⟨WType.mkafchild,hval⟩).head=ihv:(pElimDataFYα↑⟨WType.mkafchild,hval⟩).validhn:(pElimDataFYα↑⟨WType.mkafchild,hval⟩).Hhvhv':(pElimDataFYα↑(F.wRestrTreef⟨WType.mkafchild,hval⟩hqi)).validhn':(pElimDataFYα↑(F.wRestrTreef⟨WType.mkafchild,hval⟩hqi)).Hhv'⊢ ((pElimDataFYα↑(F.wRestrTreef⟨WType.mkafchild,hval⟩hqi)).valuehv'hn').snd≍⟨i',(ConcreteCategory.hom(Y.mapf.op))(cast⋯((pElimDataFYα↑⟨WType.mkafchild,hval⟩).valuehvhn).snd)⟩.sndhavehqa:F.qa=i:=hqimkI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yi:Ii':If:i'⟶ia:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.Ba→WTypeF.toSlicePFunctor.Bhval:F.toSlicePFunctor.WValid(WType.mkafchild)hqi:F.q(↑⟨WType.mkafchild,hval⟩).head=ihv:(pElimDataFYα↑⟨WType.mkafchild,hval⟩).validhn:(pElimDataFYα↑⟨WType.mkafchild,hval⟩).Hhvhv':(pElimDataFYα↑(F.wRestrTreef⟨WType.mkafchild,hval⟩hqi)).validhn':(pElimDataFYα↑(F.wRestrTreef⟨WType.mkafchild,hval⟩hqi)).Hhv'hqa:F.qa=i⊢ ((pElimDataFYα↑(F.wRestrTreef⟨WType.mkafchild,hval⟩hqi)).valuehv'hn').snd≍⟨i',(ConcreteCategory.hom(Y.mapf.op))(cast⋯((pElimDataFYα↑⟨WType.mkafchild,hval⟩).valuehvhn).snd)⟩.sndsubsthqamkI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yi':Ia:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.Ba→WTypeF.toSlicePFunctor.Bhval:F.toSlicePFunctor.WValid(WType.mkafchild)hv:(pElimDataFYα↑⟨WType.mkafchild,hval⟩).validhn:(pElimDataFYα↑⟨WType.mkafchild,hval⟩).Hhvf:i'⟶F.qahqi:F.q(↑⟨WType.mkafchild,hval⟩).head=F.qahv':(pElimDataFYα↑(F.wRestrTreef⟨WType.mkafchild,hval⟩hqi)).validhn':(pElimDataFYα↑(F.wRestrTreef⟨WType.mkafchild,hval⟩hqi)).Hhv'⊢ ((pElimDataFYα↑(F.wRestrTreef⟨WType.mkafchild,hval⟩hqi)).valuehv'hn').snd≍⟨i',(ConcreteCategory.hom(Y.mapf.op))(cast⋯((pElimDataFYα↑⟨WType.mkafchild,hval⟩).valuehvhn).snd)⟩.sndhavehnat:Y.mapf.op(α.app⟨F.qa⟩(⟨⟨pNodeSlice(funb↦pElimDataFYα(fchildb))hvhn.1,hn.2hn.1⟩,rfl⟩:(F.objPresheafY).obj⟨F.qa⟩))=α.app⟨i'⟩((F.objPresheafY).mapf.op⟨⟨pNodeSlice(funb↦pElimDataFYα(fchildb))hvhn.1,hn.2hn.1⟩,rfl⟩):=(ConcreteCategory.comp_apply___).symm.trans((ConcreteCategory.congr_hom(α.naturalityf.op).symm_).trans(ConcreteCategory.comp_apply___))mkI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yi':Ia:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.Ba→WTypeF.toSlicePFunctor.Bhval:F.toSlicePFunctor.WValid(WType.mkafchild)hv:(pElimDataFYα↑⟨WType.mkafchild,hval⟩).validhn:(pElimDataFYα↑⟨WType.mkafchild,hval⟩).Hhvf:i'⟶F.qahqi:F.q(↑⟨WType.mkafchild,hval⟩).head=F.qahv':(pElimDataFYα↑(F.wRestrTreef⟨WType.mkafchild,hval⟩hqi)).validhn':(pElimDataFYα↑(F.wRestrTreef⟨WType.mkafchild,hval⟩hqi)).Hhv'hnat:(ConcreteCategory.hom(Y.mapf.op))((ConcreteCategory.hom(α.app(Opposite.op(F.qa))))⟨⟨pNodeSlice(funb↦pElimDataFYα(fchildb))hv⋯,⋯⟩,⋯⟩)=(ConcreteCategory.hom(α.app(Opposite.opi')))((ConcreteCategory.hom((F.objPresheafY).mapf.op))⟨⟨pNodeSlice(funb↦pElimDataFYα(fchildb))hv⋯,⋯⟩,⋯⟩)⊢ ((pElimDataFYα↑(F.wRestrTreef⟨WType.mkafchild,hval⟩hqi)).valuehv'hn').snd≍⟨i',(ConcreteCategory.hom(Y.mapf.op))(cast⋯((pElimDataFYα↑⟨WType.mkafchild,hval⟩).valuehvhn).snd)⟩.sndchange(α.app⟨F.q(F.shapeRestrf⟨a,hqi⟩).1⟩(⟨⟨F.objRestrEltf(pNodeSlice(funb↦pElimDataFYα(fchildb))hvhn.1)hqi,hn'.2hn'.1⟩,rfl⟩:(F.objPresheafY).obj⟨F.q(F.shapeRestrf⟨a,hqi⟩).1⟩))≍Y.mapf.op(α.app⟨F.qa⟩(⟨⟨pNodeSlice(funb↦pElimDataFYα(fchildb))hvhn.1,hn.2hn.1⟩,rfl⟩:(F.objPresheafY).obj⟨F.qa⟩))mkI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yi':Ia:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.Ba→WTypeF.toSlicePFunctor.Bhval:F.toSlicePFunctor.WValid(WType.mkafchild)hv:(pElimDataFYα↑⟨WType.mkafchild,hval⟩).validhn:(pElimDataFYα↑⟨WType.mkafchild,hval⟩).Hhvf:i'⟶F.qahqi:F.q(↑⟨WType.mkafchild,hval⟩).head=F.qahv':(pElimDataFYα↑(F.wRestrTreef⟨WType.mkafchild,hval⟩hqi)).validhn':(pElimDataFYα↑(F.wRestrTreef⟨WType.mkafchild,hval⟩hqi)).Hhv'hnat:(ConcreteCategory.hom(Y.mapf.op))((ConcreteCategory.hom(α.app(Opposite.op(F.qa))))⟨⟨pNodeSlice(funb↦pElimDataFYα(fchildb))hv⋯,⋯⟩,⋯⟩)=(ConcreteCategory.hom(α.app(Opposite.opi')))((ConcreteCategory.hom((F.objPresheafY).mapf.op))⟨⟨pNodeSlice(funb↦pElimDataFYα(fchildb))hv⋯,⋯⟩,⋯⟩)⊢ (ConcreteCategory.hom(α.app(Opposite.op(F.q↑(F.shapeRestrf⟨a,hqi⟩)))))⟨⟨F.objRestrEltf(pNodeSlice(funb↦pElimDataFYα(fchildb))hv⋯)hqi,⋯⟩,⋯⟩≍(ConcreteCategory.hom(Y.mapf.op))((ConcreteCategory.hom(α.app(Opposite.op(F.qa))))⟨⟨pNodeSlice(funb↦pElimDataFYα(fchildb))hv⋯,⋯⟩,⋯⟩)rw[hnatmkI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yi':Ia:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.Ba→WTypeF.toSlicePFunctor.Bhval:F.toSlicePFunctor.WValid(WType.mkafchild)hv:(pElimDataFYα↑⟨WType.mkafchild,hval⟩).validhn:(pElimDataFYα↑⟨WType.mkafchild,hval⟩).Hhvf:i'⟶F.qahqi:F.q(↑⟨WType.mkafchild,hval⟩).head=F.qahv':(pElimDataFYα↑(F.wRestrTreef⟨WType.mkafchild,hval⟩hqi)).validhn':(pElimDataFYα↑(F.wRestrTreef⟨WType.mkafchild,hval⟩hqi)).Hhv'hnat:(ConcreteCategory.hom(Y.mapf.op))((ConcreteCategory.hom(α.app(Opposite.op(F.qa))))⟨⟨pNodeSlice(funb↦pElimDataFYα(fchildb))hv⋯,⋯⟩,⋯⟩)=(ConcreteCategory.hom(α.app(Opposite.opi')))((ConcreteCategory.hom((F.objPresheafY).mapf.op))⟨⟨pNodeSlice(funb↦pElimDataFYα(fchildb))hv⋯,⋯⟩,⋯⟩)⊢ (ConcreteCategory.hom(α.app(Opposite.op(F.q↑(F.shapeRestrf⟨a,hqi⟩)))))⟨⟨F.objRestrEltf(pNodeSlice(funb↦pElimDataFYα(fchildb))hv⋯)hqi,⋯⟩,⋯⟩≍(ConcreteCategory.hom(α.app(Opposite.opi')))((ConcreteCategory.hom((F.objPresheafY).mapf.op))⟨⟨pNodeSlice(funb↦pElimDataFYα(fchildb))hv⋯,⋯⟩,⋯⟩)]mkI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yi':Ia:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.Ba→WTypeF.toSlicePFunctor.Bhval:F.toSlicePFunctor.WValid(WType.mkafchild)hv:(pElimDataFYα↑⟨WType.mkafchild,hval⟩).validhn:(pElimDataFYα↑⟨WType.mkafchild,hval⟩).Hhvf:i'⟶F.qahqi:F.q(↑⟨WType.mkafchild,hval⟩).head=F.qahv':(pElimDataFYα↑(F.wRestrTreef⟨WType.mkafchild,hval⟩hqi)).validhn':(pElimDataFYα↑(F.wRestrTreef⟨WType.mkafchild,hval⟩hqi)).Hhv'hnat:(ConcreteCategory.hom(Y.mapf.op))((ConcreteCategory.hom(α.app(Opposite.op(F.qa))))⟨⟨pNodeSlice(funb↦pElimDataFYα(fchildb))hv⋯,⋯⟩,⋯⟩)=(ConcreteCategory.hom(α.app(Opposite.opi')))((ConcreteCategory.hom((F.objPresheafY).mapf.op))⟨⟨pNodeSlice(funb↦pElimDataFYα(fchildb))hv⋯,⋯⟩,⋯⟩)⊢ (ConcreteCategory.hom(α.app(Opposite.op(F.q↑(F.shapeRestrf⟨a,hqi⟩)))))⟨⟨F.objRestrEltf(pNodeSlice(funb↦pElimDataFYα(fchildb))hv⋯)hqi,⋯⟩,⋯⟩≍(ConcreteCategory.hom(α.app(Opposite.opi')))((ConcreteCategory.hom((F.objPresheafY).mapf.op))⟨⟨pNodeSlice(funb↦pElimDataFYα(fchildb))hv⋯,⋯⟩,⋯⟩)exactapp_heqα(F.shapeRestrf⟨a,hqi⟩).2(objPresheaf_obj_heqFY(F.shapeRestrf⟨a,hqi⟩).2(Subtype.extrfl))All goals completed! 🐙
The node the value fold assembles at a slice node whose children are folds of
hereditarily-natural subtrees is natural: local naturality of the enclosing tree
(each child restricting to the child at the reindexed direction) transports
through the fold's value-restriction coherence value_wRestrTree.
The value fold's hereditary-naturality proxy H holds at every validated
hereditarily-natural tree: the children's proxies hold by the tree recursion
(SlicePFunctor.W.induction), and the node the fold assembles (pNodeSlice)
is natural by isNatural_pNodeSlice, from the tree's local naturality.
The fiber value the fold contributes to a validated hereditarily-natural
tree indexed at j: the total-space value's Y-component, transported to the
fiber over j through the fold's over law and root-index agreement.
The total-space fold value at a carrier element is elimVal paired with the
index: the Y-component is elimVal and the base point is the fiber index.
Proof-irrelevance identifies the fold's internal hereditary-naturality proof with
any supplied one.
elimVal commutes with the restriction maps: the value of a restricted
carrier element is the Y-restriction of the value. It glues the fold-level
restriction coherence value_wRestrTree (the one-level argument, combining the
fold's one-level computation with α's naturality) with value_eq_elimVal,
which identifies the two total-space fold values' fiber components with the two
elimVals; the tree recursion is confined to pElimData_H_of_isHereditarilyNatural.
theoremelimVal_wRestr{I:TypeuI}[Category.{vI}I](F:PresheafPFunctor.{uI,uI,uA,uB,vI,vI}II)(Y:Iᵒᵖ⥤Type(maxuIuAuB))(α:NatTrans(F.objPresheafY)Y)⦃ii':I⦄(g:i'⟶i)(z:(F.W).obj⟨i⟩):elimValFYα((F.W).mapg.opz)=Y.mapg.op(elimValFYαz):=byI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yi:Ii':Ig:i'⟶iz:F.W.obj(Opposite.opi)⊢ elimValFYα((ConcreteCategory.hom(F.W.mapg.op))z)=(ConcreteCategory.hom(Y.mapg.op))(elimValFYαz)havehvz:(pElimDataFYαz.down.1.1).valid:=(pElimData_validFYαz.down.1.1)▸z.down.1.2I:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yi:Ii':Ig:i'⟶iz:F.W.obj(Opposite.opi)hvz:(pElimDataFYα↑↑z.down).valid⊢ elimValFYα((ConcreteCategory.hom(F.W.mapg.op))z)=(ConcreteCategory.hom(Y.mapg.op))(elimValFYαz)havehnz:(pElimDataFYαz.down.1.1).Hhvz:=pElimData_H_of_isHereditarilyNaturalFYαz.down.1hvzz.down.2.2I:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yi:Ii':Ig:i'⟶iz:F.W.obj(Opposite.opi)hvz:(pElimDataFYα↑↑z.down).validhnz:(pElimDataFYα↑↑z.down).Hhvz⊢ elimValFYα((ConcreteCategory.hom(F.W.mapg.op))z)=(ConcreteCategory.hom(Y.mapg.op))(elimValFYαz)havehvzr:(pElimDataFYα((F.W).mapg.opz).down.1.1).valid:=(pElimData_validFYα((F.W).mapg.opz).down.1.1)▸((F.W).mapg.opz).down.1.2I:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yi:Ii':Ig:i'⟶iz:F.W.obj(Opposite.opi)hvz:(pElimDataFYα↑↑z.down).validhnz:(pElimDataFYα↑↑z.down).Hhvzhvzr:(pElimDataFYα↑↑((ConcreteCategory.hom(F.W.mapg.op))z).down).valid⊢ elimValFYα((ConcreteCategory.hom(F.W.mapg.op))z)=(ConcreteCategory.hom(Y.mapg.op))(elimValFYαz)havehnzr:(pElimDataFYα((F.W).mapg.opz).down.1.1).Hhvzr:=pElimData_H_of_isHereditarilyNaturalFYα((F.W).mapg.opz).down.1hvzr((F.W).mapg.opz).down.2.2I:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yi:Ii':Ig:i'⟶iz:F.W.obj(Opposite.opi)hvz:(pElimDataFYα↑↑z.down).validhnz:(pElimDataFYα↑↑z.down).Hhvzhvzr:(pElimDataFYα↑↑((ConcreteCategory.hom(F.W.mapg.op))z).down).validhnzr:(pElimDataFYα↑↑((ConcreteCategory.hom(F.W.mapg.op))z).down).Hhvzr⊢ elimValFYα((ConcreteCategory.hom(F.W.mapg.op))z)=(ConcreteCategory.hom(Y.mapg.op))(elimValFYαz)haveeR:=value_eq_elimValFYα((F.W).mapg.opz)hvzrhnzrI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yi:Ii':Ig:i'⟶iz:F.W.obj(Opposite.opi)hvz:(pElimDataFYα↑↑z.down).validhnz:(pElimDataFYα↑↑z.down).Hhvzhvzr:(pElimDataFYα↑↑((ConcreteCategory.hom(F.W.mapg.op))z).down).validhnzr:(pElimDataFYα↑↑((ConcreteCategory.hom(F.W.mapg.op))z).down).HhvzreR:(pElimDataFYα↑↑((ConcreteCategory.hom(F.W.mapg.op))z).down).valuehvzrhnzr=⟨i',elimValFYα((ConcreteCategory.hom(F.W.mapg.op))z)⟩⊢ elimValFYα((ConcreteCategory.hom(F.W.mapg.op))z)=(ConcreteCategory.hom(Y.mapg.op))(elimValFYαz)haveeW:=value_wRestrTreeFYαz.down.1gz.down.2.1hvzhnzhvzrhnzrI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yi:Ii':Ig:i'⟶iz:F.W.obj(Opposite.opi)hvz:(pElimDataFYα↑↑z.down).validhnz:(pElimDataFYα↑↑z.down).Hhvzhvzr:(pElimDataFYα↑↑((ConcreteCategory.hom(F.W.mapg.op))z).down).validhnzr:(pElimDataFYα↑↑((ConcreteCategory.hom(F.W.mapg.op))z).down).HhvzreR:(pElimDataFYα↑↑((ConcreteCategory.hom(F.W.mapg.op))z).down).valuehvzrhnzr=⟨i',elimValFYα((ConcreteCategory.hom(F.W.mapg.op))z)⟩eW:(pElimDataFYα↑(F.wRestrTreeg↑z.down⋯)).valuehvzrhnzr=⟨i',(ConcreteCategory.hom(Y.mapg.op))(cast⋯((pElimDataFYα↑↑z.down).valuehvzhnz).snd)⟩⊢ elimValFYα((ConcreteCategory.hom(F.W.mapg.op))z)=(ConcreteCategory.hom(Y.mapg.op))(elimValFYαz)havekey:(⟨i',elimValFYα((F.W).mapg.opz)⟩:Σk:I,Y.obj⟨k⟩)=⟨i',Y.mapg.op(elimValFYαz)⟩:=eR.symm.transeWI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yi:Ii':Ig:i'⟶iz:F.W.obj(Opposite.opi)hvz:(pElimDataFYα↑↑z.down).validhnz:(pElimDataFYα↑↑z.down).Hhvzhvzr:(pElimDataFYα↑↑((ConcreteCategory.hom(F.W.mapg.op))z).down).validhnzr:(pElimDataFYα↑↑((ConcreteCategory.hom(F.W.mapg.op))z).down).HhvzreR:(pElimDataFYα↑↑((ConcreteCategory.hom(F.W.mapg.op))z).down).valuehvzrhnzr=⟨i',elimValFYα((ConcreteCategory.hom(F.W.mapg.op))z)⟩eW:(pElimDataFYα↑(F.wRestrTreeg↑z.down⋯)).valuehvzrhnzr=⟨i',(ConcreteCategory.hom(Y.mapg.op))(cast⋯((pElimDataFYα↑↑z.down).valuehvzhnz).snd)⟩key:⟨i',elimValFYα((ConcreteCategory.hom(F.W.mapg.op))z)⟩=⟨i',(ConcreteCategory.hom(Y.mapg.op))(elimValFYαz)⟩⊢ elimValFYα((ConcreteCategory.hom(F.W.mapg.op))z)=(ConcreteCategory.hom(Y.mapg.op))(elimValFYαz)exacteq_of_heq(Sigma.ext_iff.mpkey).2All goals completed! 🐙
The eliminator of the presheaf W-type: the natural transformation into any
presheaf algebra (Y, α). Its component over j is the bespoke value fold
elimVal; naturality is elimVal_wRestr. The existence half of initiality.
@[`@[expose]` has no effect outside a `module` fileexpose]defelim{I:TypeuI}[Category.{vI}I](F:PresheafPFunctor.{uI,uI,uA,uB,vI,vI}II)(Y:Iᵒᵖ⥤Type(maxuIuAuB))(α:NatTrans(F.objPresheafY)Y):NatTransF.WYwhereappj:=↾funz↦elimValFYα(j:=j.unop)znaturality__g:=byI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yx✝¹:Iᵒᵖx✝:Iᵒᵖg:x✝¹⟶x✝⊢ (F.W.mapg≫↾funz↦elimValFYαz)=(↾funz↦elimValFYαz)≫Y.mapgextzI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yx✝¹:Iᵒᵖx✝:Iᵒᵖg:x✝¹⟶x✝z:F.W.objx✝¹⊢ (ConcreteCategory.hom(F.W.mapg≫↾funz↦elimValFYαz)).toFunz=(ConcreteCategory.hom((↾funz↦elimValFYαz)≫Y.mapg)).toFunzexactelimVal_wRestrFYαg.unopzAll goals completed! 🐙
elim is a presheaf morphism: it commutes with the restriction
maps of F.W and Y. The NatTrans naturality of elim, mirroring the slice
comp_elim.
The computation rule for elim: it commutes with the constructor mk, i.e.
it is a morphism of presheaf algebras.
theoremelim_mk{I:TypeuI}[Category.{vI}I](F:PresheafPFunctor.{uI,uI,uA,uB,vI,vI}II)(Y:Iᵒᵖ⥤Type(maxuIuAuB))(α:NatTrans(F.objPresheafY)Y){j:I}(x:(F.objPresheafF.W).obj⟨j⟩):(elimFYα).app⟨j⟩(mkx)=α.app⟨j⟩((F.mapPresheaf(elimFYα)).app⟨j⟩x):=byI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yj:Ix:(F.objPresheafF.W).obj(Opposite.opj)⊢ (ConcreteCategory.hom((elimFYα).app(Opposite.opj)))(mkx)=(ConcreteCategory.hom(α.app(Opposite.opj)))((ConcreteCategory.hom((F.mapPresheaf(elimFYα)).app(Opposite.opj)))x)havehv:(pElimDataFYα(mkx).down.1.1).valid:=(pElimData_validFYα(mkx).down.1.1)▸(mkx).down.1.2I:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yj:Ix:(F.objPresheafF.W).obj(Opposite.opj)hv:(pElimDataFYα↑↑(mkx).down).valid⊢ (ConcreteCategory.hom((elimFYα).app(Opposite.opj)))(mkx)=(ConcreteCategory.hom(α.app(Opposite.opj)))((ConcreteCategory.hom((F.mapPresheaf(elimFYα)).app(Opposite.opj)))x)havehn:(pElimDataFYα(mkx).down.1.1).Hhv:=pElimData_H_of_isHereditarilyNaturalFYα(mkx).down.1hv(mkx).down.2.2I:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yj:Ix:(F.objPresheafF.W).obj(Opposite.opj)hv:(pElimDataFYα↑↑(mkx).down).validhn:(pElimDataFYα↑↑(mkx).down).Hhv⊢ (ConcreteCategory.hom((elimFYα).app(Opposite.opj)))(mkx)=(ConcreteCategory.hom(α.app(Opposite.opj)))((ConcreteCategory.hom((F.mapPresheaf(elimFYα)).app(Opposite.opj)))x)havehq:F.qx.1.1.1.1=j:=x.2I:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yj:Ix:(F.objPresheafF.W).obj(Opposite.opj)hv:(pElimDataFYα↑↑(mkx).down).validhn:(pElimDataFYα↑↑(mkx).down).Hhvhq:F.q(↑↑↑x).fst=j⊢ (ConcreteCategory.hom((elimFYα).app(Opposite.opj)))(mkx)=(ConcreteCategory.hom(α.app(Opposite.opj)))((ConcreteCategory.hom((F.mapPresheaf(elimFYα)).app(Opposite.opj)))x)havehchild:∀b,(pElimDataFYα(x.1.1.1.2b).2.down.1.1).value(hv.1b)(hn.1b)=(⟨(x.1.1.1.2b).1,elimValFYα(x.1.1.1.2b).2⟩:Σi:I,Y.obj⟨i⟩):=funb↦value_eq_elimValFYα(x.1.1.1.2b).2(hv.1b)(hn.1b)I:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yj:Ix:(F.objPresheafF.W).obj(Opposite.opj)hv:(pElimDataFYα↑↑(mkx).down).validhn:(pElimDataFYα↑↑(mkx).down).Hhvhq:F.q(↑↑↑x).fst=jhchild:∀(b:F.B(↑↑↑x).fst),(pElimDataFYα↑↑((↑↑↑x).sndb).snd.down).value⋯⋯=⟨((↑↑↑x).sndb).fst,elimValFYα((↑↑↑x).sndb).snd⟩⊢ (ConcreteCategory.hom((elimFYα).app(Opposite.opj)))(mkx)=(ConcreteCategory.hom(α.app(Opposite.opj)))((ConcreteCategory.hom((F.mapPresheaf(elimFYα)).app(Opposite.opj)))x)havehval:=value_eq_elimValFYα(mkx)hvhnI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yj:Ix:(F.objPresheafF.W).obj(Opposite.opj)hv:(pElimDataFYα↑↑(mkx).down).validhn:(pElimDataFYα↑↑(mkx).down).Hhvhq:F.q(↑↑↑x).fst=jhchild:∀(b:F.B(↑↑↑x).fst),(pElimDataFYα↑↑((↑↑↑x).sndb).snd.down).value⋯⋯=⟨((↑↑↑x).sndb).fst,elimValFYα((↑↑↑x).sndb).snd⟩hval:(pElimDataFYα↑↑(mkx).down).valuehvhn=⟨j,elimValFYα(mkx)⟩⊢ (ConcreteCategory.hom((elimFYα).app(Opposite.opj)))(mkx)=(ConcreteCategory.hom(α.app(Opposite.opj)))((ConcreteCategory.hom((F.mapPresheaf(elimFYα)).app(Opposite.opj)))x)applyeq_of_heqI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yj:Ix:(F.objPresheafF.W).obj(Opposite.opj)hv:(pElimDataFYα↑↑(mkx).down).validhn:(pElimDataFYα↑↑(mkx).down).Hhvhq:F.q(↑↑↑x).fst=jhchild:∀(b:F.B(↑↑↑x).fst),(pElimDataFYα↑↑((↑↑↑x).sndb).snd.down).value⋯⋯=⟨((↑↑↑x).sndb).fst,elimValFYα((↑↑↑x).sndb).snd⟩hval:(pElimDataFYα↑↑(mkx).down).valuehvhn=⟨j,elimValFYα(mkx)⟩⊢ (ConcreteCategory.hom((elimFYα).app(Opposite.opj)))(mkx)≍(ConcreteCategory.hom(α.app(Opposite.opj)))((ConcreteCategory.hom((F.mapPresheaf(elimFYα)).app(Opposite.opj)))x)refine((Sigma.ext_iff.mphval).2.symm).trans?_I:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yj:Ix:(F.objPresheafF.W).obj(Opposite.opj)hv:(pElimDataFYα↑↑(mkx).down).validhn:(pElimDataFYα↑↑(mkx).down).Hhvhq:F.q(↑↑↑x).fst=jhchild:∀(b:F.B(↑↑↑x).fst),(pElimDataFYα↑↑((↑↑↑x).sndb).snd.down).value⋯⋯=⟨((↑↑↑x).sndb).fst,elimValFYα((↑↑↑x).sndb).snd⟩hval:(pElimDataFYα↑↑(mkx).down).valuehvhn=⟨j,elimValFYα(mkx)⟩⊢ ((pElimDataFYα↑↑(mkx).down).valuehvhn).snd≍(ConcreteCategory.hom(α.app(Opposite.opj)))((ConcreteCategory.hom((F.mapPresheaf(elimFYα)).app(Opposite.opj)))x)refineapp_heqαhq?_I:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yj:Ix:(F.objPresheafF.W).obj(Opposite.opj)hv:(pElimDataFYα↑↑(mkx).down).validhn:(pElimDataFYα↑↑(mkx).down).Hhvhq:F.q(↑↑↑x).fst=jhchild:∀(b:F.B(↑↑↑x).fst),(pElimDataFYα↑↑((↑↑↑x).sndb).snd.down).value⋯⋯=⟨((↑↑↑x).sndb).fst,elimValFYα((↑↑↑x).sndb).snd⟩hval:(pElimDataFYα↑↑(mkx).down).valuehvhn=⟨j,elimValFYα(mkx)⟩⊢ ⟨⟨pNodeSlice⟨(↑(forgetNodeF↑↑x)).fst,funb↦WType.elim(PElimDataFY)(pElimStepFYα)((Subtype.val∘(↑(forgetNodeF↑↑x)).snd)b)⟩.sndhv⋯,⋯⟩,⋯⟩≍(ConcreteCategory.hom((F.mapPresheaf(elimFYα)).app(Opposite.opj)))xrefineobjPresheaf_obj_heqFYhq?_I:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yj:Ix:(F.objPresheafF.W).obj(Opposite.opj)hv:(pElimDataFYα↑↑(mkx).down).validhn:(pElimDataFYα↑↑(mkx).down).Hhvhq:F.q(↑↑↑x).fst=jhchild:∀(b:F.B(↑↑↑x).fst),(pElimDataFYα↑↑((↑↑↑x).sndb).snd.down).value⋯⋯=⟨((↑↑↑x).sndb).fst,elimValFYα((↑↑↑x).sndb).snd⟩hval:(pElimDataFYα↑↑(mkx).down).valuehvhn=⟨j,elimValFYα(mkx)⟩⊢ ↑⟨⟨pNodeSlice⟨(↑(forgetNodeF↑↑x)).fst,funb↦WType.elim(PElimDataFY)(pElimStepFYα)((Subtype.val∘(↑(forgetNodeF↑↑x)).snd)b)⟩.sndhv⋯,⋯⟩,⋯⟩=↑((ConcreteCategory.hom((F.mapPresheaf(elimFYα)).app(Opposite.opj)))x)applySubtype.extI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yj:Ix:(F.objPresheafF.W).obj(Opposite.opj)hv:(pElimDataFYα↑↑(mkx).down).validhn:(pElimDataFYα↑↑(mkx).down).Hhvhq:F.q(↑↑↑x).fst=jhchild:∀(b:F.B(↑↑↑x).fst),(pElimDataFYα↑↑((↑↑↑x).sndb).snd.down).value⋯⋯=⟨((↑↑↑x).sndb).fst,elimValFYα((↑↑↑x).sndb).snd⟩hval:(pElimDataFYα↑↑(mkx).down).valuehvhn=⟨j,elimValFYα(mkx)⟩⊢ ↑↑⟨⟨pNodeSlice⟨(↑(forgetNodeF↑↑x)).fst,funb↦WType.elim(PElimDataFY)(pElimStepFYα)((Subtype.val∘(↑(forgetNodeF↑↑x)).snd)b)⟩.sndhv⋯,⋯⟩,⋯⟩=↑↑((ConcreteCategory.hom((F.mapPresheaf(elimFYα)).app(Opposite.opj)))x)applySubtype.extI:Type uIinst✝:Category.{vI, uI}IF:PresheafPFunctorIIY:Iᵒᵖ⥤Type (max uI uA uB)α:NatTrans(F.objPresheafY)Yj:Ix:(F.objPresheafF.W).obj(Opposite.opj)hv:(pElimDataFYα↑↑(mkx).down).validhn:(pElimDataFYα↑↑(mkx).down).Hhvhq:F.q(↑↑↑x).fst=jhchild:∀(b:F.B(↑↑↑x).fst),(pElimDataFYα↑↑((↑↑↑x).sndb).snd.down).value⋯⋯=⟨((↑↑↑x).sndb).fst,elimValFYα((↑↑↑x).sndb).snd⟩hval:(pElimDataFYα↑↑(mkx).down).valuehvhn=⟨j,elimValFYα(mkx)⟩⊢ ↑↑↑⟨⟨pNodeSlice⟨(↑(forgetNodeF↑↑x)).fst,funb↦WType.elim(PElimDataFY)(pElimStepFYα)((Subtype.val∘(↑(forgetNodeF↑↑x)).snd)b)⟩.sndhv⋯,⋯⟩,⋯⟩=↑↑↑((ConcreteCategory.hom((F.mapPresheaf(elimFYα)).app(Opposite.opj)))x)exactSigma.extrfl(heq_of_eq(funextfunb↦hchildb))All goals completed! 🐙
endW
Membership of a raw W-tree in the carrier presheaf's fiber over j: the
tree is admissible, its index is j, and it is hereditarily natural. Stated on
F.toPFunctor.W rather than on W's fiber so that a decision procedure has a
raw tree to fold over; memW_iff_exists_obj identifies it with the fiber.
@[`@[expose]` has no effect outside a `module` fileexpose]defMemW{I:TypeuI}[Category.{vI}I](F:PresheafPFunctor.{uI,uI,uA,uB,vI,vI}II)(j:I)(w:F.toPFunctor.W):Prop:=∃hw:F.toSlicePFunctor.WValidw,F.toSlicePFunctor.wIndex⟨w,hw⟩=j∧F.IsHereditarilyNatural⟨w,hw⟩
MemW holds exactly of the trees underlying the carrier presheaf's fiber
over j.