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, 25, 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, 25, 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, 25, 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, 25, 4, 6, 24]
After
derived = [0, 24, 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(24, 5)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product5 = 120
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, 25, 5, 24, 120]
After
derived = [4, 20, 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(20, 6)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product6 = 120
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, 25, 6, 20, 120]
After
derived = [4, 20, 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(20, 7)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product7 = 140
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, 25, 7, 20, 140]
After
derived = [5, 15, 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(15, 8)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product8 = 120
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, 25, 8, 15, 120]
After
derived = [4, 20, 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(20, 9)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product9 = 180
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, 25, 9, 20, 180]
After
derived = [7, 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, S018
S020 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product10 := mul(5, 10)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product10 = 50
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, 25, 10, 5, 50]
After
derived = [2, 0, 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(0, 11)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product11 = 0
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, 25, 11, 0, 0]
After
derived = [0, 0, 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(0, 12)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product12 = 0
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, 25, 12, 0, 0]
After
derived = [0, 0, 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(0, 13)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product13 = 0
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, 25, 13, 0, 0]
After
derived = [0, 0, 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(0, 14)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product14 = 0
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, 25, 14, 0, 0]
After
derived = [0, 0, 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(0, 15)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product15 = 0
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, 25, 15, 0, 0]
After
derived = [0, 0, 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(0, 16)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product16 = 0
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, 25, 16, 0, 0]
After
derived = [0, 0, 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(0, 17)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product17 = 0
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, 25, 17, 0, 0]
After
derived = [0, 0, 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(0, 18)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product18 = 0
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, 25, 18, 0, 0]
After
derived = [0, 0, 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(0, 19)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product19 = 0
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, 25, 19, 0, 0]
After
derived = [0, 0, 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(0, 20)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product20 = 0
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, 25, 20, 0, 0]
After
derived = [0, 0, 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(0, 21)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product21 = 0
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, 25, 21, 0, 0]
After
derived = [0, 0, 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(0, 22)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product22 = 0
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, 25, 22, 0, 0]
After
derived = [0, 0, 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 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product23 := mul(0, 23)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product23 = 0
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, S045
S047 · implies
Before
source roles = [Wilson ORIGINAL factorial, 25, 23, 0, 0]
After
derived = [0, 0, 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, S046
S048 · calculation
Before
Wilson ORIGINAL factorial ORIGINAL running factorial product24 := mul(0, 24)
After
Wilson ORIGINAL factorial ORIGINAL running factorial product24 = 0
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, S047
S049 · implies
Before
source roles = [Wilson ORIGINAL factorial, 25, 24, 0, 0]
After
derived = [0, 0, 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, S048
S050 · implies
Before
source roles = [25, [[1, 1], [2, 2], [3, 6], [4, 24], [5, 20], [6, 20], [7, 15], [8, 20], [9, 5], [10, 0], [11, 0], [12, 0], [13, 0], [14, 0], [15, 0], [16, 0], [17, 0], [18, 0], [19, 0], [20, 0], [21, 0], [22, 0], [23, 0], [24, 0]]]
After
derived = [No, 0, 24, No, 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, S049