mirror of
https://github.com/tomasriveral/ZeroToLean.git
synced 2026-08-11 18:28:39 +02:00
reverse implication for some \iff
This commit is contained in:
@@ -21,20 +21,32 @@ theorem p_implies_p_or_q
|
||||
intro hp
|
||||
exact Or.inl hp
|
||||
theorem and_commutative
|
||||
: P ∧ Q → Q ∧ P := by
|
||||
intro hpq
|
||||
cases hpq with
|
||||
| intro hp hq =>
|
||||
: P ∧ Q ↔ Q ∧ P := by
|
||||
constructor
|
||||
· intro hpq
|
||||
cases hpq with
|
||||
| intro hp hq =>
|
||||
exact ⟨hq,hp⟩
|
||||
· intro hqp
|
||||
cases hqp with
|
||||
| intro hq hp =>
|
||||
exact ⟨hp,hq⟩
|
||||
|
||||
theorem or_commutative
|
||||
: P ∨ Q → Q ∨ P := by
|
||||
intro p_or_q
|
||||
cases p_or_q with
|
||||
| inl hp =>
|
||||
exact Or.inr hp
|
||||
| inr hq =>
|
||||
exact Or.inl hq
|
||||
: P ∨ Q ↔ Q ∨ P := by
|
||||
constructor
|
||||
· intro p_or_q
|
||||
cases p_or_q with
|
||||
| inl hp =>
|
||||
exact Or.inr hp
|
||||
| inr hq =>
|
||||
exact Or.inl hq
|
||||
· intro q_or_p
|
||||
cases q_or_p with
|
||||
| inl hq =>
|
||||
exact Or.inr hq
|
||||
| inr hp =>
|
||||
exact Or.inl hp
|
||||
|
||||
theorem p_imples_q_and_q_implies_r_Implies_p_implies_r
|
||||
: (P→Q) ∧ (Q→R) → (P→R) := by
|
||||
@@ -51,13 +63,20 @@ theorem double_negation
|
||||
exact hnotp hp
|
||||
|
||||
theorem and_associative
|
||||
: P ∧ (Q ∧ R) → (P ∧ Q) ∧ R := by
|
||||
intro h
|
||||
cases h with
|
||||
| intro p q_and_r =>
|
||||
cases q_and_r with
|
||||
| intro q r =>
|
||||
exact ⟨ ⟨p,q⟩,r⟩
|
||||
: P ∧ (Q ∧ R) ↔ (P ∧ Q) ∧ R := by
|
||||
constructor
|
||||
· intro h
|
||||
cases h with
|
||||
| intro p q_and_r =>
|
||||
cases q_and_r with
|
||||
| intro q r =>
|
||||
exact ⟨⟨p,q⟩,r⟩
|
||||
· intro h
|
||||
cases h with
|
||||
| intro p_and_q r =>
|
||||
cases p_and_q with
|
||||
| intro p q =>
|
||||
exact ⟨p, ⟨q,r⟩⟩
|
||||
|
||||
theorem contrapositive
|
||||
: (P → Q) → (¬Q → ¬P) := by
|
||||
|
||||
Reference in New Issue
Block a user