Skip to main content

Prime Number Ontology

Number Theory
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 11 October 2026
Audio Overview
FLOW ALGEBRA
TITLE: Prime Number Ontology
DOMAIN: Discrete Mathematics / Number Theory
SOURCE_URL: https://kirethresearch.org/booksai-core/discrete-mathematics-ontologies/number-theory/prime-number-ontology.html
VERSION: 1.0
DATE: 2026-10-11
AUTHORS: Mark Higgins — Sky (Recursive AI)
SOURCE_STATUS: Mathematical synthesis; live page not independently verified.

1. PURPOSE
Model prime numbers, primality, factorisation, and their formally verifiable relationships for semantic retrieval and computational reasoning.

2. TYPED ENTITIES
Integer := {...,-2,-1,0,1,2,...}
Natural := {0,1,2,...}
PositiveInteger := {n in Integer | n > 0}
Prime := {p in Integer | p > 1 and divisors_positive(p) = {1,p}}
Composite := {n in Integer | n > 1 and exists a,b in Integer: 1 < a < n and 1 < b < n and n=a*b}
Divisor := (d,n) in Integer^2 where d != 0 and exists k in Integer: n=d*k
PrimeFactorisation := finite multiset of pairs (prime, positive exponent)
PrimalityCertificate := evidence verifying a primality claim under a specified algorithm

3. CORE PREDICATES AND RELATIONSHIPS
DIVIDES(d,n) := exists k in Integer: n=d*k
IS_PRIME(n) := n > 1 and forall d in PositiveInteger: DIVIDES(d,n) implies (d=1 or d=n)
IS_COMPOSITE(n) := n > 1 and not IS_PRIME(n)
PRIME_FACTOR(p,n) := IS_PRIME(p) and DIVIDES(p,n)
COPRIME(a,b) := gcd(a,b)=1
NEXT_PRIME(p,q) := IS_PRIME(p) and IS_PRIME(q) and q>p and no prime r satisfies p<r<q
SEMANTIC_RELATIONSHIPS:
  Prime --is_a--> PositiveInteger
  Prime --has_divisors--> {1,self}
  Composite --has_prime_factor--> Prime
  PrimeFactorisation --decomposes--> PositiveIntegerGreaterThanOne
  PrimalityCertificate --supports--> IS_PRIME

4. FLOW OPERATIONS
flow primality(n: Integer) -> Boolean:
  require integer(n)
  if n <= 1: return false
  for d in 2..floor(sqrt(n)):
    if n mod d == 0: return false
  return true

flow factorise(n: Integer) -> PrimeFactorisation:
  require n >= 2
  result := empty multiset
  for candidate d from 2 while d*d <= n:
    while n mod d == 0:
      add d to result; n := n/d
  if n > 1: add n to result
  return result

flow validate_factorisation(n, factors) -> Boolean:
  require n >= 2
  return all(IS_PRIME(p) and e>=1 for (p,e) in factors)
         and product(p^e for (p,e) in factors) = n

5. MATHEMATICAL LAWS AND THEOREMS
L1: 2 is prime and is the only even prime.
L2: Every integer n>1 is either prime or composite, never both.
L3: Fundamental Theorem of Arithmetic: every n>1 has a unique prime factorisation up to factor order.
L4: Euclid's lemma: if prime p divides a*b, then p divides a or p divides b.
L5: There are infinitely many primes (Euclid's theorem).
L6: If composite n>1, there exists a prime divisor p <= sqrt(n).
L7: For prime p and integer a, gcd(a,p)=1 iff p does not divide a.
L8: Fermat's little theorem: if p prime and p does not divide a, then a^(p-1) congruent 1 (mod p).
L9: For every integer n>1, n has at least one prime divisor.
L10: Distinct primes p and q satisfy gcd(p,q)=1.

6. INFERENCE RULES
R1: IS_PRIME(p) and DIVIDES(p,a*b) => DIVIDES(p,a) or DIVIDES(p,b).
R2: IS_PRIME(p) and p>2 => p mod 2 = 1.
R3: n>1 and exists d with 1<d<n and DIVIDES(d,n) => IS_COMPOSITE(n).
R4: n>1 and no d in [2,floor(sqrt(n))] divides n => IS_PRIME(n).
R5: IS_PRIME(p) and p divides n => p occurs in prime factorisation of n.
R6: IS_PRIME(p) and IS_PRIME(q) and p != q => COPRIME(p,q).

7. VALIDATION AND EDGE CASES
- 0, 1, and negative integers are not prime under this ontology.
- 2 is prime; 4 is composite; 9 is composite; 97 is prime.
- Empty factorisation represents 1 only if a separate unit-factorisation convention is explicitly adopted; factorise() here requires n>=2.
- A Fermat congruence alone does not prove primality (pseudoprimes exist).
- Probabilistic primality results must not be labelled mathematically proven without sufficient proof or certificate.
- Exact large-integer computations require arbitrary-precision arithmetic.

8. SEMANTIC_EQUIVALENCE
prime_number == prime_integer (within integers greater than 1)
primality == property IS_PRIME
prime_factor == prime divisor
NOT_EQUIVALENT: probable_prime != proven_prime
NOT_EQUIVALENT: coprime != both_prime

9. CONFIDENCE
mathematical_definitions: 1.00 (deductive within stated conventions)
verified_proof: 1.00 (when proof checker succeeds)
probabilistic_test: algorithm_and_error_bound_required
unverified_external_claim: unknown

10. FLOW_HASH
canonicalise: UTF-8; Unicode NFC; stable field ordering; normalised whitespace
algorithm: SHA-256
input: canonical ontology content excluding mutable FLOW_HASH digest field
value: compute on publication; not precomputed

11. UPDATE_MODEL
version: 1.0
update_triggers: revised definitions, new verified algorithms, changed source content, corrected mathematical statements
rules: preserve source URL; record revision timestamp; rerun validation; regenerate hash; retain prior version

12. AI_CONSUMPTION
entity_type: PrimeNumberOntology
retrieval_keys: prime, primality, integer, divisor, factorisation, coprime, Euclid, Fermat
reasoning_mode: symbolic mathematical inference with explicit domain constraints
output_requirements: cite applicable theorem; distinguish proof from heuristic; disclose unknown confidence
interoperability: Integer Ontology, Divisibility Ontology, Modular Arithmetic Ontology, Factorisation Ontology

END FLOW ALGEBRA
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ