CoherenceTime.lean

Lean 4 source, lean/DataMiningAsObservation/CoherenceTime.lean at commit bccca4f. Appendix C, Machine-checked statements, says what each file proves. All Lean files.

/-
CoherenceTime.lean. Equations 0.25 and 13.2.

Clarke's coherence time is `√(9 / (16π)) / f_D`, whose constant is 0.423 to three decimals,
so a 10 hertz Doppler gives about 42 milliseconds and 400 hertz about 1 millisecond, as
chapter 0 says. The refuted refresh law of chapter 13 put the floor at 0.177 coherence
times. Evaluated at the chapter's Doppler frequencies it predicts about 7.5 milliseconds at
10 hertz and 1.5 milliseconds at 50 hertz, which with a one-millisecond transmission
interval exceed the sealed floors of at most 6 and 1 intervals. The arithmetic is checked
here. The refutation itself rests on the sealed record, not on this arithmetic.
-/
import Mathlib

namespace DMO.CoherenceTime

/-- Clarke's constant, `√(9 / (16π))`. -/
noncomputable def clarke : ℝ := Real.sqrt (9 / (16 * Real.pi))

/-- **Equation 0.25's constant.** Clarke's constant is 0.423 to three decimals. -/
theorem clarke_to_three_decimals : |clarke - 0.423| < 0.0005 := by
  have hpi1 := Real.pi_gt_d2
  have hpi2 := Real.pi_lt_d2
  have hlo : (0.4225 : ℝ) < clarke := by
    unfold clarke
    rw [Real.lt_sqrt (by norm_num)]
    rw [lt_div_iff₀ (by positivity)]
    nlinarith
  have hhi : clarke < (0.4235 : ℝ) := by
    unfold clarke
    rw [Real.sqrt_lt' (by norm_num)]
    rw [div_lt_iff₀ (by positivity)]
    nlinarith
  rw [abs_lt]
  constructor <;> linarith

/-- The coherence time at Doppler `fD`, with the constant as the book prints it. -/
noncomputable def coherenceTime (fD : ℝ) : ℝ := 0.423 / fD

/-- Ten hertz gives 42.3 milliseconds and 400 hertz gives about 1.06 milliseconds. -/
theorem examples : coherenceTime 10 = 0.0423 ∧ |coherenceTime 400 - 0.001| < 0.0001 := by
  unfold coherenceTime
  constructor
  · norm_num
  · rw [abs_lt]; constructor <;> norm_num

/-- The refuted law's floor, 0.177 coherence times. -/
noncomputable def refutedFloor (fD : ℝ) : ℝ := 0.177 * coherenceTime fD

/-- **Equation 13.2's arithmetic.** The refuted law predicts more than 6 milliseconds at 10
hertz and more than 1 millisecond at 50 hertz, above the sealed floors of at most 6 and 1
one-millisecond intervals. -/
theorem refuted_law_exceeds_sealed : 0.006 < refutedFloor 10 ∧ 0.001 < refutedFloor 50 := by
  unfold refutedFloor coherenceTime
  constructor <;> norm_num

end DMO.CoherenceTime