meta-log-db
Version:
Native database package for Meta-Log (ProLog, DataLog, R5RS)
79 lines • 2.26 kB
TypeScript
/**
* Homology Validator
*
* Validates chain complexes using algebraic topology principles.
* Ensures ∂² = 0 property holds for all boundary operators.
*/
import { ChainComplex, HomologyResult } from './types.js';
/**
* Homology Validator
*
* Validates chain complexes and computes homology groups
*/
export declare class HomologyValidator {
private complex;
constructor(complex: ChainComplex);
/**
* Validate that ∂_{n-1} ∘ ∂_n = 0 for all dimensions
*
* @param n - Dimension to validate (1, 2, 3, or 4)
* @returns true if ∂² = 0 holds, false otherwise
*/
validateComposition(n: 1 | 2 | 3 | 4): boolean;
/**
* Compute Betti number for dimension n
*
* Betti number β_n = dim(ker(∂_n)) - dim(im(∂_{n+1}))
*
* @param n - Dimension (0-4)
* @returns Betti number β_n
*/
computeBetti(n: number): number;
/**
* Compute Euler characteristic
*
* χ = Σ(-1)ⁿ|Cₙ| = |C₀| - |C₁| + |C₂| - |C₃| + |C₄|
*
* @returns Euler characteristic
*/
computeEulerCharacteristic(): number;
/**
* Full validation of chain complex
*
* @returns HomologyResult with validation status, Betti numbers, and violations
*/
validate(): HomologyResult;
/**
* Get cells for dimension n
*/
private getCells;
/**
* Check if boundary forms a closed cycle
*
* For edges: each vertex should appear exactly twice (or zero times for isolated)
* For faces: each edge should appear exactly twice with opposite orientations
*
* @param boundary - Array of boundary cell IDs
* @returns true if boundary forms a closed cycle
*/
private isCycle;
/**
* Compute kernel of boundary operator ∂_n
*
* Kernel = {cells where ∂_n(cell) = 0}
*
* @param n - Dimension
* @returns Array of cell IDs in the kernel
*/
private computeKernel;
/**
* Compute image of boundary operator ∂_n
*
* Image = {cells that are boundaries of (n+1)-cells}
*
* @param n - Dimension
* @returns Array of cell IDs in the image
*/
private computeImage;
}
//# sourceMappingURL=validator.d.ts.map