:: EUCLID_2 semantic presentation

theorem Th1: :: EUCLID_2:1
for b1 being Nat
for b2 being Element of b1 -tuples_on REAL
for b3 being Nat st b3 in Seg b1 holds
(mlt b2,(0* b1)) . b3 = 0
proof end;

theorem Th2: :: EUCLID_2:2
for b1 being Nat
for b2 being Element of b1 -tuples_on REAL holds mlt b2,(0* b1) = 0* b1
proof end;

theorem Th3: :: EUCLID_2:3
for b1 being FinSequence of REAL holds (- 1) * b1 = - b1
proof end;

theorem Th4: :: EUCLID_2:4
for b1, b2 being FinSequence of REAL st len b1 = len b2 holds
b1 - b2 = b1 + (- b2)
proof end;

theorem Th5: :: EUCLID_2:5
for b1 being FinSequence of REAL holds len (- b1) = len b1
proof end;

theorem Th6: :: EUCLID_2:6
for b1, b2 being FinSequence of REAL st len b1 = len b2 holds
len (b1 + b2) = len b1
proof end;

theorem Th7: :: EUCLID_2:7
for b1, b2 being FinSequence of REAL st len b1 = len b2 holds
len (b1 - b2) = len b1
proof end;

theorem Th8: :: EUCLID_2:8
for b1 being real number
for b2 being FinSequence of REAL holds len (b1 * b2) = len b2
proof end;

theorem Th9: :: EUCLID_2:9
for b1, b2, b3 being FinSequence of REAL st len b1 = len b2 & len b2 = len b3 holds
mlt (b1 + b2),b3 = (mlt b1,b3) + (mlt b2,b3)
proof end;

definition
let c1, c2 be FinSequence of REAL ;
func |(c1,c2)| -> real number equals :: EUCLID_2:def 1
Sum (mlt a1,a2);
correctness
coherence
Sum (mlt c1,c2) is real number
;
;
commutativity
for b1 being real number
for b2, b3 being FinSequence of REAL st b1 = Sum (mlt b2,b3) holds
b1 = Sum (mlt b3,b2)
;
end;

:: deftheorem Def1 defines |( EUCLID_2:def 1 :
for b1, b2 being FinSequence of REAL holds |(b1,b2)| = Sum (mlt b1,b2);

theorem Th10: :: EUCLID_2:10
for b1 being Nat
for b2, b3 being FinSequence of REAL
for b4, b5 being Element of REAL b1 st b4 = b2 & b5 = b3 holds
|(b2,b3)| = (1 / 4) * ((|.(b4 + b5).| ^2 ) - (|.(b4 - b5).| ^2 ))
proof end;

theorem Th11: :: EUCLID_2:11
for b1 being FinSequence of REAL holds |(b1,b1)| >= 0
proof end;

theorem Th12: :: EUCLID_2:12
for b1 being FinSequence of REAL holds |.b1.| ^2 = |(b1,b1)|
proof end;

theorem Th13: :: EUCLID_2:13
for b1 being FinSequence of REAL holds |.b1.| = sqrt |(b1,b1)|
proof end;

theorem Th14: :: EUCLID_2:14
for b1 being FinSequence of REAL holds 0 <= |.b1.|
proof end;

theorem Th15: :: EUCLID_2:15
for b1 being FinSequence of REAL holds
( |(b1,b1)| = 0 iff b1 = 0* (len b1) )
proof end;

theorem Th16: :: EUCLID_2:16
for b1 being FinSequence of REAL holds
( |(b1,b1)| = 0 iff |.b1.| = 0 )
proof end;

theorem Th17: :: EUCLID_2:17
for b1 being FinSequence of REAL holds |(b1,(0* (len b1)))| = 0
proof end;

theorem Th18: :: EUCLID_2:18
for b1 being FinSequence of REAL holds |((0* (len b1)),b1)| = 0 by Th17;

theorem Th19: :: EUCLID_2:19
for b1, b2, b3 being FinSequence of REAL st len b1 = len b2 & len b2 = len b3 holds
|((b1 + b2),b3)| = |(b1,b3)| + |(b2,b3)|
proof end;

theorem Th20: :: EUCLID_2:20
for b1, b2 being FinSequence of REAL
for b3 being real number st len b1 = len b2 holds
|((b3 * b1),b2)| = b3 * |(b1,b2)|
proof end;

theorem Th21: :: EUCLID_2:21
for b1, b2 being FinSequence of REAL
for b3 being real number st len b1 = len b2 holds
|(b1,(b3 * b2))| = b3 * |(b1,b2)|
proof end;

theorem Th22: :: EUCLID_2:22
for b1, b2 being FinSequence of REAL st len b1 = len b2 holds
|((- b1),b2)| = - |(b1,b2)|
proof end;

theorem Th23: :: EUCLID_2:23
for b1, b2 being FinSequence of REAL st len b1 = len b2 holds
|(b1,(- b2))| = - |(b1,b2)| by Th22;

theorem Th24: :: EUCLID_2:24
for b1, b2 being FinSequence of REAL st len b1 = len b2 holds
|((- b1),(- b2))| = |(b1,b2)|
proof end;

theorem Th25: :: EUCLID_2:25
for b1, b2, b3 being FinSequence of REAL st len b1 = len b2 & len b2 = len b3 holds
|((b1 - b2),b3)| = |(b1,b3)| - |(b2,b3)|
proof end;

theorem Th26: :: EUCLID_2:26
for b1, b2 being real number
for b3, b4, b5 being FinSequence of REAL st len b3 = len b4 & len b4 = len b5 holds
|(((b1 * b3) + (b2 * b4)),b5)| = (b1 * |(b3,b5)|) + (b2 * |(b4,b5)|)
proof end;

theorem Th27: :: EUCLID_2:27
for b1, b2, b3 being FinSequence of REAL st len b1 = len b2 & len b2 = len b3 holds
|(b1,(b2 + b3))| = |(b1,b2)| + |(b1,b3)| by Th19;

theorem Th28: :: EUCLID_2:28
for b1, b2, b3 being FinSequence of REAL st len b1 = len b2 & len b2 = len b3 holds
|(b1,(b2 - b3))| = |(b1,b2)| - |(b1,b3)| by Th25;

theorem Th29: :: EUCLID_2:29
for b1, b2, b3, b4 being FinSequence of REAL st len b1 = len b2 & len b2 = len b3 & len b3 = len b4 holds
|((b1 + b2),(b3 + b4))| = ((|(b1,b3)| + |(b1,b4)|) + |(b2,b3)|) + |(b2,b4)|
proof end;

theorem Th30: :: EUCLID_2:30
for b1, b2, b3, b4 being FinSequence of REAL st len b1 = len b2 & len b2 = len b3 & len b3 = len b4 holds
|((b1 - b2),(b3 - b4))| = ((|(b1,b3)| - |(b1,b4)|) - |(b2,b3)|) + |(b2,b4)|
proof end;

theorem Th31: :: EUCLID_2:31
for b1, b2 being FinSequence of REAL st len b1 = len b2 holds
|((b1 + b2),(b1 + b2))| = (|(b1,b1)| + (2 * |(b1,b2)|)) + |(b2,b2)|
proof end;

theorem Th32: :: EUCLID_2:32
for b1, b2 being FinSequence of REAL st len b1 = len b2 holds
|((b1 - b2),(b1 - b2))| = (|(b1,b1)| - (2 * |(b1,b2)|)) + |(b2,b2)|
proof end;

theorem Th33: :: EUCLID_2:33
for b1, b2 being FinSequence of REAL st len b1 = len b2 holds
|.(b1 + b2).| ^2 = ((|.b1.| ^2 ) + (2 * |(b2,b1)|)) + (|.b2.| ^2 )
proof end;

theorem Th34: :: EUCLID_2:34
for b1, b2 being FinSequence of REAL st len b1 = len b2 holds
|.(b1 - b2).| ^2 = ((|.b1.| ^2 ) - (2 * |(b2,b1)|)) + (|.b2.| ^2 )
proof end;

theorem Th35: :: EUCLID_2:35
for b1, b2 being FinSequence of REAL st len b1 = len b2 holds
(|.(b1 + b2).| ^2 ) + (|.(b1 - b2).| ^2 ) = 2 * ((|.b1.| ^2 ) + (|.b2.| ^2 ))
proof end;

theorem Th36: :: EUCLID_2:36
for b1, b2 being FinSequence of REAL st len b1 = len b2 holds
(|.(b1 + b2).| ^2 ) - (|.(b1 - b2).| ^2 ) = 4 * |(b1,b2)|
proof end;

theorem Th37: :: EUCLID_2:37
for b1, b2 being FinSequence of REAL st len b1 = len b2 holds
abs |(b1,b2)| <= |.b1.| * |.b2.|
proof end;

theorem Th38: :: EUCLID_2:38
for b1, b2 being FinSequence of REAL st len b1 = len b2 holds
|.(b1 + b2).| <= |.b1.| + |.b2.|
proof end;

definition
let c1 be Nat;
let c2, c3 be Point of (TOP-REAL c1);
func |(c2,c3)| -> real number means :Def2: :: EUCLID_2:def 2
ex b1, b2 being FinSequence of REAL st
( b1 = a2 & b2 = a3 & a4 = |(b1,b2)| );
existence
ex b1 being real number ex b2, b3 being FinSequence of REAL st
( b2 = c2 & b3 = c3 & b1 = |(b2,b3)| )
proof end;
uniqueness
for b1, b2 being real number st ex b3, b4 being FinSequence of REAL st
( b3 = c2 & b4 = c3 & b1 = |(b3,b4)| ) & ex b3, b4 being FinSequence of REAL st
( b3 = c2 & b4 = c3 & b2 = |(b3,b4)| ) holds
b1 = b2
;
commutativity
for b1 being real number
for b2, b3 being Point of (TOP-REAL c1) st ex b4, b5 being FinSequence of REAL st
( b4 = b2 & b5 = b3 & b1 = |(b4,b5)| ) holds
ex b4, b5 being FinSequence of REAL st
( b4 = b3 & b5 = b2 & b1 = |(b4,b5)| )
;
end;

:: deftheorem Def2 defines |( EUCLID_2:def 2 :
for b1 being Nat
for b2, b3 being Point of (TOP-REAL b1)
for b4 being real number holds
( b4 = |(b2,b3)| iff ex b5, b6 being FinSequence of REAL st
( b5 = b2 & b6 = b3 & b4 = |(b5,b6)| ) );

theorem Th39: :: EUCLID_2:39
for b1 being Nat
for b2, b3 being Point of (TOP-REAL b1) holds |(b2,b3)| = (1 / 4) * ((|.(b2 + b3).| ^2 ) - (|.(b2 - b3).| ^2 ))
proof end;

theorem Th40: :: EUCLID_2:40
for b1 being Nat
for b2, b3, b4 being Point of (TOP-REAL b1) holds |((b2 + b3),b4)| = |(b2,b4)| + |(b3,b4)|
proof end;

theorem Th41: :: EUCLID_2:41
for b1 being Nat
for b2, b3 being Point of (TOP-REAL b1)
for b4 being real number holds |((b4 * b2),b3)| = b4 * |(b2,b3)|
proof end;

theorem Th42: :: EUCLID_2:42
for b1 being Nat
for b2, b3 being Point of (TOP-REAL b1)
for b4 being real number holds |(b2,(b4 * b3))| = b4 * |(b2,b3)| by Th41;

theorem Th43: :: EUCLID_2:43
for b1 being Nat
for b2, b3 being Point of (TOP-REAL b1) holds |((- b2),b3)| = - |(b2,b3)|
proof end;

theorem Th44: :: EUCLID_2:44
for b1 being Nat
for b2, b3 being Point of (TOP-REAL b1) holds |(b2,(- b3))| = - |(b2,b3)| by Th43;

theorem Th45: :: EUCLID_2:45
for b1 being Nat
for b2, b3 being Point of (TOP-REAL b1) holds |((- b2),(- b3))| = |(b2,b3)|
proof end;

theorem Th46: :: EUCLID_2:46
for b1 being Nat
for b2, b3, b4 being Point of (TOP-REAL b1) holds |((b2 - b3),b4)| = |(b2,b4)| - |(b3,b4)|
proof end;

theorem Th47: :: EUCLID_2:47
for b1 being Nat
for b2, b3 being real number
for b4, b5, b6 being Point of (TOP-REAL b1) holds |(((b2 * b4) + (b3 * b5)),b6)| = (b2 * |(b4,b6)|) + (b3 * |(b5,b6)|)
proof end;

theorem Th48: :: EUCLID_2:48
for b1 being Nat
for b2, b3, b4 being Point of (TOP-REAL b1) holds |(b2,(b3 + b4))| = |(b2,b3)| + |(b2,b4)| by Th40;

theorem Th49: :: EUCLID_2:49
for b1 being Nat
for b2, b3, b4 being Point of (TOP-REAL b1) holds |(b2,(b3 - b4))| = |(b2,b3)| - |(b2,b4)| by Th46;

theorem Th50: :: EUCLID_2:50
for b1 being Nat
for b2, b3, b4, b5 being Point of (TOP-REAL b1) holds |((b2 + b3),(b4 + b5))| = ((|(b2,b4)| + |(b2,b5)|) + |(b3,b4)|) + |(b3,b5)|
proof end;

theorem Th51: :: EUCLID_2:51
for b1 being Nat
for b2, b3, b4, b5 being Point of (TOP-REAL b1) holds |((b2 - b3),(b4 - b5))| = ((|(b2,b4)| - |(b2,b5)|) - |(b3,b4)|) + |(b3,b5)|
proof end;

theorem Th52: :: EUCLID_2:52
for b1 being Nat
for b2, b3 being Point of (TOP-REAL b1) holds |((b2 + b3),(b2 + b3))| = (|(b2,b2)| + (2 * |(b2,b3)|)) + |(b3,b3)|
proof end;

theorem Th53: :: EUCLID_2:53
for b1 being Nat
for b2, b3 being Point of (TOP-REAL b1) holds |((b2 - b3),(b2 - b3))| = (|(b2,b2)| - (2 * |(b2,b3)|)) + |(b3,b3)|
proof end;

theorem Th54: :: EUCLID_2:54
for b1 being Nat
for b2 being Point of (TOP-REAL b1) holds |(b2,(0.REAL b1))| = 0
proof end;

theorem Th55: :: EUCLID_2:55
for b1 being Nat
for b2 being Point of (TOP-REAL b1) holds |((0.REAL b1),b2)| = 0 by Th54;

theorem Th56: :: EUCLID_2:56
for b1 being Nat holds |((0.REAL b1),(0.REAL b1))| = 0 by Th54;

theorem Th57: :: EUCLID_2:57
for b1 being Nat
for b2 being Point of (TOP-REAL b1) holds |(b2,b2)| >= 0
proof end;

theorem Th58: :: EUCLID_2:58
for b1 being Nat
for b2 being Point of (TOP-REAL b1) holds |(b2,b2)| = |.b2.| ^2
proof end;

theorem Th59: :: EUCLID_2:59
for b1 being Nat
for b2 being Point of (TOP-REAL b1) holds |.b2.| = sqrt |(b2,b2)|
proof end;

theorem Th60: :: EUCLID_2:60
for b1 being Nat
for b2 being Point of (TOP-REAL b1) holds 0 <= |.b2.|
proof end;

theorem Th61: :: EUCLID_2:61
for b1 being Nat holds |.(0.REAL b1).| = 0
proof end;

theorem Th62: :: EUCLID_2:62
for b1 being Nat
for b2 being Point of (TOP-REAL b1) holds
( |(b2,b2)| = 0 iff |.b2.| = 0 )
proof end;

theorem Th63: :: EUCLID_2:63
for b1 being Nat
for b2 being Point of (TOP-REAL b1) holds
( |(b2,b2)| = 0 iff b2 = 0.REAL b1 )
proof end;

theorem Th64: :: EUCLID_2:64
for b1 being Nat
for b2 being Point of (TOP-REAL b1) holds
( |.b2.| = 0 iff b2 = 0.REAL b1 ) by Th61, TOPRNS_1:25;

theorem Th65: :: EUCLID_2:65
for b1 being Nat
for b2 being Point of (TOP-REAL b1) holds
( b2 <> 0.REAL b1 iff |(b2,b2)| > 0 )
proof end;

theorem Th66: :: EUCLID_2:66
for b1 being Nat
for b2 being Point of (TOP-REAL b1) holds
( b2 <> 0.REAL b1 iff |.b2.| > 0 )
proof end;

theorem Th67: :: EUCLID_2:67
for b1 being Nat
for b2, b3 being Point of (TOP-REAL b1) holds |.(b2 + b3).| ^2 = ((|.b2.| ^2 ) + (2 * |(b3,b2)|)) + (|.b3.| ^2 )
proof end;

theorem Th68: :: EUCLID_2:68
for b1 being Nat
for b2, b3 being Point of (TOP-REAL b1) holds |.(b2 - b3).| ^2 = ((|.b2.| ^2 ) - (2 * |(b3,b2)|)) + (|.b3.| ^2 )
proof end;

theorem Th69: :: EUCLID_2:69
for b1 being Nat
for b2, b3 being Point of (TOP-REAL b1) holds (|.(b2 + b3).| ^2 ) + (|.(b2 - b3).| ^2 ) = 2 * ((|.b2.| ^2 ) + (|.b3.| ^2 ))
proof end;

theorem Th70: :: EUCLID_2:70
for b1 being Nat
for b2, b3 being Point of (TOP-REAL b1) holds (|.(b2 + b3).| ^2 ) - (|.(b2 - b3).| ^2 ) = 4 * |(b2,b3)|
proof end;

theorem Th71: :: EUCLID_2:71
for b1 being Nat
for b2, b3 being Point of (TOP-REAL b1) holds |(b2,b3)| = (1 / 4) * ((|.(b2 + b3).| ^2 ) - (|.(b2 - b3).| ^2 ))
proof end;

theorem Th72: :: EUCLID_2:72
for b1 being Nat
for b2, b3 being Point of (TOP-REAL b1) holds |(b2,b3)| <= |(b2,b2)| + |(b3,b3)|
proof end;

theorem Th73: :: EUCLID_2:73
for b1 being Nat
for b2, b3 being Point of (TOP-REAL b1) holds abs |(b2,b3)| <= |.b2.| * |.b3.|
proof end;

theorem Th74: :: EUCLID_2:74
for b1 being Nat
for b2, b3 being Point of (TOP-REAL b1) holds |.(b2 + b3).| <= |.b2.| + |.b3.|
proof end;

definition
let c1 be Nat;
let c2, c3 be Point of (TOP-REAL c1);
pred c2,c3 are_orthogonal means :Def3: :: EUCLID_2:def 3
|(a2,a3)| = 0;
symmetry
for b1, b2 being Point of (TOP-REAL c1) st |(b1,b2)| = 0 holds
|(b2,b1)| = 0
;
end;

:: deftheorem Def3 defines are_orthogonal EUCLID_2:def 3 :
for b1 being Nat
for b2, b3 being Point of (TOP-REAL b1) holds
( b2,b3 are_orthogonal iff |(b2,b3)| = 0 );

theorem Th75: :: EUCLID_2:75
for b1 being Nat
for b2 being Point of (TOP-REAL b1) holds b2, 0.REAL b1 are_orthogonal
proof end;

theorem Th76: :: EUCLID_2:76
for b1 being Nat
for b2 being Point of (TOP-REAL b1) holds 0.REAL b1,b2 are_orthogonal by Th75;

theorem Th77: :: EUCLID_2:77
for b1 being Nat
for b2 being Point of (TOP-REAL b1) holds
( b2,b2 are_orthogonal iff b2 = 0.REAL b1 )
proof end;

theorem Th78: :: EUCLID_2:78
for b1 being Nat
for b2 being real number
for b3, b4 being Point of (TOP-REAL b1) st b3,b4 are_orthogonal holds
b2 * b3,b4 are_orthogonal
proof end;

theorem Th79: :: EUCLID_2:79
for b1 being Nat
for b2 being real number
for b3, b4 being Point of (TOP-REAL b1) st b3,b4 are_orthogonal holds
b3,b2 * b4 are_orthogonal by Th78;

theorem Th80: :: EUCLID_2:80
for b1 being Nat
for b2 being Point of (TOP-REAL b1) st ( for b3 being Point of (TOP-REAL b1) holds b2,b3 are_orthogonal ) holds
b2 = 0.REAL b1
proof end;