Step-by-step derivation
S001 · implies
Before
source roles = [wilson-domain-factorial]
After
derived = [[n, prime, running_factorial_residues, factorial_residue, minus_one_residue, Wilson_congruence, instance_equivalence, instance_scope]]
Conditions: none
List the complete operation/mode field order without JavaScript or answer-shape inference;Boolean,string,null and an unclaimed result remain distinct.
Step identifiers and dependencies
Rule: source_ordered_fields_without_JS · Uses: G001
S002 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product1 := mul(1, 1)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product1 = 1
Conditions: none
Substitute original roles and established intermediates exactly,not approximations or internally consistent changed operands;extra teaching algebra adds no source-domain gate.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S001
S003 · implies
Before
source roles = [Wilson ORIGINAL factorial, 23, 1, 1, 1]
After
derived = [0, 1, Yes, Yes]
Conditions: none
Retain the prior residue and full product at every k,then its unique Euclidean remainder in0..n-1.The invariant is value congruent to k! mod n,not an assumed last table entry.
Step identifiers and dependencies
Rule: Wilson_EACH_running_factorial_exact_Euclidean_remainder · Uses: G001, S002
S004 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product2 := mul(1, 2)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product2 = 2
Conditions: none
Substitute original roles and established intermediates exactly,not approximations or internally consistent changed operands;extra teaching algebra adds no source-domain gate.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S003
S005 · implies
Before
source roles = [Wilson ORIGINAL factorial, 23, 2, 1, 2]
After
derived = [0, 2, Yes, Yes]
Conditions: none
Retain the prior residue and full product at every k,then its unique Euclidean remainder in0..n-1.The invariant is value congruent to k! mod n,not an assumed last table entry.
Step identifiers and dependencies
Rule: Wilson_EACH_running_factorial_exact_Euclidean_remainder · Uses: G001, S004
S006 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product3 := mul(2, 3)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product3 = 6
Conditions: none
Substitute original roles and established intermediates exactly,not approximations or internally consistent changed operands;extra teaching algebra adds no source-domain gate.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S005
S007 · implies
Before
source roles = [Wilson ORIGINAL factorial, 23, 3, 2, 6]
After
derived = [0, 6, Yes, Yes]
Conditions: none
Retain the prior residue and full product at every k,then its unique Euclidean remainder in0..n-1.The invariant is value congruent to k! mod n,not an assumed last table entry.
Step identifiers and dependencies
Rule: Wilson_EACH_running_factorial_exact_Euclidean_remainder · Uses: G001, S006
S008 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product4 := mul(6, 4)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product4 = 24
Conditions: none
Substitute original roles and established intermediates exactly,not approximations or internally consistent changed operands;extra teaching algebra adds no source-domain gate.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S007
S009 · implies
Before
source roles = [Wilson ORIGINAL factorial, 23, 4, 6, 24]
After
derived = [1, 1, Yes, Yes]
Conditions: none
Retain the prior residue and full product at every k,then its unique Euclidean remainder in0..n-1.The invariant is value congruent to k! mod n,not an assumed last table entry.
Step identifiers and dependencies
Rule: Wilson_EACH_running_factorial_exact_Euclidean_remainder · Uses: G001, S008
S010 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product5 := mul(1, 5)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product5 = 5
Conditions: none
Substitute original roles and established intermediates exactly,not approximations or internally consistent changed operands;extra teaching algebra adds no source-domain gate.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S009
S011 · implies
Before
source roles = [Wilson ORIGINAL factorial, 23, 5, 1, 5]
After
derived = [0, 5, Yes, Yes]
Conditions: none
Retain the prior residue and full product at every k,then its unique Euclidean remainder in0..n-1.The invariant is value congruent to k! mod n,not an assumed last table entry.
Step identifiers and dependencies
Rule: Wilson_EACH_running_factorial_exact_Euclidean_remainder · Uses: G001, S010
S012 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product6 := mul(5, 6)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product6 = 30
Conditions: none
Substitute original roles and established intermediates exactly,not approximations or internally consistent changed operands;extra teaching algebra adds no source-domain gate.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S011
S013 · implies
Before
source roles = [Wilson ORIGINAL factorial, 23, 6, 5, 30]
After
derived = [1, 7, Yes, Yes]
Conditions: none
Retain the prior residue and full product at every k,then its unique Euclidean remainder in0..n-1.The invariant is value congruent to k! mod n,not an assumed last table entry.
Step identifiers and dependencies
Rule: Wilson_EACH_running_factorial_exact_Euclidean_remainder · Uses: G001, S012
S014 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product7 := mul(7, 7)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product7 = 49
Conditions: none
Substitute original roles and established intermediates exactly,not approximations or internally consistent changed operands;extra teaching algebra adds no source-domain gate.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S013
S015 · implies
Before
source roles = [Wilson ORIGINAL factorial, 23, 7, 7, 49]
After
derived = [2, 3, Yes, Yes]
Conditions: none
Retain the prior residue and full product at every k,then its unique Euclidean remainder in0..n-1.The invariant is value congruent to k! mod n,not an assumed last table entry.
Step identifiers and dependencies
Rule: Wilson_EACH_running_factorial_exact_Euclidean_remainder · Uses: G001, S014
S016 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product8 := mul(3, 8)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product8 = 24
Conditions: none
Substitute original roles and established intermediates exactly,not approximations or internally consistent changed operands;extra teaching algebra adds no source-domain gate.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S015
S017 · implies
Before
source roles = [Wilson ORIGINAL factorial, 23, 8, 3, 24]
After
derived = [1, 1, Yes, Yes]
Conditions: none
Retain the prior residue and full product at every k,then its unique Euclidean remainder in0..n-1.The invariant is value congruent to k! mod n,not an assumed last table entry.
Step identifiers and dependencies
Rule: Wilson_EACH_running_factorial_exact_Euclidean_remainder · Uses: G001, S016
S018 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product9 := mul(1, 9)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product9 = 9
Conditions: none
Substitute original roles and established intermediates exactly,not approximations or internally consistent changed operands;extra teaching algebra adds no source-domain gate.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S017
S019 · implies
Before
source roles = [Wilson ORIGINAL factorial, 23, 9, 1, 9]
After
derived = [0, 9, Yes, Yes]
Conditions: none
Retain the prior residue and full product at every k,then its unique Euclidean remainder in0..n-1.The invariant is value congruent to k! mod n,not an assumed last table entry.
Step identifiers and dependencies
Rule: Wilson_EACH_running_factorial_exact_Euclidean_remainder · Uses: G001, S018
S020 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product10 := mul(9, 10)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product10 = 90
Conditions: none
Substitute original roles and established intermediates exactly,not approximations or internally consistent changed operands;extra teaching algebra adds no source-domain gate.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S019
S021 · implies
Before
source roles = [Wilson ORIGINAL factorial, 23, 10, 9, 90]
After
derived = [3, 21, Yes, Yes]
Conditions: none
Retain the prior residue and full product at every k,then its unique Euclidean remainder in0..n-1.The invariant is value congruent to k! mod n,not an assumed last table entry.
Step identifiers and dependencies
Rule: Wilson_EACH_running_factorial_exact_Euclidean_remainder · Uses: G001, S020
S022 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product11 := mul(21, 11)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product11 = 231
Conditions: none
Substitute original roles and established intermediates exactly,not approximations or internally consistent changed operands;extra teaching algebra adds no source-domain gate.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S021
S023 · implies
Before
source roles = [Wilson ORIGINAL factorial, 23, 11, 21, 231]
After
derived = [10, 1, Yes, Yes]
Conditions: none
Retain the prior residue and full product at every k,then its unique Euclidean remainder in0..n-1.The invariant is value congruent to k! mod n,not an assumed last table entry.
Step identifiers and dependencies
Rule: Wilson_EACH_running_factorial_exact_Euclidean_remainder · Uses: G001, S022
S024 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product12 := mul(1, 12)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product12 = 12
Conditions: none
Substitute original roles and established intermediates exactly,not approximations or internally consistent changed operands;extra teaching algebra adds no source-domain gate.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S023
S025 · implies
Before
source roles = [Wilson ORIGINAL factorial, 23, 12, 1, 12]
After
derived = [0, 12, Yes, Yes]
Conditions: none
Retain the prior residue and full product at every k,then its unique Euclidean remainder in0..n-1.The invariant is value congruent to k! mod n,not an assumed last table entry.
Step identifiers and dependencies
Rule: Wilson_EACH_running_factorial_exact_Euclidean_remainder · Uses: G001, S024
S026 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product13 := mul(12, 13)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product13 = 156
Conditions: none
Substitute original roles and established intermediates exactly,not approximations or internally consistent changed operands;extra teaching algebra adds no source-domain gate.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S025
S027 · implies
Before
source roles = [Wilson ORIGINAL factorial, 23, 13, 12, 156]
After
derived = [6, 18, Yes, Yes]
Conditions: none
Retain the prior residue and full product at every k,then its unique Euclidean remainder in0..n-1.The invariant is value congruent to k! mod n,not an assumed last table entry.
Step identifiers and dependencies
Rule: Wilson_EACH_running_factorial_exact_Euclidean_remainder · Uses: G001, S026
S028 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product14 := mul(18, 14)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product14 = 252
Conditions: none
Substitute original roles and established intermediates exactly,not approximations or internally consistent changed operands;extra teaching algebra adds no source-domain gate.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S027
S029 · implies
Before
source roles = [Wilson ORIGINAL factorial, 23, 14, 18, 252]
After
derived = [10, 22, Yes, Yes]
Conditions: none
Retain the prior residue and full product at every k,then its unique Euclidean remainder in0..n-1.The invariant is value congruent to k! mod n,not an assumed last table entry.
Step identifiers and dependencies
Rule: Wilson_EACH_running_factorial_exact_Euclidean_remainder · Uses: G001, S028
S030 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product15 := mul(22, 15)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product15 = 330
Conditions: none
Substitute original roles and established intermediates exactly,not approximations or internally consistent changed operands;extra teaching algebra adds no source-domain gate.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S029
S031 · implies
Before
source roles = [Wilson ORIGINAL factorial, 23, 15, 22, 330]
After
derived = [14, 8, Yes, Yes]
Conditions: none
Retain the prior residue and full product at every k,then its unique Euclidean remainder in0..n-1.The invariant is value congruent to k! mod n,not an assumed last table entry.
Step identifiers and dependencies
Rule: Wilson_EACH_running_factorial_exact_Euclidean_remainder · Uses: G001, S030
S032 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product16 := mul(8, 16)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product16 = 128
Conditions: none
Substitute original roles and established intermediates exactly,not approximations or internally consistent changed operands;extra teaching algebra adds no source-domain gate.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S031
S033 · implies
Before
source roles = [Wilson ORIGINAL factorial, 23, 16, 8, 128]
After
derived = [5, 13, Yes, Yes]
Conditions: none
Retain the prior residue and full product at every k,then its unique Euclidean remainder in0..n-1.The invariant is value congruent to k! mod n,not an assumed last table entry.
Step identifiers and dependencies
Rule: Wilson_EACH_running_factorial_exact_Euclidean_remainder · Uses: G001, S032
S034 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product17 := mul(13, 17)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product17 = 221
Conditions: none
Substitute original roles and established intermediates exactly,not approximations or internally consistent changed operands;extra teaching algebra adds no source-domain gate.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S033
S035 · implies
Before
source roles = [Wilson ORIGINAL factorial, 23, 17, 13, 221]
After
derived = [9, 14, Yes, Yes]
Conditions: none
Retain the prior residue and full product at every k,then its unique Euclidean remainder in0..n-1.The invariant is value congruent to k! mod n,not an assumed last table entry.
Step identifiers and dependencies
Rule: Wilson_EACH_running_factorial_exact_Euclidean_remainder · Uses: G001, S034
S036 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product18 := mul(14, 18)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product18 = 252
Conditions: none
Substitute original roles and established intermediates exactly,not approximations or internally consistent changed operands;extra teaching algebra adds no source-domain gate.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S035
S037 · implies
Before
source roles = [Wilson ORIGINAL factorial, 23, 18, 14, 252]
After
derived = [10, 22, Yes, Yes]
Conditions: none
Retain the prior residue and full product at every k,then its unique Euclidean remainder in0..n-1.The invariant is value congruent to k! mod n,not an assumed last table entry.
Step identifiers and dependencies
Rule: Wilson_EACH_running_factorial_exact_Euclidean_remainder · Uses: G001, S036
S038 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product19 := mul(22, 19)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product19 = 418
Conditions: none
Substitute original roles and established intermediates exactly,not approximations or internally consistent changed operands;extra teaching algebra adds no source-domain gate.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S037
S039 · implies
Before
source roles = [Wilson ORIGINAL factorial, 23, 19, 22, 418]
After
derived = [18, 4, Yes, Yes]
Conditions: none
Retain the prior residue and full product at every k,then its unique Euclidean remainder in0..n-1.The invariant is value congruent to k! mod n,not an assumed last table entry.
Step identifiers and dependencies
Rule: Wilson_EACH_running_factorial_exact_Euclidean_remainder · Uses: G001, S038
S040 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product20 := mul(4, 20)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product20 = 80
Conditions: none
Substitute original roles and established intermediates exactly,not approximations or internally consistent changed operands;extra teaching algebra adds no source-domain gate.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S039
S041 · implies
Before
source roles = [Wilson ORIGINAL factorial, 23, 20, 4, 80]
After
derived = [3, 11, Yes, Yes]
Conditions: none
Retain the prior residue and full product at every k,then its unique Euclidean remainder in0..n-1.The invariant is value congruent to k! mod n,not an assumed last table entry.
Step identifiers and dependencies
Rule: Wilson_EACH_running_factorial_exact_Euclidean_remainder · Uses: G001, S040
S042 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product21 := mul(11, 21)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product21 = 231
Conditions: none
Substitute original roles and established intermediates exactly,not approximations or internally consistent changed operands;extra teaching algebra adds no source-domain gate.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S041
S043 · implies
Before
source roles = [Wilson ORIGINAL factorial, 23, 21, 11, 231]
After
derived = [10, 1, Yes, Yes]
Conditions: none
Retain the prior residue and full product at every k,then its unique Euclidean remainder in0..n-1.The invariant is value congruent to k! mod n,not an assumed last table entry.
Step identifiers and dependencies
Rule: Wilson_EACH_running_factorial_exact_Euclidean_remainder · Uses: G001, S042
S044 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product22 := mul(1, 22)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product22 = 22
Conditions: none
Substitute original roles and established intermediates exactly,not approximations or internally consistent changed operands;extra teaching algebra adds no source-domain gate.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S043
S045 · implies
Before
source roles = [Wilson ORIGINAL factorial, 23, 22, 1, 22]
After
derived = [0, 22, Yes, Yes]
Conditions: none
Retain the prior residue and full product at every k,then its unique Euclidean remainder in0..n-1.The invariant is value congruent to k! mod n,not an assumed last table entry.
Step identifiers and dependencies
Rule: Wilson_EACH_running_factorial_exact_Euclidean_remainder · Uses: G001, S044
S046 · implies
Before
source roles = [23, [[1, 1], [2, 2], [3, 6], [4, 1], [5, 5], [6, 7], [7, 3], [8, 1], [9, 9], [10, 21], [11, 1], [12, 12], [13, 18], [14, 22], [15, 8], [16, 13], [17, 14], [18, 22], [19, 4], [20, 11], [21, 1], [22, 22]]]
After
derived = [Yes, 22, 22, Yes, Yes]
Conditions: none
Qualify primality and congruence separately.Both may be False at a composite while equivalence is True.The converse has a separate argument:a proper divisor d>=2 of composite n divides both n and(n-1)!;a congruence to-1 would force d to divide1,a contradiction.This reasoning is not a single instance or finite-cutoff test.
Step identifiers and dependencies
Rule: Wilson_prime_classification_instance_flags_AND_separate_converse_reason · Uses: G001, S045