Showing posts with label logic. Show all posts
Showing posts with label logic. Show all posts

10 July, 2023

Logical implication and causality

Judea Pearl, one of the prominent researchers in the logic of causality, argues that current-day mathematics and logic does not have mechanisms to represent causality. And this has caused great confusions in several instances. 

Let us consider how causality is represented in current day mathematics and logic. 

One of the most common situations where we interpret causality, is in a mathematical equation. An equation of the form 

y = f(x)

is often interpreted as the value of f(x) causes y to get a given value. This is the interpretation used in several programming languages for example. In a language like C or python, when we say: 

a = b

it means that the value of b causes the variable a to attain a given value. It is not the value of a that changes b, but the value of b that changes a. 

But mathematically, the sign "=" simply means equality. In mathematics, a = b is the same as saying b = a. 

This overloading of the "=" symbol causes complications in programming, when we have to distinguish between logical equality, and assignment. Programming languages hence, distinguish between the two kinds of operations. In languages like C or python, logical equality is represented as "==" that tells the program to check for equality, while the symbol "=" represents an imperative-- that tells the program to do something. 

Even here, there is no separate operator for checking causality. When we say "a == b" in a programming language, we are only asking the program to check whether the values of a and b are the same. We are not asking it to check whether a caused b or b caused a to take on a specific value. 

For instance, if 'a' were to represent the air pressure in a canister, and 'b' were to represent the reading of a barometer attached to the canister, then, whether we say "a == b" or "b == a", the outcome would still be the same. However, we can see that, if we manually change the air pressure to a different value, versus, if we manually change the barometer reading to a different value, the logical equality holds in the former case, but breaks in the latter case. This is because, this is not just an equality, but a causal relation between the two variables. The air pressure is causing the barometer reading, while the barometer reading is not causing the air pressure. 

~*~*~*~*~*

Another common operator that is commonly mistaken for causality is the logical implication operator in formal logic. A statement of the form 

P  --> Q

is read as, "if P is true, then, Q is true." 

A commonly used example is if P represents "it is raining" and Q represents "the lawn is wet". In this case, we can see that the logical implication is also interpreted as causality. The statement only says that "If it is true that it is raining, then it is true that the lawn is wet." But it is often interpreted as, "If it is raining, then it causes the lawn to be wet." 

There is this common example to illustrate correlations versus causality. It is often seen that increase in ice-cream sales is correlated with increase in drowning incidents. But of course, it is not the ice-cream sales that is causing the drowning incidents. They are both increased because of the summer season, where people eat more ice-creams, and also go swimming more. 

But, if P were to represent "increase in ice-cream sales" and Q were to represent "increase in drowning incidents" then the implication P --> Q is very much valid. The implication only says that if P is true, then Q is true-- not that P causes Q to be true. 

Another confusion that is caused because of the lack of a causality operator is the famous saying by Rene Decartes: "I think, therefore, I am". 

It is often interpreted as "I think, and therefore it causes me to exist" and leads to several jokes like the following: 

René Descartes walked into a bar. The bartender said “would you like a beer?” René replied “I think not”
He disappeared. 

Or this.. 


But the problem here is of course, that of interpreting implication as causation. "I think, therefore, I am" can be interpreted as "I think, and that causes me to exist" or as "I think, and therefore I can infer that I exist." 

What Decartes meant was the latter. The fact that "I think" leads me to infer that "I exist". In other words, it is my existence that is having a causal dependency on the fact that I think, and not the other way around! 

An implication of the form P --> Q can also legitimately mean that Q is the cause and P is the effect! 

To understand his even better, consider the equivalence between an implication and its contra-positive. An implication of the form P --> Q and another implication of them form ~Q --> ~P (where ~ is interpreted as "not") are both equivalent. 

Using this, we can see that "I think, therefore, I am" is equivalent to saying that "I am not, therefore I do not think". which is consistent. 

Even if Decartes had meant that my thinking is causing me to exist, the implication that "I don't think, therefore I don't exist" is still a fallacy-- called the inverse fallacy. "If P then Q" is not equivalent to either "If Q then P" or "If not-P then not-Q". 

13 April, 2023

Logic, Invariance and Self

When we study logic, we first study the definition of a proposition or assertion: A statement that can be assigned a true or false value. For instance, a statement like "It is raining" is an assertion-- it could be either true that it is indeed raining, or false. But a sentence like, "Come here" is an imperative statement that is calling for an action, and not an assertion-- there is no truth or false value we can assign to it. 

Assertions can be strung together using several logical operators like "and", "or", "not", "if-then" and so on. Hence for instance if we have two assertions: "It is raining" and "Our basement is flooded", then a statement of the form: "If it is raining then our basement is flooded" is also an assertion. Verifying the truth or falsity of this assertion often proceeds by an attempt at falsification. For instance, if we observe that it is indeed raining, and our basement is not flooded, then we can say that the assertion is false. However, if it is raining and the basement is indeed flooded, it is not sufficient to deduce that the assertion is true. Maybe the basement is going to be flooded from an other source regardless of whether it is raining or not. Verifying the falsity of an assertion is easier, than verifying its truth. 

As we get more advanced in our study of logic, we often see the term "true", getting replaced by the term "holds". We don't say that an assertion is "true"-- rather we say that an assertion "holds" against multiple attempts at falsifying it.

The term "holds" represents a property of invariance-- indicating something that sustains or remains. Invariance is a weaker construct than truth-- and indeed truth is often defined as something that is eternally invariant, across time and observers. 

The term "dharma" that is characteristic of Indian thought-- comes from the root dhrt-- to mean something that "holds". The name for "Hinduism" in India is called "Sanatana dharma" where the term "Sanatana" means "eternal" or "universal." Hence, the "religion" of India can be seen as a quest for assertions that have eternal sustainability-- precisely what all scientific inquiry is about. 

In our mainstream education, we often learn of mathematical truths that have eternal invariance. For instance, every number can be written as a product of prime numbers, and the number of prime numbers are infinite. These assertions hold everywhere and always-- they were true during the time of dinosaurs and they are true today; they are true on Earth, Mars, or anywhere in the (physical) universe. 

While we spend most of our time searching for invariance in the objective universe outside us, Indian thought also has a lot of inquiry on what is invariant in our own subjective experiences. 

There is a story of the king Janaka (father of Sita and the king of Mithila), who was known to be a very good philosopher himself. He once had a dream in which, his kingdom is attacked and he loses his kingdom and is exiled. He goes into increasing desperation as he roams from place to place, searching for food and striving to survive. In this desperation, he cries out and wakes up, only to realise that it was all a dream. He wakes up to find himself back in his palace, with his servants tending to him, his family members concerned for him, and people treating him with deference. 

But the dream was so intense, that the king is not sure which was real. He asks the philosopher Ashtavakra as to which of his experience was real. Ashtavakra replies by asking, "When you were experiencing your dream, did you experience what you are experiencing now-- the comfort of the palace, the respect and deference from others, etc.?" to which, the king says no. And then Ashtavakra asks, "And now, are you experiencing the desperation, the desolation and helplessness that you experienced in your dream?" to which, the king says no again. 

And Ashtavakra replies, "Well then neither the experience of the dream nor the experience that you are having now in your waking state, are real. Both are bounded and temporary." 

The king is perplexed, "Neither of them are real?" Not even what we are experiencing now? What was real then?" 

Ashtavakra replies, "In your dream, were you-- the experiencer-- there, going through the intense experience?" To which, the king replies, "Yes, I was there." Ashtavakra goes on, "And now, are you here, feeling the experience of the palace and your waking universe?" To which, the king affirms that he is indeed here, experiencing all these now. 

"Hence," replies Ashtavakra, "you-- the subject, or inquirer-- is more real than your experiences. The inquirer remains invariant while objects of inquiry that create experiences in our minds keep changing." 

Models of Intelligence

Today, whenever we speak of AI, we mean a specific model of AI based on large language models and diffusion, both of which, undergo foundati...