Step-by-step derivation
S001 · implies
Before
source operation=flt-converse-counterexample;original snapshot and mathematics retained
After
explicit ordered source output fields=[modulus, base, prime, coprime, power_modulus_minus_1, boundary]
Conditions: none
Keep the historical interface marker in the original snapshot while listing ordered source fields here,without JavaScript or external lookup.Field labels are not mathematical evidence,and No retains the operation's claim scope.
Step identifiers and dependencies
Rule: source_ordered_interface_explicit_without_javascript · Uses: G001
S002 · implies
Before
ACTUAL integer modulus=561;complete trial range2..floor_sqrt=23
After
checked rows[divisor,quotient,remainder]=[[2, 280, 1], [3, 187, 0]];first exact factor=3;prime=No
Conditions: none
An exact factor in the trial range witnesses compositeness.If the entire range has no factor,any composite decomposition would require one at most sqrt(n),so all composite cases are excluded.The empty range for2 is valid.This is not a primality inference from a Fermat test.
Step identifiers and dependencies
Rule: flt_primality_complete_trial_or_actual_factor_not_Fermat_test · Uses: G001, S001
S003 · implies
Before
original signed base=13;positive modulus=561;use nonnegative gcd inputs=[13, 561]
After
ALL Euclidean rows[left,right,q,r]=[[13, 561, 0, 13], [561, 13, 43, 2], [13, 2, 6, 1], [2, 1, 2, 0]];terminal nonnegative gcd=1;coprime=Yes
Conditions: none
Euclidean replacements preserve common divisors and give the terminal gcd,including gcd(0,m)=m.Primality of the modulus and invertibility of the base remain separate flags.
Step identifiers and dependencies
Rule: flt_actual_gcd_coprime_separate_from_primality · Uses: G001, S002
S004 · calculation
Before
Fermat original signed base exact quotient := div(13, 561)
After
Fermat original signed base exact quotient = 13/561
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S003
S005 · calculation
Before
Fermat original signed base floor quotient multiple := mul(0, 561)
After
Fermat original signed base floor quotient multiple = 0
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S004
S006 · calculation
Before
Fermat original signed base normalized remainder := sub(13, 0)
After
Fermat original signed base normalized remainder = 13
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S005
S007 · implies
Before
Fermat original signed base:signed integer value=13;positive modulus=561;exact quotient=13/561;floor q=0
After
value=q*modulus+remainder;normalized remainder=13 in[0,561)
Conditions: none
Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.
Step identifiers and dependencies
Rule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S006
S008 · implies
Before
Fermat original modular exponent:original normalized base=13;original exponent=560;modulus=561
After
initialize accumulator1,current_base=base,remaining=exponent;invariant accumulator*current_base^remaining congruent to original power
Conditions: none
The multiplicative identity gives the exponent0 convention.Each step preserves congruence to the same original power without constructing huge ordinary powers or replacing modular relations with real equalities.
Step identifiers and dependencies
Rule: flt_modular_power_initial_invariant · Uses: G001, S007
S009 · calculation
Before
Fermat original modular exponent bit0 current base square := mul(13, 13)
After
Fermat original modular exponent bit0 current base square = 169
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S008
S010 · calculation
Before
Fermat original modular exponent bit0 squared base reduction exact quotient := div(169, 561)
After
Fermat original modular exponent bit0 squared base reduction exact quotient = 169/561
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S009
S011 · calculation
Before
Fermat original modular exponent bit0 squared base reduction floor quotient multiple := mul(0, 561)
After
Fermat original modular exponent bit0 squared base reduction floor quotient multiple = 0
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S010
S012 · calculation
Before
Fermat original modular exponent bit0 squared base reduction normalized remainder := sub(169, 0)
After
Fermat original modular exponent bit0 squared base reduction normalized remainder = 169
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S011
S013 · implies
Before
Fermat original modular exponent bit0 squared base reduction:signed integer value=169;positive modulus=561;exact quotient=169/561;floor q=0
After
value=q*modulus+remainder;normalized remainder=169 in[0,561)
Conditions: none
Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.
Step identifiers and dependencies
Rule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S012
S014 · implies
Before
Fermat original modular exponent:step=0;previous[accumulator,base,exponent]=[1, 13, 560];low bit=0
After
next[accumulator,base,exponent]=[1, 169, 280];split exponent=2*q+bit preserves original-power invariant
Conditions: none
Replace an even power by a squared base;an odd power also contributes one base factor to the accumulator.Exact reductions preserve congruence and halving the remaining nonnegative exponent guarantees termination.
Step identifiers and dependencies
Rule: flt_each_binary_power_step_exact_invariant · Uses: G001, S013
S015 · calculation
Before
Fermat original modular exponent bit1 current base square := mul(169, 169)
After
Fermat original modular exponent bit1 current base square = 28561
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S014
S016 · calculation
Before
Fermat original modular exponent bit1 squared base reduction exact quotient := div(28561, 561)
After
Fermat original modular exponent bit1 squared base reduction exact quotient = 28561/561
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S015
S017 · calculation
Before
Fermat original modular exponent bit1 squared base reduction floor quotient multiple := mul(50, 561)
After
Fermat original modular exponent bit1 squared base reduction floor quotient multiple = 28050
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S016
S018 · calculation
Before
Fermat original modular exponent bit1 squared base reduction normalized remainder := sub(28561, 28050)
After
Fermat original modular exponent bit1 squared base reduction normalized remainder = 511
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S017
S019 · implies
Before
Fermat original modular exponent bit1 squared base reduction:signed integer value=28561;positive modulus=561;exact quotient=28561/561;floor q=50
After
value=q*modulus+remainder;normalized remainder=511 in[0,561)
Conditions: none
Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.
Step identifiers and dependencies
Rule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S018
S020 · implies
Before
Fermat original modular exponent:step=1;previous[accumulator,base,exponent]=[1, 169, 280];low bit=0
After
next[accumulator,base,exponent]=[1, 511, 140];split exponent=2*q+bit preserves original-power invariant
Conditions: none
Replace an even power by a squared base;an odd power also contributes one base factor to the accumulator.Exact reductions preserve congruence and halving the remaining nonnegative exponent guarantees termination.
Step identifiers and dependencies
Rule: flt_each_binary_power_step_exact_invariant · Uses: G001, S019
S021 · calculation
Before
Fermat original modular exponent bit2 current base square := mul(511, 511)
After
Fermat original modular exponent bit2 current base square = 261121
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S020
S022 · calculation
Before
Fermat original modular exponent bit2 squared base reduction exact quotient := div(261121, 561)
After
Fermat original modular exponent bit2 squared base reduction exact quotient = 261121/561
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S021
S023 · calculation
Before
Fermat original modular exponent bit2 squared base reduction floor quotient multiple := mul(465, 561)
After
Fermat original modular exponent bit2 squared base reduction floor quotient multiple = 260865
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S022
S024 · calculation
Before
Fermat original modular exponent bit2 squared base reduction normalized remainder := sub(261121, 260865)
After
Fermat original modular exponent bit2 squared base reduction normalized remainder = 256
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S023
S025 · implies
Before
Fermat original modular exponent bit2 squared base reduction:signed integer value=261121;positive modulus=561;exact quotient=261121/561;floor q=465
After
value=q*modulus+remainder;normalized remainder=256 in[0,561)
Conditions: none
Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.
Step identifiers and dependencies
Rule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S024
S026 · implies
Before
Fermat original modular exponent:step=2;previous[accumulator,base,exponent]=[1, 511, 140];low bit=0
After
next[accumulator,base,exponent]=[1, 256, 70];split exponent=2*q+bit preserves original-power invariant
Conditions: none
Replace an even power by a squared base;an odd power also contributes one base factor to the accumulator.Exact reductions preserve congruence and halving the remaining nonnegative exponent guarantees termination.
Step identifiers and dependencies
Rule: flt_each_binary_power_step_exact_invariant · Uses: G001, S025
S027 · calculation
Before
Fermat original modular exponent bit3 current base square := mul(256, 256)
After
Fermat original modular exponent bit3 current base square = 65536
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S026
S028 · calculation
Before
Fermat original modular exponent bit3 squared base reduction exact quotient := div(65536, 561)
After
Fermat original modular exponent bit3 squared base reduction exact quotient = 65536/561
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S027
S029 · calculation
Before
Fermat original modular exponent bit3 squared base reduction floor quotient multiple := mul(116, 561)
After
Fermat original modular exponent bit3 squared base reduction floor quotient multiple = 65076
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S028
S030 · calculation
Before
Fermat original modular exponent bit3 squared base reduction normalized remainder := sub(65536, 65076)
After
Fermat original modular exponent bit3 squared base reduction normalized remainder = 460
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S029
S031 · implies
Before
Fermat original modular exponent bit3 squared base reduction:signed integer value=65536;positive modulus=561;exact quotient=65536/561;floor q=116
After
value=q*modulus+remainder;normalized remainder=460 in[0,561)
Conditions: none
Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.
Step identifiers and dependencies
Rule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S030
S032 · implies
Before
Fermat original modular exponent:step=3;previous[accumulator,base,exponent]=[1, 256, 70];low bit=0
After
next[accumulator,base,exponent]=[1, 460, 35];split exponent=2*q+bit preserves original-power invariant
Conditions: none
Replace an even power by a squared base;an odd power also contributes one base factor to the accumulator.Exact reductions preserve congruence and halving the remaining nonnegative exponent guarantees termination.
Step identifiers and dependencies
Rule: flt_each_binary_power_step_exact_invariant · Uses: G001, S031
S033 · calculation
Before
Fermat original modular exponent bit4 accumulator product := mul(1, 460)
After
Fermat original modular exponent bit4 accumulator product = 460
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S032
S034 · calculation
Before
Fermat original modular exponent bit4 accumulator reduction exact quotient := div(460, 561)
After
Fermat original modular exponent bit4 accumulator reduction exact quotient = 460/561
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S033
S035 · calculation
Before
Fermat original modular exponent bit4 accumulator reduction floor quotient multiple := mul(0, 561)
After
Fermat original modular exponent bit4 accumulator reduction floor quotient multiple = 0
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S034
S036 · calculation
Before
Fermat original modular exponent bit4 accumulator reduction normalized remainder := sub(460, 0)
After
Fermat original modular exponent bit4 accumulator reduction normalized remainder = 460
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S035
S037 · implies
Before
Fermat original modular exponent bit4 accumulator reduction:signed integer value=460;positive modulus=561;exact quotient=460/561;floor q=0
After
value=q*modulus+remainder;normalized remainder=460 in[0,561)
Conditions: none
Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.
Step identifiers and dependencies
Rule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S036
S038 · calculation
Before
Fermat original modular exponent bit4 current base square := mul(460, 460)
After
Fermat original modular exponent bit4 current base square = 211600
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S037
S039 · calculation
Before
Fermat original modular exponent bit4 squared base reduction exact quotient := div(211600, 561)
After
Fermat original modular exponent bit4 squared base reduction exact quotient = 211600/561
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S038
S040 · calculation
Before
Fermat original modular exponent bit4 squared base reduction floor quotient multiple := mul(377, 561)
After
Fermat original modular exponent bit4 squared base reduction floor quotient multiple = 211497
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S039
S041 · calculation
Before
Fermat original modular exponent bit4 squared base reduction normalized remainder := sub(211600, 211497)
After
Fermat original modular exponent bit4 squared base reduction normalized remainder = 103
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S040
S042 · implies
Before
Fermat original modular exponent bit4 squared base reduction:signed integer value=211600;positive modulus=561;exact quotient=211600/561;floor q=377
After
value=q*modulus+remainder;normalized remainder=103 in[0,561)
Conditions: none
Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.
Step identifiers and dependencies
Rule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S041
S043 · implies
Before
Fermat original modular exponent:step=4;previous[accumulator,base,exponent]=[1, 460, 35];low bit=1
After
next[accumulator,base,exponent]=[460, 103, 17];split exponent=2*q+bit preserves original-power invariant
Conditions: none
Replace an even power by a squared base;an odd power also contributes one base factor to the accumulator.Exact reductions preserve congruence and halving the remaining nonnegative exponent guarantees termination.
Step identifiers and dependencies
Rule: flt_each_binary_power_step_exact_invariant · Uses: G001, S042
S044 · calculation
Before
Fermat original modular exponent bit5 accumulator product := mul(460, 103)
After
Fermat original modular exponent bit5 accumulator product = 47380
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S043
S045 · calculation
Before
Fermat original modular exponent bit5 accumulator reduction exact quotient := div(47380, 561)
After
Fermat original modular exponent bit5 accumulator reduction exact quotient = 47380/561
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S044
S046 · calculation
Before
Fermat original modular exponent bit5 accumulator reduction floor quotient multiple := mul(84, 561)
After
Fermat original modular exponent bit5 accumulator reduction floor quotient multiple = 47124
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S045
S047 · calculation
Before
Fermat original modular exponent bit5 accumulator reduction normalized remainder := sub(47380, 47124)
After
Fermat original modular exponent bit5 accumulator reduction normalized remainder = 256
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S046
S048 · implies
Before
Fermat original modular exponent bit5 accumulator reduction:signed integer value=47380;positive modulus=561;exact quotient=47380/561;floor q=84
After
value=q*modulus+remainder;normalized remainder=256 in[0,561)
Conditions: none
Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.
Step identifiers and dependencies
Rule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S047
S049 · calculation
Before
Fermat original modular exponent bit5 current base square := mul(103, 103)
After
Fermat original modular exponent bit5 current base square = 10609
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S048
S050 · calculation
Before
Fermat original modular exponent bit5 squared base reduction exact quotient := div(10609, 561)
After
Fermat original modular exponent bit5 squared base reduction exact quotient = 10609/561
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S049
S051 · calculation
Before
Fermat original modular exponent bit5 squared base reduction floor quotient multiple := mul(18, 561)
After
Fermat original modular exponent bit5 squared base reduction floor quotient multiple = 10098
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S050
S052 · calculation
Before
Fermat original modular exponent bit5 squared base reduction normalized remainder := sub(10609, 10098)
After
Fermat original modular exponent bit5 squared base reduction normalized remainder = 511
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S051
S053 · implies
Before
Fermat original modular exponent bit5 squared base reduction:signed integer value=10609;positive modulus=561;exact quotient=10609/561;floor q=18
After
value=q*modulus+remainder;normalized remainder=511 in[0,561)
Conditions: none
Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.
Step identifiers and dependencies
Rule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S052
S054 · implies
Before
Fermat original modular exponent:step=5;previous[accumulator,base,exponent]=[460, 103, 17];low bit=1
After
next[accumulator,base,exponent]=[256, 511, 8];split exponent=2*q+bit preserves original-power invariant
Conditions: none
Replace an even power by a squared base;an odd power also contributes one base factor to the accumulator.Exact reductions preserve congruence and halving the remaining nonnegative exponent guarantees termination.
Step identifiers and dependencies
Rule: flt_each_binary_power_step_exact_invariant · Uses: G001, S053
S055 · calculation
Before
Fermat original modular exponent bit6 current base square := mul(511, 511)
After
Fermat original modular exponent bit6 current base square = 261121
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S054
S056 · calculation
Before
Fermat original modular exponent bit6 squared base reduction exact quotient := div(261121, 561)
After
Fermat original modular exponent bit6 squared base reduction exact quotient = 261121/561
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S055
S057 · calculation
Before
Fermat original modular exponent bit6 squared base reduction floor quotient multiple := mul(465, 561)
After
Fermat original modular exponent bit6 squared base reduction floor quotient multiple = 260865
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S056
S058 · calculation
Before
Fermat original modular exponent bit6 squared base reduction normalized remainder := sub(261121, 260865)
After
Fermat original modular exponent bit6 squared base reduction normalized remainder = 256
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S057
S059 · implies
Before
Fermat original modular exponent bit6 squared base reduction:signed integer value=261121;positive modulus=561;exact quotient=261121/561;floor q=465
After
value=q*modulus+remainder;normalized remainder=256 in[0,561)
Conditions: none
Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.
Step identifiers and dependencies
Rule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S058
S060 · implies
Before
Fermat original modular exponent:step=6;previous[accumulator,base,exponent]=[256, 511, 8];low bit=0
After
next[accumulator,base,exponent]=[256, 256, 4];split exponent=2*q+bit preserves original-power invariant
Conditions: none
Replace an even power by a squared base;an odd power also contributes one base factor to the accumulator.Exact reductions preserve congruence and halving the remaining nonnegative exponent guarantees termination.
Step identifiers and dependencies
Rule: flt_each_binary_power_step_exact_invariant · Uses: G001, S059
S061 · calculation
Before
Fermat original modular exponent bit7 current base square := mul(256, 256)
After
Fermat original modular exponent bit7 current base square = 65536
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S060
S062 · calculation
Before
Fermat original modular exponent bit7 squared base reduction exact quotient := div(65536, 561)
After
Fermat original modular exponent bit7 squared base reduction exact quotient = 65536/561
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S061
S063 · calculation
Before
Fermat original modular exponent bit7 squared base reduction floor quotient multiple := mul(116, 561)
After
Fermat original modular exponent bit7 squared base reduction floor quotient multiple = 65076
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S062
S064 · calculation
Before
Fermat original modular exponent bit7 squared base reduction normalized remainder := sub(65536, 65076)
After
Fermat original modular exponent bit7 squared base reduction normalized remainder = 460
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S063
S065 · implies
Before
Fermat original modular exponent bit7 squared base reduction:signed integer value=65536;positive modulus=561;exact quotient=65536/561;floor q=116
After
value=q*modulus+remainder;normalized remainder=460 in[0,561)
Conditions: none
Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.
Step identifiers and dependencies
Rule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S064
S066 · implies
Before
Fermat original modular exponent:step=7;previous[accumulator,base,exponent]=[256, 256, 4];low bit=0
After
next[accumulator,base,exponent]=[256, 460, 2];split exponent=2*q+bit preserves original-power invariant
Conditions: none
Replace an even power by a squared base;an odd power also contributes one base factor to the accumulator.Exact reductions preserve congruence and halving the remaining nonnegative exponent guarantees termination.
Step identifiers and dependencies
Rule: flt_each_binary_power_step_exact_invariant · Uses: G001, S065
S067 · calculation
Before
Fermat original modular exponent bit8 current base square := mul(460, 460)
After
Fermat original modular exponent bit8 current base square = 211600
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S066
S068 · calculation
Before
Fermat original modular exponent bit8 squared base reduction exact quotient := div(211600, 561)
After
Fermat original modular exponent bit8 squared base reduction exact quotient = 211600/561
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S067
S069 · calculation
Before
Fermat original modular exponent bit8 squared base reduction floor quotient multiple := mul(377, 561)
After
Fermat original modular exponent bit8 squared base reduction floor quotient multiple = 211497
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S068
S070 · calculation
Before
Fermat original modular exponent bit8 squared base reduction normalized remainder := sub(211600, 211497)
After
Fermat original modular exponent bit8 squared base reduction normalized remainder = 103
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S069
S071 · implies
Before
Fermat original modular exponent bit8 squared base reduction:signed integer value=211600;positive modulus=561;exact quotient=211600/561;floor q=377
After
value=q*modulus+remainder;normalized remainder=103 in[0,561)
Conditions: none
Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.
Step identifiers and dependencies
Rule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S070
S072 · implies
Before
Fermat original modular exponent:step=8;previous[accumulator,base,exponent]=[256, 460, 2];low bit=0
After
next[accumulator,base,exponent]=[256, 103, 1];split exponent=2*q+bit preserves original-power invariant
Conditions: none
Replace an even power by a squared base;an odd power also contributes one base factor to the accumulator.Exact reductions preserve congruence and halving the remaining nonnegative exponent guarantees termination.
Step identifiers and dependencies
Rule: flt_each_binary_power_step_exact_invariant · Uses: G001, S071
S073 · calculation
Before
Fermat original modular exponent bit9 accumulator product := mul(256, 103)
After
Fermat original modular exponent bit9 accumulator product = 26368
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S072
S074 · calculation
Before
Fermat original modular exponent bit9 accumulator reduction exact quotient := div(26368, 561)
After
Fermat original modular exponent bit9 accumulator reduction exact quotient = 26368/561
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S073
S075 · calculation
Before
Fermat original modular exponent bit9 accumulator reduction floor quotient multiple := mul(47, 561)
After
Fermat original modular exponent bit9 accumulator reduction floor quotient multiple = 26367
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S074
S076 · calculation
Before
Fermat original modular exponent bit9 accumulator reduction normalized remainder := sub(26368, 26367)
After
Fermat original modular exponent bit9 accumulator reduction normalized remainder = 1
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S075
S077 · implies
Before
Fermat original modular exponent bit9 accumulator reduction:signed integer value=26368;positive modulus=561;exact quotient=26368/561;floor q=47
After
value=q*modulus+remainder;normalized remainder=1 in[0,561)
Conditions: none
Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.
Step identifiers and dependencies
Rule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S076
S078 · calculation
Before
Fermat original modular exponent bit9 current base square := mul(103, 103)
After
Fermat original modular exponent bit9 current base square = 10609
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S077
S079 · calculation
Before
Fermat original modular exponent bit9 squared base reduction exact quotient := div(10609, 561)
After
Fermat original modular exponent bit9 squared base reduction exact quotient = 10609/561
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S078
S080 · calculation
Before
Fermat original modular exponent bit9 squared base reduction floor quotient multiple := mul(18, 561)
After
Fermat original modular exponent bit9 squared base reduction floor quotient multiple = 10098
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S079
S081 · calculation
Before
Fermat original modular exponent bit9 squared base reduction normalized remainder := sub(10609, 10098)
After
Fermat original modular exponent bit9 squared base reduction normalized remainder = 511
Conditions: none
Substitute original roles and established intermediates exactly,retaining signs,denominators,indices and the relevant carrier.
Step identifiers and dependencies
Rule: exact_rational_arithmetic · Uses: G001, S080
S082 · implies
Before
Fermat original modular exponent bit9 squared base reduction:signed integer value=10609;positive modulus=561;exact quotient=10609/561;floor q=18
After
value=q*modulus+remainder;normalized remainder=511 in[0,561)
Conditions: none
Use a positive modulus and floor quotient to obtain the nonnegative representative even for a negative base.Equal remainders express congruence modulo this modulus,not unrestricted integer equality.
Step identifiers and dependencies
Rule: flt_exact_signed_modulo_not_integer_equality · Uses: G001, S081
S083 · implies
Before
Fermat original modular exponent:step=9;previous[accumulator,base,exponent]=[256, 103, 1];low bit=1
After
next[accumulator,base,exponent]=[1, 511, 0];split exponent=2*q+bit preserves original-power invariant
Conditions: none
Replace an even power by a squared base;an odd power also contributes one base factor to the accumulator.Exact reductions preserve congruence and halving the remaining nonnegative exponent guarantees termination.
Step identifiers and dependencies
Rule: flt_each_binary_power_step_exact_invariant · Uses: G001, S082
S084 · implies
Before
Fermat original modular exponent:remaining exponent0;final normalized accumulator=1
After
EXACT original base^560 modulo561=1
Conditions: none
At remaining exponent0 the invariant leaves exactly the accumulator,giving the original power's residue.The arithmetic result alone does not certify a prime modulus.
Step identifiers and dependencies
Rule: flt_modular_power_terminal_not_primality_converse · Uses: G001, S083
S085 · implies
Before
ACTUAL composite modulus=561 certified by a trial factor;ORIGINAL base=13 coprime;computed a^(m-1) modulo m=1
After
THIS chosen composite/base pair passes the Fermat power test,but modulus is NOT prime;counterexample to converse ONLY
Conditions: none
This explicit composite/coprime-base pair refutes the implication from a passing test to primality.It says neither that every composite nor every base passes,and does not refute Fermat's theorem under its prime premise.
Step identifiers and dependencies
Rule: flt_composite_passing_chosen_base_not_all_bases_or_theorem_failure · Uses: G001, S084