論理と証明
導入済み
5:38
離散数学
Discrete mathematics is the mathematics of objects you can list: statements, sets, graphs and arrangements. The first three units build the proof engine…
英語のナレーション・英語と中国語の字幕を切り替え可能
このレッスンの内容
| English | 意味 |
|---|---|
| sorted lists | |
| proposition/ˌprɒpəˈzɪʃn/ | 命題 |
| truth table/truːθ ˈteɪbl/ | 真値表 |
| contrapositive/ˌkɒntrəˈpɒzɪtɪv/ | 逆命題 |
| converse/ˈkɒnvɜːs/ | 逆命題 |
| De Morgan's laws/də ˈmɔːɡənz lɔːz/ | ド・モルガンの法則 |
| predicate logic/ˈpredɪkeɪt ˈlɒdʒɪk/ | 述語論理 |
| quantifier/ˈkwɒntɪfaɪə/ | 量詞 |
| direct proof/daɪˈrekt pruːf/ | 直接証明 |
| contraposition/ˌkɒntrəpəˈzɪʃn/ | 対偶証明 |
| proof by contradiction/pruːf baɪ ˌkɒntrəˈdɪkʃn/ | 背理法 |
Did the tester break the claim?
- A spec says: "If the list is sorted, the search returns the right index." A tester feeds in an unsorted list, gets a wrong index and files a bug: "the claim is false."
- This test does not show the claim is false. The claim only promises something about sorted lists 有序列表. This lesson makes that kind of reading exact, then turns it into proofs.
Propositions and the truth table
- A proposition 命题 is a statement that is true or false. Join them with ¬ (not), ∧ (and), ∨ (or), → (if…then) and ↔ (if and only if).
- A truth table 真值表 lists every combination of T and F for the variables, so it settles any formula. With $n$ variables there are $2^n$ rows.
| $p$ | $q$ | ${p{\land}q}$ | ${p{\lor}q}$ | ${p{\to}q}$ | ${p{\leftrightarrow}q}$ |
|---|---|---|---|---|---|
| T | T | T | T | T | T |
| T | F | F | T | F | F |
| F | T | F | T | T | F |
| F | F | F | F | T | T |
- $p \to q$ is false in one row only: $p$ true and $q$ false. When $p$ is false, the implication is true whatever $q$ is.
ある式は変数 p, q, r, s を用いる。この真値表には何行あるか。
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
各変数は T または F のいずれかであるため、$2^4 = 16$ 通りの組み合わせがある。
Reading "if p then q"
- $p \to q$ is false in one row only: $p$ true and $q$ false. When $p$ is false the claim makes no promise, so it counts as true. That is why the unsorted list broke nothing.
- $p \to q \equiv \neg p \lor q$. The contrapositive 逆否命题 $\neg q \to \neg p$ has the same truth table; the converse 逆命题 $q \to p$ does not.

"リストが並べ替えられている場合、検索は正しいインデックスを返す"という主張は、並べ替えられていないリストで誤ったインデックスが返されることで反証される。
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
p が false のとき、p → q はどのような状況でも true となる。この主張を破るのは、並べ替えられていてかつ誤ったインデックスを持つリストのみである。
p → q という主張を説明する記述に、それぞれ対応する形を結びつけよ。
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
対偶命題と ¬p ∨ q は p → q と同じ真値表を持ち、逆命題は異なる。p ∧ ¬q はその否定である。
Negation flips everything it passes
- De Morgan's laws 德摩根律: $\neg(p \land q) \equiv \neg p \lor \neg q$ and $\neg(p \lor q) \equiv \neg p \land \neg q$. The negation goes inside and the connective flips.
- Predicate logic 谓词逻辑 adds the quantifiers 量词 $\forall$ (for all) and $\exists$ (there exists). Negation swaps them and negates the predicate: $\neg\forall x\,P(x) \equiv \exists x\,\neg P(x)$.
Claim: "every email has exactly one address." Its negation: "some email has no address, or some email has two or more addresses." One email that breaks the rule is enough.
Push the negation inside
Set a and b and compare ¬(a ∧ b) with ¬a ∨ ¬b, then the OR form. The two sides agree on every row, and the naive rewrite without flipping the connective fails on a counterexample.
∀x P(x) の否定は — 。
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
反例が1つあれば十分である。否定では量詞を入れ替え、述語を否定する。
¬(p ∧ q) と同値な式はどれか。該当するものをすべて選択せよ。
難易度 2/5 · 140 コイン + 今日初回達成時の小ボーナス
ド・モルガンの法則により ¬p ∨ ¬q となる。p → ¬q を ¬p ∨ ¬q に書き換えると一致し、q → ¬p も同様である。¬p ∧ ¬q は演算子を入れ替えることを忘れている。
Three proof shapes
- Direct proof 直接证明: assume $p$ and derive $q$. Contraposition 逆否证明: prove $\neg q \to \neg p$ instead, which helps when the negatives are easier to work with.
- Proof by contradiction 反证法: assume $p \land \neg q$ and derive something impossible. Choosing the shape decides which assumptions you get to compute with.
p ∧ ¬q を仮定して矛盾を導くことは — 。
難易度 1/5 · 100 コイン + 今日初回達成時の小ボーナス
帰結法は主張の失敗を仮定し、不可能性がその失敗の非存在を示す。
Name the shape, then prove
Claim: if $n^2$ is even, then $n$ is even. "$n^2$ even" is hard to use, so prove the contrapositive 逆否命题.
Suppose $n$ is odd: $n = 2k + 1$. Then $n^2 = 4k^2 + 4k + 1 = 2(2k^2 + 2k) + 1$, which is odd. So "$n$ odd" gives "$n^2$ odd", and the claim follows.
- State the strategy in the first line ("by contraposition"), so the reader knows what you are assuming.
"n² が偶数なら n は偶数"の対偶による証明を正しい順序で並べ替えよ。
難易度 3/5 · 200 コイン + 今日初回達成時の小ボーナス
まず図形の名称を答え、次に ¬q を仮定して ¬p の結論に至る。
Marks that slip away
- Proving the converse 逆命题. Showing $q \to p$ when $p \to q$ was asked proves the wrong thing.
- Negating without flipping. $\neg(p \land q)$ is $\neg p \lor \neg q$, not $\neg p \land \neg q$.
- Examples as proof. Ten examples do not prove a "for all" claim. One counterexample does disprove it.
You've got it
- $p \to q$ is false only when $p$ is true and $q$ is false; $p \to q \equiv \neg p \lor q \equiv \neg q \to \neg p$.
- Negation flips ∧/∨ (De Morgan) and swaps $\forall$/$\exists$.
- Translate the claim, choose a shape (direct, contraposition 逆否证明, contradiction), name it, then write justified steps.
何が問題でしたか?この内容はサイトの運営チームだけが確認します。