1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use ;
use crateRing;
/// A graded module over a coefficient ring `Coeffs`, constructed with a context `Ctx`.
///
/// A graded module is a module `M = ⊕ M_n` decomposed as a direct sum of homogeneous
/// pieces indexed by degree. The standard module operations (addition, subtraction,
/// scalar multiplication) must respect this grading.
///
/// The `Ctx` parameter carries any runtime information needed to construct elements —
/// for example, a plain algebra may use `()`, while a differential graded algebra
/// uses `Arc<F>` to share the differential across all elements of the same instance.
///
/// Implementors must provide:
/// - [`zero`]: the additive identity, built from a context
/// - [`extract_homogeneous`]: split off the degree-`n` component from a mixed element