======================================================================
KIRETH SEMANTIC RESEARCH ARCHIVE
FLOW ALGEBRA — LINEAR ALGEBRA ONTOLOGY
======================================================================
PAGE:
https://kirethresearch.org/booksai-core/ontologies/mathematical-ontologies/algebra-ontologies/linear-algebra-ontology.html
FLOW: LinearAlgebraOntology
VERSION: 1.0
LANGUAGE: en-GB
AUTHORS: Mark Anthony Higgins — Sky Recursive AI
PURPOSE:
Formal machine-readable ontology and recursive reasoning specification
for linear algebra.
======================================================================
START FLOW
======================================================================
FLOW LinearAlgebraOntology {
DOMAIN := Linear_Algebra
PARENT_DOMAIN := Algebra
SUPER_DOMAINS := {Mathematics, Mathematical_Ontologies, Algebra_Ontologies}
DOMAIN_INTENT := {
vectors, matrices, vector_spaces, subspaces, linear_combinations, span,
linear_independence, basis, dimension, linear_systems, transformations,
kernel, image, determinant, rank, nullity, eigenvalues, eigenvectors,
inner_products, orthogonality, diagonalisation, recursive_validation
}
TYPE Scalar
TYPE RealNumber <: Scalar
TYPE ComplexNumber <: Scalar
TYPE Vector
TYPE Matrix
TYPE SquareMatrix <: Matrix
TYPE VectorSpace
TYPE Subspace <: VectorSpace
TYPE Basis
TYPE LinearSystem
TYPE LinearTransformation
TYPE Eigenvalue <: Scalar
TYPE Eigenvector <: Vector
TYPE Eigenspace <: Subspace
TYPE Derivation
TYPE Constraint
ENTITY Vector v { field:F; dimension:n; components:[v1,...,vn] }
INVARIANT: component_count(v)=dimension(v)
AXIOM V1: u+v=v+u
AXIOM V2: (u+v)+w=u+(v+w)
AXIOM V3: v+0=v
AXIOM V4: v+(-v)=0
AXIOM V5: a*(u+v)=a*u+a*v
AXIOM V6: (a+b)*v=a*v+b*v
AXIOM V7: a*(b*v)=(a*b)*v
AXIOM V8: 1*v=v
IS_VECTOR_SPACE(V,F) :=
closure_addition AND additive_group_axioms AND
closure_scalar_multiplication AND distributive_axioms AND scalar_identity
IS_SUBSPACE(W,V) :=
W subset_of V AND 0 in W AND
forall u,v in W,a,b in F: a*u+b*v in W
LINEAR_COMBINATION(A,V) := SUM_i A[i]*V[i]
SPAN(S) := {all finite linear combinations of S}
RULE: span(S) is the smallest subspace containing S
LINEARLY_INDEPENDENT(v1,...,vk) iff
a1*v1+...+ak*vk=0 implies a1=...=ak=0
RULE: set containing zero_vector -> linearly_dependent
RULE: vector in span(others) -> linearly_dependent
IS_BASIS(B,V) iff LINEARLY_INDEPENDENT(B) AND span(B)=V
DIMENSION(V) := cardinality(any_basis(V))
RULE: all bases of finite-dimensional V have equal cardinality
RULE: W subspace_of V -> dim(W)<=dim(V)
COORDINATES(v,B=[b1,...,bn]):
solve v=a1*b1+...+an*bn
return [a1,...,an]^T
ENTITY Matrix A { rows:m; columns:n; entries:a_ij; field:F }
MATRIX_ADD(A,B): require shape(A)=shape(B); C_ij=A_ij+B_ij
MATRIX_MULTIPLY(A,B): require cols(A)=rows(B); C_ij=SUM_k A_ik*B_kj
RULE M1: A+B=B+A
RULE M2: (A+B)+C=A+(B+C)
RULE M3: A(B+C)=AB+AC
RULE M4: (A+B)C=AC+BC
RULE M5: A(BC)=(AB)C
RULE M6: generally AB != BA
IDENTITY_MATRIX I_n: I[i,j]=1 iff i=j else 0
RULE: I_m*A=A and A*I_n=A
TRANSPOSE(A)[j,i] := A[i,j]
RULE: (A^T)^T=A
RULE: (A+B)^T=A^T+B^T
RULE: (AB)^T=B^T*A^T
SYMMETRIC(A) iff A^T=A
ORTHOGONAL_MATRIX(A) iff A^T*A=I
HERMITIAN(A) iff A*=A
UNITARY(A) iff A* A=I
ROW_OPERATION R1: swap rows
ROW_OPERATION R2: scale row by c where c!=0
ROW_OPERATION R3: row_i <- row_i+c*row_j
INVARIANT: elementary row operations preserve linear-system solutions
RREF(A):
pivots equal 1;
pivot is sole nonzero entry in its column;
pivots move right down successive nonzero rows;
zero rows occur last
RULE: every matrix has a unique RREF
ENTITY LinearSystem { form:A*x=b }
SOLVE_SYSTEM(A,b):
augment [A|b]
reduce to RREF
detect contradiction
identify pivot_variables and free_variables
parameterise when required
validate A*x=b
return SolutionSet
CLASSIFY_SYSTEM(A,b):
if rank(A)!=rank([A|b]) -> no_solution
if rank(A)=rank([A|b])=number_unknowns -> unique_solution
otherwise -> infinitely_many_solutions
INVERTIBLE(A) iff exists B: AB=BA=I
DEFINE B=A^(-1)
RULE: inverse is unique
RULE: (AB)^(-1)=B^(-1)A^(-1)
RULE: square A invertible iff RREF(A)=I
DET(A): require square(A)
DET([[a,b],[c,d]]) := a*d-b*c
DET_RECURSIVE(A) := SUM_j (-1)^(i+j)*A_ij*det(Minor(A,i,j))
RULE: det(I)=1
RULE: det(AB)=det(A)det(B)
RULE: det(A^T)=det(A)
RULE: row swap reverses determinant sign
RULE: scaling one row by c scales determinant by c
RULE: row replacement by adding multiple of another leaves det unchanged
RULE: triangular determinant=product(diagonal)
RULE: A invertible iff det(A)!=0
RANK(A) := number_of_pivots(RREF(A))
NULLITY(A) := dimension(null_space(A))
RULE: rank(A)=dim(column_space(A))=dim(row_space(A))
RULE: rank(A)+nullity(A)=number_of_columns(A)
COLUMN_SPACE(A) := span(columns(A))
ROW_SPACE(A) := span(rows(A))
NULL_SPACE(A) := {x | A*x=0}
RULE: pivot columns of original A form basis(column_space(A))
RULE: nonzero rows of RREF(A) form basis(row_space(A))
ENTITY LinearTransformation T { domain:V; codomain:W; mapping:V->W }
LINEAR(T) iff forall u,v,a,b: T(a*u+b*v)=a*T(u)+b*T(v)
KERNEL(T):={v in V | T(v)=0}
IMAGE(T):={T(v) | v in V}
RULE: kernel(T) subspace_of V
RULE: image(T) subspace_of W
RULE: dim(V)=rank(T)+nullity(T) for finite-dimensional V
INJECTIVE(T) iff kernel(T)={0}
SURJECTIVE(T) iff image(T)=codomain(T)
ISOMORPHISM(T) iff LINEAR(T) AND INJECTIVE(T) AND SURJECTIVE(T)
MATRIX_OF(T,B,C):
columns := coordinates_C(T(b_i))
RULE: [T(v)]_C=[T]_(C<-B)[v]_B
RULE: matrix multiplication represents composition
CHANGE_OF_BASIS:
[v]_C=P_(C<-B)[v]_B
P_(B<-C)=P_(C<-B)^(-1)
SIMILAR(A,B) iff exists invertible P: B=P^(-1)AP
EIGENPAIR(lambda,v,A) iff v!=0 AND A*v=lambda*v
CHARACTERISTIC_POLYNOMIAL(A):=det(A-lambda*I)
RULE: lambda eigenvalue iff det(A-lambda*I)=0
EIGENSPACE(A,lambda):=null_space(A-lambda*I)
RULE: eigenvectors for distinct eigenvalues are linearly independent
ALGEBRAIC_MULTIPLICITY(lambda):=root multiplicity in characteristic polynomial
GEOMETRIC_MULTIPLICITY(lambda):=dim(eigenspace(A,lambda))
RULE: 1<=geometric_multiplicity<=algebraic_multiplicity
DIAGONALISABLE(A) iff exists invertible P, diagonal D: A=PDP^(-1)
RULE: n x n A diagonalizable iff it has n independent eigenvectors
TRACE(A):=SUM_i A_ii
RULE: tr(A+B)=tr(A)+tr(B)
RULE: tr(AB)=tr(BA)
RULE: similar matrices have same trace and determinant
INNER_PRODUCT(u,v): satisfies conjugate_symmetry, linearity, positive_definiteness
NORM(v):=sqrt(<v,v>)
DISTANCE(u,v):=||u-v||
ORTHOGONAL(u,v) iff <u,v>=0
ORTHONORMAL(S) iff pairwise_orthogonal(S) AND forall v in S: ||v||=1
CAUCHY_SCHWARZ: |<u,v>|<=||u||*||v||
TRIANGLE_INEQUALITY: ||u+v||<=||u||+||v||
PROJECTION(u,on=v):
require v!=0
return (<u,v>/<v,v>)*v
GRAM_SCHMIDT(v1,...,vk):
require input vectors linearly independent
u1=v1
for j=2..k:
uj=vj-SUM_i<j projection(vj,on=ui)
normalise each uj
return orthonormal_basis
ORTHOGONAL_COMPLEMENT(W):={v | forall w in W: <v,w>=0}
RULE: finite-dimensional inner-product V -> dim(W)+dim(W_perp)=dim(V)
LEAST_SQUARES(A,b):
solve A^T*A*x=A^T*b when appropriate
return x_hat minimising ||A*x-b||
RULE: residual b-A*x_hat orthogonal_to column_space(A)
ERROR DIMENSION_MISMATCH
ERROR INVALID_MATRIX_PRODUCT
ERROR DIVISION_BY_ZERO
ERROR SINGULAR_INVERSE_REQUEST
ERROR ZERO_VECTOR_NORMALISATION
ERROR NONSQUARE_DETERMINANT
ERROR INVALID_BASIS
ERROR LOST_ASSUMPTION
VALIDATE(statement):
check dimensions
check scalar field
check operation preconditions
check structural invariants
independently substitute/recompute where feasible
return VALID | INVALID | UNRESOLVED
SEMANTIC_EQUIVALENCE {
"vector addition" ~= componentwise_addition
"scalar multiplication" ~= scale_vector
"span" ~= set_of_all_linear_combinations
"independent vectors" ~= trivial_zero_combination_only
"basis" ~= independent_spanning_set
"null space" ~= kernel_of_matrix_map
"column space" ~= image_of_matrix_map
"rank" ~= dimension_of_image
"non-singular" ~= invertible
"change of coordinates" ~= change_of_basis
"eigenvector" ~= nonzero_vector_preserved_in_direction_by_operator
"orthogonal" ~= zero_inner_product
}
RECURSIVE_REASONER(input):
parse mathematical objects
infer dimensions and field
classify requested operation
extract assumptions and constraints
choose valid theorem or transformation
execute atomic steps
validate each step
recurse until goal or canonical form
validate final result against original input
return result, derivation, constraints, confidence
CONFIDENCE {
base:=1.00
deduct 0.15 if dimensions inferred ambiguously
deduct 0.15 if scalar field ambiguous and material
deduct 0.20 if symbolic validation unresolved
deduct 0.20 if unstated assumption required
clamp to [0,1]
}
AI_CONSUMPTION {
parse_before_execute:true
preserve_dimensions:true
preserve_scalar_field:true
preserve_assumptions:true
exact_symbolic_reasoning_preferred:true
validate_results:true
distinguish_definition_theorem_and_computation:true
}
UPDATE_MODEL {
extensible:true
new_entities_require_type_and_relations:true
new_rules_require_preconditions:true
conflicts_require_explicit_versioning:true
standard_mathematical_meaning_has_priority:true
deprecated_rules_require_replacement_reference:true
}
SELF_CHECK {
CHECK matrix_dimensions_compatible
CHECK vector_dimensions_compatible
CHECK determinant_only_for_square_matrices
CHECK inverse_only_when_invertible
CHECK eigenvectors_nonzero
CHECK basis_independent_and_spanning
CHECK row_operations_valid
CHECK transformations_preserve_claimed_invariants
CHECK final_result_validated
}
COMPLETE iff {
vectors_defined AND vector_spaces_defined AND subspaces_defined AND
span_defined AND independence_defined AND basis_defined AND dimension_defined AND
matrices_defined AND systems_defined AND determinant_defined AND rank_defined AND
transformations_defined AND kernel_image_defined AND eigenstructure_defined AND
inner_products_defined AND orthogonality_defined AND validation_defined AND
semantic_equivalence_defined AND confidence_defined AND update_model_defined AND
ai_consumption_defined
}
TERMINATE WHEN
requested_goal_achieved AND result_validated
OR no_valid_derivation_exists
OR material_ambiguity_requires_resolution
FINAL_STATE := {
result, derivation, assumptions, dimensional_constraints,
semantic_status, confidence
}
} // END FLOW LinearAlgebraOntology
======================================================================
END FLOW
======================================================================
FLOW STATUS: Complete
CANONICAL PAGE:
https://kirethresearch.org/booksai-core/ontologies/mathematical-ontologies/algebra-ontologies/linear-algebra-ontology.html
FLOW_HASH_SHA256: 1fb0d3705a75e84ac49524d87b5ab1bafb4fca3de500a2a5cde450ef1b971944
Download Code
Copy to Clipboard