:: ALTCAT_1 semantic presentation

registration
let c1 be functional set ;
cluster -> functional Element of bool a1;
coherence
for b1 being Subset of c1 holds b1 is functional
proof end;
end;

registration
let c1 be Function-yielding Function;
let c2 be set ;
cluster a1 | a2 -> Function-yielding ;
correctness
coherence
c1 | c2 is Function-yielding
;
by MSUHOM_1:3;
end;

registration
let c1 be Function;
cluster {a1} -> functional ;
coherence
{c1} is functional
proof end;
end;

theorem Th1: :: ALTCAT_1:1
canceled;

theorem Th2: :: ALTCAT_1:2
for b1 being set holds id b1 in Funcs b1,b1
proof end;

theorem Th3: :: ALTCAT_1:3
Funcs {} ,{} = {(id {} )}
proof end;

theorem Th4: :: ALTCAT_1:4
for b1, b2, b3 being set
for b4, b5 being Function st b4 in Funcs b1,b2 & b5 in Funcs b2,b3 holds
b5 * b4 in Funcs b1,b3
proof end;

theorem Th5: :: ALTCAT_1:5
for b1, b2, b3 being set st Funcs b1,b2 <> {} & Funcs b2,b3 <> {} holds
Funcs b1,b3 <> {}
proof end;

theorem Th6: :: ALTCAT_1:6
canceled;

theorem Th7: :: ALTCAT_1:7
for b1, b2 being set
for b3 being ManySortedSet of [:b2,b1:]
for b4 being Subset of b1
for b5 being Subset of b2
for b6, b7 being set st b6 in b4 & b7 in b5 holds
b3 . b7,b6 = (b3 | [:b5,b4:]) . b7,b6
proof end;

scheme :: ALTCAT_1:sch 1
s1{ F1() -> set , F2() -> set , F3( set , set ) -> set } :
ex b1 being ManySortedSet of [:F1(),F2():] st
for b2, b3 being set st b2 in F1() & b3 in F2() holds
b1 . b2,b3 = F3(b2,b3)
proof end;

scheme :: ALTCAT_1:sch 2
s2{ F1() -> non empty set , F2() -> non empty set , F3( set , set ) -> set } :
ex b1 being ManySortedSet of [:F1(),F2():] st
for b2 being Element of F1()
for b3 being Element of F2() holds b1 . b2,b3 = F3(b2,b3)
proof end;

scheme :: ALTCAT_1:sch 3
s3{ F1() -> set , F2() -> set , F3() -> set , F4( set , set , set ) -> set } :
ex b1 being ManySortedSet of [:F1(),F2(),F3():] st
for b2, b3, b4 being set st b2 in F1() & b3 in F2() & b4 in F3() holds
b1 . b2,b3,b4 = F4(b2,b3,b4)
proof end;

scheme :: ALTCAT_1:sch 4
s4{ F1() -> non empty set , F2() -> non empty set , F3() -> non empty set , F4( set , set , set ) -> set } :
ex b1 being ManySortedSet of [:F1(),F2(),F3():] st
for b2 being Element of F1()
for b3 being Element of F2()
for b4 being Element of F3() holds b1 . b2,b3,b4 = F4(b2,b3,b4)
proof end;

theorem Th8: :: ALTCAT_1:8
for b1, b2 being set
for b3, b4 being ManySortedSet of [:b1,b2:] st ( for b5, b6 being set st b5 in b1 & b6 in b2 holds
b3 . b5,b6 = b4 . b5,b6 ) holds
b4 = b3
proof end;

theorem Th9: :: ALTCAT_1:9
for b1, b2 being non empty set
for b3, b4 being ManySortedSet of [:b1,b2:] st ( for b5 being Element of b1
for b6 being Element of b2 holds b3 . b5,b6 = b4 . b5,b6 ) holds
b4 = b3
proof end;

theorem Th10: :: ALTCAT_1:10
for b1 being set
for b2, b3 being ManySortedSet of [:b1,b1,b1:] st ( for b4, b5, b6 being set st b4 in b1 & b5 in b1 & b6 in b1 holds
b2 . b4,b5,b6 = b3 . b4,b5,b6 ) holds
b3 = b2
proof end;

theorem Th11: :: ALTCAT_1:11
for b1, b2, b3 being set holds b1,b2 :-> b3 = [b1,b2] .--> b3
proof end;

theorem Th12: :: ALTCAT_1:12
for b1, b2, b3 being set holds (b1,b2 :-> b3) . b1,b2 = b3
proof end;

definition
attr a1 is strict;
struct AltGraph -> 1-sorted ;
aggr AltGraph(# carrier, Arrows #) -> AltGraph ;
sel Arrows c1 -> ManySortedSet of [:the carrier of a1,the carrier of a1:];
end;

definition
let c1 be AltGraph ;
mode object of a1 is Element of a1;
end;

definition
let c1 be AltGraph ;
let c2, c3 be object of c1;
canceled;
func <^c2,c3^> -> set equals :: ALTCAT_1:def 2
the Arrows of a1 . a2,a3;
correctness
coherence
the Arrows of c1 . c2,c3 is set
;
;
end;

:: deftheorem Def1 ALTCAT_1:def 1 :
canceled;

:: deftheorem Def2 defines <^ ALTCAT_1:def 2 :
for b1 being AltGraph
for b2, b3 being object of b1 holds <^b2,b3^> = the Arrows of b1 . b2,b3;

definition
let c1 be AltGraph ;
let c2, c3 be object of c1;
mode Morphism of a2,a3 is Element of <^a2,a3^>;
end;

definition
let c1 be AltGraph ;
canceled;
attr a1 is transitive means :Def4: :: ALTCAT_1:def 4
for b1, b2, b3 being object of a1 st <^b1,b2^> <> {} & <^b2,b3^> <> {} holds
<^b1,b3^> <> {} ;
end;

:: deftheorem Def3 ALTCAT_1:def 3 :
canceled;

:: deftheorem Def4 defines transitive ALTCAT_1:def 4 :
for b1 being AltGraph holds
( b1 is transitive iff for b2, b3, b4 being object of b1 st <^b2,b3^> <> {} & <^b3,b4^> <> {} holds
<^b2,b4^> <> {} );

definition
let c1 be set ;
let c2 be ManySortedSet of [:c1,c1:];
func {|c2|} -> ManySortedSet of [:a1,a1,a1:] means :Def5: :: ALTCAT_1:def 5
for b1, b2, b3 being set st b1 in a1 & b2 in a1 & b3 in a1 holds
a3 . b1,b2,b3 = a2 . b1,b3;
existence
ex b1 being ManySortedSet of [:c1,c1,c1:] st
for b2, b3, b4 being set st b2 in c1 & b3 in c1 & b4 in c1 holds
b1 . b2,b3,b4 = c2 . b2,b4
proof end;
uniqueness
for b1, b2 being ManySortedSet of [:c1,c1,c1:] st ( for b3, b4, b5 being set st b3 in c1 & b4 in c1 & b5 in c1 holds
b1 . b3,b4,b5 = c2 . b3,b5 ) & ( for b3, b4, b5 being set st b3 in c1 & b4 in c1 & b5 in c1 holds
b2 . b3,b4,b5 = c2 . b3,b5 ) holds
b1 = b2
proof end;
let c3 be ManySortedSet of [:c1,c1:];
func {|c2,c3|} -> ManySortedSet of [:a1,a1,a1:] means :Def6: :: ALTCAT_1:def 6
for b1, b2, b3 being set st b1 in a1 & b2 in a1 & b3 in a1 holds
a4 . b1,b2,b3 = [:(a3 . b2,b3),(a2 . b1,b2):];
existence
ex b1 being ManySortedSet of [:c1,c1,c1:] st
for b2, b3, b4 being set st b2 in c1 & b3 in c1 & b4 in c1 holds
b1 . b2,b3,b4 = [:(c3 . b3,b4),(c2 . b2,b3):]
proof end;
uniqueness
for b1, b2 being ManySortedSet of [:c1,c1,c1:] st ( for b3, b4, b5 being set st b3 in c1 & b4 in c1 & b5 in c1 holds
b1 . b3,b4,b5 = [:(c3 . b4,b5),(c2 . b3,b4):] ) & ( for b3, b4, b5 being set st b3 in c1 & b4 in c1 & b5 in c1 holds
b2 . b3,b4,b5 = [:(c3 . b4,b5),(c2 . b3,b4):] ) holds
b1 = b2
proof end;
end;

:: deftheorem Def5 defines {| ALTCAT_1:def 5 :
for b1 being set
for b2 being ManySortedSet of [:b1,b1:]
for b3 being ManySortedSet of [:b1,b1,b1:] holds
( b3 = {|b2|} iff for b4, b5, b6 being set st b4 in b1 & b5 in b1 & b6 in b1 holds
b3 . b4,b5,b6 = b2 . b4,b6 );

:: deftheorem Def6 defines {| ALTCAT_1:def 6 :
for b1 being set
for b2, b3 being ManySortedSet of [:b1,b1:]
for b4 being ManySortedSet of [:b1,b1,b1:] holds
( b4 = {|b2,b3|} iff for b5, b6, b7 being set st b5 in b1 & b6 in b1 & b7 in b1 holds
b4 . b5,b6,b7 = [:(b3 . b6,b7),(b2 . b5,b6):] );

definition
let c1 be set ;
let c2 be ManySortedSet of [:c1,c1:];
mode BinComp of a2 is ManySortedFunction of {|a2,a2|},{|a2|};
end;

definition
let c1 be non empty set ;
let c2 be ManySortedSet of [:c1,c1:];
let c3 be BinComp of c2;
let c4, c5, c6 be Element of c1;
redefine func . as c3 . c4,c5,c6 -> Function of [:(a2 . a5,a6),(a2 . a4,a5):],a2 . a4,a6;
coherence
c3 . c4,c5,c6 is Function of [:(c2 . c5,c6),(c2 . c4,c5):],c2 . c4,c6
proof end;
end;

definition
let c1 be non empty set ;
let c2 be ManySortedSet of [:c1,c1:];
let c3 be BinComp of c2;
attr a3 is associative means :Def7: :: ALTCAT_1:def 7
for b1, b2, b3, b4 being Element of a1
for b5, b6, b7 being set st b5 in a2 . b1,b2 & b6 in a2 . b2,b3 & b7 in a2 . b3,b4 holds
(a3 . b1,b3,b4) . b7,((a3 . b1,b2,b3) . b6,b5) = (a3 . b1,b2,b4) . ((a3 . b2,b3,b4) . b7,b6),b5;
attr a3 is with_right_units means :Def8: :: ALTCAT_1:def 8
for b1 being Element of a1 ex b2 being set st
( b2 in a2 . b1,b1 & ( for b3 being Element of a1
for b4 being set st b4 in a2 . b1,b3 holds
(a3 . b1,b1,b3) . b4,b2 = b4 ) );
attr a3 is with_left_units means :Def9: :: ALTCAT_1:def 9
for b1 being Element of a1 ex b2 being set st
( b2 in a2 . b1,b1 & ( for b3 being Element of a1
for b4 being set st b4 in a2 . b3,b1 holds
(a3 . b3,b1,b1) . b2,b4 = b4 ) );
end;

:: deftheorem Def7 defines associative ALTCAT_1:def 7 :
for b1 being non empty set
for b2 being ManySortedSet of [:b1,b1:]
for b3 being BinComp of b2 holds
( b3 is associative iff for b4, b5, b6, b7 being Element of b1
for b8, b9, b10 being set st b8 in b2 . b4,b5 & b9 in b2 . b5,b6 & b10 in b2 . b6,b7 holds
(b3 . b4,b6,b7) . b10,((b3 . b4,b5,b6) . b9,b8) = (b3 . b4,b5,b7) . ((b3 . b5,b6,b7) . b10,b9),b8 );

:: deftheorem Def8 defines with_right_units ALTCAT_1:def 8 :
for b1 being non empty set
for b2 being ManySortedSet of [:b1,b1:]
for b3 being BinComp of b2 holds
( b3 is with_right_units iff for b4 being Element of b1 ex b5 being set st
( b5 in b2 . b4,b4 & ( for b6 being Element of b1
for b7 being set st b7 in b2 . b4,b6 holds
(b3 . b4,b4,b6) . b7,b5 = b7 ) ) );

:: deftheorem Def9 defines with_left_units ALTCAT_1:def 9 :
for b1 being non empty set
for b2 being ManySortedSet of [:b1,b1:]
for b3 being BinComp of b2 holds
( b3 is with_left_units iff for b4 being Element of b1 ex b5 being set st
( b5 in b2 . b4,b4 & ( for b6 being Element of b1
for b7 being set st b7 in b2 . b6,b4 holds
(b3 . b6,b4,b4) . b5,b7 = b7 ) ) );

definition
attr a1 is strict;
struct AltCatStr -> AltGraph ;
aggr AltCatStr(# carrier, Arrows, Comp #) -> AltCatStr ;
sel Comp c1 -> BinComp of the Arrows of a1;
end;

registration
cluster non empty strict AltCatStr ;
existence
ex b1 being AltCatStr st
( b1 is strict & not b1 is empty )
proof end;
end;

definition
let c1 be non empty AltCatStr ;
let c2, c3, c4 be object of c1;
assume E16: ( <^c2,c3^> <> {} & <^c3,c4^> <> {} ) ;
let c5 be Morphism of c2,c3;
let c6 be Morphism of c3,c4;
func c6 * c5 -> Morphism of a2,a4 equals :Def10: :: ALTCAT_1:def 10
(the Comp of a1 . a2,a3,a4) . a6,a5;
coherence
(the Comp of c1 . c2,c3,c4) . c6,c5 is Morphism of c2,c4
proof end;
correctness
;
end;

:: deftheorem Def10 defines * ALTCAT_1:def 10 :
for b1 being non empty AltCatStr
for b2, b3, b4 being object of b1 st <^b2,b3^> <> {} & <^b3,b4^> <> {} holds
for b5 being Morphism of b2,b3
for b6 being Morphism of b3,b4 holds b6 * b5 = (the Comp of b1 . b2,b3,b4) . b6,b5;

definition
let c1 be Function;
attr a1 is compositional means :Def11: :: ALTCAT_1:def 11
for b1 being set st b1 in dom a1 holds
ex b2, b3 being Function st
( b1 = [b3,b2] & a1 . b1 = b3 * b2 );
end;

:: deftheorem Def11 defines compositional ALTCAT_1:def 11 :
for b1 being Function holds
( b1 is compositional iff for b2 being set st b2 in dom b1 holds
ex b3, b4 being Function st
( b2 = [b4,b3] & b1 . b2 = b4 * b3 ) );

registration
let c1, c2 be functional set ;
cluster compositional ManySortedSet of [:a1,a2:];
existence
ex b1 being ManySortedFunction of [:c1,c2:] st b1 is compositional
proof end;
end;

theorem Th13: :: ALTCAT_1:13
for b1, b2 being functional set
for b3 being compositional ManySortedSet of [:b1,b2:]
for b4, b5 being Function st b4 in b1 & b5 in b2 holds
b3 . b4,b5 = b4 * b5
proof end;

definition
let c1, c2 be functional set ;
func FuncComp c1,c2 -> compositional ManySortedFunction of [:a2,a1:] means :Def12: :: ALTCAT_1:def 12
verum;
uniqueness
for b1, b2 being compositional ManySortedFunction of [:c2,c1:] holds b1 = b2
proof end;
correctness
existence
ex b1 being compositional ManySortedFunction of [:c2,c1:] st verum
;
;
end;

:: deftheorem Def12 defines FuncComp ALTCAT_1:def 12 :
for b1, b2 being functional set
for b3 being compositional ManySortedFunction of [:b2,b1:] holds
( b3 = FuncComp b1,b2 iff verum );

theorem Th14: :: ALTCAT_1:14
for b1, b2, b3 being set holds rng (FuncComp (Funcs b1,b2),(Funcs b2,b3)) c= Funcs b1,b3
proof end;

theorem Th15: :: ALTCAT_1:15
for b1 being set holds FuncComp {(id b1)},{(id b1)} = (id b1),(id b1) :-> (id b1)
proof end;

theorem Th16: :: ALTCAT_1:16
for b1, b2 being functional set
for b3 being Subset of b1
for b4 being Subset of b2 holds FuncComp b3,b4 = (FuncComp b1,b2) | [:b4,b3:]
proof end;

definition
let c1 be non empty AltCatStr ;
attr a1 is quasi-functional means :Def13: :: ALTCAT_1:def 13
for b1, b2 being object of a1 holds <^b1,b2^> c= Funcs b1,b2;
attr a1 is semi-functional means :Def14: :: ALTCAT_1:def 14
for b1, b2, b3 being object of a1 st <^b1,b2^> <> {} & <^b2,b3^> <> {} & <^b1,b3^> <> {} holds
for b4 being Morphism of b1,b2
for b5 being Morphism of b2,b3
for b6, b7 being Function st b4 = b6 & b5 = b7 holds
b5 * b4 = b7 * b6;
attr a1 is pseudo-functional means :Def15: :: ALTCAT_1:def 15
for b1, b2, b3 being object of a1 holds the Comp of a1 . b1,b2,b3 = (FuncComp (Funcs b1,b2),(Funcs b2,b3)) | [:<^b2,b3^>,<^b1,b2^>:];
end;

:: deftheorem Def13 defines quasi-functional ALTCAT_1:def 13 :
for b1 being non empty AltCatStr holds
( b1 is quasi-functional iff for b2, b3 being object of b1 holds <^b2,b3^> c= Funcs b2,b3 );

:: deftheorem Def14 defines semi-functional ALTCAT_1:def 14 :
for b1 being non empty AltCatStr holds
( b1 is semi-functional iff for b2, b3, b4 being object of b1 st <^b2,b3^> <> {} & <^b3,b4^> <> {} & <^b2,b4^> <> {} holds
for b5 being Morphism of b2,b3
for b6 being Morphism of b3,b4
for b7, b8 being Function st b5 = b7 & b6 = b8 holds
b6 * b5 = b8 * b7 );

:: deftheorem Def15 defines pseudo-functional ALTCAT_1:def 15 :
for b1 being non empty AltCatStr holds
( b1 is pseudo-functional iff for b2, b3, b4 being object of b1 holds the Comp of b1 . b2,b3,b4 = (FuncComp (Funcs b2,b3),(Funcs b3,b4)) | [:<^b3,b4^>,<^b2,b3^>:] );

registration
let c1 be non empty set ;
let c2 be ManySortedSet of [:c1,c1:];
let c3 be BinComp of c2;
cluster AltCatStr(# a1,a2,a3 #) -> non empty ;
coherence
not AltCatStr(# c1,c2,c3 #) is empty
by STRUCT_0:def 1;
end;

registration
cluster non empty strict pseudo-functional AltCatStr ;
existence
ex b1 being non empty AltCatStr st
( b1 is strict & b1 is pseudo-functional )
proof end;
end;

theorem Th17: :: ALTCAT_1:17
for b1 being non empty AltCatStr
for b2, b3, b4 being object of b1 holds the Comp of b1 . b2,b3,b4 is Function of [:<^b3,b4^>,<^b2,b3^>:],<^b2,b4^> ;

theorem Th18: :: ALTCAT_1:18
for b1 being non empty pseudo-functional AltCatStr
for b2, b3, b4 being object of b1 st <^b2,b3^> <> {} & <^b3,b4^> <> {} & <^b2,b4^> <> {} holds
for b5 being Morphism of b2,b3
for b6 being Morphism of b3,b4
for b7, b8 being Function st b5 = b7 & b6 = b8 holds
b6 * b5 = b8 * b7
proof end;

definition
let c1 be non empty set ;
func EnsCat c1 -> non empty strict pseudo-functional AltCatStr means :Def16: :: ALTCAT_1:def 16
( the carrier of a2 = a1 & ( for b1, b2 being object of a2 holds <^b1,b2^> = Funcs b1,b2 ) );
existence
ex b1 being non empty strict pseudo-functional AltCatStr st
( the carrier of b1 = c1 & ( for b2, b3 being object of b1 holds <^b2,b3^> = Funcs b2,b3 ) )
proof end;
uniqueness
for b1, b2 being non empty strict pseudo-functional AltCatStr st the carrier of b1 = c1 & ( for b3, b4 being object of b1 holds <^b3,b4^> = Funcs b3,b4 ) & the carrier of b2 = c1 & ( for b3, b4 being object of b2 holds <^b3,b4^> = Funcs b3,b4 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def16 defines EnsCat ALTCAT_1:def 16 :
for b1 being non empty set
for b2 being non empty strict pseudo-functional AltCatStr holds
( b2 = EnsCat b1 iff ( the carrier of b2 = b1 & ( for b3, b4 being object of b2 holds <^b3,b4^> = Funcs b3,b4 ) ) );

definition
let c1 be non empty AltCatStr ;
attr a1 is associative means :Def17: :: ALTCAT_1:def 17
the Comp of a1 is associative;
attr a1 is with_units means :Def18: :: ALTCAT_1:def 18
( the Comp of a1 is with_left_units & the Comp of a1 is with_right_units );
end;

:: deftheorem Def17 defines associative ALTCAT_1:def 17 :
for b1 being non empty AltCatStr holds
( b1 is associative iff the Comp of b1 is associative );

:: deftheorem Def18 defines with_units ALTCAT_1:def 18 :
for b1 being non empty AltCatStr holds
( b1 is with_units iff ( the Comp of b1 is with_left_units & the Comp of b1 is with_right_units ) );

Lemma30: for b1 being non empty set holds
( EnsCat b1 is transitive & EnsCat b1 is associative & EnsCat b1 is with_units )
proof end;

registration
cluster non empty transitive strict associative with_units AltCatStr ;
existence
ex b1 being non empty AltCatStr st
( b1 is transitive & b1 is associative & b1 is with_units & b1 is strict )
proof end;
end;

theorem Th19: :: ALTCAT_1:19
canceled;

theorem Th20: :: ALTCAT_1:20
for b1 being non empty transitive AltCatStr
for b2, b3, b4 being object of b1 holds
( dom (the Comp of b1 . b2,b3,b4) = [:<^b3,b4^>,<^b2,b3^>:] & rng (the Comp of b1 . b2,b3,b4) c= <^b2,b4^> )
proof end;

theorem Th21: :: ALTCAT_1:21
for b1 being non empty with_units AltCatStr
for b2 being object of b1 holds <^b2,b2^> <> {}
proof end;

registration
let c1 be non empty set ;
cluster EnsCat a1 -> non empty transitive strict pseudo-functional associative with_units ;
coherence
( EnsCat c1 is transitive & EnsCat c1 is associative & EnsCat c1 is with_units )
by Lemma30;
end;

registration
cluster non empty transitive quasi-functional semi-functional -> non empty pseudo-functional AltCatStr ;
coherence
for b1 being non empty AltCatStr st b1 is quasi-functional & b1 is semi-functional & b1 is transitive holds
b1 is pseudo-functional
proof end;
cluster non empty transitive pseudo-functional with_units -> non empty quasi-functional semi-functional AltCatStr ;
coherence
for b1 being non empty AltCatStr st b1 is with_units & b1 is pseudo-functional & b1 is transitive holds
( b1 is quasi-functional & b1 is semi-functional )
proof end;
end;

definition
mode category is non empty transitive associative with_units AltCatStr ;
end;

definition
let c1 be non empty with_units AltCatStr ;
let c2 be object of c1;
func idm c2 -> Morphism of a2,a2 means :Def19: :: ALTCAT_1:def 19
for b1 being object of a1 st <^a2,b1^> <> {} holds
for b2 being Morphism of a2,b1 holds b2 * a3 = b2;
existence
ex b1 being Morphism of c2,c2 st
for b2 being object of c1 st <^c2,b2^> <> {} holds
for b3 being Morphism of c2,b2 holds b3 * b1 = b3
proof end;
uniqueness
for b1, b2 being Morphism of c2,c2 st ( for b3 being object of c1 st <^c2,b3^> <> {} holds
for b4 being Morphism of c2,b3 holds b4 * b1 = b4 ) & ( for b3 being object of c1 st <^c2,b3^> <> {} holds
for b4 being Morphism of c2,b3 holds b4 * b2 = b4 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def19 defines idm ALTCAT_1:def 19 :
for b1 being non empty with_units AltCatStr
for b2 being object of b1
for b3 being Morphism of b2,b2 holds
( b3 = idm b2 iff for b4 being object of b1 st <^b2,b4^> <> {} holds
for b5 being Morphism of b2,b4 holds b5 * b3 = b5 );

theorem Th22: :: ALTCAT_1:22
canceled;

theorem Th23: :: ALTCAT_1:23
for b1 being non empty with_units AltCatStr
for b2 being object of b1 holds idm b2 in <^b2,b2^>
proof end;

theorem Th24: :: ALTCAT_1:24
for b1 being non empty with_units AltCatStr
for b2, b3 being object of b1 st <^b2,b3^> <> {} holds
for b4 being Morphism of b2,b3 holds (idm b3) * b4 = b4
proof end;

theorem Th25: :: ALTCAT_1:25
for b1 being non empty transitive associative AltCatStr
for b2, b3, b4, b5 being object of b1 st <^b2,b3^> <> {} & <^b3,b4^> <> {} & <^b4,b5^> <> {} holds
for b6 being Morphism of b2,b3
for b7 being Morphism of b3,b4
for b8 being Morphism of b4,b5 holds b8 * (b7 * b6) = (b8 * b7) * b6
proof end;

definition
let c1 be AltCatStr ;
attr a1 is quasi-discrete means :Def20: :: ALTCAT_1:def 20
for b1, b2 being object of a1 st <^b1,b2^> <> {} holds
b1 = b2;
attr a1 is pseudo-discrete means :Def21: :: ALTCAT_1:def 21
for b1 being object of a1 holds <^b1,b1^> is trivial;
end;

:: deftheorem Def20 defines quasi-discrete ALTCAT_1:def 20 :
for b1 being AltCatStr holds
( b1 is quasi-discrete iff for b2, b3 being object of b1 st <^b2,b3^> <> {} holds
b2 = b3 );

:: deftheorem Def21 defines pseudo-discrete ALTCAT_1:def 21 :
for b1 being AltCatStr holds
( b1 is pseudo-discrete iff for b2 being object of b1 holds <^b2,b2^> is trivial );

theorem Th26: :: ALTCAT_1:26
for b1 being non empty with_units AltCatStr holds
( b1 is pseudo-discrete iff for b2 being object of b1 holds <^b2,b2^> = {(idm b2)} )
proof end;

registration
cluster non empty trivial -> quasi-discrete AltCatStr ;
coherence
for b1 being AltCatStr st b1 is trivial & not b1 is empty holds
b1 is quasi-discrete
proof end;
end;

theorem Th27: :: ALTCAT_1:27
( EnsCat 1 is pseudo-discrete & EnsCat 1 is trivial )
proof end;

registration
cluster trivial strict quasi-discrete pseudo-discrete AltCatStr ;
existence
ex b1 being category st
( b1 is pseudo-discrete & b1 is trivial & b1 is strict )
by Th27;
end;

registration
cluster trivial strict quasi-discrete pseudo-discrete AltCatStr ;
existence
ex b1 being category st
( b1 is quasi-discrete & b1 is pseudo-discrete & b1 is trivial & b1 is strict )
proof end;
end;

definition
mode discrete_category is quasi-discrete pseudo-discrete category;
end;

definition
let c1 be non empty set ;
func DiscrCat c1 -> non empty strict quasi-discrete AltCatStr means :Def22: :: ALTCAT_1:def 22
( the carrier of a2 = a1 & ( for b1 being object of a2 holds <^b1,b1^> = {(id b1)} ) );
existence
ex b1 being non empty strict quasi-discrete AltCatStr st
( the carrier of b1 = c1 & ( for b2 being object of b1 holds <^b2,b2^> = {(id b2)} ) )
proof end;
correctness
uniqueness
for b1, b2 being non empty strict quasi-discrete AltCatStr st the carrier of b1 = c1 & ( for b3 being object of b1 holds <^b3,b3^> = {(id b3)} ) & the carrier of b2 = c1 & ( for b3 being object of b2 holds <^b3,b3^> = {(id b3)} ) holds
b1 = b2
;
proof end;
end;

:: deftheorem Def22 defines DiscrCat ALTCAT_1:def 22 :
for b1 being non empty set
for b2 being non empty strict quasi-discrete AltCatStr holds
( b2 = DiscrCat b1 iff ( the carrier of b2 = b1 & ( for b3 being object of b2 holds <^b3,b3^> = {(id b3)} ) ) );

registration
cluster quasi-discrete -> transitive AltCatStr ;
coherence
for b1 being AltCatStr st b1 is quasi-discrete holds
b1 is transitive
proof end;
end;

theorem Th28: :: ALTCAT_1:28
for b1 being non empty set
for b2, b3, b4 being object of (DiscrCat b1) st ( b2 <> b3 or b3 <> b4 ) holds
the Comp of (DiscrCat b1) . b2,b3,b4 = {}
proof end;

theorem Th29: :: ALTCAT_1:29
for b1 being non empty set
for b2 being object of (DiscrCat b1) holds the Comp of (DiscrCat b1) . b2,b2,b2 = (id b2),(id b2) :-> (id b2)
proof end;

registration
let c1 be non empty set ;
cluster DiscrCat a1 -> non empty transitive strict quasi-functional semi-functional pseudo-functional associative with_units quasi-discrete pseudo-discrete ;
coherence
( DiscrCat c1 is pseudo-functional & DiscrCat c1 is pseudo-discrete & DiscrCat c1 is with_units & DiscrCat c1 is associative )
proof end;
end;