refactor(displayed): use algebra terminology - #75
Merged
Merged
Conversation
quangvdao
marked this pull request as ready for review
July 17, 2026 12:14
quangvdao
marked this pull request as draft
July 18, 2026 07:19
quangvdao
force-pushed
the
refactor/displayed-algebra-names
branch
3 times, most recently
from
July 18, 2026 07:50
6800be1 to
0dc493d
Compare
quangvdao
marked this pull request as ready for review
July 18, 2026 07:53
This was referenced Jul 18, 2026
quangvdao
force-pushed
the
agent/pfunctor-display
branch
from
July 18, 2026 19:04
c4e2448 to
81a61aa
Compare
quangvdao
force-pushed
the
refactor/displayed-algebra-names
branch
from
July 18, 2026 19:16
0dc493d to
9f68b3d
Compare
dtumad
approved these changes
Jul 19, 2026
dtumad
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed the complete Shape/LocalHom to Algebra/LocalMap migration. The new names better reflect that arbitrary local maps do not carry categorical laws, the public surface and tests are consistent, and no stale declarations remain. No blocking findings.
dtumad
force-pushed
the
refactor/displayed-algebra-names
branch
from
July 19, 2026 02:38
9f68b3d to
4a15062
Compare
dtumad
approved these changes
Jul 19, 2026
dtumad
left a comment
Collaborator
There was a problem hiding this comment.
Re-reviewed the restacked head. Range-diff shows both reviewed commits are patch-identical to the prior series, now based directly on current main; the endpoint diff is clean.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and context
PR #74 introduces
PFunctor.Display, the one-step dependent-polynomial layer needed for Aberle's compositional verification development. That work exposes an older naming problem:FreeM.Displayed.Shapeis not a polynomial shape. It is a large,Sort-valued leaf/node algebra that computes a fiber recursively over a free tree.The distinction matters:
PFunctor.Display Pis one-step polynomial data displayed overP. Itspositionanddirectionfields areType-valued, and its polynomial object action supports dependent substitution.FreeM.Displayed.Algebra P αis a generic higher-order recursion algebra. Itsnodemay use child fibers arbitrarily, including negatively or nonfunctorially.FreeM.Displayed D sevaluates that algebra at a concrete free tree.FreeM.Displayed.Over.Algebra Dis a dependent second algebra over inhabitants of the first evaluated fiber;FreeM.Displayed.Over R s devaluates it.This PR gives those levels names that describe their actual semantics before the Aberle theory is built on top of them.
Final naming model
Displayed.ShapeDisplayed.AlgebraDisplayed.LocalHomDisplayed.LocalMapDisplayed.OverShapeDisplayed.Over.AlgebraDisplayed.Over.LocalHomDisplayed.Over.LocalMapLocalMapDisplayed.Over.FiberLocalHomDisplayed.Over.FiberLocalMapDisplayed.TotalDisplayed.Over.TotalThe evaluated maps keep the categorical name:
Displayed.Hom D Emaps evaluated fibers over every tree and has extensionality, identity, composition, and associativity;Displayed.Over.Hom η R Sdoes the same for evaluated second-layer fibers;LocalMap.toHom,Over.LocalMap.toHom, andOver.FiberLocalMap.toHomrecursively interpret local rules as genuine evaluated morphisms.Why not
AlgHom?An early version of this PR followed the usual mathlib abbreviation and called the local records
AlgHom. Independent review found that this was mathematically false for the abstraction actually supported by the library.For an arbitrary negative
Algebra.node, constructor-local transformation data need not admit identity or composition. A unary counterexample isAn identity-like local rule instantiated from source child
PEmptyto target childPUnitwould producePUnit → PEmpty. Therefore the object may correctly be called anAlgebra, but its local rule is only aLocalMap;Homis reserved for the evaluated layer where the categorical laws really hold.This is also why the PR does not add local
idorcompoperations.API consolidation
The rename updates the whole owned surface together:
mapLeafandmapNode;children,sourceChildren, andtargetChildren;Section.ofConstructbecomesSection.ofConstructors;Displayed.Sectionis documented as a global dependent section, whileSection.ofConstructorsis the constructor-local fold;liftBind;Decoration.algebra,Decoration.Over.algebra,Path.algebra, andPathAlong.algebra;Decoration.localMap,Decoration.Over.fiberLocalMap,Decoration.Over.baseLocalMap, andprojectPathAlongLocalMap;Displayed.Algebra.ChildProjectionandDisplayed.Over.Algebra.ChildProjection, with fieldproject;Display.toDisplayedShapebecomesDisplay.toDisplayedAlgebra;The change is intentionally alias-free: this surface is still in the open foundation stack, so retaining the old terminology would create a permanent duplicate API before release.
Proof-engineering findings
The review also identified representation-exposing proofs introduced during the first mechanical rename. Repeated tuple
changeblocks were replaced with owner-level recursion equations and explicitFreeM.liftBind_eqnormalization at constructor-shaped goals.One localized tuple normalization remains in
Decoration.map_ofOver. This is intentional: rewriting its tree index first makes the dependent decoration argument ill-typed at tactic transparency, while the environment'ssimpNFlinter requires the public simp equations inlift.bindnormal form. A one-use helper would only relocate the same concrete packing dependency, so no public API was added to hide it.The exact-head full build additionally caught two downstream rewrite consumers (
TwoParty.SwapandConcurrent.Process); both now normalize explicitly before applyingDecoration.map_liftBind.What this PR does not do
DisplaywithDisplayed.Algebra: the former is the polynomial sublanguage; the latter is strictly more general.DependentPFunctororFreeDep.AlgHomname.Relationship to #74 and later work
This PR is one commit stacked directly on #74:
81a61aa3c2abdfd563cb91451220f6bc96af72cc9f68b3da59b3bf59c38527415164dd2f1ebd0c1fIt should merge after #74. Subsequent Aberle general-theory PRs should use this head (or
mainafter both merge), so the Display and Displayed layers have a stable vocabulary.Validation and review
./scripts/validate.sh --lint --testpasses at the exact head:lake exe lint-styleandgit diff --checkpass.sorry,admit,stop, newunsafe, axiom, or linter suppression.Lint Styleand PR-summary checks pass. Full hosted build CI is absent because this stacked PR targets a non-default branch; local full validation is the authoritative gate.review-lean-formalizationreview found the falseAlgHomabstraction and the documentation/proof issues described above. The repair re-review confirms the mathematical issue is resolved, accepts the localizedmap_ofOvernormalization, and found no remaining code/API issue after the final stale Path docstring was corrected.This PR is ready for inspection but is not being merged here.
Final restack and audit (2026-07-19)
This final record supersedes earlier candidate SHA and count language above.
81a61aa3c2abdfd563cb91451220f6bc96af72cc(feat(pfunctor): add polynomial displays #74)9f68b3da59b3bf59c38527415164dd2f1ebd0c1fThe second commit is a narrow restack compatibility repair: the new heterogeneous-universe canaries inherited from #74 now use the renamed
toDisplayedAlgebraAPI. No compatibility aliases or stale old identifiers were introduced. Independent exact-head review found zero P0-P3 code/API findings and reconfirmed theAlgebra/LocalMap/ evaluatedHomnaming boundary.Fresh exact-head
./scripts/validate.sh --lint --testpassed: 8,838 build jobs, generated imports, docs integrity, environment lint, and the full test library. Style and diff checks pass. Because this PR targets a non-default stacked branch, hosted style and summary are the hosted gates; the full local validator is authoritative.