math / data /lean /OAI /Combinatorics /EditApproximation /Geometry /ChargedRandomGlobalQuery.lean
introvoyz045's picture
Migrated from GitHub
4a56cd6 verified
Raw History Blame Contribute Delete
4.09 kB
import OAI.Combinatorics.EditApproximation.Refinement.PhysicalRandomBoundedQuery
import OAI.Combinatorics.EditApproximation.Geometry.ChargedGlobalQuery
import OAI.Combinatorics.EditApproximation.Definitions
namespace OAI
/-! The coarse seed, recursive table values, and random scalar sources are
all requested through the memo program. Inactive refinement branches use
the existing explicit coarse/median seed queries. -/
namespace EditApproximation
section Global
variable {Οƒ Ξ± : Type*} [DecidableEq Ξ±] {M J R : β„•} [NeZero M] [NeZero R]
(source target : List Ξ±) (N P F exponent H Q T S passes copies : β„•)
(factor : β„• β†’ β„š) (multiplier : β„• β†’ β„•) (tau eta kappa delta : β„š)
(readGroup : β„• β†’ β„• β†’ PhysicalInternalNode M J β†’ Fin R β†’ GroupScalarKey M F Q β†’ FiniteQuery Οƒ)
(readInteger : β„• β†’ β„• β†’ PhysicalInternalNode M J β†’ Fin R β†’
(β„• Γ— TargetInterval target.length) β†’ β„• β†’ FiniteQuery Οƒ)
(initial : PhysicalEntry M J target.length β†’ β„•)
variable
(group : β„• β†’ β„• β†’ PhysicalInternalNode M J β†’ Fin R β†’ CellGroupDraws M F Q)
(integer : β„• β†’ β„• β†’ PhysicalInternalNode M J β†’ Fin R β†’ β„• β†’ TargetInterval target.length β†’ β„•)
(sourceAnswer : Οƒ β†’ β„š)
/-- Composition with the local source-provider correctness theorem. -/
theorem chargedRandomGlobalQuery_value
(hbody : βˆ€ parent,
(physicalRandomBoundedQuery source target N P F exponent H Q T S passes copies factor multiplier
tau eta kappa delta readGroup readInteger initial parent).value
(Sum.elim sourceAnswer (fun child => localRequestValue source target N P F exponent H Q T S copies
factor multiplier tau eta kappa delta group integer initial child.val.val)) =
localRequestValue source target N P F exponent H Q T S copies factor multiplier
tau eta kappa delta group integer initial parent.val)
(request : ChargedPhysicalRequest M J target.length passes copies T S) :
(chargedRandomGlobalQuery source target N P F exponent H Q T S passes copies factor multiplier
tau eta kappa delta readGroup readInteger initial request).value
(Sum.elim sourceAnswer (fun child => chargedRequestValue source target N P F exponent H Q T S
passes copies factor multiplier tau eta kappa delta group integer initial child.val)) =
chargedRequestValue source target N P F exponent H Q T S passes copies factor multiplier
tau eta kappa delta group integer initial request := by
cases request with
| inl entry => rfl
| inr parent =>
change _ = localRequestValue source target N P F exponent H Q T S copies factor multiplier
tau eta kappa delta group integer initial parent.val
unfold chargedRandomGlobalQuery
dsimp only
split_ifs with hi hd hw
Β· rw [FiniteQuery.mapKeys_value]
exact chargedWarmupQuery_value source target N P F exponent H Q T S passes copies
factor multiplier tau eta kappa delta group integer initial parent hi
Β· rw [FiniteQuery.mapKeys_value,
localRequestValue_terminal source target N P F exponent H Q T S copies factor multiplier
tau eta kappa delta group integer initial parent.val (Or.inr hw)]
exact physicalInitialQuery_value_local source target N P F _ _ _ _ _ _
(chargedSeedQuery_localValue source target N P F exponent H Q T S passes copies
factor multiplier tau eta kappa delta group integer initial parent)
Β· rw [FiniteQuery.mapKeys_value]
refine Eq.trans ?_ (hbody parent)
congr 1
funext next
cases next <;> rfl
Β· rw [FiniteQuery.mapKeys_value,
localRequestValue_terminal source target N P F exponent H Q T S copies factor multiplier
tau eta kappa delta group integer initial parent.val (Or.inl hd)]
exact physicalInitialQuery_value_local source target N P F _ _ _ _ _ _
(chargedSeedQuery_localValue source target N P F exponent H Q T S passes copies
factor multiplier tau eta kappa delta group integer initial parent)
end Global
end EditApproximation
end OAI