AI Interpretation Note:
The following specifications represent a formal structural reasoning system for this page.
Execute as formal rules, not pseudocode.
FLOW ALGEBRA
TITLE: Diagonal Matrix Ontology
VERSION: 4.0
DOMAIN: Mathematics / Linear Algebra / Matrix Entities
SOURCE_URL: https://kirethresearch.org/booksai-core/entity-graph/mathematical-entities/linear-algebra-entities/diagonal-matrix-ontology.html
AUTHORSHIP: Mark Higgins — Sky (Recursive AI)
SOURCE_STATUS: Independently constructed; source-page alignment not verified.
01. ONTOLOGY IDENTITY
ENTITY: DiagonalMatrix
PARENT: SquareMatrix
RELATED: Matrix, ScalarMatrix, IdentityMatrix, ZeroMatrix, Eigenvalue, Determinant, Trace, InverseMatrix, LinearTransformation
DEFINITION: A square matrix D=(d_ij) over a field F is diagonal iff d_ij=0 whenever i != j.
NOTATION: D=diag(d_1,...,d_n), d_i in F, n >= 1.
SCOPE: Finite-dimensional matrices over a field F unless a rule explicitly specifies another algebraic setting.
02. TYPED ENTITIES
TYPE Field: F
TYPE NaturalDimension: n >= 1
TYPE SquareMatrix(F,n): F^(n x n)
TYPE DiagonalMatrix(F,n): {D in F^(n x n) | forall i != j, D[i,j]=0}
TYPE DiagonalEntry(F): d_i in F
TYPE ScalarMatrix(F,n): lambda*I_n
TYPE IdentityMatrix(F,n): diag(1,...,1)
TYPE ZeroMatrix(F,n): diag(0,...,0)
TYPE InvertibleDiagonalMatrix(F,n): {D diagonal | forall i, d_i != 0}
TYPE DiagonalProjection(F,n): {D diagonal | D^2=D}
TYPE DiagonalLinearOperator(F,n): linear map x -> Dx
TYPE DiagonalisationWitness(F,n): pair (P,D) where P invertible and A=PDP^(-1)
03. FORMAL PREDICATES
P01 DIAGONAL(D) := SQUARE(D) and forall i,j (i != j => D[i,j]=0).
P02 DIAGONAL_ENTRIES(D) := (D[1,1],...,D[n,n]).
P03 SCALAR(D) := exists lambda in F, D=lambda*I_n.
P04 IDENTITY(D) := D=I_n.
P05 ZERO(D) := D=0_(n x n).
P06 INVERTIBLE(D) := forall i, D[i,i] != 0, for diagonal D over F.
P07 IDEMPOTENT(D) := D^2=D.
P08 NILPOTENT(D) := exists k>=1, D^k=0.
P09 ORTHOGONAL_REAL(D) := D^T D=I_n, over R.
P10 UNITARY_COMPLEX(D) := D* D=I_n, over C, where D* is conjugate transpose.
P11 POSITIVE_DEFINITE_REAL(D) := forall i, d_i>0, for real diagonal D.
P12 DIAGONALISABLE(A,F) := exists invertible P over F and diagonal D over F such that A=PDP^(-1).
04. CONSTRUCTION AND REPRESENTATION
C01 INPUT n, field F, entries d_1,...,d_n.
C02 BUILD D[i,j] := d_i if i=j else 0.
C03 VALIDATE D has exactly n rows and n columns.
C04 VALIDATE every off-diagonal entry is the additive identity of F.
C05 SERIALISE as diag(d_1,...,d_n) with field and dimension metadata.
C06 EXPAND to full matrix only when required for interoperability.
C07 PRESERVE diagonal entries in their original order.
C08 DISTINGUISH diagonal matrices from matrices merely similar to diagonal matrices.
05. ALGEBRAIC OPERATIONS
O01 ADD: diag(a_i)+diag(b_i)=diag(a_i+b_i).
O02 NEGATE: -diag(a_i)=diag(-a_i).
O03 SCALE: c*diag(a_i)=diag(c*a_i).
O04 MULTIPLY: diag(a_i)diag(b_i)=diag(a_i*b_i).
O05 POWER: diag(a_i)^k=diag(a_i^k), integer k>=0; negative k requires invertibility.
O06 TRANSPOSE: D^T=D.
O07 CONJUGATE_TRANSPOSE: D*=diag(conjugate(d_i)), over C.
O08 INVERSE: D^(-1)=diag(1/d_i) iff every d_i != 0.
O09 DETERMINANT: det(D)=product(i=1..n,d_i).
O10 TRACE: tr(D)=sum(i=1..n,d_i).
O11 RANK: rank(D)=number of nonzero diagonal entries, over F.
O12 NULLITY: nullity(D)=number of zero diagonal entries, over F.
O13 CHARACTERISTIC_POLYNOMIAL: chi_D(t)=product(i=1..n,(t-d_i)).
O14 EIGENVALUES: eigenvalues of D over F are its diagonal entries, with algebraic multiplicity.
O15 EIGENVECTORS: e_i is an eigenvector with eigenvalue d_i.
O16 MATRIX_VECTOR: (Dx)_i=d_i*x_i.
O17 DIRECT_SUM: diag(a_1,...,a_m) direct_sum diag(b_1,...,b_n)=diag(a_1,...,a_m,b_1,...,b_n).
O18 KRONECKER: D tensor E is diagonal with entries d_i*e_j in the Kronecker ordering.
O19 POLYNOMIAL: p(D)=diag(p(d_i)) for p in F[t].
O20 MATRIX_EXPONENTIAL: exp(D)=diag(exp(d_i)) over R or C.
06. TYPED RELATIONSHIPS
R01 DiagonalMatrix IS_A SquareMatrix.
R02 IdentityMatrix IS_A DiagonalMatrix.
R03 ZeroMatrix IS_A DiagonalMatrix.
R04 ScalarMatrix IS_A DiagonalMatrix.
R05 DiagonalMatrix HAS_ENTRY DiagonalEntry.
R06 DiagonalMatrix HAS_PROPERTY OffDiagonalZero.
R07 DiagonalMatrix REPRESENTS DiagonalLinearOperator.
R08 DiagonalMatrix HAS_INVARIANT Determinant.
R09 DiagonalMatrix HAS_INVARIANT Trace.
R10 DiagonalMatrix HAS_INVARIANT Rank.
R11 DiagonalMatrix HAS_EIGENVALUE DiagonalEntry.
R12 DiagonalMatrix HAS_EIGENVECTOR StandardBasisVector.
R13 DiagonalMatrix MAY_HAVE InverseMatrix.
R14 DiagonalMatrix MAY_BE SimilarityNormalForm.
R15 DiagonalMatrix COMMUTES_WITH DiagonalMatrix of same dimension over commutative F.
R16 DiagonalMatrix CLOSED_UNDER MatrixAddition.
R17 DiagonalMatrix CLOSED_UNDER MatrixMultiplication.
R18 DiagonalMatrix CLOSED_UNDER ScalarMultiplication.
R19 DiagonalMatrix CLOSED_UNDER Transposition.
R20 DiagonalMatrix IS_REPRESENTED_BY OrderedDiagonalTuple.
07. FORMAL INFERENCE RULES
RULE 01: SQUARE(D) and OFF_DIAGONAL_ZERO(D) => DIAGONAL(D).
RULE 02: DIAGONAL(D) => SQUARE(D).
RULE 03: DIAGONAL(D) => SYMMETRIC(D) over any field (transpose symmetry).
RULE 04: DIAGONAL(A) and DIAGONAL(B) and SAME_SHAPE(A,B) => DIAGONAL(A+B).
RULE 05: DIAGONAL(A) and DIAGONAL(B) and SAME_SHAPE(A,B) => DIAGONAL(AB).
RULE 06: DIAGONAL(A) and SCALAR(c) => DIAGONAL(cA).
RULE 07: DIAGONAL(D) => DIAGONAL(D^T).
RULE 08: DIAGONAL(D) and NONZERO_ALL_DIAGONAL(D) => INVERTIBLE(D).
RULE 09: DIAGONAL(D) and ZERO_SOME_DIAGONAL(D) => SINGULAR(D).
RULE 10: DIAGONAL(D) => DET(D)=PRODUCT_DIAGONAL(D).
RULE 11: DIAGONAL(D) => TRACE(D)=SUM_DIAGONAL(D).
RULE 12: DIAGONAL(D) => RANK(D)=COUNT_NONZERO_DIAGONAL(D).
RULE 13: DIAGONAL(D) => NULLITY(D)=COUNT_ZERO_DIAGONAL(D).
RULE 14: DIAGONAL(D) => RANK(D)+NULLITY(D)=n.
RULE 15: DIAGONAL(D) => EIGENVALUES(D)=DIAGONAL_ENTRIES(D) as multisets.
RULE 16: DIAGONAL(D) => EIGENPAIR(D,e_i,d_i) for every i.
RULE 17: DIAGONAL(D) and INTEGER(k>=0) => DIAGONAL(D^k).
RULE 18: DIAGONAL(D) and INVERTIBLE(D) => DIAGONAL(D^(-1)).
RULE 19: DIAGONAL(D) and POLYNOMIAL(p) => DIAGONAL(p(D)).
RULE 20: DIAGONAL(D) and IDEMPOTENT(D) => forall i, d_i in {0,1} over a field.
RULE 21: DIAGONAL(D) and forall i, d_i in {0,1} => IDEMPOTENT(D).
RULE 22: DIAGONAL(D) and NILPOTENT(D) => ZERO(D), over a field.
RULE 23: DIAGONAL(D) and ZERO(D) => NILPOTENT(D).
RULE 24: DIAGONAL(D) and forall i, d_i=d => SCALAR(D).
RULE 25: SCALAR(D) => DIAGONAL(D).
RULE 26: DIAGONAL(D) and forall i, d_i=1 => IDENTITY(D).
RULE 27: DIAGONAL(D) and forall i, d_i=0 => ZERO(D).
RULE 28: REAL_DIAGONAL(D) and forall i, d_i>0 => POSITIVE_DEFINITE(D).
RULE 29: REAL_DIAGONAL(D) and forall i, d_i>=0 => POSITIVE_SEMIDEFINITE(D).
RULE 30: REAL_DIAGONAL(D) and forall i, |d_i|=1 => ORTHOGONAL(D).
RULE 31: COMPLEX_DIAGONAL(D) and forall i, |d_i|=1 => UNITARY(D).
RULE 32: DIAGONAL(A) and DIAGONAL(B) and SAME_SHAPE(A,B) => AB=BA.
RULE 33: SIMILAR(A,D) and DIAGONAL(D) => DIAGONALISABLE(A,F).
RULE 34: DIAGONALISABLE(A,F) => exists invertible P and diagonal D over F with A=PDP^(-1).
RULE 35: DIAGONAL(D) and NONZERO_ALL_DIAGONAL(D) => DET(D)!=0.
RULE 36: DIAGONAL(D) and DET(D)!=0 => NONZERO_ALL_DIAGONAL(D).
08. VALIDATION CONSTRAINTS
V01 Require n>=1 for this ontology's matrix representation.
V02 Require all entries to belong to the declared field F.
V03 Reject non-square matrices as diagonal matrices.
V04 Reject matrices with any nonzero off-diagonal entry.
V05 Do not infer invertibility from diagonal form alone.
V06 Do not infer positive definiteness without an ordered real or appropriate Hermitian context.
V07 Do not equate diagonal and diagonalisable: diagonalisable means similar to diagonal.
V08 Do not infer diagonal form from symmetry alone.
V09 Require compatible dimensions for matrix sums and products.
V10 Require nonzero diagonal entries before constructing inverse.
V11 Preserve multiplicity of repeated eigenvalues.
V12 Distinguish algebraic multiplicity from number of distinct eigenvalues.
V13 Require a specified field for field-dependent eigenvalue claims.
V14 For complex matrices, distinguish transpose from conjugate transpose.
V15 Do not infer that every diagonal matrix is the identity or a scalar matrix.
V16 Require explicit order when comparing diagonal tuples.
09. MATHEMATICAL EXAMPLES
EX01 diag(2,3) is diagonal, invertible, determinant 6, trace 5.
EX02 diag(2,0,5) is diagonal, singular, rank 2, nullity 1.
EX03 I_3=diag(1,1,1) is a diagonal identity matrix.
EX04 0_3=diag(0,0,0) is a diagonal zero matrix.
EX05 diag(4,4,4)=4I_3 is scalar.
EX06 diag(1,0,1) is an idempotent diagonal projection.
EX07 diag(-1,1) is real orthogonal.
EX08 diag(1,i) is complex unitary.
EX09 diag(1,2)^2=diag(1,4).
EX10 diag(2,3)^(-1)=diag(1/2,1/3).
EX11 diag(2,3)+diag(4,5)=diag(6,8).
EX12 diag(2,3)diag(4,5)=diag(8,15).
EX13 diag(2,2,5) has eigenvalue 2 with algebraic multiplicity 2.
EX14 diag(-2,3) is not positive definite over R.
EX15 diag(0,0) is the only nilpotent 2x2 diagonal matrix over a field.
EX16 [[1,1],[0,1]] is not diagonal, though it is upper triangular.
10. SEMANTIC EQUIVALENCE
EQ01 "diagonal matrix" == "square matrix with zero off-diagonal entries".
EQ02 "diag(d_1,...,d_n)" == "matrix with entries d_i on the main diagonal and zero elsewhere".
EQ03 "nonsingular diagonal matrix" == "invertible diagonal matrix".
EQ04 "diagonal identity" == "identity matrix" when all diagonal entries equal 1.
EQ05 "diagonal zero matrix" == "zero matrix" when all diagonal entries equal 0.
NON_EQ01 diagonal matrix != diagonalisable matrix (general distinction).
NON_EQ02 diagonal matrix != scalar matrix (unless all diagonal entries equal).
NON_EQ03 diagonal matrix != upper triangular matrix (strict inclusion).
NON_EQ04 diagonal matrix != symmetric matrix (strict inclusion).
NON_EQ05 diagonal matrix != invertible matrix (some diagonal matrices are singular).
11. KNOWLEDGE GRAPH TRIPLES
(DiagonalMatrix, subClassOf, SquareMatrix)
(DiagonalMatrix, characterisedBy, OffDiagonalZero)
(DiagonalMatrix, hasRepresentation, OrderedDiagonalTuple)
(DiagonalMatrix, supportsOperation, MatrixAddition)
(DiagonalMatrix, supportsOperation, MatrixMultiplication)
(DiagonalMatrix, supportsOperation, ScalarMultiplication)
(DiagonalMatrix, hasInvariant, Determinant)
(DiagonalMatrix, hasInvariant, Trace)
(DiagonalMatrix, hasInvariant, Rank)
(DiagonalMatrix, hasSpectrum, DiagonalEntries)
(IdentityMatrix, subClassOf, DiagonalMatrix)
(ZeroMatrix, subClassOf, DiagonalMatrix)
(ScalarMatrix, subClassOf, DiagonalMatrix)
(DiagonalMatrix, relatedTo, Diagonalisation)
(DiagonalMatrix, relatedTo, LinearTransformation)
12. CONFIDENCE
CONFIDENCE.definition: 1.00 (standard mathematical definition)
CONFIDENCE.formal_properties: 1.00 (under stated field assumptions)
CONFIDENCE.examples: 1.00 (algebraically checkable)
CONFIDENCE.source_alignment: unverified
CONFIDENCE.provenance: independently authored mathematical formalisation
CONFIDENCE.rule: Distinguish mathematical validity from source-page fidelity.
13. FLOW_HASH
FLOW_HASH.algorithm: SHA-256
FLOW_HASH.input: canonical UTF-8 bytes of ontology payload excluding mutable hash field
FLOW_HASH.canonicalisation: UTF-8; LF line endings; preserve field order; trim trailing whitespace
FLOW_HASH.value: COMPUTE_AT_INGESTION
FLOW_HASH.note: Do not claim a calculated digest until canonicalisation and hashing have run.
14. UPDATE_MODEL
UPDATE_MODEL.version: 4.0
UPDATE_MODEL.strategy: semantic versioning with provenance tracking
UPDATE_MODEL.trigger: source content change, mathematical correction, schema update, or new relationship
UPDATE_MODEL.required_checks: type safety, rule consistency, examples, graph links, and hash regeneration
UPDATE_MODEL.change_log: append timestamped revision, reason, author, and validation status
UPDATE_MODEL.backward_compatibility: preserve stable entity identifiers where possible
UPDATE_MODEL.source_sync: compare against source URL when accessible; do not assume synchronisation
15. AI_CONSUMPTION
AI_CONSUMPTION.primary_entity: DiagonalMatrix
AI_CONSUMPTION.parse: typed entities, predicates, operations, rules, constraints, and graph triples
AI_CONSUMPTION.reasoning: apply rules only after validating dimension, field, and premises
AI_CONSUMPTION.explanation: return rule IDs and relevant mathematical assumptions
AI_CONSUMPTION.confidence: distinguish theorem-backed conclusions from source-specific claims
AI_CONSUMPTION.retrieval_keys: diagonal matrix; diagonal entries; determinant; eigenvalues; inverse; trace; rank
AI_CONSUMPTION.disambiguation: diagonal versus diagonalisable; diagonal versus triangular; scalar versus diagonal
AI_CONSUMPTION.interoperability: linear algebra ontology; matrix ontology; square matrix ontology; identity matrix ontology
AI_CONSUMPTION.error_handling: flag incompatible dimensions, invalid field entries, and false assumptions
AI_CONSUMPTION.output: validated typed triples and human-readable mathematical explanation
END FLOW ALGEBRA