Skip to content
Open
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
24 changes: 24 additions & 0 deletions LeanPool/Zeta5Irrational/Table/RationalSeries.lean
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ Authors: Lean Pool contributors
module

public import LeanPool.Zeta5Irrational.TableCheck
import Mathlib.Analysis.Complex.ExponentialBounds
import Mathlib.Tactic.Linarith

/-!
# Rational certificates for finite analytic series

The table bounds use only rational inputs. Check their finite sums in `ℚ`, then transport
one inequality to `ℝ`, avoiding a separate normalization proof for every real operation.
Binary range reduction also checks its rational rounding bound before using the shared
lower bound on `Real.log 2`.
-/

public section
Expand Down Expand Up @@ -62,4 +66,24 @@ lemma arctan_le_of_series_rat {z U : ℚ} (k : ℕ)
simpa only [Rat.cast_add, Rat.cast_mul, Rat.cast_sum, Rat.cast_div, Rat.cast_pow,
Rat.cast_sub, Rat.cast_one, Rat.cast_ofNat, Rat.cast_natCast, Rat.cast_neg] using h

/-- Check binary range reduction and its final logarithm bound in the rationals. -/
lemma log_le_of_split_neg_rational {r r' U U' : ℚ} (power m : ℕ)
(certificate : 1 ≤ r' ∧
2 * ∑ k ∈ range m, (1 / (2 * (k : ℚ) + 1)) * ((r' - 1) / (r' + 1)) ^ (2 * k + 1) +
2 * ((r' - 1) / (r' + 1)) ^ (2 * m + 1) /
((2 * m + 1) * (1 - ((r' - 1) / (r' + 1)) ^ 2)) ≤ U')
(reduction : r = r' / 2 ^ power ∧ U' - power * (6931471803 / 10000000000) ≤ U) :
Real.log (r : ℝ) ≤ (U : ℝ) := by
have hr : (r : ℝ) = (r' : ℝ) / 2 ^ power := by exact_mod_cast reduction.1
have hr' : (0 : ℝ) < r' := by
exact_mod_cast (lt_of_lt_of_le (by decide : (0 : ℚ) < 1) certificate.1)
have h := log_le_of_split_neg power hr hr' (log_le_of_ge_one_rat m certificate)
have hround : (U' : ℝ) - power * (6931471803 / 10000000000) ≤ U := by
simpa only [Rat.cast_sub, Rat.cast_mul, Rat.cast_natCast, Rat.cast_div,
Rat.cast_ofNat] using (Rat.cast_le (K := ℝ)).2 reduction.2
have hlog : (6931471803 / 10000000000 : ℝ) ≤ Real.log 2 := by
linarith only [Real.log_two_gt_d9]
have hmul := mul_le_mul_of_nonneg_left hlog (Nat.cast_nonneg (α := ℝ) power)
exact h.trans ((sub_le_sub_left hmul _).trans hround)

end Zeta5Irrational
4,984 changes: 2,205 additions & 2,779 deletions LeanPool/Zeta5Irrational/Table/U00.lean

Large diffs are not rendered by default.

1,765 changes: 795 additions & 970 deletions LeanPool/Zeta5Irrational/Table/U01.lean

Large diffs are not rendered by default.

526 changes: 240 additions & 286 deletions LeanPool/Zeta5Irrational/Table/U02.lean

Large diffs are not rendered by default.

770 changes: 345 additions & 425 deletions LeanPool/Zeta5Irrational/Table/U03.lean

Large diffs are not rendered by default.

1,070 changes: 480 additions & 590 deletions LeanPool/Zeta5Irrational/Table/U04.lean

Large diffs are not rendered by default.

1,212 changes: 540 additions & 672 deletions LeanPool/Zeta5Irrational/Table/U05.lean

Large diffs are not rendered by default.

1,523 changes: 675 additions & 848 deletions LeanPool/Zeta5Irrational/Table/U06.lean

Large diffs are not rendered by default.

1,622 changes: 720 additions & 902 deletions LeanPool/Zeta5Irrational/Table/U07.lean

Large diffs are not rendered by default.

1,795 changes: 795 additions & 1,000 deletions LeanPool/Zeta5Irrational/Table/U08.lean

Large diffs are not rendered by default.

2,038 changes: 900 additions & 1,138 deletions LeanPool/Zeta5Irrational/Table/U09.lean

Large diffs are not rendered by default.

2,035 changes: 900 additions & 1,135 deletions LeanPool/Zeta5Irrational/Table/U10.lean

Large diffs are not rendered by default.

2,098 changes: 930 additions & 1,168 deletions LeanPool/Zeta5Irrational/Table/U11.lean

Large diffs are not rendered by default.

2,448 changes: 1,080 additions & 1,368 deletions LeanPool/Zeta5Irrational/Table/U12.lean

Large diffs are not rendered by default.

2,447 changes: 1,080 additions & 1,367 deletions LeanPool/Zeta5Irrational/Table/U13.lean

Large diffs are not rendered by default.

2,448 changes: 1,080 additions & 1,368 deletions LeanPool/Zeta5Irrational/Table/U14.lean

Large diffs are not rendered by default.

2,578 changes: 1,140 additions & 1,438 deletions LeanPool/Zeta5Irrational/Table/U15.lean

Large diffs are not rendered by default.

2,855 changes: 1,260 additions & 1,595 deletions LeanPool/Zeta5Irrational/Table/U16.lean

Large diffs are not rendered by default.

2,856 changes: 1,260 additions & 1,596 deletions LeanPool/Zeta5Irrational/Table/U17.lean

Large diffs are not rendered by default.

2,853 changes: 1,260 additions & 1,593 deletions LeanPool/Zeta5Irrational/Table/U18.lean

Large diffs are not rendered by default.

2,921 changes: 1,290 additions & 1,631 deletions LeanPool/Zeta5Irrational/Table/U19.lean

Large diffs are not rendered by default.

3,259 changes: 1,440 additions & 1,819 deletions LeanPool/Zeta5Irrational/Table/U20.lean

Large diffs are not rendered by default.

3,262 changes: 1,440 additions & 1,822 deletions LeanPool/Zeta5Irrational/Table/U21.lean

Large diffs are not rendered by default.

3,258 changes: 1,440 additions & 1,818 deletions LeanPool/Zeta5Irrational/Table/U22.lean

Large diffs are not rendered by default.

3,257 changes: 1,440 additions & 1,817 deletions LeanPool/Zeta5Irrational/Table/U23.lean

Large diffs are not rendered by default.

3,563 changes: 1,575 additions & 1,988 deletions LeanPool/Zeta5Irrational/Table/U24.lean

Large diffs are not rendered by default.

3,671 changes: 1,620 additions & 2,051 deletions LeanPool/Zeta5Irrational/Table/U25.lean

Large diffs are not rendered by default.

3,669 changes: 1,620 additions & 2,049 deletions LeanPool/Zeta5Irrational/Table/U26.lean

Large diffs are not rendered by default.

3,671 changes: 1,620 additions & 2,051 deletions LeanPool/Zeta5Irrational/Table/U27.lean

Large diffs are not rendered by default.

3,736 changes: 1,650 additions & 2,086 deletions LeanPool/Zeta5Irrational/Table/U28.lean

Large diffs are not rendered by default.

4,085 changes: 1,800 additions & 2,285 deletions LeanPool/Zeta5Irrational/Table/U29.lean

Large diffs are not rendered by default.

4,087 changes: 1,800 additions & 2,287 deletions LeanPool/Zeta5Irrational/Table/U30.lean

Large diffs are not rendered by default.

4,092 changes: 1,800 additions & 2,292 deletions LeanPool/Zeta5Irrational/Table/U31.lean

Large diffs are not rendered by default.

4,086 changes: 1,800 additions & 2,286 deletions LeanPool/Zeta5Irrational/Table/U32.lean

Large diffs are not rendered by default.

4,219 changes: 1,860 additions & 2,359 deletions LeanPool/Zeta5Irrational/Table/U33.lean

Large diffs are not rendered by default.

4,498 changes: 1,980 additions & 2,518 deletions LeanPool/Zeta5Irrational/Table/U34.lean

Large diffs are not rendered by default.

4,501 changes: 1,980 additions & 2,521 deletions LeanPool/Zeta5Irrational/Table/U35.lean

Large diffs are not rendered by default.

4,497 changes: 1,980 additions & 2,517 deletions LeanPool/Zeta5Irrational/Table/U36.lean

Large diffs are not rendered by default.

4,495 changes: 1,980 additions & 2,515 deletions LeanPool/Zeta5Irrational/Table/U37.lean

Large diffs are not rendered by default.

4,679 changes: 2,055 additions & 2,624 deletions LeanPool/Zeta5Irrational/Table/U38.lean

Large diffs are not rendered by default.

4,929 changes: 2,160 additions & 2,769 deletions LeanPool/Zeta5Irrational/Table/U39.lean

Large diffs are not rendered by default.

4,929 changes: 2,160 additions & 2,769 deletions LeanPool/Zeta5Irrational/Table/U40.lean

Large diffs are not rendered by default.

4,925 changes: 2,160 additions & 2,765 deletions LeanPool/Zeta5Irrational/Table/U41.lean

Large diffs are not rendered by default.

4,929 changes: 2,160 additions & 2,769 deletions LeanPool/Zeta5Irrational/Table/U42.lean

Large diffs are not rendered by default.

5,204 changes: 2,280 additions & 2,924 deletions LeanPool/Zeta5Irrational/Table/U43.lean

Large diffs are not rendered by default.

5,342 changes: 2,340 additions & 3,002 deletions LeanPool/Zeta5Irrational/Table/U44.lean

Large diffs are not rendered by default.

5,347 changes: 2,340 additions & 3,007 deletions LeanPool/Zeta5Irrational/Table/U45.lean

Large diffs are not rendered by default.

5,344 changes: 2,340 additions & 3,004 deletions LeanPool/Zeta5Irrational/Table/U46.lean

Large diffs are not rendered by default.

5,656 changes: 2,475 additions & 3,181 deletions LeanPool/Zeta5Irrational/Table/U47.lean

Large diffs are not rendered by default.

5,767 changes: 2,520 additions & 3,247 deletions LeanPool/Zeta5Irrational/Table/U48.lean

Large diffs are not rendered by default.

5,768 changes: 2,520 additions & 3,248 deletions LeanPool/Zeta5Irrational/Table/U49.lean

Large diffs are not rendered by default.

5,760 changes: 2,520 additions & 3,240 deletions LeanPool/Zeta5Irrational/Table/U50.lean

Large diffs are not rendered by default.

6,186 changes: 2,700 additions & 3,486 deletions LeanPool/Zeta5Irrational/Table/U51.lean

Large diffs are not rendered by default.

6,184 changes: 2,700 additions & 3,484 deletions LeanPool/Zeta5Irrational/Table/U52.lean

Large diffs are not rendered by default.

6,396 changes: 2,790 additions & 3,606 deletions LeanPool/Zeta5Irrational/Table/U53.lean

Large diffs are not rendered by default.

6,612 changes: 2,880 additions & 3,732 deletions LeanPool/Zeta5Irrational/Table/U54.lean

Large diffs are not rendered by default.

6,606 changes: 2,880 additions & 3,726 deletions LeanPool/Zeta5Irrational/Table/U55.lean

Large diffs are not rendered by default.

3,414 changes: 1,670 additions & 1,744 deletions LeanPool/Zeta5Irrational/Table/U56.lean

Large diffs are not rendered by default.

56 changes: 55 additions & 1 deletion LeanPool/Zeta5Irrational/Table/UpperCertificate.lean
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ public import LeanPool.Zeta5Irrational.Table.Common
public import LeanPool.Zeta5Irrational.Certificates
public import Mathlib.Analysis.Complex.ExponentialBounds

/-! # Reusable upper certificates for arcsine potentials -/
/-! # Reusable upper certificates for arcsine potentials

The rational versions read endpoints from the existing table and transfer their closed
arithmetic certificates to the real analytic lemmas once.
-/

@[expose] public section

Expand All @@ -36,4 +40,54 @@ lemma Uω_le_right_certificate {a b t s q U : ℝ} (hab : a < b) (ht : b ≤ t)
apply (Real.log_le_log (by linarith) ?_).trans hlog
linarith

/-- The left endpoint of an arcsine interval, evaluated in the rationals. -/
def rationalLeftEndpoint (j : ℕ) : ℚ :=
((table1.getD (j - 1) (0, 0, 0)).1 : ℚ) / 10 ^ 12

/-- The right endpoint of an arcsine interval, evaluated in the rationals. -/
def rationalRightEndpoint (j : ℕ) : ℚ :=
((table1.getD (j - 1) (0, 0, 0)).2.1 : ℚ) / 10 ^ 12

lemma aρ_eq_rationalLeftEndpoint (j : ℕ) : aρ j = (rationalLeftEndpoint j : ℝ) := by
simp only [aρ, rationalLeftEndpoint, Rat.cast_div, Rat.cast_natCast,
Rat.cast_pow, Rat.cast_ofNat]

lemma bρ_eq_rationalRightEndpoint (j : ℕ) : bρ j = (rationalRightEndpoint j : ℝ) := by
simp only [bρ, rationalRightEndpoint, Rat.cast_div, Rat.cast_natCast,
Rat.cast_pow, Rat.cast_ofNat]

/-- A rational certificate to the left of a tabulated arcsine interval. -/
lemma Uω_le_left_certificate_rational {j : ℕ} {t s q U : ℚ}
(certificate : rationalLeftEndpoint j < rationalRightEndpoint j ∧
t ≤ rationalLeftEndpoint j ∧ 0 ≤ s ∧
(t - rationalLeftEndpoint j) * (t - rationalRightEndpoint j) ≤ s ^ 2 ∧
((rationalLeftEndpoint j + rationalRightEndpoint j) / 2 - t + s) / 2 ≤ q)
(hlog : Real.log (q : ℝ) ≤ (U : ℝ)) :
Uω (aρ j) (bρ j) (t : ℝ) ≤ (U : ℝ) := by
rw [aρ_eq_rationalLeftEndpoint, bρ_eq_rationalRightEndpoint]
apply Uω_le_left_certificate (s := (s : ℝ)) (q := (q : ℝ))
· exact_mod_cast certificate.1
· exact_mod_cast certificate.2.1
· exact_mod_cast certificate.2.2.1
· exact_mod_cast certificate.2.2.2.1
· exact_mod_cast certificate.2.2.2.2
· exact hlog

/-- A rational certificate to the right of a tabulated arcsine interval. -/
lemma Uω_le_right_certificate_rational {j : ℕ} {t s q U : ℚ}
(certificate : rationalLeftEndpoint j < rationalRightEndpoint j ∧
rationalRightEndpoint j ≤ t ∧ 0 ≤ s ∧
(t - rationalLeftEndpoint j) * (t - rationalRightEndpoint j) ≤ s ^ 2 ∧
(t - (rationalLeftEndpoint j + rationalRightEndpoint j) / 2 + s) / 2 ≤ q)
(hlog : Real.log (q : ℝ) ≤ (U : ℝ)) :
Uω (aρ j) (bρ j) (t : ℝ) ≤ (U : ℝ) := by
rw [aρ_eq_rationalLeftEndpoint, bρ_eq_rationalRightEndpoint]
apply Uω_le_right_certificate (s := (s : ℝ)) (q := (q : ℝ))
· exact_mod_cast certificate.1
· exact_mod_cast certificate.2.1
· exact_mod_cast certificate.2.2.1
· exact_mod_cast certificate.2.2.2.1
· exact_mod_cast certificate.2.2.2.2
· exact hlog

end Zeta5Irrational
Loading