karpal-higher
2-categories, enriched categories, and bicategories for the Industrial Algebra ecosystem.
karpal-higher implements Phase 15 of the Karpal roadmap:
- TwoCategory — strict 2-categories with objects, 1-morphisms, and 2-morphisms
- Bicategory — weakened 2-categories with associator and unitors as isomorphisms
- EnrichedCategory — categories enriched over a monoidal base (Set, Monoid)
- FFunctor / FMonad — functors and monads at the 2-categorical level
- Coherence witnesses — interchange, pentagon, and triangle identities as type-level proofs
- Verification integration — certificates for coherence laws via karpal-verify
Example
use ;
// Cat: the strict 2-category of categories
let id: = id1;
assert_eq!;
let f: = Boxnew;
let g: = Boxnew;
let gf = compose1;
assert_eq!; // (5+1)*2
// Coherence witnesses
use verify_interchange;
let _proof = verify_interchange;
// Verification certificates
use higher_coherence_certificates;
let certs = higher_coherence_certificates;
assert_eq!; // interchange, pentagon, triangle
License
Apache-2.0