Download data/lean/OAI/Dynamics/ConditionalShuffle/InstrumentChunks.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 3.09 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Dynamics/ConditionalShuffle/InstrumentChunks.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Dynamics/ConditionalShuffle/InstrumentChunks.lean
-
curl -L -o InstrumentChunks.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Dynamics/ConditionalShuffle/InstrumentChunks.lean
3.09 kB
| import OAI.Dynamics.ConditionalShuffle.InstrumentAppend | |
| namespace OAI | |
| noncomputable section | |
| namespace Revealed.Instrument | |
| open scoped Classical | |
| open Thorp Thorp.Fourier Revealed.Disintegration | |
| def chunks (S : Type) (t : β) : (n : β) β (Fin n β Fin t β S) β (Fin (t*n) β S) | |
| | 0 => by simpa only [Nat.mul_zero] using (Equiv.ofUnique (Fin 0 β Fin t β S) (Fin 0 β S)) | |
| | n+1 => ((Fin.snocEquiv (fun _ : Fin (n+1) => Fin t β S)).symm.trans | |
| (Equiv.prodComm _ _)).trans ((Equiv.prodCongr (chunks S t n) (Equiv.refl _)).trans | |
| (Fin.appendEquiv (t*n) t)) | |
| lemma chunks_snoc {S : Type} (t n : β) (p : Fin n β Fin t β S) (q : Fin t β S) : | |
| chunks S t (n+1) (Fin.snoc p q) = Fin.append (chunks S t n p) q := by | |
| simp [chunks, Fin.appendEquiv] | |
| variable {E S G Ξ© : Type} [Fintype S] [Fintype G] [Group G] [Fintype Ξ©] [Nonempty Ξ©] | |
| variable (I : Data E S G Ξ©) | |
| lemma block_base (e : E) (t n : β) (p : Fin n β Fin t β S) : | |
| base (block I t) e n p = base I e (t*n) (chunks S t n p) := by | |
| induction n with | |
| | zero => rfl | |
| | succ n ih => | |
| obtain β¨β¨q,pβ©,rflβ© := (Fin.snocEquiv (fun _ : Fin (n+1) => Fin t β S)).surjective p | |
| erw [base_snoc, chunks_snoc] | |
| change base I (base (block I t) e n p) t q = base I e (t*n+t) (Fin.append (chunks S t n p) q) | |
| rw [base_append, ih] | |
| lemma block_weights (e : E) (t n : β) (p : Fin n β Fin t β S) : | |
| weights (block I t) e n p = weights I e (t*n) (chunks S t n p) := by | |
| induction n with | |
| | zero => rfl | |
| | succ n ih => | |
| obtain β¨β¨q,pβ©,rflβ© := (Fin.snocEquiv (fun _ : Fin (n+1) => Fin t β S)).surjective p | |
| erw [weights_snoc, chunks_snoc, block_probability, block_base, ih] | |
| exact (weights_append I e (t*n) t (chunks S t n p) q).symm | |
| lemma block_product (e : E) (t n : β) (p : Fin n β Fin t β S) | |
| (hp : weights (block I t) e n p β 0) : | |
| realProduct n (kernels (block I t) e n p) = | |
| realProduct (t*n) (kernels I e (t*n) (chunks S t n p)) := by | |
| induction n with | |
| | zero => rfl | |
| | succ n ih => | |
| obtain β¨β¨q,pβ©,rflβ© := (Fin.snocEquiv (fun _ : Fin (n+1) => Fin t β S)).surjective p | |
| erw [weights_snoc] at hp | |
| have hp0 := (mul_ne_zero_iff.mp hp).1 | |
| have hq := (mul_ne_zero_iff.mp hp).2 | |
| rw [block_probability] at hq | |
| erw [kernels_snoc, realProduct_snoc, ih p hp0, chunks_snoc] | |
| change realConv (conditional (pathJoint I (base (block I t) e n p) t) q) | |
| (realProduct (t*n) (kernels I e (t*n) (chunks S t n p))) = | |
| realProduct (t*n+t) (kernels I e (t*n+t) (Fin.append (chunks S t n p) q)) | |
| rw [conditional_pathJoint I _ t q hq, block_base, kernels_append, realProduct_append] | |
| theorem distance_block (e : E) (t n : β) : distance (block I t) e n = distance I e (t*n) := by | |
| unfold distance | |
| rw [β Equiv.sum_comp (chunks S t n)] | |
| apply Finset.sum_congr rfl | |
| intro p _ | |
| by_cases hp : weights (block I t) e n p = 0 | |
| Β· rw [β block_weights, hp, zero_mul, zero_mul] | |
| Β· rw [block_product I e t n p hp, block_weights] | |
| end Revealed.Instrument | |
| end | |
| end OAI | |