:: Cross Products and Tripple Vector Products in 3-dimensional Euclidian Space
:: by Kanchun, Hiroshi Yamazaki and Yatsuka Nakamura
::
:: Received August 8, 2003
:: Copyright (c) 2003-2021 Association of Mizar Users


theorem Th1: :: EUCLID_5:1
for p being Point of (TOP-REAL 3) ex x, y, z being Real st p = <*x,y,z*>
proof end;

definition
let p be Point of (TOP-REAL 3);
func p `1 -> Real equals :: EUCLID_5:def 1
p . 1;
coherence
p . 1 is Real
;
func p `2 -> Real equals :: EUCLID_5:def 2
p . 2;
coherence
p . 2 is Real
;
func p `3 -> Real equals :: EUCLID_5:def 3
p . 3;
coherence
p . 3 is Real
;
end;

:: deftheorem defines `1 EUCLID_5:def 1 :
for p being Point of (TOP-REAL 3) holds p `1 = p . 1;

:: deftheorem defines `2 EUCLID_5:def 2 :
for p being Point of (TOP-REAL 3) holds p `2 = p . 2;

:: deftheorem defines `3 EUCLID_5:def 3 :
for p being Point of (TOP-REAL 3) holds p `3 = p . 3;

notation
let x, y, z be Real;
synonym |[x,y,z]| for <*x,y,z*>;
end;

definition
let x, y, z be Real;
:: original: |[
redefine func |[x,y,z]| -> Point of (TOP-REAL 3);
coherence
|[x,y,z]| is Point of (TOP-REAL 3)
proof end;
end;

theorem Th2: :: EUCLID_5:2
for x, y, z being Real holds
( |[x,y,z]| `1 = x & |[x,y,z]| `2 = y & |[x,y,z]| `3 = z ) by FINSEQ_1:45;

theorem Th3: :: EUCLID_5:3
for p being Point of (TOP-REAL 3) holds p = |[(p `1),(p `2),(p `3)]|
proof end;

theorem Th4: :: EUCLID_5:4
0. (TOP-REAL 3) = |[0,0,0]|
proof end;

theorem Th5: :: EUCLID_5:5
for p1, p2 being Point of (TOP-REAL 3) holds p1 + p2 = |[((p1 `1) + (p2 `1)),((p1 `2) + (p2 `2)),((p1 `3) + (p2 `3))]|
proof end;

theorem Th6: :: EUCLID_5:6
for x1, x2, y1, y2, z1, z2 being Real holds |[x1,y1,z1]| + |[x2,y2,z2]| = |[(x1 + x2),(y1 + y2),(z1 + z2)]|
proof end;

theorem Th7: :: EUCLID_5:7
for x being Real
for p being Point of (TOP-REAL 3) holds x * p = |[(x * (p `1)),(x * (p `2)),(x * (p `3))]|
proof end;

theorem Th8: :: EUCLID_5:8
for x, x1, y1, z1 being Real holds x * |[x1,y1,z1]| = |[(x * x1),(x * y1),(x * z1)]|
proof end;

theorem :: EUCLID_5:9
for x being Real
for p being Point of (TOP-REAL 3) holds
( (x * p) `1 = x * (p `1) & (x * p) `2 = x * (p `2) & (x * p) `3 = x * (p `3) )
proof end;

theorem Th10: :: EUCLID_5:10
for p being Point of (TOP-REAL 3) holds - p = |[(- (p `1)),(- (p `2)),(- (p `3))]|
proof end;

theorem :: EUCLID_5:11
for x1, y1, z1 being Real holds - |[x1,y1,z1]| = |[(- x1),(- y1),(- z1)]|
proof end;

theorem Th12: :: EUCLID_5:12
for p1, p2 being Point of (TOP-REAL 3) holds p1 - p2 = |[((p1 `1) - (p2 `1)),((p1 `2) - (p2 `2)),((p1 `3) - (p2 `3))]|
proof end;

theorem Th13: :: EUCLID_5:13
for x1, x2, y1, y2, z1, z2 being Real holds |[x1,y1,z1]| - |[x2,y2,z2]| = |[(x1 - x2),(y1 - y2),(z1 - z2)]|
proof end;

definition
let p1, p2 be Point of (TOP-REAL 3);
func p1 <X> p2 -> Point of (TOP-REAL 3) equals :: EUCLID_5:def 4
|[(((p1 `2) * (p2 `3)) - ((p1 `3) * (p2 `2))),(((p1 `3) * (p2 `1)) - ((p1 `1) * (p2 `3))),(((p1 `1) * (p2 `2)) - ((p1 `2) * (p2 `1)))]|;
correctness
coherence
|[(((p1 `2) * (p2 `3)) - ((p1 `3) * (p2 `2))),(((p1 `3) * (p2 `1)) - ((p1 `1) * (p2 `3))),(((p1 `1) * (p2 `2)) - ((p1 `2) * (p2 `1)))]| is Point of (TOP-REAL 3)
;
;
end;

:: deftheorem defines <X> EUCLID_5:def 4 :
for p1, p2 being Point of (TOP-REAL 3) holds p1 <X> p2 = |[(((p1 `2) * (p2 `3)) - ((p1 `3) * (p2 `2))),(((p1 `3) * (p2 `1)) - ((p1 `1) * (p2 `3))),(((p1 `1) * (p2 `2)) - ((p1 `2) * (p2 `1)))]|;

theorem :: EUCLID_5:14
for x, y, z being Real
for p being Point of (TOP-REAL 3) st p = |[x,y,z]| holds
( p `1 = x & p `2 = y & p `3 = z ) by FINSEQ_1:45;

theorem Th15: :: EUCLID_5:15
for x1, x2, y1, y2, z1, z2 being Real holds |[x1,y1,z1]| <X> |[x2,y2,z2]| = |[((y1 * z2) - (z1 * y2)),((z1 * x2) - (x1 * z2)),((x1 * y2) - (y1 * x2))]|
proof end;

theorem :: EUCLID_5:16
for x being Real
for p1, p2 being Point of (TOP-REAL 3) holds
( (x * p1) <X> p2 = x * (p1 <X> p2) & (x * p1) <X> p2 = p1 <X> (x * p2) )
proof end;

theorem Th17: :: EUCLID_5:17
for p1, p2 being Point of (TOP-REAL 3) holds p1 <X> p2 = - (p2 <X> p1)
proof end;

theorem :: EUCLID_5:18
for p1, p2 being Point of (TOP-REAL 3) holds (- p1) <X> p2 = p1 <X> (- p2)
proof end;

theorem :: EUCLID_5:19
for x, y, z being Real holds |[0,0,0]| <X> |[x,y,z]| = 0. (TOP-REAL 3)
proof end;

theorem :: EUCLID_5:20
for x1, x2 being Real holds |[x1,0,0]| <X> |[x2,0,0]| = 0. (TOP-REAL 3)
proof end;

theorem :: EUCLID_5:21
for y1, y2 being Real holds |[0,y1,0]| <X> |[0,y2,0]| = 0. (TOP-REAL 3)
proof end;

theorem :: EUCLID_5:22
for z1, z2 being Real holds |[0,0,z1]| <X> |[0,0,z2]| = 0. (TOP-REAL 3)
proof end;

theorem Th23: :: EUCLID_5:23
for p1, p2, p3 being Point of (TOP-REAL 3) holds p1 <X> (p2 + p3) = (p1 <X> p2) + (p1 <X> p3)
proof end;

theorem Th24: :: EUCLID_5:24
for p1, p2, p3 being Point of (TOP-REAL 3) holds (p1 + p2) <X> p3 = (p1 <X> p3) + (p2 <X> p3)
proof end;

theorem :: EUCLID_5:25
for p1 being Point of (TOP-REAL 3) holds p1 <X> p1 = 0. (TOP-REAL 3) by Th4;

theorem :: EUCLID_5:26
for p1, p2, p3, p4 being Point of (TOP-REAL 3) holds (p1 + p2) <X> (p3 + p4) = (((p1 <X> p3) + (p1 <X> p4)) + (p2 <X> p3)) + (p2 <X> p4)
proof end;

::
:: Inner Product for Point of TOP-REAL 3
::
theorem Th27: :: EUCLID_5:27
for p being Point of (TOP-REAL 3) holds p = <*(p `1),(p `2),(p `3)*>
proof end;

theorem Th28: :: EUCLID_5:28
for f1, f2 being FinSequence of REAL st len f1 = 3 & len f2 = 3 holds
mlt (f1,f2) = <*((f1 . 1) * (f2 . 1)),((f1 . 2) * (f2 . 2)),((f1 . 3) * (f2 . 3))*>
proof end;

theorem Th29: :: EUCLID_5:29
for p1, p2 being Point of (TOP-REAL 3) holds |(p1,p2)| = (((p1 `1) * (p2 `1)) + ((p1 `2) * (p2 `2))) + ((p1 `3) * (p2 `3))
proof end;

theorem Th30: :: EUCLID_5:30
for x3, y3, x1, x2, y1, y2 being Real holds |(|[x1,x2,x3]|,|[y1,y2,y3]|)| = ((x1 * y1) + (x2 * y2)) + (x3 * y3)
proof end;

::
:: Scalar and Vector : Triple Products
::
definition
let p1, p2, p3 be Point of (TOP-REAL 3);
func |{p1,p2,p3}| -> Real equals :: EUCLID_5:def 5
|(p1,(p2 <X> p3))|;
coherence
|(p1,(p2 <X> p3))| is Real
;
end;

:: deftheorem defines |{ EUCLID_5:def 5 :
for p1, p2, p3 being Point of (TOP-REAL 3) holds |{p1,p2,p3}| = |(p1,(p2 <X> p3))|;

theorem :: EUCLID_5:31
for p1, p2 being Point of (TOP-REAL 3) holds
( |{p1,p1,p2}| = 0 & |{p2,p1,p2}| = 0 )
proof end;

theorem :: EUCLID_5:32
for p1, p2, p3 being Point of (TOP-REAL 3) holds p1 <X> (p2 <X> p3) = (|(p1,p3)| * p2) - (|(p1,p2)| * p3)
proof end;

theorem Th33: :: EUCLID_5:33
for p1, p2, p3 being Point of (TOP-REAL 3) holds |{p1,p2,p3}| = |{p2,p3,p1}|
proof end;

theorem :: EUCLID_5:34
for p1, p2, p3 being Point of (TOP-REAL 3) holds |{p1,p2,p3}| = |{p3,p1,p2}| by Th33;

theorem :: EUCLID_5:35
for p1, p2, p3 being Point of (TOP-REAL 3) holds |{p1,p2,p3}| = |((p1 <X> p2),p3)|
proof end;

registration
cluster TOP-REAL 3 -> up-3-dimensional ;
coherence
TOP-REAL 3 is up-3-dimensional
proof end;
end;