File size: 2,993 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
import OAI.Dynamics.ConditionalShuffle.OverlayDistance

namespace OAI

noncomputable section
open scoped Classical
namespace Thorp.Conditional.OverlayEnergy

def cycles (g : β„•) (v : RawState (g+3)) : (n : β„•) β†’ (Fin n β†’ CycleCoins g) β†’ RawState (g+3)
  | 0, _ => v
  | n+1, Ο‰ => cycle g (cycles g v n (Fin.init Ο‰)) (Ο‰ (Fin.last n))

def cyclesPerm (g : β„•) : (n : β„•) β†’ (Fin n β†’ CycleCoins g) β†’ State (g+3)
  | 0, _ => 1
  | n+1, Ο‰ => cyclePerm g (Ο‰ (Fin.last n)) * cyclesPerm g n (Fin.init Ο‰)

lemma cycles_free (g : β„•) (v : RawState (g+3)) (n : β„•) (Ο‰ : Fin n β†’ CycleCoins g) (y) :
    (cycles g v n Ο‰).free y = v.free ((cyclesPerm g n Ο‰).symm y) := by
  induction n generalizing y with
  | zero => rfl
  | succ n ih =>
      rw [cycles, cycle_free, ih]
      rfl

lemma cycles_count (g : β„•) (v : RawState (g+3)) (n : β„•) (Ο‰ : Fin n β†’ CycleCoins g) :
    freeCount (cycles g v n Ο‰).free = freeCount v.free := by
  induction n with
  | zero => rfl
  | succ n ih => exact (cycle_count g _ _).trans (ih (Fin.init Ο‰))

lemma cycles_mass (g : β„•) (v : RawState (g+3)) (n : β„•) (Ο‰ : Fin n β†’ CycleCoins g) :
    (βˆ‘ x, (cycles g v n Ο‰).weight x) = βˆ‘ x, v.weight x := by
  induction n with
  | zero => rfl
  | succ n ih => exact (cycle_mass g _ _).trans (ih (Fin.init Ο‰))

lemma cycles_support (g : β„•) (v : RawState (g+3))
    (hw : βˆ€ x, v.free x = false β†’ v.weight x = 0) (n : β„•) (Ο‰ : Fin n β†’ CycleCoins g) :
    βˆ€ x, (cycles g v n Ο‰).free x = false β†’ (cycles g v n Ο‰).weight x = 0 := by
  induction n with
  | zero => exact hw
  | succ n ih => exact cycle_support g _ (ih (Fin.init Ο‰)) _

lemma cycles_energy_le (g : β„•) (v : RawState (g+3)) (n : β„•) (Ο‰ : Fin n β†’ CycleCoins g) :
    rawEnergy (cycles g v n Ο‰) ≀ rawEnergy v := by
  induction n with
  | zero => exact le_rfl
  | succ n ih => exact (cycle_energy_le g _ _).trans (ih (Fin.init Ο‰))

lemma cycles_expected_energy (g : β„•) (v : RawState (g+3))
    (hw : βˆ€ x, v.free x = false β†’ v.weight x = 0) (hz : βˆ‘ x, v.weight x = 0)
    (hf : Fintype.card (Position (g+3)) ≀ 64 * freeCount v.free)
    (hk : freeCount v.free ≀ 2^g)
    (hs : 256*(g+4) ≀ Fintype.card (Position (g+3))) (n : β„•) :
    mean (fun Ο‰ : Fin n β†’ CycleCoins g => rawEnergy (cycles g v n Ο‰)) ≀
      rawEnergy v * coefficient g ^ n := by
  induction n with
  | zero => simp only [cycles, mean_const, pow_zero, mul_one, le_refl]
  | succ n ih =>
      rw [mean_function_snoc]
      simp only [cycles, Fin.init_snoc, Fin.snoc_last]
      have hh := mean_le_mean (fun Ο‰ : Fin n β†’ CycleCoins g => cycle_expected_energy g
        (cycles g v n Ο‰) (cycles_support g v hw n Ο‰) ((cycles_mass g v n Ο‰).trans hz)
        (by rwa [cycles_count]) (by rwa [cycles_count]) hs)
      rw [mean_mul_const] at hh
      exact hh.trans ((mul_le_mul_of_nonneg_right ih (coefficient_nonneg g)).trans_eq (by
        rw [pow_succ, mul_assoc]))

end Thorp.Conditional.OverlayEnergy

end

end OAI