Buckets:
| import Mathlib.Logic.Equiv.Prod | |
| import OAI.Computability.PerfectCompleteness.Construction.HiddenBucketBias | |
| import OAI.Computability.PerfectCompleteness.Foundations.TerminalCalls | |
| import OAI.Computability.PerfectCompleteness.Sampling.CutSamplerRefinement | |
| import OAI.Computability.UniqueGames.Foundations.SamplingLemmas | |
| namespace OAI | |
| section | |
| namespace PerfectCompleteness.CutTerminalSplit | |
| open PointwiseSpaces RecursiveSpaces DescendantSpaces RecursiveSampler TerminalCalls | |
| open UniqueGamesTheorem.Foundations.Games | |
| open scoped Classical | |
| noncomputable section | |
| universe u w | |
| variable {branch : Nat โ Nat} {n m : Nat} | |
| theorem refinedSpace_eq_terminal (๐ : Type w) [Field ๐] | |
| (repeats : Nat โ Nat) (p : Path branch n m) : | |
| โ (A : Slots branch n โ Type u) (terminal : TerminalIndex repeats p), | |
| CutSamplerRefinement.RefinedSpace ๐ repeats p A (drawIndex repeats p terminal) = | |
| CutSamplerRefinement.RefinedSpace ๐ repeats (.refl m) (p.family A) () := by | |
| induction p with | |
| | refl n => | |
| intro A terminal | |
| cases terminal | |
| rfl | |
| | step i p ih => | |
| intro A terminal | |
| exact ih (childFamily A i) terminal.2 | |
| variable (๐ : Type w) [Field ๐] (repeats : Nat โ Nat) | |
| (p : Path branch n (m + 1)) (A : Slots branch n โ Type u) | |
| abbrev TerminalFactor := | |
| (i : Fin (branch m)) โ squareSpace (space ๐ branch m (childFamily (p.family A) i)) | |
| abbrev TerminalTape := TerminalIndex repeats p โ TerminalFactor ๐ p A | |
| abbrev ExteriorIndex := {j : DrawIndex repeats p // ยฌ IsTerminal repeats p j} | |
| abbrev ExteriorTape := | |
| (j : ExteriorIndex repeats p) โ CutSamplerRefinement.RefinedSpace ๐ repeats p A j.val | |
| def terminalFactorEquiv (terminal : TerminalIndex repeats p) : | |
| CutSamplerRefinement.RefinedSpace ๐ repeats p A (drawIndex repeats p terminal) โ | |
| TerminalFactor ๐ p A := | |
| Equiv.cast (refinedSpace_eq_terminal ๐ repeats p A terminal) | |
| def terminalTapeEquiv : | |
| ((j : {j : DrawIndex repeats p // IsTerminal repeats p j}) โ | |
| CutSamplerRefinement.RefinedSpace ๐ repeats p A j.val) โ | |
| TerminalTape ๐ repeats p A := | |
| ((Equiv.piCongrLeft | |
| (fun j : {j : DrawIndex repeats p // IsTerminal repeats p j} => | |
| CutSamplerRefinement.RefinedSpace ๐ repeats p A j.val) | |
| (terminalSubtypeEquiv repeats p)).symm).trans | |
| (Equiv.piCongrRight (terminalFactorEquiv ๐ repeats p A)) | |
| def splitTape : | |
| CutSamplerRefinement.Tape ๐ repeats p A โ | |
| TerminalTape ๐ repeats p A ร ExteriorTape ๐ repeats p A := | |
| (Equiv.piEquivPiSubtypeProd (IsTerminal repeats p) | |
| (CutSamplerRefinement.RefinedSpace ๐ repeats p A)).trans | |
| (Equiv.prodCongr (terminalTapeEquiv ๐ repeats p A) (Equiv.refl _)) | |
| @[simp] theorem splitTape_terminal_apply | |
| (x : CutSamplerRefinement.Tape ๐ repeats p A) (terminal : TerminalIndex repeats p) : | |
| (splitTape ๐ repeats p A x).1 terminal = | |
| terminalFactorEquiv ๐ repeats p A terminal (x (drawIndex repeats p terminal)) := rfl | |
| @[simp] theorem splitTape_exterior_apply | |
| (x : CutSamplerRefinement.Tape ๐ repeats p A) (j : ExteriorIndex repeats p) : | |
| (splitTape ๐ repeats p A x).2 j = x j.val := rfl | |
| variable [Finite ๐] [โ s, Finite (A s)] | |
| instance childSquareFintype (i : Fin (branch m)) : | |
| Fintype (squareSpace (space ๐ branch m (childFamily (p.family A) i))) := | |
| Fintype.ofFinite _ | |
| def terminalLaw : FiniteDistribution (TerminalTape ๐ repeats p A) := | |
| FiniteProduct.law (fun _ : TerminalIndex repeats p => | |
| FiniteProduct.law (fun i : Fin (branch m) => | |
| FiniteDistribution.uniform | |
| (squareSpace (space ๐ branch m (childFamily (p.family A) i))))) | |
| def exteriorLaw : FiniteDistribution (ExteriorTape ๐ repeats p A) := | |
| FiniteProduct.law (fun j : ExteriorIndex repeats p => | |
| FiniteDistribution.uniform (CutSamplerRefinement.RefinedSpace ๐ repeats p A j.val)) | |
| theorem terminalLaw_uniform : | |
| terminalLaw ๐ repeats p A = FiniteDistribution.uniform (TerminalTape ๐ repeats p A) := by | |
| simp only [terminalLaw, UniformLinearImage.law_uniform] | |
| theorem exteriorLaw_uniform : | |
| exteriorLaw ๐ repeats p A = FiniteDistribution.uniform (ExteriorTape ๐ repeats p A) := | |
| UniformLinearImage.law_uniform | |
| theorem split_tapeLaw : | |
| (CutSamplerRefinement.tapeLaw ๐ repeats p A).pushforward (splitTape ๐ repeats p A) = | |
| (terminalLaw ๐ repeats p A).product (exteriorLaw ๐ repeats p A) := by | |
| unfold CutSamplerRefinement.tapeLaw | |
| rw [UniformLinearImage.law_uniform, FiniteDistribution.pushforward_equiv, | |
| terminalLaw_uniform, exteriorLaw_uniform] | |
| apply FiniteDistribution.eq_of_weight_eq | |
| intro x | |
| change 1 / (Fintype.card (CutSamplerRefinement.Tape ๐ repeats p A) : โ) = | |
| (1 / (Fintype.card (TerminalTape ๐ repeats p A) : โ)) * | |
| (1 / (Fintype.card (ExteriorTape ๐ repeats p A) : โ)) | |
| rw [Fintype.card_congr (splitTape ๐ repeats p A), Fintype.card_prod] | |
| simp only [Nat.cast_mul, one_div, mul_inv] | |
| theorem terminal_marginal : | |
| (CutSamplerRefinement.tapeLaw ๐ repeats p A).pushforward | |
| (fun x => (splitTape ๐ repeats p A x).1) = terminalLaw ๐ repeats p A := by | |
| rw [โ FiniteDistribution.pushforward_comp (CutSamplerRefinement.tapeLaw ๐ repeats p A) | |
| (splitTape ๐ repeats p A) Prod.fst, split_tapeLaw] | |
| exact HiddenBucketBias.product_fst | |
| (terminalLaw ๐ repeats p A) (exteriorLaw ๐ repeats p A) | |
| theorem terminal_marginal_uniform : | |
| (CutSamplerRefinement.tapeLaw ๐ repeats p A).pushforward | |
| (fun x => (splitTape ๐ repeats p A x).1) = | |
| FiniteDistribution.uniform (TerminalTape ๐ repeats p A) := by | |
| rw [terminal_marginal, terminalLaw_uniform] | |
| end | |
| end PerfectCompleteness.CutTerminalSplit | |
| end | |
| end OAI | |
Xet Storage Details
- Size:
- 5.76 kB
- Xet hash:
- 00b0ad5acafa1059b1d6951f84a29102ffc45f8d2010f7c75845e04e8a4d83f9
ยท
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.