File size: 4,356 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 | import OAI.Computability.PerfectCompleteness.Foundations.CutTerminalSplit
import OAI.Computability.PerfectCompleteness.Sampling.CutSamplerLocality
namespace OAI
section
namespace PerfectCompleteness.CutTerminalZero
open RecursiveSpaces DescendantSpaces RecursiveSampler TerminalCalls
open scoped Classical
noncomputable section
universe u w
variable {branch : Nat β Nat} {n m : Nat}
(π : Type w) [Field π] (repeats : Nat β Nat)
theorem terminalFactorEquiv_refl (A : Slots branch (m + 1) β Type u)
(terminal : TerminalIndex repeats (.refl (m + 1)))
(x : CutSamplerRefinement.RefinedSpace π repeats (.refl (m + 1)) A
(drawIndex repeats (.refl (m + 1)) terminal)) :
CutTerminalSplit.terminalFactorEquiv π repeats (.refl (m + 1)) A terminal x = x := rfl
theorem terminalFactorEquiv_step (i : Fin (branch n))
(p : Path branch n (m + 1)) (A : Slots branch (n + 1) β Type u)
(call : Fin (repeats (n + 1)) Γ Bool) (terminal : TerminalIndex repeats p)
(x : CutSamplerRefinement.RefinedSpace π repeats p (childFamily A i)
(drawIndex repeats p terminal)) :
CutTerminalSplit.terminalFactorEquiv π repeats (.step i p) A (call, terminal) x =
CutTerminalSplit.terminalFactorEquiv π repeats p (childFamily A i) terminal x := rfl
theorem splitTape_terminal_step (i : Fin (branch n))
(p : Path branch n (m + 1)) (A : Slots branch (n + 1) β Type u)
(tape : CutSamplerRefinement.Tape π repeats (.step i p) A)
(h : Fin (repeats (n + 1))) (b : Bool) (terminal : TerminalIndex repeats p) :
(CutTerminalSplit.splitTape π repeats (.step i p) A tape).1 ((h, b), terminal) =
(CutTerminalSplit.splitTape π repeats p (childFamily A i)
(CutSamplerLocality.subTape π repeats i p A tape h b)).1 terminal := by
simp only [CutTerminalSplit.splitTape_terminal_apply]
rfl
theorem zeroAtClean_iff (p : Path branch n (m + 1)) :
β (A : Slots branch n β Type u) (clean : Fin (branch m) β Prop)
(tape : CutSamplerRefinement.Tape π repeats p A),
(β terminal i, clean i β
(CutTerminalSplit.splitTape π repeats p A tape).1 terminal i = 0) β
CutSamplerLocality.ZeroAtClean π repeats p A clean tape := by
induction n generalizing m with
| zero =>
have h := p.height_le
omega
| succ n ih =>
cases p with
| refl =>
intro A clean tape
constructor
Β· intro hzero i hi
exact hzero () i hi
Β· intro hzero terminal i hi
cases terminal
exact hzero i hi
| step i p =>
intro A clean tape
constructor
Β· intro hzero h b
apply (ih p (childFamily A i) clean
(CutSamplerLocality.subTape π repeats i p A tape h b)).mp
intro terminal j hj
apply Subtype.ext
have hread := congrArg
(fun f : CutTerminalSplit.TerminalFactor π (.step i p) A => (f j).val)
(splitTape_terminal_step π repeats i p A tape h b terminal)
exact hread.symm.trans (congrArg Subtype.val (hzero ((h, b), terminal) j hj))
Β· intro hzero terminal j hj
rcases terminal with β¨β¨h, bβ©, terminalβ©
have hsub := (ih p (childFamily A i) clean
(CutSamplerLocality.subTape π repeats i p A tape h b)).mpr (hzero h b)
apply Subtype.ext
have hread := congrArg
(fun f : CutTerminalSplit.TerminalFactor π (.step i p) A => (f j).val)
(splitTape_terminal_step π repeats i p A tape h b terminal)
exact hread.trans (congrArg Subtype.val (hsub terminal j hj))
theorem evaluate_factors_of_split_zero (p : Path branch n (m + 1))
(A : Slots branch n β Type u) (clean : Fin (branch m) β Prop)
(tape : CutSamplerRefinement.Tape π repeats p A)
(hzero : β terminal i, clean i β
(CutTerminalSplit.splitTape π repeats p A tape).1 terminal i = 0) :
(CutSamplerRefinement.evaluate π repeats p A tape).val β
FactoredFunctions.factoringSpace (CutSamplerLocality.view p A clean) :=
CutSamplerLocality.evaluate_factors π repeats p A clean tape
((zeroAtClean_iff π repeats p A clean tape).mp hzero)
end
end PerfectCompleteness.CutTerminalZero
end
end OAI
|