Applied category theory extensions for catgraph. Anchored to Fong & Spivak, Seven Sketches in Compositionality (arXiv:1803.05316v3, 2018), Chapters 4–6.
This crate packages applied-CT modules that build on catgraph's strict Fong-Spivak 2019 core but are not part of the 2019 paper's numbered content. It is the applied-CT complement to the F&S core crate.
| Module | Purpose |
|---|---|
decorated_cospan |
Generic Decoration trait + DecoratedCospan<Lambda, D> realizing F&S Def 6.75 + Thm 6.77 |
wiring_diagram |
Operadic substitution built on named cospans |
petri_net |
Place/transition nets with cospan bridge, firing, reachability, parallel/sequential composition, HypergraphCategory impl, PetriDecoration bridge to DecoratedCospan |
temperley_lieb |
Temperley-Lieb / Brauer algebra via perfect matchings |
linear_combination |
Formal linear combinations over a coefficient ring |
e1_operad |
Little-intervals operad (E₁) |
e2_operad |
Little-disks operad (E₂) |
prop |
Symmetric strict monoidal categories with Ob = ℕ and the free prop Free(G) on a signature (F&S Def 5.2, Def 5.25; v0.4.0); Presentation<G> with 8-rule SMC quotient (Def 5.33; v0.5.0) |
operad_algebra |
Single-sorted operad algebras F : O → Set with concrete CircAlgebra for WiringDiagram (F&S Def 6.99, Ex 6.100; v0.4.0) |
operad_functor |
Functors between operads with the canonical E₁ ↪ E₂ inclusion (F&S Rough Def 6.98; v0.4.0) |
rig |
Rig trait (semiring) + BoolRig, UnitInterval, Tropical, F64Rig instances (F&S Def 5.36; v0.5.0) |
sfg |
SignalFlowGraph<R> — free prop on signal-flow generators (F&S Def 5.45; v0.5.0) |
mat |
MatR<R> — pure-rig matrix prop over any Rig R (F&S Def 5.50; v0.5.0) |
sfg_to_mat |
sfg_to_mat functor S: SFG_R → Mat(R) (F&S Thm 5.53; v0.5.0) |
graphical_linalg |
matr_presentation<R> — 16-equation Thm 5.60 presentation of Mat(R) (F&S §5.4; v0.5.0, PARTIAL — string-diagram normal form deferred to v0.5.2) |
mat_f64 (feature f64-rig) |
nalgebra bridge for MatR<F64Rig>: determinant, inverse, DMatrix roundtrip (v0.5.0) |
prop::presentation::kb |
Congruence-closure decision procedure (DST 1980 signature-table variant) — default eq_mod backend since v0.5.1 |
enriched |
EnrichedCategory<V> trait + HomMap<O, V> finite realization (F&S §1.1, §2.4; v0.5.1) |
lawvere_metric |
LawvereMetricSpace<T> over Tropical — triangle-inequality verifier + -ln π embedding from UnitInterval (Lawvere 1973; v0.5.1) |
prop::presentation::kb— congruence-closure decision procedure forPresentation(replaces bounded structural rewriting as the defaulteq_modbackend).enriched::EnrichedCategory<V>— V-enriched categories over aRig. Object-safe for heterogeneousdyncollections.lawvere_metric::LawvereMetricSpace<T>— Lawvere metric spaces overTropicalwith triangle-inequality verification.
BREAKING: Presentation::normalize / eq_mod signatures changed.
PropSignature widened to Eq + Hash. See CHANGELOG.md for migration.
Known gap: Thm 5.60 faithfulness tests remain #[ignore]'d pending
SMC string-diagram normal form (v0.5.2).
Every module depends on catgraph's public API:
Cospan,NamedCospan,Span,Rel— pushout/pullback compositionFrobeniusgenerators — operadic composition of SMCs (Prop 3.8)HypergraphCategorytrait — target for semantic functorsOperadictrait — abstract substitution interface (concrete impls live here)compact_closedcup/cap — string-diagram rewriting (TL, wiring)
See docs/SEVEN-SKETCHES-AUDIT.md for the section-by-section Seven Sketches coverage audit (Chapters 4–6, 60 items tracked; v0.5.1 headline: 83% of implementable items DONE). Cross-linked from ../catgraph/docs/FONG-SPIVAK-AUDIT.md "Reconciliation" section.
See CHANGELOG.md for release history.
cargo test -p catgraph-applied
cargo clippy -p catgraph-applied -- -W clippy::pedantic[features] parallel (default-on) gates the rayon + rayon-cond
dependencies and the four CondIterator call sites in
linear_combination::Mul::mul, linear_combination::linear_combine, and
temperley_lieb::BrauerMorphism::non_crossing (source + target sides).
Disable with --no-default-features for single-threaded WASI hosts.
cargo build --lib -p catgraph-applied --target wasm32-wasip1-threads
cargo build --lib -p catgraph-applied --target wasm32-wasip1 --no-default-featuresSee examples/wasi_smoke_applied.rs for a minimal LinearCombination
multiplication smoke test exercising the CondIterator parallel arm.
MIT.