Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .solutions/10_tactics/tactics2.lean
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,9 @@ theorem and_swap (P Q : Prop) (h : P ∧ Q) : Q ∧ P := by
constructor
· exact h.right
· exact h.left

theorem and_map (P Q R : Prop) (h : P ∧ Q) (f : Q → R) : P ∧ R := by
constructor
· exact h.left
· apply f
exact h.right
6 changes: 5 additions & 1 deletion exercises/10_tactics/tactics2.lean
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ theorem and_intro (P Q : Prop) (hp : P) (hq : Q) : P ∧ Q := by
-- For the next theorem, you can access parts of `h : P ∧ Q`
-- using `h.left` (or `h.1`) and `h.right` (or `h.2`).

-- Combine constructor and apply
-- Use constructor and the .left/.right accessors together
theorem and_swap (P Q : Prop) (h : P ∧ Q) : Q ∧ P := by
sorry

-- Combine constructor and apply
theorem and_map (P Q R : Prop) (h : P ∧ Q) (f : Q → R) : P ∧ R := by
sorry
Loading