File size: 3,479 Bytes
2f887db
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import OAI.Computability.PerfectCompleteness.Decoding.LowerCutPairLemmas

namespace OAI

section

namespace PerfectCompleteness.CutCallOriginalLaw

open RecursiveSpaces TreeSourceSpaces HierarchicalArrays WholeCutGrouping
open UniqueGamesTheorem.Foundations.Games
open scoped Classical

noncomputable section

section Original

variable {branch : Nat → Nat} {n t : Nat} {C : Type*} [Fintype C]
  (slots : Slots branch (n + 1) → Fin t → MixedSupport.Slot)
  (rows : Nat → Nat)

def originalLinear : CutCallExtension.Extended (C := C) slots rows →ₗ[ZMod 2]
    CutChildGrouping.Raw (C := C) slots rows where
  toFun := CutCallExtension.original slots rows
  map_add' _ _ := rfl
  map_smul' _ _ := rfl

omit [Fintype C] in
theorem originalLinear_surjective : Function.Surjective
    (originalLinear (C := C) slots rows) := by
  intro old
  refine ⟨fun i => (fun c => match c with
    | none => 0
    | some c => (old i).1 c, (old i).2), ?_⟩
  rfl

theorem original_law :
    (CutChildGrouping.rawLaw (C := Option C) slots rows).pushforward
        (CutCallExtension.original slots rows) =
      CutChildGrouping.rawLaw (C := C) slots rows := by
  unfold CutChildGrouping.rawLaw
  rw [UniformLinearImage.law_uniform, UniformLinearImage.law_uniform]
  exact UniformLinearImage.uniform_pushforward_linearMap
    (originalLinear slots rows) (originalLinear_surjective slots rows)

theorem original_probability (event : CutChildGrouping.Raw (C := C) slots rows → Bool) :
    (CutChildGrouping.rawLaw (C := Option C) slots rows).probability
        (fun raw => event (CutCallExtension.original slots rows raw)) =
      (CutChildGrouping.rawLaw (C := C) slots rows).probability event := by
  rw [← FiniteDistribution.probability_pushforward, original_law]

end Original

section First

variable {branch : Nat → Nat} {n m t : Nat}
  (rows repeats : Nat → Nat) (p : DescendantSpaces.Path branch n (m + 1))
  (slots : Slots branch n → Fin t → MixedSupport.Slot)

theorem first_law (exterior : Exterior rows repeats p slots) :
    (CutChildGrouping.rawLaw (C := Option (LowerCutPair.Calls rows repeats p))
        (cutSlots p slots) rows).pushforward
        (LowerCutPair.first rows repeats p slots exterior) =
      (CutChildGrouping.rawLaw (C := LowerCutPair.Calls rows repeats p)
        (cutSlots p slots) rows).pushforward
        (LowerCutRows.reconstruct rows repeats p slots exterior) := by
  change (CutChildGrouping.rawLaw
    (C := Option (LowerCutPair.Calls rows repeats p)) (cutSlots p slots) rows).pushforward
    (fun raw => LowerCutRows.reconstruct rows repeats p slots exterior
      (CutCallExtension.original (cutSlots p slots) rows raw)) = _
  rw [← FiniteDistribution.pushforward_comp, original_law]

theorem first_probability (exterior : Exterior rows repeats p slots)
    (event : Arrays slots rows → Bool) :
    (CutChildGrouping.rawLaw (C := Option (LowerCutPair.Calls rows repeats p))
        (cutSlots p slots) rows).probability
        (fun raw => event (LowerCutPair.first rows repeats p slots exterior raw)) =
      (CutChildGrouping.rawLaw (C := LowerCutPair.Calls rows repeats p)
        (cutSlots p slots) rows).probability
        (fun raw => event (LowerCutRows.reconstruct rows repeats p slots exterior raw)) := by
  exact original_probability (cutSlots p slots) rows
    (fun raw => event (LowerCutRows.reconstruct rows repeats p slots exterior raw))

end First
end
end PerfectCompleteness.CutCallOriginalLaw

end

end OAI