Jump to content

Logical proof: Difference between revisions

From Wikibase
No edit summary
Migrate: wrap Proof/Solution/Example blocks in Hidden templates
Line 13: Line 13:
$$
$$


'''Example:''' Prove that for all odd integers $n$, $n^2$ is odd.
{{Hidden example}}
Prove that for all odd integers $n$, $n^2$ is odd.


Rewrite in formal language:
Rewrite in formal language:
Line 26: Line 27:
\text{Let} k_1=2k^2+k \in Z, n^2= 2k_1+1, k_1 \in Z\ \ (Q)
\text{Let} k_1=2k^2+k \in Z, n^2= 2k_1+1, k_1 \in Z\ \ (Q)
$$
$$
{{End hidden}}


== Proof by contrapositive ==
== Proof by contrapositive ==
Line 37: Line 39:
$$
$$


'''Example:'''Prove that for integers $a$ and $b$, if $a+b$ is odd, then either $a$ is odd or $b$ is odd, but not both.
{{Hidden example}}
Prove that for integers $a$ and $b$, if $a+b$ is odd, then either $a$ is odd or $b$ is odd, but not both.


Rewrite in formal language:
Rewrite in formal language:
Line 75: Line 78:
   
   
We have since proven that $\neg Q \implies \neg P$, hence by logical equivalence $P \implies Q$, i.e., for integers $a$ and $b$, if $a+b$ is odd, then either $a$ is odd or $b$ is odd, but not both.
We have since proven that $\neg Q \implies \neg P$, hence by logical equivalence $P \implies Q$, i.e., for integers $a$ and $b$, if $a+b$ is odd, then either $a$ is odd or $b$ is odd, but not both.
{{End hidden}}


== Proof by contradiction ==
== Proof by contradiction ==
Line 86: Line 90:
$$
$$


'''Example:''' Prove the pigeon hole principle - if more than $n$ pigeons fly into $n$ pigeon holes, then there is at least one hole with at least 2 pigeons.
{{Hidden example}}
Prove the pigeon hole principle - if more than $n$ pigeons fly into $n$ pigeon holes, then there is at least one hole with at least 2 pigeons.


Formalise the statements:
Formalise the statements:
Line 106: Line 111:
\therefore P
\therefore P
$$
$$
{{End hidden}}


== Disproof by counter-example ==
== Disproof by counter-example ==
Line 111: Line 117:
Any number of examples cannot suffice as logical proof. However, a counter-example is adequate to prove that a general statement is not true.
Any number of examples cannot suffice as logical proof. However, a counter-example is adequate to prove that a general statement is not true.


'''Example:'''Are all life in sea fishes?
{{Hidden example}}
Are all life in sea fishes?


Rewrite in formal language:
Rewrite in formal language:
Line 137: Line 144:
x = \text{whales}, x \in \text{sea life}, x \notin \text{fish}
x = \text{whales}, x \in \text{sea life}, x \notin \text{fish}
$$
$$
{{End hidden}}


== Proof by case ==
== Proof by case ==
Line 147: Line 155:
$$
$$


'''Example''': Prove that for any integer $n$, $(n^3-n)$ is even.
{{Hidden example}}
Prove that for any integer $n$, $(n^3-n)$ is even.


Rewrite in formal language:
Rewrite in formal language:
Line 179: Line 188:


Hence $Q$.
Hence $Q$.
{{End hidden}}


== Natural-formal language translation via equivalent statements ==
== Natural-formal language translation via equivalent statements ==
Line 186: Line 196:
Sometimes, this requires first rewriting a statement $P$ with equivalent statement $Q$ where $P \iff Q$.
Sometimes, this requires first rewriting a statement $P$ with equivalent statement $Q$ where $P \iff Q$.


'''Example:''' Prove there are an infinite number of prime numbers.
{{Hidden example}}
Prove there are an infinite number of prime numbers.


P (desired conclusion): There are an infinite number of prime numbers
P (desired conclusion): There are an infinite number of prime numbers
Line 211: Line 222:


Since $P \iff Q$, therefore $P$: there are an infinite number of prime numbers.
Since $P \iff Q$, therefore $P$: there are an infinite number of prime numbers.
{{End hidden}}

Revision as of 06:41, 18 October 2026

Languages: English · français · Esperanto

Logical proof is the process of applying logic to prove whether a statement is true or false.

Direct proof

Direct proof consists of identifying a set of true premises, and derive the conclusion based on logical combination and manipulation of those premises.[1] It is the formal equivalent of an argument.

To prove $Q$, identify true statement(s) $P$ as premises, then prove $P \implies Q$.

In formal language:

$$ P \land (P \implies Q) \implies Q $$

Proof by contrapositive

To prove $P \implies Q$, prove $\neg Q \implies \neg P$.

In formal language:

$$ P \implies Q \iff \neg Q \implies \neg P $$

Proof by contradiction

To prove $P$, prove $(\neg P \implies Q) \land \neg Q$

In formal language:

$$ (\neg P \implies Q) \land \neg Q \implies P $$

Disproof by counter-example

Any number of examples cannot suffice as logical proof. However, a counter-example is adequate to prove that a general statement is not true.

Proof by case

To prove $Q$, proves that at least one of $\{P_1,P_2,...,P_n\}$ is true, and $\forall k \in \{1,2,...,n\}, P_k \implies Q$

In formal language: $$ (P_1 \lor P_2 \lor ... \lor P_n) \land (\forall k \in \{1,2,...,n\}, P_k \implies Q) \implies Q $$

Natural-formal language translation via equivalent statements

The first and highly essential step of constructing formal logic proofs is the translation of natural language statements into formal language.

Sometimes, this requires first rewriting a statement $P$ with equivalent statement $Q$ where $P \iff Q$.