/-
Copyright 2026 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/
import FormalConjecturesUtilNearest integer to $n/\sqrt{2}$
Nearest integer to $n/\sqrt{2}$, defined by $\lfloor n/\sqrt{2} + 1/2 \rfloor$.
References:
namespace OeisA49473Nearest integer to $n/\sqrt{2}$.
noncomputable def a (n : ℕ) : ℕ :=
(Int.floor ((n : ℝ) / Real.sqrt 2 + 1 / 2)).toNath:↑0 / √2 + 1 / 2 = 1 / 2hf:⌊1 / 2⌋ = 0⊢ Int.toNat 0 = 0
rfl All goals completed! 🐙
@[category test, AMS 11]
theorem a_1 : a 1 = 1 := by ⊢ a 1 = 1
unfold a ⊢ ⌊↑1 / √2 + 1 / 2⌋.toNat = 1
have h1 : ((1 : ℕ) : ℝ) = 1 := by ⊢ a 1 = 1 h1:↑1 = 1⊢ ⌊↑1 / √2 + 1 / 2⌋.toNat = 1 norm_num h1:↑1 = 1⊢ ⌊↑1 / √2 + 1 / 2⌋.toNat = 1 h1:↑1 = 1⊢ ⌊↑1 / √2 + 1 / 2⌋.toNat = 1
rw [h1 h1:↑1 = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1 h1:↑1 = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1] h1:↑1 = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1
have h_sqrt_pos : 0 < Real.sqrt 2 := Real.sqrt_pos.mpr (by h1:↑1 = 1⊢ 0 < 2 h1:↑1 = 1h_sqrt_pos:0 < √2⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1 norm_num All goals completed! 🐙 h1:↑1 = 1h_sqrt_pos:0 < √2⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1) h1:↑1 = 1h_sqrt_pos:0 < √2⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1
have hf : Int.floor ((1 : ℝ) / Real.sqrt 2 + 1 / 2) = 1 := by ⊢ a 1 = 1 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1
rw [Int.floor_eq_iff h1:↑1 = 1h_sqrt_pos:0 < √2⊢ ↑1 ≤ 1 / √2 + 1 / 2 ∧ 1 / √2 + 1 / 2 < ↑1 + 1 h1:↑1 = 1h_sqrt_pos:0 < √2⊢ ↑1 ≤ 1 / √2 + 1 / 2 ∧ 1 / √2 + 1 / 2 < ↑1 + 1 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1] h1:↑1 = 1h_sqrt_pos:0 < √2⊢ ↑1 ≤ 1 / √2 + 1 / 2 ∧ 1 / √2 + 1 / 2 < ↑1 + 1 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1
constructor left h1:↑1 = 1h_sqrt_pos:0 < √2⊢ ↑1 ≤ 1 / √2 + 1 / 2right h1:↑1 = 1h_sqrt_pos:0 < √2⊢ 1 / √2 + 1 / 2 < ↑1 + 1 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1
· left h1:↑1 = 1h_sqrt_pos:0 < √2⊢ ↑1 ≤ 1 / √2 + 1 / 2 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1 have hle : Real.sqrt 2 ≤ 2 := (Real.sqrt_le_iff.mpr ⟨by h1:↑1 = 1h_sqrt_pos:0 < √2⊢ 0 ≤ 2 left h1:↑1 = 1h_sqrt_pos:0 < √2hle:√2 ≤ 2⊢ ↑1 ≤ 1 / √2 + 1 / 2 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1 norm_num All goals completed! 🐙left h1:↑1 = 1h_sqrt_pos:0 < √2hle:√2 ≤ 2⊢ ↑1 ≤ 1 / √2 + 1 / 2 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1, by h1:↑1 = 1h_sqrt_pos:0 < √2⊢ 2 ≤ 2 ^ 2left h1:↑1 = 1h_sqrt_pos:0 < √2hle:√2 ≤ 2⊢ ↑1 ≤ 1 / √2 + 1 / 2 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1 norm_num All goals completed! 🐙left h1:↑1 = 1h_sqrt_pos:0 < √2hle:√2 ≤ 2⊢ ↑1 ≤ 1 / √2 + 1 / 2 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1⟩)left h1:↑1 = 1h_sqrt_pos:0 < √2hle:√2 ≤ 2⊢ ↑1 ≤ 1 / √2 + 1 / 2 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1
have : (1 / 2 : ℝ) ≤ 1 / Real.sqrt 2 := by ⊢ a 1 = 1 left h1:↑1 = 1h_sqrt_pos:0 < √2hle:√2 ≤ 2this:1 / 2 ≤ 1 / √2⊢ ↑1 ≤ 1 / √2 + 1 / 2 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1
rw [div_le_div_iff₀ (by h1:↑1 = 1h_sqrt_pos:0 < √2hle:√2 ≤ 2⊢ 0 < 2 h1:↑1 = 1h_sqrt_pos:0 < √2hle:√2 ≤ 2⊢ 1 * √2 ≤ 1 * 2left h1:↑1 = 1h_sqrt_pos:0 < √2hle:√2 ≤ 2this:1 / 2 ≤ 1 / √2⊢ ↑1 ≤ 1 / √2 + 1 / 2 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1 norm_num All goals completed! 🐙 h1:↑1 = 1h_sqrt_pos:0 < √2hle:√2 ≤ 2⊢ 1 * √2 ≤ 1 * 2left h1:↑1 = 1h_sqrt_pos:0 < √2hle:√2 ≤ 2this:1 / 2 ≤ 1 / √2⊢ ↑1 ≤ 1 / √2 + 1 / 2 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1) h_sqrt_pos] h1:↑1 = 1h_sqrt_pos:0 < √2hle:√2 ≤ 2⊢ 1 * √2 ≤ 1 * 2left h1:↑1 = 1h_sqrt_pos:0 < √2hle:√2 ≤ 2this:1 / 2 ≤ 1 / √2⊢ ↑1 ≤ 1 / √2 + 1 / 2 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1
linarithleft h1:↑1 = 1h_sqrt_pos:0 < √2hle:√2 ≤ 2this:1 / 2 ≤ 1 / √2⊢ ↑1 ≤ 1 / √2 + 1 / 2 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1left h1:↑1 = 1h_sqrt_pos:0 < √2hle:√2 ≤ 2this:1 / 2 ≤ 1 / √2⊢ ↑1 ≤ 1 / √2 + 1 / 2 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1
linarith All goals completed! 🐙 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1
· right h1:↑1 = 1h_sqrt_pos:0 < √2⊢ 1 / √2 + 1 / 2 < ↑1 + 1 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1 have hlt : (2 / 3 : ℝ) < Real.sqrt 2 := by ⊢ a 1 = 1 right h1:↑1 = 1h_sqrt_pos:0 < √2hlt:2 / 3 < √2⊢ 1 / √2 + 1 / 2 < ↑1 + 1 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1
rw [Real.lt_sqrt (by h1:↑1 = 1h_sqrt_pos:0 < √2⊢ 0 ≤ 2 / 3 h1:↑1 = 1h_sqrt_pos:0 < √2⊢ (2 / 3) ^ 2 < 2right h1:↑1 = 1h_sqrt_pos:0 < √2hlt:2 / 3 < √2⊢ 1 / √2 + 1 / 2 < ↑1 + 1 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1 norm_num All goals completed! 🐙 h1:↑1 = 1h_sqrt_pos:0 < √2⊢ (2 / 3) ^ 2 < 2right h1:↑1 = 1h_sqrt_pos:0 < √2hlt:2 / 3 < √2⊢ 1 / √2 + 1 / 2 < ↑1 + 1 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1)] h1:↑1 = 1h_sqrt_pos:0 < √2⊢ (2 / 3) ^ 2 < 2right h1:↑1 = 1h_sqrt_pos:0 < √2hlt:2 / 3 < √2⊢ 1 / √2 + 1 / 2 < ↑1 + 1 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1
norm_numright h1:↑1 = 1h_sqrt_pos:0 < √2hlt:2 / 3 < √2⊢ 1 / √2 + 1 / 2 < ↑1 + 1 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1right h1:↑1 = 1h_sqrt_pos:0 < √2hlt:2 / 3 < √2⊢ 1 / √2 + 1 / 2 < ↑1 + 1 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1
have : 1 / Real.sqrt 2 < (3 / 2 : ℝ) := by ⊢ a 1 = 1 right h1:↑1 = 1h_sqrt_pos:0 < √2hlt:2 / 3 < √2this:1 / √2 < 3 / 2⊢ 1 / √2 + 1 / 2 < ↑1 + 1 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1
rw [div_lt_iff₀ h_sqrt_pos h1:↑1 = 1h_sqrt_pos:0 < √2hlt:2 / 3 < √2⊢ 1 < 3 / 2 * √2 h1:↑1 = 1h_sqrt_pos:0 < √2hlt:2 / 3 < √2⊢ 1 < 3 / 2 * √2right h1:↑1 = 1h_sqrt_pos:0 < √2hlt:2 / 3 < √2this:1 / √2 < 3 / 2⊢ 1 / √2 + 1 / 2 < ↑1 + 1 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1] h1:↑1 = 1h_sqrt_pos:0 < √2hlt:2 / 3 < √2⊢ 1 < 3 / 2 * √2right h1:↑1 = 1h_sqrt_pos:0 < √2hlt:2 / 3 < √2this:1 / √2 < 3 / 2⊢ 1 / √2 + 1 / 2 < ↑1 + 1 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1
linarithright h1:↑1 = 1h_sqrt_pos:0 < √2hlt:2 / 3 < √2this:1 / √2 < 3 / 2⊢ 1 / √2 + 1 / 2 < ↑1 + 1 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1right h1:↑1 = 1h_sqrt_pos:0 < √2hlt:2 / 3 < √2this:1 / √2 < 3 / 2⊢ 1 / √2 + 1 / 2 < ↑1 + 1 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1
linarith h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ ⌊1 / √2 + 1 / 2⌋.toNat = 1
rw [hf h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ Int.toNat 1 = 1 h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ Int.toNat 1 = 1] h1:↑1 = 1h_sqrt_pos:0 < √2hf:⌊1 / √2 + 1 / 2⌋ = 1⊢ Int.toNat 1 = 1
rfl All goals completed! 🐙
@[category test, AMS 11]
theorem a_2 : a 2 = 1 := by ⊢ a 2 = 1
unfold a ⊢ ⌊↑2 / √2 + 1 / 2⌋.toNat = 1
have h2 : ((2 : ℕ) : ℝ) = 2 := by ⊢ a 2 = 1 h2:↑2 = 2⊢ ⌊↑2 / √2 + 1 / 2⌋.toNat = 1 norm_num h2:↑2 = 2⊢ ⌊↑2 / √2 + 1 / 2⌋.toNat = 1 h2:↑2 = 2⊢ ⌊↑2 / √2 + 1 / 2⌋.toNat = 1
rw [h2 h2:↑2 = 2⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1 h2:↑2 = 2⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1] h2:↑2 = 2⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1
have h_sqrt_pos : 0 < Real.sqrt 2 := Real.sqrt_pos.mpr (by h2:↑2 = 2⊢ 0 < 2 h2:↑2 = 2h_sqrt_pos:0 < √2⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1 norm_num All goals completed! 🐙 h2:↑2 = 2h_sqrt_pos:0 < √2⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1) h2:↑2 = 2h_sqrt_pos:0 < √2⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1
have hf : Int.floor ((2 : ℝ) / Real.sqrt 2 + 1 / 2) = 1 := by ⊢ a 2 = 1 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1
rw [Int.floor_eq_iff h2:↑2 = 2h_sqrt_pos:0 < √2⊢ ↑1 ≤ 2 / √2 + 1 / 2 ∧ 2 / √2 + 1 / 2 < ↑1 + 1 h2:↑2 = 2h_sqrt_pos:0 < √2⊢ ↑1 ≤ 2 / √2 + 1 / 2 ∧ 2 / √2 + 1 / 2 < ↑1 + 1 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1] h2:↑2 = 2h_sqrt_pos:0 < √2⊢ ↑1 ≤ 2 / √2 + 1 / 2 ∧ 2 / √2 + 1 / 2 < ↑1 + 1 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1
constructor left h2:↑2 = 2h_sqrt_pos:0 < √2⊢ ↑1 ≤ 2 / √2 + 1 / 2right h2:↑2 = 2h_sqrt_pos:0 < √2⊢ 2 / √2 + 1 / 2 < ↑1 + 1 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1
· left h2:↑2 = 2h_sqrt_pos:0 < √2⊢ ↑1 ≤ 2 / √2 + 1 / 2 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1 have hle : Real.sqrt 2 ≤ 4 := (Real.sqrt_le_iff.mpr ⟨by h2:↑2 = 2h_sqrt_pos:0 < √2⊢ 0 ≤ 4 left h2:↑2 = 2h_sqrt_pos:0 < √2hle:√2 ≤ 4⊢ ↑1 ≤ 2 / √2 + 1 / 2 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1 norm_num All goals completed! 🐙left h2:↑2 = 2h_sqrt_pos:0 < √2hle:√2 ≤ 4⊢ ↑1 ≤ 2 / √2 + 1 / 2 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1, by h2:↑2 = 2h_sqrt_pos:0 < √2⊢ 2 ≤ 4 ^ 2left h2:↑2 = 2h_sqrt_pos:0 < √2hle:√2 ≤ 4⊢ ↑1 ≤ 2 / √2 + 1 / 2 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1 norm_num All goals completed! 🐙left h2:↑2 = 2h_sqrt_pos:0 < √2hle:√2 ≤ 4⊢ ↑1 ≤ 2 / √2 + 1 / 2 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1⟩)left h2:↑2 = 2h_sqrt_pos:0 < √2hle:√2 ≤ 4⊢ ↑1 ≤ 2 / √2 + 1 / 2 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1
have : (1 / 2 : ℝ) ≤ 2 / Real.sqrt 2 := by ⊢ a 2 = 1 left h2:↑2 = 2h_sqrt_pos:0 < √2hle:√2 ≤ 4this:1 / 2 ≤ 2 / √2⊢ ↑1 ≤ 2 / √2 + 1 / 2 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1
rw [div_le_div_iff₀ (by h2:↑2 = 2h_sqrt_pos:0 < √2hle:√2 ≤ 4⊢ 0 < 2 h2:↑2 = 2h_sqrt_pos:0 < √2hle:√2 ≤ 4⊢ 1 * √2 ≤ 2 * 2left h2:↑2 = 2h_sqrt_pos:0 < √2hle:√2 ≤ 4this:1 / 2 ≤ 2 / √2⊢ ↑1 ≤ 2 / √2 + 1 / 2 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1 norm_num All goals completed! 🐙 h2:↑2 = 2h_sqrt_pos:0 < √2hle:√2 ≤ 4⊢ 1 * √2 ≤ 2 * 2left h2:↑2 = 2h_sqrt_pos:0 < √2hle:√2 ≤ 4this:1 / 2 ≤ 2 / √2⊢ ↑1 ≤ 2 / √2 + 1 / 2 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1) h_sqrt_pos] h2:↑2 = 2h_sqrt_pos:0 < √2hle:√2 ≤ 4⊢ 1 * √2 ≤ 2 * 2left h2:↑2 = 2h_sqrt_pos:0 < √2hle:√2 ≤ 4this:1 / 2 ≤ 2 / √2⊢ ↑1 ≤ 2 / √2 + 1 / 2 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1
linarithleft h2:↑2 = 2h_sqrt_pos:0 < √2hle:√2 ≤ 4this:1 / 2 ≤ 2 / √2⊢ ↑1 ≤ 2 / √2 + 1 / 2 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1left h2:↑2 = 2h_sqrt_pos:0 < √2hle:√2 ≤ 4this:1 / 2 ≤ 2 / √2⊢ ↑1 ≤ 2 / √2 + 1 / 2 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1
linarith All goals completed! 🐙 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1
· right h2:↑2 = 2h_sqrt_pos:0 < √2⊢ 2 / √2 + 1 / 2 < ↑1 + 1 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1 have hlt : (4 / 3 : ℝ) < Real.sqrt 2 := by ⊢ a 2 = 1 right h2:↑2 = 2h_sqrt_pos:0 < √2hlt:4 / 3 < √2⊢ 2 / √2 + 1 / 2 < ↑1 + 1 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1
rw [Real.lt_sqrt (by h2:↑2 = 2h_sqrt_pos:0 < √2⊢ 0 ≤ 4 / 3 h2:↑2 = 2h_sqrt_pos:0 < √2⊢ (4 / 3) ^ 2 < 2right h2:↑2 = 2h_sqrt_pos:0 < √2hlt:4 / 3 < √2⊢ 2 / √2 + 1 / 2 < ↑1 + 1 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1 norm_num All goals completed! 🐙 h2:↑2 = 2h_sqrt_pos:0 < √2⊢ (4 / 3) ^ 2 < 2right h2:↑2 = 2h_sqrt_pos:0 < √2hlt:4 / 3 < √2⊢ 2 / √2 + 1 / 2 < ↑1 + 1 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1)] h2:↑2 = 2h_sqrt_pos:0 < √2⊢ (4 / 3) ^ 2 < 2right h2:↑2 = 2h_sqrt_pos:0 < √2hlt:4 / 3 < √2⊢ 2 / √2 + 1 / 2 < ↑1 + 1 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1
norm_numright h2:↑2 = 2h_sqrt_pos:0 < √2hlt:4 / 3 < √2⊢ 2 / √2 + 1 / 2 < ↑1 + 1 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1right h2:↑2 = 2h_sqrt_pos:0 < √2hlt:4 / 3 < √2⊢ 2 / √2 + 1 / 2 < ↑1 + 1 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1
have : 2 / Real.sqrt 2 < (3 / 2 : ℝ) := by ⊢ a 2 = 1 right h2:↑2 = 2h_sqrt_pos:0 < √2hlt:4 / 3 < √2this:2 / √2 < 3 / 2⊢ 2 / √2 + 1 / 2 < ↑1 + 1 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1
rw [div_lt_iff₀ h_sqrt_pos h2:↑2 = 2h_sqrt_pos:0 < √2hlt:4 / 3 < √2⊢ 2 < 3 / 2 * √2 h2:↑2 = 2h_sqrt_pos:0 < √2hlt:4 / 3 < √2⊢ 2 < 3 / 2 * √2right h2:↑2 = 2h_sqrt_pos:0 < √2hlt:4 / 3 < √2this:2 / √2 < 3 / 2⊢ 2 / √2 + 1 / 2 < ↑1 + 1 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1] h2:↑2 = 2h_sqrt_pos:0 < √2hlt:4 / 3 < √2⊢ 2 < 3 / 2 * √2right h2:↑2 = 2h_sqrt_pos:0 < √2hlt:4 / 3 < √2this:2 / √2 < 3 / 2⊢ 2 / √2 + 1 / 2 < ↑1 + 1 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1
linarithright h2:↑2 = 2h_sqrt_pos:0 < √2hlt:4 / 3 < √2this:2 / √2 < 3 / 2⊢ 2 / √2 + 1 / 2 < ↑1 + 1 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1right h2:↑2 = 2h_sqrt_pos:0 < √2hlt:4 / 3 < √2this:2 / √2 < 3 / 2⊢ 2 / √2 + 1 / 2 < ↑1 + 1 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1
linarith h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ ⌊2 / √2 + 1 / 2⌋.toNat = 1
rw [hf h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ Int.toNat 1 = 1 h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ Int.toNat 1 = 1] h2:↑2 = 2h_sqrt_pos:0 < √2hf:⌊2 / √2 + 1 / 2⌋ = 1⊢ Int.toNat 1 = 1
rfl All goals completed! 🐙
@[category test, AMS 11]
theorem a_3 : a 3 = 2 := by ⊢ a 3 = 2
unfold a ⊢ ⌊↑3 / √2 + 1 / 2⌋.toNat = 2
have h3 : ((3 : ℕ) : ℝ) = 3 := by ⊢ a 3 = 2 h3:↑3 = 3⊢ ⌊↑3 / √2 + 1 / 2⌋.toNat = 2 norm_num h3:↑3 = 3⊢ ⌊↑3 / √2 + 1 / 2⌋.toNat = 2 h3:↑3 = 3⊢ ⌊↑3 / √2 + 1 / 2⌋.toNat = 2
rw [h3 h3:↑3 = 3⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2 h3:↑3 = 3⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2] h3:↑3 = 3⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2
have h_sqrt_pos : 0 < Real.sqrt 2 := Real.sqrt_pos.mpr (by h3:↑3 = 3⊢ 0 < 2 h3:↑3 = 3h_sqrt_pos:0 < √2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2 norm_num All goals completed! 🐙 h3:↑3 = 3h_sqrt_pos:0 < √2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2) h3:↑3 = 3h_sqrt_pos:0 < √2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2
have hf : Int.floor ((3 : ℝ) / Real.sqrt 2 + 1 / 2) = 2 := by ⊢ a 3 = 2 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2
rw [Int.floor_eq_iff h3:↑3 = 3h_sqrt_pos:0 < √2⊢ ↑2 ≤ 3 / √2 + 1 / 2 ∧ 3 / √2 + 1 / 2 < ↑2 + 1 h3:↑3 = 3h_sqrt_pos:0 < √2⊢ ↑2 ≤ 3 / √2 + 1 / 2 ∧ 3 / √2 + 1 / 2 < ↑2 + 1 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2] h3:↑3 = 3h_sqrt_pos:0 < √2⊢ ↑2 ≤ 3 / √2 + 1 / 2 ∧ 3 / √2 + 1 / 2 < ↑2 + 1 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2
constructor left h3:↑3 = 3h_sqrt_pos:0 < √2⊢ ↑2 ≤ 3 / √2 + 1 / 2right h3:↑3 = 3h_sqrt_pos:0 < √2⊢ 3 / √2 + 1 / 2 < ↑2 + 1 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2
· left h3:↑3 = 3h_sqrt_pos:0 < √2⊢ ↑2 ≤ 3 / √2 + 1 / 2 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2 have hle : Real.sqrt 2 ≤ 2 := (Real.sqrt_le_iff.mpr ⟨by h3:↑3 = 3h_sqrt_pos:0 < √2⊢ 0 ≤ 2 left h3:↑3 = 3h_sqrt_pos:0 < √2hle:√2 ≤ 2⊢ ↑2 ≤ 3 / √2 + 1 / 2 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2 norm_num All goals completed! 🐙left h3:↑3 = 3h_sqrt_pos:0 < √2hle:√2 ≤ 2⊢ ↑2 ≤ 3 / √2 + 1 / 2 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2, by h3:↑3 = 3h_sqrt_pos:0 < √2⊢ 2 ≤ 2 ^ 2left h3:↑3 = 3h_sqrt_pos:0 < √2hle:√2 ≤ 2⊢ ↑2 ≤ 3 / √2 + 1 / 2 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2 norm_num All goals completed! 🐙left h3:↑3 = 3h_sqrt_pos:0 < √2hle:√2 ≤ 2⊢ ↑2 ≤ 3 / √2 + 1 / 2 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2⟩)left h3:↑3 = 3h_sqrt_pos:0 < √2hle:√2 ≤ 2⊢ ↑2 ≤ 3 / √2 + 1 / 2 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2
have : (3 / 2 : ℝ) ≤ 3 / Real.sqrt 2 := by ⊢ a 3 = 2 left h3:↑3 = 3h_sqrt_pos:0 < √2hle:√2 ≤ 2this:3 / 2 ≤ 3 / √2⊢ ↑2 ≤ 3 / √2 + 1 / 2 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2
rw [div_le_div_iff₀ (by h3:↑3 = 3h_sqrt_pos:0 < √2hle:√2 ≤ 2⊢ 0 < 2 h3:↑3 = 3h_sqrt_pos:0 < √2hle:√2 ≤ 2⊢ 3 * √2 ≤ 3 * 2left h3:↑3 = 3h_sqrt_pos:0 < √2hle:√2 ≤ 2this:3 / 2 ≤ 3 / √2⊢ ↑2 ≤ 3 / √2 + 1 / 2 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2 norm_num All goals completed! 🐙 h3:↑3 = 3h_sqrt_pos:0 < √2hle:√2 ≤ 2⊢ 3 * √2 ≤ 3 * 2left h3:↑3 = 3h_sqrt_pos:0 < √2hle:√2 ≤ 2this:3 / 2 ≤ 3 / √2⊢ ↑2 ≤ 3 / √2 + 1 / 2 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2) h_sqrt_pos] h3:↑3 = 3h_sqrt_pos:0 < √2hle:√2 ≤ 2⊢ 3 * √2 ≤ 3 * 2left h3:↑3 = 3h_sqrt_pos:0 < √2hle:√2 ≤ 2this:3 / 2 ≤ 3 / √2⊢ ↑2 ≤ 3 / √2 + 1 / 2 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2
linarithleft h3:↑3 = 3h_sqrt_pos:0 < √2hle:√2 ≤ 2this:3 / 2 ≤ 3 / √2⊢ ↑2 ≤ 3 / √2 + 1 / 2 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2left h3:↑3 = 3h_sqrt_pos:0 < √2hle:√2 ≤ 2this:3 / 2 ≤ 3 / √2⊢ ↑2 ≤ 3 / √2 + 1 / 2 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2
linarith All goals completed! 🐙 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2
· right h3:↑3 = 3h_sqrt_pos:0 < √2⊢ 3 / √2 + 1 / 2 < ↑2 + 1 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2 have hlt : (6 / 5 : ℝ) < Real.sqrt 2 := by ⊢ a 3 = 2 right h3:↑3 = 3h_sqrt_pos:0 < √2hlt:6 / 5 < √2⊢ 3 / √2 + 1 / 2 < ↑2 + 1 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2
rw [Real.lt_sqrt (by h3:↑3 = 3h_sqrt_pos:0 < √2⊢ 0 ≤ 6 / 5 h3:↑3 = 3h_sqrt_pos:0 < √2⊢ (6 / 5) ^ 2 < 2right h3:↑3 = 3h_sqrt_pos:0 < √2hlt:6 / 5 < √2⊢ 3 / √2 + 1 / 2 < ↑2 + 1 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2 norm_num All goals completed! 🐙 h3:↑3 = 3h_sqrt_pos:0 < √2⊢ (6 / 5) ^ 2 < 2right h3:↑3 = 3h_sqrt_pos:0 < √2hlt:6 / 5 < √2⊢ 3 / √2 + 1 / 2 < ↑2 + 1 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2)] h3:↑3 = 3h_sqrt_pos:0 < √2⊢ (6 / 5) ^ 2 < 2right h3:↑3 = 3h_sqrt_pos:0 < √2hlt:6 / 5 < √2⊢ 3 / √2 + 1 / 2 < ↑2 + 1 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2
norm_numright h3:↑3 = 3h_sqrt_pos:0 < √2hlt:6 / 5 < √2⊢ 3 / √2 + 1 / 2 < ↑2 + 1 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2right h3:↑3 = 3h_sqrt_pos:0 < √2hlt:6 / 5 < √2⊢ 3 / √2 + 1 / 2 < ↑2 + 1 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2
have : 3 / Real.sqrt 2 < (5 / 2 : ℝ) := by ⊢ a 3 = 2 right h3:↑3 = 3h_sqrt_pos:0 < √2hlt:6 / 5 < √2this:3 / √2 < 5 / 2⊢ 3 / √2 + 1 / 2 < ↑2 + 1 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2
rw [div_lt_iff₀ h_sqrt_pos h3:↑3 = 3h_sqrt_pos:0 < √2hlt:6 / 5 < √2⊢ 3 < 5 / 2 * √2 h3:↑3 = 3h_sqrt_pos:0 < √2hlt:6 / 5 < √2⊢ 3 < 5 / 2 * √2right h3:↑3 = 3h_sqrt_pos:0 < √2hlt:6 / 5 < √2this:3 / √2 < 5 / 2⊢ 3 / √2 + 1 / 2 < ↑2 + 1 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2] h3:↑3 = 3h_sqrt_pos:0 < √2hlt:6 / 5 < √2⊢ 3 < 5 / 2 * √2right h3:↑3 = 3h_sqrt_pos:0 < √2hlt:6 / 5 < √2this:3 / √2 < 5 / 2⊢ 3 / √2 + 1 / 2 < ↑2 + 1 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2
linarithright h3:↑3 = 3h_sqrt_pos:0 < √2hlt:6 / 5 < √2this:3 / √2 < 5 / 2⊢ 3 / √2 + 1 / 2 < ↑2 + 1 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2right h3:↑3 = 3h_sqrt_pos:0 < √2hlt:6 / 5 < √2this:3 / √2 < 5 / 2⊢ 3 / √2 + 1 / 2 < ↑2 + 1 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2
linarith h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ ⌊3 / √2 + 1 / 2⌋.toNat = 2
rw [hf h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ Int.toNat 2 = 2 h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ Int.toNat 2 = 2] h3:↑3 = 3h_sqrt_pos:0 < √2hf:⌊3 / √2 + 1 / 2⌋ = 2⊢ Int.toNat 2 = 2
rfl All goals completed! 🐙
@[category test, AMS 11]
theorem a_4 : a 4 = 3 := by ⊢ a 4 = 3
unfold a ⊢ ⌊↑4 / √2 + 1 / 2⌋.toNat = 3
have h4 : ((4 : ℕ) : ℝ) = 4 := by ⊢ a 4 = 3 h4:↑4 = 4⊢ ⌊↑4 / √2 + 1 / 2⌋.toNat = 3 norm_num h4:↑4 = 4⊢ ⌊↑4 / √2 + 1 / 2⌋.toNat = 3 h4:↑4 = 4⊢ ⌊↑4 / √2 + 1 / 2⌋.toNat = 3
rw [h4 h4:↑4 = 4⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3 h4:↑4 = 4⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3] h4:↑4 = 4⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3
have h_sqrt_pos : 0 < Real.sqrt 2 := Real.sqrt_pos.mpr (by h4:↑4 = 4⊢ 0 < 2 h4:↑4 = 4h_sqrt_pos:0 < √2⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3 norm_num All goals completed! 🐙 h4:↑4 = 4h_sqrt_pos:0 < √2⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3) h4:↑4 = 4h_sqrt_pos:0 < √2⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3
have hf : Int.floor ((4 : ℝ) / Real.sqrt 2 + 1 / 2) = 3 := by ⊢ a 4 = 3 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3
rw [Int.floor_eq_iff h4:↑4 = 4h_sqrt_pos:0 < √2⊢ ↑3 ≤ 4 / √2 + 1 / 2 ∧ 4 / √2 + 1 / 2 < ↑3 + 1 h4:↑4 = 4h_sqrt_pos:0 < √2⊢ ↑3 ≤ 4 / √2 + 1 / 2 ∧ 4 / √2 + 1 / 2 < ↑3 + 1 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3] h4:↑4 = 4h_sqrt_pos:0 < √2⊢ ↑3 ≤ 4 / √2 + 1 / 2 ∧ 4 / √2 + 1 / 2 < ↑3 + 1 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3
constructor left h4:↑4 = 4h_sqrt_pos:0 < √2⊢ ↑3 ≤ 4 / √2 + 1 / 2right h4:↑4 = 4h_sqrt_pos:0 < √2⊢ 4 / √2 + 1 / 2 < ↑3 + 1 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3
· left h4:↑4 = 4h_sqrt_pos:0 < √2⊢ ↑3 ≤ 4 / √2 + 1 / 2 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3 have hle : Real.sqrt 2 ≤ 8 / 5 := (Real.sqrt_le_iff.mpr ⟨by h4:↑4 = 4h_sqrt_pos:0 < √2⊢ 0 ≤ 8 / 5 left h4:↑4 = 4h_sqrt_pos:0 < √2hle:√2 ≤ 8 / 5⊢ ↑3 ≤ 4 / √2 + 1 / 2 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3 norm_num All goals completed! 🐙left h4:↑4 = 4h_sqrt_pos:0 < √2hle:√2 ≤ 8 / 5⊢ ↑3 ≤ 4 / √2 + 1 / 2 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3, by h4:↑4 = 4h_sqrt_pos:0 < √2⊢ 2 ≤ (8 / 5) ^ 2left h4:↑4 = 4h_sqrt_pos:0 < √2hle:√2 ≤ 8 / 5⊢ ↑3 ≤ 4 / √2 + 1 / 2 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3 norm_num All goals completed! 🐙left h4:↑4 = 4h_sqrt_pos:0 < √2hle:√2 ≤ 8 / 5⊢ ↑3 ≤ 4 / √2 + 1 / 2 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3⟩)left h4:↑4 = 4h_sqrt_pos:0 < √2hle:√2 ≤ 8 / 5⊢ ↑3 ≤ 4 / √2 + 1 / 2 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3
have : (5 / 2 : ℝ) ≤ 4 / Real.sqrt 2 := by ⊢ a 4 = 3 left h4:↑4 = 4h_sqrt_pos:0 < √2hle:√2 ≤ 8 / 5this:5 / 2 ≤ 4 / √2⊢ ↑3 ≤ 4 / √2 + 1 / 2 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3
rw [div_le_div_iff₀ (by h4:↑4 = 4h_sqrt_pos:0 < √2hle:√2 ≤ 8 / 5⊢ 0 < 2 h4:↑4 = 4h_sqrt_pos:0 < √2hle:√2 ≤ 8 / 5⊢ 5 * √2 ≤ 4 * 2left h4:↑4 = 4h_sqrt_pos:0 < √2hle:√2 ≤ 8 / 5this:5 / 2 ≤ 4 / √2⊢ ↑3 ≤ 4 / √2 + 1 / 2 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3 norm_num All goals completed! 🐙 h4:↑4 = 4h_sqrt_pos:0 < √2hle:√2 ≤ 8 / 5⊢ 5 * √2 ≤ 4 * 2left h4:↑4 = 4h_sqrt_pos:0 < √2hle:√2 ≤ 8 / 5this:5 / 2 ≤ 4 / √2⊢ ↑3 ≤ 4 / √2 + 1 / 2 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3) h_sqrt_pos] h4:↑4 = 4h_sqrt_pos:0 < √2hle:√2 ≤ 8 / 5⊢ 5 * √2 ≤ 4 * 2left h4:↑4 = 4h_sqrt_pos:0 < √2hle:√2 ≤ 8 / 5this:5 / 2 ≤ 4 / √2⊢ ↑3 ≤ 4 / √2 + 1 / 2 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3
linarithleft h4:↑4 = 4h_sqrt_pos:0 < √2hle:√2 ≤ 8 / 5this:5 / 2 ≤ 4 / √2⊢ ↑3 ≤ 4 / √2 + 1 / 2 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3left h4:↑4 = 4h_sqrt_pos:0 < √2hle:√2 ≤ 8 / 5this:5 / 2 ≤ 4 / √2⊢ ↑3 ≤ 4 / √2 + 1 / 2 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3
linarith All goals completed! 🐙 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3
· right h4:↑4 = 4h_sqrt_pos:0 < √2⊢ 4 / √2 + 1 / 2 < ↑3 + 1 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3 have hlt : (8 / 7 : ℝ) < Real.sqrt 2 := by ⊢ a 4 = 3 right h4:↑4 = 4h_sqrt_pos:0 < √2hlt:8 / 7 < √2⊢ 4 / √2 + 1 / 2 < ↑3 + 1 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3
rw [Real.lt_sqrt (by h4:↑4 = 4h_sqrt_pos:0 < √2⊢ 0 ≤ 8 / 7 h4:↑4 = 4h_sqrt_pos:0 < √2⊢ (8 / 7) ^ 2 < 2right h4:↑4 = 4h_sqrt_pos:0 < √2hlt:8 / 7 < √2⊢ 4 / √2 + 1 / 2 < ↑3 + 1 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3 norm_num All goals completed! 🐙 h4:↑4 = 4h_sqrt_pos:0 < √2⊢ (8 / 7) ^ 2 < 2right h4:↑4 = 4h_sqrt_pos:0 < √2hlt:8 / 7 < √2⊢ 4 / √2 + 1 / 2 < ↑3 + 1 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3)] h4:↑4 = 4h_sqrt_pos:0 < √2⊢ (8 / 7) ^ 2 < 2right h4:↑4 = 4h_sqrt_pos:0 < √2hlt:8 / 7 < √2⊢ 4 / √2 + 1 / 2 < ↑3 + 1 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3
norm_numright h4:↑4 = 4h_sqrt_pos:0 < √2hlt:8 / 7 < √2⊢ 4 / √2 + 1 / 2 < ↑3 + 1 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3right h4:↑4 = 4h_sqrt_pos:0 < √2hlt:8 / 7 < √2⊢ 4 / √2 + 1 / 2 < ↑3 + 1 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3
have : 4 / Real.sqrt 2 < (7 / 2 : ℝ) := by ⊢ a 4 = 3 right h4:↑4 = 4h_sqrt_pos:0 < √2hlt:8 / 7 < √2this:4 / √2 < 7 / 2⊢ 4 / √2 + 1 / 2 < ↑3 + 1 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3
rw [div_lt_iff₀ h_sqrt_pos h4:↑4 = 4h_sqrt_pos:0 < √2hlt:8 / 7 < √2⊢ 4 < 7 / 2 * √2 h4:↑4 = 4h_sqrt_pos:0 < √2hlt:8 / 7 < √2⊢ 4 < 7 / 2 * √2right h4:↑4 = 4h_sqrt_pos:0 < √2hlt:8 / 7 < √2this:4 / √2 < 7 / 2⊢ 4 / √2 + 1 / 2 < ↑3 + 1 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3] h4:↑4 = 4h_sqrt_pos:0 < √2hlt:8 / 7 < √2⊢ 4 < 7 / 2 * √2right h4:↑4 = 4h_sqrt_pos:0 < √2hlt:8 / 7 < √2this:4 / √2 < 7 / 2⊢ 4 / √2 + 1 / 2 < ↑3 + 1 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3
linarithright h4:↑4 = 4h_sqrt_pos:0 < √2hlt:8 / 7 < √2this:4 / √2 < 7 / 2⊢ 4 / √2 + 1 / 2 < ↑3 + 1 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3right h4:↑4 = 4h_sqrt_pos:0 < √2hlt:8 / 7 < √2this:4 / √2 < 7 / 2⊢ 4 / √2 + 1 / 2 < ↑3 + 1 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3
linarith h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ ⌊4 / √2 + 1 / 2⌋.toNat = 3
rw [hf h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ Int.toNat 3 = 3 h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ Int.toNat 3 = 3] h4:↑4 = 4h_sqrt_pos:0 < √2hf:⌊4 / √2 + 1 / 2⌋ = 3⊢ Int.toNat 3 = 3
rfl All goals completed! 🐙
@[category test, AMS 11]
theorem a_5 : a 5 = 4 := by ⊢ a 5 = 4
unfold a ⊢ ⌊↑5 / √2 + 1 / 2⌋.toNat = 4
have h5 : ((5 : ℕ) : ℝ) = 5 := by ⊢ a 5 = 4 h5:↑5 = 5⊢ ⌊↑5 / √2 + 1 / 2⌋.toNat = 4 norm_num h5:↑5 = 5⊢ ⌊↑5 / √2 + 1 / 2⌋.toNat = 4 h5:↑5 = 5⊢ ⌊↑5 / √2 + 1 / 2⌋.toNat = 4
rw [h5 h5:↑5 = 5⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4 h5:↑5 = 5⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4] h5:↑5 = 5⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4
have h_sqrt_pos : 0 < Real.sqrt 2 := Real.sqrt_pos.mpr (by h5:↑5 = 5⊢ 0 < 2 h5:↑5 = 5h_sqrt_pos:0 < √2⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4 norm_num All goals completed! 🐙 h5:↑5 = 5h_sqrt_pos:0 < √2⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4) h5:↑5 = 5h_sqrt_pos:0 < √2⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4
have hf : Int.floor ((5 : ℝ) / Real.sqrt 2 + 1 / 2) = 4 := by ⊢ a 5 = 4 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4
rw [Int.floor_eq_iff h5:↑5 = 5h_sqrt_pos:0 < √2⊢ ↑4 ≤ 5 / √2 + 1 / 2 ∧ 5 / √2 + 1 / 2 < ↑4 + 1 h5:↑5 = 5h_sqrt_pos:0 < √2⊢ ↑4 ≤ 5 / √2 + 1 / 2 ∧ 5 / √2 + 1 / 2 < ↑4 + 1 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4] h5:↑5 = 5h_sqrt_pos:0 < √2⊢ ↑4 ≤ 5 / √2 + 1 / 2 ∧ 5 / √2 + 1 / 2 < ↑4 + 1 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4
constructor left h5:↑5 = 5h_sqrt_pos:0 < √2⊢ ↑4 ≤ 5 / √2 + 1 / 2right h5:↑5 = 5h_sqrt_pos:0 < √2⊢ 5 / √2 + 1 / 2 < ↑4 + 1 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4
· left h5:↑5 = 5h_sqrt_pos:0 < √2⊢ ↑4 ≤ 5 / √2 + 1 / 2 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4 have hle : Real.sqrt 2 ≤ 10 / 7 := (Real.sqrt_le_iff.mpr ⟨by h5:↑5 = 5h_sqrt_pos:0 < √2⊢ 0 ≤ 10 / 7 left h5:↑5 = 5h_sqrt_pos:0 < √2hle:√2 ≤ 10 / 7⊢ ↑4 ≤ 5 / √2 + 1 / 2 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4 norm_num All goals completed! 🐙left h5:↑5 = 5h_sqrt_pos:0 < √2hle:√2 ≤ 10 / 7⊢ ↑4 ≤ 5 / √2 + 1 / 2 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4, by h5:↑5 = 5h_sqrt_pos:0 < √2⊢ 2 ≤ (10 / 7) ^ 2left h5:↑5 = 5h_sqrt_pos:0 < √2hle:√2 ≤ 10 / 7⊢ ↑4 ≤ 5 / √2 + 1 / 2 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4 norm_num All goals completed! 🐙left h5:↑5 = 5h_sqrt_pos:0 < √2hle:√2 ≤ 10 / 7⊢ ↑4 ≤ 5 / √2 + 1 / 2 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4⟩)left h5:↑5 = 5h_sqrt_pos:0 < √2hle:√2 ≤ 10 / 7⊢ ↑4 ≤ 5 / √2 + 1 / 2 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4
have : (7 / 2 : ℝ) ≤ 5 / Real.sqrt 2 := by ⊢ a 5 = 4 left h5:↑5 = 5h_sqrt_pos:0 < √2hle:√2 ≤ 10 / 7this:7 / 2 ≤ 5 / √2⊢ ↑4 ≤ 5 / √2 + 1 / 2 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4
rw [div_le_div_iff₀ (by h5:↑5 = 5h_sqrt_pos:0 < √2hle:√2 ≤ 10 / 7⊢ 0 < 2 h5:↑5 = 5h_sqrt_pos:0 < √2hle:√2 ≤ 10 / 7⊢ 7 * √2 ≤ 5 * 2left h5:↑5 = 5h_sqrt_pos:0 < √2hle:√2 ≤ 10 / 7this:7 / 2 ≤ 5 / √2⊢ ↑4 ≤ 5 / √2 + 1 / 2 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4 norm_num All goals completed! 🐙 h5:↑5 = 5h_sqrt_pos:0 < √2hle:√2 ≤ 10 / 7⊢ 7 * √2 ≤ 5 * 2left h5:↑5 = 5h_sqrt_pos:0 < √2hle:√2 ≤ 10 / 7this:7 / 2 ≤ 5 / √2⊢ ↑4 ≤ 5 / √2 + 1 / 2 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4) h_sqrt_pos] h5:↑5 = 5h_sqrt_pos:0 < √2hle:√2 ≤ 10 / 7⊢ 7 * √2 ≤ 5 * 2left h5:↑5 = 5h_sqrt_pos:0 < √2hle:√2 ≤ 10 / 7this:7 / 2 ≤ 5 / √2⊢ ↑4 ≤ 5 / √2 + 1 / 2 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4
linarithleft h5:↑5 = 5h_sqrt_pos:0 < √2hle:√2 ≤ 10 / 7this:7 / 2 ≤ 5 / √2⊢ ↑4 ≤ 5 / √2 + 1 / 2 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4left h5:↑5 = 5h_sqrt_pos:0 < √2hle:√2 ≤ 10 / 7this:7 / 2 ≤ 5 / √2⊢ ↑4 ≤ 5 / √2 + 1 / 2 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4
linarith All goals completed! 🐙 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4
· right h5:↑5 = 5h_sqrt_pos:0 < √2⊢ 5 / √2 + 1 / 2 < ↑4 + 1 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4 have hlt : (10 / 9 : ℝ) < Real.sqrt 2 := by ⊢ a 5 = 4 right h5:↑5 = 5h_sqrt_pos:0 < √2hlt:10 / 9 < √2⊢ 5 / √2 + 1 / 2 < ↑4 + 1 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4
rw [Real.lt_sqrt (by h5:↑5 = 5h_sqrt_pos:0 < √2⊢ 0 ≤ 10 / 9 h5:↑5 = 5h_sqrt_pos:0 < √2⊢ (10 / 9) ^ 2 < 2right h5:↑5 = 5h_sqrt_pos:0 < √2hlt:10 / 9 < √2⊢ 5 / √2 + 1 / 2 < ↑4 + 1 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4 norm_num All goals completed! 🐙 h5:↑5 = 5h_sqrt_pos:0 < √2⊢ (10 / 9) ^ 2 < 2right h5:↑5 = 5h_sqrt_pos:0 < √2hlt:10 / 9 < √2⊢ 5 / √2 + 1 / 2 < ↑4 + 1 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4)] h5:↑5 = 5h_sqrt_pos:0 < √2⊢ (10 / 9) ^ 2 < 2right h5:↑5 = 5h_sqrt_pos:0 < √2hlt:10 / 9 < √2⊢ 5 / √2 + 1 / 2 < ↑4 + 1 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4
norm_numright h5:↑5 = 5h_sqrt_pos:0 < √2hlt:10 / 9 < √2⊢ 5 / √2 + 1 / 2 < ↑4 + 1 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4right h5:↑5 = 5h_sqrt_pos:0 < √2hlt:10 / 9 < √2⊢ 5 / √2 + 1 / 2 < ↑4 + 1 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4
have : 5 / Real.sqrt 2 < (9 / 2 : ℝ) := by ⊢ a 5 = 4 right h5:↑5 = 5h_sqrt_pos:0 < √2hlt:10 / 9 < √2this:5 / √2 < 9 / 2⊢ 5 / √2 + 1 / 2 < ↑4 + 1 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4
rw [div_lt_iff₀ h_sqrt_pos h5:↑5 = 5h_sqrt_pos:0 < √2hlt:10 / 9 < √2⊢ 5 < 9 / 2 * √2 h5:↑5 = 5h_sqrt_pos:0 < √2hlt:10 / 9 < √2⊢ 5 < 9 / 2 * √2right h5:↑5 = 5h_sqrt_pos:0 < √2hlt:10 / 9 < √2this:5 / √2 < 9 / 2⊢ 5 / √2 + 1 / 2 < ↑4 + 1 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4] h5:↑5 = 5h_sqrt_pos:0 < √2hlt:10 / 9 < √2⊢ 5 < 9 / 2 * √2right h5:↑5 = 5h_sqrt_pos:0 < √2hlt:10 / 9 < √2this:5 / √2 < 9 / 2⊢ 5 / √2 + 1 / 2 < ↑4 + 1 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4
linarithright h5:↑5 = 5h_sqrt_pos:0 < √2hlt:10 / 9 < √2this:5 / √2 < 9 / 2⊢ 5 / √2 + 1 / 2 < ↑4 + 1 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4right h5:↑5 = 5h_sqrt_pos:0 < √2hlt:10 / 9 < √2this:5 / √2 < 9 / 2⊢ 5 / √2 + 1 / 2 < ↑4 + 1 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4
linarith h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ ⌊5 / √2 + 1 / 2⌋.toNat = 4
rw [hf h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ Int.toNat 4 = 4 h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ Int.toNat 4 = 4] h5:↑5 = 5h_sqrt_pos:0 < √2hf:⌊5 / √2 + 1 / 2⌋ = 4⊢ Int.toNat 4 = 4
rfl All goals completed! 🐙$\zeta(3)$ (Apéry's constant).
noncomputable def zetaThreeReal : ℝ :=
(riemannZeta 3).reLet $s(n) = \zeta(3) - \sum_{k=1}^{n} 1/k^3$.
noncomputable def s (n : ℕ) : ℝ :=
zetaThreeReal - ∑ k ∈ Finset.range n, (1 : ℝ) / ((k + 1 : ℝ) ^ 3)A001953: Nonhomogeneous Beatty sequence $\lfloor (k + 1/2)\sqrt{2} \rfloor$ for $k \ge 0$.
def A001953 : Set ℕ :=
{n | ∃ k : ℕ, n = (Int.floor (((k : ℝ) + 1 / 2) * Real.sqrt 2)).toNat}A001954: Nonhomogeneous Beatty sequence $\lfloor (k + 1/2)(2 + \sqrt{2}) \rfloor$ for $k \ge 0$.
def A001954 : Set ℕ :=
{n | ∃ k : ℕ, n = (Int.floor (((k : ℝ) + 1 / 2) * (2 + Real.sqrt 2))).toNat}Let $s(n) = \zeta(3) - \sum_{k=1}^n \frac{1}{k^3}$. Conjecture: for $n \ge 1$, $s(a(n)) < \frac{1}{n^2} < s(a(n)-1)$, and the difference sequence of A049473 consists solely of $0$'s and $1$'s, in positions given by the nonhomogeneous Beatty sequences A001954 and A001953, respectively.
Clark Kimberling, Oct 05 2014
@[category research open, AMS 11]
theorem conjecture :
(∀ n : ℕ, 1 ≤ n → s (a n) < 1 / (n : ℝ) ^ 2 ∧ 1 / (n : ℝ) ^ 2 < s (a n - 1)) ∧
(∀ n : ℕ, 1 ≤ n →
let diff : ℕ := a n - a (n - 1)
(diff = 0 ↔ n - 1 ∈ A001954) ∧ (diff = 1 ↔ n - 1 ∈ A001953)) := by ⊢ (∀ (n : ℕ), 1 ≤ n → s (OeisA49473.a n) < 1 / ↑n ^ 2 ∧ 1 / ↑n ^ 2 < s (OeisA49473.a n - 1)) ∧
∀ (n : ℕ),
1 ≤ n →
let diff := OeisA49473.a n - OeisA49473.a (n - 1);
(diff = 0 ↔ n - 1 ∈ A001954) ∧ (diff = 1 ↔ n - 1 ∈ A001953)
sorry All goals completed! 🐙end OeisA49473