Main derivation
S01 · definition
Before
p\ \text{prime}After
2\le p\ \land\ \forall d\in\mathbb{N}\,(d\mid p\Rightarrow d=1\lor d=p)Conditions: none
Rule: mko_prime_def · Uses: G1, mko_prime_def
Leaf basis: mko_prime_def + def_unfold
By the MKO's definition, a prime must satisfy two conditions together: p≥2, and p has no natural divisor other than 1 and p. To refute, one failed condition suffices; to confirm, every possible nontrivial divisor must be excluded.
S02 · implies
Before
d\mid n,\ n>0
After
1\le d\le n
Conditions: n>0
Rule: L_div_bound · Uses: mko_dvd_def, L_div_bound
Leaf basis: mul_zero + order_basics + exists_elim
A divisor of a positive number lies between 1 and the number itself, by Lemma L_div_bound (proved in S02.1 and S02.2). This makes 'list every divisor' a finite task.
S03 · implies
Before
p=0,\ p=1
After
0,\ 1\ \text{not prime}Conditions: none
Rule: mko_prime_def · Uses: S01, S02, G3
Leaf basis: mko_prime_def + order_basics + mul_zero
Neither 2≤0 nor 2≤1 holds, so 0 and 1 are not prime. Note: by S02 the only divisor of 1 is 1 (1≤d≤1), so 1 actually passes the condition 'divisors are only 1 and itself'; it is excluded solely by 2≤p. 0 fails both conditions: 0=2·0, so 2∣0 with 2∉{1,0}.
S04 · implies
Before
p=2
After
2\ \text{prime}Conditions: none
Rule: mko_prime_def · Uses: S01, S02
Leaf basis: mko_prime_def + case_analysis + order_basics
2≥2. If d∣2, then 1≤d≤2 by S02, and the only naturals from 1 to 2 are 1 and 2, so d=1 or d=2. Both conditions hold, so 2 is prime (N22 is an independent check).
S05 · implies
Before
91=7\cdot 13
After
7\mid 91,\ 7\notin\{1,91\};\ 91\ \text{not prime}Conditions: none
Rule: mko_prime_def · Uses: S01, mko_dvd_def, G3
Leaf basis: mko_prime_def + exists_intro + numeric_evaluation
7·13=91 (N1), so 7∣91 with witness 13. 7≠1 and 7≠91, so the divisor condition fails and 91 is not prime; 7 is a compositeness witness (MKO paragraph 2).
S06 · implies
Before
91\bmod 2=91\bmod 3=91\bmod 5=1
After
2,3,5\nmid 91,\ \text{yet}\ 91\ \text{is composite}Conditions: none
Rule: rem_test · Uses: S05, rem_test
Leaf basis: rem_test + numeric_evaluation
91 leaves remainder 1 on division by 2, 3 and 5 (N2 to N4), so by rem_test none of them divides 91. Declaring 91 prime after testing only these three would be wrong, since S05 found the divisor 7. Finding no factor in an incomplete list of candidates is not a proof of primality (MKO paragraph 2).
S07 · implies
Before
d\mid 97,\ d\neq 1,\ d\neq 97
After
97=dk,\ 2\le d\le 96,\ k\ge 2
Conditions: none
Rule: L_div_bound · Uses: S01, S02, G3
Leaf basis: exists_elim + order_basics + case_analysis
97≥2 holds. For the divisor condition argue by contradiction: suppose d∣97 with d≠1 and d≠97, and take a witness 97=dk. By S02, 1≤d≤97, and excluding 1 and 97 gives 2≤d≤96. Also k≥1 (S02.1); if k=1 then d=97, which is excluded; so k≥2.
S08 · implies
Before
97=dk,\ d\ge 2,\ k\ge 2
After
m=\min(d,k):\ 2\le m,\ m\mid 97,\ m^2\le 97
Conditions: d\ge 2; k\ge 2
Rule: L_small_factor · Uses: S07, L_small_factor
Leaf basis: order_basics + mul_comm + exists_intro
By Lemma L_small_factor (proved in S08.1 and S08.2), the smaller member m of the factor pair also divides 97, and m²≤97. This is the reason one only needs to check up to the square root, stated with exact integer comparisons.
S09 · implies
Before
m^2\le 97
After
2\le m\le 9
Conditions: none
Rule: order_basics · Uses: S08, G2
Leaf basis: order_basics + numeric_evaluation + contradiction
If m≥10, then m²≥100>97 (N5), contradicting m²≤97; so m≤9. And 9²=81≤97 (N6), so 9 is the largest integer with m²≤97. This uses exact integer squares, not a floating-point √97.
S10 · case_split
Before
m\in\{2,3,4,5,6,7,8,9\}After
97\bmod m\in\{1,1,1,2,1,6,1,7\}\neq 0,\ \text{so}\ m\nmid 97Conditions: none
Rule: rem_test · Uses: S09, rem_test
Leaf basis: rem_test + case_analysis + numeric_evaluation
Compute the remainder of 97 on division by each m: m=2 gives 1, 3 gives 1, 4 gives 1, 5 gives 2, 6 gives 1, 7 gives 6, 8 gives 1, 9 gives 7 (N7 to N14). None is 0, so by rem_test none of 2 to 9 divides 97. This contradicts 'some m with 2≤m≤9 divides 97' from S08 and S09.
S11 · implies
Before
\text{assumption of S07 leads to a contradiction}After
\forall d\,(d\mid 97\Rightarrow d=1\lor d=97);\ 97\ \text{prime}Conditions: none
Rule: contradiction · Uses: S07, S10
Leaf basis: contradiction + quantifier_negation + mko_prime_def
The hypothesis of S07, 'some d∣97 with d∉{1,97}', leads to the contradiction in S10, so it is false: every divisor of 97 is 1 or 97. Together with 97≥2, the definition makes 97 prime. N15 is an independent check with a built-in primality test.
S12 · implies
Before
91,\ 9^2\le 91<10^2
After
\text{the complete search}\ 2\le m\le 9\ \text{finds}\ 7Conditions: none
Rule: L_small_factor · Uses: S05, S08, G2
Leaf basis: order_basics + rem_test + numeric_evaluation
Apply the same bound to 91: 9²=81≤91<100=10² (N18, N19), so the composite 91 must have a divisor between 2 and 9; the complete search finds m=7 (91 leaves remainder 0 on division by 7, N17), in agreement with S05. Contrast S06: testing only 2, 3, 5 is an incomplete search, which is how 7 was missed.
S13 · implies
Before
p=2j,\ p\ge 2,\ p\neq 2
After
2\mid p,\ 2\notin\{1,p\};\ p\ \text{not prime}Conditions: p\neq 2
Rule: mko_prime_def · Uses: S01, S04, mko_dvd_def
Leaf basis: mko_prime_def + exists_intro + forall_intro
An even p=2j has the divisor 2 (witness j). If p≠2, then 2≠1 and 2≠p, so the divisor condition fails and p is not prime. With S04, 2 is the only even prime (N21 is a finite check over the even numbers 4 to 120 and supports only those points).
Substeps and lemmas
S02.1 · implies
Before
n=dk,\ n>0
After
d\ge 1,\ k\ge 1
Conditions: n>0
Rule: mul_zero · Uses: mko_dvd_def, mul_zero
Leaf basis: mul_zero + contradiction
If d=0 or k=0, then n=dk=0, contradicting n>0. So d≠0 and k≠0, and a nonzero natural is at least 1.
S02.2 · implies
Before
k\ge 1,\ d\ge 0
After
n=dk\ge d\cdot 1=d
Conditions: none
Rule: order_basics · Uses: S02.1, order_basics
Leaf basis: order_basics + mul_one
k≥1 and d≥0, so dk≥d·1=d, that is d≤n. S02.1 and S02.2 together prove Lemma L_div_bound.
S08.1 · implies
Before
n=dk
After
d\mid n,\ k\mid n,\ \text{so}\ m\mid nConditions: none
Rule: exists_intro · Uses: mko_dvd_def, mul_comm
Leaf basis: exists_intro + mul_comm + case_analysis
n=d·k gives d∣n (witness k); by commutativity n=k·d gives k∣n (witness d). m is one of d and k, so m∣n; and since d, k≥2, m≥2.
S08.2 · implies
Before
m\le d,\ m\le k,\ m\ge 0
After
m^2=m\cdot m\le d\cdot m\le d\cdot k=n
Conditions: none
Rule: order_basics · Uses: order_basics
Leaf basis: order_basics + mul_comm
Multiplying m≤d by the nonnegative m gives m·m≤d·m; multiplying m≤k by the nonnegative d gives d·m≤d·k. Chaining gives m²≤n. S08.1 and S08.2 together prove Lemma L_small_factor.