Step-by-step derivation
S001 · implies
Before
source operation=flt-all-integer;original snapshot and mathematics retained
After
explicit ordered source output fields=[p, normalized_base, power_p, comparison_residue, congruent, 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=59;complete trial range2..floor_sqrt=7
After
checked rows[divisor,quotient,remainder]=[[2, 29, 1], [3, 19, 2], [4, 14, 3], [5, 11, 4], [6, 9, 5], [7, 8, 3]];first exact factor=null;prime=Yes
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=1003;positive modulus=59;use nonnegative gcd inputs=[1003, 59]
After
ALL Euclidean rows[left,right,q,r]=[[1003, 59, 17, 0]];terminal nonnegative gcd=59;coprime=No
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(1003, 59)
After
Fermat original signed base exact quotient = 17
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(17, 59)
After
Fermat original signed base floor quotient multiple = 1003
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(1003, 1003)
After
Fermat original signed base normalized remainder = 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, S005
S007 · implies
Before
Fermat original signed base:signed integer value=1003;positive modulus=59;exact quotient=17;floor q=17
After
value=q*modulus+remainder;normalized remainder=0 in[0,59)
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=0;original exponent=59;modulus=59
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 accumulator product := mul(1, 0)
After
Fermat original modular exponent bit0 accumulator product = 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, S008
S010 · calculation
Before
Fermat original modular exponent bit0 accumulator reduction exact quotient := div(0, 59)
After
Fermat original modular exponent bit0 accumulator reduction exact quotient = 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, S009
S011 · calculation
Before
Fermat original modular exponent bit0 accumulator reduction floor quotient multiple := mul(0, 59)
After
Fermat original modular exponent bit0 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, S010
S012 · calculation
Before
Fermat original modular exponent bit0 accumulator reduction normalized remainder := sub(0, 0)
After
Fermat original modular exponent bit0 accumulator reduction normalized remainder = 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, S011
S013 · implies
Before
Fermat original modular exponent bit0 accumulator reduction:signed integer value=0;positive modulus=59;exact quotient=0;floor q=0
After
value=q*modulus+remainder;normalized remainder=0 in[0,59)
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 · calculation
Before
Fermat original modular exponent bit0 current base square := mul(0, 0)
After
Fermat original modular exponent bit0 current base square = 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, S013
S015 · calculation
Before
Fermat original modular exponent bit0 squared base reduction exact quotient := div(0, 59)
After
Fermat original modular exponent bit0 squared base reduction exact quotient = 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, S014
S016 · calculation
Before
Fermat original modular exponent bit0 squared base reduction floor quotient multiple := mul(0, 59)
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, S015
S017 · calculation
Before
Fermat original modular exponent bit0 squared base reduction normalized remainder := sub(0, 0)
After
Fermat original modular exponent bit0 squared base reduction normalized remainder = 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, S016
S018 · implies
Before
Fermat original modular exponent bit0 squared base reduction:signed integer value=0;positive modulus=59;exact quotient=0;floor q=0
After
value=q*modulus+remainder;normalized remainder=0 in[0,59)
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, S017
S019 · implies
Before
Fermat original modular exponent:step=0;previous[accumulator,base,exponent]=[1, 0, 59];low bit=1
After
next[accumulator,base,exponent]=[0, 0, 29];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, S018
S020 · calculation
Before
Fermat original modular exponent bit1 accumulator product := mul(0, 0)
After
Fermat original modular exponent bit1 accumulator product = 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, S019
S021 · calculation
Before
Fermat original modular exponent bit1 accumulator reduction exact quotient := div(0, 59)
After
Fermat original modular exponent bit1 accumulator reduction exact quotient = 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, S020
S022 · calculation
Before
Fermat original modular exponent bit1 accumulator reduction floor quotient multiple := mul(0, 59)
After
Fermat original modular exponent bit1 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, S021
S023 · calculation
Before
Fermat original modular exponent bit1 accumulator reduction normalized remainder := sub(0, 0)
After
Fermat original modular exponent bit1 accumulator reduction normalized remainder = 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, S022
S024 · implies
Before
Fermat original modular exponent bit1 accumulator reduction:signed integer value=0;positive modulus=59;exact quotient=0;floor q=0
After
value=q*modulus+remainder;normalized remainder=0 in[0,59)
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, S023
S025 · calculation
Before
Fermat original modular exponent bit1 current base square := mul(0, 0)
After
Fermat original modular exponent bit1 current base square = 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, S024
S026 · calculation
Before
Fermat original modular exponent bit1 squared base reduction exact quotient := div(0, 59)
After
Fermat original modular exponent bit1 squared base reduction exact quotient = 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, S025
S027 · calculation
Before
Fermat original modular exponent bit1 squared base reduction floor quotient multiple := mul(0, 59)
After
Fermat original modular exponent bit1 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, S026
S028 · calculation
Before
Fermat original modular exponent bit1 squared base reduction normalized remainder := sub(0, 0)
After
Fermat original modular exponent bit1 squared base reduction normalized remainder = 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, S027
S029 · implies
Before
Fermat original modular exponent bit1 squared base reduction:signed integer value=0;positive modulus=59;exact quotient=0;floor q=0
After
value=q*modulus+remainder;normalized remainder=0 in[0,59)
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, S028
S030 · implies
Before
Fermat original modular exponent:step=1;previous[accumulator,base,exponent]=[0, 0, 29];low bit=1
After
next[accumulator,base,exponent]=[0, 0, 14];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, S029
S031 · calculation
Before
Fermat original modular exponent bit2 current base square := mul(0, 0)
After
Fermat original modular exponent bit2 current base square = 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, S030
S032 · calculation
Before
Fermat original modular exponent bit2 squared base reduction exact quotient := div(0, 59)
After
Fermat original modular exponent bit2 squared base reduction exact quotient = 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, S031
S033 · calculation
Before
Fermat original modular exponent bit2 squared base reduction floor quotient multiple := mul(0, 59)
After
Fermat original modular exponent bit2 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, S032
S034 · calculation
Before
Fermat original modular exponent bit2 squared base reduction normalized remainder := sub(0, 0)
After
Fermat original modular exponent bit2 squared base reduction normalized remainder = 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, S033
S035 · implies
Before
Fermat original modular exponent bit2 squared base reduction:signed integer value=0;positive modulus=59;exact quotient=0;floor q=0
After
value=q*modulus+remainder;normalized remainder=0 in[0,59)
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, S034
S036 · implies
Before
Fermat original modular exponent:step=2;previous[accumulator,base,exponent]=[0, 0, 14];low bit=0
After
next[accumulator,base,exponent]=[0, 0, 7];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, S035
S037 · calculation
Before
Fermat original modular exponent bit3 accumulator product := mul(0, 0)
After
Fermat original modular exponent bit3 accumulator product = 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, S036
S038 · calculation
Before
Fermat original modular exponent bit3 accumulator reduction exact quotient := div(0, 59)
After
Fermat original modular exponent bit3 accumulator reduction exact quotient = 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, S037
S039 · calculation
Before
Fermat original modular exponent bit3 accumulator reduction floor quotient multiple := mul(0, 59)
After
Fermat original modular exponent bit3 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, S038
S040 · calculation
Before
Fermat original modular exponent bit3 accumulator reduction normalized remainder := sub(0, 0)
After
Fermat original modular exponent bit3 accumulator reduction normalized remainder = 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, S039
S041 · implies
Before
Fermat original modular exponent bit3 accumulator reduction:signed integer value=0;positive modulus=59;exact quotient=0;floor q=0
After
value=q*modulus+remainder;normalized remainder=0 in[0,59)
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, S040
S042 · calculation
Before
Fermat original modular exponent bit3 current base square := mul(0, 0)
After
Fermat original modular exponent bit3 current base square = 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, S041
S043 · calculation
Before
Fermat original modular exponent bit3 squared base reduction exact quotient := div(0, 59)
After
Fermat original modular exponent bit3 squared base reduction exact quotient = 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, S042
S044 · calculation
Before
Fermat original modular exponent bit3 squared base reduction floor quotient multiple := mul(0, 59)
After
Fermat original modular exponent bit3 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, S043
S045 · calculation
Before
Fermat original modular exponent bit3 squared base reduction normalized remainder := sub(0, 0)
After
Fermat original modular exponent bit3 squared base reduction normalized remainder = 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, S044
S046 · implies
Before
Fermat original modular exponent bit3 squared base reduction:signed integer value=0;positive modulus=59;exact quotient=0;floor q=0
After
value=q*modulus+remainder;normalized remainder=0 in[0,59)
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, S045
S047 · implies
Before
Fermat original modular exponent:step=3;previous[accumulator,base,exponent]=[0, 0, 7];low bit=1
After
next[accumulator,base,exponent]=[0, 0, 3];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, S046
S048 · calculation
Before
Fermat original modular exponent bit4 accumulator product := mul(0, 0)
After
Fermat original modular exponent bit4 accumulator product = 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, S047
S049 · calculation
Before
Fermat original modular exponent bit4 accumulator reduction exact quotient := div(0, 59)
After
Fermat original modular exponent bit4 accumulator reduction exact quotient = 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, S048
S050 · calculation
Before
Fermat original modular exponent bit4 accumulator reduction floor quotient multiple := mul(0, 59)
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, S049
S051 · calculation
Before
Fermat original modular exponent bit4 accumulator reduction normalized remainder := sub(0, 0)
After
Fermat original modular exponent bit4 accumulator reduction normalized remainder = 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, S050
S052 · implies
Before
Fermat original modular exponent bit4 accumulator reduction:signed integer value=0;positive modulus=59;exact quotient=0;floor q=0
After
value=q*modulus+remainder;normalized remainder=0 in[0,59)
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, S051
S053 · calculation
Before
Fermat original modular exponent bit4 current base square := mul(0, 0)
After
Fermat original modular exponent bit4 current base square = 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, S052
S054 · calculation
Before
Fermat original modular exponent bit4 squared base reduction exact quotient := div(0, 59)
After
Fermat original modular exponent bit4 squared base reduction exact quotient = 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, S053
S055 · calculation
Before
Fermat original modular exponent bit4 squared base reduction floor quotient multiple := mul(0, 59)
After
Fermat original modular exponent bit4 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, S054
S056 · calculation
Before
Fermat original modular exponent bit4 squared base reduction normalized remainder := sub(0, 0)
After
Fermat original modular exponent bit4 squared base reduction normalized remainder = 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, S055
S057 · implies
Before
Fermat original modular exponent bit4 squared base reduction:signed integer value=0;positive modulus=59;exact quotient=0;floor q=0
After
value=q*modulus+remainder;normalized remainder=0 in[0,59)
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, S056
S058 · implies
Before
Fermat original modular exponent:step=4;previous[accumulator,base,exponent]=[0, 0, 3];low bit=1
After
next[accumulator,base,exponent]=[0, 0, 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, S057
S059 · calculation
Before
Fermat original modular exponent bit5 accumulator product := mul(0, 0)
After
Fermat original modular exponent bit5 accumulator product = 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, S058
S060 · calculation
Before
Fermat original modular exponent bit5 accumulator reduction exact quotient := div(0, 59)
After
Fermat original modular exponent bit5 accumulator reduction exact quotient = 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, S059
S061 · calculation
Before
Fermat original modular exponent bit5 accumulator reduction floor quotient multiple := mul(0, 59)
After
Fermat original modular exponent bit5 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, S060
S062 · calculation
Before
Fermat original modular exponent bit5 accumulator reduction normalized remainder := sub(0, 0)
After
Fermat original modular exponent bit5 accumulator reduction normalized remainder = 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, S061
S063 · implies
Before
Fermat original modular exponent bit5 accumulator reduction:signed integer value=0;positive modulus=59;exact quotient=0;floor q=0
After
value=q*modulus+remainder;normalized remainder=0 in[0,59)
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, S062
S064 · calculation
Before
Fermat original modular exponent bit5 current base square := mul(0, 0)
After
Fermat original modular exponent bit5 current base square = 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, S063
S065 · calculation
Before
Fermat original modular exponent bit5 squared base reduction exact quotient := div(0, 59)
After
Fermat original modular exponent bit5 squared base reduction exact quotient = 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, S064
S066 · calculation
Before
Fermat original modular exponent bit5 squared base reduction floor quotient multiple := mul(0, 59)
After
Fermat original modular exponent bit5 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, S065
S067 · calculation
Before
Fermat original modular exponent bit5 squared base reduction normalized remainder := sub(0, 0)
After
Fermat original modular exponent bit5 squared base reduction normalized remainder = 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, S066
S068 · implies
Before
Fermat original modular exponent bit5 squared base reduction:signed integer value=0;positive modulus=59;exact quotient=0;floor q=0
After
value=q*modulus+remainder;normalized remainder=0 in[0,59)
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, S067
S069 · implies
Before
Fermat original modular exponent:step=5;previous[accumulator,base,exponent]=[0, 0, 1];low bit=1
After
next[accumulator,base,exponent]=[0, 0, 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, S068
S070 · implies
Before
Fermat original modular exponent:remaining exponent0;final normalized accumulator=0
After
EXACT original base^59 modulo59=0
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, S069
S071 · implies
Before
ACTUAL prime p=59;original a=1003 is divisible by p;normalized residue0;positive exponent p
After
a^p residue=0=0=a residue;NO cancellation of a or0 needed
Conditions: none
When p divides a,it also divides the positive p-th power,so both residues are0.This branch does not cancel0 to derive the coprime form.
Step identifiers and dependencies
Rule: flt_all_integer_zero_residue_case_no_invalid_cancellation · Uses: G001, S070