Sources covered
Lecture 1 (introduction and teasers), Lecture 2 (propositional logic), Lecture 3 (propositional logic continued, start of predicate logic, mock interview). Script: Chapter 1 (§1.1–1.3), §2.1–2.3 complete, §2.4.1–2.4.2. The rest of §2.4 (quantifiers in detail), §2.5 and §2.6 (proof patterns) follow in Week 2. Material that appears only in the script and was not discussed in the lecture is marked (script only).
1. Executive Overview & Core Objectives
Week 1 lays the foundation for the whole course: what a mathematical statement is, what it means to prove one, and how propositional logic gives us a precise “toy world” of formulas in which we can compute with truth values like we compute with polynomials. The central conceptual point, stressed repeatedly by the lecturer, is the strict separation between statements (true or false, natural-language level, connected by ) and formulas (syntactic objects with symbols that need a truth assignment, connected by ). Relations between formulas such as and produce statements about formulas. The week ends with the motivation and the building blocks of predicate logic.
Learning objectives. After this week you should be able to:
- decide whether a sentence is a well-defined mathematical statement, and distinguish “well-defined” from “known to be true”;
- evaluate composed statements, especially , and explain why implication has nothing to do with causality;
- solve the chessboard L-tiling teaser (counting argument + doubling theorem) and the chocolate teaser (invariant argument);
- build truth tables (function tables) for arbitrary propositional formulas;
- define and check logical equivalence (), logical consequence (), tautology/validity, and (un)satisfiability;
- derive equivalences by algebraic manipulation using Lemma 2.1 instead of truth tables;
- state and prove Lemma 2.3 ( is a tautology ) and justify modus ponens;
- spot circular reasoning (“assuming what you want to prove”) in a false proof;
- name the building blocks of predicate logic (universe, predicates, functions, constants, operators, quantifiers).
Course logistics (Lecture 1)
- Lectures Monday and Wednesday. One exercise class (Übungsgruppe) on Monday or Tuesday, groups A–Y, in German or English. Registration is on Moodle, not myStudies.
- Exercise sheets come out on Thursdays. Each sheet has a bonus exercise.
- Bonus system: two one-on-one oral interviews with a TA per semester, max 6 points each, so 12 points total, converted to a bonus of to added to the exam grade. Each interview covers the bonus exercise of the previous Thursday’s sheet. Four students per time slot, ordered alphabetically by surname. You may bring handwritten notes for yourself, but you present the solution from scratch.
- Mock-interview grading (Lecture 3): partial points per sub-question. Extra questions can make up for lost points, but the cap stays at 6.
- Exam: on paper, on site, 3 hours, in the exam session (late Jan/early Feb). You can choose an English or German version.
- Sections marked with in the script are not exam relevant.
- The board content is not uploaded. It either matches the script or is a slight variant, and the lecturer announces explicitly when it isn’t.
2. Core Concepts & Formal Definitions
2.1 Why discrete mathematics? (Script §1.1, §1.3)
Discrete mathematics (Diskrete Mathematik) studies finite and countably infinite structures, such as graphs, integers and finite algebraic structures, as opposed to the continuum () of analysis. The script gives three reasons it is central to computer science:
- Discrete structures. Networks are graphs, and cryptography and coding theory use algebraic groups and fields.
- Abstraction. Computer systems can only be understood in layers of abstraction.
- Mathematical derivations. In CS, reasoning usually takes the form of a proof (e.g. “this program terminates”, “this system is secure”), not a numerical calculation.
Abstraction (Abstraktion) in this course means two things:
- simplification: ignore every aspect that is irrelevant to the problem;
- generalization: a property proved at the abstract level holds for every system with the same abstraction.
The lecturer’s three goals for the course:
- build everything from scratch;
- abstract as much as possible (e.g. talk about groups and rings rather than );
- make everything formal and proved.
Course roadmap: logic (start) → sets/relations, number theory, algebra (middle) → logic again (mid-November to the end).
2.2 Mathematical statements (Script §2.1.1)
Definition 2.1 (Mathematical statement)
A mathematical statement (mathematische Aussage), also called a proposition, is a statement that is true or false in an absolute, indisputable sense, according to the laws of mathematics.
Terminology:
| Term | Meaning |
|---|---|
| theorem (Theorem/Satz) | a true statement, usually an important result |
| lemma (Lemma) | a true, intermediate, often technical result used in later proofs |
| corollary (Korollar) | a simple consequence (e.g. special case) of a theorem or lemma |
| conjecture (Vermutung) | a statement not known to be true or false, but believed to be one of them |
| assumption (Annahme) | not known to be true, but assumed true within a line of reasoning |
| assertion / claim (Behauptung) | a true statement before its proof has been given |
The lecture asks two separate questions for every sentence:
- Is it a well-defined statement, i.e. does it definitely have a truth value?
- If so, is it true or false, and do we know which?
Examples from the lecture (Lecture 1)
- : “101 is a prime number.” Well-defined and true. The number is meant in decimal. A student also asked about that.
- : “There are infinitely many twin primes.” Twin primes are pairs of primes that differ by 2, e.g. . Well-defined, but its truth value is unknown (open research problem). Well-defined does not mean known.
- “I love you.” Grammatically a statement, but not a mathematical statement: there is no precise definition that fixes a truth value.
- : “This statement is false.” Not well-defined. If were true, then what it says holds, so it is false. If were false, then what it says fails, so it is true. A statement must be exactly one of true/false, so is not a statement. The problem is self-reference. Later in the course there are statements that fail to be well-defined in much subtler ways.
Script examples (§2.1.1) (script only)
Statement Status 71 is a prime number. true (easy) If is prime, then is prime. false. Counterexample: , Every natural number is the sum of at most four squares. true, but needs a sophisticated proof (e.g. ) Every even natural number is the sum of two primes (Goldbach). unknown Any pairwise non-parallel lines in the plane intersect in one point. false (see the false proof, Example 2.4) In chess, the first player (“white”) has a winning strategy. unknown Example 2.1: “There is no algorithm factoring any -bit integer in steps” is not a precise statement. Its truth depends on the computational model, which theoretical CS has to fix first.
Two uses of stating : (a) claiming that is true, or (b) merely discussing (e.g. as an assumption). Keep them apart.
2.3 Composing statements; the implication (Script §2.1.2)
From statements we form new statements:
- Negation: ” is false.”
- And: ” and are (both) true.”
- Or: “At least one of and is true.” (Inclusive.)
- Implication (Implikation): “If is true, then is true”, written , read ” implies ”.
Truth value of
is false exactly when is true and is false. In all other three cases it is true.
means ” is true if and only if is true”, i.e. and .
Script examples: the first three are true, the last is false.
- “4 is even 71 is prime” (T ⇒ T: true)
- “5 is even 71 is prime” (F ⇒ T: true)
- “5 is even 70 is prime” (F ⇒ F: true)
- “4 is even 70 is prime” (T ⇒ F: false)
For negation, “and” and “or” between statements there is no symbol in this course. Writing for statements is forbidden here, because is reserved for formulas (see 2.13).
Exam Trap: implication is not causality
only says something about the truth values of and . The statements need not be related at all. Lecture example: “If it rains, the ground gets wet” looks causal. Its contrapositive (Kontraposition), “If the ground is not wet, it did not rain”, is just as true but makes no causal sense (“not wet” does not cause “no rain”).
Exam Trap: false premise
If is false, is true regardless of : there is “no obligation” to fulfil. And from ” is true and is false” you cannot conclude that is false (script, after Example 2.2).
Source note (Lecture 1)
The lecturer misspoke twice:
- He first called (“101 is prime”) false and argued that is therefore true. A student pointed out that 101 is prime; he had a different number from the script in mind. Correct: since is true, has the same truth value as , which is unknown.
- He once said ” is true iff is true or is false” and “false if is false and is not true”. Both are swapped. Correct (and what he said at the end): is true iff is false or is true.
2.4 Two meanings of (Script §2.2.3)
In the literature, is used for:
- the composed statement (§2.1.2);
- a derivation step in a proof.
The script and lecture use a dotted arrow for the second meaning.
Notation: proof step
means: can be obtained from by one (simple) proof step. Analogously, means each follows from the other by one simple step.
If holds, then the statement is true. The converse fails: can be true without a single proof step from to . This notation is not standard; it is only used in this course.
2.5 The concept of a proof (Script §2.2.5–2.2.8) (mostly script only; the lecture returns to proof patterns in Week 2)
Definition 2.2 (Proof, informal)
A proof (Beweis) of a statement is a sequence of simple, easily verifiable, consecutive steps. It starts from a set of axioms (postulated to be true) and known (previously proved) facts. Each step applies a derivation rule to a few already proven statements, giving a newly proved statement, until the final step yields .
Proofs differ in which axioms/facts they assume, what counts as “easy to verify”, how much is explicit, and how much notation (like ) they use.
There are three reasons for formal proofs: (1) prevention of errors; (2) proof complexity and automatic verification (computers need formalized statements); (3) precision and deeper understanding. There is a trade-off between rigour and readability. Chapters 3–5 use informal proofs; Chapter 6 formalizes proofs.
Role of logic (§2.2.7). Logic answers three questions:
- In which language are statements written? (syntax)
- What does it mean for a statement to be true? (semantics)
- What constitutes a proof from given axioms? (calculus)
Proof levels in this course (§2.2.8)
- Proof sketch / proof idea: the non-obvious ideas, not spelled out with every definition.
- Complete proof: every definition used is explicit, and every step is justified by naming the rule or definition applied.
- Formal proof: entirely phrased in a given proof calculus (e.g. resolution in Chapter 6).
Exercises and exams always say which level is expected and which rules are allowed (confirmed in Lecture 3).
2.6 Propositional logic: symbols, operators, formulas (Script §2.3.1)
Motivation (Lecture 2). Around 1900, paradoxes in natural-language reasoning caused a foundational crisis. Example, the barber paradox: “The barber of Seville shaves exactly those people who do not shave themselves.” Does he shave himself? If yes, he belongs to those who shave themselves, so he must not shave himself. If no, he must shave himself. The answer: build reasoning from the ground up, starting with a formalism in which nothing can go wrong, and then arithmetize it, i.e. compute with statements mechanically, the way one expands without thinking about graphs.
Building blocks of propositional logic (Aussagenlogik):
- Propositional symbols (Aussagensymbole) (or ). They are like variables (placeholders for basic statements) and take the values or .
- Logical operators (Operatoren / Junktoren): (NOT), (AND), (OR), (the lecturer calls it just “arrow”, Pfeil), and .
Definition 2.3 (Logical values)
The logical values (constants) “true” and “false” are denoted and . They are not the numbers 1 and 0, despite the same symbols.
Definition 2.4 (Negation, conjunction, disjunction)
- The negation (Negation) is true iff is false.
- The conjunction (Konjunktion) is true iff both and are true.
- The disjunction (Disjunktion) is true iff or (or both) is true.
As functions: and .
In the lecture these tables are the definitions of the operators. We do not derive them from intuition; we define the computation rules.
| 0 | 0 | 1 | 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 0 | 1 | 1 | 0 |
| 1 | 0 | 0 | 0 | 1 | 0 | 0 |
| 1 | 1 | 0 | 1 | 1 | 1 | 1 |
Definition 2.5 (Formula)
A correctly formed (well-formed) expression involving the propositional symbols and logical operators is called a formula (Formel) of propositional logic.
Building rules (lecture): every symbol is a formula; if are formulas, then , , , , are formulas. is unary (one operand); the others are binary (a formula on each side). Formulas are named ; symbols .
Exam Trap (mock interview)
“A formula is an expression of symbols and operators” got only half a point. The well-formedness requirement is missing: is not a formula.
Implication (arrow) and two-sided implication. is false iff and . It is an alternative notation for (same function table, see 4.2), so we could drop entirely. It is kept because it is intuitive and pleasant to write. is iff and have the same value; it is equivalent to .
Notational conventions.
- binds stronger than everything else: means , and means .
- No other precedence rules are used. When in doubt, parenthesize; extra parentheses are never wrong.
- Because of associativity, and may be written without parentheses.
- Negation is written , not . Some other courses use the overbar; here it may be misunderstood.
- “Or” is inclusive. An exclusive or (XOR, “entweder … oder”) would be a separate operator, often written , with table . It is not introduced officially.
2.7 Formulas as functions (Script §2.3.2)
Just as the arithmetic expression defines a function , a formula with symbols defines a function
Here is the set of all -tuples of bits, i.e. all truth assignments (Belegungen). Each element corresponds to one row of the function table, so there are rows (e.g. : ; : 32 rows). Since the domain is finite, the function table characterizes the function completely. This is true for propositional logic only, not for predicate logic.
Intuition: formula vs. function
Formula and function are not interchangeable words. Different formulas can induce the same function: and are different formulas with one function. The formula is the syntax (a string or tree); the function is its meaning.
2.8 Logical equivalence, and (Script §2.3.3, §2.3.6)
Definition 2.6 (Logical equivalence)
Two formulas and are (logically) equivalent (logisch äquivalent), written , if they correspond to the same function, i.e. their truth values are equal for all truth assignments to the symbols appearing in or .
Notation: and
- (“top”) is the formula that is always 1 (a tautology). (“bottom”) is the formula that is always 0 (unsatisfiable).
- They adapt to as many symbols as the context needs.
- : is a tautology / valid (allgemeingültig). : is unsatisfiable (unerfüllbar).
- For every formula : and .
Exam Trap
are formulas, not the constants . You substitute into symbols; you cannot substitute into a symbol the same way, and by itself is not a formula (Lecture 2 Q&A). Also: every symbol is a formula, but not every formula is a symbol.
2.9 Basic equivalences: Lemma 2.1 (Script §2.3.3)
Lemma 2.1
- and (idempotence, Idempotenz)
- and (commutativity, Kommutativität)
- and (associativity, Assoziativität)
- and (absorption, Absorption)
- (first distributive law)
- (second distributive law)
- (double negation, doppelte Negation)
- and (de Morgan’s rules)
Proof: each part is checked by a truth table (“brute force”, “Holzhammer”). The tables of both sides agree in every row. Example for 7: ; .
Further simple facts used in the lecture (each provable by a 1- or 2-row truth table):
Script examples (script only):
- . So and suffice to express every function.
- Example 2.8: .
- Example 2.9: (verified in 4.6).
- Example 2.10: .
2.10 Logical consequence (Script §2.3.4)
Definition 2.7 (Logical consequence)
A formula is a logical consequence (logische Folgerung / logische Konsequenz) of a formula , written
if for all truth assignments to the symbols appearing in or , the truth value of is whenever the truth value of is .
How to check with a table: look at only the rows where . In each of them must be . Rows with impose no condition.
Intuition
If we (wrongly, but as a picture) read as numbers, means pointwise as functions. Equivalence is then "", consequence is "", just as holds for all values.
Equivalence vs. consequence (Script §2.3.4)
Exam Trap: footnote 16
Write ” and ” with the word “and”. Never write . only combines formulas, and is a statement, not a formula.
2.11 Lifting to formulas (Script §2.3.5)
Equivalences and consequences remain valid if the symbols are replaced by arbitrary formulas (consistently). The script states this without proof. The reason (Lecture 3): a truth-table proof only uses the value ( or ) that each symbol takes, and a substituted formula also only evaluates to or . Analogy: for all reals implies for all expressions .
Example 2.14: since , also for all formulas .
A second, related principle used constantly in derivations (Lecture 3): replacing a subformula by an equivalent subformula yields an equivalent formula, because the subformula’s value is the same in every row, so everything around it evaluates the same.
2.12 Tautologies and satisfiability (Script §2.3.6)
Definition 2.8 (Tautology / valid)
A formula is a tautology (Tautologie) or valid (allgemeingültig) if it is true for all truth assignments of the involved symbols. Notation: . “Tautology” and “valid” mean exactly the same.
Definition 2.9 (Satisfiable)
is satisfiable (erfüllbar) if it is true for at least one truth assignment, and unsatisfiable (unerfüllbar) otherwise.
Examples:
- Example 2.15: and are tautologies.
- Example 2.16: is unsatisfiable; is satisfiable (but not valid).
Notation (Lecture 3)
is shorthand for . Every assignment makes true, so must be true under every assignment. Hence
(A student noted that would express the same thing. Correct, but the course uses only .)
Lemma 2.2
A formula is a tautology if and only if is unsatisfiable.
Lemma 2.3
For any formulas and : is a tautology if and only if .
(Proofs in §3.5.)
2.13 Two worlds: statements vs. formulas (Lectures 2 and 3)
This is the single most important conceptual distinction of the week; the lecturer repeated it in every lecture.
| Symbol | Name | Input | Output | Defined by |
|---|---|---|---|---|
| implication | two statements | statement | false iff left true, right false | |
| arrow (formula implication) | two formulas | formula | table | |
| logical consequence | two formulas | statement | Def. 2.7 | |
| equivalence of statements | two statements | statement | both true or both false | |
| two-sided implication | two formulas | formula | table | |
| logical equivalence | two formulas | statement | Def. 2.6 | |
| and, or, not | formulas | formula | Def. 2.4 (never between statements here) | |
| proof step | statements | (claim of one derivation step) | §2.2.3 |
- A statement is always either true or false.
- A formula is in general neither true nor false. It gets a truth value only once all its symbols are assigned. It is a different data type.
- ” is valid”, ” is unsatisfiable”, "", "" are statements about formulas.
Parsing a mixed line (Lecture 2 Q&A)
, are formulas. , and are statements. “and” joins two statements into a statement; joins two statements into a statement. Likewise, in , the left and right sides are formulas, and the whole line is a (true) statement.By convention, anything asserted in the script or lecture is claimed to be true unless stated otherwise.
Source note (Lecture 2)
When introducing , the lecturer said its table is “exactly XOR … no, NOT XOR”. The correct table is (the negation of XOR, “XNOR”). He also said had “not yet been defined”; the script already defines it in §2.3.1.
2.14 Formulas as trees and functional completeness (Lecture 3; Script §2.3.7*)
A formula can be drawn as a tree:
- leaves are the symbols;
- inner nodes are the operators;
- the root is the outermost operator.
Evaluation proceeds bottom-up (recursively). Script §2.3.7 (starred) adds that such trees correspond to digital circuits: the operators become logic gates (topic of “Digitaltechnik”).
Every function is induced by some formula. In the lecture poll, almost everyone guessed this correctly. The formula may be exponentially large in . Finding compact formulas is a problem of technical computer science, attacked e.g. by covering the 1-rows of the table with large sub-terms. The lecture stated this without proof; a construction is in §3.9.
2.15 Predicate logic: building blocks (Script §2.4.1–2.4.2; Lecture 3)
Motivation. Propositional logic is too weak. It cannot express “11 is prime” or “there are infinitely many primes”: there are no objects such as numbers to talk about, only 0/1-valued symbols. Predicate logic (Prädikatenlogik) extends it with quantifiers, predicates and functions. It is much more powerful and correspondingly more involved.
Building blocks (the propositional symbols disappear):
| Building block | Notation | Description | Examples |
|---|---|---|---|
| universe (Universum) | the collection of objects we reason about; non-empty | , , , , all humans | |
| predicates (Prädikate) | take objects of , output a truth value | , , , | |
| functions (Funktionen) | (lower case) | take objects of , output an object of | , , |
| constants (Konstanten) | fixed elements of | , , ; , | |
| operators | as before: truth values in, truth value out | ||
| quantifiers (Quantoren) | , | “for all ”, “there exists ” |
Definition 2.10 (Predicate)
Let be a non-empty set (the universe). A -ary predicate on is a function
It assigns to each list of elements of the truth value .
Examples on :
Binary predicates are often written in infix notation ( instead of ). With functions and constants, is written . It is true for every , and quantifiers will let us express exactly this (“for all ”).
Source note (Lecture 3)
- The lecturer said the universe “need not be a set”. The script defines as a non-empty set; use the script’s version.
- He first called constants “A, B and C” and then corrected himself, since capital letters are the propositional symbols. Use lower-case .
- Interpretations (fixing and the meaning of predicate/function symbols) and quantifiers (Def. 2.11) are treated next week.
3. Step-by-Step Derivations & Mathematical Proofs
3.1 The chessboard L-tiling problem (Example 1.1; Lecture 1)
Problem. : “A chessboard on which an arbitrary square is marked (blocked) can be covered completely and without overlaps by L-shaped pieces of 3 squares each (any rotation allowed).”
is a predicate : means the statement is true for . The original question is .
Well-definedness first
Students asked for two clarifications, and both are needed for to be a statement:
- What is an L-piece? It is squares forming an “L”, in any orientation.
- What size is the board? Hence the parameter .
makes no sense: a board has no square to mark. So .
Step 1: small cases.
- trivially: the only square is marked, nothing remains to cover.
- : whichever square of the board is marked, the other three form an L.
Theorem (necessary condition, Lecture 1)
Proof. Every L-piece covers exactly previously uncovered squares. If a tiling uses pieces, it covers squares. The squares to be covered are , so a tiling forces , i.e. divides . Contrapositive: if , no tiling exists, so .
Which satisfy the condition? Compute by cases on :
| 0 | 0 | 2 |
| 1 | 1 | 0 |
| 2 | 4 ≡ 1 | 0 |
So or (script’s formulation). Hence for all divisible by 3 (). For : , so two squares are always left over.
Exam Trap: necessary is not sufficient
only says there is the right amount of space (an integer number of pieces). It does not prove that a tiling exists. The theorem says nothing when its premise is false: is divisible by 3, yet according to the script.
Theorem (doubling, Lecture 1; Script §1.2)
Proof (found in the lecture by a student).
- Take a board with one marked square. Split it into four quadrants.
- The marked square lies in exactly one quadrant. Rotating the board by multiples of doesn’t change the problem, so w.l.o.g. it lies in the top-left quadrant .
- is a board with one marked square. By the assumption it can be tiled completely.
- Look at the four squares at the centre of the big board (one corner square from each quadrant). The three of them belonging to form an L-shape. Place one L-piece exactly there. This is the only piece we place explicitly.
- Now each of is a board with exactly one already-covered square (its centre corner). By , each can be tiled completely.
- All four quadrants are now covered without overlap.
Why this works for every
We never need to know how the quadrants are tiled (“wie genau weiß der Kuckuck”). The assumption is a “recipe” that works for any marked square, and we use it four times: once with the original marked square, three times with the centre square as the “marked” square. Only the central L is concrete. This is the core idea of induction (formalized in §2.6.10).
Consequences.
- . The original problem is solved: the board can always be tiled.
- In general for all . If (script exercise), then for all .
- Generalization (exercise, not proved in lecture or script): and . The lecturer says the proof needs more than “plugging in other numbers” and gives a nice “aha” moment.
- Status per script: ; ; next open cases , .
Source note (Example 1.1)
- Script: via proof by case distinction (marked square in a corner, on an edge, or in the interior; give a tiling for each). Lecture: via the doubling theorem from . Both are valid.
- Script: via counterexample. If the square next to the centre square is marked, the rest cannot be tiled; the script asserts this without the case check. In the lecture, the lecturer was unsure whether was 0 or 1 and said “clever trial and error”. The script value is .
Morals of the example (lecturer): (1) attack a hard instance via simplified instances and look for regularities; (2) abstraction from to general made the problem easier, and taught us facts about many at once.
3.2 Chocolate breaking (Example 1.5; Lecture 1)
Problem. A Swiss chocolate bar has 24 pieces. A move takes one current piece and breaks it along one groove. Stacking pieces is not allowed. What is the minimal number of moves to get 24 single pieces?
Claim
Every strategy needs exactly breaks; in general an bar needs exactly .
Proof (invariant).
- Before any move there is piece.
- Each move takes one piece and replaces it by two, so the number of pieces increases by exactly 1.
- By repeating this, after moves there are exactly pieces, independently of the strategy.
- We are done exactly when there are pieces, i.e. after moves.
- Hence minimum = maximum = ; for it is .
Exam Trap
Students’ answers of 15, 18 and 21 in the lecture came from breaking several pieces at once along a full line. That is the forbidden “stacking”. With the rule “one piece per move”, the answer 23 holds for every strategy. Questions like “Is it better to halve first or break off a row?” have the answer “it doesn’t matter”.
The abstraction
The only thing that matters is “pieces moves ”. Everything else (shape, chocolate, grooves) is irrelevant. A problem with the same abstraction (my addition): a knock-out tournament with players needs exactly matches, because each match eliminates exactly one player.
3.3 Proof that is not prime (Example 2.2) (script only)
Claim. is not prime is not prime.
Proof.
- If is not prime, then with (definition of prime), so also .
- Factor using the geometric sum:
(Multiply out: the sum telescopes to .)
3. Since , we have . Since , we have .
4. So is a non-trivial divisor of , which is therefore not prime.
Application: , so divides .
Exam Trap
The converse ” prime prime” is false (). From ” is true” you cannot conclude "".
3.4 A proof as a chain of steps (Example 2.3) (script only)
Claim. If and are squares, then so is . ( is a square if for some integer .)
Every step names its justification. Proofs may also be non-linear (§2.2.4): from true one may prove , , , ” and ” , ” and ” , and finally ” and ” .
3.5 Proofs of Lemma 2.2, Lemma 2.3, and and
Lemma 2.2 (the script omits this proof since it follows from the definitions). is a tautology takes value under every assignment takes value under every assignment (definition of ) is unsatisfiable (Def. 2.9).
Lemma 2.3. is a tautology .
Proof. Two directions.
- () Assume is a tautology. Fix any assignment. By the table of , the pair of truth values is , or ; never , since that would make . In each of the three cases, if then . As the assignment was arbitrary, .
- () Assume . Then no assignment makes and . That combination is the only row where gives , so evaluates to under every assignment, i.e. it is a tautology.
In Lecture 3 this was presented as the “observation”:
and .
- () If and agree everywhere, then implies and vice versa.
- () Suppose some assignment gave different values. Either , contradicting , or , contradicting . So they agree everywhere.
3.6 Modus ponens: tautology by truth table and by algebra (Lectures 2 and 3)
Claim (Example 2.15, Lecture 2): , equivalently (Lemma 2.3) is a tautology.
Method 1: truth table.
| 0 | 0 | 1 | 0 | 1 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 0 | 0 | 1 |
| 1 | 1 | 1 | 1 | 1 |
The last column is all 1s, so it is a tautology. The only row with is row 4, where , so holds.
Method 2: algebraic derivation (Lecture 3). This scales to larger formulas where truth tables explode.
Why each step is legitimate:
- Step 1 uses that and have identical tables (Lecture 2). Replacing a subformula by an equivalent one does not change the value of the surrounding formula in any row (§2.11).
- Step 2 instantiates Lemma 2.1(5) with , , . This is allowed by lifting (§2.11).
- Step 3 makes things “more complicated first in order to simplify later”: the distributive law created the contradictory subformula , which we can now kill.
- Step 4 is only a reordering, so that the rule applies in exactly the form it is stated. (Proving directly would have saved this step.)
- Final step: a chain of ending in gives overall. Equal tables followed by "" is "".
Every step must use either a proven rule or something provable on the side (a small truth table).
Then by Lemma 2.3 with , , the formula is a tautology. The two directions are “equivalent as statements”.
Exam Trap: which rules may I use?
In the exam, the task specifies the allowed rules (e.g. “using only Lemma 2.1”, with the lemma reprinted). You then have to stick to them. Small helper facts like are either explicitly allowed or must be justified by a side truth table. Not every proof has to be in formal logic: the task says whether a formal-logic proof or a normal proof is wanted.
3.7 Modus ponens as a proof strategy (Lecture 3)
The tautology inspires a proof strategy for statements:
Proof strategy: Modus ponens
Goal: prove a statement .
- Find a suitable statement .
- Prove .
- Prove .
Then is proved.
Points the lecturer stressed:
- are statements, connected by (double arrow), not formulas.
- In the formula world the strategy is a theorem: we proved , and by lifting it holds for any formulas.
- Transferring it to the statement world (proofs in natural language) is a heuristic that is universally accepted. We cannot prove ” and () ” for arbitrary statements, because we haven’t formally defined what a statement is. That is the sense of “inspired”.
- Modus ponens doesn’t tell you how to prove : it turns one problem into three (find , prove , prove ). The point is that these should be easier.
- Transitivity (Example 2.13), , inspires a second strategy: to prove , prove and for an intermediate claim . Week 2 covers proof patterns systematically.
3.8 Proof of transitivity (Example 2.13)
Claim. .
Proof (contrapositive style, equivalent to checking the table). We must show there is no assignment with the left side and .
- forces .
- If : , so the left side is .
- If : , so the left side is .
In both remaining rows the left side is , so whenever the left side is , the right side is .
The full table has 8 rows. The lecturer suggested computing columns , , their , and , then comparing.
3.9 Every Boolean function is a formula (supplement: claimed in Lecture 3, construction added here)
Claim. For every and every there is a formula in inducing .
Construction.
- For each with , define the minterm , where if and if .
- evaluates to exactly at the assignment : all literals are there, and at any other assignment some is .
- Let . Then iff the assignment equals some with , i.e. iff . If is never , take .
- can have up to minterms, so it is exponentially large in the worst case, matching the lecturer’s remark. By de Morgan, can be replaced by and , so these two operators suffice (script §2.3.3).
4. Worked Examples & Applications
4.1 vs. (Lecture 2)
Evaluate first (it binds strongest), then OR with :
| 0 | 0 | 1 | 1 | 1 | 1 |
| 0 | 1 | 1 | 1 | 1 | 1 |
| 1 | 0 | 0 | 0 | 0 | 0 |
| 1 | 1 | 0 | 1 | 1 | 1 |
- Row 1: , and anything . The result is only when and , i.e. row 3.
- Columns 4 and 5 agree: .
Tip from the lecture: for complex formulas, write intermediate columns for the subformulas first. For the last column you then only need to AND columns 4 and 5, which are always or .
4.2 Flatmate search (WG-Mitbewohner, Lecture 2)
Candidates , where means “A moves in”; any number from 0 to 3 may move in. Three current flatmates’ opinions are formulas:
: “A or B is fine, but definitely not C”. : “B or C, and A doesn’t matter”. : “either B doesn’t move in or A does”. has nothing against B per se; .
| 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 |
| 0 | 0 | 1 | 0 | 1 | 1 | 0 | 0 |
| 0 | 1 | 0 | 1 | 1 | 0 | 1 | 0 |
| 0 | 1 | 1 | 0 | 1 | 0 | 0 | 0 |
| 1 | 0 | 0 | 1 | 0 | 1 | 0 | 0 |
| 1 | 0 | 1 | 0 | 1 | 1 | 0 | 0 |
| 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 |
| 1 | 1 | 1 | 0 | 1 | 1 | 0 | 0 |
Computing the columns:
- : is in rows 1–2, so there. Otherwise : 1 when (rows 3, 5, 7), 0 when .
- : only when (rows 1, 5).
- : only when and (rows 3, 4).
- : in rows 3 and 7, i.e. “only B” or “A and B”.
- (everybody happy): row 3 fails because , so only row 7 remains: A and B move in, C does not. Check: , , .
Because the solution is unique, . This is exactly the minterm of row 7 (cf. §3.9). Adding the requirement gives (an all-zero column), which is unsatisfiable. itself is satisfiable but not valid.
Source note (Lecture 2)
The lecturer’s prepared notes said “there is no solution”. Re-checking the table on the board, he found that his notes contained a computation error. Correct: exactly one solution, , . He also briefly doubted the column; it is correct as above.
4.3 Logical consequence checks (Lecture 2, Script 2.11–2.12)
- and : only for , where both and are . The converse fails: at the right side is but the left is . That is allowed for but rules out .
- (flatmates): row 3 () has but . The lecturer first pointed at the wrong row (row 5) and then corrected to row 3.
- Example 2.11: . The left side is only at , where .
- Example 2.12: . If the left side is , then , so , so the implication is . The two formulas are not equivalent: at the right side is , while the left side is .
4.4 Script truth tables (§2.3.1) and Example 2.9
| 0 | 0 | 0 | 0 | 0 | 0 |
| 0 | 0 | 1 | 0 | 0 | 0 |
| 0 | 1 | 0 | 0 | 1 | 1 |
| 0 | 1 | 1 | 1 | 0 | 0 |
| 1 | 0 | 0 | 1 | 1 | 1 |
| 1 | 0 | 1 | 1 | 1 | 1 |
| 1 | 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 1 | 1 | 0 | 0 |
Columns 5 and 6 agree, which verifies Example 2.9. Spot check for row 4 (): , and .
4.5 The tree of (Lecture 3)
∧
┌─────────┼──────────┐
∨ ∨ ∨
/ \ / \ / \
A B A C ¬ ¬
| |
A C
Evaluation is bottom-up. At , the first gives , so the root gives . At , the second gives , so again . At : .
(The transcript only describes the tree; the formula is reconstructed from it.)
4.6 A false proof: “1 < 0” (Lecture 3)
“Theorem”: .
is true, so ” is proved”?
What went wrong. Each individual step is a valid manipulation. A student asked whether the second step should be ; it is intentionally , using the assumed . The error is that we started from the claim itself and derived a true statement. We showed "" (with : , : ) and ” is true”, and concluded . That is modus ponens backwards: ” and ” is not a valid pattern.
In the formula world: is not a tautology. At : .
Exam Trap: circular proofs
Deriving something true from the claim proves nothing. From a false statement you can derive true statements. A valid proof derives the claim from known facts. This error is different from the one in the script’s false proofs (Examples 2.4 and 2.5).
4.7 A false proof by induction: “all lines meet in one point” (Example 2.4) (script only)
“Claim”: any pairwise non-parallel lines in the plane pass through one common point.
“Proof”:
- Base case : two non-parallel lines meet in a point.
- Step: given , the lines meet in a point , and meet in a point .
- and lie in both groups, so both contain and . Two distinct non-parallel lines meet in only one point, so .
What is wrong? (the script asks "Something must be wrong! (What?)")
The step needs two distinct lines and in both groups. For , i.e. the step from 2 to 3 lines, we have . The groups and share only one line, so nothing forces . The step from 2 to 3 fails, so the chain breaks immediately. The step argument does work for , but that is useless without . Moral: check that the induction step is valid for every from the base case on.
4.8 Mock-interview exercise (Lecture 3, Moodle “Mock Interview”)
The exact sheet wasn’t visible in the recording; the formulas below are reconstructed from the spoken solution and are consistent with every value stated.
(a) “What is a formula of propositional logic?” A well-formed (correctly formed) expression built from propositional symbols and logical operators (Def. 2.5).
(b) “What does mean? How would you show it?” For every truth assignment under which evaluates to , also evaluates to . Two ways to show it:
- A truth table: check every row with .
- Show that is a tautology (Lemma 2.3). This was the extra question.
(c) New operator with table (rows ), i.e. XOR. Compute the table of :
| 0 | 0 | 0 | 0 | 0 |
| 0 | 1 | 1 | 0 | 1 |
| 1 | 0 | 1 | 1 | 1 |
| 1 | 1 | 0 | 0 | 1 |
Follow-up question, simplify : the column is , so .
Exam Trap (interview)
Showing only the final column (“0,1,1,1”) is not enough. You must show the intermediate steps.
(d) Define an operator such that
is a tautology. First: a tautology is a formula that evaluates to for every assignment.
- Strategy: a conjunction is a tautology iff both conjuncts are.
- Left conjunct: is only at . In the other three rows (, , ) the premise is , so we need , i.e. . Row is unconstrained (”?”).
- Right conjunct: is only at . There we need . Elsewhere unconstrained.
- Combined: (rows ), i.e. .
In the mock, the student first gave (wrong), because he had computed as false at instead of . A check of row exposed this: .
Exam Trap: the most common slip
is only for . For that is , not the other way round. Also: before the interview, verify your solution in at least one row.
Mock grading: (a) 0.5/1 (well-formedness missing), (b) 1/1, (c) 1/1, simplification 1/1, (d) 1/2 (needed hints), extra question +1. Extra questions make up for lost points, capped at 6.
5. Intuition & Conceptual Bridges
Formulas are to statements what polynomials are to numbers
A polynomial is not a number; it becomes one when you plug in . A formula is not true or false; it becomes so when you plug in values for and . ” for all ” is a statement about polynomials. In the same way, "" is a statement about formulas. Lemma 2.1 is the “algebra rule sheet” of this arithmetic.
is "" and is ""
If you picture each formula as its column of 0/1 values, means “column column in every row” and means “the columns are equal”. Many facts follow at once:
- and ;
- , so and for every ;
- means , i.e. ;
- a chain gives .
Why is true when the premise is false
Think of as a promise: “if happens, I guarantee ”. The promise is only broken when happens and doesn’t. If never happens, the promise was not broken, so it counts as kept (true). That is all; there is no causality involved.
The two teasers are about invariants and reduction
- Chocolate: find a quantity that changes predictably with each move (“pieces moves ”). Then the answer doesn’t depend on the strategy. Invariants return in algorithm analysis (loop invariants) and in group theory.
- Chessboard: reduce size to size , using the smaller solution as a black box. This is the template of induction and recursion, and of divide-and-conquer algorithms (formal induction: §2.6.10).
- The counting argument () is your first modular arithmetic (), formalized in Chapter 4.
Connections across the course.
- Backwards: this week builds the vocabulary everything else uses. Statements, proofs, versus .
- Next week (Week 2): quantifiers in detail (Def. 2.11), nested quantifiers, interpretations, the rules in §2.4.8 such as , formulas vs. statements (§2.5), and proof patterns (§2.6): direct proof, contrapositive, contradiction, case distinction, counterexample, induction. Modus ponens and transitivity are the first of these.
- Chapters 3–5: set theory, number theory (congruences , Fermat test of Example 1.2), algebra (groups, rings, fields; Examples 1.3, 1.4, 1.8 about cancellation, interpolation and Euclid’s algorithm).
- Chapter 6: fully formal logic. Syntax vs. semantics, proof calculi, resolution. Lemma 2.1 and logical consequence come back rigorously, and “mechanical transformation from left to right” replaces truth tables.
Other teasers from Script §1.2–1.3 (not discussed in lecture)
- 1.2 (Fermat test): Is odd prime ? It holds for small primes and fails for small composites. The answer comes in Chapter 4: the "" direction is false. The smallest counterexample, , satisfies (my addition).
- 1.3 (cancellation law): . Does it hold for polynomials, for integers mod , for permutations? This is an algebra question (Chapter 5).
- 1.4 (interpolation): A degree- polynomial is determined by values. Does this survive over finite domains (e.g. mod 5, with polynomials of degree )? Chapter 5 (finite fields).
- 1.6: Can the shape in Fig. 1.1 be cut into 9 identical pieces? Find the abstraction.
- 1.7: Continue . Several rules fit; one is (my addition).
- 1.8: Euclid’s gcd algorithm works for integers and polynomials. The common abstraction is the Euclidean domain, a special integral domain, which is a special ring (Chapter 5).
6. Summary & Self-Assessment Questions
Cheat sheet
| Concept | Definition / fact |
|---|---|
| Statement (Aussage) | true or false in an absolute sense (Def. 2.1) |
| false iff true and false; no causality | |
| follows from by one proof step | |
| Formula | well-formed expression of symbols and operators (Def. 2.5) |
| table ; | |
| table ; | |
| Precedence | binds strongest; otherwise parenthesize |
| Formula ↦ function | , rows |
| same value under all assignments (Def. 2.6) | |
| under all assignments (Def. 2.7) | |
| iff and | |
| Tautology / valid | true under all assignments; ; (Def. 2.8) |
| Satisfiable | true under at least one assignment (Def. 2.9) |
| Unsatisfiable | |
| Lemma 2.2 | tautology unsatisfiable |
| Lemma 2.3 | tautology |
| Lemma 2.1 | idempotence, commutativity, associativity, absorption, two distributive laws, double negation, de Morgan |
| Extra rules | , , , |
| Lifting | laws hold with symbols replaced by formulas; equivalent subformulas can be swapped |
| Modus ponens | ; strategy: find , prove , prove |
| Transitivity | |
| Invalid | is not a tautology (proving the claim backwards) |
| Chessboard | (i.e. ); ; |
| Chocolate | bar needs exactly breaks |
| -ary predicate | , a non-empty set (Def. 2.10) |
Source notes: where lecture and correct version differ
- L1: 101 is prime (first called false); so "" has the unknown truth value of .
- L1: truth condition of was misspoken once. Correct: true iff false or true.
- L1: : the lecturer was unsure; the script says . : case distinction in the script, doubling in the lecture.
- L2: "" as a tautology was misspoken; it is .
- L2: flatmates: the notes said “no solution”; correct is the unique solution .
- L2: is not XOR but its negation; it is already defined in the script.
- L3: the universe is a non-empty set (script); constants are in lower case.
Self-assessment questions
Question 1. For each sentence, decide (i) whether it is a well-defined mathematical statement and (ii) if so, its truth value or that it is unknown:
(a) ” is even is prime.”
(b) ” is prime is even.”
(c) “There are infinitely many twin primes is prime.”
(d) “The sentence you are reading right now is false.”
(e) ” is prime there are infinitely many twin primes.”
Solution to Question 1
(a) Well-defined. Premise false, so the implication is true (F ⇒ F).
(b) Well-defined. is not prime, so the premise is false and the implication is true. (The conclusion is also true.)
(c) Well-defined. The conclusion is true, so the implication is true no matter what the premise is, even though the premise is an open problem.
(d) Not well-defined: self-reference. If true, then false; if false, then true.
(e) Well-defined. The premise is true, so the implication’s value equals that of the twin-prime conjecture: unknown. (This is the corrected version of the lecture example.)
Question 2. Using only Lemma 2.1 plus the facts and (and lifting), prove
Solution to Question 2
First simplify the inner formula:
Replacing this subformula under the by its equivalent (equivalent subformulas may be swapped):
Check one row: . Left: . Right: .
Question 3. Let , and (flatmate example). Decide, with justification: (a) ? (b) ? (c) ? (d) Is satisfiable?
Solution to Question 3
Use the table in §4.2.
(a) No. in rows . In row , . Counterexample: .
(b) No. in rows and . In row , .
(c) Yes. only in row , where .
(d) No. is only at , so adding leaves no satisfying row. The formula is .
Question 4. (a) Prove that is not a tautology. (b) Explain why this shows that the “proof” of in §4.6 is invalid, even though each algebraic step was correct. (c) Using Lemma 2.3, what statement about is equivalent to (a)?
Solution to Question 4
(a) Take : , so , and the formula is . One falsifying assignment suffices.
(b) The “proof” had the shape: from () derive (), observe is true, conclude . That is the pattern ” and (), therefore ”. Its formula counterpart (with , ) is exactly the non-tautology from (a). The pattern can lead from a true to a false . Correct steps don’t help if the overall reasoning pattern is invalid. The proof assumed what it wanted to show.
(c) By Lemma 2.3, ” is a tautology” . So (a) is equivalent to .
Question 5. (a) Show that whenever . (b) Using only the doubling theorem and , list all for which follows. If you additionally know , can you conclude anything about ? (c) In the proof of the doubling theorem, where exactly is the hypothesis used, and why must it hold for every marked square?
Solution to Question 5
(a) If , then . So , and by the counting theorem (each L covers 3 squares, so would be needed) .
(b) . So . With (script exercise) you would also get .
tells us nothing about . The theorem has a false premise for , and a false premise makes the implication true without saying anything about the conclusion. (Also is divisible by 3, so the counting theorem doesn’t exclude it either. is listed as open in the script.)
(c) It is used four times:
- On the quadrant containing the original marked square; that square can be anywhere in the quadrant.
- On each of the three other quadrants, whose “marked” square is the centre-corner square covered by the central L.
The marked positions differ (arbitrary, or a specific corner after rotation), so we need the recipe for every possible marked square. That is exactly what says (“an arbitrary square is marked”). A weaker hypothesis such as “tileable when a corner is marked” would not cover the first quadrant.