File size: 2,192 Bytes
c4cdbbd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import OAI.Probability.InvariantIsing.Fields.CascadeSeedLeaf
import OAI.Probability.InvariantIsing.Fields.MarkForestRootLaw

namespace OAI

/-! The ancestor-state increment path generated by an independent seed forest. -/
noncomputable section
open MeasureTheory ProbabilityTheory IsingPerceptron
namespace InvariantIsing
variable {ι : Type}

def cascadeSeedPath : (n : ℕ) → (ℕ → (ι → ℝ) → unitInterval → (ι → ℝ)) →
    (ι → ℝ) → MarkForest unitInterval n → LabeledLeaf n → Fin n → (ι → ℝ)
  | 0, _, _, _, _ => Fin.elim0
  | n+1, ψ, z, g, α =>
      Fin.cons (ψ 0 z (g α.1.1 α.1.2).1)
        (cascadeSeedPath n (fun j => ψ (j+1)) (z+ψ 0 z (g α.1.1 α.1.2).1)
          (g α.1.1 α.1.2).2 α.2)

lemma measurable_cascadeSeedPath (n : ℕ)
    (ψ : ℕ → (ι → ℝ) → unitInterval → (ι → ℝ))
    (hψ : ∀ i, Measurable (Function.uncurry (ψ i))) (α : LabeledLeaf n) :
    Measurable (fun p : (ι → ℝ) × MarkForest unitInterval n => cascadeSeedPath n ψ p.1 p.2 α) := by
  induction n generalizing ψ with
  | zero => exact Measurable.of_eval fun i => i.elim0
  | succ n ih =>
    have hm : Measurable (fun p : (ι → ℝ) × MarkForest unitInterval (n+1) =>
        ψ 0 p.1 (p.2 α.1.1 α.1.2).1) :=
      (hψ 0).comp (measurable_fst.prodMk (by fun_prop))
    apply Measurable.of_eval
    intro i
    refine Fin.cases hm ?_ i
    intro j
    exact ((measurable_pi_apply j).comp (ih _ (fun i => hψ (i+1)) α.2)).comp
      ((measurable_fst.add hm).prodMk (by fun_prop))

lemma cascadeSeedPath_labeled (n : ℕ)
    (ψ : ℕ → (ι → ℝ) → unitInterval → (ι → ℝ)) (z : ι → ℝ)
    (T : LabeledTree n) (g : MarkForest unitInterval n) (α : LabeledLeaf n) :
    noiseLeafMark n (cascadeSeedLeaf n ψ z (labeledNoiseLeaf unitInterval n (T,g) α)) =
      cascadeSeedPath n ψ z g α := by
  induction n generalizing ψ z with
  | zero => exact funext fun i => i.elim0
  | succ n ih =>
    funext i
    refine Fin.cases rfl (fun j => ?_) i
    exact congrFun (ih (fun k => ψ (k+1)) (z+ψ 0 z (g α.1.1 α.1.2).1)
      (T.2 α.1.1 α.1.2) (g α.1.1 α.1.2).2 α.2) j

end InvariantIsing

end

end OAI