comodules/comodule/
traits.rs

1use std::sync::Arc;
2
3use crate::linalg::{graded::BasisElement, grading::Grading};
4
5pub trait Comodule<G: Grading>: Sized {
6    type Element: BasisElement;
7    type Coalgebra;
8    type Morphism: ComoduleMorphism<G, Self>;
9
10    fn zero_comodule(coalgebra: Arc<Self::Coalgebra>) -> Self;
11
12    // This is not the correct type yet
13    fn get_generators(&self) -> Vec<(usize, G, Option<String>)>;
14
15    fn fp_comodule(coalgebra: Arc<Self::Coalgebra>) -> Self;
16
17    fn direct_sum(&mut self, other: &mut Self);
18
19    fn cofree_comodule(coalgebra: Arc<Self::Coalgebra>, index: usize, grade: G, limit: G) -> Self;
20}
21
22pub trait ComoduleMorphism<G: Grading, M: Comodule<G>> {
23    fn cokernel(&self) -> Self;
24    fn inject_codomain_to_cofree(&self, limit: G) -> Self; // Question: Shouldn't 'codomain' be 'cokernel'/'comodule'?
25
26    fn zero_morphism(comodule: Arc<M>) -> Self;
27
28    // domain l == codomain r, l \circ r
29    fn compose(l: Self, r: Self) -> Self;
30
31    fn get_codomain(&self) -> Arc<M>;
32
33    /// (s, gen_index) uniquely defines a generator of Ext
34    /// in a specific morphism we only need to know its gen_index
35    /// in the resolution we add the s
36    /// (from_dot, to_dot, value, line_type)
37    fn get_structure_lines(&self) -> Vec<(usize, usize, usize, String)>;
38}
39
40pub trait Tensor<G: Grading> {
41    fn tensor_to_base();
42    fn base_to_tensor();
43
44    fn get_dimension(&self, grading: &G) -> usize;
45}