File size: 1,741 Bytes
92416a2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import OAI.Dynamics.ConditionalShuffle.OverlayGauge

namespace OAI

noncomputable section
open scoped Classical
namespace Revealed.Overlay
open Thorp Thorp.Conditional Revealed.Split Revealed.Instrument Revealed.Scheduled

lemma fairMass_equiv_tv {Ω G : Type} [Fintype Ω] [Fintype G] (f : Ω → G) (e : G ≃ G) :
    tv (fairMass (fun ω => e (f ω))) (fun _ => (Fintype.card G : ℝ)⁻¹) =
      tv (fairMass f) (fun _ => (Fintype.card G : ℝ)⁻¹) := by
  unfold tv
  rw [← Equiv.sum_comp e]
  congr 1
  apply Finset.sum_congr rfl
  intro g _
  simp only [fairMass, e.injective.eq_iff]

variable {ι α : Type} [Fintype ι] [Fintype α] [DecidableEq α]

lemma expectedTV_instrument (d : ℕ) (L : Sum ι α ≃ Position (d+1)) (σ : ℕ → Bool) (t : ℕ) :
    expectedTV d L σ t = Instrument.distance (stepInstrument (d+1) σ) (0,Split.outside L) t := by
  unfold expectedTV conditionalLaw
  have hh (c : History (d+1) t) :
      tv (fairMass (overlayRun d L σ t c)) (fun _ => (Fintype.card (Equiv.Perm α) : ℝ)⁻¹) =
        tv (fairMass (resampledRun (stepInstrument (d+1) σ) (xorIncrement d σ) (0,Split.outside L) t c))
          (fun _ => (Fintype.card (Equiv.Perm α) : ℝ)⁻¹) := by
    have he : overlayRun d L σ t c = fun r =>
        ((Equiv.mulLeft ((assignment (L.trans (run (d+1) t c)))⁻¹)).trans
          (Equiv.mulRight (assignment L)))
            (resampledRun (stepInstrument (d+1) σ) (xorIncrement d σ) (0,Split.outside L) t c r) := by
      funext r
      exact overlayRun_gauge d L σ t c r
    rw [he]
    exact fairMass_equiv_tv _ _
  simp_rw [hh]
  exact resampled_distance (stepInstrument (d+1) σ) (xorIncrement d σ) (xorIncrement_law d σ) _ t

end Revealed.Overlay

end

end OAI