gaia.core.simplices module

Module: simplices Defines simplicial objects for the GAIA framework.

Following Mahadevan (2024), this implements simplicial objects as functorial mappings from the simplex category Δ to neural network parameters.

Key principles: 1. Pure categorical structure - no local identity checking 2. Simplicial objects are immutable after creation 3. Face and degeneracy operations are purely structural 4. Composition is handled dynamically for coherence

class gaia.core.simplices.SimplicialObject(level, name, payload=None)[source]

Bases: object

Base class for all simplicial objects in the GAIA framework.

level: int
name: str
payload: Any
id: UUID
__init__(level, name, payload=None)
class gaia.core.simplices.BasisRegistry[source]

Bases: object

Registry for managing basis transformations between parameter spaces.

Following Mahadevan (2024), this implements the basis equivalence relation that defines the Param category. Two parameter spaces are equivalent if there exists a differentiable isomorphism between them.

The registry maintains: 1. Canonical basis representatives for each dimension 2. Isomorphisms between equivalent bases 3. Efficient lookup for basis equivalence queries

__init__()[source]
canonical_id(dim)[source]

Get the canonical basis ID for a given dimension.

This implements the canonical choice function that selects a representative from each equivalence class of parameter spaces.

Parameters:

dim (int) – The dimension of the parameter space

Returns:

UUID of the canonical basis for this dimension

Return type:

UUID

register_isomorphism(basis_a, basis_b, iso)[source]

Register an isomorphism between two bases.

This extends the equivalence relation by adding a new isomorphism. The registry automatically computes the inverse and maintains transitivity through composition.

Parameters:
  • basis_a (UUID) – Source basis UUID

  • basis_b (UUID) – Target basis UUID

  • iso (<MagicMock name='mock.Module' id='4349584528'>) – Neural network implementing the isomorphism

get_isomorphism(basis_a, basis_b)[source]

Get the isomorphism from basis_a to basis_b, if it exists.

get_canonical_id(dim)

Get the canonical basis ID for a given dimension.

This implements the canonical choice function that selects a representative from each equivalence class of parameter spaces.

Parameters:

dim (int) – The dimension of the parameter space

Returns:

UUID of the canonical basis for this dimension

Return type:

UUID

new_id(dim)[source]

Create a new basis ID for the given dimension.

This creates a fresh basis that is initially not equivalent to any existing basis. Equivalences can be established later through register_isomorphism.

Parameters:

dim (int) – The dimension of the parameter space

Returns:

UUID of the new basis

Return type:

UUID

get_id(dim, *, same_basis=True)[source]

Get a basis ID for the given dimension.

Parameters:
  • dim (int) – The dimension of the parameter space

  • same_basis (bool) – If True, return canonical basis. If False, create new basis.

Returns:

UUID of the basis (canonical or new)

Return type:

UUID

class gaia.core.simplices.Simplex0(dim, name, registry, payload=None, same_basis=False, basis_id=None)[source]

Bases: SimplicialObject

0-simplex representing an object in the Param category.

Following Mahadevan (2024), objects are equivalence classes of parameter spaces <d> modulo differentiable isomorphism.

__init__(dim, name, registry, payload=None, same_basis=False, basis_id=None)[source]
__setattr__(name, value)[source]

Prevent modification after initialization.

__eq__(other)[source]

Equality based on basis equivalence, not just basis_id.

__hash__()[source]

Hash based on dimension and basis_id.

__deepcopy__(memo)[source]

Create a deep copy with a new UUID but same basis.

dim
basis_id
id: UUID
level: int
name: str
payload: Any
class gaia.core.simplices.SimplexN(level, name, components, payload=None)[source]

Bases: SimplicialObject

n-simplex for n ≥ 1, representing higher-dimensional simplicial structure.

This is a pure categorical implementation with no local identity checking. All simplicial identities are verified globally at the functor level.

__init__(level, name, components, payload=None)[source]
face(i)[source]

Compute the i-th face by removing the i-th component.

This is a pure categorical operation - no identity verification. The functor is responsible for maintaining simplicial identities.

degeneracy(j)[source]

Compute the j-th degeneracy by duplicating the j-th component.

Pure categorical operation with no identity checking.

__eq__(other)[source]

Equality based on level, components, and name.

__hash__()[source]

Hash based on level, components, and name.

components
id: UUID
level: int
name: str
payload: Any
class gaia.core.simplices.Simplex1(morphism, domain, codomain, name, payload=None)[source]

Bases: SimplexN

1-simplex representing a morphism in the Param category.

Following Mahadevan (2024), morphisms are equivalence classes of differentiable maps modulo parameter re-parameterization.

__init__(morphism, domain, codomain, name, payload=None)[source]
property domain: Simplex0
property codomain: Simplex0
__call__(x)[source]

Apply the morphism to input tensor x.

If this is a composition morphism (with payload function), always use the payload to ensure dynamic composition is maintained.

to(device)[source]

Move morphism to specified device.

eval()[source]

Set morphism to evaluation mode.

morphism
__eq__(other)

Equality based on level, components, and name.

__hash__()

Hash based on level, components, and name.

components
degeneracy(j)

Compute the j-th degeneracy by duplicating the j-th component.

Pure categorical operation with no identity checking.

face(i)

Compute the i-th face by removing the i-th component.

This is a pure categorical operation - no identity verification. The functor is responsible for maintaining simplicial identities.

id: UUID
level: int
name: str
payload: Any
class gaia.core.simplices.Simplex2(f, g, name, payload=None)[source]

Bases: SimplexN

2-simplex representing a commutative triangle in the Param category.

Following Mahadevan (2024), this implements the inner horn Λ²₁ with endofunctorial solver where h = g ∘ f is computed dynamically to maintain coherence during training.

__init__(f, g, name, payload=None)[source]
property f: Simplex1
property h: Simplex1
property g: Simplex1
is_inner_horn(missing_face)[source]

Check if this is an inner horn with the specified missing face.

is_outer_horn(missing_face)[source]

Check if this is an outer horn with the specified missing face.

horn_type(missing_face)[source]

Determine the type of horn based on the missing face.

components
__eq__(other)

Equality based on level, components, and name.

__hash__()

Hash based on level, components, and name.

degeneracy(j)

Compute the j-th degeneracy by duplicating the j-th component.

Pure categorical operation with no identity checking.

face(i)

Compute the i-th face by removing the i-th component.

This is a pure categorical operation - no identity verification. The functor is responsible for maintaining simplicial identities.

id: UUID
level: int
name: str
payload: Any