Skip to main content

Expansion 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 algebraic expansion. Expansion rewrites a product, power, or nested algebraic expression into an equivalent sum or more explicit polynomial form by applying distributive laws and related identities. This record is designed for semantic retrieval, symbolic reasoning, ontology linking, knowledge-graph construction and AI consumption within the Kireth Research Semantic Library.

FLOW_ALGEBRA_RECORD {

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

IDENTITY {
 PRIMARY_ENTITY = Expansion
 SYMBOLIC_FORMS = ["a(b+c)=ab+ac", "(a+b)^2=a^2+2ab+b^2", "EXPAND(E)"]
 ENTITY_CLASS = AlgebraicRewrite
 PRIMARY_CONTEXT = Algebra
 DEFINITION = "Expansion is the process of rewriting an algebraic expression into an equivalent form by removing products of sums, powers of sums, or nested grouped structure through distributive and identity-based rules."
 EQUIVALENCE_ROLE = "The expanded expression must remain algebraically equivalent to the original expression."
}

SCOPE {
 INCLUDE = [
  Expansion,
  Distribution,
  DistributiveLaw,
  PolynomialExpansion,
  BinomialExpansion,
  MultinomialExpansion,
  ProductExpansion,
  PowerExpansion,
  TermCollection,
  LikeTerms,
  CanonicalPolynomialForm,
  AlgebraicIdentity,
  FactorisationInverseRelation
 ]

 EXCLUDE_AS_PRIMARY = [
  SeriesExpansion,
  TaylorExpansion,
  FourierExpansion,
  PhysicalExpansion,
  DataExpansion
 ]

 DISAMBIGUATION_RULE =
  "When expansion occurs with algebraic expressions, products, brackets, powers, polynomials, binomials, terms or factorisation, interpret it as symbolic algebraic expansion."
}

CORE_CONCEPTS {

 Expansion {
  definition = "Equivalent rewriting that distributes multiplication over addition or subtraction and resolves grouped products into explicit terms."
  semantic_role = "Transforms compact product structure into explicit additive structure."
 }

 DistributiveLaw {
  forms = [
   "a(b+c)=ab+ac",
   "a(b-c)=ab-ac",
   "(a+b)c=ac+bc"
  ]
  role = "Primary local rule underlying algebraic expansion."
 }

 ProductExpansion {
  definition = "Expansion of products of algebraic sums."
  example = "(a+b)(c+d)=ac+ad+bc+bd"
 }

 BinomialExpansion {
  definition = "Expansion of a power of a binomial."
  general_form = "(a+b)^n = sum_{k=0}^{n} C(n,k)a^(n-k)b^k"
 }

 MultinomialExpansion {
  definition = "Generalisation of binomial expansion to powers of sums containing more than two terms."
 }

 LikeTerms {
  definition = "Terms with the same variable structure and exponents that may be combined after expansion."
 }

 CanonicalPolynomialForm {
  definition = "A standard expanded polynomial representation with like terms collected and terms ordered according to a chosen convention."
 }

 Factorisation {
  relation = "Factorisation and expansion are inverse-style symbolic transformations."
 }
}

CANONICAL_IDENTITIES {

 DISTRIBUTION_SUM = "a(b+c)=ab+ac"

 DISTRIBUTION_DIFFERENCE = "a(b-c)=ab-ac"

 TWO_BINOMIALS = "(a+b)(c+d)=ac+ad+bc+bd"

 PERFECT_SQUARE_SUM = "(a+b)^2=a^2+2ab+b^2"

 PERFECT_SQUARE_DIFFERENCE = "(a-b)^2=a^2-2ab+b^2"

 DIFFERENCE_OF_SQUARES_REVERSE = "(a-b)(a+b)=a^2-b^2"

 CUBE_OF_SUM = "(a+b)^3=a^3+3a^2b+3ab^2+b^3"

 CUBE_OF_DIFFERENCE = "(a-b)^3=a^3-3a^2b+3ab^2-b^3"
}

RELATIONS {
 Expansion --rewrites--> AlgebraicExpression
 Expansion --preserves--> AlgebraicEquivalence
 Expansion --uses--> DistributiveLaw
 Expansion --can_use--> AlgebraicIdentity
 Expansion --produces--> ExplicitTerms
 Expansion --can_require--> CollectionOfLikeTerms
 Expansion --can_produce--> CanonicalPolynomialForm
 Expansion --is_inverse_style_relation_of--> Factorisation
 BinomialExpansion --uses--> BinomialCoefficients
 MultinomialExpansion --generalises--> BinomialExpansion
 PolynomialExpansion --supports--> CoefficientComparison
 Expansion --supports--> Simplification
 Expansion --supports--> EquationManipulation
}

OPERATORS {
 EXPAND(E) :=
  recursively_apply_distributive_and_power_rules(E)

 DISTRIBUTE(a,B) :=
  multiply_a_by_each_term_of_B

 EXPAND_PRODUCT(A,B) :=
  sum_of_all_pairwise_term_products(A,B)

 EXPAND_POWER(E,n) :=
  repeated_product_expansion(E,n)

 COLLECT_LIKE_TERMS(E) :=
  combine_terms_with_identical_variable_signature

 CANONICALISE_POLYNOMIAL(E) :=
  order_and_collect(EXPAND(E))

 VERIFY_EXPANSION(original,expanded) :=
  SIMPLIFY(original-expanded)==0
}

DEFINITIONS {
 D1 = "Expansion rewrites an expression into an equivalent more explicit additive form."
 D2 = "Distribution is the fundamental local operation of expansion."
 D3 = "Expansion must preserve algebraic equivalence."
 D4 = "Products of sums expand into sums of products."
 D5 = "Powers of binomials may be expanded using repeated multiplication or the binomial theorem."
 D6 = "Like terms should be collected when a simplified expanded form is requested."
 D7 = "Canonical polynomial form is an expanded form with coefficients combined and terms ordered."
 D8 = "Expansion and factorisation are inverse-style transformations but may not produce a unique syntactic form."
}

AXIOMS {
 A1_DISTRIBUTIVE_LEFT:
  "a(b+c)=ab+ac"

 A2_DISTRIBUTIVE_RIGHT:
  "(a+b)c=ac+bc"

 A3_DISTRIBUTIVE_DIFFERENCE:
  "a(b-c)=ab-ac"

 A4_EQUIVALENCE:
  IF E expands to F
  THEN E ≡ F

 A5_RECURSION:
  IF an expanded expression still contains expandable grouped products
  THEN expansion may continue recursively

 A6_LIKE_TERM_COLLECTION:
  Combining like terms preserves algebraic equivalence

 A7_BINOMIAL:
  FOR nonnegative integer n
  "(a+b)^n = sum_{k=0}^{n} C(n,k)a^(n-k)b^k"
}

REASONING {

 R1_SINGLE_DISTRIBUTION {
  INPUT = "a(B+C)"
  APPLY = distributive_law
  RETURN = "aB+aC"
 }

 R2_PRODUCT_OF_SUMS {
  INPUT = "(A+B)(C+D)"
  MULTIPLY = every_term_in_first_group_by_every_term_in_second_group
  SUM = resulting_products
  COLLECT = like_terms_if_any
  RETURN = expanded_form
 }

 R3_RECURSIVE_EXPANSION {
  INPUT = expression E
  WHILE expandable_grouped_products_exist
   APPLY = distributive_rules
  COLLECT = like_terms
  RETURN = expanded_expression
 }

 R4_BINOMIAL_POWER {
  INPUT = "(a+b)^n"
  IF n is small
   OPTION = repeated_multiplication
  ELSE
   APPLY = binomial_theorem
  RETURN = expanded_polynomial
 }

 R5_MULTINOMIAL_POWER {
  INPUT = "(x1+...+xm)^n"
  APPLY = multinomial_theorem
  RETURN = sum_over_multiindices
 }

 R6_VERIFY {
  INPUT = [original E, candidate expansion F]
  COMPUTE = simplify(E-F)
  IF result==0
   RETURN ValidExpansion
  ELSE
   RETURN InvalidExpansion
 }

 R7_CANONICAL_FORM {
  INPUT = polynomial expression E
  EXPAND = all_products_and_powers
  COLLECT = like_terms
  ORDER = terms_by_chosen_monomial_order
  RETURN = canonical_polynomial_form
 }
}

CONSTRAINTS {
 C1 = "Expansion must preserve the value of the expression over its domain."
 C2 = "Every term in one factor must be multiplied by every required term in the other factor."
 C3 = "Signs must be propagated correctly when distributing subtraction or negative factors."
 C4 = "Like terms may be combined only when their variable and exponent structures match."
 C5 = "Binomial theorem in its standard finite form requires a nonnegative integer exponent."
 C6 = "Expansion may increase expression size and is not always the preferred simplification direction."
 C7 = "Do not confuse algebraic expansion with infinite series expansion unless series context is explicit."
}

SEMANTIC_EQUIVALENCE {
 "Expansion" <=> "DistributiveAlgebraicRewrite"
 "ExpandedForm" <=> "EquivalentExpressionWithResolvedProducts"
 "CanonicalPolynomialForm" <=> "ExpandedCollectedPolynomial"
 "Factorisation" <=> "ReverseStyleTransformationOfExpansion"
}

VALIDATION {
 V1 = "a(b+c)=ab+ac."
 V2 = "(a+b)(c+d)=ac+ad+bc+bd."
 V3 = "(a+b)^2=a^2+2ab+b^2."
 V4 = "(a-b)^2=a^2-2ab+b^2."
 V5 = "(a-b)(a+b)=a^2-b^2."
 V6 = "A correct expansion simplifies to zero when subtracted from the original expression."
 V7 = "Collecting like terms preserves equivalence."
}

CONFIDENCE {
 BASE_CONFIDENCE = 0.99
 EXPANSION_DEFINITION = 0.99
 DISTRIBUTIVE_LAW = 0.99
 EQUIVALENCE_PRESERVATION = 0.99
 BINOMIAL_EXPANSION = 0.99
 LIKE_TERM_COLLECTION = 0.99
 CANONICAL_POLYNOMIAL_FORM = 0.99

 POLICY =
  "Reduce confidence when the expression syntax, exponent domain or intended expansion depth is underspecified."
}

AI_CONSUMPTION {
 PURPOSES = [
  SemanticSearch,
  OntologyGrounding,
  SymbolicAlgebraReasoning,
  PolynomialReasoning,
  IdentityVerification,
  Simplification,
  EquationManipulation,
  KnowledgeGraphConstruction,
  RetrievalAugmentation,
  RecursiveInference
 ]

 NORMALISE {
  "expand" -> Expansion
  "expansion" -> Expansion
  "expand brackets" -> Expansion
  "multiply out" -> Expansion
  "distribute" -> DistributiveLaw
  "binomial expansion" -> BinomialExpansion
  "collect like terms" -> LikeTerms
  "expanded polynomial form" -> CanonicalPolynomialForm
 }

 INTERPRETATION_ORDER = [
  identify_expression_structure,
  detect_grouped_products,
  detect_powers_of_sums,
  apply_distributive_rules,
  recurse_over_nested_structure,
  apply_binomial_or_multinomial_rules_when_applicable,
  collect_like_terms,
  canonicalise_polynomial_when_requested,
  verify_equivalence,
  return_semantic_result
 ]
}

EXECUTION_RULES {
 E1:
  IF query_mentions("expansion")
  OR query_mentions("expand")
  AND algebraic_expression_context
  THEN activate(ExpansionOntology)

 E2:
  IF grouped_product_detected
  THEN distribute_all_required_terms

 E3:
  IF nested_expandable_structure_remains
  THEN recurse

 E4:
  IF power_of_binomial_detected
  AND exponent_is_nonnegative_integer
  THEN permit(binomial_theorem)

 E5:
  IF request=="fully expand"
  THEN continue_until_no_grouped_products_or_expandable_powers_remain

 E6:
  IF request=="simplified expanded form"
  THEN collect_like_terms_after_expansion

 E7:
  IF request=="verify expansion"
  THEN simplify(original-candidate)
}

RECURSION {
 ENTRY = Expansion

 EXPAND(Expansion) -> [
  AlgebraicExpression,
  DistributiveLaw,
  Polynomial,
  Monomial,
  Binomial,
  AlgebraicIdentity,
  LikeTerm,
  Factorisation
 ]

 EXPAND(BinomialExpansion) -> [
  BinomialCoefficient,
  Combination,
  Power,
  Polynomial
 ]

 EXPAND(CanonicalPolynomialForm) -> [
  Monomial,
  Coefficient,
  Exponent,
  LikeTerm,
  TermOrdering
 ]

 EXPAND(DistributiveLaw) -> [
  Multiplication,
  Addition,
  Subtraction,
  AlgebraicIdentity
 ]

 STOP_CONDITION =
  "Stop when no requested expandable structure remains and the resulting expression is verified equivalent to the original."
}

ROUTING {
 PARENT_ONTOLOGY = "Algebra Ontology"

 IMMEDIATE_CONTEXTS = [
  "Algebraic Expression Ontology",
  "Polynomial Ontology",
  "Algebraic Identity Ontology"
 ]

 RELATED_ONTOLOGIES = [
  "Algebraic Expression Ontology",
  "Polynomial Ontology",
  "Monomial Ontology",
  "Equation Ontology",
  "Algebraic Identity Ontology",
  "Factorisation Ontology",
  "Rational Expression Ontology"
 ]

 ROUTE_RULES = [
  "Expansion -> Algebraic Expression for syntax and structure",
  "Expansion -> Polynomial for canonical polynomial form",
  "Expansion -> Algebraic Identity for standard expansion identities",
  "Expansion -> Factorisation for reverse-style transformation",
  "Expansion -> Equation when expanding both sides during equation manipulation",
  "Expansion -> Rational Expression when numerator or denominator products are expanded"
 ]
}

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

 RULES = [
  "Preserve algebraic equivalence during expansion.",
  "Preserve distributive-law semantics.",
  "Preserve recursive treatment of nested grouped products.",
  "Preserve binomial-theorem conditions.",
  "Preserve distinction between algebraic expansion and infinite series expansion.",
  "Preserve inverse-style relationship with factorisation."
 ]
}

OUTPUT {
 CANONICAL_DEFINITION =
  "Expansion is the rewriting of an algebraic expression into an equivalent form by distributing products and resolving powers or grouped structure into explicit terms."

 SYMBOLIC_SUMMARY =
  "a(b+c)=ab+ac"

 PRODUCT_SUMMARY =
  "(a+b)(c+d)=ac+ad+bc+bd"

 BINOMIAL_SUMMARY =
  "(a+b)^n=sum_{k=0}^{n} C(n,k)a^(n-k)b^k"

 VERIFICATION_SUMMARY =
  "A candidate expansion is valid when simplify(original-expanded)=0."

 FACTORISATION_RELATION =
  "Expansion and factorisation are inverse-style algebraic rewrites."
}

FLOW {
 INPUT
 -> detect_expansion_context
 -> identify_expression
 -> detect_grouped_products
 -> detect_powers_of_sums
 -> apply_distributive_law
 -> recursively_expand_nested_structure
 -> apply_binomial_or_multinomial_rule_when_applicable
 -> collect_like_terms
 -> canonicalise_polynomial_when_requested
 -> verify_equivalence
 -> connect_factorisation_and_identity_relations
 -> link_related_ontologies
 -> assign_confidence
 -> produce_semantic_output
 -> END
}

SEMANTIC_SUMMARY {
 "Expansion rewrites algebraic expressions into equivalent explicit additive forms by applying distributive laws and related identities. It is central to polynomial manipulation, simplification, coefficient comparison and equation work, and it acts as the inverse-style counterpart of factorisation. Correct expansion preserves algebraic equivalence throughout."
}

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

}

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