A Little Logic

Logic is the study of correct reasoning. Among other things, it enables us to prove, deduce, and solve puzzles.

This chapter is about Logic because Eberbanā€™s jargon is based on Logic jargon.

Naturally, this chapter is really jargon-heavy, so itā€™s alright if it takes a while to understand it all. The jargon blocks below are the only bits relevant to Eberban; the rest is just extra for experts šŸ™‚

Propositional Logic

šŸŖ¶ Jargon: Propositions

In logic, a proposition is a statement that is true or false.

Propositions appear in everyday speech all the time.

Everyday propositions v1:

  • Itā€™s raining.
  • I walk to work.
  • Itā€™s open on Sundays too.
  • Sheā€™s been to Uluru.
  • This is the top floor.

These propositions are atomic because they cannot be broken down any further. We can make propositions more complex with connectives.

Everyday propositions v2:

ConnectiveNameExampleTranslation
āˆ§\landConjunctionItā€™sĀ raining.āˆ§IĀ forgotĀ myĀ umbrella.\text{It's raining.} \\ \land \\ \text{I forgot my umbrella.}Itā€™s raining and I forgot my umbrella.
āˆØ\lorDisjunctionIĀ walkĀ toĀ work.āˆØIĀ catchĀ theĀ trainĀ toĀ work.\text{I walk to work.} \\ \lor \\ \text{I catch the train to work.}I walk or catch the train to work.
Ā¬\lnotNegationĀ¬(Itā€™sĀ openĀ onĀ SundaysĀ too.)\lnot(\text{It's open on Sundays too.})Itā€™s not open on Sundays either.
ā€…ā€ŠāŸ¹ā€…ā€Š\impliesMaterial ImplicationSheā€™sĀ beenĀ toĀ Uluru.ā€…ā€ŠāŸ¹ā€…ā€ŠSheā€™sĀ beenĀ toĀ Australia.\text{She's been to Uluru.} \\ \implies \\ \text{She's been to Australia.}If sheā€™s been to Uluru, then sheā€™s been to Australia.
ā€…ā€ŠāŸŗā€…ā€Š\iffBiconditionalThisĀ isĀ theĀ topĀ floor.ā€…ā€ŠāŸŗā€…ā€ŠThereā€™sĀ noĀ floorĀ aboveĀ it.\text{This is the top floor.} \\ \iff \\ \text{There's no floor above it.}This is the top floor if and only if thereā€™s no floor above it.

Now that we know of these connections, we can reason. Reasoning also happens all the time in everyday speech. Take a look:

āœļø Examples:

ā€œHas she been to Australia?ā€
ā€œYeah, sheā€™s been to Uluru.ā€

Finally, no more stairs! Looks like Iā€™ve made it to the top floor.

You can connect as many propositions as youā€™d like and still have a proposition. For example:

(TheĀ skyĀ isĀ clear.āˆ§((Itā€™sĀ night.āˆ§Ā¬(Itā€™sĀ tooĀ cold.))āˆØItā€™sĀ theĀ goldenĀ hour.))ā†’TheĀ oldĀ manĀ goesĀ forĀ aĀ walk.(\\ \quad \text{The sky is clear.} \\ \quad āˆ§ \\ \quad ( \\ \qquad (\text{It's night.} āˆ§ Ā¬(\text{It's too cold.})) \\ \qquad āˆØ \\ \qquad \text{It's the golden hour.} \\ \quad ) \\ ) \\ ā†’ \\ \text{The old man goes for a walk.}

This is so wordy that weā€™ve spread this across several lines! Letā€™s instead denote each constituent proposition as a variable and see what it looks like.

šŸŖ¶ Jargon: Variables

A variable is anything that can vary in value. You can use variables to represent absolutely anything.

By convention, uppercase variables denote propositions and predicates while lowercase variables denote entities (things that exist).

Given the constituent propositions (choice of letter is arbitrary):

  • S:Ā TheĀ skyĀ isĀ clear.S\text{: The sky is clear.}
  • N:Ā Itā€™sĀ night.N\text{: It's night.}
  • C:Ā Itā€™sĀ tooĀ cold.C\text{: It's too cold.}
  • G:Ā Itā€™sĀ theĀ goldenā€‰hour.G\text{: It's the } \href{https://en.wikipedia.org/wiki/Golden_hour_(photography)}{\text{golden\,hour}}\text{.}
  • W:Ā TheĀ oldĀ manĀ goesĀ forĀ aĀ walk.W\text{: The old man goes for a walk.}

We state the following:

(Sāˆ§((Nāˆ§Ā¬C)āˆØG))ā†’W(S \land ((N \land \lnot C) \lor G)) \to W

Now we can focus on the connectives and start looking at what we can conclude from this!

Predicate Logic

If you play around with propositions, you may start to notice their limitations. For example, itā€™s tedious to denote that the travellers Alice, Bob, and Carol have all been to Uluru:

  • A:Ā AliceĀ hasĀ beenĀ toĀ Uluru.A\text{: Alice has been to Uluru.}
  • B:Ā BobĀ hasĀ beenĀ toĀ Uluru.B\text{: Bob has been to Uluru.}
  • C:Ā CarolĀ hasĀ beenĀ toĀ Uluru.C\text{: Carol has been to Uluru.}
Aāˆ§Bāˆ§CA \land B \land C

This is because propositions arenā€™t related unless theyā€™re logically connected, so we have to write them all out and join them.

Thankfully we can better express this with a predicate. Letā€™s define one for travellers who have been to Uluru.

šŸŖ¶ Jargon: Predicates

A predicate is a proposition with associated variables (called arguments). Predicates are neither true nor false until all of their variables are substituted for values.

HAS_BEEN_TO_ULURU(t):tĀ hasĀ beenĀ toĀ Uluru.\text{HAS\_BEEN\_TO\_ULURU}(t): t \text{ has been to Uluru.}

tt is lowercase as it is an entity. So are alicealice, bobbob, and carol.carol. Shortening this predicate to U(t)U(t), we substitute tt for our travellers:

U(alice)āˆ§U(bob)āˆ§U(carol)U(alice) \land U(bob) \land U(carol)

If we want to talk about more than one entity without using a connective, then we have to quantify. Hereā€™s how you talk about all the travellers:

Domain of discourse: {Alice, Bob, Carol}

āˆ€tĀ U(t)\forall t \ U(t)For all t, where t is all of Alice, Bob, Carol; t has been to Uluru.
Simply put: all of Alice, Bob, Carol, have been to Uluru.

The domain of discourse is the set of all possible values that tt can range over. So, whenever we quantify, we need the domain of discourse.

šŸŖ¶ Jargon: Sets

A set is an unordered collection of distinct things. These things can be entities, predicates, or anything else.

Sets are denoted with curly braces {}.

Instead of using āˆ€ (the universal quantifier) to denote all travellers, we can use āˆƒ (the existential quantifier) to speak about just one.

Domain of discourse: {Alice, Bob, Carol}

āˆƒtĀ U(t)\exists t \ U(t)For some t, where t is all of Alice, Bob, Carol; t has been to Uluru.
Simply put: at least one of Alice, Bob, Carol has been to Uluru.

Now that weā€™ve covered quantification and variables, letā€™s derive predicates from our everyday propositions v2.

Everyday propositions v3:

Domain of discourse: All people

āˆƒpĀ RAININGāˆ§FORGOT_THEIR_UMBRELLA(p)\exists p \ \text{RAINING} \land \text{FORGOT\_THEIR\_UMBRELLA}(p)

Domain of discourse: All people

āˆƒpĀ WALKS_TO_WORK(p)āˆØTRAINS_TO_WORK(p)\exists p \ \text{WALKS\_TO\_WORK}(p) \lor \text{TRAINS\_TO\_WORK}(p)

Domains of discourse: d: Days, s: Stores

āˆƒdĀ Ā¬IS_SUNDAY(d),Ā āˆƒsĀ IS_OPEN(s)āˆ§Ā¬(IS_TODAY(d)āˆØIS_TODAY(sunday))\exists d \ \lnot \text{IS\_SUNDAY}(d), \ \exists s \ \text{IS\_OPEN}(s) \land \lnot(\text{IS\_TODAY}(d) \lor \text{IS\_TODAY}(sunday))

Domain of discourse: All travellers

āˆƒtĀ U(t)ā€…ā€ŠāŸ¹ā€…ā€ŠHAS_BEEN_TO_AUSTRALIA(t)\exists t \ U(t) \implies \text{HAS\_BEEN\_TO\_AUSTRALIA}(t)

Domain of discourse: Floors

āˆƒf,tĀ IS_TOP_FLOOR(t)ā€…ā€ŠāŸŗā€…ā€ŠĀ¬IS_ABOVE(f,t)\exists f,t \ \text{IS\_TOP\_FLOOR}(t) \iff \lnot \text{IS\_ABOVE}(f,t)

Look how expressive predicates are!

Notice how a predicate can have any number of arguments. This number is called arity.

šŸŖ¶ Jargon: Arity

Arity refers to the number of arguments a predicate has.

A 0-ary predicate is a proposition. Propositions have no variables, e.g. RAINING\text{RAINING}.

A unary predicate takes one argument and is also called a property. Properties describe entities, like IS_TALL(p)\text{IS\_TALL}(p) or IS_TOP_FLOOR(t)\text{IS\_TOP\_FLOOR}(t).

A binary predicate takes two arguments and is also called a relation. We relate two entities to each other like IS_MOTHER_OF(x,y)\text{IS\_MOTHER\_OF}(x,y) or IS_ABOVE(f,t)\text{IS\_ABOVE}(f,t).

A ternary predicate takes three arguments, and an n-ary, n-arguments.

Higher-order Logic

If predicates of Predicate Logic are tools to talk about the world more specifically, then these tools are limited. So far, weā€™ve only been using entities as variables.

With Higher-order Logic, we can use predicates as variables. Through this, we can give ourselves more tools.

By design, Eberban translates into higher-order logic and uses this idea of making more tools to increase vocabulary and grammatical function.

Letā€™s try to make more tools for ourselves: Letā€™s take one of our everyday propositions and make it higher order.

For reference, here is one of our everyday propositions v3.

Domains of discourse: d: Days, s: Stores

āˆƒdĀ Ā¬IS_SUNDAY(d),Ā āˆƒsĀ IS_OPEN(s)āˆ§Ā¬(IS_TODAY(d)āˆØIS_TODAY(sunday))\exists d \ \lnot \text{IS\_SUNDAY}(d), \ \exists s \ \text{IS\_OPEN}(s) \land \lnot(\text{IS\_TODAY}(d) \lor \text{IS\_TODAY}(sunday))

Now here is the higher-order version, using the same domain.

NEITHER_WHEN(P,X,Y):Pāˆ§Ā¬(XāˆØY)\text{NEITHER\_WHEN}(P,X,Y): P \land \lnot(X \lor Y) NEITHER_OPEN_ON(s,x,y):NEITHER_WHEN(IS_OPEN(s),IS_TODAY(x),IS_TODAY(y)))\text{NEITHER\_OPEN\_ON}(s,x,y): \text{NEITHER\_WHEN}(\text{IS\_OPEN}(s), \allowbreak \text{IS\_TODAY}(x), \text{IS\_TODAY}(y))) āˆƒdĀ Ā¬IS_SUNDAY(d),āˆƒsĀ NEITHER_OPEN_ON(s,d,sunday)\exists d \ \lnot \text{IS\_SUNDAY}(d), \exists s \ \allowbreak \text{NEITHER\_OPEN\_ON}(s,d,sunday)

The NEITHER_WHEN\text{NEITHER\_WHEN} predicate is generic and can be used whenever you find yourself using the word neither (or words not either).