File size: 5,257 Bytes
4a56cd6 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | import OAI.Dynamics.ConditionalShuffle.CanonicalBridge
namespace OAI
noncomputable section
open Filter Topology
namespace Thorp.Conditional
open scoped Classical
open Revealed.Split Revealed.Disintegration
def conditionalRate (d : β) : β :=
Real.sqrt (12544 * ((1 / 32 : β) ^ d + (2 ^ d : β) ^ 3 * (9 / 10 : β) ^ (2 ^ d)))
lemma conditionalRate_tendsto : Tendsto conditionalRate atTop (nhds 0) := by
have hβ := tendsto_pow_atTop_nhds_zero_of_lt_one
(by norm_num : (0 : β) β€ 1 / 32) (by norm_num : (1 / 32 : β) < 1)
have hβ := (tendsto_pow_const_mul_const_pow_of_lt_one 3
(by norm_num : (0 : β) β€ 9 / 10) (by norm_num : (9 / 10 : β) < 1)).comp
(tendsto_pow_atTop_atTop_of_one_lt (by norm_num : (1 : β) < 2))
have hh := ((hβ.add hβ).const_mul 12544).sqrt
unfold conditionalRate
simpa only [Nat.cast_pow, Nat.cast_ofNat, Function.comp_def,
add_zero, mul_zero, Real.sqrt_zero] using hh
lemma frameJoint_sum {ΞΉ Ξ± : Type*} [Fintype ΞΉ] [Fintype Ξ±] [DecidableEq Ξ±] {d : β}
(L : Sum ΞΉ Ξ± β Position d) (t : β) : β z, frameJoint L t z = 1 := fairMass_sum _
lemma frameMarginal_sum {ΞΉ Ξ± : Type*} [Fintype ΞΉ] [Fintype Ξ±] [DecidableEq Ξ±] {d : β}
(L : Sum ΞΉ Ξ± β Position d) (t : β) : β p, marginal (frameJoint L t) p = 1 := by
rw [marginal_sum, frameJoint_sum]
lemma frameKernel_marginal_rate {ΞΉ : Type*} [Fintype ΞΉ] (d : β)
(L : Sum ΞΉ (Position (d + 1 + 2)) β Position (d + 2 + 2))
(e : Fin (7 * 2 ^ d) β Position (d + 1 + 2)) (he : Function.Injective e) :
(β p, marginal (frameJoint L (400 * (d + 2 + 2))) p *
tv (Trim.push (frameKernel L (400 * (d + 2 + 2)) p) (fun g => g β e))
(fairMass (fun g : State (d + 1 + 2) => g β e))) β€ conditionalRate d := by
have hc : Fintype.card (Position (d + 2 + 2)) = 16 * 2 ^ d := by
simp only [card_position, pow_add]
norm_num
omega
have hf : Fintype.card (Position (d + 1 + 2)) = 8 * 2 ^ d := by
simp only [card_position, pow_add]
norm_num
omega
have hh := frameKernel_marginal_400 (d + 2) (2 ^ d) (by rw [hc]) L (7 * 2 ^ d)
(by rw [hf]; omega) e he
apply hh.trans
unfold conditionalRate
apply Real.le_sqrt_of_sq_le
have hp : (1 / 2 : β) ^ (8 * (d + 2 + 2)) β€ (1 / 2 : β) ^ (8 * d) :=
pow_le_pow_of_le_one (by norm_num) (by norm_num) (by omega)
have hid : (2 ^ d : β) ^ 3 * (1 / 2 : β) ^ (8 * d) = (1 / 32 : β) ^ d := by
rw [β pow_mul, Nat.mul_comm d 3, pow_mul, pow_mul, β mul_pow]
norm_num
have hp' := mul_le_mul_of_nonneg_left hp (by positivity : (0 : β) β€ (2 ^ d : β) ^ 3)
rw [hid] at hp'
have hsq :
(((7 * 2 ^ d : β) : β) / 2 *
Real.sqrt ((Fintype.card (Position (d + 2 + 2)) : β) *
((1 / 2 : β) ^ (8 * (d + 2 + 2)) + 64 * (9 / 10 : β) ^ (2 ^ d)))) ^ 2 =
196 * (2 ^ d : β) ^ 3 *
((1 / 2 : β) ^ (8 * (d + 2 + 2)) + 64 * (9 / 10 : β) ^ (2 ^ d)) := by
rw [mul_pow, Real.sq_sqrt (by positivity), hc]
push_cast
ring
rw [hsq]
nlinarith [pow_nonneg (by norm_num : (0 : β) β€ 1 / 32) d]
lemma average_discarded_le {ΞΉ : Type*} [Fintype ΞΉ] (d : β)
(L : Sum ΞΉ (Position (d + 1 + 2)) β Position (d + 2 + 2)) :
(β p, marginal (frameJoint L (400 * (d + 2 + 2))) p *
Trim.discarded (Block.embedding (Block.eightEquiv d)) (frameKernel L (400 * (d + 2 + 2)) p)) β€
16 * conditionalRate d := by
let T := 400 * (d + 2 + 2)
let q := marginal (frameJoint L T)
let ΞΌ := frameKernel L T
have hp (p) := Block.discarded_ordered_bound (Block.eightEquiv d) (Block.ordering d) (ΞΌ p)
(frameKernel_nonneg L T p) (frameKernel_sum L T p)
have hb := Finset.sum_le_sum (s := Finset.univ) (fun p _ =>
mul_le_mul_of_nonneg_left (hp p) (marginal_nonneg _ (frameJoint_nonneg L T) p))
have hu (i : Fin 8) :
Trim.push (fun _ : State (d+1+2) => (Fintype.card (State (d+1+2)) : β)β»ΒΉ)
(Block.orderedRestriction (Block.eightEquiv d) i (Block.ordering d i)) =
fairMass (fun g : State (d+1+2) => g β Block.domain d i) := Block.push_uniform_ordered d i
simp only [hu] at hb
change (β p, q p * Trim.discarded _ (ΞΌ p)) β€
β p, q p * (2 * β i, tv (Trim.push (ΞΌ p) (fun g => g β Block.domain d i))
(fairMass (fun g : State (d+1+2) => g β Block.domain d i))) at hb
have hswap : (β p, q p * (2 * β i, tv (Trim.push (ΞΌ p) (fun g => g β Block.domain d i))
(fairMass (fun g : State (d+1+2) => g β Block.domain d i)))) =
2 * β i, β p, q p * tv (Trim.push (ΞΌ p) (fun g => g β Block.domain d i))
(fairMass (fun g : State (d+1+2) => g β Block.domain d i)) := by
simp only [Finset.mul_sum]
rw [Finset.sum_comm]
apply Finset.sum_congr rfl
intro i _
apply Finset.sum_congr rfl
intro p _
ring
rw [hswap] at hb
have hi (i : Fin 8) := frameKernel_marginal_rate d L (Block.domain d i) (Block.domain_injective d i)
have hs := Finset.sum_le_sum (s := Finset.univ) (fun i _ => hi i)
simp only [Finset.sum_const, Finset.card_univ, Fintype.card_fin, nsmul_eq_mul] at hs
dsimp only [q, ΞΌ, T] at hb
norm_num only [Nat.cast_ofNat] at hs
exact hb.trans (by linarith)
end Thorp.Conditional
end
end OAI
|