math / data /lean /OAI /Probability /BinarySweep /Analytic /OneAxisBase.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
4.23 kB
import Mathlib
import OAI.Probability.BinarySweep.Analytic.OneAxisPerturbation
import OAI.Probability.BinarySweep.FiniteLaws.QuantitativeMoment
import OAI.Probability.BinarySweep.Conditional.MainEasyCases
namespace OAI
noncomputable section
open scoped BigOperators
namespace BinaryCoordinateSweeps
def oneAxisRadius (r : β„•) : ℝ :=
(2 * (((2^(2*r) : β„•).factorial : ℝ))^2)⁻¹
lemma oneAxisRadius_pos (r : β„•) : 0 < oneAxisRadius r := by
unfold oneAxisRadius
positivity
lemma oneAxisRadius_le_half (r : β„•) : oneAxisRadius r ≀ 1/2 := by
have hB : (1 : ℝ) ≀ ((2^(2*r) : β„•).factorial : ℝ) := by
exact_mod_cast Nat.factorial_pos (2^(2*r))
unfold oneAxisRadius
calc
_ ≀ (2 : ℝ)⁻¹ := inv_antiβ‚€ (by norm_num) (by nlinarith)
_ = 1/2 := by norm_num
lemma oneAxis_size_le {r : β„•} {bits : Fin 1 β†’ β„•} (hd : βˆ€ j, bits j ≀ 2*r) :
gridSize bits ≀ 2^(2*r) := by
simp only [gridSize, Fin.prod_univ_one]
exact Nat.pow_le_pow_right (by omega) (hd 0)
lemma oneAxis_norm_le_inv_dimension {r h D : β„•} {bits : Fin 1 β†’ β„•}
(hd : βˆ€ j, bits j ≀ 2*r) (H : PathFamily bits h)
{z : ℝ} (hz : 0 ≀ z) (hzr : z ≀ oneAxisRadius r)
(ρ : Representation β„‚ (Equiv.Perm (FreeSlot H 0)) (RepSpace D))
[ρ.IsIrreducible] (hρ : IsUnitaryRep ρ) (hD : 1 < D) :
β€–conditionalOperator H z ρ‖ ≀ (D : ℝ)⁻¹ := by
let B : ℝ := ((2^(2*r) : β„•).factorial : ℝ)
have hB : 0 < B := by dsimp [B]; positivity
have hfac : ((gridSize bits).factorial : ℝ) ≀ B := by
dsimp [B]
exact_mod_cast Nat.factorial_le (oneAxis_size_le hd)
have hdim : D ≀ (gridSize bits).factorial := by
have hbound := Irrep.finrank_le_card ρ
simp only [finrank_euclideanSpace_fin, Fintype.card_perm, card_freeSlot] at hbound
exact hbound.trans (Nat.factorial_le (Nat.sub_le _ _))
have hDB : (D : ℝ) ≀ B := (by exact_mod_cast hdim :
(D : ℝ) ≀ ((gridSize bits).factorial : ℝ)).trans hfac
have hD0 : (0 : ℝ) < D := by exact_mod_cast (by omega : 0 < D)
calc
_ ≀ 2 * ((gridSize bits).factorial : ℝ) * z :=
oneAxis_conditional_norm_le H hz (hzr.trans (oneAxisRadius_le_half r)) ρ hρ hD
_ ≀ 2 * B * oneAxisRadius r := by gcongr
_ = B⁻¹ := by dsimp [oneAxisRadius, B]; field_simp
_ ≀ (D : ℝ)⁻¹ := inv_antiβ‚€ hD0 hDB
theorem conditional_moment_one_axis {r q : β„•}
(hr : (400000000 : ℝ) ≀ (r : ℝ) * Real.log 2) (hq : 0 < q)
(bits : Fin 1 β†’ β„•) (hd : βˆ€ j, r ≀ bits j ∧ bits j ≀ 2*r)
{h D : β„•} (H : PathFamily bits h) {z : ℝ} (hz : 0 ≀ z)
(hzr : z ≀ oneAxisRadius r)
(ρ : Representation β„‚ (Equiv.Perm (FreeSlot H 0)) (RepSpace D))
[ρ.IsIrreducible] (hρ : IsUnitaryRep ρ) :
logMoment (traceMoment q (conditionalOperator H z ρ)) ≀
((-cExponent (gridSize bits) * Real.log D +
eExponent (gridSize bits) * h * Real.log (gridSize bits) - pathCost H : ℝ) : EReal) := by
have ha := grid_parameter_allowance (by omega : 1 ≀ 1) (fun j => (hd j).1) hr H
have hl0 : 0 ≀ Real.log (gridSize bits) := Real.log_nonneg (by
exact_mod_cast gridSize_pos bits)
have hallow : 0 ≀ eExponent (gridSize bits) * h * Real.log (gridSize bits) - pathCost H := by
apply le_trans _ ha.2.2
unfold e0
positivity
by_cases hD : 1 < D
· have hn := oneAxis_norm_le_inv_dimension (fun j => (hd j).2) H hz hzr ρ hρ hD
apply (logMoment_le_neg_log_dimension (by omega) hq _ hn).trans
have hc : cExponent (gridSize bits) ≀ 1 := by
have := ha.1
unfold c0 at this
linarith
have hlog : 0 ≀ Real.log D := Real.log_nonneg (by exact_mod_cast (by omega : 1 ≀ D))
exact_mod_cast (show -Real.log D ≀ -cExponent (gridSize bits) * Real.log D +
eExponent (gridSize bits) * h * Real.log (gridSize bits) - pathCost H by nlinarith)
Β· have hlog : Real.log D = 0 := by
have hD' : D = 0 ∨ D = 1 := by omega
rcases hD' with rfl | rfl <;> norm_num
apply conditional_moment_of_automatic_regime H hz
(lt_of_le_of_lt (hzr.trans (oneAxisRadius_le_half r)) (by norm_num)) q ρ hρ
simpa only [hlog, mul_zero] using hallow
end BinaryCoordinateSweeps
end
end OAI