Step-by-step derivation
S001 · implies
Before
source roles = [wilson-composite-instance]
After
derived = [[n, prime, running_factorial_residues, factorial_residue, minus_one_residue, Wilson_congruence_fails, finite_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, 4, 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, 4, 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, 4, 3, 2, 6]
After
derived = [1, 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, S006
S008 · implies
Before
source roles = [4, [[1, 1], [2, 2], [3, 2]]]
After
derived = [No, 2, 3, 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, S007
Result
(4, No, [[1, 1], [2, 2], [3, 2]], 2, 3, Yes, finite_composite_instance_not_converse_proof)
The full substitutions and premise checks give the original answer; source identity,format and status are unchanged.