Step-by-step derivation
S001 · implies
Before
source roles = [wilson-prime-inverse-pairing]
After
derived = [[p, all_inverse_pairs, self_inverse_residues, distinct_cancelling_pairs, self_inverse_scope, factorial_residue, Wilson_congruence]]
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 · implies
Before
source roles = [19, 1]
After
derived = [1, 1]
Conditions: none
Every nonzero residue at a prime modulus is a unit.For each a find the first source inverse;two inverses coincide by cancellation of a.
Step identifiers and dependencies
Rule: Wilson_EVERY_nonzero_prime_residue_unique_inverse · Uses: G001, S001
S003 · implies
Before
source roles = [19, 2]
After
derived = [10, 1]
Conditions: none
Every nonzero residue at a prime modulus is a unit.For each a find the first source inverse;two inverses coincide by cancellation of a.
Step identifiers and dependencies
Rule: Wilson_EVERY_nonzero_prime_residue_unique_inverse · Uses: G001, S002
S004 · implies
Before
source roles = [19, 3]
After
derived = [13, 1]
Conditions: none
Every nonzero residue at a prime modulus is a unit.For each a find the first source inverse;two inverses coincide by cancellation of a.
Step identifiers and dependencies
Rule: Wilson_EVERY_nonzero_prime_residue_unique_inverse · Uses: G001, S003
S005 · implies
Before
source roles = [19, 4]
After
derived = [5, 1]
Conditions: none
Every nonzero residue at a prime modulus is a unit.For each a find the first source inverse;two inverses coincide by cancellation of a.
Step identifiers and dependencies
Rule: Wilson_EVERY_nonzero_prime_residue_unique_inverse · Uses: G001, S004
S006 · implies
Before
source roles = [19, 5]
After
derived = [4, 1]
Conditions: none
Every nonzero residue at a prime modulus is a unit.For each a find the first source inverse;two inverses coincide by cancellation of a.
Step identifiers and dependencies
Rule: Wilson_EVERY_nonzero_prime_residue_unique_inverse · Uses: G001, S005
S007 · implies
Before
source roles = [19, 6]
After
derived = [16, 1]
Conditions: none
Every nonzero residue at a prime modulus is a unit.For each a find the first source inverse;two inverses coincide by cancellation of a.
Step identifiers and dependencies
Rule: Wilson_EVERY_nonzero_prime_residue_unique_inverse · Uses: G001, S006
S008 · implies
Before
source roles = [19, 7]
After
derived = [11, 1]
Conditions: none
Every nonzero residue at a prime modulus is a unit.For each a find the first source inverse;two inverses coincide by cancellation of a.
Step identifiers and dependencies
Rule: Wilson_EVERY_nonzero_prime_residue_unique_inverse · Uses: G001, S007
S009 · implies
Before
source roles = [19, 8]
After
derived = [12, 1]
Conditions: none
Every nonzero residue at a prime modulus is a unit.For each a find the first source inverse;two inverses coincide by cancellation of a.
Step identifiers and dependencies
Rule: Wilson_EVERY_nonzero_prime_residue_unique_inverse · Uses: G001, S008
S010 · implies
Before
source roles = [19, 9]
After
derived = [17, 1]
Conditions: none
Every nonzero residue at a prime modulus is a unit.For each a find the first source inverse;two inverses coincide by cancellation of a.
Step identifiers and dependencies
Rule: Wilson_EVERY_nonzero_prime_residue_unique_inverse · Uses: G001, S009
S011 · implies
Before
source roles = [19, 10]
After
derived = [2, 1]
Conditions: none
Every nonzero residue at a prime modulus is a unit.For each a find the first source inverse;two inverses coincide by cancellation of a.
Step identifiers and dependencies
Rule: Wilson_EVERY_nonzero_prime_residue_unique_inverse · Uses: G001, S010
S012 · implies
Before
source roles = [19, 11]
After
derived = [7, 1]
Conditions: none
Every nonzero residue at a prime modulus is a unit.For each a find the first source inverse;two inverses coincide by cancellation of a.
Step identifiers and dependencies
Rule: Wilson_EVERY_nonzero_prime_residue_unique_inverse · Uses: G001, S011
S013 · implies
Before
source roles = [19, 12]
After
derived = [8, 1]
Conditions: none
Every nonzero residue at a prime modulus is a unit.For each a find the first source inverse;two inverses coincide by cancellation of a.
Step identifiers and dependencies
Rule: Wilson_EVERY_nonzero_prime_residue_unique_inverse · Uses: G001, S012
S014 · implies
Before
source roles = [19, 13]
After
derived = [3, 1]
Conditions: none
Every nonzero residue at a prime modulus is a unit.For each a find the first source inverse;two inverses coincide by cancellation of a.
Step identifiers and dependencies
Rule: Wilson_EVERY_nonzero_prime_residue_unique_inverse · Uses: G001, S013
S015 · implies
Before
source roles = [19, 14]
After
derived = [15, 1]
Conditions: none
Every nonzero residue at a prime modulus is a unit.For each a find the first source inverse;two inverses coincide by cancellation of a.
Step identifiers and dependencies
Rule: Wilson_EVERY_nonzero_prime_residue_unique_inverse · Uses: G001, S014
S016 · implies
Before
source roles = [19, 15]
After
derived = [14, 1]
Conditions: none
Every nonzero residue at a prime modulus is a unit.For each a find the first source inverse;two inverses coincide by cancellation of a.
Step identifiers and dependencies
Rule: Wilson_EVERY_nonzero_prime_residue_unique_inverse · Uses: G001, S015
S017 · implies
Before
source roles = [19, 16]
After
derived = [6, 1]
Conditions: none
Every nonzero residue at a prime modulus is a unit.For each a find the first source inverse;two inverses coincide by cancellation of a.
Step identifiers and dependencies
Rule: Wilson_EVERY_nonzero_prime_residue_unique_inverse · Uses: G001, S016
S018 · implies
Before
source roles = [19, 17]
After
derived = [9, 1]
Conditions: none
Every nonzero residue at a prime modulus is a unit.For each a find the first source inverse;two inverses coincide by cancellation of a.
Step identifiers and dependencies
Rule: Wilson_EVERY_nonzero_prime_residue_unique_inverse · Uses: G001, S017
S019 · implies
Before
source roles = [19, 18]
After
derived = [18, 1]
Conditions: none
Every nonzero residue at a prime modulus is a unit.For each a find the first source inverse;two inverses coincide by cancellation of a.
Step identifiers and dependencies
Rule: Wilson_EVERY_nonzero_prime_residue_unique_inverse · Uses: G001, S018
S020 · calculation
Before
Wilson ORIGINAL prime factorial ORIGINAL running factorial product1 := mul(1, 1)
After
Wilson ORIGINAL prime 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, S019
S021 · implies
Before
source roles = [Wilson ORIGINAL prime factorial, 19, 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, S020
S022 · calculation
Before
Wilson ORIGINAL prime factorial ORIGINAL running factorial product2 := mul(1, 2)
After
Wilson ORIGINAL prime 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, S021
S023 · implies
Before
source roles = [Wilson ORIGINAL prime factorial, 19, 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, S022
S024 · calculation
Before
Wilson ORIGINAL prime factorial ORIGINAL running factorial product3 := mul(2, 3)
After
Wilson ORIGINAL prime 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, S023
S025 · implies
Before
source roles = [Wilson ORIGINAL prime factorial, 19, 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, S024
S026 · calculation
Before
Wilson ORIGINAL prime factorial ORIGINAL running factorial product4 := mul(6, 4)
After
Wilson ORIGINAL prime 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, S025
S027 · implies
Before
source roles = [Wilson ORIGINAL prime factorial, 19, 4, 6, 24]
After
derived = [1, 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, S026
S028 · calculation
Before
Wilson ORIGINAL prime factorial ORIGINAL running factorial product5 := mul(5, 5)
After
Wilson ORIGINAL prime factorial ORIGINAL running factorial product5 = 25
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 prime factorial, 19, 5, 5, 25]
After
derived = [1, 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, S028
S030 · calculation
Before
Wilson ORIGINAL prime factorial ORIGINAL running factorial product6 := mul(6, 6)
After
Wilson ORIGINAL prime factorial ORIGINAL running factorial product6 = 36
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 prime factorial, 19, 6, 6, 36]
After
derived = [1, 17, 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 prime factorial ORIGINAL running factorial product7 := mul(17, 7)
After
Wilson ORIGINAL prime factorial ORIGINAL running factorial product7 = 119
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 prime factorial, 19, 7, 17, 119]
After
derived = [6, 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, S032
S034 · calculation
Before
Wilson ORIGINAL prime factorial ORIGINAL running factorial product8 := mul(5, 8)
After
Wilson ORIGINAL prime factorial ORIGINAL running factorial product8 = 40
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 prime factorial, 19, 8, 5, 40]
After
derived = [2, 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, S034
S036 · calculation
Before
Wilson ORIGINAL prime factorial ORIGINAL running factorial product9 := mul(2, 9)
After
Wilson ORIGINAL prime factorial ORIGINAL running factorial product9 = 18
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 prime factorial, 19, 9, 2, 18]
After
derived = [0, 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, S036
S038 · calculation
Before
Wilson ORIGINAL prime factorial ORIGINAL running factorial product10 := mul(18, 10)
After
Wilson ORIGINAL prime factorial ORIGINAL running factorial product10 = 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, S037
S039 · implies
Before
source roles = [Wilson ORIGINAL prime factorial, 19, 10, 18, 180]
After
derived = [9, 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, S038
S040 · calculation
Before
Wilson ORIGINAL prime factorial ORIGINAL running factorial product11 := mul(9, 11)
After
Wilson ORIGINAL prime factorial ORIGINAL running factorial product11 = 99
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 prime factorial, 19, 11, 9, 99]
After
derived = [5, 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, S040
S042 · calculation
Before
Wilson ORIGINAL prime factorial ORIGINAL running factorial product12 := mul(4, 12)
After
Wilson ORIGINAL prime factorial ORIGINAL running factorial product12 = 48
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 prime factorial, 19, 12, 4, 48]
After
derived = [2, 10, 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 prime factorial ORIGINAL running factorial product13 := mul(10, 13)
After
Wilson ORIGINAL prime factorial ORIGINAL running factorial product13 = 130
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 prime factorial, 19, 13, 10, 130]
After
derived = [6, 16, 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 prime factorial ORIGINAL running factorial product14 := mul(16, 14)
After
Wilson ORIGINAL prime factorial ORIGINAL running factorial product14 = 224
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 prime factorial, 19, 14, 16, 224]
After
derived = [11, 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, S046
S048 · calculation
Before
Wilson ORIGINAL prime factorial ORIGINAL running factorial product15 := mul(15, 15)
After
Wilson ORIGINAL prime factorial ORIGINAL running factorial product15 = 225
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 prime factorial, 19, 15, 15, 225]
After
derived = [11, 16, 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 · calculation
Before
Wilson ORIGINAL prime factorial ORIGINAL running factorial product16 := mul(16, 16)
After
Wilson ORIGINAL prime factorial ORIGINAL running factorial product16 = 256
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, S049
S051 · implies
Before
source roles = [Wilson ORIGINAL prime factorial, 19, 16, 16, 256]
After
derived = [13, 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, S050
S052 · calculation
Before
Wilson ORIGINAL prime factorial ORIGINAL running factorial product17 := mul(9, 17)
After
Wilson ORIGINAL prime factorial ORIGINAL running factorial product17 = 153
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, S051
S053 · implies
Before
source roles = [Wilson ORIGINAL prime factorial, 19, 17, 9, 153]
After
derived = [8, 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, S052
S054 · calculation
Before
Wilson ORIGINAL prime factorial ORIGINAL running factorial product18 := mul(1, 18)
After
Wilson ORIGINAL prime factorial ORIGINAL running factorial product18 = 18
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, S053
S055 · implies
Before
source roles = [Wilson ORIGINAL prime factorial, 19, 18, 1, 18]
After
derived = [0, 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, S054
S056 · implies
Before
source roles = [19, [[1, 1], [2, 10], [3, 13], [4, 5], [5, 4], [6, 16], [7, 11], [8, 12], [9, 17], [10, 2], [11, 7], [12, 8], [13, 3], [14, 15], [15, 14], [16, 6], [17, 9], [18, 18]]]
After
derived = [[1, 18], [[2, 10, 1], [3, 13, 1], [4, 5, 1], [6, 16, 1], [7, 11, 1], [8, 12, 1], [9, 17, 1], [14, 15, 1]], 18, Yes]
Conditions: none
Nonself inverse pairs multiply to1.A self-inverse satisfies(r-1)(r+1)=0 modulo a prime,so is±1.For p>2 their product is-1;at p2 only the single1=-1 remains.This general teaching argument does not turn the finite table/program into a Lean proof.
Step identifiers and dependencies
Rule: Wilson_GENERAL_inverse_pairing_and_p2_exception · Uses: G001, S055
Result
(19, [[1, 1], [2, 10], [3, 13], [4, 5], [5, 4], [6, 16], [7, 11], [8, 12], [9, 17], [10, 2], [11, 7], [12, 8], [13, 3], [14, 15], [15, 14], [16, 6], [17, 9], [18, 18]], [1, 18], [[2, 10, 1], [3, 13, 1], [4, 5, 1], [6, 16, 1], [7, 11, 1], [8, 12, 1], [9, 17, 1], [14, 15, 1]], self_inverse_residues_1_and_p_minus_1, 18, Yes)
The full substitutions and premise checks give the original answer; source identity,format and status are unchanged.