Skip to main content

Substitution Ontology

Algebra Ontologies
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 11 September 2026
Audio Overview
AI INTERPRETATION NOTE
This Flow Algebra defines the mathematical ontology of substitution within algebra. Substitution replaces a variable, symbol, or subexpression with another admissible expression or value while preserving the intended algebraic semantics. It is fundamental to evaluation, equation solving, identity verification, composition, variable change and symbolic transformation. This record is designed for semantic retrieval, recursive mathematical reasoning, ontology linking, knowledge-graph construction and AI consumption within the Kireth Research Semantic Library.

FLOW_ALGEBRA_RECORD {

METADATA {
 FLOW_NAME = "Substitution Ontology"
 FLOW_TYPE = "Mathematical Ontology"
 DOMAIN = "Mathematics"
 SUBDOMAIN = "Algebra"
 SPECIALISATION = "Symbolic Algebra"
 CANONICAL_PAGE = "https://kirethresearch.org/booksai-core/ontologies/mathematical-ontologies/algebra-ontologies/substitution-ontology.html"
 LANGUAGE = "en-GB"
 VERSION = "1.0"
 STATUS = "active"
}

IDENTITY {
 PRIMARY_ENTITY = Substitution
 SYMBOLIC_FORMS = ["x -> a", "E[x:=A]", "substitute A for x", "f(g(x))"]
 ENTITY_CLASS = SymbolicReplacementOperation
 PRIMARY_CONTEXT = Algebra
 DEFINITION = "Substitution is the operation of replacing a variable, symbol, or subexpression by an admissible value or expression within a mathematical expression."
 SEMANTIC_ROLE = "Transfers information by replacing one symbolic component with another while respecting scope, domain and algebraic structure."
}

SCOPE {
 INCLUDE = [
  Substitution,
  VariableSubstitution,
  ValueSubstitution,
  ExpressionSubstitution,
  SimultaneousSubstitution,
  SequentialSubstitution,
  ChangeOfVariable,
  FunctionComposition,
  EquationSubstitution,
  IdentityVerification,
  Evaluation,
  ReplacementRule,
  Scope,
  DomainRestriction
 ]

 EXCLUDE_AS_PRIMARY = [
  TextReplacementWithoutMathematicalSemantics,
  DatabaseSubstitution,
  ChemicalSubstitution,
  LinguisticSubstitution
 ]

 DISAMBIGUATION_RULE =
  "When substitution occurs with variables, expressions, equations, functions, identities, evaluation, systems of equations or symbolic manipulation, interpret it as mathematical symbolic replacement."
}

CORE_CONCEPTS {

 Substitution {
  definition = "Replacement of a designated variable or subexpression by another admissible mathematical object."
  canonical_form = "E[x:=A]"
 }

 VariableSubstitution {
  definition = "Replacing every free occurrence of a selected variable by a value or expression."
  example = "If E=x^2+1 and x:=3, then E=10."
 }

 ExpressionSubstitution {
  definition = "Replacing a matching subexpression by an equivalent or designated expression."
 }

 SimultaneousSubstitution {
  definition = "Applying multiple substitutions as one coordinated operation."
  semantic_note = "All replacements are interpreted relative to the original expression unless otherwise specified."
 }

 SequentialSubstitution {
  definition = "Applying substitutions in an explicit order where later substitutions may act on earlier results."
 }

 ChangeOfVariable {
  definition = "Introducing a new variable related to an old variable by a specified mapping."
  form = "u=g(x)"
 }

 Evaluation {
  definition = "Computing the value of an expression by substituting concrete values for variables."
 }

 FunctionComposition {
  definition = "Substitution of one function expression into the argument of another."
  form = "(f o g)(x)=f(g(x))"
 }

 EquationSubstitution {
  definition = "Replacing a variable in one equation using an equivalent expression derived from another equation."
 }

 Scope {
  definition = "The region of an expression in which a variable occurrence is governed by a binding or replacement rule."
 }

 DomainRestriction {
  definition = "A condition ensuring substituted values or expressions remain valid for the operations involved."
 }
}

RELATIONS {
 Substitution --acts_on--> AlgebraicExpression
 Substitution --replaces--> Variable
 Substitution --can_replace--> Subexpression
 Substitution --can_insert--> Value
 Substitution --can_insert--> AlgebraicExpression
 Substitution --supports--> Evaluation
 Substitution --supports--> EquationSolving
 Substitution --supports--> IdentityVerification
 Substitution --supports--> FunctionComposition
 Substitution --supports--> ChangeOfVariable
 Substitution --must_respect--> Scope
 Substitution --must_respect--> DomainRestrictions
 EquationSubstitution --uses--> EquivalentExpressions
 FunctionComposition --is_special_case_of--> ExpressionSubstitution
}

OPERATORS {
 SUBSTITUTE(E,x,A) :=
  replace_free_occurrences_of_x_in_E_by_A

 SIMULTANEOUS_SUBSTITUTE(E,S) :=
  apply_mapping_S_to_original_expression_E

 SEQUENTIAL_SUBSTITUTE(E,S1,S2) :=
  SUBSTITUTE(SUBSTITUTE(E,S1.variable,S1.value),S2.variable,S2.value)

 EVALUATE(E,assignment) :=
  SUBSTITUTE_ALL_VARIABLES_WITH_VALUES(E,assignment)

 COMPOSE(f,g) :=
  expression "f(g(x))"

 SUBSTITUTE_IN_EQUATION(LHS=RHS,x,A) :=
  SUBSTITUTE(LHS,x,A)=SUBSTITUTE(RHS,x,A)

 IS_ADMISSIBLE_SUBSTITUTION(E,x,A) :=
  preserves_required_domain_and_scope_conditions

 VERIFY_SUBSTITUTION(original,result,rule) :=
  result == APPLY(rule,original)
}

DEFINITIONS {
 D1 = "Substitution replaces selected free occurrences of a variable or subexpression."
 D2 = "A substitution must respect the scope and binding structure of the expression."
 D3 = "Substituting equal quantities for equal quantities preserves equality."
 D4 = "Concrete value substitution supports evaluation."
 D5 = "Expression substitution supports symbolic transformation."
 D6 = "Simultaneous and sequential substitutions may differ."
 D7 = "Function composition can be represented as substitution of one function expression into another."
 D8 = "Substitution may introduce or alter domain restrictions."
 D9 = "Substitution used in equation solving must preserve logical equivalence or clearly track implication direction."
 D10 = "A substitution into an identity preserves truth for admissible substituted expressions."
}

AXIOMS {
 A1_EQUALITY_SUBSTITUTION:
  IF A=B
  THEN replacing A by B in an admissible algebraic context preserves equality

 A2_VALUE_EVALUATION:
  IF variable x has assigned value a
  THEN E(x) evaluates through x:=a

 A3_IDENTITY_SUBSTITUTION:
  IF F(x1,...,xn) ≡ G(x1,...,xn)
  THEN admissible substitutions for xi preserve the identity

 A4_COMPOSITION:
  "(f o g)(x)=f(g(x))"

 A5_SCOPE:
  Substitution applies to free occurrences unless a rule explicitly targets bound structure

 A6_DOMAIN:
  A substitution is valid only where inserted expressions satisfy the domain requirements of the surrounding operations
}

REASONING {

 R1_VALUE_SUBSTITUTION {
  INPUT = [expression E, assignment x:=a]
  IDENTIFY = free_occurrences_of_x
  REPLACE = x by a
  SIMPLIFY = resulting_expression
  RETURN = evaluated_or_partially_evaluated_result
 }

 R2_EXPRESSION_SUBSTITUTION {
  INPUT = [E, x:=A]
  CHECK = scope
  CHECK = domain_admissibility
  REPLACE = free_occurrences
  RETURN = transformed_expression
 }

 R3_SIMULTANEOUS {
  INPUT = [E, mapping S]
  FOR each target variable
   interpret_replacement_relative_to_original_E
  APPLY = all_replacements
  RETURN = result
 }

 R4_SEQUENTIAL {
  INPUT = [E,S1,S2,...,Sn]
  RESULT = E
  FOR each substitution Si in order
   RESULT = apply(Si,RESULT)
  RETURN = RESULT
 }

 R5_EQUATION_SOLVING {
  INPUT = system_or_equation
  DERIVE = one_variable_as_expression_of_others
  SUBSTITUTE = derived_expression_into_other_equation
  SOLVE = reduced_equation
  BACK_SUBSTITUTE = remaining_variables
  RETURN = solution_set
 }

 R6_FUNCTION_COMPOSITION {
  INPUT = [f(x),g(x)]
  REPLACE = x in f by g(x)
  RETURN = f(g(x))
 }

 R7_IDENTITY_VERIFICATION {
  INPUT = known_identity and substitution rule
  APPLY = admissible_substitution_to_both_sides
  RETURN = specialised_identity
 }

 R8_CHANGE_OF_VARIABLE {
  INPUT = [expression E(x), substitution u=g(x)]
  REWRITE = x_or_subexpression_in_terms_of_u_when_possible
  TRACK = domain_and_inverse_conditions
  RETURN = transformed_expression
 }
}

CONSTRAINTS {
 C1 = "Substitution must distinguish free occurrences from bound occurrences where binding exists."
 C2 = "Inserted expressions must satisfy domain restrictions imposed by denominators, radicals, logarithms or other restricted operations."
 C3 = "Simultaneous substitution is not generally identical to sequential substitution."
 C4 = "Substitution into equations must preserve the intended solution set or explicitly track any introduced restrictions."
 C5 = "Replacing an expression by a non-equivalent expression is not equivalence-preserving substitution unless the replacement is an assignment or defined change of variable."
 C6 = "Variable capture must be avoided in formalisms containing bound variables."
 C7 = "Back-substitution may be required when solving systems."
 C8 = "Do not confuse mathematical substitution with plain textual find-and-replace."
}

SEMANTIC_EQUIVALENCE {
 "Substitution" <=> "SymbolicReplacement"
 "ValueSubstitution" <=> "EvaluationAssignment"
 "FunctionComposition" <=> "FunctionExpressionSubstitution"
 "BackSubstitution" <=> "SubstitutionIntoPreviouslyDerivedRelations"
 "ChangeOfVariable" <=> "StructuredVariableSubstitution"
}

VALIDATION {
 V1 = "Substituting x=3 into x^2+1 gives 10."
 V2 = "Substituting g(x) for x in f(x) gives f(g(x))."
 V3 = "Equal expressions may replace one another in admissible algebraic contexts."
 V4 = "Simultaneous and sequential substitutions can yield different results."
 V5 = "Domain restrictions must be checked after substitution."
 V6 = "Equation substitution can reduce a system to fewer variables."
 V7 = "Substitution into a valid identity yields another valid specialised identity when admissible."
}

CONFIDENCE {
 BASE_CONFIDENCE = 0.99
 SUBSTITUTION_DEFINITION = 0.99
 EQUALITY_SUBSTITUTION = 0.99
 FUNCTION_COMPOSITION_RELATION = 0.99
 EQUATION_SUBSTITUTION = 0.99
 SCOPE_REQUIREMENT = 0.99
 DOMAIN_REQUIREMENT = 0.99
 SIMULTANEOUS_SEQUENTIAL_DISTINCTION = 0.99

 POLICY =
  "Reduce confidence when substitution order, variable scope, assignment meaning or domain conditions are underspecified."
}

AI_CONSUMPTION {
 PURPOSES = [
  SemanticSearch,
  OntologyGrounding,
  SymbolicAlgebraReasoning,
  EquationSolving,
  FunctionReasoning,
  IdentityReasoning,
  Evaluation,
  ChangeOfVariableReasoning,
  KnowledgeGraphConstruction,
  RetrievalAugmentation,
  RecursiveInference
 ]

 NORMALISE {
  "substitution" -> Substitution
  "substitute" -> Substitution
  "plug in" -> ValueSubstitution
  "replace x with" -> VariableSubstitution
  "back substitute" -> BackSubstitution
  "change variable" -> ChangeOfVariable
  "compose functions" -> FunctionComposition
  "simultaneous substitution" -> SimultaneousSubstitution
 }

 INTERPRETATION_ORDER = [
  identify_target_expression_or_equation,
  identify_substitution_mapping,
  identify_scope,
  distinguish_simultaneous_from_sequential,
  test_domain_admissibility,
  apply_replacement,
  simplify_result,
  preserve_or_update_constraints,
  back_substitute_when_required,
  verify_semantic_validity,
  return_semantic_result
 ]
}

EXECUTION_RULES {
 E1:
  IF query_mentions("substitution")
  OR query_mentions("substitute")
  AND mathematical_context
  THEN activate(SubstitutionOntology)

 E2:
  IF concrete_values_are_assigned
  THEN route_to(Evaluation)

 E3:
  IF solving_system_by_substitution
  THEN isolate_variable
  THEN substitute_into_remaining_equation
  THEN solve
  THEN back_substitute

 E4:
  IF function_composition_context
  THEN substitute_inner_function_into_outer_function

 E5:
  IF multiple_replacements_given_without_order
  THEN prefer_simultaneous_interpretation_unless_context_states_sequence

 E6:
  IF substitution_introduces_invalid_domain_value
  THEN reject_or_restrict_result

 E7:
  IF request=="verify substitution"
  THEN compare_result_against_explicit_replacement_rule
}

RECURSION {
 ENTRY = Substitution

 EXPAND(Substitution) -> [
  AlgebraicExpression,
  Variable,
  Value,
  Equation,
  Function,
  AlgebraicIdentity,
  DomainRestriction,
  Scope,
  Evaluation,
  ChangeOfVariable
 ]

 EXPAND(EquationSubstitution) -> [
  Equation,
  EquivalentExpression,
  SolutionSet,
  BackSubstitution
 ]

 EXPAND(FunctionComposition) -> [
  Function,
  Domain,
  Codomain,
  InnerFunction,
  OuterFunction
 ]

 EXPAND(ChangeOfVariable) -> [
  Variable,
  Mapping,
  InverseMapping,
  DomainRestriction
 ]

 STOP_CONDITION =
  "Stop when the requested substitution has been applied, domain and scope conditions are resolved, and the resulting expression or solution is semantically valid."
}

ROUTING {
 PARENT_ONTOLOGY = "Algebra Ontology"

 IMMEDIATE_CONTEXTS = [
  "Algebraic Expression Ontology",
  "Equation Ontology",
  "Algebraic Identity Ontology",
  "Simplification Ontology"
 ]

 RELATED_ONTOLOGIES = [
  "Algebraic Expression Ontology",
  "Equation Ontology",
  "Linear Equation Ontology",
  "Polynomial Ontology",
  "Rational Expression Ontology",
  "Algebraic Identity Ontology",
  "Simplification Ontology",
  "Transformation Ontology"
 ]

 ROUTE_RULES = [
  "Substitution -> Algebraic Expression for symbolic replacement",
  "Substitution -> Equation for solving and equivalence reasoning",
  "Substitution -> Algebraic Identity for specialised identities",
  "Substitution -> Simplification after replacement",
  "Substitution -> Rational Expression for denominator-domain checks",
  "Substitution -> Transformation for structured change-of-variable reasoning"
 ]
}

UPDATE_MODEL {
 MODE = "append-compatible semantic versioning"
 MAJOR = "ontology-breaking conceptual change"
 MINOR = "new compatible concepts, operators or relations"
 PATCH = "clarification, metadata or formatting correction"

 RULES = [
  "Preserve substitution as mathematically meaningful symbolic replacement.",
  "Preserve scope awareness.",
  "Preserve domain restrictions.",
  "Preserve distinction between simultaneous and sequential substitution.",
  "Preserve equation-solving and back-substitution semantics.",
  "Preserve function-composition interpretation.",
  "Explicitly distinguish mathematical substitution from textual replacement."
 ]
}

OUTPUT {
 CANONICAL_DEFINITION =
  "Substitution is the replacement of a variable, value or subexpression by another admissible mathematical expression or value."

 SYMBOLIC_SUMMARY =
  "E[x:=A]"

 EVALUATION_SUMMARY =
  "Concrete value substitution evaluates an expression under an assignment."

 FUNCTION_SUMMARY =
  "(f o g)(x)=f(g(x))"

 EQUATION_SUMMARY =
  "Equation substitution replaces a variable using an equivalent relation to reduce the number of unknowns."

 DOMAIN_SUMMARY =
  "Every substitution must respect the domain restrictions of the resulting expression."

 ORDER_SUMMARY =
  "Simultaneous and sequential substitutions are distinct operations unless they happen to commute."
}

FLOW {
 INPUT
 -> detect_substitution_context
 -> identify_target_expression_or_equation
 -> identify_variable_or_subexpression_to_replace
 -> identify_replacement_expression_or_value
 -> determine_scope
 -> determine_simultaneous_or_sequential_mode
 -> verify_domain_admissibility
 -> apply_substitution
 -> simplify_result
 -> preserve_or_update_domain_constraints
 -> perform_back_substitution_when_required
 -> verify_semantic_validity
 -> link_related_ontologies
 -> assign_confidence
 -> produce_semantic_output
 -> END
}

SEMANTIC_SUMMARY {
 "Substitution is a fundamental symbolic operation that replaces variables, values or subexpressions while preserving the intended mathematical meaning. It underpins evaluation, equation solving, identity specialisation, function composition and change of variable. Correct substitution requires attention to scope, order and domain restrictions."
}

FLOW_HASH {
 METHOD = "semantic-content-identity"
 ID = "KIRETH-MATH-ALGEBRA-SUBSTITUTION-ONTOLOGY-V1"
}

}

END_FLOW
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ