> For the complete documentation index, see [llms.txt](https://mvdd188.gitbook.io/cs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mvdd188.gitbook.io/cs/san/logic-and-proofs-2-5.md).

# Logic and proofs(2/5)

## A compound proposition is always true or false

* tautology(always true)
* contradiction(always false)

注意一定要複合陳述

Ex:&#x20;

(1) tautology

* p or \~p

(2) contradiction

* p and \~p

## Def: Logic Equivalence

two compound propositions p and q are called logical equivalent,&#x20;

if p <--> is a tautology

當p ≡ q， p = true, q = true;  p = false, q = false

則 p <--> q is a tautology

if and only if 的 truth table

## Demorgan' s Law

以truth table 驗證

## **結合率，交換率**

Ex:&#x20;

* p and (q or r) ≡ (p and q) or (p and r)

&#x20;       比較特別的是在數的四則運算，乘法對加法滿足分配律，

&#x20;        X(Y + Z) = XY + XZ，但反之

**而Logic operator 內 or 跟 and 地位是一樣的，這邊比較不一樣所以**

* p or (q and r) ≡ (p or q) and (p or r)

![](/files/-LZT4qWcPoQB3WPm8ZM2)

## 重要的要記的，最基本的

![](/files/-LZT5hg9yjFiuzua9ErJ)

![](/files/-LZT6SGgbZHvTfFySpAQ)

## Algebra operation

## Truth table 可以拿來證明， 相對的Algebra 的運算也可以拿來推演。

Show p ^ q --> p v q is tautology


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://mvdd188.gitbook.io/cs/san/logic-and-proofs-2-5.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
