:: ALGSTR_3 semantic presentation

definition
attr a1 is strict;
struct TernaryFieldStr -> ZeroStr ;
aggr TernaryFieldStr(# carrier, Zero, unity, ternary #) -> TernaryFieldStr ;
sel unity c1 -> Element of the carrier of a1;
sel ternary c1 -> TriOp of the carrier of a1;
end;

registration
cluster non empty TernaryFieldStr ;
existence
not for b1 being TernaryFieldStr holds b1 is empty
proof end;
end;

definition
let c1 be non empty TernaryFieldStr ;
mode Scalar of a1 is Element of a1;
end;

definition
let c1 be non empty TernaryFieldStr ;
let c2, c3, c4 be Scalar of c1;
func Tern c2,c3,c4 -> Scalar of a1 equals :: ALGSTR_3:def 1
the ternary of a1 . a2,a3,a4;
correctness
coherence
the ternary of c1 . c2,c3,c4 is Scalar of c1
;
;
end;

:: deftheorem Def1 defines Tern ALGSTR_3:def 1 :
for b1 being non empty TernaryFieldStr
for b2, b3, b4 being Scalar of b1 holds Tern b2,b3,b4 = the ternary of b1 . b2,b3,b4;

definition
let c1 be non empty TernaryFieldStr ;
canceled;
func 1_ c1 -> Scalar of a1 equals :: ALGSTR_3:def 3
the unity of a1;
correctness
coherence
the unity of c1 is Scalar of c1
;
;
end;

:: deftheorem Def2 ALGSTR_3:def 2 :
canceled;

:: deftheorem Def3 defines 1_ ALGSTR_3:def 3 :
for b1 being non empty TernaryFieldStr holds 1_ b1 = the unity of b1;

definition
func ternaryreal -> TriOp of REAL means :Def4: :: ALGSTR_3:def 4
for b1, b2, b3 being Real holds a1 . b1,b2,b3 = (b1 * b2) + b3;
existence
ex b1 being TriOp of REAL st
for b2, b3, b4 being Real holds b1 . b2,b3,b4 = (b2 * b3) + b4
proof end;
uniqueness
for b1, b2 being TriOp of REAL st ( for b3, b4, b5 being Real holds b1 . b3,b4,b5 = (b3 * b4) + b5 ) & ( for b3, b4, b5 being Real holds b2 . b3,b4,b5 = (b3 * b4) + b5 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def4 defines ternaryreal ALGSTR_3:def 4 :
for b1 being TriOp of REAL holds
( b1 = ternaryreal iff for b2, b3, b4 being Real holds b1 . b2,b3,b4 = (b2 * b3) + b4 );

definition
func TernaryFieldEx -> strict TernaryFieldStr equals :: ALGSTR_3:def 5
TernaryFieldStr(# REAL ,0,1,ternaryreal #);
correctness
coherence
TernaryFieldStr(# REAL ,0,1,ternaryreal #) is strict TernaryFieldStr
;
;
end;

:: deftheorem Def5 defines TernaryFieldEx ALGSTR_3:def 5 :
TernaryFieldEx = TernaryFieldStr(# REAL ,0,1,ternaryreal #);

registration
cluster TernaryFieldEx -> non empty strict ;
coherence
not TernaryFieldEx is empty
proof end;
end;

definition
let c1, c2, c3 be Scalar of TernaryFieldEx ;
func tern c1,c2,c3 -> Scalar of TernaryFieldEx equals :: ALGSTR_3:def 6
the ternary of TernaryFieldEx . a1,a2,a3;
correctness
coherence
the ternary of TernaryFieldEx . c1,c2,c3 is Scalar of TernaryFieldEx
;
;
end;

:: deftheorem Def6 defines tern ALGSTR_3:def 6 :
for b1, b2, b3 being Scalar of TernaryFieldEx holds tern b1,b2,b3 = the ternary of TernaryFieldEx . b1,b2,b3;

theorem Th1: :: ALGSTR_3:1
canceled;

theorem Th2: :: ALGSTR_3:2
canceled;

theorem Th3: :: ALGSTR_3:3
for b1, b2, b3, b4 being Real st b1 <> b2 holds
ex b5 being Real st (b1 * b5) + b3 = (b2 * b5) + b4
proof end;

theorem Th4: :: ALGSTR_3:4
canceled;

theorem Th5: :: ALGSTR_3:5
for b1, b2, b3 being Scalar of TernaryFieldEx
for b4, b5, b6 being Real st b1 = b4 & b2 = b5 & b3 = b6 holds
Tern b1,b2,b3 = (b4 * b5) + b6 by Def4;

theorem Th6: :: ALGSTR_3:6
0 = 0. TernaryFieldEx by RLVECT_1:def 2;

theorem Th7: :: ALGSTR_3:7
1 = 1_ TernaryFieldEx ;

Lemma5: for b1 being Scalar of TernaryFieldEx holds Tern b1,(1_ TernaryFieldEx ),(0. TernaryFieldEx ) = b1
proof end;

Lemma6: for b1 being Scalar of TernaryFieldEx holds Tern (1_ TernaryFieldEx ),b1,(0. TernaryFieldEx ) = b1
proof end;

Lemma7: for b1, b2 being Scalar of TernaryFieldEx holds Tern b1,(0. TernaryFieldEx ),b2 = b2
proof end;

Lemma8: for b1, b2 being Scalar of TernaryFieldEx holds Tern (0. TernaryFieldEx ),b1,b2 = b2
proof end;

Lemma9: for b1, b2, b3 being Scalar of TernaryFieldEx ex b4 being Scalar of TernaryFieldEx st Tern b1,b2,b4 = b3
proof end;

Lemma10: for b1, b2, b3, b4 being Scalar of TernaryFieldEx st Tern b1,b2,b3 = Tern b1,b2,b4 holds
b3 = b4
proof end;

Lemma11: for b1, b2 being Scalar of TernaryFieldEx st b1 <> b2 holds
for b3, b4 being Scalar of TernaryFieldEx ex b5, b6 being Scalar of TernaryFieldEx st
( Tern b5,b1,b6 = b3 & Tern b5,b2,b6 = b4 )
proof end;

Lemma12: for b1, b2 being Scalar of TernaryFieldEx st b1 <> b2 holds
for b3, b4 being Scalar of TernaryFieldEx ex b5 being Scalar of TernaryFieldEx st Tern b1,b5,b3 = Tern b2,b5,b4
proof end;

Lemma13: for b1, b2, b3, b4, b5, b6 being Scalar of TernaryFieldEx st Tern b3,b1,b5 = Tern b4,b1,b6 & Tern b3,b2,b5 = Tern b4,b2,b6 & not b1 = b2 holds
b3 = b4
proof end;

definition
let c1 be non empty TernaryFieldStr ;
attr a1 is Ternary-Field-like means :Def7: :: ALGSTR_3:def 7
( 0. a1 <> 1_ a1 & ( for b1 being Scalar of a1 holds Tern b1,(1_ a1),(0. a1) = b1 ) & ( for b1 being Scalar of a1 holds Tern (1_ a1),b1,(0. a1) = b1 ) & ( for b1, b2 being Scalar of a1 holds Tern b1,(0. a1),b2 = b2 ) & ( for b1, b2 being Scalar of a1 holds Tern (0. a1),b1,b2 = b2 ) & ( for b1, b2, b3 being Scalar of a1 ex b4 being Scalar of a1 st Tern b1,b2,b4 = b3 ) & ( for b1, b2, b3, b4 being Scalar of a1 st Tern b1,b2,b3 = Tern b1,b2,b4 holds
b3 = b4 ) & ( for b1, b2 being Scalar of a1 st b1 <> b2 holds
for b3, b4 being Scalar of a1 ex b5, b6 being Scalar of a1 st
( Tern b5,b1,b6 = b3 & Tern b5,b2,b6 = b4 ) ) & ( for b1, b2 being Scalar of a1 st b1 <> b2 holds
for b3, b4 being Scalar of a1 ex b5 being Scalar of a1 st Tern b1,b5,b3 = Tern b2,b5,b4 ) & ( for b1, b2, b3, b4, b5, b6 being Scalar of a1 st Tern b3,b1,b5 = Tern b4,b1,b6 & Tern b3,b2,b5 = Tern b4,b2,b6 & not b1 = b2 holds
b3 = b4 ) );
end;

:: deftheorem Def7 defines Ternary-Field-like ALGSTR_3:def 7 :
for b1 being non empty TernaryFieldStr holds
( b1 is Ternary-Field-like iff ( 0. b1 <> 1_ b1 & ( for b2 being Scalar of b1 holds Tern b2,(1_ b1),(0. b1) = b2 ) & ( for b2 being Scalar of b1 holds Tern (1_ b1),b2,(0. b1) = b2 ) & ( for b2, b3 being Scalar of b1 holds Tern b2,(0. b1),b3 = b3 ) & ( for b2, b3 being Scalar of b1 holds Tern (0. b1),b2,b3 = b3 ) & ( for b2, b3, b4 being Scalar of b1 ex b5 being Scalar of b1 st Tern b2,b3,b5 = b4 ) & ( for b2, b3, b4, b5 being Scalar of b1 st Tern b2,b3,b4 = Tern b2,b3,b5 holds
b4 = b5 ) & ( for b2, b3 being Scalar of b1 st b2 <> b3 holds
for b4, b5 being Scalar of b1 ex b6, b7 being Scalar of b1 st
( Tern b6,b2,b7 = b4 & Tern b6,b3,b7 = b5 ) ) & ( for b2, b3 being Scalar of b1 st b2 <> b3 holds
for b4, b5 being Scalar of b1 ex b6 being Scalar of b1 st Tern b2,b6,b4 = Tern b3,b6,b5 ) & ( for b2, b3, b4, b5, b6, b7 being Scalar of b1 st Tern b4,b2,b6 = Tern b5,b2,b7 & Tern b4,b3,b6 = Tern b5,b3,b7 & not b2 = b3 holds
b4 = b5 ) ) );

registration
cluster non empty strict Ternary-Field-like TernaryFieldStr ;
existence
ex b1 being non empty TernaryFieldStr st
( b1 is strict & b1 is Ternary-Field-like )
proof end;
end;

definition
mode Ternary-Field is non empty Ternary-Field-like TernaryFieldStr ;
end;

theorem Th8: :: ALGSTR_3:8
for b1 being Ternary-Field
for b2, b3, b4, b5, b6, b7 being Scalar of b1 st b2 <> b3 & Tern b4,b2,b5 = Tern b6,b2,b7 & Tern b4,b3,b5 = Tern b6,b3,b7 holds
( b4 = b6 & b5 = b7 )
proof end;

theorem Th9: :: ALGSTR_3:9
canceled;

theorem Th10: :: ALGSTR_3:10
canceled;

theorem Th11: :: ALGSTR_3:11
for b1 being Ternary-Field
for b2 being Scalar of b1 st b2 <> 0. b1 holds
for b3, b4 being Scalar of b1 ex b5 being Scalar of b1 st Tern b2,b5,b3 = b4
proof end;

theorem Th12: :: ALGSTR_3:12
for b1 being Ternary-Field
for b2, b3, b4, b5 being Scalar of b1 st b2 <> 0. b1 & Tern b2,b3,b4 = Tern b2,b5,b4 holds
b3 = b5
proof end;

theorem Th13: :: ALGSTR_3:13
for b1 being Ternary-Field
for b2 being Scalar of b1 st b2 <> 0. b1 holds
for b3, b4 being Scalar of b1 ex b5 being Scalar of b1 st Tern b5,b2,b3 = b4
proof end;

theorem Th14: :: ALGSTR_3:14
for b1 being Ternary-Field
for b2, b3, b4, b5 being Scalar of b1 st b2 <> 0. b1 & Tern b3,b2,b4 = Tern b5,b2,b4 holds
b3 = b5
proof end;