reconsider X = {0,1} as set ;
set comp = {[[0,0],0],[[0,1],1]};
A1: for x, y1, y2 being object st [x,y1] in {[[0,0],0],[[0,1],1]} & [x,y2] in {[[0,0],0],[[0,1],1]} holds
y1 = y2
proof
let x, y1, y2 be object ; :: thesis: ( [x,y1] in {[[0,0],0],[[0,1],1]} & [x,y2] in {[[0,0],0],[[0,1],1]} implies y1 = y2 )
assume A2: [x,y1] in {[[0,0],0],[[0,1],1]} ; :: thesis: ( not [x,y2] in {[[0,0],0],[[0,1],1]} or y1 = y2 )
assume A3: [x,y2] in {[[0,0],0],[[0,1],1]} ; :: thesis: y1 = y2
per cases ( [x,y1] = [[0,0],0] or [x,y1] = [[0,1],1] ) by A2, TARSKI:def 2;
suppose A4: [x,y1] = [[0,0],0] ; :: thesis: y1 = y2
then A5: ( x = [0,0] & y1 = 0 ) by XTUPLE_0:1;
per cases ( [x,y2] = [[0,0],0] or [x,y2] = [[0,1],1] ) by A3, TARSKI:def 2;
suppose [x,y2] = [[0,0],0] ; :: thesis: y1 = y2
hence y1 = y2 by A4, XTUPLE_0:1; :: thesis: verum
end;
suppose [x,y2] = [[0,1],1] ; :: thesis: y1 = y2
then ( x = [0,1] & y2 = 1 ) by XTUPLE_0:1;
hence y1 = y2 by A5, XTUPLE_0:1; :: thesis: verum
end;
end;
end;
suppose A6: [x,y1] = [[0,1],1] ; :: thesis: y1 = y2
then A7: ( x = [0,1] & y1 = 1 ) by XTUPLE_0:1;
per cases ( [x,y2] = [[0,0],0] or [x,y2] = [[0,1],1] ) by A3, TARSKI:def 2;
suppose [x,y2] = [[0,0],0] ; :: thesis: y1 = y2
then ( x = [0,0] & y2 = 0 ) by XTUPLE_0:1;
hence y1 = y2 by A7, XTUPLE_0:1; :: thesis: verum
end;
suppose [x,y2] = [[0,1],1] ; :: thesis: y1 = y2
hence y1 = y2 by A6, XTUPLE_0:1; :: thesis: verum
end;
end;
end;
end;
end;
for x being object st x in {[[0,0],0],[[0,1],1]} holds
x in [:[:X,X:],X:]
proof end;
then reconsider comp = {[[0,0],0],[[0,1],1]} as PartFunc of [:X,X:],X by A1, TARSKI:def 3, FUNCT_1:def 1;
set C = CategoryStr(# X,comp #);
A13: for f1, f2 being morphism of CategoryStr(# X,comp #) holds
( not f1 |> f2 or ( f1 = 0 & f2 = 0 & f1 (*) f2 = 0 ) or ( f1 = 0 & f2 = 1 & f1 (*) f2 = 1 ) )
proof
let f1, f2 be morphism of CategoryStr(# X,comp #); :: thesis: ( not f1 |> f2 or ( f1 = 0 & f2 = 0 & f1 (*) f2 = 0 ) or ( f1 = 0 & f2 = 1 & f1 (*) f2 = 1 ) )
assume A14: f1 |> f2 ; :: thesis: ( ( f1 = 0 & f2 = 0 & f1 (*) f2 = 0 ) or ( f1 = 0 & f2 = 1 & f1 (*) f2 = 1 ) )
assume A15: ( not f1 = 0 or not f2 = 0 or not f1 (*) f2 = 0 ) ; :: thesis: ( f1 = 0 & f2 = 1 & f1 (*) f2 = 1 )
consider y being object such that
A16: [[f1,f2],y] in the composition of CategoryStr(# X,comp #) by A14, XTUPLE_0:def 12;
A17: f1 (*) f2 = the composition of CategoryStr(# X,comp #) . (f1,f2) by Def3, A14
.= the composition of CategoryStr(# X,comp #) . [f1,f2] by BINOP_1:def 1
.= y by A16, FUNCT_1:1 ;
per cases ( [[f1,f2],y] = [[0,0],0] or [[f1,f2],y] = [[0,1],1] ) by A16, TARSKI:def 2;
suppose [[f1,f2],y] = [[0,0],0] ; :: thesis: ( f1 = 0 & f2 = 1 & f1 (*) f2 = 1 )
then ( [f1,f2] = [0,0] & y = 0 ) by XTUPLE_0:1;
hence ( f1 = 0 & f2 = 1 & f1 (*) f2 = 1 ) by A17, A15, XTUPLE_0:1; :: thesis: verum
end;
suppose [[f1,f2],y] = [[0,1],1] ; :: thesis: ( f1 = 0 & f2 = 1 & f1 (*) f2 = 1 )
then ( [f1,f2] = [0,1] & y = 1 ) by XTUPLE_0:1;
hence ( f1 = 0 & f2 = 1 & f1 (*) f2 = 1 ) by A17, XTUPLE_0:1; :: thesis: verum
end;
end;
end;
A18: for f1, f2 being morphism of CategoryStr(# X,comp #) st f1 |> f2 holds
( f1 = 0 & ( f2 = 0 or f2 = 1 ) )
proof
let f1, f2 be morphism of CategoryStr(# X,comp #); :: thesis: ( f1 |> f2 implies ( f1 = 0 & ( f2 = 0 or f2 = 1 ) ) )
assume f1 |> f2 ; :: thesis: ( f1 = 0 & ( f2 = 0 or f2 = 1 ) )
then consider y being object such that
A19: [[f1,f2],y] in the composition of CategoryStr(# X,comp #) by XTUPLE_0:def 12;
per cases ( [[f1,f2],y] = [[0,0],0] or [[f1,f2],y] = [[0,1],1] ) by A19, TARSKI:def 2;
suppose [[f1,f2],y] = [[0,0],0] ; :: thesis: ( f1 = 0 & ( f2 = 0 or f2 = 1 ) )
then ( [f1,f2] = [0,0] & y = 0 ) by XTUPLE_0:1;
hence ( f1 = 0 & ( f2 = 0 or f2 = 1 ) ) by XTUPLE_0:1; :: thesis: verum
end;
suppose [[f1,f2],y] = [[0,1],1] ; :: thesis: ( f1 = 0 & ( f2 = 0 or f2 = 1 ) )
then ( [f1,f2] = [0,1] & y = 1 ) by XTUPLE_0:1;
hence ( f1 = 0 & ( f2 = 0 or f2 = 1 ) ) by XTUPLE_0:1; :: thesis: verum
end;
end;
end;
A20: for f1, f2 being morphism of CategoryStr(# X,comp #) st f1 = 0 holds
f1 |> f2
proof
let f1, f2 be morphism of CategoryStr(# X,comp #); :: thesis: ( f1 = 0 implies f1 |> f2 )
assume A21: f1 = 0 ; :: thesis: f1 |> f2
( f2 = 0 or f2 = 1 ) by TARSKI:def 2;
then [[f1,f2],f2] in the composition of CategoryStr(# X,comp #) by A21, TARSKI:def 2;
hence f1 |> f2 by FUNCT_1:1; :: thesis: verum
end;
for f, f1, f2 being morphism of CategoryStr(# X,comp #) st f1 |> f2 holds
( f1 (*) f2 |> f iff f2 |> f )
proof
let f, f1, f2 be morphism of CategoryStr(# X,comp #); :: thesis: ( f1 |> f2 implies ( f1 (*) f2 |> f iff f2 |> f ) )
assume A22: f1 |> f2 ; :: thesis: ( f1 (*) f2 |> f iff f2 |> f )
per cases ( ( f1 = 0 & f2 = 0 & f1 (*) f2 = 0 ) or ( f1 = 0 & f2 = 1 & f1 (*) f2 = 1 ) ) by A22, A13;
suppose ( f1 = 0 & f2 = 0 & f1 (*) f2 = 0 ) ; :: thesis: ( f1 (*) f2 |> f iff f2 |> f )
hence ( f1 (*) f2 |> f iff f2 |> f ) ; :: thesis: verum
end;
suppose ( f1 = 0 & f2 = 1 & f1 (*) f2 = 1 ) ; :: thesis: ( f1 (*) f2 |> f iff f2 |> f )
hence ( f1 (*) f2 |> f iff f2 |> f ) ; :: thesis: verum
end;
end;
end;
then A23: CategoryStr(# X,comp #) is left_composable ;
for f, f1, f2 being morphism of CategoryStr(# X,comp #) st f1 |> f2 holds
( f |> f1 (*) f2 iff f |> f1 )
proof
let f, f1, f2 be morphism of CategoryStr(# X,comp #); :: thesis: ( f1 |> f2 implies ( f |> f1 (*) f2 iff f |> f1 ) )
assume A24: f1 |> f2 ; :: thesis: ( f |> f1 (*) f2 iff f |> f1 )
per cases ( ( f1 = 0 & f2 = 0 & f1 (*) f2 = 0 ) or ( f1 = 0 & f2 = 1 & f1 (*) f2 = 1 ) ) by A24, A13;
suppose ( f1 = 0 & f2 = 0 & f1 (*) f2 = 0 ) ; :: thesis: ( f |> f1 (*) f2 iff f |> f1 )
hence ( f |> f1 (*) f2 iff f |> f1 ) ; :: thesis: verum
end;
suppose ( f1 = 0 & f2 = 1 & f1 (*) f2 = 1 ) ; :: thesis: ( f |> f1 (*) f2 iff f |> f1 )
hereby :: thesis: ( f |> f1 implies f |> f1 (*) f2 )
assume f |> f1 (*) f2 ; :: thesis: f |> f1
then f = 0 by A18;
hence f |> f1 by A20; :: thesis: verum
end;
assume f |> f1 ; :: thesis: f |> f1 (*) f2
then f = 0 by A18;
hence f |> f1 (*) f2 by A20; :: thesis: verum
end;
end;
end;
then A25: CategoryStr(# X,comp #) is composable by A23, Def9;
for f1 being morphism of CategoryStr(# X,comp #) st f1 in the carrier of CategoryStr(# X,comp #) holds
ex f being morphism of CategoryStr(# X,comp #) st
( f |> f1 & f is left_identity )
proof
let f1 be morphism of CategoryStr(# X,comp #); :: thesis: ( f1 in the carrier of CategoryStr(# X,comp #) implies ex f being morphism of CategoryStr(# X,comp #) st
( f |> f1 & f is left_identity ) )

assume f1 in the carrier of CategoryStr(# X,comp #) ; :: thesis: ex f being morphism of CategoryStr(# X,comp #) st
( f |> f1 & f is left_identity )

reconsider f = 0 as morphism of CategoryStr(# X,comp #) by TARSKI:def 2;
take f ; :: thesis: ( f |> f1 & f is left_identity )
thus f |> f1 by A20; :: thesis: f is left_identity
for f2 being morphism of CategoryStr(# X,comp #) st f |> f2 holds
f (*) f2 = f2
proof
let f2 be morphism of CategoryStr(# X,comp #); :: thesis: ( f |> f2 implies f (*) f2 = f2 )
assume A26: f |> f2 ; :: thesis: f (*) f2 = f2
( f2 = 0 or f2 = 1 ) by TARSKI:def 2;
hence f (*) f2 = f2 by A26, A13; :: thesis: verum
end;
hence f is left_identity ; :: thesis: verum
end;
then A27: CategoryStr(# X,comp #) is with_left_identities ;
ex f1 being morphism of CategoryStr(# X,comp #) st
( f1 in the carrier of CategoryStr(# X,comp #) & ( for f being morphism of CategoryStr(# X,comp #) st f1 |> f holds
not f is right_identity ) )
proof
reconsider f1 = 1 as morphism of CategoryStr(# X,comp #) by TARSKI:def 2;
take f1 ; :: thesis: ( f1 in the carrier of CategoryStr(# X,comp #) & ( for f being morphism of CategoryStr(# X,comp #) st f1 |> f holds
not f is right_identity ) )

thus f1 in the carrier of CategoryStr(# X,comp #) ; :: thesis: for f being morphism of CategoryStr(# X,comp #) st f1 |> f holds
not f is right_identity

let f be morphism of CategoryStr(# X,comp #); :: thesis: ( f1 |> f implies not f is right_identity )
assume f1 |> f ; :: thesis: not f is right_identity
hence not f is right_identity by A18; :: thesis: verum
end;
then A28: not CategoryStr(# X,comp #) is with_right_identities ;
for f1, f2, f3 being morphism of CategoryStr(# X,comp #) st f1 |> f2 & f2 |> f3 & f1 (*) f2 |> f3 & f1 |> f2 (*) f3 holds
f1 (*) (f2 (*) f3) = (f1 (*) f2) (*) f3
proof
let f1, f2, f3 be morphism of CategoryStr(# X,comp #); :: thesis: ( f1 |> f2 & f2 |> f3 & f1 (*) f2 |> f3 & f1 |> f2 (*) f3 implies f1 (*) (f2 (*) f3) = (f1 (*) f2) (*) f3 )
assume A29: ( f1 |> f2 & f2 |> f3 ) ; :: thesis: ( not f1 (*) f2 |> f3 or not f1 |> f2 (*) f3 or f1 (*) (f2 (*) f3) = (f1 (*) f2) (*) f3 )
assume A30: f1 (*) f2 |> f3 ; :: thesis: ( not f1 |> f2 (*) f3 or f1 (*) (f2 (*) f3) = (f1 (*) f2) (*) f3 )
assume A31: f1 |> f2 (*) f3 ; :: thesis: f1 (*) (f2 (*) f3) = (f1 (*) f2) (*) f3
per cases ( f3 = 0 or f3 = 1 ) by TARSKI:def 2;
suppose A32: f3 = 0 ; :: thesis: f1 (*) (f2 (*) f3) = (f1 (*) f2) (*) f3
then f2 (*) f3 = 0 by A29, A13;
hence f1 (*) (f2 (*) f3) = 0 by A31, A13
.= (f1 (*) f2) (*) f3 by A30, A32, A13 ;
:: thesis: verum
end;
suppose A33: f3 = 1 ; :: thesis: f1 (*) (f2 (*) f3) = (f1 (*) f2) (*) f3
then f2 (*) f3 = 1 by A29, A13;
hence f1 (*) (f2 (*) f3) = 1 by A31, A13
.= (f1 (*) f2) (*) f3 by A30, A33, A13 ;
:: thesis: verum
end;
end;
end;
hence ex b1 being CategoryStr st
( b1 is with_left_identities & not b1 is with_right_identities & b1 is composable & b1 is associative ) by A25, A27, A28, Def10; :: thesis: verum