Menge / Set
Ring
Gruppe / Group
Abelsche Gruppe / Abelian Group
Kรถrper / Field
Division
forget Division
Ring
Set
โ
โโโ> Pos (Adds <= relation)
โโโ> Top (Adds open sets)
โโโ> Met (Adds distance function)
โ
โโโ> Mon (Adds associative '*' and '1')
โ
โโโ> Grp (Adds 'inverse')
โ
โโโ> Ab (Adds commutative rule)
โ
โโโ> Ring (Mixes Ab for '+' and Mon for '*')
โ โ
โ โโโ> CRing (Multiplication is commutative)
โ โ
โ โโโ> Fld (Division is possible)
โ
โโโ> RMod<R: Ring> (Ab + Scalar Multiplication by R)
โ
โโโ> Vect<K: Fld> (RMod where R is a Field)
โ
โโโ> Alg<R: CRing> (RMod that is ALSO a Ring)
// ==========================================
// 1. THE ROOT
// ==========================================
interface Set<T> {
elements: T[];
contains(element: T): boolean;
}
// ==========================================
// 2. ALGEBRA (The "Operators" Branch)
// ==========================================
interface Group<T> extends Set<T> {
operate(a: T, b: T): T; // 1. Closure
identity(): T; // 2. Neutral element (e.g., 0 or 1)
inverse(a: T): T; // 3. Reversibility
}
// Abelian means the order doesn't matter (Commutative)
interface AbelianGroup<T> extends Group<T> {
// Axiom: operate(a,b) === operate(b,a)
}
interface Ring<T> extends AbelianGroup<T> { // Abelian for Addition (+)
multiply(a: T, b: T): T; // Adds a 2nd operator
// Axiom: Distributive law connects (+) and (*)
}
// "Kรถrper" (e.g., Real numbers, Complex numbers)
interface Field<T> extends Ring<T> {
divide(a: T, b: T): T; // Now multiplication is fully reversible too!
}
// "Vektorraum" - Combines an AbelianGroup (Vectors) with a Field (Scalars)
interface VectorSpace<V, S extends Field<S>> extends AbelianGroup<V> {
scale(scalar: S, vector: V): V;
}
// ==========================================
// 3. TOPOLOGY & GEOMETRY (The "Proximity" Branch)
// ==========================================
// "Topologischer Raum" - The most abstract definition of "Shape" and "Limits"
interface TopologicalSpace<T> extends Set<T> {
isOpen(subset: Set<T>): boolean; // Defines what is "near" what, WITHOUT numbers
}
// "Metrischer Raum" - Gives Topology a strict numerical ruler
interface MetricSpace<T> extends TopologicalSpace<T> {
distance(a: T, b: T): number; // Introduces the ruler: d(x,y)
// Axiom: Triangle Inequality d(x,z) <= d(x,y) + d(y,z)
}
// "Mannigfaltigkeit" - Curved space that pretends to be flat
interface Manifold<T> extends TopologicalSpace<T> {
// If you zoom in infinitely close to ANY point, it looks like a flat VectorSpace (R^n)
tangentSpaceAt(point: T): VectorSpace<T, RealNumbers>;
chart(localSubset: Set<T>): FlatCoordinates;
}
// "Riemannsche Mannigfaltigkeit" (General Relativity lives here)
interface RiemannianManifold<T> extends Manifold<T>, MetricSpace<T> {
// Allows you to measure angles and distances on a CURVED surface
metricTensor(point: T, v1: Vector, v2: Vector): number;
}
// ==========================================
// 4. MEASURE THEORY (The "Integration" Branch)
// ==========================================
// "Messraum" - Defines WHAT can be measured (Sigma-Algebra)
interface MeasurableSpace<T> extends Set<T> {
isMeasurable(subset: Set<T>): boolean; // Filters out paradoxes like Banach-Tarski
}
// "Maรraum" - Actually assigns a size/volume/probability to the subsets
interface MeasureSpace<T> extends MeasurableSpace<T> {
measure(subset: Set<T>): number; // Returns "Volume" or "Probability"
integrate(func: Function): number; // Lebesgue Integration (Superior to Riemann!)
}
// ==========================================
// 5. FUNCTIONAL ANALYSIS (The "God-Tier" Branch)
// Where Algebra and Topology implement Multiple Inheritance
// ==========================================
// "Normierter Raum" - A VectorSpace that is also a MetricSpace
interface NormedSpace<V, S> extends VectorSpace<V, S>, MetricSpace<V> {
norm(vector: V): number; // Every vector has an absolute length ||v||
}
// "Banachraum" - A Normed Space with NO HOLES
interface BanachSpace<V, S> extends NormedSpace<V, S> {
isComplete(): boolean; // Axiom: If a sequence looks like it's converging, the limit actually exists inside the space.
}
// "Hilbertraum" - The framework for Quantum Mechanics and infinite-dimensional geometry
interface HilbertSpace<V, S> extends BanachSpace<V, S> {
innerProduct(v1: V, v2: V): S; // Introduces Angles and Orthogonality (Dot Product)
project(vector: V, ontoSubspace: Set<V>): V;
}