Decidability of the slice functor's fiber and compatibility predicates
SliceDomPFunctor.DirectionOver / SlicePFunctor.ShapeOver are equalities
against a base or output index, decidable given decidable equality on that
index. A quantifier over the directions of a shape lying over an index is
decidable given PFunctor.Finitary, via FinEnum.decidableForallSubtype.
SliceDomPFunctor.Compatible is, by definition, an equality of functions out
of the (finitary) direction type, decidable via FinEnum.decidablePiFinEnum.
SlicePFunctor.WValid is decidable via a WType.elim fold computing
admissibility alongside the root index in a single pass.
Main definitions
SliceDomPFunctor.decidableDirectionOver — decidability of
DirectionOver.
SlicePFunctor.decidableShapeOver — decidability of ShapeOver.
SliceDomPFunctor.decidableForallDirection — decidability of a
quantifier over the directions of a shape lying over an index.
SliceDomPFunctor.decidableCompatible — decidability of Compatible.
SlicePFunctor.wValidData — the WType.elim fold computing a tree's
root index and admissibility together.
SlicePFunctor.decidableWValid — decidability of WValid.
A quantifier over the directions of shape a lying over i is
decidable. Stated at Direction rather than left to
FinEnum.decidableForallSubtype: Direction is a def, and instance
resolution does not unfold it to a Subtype.
Compatibility of a direction assignment with a projection is
decidable: Compatible p a v is by definition the function equality
p ∘ v = F.r ∘ Sigma.mk a out of the finite direction type, decided by
FinEnum.decidablePiFinEnum.
The algebra of the WValid fold: a node's index is its shape's
output index, and it is admitted when every child is admitted and the
children's index family equals the direction-input map. The Bool
analogue of wIndexStep.
@[`@[expose]` has no effect outside a `module` fileexpose]defwValidStep{I:TypeuI}(F:SlicePFunctor.{uA,uB,uI,uI}II)[F.Finitary][DecidableEqI]:F.toPFunctor.Obj(I×Bool)→I×Bool:=funx↦(F.qx.1,decide(∀b,(x.2b).2=true)&&decide(∀b,(x.2b).1=F.rCurriedx.1b))
The WValid fold: index and admissibility computed together, by a
single WType.elim at the carrier I × Bool. The index must be carried
even though it is non-recursive, because the step sees the children's
results and never the children.
@[`@[expose]` has no effect outside a `module` fileexpose]defwValidData{I:TypeuI}(F:SlicePFunctor.{uA,uB,uI,uI}II)[F.Finitary][DecidableEqI]:F.toPFunctor.W→I×Bool:=WType.elim(I×Bool)(F.wValidStep)
The admissibility component of the fold.
@[`@[expose]` has no effect outside a `module` fileexpose]defwValidBool{I:TypeuI}(F:SlicePFunctor.{uA,uB,uI,uI}II)[F.Finitary][DecidableEqI]:F.toPFunctor.W→Bool:=funw↦(F.wValidDataw).2
The index component of the fold is the root index.