# The sentence structure of mathematics

“Alice pushes Bob.”

“Cat drinks milk.”

“Com­ment hurts feel­ings.”

Th­ese are all differ­ent sen­tences that de­scribe wildly differ­ent things. Peo­ple are very differ­ent from cats, and cats are very differ­ent from com­ments. Bob, milk, and feel­ings don’t have much to do with each other. Push­ing, drink­ing, and (emo­tion­ally) hurt­ing are also re­ally differ­ent things.

But I bet these sen­tences all feel re­ally similar to you.

They should feel similar. They all have the same struc­ture. Speci­fi­cally, that struc­ture is

Be­cause these sen­tences all share the same fun­da­men­tal un­der­ly­ing struc­ture, they all feel quite similar even though they are very differ­ent on the sur­face. (The math­e­mat­i­cal term for “fun­da­men­tally the same but differ­ent on the sur­face” is iso­mor­phic.)

When you stud­ied sen­tence struc­ture back in gram­mar school (it wasn’t just me, right?) you learned to break down sen­tences into their parts of speech. You learn that nouns are per­sons, places, or things, and verbs are the ac­tivi­ties that nouns do. Ad­jec­tives de­scribe nouns, and ad­verbs de­scribe pretty much any­thing. Prepo­si­tions tell you where nouns go. Etc.

Parts of speech are re­ally ab­stract and re­ally gen­eral. When you look at the sur­face, the sentence

the ant crawls on the ground

and the sentence

the space­ship flies through space

could not pos­si­bly be more differ­ent. But when you look at the sen­tence struc­ture, they’re nearly iden­ti­cal.

The con­cept of “parts of speech” emerge when we no­tice cer­tain gen­eral pat­terns aris­ing in the way we speak. We no­tice that whether we’re talk­ing about ants or space­ships, we’re always talk­ing about things. And whether we’re talk­ing about crawl­ing or fly­ing, we’re always talk­ing about ac­tions.

And so on for ad­jec­tives, ad­verbs, con­junc­tions, etc., which always seem to re­late back to nouns and verbs—ad­jec­tives mod­ify nouns, for ex­am­ple.

Next we sim­ply give things and ac­tions, de­scrip­tors and re­la­tional terms some con­fus­ing names to make sure the pe­ons can’t catch on—nouns and verbs, ad­jec­tives and prepo­si­tions—and we have a way of break­ing down any English sen­tence into its fun­da­men­tal parts.

That is to say, if you know the ab­stract rules gov­ern­ing sen­tence struc­ture—the types of pieces and their con­nec­tions—you can come up with struc­tures that any English sen­tence is but a par­tic­u­lar ex­am­ple of.

Like how “Alice pushes Bob” is but a par­tic­u­lar ex­am­ple of “Noun verb noun.”

At the most ba­sic level, cat­e­gory the­ory breaks down math­e­mat­ics into its parts of speech. It turns out that math­e­mat­ics is pretty much just nouns and verbs at its sim­plest—just like how, if you read be­tween the lines a bit, any English sen­tence can be boiled down to its nouns and verbs. Those are the “main play­ers” which ev­ery­thing else just mod­ifies in some fash­ion.

In math­e­mat­ics, a noun is called an ob­ject.

A verb is called a mor­phism or ar­row. We’ll ex­plore the ter­minol­ogy of mor­phism a bit more next time. As to why they can also be called ar­rows, that’s be­cause verbs ap­pear to have di­rec­tions: One noun does the verb, and an­other noun (po­ten­tially the same noun, like pinch­ing your­self) re­ceives the verb. So you could draw that as an ar­row like so:

This is ex­actly how we di­a­gram ob­jects and mor­phisms in cat­e­gory the­ory, with one differ­ence: we typ­i­cally use sin­gle let­ters in place of full names. (I’d ex­plain the value of con­ci­sion here, but it seems hyp­o­crit­i­cal.) So if Alice and Bob are ob­jects in our cat­e­gory, and Alice’s push of Bob is the mor­phism, then we might write it this way:

Equally le­gi­t­i­mate is to high­light the mor­phism up front. (We’ll see they’re the real stars of the show):

So now you un­der­stand ob­jects and mor­phisms, the ba­sic pieces of any cat­e­gory, just like how nouns and verbs are the ba­sic pieces of any sen­tence.

Of course, mak­ing a sen­tence isn’t as sim­ple as mash­ing nouns and verbs to­gether. We need to make sure that the sen­tence makes sense. To para­phrase Har­ri­son Ford, you can write “col­or­less green ideas sleep fu­ri­ously”, but you sure can’t think it.

We’ll ex­plore the rules that define a cat­e­gory in the next post.

• I was ten­ta­tively ex­cited about this se­ries, but I have to be hon­est: I am dis­mayed by this post.

So now you un­der­stand ob­jects and morphisms

… I re­ally, re­ally don’t.

You are (un­less I’m grossly mi­s­un­der­stand­ing) analo­giz­ing cat­e­gory the­ory to gram­mar. Your anal­ogy starts with some ex­am­ples of sen­tences; then pro­vides an in­tu­itive, com­mon-sense ex­pla­na­tion of the com­mon parts of speech, in non-tech­ni­cal terms; and also pro­vides the tech­ni­cal terms. This is perfectly sen­si­ble, and is easy to fol­low.

Then, to make use of the anal­ogy, you in­tro­duce the math­e­mat­i­cal analogues… but this time, you don’t provide any ex­am­ples, nor any in­tu­itive gen­er­al­iza­tions of the ex­am­ples (be­cause there are none to gen­er­al­ize)… you sim­ply in­tro­duce the tech­ni­cal terms, as­sert that they analo­gize, and de­clare that un­der­stand­ing has been con­veyed. But that doesn’t work at all!

To elab­o­rate:

It turns out that math­e­mat­ics is pretty much just nouns and verbs at its sim­plest—just like how, if you read be­tween the lines a bit, any English sen­tence can be boiled down to its nouns and verbs.

What are some ex­am­ples of this? What are some things in math­e­mat­ics which are “nouns” and “verbs”? I don’t have any in­tu­ition for this (as I cer­tainly do for English sen­tences, which clearly deal with things, and ac­tions that peo­ple take, etc.).

In math­e­mat­ics, a noun is called an ob­ject.

So we’re talk­ing about… what, ex­actly? Num­bers? Digits? Vari­ables? Func­tions? Ex­pres­sions? Equa­tions? Oper­a­tors? Sym­bols? All of the above? None of the above? Some of the above?

A verb is called a mor­phism or ar­row.

Again… what are ex­am­ples of “mor­phisms” or “ar­rows”? Like, ac­tual ex­am­ples, not “ex­am­ples” by anal­ogy to English sen­tences?

p:AB

Ditto. If this is the gen­er­al­iza­tion, what are some spe­cific ex­am­ples?

I very much hope that you can ad­dress these trou­bles… oth­er­wise, if I can’t un­der­stand even the very ba­sic first con­cepts, there doesn’t seem to be much hope of un­der­stand­ing any­thing else!

• Thank you very much for your re­ac­tion to this post. As it hap­pens, I find my­self in agree­ment with you. I leaned too hard in the di­rec­tion of avoid­ing any dis­cus­sion of math­e­mat­ics. The next post is already writ­ten to clar­ify that sen­tences are all about nouns and verbs be­cause we use sen­tences to model re­al­ity, and re­al­ity seems to con­sist of nouns and verbs. (Cats, drink­ing, milk, etc., are all part of re­al­ity. Even ad­jec­tives like “blue” are bro­ken down by our physics into nouns and verbs.) We use var­i­ous spe­cific kinds of math­e­mat­ics to model var­i­ous spe­cific parts of re­al­ity, and so var­i­ous spe­cific kinds of math­e­mat­ics them­selves boil down to nouns and verbs. So when you do a “math­e­mat­ics of math” it ends up be­ing a math­e­mat­ics that is analo­gous to a math­e­mat­ics of nouns and verbs, which get called ob­jects and mor­phisms re­spec­tively. (We prob­a­bly can’t carry this anal­ogy for­ever—I don’t know that there’s a real-world lan­guage anal­ogy to n-cat­e­gories. But that won’t come up any­way.) I’ll very much look for­ward to your re­ac­tion to the next post, which mo­ti­vates cat­e­gory the­ory as a gen­eral de­scrip­tion of how you’d want to model pretty much any­thing in a uni­verse of cause-and-effect, which cor­re­spond­ingly gen­er­al­izes, al­most as a byproduct, the math­e­mat­ics any hu­man is likely to in­vent.

There are many op­tions for be­ing clearer about ob­jects and mor­phisms in this post, and I will con­sider them...I will also take pains to en­sure it is not nec­es­sary to re­con­sider fu­ture posts for this par­tic­u­lar mis­take, thanks to you.

• Delighted that some­one is wants to give a de­tailed ex­pla­na­tion of this area. I tried to read the start of the in­tro­duc­tion for pro­gram­mers and it wasn’t as self-ev­i­dent that I would have thought.

I would have bro­ken up the parts of speech as sub­ject pred­i­cate ob­ject, s p o, which pro­duces a pat­tern like a b c while the post wants to in­tro­duce a pat­tern like a b a. The verb also gets in­flected in the ex­am­ples. A starkly literal ap­pli­ca­tion of noun verb noun pat­tern would spell “cat drink milk” rather than “cat drinks milk”. It is also am­bi­gious whether it should carry over that the As are drawn form the same kind of en­tities (Alice and Bob are per­sons)

There is also the differ­ence of a verb as it re­lates to place ina sen­tence and verb as de­scrip­bing an ac­tion. For ex­am­ple I do not think that ad­di­tion is a verb but more of a re­la­tion. Part of the shak­i­ness and in­se­cu­rity on tak­ing on odd con­cept ar­eas can be the un­defined­ness of the ba­sic con­cepts. To that effect I think the post seems me to think that I have a un­der­stand­ing of “ob­jects” and “mor­phisms” but it re­ally just says “trans­late these as nouns and verbs”. Okay it is some­thing I can hangs con­cep­tual stuff on but refer­ring to es­tablihed con­cepts el­se­where seems like a lot of un­wanted bag­gage might be im­ported in the same go.

If this is part of fu­ture steps re­fer to there but I got my­self con­fused over what is the same or differ­ent be­tween pro­gram­ming func­tions, math­e­mat­i­cal func­tions and mor­phisms. How it re­lates to this post based on read­ing this if I have p: A → B and q: A → B these seem to define two sep­a­rate mor­phisms. I get that if I have p:A->B and p:A->C there is a nam­ing con­flict and the sec­ond p is necce­sar­ily differ­ent. But on lan­guage level it would seem that “Alice punches Bob” and “Alice hugs Bob” are two sep­a­rate en­tities.

I have pre­vi­ous bag­gage since the differ­ence be­tween a pro­gram­ming func­tion and a math­e­mat­i­cal func­tion gives me a the­o­reth­i­cal headache. In par­tic­u­lar I can imag­ine two pro­gram­ming func­tions that have the same in­put and out­put be­havi­our but work differ­ently and are thus clearly sep­a­rate. Yet math­e­mat­i­cal func­tions are iden­ti­fied by their in­put/​out­put be­havi­our. (then there is the prob­lem that some of the ex­ten­sions are in fact drawn from in­ten­sions which makes one won­der whether the ex­ten­sion defi­ni­tions are just a front for the real thought pro­cesses. If you have a thing like “f(x)=x+x^2” it seems to be a differ­ent kind of en­tity than a in­finite list­ing of value pairs) Then there is the thing that pro­gram­ming func­tions are ge­ni­unely verb in that you can ex­e­cute func­tions and it cor­re­sponds to phys­i­cal events hap­pen­ing on a com­puter. How­ever there is no “time pro­gres­sion” for math­e­mat­i­cal func­tions. The ana­log for mor­phisms to verbs seems to me that they also have time pro­gres­sion but it seems to be some­what in con­flict with the other source.

• You have thought about the lan­guage anal­ogy much harder than I did. I will think about how to avoid this is­sue bet­ter in the fu­ture, so thank you. In any case, don’t stress it too much—all that this post seeks to es­tab­lish is that cat­e­gory the­ory is a math­e­mat­ics of “stuff tak­ing ac­tion on stuff”—more­over, it does so in a log­i­cal, in­tu­itive way that you are already fa­mil­iar with, even if you don’t know higher maths. Judg­ing by Said’s com­ment, I also should have clar­ified that spe­cific branches of math­e­mat­ics fill in par­tic­u­lar things for “stuff” and “tak­ing ac­tion.” E.g., you get set the­ory when you fill in “sets” for stuff and “func­tions” for tak­ing ac­tion.

• It might get weird for me as part of the past prgoress for me is how func­tions are ac­tu­ally ob­jects ie non-verblike. You can ex­am­ple code a func­tion into or­dered pairs which can be rep­re­sented as a set. You are mean­ing more in the sense that a func­tion by it­self is miss­ing some­thing has a “hole” in it? For ex­am­ple “It rains” can seem like a lan­guage con­struc­tion where “rain” ap­pears with­out holes (and in my na­tive lan­guage you ex­press that kind of thought with­out any for­mal sub­ject, “rains” is a pert­fectly fine sen­tence that de­scripbes a com­mon wheather con­di­tion/​ac­tivity.).

• The bag­gage that comes with the words noun and verb is only for guid­ing the search for in­tu­ition and is to be dis­carded when it leads to con­fu­sion.

In all your in­ter­pre­ta­tions of math/​pro­gram­ming func­tions, there can be differ­ent ar­rows be­tween the same ob­jects. The in­put/​out­put be­hav­ior is seen as part of the ar­row. The ob­jects are merely there to es­tab­lish what kinds of ar­rows can be strung to­gether be­cause one pro­duces, say, real num­bers, and the other con­sumes them.

• Well if I have a map­ping (func­tion, mor­phism?) that has some “rows” of

1 to 5 A to 3 B to cat cow to france

it doesn’t seem that de­scrip­tive to say that this is a “B->5” map­ping. Now usu­ally pro­gram­ming func­tions are sen­si­ble in the sense that the in­puts and out­puts are of similar types. But if I am start and form the con­cept of mor­phism from the ground up how do I know whether such “mixed” types are al­lowed or not? Or rather given that I do not know of types how I get map­ping over mul­ti­ple in­puts?

• If your map­ping con­tains those three pairs, then the ar­row’s source ob­ject con­tains 1, A, B and cow, and the tar­get ob­ject con­tains 5, 3, cat and france. Allow­ing or dis­al­low­ing mixed types gives two differ­ent cat­e­gories. Whether an ar­row mixes types is as far as I can tell you to mean uniquely de­ter­mined by whether its source or tar­get ob­ject mix types. In ei­ther case, to com­pose two ar­rows they must have a com­mon mid­dle ob­ject.

• I don’t know whether it is a rele­vant fear but just I am un­sure how much the other de­tails other than type com­pat­i­bil­ity are pre­served.

Say you have a map­ping O: A->1, B->3 and a map­ping P: 4-> france, 5->england. You could then go that O is let­ters to num­bers and P is num­bers to coun­tries so you go that map­ping from let­ters to coun­tries should ex­ist but if you start at A or B you don’t end up at any coun­try. Or is the case that {1,3} is a differ­ent cat­e­gory than {4,5} rather than let­ters be­ing equal to let­ters?

• is a differ­ent category

You mean ob­ject.

Every cat­e­gory con­tain­ing O and P must ad­dress this ques­tion. In the usual cat­e­gory of math func­tions, if P has only those two pairs then the source ob­ject of P is ex­actly {4,5}, so O and P can’t be com­posed. In the cat­e­gory of re­la­tions, that is ar­bi­trary sets of pairs be­tween the source and tar­get sets, O and P would com­pose to the empty re­la­tion be­tween let­ters and coun­tries.

• I would sus­pect there are rules how it works that way but now it is not in­tu­itive for me why that would be the re­sult. Why it would not pro­duce the empty func­tion? And if you have a empty re­la­tion isn’t it a re­la­tion of any type to any type at the same time? Would it or why it would not be an empty re­la­tion be­tween let­ter-shapes and coun­try-dances? But ap­par­ently you can have differ­ent kinds of empty mor­phisms based on what their source and tar­get ob­jects are.

I didn’t also re­al­ise that com­pos­ing is rel­a­tive to how you view the ob­jects.

• Cat­e­gories are what we call it when each ar­row re­mem­bers its source and tar­get. When they don’t, and you can com­pose any­thing, it’s called a monoid. The differ­ence is the same as be­tween static and dy­namic type sys­tems. The more pow­er­ful your sys­tem is, the less you can prove about it, so when­ever we can, we ex­press that par­tic­u­lar ar­rows can’t be com­posed, us­ing defi­ni­tions of source and tar­get.

• A verb is called a mor­phism or ar­row.

There are some pretty big differ­ences. A verb typ­i­cally defines an ac­tion that takes place at a time, so that Bob was not pushed by Alice un­til time T when he was. Mor­phisms are more like static re­la­tion­ships, which would typ­i­cally ex­pressed by the cop­ula .. “is the father of” and so on.

• Does cat­e­gory the­ory have mean­ing com­po­nent?