:: EUCLID_3 semantic presentation

definition
let c1 be Element of COMPLEX ;
func cpx2euc c1 -> Point of (TOP-REAL 2) equals :: EUCLID_3:def 1
|[(Re a1),(Im a1)]|;
correctness
coherence
|[(Re c1),(Im c1)]| is Point of (TOP-REAL 2)
;
;
end;

:: deftheorem Def1 defines cpx2euc EUCLID_3:def 1 :
for b1 being Element of COMPLEX holds cpx2euc b1 = |[(Re b1),(Im b1)]|;

definition
let c1 be Point of (TOP-REAL 2);
func euc2cpx c1 -> Element of COMPLEX equals :: EUCLID_3:def 2
[*(a1 `1 ),(a1 `2 )*];
correctness
coherence
[*(c1 `1 ),(c1 `2 )*] is Element of COMPLEX
;
;
end;

:: deftheorem Def2 defines euc2cpx EUCLID_3:def 2 :
for b1 being Point of (TOP-REAL 2) holds euc2cpx b1 = [*(b1 `1 ),(b1 `2 )*];

theorem Th1: :: EUCLID_3:1
for b1 being Element of COMPLEX holds euc2cpx (cpx2euc b1) = b1
proof end;

theorem Th2: :: EUCLID_3:2
for b1 being Point of (TOP-REAL 2) holds cpx2euc (euc2cpx b1) = b1
proof end;

theorem Th3: :: EUCLID_3:3
for b1 being Point of (TOP-REAL 2) ex b2 being Element of COMPLEX st b1 = cpx2euc b2
proof end;

theorem Th4: :: EUCLID_3:4
for b1 being Element of COMPLEX ex b2 being Point of (TOP-REAL 2) st b1 = euc2cpx b2
proof end;

theorem Th5: :: EUCLID_3:5
for b1, b2 being Element of COMPLEX st cpx2euc b1 = cpx2euc b2 holds
b1 = b2
proof end;

theorem Th6: :: EUCLID_3:6
for b1, b2 being Point of (TOP-REAL 2) st euc2cpx b1 = euc2cpx b2 holds
b1 = b2
proof end;

theorem Th7: :: EUCLID_3:7
for b1 being Element of COMPLEX holds
( (cpx2euc b1) `1 = Re b1 & (cpx2euc b1) `2 = Im b1 ) by EUCLID:56;

theorem Th8: :: EUCLID_3:8
for b1 being Point of (TOP-REAL 2) holds
( Re (euc2cpx b1) = b1 `1 & Im (euc2cpx b1) = b1 `2 )
proof end;

theorem Th9: :: EUCLID_3:9
for b1, b2 being Real holds cpx2euc [*b1,b2*] = |[b1,b2]|
proof end;

theorem Th10: :: EUCLID_3:10
for b1, b2 being Element of COMPLEX holds |[(Re (b1 + b2)),(Im (b1 + b2))]| = |[((Re b1) + (Re b2)),((Im b1) + (Im b2))]|
proof end;

theorem Th11: :: EUCLID_3:11
for b1, b2 being Element of COMPLEX holds cpx2euc (b1 + b2) = (cpx2euc b1) + (cpx2euc b2)
proof end;

theorem Th12: :: EUCLID_3:12
for b1, b2 being Point of (TOP-REAL 2) holds [*((b1 + b2) `1 ),((b1 + b2) `2 )*] = [*((b1 `1 ) + (b2 `1 )),((b1 `2 ) + (b2 `2 ))*]
proof end;

theorem Th13: :: EUCLID_3:13
for b1, b2 being Point of (TOP-REAL 2) holds euc2cpx (b1 + b2) = (euc2cpx b1) + (euc2cpx b2)
proof end;

theorem Th14: :: EUCLID_3:14
for b1 being Element of COMPLEX holds |[(Re (- b1)),(Im (- b1))]| = |[(- (Re b1)),(- (Im b1))]|
proof end;

theorem Th15: :: EUCLID_3:15
for b1 being Element of COMPLEX holds cpx2euc (- b1) = - (cpx2euc b1)
proof end;

theorem Th16: :: EUCLID_3:16
for b1 being Point of (TOP-REAL 2) holds [*((- b1) `1 ),((- b1) `2 )*] = [*(- (b1 `1 )),(- (b1 `2 ))*]
proof end;

theorem Th17: :: EUCLID_3:17
for b1 being Point of (TOP-REAL 2) holds euc2cpx (- b1) = - (euc2cpx b1)
proof end;

theorem Th18: :: EUCLID_3:18
for b1, b2 being Element of COMPLEX holds cpx2euc (b1 - b2) = (cpx2euc b1) - (cpx2euc b2)
proof end;

theorem Th19: :: EUCLID_3:19
for b1, b2 being Point of (TOP-REAL 2) holds euc2cpx (b1 - b2) = (euc2cpx b1) - (euc2cpx b2)
proof end;

theorem Th20: :: EUCLID_3:20
cpx2euc 0c = 0.REAL 2 by COMPLEX1:12, EUCLID:58;

theorem Th21: :: EUCLID_3:21
euc2cpx (0.REAL 2) = 0c by Th1, Th20;

theorem Th22: :: EUCLID_3:22
for b1 being Point of (TOP-REAL 2) st euc2cpx b1 = 0c holds
b1 = 0.REAL 2 by Th2, Th20;

theorem Th23: :: EUCLID_3:23
for b1 being Element of COMPLEX
for b2 being Real holds cpx2euc ([*b2,0*] * b1) = b2 * (cpx2euc b1)
proof end;

theorem Th24: :: EUCLID_3:24
for b1, b2, b3 being Real holds (b1 + (0 * <i> )) * (b2 + (b3 * <i> )) = (b1 * b2) + ((b1 * b3) * <i> ) ;

theorem Th25: :: EUCLID_3:25
for b1 being Real
for b2 being Point of (TOP-REAL 2) holds euc2cpx (b1 * b2) = [*b1,0*] * (euc2cpx b2)
proof end;

theorem Th26: :: EUCLID_3:26
for b1 being Point of (TOP-REAL 2) holds |.(euc2cpx b1).| = sqrt (((b1 `1 ) ^2 ) + ((b1 `2 ) ^2 ))
proof end;

theorem Th27: :: EUCLID_3:27
for b1 being FinSequence of REAL st len b1 = 2 holds
|.b1.| = sqrt (((b1 . 1) ^2 ) + ((b1 . 2) ^2 ))
proof end;

theorem Th28: :: EUCLID_3:28
for b1 being FinSequence of REAL
for b2 being Point of (TOP-REAL 2) st len b1 = 2 & b2 = b1 holds
|.b2.| = |.b1.|
proof end;

theorem Th29: :: EUCLID_3:29
for b1 being Element of COMPLEX holds |.(cpx2euc b1).| = sqrt (((Re b1) ^2 ) + ((Im b1) ^2 ))
proof end;

theorem Th30: :: EUCLID_3:30
for b1 being Element of COMPLEX holds |.(cpx2euc b1).| = |.b1.|
proof end;

theorem Th31: :: EUCLID_3:31
for b1 being Point of (TOP-REAL 2) holds |.(euc2cpx b1).| = |.b1.|
proof end;

definition
let c1 be Point of (TOP-REAL 2);
func Arg c1 -> Real equals :: EUCLID_3:def 3
Arg (euc2cpx a1);
correctness
coherence
Arg (euc2cpx c1) is Real
;
;
end;

:: deftheorem Def3 defines Arg EUCLID_3:def 3 :
for b1 being Point of (TOP-REAL 2) holds Arg b1 = Arg (euc2cpx b1);

theorem Th32: :: EUCLID_3:32
for b1 being Element of COMPLEX
for b2 being Point of (TOP-REAL 2) st ( b1 = euc2cpx b2 or b2 = cpx2euc b1 ) holds
Arg b1 = Arg b2
proof end;

theorem Th33: :: EUCLID_3:33
for b1 being Point of (TOP-REAL 2) holds
( 0 <= Arg b1 & Arg b1 < 2 * PI ) by COMPTRIG:52;

theorem Th34: :: EUCLID_3:34
for b1, b2 being Real
for b3 being Point of (TOP-REAL 2) st b1 = |.b3.| * (cos (Arg b3)) & b2 = |.b3.| * (sin (Arg b3)) holds
b3 = |[b1,b2]|
proof end;

theorem Th35: :: EUCLID_3:35
Arg (0.REAL 2) = 0 by Th21, COMPLEX2:20;

theorem Th36: :: EUCLID_3:36
for b1 being Point of (TOP-REAL 2) st b1 <> 0.REAL 2 holds
( ( Arg b1 < PI implies Arg (- b1) = (Arg b1) + PI ) & ( Arg b1 >= PI implies Arg (- b1) = (Arg b1) - PI ) )
proof end;

theorem Th37: :: EUCLID_3:37
for b1 being Point of (TOP-REAL 2) st Arg b1 = 0 holds
( b1 = |[|.b1.|,0]| & b1 `2 = 0 )
proof end;

theorem Th38: :: EUCLID_3:38
for b1 being Point of (TOP-REAL 2) st b1 <> 0.REAL 2 holds
( Arg b1 < PI iff Arg (- b1) >= PI )
proof end;

theorem Th39: :: EUCLID_3:39
for b1, b2 being Point of (TOP-REAL 2) st ( b1 <> b2 or b1 - b2 <> 0.REAL 2 ) holds
( Arg (b1 - b2) < PI iff Arg (b2 - b1) >= PI )
proof end;

theorem Th40: :: EUCLID_3:40
for b1 being Point of (TOP-REAL 2) holds
( Arg b1 in ].0,PI .[ iff b1 `2 > 0 )
proof end;

theorem Th41: :: EUCLID_3:41
for b1 being Point of (TOP-REAL 2) st Arg b1 <> 0 holds
( Arg b1 < PI iff sin (Arg b1) > 0 ) by COMPLEX2:28;

theorem Th42: :: EUCLID_3:42
for b1, b2 being Point of (TOP-REAL 2) st Arg b1 < PI & Arg b2 < PI holds
Arg (b1 + b2) < PI
proof end;

definition
let c1, c2, c3 be Point of (TOP-REAL 2);
func angle c1,c2,c3 -> Real equals :: EUCLID_3:def 4
angle (euc2cpx a1),(euc2cpx a2),(euc2cpx a3);
correctness
coherence
angle (euc2cpx c1),(euc2cpx c2),(euc2cpx c3) is Real
;
by XREAL_0:def 1;
end;

:: deftheorem Def4 defines angle EUCLID_3:def 4 :
for b1, b2, b3 being Point of (TOP-REAL 2) holds angle b1,b2,b3 = angle (euc2cpx b1),(euc2cpx b2),(euc2cpx b3);

theorem Th43: :: EUCLID_3:43
for b1, b2, b3 being Point of (TOP-REAL 2) holds
( 0 <= angle b1,b2,b3 & angle b1,b2,b3 < 2 * PI ) by COMPLEX2:84;

theorem Th44: :: EUCLID_3:44
for b1, b2, b3 being Point of (TOP-REAL 2) holds angle b1,b2,b3 = angle (b1 - b2),(0.REAL 2),(b3 - b2)
proof end;

theorem Th45: :: EUCLID_3:45
for b1, b2, b3 being Point of (TOP-REAL 2) st angle b1,b2,b3 = 0 holds
( Arg (b1 - b2) = Arg (b3 - b2) & angle b3,b2,b1 = 0 )
proof end;

theorem Th46: :: EUCLID_3:46
for b1, b2, b3 being Point of (TOP-REAL 2) st angle b1,b2,b3 <> 0 holds
angle b3,b2,b1 = (2 * PI ) - (angle b1,b2,b3)
proof end;

theorem Th47: :: EUCLID_3:47
for b1, b2, b3 being Point of (TOP-REAL 2) st angle b3,b2,b1 <> 0 holds
angle b3,b2,b1 = (2 * PI ) - (angle b1,b2,b3)
proof end;

theorem Th48: :: EUCLID_3:48
for b1, b2 being Element of COMPLEX holds Re (b1 .|. b2) = ((Re b1) * (Re b2)) + ((Im b1) * (Im b2))
proof end;

theorem Th49: :: EUCLID_3:49
for b1, b2 being Element of COMPLEX holds Im (b1 .|. b2) = (- ((Re b1) * (Im b2))) + ((Im b1) * (Re b2))
proof end;

theorem Th50: :: EUCLID_3:50
for b1, b2 being Point of (TOP-REAL 2) holds |(b1,b2)| = ((b1 `1 ) * (b2 `1 )) + ((b1 `2 ) * (b2 `2 ))
proof end;

theorem Th51: :: EUCLID_3:51
for b1, b2 being Point of (TOP-REAL 2) holds |(b1,b2)| = Re ((euc2cpx b1) .|. (euc2cpx b2))
proof end;

theorem Th52: :: EUCLID_3:52
for b1, b2, b3 being Point of (TOP-REAL 2) st b1 <> 0.REAL 2 & b2 <> 0.REAL 2 holds
( |(b1,b2)| = 0 iff ( angle b1,(0.REAL 2),b2 = PI / 2 or angle b1,(0.REAL 2),b2 = (3 / 2) * PI ) )
proof end;

theorem Th53: :: EUCLID_3:53
for b1, b2 being Point of (TOP-REAL 2) st b1 <> 0.REAL 2 & b2 <> 0.REAL 2 holds
( ( ( not (- ((b1 `1 ) * (b2 `2 ))) + ((b1 `2 ) * (b2 `1 )) = |.b1.| * |.b2.| & not (- ((b1 `1 ) * (b2 `2 ))) + ((b1 `2 ) * (b2 `1 )) = - (|.b1.| * |.b2.|) ) or angle b1,(0.REAL 2),b2 = PI / 2 or angle b1,(0.REAL 2),b2 = (3 / 2) * PI ) & ( ( not angle b1,(0.REAL 2),b2 = PI / 2 & not angle b1,(0.REAL 2),b2 = (3 / 2) * PI ) or (- ((b1 `1 ) * (b2 `2 ))) + ((b1 `2 ) * (b2 `1 )) = |.b1.| * |.b2.| or (- ((b1 `1 ) * (b2 `2 ))) + ((b1 `2 ) * (b2 `1 )) = - (|.b1.| * |.b2.|) ) )
proof end;

theorem Th54: :: EUCLID_3:54
for b1, b2, b3 being Point of (TOP-REAL 2) st b1 <> b2 & b3 <> b2 holds
( |((b1 - b2),(b3 - b2))| = 0 iff ( angle b1,b2,b3 = PI / 2 or angle b1,b2,b3 = (3 / 2) * PI ) )
proof end;

theorem Th55: :: EUCLID_3:55
for b1, b2, b3 being Point of (TOP-REAL 2) st b1 <> b2 & b3 <> b2 & ( angle b1,b2,b3 = PI / 2 or angle b1,b2,b3 = (3 / 2) * PI ) holds
(|.(b1 - b2).| ^2 ) + (|.(b3 - b2).| ^2 ) = |.(b1 - b3).| ^2
proof end;

theorem Th56: :: EUCLID_3:56
for b1, b2, b3 being Point of (TOP-REAL 2) st b2 <> b1 & b1 <> b3 & b3 <> b2 & angle b2,b1,b3 < PI & angle b1,b3,b2 < PI & angle b3,b2,b1 < PI holds
((angle b2,b1,b3) + (angle b1,b3,b2)) + (angle b3,b2,b1) = PI
proof end;

definition
let c1 be Nat;
let c2, c3, c4 be Point of (TOP-REAL c1);
func Triangle c2,c3,c4 -> Subset of (TOP-REAL a1) equals :: EUCLID_3:def 5
((LSeg a2,a3) \/ (LSeg a3,a4)) \/ (LSeg a4,a2);
correctness
coherence
((LSeg c2,c3) \/ (LSeg c3,c4)) \/ (LSeg c4,c2) is Subset of (TOP-REAL c1)
;
;
end;

:: deftheorem Def5 defines Triangle EUCLID_3:def 5 :
for b1 being Nat
for b2, b3, b4 being Point of (TOP-REAL b1) holds Triangle b2,b3,b4 = ((LSeg b2,b3) \/ (LSeg b3,b4)) \/ (LSeg b4,b2);

definition
let c1 be Nat;
let c2, c3, c4 be Point of (TOP-REAL c1);
func closed_inside_of_triangle c2,c3,c4 -> Subset of (TOP-REAL a1) equals :: EUCLID_3:def 6
{ b1 where B is Point of (TOP-REAL a1) : ex b1, b2, b3 being Real st
( 0 <= b2 & 0 <= b3 & 0 <= b4 & (b2 + b3) + b4 = 1 & b1 = ((b2 * a2) + (b3 * a3)) + (b4 * a4) )
}
;
correctness
coherence
{ b1 where B is Point of (TOP-REAL c1) : ex b1, b2, b3 being Real st
( 0 <= b2 & 0 <= b3 & 0 <= b4 & (b2 + b3) + b4 = 1 & b1 = ((b2 * c2) + (b3 * c3)) + (b4 * c4) )
}
is Subset of (TOP-REAL c1)
;
proof end;
end;

:: deftheorem Def6 defines closed_inside_of_triangle EUCLID_3:def 6 :
for b1 being Nat
for b2, b3, b4 being Point of (TOP-REAL b1) holds closed_inside_of_triangle b2,b3,b4 = { b5 where B is Point of (TOP-REAL b1) : ex b1, b2, b3 being Real st
( 0 <= b6 & 0 <= b7 & 0 <= b8 & (b6 + b7) + b8 = 1 & b5 = ((b6 * b2) + (b7 * b3)) + (b8 * b4) )
}
;

definition
let c1 be Nat;
let c2, c3, c4 be Point of (TOP-REAL c1);
func inside_of_triangle c2,c3,c4 -> Subset of (TOP-REAL a1) equals :: EUCLID_3:def 7
(closed_inside_of_triangle a2,a3,a4) \ (Triangle a2,a3,a4);
correctness
coherence
(closed_inside_of_triangle c2,c3,c4) \ (Triangle c2,c3,c4) is Subset of (TOP-REAL c1)
;
;
end;

:: deftheorem Def7 defines inside_of_triangle EUCLID_3:def 7 :
for b1 being Nat
for b2, b3, b4 being Point of (TOP-REAL b1) holds inside_of_triangle b2,b3,b4 = (closed_inside_of_triangle b2,b3,b4) \ (Triangle b2,b3,b4);

definition
let c1 be Nat;
let c2, c3, c4 be Point of (TOP-REAL c1);
func outside_of_triangle c2,c3,c4 -> Subset of (TOP-REAL a1) equals :: EUCLID_3:def 8
{ b1 where B is Point of (TOP-REAL a1) : ex b1, b2, b3 being Real st
( ( 0 > b2 or 0 > b3 or 0 > b4 ) & (b2 + b3) + b4 = 1 & b1 = ((b2 * a2) + (b3 * a3)) + (b4 * a4) )
}
;
correctness
coherence
{ b1 where B is Point of (TOP-REAL c1) : ex b1, b2, b3 being Real st
( ( 0 > b2 or 0 > b3 or 0 > b4 ) & (b2 + b3) + b4 = 1 & b1 = ((b2 * c2) + (b3 * c3)) + (b4 * c4) )
}
is Subset of (TOP-REAL c1)
;
proof end;
end;

:: deftheorem Def8 defines outside_of_triangle EUCLID_3:def 8 :
for b1 being Nat
for b2, b3, b4 being Point of (TOP-REAL b1) holds outside_of_triangle b2,b3,b4 = { b5 where B is Point of (TOP-REAL b1) : ex b1, b2, b3 being Real st
( ( 0 > b6 or 0 > b7 or 0 > b8 ) & (b6 + b7) + b8 = 1 & b5 = ((b6 * b2) + (b7 * b3)) + (b8 * b4) )
}
;

definition
let c1 be Nat;
let c2, c3, c4 be Point of (TOP-REAL c1);
func plane c2,c3,c4 -> Subset of (TOP-REAL a1) equals :: EUCLID_3:def 9
(outside_of_triangle a2,a3,a4) \/ (closed_inside_of_triangle a2,a3,a4);
correctness
coherence
(outside_of_triangle c2,c3,c4) \/ (closed_inside_of_triangle c2,c3,c4) is Subset of (TOP-REAL c1)
;
;
end;

:: deftheorem Def9 defines plane EUCLID_3:def 9 :
for b1 being Nat
for b2, b3, b4 being Point of (TOP-REAL b1) holds plane b2,b3,b4 = (outside_of_triangle b2,b3,b4) \/ (closed_inside_of_triangle b2,b3,b4);

theorem Th57: :: EUCLID_3:57
for b1 being Nat
for b2, b3, b4, b5 being Point of (TOP-REAL b1) st b5 in plane b2,b3,b4 holds
ex b6, b7, b8 being Real st
( (b6 + b7) + b8 = 1 & b5 = ((b6 * b2) + (b7 * b3)) + (b8 * b4) )
proof end;

theorem Th58: :: EUCLID_3:58
for b1 being Nat
for b2, b3, b4 being Point of (TOP-REAL b1) holds Triangle b2,b3,b4 c= closed_inside_of_triangle b2,b3,b4
proof end;

definition
let c1 be Nat;
let c2, c3 be Point of (TOP-REAL c1);
pred c2,c3 are_lindependent2 means :Def10: :: EUCLID_3:def 10
for b1, b2 being Real st (b1 * a2) + (b2 * a3) = 0.REAL a1 holds
( b1 = 0 & b2 = 0 );
end;

:: deftheorem Def10 defines are_lindependent2 EUCLID_3:def 10 :
for b1 being Nat
for b2, b3 being Point of (TOP-REAL b1) holds
( b2,b3 are_lindependent2 iff for b4, b5 being Real st (b4 * b2) + (b5 * b3) = 0.REAL b1 holds
( b4 = 0 & b5 = 0 ) );

notation
let c1 be Nat;
let c2, c3 be Point of (TOP-REAL c1);
antonym c2,c3 are_ldependent2 for c2,c3 are_lindependent2 ;
end;

theorem Th59: :: EUCLID_3:59
for b1 being Nat
for b2, b3 being Point of (TOP-REAL b1) st b2,b3 are_lindependent2 holds
( b2 <> b3 & b2 <> 0.REAL b1 & b3 <> 0.REAL b1 )
proof end;

theorem Th60: :: EUCLID_3:60
for b1 being Nat
for b2, b3, b4, b5 being Point of (TOP-REAL b1) st b3 - b2,b4 - b2 are_lindependent2 & b5 in plane b2,b3,b4 holds
ex b6, b7, b8 being Real st
( b5 = ((b6 * b2) + (b7 * b3)) + (b8 * b4) & (b6 + b7) + b8 = 1 & ( for b9, b10, b11 being Real st b5 = ((b9 * b2) + (b10 * b3)) + (b11 * b4) & (b9 + b10) + b11 = 1 holds
( b9 = b6 & b10 = b7 & b11 = b8 ) ) )
proof end;

theorem Th61: :: EUCLID_3:61
for b1 being Nat
for b2, b3, b4, b5 being Point of (TOP-REAL b1) st ex b6, b7, b8 being Real st
( b5 = ((b6 * b2) + (b7 * b3)) + (b8 * b4) & (b6 + b7) + b8 = 1 ) holds
b5 in plane b2,b3,b4
proof end;

theorem Th62: :: EUCLID_3:62
for b1 being Nat
for b2, b3, b4 being Point of (TOP-REAL b1) holds plane b2,b3,b4 = { b5 where B is Point of (TOP-REAL b1) : ex b1, b2, b3 being Real st
( (b6 + b7) + b8 = 1 & b5 = ((b6 * b2) + (b7 * b3)) + (b8 * b4) )
}
proof end;

theorem Th63: :: EUCLID_3:63
for b1, b2, b3 being Point of (TOP-REAL 2) st b2 - b1,b3 - b1 are_lindependent2 holds
plane b1,b2,b3 = REAL 2
proof end;

definition
let c1 be Nat;
let c2, c3, c4, c5 be Point of (TOP-REAL c1);
assume E33: ( c3 - c2,c4 - c2 are_lindependent2 & c5 in plane c2,c3,c4 ) ;
func tricord1 c2,c3,c4,c5 -> Real means :Def11: :: EUCLID_3:def 11
ex b1, b2 being Real st
( (a6 + b1) + b2 = 1 & a5 = ((a6 * a2) + (b1 * a3)) + (b2 * a4) );
existence
ex b1, b2, b3 being Real st
( (b1 + b2) + b3 = 1 & c5 = ((b1 * c2) + (b2 * c3)) + (b3 * c4) )
proof end;
uniqueness
for b1, b2 being Real st ex b3, b4 being Real st
( (b1 + b3) + b4 = 1 & c5 = ((b1 * c2) + (b3 * c3)) + (b4 * c4) ) & ex b3, b4 being Real st
( (b2 + b3) + b4 = 1 & c5 = ((b2 * c2) + (b3 * c3)) + (b4 * c4) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def11 defines tricord1 EUCLID_3:def 11 :
for b1 being Nat
for b2, b3, b4, b5 being Point of (TOP-REAL b1) st b3 - b2,b4 - b2 are_lindependent2 & b5 in plane b2,b3,b4 holds
for b6 being Real holds
( b6 = tricord1 b2,b3,b4,b5 iff ex b7, b8 being Real st
( (b6 + b7) + b8 = 1 & b5 = ((b6 * b2) + (b7 * b3)) + (b8 * b4) ) );

definition
let c1 be Nat;
let c2, c3, c4, c5 be Point of (TOP-REAL c1);
assume E34: ( c3 - c2,c4 - c2 are_lindependent2 & c5 in plane c2,c3,c4 ) ;
func tricord2 c2,c3,c4,c5 -> Real means :Def12: :: EUCLID_3:def 12
ex b1, b2 being Real st
( (b1 + a6) + b2 = 1 & a5 = ((b1 * a2) + (a6 * a3)) + (b2 * a4) );
existence
ex b1, b2, b3 being Real st
( (b2 + b1) + b3 = 1 & c5 = ((b2 * c2) + (b1 * c3)) + (b3 * c4) )
proof end;
uniqueness
for b1, b2 being Real st ex b3, b4 being Real st
( (b3 + b1) + b4 = 1 & c5 = ((b3 * c2) + (b1 * c3)) + (b4 * c4) ) & ex b3, b4 being Real st
( (b3 + b2) + b4 = 1 & c5 = ((b3 * c2) + (b2 * c3)) + (b4 * c4) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def12 defines tricord2 EUCLID_3:def 12 :
for b1 being Nat
for b2, b3, b4, b5 being Point of (TOP-REAL b1) st b3 - b2,b4 - b2 are_lindependent2 & b5 in plane b2,b3,b4 holds
for b6 being Real holds
( b6 = tricord2 b2,b3,b4,b5 iff ex b7, b8 being Real st
( (b7 + b6) + b8 = 1 & b5 = ((b7 * b2) + (b6 * b3)) + (b8 * b4) ) );

definition
let c1 be Nat;
let c2, c3, c4, c5 be Point of (TOP-REAL c1);
assume E35: ( c3 - c2,c4 - c2 are_lindependent2 & c5 in plane c2,c3,c4 ) ;
func tricord3 c2,c3,c4,c5 -> Real means :Def13: :: EUCLID_3:def 13
ex b1, b2 being Real st
( (b1 + b2) + a6 = 1 & a5 = ((b1 * a2) + (b2 * a3)) + (a6 * a4) );
existence
ex b1, b2, b3 being Real st
( (b2 + b3) + b1 = 1 & c5 = ((b2 * c2) + (b3 * c3)) + (b1 * c4) )
proof end;
uniqueness
for b1, b2 being Real st ex b3, b4 being Real st
( (b3 + b4) + b1 = 1 & c5 = ((b3 * c2) + (b4 * c3)) + (b1 * c4) ) & ex b3, b4 being Real st
( (b3 + b4) + b2 = 1 & c5 = ((b3 * c2) + (b4 * c3)) + (b2 * c4) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def13 defines tricord3 EUCLID_3:def 13 :
for b1 being Nat
for b2, b3, b4, b5 being Point of (TOP-REAL b1) st b3 - b2,b4 - b2 are_lindependent2 & b5 in plane b2,b3,b4 holds
for b6 being Real holds
( b6 = tricord3 b2,b3,b4,b5 iff ex b7, b8 being Real st
( (b7 + b8) + b6 = 1 & b5 = ((b7 * b2) + (b8 * b3)) + (b6 * b4) ) );

definition
let c1, c2, c3 be Point of (TOP-REAL 2);
func trcmap1 c1,c2,c3 -> Function of (TOP-REAL 2),R^1 means :: EUCLID_3:def 14
for b1 being Point of (TOP-REAL 2) holds a4 . b1 = tricord1 a1,a2,a3,b1;
existence
ex b1 being Function of (TOP-REAL 2),R^1 st
for b2 being Point of (TOP-REAL 2) holds b1 . b2 = tricord1 c1,c2,c3,b2
proof end;
uniqueness
for b1, b2 being Function of (TOP-REAL 2),R^1 st ( for b3 being Point of (TOP-REAL 2) holds b1 . b3 = tricord1 c1,c2,c3,b3 ) & ( for b3 being Point of (TOP-REAL 2) holds b2 . b3 = tricord1 c1,c2,c3,b3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def14 defines trcmap1 EUCLID_3:def 14 :
for b1, b2, b3 being Point of (TOP-REAL 2)
for b4 being Function of (TOP-REAL 2),R^1 holds
( b4 = trcmap1 b1,b2,b3 iff for b5 being Point of (TOP-REAL 2) holds b4 . b5 = tricord1 b1,b2,b3,b5 );

definition
let c1, c2, c3 be Point of (TOP-REAL 2);
func trcmap2 c1,c2,c3 -> Function of (TOP-REAL 2),R^1 means :: EUCLID_3:def 15
for b1 being Point of (TOP-REAL 2) holds a4 . b1 = tricord2 a1,a2,a3,b1;
existence
ex b1 being Function of (TOP-REAL 2),R^1 st
for b2 being Point of (TOP-REAL 2) holds b1 . b2 = tricord2 c1,c2,c3,b2
proof end;
uniqueness
for b1, b2 being Function of (TOP-REAL 2),R^1 st ( for b3 being Point of (TOP-REAL 2) holds b1 . b3 = tricord2 c1,c2,c3,b3 ) & ( for b3 being Point of (TOP-REAL 2) holds b2 . b3 = tricord2 c1,c2,c3,b3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def15 defines trcmap2 EUCLID_3:def 15 :
for b1, b2, b3 being Point of (TOP-REAL 2)
for b4 being Function of (TOP-REAL 2),R^1 holds
( b4 = trcmap2 b1,b2,b3 iff for b5 being Point of (TOP-REAL 2) holds b4 . b5 = tricord2 b1,b2,b3,b5 );

definition
let c1, c2, c3 be Point of (TOP-REAL 2);
func trcmap3 c1,c2,c3 -> Function of (TOP-REAL 2),R^1 means :: EUCLID_3:def 16
for b1 being Point of (TOP-REAL 2) holds a4 . b1 = tricord3 a1,a2,a3,b1;
existence
ex b1 being Function of (TOP-REAL 2),R^1 st
for b2 being Point of (TOP-REAL 2) holds b1 . b2 = tricord3 c1,c2,c3,b2
proof end;
uniqueness
for b1, b2 being Function of (TOP-REAL 2),R^1 st ( for b3 being Point of (TOP-REAL 2) holds b1 . b3 = tricord3 c1,c2,c3,b3 ) & ( for b3 being Point of (TOP-REAL 2) holds b2 . b3 = tricord3 c1,c2,c3,b3 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def16 defines trcmap3 EUCLID_3:def 16 :
for b1, b2, b3 being Point of (TOP-REAL 2)
for b4 being Function of (TOP-REAL 2),R^1 holds
( b4 = trcmap3 b1,b2,b3 iff for b5 being Point of (TOP-REAL 2) holds b4 . b5 = tricord3 b1,b2,b3,b5 );

theorem Th64: :: EUCLID_3:64
for b1, b2, b3, b4 being Point of (TOP-REAL 2) st b2 - b1,b3 - b1 are_lindependent2 holds
( b4 in outside_of_triangle b1,b2,b3 iff ( tricord1 b1,b2,b3,b4 < 0 or tricord2 b1,b2,b3,b4 < 0 or tricord3 b1,b2,b3,b4 < 0 ) )
proof end;

theorem Th65: :: EUCLID_3:65
for b1, b2, b3, b4 being Point of (TOP-REAL 2) st b2 - b1,b3 - b1 are_lindependent2 holds
( b4 in Triangle b1,b2,b3 iff ( tricord1 b1,b2,b3,b4 >= 0 & tricord2 b1,b2,b3,b4 >= 0 & tricord3 b1,b2,b3,b4 >= 0 & ( tricord1 b1,b2,b3,b4 = 0 or tricord2 b1,b2,b3,b4 = 0 or tricord3 b1,b2,b3,b4 = 0 ) ) )
proof end;

theorem Th66: :: EUCLID_3:66
for b1, b2, b3, b4 being Point of (TOP-REAL 2) st b2 - b1,b3 - b1 are_lindependent2 holds
( b4 in Triangle b1,b2,b3 iff ( ( tricord1 b1,b2,b3,b4 = 0 & tricord2 b1,b2,b3,b4 >= 0 & tricord3 b1,b2,b3,b4 >= 0 ) or ( tricord1 b1,b2,b3,b4 >= 0 & tricord2 b1,b2,b3,b4 = 0 & tricord3 b1,b2,b3,b4 >= 0 ) or ( tricord1 b1,b2,b3,b4 >= 0 & tricord2 b1,b2,b3,b4 >= 0 & tricord3 b1,b2,b3,b4 = 0 ) ) ) by Th65;

theorem Th67: :: EUCLID_3:67
for b1, b2, b3, b4 being Point of (TOP-REAL 2) st b2 - b1,b3 - b1 are_lindependent2 holds
( b4 in inside_of_triangle b1,b2,b3 iff ( tricord1 b1,b2,b3,b4 > 0 & tricord2 b1,b2,b3,b4 > 0 & tricord3 b1,b2,b3,b4 > 0 ) )
proof end;

theorem Th68: :: EUCLID_3:68
for b1, b2, b3 being Point of (TOP-REAL 2) st b2 - b1,b3 - b1 are_lindependent2 holds
not inside_of_triangle b1,b2,b3 is empty
proof end;