diff --git a/LMLTutorial/Pages/MarkovKernels.lean b/LMLTutorial/Pages/MarkovKernels.lean index e11d267f..5c339508 100644 --- a/LMLTutorial/Pages/MarkovKernels.lean +++ b/LMLTutorial/Pages/MarkovKernels.lean @@ -13,6 +13,7 @@ set_option linter.style.header false set_option linter.style.setOption false set_option linter.hashCommand false set_option linter.style.longLine false +set_option linter.style.emptyLine false set_option pp.rawOnError true set_option verso.code.warnLineLength 100 diff --git a/LMLTutorial/Pages/Martingales.lean b/LMLTutorial/Pages/Martingales.lean index 40181c42..3c4cb708 100644 --- a/LMLTutorial/Pages/Martingales.lean +++ b/LMLTutorial/Pages/Martingales.lean @@ -13,6 +13,7 @@ set_option linter.style.header false set_option linter.style.setOption false set_option linter.hashCommand false set_option linter.style.longLine false +set_option linter.style.emptyLine false set_option pp.rawOnError true set_option verso.code.warnLineLength 100 diff --git a/LMLTutorial/Tutorial.lean b/LMLTutorial/Tutorial.lean index d779e365..73f8f462 100644 --- a/LMLTutorial/Tutorial.lean +++ b/LMLTutorial/Tutorial.lean @@ -12,12 +12,12 @@ set_option linter.style.setOption false @[expose] public section -open Verso.Genre.Manual Verso.Output.Html +open Verso.Genre.Manual def extraHead : Array Verso.Output.Html := #[ - {{}}, - {{}}, - {{}}, + html%{}, + html%{}, + html%{}, ] def config : RenderConfig := { diff --git a/LeanMachineLearning/ForMathlib/InformationTheory/KullbackLeibler/MapSequence.lean b/LeanMachineLearning/ForMathlib/InformationTheory/KullbackLeibler/MapSequence.lean index a2797244..e4168ae2 100644 --- a/LeanMachineLearning/ForMathlib/InformationTheory/KullbackLeibler/MapSequence.lean +++ b/LeanMachineLearning/ForMathlib/InformationTheory/KullbackLeibler/MapSequence.lean @@ -89,8 +89,10 @@ lemma klDiv_eq_iSup_map {β : ℕ → Type*} [mβ : ∀ n, MeasurableSpace (β n (measurable_const.indicator hA).stronglyMeasurable.mono hℱ_sup.symm.le have hlim := hφ_int.tendsto_ae_condExp (ℱ := ℱ) hφ_meas set B : ℕ → Set α := fun n ↦ {x | (2⁻¹ : ℝ) < (ρ[φ | ℱ n]) x} with hB - have hB_meas : ∀ n, MeasurableSet[ℱ n] (B n) := fun n ↦ - (stronglyMeasurable_condExp (m := ℱ n)).measurable measurableSet_Ioi + have hB_meas : ∀ n, MeasurableSet[ℱ n] (B n) := fun n ↦ by + have : B n = (ρ[φ | ℱ n]) ⁻¹' Set.Ioi 2⁻¹ := by ext; simp [hB] + rw [this] + exact (stronglyMeasurable_condExp (m := ℱ n)).measurable measurableSet_Ioi have hB_meas0 : ∀ n, MeasurableSet (B n) := fun n ↦ ℱ.le n _ (hB_meas n) have hB_lim : ∀ᵐ x ∂ρ, ∀ᶠ n in atTop, x ∈ B n ↔ x ∈ A := by filter_upwards [hlim] with x hx diff --git a/LeanMachineLearning/ForMathlib/MeasureTheory/MeasurableSpace/Embedding.lean b/LeanMachineLearning/ForMathlib/MeasureTheory/MeasurableSpace/Embedding.lean index 4fca8151..df72cede 100644 --- a/LeanMachineLearning/ForMathlib/MeasureTheory/MeasurableSpace/Embedding.lean +++ b/LeanMachineLearning/ForMathlib/MeasureTheory/MeasurableSpace/Embedding.lean @@ -160,8 +160,9 @@ lemma finSuccProd_apply {X : Type*} [MeasurableSpace X] (n : ℕ) lemma finSuccProd_symm_apply {X : Type*} [MeasurableSpace X] (n : ℕ) (p : (Fin n → X) × X) : (finSuccProd X n).symm p = Fin.snoc p.1 p.2 := by - simp [finSuccProd] - rfl + simp only [finSuccProd, trans_symm, trans_apply, piFinSuccAbove_symm_apply, + Fin.insertNthEquiv_last, Fin.snocEquiv_apply, Fin.snoc_inj] + exact ⟨rfl, rfl⟩ end Fin diff --git a/LeanMachineLearning/ForMathlib/MeasureTheory/Order/MeasurableArg.lean b/LeanMachineLearning/ForMathlib/MeasureTheory/Order/MeasurableArg.lean index 258d29d8..9ba97560 100644 --- a/LeanMachineLearning/ForMathlib/MeasureTheory/Order/MeasurableArg.lean +++ b/LeanMachineLearning/ForMathlib/MeasureTheory/Order/MeasurableArg.lean @@ -78,7 +78,8 @@ lemma measurable_argmax [MeasurableSpace ι] [MeasurableEq α] [MeasurableSup₂ constructor · intro hf x hx rw [← hf] - exact Classical.choose.congr_simp hx (exists_argmax x) + exact Classical.choose.congr_simp (funext fun j ↦ propext (Set.ext_iff.mp hx j)) + (exists_argmax x) · intro h exact h f rfl diff --git a/LeanMachineLearning/SequentialLearning/StoppedHistory.lean b/LeanMachineLearning/SequentialLearning/StoppedHistory.lean index 17cd41a3..4a2c3dd8 100644 --- a/LeanMachineLearning/SequentialLearning/StoppedHistory.lean +++ b/LeanMachineLearning/SequentialLearning/StoppedHistory.lean @@ -80,8 +80,8 @@ lemma measurable_hittingAfter_sigmaHistory (hS : MeasurableSet S) : · infer_instance simp only [ENat.some_eq_natCast, this, Set.preimage_compl] exact (measurable_sigmaHistory hO hX hY n hS).inter - (MeasurableSet.biInter (Set.to_countable _) fun j _ ↦ - measurable_sigmaHistory hO hX hY j hS.compl) + (MeasurableSet.iInter fun j ↦ MeasurableSet.iInter fun _ ↦ + (measurable_sigmaHistory hO hX hY j hS).compl) @[fun_prop] lemma measurable_stoppedValue_sigmaHistory (hτ : Measurable τ) : diff --git a/LeanMachineLearning/Tactic/KernelHom/Tactic/KernelDiagram.lean b/LeanMachineLearning/Tactic/KernelHom/Tactic/KernelDiagram.lean index 6ddf5030..a2eb3742 100644 --- a/LeanMachineLearning/Tactic/KernelHom/Tactic/KernelDiagram.lean +++ b/LeanMachineLearning/Tactic/KernelHom/Tactic/KernelDiagram.lean @@ -59,7 +59,6 @@ def Node.toPenroseVar_kernel (n : Node) : MetaM PenroseVar := do pure n.e return ⟨"E", [n.vPos, n.hPosSrc, n.hPosTar], expr⟩ -open scoped Jsx in /-- Construct a kernelized string diagram from a Penrose `sub`stance program and expressions `embeds` to display as labels in the diagram. -/ def mkKernelDiagram (nodes : List (List Node)) (strands : List (List Strand)) : @@ -90,7 +89,6 @@ end Mathlib.Tactic.Widget.StringDiagram namespace KernelDiagram -open scoped Jsx in /-- Given a kernel expression, return a string diagram. Otherwise `none`. -/ def KernelM? (e : Expr) : MetaM (Option Html) := do let e ← instantiateMVars e @@ -118,24 +116,23 @@ def KernelM? (e : Expr) : MetaM (Option Html) := do trace[string_diagram] "Penrose substance: \n{(← get).sub}" match ← DiagramBuilderM.buildDiagram StringDiagram.dsl StringDiagram.sty with | some html => return html - | none => return No non-structural morphisms found. + | none => return jsx%{No non-structural morphisms found.} catch _ => return none -open scoped Jsx in /-- Help function for displaying two string diagrams in an equality. -/ def mkEqHtml (lhs rhs : Html) : Html := -