scheme
BinPredToFunUnique{
F1()
-> set ,
F2()
-> set ,
P1[
object ,
object ] } :
for
f,
g being
Function of
[:F1(),F2():],
BOOLEAN st ( for
x,
y being
object st
x in F1() &
y in F2() holds
( (
P1[
x,
y] implies
f . (
x,
y)
= TRUE ) & (
P1[
x,
y] implies
f . (
x,
y)
= FALSE ) ) ) & ( for
x,
y being
object st
x in F1() &
y in F2() holds
( (
P1[
x,
y] implies
g . (
x,
y)
= TRUE ) & (
P1[
x,
y] implies
g . (
x,
y)
= FALSE ) ) ) holds
f = g
scheme
Lambda2Unique{
F1()
-> set ,
F2()
-> set ,
F3()
-> set ,
F4(
object ,
object )
-> object } :
for
f,
g being
Function of
[:F1(),F2():],
F3() st ( for
x,
y being
object st
x in F1() &
y in F2() holds
f . (
x,
y)
= F4(
x,
y) ) & ( for
x,
y being
object st
x in F1() &
y in F2() holds
g . (
x,
y)
= F4(
x,
y) ) holds
f = g
theorem Th9:
for
V,
A being
set for
a,
b being
Element of
V st ( for
d being
TypeSCNominativeData of
V,
A holds
a is_a_value_on d ) & ( for
d being
TypeSCNominativeData of
V,
A holds
b is_a_value_on d ) holds
rng <:(denaming (V,A,a)),(denaming (V,A,b)):> c= [:A,A:]
definition
let V,
A be
set ;
let a,
b be
Element of
V;
let p be
Function of
[:A,A:],
BOOLEAN;
coherence
p * <:(denaming (V,A,a)),(denaming (V,A,b)):> is SCPartialNominativePredicate of V,A
end;
::
deftheorem defines
lift_binary_pred NOMIN_4:def 7 :
for V, A being set
for a, b being Element of V
for p being Function of [:A,A:],BOOLEAN holds lift_binary_pred (p,a,b) = p * <:(denaming (V,A,a)),(denaming (V,A,b)):>;
definition
let V,
A be
set ;
let a,
b be
Element of
V;
let op be
Function of
[:A,A:],
A;
coherence
op * <:(denaming (V,A,a)),(denaming (V,A,b)):> is SCBinominativeFunction of V,A
end;
::
deftheorem defines
lift_binary_op NOMIN_4:def 8 :
for V, A being set
for a, b being Element of V
for op being Function of [:A,A:],A holds lift_binary_op (op,a,b) = op * <:(denaming (V,A,a)),(denaming (V,A,b)):>;
definition
let A be
set ;
existence
ex b1 being Function of [:A,A:],BOOLEAN st
for a, b being object st a in A & b in A holds
( ( a = b implies b1 . (a,b) = TRUE ) & ( a <> b implies b1 . (a,b) = FALSE ) )
uniqueness
for b1, b2 being Function of [:A,A:],BOOLEAN st ( for a, b being object st a in A & b in A holds
( ( a = b implies b1 . (a,b) = TRUE ) & ( a <> b implies b1 . (a,b) = FALSE ) ) ) & ( for a, b being object st a in A & b in A holds
( ( a = b implies b2 . (a,b) = TRUE ) & ( a <> b implies b2 . (a,b) = FALSE ) ) ) holds
b1 = b2
end;
definition
let A be
set ;
existence
ex b1 being Function of [:A,A:],BOOLEAN st
for x, y being object st x in A & y in A holds
( ( x less_pred y implies b1 . (x,y) = TRUE ) & ( not x less_pred y implies b1 . (x,y) = FALSE ) )
uniqueness
for b1, b2 being Function of [:A,A:],BOOLEAN st ( for x, y being object st x in A & y in A holds
( ( x less_pred y implies b1 . (x,y) = TRUE ) & ( not x less_pred y implies b1 . (x,y) = FALSE ) ) ) & ( for x, y being object st x in A & y in A holds
( ( x less_pred y implies b2 . (x,y) = TRUE ) & ( not x less_pred y implies b2 . (x,y) = FALSE ) ) ) holds
b1 = b2
end;
theorem Th11:
for
V,
A being
set for
a,
b being
Element of
V st ( for
d being
TypeSCNominativeData of
V,
A holds
a is_a_value_on d ) & ( for
d being
TypeSCNominativeData of
V,
A holds
b is_a_value_on d ) holds
dom (Equality (A,a,b)) = (dom (denaming (V,A,a))) /\ (dom (denaming (V,A,b)))
theorem Th12:
for
V,
A being
set for
a,
b being
Element of
V st ( for
d being
TypeSCNominativeData of
V,
A holds
a is_a_value_on d ) & ( for
d being
TypeSCNominativeData of
V,
A holds
b is_a_value_on d ) holds
dom (less (A,a,b)) = (dom (denaming (V,A,a))) /\ (dom (denaming (V,A,b)))
theorem
for
V,
A being
set for
a,
b being
Element of
V st ( for
d being
TypeSCNominativeData of
V,
A holds
a is_a_value_on d ) & ( for
d being
TypeSCNominativeData of
V,
A holds
b is_a_value_on d ) & ( for
d being
TypeSCNominativeData of
V,
A holds
a is_ext_real_on d ) & ( for
d being
TypeSCNominativeData of
V,
A holds
b is_ext_real_on d ) holds
PP_not (Equality (A,a,b)) = PP_or (
(less (A,a,b)),
(less (A,b,a)))
theorem
for
V,
A being
set for
d being
TypeSCNominativeData of
V,
A for
a,
b being
Element of
V st ( for
d being
TypeSCNominativeData of
V,
A holds
a is_a_value_on d ) & ( for
d being
TypeSCNominativeData of
V,
A holds
b is_a_value_on d ) &
a is_ext_real_on d &
b is_ext_real_on d &
d in dom (PP_not (Equality (A,a,b))) &
(PP_not (Equality (A,a,b))) . d = TRUE & not (
d in dom (less (A,a,b)) &
(less (A,a,b)) . d = TRUE ) holds
(
d in dom (less (A,b,a)) &
(less (A,b,a)) . d = TRUE )
definition
let A be
set ;
assume A1:
A is
complex-containing
;
existence
ex b1 being Function of [:A,A:],A st
for x, y being object st x in A & y in A holds
b1 . (x,y) = subtraction (x,y)
uniqueness
for b1, b2 being Function of [:A,A:],A st ( for x, y being object st x in A & y in A holds
b1 . (x,y) = subtraction (x,y) ) & ( for x, y being object st x in A & y in A holds
b2 . (x,y) = subtraction (x,y) ) holds
b1 = b2
end;
definition
let V,
A be
set ;
let a,
b be
Element of
V;
func gcd_conditional_step (
V,
A,
a,
b)
-> SCBinominativeFunction of
V,
A equals
PP_IF (
(less (A,b,a)),
(SC_assignment ((subtraction (A,a,b)),a)),
(PPid (ND (V,A))));
coherence
PP_IF ((less (A,b,a)),(SC_assignment ((subtraction (A,a,b)),a)),(PPid (ND (V,A)))) is SCBinominativeFunction of V,A
;
end;
::
deftheorem defines
gcd_conditional_step NOMIN_4:def 17 :
for V, A being set
for a, b being Element of V holds gcd_conditional_step (V,A,a,b) = PP_IF ((less (A,b,a)),(SC_assignment ((subtraction (A,a,b)),a)),(PPid (ND (V,A))));
definition
let V,
A be
set ;
let a,
b be
Element of
V;
func gcd_loop_body (
V,
A,
a,
b)
-> SCBinominativeFunction of
V,
A equals
PP_composition (
(gcd_conditional_step (V,A,a,b)),
(gcd_conditional_step (V,A,b,a)));
coherence
PP_composition ((gcd_conditional_step (V,A,a,b)),(gcd_conditional_step (V,A,b,a))) is SCBinominativeFunction of V,A
;
end;
::
deftheorem defines
gcd_loop_body NOMIN_4:def 18 :
for V, A being set
for a, b being Element of V holds gcd_loop_body (V,A,a,b) = PP_composition ((gcd_conditional_step (V,A,a,b)),(gcd_conditional_step (V,A,b,a)));
definition
let V,
A be
set ;
let a,
b be
Element of
V;
func gcd_main_loop (
V,
A,
a,
b)
-> SCBinominativeFunction of
V,
A equals
PP_while (
(PP_not (Equality (A,a,b))),
(gcd_loop_body (V,A,a,b)));
coherence
PP_while ((PP_not (Equality (A,a,b))),(gcd_loop_body (V,A,a,b))) is SCBinominativeFunction of V,A
;
end;
::
deftheorem defines
gcd_main_loop NOMIN_4:def 19 :
for V, A being set
for a, b being Element of V holds gcd_main_loop (V,A,a,b) = PP_while ((PP_not (Equality (A,a,b))),(gcd_loop_body (V,A,a,b)));
definition
let V,
A be
set ;
let a,
b be
Element of
V;
let x,
y be
object ;
func gcd_var_init (
V,
A,
a,
b,
x,
y)
-> SCBinominativeFunction of
V,
A equals
PP_composition (
(SC_assignment ((denaming (V,A,x)),a)),
(SC_assignment ((denaming (V,A,y)),b)));
coherence
PP_composition ((SC_assignment ((denaming (V,A,x)),a)),(SC_assignment ((denaming (V,A,y)),b))) is SCBinominativeFunction of V,A
;
end;
::
deftheorem defines
gcd_var_init NOMIN_4:def 20 :
for V, A being set
for a, b being Element of V
for x, y being object holds gcd_var_init (V,A,a,b,x,y) = PP_composition ((SC_assignment ((denaming (V,A,x)),a)),(SC_assignment ((denaming (V,A,y)),b)));
definition
let V,
A be
set ;
let a,
b be
Element of
V;
let x,
y be
object ;
func gcd_main_part (
V,
A,
a,
b,
x,
y)
-> SCBinominativeFunction of
V,
A equals
PP_composition (
(gcd_var_init (V,A,a,b,x,y)),
(gcd_main_loop (V,A,a,b)));
coherence
PP_composition ((gcd_var_init (V,A,a,b,x,y)),(gcd_main_loop (V,A,a,b))) is SCBinominativeFunction of V,A
;
end;
::
deftheorem defines
gcd_main_part NOMIN_4:def 21 :
for V, A being set
for a, b being Element of V
for x, y being object holds gcd_main_part (V,A,a,b,x,y) = PP_composition ((gcd_var_init (V,A,a,b,x,y)),(gcd_main_loop (V,A,a,b)));
definition
let V,
A be
set ;
let a,
b be
Element of
V;
let x,
y be
object ;
let z be
Element of
V;
func gcd_program (
V,
A,
a,
b,
x,
y,
z)
-> SCBinominativeFunction of
V,
A equals
PP_composition (
(gcd_main_part (V,A,a,b,x,y)),
(SC_assignment ((denaming (V,A,a)),z)));
coherence
PP_composition ((gcd_main_part (V,A,a,b,x,y)),(SC_assignment ((denaming (V,A,a)),z))) is SCBinominativeFunction of V,A
;
end;
::
deftheorem defines
gcd_program NOMIN_4:def 22 :
for V, A being set
for a, b being Element of V
for x, y being object
for z being Element of V holds gcd_program (V,A,a,b,x,y,z) = PP_composition ((gcd_main_part (V,A,a,b,x,y)),(SC_assignment ((denaming (V,A,a)),z)));
::
deftheorem defines
valid_gcd_input_pred NOMIN_4:def 23 :
for V, A being set
for x, y being object
for x0, y0 being Nat
for d being object holds
( valid_gcd_input_pred V,A,x,y,x0,y0,d iff ex d1 being NonatomicND of V,A st
( d = d1 & x in dom d1 & y in dom d1 & d1 . x = x0 & d1 . y = y0 ) );
definition
let V,
A be
set ;
let x,
y be
object ;
let x0,
y0 be
Nat;
func valid_gcd_input (
V,
A,
x,
y,
x0,
y0)
-> SCPartialNominativePredicate of
V,
A means :
Def24:
(
dom it = ND (
V,
A) & ( for
d being
object st
d in dom it holds
( (
valid_gcd_input_pred V,
A,
x,
y,
x0,
y0,
d implies
it . d = TRUE ) & ( not
valid_gcd_input_pred V,
A,
x,
y,
x0,
y0,
d implies
it . d = FALSE ) ) ) );
existence
ex b1 being SCPartialNominativePredicate of V,A st
( dom b1 = ND (V,A) & ( for d being object st d in dom b1 holds
( ( valid_gcd_input_pred V,A,x,y,x0,y0,d implies b1 . d = TRUE ) & ( not valid_gcd_input_pred V,A,x,y,x0,y0,d implies b1 . d = FALSE ) ) ) )
uniqueness
for b1, b2 being SCPartialNominativePredicate of V,A st dom b1 = ND (V,A) & ( for d being object st d in dom b1 holds
( ( valid_gcd_input_pred V,A,x,y,x0,y0,d implies b1 . d = TRUE ) & ( not valid_gcd_input_pred V,A,x,y,x0,y0,d implies b1 . d = FALSE ) ) ) & dom b2 = ND (V,A) & ( for d being object st d in dom b2 holds
( ( valid_gcd_input_pred V,A,x,y,x0,y0,d implies b2 . d = TRUE ) & ( not valid_gcd_input_pred V,A,x,y,x0,y0,d implies b2 . d = FALSE ) ) ) holds
b1 = b2
end;
::
deftheorem Def24 defines
valid_gcd_input NOMIN_4:def 24 :
for V, A being set
for x, y being object
for x0, y0 being Nat
for b7 being SCPartialNominativePredicate of V,A holds
( b7 = valid_gcd_input (V,A,x,y,x0,y0) iff ( dom b7 = ND (V,A) & ( for d being object st d in dom b7 holds
( ( valid_gcd_input_pred V,A,x,y,x0,y0,d implies b7 . d = TRUE ) & ( not valid_gcd_input_pred V,A,x,y,x0,y0,d implies b7 . d = FALSE ) ) ) ) );
definition
let V,
A be
set ;
let z be
Element of
V;
let x0,
y0 be
Nat;
set D =
{ d where d is TypeSCNominativeData of V,A : d in dom (denaming (V,A,z)) } ;
func valid_gcd_output (
V,
A,
z,
x0,
y0)
-> SCPartialNominativePredicate of
V,
A means :
Def26:
(
dom it = { d where d is TypeSCNominativeData of V,A : d in dom (denaming (V,A,z)) } & ( for
d being
object st
d in dom it holds
( (
valid_gcd_output_pred V,
A,
z,
x0,
y0,
d implies
it . d = TRUE ) & ( not
valid_gcd_output_pred V,
A,
z,
x0,
y0,
d implies
it . d = FALSE ) ) ) );
existence
ex b1 being SCPartialNominativePredicate of V,A st
( dom b1 = { d where d is TypeSCNominativeData of V,A : d in dom (denaming (V,A,z)) } & ( for d being object st d in dom b1 holds
( ( valid_gcd_output_pred V,A,z,x0,y0,d implies b1 . d = TRUE ) & ( not valid_gcd_output_pred V,A,z,x0,y0,d implies b1 . d = FALSE ) ) ) )
uniqueness
for b1, b2 being SCPartialNominativePredicate of V,A st dom b1 = { d where d is TypeSCNominativeData of V,A : d in dom (denaming (V,A,z)) } & ( for d being object st d in dom b1 holds
( ( valid_gcd_output_pred V,A,z,x0,y0,d implies b1 . d = TRUE ) & ( not valid_gcd_output_pred V,A,z,x0,y0,d implies b1 . d = FALSE ) ) ) & dom b2 = { d where d is TypeSCNominativeData of V,A : d in dom (denaming (V,A,z)) } & ( for d being object st d in dom b2 holds
( ( valid_gcd_output_pred V,A,z,x0,y0,d implies b2 . d = TRUE ) & ( not valid_gcd_output_pred V,A,z,x0,y0,d implies b2 . d = FALSE ) ) ) holds
b1 = b2
end;
::
deftheorem Def26 defines
valid_gcd_output NOMIN_4:def 26 :
for V, A being set
for z being Element of V
for x0, y0 being Nat
for b6 being SCPartialNominativePredicate of V,A holds
( b6 = valid_gcd_output (V,A,z,x0,y0) iff ( dom b6 = { d where d is TypeSCNominativeData of V,A : d in dom (denaming (V,A,z)) } & ( for d being object st d in dom b6 holds
( ( valid_gcd_output_pred V,A,z,x0,y0,d implies b6 . d = TRUE ) & ( not valid_gcd_output_pred V,A,z,x0,y0,d implies b6 . d = FALSE ) ) ) ) );
::
deftheorem defines
gcd_inv_pred NOMIN_4:def 27 :
for V, A being set
for a, b being Element of V
for x0, y0 being Nat
for d being object holds
( gcd_inv_pred V,A,a,b,x0,y0,d iff ex d1 being NonatomicND of V,A st
( d = d1 & a in dom d1 & b in dom d1 & ex x, y being Nat st
( x = d1 . a & y = d1 . b & x gcd y = x0 gcd y0 ) ) );
definition
let V,
A be
set ;
let a,
b be
Element of
V;
let x0,
y0 be
Nat;
func gcd_inv (
V,
A,
a,
b,
x0,
y0)
-> SCPartialNominativePredicate of
V,
A means :
Def28:
(
dom it = ND (
V,
A) & ( for
d being
object st
d in dom it holds
( (
gcd_inv_pred V,
A,
a,
b,
x0,
y0,
d implies
it . d = TRUE ) & ( not
gcd_inv_pred V,
A,
a,
b,
x0,
y0,
d implies
it . d = FALSE ) ) ) );
existence
ex b1 being SCPartialNominativePredicate of V,A st
( dom b1 = ND (V,A) & ( for d being object st d in dom b1 holds
( ( gcd_inv_pred V,A,a,b,x0,y0,d implies b1 . d = TRUE ) & ( not gcd_inv_pred V,A,a,b,x0,y0,d implies b1 . d = FALSE ) ) ) )
uniqueness
for b1, b2 being SCPartialNominativePredicate of V,A st dom b1 = ND (V,A) & ( for d being object st d in dom b1 holds
( ( gcd_inv_pred V,A,a,b,x0,y0,d implies b1 . d = TRUE ) & ( not gcd_inv_pred V,A,a,b,x0,y0,d implies b1 . d = FALSE ) ) ) & dom b2 = ND (V,A) & ( for d being object st d in dom b2 holds
( ( gcd_inv_pred V,A,a,b,x0,y0,d implies b2 . d = TRUE ) & ( not gcd_inv_pred V,A,a,b,x0,y0,d implies b2 . d = FALSE ) ) ) holds
b1 = b2
end;
::
deftheorem Def28 defines
gcd_inv NOMIN_4:def 28 :
for V, A being set
for a, b being Element of V
for x0, y0 being Nat
for b7 being SCPartialNominativePredicate of V,A holds
( b7 = gcd_inv (V,A,a,b,x0,y0) iff ( dom b7 = ND (V,A) & ( for d being object st d in dom b7 holds
( ( gcd_inv_pred V,A,a,b,x0,y0,d implies b7 . d = TRUE ) & ( not gcd_inv_pred V,A,a,b,x0,y0,d implies b7 . d = FALSE ) ) ) ) );
theorem Th15:
for
V,
A being
set for
a being
Element of
V for
x being
object for
p being
SCPartialNominativePredicate of
V,
A holds
<*(PP_inversion (SC_Psuperpos (p,(denaming (V,A,x)),a))),(SC_assignment ((denaming (V,A,x)),a)),p*> is
SFHT of
(ND (V,A))
theorem Th16:
for
V,
A being
set for
a,
b being
Element of
V for
x,
y being
object for
x0,
y0 being
Nat st not
V is
empty &
A is_without_nonatomicND_wrt V &
a <> b &
a <> y holds
<*(valid_gcd_input (V,A,x,y,x0,y0)),(gcd_var_init (V,A,a,b,x,y)),(gcd_inv (V,A,a,b,x0,y0))*> is
SFHT of
(ND (V,A))
theorem Th17:
for
V,
A being
set for
a,
b being
Element of
V for
x0,
y0 being
Nat st not
V is
empty &
A is_without_nonatomicND_wrt V &
a <> b &
A is
complex-containing & ( for
d being
TypeSCNominativeData of
V,
A holds
a is_complex_on d ) & ( for
d being
TypeSCNominativeData of
V,
A holds
b is_complex_on d ) holds
<*(PP_and ((less (A,b,a)),(gcd_inv (V,A,a,b,x0,y0)))),(SC_assignment ((subtraction (A,a,b)),a)),(gcd_inv (V,A,a,b,x0,y0))*> is
SFHT of
(ND (V,A))
theorem Th18:
for
V,
A being
set for
a,
b being
Element of
V for
x0,
y0 being
Nat st not
V is
empty &
A is_without_nonatomicND_wrt V &
a <> b &
A is
complex-containing & ( for
d being
TypeSCNominativeData of
V,
A holds
a is_complex_on d ) & ( for
d being
TypeSCNominativeData of
V,
A holds
b is_complex_on d ) holds
<*(PP_and ((less (A,a,b)),(gcd_inv (V,A,a,b,x0,y0)))),(SC_assignment ((subtraction (A,b,a)),b)),(gcd_inv (V,A,a,b,x0,y0))*> is
SFHT of
(ND (V,A))
theorem Th19:
for
V,
A being
set for
a,
b being
Element of
V for
x0,
y0 being
Nat st not
V is
empty &
A is_without_nonatomicND_wrt V &
a <> b &
A is
complex-containing & ( for
d being
TypeSCNominativeData of
V,
A holds
a is_complex_on d ) & ( for
d being
TypeSCNominativeData of
V,
A holds
b is_complex_on d ) holds
<*(gcd_inv (V,A,a,b,x0,y0)),(gcd_conditional_step (V,A,a,b)),(gcd_inv (V,A,a,b,x0,y0))*> is
SFHT of
(ND (V,A))
theorem Th20:
for
V,
A being
set for
a,
b being
Element of
V for
x0,
y0 being
Nat st not
V is
empty &
A is_without_nonatomicND_wrt V &
a <> b &
A is
complex-containing & ( for
d being
TypeSCNominativeData of
V,
A holds
a is_complex_on d ) & ( for
d being
TypeSCNominativeData of
V,
A holds
b is_complex_on d ) holds
<*(gcd_inv (V,A,a,b,x0,y0)),(gcd_conditional_step (V,A,b,a)),(gcd_inv (V,A,a,b,x0,y0))*> is
SFHT of
(ND (V,A))
theorem Th21:
for
V,
A being
set for
a,
b being
Element of
V for
x0,
y0 being
Nat st not
V is
empty &
A is_without_nonatomicND_wrt V &
a <> b &
A is
complex-containing & ( for
d being
TypeSCNominativeData of
V,
A holds
a is_complex_on d ) & ( for
d being
TypeSCNominativeData of
V,
A holds
b is_complex_on d ) holds
<*(gcd_inv (V,A,a,b,x0,y0)),(gcd_loop_body (V,A,a,b)),(gcd_inv (V,A,a,b,x0,y0))*> is
SFHT of
(ND (V,A))
theorem Th23:
for
V,
A being
set for
a,
b being
Element of
V for
x0,
y0 being
Nat st not
V is
empty &
A is_without_nonatomicND_wrt V &
a <> b &
A is
complex-containing & ( for
d being
TypeSCNominativeData of
V,
A holds
a is_complex_on d ) & ( for
d being
TypeSCNominativeData of
V,
A holds
b is_complex_on d ) holds
<*(gcd_inv (V,A,a,b,x0,y0)),(gcd_main_loop (V,A,a,b)),(PP_and ((Equality (A,a,b)),(gcd_inv (V,A,a,b,x0,y0))))*> is
SFHT of
(ND (V,A))
theorem Th24:
for
V,
A being
set for
a,
b being
Element of
V for
x,
y being
object for
x0,
y0 being
Nat st not
V is
empty &
A is_without_nonatomicND_wrt V &
a <> b &
a <> y &
A is
complex-containing & ( for
d being
TypeSCNominativeData of
V,
A holds
a is_complex_on d ) & ( for
d being
TypeSCNominativeData of
V,
A holds
b is_complex_on d ) holds
<*(valid_gcd_input (V,A,x,y,x0,y0)),(gcd_main_part (V,A,a,b,x,y)),(PP_and ((Equality (A,a,b)),(gcd_inv (V,A,a,b,x0,y0))))*> is
SFHT of
(ND (V,A))
theorem Th25:
for
V,
A being
set for
a,
b,
z being
Element of
V for
x0,
y0 being
Nat st not
V is
empty &
A is_without_nonatomicND_wrt V & ( for
d being
TypeSCNominativeData of
V,
A holds
a is_a_value_on d ) & ( for
d being
TypeSCNominativeData of
V,
A holds
b is_a_value_on d ) holds
<*(PP_and ((Equality (A,a,b)),(gcd_inv (V,A,a,b,x0,y0)))),(SC_assignment ((denaming (V,A,a)),z)),(valid_gcd_output (V,A,z,x0,y0))*> is
SFHT of
(ND (V,A))
theorem Th26:
for
V,
A being
set for
a,
b,
z being
Element of
V for
x0,
y0 being
Nat st
A is
complex-containing & ( for
d being
TypeSCNominativeData of
V,
A holds
a is_complex_on d ) & ( for
d being
TypeSCNominativeData of
V,
A holds
b is_complex_on d ) holds
<*(PP_inversion (PP_and ((Equality (A,a,b)),(gcd_inv (V,A,a,b,x0,y0))))),(SC_assignment ((denaming (V,A,a)),z)),(valid_gcd_output (V,A,z,x0,y0))*> is
SFHT of
(ND (V,A))
theorem
for
V,
A being
set for
a,
b,
z being
Element of
V for
x,
y being
object for
x0,
y0 being
Nat st not
V is
empty &
A is_without_nonatomicND_wrt V &
a <> b &
a <> y &
A is
complex-containing & ( for
d being
TypeSCNominativeData of
V,
A holds
a is_complex_on d ) & ( for
d being
TypeSCNominativeData of
V,
A holds
b is_complex_on d ) holds
<*(valid_gcd_input (V,A,x,y,x0,y0)),(gcd_program (V,A,a,b,x,y,z)),(valid_gcd_output (V,A,z,x0,y0))*> is
SFHT of
(ND (V,A))
:: Atomic data are assumed to be natural numbers
:: Basic operations and relations on atomic data include difference operation (subtraction) and comparisons (less, Equality)
:: Pseudo code of the algorithm
:: Input: nonnegative integers x and y
:: Output: nonnegative integer z = gcd(x,y)
:: a := x;
:: b := y;
:: while not (a=b) do
:: if b<a then a := a-b;
:: if a<b then b := b-a;
:: end;
:: z := a;