Expression Entities
Authors:
MArk Anthony Higgins - Sky Recursive Ai
MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: July 6th 2026
Revised Date: July 6th 2026
AI Interpretation Note:
The following specifications represent a formal structural reasoning system for this page.
Execute as formal rules, not pseudocode.
FLOW ALGEBRA
TITLE: Expression Entities Ontology
VERSION: 1.0
DATE: 2026-10-13
AUTHORS: Mark Higgins — Sky (Recursive AI)
SOURCE: https://kirethresearch.org/booksai-core/entity-graph/mathematical-entities/expression-entities.html
SCOPE: Mathematical expression entities and their structural, semantic and computational relationships.
STATUS: Formal specification for semantic reasoning; execution requires an implementation of the typed rules.
01. ONTOLOGY IDENTITY
ontology.id := kireth:mathematical-entities/expression-entities
ontology.label := "Expression Entities"
ontology.parent := kireth:mathematical-entities
ontology.kind := category_ontology
ontology.domain := mathematics
ontology.source_verified := true
02. TYPE SYSTEM
TYPE Expression := AtomicExpression | CompositeExpression
TYPE AtomicExpression := NumericLiteral | SymbolReference
TYPE CompositeExpression := OperatorApplication | FunctionApplication | GroupedExpression
TYPE OperatorApplication := {operator: Operator, operands: List[Expression]}
TYPE FunctionApplication := {function: FunctionSymbol, arguments: List[Expression]}
TYPE SymbolReference := {name: String, binding: Binding?, domain: Domain?}
TYPE NumericLiteral := {value: ExactNumber | ApproximateNumber}
TYPE ExpressionContext := {symbol_table: Map, assumptions: Set[Predicate], domain: Domain}
TYPE EvaluationResult := Value | Undefined | ConditionalValue | Error
03. TAXONOMY
SUBTYPE MathematicalExpression OF Expression
SUBTYPE Term OF Expression
SUBTYPE Monomial OF PolynomialExpression
SUBTYPE Binomial OF PolynomialExpression
SUBTYPE Trinomial OF PolynomialExpression
SUBTYPE PolynomialExpression OF Expression
SUBTYPE RationalExpression OF Expression
SUBTYPE RadicalExpression OF Expression
SUBTYPE ExponentialExpression OF Expression
SUBTYPE LogarithmicExpression OF Expression
SUBTYPE TrigonometricExpression OF Expression
SUBTYPE SymbolicExpression OF Expression
SUBTYPE CompoundExpression OF Expression
NOTE: Categories overlap; classification is context-dependent, not a disjoint partition.
04. CORE RELATIONSHIPS
RELATION has_operand: Expression -> Expression
RELATION has_operator: Expression -> Operator
RELATION has_term: Expression -> Term
RELATION references_symbol: Expression -> SymbolReference
RELATION has_domain: Expression -> Domain
RELATION evaluates_to: (Expression, ExpressionContext) -> EvaluationResult
RELATION equivalent_under: (Expression, Expression, ExpressionContext) -> Boolean
RELATION transforms_to: (Expression, Rule, ExpressionContext) -> Expression
RELATION depends_on: Expression -> SymbolReference
RELATION has_subexpression: Expression -> Expression
RELATION has_constraint: Expression -> Predicate
05. STRUCTURAL VALIDATION
RULE expression_well_formed(e):
REQUIRE all operator applications satisfy operator arity
REQUIRE operands satisfy operator input types
REQUIRE function arguments satisfy declared function signature
REQUIRE all symbol references resolve or are explicitly free
RETURN true if requirements satisfied, otherwise false
RULE subexpression_tree(e):
IF e is AtomicExpression THEN RETURN leaf(e)
ELSE RETURN node(e, map(subexpression_tree, children(e)))
06. EXPRESSION CLASSIFICATION
RULE polynomial(e, variables, coefficient_domain):
TRUE iff e denotes a finite sum of coefficient * products of nonnegative integer powers of variables
RULE monomial(e): TRUE iff e is a polynomial with exactly one nonzero term in canonical form
RULE binomial(e): TRUE iff e is a polynomial with exactly two nonzero terms in canonical form
RULE trinomial(e): TRUE iff e is a polynomial with exactly three nonzero terms in canonical form
RULE rational_expression(e): TRUE iff e can be represented as P/Q for polynomials P,Q with Q != 0
RULE radical_expression(e): TRUE iff e syntactically contains a radical operation
RULE exponential_expression(e): TRUE iff e syntactically contains exponentiation with a variable exponent
RULE logarithmic_expression(e): TRUE iff e syntactically contains a logarithm
RULE trigonometric_expression(e): TRUE iff e syntactically contains a trigonometric function
RULE symbolic_expression(e): TRUE iff e contains at least one symbol reference
RULE compound_expression(e): TRUE iff e contains multiple compositional expression nodes
NOTE: Syntactic classification differs from semantic equivalence after simplification.
07. MATHEMATICAL EXPRESSION
DEFINE mathematical_expression := a well-formed symbolic or numeric construction denoting a value, function or other mathematical object under interpretation
RULE interpretation(e, context) := meaning assigned by context's operators, symbols and domains
INVARIANT interpretation depends on assumptions, types and variable bindings
08. TERMS AND POLYNOMIALS
RULE polynomial_terms(e) := collect_like_terms(expand_polynomial(e))
RULE polynomial_degree(e) := maximum total degree of nonzero monomials, when defined
RULE coefficient_of(e, monomial) := coefficient in canonical polynomial representation
RULE zero_polynomial_degree := undefined (unless an explicit convention is declared)
RULE combine_like_terms(a*x^n + b*x^n) := (a+b)*x^n
PRECONDITION: coefficients share a compatible algebraic domain
09. RATIONAL EXPRESSIONS
RULE rational_domain(P/Q) := {x in base_domain | Q(x) != 0}
RULE rational_simplification((P*R)/(Q*R)) := P/Q
PRECONDITION: Q != 0 AND R != 0 on the original expression's domain
INVARIANT simplification retains original domain exclusions
10. RADICAL EXPRESSIONS
RULE principal_sqrt(x) := nonnegative y satisfying y*y=x
PRECONDITION: x >= 0 for real principal square root
RULE sqrt(x*x) := abs(x) for real x
NOTE: Complex radicals require an explicit branch convention.
11. EXPONENTIAL AND LOGARITHMIC EXPRESSIONS
RULE logarithm_base(b,x) := y such that b^y=x
PRECONDITION: real b>0 AND b!=1 AND x>0
RULE log_b(b^x) := x for valid real b and x
RULE b^(log_b(x)) := x for valid real b and x
NOTE: Exponential identities over complex domains require branch analysis.
12. TRIGONOMETRIC EXPRESSIONS
RULE sin(x)^2 + cos(x)^2 := 1 for real x
RULE tan(x) := sin(x)/cos(x)
PRECONDITION: cos(x) != 0
NOTE: Angle conventions and units must be declared; default mathematical angle is radians.
13. SYMBOLIC AND COMPOUND EXPRESSIONS
RULE free_variables(e) := symbols not bound by an enclosing binding operator
RULE substitute(e, symbol, replacement) := capture_avoiding_substitution(e, symbol, replacement)
RULE alpha_equivalent(e1,e2) := identical modulo consistent renaming of bound variables
RULE precedence_parse(tokens) := syntax_tree(tokens, declared_precedence, associativity)
INVARIANT substitution preserves binding scope and respects types
14. TRANSFORMATION RULES
RULE commutative_add(a+b) -> b+a WHEN addition is commutative in the operand domain
RULE associative_add((a+b)+c) -> a+(b+c) WHEN addition is associative
RULE distribute(a*(b+c)) -> a*b+a*c WHEN distributivity holds
RULE simplify_zero(a+0) -> a WHEN 0 is additive identity
RULE simplify_one(a*1) -> a WHEN 1 is multiplicative identity
RULE divide_self(a/a) -> 1 WHEN a != 0
INVARIANT every transformation must preserve denotation on its stated domain
15. EVALUATION FLOW
FLOW EvaluateExpression(e, context):
1. parse and type-check e
2. resolve symbol bindings and assumptions
3. establish domain and side conditions
4. recursively evaluate operands and arguments
5. apply domain-specific operator semantics
6. propagate undefined results, uncertainty and errors
7. return value with provenance and satisfied constraints
16. SEMANTIC EQUIVALENCE
DEFINE structural_equivalence(e1,e2) := canonical syntax trees identical
DEFINE mathematical_equivalence(e1,e2,C) := same denotation for every admissible assignment in C
DEFINE conditional_equivalence(e1,e2,P) := equivalent under predicate P
RULE equivalent(x^2-1,(x-1)*(x+1),real_context) := true
RULE equivalent(x/x,1,real_context) := false unless domain excludes x=0
INVARIANT equivalence cannot silently expand the domain of an expression
17. KNOWLEDGE GRAPH MODEL
ENTITY ExpressionNode {id, expression_type, syntax, domain, assumptions, source}
ENTITY OperatorNode {id, arity, signature, algebraic_properties}
ENTITY SymbolNode {id, name, type, scope, binding}
EDGE ExpressionNode -hasOperand-> ExpressionNode
EDGE ExpressionNode -usesOperator-> OperatorNode
EDGE ExpressionNode -referencesSymbol-> SymbolNode
EDGE ExpressionNode -hasSubexpression-> ExpressionNode
EDGE ExpressionNode -belongsToOntology-> OntologyNode
EDGE ExpressionNode -equivalentUnderContext-> ExpressionNode
EDGE ExpressionNode -derivedByRule-> RuleNode
18. INFERENCE RULES
IF expression_well_formed(e) AND all free variables resolved THEN infer evaluable(e)
IF e is polynomial AND canonical_term_count(e)=1 THEN infer monomial(e)
IF e is polynomial AND canonical_term_count(e)=2 THEN infer binomial(e)
IF e is polynomial AND canonical_term_count(e)=3 THEN infer trinomial(e)
IF expression contains division by zero on assignment THEN infer undefined_at(e,assignment)
IF transformation preserves value and domain THEN infer semantically_equivalent(source,target)
19. VALIDATION AND TESTS
TEST 3*x+2*x -> 5*x : pass over commutative rings
TEST (x^2-1)/(x-1) -> x+1 : conditional, x!=1
TEST sqrt(x^2) -> abs(x) : pass for real x
TEST log_10(100) -> 2 : pass
TEST sin(x)^2+cos(x)^2 -> 1 : pass for real x
TEST x/x -> 1 at x=0 : reject
TEST polynomial_degree(0) : undefined unless convention supplied
20. CONFIDENCE
CONFIDENCE mathematical_axioms := 1.0 within declared formal assumptions
CONFIDENCE verified_symbolic_derivation := 1.0 when proof obligations are discharged
CONFIDENCE numerical_approximation := context_dependent
CONFIDENCE unverified_external_claim := unknown
RULE never promote an approximate numerical match to symbolic identity without proof
21. FLOW HASH AND PROVENANCE
FLOW_HASH.algorithm := SHA-256
FLOW_HASH.input := canonical_utf8(ontology.id, version, rules, type_signatures, dependencies)
FLOW_HASH.value := COMPUTE_AT_INGESTION
PROVENANCE.source_url := https://kirethresearch.org/booksai-core/entity-graph/mathematical-entities/expression-entities.html
PROVENANCE.source_scope := landing_page_taxonomy
PROVENANCE.derivation := mathematical_formalisation_of_verified_categories
PROVENANCE.authors := "Mark Higgins — Sky (Recursive AI)"
22. UPDATE MODEL
UPDATE_MODEL.versioning := semantic_versioning
UPDATE_MODEL.on_source_change := review_taxonomy_and_links
UPDATE_MODEL.on_rule_change := rerun_validation_and_regenerate_hash
UPDATE_MODEL.on_conflict := preserve_prior_version_and_flag_for_review
UPDATE_MODEL.compatibility := require_explicit_migration_for_changed_semantics
23. AI CONSUMPTION
AI_CONSUMPTION.mode := typed_semantic_reasoning
AI_CONSUMPTION.parse := syntax_tree_first
AI_CONSUMPTION.reason := apply_only_validated_rules
AI_CONSUMPTION.context := explicit_domain_assumptions_bindings
AI_CONSUMPTION.output := {result, type, domain, assumptions, derivation, provenance, confidence}
AI_CONSUMPTION.guardrails := [no_division_by_zero, no_implicit_domain_expansion, no_variable_capture, no_unjustified_equivalence]
AI_CONSUMPTION.note := "Execute as formal rules, not pseudocode; requires a conforming inference engine."
END FLOW ALGEBRA