Why definition of categorical product works for $C'=$(Int, Int, Bool) and $C=($Int, Bool$)$?
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
In milewski-ctfp
is said that one can convert pseudo-product C' = (Int, Int, Bool)
to product C = (Int, Bool)
using function m
that is uniquely determined as
m (x, _, b) = (x, b)
But there are two ways to define m
m (x, _, b) = (x, b)
m (_, x, b) = (x, b)
They are not equal, then m
is not unique, then (int, bool)
is not a product
Can you point where I'm wrong?
P.S. this is duplicate of issue https://github.com/hmemcpy/milewski-ctfp-pdf/issues/127
Update
image part 1
image part 2
category-theory
add a comment |Â
up vote
2
down vote
favorite
In milewski-ctfp
is said that one can convert pseudo-product C' = (Int, Int, Bool)
to product C = (Int, Bool)
using function m
that is uniquely determined as
m (x, _, b) = (x, b)
But there are two ways to define m
m (x, _, b) = (x, b)
m (_, x, b) = (x, b)
They are not equal, then m
is not unique, then (int, bool)
is not a product
Can you point where I'm wrong?
P.S. this is duplicate of issue https://github.com/hmemcpy/milewski-ctfp-pdf/issues/127
Update
image part 1
image part 2
category-theory
Welcome to MSE. For some basic information about writing mathematics at this site see, e.g., basic help on mathjax notation, mathjax tutorial and quick reference, main meta site math tutorial and equation editing how-to.
– José Carlos Santos
Jul 15 at 12:07
I don't think you are using standard terminology; your question would be better if you wrote it in the language category theorists usually use, or at least provide sufficient definition so that people can know what you mean by the words and operations you use.
– Hurkyl
Jul 15 at 12:27
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
In milewski-ctfp
is said that one can convert pseudo-product C' = (Int, Int, Bool)
to product C = (Int, Bool)
using function m
that is uniquely determined as
m (x, _, b) = (x, b)
But there are two ways to define m
m (x, _, b) = (x, b)
m (_, x, b) = (x, b)
They are not equal, then m
is not unique, then (int, bool)
is not a product
Can you point where I'm wrong?
P.S. this is duplicate of issue https://github.com/hmemcpy/milewski-ctfp-pdf/issues/127
Update
image part 1
image part 2
category-theory
In milewski-ctfp
is said that one can convert pseudo-product C' = (Int, Int, Bool)
to product C = (Int, Bool)
using function m
that is uniquely determined as
m (x, _, b) = (x, b)
But there are two ways to define m
m (x, _, b) = (x, b)
m (_, x, b) = (x, b)
They are not equal, then m
is not unique, then (int, bool)
is not a product
Can you point where I'm wrong?
P.S. this is duplicate of issue https://github.com/hmemcpy/milewski-ctfp-pdf/issues/127
Update
image part 1
image part 2
category-theory
edited Jul 15 at 14:07
asked Jul 15 at 11:56


sergey
133
133
Welcome to MSE. For some basic information about writing mathematics at this site see, e.g., basic help on mathjax notation, mathjax tutorial and quick reference, main meta site math tutorial and equation editing how-to.
– José Carlos Santos
Jul 15 at 12:07
I don't think you are using standard terminology; your question would be better if you wrote it in the language category theorists usually use, or at least provide sufficient definition so that people can know what you mean by the words and operations you use.
– Hurkyl
Jul 15 at 12:27
add a comment |Â
Welcome to MSE. For some basic information about writing mathematics at this site see, e.g., basic help on mathjax notation, mathjax tutorial and quick reference, main meta site math tutorial and equation editing how-to.
– José Carlos Santos
Jul 15 at 12:07
I don't think you are using standard terminology; your question would be better if you wrote it in the language category theorists usually use, or at least provide sufficient definition so that people can know what you mean by the words and operations you use.
– Hurkyl
Jul 15 at 12:27
Welcome to MSE. For some basic information about writing mathematics at this site see, e.g., basic help on mathjax notation, mathjax tutorial and quick reference, main meta site math tutorial and equation editing how-to.
– José Carlos Santos
Jul 15 at 12:07
Welcome to MSE. For some basic information about writing mathematics at this site see, e.g., basic help on mathjax notation, mathjax tutorial and quick reference, main meta site math tutorial and equation editing how-to.
– José Carlos Santos
Jul 15 at 12:07
I don't think you are using standard terminology; your question would be better if you wrote it in the language category theorists usually use, or at least provide sufficient definition so that people can know what you mean by the words and operations you use.
– Hurkyl
Jul 15 at 12:27
I don't think you are using standard terminology; your question would be better if you wrote it in the language category theorists usually use, or at least provide sufficient definition so that people can know what you mean by the words and operations you use.
– Hurkyl
Jul 15 at 12:27
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
2
down vote
accepted
(Int, Bool)
together with p :: (Int, Bool) -> Int
and q :: (Int, Bool) -> Bool
given by the two projections is indeed a product of Int
and Bool
.
Recall that a product of two objects a
and b
is given by an object c
together with two functions p :: c -> a
, q :: c -> b
such that for any other object c'
and functions p' :: c' -> a
, q' :: c' -> b
there is a unique function m :: c' -> c
such that p' = p . m
, q' = q . m
.
This last bit is important: there can be many functions m' :: c' -> c
, but only one of them shall satisfy both p' = p . m'
and q' = q . m'
.
Let c' = (Int, Int, Bool)
and p' :: (Int, Int, Bool) -> Int
, q' :: (Int, Int, Bool) -> Bool
with p' (x, _, _) = x
and q' (_, _, b) = b
.
If you define m :: c' -> c
by m (_, x, b) = (x, b)
, then you have that p' (x, y, b) = x
but p (m (x, y, b)) = p (y, b) = y
, and so p' = p . m
does not hold.
Therefore, it is true that there are two ways to define m :: c' -> c
– actually, there are even more! We could also have m (x, _, _) = (x, True)
, or m (_, _, b) = (0, b)
, ... but of all these functions there is only one that satisfies p' = p . m
, q' = q . m
. This is what makes (Int, Bool)
together with p :: (Int, Bool) -> Int
and q :: (Int, Bool) -> Bool
a product of Int
and Bool
.
I still don't understand, I added images to my question
– sergey
Jul 15 at 14:08
I think I understand now - though possible implementations of graphs are many, in each of them there only one possible implementation ofm
– sergey
Jul 15 at 14:14
You are saying thatm (_, x, b) = (x, b)
will not work withp' (x, y, b) = x
- of course it will not, but it will work withp' (x, y, b) = y
, this is second possible implementation of graph, and them are many, and each of them have uniquem
. But(Int, Int, Bool)
will not have uniquem
, that's why its not a product
– sergey
Jul 15 at 14:17
1
Yes. To be more precise, you shouldn't say "(Int, Int, Bool)
will not have a uniquem
". You should say "(Int, Int, Bool)
together withp' :: (Int, Int, Bool) -> Int
andq' :: (Int, Int, Bool) -> Bool
defined byp' (x, _, _) = x
andq' (_, _, b) = b
is not a product ofInt
andBool
because it's not true that for anyc''
together withp'' :: c'' -> Int
andq'' :: c'' -> Bool
there exists a uniquem :: c'' -> (Int, Int, Bool)
such thatp'' = p' . m
andq'' = q' . m
".
– Luca Bressan
Jul 15 at 15:05
add a comment |Â
up vote
1
down vote
If I interprete the notation correctly, we are given
$$beginalignpcolon text(Int, Int, Bool)&to textInt\(x,y,z)&mapsto x\
qcolon text(Int, Int, Bool)&to textBool\(x,y,b)&mapsto bendalign$$
and are looking for $mcolontext(Int, Int, Bool)totext(Int, Bool) $ such that $textfstcirc m=p$ and $textsndcirc m=q$.
If we want to compute $m(x,y,z)$, the result will certainly be of the form $(u,v)$ with $uintextInt$ and $vintextBool$. From $$u=textfst(u,v)=textfst(m(x,y,z))=(textfstcirc m)(x,y,z)=p(x,y,z)=x$$
$$v=textsnd(u,v)=textsnd(m(x,y,z))=(textsndcirc m)(x,y,z)=q(x,y,z)=z$$
we conclude that $m(x,y,z)=(u,v)=(x,z)$, as stated in the text.
Remark: It seems you instead skimmed over a different bug in the text:
For instance, there is a
Boolean-valued function (a predicate) defined for every type:
beginVerbatim
yes :: a -> Bool
yes _ = True
endVerbatim
But codeBool is not a terminal object. There is at least one more
codeBool-valued function from every type:
beginVerbatim
no :: a -> Bool
no _ = False
endVerbatim
The point is that for the second function is in general not different from the first function (and so not "one more"). For (exhaustive) example, if a
happens to be Void
, both yes
and no
are the same, absurd
.
Good point! Should be "every type, exceptVoid
".
– Bartosz Milewski
Jul 15 at 16:37
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
accepted
(Int, Bool)
together with p :: (Int, Bool) -> Int
and q :: (Int, Bool) -> Bool
given by the two projections is indeed a product of Int
and Bool
.
Recall that a product of two objects a
and b
is given by an object c
together with two functions p :: c -> a
, q :: c -> b
such that for any other object c'
and functions p' :: c' -> a
, q' :: c' -> b
there is a unique function m :: c' -> c
such that p' = p . m
, q' = q . m
.
This last bit is important: there can be many functions m' :: c' -> c
, but only one of them shall satisfy both p' = p . m'
and q' = q . m'
.
Let c' = (Int, Int, Bool)
and p' :: (Int, Int, Bool) -> Int
, q' :: (Int, Int, Bool) -> Bool
with p' (x, _, _) = x
and q' (_, _, b) = b
.
If you define m :: c' -> c
by m (_, x, b) = (x, b)
, then you have that p' (x, y, b) = x
but p (m (x, y, b)) = p (y, b) = y
, and so p' = p . m
does not hold.
Therefore, it is true that there are two ways to define m :: c' -> c
– actually, there are even more! We could also have m (x, _, _) = (x, True)
, or m (_, _, b) = (0, b)
, ... but of all these functions there is only one that satisfies p' = p . m
, q' = q . m
. This is what makes (Int, Bool)
together with p :: (Int, Bool) -> Int
and q :: (Int, Bool) -> Bool
a product of Int
and Bool
.
I still don't understand, I added images to my question
– sergey
Jul 15 at 14:08
I think I understand now - though possible implementations of graphs are many, in each of them there only one possible implementation ofm
– sergey
Jul 15 at 14:14
You are saying thatm (_, x, b) = (x, b)
will not work withp' (x, y, b) = x
- of course it will not, but it will work withp' (x, y, b) = y
, this is second possible implementation of graph, and them are many, and each of them have uniquem
. But(Int, Int, Bool)
will not have uniquem
, that's why its not a product
– sergey
Jul 15 at 14:17
1
Yes. To be more precise, you shouldn't say "(Int, Int, Bool)
will not have a uniquem
". You should say "(Int, Int, Bool)
together withp' :: (Int, Int, Bool) -> Int
andq' :: (Int, Int, Bool) -> Bool
defined byp' (x, _, _) = x
andq' (_, _, b) = b
is not a product ofInt
andBool
because it's not true that for anyc''
together withp'' :: c'' -> Int
andq'' :: c'' -> Bool
there exists a uniquem :: c'' -> (Int, Int, Bool)
such thatp'' = p' . m
andq'' = q' . m
".
– Luca Bressan
Jul 15 at 15:05
add a comment |Â
up vote
2
down vote
accepted
(Int, Bool)
together with p :: (Int, Bool) -> Int
and q :: (Int, Bool) -> Bool
given by the two projections is indeed a product of Int
and Bool
.
Recall that a product of two objects a
and b
is given by an object c
together with two functions p :: c -> a
, q :: c -> b
such that for any other object c'
and functions p' :: c' -> a
, q' :: c' -> b
there is a unique function m :: c' -> c
such that p' = p . m
, q' = q . m
.
This last bit is important: there can be many functions m' :: c' -> c
, but only one of them shall satisfy both p' = p . m'
and q' = q . m'
.
Let c' = (Int, Int, Bool)
and p' :: (Int, Int, Bool) -> Int
, q' :: (Int, Int, Bool) -> Bool
with p' (x, _, _) = x
and q' (_, _, b) = b
.
If you define m :: c' -> c
by m (_, x, b) = (x, b)
, then you have that p' (x, y, b) = x
but p (m (x, y, b)) = p (y, b) = y
, and so p' = p . m
does not hold.
Therefore, it is true that there are two ways to define m :: c' -> c
– actually, there are even more! We could also have m (x, _, _) = (x, True)
, or m (_, _, b) = (0, b)
, ... but of all these functions there is only one that satisfies p' = p . m
, q' = q . m
. This is what makes (Int, Bool)
together with p :: (Int, Bool) -> Int
and q :: (Int, Bool) -> Bool
a product of Int
and Bool
.
I still don't understand, I added images to my question
– sergey
Jul 15 at 14:08
I think I understand now - though possible implementations of graphs are many, in each of them there only one possible implementation ofm
– sergey
Jul 15 at 14:14
You are saying thatm (_, x, b) = (x, b)
will not work withp' (x, y, b) = x
- of course it will not, but it will work withp' (x, y, b) = y
, this is second possible implementation of graph, and them are many, and each of them have uniquem
. But(Int, Int, Bool)
will not have uniquem
, that's why its not a product
– sergey
Jul 15 at 14:17
1
Yes. To be more precise, you shouldn't say "(Int, Int, Bool)
will not have a uniquem
". You should say "(Int, Int, Bool)
together withp' :: (Int, Int, Bool) -> Int
andq' :: (Int, Int, Bool) -> Bool
defined byp' (x, _, _) = x
andq' (_, _, b) = b
is not a product ofInt
andBool
because it's not true that for anyc''
together withp'' :: c'' -> Int
andq'' :: c'' -> Bool
there exists a uniquem :: c'' -> (Int, Int, Bool)
such thatp'' = p' . m
andq'' = q' . m
".
– Luca Bressan
Jul 15 at 15:05
add a comment |Â
up vote
2
down vote
accepted
up vote
2
down vote
accepted
(Int, Bool)
together with p :: (Int, Bool) -> Int
and q :: (Int, Bool) -> Bool
given by the two projections is indeed a product of Int
and Bool
.
Recall that a product of two objects a
and b
is given by an object c
together with two functions p :: c -> a
, q :: c -> b
such that for any other object c'
and functions p' :: c' -> a
, q' :: c' -> b
there is a unique function m :: c' -> c
such that p' = p . m
, q' = q . m
.
This last bit is important: there can be many functions m' :: c' -> c
, but only one of them shall satisfy both p' = p . m'
and q' = q . m'
.
Let c' = (Int, Int, Bool)
and p' :: (Int, Int, Bool) -> Int
, q' :: (Int, Int, Bool) -> Bool
with p' (x, _, _) = x
and q' (_, _, b) = b
.
If you define m :: c' -> c
by m (_, x, b) = (x, b)
, then you have that p' (x, y, b) = x
but p (m (x, y, b)) = p (y, b) = y
, and so p' = p . m
does not hold.
Therefore, it is true that there are two ways to define m :: c' -> c
– actually, there are even more! We could also have m (x, _, _) = (x, True)
, or m (_, _, b) = (0, b)
, ... but of all these functions there is only one that satisfies p' = p . m
, q' = q . m
. This is what makes (Int, Bool)
together with p :: (Int, Bool) -> Int
and q :: (Int, Bool) -> Bool
a product of Int
and Bool
.
(Int, Bool)
together with p :: (Int, Bool) -> Int
and q :: (Int, Bool) -> Bool
given by the two projections is indeed a product of Int
and Bool
.
Recall that a product of two objects a
and b
is given by an object c
together with two functions p :: c -> a
, q :: c -> b
such that for any other object c'
and functions p' :: c' -> a
, q' :: c' -> b
there is a unique function m :: c' -> c
such that p' = p . m
, q' = q . m
.
This last bit is important: there can be many functions m' :: c' -> c
, but only one of them shall satisfy both p' = p . m'
and q' = q . m'
.
Let c' = (Int, Int, Bool)
and p' :: (Int, Int, Bool) -> Int
, q' :: (Int, Int, Bool) -> Bool
with p' (x, _, _) = x
and q' (_, _, b) = b
.
If you define m :: c' -> c
by m (_, x, b) = (x, b)
, then you have that p' (x, y, b) = x
but p (m (x, y, b)) = p (y, b) = y
, and so p' = p . m
does not hold.
Therefore, it is true that there are two ways to define m :: c' -> c
– actually, there are even more! We could also have m (x, _, _) = (x, True)
, or m (_, _, b) = (0, b)
, ... but of all these functions there is only one that satisfies p' = p . m
, q' = q . m
. This is what makes (Int, Bool)
together with p :: (Int, Bool) -> Int
and q :: (Int, Bool) -> Bool
a product of Int
and Bool
.
edited Jul 15 at 12:43
answered Jul 15 at 12:35
Luca Bressan
3,86621036
3,86621036
I still don't understand, I added images to my question
– sergey
Jul 15 at 14:08
I think I understand now - though possible implementations of graphs are many, in each of them there only one possible implementation ofm
– sergey
Jul 15 at 14:14
You are saying thatm (_, x, b) = (x, b)
will not work withp' (x, y, b) = x
- of course it will not, but it will work withp' (x, y, b) = y
, this is second possible implementation of graph, and them are many, and each of them have uniquem
. But(Int, Int, Bool)
will not have uniquem
, that's why its not a product
– sergey
Jul 15 at 14:17
1
Yes. To be more precise, you shouldn't say "(Int, Int, Bool)
will not have a uniquem
". You should say "(Int, Int, Bool)
together withp' :: (Int, Int, Bool) -> Int
andq' :: (Int, Int, Bool) -> Bool
defined byp' (x, _, _) = x
andq' (_, _, b) = b
is not a product ofInt
andBool
because it's not true that for anyc''
together withp'' :: c'' -> Int
andq'' :: c'' -> Bool
there exists a uniquem :: c'' -> (Int, Int, Bool)
such thatp'' = p' . m
andq'' = q' . m
".
– Luca Bressan
Jul 15 at 15:05
add a comment |Â
I still don't understand, I added images to my question
– sergey
Jul 15 at 14:08
I think I understand now - though possible implementations of graphs are many, in each of them there only one possible implementation ofm
– sergey
Jul 15 at 14:14
You are saying thatm (_, x, b) = (x, b)
will not work withp' (x, y, b) = x
- of course it will not, but it will work withp' (x, y, b) = y
, this is second possible implementation of graph, and them are many, and each of them have uniquem
. But(Int, Int, Bool)
will not have uniquem
, that's why its not a product
– sergey
Jul 15 at 14:17
1
Yes. To be more precise, you shouldn't say "(Int, Int, Bool)
will not have a uniquem
". You should say "(Int, Int, Bool)
together withp' :: (Int, Int, Bool) -> Int
andq' :: (Int, Int, Bool) -> Bool
defined byp' (x, _, _) = x
andq' (_, _, b) = b
is not a product ofInt
andBool
because it's not true that for anyc''
together withp'' :: c'' -> Int
andq'' :: c'' -> Bool
there exists a uniquem :: c'' -> (Int, Int, Bool)
such thatp'' = p' . m
andq'' = q' . m
".
– Luca Bressan
Jul 15 at 15:05
I still don't understand, I added images to my question
– sergey
Jul 15 at 14:08
I still don't understand, I added images to my question
– sergey
Jul 15 at 14:08
I think I understand now - though possible implementations of graphs are many, in each of them there only one possible implementation of
m
– sergey
Jul 15 at 14:14
I think I understand now - though possible implementations of graphs are many, in each of them there only one possible implementation of
m
– sergey
Jul 15 at 14:14
You are saying that
m (_, x, b) = (x, b)
will not work with p' (x, y, b) = x
- of course it will not, but it will work with p' (x, y, b) = y
, this is second possible implementation of graph, and them are many, and each of them have unique m
. But (Int, Int, Bool)
will not have unique m
, that's why its not a product– sergey
Jul 15 at 14:17
You are saying that
m (_, x, b) = (x, b)
will not work with p' (x, y, b) = x
- of course it will not, but it will work with p' (x, y, b) = y
, this is second possible implementation of graph, and them are many, and each of them have unique m
. But (Int, Int, Bool)
will not have unique m
, that's why its not a product– sergey
Jul 15 at 14:17
1
1
Yes. To be more precise, you shouldn't say "
(Int, Int, Bool)
will not have a unique m
". You should say "(Int, Int, Bool)
together with p' :: (Int, Int, Bool) -> Int
and q' :: (Int, Int, Bool) -> Bool
defined by p' (x, _, _) = x
and q' (_, _, b) = b
is not a product of Int
and Bool
because it's not true that for any c''
together with p'' :: c'' -> Int
and q'' :: c'' -> Bool
there exists a unique m :: c'' -> (Int, Int, Bool)
such that p'' = p' . m
and q'' = q' . m
".– Luca Bressan
Jul 15 at 15:05
Yes. To be more precise, you shouldn't say "
(Int, Int, Bool)
will not have a unique m
". You should say "(Int, Int, Bool)
together with p' :: (Int, Int, Bool) -> Int
and q' :: (Int, Int, Bool) -> Bool
defined by p' (x, _, _) = x
and q' (_, _, b) = b
is not a product of Int
and Bool
because it's not true that for any c''
together with p'' :: c'' -> Int
and q'' :: c'' -> Bool
there exists a unique m :: c'' -> (Int, Int, Bool)
such that p'' = p' . m
and q'' = q' . m
".– Luca Bressan
Jul 15 at 15:05
add a comment |Â
up vote
1
down vote
If I interprete the notation correctly, we are given
$$beginalignpcolon text(Int, Int, Bool)&to textInt\(x,y,z)&mapsto x\
qcolon text(Int, Int, Bool)&to textBool\(x,y,b)&mapsto bendalign$$
and are looking for $mcolontext(Int, Int, Bool)totext(Int, Bool) $ such that $textfstcirc m=p$ and $textsndcirc m=q$.
If we want to compute $m(x,y,z)$, the result will certainly be of the form $(u,v)$ with $uintextInt$ and $vintextBool$. From $$u=textfst(u,v)=textfst(m(x,y,z))=(textfstcirc m)(x,y,z)=p(x,y,z)=x$$
$$v=textsnd(u,v)=textsnd(m(x,y,z))=(textsndcirc m)(x,y,z)=q(x,y,z)=z$$
we conclude that $m(x,y,z)=(u,v)=(x,z)$, as stated in the text.
Remark: It seems you instead skimmed over a different bug in the text:
For instance, there is a
Boolean-valued function (a predicate) defined for every type:
beginVerbatim
yes :: a -> Bool
yes _ = True
endVerbatim
But codeBool is not a terminal object. There is at least one more
codeBool-valued function from every type:
beginVerbatim
no :: a -> Bool
no _ = False
endVerbatim
The point is that for the second function is in general not different from the first function (and so not "one more"). For (exhaustive) example, if a
happens to be Void
, both yes
and no
are the same, absurd
.
Good point! Should be "every type, exceptVoid
".
– Bartosz Milewski
Jul 15 at 16:37
add a comment |Â
up vote
1
down vote
If I interprete the notation correctly, we are given
$$beginalignpcolon text(Int, Int, Bool)&to textInt\(x,y,z)&mapsto x\
qcolon text(Int, Int, Bool)&to textBool\(x,y,b)&mapsto bendalign$$
and are looking for $mcolontext(Int, Int, Bool)totext(Int, Bool) $ such that $textfstcirc m=p$ and $textsndcirc m=q$.
If we want to compute $m(x,y,z)$, the result will certainly be of the form $(u,v)$ with $uintextInt$ and $vintextBool$. From $$u=textfst(u,v)=textfst(m(x,y,z))=(textfstcirc m)(x,y,z)=p(x,y,z)=x$$
$$v=textsnd(u,v)=textsnd(m(x,y,z))=(textsndcirc m)(x,y,z)=q(x,y,z)=z$$
we conclude that $m(x,y,z)=(u,v)=(x,z)$, as stated in the text.
Remark: It seems you instead skimmed over a different bug in the text:
For instance, there is a
Boolean-valued function (a predicate) defined for every type:
beginVerbatim
yes :: a -> Bool
yes _ = True
endVerbatim
But codeBool is not a terminal object. There is at least one more
codeBool-valued function from every type:
beginVerbatim
no :: a -> Bool
no _ = False
endVerbatim
The point is that for the second function is in general not different from the first function (and so not "one more"). For (exhaustive) example, if a
happens to be Void
, both yes
and no
are the same, absurd
.
Good point! Should be "every type, exceptVoid
".
– Bartosz Milewski
Jul 15 at 16:37
add a comment |Â
up vote
1
down vote
up vote
1
down vote
If I interprete the notation correctly, we are given
$$beginalignpcolon text(Int, Int, Bool)&to textInt\(x,y,z)&mapsto x\
qcolon text(Int, Int, Bool)&to textBool\(x,y,b)&mapsto bendalign$$
and are looking for $mcolontext(Int, Int, Bool)totext(Int, Bool) $ such that $textfstcirc m=p$ and $textsndcirc m=q$.
If we want to compute $m(x,y,z)$, the result will certainly be of the form $(u,v)$ with $uintextInt$ and $vintextBool$. From $$u=textfst(u,v)=textfst(m(x,y,z))=(textfstcirc m)(x,y,z)=p(x,y,z)=x$$
$$v=textsnd(u,v)=textsnd(m(x,y,z))=(textsndcirc m)(x,y,z)=q(x,y,z)=z$$
we conclude that $m(x,y,z)=(u,v)=(x,z)$, as stated in the text.
Remark: It seems you instead skimmed over a different bug in the text:
For instance, there is a
Boolean-valued function (a predicate) defined for every type:
beginVerbatim
yes :: a -> Bool
yes _ = True
endVerbatim
But codeBool is not a terminal object. There is at least one more
codeBool-valued function from every type:
beginVerbatim
no :: a -> Bool
no _ = False
endVerbatim
The point is that for the second function is in general not different from the first function (and so not "one more"). For (exhaustive) example, if a
happens to be Void
, both yes
and no
are the same, absurd
.
If I interprete the notation correctly, we are given
$$beginalignpcolon text(Int, Int, Bool)&to textInt\(x,y,z)&mapsto x\
qcolon text(Int, Int, Bool)&to textBool\(x,y,b)&mapsto bendalign$$
and are looking for $mcolontext(Int, Int, Bool)totext(Int, Bool) $ such that $textfstcirc m=p$ and $textsndcirc m=q$.
If we want to compute $m(x,y,z)$, the result will certainly be of the form $(u,v)$ with $uintextInt$ and $vintextBool$. From $$u=textfst(u,v)=textfst(m(x,y,z))=(textfstcirc m)(x,y,z)=p(x,y,z)=x$$
$$v=textsnd(u,v)=textsnd(m(x,y,z))=(textsndcirc m)(x,y,z)=q(x,y,z)=z$$
we conclude that $m(x,y,z)=(u,v)=(x,z)$, as stated in the text.
Remark: It seems you instead skimmed over a different bug in the text:
For instance, there is a
Boolean-valued function (a predicate) defined for every type:
beginVerbatim
yes :: a -> Bool
yes _ = True
endVerbatim
But codeBool is not a terminal object. There is at least one more
codeBool-valued function from every type:
beginVerbatim
no :: a -> Bool
no _ = False
endVerbatim
The point is that for the second function is in general not different from the first function (and so not "one more"). For (exhaustive) example, if a
happens to be Void
, both yes
and no
are the same, absurd
.
answered Jul 15 at 12:40


Hagen von Eitzen
265k20258477
265k20258477
Good point! Should be "every type, exceptVoid
".
– Bartosz Milewski
Jul 15 at 16:37
add a comment |Â
Good point! Should be "every type, exceptVoid
".
– Bartosz Milewski
Jul 15 at 16:37
Good point! Should be "every type, except
Void
".– Bartosz Milewski
Jul 15 at 16:37
Good point! Should be "every type, except
Void
".– Bartosz Milewski
Jul 15 at 16:37
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmath.stackexchange.com%2fquestions%2f2852451%2fwhy-definition-of-categorical-product-works-for-c-int-int-bool-and-c-i%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Welcome to MSE. For some basic information about writing mathematics at this site see, e.g., basic help on mathjax notation, mathjax tutorial and quick reference, main meta site math tutorial and equation editing how-to.
– José Carlos Santos
Jul 15 at 12:07
I don't think you are using standard terminology; your question would be better if you wrote it in the language category theorists usually use, or at least provide sufficient definition so that people can know what you mean by the words and operations you use.
– Hurkyl
Jul 15 at 12:27