Integrates the parallel agent work (slice computation, degeneracy
factorisation, explosion) with the normalisation implementation.
Added to DiagramMap:
- compose(): Compose two diagram maps
- has_singular_height_in_image(): Check if height is in singular image
All 77 tests pass.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Complete implementation of the zigzag normalisation algorithm from the
LICS 2022 paper "Zigzag normalisation for associative n-categories".
Key changes:
- diagram.rs: Add DiagramMap composition, singular_map extraction
- degeneracy.rs: Add extract_singular_map() and height checking functions
- normalise.rs: Complete Construction 17 with essential identity detection
The algorithm:
1. Recursively normalise at each regular height
2. Recursively normalise at each singular height with cospan leg composites
3. Assemble into intermediate diagram P
4. Remove trivial cospans (ONLY if identity AND not in sink image)
5. Compose degeneracies: d = dP ∘ dS
Critical: In dimension >= 4, some identity cospans are ESSENTIAL and must
be preserved if they are in the image of any sink map.
All 57 tests pass.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Complete the explosion module for layout computation:
- Poset methods: is_less_than, less_than_or_equal, is_comparable,
minimal_elements, maximal_elements, topological_sort
- Covering relations: compute_covers() from poset ordering
- k_points: Full implementation with proper covering relation computation
- Point ordering: Product ordering on height labels with zigzag structure
- HeightLabel ordering: r_j < s_j < r_{j+1} within each dimension
- Injectification stub for future layout integration
The poset structure captures the combinatorial data needed for
embedding Pt_n(X) -> R^n in the layout algorithm.
All 55 tests pass.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Core degeneracy infrastructure from the LICS 2022 paper:
- Simple degeneracy detection: Checks that the singular map is injective
(composition of face maps) and all slice maps are identities.
- Parallel degeneracy detection: Checks that the singular map is the
identity (no cones in RewriteN) and all slice maps are degeneracies.
- Degeneracy detection: Combines simple and parallel checks.
- Factorisation (Lemma 7): Every degeneracy factors uniquely as
N --simple--> P --parallel--> T.
- Pullback computation (Proposition 13): Given degeneracies f: X -> T
and g: Y -> T, computes the pullback by intersecting images in Delta+.
- Helper functions: simple_degeneracy_at(), extract_singular_map(), etc.
All 53 tests pass.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add the core slice computation functionality for n-diagrams:
- Rewrite::apply_forward/apply_backward: Apply rewrites to transform
diagrams in either direction
- RewriteN::apply_forward/apply_backward: Handle n-dimensional rewrites
by modifying cospan structure via cone contraction/expansion
- DiagramN::regular_slice(h): Compute regular slice at height h by
traversing cospans, applying forward then backward rewrites
- DiagramN::singular_slice(h): Compute singular slice (cospan apex)
by applying forward rewrite to the corresponding regular slice
- DiagramN::target(): Now properly computes the last regular slice
- DiagramN::slices(): Iterator yielding all slices in order r0,s0,r1,...
- DiagramN::regular_slices()/singular_slices(): Filtered iterators
All 48 tests pass.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Initial structure implementing the zigzag construction for associative
n-categories (LICS 2022 paper). Includes:
- monotone.rs: MonotoneMap with Wraith's R equivalence (complete)
- zigzag.rs: Zigzag<T>, ZigzagMap<S> with composition
- diagram.rs: Diagram, DiagramN, Cospan, Rewrite, Cone types
- signature.rs: Generator, Signature (complete)
- degeneracy.rs: Degeneracy detection stubs
- normalise.rs: Construction 17 algorithm structure
- typecheck.rs: Type checking against signatures
- explosion.rs: k-points and Poset for layout
- layout.rs: SpringConstraint API surface
All 33 unit tests pass.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>