Skip to content

Commit

Permalink
Fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickMassot committed Jul 16, 2024
1 parent ec8a7d8 commit a3506ee
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ we immediately have :math:`h(g(y))= y`, and we are done.
Once again, we encourage you to step through the proof and fill in
the missing parts.
The tactic ``cases n with n`` splits on the cases ``g y ∈ sbAux f g 0``
and ``g y ∈ sbAux f g n.succ``.
The tactic ``rcases n with _ | n`` splits on the cases ``g y ∈ sbAux f g 0``
and ``g y ∈ sbAux f g (n + 1)``.
In both cases, calling the simplifier with ``simp [sbAux]``
applies the corresponding defining equation of ``sbAux``.
BOTH: -/
Expand Down
17 changes: 10 additions & 7 deletions MIL/C05_Elementary_Number_Theory/S01_Irrational_Roots.lean
Original file line number Diff line number Diff line change
Expand Up @@ -344,12 +344,11 @@ we need to know that ``r`` is positive.
But when ``r`` is zero, the theorem below is trivial, and easily
proved by the simplifier.
So the proof is carried out in cases.
The line ``cases r with r`` replaces the goal with two versions:
The line ``rcases r with _ | r`` replaces the goal with two versions:
one in which ``r`` is replaced by ``0``,
and the other in which ``r`` is replaces by ``r.succ``,
the successor of ``r``.
and the other in which ``r`` is replaces by ``r + 1``.
In the second case, we can use the theorem ``r.succ_ne_zero``, which
establishes ``r.succ ≠ 0``.
establishes ``r + 1 ≠ 0`` (``succ`` stands for successor).
Notice also that the line that begins ``have : npow_nz`` provides a
short proof-term proof of ``n^k ≠ 0``.
Expand All @@ -359,9 +358,13 @@ and then think about how the tactics describe the proof term.
See if you can fill in the missing parts of the proof below.
At the very end, you can use ``Nat.dvd_sub'`` and ``Nat.dvd_mul_right``
to finish it off.
Note that this example does not assume that ``p`` is prime, but the
conclusion is trivial when ``p`` is not prime since ``r.factorization p``
is then zero by definition, and the proof works in all cases anyway.
BOTH: -/
-- QUOTE:
example {m n k r : ℕ} (nnz : n ≠ 0) (pow_eq : m ^ k = r * n ^ k) {p : ℕ} (prime_p : p.Prime) :
example {m n k r : ℕ} (nnz : n ≠ 0) (pow_eq : m ^ k = r * n ^ k) {p : ℕ} :
k ∣ r.factorization p := by
rcases r with _ | r
· simp
Expand All @@ -372,8 +375,8 @@ example {m n k r : ℕ} (nnz : n ≠ 0) (pow_eq : m ^ k = r * n ^ k) {p : ℕ} (
SOLUTIONS: -/
rw [factorization_pow']
-- BOTH:
have eq2 : (r.succ * n ^ k).factorization p =
k * n.factorization p + r.succ.factorization p := by
have eq2 : ((r + 1) * n ^ k).factorization p =
k * n.factorization p + (r + 1).factorization p := by
/- EXAMPLES:
sorry
SOLUTIONS: -/
Expand Down

0 comments on commit a3506ee

Please sign in to comment.