Download data/lean/OAI/Analysis/FourierLLogL/Compress/Theorem.lean from introvoyz045/math: direct link, hf CLI and curl.
- Browser
- Download file 4.17 kB
-
https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/FourierLLogL/Compress/Theorem.lean
- Command line
-
hf download hf://datasets/introvoyz045/math/data/lean/OAI/Analysis/FourierLLogL/Compress/Theorem.lean
-
curl -L -o Theorem.lean https://huggingface.co/datasets/introvoyz045/math/resolve/main/data/lean/OAI/Analysis/FourierLLogL/Compress/Theorem.lean
4.17 kB
| import OAI.Analysis.FourierLLogL.Compress.Schedule | |
| import OAI.Analysis.FourierLLogL.Compress.Phase | |
| import OAI.Analysis.FourierLLogL.Compress.Low | |
| open Function Filter Set | |
| open scoped BigOperators | |
| noncomputable section | |
| namespace OAI | |
| namespace FourierLLogL.Compress | |
| open Law Real | |
| variable {A G Ξ : Type} [Fintype A] [Fintype G] [DecidableEq G] | |
| [AddCommGroup G] [Nonempty A] [Fintype Ξ] | |
| omit [Nonempty A] in | |
| lemma init_gap (tag : A β G) (hi : Injective tag) (P : Law A) : | |
| fundG tag (initial P) 1 = P.entropy := by | |
| rw [G_initial] | |
| let Q := iid P 1 | |
| have h : Q.send (fun x => x 0) = P := marginalPack (fun _ => P) _ | |
| change Q.H _ = _; rw [β h] | |
| refine H_partition Q (X:=tot tag) (Y:=fun x => x 0) (fun _ _ => ?_) | |
| simp only [tot,Fin.sum_univ_one,hi.eq_iff] | |
| /-- Finite compression from schedule and numerical constraints, before a | |
| choice of scales in terms of height. -/ | |
| lemma compress_arrays (tag : A β G) (hi : Injective tag) (q : Law G) | |
| (hq : β x, 0 < q x) (c : G β β) (hc : β x, 0 β€ c x) (hc0 : c 0=0) | |
| (Q : Law Ξ) (Ο : Ξ β AddChar G β) (hn : β t x, βΟ t xβ=1) | |
| (hrq : β g, (β(exp (-c g)):β)=Q.Cx fun t => Ο t g) | |
| (hlog : β g, -log (q g) = -log (q 0) + c g) | |
| (F L C : β) (hF : 1 β€ F) (hL : 0 β€ L) | |
| (T N m : β) (hm : 0 < m) (hN : m β€ N) (hT : 3*N β€ T) (S : Schedule) | |
| (l u r : β β β) | |
| (hl : β i, i < S.size β l i β€ u i β§ u i β€ m β§ 0 < u i β§ 0 < r i β§ | |
| 2*r i*l i β€ N β§ L β€ (r i:β)*(u i:β)) | |
| (hp : β i j, i < j β j < S.size β u j β€ l i β§ r i β€ r j) | |
| (hg : β P : Law A, exp (-F) β€ heatMoment (Fin T) P tag c) | |
| (hC : 10*F+2*(-log (q 0))+1 β€ C) | |
| (hh : β i, i < S.size β 0 < l i) | |
| (hs : β i, i < S.size β | |
| 2*m*βF/N*lnS (Fin (u i)) tag β€ F β§ | |
| log (Fintype.card (Ticket (r i) (2*r i))) + r i + | |
| 2*(2*m*βF/N)*lnS (Fin (r i*l i)) tag β€ 6*F) : | |
| β (a : A) (s : Finset A), s.Nonempty β§ | |
| log (Fintype.card A)-log (s.card:β) β€ | |
| 8*(3*(F/N)+S.loss*C*C/F)+2 β§ small_defects tag Ο Q L s a (350*F) := by | |
| have hFp : 0 < F := by linarith | |
| have hCp : 0 < C := by | |
| have hh := Real.log_nonpos (q.nonneg 0) (q.le_one 0) | |
| linarith | |
| have hNp : (0:β)< N := by | |
| exact_mod_cast (Nat.lt_of_lt_of_le hm hN) | |
| obtain β¨p,R,h1,h2,h3,h4,h5β© := select_context tag c hc T N m hm hN hT F hFp hg | |
| let Ξ΅ := 2*m*βF/N | |
| let x : Starting tag c N m (3*F) Ξ΅ := β¨p,R,h1,h2,h4,hN,h5β© | |
| let W := initial p | |
| have ha (i) (hh : i < S.size) : fundG tag W (u i) β€ C := by | |
| have H := x.G_upper hc q hq (-log (q 0)) hlog _ (hl i hh).2.1 | |
| apply H.trans | |
| unfold Ξ΅ | |
| have hj := Real.log_le_sub_one_of_pos (show (0:β)<2 by norm_num) | |
| linarith [(hs i hh).1] | |
| have hb (i) (hh : i < S.size) (hle : 1 β€ l i) : fundI tag W (r i) β€ C := by | |
| refine (x.I_upper hc q hq (-log (q 0)) hlog _ ?_).trans ?_ | |
| Β· have := (hl i hh).2.2.2.2.1 | |
| nlinarith | |
| linarith | |
| obtain β¨P,hv,hW,i,hi',hKβ© := | |
| reach tag hi c hc W C F hCp hFp S m l u r hm (fun i h => β¨(hl i h).1,(hl i h).2.1β©) | |
| hp ha (fun i h => hb i h (hh i h)) | |
| obtain β¨hi1,hi2,hu',hr',hn',hL'β© := hl i hi' | |
| have HK : fundK tag c P (u i) (r i) β€ 10*F := by | |
| have H := x.K_upper hc hc0 (l i) (r i) hr' (le_trans hi1 hi2) hn' | |
| have HH := K_anti tag c hv (l i) (r i) | |
| change fundK tag c W _ _ β€ _ at H | |
| dsimp only [Ξ΅] at H | |
| linarith [(hs i hi').2] | |
| let D := 3*(F/N)+S.loss*C*C/F | |
| have hD : 0 < D := by unfold D; have := S.loss_pos; positivity | |
| have Hd : log (Fintype.card A) - fundG tag P 1 β€ D := by | |
| rw [show fundG tag W 1 = _ from init_gap tag hi p] at hW | |
| linarith | |
| obtain β¨p',z,hz,hz'β© := freeze tag hi c hc P (u i) (r i) hu' hr' (10*F) D | |
| (by positivity) hD HK Hd | |
| have : NeZero (r i) := β¨hr'.ne'β© | |
| have : NeZero (u i) := β¨hu'.ne'β© | |
| have H0 := alignment tag c Q Ο hn hrq p' z (10*F) D L (by linarith) hD hL | |
| (by simpa only [Fintype.card_prod,Fintype.card_fin,Nat.cast_mul]) hz (by | |
| simpa only [Fintype.card_prod,Fintype.card_fin,Nat.cast_mul]) | |
| rwa [show 350*F = 35*(10*F) by ring] | |
| end FourierLLogL.Compress | |
| end OAI | |