AFTD Auto-Formalizing Theoretical Domains

CodingTheory.Johnson.alpha_lt_one_of_hd1

theoremverifiedimported Lean

The shift parameter is less than one. Let $n$ and $d$ be natural numbers with $n \ge 1$, $d \ge 1$, and $2d \le n$. Then the shift parameter satisfies \[ \alpha(n,d) \;=\; \sqrt{\frac{n - 2d}{n}} \;<\; 1. \]

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
open scoped BigOperators RealInnerProductSpace in
open Finset in
lemma CodingTheory.Johnson.alpha_lt_one_of_hd1
    {n d : ℕ} (hn : 0 < n) (hd1 : 1 ≤ d) (hd : 2 * d ≤ n) :
    alpha n d < 1
Source
TCSlib, `CodingTheory.Johnson.alpha_lt_one_of_hd1`
Lean proof
By Allan Li, Frederick Dehmel, Hydroxyi (from the file's git history), from github.com/Shilun-Allan-Li/tcslib at c8a02591b1e5 (Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.25.0.
What was changed in CodingTheory.Johnson.alpha_lt_one_of_hd1
--- TCSlib/ErrorCorrectingCodes/JohnsonBound.lean:147 (CodingTheory.Johnson.alpha_lt_one_of_hd1)
+++ as compiled here
@@ -1,2 +1,6 @@
-lemma alpha_lt_one_of_hd1
+set_option autoImplicit true in
+set_option relaxedAutoImplicit true in
+open scoped BigOperators RealInnerProductSpace in
+open Finset in
+lemma CodingTheory.Johnson.alpha_lt_one_of_hd1
     {n d : ℕ} (hn : 0 < n) (hd1 : 1 ≤ d) (hd : 2 * d ≤ n) :
@@ -11,2 +15,3 @@
   convert h_sqrt_lt_one using 1
+  · rfl
   simp [Real.sqrt_one]
Verified
07 Oct 2026
Axioms
Classical.choiceQuot.soundpropext
Built on 1
Used by 1

Lean source view module on GitHub

set_option autoImplicit true inset_option relaxedAutoImplicit true inopen scoped BigOperators RealInnerProductSpace inopen Finset inlemma CodingTheory.Johnson.alpha_lt_one_of_hd1    {n d : ℕ} (hn : 0 < n) (hd1 : 1 ≤ d) (hd : 2 * d ≤ n) :    alpha n d < 1 := by  have h_alpha_lt_one : (n - 2 * d : ℝ) / n < 1 := by    have h_frac_lt_one : (n - 2 * d : ℝ) < n := by      norm_num [hd1];      exact hd1;    rwa [ div_lt_one ( by positivity ) ];  have h_sqrt_lt_one : Real.sqrt ((n - 2 * d : ℝ) / n) < Real.sqrt 1 := by    apply Real.sqrt_lt_sqrt; exact div_nonneg (sub_nonneg_of_le (by norm_cast)) (Nat.cast_nonneg n); exact h_alpha_lt_one.trans_le (by norm_num);  convert h_sqrt_lt_one using 1  · rfl  simp [Real.sqrt_one]
See it in the graphDiscuss this resultChallenge it