Skip to content

Commit c1fe976

Browse files
rwstmo271
andauthored
Ch01: add lemma for proof 4 (#53)
* add lemma for proof 4 Co-authored-by: Moritz Firsching <[email protected]>
1 parent d489678 commit c1fe976

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

FormalBook/Ch01_Six_proofs_of_the_infinity_of_primes.lean

+21-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
See the License for the specific language governing permissions and
1414
limitations under the License.
1515
16-
Authors: Moritz Firsching
16+
Authors: Moritz Firsching, Ralf Stephan
1717
-/
1818
import Mathlib.NumberTheory.LucasLehmer
1919
import Mathlib.NumberTheory.PrimeCounting
@@ -224,6 +224,26 @@ lemma H_P4_1 {k p: ℝ} (hk: k > 0) (hp: p ≥ k + 1): p / (p - 1) ≤ (k + 1) /
224224
one_div_le_one_div h_p_pred_pos hk, @le_sub_iff_add_le]
225225
exact hp
226226

227+
lemma prod_Icc_succ_div (n : ℕ) (hn : 2 ≤ n) : (∏ x in Icc 1 n, ((x + 1) : ℝ) / x) = n + 1 := by
228+
rw [← Nat.Ico_succ_right]
229+
induction' n with n h
230+
· simp
231+
· rw [Finset.prod_Ico_succ_top <| Nat.le_add_left 1 n]
232+
norm_num
233+
cases' lt_or_ge n 2 with _ h2
234+
· interval_cases n
235+
· tauto
236+
· norm_num
237+
specialize h h2
238+
field_simp [Finset.prod_eq_zero_iff] at h ⊢
239+
rw [h]
240+
ring
241+
242+
lemma H_P4_2 (hx : x ≥ 3) (hpi3 : (π 3) = 2) : (∏ x in Icc 1 (π x), ((x + 1) : ℝ) / x) = (π x) + 1 := by
243+
rw [prod_Icc_succ_div]
244+
rw [← hpi3]
245+
refine Monotone.imp monotone_primeCounting ?h
246+
linarith
227247

228248
/-!
229249
### Fifth proof

0 commit comments

Comments
 (0)