theoremjoint_eq_of_view_eq (rows repeats : Nat→Nat) (p : Path branch n (m + 1)) :
∀ (slots : Slots branch n →Fin t →MixedSupport.Slot)
(clean : Fin (branch m) →Prop)
(tape : WholeCutSampler.Tape rows repeats p slots),
WholeCutZero.ZeroAtClean rows repeats p slots clean tape →∀x y : Domain slots,
CutSamplerLocality.view p (LeafDomain slots) clean x =
CutSamplerLocality.view p (LeafDomain slots) clean y →
joint (WholeCutSampler.evaluate rows repeats p slots tape) x =
joint (WholeCutSampler.evaluate rows repeats p slots tape) y :=by
proof · 84
lines
induction n generalizing m with
| zero =>have h := p.height_le
omega
| succ n ih =>
cases p with
| refl =>
intro slots clean tape hzero x y hview
funext node row
rcases node with u | ⟨i, node⟩
· cases u
letscalarTape : CutSamplerRefinement.TapeF2 repeats (.refl (n + 1))
(LeafDomain slots) :=fun _ i => (tape i).1 row
havehz : CutSamplerLocality.ZeroAtCleanF2 repeats (.refl (n + 1))
(LeafDomain slots) clean scalarTape :=fun i hi => (hzero i hi).1 row
exact CutSamplerLocality.evaluate_eq_of_view_eq F2 repeats (.refl (n + 1))
(LeafDomain slots) clean scalarTape hz x y hview
· change ((tape i).2 node row).val
(restrictNode (childSlots slots i) node (restrictChild slots i x)) =
((tape i).2 node row).val
(restrictNode (childSlots slots i) node (restrictChild slots i y))
by_cases hi : clean i
· rw [(hzero i hi).2 node row]
rfl
· exact congrArg
(fun z => ((tape i).2 node row).val (restrictNode (childSlots slots i) node z))
(congrFun hview ⟨i, hi⟩)
| step i p =>
intro slots clean tape hzero x y hview
havehout : ∀j : RecursiveSampler.OffPath i,
restrictChild slots j.val x = restrictChild slots j.val y :=
congrFun (congrArg Prod.fst hview)
havehin :
CutSamplerLocality.view p (LeafDomain (childSlots slots i)) clean
(restrictChild slots i x) =
CutSamplerLocality.view p (LeafDomain (childSlots slots i)) clean
(restrictChild slots i y) := congrArg Prod.snd hview
funext node row
rcases node with u | ⟨j, node⟩
· cases u
change
(WholeCutSampler.evaluate rows repeats (.step i p) slots tape (.inl ()) row).val x =
(WholeCutSampler.evaluate rows repeats (.step i p) slots tape (.inl ()) row).val y
simp only [evaluate_root]
have hx :=BucketSampler.evaluate_apply (rows (n + 1))
(space F2 branch (n + 1) (LeafDomain slots))
(CutSamplerRefinement.evaluate F2 repeats (.step i p) (LeafDomain slots))
tape.1 row x
have hy :=BucketSampler.evaluate_apply (rows (n + 1))
(space F2 branch (n + 1) (LeafDomain slots))
(CutSamplerRefinement.evaluate F2 repeats (.step i p) (LeafDomain slots))
tape.1 row y
refine hx.trans (Eq.trans ?_ hy.symm)
refine Finset.sum_congr (ι :=BucketSampler.Direction (rows (n + 1))) ?_ ?_
· ext v
simp only [Finset.mem_univ]
· intro v _
exact congrArg (funz : F2=> v.val row * z)
(CutSamplerLocality.evaluate_eq_of_view_eq F2 repeats (.step i p)
(LeafDomain slots) clean (tape.1 v) (hzero.1 v) x y hview)
· by_cases hji : j = i
· subst j
have hselected := ih p (childSlots slots i) clean tape.2.1 hzero.2
(restrictChild slots i x) (restrictChild slots i y) hin
have hrow := congrFun (congrFun hselected node) row
change
(WholeCutSampler.evaluate rows repeats (.step i p) slots tape
(.inr (i, node)) row).val
(restrictNode (childSlots slots i) node (restrictChild slots i x)) =
(WholeCutSampler.evaluate rows repeats (.step i p) slots tape
(.inr (i, node)) row).val
(restrictNode (childSlots slots i) node (restrictChild slots i y))
simp only [evaluate_selected]
exact hrow
· change
(WholeCutSampler.evaluate rows repeats (.step i p) slots tape
(.inr (j, node)) row).val
(restrictNode (childSlots slots j) node (restrictChild slots j x)) =
(WholeCutSampler.evaluate rows repeats (.step i p) slots tape
(.inr (j, node)) row).val
(restrictNode (childSlots slots j) node (restrictChild slots j y))
rw [evaluate_ordinary rows repeats i p slots tape ⟨j, hji⟩ node]
rw [hout ⟨j, hji⟩]
theoremquery_constant
(hzero : WholeCutZero.GroupedAtClean rows repeats p slots clean tape)
(x y : MixedSupport.Assignment (TreeCanonical.numberedSlots slots))
(hret : CleanKeyErasure.retain (TreeCanonical.numberedSlots slots) (numberedKeep p clean) x =
CleanKeyErasure.retain (TreeCanonical.numberedSlots slots) (numberedKeep p clean) y) :
query rows repeats p slots tape post x = query rows repeats p slots tape post y :=
proof · 2
lines
congrArg post (WholeCutLocality.fullJoint_eq_of_grouped_zero rows repeats p slots clean
tape hzero _ _ (view_eq_of_retained p slots clean x y hret))
theoremclean_position_dropped
(hzero : WholeCutZero.GroupedAtClean rows repeats p slots clean tape)
(i : Fin (branch m)) (hi : clean i) (s : Slots branch m) (k : Fin t) :
MixedSupport.keyFields (TreeCanonical.numberedSlots slots)
(query rows repeats p slots tape post)
(TreeCanonical.numbering branch n t (p.slotEmbedding (i, s), k)) = .dropped :=
proof · 4
lines
CleanKeyErasure.keyFields_dropped_of_retained (TreeCanonical.numberedSlots slots)
(numberedKeep p clean) (query rows repeats p slots tape post)
(query_constant rows repeats p slots clean tape post hzero) _
(not_numberedKeep_clean p clean i hi s k)