Isotropy.lean
Lean 4 source, lean/DataMiningAsObservation/Isotropy.lean at commit bccca4f. Appendix C, Machine-checked statements, says what each file proves. All Lean files.
/-
Isotropy.lean. Chapter 0 section 0.3 and chapter 3 section 3.2, isotropic and anisotropic covariances.
An isotropic covariance has the same variance in every direction, so every unit reader
reads it the same and no flip is possible. An anisotropic one has different variances in
different directions, so two unit readers can read it differently, and the flip of chapter 3
needs exactly that. The file states both in the diagonal two-dimensional setting of the
flip file.
-/
import Mathlib
import DataMiningAsObservation.Flip
namespace DMO.Isotropy
open DMO.Flip
/-- **Every unit reader reads an isotropic covariance the same.** -/
theorem isotropic_reads_same (a c s : ℝ) (hcs : c ^ 2 + s ^ 2 = 1) : readDiag a a c s = a := by
unfold readDiag
linear_combination a * hcs
/-- **No flip under an isotropic error.** Swapping the reader's coordinates changes nothing. -/
theorem isotropic_no_flip (a c s : ℝ) : readDiag a a c s = readDiag a a s c := by
unfold readDiag; ring
/-- **Two unit readers disagree on an anisotropic covariance.** The reader along the first
axis reads `a` and the reader along the second reads `b`. -/
theorem anisotropic_readers_differ (a b : ℝ) (hab : a ≠ b) :
readDiag a b 1 0 ≠ readDiag a b 0 1 := by
unfold readDiag
intro h
apply hab
linarith
/-- **The flip needs anisotropy.** Two codes with the variances exchanged are read the same by
every reader exactly when the two variances agree. -/
theorem flip_iff_anisotropic (a b c s : ℝ) (hcs : c ^ 2 ≠ s ^ 2) :
readDiag a b c s = readDiag b a c s ↔ a = b := by
rw [← sub_eq_zero, reading_difference, mul_eq_zero, sub_eq_zero, sub_eq_zero]
constructor
· rintro (h | h)
· exact h
· exact absurd h hcs
· intro h; left; exact h
end DMO.Isotropy