Formal logic is the foundation of clear thinking. Understanding it allows you to articulate thoughts precisely, identify flaws in others' arguments, and make well-founded decisions.
Here we will cover just the basics, the essential minimum, and revisit what you probably already know — from atomic propositions to inference rules and De Morgan's laws.
1. Fundamental Laws of Logic
Before moving on to operations, we need to establish the fundamental laws upon which all classical binary logic is built. The first three were formulated by Aristotle, the fourth by Leibniz.
Law of Identity ()
Every thought in the process of reasoning must retain the same definite meaning.
-
Essence: You cannot change the definition of terms "on the fly".
-
Example of error: "The students overlooked the lecture." The word "overlooked" is ambiguous: did they observe it carefully, or did they miss it? Without clarifying the context, logical inference is impossible.
Law of Non-Contradiction ()
Two contradictory statements cannot both be true at the same time.
-
Essence: A statement cannot be both true and false simultaneously.
-
Example: You cannot say "This code works" and "This code doesn't work" about the same version of a program at the same moment in time.
Law of Excluded Middle ()
Of two contradictory statements, one is true, the other is false, and there is no third option.
-
Essence: The world is binary. Either a fact holds, or it doesn't.
-
Example: A number is either even or odd. There are no "almost even" numbers.
-
Important: This law doesn't work in fuzzy logic, where intermediate states exist, but in classical logic (and in if-statements in programming) it is absolute.
Principle of Sufficient Reason
Every true statement must be justified by other statements whose truth has already been proven.
-
Essence: Nothing is taken on faith just like that ("because I said so"). This is a requirement for provability and verifiability.
-
Example: The statement "This algorithm works faster" is logically meaningless without metrics, benchmarks, or complexity analysis ().
2. Propositions
The basic unit of formal logic is a proposition.
Definition: A proposition is a sentence about which one can unambiguously say whether it is true () or false ().
Examples:
-
: "Surgut is the capital of the world." ()
-
: "2 + 2 = 5." ()
Important: Not every sentence is a proposition.
-
Questions ("What time is it?") or commands ("Close the door") have no truth value.
-
Statements with undefined variables, for example, "He is a tall person" or "". In their current form, they have no truth value. In logic, such constructs are called predicates.
3. Logical Operations (Connectives)
Complex propositions are built from simple ones using logical connectives.
Conjunction (AND, )
The proposition is true if and only if both statements are true simultaneously.
- Example: "It's raining outside AND the wind is blowing." This statement will be false if there's only rain without wind.
Disjunction (OR, )
Logical "OR" is often confused with the everyday choice of "either this or that." In logic, disjunction is inclusive. The proposition is true if at least one of the statements is true (or both).
- Example: "To be admitted, you need to pass math OR physics." If the applicant passed both subjects, the condition is not violated — it's true.
Implication (If... then, )
The most difficult operation to understand intuitively. It reads as "If A, then B."
The proposition is false only in one case: when the premise () is true, but the consequence () is false.
- Example: "If it's raining (), then the pavement is wet ()."
Let's consider non-obvious cases:
-
It's not raining (), but the pavement is wet (). Is our logic violated? No, the pavement could have been washed by a machine. The implication remains true.
-
It's not raining (), the pavement is dry (). The logic is also not violated.
Rule: "From falsehood, anything follows." If the condition is not met, the statement itself is not considered false.
Biconditional (If and only if, )
True when the values of and match.
- Example: "I will go for a walk if and only if the rain stops."
4. Tautologies
If a formula is true under any circumstances, it is called a tautology. In rhetoric, these are often "empty" statements, impossible to refute, carrying no new information.
Example formula:
-
Verbal interpretation: "If it's raining and the wind is blowing, then it's raining."
-
This statement is always true, regardless of the weather. It's logically correct but useless.
5. De Morgan's Laws
These laws help correctly formulate negations of complex statements. This is a common trap in arguments and contracts.
First Law
The negation of "AND" changes the meaning to "OR" with negation of the parts:
-
Statement: "He is smart AND honest."
-
Incorrect negation: "He is stupid and dishonest."
-
Correct negation: "It's not true that he is smart and honest" = "He is EITHER not smart, OR not honest (or both)." The absence of just one quality is enough for the original statement to become false.
Second Law
The negation of "OR" changes the meaning to "AND" with negation of the parts:
-
Statement: "Tomorrow I'll go to the cinema OR to the park."
-
Negation: "I won't go anywhere" = "I will NOT go to the cinema AND I will NOT go to the park."
6. Logical Inference (Rules of Deduction)
Logic allows us to obtain new reliable knowledge from existing facts.
Modus Ponens (Affirmation)
If we know the rule "If , then " and observe the fact , we must acknowledge the fact .
-
Example:
-
All humans are mortal (If human, then mortal).
-
Socrates is a human.
-
Conclusion: Socrates is mortal.
-
Modus Tollens (Denial)
If we know the rule "If , then ," but observe that did not occur (we observe ), we must acknowledge that did not happen.
-
Example (Sherlock Holmes' method):
-
Premise: "If a stranger had entered the house (), the dog would have barked ()."
-
Observation: The dog did not bark ().
-
Conclusion: No stranger entered the house ().
-
Conclusion
We have reviewed the fundamental principles of classical binary logic. These tools will help you structure your thinking and avoid common cognitive errors.
However, formal logic is an extensive discipline. Beyond this article remain such important topics as predicate logic (working with quantifiers), fuzzy logic for handling uncertainty, and probabilistic reasoning methods (induction and abduction). These areas deserve separate detailed study (hopefully on your part).
I hope I've piqued your interest once again, see you soon ~