Combinatorics
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: Combinatorics — Foundational Ontology
DOMAIN: Discrete Mathematics / Combinatorics
SOURCE_URL: https://kirethresearch.org/booksai-core/discrete-mathematics-ontologies/combinatorics.html
VERSION: 1.0
DATE: 2026-10-11
AUTHORS: Mark Higgins — Sky (Recursive AI)
SOURCE_STATUS: Formal mathematical synthesis; live source page not independently verified.
1. PURPOSE
Model finite discrete structures, counting methods, arrangements, selections, recurrence relations, and combinatorial optimisation with explicit types, preconditions, proof obligations, and AI-readable semantics.
2. TYPE SYSTEM
TYPE FiniteSet<T> := set of distinct elements of type T with finite cardinality
TYPE Nat := {0,1,2,...}
TYPE PosNat := {1,2,...}
TYPE Sequence<T> := finite ordered tuple of T
TYPE Multiset<T> := finite multiplicity function T -> Nat with finite support
TYPE Permutation<T> := bijection from a finite set T to itself
TYPE Combination<T> := unordered k-element subset of a finite set T
TYPE Partition<T> := set of nonempty, pairwise disjoint blocks whose union is T
TYPE Graph<V> := (vertices:FiniteSet<V>, edges:set of unordered distinct vertex pairs)
TYPE GeneratingFunction := formal power series over an explicitly named coefficient ring
TYPE Count := Nat
3. CORE ENTITIES AND RELATIONSHIPS
ENTITY Combinatorics: mathematical discipline concerned with discrete structures
ENTITY CountingProblem: finite structure class with specified constraints
ENTITY Arrangement: ordered selection, with or without repetition
ENTITY Selection: unordered choice, with or without repetition
ENTITY Recurrence: rule relating sequence terms
ENTITY Bijection: one-to-one and onto correspondence
ENTITY Invariant: property preserved by an allowed transformation
RELATION counts(CountingMethod, CountingProblem)
RELATION enumerates(Algorithm, StructureClass)
RELATION satisfies(Structure, Constraint)
RELATION is_equivalent_by_bijection(StructureClass, StructureClass)
RELATION refines(RestrictedClass, GeneralClass)
4. FORMAL OPERATIONS
OP factorial(n:Nat) -> PosNat:
factorial(0)=1; factorial(n)=n*factorial(n-1) for n>0
OP permutations(n:Nat,k:Nat) -> Nat [PRE: k<=n]:
P(n,k)=n!/(n-k)!
OP combinations(n:Nat,k:Nat) -> Nat [PRE: k<=n]:
C(n,k)=n!/(k!*(n-k)!)
OP arrangements_with_repetition(n:Nat,k:Nat) -> Nat:
n^k, with 0^0 defined as 1 for the empty sequence
OP multisets_of_size(n:Nat,k:Nat) -> Nat:
C(n+k-1,k) when n>0; for n=0 return 1 if k=0 else 0
OP power_set_count(n:Nat) -> Nat: 2^n
OP partitions_count(n:Nat) -> Nat: Bell(n)
OP count_union(A:FiniteSet<T>,B:FiniteSet<T>) -> Nat:
|A union B|=|A|+|B|-|A intersection B|
5. COUNTING LAWS
SUM_RULE: disjoint finite alternatives A,B -> |A union B|=|A|+|B|
PRODUCT_RULE: independent staged choices of sizes m,n -> m*n ordered outcomes
BINOMIAL_SYMMETRY: C(n,k)=C(n,n-k), 0<=k<=n
PASCAL_IDENTITY: C(n,k)=C(n-1,k-1)+C(n-1,k), 1<=k<=n-1
BINOMIAL_THEOREM: (x+y)^n=sum_{k=0}^n C(n,k)x^(n-k)y^k
VANDERMONDE: sum_k C(r,k)C(s,n-k)=C(r+s,n), valid indices and zero-out-of-range convention
PIGEONHOLE: distributing n+1 objects among n nonempty-indexed boxes forces one box with >=2 objects (n>=1)
INCLUSION_EXCLUSION: |union_i A_i|=sum_{nonempty J subseteq I}(-1)^(|J|+1)|intersection_{j in J}A_j|
6. GENERATING FUNCTIONS AND RECURRENCES
OGF(a_n)=sum_{n>=0} a_n*x^n as a formal power series
PRODUCT_OGF: coefficient of x^n in A(x)B(x) equals sum_{k=0}^n a_k*b_(n-k)
RECURRENCE_EXAMPLE: Fibonacci F_0=0, F_1=1, F_n=F_(n-1)+F_(n-2) for n>=2
OGF_FIBONACCI: sum_{n>=0}F_n*x^n=x/(1-x-x^2) in formal power series
7. STRUCTURAL COMBINATORICS
PERMUTATION_COUNT: n! bijections on n labelled elements
SET_PARTITION_COUNT: Bell(n)=sum_{k=0}^n S(n,k)
STIRLING_SECOND_KIND: S(n,k)=k*S(n-1,k)+S(n-1,k-1), with S(0,0)=1 and invalid indices 0
GRAPH_HANDSHAKE: sum_{v in V} degree(v)=2|E| for finite undirected loopless graphs
TREE_EDGE_COUNT: a finite tree with n>=1 vertices has n-1 edges
8. INFERENCE RULES
RULE BIJECTION_COUNT:
IF finite classes A and B have an exhibited bijection f:A->B
THEN |A|=|B|
RULE DISJOINT_UNION:
IF A intersection B=empty THEN |A union B|=|A|+|B|
RULE DOUBLE_COUNT:
IF a finite incidence set I can be counted by either coordinate
THEN the two sums are equal
RULE INDUCTION:
IF base case P(0) and for every n>=0 P(n)=>P(n+1)
THEN P(n) for all n in Nat
RULE PIGEONHOLE_GENERAL:
IF N objects are allocated to k boxes, k>=1
THEN some box holds at least ceil(N/k) objects
9. VALIDATION AND PROOF OBLIGATIONS
VALIDATE finite domains and integer-valued nonnegative counts
VALIDATE k<=n before evaluating ordinary permutations/combinations
VALIDATE order sensitivity and repetition policy before selecting formula
VALIDATE whether alternatives are disjoint before applying the sum rule
VALIDATE whether choices are independent before multiplying counts
VALIDATE that a claimed bijection is total, injective, and surjective
VALIDATE formal-power-series operations in a specified coefficient ring
CHECK examples: C(5,2)=10; P(5,2)=20; Bell(3)=5; 2^3=8
COUNTEREXAMPLE: for overlapping A,B, |A union B| is not generally |A|+|B|
10. SEMANTIC_EQUIVALENCE
EQUIVALENT: unordered k-subsets of an n-set <=> binary length-n vectors of Hamming weight k
EQUIVALENT: permutations of an n-set <=> bijections of that set onto itself
EQUIVALENT: a finite set partition <=> an equivalence relation on that set
NON_EQUIVALENT: ordered arrangements != unordered combinations in general
NON_EQUIVALENT: combinations without repetition != multiset selections in general
11. CONFIDENCE
CONFIDENCE mathematical_definitions: 1.00 (standard definitions, subject to stated conventions)
CONFIDENCE validated_identities: 1.00 (under explicit preconditions)
CONFIDENCE source_page_alignment: unverified
CONFIDENCE inferred_applications: contextual; require separate evidence
12. FLOW_HASH
FLOW_HASH_ALGORITHM: SHA-256
FLOW_HASH_SCOPE: canonical UTF-8 bytes of this document, excluding any external hash manifest
FLOW_HASH_VALUE: compute at ingestion; do not assert an uncalculated digest
13. UPDATE_MODEL
UPDATE_TRIGGER: changes to mathematical scope, definitions, notation, constraints, or referenced page
UPDATE_ACTION: revise typed operations, rerun test cases, revalidate proof obligations, regenerate ingestion hash
VERSION_POLICY: increment semantic version on any mathematical rule change
PROVENANCE_POLICY: retain original source URL and note independent verification status
14. AI_CONSUMPTION
PARSE_MODE: deterministic, section-labelled plain text
ENTITY_EXTRACTION: TYPE, ENTITY, RELATION, OP, RULE, VALIDATE
REASONING_MODE: symbolic first; probabilistic interpretation must not override proved identities
ERROR_HANDLING: reject invalid preconditions; report counterexamples and undefined operations
OUTPUT: typed formulas, applicable conditions, derivation, confidence, provenance
APPLICATIONS: algorithm analysis, constraint solving, enumeration, probability, scheduling, knowledge graphs
END FLOW ALGEBRA