use crate::Primitives;
pub trait Simplex<P: Primitives> {
fn dimension(&self) -> P::Integer;
type Constraint: crate::user::type_::Constraint<P>;
fn vertex(&self) -> &[Self::Constraint];
fn vertex_count(&self) -> P::PositiveInteger;
type SimplexTarget: Simplex<P>;
fn is_face_of(&self) -> &[Self::SimplexTarget];
type FiberCoordinate: crate::bridge::partition::FiberCoordinate<P>;
fn pin_intersection(&self) -> &[Self::FiberCoordinate];
}
pub trait SimplicialComplex<P: Primitives> {
type Simplex: Simplex<P>;
fn has_simplex(&self) -> &[Self::Simplex];
fn max_dimension(&self) -> P::Integer;
fn euler_characteristic(&self) -> P::Integer;
fn simplicial_vertex_count(&self) -> P::NonNegativeInteger;
}
pub trait FaceMap<P: Primitives> {
fn removes_vertex(&self) -> P::NonNegativeInteger;
type Simplex: Simplex<P>;
fn source_simplex(&self) -> &Self::Simplex;
fn target_face(&self) -> &Self::Simplex;
}
pub trait ChainGroup<P: Primitives> {
fn degree(&self) -> P::Integer;
type Simplex: Simplex<P>;
fn generated_by(&self) -> &[Self::Simplex];
}
pub trait BoundaryOperator<P: Primitives> {
type ChainGroup: ChainGroup<P>;
fn source_group(&self) -> &Self::ChainGroup;
fn target_group(&self) -> &Self::ChainGroup;
fn satisfies_boundary_squared_zero(&self) -> P::Boolean;
}
pub trait ChainComplex<P: Primitives> {
type ChainGroup: ChainGroup<P>;
fn has_chain_group(&self) -> &[Self::ChainGroup];
type BoundaryOperator: BoundaryOperator<P>;
fn has_boundary(&self) -> &[Self::BoundaryOperator];
}
pub trait HomologyGroup<P: Primitives> {
fn homology_degree(&self) -> P::Integer;
fn betti_number(&self) -> P::NonNegativeInteger;
}
pub trait NerveFunctor<P: Primitives> {}
pub trait ChainFunctor<P: Primitives> {}
pub trait KanComplex<P: Primitives>: SimplicialComplex<P> {
type HornFiller: HornFiller<P>;
fn kan_witness(&self) -> &[Self::HornFiller];
}
pub trait HornFiller<P: Primitives> {
fn horn_dimension(&self) -> P::NonNegativeInteger;
fn horn_position(&self) -> P::NonNegativeInteger;
}
pub trait PostnikovTruncation<P: Primitives> {
fn truncation_level(&self) -> P::NonNegativeInteger;
type KanComplex: KanComplex<P>;
fn truncation_source(&self) -> &Self::KanComplex;
type KInvariant: KInvariant<P>;
fn k_invariant(&self) -> &Self::KInvariant;
}
pub trait KInvariant<P: Primitives> {
fn k_invariant_trivial(&self) -> P::Boolean;
}
pub trait DeformationComplex<P: Primitives>: ChainComplex<P> {
type CompleteType: crate::user::type_::CompleteType<P>;
fn deformation_base(&self) -> &Self::CompleteType;
fn tangent_dimension(&self) -> P::NonNegativeInteger;
fn obstruction_dimension(&self) -> P::NonNegativeInteger;
}
pub mod boundary_squared_zero {
pub const FOR_ALL: &str = "c ∈ C_{k+1}";
pub const LHS: &str = "∂_k(∂_{k+1}(c))";
pub const RHS: &str = "0";
pub const VERIFICATION_DOMAIN: &str = "https://uor.foundation/op/Topological";
pub const VERIFICATION_PATH_NOTE: &str = "ChainComplex → BoundaryOperator → ∂² = 0";
}
pub mod nerve_functor_n {}
pub mod chain_functor_c {}
pub mod psi_4 {
pub const FOR_ALL: &str = "simplicial complex K";
pub const LHS: &str = "β_k(K)";
pub const RHS: &str = "rank(H_k(K))";
pub const VERIFICATION_DOMAIN: &str = "https://uor.foundation/op/Topological";
pub const VERIFICATION_PATH_NOTE: &str = "HomologyGroup → rank → BettiNumber";
}
pub mod index_bridge {
pub const FOR_ALL: &str = "finite simplicial complex K";
pub const LHS: &str = "χ(K)";
pub const RHS: &str = "Σ_k (-1)^k β_k";
pub const VERIFICATION_DOMAIN: &str = "https://uor.foundation/op/Topological";
pub const VERIFICATION_PATH_NOTE: &str =
"SimplicialComplex → ChainComplex → HomologyGroup → BettiNumber → alternating sum";
}