:: A Construction of an Abstract Space of Congruence of Vectors
:: by Grzegorz Lewandowski and Krzysztof Pra\.zmowski
::
:: Copyright (c) 1990-2019 Association of Mizar Users

theorem Th1: :: TDGROUP:1
for a being Element of G_Real ex b being Element of G_Real st b + b = a
proof end;

theorem :: TDGROUP:2
for a being Element of G_Real st a + a = 0. G_Real holds
a = 0. G_Real ;

definition
let IT be non empty addLoopStr ;
attr IT is Two_Divisible means :Def1: :: TDGROUP:def 1
for a being Element of IT ex b being Element of IT st b + b = a;
end;

:: deftheorem Def1 defines Two_Divisible TDGROUP:def 1 :
for IT being non empty addLoopStr holds
( IT is Two_Divisible iff for a being Element of IT ex b being Element of IT st b + b = a );

Lm1:
;

registration
coherence by Th1;
end;

registration
existence
ex b1 being non empty addLoopStr st
( b1 is strict & b1 is Fanoian & b1 is Two_Divisible & b1 is add-associative & b1 is right_zeroed & b1 is right_complementable & b1 is Abelian )
by Lm1;
end;

definition end;

definition end;

theorem :: TDGROUP:3
( AG is Uniquely_Two_Divisible_Group iff ( ( for a being Element of AG ex b being Element of AG st b + b = a ) & ( for a being Element of AG st a + a = 0. AG holds
a = 0. AG ) ) ) by ;

notation
let a, b be Element of ADG;
synonym a # b for a + b;
end;

definition
func CONGRD ADG -> Relation of [: the carrier of ADG, the carrier of ADG:] means :Def2: :: TDGROUP:def 2
for a, b, c, d being Element of ADG holds
( [[a,b],[c,d]] in it iff a # d = b # c );
existence
ex b1 being Relation of [: the carrier of ADG, the carrier of ADG:] st
for a, b, c, d being Element of ADG holds
( [[a,b],[c,d]] in b1 iff a # d = b # c )
proof end;
uniqueness
for b1, b2 being Relation of [: the carrier of ADG, the carrier of ADG:] st ( for a, b, c, d being Element of ADG holds
( [[a,b],[c,d]] in b1 iff a # d = b # c ) ) & ( for a, b, c, d being Element of ADG holds
( [[a,b],[c,d]] in b2 iff a # d = b # c ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def2 defines CONGRD TDGROUP:def 2 :
for b2 being Relation of [: the carrier of ADG, the carrier of ADG:] holds
( b2 = CONGRD ADG iff for a, b, c, d being Element of ADG holds
( [[a,b],[c,d]] in b2 iff a # d = b # c ) );

definition
func AV ADG -> strict AffinStruct equals :: TDGROUP:def 3
coherence
;
end;

:: deftheorem defines AV TDGROUP:def 3 :

registration
cluster AV ADG -> non empty strict ;
coherence
;
end;

theorem :: TDGROUP:4

definition
let a, b, c, d be Element of ADG;
pred a,b ==> c,d means :: TDGROUP:def 4
[[a,b],[c,d]] in the CONGR of (AV ADG);
end;

:: deftheorem defines ==> TDGROUP:def 4 :
for a, b, c, d being Element of ADG holds
( a,b ==> c,d iff [[a,b],[c,d]] in the CONGR of (AV ADG) );

theorem Th5: :: TDGROUP:5
for a, b, c, d being Element of ADG holds
( a,b ==> c,d iff a # d = b # c ) by Def2;

theorem Th6: :: TDGROUP:6
ex a, b being Element of G_Real st a <> b
proof end;

theorem :: TDGROUP:7
ex ADG being Uniquely_Two_Divisible_Group ex a, b being Element of ADG st a <> b by Th6;

theorem Th8: :: TDGROUP:8
for a, b, c being Element of ADG st a,b ==> c,c holds
a = b
proof end;

theorem Th9: :: TDGROUP:9
for a, b, c, d, p, q being Element of ADG st a,b ==> p,q & c,d ==> p,q holds
a,b ==> c,d
proof end;

theorem Th10: :: TDGROUP:10
for a, b, c being Element of ADG ex d being Element of ADG st a,b ==> c,d
proof end;

theorem Th11: :: TDGROUP:11
for a, b, c, a9, b9, c9 being Element of ADG st a,b ==> a9,b9 & a,c ==> a9,c9 holds
b,c ==> b9,c9
proof end;

theorem Th12: :: TDGROUP:12
for a, c being Element of ADG ex b being Element of ADG st a,b ==> b,c
proof end;

theorem Th13: :: TDGROUP:13
for a, b, c, b9 being Element of ADG st a,b ==> b,c & a,b9 ==> b9,c holds
b = b9
proof end;

theorem Th14: :: TDGROUP:14
for a, b, c, d being Element of ADG st a,b ==> c,d holds
a,c ==> b,d
proof end;

theorem Th15: :: TDGROUP:15
for ADG being Uniquely_Two_Divisible_Group st ex a, b being Element of ADG st a <> b holds
( ex a, b being Element of (AV ADG) st a <> b & ( for a, b, c being Element of (AV ADG) st a,b // c,c holds
a = b ) & ( for a, b, c, d, p, q being Element of (AV ADG) st a,b // p,q & c,d // p,q holds
a,b // c,d ) & ( for a, b, c being Element of (AV ADG) ex d being Element of (AV ADG) st a,b // c,d ) & ( for a, b, c, a9, b9, c9 being Element of (AV ADG) st a,b // a9,b9 & a,c // a9,c9 holds
b,c // b9,c9 ) & ( for a, c being Element of (AV ADG) ex b being Element of (AV ADG) st a,b // b,c ) & ( for a, b, c, b9 being Element of (AV ADG) st a,b // b,c & a,b9 // b9,c holds
b = b9 ) & ( for a, b, c, d being Element of (AV ADG) st a,b // c,d holds
a,c // b,d ) )
proof end;

definition
let IT be non empty AffinStruct ;
attr IT is AffVect-like means :Def5: :: TDGROUP:def 5
( ( for a, b, c being Element of IT st a,b // c,c holds
a = b ) & ( for a, b, c, d, p, q being Element of IT st a,b // p,q & c,d // p,q holds
a,b // c,d ) & ( for a, b, c being Element of IT ex d being Element of IT st a,b // c,d ) & ( for a, b, c, a9, b9, c9 being Element of IT st a,b // a9,b9 & a,c // a9,c9 holds
b,c // b9,c9 ) & ( for a, c being Element of IT ex b being Element of IT st a,b // b,c ) & ( for a, b, c, b9 being Element of IT st a,b // b,c & a,b9 // b9,c holds
b = b9 ) & ( for a, b, c, d being Element of IT st a,b // c,d holds
a,c // b,d ) );
end;

:: deftheorem Def5 defines AffVect-like TDGROUP:def 5 :
for IT being non empty AffinStruct holds
( IT is AffVect-like iff ( ( for a, b, c being Element of IT st a,b // c,c holds
a = b ) & ( for a, b, c, d, p, q being Element of IT st a,b // p,q & c,d // p,q holds
a,b // c,d ) & ( for a, b, c being Element of IT ex d being Element of IT st a,b // c,d ) & ( for a, b, c, a9, b9, c9 being Element of IT st a,b // a9,b9 & a,c // a9,c9 holds
b,c // b9,c9 ) & ( for a, c being Element of IT ex b being Element of IT st a,b // b,c ) & ( for a, b, c, b9 being Element of IT st a,b // b,c & a,b9 // b9,c holds
b = b9 ) & ( for a, b, c, d being Element of IT st a,b // c,d holds
a,c // b,d ) ) );

registration
existence
ex b1 being non trivial AffinStruct st
( b1 is strict & b1 is AffVect-like )
proof end;
end;

definition end;

theorem :: TDGROUP:16
for AS being non empty AffinStruct holds
( ( ex a, b being Element of AS st a <> b & ( for a, b, c being Element of AS st a,b // c,c holds
a = b ) & ( for a, b, c, d, p, q being Element of AS st a,b // p,q & c,d // p,q holds
a,b // c,d ) & ( for a, b, c being Element of AS ex d being Element of AS st a,b // c,d ) & ( for a, b, c, a9, b9, c9 being Element of AS st a,b // a9,b9 & a,c // a9,c9 holds
b,c // b9,c9 ) & ( for a, c being Element of AS ex b being Element of AS st a,b // b,c ) & ( for a, b, c, b9 being Element of AS st a,b // b,c & a,b9 // b9,c holds
b = b9 ) & ( for a, b, c, d being Element of AS st a,b // c,d holds
a,c // b,d ) ) iff AS is AffVect ) by ;

theorem :: TDGROUP:17
for ADG being Uniquely_Two_Divisible_Group st ex a, b being Element of ADG st a <> b holds