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 Geb.Mathlib.Data.PFunctor.Presheaf.Basic public import Geb.Mathlib.Data.PFunctor.Slice.W

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_destmk 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_elimelim 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_objMemW 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 W ULifts 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.

References

    [Weber2007]

    [GambinoHyland2004]

    [GambinoKock2013]

    [AltenkirchGhaniHancockMcBrideMorris2015]

Tags

W-type, initial algebra, polynomial functor, presheaf, parametric right adjoint, naturality, restriction map, PFunctor

public sectionopen CategoryTheoryuniverse uI uA uB vInamespace PresheafPFunctor

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] def wRestrTree {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) j j' : I (g : j' j) (z : F.toSlicePFunctor.W) (hq : F.q (PFunctor.W.head z.1) = j) : F.toSlicePFunctor.W := SlicePFunctor.W.mk (F.objRestrElt g (SlicePFunctor.W.dest z) (I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ig:j' jz:F.toSlicePFunctor.Whq:F.q (↑z).head = jF.q (↑z.dest).fst = j I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ig:j' jw:F.toSlicePFunctor.Whw:F.toSlicePFunctor.WValid whq:F.q (↑w, hw).head = jF.q (↑(SlicePFunctor.W.dest w, hw)).fst = j; cases w with I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ig:j' ja:F.toSlicePFunctor.Af:F.toSlicePFunctor.B a WType F.toSlicePFunctor.Bhw:F.toSlicePFunctor.WValid (WType.mk a f)hq:F.q (↑WType.mk a f, hw).head = jF.q (↑(SlicePFunctor.W.dest WType.mk a f, hw)).fst = j All 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] def IsHereditarilyNatural {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) : F.toSlicePFunctor.W Prop := SlicePFunctor.W.RecProp (fun x ih ( i i' : I (g : i' i) (b : F.toSliceDomPFunctor.Direction x.1.1 i), x.1.2 (F.directionRestr x.1.1 g b).1 = F.wRestrTree g (x.1.2 b.1) (((F.toSliceDomPFunctor.compatible_iff F.toSlicePFunctor.wIndex x.1.1 x.1.2).mp x.2 b.1).trans b.2)) b, ih b)

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.

theorem isHereditarilyNatural_mk {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (x : F.toSliceDomPFunctor.Obj F.toSlicePFunctor.wIndex) : F.IsHereditarilyNatural (SlicePFunctor.W.mk x) ( i i' : I (g : i' i) (b : F.toSliceDomPFunctor.Direction x.1.1 i), x.1.2 (F.directionRestr x.1.1 g b).1 = F.wRestrTree g (x.1.2 b.1) (((F.toSliceDomPFunctor.compatible_iff F.toSlicePFunctor.wIndex x.1.1 x.1.2).mp x.2 b.1).trans b.2)) b, F.IsHereditarilyNatural (x.1.2 b) := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ix:F.Obj F.toSlicePFunctor.wIndexF.IsHereditarilyNatural (SlicePFunctor.W.mk x) (∀ i i' : I (g : i' i) (b : F.Direction (↑x).fst i), (↑x).snd (F.directionRestr (↑x).fst g b) = F.wRestrTree g ((↑x).snd b) ) (b : F.B (↑x).fst), F.IsHereditarilyNatural ((↑x).snd b) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ix:F.Obj F.toSlicePFunctor.wIndexSlicePFunctor.W.RecProp (fun x ih (∀ i i' : I (g : i' i) (b : F.Direction (↑x).fst i), (↑x).snd (F.directionRestr (↑x).fst g b) = F.wRestrTree g ((↑x).snd b) ) (b : F.toSlicePFunctor.B (↑x).fst), ih b) (SlicePFunctor.W.mk x) (∀ i i' : I (g : i' i) (b : F.Direction (↑x).fst i), (↑x).snd (F.directionRestr (↑x).fst g b) = F.wRestrTree g ((↑x).snd b) ) (b : F.B (↑x).fst), SlicePFunctor.W.RecProp (fun x ih (∀ i i' : I (g : i' i) (b : F.Direction (↑x).fst i), (↑x).snd (F.directionRestr (↑x).fst g b) = F.wRestrTree g ((↑x).snd b) ) (b : F.toSlicePFunctor.B (↑x).fst), ih b) ((↑x).snd b) All goals completed! 🐙

The index of a root-restricted tree is j': wRestrTree g z rebuilds the root with the restricted shape (shapeRestr g _).1, whose q-output index is j'.

theorem wIndex_wRestrTree {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) j j' : I (g : j' j) (z : F.toSlicePFunctor.W) (hq : F.q (PFunctor.W.head z.1) = j) : F.toSlicePFunctor.wIndex (F.wRestrTree g z hq) = j' := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ig:j' jz:F.toSlicePFunctor.Whq:F.q (↑z).head = jF.toSlicePFunctor.wIndex (F.wRestrTree g z hq) = j' I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ig:j' jtree:F.toSlicePFunctor.Whvalid:F.toSlicePFunctor.WValid treehq:F.q (↑tree, hvalid).head = jF.toSlicePFunctor.wIndex (F.wRestrTree g tree, hvalid hq) = j' cases tree with I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ig:j' ja:F.toSlicePFunctor.Af:F.toSlicePFunctor.B a WType F.toSlicePFunctor.Bhvalid:F.toSlicePFunctor.WValid (WType.mk a f)hq:F.q (↑WType.mk a f, hvalid).head = jF.toSlicePFunctor.wIndex (F.wRestrTree g WType.mk a f, hvalid hq) = j' All goals completed! 🐙

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.

private theorem snd_objRestrElt {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) j j' : I (g : j' j) (x : F.toSliceDomPFunctor.Obj F.toSlicePFunctor.wIndex) (hq : F.q x.1.1 = j) i : I (d : F.toSliceDomPFunctor.Direction (F.objRestrElt g x hq).1.1 i) : (F.objRestrElt g x hq).1.2 d.1 = x.1.2 (F.reindex g x.1.1, hq d).1 := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ig:j' jx:F.Obj F.toSlicePFunctor.wIndexhq:F.q (↑x).fst = ji:Id:F.Direction (↑(F.objRestrElt g x hq)).fst i(↑(F.objRestrElt g x hq)).snd d = (↑x).snd (F.reindex g (↑x).fst, hq d) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ig:j' jx:F.Obj F.toSlicePFunctor.wIndexhq:F.q (↑x).fst = jdv:F.B (↑(F.objRestrElt g x hq)).fst(↑(F.objRestrElt g x hq)).snd dv, = (↑x).snd (F.reindex g (↑x).fst, hq dv, ) All goals completed! 🐙

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.

theorem isHereditarilyNatural_wRestrTree {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) j j' : I (g : j' j) (z : F.toSlicePFunctor.W) (hq : F.q (PFunctor.W.head z.1) = j) (hz : F.IsHereditarilyNatural z) : F.IsHereditarilyNatural (F.wRestrTree g z hq) := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ig:j' jz:F.toSlicePFunctor.Whq:F.q (↑z).head = jhz:F.IsHereditarilyNatural zF.IsHereditarilyNatural (F.wRestrTree g z hq) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ig:j' jtree:F.toSlicePFunctor.Whvalid:F.toSlicePFunctor.WValid treehq:F.q (↑tree, hvalid).head = jhz:F.IsHereditarilyNatural tree, hvalidF.IsHereditarilyNatural (F.wRestrTree g tree, hvalid hq) cases tree with I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ig:j' ja:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.B a WType F.toSlicePFunctor.Bhvalid:F.toSlicePFunctor.WValid (WType.mk a fchild)hq:F.q (↑WType.mk a fchild, hvalid).head = jhz:F.IsHereditarilyNatural WType.mk a fchild, hvalidF.IsHereditarilyNatural (F.wRestrTree g WType.mk a fchild, hvalid hq) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ig:j' ja:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.B a WType F.toSlicePFunctor.Bhvalid:F.toSlicePFunctor.WValid (WType.mk a fchild)hq:F.q (↑WType.mk a fchild, hvalid).head = jhz:F.IsHereditarilyNatural WType.mk a fchild, hvalidhz_local: i i' : I (g : i' i) (b : F.Direction (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst i), (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd (F.directionRestr (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst g b) = F.wRestrTree g ((↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd b) hz_children: (b : F.B (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst), F.IsHereditarilyNatural ((↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd b)F.IsHereditarilyNatural (F.wRestrTree g WType.mk a fchild, hvalid hq) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ig:j' ja:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.B a WType F.toSlicePFunctor.Bhvalid:F.toSlicePFunctor.WValid (WType.mk a fchild)hq:F.q (↑WType.mk a fchild, hvalid).head = jhz:F.IsHereditarilyNatural WType.mk a fchild, hvalidhz_local: i i' : I (g : i' i) (b : F.Direction (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst i), (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd (F.directionRestr (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst g b) = F.wRestrTree g ((↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd b) hz_children: (b : F.B (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst), F.IsHereditarilyNatural ((↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd b) i i' : I (g_1 : i' i) (b : F.Direction (↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).fst i), (↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).snd (F.directionRestr (↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).fst g_1 b) = F.wRestrTree g_1 ((↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).snd b) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ig:j' ja:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.B a WType F.toSlicePFunctor.Bhvalid:F.toSlicePFunctor.WValid (WType.mk a fchild)hq:F.q (↑WType.mk a fchild, hvalid).head = jhz:F.IsHereditarilyNatural WType.mk a fchild, hvalidhz_local: i i' : I (g : i' i) (b : F.Direction (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst i), (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd (F.directionRestr (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst g b) = F.wRestrTree g ((↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd b) hz_children: (b : F.B (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst), F.IsHereditarilyNatural ((↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd b) (b : F.B (↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).fst), F.IsHereditarilyNatural ((↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).snd b) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ig:j' ja:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.B a WType F.toSlicePFunctor.Bhvalid:F.toSlicePFunctor.WValid (WType.mk a fchild)hq:F.q (↑WType.mk a fchild, hvalid).head = jhz:F.IsHereditarilyNatural WType.mk a fchild, hvalidhz_local: i i' : I (g : i' i) (b : F.Direction (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst i), (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd (F.directionRestr (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst g b) = F.wRestrTree g ((↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd b) hz_children: (b : F.B (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst), F.IsHereditarilyNatural ((↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd b) i i' : I (g_1 : i' i) (b : F.Direction (↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).fst i), (↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).snd (F.directionRestr (↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).fst g_1 b) = F.wRestrTree g_1 ((↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).snd b) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ig:j' ja:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.B a WType F.toSlicePFunctor.Bhvalid:F.toSlicePFunctor.WValid (WType.mk a fchild)hq:F.q (↑WType.mk a fchild, hvalid).head = jhz:F.IsHereditarilyNatural WType.mk a fchild, hvalidhz_local: i i' : I (g : i' i) (b : F.Direction (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst i), (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd (F.directionRestr (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst g b) = F.wRestrTree g ((↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd b) hz_children: (b : F.B (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst), F.IsHereditarilyNatural ((↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd b)i:Ii':Ih:i' ib:F.Direction (↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).fst i(↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).snd (F.directionRestr (↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).fst h b) = F.wRestrTree h ((↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).snd b) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ig:j' ja:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.B a WType F.toSlicePFunctor.Bhvalid:F.toSlicePFunctor.WValid (WType.mk a fchild)hq:F.q (↑WType.mk a fchild, hvalid).head = jhz:F.IsHereditarilyNatural WType.mk a fchild, hvalidhz_local: i i' : I (g : i' i) (b : F.Direction (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst i), (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd (F.directionRestr (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst g b) = F.wRestrTree g ((↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd b) hz_children: (b : F.B (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst), F.IsHereditarilyNatural ((↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd b)i':Ibv:F.B (↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).fsth:i' F.rCurried (↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).fst bv(↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).snd (F.directionRestr (↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).fst h bv, ) = F.wRestrTree h ((↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).snd bv, ) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ig:j' ja:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.B a WType F.toSlicePFunctor.Bhvalid:F.toSlicePFunctor.WValid (WType.mk a fchild)hq:F.q (↑WType.mk a fchild, hvalid).head = jhz:F.IsHereditarilyNatural WType.mk a fchild, hvalidhz_local: i i' : I (g : i' i) (b : F.Direction (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst i), (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd (F.directionRestr (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst g b) = F.wRestrTree g ((↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd b) hz_children: (b : F.B (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst), F.IsHereditarilyNatural ((↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd b)i':Ibv:F.B (↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).fsth:i' F.rCurried (↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).fst bv(↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd (F.reindex g (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst, (F.directionRestr (↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).fst h bv, )) = F.wRestrTree h ((↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).snd bv, ) All goals completed! 🐙 I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ig:j' ja:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.B a WType F.toSlicePFunctor.Bhvalid:F.toSlicePFunctor.WValid (WType.mk a fchild)hq:F.q (↑WType.mk a fchild, hvalid).head = jhz:F.IsHereditarilyNatural WType.mk a fchild, hvalidhz_local: i i' : I (g : i' i) (b : F.Direction (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst i), (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd (F.directionRestr (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst g b) = F.wRestrTree g ((↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd b) hz_children: (b : F.B (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst), F.IsHereditarilyNatural ((↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd b) (b : F.B (↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).fst), F.IsHereditarilyNatural ((↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).snd b) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ig:j' ja:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.B a WType F.toSlicePFunctor.Bhvalid:F.toSlicePFunctor.WValid (WType.mk a fchild)hq:F.q (↑WType.mk a fchild, hvalid).head = jhz:F.IsHereditarilyNatural WType.mk a fchild, hvalidhz_local: i i' : I (g : i' i) (b : F.Direction (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst i), (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd (F.directionRestr (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst g b) = F.wRestrTree g ((↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd b) hz_children: (b : F.B (↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).fst), F.IsHereditarilyNatural ((↑(SlicePFunctor.W.dest WType.mk a fchild, hvalid)).snd b)b:F.B (↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).fstF.IsHereditarilyNatural ((↑(F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) )).snd b) All goals completed! 🐙

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).

@[`@[expose]` has no effect outside a `module` fileexpose] def wRestr {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) j j' : I (g : j' j) : ULift.{uI} { w : F.toSlicePFunctor.W // F.toSlicePFunctor.wIndex w = j F.IsHereditarilyNatural w } ULift.{uI} { w : F.toSlicePFunctor.W // F.toSlicePFunctor.wIndex w = j' F.IsHereditarilyNatural w } := fun w ULift.up F.wRestrTree g w.down.1 w.down.2.1, F.wIndex_wRestrTree g w.down.1 w.down.2.1, F.isHereditarilyNatural_wRestrTree g w.down.1 w.down.2.1 w.down.2.2

Restriction along an identity fixes the tree: objRestrElt_id collapses the rebuilt root, and mk_dest reassembles the original tree.

theorem wRestrTree_id {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) j : I (z : F.toSlicePFunctor.W) (hq : F.q (PFunctor.W.head z.1) = j) : F.wRestrTree (𝟙 j) z hq = z := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Iz:F.toSlicePFunctor.Whq:F.q (↑z).head = jF.wRestrTree (𝟙 j) z hq = z I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Itree:F.toSlicePFunctor.Whvalid:F.toSlicePFunctor.WValid treehq:F.q (↑tree, hvalid).head = jF.wRestrTree (𝟙 j) tree, hvalid hq = tree, hvalid cases tree with I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ia:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.B a WType F.toSlicePFunctor.Bhvalid:F.toSlicePFunctor.WValid (WType.mk a fchild)hq:F.q (↑WType.mk a fchild, hvalid).head = jF.wRestrTree (𝟙 j) WType.mk a fchild, hvalid hq = WType.mk a fchild, hvalid I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ia:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.B a WType F.toSlicePFunctor.Bhvalid:F.toSlicePFunctor.WValid (WType.mk a fchild)hq:F.q (↑WType.mk a fchild, hvalid).head = jSlicePFunctor.W.mk (F.objRestrElt (𝟙 j) (SlicePFunctor.W.dest WType.mk a fchild, hvalid) ) = WType.mk a fchild, hvalid I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ia:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.B a WType F.toSlicePFunctor.Bhvalid:F.toSlicePFunctor.WValid (WType.mk a fchild)hq:F.q (↑WType.mk a fchild, hvalid).head = jSlicePFunctor.W.mk (SlicePFunctor.W.dest WType.mk a fchild, hvalid) = WType.mk a fchild, hvalid All goals completed! 🐙

Restriction along a composite factors: dest_mk exposes the inner restriction and objRestrElt_comp splits the rebuilt root.

theorem wRestrTree_comp {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) j j' j'' : I (g : j' j) (h : j'' j') (z : F.toSlicePFunctor.W) (hq : F.q (PFunctor.W.head z.1) = j) (hq2 : F.q (PFunctor.W.head (F.wRestrTree g z hq).1) = j') : F.wRestrTree (h g) z hq = F.wRestrTree h (F.wRestrTree g z hq) hq2 := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ij'':Ig:j' jh:j'' j'z:F.toSlicePFunctor.Whq:F.q (↑z).head = jhq2:F.q (↑(F.wRestrTree g z hq)).head = j'F.wRestrTree (h g) z hq = F.wRestrTree h (F.wRestrTree g z hq) hq2 I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ij'':Ig:j' jh:j'' j'tree:F.toSlicePFunctor.Whvalid:F.toSlicePFunctor.WValid treehq:F.q (↑tree, hvalid).head = jhq2:F.q (↑(F.wRestrTree g tree, hvalid hq)).head = j'F.wRestrTree (h g) tree, hvalid hq = F.wRestrTree h (F.wRestrTree g tree, hvalid hq) hq2 cases tree with I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ij'':Ig:j' jh:j'' j'a:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.B a WType F.toSlicePFunctor.Bhvalid:F.toSlicePFunctor.WValid (WType.mk a fchild)hq:F.q (↑WType.mk a fchild, hvalid).head = jhq2:F.q (↑(F.wRestrTree g WType.mk a fchild, hvalid hq)).head = j'F.wRestrTree (h g) WType.mk a fchild, hvalid hq = F.wRestrTree h (F.wRestrTree g WType.mk a fchild, hvalid hq) hq2 I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ij'':Ig:j' jh:j'' j'a:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.B a WType F.toSlicePFunctor.Bhvalid:F.toSlicePFunctor.WValid (WType.mk a fchild)hq:F.q (↑WType.mk a fchild, hvalid).head = jhq2:F.q (↑(F.wRestrTree g WType.mk a fchild, hvalid hq)).head = j'SlicePFunctor.W.mk (F.objRestrElt (h g) (SlicePFunctor.W.dest WType.mk a fchild, hvalid) ) = SlicePFunctor.W.mk (F.objRestrElt h (F.objRestrElt g (SlicePFunctor.W.dest WType.mk a fchild, hvalid) ) ) All goals completed! 🐙

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] def W {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) : Iᵒᵖ Type (max uI uA uB) where obj j := ULift.{uI} { w : F.toSlicePFunctor.W // F.toSlicePFunctor.wIndex w = j.unop F.IsHereditarilyNatural w } map g := (F.wRestr g.unop) map_id j := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:IᵒᵖF.wRestr (𝟙 j).unop = 𝟙 (ULift.{uI, max uA uB} { w // F.toSlicePFunctor.wIndex w = Opposite.unop j F.IsHereditarilyNatural w }) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Iᵒᵖw:ULift.{uI, max uA uB} { w // F.toSlicePFunctor.wIndex w = Opposite.unop j F.IsHereditarilyNatural w }((ConcreteCategory.hom (F.wRestr (𝟙 j).unop)).toFun w).down = ((ConcreteCategory.hom (𝟙 (ULift.{uI, max uA uB} { w // F.toSlicePFunctor.wIndex w = Opposite.unop j F.IsHereditarilyNatural w }))).toFun w).down All goals completed! 🐙 map_comp g h := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IX✝:IᵒᵖY✝:IᵒᵖZ✝:Iᵒᵖg:X✝ Y✝h:Y✝ Z✝F.wRestr (g h).unop = F.wRestr g.unop F.wRestr h.unop I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IX✝:IᵒᵖY✝:IᵒᵖZ✝:Iᵒᵖg:X✝ Y✝h:Y✝ Z✝w:ULift.{uI, max uA uB} { w // F.toSlicePFunctor.wIndex w = Opposite.unop X✝ F.IsHereditarilyNatural w }((ConcreteCategory.hom (F.wRestr (g h).unop)).toFun w).down = ((ConcreteCategory.hom (F.wRestr g.unop F.wRestr h.unop)).toFun w).down All goals completed! 🐙
namespace W

Casting a carrier fiber element along an index equality leaves its underlying slice W-tree unchanged.

private theorem cast_down {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) {k k' : I} (e : k = k') (u : (F.W).obj k) : (cast (congrArg (fun k : I (F.W).obj k) e) u).down.1 = u.down.1 := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ik:Ik':Ie:k = k'u:F.W.obj (Opposite.op k)(cast u).down = u.down I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ik:Iu:F.W.obj (Opposite.op k)(cast u).down = u.down All goals completed! 🐙

wRestrTree respects equality of the restricted trees; the head-index witnesses are proof-irrelevant.

private theorem wRestrTree_congr {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) j j' : I (g : j' j) {z z' : F.toSlicePFunctor.W} (hz : z = z') (hq : F.q (PFunctor.W.head z.1) = j) (hq' : F.q (PFunctor.W.head z'.1) = j) : F.wRestrTree g z hq = F.wRestrTree g z' hq' := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ig:j' jz:F.toSlicePFunctor.Wz':F.toSlicePFunctor.Whz:z = z'hq:F.q (↑z).head = jhq':F.q (↑z').head = jF.wRestrTree g z hq = F.wRestrTree g z' hq' I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ij':Ig:j' jz:F.toSlicePFunctor.Whq:F.q (↑z).head = jhq':F.q (↑z).head = jF.wRestrTree g z hq = F.wRestrTree g z hq' All goals completed! 🐙

Two carrier fiber elements with equal underlying trees are equal.

private theorem obj_ext {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) {k : I} {u u' : (F.W).obj k} (h : u.down.1 = u'.down.1) : u = u' := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ik:Iu:F.W.obj (Opposite.op k)u':F.W.obj (Opposite.op k)h:u.down = u'.downu = u' I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ik:Iu':F.W.obj (Opposite.op k)u:{ w // F.toSlicePFunctor.wIndex w = Opposite.unop (Opposite.op k) F.IsHereditarilyNatural w }h:{ down := u }.down = u'.down{ down := u } = u' I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ik:Iu:{ w // F.toSlicePFunctor.wIndex w = Opposite.unop (Opposite.op k) F.IsHereditarilyNatural w }u':{ w // F.toSlicePFunctor.wIndex w = Opposite.unop (Opposite.op k) F.IsHereditarilyNatural w }h:{ down := u }.down = { down := u' }.down{ down := u } = { down := u' } All goals completed! 🐙

The underlying tree of a restricted fiber element is the root-restriction of the underlying tree.

private theorem map_down {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) i i' : I (f : i' i) (u : (F.W).obj i) : ((F.W).map f.op u).down.1 = F.wRestrTree f u.down.1 u.down.2.1 := rfl

The underlying tree of the value a presheaf node over F.W assigns to a direction is the underlying tree of the carried child fiber element.

private theorem value_down {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (n : F.toSliceDomPFunctor.Obj (PresheafDomPFunctorData.elemProj (F.W))) i : I (b : F.toSliceDomPFunctor.Direction n.1.1 i) : (F.toPresheafDomPFunctorData.value n b).down.1 = (n.1.2 b.1).2.down.1 := cast_down F (((F.toSliceDomPFunctor.compatible_iff (PresheafDomPFunctorData.elemProj (F.W)) n.1.1 n.1.2).mp n.2 b.1).trans b.2) (n.1.2 b.1).2

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.

private theorem sigma_eta {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) {i : I} (w : (F.W).obj i) : (F.toSlicePFunctor.wIndex w.down.1, ULift.up w.down.1, rfl, w.down.2.2 : Σ i : I, (F.W).obj i) = i, w := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ii:Iw:F.W.obj (Opposite.op i)F.toSlicePFunctor.wIndex w.down, { down := w.down, } = i, w I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ii:It:F.toSlicePFunctor.Whi:F.toSlicePFunctor.wIndex t = Opposite.unop (Opposite.op i)hh:F.IsHereditarilyNatural tF.toSlicePFunctor.wIndex { down := t, }.down, { down := { down := t, }.down, } = i, { down := t, } I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I It:F.toSlicePFunctor.Whh:F.IsHereditarilyNatural tF.toSlicePFunctor.wIndex { down := t, }.down, { down := { down := t, }.down, } = F.toPresheafPFunctorData.2 (↑t).head, { down := t, } All goals completed! 🐙

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.

@[`@[expose]` has no effect outside a `module` fileexpose] def forgetNode {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (n : F.toSliceDomPFunctor.Obj (PresheafDomPFunctorData.elemProj (F.W))) : F.toSliceDomPFunctor.Obj F.toSlicePFunctor.wIndex := n.1.1, fun b (n.1.2 b).2.down.1, (F.toSliceDomPFunctor.compatible_iff F.toSlicePFunctor.wIndex _ _).mpr fun b ((n.1.2 b).2.down.2.1).trans ((F.toSliceDomPFunctor.compatible_iff (PresheafDomPFunctorData.elemProj (F.W)) _ _).mp n.2 b)

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.

@[`@[expose]` has no effect outside a `module` fileexpose] def rememberNode {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (y : F.toSliceDomPFunctor.Obj F.toSlicePFunctor.wIndex) (hchildren : b, F.IsHereditarilyNatural (y.1.2 b)) : F.toSliceDomPFunctor.Obj (PresheafDomPFunctorData.elemProj (F.W)) := y.1.1, fun b F.toSlicePFunctor.wIndex (y.1.2 b), ULift.up y.1.2 b, rfl, hchildren b, (F.toSliceDomPFunctor.compatible_iff (PresheafDomPFunctorData.elemProj (F.W)) _ _).mpr fun b (F.toSliceDomPFunctor.compatible_iff F.toSlicePFunctor.wIndex _ _).mp y.2 b

rememberNode depends on the slice node only, not the hereditary-naturality data (which occupies a Prop position).

private theorem rememberNode_eq {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) {y y' : F.toSliceDomPFunctor.Obj F.toSlicePFunctor.wIndex} (hy : b, F.IsHereditarilyNatural (y.1.2 b)) (hy' : b, F.IsHereditarilyNatural (y'.1.2 b)) (e : y = y') : rememberNode F y hy = rememberNode F y' hy' := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Iy:F.Obj F.toSlicePFunctor.wIndexy':F.Obj F.toSlicePFunctor.wIndexhy: (b : F.B (↑y).fst), F.IsHereditarilyNatural ((↑y).snd b)hy': (b : F.B (↑y').fst), F.IsHereditarilyNatural ((↑y').snd b)e:y = y'rememberNode F y hy = rememberNode F y' hy' I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Iy:F.Obj F.toSlicePFunctor.wIndexhy: (b : F.B (↑y).fst), F.IsHereditarilyNatural ((↑y).snd b)hy': (b : F.B (↑y).fst), F.IsHereditarilyNatural ((↑y).snd b)rememberNode F y hy = rememberNode F y hy' All goals completed! 🐙

forgetNode inverts rememberNode.

private theorem forgetNode_rememberNode {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (y : F.toSliceDomPFunctor.Obj F.toSlicePFunctor.wIndex) (hchildren : b, F.IsHereditarilyNatural (y.1.2 b)) : forgetNode F (rememberNode F y hchildren) = y := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Iy:F.Obj F.toSlicePFunctor.wIndexhchildren: (b : F.B (↑y).fst), F.IsHereditarilyNatural ((↑y).snd b)forgetNode F (rememberNode F y hchildren) = y I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Iy:F.Obj F.toSlicePFunctor.wIndexhchildren: (b : F.B (↑y).fst), F.IsHereditarilyNatural ((↑y).snd b)(forgetNode F (rememberNode F y hchildren)) = y I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ia:F.Av:F.B a F.toSlicePFunctor.Whc:F.Compatible F.toSlicePFunctor.wIndex a, v.fst a, v.sndhchildren: (b : F.B (↑a, v, hc).fst), F.IsHereditarilyNatural ((↑a, v, hc).snd b)(forgetNode F (rememberNode F a, v, hc hchildren)) = a, v, hc All goals completed! 🐙

rememberNode inverts forgetNode (with the hereditary-naturality data transported through the round trip).

private theorem rememberNode_forgetNode {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (n : F.toSliceDomPFunctor.Obj (PresheafDomPFunctorData.elemProj (F.W))) (hchildren : b, F.IsHereditarilyNatural ((forgetNode F n).1.2 b)) : rememberNode F (forgetNode F n) hchildren = n := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I In:F.Obj (PresheafDomPFunctorData.elemProj F.W)hchildren: (b : F.B (↑(forgetNode F n)).fst), F.IsHereditarilyNatural ((↑(forgetNode F n)).snd b)rememberNode F (forgetNode F n) hchildren = n I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I In:F.Obj (PresheafDomPFunctorData.elemProj F.W)hchildren: (b : F.B (↑(forgetNode F n)).fst), F.IsHereditarilyNatural ((↑(forgetNode F n)).snd b)(rememberNode F (forgetNode F n) hchildren) = n I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ia:F.Av:F.B a (i : I) × F.W.obj (Opposite.op i)hc:F.Compatible (PresheafDomPFunctorData.elemProj F.W) a, v.fst a, v.sndhchildren: (b : F.B (↑(forgetNode F a, v, hc)).fst), F.IsHereditarilyNatural ((↑(forgetNode F a, v, hc)).snd b)(rememberNode F (forgetNode F a, v, hc) hchildren) = a, v, hc All goals completed! 🐙

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.

theorem isHereditarilyNatural_mk_forgetNode {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (n : F.toSliceDomPFunctor.Obj (PresheafDomPFunctorData.elemProj (F.W))) : F.IsHereditarilyNatural (SlicePFunctor.W.mk (forgetNode F n)) F.toPresheafDomPFunctorData.IsNatural n := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I In:F.Obj (PresheafDomPFunctorData.elemProj F.W)F.IsHereditarilyNatural (SlicePFunctor.W.mk (forgetNode F n)) F.IsNatural n I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I In:F.Obj (PresheafDomPFunctorData.elemProj F.W)((∀ i i' : I (g : i' i) (b : F.Direction (↑(forgetNode F n)).fst i), (↑(forgetNode F n)).snd (F.directionRestr (↑(forgetNode F n)).fst g b) = F.wRestrTree g ((↑(forgetNode F n)).snd b) ) (b : F.B (↑(forgetNode F n)).fst), F.IsHereditarilyNatural ((↑(forgetNode F n)).snd b)) F.IsNatural n I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I In:F.Obj (PresheafDomPFunctorData.elemProj F.W)((∀ i i' : I (g : i' i) (b : F.Direction (↑(forgetNode F n)).fst i), (↑(forgetNode F n)).snd (F.directionRestr (↑(forgetNode F n)).fst g b) = F.wRestrTree g ((↑(forgetNode F n)).snd b) ) (b : F.B (↑(forgetNode F n)).fst), F.IsHereditarilyNatural ((↑(forgetNode F n)).snd b)) F.IsNatural nI:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I In:F.Obj (PresheafDomPFunctorData.elemProj F.W)F.IsNatural n (∀ i i' : I (g : i' i) (b : F.Direction (↑(forgetNode F n)).fst i), (↑(forgetNode F n)).snd (F.directionRestr (↑(forgetNode F n)).fst g b) = F.wRestrTree g ((↑(forgetNode F n)).snd b) ) (b : F.B (↑(forgetNode F n)).fst), F.IsHereditarilyNatural ((↑(forgetNode F n)).snd b) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I In:F.Obj (PresheafDomPFunctorData.elemProj F.W)((∀ i i' : I (g : i' i) (b : F.Direction (↑(forgetNode F n)).fst i), (↑(forgetNode F n)).snd (F.directionRestr (↑(forgetNode F n)).fst g b) = F.wRestrTree g ((↑(forgetNode F n)).snd b) ) (b : F.B (↑(forgetNode F n)).fst), F.IsHereditarilyNatural ((↑(forgetNode F n)).snd b)) F.IsNatural n I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I In:F.Obj (PresheafDomPFunctorData.elemProj F.W)hloc: i i' : I (g : i' i) (b : F.Direction (↑(forgetNode F n)).fst i), (↑(forgetNode F n)).snd (F.directionRestr (↑(forgetNode F n)).fst g b) = F.wRestrTree g ((↑(forgetNode F n)).snd b) i:Ii':If:i' ib:F.Direction (↑n).fst iF.value n (F.directionRestr (↑n).fst f b) = (ConcreteCategory.hom (F.W.map f.op)) (F.value n b) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I In:F.Obj (PresheafDomPFunctorData.elemProj F.W)hloc: i i' : I (g : i' i) (b : F.Direction (↑(forgetNode F n)).fst i), (↑(forgetNode F n)).snd (F.directionRestr (↑(forgetNode F n)).fst g b) = F.wRestrTree g ((↑(forgetNode F n)).snd b) i:Ii':If:i' ib:F.Direction (↑n).fst i(F.value n (F.directionRestr (↑n).fst f b)).down = ((ConcreteCategory.hom (F.W.map f.op)) (F.value n b)).down I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I In:F.Obj (PresheafDomPFunctorData.elemProj F.W)hloc: i i' : I (g : i' i) (b : F.Direction (↑(forgetNode F n)).fst i), (↑(forgetNode F n)).snd (F.directionRestr (↑(forgetNode F n)).fst g b) = F.wRestrTree g ((↑(forgetNode F n)).snd b) i:Ii':If:i' ib:F.Direction (↑n).fst i((↑n).snd (F.directionRestr (↑n).fst f b)).snd.down = F.wRestrTree f ((↑n).snd b).snd.down All goals completed! 🐙 I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I In:F.Obj (PresheafDomPFunctorData.elemProj F.W)F.IsNatural n (∀ i i' : I (g : i' i) (b : F.Direction (↑(forgetNode F n)).fst i), (↑(forgetNode F n)).snd (F.directionRestr (↑(forgetNode F n)).fst g b) = F.wRestrTree g ((↑(forgetNode F n)).snd b) ) (b : F.B (↑(forgetNode F n)).fst), F.IsHereditarilyNatural ((↑(forgetNode F n)).snd b) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I In:F.Obj (PresheafDomPFunctorData.elemProj F.W)hnat:F.IsNatural n(∀ i i' : I (g : i' i) (b : F.Direction (↑(forgetNode F n)).fst i), (↑(forgetNode F n)).snd (F.directionRestr (↑(forgetNode F n)).fst g b) = F.wRestrTree g ((↑(forgetNode F n)).snd b) ) (b : F.B (↑(forgetNode F n)).fst), F.IsHereditarilyNatural ((↑(forgetNode F n)).snd b) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I In:F.Obj (PresheafDomPFunctorData.elemProj F.W)hnat:F.IsNatural ni:Ii':Ig:i' ib:F.Direction (↑(forgetNode F n)).fst i(↑(forgetNode F n)).snd (F.directionRestr (↑(forgetNode F n)).fst g b) = F.wRestrTree g ((↑(forgetNode F n)).snd b) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I In:F.Obj (PresheafDomPFunctorData.elemProj F.W)hnat:F.IsNatural ni:Ii':Ig:i' ib:F.Direction (↑(forgetNode F n)).fst ih:(F.value n (F.directionRestr (↑n).fst g b)).down = ((ConcreteCategory.hom (F.W.map g.op)) (F.value n b)).down(↑(forgetNode F n)).snd (F.directionRestr (↑(forgetNode F n)).fst g b) = F.wRestrTree g ((↑(forgetNode F n)).snd b) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I In:F.Obj (PresheafDomPFunctorData.elemProj F.W)hnat:F.IsNatural ni:Ii':Ig:i' ib:F.Direction (↑(forgetNode F n)).fst ih:((↑n).snd (F.directionRestr (↑n).fst g b)).snd.down = F.wRestrTree g (F.value n b).down (↑(forgetNode F n)).snd (F.directionRestr (↑(forgetNode F n)).fst g b) = F.wRestrTree g ((↑(forgetNode F n)).snd b) All goals completed! 🐙

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.

@[`@[expose]` has no effect outside a `module` fileexpose] def mk {I : Type uI} [Category.{vI} I] {F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I} {j : I} (x : (F.objPresheaf F.W).obj j) : (F.W).obj j := ULift.up SlicePFunctor.W.mk (forgetNode F x.1.1), x.2, (isHereditarilyNatural_mk_forgetNode F x.1.1).mpr x.1.2

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.

@[`@[expose]` has no effect outside a `module` fileexpose] def dest {I : Type uI} [Category.{vI} I] {F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I} {j : I} (z : (F.W).obj j) : (F.objPresheaf F.W).obj j := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Iz:F.W.obj (Opposite.op j)(F.objPresheaf F.W).obj (Opposite.op j) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Iz:F.W.obj (Opposite.op j)hz:F.IsHereditarilyNatural (SlicePFunctor.W.mk (↑z.down).dest)(F.objPresheaf F.W).obj (Opposite.op j) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Iz:F.W.obj (Opposite.op j)hz:F.IsHereditarilyNatural (SlicePFunctor.W.mk (↑z.down).dest)hchildren: (b : F.B (↑(↑z.down).dest).fst), F.IsHereditarilyNatural ((↑(↑z.down).dest).snd b)(F.objPresheaf F.W).obj (Opposite.op j) exact rememberNode F (SlicePFunctor.W.dest z.down.1) hchildren, (isHereditarilyNatural_mk_forgetNode F _).mp (I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Iz:F.W.obj (Opposite.op j)hz:F.IsHereditarilyNatural (SlicePFunctor.W.mk (↑z.down).dest)hchildren: (b : F.B (↑(↑z.down).dest).fst), F.IsHereditarilyNatural ((↑(↑z.down).dest).snd b)F.IsHereditarilyNatural (SlicePFunctor.W.mk (forgetNode F (rememberNode F (↑z.down).dest hchildren))) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Iz:F.W.obj (Opposite.op j)hz:F.IsHereditarilyNatural (SlicePFunctor.W.mk (↑z.down).dest)hchildren: (b : F.B (↑(↑z.down).dest).fst), F.IsHereditarilyNatural ((↑(↑z.down).dest).snd b)F.IsHereditarilyNatural (SlicePFunctor.W.mk (↑z.down).dest); All goals completed! 🐙), calc F.q (SlicePFunctor.W.dest z.down.1).1.1 = F.toSlicePFunctor.wIndex (SlicePFunctor.W.mk (SlicePFunctor.W.dest z.down.1)) := (SlicePFunctor.W.wIndex_mk (SlicePFunctor.W.dest z.down.1)).symm _ = F.toSlicePFunctor.wIndex z.down.1 := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Iz:F.W.obj (Opposite.op j)hz:F.IsHereditarilyNatural (SlicePFunctor.W.mk (↑z.down).dest)hchildren: (b : F.B (↑(↑z.down).dest).fst), F.IsHereditarilyNatural ((↑(↑z.down).dest).snd b)F.toSlicePFunctor.wIndex (SlicePFunctor.W.mk (↑z.down).dest) = F.toSlicePFunctor.wIndex z.down All goals completed! 🐙 _ = j := z.down.2.1

dest is a left inverse of mk.

@[simp] theorem dest_mk {I : Type uI} [Category.{vI} I] {F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I} {j : I} (x : (F.objPresheaf F.W).obj j) : dest (mk x) = x := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ix:(F.objPresheaf F.W).obj (Opposite.op j)dest (mk x) = x I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ix:(F.objPresheaf F.W).obj (Opposite.op j)(dest (mk x)) = x I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ix:(F.objPresheaf F.W).obj (Opposite.op j)(dest (mk x)) = x I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ix:(F.objPresheaf F.W).obj (Opposite.op j)hz:F.IsHereditarilyNatural (SlicePFunctor.W.mk (SlicePFunctor.W.mk (forgetNode F x)).dest)(dest (mk x)) = x I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ix:(F.objPresheaf F.W).obj (Opposite.op j)hz:F.IsHereditarilyNatural (SlicePFunctor.W.mk (SlicePFunctor.W.mk (forgetNode F x)).dest)hch: (b : F.B (↑(SlicePFunctor.W.mk (forgetNode F x)).dest).fst), F.IsHereditarilyNatural ((↑(SlicePFunctor.W.mk (forgetNode F x)).dest).snd b)(dest (mk x)) = x I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ix:(F.objPresheaf F.W).obj (Opposite.op j)hz:F.IsHereditarilyNatural (SlicePFunctor.W.mk (SlicePFunctor.W.mk (forgetNode F x)).dest)hch: (b : F.B (↑(SlicePFunctor.W.mk (forgetNode F x)).dest).fst), F.IsHereditarilyNatural ((↑(SlicePFunctor.W.mk (forgetNode F x)).dest).snd b)rememberNode F (SlicePFunctor.W.mk (forgetNode F x)).dest hch = x I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Ix:(F.objPresheaf F.W).obj (Opposite.op j)hz:F.IsHereditarilyNatural (SlicePFunctor.W.mk (SlicePFunctor.W.mk (forgetNode F x)).dest)hch: (b : F.B (↑(SlicePFunctor.W.mk (forgetNode F x)).dest).fst), F.IsHereditarilyNatural ((↑(SlicePFunctor.W.mk (forgetNode F x)).dest).snd b)hy': (b : F.B (↑(forgetNode F x)).fst), F.IsHereditarilyNatural ((↑(forgetNode F x)).snd b)rememberNode F (SlicePFunctor.W.mk (forgetNode F x)).dest hch = x All goals completed! 🐙

mk is a left inverse of dest; with dest_mk, mk and dest are mutually inverse, so F.W is a fixed point of the objPresheaf-action at F.W.

@[simp] theorem mk_dest {I : Type uI} [Category.{vI} I] {F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I} {j : I} (z : (F.W).obj j) : mk (dest z) = z := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Iz:F.W.obj (Opposite.op j)mk (dest z) = z I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Iz:F.W.obj (Opposite.op j)hz:F.IsHereditarilyNatural (SlicePFunctor.W.mk (↑z.down).dest)mk (dest z) = z I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Iz:F.W.obj (Opposite.op j)hz:F.IsHereditarilyNatural (SlicePFunctor.W.mk (↑z.down).dest)hch: (b : F.B (↑(↑z.down).dest).fst), F.IsHereditarilyNatural ((↑(↑z.down).dest).snd b)mk (dest z) = z I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Iz:F.W.obj (Opposite.op j)hz:F.IsHereditarilyNatural (SlicePFunctor.W.mk (↑z.down).dest)hch: (b : F.B (↑(↑z.down).dest).fst), F.IsHereditarilyNatural ((↑(↑z.down).dest).snd b)(mk (dest z)).down = z.down I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Iz:F.W.obj (Opposite.op j)hz:F.IsHereditarilyNatural (SlicePFunctor.W.mk (↑z.down).dest)hch: (b : F.B (↑(↑z.down).dest).fst), F.IsHereditarilyNatural ((↑(↑z.down).dest).snd b)SlicePFunctor.W.mk (forgetNode F (rememberNode F (↑z.down).dest hch)) = z.down All goals completed! 🐙

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 value lies over the index.

@[ext] structure PElimData {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (Y : Iᵒᵖ Type (max uI uA uB)) extends SlicePFunctor.WIndex I where H : valid Prop value : (hv : valid) H hv Σ i : I, Y.obj i over : (hv : valid) (hn : H hv), (value hv hn).1 = index

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] def pNodeSlice {I : Type uI} [Category.{vI} I] {F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I} {Y : Iᵒᵖ Type (max uI uA uB)} {a : F.toPFunctor.A} (c : F.toPFunctor.B a PElimData F Y) (hv : F.toSlicePFunctor.NodeValid a (fun b (c b).toWIndex)) (hc : b, (c b).H (hv.1 b)) : F.toSliceDomPFunctor.Obj (PresheafDomPFunctorData.elemProj Y) := a, fun b (c b).value (hv.1 b) (hc b), (F.toSliceDomPFunctor.compatible_iff (PresheafDomPFunctorData.elemProj Y) a _).mpr fun b ((c b).over (hv.1 b) (hc b)).trans (congrFun hv.2 b)

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] def pElimStep {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (Y : Iᵒᵖ Type (max uI uA uB)) (α : NatTrans (F.objPresheaf Y) Y) : F.toPFunctor.Obj (PElimData F Y) PElimData F Y := fun x { index := F.q x.1 valid := F.toSlicePFunctor.NodeValid x.1 (fun b (x.2 b).toWIndex) H := fun hv ( b, (x.2 b).H (hv.1 b)) ( hc : ( b, (x.2 b).H (hv.1 b)), F.IsNatural (pNodeSlice x.2 hv hc)) value := fun hv hn F.q x.1, α.app F.q x.1 pNodeSlice x.2 hv hn.1, hn.2 hn.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] def pElimData {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (Y : Iᵒᵖ Type (max uI uA uB)) (α : NatTrans (F.objPresheaf Y) Y) : F.toPFunctor.W PElimData F Y := WType.elim (PElimData F Y) (pElimStep F Y α)

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.

theorem pElimData_toWIndex {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (Y : Iᵒᵖ Type (max uI uA uB)) (α : NatTrans (F.objPresheaf Y) Y) (w : F.toPFunctor.W) : (pElimData F Y α w).toWIndex = F.wIndexValid w := WType.rec (motive := fun w (pElimData F Y α w).toWIndex = F.wIndexValid w) (fun a f ih I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yw:F.Wa:F.Af:F.B a WType F.Bih: (a : F.B a), (pElimData F Y α (f a)).toWIndex = F.toSlicePFunctor.wIndexValid (f a)(pElimData F Y α (WType.mk a f)).toWIndex = F.toSlicePFunctor.wIndexValid (WType.mk a f) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yw:F.Wa:F.Af:F.B a WType F.Bih: (a : F.B a), (pElimData F Y α (f a)).toWIndex = F.toSlicePFunctor.wIndexValid (f a)F.toSlicePFunctor.wIndexStep a, fun b (pElimData F Y α (f b)).toWIndex = F.toSlicePFunctor.wIndexStep a, fun b F.toSlicePFunctor.wIndexValid (f b) All goals completed! 🐙) w

The admissibility component of pElimData is WValid.

theorem pElimData_valid {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (Y : Iᵒᵖ Type (max uI uA uB)) (α : NatTrans (F.objPresheaf Y) Y) (w : F.toPFunctor.W) : (pElimData F Y α w).valid = F.WValid w := congrArg SlicePFunctor.WIndex.valid (pElimData_toWIndex F Y α w)

The index component of pElimData is the root index.

theorem pElimData_index {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (Y : Iᵒᵖ Type (max uI uA uB)) (α : NatTrans (F.objPresheaf Y) Y) (w : F.toPFunctor.W) : (pElimData F Y α w).index = F.wIndexRoot w := (congrArg SlicePFunctor.WIndex.index (pElimData_toWIndex F Y α w)).trans (F.wIndexValid_index_eq_wIndexRoot w)

A natural transformation's components respect heterogeneous equality of fiber elements over equal indices.

private theorem app_heq.{w} {I : Type uI} [Category.{vI} I] {Z Z' : Iᵒᵖ Type w} (β : NatTrans Z Z') {k k' : I} (hk : k = k') {x : Z.obj k} {x' : Z.obj k'} (hx : x x') : β.app k x β.app k' x' := I:Type uIinst✝:Category.{vI, uI} IZ:Iᵒᵖ Type wZ':Iᵒᵖ Type wβ:NatTrans Z Z'k:Ik':Ihk:k = k'x:Z.obj (Opposite.op k)x':Z.obj (Opposite.op k')hx:x x'(ConcreteCategory.hom (β.app (Opposite.op k))) x (ConcreteCategory.hom (β.app (Opposite.op k'))) x' I:Type uIinst✝:Category.{vI, uI} IZ:Iᵒᵖ Type wZ':Iᵒᵖ Type wβ:NatTrans Z Z'k:Ix:Z.obj (Opposite.op k)x':Z.obj (Opposite.op k)hx:x x'(ConcreteCategory.hom (β.app (Opposite.op k))) x (ConcreteCategory.hom (β.app (Opposite.op k))) x' I:Type uIinst✝:Category.{vI, uI} IZ:Iᵒᵖ Type wZ':Iᵒᵖ Type wβ:NatTrans Z Z'k:Ix:Z.obj (Opposite.op k)(ConcreteCategory.hom (β.app (Opposite.op k))) x (ConcreteCategory.hom (β.app (Opposite.op k))) x All goals completed! 🐙

Two fiber elements of objPresheaf Y over equal indices whose underlying dom values are equal are heterogeneously equal.

private theorem objPresheaf_obj_heq {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (Y : Iᵒᵖ Type (max uI uA uB)) {k k' : I} (hk : k = k') {u : (F.objPresheaf Y).obj k} {u' : (F.objPresheaf Y).obj k'} (h : u.1 = u'.1) : u u' := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)k:Ik':Ihk:k = k'u:(F.objPresheaf Y).obj (Opposite.op k)u':(F.objPresheaf Y).obj (Opposite.op k')h:u = u'u u' I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)k:Iu:(F.objPresheaf Y).obj (Opposite.op k)u':(F.objPresheaf Y).obj (Opposite.op k)h:u = u'u u' 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.

theorem value_wRestrTree {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (Y : Iᵒᵖ Type (max uI uA uB)) (α : NatTrans (F.objPresheaf Y) Y) (t : F.toSlicePFunctor.W) i i' : I (f : i' i) (hqi : F.q (PFunctor.W.head t.1) = i) (hv : (pElimData F Y α t.1).valid) (hn : (pElimData F Y α t.1).H hv) (hv' : (pElimData F Y α (F.wRestrTree f t hqi).1).valid) (hn' : (pElimData F Y α (F.wRestrTree f t hqi).1).H hv') : (pElimData F Y α (F.wRestrTree f t hqi).1).value hv' hn' = i', Y.map f.op (cast (congrArg (fun k : I Y.obj k) (((pElimData F Y α t.1).over hv hn).trans ((pElimData_index F Y α t.1).trans hqi))) ((pElimData F Y α t.1).value hv hn).2) := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yt:F.toSlicePFunctor.Wi:Ii':If:i' ihqi:F.q (↑t).head = ihv:(pElimData F Y α t).validhn:(pElimData F Y α t).H hvhv':(pElimData F Y α (F.wRestrTree f t hqi)).validhn':(pElimData F Y α (F.wRestrTree f t hqi)).H hv'(pElimData F Y α (F.wRestrTree f t hqi)).value hv' hn' = i', (ConcreteCategory.hom (Y.map f.op)) (cast ((pElimData F Y α t).value hv hn).snd) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yi:Ii':If:i' itree:F.toSlicePFunctor.Whval:F.toSlicePFunctor.WValid treehqi:F.q (↑tree, hval).head = ihv:(pElimData F Y α tree, hval).validhn:(pElimData F Y α tree, hval).H hvhv':(pElimData F Y α (F.wRestrTree f tree, hval hqi)).validhn':(pElimData F Y α (F.wRestrTree f tree, hval hqi)).H hv'(pElimData F Y α (F.wRestrTree f tree, hval hqi)).value hv' hn' = i', (ConcreteCategory.hom (Y.map f.op)) (cast ((pElimData F Y α tree, hval).value hv hn).snd) cases tree with I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yi:Ii':If:i' ia:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.B a WType F.toSlicePFunctor.Bhval:F.toSlicePFunctor.WValid (WType.mk a fchild)hqi:F.q (↑WType.mk a fchild, hval).head = ihv:(pElimData F Y α WType.mk a fchild, hval).validhn:(pElimData F Y α WType.mk a fchild, hval).H hvhv':(pElimData F Y α (F.wRestrTree f WType.mk a fchild, hval hqi)).validhn':(pElimData F Y α (F.wRestrTree f WType.mk a fchild, hval hqi)).H hv'(pElimData F Y α (F.wRestrTree f WType.mk a fchild, hval hqi)).value hv' hn' = i', (ConcreteCategory.hom (Y.map f.op)) (cast ((pElimData F Y α WType.mk a fchild, hval).value hv hn).snd) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yi:Ii':If:i' ia:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.B a WType F.toSlicePFunctor.Bhval:F.toSlicePFunctor.WValid (WType.mk a fchild)hqi:F.q (↑WType.mk a fchild, hval).head = ihv:(pElimData F Y α WType.mk a fchild, hval).validhn:(pElimData F Y α WType.mk a fchild, hval).H hvhv':(pElimData F Y α (F.wRestrTree f WType.mk a fchild, hval hqi)).validhn':(pElimData F Y α (F.wRestrTree f WType.mk a fchild, hval hqi)).H hv'((pElimData F Y α (F.wRestrTree f WType.mk a fchild, hval hqi)).value hv' hn').snd i', (ConcreteCategory.hom (Y.map f.op)) (cast ((pElimData F Y α WType.mk a fchild, hval).value hv hn).snd).snd I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yi:Ii':If:i' ia:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.B a WType F.toSlicePFunctor.Bhval:F.toSlicePFunctor.WValid (WType.mk a fchild)hqi:F.q (↑WType.mk a fchild, hval).head = ihv:(pElimData F Y α WType.mk a fchild, hval).validhn:(pElimData F Y α WType.mk a fchild, hval).H hvhv':(pElimData F Y α (F.wRestrTree f WType.mk a fchild, hval hqi)).validhn':(pElimData F Y α (F.wRestrTree f WType.mk a fchild, hval hqi)).H hv'hqa:F.q a = i((pElimData F Y α (F.wRestrTree f WType.mk a fchild, hval hqi)).value hv' hn').snd i', (ConcreteCategory.hom (Y.map f.op)) (cast ((pElimData F Y α WType.mk a fchild, hval).value hv hn).snd).snd I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yi':Ia:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.B a WType F.toSlicePFunctor.Bhval:F.toSlicePFunctor.WValid (WType.mk a fchild)hv:(pElimData F Y α WType.mk a fchild, hval).validhn:(pElimData F Y α WType.mk a fchild, hval).H hvf:i' F.q ahqi:F.q (↑WType.mk a fchild, hval).head = F.q ahv':(pElimData F Y α (F.wRestrTree f WType.mk a fchild, hval hqi)).validhn':(pElimData F Y α (F.wRestrTree f WType.mk a fchild, hval hqi)).H hv'((pElimData F Y α (F.wRestrTree f WType.mk a fchild, hval hqi)).value hv' hn').snd i', (ConcreteCategory.hom (Y.map f.op)) (cast ((pElimData F Y α WType.mk a fchild, hval).value hv hn).snd).snd I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yi':Ia:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.B a WType F.toSlicePFunctor.Bhval:F.toSlicePFunctor.WValid (WType.mk a fchild)hv:(pElimData F Y α WType.mk a fchild, hval).validhn:(pElimData F Y α WType.mk a fchild, hval).H hvf:i' F.q ahqi:F.q (↑WType.mk a fchild, hval).head = F.q ahv':(pElimData F Y α (F.wRestrTree f WType.mk a fchild, hval hqi)).validhn':(pElimData F Y α (F.wRestrTree f WType.mk a fchild, hval hqi)).H hv'hnat:(ConcreteCategory.hom (Y.map f.op)) ((ConcreteCategory.hom (α.app (Opposite.op (F.q a)))) pNodeSlice (fun b pElimData F Y α (fchild b)) hv , , ) = (ConcreteCategory.hom (α.app (Opposite.op i'))) ((ConcreteCategory.hom ((F.objPresheaf Y).map f.op)) pNodeSlice (fun b pElimData F Y α (fchild b)) hv , , )((pElimData F Y α (F.wRestrTree f WType.mk a fchild, hval hqi)).value hv' hn').snd i', (ConcreteCategory.hom (Y.map f.op)) (cast ((pElimData F Y α WType.mk a fchild, hval).value hv hn).snd).snd I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yi':Ia:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.B a WType F.toSlicePFunctor.Bhval:F.toSlicePFunctor.WValid (WType.mk a fchild)hv:(pElimData F Y α WType.mk a fchild, hval).validhn:(pElimData F Y α WType.mk a fchild, hval).H hvf:i' F.q ahqi:F.q (↑WType.mk a fchild, hval).head = F.q ahv':(pElimData F Y α (F.wRestrTree f WType.mk a fchild, hval hqi)).validhn':(pElimData F Y α (F.wRestrTree f WType.mk a fchild, hval hqi)).H hv'hnat:(ConcreteCategory.hom (Y.map f.op)) ((ConcreteCategory.hom (α.app (Opposite.op (F.q a)))) pNodeSlice (fun b pElimData F Y α (fchild b)) hv , , ) = (ConcreteCategory.hom (α.app (Opposite.op i'))) ((ConcreteCategory.hom ((F.objPresheaf Y).map f.op)) pNodeSlice (fun b pElimData F Y α (fchild b)) hv , , )(ConcreteCategory.hom (α.app (Opposite.op (F.q (F.shapeRestr f a, hqi))))) F.objRestrElt f (pNodeSlice (fun b pElimData F Y α (fchild b)) hv ) hqi, , (ConcreteCategory.hom (Y.map f.op)) ((ConcreteCategory.hom (α.app (Opposite.op (F.q a)))) pNodeSlice (fun b pElimData F Y α (fchild b)) hv , , ) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yi':Ia:F.toSlicePFunctor.Afchild:F.toSlicePFunctor.B a WType F.toSlicePFunctor.Bhval:F.toSlicePFunctor.WValid (WType.mk a fchild)hv:(pElimData F Y α WType.mk a fchild, hval).validhn:(pElimData F Y α WType.mk a fchild, hval).H hvf:i' F.q ahqi:F.q (↑WType.mk a fchild, hval).head = F.q ahv':(pElimData F Y α (F.wRestrTree f WType.mk a fchild, hval hqi)).validhn':(pElimData F Y α (F.wRestrTree f WType.mk a fchild, hval hqi)).H hv'hnat:(ConcreteCategory.hom (Y.map f.op)) ((ConcreteCategory.hom (α.app (Opposite.op (F.q a)))) pNodeSlice (fun b pElimData F Y α (fchild b)) hv , , ) = (ConcreteCategory.hom (α.app (Opposite.op i'))) ((ConcreteCategory.hom ((F.objPresheaf Y).map f.op)) pNodeSlice (fun b pElimData F Y α (fchild b)) hv , , )(ConcreteCategory.hom (α.app (Opposite.op (F.q (F.shapeRestr f a, hqi))))) F.objRestrElt f (pNodeSlice (fun b pElimData F Y α (fchild b)) hv ) hqi, , (ConcreteCategory.hom (α.app (Opposite.op i'))) ((ConcreteCategory.hom ((F.objPresheaf Y).map f.op)) pNodeSlice (fun b pElimData F Y α (fchild b)) hv , , ) 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.

private theorem isNatural_pNodeSlice {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (Y : Iᵒᵖ Type (max uI uA uB)) (α : NatTrans (F.objPresheaf Y) Y) {a : F.toPFunctor.A} (fc : F.toPFunctor.B a F.toSlicePFunctor.W) (hv : F.toSlicePFunctor.NodeValid a (fun b (pElimData F Y α (fc b).1).toWIndex)) (hc : b, (pElimData F Y α (fc b).1).H (hv.1 b)) (hloc : i i' : I (g : i' i) (b : F.toSliceDomPFunctor.Direction a i) (hq : F.q (PFunctor.W.head (fc b.1).1) = i), fc (F.directionRestr a g b).1 = F.wRestrTree g (fc b.1) hq) : F.IsNatural (pNodeSlice (fun b pElimData F Y α (fc b).1) hv hc) := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Ya:F.Afc:F.B a F.toSlicePFunctor.Whv:F.toSlicePFunctor.NodeValid a fun b (pElimData F Y α (fc b)).toWIndexhc: (b : F.B a), (pElimData F Y α (fc b)).H hloc: i i' : I (g : i' i) (b : F.Direction a i) (hq : F.q (↑(fc b)).head = i), fc (F.directionRestr a g b) = F.wRestrTree g (fc b) hqF.IsNatural (pNodeSlice (fun b pElimData F Y α (fc b)) hv hc) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Ya:F.Afc:F.B a F.toSlicePFunctor.Whv:F.toSlicePFunctor.NodeValid a fun b (pElimData F Y α (fc b)).toWIndexhc: (b : F.B a), (pElimData F Y α (fc b)).H hloc: i i' : I (g : i' i) (b : F.Direction a i) (hq : F.q (↑(fc b)).head = i), fc (F.directionRestr a g b) = F.wRestrTree g (fc b) hqi:Ii':Ig:i' ib:F.Direction (↑(pNodeSlice (fun b pElimData F Y α (fc b)) hv hc)).fst iF.value (pNodeSlice (fun b pElimData F Y α (fc b)) hv hc) (F.directionRestr (↑(pNodeSlice (fun b pElimData F Y α (fc b)) hv hc)).fst g b) = (ConcreteCategory.hom (Y.map g.op)) (F.value (pNodeSlice (fun b pElimData F Y α (fc b)) hv hc) b) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Ya:F.Afc:F.B a F.toSlicePFunctor.Whv:F.toSlicePFunctor.NodeValid a fun b (pElimData F Y α (fc b)).toWIndexhc: (b : F.B a), (pElimData F Y α (fc b)).H hloc: i i' : I (g : i' i) (b : F.Direction a i) (hq : F.q (↑(fc b)).head = i), fc (F.directionRestr a g b) = F.wRestrTree g (fc b) hqi:Ii':Ig:i' ib:F.Direction (↑(pNodeSlice (fun b pElimData F Y α (fc b)) hv hc)).fst iF.value (pNodeSlice (fun b pElimData F Y α (fc b)) hv hc) (F.directionRestr a g b) = (ConcreteCategory.hom (Y.map g.op)) (F.value (pNodeSlice (fun b pElimData F Y α (fc b)) hv hc) b) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Ya:F.Afc:F.B a F.toSlicePFunctor.Whv:F.toSlicePFunctor.NodeValid a fun b (pElimData F Y α (fc b)).toWIndexhc: (b : F.B a), (pElimData F Y α (fc b)).H hloc: i i' : I (g : i' i) (b : F.Direction a i) (hq : F.q (↑(fc b)).head = i), fc (F.directionRestr a g b) = F.wRestrTree g (fc b) hqi:Ii':Ig:i' ib:F.Direction (↑(pNodeSlice (fun b pElimData F Y α (fc b)) hv hc)).fst ihqit:F.q (↑(fc b)).head = iF.value (pNodeSlice (fun b pElimData F Y α (fc b)) hv hc) (F.directionRestr a g b) = (ConcreteCategory.hom (Y.map g.op)) (F.value (pNodeSlice (fun b pElimData F Y α (fc b)) hv hc) b) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Ya:F.Afc:F.B a F.toSlicePFunctor.Whv:F.toSlicePFunctor.NodeValid a fun b (pElimData F Y α (fc b)).toWIndexhc: (b : F.B a), (pElimData F Y α (fc b)).H hloc: i i' : I (g : i' i) (b : F.Direction a i) (hq : F.q (↑(fc b)).head = i), fc (F.directionRestr a g b) = F.wRestrTree g (fc b) hqi:Ii':Ig:i' ib:F.Direction (↑(pNodeSlice (fun b pElimData F Y α (fc b)) hv hc)).fst ihqit:F.q (↑(fc b)).head = ihgen: (T : F.toSlicePFunctor.W) (hvT : (pElimData F Y α T).valid) (hnT : (pElimData F Y α T).H hvT), T = F.wRestrTree g (fc b) hqit (pElimData F Y α T).value hvT hnT = i', (ConcreteCategory.hom (Y.map g.op)) (cast ((pElimData F Y α (fc b)).value ).snd)F.value (pNodeSlice (fun b pElimData F Y α (fc b)) hv hc) (F.directionRestr a g b) = (ConcreteCategory.hom (Y.map g.op)) (F.value (pNodeSlice (fun b pElimData F Y α (fc b)) hv hc) b) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Ya:F.Afc:F.B a F.toSlicePFunctor.Whv:F.toSlicePFunctor.NodeValid a fun b (pElimData F Y α (fc b)).toWIndexhc: (b : F.B a), (pElimData F Y α (fc b)).H hloc: i i' : I (g : i' i) (b : F.Direction a i) (hq : F.q (↑(fc b)).head = i), fc (F.directionRestr a g b) = F.wRestrTree g (fc b) hqi:Ii':Ig:i' ib:F.Direction (↑(pNodeSlice (fun b pElimData F Y α (fc b)) hv hc)).fst ihqit:F.q (↑(fc b)).head = ihgen: (T : F.toSlicePFunctor.W) (hvT : (pElimData F Y α T).valid) (hnT : (pElimData F Y α T).H hvT), T = F.wRestrTree g (fc b) hqit (pElimData F Y α T).value hvT hnT = i', (ConcreteCategory.hom (Y.map g.op)) (cast ((pElimData F Y α (fc b)).value ).snd)hchild:(↑(pNodeSlice (fun b pElimData F Y α (fc b)) hv hc)).snd (F.directionRestr a g b) = i', (ConcreteCategory.hom (Y.map g.op)) (cast ((pElimData F Y α (fc b)).value ).snd)F.value (pNodeSlice (fun b pElimData F Y α (fc b)) hv hc) (F.directionRestr a g b) = (ConcreteCategory.hom (Y.map g.op)) (F.value (pNodeSlice (fun b pElimData F Y α (fc b)) hv hc) b) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Ya:F.Afc:F.B a F.toSlicePFunctor.Whv:F.toSlicePFunctor.NodeValid a fun b (pElimData F Y α (fc b)).toWIndexhc: (b : F.B a), (pElimData F Y α (fc b)).H hloc: i i' : I (g : i' i) (b : F.Direction a i) (hq : F.q (↑(fc b)).head = i), fc (F.directionRestr a g b) = F.wRestrTree g (fc b) hqi:Ii':Ig:i' ib:F.Direction (↑(pNodeSlice (fun b pElimData F Y α (fc b)) hv hc)).fst ihqit:F.q (↑(fc b)).head = ihgen: (T : F.toSlicePFunctor.W) (hvT : (pElimData F Y α T).valid) (hnT : (pElimData F Y α T).H hvT), T = F.wRestrTree g (fc b) hqit (pElimData F Y α T).value hvT hnT = i', (ConcreteCategory.hom (Y.map g.op)) (cast ((pElimData F Y α (fc b)).value ).snd)hchild:(↑(pNodeSlice (fun b pElimData F Y α (fc b)) hv hc)).snd (F.directionRestr a g b) = i', (ConcreteCategory.hom (Y.map g.op)) (cast ((pElimData F Y α (fc b)).value ).snd)cast ((↑(pNodeSlice (fun b pElimData F Y α (fc b)) hv hc)).snd (F.directionRestr a g b)).snd = (ConcreteCategory.hom (Y.map g.op)) (cast ((↑(pNodeSlice (fun b pElimData F Y α (fc b)) hv hc)).snd b).snd) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Ya:F.Afc:F.B a F.toSlicePFunctor.Whv:F.toSlicePFunctor.NodeValid a fun b (pElimData F Y α (fc b)).toWIndexhc: (b : F.B a), (pElimData F Y α (fc b)).H hloc: i i' : I (g : i' i) (b : F.Direction a i) (hq : F.q (↑(fc b)).head = i), fc (F.directionRestr a g b) = F.wRestrTree g (fc b) hqi:Ii':Ig:i' ib:F.Direction (↑(pNodeSlice (fun b pElimData F Y α (fc b)) hv hc)).fst ihqit:F.q (↑(fc b)).head = ihgen: (T : F.toSlicePFunctor.W) (hvT : (pElimData F Y α T).valid) (hnT : (pElimData F Y α T).H hvT), T = F.wRestrTree g (fc b) hqit (pElimData F Y α T).value hvT hnT = i', (ConcreteCategory.hom (Y.map g.op)) (cast ((pElimData F Y α (fc b)).value ).snd)hchild:(↑(pNodeSlice (fun b pElimData F Y α (fc b)) hv hc)).snd (F.directionRestr a g b) = i', (ConcreteCategory.hom (Y.map g.op)) (cast ((pElimData F Y α (fc b)).value ).snd)cast ((↑(pNodeSlice (fun b pElimData F Y α (fc b)) hv hc)).snd (F.directionRestr a g b)).snd (ConcreteCategory.hom (Y.map g.op)) (cast ((↑(pNodeSlice (fun b pElimData F Y α (fc b)) hv hc)).snd b).snd) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Ya:F.Afc:F.B a F.toSlicePFunctor.Whv:F.toSlicePFunctor.NodeValid a fun b (pElimData F Y α (fc b)).toWIndexhc: (b : F.B a), (pElimData F Y α (fc b)).H hloc: i i' : I (g : i' i) (b : F.Direction a i) (hq : F.q (↑(fc b)).head = i), fc (F.directionRestr a g b) = F.wRestrTree g (fc b) hqi:Ii':Ig:i' ib:F.Direction (↑(pNodeSlice (fun b pElimData F Y α (fc b)) hv hc)).fst ihqit:F.q (↑(fc b)).head = ihgen: (T : F.toSlicePFunctor.W) (hvT : (pElimData F Y α T).valid) (hnT : (pElimData F Y α T).H hvT), T = F.wRestrTree g (fc b) hqit (pElimData F Y α T).value hvT hnT = i', (ConcreteCategory.hom (Y.map g.op)) (cast ((pElimData F Y α (fc b)).value ).snd)hchild:(↑(pNodeSlice (fun b pElimData F Y α (fc b)) hv hc)).snd (F.directionRestr a g b) = i', (ConcreteCategory.hom (Y.map g.op)) (cast ((pElimData F Y α (fc b)).value ).snd)((↑(pNodeSlice (fun b pElimData F Y α (fc b)) hv hc)).snd (F.directionRestr a g b)).snd (ConcreteCategory.hom (Y.map g.op)) (cast ((↑(pNodeSlice (fun b pElimData F Y α (fc b)) hv hc)).snd b).snd) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Ya:F.Afc:F.B a F.toSlicePFunctor.Whv:F.toSlicePFunctor.NodeValid a fun b (pElimData F Y α (fc b)).toWIndexhc: (b : F.B a), (pElimData F Y α (fc b)).H hloc: i i' : I (g : i' i) (b : F.Direction a i) (hq : F.q (↑(fc b)).head = i), fc (F.directionRestr a g b) = F.wRestrTree g (fc b) hqi:Ii':Ig:i' ib:F.Direction (↑(pNodeSlice (fun b pElimData F Y α (fc b)) hv hc)).fst ihqit:F.q (↑(fc b)).head = ihgen: (T : F.toSlicePFunctor.W) (hvT : (pElimData F Y α T).valid) (hnT : (pElimData F Y α T).H hvT), T = F.wRestrTree g (fc b) hqit (pElimData F Y α T).value hvT hnT = i', (ConcreteCategory.hom (Y.map g.op)) (cast ((pElimData F Y α (fc b)).value ).snd)hchild:(↑(pNodeSlice (fun b pElimData F Y α (fc b)) hv hc)).snd (F.directionRestr a g b) = i', (ConcreteCategory.hom (Y.map g.op)) (cast ((pElimData F Y α (fc b)).value ).snd)i', (ConcreteCategory.hom (Y.map g.op)) (cast ((pElimData F Y α (fc b)).value ).snd).snd (ConcreteCategory.hom (Y.map g.op)) (cast ((↑(pNodeSlice (fun b pElimData F Y α (fc b)) hv hc)).snd b).snd) All goals completed! 🐙

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.

theorem pElimData_H_of_isHereditarilyNatural {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (Y : Iᵒᵖ Type (max uI uA uB)) (α : NatTrans (F.objPresheaf Y) Y) (w : F.toSlicePFunctor.W) (hv : (pElimData F Y α w.1).valid) (hn : F.IsHereditarilyNatural w) : (pElimData F Y α w.1).H hv := SlicePFunctor.W.induction (motive := fun z (hv : (pElimData F Y α z.1).valid), F.IsHereditarilyNatural z (pElimData F Y α z.1).H hv) (fun x ih hv hHN I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yw:F.toSlicePFunctor.Whv✝:(pElimData F Y α w).validhn:F.IsHereditarilyNatural wx:F.toSlicePFunctor.Obj F.toSlicePFunctor.wIndexih: (b : F.toSlicePFunctor.B (↑x).fst) (hv : (pElimData F Y α ((↑x).snd b)).valid), F.IsHereditarilyNatural ((↑x).snd b) (pElimData F Y α ((↑x).snd b)).H hvhv:(pElimData F Y α (SlicePFunctor.W.mk x)).validhHN:F.IsHereditarilyNatural (SlicePFunctor.W.mk x)(pElimData F Y α (SlicePFunctor.W.mk x)).H hv I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yw:F.toSlicePFunctor.Whv✝:(pElimData F Y α w).validhn:F.IsHereditarilyNatural wx:F.toSlicePFunctor.Obj F.toSlicePFunctor.wIndexih: (b : F.toSlicePFunctor.B (↑x).fst) (hv : (pElimData F Y α ((↑x).snd b)).valid), F.IsHereditarilyNatural ((↑x).snd b) (pElimData F Y α ((↑x).snd b)).H hvhv:(pElimData F Y α (SlicePFunctor.W.mk x)).validhHN:F.IsHereditarilyNatural (SlicePFunctor.W.mk x)x✝: (b : F.B (↑x).fst, fun b WType.elim (PElimData F Y) (pElimStep F Y α) ((Subtype.val (↑x).snd) b).fst), ((↑x).fst, fun b WType.elim (PElimData F Y) (pElimStep F Y α) ((Subtype.val (↑x).snd) b).snd b).H F.IsNatural (pNodeSlice (↑x).fst, fun b WType.elim (PElimData F Y) (pElimStep F Y α) ((Subtype.val (↑x).snd) b).snd hv x✝) All goals completed! 🐙) w hv hn

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.

@[`@[expose]` has no effect outside a `module` fileexpose] def elimVal {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (Y : Iᵒᵖ Type (max uI uA uB)) (α : NatTrans (F.objPresheaf Y) Y) {j : I} (z : (F.W).obj j) : Y.obj j := cast (congrArg (fun i : I Y.obj i) ((((pElimData F Y α z.down.1.1).over ((pElimData_valid F Y α z.down.1.1) z.down.1.2) (pElimData_H_of_isHereditarilyNatural F Y α z.down.1 ((pElimData_valid F Y α z.down.1.1) z.down.1.2) z.down.2.2)).trans (pElimData_index F Y α z.down.1.1)).trans z.down.2.1)) ((pElimData F Y α z.down.1.1).value ((pElimData_valid F Y α z.down.1.1) z.down.1.2) (pElimData_H_of_isHereditarilyNatural F Y α z.down.1 ((pElimData_valid F Y α z.down.1.1) z.down.1.2) z.down.2.2)).2

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.

theorem value_eq_elimVal {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (Y : Iᵒᵖ Type (max uI uA uB)) (α : NatTrans (F.objPresheaf Y) Y) {j : I} (z : (F.W).obj j) (hv : (pElimData F Y α z.down.1.1).valid) (hn : (pElimData F Y α z.down.1.1).H hv) : (pElimData F Y α z.down.1.1).value hv hn = j, elimVal F Y α z := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yj:Iz:F.W.obj (Opposite.op j)hv:(pElimData F Y α z.down).validhn:(pElimData F Y α z.down).H hv(pElimData F Y α z.down).value hv hn = j, elimVal F Y α z I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yj:Iz:F.W.obj (Opposite.op j)hv:(pElimData F Y α z.down).validhn:(pElimData F Y α z.down).H hv((pElimData F Y α z.down).value hv hn).snd j, elimVal F Y α z.snd All goals completed! 🐙

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.

theorem elimVal_wRestr {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (Y : Iᵒᵖ Type (max uI uA uB)) (α : NatTrans (F.objPresheaf Y) Y) i i' : I (g : i' i) (z : (F.W).obj i) : elimVal F Y α ((F.W).map g.op z) = Y.map g.op (elimVal F Y α z) := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yi:Ii':Ig:i' iz:F.W.obj (Opposite.op i)elimVal F Y α ((ConcreteCategory.hom (F.W.map g.op)) z) = (ConcreteCategory.hom (Y.map g.op)) (elimVal F Y α z) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yi:Ii':Ig:i' iz:F.W.obj (Opposite.op i)hvz:(pElimData F Y α z.down).validelimVal F Y α ((ConcreteCategory.hom (F.W.map g.op)) z) = (ConcreteCategory.hom (Y.map g.op)) (elimVal F Y α z) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yi:Ii':Ig:i' iz:F.W.obj (Opposite.op i)hvz:(pElimData F Y α z.down).validhnz:(pElimData F Y α z.down).H hvzelimVal F Y α ((ConcreteCategory.hom (F.W.map g.op)) z) = (ConcreteCategory.hom (Y.map g.op)) (elimVal F Y α z) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yi:Ii':Ig:i' iz:F.W.obj (Opposite.op i)hvz:(pElimData F Y α z.down).validhnz:(pElimData F Y α z.down).H hvzhvzr:(pElimData F Y α ((ConcreteCategory.hom (F.W.map g.op)) z).down).validelimVal F Y α ((ConcreteCategory.hom (F.W.map g.op)) z) = (ConcreteCategory.hom (Y.map g.op)) (elimVal F Y α z) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yi:Ii':Ig:i' iz:F.W.obj (Opposite.op i)hvz:(pElimData F Y α z.down).validhnz:(pElimData F Y α z.down).H hvzhvzr:(pElimData F Y α ((ConcreteCategory.hom (F.W.map g.op)) z).down).validhnzr:(pElimData F Y α ((ConcreteCategory.hom (F.W.map g.op)) z).down).H hvzrelimVal F Y α ((ConcreteCategory.hom (F.W.map g.op)) z) = (ConcreteCategory.hom (Y.map g.op)) (elimVal F Y α z) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yi:Ii':Ig:i' iz:F.W.obj (Opposite.op i)hvz:(pElimData F Y α z.down).validhnz:(pElimData F Y α z.down).H hvzhvzr:(pElimData F Y α ((ConcreteCategory.hom (F.W.map g.op)) z).down).validhnzr:(pElimData F Y α ((ConcreteCategory.hom (F.W.map g.op)) z).down).H hvzreR:(pElimData F Y α ((ConcreteCategory.hom (F.W.map g.op)) z).down).value hvzr hnzr = i', elimVal F Y α ((ConcreteCategory.hom (F.W.map g.op)) z)elimVal F Y α ((ConcreteCategory.hom (F.W.map g.op)) z) = (ConcreteCategory.hom (Y.map g.op)) (elimVal F Y α z) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yi:Ii':Ig:i' iz:F.W.obj (Opposite.op i)hvz:(pElimData F Y α z.down).validhnz:(pElimData F Y α z.down).H hvzhvzr:(pElimData F Y α ((ConcreteCategory.hom (F.W.map g.op)) z).down).validhnzr:(pElimData F Y α ((ConcreteCategory.hom (F.W.map g.op)) z).down).H hvzreR:(pElimData F Y α ((ConcreteCategory.hom (F.W.map g.op)) z).down).value hvzr hnzr = i', elimVal F Y α ((ConcreteCategory.hom (F.W.map g.op)) z)eW:(pElimData F Y α (F.wRestrTree g z.down )).value hvzr hnzr = i', (ConcreteCategory.hom (Y.map g.op)) (cast ((pElimData F Y α z.down).value hvz hnz).snd)elimVal F Y α ((ConcreteCategory.hom (F.W.map g.op)) z) = (ConcreteCategory.hom (Y.map g.op)) (elimVal F Y α z) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yi:Ii':Ig:i' iz:F.W.obj (Opposite.op i)hvz:(pElimData F Y α z.down).validhnz:(pElimData F Y α z.down).H hvzhvzr:(pElimData F Y α ((ConcreteCategory.hom (F.W.map g.op)) z).down).validhnzr:(pElimData F Y α ((ConcreteCategory.hom (F.W.map g.op)) z).down).H hvzreR:(pElimData F Y α ((ConcreteCategory.hom (F.W.map g.op)) z).down).value hvzr hnzr = i', elimVal F Y α ((ConcreteCategory.hom (F.W.map g.op)) z)eW:(pElimData F Y α (F.wRestrTree g z.down )).value hvzr hnzr = i', (ConcreteCategory.hom (Y.map g.op)) (cast ((pElimData F Y α z.down).value hvz hnz).snd)key:i', elimVal F Y α ((ConcreteCategory.hom (F.W.map g.op)) z) = i', (ConcreteCategory.hom (Y.map g.op)) (elimVal F Y α z)elimVal F Y α ((ConcreteCategory.hom (F.W.map g.op)) z) = (ConcreteCategory.hom (Y.map g.op)) (elimVal F Y α z) All 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] def elim {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (Y : Iᵒᵖ Type (max uI uA uB)) (α : NatTrans (F.objPresheaf Y) Y) : NatTrans F.W Y where app j := fun z elimVal F Y α (j := j.unop) z naturality _ _ g := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yx✝¹:Iᵒᵖx✝:Iᵒᵖg:x✝¹ x✝(F.W.map g fun z elimVal F Y α z) = (fun z elimVal F Y α z) Y.map g I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yx✝¹:Iᵒᵖx✝:Iᵒᵖg:x✝¹ x✝z:F.W.obj x✝¹(ConcreteCategory.hom (F.W.map g fun z elimVal F Y α z)).toFun z = (ConcreteCategory.hom ((fun z elimVal F Y α z) Y.map g)).toFun z All 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.

theorem comp_elim {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (Y : Iᵒᵖ Type (max uI uA uB)) (α : NatTrans (F.objPresheaf Y) Y) i i' : I (g : i' i) (z : (F.W).obj i) : (elim F Y α).app i' ((F.W).map g.op z) = Y.map g.op ((elim F Y α).app i z) := elimVal_wRestr F Y α g z

The computation rule for elim: it commutes with the constructor mk, i.e. it is a morphism of presheaf algebras.

theorem elim_mk {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (Y : Iᵒᵖ Type (max uI uA uB)) (α : NatTrans (F.objPresheaf Y) Y) {j : I} (x : (F.objPresheaf F.W).obj j) : (elim F Y α).app j (mk x) = α.app j ((F.mapPresheaf (elim F Y α)).app j x) := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yj:Ix:(F.objPresheaf F.W).obj (Opposite.op j)(ConcreteCategory.hom ((elim F Y α).app (Opposite.op j))) (mk x) = (ConcreteCategory.hom (α.app (Opposite.op j))) ((ConcreteCategory.hom ((F.mapPresheaf (elim F Y α)).app (Opposite.op j))) x) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yj:Ix:(F.objPresheaf F.W).obj (Opposite.op j)hv:(pElimData F Y α (mk x).down).valid(ConcreteCategory.hom ((elim F Y α).app (Opposite.op j))) (mk x) = (ConcreteCategory.hom (α.app (Opposite.op j))) ((ConcreteCategory.hom ((F.mapPresheaf (elim F Y α)).app (Opposite.op j))) x) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yj:Ix:(F.objPresheaf F.W).obj (Opposite.op j)hv:(pElimData F Y α (mk x).down).validhn:(pElimData F Y α (mk x).down).H hv(ConcreteCategory.hom ((elim F Y α).app (Opposite.op j))) (mk x) = (ConcreteCategory.hom (α.app (Opposite.op j))) ((ConcreteCategory.hom ((F.mapPresheaf (elim F Y α)).app (Opposite.op j))) x) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yj:Ix:(F.objPresheaf F.W).obj (Opposite.op j)hv:(pElimData F Y α (mk x).down).validhn:(pElimData F Y α (mk x).down).H hvhq:F.q (↑x).fst = j(ConcreteCategory.hom ((elim F Y α).app (Opposite.op j))) (mk x) = (ConcreteCategory.hom (α.app (Opposite.op j))) ((ConcreteCategory.hom ((F.mapPresheaf (elim F Y α)).app (Opposite.op j))) x) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yj:Ix:(F.objPresheaf F.W).obj (Opposite.op j)hv:(pElimData F Y α (mk x).down).validhn:(pElimData F Y α (mk x).down).H hvhq:F.q (↑x).fst = jhchild: (b : F.B (↑x).fst), (pElimData F Y α ((↑x).snd b).snd.down).value = ((↑x).snd b).fst, elimVal F Y α ((↑x).snd b).snd(ConcreteCategory.hom ((elim F Y α).app (Opposite.op j))) (mk x) = (ConcreteCategory.hom (α.app (Opposite.op j))) ((ConcreteCategory.hom ((F.mapPresheaf (elim F Y α)).app (Opposite.op j))) x) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yj:Ix:(F.objPresheaf F.W).obj (Opposite.op j)hv:(pElimData F Y α (mk x).down).validhn:(pElimData F Y α (mk x).down).H hvhq:F.q (↑x).fst = jhchild: (b : F.B (↑x).fst), (pElimData F Y α ((↑x).snd b).snd.down).value = ((↑x).snd b).fst, elimVal F Y α ((↑x).snd b).sndhval:(pElimData F Y α (mk x).down).value hv hn = j, elimVal F Y α (mk x)(ConcreteCategory.hom ((elim F Y α).app (Opposite.op j))) (mk x) = (ConcreteCategory.hom (α.app (Opposite.op j))) ((ConcreteCategory.hom ((F.mapPresheaf (elim F Y α)).app (Opposite.op j))) x) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yj:Ix:(F.objPresheaf F.W).obj (Opposite.op j)hv:(pElimData F Y α (mk x).down).validhn:(pElimData F Y α (mk x).down).H hvhq:F.q (↑x).fst = jhchild: (b : F.B (↑x).fst), (pElimData F Y α ((↑x).snd b).snd.down).value = ((↑x).snd b).fst, elimVal F Y α ((↑x).snd b).sndhval:(pElimData F Y α (mk x).down).value hv hn = j, elimVal F Y α (mk x)(ConcreteCategory.hom ((elim F Y α).app (Opposite.op j))) (mk x) (ConcreteCategory.hom (α.app (Opposite.op j))) ((ConcreteCategory.hom ((F.mapPresheaf (elim F Y α)).app (Opposite.op j))) x) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yj:Ix:(F.objPresheaf F.W).obj (Opposite.op j)hv:(pElimData F Y α (mk x).down).validhn:(pElimData F Y α (mk x).down).H hvhq:F.q (↑x).fst = jhchild: (b : F.B (↑x).fst), (pElimData F Y α ((↑x).snd b).snd.down).value = ((↑x).snd b).fst, elimVal F Y α ((↑x).snd b).sndhval:(pElimData F Y α (mk x).down).value hv hn = j, elimVal F Y α (mk x)((pElimData F Y α (mk x).down).value hv hn).snd (ConcreteCategory.hom (α.app (Opposite.op j))) ((ConcreteCategory.hom ((F.mapPresheaf (elim F Y α)).app (Opposite.op j))) x) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yj:Ix:(F.objPresheaf F.W).obj (Opposite.op j)hv:(pElimData F Y α (mk x).down).validhn:(pElimData F Y α (mk x).down).H hvhq:F.q (↑x).fst = jhchild: (b : F.B (↑x).fst), (pElimData F Y α ((↑x).snd b).snd.down).value = ((↑x).snd b).fst, elimVal F Y α ((↑x).snd b).sndhval:(pElimData F Y α (mk x).down).value hv hn = j, elimVal F Y α (mk x)pNodeSlice (↑(forgetNode F x)).fst, fun b WType.elim (PElimData F Y) (pElimStep F Y α) ((Subtype.val (↑(forgetNode F x)).snd) b).snd hv , , (ConcreteCategory.hom ((F.mapPresheaf (elim F Y α)).app (Opposite.op j))) x I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yj:Ix:(F.objPresheaf F.W).obj (Opposite.op j)hv:(pElimData F Y α (mk x).down).validhn:(pElimData F Y α (mk x).down).H hvhq:F.q (↑x).fst = jhchild: (b : F.B (↑x).fst), (pElimData F Y α ((↑x).snd b).snd.down).value = ((↑x).snd b).fst, elimVal F Y α ((↑x).snd b).sndhval:(pElimData F Y α (mk x).down).value hv hn = j, elimVal F Y α (mk x)pNodeSlice (↑(forgetNode F x)).fst, fun b WType.elim (PElimData F Y) (pElimStep F Y α) ((Subtype.val (↑(forgetNode F x)).snd) b).snd hv , , = ((ConcreteCategory.hom ((F.mapPresheaf (elim F Y α)).app (Opposite.op j))) x) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yj:Ix:(F.objPresheaf F.W).obj (Opposite.op j)hv:(pElimData F Y α (mk x).down).validhn:(pElimData F Y α (mk x).down).H hvhq:F.q (↑x).fst = jhchild: (b : F.B (↑x).fst), (pElimData F Y α ((↑x).snd b).snd.down).value = ((↑x).snd b).fst, elimVal F Y α ((↑x).snd b).sndhval:(pElimData F Y α (mk x).down).value hv hn = j, elimVal F Y α (mk x)pNodeSlice (↑(forgetNode F x)).fst, fun b WType.elim (PElimData F Y) (pElimStep F Y α) ((Subtype.val (↑(forgetNode F x)).snd) b).snd hv , , = ((ConcreteCategory.hom ((F.mapPresheaf (elim F Y α)).app (Opposite.op j))) x) I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I IY:Iᵒᵖ Type (max uI uA uB)α:NatTrans (F.objPresheaf Y) Yj:Ix:(F.objPresheaf F.W).obj (Opposite.op j)hv:(pElimData F Y α (mk x).down).validhn:(pElimData F Y α (mk x).down).H hvhq:F.q (↑x).fst = jhchild: (b : F.B (↑x).fst), (pElimData F Y α ((↑x).snd b).snd.down).value = ((↑x).snd b).fst, elimVal F Y α ((↑x).snd b).sndhval:(pElimData F Y α (mk x).down).value hv hn = j, elimVal F Y α (mk x)pNodeSlice (↑(forgetNode F x)).fst, fun b WType.elim (PElimData F Y) (pElimStep F Y α) ((Subtype.val (↑(forgetNode F x)).snd) b).snd hv , , = ((ConcreteCategory.hom ((F.mapPresheaf (elim F Y α)).app (Opposite.op j))) x) All goals completed! 🐙
end W

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] def MemW {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (j : I) (w : F.toPFunctor.W) : Prop := hw : F.toSlicePFunctor.WValid w, F.toSlicePFunctor.wIndex w, hw = j F.IsHereditarilyNatural w, hw

MemW holds exactly of the trees underlying the carrier presheaf's fiber over j.

theorem memW_iff_exists_obj {I : Type uI} [Category.{vI} I] (F : PresheafPFunctor.{uI, uI, uA, uB, vI, vI} I I) (j : I) (w : F.toPFunctor.W) : F.MemW j w u : (F.W).obj j, u.down.1.1 = w := I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Iw:F.WF.MemW j w u, u.down = w I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Iw:F.WF.MemW j w u, u.down = wI:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Iw:F.W(∃ u, u.down = w) F.MemW j w I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Iw:F.WF.MemW j w u, u.down = w I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Iw:F.Whw:F.toSlicePFunctor.WValid whq:F.toSlicePFunctor.wIndex w, hw = jhn:F.IsHereditarilyNatural w, hw u, u.down = w All goals completed! 🐙 I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Iw:F.W(∃ u, u.down = w) F.MemW j w I:Type uIinst✝:Category.{vI, uI} IF:PresheafPFunctor I Ij:Iw':F.toSlicePFunctor.Whw':F.toSlicePFunctor.WValid w'hq:F.toSlicePFunctor.wIndex w', hw' = Opposite.unop (Opposite.op j)hn:F.IsHereditarilyNatural w', hw'F.MemW j { down := w', hw', }.down All goals completed! 🐙
end PresheafPFunctor