:: ARMSTRNG semantic presentation

E1: now
let c1 be Nat;
let c2 be non empty set ;
let c3 be Tuple of c1,c2;
len c3 = c1 by FINSEQ_2:109;
hence dom c3 = Seg c1 by FINSEQ_1:def 3;
end;

theorem Th1: :: ARMSTRNG:1
for b1 being set st b1 is (B2) holds
for b2 being set
for b3 being finite Subset-Family of b2 st b2 in b1 & b3 c= b1 holds
Intersect b3 in b1
proof end;

registration
cluster non empty reflexive antisymmetric transitive set ;
existence
ex b1 being Relation st
( b1 is reflexive & b1 is antisymmetric & b1 is (F2) & b1 is (C1) )
proof end;
end;

theorem Th2: :: ARMSTRNG:2
for b1 being non empty antisymmetric transitive Relation
for b2 being finite Subset of (field b1) st b2 <> {} holds
ex b3 being Element of b2 st b3 is_maximal_wrt b2,b1
proof end;

scheme :: ARMSTRNG:sch 1
s1{ F1() -> set , P1[ set ] } :
for b1, b2 being Subset of F1() st ( for b3 being set holds
( b3 in b1 iff P1[b3] ) ) & ( for b3 being set holds
( b3 in b2 iff P1[b3] ) ) holds
b1 = b2
proof end;

definition
let c1 be set ;
let c2 be Relation;
func c2 Maximal_in c1 -> Subset of a1 means :Def1: :: ARMSTRNG:def 1
for b1 being set holds
( b1 in a3 iff b1 is_maximal_wrt a1,a2 );
existence
ex b1 being Subset of c1 st
for b2 being set holds
( b2 in b1 iff b2 is_maximal_wrt c1,c2 )
proof end;
uniqueness
for b1, b2 being Subset of c1 st ( for b3 being set holds
( b3 in b1 iff b3 is_maximal_wrt c1,c2 ) ) & ( for b3 being set holds
( b3 in b2 iff b3 is_maximal_wrt c1,c2 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def1 defines Maximal_in ARMSTRNG:def 1 :
for b1 being set
for b2 being Relation
for b3 being Subset of b1 holds
( b3 = b2 Maximal_in b1 iff for b4 being set holds
( b4 in b3 iff b4 is_maximal_wrt b1,b2 ) );

definition
let c1, c2 be set ;
pred c1 is_/\-irreducible_in c2 means :Def2: :: ARMSTRNG:def 2
( a1 in a2 & ( for b1, b2 being set st b1 in a2 & b2 in a2 & a1 = b1 /\ b2 & not a1 = b1 holds
a1 = b2 ) );
end;

:: deftheorem Def2 defines is_/\-irreducible_in ARMSTRNG:def 2 :
for b1, b2 being set holds
( b1 is_/\-irreducible_in b2 iff ( b1 in b2 & ( for b3, b4 being set st b3 in b2 & b4 in b2 & b1 = b3 /\ b4 & not b1 = b3 holds
b1 = b4 ) ) );

notation
let c1, c2 be set ;
antonym c1 is_/\-reducible_in c2 for c1 is_/\-irreducible_in c2;
end;

definition
let c1 be non empty set ;
func /\-IRR c1 -> Subset of a1 means :Def3: :: ARMSTRNG:def 3
for b1 being set holds
( b1 in a2 iff b1 is_/\-irreducible_in a1 );
existence
ex b1 being Subset of c1 st
for b2 being set holds
( b2 in b1 iff b2 is_/\-irreducible_in c1 )
proof end;
uniqueness
for b1, b2 being Subset of c1 st ( for b3 being set holds
( b3 in b1 iff b3 is_/\-irreducible_in c1 ) ) & ( for b3 being set holds
( b3 in b2 iff b3 is_/\-irreducible_in c1 ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def3 defines /\-IRR ARMSTRNG:def 3 :
for b1 being non empty set
for b2 being Subset of b1 holds
( b2 = /\-IRR b1 iff for b3 being set holds
( b3 in b2 iff b3 is_/\-irreducible_in b1 ) );

scheme :: ARMSTRNG:sch 2
s2{ F1() -> non empty finite set , P1[ set ] } :
for b1 being set st b1 in F1() holds
P1[b1]
provided
E7: for b1 being set st b1 is_/\-irreducible_in F1() holds
P1[b1] and
E8: for b1, b2 being set st b1 in F1() & b2 in F1() & P1[b1] & P1[b2] holds
P1[b1 /\ b2]
proof end;

theorem Th3: :: ARMSTRNG:3
for b1 being non empty finite set
for b2 being Element of b1 ex b3 being non empty Subset of b1 st
( b2 = meet b3 & ( for b4 being set st b4 in b3 holds
b4 is_/\-irreducible_in b1 ) )
proof end;

definition
let c1 be set ;
let c2 be Subset-Family of c1;
attr a2 is (B1) means :Def4: :: ARMSTRNG:def 4
a1 in a2;
end;

:: deftheorem Def4 defines (B1) ARMSTRNG:def 4 :
for b1 being set
for b2 being Subset-Family of b1 holds
( b2 is (B1) iff b1 in b2 );

notation
let c1 be set ;
synonym (B2) c1 for cap-closed c1;
end;

registration
let c1 be set ;
cluster (B2) (B1) Element of bool (bool a1);
existence
ex b1 being Subset-Family of c1 st
( b1 is (B1) & b1 is (B2) )
proof end;
end;

theorem Th4: :: ARMSTRNG:4
for b1 being set
for b2 being non empty Subset-Family of b1 st b2 is (B2) holds
for b3 being Element of b2 st b3 is_/\-irreducible_in b2 & b3 <> b1 holds
for b4 being finite Subset-Family of b1 st b4 c= b2 & b3 = Intersect b4 holds
b3 in b4
proof end;

registration
let c1, c2 be non empty set ;
let c3 be Nat;
cluster -> FinSequence-yielding Relation of a1,a3 -tuples_on a2;
coherence
for b1 being Function of c1,c3 -tuples_on c2 holds b1 is FinSequence-yielding
proof end;
end;

registration
let c1 be FinSequence-yielding Function;
let c2 be set ;
cluster a1 . a2 -> FinSequence-like ;
coherence
c1 . c2 is FinSequence-like
proof end;
end;

definition
let c1 be Nat;
let c2, c3 be Tuple of c1,BOOLEAN ;
func c2 '&' c3 -> Tuple of a1,BOOLEAN means :Def5: :: ARMSTRNG:def 5
for b1 being set st b1 in Seg a1 holds
a4 . b1 = (a2 /. b1) '&' (a3 /. b1);
existence
ex b1 being Tuple of c1,BOOLEAN st
for b2 being set st b2 in Seg c1 holds
b1 . b2 = (c2 /. b2) '&' (c3 /. b2)
proof end;
uniqueness
for b1, b2 being Tuple of c1,BOOLEAN st ( for b3 being set st b3 in Seg c1 holds
b1 . b3 = (c2 /. b3) '&' (c3 /. b3) ) & ( for b3 being set st b3 in Seg c1 holds
b2 . b3 = (c2 /. b3) '&' (c3 /. b3) ) holds
b1 = b2
proof end;
commutativity
for b1, b2, b3 being Tuple of c1,BOOLEAN st ( for b4 being set st b4 in Seg c1 holds
b1 . b4 = (b2 /. b4) '&' (b3 /. b4) ) holds
for b4 being set st b4 in Seg c1 holds
b1 . b4 = (b3 /. b4) '&' (b2 /. b4)
;
end;

:: deftheorem Def5 defines '&' ARMSTRNG:def 5 :
for b1 being Nat
for b2, b3, b4 being Tuple of b1,BOOLEAN holds
( b4 = b2 '&' b3 iff for b5 being set st b5 in Seg b1 holds
b4 . b5 = (b2 /. b5) '&' (b3 /. b5) );

theorem Th5: :: ARMSTRNG:5
for b1 being Nat
for b2 being Tuple of b1,BOOLEAN holds (b1 -BinarySequence 0) '&' b2 = b1 -BinarySequence 0
proof end;

theorem Th6: :: ARMSTRNG:6
for b1 being Nat
for b2 being Tuple of b1,BOOLEAN holds ('not' (b1 -BinarySequence 0)) '&' b2 = b2
proof end;

theorem Th7: :: ARMSTRNG:7
canceled;

theorem Th8: :: ARMSTRNG:8
for b1, b2 being Nat st b2 < b1 holds
( (b1 -BinarySequence (2 to_power b2)) . (b2 + 1) = 1 & ( for b3 being Nat st b3 in Seg b1 & b3 <> b2 + 1 holds
(b1 -BinarySequence (2 to_power b2)) . b3 = 0 ) )
proof end;

definition
attr a1 is strict;
struct DB-Rel -> ;
aggr DB-Rel(# Attributes, Domains, Relationship #) -> DB-Rel ;
sel Attributes c1 -> non empty finite set ;
sel Domains c1 -> V2 ManySortedSet of the Attributes of a1;
sel Relationship c1 -> Subset of (product the Domains of a1);
end;

definition
let c1 be set ;
mode Subset-Relation of a1 is Relation of bool a1;
mode Dependency-set of a1 is Relation of bool a1;
end;

registration
let c1 be set ;
cluster non empty finite Relation of bool a1, bool a1;
existence
ex b1 being Dependency-set of c1 st
( b1 is (C1) & b1 is finite )
proof end;
end;

definition
let c1 be set ;
canceled;
func Dependencies c1 -> Dependency-set of a1 equals :: ARMSTRNG:def 7
[:(bool a1),(bool a1):];
coherence
[:(bool c1),(bool c1):] is Dependency-set of c1
by RELSET_1:def 1;
end;

:: deftheorem Def6 ARMSTRNG:def 6 :
canceled;

:: deftheorem Def7 defines Dependencies ARMSTRNG:def 7 :
for b1 being set holds Dependencies b1 = [:(bool b1),(bool b1):];

definition
let c1 be set ;
mode Dependency of a1 is Element of Dependencies a1;
end;

registration
let c1 be set ;
cluster Dependencies a1 -> non empty ;
coherence
Dependencies c1 is (C1)
;
end;

definition
let c1 be set ;
let c2 be non empty Dependency-set of c1;
redefine mode Element as Element of c2 -> Dependency of a1;
correctness
coherence
for b1 being Element of c2 holds b1 is Dependency of c1
;
proof end;
end;

theorem Th9: :: ARMSTRNG:9
for b1, b2 being set holds
( b2 in Dependencies b1 iff ex b3, b4 being Subset of b1 st b2 = [b3,b4] )
proof end;

theorem Th10: :: ARMSTRNG:10
for b1, b2 being set
for b3 being Dependency-set of b1 st b2 in b3 holds
ex b4, b5 being Subset of b1 st b2 = [b4,b5]
proof end;

definition
let c1 be DB-Rel ;
let c2, c3 be Subset of the Attributes of c1;
pred c2 >|> c3,c1 means :Def8: :: ARMSTRNG:def 8
for b1, b2 being Element of the Relationship of a1 st b1 | a2 = b2 | a2 holds
b1 | a3 = b2 | a3;
end;

:: deftheorem Def8 defines >|> ARMSTRNG:def 8 :
for b1 being DB-Rel
for b2, b3 being Subset of the Attributes of b1 holds
( b2 >|> b3,b1 iff for b4, b5 being Element of the Relationship of b1 st b4 | b2 = b5 | b2 holds
b4 | b3 = b5 | b3 );

notation
let c1 be DB-Rel ;
let c2, c3 be Subset of the Attributes of c1;
synonym c2,c3 holds_in c1 for c2 >|> c3,c1;
end;

definition
let c1 be DB-Rel ;
func Dependency-str c1 -> Dependency-set of the Attributes of a1 equals :: ARMSTRNG:def 9
{ [b1,b2] where B is Subset of the Attributes of a1, B is Subset of the Attributes of a1 : b1 >|> b2,a1 } ;
coherence
{ [b1,b2] where B is Subset of the Attributes of c1, B is Subset of the Attributes of c1 : b1 >|> b2,c1 } is Dependency-set of the Attributes of c1
proof end;
end;

:: deftheorem Def9 defines Dependency-str ARMSTRNG:def 9 :
for b1 being DB-Rel holds Dependency-str b1 = { [b2,b3] where B is Subset of the Attributes of b1, B is Subset of the Attributes of b1 : b2 >|> b3,b1 } ;

theorem Th11: :: ARMSTRNG:11
canceled;

theorem Th12: :: ARMSTRNG:12
for b1 being DB-Rel
for b2, b3 being Subset of the Attributes of b1 holds
( [b2,b3] in Dependency-str b1 iff b2 >|> b3,b1 )
proof end;

definition
let c1 be set ;
let c2, c3 be Dependency of c1;
pred c2 >= c3 means :Def10: :: ARMSTRNG:def 10
( a2 `1 c= a3 `1 & a3 `2 c= a2 `2 );
reflexivity
for b1 being Dependency of c1 holds
( b1 `1 c= b1 `1 & b1 `2 c= b1 `2 )
;
end;

:: deftheorem Def10 defines >= ARMSTRNG:def 10 :
for b1 being set
for b2, b3 being Dependency of b1 holds
( b2 >= b3 iff ( b2 `1 c= b3 `1 & b3 `2 c= b2 `2 ) );

notation
let c1 be set ;
let c2, c3 be Dependency of c1;
synonym c3 <= c2 for c2 >= c3;
synonym c2 is_at_least_as_informative_as c3 for c2 >= c3;
end;

theorem Th13: :: ARMSTRNG:13
for b1 being set
for b2, b3 being Dependency of b1 st b2 <= b3 & b3 <= b2 holds
b2 = b3
proof end;

theorem Th14: :: ARMSTRNG:14
for b1 being set
for b2, b3, b4 being Dependency of b1 st b2 <= b3 & b3 <= b4 holds
b2 <= b4
proof end;

definition
let c1 be set ;
let c2, c3 be Subset of c1;
redefine func [ as [c2,c3] -> Dependency of a1;
coherence
[c2,c3] is Dependency of c1
by ZFMISC_1:def 2;
end;

theorem Th15: :: ARMSTRNG:15
for b1 being set
for b2, b3, b4, b5 being Subset of b1 holds
( [b2,b3] >= [b4,b5] iff ( b2 c= b4 & b5 c= b3 ) )
proof end;

definition
let c1 be set ;
func Dependencies-Order c1 -> Relation of Dependencies a1 equals :: ARMSTRNG:def 11
{ [b1,b2] where B is Dependency of a1, B is Dependency of a1 : b1 <= b2 } ;
coherence
{ [b1,b2] where B is Dependency of c1, B is Dependency of c1 : b1 <= b2 } is Relation of Dependencies c1
proof end;
end;

:: deftheorem Def11 defines Dependencies-Order ARMSTRNG:def 11 :
for b1 being set holds Dependencies-Order b1 = { [b2,b3] where B is Dependency of b1, B is Dependency of b1 : b2 <= b3 } ;

theorem Th16: :: ARMSTRNG:16
for b1, b2 being set holds
( b2 in Dependencies-Order b1 iff ex b3, b4 being Dependency of b1 st
( b2 = [b3,b4] & b3 <= b4 ) ) ;

theorem Th17: :: ARMSTRNG:17
for b1 being set holds dom (Dependencies-Order b1) = [:(bool b1),(bool b1):]
proof end;

theorem Th18: :: ARMSTRNG:18
for b1 being set holds rng (Dependencies-Order b1) = [:(bool b1),(bool b1):]
proof end;

theorem Th19: :: ARMSTRNG:19
for b1 being set holds field (Dependencies-Order b1) = [:(bool b1),(bool b1):]
proof end;

registration
let c1 be set ;
cluster Dependencies-Order a1 -> non empty ;
coherence
Dependencies-Order c1 is (C1)
by Th17, RELAT_1:60;
cluster Dependencies-Order a1 -> reflexive antisymmetric transitive total ;
coherence
( Dependencies-Order c1 is total & Dependencies-Order c1 is reflexive & Dependencies-Order c1 is antisymmetric & Dependencies-Order c1 is (F2) )
proof end;
end;

notation
let c1 be set ;
let c2 be Dependency-set of c1;
synonym (F2) c2 for transitive c1;
synonym (DC1) c2 for transitive c1;
end;

definition
let c1 be set ;
let c2 be Dependency-set of c1;
attr a2 is (F1) means :Def12: :: ARMSTRNG:def 12
for b1 being Subset of a1 holds [b1,b1] in a2;
end;

:: deftheorem Def12 defines (F1) ARMSTRNG:def 12 :
for b1 being set
for b2 being Dependency-set of b1 holds
( b2 is (F1) iff for b3 being Subset of b1 holds [b3,b3] in b2 );

notation
let c1 be set ;
let c2 be Dependency-set of c1;
synonym (DC2) c2 for (F1) c2;
end;

theorem Th20: :: ARMSTRNG:20
for b1 being set
for b2 being Dependency-set of b1 holds
( b2 is (F2) iff for b3, b4, b5 being Subset of b1 st [b3,b4] in b2 & [b4,b5] in b2 holds
[b3,b5] in b2 )
proof end;

definition
let c1 be set ;
let c2 be Dependency-set of c1;
attr a2 is (F3) means :Def13: :: ARMSTRNG:def 13
for b1, b2, b3, b4 being Subset of a1 st [b1,b2] in a2 & [b1,b2] >= [b3,b4] holds
[b3,b4] in a2;
attr a2 is (F4) means :Def14: :: ARMSTRNG:def 14
for b1, b2, b3, b4 being Subset of a1 st [b1,b2] in a2 & [b3,b4] in a2 holds
[(b1 \/ b3),(b2 \/ b4)] in a2;
end;

:: deftheorem Def13 defines (F3) ARMSTRNG:def 13 :
for b1 being set
for b2 being Dependency-set of b1 holds
( b2 is (F3) iff for b3, b4, b5, b6 being Subset of b1 st [b3,b4] in b2 & [b3,b4] >= [b5,b6] holds
[b5,b6] in b2 );

:: deftheorem Def14 defines (F4) ARMSTRNG:def 14 :
for b1 being set
for b2 being Dependency-set of b1 holds
( b2 is (F4) iff for b3, b4, b5, b6 being Subset of b1 st [b3,b4] in b2 & [b5,b6] in b2 holds
[(b3 \/ b5),(b4 \/ b6)] in b2 );

theorem Th21: :: ARMSTRNG:21
for b1 being set holds
( Dependencies b1 is (F1) & Dependencies b1 is (F2) & Dependencies b1 is (F3) & Dependencies b1 is (F4) )
proof end;

registration
let c1 be set ;
cluster non empty (F2) (F1) (F3) (F4) Relation of bool a1, bool a1;
existence
ex b1 being Dependency-set of c1 st
( b1 is (F1) & b1 is (F2) & b1 is (F3) & b1 is (F4) & b1 is (C1) )
proof end;
end;

definition
let c1 be set ;
let c2 be Dependency-set of c1;
attr a2 is full_family means :Def15: :: ARMSTRNG:def 15
( a2 is (F1) & a2 is (F2) & a2 is (F3) & a2 is (F4) );
end;

:: deftheorem Def15 defines full_family ARMSTRNG:def 15 :
for b1 being set
for b2 being Dependency-set of b1 holds
( b2 is full_family iff ( b2 is (F1) & b2 is (F2) & b2 is (F3) & b2 is (F4) ) );

registration
let c1 be set ;
cluster full_family Relation of bool a1, bool a1;
existence
ex b1 being Dependency-set of c1 st b1 is full_family
proof end;
end;

definition
let c1 be set ;
mode Full-family of a1 is full_family Dependency-set of a1;
end;

theorem Th22: :: ARMSTRNG:22
for b1 being finite set
for b2 being Dependency-set of b1 holds b2 is finite
proof end;

registration
let c1 be finite set ;
cluster finite Relation of bool a1, bool a1;
existence
ex b1 being Full-family of c1 st b1 is finite
proof end;
cluster -> finite Relation of bool a1, bool a1;
coherence
for b1 being Dependency-set of c1 holds b1 is finite
by Th22;
end;

registration
let c1 be set ;
cluster full_family -> (F2) (F1) (F3) (F4) Relation of bool a1, bool a1;
coherence
for b1 being Dependency-set of c1 st b1 is full_family holds
( b1 is (F1) & b1 is (F2) & b1 is (F3) & b1 is (F4) )
by Def15;
cluster (F2) (F1) (F3) (F4) -> full_family Relation of bool a1, bool a1;
correctness
coherence
for b1 being Dependency-set of c1 st b1 is (F1) & b1 is (F2) & b1 is (F3) & b1 is (F4) holds
b1 is full_family
;
by Def15;
end;

definition
let c1 be set ;
let c2 be Dependency-set of c1;
attr a2 is (DC3) means :Def16: :: ARMSTRNG:def 16
for b1, b2 being Subset of a1 st b2 c= b1 holds
[b1,b2] in a2;
end;

:: deftheorem Def16 defines (DC3) ARMSTRNG:def 16 :
for b1 being set
for b2 being Dependency-set of b1 holds
( b2 is (DC3) iff for b3, b4 being Subset of b1 st b4 c= b3 holds
[b3,b4] in b2 );

registration
let c1 be set ;
cluster (F1) (F3) -> (DC3) Relation of bool a1, bool a1;
coherence
for b1 being Dependency-set of c1 st b1 is (F1) & b1 is (F3) holds
b1 is (DC3)
proof end;
cluster (F2) (DC3) -> (F1) (F3) Relation of bool a1, bool a1;
coherence
for b1 being Dependency-set of c1 st b1 is (DC3) & b1 is (F2) holds
( b1 is (F1) & b1 is (F3) )
proof end;
end;

registration
let c1 be set ;
cluster non empty (F2) (F1) (F3) (F4) full_family (DC3) Relation of bool a1, bool a1;
existence
ex b1 being Dependency-set of c1 st
( b1 is (DC3) & b1 is (F2) & b1 is (F4) & b1 is (C1) )
proof end;
end;

theorem Th23: :: ARMSTRNG:23
for b1 being set
for b2 being Dependency-set of b1 st b2 is (DC3) & b2 is (F2) holds
( b2 is (F1) & b2 is (F3) )
proof end;

theorem Th24: :: ARMSTRNG:24
for b1 being set
for b2 being Dependency-set of b1 st b2 is (F1) & b2 is (F3) holds
b2 is (DC3)
proof end;

registration
let c1 be set ;
cluster (F1) -> non empty Relation of bool a1, bool a1;
coherence
for b1 being Dependency-set of c1 st b1 is (F1) holds
b1 is (C1)
by Def12;
end;

theorem Th25: :: ARMSTRNG:25
for b1 being DB-Rel holds Dependency-str b1 is full_family
proof end;

theorem Th26: :: ARMSTRNG:26
for b1 being set
for b2 being Subset of b1 holds { [b3,b4] where B is Subset of b1, B is Subset of b1 : ( b2 c= b3 or b4 c= b3 ) } is Full-family of b1
proof end;

definition
let c1 be set ;
let c2 be Dependency-set of c1;
func Maximal_wrt c2 -> Dependency-set of a1 equals :: ARMSTRNG:def 17
(Dependencies-Order a1) Maximal_in a2;
coherence
(Dependencies-Order c1) Maximal_in c2 is Dependency-set of c1
by RELSET_1:4;
end;

:: deftheorem Def17 defines Maximal_wrt ARMSTRNG:def 17 :
for b1 being set
for b2 being Dependency-set of b1 holds Maximal_wrt b2 = (Dependencies-Order b1) Maximal_in b2;

theorem Th27: :: ARMSTRNG:27
for b1 being set
for b2 being Dependency-set of b1 holds Maximal_wrt b2 c= b2 ;

definition
let c1 be set ;
let c2 be Dependency-set of c1;
let c3, c4 be set ;
pred c3 ^|^ c4,c2 means :Def18: :: ARMSTRNG:def 18
[a3,a4] in Maximal_wrt a2;
end;

:: deftheorem Def18 defines ^|^ ARMSTRNG:def 18 :
for b1 being set
for b2 being Dependency-set of b1
for b3, b4 being set holds
( b3 ^|^ b4,b2 iff [b3,b4] in Maximal_wrt b2 );

theorem Th28: :: ARMSTRNG:28
for b1 being finite set
for b2 being Dependency of b1
for b3 being Dependency-set of b1 st b2 in b3 holds
ex b4, b5 being Subset of b1 st
( [b4,b5] in Maximal_wrt b3 & [b4,b5] >= b2 )
proof end;

theorem Th29: :: ARMSTRNG:29
for b1 being set
for b2 being Dependency-set of b1
for b3, b4 being Subset of b1 holds
( b3 ^|^ b4,b2 iff ( [b3,b4] in b2 & ( for b5, b6 being Subset of b1 holds
( not [b5,b6] in b2 or ( not b3 <> b5 & not b4 <> b6 ) or not [b3,b4] <= [b5,b6] ) ) ) )
proof end;

definition
let c1 be set ;
let c2 be Dependency-set of c1;
attr a2 is (M1) means :Def19: :: ARMSTRNG:def 19
for b1 being Subset of a1 ex b2, b3 being Subset of a1 st
( [b2,b3] >= [b1,b1] & [b2,b3] in a2 );
attr a2 is (M2) means :Def20: :: ARMSTRNG:def 20
for b1, b2, b3, b4 being Subset of a1 st [b1,b2] in a2 & [b3,b4] in a2 & [b1,b2] >= [b3,b4] holds
( b1 = b3 & b2 = b4 );
attr a2 is (M3) means :Def21: :: ARMSTRNG:def 21
for b1, b2, b3, b4 being Subset of a1 st [b1,b2] in a2 & [b3,b4] in a2 & b3 c= b2 holds
b4 c= b2;
end;

:: deftheorem Def19 defines (M1) ARMSTRNG:def 19 :
for b1 being set
for b2 being Dependency-set of b1 holds
( b2 is (M1) iff for b3 being Subset of b1 ex b4, b5 being Subset of b1 st
( [b4,b5] >= [b3,b3] & [b4,b5] in b2 ) );

:: deftheorem Def20 defines (M2) ARMSTRNG:def 20 :
for b1 being set
for b2 being Dependency-set of b1 holds
( b2 is (M2) iff for b3, b4, b5, b6 being Subset of b1 st [b3,b4] in b2 & [b5,b6] in b2 & [b3,b4] >= [b5,b6] holds
( b3 = b5 & b4 = b6 ) );

:: deftheorem Def21 defines (M3) ARMSTRNG:def 21 :
for b1 being set
for b2 being Dependency-set of b1 holds
( b2 is (M3) iff for b3, b4, b5, b6 being Subset of b1 st [b3,b4] in b2 & [b5,b6] in b2 & b5 c= b4 holds
b6 c= b4 );

theorem Th30: :: ARMSTRNG:30
for b1 being non empty finite set
for b2 being Full-family of b1 holds
( Maximal_wrt b2 is (M1) & Maximal_wrt b2 is (M2) & Maximal_wrt b2 is (M3) )
proof end;

theorem Th31: :: ARMSTRNG:31
for b1 being finite set
for b2, b3 being Dependency-set of b1 st b2 is (M1) & b2 is (M2) & b2 is (M3) & b3 = { [b4,b5] where B is Subset of b1, B is Subset of b1 : ex b1, b2 being Subset of b1 st
( [b6,b7] >= [b4,b5] & [b6,b7] in b2 )
}
holds
( b2 = Maximal_wrt b3 & b3 is full_family & ( for b4 being Full-family of b1 st b2 = Maximal_wrt b4 holds
b4 = b3 ) )
proof end;

registration
let c1 be non empty finite set ;
let c2 be Full-family of c1;
cluster Maximal_wrt a2 -> non empty finite ;
coherence
Maximal_wrt c2 is (C1)
proof end;
end;

theorem Th32: :: ARMSTRNG:32
for b1 being finite set
for b2 being Dependency-set of b1
for b3 being Subset of b1 st b2 = { [b4,b5] where B is Subset of b1, B is Subset of b1 : ( b3 c= b4 or b5 c= b4 ) } holds
{[b3,b1]} \/ { [b4,b4] where B is Subset of b1 : not b3 c= b4 } = Maximal_wrt b2
proof end;

definition
let c1 be set ;
let c2 be Dependency-set of c1;
func saturated-subsets c2 -> Subset-Family of a1 equals :: ARMSTRNG:def 22
{ b1 where B is Subset of a1 : ex b1 being Subset of a1 st b2 ^|^ b1,a2 } ;
coherence
{ b1 where B is Subset of c1 : ex b1 being Subset of c1 st b2 ^|^ b1,c2 } is Subset-Family of c1
proof end;
end;

:: deftheorem Def22 defines saturated-subsets ARMSTRNG:def 22 :
for b1 being set
for b2 being Dependency-set of b1 holds saturated-subsets b2 = { b3 where B is Subset of b1 : ex b1 being Subset of b1 st b4 ^|^ b3,b2 } ;

notation
let c1 be set ;
let c2 be Dependency-set of c1;
synonym closed_attribute_subset c2 for saturated-subsets c2;
end;

registration
let c1 be set ;
let c2 be finite Dependency-set of c1;
cluster saturated-subsets a2 -> finite ;
coherence
saturated-subsets c2 is finite
proof end;
end;

theorem Th33: :: ARMSTRNG:33
for b1, b2 being set
for b3 being Dependency-set of b1 holds
( b2 in saturated-subsets b3 iff ex b4, b5 being Subset of b1 st
( b2 = b4 & b5 ^|^ b4,b3 ) )
proof end;

theorem Th34: :: ARMSTRNG:34
for b1 being non empty finite set
for b2 being Full-family of b1 holds
( saturated-subsets b2 is (B1) & saturated-subsets b2 is (B2) )
proof end;

definition
let c1, c2 be set ;
func c1 deps_encl_by c2 -> Dependency-set of a1 equals :: ARMSTRNG:def 23
{ [b1,b2] where B is Subset of a1, B is Subset of a1 : for b1 being set st b3 in a2 & b1 c= b3 holds
b2 c= b3
}
;
coherence
{ [b1,b2] where B is Subset of c1, B is Subset of c1 : for b1 being set st b3 in c2 & b1 c= b3 holds
b2 c= b3
}
is Dependency-set of c1
proof end;
end;

:: deftheorem Def23 defines deps_encl_by ARMSTRNG:def 23 :
for b1, b2 being set holds b1 deps_encl_by b2 = { [b3,b4] where B is Subset of b1, B is Subset of b1 : for b1 being set st b5 in b2 & b3 c= b5 holds
b4 c= b5
}
;

theorem Th35: :: ARMSTRNG:35
for b1 being set
for b2 being Subset-Family of b1
for b3 being Dependency-set of b1 holds b1 deps_encl_by b2 is full_family
proof end;

theorem Th36: :: ARMSTRNG:36
for b1 being non empty finite set
for b2 being Subset-Family of b1 holds b2 c= saturated-subsets (b1 deps_encl_by b2)
proof end;

theorem Th37: :: ARMSTRNG:37
for b1 being non empty finite set
for b2 being Subset-Family of b1 st b2 is (B1) & b2 is (B2) holds
( b2 = saturated-subsets (b1 deps_encl_by b2) & ( for b3 being Full-family of b1 st b2 = saturated-subsets b3 holds
b3 = b1 deps_encl_by b2 ) )
proof end;

definition
let c1 be set ;
let c2 be Dependency-set of c1;
func enclosure_of c2 -> Subset-Family of a1 equals :: ARMSTRNG:def 24
{ b1 where B is Subset of a1 : for b1, b2 being Subset of a1 st [b2,b3] in a2 & b2 c= b1 holds
b3 c= b1
}
;
coherence
{ b1 where B is Subset of c1 : for b1, b2 being Subset of c1 st [b2,b3] in c2 & b2 c= b1 holds
b3 c= b1
}
is Subset-Family of c1
proof end;
end;

:: deftheorem Def24 defines enclosure_of ARMSTRNG:def 24 :
for b1 being set
for b2 being Dependency-set of b1 holds enclosure_of b2 = { b3 where B is Subset of b1 : for b1, b2 being Subset of b1 st [b4,b5] in b2 & b4 c= b3 holds
b5 c= b3
}
;

theorem Th38: :: ARMSTRNG:38
for b1 being non empty finite set
for b2 being Dependency-set of b1 holds
( enclosure_of b2 is (B1) & enclosure_of b2 is (B2) )
proof end;

theorem Th39: :: ARMSTRNG:39
for b1 being non empty finite set
for b2 being Dependency-set of b1 holds
( b2 c= b1 deps_encl_by (enclosure_of b2) & ( for b3 being Dependency-set of b1 st b2 c= b3 & b3 is full_family holds
b1 deps_encl_by (enclosure_of b2) c= b3 ) )
proof end;

definition
let c1 be non empty finite set ;
let c2 be Dependency-set of c1;
func Dependency-closure c2 -> Full-family of a1 means :Def25: :: ARMSTRNG:def 25
( a2 c= a3 & ( for b1 being Dependency-set of a1 st a2 c= b1 & b1 is full_family holds
a3 c= b1 ) );
existence
ex b1 being Full-family of c1 st
( c2 c= b1 & ( for b2 being Dependency-set of c1 st c2 c= b2 & b2 is full_family holds
b1 c= b2 ) )
proof end;
correctness
uniqueness
for b1, b2 being Full-family of c1 st c2 c= b1 & ( for b3 being Dependency-set of c1 st c2 c= b3 & b3 is full_family holds
b1 c= b3 ) & c2 c= b2 & ( for b3 being Dependency-set of c1 st c2 c= b3 & b3 is full_family holds
b2 c= b3 ) holds
b1 = b2
;
proof end;
end;

:: deftheorem Def25 defines Dependency-closure ARMSTRNG:def 25 :
for b1 being non empty finite set
for b2 being Dependency-set of b1
for b3 being Full-family of b1 holds
( b3 = Dependency-closure b2 iff ( b2 c= b3 & ( for b4 being Dependency-set of b1 st b2 c= b4 & b4 is full_family holds
b3 c= b4 ) ) );

theorem Th40: :: ARMSTRNG:40
for b1 being non empty finite set
for b2 being Dependency-set of b1 holds Dependency-closure b2 = b1 deps_encl_by (enclosure_of b2)
proof end;

theorem Th41: :: ARMSTRNG:41
for b1 being set
for b2 being Subset of b1
for b3 being Subset-Family of b1 st b3 = {b1} \/ { b4 where B is Subset of b1 : not b2 c= b4 } holds
( b3 is (B1) & b3 is (B2) )
proof end;

theorem Th42: :: ARMSTRNG:42
for b1 being non empty finite set
for b2 being Dependency-set of b1
for b3 being Subset of b1 st b2 = { [b4,b5] where B is Subset of b1, B is Subset of b1 : ( b3 c= b4 or b5 c= b4 ) } holds
{b1} \/ { b4 where B is Subset of b1 : not b3 c= b4 } = saturated-subsets b2
proof end;

theorem Th43: :: ARMSTRNG:43
for b1 being finite set
for b2 being Dependency-set of b1
for b3 being Subset of b1 st b2 = { [b4,b5] where B is Subset of b1, B is Subset of b1 : ( b3 c= b4 or b5 c= b4 ) } holds
{b1} \/ { b4 where B is Subset of b1 : not b3 c= b4 } = saturated-subsets b2
proof end;

definition
let c1, c2 be set ;
let c3 be Subset-Family of c1;
pred c2 is_generator-set_of c3 means :Def26: :: ARMSTRNG:def 26
( a2 c= a3 & a3 = { (Intersect b1) where B is Subset-Family of a1 : b1 c= a2 } );
end;

:: deftheorem Def26 defines is_generator-set_of ARMSTRNG:def 26 :
for b1, b2 being set
for b3 being Subset-Family of b1 holds
( b2 is_generator-set_of b3 iff ( b2 c= b3 & b3 = { (Intersect b4) where B is Subset-Family of b1 : b4 c= b2 } ) );

theorem Th44: :: ARMSTRNG:44
for b1 being non empty finite set
for b2 being Subset-Family of b1 holds b2 is_generator-set_of saturated-subsets (b1 deps_encl_by b2)
proof end;

theorem Th45: :: ARMSTRNG:45
for b1 being non empty finite set
for b2 being Full-family of b1 ex b3 being Subset-Family of b1 st
( b3 is_generator-set_of saturated-subsets b2 & b2 = b1 deps_encl_by b3 )
proof end;

theorem Th46: :: ARMSTRNG:46
for b1 being set
for b2 being non empty finite Subset-Family of b1 st b2 is (B1) & b2 is (B2) holds
/\-IRR b2 is_generator-set_of b2
proof end;

theorem Th47: :: ARMSTRNG:47
for b1, b2 being set
for b3 being non empty finite Subset-Family of b1 st b3 is (B1) & b3 is (B2) & b2 is_generator-set_of b3 holds
/\-IRR b3 c= b2 \/ {b1}
proof end;

theorem Th48: :: ARMSTRNG:48
for b1 being non empty finite set
for b2 being Full-family of b1 ex b3 being DB-Rel st
( the Attributes of b3 = b1 & ( for b4 being Element of b1 holds the Domains of b3 . b4 = INT ) & b2 = Dependency-str b3 )
proof end;

Lemma56: for b1, b2, b3 being set st b2 = { [b4,b5] where B is Subset of b1, B is Subset of b1 : for b1 being set st b6 in b3 & b4 c= b6 holds
b5 c= b6
}
holds
for b4, b5 being Subset of b1 holds
( [b4,b5] in b2 iff for b6 being set st b6 in b3 & b4 c= b6 holds
b5 c= b6 )
proof end;

definition
let c1 be set ;
let c2 be Dependency-set of c1;
func candidate-keys c2 -> Subset-Family of a1 equals :: ARMSTRNG:def 27
{ b1 where B is Subset of a1 : [b1,a1] in Maximal_wrt a2 } ;
coherence
{ b1 where B is Subset of c1 : [b1,c1] in Maximal_wrt c2 } is Subset-Family of c1
proof end;
end;

:: deftheorem Def27 defines candidate-keys ARMSTRNG:def 27 :
for b1 being set
for b2 being Dependency-set of b1 holds candidate-keys b2 = { b3 where B is Subset of b1 : [b3,b1] in Maximal_wrt b2 } ;

theorem Th49: :: ARMSTRNG:49
for b1 being finite set
for b2 being Dependency-set of b1
for b3 being Subset of b1 st b2 = { [b4,b5] where B is Subset of b1, B is Subset of b1 : ( b3 c= b4 or b5 c= b4 ) } holds
candidate-keys b2 = {b3}
proof end;

notation
let c1 be set ;
antonym (C1) c1 for empty c1;
end;

definition
let c1 be set ;
attr a1 is without_proper_subsets means :Def28: :: ARMSTRNG:def 28
for b1, b2 being set st b1 in a1 & b2 in a1 & b1 c= b2 holds
b1 = b2;
end;

:: deftheorem Def28 defines without_proper_subsets ARMSTRNG:def 28 :
for b1 being set holds
( b1 is without_proper_subsets iff for b2, b3 being set st b2 in b1 & b3 in b1 & b2 c= b3 holds
b2 = b3 );

notation
let c1 be set ;
synonym (C2) c1 for without_proper_subsets c1;
end;

theorem Th50: :: ARMSTRNG:50
for b1 being DB-Rel holds
( candidate-keys (Dependency-str b1) is (C1) & candidate-keys (Dependency-str b1) is without_proper_subsets )
proof end;

theorem Th51: :: ARMSTRNG:51
for b1 being finite set
for b2 being Subset-Family of b1 st b2 is (C1) & b2 is without_proper_subsets holds
ex b3 being Full-family of b1 st b2 = candidate-keys b3
proof end;

theorem Th52: :: ARMSTRNG:52
for b1 being finite set
for b2 being Subset-Family of b1
for b3 being set st b2 is (C1) & b2 is without_proper_subsets & b3 = { b4 where B is Subset of b1 : for b1 being Subset of b1 st b5 in b2 holds
not b5 c= b4
}
holds
b2 = candidate-keys (b1 deps_encl_by b3)
proof end;

theorem Th53: :: ARMSTRNG:53
for b1 being non empty finite set
for b2 being Subset-Family of b1 st b2 is (C1) & b2 is without_proper_subsets holds
ex b3 being DB-Rel st
( the Attributes of b3 = b1 & b2 = candidate-keys (Dependency-str b3) )
proof end;

definition
let c1 be set ;
let c2 be Dependency-set of c1;
attr a2 is (DC4) means :Def29: :: ARMSTRNG:def 29
for b1, b2, b3 being Subset of a1 st [b1,b2] in a2 & [b1,b3] in a2 holds
[b1,(b2 \/ b3)] in a2;
attr a2 is (DC5) means :Def30: :: ARMSTRNG:def 30
for b1, b2, b3, b4 being Subset of a1 st [b1,b2] in a2 & [(b2 \/ b3),b4] in a2 holds
[(b1 \/ b3),b4] in a2;
attr a2 is (DC6) means :Def31: :: ARMSTRNG:def 31
for b1, b2, b3 being Subset of a1 st [b1,b2] in a2 holds
[(b1 \/ b3),b2] in a2;
end;

:: deftheorem Def29 defines (DC4) ARMSTRNG:def 29 :
for b1 being set
for b2 being Dependency-set of b1 holds
( b2 is (DC4) iff for b3, b4, b5 being Subset of b1 st [b3,b4] in b2 & [b3,b5] in b2 holds
[b3,(b4 \/ b5)] in b2 );

:: deftheorem Def30 defines (DC5) ARMSTRNG:def 30 :
for b1 being set
for b2 being Dependency-set of b1 holds
( b2 is (DC5) iff for b3, b4, b5, b6 being Subset of b1 st [b3,b4] in b2 & [(b4 \/ b5),b6] in b2 holds
[(b3 \/ b5),b6] in b2 );

:: deftheorem Def31 defines (DC6) ARMSTRNG:def 31 :
for b1 being set
for b2 being Dependency-set of b1 holds
( b2 is (DC6) iff for b3, b4, b5 being Subset of b1 st [b3,b4] in b2 holds
[(b3 \/ b5),b4] in b2 );

theorem Th54: :: ARMSTRNG:54
for b1 being set
for b2 being Dependency-set of b1 holds
( b2 is (F1) & b2 is (F2) & b2 is (F3) & b2 is (F4) iff ( b2 is (F2) & b2 is (DC3) & b2 is (F4) ) ) by Th23, Th24;

theorem Th55: :: ARMSTRNG:55
for b1 being set
for b2 being Dependency-set of b1 holds
( b2 is (F1) & b2 is (F2) & b2 is (F3) & b2 is (F4) iff ( b2 is (F2) & b2 is (DC3) & b2 is (DC4) ) )
proof end;

theorem Th56: :: ARMSTRNG:56
for b1 being set
for b2 being Dependency-set of b1 holds
( b2 is (F1) & b2 is (F2) & b2 is (F3) & b2 is (F4) iff ( b2 is (F1) & b2 is (DC5) & b2 is (DC6) ) )
proof end;

definition
let c1 be set ;
let c2 be Dependency-set of c1;
func charact_set c2 -> set equals :: ARMSTRNG:def 32
{ b1 where B is Subset of a1 : ex b1, b2 being Subset of a1 st
( [b2,b3] in a2 & b2 c= b1 & not b3 c= b1 )
}
;
correctness
coherence
{ b1 where B is Subset of c1 : ex b1, b2 being Subset of c1 st
( [b2,b3] in c2 & b2 c= b1 & not b3 c= b1 )
}
is set
;
;
end;

:: deftheorem Def32 defines charact_set ARMSTRNG:def 32 :
for b1 being set
for b2 being Dependency-set of b1 holds charact_set b2 = { b3 where B is Subset of b1 : ex b1, b2 being Subset of b1 st
( [b4,b5] in b2 & b4 c= b3 & not b5 c= b3 )
}
;

theorem Th57: :: ARMSTRNG:57
for b1, b2 being set
for b3 being Dependency-set of b1 st b2 in charact_set b3 holds
( b2 is Subset of b1 & ex b4, b5 being Subset of b1 st
( [b4,b5] in b3 & b4 c= b2 & not b5 c= b2 ) )
proof end;

theorem Th58: :: ARMSTRNG:58
for b1 being set
for b2 being Subset of b1
for b3 being Dependency-set of b1 st ex b4, b5 being Subset of b1 st
( [b4,b5] in b3 & b4 c= b2 & not b5 c= b2 ) holds
b2 in charact_set b3 ;

theorem Th59: :: ARMSTRNG:59
for b1 being non empty finite set
for b2 being Dependency-set of b1 holds
( ( for b3, b4 being Subset of b1 holds
( [b3,b4] in Dependency-closure b2 iff for b5 being Subset of b1 st b3 c= b5 & not b4 c= b5 holds
b5 in charact_set b2 ) ) & saturated-subsets (Dependency-closure b2) = (bool b1) \ (charact_set b2) )
proof end;

theorem Th60: :: ARMSTRNG:60
for b1 being non empty finite set
for b2, b3 being Dependency-set of b1 st charact_set b2 = charact_set b3 holds
Dependency-closure b2 = Dependency-closure b3
proof end;

theorem Th61: :: ARMSTRNG:61
for b1 being non empty finite set
for b2 being Dependency-set of b1 holds charact_set b2 = charact_set (Dependency-closure b2)
proof end;

definition
let c1, c2 be set ;
let c3 be Dependency-set of c1;
pred c2 is_p_i_w_ncv_of c3 means :Def33: :: ARMSTRNG:def 33
( ( for b1 being Subset of a1 st a2 c= b1 & b1 <> a1 holds
b1 in charact_set a3 ) & ( for b1 being set st b1 c< a2 holds
ex b2 being Subset of a1 st
( b1 c= b2 & b2 <> a1 & not b2 in charact_set a3 ) ) );
end;

:: deftheorem Def33 defines is_p_i_w_ncv_of ARMSTRNG:def 33 :
for b1, b2 being set
for b3 being Dependency-set of b1 holds
( b2 is_p_i_w_ncv_of b3 iff ( ( for b4 being Subset of b1 st b2 c= b4 & b4 <> b1 holds
b4 in charact_set b3 ) & ( for b4 being set st b4 c< b2 holds
ex b5 being Subset of b1 st
( b4 c= b5 & b5 <> b1 & not b5 in charact_set b3 ) ) ) );

theorem Th62: :: ARMSTRNG:62
for b1 being non empty finite set
for b2 being Dependency-set of b1
for b3 being Subset of b1 holds
( b3 in candidate-keys (Dependency-closure b2) iff b3 is_p_i_w_ncv_of b2 )
proof end;