From 374d6870b9f85139258a4bd75cb68aad8aa84e6e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 15 Sep 2026 10:15:20 +0000 Subject: [PATCH 1/8] chore: pin Lean and Mathlib to v4.34.0 --- docbuild/lake-manifest.json | 30 +++++++++++++++--------------- docbuild/lakefile.toml | 2 +- docbuild/lean-toolchain | 2 +- lake-manifest.json | 22 +++++++++++----------- lakefile.toml | 2 +- lean-toolchain | 2 +- 6 files changed, 30 insertions(+), 30 deletions(-) diff --git a/docbuild/lake-manifest.json b/docbuild/lake-manifest.json index 977388fdb5..dc8a286ee9 100644 --- a/docbuild/lake-manifest.json +++ b/docbuild/lake-manifest.json @@ -5,10 +5,10 @@ "type": "git", "subDir": null, "scope": "leanprover", - "rev": "db53577d4634df2604840cabb4bc74685300afe4", + "rev": "a6521b2d0c93dcdf2d640089f95548df5dd8bf46", "name": "«doc-gen4»", "manifestFile": "lake-manifest.json", - "inputRev": "v4.34.0-rc1", + "inputRev": "v4.34.0", "inherited": false, "configFile": "lakefile.lean"}, {"type": "path", @@ -22,7 +22,7 @@ "type": "git", "subDir": null, "scope": "", - "rev": "a117edeff8db819a001455bcbafe86748635dd6b", + "rev": "f9cdb9eacb5c8b8ecc02ee9fd9e568d7d28c1416", "name": "leansqlite", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -32,7 +32,7 @@ "type": "git", "subDir": null, "scope": "", - "rev": "af8bc067a4cc6c6df472a68909a3f40b1c76c43e", + "rev": "e92c9f15fdfacc8536f31cfb3b7ad26c3c8cd204", "name": "Cli", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -42,7 +42,7 @@ "type": "git", "subDir": null, "scope": "", - "rev": "49ad68b40c254707ff47f114d80a5e51c533b6d7", + "rev": "0e569d08b6443ce0908d356884c765397253e2f0", "name": "UnicodeBasic", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -52,7 +52,7 @@ "type": "git", "subDir": null, "scope": "", - "rev": "e45290d7c80738a7635847bc5ace97275cc70d30", + "rev": "4d8616fd4870d0a3453d845770833eac7951fe1c", "name": "BibtexQuery", "manifestFile": "lake-manifest.json", "inputRev": "master", @@ -72,17 +72,17 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "de5ce8a9a66a4aa68a9bdbb35b63a06d34d9ca11", + "rev": "5ed2965256430c3649e86755f9576b54eca72435", "name": "mathlib", "manifestFile": "lake-manifest.json", - "inputRev": "v4.34.0-rc1", + "inputRev": "v4.34.0", "inherited": true, "configFile": "lakefile.lean"}, {"url": "https://github.com/leanprover-community/plausible", "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "38e9c3ce15cbb63c92e90bb9a92e4eb82131f669", + "rev": "118aa17ee84656b8bd727fef7c458ee8c833385c", "name": "plausible", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -92,7 +92,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "2bc7cf064315b26bc38dac2e9612fb581be9b75f", + "rev": "ddf04cf3949fa556442341e87d47f9f6e6074707", "name": "LeanSearchClient", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -102,7 +102,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "978b7ec9fbbf9a535114f1de8fe5b3778b358870", + "rev": "e928b72544873815af278d38681b31c0293588e3", "name": "importGraph", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -112,7 +112,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "99e8adeea3c3cd86b6b79ba01a1383bf2d31d055", + "rev": "106ff4fafc74ef4ac99d81dbf3ab399118f497a5", "name": "proofwidgets", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -122,7 +122,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "c1c4362a130f12e632d252180a6c2a31d8fd4726", + "rev": "355695d523e41d0554926416cba2a2b3544fbbc9", "name": "aesop", "manifestFile": "lake-manifest.json", "inputRev": "master", @@ -132,7 +132,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "3b55e9d00c6b0018e5d984eb011b6f93c09bd163", + "rev": "6a489d9af5d0c47e5b259e2e8bcdfc1811b5a259", "name": "Qq", "manifestFile": "lake-manifest.json", "inputRev": "master", @@ -142,7 +142,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "01bc479e7432594821ba3fb0ca465211941de86d", + "rev": "f2effa3d803fda822b1f97b806c47cf2adfbcbc2", "name": "batteries", "manifestFile": "lake-manifest.json", "inputRev": "main", diff --git a/docbuild/lakefile.toml b/docbuild/lakefile.toml index 6f2fb34eff..6c380253ff 100644 --- a/docbuild/lakefile.toml +++ b/docbuild/lakefile.toml @@ -10,4 +10,4 @@ path = "../" [[require]] scope = "leanprover" name = "doc-gen4" -rev = "v4.34.0-rc1" +rev = "v4.34.0" diff --git a/docbuild/lean-toolchain b/docbuild/lean-toolchain index 75def60936..12359f928f 100644 --- a/docbuild/lean-toolchain +++ b/docbuild/lean-toolchain @@ -1 +1 @@ -leanprover/lean4:v4.34.0-rc1 +leanprover/lean4:v4.34.0 diff --git a/lake-manifest.json b/lake-manifest.json index 1f09369c47..557f9186bf 100644 --- a/lake-manifest.json +++ b/lake-manifest.json @@ -5,17 +5,17 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "de5ce8a9a66a4aa68a9bdbb35b63a06d34d9ca11", + "rev": "5ed2965256430c3649e86755f9576b54eca72435", "name": "mathlib", "manifestFile": "lake-manifest.json", - "inputRev": "v4.34.0-rc1", + "inputRev": "v4.34.0", "inherited": false, "configFile": "lakefile.lean"}, {"url": "https://github.com/leanprover-community/plausible", "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "38e9c3ce15cbb63c92e90bb9a92e4eb82131f669", + "rev": "118aa17ee84656b8bd727fef7c458ee8c833385c", "name": "plausible", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -25,7 +25,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "2bc7cf064315b26bc38dac2e9612fb581be9b75f", + "rev": "ddf04cf3949fa556442341e87d47f9f6e6074707", "name": "LeanSearchClient", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -35,7 +35,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "978b7ec9fbbf9a535114f1de8fe5b3778b358870", + "rev": "e928b72544873815af278d38681b31c0293588e3", "name": "importGraph", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -45,7 +45,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "99e8adeea3c3cd86b6b79ba01a1383bf2d31d055", + "rev": "106ff4fafc74ef4ac99d81dbf3ab399118f497a5", "name": "proofwidgets", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -55,7 +55,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "c1c4362a130f12e632d252180a6c2a31d8fd4726", + "rev": "355695d523e41d0554926416cba2a2b3544fbbc9", "name": "aesop", "manifestFile": "lake-manifest.json", "inputRev": "master", @@ -65,7 +65,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "3b55e9d00c6b0018e5d984eb011b6f93c09bd163", + "rev": "6a489d9af5d0c47e5b259e2e8bcdfc1811b5a259", "name": "Qq", "manifestFile": "lake-manifest.json", "inputRev": "master", @@ -75,7 +75,7 @@ "type": "git", "subDir": null, "scope": "leanprover-community", - "rev": "01bc479e7432594821ba3fb0ca465211941de86d", + "rev": "f2effa3d803fda822b1f97b806c47cf2adfbcbc2", "name": "batteries", "manifestFile": "lake-manifest.json", "inputRev": "main", @@ -85,10 +85,10 @@ "type": "git", "subDir": null, "scope": "leanprover", - "rev": "af8bc067a4cc6c6df472a68909a3f40b1c76c43e", + "rev": "e92c9f15fdfacc8536f31cfb3b7ad26c3c8cd204", "name": "Cli", "manifestFile": "lake-manifest.json", - "inputRev": "v4.34.0-rc1", + "inputRev": "v4.34.0", "inherited": true, "configFile": "lakefile.toml"}], "name": "«lean-pool»", diff --git a/lakefile.toml b/lakefile.toml index b0803c7ba9..9924aef89f 100644 --- a/lakefile.toml +++ b/lakefile.toml @@ -12,7 +12,7 @@ maxSynthPendingDepth = 3 [[require]] name = "mathlib" scope = "leanprover-community" -rev = "v4.34.0-rc1" +rev = "v4.34.0" [[lean_lib]] name = "LeanPool" diff --git a/lean-toolchain b/lean-toolchain index 75def60936..12359f928f 100644 --- a/lean-toolchain +++ b/lean-toolchain @@ -1 +1 @@ -leanprover/lean4:v4.34.0-rc1 +leanprover/lean4:v4.34.0 From f30fcb14db7666e69b41bc612b1ba24c13b2fb19 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 15 Sep 2026 13:17:59 +0000 Subject: [PATCH 2/8] Repair 95 project(s) for v4.34.0 --- LeanPool/ABCExceptions/Section2.lean | 17 +- .../Applications/General.lean | 10 +- .../Applications/Meager.lean | 2 +- .../Basic/General.lean | 6 +- LeanPool/AndersonConjecture/AdicKerEval.lean | 3 +- .../Jensen/Adjoin/Adjoin.lean | 2 +- .../Jensen/Adjoin/FromPrime.lean | 2 +- .../Jensen/Adjoin/Transcendental.lean | 3 +- .../Jensen/CloseUp/AvoidanceStep.lean | 2 +- .../Jensen/CloseUp/NoCommonFactor.lean | 2 +- .../Jensen/CombinedStep.lean | 8 +- .../Jensen/Construction/Transfinite.lean | 6 +- .../Jensen/KrullDomain/HeightBound.lean | 3 +- LeanPool/AndersonConjecture/Main.lean | 10 +- .../FirstProof4/Auxiliary/Density.lean | 2 +- .../FirstProof4/Problem4.lean | 2 +- .../Auxiliary/DynamicColoring.lean | 2 +- .../FirstProof6/Problem6.lean | 2 +- .../ArtinWedderburnTheorem.lean | 2 +- LeanPool/ArtinWedderburn/CornerRing.lean | 5 +- .../ArtinWedderburn/NonUnitalToUnital.lean | 26 ++- .../BoundOnDistanceSet.lean | 28 +-- LeanPool/BollobasNikiforov/Basic/Graph.lean | 2 +- LeanPool/BollobasNikiforov/Definition.lean | 1 + LeanPool/BollobasNikiforov/M/Elim.lean | 4 +- LeanPool/BollobasNikiforov/M/Schur.lean | 2 +- LeanPool/BollobasNikiforov/MS/Basic.lean | 44 +++- LeanPool/BollobasNikiforov/TN/Basic.lean | 2 +- LeanPool/BollobasNikiforov/TN/Truncated.lean | 4 +- LeanPool/BrauerGroupNew/AlgClosedUnion.lean | 12 +- LeanPool/BrauerGroupNew/Azumaya/Basic.lean | 3 +- LeanPool/BrauerGroupNew/Azumaya/Mul.lean | 3 +- LeanPool/BrauerGroupNew/BrauerGroup.lean | 44 ++-- LeanPool/BrauerGroupNew/BrauerOverR.lean | 34 +--- LeanPool/BrauerGroupNew/CentralSimple.lean | 15 +- LeanPool/BrauerGroupNew/Centralizer.lean | 3 +- .../BrauerGroupNew/DoubleCentralizer.lean | 12 +- LeanPool/BrauerGroupNew/ExtendScalar.lean | 36 ++-- LeanPool/BrauerGroupNew/IsoSecond.lean | 39 +--- .../BrauerGroupNew/MatrixEquivTensor.lean | 6 - .../BrauerGroupNew/Morita/TensorProduct.lean | 8 +- LeanPool/BrauerGroupNew/SkolemNoether.lean | 23 +-- .../BrauerGroupNew/Subfield/Splitting.lean | 9 +- LeanPool/BruhatTits/Graph/GroupAction.lean | 1 - LeanPool/BruhatTits/Graph/Regular.lean | 2 +- LeanPool/BruhatTits/Harmonic/Basic.lean | 21 ++ LeanPool/BruhatTits/Lattice/Basic.lean | 4 +- LeanPool/BruhatTits/Lattice/Construction.lean | 2 +- LeanPool/BruhatTits/Utils/Matrix.lean | 8 +- LeanPool/BruhatTits/Utils/RingHom.lean | 1 - LeanPool/Burkholder/MartingaleTransforms.lean | 6 +- LeanPool/Chudnovsky/SigmaZeta.lean | 2 +- .../SingularModuli/ModularPolynomialZ.lean | 3 +- .../ClassificationOfSurfaces/DiskSquare.lean | 2 +- .../FiniteCyclicP2DegenerateRealization.lean | 4 +- .../FiniteCyclicP2Realization.lean | 6 +- .../Moise/Anchors.lean | 10 +- .../Moise/ChartInduction.lean | 5 +- .../Moise/FreeTriangleMove.lean | 12 +- .../Moise/GeometricTriangulation.lean | 177 +++++++++++++++++ .../Moise/GraphPolygonalization.lean | 26 +-- .../Moise/GraphRefinement.lean | 8 +- .../Moise/GraphSubdivision.lean | 8 +- .../Moise/IntrinsicFaceExtension.lean | 2 +- .../Moise/IntrinsicFaceModel.lean | 4 +- .../Moise/IntrinsicGraphModel.lean | 2 +- .../Moise/LocallyFiniteFaceExtension.lean | 2 +- .../Moise/LocallyFiniteFaceModel.lean | 4 +- .../Moise/PLApproximation.lean | 8 +- .../Moise/PlaneCycle.lean | 4 +- .../Moise/PolygonalArc.lean | 6 +- .../Moise/PolygonalSchoenflies.lean | 18 +- LeanPool/Clawristotle/CoulombFlux.lean | 3 +- LeanPool/Clawristotle/CoulombFluxConv.lean | 7 +- .../Clawristotle/CoulombForceTransport.lean | 3 +- .../Clawristotle/CoulombSpatialTransport.lean | 3 +- .../Clawristotle/IteratedDerivHelpers.lean | 3 +- LeanPool/Clawristotle/NewtonianPotential.lean | 7 +- .../CompactnessAndDegeneracy/Compactness.lean | 6 +- .../CompactnessAndDegeneracy/Degeneracy.lean | 12 +- LeanPool/Computability/Encoding.lean | 2 +- .../FreedmanBernstein.lean | 35 ++-- LeanPool/ConnesKreimer/PowerSeriesLogMul.lean | 31 ++- .../Construction/SquareSpan.lean | 3 +- .../LinearAlgebra/BooleanPolynomial.lean | 23 ++- .../OperatorAlgebra/NormalizedHaar.lean | 3 +- .../PositiveSpectralMeasure.lean | 15 +- .../Projection/ValuedSpectralMeasure.lean | 2 +- .../OperatorAlgebra/PropertyTTransfer.lean | 2 +- LeanPool/DeadEnds/Basic.lean | 2 +- LeanPool/DeadEnds/CRT.lean | 2 +- LeanPool/DirectedTopologyLean4/Dipath.lean | 1 - .../DirectedVanKampen.lean | 22 +- .../Neighborhood/Exercise117.lean | 2 +- .../Neighborhood/Exercise125.lean | 2 +- .../Neighborhood/Exercise222.lean | 4 +- LeanPool/Duality/Common.lean | 1 + LeanPool/Duality/LinearProgramming.lean | 1 - LeanPool/Duality/LinearProgrammingB.lean | 2 +- .../Algebra/EllipticCurve/Kronecker.lean | 2 +- .../EhrhartVolumeInequality/Convergence.lean | 2 +- .../EhrhartVolumeInequality/Foundations.lean | 2 +- .../FourierAnalysis.lean | 4 +- .../Regularization.lean | 4 +- .../EhrhartVolumeInequality/Variation.lean | 2 +- LeanPool/Erdos137/Base.lean | 12 +- LeanPool/Erdos137/Finiteness.lean | 4 +- LeanPool/Erdos137/RefinedOverlap.lean | 2 +- LeanPool/Erdos137/RoughPartStructure.lean | 8 +- LeanPool/Erdos137/SquarefreeCapacity.lean | 4 +- LeanPool/Erdos367/Core4027.lean | 17 +- LeanPool/Erdos367/GeneralKUpperBound.lean | 4 +- LeanPool/Erdos367/K3AbcUpperBound.lean | 5 +- LeanPool/Erdos367/PellLimsup.lean | 6 +- LeanPool/Erdos367/RFullLowerBound.lean | 3 +- LeanPool/EventStructures/FinitePoset.lean | 2 +- LeanPool/Feige/Grunbaum/Main.lean | 3 +- .../Feige/IndependentCalibrationAssembly.lean | 4 +- LeanPool/Feige/InsertionCommonLaw.lean | 3 +- LeanPool/Feige/InsertionTerminalLaw.lean | 3 +- LeanPool/Feige/KStatistic.lean | 4 +- .../Feige/RecursiveLatentProbability.lean | 3 +- .../SimplexExponentialIdentification.lean | 2 +- LeanPool/Feige/TransferAlgebra.lean | 2 +- LeanPool/Feige/TwoPointBoundary.lean | 2 +- LeanPool/Flean/Rounding.lean | 1 - .../FltRegular/NumberTheory/Hilbert92.lean | 8 +- .../FltRegular/NumberTheory/Unramified.lean | 2 +- LeanPool/FormalLearningTheory/Basic.lean | 2 +- .../Complexity/Generalization/Core.lean | 2 +- .../Complexity/Generalization/Tail.lean | 2 +- .../Complexity/Rademacher.lean | 6 +- .../Complexity/Symmetrization.lean | 2 +- LeanPool/FormalLearningTheory/Data.lean | 2 +- .../FormalLearningTheory/Learner/Closure.lean | 2 +- .../PureMath/Concentration.lean | 2 +- .../Theorem/Extended.lean | 6 +- .../Theorem/Separation.lean | 2 +- .../IOPEN.lean | 2 +- .../IsEnum.lean | 4 +- .../FinitelyGeneratedVanishing.lean | 10 +- .../FlasqueVanishing.lean | 68 +++---- .../GeneratedSubsheaf.lean | 14 +- .../GrothendieckVanishing.lean | 2 +- .../PresheafFilteredColimit.lean | 4 +- .../PresheafFilteredColimitCore.lean | 2 +- .../Concentration/HansonWright.lean | 22 +- .../EndHomogeneousErdosRado.lean | 4 +- .../Combinatorics/PairErdosRadoGeneral.lean | 6 +- .../Conditional/MorleyHanfTransfer.lean | 2 - .../InfinitaryLogic/Descriptive/GSGraph.lean | 2 +- .../Descriptive/KuratowskiUlam.lean | 2 +- .../Descriptive/WellOrderBridge.lean | 9 +- .../Methods/LocalEMTemplateRealization.lean | 1 - .../WellOrdering/GraphTranslation.lean | 2 +- .../HanfSpectrum/LadderSyntax.lean | 4 +- .../CarryAndCrossedProduct.lean | 15 +- .../FactorAndRigidity.lean | 2 +- .../GroupConstruction.lean | 10 +- .../SpectralAndPropertyT.lean | 25 +-- LeanPool/IsTranscendentalPi/Main.lean | 2 +- .../JacobianDiffgeo/Finiteness/Chain.lean | 2 +- LeanPool/JacobianDiffgeo/Path/Planar.lean | 3 +- .../JacobianDiffgeo/Surface/Identity.lean | 2 +- .../Surface/InverseFunction.lean | 2 +- .../GaussianTail.lean | 3 +- LeanPool/JohnsonLindenstraussLean/QJL.lean | 2 +- .../QJLDistortion.lean | 2 +- LeanPool/KaltonRoberts/PhiDeriv.lean | 109 ++++------ LeanPool/Koethe/MultiProjective.lean | 43 ++-- LeanPool/Koethe/Pencil.lean | 2 +- LeanPool/KrafftSieve/Basic.lean | 19 +- LeanPool/KrafftSieve/Defs.lean | 2 +- LeanPool/KrafftSieve/ThirdHarmonic.lean | 2 +- .../General/Completeness.lean | 1 - .../Lean4GlCoalgebras/General/Soundness.lean | 2 +- .../Lean4GlCoalgebras/Logic/Semantics.lean | 2 +- .../Lean4GlCoalgebras/Split/Completeness.lean | 2 - .../Lean4GlCoalgebras/Split/Soundness.lean | 2 +- LeanPool/Lean4Itree/ITree/Basic.lean | 8 +- LeanPool/Lean4Itree/ITree/Utils.lean | 62 +++--- LeanPool/Lean4Itree/Paco/PacoTactics.lean | 7 +- .../HerglotzRieszRepresentations.lean | 4 +- .../UnivalentFunctions/ClassS.lean | 5 +- .../ForMathlib/CongruenceSubgrps.lean | 2 +- .../GeneralizedResidueTheory/ArcCalculus.lean | 3 +- .../CauchyPrimitive.lean | 8 +- .../Residue/SectorCurve.lean | 6 +- .../HeckeRIngs/AbstractHeckeRing/Basic.lean | 2 +- .../AbstractHeckeRing/Commutativity.lean | 2 +- .../AbstractHeckeRing/Multiplication.lean | 2 +- .../HeckeRIngs/GL2/HeckeAction.lean | 2 +- .../HeckeRIngs/GLn/Basic.lean | 8 +- .../HeckeRIngs/GLn/Degree.lean | 2 +- .../HeckeRIngs/GLn/PolynomialRing.lean | 2 +- .../Modularforms/EisensteinAsymptotics.lean | 6 +- .../LeanModularForms/Modularforms/Eta.lean | 2 +- .../Modularforms/EtaCleanup.lean | 4 +- .../Modularforms/Generators/Defs.lean | 12 +- .../Modularforms/Generators/Injectivity.lean | 36 ++-- .../Modularforms/LogDerivLems.lean | 4 +- .../Modularforms/MultipliableLems.lean | 2 +- .../Modularforms/QExpansionLems.lean | 3 +- .../Modularforms/SlashActionAuxil.lean | 3 +- .../Modularforms/ThetaDerivIdentities.lean | 3 +- .../Modularforms/TsumderivWithin.lean | 2 +- .../RectHomotopy/MainTheoremDerivCont.lean | 1 - .../LeanPolyABC/Corollaries/FltCatalan.lean | 5 +- .../Primitives/QKernel/Advantage.lean | 2 +- .../Primitives/QKernel/Concentration.lean | 2 +- .../QKernel/DiscreteLogConcept.lean | 2 +- .../Primitives/QNN/PauliPropagation.lean | 2 +- .../LeanQuantumAlg/Util/HilbertSchmidt.lean | 2 +- LeanPool/LehmerE10/Kronecker.lean | 2 +- .../ClassicalComplexWPT/WeightedSeries.lean | 2 +- LeanPool/LongGapsBetweenPrimes/Main.lean | 18 +- .../LowDimSolvClassification/LemmasDim3.lean | 7 +- .../LowDimSolvClassification/Semidirect.lean | 2 +- LeanPool/MRiscX/Examples/Examples.lean | 3 +- LeanPool/MRiscX/Hoare/HoareRules.lean | 2 +- LeanPool/MRiscX/Tactics/CodeProofTactics.lean | 62 +++--- LeanPool/MRiscX/Util/BasicTheorems.lean | 9 +- LeanPool/MatchingLogic/Core.lean | 6 +- LeanPool/MatchingLogic/EntryIII/Renaming.lean | 2 +- .../MatchingLogic/EntryIII/Witnessed.lean | 2 +- LeanPool/MetricCodes/Branching.lean | 40 ++-- LeanPool/MetricCodes/Conclusion.lean | 36 +--- LeanPool/MetricCodes/HarmonicAnalysis.lean | 136 ++++++------- LeanPool/MetricCodes/Hierarchy.lean | 24 +-- LeanPool/MetricCodes/HighestWeights.lean | 23 ++- LeanPool/MetricCodes/Interlacing.lean | 10 +- LeanPool/MetricCodes/Rates.lean | 9 +- LeanPool/MetricCodes/Representation.lean | 25 ++- LeanPool/MetricCodes/Rigidity.lean | 8 +- LeanPool/MetricCodes/RootComplex.lean | 61 +++--- LeanPool/MetricCodes/Weyl.lean | 114 +++++------ LeanPool/MisereGames/Form.lean | 8 +- LeanPool/MisereGames/GameGraph.lean | 8 +- LeanPool/MisereGames/Mathlib/NatOrdinal.lean | 2 +- LeanPool/MisereGames/Ruleset/Hackenbush.lean | 1 - LeanPool/MisereGames/Ruleset/Strip.lean | 2 +- .../Coalgebra/FiniteDimensional.lean | 3 +- .../LinearAlgebra/InvariantSubmodule.lean | 2 +- .../LinearAlgebra/Ips/MinimalProj.lean | 2 +- LeanPool/Monlib4/LinearAlgebra/Ips/Pos.lean | 6 +- .../LinearAlgebra/Ips/TensorHilbert.lean | 2 - .../LinearAlgebra/KroneckerToTensor.lean | 6 +- LeanPool/Monlib4/LinearAlgebra/LmulRmul.lean | 2 +- .../Matrix/IsAlmostHermitian.lean | 2 +- .../Monlib4/LinearAlgebra/MyBimodule.lean | 5 +- LeanPool/Monlib4/LinearAlgebra/OfNorm.lean | 1 + .../Monlib4/LinearAlgebra/PiDirectSum.lean | 10 +- .../LinearAlgebra/PiStarOrderedRing.lean | 2 +- .../LinearAlgebra/QuantumSet/Basic.lean | 7 +- .../LinearAlgebra/QuantumSet/QIso.lean | 8 +- .../LinearAlgebra/QuantumSet/SchurMul.lean | 58 +++--- .../LinearAlgebra/QuantumSet/Symm.lean | 2 +- .../QuantumSet/TensorProduct.lean | 29 +-- .../TensorProduct/BasicLemmas.lean | 3 +- .../TensorProduct/FiniteDimensional.lean | 11 +- .../LinearAlgebra/TensorProduct/Lemmas.lean | 9 +- LeanPool/Monlib4/Preq/Complex.lean | 4 +- LeanPool/Monlib4/Preq/Dite.lean | 2 +- LeanPool/Monlib4/Preq/StarAlgEquiv.lean | 10 +- LeanPool/Monlib4/QuantumGraph/Basic.lean | 5 +- LeanPool/Monlib4/QuantumGraph/Iso.lean | 16 +- .../Monlib4/QuantumGraph/PiMatFinTwo.lean | 18 +- LeanPool/Monlib4/QuantumGraph/QamA.lean | 2 +- .../Monlib4/QuantumGraph/QamAExample.lean | 2 +- .../Monlib4/QuantumGraph/ToProjections.lean | 3 +- LeanPool/Monsky/Appendix.lean | 4 +- LeanPool/Monsky/Miscellaneous.lean | 2 +- LeanPool/Monsky/MonskyEven.lean | 4 +- LeanPool/Monsky/SegmentTriangle.lean | 12 +- .../Combinatorics/Front/Rank.lean | 66 +++--- .../NashWilliams/Combinatorics/Front/Ray.lean | 14 +- .../Combinatorics/Front/Shrink.lean | 8 +- .../Euler/BaseEulerState.lean | 4 +- .../Euler/ChildParticleFieldBounds.lean | 3 +- .../Euler/CoefficientPathSmooth.lean | 2 +- .../Euler/CylinderDirichletSobolev.lean | 2 +- .../Euler/CylinderJetGraphTrace.lean | 2 +- .../Euler/CylinderJetLp.lean | 10 +- .../Euler/CylinderPhysicalTensorLp.lean | 11 +- .../Euler/ExternalTransportCommutator.lean | 4 +- .../Euler/FiniteGradeAlgebra.lean | 2 +- .../Euler/Foundations/CylinderAlgebra.lean | 2 + .../Foundations/CylinderCoordinates.lean | 14 +- .../Euler/Foundations/CylinderGradient.lean | 11 +- .../Euler/Foundations/CylinderSobolev.lean | 11 +- .../Euler/Foundations/DeformationVolume.lean | 3 +- .../Euler/Foundations/Gevrey.lean | 2 +- .../Foundations/MollifierRepresentative.lean | 5 +- .../Foundations/NoncompactTransport.lean | 3 +- .../Euler/Foundations/PacketWeights.lean | 2 +- .../Foundations/PressureJetIdentities.lean | 3 +- .../PressureSpatialRegularity.lean | 2 - .../Euler/Foundations/RealCylinder.lean | 10 +- .../Euler/Foundations/SmoothSobolev.lean | 27 ++- .../Euler/Foundations/Sobolev.lean | 5 +- .../Foundations/SobolevDerivativeNorm.lean | 2 +- .../Euler/Foundations/SobolevProducts.lean | 5 +- .../Foundations/SpatialSobolevInverse.lean | 9 +- .../Euler/Foundations/VectorCylinder.lean | 17 +- .../Euler/GeneralCylinderAlgebra.lean | 2 + .../Euler/GevreyComposition.lean | 2 +- .../Euler/GevreyCompositionLp.lean | 14 +- .../Euler/GevreyCorrectionForcing.lean | 5 +- .../Euler/GevreyGeneratingDerivatives.lean | 2 +- .../Euler/GevreyInverseMap.lean | 2 +- .../Euler/GevreyJetCompositionLp.lean | 14 +- .../Euler/GevreyProductLp.lean | 9 +- .../Euler/H6NonlinearProduct.lean | 2 +- .../Euler/InitialH1OperatorProduct.lean | 2 +- .../Euler/LinearDuhamel.lean | 7 +- .../Euler/LowerTransportSource.lean | 2 + .../Euler/LpCylinderCoefficients.lean | 2 +- .../LpCylinderRectangularRegularity.lean | 2 +- .../Euler/LpCylinderRegularCoefficient.lean | 2 +- .../Euler/LpSmoothField.lean | 7 +- .../Euler/MeanBoundaryOperator.lean | 2 +- .../Euler/MeanCutoffCurlBound.lean | 26 +-- .../Euler/MeanCutoffDifferenceBound.lean | 19 +- .../Euler/MeanGradientTestSpace.lean | 2 +- .../Euler/MeanLocalL2Energy.lean | 2 +- .../Euler/MeanPacketForcing.lean | 2 +- .../Euler/MeanScalarSobolev.lean | 7 +- .../Euler/MeanVectorIdentities.lean | 6 +- .../Euler/MetricHeatEnergy.lean | 3 +- .../Euler/NonnegativeLogConvex.lean | 2 +- .../Euler/OrdinaryEulerGradientControl.lean | 2 +- .../Euler/OrdinaryL2Integration.lean | 5 +- .../Euler/OrdinarySmoothWords.lean | 2 +- .../Euler/OrdinarySobolevL4.lean | 21 +- .../Euler/OrdinaryWordBounds.lean | 4 +- .../Euler/PacketFieldPhysicalSobolev.lean | 2 +- .../Euler/PacketTimeProfiles.lean | 2 +- .../Euler/ParameterWordGevrey.lean | 2 +- .../Euler/ParentState.lean | 12 +- .../Euler/PhysicalGraphFlowBounds.lean | 4 +- .../Euler/PhysicalGraphGevrey.lean | 4 +- .../Euler/PhysicalL2Scaling.lean | 2 +- .../Euler/PolynomialCostMajorant.lean | 2 +- .../Euler/ScalarEulerVorticity.lean | 1 - .../Euler/SmoothL2Series.lean | 2 +- .../Euler/SmoothTimeFieldComposition.lean | 2 +- .../Euler/SourceCylinderPressureField.lean | 3 +- .../TransverseForwardCoefficientGevrey.lean | 3 +- .../TransversePacketHistoryPressure.lean | 3 +- .../Euler/WeightedForcingTime.lean | 2 +- .../Euler/WholeSpaceGaussianFields.lean | 2 +- .../ForMathlib/SmoothCutoff.lean | 2 +- .../ForMathlib/SmoothnessOrder.lean | 2 +- .../ForMathlib/SobolevThreeDimensional.lean | 23 ++- .../ForMathlib/WeightedDecay.lean | 2 +- .../NavierStokes/ActualCandidateAssembly.lean | 1 - .../NavierStokes/AxisCoefficientSpace.lean | 2 +- .../NavierStokes/ConstructedSlowBase.lean | 2 - .../NavierStokes/CurlClassBounds.lean | 2 +- .../NavierStokes/EdgeWeightJets.lean | 4 +- .../NavierStokes/ExponentLedger.lean | 2 +- .../NavierStokes/ParametricODE.lean | 2 +- .../NavierStokes/PrimaryPulseBounds.lean | 2 +- .../NavierStokes/PulseAmplitude.lean | 2 +- .../NavierStokes/R3/LpNormTools.lean | 11 +- .../NavierStokes/R3/PairedKernelBound.lean | 13 +- .../NavierStokes/R3/PressureFlux.lean | 56 ++++-- .../NavierStokes/R3/PressureFunctionals.lean | 2 +- .../NavierStokes/R3/RieszTestOperators.lean | 3 +- .../R3/WeightedInterpolation.lean | 31 +-- .../NavierStokes/R3/WeightedSobolev.lean | 3 +- .../NavierStokes/R3/WholeSpaceUniqueness.lean | 4 +- .../R3FiniteEnergyComparison.lean | 3 +- .../NavierStokes/RadialPullback.lean | 2 +- .../NavierStokes/TangentODE.lean | 2 +- .../Neukirch/ExtensionOfDedekindDomains.lean | 11 +- .../Neukirch/HilbertRamificationTheory.lean | 59 +++--- LeanPool/NonSoficGroup/Spectral.lean | 4 +- .../OSforGFF/Bochner/PositiveDefinite.lean | 2 +- LeanPool/OSforGFF/Covariance/Momentum.lean | 4 +- LeanPool/OSforGFF/Covariance/Position.lean | 2 +- LeanPool/OSforGFF/Covariance/RealForm.lean | 7 +- .../Nuclear/NuclearTensorProduct.lean | 2 +- .../SchwartzNuclear/HermiteTensorProduct.lean | 6 +- .../SchwartzHermiteExpansion.lean | 13 +- .../SchwartzNuclear/SchwartzSlicing.lean | 8 +- .../OSforGFF/General/FunctionalAnalysis.lean | 10 +- LeanPool/OSforGFF/General/L2TimeIntegral.lean | 2 +- .../OSforGFF/General/PositiveDefinite.lean | 2 +- .../General/SchwartzTranslationDecay.lean | 5 +- .../KolmogorovExtension.lean | 1 + LeanPool/OSforGFF/Measure/Construct.lean | 6 +- .../OSforGFF/Measure/GaussianFreeField.lean | 2 +- LeanPool/OSforGFF/Measure/Minlos.lean | 2 +- LeanPool/OSforGFF/Measure/MinlosAnalytic.lean | 5 +- .../Minlos/MeasurableModification.lean | 5 +- .../OSforGFF/Minlos/MinlosConcentration.lean | 10 +- .../OSforGFF/Minlos/ProjectiveFamily.lean | 9 +- LeanPool/OSforGFF/OS/Axioms.lean | 2 +- LeanPool/OSforGFF/OS/OS0Analyticity.lean | 7 +- LeanPool/OSforGFF/OS/OS1Regularity.lean | 6 +- LeanPool/OSforGFF/OS/OS4Ergodicity.lean | 8 +- .../OSforGFF/Schwinger/GaussianMoments.lean | 2 +- .../Spacetime/ComplexTestFunction.lean | 2 +- .../OSforGFF/Spacetime/DiscreteSymmetry.lean | 2 +- .../OSforGFF/Spacetime/TimeTranslation.lean | 2 +- .../CompletedZeta/FractionalShapeTheta.lean | 4 +- .../FunctionalEquationLogDeriv.lean | 4 +- .../Odlyzko/CompletedZeta/GammaFactor.lean | 2 +- .../Odlyzko/CompletedZeta/RightHalfPlane.lean | 4 +- .../Odlyzko/CompletedZeta/UnitSlabRadial.lean | 5 +- .../CompletedZeta/VerticalLowerBound.lean | 2 +- .../CompletedZetaCenterLogBound.lean | 2 +- .../GaussDigammaEqDigamma.lean | 4 +- .../RegularizedPoitouContourLimit.lean | 2 +- .../Odlyzko/TestFunction/ComplexFourier.lean | 7 +- LeanPool/Odlyzko/Theta/PoissonSummation.lean | 2 +- LeanPool/OrderPQ/Basic.lean | 3 +- LeanPool/OrderPQ/MonoidHom.lean | 2 +- LeanPool/PCFTheory/Background/Club.lean | 3 +- LeanPool/PCFTheory/Background/Ordinal.lean | 4 +- .../Convergence/CurvAbsorb/Algebraic.lean | 5 +- .../LocalGeometry/SegmentEstimate.lean | 7 +- .../FlatCaseArithmetic.lean | 2 +- .../LyapunovContraction/Step1.lean | 9 +- .../Convergence/RateArithmetic.lean | 2 +- .../MorseBott/GradAlign.lean | 6 +- .../MorseBott/TubularProjection/IFT.lean | 7 +- LeanPool/PentagonalNumberTheorem/Complex.lean | 2 +- .../PentagonalNumberTheorem/Partition.lean | 1 - LeanPool/PermanentFormulaLowerBound.lean | 45 +++-- .../DimdPoly/Internal/Auxiliary.lean | 26 ++- .../Internal/CoefficientLimitRigidity.lean | 36 +--- .../Internal/ExactModulusRecovery.lean | 25 +-- .../Hermite1Dimd/BlockLocalization.lean | 3 +- .../Hermite1Dimd/ImportedAnalyticInputs.lean | 2 - .../Hermite1Dimd/ProductBasisAndAnnuli.lean | 2 - .../Internal/Hermitek/TrueLevelBasis.lean | 4 +- .../Internal/ImportedAnalyticInputs.lean | 56 ++++-- .../Internal/OrthogonalCoercivity.lean | 4 +- .../OrthogonalReduction.lean | 14 +- .../DimdPoly/Internal/PhaseStability.lean | 11 +- .../DimdPoly/Internal/TensorBasis.lean | 6 +- .../OrbitHomologicalEquation.lean | 6 +- LeanPool/PointwiseBirkhoff/Main.lean | 6 +- .../ANRPolynomialMethod.lean | 188 +++++++++--------- .../CauchyDavenportTheorem.lean | 7 +- .../RestrictedSumDistinctSizes.lean | 34 ++-- .../VandermondeCoefficientFormula.lean | 22 +- .../Explanatory.lean | 40 ++-- .../QuadraticIterates/ArchMath1992/Main.lean | 2 +- .../Mathlib/FieldTheory/Multiquadratic.lean | 4 +- .../Mathlib/GroupTheory/PGroup.lean | 4 +- .../Mathlib/RingTheory/MoebiusFactor.lean | 1 + .../QuantumParallelRepetition/Part01.lean | 6 +- .../QuantumParallelRepetition/Part10.lean | 4 +- LeanPool/QuasiBorelSpaces/Defs.lean | 2 +- .../QuasiBorelSpaces/MeasureTheory/List.lean | 2 +- .../MeasureTheory/Quantile.lean | 8 +- .../MeasureTheory/Randomization.lean | 8 +- .../OmegaCompletePartialOrder/Basic.lean | 2 +- .../PreProbabilityMeasure.lean | 8 +- LeanPool/RamanujanNagell/Helpers.lean | 2 +- .../RamanujanTauMissesPrimes/Solution.lean | 6 +- LeanPool/Redhill/Common/SubsumCondition.lean | 3 +- LeanPool/Redhill/General/Defs.lean | 2 +- LeanPool/Redhill/KonyaginPrelude.lean | 9 +- LeanPool/Redhill/ToMathlib/NatSumProd.lean | 2 +- .../L2Compactness/Approximation.lean | 2 +- .../Euclidean/TranslationEstimateL2.lean | 16 +- .../Chartwise.lean | 4 +- .../Function/LpSpace/ChangeMeasureLeSmul.lean | 7 +- LeanPool/RiemannMappingTheorem/DerivInj.lean | 1 - LeanPool/RiemannMappingTheorem/ToMathlib.lean | 2 +- .../EllipticCurve/Dedekind.lean | 2 +- .../EllipticCurve/Infinity.lean | 21 +- .../EllipticCurve/Instances.lean | 1 + .../FunctionField/Divisor.lean | 36 ++-- .../FundamentalIdentity.lean | 8 +- .../Genus/Ramification.lean | 8 +- LeanPool/RiemannRochFunctionFields/Place.lean | 9 +- .../SeparableRelNorm.lean | 16 +- LeanPool/RlTheoryInLean/Data/Matrix/Mul.lean | 2 +- .../Data/Matrix/Stochastic.lean | 10 +- .../RlTheoryInLean/Order/Filter/Basic.lean | 2 +- .../Probability/MarkovChain/Trajectory.lean | 6 +- .../DiscreteGronwall.lean | 4 +- LeanPool/SardMoreira/ContDiff.lean | 3 +- LeanPool/SardMoreira/LinearAlgebra.lean | 2 +- LeanPool/SardMoreira/LocalEstimates.lean | 2 +- LeanPool/SardMoreira/MainTheorem.lean | 2 +- LeanPool/SardMoreira/ToMathlib/PR32186.lean | 4 +- LeanPool/SardMoreira/ToMathlib/PR32986.lean | 2 +- LeanPool/SardMoreira/ToMathlib/PR32993.lean | 2 +- LeanPool/SardMoreira/Unused.lean | 16 +- .../SelbergSieve4/ForArithmeticFunction.lean | 2 +- LeanPool/SelbergSieve4/ForMathlib/Basic.lean | 2 +- LeanPool/SelbergSieve4/Selberg.lean | 2 +- LeanPool/SelbergSieve4/SieveLemmas.lean | 2 +- LeanPool/SelbergSieve4/UpperBoundSieve.lean | 2 +- LeanPool/SetTheory/KunenInconsistency.lean | 9 +- LeanPool/SetTheory/Omega.lean | 11 +- LeanPool/SetTheory/Ordinals.lean | 18 +- .../Matrix/NonnegPower.lean | 2 +- .../Matrix/PerronFrobenius.lean | 12 +- .../Operator/JentzschProof.lean | 7 +- LeanPool/SpherePacking/Foundations.lean | 8 +- LeanPool/SpherePacking/HarmonicAnalysis.lean | 3 +- LeanPool/SpherePacking/MellinAnalysis.lean | 2 +- LeanPool/SpherePacking/PackingBound.lean | 6 +- LeanPool/SpherePacking/SaddleAnalysis.lean | 2 +- LeanPool/Sundogcert/VarWheel.lean | 2 +- LeanPool/Vlasov/Basic.lean | 3 +- LeanPool/Vlasov/OT/CharacteristicFlow.lean | 6 +- LeanPool/Vlasov/OT/Coupling.lean | 12 +- LeanPool/Vlasov/OT/Wasserstein.lean | 2 +- LeanPool/Vlasov/OT/WeakToLagrangian.lean | 55 +++-- LeanPool/Vlasov/OT/WellPosedness.lean | 41 ++-- LeanPool/ZFLean/Naturals.lean | 2 + LeanPool/Zeta3Irrational/Basic.lean | 6 +- LeanPool/Zeta3Irrational/D.lean | 2 +- LeanPool/Zeta3Irrational/Integral.lean | 10 +- .../ZetaZeros/Hilbert/AlphaExpansion.lean | 10 +- LeanPool/ZetaZeros/Hilbert/L2.lean | 2 +- LeanPool/ZetaZeros/Zeta/Kernel.lean | 5 +- .../ZhangYeungInequality/EntropyRegion.lean | 2 +- .../ForMathlib/ConditionalIndependence.lean | 2 +- .../PFR/ForMathlib/Entropy/Basic.lean | 3 +- .../PFR/ForMathlib/Entropy/Kernel/Basic.lean | 1 - .../PFR/ForMathlib/Entropy/Measure.lean | 29 +-- .../PFR/ForMathlib/FiniteRange/Defs.lean | 20 +- .../Mathlib/MeasureTheory/Measure/Dirac.lean | 3 +- .../PFR/Mathlib/Probability/IdentDistrib.lean | 4 +- .../Probability/Independence/Basic.lean | 14 +- .../Probability/Kernel/Disintegration.lean | 2 +- .../ZhangYeungInequality/Test/Theorem5.lean | 2 +- LeanPool/ZhangYeungInequality/Theorem2.lean | 5 +- LeanPool/ZhangYeungInequality/Theorem4.lean | 8 +- LeanPool/ZhangYeungInequality/Theorem5.lean | 6 +- 539 files changed, 2412 insertions(+), 2374 deletions(-) diff --git a/LeanPool/ABCExceptions/Section2.lean b/LeanPool/ABCExceptions/Section2.lean index 3f17014c65..da48b1bf6e 100644 --- a/LeanPool/ABCExceptions/Section2.lean +++ b/LeanPool/ABCExceptions/Section2.lean @@ -414,8 +414,7 @@ theorem Finset.abcExceptionsBelow_subset_union_dyadicPoints (ε : ℝ) (X : ℕ) rw [← Real.rpow_le_rpow_left_iff (show 1 < (2 : ℝ) by norm_num)] norm_cast at this ⊢ convert this using 2 - · rfl - · ring_nf + ring have {a : ℕ} : (2 ^ n : ℝ) ^ (Nat.log 2 (radical a) / n : ℝ) = 2 ^ Nat.log 2 (radical a) := by rw [← Real.rpow_natCast_mul (by norm_num)] @@ -849,7 +848,7 @@ private theorem prod_y_large_le_X_pow : ∏ m ∈ Finset.Ioc d n, y m ≤ (X : _ ≤ (∏ m ∈ Finset.Ioc d n, y m ^ m : ℝ) ^ (d⁻¹ : ℝ) := by rw [← Real.finsetProd_rpow] · push_cast - apply Finset.prod_le_prod + apply Finset.prod_le_prod₀ · intros; positivity simp only [Finset.mem_Ioc, and_imp] intro i hMi hin @@ -866,7 +865,7 @@ private theorem prod_y_large_le_X_pow : ∏ m ∈ Finset.Ioc d n, y m ≤ (X : gcongr norm_cast conv => rhs; rw [← prod_y_pow_eq_n] - apply Finset.prod_le_prod_of_subset_of_one_le' + apply Finset.prod_le_prod_of_subset_of_one_le · simp simp only [Finset.mem_union, Finset.mem_Icc, y] intro i hi _ @@ -882,7 +881,7 @@ private theorem c_le_X_pow : c ≤ (X : ℝ) ^ ε := calc c ≤ ∏ m ∈ Finset.Ioc d n, (y m : ℝ) ^ K := by simp_rw [c] push_cast - apply Finset.prod_le_prod + apply Finset.prod_le_prod₀ · intros; positivity simp only [Finset.mem_Ioc, and_imp] intro x hMx hxn @@ -1057,7 +1056,7 @@ private theorem X_pow_mul_prod_le_radical : (X : ℝ)^(-ε) * ∏ j, x j ≤ (ra Fin.prod_univ_eq_prod_range (fun j ↦ if j + 1 ≠ K then y (j + 1) else 1) d] _ ≤ ∏ m ∈ Finset.range d, y (m+1) := by norm_cast - apply Finset.prod_le_prod_of_subset_of_one_le' + apply Finset.prod_le_prod_of_subset_of_one_le · exact Finset.filter_subset (fun m ↦ m + 1 ≠ K) (Finset.range d) · intros apply hy_pos @@ -1071,7 +1070,7 @@ private theorem X_pow_mul_prod_le_radical : (X : ℝ)^(-ε) * ∏ j, x j ≤ (ra simp [← this, Finset.prod_map] _ ≤ ∏ m ∈ Finset.Icc 1 d ∪ Finset.Ioc d n, y m := by norm_cast - apply Finset.prod_le_prod_of_subset_of_one_le' + apply Finset.prod_le_prod_of_subset_of_one_le · simp_all · simp only [Finset.mem_union, Finset.mem_Icc, not_and] intro i _ _ @@ -1317,7 +1316,7 @@ theorem B_to_triple_surjOn {α β γ : ℝ} (x : ℕ) (ε : ℝ) ring have prod_log_pow_le_prod_pow {u : Fin d → ℕ} (hu : ∀ i, 0 < u i): ∏ i, (2 ^ Nat.log 2 (u i)) ^ (i.val + 1) ≤ ∏ i, u i ^ (i.val + 1) := by - apply Finset.prod_le_prod + apply Finset.prod_le_prod₀ · simp simp only [Finset.mem_univ, forall_const] intro i @@ -1371,7 +1370,7 @@ theorem B_to_triple_surjOn {α β γ : ℝ} (x : ℕ) (ε : ℝ) _ ≤ 2 * (∏ i, (2 ^ (Nat.log 2 (w i)+1))^(i.val+1) : ℝ):= by norm_cast gcongr _ * ?_ - apply Finset.prod_le_prod + apply Finset.prod_le_prod₀ · simp intro i _ gcongr diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications/General.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications/General.lean index d15a77b738..25a11a246a 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications/General.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications/General.lean @@ -28,11 +28,11 @@ namespace Filter variable {α β γ : Type*} {s t : Set α} {l : Filter α} lemma mem_congr (h : s =ᶠ[l] t) : s ∈ l ↔ t ∈ l := by apply congr_sets - rwa [eventuallyEq_set, eventually_iff] at h + rwa [eventuallyEqSet_iff, eventually_iff] at h lemma eventuallyEq_set' {α} {s t : Set α} {l : Filter α} : - l.EventuallyEq s t ↔ (s \ t)ᶜ ∈ l ∧ (t \ s)ᶜ ∈ l := by + l.EventuallyEqSet s t ↔ (s \ t)ᶜ ∈ l ∧ (t \ s)ᶜ ∈ l := by constructor <;> intro h - · simp [Filter.mem_congr (h.diff (Filter.EventuallyEq.refl _ t)).compl, - Filter.mem_congr ((Filter.EventuallyEq.refl _ t).diff h).compl] - · rw [Filter.eventuallyEq_set]; filter_upwards [h.1, h.2]; tauto_set + · simp [Filter.mem_congr (h.diff (Filter.EventuallyEqSet.refl _ t)).compl, + Filter.mem_congr ((Filter.EventuallyEqSet.refl _ t).diff h).compl] + · rw [Filter.eventuallyEqSet_iff]; filter_upwards [h.1, h.2]; tauto_set end Filter diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications/Meager.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications/Meager.lean index d3b1e2fac4..68be5bc906 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications/Meager.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Applications/Meager.lean @@ -279,7 +279,7 @@ lemma forces_trans (hU : U ⊩ V) (h : V ⊩ A) : U ⊩ A := by exact (hU.union h).mono diff_subset_union lemma forces_congr {U : tX.Opens} (h : A =ᵇ B) : U ⊩ A ↔ U ⊩ B := by simp_rw [forces_iff_isMeagre] - exact isMeagre_congr (Filter.EventuallyEq.rfl.diff h) + exact isMeagre_congr (Filter.EventuallyEqSet.rfl.diff h) private lemma forces_disjoint_iUnion_left {I} (U : I → tX.Opens) (hd : Pairwise (Function.onFun Disjoint (fun i ↦ (U i : Set X)))) (h : ∀ i, U i ⊩ A) : ⨆ i, U i ⊩ A := by diff --git a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic/General.lean b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic/General.lean index 39fa53fbc1..6e55f92700 100644 --- a/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic/General.lean +++ b/LeanPool/AFormalizationOfBorelDeterminacyInLean/Basic/General.lean @@ -80,8 +80,8 @@ lemma Cardinal.choose_injection {α β : Type u} (f : α → Set β) (h : ∀ a, #(Set.range (uncurryProp recg)) ≤ _) (Cardinal.card_typein_lt (r := wo) a hwol)) (h a)) (Cardinal.mk_le_mk_of_subset (Set.sdiff_eq_empty.mp hf))).some - refine ⟨hwo.fix (r := wo) recg, ?_, ?_⟩ + refine ⟨hwo.wf.fix recg, ?_, ?_⟩ · intro a a' he rcases trichotomous_of wo a a' with h | h | h <;> [symm at he; exact h; skip] <;> - (rw [hwo.fix_eq] at he; cases (equals_nonempty_some he.symm).2 ⟨⟨_, h⟩, rfl⟩) - · intro a; rw [hwo.fix_eq]; exact Set.sdiff_subset (Set.Nonempty.some_mem _) + (rw [hwo.wf.fix_eq] at he; cases (equals_nonempty_some he.symm).2 ⟨⟨_, h⟩, rfl⟩) + · intro a; rw [hwo.wf.fix_eq]; exact Set.sdiff_subset (Set.Nonempty.some_mem _) diff --git a/LeanPool/AndersonConjecture/AdicKerEval.lean b/LeanPool/AndersonConjecture/AdicKerEval.lean index cc0ac6c358..92826136df 100644 --- a/LeanPool/AndersonConjecture/AdicKerEval.lean +++ b/LeanPool/AndersonConjecture/AdicKerEval.lean @@ -133,8 +133,7 @@ lemma ker_evalₐ_le_smul_top (I : Ideal R) [IsNoetherianRing R] (n : ℕ) ofTensorProductEquivOfFiniteNoetherian_apply, ← LinearMap.comp_apply, nat, LinearMap.comp_apply] rw [key] - induction w using TensorProduct.induction_on with - | zero => simp + induction w using TensorProduct.inductionOn with | tmul a m => simp only [TensorProduct.AlgebraTensorModule.map_tmul, LinearMap.id_apply] rw [ofTensorProduct_tmul] diff --git a/LeanPool/AndersonConjecture/Jensen/Adjoin/Adjoin.lean b/LeanPool/AndersonConjecture/Jensen/Adjoin/Adjoin.lean index a390f261ea..7b0b29e85b 100644 --- a/LeanPool/AndersonConjecture/Jensen/Adjoin/Adjoin.lean +++ b/LeanPool/AndersonConjecture/Jensen/Adjoin/Adjoin.lean @@ -302,7 +302,7 @@ private def adjoin_surjectivity_proof have hf_bar_ne : f.map (φ P) ≠ 0 := by intro h_eq apply h_neg - have h := congr_fun (congr_arg Polynomial.coeff h_eq) i + have h := congr_arg (fun p => Polynomial.coeff p i) h_eq simp only [Polynomial.coeff_map, Polynomial.coeff_zero] at h exact Ideal.mem_comap.mpr (Ideal.Quotient.eq_zero_iff_mem.mp h) have hP_in_C : P ∈ C := by diff --git a/LeanPool/AndersonConjecture/Jensen/Adjoin/FromPrime.lean b/LeanPool/AndersonConjecture/Jensen/Adjoin/FromPrime.lean index 77d3e573f8..9a3501b6c1 100644 --- a/LeanPool/AndersonConjecture/Jensen/Adjoin/FromPrime.lean +++ b/LeanPool/AndersonConjecture/Jensen/Adjoin/FromPrime.lean @@ -333,7 +333,7 @@ private def adjoin_from_prime_proof have hf_bar_ne : f.map (φ P) ≠ 0 := by intro h_eq apply h_neg - have h := congr_fun (congr_arg Polynomial.coeff h_eq) i + have h := congr_arg (fun p => Polynomial.coeff p i) h_eq simp only [Polynomial.coeff_map, Polynomial.coeff_zero] at h exact Ideal.mem_comap.mpr (Ideal.Quotient.eq_zero_iff_mem.mp h) -- P ∈ C: find nonzero r₀ ∈ P ∩ R, show P is minimal over (r₀) diff --git a/LeanPool/AndersonConjecture/Jensen/Adjoin/Transcendental.lean b/LeanPool/AndersonConjecture/Jensen/Adjoin/Transcendental.lean index f190fab1f6..db16f19605 100644 --- a/LeanPool/AndersonConjecture/Jensen/Adjoin/Transcendental.lean +++ b/LeanPool/AndersonConjecture/Jensen/Adjoin/Transcendental.lean @@ -417,12 +417,11 @@ private lemma adjoinLoc_uniqueFactorizationMonoid exact ⟨f, 1, by simp_all, by rw [map_one, mul_one]⟩ have : WfDvdMonoid S_sub := by - constructor apply Subrelation.wf (r := InvImage DvdNotUnit (fun (a : S_sub) => (a : T))) · intro a b ⟨ha_ne, c, hc_nu, hab_eq⟩ refine ⟨fun h => ha_ne (Subtype.ext h), c.val, ?_, congrArg Subtype.val hab_eq⟩ exact fun hcu_T => hc_nu (hinv c (IsLocalRing.notMem_maximalIdeal.mpr hcu_T)) - · exact InvImage.wf _ IsWellFounded.wf + · exact InvImage.wf _ wellFounded_dvdNotUnit apply UniqueFactorizationMonoid.mk (fun {a} => ⟨fun ha_irr => ?_, Prime.irreducible⟩) have ha_M : (a : T) ∈ IsLocalRing.maximalIdeal T := by by_contra h diff --git a/LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean b/LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean index 881ae56971..830c69f895 100644 --- a/LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean +++ b/LeanPool/AndersonConjecture/Jensen/CloseUp/AvoidanceStep.lean @@ -392,7 +392,7 @@ private def close_up_avoidance_step_proof have hf_bar_ne : f.map (φ P) ≠ 0 := by intro h_eq apply h_neg - have h := congr_fun (congr_arg Polynomial.coeff h_eq) i + have h := congr_arg (fun p => Polynomial.coeff p i) h_eq simp only [Polynomial.coeff_map, Polynomial.coeff_zero] at h exact Ideal.mem_comap.mpr (Ideal.Quotient.eq_zero_iff_mem.mp h) -- P is an associated prime of some T/(r₀) diff --git a/LeanPool/AndersonConjecture/Jensen/CloseUp/NoCommonFactor.lean b/LeanPool/AndersonConjecture/Jensen/CloseUp/NoCommonFactor.lean index 302f89addc..d6f14a10c7 100644 --- a/LeanPool/AndersonConjecture/Jensen/CloseUp/NoCommonFactor.lean +++ b/LeanPool/AndersonConjecture/Jensen/CloseUp/NoCommonFactor.lean @@ -521,7 +521,7 @@ private def close_up_aux_no_common_nonzero_proof have hf_bar_ne : f.map (φ P) ≠ 0 := by intro h_eq apply h_neg - have h := congr_fun (congr_arg Polynomial.coeff h_eq) i + have h := congr_arg (fun p => Polynomial.coeff p i) h_eq simp only [Polynomial.coeff_map, Polynomial.coeff_zero] at h exact Ideal.mem_comap.mpr (Ideal.Quotient.eq_zero_iff_mem.mp h) have hP_in_C_main : P ∈ C_main := by diff --git a/LeanPool/AndersonConjecture/Jensen/CombinedStep.lean b/LeanPool/AndersonConjecture/Jensen/CombinedStep.lean index e91321307d..4ef2e81db9 100644 --- a/LeanPool/AndersonConjecture/Jensen/CombinedStep.lean +++ b/LeanPool/AndersonConjecture/Jensen/CombinedStep.lean @@ -243,7 +243,7 @@ private def close_up_all_one_pass_aux_proof set Pairs := Finset R'.carrier × R'.carrier with Pairs_def have cdec : ∀ (p : Prop), Decidable p := Classical.propDecidable let pairLO : LinearOrder Pairs := IsWellOrder.linearOrder WellOrderingRel - let pairWF : WellFoundedLT Pairs := ⟨WellOrderingRel.isWellOrder.wf⟩ + let pairWF : WellFoundedLT Pairs := WellOrderingRel.isWellOrder.wf -- #Pairs ≤ max(ℵ₀, #R'): for infinite R', #(Finset R' × R') = #R' have hPairs_card : Cardinal.mk Pairs ≤ max Cardinal.aleph0 (Cardinal.mk R'.carrier) := by by_cases hfin : Finite R'.carrier @@ -254,7 +254,7 @@ private def close_up_all_one_pass_aux_proof le_trans hPairs_card (max_le (le_max_left ..) R'.card_le) let build_union := @build_union_isNSubring T _ _ _ _ -- Define f by well-founded recursion: f(p) closes the pair p over the union of all f(q), q < p - let f : Pairs → NSubring T := WellFounded.fix pairWF.wf (fun p IH => + let f : Pairs → NSubring T := WellFounded.fix pairWF (fun p IH => if hmono : ∀ q₁ q₂ (h₁ : q₁ < p) (h₂ : q₂ < p), q₁ ≤ q₂ → (IH q₁ h₁).carrier ≤ (IH q₂ h₂).carrier then if hprimes : ∀ q₁ q₂ (h₁ : q₁ < p) (h₂ : q₂ < p) (h12 : q₁ ≤ q₂) @@ -311,8 +311,8 @@ private def close_up_all_one_pass_aux_proof (⟨(p.2 : T), hle p.2.2⟩ : (f p).carrier) ∈ Ideal.map (Subring.inclusion hle) (Ideal.span ↑p.1)) := by intro p - induction p using pairWF.wf.induction with - | h p IHGood => + induction p using pairWF.induction with + | ind p IHGood => have hfq_R'_le : ∀ q (hq : q < p), R'.carrier ≤ (f q).carrier := fun q hq => (IHGood q hq).1.choose have hfq_R'_primes : ∀ q (hq : q < p) (r : R'.carrier), Prime r → diff --git a/LeanPool/AndersonConjecture/Jensen/Construction/Transfinite.lean b/LeanPool/AndersonConjecture/Jensen/Construction/Transfinite.lean index 01feca1dac..47eebac910 100644 --- a/LeanPool/AndersonConjecture/Jensen/Construction/Transfinite.lean +++ b/LeanPool/AndersonConjecture/Jensen/Construction/Transfinite.lean @@ -625,8 +625,12 @@ private def transfinite_construction_proof (hprimes_lt (le_of_lt hlt') hγ_lt r (((IH_wf hγ_ex.choose hγ_lt).1 β₁ hlt').trans (data hγ_ex.choose).2.2.1.le r.2) hr) + have prime_of_eq : ∀ (S : NSubring T), S = prevF α (fun γ hγ => data γ) → + ∀ (hx : (r : T) ∈ S.carrier), Prime (⟨(r : T), hx⟩ : S.carrier) := by + rintro S rfl hx + exact hprime_prevF have hprime_prev : Prime (⟨(r : T), hmem_prev⟩ : (data α).2.1.carrier) := - prime_transport _ _ h_nsub_eq.symm _ hmem_prevF_carrier hprime_prevF + prime_of_eq _ h_nsub_eq hmem_prev have hext := (data α).2.2.1 have hprime_ring := hext.primes_preserved ⟨(r : T), hmem_prev⟩ hprime_prev cases heq_α diff --git a/LeanPool/AndersonConjecture/Jensen/KrullDomain/HeightBound.lean b/LeanPool/AndersonConjecture/Jensen/KrullDomain/HeightBound.lean index bd8da02f5a..0c3b832472 100644 --- a/LeanPool/AndersonConjecture/Jensen/KrullDomain/HeightBound.lean +++ b/LeanPool/AndersonConjecture/Jensen/KrullDomain/HeightBound.lean @@ -830,12 +830,11 @@ private def build_intersection_nsubring_proof -- WfDvdMonoid for S: divisibility in S embeds into divisibility in T (which is Noetherian) have : IsDomain S_sub := inferInstance have : WfDvdMonoid S_sub := by - constructor apply Subrelation.wf (r := InvImage DvdNotUnit (fun (a : S_sub) => (a : T))) · intro a b ⟨ha_ne, c, hc_nu, hab_eq⟩ refine ⟨fun h => ha_ne (Subtype.ext h), c.val, ?_, congrArg Subtype.val hab_eq⟩ exact fun hcu_T => hc_nu (hinv c (IsLocalRing.notMem_maximalIdeal.mpr hcu_T)) - · exact InvImage.wf _ IsWellFounded.wf + · exact InvImage.wf _ wellFounded_dvdNotUnit have hS_mem_rep : ∀ s : S_sub, ∃ (a b : T), a ∈ Rbar ∧ b ∈ Rbar ∧ b ∉ IsLocalRing.maximalIdeal T ∧ (s : T) * b = a := by diff --git a/LeanPool/AndersonConjecture/Main.lean b/LeanPool/AndersonConjecture/Main.lean index c2f50bd8e7..0f9e7eead4 100644 --- a/LeanPool/AndersonConjecture/Main.lean +++ b/LeanPool/AndersonConjecture/Main.lean @@ -297,10 +297,7 @@ lemma range_map_subtype_le_ideal_map {A : Type u_1} [CommRing A] [IsLocalRing A] (↥(IsLocalRing.maximalIdeal A : Submodule A A))).surjective z change (AdicCompletion.map _ (Submodule.subtype _)) ((AdicCompletion.ofTensorProduct _ _) t) ∈ _ - induction t using TensorProduct.induction_on with - | zero => - rw [map_zero] - exact Submodule.zero_mem _ + induction t using TensorProduct.inductionOn with | tmul a m => rw [AdicCompletion.ofTensorProduct_tmul, map_smul, AdicCompletion.map_of] exact Ideal.mul_mem_left _ a (Ideal.mem_map_of_mem _ m.property) @@ -425,10 +422,7 @@ lemma range_map_subtype_pow_le {A : Type u_1} [CommRing A] [IsLocalRing A] (↥(M ^ n : Submodule A A))).surjective z change (AdicCompletion.map _ (Submodule.subtype _)) ((AdicCompletion.ofTensorProduct _ _) t) ∈ _ - induction t using TensorProduct.induction_on with - | zero => - rw [map_zero] - exact Submodule.zero_mem _ + induction t using TensorProduct.inductionOn with | tmul a m => rw [AdicCompletion.ofTensorProduct_tmul, map_smul, AdicCompletion.map_of] exact Ideal.mul_mem_left _ a (Ideal.mem_map_of_mem _ m.property) diff --git a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Density.lean b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Density.lean index cd4292d03b..8387ed75a1 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Density.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof4/Auxiliary/Density.lean @@ -57,7 +57,7 @@ lemma continuous_prodPoly_coeff (m : ℕ) : have hprod_eq : ∀ r : Fin (n + 1) → ℝ, (∏ i : Fin (n + 1), (X - C (r i))).coeff k = ((∏ i : Fin n, (X - C (r (Fin.castSucc i)))) * (X - C (r (Fin.last n)))).coeff k := by - intro r; congr 1; exact Fin.prod_univ_castSucc _ + intro r; rw [Fin.prod_univ_castSucc] simp_rw [hprod_eq] cases k with | zero => diff --git a/LeanPool/ArchonFirstProofResults/FirstProof4/Problem4.lean b/LeanPool/ArchonFirstProofResults/FirstProof4/Problem4.lean index 6974306291..d63d4d120a 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof4/Problem4.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof4/Problem4.lean @@ -318,7 +318,7 @@ private lemma g_eval_lower_at_test_points (n : ℕ) (g : ℝ[X]) · have hcard : (Finset.univ.erase i).card = n - 1 := by rw [Finset.card_erase_of_mem (Finset.mem_univ _), Finset.card_univ, Fintype.card_fin] rw [← hcard, ← Finset.prod_const] - exact Finset.prod_le_prod + exact Finset.prod_le_prod₀ (fun _ _ => hgap_sub_δ_pos.le) (fun j hj => hfar j (Finset.ne_of_mem_erase hj)) · apply pow_nonneg; linarith diff --git a/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/DynamicColoring.lean b/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/DynamicColoring.lean index 6fde15a07c..51dc95e185 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/DynamicColoring.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof6/Auxiliary/DynamicColoring.lean @@ -107,7 +107,7 @@ lemma pinv_pullback_eq have h_diff_nn : 0 ≤ star y ⬝ᵥ ((graphLaplacian G - L_S) *ᵥ y) := (inducedLaplacian_le_graphLaplacian G S).dotProduct_mulVec_nonneg y rw [Matrix.sub_mulVec, hLy, zero_sub, dotProduct_neg] at h_diff_nn - exact (hLS_psd.dotProduct_mulVec_zero_iff y).mp + exact (hLS_psd.dotProduct_mulVec_zero_iff (x := y)).mp (le_antisymm (neg_nonneg.mp h_diff_nn) h_LS_nn) have hLP : L_S * P = L_S := by have key : ∀ v, (L_S * P) *ᵥ v = L_S *ᵥ v := by diff --git a/LeanPool/ArchonFirstProofResults/FirstProof6/Problem6.lean b/LeanPool/ArchonFirstProofResults/FirstProof6/Problem6.lean index 023529ab4f..c1d6ce127d 100644 --- a/LeanPool/ArchonFirstProofResults/FirstProof6/Problem6.lean +++ b/LeanPool/ArchonFirstProofResults/FirstProof6/Problem6.lean @@ -355,7 +355,7 @@ lemma cross_edge_sum_le_graphLaplacian have laplacian_row_sum : ∀ (H : SimpleGraph V) [DecidableRel H.Adj] (a : V), ∑ b, graphLaplacian H a b = 0 := by intro H _ a - have h := congrFun (SimpleGraph.lapMatrix_mulVec_const_eq_zero (R := ℝ) H) a + have h := congrFun (H.lapMatrix_mulVec_one_eq_zero ℝ) a rw [graphLaplacian_eq_lapMatrix] simpa [Matrix.mulVec, dotProduct] using h -- Helper: inducedLaplacian row sum = 0 (induced subgraph is itself a graph Laplacian) diff --git a/LeanPool/ArtinWedderburn/ArtinWedderburnTheorem.lean b/LeanPool/ArtinWedderburn/ArtinWedderburnTheorem.lean index 973d05f8a8..578895b3db 100644 --- a/LeanPool/ArtinWedderburn/ArtinWedderburnTheorem.lean +++ b/LeanPool/ArtinWedderburn/ArtinWedderburnTheorem.lean @@ -33,7 +33,7 @@ theorem ArtinWedderburnForPrime {R : Type u} [Ring R] [h_nontriv : Nontrivial R] ∃ (n : ℕ) (D : Type u) (_ : DivisionRing D), Nonempty (R ≃+* Matrix (Fin n) (Fin n) D) := by have top_acc : Acc (fun x y => x < y) (⊤ : Ideal R) := - IsWellFounded.apply (fun x y ↦ x < y) ⊤ + WellFounded.apply h_artinian ⊤ have top_nice := accIdealNice h_prime h_artinian ⊤ top_acc have top_idem : IdemIdeal (⊤ : Ideal R) := by refine ⟨1, IsIdempotentElem.one, ?_⟩ diff --git a/LeanPool/ArtinWedderburn/CornerRing.lean b/LeanPool/ArtinWedderburn/CornerRing.lean index 18f036665d..eb061f8e96 100644 --- a/LeanPool/ArtinWedderburn/CornerRing.lean +++ b/LeanPool/ArtinWedderburn/CornerRing.lean @@ -430,10 +430,7 @@ theorem lift_acc_then_ideal_acc (idem_e : IsIdempotentElem e) (J : Ideal R) -- a) If R is artinian, then the corner ring is artinian theorem corner_ring_artinian [h_ar : IsArtinian R R] : IsArtinian (CornerSubring idem_e) (CornerSubring idem_e) := by - unfold IsArtinian at * - unfold WellFoundedLT at * - have Iacc : ∀ I : Ideal R, Acc (fun x y => x < y) I := fun I ↦ WellFounded.apply h_ar.wf I - apply IsWellFounded.mk + have Iacc : ∀ I : Ideal R, Acc (fun x y => x < y) I := fun I ↦ WellFounded.apply h_ar I have allacc : ∀ I : Ideal (CornerSubring idem_e), Acc (fun x y => x < y) I := by intro I have h : Acc (fun x y => x < y) (idealPush idem_e (idealLift idem_e I)) := diff --git a/LeanPool/ArtinWedderburn/NonUnitalToUnital.lean b/LeanPool/ArtinWedderburn/NonUnitalToUnital.lean index 6160bc26de..128e572af6 100644 --- a/LeanPool/ArtinWedderburn/NonUnitalToUnital.lean +++ b/LeanPool/ArtinWedderburn/NonUnitalToUnital.lean @@ -4,7 +4,6 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Matevz Miščič, Maša Žaucer, Job Petrovčič -/ import Mathlib.Algebra.Ring.Basic -import Mathlib.Algebra.Ring.MinimalAxioms /-! # Promoting a non-unital ring with a unit element to a unital ring @@ -18,8 +17,7 @@ namespace LeanPool.ArtinWedderburn variable {R : Type*} [NonUnitalRing R] variable (e : R) -/-- Designate `e` as the `1` element when building a unital `Ring` structure -on `R` via `Ring.ofMinimalAxioms`. -/ +/-- Designate `e` as the `1` element when building a unital `Ring` structure on `R`. -/ @[reducible] def eOne : One R := ⟨e⟩ @@ -28,17 +26,17 @@ variable (is_right_unit : ∀ x : R, x * e = x) -- if we have a nonunital ring where one element is the left and right unit simultaneously -- then it is a regular ring -/-- Promote a non-unital ring `R` with a two-sided identity `e` to a unital `Ring R`. -/ +/-- Promote a non-unital ring `R` with a two-sided identity `e` to a unital `Ring R`. + +The additive structure is inherited verbatim from the `NonUnitalRing R` instance, so the +`AddCommMonoid R` carried by the result is the one already in scope; rebuilding it (as +`Ring.ofMinimalAxioms` would) yields `nsmulRec`/`zsmulRec` instead and makes the two +incomparable during instance synthesis. -/ @[reducible] -def nonUnitalWEIsRing : Ring R := - @Ring.ofMinimalAxioms R (by exact inferInstance) (by exact inferInstance) (by exact inferInstance) - (by exact inferInstance) (by exact eOne e) - (by intro a b c; rw [add_assoc]) - (by intro a; exact AddZeroClass.zero_add a) - (by intro a; exact neg_add_cancel a) - (by intro a b c; exact mul_assoc a b c) - is_left_unit is_right_unit - (by intro a b c; exact LeftDistribClass.left_distrib a b c) - (by intro a b c; exact RightDistribClass.right_distrib a b c) +def nonUnitalWEIsRing : Ring R where + __ := (inferInstance : NonUnitalRing R) + __ := eOne e + one_mul := is_left_unit + mul_one := is_right_unit end LeanPool.ArtinWedderburn diff --git a/LeanPool/BannaiBannaiStanton/BoundOnDistanceSet.lean b/LeanPool/BannaiBannaiStanton/BoundOnDistanceSet.lean index 3204d813e6..e621055eb5 100644 --- a/LeanPool/BannaiBannaiStanton/BoundOnDistanceSet.lean +++ b/LeanPool/BannaiBannaiStanton/BoundOnDistanceSet.lean @@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Antoine du Fresne von Hohenesche -/ +import Mathlib.Algebra.MvPolynomial.CommRing import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.LinearAlgebra.Matrix.Rank import Mathlib.LinearAlgebra.Matrix.BilinearForm @@ -530,22 +531,22 @@ lemma bilinear_form_vanishes_on_orthogonal_complement f a * (eval ((Fin.append a.1 b.1) ∘ Fin.cast (by rw [two_mul])) p) * g b = ∑ m ∈ p.support, f a * (eval ((Fin.append a.1 b.1) ∘ Fin.cast (by rw [two_mul])) - (monomial m (coeff m p))) * g b := by + (monomial m (p.coeff m))) * g b := by intro a b conv_lhs => rw [p.as_sum, map_sum] rw [Finset.mul_sum, Finset.sum_mul] simp only [Finset.univ_eq_attach, hexp] have h_swap : ∑ b : A, ∑ a : A, ∑ m ∈ p.support, f a * (eval ((Fin.append a.1 b.1) - ∘ Fin.cast (by rw [two_mul])) (monomial m (coeff m p))) * g b = + ∘ Fin.cast (by rw [two_mul])) (monomial m (p.coeff m))) * g b = ∑ b : A, ∑ m ∈ p.support, ∑ a : A, f a * (eval ((Fin.append a.1 b.1) - ∘ Fin.cast (by rw [two_mul])) (monomial m (coeff m p))) * g b := by + ∘ Fin.cast (by rw [two_mul])) (monomial m (p.coeff m))) * g b := by apply Finset.sum_congr rfl intro b _ rw [Finset.sum_comm] rw [Finset.sum_comm] change ∑ b : A, ∑ a : A, ∑ m ∈ p.support, f a * (eval ((Fin.append a.1 b.1) - ∘ Fin.cast (by rw [two_mul])) (monomial m (coeff m p))) * g b = 0 + ∘ Fin.cast (by rw [two_mul])) (monomial m (p.coeff m))) * g b = 0 rw [h_swap, Finset.sum_comm] -- It then suffices to show that each term in the rewritten sum is 0. apply Finset.sum_eq_zero @@ -561,9 +562,9 @@ lemma bilinear_form_vanishes_on_orthogonal_complement have monomial_eq_smul_monomial (n : Fin (2 * d) →₀ ℕ) (a : F) : monomial n a = a • monomial n 1 := by simp [smul_monomial] rw [monomial_eq_smul_monomial] - have h_eq : (∑ a : A, ∑ b : A, f a * (coeff m p * + have h_eq : (∑ a : A, ∑ b : A, f a * (p.coeff m * ((eval a.1 (monomial m_left 1)) * eval b.1 (monomial m_right 1))) * g b) - = coeff m p * (∑ a : A, f a * eval a.1 (monomial m_left 1)) * + = p.coeff m * (∑ a : A, f a * eval a.1 (monomial m_left 1)) * (∑ b : A, g b * eval b.1 (monomial m_right 1)) := by rw [mul_assoc, Finset.sum_mul, Finset.mul_sum] apply Finset.sum_congr rfl @@ -610,7 +611,6 @@ lemma bilinear_form_vanishes_on_orthogonal_complement Finset.sum_ite_eq, Finset.mem_univ, ite_true, mul_ite, mul_one, mul_zero, ite_mul, zero_mul, Pi.basisFun_repr] at h_orth convert h_orth - rfl simp only [Finset.univ_eq_attach] at h_S_left rw [h_S_left] simp only [mul_zero, zero_mul] @@ -707,9 +707,9 @@ lemma Croot_Lev_Pach_lemma_generalised_1st_part let S2 := p.support.filter (fun m => s < (m_left m).support.sum (fun i => m_left m i)) -- We define M1 and M2 corresponding to S1 and S2. let M1 : Matrix A A F := fun a b => ∑ m ∈ S1, - (coeff m p) * eval a.1 (monomial (m_left m) 1) * eval b.1 (monomial (m_right m) 1) + (p.coeff m) * eval a.1 (monomial (m_left m) 1) * eval b.1 (monomial (m_right m) 1) let M2 : Matrix A A F := fun a b => ∑ m ∈ S2, - (coeff m p) * eval a.1 (monomial (m_left m) 1) * eval b.1 (monomial (m_right m) 1) + (p.coeff m) * eval a.1 (monomial (m_left m) 1) * eval b.1 (monomial (m_right m) 1) have h_M_eq : M = M1 + M2 := by ext a b rw [Matrix.add_apply] @@ -727,7 +727,7 @@ lemma Croot_Lev_Pach_lemma_generalised_1st_part · intro h rcases h with h | h <;> exact h.1 · intro m hm - rw [← mul_one (coeff m p)]; simp only [← smul_eq_mul]; rw [← smul_monomial] + rw [← mul_one (p.coeff m)]; simp only [← smul_eq_mul]; rw [← smul_monomial] simp only [smul_eval] -- Here we use the preliminary lemma `eval_split` to show that -- eval (x, y) m = eval x m_left * eval y m_right. @@ -750,7 +750,7 @@ lemma Croot_Lev_Pach_lemma_generalised_1st_part have h_rank1 : M1.rank ≤ dim A s := by rw [dim] have h_cols (b) : (fun a => M1 a b) ∈ LinearMap.range (evalMapRestricted A s) := by - let P := ∑ m ∈ S1, (coeff m p * + let P := ∑ m ∈ S1, (p.coeff m * eval b.1 (monomial (m_right m) (1 : F))) • monomial (m_left m) (1 : F) have hP : P ∈ restrictTotalDegree (Fin d) F s := by apply Submodule.sum_mem @@ -759,7 +759,7 @@ lemma Croot_Lev_Pach_lemma_generalised_1st_part apply Submodule.smul_mem rw [mem_restrictTotalDegree, totalDegree_monomial (m_left m) one_ne_zero] · exact hm.2 - have h_eval : (fun a => ∑ m ∈ S1, coeff m p * + have h_eval : (fun a => ∑ m ∈ S1, p.coeff m * eval a.1 (monomial (m_left m) (1 : F)) * eval b.1 (monomial (m_right m) (1 : F))) = evalMapRestricted A s ⟨P, hP⟩ := by ext a @@ -789,7 +789,7 @@ lemma Croot_Lev_Pach_lemma_generalised_1st_part rw [← Matrix.rank_transpose, dim] let W := LinearMap.range (evalMapRestricted A s) have h_rows (a) : (fun b => M2 a b) ∈ LinearMap.range (evalMapRestricted A s) := by - let P := ∑ m ∈ S2, (coeff m p * + let P := ∑ m ∈ S2, (p.coeff m * eval a.1 (monomial (m_left m) (1 : F))) • monomial (m_right m) (1 : F) have hP : P ∈ restrictTotalDegree (Fin d) F s := by apply Submodule.sum_mem @@ -815,7 +815,7 @@ lemma Croot_Lev_Pach_lemma_generalised_1st_part rw [h_dR] at h_deg_m zify at * linarith - have h_eval : (fun b => ∑ m ∈ S2, coeff m p * + have h_eval : (fun b => ∑ m ∈ S2, p.coeff m * eval a.1 (monomial (m_left m) (1 : F)) * eval b.1 (monomial (m_right m) (1 : F))) = evalMapRestricted A s ⟨P, hP⟩ := by ext b diff --git a/LeanPool/BollobasNikiforov/Basic/Graph.lean b/LeanPool/BollobasNikiforov/Basic/Graph.lean index eb65e1bf17..580d9e3429 100644 --- a/LeanPool/BollobasNikiforov/Basic/Graph.lean +++ b/LeanPool/BollobasNikiforov/Basic/Graph.lean @@ -6,7 +6,7 @@ Authors: Shengtong Zhang import Mathlib.Combinatorics.SimpleGraph.Clique import Mathlib.Combinatorics.SimpleGraph.Finite -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic /-! # Elementary clique-number facts diff --git a/LeanPool/BollobasNikiforov/Definition.lean b/LeanPool/BollobasNikiforov/Definition.lean index 9a04c26b19..4b35eb9d6a 100644 --- a/LeanPool/BollobasNikiforov/Definition.lean +++ b/LeanPool/BollobasNikiforov/Definition.lean @@ -4,6 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Shengtong Zhang -/ +import Mathlib.Analysis.Matrix.Spectrum import Mathlib.Combinatorics.SimpleGraph.LapMatrix /-! diff --git a/LeanPool/BollobasNikiforov/M/Elim.lean b/LeanPool/BollobasNikiforov/M/Elim.lean index 4c62c2b71b..92cc5518b8 100644 --- a/LeanPool/BollobasNikiforov/M/Elim.lean +++ b/LeanPool/BollobasNikiforov/M/Elim.lean @@ -11,7 +11,7 @@ import Mathlib.Analysis.Matrix.PosDef import Mathlib.Algebra.BigOperators.Fin import Mathlib.Data.Fin.Tuple.Basic import Mathlib.Data.Fintype.BigOperators -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic import Mathlib.LinearAlgebra.Matrix.Charpoly.Coeff import Mathlib.LinearAlgebra.Matrix.SchurComplement import Mathlib.Logic.Equiv.Fin.Basic @@ -675,7 +675,7 @@ lemma det_smul_row_col {n : Type*} [Fintype n] [DecidableEq n] (of fun i j ↦ u i * v j * A i j) = of fun i j ↦ u i * (v j * A i j) := by ext i j - ring + ring_nf have hcol : (of fun i j ↦ v j * A i j).det = (∏ j, v j) * A.det := det_mul_row v A have hrow : diff --git a/LeanPool/BollobasNikiforov/M/Schur.lean b/LeanPool/BollobasNikiforov/M/Schur.lean index 1b0b4471d7..b35a12bb4a 100644 --- a/LeanPool/BollobasNikiforov/M/Schur.lean +++ b/LeanPool/BollobasNikiforov/M/Schur.lean @@ -794,7 +794,7 @@ lemma configLEE_quad (v : Option (Fin k) → ℝ) : ∑ i, s i * v (some i) ^ 2 + ∑ i, s i * configH t ρ x i * v (some i) ^ 2 := by simp only [configD, mul_add, add_mul, sum_add_distrib, mul_assoc] - ring + ring_nf rw [hD] ring diff --git a/LeanPool/BollobasNikiforov/MS/Basic.lean b/LeanPool/BollobasNikiforov/MS/Basic.lean index f4023af495..2af99624e5 100644 --- a/LeanPool/BollobasNikiforov/MS/Basic.lean +++ b/LeanPool/BollobasNikiforov/MS/Basic.lean @@ -8,7 +8,6 @@ import LeanPool.BollobasNikiforov.Basic.Graph import LeanPool.BollobasNikiforov.Basic.Inner import LeanPool.BollobasNikiforov.CP.Basic import Mathlib.Algebra.Order.BigOperators.Ring.Finset -import Mathlib.Analysis.Convex.StdSimplex import Mathlib.Combinatorics.SimpleGraph.AdjMatrix import Mathlib.Tactic.FieldSimp import Mathlib.Tactic.Linarith @@ -31,6 +30,45 @@ open scoped Matrix variable {V : Type*} [Fintype V] [DecidableEq V] +/-! ### The standard simplex + +Mathlib's set-valued `stdSimplex` was deprecated in favour of the bundled type +`Convexity.StdSimplex`. The Motzkin–Straus argument below perturbs a vector +inside the simplex and compares it against the ambient quadratic form, so it +works with the set of vectors rather than with a bundled carrier. -/ + +/-- The standard simplex in `ι → 𝕜`: the vectors with nonnegative coordinates +summing to `1`. -/ +def stdSimplex (𝕜 : Type*) [AddCommMonoid 𝕜] [PartialOrder 𝕜] [One 𝕜] + (ι : Type*) [Fintype ι] : Set (ι → 𝕜) := + {f | (∀ i, 0 ≤ f i) ∧ ∑ i, f i = 1} + +/-- Each vertex `Pi.single i 1` lies in the standard simplex. -/ +lemma single_mem_stdSimplex {ι : Type*} [Fintype ι] [DecidableEq ι] (i : ι) : + Pi.single i (1 : ℝ) ∈ stdSimplex ℝ ι := by + refine ⟨fun j => ?_, by simp⟩ + rw [Pi.single_apply] + split_ifs <;> norm_num + +/-- Every coordinate of a point of the standard simplex lies in `[0, 1]`. -/ +lemma stdSimplex_subset_Icc (ι : Type*) [Fintype ι] : + stdSimplex ℝ ι ⊆ Set.Icc 0 1 := fun _ hf => + ⟨fun i => hf.1 i, fun i => + (Finset.single_le_sum (fun j _ => hf.1 j) (Finset.mem_univ i)).trans_eq hf.2⟩ + +lemma isClosed_stdSimplex (ι : Type*) [Fintype ι] : IsClosed (stdSimplex ℝ ι) := by + have : stdSimplex ℝ ι = + (⋂ i, {f : ι → ℝ | 0 ≤ f i}) ∩ {f : ι → ℝ | ∑ i, f i = 1} := by + ext f + simp [stdSimplex, Set.mem_iInter] + rw [this] + exact (isClosed_iInter fun i => isClosed_le continuous_const (continuous_apply i)).inter + (isClosed_eq (by fun_prop) continuous_const) + +/-- The standard simplex is compact: it is a closed subset of the unit cube. -/ +lemma isCompact_stdSimplex (ι : Type*) [Fintype ι] : IsCompact (stdSimplex ℝ ι) := + IsCompact.of_isClosed_subset isCompact_Icc (isClosed_stdSimplex ι) (stdSimplex_subset_Icc ι) + /-! ### MS05 — Cauchy–Schwarz on a block of size `k` -/ lemma sum_sq_le_card_mul_sum_sq_finset {ι : Type*} (s : Finset ι) (y : ι → ℝ) : @@ -198,13 +236,13 @@ lemma adjMatrix_quadratic_add_smul_single_sub_single omit [DecidableEq V] in lemma stdSimplex_nonempty [Nonempty V] : (stdSimplex ℝ V).Nonempty := by classical - exact ⟨Pi.single (Classical.arbitrary V) 1, single_mem_stdSimplex ℝ _⟩ + exact ⟨Pi.single (Classical.arbitrary V) 1, single_mem_stdSimplex _⟩ omit [DecidableEq V] in lemma exists_isMaxOn_adjMatrix_quadratic [Nonempty V] : ∃ y, y ∈ stdSimplex ℝ V ∧ IsMaxOn (fun y : V → ℝ => y ⬝ᵥ G.adjMatrix ℝ *ᵥ y) (stdSimplex ℝ V) y := - (isCompact_stdSimplex ℝ V).exists_isMaxOn stdSimplex_nonempty + (isCompact_stdSimplex V).exists_isMaxOn stdSimplex_nonempty continuous_adjMatrix_quadratic.continuousOn omit [DecidableEq V] in diff --git a/LeanPool/BollobasNikiforov/TN/Basic.lean b/LeanPool/BollobasNikiforov/TN/Basic.lean index 5979b25055..d6dceb7298 100644 --- a/LeanPool/BollobasNikiforov/TN/Basic.lean +++ b/LeanPool/BollobasNikiforov/TN/Basic.lean @@ -6,7 +6,7 @@ Authors: Shengtong Zhang import Mathlib.Algebra.BigOperators.Fin import Mathlib.Data.Finset.Sort -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic import Mathlib.LinearAlgebra.Matrix.Determinant.Basic import Mathlib.LinearAlgebra.Matrix.Rank import Mathlib.Order.Fin.Basic diff --git a/LeanPool/BollobasNikiforov/TN/Truncated.lean b/LeanPool/BollobasNikiforov/TN/Truncated.lean index ed90cb6c08..b45849a890 100644 --- a/LeanPool/BollobasNikiforov/TN/Truncated.lean +++ b/LeanPool/BollobasNikiforov/TN/Truncated.lean @@ -14,7 +14,7 @@ import Mathlib.Data.Fintype.Perm import Mathlib.Data.Fintype.Sort import Mathlib.Data.Matrix.Basic import Mathlib.Data.Matrix.Block -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic import Mathlib.LinearAlgebra.Matrix.Determinant.Basic import Mathlib.LinearAlgebra.Matrix.Rank import Mathlib.Logic.Equiv.Fin.Basic @@ -819,7 +819,7 @@ lemma injRearrange_comp {k m : ℕ} (S : StrictMonoFin k m) (π : Equiv.Perm (Fi injRearrange (S.2.injective.comp π.injective) = S := by have hu : Function.Injective (S.1 ∘ π) := S.2.injective.comp π.injective apply Subtype.ext - refine (StrictMono.range_inj (injRearrange hu).2 S.2).1 ?_ + refine (StrictMono.range_inj_of_wellFoundedLT (injRearrange hu).2 S.2).1 ?_ have h1 : Set.range (injRearrange hu).1 = ((univ.image (S.1 ∘ π) : Finset _) : Set _) := by simp only [injRearrange] exact range_orderEmbOfFin _ _ diff --git a/LeanPool/BrauerGroupNew/AlgClosedUnion.lean b/LeanPool/BrauerGroupNew/AlgClosedUnion.lean index 719fbf431a..1801c9af85 100644 --- a/LeanPool/BrauerGroupNew/AlgClosedUnion.lean +++ b/LeanPool/BrauerGroupNew/AlgClosedUnion.lean @@ -48,8 +48,7 @@ def intermediateTensor' (L : IntermediateField K K_bar) : Submodule L (K_bar ⊗ LinearMap.range ({LinearMap.rTensor _ (L.val.toLinearMap) with map_smul' l x := by simp only [AddHom.toFun_eq_coe, LinearMap.coe_toAddHom, RingHom.id_apply] - induction x using TensorProduct.induction_on with - | zero => simp + induction x using TensorProduct.inductionOn with | tmul x a => simp only [smul_tmul', smul_eq_mul, LinearMap.rTensor_tmul, AlgHom.toLinearMap_apply, _root_.map_mul, IntermediateField.coe_val]; rfl @@ -83,11 +82,7 @@ def intermediateTensorEquiv' (L : IntermediateField K K_bar) : map_smul' := by rintro x ⟨-, ⟨y, rfl⟩⟩ simp only [RingHom.id_apply] - induction y using TensorProduct.induction_on with - | zero => - simp only [map_zero, SetLike.mk_smul_mk, smul_zero] - erw [map_zero] - rw [smul_zero] + induction y using TensorProduct.inductionOn with | tmul y a => change (intermediateTensorEquiv K K_bar A L) ⟨↑(x * y) ⊗ₜ[K] a, _⟩ = x • (intermediateTensorEquiv K K_bar A L) ⟨↑y ⊗ₜ[K] a, _⟩ @@ -151,8 +146,7 @@ theorem inter_tensor_union : (intermediateTensor K K_bar A L) = ⊤ := by rw [eq_top_iff] rintro x - - induction x using TensorProduct.induction_on with - |zero => simp + induction x using TensorProduct.inductionOn with |tmul x a => have fin0: FiniteDimensional K K⟮x⟯ := IntermediateField.adjoin.finiteDimensional (by observe : IsAlgebraic K x diff --git a/LeanPool/BrauerGroupNew/Azumaya/Basic.lean b/LeanPool/BrauerGroupNew/Azumaya/Basic.lean index a36c1c39ea..d7bb1bb5ae 100644 --- a/LeanPool/BrauerGroupNew/Azumaya/Basic.lean +++ b/LeanPool/BrauerGroupNew/Azumaya/Basic.lean @@ -45,8 +45,7 @@ lemma IsCentral.left_of_tensor (B C : Type*) obtain ⟨b, hb0, hb⟩ := hx rw [Subalgebra.mem_center_iff] at hb0 ⊢ intro bc - induction bc using TensorProduct.induction_on with - | zero => simp + induction bc using TensorProduct.inductionOn with | tmul b' c => subst hb simp only [Algebra.TensorProduct.tmul_mul_tmul, mul_one, one_mul] diff --git a/LeanPool/BrauerGroupNew/Azumaya/Mul.lean b/LeanPool/BrauerGroupNew/Azumaya/Mul.lean index 73a2c7fa62..9d0231c591 100644 --- a/LeanPool/BrauerGroupNew/Azumaya/Mul.lean +++ b/LeanPool/BrauerGroupNew/Azumaya/Mul.lean @@ -366,8 +366,7 @@ lemma small_comm_square (e : A ≃ₐ[R] B) : (e.toLinearEquiv.conjAlgEquiv R).toAlgHom.comp (AlgHom.mulLeftRight R A) := by apply AlgHom.ext intro a - induction a using TensorProduct.induction_on with - | zero => simp + induction a using TensorProduct.inductionOn with | tmul a a' => ext simp [AlgHom.mulLeftRight_apply, LinearEquiv.conjAlgEquiv] diff --git a/LeanPool/BrauerGroupNew/BrauerGroup.lean b/LeanPool/BrauerGroupNew/BrauerGroup.lean index 48aef2972f..691132fc6a 100644 --- a/LeanPool/BrauerGroupNew/BrauerGroup.lean +++ b/LeanPool/BrauerGroupNew/BrauerGroup.lean @@ -515,27 +515,19 @@ def baseChangeTensorEquiv : apply LinearMap.map_mul_of_map_mul_tmul intro x1 x2 y1 y2 change f ((x1 * x2) ⊗ₜ[E] (y1 * y2)) = f (x1 ⊗ₜ[E] y1) * f (x2 ⊗ₜ[E] y2) - induction x1 using TensorProduct.induction_on with - | zero => - simp only [zero_mul, TensorProduct.zero_tmul, f.map_zero] + induction x1 using TensorProduct.inductionOn with | add x1 x1' hx hx' => simp only [add_mul, TensorProduct.add_tmul, f.map_add, hx, hx', add_mul] | tmul e1 a1 => - induction x2 using TensorProduct.induction_on with - | zero => - simp only [mul_zero, TensorProduct.zero_tmul, f.map_zero] + induction x2 using TensorProduct.inductionOn with | add x2 x2' hx hx' => simp only [mul_add, TensorProduct.add_tmul, f.map_add, hx, hx', mul_add] | tmul e2 a2 => - induction y1 using TensorProduct.induction_on with - | zero => - simp only [zero_mul, TensorProduct.tmul_zero, f.map_zero] + induction y1 using TensorProduct.inductionOn with | add y1 y1' hy hy' => simp only [add_mul, TensorProduct.tmul_add, f.map_add, hy, hy', add_mul] | tmul e3 b1 => - induction y2 using TensorProduct.induction_on with - | zero => - simp only [mul_zero, TensorProduct.tmul_zero, f.map_zero] + induction y2 using TensorProduct.inductionOn with | add y2 y2' hy hy' => simp only [mul_add, TensorProduct.tmul_add, f.map_add, hy, hy', mul_add] | tmul e4 b2 => @@ -561,12 +553,10 @@ lemma e3Aux3 (hm : m = 0) : exact ⟨fun a b => by rw [this a, this b]⟩ subst hm intro x - induction x using TensorProduct.induction_on with - | zero => rfl + induction x using TensorProduct.inductionOn with | add e a he ha => rw [he, ha, zero_add] | tmul e a => - induction a using TensorProduct.induction_on with - | zero => simp + induction a using TensorProduct.inductionOn with | add _ _ hx hy => rw [TensorProduct.tmul_add, hx, hy, add_zero] | tmul e' mat => rw [show mat = 0 from Subsingleton.elim _ _] @@ -681,13 +671,11 @@ def e6Aux0 : (E ⊗[K] A) ⊗[E] (E ⊗[K] B) →ₐ[E] E ⊗[K] (A ⊗[K] B) := fun e b => (commute_iff_eq _ _).2 <| show (_ ⊗ₜ _) * (_ ⊗ₜ _) = (_ ⊗ₜ _) * (_ ⊗ₜ _) by simp) fun x y => (commute_iff_eq _ _).2 <| show _ = _ by - induction x using TensorProduct.induction_on with - | zero => simp only [map_zero, zero_mul, mul_zero] + induction x using TensorProduct.inductionOn with | add x x' hx hx' => simp only [map_add, mul_add, hx, hx', add_mul] | tmul e a => simp only [Algebra.TensorProduct.lift_tmul, AlgHom.coe_mk, RingHom.coe_mk] - induction y using TensorProduct.induction_on with - | zero => simp only [map_zero, mul_zero, zero_mul] + induction y using TensorProduct.inductionOn with | add y y' hy hy' => simp only [map_add, mul_add, hy, hy', add_mul] | tmul e' b => simp only [Algebra.TensorProduct.lift_tmul, AlgHom.coe_mk, RingHom.coe_mk] @@ -781,12 +769,10 @@ def Aux' (F K E : Type u) [Field F] [Field K] [Field E] Algebra.smul_def, Algebra.smul_def, _root_.mul_assoc] } refine .ofLinearEquiv (Aux F K E A) ?_ fun x y ↦ ?_ · simp [Algebra.TensorProduct.one_def] - induction x using TensorProduct.induction_on with - | zero => rw [zero_mul, (baseChangeIdem.Aux F K E A).map_zero, zero_mul] + induction x using TensorProduct.inductionOn with | add => simp only [add_mul, (Aux F K E A).map_add, *] | tmul => - induction y using TensorProduct.induction_on with - | zero => rw [mul_zero, (baseChangeIdem.Aux F K E A).map_zero, mul_zero] + induction y using TensorProduct.inductionOn with | add => simp only [mul_add, (Aux F K E A).map_add, *] | tmul => rename_i x1 y1 x2 y2 @@ -795,16 +781,10 @@ def Aux' (F K E : Type u) [Field F] [Field K] [Field E] (TensorProduct.AlgebraTensorModule.rid K E E) (LinearEquiv.refl F A)) set g := (TensorProduct.AlgebraTensorModule.assoc F K E E K A.carrier).symm change f (g _) = _ - induction y1 using TensorProduct.induction_on with - | zero => - rw [zero_mul, TensorProduct.tmul_zero, g.map_zero, f.map_zero, TensorProduct.tmul_zero, - g.map_zero, f.map_zero, zero_mul] + induction y1 using TensorProduct.inductionOn with | add => simp only [add_mul, TensorProduct.tmul_add, g.map_add, f.map_add, *] | tmul k1 a1 => - induction y2 using TensorProduct.induction_on with - | zero => - rw [mul_zero, TensorProduct.tmul_zero, TensorProduct.tmul_zero, g.map_zero, f.map_zero, - mul_zero] + induction y2 using TensorProduct.inductionOn with | add => simp only [mul_add, TensorProduct.tmul_add, g.map_add, f.map_add, *] | tmul k2 a2 => simp only [Algebra.TensorProduct.tmul_mul_tmul, *] diff --git a/LeanPool/BrauerGroupNew/BrauerOverR.lean b/LeanPool/BrauerGroupNew/BrauerOverR.lean index 7920786a69..0a375d6494 100644 --- a/LeanPool/BrauerGroupNew/BrauerOverR.lean +++ b/LeanPool/BrauerGroupNew/BrauerOverR.lean @@ -38,17 +38,9 @@ abbrev toEndMap : ℍ[ℝ] ⊗[ℝ] ℍ[ℝ] →ₗ[ℝ] Module.End ℝ (ℍ[ℝ lemma toEndMap.map_mul (x1 x2 : ℍ[ℝ] ⊗[ℝ] ℍ[ℝ]) : toEndMap (x1 * x2) = toEndMap x1 * toEndMap x2 := by - induction x1 using TensorProduct.induction_on with - | zero => - have e : (0 : ℍ[ℝ] ⊗[ℝ] ℍ[ℝ]) * x2 = 0 := by - exact (inferInstance : MulZeroClass (ℍ[ℝ] ⊗[ℝ] ℍ[ℝ])).zero_mul _ - rw [e, map_zero, zero_mul] + induction x1 using TensorProduct.inductionOn with | tmul q1 q2 => - induction x2 using TensorProduct.induction_on with - | zero => - have e : (q1 ⊗ₜ[ℝ] q2 : ℍ[ℝ] ⊗[ℝ] ℍ[ℝ]) * 0 = 0 := by - exact (inferInstance : MulZeroClass (ℍ[ℝ] ⊗[ℝ] ℍ[ℝ])).mul_zero _ - rw [e, map_zero, mul_zero] + induction x2 using TensorProduct.inductionOn with | tmul q3 q4 => ext : 1; simp [← _root_.mul_assoc] | add x y h1 h2 => have e : (q1 ⊗ₜ[ℝ] q2 : ℍ[ℝ] ⊗[ℝ] ℍ[ℝ]) * (x + y) = @@ -82,24 +74,10 @@ instance : Algebra.IsCentral ℝ ℍ[ℝ] := ⟨fun q hq ↦ by obtain ⟨_, _, eq13, eq14⟩ := eq1 obtain ⟨_, eq22, _, eq24⟩ := eq2 obtain ⟨_, eq32, eq33, _⟩ := eq3 - have hI : q.imI = 0 := by - have hleft := Quaternion.imJ_mul (⟨0, 0, 0, 1⟩ : ℍ[ℝ]) q - have hright := Quaternion.imJ_mul q (⟨0, 0, 0, 1⟩ : ℍ[ℝ]) - norm_num at hleft hright - have hx : q.imI = -q.imI := hleft.symm.trans (eq33.trans hright) - linarith - have hJ : q.imJ = 0 := by - have hleft := Quaternion.imK_mul (⟨0, 1, 0, 0⟩ : ℍ[ℝ]) q - have hright := Quaternion.imK_mul q (⟨0, 1, 0, 0⟩ : ℍ[ℝ]) - norm_num at hleft hright - have hx : q.imJ = -q.imJ := hleft.symm.trans (eq14.trans hright) - linarith - have hK : q.imK = 0 := by - have hleft := Quaternion.imJ_mul (⟨0, 1, 0, 0⟩ : ℍ[ℝ]) q - have hright := Quaternion.imJ_mul q (⟨0, 1, 0, 0⟩ : ℍ[ℝ]) - norm_num at hleft hright - have hx : -q.imK = q.imK := hleft.symm.trans (eq13.trans hright) - linarith + norm_num at eq13 eq14 eq33 + have hI : q.imI = 0 := by linarith + have hJ : q.imJ = 0 := by linarith + have hK : q.imK = 0 := by linarith change (⟨q.re, 0, 0, 0⟩ : ℍ[ℝ]) = q ext <;> simp [hI, hJ, hK]⟩ diff --git a/LeanPool/BrauerGroupNew/CentralSimple.lean b/LeanPool/BrauerGroupNew/CentralSimple.lean index d3c0224e12..53d65b14db 100644 --- a/LeanPool/BrauerGroupNew/CentralSimple.lean +++ b/LeanPool/BrauerGroupNew/CentralSimple.lean @@ -84,8 +84,7 @@ lemma _root_.IsCentralSimple.TensorProduct.left_tensor_base_sup_base_tensor_righ (Algebra.TensorProduct.map (Algebra.ofId K B) (AlgHom.id K C)).range = ⊤ := by rw [eq_top_iff] rintro x - - induction x using TensorProduct.induction_on with - | zero => exact Subalgebra.zero_mem _ + induction x using TensorProduct.inductionOn with | tmul b c => rw [show b ⊗ₜ[K] c = b ⊗ₜ[K] 1 * 1 ⊗ₜ[K] c by simp] exact Algebra.mul_mem_sup ⟨b ⊗ₜ 1, by simp⟩ ⟨1 ⊗ₜ c, by simp⟩ @@ -245,8 +244,7 @@ instance _root_.IsCentralSimple.TensorProduct.isCentral constructor intro _ H obtain ⟨x, rfl⟩ := le_of_eq (center_tensorProduct K A B) H; clear H - induction x using TensorProduct.induction_on with - | zero => exact ⟨0, by simp⟩ + induction x using TensorProduct.inductionOn with | tmul a b => obtain ⟨a', ha⟩ := isCentral_A.1 a.2 obtain ⟨b', hb⟩ := isCentral_B.1 b.2 @@ -461,8 +459,7 @@ lemma _root_.IsCentralSimple.TensorProduct.map_comap_le_span_of_isSimple_isCentr rw [hI, TwoSidedIdeal.coe_top_set, TwoSidedIdeal.le_iff] rintro x - rw [SetLike.mem_coe] - induction x using TensorProduct.induction_on with - | zero => simp + induction x using TensorProduct.inductionOn with | tmul a b => rw [show a ⊗ₜ[K] b = (a ⊗ₜ 1) * (1 ⊗ₜ b) by simp] exact TwoSidedIdeal.mul_mem_right _ _ _ <| TwoSidedIdeal.subset_span ⟨a, ⟨⟩, rfl⟩ @@ -509,8 +506,7 @@ instance _root_.IsCentralSimple.TensorProduct.simple rw [eq1, eq_top_iff, TwoSidedIdeal.le_iff] rintro x - rw [SetLike.mem_coe] - induction x using TensorProduct.induction_on with - | zero => simp + induction x using TensorProduct.inductionOn with | tmul a b => rw [show a ⊗ₜ[K] b = (a ⊗ₜ 1) * (1 ⊗ₜ b) by simp] exact TwoSidedIdeal.mul_mem_right _ _ _ <| TwoSidedIdeal.subset_span ⟨a, ⟨⟩, rfl⟩ @@ -527,8 +523,7 @@ instance baseChange out:= by intro _ H obtain ⟨x, rfl⟩ := le_of_eq (center_tensorProduct K L D) H; clear H - induction x using TensorProduct.induction_on with - | zero => exact ⟨0, by simp⟩ + induction x using TensorProduct.inductionOn with | tmul l d => obtain ⟨k, hk⟩ := h.out d.2 refine ⟨k • l, ?_⟩ diff --git a/LeanPool/BrauerGroupNew/Centralizer.lean b/LeanPool/BrauerGroupNew/Centralizer.lean index 4e346da4bc..fadb5bb5f2 100644 --- a/LeanPool/BrauerGroupNew/Centralizer.lean +++ b/LeanPool/BrauerGroupNew/Centralizer.lean @@ -93,8 +93,7 @@ lemma _root_.Subalgebra.centralizer_range_includeLeft_eq_center_tensorProduct [M · rintro ⟨w, rfl⟩ rw [Subalgebra.mem_centralizer_iff] rintro _ ⟨x, rfl⟩ - induction w using TensorProduct.induction_on with - | zero => simp + induction w using TensorProduct.inductionOn with | tmul b c => simp only [AlgHom.toRingHom_eq_coe, RingHom.coe_coe, Algebra.TensorProduct.includeLeft_apply, Algebra.TensorProduct.map_tmul, coe_val, AlgHom.coe_id, id_eq, diff --git a/LeanPool/BrauerGroupNew/DoubleCentralizer.lean b/LeanPool/BrauerGroupNew/DoubleCentralizer.lean index f5b499c10f..04ecac1f7e 100644 --- a/LeanPool/BrauerGroupNew/DoubleCentralizer.lean +++ b/LeanPool/BrauerGroupNew/DoubleCentralizer.lean @@ -58,8 +58,7 @@ lemma centralizer_inclusionLeft : rw [sub_eq_zero] at this exact this · rintro _ ⟨x, rfl⟩ _ ⟨y, rfl⟩ - induction x using TensorProduct.induction_on with - | zero => simp + induction x using TensorProduct.inductionOn with | tmul a b => simp only [AlgHom.toRingHom_eq_coe, RingHom.coe_coe, AlgHom.coe_comp, Subalgebra.coe_val, Function.comp_apply, Algebra.TensorProduct.includeLeft_apply, @@ -95,8 +94,7 @@ lemma centralizer_inclusionRight : rw [sub_eq_zero] at this exact this · rintro _ ⟨x, rfl⟩ _ ⟨y, rfl⟩ - induction x using TensorProduct.induction_on with - | zero => simp + induction x using TensorProduct.inductionOn with | tmul a b => simp only [AlgHom.toRingHom_eq_coe, RingHom.coe_coe, AlgHom.coe_comp, Subalgebra.coe_val, Function.comp_apply, Algebra.TensorProduct.includeRight_apply, @@ -168,15 +166,13 @@ lemma centralizer_tensor_centralizer : exact this rwa [← this] · rintro _ ⟨x, rfl⟩ - induction x using TensorProduct.induction_on with - | zero => exact Subalgebra.zero_mem _ + induction x using TensorProduct.inductionOn with | tmul a b => simp only [AlgHom.coe_range, AlgHom.toRingHom_eq_coe, RingHom.coe_coe, Algebra.TensorProduct.map_tmul, Subalgebra.coe_val, Subalgebra.mem_centralizer_iff, Set.mem_range, forall_exists_index, forall_apply_eq_imp_iff] intro x - induction x using TensorProduct.induction_on with - | zero => simp + induction x using TensorProduct.inductionOn with | tmul x y => simp only [Algebra.TensorProduct.map_tmul, Subalgebra.coe_val, Algebra.TensorProduct.tmul_mul_tmul] diff --git a/LeanPool/BrauerGroupNew/ExtendScalar.lean b/LeanPool/BrauerGroupNew/ExtendScalar.lean index fb076fff9d..284faf8469 100644 --- a/LeanPool/BrauerGroupNew/ExtendScalar.lean +++ b/LeanPool/BrauerGroupNew/ExtendScalar.lean @@ -40,11 +40,9 @@ def release : L ⊗[k] A →ₐ[L] L ⊗[K] (K ⊗[k] A) where AddMonoidHom.toZeroHom_coe, TensorProduct.liftAddHom_tmul, AddMonoidHom.coe_mk, ZeroHom.coe_mk] map_mul' x y := by - induction x using TensorProduct.induction_on with - | zero => simp only [zero_mul, ZeroHom.toFun_eq_coe, map_zero, AddMonoidHom.toZeroHom_coe] + induction x using TensorProduct.inductionOn with | tmul l a => - induction y using TensorProduct.induction_on with - | zero => simp only [mul_zero, ZeroHom.toFun_eq_coe, map_zero, AddMonoidHom.toZeroHom_coe] + induction y using TensorProduct.inductionOn with | tmul l' a' => simp only [Algebra.TensorProduct.tmul_mul_tmul, ZeroHom.toFun_eq_coe, AddMonoidHom.toZeroHom_coe] @@ -81,8 +79,7 @@ def absorbAddHom : L ⊗[K] (K ⊗[k] A) →+ L ⊗[k] A := toFun l := absorbMap k K L A l map_zero' := by ext x - induction x using TensorProduct.induction_on with - | zero => simp only [map_zero] + induction x using TensorProduct.inductionOn with | tmul x a => change (x • 0) ⊗ₜ a = 0 simp only [smul_zero, TensorProduct.zero_tmul] @@ -90,8 +87,7 @@ def absorbAddHom : L ⊗[K] (K ⊗[k] A) →+ L ⊗[k] A := simp_all only [AddMonoidHom.zero_apply, map_add, add_zero] map_add' := fun x y ↦ by ext z - induction z using TensorProduct.induction_on with - | zero => simp only [map_zero] + induction z using TensorProduct.inductionOn with | tmul m a => change (m • (x + y)) ⊗ₜ a = (m • x) ⊗ₜ a + (m • y) ⊗ₜ a simp only [smul_add, TensorProduct.add_tmul] @@ -99,8 +95,7 @@ def absorbAddHom : L ⊗[K] (K ⊗[k] A) →+ L ⊗[k] A := simp only [AddMonoidHom.add_apply] at hz hw simp only [map_add, AddMonoidHom.add_apply, hz, hw] } (fun r l a ↦ by - induction a using TensorProduct.induction_on with - | zero => simp only [AddMonoidHom.coe_mk, ZeroHom.coe_mk, map_zero, smul_zero] + induction a using TensorProduct.inductionOn with | tmul m a => simp only [AddMonoidHom.coe_mk, ZeroHom.coe_mk, TensorProduct.smul_tmul'] change (m • (r • l)) ⊗ₜ a = ((r • m) • l) ⊗ₜ a @@ -118,21 +113,17 @@ def absorb : L ⊗[K] (K ⊗[k] A) →ₐ[L] L ⊗[k] A where rw [one_smul] map_mul' := fun x y ↦ by simp only [ZeroHom.toFun_eq_coe, AddMonoidHom.toZeroHom_coe] - induction x using TensorProduct.induction_on with - | zero => simp only [zero_mul, map_zero] + induction x using TensorProduct.inductionOn with | add x' y' hx hy => simp only [add_mul, map_add, hx, hy] | tmul l ka => - induction y using TensorProduct.induction_on with - | zero => simp only [mul_zero, map_zero] + induction y using TensorProduct.inductionOn with | add x y hx hy => simp only [mul_add, map_add, hx, hy] | tmul l' ka' => simp only [Algebra.TensorProduct.tmul_mul_tmul] - induction ka' using TensorProduct.induction_on with - | zero => simp only [mul_zero, TensorProduct.tmul_zero, map_zero] + induction ka' using TensorProduct.inductionOn with | add x y hx hy => simp only [mul_add, TensorProduct.tmul_add, map_add, hx, hy] | tmul k' a => - induction ka using TensorProduct.induction_on with - | zero => simp only [zero_mul, TensorProduct.tmul_zero, map_zero] + induction ka using TensorProduct.inductionOn with | add x y hx hy => simp only [add_mul, TensorProduct.tmul_add, map_add, hx, hy] | tmul k1 a1 => simp only [Algebra.TensorProduct.tmul_mul_tmul] @@ -151,8 +142,7 @@ def absorbEqv : L ⊗[k] A ≃ₐ[L] L ⊗[K] (K ⊗[k] A) where toFun := release k K L A invFun := absorb k K L A left_inv := fun x ↦ by - induction x using TensorProduct.induction_on with - | zero => simp only [map_zero] + induction x using TensorProduct.inductionOn with | tmul l a => change (absorb k K L A) (l ⊗ₜ[K] (1 ⊗ₜ a)) = _ change (1 • l) ⊗ₜ _ = _ @@ -160,11 +150,9 @@ def absorbEqv : L ⊗[k] A ≃ₐ[L] L ⊗[K] (K ⊗[k] A) where | add x y hx hy => simp only [map_add, hx, hy] right_inv := fun x ↦ by - induction x using TensorProduct.induction_on with - | zero => simp only [map_zero] + induction x using TensorProduct.inductionOn with | tmul l ka => - induction ka using TensorProduct.induction_on with - | zero => simp only [TensorProduct.tmul_zero, map_zero] + induction ka using TensorProduct.inductionOn with | tmul k' a => change (release k K L A) ((k' • l) ⊗ₜ a) = _ change (k' • l) ⊗ₜ[K] (1 ⊗ₜ a) = _ diff --git a/LeanPool/BrauerGroupNew/IsoSecond.lean b/LeanPool/BrauerGroupNew/IsoSecond.lean index b4b3982fd3..f783bfc6e0 100644 --- a/LeanPool/BrauerGroupNew/IsoSecond.lean +++ b/LeanPool/BrauerGroupNew/IsoSecond.lean @@ -138,14 +138,12 @@ instance : MulAction (A ⊗[F] B)ᵐᵒᵖ (M α β) where ext a b simp only [AlgebraTensorModule.curry_apply, curry_apply, LinearMap.coe_restrictScalars, LinearMap.coe_comp, Function.comp_apply, Submodule.mkQ_apply] - induction x using TensorProduct.induction_on with + induction x using TensorProduct.inductionOn with | tmul xl rl => - induction y using TensorProduct.induction_on with + induction y using TensorProduct.inductionOn with | tmul yl yr => simp [AoxFBSmulM_op_tmul_smul_mk_tmul, _root_.mul_assoc] | add y y' hy hy' => simp_all [add_mul] - | zero => simp | add x x' hx hx' => simp_all [mul_add] - | zero => simp instance : DistribMulAction (A ⊗[F] B)ᵐᵒᵖ (M α β) where smul_zero x := show AoxFBSmulM _ _ = _ by simp @@ -303,10 +301,7 @@ theorem C_mul_smul' (x y : C) (ab : M α β) : (x * y) • ab = x • y • ab : rw [mul_add, map_add, LinearMap.add_apply, map_add, LinearMap.add_apply, h1, h2, map_add] | single τ k2 => induction ab using Submodule.Quotient.induction_on with | H ab => - induction ab using TensorProduct.induction_on with - | zero => - change CSmul _ _ = CSmul _ (CSmul _ _) - simp + induction ab using TensorProduct.inductionOn with | tmul a b => change CSmul (⟨mulLinearMap _ (.single σ k1) (.single τ k2)⟩ : C) _ = CSmul _ (CSmul _ _) simp only [mulLinearMap_single_single, Pi.mul_apply, Units.val_mul] @@ -333,7 +328,7 @@ instance : MulAction C (M α β) where one_smul x := by induction x using Quotient.inductionOn' with | h x => change (1 : C) • Submodule.Quotient.mk x = Submodule.Quotient.mk x - induction x using TensorProduct.induction_on with + induction x using TensorProduct.inductionOn with | tmul a b => rw [show (1 : C) = ((β (1, 1)).1⁻¹ * (α (1, 1)).1⁻¹) • CrossProductAlgebra.basis 1 by apply val_injective; simp [CrossProductAlgebra.basis], CSmul_calc, mul_smul, @@ -355,8 +350,6 @@ instance : MulAction C (M α β) where simp only [Submodule.Quotient.mk_add] conv_rhs => rw [← hx, ← hy] simp [CSmul_def, map_add] - | zero => - simp [Submodule.Quotient.mk_zero, CSmul_def, map_zero] mul_smul := C_mul_smul' instance : DistribMulAction C (M α β) where @@ -381,9 +374,9 @@ instance : SMulCommClass (A ⊗[F] B)ᵐᵒᵖ C (M α β) where rintro ⟨x⟩ c m induction m using Quotient.inductionOn' with | h m => change op x • c • Submodule.Quotient.mk _ = c • op x • Submodule.Quotient.mk _ - induction x using TensorProduct.induction_on with + induction x using TensorProduct.inductionOn with | tmul a' b' => - induction m using TensorProduct.induction_on with + induction m using TensorProduct.inductionOn with | tmul a b => change _ • (⟨c.val⟩ : C) • _ = (⟨c.val⟩ : C) • _ • Submodule.Quotient.mk _ induction c.val using Finsupp.induction_linear with @@ -394,14 +387,11 @@ instance : SMulCommClass (A ⊗[F] B)ᵐᵒᵖ C (M α β) where rw [← mul_one c, ← smul_eq_mul _ 1, ← Finsupp.smul_single, ← smul_mk, mk_single_one, CSmul_calc, Aox_FB_op_tmul_smul_mk_tmul, Aox_FB_op_tmul_smul_mk_tmul, CSmul_calc, _root_.mul_assoc, _root_.mul_assoc] - | zero => simp | add x y hx hy => simp [Submodule.Quotient.mk_add, @smul_add (A ⊗[F] B)ᵐᵒᵖ (M α β) _ _, @smul_add C (M α β) _ _, hx, hy] | add x y hx hy => simp only [op_add, @add_smul (A ⊗[F] B)ᵐᵒᵖ (M α β) _ _, hx, hy, smul_add] - | zero => - simp [op_zero, zero_smul] /-- The tensor-product action commutes with the cross-product action on `M`. -/ lemma Aox_FB_smul_comm_CSmul (x : (A ⊗[F] B)ᵐᵒᵖ) (c : C) (m : M α β) : @@ -411,8 +401,7 @@ lemma Aox_FB_smul_comm_CSmul (x : (A ⊗[F] B)ᵐᵒᵖ) (c : C) (m : M α β) : open CrossProductAlgebra TensorProduct in instance : IsScalarTower F C (M α β) := .of_algebraMap_smul fun x m ↦ by induction m using Submodule.Quotient.induction_on with | H m => - induction m using TensorProduct.induction_on with - | zero => simp + induction m using TensorProduct.inductionOn with | add x y h1 h2 => rw [Submodule.Quotient.mk_add, smul_add, h1, h2, smul_add] | tmul a b => @@ -481,15 +470,13 @@ noncomputable def φ0 : simp only [MulOpposite.algebraMap_apply, Algebra.TensorProduct.algebraMap_apply, LinearMap.coe_mk, AddHom.coe_mk, Module.algebraMap_end_apply] induction m using Submodule.Quotient.induction_on with | H m => - induction m using TensorProduct.induction_on with + induction m using TensorProduct.inductionOn with | tmul a b => erw [Aox_FB_op_tmul_smul_mk_tmul] rw [_root_.mul_one, ← Algebra.commutes, ← Algebra.smul_def, ← smul_tmul', Submodule.Quotient.mk_smul] | add x y hx hy => simpa using congr($hx + $hy) - | zero => - erw [smul_zero] open TensorProduct @@ -528,7 +515,7 @@ def AoxKBToM : A ⊗[K] B →ₗ[F] M α β where __ := AoxKBToMAux map_smul' := by intro f x - induction x using TensorProduct.induction_on with + induction x using TensorProduct.inductionOn with | tmul a b => simp only [AoxKBToMAux, smul_tmul', ZeroHom.toFun_eq_coe, AddMonoidHom.toZeroHom_coe, liftAddHom_tmul, AddMonoidHom.coe_mk, ZeroHom.coe_mk, RingHom.id_apply] @@ -537,15 +524,12 @@ def AoxKBToM : A ⊗[K] B →ₗ[F] M α β where simp only [ZeroHom.toFun_eq_coe, AddMonoidHom.toZeroHom_coe, RingHom.id_apply, smul_add, map_add] at hx hy ⊢ simp only [hx, hy] - | zero => - simp only [smul_zero, ZeroHom.toFun_eq_coe, map_zero, - RingHom.id_apply] /-- The balanced quotient is linearly equivalent to the tensor product over `K`. -/ def AoxKBEquivM : M α β ≃ₗ[F] A ⊗[K] B := .ofLinearMap MtoAoxKB AoxKBToM (by ext x - induction x using TensorProduct.induction_on with + induction x using TensorProduct.inductionOn with | tmul a b => simp only [MtoAoxKB, AoxKBToM, AoxKBToMAux, ZeroHom.toFun_eq_coe, AddMonoidHom.toZeroHom_coe, LinearMap.coe_comp, LinearMap.coe_mk, AddHom.coe_mk, @@ -553,8 +537,7 @@ def AoxKBEquivM : M α β ≃ₗ[F] A ⊗[K] B := .ofLinearMap MtoAoxKB AoxKBToM Submodule.liftQ_apply, lift.tmul, LinearMap.id_coe, id_eq] | add x y hx hy => simp only [LinearMap.coe_comp, Function.comp_apply, LinearMap.id_coe, id_eq] at hx hy - simp only [LinearMap.coe_comp, Function.comp_apply, map_add, hx, hy, LinearMap.id_coe, id_eq] - | zero => simp) + simp only [LinearMap.coe_comp, Function.comp_apply, map_add, hx, hy, LinearMap.id_coe, id_eq]) (by ext a b simp only [AoxKBToM, AoxKBToMAux, ZeroHom.toFun_eq_coe, AddMonoidHom.toZeroHom_coe, diff --git a/LeanPool/BrauerGroupNew/MatrixEquivTensor.lean b/LeanPool/BrauerGroupNew/MatrixEquivTensor.lean index f7b600228f..8abd08f32c 100644 --- a/LeanPool/BrauerGroupNew/MatrixEquivTensor.lean +++ b/LeanPool/BrauerGroupNew/MatrixEquivTensor.lean @@ -44,7 +44,6 @@ abbrev toTensorMatrixToFunKlinear : K ⊗[F] Matrix n n A →ₗ[K] Matrix n n ( {__ := toTensorMatrixToFunFlinear K F A n, map_smul' k tensor := by induction tensor with - | zero => simp | tmul k0 M => simp [TensorProduct.smul_tmul', SemigroupAction.mul_smul] | add _ _ h1 h2 => simp_all} @@ -58,10 +57,8 @@ abbrev toTensorMatrix : K ⊗[F] Matrix n n A →ₐ[K] Matrix n n (K ⊗[F] A) exact Matrix.map_one _ (map_zero _) (map_one _)) fun t1 t2 ↦ by induction t1 with - | zero => simp | tmul x y => induction t2 with - | zero => simp | tmul x0 y0 => simp [mul_comm x x0, SemigroupAction.mul_smul, Matrix.map_mul] | add _ _ h1 h2 => simp_all [mul_add] @@ -93,7 +90,6 @@ abbrev invFunKlinear (i j : n) : K ⊗[F] A →ₗ[K] K ⊗[F] Matrix n n A := {__ := invFunToFun K F A n i j, map_smul' k tensor := by induction tensor with - | zero => simp | tmul k0 a => simp [smul_tmul'] | add _ _ h1 h2 => simp_all} @@ -106,7 +102,6 @@ abbrev invFunLinearMap : Matrix n n (K ⊗[F] A) →ₗ[K] K ⊗[F] Matrix n n A lemma matrixTensor_left_inv (M : K ⊗[F] Matrix n n A) : invFunLinearMap K F A n (toTensorMatrix K F A n M) = M := by induction M with - | zero => simp | tmul k M => simp [← tmul_sum, smul_tmul', Fintype.sum_prod_type, ← matrix_eq_sum_single] | add koxa1 koxa2 h1 h2 => rw [map_add, map_add, h1, h2] @@ -118,7 +113,6 @@ lemma matrixTensor_right_inv (M : Matrix n n (K ⊗[F] A)) : conv_rhs => rw [matrix_eq_sum_single M] refine Finset.sum_congr rfl fun p _ => Finset.sum_congr rfl fun q _ => ?_ induction M p q with - | zero => simp | tmul x y => simp [smul_tmul'] | add _ _ h1 h2 => simp [single_add, h1, h2] diff --git a/LeanPool/BrauerGroupNew/Morita/TensorProduct.lean b/LeanPool/BrauerGroupNew/Morita/TensorProduct.lean index 3e037ad5a8..f187b9c35f 100644 --- a/LeanPool/BrauerGroupNew/Morita/TensorProduct.lean +++ b/LeanPool/BrauerGroupNew/Morita/TensorProduct.lean @@ -258,8 +258,7 @@ abbrev toModuleOverTensor : TensorModule R A C ⥤ ModuleCat (A ⊗[R] C) where map {M N} f := ModuleCat.ofHom { __ := f.hom.hom map_smul' ac m := by - induction ac using TensorProduct.induction_on with - | zero => simp + induction ac using TensorProduct.inductionOn with | tmul a c => simp [moduleAux_apply, TensorModule.commutes_apply] | add _ _ _ _ => simp_all [add_smul] } @@ -322,10 +321,7 @@ abbrev e02 (M : ModuleCat (A ⊗[R] C)) : · have key : ∀ (ac : A ⊗[R] C) (m : M), (moduleAux R A C ((fromModuleOverTensor R A C).obj M) ac) m = ac • m := by intro ac m - induction ac using TensorProduct.induction_on with - | zero => - rw [map_zero] - exact (zero_smul _ m).symm + induction ac using TensorProduct.inductionOn with | tmul a c => refine (moduleAux_apply R A C ((fromModuleOverTensor R A C).obj M) a c m).trans ?_ change (a ⊗ₜ[R] (1 : C)) • (((1 : A) ⊗ₜ[R] c) • m) = (a ⊗ₜ[R] c) • m diff --git a/LeanPool/BrauerGroupNew/SkolemNoether.lean b/LeanPool/BrauerGroupNew/SkolemNoether.lean index 65c180941f..2bb3ffe5b8 100644 --- a/LeanPool/BrauerGroupNew/SkolemNoether.lean +++ b/LeanPool/BrauerGroupNew/SkolemNoether.lean @@ -87,10 +87,7 @@ def smul1 (K A B M : Type u) __ := smul1AddHom K A B M f m map_smul' := fun k b ↦ by simp only [smul1AddHom, ZeroHom.toFun_eq_coe, AddMonoidHom.toZeroHom_coe, RingHom.id_apply] - induction b using TensorProduct.induction_on - · rw [smul_zero, map_zero] - have h : algebraMap K A k • (0 : M) = 0 := smul_zero _ - exact h.symm + induction b using TensorProduct.inductionOn · rename_i b l rw [TensorProduct.smul_tmul', TensorProduct.liftAddHom_tmul, TensorProduct.liftAddHom_tmul] @@ -126,8 +123,7 @@ lemma smul1_zero_left (K A B M : Type u) [Field K] [Ring A] [Algebra K A] [Ring B] [Algebra K B] [AddCommGroup M] [Module K M] [Module A M] [IsScalarTower K A M] (f : B →ₐ[K] A) (r : B ⊗[K] Module.End A M) : smul1 K A B M f (0 : M) r = 0 := by - induction r using TensorProduct.induction_on with - | zero => rw [map_zero] + induction r using TensorProduct.inductionOn with | tmul b l => rw [smul1_tmul, map_zero, smul_zero] rfl @@ -140,8 +136,7 @@ lemma smul1_add (K A B M : Type u) smul1 K A B M f (m1 + m2) r = smul1 K A B M f m1 r + smul1 K A B M f m2 r := fun r (m1 m2 : M) ↦ by change smul1 K A B M f ((m1 : M) + m2) r = smul1 K A B M f m1 r + smul1 K A B M f m2 r - induction r using TensorProduct.induction_on with - | zero => rw [map_zero, map_zero, map_zero, add_zero] + induction r using TensorProduct.inductionOn with | tmul b l => rw [smul1_tmul, smul1_tmul, smul1_tmul, map_add, smul_add] rfl @@ -154,13 +149,9 @@ lemma mul_smul1 (K A B M : Type u) [Module K M] [Module A M] [IsScalarTower K A M] (f : B →ₐ[K] A) : ∀ (x y : (B ⊗[K] (Module.End A M))) (m : moduleInst K A B M f), smul1 K A B M f m (x * y) = smul1 K A B M f (smul1 K A B M f m y) x := fun x y (m : M) ↦ by - induction x using TensorProduct.induction_on with - | zero => rw [zero_mul, map_zero, map_zero] + induction x using TensorProduct.inductionOn with | tmul b1 l1 => - induction y using TensorProduct.induction_on with - | zero => - rw [mul_zero, map_zero] - exact (smul1_zero_left K A B M f _).symm + induction y using TensorProduct.inductionOn with | tmul b2 l2 => rw [Algebra.TensorProduct.tmul_mul_tmul, smul1_tmul, smul1_tmul, smul1_tmul, map_mul, Module.End.mul_apply, map_smul, mul_smul] @@ -196,10 +187,6 @@ instance (K A B M : Type u) IsScalarTower K (B ⊗[K] Module.End A M) (moduleInst K A B M f) where smul_assoc a x y := by induction x with - | zero => - -- simp - change smul1 K A B M f _ _ = _ • smul1 K A B M f _ _ - rw [map_zero, smul_zero, smul_zero, map_zero] | tmul b z => change (smul1 K A B M f _ _) = _ • smul1 K A B M f _ _ simp diff --git a/LeanPool/BrauerGroupNew/Subfield/Splitting.lean b/LeanPool/BrauerGroupNew/Subfield/Splitting.lean index 23756816a6..cc6fa09184 100644 --- a/LeanPool/BrauerGroupNew/Subfield/Splitting.lean +++ b/LeanPool/BrauerGroupNew/Subfield/Splitting.lean @@ -261,8 +261,7 @@ theorem isSplit_iff_dimension [FiniteDimensional F K] (A : CSA F) : { __ := μ' map_smul' := by intro r a - induction a using TensorProduct.induction_on with - | zero => simp + induction a using TensorProduct.inductionOn with | tmul c a => ext a' simp only [smul_eq_mul, smul_def, smul_tmul', AddHom.toFun_eq_coe, lift.tmul', @@ -279,11 +278,9 @@ theorem isSplit_iff_dimension [FiniteDimensional F K] (A : CSA F) : (by intro x y ext a'' - induction x using TensorProduct.induction_on with - | zero => simp + induction x using TensorProduct.inductionOn with | tmul c a => - induction y using TensorProduct.induction_on with - | zero => simp + induction y using TensorProduct.inductionOn with | tmul c' a' => simp only [smul_eq_mul, Algebra.TensorProduct.tmul_mul_tmul, mul_comm c c', LinearMap.coe_mk, lift.tmul', AddHom.coe_mk, mul_smul, _root_.mul_assoc, diff --git a/LeanPool/BruhatTits/Graph/GroupAction.lean b/LeanPool/BruhatTits/Graph/GroupAction.lean index 5a68c1b034..a48828f392 100644 --- a/LeanPool/BruhatTits/Graph/GroupAction.lean +++ b/LeanPool/BruhatTits/Graph/GroupAction.lean @@ -290,7 +290,6 @@ lemma _root_.Matrix.GL.mem_range_map_iff {R K : Type*} [CommRing R] congr 1 ext i j simp [hr] - · exact (Units.inv_eq_val_inv _).symm lemma mem_stabilizer_twist_iff_mem {ϖ : R} (hϖ : Irreducible ϖ) (g : GL (Fin 2) R) (f : Fin 2 → ℤ) : diff --git a/LeanPool/BruhatTits/Graph/Regular.lean b/LeanPool/BruhatTits/Graph/Regular.lean index 96d7cc52fd..c7845dc66b 100644 --- a/LeanPool/BruhatTits/Graph/Regular.lean +++ b/LeanPool/BruhatTits/Graph/Regular.lean @@ -270,7 +270,7 @@ open scoped LinearAlgebra.Projectivization /-- Neighbors of a vertex `⟦L⟧` correspond the projectivization of `L ⧸ ϖ L`. -/ def neighborSetEquivProjectivization (L : Lattice R) : BTgraph.neighborSet ⟦L⟧ ≃ ℙ (ResidueField R) L.quotient := - (Equiv.setCongr <| by ext; simp [BTgraph_adj, isNeighbour_symm]; rfl).trans <| + (Set.equivOfEq <| by ext; simp [BTgraph_adj, isNeighbour_symm]; rfl).trans <| (neighborsEquivLines L).trans (Projectivization.equivSubmodule (ResidueField R) L.quotient).symm diff --git a/LeanPool/BruhatTits/Harmonic/Basic.lean b/LeanPool/BruhatTits/Harmonic/Basic.lean index f2de6f9ff1..33d6b34bda 100644 --- a/LeanPool/BruhatTits/Harmonic/Basic.lean +++ b/LeanPool/BruhatTits/Harmonic/Basic.lean @@ -49,6 +49,7 @@ instance (v : V) [Finite (X.incidenceSet v)] : Finite { e : X.edgeSet | v ∈ e. def incidenceFinset' (v : V) [Fintype (X.neighborSet v)] : Finset X.edgeSet := (Set.toFinite { e : X.edgeSet | v ∈ e.val }).toFinset +omit [DecidableEq V] in lemma mem_incidenceFinset' (v : V) [Fintype (X.neighborSet v)] (e : X.edgeSet) : e ∈ incidenceFinset' v ↔ v ∈ e.val := by simp [incidenceFinset'] @@ -242,16 +243,19 @@ def outwardEdgeCone (w : V) : Finset X.edgeSet := simpa only [Finset.mem_coe, mem_incidenceFinset'] using he.left hs.toFinset +omit [DecidableEq V] in lemma mem_outwardEdgeCone_iff (w : V) (e : X.edgeSet) : e ∈ X.outwardEdgeCone v₀ w ↔ w ∈ e.val ∧ X.source v₀ e = w := by simp [outwardEdgeCone] +omit [DecidableEq V] in lemma outwardEdgeCone_nonempty_of_source (e : X.edgeSet) : (X.outwardEdgeCone v₀ (X.source v₀ e)).Nonempty := by use e rw [mem_outwardEdgeCone_iff] simp +omit [DecidableEq V] in /-- The outward edge cone of the origin `v₀` is the finset of all neighboring edges. -/ lemma outwardEdgeCone_origin_eq : X.outwardEdgeCone v₀ v₀ = X.incidenceFinset' v₀ := by ext e @@ -263,10 +267,12 @@ lemma outwardEdgeCone_origin_eq : X.outwardEdgeCone v₀ v₀ = X.incidenceFinse def distinguishedEdge (w : V) (hw : (X.outwardEdgeCone v₀ w).Nonempty) : X.edgeSet := hw.choose +omit [DecidableEq V] in lemma distinguishedEdge_mem (w : V) (hw : (X.outwardEdgeCone v₀ w).Nonempty) : X.distinguishedEdge v₀ w hw ∈ X.outwardEdgeCone v₀ w := hw.choose_spec +omit [DecidableEq V] in @[simp] lemma source_distinguishedEdge (v : V) (hnonempty : (X.outwardEdgeCone v₀ v).Nonempty) : X.source v₀ (distinguishedEdge v₀ v hnonempty) = v := by @@ -274,9 +280,11 @@ lemma source_distinguishedEdge (v : V) (hnonempty : (X.outwardEdgeCone v₀ v).N rw [mem_outwardEdgeCone_iff] at this exact this.right +omit [DecidableEq V] in lemma outwardEdgeCone_eq_union (w : V) (hw : (X.outwardEdgeCone v₀ w).Nonempty) : X.outwardEdgeCone v₀ w = { X.distinguishedEdge v₀ w hw } ∪ { e | e ∈ X.outwardEdgeCone v₀ w ∧ X.distinguishedEdge v₀ w hw ≠ e } := by + classical ext e simp_rw [Finset.mem_coe, ne_eq, Set.singleton_union, Set.mem_insert_iff, Set.mem_ofPred_eq] constructor @@ -408,6 +416,7 @@ lemma vertex_mem_edgeTowardsOrigin (w : V) (hw : 0 < X.dist v₀ w) : nth_rw 2 [← edgeTowardsOrigin_target_eq v₀ w hw] exact target_mem v₀ (edgeTowardsOrigin v₀ w hw) +omit [DecidableEq V] in lemma edgeTowardsOrigin_not_mem_outwardEdgeCone (v : V) (hdist : 0 < X.dist v₀ v) : edgeTowardsOrigin v₀ v hdist ∉ outwardEdgeCone v₀ v := by intro hc @@ -418,6 +427,7 @@ lemma edgeTowardsOrigin_not_mem_outwardEdgeCone (v : V) (hdist : 0 < X.dist v₀ apply this.ne exact hc.right +omit [DecidableEq V] in lemma outwardEdgeCone_nonempty_of_two_le_degree {v : V} (hv : 2 ≤ X.degree v) : (X.outwardEdgeCone v₀ v).Nonempty := by have : 1 < (X.neighborFinset v).card := by simpa @@ -710,9 +720,11 @@ end Tree end «Surjectivity» +omit [DecidableEq V] in /-- If `X` is a tree, the Laplacian on `X` is surjective. -/ lemma laplace_surjective {X : SimpleGraph V} (htree : IsTree X) [∀ v, Fintype (X.neighborSet v)] (w : V → Aˣ) (hmindeg : ∀ v, 2 ≤ X.degree v) : Function.Surjective (X.laplace (M := M) w) := by + classical intro f let X : Tree V := ⟨X, htree⟩ obtain ⟨v₀⟩ := X.isTree.connected.nonempty @@ -726,15 +738,18 @@ section «Hom» variable {X : SimpleGraph V} variable [∀ v, Fintype (X.neighborSet v)] (w : V → Aˣ) +omit [DecidableEq V] in lemma laplace_apply (f : X.edgeSet → M) (v : V) : laplace w f v = w v • ∑ e ∈ X.incidenceFinset' v, f e := rfl +omit [DecidableEq V] in @[simp] lemma laplace_zero : X.laplace w (M := M) 0 = 0 := by ext x simp [laplace_apply] +omit [DecidableEq V] in @[simp] lemma laplace_add (f g : X.edgeSet → M) : X.laplace w (f + g) = X.laplace w f + X.laplace w g := by ext x @@ -747,15 +762,18 @@ def laplaceHom : (X.edgeSet → M) →+ (V → M) where map_zero' := laplace_zero w map_add' := laplace_add w +omit [DecidableEq V] in lemma laplaceHom_surjective (htree : X.IsTree) (hdeg : ∀ (v : V), 2 ≤ X.degree v) : Function.Surjective (X.laplaceHom (M := M) w) := laplace_surjective htree w hdeg +omit [DecidableEq V] in @[simp] lemma laplace_ASmul (a : A) (f : X.edgeSet → M) : X.laplace w (a • f) = a • X.laplace w f := by ext v simp [laplace_apply ,smul_comm a (w v), Finset.smul_sum] +omit [DecidableEq V] in lemma isLinearMap_laplace : IsLinearMap A (X.laplace (M := M) w) where map_add := laplace_add w map_smul := laplace_ASmul w @@ -763,6 +781,7 @@ lemma isLinearMap_laplace : IsLinearMap A (X.laplace (M := M) w) where /-- The Laplacian of `X` as an `A`-linear map. -/ def laplaceLinearMap : (X.edgeSet → M) →ₗ[A] (V → M) := (isLinearMap_laplace w).mk' +omit [DecidableEq V] in @[simp] lemma coe_laplaceLinearMap : ⇑(laplaceLinearMap w) = laplace (X := X) (M := M) w := rfl @@ -801,6 +820,7 @@ lemma smul_units (g : G) (x : Rˣ) : g • x = x := rfl variable {G} {X} variable [∀ v, Fintype (X.neighborSet v)] (w : V →[G] Rˣ) +omit [DecidableEq V] in @[simp] lemma laplace_smul (g : G) (f : X.edgeSet → M) : laplace w (g • f) = g • laplace w f := by @@ -824,6 +844,7 @@ def laplaceSMulHom : (X.edgeSet → M) →+[G] (V → M) where map_zero' := laplace_zero w map_add' := laplace_add w +omit [DecidableEq V] in lemma laplaceSMulHom_surjective (htree : X.IsTree) (hdeg : ∀ (v : V), 2 ≤ X.degree v) : Function.Surjective (laplaceSMulHom (M := M) (X := X) w) := laplace_surjective htree w hdeg diff --git a/LeanPool/BruhatTits/Lattice/Basic.lean b/LeanPool/BruhatTits/Lattice/Basic.lean index 4dab9d4312..a47c1fb667 100644 --- a/LeanPool/BruhatTits/Lattice/Basic.lean +++ b/LeanPool/BruhatTits/Lattice/Basic.lean @@ -96,11 +96,11 @@ instance toSubmodule_isLattice (g : GL ι K) : instance (g : GL ι K) (M : Submodule R (ι → K)) [IsLattice M] : IsLattice (g • M) where isFG := by - rw [GeneralLinearGroup.smul_def] + rw [GeneralLinearGroup.smul_submodule_def] apply Submodule.FG.map exact IsLattice.isFG spans := by - rw [GeneralLinearGroup.smul_def] + rw [GeneralLinearGroup.smul_submodule_def] simp_rw [Submodule.map_coe, LinearMap.coe_restrictScalars] erw [Submodule.span_image g.val.mulVecLin] rw [IsLattice.spans] diff --git a/LeanPool/BruhatTits/Lattice/Construction.lean b/LeanPool/BruhatTits/Lattice/Construction.lean index a379a2e241..725ee785d0 100644 --- a/LeanPool/BruhatTits/Lattice/Construction.lean +++ b/LeanPool/BruhatTits/Lattice/Construction.lean @@ -712,7 +712,7 @@ lemma Lattice.standard_M : lemma map_subtype_smul_standard_eq_standard (g : GL (Fin 2) R) : Matrix.GeneralLinearGroup.map R.subtype g • Lattice.standard R = Lattice.standard R := by ext : 1 - rw [Lattice.smul_M, Lattice.standard_M, Matrix.GeneralLinearGroup.smul_def] + rw [Lattice.smul_M, Lattice.standard_M, Matrix.GeneralLinearGroup.smul_submodule_def] simp only [Matrix.GeneralLinearGroup.val_map_apply, Subring.coe_subtype] have (x : Fin 2 → R) : (g.val.map Subtype.val).mulVec (((Algebra.linearMap (↥R) K).compLeft (Fin 2)) x) = diff --git a/LeanPool/BruhatTits/Utils/Matrix.lean b/LeanPool/BruhatTits/Utils/Matrix.lean index e153676e6b..f475dc743b 100644 --- a/LeanPool/BruhatTits/Utils/Matrix.lean +++ b/LeanPool/BruhatTits/Utils/Matrix.lean @@ -507,13 +507,13 @@ instance instSMulSubmoduleSubtypeMemSubringForallLeanPool : SMul (GL ι K) (Submodule R (ι → K)) where smul g M := Submodule.map ((toLin g).val : (ι → K) →ₗ[R] ι → K) M -lemma smul_def (g : GL ι K) (M : Submodule R (ι → K)) : +lemma smul_submodule_def (g : GL ι K) (M : Submodule R (ι → K)) : g • M = Submodule.map (g.val.mulVecLin : (ι → K) →ₗ[R] ι → K) M := rfl lemma mem_smul (g : GL ι K) (M : Submodule R (ι → K)) (x : ι → K) : x ∈ g • M ↔ ∃ y ∈ M, g.val *ᵥ y = x := by - rw [smul_def] + rw [smul_submodule_def] simp open Pointwise in @@ -530,10 +530,10 @@ lemma diagonal_smul (f : ι → Kˣ) (M : Submodule R (ι → K)) (hf : ∀ i j, instance instMulActionSubmoduleSubtypeMemSubringForallLeanPool : MulAction (GL ι K) (Submodule R (ι → K)) where one_smul M := by - rw [smul_def] + rw [smul_submodule_def] simp_all mul_smul g h M := by - simp_rw [smul_def] + simp_rw [smul_submodule_def] ext simp diff --git a/LeanPool/BruhatTits/Utils/RingHom.lean b/LeanPool/BruhatTits/Utils/RingHom.lean index da3da52ae4..e3009eb6be 100644 --- a/LeanPool/BruhatTits/Utils/RingHom.lean +++ b/LeanPool/BruhatTits/Utils/RingHom.lean @@ -94,7 +94,6 @@ lemma GL.mem_range_map_iff {f : R →+* S} (hf : Function.Injective f) congr 1 ext i j simp [hr] - · exact (Units.inv_eq_val_inv _).symm variable {K : Type*} [CommRing K] (R : Subring K) diff --git a/LeanPool/Burkholder/MartingaleTransforms.lean b/LeanPool/Burkholder/MartingaleTransforms.lean index a78932b57c..714c6b8a94 100644 --- a/LeanPool/Burkholder/MartingaleTransforms.lean +++ b/LeanPool/Burkholder/MartingaleTransforms.lean @@ -394,7 +394,7 @@ private lemma burkholder_plusOne_mul_martingaleDiff_memLp have hcoeff_meas : AEStronglyMeasurable (plusOne w n) μ := by exact hw_meas.add aestronglyMeasurable_const refine MemLp.of_le_mul (c := (2 : ℝ)) (burkholder_martingaleDiff_memLp h n) - (hcoeff_meas.mul (burkholder_martingaleDiff_memLp h n).1) ?_ + (hcoeff_meas.mul (burkholder_martingaleDiff_memLp h n).aestronglyMeasurable) ?_ filter_upwards [h.hbound n] with ω hwω have hcoeff : |plusOne w n ω| ≤ 2 := by rw [plusOne, abs_le] @@ -415,7 +415,7 @@ private lemma burkholder_minusOne_mul_martingaleDiff_memLp have hcoeff_meas : AEStronglyMeasurable (minusOne w n) μ := by exact hw_meas.sub aestronglyMeasurable_const refine MemLp.of_le_mul (c := (2 : ℝ)) (burkholder_martingaleDiff_memLp h n) - (hcoeff_meas.mul (burkholder_martingaleDiff_memLp h n).1) ?_ + (hcoeff_meas.mul (burkholder_martingaleDiff_memLp h n).aestronglyMeasurable) ?_ filter_upwards [h.hbound n] with ω hwω have hcoeff : |minusOne w n ω| ≤ 2 := by rw [minusOne, abs_le] @@ -519,7 +519,7 @@ private lemma burkholder_u_Xn_Yn_integrable have hpair_meas : AEStronglyMeasurable (fun ω => (X_{n}[w, f] ω, Y_{n}[w, f] ω)) μ := - hX.1.prodMk hY.1 + hX.aestronglyMeasurable.prodMk hY.aestronglyMeasurable have hu_meas : AEStronglyMeasurable (fun ω => diff --git a/LeanPool/Chudnovsky/SigmaZeta.lean b/LeanPool/Chudnovsky/SigmaZeta.lean index 32354e6995..639ac67987 100644 --- a/LeanPool/Chudnovsky/SigmaZeta.lean +++ b/LeanPool/Chudnovsky/SigmaZeta.lean @@ -186,7 +186,7 @@ private lemma logDeriv_weierstrassSigmaTerm {z w : ℂ} (hw : w ≠ 0) (hzw : z exact hA.add hB have d1 : deriv (fun z : ℂ ↦ 1 - z / w) z = -(1 / w) := (((hasDerivAt_id z).div_const w).const_sub 1).deriv - have hmul := logDeriv_mul (f := fun z : ℂ ↦ 1 - z / w) + have hmul := logDeriv_fun_mul (f := fun z : ℂ ↦ 1 - z / w) (g := fun z : ℂ ↦ Complex.exp (z / w + z ^ 2 / (2 * w ^ 2))) z h1a (Complex.exp_ne_zero _) (by fun_prop) (by fun_prop) rw [show (fun z ↦ weierstrassSigmaTerm z w) diff --git a/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialZ.lean b/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialZ.lean index 9f137c6de1..30c8700191 100644 --- a/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialZ.lean +++ b/LeanPool/Chudnovsky/SingularModuli/ModularPolynomialZ.lean @@ -102,11 +102,10 @@ identical fact is `private` in `Coefficients.lean`). -/ rational `r`, then `x = (m : ℂ)` for some `m : ℤ`. -/ theorem isInt_of_integral_of_rat {x : ℂ} (hint : IsIntegral ℤ x) {r : ℚ} (hr : x = (r : ℂ)) : ∃ m : ℤ, x = (m : ℂ) := by - have hinj : Function.Injective (algebraMap ℚ ℂ) := FaithfulSMul.algebraMap_injective ℚ ℂ have h1 : IsIntegral ℤ (algebraMap ℚ ℂ r) := by have hx : algebraMap ℚ ℂ r = x := by rw [hr]; simp rw [hx]; exact hint - have h2 : IsIntegral ℤ r := (isIntegral_algebraMap_iff hinj).mp h1 + have h2 : IsIntegral ℤ r := isIntegral_algebraMap_iff.mp h1 obtain ⟨n, hn⟩ := IsIntegrallyClosed.isIntegral_iff.mp h2 exact ⟨n, by rw [hr, ← hn]; simp⟩ diff --git a/LeanPool/ClassificationOfSurfaces/DiskSquare.lean b/LeanPool/ClassificationOfSurfaces/DiskSquare.lean index 24f6650e39..4943bc43ac 100644 --- a/LeanPool/ClassificationOfSurfaces/DiskSquare.lean +++ b/LeanPool/ClassificationOfSurfaces/DiskSquare.lean @@ -371,7 +371,7 @@ noncomputable def boundaryCircleHomeomorph : squareAmbientHomeomorph '' boundary := by rw [squareAmbientHomeomorph_image_boundary] rw [squareAmbientHomeomorph.apply_symm_apply] - simpa [Metric.mem_sphere, Submonoid.unitSphere] using z.property + simp [Submonoid.unitSphere] rcases hz with ⟨w, hw, heq⟩ exact squareAmbientHomeomorph.injective heq.symm ▸ hw⟩ left_inv := by diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2DegenerateRealization.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2DegenerateRealization.lean index 927e4bd4a8..a5332ef29a 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2DegenerateRealization.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2DegenerateRealization.lean @@ -563,13 +563,13 @@ theorem rightDegeneratePreMap_occurrenceSide simp only [occurrenceSide, PolygonGluing.Side.point] convert rightDegeneratePreMap_selected_side - P cut horientation hleft hr validP i t using 1 <;> rfl + P cut horientation hleft hr validP i t using 1 · rw [rightDegenerateMapOccurrence_retained P cut horientation hleft hr hface i] simp only [occurrenceSide, PolygonGluing.Side.point] convert rightDegeneratePreMap_retained_side - P cut horientation hleft hr validP hface i t using 1 <;> rfl + P cut horientation hleft hr validP hface i t using 1 theorem rightDegenerateMapOccurrence_dart (P : FiniteCyclicPresentation) (cut : P2Cut P) diff --git a/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2Realization.lean b/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2Realization.lean index c9fd4fab94..0718c517c0 100644 --- a/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2Realization.lean +++ b/LeanPool/ClassificationOfSurfaces/FiniteCyclicP2Realization.lean @@ -1262,7 +1262,7 @@ theorem positivePreMap_occurrenceSide simp only [occurrenceSide, PolygonGluing.Side.point] convert positivePreMap_selected_side_of_lt - P cut horientation hl hr validP i t hleft using 1 <;> rfl + P cut horientation hl hr validP i t hleft using 1 · have hright : cut.left.length ≤ (positiveCutSideIndex @@ -1273,13 +1273,13 @@ theorem positivePreMap_occurrenceSide simp only [occurrenceSide, PolygonGluing.Side.point] convert positivePreMap_selected_side_of_not_lt - P cut horientation hl hr validP i t hright using 1 <;> rfl + P cut horientation hl hr validP i t hright using 1 · rw [positiveMapOccurrence_retained P cut horientation hl hr hface i] simp only [occurrenceSide, PolygonGluing.Side.point] convert positivePreMap_retained_side - P cut horientation hl hr validP hface i t using 1 <;> rfl + P cut horientation hl hr validP hface i t using 1 /-- The transported occurrence carries exactly the retained old dart. -/ theorem positiveMapOccurrence_dart diff --git a/LeanPool/ClassificationOfSurfaces/Moise/Anchors.lean b/LeanPool/ClassificationOfSurfaces/Moise/Anchors.lean index 34572c3807..5f65a70dfb 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/Anchors.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/Anchors.lean @@ -284,19 +284,19 @@ theorem standardTriangleCircle_carrier : change x ∈ segment ℝ (standardTriangleVertex 0) (standardTriangleVertex ((0 : ZMod 3) + (1 : ZMod 3))) at hi rw [show (0 : ZMod 3) + (1 : ZMod 3) = 1 by decide] at hi - convert hi using 1; rfl + exact hi · refine ⟨0, ?_⟩ rw [hface0] change x ∈ segment ℝ (standardTriangleVertex 1) (standardTriangleVertex ((1 : ZMod 3) + (1 : ZMod 3))) at hi rw [show (1 : ZMod 3) + (1 : ZMod 3) = 2 by decide] at hi - convert hi using 1; rfl + exact hi · refine ⟨1, ?_⟩ rw [hface1, segment_symm] change x ∈ segment ℝ (standardTriangleVertex 2) (standardTriangleVertex ((2 : ZMod 3) + (1 : ZMod 3))) at hi rw [show (2 : ZMod 3) + (1 : ZMod 3) = 0 by decide] at hi - convert hi using 1; rfl + exact hi · rintro ⟨i, hi⟩ have hcases : ∀ j : Fin 3, j = 0 ∨ j = 1 ∨ j = 2 := by decide rcases hcases i with rfl | rfl | rfl @@ -305,7 +305,7 @@ theorem standardTriangleCircle_carrier : change x ∈ segment ℝ (standardTriangleVertex 1) (standardTriangleVertex ((1 : ZMod 3) + (1 : ZMod 3))) rw [show (1 : ZMod 3) + (1 : ZMod 3) = 2 by decide] - convert hi using 1; rfl + exact hi · rw [hface1] at hi refine ⟨2, ?_⟩ change x ∈ segment ℝ (standardTriangleVertex 2) @@ -317,7 +317,7 @@ theorem standardTriangleCircle_carrier : change x ∈ segment ℝ (standardTriangleVertex 0) (standardTriangleVertex ((0 : ZMod 3) + (1 : ZMod 3))) rw [show (0 : ZMod 3) + (1 : ZMod 3) = 1 by decide] - convert hi using 1; rfl + exact hi /-- **Positive anchor** for `PlaneComplex`: the closed standard triangle as a simplicial complex, with the seven nonempty subsets of its three vertices as faces. -/ diff --git a/LeanPool/ClassificationOfSurfaces/Moise/ChartInduction.lean b/LeanPool/ClassificationOfSurfaces/Moise/ChartInduction.lean index 1d28c1c6cd..e81bf0d635 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/ChartInduction.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/ChartInduction.lean @@ -1567,8 +1567,7 @@ private noncomputable abbrev MixedLocalFanCertificate.mixedOldComplex M.mixedFaceUsedEmbedding f ⟨v.1, hvf⟩ ∈ M.mixedUsedFaceVertices f := mem_map_univ (M.mixedFaceUsedEmbedding f) ⟨v.1, hvf⟩ refine ⟨f, ?_⟩ - convert hvMem using 1 - exact Subtype.ext rfl + exact hvMem faceMap := M.mixedUsedFaceMap faceMap_continuous := C.continuous_mixedUsedFaceMap faceMap_eq_iff := C.mixedUsedFaceMap_eq_iff @@ -3113,7 +3112,7 @@ private theorem chartCore_inter_protected_subset_interior_frontierGlue ChartKind.halfDisk.modelRegion) : Plane) = (c.chart ⟨z, hz⟩ : Plane) := by exact congrArg Subtype.val - (Equiv.setCongr_apply hmodel (c.chart ⟨z, hz⟩)) + (Set.equivOfEq_apply hmodel (c.chart ⟨z, hz⟩)) change z ∈ (modelWithCornersEuclideanHalfSpace 2).boundary S ↔ (((Homeomorph.setCongr hmodel) diff --git a/LeanPool/ClassificationOfSurfaces/Moise/FreeTriangleMove.lean b/LeanPool/ClassificationOfSurfaces/Moise/FreeTriangleMove.lean index fe99581f11..49a6980608 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/FreeTriangleMove.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/FreeTriangleMove.lean @@ -315,7 +315,7 @@ theorem image_freeTriangleBaseEdge (T : M.Triangle) (k : Fin 3) : rw [freeTriangleBaseEdge, hindices] rw [Finset.image_insert, Finset.image_singleton] ext p - simp [freeTriangleOrder, eq_comm] + simp [freeTriangleOrder] theorem freeTriangleBaseEdge_eq_orderedPair (T : M.Triangle) (k : Fin 3) : M.freeTriangleBaseEdge T k = @@ -338,7 +338,7 @@ theorem freeTriangleApexEdge0_carrier (T : M.Triangle) (k : Fin 3) : rw [show M.position '' (M.freeTriangleApexEdge0 T k : Set M.Vertex) = {M.freeTriangleOrder T k 0, M.freeTriangleOrder T k 2} by ext p - simp [freeTriangleApexEdge0, freeTriangleOrder, eq_comm]] + simp [freeTriangleApexEdge0, freeTriangleOrder]] exact convexHull_pair _ _ theorem freeTriangleApexEdge1_carrier (T : M.Triangle) (k : Fin 3) : @@ -347,7 +347,7 @@ theorem freeTriangleApexEdge1_carrier (T : M.Triangle) (k : Fin 3) : rw [show M.position '' (M.freeTriangleApexEdge1 T k : Set M.Vertex) = {M.freeTriangleOrder T k 1, M.freeTriangleOrder T k 2} by ext p - simp [freeTriangleApexEdge1, freeTriangleOrder, eq_comm]] + simp [freeTriangleApexEdge1, freeTriangleOrder]] exact convexHull_pair _ _ theorem triangleEdges_eq_freeTriangleEdges (T : M.Triangle) (k : Fin 3) : @@ -412,7 +412,7 @@ theorem frontier_triangleCarrier_subset_freeTriangleEdges (T : M.Triangle) (k : convexHull ℝ (M.position '' (({a, b} : Finset M.Vertex) : Set M.Vertex)) = segment ℝ (M.position a) (M.position b) := by rw [show M.position '' (({a, b} : Finset M.Vertex) : Set M.Vertex) = - {M.position a, M.position b} by ext q; simp [eq_comm]] + {M.position a, M.position b} by ext q; simp] exact convexHull_pair _ _ rw [M.triangleEdges_eq_orderedEdges T] at he simp only [Finset.mem_insert, Finset.mem_singleton] at he @@ -571,7 +571,7 @@ theorem isGeometricallyFreeTriangle_of_boundaryEdges_card_two (T : M.Triangle) convexHull ℝ (M.position '' (({a, b} : Finset M.Vertex) : Set M.Vertex)) = segment ℝ (M.position a) (M.position b) := by rw [show M.position '' (({a, b} : Finset M.Vertex) : Set M.Vertex) = - {M.position a, M.position b} by ext p; simp [eq_comm]] + {M.position a, M.position b} by ext p; simp] exact convexHull_pair _ _ have hUnion (a b : Finset M.Vertex) : (⋃ d ∈ ({a, b} : Finset (Finset M.Vertex)), @@ -821,7 +821,7 @@ theorem exists_transportedThinKitePatch_inter_boundaryEdge_subset_baseEndpoints convexHull ℝ (M.position '' (({v, w} : Finset M.Vertex) : Set M.Vertex)) = segment ℝ (M.position v) (M.position w) := by rw [show M.position '' (({v, w} : Finset M.Vertex) : Set M.Vertex) = - {M.position v, M.position w} by ext p; simp [eq_comm]] + {M.position v, M.position w} by ext p; simp] exact convexHull_pair _ _ have hsegmentImage : E '' segment ℝ a b = segment ℝ (M.position v) (M.position w) := by diff --git a/LeanPool/ClassificationOfSurfaces/Moise/GeometricTriangulation.lean b/LeanPool/ClassificationOfSurfaces/Moise/GeometricTriangulation.lean index 7fd47ef299..25c5738f2e 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/GeometricTriangulation.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/GeometricTriangulation.lean @@ -82,6 +82,183 @@ namespace LeanEval namespace Topology namespace ClassificationOfSurfaces +/-! +### Barycentric coordinates on the standard simplex + +Mathlib replaced the set-valued `stdSimplex 𝕜 ι : Set (ι → 𝕜)` by the bundled +`Convexity.StdSimplex`, whose elements carry a `Finsupp` of weights instead of a plain +coordinate function. Every complex in this development parametrizes its faces by honest +barycentric coordinate functions `ι → ℝ`, so the section below keeps the set-valued simplex — +and exactly the slice of its API that this project uses — as a definition of its own. The +statements and proofs are those of the corresponding Mathlib declarations, which are now +deprecated. +-/ + +section StandardSimplex + +variable (𝕜 : Type*) (ι : Type*) [Semiring 𝕜] [PartialOrder 𝕜] [Fintype ι] + +/-- The standard simplex in the space of functions `ι → 𝕜` is the set of vectors with +non-negative coordinates with total sum `1`. -/ +def stdSimplex : Set (ι → 𝕜) := + {f | (∀ x, 0 ≤ f x) ∧ ∑ x, f x = 1} + +theorem stdSimplex_eq_inter : + stdSimplex 𝕜 ι = (⋂ x, {f : ι → 𝕜 | 0 ≤ f x}) ∩ {f | ∑ x, f x = 1} := by + ext f + simp only [stdSimplex, Set.mem_inter_iff, Set.mem_iInter, Set.mem_ofPred_eq] + +theorem convex_stdSimplex [IsOrderedRing 𝕜] : Convex 𝕜 (stdSimplex 𝕜 ι) := by + refine fun f hf g hg a b ha hb hab => ⟨fun x => ?_, ?_⟩ + · apply_rules [add_nonneg, mul_nonneg, hf.1, hg.1] + · simp_rw [Pi.add_apply, Pi.smul_apply] + rwa [Finset.sum_add_distrib, ← Finset.smul_sum, ← Finset.smul_sum, hf.2, hg.2, smul_eq_mul, + smul_eq_mul, mul_one, mul_one] + +variable {ι} + +variable {𝕜} in +/-- All values of a function `f ∈ stdSimplex 𝕜 ι` belong to `[0, 1]`. -/ +theorem mem_Icc_of_mem_stdSimplex [IsOrderedAddMonoid 𝕜] {f : ι → 𝕜} + (hf : f ∈ stdSimplex 𝕜 ι) (x) : f x ∈ Set.Icc (0 : 𝕜) 1 := + ⟨hf.1 x, hf.2 ▸ Finset.single_le_sum (fun y _ => hf.1 y) (Finset.mem_univ x)⟩ + +/-- `stdSimplex 𝕜 ι` is a subset of the unit cube. -/ +theorem stdSimplex_subset_Icc [IsOrderedAddMonoid 𝕜] : stdSimplex 𝕜 ι ⊆ Set.Icc 0 1 := by + intro f h + rw [← Set.pi_univ_Icc, Set.univ_pi_eq_iInter, Set.mem_iInter] + simpa using fun i ↦ mem_Icc_of_mem_stdSimplex h i + +variable [DecidableEq ι] [ZeroLEOneClass 𝕜] + +theorem single_mem_stdSimplex (i : ι) : Pi.single i 1 ∈ stdSimplex 𝕜 ι := + ⟨le_update_iff.2 ⟨zero_le_one, fun _ _ ↦ le_rfl⟩, by simp⟩ + +end StandardSimplex + +section StandardSimplexTopology + +variable (𝕜 ι : Type*) [Fintype ι] [TopologicalSpace 𝕜] [Semiring 𝕜] [PartialOrder 𝕜] + [OrderClosedTopology 𝕜] [ContinuousAdd 𝕜] + +/-- `stdSimplex 𝕜 ι` is closed. -/ +theorem isClosed_stdSimplex : IsClosed (stdSimplex 𝕜 ι) := by + rw [stdSimplex_eq_inter] + apply IsClosed.inter + · exact isClosed_iInter fun i ↦ isClosed_le continuous_const (continuous_apply i) + · exact isClosed_eq (by fun_prop) continuous_const + +/-- `stdSimplex 𝕜 ι` is compact. -/ +theorem isCompact_stdSimplex [CompactIccSpace 𝕜] [IsOrderedAddMonoid 𝕜] : + IsCompact (stdSimplex 𝕜 ι) := + IsCompact.of_isClosed_subset isCompact_Icc (isClosed_stdSimplex 𝕜 ι) (stdSimplex_subset_Icc 𝕜) + +instance stdSimplex.instCompactSpace_coe [CompactIccSpace 𝕜] [IsOrderedAddMonoid 𝕜] : + CompactSpace (stdSimplex 𝕜 ι) := + isCompact_iff_compactSpace.mp <| isCompact_stdSimplex 𝕜 _ + +end StandardSimplexTopology + +namespace stdSimplex + +variable {S : Type*} [Semiring S] [PartialOrder S] + {X Y Z : Type*} [Fintype X] [Fintype Y] [Fintype Z] + +@[macro_inline] +instance : FunLike (stdSimplex S X) X S where + coe s := s.val + coe_injective := by aesop + +@[ext high] +lemma ext {s t : stdSimplex S X} (h : (s : X → S) = t) : s = t := by + ext : 1 + assumption + +@[simp] lemma zero_le (s : stdSimplex S X) (x : X) : 0 ≤ s x := s.2.1 x + +@[simp] lemma sum_eq_one (s : stdSimplex S X) : ∑ x, s x = 1 := s.2.2 + +@[simp] lemma add_eq_one (s : stdSimplex S (Fin 2)) : s 0 + s 1 = 1 := by + simpa only [Fin.sum_univ_two] using sum_eq_one s + +section + +variable [IsOrderedRing S] + +@[simp] lemma le_one (s : stdSimplex S X) (x : X) : s x ≤ 1 := by + rw [← sum_eq_one s] + exact Finset.single_le_sum (by simp) (by simp) + +lemma image_linearMap (f : X → Y) : + Set.image (FunOnFinite.linearMap S S f) (stdSimplex S X) ⊆ stdSimplex S Y := by + classical + rintro _ ⟨s, ⟨hs₀, hs₁⟩, rfl⟩ + refine ⟨fun y ↦ ?_, ?_⟩ + · rw [FunOnFinite.linearMap_apply_apply] + exact Finset.sum_nonneg (by aesop) + · simp only [FunOnFinite.linearMap_apply_apply, ← hs₁] + exact Finset.sum_fiberwise Finset.univ f s + +/-- The map `stdSimplex S X → stdSimplex S Y` that is induced by a map `f : X → Y`. -/ +noncomputable def map (f : X → Y) (s : stdSimplex S X) : stdSimplex S Y := + ⟨FunOnFinite.linearMap S S f s, image_linearMap f (by aesop)⟩ + +@[simp] lemma map_coe (f : X → Y) (s : stdSimplex S X) : + ⇑(map f s) = FunOnFinite.linearMap S S f s := rfl + +@[simp] lemma map_id_apply (x : stdSimplex S X) : map id x = x := by + aesop + +lemma map_comp_apply (f : X → Y) (g : Y → Z) (x : stdSimplex S X) : + map g (map f x) = map (g.comp f) x := by + ext + simp [FunOnFinite.linearMap_comp] + +/-- The vertex corresponding to `x : X` in `stdSimplex S X`. -/ +abbrev vertex [DecidableEq X] (x : X) : stdSimplex S X := + ⟨Pi.single x 1, single_mem_stdSimplex S x⟩ + +@[simp] lemma vertex_coe [DecidableEq X] (x : X) : + ⇑(vertex (S := S) x) = Pi.single x 1 := rfl + +@[simp] lemma map_vertex [DecidableEq X] [DecidableEq Y] (f : X → Y) (x : X) : + map (S := S) f (vertex x) = vertex (f x) := by + aesop + +lemma continuous_map [TopologicalSpace S] [IsTopologicalSemiring S] (f : X → Y) : + Continuous (map (S := S) f) := + Continuous.subtype_mk ((FunOnFinite.continuous_linearMap S S f).comp continuous_induced_dom) _ + +lemma vertex_injective [Nontrivial S] [DecidableEq X] : + Function.Injective (vertex (S := S) (X := X)) := by + intro x y h + replace h := DFunLike.congr_fun h x + by_contra! + simp [Pi.single_eq_of_ne this] at h + +instance [Nonempty X] : Nonempty (stdSimplex S X) := by + classical + exact ⟨vertex (Classical.arbitrary _)⟩ + +instance [Nontrivial S] [Nontrivial X] : Nontrivial (stdSimplex S X) where + exists_pair_ne := by + classical + obtain ⟨x, y, hxy⟩ := exists_pair_ne X + exact ⟨vertex x, vertex y, fun h ↦ hxy (vertex_injective h)⟩ + +instance [Subsingleton X] : Subsingleton (stdSimplex S X) where + allEq s t := by + ext i + have (u : stdSimplex S X) : u i = 1 := by + rw [← sum_eq_one u, Finset.sum_eq_single i _ (by simp)] + intro j _ hj + exact (hj (Subsingleton.elim j i)).elim + simp [this] + +end + +end stdSimplex + /-- The geometric realization of a finite family `F` of faces on a finite vertex type `V`: the points of the standard simplex on `V` whose support lies inside some face of `F`. For a face `t` this carves out the geometric simplex spanned by `t`, so the realization is the finite union of diff --git a/LeanPool/ClassificationOfSurfaces/Moise/GraphPolygonalization.lean b/LeanPool/ClassificationOfSurfaces/Moise/GraphPolygonalization.lean index 60cbf685e9..55d19111aa 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/GraphPolygonalization.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/GraphPolygonalization.lean @@ -591,7 +591,7 @@ theorem edge_lineMap_mem_support (i : Fin (Fintype.card K.EdgeFace)) {t : ℝ} (({K.edgeFirst i, K.edgeSecond i} : Finset K.Vertex) : Set K.Vertex) = {K.position (K.edgeFirst i), K.position (K.edgeSecond i)} := by ext x - simp [eq_comm] + simp rw [himage, convexHull_pair] exact lineMap_mem_segment ℝ _ _ ht @@ -841,7 +841,7 @@ theorem openSegments_disjoint_of_ne (({K.edgeFirst i, K.edgeSecond i} : Finset K.Vertex) : Set K.Vertex) = {K.position (K.edgeFirst i), K.position (K.edgeSecond i)} := by ext y - simp [eq_comm] + simp rw [himage, convexHull_pair] exact openSegment_subset_segment ℝ _ _ hxi have hxjSeg : x ∈ K.cellCarrier (K.edgeAt j).1 := by @@ -850,7 +850,7 @@ theorem openSegments_disjoint_of_ne (({K.edgeFirst j, K.edgeSecond j} : Finset K.Vertex) : Set K.Vertex) = {K.position (K.edgeFirst j), K.position (K.edgeSecond j)} := by ext y - simp [eq_comm] + simp rw [himage, convexHull_pair] exact openSegment_subset_segment ℝ _ _ hxj have hxInter : x ∈ K.cellCarrier ((K.edgeAt i).1 ∩ (K.edgeAt j).1) := by @@ -964,7 +964,7 @@ theorem disjoint_centralCarrier {j : Fin (Fintype.card K.EdgeFace)} (({K.edgeFirst i, K.edgeSecond i} : Finset K.Vertex) : Set K.Vertex) = {K.position (K.edgeFirst i), K.position (K.edgeSecond i)} := by ext z - simp [eq_comm] + simp rw [himage, convexHull_pair] exact openSegment_subset_segment ℝ _ _ hxOpen have hx'Support : x' ∈ K.support := by @@ -974,7 +974,7 @@ theorem disjoint_centralCarrier {j : Fin (Fintype.card K.EdgeFace)} (({K.edgeFirst j, K.edgeSecond j} : Finset K.Vertex) : Set K.Vertex) = {K.position (K.edgeFirst j), K.position (K.edgeSecond j)} := by ext z - simp [eq_comm] + simp rw [himage, convexHull_pair] exact openSegment_subset_segment ℝ _ _ hx'Open have hxx' : x = x' := hinj hxSupport hx'Support (hxy.trans hx'y.symm) @@ -1104,7 +1104,7 @@ theorem exists_centralPolygonalArc {h : Plane → Plane} (({K.edgeFirst i, K.edgeSecond i} : Finset K.Vertex) : Set K.Vertex) = {K.position (K.edgeFirst i), K.position (K.edgeSecond i)} := by ext z - simp [eq_comm] + simp rw [himage, convexHull_pair] exact lineMap_mem_segment ℝ _ _ ⟨(K.edgeTrim hcont D i).left_pos.le.trans ht.1, @@ -1147,7 +1147,7 @@ theorem resolvedCarrier_subset_tube (A : K.CentralPolygonalArc hcont D C i) : (({K.edgeFirst i, K.edgeSecond i} : Finset K.Vertex) : Set K.Vertex) = {K.position (K.edgeFirst i), K.position (K.edgeSecond i)} := by ext z - simp [eq_comm] + simp rw [himage, convexHull_pair] exact lineMap_mem_segment ℝ _ _ ⟨(K.edgeTrim hcont D i).left_pos.le, @@ -1172,7 +1172,7 @@ theorem resolvedCarrier_subset_edgeConvexHull (({K.edgeFirst i, K.edgeSecond i} : Finset K.Vertex) : Set K.Vertex) = {K.position (K.edgeFirst i), K.position (K.edgeSecond i)} := by ext z - simp [eq_comm] + simp rw [himage, convexHull_pair] exact lineMap_mem_segment ℝ _ _ ⟨(K.edgeTrim hcont D i).left_pos.le, @@ -1386,7 +1386,7 @@ theorem trimmedCarrier_avoids_nonincident (({K.edgeFirst i, K.edgeSecond i} : Finset K.Vertex) : Set K.Vertex) = {K.position (K.edgeFirst i), K.position (K.edgeSecond i)} := by ext x - simp [eq_comm] + simp rw [himage, convexHull_pair] exact openSegment_subset_segment ℝ _ _ @@ -2195,7 +2195,7 @@ theorem edgeReplacementMap_image_cellCarrier {h : Plane → Plane} (({K.edgeFirst i, K.edgeSecond i} : Finset K.Vertex) : Set K.Vertex) = {K.position (K.edgeFirst i), K.position (K.edgeSecond i)} := by ext z - simp [eq_comm] + simp rw [himage, convexHull_pair] exact lineMap_mem_segment ℝ _ _ t.2 refine ⟨x, hx, ?_⟩ @@ -2263,7 +2263,7 @@ private theorem mem_openSegment_of_mem_edge_not_vertex (({K.edgeFirst i, K.edgeSecond i} : Finset K.Vertex) : Set K.Vertex) = {K.position (K.edgeFirst i), K.position (K.edgeSecond i)} := by ext z - simp [eq_comm] + simp rwa [himage] at hx theorem edgeIndexAt_eq_of_not_vertex {x : Plane} @@ -2671,7 +2671,7 @@ theorem graphReplacementMap_affineOn_middle {h : Plane → Plane} have himage : R.position '' (({p, q} : Finset R.Vertex) : Set R.Vertex) = {R.position p, R.position q} := by ext x - simp [eq_comm] + simp rw [himage, convexHull_pair, image_segment] simp only [middleSourceMap_apply] change segment ℝ (planePoint (z (R.position p)) 0) @@ -2936,7 +2936,7 @@ theorem graphReplacementMap_dist_lt_two_mul {h : Plane → Plane} (({K.edgeFirst i, K.edgeSecond i} : Finset K.Vertex) : Set K.Vertex) = {K.position (K.edgeFirst i), K.position (K.edgeSecond i)} := by ext y - simp [eq_comm] + simp rw [himage, convexHull_pair] exact lineMap_mem_segment ℝ _ _ htIcc calc diff --git a/LeanPool/ClassificationOfSurfaces/Moise/GraphRefinement.lean b/LeanPool/ClassificationOfSurfaces/Moise/GraphRefinement.lean index 7549036047..001cc67571 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/GraphRefinement.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/GraphRefinement.lean @@ -140,7 +140,7 @@ theorem markedEdgeChain_segment (point : P → Plane) (({K.edgeFirst i, K.edgeSecond i} : Finset K.Vertex) : Set K.Vertex) = {K.position (K.edgeFirst i), K.position (K.edgeSecond i)} := by ext x - simp [eq_comm] + simp rw [himage, convexHull_pair] /-- The `markedEdgeArrangement` declaration. -/ @@ -578,7 +578,7 @@ theorem exists_face_containing_axis_segment_of_no_vertex have himage : L.position '' (({v, w} : Finset L.Vertex) : Set L.Vertex) = {L.position v, L.position w} := by ext z - simp [eq_comm] + simp rwa [himage] at hqs rw [segment_eq_image_lineMap] at hqSeg obtain ⟨t, ht, hqt⟩ := hqSeg @@ -605,7 +605,7 @@ theorem exists_face_containing_axis_segment_of_no_vertex exact ⟨hvLow.trans hab, hwHigh⟩ refine ⟨{v, w}, hs, ?_⟩ rw [PlaneComplex.cellCarrier, show L.position '' (({v, w} : Finset L.Vertex) : Set L.Vertex) = - {L.position v, L.position w} by ext z; simp [eq_comm], convexHull_pair, hvAxis, hwAxis] + {L.position v, L.position w} by ext z; simp, convexHull_pair, hvAxis, hwAxis] exact hsub · have hsub : segment ℝ (planePoint a 0) (planePoint b 0) ⊆ segment ℝ (planePoint (L.position w 0) 0) (planePoint (L.position v 0) 0) := by @@ -618,7 +618,7 @@ theorem exists_face_containing_axis_segment_of_no_vertex exact ⟨hwLow.trans hab, hvHigh⟩ refine ⟨{v, w}, hs, ?_⟩ rw [PlaneComplex.cellCarrier, show L.position '' (({v, w} : Finset L.Vertex) : Set L.Vertex) = - {L.position v, L.position w} by ext z; simp [eq_comm], convexHull_pair, + {L.position v, L.position w} by ext z; simp, convexHull_pair, hvAxis, hwAxis] simpa only [segment_symm] using hsub · have hbq : b ≤ q := by diff --git a/LeanPool/ClassificationOfSurfaces/Moise/GraphSubdivision.lean b/LeanPool/ClassificationOfSurfaces/Moise/GraphSubdivision.lean index c3d9792041..8326b48492 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/GraphSubdivision.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/GraphSubdivision.lean @@ -200,7 +200,7 @@ theorem edgeParameter_mem_Icc (i : Fin (Fintype.card K.EdgeFace)) {x : Plane} (({K.edgeFirst i, K.edgeSecond i} : Finset K.Vertex) : Set K.Vertex) = {K.position (K.edgeFirst i), K.position (K.edgeSecond i)} := by ext y - simp [eq_comm] + simp rw [himage, convexHull_pair] at hx rw [segment_eq_image_lineMap] at hx obtain ⟨t, ht, rfl⟩ := hx @@ -215,7 +215,7 @@ theorem lineMap_edgeParameter_eq (i : Fin (Fintype.card K.EdgeFace)) {x : Plane} (({K.edgeFirst i, K.edgeSecond i} : Finset K.Vertex) : Set K.Vertex) = {K.position (K.edgeFirst i), K.position (K.edgeSecond i)} := by ext y - simp [eq_comm] + simp rw [himage, convexHull_pair, segment_eq_image_lineMap] at hx obtain ⟨t, -, rfl⟩ := hx rw [K.edgeParameter_lineMap] @@ -322,7 +322,7 @@ theorem edgeChain_segment (i : Fin (Fintype.card K.EdgeFace)) : (({K.edgeFirst i, K.edgeSecond i} : Finset K.Vertex) : Set K.Vertex) = {K.position (K.edgeFirst i), K.position (K.edgeSecond i)} := by ext x - simp [eq_comm] + simp rw [himage, convexHull_pair] /-- The ambient arrangement generated by all graph edges. -/ @@ -736,7 +736,7 @@ theorem sampledEdgeChain_segment (cuts : ℕ) (({K.edgeFirst i, K.edgeSecond i} : Finset K.Vertex) : Set K.Vertex) = {K.position (K.edgeFirst i), K.position (K.edgeSecond i)} := by ext x - simp [eq_comm] + simp rw [himage, convexHull_pair] /-- The `sampledEdgeArrangement` declaration. -/ diff --git a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceExtension.lean b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceExtension.lean index f3aa71f19a..edc19a220d 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceExtension.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceExtension.lean @@ -960,7 +960,7 @@ theorem faceBoundarySubdivision_middleSource have himage : R.position '' (({p, q} : Finset R.Vertex) : Set R.Vertex) = {R.position p, R.position q} := by ext x - simp [eq_comm] + simp rw [himage, convexHull_pair, image_segment] rw [hsourceApply, hsourceApply] rcases le_total (z (R.position p)) (z (R.position q)) with hpzq | hqzp diff --git a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceModel.lean b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceModel.lean index 53e153d635..2d2ee487ee 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceModel.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicFaceModel.lean @@ -514,7 +514,7 @@ theorem faceEdgeSourcePoint_mem_standardEdge (t : K.Face) (i : ZMod 3) {standardTriangleVertex (K.faceEdgeFirstIndex t i), standardTriangleVertex (K.faceEdgeSecondIndex t i)} by ext p - simp [eq_comm]] + simp] rw [convexHull_pair, segment_eq_image_lineMap] exact ⟨r, hr, rfl⟩ @@ -529,7 +529,7 @@ theorem faceEdgeSourcePoint_image_Icc (t : K.Face) (i : ZMod 3) : {standardTriangleVertex (K.faceEdgeFirstIndex t i), standardTriangleVertex (K.faceEdgeSecondIndex t i)} := by ext p - simp [eq_comm] + simp rw [himage, convexHull_pair, segment_eq_image_lineMap] rfl diff --git a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicGraphModel.lean b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicGraphModel.lean index cdb4d1c72d..86368d53fc 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicGraphModel.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/IntrinsicGraphModel.lean @@ -42,7 +42,7 @@ theorem exists_cellCarrier_eq_segment (L : PlaneComplex) L.position '' (↑({v, w} : Finset L.Vertex) : Set L.Vertex) = {L.position v, L.position w} := by ext x - simp [eq_comm] + simp rw [himage, convexHull_pair] end PlaneComplex diff --git a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceExtension.lean b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceExtension.lean index a56075b463..37eff18fa7 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceExtension.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceExtension.lean @@ -902,7 +902,7 @@ theorem faceBoundarySubdivision_middleSource have himage : R.position '' (({p, q} : Finset R.Vertex) : Set R.Vertex) = {R.position p, R.position q} := by ext x - simp [eq_comm] + simp rw [himage, convexHull_pair, image_segment] rw [hsourceApply, hsourceApply] rcases le_total (z (R.position p)) (z (R.position q)) with hpzq | hqzp diff --git a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceModel.lean b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceModel.lean index 53151949c9..5b57ef5d5c 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceModel.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/LocallyFiniteFaceModel.lean @@ -252,7 +252,7 @@ theorem faceEdgeSourcePoint_mem_standardEdge (f : K.Face) (i : ZMod 3) Set (Fin 3)) = {standardTriangleVertex (K.faceEdgeFirstIndex f i), standardTriangleVertex (K.faceEdgeSecondIndex f i)} by - ext p; simp [eq_comm]] + ext p; simp] rw [convexHull_pair, segment_eq_image_lineMap] exact ⟨r, hr, rfl⟩ @@ -266,7 +266,7 @@ theorem faceEdgeSourcePoint_image_Icc (f : K.Face) (i : ZMod 3) : Set (Fin 3)) = {standardTriangleVertex (K.faceEdgeFirstIndex f i), standardTriangleVertex (K.faceEdgeSecondIndex f i)} by - ext p; simp [eq_comm]] + ext p; simp] rw [convexHull_pair, segment_eq_image_lineMap] rfl diff --git a/LeanPool/ClassificationOfSurfaces/Moise/PLApproximation.lean b/LeanPool/ClassificationOfSurfaces/Moise/PLApproximation.lean index 86c4eb2434..c73237ff29 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/PLApproximation.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/PLApproximation.lean @@ -319,7 +319,7 @@ theorem PlaneComplex.isPreconnected_cellCarrier_sdiff_sharedCarrier (K : PlaneCo simp only [Finset.mem_insert, Finset.mem_singleton] at hz rcases hz with rfl | rfl <;> assumption have himage : K.position '' (({v, w} : Finset K.Vertex) : Set K.Vertex) = - {K.position v, K.position w} := by ext z; simp [eq_comm] + {K.position v, K.position w} := by ext z; simp have hset : K.oneSkeleton.cellCarrier ({v, w} : Finset K.Vertex) \ K.cellCarrier (({v, w} : Finset K.Vertex) ∩ t) = AffineMap.lineMap (K.position v) (K.position w) '' Set.Ioc (0 : ℝ) 1 := by @@ -358,7 +358,7 @@ theorem PlaneComplex.isPreconnected_cellCarrier_sdiff_sharedCarrier (K : PlaneCo K.cellCarrier (({v, w} : Finset K.Vertex) ∩ t) = AffineMap.lineMap (K.position v) (K.position w) '' Set.Ico (0 : ℝ) 1 := by have himage : K.position '' (({v, w} : Finset K.Vertex) : Set K.Vertex) = - {K.position v, K.position w} := by ext z; simp [eq_comm] + {K.position v, K.position w} := by ext z; simp rw [show ({v, w} : Finset K.Vertex) ∩ t = {w} by ext z; simp [hv, hw]] rw [show K.oneSkeleton.cellCarrier ({v, w} : Finset K.Vertex) = segment ℝ (K.position v) (K.position w) by @@ -472,7 +472,7 @@ theorem PlaneComplex.exists_face_containing_polygon_edge have himage : K.position '' (({v, w} : Finset K.Vertex) : Set K.Vertex) = ({K.position v, K.position w} : Set Plane) := by ext x - simp [eq_comm] + simp have hmABSegment : m ∈ segment ℝ A B := by simpa only [PlaneComplex.cellCarrier, himage, convexHull_pair, A, B] using hms have hmAB : m ∈ openSegment ℝ A B := by @@ -987,7 +987,7 @@ theorem IsPLOnSet.comp_polygonal_embedding (J J' : PolygonalCircle) rw [← convexHull_pair] congr 1 ext x - simp [eq_comm] + simp rw [← hpair] exact convexHull_mono (Set.image_mono hsi) diff --git a/LeanPool/ClassificationOfSurfaces/Moise/PlaneCycle.lean b/LeanPool/ClassificationOfSurfaces/Moise/PlaneCycle.lean index cf6db587b8..9447292546 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/PlaneCycle.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/PlaneCycle.lean @@ -30,7 +30,7 @@ theorem cellCarrier_pair_of_adj {u w : K.Vertex} (_ : K.vertexGraph.Adj u w) : (({u, w} : Finset K.Vertex) : Set K.Vertex) = {K.position u, K.position w} := by ext x - simp [eq_comm] + simp rw [himage, convexHull_pair] /-- A graph walk traces a canonical geometric path through the corresponding straight edges. -/ @@ -345,7 +345,7 @@ private theorem cycle_edge_carrier (p : K.vertexGraph.Walk v v) (_ : p.IsCycle) (({p.getVert i.val, p.getVert (i + 1).val} : Finset K.Vertex) : Set K.Vertex) = {K.position (p.getVert i.val), K.position (p.getVert (i + 1).val)} := by ext x - simp [eq_comm] + simp rw [himage, convexHull_pair] private theorem cycle_edge_inter_next (p : K.vertexGraph.Walk v v) (hp : p.IsCycle) diff --git a/LeanPool/ClassificationOfSurfaces/Moise/PolygonalArc.lean b/LeanPool/ClassificationOfSurfaces/Moise/PolygonalArc.lean index da2eaad8fc..56ba300b5e 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/PolygonalArc.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/PolygonalArc.lean @@ -537,7 +537,7 @@ theorem exists_vertex_pair_segment_of_mem_cellCarrier {s : Finset K.Vertex} (({v, w} : Finset K.Vertex) : Set K.Vertex) = {K.position v, K.position w} := by ext y - simp [eq_comm] + simp rwa [himage, convexHull_pair] at hx /-- The graph formed by the one-dimensional faces of a plane complex. -/ @@ -1285,7 +1285,7 @@ theorem resolvedSegment_subset (i : Fin B.resolvedWalk.length) : {B.arrangementMesh.toPlaneComplex.position (p.getVert i.val), B.arrangementMesh.toPlaneComplex.position (p.getVert (i.val + 1))} := by ext x - simp [eq_comm] + simp rw [PlaneComplex.cellCarrier, himage, convexHull_pair] at hcarrier exact hcarrier @@ -1303,7 +1303,7 @@ theorem resolvedSegment_eq_cellCarrier (i : Fin B.resolvedWalk.length) : {B.arrangementMesh.toPlaneComplex.position (B.resolvedWalk.getVert i.val), B.arrangementMesh.toPlaneComplex.position (B.resolvedWalk.getVert (i.val + 1))} := by ext x - simp [eq_comm] + simp rw [himage, convexHull_pair] theorem resolvedEdge_mem_simplexes (i : Fin B.resolvedWalk.length) : diff --git a/LeanPool/ClassificationOfSurfaces/Moise/PolygonalSchoenflies.lean b/LeanPool/ClassificationOfSurfaces/Moise/PolygonalSchoenflies.lean index 57c8c7734b..156c9b1371 100644 --- a/LeanPool/ClassificationOfSurfaces/Moise/PolygonalSchoenflies.lean +++ b/LeanPool/ClassificationOfSurfaces/Moise/PolygonalSchoenflies.lean @@ -151,7 +151,7 @@ theorem PolygonalCircle.edgeSegment_inter_eq_shared_vertices rw [PolygonalCircle.edgeSegment, ← convexHull_pair] congr 1 ext x - simp [eq_comm] + simp have hsucc (k : ZMod J.n) : k ≠ k + 1 := by intro hk exact J.adjacent_ne k (congrArg J.vertex hk) @@ -308,7 +308,7 @@ noncomputable def PolygonalCircle.edgeComplex (J : PolygonalCircle) : PlaneCompl rw [PolygonalCircle.edgeSegment, ← convexHull_pair] congr 1 ext x - simp [eq_comm] + simp simpa only [Finset.mem_insert, Finset.mem_singleton] using (J.vertex_mem_edgeSegment_iff v i).mp (by rw [← hpair] @@ -370,13 +370,13 @@ noncomputable def PolygonalCircle.edgeComplex (J : PolygonalCircle) : PlaneCompl rw [PolygonalCircle.edgeSegment, ← convexHull_pair] congr 1 ext x - simp [eq_comm]] + simp] rw [show convexHull ℝ (J.vertex '' (({j, j + 1} : Finset (ZMod J.n)) : Set (ZMod J.n))) = J.edgeSegment j by rw [PolygonalCircle.edgeSegment, ← convexHull_pair] congr 1 ext x - simp [eq_comm]] + simp] exact J.edgeSegment_inter_eq_shared_vertices i j /-- The support of the polygon edge complex is exactly the polygon carrier. -/ @@ -390,7 +390,7 @@ theorem PolygonalCircle.edgeComplex_support (J : PolygonalCircle) : rw [← convexHull_pair] congr 1 ext x - simp [eq_comm] + simp apply Set.Subset.antisymm · intro x hx rw [PlaneComplex.support] at hx @@ -1330,11 +1330,11 @@ theorem TriangleMesh.exists_realizedProperChords_of_badFreeTriangle have havImage : M.position '' (({a, v} : Finset M.Vertex) : Set M.Vertex) = {M.position a, M.position v} := by ext p - simp [eq_comm] + simp have hbvImage : M.position '' (({b, v} : Finset M.Vertex) : Set M.Vertex) = {M.position b, M.position v} := by ext p - simp [eq_comm] + simp let Cav : J.ProperChord := { P := M.position a Q := M.position v @@ -1399,7 +1399,7 @@ theorem TriangleMesh.exists_meshCrosscut_of_badFreeTriangle have hchord : convexHull ℝ (M.position '' (({a, v} : Finset M.Vertex) : Set M.Vertex)) = G.B3 := by rw [show M.position '' (({a, v} : Finset M.Vertex) : Set M.Vertex) = - {M.position a, M.position v} by ext p; simp [eq_comm]] + {M.position a, M.position v} by ext p; simp] rw [convexHull_pair, hGB3, hCavP, hCavQ] refine ⟨G, ⟨{ support_eq := hsupport.trans hclosed.symm @@ -1407,7 +1407,7 @@ theorem TriangleMesh.exists_meshCrosscut_of_badFreeTriangle chordEdge_mem := hedgeMem chordVertices := by rw [show M.position '' (({a, v} : Finset M.Vertex) : Set M.Vertex) = - {M.position a, M.position v} by ext p; simp [eq_comm]] + {M.position a, M.position v} by ext p; simp] rw [hGP, hGQ, hCavP, hCavQ] chordCarrier := hchord }⟩⟩ diff --git a/LeanPool/Clawristotle/CoulombFlux.lean b/LeanPool/Clawristotle/CoulombFlux.lean index d830fed459..bb1e3941da 100644 --- a/LeanPool/Clawristotle/CoulombFlux.lean +++ b/LeanPool/Clawristotle/CoulombFlux.lean @@ -64,8 +64,7 @@ lemma landau_flux_integrable_coulomb · exact ((hf_smooth.continuous_fderiv (by norm_num)).eval_const (Pi.single j 1)).aestronglyMeasurable convert h_int.1.mul_const ((vGrad f v) j) |>.sub (h_int.2.const_mul (f v)) using 2 - · rfl - · simp only [Pi.smul_apply, Pi.sub_apply, smul_eq_mul]; ring + simp only [Pi.smul_apply, Pi.sub_apply, smul_eq_mul]; ring intro i j refine (h_inv i j).norm.mono' ?_ ?_ · refine AEStronglyMeasurable.mul ?_ ?_ diff --git a/LeanPool/Clawristotle/CoulombFluxConv.lean b/LeanPool/Clawristotle/CoulombFluxConv.lean index 49e186942b..8d9804a1d3 100644 --- a/LeanPool/Clawristotle/CoulombFluxConv.lean +++ b/LeanPool/Clawristotle/CoulombFluxConv.lean @@ -39,10 +39,9 @@ private lemma inv_norm_bounded_integrable have h_inv_ball : IntegrableOn (fun w => ‖v - w‖⁻¹) (Metric.closedBall v 1) := by rw [← integrable_indicator_iff measurableSet_closedBall] at * convert hK_local.comp_sub_left v using 1 - · rfl - · ext w - simp only [Set.indicator, Metric.mem_closedBall, dist_eq_norm, sub_zero, - norm_sub_rev v w] + ext w + simp only [Set.indicator, Metric.mem_closedBall, dist_eq_norm, sub_zero, + norm_sub_rev v w] exact (h_inv_ball.const_mul M).mono' ((Measurable.aestronglyMeasurable (Measurable.inv (measurable_norm.comp (measurable_const.sub measurable_id')))).mul diff --git a/LeanPool/Clawristotle/CoulombForceTransport.lean b/LeanPool/Clawristotle/CoulombForceTransport.lean index a7f3b04e99..91a7399b4e 100644 --- a/LeanPool/Clawristotle/CoulombForceTransport.lean +++ b/LeanPool/Clawristotle/CoulombForceTransport.lean @@ -50,7 +50,8 @@ lemma torusGradX_aestronglyMeasurable (x₀ + (0 : ℝ) • (Pi.single i (1 : ℝ) : Fin 3 → ℝ)) := by rw [h_eq]; exact hF_diff.hasFDerivAt have hline : HasDerivAt (fun t : ℝ => F (x₀ + t • ei)) (fderiv ℝ F x₀ ei) 0 := by - convert hF_at.comp_hasDerivAt (x := (0 : ℝ)) hg using 1 <;> rfl + convert hF_at.comp_hasDerivAt (x := (0 : ℝ)) hg using 1 + rfl have htendsto_inv : Filter.Tendsto (fun n : ℕ => ((↑n + 1 : ℝ))⁻¹) Filter.atTop (nhdsWithin 0 (Set.Ioi 0)) := tendsto_nhdsWithin_iff.mpr ⟨ diff --git a/LeanPool/Clawristotle/CoulombSpatialTransport.lean b/LeanPool/Clawristotle/CoulombSpatialTransport.lean index 68fe117d57..86e5951d1d 100644 --- a/LeanPool/Clawristotle/CoulombSpatialTransport.lean +++ b/LeanPool/Clawristotle/CoulombSpatialTransport.lean @@ -54,7 +54,8 @@ lemma gradX_stronglyMeasurable_v have hF_at : HasFDerivAt F (fderiv ℝ F x₀) (x₀ + (0 : ℝ) • ei) := by rw [h_eq]; exact hF_diff.hasFDerivAt have hline : HasDerivAt (fun t : ℝ => F (x₀ + t • ei)) (fderiv ℝ F x₀ ei) 0 := by - convert hF_at.comp_hasDerivAt (x := (0 : ℝ)) hg using 1 <;> rfl + convert hF_at.comp_hasDerivAt (x := (0 : ℝ)) hg using 1 + rfl have htendsto_inv : Filter.Tendsto (fun n : ℕ => ((↑n + 1 : ℝ))⁻¹) Filter.atTop (nhdsWithin 0 (Set.Ioi 0)) := tendsto_nhdsWithin_iff.mpr ⟨ diff --git a/LeanPool/Clawristotle/IteratedDerivHelpers.lean b/LeanPool/Clawristotle/IteratedDerivHelpers.lean index 2cf41d7e55..1dd49e07bd 100644 --- a/LeanPool/Clawristotle/IteratedDerivHelpers.lean +++ b/LeanPool/Clawristotle/IteratedDerivHelpers.lean @@ -88,7 +88,8 @@ lemma norm_iteratedFDeriv_proj_sq_le (j : Fin 3) (i : ℕ) (hi : 1 ≤ i) ContinuousLinearMap.opNorm_le_bound _ zero_le_one fun w => by simp only [one_mul]; exact norm_le_pi_norm w j have hpj_eq : (fun w : Fin 3 → ℝ => w j) = (pj : (Fin 3 → ℝ) →L[ℝ] ℝ) := rfl - have hpj_sq : ‖pj‖ * ‖pj‖ ≤ 1 := mul_le_one₀ hpj_le (norm_nonneg pj) hpj_le + have hpj_sq : ‖pj‖ * ‖pj‖ ≤ 1 := + (mul_le_of_le_one_left (norm_nonneg pj) hpj_le).trans hpj_le refine le_trans hleib ?_ by_cases h3 : 3 ≤ i · refine le_trans (Finset.sum_nonpos fun s hs => ?_) (by positivity) diff --git a/LeanPool/Clawristotle/NewtonianPotential.lean b/LeanPool/Clawristotle/NewtonianPotential.lean index d07204e1ef..bc59b34f19 100644 --- a/LeanPool/Clawristotle/NewtonianPotential.lean +++ b/LeanPool/Clawristotle/NewtonianPotential.lean @@ -275,10 +275,9 @@ lemma convolution_local_int_schwartz MeasureTheory.IntegrableOn (fun w => ‖v - w‖⁻¹) (Metric.closedBall v 1) := by rw [ ← MeasureTheory.integrable_indicator_iff (measurableSet_closedBall) ] at * convert hK_local.comp_sub_left v using 1 - · rfl - · ext w - simp only [Set.indicator, Metric.mem_closedBall, dist_eq_norm, sub_zero, - norm_sub_rev v w] + ext w + simp only [Set.indicator, Metric.mem_closedBall, dist_eq_norm, sub_zero, + norm_sub_rev v w] have h_prod_integrable : MeasureTheory.IntegrableOn (fun w => M * ‖v - w‖⁻¹) (Metric.closedBall v 1) := h_inv_integrable.const_mul M diff --git a/LeanPool/CompactnessAndDegeneracy/Compactness.lean b/LeanPool/CompactnessAndDegeneracy/Compactness.lean index 02c939aeb5..76a5c7698a 100644 --- a/LeanPool/CompactnessAndDegeneracy/Compactness.lean +++ b/LeanPool/CompactnessAndDegeneracy/Compactness.lean @@ -6,9 +6,9 @@ Authors: OpenAI, Dean Cureton module +public import Mathlib.Basic.Real.Basic public import Mathlib.Combinatorics.SimpleGraph.Acyclic public import Mathlib.Combinatorics.SimpleGraph.Extremal.Basic -public import Mathlib.Data.Real.Basic import Mathlib.Analysis.SpecialFunctions.Pow.Asymptotics import Mathlib.Combinatorics.SimpleGraph.Coloring.Constructions import Mathlib.Data.SetLike.Fintype @@ -5645,10 +5645,10 @@ private lemma edgeFinset_card_le_sum_degree_of_vertex_cover simpa only [mem_edgeFinset, mem_edgeSet] using hedge rcases hcover hadj with hu | hv · exact Finset.mem_biUnion.mpr - ⟨u, hu, (G.mem_incidenceFinset u _).mpr + ⟨u, hu, mem_incidenceFinset.mpr (G.mk'_mem_incidenceSet_left_iff.mpr hadj)⟩ · exact Finset.mem_biUnion.mpr - ⟨v, hv, (G.mem_incidenceFinset v _).mpr + ⟨v, hv, mem_incidenceFinset.mpr (G.mk'_mem_incidenceSet_right_iff.mpr hadj)⟩ calc G.edgeFinset.card ≤ diff --git a/LeanPool/CompactnessAndDegeneracy/Degeneracy.lean b/LeanPool/CompactnessAndDegeneracy/Degeneracy.lean index 26ba8533c0..bac63dcd05 100644 --- a/LeanPool/CompactnessAndDegeneracy/Degeneracy.lean +++ b/LeanPool/CompactnessAndDegeneracy/Degeneracy.lean @@ -2027,7 +2027,7 @@ private theorem choose_product_le_exp_binary_entropy ((population index : ℝ) * Real.binEntropy ((success index : ℝ) / (population index : ℝ))) := by - apply Finset.prod_le_prod + apply Finset.prod_le_prod₀ · intro index _ positivity · intro index _ @@ -5644,13 +5644,9 @@ private theorem hammingRetentionMeasure_real_contains_finset rw [ProbabilityTheory.setBernoulli_apply'] rw [hpreimage] rw [MeasureTheory.Measure.infinitePi_pi] - · simp only [Set.mem_univ, MeasureTheory.Measure.coe_add, MeasureTheory.Measure.coe_smul, - Pi.add_apply, - Pi.smul_apply, MeasurableSpace.measurableSet_top, MeasureTheory.Measure.dirac_apply', - Set.mem_singleton_iff, - Set.indicator_of_mem, Pi.one_apply, ENNReal.smul_one, eq_iff_iff, iff_true, - not_false_eq_true, - Set.indicator_of_notMem, smul_zero, add_zero, prod_const] + · simp only [Set.mem_univ, ProbabilityTheory.bernoulliMeasure_apply_of_mem_of_notMem, + MeasurableSpace.measurableSet_top, Set.mem_singleton_iff, eq_iff_iff, iff_true, + not_false_eq_true, prod_const] · intro vertex _ measurability change diff --git a/LeanPool/Computability/Encoding.lean b/LeanPool/Computability/Encoding.lean index 2b13c955b5..63b2b8d69e 100644 --- a/LeanPool/Computability/Encoding.lean +++ b/LeanPool/Computability/Encoding.lean @@ -6,7 +6,7 @@ Authors: Tanner Duve, Elan Roth import LeanPool.Computability.TuringDegree import Mathlib.Data.Option.Basic import Mathlib.Tactic.Linarith -import Mathlib.Logic.Denumerable +import Mathlib.Basic.Denumerable import Mathlib.Logic.Encodable.Basic import Mathlib.Data.Nat.PSub import Mathlib.Data.PFun diff --git a/LeanPool/ConcentrationInequalities/FreedmanBernstein.lean b/LeanPool/ConcentrationInequalities/FreedmanBernstein.lean index 8ef427f32f..ec2c6e9e56 100644 --- a/LeanPool/ConcentrationInequalities/FreedmanBernstein.lean +++ b/LeanPool/ConcentrationInequalities/FreedmanBernstein.lean @@ -59,16 +59,15 @@ lemma memLp_exp_mul (h : Kernel.HasSubgammaMGF X V c κ ν) (t : ℝ) (p : ℝ MemLp (fun ω ↦ exp (t * X ω)) p (κ ∘ₘ ν) := by by_cases hp0 : p = 0 · simpa [hp0] using (h.integrable_exp_mul t).1 - constructor - · exact (h.integrable_exp_mul t).1 - · rw [eLpNorm_lt_top_iff_lintegral_rpow_enorm_lt_top (mod_cast hp0) (by simp)] - simp only [ENNReal.coe_toReal] - have hi := (h.integrable_exp_mul (p * t)).2 - rw [hasFiniteIntegral_def] at hi - convert hi using 3 with ω - rw [enorm_eq_ofReal (by positivity), enorm_eq_ofReal (by positivity), - ENNReal.ofReal_rpow_of_nonneg (by positivity), ← exp_mul, mul_comm, ← mul_assoc] - positivity + rw [memLp_iff, eLpNorm_lt_top_iff_lintegral_rpow_enorm_lt_top (mod_cast hp0) (by simp) + (h.integrable_exp_mul t).1] + simp only [ENNReal.coe_toReal] + have hi := (h.integrable_exp_mul (p * t)).2 + rw [hasFiniteIntegral_def] at hi + convert hi using 3 with ω + rw [enorm_eq_ofReal (by positivity), enorm_eq_ofReal (by positivity), + ENNReal.ofReal_rpow_of_nonneg (by positivity), ← exp_mul, mul_comm, ← mul_assoc] + positivity @[simp] lemma fun_zero [IsFiniteMeasure ν] [IsZeroOrMarkovKernel κ] : Kernel.HasSubgammaMGF (fun _ ↦ 0) 0 c κ ν where @@ -123,10 +122,10 @@ lemma integrable_exp_add_compProd {η : Kernel (Ω' × Ω) Ω''} [IsZeroOrMarkov simp only [ENNReal.coe_ofNat] at hp have heq : κ ∘ₘ ν = ((κ ⊗ₖ η) ∘ₘ ν).map Prod.fst := by rw [Measure.map_comp _ _ measurable_fst, ← Kernel.fst_eq, Kernel.fst_compProd] - rwa [heq, memLp_map_measure_iff hp.1 measurable_fst.aemeasurable] at hp + rwa [heq, memLp_map_measure_iff hp.aestronglyMeasurable measurable_fst.aemeasurable] at hp · have hp := hY.memLp_exp_mul t 2 rwa [ENNReal.coe_ofNat, Measure.comp_compProd_comm, Measure.snd, - memLp_map_measure_iff hp.1 measurable_snd.aemeasurable] at hp + memLp_map_measure_iff hp.aestronglyMeasurable measurable_snd.aemeasurable] at hp /-- Multiplying two compatible sub-gamma estimates adds their variance factors. -/ private lemma mgf_mul_exp_le_add {a t : ℝ} @@ -315,13 +314,11 @@ lemma MeasureSubgammaMGF.add_of_hasCondSubgammaMGF [IsFiniteMeasure μ] have hY' : Kernel.HasSubgammaMGF Y W c (condExpKernel μ m) (Kernel.const Unit (μ.trim hm) ∘ₘ Measure.dirac ()) := by simpa convert hX.add_of_indep hY' - · ext - rfl - · ext - rw [Kernel.const_apply, ← Measure.compProd, compProd_trim_condExpKernel] - apply Measure.map_congr - filter_upwards with ω - rfl + ext + rw [Kernel.const_apply, ← Measure.compProd, compProd_trim_condExpKernel] + apply Measure.map_congr + filter_upwards with ω + rfl variable {Y : ℕ → Ω → ℝ} {V : ℕ → ℝ≥0} {c : ℝ≥0} {ℱ : Filtration ℕ mΩ} diff --git a/LeanPool/ConnesKreimer/PowerSeriesLogMul.lean b/LeanPool/ConnesKreimer/PowerSeriesLogMul.lean index 3323e657bc..b37f0f0765 100644 --- a/LeanPool/ConnesKreimer/PowerSeriesLogMul.lean +++ b/LeanPool/ConnesKreimer/PowerSeriesLogMul.lean @@ -21,40 +21,33 @@ namespace PowerSeries variable {A : Type*} [CommRing A] [Algebra ℚ A] /-- `(1+X) · (log(1+X))' = 1`: the geometric-series identity behind the derivative of `log`. -/ -theorem one_add_X_mul_deriv_log : (1 + X : A⟦X⟧) * d⁄dX A (log A) = 1 := by - rw [deriv_log] - ext n - rw [add_mul, one_mul, map_add, coeff_one] - rcases Nat.eq_zero_or_pos n with hn | hn - · simp_all - · obtain ⟨m, rfl⟩ := Nat.exists_eq_succ_of_ne_zero (by omega : n ≠ 0) - rw [coeff_succ_X_mul, coeff_mk, coeff_mk, ite_eq_right (Nat.succ_ne_zero m), ← map_add] - simp only [Nat.succ_eq_add_one] - rw [show ((-1 : ℚ) ^ (m + 1) + (-1) ^ m) = 0 by ring, map_zero] +theorem one_add_X_mul_deriv_log : (1 + X : A⟦X⟧) * d⁄dX (log A) = 1 := by + rw [mul_comm] + exact derivative_log_mul_one_add_X /-- The derivative `(log(1+X))'` substituted at `h-1` is the inverse of `h` (for `h` with constant term `1`): `(log A)'.subst (h-1) * h = 1`. -/ theorem deriv_log_subst_mul {h : A⟦X⟧} (hh : constantCoeff h = 1) : - (d⁄dX A (log A)).subst (h - 1) * h = 1 := by + (d⁄dX (log A)).subst (h - 1) * h = 1 := by have hS : HasSubst (h - 1 : A⟦X⟧) := HasSubst.of_constantCoeff_zero' (by simp [hh]) have hsub1 : (1 : A⟦X⟧).subst (h - 1) = 1 := by rw [← coe_substAlgHom hS, map_one] have hsub : (1 + X : A⟦X⟧).subst (h - 1) = h := by rw [subst_add hS, hsub1, subst_X hS]; ring - calc (d⁄dX A (log A)).subst (h - 1) * h - = h * (d⁄dX A (log A)).subst (h - 1) := by ring - _ = ((1 + X : A⟦X⟧).subst (h - 1)) * (d⁄dX A (log A)).subst (h - 1) := by rw [hsub] - _ = ((1 + X : A⟦X⟧) * d⁄dX A (log A)).subst (h - 1) := by rw [subst_mul hS] + calc (d⁄dX (log A)).subst (h - 1) * h + = h * (d⁄dX (log A)).subst (h - 1) := by ring + _ = ((1 + X : A⟦X⟧).subst (h - 1)) * (d⁄dX (log A)).subst (h - 1) := by rw [hsub] + _ = ((1 + X : A⟦X⟧) * d⁄dX (log A)).subst (h - 1) := by rw [subst_mul hS] _ = (1 : A⟦X⟧).subst (h - 1) := by rw [one_add_X_mul_deriv_log] _ = 1 := hsub1 /-- The chain-rule form of the derivative of `logOf`: `(logOf h)' · h = h'` for `h` with constant term `1`. -/ theorem deriv_logOf_mul {h : A⟦X⟧} (hh : constantCoeff h = 1) : - d⁄dX A (logOf h) * h = d⁄dX A h := by + d⁄dX (logOf h) * h = d⁄dX h := by have hS : HasSubst (h - 1 : A⟦X⟧) := HasSubst.of_constantCoeff_zero' (by simp [hh]) - have hd : d⁄dX A (logOf h) = (d⁄dX A (log A)).subst (h - 1) * d⁄dX A h := by + have hd : d⁄dX (logOf h) = (d⁄dX (log A)).subst (h - 1) * d⁄dX h := by rw [logOf_eq, derivative_subst hS, map_sub, Derivation.map_one_eq_zero, sub_zero] rw [hd, mul_right_comm, deriv_log_subst_mul hh, one_mul] @@ -75,9 +68,9 @@ theorem logOf_mul [IsAddTorsionFree A] {f g : A⟦X⟧} · -- derivatives agree apply hcancel rw [map_add, add_mul, deriv_logOf_mul hfg] - have e1 : d⁄dX A (logOf f) * (f * g) = d⁄dX A f * g := by + have e1 : d⁄dX (logOf f) * (f * g) = d⁄dX f * g := by rw [← mul_assoc, deriv_logOf_mul hf] - have e2 : d⁄dX A (logOf g) * (f * g) = d⁄dX A g * f := by + have e2 : d⁄dX (logOf g) * (f * g) = d⁄dX g * f := by rw [mul_comm f g, ← mul_assoc, deriv_logOf_mul hg] rw [e1, e2, Derivation.leibniz] simp only [smul_eq_mul] diff --git a/LeanPool/ConnesRigidity/Construction/SquareSpan.lean b/LeanPool/ConnesRigidity/Construction/SquareSpan.lean index 372fe0775b..fc4fe59c98 100644 --- a/LeanPool/ConnesRigidity/Construction/SquareSpan.lean +++ b/LeanPool/ConnesRigidity/Construction/SquareSpan.lean @@ -96,8 +96,7 @@ theorem pair_mem_squareSpan (i j : OrderedBasisIndex) : ext n m exact CharTwo.add_self_eq_zero ((x n).coeff m) have tensor_add_self (x : TensorAA) : x + x = 0 := by - refine TensorProduct.induction_on x ?_ ?_ ?_ - · simp + refine TensorProduct.inductionOn x ?_ ?_ · intro x y rw [← TensorProduct.add_tmul, A_add_self] simp diff --git a/LeanPool/ConnesRigidity/Foundation/LinearAlgebra/BooleanPolynomial.lean b/LeanPool/ConnesRigidity/Foundation/LinearAlgebra/BooleanPolynomial.lean index b8e44fe233..8e8e6b4b1c 100644 --- a/LeanPool/ConnesRigidity/Foundation/LinearAlgebra/BooleanPolynomial.lean +++ b/LeanPool/ConnesRigidity/Foundation/LinearAlgebra/BooleanPolynomial.lean @@ -198,12 +198,23 @@ theorem quadratic_weight_lower_bound have hadd (x y : ι → F) : q.eval (x + y) = q.eval x + q.eval y + q.eval 0 + b x y := by rw [hq0] - simp only [QuadraticData.eval, b, Pi.add_apply, add_mul, mul_add, - Finset.sum_add_distrib] - have hthree : (3 : F) = 1 := by decide - have hc3 : q.constantTerm * 3 = q.constantTerm := by rw [hthree, mul_one] - ring_nf - try rw [hc3] + simp only [QuadraticData.eval, b, Pi.add_apply] + have hlinear : ∑ i, q.linear i * (x i + y i) = + (∑ i, q.linear i * x i) + ∑ i, q.linear i * y i := by + rw [← Finset.sum_add_distrib] + exact Finset.sum_congr rfl fun i _ => by ring + have hquadratic : ∑ i, ∑ j, q.quadratic i j * (x i + y i) * (x j + y j) = + (∑ i, ∑ j, q.quadratic i j * x i * x j) + + (∑ i, ∑ j, q.quadratic i j * y i * y j) + + ∑ i, ∑ j, q.quadratic i j * (x i * y j + y i * x j) := by + rw [← Finset.sum_add_distrib, ← Finset.sum_add_distrib] + refine Finset.sum_congr rfl fun i _ => ?_ + rw [← Finset.sum_add_distrib, ← Finset.sum_add_distrib] + exact Finset.sum_congr rfl fun j _ => by ring + rw [hlinear, hquadratic] + have hconstantTerm : q.constantTerm + q.constantTerm = 0 := + CharTwo.add_self_eq_zero q.constantTerm + linear_combination -hconstantTerm have hbadd (x y z : ι → F) : b (x + y) z = b x z + b y z := by dsimp [b] simp only [add_mul, mul_add] diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/NormalizedHaar.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/NormalizedHaar.lean index 74c3af983c..e4910bd89c 100644 --- a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/NormalizedHaar.lean +++ b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/NormalizedHaar.lean @@ -77,8 +77,7 @@ theorem normalizedAddHaar_preserving_addEquiv let μ := normalizedAddHaar A have mappedHaar : Measure.IsAddHaarMeasure (μ.map e) := e.isAddHaarMeasure_map μ he heinv - have mappedProbability : IsProbabilityMeasure (μ.map e) := - μ.isProbabilityMeasure_map he.measurable.aemeasurable + have mappedProbability : IsProbabilityMeasure (μ.map e) := inferInstance refine ⟨he.measurable, ?_⟩ exact normalizedAddHaar_unique A (μ.map e) diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/PositiveSpectralMeasure.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/PositiveSpectralMeasure.lean index 4c9f9b09f7..0b1c46caa2 100644 --- a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/PositiveSpectralMeasure.lean +++ b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/PositiveSpectralMeasure.lean @@ -967,19 +967,20 @@ instance spectralOperatorAdjoin_isMulCommutative IsMulCommutative (StarAlgebra.adjoin ℂ (spectralOperatorGenerators E π)) := by apply StarAlgebra.isMulCommutative_adjoin - · exact fun _ hS _ hT ↦ spectralOperatorGenerators_commute E π hS hT - · intro S hS T hT - exact spectralOperatorGenerators_commute E π hS + · exact fun S hS ↦ + ⟨spectralOperatorGenerators_commute E π + (star_mem_spectralOperatorGenerators E π hS) hS⟩ + · exact fun _ hS _ hT _ ↦ spectralOperatorGenerators_commute E π hS hT + · exact fun _ hS _ hT _ ↦ spectralOperatorGenerators_commute E π hS (star_mem_spectralOperatorGenerators E π hT) +open scoped IsMulCommutative in instance spectralOperatorAlgebraCommCStarAlgebra (E : SplitAbelianExtension A G H) (π : UnitaryRepresentation G V) : CommCStarAlgebra (spectralOperatorAlgebra E π) := by - let commRingInstance : CommRing (spectralOperatorAlgebra E π) := - StarSubalgebra.commRingTopologicalClosure _ - (isMulCommutative_iff.mp - (spectralOperatorAdjoin_isMulCommutative E π)) + let commutativeInstance : IsMulCommutative (spectralOperatorAlgebra E π) := + StarSubalgebra.isMulCommutative_topologicalClosure _ let closedInstance : IsClosed (spectralOperatorAlgebra E π : Set (V →L[ℂ] V)) := (StarAlgebra.adjoin ℂ (spectralOperatorGenerators E π)).isClosed_topologicalClosure diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/Projection/ValuedSpectralMeasure.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/Projection/ValuedSpectralMeasure.lean index 041d032ac4..5297e7d2b3 100644 --- a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/Projection/ValuedSpectralMeasure.lean +++ b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/Projection/ValuedSpectralMeasure.lean @@ -394,7 +394,7 @@ theorem exists_quotientFixedUnitVector_with_displacement ‖((‖(p : K)‖ : ℂ)⁻¹)‖ = (‖(p : K)‖ : ℝ)⁻¹ := by simp [norm_inv, Complex.norm_real] rw [hscalar] - simpa only [Submodule.coe_norm, div_eq_mul_inv, mul_comm] using hfrac + simpa only [← Submodule.norm_coe, div_eq_mul_inv, mul_comm] using hfrac omit [TopologicalSpace A] [DiscreteTopology A] [MeasurableSpace (DiscreteCharacterSpace A)] diff --git a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/PropertyTTransfer.lean b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/PropertyTTransfer.lean index 0ba854ef79..dd141746dc 100644 --- a/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/PropertyTTransfer.lean +++ b/LeanPool/ConnesRigidity/Foundation/OperatorAlgebra/PropertyTTransfer.lean @@ -259,7 +259,7 @@ theorem normalFixedQuotient_hasAlmostInvariantUnitVectors ‖((‖(p : K)‖ : ℂ)⁻¹)‖ = (‖(p : K)‖ : ℝ)⁻¹ := by simp [norm_inv, Complex.norm_real] rw [hscalar] - simpa only [Submodule.coe_norm, div_eq_mul_inv, mul_comm] using hfrac + simpa only [← Submodule.norm_coe, div_eq_mul_inv, mul_comm] using hfrac have hrep : ((normalFixedQuotientRepresentation N π (QuotientGroup.mk' N g) : normalFixedSubmodule N π →L[ℂ] normalFixedSubmodule N π) η : K) = diff --git a/LeanPool/DeadEnds/Basic.lean b/LeanPool/DeadEnds/Basic.lean index 5099ea76c1..4c62690aea 100644 --- a/LeanPool/DeadEnds/Basic.lean +++ b/LeanPool/DeadEnds/Basic.lean @@ -311,7 +311,7 @@ lemma tprod_compl_le_one (b : ℕ) (_hb : 2 ≤ b) (T : Finset ℕ) (_hT : T ⊆ apply tprod_le_of_prod_le' · exact le_refl 1 · intro s - apply Finset.prod_le_one + apply Finset.prod_le_one₀ · intro i _ exact localDensityFactor_nonneg (i : ℕ) b T · intro i _ diff --git a/LeanPool/DeadEnds/CRT.lean b/LeanPool/DeadEnds/CRT.lean index 8fb42b952f..f5da297c35 100644 --- a/LeanPool/DeadEnds/CRT.lean +++ b/LeanPool/DeadEnds/CRT.lean @@ -272,7 +272,7 @@ lemma validResidues_card_eq_mul (b : ℕ) (_hb : 2 ≤ b) (T : Finset ℕ) (_hT lemma localDensityProduct_le_one (b : ℕ) (T : Finset ℕ) (S : Finset Nat.Primes) : localDensityProduct b T S ≤ 1 := by unfold localDensityProduct - apply Finset.prod_le_one + apply Finset.prod_le_one₀ · intro p _ exact localDensityFactor_nonneg p b T · intro p _ diff --git a/LeanPool/DirectedTopologyLean4/Dipath.lean b/LeanPool/DirectedTopologyLean4/Dipath.lean index 47cdcc811f..21c2a55668 100644 --- a/LeanPool/DirectedTopologyLean4/Dipath.lean +++ b/LeanPool/DirectedTopologyLean4/Dipath.lean @@ -146,7 +146,6 @@ lemma image_extend_eq_image (γ : Dipath x y) (a b : I) : refine ⟨t, t_ab, ?_⟩ rw [← ht] convert Path.extend_apply γ.toPath ⟨le_trans a.2.1 t_ab.1, le_trans t_ab.2 b.2.2⟩ - rfl /-! ### Reflexive dipaths -/ diff --git a/LeanPool/DirectedTopologyLean4/DirectedVanKampen.lean b/LeanPool/DirectedTopologyLean4/DirectedVanKampen.lean index 2053405b61..7f2f6b4629 100644 --- a/LeanPool/DirectedTopologyLean4/DirectedVanKampen.lean +++ b/LeanPool/DirectedTopologyLean4/DirectedVanKampen.lean @@ -164,7 +164,7 @@ def FunctorOnHomOfCoveredAux₂ {γ : Dipath x y} (hγ : range γ ⊆ X₂) : /- Show that these maps respect composition of paths -/ -attribute [local implicit_reducible] CategoryTheory.Cat.of CategoryTheory.Bundled.of dTopCat.of +attribute [local implicit_reducible] dTopCat.of FundamentalCategory.fundamentalCategoryFunctor in lemma functorOnHomOfCoveredAux₁_trans {x y z : X} {γ₁ : Dipath x y} {γ₂ : Dipath y z} (hγ : range (γ₁.trans γ₂) ⊆ X₁) : @@ -174,7 +174,7 @@ lemma functorOnHomOfCoveredAux₁_trans {x y z : X} {γ₁ : Dipath x y} unfold FunctorOnHomOfCoveredAux₁ rw [(subset_functor_trans hγ).symm] simp -attribute [local implicit_reducible] CategoryTheory.Cat.of CategoryTheory.Bundled.of dTopCat.of +attribute [local implicit_reducible] dTopCat.of FundamentalCategory.fundamentalCategoryFunctor in lemma functorOnHomOfCoveredAux₂_trans {x y z : X} {γ₁ : Dipath x y} {γ₂ : Dipath y z} (hγ : range (γ₁.trans γ₂) ⊆ X₂) : @@ -202,7 +202,7 @@ lemma functorOnHomOfCoveredAux₂_reparam {x y : X} {γ : Dipath x y} (hγ : ran /- Show that the maps respect reparametrization of paths -/ -attribute [local implicit_reducible] CategoryTheory.Cat.of CategoryTheory.Bundled.of dTopCat.of +attribute [local implicit_reducible] dTopCat.of FundamentalCategory.fundamentalCategoryFunctor in lemma functorOnHomOfCoveredAux₁_refl {x : X} (hx : x ∈ X₁) : FunctorOnHomOfCoveredAux₁ hX h_comm (range_refl_subset_of_mem hx) = 𝟙 (F_obj ⟨x⟩) := by @@ -211,7 +211,7 @@ lemma functorOnHomOfCoveredAux₁_refl {x : X} (hx : x ∈ X₁) : change eqToHom _ ≫ F₁.map (𝟙 ⟨x, hx⟩) ≫ eqToHom _ = 𝟙 (F_obj ⟨x⟩) rw [F₁.map_id] simp -attribute [local implicit_reducible] CategoryTheory.Cat.of CategoryTheory.Bundled.of dTopCat.of +attribute [local implicit_reducible] dTopCat.of FundamentalCategory.fundamentalCategoryFunctor in lemma functorOnHomOfCoveredAux₂_refl {x : X} (hx : x ∈ X₂) : FunctorOnHomOfCoveredAux₂ hX h_comm (range_refl_subset_of_mem hx) = 𝟙 (F_obj ⟨x⟩) := by @@ -223,7 +223,7 @@ lemma functorOnHomOfCoveredAux₂_refl {x : X} (hx : x ∈ X₂) : /- Show that for any path living in `X₁ ∩ X₂`, either map gives the same result. -/ -attribute [local implicit_reducible] CategoryTheory.Cat.of CategoryTheory.Bundled.of dTopCat.of +attribute [local implicit_reducible] dTopCat.of FundamentalCategory.fundamentalCategoryFunctor in lemma functorOnHomOfCoveredAux_equal {γ : Dipath x y} (hγ₁ : range γ ⊆ X₁) (hγ₂ : range γ ⊆ X₂) : @@ -562,7 +562,7 @@ lemma functorOnHomOfCoveredPartwise_apply_right_side {x y : X} {γ : Dipath x y} rw [functorOnHomOfCoveredPartwise_split hX h_comm (Nat.lt_succ_self n)] rw [functorOnHomOfCoveredPartwise_equal' hX h_comm rfl (Nat.sub_self n.succ)] rw [functorOnHomOfCoveredPartwise_apply_0] -attribute [local implicit_reducible] CategoryTheory.Cat.of CategoryTheory.Bundled.of dTopCat.of +attribute [local implicit_reducible] dTopCat.of FundamentalCategory.fundamentalCategoryFunctor Dipath.coveredPartwise in lemma functorOnHomOfCoveredPartwise_trans_case_0 {x y z : X} {γ₁ : Dipath x y} {γ₂ : Dipath y z} @@ -872,7 +872,7 @@ lemma functorOnHomAux_of_homotopic_dimaps {m : ℕ} : := by rw [Category.assoc] _ = Fh_aux (H.evalAtRight 0) ≫ Fh_aux (Dipath.ofDirectedMap g) := by rw [functorOnHomAux_split_of_covered_partwise _ _ _ _ g_cov] -attribute [local implicit_reducible] CategoryTheory.Cat.of CategoryTheory.Bundled.of dTopCat.of +attribute [local implicit_reducible] dTopCat.of FundamentalCategory.fundamentalCategoryFunctor Quiver.Hom Quotient Dipath.Dihomotopic.Quotient Dipath.coveredPartwise Dipath.cast SplitDipath.FirstPart SplitDipath.SecondPart SplitPath.FirstPart SplitPath.SecondPart @@ -958,7 +958,7 @@ lemma functorOnHom_comp_path {x y z : X} (γ₁ : Dipath x y) (γ₂ : Dipath y F_hom (⟦γ₁⟧ ≫ ⟦γ₂⟧) = F_hom ⟦γ₁⟧ ≫ F_hom ⟦γ₂⟧ := by change Fh_aux (γ₁.trans γ₂) = Fh_aux γ₁ ≫ Fh_aux γ₂ exact functorOnHom_trans hX X₁_open X₂_open h_comm γ₁ γ₂ -attribute [local implicit_reducible] CategoryTheory.Cat.of CategoryTheory.Bundled.of dTopCat.of +attribute [local implicit_reducible] dTopCat.of FundamentalCategory.fundamentalCategoryFunctor Quiver.Hom Quotient Dipath.Dihomotopic.Quotient in lemma functorOnHom_comp {x y z : dπₓ X} (γ₁ : x ⟶ y) (γ₂ : y ⟶ z) : @@ -1033,7 +1033,7 @@ lemma functor_comp_right : (dπₘ j₂) ⋙ F = F₂ := by · intros x y f rw [←Quotient.out_eq f] exact functor_comp_right_dipath hX X₁_open X₂_open h_comm f.out -attribute [local implicit_reducible] CategoryTheory.Cat.of CategoryTheory.Bundled.of dTopCat.of +attribute [local implicit_reducible] dTopCat.of FundamentalCategory.fundamentalCategoryFunctor Functor in lemma functor_uniq_aux_obj (F' : (dπₓ X) ⥤ C) (h₁ : (dπₘ j₁) ⋙ F' = F₁) (h₂ : (dπₘ j₂) ⋙ F' = F₂) (x : X) : @@ -1050,7 +1050,7 @@ lemma functor_uniq_aux_obj (F' : (dπₓ X) ⥤ C) (h₁ : (dπₘ j₁) ⋙ F' change F'.obj _ = F'.obj _ apply congrArg rfl -attribute [local implicit_reducible] CategoryTheory.Cat.of CategoryTheory.Bundled.of dTopCat.of +attribute [local implicit_reducible] dTopCat.of FundamentalCategory.fundamentalCategoryFunctor Quiver.Hom Quotient Dipath.Dihomotopic.Quotient Functor in lemma functor_uniq_of_covered (F' : (dπₓ X) ⥤ C) (h₁ : (dπₘ j₁) ⋙ F' = F₁) @@ -1078,7 +1078,7 @@ lemma functor_uniq_of_covered (F' : (dπₓ X) ⥤ C) (h₁ : (dπₘ j₁) ⋙ change ((dπₘ j₂) ⋙ F').map ⟦SubtypeDipath γ hγ⟧ = _ rw [map_eq_map_of_eq h₂] simp [functorObj_def]; rfl -attribute [local implicit_reducible] CategoryTheory.Cat.of CategoryTheory.Bundled.of dTopCat.of +attribute [local implicit_reducible] dTopCat.of FundamentalCategory.fundamentalCategoryFunctor Quiver.Hom Quotient Dipath.Dihomotopic.Quotient Functor in lemma functor_uniq_aux_map (F' : (dπₓ X) ⥤ C) (h₁ : (dπₘ j₁) ⋙ F' = F₁) diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise117.lean b/LeanPool/DomainTheory/Neighborhood/Exercise117.lean index 66a3ae863f..d1148fd370 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise117.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise117.lean @@ -6,7 +6,7 @@ Authors: Catskills Research Company import LeanPool.DomainTheory.Neighborhood.Basic import Mathlib.Algebra.Order.Archimedean.Real.Basic -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic import Mathlib.Data.Rat.Cast.Order /-! diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise125.lean b/LeanPool/DomainTheory/Neighborhood/Exercise125.lean index 02e251b352..5557d1dc90 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise125.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise125.lean @@ -110,7 +110,7 @@ variable [WellFoundedLT Δ] is its least element. -/ theorem exists_Ici_of_mem {X : Set Δ} (hX : (finalSegmentSystem Δ).mem X) : ∃ a, X = Set.Ici a := by - obtain ⟨a, haX, hmin⟩ := (IsWellFounded.wf (r := (· < · : Δ → Δ → Prop))).has_min X hX.1 + obtain ⟨a, haX, hmin⟩ := (wellFounded_lt (α := Δ)).has_min X hX.1 refine ⟨a, Set.ext fun b => ⟨fun hb => ?_, fun hb => ?_⟩⟩ · simp_all · exact hX.2 (Set.mem_Ici.mp hb) haX diff --git a/LeanPool/DomainTheory/Neighborhood/Exercise222.lean b/LeanPool/DomainTheory/Neighborhood/Exercise222.lean index 6cae73ed3a..2d9be9d8c6 100644 --- a/LeanPool/DomainTheory/Neighborhood/Exercise222.lean +++ b/LeanPool/DomainTheory/Neighborhood/Exercise222.lean @@ -6,7 +6,9 @@ Authors: Catskills Research Company import LeanPool.DomainTheory.Neighborhood.Approximable import Mathlib.Data.Set.Finite.Basic -import Mathlib.Data.Set.Lattice +import Mathlib.Data.Set.Lattice.Bounded +import Mathlib.Data.Set.Lattice.Disjoint +import Mathlib.Data.Set.Lattice.Image import Mathlib.Order.Directed /-! diff --git a/LeanPool/Duality/Common.lean b/LeanPool/Duality/Common.lean index 907f8ddcc8..63bc6b0a2e 100644 --- a/LeanPool/Duality/Common.lean +++ b/LeanPool/Duality/Common.lean @@ -73,6 +73,7 @@ lemma le_of_nneg_add {α : Type*} [AddCommGroup α] [PartialOrder α] [IsOrdered {a b c : α} (habc : a + b = c) (ha : 0 ≤ a) : b ≤ c := by aesop /-- `change h to t` rewrites the hypothesis `h` to the definitionally equal type `t`. -/ +@[tactic_alt Lean.Parser.Tactic.change] macro "change " h:ident " to " t:term : tactic => `(tactic| change $t at $h:ident) /-- `aeply t` is shorthand for `intro <;> apply t <;> aesop`, useful for proving universally diff --git a/LeanPool/Duality/LinearProgramming.lean b/LeanPool/Duality/LinearProgramming.lean index 1b609dba0a..ef2103808a 100644 --- a/LeanPool/Duality/LinearProgramming.lean +++ b/LeanPool/Duality/LinearProgramming.lean @@ -639,7 +639,6 @@ lemma ValidELP.unbounded_of_feasible_of_neg (P : ValidELP I J F) (hP : P.IsFeasi convert hAx₀ · change 0 = 0 • -(toE bᵢ) rw [←EF.coe_neg, EF.zero_smul_coe] - · rfl rw [add_zero] at zeros rw [Matrix.mulWeig_add, Matrix.mulWeig_smul k_pos, Pi.add_apply] apply add_le_of_le_of_nonpos diff --git a/LeanPool/Duality/LinearProgrammingB.lean b/LeanPool/Duality/LinearProgrammingB.lean index a125e06578..45a37ef0c3 100644 --- a/LeanPool/Duality/LinearProgrammingB.lean +++ b/LeanPool/Duality/LinearProgrammingB.lean @@ -142,7 +142,7 @@ private lemma StandardLP.toValidELP.isSolution_iff (P : StandardLP I J R) (x : J private lemma StandardLP.toValidELP_reaches_iff (P : StandardLP I J R) (r : R) : P.toValidELP.Reaches r ↔ P.Reaches r := by - peel with x + refine exists_congr fun x => ?_ apply and_congr · apply StandardLP.toValidELP.isSolution_iff · exact P.toE_dotProduct_apply x ▸ EF.coe_eq_coe_iff diff --git a/LeanPool/EcTateLean/Algebra/EllipticCurve/Kronecker.lean b/LeanPool/EcTateLean/Algebra/EllipticCurve/Kronecker.lean index cc30e9ca9a..ec3babea69 100644 --- a/LeanPool/EcTateLean/Algebra/EllipticCurve/Kronecker.lean +++ b/LeanPool/EcTateLean/Algebra/EllipticCurve/Kronecker.lean @@ -6,7 +6,7 @@ Authors: Alex J. Best import Mathlib.Data.Int.Basic import Mathlib.Data.Nat.Basic -import Mathlib.Logic.Basic +import Mathlib.Basic.Logic.Basic import Mathlib.Tactic.Common import Mathlib.Data.Nat.Order.Lemmas import Mathlib.Data.Nat.ModEq diff --git a/LeanPool/EhrhartVolumeInequality/Convergence.lean b/LeanPool/EhrhartVolumeInequality/Convergence.lean index 92e3a14fd3..4ff2aa3af4 100644 --- a/LeanPool/EhrhartVolumeInequality/Convergence.lean +++ b/LeanPool/EhrhartVolumeInequality/Convergence.lean @@ -1428,7 +1428,7 @@ private theorem measurable_finiteEnergySourceLegendreGradient Measurable (SpatialBergmanFatouScheffe.actualGradient (legendreTransform F.potential)) := by - apply measurable_pi_lambda + apply Measurable.of_eval intro i exact measurable_fderiv_apply_const ℝ (legendreTransform F.potential) diff --git a/LeanPool/EhrhartVolumeInequality/Foundations.lean b/LeanPool/EhrhartVolumeInequality/Foundations.lean index 07c39a2d05..88d5f85623 100644 --- a/LeanPool/EhrhartVolumeInequality/Foundations.lean +++ b/LeanPool/EhrhartVolumeInequality/Foundations.lean @@ -7400,7 +7400,7 @@ private theorem measurable_finiteEnergySourceGradient Measurable (SpatialBergmanFatouScheffe.actualGradient (F.potential : Space n → ℝ)) := by - apply measurable_pi_lambda + apply Measurable.of_eval intro i exact measurable_fderiv_apply_const ℝ (F.potential : Space n → ℝ) diff --git a/LeanPool/EhrhartVolumeInequality/FourierAnalysis.lean b/LeanPool/EhrhartVolumeInequality/FourierAnalysis.lean index f3f6c8494f..6c589da55b 100644 --- a/LeanPool/EhrhartVolumeInequality/FourierAnalysis.lean +++ b/LeanPool/EhrhartVolumeInequality/FourierAnalysis.lean @@ -1524,7 +1524,7 @@ private theorem angularCoverProjection_measurePreserving {n : ℕ} unfold angularFundamentalBox exact MeasurableSet.univ_pi' (fun _ => measurableSet_Ioc) have hp : Measurable (angularCoverProjection n) := by - apply measurable_pi_lambda + apply Measurable.of_eval intro i exact AddCircle.measurable_mk'.comp (measurable_pi_apply i) refine ⟨hp, ?_⟩ @@ -7652,7 +7652,7 @@ theorem complexLp_norm_le_of_ae_norm_le ‖hf.toLp f‖ ≤ C * ‖hg.toLp g‖ := by have hsemi := MeasureTheory.eLpNorm_le_mul_eLpNorm_of_ae_le_mul - hbound (2 : ℝ≥0∞) + hf.aestronglyMeasurable hbound (2 : ℝ≥0∞) have htop : ENNReal.ofReal C * eLpNorm g 2 μ ≠ ⊤ := ENNReal.mul_ne_top ENNReal.ofReal_ne_top hg.eLpNorm_ne_top diff --git a/LeanPool/EhrhartVolumeInequality/Regularization.lean b/LeanPool/EhrhartVolumeInequality/Regularization.lean index 78a464d85c..aff4a4aea6 100644 --- a/LeanPool/EhrhartVolumeInequality/Regularization.lean +++ b/LeanPool/EhrhartVolumeInequality/Regularization.lean @@ -2423,6 +2423,8 @@ private theorem contDiff_sourceJointTrueRadialSmoothed {n : ℕ} (volume : Measure (SourceJointComplexCover n))) (k : ℕ) : ContDiff ℝ ∞ (sourceJointTrueRadialSmoothed f k) := by + -- Discharged up front: inlined, this search exceeds `synthInstance.maxSize`. + have : (volume : Measure (SourceJointComplexCover n)).IsNegInvariant := inferInstance exact (hasCompactSupport_sourceJointTrueRadialMollifier n k).contDiff_convolution_left (ContinuousLinearMap.lsmul ℝ ℝ) (contDiff_sourceJointTrueRadialMollifier n k) hf @@ -4681,7 +4683,7 @@ private theorem integral_momentTorusRepresentative_normSq (MeasureTheory.L2.inner_def f f).symm _ = ((‖s‖ ^ 2 : ℝ) : ℂ) := by rw [inner_self_eq_norm_sq_to_K] - simp only [Complex.coe_algebraMap, Submodule.coe_norm, Complex.ofReal_pow, f] + simp only [Complex.coe_algebraMap, ← Submodule.norm_coe, Complex.ofReal_pow, f] exact Complex.ofReal_injective hcomplex private theorem integral_momentTorusRepresentative_jetBasis diff --git a/LeanPool/EhrhartVolumeInequality/Variation.lean b/LeanPool/EhrhartVolumeInequality/Variation.lean index e6206939d7..0d0f664123 100644 --- a/LeanPool/EhrhartVolumeInequality/Variation.lean +++ b/LeanPool/EhrhartVolumeInequality/Variation.lean @@ -8295,7 +8295,7 @@ private theorem jointRealCoordinate_sourcePositiveJointTimePoint private theorem measurable_sourceTorusCoverPoint {n : ℕ} : Measurable (sourceTorusCoverPoint (n := n)) := by - apply measurable_pi_lambda + apply Measurable.of_eval intro i have hangle : Measurable diff --git a/LeanPool/Erdos137/Base.lean b/LeanPool/Erdos137/Base.lean index e7929a67fb..5b704dbf29 100644 --- a/LeanPool/Erdos137/Base.lean +++ b/LeanPool/Erdos137/Base.lean @@ -126,7 +126,7 @@ theorem pow_le_F {k n : ℕ} : n ^ k ≤ F k n := by unfold F calc n ^ k = ∏ _i ∈ Finset.range k, n := by rw [Finset.prod_const, Finset.card_range] _ ≤ ∏ i ∈ Finset.range k, (n + i) := - Finset.prod_le_prod' (fun i _ => Nat.le_add_right n i) + Finset.prod_le_prod (fun i _ => Nat.le_add_right n i) /-! ## Counting multiples of a prime in an interval (for the overlap bound) -/ @@ -187,10 +187,10 @@ def P (k : ℕ) : ℕ := ∏ p ∈ Nat.primesBelow k, p def L (k : ℕ) : ℕ := ∏ p ∈ Nat.primesBelow k, p ^ (k / p) lemma P_pos (k : ℕ) : 1 ≤ P k := - Finset.one_le_prod' fun _p hp => (Nat.prime_of_mem_primesBelow hp).one_le + Finset.one_le_prod fun _p hp => (Nat.prime_of_mem_primesBelow hp).one_le lemma L_pos (k : ℕ) : 1 ≤ L k := - Finset.one_le_prod' fun _p hp => Nat.one_le_pow _ _ (Nat.prime_of_mem_primesBelow hp).pos + Finset.one_le_prod fun _p hp => Nat.one_le_pow _ _ (Nat.prime_of_mem_primesBelow hp).pos lemma L_ne_zero (k : ℕ) : L k ≠ 0 := Nat.one_le_iff_ne_zero.mp (L_pos k) @@ -226,11 +226,11 @@ lemma Ssmooth_mul_Rrough {k n : ℕ} (hn : 1 ≤ n) : Ssmooth k n * Rrough k n = rw [Nat.prod_factorization_eq_prod_primeFactors] lemma Ssmooth_pos {k n : ℕ} (_hn : 1 ≤ n) : 1 ≤ Ssmooth k n := - Finset.one_le_prod' fun _p hp => + Finset.one_le_prod fun _p hp => Nat.one_le_pow _ _ (Nat.prime_of_mem_primeFactors (Finset.mem_of_mem_filter _ hp)).pos lemma Rrough_pos {k n : ℕ} (_hn : 1 ≤ n) : 1 ≤ Rrough k n := - Finset.one_le_prod' fun _p hp => + Finset.one_le_prod fun _p hp => Nat.one_le_pow _ _ (Nat.prime_of_mem_primeFactors (Finset.mem_of_mem_filter _ hp)).pos /-! ## Bound on the smooth radical: `rad(S)^2 ≤ P^2` -/ @@ -257,7 +257,7 @@ lemma rough_sq_le {k n : ℕ} (hF : F k n ≠ 0) (hP : Powerful (F k n)) : (∏ p ∈ (F k n).primeFactors.filter (fun p => ¬ p < k), p) ^ 2 ≤ Rrough k n := by unfold Rrough rw [← Finset.prod_pow] - apply Finset.prod_le_prod' + apply Finset.prod_le_prod intro p hp rw [Finset.mem_filter] at hp have hpp : p.Prime := Nat.prime_of_mem_primeFactors hp.1 diff --git a/LeanPool/Erdos137/Finiteness.lean b/LeanPool/Erdos137/Finiteness.lean index e2a2a6deba..fe9607ec2b 100644 --- a/LeanPool/Erdos137/Finiteness.lean +++ b/LeanPool/Erdos137/Finiteness.lean @@ -102,7 +102,7 @@ lemma factor_le_mul {k n i : ℕ} (_hk : 1 ≤ k) (hn : 1 ≤ n) (hi : i < k) : F(k, n) ≤ (k * n) ^ k for n ≥ 1, k ≥ 1. -/ lemma F_le_pow {k n : ℕ} (hk : 1 ≤ k) (hn : 1 ≤ n) : F k n ≤ (k * n) ^ k := by - exact le_trans ( Finset.prod_le_prod' fun _ _ => factor_le_mul hk hn ( Finset.mem_range.mp ‹_› ) ) + exact le_trans ( Finset.prod_le_prod fun _ _ => factor_le_mul hk hn ( Finset.mem_range.mp ‹_› ) ) ( by norm_num ) /-! ### LEMMA STAR -/ @@ -129,7 +129,7 @@ theorem lemma_star (m : ℕ) (hm : m ≠ 0) : rad m ^ 2 * B2 m ≤ m ^ 2 := by rw [ ← Finset.prod_pow ]; rw [ Finset.prod_filter ]; rw [ ← Finset.prod_mul_distrib ]; congr; ext; split_ifs <;> ring; rw [ h_factorization, h_rad_B2 ]; - exact Finset.prod_le_prod' fun p hp => Nat.pow_le_pow_right ( Nat.pos_of_mem_primeFactors hp ) + exact Finset.prod_le_prod fun p hp => Nat.pow_le_pow_right ( Nat.pos_of_mem_primeFactors hp ) ( by split_ifs <;> linarith [ Nat.pos_of_ne_zero ( Finsupp.mem_support_iff.mp hp ) ] ) /-! ### Bridge to ℝ -/ diff --git a/LeanPool/Erdos137/RefinedOverlap.lean b/LeanPool/Erdos137/RefinedOverlap.lean index 0ab9f39b41..e7633736e1 100644 --- a/LeanPool/Erdos137/RefinedOverlap.lean +++ b/LeanPool/Erdos137/RefinedOverlap.lean @@ -103,7 +103,7 @@ def WgRefinedCap (g k : ℕ) : ℕ := ∏ p ∈ Nat.primesBelow (k + 1), p ^ min /-- `1 ≤ WgRefinedCap g k` (empty/prime-power factors are all `≥ 1`). Mirrors `smoothCapacity_pos`. -/ lemma wgRefinedCap_pos (g k : ℕ) : 1 ≤ WgRefinedCap g k := - Finset.one_le_prod' fun _p hp => Nat.one_le_pow _ _ (Nat.prime_of_mem_primesBelow hp).pos + Finset.one_le_prod fun _p hp => Nat.one_le_pow _ _ (Nat.prime_of_mem_primesBelow hp).pos lemma wgRefinedCap_ne_zero (g k : ℕ) : WgRefinedCap g k ≠ 0 := Nat.one_le_iff_ne_zero.mp (wgRefinedCap_pos g k) diff --git a/LeanPool/Erdos137/RoughPartStructure.lean b/LeanPool/Erdos137/RoughPartStructure.lean index e0d8fab8b2..7cb1f07792 100644 --- a/LeanPool/Erdos137/RoughPartStructure.lean +++ b/LeanPool/Erdos137/RoughPartStructure.lean @@ -35,12 +35,12 @@ def RoughPartAbove (k m : ℕ) : ℕ := lemma smoothPartBelow_pos (k m : ℕ) : 1 ≤ SmoothPartBelow k m := by unfold SmoothPartBelow - exact Finset.one_le_prod' fun p hp => + exact Finset.one_le_prod fun p hp => Nat.one_le_pow _ _ (Nat.prime_of_mem_primeFactors (Finset.mem_of_mem_filter _ hp)).pos lemma roughPartAbove_pos (k m : ℕ) : 1 ≤ RoughPartAbove k m := by unfold RoughPartAbove - exact Finset.one_le_prod' fun p hp => + exact Finset.one_le_prod fun p hp => Nat.one_le_pow _ _ (Nat.prime_of_mem_primeFactors (Finset.mem_of_mem_filter _ hp)).pos lemma roughPartAbove_ne_zero (k m : ℕ) : RoughPartAbove k m ≠ 0 := @@ -63,8 +63,8 @@ lemma factorization_roughPartAbove (k m p : ℕ) : (RoughPartAbove k m).factorization p = if p ∈ m.primeFactors.filter (fun q => ¬ q < k) then m.factorization p else 0 := by unfold RoughPartAbove - rw [Nat.factorization_prod (by - simp_all)] + rw [Nat.factorization_prod fun q hq => + pow_ne_zero _ (Nat.prime_of_mem_primeFactors (Finset.mem_of_mem_filter _ hq)).ne_zero] rw [Finset.sum_apply'] by_cases hp : p ∈ m.primeFactors.filter (fun q => ¬ q < k) · rw [ite_eq_left hp] diff --git a/LeanPool/Erdos137/SquarefreeCapacity.lean b/LeanPool/Erdos137/SquarefreeCapacity.lean index de00ee5eda..9d960ee3c6 100644 --- a/LeanPool/Erdos137/SquarefreeCapacity.lean +++ b/LeanPool/Erdos137/SquarefreeCapacity.lean @@ -97,7 +97,7 @@ lemma sqfreeBlockProduct_ne_zero {k n : ℕ} (hn : 1 ≤ n) : SqfreeBlockProduct intro i _; omega lemma smoothCapacity_pos (k : ℕ) : 1 ≤ SmoothCapacity k := - Finset.one_le_prod' fun _p hp => Nat.one_le_pow _ _ (Nat.prime_of_mem_primesBelow hp).pos + Finset.one_le_prod fun _p hp => Nat.one_le_pow _ _ (Nat.prime_of_mem_primesBelow hp).pos lemma smoothCapacity_ne_zero (k : ℕ) : SmoothCapacity k ≠ 0 := Nat.one_le_iff_ne_zero.mp (smoothCapacity_pos k) @@ -266,7 +266,7 @@ lemma sqfreeBlockProduct_ge_pow {k n : ℕ} : calc n ^ (SqfreeBlockIndices k n).card = ∏ _i ∈ SqfreeBlockIndices k n, n := by rw [Finset.prod_const] _ ≤ ∏ i ∈ SqfreeBlockIndices k n, (n + i) := - Finset.prod_le_prod' (fun i _ => Nat.le_add_right n i) + Finset.prod_le_prod (fun i _ => Nat.le_add_right n i) /-- Counting form of the squarefree-capacity obstruction. -/ theorem powerful_sqfree_count_capacity_bound {k n : ℕ} diff --git a/LeanPool/Erdos367/Core4027.lean b/LeanPool/Erdos367/Core4027.lean index 283d5b51a1..5b652d3fc4 100644 --- a/LeanPool/Erdos367/Core4027.lean +++ b/LeanPool/Erdos367/Core4027.lean @@ -81,14 +81,15 @@ If `d ^ 3 ∣ M` (and `M > 0`), then `d ^ 3 ∣ rFullPart 3 M`. -/ theorem pow_dvd_rFullPart (M d : ℕ) (hM : 0 < M) (hd : d ^ 3 ∣ M) : d ^ 3 ∣ rFullPart 3 M := by - rw [ ← Nat.factorization_le_iff_dvd ] at *; - · intro q; by_cases hq : Nat.Prime q <;> simp_all +decide ; - have := hd q; simp_all +decide [ rFullPart_factorization ] ; - grind; - · aesop; - · positivity; - · aesop; - · exact rFullPart_ne_zero 3 M + have hd0 : d ^ 3 ≠ 0 := fun h => hM.ne' (Nat.eq_zero_of_zero_dvd (h ▸ hd)) + rw [← Nat.factorization_le_iff_dvd hd0 hM.ne'] at hd + rw [← Nat.factorization_le_iff_dvd hd0 (rFullPart_ne_zero 3 M), Finsupp.le_def] + intro q + have hq := Finsupp.le_def.mp hd q + rw [rFullPart_factorization] + rw [Nat.factorization_pow] at hq ⊢ + simp only [Finsupp.smul_apply, smul_eq_mul] at hq ⊢ + split_ifs with h <;> omega /-! ## The key algebraic identity -/ diff --git a/LeanPool/Erdos367/GeneralKUpperBound.lean b/LeanPool/Erdos367/GeneralKUpperBound.lean index 583d8d9400..84ca01e515 100644 --- a/LeanPool/Erdos367/GeneralKUpperBound.lean +++ b/LeanPool/Erdos367/GeneralKUpperBound.lean @@ -91,7 +91,7 @@ F(k, n) ≤ (k * n) ^ k for n ≥ 1, k ≥ 1. -/ lemma F_le_pow {k n : ℕ} (hk : 1 ≤ k) (hn : 1 ≤ n) : F k n ≤ (k * n) ^ k := by exact le_trans - (Finset.prod_le_prod' fun _ _ => factor_le_mul hk hn (Finset.mem_range.mp ‹_›)) + (Finset.prod_le_prod fun _ _ => factor_le_mul hk hn (Finset.mem_range.mp ‹_›)) (by norm_num) /-! ### LEMMA STAR -/ @@ -124,7 +124,7 @@ theorem lemma_star (m : ℕ) (hm : m ≠ 0) : rad m ^ 2 * B2 m ≤ m ^ 2 := by rw [ ← Finset.prod_pow ]; rw [ Finset.prod_filter ]; rw [ ← Finset.prod_mul_distrib ]; congr; ext; split_ifs <;> ring; rw [ h_factorization, h_rad_B2 ]; - exact Finset.prod_le_prod' fun p hp => + exact Finset.prod_le_prod fun p hp => Nat.pow_le_pow_right (Nat.pos_of_mem_primeFactors hp) (by split_ifs <;> linarith [Nat.pos_of_ne_zero (Finsupp.mem_support_iff.mp hp)]) diff --git a/LeanPool/Erdos367/K3AbcUpperBound.lean b/LeanPool/Erdos367/K3AbcUpperBound.lean index 0de92437a4..e1f56d7d63 100644 --- a/LeanPool/Erdos367/K3AbcUpperBound.lean +++ b/LeanPool/Erdos367/K3AbcUpperBound.lean @@ -7,9 +7,9 @@ Authors: Scott D. Hughes import Mathlib.Algebra.Order.Ring.Nat import Mathlib.Algebra.Order.BigOperators.GroupWithZero.Finset import Mathlib.Analysis.SpecialFunctions.Pow.Real +import Mathlib.Basic.Real.Basic import Mathlib.Data.Nat.Factorization.Defs import Mathlib.Data.Nat.PrimeFin -import Mathlib.Data.Real.Basic import Mathlib.Tactic.Convert import Mathlib.Tactic.GCongr import Mathlib.Tactic.IntervalCases @@ -85,14 +85,13 @@ theorem lemma_star (m : ℕ) (hm : 0 < m) : (Nat.primeFactors m).prod (fun p => p ^ 2 * if 2 ≤ m.factorization p then p ^ m.factorization p else 1) ≤ (Nat.primeFactors m).prod (fun p => p ^ (2 * m.factorization p)) := by - refine Finset.prod_le_prod' ?_ + refine Finset.prod_le_prod ?_ intro p hp split_ifs with h_factorization · rw [← pow_add] exact Nat.pow_le_pow_right (Nat.prime_of_mem_primeFactors hp).one_lt.le (by nlinarith) · interval_cases _ : m.factorization p <;> simp_all +decide [Nat.pow_succ'] - simp_all +decide [ Nat.factorization_eq_zero_iff ]; -- By definition of $rad$ and $powerfulPart$, we can rewrite the left-hand side of the inequality. simp only [Nat.rad, Nat.powerfulPart, ge_iff_le] at * convert h_term_by_term using 1 diff --git a/LeanPool/Erdos367/PellLimsup.lean b/LeanPool/Erdos367/PellLimsup.lean index b5befee8bd..0663afccc8 100644 --- a/LeanPool/Erdos367/PellLimsup.lean +++ b/LeanPool/Erdos367/PellLimsup.lean @@ -804,7 +804,7 @@ lemma erdos367_key (j₀ : ℕ) : _ ≤ (p + 1) / 2 * p := Nat.mul_le_mul h1 hp5le have h2card : 2 ^ S.card ≤ L := by calc 2 ^ S.card = ∏ _p ∈ S, 2 := by rw [Finset.prod_const] - _ ≤ L := Finset.prod_le_prod' hfac + _ ≤ L := Finset.prod_le_prod hfac have hcard_le : S.card ≤ 2 ^ S.card := Nat.lt_two_pow_self.le have hj0_le_L : 2 * j₀ ≤ L := le_trans hS_card_j (le_trans hcard_le h2card) omega @@ -844,13 +844,13 @@ lemma erdos367_key (j₀ : ℕ) : have h_lower_le_sq : (∏ p ∈ S, (5 / 3 : ℝ) * (((p : ℝ) + 1) / 2 * p)) ≤ ∏ p ∈ S, (p : ℝ) ^ 2 := - Finset.prod_le_prod h_lower_nonneg h_prod_sq_ge + Finset.prod_le_prod₀ h_lower_nonneg h_prod_sq_ge have hL_le : (L : ℝ) ≤ ∏ p ∈ S, (((p : ℝ) + 1) / 2 * p) := by change ((S.prod (fun p => (p + 1) / 2 * p) : ℕ) : ℝ) ≤ ∏ p ∈ S, (((p : ℝ) + 1) / 2 * p) rw [Nat.cast_prod] - exact Finset.prod_le_prod (fun p hp => by positivity) fun p hp => by + exact Finset.prod_le_prod₀ (fun p hp => by positivity) fun p hp => by rw [Nat.cast_mul] have hdiv : (((p + 1) / 2 : ℕ) : ℝ) ≤ ((p : ℝ) + 1) / 2 := by rw [le_div_iff₀ (by positivity : (0 : ℝ) < 2)] diff --git a/LeanPool/Erdos367/RFullLowerBound.lean b/LeanPool/Erdos367/RFullLowerBound.lean index c0d5d8d66f..54bed1ed36 100644 --- a/LeanPool/Erdos367/RFullLowerBound.lean +++ b/LeanPool/Erdos367/RFullLowerBound.lean @@ -74,7 +74,8 @@ lemma rFullPart_dvd (r m : ℕ) (hm : m ≠ 0) : rFullPart r m ∣ m := by unfold rFullPart simpa [Finsupp.prod, Finset.prod_ite] using (Finset.prod_congr rfl fun x hx => by - simp_all) + have hxr := (Finset.mem_filter.mp hx).2 + simp [hxr]) conv_rhs => rw [← Nat.prod_factorization_pow_eq_self hm] exact h_factorization.symm ▸ Finset.prod_dvd_prod_of_dvd _ _ fun p hp => by diff --git a/LeanPool/EventStructures/FinitePoset.lean b/LeanPool/EventStructures/FinitePoset.lean index 000cc33fa4..19511c4f7c 100644 --- a/LeanPool/EventStructures/FinitePoset.lean +++ b/LeanPool/EventStructures/FinitePoset.lean @@ -26,7 +26,7 @@ lemma Finset.exists_minimal_of_nonempty {α : Type*} [PartialOrder α] [WellFoun obtain ⟨m, hmT, hmmin, _⟩ := this x₀ hx₀ exact ⟨m, hmT, hmmin⟩ intro x - apply (IsWellFounded.wf (r := (· < ·))).induction x + apply (wellFounded_lt (α := α)).induction x intro z ih hz by_cases hmin : ∀ y ∈ T, y < z → False · exact ⟨z, hz, hmin, le_rfl⟩ diff --git a/LeanPool/Feige/Grunbaum/Main.lean b/LeanPool/Feige/Grunbaum/Main.lean index 48c0734718..c9e703519d 100644 --- a/LeanPool/Feige/Grunbaum/Main.lean +++ b/LeanPool/Feige/Grunbaum/Main.lean @@ -6,7 +6,6 @@ Authors: OpenAI import LeanPool.Feige.Grunbaum.ProbabilityCore import LeanPool.Feige.Grunbaum.TruncationConcavity import LeanPool.Feige.Grunbaum.FinalBridge -import Mathlib.MeasureTheory.Measure.MeasureSpace import Mathlib.MeasureTheory.Measure.Restrict /-! @@ -112,7 +111,7 @@ theorem cdfRoot_centroid_lower_bound {d : ℕ} isProbabilityMeasure_uniformVolume (C : Set (Euc d)) C.volume_ne_zero C.volume_ne_top let : IsProbabilityMeasure ν := by - exact Measure.isProbabilityMeasure_map ℓ.measurable.aemeasurable + exact inferInstanceAs (IsProbabilityMeasure (μ.map ℓ)) let : NullSingletonClass ν := by change NullSingletonClass ((uniformVolume (C : Set (Euc d))).map ℓ) exact nullSingletonClass_map_uniform (C : Set (Euc d)) ℓ hℓ diff --git a/LeanPool/Feige/IndependentCalibrationAssembly.lean b/LeanPool/Feige/IndependentCalibrationAssembly.lean index 3cea96907d..66d2eaa3d7 100644 --- a/LeanPool/Feige/IndependentCalibrationAssembly.lean +++ b/LeanPool/Feige/IndependentCalibrationAssembly.lean @@ -42,7 +42,7 @@ theorem universalCalibration_dirichletK_of_twoPointRejectionBound have hZindep : iIndepFun Z μ := meanOneNormalize_iIndepFun Y hYindep let hmarginal : ∀ i, IsProbabilityMeasure (marginal i) := - fun i ↦ Measure.isProbabilityMeasure_map (hZmeas i).aemeasurable + fun i ↦ inferInstanceAs (IsProbabilityMeasure (μ.map (Z i))) have hmarginalInt : ∀ i, Integrable (fun x : ℝ ↦ x) (marginal i) := fun i ↦ integrable_id_map (hZmeas i) (hZint i) @@ -88,7 +88,7 @@ theorem universalCalibration_dirichletK_of_twoPointRejectionBound _ = (μ.map (fun ω i ↦ Z i ω)).real {y | dirichletK y ≤ α} := by exact (map_measureReal_apply - (measurable_pi_lambda _ hZmeas) + (Measurable.of_eval hZmeas) (measurableSet_dirichletK_le α)).symm _ = (Measure.pi marginal).real {y | dirichletK y ≤ α} := by rw [hjoint] diff --git a/LeanPool/Feige/InsertionCommonLaw.lean b/LeanPool/Feige/InsertionCommonLaw.lean index ab55b25d3b..9eb07fcbf9 100644 --- a/LeanPool/Feige/InsertionCommonLaw.lean +++ b/LeanPool/Feige/InsertionCommonLaw.lean @@ -56,8 +56,7 @@ noncomputable def stateLaw (γ β : ι → ℝ) (S : Finset ι) : Measure ℝ := instance stateLaw_isProbability (γ β : ι → ℝ) (S : Finset ι) : IsProbabilityMeasure (stateLaw γ β S) := by unfold stateLaw - exact Measure.isProbabilityMeasure_map - (measurable_stateSignedSum γ β S).aemeasurable + infer_instance /-- The original event in the definition of `K` is exactly nonnegativity of the signed sum. -/ diff --git a/LeanPool/Feige/InsertionTerminalLaw.lean b/LeanPool/Feige/InsertionTerminalLaw.lean index 1fed3c5fee..a931e15cfa 100644 --- a/LeanPool/Feige/InsertionTerminalLaw.lean +++ b/LeanPool/Feige/InsertionTerminalLaw.lean @@ -39,8 +39,7 @@ instance terminalCommonLaw_isProbability {n : ℕ} (β : Fin (n + 1) → ℝ) : IsProbabilityMeasure (terminalCommonLaw β) := by unfold terminalCommonLaw - exact Measure.isProbabilityMeasure_map - (measurable_terminalCommonSignedSum β).aemeasurable + infer_instance theorem terminalCommonLaw_Ioi_zero {n : ℕ} (β : Fin (n + 1) → ℝ) (hβ : ∀ i, 0 < β i) : diff --git a/LeanPool/Feige/KStatistic.lean b/LeanPool/Feige/KStatistic.lean index 403440d6a5..72fc642981 100644 --- a/LeanPool/Feige/KStatistic.lean +++ b/LeanPool/Feige/KStatistic.lean @@ -43,8 +43,8 @@ noncomputable instance nnexpMeasure.isProbabilityMeasure : IsProbabilityMeasure nnexpMeasure := by let : IsProbabilityMeasure (expMeasure 1) := isProbabilityMeasure_expMeasure zero_lt_one - exact Measure.isProbabilityMeasure_map - (μ := expMeasure 1) measurable_real_toNNReal.aemeasurable + unfold nnexpMeasure + infer_instance /-- The joint law of `E₀` and an `ι`-indexed family of independent rate-one exponentials. -/ diff --git a/LeanPool/Feige/RecursiveLatentProbability.lean b/LeanPool/Feige/RecursiveLatentProbability.lean index c6d9200d75..6a835acb3c 100644 --- a/LeanPool/Feige/RecursiveLatentProbability.lean +++ b/LeanPool/Feige/RecursiveLatentProbability.lean @@ -33,8 +33,7 @@ instance recursiveAugmentedLatent_isProbability (fun i ↦ latent (Fin.succ i))) := ih (fun i ↦ latent (Fin.succ i)) unfold recursiveAugmentedLatent - exact Measure.isProbabilityMeasure_map - (finHeadTailEquiv AugmentedTwoPointParams n).symm.measurable.aemeasurable + infer_instance end diff --git a/LeanPool/Feige/SimplexExponentialIdentification.lean b/LeanPool/Feige/SimplexExponentialIdentification.lean index b40d40bbc1..616501a188 100644 --- a/LeanPool/Feige/SimplexExponentialIdentification.lean +++ b/LeanPool/Feige/SimplexExponentialIdentification.lean @@ -302,7 +302,7 @@ theorem measurable_nnrealNormalizedCoordinates : Measurable (nnrealNormalizedCoordinates : (Option (Fin n) → NNReal) → (Fin n → ℝ)) := by unfold nnrealNormalizedCoordinates - apply measurable_pi_lambda + apply Measurable.of_eval intro i exact ((measurable_pi_apply (some i)).coe_nnreal_real).div measurable_nnrealExponentialTotal diff --git a/LeanPool/Feige/TransferAlgebra.lean b/LeanPool/Feige/TransferAlgebra.lean index 88af5ad7c0..8f3f0a14c9 100644 --- a/LeanPool/Feige/TransferAlgebra.lean +++ b/LeanPool/Feige/TransferAlgebra.lean @@ -3,7 +3,7 @@ Copyright (c) 2026 Zhengqing Zhou and contributors. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Zhengqing Zhou, GPT-5.6 Pro -/ -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic import Mathlib.Tactic.FieldSimp import Mathlib.Tactic.LinearCombination import Mathlib.Tactic.Ring diff --git a/LeanPool/Feige/TwoPointBoundary.lean b/LeanPool/Feige/TwoPointBoundary.lean index 99db85ed1d..5d7e79d598 100644 --- a/LeanPool/Feige/TwoPointBoundary.lean +++ b/LeanPool/Feige/TwoPointBoundary.lean @@ -61,7 +61,7 @@ theorem tendsto_strictGammaApprox {m : ℕ} (γ : Fin m → ℝ) : unfold strictGammaApprox convert (((tendsto_const_nhds.sub tendsto_boundaryEpsilon).mul tendsto_const_nhds).add (tendsto_boundaryEpsilon.div_const 2)) using 1 - ring + ring_nf theorem tendsto_twoPointKFinset_strictGammaApprox {m : ℕ} (γ β : Fin m → ℝ) (S : Finset (Fin m)) : diff --git a/LeanPool/Flean/Rounding.lean b/LeanPool/Flean/Rounding.lean index 8d98f95133..f0f106660b 100644 --- a/LeanPool/Flean/Rounding.lean +++ b/LeanPool/Flean/Rounding.lean @@ -454,7 +454,6 @@ lemma roundf_up_minus_down {q : ℚ} (q_nezero : q ≠ 0) : · rw [Nat.cast_natAbs] nth_rw 5 [abs_of_nonneg] · convert this using 1 - · rfl ring · apply Int.floor_nonneg.mpr apply mantissa_nonneg C q q_nezero diff --git a/LeanPool/FltRegular/NumberTheory/Hilbert92.lean b/LeanPool/FltRegular/NumberTheory/Hilbert92.lean index b68ef49534..9d05c1335f 100644 --- a/LeanPool/FltRegular/NumberTheory/Hilbert92.lean +++ b/LeanPool/FltRegular/NumberTheory/Hilbert92.lean @@ -117,7 +117,7 @@ lemma lemma2 [Module A G] (S : systemOfUnits p G s) (hs : S.IsFundamental) · rw [Finsupp.mapDomain_of_notMem_range, zero_add, hij] rwa [← this] · obtain ⟨j, rfl⟩ := not_imp_comm.mp this.mpr hij - rw [Finsupp.mapDomain_apply Fin.succAbove_right_injective, add_zero, + rw [Finsupp.mapDomain_apply_of_injective Fin.succAbove_right_injective, add_zero, Finsupp.comapDomain_apply] have := S'.isMaximal p hp G hf suffices Submodule.span A (Set.range S.units) < Submodule.span A (Set.range S'.units) by @@ -235,7 +235,7 @@ lemma relativeUnitsMap_mk (σ : K →ₐ[k] K) (x : (𝓞 K)ˣ) : private lemma relativeUnitsMap_addMonoidEndRingEquivInt_apply (σ : K →ₐ[k] K) (x : (𝓞 K)ˣ) : - (addMonoidEndRingEquivInt _ (MulEquiv.Monoid.End (relativeUnitsMap σ))) + (addMonoidEndRingEquivInt _ (MulEquiv.monoidEnd _ (relativeUnitsMap σ))) (Additive.ofMul (QuotientGroup.mk x)) = Additive.ofMul (QuotientGroup.mk (Units.map (galRestrictHom (𝓞 k) k K (𝓞 K) σ) x)) := by @@ -280,7 +280,7 @@ include σ hp hKL hσ in open Polynomial in lemma isTors' [IsGalois k K] : Module.IsTorsionBySet ℤ[X] (Module.AEval' (addMonoidEndRingEquivInt _ - (MulEquiv.Monoid.End <| relativeUnitsMapHom <| + (MulEquiv.monoidEnd _ <| relativeUnitsMapHom <| ((AlgEquiv.algHomUnitsEquiv _ _).symm σ).val))) (Ideal.span {cyclotomic p ℤ}) := by classical @@ -552,7 +552,7 @@ instance relativeUnitsModule : Module A G := by lemma relativeUnitsModule_zeta_smul (x) : (zeta p) • mkG x = mkG (Units.map (galRestrictHom (𝓞 k) k K (𝓞 K) σ) x) := by let φ := (addMonoidEndRingEquivInt _ - (MulEquiv.Monoid.End <| relativeUnitsMap <| ((AlgEquiv.algHomUnitsEquiv _ _).symm σ).val)) + (MulEquiv.monoidEnd _ <| relativeUnitsMap <| ((AlgEquiv.algHomUnitsEquiv _ _).symm σ).val)) change QuotientAddGroup.mk ((Module.AEval'.of φ).symm <| Polynomial.X (R := ℤ) • Module.AEval'.of φ (Additive.ofMul (QuotientGroup.mk x))) = _ simp only [Module.AEval.of_symm_smul, Polynomial.aeval_X, diff --git a/LeanPool/FltRegular/NumberTheory/Unramified.lean b/LeanPool/FltRegular/NumberTheory/Unramified.lean index 5a8e3fbe72..62c1f27a36 100644 --- a/LeanPool/FltRegular/NumberTheory/Unramified.lean +++ b/LeanPool/FltRegular/NumberTheory/Unramified.lean @@ -56,7 +56,7 @@ lemma comap_map_eq_of_unramified [IsGalois K L] [Algebra.Unramified R S] (I : Id by_cases hIbot : I = ⊥ · rw [hIbot, Ideal.comap_bot_of_injective _ hRS, Ideal.map_bot] have : Algebra.IsIntegral R S := IsIntegralClosure.isIntegral_algebra R L - have hIbot' : I.comap (algebraMap R S) ≠ ⊥ := mt Ideal.eq_bot_of_comap_eq_bot hIbot + have hIbot' : I.comap (algebraMap R S) ≠ ⊥ := mt Ideal.eq_bot_of_under_eq_bot hIbot have : ∀ p, (p.IsPrime ∧ I.comap (algebraMap R S) ≤ p) → ∃ P ≥ I, P ∈ primesOver p S := by intro p ⟨hp₁, hp₂⟩ diff --git a/LeanPool/FormalLearningTheory/Basic.lean b/LeanPool/FormalLearningTheory/Basic.lean index 8c836c8d54..3b8c9a45b9 100644 --- a/LeanPool/FormalLearningTheory/Basic.lean +++ b/LeanPool/FormalLearningTheory/Basic.lean @@ -5,7 +5,7 @@ Authors: Dhruv Gupta -/ import Mathlib.Order.BoundedOrder.Basic import Mathlib.Topology.Basic -import Mathlib.MeasureTheory.Measure.MeasureSpace +import Mathlib.MeasureTheory.Measure.Basic import Mathlib.Data.Finset.Basic /-! diff --git a/LeanPool/FormalLearningTheory/Complexity/Generalization/Core.lean b/LeanPool/FormalLearningTheory/Complexity/Generalization/Core.lean index 6145600744..c16afa3642 100644 --- a/LeanPool/FormalLearningTheory/Complexity/Generalization/Core.lean +++ b/LeanPool/FormalLearningTheory/Complexity/Generalization/Core.lean @@ -531,7 +531,7 @@ theorem consistent_tail_bound {X : Type u} [MeasurableSpace X] exact tsub_le_tsub_left herr 1 calc ∏ i : Fin m, D { x | h x = c x } ≤ ∏ _i : Fin m, ENNReal.ofReal (1 - ε) := - Finset.prod_le_prod' (fun i _ => hD_agree) + Finset.prod_le_prod (fun i _ => hD_agree) _ = ENNReal.ofReal (1 - ε) ^ m := by rw [Finset.prod_const, Finset.card_univ, Fintype.card_fin] _ = ENNReal.ofReal ((1 - ε) ^ m) := by rw [ENNReal.ofReal_pow (by linarith : (0 : ℝ) ≤ 1 - ε)] diff --git a/LeanPool/FormalLearningTheory/Complexity/Generalization/Tail.lean b/LeanPool/FormalLearningTheory/Complexity/Generalization/Tail.lean index 7e7ec1eac9..f952a6f5d6 100644 --- a/LeanPool/FormalLearningTheory/Complexity/Generalization/Tail.lean +++ b/LeanPool/FormalLearningTheory/Complexity/Generalization/Tail.lean @@ -35,7 +35,7 @@ lemma block_extract_disjoint (k m : ℕ) (j₁ j₂ : Fin k) (hne : j₁ ≠ j lemma block_extract_measurable {X : Type*} [MeasurableSpace X] (k m : ℕ) (j : Fin k) : Measurable (fun (ω : Fin (k * m) → X) => blockExtract k m ω j) := by - exact measurable_pi_lambda _ (fun i => measurable_pi_apply _) + exact Measurable.of_eval (fun i => measurable_pi_apply _) /-- Block extractions are independent under the product measure. Key infrastructure for boosting (D4) and probability amplification. -/ diff --git a/LeanPool/FormalLearningTheory/Complexity/Rademacher.lean b/LeanPool/FormalLearningTheory/Complexity/Rademacher.lean index ebb4fdc9c5..d971d2f77f 100644 --- a/LeanPool/FormalLearningTheory/Complexity/Rademacher.lean +++ b/LeanPool/FormalLearningTheory/Complexity/Rademacher.lean @@ -392,7 +392,7 @@ theorem rademacher_mgf_bound {m : ℕ} (hm : 0 < m) (a : Fin m → ℝ) (c : ℝ -- Step 4: Product inequality → exponential sum → final bound calc ∏ i : Fin m, (1 / 2 : ℝ) * ∑ b : Bool, Real.exp (t * a i * boolToSign b / ↑m) ≤ ∏ i : Fin m, Real.exp ((t * a i / ↑m) ^ 2 / 2) := - Finset.prod_le_prod h_factor_nonneg (fun i _ => h_factor_bound i) + Finset.prod_le_prod₀ h_factor_nonneg (fun i _ => h_factor_bound i) _ = Real.exp (∑ i : Fin m, (t * a i / ↑m) ^ 2 / 2) := (Real.exp_sum Finset.univ _).symm _ ≤ Real.exp (t ^ 2 * c ^ 2 / (2 * ↑m)) := by @@ -1178,7 +1178,7 @@ private theorem uniform_injective_tuple_measure_half calc ∏ k : Fin m, D_sub (if k = i then {t} else if k = j then {t} else Set.univ) ≤ ∏ k : Fin m, (if k = i ∨ k = j then 1 / (n : ENNReal) else 1) := by - apply Finset.prod_le_prod' + apply Finset.prod_le_prod intro k _; exact (hfact_eq k) ▸ (hfact_le k) _ = (1 / (n : ENNReal)) ^ 2 := by have hprod_ij : ∏ k : Fin m, @@ -1366,7 +1366,7 @@ theorem rademacher_lower_bound_on_shattered (X : Type u) [MeasurableSpace X] -- φ is a MeasurableEmbedding (injective, measurable, images of meas sets are meas). have hφ_emb : MeasurableEmbedding φ := by refine ⟨fun a b hab => funext (fun i => Subtype.val_injective (congr_fun hab i)), - measurable_pi_lambda _ (fun i => hval_meas.comp (measurable_pi_apply i)), + Measurable.of_eval (fun i => hval_meas.comp (measurable_pi_apply i)), fun s _ => ?_⟩ -- φ '' s ⊆ {xs | ∀ i, xs i ∈ T} which is finite, so φ '' s is finite, hence measurable. apply Set.Finite.measurableSet diff --git a/LeanPool/FormalLearningTheory/Complexity/Symmetrization.lean b/LeanPool/FormalLearningTheory/Complexity/Symmetrization.lean index 8e1b0c503a..86156a2a4e 100644 --- a/LeanPool/FormalLearningTheory/Complexity/Symmetrization.lean +++ b/LeanPool/FormalLearningTheory/Complexity/Symmetrization.lean @@ -770,7 +770,7 @@ theorem exchangeability_chain_bound {X : Type u} [MeasurableSpace X] [Infinite X let swap_fun (σ : SignVector m) : (Fin m → X × X) → (Fin m → X × X) := fun z i => if σ i then (z i).swap else z i have h_swap_meas : ∀ σ, Measurable (swap_fun σ) := by - intro σ; apply measurable_pi_lambda; intro i + intro σ; apply Measurable.of_eval; intro i by_cases hσi : σ i · simp only [swap_fun, hσi, ↓reduceIte] exact (measurable_pi_apply i |>.snd).prod (measurable_pi_apply i |>.fst) diff --git a/LeanPool/FormalLearningTheory/Data.lean b/LeanPool/FormalLearningTheory/Data.lean index 525ca87793..4cbccf87b8 100644 --- a/LeanPool/FormalLearningTheory/Data.lean +++ b/LeanPool/FormalLearningTheory/Data.lean @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Dhruv Gupta -/ import LeanPool.FormalLearningTheory.Basic -import Mathlib.MeasureTheory.Measure.MeasureSpace +import Mathlib.MeasureTheory.Measure.Basic import Mathlib.Probability.ProbabilityMassFunction.Basic /-! diff --git a/LeanPool/FormalLearningTheory/Learner/Closure.lean b/LeanPool/FormalLearningTheory/Learner/Closure.lean index 28b235fc5e..d0dd033469 100644 --- a/LeanPool/FormalLearningTheory/Learner/Closure.lean +++ b/LeanPool/FormalLearningTheory/Learner/Closure.lean @@ -56,7 +56,7 @@ theorem measurableBatchLearner_combine have hg : Measurable (fun p : (Fin m → X × Bool) × X => (p.2, fun i => (L i).learn p.1 p.2) : (Fin m → X × Bool) × X → X × (Fin k → Bool)) := Measurable.prodMk measurable_snd - (measurable_pi_lambda _ (fun i => (hL i).eval_measurable m)) + (Measurable.of_eval (fun i => (hL i).eval_measurable m)) exact hF.comp hg /-! ## Part 3: Boost learner via majority vote -/ diff --git a/LeanPool/FormalLearningTheory/PureMath/Concentration.lean b/LeanPool/FormalLearningTheory/PureMath/Concentration.lean index d351f73cda..f6d9397288 100644 --- a/LeanPool/FormalLearningTheory/PureMath/Concentration.lean +++ b/LeanPool/FormalLearningTheory/PureMath/Concentration.lean @@ -3,7 +3,7 @@ Copyright (c) 2026 Dhruv Gupta. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Dhruv Gupta -/ -import Mathlib.MeasureTheory.Measure.MeasureSpace +import Mathlib.MeasureTheory.Measure.Basic import Mathlib.Probability.Independence.Basic import Mathlib.MeasureTheory.Function.LpSeminorm.Basic import Mathlib.MeasureTheory.Integral.Bochner.Basic diff --git a/LeanPool/FormalLearningTheory/Theorem/Extended.lean b/LeanPool/FormalLearningTheory/Theorem/Extended.lean index ffd3dfe71f..05971c355a 100644 --- a/LeanPool/FormalLearningTheory/Theorem/Extended.lean +++ b/LeanPool/FormalLearningTheory/Theorem/Extended.lean @@ -351,7 +351,7 @@ private lemma nat_pair_sample_marginal simp only [Set.mem_preimage, Set.mem_ofPred_eq, SuccessSub, p, N, n] constructor <;> intro h <;> (convert h using 1; rfl) have hSuccessSub_meas : MeasurableSet SuccessSub := - measurableSet_preimage (measurable_pi_lambda _ (fun j => measurable_pi_apply (e₁ j))) hSuccess + measurableSet_preimage (Measurable.of_eval (fun j => measurable_pi_apply (e₁ j))) hSuccess rw [h_eq, pi_cylinder_set_eq D p SuccessSub hSuccessSub_meas] -- Now D^{p}(SuccessSub) and need D^{Fin n}(Success) — reindex via e₁ have h_mp : MeasureTheory.MeasurePreserving @@ -405,7 +405,7 @@ private lemma adviceGoodTrain_measurable {X : Type u} [MeasurableSpace X] ≤ ENNReal.ofReal (ε / 2)} := by have h_label : Measurable (fun xs₁ : Fin m₁ → X => fun i : Fin m₁ => (xs₁ i, c (xs₁ i))) := - measurable_pi_lambda _ (fun i => + Measurable.of_eval (fun i => (measurable_pi_apply i).prodMk (hcm.comp (measurable_pi_apply i))) have h_joint : Measurable (fun p : (Fin m₁ → X) × X => LA.learnWithAdvice aStar (fun i => (p.1 i, c (p.1 i))) p.2) := @@ -446,7 +446,7 @@ private lemma adviceBadVal_measurable {X : Type u} [MeasurableSpace X] intro a have h_label_a : Measurable (fun xs₁ : Fin m₁ → X => fun i : Fin m₁ => (xs₁ i, c (xs₁ i))) := - measurable_pi_lambda _ (fun i => + Measurable.of_eval (fun i => (measurable_pi_apply i).prodMk (hcm.comp (measurable_pi_apply i))) have h_joint_a : Measurable (fun q : (Fin m₁ → X) × X => LA.learnWithAdvice a (fun i => (q.1 i, c (q.1 i))) q.2) := diff --git a/LeanPool/FormalLearningTheory/Theorem/Separation.lean b/LeanPool/FormalLearningTheory/Theorem/Separation.lean index ba7bd145d6..4b8fa7d626 100644 --- a/LeanPool/FormalLearningTheory/Theorem/Separation.lean +++ b/LeanPool/FormalLearningTheory/Theorem/Separation.lean @@ -190,7 +190,7 @@ private lemma measurableSet_goodBlock_A have hL_meas : LearnEvalMeasurable L := MeasurableBatchLearner.eval_measurable have h_label : Measurable (fun p : (Fin n → X) × X => fun i : Fin n => (p.1 i, c (p.1 i))) := - measurable_pi_lambda _ (fun i => + Measurable.of_eval (fun i => ((measurable_pi_apply i).comp measurable_fst).prodMk (hc_meas.comp ((measurable_pi_apply i).comp measurable_fst))) have h_joint : Measurable (fun p : (Fin n → X) × X => diff --git a/LeanPool/FormalizationOfBoundedArithmetic/IOPEN.lean b/LeanPool/FormalizationOfBoundedArithmetic/IOPEN.lean index 46b5a54d3c..618996d71a 100644 --- a/LeanPool/FormalizationOfBoundedArithmetic/IOPEN.lean +++ b/LeanPool/FormalizationOfBoundedArithmetic/IOPEN.lean @@ -6,7 +6,7 @@ Authors: ruplet -- for a quick demo, jump straight to `theorem add_assoc` import Mathlib.Tactic.Core -import Mathlib.Logic.Basic +import Mathlib.Basic.Logic.Basic import Mathlib.Tactic.Common import Mathlib.Tactic.Linarith import Mathlib.Tactic.Ring diff --git a/LeanPool/FormalizationOfBoundedArithmetic/IsEnum.lean b/LeanPool/FormalizationOfBoundedArithmetic/IsEnum.lean index de4d15ec95..b31168923a 100644 --- a/LeanPool/FormalizationOfBoundedArithmetic/IsEnum.lean +++ b/LeanPool/FormalizationOfBoundedArithmetic/IsEnum.lean @@ -7,9 +7,9 @@ Authors: ruplet -- Source: the example from https://lean-lang.org/doc/reference/latest/Type-Classes/Deriving-Instances/ -- extended with case for empty type import Lean.Elab.Deriving.Basic -import Mathlib.Logic.IsEmpty.Basic +import Mathlib.Basic.IsEmpty.Basic import Mathlib.Logic.Equiv.Defs -import Mathlib.Data.Finite.Defs +import Mathlib.Basic.Finite.Defs import Mathlib.Data.List.Nodup import Mathlib.Data.List.OfFn diff --git a/LeanPool/GrothendieckVanishing/FinitelyGeneratedVanishing.lean b/LeanPool/GrothendieckVanishing/FinitelyGeneratedVanishing.lean index 181904b258..176fa0dce2 100644 --- a/LeanPool/GrothendieckVanishing/FinitelyGeneratedVanishing.lean +++ b/LeanPool/GrothendieckVanishing/FinitelyGeneratedVanishing.lean @@ -116,7 +116,7 @@ noncomputable def finsetGenCoconeIsColimit : have hfac : g ≫ d = TopCat.Presheaf.allSectionMap hK := by ext σ dsimp only [g, d] - rw [← Category.assoc, Sigma.ι_desc] + rw [← Category.assoc, Sigma.ι_comp_desc] calc Sigma.ι (fun τ : {τ // τ ∈ ({σ} : Finset _)} ↦ TopCat.Sheaf.zeroOutsideInt τ.1.1) ⟨σ, Finset.mem_singleton_self σ⟩ ≫ @@ -135,7 +135,7 @@ noncomputable def finsetGenCoconeIsColimit : rw [← Category.assoc] dsimp only [finsetGenCocone] rw [Category.assoc, Limits.image.fac] - exact (Sigma.ι_desc _ _).trans (Sigma.ι_desc _ _).symm + exact (Sigma.ι_comp_desc _ _).trans (Sigma.ι_comp_desc _ _).symm exact @epi_of_epi_fac _ _ _ _ _ g d (TopCat.Presheaf.allSectionMap hK) (TopCat.Presheaf.allSectionMap_epi (F := K) hK) hfac -- mono + epi → iso in abelian category @@ -220,9 +220,9 @@ theorem finsetGeneratedSheaf_vanishing ext ⟨σ, hσ⟩ by_cases h : σ = σ₀ · subst h - rw [← Category.assoc, Sigma.ι_desc] + rw [← Category.assoc, Sigma.ι_comp_desc] simp [g] - · rw [← Category.assoc, Sigma.ι_desc, dite_eq_right h, zero_comp] + · rw [← Category.assoc, Sigma.ι_comp_desc, dite_eq_right h, zero_comp] have hfacBase : TopCat.Presheaf.finsetCoproductInclGen h_sub ≫ qIns = qS ≫ f := by simp [qIns, qS, f, TopCat.Presheaf.finsetImageInclGen] @@ -235,7 +235,7 @@ theorem finsetGeneratedSheaf_vanishing (fun σ : {σ // σ ∈ insert σ₀ S'} ↦ TopCat.Sheaf.zeroOutsideInt σ.1.1) ⟨σ, hσ⟩ ≫ qIns ≫ cokernel.π f = 0 := by simpa [TopCat.Presheaf.finsetCoproductInclGen, Category.assoc, h, - cokernel.condition, Sigma.ι_desc_assoc, Sigma.ι_desc] using hfac' + cokernel.condition, Sigma.ι_comp_desc_assoc, Sigma.ι_comp_desc] using hfac' exact hzero_rhs.symm exact subsingleton_sheafH_of_shortExact_middle f m ih <| hzero (cokernel f).property g.hom diff --git a/LeanPool/GrothendieckVanishing/FlasqueVanishing.lean b/LeanPool/GrothendieckVanishing/FlasqueVanishing.lean index b09d76fbe8..145b8402d8 100644 --- a/LeanPool/GrothendieckVanishing/FlasqueVanishing.lean +++ b/LeanPool/GrothendieckVanishing/FlasqueVanishing.lean @@ -168,18 +168,18 @@ private abbrev underMk {X : TopCat.{u}} {F G : TopCat.Sheaf AddCommGrpCat.{u} X} (t : F.obj.obj (op V)) (hVU : V ≤ U) (ht : ConcreteCategory.hom (g.hom.app (op V)) t = ConcreteCategory.hom (G.obj.map (homOfLE hVU).op) s) : - StructuredArrow ⟨op U, s⟩ + StructuredArrow (Functor.elementsMk _ (op U) s) (Functor.whiskerRight g.hom (CategoryTheory.forget AddCommGrpCat.{u})).mapElements := - StructuredArrow.mk (S := ⟨op U, s⟩) + StructuredArrow.mk (S := Functor.elementsMk _ (op U) s) (T := (Functor.whiskerRight g.hom (CategoryTheory.forget AddCommGrpCat.{u})).mapElements) - (Y := ⟨op V, t⟩) - (CategoryOfElements.homMk _ _ (homOfLE hVU).op (by exact ht.symm)) + (Y := Functor.elementsMk _ (op V) t) + (Functor.Elements.homMk (homOfLE hVU).op (by exact ht.symm)) /-- Partial lifts of a section `s` along a morphism of sheaves. An object is an open `V`, a section over `V`, and the proof that it maps to `s |_ V`. -/ private abbrev PartialLift {X : TopCat.{u}} {F G : TopCat.Sheaf AddCommGrpCat.{u} X} (g : F ⟶ G) {U : Opens X} (s : G.obj.obj (op U)) := - StructuredArrow ⟨op U, s⟩ + StructuredArrow (Functor.elementsMk _ (op U) s) (Functor.whiskerRight g.hom (CategoryTheory.forget AddCommGrpCat.{u})).mapElements private local instance partialLiftCategory {X : TopCat.{u}} @@ -194,10 +194,10 @@ private lemma chain_isCompatible_of_chain {X : TopCat.{u}} {c : Set (PartialLift g s)} (hchain : IsChain (fun x y ↦ Nonempty (y ⟶ x)) c) : TopCat.Presheaf.IsCompatible F.obj - (fun x : c ↦ x.1.right.1.unop) - (fun x : c ↦ x.1.right.2) := by - let cV : c → Opens X := fun x ↦ x.1.right.1.unop - let cs : (x : c) → F.obj.obj (op (cV x)) := fun x ↦ x.1.right.2 + (fun x : c ↦ x.1.right.obj.unop) + (fun x : c ↦ x.1.right.val) := by + let cV : c → Opens X := fun x ↦ x.1.right.obj.unop + let cs : (x : c) → F.obj.obj (op (cV x)) := fun x ↦ x.1.right.val change TopCat.Presheaf.IsCompatible F.obj cV cs intro i j by_cases hij : i = j @@ -206,17 +206,17 @@ private lemma chain_isCompatible_of_chain {X : TopCat.{u}} · have htotal := hchain i.property j.property (fun h ↦ hij (Subtype.ext h)) rcases htotal with hji | hij' · rw [show (cV i).infLERight (cV j) = - (cV i).infLELeft (cV j) ≫ hji.some.right.val.unop from Subsingleton.elim _ _, + (cV i).infLELeft (cV j) ≫ hji.some.right.hom.unop from Subsingleton.elim _ _, op_comp, Functor.map_comp, CategoryTheory.comp_apply] - have hsec : ConcreteCategory.hom (F.obj.map hji.some.right.val) j.1.right.2 = - i.1.right.2 := CategoryOfElements.map_snd hji.some.right + have hsec : ConcreteCategory.hom (F.obj.map hji.some.right.hom) j.1.right.val = + i.1.right.val := hji.some.right.map_val exact congrArg (ConcreteCategory.hom (F.obj.map ((cV i).infLELeft (cV j)).op)) hsec.symm · rw [show (cV i).infLELeft (cV j) = - (cV i).infLERight (cV j) ≫ hij'.some.right.val.unop from Subsingleton.elim _ _, + (cV i).infLERight (cV j) ≫ hij'.some.right.hom.unop from Subsingleton.elim _ _, op_comp, Functor.map_comp, CategoryTheory.comp_apply] - have hsec : ConcreteCategory.hom (F.obj.map hij'.some.right.val) i.1.right.2 = - j.1.right.2 := CategoryOfElements.map_snd hij'.some.right + have hsec : ConcreteCategory.hom (F.obj.map hij'.some.right.hom) i.1.right.val = + j.1.right.val := hij'.some.right.map_val exact congrArg (ConcreteCategory.hom (F.obj.map ((cV i).infLERight (cV j)).op)) hsec private lemma exists_glued_lift_upper_bound {X : TopCat.{u}} @@ -225,25 +225,25 @@ private lemma exists_glued_lift_upper_bound {X : TopCat.{u}} {ι : Type*} (T : ι → PartialLift g s) (hcompat : TopCat.Presheaf.IsCompatible F.obj - (fun i ↦ (T i).right.1.unop) (fun i ↦ (T i).right.2)) : + (fun i ↦ (T i).right.obj.unop) (fun i ↦ (T i).right.val)) : ∃ y : PartialLift g s, - y.right.1.unop = iSup (fun i ↦ (T i).right.1.unop) ∧ + y.right.obj.unop = iSup (fun i ↦ (T i).right.obj.unop) ∧ ∀ i, Nonempty (y ⟶ T i) := by - let cV : ι → Opens X := fun i ↦ (T i).right.1.unop - let cs : (i : ι) → F.obj.obj (op (cV i)) := fun i ↦ (T i).right.2 + let cV : ι → Opens X := fun i ↦ (T i).right.obj.unop + let cs : (i : ι) → F.obj.obj (op (cV i)) := fun i ↦ (T i).right.val have hcompat' : TopCat.Presheaf.IsCompatible F.obj cV cs := by simpa [cV, cs] using hcompat obtain ⟨t_gl, ht_gl, _⟩ := F.existsUnique_gluing cV cs hcompat' - have hVsup_le : iSup cV ≤ U := iSup_le fun i ↦ leOfHom (T i).hom.val.unop + have hVsup_le : iSup cV ≤ U := iSup_le fun i ↦ leOfHom (T i).hom.hom.unop have hgt : ConcreteCategory.hom (g.hom.app (op (iSup cV))) t_gl = ConcreteCategory.hom (G.obj.map (homOfLE hVsup_le).op) s := by apply map_glued_eq_of_local_eq g (fun j ↦ le_trans (le_iSup cV j) hVsup_le) ht_gl intro j - exact (CategoryOfElements.map_snd (T j).hom).symm + exact (((T j).hom).map_val).symm let y := underMk g s t_gl hVsup_le hgt refine ⟨y, rfl, fun i ↦ ?_⟩ exact Nonempty.intro (StructuredArrow.homMk - (CategoryOfElements.homMk _ _ (homOfLE (le_iSup cV i)).op (by + (Functor.Elements.homMk (homOfLE (le_iSup cV i)).op (by change ConcreteCategory.hom (F.obj.map (homOfLE (le_iSup cV i)).op) t_gl = cs i exact ht_gl i)) (by cat_disch)) @@ -260,20 +260,20 @@ private lemma under_extend_by_one_open {X : TopCat.{u}} (ht' : ConcreteCategory.hom (S.g.hom.app (op W)) t' = ConcreteCategory.hom (S.X₃.obj.map (homOfLE hWU).op) s) {x : X} (hxW : x ∈ W) : - ∃ y : PartialLift S.g s, Nonempty (y ⟶ t) ∧ x ∈ y.right.1.unop := by - let V₀ : Opens X := t.right.1.unop - let t₀ : S.X₂.obj.obj (op V₀) := t.right.2 - have hV₀U : V₀ ≤ U := leOfHom t.hom.val.unop + ∃ y : PartialLift S.g s, Nonempty (y ⟶ t) ∧ x ∈ y.right.obj.unop := by + let V₀ : Opens X := t.right.obj.unop + let t₀ : S.X₂.obj.obj (op V₀) := t.right.val + have hV₀U : V₀ ≤ U := leOfHom t.hom.hom.unop have ht₀ : ConcreteCategory.hom (S.g.hom.app (op V₀)) t₀ = ConcreteCategory.hom (S.X₃.obj.map (homOfLE hV₀U).op) s := - (CategoryOfElements.map_snd t.hom).symm + (t.hom.map_val).symm obtain ⟨t'', hgt'', hcompat_patch⟩ := exists_patch_of_shortExact hS hX₁_epi hV₀U hWU ht₀ ht' let T : Bool → PartialLift S.g s | false => t | true => underMk S.g s t'' hWU hgt'' have hcompat_glue : TopCat.Presheaf.IsCompatible S.X₂.obj - (fun b ↦ (T b).right.1.unop) (fun b ↦ (T b).right.2) := by + (fun b ↦ (T b).right.obj.unop) (fun b ↦ (T b).right.val) := by apply bool_isCompatible_of_false_true_eq S.X₂.obj change ConcreteCategory.hom (S.X₂.obj.map (homOfLE (inf_le_right : V₀ ⊓ W ≤ W)).op) t'' = @@ -304,19 +304,19 @@ theorem epi_app_of_shortExact_of_epi_restrictions {X : TopCat.{u}} obtain ⟨t, hmax⟩ := exists_maximal_of_chains_bounded (fun (c : Set (PartialLift S.g s)) hchain ↦ by have hcompat : TopCat.Presheaf.IsCompatible S.X₂.obj - (fun x : c ↦ x.1.right.1.unop) (fun x : c ↦ x.1.right.2) := + (fun x : c ↦ x.1.right.obj.unop) (fun x : c ↦ x.1.right.val) := chain_isCompatible_of_chain (g := S.g) (s := s) (c := c) hchain obtain ⟨ub, _, hub⟩ := exists_glued_lift_upper_bound S.g s (fun x : c ↦ x.1) hcompat exact ⟨ub, fun a ha ↦ hub ⟨a, ha⟩⟩) (fun {a b c : PartialLift S.g s} (hab : Nonempty (b ⟶ a)) (hbc : Nonempty (c ⟶ b)) ↦ ⟨hbc.some ≫ hab.some⟩) - let V₀ : Opens X := t.right.1.unop - let t₀ : S.X₂.obj.obj (op V₀) := t.right.2 - have hV₀U : V₀ ≤ U := leOfHom t.hom.val.unop + let V₀ : Opens X := t.right.obj.unop + let t₀ : S.X₂.obj.obj (op V₀) := t.right.val + have hV₀U : V₀ ≤ U := leOfHom t.hom.hom.unop have ht₀ : ConcreteCategory.hom (S.g.hom.app (op V₀)) t₀ = ConcreteCategory.hom (S.X₃.obj.map (homOfLE hV₀U).op) s := - (CategoryOfElements.map_snd t.hom).symm + (t.hom.map_val).symm have hUleV₀ : U ≤ V₀ := by by_contra hnot have hlt : V₀ < U := lt_of_le_not_ge hV₀U hnot @@ -326,7 +326,7 @@ theorem epi_app_of_shortExact_of_epi_restrictions {X : TopCat.{u}} under_extend_by_one_open (S := S) hS hX₁_epi s t W (leOfHom iWU) t' ht' hxW have h_back : Nonempty (t ⟶ y) := hmax y hyt - exact hxV₀ (leOfHom h_back.some.right.val.unop hxy) + exact hxV₀ (leOfHom h_back.some.right.hom.unop hxy) exact ⟨ConcreteCategory.hom (S.X₂.obj.map (homOfLE hUleV₀).op) t₀, by rw [S.g.hom.naturality_apply (homOfLE hUleV₀).op t₀, ht₀] rw [← CategoryTheory.comp_apply, ← S.X₃.obj.map_comp] diff --git a/LeanPool/GrothendieckVanishing/GeneratedSubsheaf.lean b/LeanPool/GrothendieckVanishing/GeneratedSubsheaf.lean index 43c71a74da..a6d29d8fb0 100644 --- a/LeanPool/GrothendieckVanishing/GeneratedSubsheaf.lean +++ b/LeanPool/GrothendieckVanishing/GeneratedSubsheaf.lean @@ -142,9 +142,9 @@ noncomputable def finsetImageInclGen {X : TopCat.{u}} rw [Category.assoc, Limits.image.fac] ext ⟨σ, hσ⟩ simp only [finsetCoproductInclGen, TopCat.Presheaf.finsetGeneratorMap, - TopCat.Sheaf.familyMap, Sigma.ι_desc_assoc] - exact (Sigma.ι_desc _ _).trans - (Sigma.ι_desc + TopCat.Sheaf.familyMap, Sigma.ι_comp_desc_assoc] + exact (Sigma.ι_comp_desc _ _).trans + (Sigma.ι_comp_desc (fun τ : {τ // τ ∈ S} ↦ sectionHom hF τ.1) ⟨σ, hσ⟩).symm } @@ -165,9 +165,9 @@ theorem finsetImageInclGen_comp_ι {X : TopCat.{u}} rw [Category.assoc, Limits.image.fac] ext ⟨σ, hσ⟩ simp only [finsetCoproductInclGen, TopCat.Presheaf.finsetGeneratorMap, - TopCat.Sheaf.familyMap, Sigma.ι_desc_assoc] - exact (Sigma.ι_desc _ _).trans - (Sigma.ι_desc + TopCat.Sheaf.familyMap, Sigma.ι_comp_desc_assoc] + exact (Sigma.ι_comp_desc _ _).trans + (Sigma.ι_comp_desc (fun τ : {τ // τ ∈ S} ↦ sectionHom hF τ.1) ⟨σ, hσ⟩).symm }) @@ -210,7 +210,7 @@ instance allSectionMap_epi {X : TopCat.{u}} Sigma.ι (fun σ : SectionIndex F ↦ TopCat.Sheaf.zeroOutsideInt σ.1) ⟨U, t⟩ ≫ allSectionMap hF = sectionHom hF ⟨U, t⟩ := by - apply Sigma.ι_desc + apply Sigma.ι_comp_desc rw [hcomp] change (TopCat.Sheaf.zeroOutsideInt.sHomVal hF t).app (op U) (TopCat.Sheaf.zeroOutsideInt.generator U) = diff --git a/LeanPool/GrothendieckVanishing/GrothendieckVanishing.lean b/LeanPool/GrothendieckVanishing/GrothendieckVanishing.lean index bb1d653c50..4f3d1e911e 100644 --- a/LeanPool/GrothendieckVanishing/GrothendieckVanishing.lean +++ b/LeanPool/GrothendieckVanishing/GrothendieckVanishing.lean @@ -127,7 +127,7 @@ theorem GrothendieckVanishing (X : TopCat.{u}) [NoetherianSpace X] (n : ℕ) (h : n > topologicalKrullDim X) (F : TopCat.Sheaf AddCommGrpCat.{u} X) : Subsingleton (Sheaf.H F n) := by - have hwf : WellFounded (fun (a b : WithBot ℕ∞) ↦ a < b) := IsWellFounded.wf + have hwf : WellFounded (fun (a b : WithBot ℕ∞) ↦ a < b) := inferInstance exact hwf.induction (C := fun d ↦ ∀ (X : TopCat.{u}) [NoetherianSpace X] (n : ℕ) (F : TopCat.Sheaf AddCommGrpCat.{u} X), diff --git a/LeanPool/GrothendieckVanishing/PresheafFilteredColimit.lean b/LeanPool/GrothendieckVanishing/PresheafFilteredColimit.lean index 99fefc9153..fbcb8bdd2c 100644 --- a/LeanPool/GrothendieckVanishing/PresheafFilteredColimit.lean +++ b/LeanPool/GrothendieckVanishing/PresheafFilteredColimit.lean @@ -425,7 +425,7 @@ private noncomputable def sheafH_filtered_colimit_comparison_one_iso : exact sheafH1_cokernel_iso_of_subsingleton_middle_natural (sheafH_filtered_colimit_succ_stage_shortExact (Y' := Ysh) j) (sheafH_filtered_colimit_succ_shortExact Ysh csh hcsh) stageHom (h_mid j) h_colim - rw [HasColimit.isoOfNatIso_ι_inv_assoc, HasColimit.isoOfNatIso_ι_hom_assoc, + rw [HasColimit.ι_isoOfNatIso_inv_assoc, HasColimit.ι_isoOfNatIso_hom_assoc, colimit_ι_sheafH_filtered_colimit_comparison] have hright : stageNat.inv.app j ≫ (stageCokMap ≫ globalIso.hom) = @@ -625,7 +625,7 @@ private noncomputable def sheafH_filtered_colimit_comparison_zero_iso : (HasColimit.isoOfNatIso h0Iso).hom ≫ (e.hom ≫ h0Symm) = h0Iso.hom.app j ≫ colimit.ι (Ysh ⋙ sectionsFunctor) j ≫ e.hom ≫ h0Symm - rw [HasColimit.isoOfNatIso_ι_hom_assoc] + rw [HasColimit.ι_isoOfNatIso_hom_assoc] _ = colimit.ι (Ysh ⋙ sheafCohomologyFunctor X 0) j ≫ sheafHFilteredColimitComparison Ysh 0 csh := by rw [colimit_ι_sheafH_filtered_colimit_comparison] diff --git a/LeanPool/GrothendieckVanishing/PresheafFilteredColimitCore.lean b/LeanPool/GrothendieckVanishing/PresheafFilteredColimitCore.lean index 212b7d2dcf..a9a1d5d456 100644 --- a/LeanPool/GrothendieckVanishing/PresheafFilteredColimitCore.lean +++ b/LeanPool/GrothendieckVanishing/PresheafFilteredColimitCore.lean @@ -560,7 +560,7 @@ theorem sheafH_filtered_colimit_comparison_succ_compatibility rw [show (sheafHFilteredColimitSuccShiftDomainIso Ysh n h_mid_n h_mid_succ).hom = (HasColimit.isoOfNatIso (sheafHFilteredColimitSuccShiftNatIso Ysh n h_mid_n h_mid_succ)).hom from rfl] - rw [HasColimit.isoOfNatIso_ι_hom_assoc] + rw [HasColimit.ι_isoOfNatIso_hom_assoc] rw [colimit_ι_sheafH_filtered_colimit_comparison] rw [show colimit.ι (sheafHFilteredColimitSuccQuotient Ysh ⋙ sheafCohomologyFunctor X n) j ≫ diff --git a/LeanPool/HansonWright/Probability/Concentration/HansonWright.lean b/LeanPool/HansonWright/Probability/Concentration/HansonWright.lean index 69d889de0e..31f1b96ac3 100644 --- a/LeanPool/HansonWright/Probability/Concentration/HansonWright.lean +++ b/LeanPool/HansonWright/Probability/Concentration/HansonWright.lean @@ -65,9 +65,9 @@ lemma mgf_innerSL_stdGaussian {E : Type*} [NormedAddCommGroup E] [InnerProductSp mgf (fun x : E => inner ℝ v x) (stdGaussian E) t = exp (‖v‖ ^ 2 * t ^ 2 / 2) := by let L : StrongDual ℝ E := innerSL ℝ v - have hmap : (stdGaussian E).map L = - gaussianReal ((stdGaussian E)[L]) Var[L; stdGaussian E].toNNReal := - IsGaussian.map_eq_gaussianReal L + have hmap : HasLaw L (gaussianReal ((stdGaussian E)[L]) Var[L; stdGaussian E].toNNReal) + (stdGaussian E) := + ⟨L.continuous.measurable.aemeasurable, IsGaussian.map_eq_gaussianReal L⟩ have hmgf := mgf_gaussianReal hmap t have hmean : (stdGaussian E)[L] = 0 := integral_strongDual_stdGaussian L have hvar : (Var[L; stdGaussian E].toNNReal : ℝ) = ‖v‖ ^ 2 := by @@ -163,7 +163,7 @@ lemma randomVector_aemeasurable {μ : Measure Ω} {n : ℕ} {X : Fin n → Ω (hX_meas : ∀ i, AEMeasurable (X i) μ) : AEMeasurable (randomVector X) μ := by exact (MeasurableEquiv.toLp 2 (Fin n → ℝ)).measurable.comp_aemeasurable - (aemeasurable_pi_lambda _ hX_meas) + (AEMeasurable.of_eval hX_meas) omit [MeasurableSpace Ω] in lemma measure_map_prod_map_of_aemeasurable {α β γ δ : Type*} @@ -244,7 +244,7 @@ lemma subtypeMask_apply {n : ℕ} (s : Finset (Fin n)) (x : s → ℝ) (i : Fin lemma measurable_subtypeMask {n : ℕ} (s : Finset (Fin n)) : Measurable (subtypeMask (n := n) s) := by exact (MeasurableEquiv.toLp 2 (Fin n → ℝ)).measurable.comp - (measurable_pi_lambda _ fun i => by + (Measurable.of_eval fun i => by by_cases hi : i ∈ s · simpa [hi] using (measurable_pi_apply (⟨i, hi⟩ : s) : Measurable fun x : s → ℝ => x ⟨i, hi⟩) @@ -265,7 +265,7 @@ lemma coordinateMask_aemeasurable {μ : Measure Ω} {n : ℕ} (s : Finset (Fin n AEMeasurable (fun ω => coordinateMask s (randomVector X ω)) μ := by rw [← subtypeMask_subtype_randomVector s X] exact (measurable_subtypeMask s).aemeasurable.comp_aemeasurable - (aemeasurable_pi_lambda _ fun i => hX_meas i) + (AEMeasurable.of_eval fun i => hX_meas i) lemma coordinateMask_indepFun_compl {μ : Measure Ω} {n : ℕ} {X : Fin n → Ω → ℝ} (h_indep : iIndepFun X μ) (hX_meas : ∀ i, AEMeasurable (X i) μ) @@ -1433,7 +1433,7 @@ lemma integral_exp_quadratic_stdGaussian_le {E : Type*} [NormedAddCommGroup E] _ ≤ ∏ i : Fin (Module.finrank ℝ E), exp (2 * exp 1 * ((θ * hTpos.isSymmetric.eigenvalues rfl i) * 1 * exp 1)) := by - apply Finset.prod_le_prod + apply Finset.prod_le_prod₀ · intro i _ exact integral_nonneg_of_ae (ae_of_all _ fun x => exp_nonneg _) · intro i _ @@ -2238,10 +2238,6 @@ lemma integrable_exp_mul_prod_of_indepFun_hasSubgaussianMGF_of_le independentPair_pushforward h_indep hX.aemeasurable hY.aemeasurable have hg := exp_mul_snd_fst_aestronglyMeasurable θ (μ.map fun ω => (Y ω, X ω)) - have : IsProbabilityMeasure (μ.map X) := - MeasureTheory.Measure.isProbabilityMeasure_map hX.aemeasurable - have : IsProbabilityMeasure (μ.map Y) := - MeasureTheory.Measure.isProbabilityMeasure_map hY.aemeasurable have hprod_int : Integrable (fun p : ℝ × ℝ => exp (θ * p.2 * p.1)) ((μ.map Y).prod (μ.map X)) := integrable_exp_mul_snd_fst_prod_of_hasSubgaussianMGF_of_le @@ -2266,10 +2262,6 @@ lemma integral_exp_mul_prod_le_of_indepFun_hasSubgaussianMGF_of_le independentPair_pushforward h_indep hX.aemeasurable hY.aemeasurable have hg := exp_mul_snd_fst_aestronglyMeasurable θ (μ.map fun ω => (Y ω, X ω)) - have : IsProbabilityMeasure (μ.map X) := - MeasureTheory.Measure.isProbabilityMeasure_map hX.aemeasurable - have : IsProbabilityMeasure (μ.map Y) := - MeasureTheory.Measure.isProbabilityMeasure_map hY.aemeasurable have hprod_bound : ∫ p : ℝ × ℝ, exp (θ * p.2 * p.1) ∂((μ.map Y).prod (μ.map X)) ≤ exp (exp 1 ^ 2 * C0 ^ 2 * θ ^ 2) := diff --git a/LeanPool/InfinitaryLogic/Combinatorics/EndHomogeneousErdosRado.lean b/LeanPool/InfinitaryLogic/Combinatorics/EndHomogeneousErdosRado.lean index bef1daa45a..3f95bf4cff 100644 --- a/LeanPool/InfinitaryLogic/Combinatorics/EndHomogeneousErdosRado.lean +++ b/LeanPool/InfinitaryLogic/Combinatorics/EndHomogeneousErdosRado.lean @@ -269,7 +269,7 @@ noncomputable def nodeChosen (G : (Fin (n + 2) ↪o Source lam) → C) (h.restrict (le_of_lt (by have hh := Ordinal.typein_lt_type (· < · : β.ToType → β.ToType → Prop) x rwa [Ordinal.type_toType] at hh)))) h).Nonempty then - (IsWellFounded.wf : WellFounded (· < · : Source lam → Source lam → Prop)).min _ hne + (wellFounded_lt : WellFounded (· < · : Source lam → Source lam → Prop)).min _ hne else Classical.arbitrary (Source lam) termination_by β @@ -329,7 +329,7 @@ private theorem nodeChosen_mem (G : (Fin (n + 2) ↪o Source lam) → C) {β : O private theorem nodeChosen_eq_min (G : (Fin (n + 2) ↪o Source lam) → C) {β : Ordinal.{0}} (h : NodeAt C n β) (hlive : nodeLive G h) : nodeChosen G β h = - (IsWellFounded.wf : WellFounded (· < · : Source lam → Source lam → Prop)).min + (wellFounded_lt : WellFounded (· < · : Source lam → Source lam → Prop)).min (nodeS G h) hlive := by classical have : IsWellOrder β.ToType (· < ·) := isWellOrder_lt diff --git a/LeanPool/InfinitaryLogic/Combinatorics/PairErdosRadoGeneral.lean b/LeanPool/InfinitaryLogic/Combinatorics/PairErdosRadoGeneral.lean index fb05bcea57..fb8996de26 100644 --- a/LeanPool/InfinitaryLogic/Combinatorics/PairErdosRadoGeneral.lean +++ b/LeanPool/InfinitaryLogic/Combinatorics/PairErdosRadoGeneral.lean @@ -281,7 +281,7 @@ noncomputable def ehmrChosen (cR : (Fin 2 ↪o Source κ) → C) (h.restrict (le_of_lt (by have hh := Ordinal.typein_lt_type (· < · : β.ToType → β.ToType → Prop) x rwa [Ordinal.type_toType] at hh)))) h).Nonempty then - (IsWellFounded.wf : WellFounded (· < · : Source κ → Source κ → Prop)).min _ hne + (wellFounded_lt : WellFounded (· < · : Source κ → Source κ → Prop)).min _ hne else Classical.arbitrary (Source κ) termination_by β @@ -341,7 +341,7 @@ private theorem ehmrChosen_mem (cR : (Fin 2 ↪o Source κ) → C) {β : Ordinal private theorem ehmrChosen_eq_min (cR : (Fin 2 ↪o Source κ) → C) {β : Ordinal.{0}} (h : EHMRNodeAt C β) (hlive : ehmrLive cR h) : ehmrChosen cR β h = - (IsWellFounded.wf : WellFounded (· < · : Source κ → Source κ → Prop)).min + (wellFounded_lt : WellFounded (· < · : Source κ → Source κ → Prop)).min (ehmrS cR h) hlive := by classical have hcond : (ehmrFiber cR @@ -471,7 +471,7 @@ theorem yNode_mem_of (cR : (Fin 2 ↪o Source κ) → C) (y : Source κ) have hlt : yRep cR y (Ordinal.typein (· < ·) x) < y := hbelow _ htx_lt rw [hrep] refine ⟨hlt, ?_⟩ - show cR (pairEmbed hlt) = yNode cR y β x + change cR (pairEmbed hlt) = yNode cR y β x simp only [yNode] rw [dite_eq_left hlt] diff --git a/LeanPool/InfinitaryLogic/Conditional/MorleyHanfTransfer.lean b/LeanPool/InfinitaryLogic/Conditional/MorleyHanfTransfer.lean index 2f9aa0d213..9e03d76662 100644 --- a/LeanPool/InfinitaryLogic/Conditional/MorleyHanfTransfer.lean +++ b/LeanPool/InfinitaryLogic/Conditional/MorleyHanfTransfer.lean @@ -9,7 +9,6 @@ import LeanPool.InfinitaryLogic.Methods.EM.TailAdapter import Mathlib.Data.Fin.VecNotation import Mathlib.Data.Nat.Nth import Mathlib.Data.Set.Finite.Basic -import Mathlib.Data.Set.Lattice import Mathlib.Order.Hom.Basic import Mathlib.Order.WellFounded import Mathlib.SetTheory.Cardinal.Aleph @@ -126,7 +125,6 @@ private theorem hasArbLargeModels_of_seed_realizability (morleySeed_indiscernibleOn φ hPairwise) intro κ let J : Type := (Cardinal.ord κ).ToType - have : LinearOrder J := linearOrder_toType _ have hJ_card : Cardinal.mk J = κ := Cardinal.mk_ord_toType κ obtain ⟨N, instN, b, hSeq⟩ := IsLomega1omegaIndiscernibleOnTail.stretch_restricted_sequence_of_model (J := J) diff --git a/LeanPool/InfinitaryLogic/Descriptive/GSGraph.lean b/LeanPool/InfinitaryLogic/Descriptive/GSGraph.lean index b28edfecbb..3380d18dd3 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/GSGraph.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/GSGraph.lean @@ -232,7 +232,7 @@ theorem exists_gSGraph_edge_of_not_isMeagre have hsym : IsMeagre {p : ℕ → Bool | ¬(p ∈ B ↔ p ∈ W)} := by rw [IsMeagre, compl_ofPred] simp only [not_not] - exact Filter.eventuallyEq_set.mp hBW + exact Filter.eventuallyEqSet_iff.mp hBW have hW_ne : W.Nonempty := by rcases W.eq_empty_or_nonempty with rfl | h · exact (hBnm (hsym.mono fun p hp => by simp [hp])).elim diff --git a/LeanPool/InfinitaryLogic/Descriptive/KuratowskiUlam.lean b/LeanPool/InfinitaryLogic/Descriptive/KuratowskiUlam.lean index f48275ce37..2708b40dca 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/KuratowskiUlam.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/KuratowskiUlam.lean @@ -121,7 +121,7 @@ theorem isMeagre_of_isMeagre_sections [SecondCountableTopology Y] have hM : IsMeagre {p : X × Y | ¬(p ∈ A ↔ p ∈ W)} := by rw [IsMeagre, compl_ofPred] simp only [not_not] - exact Filter.eventuallyEq_set.mp hAW + exact Filter.eventuallyEqSet_iff.mp hAW by_contra hA_nm -- W is nonempty (otherwise A is contained in the symmetric difference) have hW_ne : W.Nonempty := by diff --git a/LeanPool/InfinitaryLogic/Descriptive/WellOrderBridge.lean b/LeanPool/InfinitaryLogic/Descriptive/WellOrderBridge.lean index 027548ab11..dfb34e3c2e 100644 --- a/LeanPool/InfinitaryLogic/Descriptive/WellOrderBridge.lean +++ b/LeanPool/InfinitaryLogic/Descriptive/WellOrderBridge.lean @@ -52,12 +52,11 @@ theorem exists_countable_defect_seed (h : ¬ IsWellOrder M r) : ∀ N : Set M, X ⊆ N → ¬ IsWellOrder ↥N fun x y : ↥N => r ↑x ↑y := by by_cases htri : Std.Trichotomous r · -- the relation must be ill-founded - have hwf : ¬ IsWellFounded M r := fun hwf => h (@IsWellOrder.mk M r hwf htri) - have hnwf : ¬ WellFounded r := fun hw => hwf ⟨hw⟩ + have hnwf : ¬ WellFounded r := fun hw => h (@IsWellOrder.mk M r htri hw) rw [wellFounded_iff_isEmpty_descending_chain, not_isEmpty_iff] at hnwf obtain ⟨f, hf⟩ := hnwf.some refine ⟨Set.range f, Set.countable_range f, ⟨f 0, 0, rfl⟩, fun N hXN hwo => ?_⟩ - exact (wellFounded_iff_isEmpty_descending_chain.mp hwo.toIsWellFounded.wf).false + exact (wellFounded_iff_isEmpty_descending_chain.mp hwo.wf).false ⟨fun n => (⟨f n, hXN ⟨n, rfl⟩⟩ : ↥N), fun n => hf n⟩ · -- trichotomy fails: a two-element seed have hex : ∃ a b : M, ¬ r a b ∧ ¬ r b a ∧ a ≠ b := by @@ -139,11 +138,11 @@ private theorem isWellOrder_of_realize_of_modelsOf_subset (lt : L.Relations 2) { rw [show (⇑N.subtype ∘ ![x, y]) = ![(x : M), (y : M)] from funext fun i => by fin_cases i <;> rfl] at h exact h.symm - refine hXdefect (N : Set M) hXN (@IsWellOrder.mk _ _ ⟨?_⟩ ⟨?_⟩) - · exact Subrelation.wf (fun {a b} hab => (hsub a b).mpr hab) hwoN.toIsWellFounded.wf + refine hXdefect (N : Set M) hXN (@IsWellOrder.mk _ _ ⟨?_⟩ ?_) · exact fun a b hab hba => Std.Trichotomous.trichotomous (r := fun x y : ↥N => @Structure.RelMap L ↥N _ 2 lt ![x, y]) a b (fun h => hab ((hsub a b).mp h)) (fun h => hba ((hsub b a).mp h)) + · exact Subrelation.wf (fun {a b} hab => (hsub a b).mpr hab) hwoN.wf omit [Countable (Σ l, L.Relations l)] in /-- **The bridge**, equality form: if a sentence *defines* the well-order class on codes, then diff --git a/LeanPool/InfinitaryLogic/Methods/LocalEMTemplateRealization.lean b/LeanPool/InfinitaryLogic/Methods/LocalEMTemplateRealization.lean index ea4b1560e8..e719870d70 100644 --- a/LeanPool/InfinitaryLogic/Methods/LocalEMTemplateRealization.lean +++ b/LeanPool/InfinitaryLogic/Methods/LocalEMTemplateRealization.lean @@ -8,7 +8,6 @@ import LeanPool.InfinitaryLogic.Methods.EM.TailAdapter import Mathlib.Data.Fin.VecNotation import Mathlib.Data.Nat.Nth import Mathlib.Data.Set.Finite.Basic -import Mathlib.Data.Set.Lattice import Mathlib.Order.Hom.Basic import Mathlib.Order.WellFounded /-! diff --git a/LeanPool/InfinitaryLogic/Methods/WellOrdering/GraphTranslation.lean b/LeanPool/InfinitaryLogic/Methods/WellOrdering/GraphTranslation.lean index 5d662db958..76d8b4588a 100644 --- a/LeanPool/InfinitaryLogic/Methods/WellOrdering/GraphTranslation.lean +++ b/LeanPool/InfinitaryLogic/Methods/WellOrdering/GraphTranslation.lean @@ -100,7 +100,7 @@ theorem wellOrder_type_boundedness (φ : L.Sentenceω) (lt : L.Relations 2) ∀ (M : Type) (inst : L.Structure M) (hreal : Sentenceω.Realize φ M), @Ordinal.type M (fun x y => RelMap lt ![x, y]) (hwo M inst hreal) < α := by obtain ⟨α, hα, hnochain⟩ := wellFounded_boundedness φ lt - (fun M inst h => letI := hwo M inst h; IsWellFounded.wf) + (fun M inst h => (hwo M inst h).wf) refine ⟨α, hα, fun M inst hreal => ?_⟩ let := hwo M inst hreal by_contra hle diff --git a/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/LadderSyntax.lean b/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/LadderSyntax.lean index 69a794339d..db7f140fd8 100644 --- a/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/LadderSyntax.lean +++ b/LeanPool/InfinitaryLogic/ModelTheory/HanfSpectrum/LadderSyntax.lean @@ -48,9 +48,9 @@ abbrev Index (α : Ordinal.{0}) : Type := (α + 2).ToType instance (α : Ordinal.{0}) : Nonempty (Index α) := Ordinal.nonempty_toType_iff.mpr fun h => by - have h2 := (Ordinal.add_eq_zero_iff.mp h).2 + have h2 := (add_eq_zero.mp h).2 rw [show (2 : Ordinal) = 1 + 1 from one_add_one_eq_two.symm, - Ordinal.add_eq_zero_iff] at h2 + add_eq_zero] at h2 exact one_ne_zero h2.1 noncomputable instance (α : Ordinal.{0}) : OrderBot (Index α) := diff --git a/LeanPool/InfiniteConnesRigidity/CarryAndCrossedProduct.lean b/LeanPool/InfiniteConnesRigidity/CarryAndCrossedProduct.lean index 9a3f639d57..9c61c2b982 100644 --- a/LeanPool/InfiniteConnesRigidity/CarryAndCrossedProduct.lean +++ b/LeanPool/InfiniteConnesRigidity/CarryAndCrossedProduct.lean @@ -3662,12 +3662,10 @@ private theorem continuous_shiftedCarry_linear_pair_apply (n : ℕ) (b : B) : · intro u v _ _ hu hv simp_rw [map_add] convert hu.add hv using 1 - all_goals rfl · intro a v _ hv simp_rw [map_smul, smul_eq_mul] convert (continuous_const : Continuous (fun _ : CarryGroup n × CarryGroup n => a)).mul hv using 1 - all_goals rfl /-- Cross-module support for the infinite Connes-rigidity construction. -/ private theorem continuous_shiftedCarry_linear_self_apply (n : ℕ) (b : B) : @@ -3690,11 +3688,9 @@ private theorem continuous_shiftedCarry_linear_self_apply (n : ℕ) (b : B) : · intro u v _ _ hu hv simp_rw [map_add] convert hu.add hv using 1 - all_goals rfl · intro a v _ hv simp_rw [map_smul, smul_eq_mul] convert (continuous_const : Continuous (fun _ : CarryGroup n => a)).mul hv using 1 - all_goals rfl /-- Cross-module support for the infinite Connes-rigidity construction. -/ public @@ -5029,8 +5025,7 @@ private theorem normalizedAddHaar_preserving_addEquiv let μ := normalizedAddHaar A have : Measure.IsAddHaarMeasure (μ.map e) := e.isAddHaarMeasure_map μ he heinv - have : IsProbabilityMeasure (μ.map e) := - μ.isProbabilityMeasure_map he.measurable.aemeasurable + have : IsProbabilityMeasure (μ.map e) := inferInstance refine ⟨he.measurable, ?_⟩ exact normalizedAddHaar_unique A (μ.map e) @@ -5128,11 +5123,9 @@ private theorem continuous_shiftedCarry_right (n : ℕ) (ℓ : X) : · intro u v _ _ hu hv simp_rw [map_add] convert hu.add hv using 1 - rfl · intro r v _ hv simp_rw [map_smul, smul_eq_mul] convert (continuous_const : Continuous (fun _ : X => r)).mul hv using 1 - rfl /-- Cross-module support for the infinite Connes-rigidity construction. -/ private theorem carryTranslation_measurePreserving (n : ℕ) (a : CarryGroup n) : @@ -5164,8 +5157,7 @@ public instance carryHaar_isProbabilityMeasure (n : ℕ) : IsProbabilityMeasure (carryHaar n) := by unfold carryHaar - exact Measure.isProbabilityMeasure_map - (carryHomeomorph n).symm.continuous.measurable.aemeasurable + infer_instance /-- Cross-module support for the infinite Connes-rigidity construction. -/ public @@ -8236,8 +8228,7 @@ variable {Ω : Type*} [MeasurableSpace Ω] {μ : Measure Ω} private theorem lp_infty_ae_norm_le (f : Lp ℂ ⊤ μ) : ∀ᵐ x ∂μ, ‖f x‖ ≤ ‖f‖ := by have hnorm : lpNorm (fun x => f x) ⊤ μ = ‖f‖ := by - rw [← toReal_eLpNorm (Lp.memLp f).aestronglyMeasurable, - Lp.norm_def] + rw [← toReal_eLpNorm, Lp.norm_def] simpa only [hnorm] using (ae_le_lpNorm_exponent_top (Lp.memLp f)) diff --git a/LeanPool/InfiniteConnesRigidity/FactorAndRigidity.lean b/LeanPool/InfiniteConnesRigidity/FactorAndRigidity.lean index 4118686bea..89e4841e0c 100644 --- a/LeanPool/InfiniteConnesRigidity/FactorAndRigidity.lean +++ b/LeanPool/InfiniteConnesRigidity/FactorAndRigidity.lean @@ -2889,7 +2889,7 @@ variable [TopologicalSpace α] [MeasurableSpace α] [BorelSpace α] /-- Cross-module support for the infinite Connes-rigidity construction. -/ private def homeomorphPushProbability (e : α ≃ₜ β) (μ : ProbabilityMeasure α) : ProbabilityMeasure β := - μ.map e.continuous.measurable.aemeasurable + μ.map e /-- Cross-module support for the infinite Connes-rigidity construction. -/ private theorem homeomorphPushProbability_invariant diff --git a/LeanPool/InfiniteConnesRigidity/GroupConstruction.lean b/LeanPool/InfiniteConnesRigidity/GroupConstruction.lean index fc43927f5f..c4a144d235 100644 --- a/LeanPool/InfiniteConnesRigidity/GroupConstruction.lean +++ b/LeanPool/InfiniteConnesRigidity/GroupConstruction.lean @@ -4810,7 +4810,7 @@ private theorem measurable_polynomialCharacterCoefficient private theorem measurable_polynomialCharacterCoefficients (i : Fin 2) : Measurable (fun χ : PolynomialRankTwoCharacter => polynomialCharacterCoefficients χ i) := by - exact measurable_pi_lambda _ fun n => + exact Measurable.of_eval fun n => measurable_polynomialCharacterCoefficient i n /-- Cross-module support for the infinite Connes-rigidity construction. -/ @@ -6263,7 +6263,7 @@ private theorem shalom_normalizedFixedVector_of_relativePair ((‖p‖ : ℂ)⁻¹) • (p : W)‖ < _ rw [map_smul, ← smul_sub, norm_smul, norm_inv, Complex.norm_real, Real.norm_of_nonneg (norm_nonneg p)] - simpa only [Submodule.coe_norm, div_eq_mul_inv, mul_comm] using hfrac + simpa only [← Submodule.norm_coe, div_eq_mul_inv, mul_comm] using hfrac /-- Cross-module support for the infinite Connes-rigidity construction. -/ private theorem shalom_normalizedConstantFixedVector_of_integerPair @@ -8130,8 +8130,7 @@ private theorem blockCoefficients_map_mulLeft (f : R) (w : TensorProduct F R R) blockCoefficients ((TensorProduct.map (LinearMap.mulLeft F f) LinearMap.id) w) n = f * blockCoefficients w n := by - induction w using TensorProduct.induction_on with - | zero => simp only [map_zero, Finsupp.coe_zero, Pi.zero_apply, mul_zero] + induction w with | tmul u v => simp only [TensorProduct.map_tmul, LinearMap.mulLeft_apply, LinearMap.id_coe, id_eq, blockCoefficients_tmul, Algebra.mul_smul_comm] @@ -8292,8 +8291,7 @@ private theorem tensorCoords_transvection tensorCoords w i k + (TensorProduct.map (LinearMap.mulLeft F f) LinearMap.id) (tensorCoords w j k) := by - induction w using TensorProduct.induction_on with - | zero => simp only [map_zero, Pi.zero_apply, add_zero] + induction w using TensorProduct.inductionOn with | tmul u v => simp only [transvectionTensor, TensorProduct.congr_tmul, LinearEquiv.restrictScalars_apply, tensorCoords_tmul, transvection_linear_apply_coordinate, ↓reduceIte, hik.symm, add_zero, diff --git a/LeanPool/InfiniteConnesRigidity/SpectralAndPropertyT.lean b/LeanPool/InfiniteConnesRigidity/SpectralAndPropertyT.lean index 63746319fd..1ea4e6f78a 100644 --- a/LeanPool/InfiniteConnesRigidity/SpectralAndPropertyT.lean +++ b/LeanPool/InfiniteConnesRigidity/SpectralAndPropertyT.lean @@ -2341,8 +2341,10 @@ instance spectralOperatorAdjoin_isMulCommutative IsMulCommutative (StarAlgebra.adjoin ℂ (spectralOperatorGenerators E π)) := by apply StarAlgebra.isMulCommutative_adjoin - · exact fun _ hS _ hT ↦ spectralOperatorGenerators_commute E π hS hT - · intro S hS T hT + · exact fun _ hS ↦ ⟨spectralOperatorGenerators_commute E π + (star_mem_spectralOperatorGenerators E π hS) hS⟩ + · exact fun _ hS _ hT _ ↦ spectralOperatorGenerators_commute E π hS hT + · intro S hS T hT _ exact spectralOperatorGenerators_commute E π hS (star_mem_spectralOperatorGenerators E π hT) @@ -2352,14 +2354,13 @@ instance spectralOperatorAlgebraCommCStarAlgebra (E : SplitAbelianExtension A G H) (π : UnitaryRepresentation G V) : CommCStarAlgebra (spectralOperatorAlgebra E π) := by - letI : CommRing (spectralOperatorAlgebra E π) := - StarSubalgebra.commRingTopologicalClosure _ - (isMulCommutative_iff.mp - (spectralOperatorAdjoin_isMulCommutative E π)) + letI : IsMulCommutative (spectralOperatorAlgebra E π) := + StarSubalgebra.isMulCommutative_topologicalClosure + (StarAlgebra.adjoin ℂ (spectralOperatorGenerators E π)) letI : IsClosed (spectralOperatorAlgebra E π : Set (V →L[ℂ] V)) := (StarAlgebra.adjoin ℂ (spectralOperatorGenerators E π)).isClosed_topologicalClosure - exact { mul_comm := mul_comm } + exact { mul_comm := mul_comm' } /-- Cross-module support for the infinite Connes-rigidity construction. -/ @[expose] @@ -4117,7 +4118,7 @@ private theorem scalarOperatorKernel_posSemidef {I : Type u} (K : Matrix I I ℂ) (hK : K.PosSemidef) : (scalarOperatorKernel K).PosSemidef := by apply ((RKHS.posSemidef_tfae - (K := scalarOperatorKernel K)).out 2 0).mp + (K := scalarOperatorKernel K)).out 3 1).mp constructor · apply Matrix.IsHermitian.ext intro g h @@ -8547,15 +8548,15 @@ private theorem cornulierRowRoot_commute private theorem cornulierK₁_isMulCommutative : IsMulCommutative cornulierK₁ := by unfold cornulierK₁ apply Subgroup.isMulCommutative_closure - rintro _ ⟨i, hi, a, rfl⟩ _ ⟨j, hj, b, rfl⟩ - exact (cornulierColumnRoot_commute i j hi hj a b).eq + rintro _ ⟨i, hi, a, rfl⟩ _ ⟨j, hj, b, rfl⟩ _ + exact cornulierColumnRoot_commute i j hi hj a b /-- Cross-module support for the infinite Connes-rigidity construction. -/ private theorem cornulierK₂_isMulCommutative : IsMulCommutative cornulierK₂ := by unfold cornulierK₂ apply Subgroup.isMulCommutative_closure - rintro _ ⟨i, hi, a, rfl⟩ _ ⟨j, hj, b, rfl⟩ - exact (cornulierRowRoot_commute i j hi hj a b).eq + rintro _ ⟨i, hi, a, rfl⟩ _ ⟨j, hj, b, rfl⟩ _ + exact cornulierRowRoot_commute i j hi hj a b /-- Cross-module support for the infinite Connes-rigidity construction. -/ @[expose] diff --git a/LeanPool/IsTranscendentalPi/Main.lean b/LeanPool/IsTranscendentalPi/Main.lean index 3ff199a354..79e73f6be6 100644 --- a/LeanPool/IsTranscendentalPi/Main.lean +++ b/LeanPool/IsTranscendentalPi/Main.lean @@ -33,7 +33,7 @@ lemma isAlgebraic_pi_of_not_transcendental_pi /-- If `π` is algebraic over `ℚ`, then so is `π i`. -/ lemma isAlgebraic_I_mul_pi_of_isAlgebraic_pi (hpi : IsAlgebraic ℚ (Real.pi : ℂ)) : IsAlgebraic ℚ (Real.pi * I : ℂ) := by - simpa [mul_comm] using (isAlgebraic_iff_isIntegral.2 Complex.isIntegral_rat_I).mul hpi + simpa [mul_comm] using (isAlgebraic_iff_isIntegral.2 (Complex.isIntegral_I ℚ)).mul hpi /-- If `π i` is algebraic over `ℚ`, there is a monic rational polynomial vanishing at `π i`. -/ lemma exists_monic_rat_poly_aeval_Ipi_eq_zero diff --git a/LeanPool/JacobianDiffgeo/Finiteness/Chain.lean b/LeanPool/JacobianDiffgeo/Finiteness/Chain.lean index b9580aa341..2252a30834 100644 --- a/LeanPool/JacobianDiffgeo/Finiteness/Chain.lean +++ b/LeanPool/JacobianDiffgeo/Finiteness/Chain.lean @@ -267,7 +267,7 @@ and keeps all cross-instance defeq checks trivial. -/ noncomputable instance : AddCommGroup (NZ1 T P) := (NZ1 T P).addCommGroup -instance : IsTopologicalAddGroup (NZ1 T P) := (NZ1 T P).topologicalAddGroup +instance : IsTopologicalAddGroup (NZ1 T P) := (NZ1 T P).isTopologicalAddGroup noncomputable instance : NormedAddCommGroup (NZ1 T P) := (NZ1 T P).normedAddCommGroup diff --git a/LeanPool/JacobianDiffgeo/Path/Planar.lean b/LeanPool/JacobianDiffgeo/Path/Planar.lean index 9e28c1893f..edf33996bc 100644 --- a/LeanPool/JacobianDiffgeo/Path/Planar.lean +++ b/LeanPool/JacobianDiffgeo/Path/Planar.lean @@ -131,8 +131,7 @@ theorem Convex.isPathConnected_diff_countable {s : Set ℂ} (hs : Convex ℝ s) apply inter_subset_inter_left rw [sub_eq_add_neg _ x] refine (segment_inter_eq_endpoint_of_linearIndependent_of_ne ?_ htt'.symm c).subset - convert hy.units_smul ![-1, 1] <;> [skip; rfl; rfl] - simp [← List.ofFn_inj] + exact LinearIndependent.pair_neg_left_iff.mpr hy -- pick `t` in `Ioo (-ρ) ρ` outside both countable exceptional sets. have hopen : IsOpen (Ioo (-ρ) ρ) := isOpen_Ioo have hnonempty : (Ioo (-ρ) ρ).Nonempty := nonempty_Ioo.mpr (by linarith) diff --git a/LeanPool/JacobianDiffgeo/Surface/Identity.lean b/LeanPool/JacobianDiffgeo/Surface/Identity.lean index 2daf9915fb..a444a863a0 100644 --- a/LeanPool/JacobianDiffgeo/Surface/Identity.lean +++ b/LeanPool/JacobianDiffgeo/Surface/Identity.lean @@ -46,7 +46,7 @@ theorem map_extChartAt_nhdsNE (x : X) : (chartAt ℂ x).map_nhdsWithin_eq (mem_chart_source ℂ x) _ have h2 : 𝓝[(chartAt ℂ x) '' ((chartAt ℂ x).source ∩ {x}ᶜ)] (chartAt ℂ x x) = 𝓝[≠] (chartAt ℂ x x) := by - rw [nhdsWithin_eq_iff_eventuallyEq, Filter.eventuallyEq_set] + rw [nhdsWithin_eq_iff_eventuallyEqSet, Filter.eventuallyEqSet_iff] filter_upwards [(chartAt ℂ x).open_target.mem_nhds ((chartAt ℂ x).map_source (mem_chart_source ℂ x))] with w hw constructor diff --git a/LeanPool/JacobianDiffgeo/Surface/InverseFunction.lean b/LeanPool/JacobianDiffgeo/Surface/InverseFunction.lean index 9f19d7653b..2ffd2ef9c3 100644 --- a/LeanPool/JacobianDiffgeo/Surface/InverseFunction.lean +++ b/LeanPool/JacobianDiffgeo/Surface/InverseFunction.lean @@ -174,7 +174,7 @@ theorem mfderiv_ne_zero_iff_deriv_ne_zero {f : X → Y} {x : X} (hf : MDifferentiableAt 𝓘(ℂ) 𝓘(ℂ) f x) : mfderiv 𝓘(ℂ) 𝓘(ℂ) f x ≠ 0 ↔ deriv (writtenInExtChartAt 𝓘(ℂ) 𝓘(ℂ) x f) (extChartAt 𝓘(ℂ) x x) ≠ 0 := by - rw [hf.mfderiv, modelWithCornersSelf_coe, Set.range_id, fderivWithin_univ] + rw [hf.mfderiv_abuse, modelWithCornersSelf_coe, Set.range_id, fderivWithin_univ] refine not_congr ?_ constructor · intro h diff --git a/LeanPool/JohnsonLindenstraussLean/GaussianTail.lean b/LeanPool/JohnsonLindenstraussLean/GaussianTail.lean index 8f65da31f6..3dc2423aeb 100644 --- a/LeanPool/JohnsonLindenstraussLean/GaussianTail.lean +++ b/LeanPool/JohnsonLindenstraussLean/GaussianTail.lean @@ -46,7 +46,8 @@ theorem integrable_exp_mul_abs (t : ℝ) : have hdom : Integrable (fun x : ℝ => rexp (t * x) + rexp (-t * x)) (gaussianReal 0 1) := (integrable_exp_mul_gaussianReal t).add (integrable_exp_mul_gaussianReal (-t)) refine hdom.mono' ?_ ?_ - · exact (measurable_exp.comp ((measurable_const.mul measurable_id.abs))).aestronglyMeasurable + · exact (measurable_exp.comp + (measurable_const.mul continuous_abs.measurable)).aestronglyMeasurable · filter_upwards with x rw [Real.norm_eq_abs, abs_of_nonneg (Real.exp_pos _).le] have h1 : (0 : ℝ) ≤ rexp (t * x) := (Real.exp_pos _).le diff --git a/LeanPool/JohnsonLindenstraussLean/QJL.lean b/LeanPool/JohnsonLindenstraussLean/QJL.lean index dae3459fb1..c99b2d3256 100644 --- a/LeanPool/JohnsonLindenstraussLean/QJL.lean +++ b/LeanPool/JohnsonLindenstraussLean/QJL.lean @@ -3,7 +3,7 @@ Copyright (c) 2026 claytomode. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: claytomode -/ -import Mathlib.Data.Real.Sign +import Mathlib.Basic.Real.Sign import LeanPool.JohnsonLindenstraussLean.Rotation /-! diff --git a/LeanPool/JohnsonLindenstraussLean/QJLDistortion.lean b/LeanPool/JohnsonLindenstraussLean/QJLDistortion.lean index d20f7efec5..47172ee368 100644 --- a/LeanPool/JohnsonLindenstraussLean/QJLDistortion.lean +++ b/LeanPool/JohnsonLindenstraussLean/QJLDistortion.lean @@ -223,7 +223,7 @@ abbreviation used by the exponential distortion bound below. -/ `∫ exp(r·b) d(N(0,v)) = exp(v·r²/2)`. -/ theorem gaussianReal_mgf_id (r : ℝ) (v : ℝ≥0) : ∫ b, rexp (r * b) ∂(gaussianReal 0 v) = rexp ((v : ℝ) * r ^ 2 / 2) := by - have h := mgf_gaussianReal (X := (id : ℝ → ℝ)) (p := gaussianReal (0 : ℝ) v) Measure.map_id r + have h := mgf_gaussianReal (X := (id : ℝ → ℝ)) (p := gaussianReal (0 : ℝ) v) .id r rw [mgf] at h simpa using h diff --git a/LeanPool/KaltonRoberts/PhiDeriv.lean b/LeanPool/KaltonRoberts/PhiDeriv.lean index 69c603fe42..8428c4dd5f 100644 --- a/LeanPool/KaltonRoberts/PhiDeriv.lean +++ b/LeanPool/KaltonRoberts/PhiDeriv.lean @@ -26,94 +26,68 @@ theorem hasDerivAt_binEntropy (x : ℝ) (hx : 0 < x) (hx1 : x < 1) : HasDerivAt (fun x => -x * Real.log x - (1 - x) * Real.log (1 - x)) (Real.log (1 - x) - Real.log x) x := by convert - HasDerivAt.sub - (HasDerivAt.mul (hasDerivAt_neg x) (Real.hasDerivAt_log hx.ne')) - (HasDerivAt.mul (hasDerivAt_id x |> HasDerivAt.const_sub 1) - (HasDerivAt.log (hasDerivAt_id x |> HasDerivAt.const_sub 1) + HasDerivAt.fun_sub + (HasDerivAt.fun_mul (hasDerivAt_neg' x) (Real.hasDerivAt_log hx.ne')) + (HasDerivAt.fun_mul (hasDerivAt_id' x |> HasDerivAt.const_sub 1) + (HasDerivAt.log (hasDerivAt_id' x |> HasDerivAt.const_sub 1) (by linarith : (1 - x) ≠ 0))) using 1 - · rfl - · rfl - · ext y - simp [Pi.mul_apply, Pi.sub_apply, id_eq] - · simp [id_eq] - field_simp [hx.ne', sub_ne_zero.mpr hx1.ne'] - ring + field_simp [hx.ne', sub_ne_zero.mpr hx1.ne'] + ring theorem hasDerivAt_h_entropy_second (θ x : ℝ) (hx : 0 < x) (hxθ : x < θ) : HasDerivAt (fun x => θ * Real.log θ - x * Real.log x - (θ - x) * Real.log (θ - x)) (Real.log (θ - x) - Real.log x) x := by convert - HasDerivAt.sub - (HasDerivAt.sub (hasDerivAt_const x (θ * Real.log θ)) - (HasDerivAt.mul (hasDerivAt_id x) (Real.hasDerivAt_log hx.ne'))) - (HasDerivAt.mul (hasDerivAt_id x |> HasDerivAt.const_sub θ) - (HasDerivAt.log (hasDerivAt_id x |> HasDerivAt.const_sub θ) + HasDerivAt.fun_sub + (HasDerivAt.fun_sub (hasDerivAt_const x (θ * Real.log θ)) + (HasDerivAt.fun_mul (hasDerivAt_id' x) (Real.hasDerivAt_log hx.ne'))) + (HasDerivAt.fun_mul (hasDerivAt_id' x |> HasDerivAt.const_sub θ) + (HasDerivAt.log (hasDerivAt_id' x |> HasDerivAt.const_sub θ) (by linarith : (θ - x) ≠ 0))) using 1 - · rfl - · rfl - · ext y - simp [Pi.mul_apply, Pi.sub_apply, id_eq] - · simp [id_eq] - field_simp [hx.ne', sub_ne_zero.mpr hxθ.ne'] - ring + field_simp [hx.ne', sub_ne_zero.mpr hxθ.ne'] + ring theorem hasDerivAt_neg_entropy_scaled (r x : ℝ) (hx : 0 < x) (hx1 : x < 1) : HasDerivAt (fun x => r * x * Real.log x + r * (1 - x) * Real.log (1 - x)) (r * (Real.log x - Real.log (1 - x))) x := by convert - HasDerivAt.add - (HasDerivAt.mul (HasDerivAt.mul (hasDerivAt_const x r) (hasDerivAt_id x)) + HasDerivAt.fun_add + (HasDerivAt.fun_mul (HasDerivAt.fun_mul (hasDerivAt_const x r) (hasDerivAt_id' x)) (Real.hasDerivAt_log hx.ne')) - (HasDerivAt.mul - (HasDerivAt.mul (hasDerivAt_const x r) (hasDerivAt_id x |> HasDerivAt.const_sub 1)) - (HasDerivAt.log (hasDerivAt_id x |> HasDerivAt.const_sub 1) + (HasDerivAt.fun_mul + (HasDerivAt.fun_mul (hasDerivAt_const x r) (hasDerivAt_id' x |> HasDerivAt.const_sub 1)) + (HasDerivAt.log (hasDerivAt_id' x |> HasDerivAt.const_sub 1) (by linarith : (1 - x) ≠ 0))) using 1 - · rfl - · rfl - · ext y - simp [Pi.mul_apply, Pi.add_apply, id_eq] - · simp [id_eq] - field_simp [hx.ne', sub_ne_zero.mpr hx1.ne'] - ring + field_simp [hx.ne', sub_ne_zero.mpr hx1.ne'] + ring /-! ## Second derivatives -/ theorem hasDerivAt_binEntropy_deriv (x : ℝ) (hx : 0 < x) (hx1 : x < 1) : HasDerivAt (fun x => Real.log (1 - x) - Real.log x) (-1/(1-x) - 1/x) x := by convert - HasDerivAt.sub - (HasDerivAt.log (hasDerivAt_id x |> HasDerivAt.const_sub 1) + HasDerivAt.fun_sub + (HasDerivAt.log (hasDerivAt_id' x |> HasDerivAt.const_sub 1) (by linarith : (1 - x) ≠ 0)) (Real.hasDerivAt_log hx.ne') using 1 - · rfl - · rfl - · ext y - rfl - · simp [id_eq, one_div, sub_eq_add_neg] + simp [one_div] theorem hasDerivAt_h_entropy_second_deriv (θ x : ℝ) (hx : 0 < x) (hxθ : x < θ) : HasDerivAt (fun x => Real.log (θ - x) - Real.log x) (-1/(θ-x) - 1/x) x := by convert - HasDerivAt.sub - (HasDerivAt.log (hasDerivAt_id x |> HasDerivAt.const_sub θ) + HasDerivAt.fun_sub + (HasDerivAt.log (hasDerivAt_id' x |> HasDerivAt.const_sub θ) (by linarith : (θ - x) ≠ 0)) (Real.hasDerivAt_log hx.ne') using 1 - · rfl - · rfl - · ext y - rfl - · simp [id_eq, one_div, sub_eq_add_neg] + simp [one_div] theorem hasDerivAt_neg_entropy_scaled_deriv (r x : ℝ) (hx : 0 < x) (hx1 : x < 1) : HasDerivAt (fun x => r * (Real.log x - Real.log (1 - x))) (r * (1/x + 1/(1-x))) x := by convert HasDerivAt.const_mul r - (HasDerivAt.sub (Real.hasDerivAt_log hx.ne') + (HasDerivAt.fun_sub (Real.hasDerivAt_log hx.ne') (HasDerivAt.log (hasDerivAt_id' x |> HasDerivAt.const_sub 1) (by linarith))) using 1 - · rfl - · rfl - · simp_all - · ring_nf + ring_nf /-! ## Derivative of Phi -/ @@ -171,23 +145,20 @@ theorem hasDerivAt_Phi (r θ x : ℝ) (hx : 0 < x) (hxθ : x < θ) (hx1 : x < 1) r * (log x - log (1 - x))) x := by convert - HasDerivAt.add - (HasDerivAt.add - (HasDerivAt.add - (HasDerivAt.add - (HasDerivAt.add - (HasDerivAt.add - (HasDerivAt.add (hasDerivAt_binEntropy x hx hx1) (hasDerivAt_const x 0)) + HasDerivAt.fun_add + (HasDerivAt.fun_add + (HasDerivAt.fun_add + (HasDerivAt.fun_add + (HasDerivAt.fun_add + (HasDerivAt.fun_add + (HasDerivAt.fun_add (hasDerivAt_binEntropy x hx hx1) (hasDerivAt_const x 0)) (hasDerivAt_h_entropy_second θ x hx hxθ)) (hasDerivAt_id' x |> HasDerivAt.mul_const <| hEntropy (r / θ) r)) (hasDerivAt_neg_entropy_scaled r x hx hx1)) (hasDerivAt_const x 0)) (hasDerivAt_const x 0)) (hasDerivAt_const x 0) using 1 - · rfl - · rfl · ext y - simp [Pi.add_apply] ring · unfold hEntropy ring @@ -205,18 +176,14 @@ theorem hasDerivAt_Phi_second (r θ x : ℝ) (hx : 0 < x) (hxθ : x < θ) (hx1 : + r * (Real.log x - Real.log (1 - x))) (Phi'' r θ x) x := by convert - HasDerivAt.add - (HasDerivAt.add - (HasDerivAt.add (hasDerivAt_binEntropy_deriv x hx hx1) + HasDerivAt.fun_add + (HasDerivAt.fun_add + (HasDerivAt.fun_add (hasDerivAt_binEntropy_deriv x hx hx1) (hasDerivAt_h_entropy_second_deriv θ x hx hxθ)) (hasDerivAt_const x (r / θ * Real.log (r / θ) - r * Real.log r - (r / θ - r) * Real.log (r / θ - r)))) (hasDerivAt_neg_entropy_scaled_deriv r x hx hx1) using 1 - · rfl - · rfl - · ext y - simp [Pi.add_apply] · unfold Phi'' field_simp [hx.ne', sub_ne_zero.mpr hx1.ne', sub_ne_zero.mpr hxθ.ne'] ring diff --git a/LeanPool/Koethe/MultiProjective.lean b/LeanPool/Koethe/MultiProjective.lean index b4c2f20bee..3d5fe952a4 100644 --- a/LeanPool/Koethe/MultiProjective.lean +++ b/LeanPool/Koethe/MultiProjective.lean @@ -93,7 +93,7 @@ theorem Balanced.add_iff_right {d e : Vars N →₀ ℕ} (hd : Balanced d) : /-- Coefficientwise multihomogeneity with a specified degree in each block. -/ def IsMultiHomogeneous [CommSemiring k] (f : MvPolynomial (Vars N) k) (r : Fin N → ℕ) : Prop := - ∀ d, coeff d f ≠ 0 → ∀ b, blockDegree d b = r b + ∀ d, f.coeff d ≠ 0 → ∀ b, blockDegree d b = r b /-- Every nonzero monomial has the same degree `r` in every block. -/ def IsMultiHomogeneousOfDegree [CommSemiring k] (f : MvPolynomial (Vars N) k) @@ -103,7 +103,7 @@ def IsMultiHomogeneousOfDegree [CommSemiring k] (f : MvPolynomial (Vars N) k) /-- Polynomials all of whose monomials have balanced block degrees. Different monomials may have different common degrees. -/ def HasBalancedSupport [CommSemiring k] (f : MvPolynomial (Vars N) k) : Prop := - ∀ d, coeff d f ≠ 0 → Balanced d + ∀ d, f.coeff d ≠ 0 → Balanced d theorem IsMultiHomogeneousOfDegree.hasBalancedSupport [CommSemiring k] {f : MvPolynomial (Vars N) k} {r : ℕ} (hf : IsMultiHomogeneousOfDegree f r) : @@ -138,9 +138,9 @@ theorem IsMultiHomogeneous.add {p q : MvPolynomial (Vars N) k} {r : Fin N → (hp : IsMultiHomogeneous p r) (hq : IsMultiHomogeneous q r) : IsMultiHomogeneous (p + q) r := by intro d hd - by_cases h : coeff d p = 0 + by_cases h : p.coeff d = 0 · apply hq d - simpa [coeff_add, h] using hd + simpa [h] using hd · exact hp d h theorem IsMultiHomogeneous.smul {p : MvPolynomial (Vars N) k} {r : Fin N → ℕ} @@ -204,9 +204,9 @@ theorem hasBalancedSupport_add {p q : MvPolynomial (Vars N) k} (hp : HasBalancedSupport p) (hq : HasBalancedSupport q) : HasBalancedSupport (p + q) := by intro d hd - by_cases h : coeff d p = 0 + by_cases h : p.coeff d = 0 · apply hq d - simpa [coeff_add, h] using hd + simpa [h] using hd · exact hp d h theorem hasBalancedSupport_mul {p q : MvPolynomial (Vars N) k} @@ -216,8 +216,8 @@ theorem hasBalancedSupport_mul {p q : MvPolynomial (Vars N) k} intro d hd rw [coeff_mul] at hd obtain ⟨⟨e, f⟩, hef, h⟩ := Finset.exists_ne_zero_of_sum_ne_zero hd - have he : coeff e p ≠ 0 := left_ne_zero_of_mul h - have hf : coeff f q ≠ 0 := right_ne_zero_of_mul h + have he : p.coeff e ≠ 0 := left_ne_zero_of_mul h + have hf : q.coeff f ≠ 0 := right_ne_zero_of_mul h rw [← Finset.HasAntidiagonal.mem_antidiagonal.mp hef] exact (hp e he).add (hq f hf) @@ -325,7 +325,7 @@ theorem monomial_mem_adjoin_segre {d : Vars N →₀ ℕ} {r : ℕ} simp only [blockDegree_add, blockDegree_segreExponent, hd b] at h omega have hm : monomial d a = segreMonomial j * monomial (d - segreExponent j) a := by - rw [segreMonomial_eq_monomial, monomial_mul, one_mul, hde] + rw [segreMonomial_eq_monomial, monomial_mul_monomial, one_mul, hde] rw [hm] exact Subalgebra.mul_mem _ (Algebra.subset_adjoin ⟨j, rfl⟩) (ih hrem) @@ -365,8 +365,8 @@ def balancedPart : MvPolynomial (Vars N) k →ₗ[k] MvPolynomial (Vars N) k whe map_smul' _ _ := by simp [Finsupp.filter_smul] @[simp] theorem coeff_balancedPart (p : MvPolynomial (Vars N) k) (d : Vars N →₀ ℕ) : - coeff d (balancedPart p) = if Balanced d then coeff d p else 0 := by - simp [balancedPart, MvPolynomial.coeff, Finsupp.filter_apply] + (balancedPart p).coeff d = if Balanced d then p.coeff d else 0 := by + simp [balancedPart, Finsupp.filter_apply] theorem balancedPart_mem (p : MvPolynomial (Vars N) k) : balancedPart p ∈ balancedAlgebra k N := by @@ -382,7 +382,7 @@ theorem balancedPart_mem (p : MvPolynomial (Vars N) k) : rw [coeff_balancedPart] by_cases h : Balanced d · simp [h] - · have hc : coeff d p = 0 := by + · have hc : p.coeff d = 0 := by by_contra hc exact h (hp d hc) simp [h, hc] @@ -394,7 +394,8 @@ theorem balancedPart_mem (p : MvPolynomial (Vars N) k) : rw [coeff_balancedPart] rcases eq_or_ne d e with rfl | hde · split_ifs <;> simp [coeff_monomial] - · simp [coeff_monomial, hde, apply_ite (coeff e)] + · simp [coeff_monomial, hde, + apply_ite (fun p : MvPolynomial (Vars N) k => p.coeff e)] theorem balancedPart_monomial_mul {d : Vars N →₀ ℕ} (hd : Balanced d) (a : k) (q : MvPolynomial (Vars N) k) : @@ -402,9 +403,9 @@ theorem balancedPart_monomial_mul {d : Vars N →₀ ℕ} (hd : Balanced d) classical induction q using MvPolynomial.induction_on' with | monomial e b => - rw [monomial_mul, balancedPart_monomial, balancedPart_monomial] + rw [monomial_mul_monomial, balancedPart_monomial, balancedPart_monomial] simp only [hd.add_iff_right] - split_ifs <;> simp [monomial_mul] + split_ifs <;> simp [monomial_mul_monomial] | add p q hp hq => simp only [mul_add, map_add, hp, hq] @@ -416,12 +417,12 @@ theorem balancedPart_mul {p : MvPolynomial (Vars N) k} classical calc balancedPart (p * q) = - balancedPart ((∑ d ∈ p.support, monomial d (coeff d p)) * q) := by + balancedPart ((∑ d ∈ p.support, monomial d (p.coeff d)) * q) := by congr 2 exact p.as_sum - _ = ∑ d ∈ p.support, balancedPart (monomial d (coeff d p) * q) := by + _ = ∑ d ∈ p.support, balancedPart (monomial d (p.coeff d) * q) := by simp only [Finset.sum_mul, map_sum] - _ = ∑ d ∈ p.support, monomial d (coeff d p) * balancedPart q := by + _ = ∑ d ∈ p.support, monomial d (p.coeff d) * balancedPart q := by apply Finset.sum_congr rfl intro d hd exact balancedPart_monomial_mul (hp d (mem_support_iff.mp hd)) _ _ @@ -672,7 +673,7 @@ variable [Field k] theorem IsMultiHomogeneousOfDegree.constantCoeff_eq_zero [NeZero N] {f : MvPolynomial (Vars N) k} {r : ℕ} (hf : IsMultiHomogeneousOfDegree f r) (hr : 0 < r) : constantCoeff f = 0 := by - change coeff 0 f = 0 + change f.coeff 0 = 0 by_contra h have hdeg := hf 0 h (0 : Fin N) simp only [blockDegree_zero] at hdeg @@ -742,7 +743,7 @@ theorem exists_common_zero_balanced {q : ℕ} (hq : q ≤ 2 * N) have hmin : vertexIdeal k N ∈ (Ideal.span (Set.range f)).minimalPrimes := by rw [← Ideal.radical_minimalPrimes, hrad, Ideal.minimalPrimes_eq_subsingleton_self] exact Set.mem_singleton _ - have hupper := Ideal.height_le_card_of_mem_minimalPrimes_span (Set.finite_range f) hmin + have hupper := Ideal.height_le_ncard_of_mem_minimalPrimes_span (Set.finite_range f) hmin have hcard : (Set.range f).ncard ≤ q := by simpa only [Set.image_univ, Set.ncard_univ, Nat.card_fin] using (Set.ncard_image_le (s := Set.univ) (f := f) Set.finite_univ) @@ -786,7 +787,7 @@ of coefficients and blockwise sums of exponents. -/ theorem exists_common_zero_of_coeff [Field k] [IsAlgClosed k] {q r : ℕ} (f : Fin q → MvPolynomial (Fin N × Fin 3) k) (hN : 0 < N) (hr : 0 < r) (hq : q ≤ 2 * N) - (hf : ∀ i d, coeff d (f i) ≠ 0 → ∀ b : Fin N, ∑ j : Fin 3, d (b, j) = r) : + (hf : ∀ i d, (f i).coeff d ≠ 0 → ∀ b : Fin N, ∑ j : Fin 3, d (b, j) = r) : ∃ x : (Fin N × Fin 3) → k, (∀ b : Fin N, (fun j : Fin 3 => x (b, j)) ≠ 0) ∧ ∀ i : Fin q, eval x (f i) = 0 := diff --git a/LeanPool/Koethe/Pencil.lean b/LeanPool/Koethe/Pencil.lean index 56ac1d208a..cd7d402ae7 100644 --- a/LeanPool/Koethe/Pencil.lean +++ b/LeanPool/Koethe/Pencil.lean @@ -7,7 +7,7 @@ import Mathlib.Algebra.Algebra.Defs import Mathlib.Algebra.Field.Defs import Mathlib.Algebra.Notation.Pi.Defs import Mathlib.Algebra.Polynomial.Basic -import Mathlib.Data.Countable.Basic +import Mathlib.Basic.Countable.Basic import Mathlib.Data.Finset.Card import Mathlib.Data.Fintype.Basic import Mathlib.Data.Matrix.Mul diff --git a/LeanPool/KrafftSieve/Basic.lean b/LeanPool/KrafftSieve/Basic.lean index 8bbf66d06e..7ee9d1a23b 100644 --- a/LeanPool/KrafftSieve/Basic.lean +++ b/LeanPool/KrafftSieve/Basic.lean @@ -107,9 +107,9 @@ theorem q_bound (n : ℕ) (hn : n ≥ 1) : 6 * n^2 + 10 * n + 3 < q n := by have h_q_large : q n ≥ 5 ^ (Nat.log 2 n) := by have h_q_large : q n ≥ 5 ^ (Finset.card (Finset.filter (fun p => 5 ≤ p ∧ p.Prime) (Finset.range (6 * n + 2)))) := by - exact le_trans ( by norm_num ) ( Finset.prod_le_prod' fun x hx => + exact le_trans ( by norm_num ) ( Finset.prod_le_prod fun x hx => show x ≥ 5 from Finset.mem_filter.mp hx |>.2.1 ) |> le_trans <| - Finset.prod_le_prod_of_subset_of_one_le' ( Finset.filter_subset_filter _ <| + Finset.prod_le_prod_of_subset_of_one_le ( Finset.filter_subset_filter _ <| Finset.range_mono <| Nat.le_refl _ ) fun x hx _ => Nat.one_le_iff_ne_zero.mpr <| Nat.Prime.ne_zero <| Finset.mem_filter.mp hx |>.2.2 refine le_trans ?_ h_q_large @@ -173,10 +173,17 @@ theorem q_bound (n : ℕ) (hn : n ≥ 1) : 6 * n^2 + 10 * n + 3 < q n := by rw [ pow_succ' ]; linarith nlinarith only [ hn_large, Nat.div_add_mod n 2, Nat.mod_lt n two_pos, h_exp_growth, ‹5 ^ Nat.log 2 n ≥ 5 ^ ( Nat.log 2 ( n / 2 ) + 1 ) › ] - · have : Nat.log 2 n ≥ 29 := Nat.le_log_of_pow_le ( by decide ) ( by linarith ) - ( have : Nat.log 2 n ≤ 29 := Nat.le_of_lt_succ ( Nat.log_lt_of_lt_pow ( by linarith ) - ( by linarith ) ); interval_cases Nat.log 2 n; norm_num at * ) - nlinarith only [ hn, hn_large ] + · have h_log_ge : Nat.log 2 n ≥ 29 := Nat.le_log_of_pow_le ( by norm_num ) ( by linarith ) + have h_pow_ge : ( 186264514923095703125 : ℕ ) ≤ 5 ^ Nat.log 2 n := by + calc ( 186264514923095703125 : ℕ ) = 5 ^ 29 := by norm_num + _ ≤ 5 ^ Nat.log 2 n := Nat.pow_le_pow_right ( by norm_num ) h_log_ge + have h_n_le : n ≤ 1073741823 := by + have := not_le.mp hn_large + omega + have h_sq_le : n ^ 2 ≤ 1152921502459363329 := by + calc n ^ 2 ≤ 1073741823 ^ 2 := Nat.pow_le_pow_left h_n_le 2 + _ = 1152921502459363329 := by norm_num + linarith only [ h_pow_ge, h_n_le, h_sq_le ] exact h_exp_growth n hn_large.le end diff --git a/LeanPool/KrafftSieve/Defs.lean b/LeanPool/KrafftSieve/Defs.lean index dbf306223f..f2840e4f59 100644 --- a/LeanPool/KrafftSieve/Defs.lean +++ b/LeanPool/KrafftSieve/Defs.lean @@ -18,12 +18,12 @@ import Mathlib.Algebra.Group.Pointwise.Finset.Basic import Mathlib.Analysis.Complex.Exponential import Mathlib.Analysis.SpecialFunctions.Complex.Log import Mathlib.Analysis.SpecialFunctions.Trigonometric.Complex +import Mathlib.Basic.Real.Basic import Mathlib.CategoryTheory.Category.Basic import Mathlib.Data.Finset.Sort import Mathlib.Data.Nat.Basic import Mathlib.Data.Nat.Nth import Mathlib.Data.Nat.Prime.Basic -import Mathlib.Data.Real.Basic import Mathlib.Data.ZMod.QuotientRing import Mathlib.NumberTheory.ArithmeticFunction.Defs import Mathlib.NumberTheory.Bertrand diff --git a/LeanPool/KrafftSieve/ThirdHarmonic.lean b/LeanPool/KrafftSieve/ThirdHarmonic.lean index 5cf3617602..448db3f44c 100644 --- a/LeanPool/KrafftSieve/ThirdHarmonic.lean +++ b/LeanPool/KrafftSieve/ThirdHarmonic.lean @@ -581,7 +581,7 @@ private lemma dirac_comb_zero_split_sum (n : ℕ) (i : Fin (w n)) (h : ZMod (q n · intro a₁ a₂ h have := Fact.mk (show 1 < q n from ?_) · exact ZMod.val_injective _ h - refine lt_of_lt_of_le ?_ (Finset.prod_le_prod' fun x hx => + refine lt_of_lt_of_le ?_ (Finset.prod_le_prod fun x hx => Nat.Prime.two_le <| Finset.mem_filter.mp hx |>.2.2) norm_num [q] exact Finset.Nonempty.ne_empty ⟨5, Finset.mem_filter.mpr ⟨ diff --git a/LeanPool/Lean4GlCoalgebras/General/Completeness.lean b/LeanPool/Lean4GlCoalgebras/General/Completeness.lean index 73b1d143b7..cb6dd0a4ee 100644 --- a/LeanPool/Lean4GlCoalgebras/General/Completeness.lean +++ b/LeanPool/Lean4GlCoalgebras/General/Completeness.lean @@ -1668,7 +1668,6 @@ lemma builder_win_strong {Δ : Sequent} (strat : Strategy coalgebraGame Builder) nonBoxMove (Sum.inr R, Γ :: Γs, Rs) (π[π.length - (i + 1 + 1) - 1 + 1 + 1]'(by grind)) := by convert u₁_u₂ - exact u₁_def have u₁_u₂_mem := move_iff_in_moves.1 u₁_u₂.1 change π[π.length - (i + 1 + 1) - 1 + 1 + 1] ∈ Finset.filterMap diff --git a/LeanPool/Lean4GlCoalgebras/General/Soundness.lean b/LeanPool/Lean4GlCoalgebras/General/Soundness.lean index 9c14830c38..bbf19f27c5 100644 --- a/LeanPool/Lean4GlCoalgebras/General/Soundness.lean +++ b/LeanPool/Lean4GlCoalgebras/General/Soundness.lean @@ -7,7 +7,7 @@ Authors: Madeleine Gignoux import Mathlib.Data.Finset.Basic import Mathlib.Order.CompleteLattice.Basic import Mathlib.Order.FixedPoints -import Mathlib.Data.Set.Lattice +import Mathlib.Data.Set.Lattice.Indexed import LeanPool.Lean4GlCoalgebras.Logic.Semantics import LeanPool.Lean4GlCoalgebras.General.Proof diff --git a/LeanPool/Lean4GlCoalgebras/Logic/Semantics.lean b/LeanPool/Lean4GlCoalgebras/Logic/Semantics.lean index 951fbb70d5..7bcb7bd34e 100644 --- a/LeanPool/Lean4GlCoalgebras/Logic/Semantics.lean +++ b/LeanPool/Lean4GlCoalgebras/Logic/Semantics.lean @@ -7,7 +7,7 @@ Authors: Madeleine Gignoux import Mathlib.Data.Finset.Basic import Mathlib.Order.CompleteLattice.Basic import Mathlib.Order.FixedPoints -import Mathlib.Data.Set.Lattice +import Mathlib.Data.Set.Lattice.Indexed import LeanPool.Lean4GlCoalgebras.Logic.Syntax /-! ## Semantics of GL diff --git a/LeanPool/Lean4GlCoalgebras/Split/Completeness.lean b/LeanPool/Lean4GlCoalgebras/Split/Completeness.lean index c8f4578d55..b2925e5915 100644 --- a/LeanPool/Lean4GlCoalgebras/Split/Completeness.lean +++ b/LeanPool/Lean4GlCoalgebras/Split/Completeness.lean @@ -1981,7 +1981,6 @@ lemma builder_win_strong_left_succ {Δ : SplitSequent} nonBoxMove (Sum.inr R, Γ :: Γs, Rs) (π[π.length - (i + 1 + 1) - 1 + 1 + 1]'(by grind)) := by convert raw_u₁_u₂ -- dont understand why simp or rw doesn't do this - exact u₁_def have u₁_u₂_mem := move_iff_in_moves.1 move_u₁_u₂.1 unfold Game.Pos.moves Game.moves at u₁_u₂_mem simp only [List.mem_cons, Finset.mem_filterMap, Option.ite_none_left_eq_some, not_or, @@ -2226,7 +2225,6 @@ lemma builder_win_strong_right_succ {Δ : SplitSequent} nonBoxMove (Sum.inr R, Γ :: Γs, Rs) (π[π.length - (i + 1 + 1) - 1 + 1 + 1]'(by grind)) := by convert raw_u₁_u₂ -- dont understand why simp or rw doesn't do this - exact u₁_def have u₁_u₂_mem := move_iff_in_moves.1 move_u₁_u₂.1 unfold Game.Pos.moves Game.moves at u₁_u₂_mem simp only [List.mem_cons, Finset.mem_filterMap, Option.ite_none_left_eq_some, not_or, diff --git a/LeanPool/Lean4GlCoalgebras/Split/Soundness.lean b/LeanPool/Lean4GlCoalgebras/Split/Soundness.lean index f29e5b2b7f..f201ddf7d1 100644 --- a/LeanPool/Lean4GlCoalgebras/Split/Soundness.lean +++ b/LeanPool/Lean4GlCoalgebras/Split/Soundness.lean @@ -7,7 +7,7 @@ Authors: Madeleine Gignoux import Mathlib.Data.Finset.Basic import Mathlib.Order.CompleteLattice.Basic import Mathlib.Order.FixedPoints -import Mathlib.Data.Set.Lattice +import Mathlib.Data.Set.Lattice.Indexed import LeanPool.Lean4GlCoalgebras.Logic.Semantics import LeanPool.Lean4GlCoalgebras.Split.Proof import LeanPool.Lean4GlCoalgebras.Split.CutProof diff --git a/LeanPool/Lean4Itree/ITree/Basic.lean b/LeanPool/Lean4Itree/ITree/Basic.lean index 7188f0d5e8..286826f1fe 100644 --- a/LeanPool/Lean4Itree/ITree/Basic.lean +++ b/LeanPool/Lean4Itree/ITree/Basic.lean @@ -152,8 +152,8 @@ def dMatchOn {motive : ITree ε ρ → Sort u} (x : ITree ε ρ) ret v (by rw [elim0_eq_all snd] at hm simp only [ITree.ret, ret'] - rw [←hm] - exact (PFunctor.M.mk_dest x).symm + rw [← PFunctor.M.mk_dest x, hm] + rfl ) | ⟨.tau, c⟩ => tau (c 0) (by @@ -164,8 +164,8 @@ def dMatchOn {motive : ITree ε ρ → Sort u} (x : ITree ε ρ) | ⟨.vis α e, k⟩ => vis α e k (by simp only [ITree.vis, vis'] - rw [←hm] - exact (PFunctor.M.mk_dest x).symm + rw [← PFunctor.M.mk_dest x, hm] + rfl ) /- Destructor utilities -/ diff --git a/LeanPool/Lean4Itree/ITree/Utils.lean b/LeanPool/Lean4Itree/ITree/Utils.lean index 5811a770b2..95e57b85bd 100644 --- a/LeanPool/Lean4Itree/ITree/Utils.lean +++ b/LeanPool/Lean4Itree/ITree/Utils.lean @@ -61,11 +61,11 @@ theorem PFunctor.M.unfold_corec'_left {P : PFunctor.{uA, uB}} {α : Type u} (h_eq : ∀ l, F (.inl l) = ⟨l.dest.1, Sum.inl ∘ l.dest.2⟩) : ∀ l, PFunctor.M.corec F (.inl l) = l := by intros - apply PFunctor.M.bisim (fun t1 t2 => t1 = PFunctor.M.corec _ (Sum.inl t2)) _ _ _ rfl + apply PFunctor.M.bisim (fun t1 t2 => t1 = PFunctor.M.corec F (Sum.inl t2)) ?_ _ _ rfl intros t1 t2 h; subst h - simp only [PFunctor.M.dest_corec, PFunctor.map, h_eq] - have ⟨a, g⟩ := t2.dest - exact ⟨_, _, _, rfl, rfl, fun _ => rfl⟩ + refine ⟨t2.dest.fst, _, t2.dest.snd, ?_, rfl, fun _ => rfl⟩ + rw [PFunctor.M.dest_corec, h_eq] + rfl theorem PFunctor.M.unfold_corec' {P : PFunctor.{uA, uB}} {α : Type u} (F : ∀ {X : Type (max u uA uB)}, (α → X) → α → P.M ⊕ P X) (x : α) : @@ -76,27 +76,39 @@ theorem PFunctor.M.unfold_corec' {P : PFunctor.{uA, uB}} {α : Type u} match g i with | .inl l => l | .inr r => .corec' F r⟩ := by - conv => - lhs - simp only [PFunctor.M.corec', PFunctor.M.corec₁, PFunctor.M.corec_def, PFunctor.map, - Sum.bind, Function.id_comp] - match F (@Sum.inr P.M α) x with - | .inl v => - simp only - conv => rhs; rw [← (PFunctor.M.mk_dest v)] - congr - have ⟨a, g⟩ := v.dest - simp only; congr; funext i - apply unfold_corec'_left _ (fun _ => rfl) - | .inr ⟨a, g⟩ => - simp only; congr; funext i - simp only [Function.comp] - match g i with - | .inl l => - simp only - apply unfold_corec'_left _ (fun _ => rfl) - | .inr r => - simp only [PFunctor.M.corec', PFunctor.M.corec₁, PFunctor.map, Sum.bind, Function.id_comp] + have main : ∀ G : P.M ⊕ α → P (P.M ⊕ α), + (∀ l : P.M, G (.inl l) = P.map Sum.inl l.dest) → + (∀ (a : α) (l : P.M), F (@Sum.inr P.M α) a = .inl l → G (.inr a) = P.map Sum.inl l.dest) → + (∀ (a : α) (w : P (P.M ⊕ α)), F (@Sum.inr P.M α) a = .inr w → G (.inr a) = w) → + ∀ a : α, PFunctor.M.corec G (.inr a) = + match F (@Sum.inr P.M α) a with + | .inl l => l + | .inr ⟨b, g⟩ => .mk ⟨b, fun i ↦ + match g i with + | .inl l => l + | .inr r => PFunctor.M.corec G (.inr r)⟩ := by + intro G hl hinl hinr a + have key : ∀ l : P.M, PFunctor.M.corec G (Sum.inl l) = l := + unfold_corec'_left G hl + rw [PFunctor.M.corec_def] + rcases hF : F (@Sum.inr P.M α) a with v | ⟨b, g⟩ + · simp only + rw [hinl a v hF, PFunctor.map_map, + show (PFunctor.M.corec G ∘ Sum.inl) = id from funext key, + PFunctor.id_map, PFunctor.M.mk_dest] + · simp only + rw [hinr a _ hF] + refine congrArg PFunctor.M.mk (congrArg (PFunctor.Obj.mk b) (funext fun i ↦ ?_)) + change PFunctor.M.corec G (g i) = _ + match g i with + | .inl l => exact key l + | .inr r => rfl + simp only [PFunctor.M.corec', PFunctor.M.corec₁] + refine main _ (fun _ ↦ rfl) ?_ ?_ x + · intro a l h + simp only [Sum.bind, Function.id_comp, h] + · intro a w h + simp only [Sum.bind, Function.id_comp, h] end Lean4Itree diff --git a/LeanPool/Lean4Itree/Paco/PacoTactics.lean b/LeanPool/Lean4Itree/Paco/PacoTactics.lean index 90e990d423..838b09ba29 100644 --- a/LeanPool/Lean4Itree/Paco/PacoTactics.lean +++ b/LeanPool/Lean4Itree/Paco/PacoTactics.lean @@ -84,7 +84,10 @@ private def rewriteLocalWith (mvarId : MVarId) (fvarId : FVarId) return replacement.mvarId :: result.mvarIds /-- Initialise a parameterized-coinduction proof: mark the context and unfold the -goal's `lfp_monotone` fixed point so the Paco combinators can act on it. -/ +goal's `lfp_monotone` fixed point so the Paco combinators can act on it. + +The variant `pinit at h` initialises the proof from a fixed-point hypothesis `h` +instead of from the goal. -/ elab "pinit" : tactic => Tactic.liftMetaTactic λ mvarId => do let mark := Expr.const ``paco_mark.mk_paco_mark [] @@ -261,7 +264,7 @@ elab_rules : tactic | throwError "Cannot find hypothesis of name {h.getId}" rewriteLocalWith mvarId decl.fvarId (← mkPlfpUnfoldProof decl.type) -/-- Initialise a parameterized-coinduction proof from a fixed-point hypothesis `h`. -/ +@[tactic_alt tacticPinit] elab "pinit" " at " h:ident : tactic => Tactic.withMainContext do let some hyp := (← getLCtx).findDecl? (λ ldecl => diff --git a/LeanPool/LeanComplexAnalysis/Harmonic/Positive/HerglotzRieszRepresentations.lean b/LeanPool/LeanComplexAnalysis/Harmonic/Positive/HerglotzRieszRepresentations.lean index dc6695383a..02760c340c 100644 --- a/LeanPool/LeanComplexAnalysis/Harmonic/Positive/HerglotzRieszRepresentations.lean +++ b/LeanPool/LeanComplexAnalysis/Harmonic/Positive/HerglotzRieszRepresentations.lean @@ -888,8 +888,8 @@ lemma analytic_unique_of_real_part _ < 1 := hz convert HasDerivAt.deriv (HasDerivAt.comp (t : ℂ) ( h_analytic.differentiableOn.differentiableAt (isOpen_ball.mem_nhds hmem) |> - DifferentiableAt.hasDerivAt) (hasDerivAt_mul_const z)) using 2 <;> - rfl + DifferentiableAt.hasDerivAt) (hasDerivAt_mul_const z)) using 2 + rfl simp_all only [mem_ball, dist_zero_right, mem_Icc, mul_eq_zero] exact Or.inl <| h_const _ <| by simpa [abs_of_nonneg ht.1] using lt_of_le_of_lt ( mul_le_of_le_one_left (norm_nonneg _) ht.2) hz diff --git a/LeanPool/LeanComplexAnalysis/UnivalentFunctions/ClassS.lean b/LeanPool/LeanComplexAnalysis/UnivalentFunctions/ClassS.lean index 9a030752e6..a0d0cb8260 100644 --- a/LeanPool/LeanComplexAnalysis/UnivalentFunctions/ClassS.lean +++ b/LeanPool/LeanComplexAnalysis/UnivalentFunctions/ClassS.lean @@ -383,9 +383,10 @@ lemma exists_log_of_analytic_nonzero_on_ball (f : ℂ → ℂ) intro z hz; rw [← hH_const z hz, mul_assoc, ← exp_add, neg_add_cancel, exp_zero, mul_one] obtain ⟨c, hc⟩ : ∃ c : ℂ, H 0 = exp c := ⟨log (H 0), by rw [exp_log (mul_ne_zero (hf_ne_zero 0 (by norm_num)) (exp_ne_zero _))]⟩ - refine ⟨fun z => c + g0 z, ?_, ?_⟩ <;> norm_num [hc] at * + refine ⟨fun z => c + g0 z, ?_, fun z hz => ?_⟩ · exact AnalyticOn.add analyticOn_const hg0_anal - · exact fun z hz => by rw [hf_eq z hz, exp_add] + · rw [exp_add, ← hc] + exact (hf_eq z hz).symm /-- For any function `f` in `classS`, there exists an analytic function `h` on the unit disc such that diff --git a/LeanPool/LeanModularForms/ForMathlib/CongruenceSubgrps.lean b/LeanPool/LeanModularForms/ForMathlib/CongruenceSubgrps.lean index df786908bc..6989a1ce36 100644 --- a/LeanPool/LeanModularForms/ForMathlib/CongruenceSubgrps.lean +++ b/LeanPool/LeanModularForms/ForMathlib/CongruenceSubgrps.lean @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Chris Birkbeck -/ -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic import Mathlib.GroupTheory.Archimedean import Mathlib.LinearAlgebra.Matrix.Integer import Mathlib.LinearAlgebra.Matrix.GeneralLinearGroup.Defs diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/ArcCalculus.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/ArcCalculus.lean index 58e7873ff3..2f91a09bde 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/ArcCalculus.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/ArcCalculus.lean @@ -78,7 +78,8 @@ private lemma unitArc_angle_hasDerivAt (θ₁ θ₂ a b t : ℝ) (_hab : b - a have h1 : HasDerivAt (fun s => (s - a) / (b - a) * (θ₂ - θ₁)) ((θ₂ - θ₁) / (b - a)) t := by have hmul := hd.mul_const (θ₂ - θ₁) - convert hmul using 2 <;> first + convert hmul using 2 + first | rfl | ring simpa using h1.const_add θ₁ diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/CauchyPrimitive.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/CauchyPrimitive.lean index 5485b94816..f43b8d0476 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/CauchyPrimitive.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/CauchyPrimitive.lean @@ -79,9 +79,7 @@ private lemma integral_t_mul_deriv_eq {f : ℂ → ℂ} {S : Set ℂ} have h3 : HasDerivAt (fun _ : ℝ => c) 0 t := hasDerivAt_const t c convert h3.add h2 using 1 - · rfl - · rfl - · ring + ring have hv_deriv : ∀ x ∈ Set.Ioo (min 0 1) (max 0 1), HasDerivAt v (v' x) x := by intro t ht @@ -93,8 +91,8 @@ private lemma integral_t_mul_deriv_eq {f : ℂ → ℂ} {S : Set ℂ} simp only [smul_eq_mul] at h_chain convert h_chain using 1 · rfl - · rfl - · ring + · simp only [γ] + ring have hu'_int : IntervalIntegrable u' MeasureTheory.volume 0 1 := ContinuousOn.intervalIntegrable continuousOn_const have hv'_int : IntervalIntegrable v' MeasureTheory.volume 0 1 := by diff --git a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/SectorCurve.lean b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/SectorCurve.lean index c2b1326b9c..43a1e42279 100644 --- a/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/SectorCurve.lean +++ b/LeanPool/LeanModularForms/GeneralizedResidueTheory/Residue/SectorCurve.lean @@ -509,7 +509,7 @@ private theorem pv_cutoff_integral_seg1_eq_inv (r : ℝ) (hr : 0 < r) (α : ℝ) calc ε = δ * r := by rw [hδ_def]; field_simp _ < t * r := by nlinarith apply intervalIntegral.integral_congr_ae - filter_upwards [(Filter.eventuallyEq_set.mp Ioo_ae_eq_Ioc)] with t ht + filter_upwards [(Filter.eventuallyEqSet_iff.mp Ioo_ae_eq_Ioc)] with t ht rw [Set.uIoc_of_le (le_of_lt hδ1)] exact fun ht_mem => h_on_Ioo t (ht.mpr ht_mem) @@ -532,7 +532,7 @@ private theorem pv_cutoff_integral_seg2_eq_Ialpha (r : ℝ) (hr : 0 < r) (α : simp only [norm_mul, Complex.norm_exp_I_mul_ofReal, mul_one] rw [Complex.norm_of_nonneg (le_of_lt hr)]; linarith have h_ae : ∀ᵐ t, t ∈ Ι 1 2 → F t = I * ↑α := by - filter_upwards [(Filter.eventuallyEq_set.mp Ioo_ae_eq_Ioc)] with t ht + filter_upwards [(Filter.eventuallyEqSet_iff.mp Ioo_ae_eq_Ioc)] with t ht rw [Set.uIoc_of_le (by norm_num : (1 : ℝ) ≤ 2)] exact fun ht_mem => h_on_Ioo t (ht.mpr ht_mem) change ∫ (t : ℝ) in (1 : ℝ)..2, F t = I * ↑α @@ -566,7 +566,7 @@ private theorem pv_cutoff_integral_seg3_eq_neg_inv (r : ℝ) (hr : 0 < r) (α : calc ε = δ * r := by rw [hδ_def]; field_simp _ < (3 - t) * r := by nlinarith apply intervalIntegral.integral_congr_ae - filter_upwards [(Filter.eventuallyEq_set.mp Ioo_ae_eq_Ioc)] with t ht + filter_upwards [(Filter.eventuallyEqSet_iff.mp Ioo_ae_eq_Ioc)] with t ht rw [Set.uIoc_of_le (le_of_lt h3δ)] exact fun ht_mem => h_on_Ioo t (ht.mpr ht_mem) diff --git a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Basic.lean b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Basic.lean index 023cbc08b5..7977df8d93 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Basic.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Basic.lean @@ -372,7 +372,7 @@ abbrev decompQuot (P : HeckePair G) (g : P.Δ) := /-- The decomposition quotient is finite because `Δ ≤ commensurator(H)`. -/ noncomputable instance instFintypeDecompQuot (P : HeckePair G) (g : P.Δ) : Fintype (decompQuot P g) := - Subgroup.fintypeOfIndexNeZero (P.h₁ g.2).1 + Subgroup.fintypeOfIndexNeZero (P.h₁ g.2).1.relIndex_ne_zero /-- Products of the form `a · h · b` with `h ∈ H`, `a, b ∈ Δ` remain in `Δ`. -/ lemma delta_mul_mem (i : H) (a b : Δ) (h₀ : H.toSubmonoid ≤ Δ) : diff --git a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Commutativity.lean b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Commutativity.lean index c3dc848518..352041743e 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Commutativity.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Commutativity.lean @@ -70,7 +70,7 @@ lemma bar_doubleCoset_eq (g₁ g₂ : G) DoubleCoset.doubleCoset g₂ P.H P.H) : DoubleCoset.doubleCoset (ι.bar g₁) P.H P.H = DoubleCoset.doubleCoset (ι.bar g₂) P.H P.H := by - have hmem := (DoubleCoset.eq P.H P.H _ _).mp + have hmem := DoubleCoset.eq.mp (DoubleCoset.mk_eq_of_doubleCoset_eq h) obtain ⟨h₁, hh₁, h₂, hh₂, hprod⟩ := hmem have hbar : ι.bar g₂ = ι.bar h₂ * ι.bar g₁ * ι.bar h₁ := by diff --git a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Multiplication.lean b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Multiplication.lean index 26f95750a5..51faa17668 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Multiplication.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/AbstractHeckeRing/Multiplication.lean @@ -293,7 +293,7 @@ lemma heckeMultiplicity_pos_of_mem_mulSupport (g₁ g₂ : P.Δ) (d : HeckeCoset have h1 : mulMap P g₁ g₂ (i₀, j₀) = (⟦HeckeCoset.rep d⟧ : HeckeCoset P) := hmap.trans (Quotient.out_eq d).symm exact (HeckeCoset.eq_iff _ _).mp h1 - obtain ⟨h₁, hh₁, h₂, hh₂, hprod⟩ := (DoubleCoset.eq P.H P.H _ _).mp + obtain ⟨h₁, hh₁, h₂, hh₂, hprod⟩ := DoubleCoset.eq.mp (DoubleCoset.mk_eq_of_doubleCoset_eq hset_eq) set α := (↑g₁ : G) with hα_def set β := (↑g₂ : G) with hβ_def diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GL2/HeckeAction.lean b/LeanPool/LeanModularForms/HeckeRIngs/GL2/HeckeAction.lean index 4daa0dc0f8..4862c576e0 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GL2/HeckeAction.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GL2/HeckeAction.lean @@ -224,7 +224,7 @@ private lemma h_coset_mem_H (D : HeckeCoset (GLPair 2)) rw [Subgroup.mem_subgroupOf] at h_K rw [Subgroup.mem_pointwise_smul_iff_inv_smul_mem, ConjAct.smul_def] at h_K simp only [ConjAct.ofConjAct_toConjAct, map_inv, inv_inv] at h_K - exact (GLPair 2).H.mul_mem (by convert h_K using 1; push_cast; rfl) hh₂ + exact (GLPair 2).H.mul_mem (by convert h_K using 1) hh₂ /-- The transpose round-trip: `(h₁ * δ * h₂)ᵀ = h_cosetᵀ * (q.out * δ)ᵀ` where `h_coset = δ⁻¹ * (q.out⁻¹ * h₁) * δ * h₂`. -/ diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GLn/Basic.lean b/LeanPool/LeanModularForms/HeckeRIngs/GLn/Basic.lean index b1197ef566..7ec2b21c72 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GLn/Basic.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GLn/Basic.lean @@ -334,9 +334,11 @@ lemma posDetInt_le_commensurator : change ConjAct.toConjAct g • (γ : GL (Fin n) ℚ) ∈ H rw [ConjAct.smul_def, ConjAct.ofConjAct_toConjAct] exact conj_ker_mem_SLnZ_inv n g A hA hAdet_ne γ hγ_ker - refine ⟨ne_zero_of_dvd_ne_zero hK_relIndex - (Subgroup.relIndex_dvd_of_le_left H hK_le_gH), ?_⟩ - rw [show H.relIndex (ConjAct.toConjAct g • H) = + rw [show MulAut.conj g • H = ConjAct.toConjAct g • H from rfl] + refine ⟨⟨ne_zero_of_dvd_ne_zero hK_relIndex + (Subgroup.relIndex_dvd_of_le_left H hK_le_gH)⟩, ?_⟩ + rw [Subgroup.isFiniteRelIndex_iff_relIndex_ne_zero, + show H.relIndex (ConjAct.toConjAct g • H) = (ConjAct.toConjAct g⁻¹ • H).relIndex H from by have h1 : ConjAct.toConjAct g⁻¹ • (ConjAct.toConjAct g • H) = H := by rw [smul_smul, ← map_mul, inv_mul_cancel, map_one, one_smul] diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GLn/Degree.lean b/LeanPool/LeanModularForms/HeckeRIngs/GLn/Degree.lean index 0b73bc0af4..03b5e151c4 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GLn/Degree.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GLn/Degree.lean @@ -303,7 +303,7 @@ theorem upperTriRep_card_le_HeckeCoset_deg (a : Fin n → ℕ) (ha : ∀ i, have h_α_inv_comm : α⁻¹ ∈ Subgroup.Commensurable.commensurator H := (Subgroup.Commensurable.commensurator H).inv_mem h_α_comm have h_rel_ne : (ConjAct.toConjAct α⁻¹ • H).relIndex H ≠ 0 := - ((Subgroup.Commensurable.commensurator_mem_iff H α⁻¹).mp h_α_inv_comm).1 + ((Subgroup.Commensurable.commensurator_mem_iff H α⁻¹).mp h_α_inv_comm).1.relIndex_ne_zero have h_card_le : Fintype.card (UpperTriRep n a hdiv) ≤ (ConjAct.toConjAct α⁻¹ • H).relIndex H := upperTriRep_card_le_relIndex n a ha hdiv h_rel_ne diff --git a/LeanPool/LeanModularForms/HeckeRIngs/GLn/PolynomialRing.lean b/LeanPool/LeanModularForms/HeckeRIngs/GLn/PolynomialRing.lean index e7b61713c7..73183d7046 100644 --- a/LeanPool/LeanModularForms/HeckeRIngs/GLn/PolynomialRing.lean +++ b/LeanPool/LeanModularForms/HeckeRIngs/GLn/PolynomialRing.lean @@ -383,7 +383,7 @@ theorem evalHom_injective_one (p : ℕ) (hp : p.Prime) : set D := TDiag (n := 1) (fun _ => p ^ (s 0)) have h0 : (evalHom 1 p R).toFun D = 0 := by rw [hR]; rfl apply hcoeff - suffices h : ((evalHom 1 p) R).toFun D = MvPolynomial.coeff s R from h ▸ h0 + suffices h : ((evalHom 1 p) R).toFun D = R.coeff s from h ▸ h0 -- Adapted for v4.29: use erw for coercion-sensitive rewrites -- Reduce to eval₂ and expand as sum, push application D inside change (MvPolynomial.eval₂ (Int.castRingHom (HeckeAlgebra 1)) diff --git a/LeanPool/LeanModularForms/Modularforms/EisensteinAsymptotics.lean b/LeanPool/LeanModularForms/Modularforms/EisensteinAsymptotics.lean index f36f7ed3ac..815b597496 100644 --- a/LeanPool/LeanModularForms/Modularforms/EisensteinAsymptotics.lean +++ b/LeanPool/LeanModularForms/Modularforms/EisensteinAsymptotics.lean @@ -193,16 +193,14 @@ lemma serre_DE₄_tendsto_atImInfty : Filter.Tendsto (serreD 4 E₄.toFun) atImInfty (nhds (-(1/3 : ℂ))) := by convert serre_D_tendsto_neg_k_div_12 4 E₄.toFun E₄.holo' (ModularFormClass.bdd_at_infty E₄) E₄_tendsto_one_atImInfty using 2 - · rw [show ((4 : ℤ) : ℂ) = 4 from by norm_num] - · norm_num + norm_num /-- serreD 6 E₆ → -1/2 at i∞. -/ lemma serre_DE₆_tendsto_atImInfty : Filter.Tendsto (serreD 6 E₆.toFun) atImInfty (nhds (-(1/2 : ℂ))) := by convert serre_D_tendsto_neg_k_div_12 6 E₆.toFun E₆.holo' E₆_isBoundedAtImInfty E₆_tendsto_one_atImInfty using 2 - · rw [show ((6 : ℤ) : ℂ) = 6 from by norm_num] - · norm_num + norm_num /-- serreD 1 E₂ is a weight-4 modular form. Note: E₂ itself is NOT a modular form, but serreD 1 E₂ IS. -/ diff --git a/LeanPool/LeanModularForms/Modularforms/Eta.lean b/LeanPool/LeanModularForms/Modularforms/Eta.lean index a375064b69..a6a34fcb1e 100644 --- a/LeanPool/LeanModularForms/Modularforms/Eta.lean +++ b/LeanPool/LeanModularForms/Modularforms/Eta.lean @@ -55,7 +55,7 @@ lemma eta_logDeriv_eql (z : ℍ) : (logDeriv (η ∘ (fun z : ℂ => -1/z))) z = apply DifferentiableAt.inv · simp only [differentiableAt_fun_id] · exact ne_zero z - rw [h0, show ((csqrt) * η) = (fun x => (csqrt) x * η x) by rfl, logDeriv_mul] + rw [h0, show ((csqrt) * η) = (fun x => (csqrt) x * η x) by rfl, logDeriv_fun_mul] · nth_rw 2 [logDeriv_apply] unfold csqrt have := csqrt_deriv z diff --git a/LeanPool/LeanModularForms/Modularforms/EtaCleanup.lean b/LeanPool/LeanModularForms/Modularforms/EtaCleanup.lean index a022e1a903..8cf098c2ac 100644 --- a/LeanPool/LeanModularForms/Modularforms/EtaCleanup.lean +++ b/LeanPool/LeanModularForms/Modularforms/EtaCleanup.lean @@ -187,7 +187,7 @@ lemma eta_DifferentiableAt_UpperHalfPlane' (z : ℍ) : DifferentiableAt ℂ dede lemma eta_logDeriv' (z : ℍ) : logDeriv dedekindEtaFun' z = (π * Complex.I / 12) * E₂ z := by unfold dedekindEtaFun' etaProdTerm - rw [logDeriv_mul (UpperHalfPlane.coe z) _ (etaProdTerm_ne_zero z) _ + rw [logDeriv_fun_mul (UpperHalfPlane.coe z) _ (etaProdTerm_ne_zero z) _ (etaProdTerm_differentiableAt z)] · have HG := logDeriv_tprod_eq_tsum2 (isOpen_lt continuous_const Complex.continuous_im) ⟨(z : ℂ), z.2⟩ (fun n x => 1 - etaQ n x) @@ -247,7 +247,7 @@ lemma eta_logDeriv_eql' (z : ℍ) : (logDeriv (η ∘ (fun z : ℂ => -1/z))) z apply DifferentiableAt.inv · simp only [differentiableAt_fun_id] · exact ne_zero z - rw [h0, show ((csqrt) * η) = (fun x => (csqrt) x * η x) by rfl, logDeriv_mul] + rw [h0, show ((csqrt) * η) = (fun x => (csqrt) x * η x) by rfl, logDeriv_fun_mul] · nth_rw 2 [logDeriv_apply] unfold csqrt have := csqrt_deriv z diff --git a/LeanPool/LeanModularForms/Modularforms/Generators/Defs.lean b/LeanPool/LeanModularForms/Modularforms/Generators/Defs.lean index 9fff2c0377..e6c3109a53 100644 --- a/LeanPool/LeanModularForms/Modularforms/Generators/Defs.lean +++ b/LeanPool/LeanModularForms/Modularforms/Generators/Defs.lean @@ -168,19 +168,19 @@ lemma evalE₄E₆_whc_eq_single (n : ℕ) (p : MvPolynomial (Fin 2) ℂ) · subst hk; simp [DirectSum.of_eq_same] · rw [DirectSum.of_eq_of_ne _ _ _ hk] conv_lhs => rw [← MvPolynomial.support_sum_monomial_coeff p]; rw [map_sum] - rw [show (∑ x ∈ p.support, evalE₄E₆ ((MvPolynomial.monomial x) (MvPolynomial.coeff x p))) k = - ∑ x ∈ p.support, (evalE₄E₆ ((MvPolynomial.monomial x) (MvPolynomial.coeff x p))) k from + rw [show (∑ x ∈ p.support, evalE₄E₆ ((MvPolynomial.monomial x) (p.coeff x))) k = + ∑ x ∈ p.support, (evalE₄E₆ ((MvPolynomial.monomial x) (p.coeff x))) k from map_sum (DFinsupp.evalAddMonoidHom k) _ _] apply Finset.sum_eq_zero intro d hd have hweight := hp (MvPolynomial.mem_support_iff.mp hd) - have hd0 : MvPolynomial.monomial d (MvPolynomial.coeff d p) = - MvPolynomial.C (MvPolynomial.coeff d p) * MvPolynomial.X 0 ^ d 0 * + have hd0 : MvPolynomial.monomial d (p.coeff d) = + MvPolynomial.C (p.coeff d) * MvPolynomial.X 0 ^ d 0 * MvPolynomial.X 1 ^ d 1 := by rw [MvPolynomial.monomial_eq, mul_assoc]; simp_all - rw [hd0, show MvPolynomial.C (MvPolynomial.coeff d p) * + rw [hd0, show MvPolynomial.C (p.coeff d) * MvPolynomial.X (0 : Fin 2) ^ d 0 * MvPolynomial.X (1 : Fin 2) ^ d 1 = - MvPolynomial.C (MvPolynomial.coeff d p) * + MvPolynomial.C (p.coeff d) * (MvPolynomial.X (0 : Fin 2) ^ d 0 * MvPolynomial.X (1 : Fin 2) ^ d 1) from mul_assoc _ _ _] rw [map_mul, evalE₄E₆_C, Algebra.algebraMap_eq_smul_one, smul_mul_assoc, one_mul, diff --git a/LeanPool/LeanModularForms/Modularforms/Generators/Injectivity.lean b/LeanPool/LeanModularForms/Modularforms/Generators/Injectivity.lean index bcc4c3cb41..8035970b8b 100644 --- a/LeanPool/LeanModularForms/Modularforms/Generators/Injectivity.lean +++ b/LeanPool/LeanModularForms/Modularforms/Generators/Injectivity.lean @@ -7,6 +7,7 @@ Authors: Chris Birkbeck module public import LeanPool.LeanModularForms.Modularforms.Generators.Surjectivity +public import Mathlib.Algebra.MvPolynomial.CommRing /-! # Generators of the graded ring of level 1 modular forms: Injectivity and main results @@ -76,8 +77,8 @@ private lemma evalE₄E₆_component_eq (p : MvPolynomial (Fin 2) ℂ) (n : ℕ) (evalE₄E₆ q) (↑n : ℤ) suffices h : (evalE₄E₆ q) (↑n : ℤ) = 0 by rw [h, add_zero] rw [← MvPolynomial.support_sum_monomial_coeff q, map_sum, - show (∑ x ∈ q.support, evalE₄E₆ ((MvPolynomial.monomial x) (MvPolynomial.coeff x q))) (↑n : ℤ) = - ∑ x ∈ q.support, (evalE₄E₆ ((MvPolynomial.monomial x) (MvPolynomial.coeff x q))) (↑n : ℤ) from + show (∑ x ∈ q.support, evalE₄E₆ ((MvPolynomial.monomial x) (q.coeff x))) (↑n : ℤ) = + ∑ x ∈ q.support, (evalE₄E₆ ((MvPolynomial.monomial x) (q.coeff x))) (↑n : ℤ) from map_sum (DFinsupp.evalAddMonoidHom (↑n : ℤ)) _ _] apply Finset.sum_eq_zero intro d hd @@ -113,7 +114,7 @@ private lemma whomog_unique_monomial {n : ℕ} (p : MvPolynomial (Fin 2) ℂ) (hp : MvPolynomial.IsWeightedHomogeneous E₄E₆Weight p n) (d₀ : Fin 2 →₀ ℕ) (hd₀ : Finsupp.weight E₄E₆Weight d₀ = n) (huniq : ∀ d : Fin 2 →₀ ℕ, Finsupp.weight E₄E₆Weight d = n → d = d₀) : - p = MvPolynomial.monomial d₀ (MvPolynomial.coeff d₀ p) := by + p = MvPolynomial.monomial d₀ (p.coeff d₀) := by ext d by_cases hd : d = d₀ · subst hd; simp only [MvPolynomial.coeff_monomial, ↓reduceIte] @@ -130,16 +131,16 @@ private lemma per_weight_injective_unique_monomial {n : ℕ} (p : MvPolynomial ( (↑n : ℤ) ≠ 0) : p = 0 := by have hpc := whomog_unique_monomial p hp d₀ hd₀ huniq rw [hpc] at heval ⊢ - rw [monomial_fin2_eq, show MvPolynomial.C (MvPolynomial.coeff d₀ p) * + rw [monomial_fin2_eq, show MvPolynomial.C (p.coeff d₀) * MvPolynomial.X (0 : Fin 2) ^ d₀ 0 * MvPolynomial.X (1 : Fin 2) ^ d₀ 1 = - MvPolynomial.C (MvPolynomial.coeff d₀ p) * + MvPolynomial.C (p.coeff d₀) * (MvPolynomial.X (0 : Fin 2) ^ d₀ 0 * MvPolynomial.X (1 : Fin 2) ^ d₀ 1) from mul_assoc _ _ _] at heval rw [map_mul, evalE₄E₆_C, Algebra.algebraMap_eq_smul_one, smul_mul_assoc, one_mul, map_mul, map_pow, map_pow, evalE₄E₆_X0, evalE₄E₆_X1, DirectSum.smul_apply] at heval rcases smul_eq_zero.mp heval with hc | hmz - · rw [show MvPolynomial.monomial d₀ (MvPolynomial.coeff d₀ p) = + · rw [show MvPolynomial.monomial d₀ (p.coeff d₀) = MvPolynomial.monomial d₀ 0 from by rw [hc], MvPolynomial.monomial_zero] · exact absurd hmz hmf_ne @@ -149,12 +150,10 @@ private lemma Delta_poly_isWeightedHomogeneous : simp only [MvPolynomial.smul_eq_C_mul] intro d hd simp only [MvPolynomial.coeff_C_mul, MvPolynomial.coeff_sub] at hd - by_cases hd3 : MvPolynomial.coeff d - (MvPolynomial.X (0 : Fin 2) ^ 3 : MvPolynomial (Fin 2) ℂ) ≠ 0 + by_cases hd3 : (MvPolynomial.X (0 : Fin 2) ^ 3 : MvPolynomial (Fin 2) ℂ).coeff d ≠ 0 · exact ((MvPolynomial.isWeightedHomogeneous_X ℂ E₄E₆Weight (0 : Fin 2)).pow 3) hd3 · push Not at hd3 - by_cases hd6 : MvPolynomial.coeff d - (MvPolynomial.X (1 : Fin 2) ^ 2 : MvPolynomial (Fin 2) ℂ) ≠ 0 + by_cases hd6 : (MvPolynomial.X (1 : Fin 2) ^ 2 : MvPolynomial (Fin 2) ℂ).coeff d ≠ 0 · exact ((MvPolynomial.isWeightedHomogeneous_X ℂ E₄E₆Weight (1 : Fin 2)).pow 2) hd6 · push Not at hd6; simp only [hd3, hd6, sub_self, mul_zero, ne_eq, not_true] at hd @@ -233,10 +232,10 @@ private lemma delta_piece_eq_monomial_sub h3, h2] congr 1 · rw [MvPolynomial.X_pow_eq_monomial, MvPolynomial.X_pow_eq_monomial, - MvPolynomial.monomial_mul, one_mul, MvPolynomial.C_mul_monomial, mul_one] + MvPolynomial.monomial_mul_monomial, one_mul, MvPolynomial.C_mul_monomial, mul_one] exact congrArg (· c) (congrArg MvPolynomial.monomial hd_fin.symm) · rw [MvPolynomial.X_pow_eq_monomial, MvPolynomial.X_pow_eq_monomial, - MvPolynomial.monomial_mul, one_mul, MvPolynomial.C_mul_monomial, mul_one] + MvPolynomial.monomial_mul_monomial, one_mul, MvPolynomial.C_mul_monomial, mul_one] private lemma Finset.sum_lt_sum_of_replace {α : Type*} [DecidableEq α] (S S' : Finset α) (f : α → ℕ) (d d' : α) @@ -265,11 +264,10 @@ private lemma Finset.sum_lt_sum_of_replace {α : Type*} [DecidableEq α] open Classical in private lemma mvpoly_support_after_reduction {σ R : Type*} [CommRing R] [DecidableEq σ] (p : MvPolynomial σ R) (d d' : σ →₀ ℕ) (c : R) - (hdd' : d ≠ d') (hc : MvPolynomial.coeff d p = c) : + (hdd' : d ≠ d') (hc : p.coeff d = c) : let delta := MvPolynomial.monomial d c - MvPolynomial.monomial d' c d ∉ (p - delta).support ∧ (p - delta).support ⊆ p.support.erase d ∪ {d'} := by - have hcoeff_d : MvPolynomial.coeff d - (p - (MvPolynomial.monomial d c - MvPolynomial.monomial d' c)) = 0 := by + have hcoeff_d : (p - (MvPolynomial.monomial d c - MvPolynomial.monomial d' c)).coeff d = 0 := by rw [MvPolynomial.coeff_sub, MvPolynomial.coeff_sub, MvPolynomial.coeff_monomial, MvPolynomial.coeff_monomial, ite_eq_left rfl, ite_eq_right hdd'.symm, sub_zero, hc, sub_self] @@ -314,7 +312,7 @@ private lemma whomog_poly_Delta_decomp {n : ℕ} (hn12 : 12 ≤ n) have hwd : d 0 * 4 + d 1 * 6 = n := by have := hp (MvPolynomial.mem_support_iff.mp hd_mem) have := weight_eq_4a_6b d; omega - set c := MvPolynomial.coeff d p + set c := p.coeff d set delta_piece := MvPolynomial.C c * ((1728 : ℂ) • DeltaPoly * (MvPolynomial.X (0 : Fin 2) ^ (d 0 - 3) * MvPolynomial.X (1 : Fin 2) ^ (d 1))) set p' := p - delta_piece with hp'_def @@ -406,7 +404,7 @@ private lemma coeff_zero_of_eval_zero {n : ℕ} (hn12 : 12 ≤ n) by_cases hr_empty : r.support = ∅ · rwa [MvPolynomial.support_eq_empty] at hr_empty · obtain ⟨d₀, hd₀⟩ := Finset.nonempty_of_ne_empty hr_empty - have hr_mono : r = MvPolynomial.monomial d₀ (MvPolynomial.coeff d₀ r) := by + have hr_mono : r = MvPolynomial.monomial d₀ (r.coeff d₀) := by ext d by_cases hd : d = d₀ · subst hd; simp only [MvPolynomial.coeff_monomial, ↓reduceIte] @@ -416,7 +414,7 @@ private lemma coeff_zero_of_eval_zero {n : ℕ} (hn12 : 12 ≤ n) · rwa [MvPolynomial.mem_support_iff, not_not] at hd_supp have hwd₀ := hr (MvPolynomial.mem_support_iff.mp hd₀) have hwd₀' := weight_eq_4a_6b d₀; rw [hwd₀] at hwd₀' - set c := MvPolynomial.coeff d₀ r + set c := r.coeff d₀ suffices hc : c = 0 by rw [hr_mono, hc, MvPolynomial.monomial_zero] set Q := qExpansionAddHom (show (0 : ℝ) < (1 : ℝ) by norm_num) (show (1 : ℝ) ∈ Γ(1).strictPeriods from by simp) (↑n) @@ -521,7 +519,7 @@ private lemma per_weight_injective_zero (p : MvPolynomial (Fin 2) ℂ) (hp : MvPolynomial.IsWeightedHomogeneous E₄E₆Weight p 0) (heval : (evalE₄E₆ p) (0 : ℤ) = 0) : p = 0 := by - have hpc : p = MvPolynomial.C (MvPolynomial.coeff 0 p) := by + have hpc : p = MvPolynomial.C (p.coeff 0) := by ext d' simp only [MvPolynomial.coeff_C] by_cases hd' : 0 = d' diff --git a/LeanPool/LeanModularForms/Modularforms/LogDerivLems.lean b/LeanPool/LeanModularForms/Modularforms/LogDerivLems.lean index d47d691a12..8728a9d493 100644 --- a/LeanPool/LeanModularForms/Modularforms/LogDerivLems.lean +++ b/LeanPool/LeanModularForms/Modularforms/LogDerivLems.lean @@ -46,7 +46,7 @@ theorem logDeriv_tprod_eq_tsum2 {s : Set ℂ} (hs : IsOpen s) (x : s) (f : ℕ conv => enter [1] ext n - rw [← logDeriv_prod (by intro i hi; apply hf i) + rw [← logDeriv_fun_prod (by intro i hi; apply hf i) (by intro i hi; apply (hd i x x.2).differentiableAt; exact IsOpen.mem_nhds hs x.2)] exact HT @@ -70,8 +70,6 @@ theorem logDeriv_tprod_eq_tsumold {s : Set ℂ} (hs : IsOpen s) (x : s) (f : ℕ apply HT.congr intro m congr - ext i - simp only [Finset.prod_apply] · exact htend · simp only [eventually_atTop] exact ⟨0, fun b _ z hz => diff --git a/LeanPool/LeanModularForms/Modularforms/MultipliableLems.lean b/LeanPool/LeanModularForms/Modularforms/MultipliableLems.lean index 538b7cbc0f..7c99a1342e 100644 --- a/LeanPool/LeanModularForms/Modularforms/MultipliableLems.lean +++ b/LeanPool/LeanModularForms/Modularforms/MultipliableLems.lean @@ -116,7 +116,7 @@ theorem hasProd_le_nonneg (f g : ι → ℝ) (h : ∀ i, f i ≤ g i) (h0 : ∀ (hf : HasProd f a₁) (hg : HasProd g a₂) : a₁ ≤ a₂ := by apply le_of_tendsto_of_tendsto' hf hg intro s - exact Finset.prod_le_prod (fun i _ => h0 i) (fun i _ => h i) + exact Finset.prod_le_prod₀ (fun i _ => h0 i) (fun i _ => h i) theorem HasProd.le_one_nonneg (g : ℕ → ℝ) (h : ∀ i, g i ≤ 1) (h0 : ∀ i, 0 ≤ g i) (ha : HasProd g a) : a ≤ 1 := by diff --git a/LeanPool/LeanModularForms/Modularforms/QExpansionLems.lean b/LeanPool/LeanModularForms/Modularforms/QExpansionLems.lean index 5efc7c1acb..e1236d0909 100644 --- a/LeanPool/LeanModularForms/Modularforms/QExpansionLems.lean +++ b/LeanPool/LeanModularForms/Modularforms/QExpansionLems.lean @@ -117,8 +117,7 @@ lemma iteratedDeriv_eq_iteratedDerivWithin (n : ℕ) (f : ℂ → ℂ) (s : Set simp_rw [iteratedDerivWithin] rw [iteratedFDerivWithin_congr_set] apply EventuallyEq.symm - rw [eventuallyEq_univ] - exact IsOpen.mem_nhds hs hz + exact eventuallyEqSet_univ.2 (IsOpen.mem_nhds hs hz) lemma qExpansion_mul_coeff (a b : ℤ) (f : ModularForm Γ(n) a) (g : ModularForm Γ(n) b) [hn : NeZero n] : qExpansion n (f.mul g) = qExpansion n f * qExpansion n g := by diff --git a/LeanPool/LeanModularForms/Modularforms/SlashActionAuxil.lean b/LeanPool/LeanModularForms/Modularforms/SlashActionAuxil.lean index 22f05a6c13..f922549530 100644 --- a/LeanPool/LeanModularForms/Modularforms/SlashActionAuxil.lean +++ b/LeanPool/LeanModularForms/Modularforms/SlashActionAuxil.lean @@ -256,8 +256,7 @@ lemma Γ2_descent (A : Γ 2) (h : A.1 1 0 ≠ 0) : α_zpow_val, β_zpow_val, Matrix.mul_apply, Fin.sum_univ_two, Matrix.of_apply, Matrix.cons_val_zero, Matrix.cons_val_one] at hn hm ⊢ convert hm.trans hn using 2 - · rfl - · ring + ring theorem Γ2_generate : (⊤ : Subgroup (Γ 2)) = Subgroup.closure {α, β, negI} := by refine le_antisymm ?_ le_top diff --git a/LeanPool/LeanModularForms/Modularforms/ThetaDerivIdentities.lean b/LeanPool/LeanModularForms/Modularforms/ThetaDerivIdentities.lean index b0a86c7823..5af5d83f4f 100644 --- a/LeanPool/LeanModularForms/Modularforms/ThetaDerivIdentities.lean +++ b/LeanPool/LeanModularForms/Modularforms/ThetaDerivIdentities.lean @@ -477,8 +477,7 @@ lemma f₄_tendsto_atImInfty : Tendsto f₄ atImInfty (𝓝 0) := by have h_serre_H₄ : Tendsto (serreD 2 H₄) atImInfty (𝓝 (-(1/6 : ℂ))) := by convert serre_D_tendsto_neg_k_div_12 2 H₄ H₄_SIF_MDifferentiable isBoundedAtImInfty_H₄ H₄_tendsto_atImInfty using 2 - · rw [show ((2 : ℤ) : ℂ) = 2 from by norm_num] - · norm_num + norm_num have h_sum : Tendsto (2 * H₂ + H₄) atImInfty (𝓝 1) := by have h := (H₂_tendsto_atImInfty.const_mul 2).add H₄_tendsto_atImInfty norm_num at h; exact h diff --git a/LeanPool/LeanModularForms/Modularforms/TsumderivWithin.lean b/LeanPool/LeanModularForms/Modularforms/TsumderivWithin.lean index daeab2af9c..ee4a9eb4ac 100644 --- a/LeanPool/LeanModularForms/Modularforms/TsumderivWithin.lean +++ b/LeanPool/LeanModularForms/Modularforms/TsumderivWithin.lean @@ -100,7 +100,7 @@ private lemma summable_two_pi_pow_geometric (r : ℝ) (hr : ‖r‖ < 1) (K : mul_one, norm_natCast] norm_cast simp only [Nat.cast_pow] - have hh : |π| = π := by simp [Real.pi_pos.le] + have hh : |π| = π := by simp rw [hh] ring apply Summable.congr _ heq diff --git a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/MainTheoremDerivCont.lean b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/MainTheoremDerivCont.lean index b6cde3020d..7b3042f9d2 100644 --- a/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/MainTheoremDerivCont.lean +++ b/LeanPool/LeanModularForms/ValenceFormula/RectHomotopy/MainTheoremDerivCont.lean @@ -135,7 +135,6 @@ private lemma deriv_cont_seg1 (p₁ p₂ : ℝ) (_hp₁p₂ : p₁ < p₂) (h_se simp only [zero_sub] at this; exact this have h5 := (hasDerivAt_const q.1 ((1/2 : ℂ))).add (h3.mul_const I) simp only [zero_add] at h5; convert h5.deriv using 2 - all_goals rfl apply ContinuousOn.congr continuousOn_const hconst private lemma deriv_cont_seg2 (p₁ p₂ : ℝ) (_hp₁p₂ : p₁ < p₂) diff --git a/LeanPool/LeanPolyABC/Corollaries/FltCatalan.lean b/LeanPool/LeanPolyABC/Corollaries/FltCatalan.lean index 3abebe2703..3d4ef55c2f 100644 --- a/LeanPool/LeanPolyABC/Corollaries/FltCatalan.lean +++ b/LeanPool/LeanPolyABC/Corollaries/FltCatalan.lean @@ -9,7 +9,7 @@ import Mathlib.Algebra.EuclideanDomain.Defs import Mathlib.RingTheory.MvPowerSeries.Basic import Mathlib.Algebra.Polynomial.Expand import Mathlib.Algebra.Polynomial.Coeff -import Mathlib.Logic.Lemmas +import Mathlib.Basic.Logic.Lemmas import LeanPool.LeanPolyABC.MasonStothers import Mathlib.RingTheory.Coprime.Basic @@ -129,7 +129,8 @@ theorem flt_catalan_deriv have hpqr : 0 < p * q * r := Nat.mul_le_mul (Nat.mul_le_mul hp hq) hr apply Nat.le_of_mul_le_mul_left _ hpqr apply le_trans _ (Nat.mul_le_mul_right _ hineq) - convert weighted_average_le_max₃ using 1 <;> first | rfl | ring + convert weighted_average_le_max₃ using 1 + first | rfl | ring end Polynomial diff --git a/LeanPool/LeanQuantumAlg/Primitives/QKernel/Advantage.lean b/LeanPool/LeanQuantumAlg/Primitives/QKernel/Advantage.lean index db81f6c57b..65d58bf343 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/QKernel/Advantage.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/QKernel/Advantage.lean @@ -8,7 +8,7 @@ module public import LeanPool.LeanQuantumAlg.Init public import LeanPool.LeanQuantumAlg.Primitives.QKernel.DiscreteLogConcept -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.Tactic.Common /-! # Quantum-kernel learning advantage (Liu, Arunachalam, Temme 2021) diff --git a/LeanPool/LeanQuantumAlg/Primitives/QKernel/Concentration.lean b/LeanPool/LeanQuantumAlg/Primitives/QKernel/Concentration.lean index db63bea1fa..b6c25a1d4f 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/QKernel/Concentration.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/QKernel/Concentration.lean @@ -49,7 +49,7 @@ theorem ryKernel_nonneg (n : ℕ) (θ : Fin n → ℝ) : 0 ≤ ryKernel n θ := Finset.prod_nonneg (fun _ _ => sq_nonneg _) theorem ryKernel_le_one (n : ℕ) (θ : Fin n → ℝ) : ryKernel n θ ≤ 1 := - Finset.prod_le_one (fun k _ => sq_nonneg _) + Finset.prod_le_one₀ (fun k _ => sq_nonneg _) (fun k _ => by nlinarith [Real.neg_one_le_cos (θ k), Real.cos_le_one (θ k)]) theorem continuous_ryKernel (n : ℕ) : Continuous (ryKernel n) := by diff --git a/LeanPool/LeanQuantumAlg/Primitives/QKernel/DiscreteLogConcept.lean b/LeanPool/LeanQuantumAlg/Primitives/QKernel/DiscreteLogConcept.lean index bc52d28f24..317a8bb1d3 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/QKernel/DiscreteLogConcept.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/QKernel/DiscreteLogConcept.lean @@ -9,7 +9,7 @@ module public import LeanPool.LeanQuantumAlg.Init public import Mathlib.GroupTheory.SpecificGroups.Cyclic public import Mathlib.Data.ZMod.Basic -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.Tactic.Common /-! # The discrete-logarithm concept class and its secret-homogeneity diff --git a/LeanPool/LeanQuantumAlg/Primitives/QNN/PauliPropagation.lean b/LeanPool/LeanQuantumAlg/Primitives/QNN/PauliPropagation.lean index acda0421dd..d786ad8f4c 100644 --- a/LeanPool/LeanQuantumAlg/Primitives/QNN/PauliPropagation.lean +++ b/LeanPool/LeanQuantumAlg/Primitives/QNN/PauliPropagation.lean @@ -7,7 +7,7 @@ Authors: QudeLeap Team module public import LeanPool.LeanQuantumAlg.Init -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.Algebra.Order.BigOperators.Group.Finset /-! diff --git a/LeanPool/LeanQuantumAlg/Util/HilbertSchmidt.lean b/LeanPool/LeanQuantumAlg/Util/HilbertSchmidt.lean index 56480f60e7..97bd84fb59 100644 --- a/LeanPool/LeanQuantumAlg/Util/HilbertSchmidt.lean +++ b/LeanPool/LeanQuantumAlg/Util/HilbertSchmidt.lean @@ -11,7 +11,7 @@ public import Mathlib.LinearAlgebra.Matrix.Kronecker public import Mathlib.LinearAlgebra.Matrix.Trace public import Mathlib.LinearAlgebra.Matrix.ConjTranspose public import Mathlib.Data.Matrix.Basis -public import Mathlib.Data.Complex.Basic +public import Mathlib.Basic.Complex.Basic /-! # The Hilbert–Schmidt inner product on matrices diff --git a/LeanPool/LehmerE10/Kronecker.lean b/LeanPool/LehmerE10/Kronecker.lean index 2e8fc88810..c952943652 100644 --- a/LeanPool/LehmerE10/Kronecker.lean +++ b/LeanPool/LehmerE10/Kronecker.lean @@ -80,7 +80,7 @@ theorem kronecker_roots {p : Polynomial ℤ} (hm : p.Monic) have hgen : (algebraMap K ℂ) x = z := IntermediateField.AdjoinSimple.algebraMap_gen ℚ z have hinj : Function.Injective (algebraMap K ℂ) := (algebraMap K ℂ).injective have hxi : IsIntegral ℤ x := by - exact (isIntegral_algebraMap_iff hinj).mp (hgen ▸ hint) + exact isIntegral_algebraMap_iff.mp (hgen ▸ hint) -- the generator is itself a root of p inside K have hpx : (Polynomial.aeval x) p = 0 := by apply hinj diff --git a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/WeightedSeries.lean b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/WeightedSeries.lean index 2c2622c5e7..b730846c50 100644 --- a/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/WeightedSeries.lean +++ b/LeanPool/LocalComplexGeometry/ClassicalComplexWPT/WeightedSeries.lean @@ -283,7 +283,7 @@ lemma norm_monomial_le_one (y : S → ℂ) (hy : ∀ i, ‖y i‖ ≤ 1) (a : S change ‖∏ i ∈ a.support, y i ^ a i‖ ≤ 1 rw [norm_prod] simp only [norm_pow] - apply Finset.prod_le_one + apply Finset.prod_le_one₀ · intro i hi exact pow_nonneg (norm_nonneg _) _ · intro i hi diff --git a/LeanPool/LongGapsBetweenPrimes/Main.lean b/LeanPool/LongGapsBetweenPrimes/Main.lean index d13d6107ec..40cbaffbe3 100644 --- a/LeanPool/LongGapsBetweenPrimes/Main.lean +++ b/LeanPool/LongGapsBetweenPrimes/Main.lean @@ -696,7 +696,7 @@ theorem assignment_row_bound {α : Type*} [Fintype α] intro p _ cases σ p <;> simp [localRow] _ ≤ ∏ _ ∈ assignmentSupport σ, Real.exp ((k : ℝ) / (z - 1)) := by - apply Finset.prod_le_prod + apply Finset.prod_le_prod₀ · intro p _ exact add_nonneg zero_le_one (div_nonneg hk1 (hz1.le.trans (sub_le_sub_right (hsize p) 1))) @@ -1096,7 +1096,7 @@ theorem eulerProduct_comparison (N : ℕ) {r : ℝ} (hr : 0 ≤ r) : calc _ ≤ ∏ p ∈ N.primesLE, (1 - (p : ℝ) ^ (-(1 + r)))⁻¹ * Real.exp (2 * r * Real.log p / p) := by - apply Finset.prod_le_prod + apply Finset.prod_le_prod₀ · intro p hp apply inv_nonneg.mpr apply sub_nonneg.mpr @@ -1181,7 +1181,7 @@ lemma eulerProduct_pos (N : ℕ) {σ : ℝ} (hσ : 0 < σ) : 0 < eulerProduct N /-- The finite Euler product decreases as its positive exponent increases. -/ lemma eulerProduct_antitone (N : ℕ) {σ τ : ℝ} (hσ : 0 < σ) (hστ : σ ≤ τ) : eulerProduct N τ ≤ eulerProduct N σ := by - apply Finset.prod_le_prod + apply Finset.prod_le_prod₀ · intro p hp exact inv_nonneg.mpr (sub_nonneg.mpr (Real.rpow_lt_one_of_one_lt_of_neg (by exact_mod_cast (Nat.mem_primesLE.mp hp).2.one_lt) (by linarith)).le) @@ -1248,7 +1248,7 @@ theorem divisorEulerMoment_ge_eulerProduct {Z Y : ℕ} (hZY : Z ≤ Y) {t : ℝ} apply mul_le_mul_of_nonneg_right _ (eulerProduct_pos Z (by linarith)).le rw [auxiliaryProduct, divisorEulerMoment_primeProduct _ (fun _ hp => auxiliaryPrimes_prime hp)] - apply Finset.prod_le_prod + apply Finset.prod_le_prod₀ · intro p hp exact (inv_pos.mpr (sub_pos.mpr (Real.rpow_lt_one_of_one_lt_of_neg (by exact_mod_cast (auxiliaryPrimes_prime hp).one_lt) (by linarith)))).le @@ -1529,7 +1529,7 @@ lemma divisorEulerMoment_tilt (ps : Finset ℕ) (hps : ∀ p ∈ ps, p.Prime) divisorEulerMoment (∏ p ∈ ps, p) γ ≤ divisorEulerMoment (∏ p ∈ ps, p) 0 * Real.exp (E * γ * ∑ p ∈ ps, Real.log p / p) := by - have h := Finset.prod_le_prod (s := ps) + have h := Finset.prod_le_prod₀ (s := ps) (f := fun p : ℕ => 1 + (p : ℝ) ^ γ / ((p : ℝ) - 1)) (g := fun p : ℕ => (1 + 1 / ((p : ℝ) - 1)) * Real.exp (E * γ * Real.log p / p)) (fun p hp => by @@ -2571,7 +2571,7 @@ lemma integerAverage_bounded_periodic_weight {ι : Type*} [Fintype ι] mod_invariant_of_dvd (Nat.dvd_lcm_right _ _) (f j) (hmod j)] · intro n rw [abs_mul] - exact mul_le_one₀ (hf i n) (abs_nonneg _) (hf j n) + exact (mul_le_of_le_one_left (abs_nonneg _) (hf i n)).trans (hf j n) /-- The residues of `n` modulo the prime divisors of `P`. -/ def residueVector (P n : ℕ) : (p : PrimeIndex P) → Fin p.val := @@ -2629,14 +2629,14 @@ lemma abs_productBasis_le_one {α : Type*} [Fintype α] {Ω J : α → Type*} (f : (p : α) → J p → Ω p → ℝ) (hf : ∀ p i t, |f p i t| ≤ 1) (σ : (p : α) → J p) (t : (p : α) → Ω p) : |productBasis f σ t| ≤ 1 := by rw [productBasis, Finset.abs_prod] - exact Finset.prod_le_one (fun _ _ => abs_nonneg _) (fun p _ => hf p _ _) + exact Finset.prod_le_one₀ (fun _ _ => abs_nonneg _) (fun p _ => hf p _ _) /-- Coefficients bounded by one give tuple amplitudes bounded by one. -/ lemma tupleAmplitude_abs_le {P k : ℕ} (h : ∀ d ∈ P.divisors, |coefficient P d| ≤ 1) (r : DivisorTuple P k) : |tupleAmplitude r| ≤ 1 := by rw [tupleAmplitude, Finset.abs_prod] - exact Finset.prod_le_one (fun _ _ => abs_nonneg _) + exact Finset.prod_le_one₀ (fun _ _ => abs_nonneg _) (fun i _ => h _ (r i).property) /-- Every assigned prime divides the assignment product. -/ @@ -3752,7 +3752,7 @@ lemma eulerProduct_left_comparison (N : ℕ) {t : ℝ} (ht : 0 ≤ t) (ht' : t calc _ ≤ ∏ p ∈ N.primesLE, (1 - (p : ℝ) ^ (-(1 : ℝ)))⁻¹ * Real.exp (smoothEulerConstant * ((p : ℝ) ^ t - 1) / p) := by - apply Finset.prod_le_prod + apply Finset.prod_le_prod₀ · intro p hp exact inv_nonneg.mpr (sub_nonneg.mpr (Real.rpow_lt_one_of_one_lt_of_neg (by exact_mod_cast (Nat.mem_primesLE.mp hp).2.one_lt) (by linarith)).le) diff --git a/LeanPool/LowDimSolvClassification/LemmasDim3.lean b/LeanPool/LowDimSolvClassification/LemmasDim3.lean index c698bdad24..36fe88a924 100644 --- a/LeanPool/LowDimSolvClassification/LemmasDim3.lean +++ b/LeanPool/LowDimSolvClassification/LemmasDim3.lean @@ -124,7 +124,7 @@ lemma case1a (dim3 : Module.finrank K L = 3) (h₁ : Module.finrank K (commutato repeat rw [Finsupp.linearCombination_apply, Finsupp.sum_fintype] · repeat rw [Fin.sum_univ_three] simp only [Basis.repr_reindex, Basis.mk_repr, Fin.isValue, - Finsupp.mapDomain_equiv_apply, Equiv.symm_symm, Equiv.ofRightInverseOfCardLE_apply, + Equiv.symm_symm, Equiv.ofRightInverseOfCardLE_apply, Matrix.cons_val_zero, Basis.reindex_apply, Basis.coe_mk, Matrix.cons_val_one, Matrix.cons_val, lie_add, lie_smul, add_lie, smul_lie, lie_self, smul_zero, zero_add, smul_add, add_zero, B₂', B₂, reind', reind] @@ -1082,8 +1082,8 @@ lemma finrank_com_eq2_from_basis_bracket use ( -(B.repr z) 0 • (B.repr y) 1 + -((B.repr z) 0 • (B.repr y) 2 • β ) + (B.repr z) 1 • (B.repr y) 0 + (B.repr z) 2 • (B.repr y) 0 • β ) match_scalars - · simp only [smul_eq_mul,Fin.isValue, neg_mul, mul_one,smul_eq_mul] - · simp only [Fin.isValue, smul_eq_mul, neg_mul, mul_one] + · simp only [smul_eq_mul, Fin.isValue, neg_mul, smul_eq_mul] + · simp only [Fin.isValue, smul_eq_mul, neg_mul] · have h1 : B 1 ∈ {x | ∃ (y z:L), ⁅y, z⁆ = x} :=by rw [Set.mem_ofPred_eq] use α⁻¹ • B 0 @@ -1165,7 +1165,6 @@ lemma case2 : Module.finrank K L = 3 ∧ Module.finrank K (commutator K L) = 2 not_false_eq_true, inv_smul_smul₀, smul_inv_smul₀, add_left_inj, βinvunit, βunit, β2unit] match_scalars - simp only [mul_one] ring_nf simp_all · rintro (⟨B,hB01,hB02,hB12⟩|⟨B,hB01,hB02,⟨α, anz, hB12⟩⟩| ⟨B,hB01,hB02,⟨α, anz, hB12⟩⟩) diff --git a/LeanPool/LowDimSolvClassification/Semidirect.lean b/LeanPool/LowDimSolvClassification/Semidirect.lean index 58fa4085b4..7e904ca442 100644 --- a/LeanPool/LowDimSolvClassification/Semidirect.lean +++ b/LeanPool/LowDimSolvClassification/Semidirect.lean @@ -388,7 +388,7 @@ def Prod.toLieSemidirectProduct : (L × J) ≃ₗ⁅K⁆ L ⋉[(0 : L →ₗ⁅K rintro x y change (⁅x.1, y.1⁆, ⁅x.2, y.2⁆) = (⁅x.1, y.1⁆, _) simp only [LinearEquiv.refl_toLinearMap, AddHom.toFun_eq_coe, LinearMap.coe_toAddHom, - LinearMap.id_coe, id_eq, LieHom.coe_zero, Pi.zero_apply, LieDerivation.coe_zero, sub_self, + LinearMap.id_coe, id_eq, FunLike.coe_zero, Pi.zero_apply, LieDerivation.coe_zero, sub_self, zero_add] } diff --git a/LeanPool/MRiscX/Examples/Examples.lean b/LeanPool/MRiscX/Examples/Examples.lean index b5ff25e00e..2097ce1979 100644 --- a/LeanPool/MRiscX/Examples/Examples.lean +++ b/LeanPool/MRiscX/Examples/Examples.lean @@ -315,8 +315,7 @@ example (r₀ r₁ p : UInt64) : · exact this · exact Ne.symm h₂ · exact Ne.symm h₁ - · rw [t_update_neq, t_update_eq] - assumption + · rwa [t_update_neq, t_update_eq] -- /: · applySpec specification_LoadAddress (dst := 2) (pc := 2) (addr := 291) diff --git a/LeanPool/MRiscX/Hoare/HoareRules.lean b/LeanPool/MRiscX/Hoare/HoareRules.lean index 8561479d74..08b913db4b 100644 --- a/LeanPool/MRiscX/Hoare/HoareRules.lean +++ b/LeanPool/MRiscX/Hoare/HoareRules.lean @@ -315,7 +315,7 @@ theorem S_LOOP {α : Type} [Preorder α] [WellFoundedLT α] : V s = v → ∃ s', weak s s' L_w L_b code ∧ Q s' ∧ s'.pc ∉ L_b have loop_correct_at : ∀ v, P v := by - let wf := (inferInstance : WellFoundedLT α).wf + let wf := (inferInstance : WellFoundedLT α) intro v0 apply wf.induction v0 intro v ih s h_code h_pc hI hV diff --git a/LeanPool/MRiscX/Tactics/CodeProofTactics.lean b/LeanPool/MRiscX/Tactics/CodeProofTactics.lean index aa51be050d..7c46f52adc 100644 --- a/LeanPool/MRiscX/Tactics/CodeProofTactics.lean +++ b/LeanPool/MRiscX/Tactics/CodeProofTactics.lean @@ -82,7 +82,7 @@ sets (e.g., `L_W ≠ ∅`), which are trivial in most cases. The same tactic can be used without providing `P` -/ -elab "sapplySSeq" &"P" &" := " P:term &", " +elab (name := sapplySSeqWithP) "sapplySSeq" &"P" &" := " P:term &", " &"R" &" := " R:term &", " &"L_W" &" := " L_w:term &", " &"L_W'" &" := " L_w':term &", " @@ -98,9 +98,12 @@ elab "sapplySSeq" &"P" &" := " P:term &", " evalTactic (← `(tactic | applyToLastGoal simpSetEq )) /-- -The same as the other `sapplySSeq` tactic, but without having to provide -`P`. +`sapplySSeq R := …, L_W := …, L_W' := …, L_B := …, L_B' := …` is the same tactic +without having to provide `P`. -/ +tactic_extension sapplySSeqWithP + +@[tactic_alt sapplySSeqWithP] elab "sapplySSeq" &"R" &" := " R:term &", " &"L_W" &" := " L_w:term &", " &"L_W'" &" := " L_w':term &", " @@ -125,7 +128,7 @@ macro "sapplySSeq'" P:term ", " R:term ", " L_w:term ", " L_w':term : tactic => /-- Like `sapplySSeq`, but without solving the sidegoal `L_b = L_b' ∩ L_b''`. -/ -elab "sapplySSeq''" R:term &", " +elab (name := sapplySSeqDoublePrime) "sapplySSeq''" R:term &", " L_w:term &", " L_w':term &", " L_b:term &", " @@ -139,18 +142,16 @@ elab "sapplySSeq''" R:term &", " -- TODO make this more robust /-- -Apply `S_SEQ` without explicitly providing the names of the parameters. -The order is: -1. `R` -2. `L_W` -3. `L_W'` -4. `L_B` -5. `L_B'` +`sapplySSeq'' R := …, L_W := …, L_W' := …, L_B := …, L_B' := …` applies `S_SEQ` +without explicitly providing `P`. Also, try to automatically solve the most "side goals", which are generated during the process. Those side goals generally are goals about the set provided (e.g. `L_W ≠ ∅`), which are trivial is most cases. -/ +tactic_extension sapplySSeqDoublePrime + +@[tactic_alt sapplySSeqDoublePrime] elab "sapplySSeq''" &"R" &" := " R:term &", " &"L_W" &" := " L_w:term &", " @@ -167,20 +168,17 @@ elab "sapplySSeq''" /-- -Apply `S_SEQ` with explicitly providing the names and values of the parameters. -The order is: -1. `P` -2. `R` -3. `L_W` -4. `L_W'` -5. `L_B` -6. `L_B'` +`sapplySSeq'' P := …, R := …, L_W := …, L_W' := …, L_B := …, L_B' := …` applies +`S_SEQ` with explicitly providing the names and values of the parameters. Also, try to automatically solve the most "side goals", which are generated during the process. Those side goals generally are goals about the set provided (e.g. `L_W ≠ ∅`), which are trivial is most cases. -/ - elab "sapplySSeq''" +tactic_extension sapplySSeqDoublePrime + +@[tactic_alt sapplySSeqDoublePrime] +elab "sapplySSeq''" &"P" &" := " P:term &", " &"R" &" := " R:term &", " &"L_W" &" := " L_w:term &", " @@ -206,7 +204,7 @@ The order is: 5. `L_B` 6. `L_B'` -/ -elab "sapplySSeqPlain" &"P" &" := " P:term &", " +elab (name := sapplySSeqPlainWithP) "sapplySSeqPlain" &"P" &" := " P:term &", " &"R" &" := " R:term &", " &"L_W" &" := " L_w:term &", " &"L_W'" &" := " L_w':term &", " @@ -217,7 +215,13 @@ elab "sapplySSeqPlain" &"P" &" := " P:term &", " (L_w' := $L_w') (L_b := $L_b) (L_b' := $L_b') <;> try assumption <;> try simpSetEq)) -/-- Apply the plain sequencing rule with the given assertions and address sets. -/ +/-- +`sapplySSeqPlain R := …, L_W := …, L_W' := …, L_B := …, L_B' := …` applies the +plain sequencing rule without explicitly providing `P`. +-/ +tactic_extension sapplySSeqPlainWithP + +@[tactic_alt sapplySSeqPlainWithP] elab "sapplySSeqPlain" &"R" &" := " R:term &", " &"L_W" &" := " L_w:term &", " &"L_W'" &" := " L_w':term &", " @@ -237,7 +241,7 @@ elab "sapplySSeqPlain" &"R" &" := " R:term &", " Like `sapplySSeq''`, but also apply a tactic to automatically solve the set equality which should be able to show `L_{B''} = L_B ∩ L_{B'}`. -/ -elab "sapplySSeq'''" &"P" &" := " P:term &", " +elab (name := sapplySSeqTriplePrimeWithP) "sapplySSeq'''" &"P" &" := " P:term &", " &"R" &" := " R:term &", " &"L_W" &" := " L_w:term &", " &"L_W'" &" := " L_w':term &", " @@ -253,17 +257,15 @@ elab "sapplySSeq'''" &"P" &" := " P:term &", " evalTactic (← `(tactic | applyToLastGoal simpSetEq )) /-- -Apply S_SEQ with explicitly providing the names of the parameters. -The order is: -1. `R` -2. `L_W` -3. `L_W'` -4. `L_B` -5. `L_B'` +`sapplySSeq''' R := …, L_W := …, L_W' := …, L_B := …, L_B' := …` applies `S_SEQ` +without explicitly providing `P`. Also, apply a tactic to automatically solve set equality which should be able to show `L_{B''} = L_B ∩ L_{B'}`. -/ +tactic_extension sapplySSeqTriplePrimeWithP + +@[tactic_alt sapplySSeqTriplePrimeWithP] elab "sapplySSeq'''" &"R" &" := " R:term &", " &"L_W" &" := " L_w:term &", " &"L_W'" &" := " L_w':term &", " diff --git a/LeanPool/MRiscX/Util/BasicTheorems.lean b/LeanPool/MRiscX/Util/BasicTheorems.lean index 66da0e0815..7e63b9d09a 100644 --- a/LeanPool/MRiscX/Util/BasicTheorems.lean +++ b/LeanPool/MRiscX/Util/BasicTheorems.lean @@ -154,8 +154,7 @@ instance instPreorderUInt64LeanPool : Preorder UInt64 where · simp -instance : WellFoundedLT UInt64 where - wf := by - apply Subrelation.wf (r := InvImage (· < ·) UInt64.toNat) - (fun h => UInt64.lt_iff_toNat_lt_toNat.mp h) - exact InvImage.wf _ wellFounded_lt +instance : WellFoundedLT UInt64 := by + apply Subrelation.wf (r := InvImage (· < ·) UInt64.toNat) + (fun h => UInt64.lt_iff_toNat_lt_toNat.mp h) + exact InvImage.wf _ wellFounded_lt diff --git a/LeanPool/MatchingLogic/Core.lean b/LeanPool/MatchingLogic/Core.lean index 11589741d8..bbb4339a36 100644 --- a/LeanPool/MatchingLogic/Core.lean +++ b/LeanPool/MatchingLogic/Core.lean @@ -31,7 +31,11 @@ Representation rulings (fixed before any proof was written): * Denotations are `Set M`, i.e. `M → Prop`, classically. -/ import Mathlib.Data.Set.Basic -import Mathlib.Data.Set.Lattice +import Mathlib.Data.Set.Lattice.Bounded +import Mathlib.Data.Set.Lattice.Disjoint +import Mathlib.Data.Set.Lattice.Image +import Mathlib.Data.Set.Lattice.Indexed +import Mathlib.Data.Set.Lattice.Order import Mathlib.Logic.Function.Basic /-! diff --git a/LeanPool/MatchingLogic/EntryIII/Renaming.lean b/LeanPool/MatchingLogic/EntryIII/Renaming.lean index 4e2313f488..8a6cf2d62c 100644 --- a/LeanPool/MatchingLogic/EntryIII/Renaming.lean +++ b/LeanPool/MatchingLogic/EntryIII/Renaming.lean @@ -14,7 +14,7 @@ bridge: transport of syntax, contexts, derivations, semantics, and strong local completeness along an equivalence of variable types. -/ import LeanPool.MatchingLogic.ProofSystem -import Mathlib.Logic.Denumerable +import Mathlib.Basic.Denumerable /-! # MatchingLogic.EntryIII.Renaming diff --git a/LeanPool/MatchingLogic/EntryIII/Witnessed.lean b/LeanPool/MatchingLogic/EntryIII/Witnessed.lean index 31d7ddaff7..422f745ad6 100644 --- a/LeanPool/MatchingLogic/EntryIII/Witnessed.lean +++ b/LeanPool/MatchingLogic/EntryIII/Witnessed.lean @@ -14,7 +14,7 @@ only for the conservative-extension proof, not for the public operation. -/ import LeanPool.MatchingLogic.EntryIII.CaptureAvoiding import LeanPool.MatchingLogic.EntryIII.Lindenbaum -import Mathlib.Data.Countable.Defs +import Mathlib.Basic.Countable.Defs /-! # MatchingLogic.EntryIII.Witnessed diff --git a/LeanPool/MetricCodes/Branching.lean b/LeanPool/MetricCodes/Branching.lean index 034c32fb78..7f7e76898a 100644 --- a/LeanPool/MetricCodes/Branching.lean +++ b/LeanPool/MetricCodes/Branching.lean @@ -1752,10 +1752,8 @@ theorem tendsto_plusLeadingFactor_of_ratio {r : ℕ} (2 * (ambientShift n (lam n) i / (n : ℝ)))) atTop (𝓝 ((a i + 1) / (2 * a i + 1))) := by convert hlimit using 1 - · funext n - rfl - · congr 1 - ring + congr 1 + ring apply hconverted.congr' filter_upwards [eventually_gt_atTop (0 : ℕ)] with n hn have hn' : (n : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hn) @@ -1787,10 +1785,8 @@ theorem tendsto_raisedMinusLeadingFactor_of_ratio {r : ℕ} (1 : ℝ) / (n : ℝ)))) atTop (𝓝 (a i / (2 * a i + 1))) := by convert hlimit using 1 - · funext n - rfl - · congr 1 - ring + congr 1 + ring apply hconverted.congr' filter_upwards [eventually_gt_atTop (0 : ℕ)] with n hn have hn' : (n : ℝ) ≠ 0 := by exact_mod_cast (Nat.ne_of_gt hn) @@ -3108,9 +3104,7 @@ theorem coordinateInclusion_orthogonal rw [LinearMap.zero_apply, inner_zero_left] simp only [LinearMap.comp_apply] rw [LinearMap.adjoint_inner_left] - induction t using TensorProduct.induction_on with - | zero => simp only [LinearIsometry.coe_toLinearMap, map_zero, coordinateInclusion_tmul, - inner_zero_left] + induction t with | tmul y w => change ⟪coordinateInclusion (n := n) lam j (y ⊗ₜ[ℝ] w), @@ -4444,16 +4438,15 @@ theorem gramSummandExponent_eq_pivot_iff {r n : ℕ} theorem coeff_gramPairPolynomial_pivot {r n : ℕ} (hn : 2 * r < n) (z : UpperGramPair r) : - MvPolynomial.coeff (gramPivotExponent hn z) - (gramPairPolynomial n z) = 1 := by + (gramPairPolynomial n z).coeff (gramPivotExponent hn z) = 1 := by classical unfold gramPairPolynomial rowPairingPolynomial simp only [MvPolynomial.coeff_sum] rw [Finset.sum_eq_single (gramPivot hn z)] - · simp only [gramPivotExponent, MvPolynomial.X, MvPolynomial.monomial_mul, mul_one, + · simp only [gramPivotExponent, MvPolynomial.X, MvPolynomial.monomial_mul_monomial, mul_one, MvPolynomial.coeff_monomial, ↓reduceIte] · intro k _ hk - simp only [MvPolynomial.X, MvPolynomial.monomial_mul, + simp only [MvPolynomial.X, MvPolynomial.monomial_mul_monomial, MvPolynomial.coeff_monomial, ite_eq_right_iff, ] simpa only [gramPivotExponent, mul_one, one_ne_zero, imp_false, gramSummandExponent, ne_eq] using @@ -4583,14 +4576,13 @@ instance : IsOrderedCancelAddMonoid (YoungWeightedLex w) where variable [WellFoundedGT σ] -instance : WellFoundedLT (YoungWeightedLex w) where - wf := by - have hlex : WellFounded (Finsupp.Lex (α := σ) (· < ·) (· < ·)) := - Finsupp.Lex.wellFounded' (fun _ => Nat.not_lt_zero _) - (inferInstance : WellFoundedLT ℕ).wf wellFounded_gt - have hprod := WellFounded.prod_lex - (inferInstance : WellFoundedLT ℕ).wf hlex - exact hprod.onFun +instance : WellFoundedLT (YoungWeightedLex w) := by + have hlex : WellFounded (Finsupp.Lex (α := σ) (· < ·) (· < ·)) := + Finsupp.Lex.wellFounded' (fun _ => Nat.not_lt_zero _) + (inferInstance : WellFoundedLT ℕ) wellFounded_gt + have hprod := WellFounded.prod_lex + (inferInstance : WellFoundedLT ℕ) hlex + exact hprod.onFun end LinearOrder @@ -4708,7 +4700,7 @@ theorem gramPairPolynomial_support_exponent {r n : ℕ} obtain ⟨k, _, hk⟩ := Finset.mem_biUnion.mp hsum refine ⟨k, ?_⟩ symm - simpa only [gramSummandExponent, MvPolynomial.X, MvPolynomial.monomial_mul, mul_one, + simpa only [gramSummandExponent, MvPolynomial.X, MvPolynomial.monomial_mul_monomial, mul_one, MvPolynomial.mem_support_iff, MvPolynomial.coeff_monomial, ne_eq, ite_eq_right_iff, one_ne_zero, imp_false, Decidable.not_not] using hk diff --git a/LeanPool/MetricCodes/Conclusion.lean b/LeanPool/MetricCodes/Conclusion.lean index ca8ff107eb..cd07b44b50 100644 --- a/LeanPool/MetricCodes/Conclusion.lean +++ b/LeanPool/MetricCodes/Conclusion.lean @@ -1340,10 +1340,7 @@ theorem gtTransverseTensorEmbedding_axis_inner_eq_zero (q : HarmonicYoungSpace (n := n) mu) : ⟪gtTransverseTensorEmbedding lam nu hnu hnuGram x, canonicalGelfandTsetlinAxisTensor lam mu hmu hmuGram q⟫_ℝ = 0 := by - induction x using TensorProduct.induction_on with - | zero => simp only [map_zero, canonicalGelfandTsetlinAxisTensor_apply, - EuclideanSpace.basisFun_apply, canonicalGelfandTsetlinFibre_apply, - TensorProduct.tmul_smul, inner_zero_left] + induction x with | tmul v p => rw [gtTransverseTensorEmbedding_tmul, canonicalGelfandTsetlinAxisTensor_apply, @@ -2168,8 +2165,7 @@ theorem gtTransverseTensorEmbedding_rotation_intertwine (gtTransverseTensorEmbedding lam nu h hgram).toLinearMap := by apply LinearMap.ext intro x - induction x using TensorProduct.induction_on with - | zero => simp only [map_zero] + induction x with | add x y hx hy => simpa only [map_add] using congrArg₂ (· + ·) hx hy | tmul v p => @@ -3362,10 +3358,7 @@ theorem gtTransverseWallTensorEmbedding_axis_inner_eq_zero (q : HarmonicYoungSpace (n := n) mu) : ⟪gtTransverseWallTensorEmbedding lam mu h hn hlast x, canonicalGelfandTsetlinAxisTensor lam mu h hgram q⟫_ℝ = 0 := by - induction x using TensorProduct.induction_on with - | zero => simp only [map_zero, canonicalGelfandTsetlinAxisTensor_apply, - EuclideanSpace.basisFun_apply, canonicalGelfandTsetlinFibre_apply, - TensorProduct.tmul_smul, inner_zero_left] + induction x with | tmul v p => rw [gtTransverseWallTensorEmbedding_tmul, canonicalGelfandTsetlinAxisTensor_apply, @@ -3612,8 +3605,7 @@ private theorem wallTensorEmbedding_rotation_intertwine_metriccodes2_3a89272e (gtTransverseWallTensorEmbedding lam mu h hn hlast).toLinearMap := by apply LinearMap.ext intro x - induction x using TensorProduct.induction_on with - | zero => simp only [map_zero] + induction x with | add x y hx hy => simpa only [map_add] using congrArg₂ (· + ·) hx hy | tmul v p => @@ -3827,12 +3819,9 @@ theorem gtFullTransverseInternalEmbedding_orthogonal {r n : ℕ} HarmonicYoungSpace (n := n) (fullBranchSignature nu)) : ⟪gtFullTransverseInternalEmbedding lam hn mu x, gtFullTransverseInternalEmbedding lam hn nu y⟫_ℝ = 0 := by - induction x using TensorProduct.induction_on with - | zero => simp only [map_zero, inner_zero_left] + induction x with | tmul v p => - induction y using TensorProduct.induction_on with - | zero => simp only [gtFullTransverseInternalEmbedding_tmul, Nat.add_one_sub_one, map_zero, - inner_zero_right] + induction y with | tmul w q => rw [gtFullTransverseInternalEmbedding_tmul, gtFullTransverseInternalEmbedding_tmul, @@ -4042,8 +4031,7 @@ theorem gtFullAxisAmbientInclusion_sup_transverse_range_eq_top HarmonicYoungSpace (n := n + 1) lam)) := by apply top_unique intro x _ - induction x using TensorProduct.induction_on with - | zero => exact Submodule.zero_mem _ + induction x with | tmul v p => let w : SpherePacking.Euclidean n := WithLp.toLp 2 (fun i : Fin n => v i.castSucc) @@ -4103,9 +4091,7 @@ theorem gtFullAxisEmbedding_inner_transverse_eq_zero {r n : ℕ} HarmonicYoungSpace (n := n) (fullBranchSignature nu)) : ⟪gtFullAxisEmbedding lam hn mu p, gtFullTransverseEmbedding lam hn nu x⟫_ℝ = 0 := by - induction x using TensorProduct.induction_on with - | zero => simp only [gtFullAxisEmbedding_apply, EuclideanSpace.basisFun_apply, - Nat.add_one_sub_one, map_zero, inner_zero_right] + induction x with | tmul v q => rw [gtFullAxisEmbedding_apply] change @@ -4833,8 +4819,7 @@ theorem tensor_mapIsometry_range_eq_of_second_range_eq LinearMap.range (TensorProduct.mapIsometry e h).toLinearMap := by apply le_antisymm · rintro _ ⟨x, rfl⟩ - induction x using TensorProduct.induction_on with - | zero => exact Submodule.zero_mem _ + induction x with | add x y hx hy => simpa only [map_add] using Submodule.add_mem _ hx hy | tmul v p => have hmem : g p ∈ LinearMap.range h.toLinearMap := by @@ -4846,8 +4831,7 @@ theorem tensor_mapIsometry_range_eq_of_second_range_eq change e v ⊗ₜ[ℝ] h q = e v ⊗ₜ[ℝ] g p rw [hq] · rintro _ ⟨x, rfl⟩ - induction x using TensorProduct.induction_on with - | zero => exact Submodule.zero_mem _ + induction x with | add x y hx hy => simpa only [map_add] using Submodule.add_mem _ hx hy | tmul v p => have hmem : h p ∈ LinearMap.range g.toLinearMap := by diff --git a/LeanPool/MetricCodes/HarmonicAnalysis.lean b/LeanPool/MetricCodes/HarmonicAnalysis.lean index 1dd16b1457..1c909d6e4d 100644 --- a/LeanPool/MetricCodes/HarmonicAnalysis.lean +++ b/LeanPool/MetricCodes/HarmonicAnalysis.lean @@ -950,9 +950,9 @@ theorem multiFactorial_add_single {n : ℕ} theorem coeff_pderiv (n : ℕ) (i : Fin n) (a : MultiIndex n) (p : MvPolynomial (Fin n) ℝ) : - MvPolynomial.coeff a (MvPolynomial.pderiv i p) = + (MvPolynomial.pderiv i p).coeff a = ((a i + 1 : ℕ) : ℝ) * - MvPolynomial.coeff (a + Finsupp.single i 1) p := by + p.coeff (a + Finsupp.single i 1) := by classical induction p using MvPolynomial.induction_on' with | monomial b c => @@ -987,20 +987,20 @@ theorem coeff_pderiv (n : ℕ) (i : Fin n) (a : MultiIndex n) · simp only [add_tsub_cancel_right] simp only [hba, ↓reduceIte, Nat.cast_add, Nat.cast_one, hne, mul_zero] | add p q hp hq => - simp only [map_add, MvPolynomial.coeff_add, hp, hq] + simp only [map_add, AddMonoidAlgebra.coeff_add, Finsupp.add_apply, hp, hq] ring /-- The polynomial inner used in the spherical-code argument. -/ def polynomialInner (n : ℕ) (p q : MvPolynomial (Fin n) ℝ) : ℝ := Finsupp.sum (AddMonoidAlgebra.coeff p) fun a c => - multiFactorial a * c * MvPolynomial.coeff a q + multiFactorial a * c * q.coeff a @[simp] theorem polynomialInner_monomial (n : ℕ) (a : MultiIndex n) (c : ℝ) (q : MvPolynomial (Fin n) ℝ) : polynomialInner n (MvPolynomial.monomial a c) q = - multiFactorial a * c * MvPolynomial.coeff a q := by + multiFactorial a * c * q.coeff a := by unfold polynomialInner rw [MvPolynomial.sum_monomial_eq] simp only [mul_zero, zero_mul] @@ -1021,7 +1021,7 @@ theorem polynomialInner_add_right (n : ℕ) polynomialInner n p (q + r) = polynomialInner n p q + polynomialInner n p r := by unfold polynomialInner - simp only [MvPolynomial.sum_def, MvPolynomial.coeff_add] + simp only [MvPolynomial.sum_def, AddMonoidAlgebra.coeff_add, Finsupp.add_apply] simp_rw [mul_add] rw [Finset.sum_add_distrib] @@ -1034,29 +1034,29 @@ theorem polynomialInner_comm (n : ℕ) calc (∑ a ∈ p.support, multiFactorial a * - MvPolynomial.coeff a p * MvPolynomial.coeff a q) = + p.coeff a * q.coeff a) = ∑ a ∈ p.support ∪ q.support, multiFactorial a * - MvPolynomial.coeff a p * MvPolynomial.coeff a q := by + p.coeff a * q.coeff a := by apply Finset.sum_subset Finset.subset_union_left intro a ha hnot - have hzero : MvPolynomial.coeff a p = 0 := + have hzero : p.coeff a = 0 := MvPolynomial.notMem_support_iff.mp hnot simp only [hzero, mul_zero, zero_mul] _ = ∑ a ∈ q.support ∪ p.support, multiFactorial a * - MvPolynomial.coeff a q * MvPolynomial.coeff a p := by + q.coeff a * p.coeff a := by rw [Finset.union_comm] apply Finset.sum_congr rfl intro a ha ring _ = ∑ a ∈ q.support, multiFactorial a * - MvPolynomial.coeff a q * MvPolynomial.coeff a p := by + q.coeff a * p.coeff a := by symm apply Finset.sum_subset Finset.subset_union_left intro a ha hnot - have hzero : MvPolynomial.coeff a q = 0 := + have hzero : q.coeff a = 0 := MvPolynomial.notMem_support_iff.mp hnot simp only [hzero, mul_zero, zero_mul] @@ -1069,11 +1069,11 @@ theorem polynomialInner_self_nonneg (n : ℕ) intro a ha calc 0 ≤ multiFactorial a * - (MvPolynomial.coeff a p) ^ 2 := + (p.coeff a) ^ 2 := mul_nonneg (multiFactorial_pos a).le - (sq_nonneg (MvPolynomial.coeff a p)) + (sq_nonneg (p.coeff a)) _ = multiFactorial a * - MvPolynomial.coeff a p * MvPolynomial.coeff a p := by + p.coeff a * p.coeff a := by ring theorem polynomialInner_self_pos (n : ℕ) @@ -1083,15 +1083,15 @@ theorem polynomialInner_self_pos (n : ℕ) rw [MvPolynomial.sum_def] apply Finset.sum_pos · intro a ha - have hcoeff : MvPolynomial.coeff a p ≠ 0 := + have hcoeff : p.coeff a ≠ 0 := MvPolynomial.mem_support_iff.mp ha calc 0 < multiFactorial a * - (MvPolynomial.coeff a p) ^ 2 := + (p.coeff a) ^ 2 := mul_pos (multiFactorial_pos a) (sq_pos_of_ne_zero hcoeff) _ = multiFactorial a * - MvPolynomial.coeff a p * MvPolynomial.coeff a p := by + p.coeff a * p.coeff a := by ring · exact MvPolynomial.support_nonempty.mpr hp @@ -1103,8 +1103,8 @@ theorem polynomialInner_self_pos (n : ℕ) by_contra hp exact (ne_of_gt (polynomialInner_self_pos n hp)) h · rintro rfl - simp only [polynomialInner, AddMonoidAlgebra.coeff_zero, MvPolynomial.coeff_zero, mul_zero, - Finsupp.sum_fun_zero] + simp only [polynomialInner, AddMonoidAlgebra.coeff_zero, Finsupp.coe_zero, + Pi.zero_apply, mul_zero, Finsupp.sum_fun_zero] theorem polynomialInner_smul_left (n : ℕ) (c : ℝ) (p q : MvPolynomial (Fin n) ℝ) : @@ -1115,8 +1115,8 @@ theorem polynomialInner_smul_left (n : ℕ) (c : ℝ) rw [MvPolynomial.smul_monomial, polynomialInner_monomial, polynomialInner_monomial] change - multiFactorial a * (c * d) * MvPolynomial.coeff a q = - c * (multiFactorial a * d * MvPolynomial.coeff a q) + multiFactorial a * (c * d) * q.coeff a = + c * (multiFactorial a * d * q.coeff a) ring | add p q hp hq => rw [smul_add, polynomialInner_add_left, @@ -1154,8 +1154,9 @@ theorem polynomialInner_sum_right {ι : Type*} (n : ℕ) ∑ i ∈ s, polynomialInner n p (f i) := by classical induction s using Finset.induction_on with - | empty => simp only [polynomialInner, Finset.sum_empty, MvPolynomial.coeff_zero, mul_zero, - Finsupp.sum_fun_zero, MvPolynomial.sum_def] + | empty => simp only [polynomialInner, Finset.sum_empty, AddMonoidAlgebra.coeff_zero, + Finsupp.coe_zero, Pi.zero_apply, mul_zero, Finsupp.sum_fun_zero, + MvPolynomial.sum_def] | @insert i s hi ih => rw [Finset.sum_insert hi, polynomialInner_add_right, ih, Finset.sum_insert hi] @@ -1264,50 +1265,40 @@ def coefficientEmbedding (n m : ℕ) : toFun p := WithLp.toLp 2 fun a : DegreeIndex n m => Real.sqrt (multiFactorial (a : MultiIndex n)) * - MvPolynomial.coeff (a : MultiIndex n) - (p : MvPolynomial (Fin n) ℝ) + (p : MvPolynomial (Fin n) ℝ).coeff (a : MultiIndex n) map_add' p q := by ext a change Real.sqrt (multiFactorial (a : MultiIndex n)) * - MvPolynomial.coeff (a : MultiIndex n) - ((p : MvPolynomial (Fin n) ℝ) + - (q : MvPolynomial (Fin n) ℝ)) = + ((p : MvPolynomial (Fin n) ℝ) + (q : MvPolynomial (Fin n) ℝ)).coeff (a : MultiIndex n) = Real.sqrt (multiFactorial (a : MultiIndex n)) * - MvPolynomial.coeff (a : MultiIndex n) - (p : MvPolynomial (Fin n) ℝ) + + (p : MvPolynomial (Fin n) ℝ).coeff (a : MultiIndex n) + Real.sqrt (multiFactorial (a : MultiIndex n)) * - MvPolynomial.coeff (a : MultiIndex n) - (q : MvPolynomial (Fin n) ℝ) - rw [MvPolynomial.coeff_add] + (q : MvPolynomial (Fin n) ℝ).coeff (a : MultiIndex n) + simp only [AddMonoidAlgebra.coeff_add, Finsupp.add_apply] ring map_smul' c p := by ext a change Real.sqrt (multiFactorial (a : MultiIndex n)) * - MvPolynomial.coeff (a : MultiIndex n) - (c • (p : MvPolynomial (Fin n) ℝ)) = + (c • (p : MvPolynomial (Fin n) ℝ)).coeff (a : MultiIndex n) = c * (Real.sqrt (multiFactorial (a : MultiIndex n)) * - MvPolynomial.coeff (a : MultiIndex n) - (p : MvPolynomial (Fin n) ℝ)) + (p : MvPolynomial (Fin n) ℝ).coeff (a : MultiIndex n)) rw [MvPolynomial.coeff_smul] change Real.sqrt (multiFactorial (a : MultiIndex n)) * - (c * MvPolynomial.coeff (a : MultiIndex n) - (p : MvPolynomial (Fin n) ℝ)) = + (c * (p : MvPolynomial (Fin n) ℝ).coeff (a : MultiIndex n)) = c * (Real.sqrt (multiFactorial (a : MultiIndex n)) * - MvPolynomial.coeff (a : MultiIndex n) - (p : MvPolynomial (Fin n) ℝ)) + (p : MvPolynomial (Fin n) ℝ).coeff (a : MultiIndex n)) ring @[simp] theorem coefficientEmbedding_apply (n m : ℕ) (p : Homogeneous n m) (a : DegreeIndex n m) : coefficientEmbedding n m p a = Real.sqrt (multiFactorial (a : MultiIndex n)) * - MvPolynomial.coeff (a : MultiIndex n) - (p : MvPolynomial (Fin n) ℝ) := rfl + (p : MvPolynomial (Fin n) ℝ).coeff (a : MultiIndex n) := rfl theorem coefficientEmbedding_injective (n m : ℕ) : Function.Injective (coefficientEmbedding n m) := by @@ -1354,10 +1345,8 @@ theorem homogeneousInner_eq_sum (n m : ℕ) homogeneousInner n m p q = ∑ a : DegreeIndex n m, multiFactorial (a : MultiIndex n) * - MvPolynomial.coeff (a : MultiIndex n) - (p : MvPolynomial (Fin n) ℝ) * - MvPolynomial.coeff (a : MultiIndex n) - (q : MvPolynomial (Fin n) ℝ) := by + (p : MvPolynomial (Fin n) ℝ).coeff (a : MultiIndex n) * + (q : MvPolynomial (Fin n) ℝ).coeff (a : MultiIndex n) := by unfold homogeneousInner rw [PiLp.inner_apply] simp only [Real.inner_apply, coefficientEmbedding_apply] @@ -1367,17 +1356,13 @@ theorem homogeneousInner_eq_sum (n m : ℕ) (multiFactorial_pos (a : MultiIndex n)).le calc (Real.sqrt (multiFactorial (a : MultiIndex n)) * - MvPolynomial.coeff (a : MultiIndex n) - (p : MvPolynomial (Fin n) ℝ)) * + (p : MvPolynomial (Fin n) ℝ).coeff (a : MultiIndex n)) * (Real.sqrt (multiFactorial (a : MultiIndex n)) * - MvPolynomial.coeff (a : MultiIndex n) - (q : MvPolynomial (Fin n) ℝ)) = + (q : MvPolynomial (Fin n) ℝ).coeff (a : MultiIndex n)) = (Real.sqrt (multiFactorial (a : MultiIndex n)) * Real.sqrt (multiFactorial (a : MultiIndex n))) * - MvPolynomial.coeff (a : MultiIndex n) - (p : MvPolynomial (Fin n) ℝ) * - MvPolynomial.coeff (a : MultiIndex n) - (q : MvPolynomial (Fin n) ℝ) := by ring + (p : MvPolynomial (Fin n) ℝ).coeff (a : MultiIndex n) * + (q : MvPolynomial (Fin n) ℝ).coeff (a : MultiIndex n) := by ring _ = _ := by rw [Real.mul_self_sqrt hw] theorem homogeneousInner_eq_polynomialInner (n m : ℕ) @@ -1394,14 +1379,14 @@ theorem homogeneousInner_eq_polynomialInner (n m : ℕ) (∑ a : DegreeIndex n m, (fun b : MultiIndex n => multiFactorial b * - MvPolynomial.coeff b (p : MvPolynomial (Fin n) ℝ) * - MvPolynomial.coeff b (q : MvPolynomial (Fin n) ℝ)) + (p : MvPolynomial (Fin n) ℝ).coeff b * + (q : MvPolynomial (Fin n) ℝ).coeff b) (a : MultiIndex n)) = _ rw [Finset.sum_coe_sort (degreeIndices n m) (fun b : MultiIndex n => multiFactorial b * - MvPolynomial.coeff b (p : MvPolynomial (Fin n) ℝ) * - MvPolynomial.coeff b (q : MvPolynomial (Fin n) ℝ))] + (p : MvPolynomial (Fin n) ℝ).coeff b * + (q : MvPolynomial (Fin n) ℝ).coeff b)] symm apply Finset.sum_subset · intro a ha @@ -1411,8 +1396,7 @@ theorem homogeneousInner_eq_polynomialInner (n m : ℕ) (MvPolynomial.IsHomogeneous.coeff_eq_zero p.property hdeg) · intro a ha hnot have hzero : - MvPolynomial.coeff a - (p : MvPolynomial (Fin n) ℝ) = 0 := + (p : MvPolynomial (Fin n) ℝ).coeff a = 0 := MvPolynomial.notMem_support_iff.mp hnot rw [hzero] ring @@ -1460,8 +1444,7 @@ theorem homogeneousInner_eq_polynomialInner (n m : ℕ) (a : DegreeIndex n m) : harmonicCoefficientEmbedding n m p a = Real.sqrt (multiFactorial (a : MultiIndex n)) * - MvPolynomial.coeff (a : MultiIndex n) - (p : MvPolynomial (Fin n) ℝ) := rfl + (p : MvPolynomial (Fin n) ℝ).coeff (a : MultiIndex n) := rfl /-- The harmonic inner used in the spherical-code argument. -/ def harmonicInner (n m : ℕ) @@ -1475,10 +1458,8 @@ theorem harmonicInner_eq_sum (n m : ℕ) harmonicInner n m p q = ∑ a : DegreeIndex n m, multiFactorial (a : MultiIndex n) * - MvPolynomial.coeff (a : MultiIndex n) - (p : MvPolynomial (Fin n) ℝ) * - MvPolynomial.coeff (a : MultiIndex n) - (q : MvPolynomial (Fin n) ℝ) := by + (p : MvPolynomial (Fin n) ℝ).coeff (a : MultiIndex n) * + (q : MvPolynomial (Fin n) ℝ).coeff (a : MultiIndex n) := by unfold harmonicInner rw [PiLp.inner_apply] simp only [Real.inner_apply, harmonicCoefficientEmbedding_apply] @@ -1488,17 +1469,13 @@ theorem harmonicInner_eq_sum (n m : ℕ) (multiFactorial_pos (a : MultiIndex n)).le calc (Real.sqrt (multiFactorial (a : MultiIndex n)) * - MvPolynomial.coeff (a : MultiIndex n) - (p : MvPolynomial (Fin n) ℝ)) * + (p : MvPolynomial (Fin n) ℝ).coeff (a : MultiIndex n)) * (Real.sqrt (multiFactorial (a : MultiIndex n)) * - MvPolynomial.coeff (a : MultiIndex n) - (q : MvPolynomial (Fin n) ℝ)) = + (q : MvPolynomial (Fin n) ℝ).coeff (a : MultiIndex n)) = (Real.sqrt (multiFactorial (a : MultiIndex n)) * Real.sqrt (multiFactorial (a : MultiIndex n))) * - MvPolynomial.coeff (a : MultiIndex n) - (p : MvPolynomial (Fin n) ℝ) * - MvPolynomial.coeff (a : MultiIndex n) - (q : MvPolynomial (Fin n) ℝ) := by ring + (p : MvPolynomial (Fin n) ℝ).coeff (a : MultiIndex n) * + (q : MvPolynomial (Fin n) ℝ).coeff (a : MultiIndex n) := by ring _ = _ := by rw [Real.mul_self_sqrt hw] theorem harmonicInner_eq_polynomialInner (n m : ℕ) @@ -1983,7 +1960,7 @@ theorem polynomialLaplacian_eq_zero_of_isHomogeneous_le_one have hconst : MvPolynomial.pderiv i p = MvPolynomial.C - (MvPolynomial.coeff 0 (MvPolynomial.pderiv i p)) := + ((MvPolynomial.pderiv i p).coeff 0) := MvPolynomial.totalDegree_eq_zero_iff_eq_C.mp hdeg rw [hconst, MvPolynomial.pderiv_C] @@ -2364,7 +2341,7 @@ theorem directionalDerivative_eq_zero_of_isHomogeneous_zero have hdeg : p.totalDegree = 0 := (MvPolynomial.totalDegree_zero_iff_isHomogeneous (Fin n)).mpr hp - have hconst : p = MvPolynomial.C (MvPolynomial.coeff 0 p) := + have hconst : p = MvPolynomial.C (p.coeff 0) := MvPolynomial.totalDegree_eq_zero_iff_eq_C.mp hdeg rw [hconst, directionalDerivative_apply] simp only [MvPolynomial.derivation_C, smul_zero, Finset.sum_const_zero] @@ -2372,7 +2349,8 @@ theorem directionalDerivative_eq_zero_of_isHomogeneous_zero theorem fischer_polynomialInner_zero_right (n : ℕ) (p : MvPolynomial (Fin n) ℝ) : Fischer.polynomialInner n p 0 = 0 := by - simp only [Fischer.polynomialInner, MvPolynomial.coeff_zero, mul_zero, Finsupp.sum_fun_zero] + simp only [Fischer.polynomialInner, AddMonoidAlgebra.coeff_zero, Finsupp.coe_zero, + Pi.zero_apply, mul_zero, Finsupp.sum_fun_zero] theorem fischer_polynomialInner_sub_left (n : ℕ) (p q r : MvPolynomial (Fin n) ℝ) : diff --git a/LeanPool/MetricCodes/Hierarchy.lean b/LeanPool/MetricCodes/Hierarchy.lean index 2483cf82c0..f1f71faa64 100644 --- a/LeanPool/MetricCodes/Hierarchy.lean +++ b/LeanPool/MetricCodes/Hierarchy.lean @@ -2983,9 +2983,7 @@ theorem tendsto_sphericalEntropy_sub_of_ratio (a⁻¹ + f a / a) / (a⁻¹ + 1)) atTop (𝓝 c) := by convert (hinv.add hratio).div (hinv.add_const 1) (by norm_num : (0 : ℝ) + 1 ≠ 0) using 1 - · ext a - rfl - · norm_num + norm_num have hshifted : Tendsto (fun a : ℝ => (1 + f a) / (1 + a)) atTop (𝓝 c) := by @@ -3659,8 +3657,8 @@ theorem tendsto_spectralAtom_atTop_half : Tendsto (fun u : ℝ => Real.sqrt (1 + u⁻¹) / (u⁻¹ + 2)) atTop (nhds ((1 : ℝ) / 2)) := by convert ((tendsto_const_nhds (x := (1 : ℝ))).add hinv).sqrt.div - (hinv.add_const 2) (by norm_num : (0 : ℝ) + 2 ≠ 0) using 1 <;> - norm_num; rfl + (hinv.add_const 2) (by norm_num : (0 : ℝ) + 2 ≠ 0) using 1 + norm_num apply hnormal.congr' filter_upwards [eventually_gt_atTop (0 : ℝ)] with u hu unfold spectralAtom @@ -3696,8 +3694,8 @@ theorem tendsto_retainedQuadraticResidueFactor_atTop atTop (nhds (c ^ 2)) := by convert ((hq.const_mul (z * (1 + z))).sub_const (c ^ 2)).div ((hq.const_mul (z * (1 + z))).sub_const 1) - (by norm_num : ((z * (1 + z)) * 0 - 1 : ℝ) ≠ 0) using 1 <;> - norm_num; rfl + (by norm_num : ((z * (1 + z)) * 0 - 1 : ℝ) ≠ 0) using 1 + norm_num apply hnormal.congr' filter_upwards [eventually_gt_atTop (0 : ℝ)] with u hu have hquad : (u * (1 + u)) ≠ 0 := by @@ -4404,9 +4402,7 @@ theorem tendsto_shifted_degree_ratio_of_tendsto_ratio ((u n)⁻¹ + 1)) atTop (nhds d) := by convert (hinv.add hratio).div (hinv.add_const 1) (by norm_num : (0 : ℝ) + 1 ≠ 0) using 1 - · ext n - rfl - · norm_num + norm_num apply hnormalized.congr' filter_upwards [hu.eventually (eventually_gt_atTop (0 : ℝ))] with n hn @@ -4480,8 +4476,6 @@ theorem paired_stabilizer_tendsto_atTop_of_ambient (fun n => a (φ n) i.castSucc / D - 1) atTop atTop := by convert tendsto_atTop_add_const_right atTop (-1) (ha.atTop_div_const hD) using 1 - ext n - ring exact tendsto_atTop_mono' atTop (Filter.Eventually.of_forall hbound) hleft @@ -4882,7 +4876,7 @@ theorem exists_compactified_residual_of_closure_sequence exact (hescape i (hprefix i (Finset.mem_filter.mp hi).2).1).1 have hcle : c ≤ 1 := by dsimp [c] - apply Finset.prod_le_one + apply Finset.prod_le_one₀ · intro i _ exact (hd i).1 · intro i _ @@ -6944,9 +6938,7 @@ theorem tendsto_sphericalEntropy_sub_of_sequential_ratio atTop (𝓝 c) := by convert (hinv.add hratio).div (hinv.add_const 1) (by norm_num : (0 : ℝ) + 1 ≠ 0) using 1 - · ext n - rfl - · norm_num + norm_num have hshifted : Tendsto (fun n => (1 + b n) / (1 + a n)) atTop (𝓝 c) := by apply hnormalized.congr' diff --git a/LeanPool/MetricCodes/HighestWeights.lean b/LeanPool/MetricCodes/HighestWeights.lean index 31d16ae337..4b67b0492b 100644 --- a/LeanPool/MetricCodes/HighestWeights.lean +++ b/LeanPool/MetricCodes/HighestWeights.lean @@ -3709,7 +3709,7 @@ theorem sourceRowDegree_eq_of_coeff_ne_zero {m : ℕ} (hp : ∀ i, sourceRowRoot i i p = (lam i : ℂ) • p) (d : Fin m × Fin m →₀ ℕ) (hd : p.coeff d ≠ 0) (i : Fin m) : sourceRowDegree d i = lam i := by - have hcoeff := congrArg (MvPolynomial.coeff d) (hp i) + have hcoeff := congrArg (·.coeff d) (hp i) rw [coeff_sourceRowRoot_self, MvPolynomial.coeff_smul] at hcoeff have hmul : (sourceRowDegree d i : ℂ) * p.coeff d = @@ -3722,7 +3722,7 @@ theorem sourceColumnDegree_eq_of_coeff_ne_zero {m : ℕ} (hp : ∀ i, sourceColumnRoot i i p = (lam i : ℂ) • p) (d : Fin m × Fin m →₀ ℕ) (hd : p.coeff d ≠ 0) (i : Fin m) : sourceColumnDegree d i = lam i := by - have hcoeff := congrArg (MvPolynomial.coeff d) (hp i) + have hcoeff := congrArg (·.coeff d) (hp i) rw [coeff_sourceColumnRoot_self, MvPolynomial.coeff_smul] at hcoeff have hmul : (sourceColumnDegree d i : ℂ) * p.coeff d = @@ -4090,7 +4090,8 @@ theorem polynomialImaginaryPart_complexification apply MvPolynomial.ext intro d simp only [polynomialComplexification_apply, coeff_polynomialImaginaryPart, - MvPolynomial.coeff_map, Complex.ofRealHom_eq_coe, Complex.ofReal_im, MvPolynomial.coeff_zero] + MvPolynomial.coeff_map, Complex.ofRealHom_eq_coe, Complex.ofReal_im, + AddMonoidAlgebra.coeff_zero, Finsupp.coe_zero, Pi.zero_apply] theorem polynomialRealPart_complex_smul {r n : ℕ} (c : ℂ) (p : MvPolynomial (Fin ((r + 1) * n)) ℂ) : @@ -4110,7 +4111,7 @@ theorem polynomialImaginaryPart_complex_smul {r n : ℕ} (c : ℂ) apply MvPolynomial.ext intro d simp only [coeff_polynomialImaginaryPart, MvPolynomial.coeff_smul, smul_eq_mul, Complex.mul_im, - MvPolynomial.coeff_add, coeff_polynomialRealPart] + AddMonoidAlgebra.coeff_add, Finsupp.add_apply, coeff_polynomialRealPart] /-- The polynomial complex span used in the spherical-code argument. -/ def polynomialComplexSpan {r n : ℕ} @@ -4174,9 +4175,11 @@ theorem polynomialComplexSpan_inf_eq_bot_of_inf_eq_bot apply MvPolynomial.ext intro d apply Complex.ext - · simpa only [MvPolynomial.coeff_zero, Complex.zero_re, coeff_polynomialRealPart] using + · simpa only [AddMonoidAlgebra.coeff_zero, Finsupp.coe_zero, Pi.zero_apply, Complex.zero_re, + coeff_polynomialRealPart] using congrArg (fun p : PolynomialSpace r n => p.coeff d) hreal - · simpa only [MvPolynomial.coeff_zero, Complex.zero_im, coeff_polynomialImaginaryPart] using + · simpa only [AddMonoidAlgebra.coeff_zero, Finsupp.coe_zero, Pi.zero_apply, Complex.zero_im, + coeff_polynomialImaginaryPart] using congrArg (fun p : PolynomialSpace r n => p.coeff d) himag simp only [hz0, zero_mem] @@ -5395,10 +5398,9 @@ theorem upperRootTarget_coefficient_eq_zero {m : ℕ} if upperRootTargetExponent d i j (i, k) = 0 then 0 else (upperRootTargetExponent d i j (j, k) + 1 : ℕ) • p.coeff (upperRootSourceExponent d i j k)) = 0 := by - have hcoeff := congrArg - (MvPolynomial.coeff (upperRootTargetExponent d i j)) hhighest + have hcoeff := congrArg (·.coeff (upperRootTargetExponent d i j)) hhighest rw [sourceRowRoot_apply, MvPolynomial.coeff_sum] at hcoeff - simp only [MvPolynomial.coeff_zero] at hcoeff + simp only [AddMonoidAlgebra.coeff_zero] at hcoeff convert hcoeff using 1 apply Finset.sum_congr rfl intro k _ @@ -5587,7 +5589,8 @@ theorem eq_zero_of_upperRoots_of_massZero_coeff exact ih (belowDiagonalMass e) (by omega) e rfl apply MvPolynomial.ext intro d - simpa only [MvPolynomial.coeff_zero] using hcoeff (belowDiagonalMass d) d rfl + simpa only [AddMonoidAlgebra.coeff_zero, Finsupp.coe_zero, Pi.zero_apply] using + hcoeff (belowDiagonalMass d) d rfl theorem belowDiagonal_entry_eq_zero_of_mass_eq_zero {m : ℕ} (d : Fin m × Fin m →₀ ℕ) diff --git a/LeanPool/MetricCodes/Interlacing.lean b/LeanPool/MetricCodes/Interlacing.lean index 6650ab3185..3cd9b2287f 100644 --- a/LeanPool/MetricCodes/Interlacing.lean +++ b/LeanPool/MetricCodes/Interlacing.lean @@ -2998,7 +2998,7 @@ theorem young_pderiv_eq_zero_of_isHomogeneous_zero have hdegree : p.totalDegree = 0 := (MvPolynomial.totalDegree_zero_iff_isHomogeneous (Fin ((r + 1) * n))).mpr hp - have hconstant : p = MvPolynomial.C (MvPolynomial.coeff 0 p) := + have hconstant : p = MvPolynomial.C (p.coeff 0) := MvPolynomial.totalDegree_eq_zero_iff_eq_C.mp hdegree rw [hconstant, MvPolynomial.pderiv_C] @@ -7266,8 +7266,8 @@ theorem downstreamCorrectedDerivative_fischer_cross_recurrence internalDerivative_downstreamPolarization_fischer_inner lam i j hij p _ k] ring - · simp only [SpherePacking.Fischer.polynomialInner, MvPolynomial.coeff_zero, mul_zero, - Finsupp.sum_fun_zero, neg_zero] + · simp only [SpherePacking.Fischer.polynomialInner, AddMonoidAlgebra.coeff_zero, + Finsupp.coe_zero, Pi.zero_apply, mul_zero, Finsupp.sum_fun_zero, neg_zero] theorem downstreamCorrectedDerivative_fischer_cross_sum_recurrence {r n : ℕ} (lam : Fin (r + 1) → ℕ) @@ -7869,8 +7869,8 @@ theorem projectedCoordinateLower_basis_eq_downstreamCorrectedDerivative ((mem_harmonicYoungSubmodule mu (q : PolynomialSpace r n)).mp q.property).2.2.2 a j haj rw [hhighest] - simp only [SpherePacking.Fischer.polynomialInner, MvPolynomial.coeff_zero, mul_zero, - Finsupp.sum_fun_zero] + simp only [SpherePacking.Fischer.polynomialInner, AddMonoidAlgebra.coeff_zero, + Finsupp.coe_zero, Pi.zero_apply, mul_zero, Finsupp.sum_fun_zero] · simp only [SpherePacking.Fischer.polynomialInner, AddMonoidAlgebra.coeff_zero, Finsupp.sum_zero_index] diff --git a/LeanPool/MetricCodes/Rates.lean b/LeanPool/MetricCodes/Rates.lean index e0f1da3b70..d9340e8eda 100644 --- a/LeanPool/MetricCodes/Rates.lean +++ b/LeanPool/MetricCodes/Rates.lean @@ -3779,7 +3779,8 @@ theorem log_kissing_a : Real.log (16 : ℝ) + Real.log kissingA := Real.log_mul (by norm_num) (by norm_num [kissingA]) have hpow : Real.log (16 : ℝ) = 4 * Real.log 2 := by - convert Real.log_pow (2 : ℝ) 4 using 1 <;> norm_num + convert Real.log_pow (2 : ℝ) 4 using 1 + norm_num rw [hpow] at hmul linarith @@ -3790,7 +3791,8 @@ theorem log_kissing_b : Real.log (256 : ℝ) + Real.log kissingB := Real.log_mul (by norm_num) (by norm_num [kissingB]) have hpow : Real.log (256 : ℝ) = 8 * Real.log 2 := by - convert Real.log_pow (2 : ℝ) 8 using 1 <;> norm_num + convert Real.log_pow (2 : ℝ) 8 using 1 + norm_num have hinv : Real.log (1 / (256 * kissingB)) = -Real.log (256 * kissingB) := by rw [one_div, Real.log_inv] @@ -4771,7 +4773,7 @@ instance betaMap_half_half_isProbabilityMeasure : (fun t : ℝ => t / 4)) := by let : IsProbabilityMeasure (betaMeasure (1 / 2 : ℝ) (1 / 2 : ℝ)) := isProbabilityMeasureBeta (by norm_num) (by norm_num) - exact Measure.isProbabilityMeasure_map (by fun_prop) + infer_instance theorem arcsine_stieltjes_integrable {x : ℝ} (hx : 0 ≤ x) : Integrable (fun t : ℝ => x / (x + t)) @@ -4966,7 +4968,6 @@ theorem kissing_spectral_certificate : lagrangeDenominator, Fin.prod_univ_two] at h₀ h₁ h₂ ⊢ - norm_num [Fin.ext_iff] at h₀ h₁ h₂ ⊢ linarith theorem rational_log_lower {r lo : ℝ} (hr : 1 ≤ r) (m : ℕ) diff --git a/LeanPool/MetricCodes/Representation.lean b/LeanPool/MetricCodes/Representation.lean index b628f2b055..222fb920e6 100644 --- a/LeanPool/MetricCodes/Representation.lean +++ b/LeanPool/MetricCodes/Representation.lean @@ -351,8 +351,8 @@ theorem coeff_zero_polynomialMap {n : ℕ} (U : SpherePacking.Euclidean n ≃ₗᵢ[ℝ] SpherePacking.Euclidean n) (p : MvPolynomial (Fin n) ℝ) : - MvPolynomial.coeff 0 (polynomialMap U p) = - MvPolynomial.coeff 0 p := by + (polynomialMap U p).coeff 0 = + p.coeff 0 := by have h := eval_polynomialMap U p (0 : SpherePacking.Euclidean n) simp only [map_zero, PiLp.zero_apply] at h simpa only [MvPolynomial.eval_zero', MvPolynomial.constantCoeff_eq] @@ -2202,7 +2202,8 @@ theorem coeff_X_mul_pderiv {R σ : Type*} [CommSemiring R] classical induction p using MvPolynomial.induction_on' with | add p q hp hq => - simp only [map_add, mul_add, MvPolynomial.coeff_add, hp, nsmul_eq_mul, hq, smul_add] + simp only [map_add, mul_add, AddMonoidAlgebra.coeff_add, Finsupp.add_apply, hp, + nsmul_eq_mul, hq, smul_add] | monomial m c => rw [MvPolynomial.X_mul_pderiv_monomial, MvPolynomial.coeff_smul, MvPolynomial.coeff_monomial] @@ -2267,7 +2268,7 @@ theorem harmonicYoung_rowExponent_degree {r n : ℕ} have hrow := ((mem_harmonicYoungSubmodule lam (p : PolynomialSpace r n)).mp p.property).2.1 i - have hcoeff := congrArg (MvPolynomial.coeff d) hrow + have hcoeff := congrArg (·.coeff d) hrow rw [coeff_rowEuler, MvPolynomial.coeff_smul] at hcoeff have hmul : ((rowExponent d i).degree : ℝ) * @@ -4234,7 +4235,7 @@ theorem polarization_isHomogeneous_harmonicLift {r n m : ℕ} cases m with | zero => have hconstant : - p = MvPolynomial.C (MvPolynomial.coeff 0 p) := + p = MvPolynomial.C (p.coeff 0) := MvPolynomial.totalDegree_eq_zero_iff_eq_C.mp ((MvPolynomial.totalDegree_zero_iff_isHomogeneous _).mpr hp) rw [hconstant] @@ -4535,7 +4536,7 @@ theorem mem_youngMultihomogeneousSubmodule_iff_rowEuler have hdegree : ∀ i : Fin (r + 1), (rowExponent d i).degree = lam i := by intro i - have heuler := congrArg (MvPolynomial.coeff d) (hp i) + have heuler := congrArg (·.coeff d) (hp i) rw [coeff_rowEuler, MvPolynomial.coeff_smul] at heuler have hmul : ((rowExponent d i).degree : ℝ) * p.coeff d = @@ -4700,7 +4701,7 @@ theorem youngMultihomogeneous_pderiv_eq_zero_of_rowDegree_zero have hcoordinate := congrArg (fun e : Fin n →₀ ℕ => e k) hrow simp only [rowExponent_apply, Finsupp.coe_add, Pi.add_apply, Finsupp.single_eq_same, Finsupp.coe_zero, Pi.zero_apply, Nat.add_eq_zero_iff, one_ne_zero, and_false] at hcoordinate - simp only [hcoeff, zero_mul, MvPolynomial.coeff_zero] + simp only [hcoeff, zero_mul, AddMonoidAlgebra.coeff_zero, Finsupp.coe_zero, Pi.zero_apply] theorem youngMultihomogeneous_polarization_eq_zero_of_rowDegree_zero {r n : ℕ} (lam : Fin (r + 1) → ℕ) @@ -4861,14 +4862,16 @@ theorem polynomialRealPart_ne_zero_or_polynomialImaginaryPart_ne_zero · right intro him have hi : (p.coeff d).im = 0 := by - simpa only [coeff_polynomialImaginaryPart, MvPolynomial.coeff_zero] using + simpa only [coeff_polynomialImaginaryPart, AddMonoidAlgebra.coeff_zero, Finsupp.coe_zero, + Pi.zero_apply] using congrArg (fun q : MvPolynomial σ ℝ => q.coeff d) him apply hd apply Complex.ext <;> simp [hre, hi] · left intro hreal exact hre (by - simpa only [coeff_polynomialRealPart, MvPolynomial.coeff_zero] using + simpa only [coeff_polynomialRealPart, AddMonoidAlgebra.coeff_zero, Finsupp.coe_zero, + Pi.zero_apply] using congrArg (fun q : MvPolynomial σ ℝ => q.coeff d) hreal) theorem polynomialRealPart_pderiv {σ : Type*} (i : σ) @@ -8385,8 +8388,8 @@ theorem polynomialInner_youngGramRadialIdeal_eq_zero_of_traceFree obtain ⟨⟨i, j⟩, rfl⟩ := hg intro a rw [mul_comm a, polynomialInner_rowPairing_trace i j a p, hp i j] - simp only [SpherePacking.Fischer.polynomialInner, MvPolynomial.coeff_zero, mul_zero, - Finsupp.sum_fun_zero] + simp only [SpherePacking.Fischer.polynomialInner, AddMonoidAlgebra.coeff_zero, + Finsupp.coe_zero, Pi.zero_apply, mul_zero, Finsupp.sum_fun_zero] | zero => intro a simp only [SpherePacking.Fischer.polynomialInner, mul_zero, AddMonoidAlgebra.coeff_zero, diff --git a/LeanPool/MetricCodes/Rigidity.lean b/LeanPool/MetricCodes/Rigidity.lean index ae1c35af8c..7c52518e11 100644 --- a/LeanPool/MetricCodes/Rigidity.lean +++ b/LeanPool/MetricCodes/Rigidity.lean @@ -3485,7 +3485,7 @@ theorem sourceMatrixTranspose_columnRoot {m : ℕ} @[simp] theorem sourceExponentTranspose_apply {m : ℕ} (d : Fin m × Fin m →₀ ℕ) (i j : Fin m) : sourceExponentTranspose d (i, j) = d (j, i) := by - have h := Finsupp.mapDomain_apply + have h := Finsupp.mapDomain_apply_of_injective (Equiv.prodComm (Fin m) (Fin m)).injective d (j, i) simpa only [sourceExponentTranspose, Equiv.coe_prodComm, Equiv.prodComm_apply, Prod.swap_prod_mk] using h @@ -3728,9 +3728,9 @@ theorem columnWeightComponent_ne_zero_of_coeff_ne_zero {m : ℕ} columnWeightComponent (fun j : Fin m => sourceColumnDegree d j) p ≠ 0 := by intro hzero - have hcoeff := congrArg (MvPolynomial.coeff d) hzero + have hcoeff := congrArg (·.coeff d) hzero exact hd (by simpa only [coeff_columnWeightComponent, ↓reduceIte, - MvPolynomial.coeff_zero] using hcoeff) + AddMonoidAlgebra.coeff_zero, Finsupp.zero_apply] using hcoeff) end ArbitraryRankColumnWeightProjection @@ -4020,7 +4020,7 @@ theorem columnWeightComponent_columnHighest intro d rw [coeff_sourceColumnRoot_columnWeightComponent ν p i j (ne_of_lt hij) d, hhighest] - simp only [MvPolynomial.coeff_zero, ite_self] + simp only [AddMonoidAlgebra.coeff_zero, Finsupp.zero_apply, ite_self] theorem columnWeightComponent_columnHighest_all {m : ℕ} (ν : Fin m → ℕ) (p : SourceMatrix m) diff --git a/LeanPool/MetricCodes/RootComplex.lean b/LeanPool/MetricCodes/RootComplex.lean index daf25b3a48..315b27e422 100644 --- a/LeanPool/MetricCodes/RootComplex.lean +++ b/LeanPool/MetricCodes/RootComplex.lean @@ -406,13 +406,16 @@ theorem isotropicOrthogonalPositiveRoot_strict_even (variableIndex a (evenCoordinate h p)) (variableIndex a (evenCoordinate h q)) (2 : ℂ) _ d hd simpa only [isotropicCoordinateCoheight_even, Fin.val_fin_lt] using hpq - · simp only [MvPolynomial.coeff_zero, ne_eq, not_true_eq_false] at hd + · simp only [AddMonoidAlgebra.coeff_zero, Finsupp.zero_apply, ne_eq, + not_true_eq_false] at hd | sum p q hpq => rw [conjugatedSumRoot_X_even h p q hpq a j] at hd - simp only [MvPolynomial.coeff_zero, ne_eq, not_true_eq_false] at hd + simp only [AddMonoidAlgebra.coeff_zero, Finsupp.zero_apply, ne_eq, + not_true_eq_false] at hd | short p t ht => rw [conjugatedShortRoot_X_even h p t ht a j] at hd - simp only [MvPolynomial.coeff_zero, ne_eq, not_true_eq_false] at hd + simp only [AddMonoidAlgebra.coeff_zero, Finsupp.zero_apply, ne_eq, + not_true_eq_false] at hd theorem isotropicOrthogonalPositiveRoot_strict_odd {r n : ℕ} (h : 2 * (r + 1) ≤ n) @@ -435,7 +438,8 @@ theorem isotropicOrthogonalPositiveRoot_strict_odd have hp' := p.isLt have hq' := q.isLt omega - · simp only [MvPolynomial.coeff_zero, ne_eq, not_true_eq_false] at hd + · simp only [AddMonoidAlgebra.coeff_zero, Finsupp.zero_apply, ne_eq, + not_true_eq_false] at hd | sum p q hpq => rw [conjugatedSumRoot_X_odd h p q hpq a j] at hd by_cases hq : q = j @@ -474,8 +478,8 @@ theorem isotropicOrthogonalPositiveRoot_strict_odd have hp' := p.isLt have hq' := q.isLt omega - · simp only [hq, ↓reduceIte, hp, sub_self, MvPolynomial.coeff_zero, ne_eq, - not_true_eq_false] at hd + · simp only [hq, ↓reduceIte, hp, sub_self, AddMonoidAlgebra.coeff_zero, + Finsupp.zero_apply, ne_eq, not_true_eq_false] at hd | short p t ht => rw [conjugatedShortRoot_X_odd h p t ht a j] at hd split_ifs at hd with hp @@ -488,7 +492,8 @@ theorem isotropicOrthogonalPositiveRoot_strict_odd isotropicCoordinateCoheight_odd] have hp' := p.isLt omega - · simp only [MvPolynomial.coeff_zero, ne_eq, not_true_eq_false] at hd + · simp only [AddMonoidAlgebra.coeff_zero, Finsupp.zero_apply, ne_eq, + not_true_eq_false] at hd theorem isotropicOrthogonalPositiveRoot_strict_unused {r n : ℕ} (h : 2 * (r + 1) ≤ n) @@ -503,10 +508,12 @@ theorem isotropicOrthogonalPositiveRoot_strict_unused cases α with | difference p q hpq => rw [conjugatedDifferenceRoot_X_unused h p q hpq a t ht] at hd - simp only [MvPolynomial.coeff_zero, ne_eq, not_true_eq_false] at hd + simp only [AddMonoidAlgebra.coeff_zero, Finsupp.zero_apply, ne_eq, + not_true_eq_false] at hd | sum p q hpq => rw [conjugatedSumRoot_X_unused h p q hpq a t ht] at hd - simp only [MvPolynomial.coeff_zero, ne_eq, not_true_eq_false] at hd + simp only [AddMonoidAlgebra.coeff_zero, Finsupp.zero_apply, ne_eq, + not_true_eq_false] at hd | short p u hu => rw [conjugatedShortRoot_X_unused h p u t hu ht a] at hd split_ifs at hd with hut @@ -521,7 +528,8 @@ theorem isotropicOrthogonalPositiveRoot_strict_unused rw [isotropicCoordinateCoheight_even, isotropicCoordinateCoheight_unused a t ht] exact p.isLt - · simp only [MvPolynomial.coeff_zero, ne_eq, not_true_eq_false] at hd + · simp only [AddMonoidAlgebra.coeff_zero, Finsupp.zero_apply, ne_eq, + not_true_eq_false] at hd theorem isotropicOrthogonalPositiveRoot_strict {r n : ℕ} (h : 2 * (r + 1) ≤ n) @@ -767,7 +775,7 @@ theorem coeff_X_mul_pderiv {ι : Type*} (p : MvPolynomial ι ℂ) classical induction p using MvPolynomial.induction_on' with | add p q hp hq => - simp only [map_add, mul_add, MvPolynomial.coeff_add, hp, hq] + simp only [map_add, mul_add, AddMonoidAlgebra.coeff_add, Finsupp.add_apply, hp, hq] | monomial m c => rw [MvPolynomial.X_mul_pderiv_monomial] rw [← Nat.cast_smul_eq_nsmul ℂ] @@ -973,9 +981,9 @@ theorem isotropicCoordinateDefect_eq_zero_of_mem_vars_of_maximalCartan (MvPolynomial.mem_vars_iff_mem_support v).mp hv have hzero := isotropicCoordinateDefectDerivation_eq_zero_of_maximalCartan h f d hfhom hcartan - have hcoeff := congrArg (MvPolynomial.coeff m) hzero + have hcoeff := congrArg (·.coeff m) hzero rw [naturalDiagonalDerivation_coeff] at hcoeff - simp only [MvPolynomial.coeff_zero] at hcoeff + simp only [AddMonoidAlgebra.coeff_zero] at hcoeff have hmcoeff : g.coeff m ≠ 0 := MvPolynomial.mem_support_iff.mp hm have hcast : @@ -2561,8 +2569,7 @@ theorem youngWeightedComponent_gram_mul apply Finset.sum_congr rfl intro ab hab by_cases hg : - MvPolynomial.coeff ab.1 - (rowPairingPolynomial (n := n) i j) = 0 + (rowPairingPolynomial (n := n) i j).coeff ab.1 = 0 · simp only [hg, zero_mul] · have hga := rowPairingPolynomial_isWeightedHomogeneous i j hg have hab' := Finset.HasAntidiagonal.mem_antidiagonal.mp hab @@ -2583,8 +2590,7 @@ theorem youngWeightedComponent_gram_mul apply Finset.sum_eq_zero intro ab hab by_cases hg : - MvPolynomial.coeff ab.1 - (rowPairingPolynomial (n := n) i j) = 0 + (rowPairingPolynomial (n := n) i j).coeff ab.1 = 0 · simp only [hg, zero_mul] · have hga := rowPairingPolynomial_isWeightedHomogeneous i j hg have hab' := Finset.HasAntidiagonal.mem_antidiagonal.mp hab @@ -2849,14 +2855,13 @@ theorem youngWeightedComponent_gram_mul_eq_zero_of_overweight classical ext d rw [MvPolynomial.coeff_weightedHomogeneousComponent, - MvPolynomial.coeff_zero] + AddMonoidAlgebra.coeff_zero, Finsupp.zero_apply] by_cases hd : Finsupp.weight (youngVariableRowWeight r n) d = lam · rw [ite_eq_left hd, MvPolynomial.coeff_mul] apply Finset.sum_eq_zero intro bc hbc by_cases hg : - MvPolynomial.coeff bc.1 - (rowPairingPolynomial (n := n) i j) = 0 + (rowPairingPolynomial (n := n) i j).coeff bc.1 = 0 · simp only [hg, zero_mul] · have hga := rowPairingPolynomial_isWeightedHomogeneous i j hg have hbc' := Finset.HasAntidiagonal.mem_antidiagonal.mp hbc @@ -4936,10 +4941,9 @@ theorem rootAction_apply_X {r n : ℕ} theorem rootAction_X_coefficient {r n : ℕ} (x : RootVector r) (α : PositiveRoot r) (k : Fin n) : - MvPolynomial.coeff - (Finsupp.single (variableIndex α.val.2 k) 1) - (rootAction n x - (MvPolynomial.X (variableIndex α.val.1 k))) = x α := by + (rootAction n x + (MvPolynomial.X (variableIndex α.val.1 k))).coeff + (Finsupp.single (variableIndex α.val.2 k) 1) = x α := by classical rw [rootAction_apply_X] simp_rw [MvPolynomial.coeff_sum, MvPolynomial.coeff_smul] @@ -4964,7 +4968,8 @@ theorem rootAction_X_coefficient {r n : ℕ} intro h exact hvar (Finsupp.single_left_injective (by norm_num : (1 : ℕ) ≠ 0) h) simp only [hsource, ↓reduceIte, MvPolynomial.coeff_X, hsingle, smul_eq_mul, mul_zero] - · simp only [hsource, ↓reduceIte, MvPolynomial.coeff_zero, smul_eq_mul, mul_zero] + · simp only [hsource, ↓reduceIte, AddMonoidAlgebra.coeff_zero, Finsupp.zero_apply, + smul_eq_mul, mul_zero] · exact fun h => (h hα).elim · have hx : x α = 0 := Finsupp.notMem_support_iff.mp hα rw [hx] @@ -4989,7 +4994,8 @@ theorem rootAction_X_coefficient {r n : ℕ} intro h exact hvar (Finsupp.single_left_injective (by norm_num : (1 : ℕ) ≠ 0) h) simp only [hsource, ↓reduceIte, MvPolynomial.coeff_X, hsingle, smul_eq_mul, mul_zero] - · simp only [hsource, ↓reduceIte, MvPolynomial.coeff_zero, smul_eq_mul, mul_zero] + · simp only [hsource, ↓reduceIte, AddMonoidAlgebra.coeff_zero, Finsupp.zero_apply, + smul_eq_mul, mul_zero] theorem rootAction_injective {r n : ℕ} (hn : 0 < n) : Function.Injective (rootAction (r := r) n) := by @@ -4998,8 +5004,7 @@ theorem rootAction_injective {r n : ℕ} let k : Fin n := ⟨0, hn⟩ have hcoord := LinearMap.congr_fun hxy (MvPolynomial.X (variableIndex α.val.1 k)) - have hcoeff := congrArg - (MvPolynomial.coeff + have hcoeff := congrArg (·.coeff (Finsupp.single (variableIndex α.val.2 k) 1)) hcoord simpa only [rootAction_X_coefficient] using hcoeff diff --git a/LeanPool/MetricCodes/Weyl.lean b/LeanPool/MetricCodes/Weyl.lean index fc92434d90..efe25ad524 100644 --- a/LeanPool/MetricCodes/Weyl.lean +++ b/LeanPool/MetricCodes/Weyl.lean @@ -782,10 +782,10 @@ theorem weightedExteriorActionDifferential_fischer_adjoint exact (actionFischerCore_sum_right_metriccodes2_209634ef (jointHarmonicWeightFischerCore n (rootWedgeWeight lam S)) (p S) _).symm - _ = _ := - (actionFischerCore_sum_right_metriccodes2_209634ef + _ = _ := by + rw [actionFischerCore_sum_right_metriccodes2_209634ef (jointHarmonicWeightFischerCore n - (rootWedgeWeight lam S)) (p S) _).symm + (rootWedgeWeight lam S)) (p S)] end @@ -1001,16 +1001,20 @@ theorem rootDegreeZeroPositiveCochain_finrank_ker_add_finrank_ce_range (weightedExteriorActionCoboundary n lam 0) (weightedExteriorActionDifferential n lam 0)).mpr intro x y - change - (rootJointHarmonicChainFischerCore n lam (0 + 1)).inner - (weightedExteriorActionCoboundary n lam 0 x) y = - (rootJointHarmonicChainFischerCore n lam 0).inner x - (weightedExteriorActionDifferential n lam 0 y) - rw [degreeZeroFischerCore_inner_comm_metriccodes2_89cbd172 - (rootJointHarmonicChainFischerCore n lam (0 + 1)), + have hbridge₁ : ∀ u v : RootJointHarmonicChain n lam (0 + 1), + (inner ℝ u v : ℝ) = + (rootJointHarmonicChainFischerCore n lam (0 + 1)).inner u v := + fun _ _ => rfl + have hbridge₀ : ∀ u v : RootJointHarmonicChain n lam 0, + (inner ℝ u v : ℝ) = + (rootJointHarmonicChainFischerCore n lam 0).inner u v := + fun _ _ => rfl + rw [hbridge₁, hbridge₀, + degreeZeroFischerCore_inner_comm_metriccodes2_89cbd172 + (rootJointHarmonicChainFischerCore n lam (0 + 1)), degreeZeroFischerCore_inner_comm_metriccodes2_89cbd172 - (rootJointHarmonicChainFischerCore n lam 0)] - exact (weightedExteriorActionDifferential_fischer_adjoint lam y x).symm + (rootJointHarmonicChainFischerCore n lam 0), + weightedExteriorActionDifferential_fischer_adjoint lam y x] have hrank : Module.finrank ℝ (LinearMap.range (weightedExteriorActionCoboundary n lam 0)) = @@ -1125,7 +1129,7 @@ private def ambientBinomialPolynomial {r : ℕ} theorem coeff_ambientBinomialPolynomial_of_le {r n B : ℕ} (m : Fin (r + 1) →₀ ℕ) (hm : ∀ i, m i ≤ B) : - MvPolynomial.coeff m (ambientBinomialPolynomial (r := r) n B) = + (ambientBinomialPolynomial (r := r) n B).coeff m = ∏ i : Fin (r + 1), (((n + m i - 1).choose (m i) : ℕ) : ℤ) := by classical @@ -1174,7 +1178,7 @@ theorem gramPairMonomial {r : ℕ} (z : UpperGramPair r) : (MvPolynomial.X z.val.1 * MvPolynomial.X z.val.2 : MvPolynomial (Fin (r + 1)) ℤ) = MvPolynomial.monomial (gramPairExponent z) 1 := by - simp only [MvPolynomial.X, MvPolynomial.monomial_mul, mul_one, gramPairExponent] + simp only [MvPolynomial.X, MvPolynomial.monomial_mul_monomial, mul_one, gramPairExponent] theorem gramFamilyMonomial {r : ℕ} (s : Finset (UpperGramPair r)) : @@ -1188,8 +1192,8 @@ theorem gramFamilyMonomial {r : ℕ} MvPolynomial.monomial_zero', eq_intCast, Int.cast_one] | @insert z s hz ih => rw [Finset.prod_insert hz, gramPairMonomial, ih] - simp only [gramFamilyExponent, MvPolynomial.monomial_mul, mul_one, hz, not_false_eq_true, - Finset.sum_insert] + simp only [gramFamilyExponent, MvPolynomial.monomial_mul_monomial, mul_one, hz, + not_false_eq_true, Finset.sum_insert] theorem gramEquationPolynomial_eq_sum (r : ℕ) : gramEquationPolynomial r = @@ -1212,9 +1216,7 @@ theorem gramEquationPolynomial_eq_sum (r : ℕ) : theorem coeff_ambientBinomialPolynomial_mul_gramEquationPolynomial {r n B : ℕ} (m : Fin (r + 1) →₀ ℕ) (hm : ∀ i, m i ≤ B) : - MvPolynomial.coeff m - (ambientBinomialPolynomial (r := r) n B * - gramEquationPolynomial r) = + (ambientBinomialPolynomial (r := r) n B * gramEquationPolynomial r).coeff m = fullGramKoszulCoefficient n (fun i => m i) := by classical rw [gramEquationPolynomial_eq_sum, Finset.mul_sum, @@ -1338,9 +1340,9 @@ theorem weylTargetExponent_sub_reversePermutationExponent_apply theorem coeff_ambient_mul_gram_mul_reversedWeylPolynomial {r n B : ℕ} (lam : Fin (r + 1) → ℕ) (hB : ∀ i, weylTargetExponent lam i ≤ B) : - MvPolynomial.coeff (weylTargetExponent lam) - ((ambientBinomialPolynomial (r := r) n B * - gramEquationPolynomial r) * reversedWeylPolynomial r) = + ((ambientBinomialPolynomial (r := r) n B * + gramEquationPolynomial r) * reversedWeylPolynomial r).coeff + (weylTargetExponent lam) = alternatingGramKoszulCoefficient n lam := by classical rw [reversedWeylPolynomial_eq_sum, Finset.mul_sum, @@ -1391,9 +1393,7 @@ open MetricCodes.Spherical.HigherHarmonicYoung.ArbitraryRankMixedTraceRegularity theorem coeff_ambientBinomialPolynomial_mul_monomial {r n B : ℕ} (m s : Fin (r + 1) →₀ ℕ) (hm : ∀ i, m i ≤ B) : - MvPolynomial.coeff m - (ambientBinomialPolynomial (r := r) n B * - MvPolynomial.monomial s (1 : ℤ)) = + (ambientBinomialPolynomial (r := r) n B * MvPolynomial.monomial s (1 : ℤ)).coeff m = ∏ i : Fin (r + 1), orthogonalCompleteSymmetricCoefficient n ((m i : ℤ) - (s i : ℤ)) := by @@ -1446,11 +1446,10 @@ theorem coeff_ambientBinomialPolynomial_mul_axisDifferenceProduct {r n B : ℕ} (m : Fin (r + 1) →₀ ℕ) (hm : ∀ i, m i ≤ B) (a b : Fin (r + 1) → ℕ) : - MvPolynomial.coeff m - (ambientBinomialPolynomial (r := r) n B * - ∏ i : Fin (r + 1), - ((MvPolynomial.X i : MvPolynomial (Fin (r + 1)) ℤ) ^ a i - - (MvPolynomial.X i : MvPolynomial (Fin (r + 1)) ℤ) ^ b i)) = + (ambientBinomialPolynomial (r := r) n B * + ∏ i : Fin (r + 1), + ((MvPolynomial.X i : MvPolynomial (Fin (r + 1)) ℤ) ^ a i - + (MvPolynomial.X i : MvPolynomial (Fin (r + 1)) ℤ) ^ b i)).coeff m = ∏ i : Fin (r + 1), (orthogonalCompleteSymmetricCoefficient n ((m i : ℤ) - (a i : ℤ)) - @@ -1472,7 +1471,7 @@ theorem coeff_ambientBinomialPolynomial_mul_axisDifferenceProduct (Finsupp.indicator (Finset.univ \ t) (fun i _ => a i) + Finsupp.indicator t (fun i _ => b i)) (1 : ℤ) := by rw [MvPolynomial.prod_X_pow, MvPolynomial.prod_X_pow, - MvPolynomial.monomial_mul, mul_one] + MvPolynomial.monomial_mul_monomial, mul_one] have hsign : (-1 : MvPolynomial (Fin (r + 1)) ℤ) ^ t.card = MvPolynomial.C ((-1 : ℤ) ^ t.card) := by simp only [Int.reduceNeg, eq_intCast, Int.cast_pow, @@ -1500,11 +1499,10 @@ theorem coeff_ambientBinomialPolynomial_mul_det_separable {r n B : ℕ} (m : Fin (r + 1) →₀ ℕ) (a b : Fin (r + 1) → Fin (r + 1) → ℕ) (hm : ∀ i, m i ≤ B) : - MvPolynomial.coeff m - (ambientBinomialPolynomial (r := r) n B * - Matrix.det (Matrix.of fun i j : Fin (r + 1) => - (MvPolynomial.X i : MvPolynomial (Fin (r + 1)) ℤ) ^ a i j - - (MvPolynomial.X i : MvPolynomial (Fin (r + 1)) ℤ) ^ b i j)) = + (ambientBinomialPolynomial (r := r) n B * + Matrix.det (Matrix.of fun i j : Fin (r + 1) => + (MvPolynomial.X i : MvPolynomial (Fin (r + 1)) ℤ) ^ a i j - + (MvPolynomial.X i : MvPolynomial (Fin (r + 1)) ℤ) ^ b i j)).coeff m = Matrix.det (Matrix.of fun i j : Fin (r + 1) => orthogonalCompleteSymmetricCoefficient n ((m i : ℤ) - (a i j : ℤ)) - @@ -1517,14 +1515,13 @@ theorem coeff_ambientBinomialPolynomial_mul_det_separable apply Finset.sum_congr rfl intro σ _ change - MvPolynomial.coeff m - (ambientBinomialPolynomial (r := r) n B * + (ambientBinomialPolynomial (r := r) n B * (MvPolynomial.C (Equiv.Perm.sign σ : ℤ) * ∏ i : Fin (r + 1), ((MvPolynomial.X i : MvPolynomial (Fin (r + 1)) ℤ) ^ a i (σ i) - (MvPolynomial.X i : MvPolynomial (Fin (r + 1)) ℤ) ^ - b i (σ i)))) = + b i (σ i)))).coeff m = (Equiv.Perm.sign σ : ℤ) * ∏ i : Fin (r + 1), (orthogonalCompleteSymmetricCoefficient n @@ -1539,13 +1536,12 @@ theorem coeff_ambientBinomialPolynomial_mul_det_separable theorem coeff_ambientBinomialPolynomial_mul_orthogonalDenominator {r n B : ℕ} (lam : Fin (r + 1) → ℕ) (hB : ∀ i, weylTargetExponent lam i ≤ B) : - MvPolynomial.coeff (weylTargetExponent lam) - (ambientBinomialPolynomial (r := r) n B * - Matrix.det (Matrix.of fun i j : Fin (r + 1) => + (ambientBinomialPolynomial (r := r) n B * + Matrix.det (Matrix.of fun i j : Fin (r + 1) => + (MvPolynomial.X i : MvPolynomial (Fin (r + 1)) ℤ) ^ + (r - j.val) - (MvPolynomial.X i : MvPolynomial (Fin (r + 1)) ℤ) ^ - (r - j.val) - - (MvPolynomial.X i : MvPolynomial (Fin (r + 1)) ℤ) ^ - (r + j.val + 2))) = + (r + j.val + 2))).coeff (weylTargetExponent lam) = orthogonalJacobiTrudiDimension n lam := by rw [coeff_ambientBinomialPolynomial_mul_det_separable (weylTargetExponent lam) @@ -1622,19 +1618,18 @@ theorem alternatingGramKoszulCoefficient_eq_orthogonalJacobiTrudiDimension (MvPolynomial.X i : MvPolynomial (Fin (r + 1)) ℤ)) calc alternatingGramKoszulCoefficient n lam = - MvPolynomial.coeff (weylTargetExponent lam) - ((ambientBinomialPolynomial (r := r) n B * - gramEquationPolynomial r) * reversedWeylPolynomial r) := + ((ambientBinomialPolynomial (r := r) n B * + gramEquationPolynomial r) * reversedWeylPolynomial r).coeff + (weylTargetExponent lam) := (coeff_ambient_mul_gram_mul_reversedWeylPolynomial lam hB).symm - _ = MvPolynomial.coeff (weylTargetExponent lam) - (ambientBinomialPolynomial (r := r) n B * - Matrix.det (fun i j : Fin (r + 1) => + _ = (ambientBinomialPolynomial (r := r) n B * + Matrix.det (fun i j : Fin (r + 1) => + (MvPolynomial.X i : MvPolynomial (Fin (r + 1)) ℤ) ^ + (r - j.val) - (MvPolynomial.X i : MvPolynomial (Fin (r + 1)) ℤ) ^ - (r - j.val) - - (MvPolynomial.X i : MvPolynomial (Fin (r + 1)) ℤ) ^ - (r + j.val + 2))) := by + (r + j.val + 2))).coeff (weylTargetExponent lam) := by rw [hdenominator] - congr 1 + congr 2 ring _ = orthogonalJacobiTrudiDimension n lam := coeff_ambientBinomialPolynomial_mul_orthogonalDenominator lam hB @@ -6768,8 +6763,8 @@ theorem weightedRootBracketBoundary_fischer_adjoint weightedRootBracketEdge n lam S T h (p S)) (q T) := by apply Finset.sum_congr rfl intro T _ - exact bracketFischerCore_sum_left_metriccodes2_9c41043c - (jointHarmonicWeightFischerCore n (rootWedgeWeight lam T)) _ _ + rw [bracketFischerCore_sum_left_metriccodes2_9c41043c + (jointHarmonicWeightFischerCore n (rootWedgeWeight lam T))] _ = ∑ S : AdmissibleRootWedge lam (k + 1), ∑ T : AdmissibleRootWedge lam k, (jointHarmonicWeightFischerCore n (rootWedgeWeight lam T)).inner @@ -6829,9 +6824,8 @@ theorem weightedRootBracketBoundary_fischer_adjoint _ = _ := by apply Finset.sum_congr rfl intro S _ - symm - exact bracketFischerCore_sum_right_metriccodes2_9c41043c - (jointHarmonicWeightFischerCore n (rootWedgeWeight lam S)) _ _ + rw [bracketFischerCore_sum_right_metriccodes2_9c41043c + (jointHarmonicWeightFischerCore n (rootWedgeWeight lam S)) (p S)] end diff --git a/LeanPool/MisereGames/Form.lean b/LeanPool/MisereGames/Form.lean index adec7ce2af..b193c9ab3a 100644 --- a/LeanPool/MisereGames/Form.lean +++ b/LeanPool/MisereGames/Form.lean @@ -101,9 +101,9 @@ instance (x : G) : Small.{u + 1} {y // IsOption y x} := theorem isOption_wf : WellFounded (@IsOption G _) := g_moves.isOption'_wf -instance : IsWellFounded _ (@IsOption G _) := ⟨isOption_wf⟩ +instance : WellFounded (@IsOption G _) := isOption_wf -theorem IsOption.irrefl (x : G) : ¬ IsOption x x := _root_.irrefl x +theorem IsOption.irrefl (x : G) : ¬ IsOption x x := fun h ↦ WellFounded.asymmetric x x h h theorem self_notMem_moves (p : Player) (x : G) : x ∉ moves p x := fun hx ↦ IsOption.irrefl x (.of_mem_moves hx) @@ -134,8 +134,8 @@ instance (x : G) : Small.{u + 1} {y // Subposition y x} := instance : IsTrans _ (@Subposition G _) := inferInstanceAs (IsTrans _ (Relation.TransGen _)) instance : - IsWellFounded _ (@Subposition G _) := inferInstanceAs (IsWellFounded _ (Relation.TransGen _)) -instance : WellFoundedRelation G := ⟨Subposition, instIsWellFoundedSubposition.wf⟩ + WellFounded (@Subposition G _) := inferInstanceAs (WellFounded (Relation.TransGen _)) +instance : WellFoundedRelation G := ⟨Subposition, inferInstance⟩ /-- Solve routine well-foundedness goals generated by recursive form definitions. -/ macro (name := formWf) "form_wf" : tactic => diff --git a/LeanPool/MisereGames/GameGraph.lean b/LeanPool/MisereGames/GameGraph.lean index 3134264da0..a71ff1dc1d 100644 --- a/LeanPool/MisereGames/GameGraph.lean +++ b/LeanPool/MisereGames/GameGraph.lean @@ -69,10 +69,10 @@ literature, such a game is called *loopfree* (see [Siegel, Definition 4.1 on p. 34][siegel:CombinatorialGameTheory:2013]). -/ protected class IsWellFounded (c : GameGraph α) where - wf (c) : IsWellFounded α fun a b => ∃ p, a ∈ c.moves p b + wf (c) : WellFounded fun a b => ∃ p, a ∈ c.moves p b omit Hl Hr in -theorem IsWellFounded.of_subrelation (r : α → α → Prop) [IsWellFounded α r] +theorem IsWellFounded.of_subrelation (r : α → α → Prop) [WellFounded r] (hr : ∀ a b p, a ∈ g.moves p b → r a b) : g.IsWellFounded := by refine ⟨Subrelation.isWellFounded (r := r) ?_⟩ simpa only [Subrelation, forall_exists_index] @@ -87,13 +87,13 @@ Left and Right sets. def moveRecOn {motive : α → Sort*} (x) (ind : Π x : α, (∀ p, Π y ∈ g.moves p x, motive y) → motive x) : motive x := - (IsWellFounded.wf g).fix _ (fun x IH ↦ ind x fun _ _ h ↦ IH _ ⟨_, h⟩) x + (IsWellFounded.wf g).fix (fun x IH ↦ ind x fun _ _ h ↦ IH _ ⟨_, h⟩) x omit Hl Hr in theorem moveRecOn_eq {motive : α → Sort*} (x) (ind : Π x : α, (∀ p, Π y ∈ g.moves p x, motive y) → motive x) : g.moveRecOn x ind = ind x fun _ y _ ↦ g.moveRecOn y ind := by - rw [moveRecOn, IsWellFounded.fix_eq] + rw [moveRecOn, WellFounded.fix_eq] rfl variable {G : Type (u + 1)} [Form G] diff --git a/LeanPool/MisereGames/Mathlib/NatOrdinal.lean b/LeanPool/MisereGames/Mathlib/NatOrdinal.lean index df048f4c7d..4e186fce7f 100644 --- a/LeanPool/MisereGames/Mathlib/NatOrdinal.lean +++ b/LeanPool/MisereGames/Mathlib/NatOrdinal.lean @@ -113,7 +113,7 @@ theorem lt_wf : @WellFounded NatOrdinal (· < ·) := wellFounded_iff_wellFounded_subrel.mpr (·.induction_on fun ⟨_, _, wo⟩ ↦ RelHomClass.wellFounded (enum _) wo.wf) -instance : WellFoundedLT NatOrdinal := ⟨lt_wf⟩ +instance : WellFoundedLT NatOrdinal := lt_wf instance wellFoundedRelation : WellFoundedRelation NatOrdinal := ⟨(· < ·), lt_wf⟩ diff --git a/LeanPool/MisereGames/Ruleset/Hackenbush.lean b/LeanPool/MisereGames/Ruleset/Hackenbush.lean index 49ff88d518..4cff1e186f 100644 --- a/LeanPool/MisereGames/Ruleset/Hackenbush.lean +++ b/LeanPool/MisereGames/Ruleset/Hackenbush.lean @@ -754,7 +754,6 @@ theorem starPos_groundCount_right (l r : ℕ) : · tauto unfold groundCount rw [h_groundEdges_right, Finset.card_image_of_injOn] <;> norm_num [Function.Injective] - omega instance : GameForm.Strided (Ruleset.Forms (Hackenbush ℕ)) where mk_with_strides l r := by diff --git a/LeanPool/MisereGames/Ruleset/Strip.lean b/LeanPool/MisereGames/Ruleset/Strip.lean index b890066262..6d8993bb6c 100644 --- a/LeanPool/MisereGames/Ruleset/Strip.lean +++ b/LeanPool/MisereGames/Ruleset/Strip.lean @@ -457,7 +457,7 @@ theorem weight_lt_of_mem_move {p : Player} {s s' : R} instance : (graph R).IsWellFounded where wf := by - refine { wf := WellFounded.intro ?_ } + refine WellFounded.intro ?_ intro s induction n : weight s using Nat.strong_induction_on generalizing s with | h n ih => diff --git a/LeanPool/Monlib4/LinearAlgebra/Coalgebra/FiniteDimensional.lean b/LeanPool/Monlib4/LinearAlgebra/Coalgebra/FiniteDimensional.lean index 2ae630462d..ad6298821f 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Coalgebra/FiniteDimensional.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Coalgebra/FiniteDimensional.lean @@ -63,8 +63,7 @@ lemma TensorProduct.rid_adjoint {𝕜 E : Type*} [RCLike 𝕜] [NormedAddCommGro intro y simp only [LinearMap.adjoint_inner_left, LinearEquiv.coe_toLinearMap, TensorProduct.rid_symm_apply] - exact y.induction_on - (by simp only [inner_zero_right, map_zero]) + exact y.inductionOn (fun α z => by simp only [TensorProduct.rid_tmul, TensorProduct.inner_tmul, RCLike.inner_apply, starRingEnd_apply, star_one, inner_smul_right, mul_comm, mul_one]) diff --git a/LeanPool/Monlib4/LinearAlgebra/InvariantSubmodule.lean b/LeanPool/Monlib4/LinearAlgebra/InvariantSubmodule.lean index 755cc28bd6..5aff52946f 100644 --- a/LeanPool/Monlib4/LinearAlgebra/InvariantSubmodule.lean +++ b/LeanPool/Monlib4/LinearAlgebra/InvariantSubmodule.lean @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Monica Omar -/ -import Mathlib.Data.Complex.Basic +import Mathlib.Basic.Complex.Basic import Mathlib.LinearAlgebra.Projection import Mathlib.LinearAlgebra.TensorProduct.Basic import Mathlib.Topology.Algebra.StarSubalgebra diff --git a/LeanPool/Monlib4/LinearAlgebra/Ips/MinimalProj.lean b/LeanPool/Monlib4/LinearAlgebra/Ips/MinimalProj.lean index 0a8e54ec92..b0b56225ff 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Ips/MinimalProj.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Ips/MinimalProj.lean @@ -823,7 +823,7 @@ theorem ContinuousLinearMap.isOrthogonalProjection_iff' simp only [and_congr_right_iff] intro h have := List.TFAE.out (IsIdempotentElem.self_adjoint_is_positive_isOrthogonalProjection_tFAE - h) 0 1 + h) 1 2 rw [this, isOrthogonalProjection_iff] simp only [h, true_and] diff --git a/LeanPool/Monlib4/LinearAlgebra/Ips/Pos.lean b/LeanPool/Monlib4/LinearAlgebra/Ips/Pos.lean index 8bf186275e..00a317e2c9 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Ips/Pos.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Ips/Pos.lean @@ -249,8 +249,8 @@ theorem _root_.LinearMap.IsSymmetric.sqrtIsPositive' refine ⟨this, ?_⟩ intro x simp_rw [sqrt_apply _ hT, inner_sum, inner_smul_right] - apply Finset.sum_nonneg' - intro i + apply Finset.sum_nonneg + intro i _ simp_rw [← inner_conj_symm x _, ← OrthonormalBasis.repr_apply_apply, mul_conj, ← ofReal_pow, ← ofReal_mul, ofReal_nonneg] exact mul_nonneg (Real.sqrt_nonneg _) (sq_nonneg _) @@ -523,7 +523,7 @@ theorem LinearMap.isPositive'_iff_eq_sum_rankOne [FiniteDimensional 𝕜 E] inner_smul_right, inner_conj_symm, mul_comm, forall₂_true_iff, true_and, ← inner_conj_symm _ (u _), RCLike.conj_mul, ← RCLike.ofReal_pow, ← ofReal_sum, zero_le_real] - exact fun _ => Finset.sum_nonneg' (fun _ => sq_nonneg _) + exact fun _ => Finset.sum_nonneg (fun _ _ => sq_nonneg _) theorem LinearMap.IsSymmetric.rePowIsPositive'OfIsPositive' {𝕜 E : Type _} [RCLike 𝕜] [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] [FiniteDimensional 𝕜 E] diff --git a/LeanPool/Monlib4/LinearAlgebra/Ips/TensorHilbert.lean b/LeanPool/Monlib4/LinearAlgebra/Ips/TensorHilbert.lean index c5d9ef703f..4c048c9d3f 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Ips/TensorHilbert.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Ips/TensorHilbert.lean @@ -179,10 +179,8 @@ theorem inner_ext_fourfold_iff' (x y : (E ⊗[𝕜] F) ⊗[𝕜] (G ⊗[𝕜] H) rw [TensorProduct.ext_iff_inner_right] intro p q induction p with - | zero => simp | tmul a b => induction q with - | zero => simp | tmul c d => exact h a b c d | add q₁ q₂ hq₁ hq₂ => simp [TensorProduct.tmul_add, inner_add_right, hq₁, hq₂] | add p₁ p₂ hp₁ hp₂ => simp [TensorProduct.add_tmul, inner_add_right, hp₁, hp₂] diff --git a/LeanPool/Monlib4/LinearAlgebra/KroneckerToTensor.lean b/LeanPool/Monlib4/LinearAlgebra/KroneckerToTensor.lean index 838504a375..ec62097234 100644 --- a/LeanPool/Monlib4/LinearAlgebra/KroneckerToTensor.lean +++ b/LeanPool/Monlib4/LinearAlgebra/KroneckerToTensor.lean @@ -107,10 +107,8 @@ theorem TensorProduct.matrix_eq_sum_std_basis (x : Matrix m m R ⊗[R] Matrix n theorem TensorProduct.toKronecker_hMul (x y : Matrix m m R ⊗[R] Matrix n n R) : toKronecker (x * y) = toKronecker x * toKronecker y := -x.induction_on - (by simp only [zero_mul, map_zero]) - (y.induction_on - (by simp only [mul_zero, map_zero, implies_true]) +x.inductionOn + (y.inductionOn (fun _ _ _ _ => by simp only [Algebra.TensorProduct.tmul_mul_tmul, toKronecker_apply, Matrix.mul_kronecker_mul]) (fun _ _ h1 h2 _ _ => by simp only [_root_.map_add, h1, h2, mul_add])) diff --git a/LeanPool/Monlib4/LinearAlgebra/LmulRmul.lean b/LeanPool/Monlib4/LinearAlgebra/LmulRmul.lean index c8db647653..7265c36cf6 100644 --- a/LeanPool/Monlib4/LinearAlgebra/LmulRmul.lean +++ b/LeanPool/Monlib4/LinearAlgebra/LmulRmul.lean @@ -184,7 +184,7 @@ theorem LinearMap.mulLeft_eq_one_or_zero_iff_mulRight_tfae {H₁ : Type _} [Semi theorem LinearMap.mulLeft_eq_one_or_zero_iff_mulRight {H₁ : Type _} [Semiring H₁] [Algebra R H₁] (x : H₁) (p : Prop) [Decidable p] : LinearMap.mulLeft R x = ite p 1 0 ↔ LinearMap.mulRight R x = ite p 1 0 := - List.TFAE.out (@LinearMap.mulLeft_eq_one_or_zero_iff_mulRight_tfae R _ H₁ _ _ x p _) 0 1 + List.TFAE.out (@LinearMap.mulLeft_eq_one_or_zero_iff_mulRight_tfae R _ H₁ _ _ x p _) 1 2 theorem LinearMap.mulRight_smul (x : H₁) (α : R) : LinearMap.mulRight R (α • x) = α • LinearMap.mulRight R x := diff --git a/LeanPool/Monlib4/LinearAlgebra/Matrix/IsAlmostHermitian.lean b/LeanPool/Monlib4/LinearAlgebra/Matrix/IsAlmostHermitian.lean index 76ea199576..f5e296688e 100644 --- a/LeanPool/Monlib4/LinearAlgebra/Matrix/IsAlmostHermitian.lean +++ b/LeanPool/Monlib4/LinearAlgebra/Matrix/IsAlmostHermitian.lean @@ -3,7 +3,7 @@ Copyright (c) 2023 Monica Omar. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Monica Omar -/ -import Mathlib.Data.Complex.Basic +import Mathlib.Basic.Complex.Basic import Mathlib.LinearAlgebra.Matrix.Block import Mathlib.LinearAlgebra.Matrix.Hermitian import Mathlib.LinearAlgebra.Matrix.Kronecker diff --git a/LeanPool/Monlib4/LinearAlgebra/MyBimodule.lean b/LeanPool/Monlib4/LinearAlgebra/MyBimodule.lean index b7ff86ffc7..895084450b 100644 --- a/LeanPool/Monlib4/LinearAlgebra/MyBimodule.lean +++ b/LeanPool/Monlib4/LinearAlgebra/MyBimodule.lean @@ -189,8 +189,7 @@ theorem LinearMap.IsBimoduleMap.add_smul (a b : R) (x : (IsBimoduleMaps R H₁ H theorem LinearMap.isBimoduleMap_iff {T : l(R,H₁ ⊗[R] H₂)} : T.IsBimoduleMap ↔ ∀ a b x y, T ((a * x) ⊗ₜ[R] (y * b)) = a •ₗ T (x ⊗ₜ[R] y) •ᵣ b := ⟨fun h a b x y => by rw [← h]; rfl, fun h a b x => - x.induction_on - (by simp only [map_zero, Bimodule.lsmul_zero, Bimodule.zero_rsmul]) + x.inductionOn (fun _ _ => h _ _ _ _) (fun _ _ hc hd => by simp only [map_add, Bimodule.lsmul_add, Bimodule.add_rsmul, hc, hd])⟩ @@ -233,7 +232,7 @@ Submodule.coe_sum _ _ _ theorem rmulMapLmul_apply_apply (x : H₁ ⊗[R] H₂) (a : H₁) (b : H₂) : rmulMapLmul x (a ⊗ₜ b) = a •ₗ x •ᵣ b := -x.induction_on (by simp only [map_zero]; rfl) +x.inductionOn (fun α β => by simp_rw [rmulMapLmul_apply, TensorProduct.map_tmul, rmul_apply, lmul_apply] rfl) diff --git a/LeanPool/Monlib4/LinearAlgebra/OfNorm.lean b/LeanPool/Monlib4/LinearAlgebra/OfNorm.lean index b9cf94e231..0da8112bad 100644 --- a/LeanPool/Monlib4/LinearAlgebra/OfNorm.lean +++ b/LeanPool/Monlib4/LinearAlgebra/OfNorm.lean @@ -10,6 +10,7 @@ import LeanPool.Monlib4.LinearAlgebra.Ips.RankOne import LeanPool.Monlib4.Preq.RCLikeLe import Mathlib.Topology.Algebra.Module.Spaces.WeakDual import Mathlib.Analysis.Normed.Module.Dual +import Mathlib.Analysis.Normed.Module.HahnBanach import Mathlib.Analysis.InnerProductSpace.Adjoint import Mathlib.Analysis.Convex.Extreme diff --git a/LeanPool/Monlib4/LinearAlgebra/PiDirectSum.lean b/LeanPool/Monlib4/LinearAlgebra/PiDirectSum.lean index c3311473bd..1c5f798c41 100644 --- a/LeanPool/Monlib4/LinearAlgebra/PiDirectSum.lean +++ b/LeanPool/Monlib4/LinearAlgebra/PiDirectSum.lean @@ -107,7 +107,7 @@ theorem directSumTensorInvFun_apply_to_fun {R : Type _} [CommRing R] {ι₁ : Ty {M₂ : ι₂ → Type _} [∀ i₁ : ι₁, AddCommGroup (M₁ i₁)] [∀ i₂ : ι₂, AddCommGroup (M₂ i₂)] [∀ i₁ : ι₁, Module R (M₁ i₁)] [∀ i₂ : ι₂, Module R (M₂ i₂)] (x : (∀ i, M₁ i) ⊗[R] ∀ i, M₂ i) : directSumTensorInvFun (directSumTensorToFun x) = x := - x.induction_on (by simp only [map_zero]) + x.inductionOn (fun x y => by simp only [directSumTensorInvFun, LinearMap.coe_mk] calc @@ -192,13 +192,9 @@ letI : ZeroHomClass (((i : ι₁) → M₁ i) ⊗[R] ((i : ι₂) → M₂ i) →ₗ[R] (i : ι₁ × ι₂) → M₁ i.1 ⊗[R] M₂ i.2) _ _ := ⟨fun x => by simp only [LinearMap.map_zero]⟩ -x.induction_on - (by - simp only [zero_mul, map_zero] - ) +x.inductionOn (fun x₁ x₂ => - y.induction_on - (by simp only [MulZeroClass.mul_zero, map_zero]) + y.inductionOn (fun y₁ y₂ => by ext simp only [Pi.mul_apply, directSumTensorToFun_apply, Algebra.TensorProduct.tmul_mul_tmul]) diff --git a/LeanPool/Monlib4/LinearAlgebra/PiStarOrderedRing.lean b/LeanPool/Monlib4/LinearAlgebra/PiStarOrderedRing.lean index 1b2de9a0e3..76194d7480 100644 --- a/LeanPool/Monlib4/LinearAlgebra/PiStarOrderedRing.lean +++ b/LeanPool/Monlib4/LinearAlgebra/PiStarOrderedRing.lean @@ -7,7 +7,7 @@ import Mathlib.Algebra.Order.Star.Basic import Mathlib.Algebra.Group.Subgroup.Basic import Mathlib.Data.Fintype.Pi import Mathlib.Algebra.Star.Pi -import Mathlib.Data.Complex.Basic +import Mathlib.Basic.Complex.Basic /-! # pi.star_ordered_ring diff --git a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Basic.lean b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Basic.lean index 201c3f0f08..c11146c017 100644 --- a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Basic.lean +++ b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Basic.lean @@ -8,7 +8,7 @@ import Mathlib.Analysis.InnerProductSpace.Adjoint import Mathlib.Analysis.InnerProductSpace.Orthonormal import Mathlib.Analysis.InnerProductSpace.PiL2 import Mathlib.Analysis.RCLike.Basic -import Mathlib.Data.Complex.Basic +import Mathlib.Basic.Complex.Basic import Mathlib.LinearAlgebra.FiniteDimensional.Basic import Mathlib.LinearAlgebra.TensorProduct.Basis import Mathlib.Tactic.Ring @@ -716,7 +716,7 @@ theorem _root_.QuantumSet.starAlgEquiv_is_isometry_tfae [QuantumSet A] [QuantumS theorem _root_.QuantumSet.starAlgEquiv_isometry_iff_adjoint_eq_symm [QuantumSet A] [QuantumSet B] {f : A ≃⋆ₐ[ℂ] B} : Isometry f ↔ LinearMap.adjoint f.toLinearMap = f.symm.toLinearMap := - List.TFAE.out (QuantumSet.starAlgEquiv_is_isometry_tfae f) 3 0 + List.TFAE.out (QuantumSet.starAlgEquiv_is_isometry_tfae f) 4 1 theorem QuantumSet.starAlgEquiv_isometry_iff_coalgHom [hA : QuantumSet A] [hB : QuantumSet B] (gns₁ : hA.k = 0) (gns₂ : hB.k = 0) {f : A ≃⋆ₐ[ℂ] B} : @@ -885,8 +885,7 @@ theorem _root_.tenSwap_apply_lTensor {R A B C : Type*} (x : A ⊗[R] Bᵐᵒᵖ) : (tenSwap R) ((LinearMap.lTensor A f.op) x) = (LinearMap.rTensor _ f) (tenSwap R x) := by - refine x.induction_on ?_ ?_ ?_ - · simp only [map_zero] + refine x.inductionOn ?_ ?_ · simp_all · simp_all diff --git a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/QIso.lean b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/QIso.lean index 7ed7a017bd..ccab56d574 100644 --- a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/QIso.lean +++ b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/QIso.lean @@ -372,10 +372,10 @@ theorem QFun.adjoint_comp_self_eq_id_of_map_counit simp [TensorProduct.sum_tmul, map_sum, TensorProduct.smul_tmul] _ = rT H 1 := by convert congrArg (rT H) (@FrobeniusAlgebra.snake_equation_2 ℂ _ B₁ _ - (QuantumSet.isFrobeniusAlgebra (A := B₁))) using 2 <;> - first - | rfl - | (congr 4; ext r; simp [Algebra.algebraMap_eq_smul_one]) + (QuantumSet.isFrobeniusAlgebra (A := B₁))) using 2 + first + | rfl + | (congr 4; ext r; simp [Algebra.algebraMap_eq_smul_one]) _ = 1 := by ext; simp theorem QFun.map_counit_of_adjoint_comp_self_eq_id diff --git a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/SchurMul.lean b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/SchurMul.lean index c5f0d3088d..0e8b6c526c 100644 --- a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/SchurMul.lean +++ b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/SchurMul.lean @@ -52,9 +52,9 @@ notation3:80 (name := schurMulNotation) x:81 " •ₛ " y:80 => schurMul x y theorem nonUnitalAlgHom_comp_mul {R A B : Type*} [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B] (f : A →ₙₐ[R] B) : - (LinearMapClass.linearMap f) ∘ₗ LinearMap.mul' R A = + (LinearMap.ofClass f) ∘ₗ LinearMap.mul' R A = (LinearMap.mul' R B) ∘ₗ - ((LinearMapClass.linearMap f) ⊗ₘ (LinearMapClass.linearMap f)) := by + ((LinearMap.ofClass f) ⊗ₘ (LinearMap.ofClass f)) := by rw [TensorProduct.ext_iff'] simp_all @@ -62,10 +62,10 @@ theorem algHom_comp_mul {R A B : Type*} [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A] [Algebra R B] (f : A →ₐ[R] B) : f.toLinearMap ∘ₗ LinearMap.mul' R A = (LinearMap.mul' R B) ∘ₗ (f.toLinearMap ⊗ₘ f.toLinearMap) := by - change (LinearMapClass.linearMap f.toNonUnitalAlgHom) ∘ₗ LinearMap.mul' R A = + change (LinearMap.ofClass f.toNonUnitalAlgHom) ∘ₗ LinearMap.mul' R A = (LinearMap.mul' R B) ∘ₗ - ((LinearMapClass.linearMap f.toNonUnitalAlgHom) ⊗ₘ - (LinearMapClass.linearMap f.toNonUnitalAlgHom)) + ((LinearMap.ofClass f.toNonUnitalAlgHom) ⊗ₘ + (LinearMap.ofClass f.toNonUnitalAlgHom)) exact nonUnitalAlgHom_comp_mul f.toNonUnitalAlgHom attribute [local instance] Algebra.ofIsScalarTowerSmulCommClass @@ -305,9 +305,9 @@ theorem schurMul_assoc {A B : Type*} [starAlgebra A] [starAlgebra B] simp_rw [Psi.schurMul, mul_assoc] theorem comul_comp_nonUnitalAlgHom_adjoint (f : A →ₙₐ[ℂ] B) : - Coalgebra.comul ∘ₗ LinearMap.adjoint (LinearMapClass.linearMap f) = - ((LinearMap.adjoint (LinearMapClass.linearMap f)) ⊗ₘ - (LinearMap.adjoint (LinearMapClass.linearMap f))) ∘ₗ Coalgebra.comul := by + Coalgebra.comul ∘ₗ LinearMap.adjoint (LinearMap.ofClass f) = + ((LinearMap.adjoint (LinearMap.ofClass f)) ⊗ₘ + (LinearMap.adjoint (LinearMap.ofClass f))) ∘ₗ Coalgebra.comul := by simp_rw [Coalgebra.comul_eq_mul_adjoint, ← TensorProduct.map_adjoint, ← LinearMap.adjoint_comp, nonUnitalAlgHom_comp_mul f] @@ -316,9 +316,9 @@ theorem comul_comp_algHom_adjoint (f : A →ₐ[ℂ] B) : ((LinearMap.adjoint f.toLinearMap) ⊗ₘ (LinearMap.adjoint f.toLinearMap)) ∘ₗ Coalgebra.comul := by change Coalgebra.comul ∘ₗ - LinearMap.adjoint (LinearMapClass.linearMap f.toNonUnitalAlgHom) = - ((LinearMap.adjoint (LinearMapClass.linearMap f.toNonUnitalAlgHom)) ⊗ₘ - (LinearMap.adjoint (LinearMapClass.linearMap f.toNonUnitalAlgHom))) ∘ₗ + LinearMap.adjoint (LinearMap.ofClass f.toNonUnitalAlgHom) = + ((LinearMap.adjoint (LinearMap.ofClass f.toNonUnitalAlgHom)) ⊗ₘ + (LinearMap.adjoint (LinearMap.ofClass f.toNonUnitalAlgHom))) ∘ₗ Coalgebra.comul exact comul_comp_nonUnitalAlgHom_adjoint f.toNonUnitalAlgHom @@ -328,9 +328,9 @@ theorem schurMul_nonUnitalAlgHom_comp_coalgHom {C D : Type*} [SMulCommClass ℂ C C] [SMulCommClass ℂ D D] [IsScalarTower ℂ C C] [IsScalarTower ℂ D D] (g : C →ₙₐ[ℂ] D) (f : A →ₗc[ℂ] B) (x y : B →ₗ[ℂ] C) : - ((LinearMapClass.linearMap g) ∘ₗ x ∘ₗ f.toLinearMap) •ₛ - ((LinearMapClass.linearMap g) ∘ₗ y ∘ₗ f.toLinearMap) = - (LinearMapClass.linearMap g) ∘ₗ (x •ₛ y) ∘ₗ f.toLinearMap := by + ((LinearMap.ofClass g) ∘ₗ x ∘ₗ f.toLinearMap) •ₛ + ((LinearMap.ofClass g) ∘ₗ y ∘ₗ f.toLinearMap) = + (LinearMap.ofClass g) ∘ₗ (x •ₛ y) ∘ₗ f.toLinearMap := by simp_rw [schurMul_apply_apply, ← LinearMap.comp_assoc, nonUnitalAlgHom_comp_mul, LinearMap.comp_assoc, ← f.map_comp_comul] congr 1 @@ -346,9 +346,9 @@ theorem schurMul_algHom_comp_coalgHom {C D : Type*} (g : C →ₐ[ℂ] D) (f : A →ₗc[ℂ] B) (x y : B →ₗ[ℂ] C) : (g.toLinearMap ∘ₗ x ∘ₗ f.toLinearMap) •ₛ (g.toLinearMap ∘ₗ y ∘ₗ f.toLinearMap) = g.toLinearMap ∘ₗ (x •ₛ y) ∘ₗ f.toLinearMap := by - change ((LinearMapClass.linearMap g.toNonUnitalAlgHom) ∘ₗ x ∘ₗ f.toLinearMap) •ₛ - ((LinearMapClass.linearMap g.toNonUnitalAlgHom) ∘ₗ y ∘ₗ f.toLinearMap) = - (LinearMapClass.linearMap g.toNonUnitalAlgHom) ∘ₗ (x •ₛ y) ∘ₗ f.toLinearMap + change ((LinearMap.ofClass g.toNonUnitalAlgHom) ∘ₗ x ∘ₗ f.toLinearMap) •ₛ + ((LinearMap.ofClass g.toNonUnitalAlgHom) ∘ₗ y ∘ₗ f.toLinearMap) = + (LinearMap.ofClass g.toNonUnitalAlgHom) ∘ₗ (x •ₛ y) ∘ₗ f.toLinearMap exact schurMul_nonUnitalAlgHom_comp_coalgHom g.toNonUnitalAlgHom f x y theorem schurMul_nonUnitalAlgHom_comp_nonUnitalAlgHom_adjoint {C D : Type*} @@ -357,12 +357,12 @@ theorem schurMul_nonUnitalAlgHom_comp_nonUnitalAlgHom_adjoint {C D : Type*} [SMulCommClass ℂ C C] [SMulCommClass ℂ D D] [IsScalarTower ℂ C C] [IsScalarTower ℂ D D] (g : C →ₙₐ[ℂ] D) (f : B →ₙₐ[ℂ] A) (x y : B →ₗ[ℂ] C) : - ((LinearMapClass.linearMap g) ∘ₗ x ∘ₗ - (LinearMap.adjoint (LinearMapClass.linearMap f))) •ₛ - ((LinearMapClass.linearMap g) ∘ₗ y ∘ₗ - (LinearMap.adjoint (LinearMapClass.linearMap f))) = - (LinearMapClass.linearMap g) ∘ₗ (x •ₛ y) ∘ₗ - LinearMap.adjoint (LinearMapClass.linearMap f) := by + ((LinearMap.ofClass g) ∘ₗ x ∘ₗ + (LinearMap.adjoint (LinearMap.ofClass f))) •ₛ + ((LinearMap.ofClass g) ∘ₗ y ∘ₗ + (LinearMap.adjoint (LinearMap.ofClass f))) = + (LinearMap.ofClass g) ∘ₗ (x •ₛ y) ∘ₗ + LinearMap.adjoint (LinearMap.ofClass f) := by simp_rw [schurMul_apply_apply, ← LinearMap.comp_assoc, nonUnitalAlgHom_comp_mul, LinearMap.comp_assoc, comul_comp_nonUnitalAlgHom_adjoint] congr 1 @@ -379,12 +379,12 @@ theorem schurMul_algHom_comp_algHom_adjoint {C D : Type*} (g.toLinearMap ∘ₗ x ∘ₗ LinearMap.adjoint f.toLinearMap) •ₛ (g.toLinearMap ∘ₗ y ∘ₗ LinearMap.adjoint f.toLinearMap) = g.toLinearMap ∘ₗ (x •ₛ y) ∘ₗ LinearMap.adjoint f.toLinearMap := by - change ((LinearMapClass.linearMap g.toNonUnitalAlgHom) ∘ₗ x ∘ₗ - LinearMap.adjoint (LinearMapClass.linearMap f.toNonUnitalAlgHom)) •ₛ - ((LinearMapClass.linearMap g.toNonUnitalAlgHom) ∘ₗ y ∘ₗ - LinearMap.adjoint (LinearMapClass.linearMap f.toNonUnitalAlgHom)) = - (LinearMapClass.linearMap g.toNonUnitalAlgHom) ∘ₗ (x •ₛ y) ∘ₗ - LinearMap.adjoint (LinearMapClass.linearMap f.toNonUnitalAlgHom) + change ((LinearMap.ofClass g.toNonUnitalAlgHom) ∘ₗ x ∘ₗ + LinearMap.adjoint (LinearMap.ofClass f.toNonUnitalAlgHom)) •ₛ + ((LinearMap.ofClass g.toNonUnitalAlgHom) ∘ₗ y ∘ₗ + LinearMap.adjoint (LinearMap.ofClass f.toNonUnitalAlgHom)) = + (LinearMap.ofClass g.toNonUnitalAlgHom) ∘ₗ (x •ₛ y) ∘ₗ + LinearMap.adjoint (LinearMap.ofClass f.toNonUnitalAlgHom) exact schurMul_nonUnitalAlgHom_comp_nonUnitalAlgHom_adjoint g.toNonUnitalAlgHom f.toNonUnitalAlgHom x y diff --git a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Symm.lean b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Symm.lean index c121b6e2f9..4749d525e9 100644 --- a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Symm.lean +++ b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/Symm.lean @@ -327,7 +327,7 @@ theorem symmMap_eq_self_tfae (f : B →ₗ[ℂ] B) (gns : hB.k = 0) : ∀ x y : B, counit (f x * y) = (counit (x * f y) : ℂ)] := by tfae_have 1 ↔ 2 := by rw [← LinearEquiv.eq_symm_apply, eq_comm] tfae_have 1 ↔ 3 := by rw [symmMap_apply, LinearMap.adjoint_eq_iff] - have := List.TFAE.out (symmMap_eq_conj_modAut_tfae f) 1 2 + have := List.TFAE.out (symmMap_eq_conj_modAut_tfae f) 2 3 simp only [gns, neg_zero, starAlgebra.modAut_zero, AlgEquiv.one_toLinearMap, LinearMap.one_comp, LinearMap.comp_one] at this tfae_finish diff --git a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/TensorProduct.lean b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/TensorProduct.lean index dc6171c851..c136ab8ef2 100644 --- a/LeanPool/Monlib4/LinearAlgebra/QuantumSet/TensorProduct.lean +++ b/LeanPool/Monlib4/LinearAlgebra/QuantumSet/TensorProduct.lean @@ -22,10 +22,8 @@ open scoped TensorProduct noncomputable instance tensorStarAlgebra : starAlgebra (A ⊗[ℂ] B) where - star_mul x y := x.induction_on (by simp only [zero_mul, star_zero, mul_zero]) - (y.induction_on - (by simp only [mul_zero, star_zero, TensorProduct.star_tmul, zero_mul, - implies_true]) + star_mul x y := x.inductionOn + (y.inductionOn (fun _ _ _ _ => by simp only [Algebra.TensorProduct.tmul_mul_tmul, TensorProduct.star_tmul, star_mul]) (fun _ _ h1 h2 _ _ => by simp only [mul_add, star_add, h1, h2, add_mul])) @@ -39,7 +37,7 @@ noncomputable instance tensorStarAlgebra simp only [AlgEquiv.trans_toLinearMap, LinearMap.coe_comp, Function.comp_apply, AlgEquiv.toLinearMap_apply, AlgEquiv.TensorProduct.map_tmul, QuantumSet.modAut_apply_modAut, add_comm] - modAut_star _ x := x.induction_on (by simp only [map_zero, star_zero]) + modAut_star _ x := x.inductionOn (fun _ _ => by simp only [AlgEquiv.TensorProduct.map_tmul, TensorProduct.star_tmul, starAlgebra.modAut_star]) @@ -74,13 +72,9 @@ noncomputable instance QuantumSet.tensorProduct simp_rw [LinearMap.star_eq_adjoint, ← TensorProduct.map_adjoint] exact LinearMap.adjoint_inner_left _ _ _ k := hA.k - inner_star_left a b c := a.induction_on - (by simp only [zero_mul, inner_zero_left, star_zero, map_zero, inner_zero_right]) - (b.induction_on - (by simp only [mul_zero, inner_zero_left, TensorProduct.star_tmul, implies_true]) - (c.induction_on - (by simp only [Algebra.TensorProduct.tmul_mul_tmul, inner_zero_right, - TensorProduct.star_tmul, mul_zero, implies_true]) + inner_star_left a b c := a.inductionOn + (b.inductionOn + (c.inductionOn (fun _ _ _ _ _ _ => by simp only [TensorProduct.star_tmul, modAut_tensor, Algebra.TensorProduct.tmul_mul_tmul, QuantumSet.inner_star_left, @@ -93,14 +87,9 @@ noncomputable instance QuantumSet.tensorProduct (fun _ _ h1 h2 => by simp only [add_mul, inner_add_left, inner_add_right, h1, h2, star_add, map_add]) - inner_conj_left a b c := a.induction_on - (by simp only [zero_mul, inner_zero_left]) - (b.induction_on - (by simp only [mul_zero, inner_zero_left, star_zero, map_zero, inner_zero_right, - implies_true]) - (c.induction_on - (by simp only [Algebra.TensorProduct.tmul_mul_tmul, inner_zero_right, - TensorProduct.star_tmul, zero_mul, implies_true]) + inner_conj_left a b c := a.inductionOn + (b.inductionOn + (c.inductionOn (fun _ _ _ _ _ _ => by simp_rw [TensorProduct.star_tmul, modAut_tensor_tmul, Algebra.TensorProduct.tmul_mul_tmul, TensorProduct.inner_tmul, diff --git a/LeanPool/Monlib4/LinearAlgebra/TensorProduct/BasicLemmas.lean b/LeanPool/Monlib4/LinearAlgebra/TensorProduct/BasicLemmas.lean index 91e604cbf3..db425a38ff 100644 --- a/LeanPool/Monlib4/LinearAlgebra/TensorProduct/BasicLemmas.lean +++ b/LeanPool/Monlib4/LinearAlgebra/TensorProduct/BasicLemmas.lean @@ -217,8 +217,7 @@ theorem TensorProduct.of_basis_eq_span {𝕜 : Type _} {E : Type _} {F : Type _} (x : TensorProduct 𝕜 E F) {ι₁ ι₂ : Type _} [Fintype ι₁] [Fintype ι₂] (b₁ : Module.Basis ι₁ 𝕜 E) (b₂ : Module.Basis ι₂ 𝕜 F) : x = ∑ i : ι₁, ∑ j : ι₂, (b₁.tensorProduct b₂).repr x (i, j) • b₁ i ⊗ₜ[𝕜] b₂ j := - x.induction_on - (by simp only [map_zero, Finsupp.zero_apply, zero_smul, Finset.sum_const_zero]) + x.inductionOn (fun α₁ α₂ => by simp_rw [Module.Basis.tensorProduct_repr_tmul_apply, smul_eq_mul, mul_comm, ← TensorProduct.smul_tmul_smul, ← TensorProduct.tmul_sum, ← TensorProduct.sum_tmul, diff --git a/LeanPool/Monlib4/LinearAlgebra/TensorProduct/FiniteDimensional.lean b/LeanPool/Monlib4/LinearAlgebra/TensorProduct/FiniteDimensional.lean index 55feb8fec9..f8c14ebd53 100644 --- a/LeanPool/Monlib4/LinearAlgebra/TensorProduct/FiniteDimensional.lean +++ b/LeanPool/Monlib4/LinearAlgebra/TensorProduct/FiniteDimensional.lean @@ -136,8 +136,7 @@ theorem tensor_op_star_apply (x : E) (y : Eᵐᵒᵖ) : omit [Module.Finite 𝕜 E] in theorem tenSwap_star (x : E ⊗[𝕜] Eᵐᵒᵖ) : star (tenSwap 𝕜 x) = tenSwap 𝕜 (star x) := -x.induction_on - (by simp only [star_zero, map_zero]) +x.inductionOn (fun _ _ => by simp only [tenSwap_apply, tensor_op_star_apply, unop_apply, op_apply, MulOpposite.unop_op]) (fun z w hz hw => by simp only [map_add, StarAddMonoid.star_add, hz, hw]) @@ -159,7 +158,7 @@ noncomputable def starAlgEquivOfLinearEquivTensorProduct TensorProduct R A B ≃⋆ₐ[R] C := StarAlgEquiv.ofAlgEquiv (Algebra.TensorProduct.algEquivOfLinearEquivTensorProduct f h_mul h_one) - (fun x => x.induction_on (by simp only [star_zero, map_zero]) + (fun x => x.inductionOn h_star (fun _ _ h1 h2 => by simp only [star_add, map_add, h1, h2])) @@ -173,8 +172,7 @@ noncomputable def StarAlgEquiv.TensorProduct.map {R A B C D : Type*} [RCLike R] TensorProduct R A C ≃⋆ₐ[R] TensorProduct R B D := StarAlgEquiv.ofAlgEquiv (AlgEquiv.TensorProduct.map f.toAlgEquiv g.toAlgEquiv) - (fun x => x.induction_on - (by simp only [star_zero, map_zero]) + (fun x => x.inductionOn (fun _ _ => by simp only [TensorProduct.star_tmul, AlgEquiv.TensorProduct.map_tmul, coe_toAlgEquiv, map_star]) (fun _ _ h1 h2 => by simp only [star_add, map_add, h1, h2])) @@ -207,8 +205,7 @@ noncomputable def StarAlgEquiv.lTensor {R A B : Type*} (C : Type*) [RCLike R] (C ⊗[R] A) ≃⋆ₐ[R] (C ⊗[R] B) := StarAlgEquiv.ofAlgEquiv (AlgEquiv.lTensor C f.toAlgEquiv) - (fun x => x.induction_on - (by simp only [star_zero, map_zero]) + (fun x => x.inductionOn (fun _ _ => by simp only [AlgEquiv.lTensor_tmul, TensorProduct.star_tmul, coe_toAlgEquiv, map_star]) (fun _ _ h1 h2 => by simp only [star_add, map_add, h1, h2])) diff --git a/LeanPool/Monlib4/LinearAlgebra/TensorProduct/Lemmas.lean b/LeanPool/Monlib4/LinearAlgebra/TensorProduct/Lemmas.lean index 0fc3a1767f..28d7b6fdd7 100644 --- a/LeanPool/Monlib4/LinearAlgebra/TensorProduct/Lemmas.lean +++ b/LeanPool/Monlib4/LinearAlgebra/TensorProduct/Lemmas.lean @@ -24,8 +24,7 @@ theorem Algebra.TensorProduct.map_apply_map_apply {R : Type _} [CommSemiring R] (f : A →ₐ[R] B) (g : C →ₐ[R] D) (z : B →ₐ[R] E) (w : D →ₐ[R] F) (x : A ⊗[R] C) : (Algebra.TensorProduct.map z w) (Algebra.TensorProduct.map f g x) = Algebra.TensorProduct.map (z.comp f) (w.comp g) x := -x.induction_on - (map_zero _) +x.inductionOn (fun a b => by simp only [Algebra.TensorProduct.map_tmul]; rfl) (fun a b ha hb => by simp only [map_add, ha, hb]) @@ -75,13 +74,11 @@ noncomputable def LinearEquiv.TensorProduct.map {R : Type _} [CommSemiring R] {A toFun x := _root_.TensorProduct.map f.toLinearMap g.toLinearMap x invFun x := _root_.TensorProduct.map f.symm.toLinearMap g.symm.toLinearMap x left_inv x := by - induction x using _root_.TensorProduct.induction_on with - | zero => simp + induction x with | tmul a c => simp [_root_.TensorProduct.map_tmul] | add x y hx hy => simp [map_add, hx, hy] right_inv x := by - induction x using _root_.TensorProduct.induction_on with - | zero => simp + induction x with | tmul a c => simp [_root_.TensorProduct.map_tmul] | add x y hx hy => simp [map_add, hx, hy] map_add' x y := (_root_.TensorProduct.map f.toLinearMap g.toLinearMap).map_add x y diff --git a/LeanPool/Monlib4/Preq/Complex.lean b/LeanPool/Monlib4/Preq/Complex.lean index 0edb962649..f22ad505c1 100644 --- a/LeanPool/Monlib4/Preq/Complex.lean +++ b/LeanPool/Monlib4/Preq/Complex.lean @@ -3,10 +3,10 @@ Copyright (c) 2023 Monica Omar. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Monica Omar -/ -import Mathlib.Data.Complex.Basic +import Mathlib.Basic.Complex.Basic import Mathlib.Analysis.Complex.Norm import Mathlib.Algebra.BigOperators.Fin -import Mathlib.Data.Complex.BigOperators +import Mathlib.Basic.Complex.BigOperators /-! diff --git a/LeanPool/Monlib4/Preq/Dite.lean b/LeanPool/Monlib4/Preq/Dite.lean index 0f73d56a73..7039d174ff 100644 --- a/LeanPool/Monlib4/Preq/Dite.lean +++ b/LeanPool/Monlib4/Preq/Dite.lean @@ -3,7 +3,7 @@ Copyright (c) 2026 Monica Omar. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Monica Omar -/ -import Mathlib.Logic.Basic +import Mathlib.Basic.Logic.Basic import Mathlib.Algebra.Group.Defs import Mathlib.Algebra.Star.Basic import Mathlib.LinearAlgebra.TensorProduct.Basic diff --git a/LeanPool/Monlib4/Preq/StarAlgEquiv.lean b/LeanPool/Monlib4/Preq/StarAlgEquiv.lean index 1c29d0a4b8..c17bdc7691 100644 --- a/LeanPool/Monlib4/Preq/StarAlgEquiv.lean +++ b/LeanPool/Monlib4/Preq/StarAlgEquiv.lean @@ -186,22 +186,22 @@ lemma NonUnitalAlgEquiv.image_span_center {F R A B : Type*} [Semiring R] [NonUnitalSemiring A] [NonUnitalSemiring B] [Module R A] [Module R B] [EquivLike F A B] [NonUnitalAlgHomClass F R A B] (f : F) : f '' (Submodule.span R (Set.center A)) = Submodule.span R (Set.center B) := by - change (LinearMapClass.linearMap f : A → B) '' + change (LinearMap.ofClass f : A → B) '' (Submodule.span R (Set.center A) : Set A) = (Submodule.span R (Set.center B) : Set B) - rw [← Submodule.map_coe (LinearMapClass.linearMap f) (Submodule.span R (Set.center A)), + rw [← Submodule.map_coe (LinearMap.ofClass f) (Submodule.span R (Set.center A)), Submodule.map_span] - rw [show (LinearMapClass.linearMap f : A → B) '' Set.center A = Set.center B by + rw [show (LinearMap.ofClass f : A → B) '' Set.center A = Set.center B by change f '' Set.center A = Set.center B exact MulEquiv.image_center f] lemma NonUnitalAlgEquiv.map_span_center {F R A B : Type*} [Semiring R] [NonUnitalSemiring A] [NonUnitalSemiring B] [Module R A] [Module R B] [EquivLike F A B] [NonUnitalAlgHomClass F R A B] (f : F) : - Submodule.map (LinearMapClass.linearMap f) (Submodule.span R (Set.center A)) = + Submodule.map (LinearMap.ofClass f) (Submodule.span R (Set.center A)) = Submodule.span R (Set.center B) := by rw [Submodule.map_span] - rw [show (LinearMapClass.linearMap f : A → B) '' Set.center A = Set.center B by + rw [show (LinearMap.ofClass f : A → B) '' Set.center A = Set.center B by change f '' Set.center A = Set.center B exact MulEquiv.image_center f] diff --git a/LeanPool/Monlib4/QuantumGraph/Basic.lean b/LeanPool/Monlib4/QuantumGraph/Basic.lean index 65e67f4038..d274f61e48 100644 --- a/LeanPool/Monlib4/QuantumGraph/Basic.lean +++ b/LeanPool/Monlib4/QuantumGraph/Basic.lean @@ -1028,10 +1028,7 @@ theorem TensorProduct.toIsBimoduleMap_comp (AlgEquiv.TensorProduct.map f g).toLinearMap ∘ₗ (TensorProduct.toIsBimoduleMap x).1 ∘ₗ (AlgEquiv.TensorProduct.map f.symm g.symm).toLinearMap := by - induction x using TensorProduct.induction_on with - | zero => - simp only [map_zero, ZeroMemClass.coe_zero, AlgEquiv.TensorProduct.map_toLinearMap, - LinearMap.zero_comp, LinearMap.comp_zero] + induction x with | tmul _ _ => rw [TensorProduct.toIsBimoduleMap_apply_coe, AlgEquiv.TensorProduct.map_tmul, rmulMapLmul_apply, TensorProduct.ext_iff'] diff --git a/LeanPool/Monlib4/QuantumGraph/Iso.lean b/LeanPool/Monlib4/QuantumGraph/Iso.lean index 641b8f17f9..f22b010cbf 100644 --- a/LeanPool/Monlib4/QuantumGraph/Iso.lean +++ b/LeanPool/Monlib4/QuantumGraph/Iso.lean @@ -76,7 +76,7 @@ private theorem commutes_with_mul''_adjoint [hφ : φ.IsFaithfulPosMap] have := (List.TFAE.out (@Module.Dual.IsFaithfulPosMap.starAlgEquiv_is_isometry_tFAE n _ _ φ _ f) - 0 1).mp + 1 2).mp hf simp_rw [this, StarAlgEquiv.toLinearMap_apply, _root_.map_mul, implies_true]) @@ -98,7 +98,7 @@ theorem innerAut_adjoint_eq_iff [hφ : φ.IsFaithfulPosMap] have := List.TFAE.out (@Module.Dual.IsFaithfulPosMap.starAlgEquiv_is_isometry_tFAE n _ _ φ hφ (innerAutStarAlg U)) - 1 0 + 2 1 rw [hf, hf', this, innerAutStarAlg_apply, unitaryGroup.injective_hMul U, Matrix.mul_assoc, ← unitaryGroup.star_coe_eq_coe_star, UnitaryGroup.star_mul_self, Matrix.mul_one] @@ -183,7 +183,7 @@ theorem unitary_commutes_with_hφ_matrix_iff_isIsometry (hφ : φ.IsFaithfulPosM have := List.TFAE.out (@Module.Dual.IsFaithfulPosMap.starAlgEquiv_is_isometry_tFAE n _ _ φ _ (innerAutStarAlg U)) - 1 4 + 2 5 change LinearMap.adjoint (innerAutStarAlg U).toLinearMap = (innerAutStarAlg U).symm.toLinearMap ↔ StarAlgEquiv.IsIsometry (innerAutStarAlg U) @@ -199,7 +199,7 @@ theorem Qam.symm_apply_starAlgEquiv_conj [hφ : φ.IsFaithfulPosMap] f.toLinearMap ∘ₗ (symmMap ℂ (Matrix n n ℂ) _ A) ∘ₗ f.symm.toLinearMap) := withMatrixQuantum[φ] (by have := List.TFAE.out - (@Module.Dual.IsFaithfulPosMap.starAlgEquiv_is_isometry_tFAE n _ _ φ _ f) 4 1 + (@Module.Dual.IsFaithfulPosMap.starAlgEquiv_is_isometry_tFAE n _ _ φ _ f) 5 2 rw [StarAlgEquiv.IsIsometry, isometry_iff_norm, this] at hf change LinearMap.adjoint f.toAlgEquiv.toLinearMap = f.symm.toAlgEquiv.toLinearMap at hf change LinearMap.adjoint @@ -241,7 +241,7 @@ theorem StarAlgEquiv.IsIsometry.commutes_with_mul'_adjoint LinearMap.adjoint (LinearMap.mul' ℂ (Matrix n n ℂ)) ∘ₗ f.toLinearMap) := withMatrixQuantum[φ] (by have := List.TFAE.out - (@Module.Dual.IsFaithfulPosMap.starAlgEquiv_is_isometry_tFAE n _ _ φ _ f) 4 1 + (@Module.Dual.IsFaithfulPosMap.starAlgEquiv_is_isometry_tFAE n _ _ φ _ f) 5 2 rw [StarAlgEquiv.IsIsometry, isometry_iff_norm, this] at hf rw [← LinearMap.adjoint_adjoint (f.toLinearMap ⊗ₘ f.toLinearMap), ← LinearMap.adjoint_comp, TensorProduct.map_adjoint, hf, @@ -262,11 +262,11 @@ theorem Qam.reflIdempotent_starAlgEquiv_conj [hφ : φ.IsFaithfulPosMap] simp_rw [StarAlgEquiv.IsIsometry, isometry_iff_norm] at hf ⊢ have := List.TFAE.out (@Module.Dual.IsFaithfulPosMap.starAlgEquiv_is_isometry_tFAE n _ _ φ _ f.symm) - 4 1 + 5 2 rw [this] have this' := List.TFAE.out (@Module.Dual.IsFaithfulPosMap.starAlgEquiv_is_isometry_tFAE n _ _ φ _ f) - 4 1 + 5 2 rw [this'] at hf rw [StarAlgEquiv.symm_symm, ← hf, LinearMap.adjoint_adjoint] change @@ -309,7 +309,7 @@ theorem Qam.iso_iff [hφ : φ.IsFaithfulPosMap] {A B : l((Matrix n n ℂ))} : List.TFAE.out (@Module.Dual.IsFaithfulPosMap.starAlgEquiv_is_isometry_tFAE n _ _ φ _ (innerAutStarAlg U)) - 1 0 + 2 1 simp_rw [hf, ← innerAutStarAlg_symm_eq_star, this] constructor · rintro ⟨f, hf⟩ diff --git a/LeanPool/Monlib4/QuantumGraph/PiMatFinTwo.lean b/LeanPool/Monlib4/QuantumGraph/PiMatFinTwo.lean index 88ead6663f..98f38d64f3 100644 --- a/LeanPool/Monlib4/QuantumGraph/PiMatFinTwo.lean +++ b/LeanPool/Monlib4/QuantumGraph/PiMatFinTwo.lean @@ -374,7 +374,7 @@ lemma simp only [QuantumGraph.Real.dimOfPiMatSubmodule_eq, Finset.sum_product_univ, Fin.sum_univ_two, Fin.isValue, Prod.mk_zero_zero, Prod.mk_one_one] at hd - simp only [Fin.isValue, Nat.add_eq_one_iff, AddLeftCancelMonoid.add_eq_zero, + simp only [Fin.isValue, Nat.add_eq_one_iff, add_eq_zero, Submodule.finrank_eq_zero] at hd simp only [Fin.isValue, hA.PiMatSubmodule_eq_bot_iff_swap_eq_bot_of_adjoint hA₂ (0, 1), Prod.swap_prod_mk] at hd @@ -605,7 +605,7 @@ theorem NonUnitalAlgHom.single_toLinearMap {R ι : Type*} [CommSemiring R] [DecidableEq ι] {φ : ι → Type*} [(i : ι) → Ring (φ i)] [(i : ι) → Module R (φ i)] (i : ι) : - (LinearMapClass.linearMap (NonUnitalAlgHom.single R φ i) : φ i →ₗ[R] (Π i, φ i)) = + (LinearMap.ofClass (NonUnitalAlgHom.single R φ i) : φ i →ₗ[R] (Π i, φ i)) = LinearMap.single R φ i := rfl @@ -655,7 +655,7 @@ theorem LinearMap.proj_comp_inj theorem NonUnitalAlgHom.id_toLinearMap {R A : Type*} [Semiring R] [NonUnitalNonAssocSemiring A] [Module R A] : - (LinearMapClass.linearMap (NonUnitalAlgHom.id R A) : A →ₗ[R] A) = 1 := + (LinearMap.ofClass (NonUnitalAlgHom.id R A) : A →ₗ[R] A) = 1 := rfl theorem QuantumGraph.Real.conj_proj_isReal @@ -774,17 +774,17 @@ by simp only [← LinearMap.comp_assoc] have hcomul : TensorProduct.map - (LinearMapClass.linearMap (NonUnitalAlgHom.single ℂ (fun r => Mat ℂ (p r)) i)) - (LinearMapClass.linearMap (NonUnitalAlgHom.single ℂ (fun r => Mat ℂ (p r)) i)) ∘ₗ + (LinearMap.ofClass (NonUnitalAlgHom.single ℂ (fun r => Mat ℂ (p r)) i)) + (LinearMap.ofClass (NonUnitalAlgHom.single ℂ (fun r => Mat ℂ (p r)) i)) ∘ₗ Coalgebra.comul = Coalgebra.comul ∘ₗ - LinearMapClass.linearMap (NonUnitalAlgHom.single ℂ (fun r => Mat ℂ (p r)) i) := by + LinearMap.ofClass (NonUnitalAlgHom.single ℂ (fun r => Mat ℂ (p r)) i) := by apply_fun LinearMap.adjoint using LinearEquiv.injective _ simp only [Coalgebra.comul_eq_mul_adjoint, LinearMap.adjoint_comp, LinearMap.adjoint_adjoint, TensorProduct.map_adjoint] have hsingle : LinearMap.adjoint - (LinearMapClass.linearMap + (LinearMap.ofClass (NonUnitalAlgHom.single ℂ (fun r => Mat ℂ (p r)) i) : Mat ℂ (p i) →ₗ[ℂ] PiMat ℂ ι p) = LinearMap.proj (R := ℂ) (φ := fun r => Mat ℂ (p r)) i := by @@ -915,8 +915,8 @@ theorem schurMul_comp_proj_of_ne_eq_zero rw [hadj] change LinearMap.mul' ℂ ((i : ι) → Mat ℂ (p i)) ∘ₗ TensorProduct.map - (LinearMapClass.linearMap (NonUnitalAlgHom.single ℂ (fun r => Mat ℂ (p r)) i)) - (LinearMapClass.linearMap (NonUnitalAlgHom.single ℂ (fun r => Mat ℂ (p r)) j)) = + (LinearMap.ofClass (NonUnitalAlgHom.single ℂ (fun r => Mat ℂ (p r)) i)) + (LinearMap.ofClass (NonUnitalAlgHom.single ℂ (fun r => Mat ℂ (p r)) j)) = 0 apply TensorProduct.ext' intro x y diff --git a/LeanPool/Monlib4/QuantumGraph/QamA.lean b/LeanPool/Monlib4/QuantumGraph/QamA.lean index 3ec85b33a5..4b9a7287b1 100644 --- a/LeanPool/Monlib4/QuantumGraph/QamA.lean +++ b/LeanPool/Monlib4/QuantumGraph/QamA.lean @@ -934,7 +934,7 @@ private theorem star_alg_equiv.is_isometry_iff [hφ : φ.IsFaithfulPosMap] (f : withMatrixQuantumCtx[φ] rw [StarAlgEquiv.IsIsometry, isometry_iff_norm] exact List.TFAE.out - (@Module.Dual.IsFaithfulPosMap.starAlgEquiv_is_isometry_tFAE n _ _ φ _ f) 4 0 + (@Module.Dual.IsFaithfulPosMap.starAlgEquiv_is_isometry_tFAE n _ _ φ _ f) 5 1 -- The conjugation normal form produces large matrix expressions before simplification. theorem qamA.isometric_starAlgEquiv_conj [hφ : φ.IsFaithfulPosMap] diff --git a/LeanPool/Monlib4/QuantumGraph/QamAExample.lean b/LeanPool/Monlib4/QuantumGraph/QamAExample.lean index f68d9b06ec..a976d128ba 100644 --- a/LeanPool/Monlib4/QuantumGraph/QamAExample.lean +++ b/LeanPool/Monlib4/QuantumGraph/QamAExample.lean @@ -118,7 +118,7 @@ theorem Qam.iso_preserves_ir_reflexive {φ : Module.Dual ℂ ℍ} obtain ⟨f, hf, h⟩ := hxhy rw [StarAlgEquiv.comp_eq_iff, LinearMap.comp_assoc] at hf have := List.TFAE.out (@Module.Dual.IsFaithfulPosMap.starAlgEquiv_is_isometry_tFAE n _ _ φ _ - f) 0 4 + f) 1 5 have hisometry : StarAlgEquiv.IsIsometry f := by change Isometry f rw [isometry_iff_norm] diff --git a/LeanPool/Monlib4/QuantumGraph/ToProjections.lean b/LeanPool/Monlib4/QuantumGraph/ToProjections.lean index 31b342e6a8..f1da707b22 100644 --- a/LeanPool/Monlib4/QuantumGraph/ToProjections.lean +++ b/LeanPool/Monlib4/QuantumGraph/ToProjections.lean @@ -358,8 +358,7 @@ noncomputable def oneMapTranspose : ℍ ⊗[ℂ] ℍᵐᵒᵖ ≃⋆ₐ[ℂ] Mat tensorToKronecker change ∀ x, F (star x) = star (F x) intro x - refine x.induction_on ?zero ?tmul ?add - · simp only [star_zero, map_zero] + refine x.inductionOn ?tmul ?add · intro x₁ x₂ simp only [TensorProduct.star_tmul] exact (TensorProduct.toKronecker_star diff --git a/LeanPool/Monsky/Appendix.lean b/LeanPool/Monsky/Appendix.lean index 46175c6dfd..d5c70af701 100644 --- a/LeanPool/Monsky/Appendix.lean +++ b/LeanPool/Monsky/Appendix.lean @@ -376,7 +376,7 @@ lemma inclusion_maximal_valuation (B : Subring ℝ) (h1 : (1 / 2) ∉ B) · rcases (lower_degree B α m n H p q m_eq_degree_p n_eq_degree_q zero_lt_m zero_lt_n p_eval q_eval leq) with ⟨m', pq, deg, eval, deg2⟩ have main : m' ∈ degree := ⟨pq, deg2.symm, eval⟩ - have ge : m' ≥ m := WellFounded.min_le wellFounded_lt main + have ge : m' ≥ m := WellFoundedLT.min_le main omega · have leq2 : m ≤ n := Nat.le_of_not_ge leq have H3 : α⁻¹ ∉ B ∧ α⁻¹⁻¹ ∉ B := by @@ -386,7 +386,7 @@ lemma inclusion_maximal_valuation (B : Subring ℝ) (h1 : (1 / 2) ∉ B) rcases (lower_degree B α⁻¹ n m H3 q p n_eq_degree_q m_eq_degree_p zero_lt_n zero_lt_m q_eval p_eval2 leq2) with ⟨m', pq, deg, eval, deg2⟩ have main : m' ∈ degree' := ⟨pq, deg2.symm, eval⟩ - have ge : m' ≥ n := WellFounded.min_le wellFounded_lt main + have ge : m' ≥ n := WellFoundedLT.min_le main omega /-- The set of subrings of `ℝ` not containing `1/2`. -/ diff --git a/LeanPool/Monsky/Miscellaneous.lean b/LeanPool/Monsky/Miscellaneous.lean index 5995bceeba..90cd09cfb4 100644 --- a/LeanPool/Monsky/Miscellaneous.lean +++ b/LeanPool/Monsky/Miscellaneous.lean @@ -5,7 +5,7 @@ Authors: Dhyan Aranha, contributors -/ import Mathlib.Analysis.InnerProductSpace.PiL2 -import Mathlib.Data.Real.Sign +import Mathlib.Basic.Real.Sign import Mathlib.Tactic.Common import Mathlib.Tactic.Linarith import Mathlib.Tactic.NormNum diff --git a/LeanPool/Monsky/MonskyEven.lean b/LeanPool/Monsky/MonskyEven.lean index 8d0acda497..b8fcad7419 100644 --- a/LeanPool/Monsky/MonskyEven.lean +++ b/LeanPool/Monsky/MonskyEven.lean @@ -343,8 +343,8 @@ lemma zig_zag_covers_square {n : ℕ} (hn : n ≠ 0) try linarith [hx 0 ] ) convert sub_nonneg.2 (le_of_lt (Nat.lt_floor_add_one (↑n * x 1))) using 1 - · rfl - · ring + simp only [j] + ring · rw [translateTriangle_det, scaleTriangle_det, mul_ne_zero_iff_right] · simp only [one_div, ne_eq, inv_eq_zero, Nat.cast_eq_zero, hn, not_false_eq_true] · simp [det, Δ₀'] diff --git a/LeanPool/Monsky/SegmentTriangle.lean b/LeanPool/Monsky/SegmentTriangle.lean index ae00f21035..e6dc0a4286 100644 --- a/LeanPool/Monsky/SegmentTriangle.lean +++ b/LeanPool/Monsky/SegmentTriangle.lean @@ -1061,9 +1061,9 @@ noncomputable def makeNewTwoSimplex (a b : Fin 2 → ℝ) --This lemma shows that the above defined simplex is indeed a two simplex lemma makeNewTwoSimplex_lem (a b : Fin 2 → ℝ) (ha_simplex : a ∈ openSimplex 2) (hb_simplex : b ∈ openSimplex 2) : makeNewTwoSimplex a b ∈ openSimplex 2 := by - have hhelp := sub_pos.mpr (mul_lt_one_of_nonneg_of_lt_one_left (le_of_lt (ha_simplex.1 1)) - (simplex_co_leq_1_open (by norm_num) ha_simplex 1) - (le_of_lt (simplex_co_leq_1_open (by norm_num) hb_simplex 0))) + have hhelp := sub_pos.mpr ((mul_le_of_le_one_right (le_of_lt (ha_simplex.1 1)) + (le_of_lt (simplex_co_leq_1_open (by norm_num) hb_simplex 0))).trans_lt + (simplex_co_leq_1_open (by norm_num) ha_simplex 1)) constructor · intro i; fin_cases i · exact div_pos (ha_simplex.1 0) hhelp @@ -1100,9 +1100,9 @@ lemma two_colin_in_openHull {u v w x : ℝ²} (h₁ : colin u v w) (h₂ : colin nth_rewrite 2[← h2] module have h: (1 - a 1 * b 0) > 0 := - sub_pos.mpr (mul_lt_one_of_nonneg_of_lt_one_left (le_of_lt (ha_simplex.1 1)) - (simplex_co_leq_1_open (by norm_num) ha_simplex 1) - (le_of_lt (simplex_co_leq_1_open (by norm_num) hb_simplex 0))) + sub_pos.mpr ((mul_le_of_le_one_right (le_of_lt (ha_simplex.1 1)) + (le_of_lt (simplex_co_leq_1_open (by norm_num) hb_simplex 0))).trans_lt + (simplex_co_leq_1_open (by norm_num) ha_simplex 1)) rw[← inv_smul_eq_iff₀ (Ne.symm (ne_of_lt h))] at h1 rw[← h1] simp diff --git a/LeanPool/NashWilliams/Combinatorics/Front/Rank.lean b/LeanPool/NashWilliams/Combinatorics/Front/Rank.lean index 051ae0fe73..66babc782b 100644 --- a/LeanPool/NashWilliams/Combinatorics/Front/Rank.lean +++ b/LeanPool/NashWilliams/Combinatorics/Front/Rank.lean @@ -39,24 +39,24 @@ noncomputable section /-- **A relation homomorphism does not increase rank.** If `f : r →r s` maps `r` into a well-founded relation `s`, then the `r`-rank of `a` is at most the `s`-rank of `f a`. This is the -cross-relation companion to `IsWellFounded.rank_lt_of_rel` (which only compares ranks within a +cross-relation companion to `WellFounded.rank_lt_of_rel` (which only compares ranks within a single relation), and the tool underlying the rank comparisons for the ray and the restriction of -a front. General; Mathlib-bound (belongs next to `IsWellFounded.rank_lt_of_rel`). -/ +a front. General; Mathlib-bound (belongs next to `WellFounded.rank_lt_of_rel`). -/ theorem RelHom.rank_le {α β : Type u} {r : α → α → Prop} {s : β → β → Prop} - [IsWellFounded α r] [IsWellFounded β s] (f : r →r s) (a : α) : - IsWellFounded.rank r a ≤ IsWellFounded.rank s (f a) := by - refine IsWellFounded.induction r a - (motive := fun a => IsWellFounded.rank r a ≤ IsWellFounded.rank s (f a)) + [WellFounded r] [WellFounded s] (f : r →r s) (a : α) : + WellFounded.rank r a ≤ WellFounded.rank s (f a) := by + refine WellFounded.induction' r a + (motive := fun a => WellFounded.rank r a ≤ WellFounded.rank s (f a)) (fun a IH => ?_) - rw [IsWellFounded.rank_eq r a] + rw [WellFounded.rank_eq r a] apply Ordinal.iSup_le rintro ⟨b, hb⟩ - calc Order.succ (IsWellFounded.rank r b) - ≤ Order.succ (IsWellFounded.rank s (f b)) := Order.succ_le_succ (IH b hb) - _ ≤ IsWellFounded.rank s (f a) := by - rw [IsWellFounded.rank_eq s (f a)] + calc Order.succ (WellFounded.rank r b) + ≤ Order.succ (WellFounded.rank s (f b)) := Order.succ_le_succ (IH b hb) + _ ≤ WellFounded.rank s (f a) := by + rw [WellFounded.rank_eq s (f a)] exact Ordinal.le_iSup - (fun c : {c // s c (f a)} => Order.succ (IsWellFounded.rank s c)) + (fun c : {c // s c (f a)} => Order.succ (WellFounded.rank s c)) ⟨f b, f.map_rel hb⟩ namespace Front @@ -67,7 +67,7 @@ def tree (F : Set (List ℕ)) : Set (List ℕ) := /-- Proper end-extension inside the tree of `F`: `treeExt F a b` holds when `a` properly extends `b` and both lie in the tree. Its well-foundedness is what allows ranking a front. Note the -recursion direction: `IsWellFounded.rank (treeExt F) s` is the supremum of `succ (rank s')` over +recursion direction: `WellFounded.rank (treeExt F) s` is the supremum of `succ (rank s')` over the proper extensions `s'` of `s`, matching the usual rank of a front. -/ def treeExt (F : Set (List ℕ)) (a b : List ℕ) : Prop := a ∈ tree F ∧ b ∈ tree F ∧ b <+: a ∧ b ≠ a @@ -171,8 +171,8 @@ theorem IsFront.wellFounded_treeExt {F : Set (List ℕ)} {M : ℕ → ℕ} (hF : /-- The ordinal **rank of a front**: the rank of the root `[]` in the well-founded tree of proper end-extensions. -/ def IsFront.rank {F : Set (List ℕ)} {M : ℕ → ℕ} (hF : IsFront F M) : Ordinal := - have : IsWellFounded (List ℕ) (treeExt F) := ⟨hF.wellFounded_treeExt⟩ - IsWellFounded.rank (treeExt F) [] + have : WellFounded (treeExt F) := hF.wellFounded_treeExt + WellFounded.rank (treeExt F) [] variable {F : Set (List ℕ)} {M : ℕ → ℕ} @@ -226,17 +226,17 @@ theorem rank_eq_sub (hF : IsFront F M) {s0 : List ℕ} (L : ℕ) (hbound : ∀ s, s0 <+: s → s ∈ tree F → s.length ≤ L) (hext : ∀ s, s0 <+: s → s ∈ tree F → s.length < L → ∃ x, treeExt F (s ++ [x]) s) (s : List ℕ) (hs0 : s0 <+: s) (hs : s ∈ tree F) : - haveI : IsWellFounded (List ℕ) (treeExt F) := ⟨hF.wellFounded_treeExt⟩ - IsWellFounded.rank (treeExt F) s = ((L - s.length : ℕ) : Ordinal) := by - have : IsWellFounded (List ℕ) (treeExt F) := ⟨hF.wellFounded_treeExt⟩ + haveI : WellFounded (treeExt F) := hF.wellFounded_treeExt + WellFounded.rank (treeExt F) s = ((L - s.length : ℕ) : Ordinal) := by + have : WellFounded (treeExt F) := hF.wellFounded_treeExt suffices H : ∀ d s, s0 <+: s → s ∈ tree F → L - s.length = d → - IsWellFounded.rank (treeExt F) s = (d : Ordinal) by + WellFounded.rank (treeExt F) s = (d : Ordinal) by exact H _ s hs0 hs rfl intro d induction d using Nat.strong_induction_on with | _ d IH => intro s hs0 hs hd - rw [IsWellFounded.rank_eq] + rw [WellFounded.rank_eq] apply le_antisymm · apply Ordinal.iSup_le rintro ⟨y, hytree, -, hsy, hsney⟩ @@ -258,10 +258,10 @@ theorem rank_eq_sub (hF : IsFront F M) {s0 : List ℕ} (L : ℕ) rw [Order.succ_eq_add_one, ← Nat.cast_add_one] congr 1 omega - _ = Order.succ (IsWellFounded.rank (treeExt F) (s ++ [x])) := by rw [hrank] + _ = Order.succ (WellFounded.rank (treeExt F) (s ++ [x])) := by rw [hrank] _ ≤ _ := Ordinal.le_iSup (fun b : {b // treeExt F b s} => - Order.succ (IsWellFounded.rank (treeExt F) (b : List ℕ))) + Order.succ (WellFounded.rank (treeExt F) (b : List ℕ))) ⟨s ++ [x], hx⟩ /-- Membership in the tree of `[M]^k`: increasing lists in `M` of length at most `k`. -/ @@ -332,11 +332,11 @@ theorem mem_tree_schreier (hM : StrictMono M) {s : List ℕ} : `a + 1 - s.length`. -/ theorem schreier_rank_node (hM : StrictMono M) {s : List ℕ} {a : ℕ} (hsmem : s ∈ tree (schreier M)) (hhead : s.head? = some a) : - haveI : IsWellFounded (List ℕ) (treeExt (schreier M)) := - ⟨(isFront_schreier hM).wellFounded_treeExt⟩ - IsWellFounded.rank (treeExt (schreier M)) s = ((a + 1 - s.length : ℕ) : Ordinal) := by - have : IsWellFounded (List ℕ) (treeExt (schreier M)) := - ⟨(isFront_schreier hM).wellFounded_treeExt⟩ + haveI : WellFounded (treeExt (schreier M)) := + (isFront_schreier hM).wellFounded_treeExt + WellFounded.rank (treeExt (schreier M)) s = ((a + 1 - s.length : ℕ) : Ordinal) := by + have : WellFounded (treeExt (schreier M)) := + (isFront_schreier hM).wellFounded_treeExt have hpre_a : [a] <+: s := by obtain ⟨ys, rfl⟩ := List.head?_eq_some_iff.mp hhead exact ⟨ys, rfl⟩ @@ -373,9 +373,9 @@ theorem schreier_rank_node (hM : StrictMono M) {s : List ℕ} {a : ℕ} /-- **The Schreier front has rank `ω`.** -/ theorem schreier_rank (hM : StrictMono M) : (isFront_schreier hM).rank = ω := by - have : IsWellFounded (List ℕ) (treeExt (schreier M)) := - ⟨(isFront_schreier hM).wellFounded_treeExt⟩ - rw [IsFront.rank, IsWellFounded.rank_eq] + have : WellFounded (treeExt (schreier M)) := + (isFront_schreier hM).wellFounded_treeExt + rw [IsFront.rank, WellFounded.rank_eq] apply le_antisymm · apply Ordinal.iSup_le rintro ⟨y, hytree, -, -, hbne⟩ @@ -399,14 +399,14 @@ theorem schreier_rank (hM : StrictMono M) : (isFront_schreier hM).rank = ω := b simp only [List.length_cons, List.length_nil]; omega have hte : treeExt (schreier M) [x] [] := ⟨hxtree, (isFront_schreier hM).nil_mem_tree, List.nil_prefix, by simp⟩ - have hrank : IsWellFounded.rank (treeExt (schreier M)) [x] = (x : Ordinal) := by + have hrank : WellFounded.rank (treeExt (schreier M)) [x] = (x : Ordinal) := by rw [schreier_rank_node hM hxtree List.head?_cons]; simp calc (n : Ordinal) ≤ ((x + 1 : ℕ) : Ordinal) := by rw [Nat.cast_le]; omega - _ = Order.succ (IsWellFounded.rank (treeExt (schreier M)) [x]) := by + _ = Order.succ (WellFounded.rank (treeExt (schreier M)) [x]) := by rw [hrank, Order.succ_eq_add_one, Nat.cast_add_one] _ ≤ _ := Ordinal.le_iSup (fun b : {b // treeExt (schreier M) b []} => - Order.succ (IsWellFounded.rank (treeExt (schreier M)) (b : List ℕ))) + Order.succ (WellFounded.rank (treeExt (schreier M)) (b : List ℕ))) ⟨[x], hte⟩ end Front diff --git a/LeanPool/NashWilliams/Combinatorics/Front/Ray.lean b/LeanPool/NashWilliams/Combinatorics/Front/Ray.lean index 733c160fcd..97e4aad54a 100644 --- a/LeanPool/NashWilliams/Combinatorics/Front/Ray.lean +++ b/LeanPool/NashWilliams/Combinatorics/Front/Ray.lean @@ -245,21 +245,21 @@ theorem mem_tree_ray {a : ℕ} {t : List ℕ} : t ∈ tree (ray F a) ↔ a :: t theorem IsFront.ray_rank_lt (hF : IsFront F M) (h0 : [] ∉ F) {n : ℕ} (hn : n ∈ Set.range M) : (hF.ray_isFront_mem h0 hn).rank < hF.rank := by have ha : [n] ∈ tree F := hF.singleton_mem_tree h0 hn - have iF : IsWellFounded (List ℕ) (treeExt F) := ⟨hF.wellFounded_treeExt⟩ - have iR : IsWellFounded (List ℕ) (treeExt (ray F n)) := - ⟨(hF.ray_isFront_mem h0 hn).wellFounded_treeExt⟩ + have iF : WellFounded (treeExt F) := hF.wellFounded_treeExt + have iR : WellFounded (treeExt (ray F n)) := + (hF.ray_isFront_mem h0 hn).wellFounded_treeExt -- The head-attaching map `t ↦ n :: t` is a relation homomorphism into `treeExt F`. let φ : treeExt (ray F n) →r treeExt F := ⟨fun t => n :: t, by rintro x y ⟨hx, hy, hyx, hne⟩ refine ⟨mem_tree_ray.mp hx, mem_tree_ray.mp hy, (List.prefix_cons_inj n).mpr hyx, ?_⟩ intro hc; injection hc with _ h; exact hne h⟩ - have hle : IsWellFounded.rank (treeExt (ray F n)) [] ≤ IsWellFounded.rank (treeExt F) [n] := + have hle : WellFounded.rank (treeExt (ray F n)) [] ≤ WellFounded.rank (treeExt F) [n] := φ.rank_le [] - have hlt : IsWellFounded.rank (treeExt F) [n] < IsWellFounded.rank (treeExt F) [] := - IsWellFounded.rank_lt_of_rel + have hlt : WellFounded.rank (treeExt F) [n] < WellFounded.rank (treeExt F) [] := + WellFounded.rank_lt_of_rel ⟨ha, hF.nil_mem_tree, List.nil_prefix, (List.cons_ne_nil n []).symm⟩ - change IsWellFounded.rank (treeExt (ray F n)) [] < IsWellFounded.rank (treeExt F) [] + change WellFounded.rank (treeExt (ray F n)) [] < WellFounded.rank (treeExt F) [] exact lt_of_le_of_lt hle hlt end Front diff --git a/LeanPool/NashWilliams/Combinatorics/Front/Shrink.lean b/LeanPool/NashWilliams/Combinatorics/Front/Shrink.lean index 1d32111b88..86ac71d4e8 100644 --- a/LeanPool/NashWilliams/Combinatorics/Front/Shrink.lean +++ b/LeanPool/NashWilliams/Combinatorics/Front/Shrink.lean @@ -130,15 +130,15 @@ theorem tree_shrink_subset {N : ℕ → ℕ} : tree (shrink F N) ⊆ tree F := b rank at most that of the front. -/ theorem IsFront.shrink_rank_le (hF : IsFront F M) {E : ℕ → ℕ} (hE : StrictMono E) : (shrink_isFront hF hE).rank ≤ hF.rank := by - have iF : IsWellFounded (List ℕ) (treeExt F) := ⟨hF.wellFounded_treeExt⟩ - have iS : IsWellFounded (List ℕ) (treeExt (shrink F (M ∘ E))) := - ⟨(shrink_isFront hF hE).wellFounded_treeExt⟩ + have iF : WellFounded (treeExt F) := hF.wellFounded_treeExt + have iS : WellFounded (treeExt (shrink F (M ∘ E))) := + (shrink_isFront hF hE).wellFounded_treeExt -- The identity is a relation homomorphism `treeExt (shrink F N) →r treeExt F`. let φ : treeExt (shrink F (M ∘ E)) →r treeExt F := ⟨id, by rintro x y ⟨hx, hy, hyx, hne⟩ exact ⟨tree_shrink_subset hx, tree_shrink_subset hy, hyx, hne⟩⟩ - change IsWellFounded.rank (treeExt (shrink F (M ∘ E))) [] ≤ IsWellFounded.rank (treeExt F) [] + change WellFounded.rank (treeExt (shrink F (M ∘ E))) [] ≤ WellFounded.rank (treeExt F) [] exact φ.rank_le [] end Front diff --git a/LeanPool/NavierStokesAndEuler/Euler/BaseEulerState.lean b/LeanPool/NavierStokesAndEuler/Euler/BaseEulerState.lean index f9ff748b3b..249a60a8b1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/BaseEulerState.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/BaseEulerState.lean @@ -698,7 +698,7 @@ theorem spatialOrbit_derivative_norm (n : ℕ) (a : LiftTangent) : _ ≤ ‖iteratedFDeriv ℝ n (fun b : Space => EulerLpTranslation.translation b u.toLp) a.1‖* ∏ _i : Fin n, (1 : ℝ) := by apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) - exact Finset.prod_le_prod (fun _ _ => norm_nonneg L) + exact Finset.prod_le_prod₀ (fun _ _ => norm_nonneg L) (fun _ _ => ContinuousLinearMap.norm_fst_le ℝ Space ℝ) _ = ‖iteratedFDeriv ℝ n (fun b : Space => EulerLpTranslation.translation b u.toLp) a.1‖ := by simp only [Finset.prod_const_one,mul_one] @@ -3216,7 +3216,7 @@ theorem hasJetBound_of_support_sup (A : SmoothL2Field V) (K : Set Space) have h := EulerMeanBoundary.lpNorm_le_bound_volume (iteratedFDeriv ℝ n A.field) (A.integrable n).aestronglyMeasurable K hK (C*R^n*(n.factorial : ℝ)^2) (by positivity) (hb n) hzero 2 - rw [norm_jetLp,toReal_eLpNorm (A.integrable n).aestronglyMeasurable] + rw [norm_jetLp,toReal_eLpNorm] convert h using 1 norm_num ring diff --git a/LeanPool/NavierStokesAndEuler/Euler/ChildParticleFieldBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/ChildParticleFieldBounds.lean index 1842942e8d..9571791a4f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ChildParticleFieldBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ChildParticleFieldBounds.lean @@ -46,7 +46,8 @@ theorem norm_jetLp_le_wordSum (A : SmoothL2Field Space) (n : ℕ) : let H : (Fin n → Fin 3) → Space → ℝ := fun w x => ‖wordDerivative direction A.field w x‖ have hn (w : Fin n → Fin 3) : (eLpNorm (H w) 2 volume).toReal = ‖ordinaryWord direction A.toLp w‖ := by - rw [show H w = fun x => ‖wordDerivative direction A.field w x‖ from rfl,eLpNorm_norm] + rw [show H w = fun x => ‖wordDerivative direction A.field w x‖ from rfl, + eLpNorm_norm _ (hm w).aestronglyMeasurable] rw [← eLpNorm_congr_ae (ha w),Lp.norm_def] have hb := (finite_domination volume (univ : Finset (Fin n → Fin 3)) (iteratedFDeriv ℝ n A.field) ((A.smooth.continuous_iteratedFDeriv (m := n) (by simp)).aestronglyMeasurable) diff --git a/LeanPool/NavierStokesAndEuler/Euler/CoefficientPathSmooth.lean b/LeanPool/NavierStokesAndEuler/Euler/CoefficientPathSmooth.lean index b10463ad74..1b2f2e325f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CoefficientPathSmooth.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CoefficientPathSmooth.lean @@ -54,7 +54,7 @@ theorem cylinder_norm_iteratedFDeriv_le (P : ℝ) (A : C(K, Space →ᵇ V)) calc _ ≤ ‖iteratedFDeriv ℝ n f y.1‖ * ∏ _i : Fin n, (1 : ℝ) := by apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) - exact Finset.prod_le_prod (fun _ _ => norm_nonneg _) + exact Finset.prod_le_prod₀ (fun _ _ => norm_nonneg _) (fun _ _ => ContinuousLinearMap.norm_fst_le ℝ Space ℝ) _ = ‖iteratedFDeriv ℝ n f y.1‖ := by simp only [Finset.prod_const_one,mul_one] _ = ‖iteratedFDeriv ℝ n (A t : Space → V) (x.1+y.1)‖ := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletSobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletSobolev.lean index 689d2cefcb..83656f2bdb 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletSobolev.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderDirichletSobolev.lean @@ -109,7 +109,7 @@ theorem mixedOperatorPath_bound (A : C(K, Space →ᵇ E →L[ℝ] F)) calc _ ≤ ‖iteratedFDeriv ℝ n f a.1‖ * ∏ _i : Fin n, (1 : ℝ) := by apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) - exact Finset.prod_le_prod (fun _ _ => norm_nonneg _) + exact Finset.prod_le_prod₀ (fun _ _ => norm_nonneg _) (fun _ _ => ContinuousLinearMap.norm_fst_le ℝ Space ℝ) _ ≤ C := by simpa only [Finset.prod_const_one,mul_one] using hb a.1 have hleft := ContinuousLinearMap.norm_iteratedFDeriv_comp_left (𝕜 := ℝ) (E := LiftTangent) diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderJetGraphTrace.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderJetGraphTrace.lean index ef15df9df6..a3aedb1c16 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderJetGraphTrace.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderJetGraphTrace.lean @@ -70,7 +70,7 @@ theorem angularJet_memLp_and_bound (hf : ContDiff ℝ ∞ f) (n : ℕ) ‖fieldDerivative P (0,1) (fun x => jetSeries P f x n) q‖ ≤ ‖jetSeries P f q (n+1)‖ := Eventually.of_forall (angularJet_bound P f hperiod n) exact ⟨hLp.of_le hc.aestronglyMeasurable hb, - ENNReal.toReal_mono hLp.eLpNorm_ne_top (eLpNorm_mono_ae hb)⟩ + ENNReal.toReal_mono hLp.eLpNorm_ne_top (eLpNorm_mono_ae hc.aestronglyMeasurable hb)⟩ variable [CompleteSpace W] diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderJetLp.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderJetLp.lean index fcedd06e31..78f8df4e49 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderJetLp.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderJetLp.lean @@ -81,6 +81,7 @@ theorem tensor_eLpNorm_le (f : LiftDomain P → V) (C : ℝ≥0∞) * eLpNorm (fun q => ∑ w : Fin n → Fin 4, ‖iteratedFieldDerivative P w f q‖) 2 (liftMeasure P) := by apply eLpNorm_le_nnreal_smul_eLpNorm_of_ae_le_mul + (tensor_continuous P f hf n).aestronglyMeasurable_of_secondCountable filter_upwards [] with q apply NNReal.coe_le_coe.mp change ‖tensor P f n q‖ ≤ ‖coordinateEquiv.symm.toContinuousLinearMap‖^n * @@ -92,10 +93,11 @@ theorem tensor_eLpNorm_le (f : LiftDomain P → V) funext q simp only [Finset.sum_apply] rw [he] at hA - have hB := eLpNorm_sum_le - (fun w (_ : w ∈ (Finset.univ : Finset (Fin n → Fin 4))) => (hLp w).1.norm) - (by norm_num : (1 : ℝ≥0∞) ≤ 2) - simp only [eLpNorm_norm] at hB + have hB : eLpNorm (∑ w : Fin n → Fin 4, fun q => ‖iteratedFieldDerivative P w f q‖) 2 + (liftMeasure P) ≤ + ∑ w : Fin n → Fin 4, eLpNorm (iteratedFieldDerivative P w f) 2 (liftMeasure P) := + (eLpNorm_sum_le (by norm_num : (1 : ℝ≥0∞) ≤ 2)).trans_eq + (Finset.sum_congr rfl fun w _ => eLpNorm_norm _ (hLp w).aestronglyMeasurable) have hC : (C : ℝ≥0∞) * ∑ w : Fin n → Fin 4, eLpNorm (iteratedFieldDerivative P w f) 2 (liftMeasure P) ≠ ⊤ := by apply ENNReal.mul_ne_top ENNReal.coe_ne_top diff --git a/LeanPool/NavierStokesAndEuler/Euler/CylinderPhysicalTensorLp.lean b/LeanPool/NavierStokesAndEuler/Euler/CylinderPhysicalTensorLp.lean index deb93c9ab8..9f86b1e311 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/CylinderPhysicalTensorLp.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/CylinderPhysicalTensorLp.lean @@ -67,6 +67,7 @@ theorem physicalTensorLp_norm_le : (β : ℝ≥0∞)*eLpNorm (fun x => ∑ w : Fin n → Fin 4, ‖iteratedFieldDerivative P w f (cylinderGraph P k m x)‖) 2 volume := by apply eLpNorm_le_nnreal_smul_eLpNorm_of_ae_le_mul + (physicalTensor_memLp P k m f hf n u hu).aestronglyMeasurable filter_upwards [] with x apply NNReal.coe_le_coe.mp change ‖iteratedFDeriv ℝ n (physicalField P k m f) x‖ ≤ @@ -80,9 +81,13 @@ theorem physicalTensorLp_norm_le : funext x simp only [Finset.sum_apply] rw [he] at hA - have hB := eLpNorm_sum_le (fun w (_ : w ∈ (Finset.univ : Finset (Fin n → Fin 4))) => - (graphWord_memLp P k m f n u hu w).1.norm) (by norm_num : (1 : ℝ≥0∞) ≤ 2) - simp only [eLpNorm_norm] at hB + have hB : eLpNorm (∑ w : Fin n → Fin 4, + fun x => ‖iteratedFieldDerivative P w f (cylinderGraph P k m x)‖) 2 volume ≤ + ∑ w : Fin n → Fin 4, + eLpNorm (fun x => iteratedFieldDerivative P w f (cylinderGraph P k m x)) 2 volume := + (eLpNorm_sum_le (by norm_num : (1 : ℝ≥0∞) ≤ 2)).trans_eq + (Finset.sum_congr rfl fun w _ => + eLpNorm_norm _ (graphWord_memLp P k m f n u hu w).aestronglyMeasurable) have hfinit : (β : ℝ≥0∞) * ∑ w : Fin n → Fin 4, eLpNorm (fun x => iteratedFieldDerivative P w f (cylinderGraph P k m x)) 2 volume ≠ ⊤ := by apply ENNReal.mul_ne_top ENNReal.coe_ne_top diff --git a/LeanPool/NavierStokesAndEuler/Euler/ExternalTransportCommutator.lean b/LeanPool/NavierStokesAndEuler/Euler/ExternalTransportCommutator.lean index fcaf27f672..9c7519e755 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ExternalTransportCommutator.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ExternalTransportCommutator.lean @@ -90,7 +90,7 @@ theorem memLp_norm_of_domination {E F : Type*} [NormedAddCommGroup E] [NormedAdd (eLpNorm f 2 (liftMeasure period)).toReal ≤ c*(eLpNorm g 2 (liftMeasure period)).toReal := by have hm := hg.of_le_mul hf h refine ⟨hm, ?_⟩ - have hh := eLpNorm_le_mul_eLpNorm_of_ae_le_mul h (2 : ℝ≥0∞) + have hh := eLpNorm_le_mul_eLpNorm_of_ae_le_mul hf h (2 : ℝ≥0∞) have hfin : ENNReal.ofReal c * eLpNorm g 2 (liftMeasure period) ≠ ⊤ := by finiteness have hh' := ENNReal.toReal_mono hfin hh simpa only [ENNReal.toReal_mul, ENNReal.toReal_ofReal hc] using hh' @@ -153,7 +153,7 @@ theorem fieldL2_add_le {E : Type*} [NormedAddCommGroup E] (eLpNorm (f+g) 2 (liftMeasure period)).toReal ≤ (eLpNorm f 2 (liftMeasure period)).toReal+(eLpNorm g 2 (liftMeasure period)).toReal := by have h := ENNReal.toReal_mono (ENNReal.add_ne_top.mpr ⟨hf.eLpNorm_ne_top, hg.eLpNorm_ne_top⟩) - (eLpNorm_add_le hf.1 hg.1 (by norm_num : (1 : ℝ≥0∞) ≤ 2)) + (eLpNorm_add_le (by norm_num : (1 : ℝ≥0∞) ≤ 2)) simpa only [ENNReal.toReal_add hf.eLpNorm_ne_top hg.eLpNorm_ne_top] using h end EulerMixedH5Product diff --git a/LeanPool/NavierStokesAndEuler/Euler/FiniteGradeAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/FiniteGradeAlgebra.lean index eea9aa1bf3..e72f7a2a94 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/FiniteGradeAlgebra.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/FiniteGradeAlgebra.lean @@ -6,7 +6,7 @@ Authors: OpenAI module -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.Algebra.BigOperators.Group.Finset.Defs public import Mathlib.Algebra.Module.LinearMap.Defs public import Mathlib.Order.Interval.Finset.Nat diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderAlgebra.lean index 61b2c9303e..2032ad1a7b 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderAlgebra.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderAlgebra.lean @@ -217,6 +217,8 @@ theorem product_word_L2_le {n : ℕ} (hn : n ≤ 6) (w : Fin n → Fin 4) := by have hq := productEnvelope_memLp period f g hfL2 hgL2 have hA := eLpNorm_le_mul_eLpNorm_of_ae_le_mul (μ := liftMeasure period) + ((smoothField_continuous period _ (iteratedFieldDerivative_smooth period w (f*g) + (product_smooth period f g hf hg))).aestronglyMeasurable) (Filter.Eventually.of_forall (fun x => show ‖iteratedFieldDerivative period w (f*g) x‖ ≤ (64 * lowDerivativeConstant period) * ‖productEnvelope period f g x‖ by rw [Real.norm_of_nonneg (productEnvelope_nonneg period f g x)] diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderCoordinates.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderCoordinates.lean index f57b4a0b40..9d3e3a6813 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderCoordinates.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderCoordinates.lean @@ -173,23 +173,26 @@ theorem eLpNorm_cover_chart {F : Type*} [NormedAddCommGroup F] (6 : ℝ≥0∞) ^ (1/2 : ℝ) * eLpNorm f 2 (liftMeasure period) := by rw [eLpNorm_comp_measurePreserving (hf.smul_measure _) (euclideanCover_chart_measurePreserving period)] - rw [eLpNorm_smul_measure_of_ne_top (by norm_num)] + rw [eLpNorm_smul_measure_of_ne_top (by norm_num) _ _ hf] norm_num /-- A localized lift is controlled by the genuine cylinder norm, with explicit chart multiplicity. -/ theorem eLpNorm_localized_le {F G : Type*} [NormedAddCommGroup F] [NormedAddCommGroup G] (f : LiftDomain period → F) (hf : AEStronglyMeasurable f (liftMeasure period)) - (g : Domain 4 → G) (hsupp : Function.support g ⊆ ({z : EulerSobolev.Domain 4 | |z 0| ≤ 2 * + (g : Domain 4 → G) (hg : AEStronglyMeasurable g volume) + (hsupp : Function.support g ⊆ ({z : EulerSobolev.Domain 4 | |z 0| ≤ 2 * period})) (B : ℝ≥0) (hb : ∀ z, ‖g z‖ ≤ B * ‖f (euclideanCover period z)‖) : eLpNorm g 2 volume ≤ (B : ℝ≥0∞) * (6 : ℝ≥0∞) ^ (1/2 : ℝ) * eLpNorm f 2 (liftMeasure period) := by - rw [← eLpNorm_restrict_eq_of_support_subset hsupp] + have hgchart : AEStronglyMeasurable g (chartMeasure period) := + AEStronglyMeasurable.sum_measure (fun _ => hg.restrict) + rw [← eLpNorm_restrict_eq_of_support_subset hg hsupp] calc _ ≤ eLpNorm g 2 (chartMeasure period) := eLpNorm_mono_measure g (chartSupport_measure_le period) _ ≤ (B : ℝ≥0∞) * eLpNorm (f ∘ euclideanCover period) 2 (chartMeasure period) := - eLpNorm_le_nnreal_smul_eLpNorm_of_ae_le_mul (Filter.Eventually.of_forall hb) 2 + eLpNorm_le_nnreal_smul_eLpNorm_of_ae_le_mul hgchart (Filter.Eventually.of_forall hb) 2 _ = _ := by rw [eLpNorm_cover_chart period f hf, mul_assoc] /-- The localized-lift estimate as an inequality between ordinary real L² norms. -/ @@ -199,7 +202,8 @@ theorem localized_L2_le {F : Type*} [NormedAddCommGroup F] period})) (B : ℝ≥0) (hb : ∀ z, ‖g z‖ ≤ B * ‖f (euclideanCover period z)‖) : ‖g.toLp 2‖ ≤ (B : ℝ) * (6 : ℝ) ^ (1/2 : ℝ) * ‖hf.toLp f‖ := by - have h := eLpNorm_localized_le period f hf.1 g hsupp B hb + have h := eLpNorm_localized_le period f hf.aestronglyMeasurable g + g.continuous.aestronglyMeasurable hsupp B hb have hfin : (B : ℝ≥0∞) * (6 : ℝ≥0∞) ^ (1/2 : ℝ) * eLpNorm f 2 (liftMeasure period) ≠ ⊤ := by finiteness diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderGradient.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderGradient.lean index ed91e0fa09..7368a26c54 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderGradient.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderGradient.lean @@ -109,7 +109,7 @@ theorem fieldFDeriv_L2_le_coordinate_sum (f : LiftDomain period → F) have hA : eLpNorm (fieldFDeriv period f) 2 (liftMeasure period) ≤ eLpNorm (fun x => ∑ i : Fin 4, ‖fieldDerivative period (standardDirection i) f x‖) 2 (liftMeasure period) := by - apply eLpNorm_mono + apply eLpNorm_mono (fieldFDeriv_memLp_of_coordinates period f hf hD).aestronglyMeasurable intro x rw [Real.norm_of_nonneg (Finset.sum_nonneg (fun _ _ => norm_nonneg _))] exact fieldFDeriv_norm_le_standard_sum period f x @@ -117,9 +117,12 @@ theorem fieldFDeriv_L2_le_coordinate_sum (f : LiftDomain period → F) ∑ i : Fin 4, (fun x => ‖fieldDerivative period (standardDirection i) f x‖) := by funext x; simp rw [he] at hA - have hB := eLpNorm_sum_le (fun i (_ : i ∈ (Finset.univ : Finset (Fin 4))) => (hD i).1.norm) - (by norm_num : (1 : ℝ≥0∞) ≤ 2) - simp only [eLpNorm_norm] at hB + have hB : eLpNorm (∑ i : Fin 4, fun x => ‖fieldDerivative period (standardDirection i) f x‖) 2 + (liftMeasure period) ≤ + ∑ i : Fin 4, + eLpNorm (fieldDerivative period (standardDirection i) f) 2 (liftMeasure period) := + (eLpNorm_sum_le (by norm_num : (1 : ℝ≥0∞) ≤ 2)).trans_eq + (Finset.sum_congr rfl fun i _ => eLpNorm_norm _ (hD i).aestronglyMeasurable) have hC := ENNReal.toReal_mono (ENNReal.sum_ne_top.2 (fun i _ => (hD i).eLpNorm_ne_top)) (hA.trans hB) rw [ENNReal.toReal_sum (fun i _ => (hD i).eLpNorm_ne_top)] at hC diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderSobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderSobolev.lean index 14f3286661..3e7f2cb00f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderSobolev.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/CylinderSobolev.lean @@ -206,9 +206,8 @@ theorem eLpNorm_wordMagnitude_le (n : ℕ) (f : LiftDomain period → F) funext x simp [wordMagnitude] rw [he] - simpa only [eLpNorm_norm] using eLpNorm_sum_le - (fun w (_ : w ∈ (Finset.univ : Finset (Fin n → Fin 4))) => (hf w).1.norm) - (by norm_num : (1 : ℝ≥0∞) ≤ 2) + exact (eLpNorm_sum_le (by norm_num : (1 : ℝ≥0∞) ≤ 2)).trans_eq + (Finset.sum_congr rfl fun w _ => eLpNorm_norm _ (hf w).aestronglyMeasurable) theorem totalMagnitude_memLp (s : ℕ) (f : LiftDomain period → F) (hf : ∀ n ≤ s, ∀ w : Fin n → Fin 4, @@ -228,9 +227,7 @@ theorem totalMagnitude_L2_le (s : ℕ) (f : LiftDomain period → F) have hA : eLpNorm (totalMagnitude period s f) 2 (liftMeasure period) ≤ ∑ n ∈ Finset.range (s+1), eLpNorm (wordMagnitude period n f) 2 (liftMeasure period) := by rw [he] - exact eLpNorm_sum_le (fun n hn => - (wordMagnitude_memLp period n f (hf n (by - simpa using Finset.mem_range.1 hn))).1) (by norm_num) + exact eLpNorm_sum_le (by norm_num) have hB : (∑ n ∈ Finset.range (s+1), eLpNorm (wordMagnitude period n f) 2 (liftMeasure period)) ≤ ∑ n ∈ Finset.range (s+1), ∑ w : Fin n → Fin 4, eLpNorm (iteratedFieldDerivative period w f) 2 (liftMeasure period) := by @@ -380,7 +377,7 @@ theorem localized_directional_L2_le (n : ℕ) (i : Fin 4) (f : LiftDomain period (directional 4 n (EuclideanSpace.single i 1) (localized period f hf x)) (directional_localized_support period n i f hf x) (bumpCoefficient period n) hb have hnorm : ‖hqt.toLp (translated period q x)‖ = ‖hq.toLp q‖ := by - simp only [Lp.norm_toLp, eLpNorm_translated period q hq.1] + simp only [Lp.norm_toLp, eLpNorm_translated period q hq.aestronglyMeasurable] rw [hnorm] at hA exact hA.trans (mul_le_mul_of_nonneg_left (totalMagnitude_L2_le period n f hfL2) (mul_nonneg (bumpCoefficient period n).coe_nonneg (Real.rpow_nonneg (by norm_num) _))) diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/DeformationVolume.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/DeformationVolume.lean index b0dcb0caf3..4cc98d9ca0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/DeformationVolume.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/DeformationVolume.lean @@ -39,7 +39,8 @@ theorem determinant_hasDerivAt (F M : ℝ → Matrix (Fin 3) (Fin 3) ℝ) (t : have hd := h'.congr_deriv (g' := (M t).trace * (F t).det) (by simp only [Pi.mul_apply, mul_apply, Fin.sum_univ_three, trace, diag, det_fin_three] ring) - convert hd using 1 <;> first | rfl | (funext s; exact det_fin_three (F s)) + convert hd using 1 + first | rfl | (funext s; exact det_fin_three (F s)) /-- A trace-free velocity gradient preserves the actual deformation determinant. -/ theorem determinant_eq_one (F M : ℝ → Matrix (Fin 3) (Fin 3) ℝ) (a b : ℝ) diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/Gevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/Gevrey.lean index bdf4f1128c..f58fb78cf8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/Gevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/Gevrey.lean @@ -6,7 +6,7 @@ Authors: OpenAI module -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.Algebra.BigOperators.Group.Finset.Defs public import Mathlib.Data.Nat.Choose.Basic import Mathlib.Algebra.Order.Star.Real diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/MollifierRepresentative.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/MollifierRepresentative.lean index 42644e8868..719bc03223 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/MollifierRepresentative.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/MollifierRepresentative.lean @@ -189,7 +189,7 @@ theorem finite_set_integral_norm_le (f : LiftDomain period → Vector3) (∫ x in K, ‖f x‖ ∂liftMeasure period) ≤ (eLpNorm f 2 (liftMeasure period)).toReal * (liftMeasure period K).toReal ^ (1/2 : ℝ) := by have hA := eLpNorm_le_eLpNorm_mul_rpow_measure_univ (p := (1 : ℝ≥0∞)) (q := 2) - (by norm_num) (hf.restrict K).1 + (by norm_num) (hf.restrict K).aestronglyMeasurable norm_num only [ENNReal.toReal_one, ENNReal.toReal_ofNat, one_div, inv_one, Measure.restrict_apply_univ] at hA have hB : eLpNorm f 2 ((liftMeasure period).restrict K) * (liftMeasure period K)^(1/2 : ℝ) ≤ @@ -198,7 +198,8 @@ theorem finite_set_integral_norm_le (f : LiftDomain period → Vector3) have hfin : eLpNorm f 2 (liftMeasure period) * (liftMeasure period K) ^ (1/2 : ℝ) ≠ ⊤ := by finiteness have hC := ENNReal.toReal_mono hfin (hA.trans hB) - rw [integral_norm_eq_lintegral_enorm (hf.restrict K).1, ← eLpNorm_one_eq_lintegral_enorm] + rw [integral_norm_eq_lintegral_enorm (hf.restrict K).aestronglyMeasurable, + ← eLpNorm_one_eq_lintegral_enorm (hf.restrict K).aestronglyMeasurable] convert hC using 1 simp only [ENNReal.toReal_mul, ← ENNReal.toReal_rpow] diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/NoncompactTransport.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/NoncompactTransport.lean index 83cf505891..d48b44d9fd 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/NoncompactTransport.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/NoncompactTransport.lean @@ -94,7 +94,8 @@ theorem spatialCutoff_fderiv (n : ℕ) (x : LiftDomain period) (v : LiftTangent) have hi : HasFDerivAt (fun h : LiftTangent => cutoffScale n • (x.1 + h.1)) (cutoffScale n • ContinuousLinearMap.fst ℝ Vector3 ℝ) 0 := by convert ((ContinuousLinearMap.fst ℝ Vector3 ℝ).hasFDerivAt.const_add x.1).const_smul - (cutoffScale n) using 1 <;> rfl + (cutoffScale n) using 1 + rfl have ho := ((spatialBump.contDiff : ContDiff ℝ ∞ spatialBump).differentiable (by simp)).differentiableAt.hasFDerivAt (x := cutoffScale n • (x.1 + (0 : LiftTangent).1)) have h := ho.comp 0 hi diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketWeights.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketWeights.lean index ca332af015..36768b6cc6 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketWeights.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PacketWeights.lean @@ -7,7 +7,7 @@ Authors: OpenAI module import Mathlib.Data.Nat.Choose.Cast -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.Data.Nat.Choose.Basic import Mathlib.Analysis.Normed.Field.Basic import Mathlib.Tactic.Bound diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PressureJetIdentities.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PressureJetIdentities.lean index e4eab5ad8e..f4b0d83dc4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PressureJetIdentities.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PressureJetIdentities.lean @@ -92,7 +92,8 @@ def map (L : LiftL2 period →L[ℝ] LiftL2 period) | .succ df lower hd => .succ (fun i => L (df i)) (fun i => map L hL (lower i)) (fun i => by have h := L.hasFDerivAt.comp_hasDerivAt 0 (hd i) - convert h using 1 <;> first | rfl | (funext t; exact hL _ _)) + convert h using 1 + first | rfl | (funext t; exact hL _ _)) theorem map_word {s n : ℕ} {f : LiftL2 period} (J : EulerSpatialSobolevInverse.SpatialJet period directions s f) diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PressureSpatialRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PressureSpatialRegularity.lean index 98310207fb..4d3b670c2d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/PressureSpatialRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/PressureSpatialRegularity.lean @@ -366,8 +366,6 @@ theorem liftedPressure_hasDerivAt (κ : ℝ) (m : Vector3) have hval := S.subtypeL.hasFDerivAt.comp_hasDerivAt 0 hsol convert hval using 1 · rfl - · rfl - · rfl · simp [liftedPressure, pressureSolver, projectedInverse, projectedOperator, S, G, G', ContinuousLinearMap.comp_apply, map_sub] diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/RealCylinder.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/RealCylinder.lean index 67c43275a3..1e7234ff39 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/RealCylinder.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/RealCylinder.lean @@ -64,9 +64,13 @@ variable [Fact (0 < period)] theorem complexField_eLpNorm (f : LiftDomain period → ℝ) : eLpNorm (complexField period f) 2 (liftMeasure period) = eLpNorm f 2 (liftMeasure period) := by - apply eLpNorm_congr_norm_ae - filter_upwards [] with x - exact Complex.norm_real _ + by_cases hf : AEStronglyMeasurable f (liftMeasure period) + · refine eLpNorm_congr_norm_ae (Complex.continuous_ofReal.comp_aestronglyMeasurable hf) hf ?_ + filter_upwards [] with x + exact Complex.norm_real _ + · have hf' : ¬ AEStronglyMeasurable (complexField period f) (liftMeasure period) := fun h => + hf (Complex.continuous_re.comp_aestronglyMeasurable h) + rw [eLpNorm_of_not_aestronglyMeasurable hf, eLpNorm_of_not_aestronglyMeasurable hf'] theorem complexField_memLp (f : LiftDomain period → ℝ) (hf : MemLp f 2 (liftMeasure period)) : MemLp (complexField period f) 2 (liftMeasure period) := diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SmoothSobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SmoothSobolev.lean index 4d437a4a98..7317a03bd8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SmoothSobolev.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SmoothSobolev.lean @@ -49,7 +49,7 @@ theorem fourier_pureDerivative_norm (d n : ℕ) (v : Domain d) simp only [smul_apply, SchwartzMap.smulLeftCLM_apply_apply ht, norm_smul] have hc : ‖(2 * Real.pi * Complex.I : ℂ)‖ = 2 * Real.pi := by - simp [Real.pi_pos.le] + simp rw [hc, ih, pow_succ, pow_succ] ring @@ -61,7 +61,8 @@ noncomputable def normLp (d : ℕ) (f : 𝓢(Domain d, F)) : omit [CompleteSpace F] in theorem norm_normLp (d : ℕ) (f : 𝓢(Domain d, F)) : ‖normLp d f‖ = ‖f.toLp 2‖ := by - simp only [normLp, Lp.norm_toLp, eLpNorm_norm, SchwartzMap.norm_toLp] + simp only [normLp, Lp.norm_toLp, eLpNorm_norm _ f.continuous.aestronglyMeasurable, + SchwartzMap.norm_toLp] omit [CompleteSpace F] in theorem coe_normLp (d : ℕ) (f : 𝓢(Domain d, F)) : @@ -179,8 +180,9 @@ theorem derivativeMagnitude_L2_le (s : ℕ) (f : Domain 3 → F) have hA : eLpNorm (derivativeMagnitude s f) 2 volume ≤ ∑ j ∈ Finset.range (s+1), eLpNorm (iteratedFDeriv ℝ j f) 2 volume := by rw [he] - simpa only [eLpNorm_norm] using eLpNorm_sum_le (fun j hj => - (hfL2 j (by have := Finset.mem_range.1 hj; omega)).1.norm) (by norm_num : (1 : ℝ≥0∞) ≤ 2) + exact (eLpNorm_sum_le (by norm_num : (1 : ℝ≥0∞) ≤ 2)).trans_eq + (Finset.sum_congr rfl fun j hj => eLpNorm_norm _ + (hfL2 j (by have := Finset.mem_range.1 hj; omega)).aestronglyMeasurable) have hfin (j : ℕ) (hj : j ∈ Finset.range (s+1)) : eLpNorm (iteratedFDeriv ℝ j f) 2 volume ≠ ⊤ := (hfL2 j (by have := Finset.mem_range.1 hj; omega)).eLpNorm_ne_top have hB := ENNReal.toReal_mono (ENNReal.sum_ne_top.2 hfin) hA @@ -269,14 +271,15 @@ theorem localize_pureDerivative_L2_le (n : ℕ) (i : Fin 3) (f : Domain 3 → F) simp only [PiLp.norm_single, norm_one, Finset.prod_const_one, mul_one] at hA exact hA.trans (localize_tensor_bound n f hf x z) have hA := eLpNorm_le_nnreal_smul_eLpNorm_of_ae_le_mul (μ := (volume : Measure (Domain 3))) - (Filter.Eventually.of_forall hb) 2 + (pureDerivative 3 n (EuclideanSpace.single i 1) + (localize f hf x)).continuous.aestronglyMeasurable (Filter.Eventually.of_forall hb) 2 have hfin : (unitBumpCoefficient n : ℝ≥0∞) * eLpNorm (fun z => derivativeMagnitude n f (x+z)) 2 volume ≠ ⊤ := by finiteness have hB := ENNReal.toReal_mono hfin hA have he : eLpNorm (fun z => derivativeMagnitude n f (x+z)) 2 volume = eLpNorm (derivativeMagnitude n f) 2 volume := by - simpa only [Function.comp_def] using eLpNorm_comp_measurePreserving (p := (2 : ℝ≥0∞)) hq.1 - htrans + simpa only [Function.comp_def] using + eLpNorm_comp_measurePreserving (p := (2 : ℝ≥0∞)) hq.aestronglyMeasurable htrans rw [he] at hB simp only [ENNReal.toReal_mul, ENNReal.coe_toReal] at hB rw [SchwartzMap.norm_toLp] @@ -369,7 +372,9 @@ theorem coordinateDerivative_H2_le_H3 (i : Fin 3) (f : Domain 3 → F) intro j hj have hj3 : j+1 ≤ 3 := by have := Finset.mem_range.1 hj; omega have hB := ENNReal.toReal_mono (hfL2 (j+1) hj3).eLpNorm_ne_top - (eLpNorm_mono (coordinateDerivative_tensor_bound j i f hf)) + (eLpNorm_mono + (coordinateDerivative_tensor_memLp i f hf (hfL2 (j+1) hj3)).aestronglyMeasurable + (coordinateDerivative_tensor_bound j i f hf)) have hC : (eLpNorm (iteratedFDeriv ℝ (j+1) f) 2 volume).toReal ≤ tensorSobolevNorm 3 f := Finset.single_le_sum (f := fun k => (eLpNorm (iteratedFDeriv ℝ k f) 2 volume).toReal) (fun _ _ => ENNReal.toReal_nonneg) (Finset.mem_range.2 (by omega)) @@ -439,7 +444,11 @@ theorem complexification_sobolevNorm (q s : ℕ) (f : Domain 3 → Domain q) apply Finset.sum_congr rfl intro j _ congr 1 - exact eLpNorm_congr_norm_ae (Filter.Eventually.of_forall (complexification_tensor_norm q j f hf)) + exact eLpNorm_congr_norm_ae + (((complexify q).contDiff.comp hf).continuous_iteratedFDeriv + (by simp : (j : ℕ∞ω) ≤ (∞ : ℕ∞ω))).aestronglyMeasurable + (hf.continuous_iteratedFDeriv (by simp : (j : ℕ∞ω) ≤ (∞ : ℕ∞ω))).aestronglyMeasurable + (Filter.Eventually.of_forall (complexification_tensor_norm q j f hf)) /-- Real vector-valued H³ to C¹ on R³, for general smooth functions with actual L² derivatives. -/ theorem real_smooth_fderiv_le_H3 (q : ℕ) (f : Domain 3 → Domain q) (hf : ContDiff ℝ ∞ f) diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/Sobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/Sobolev.lean index 54ae173175..fc0783066a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/Sobolev.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/Sobolev.lean @@ -64,7 +64,8 @@ theorem fourier_L1_le_sobolevNorm (d : ℕ) (s : ℝ) (hs : (d : ℝ) < 2 * s) ext ξ simp only [Pi.smul_apply', weightedFourier_apply, smul_smul, besselWeight_neg_mul, one_smul] have hh := eLpNorm_smul_le_mul_eLpNorm (p := 2) (q := 2) (r := 1) - ((weightedFourier d s f).memLp 2 volume).1 (reciprocal_weight_memLp d s hs).1 + (reciprocal_weight_memLp d s hs).aestronglyMeasurable + ((weightedFourier d s f).memLp 2 volume).aestronglyMeasurable rw [hid] at hh have hfin : eLpNorm (besselWeight d (-s)) 2 volume * eLpNorm (weightedFourier d s f) 2 volume ≠ ⊤ := @@ -94,7 +95,7 @@ theorem fourier_lineDeriv_norm_le (d : ℕ) (f : 𝓢(Domain d, F)) (m ξ : Doma rw [SchwartzMap.fourier_lineDerivOp_eq] simp [SchwartzMap.smulLeftCLM_apply_apply ht] have hc : ‖(2 * Real.pi * Complex.I : ℂ)‖ = 2 * Real.pi := by - simp [Real.pi_pos.le] + simp rw [he, norm_smul, norm_smul, hc] have hi := norm_inner_le_norm (𝕜 := ℝ) ξ m nlinarith [mul_le_mul_of_nonneg_left diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SobolevDerivativeNorm.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SobolevDerivativeNorm.lean index e1aa9821b6..1cfb0532ea 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SobolevDerivativeNorm.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SobolevDerivativeNorm.lean @@ -63,7 +63,7 @@ theorem multilinear_norm_le_coordinate_sum {F : Type*} [NormedAddCommGroup F] [N apply Finset.sum_le_sum intro w _ apply mul_le_mul_of_nonneg_right _ (norm_nonneg _) - exact Finset.prod_le_prod (fun _ _ => norm_nonneg _) (fun j _ => PiLp.norm_apply_le (m j) (w + exact Finset.prod_le_prod₀ (fun _ _ => norm_nonneg _) (fun j _ => PiLp.norm_apply_le (m j) (w j)) _ = _ := by rw [← Finset.mul_sum]; ring diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SobolevProducts.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SobolevProducts.lean index a77e7d7472..4758c7a6d0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SobolevProducts.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SobolevProducts.lean @@ -122,7 +122,7 @@ theorem fourier_directional_norm (d n : ℕ) (v : Domain d) simp only [smul_apply, SchwartzMap.smulLeftCLM_apply_apply ht, norm_smul] have hc : ‖(2 * Real.pi * Complex.I : ℂ)‖ = 2 * Real.pi := by - simp [Real.pi_pos.le] + simp rw [hc, ih, pow_succ, pow_succ] ring @@ -133,7 +133,8 @@ noncomputable def normLp (d : ℕ) (f : 𝓢(Domain d, ℂ)) : theorem norm_normLp (d : ℕ) (f : 𝓢(Domain d, ℂ)) : ‖normLp d f‖ = ‖f.toLp 2‖ := by - simp only [normLp, Lp.norm_toLp, eLpNorm_norm, SchwartzMap.norm_toLp] + simp only [normLp, Lp.norm_toLp, eLpNorm_norm _ f.continuous.aestronglyMeasurable, + SchwartzMap.norm_toLp] theorem coe_normLp (d : ℕ) (f : 𝓢(Domain d, ℂ)) : (normLp d f : Domain d → ℝ) =ᵐ[volume] (fun x => ‖f x‖) := diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SpatialSobolevInverse.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SpatialSobolevInverse.lean index 0f50b57a96..dfcf92048c 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/SpatialSobolevInverse.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/SpatialSobolevInverse.lean @@ -174,7 +174,8 @@ theorem product_hasDerivAt (A B : SmoothCoefficient period) (a : LiftTangent) simp [translatedCoefficient] rw [hop0] at hprod simp only [translationPath_zero, translation_zero] at hprod - convert hprod using 1 <;> first | rfl | exact add_comm _ _ + convert hprod using 1 + first | rfl | exact add_comm _ _ theorem pressure_hasDerivAt (A B : SmoothCoefficient period) (a : LiftTangent) (hB : ∀ x, B.coefficient x = fieldDerivative period a A.coefficient x) @@ -266,7 +267,8 @@ def add {n : ℕ} {f g : LiftL2 period} | .zero _, .zero _ => .zero (f + g) | .succ df Jd hJ, .succ dg Kd hK => .succ (fun i => df i + dg i) (fun i => (Jd i).add (Kd i)) (fun i => by - convert (hJ i).add (hK i) using 1 <;> first | rfl | (funext t; simp)) + convert (hJ i).add (hK i) using 1 + first | rfl | (funext t; simp)) /-- Subtraction preserves the actual strong derivatives recorded in a spatial jet. -/ def sub {n : ℕ} {f g : LiftL2 period} @@ -276,7 +278,8 @@ def sub {n : ℕ} {f g : LiftL2 period} | .zero _, .zero _ => .zero (f - g) | .succ df Jd hJ, .succ dg Kd hK => .succ (fun i => df i - dg i) (fun i => (Jd i).sub (Kd i)) (fun i => by - convert (hJ i).sub (hK i) using 1 <;> first | rfl | (funext t; simp)) + convert (hJ i).sub (hK i) using 1 + first | rfl | (funext t; simp)) theorem add_norm_le {n : ℕ} {f g : LiftL2 period} (J : SpatialJet period directions n f) (K : SpatialJet period directions n g) : diff --git a/LeanPool/NavierStokesAndEuler/Euler/Foundations/VectorCylinder.lean b/LeanPool/NavierStokesAndEuler/Euler/Foundations/VectorCylinder.lean index e20d0367fc..8606880aa4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/Foundations/VectorCylinder.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/Foundations/VectorCylinder.lean @@ -53,7 +53,8 @@ theorem postcomp_sobolevNorm_le (s : ℕ) (L : F →L[ℝ] G) (hL : ‖L‖ ≤ intro w _ rw [iteratedFieldDerivative_postcomp period L w f hf] apply ENNReal.toReal_mono (hfL2 n (by have := Finset.mem_range.1 hn; omega) w).eLpNorm_ne_top - apply eLpNorm_mono + apply eLpNorm_mono (L.continuous.comp_aestronglyMeasurable + (hfL2 n (by have := Finset.mem_range.1 hn; omega) w).aestronglyMeasurable) intro x have h := L.le_opNorm (iteratedFieldDerivative period w f x) exact h.trans ((mul_le_mul_of_nonneg_right hL (norm_nonneg _)).trans_eq (one_mul _)) @@ -101,9 +102,13 @@ theorem vector_eLpNorm_le_sum_coordinates (q : ℕ) (f : LiftDomain period → D (hf : ∀ i : Fin q, MemLp (fun x => f x i) 2 (liftMeasure period)) : eLpNorm f 2 (liftMeasure period) ≤ ∑ i : Fin q, eLpNorm (fun x => f x i) 2 (liftMeasure period) := by + have hfm : AEStronglyMeasurable f (liftMeasure period) := by + have h : AEMeasurable (fun x => WithLp.ofLp (f x)) (liftMeasure period) := + aemeasurable_pi_iff.2 fun i => (hf i).aemeasurable + exact ((WithLp.measurable_toLp 2 (Fin q → ℝ)).comp_aemeasurable h).aestronglyMeasurable have hA : eLpNorm f 2 (liftMeasure period) ≤ eLpNorm (fun x => ∑ i : Fin q, ‖f x i‖) 2 (liftMeasure period) := by - apply eLpNorm_mono + apply eLpNorm_mono hfm intro x rw [Real.norm_of_nonneg (Finset.sum_nonneg (fun _ _ => norm_nonneg _))] exact norm_le_sum_coordinates q (f x) @@ -111,9 +116,11 @@ theorem vector_eLpNorm_le_sum_coordinates (q : ℕ) (f : LiftDomain period → D funext x simp rw [he] at hA - have hB := eLpNorm_sum_le - (fun i (_ : i ∈ (Finset.univ : Finset (Fin q))) => (hf i).1.norm) (by norm_num : (1 : ℝ≥0∞) ≤ 2) - simpa only [eLpNorm_norm] using hA.trans hB + have hB : eLpNorm (∑ i : Fin q, fun x => ‖f x i‖) 2 (liftMeasure period) ≤ + ∑ i : Fin q, eLpNorm (fun x => f x i) 2 (liftMeasure period) := + (eLpNorm_sum_le (by norm_num : (1 : ℝ≥0∞) ≤ 2)).trans_eq + (Finset.sum_congr rfl fun i _ => eLpNorm_norm _ (hf i).aestronglyMeasurable) + exact hA.trans hB theorem vector_word_L2_le_sum_coordinates {s n : ℕ} (hn : n ≤ s) (q : ℕ) (w : Fin n → Fin 4) (f : LiftDomain period → Domain q) (hf : ∀ x, ContDiff ℝ ∞ (localFieldLift period f x)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/GeneralCylinderAlgebra.lean b/LeanPool/NavierStokesAndEuler/Euler/GeneralCylinderAlgebra.lean index 2fb72154d7..368fec3f2f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GeneralCylinderAlgebra.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GeneralCylinderAlgebra.lean @@ -249,6 +249,8 @@ theorem product_word_L2_le {q n : ℕ} (hq : 6 ≤ q) (hn : n ≤ q) (w : Fin n liftSobolevNorm period q f * liftSobolevNorm period q g := by have henv := productEnvelope_memLp period q f g hfL2 hgL2 have hA := eLpNorm_le_mul_eLpNorm_of_ae_le_mul (μ := liftMeasure period) + ((smoothField_continuous period _ (iteratedFieldDerivative_smooth period w (f * g) + (EulerCylinderAlgebra.product_smooth period f g hf hg))).aestronglyMeasurable) (Filter.Eventually.of_forall (fun x => show ‖iteratedFieldDerivative period w (f * g) x‖ ≤ ((2 : ℝ) ^ q * lowDerivativeConstant period q) * ‖productEnvelope period q f g x‖ by rw [Real.norm_of_nonneg (productEnvelope_nonneg period q f g x)] diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyComposition.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyComposition.lean index cd3c0944fb..9cba934db4 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyComposition.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyComposition.lean @@ -60,7 +60,7 @@ theorem norm_taylorComp_le _ ≤ (A * S^c.length * (c.length.factorial : ℝ)^2) * (∏ i, B * R^(c.partSize i) * ((c.partSize i).factorial : ℝ)^2) := by apply mul_le_mul (hq _ c.length_le) - · apply Finset.prod_le_prod + · apply Finset.prod_le_prod₀ · intro i _ exact norm_nonneg _ · intro i _ diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyCompositionLp.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyCompositionLp.lean index af64f8df60..e3a18e5bc0 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyCompositionLp.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyCompositionLp.lean @@ -65,7 +65,7 @@ theorem composition_partition_bound (f : E → E) (g : E → F) c.norm_compAlongOrderedFinpartition_le _ _ _ ≤ ‖iteratedFDeriv ℝ c.length g (f x)‖*innerPartitionBound B R c := by apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) - exact Finset.prod_le_prod (fun i _ => norm_nonneg _) + exact Finset.prod_le_prod₀ (fun i _ => norm_nonneg _) (fun i _ => hfjet _ (c.partSize_pos i) (c.partSize_le i)) _ = _ := mul_comm _ _ @@ -109,15 +109,12 @@ theorem composition_memLp_and_bound have he : (fun x => ∑ c : OrderedFinpartition n, H c x) = ∑ c : OrderedFinpartition n, H c := by funext x simp only [Finset.sum_apply] - have hsumNorm := eLpNorm_sum_le - (fun c (_ : c ∈ (Finset.univ : Finset (OrderedFinpartition n))) => (hHLp - c).aestronglyMeasurable) - (by norm_num : (1 : ℝ≥0∞) ≤ 2) have hLpNorm : eLpNorm (iteratedFDeriv ℝ n (g ∘ f)) 2 μ ≤ ∑ c : OrderedFinpartition n, eLpNorm (H c) 2 μ := by - apply (eLpNorm_mono_ae_real (Filter.Eventually.of_forall hdom)).trans + apply (eLpNorm_mono_ae_real hcompLp.aestronglyMeasurable + (Filter.Eventually.of_forall hdom)).trans rw [he] - exact hsumNorm + exact eLpNorm_sum_le (by norm_num : (1 : ℝ≥0∞) ≤ 2) have hreal := ENNReal.toReal_mono (ENNReal.sum_ne_top.mpr (fun c _ => (hHLp c).eLpNorm_ne_top)) hLpNorm rw [ENNReal.toReal_sum (fun c _ => (hHLp c).eLpNorm_ne_top)] at hreal @@ -128,7 +125,8 @@ theorem composition_memLp_and_bound ((fun y => ‖iteratedFDeriv ℝ c.length g y‖) ∘ f) := rfl rw [hfun, eLpNorm_const_smul, eLpNorm_comp_measurePreserving (hgLp c.length c.length_le).aestronglyMeasurable.norm hmp, - eLpNorm_norm, ENNReal.toReal_mul, toReal_enorm, + eLpNorm_norm _ (hgLp c.length c.length_le).aestronglyMeasurable, + ENNReal.toReal_mul, toReal_enorm, Real.norm_of_nonneg (innerPartitionBound_nonneg B R hB hR c)] simp_rw [hHnorm] at hreal calc diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyCorrectionForcing.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyCorrectionForcing.lean index 3f53a737df..ba7964a6b8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyCorrectionForcing.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyCorrectionForcing.lean @@ -63,8 +63,9 @@ theorem fieldL2_sum_le {ι F : Type*} [NormedAddCommGroup F] (S : Finset ι) (f : ι → LiftDomain period → F) (hf : ∀ i ∈ S, MemLp (f i) 2 (liftMeasure period)) : (eLpNorm (∑ i ∈ S, f i) 2 (liftMeasure period)).toReal ≤ ∑ i ∈ S, (eLpNorm (f i) 2 (liftMeasure period)).toReal := by - have he := eLpNorm_sum_le (fun i hi => (hf i hi).aestronglyMeasurable) (by - norm_num : (1 : ℝ≥0∞) ≤ 2) + have he : eLpNorm (∑ i ∈ S, f i) 2 (liftMeasure period) ≤ + ∑ i ∈ S, eLpNorm (f i) 2 (liftMeasure period) := + eLpNorm_sum_le (by norm_num : (1 : ℝ≥0∞) ≤ 2) have hfin : (∑ i ∈ S, eLpNorm (f i) 2 (liftMeasure period)) ≠ ⊤ := ENNReal.sum_ne_top.mpr (fun i hi => (hf i hi).eLpNorm_ne_top) have h := ENNReal.toReal_mono hfin he diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyGeneratingDerivatives.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyGeneratingDerivatives.lean index 2107e3ea7f..2dc6eb7f63 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyGeneratingDerivatives.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyGeneratingDerivatives.lean @@ -241,7 +241,7 @@ theorem norm_taylorComp_le_coefficient _ ≤ ((c.length.factorial : ℝ)^2*q.coeff c.length) * ∏ i, ((c.partSize i).factorial : ℝ)^2*p.coeff (c.partSize i) := by apply mul_le_mul (hQ _ (c.length_pos hn) c.length_le) - · exact Finset.prod_le_prod (fun i _ => norm_nonneg _) + · exact Finset.prod_le_prod₀ (fun i _ => norm_nonneg _) (fun i _ => hP _ (c.partSize_pos i) (c.partSize_le i)) · exact Finset.prod_nonneg (fun i _ => norm_nonneg _) · exact mul_nonneg (sq_nonneg _) (hq _) diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyInverseMap.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyInverseMap.lean index 351bf47d38..8d9e4440bd 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyInverseMap.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyInverseMap.lean @@ -233,7 +233,7 @@ theorem norm_taylorComp_predecessor_le _ ≤ (A * S^c.length * (c.length.factorial : ℝ)^2) * (∏ i, B * R^(c.partSize i) * ((c.partSize i-1).factorial : ℝ)^2) := by apply mul_le_mul (hq _ c.length_le) - · apply Finset.prod_le_prod + · apply Finset.prod_le_prod₀ · intro i _ exact norm_nonneg _ · intro i _ diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyJetCompositionLp.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyJetCompositionLp.lean index 732eb94a77..f3b045c467 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyJetCompositionLp.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyJetCompositionLp.lean @@ -45,7 +45,7 @@ theorem taylorComp_partition_bound _ ≤ ‖Q c.length‖*∏ i, ‖P (c.partSize i)‖ := c.norm_compAlongOrderedFinpartition_le _ _ _ ≤ ‖Q c.length‖*innerPartitionBound B R c := by apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) - exact Finset.prod_le_prod (fun i _ => norm_nonneg _) + exact Finset.prod_le_prod₀ (fun i _ => norm_nonneg _) (fun i _ => hP _ (c.partSize_pos i) (c.partSize_le i)) _ = _ := mul_comm _ _ @@ -82,15 +82,12 @@ theorem composition_memLp_and_bound have he : (fun x => ∑ c : OrderedFinpartition n, H c x) = ∑ c : OrderedFinpartition n, H c := by funext x simp only [Finset.sum_apply] - have hsumNorm := eLpNorm_sum_le - (fun c (_ : c ∈ (Finset.univ : Finset (OrderedFinpartition n))) => (hHLp - c).aestronglyMeasurable) - (by norm_num : (1 : ℝ≥0∞) ≤ 2) have hLpNorm : eLpNorm (fun x => (Q (φ x)).taylorComp (P x) n) 2 μ ≤ ∑ c : OrderedFinpartition n, eLpNorm (H c) 2 μ := by - apply (eLpNorm_mono_ae_real (Filter.Eventually.of_forall hdom)).trans + apply (eLpNorm_mono_ae_real hcompLp.aestronglyMeasurable + (Filter.Eventually.of_forall hdom)).trans rw [he] - exact hsumNorm + exact eLpNorm_sum_le (by norm_num : (1 : ℝ≥0∞) ≤ 2) have hreal := ENNReal.toReal_mono (ENNReal.sum_ne_top.mpr (fun c _ => (hHLp c).eLpNorm_ne_top)) hLpNorm rw [ENNReal.toReal_sum (fun c _ => (hHLp c).eLpNorm_ne_top)] at hreal @@ -100,7 +97,8 @@ theorem composition_memLp_and_bound have hfun : H c = innerPartitionBound B R c • ((fun y => ‖Q y c.length‖) ∘ φ) := rfl rw [hfun, eLpNorm_const_smul, eLpNorm_comp_measurePreserving (hQLp c.length c.length_le).aestronglyMeasurable.norm hφ, - eLpNorm_norm, ENNReal.toReal_mul, toReal_enorm, + eLpNorm_norm _ (hQLp c.length c.length_le).aestronglyMeasurable, + ENNReal.toReal_mul, toReal_enorm, Real.norm_of_nonneg (innerPartitionBound_nonneg B R hB hR c)] simp_rw [hHnorm] at hreal calc diff --git a/LeanPool/NavierStokesAndEuler/Euler/GevreyProductLp.lean b/LeanPool/NavierStokesAndEuler/Euler/GevreyProductLp.lean index 5745ab4a83..fa362036ca 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/GevreyProductLp.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/GevreyProductLp.lean @@ -47,9 +47,9 @@ theorem finite_domination {ι : Type*} (μ : Measure X) (I : Finset ι) funext x simp only [Finset.sum_apply] have hn : eLpNorm f 2 μ ≤ ∑ i ∈ I, eLpNorm (H i) 2 μ := by - apply (eLpNorm_mono_ae_real (Eventually.of_forall hdom)).trans + apply (eLpNorm_mono_ae_real hf (Eventually.of_forall hdom)).trans rw [he] - exact eLpNorm_sum_le (fun i hi => (hH i hi).aestronglyMeasurable) (by norm_num) + exact eLpNorm_sum_le (by norm_num) have hr := ENNReal.toReal_mono (ENNReal.sum_ne_top.mpr (fun i hi => (hH i hi).eLpNorm_ne_top)) hn rwa [ENNReal.toReal_sum (fun i hi => (hH i hi).eLpNorm_ne_top)] at hr @@ -85,8 +85,9 @@ theorem clm_apply_memLp_and_bound have hHnorm (j : ℕ) : (eLpNorm (H j) 2 μ).toReal = a j*(eLpNorm (fun x => iteratedFDeriv ℝ (n-j) g (σ x)) 2 μ).toReal := by have he : H j = a j • (fun x => ‖iteratedFDeriv ℝ (n-j) g (σ x)‖) := rfl - rw [he,eLpNorm_const_smul,eLpNorm_norm,ENNReal.toReal_mul,toReal_enorm,Real.norm_of_nonneg (ha - j)] + rw [he,eLpNorm_const_smul, + eLpNorm_norm _ (hLp (n-j) (Nat.sub_le n j)).aestronglyMeasurable, + ENNReal.toReal_mul,toReal_enorm,Real.norm_of_nonneg (ha j)] simp_rw [hHnorm] calc _ ≤ ∑ j ∈ Finset.range (n+1), a j*(C*majorant R e (n-j)) := diff --git a/LeanPool/NavierStokesAndEuler/Euler/H6NonlinearProduct.lean b/LeanPool/NavierStokesAndEuler/Euler/H6NonlinearProduct.lean index 6dc82a4bd0..b305d5c326 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/H6NonlinearProduct.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/H6NonlinearProduct.lean @@ -110,7 +110,7 @@ theorem sobolev_add_le (q : ℕ) (f g : LiftDomain period → F) have hfj := hfL2 j (by have := Finset.mem_range.1 hj; omega) w have hgj := hgL2 j (by have := Finset.mem_range.1 hj; omega) w have he := ENNReal.toReal_mono (ENNReal.add_ne_top.2 ⟨hfj.eLpNorm_ne_top, hgj.eLpNorm_ne_top⟩) - (eLpNorm_add_le hfj.1 hgj.1 (by norm_num : (1 : ℝ≥0∞) ≤ 2)) + (eLpNorm_add_le (by norm_num : (1 : ℝ≥0∞) ≤ 2)) simpa only [ENNReal.toReal_add hfj.eLpNorm_ne_top hgj.eLpNorm_ne_top] using he /-- Sum of actual Hq norms of all external derivative words of exactly order n. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/InitialH1OperatorProduct.lean b/LeanPool/NavierStokesAndEuler/Euler/InitialH1OperatorProduct.lean index fb93392cf5..4902c39067 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/InitialH1OperatorProduct.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/InitialH1OperatorProduct.lean @@ -129,7 +129,7 @@ theorem constantFieldOperator_ae (x : E) : theorem initialPrimitive_constantFieldOperator (x : E) (t : Icc (0 : ℝ) T) : initialPrimitive T hT (constantFieldOperator T hT x) t = (t : ℝ) • x := by have hlin : AbsolutelyContinuousOnInterval (fun s : ℝ => s • x) 0 T := - (toSpanSingleton ℝ x).lipschitz.lipschitzOnWith.absolutelyContinuousOnInterval + (toSpanSingleton ℝ x).lipschitzWith.lipschitzOnWith.absolutelyContinuousOnInterval apply Eq.symm apply eq_initialRealPrimitive_of_ac_hasDerivAt_ae T hT (constantFieldOperator T hT x) (fun s : ℝ => s • x) hlin _ (zero_smul ℝ x) t t.property diff --git a/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamel.lean b/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamel.lean index 4fcceb6419..a6a3135597 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamel.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LinearDuhamel.lean @@ -182,10 +182,9 @@ theorem solution_unique (f : C(Icc (0 : ℝ) T, E)) (a₀ : E) (a : ℝ → E) have hd := (U.backward_derivative ⟨s,hs⟩).clm_apply ((ha ⟨s,hs⟩).sub (U.solution_derivative f a₀ ⟨s,hs⟩)) convert hd using 1 - · rfl - · simp only [neg_apply, comp_apply, extendPath, projIcc_of_mem hT hs, - Pi.sub_apply, map_sub, map_add, solution, ContinuousMap.coe_mk] - abel + simp only [neg_apply, comp_apply, extendPath, projIcc_of_mem hT hs, + Pi.sub_apply, map_sub, map_add, solution, ContinuousMap.coe_mk] + abel have hconst : q t = q 0 := by have hbound := Convex.norm_image_sub_le_of_norm_hasDerivWithin_le (C := 0) hq (fun s hs => by simp) (convex_Icc (0 : ℝ) T) diff --git a/LeanPool/NavierStokesAndEuler/Euler/LowerTransportSource.lean b/LeanPool/NavierStokesAndEuler/Euler/LowerTransportSource.lean index cdb9cf34cf..d13ab0e7d8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LowerTransportSource.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LowerTransportSource.lean @@ -143,6 +143,8 @@ theorem product_word_L2_le {q n : ℕ} (hq : 5 ≤ q) (hn : n ≤ q) (w : Fin n liftSobolevNorm period q f * liftSobolevNorm period q g := by have henv := productEnvelope_memLp period q f g hfL2 hgL2 have hA := eLpNorm_le_mul_eLpNorm_of_ae_le_mul (μ := liftMeasure period) + ((smoothField_continuous period _ (iteratedFieldDerivative_smooth period w (f * g) + (EulerCylinderAlgebra.product_smooth period f g hf hg))).aestronglyMeasurable) (Filter.Eventually.of_forall (fun x => show ‖iteratedFieldDerivative period w (f * g) x‖ ≤ ((2 : ℝ) ^ q * lowDerivativeConstant period q) * ‖productEnvelope period q f g x‖ by rw [Real.norm_of_nonneg (productEnvelope_nonneg period q f g x)] diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderCoefficients.lean b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderCoefficients.lean index c17bddc4bd..7707c6f60d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderCoefficients.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderCoefficients.lean @@ -190,7 +190,7 @@ theorem mixedOperator_bound (B : SmoothCoefficientPath (Icc (0 : ℝ) T) (V →L calc _ ≤ ‖iteratedFDeriv ℝ n f a.1‖ * ∏ _i : Fin n, (1 : ℝ) := by apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) - exact Finset.prod_le_prod (fun _ _ => norm_nonneg _) (fun _ _ => + exact Finset.prod_le_prod₀ (fun _ _ => norm_nonneg _) (fun _ _ => ContinuousLinearMap.norm_fst_le ℝ Space ℝ) _ ≤ C := by simpa only [Finset.prod_const_one, mul_one] using B.norm_iteratedFDeriv_translation_le n diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRectangularRegularity.lean b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRectangularRegularity.lean index 4c82db51d1..d5de4dd0f3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRectangularRegularity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRectangularRegularity.lean @@ -175,7 +175,7 @@ theorem mixedMultiplier_bound (n : ℕ) (C : ℝ) calc _ ≤ ‖iteratedFDeriv ℝ n f a.1‖ * ∏ _i : Fin n, (1 : ℝ) := by apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) - exact Finset.prod_le_prod (fun _ _ => norm_nonneg _) + exact Finset.prod_le_prod₀ (fun _ _ => norm_nonneg _) (fun _ _ => ContinuousLinearMap.norm_fst_le ℝ Space ℝ) _ ≤ C := by simpa only [Finset.prod_const_one,mul_one] using hb a.1 have hleft := ContinuousLinearMap.norm_iteratedFDeriv_comp_left (𝕜 := ℝ) (E := LiftTangent) diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRegularCoefficient.lean b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRegularCoefficient.lean index 9efae388ff..77f13235c1 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRegularCoefficient.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpCylinderRegularCoefficient.lean @@ -95,7 +95,7 @@ theorem mixedCoefficient_bound (n : ℕ) (C : ℝ) calc _ ≤ ‖iteratedFDeriv ℝ n f a.1‖ * ∏ _i : Fin n, (1 : ℝ) := by apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) - exact Finset.prod_le_prod (fun _ _ => norm_nonneg _) (fun _ _ => + exact Finset.prod_le_prod₀ (fun _ _ => norm_nonneg _) (fun _ _ => ContinuousLinearMap.norm_fst_le ℝ Space ℝ) _ ≤ C := by simpa only [Finset.prod_const_one,mul_one] using hb a.1 have hleft := ContinuousLinearMap.norm_iteratedFDeriv_comp_left (𝕜 := ℝ) (E := LiftTangent) diff --git a/LeanPool/NavierStokesAndEuler/Euler/LpSmoothField.lean b/LeanPool/NavierStokesAndEuler/Euler/LpSmoothField.lean index 4f995a5720..561d5f7818 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/LpSmoothField.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/LpSmoothField.lean @@ -112,13 +112,16 @@ theorem translation_contDiff (A : SmoothL2Field V) : theorem norm_jetLp_zero (A : SmoothL2Field V) : ‖A.jetLp 0‖ = ‖A.toLp‖ := by simp only [jetLp, toLp, Lp.norm_toLp] congr 1 - exact eLpNorm_congr_norm_ae (Eventually.of_forall (fun x => norm_iteratedFDeriv_zero)) + exact eLpNorm_congr_norm_ae (A.integrable 0).aestronglyMeasurable + A.memLp.aestronglyMeasurable (Eventually.of_forall (fun x => norm_iteratedFDeriv_zero)) theorem norm_derivative_jetLp (A : SmoothL2Field V) (n : ℕ) : ‖A.derivative.jetLp n‖ = ‖A.jetLp (n+1)‖ := by simp only [jetLp, Lp.norm_toLp] congr 1 - exact eLpNorm_congr_norm_ae (Eventually.of_forall (fun x => norm_iteratedFDeriv_fderiv)) + exact eLpNorm_congr_norm_ae (A.derivative.integrable n).aestronglyMeasurable + (A.integrable (n + 1)).aestronglyMeasurable + (Eventually.of_forall (fun x => norm_iteratedFDeriv_fderiv)) private theorem norm_iteratedFDeriv_translation_aux (n : ℕ) : ∀ (V : Type u) [NormedAddCommGroup V] [NormedSpace ℝ V] (A : SmoothL2Field V) (a : Space), diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryOperator.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryOperator.lean index 4984c91834..a1ff551c7d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryOperator.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanBoundaryOperator.lean @@ -135,7 +135,7 @@ theorem cutoffBound_nonneg (χ : Cutoff) : 0 ≤ cutoffBound χ := by theorem testCurl_bound (χ : Cutoff) (f : Test) : ‖testCurlLinear χ f‖ ≤ cutoffBound χ * ‖homogeneousGradient f‖ := by change ‖testCurl χ f‖ ≤ _ - rw [testCurl, Lp.norm_toLp, toReal_eLpNorm (testCurl_memLp χ f).aestronglyMeasurable] + rw [testCurl, Lp.norm_toLp, toReal_eLpNorm] calc _ ≤ cutoffCurlConstant * (lpNorm χ.field ∞ volume + lpNorm (gradient χ.field) 3 volume) * diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanCutoffCurlBound.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanCutoffCurlBound.lean index 851397e25b..54f4abd576 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanCutoffCurlBound.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanCutoffCurlBound.lean @@ -44,8 +44,7 @@ theorem homogeneous_sobolev (f : Space → Space) (hf.of_le (by simp)) hfc simpa only [sobolevConstant, NavierStokesAndEuler.SobolevThreeDimensional.sobolevConstant, - toReal_eLpNorm hf.continuous.aestronglyMeasurable, - toReal_eLpNorm (hf.continuous_fderiv (by simp)).aestronglyMeasurable] using h + toReal_eLpNorm] using h /-- A three-vector's Euclidean norm is at most the sum of its component norms. -/ theorem norm_le_sum_coordinates (v : Space) : ‖v‖ ≤ ∑ i : Fin 3, ‖v i‖ := by @@ -90,15 +89,16 @@ theorem lpNorm_norm_mul_le {E F : Type*} [NormedAddCommGroup E] [NormedAddCommGr {f : Space → E} {g : Space → F} {p q r : ℝ≥0∞} [ENNReal.HolderTriple p q r] (hf : MemLp f p volume) (hg : MemLp g q volume) : lpNorm (fun x => ‖f x‖ * ‖g x‖) r volume ≤ lpNorm f p volume * lpNorm g q volume := by - have h := eLpNorm_le_eLpNorm_mul_eLpNorm'_of_norm (p := p) (q := q) (r := r) - hf.aestronglyMeasurable hg.aestronglyMeasurable (fun a b => ‖a‖ * ‖b‖) 1 - (Filter.Eventually.of_forall fun x => by simp) + have hfm := hf.aestronglyMeasurable + have hgm := hg.aestronglyMeasurable + have h : eLpNorm (fun x => ‖f x‖ * ‖g x‖) r volume ≤ + eLpNorm f p volume * eLpNorm g q volume := by + have h0 := eLpNorm_smul_le_mul_eLpNorm (𝕜 := ℝ) (p := p) (q := q) (r := r) + hfm.norm hgm.norm + rw [eLpNorm_norm _ hfm, eLpNorm_norm _ hgm] at h0 + exact h0 have hr := ENNReal.toReal_mono (by finiteness [hf.eLpNorm_ne_top, hg.eLpNorm_ne_top]) h - have hm : AEStronglyMeasurable (fun x => ‖f x‖ * ‖g x‖) volume := - hf.aestronglyMeasurable.norm.mul hg.aestronglyMeasurable.norm - simpa [ENNReal.toReal_mul, ENNReal.coe_toReal, NNReal.coe_one, one_mul, - toReal_eLpNorm hm, - toReal_eLpNorm hf.aestronglyMeasurable, toReal_eLpNorm hg.aestronglyMeasurable] using hr + simpa only [ENNReal.toReal_mul, toReal_eLpNorm] using hr /-- Smooth compactly supported vector fields have square-integrable actual curl. -/ theorem vectorCurl_memLp (f : Space → Space) (hf : ContDiff ℝ ∞ f) @@ -129,8 +129,8 @@ theorem cutoff_curl_lpNorm_le (ψ : Space → ℝ) (φ : Space → Space) (hφ.fderiv_right (m := ∞) (by simp)).continuous.memLp_of_hasCompactSupport (hφc.fderiv ℝ) let a : Space → ℝ := fun x => ‖ψ x‖ * ‖fderiv ℝ φ x‖ let b : Space → ℝ := fun x => ‖fderiv ℝ ψ x‖ * ‖φ x‖ - have ha : MemLp a 2 volume := hφd.norm.mul' hψm.norm - have hb : MemLp b 2 volume := hφm.norm.mul' hψd.norm + have ha : MemLp a 2 volume := hψm.norm.fun_mul hφd.norm + have hb : MemLp b 2 volume := hψd.norm.fun_mul hφm.norm have hg : MemLp (fun x => 6 * (a x + b x)) 2 volume := (ha.add hb).const_mul 6 calc lpNorm (vectorCurl (fun x => ψ x • φ x)) 2 volume ≤ @@ -208,7 +208,7 @@ theorem integral_cutoff_curl_bound (ψ : Space → ℝ) (φ : Space → Space) vectorCurl_memLp _ hprod hpc let v : Lp Space 2 (volume : Measure Space) := hm.toLp _ have hv : ‖v‖ = lpNorm (vectorCurl (fun y => ψ y • φ y)) 2 volume := by - rw [Lp.norm_toLp, toReal_eLpNorm hm.aestronglyMeasurable] + rw [Lp.norm_toLp, toReal_eLpNorm] have he : (∫ x, inner ℝ (z x) (vectorCurl (fun y => ψ y • φ y) x)) = inner ℝ z v := by rw [L2.inner_def] apply integral_congr_ae diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanCutoffDifferenceBound.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanCutoffDifferenceBound.lean index f9292daaea..5e215dd5ef 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanCutoffDifferenceBound.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanCutoffDifferenceBound.lean @@ -30,7 +30,7 @@ theorem lpNorm_translated {E : Type*} [NormedAddCommGroup E] have hm := measurePreserving_add_right (volume : Measure Space) a have hfc : AEStronglyMeasurable (fun x => f (x+a)) volume := hf.aestronglyMeasurable.comp_measurePreserving hm - rw [← toReal_eLpNorm hfc, ← toReal_eLpNorm hf.aestronglyMeasurable] + rw [← toReal_eLpNorm, ← toReal_eLpNorm] exact congrArg ENNReal.toReal (eLpNorm_comp_measurePreserving hf.aestronglyMeasurable hm) theorem cutoffBound_translate (χ : Cutoff) (a : Space) : @@ -145,20 +145,23 @@ theorem lpNorm_le_bound_volume {E : Type*} [NormedAddCommGroup E] lpNorm f p volume ≤ C * (volume K).toReal ^ (1 / p.toReal) := by have he : eLpNorm f p volume ≤ ENNReal.ofReal C * volume K ^ (1 / p.toReal) := by calc - _ ≤ eLpNorm (K.indicator (fun _ : Space => C)) p volume := by - apply eLpNorm_mono + _ ≤ eLpNorm ((toMeasurable volume K).indicator (fun _ : Space => C)) p volume := by + apply eLpNorm_mono hf intro x - by_cases hx : x ∈ K + by_cases hx : x ∈ toMeasurable volume K · simpa only [Set.indicator_of_mem hx, Real.norm_eq_abs, abs_of_nonneg hC] using hbound x - · simp only [Set.indicator_of_notMem hx, hzero x hx, norm_zero, le_refl] + · simp only [Set.indicator_of_notMem hx, + hzero x (fun hxK => hx (subset_toMeasurable volume K hxK)), norm_zero, le_refl] _ ≤ _ := by - simpa only [← ofReal_norm, Real.norm_eq_abs, abs_of_nonneg hC] using - (eLpNorm_indicator_const_le (μ := (volume : Measure Space)) (s := K) C p) + simpa only [← ofReal_norm, Real.norm_eq_abs, abs_of_nonneg hC, measure_toMeasurable] using + (eLpNorm_indicator_const_le (μ := (volume : Measure Space)) + (s := toMeasurable volume K) C p + (measurableSet_toMeasurable volume K).nullMeasurableSet) have hfinite : ENNReal.ofReal C * volume K ^ (1 / p.toReal) ≠ (∞ : ℝ≥0∞) := by exact ENNReal.mul_ne_top ENNReal.ofReal_ne_top (ENNReal.rpow_ne_top_of_nonneg (by positivity) hK) have H := ENNReal.toReal_mono hfinite he - simpa only [toReal_eLpNorm hf, ENNReal.toReal_mul, ENNReal.toReal_ofReal hC, + simpa only [toReal_eLpNorm, ENNReal.toReal_mul, ENNReal.toReal_ofReal hC, ENNReal.toReal_rpow] using H /-- The classical mean value inequality bounds a directional difference quotient uniformly. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanGradientTestSpace.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanGradientTestSpace.lean index 48e44d72bc..2f613fb3fb 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanGradientTestSpace.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanGradientTestSpace.lean @@ -127,7 +127,7 @@ theorem lpNorm_fderiv_le_gradient (f : Test) : _ = ∑ i : Fin 3, ‖derivativeColumn f i‖ := by apply Finset.sum_congr rfl intro i _ - rw [derivativeColumn, Lp.norm_toLp, toReal_eLpNorm (f.column_memLp i).aestronglyMeasurable] + rw [derivativeColumn, Lp.norm_toLp, toReal_eLpNorm] exact lpNorm_norm (f.column_memLp i).aestronglyMeasurable 2 _ ≤ ∑ _i : Fin 3, ‖testGradient f‖ := Finset.sum_le_sum (fun i _ => PiLp.norm_apply_le (testGradient f) i) diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanLocalL2Energy.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanLocalL2Energy.lean index f806b9b39c..d71cdc4fa8 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanLocalL2Energy.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanLocalL2Energy.lean @@ -27,7 +27,7 @@ open MeasureTheory InnerProductSpace EulerSmoothLimit EulerMeanSolenoidal def localL2Energy (s : Set Space) (u : L2) : ℝ := ∫ x in s, ‖u x‖ ^ 2 theorem lpNorm_coe_L2 (u : L2) : lpNorm (u : Space → Space) 2 volume = ‖u‖ := by - rw [Lp.norm_def, toReal_eLpNorm (Lp.memLp u).aestronglyMeasurable] + rw [Lp.norm_def, toReal_eLpNorm] theorem integrable_norm_sq_L2 (u : L2) : Integrable (fun x => ‖u x‖ ^ 2) volume := (memLp_two_iff_integrable_sq (Lp.memLp u).norm.aestronglyMeasurable).1 (Lp.memLp u).norm diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketForcing.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketForcing.lean index e403d5c85d..76391c6545 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanPacketForcing.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanPacketForcing.lean @@ -303,7 +303,7 @@ theorem forcing_translation_jet_bound (T : ℝ) (A : ℝ → SmoothL2Field V) have h := (forcingFamily T A hA).norm_iteratedFDeriv_value_le n a have hn : ‖(forcingFamily T A hA).bound n‖ = ‖(hA n).toLp (fun t => (A t).jetLp n)‖ := by change ‖(hA n).norm.toLp (fun t => ‖(A t).jetLp n‖)‖ = _ - simp only [Lp.norm_toLp, eLpNorm_norm] + simp only [Lp.norm_toLp, eLpNorm_norm _ (hA n).aestronglyMeasurable] exact (congrArg (fun g : Space → TimeLp T (L2Space V) => ‖iteratedFDeriv ℝ n g a‖) he).trans_le (h.trans_eq hn) diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanScalarSobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanScalarSobolev.lean index 2fb6b634f1..f4f197f5d3 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanScalarSobolev.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanScalarSobolev.lean @@ -40,8 +40,9 @@ theorem partialDerivative_twice (f : Space → ℝ) (hf : ContDiff ℝ ∞ f) theorem complex_eLpNorm_toReal (f : Space → ℝ) (hf : AEStronglyMeasurable f volume) : (eLpNorm (fun x => (f x : ℂ)) 2 volume).toReal = lpNorm f 2 volume := by have he : eLpNorm (fun x => (f x : ℂ)) 2 volume = eLpNorm f 2 volume := - eLpNorm_congr_norm_ae (Filter.Eventually.of_forall fun x => by simp) - rw [he, toReal_eLpNorm hf] + eLpNorm_congr_norm_ae (Complex.continuous_ofReal.comp_aestronglyMeasurable hf) hf + (Filter.Eventually.of_forall fun x => by simp) + rw [he, toReal_eLpNorm] /-- This is the existing Fourier Sobolev estimate applied to the actual scalar function and its actual twofold coordinate derivatives, with no embedding @@ -88,7 +89,7 @@ theorem lpNorm_sq_eq_integral_norm_sq {V : Type*} [NormedAddCommGroup V] [InnerProductSpace ℝ V] (f : Space → V) (hf : MemLp f 2 volume) : (lpNorm f 2 volume) ^ 2 = ∫ x, ‖f x‖ ^ 2 := by have hn : ‖hf.toLp f‖ = lpNorm f 2 volume := by - rw [Lp.norm_toLp, toReal_eLpNorm hf.aestronglyMeasurable] + rw [Lp.norm_toLp, toReal_eLpNorm] rw [← hn, ← real_inner_self_eq_norm_sq, MeasureTheory.L2.inner_def] apply integral_congr_ae filter_upwards [hf.coeFn_toLp] with x hx diff --git a/LeanPool/NavierStokesAndEuler/Euler/MeanVectorIdentities.lean b/LeanPool/NavierStokesAndEuler/Euler/MeanVectorIdentities.lean index 66766c88d4..115681fd76 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MeanVectorIdentities.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MeanVectorIdentities.lean @@ -158,10 +158,8 @@ theorem vectorCurl_vectorCurl (f : Space → Space) (hf : ContDiff ℝ ∞ f) : have h₂ : d 2 1 2 = d 2 2 1 := hcomm 2 1 2 x linarith · norm_num [Fin.sum_univ_three, Fin.add_def] - change d 0 2 0 - d 2 0 0 - (d 2 1 1 - d 1 2 1) = - d 0 0 2 + d 1 1 2 + d 2 2 2 - (d 2 0 0 + d 2 1 1 + d 2 2 2) - have h₁ : d 0 2 0 = d 0 0 2 := hcomm 0 2 0 x - have h₂ : d 1 2 1 = d 1 1 2 := hcomm 1 2 1 x + have h₁ := hcomm 0 2 0 x + have h₂ := hcomm 1 2 1 x linarith theorem divergence_compact (f : Space → Space) (hf : ContDiff ℝ ∞ f) diff --git a/LeanPool/NavierStokesAndEuler/Euler/MetricHeatEnergy.lean b/LeanPool/NavierStokesAndEuler/Euler/MetricHeatEnergy.lean index 5a067cdefe..3a09ad6849 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/MetricHeatEnergy.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/MetricHeatEnergy.lean @@ -89,7 +89,8 @@ theorem metric_product_hasDerivAt (K : SmoothCoefficient period) (a : LiftTangen simp [translatedCoefficient] rw [hop0] at hprod simp only [translationPath_zero, translation_zero] at hprod - convert hprod using 1 <;> first | rfl | exact add_comm _ _ + convert hprod using 1 + first | rfl | exact add_comm _ _ /-- Exact metric integration by parts for one genuine second translation derivative. -/ theorem metric_second_derivative_identity (K : SmoothCoefficient period) (a : LiftTangent) diff --git a/LeanPool/NavierStokesAndEuler/Euler/NonnegativeLogConvex.lean b/LeanPool/NavierStokesAndEuler/Euler/NonnegativeLogConvex.lean index a4efe2ee46..b7566c8726 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/NonnegativeLogConvex.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/NonnegativeLogConvex.lean @@ -6,7 +6,7 @@ Authors: OpenAI module -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic import Mathlib.Tactic.Bound import Mathlib.Tactic.Ring.RingNF diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerGradientControl.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerGradientControl.lean index e4213c2773..b5c3f40056 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerGradientControl.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryEulerGradientControl.lean @@ -196,7 +196,7 @@ theorem secondWord_product_gradient (A : SmoothL2Field Space) (K N : ℝ) rfl have hn (j : Fin 3) : (eLpNorm (fun x => ‖(C j).field x‖) 2 volume).toReal = ‖(C j).toLp‖ := by - rw [field_norm,eLpNorm_norm] + rw [field_norm,eLpNorm_norm _ (C j).memLp.aestronglyMeasurable] have h := (finite_domination (volume : Measure Space) univ B.field B.memLp.aestronglyMeasurable (fun j x => ‖(C j).field x‖) (fun j _ => (C j).memLp.norm) (fun x => by diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryL2Integration.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryL2Integration.lean index 30c8621782..b20e14140f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryL2Integration.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryL2Integration.lean @@ -70,7 +70,6 @@ theorem field_zero_of_toLp_zero (A : SmoothL2Field V) (h : A.toLp = 0) : A.field theorem field_zero_of_derivative_zero (A : SmoothL2Field Space) (hD : ∀ x, fderiv ℝ A.field x = 0) : A.field=0 := by - have h6 := memLp_six A.field A.smooth A.memLp A.derivative.memLp have hb := eLpNorm_six_le A.field A.smooth A.memLp A.derivative.memLp have hz : eLpNorm (fderiv ℝ A.field) 2 (volume : Measure Space)=0 := by calc @@ -80,8 +79,8 @@ theorem field_zero_of_derivative_zero (A : SmoothL2Field Space) (p := 2) (μ := (volume : Measure Space)) have hb0 : eLpNorm A.field 6 (volume : Measure Space) ≤ 0 := by exact hb.trans_eq (by rw [hz,mul_zero]) - have hae : A.field=ᵐ[volume] 0 := (eLpNorm_eq_zero_iff h6.aestronglyMeasurable - (by norm_num : (6 : ℝ≥0∞) ≠ 0)).mp (le_antisymm hb0 bot_le) + have hae : A.field=ᵐ[volume] 0 := + (eLpNorm_eq_zero_iff (by norm_num : (6 : ℝ≥0∞) ≠ 0)).mp (le_antisymm hb0 bot_le) exact Measure.eq_of_ae_eq hae A.smooth.continuous continuous_const theorem field_zero_of_laplacian_zero (A : SmoothL2Field Space) diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinarySmoothWords.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinarySmoothWords.lean index b487b0f657..7a799d8a2a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinarySmoothWords.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinarySmoothWords.lean @@ -98,7 +98,7 @@ theorem wordField_toLp_norm_le (A : SmoothL2Field V) {n : ℕ} (w : Fin n → Fi rw [Lp.norm_def,eLpNorm_congr_ae (wordField A w).toLp_ae, norm_jetLp] apply ENNReal.toReal_mono (A.integrable n).eLpNorm_ne_top - apply eLpNorm_mono + apply eLpNorm_mono (wordField A w).memLp.aestronglyMeasurable intro x rw [wordField_field] have h := (iteratedFDeriv ℝ n A.field x).le_opNorm (fun i => axis (w i)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinarySobolevL4.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinarySobolevL4.lean index 751cd2240d..b83f3fbc0d 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinarySobolevL4.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinarySobolevL4.lean @@ -64,10 +64,11 @@ theorem cube_memLp {f : Space → E} (h6 : MemLp f 6 volume) : theorem cube_norm {f : Space → E} (h6 : MemLp f 6 volume) : lpNorm (fun x => ‖f x‖^3) 2 volume=(lpNorm f 6 volume)^3 := by - have he := eLpNorm_norm_rpow (μ := (volume : Measure Space)) (p := 2) f (q := 3) (by norm_num) + have he := eLpNorm_norm_rpow (μ := (volume : Measure Space)) (p := 2) f + h6.aestronglyMeasurable (q := 3) (by norm_num) norm_num at he - rw [← toReal_eLpNorm (cube_memLp h6).aestronglyMeasurable,he,ENNReal.toReal_pow, - toReal_eLpNorm h6.aestronglyMeasurable] + rw [← toReal_eLpNorm,he,ENNReal.toReal_pow, + toReal_eLpNorm] private theorem square_domination (a z : ℝ) (ha : 0 < a) (hz : 0 ≤ z) : z^2 ≤ a*z+a⁻¹*z^3 := by @@ -133,10 +134,11 @@ theorem memLp_four {f : Space → E} (h2 : MemLp f 2 volume) (h6 : MemLp f 6 vol theorem norm_four_sq {f : Space → E} (h2 : MemLp f 2 volume) (h6 : MemLp f 6 volume) : (lpNorm f 4 volume)^2=lpNorm (fun x => ‖f x‖^2) 2 volume := by - have he := eLpNorm_norm_rpow (μ := (volume : Measure Space)) (p := 2) f (q := 2) (by norm_num) + have he := eLpNorm_norm_rpow (μ := (volume : Measure Space)) (p := 2) f + (memLp_four h2 h6).aestronglyMeasurable (q := 2) (by norm_num) norm_num at he - rw [← toReal_eLpNorm (square_memLp h2 h6).aestronglyMeasurable,he,ENNReal.toReal_pow, - toReal_eLpNorm (memLp_four h2 h6).aestronglyMeasurable] + rw [← toReal_eLpNorm (f := fun x => ‖f x‖^2),he,ENNReal.toReal_pow, + toReal_eLpNorm] theorem norm_four_le_two {f : Space → E} (h2 : MemLp f 2 volume) (h6 : MemLp f 6 volume) (a : ℝ) (ha : 0 ≤ a) (h2a : lpNorm f 2 volume ≤ a) (h6a : lpNorm f 6 volume ≤ a) : @@ -153,8 +155,7 @@ theorem smooth_four_bound (f : Space → V) (hf : ContDiff ℝ ∞ f) 2*(lpNorm f 2 volume+(sobolevConstant : ℝ)*lpNorm (fderiv ℝ f) 2 volume) := by have h6 := memLp_six f hf hL hD have h6b : lpNorm f 6 volume ≤ (sobolevConstant : ℝ)*lpNorm (fderiv ℝ f) 2 volume := by - simpa only [toReal_eLpNorm hf.continuous.aestronglyMeasurable, - toReal_eLpNorm hD.aestronglyMeasurable] using norm_six_le f hf hL hD + simpa only [toReal_eLpNorm] using norm_six_le f hf hL hD refine ⟨memLp_four hL h6,norm_four_le_two hL h6 _ (add_nonneg lpNorm_nonneg (mul_nonneg sobolevConstant.coe_nonneg lpNorm_nonneg)) ?_ ?_⟩ · exact le_add_of_nonneg_right (mul_nonneg sobolevConstant.coe_nonneg lpNorm_nonneg) @@ -173,10 +174,10 @@ theorem smooth_product_h1 (f : Space → ℝ) (g : Space → V) norm_num [ENNReal.toReal_add,ENNReal.toReal_inv]⟩ have h4f := smooth_four_bound f hf hfL hfD have h4g := smooth_four_bound g hg hgL hgD - refine ⟨h4g.1.smul h4f.1,?_⟩ + refine ⟨h4f.1.smul h4g.1,?_⟩ calc _ ≤ lpNorm (fun x => ‖f x‖*‖g x‖) 2 volume := by - apply lpNorm_mono_real (h4g.1.norm.mul' h4f.1.norm) + apply lpNorm_mono_real (h4f.1.norm.fun_mul h4g.1.norm) intro x exact (norm_smul (f x) (g x)).le _ ≤ lpNorm f 4 volume*lpNorm g 4 volume := lpNorm_norm_mul_le h4f.1 h4g.1 diff --git a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryWordBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryWordBounds.lean index 4249d91ece..f3f4523b00 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/OrdinaryWordBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/OrdinaryWordBounds.lean @@ -34,7 +34,7 @@ theorem jet_norm_le_word_sum (A : SmoothL2Field V) (n : ℕ) : ‖A.jetLp n‖ ≤ ∑ w : Fin n → Fin 3, ‖(wordField A w).toLp‖ := by let H : (Fin n → Fin 3) → Space → ℝ := fun w x => ‖(wordField A w).field x‖ have hn (w : Fin n → Fin 3) : (eLpNorm (H w) 2 volume).toReal = ‖(wordField A w).toLp‖ := by - rw [field_norm,eLpNorm_norm] + rw [field_norm,eLpNorm_norm _ (wordField A w).memLp.aestronglyMeasurable] have h := (finite_domination (volume : Measure Space) univ (iteratedFDeriv ℝ n A.field) (A.integrable n).aestronglyMeasurable H (fun w _ => (wordField A w).memLp.norm) ?_).2 · simpa only [norm_jetLp,hn] using h @@ -76,7 +76,7 @@ theorem wordBound_map {s : ℕ} {M : ℝ} {A : SmoothL2Field V} (by simpa only [one_mul] using h n hn w)) theorem field_lpNorm (A : SmoothL2Field V) : lpNorm A.field 2 volume = ‖A.toLp‖ := by - rw [field_norm,toReal_eLpNorm A.memLp.aestronglyMeasurable] + rw [field_norm,toReal_eLpNorm] theorem real_pointwise_H2 (A : SmoothL2Field Space) (x : Space) : ‖A.field x‖ ≤ smoothEmbeddingConstant*(∑ j ∈ range 3, ‖A.jetLp j‖) := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketFieldPhysicalSobolev.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketFieldPhysicalSobolev.lean index c61fba003c..9161a14e9f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketFieldPhysicalSobolev.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketFieldPhysicalSobolev.lean @@ -113,7 +113,7 @@ theorem WordBound.raw_graph_tensor_lpNorm_le (hG : G.WordBound q R A 0) have he : lpNorm (iteratedFDeriv ℝ n (G.toFieldTower.physicalPointField k m t)) 2 volume = ‖G.toFieldTower.physicalTensorValue k m n t‖ := by rw [Lp.norm_def,eLpNorm_congr_ae (G.toFieldTower.physicalTensorValue_ae k m n t), - toReal_eLpNorm (G.toFieldTower.physicalTensor_memLp k m n t).aestronglyMeasurable] + toReal_eLpNorm] change lpNorm (iteratedFDeriv ℝ n (G.toFieldTower.physicalPointField k m t)) 2 volume ≤ _ rw [he] exact (G.toFieldTower.physicalTensorValue_norm_le k m n t).trans diff --git a/LeanPool/NavierStokesAndEuler/Euler/PacketTimeProfiles.lean b/LeanPool/NavierStokesAndEuler/Euler/PacketTimeProfiles.lean index 68d5d3e798..4df0cfab4a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PacketTimeProfiles.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PacketTimeProfiles.lean @@ -6,7 +6,7 @@ Authors: OpenAI module public import Mathlib.Topology.ContinuousMap.Compact -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic import Mathlib.Algebra.Order.Star.Real meta import Lean.Meta.Tactic.NormCast import Mathlib.Tactic.Bound diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParameterWordGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/ParameterWordGevrey.lean index b242c331bb..fc16196908 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParameterWordGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParameterWordGevrey.lean @@ -44,7 +44,7 @@ theorem wordDerivative_norm (directions : ι → P) (hd : ∀ i, ‖directions i (f : P → E) {n : ℕ} (w : Fin n → ι) (x : P) : ‖wordDerivative directions f w x‖ ≤ ‖iteratedFDeriv ℝ n f x‖ := by have hp : (∏ j : Fin n, ‖directions (w j)‖) ≤ 1 := - prod_le_one (fun _ _ => norm_nonneg _) (fun j _ => hd (w j)) + prod_le_one₀ (fun _ _ => norm_nonneg _) (fun j _ => hd (w j)) exact ((iteratedFDeriv ℝ n f x).le_opNorm (fun j => directions (w j))).trans (by simpa only [mul_one] using mul_le_mul_of_nonneg_left hp (norm_nonneg _)) diff --git a/LeanPool/NavierStokesAndEuler/Euler/ParentState.lean b/LeanPool/NavierStokesAndEuler/Euler/ParentState.lean index d6ec30a2a3..537d6daf78 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ParentState.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ParentState.lean @@ -279,7 +279,7 @@ theorem partitionCoefficient_bound (c : OrderedFinpartition n) (t : K) (x : Vect _ ≤ ‖v‖ * ∏ i, ‖iteratedFDeriv ℝ (c.partSize i) (Y t) x‖ := c.norm_compAlongOrderedFinpartition_le _ _ _ ≤ ‖v‖ * partitionBound D c := mul_le_mul_of_nonneg_left - (Finset.prod_le_prod (fun _ _ => norm_nonneg _) + (Finset.prod_le_prod₀ (fun _ _ => norm_nonneg _) (fun i _ => hB (c.partSize i) (c.partSize_pos i) (c.partSize_le i) t x)) (norm_nonneg _) _ = _ := mul_comm _ _ @@ -417,6 +417,7 @@ theorem compositionTensorLp_norm_le : have hA : eLpNorm (iteratedFDeriv ℝ n (g ∘ f)) 2 volume ≤ (β : ℝ≥0∞)*eLpNorm (fun x => ∑ i : Fin (n+1), ‖iteratedFDeriv ℝ i.val g (f x)‖) 2 volume := by apply eLpNorm_le_nnreal_smul_eLpNorm_of_ae_le_mul + (compositionTensor_memLp f g hf hg n D hD hjet hmp hLp).aestronglyMeasurable filter_upwards [] with x apply NNReal.coe_le_coe.mp change ‖iteratedFDeriv ℝ n (g ∘ f) x‖ ≤ ((n.factorial : ℝ)*D^n) * @@ -428,14 +429,15 @@ theorem compositionTensorLp_norm_le : funext x simp only [Finset.sum_apply] rw [he] at hA - have hB := eLpNorm_sum_le (fun i (_ : i ∈ (Finset.univ : Finset (Fin (n+1)))) => - (composedJetNorm_memLp f g n hmp hLp i).aestronglyMeasurable) - (by norm_num : (1 : ℝ≥0∞) ≤ 2) + have hB : eLpNorm (∑ i : Fin (n+1), fun x => ‖iteratedFDeriv ℝ i.val g (f x)‖) 2 volume ≤ + ∑ i : Fin (n+1), eLpNorm (fun x => ‖iteratedFDeriv ℝ i.val g (f x)‖) 2 volume := + eLpNorm_sum_le (by norm_num : (1 : ℝ≥0∞) ≤ 2) have hc (i : Fin (n+1)) : eLpNorm (fun x => ‖iteratedFDeriv ℝ i.val g (f x)‖) 2 volume = eLpNorm (iteratedFDeriv ℝ i.val g) 2 volume := by change eLpNorm ((fun y => ‖iteratedFDeriv ℝ i.val g y‖) ∘ f) 2 volume = _ rw [eLpNorm_comp_measurePreserving (hLp i (by - omega)).aestronglyMeasurable.norm hmp,eLpNorm_norm] + omega)).aestronglyMeasurable.norm hmp, + eLpNorm_norm _ (hLp i (by omega)).aestronglyMeasurable] simp_rw [hc] at hB have hAB : eLpNorm (iteratedFDeriv ℝ n (g ∘ f)) 2 volume ≤ (β : ℝ≥0∞)*∑ i : Fin (n+1), eLpNorm (iteratedFDeriv ℝ i.val g) 2 volume := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/PhysicalGraphFlowBounds.lean b/LeanPool/NavierStokesAndEuler/Euler/PhysicalGraphFlowBounds.lean index 1a22d1b6a2..eaaa847142 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PhysicalGraphFlowBounds.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PhysicalGraphFlowBounds.lean @@ -361,7 +361,6 @@ theorem scaled_flow_eq (hell : ell ≠ 0) (s t : ℝ) (x : E) : (V.velocity r (ell • (flowData T hT A).flow s r (ell⁻¹ • x))) r := by have h := ((flowData T hT A).flow_hasDerivAt s r (ell⁻¹ • x)).const_smul ell convert h using 1 - · rfl · change ell • A.field (projIcc 0 T hT r) (ell⁻¹ • (ell • (flowData T hT A).flow s r (ell⁻¹ • x))) = _ simp only [smul_smul,inv_mul_cancel₀ hell,one_smul] @@ -1003,7 +1002,8 @@ theorem accelerationField_memLp_and_bound (B R C S C₁ S₁ : ℝ) have hreal' : (eLpNorm (fun q => jetSeries P (accelerationField T A A₁ t) q n) 2 (liftMeasure P)).toReal ≤ (eLpNorm v 2 (liftMeasure P)).toReal+(eLpNorm w 2 (liftMeasure P)).toReal := by - simpa only [Fin.sum_univ_two,H,ite_true,Fin.isValue,one_ne_zero,ite_false,eLpNorm_norm] using + simpa only [Fin.sum_univ_two,H,ite_true,Fin.isValue,one_ne_zero,ite_false, + eLpNorm_norm _ hv.aestronglyMeasurable, eLpNorm_norm _ hw.aestronglyMeasurable] using hreal have hn₁ : (eLpNorm v 2 (liftMeasure P)).toReal ≤ C₁*majorant U 0 n := by apply (hNorm₁ t n).trans diff --git a/LeanPool/NavierStokesAndEuler/Euler/PhysicalGraphGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/PhysicalGraphGevrey.lean index e7003d8103..b6392c16de 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PhysicalGraphGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PhysicalGraphGevrey.lean @@ -58,8 +58,8 @@ theorem norm_jetLp_scale_le (ell : ℝ) (hell : 0 < ell) (hell1 : ell ≤ 1) (A : SmoothL2Field V) (n : ℕ) : ‖(scaleField ell hell A).jetLp n‖ ≤ (ell⁻¹)^n*‖A.jetLp n‖ := by rw [norm_jetLp,norm_jetLp, - toReal_eLpNorm ((scaleField ell hell A).integrable n).aestronglyMeasurable, - toReal_eLpNorm (A.integrable n).aestronglyMeasurable] + toReal_eLpNorm, + toReal_eLpNorm] exact lpNorm_scale_jet_le ell hell hell1 A.field A.smooth n (A.integrable n) theorem HasJetBound.scale {A : SmoothL2Field V} {C R : ℝ} diff --git a/LeanPool/NavierStokesAndEuler/Euler/PhysicalL2Scaling.lean b/LeanPool/NavierStokesAndEuler/Euler/PhysicalL2Scaling.lean index 1175157968..ec4a7ae25f 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PhysicalL2Scaling.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PhysicalL2Scaling.lean @@ -36,7 +36,7 @@ variable {V : Type*} [NormedAddCommGroup V] theorem lpNorm_sq_integral (f : Space → V) (hf : MemLp f 2 volume) : (lpNorm f 2 volume)^2 = ∫ x, ‖f x‖^2 := by have hn : ‖hf.toLp f‖ = lpNorm f 2 volume := by - rw [Lp.norm_toLp, toReal_eLpNorm hf.aestronglyMeasurable] + rw [Lp.norm_toLp, toReal_eLpNorm] rw [← hn, EulerLpConvergence.norm_sq_eq_integral] apply integral_congr_ae filter_upwards [hf.coeFn_toLp] with x hx diff --git a/LeanPool/NavierStokesAndEuler/Euler/PolynomialCostMajorant.lean b/LeanPool/NavierStokesAndEuler/Euler/PolynomialCostMajorant.lean index f249a03a81..f5d7022597 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/PolynomialCostMajorant.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/PolynomialCostMajorant.lean @@ -8,7 +8,7 @@ module public import Mathlib.Algebra.Polynomial.Degree.Defs public import Mathlib.Algebra.Polynomial.Eval.Defs -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic import Mathlib.Algebra.Polynomial.Degree.Operations import Mathlib.Tactic.Bound import Mathlib.Tactic.Measurability.Init diff --git a/LeanPool/NavierStokesAndEuler/Euler/ScalarEulerVorticity.lean b/LeanPool/NavierStokesAndEuler/Euler/ScalarEulerVorticity.lean index 9ebb8790b9..a277b2987e 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/ScalarEulerVorticity.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/ScalarEulerVorticity.lean @@ -114,7 +114,6 @@ theorem vectorCurl_convection (u : Space → Space) (hu : ContDiff ℝ ∞ u) (x simp only [vectorCurl, curl_apply] fin_cases i <;> norm_num [Fin.sum_univ_three, Fin.add_def] <;> - simp only [show (⟨2, by decide⟩ : Fin 3) = 2 from rfl] <;> simp only [hcomm01, hcomm02, hcomm12] <;> ring! /-- The form of curl transport used for incompressible Euler. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothL2Series.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothL2Series.lean index 7df2f4f3c0..e7ef2e3c39 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothL2Series.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothL2Series.lean @@ -33,7 +33,7 @@ theorem tensorNorm_eq_derivativeSum (A : SmoothL2Field Space) (s : ℕ) : unfold tensorNorm derivativeSum apply sum_congr rfl intro n _ - rw [norm_jetLp,toReal_eLpNorm (A.integrable n).aestronglyMeasurable] + rw [norm_jetLp,toReal_eLpNorm] theorem tensorNorm_add_le (A B : SmoothL2Field Space) (s : ℕ) : tensorNorm s (addField A B) ≤ tensorNorm s A+tensorNorm s B := by diff --git a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldComposition.lean b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldComposition.lean index 7588869557..f26d647bfa 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldComposition.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SmoothTimeFieldComposition.lean @@ -166,7 +166,7 @@ def multilinearValue (L : ContinuousMultilinearMap ℝ V W) (L.cont.comp (continuous_pi (fun i => (f i).continuous))) (‖L‖ * ∏ i, ‖f i‖) (fun x => (L.le_opNorm _).trans (mul_le_mul_of_nonneg_left - (Finset.prod_le_prod (fun _ _ => norm_nonneg _) + (Finset.prod_le_prod₀ (fun _ _ => norm_nonneg _) (fun i _ => (f i).norm_coe_le_norm x)) (norm_nonneg L))) @[simp] theorem multilinearValue_apply (L : ContinuousMultilinearMap ℝ V W) diff --git a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderPressureField.lean b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderPressureField.lean index 568069e440..407d11218a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderPressureField.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/SourceCylinderPressureField.lean @@ -355,7 +355,8 @@ theorem normalResidual_smooth (hm : ∀ t x, m.field t x ≠ 0) exact pow_ne_zero 2 (norm_ne_zero_iff.mpr (hm t (x.1+h.1))) have h := ((hm'.inner ℝ hF).sub ((contDiff_const (c := (2 : ℝ))).mul (hm'.inner ℝ (hM.clm_apply hA)))).div (hm'.inner ℝ hm') hd - convert h using 1 <;> first + convert h using 1 + first | rfl | (funext z; simp only [localFieldLift,normalResidual,real_inner_self_eq_norm_sq,Pi.div_apply]) diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransverseForwardCoefficientGevrey.lean b/LeanPool/NavierStokesAndEuler/Euler/TransverseForwardCoefficientGevrey.lean index beabc4b173..27b0d170ee 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransverseForwardCoefficientGevrey.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransverseForwardCoefficientGevrey.lean @@ -69,7 +69,8 @@ theorem generator_contDiff {n : ℕ∞ω} (hQr : ContDiff ℝ n Q) (hQ₁r : Con ContDiff ℝ n (fun x => generator T (Q x) (Q₁ x) c hc (hQ x)) := by have hr := (contDiff_compose (fun x => frameLeftInversePath T (Q x) c hc (hQ x)) Q₁ (frameLeftInversePath_contDiff T Q c hc hQ hQr) hQ₁r).const_smul (-2 : ℝ) - convert hr using 1 <;> rfl + convert hr using 1 + rfl /-- Applying the actual projected forcing map preserves smooth parameter dependence. -/ theorem forcing_contDiff (f : P → C(Icc (0 : ℝ) T, E)) {n : ℕ∞ω} diff --git a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHistoryPressure.lean b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHistoryPressure.lean index 82ba374516..5222d4a4af 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHistoryPressure.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/TransversePacketHistoryPressure.lean @@ -97,7 +97,8 @@ theorem normalResidual_smooth (t : Icc (0 : ℝ) D.T) (x : LiftDomain P) : exact pow_ne_zero 2 (norm_ne_zero_iff.mpr (normal_ne_zero t (x.1+h.1))) have h := ((hm.inner ℝ hF).sub ((contDiff_const (c := (2 : ℝ))).mul (hm.inner ℝ (hM.clm_apply hA)))).div (hm.inner ℝ hm) hd - convert h using 1 <;> first + convert h using 1 + first | rfl | (funext z; simp only [localFieldLift,normalResidual,forceField,Function.comp_apply, real_inner_self_eq_norm_sq,Pi.div_apply]) diff --git a/LeanPool/NavierStokesAndEuler/Euler/WeightedForcingTime.lean b/LeanPool/NavierStokesAndEuler/Euler/WeightedForcingTime.lean index b1cba13188..77a46a370a 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/WeightedForcingTime.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/WeightedForcingTime.lean @@ -41,7 +41,7 @@ theorem familyNorm_lipschitz : LipschitzWith ‖(familyHilbertMap : (I → H) => H))‖₊ (familyNorm : (I → H) → ℝ) := by have h := lipschitzWith_one_norm.comp (familyHilbertMap : (I → H) →L[ℝ] PiLp 2 (fun _ : I => - H)).lipschitz + H)).lipschitzWith simpa only [one_mul, Function.comp_def, ← familyNorm_eq_piLp] using h /-- The actual scalar finite-family norm represented in Bochner L² time. -/ diff --git a/LeanPool/NavierStokesAndEuler/Euler/WholeSpaceGaussianFields.lean b/LeanPool/NavierStokesAndEuler/Euler/WholeSpaceGaussianFields.lean index 7de6bf28c4..00128a7aad 100644 --- a/LeanPool/NavierStokesAndEuler/Euler/WholeSpaceGaussianFields.lean +++ b/LeanPool/NavierStokesAndEuler/Euler/WholeSpaceGaussianFields.lean @@ -137,7 +137,7 @@ theorem average_integrable_of_memLp {t : ℝ} (ht : 0 < t) Integrable (fun y : Space => kernel t y • f (x+y)) := by have hs : MemLp (fun y : Space => f (x+y)) 2 volume := hf.comp_measurePreserving (measurePreserving_add_left (volume : Measure Space) x) - exact memLp_one_iff_integrable.mp (hs.smul (kernel_memLp ht)) + exact memLp_one_iff_integrable.mp ((kernel_memLp ht).smul hs) theorem average_sub {t : ℝ} (ht : 0 < t) (f g : Space → V) (hf : MemLp f 2 volume) (hg : MemLp g 2 volume) (x : Space) : diff --git a/LeanPool/NavierStokesAndEuler/ForMathlib/SmoothCutoff.lean b/LeanPool/NavierStokesAndEuler/ForMathlib/SmoothCutoff.lean index 5e65248611..871471531c 100644 --- a/LeanPool/NavierStokesAndEuler/ForMathlib/SmoothCutoff.lean +++ b/LeanPool/NavierStokesAndEuler/ForMathlib/SmoothCutoff.lean @@ -181,7 +181,7 @@ theorem iteratedFDeriv_comp_inv_smul_le {χ : D → F} {n : ℕ} (hχ : ContDiff apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) calc ∏ _ : Fin n, ‖dilation D R‖ ≤ ∏ _ : Fin n, R⁻¹ := - Finset.prod_le_prod (fun _ _ => norm_nonneg _) (fun _ _ => norm_dilation_le hR) + Finset.prod_le_prod₀ (fun _ _ => norm_nonneg _) (fun _ _ => norm_dilation_le hR) _ = (R⁻¹) ^ n := by simp _ ≤ C * (R⁻¹) ^ n := mul_le_mul_of_nonneg_right (hC _) (by positivity) _ = C / R ^ n := by simp [div_eq_mul_inv] diff --git a/LeanPool/NavierStokesAndEuler/ForMathlib/SmoothnessOrder.lean b/LeanPool/NavierStokesAndEuler/ForMathlib/SmoothnessOrder.lean index 38136ee146..245cade209 100644 --- a/LeanPool/NavierStokesAndEuler/ForMathlib/SmoothnessOrder.lean +++ b/LeanPool/NavierStokesAndEuler/ForMathlib/SmoothnessOrder.lean @@ -24,6 +24,6 @@ namespace NavierStokesAndEuler n ≤ (⊤ : ℕ∞) ↔ n ≠ ⊤ := by cases n with | top => simp - | coe n => simp [WithTop.coe_le_coe] + | coe n => simp end NavierStokesAndEuler diff --git a/LeanPool/NavierStokesAndEuler/ForMathlib/SobolevThreeDimensional.lean b/LeanPool/NavierStokesAndEuler/ForMathlib/SobolevThreeDimensional.lean index f960ff07df..604de3d96e 100644 --- a/LeanPool/NavierStokesAndEuler/ForMathlib/SobolevThreeDimensional.lean +++ b/LeanPool/NavierStokesAndEuler/ForMathlib/SobolevThreeDimensional.lean @@ -89,17 +89,18 @@ theorem eLpNorm_fderiv_cutoff_smul_le {f : ℝ³ → E} (hf : ContDiff ℝ 1 f) eLpNorm (fderiv ℝ (fun y => cutoff ℝ³ R y • f y)) 2 volume ≤ eLpNorm (fun x => ‖fderiv ℝ f x‖ + (derivativeConstant ℝ³ 1 / R) * ‖f x‖) 2 volume := - eLpNorm_mono_real (norm_fderiv_cutoff_smul_le hf hR) + eLpNorm_mono_real + ((((cutoff_smooth (E := ℝ³) R).of_le (by simp)).smul hf).continuous_fderiv + (by simp)).aestronglyMeasurable (norm_fderiv_cutoff_smul_le hf hR) _ ≤ eLpNorm (fun x => ‖fderiv ℝ f x‖) 2 volume + eLpNorm (fun x => (derivativeConstant ℝ³ 1 / R) * ‖f x‖) 2 volume := - eLpNorm_add_le (hf.continuous_fderiv (by simp)).norm.aestronglyMeasurable - (continuous_const.mul hf.continuous.norm).aestronglyMeasurable (by norm_num) + eLpNorm_add_le (by norm_num) _ = eLpNorm (fderiv ℝ f) 2 volume + ENNReal.ofReal (derivativeConstant ℝ³ 1 / R) * eLpNorm f 2 volume := by - rw [eLpNorm_norm] + rw [eLpNorm_norm _ (hf.continuous_fderiv (by simp)).aestronglyMeasurable] change _ + eLpNorm ((derivativeConstant ℝ³ 1 / R) • (fun x => ‖f x‖)) 2 volume = _ - rw [eLpNorm_const_smul, eLpNorm_norm, Real.enorm_eq_ofReal - (div_nonneg (derivativeConstant_pos 1).le hR.le)] + rw [eLpNorm_const_smul, eLpNorm_norm _ hf.continuous.aestronglyMeasurable, + Real.enorm_eq_ofReal (div_nonneg (derivativeConstant_pos 1).le hR.le)] /-- The homogeneous `H¹ → L⁶` inequality without a support assumption. Only the function itself must have finite `L²` norm for this extended-norm @@ -123,6 +124,7 @@ theorem eLpNorm_six_le {f : ℝ³ → E} (hf : ContDiff ℝ 1 f) (h2 : MemLp f 2 atTop.liminf (fun n => eLpNorm (u n) 6 volume) := Lp.eLpNorm_lim_le_liminf_eLpNorm (fun n => (hu n).continuous.aestronglyMeasurable) f + hf.continuous.aestronglyMeasurable (Filter.Eventually.of_forall hpointwise) have hbound : ∀ᶠ n : ℕ in atTop, eLpNorm (u n) 6 volume ≤ @@ -157,8 +159,7 @@ theorem eLpNorm_six_le {f : ℝ³ → E} (hf : ContDiff ℝ 1 f) (h2 : MemLp f 2 theorem memLp_six {f : ℝ³ → E} (hf : ContDiff ℝ 1 f) (h2 : MemLp f 2 volume) (hD2 : MemLp (fderiv ℝ f) 2 volume) : MemLp f 6 volume := by - refine ⟨hf.continuous.aestronglyMeasurable, (eLpNorm_six_le hf h2).trans_lt ?_⟩ - exact ENNReal.mul_lt_top ENNReal.coe_lt_top hD2.2 + exact (eLpNorm_six_le hf h2).trans_lt (ENNReal.mul_lt_top ENNReal.coe_lt_top hD2) /-- The real-valued homogeneous Sobolev bound when both `L²` norms are finite. -/ theorem toReal_eLpNorm_six_le {f : ℝ³ → E} (hf : ContDiff ℝ 1 f) @@ -166,7 +167,7 @@ theorem toReal_eLpNorm_six_le {f : ℝ³ → E} (hf : ContDiff ℝ 1 f) (eLpNorm f 6 volume).toReal ≤ (sobolevConstant : ℝ) * (eLpNorm (fderiv ℝ f) 2 volume).toReal := by have hfinite : (sobolevConstant : ℝ≥0∞) * eLpNorm (fderiv ℝ f) 2 volume ≠ (⊤ : ℝ≥0∞) := - (ENNReal.mul_lt_top ENNReal.coe_lt_top hD2.2).ne + (ENNReal.mul_lt_top ENNReal.coe_lt_top hD2).ne simpa only [ENNReal.toReal_mul, ENNReal.coe_toReal] using ENNReal.toReal_mono hfinite (eLpNorm_six_le hf h2) @@ -174,8 +175,8 @@ theorem toReal_eLpNorm_six_le {f : ℝ³ → E} (hf : ContDiff ℝ 1 f) theorem lpNorm_six_le {f : ℝ³ → E} (hf : ContDiff ℝ 1 f) (h2 : MemLp f 2 volume) (hD2 : MemLp (fderiv ℝ f) 2 volume) : lpNorm f 6 volume ≤ (sobolevConstant : ℝ) * lpNorm (fderiv ℝ f) 2 volume := by - rw [← toReal_eLpNorm hf.continuous.aestronglyMeasurable, - ← toReal_eLpNorm (hf.continuous_fderiv (by simp)).aestronglyMeasurable] + rw [← toReal_eLpNorm, + ← toReal_eLpNorm] exact toReal_eLpNorm_six_le hf h2 hD2 /-- The real-valued compact-support inequality. -/ diff --git a/LeanPool/NavierStokesAndEuler/ForMathlib/WeightedDecay.lean b/LeanPool/NavierStokesAndEuler/ForMathlib/WeightedDecay.lean index 27990bce8a..cec93f9ffe 100644 --- a/LeanPool/NavierStokesAndEuler/ForMathlib/WeightedDecay.lean +++ b/LeanPool/NavierStokesAndEuler/ForMathlib/WeightedDecay.lean @@ -7,7 +7,7 @@ Authors: OpenAI, Code4me2 module public import Mathlib.Analysis.Normed.Group.Basic -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.Order.Interval.Set.Defs /-! diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCandidateAssembly.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCandidateAssembly.lean index 94c7287b8b..15d98b761a 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCandidateAssembly.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ActualCandidateAssembly.lean @@ -822,7 +822,6 @@ theorem graph_cylinderPoint (n : ℕ) (z : SpaceTime) : simp only [AxisymmetricResidual.pack, ProblemStatement.coordinateVector, PiLp.add_apply, PiLp.smul_apply, smul_eq_mul, PiLp.single_apply] norm_num - simp only [show (0 : Fin 3) ≠ 2 by decide, ite_false, add_zero] change Real.sqrt (ChartScales.Q n) * (ChartScales.Q n ^ (-(1 / 2 : ℝ)) * z.2 0) = z.2 0 rw [← mul_assoc, hs, one_mul] · simp [ActualBaseResidual.cylinderPoint, AxisymmetricResidual.pack, diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/AxisCoefficientSpace.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/AxisCoefficientSpace.lean index 8cc031aea4..399c11d873 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/AxisCoefficientSpace.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/AxisCoefficientSpace.lean @@ -9,7 +9,7 @@ public import Mathlib.Analysis.Calculus.IteratedDeriv.Defs public import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic import Mathlib.Analysis.Calculus.IteratedDeriv.Lemmas import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.Algebra.BigOperators.Group.Finset.Defs public import Mathlib.Data.Finset.NatAntidiagonal import Mathlib.Data.Nat.Choose.Vandermonde diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ConstructedSlowBase.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ConstructedSlowBase.lean index 2e787f58d3..220ebc5d96 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ConstructedSlowBase.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ConstructedSlowBase.lean @@ -993,14 +993,12 @@ theorem prefixVelocity_eq_profiles {h : ℝ} (hh : 0 < h) (hh1 : h < 1 / 2) (BaseResidual.prefixSwirl J h C d) (t, x) 0 = _ rw [AxisymmetricFields.velocity_zero _ _ _ _ hH hK, ← hf, ← hv] norm_num [AxisymmetricResidual.pack, ProblemStatement.coordinateVector, PiLp.single_apply] - norm_num [Fin.ext_iff] dsimp only [AxisymmetricFields.profilePoint] field_simp [hs.ne'] · change AxisymmetricFields.velocity (BaseResidual.prefixStream J h C d) (BaseResidual.prefixSwirl J h C d) (t, x) 1 = _ rw [AxisymmetricFields.velocity_one _ _ _ _ hH hK, ← hf, ← hv] norm_num [AxisymmetricResidual.pack, ProblemStatement.coordinateVector, PiLp.single_apply] - norm_num [Fin.ext_iff] dsimp only [AxisymmetricFields.profilePoint] field_simp [hs.ne']; ring · change AxisymmetricFields.velocity (BaseResidual.prefixStream J h C d) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/CurlClassBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/CurlClassBounds.lean index d136cb09d0..b1164d97ab 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/CurlClassBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/CurlClassBounds.lean @@ -18,7 +18,7 @@ import Mathlib.Topology.Algebra.Module.PerfectSpace public import LeanPool.NavierStokesAndEuler.NavierStokes.ResidualStability import LeanPool.NavierStokesAndEuler.NavierStokes.ResidualRegularity import Mathlib.Analysis.SpecialFunctions.Trigonometric.Deriv -public import Mathlib.Data.Complex.Basic +public import Mathlib.Basic.Complex.Basic public import Mathlib.Data.Fin.VecNotation import Mathlib.Algebra.GroupWithZero.Action.Pi import Mathlib.Data.Fintype.Basic diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/EdgeWeightJets.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/EdgeWeightJets.lean index 28bd77ff61..825c6a7932 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/EdgeWeightJets.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/EdgeWeightJets.lean @@ -149,7 +149,7 @@ theorem norm_iteratedFDeriv_snd_le {f : ℝ → ℝ} (hf : ContDiff ℝ ∞ f) rw [L.iteratedFDeriv_comp_right hf y (nat_le_infty n)] apply (ContinuousMultilinearMap.norm_compContinuousLinearMap_le _ _).trans have hprod : (∏ _i : Fin n, ‖L‖) ≤ 1 := by - exact Finset.prod_le_one (fun _ _ => norm_nonneg _) (fun _ _ => ContinuousLinearMap.norm_snd_le + exact Finset.prod_le_one₀ (fun _ _ => norm_nonneg _) (fun _ _ => ContinuousLinearMap.norm_snd_le _ _ _) exact (mul_le_mul_of_nonneg_left hprod (norm_nonneg (iteratedFDeriv ℝ n f (L y)))).trans_eq (mul_one _) @@ -283,7 +283,7 @@ theorem norm_iteratedFDeriv_comp_linear_le {G : Type*} [NormedAddCommGroup G] [N rw [L.iteratedFDeriv_comp_right hf x (nat_le_infty n)] apply (ContinuousMultilinearMap.norm_compContinuousLinearMap_le _ _).trans have hp : (∏ _i : Fin n, ‖L‖) ≤ 1 := - Finset.prod_le_one (fun _ _ => norm_nonneg _) (fun _ _ => hL) + Finset.prod_le_one₀ (fun _ _ => norm_nonneg _) (fun _ _ => hL) simpa only [mul_one] using mul_le_mul_of_nonneg_left hp (norm_nonneg (iteratedFDeriv ℝ n f (L x))) theorem norm_iteratedFDeriv_parameter_le {f : E × ℝ → ℝ} (hf : ContDiff ℝ ∞ f) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ExponentLedger.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ExponentLedger.lean index 022f4e80c3..343fce24db 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ExponentLedger.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ExponentLedger.lean @@ -6,7 +6,7 @@ Authors: OpenAI module -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic import Mathlib.Tactic.Linarith.Frontend import Mathlib.Tactic.Ring.RingNF import Mathlib.Tactic.NormNum.Abs diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricODE.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricODE.lean index 8be8b49987..8788adf3af 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricODE.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/ParametricODE.lean @@ -156,7 +156,7 @@ def homogeneousSystem (A : Coefficient a b E) : TangentODE.IntervalSystem E := { initial := 0 field := fun t x => extend hab A t x lip := ‖A‖₊ - lipschitz := fun t _ => (extend hab A t).lipschitz.weaken (A.norm_coe_le_norm _) + lipschitz := fun t _ => (extend hab A t).lipschitzWith.weaken (A.norm_coe_le_norm _) continuous := by have he : Continuous (fun t : Icc a b => extend hab A t) := (continuous_extend hab A).comp continuous_subtype_val diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryPulseBounds.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryPulseBounds.lean index e8625f2e0a..59feba310e 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryPulseBounds.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PrimaryPulseBounds.lean @@ -529,7 +529,7 @@ theorem pathFamily_polynomial (D : PhaseJetBounds.Domain ι Q) intro t rw [SmoothPathFamily.iteratedFDeriv_pathFamily_apply (D.carrier i) (V i) (D.isOpen i) (hV i) (hI i) (F i) (hF.smooth i) hp] - have hprod : (∏ j, ‖v j‖) ≤ 1 := Finset.prod_le_one (fun _ _ => norm_nonneg _) + have hprod : (∏ j, ‖v j‖) ≤ 1 := Finset.prod_le_one₀ (fun _ _ => norm_nonneg _) (fun j _ => hv j) exact ((iteratedFDeriv ℝ k (fun q => F i (q, t)) p).le_opNorm v).trans ((mul_le_mul (hm i p t ⟨hp, hI i t.2⟩ k hk) hprod diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/PulseAmplitude.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/PulseAmplitude.lean index 0b6a55c2ab..5d4e9e83ed 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/PulseAmplitude.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/PulseAmplitude.lean @@ -564,7 +564,7 @@ theorem rowMoment_bounds {a : ℝ} (ha : -1 ≤ a) (ha' : a ≤ 0) : have hlb : |Real.log x| ≤ 1 := abs_le.mpr ⟨by linarith, by linarith⟩ have hh : |Real.log x * a| ≤ 1 := by rw [abs_mul] - exact mul_le_one₀ hlb (abs_nonneg a) hab + exact (mul_le_of_le_one_left (abs_nonneg a) hlb).trans hab rw [Real.rpow_def_of_pos hxpos] exact ⟨Real.exp_le_exp.mpr (abs_le.mp hh).1, Real.exp_le_exp.mpr (abs_le.mp hh).2⟩ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/LpNormTools.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/LpNormTools.lean index fa5bde9885..dcc1e7748e 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/LpNormTools.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/LpNormTools.lean @@ -41,8 +41,11 @@ theorem lpNorm_congr_ae {p : ℝ≥0∞} {f g : Space → E} theorem lpNorm_mono_of_norm_le_ae {p : ℝ≥0∞} {f : Space → E} {g : Space → F} (hg : MemLp g p volume) (hfg : ∀ᵐ x ∂volume, ‖f x‖ ≤ ‖g x‖) : - comparisonLpNorm p f ≤ comparisonLpNorm p g := - ENNReal.toReal_mono hg.eLpNorm_lt_top.ne (eLpNorm_mono_ae hfg) + comparisonLpNorm p f ≤ comparisonLpNorm p g := by + by_cases hf : AEStronglyMeasurable f volume + · exact ENNReal.toReal_mono hg.eLpNorm_lt_top.ne (eLpNorm_mono_ae hf hfg) + · rw [comparisonLpNorm, eLpNorm_of_not_aestronglyMeasurable hf, ENNReal.toReal_top] + exact lpNorm_nonneg p g theorem lpNorm_mono_of_norm_le {p : ℝ≥0∞} {f : Space → E} {g : Space → F} (hg : MemLp g p volume) (hfg : ∀ x, ‖f x‖ ≤ ‖g x‖) : @@ -57,7 +60,7 @@ theorem lpNorm_add_le {p : ℝ≥0∞} (hp1 : 1 ≤ p) {f g : Space → E} (eLpNorm f p volume + eLpNorm g p volume).toReal := ENNReal.toReal_mono (ENNReal.add_ne_top.mpr ⟨hf.eLpNorm_lt_top.ne, hg.eLpNorm_lt_top.ne⟩) - (eLpNorm_add_le hf.aestronglyMeasurable hg.aestronglyMeasurable hp1) + (eLpNorm_add_le hp1) _ = comparisonLpNorm p f + comparisonLpNorm p g := ENNReal.toReal_add hf.eLpNorm_lt_top.ne hg.eLpNorm_lt_top.ne @@ -69,7 +72,7 @@ theorem lpNorm_const_smul {𝕜 : Type*} [NormedField 𝕜] [NormedSpace 𝕜 E] theorem lpNorm_one_eq_integral_norm {f : Space → E} (hf : Integrable f volume) : comparisonLpNorm 1 f = ∫ x : Space, ‖f x‖ := by - rw [comparisonLpNorm, eLpNorm_one_eq_lintegral_enorm, + rw [comparisonLpNorm, eLpNorm_one_eq_lintegral_enorm hf.aestronglyMeasurable, integral_norm_eq_lintegral_enorm hf.aestronglyMeasurable] theorem lpNorm_two_sq_eq_l2Sq [InnerProductSpace ℝ E] {f : Space → E} diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/PairedKernelBound.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/PairedKernelBound.lean index 4669b67cd6..8caffa4651 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/PairedKernelBound.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/PairedKernelBound.lean @@ -55,7 +55,7 @@ omit [NormedSpace ℝ E] in theorem lpNorm_one_eq_integral_norm {f : Space → E} (hf : AEStronglyMeasurable f volume) : comparisonLpNorm 1 f = ∫ x, ‖f x‖ := by - rw [comparisonLpNorm, eLpNorm_one_eq_lintegral_enorm, + rw [comparisonLpNorm, eLpNorm_one_eq_lintegral_enorm hf, integral_norm_eq_lintegral_enorm hf] /-- Nonnegative constant factors pass through the real comparison norm. -/ @@ -84,10 +84,9 @@ theorem integrable_smul_and_integral_norm_le have hbound : eLpNorm (fun y => k y • r y) 1 volume ≤ eLpNorm k (4 / 3) volume * eLpNorm r 4 volume := eLpNorm_smul_le_mul_eLpNorm (𝕜 := ℝ) (p := 4 / 3) (q := 4) (r := 1) - hr.aestronglyMeasurable hk.aestronglyMeasurable + hk.aestronglyMeasurable hr.aestronglyMeasurable have hmul : MemLp (fun y => k y • r y) 1 volume := - ⟨hk.aestronglyMeasurable.smul hr.aestronglyMeasurable, - hbound.trans_lt (ENNReal.mul_lt_top hk.eLpNorm_lt_top hr.eLpNorm_lt_top)⟩ + hbound.trans_lt (ENNReal.mul_lt_top hk.eLpNorm_lt_top hr.eLpNorm_lt_top) refine ⟨memLp_one_iff_integrable.mp hmul, ?_⟩ rw [← lpNorm_one_eq_integral_norm hmul.aestronglyMeasurable] simpa only [comparisonLpNorm, ENNReal.toReal_mul] using @@ -112,11 +111,11 @@ theorem dominated_section_memLp_and_lpNorm_le calc eLpNorm m (4 / 3) volume ≤ eLpNorm (fun y => k (x - y)) (4 / 3) volume := - eLpNorm_mono_ae_real hbound + eLpNorm_mono_ae_real hm hbound _ = eLpNorm k (4 / 3) volume := eLpNorm_comp_measurePreserving hk.aestronglyMeasurable (measurePreserving_reflect_translate x) - exact ⟨⟨hm, hbound'.trans_lt hk.eLpNorm_lt_top⟩, + exact ⟨hbound'.trans_lt hk.eLpNorm_lt_top, ENNReal.toReal_mono hk.eLpNorm_ne_top hbound'⟩ /-- Hölder for one section dominated by a translated `L^(4/3)` majorant. -/ @@ -286,7 +285,7 @@ theorem norm_convolution_pairing_le (hr : MemLp r 4 volume) (hg : Integrable g volume) : ‖∫ x, g x • ∫ y, k (x - y) • r y‖ ≤ comparisonLpNorm 1 g * comparisonLpNorm (4 / 3) k * comparisonLpNorm 4 r := by - simpa only [comparisonLpNorm, eLpNorm_norm] using + simpa only [comparisonLpNorm, eLpNorm_norm _ hk.aestronglyMeasurable] using norm_paired_kernel_le (K := fun x y => k (x - y)) (hkm.comp (measurable_fst.sub measurable_snd)) hk.norm hr hg (fun _ _ => le_rfl) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/PressureFlux.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/PressureFlux.lean index 151b8ee4c1..f6fced127e 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/PressureFlux.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/PressureFlux.lean @@ -845,7 +845,7 @@ theorem l2Sq_timeIntegral_le {E : Type*} [NormedAddCommGroup E] ((volume : Measure ℝ).restrict (Icc 0 T)).real univ * ∫ t in Icc 0 T, ∫ x : Space, ‖f (t, x)‖ ^ 2 := by have hAvg := memLp_two_timeIntegral hf hsq - have hAvgSq := (memLp_two_iff_integrable_sq_norm hAvg.1).1 hAvg + have hAvgSq := (memLp_two_iff_integrable_sq_norm hAvg.aestronglyMeasurable).1 hAvg calc l2Sq (fun x : Space => ∫ t in Icc 0 T, f (t, x)) ≤ ∫ x : Space, ((volume : Measure ℝ).restrict (Icc 0 T)).real univ * @@ -954,7 +954,7 @@ theorem uniformFiniteEnergy_component_l2Sq_bound {T : ℝ} {u : VelocityField} (EuclideanSpace.proj k : Space →L[ℝ] ℝ).continuous.comp_aestronglyMeasurable humeas have hscalar := huLp.of_le hscalarmeas (Filter.Eventually.of_forall (fun x : Space => PiLp.norm_apply_le (u (t, x)) k)) - have hscalarSq := (memLp_two_iff_integrable_sq_norm hscalar.1).1 hscalar + have hscalarSq := (memLp_two_iff_integrable_sq_norm hscalar.aestronglyMeasurable).1 hscalar refine ⟨hscalarSq, ?_⟩ apply le_trans (integral_mono hscalarSq (hM t ht).1 ?_) (hM t ht).2 intro x @@ -1020,12 +1020,14 @@ theorem l2_inner_integrable_and_norm_integral_le {E : Type*} [NormedAddCommGroup (hg : MemLp g 2 volume) : Integrable (fun x => ⟪f x, g x⟫_ℝ) ∧ (∫ x : Space, ‖⟪f x, g x⟫_ℝ‖) ≤ l2Sq f + l2Sq g := by - have hf_sq := (memLp_two_iff_integrable_sq_norm hf.1).1 hf - have hg_sq := (memLp_two_iff_integrable_sq_norm hg.1).1 hg + have hf_sq := (memLp_two_iff_integrable_sq_norm hf.aestronglyMeasurable).1 hf + have hg_sq := (memLp_two_iff_integrable_sq_norm hg.aestronglyMeasurable).1 hg have hpoint (x : Space) : ‖⟪f x, g x⟫_ℝ‖ ≤ ‖f x‖ ^ 2 + ‖g x‖ ^ 2 := by apply (norm_inner_le_norm (f x) (g x)).trans nlinarith [sq_nonneg (‖f x‖ - ‖g x‖), mul_nonneg (norm_nonneg (f x)) (norm_nonneg (g x))] - have hint := (hf_sq.add hg_sq).mono' (hf.1.inner hg.1) (Filter.Eventually.of_forall hpoint) + have hint := (hf_sq.add hg_sq).mono' + (hf.aestronglyMeasurable.inner hg.aestronglyMeasurable) + (Filter.Eventually.of_forall hpoint) refine ⟨hint, ?_⟩ calc (∫ x : Space, ‖⟪f x, g x⟫_ℝ‖) ≤ ∫ x : Space, ‖f x‖ ^ 2 + ‖g x‖ ^ 2 := @@ -1137,12 +1139,13 @@ theorem l2_complex_mul_integrable_and_norm_integral_le {f : Space → ℝ} {ψ : (hf : MemLp f 2 volume) (hψ : MemLp ψ 2 volume) : Integrable (fun x : Space => (f x : ℂ) * ψ x) ∧ (∫ x : Space, ‖(f x : ℂ) * ψ x‖) ≤ l2Sq f + l2Sq ψ := by - have hf_sq := (memLp_two_iff_integrable_sq_norm hf.1).1 hf - have hψ_sq := (memLp_two_iff_integrable_sq_norm hψ.1).1 hψ + have hf_sq := (memLp_two_iff_integrable_sq_norm hf.aestronglyMeasurable).1 hf + have hψ_sq := (memLp_two_iff_integrable_sq_norm hψ.aestronglyMeasurable).1 hψ have hpoint (x : Space) : ‖(f x : ℂ) * ψ x‖ ≤ ‖f x‖ ^ 2 + ‖ψ x‖ ^ 2 := by rw [norm_mul, Complex.norm_real] nlinarith [sq_nonneg (‖f x‖ - ‖ψ x‖), mul_nonneg (norm_nonneg (f x)) (norm_nonneg (ψ x))] - have hmeas := (Complex.continuous_ofReal.comp_aestronglyMeasurable hf.1).mul hψ.1 + have hmeas := (Complex.continuous_ofReal.comp_aestronglyMeasurable + hf.aestronglyMeasurable).mul hψ.aestronglyMeasurable have hint := (hf_sq.add hψ_sq).mono' hmeas (Filter.Eventually.of_forall hpoint) refine ⟨hint, ?_⟩ calc @@ -1925,7 +1928,8 @@ theorem memLp_and_lpNorm_fderiv_r_two_le {φ : Space → ℝ} {w : Space → Spa have hGeq := WeightedSobolev.lpNorm_cutoffGradientAmplitude hφ.continuous hs hw1 change comparisonLpNorm 2 G = _ at hGeq rw [hGeq] - simp [comparisonLpNorm, eLpNorm_norm, Real.norm_eq_abs, abs_of_nonneg hL0, abs_of_nonneg hc] + simp [comparisonLpNorm, eLpNorm_norm _ hw2.aestronglyMeasurable, Real.norm_eq_abs, + abs_of_nonneg hL0, abs_of_nonneg hc] theorem lpNorm_fderiv_r_two_le {φ : Space → ℝ} {w : Space → Space} (hφ : ContDiff ℝ ∞ φ) (hs : HasCompactSupport φ) (hw : ContDiff ℝ ∞ w) @@ -2305,11 +2309,12 @@ theorem scalar_product_bound {p q r : ℝ≥0∞} [ENNReal.HolderTriple p q r] {f g : Space → ℝ} (hf : MemLp f p volume) (hg : MemLp g q volume) : MemLp (fun x => f x * g x) r volume ∧ comparisonLpNorm r (fun x => f x * g x) ≤ comparisonLpNorm p f * comparisonLpNorm q g := by - have hprod : MemLp (fun x => f x * g x) r volume := hg.mul' hf + have hprod : MemLp (fun x => f x * g x) r volume := hf.fun_mul hg have hb : eLpNorm (fun x => f x * g x) r volume ≤ eLpNorm f p volume * eLpNorm g q volume := by - simpa using eLpNorm_le_eLpNorm_mul_eLpNorm'_of_norm hf.1 hg.1 - (fun a b : ℝ => a * b) 1 + simpa using eLpNorm_le_eLpNorm_mul_eLpNorm_of_norm + (fun a b : ℝ => a * b) 1 continuous_mul + hf.aestronglyMeasurable hg.aestronglyMeasurable (Eventually.of_forall fun x => by simp [norm_mul]) refine ⟨hprod, ?_⟩ simpa only [comparisonLpNorm, ENNReal.toReal_mul] using @@ -2326,8 +2331,9 @@ theorem cross_norm_bound {u w : Space → Space} (ENNReal.inv_ne_top.mpr six_fifths_ne_zero)).mp rw [ENNReal.toReal_add (by finiteness) (by finiteness)] norm_num⟩ - simpa only [comparisonLpNorm, eLpNorm_norm] using scalar_product_bound (r := 6 / 5) hu.norm - hw.norm + simpa only [comparisonLpNorm, eLpNorm_norm _ hu.aestronglyMeasurable, + eLpNorm_norm _ hw.aestronglyMeasurable] using + scalar_product_bound (r := 6 / 5) hu.norm hw.norm /-- The quadratic weighted difference has the endpoint interpolation bound. -/ theorem quadratic_cutoff_bound {φ : Space → ℝ} {w : Space → Space} @@ -2351,7 +2357,8 @@ theorem quadratic_cutoff_bound {φ : Space → ℝ} {w : Space → Space} simpa only [pow_two] using hprod have hQb : comparisonLpNorm (6 / 5) (fun x => ‖φ x • w x‖ ^ 2) ≤ comparisonLpNorm (12 / 5) (fun x => φ x • w x) ^ 2 := by - simpa only [pow_two, comparisonLpNorm, eLpNorm_norm] using hprodb + simpa only [pow_two, comparisonLpNorm, eLpNorm_norm _ hmem.aestronglyMeasurable] using + hprodb have hA := LpNormTools.lpNorm_nonneg (12 / 5) (fun x => φ x • w x) have hM := LpNormTools.lpNorm_nonneg 2 w have hB := LpNormTools.lpNorm_nonneg 6 (fun x => φ x ^ 4 • w x) @@ -2512,8 +2519,14 @@ open ProblemStatement Comparison theorem lpNorm_ofReal (p : ℝ≥0∞) (f : Space → ℝ) : comparisonLpNorm p (fun x => (f x : ℂ)) = comparisonLpNorm p f := by - apply congrArg ENNReal.toReal - exact eLpNorm_congr_norm_ae (Eventually.of_forall fun x => Complex.norm_real (f x)) + by_cases hf : AEStronglyMeasurable f volume + · exact congrArg ENNReal.toReal (eLpNorm_congr_norm_ae + (Complex.continuous_ofReal.comp_aestronglyMeasurable hf) hf + (Eventually.of_forall fun x => Complex.norm_real (f x))) + · have hf' : ¬ AEStronglyMeasurable (fun x => (f x : ℂ)) volume := fun h => + hf (by simpa using Complex.continuous_re.comp_aestronglyMeasurable h) + rw [comparisonLpNorm, comparisonLpNorm, eLpNorm_of_not_aestronglyMeasurable hf, + eLpNorm_of_not_aestronglyMeasurable hf'] theorem norm_fderiv_ofReal {f : Space → ℝ} {x : Space} (hf : DifferentiableAt ℝ f x) : @@ -2537,7 +2550,9 @@ theorem lpNorm_fderiv_realTest (p : ℝ≥0∞) (f : Space → ℝ) comparisonLpNorm p (fderiv ℝ (fun x => PressureRecovery.realTest f hf hc x)) = comparisonLpNorm p (fderiv ℝ f) := by apply congrArg ENNReal.toReal - apply eLpNorm_congr_norm_ae + refine eLpNorm_congr_norm_ae + ((Complex.ofRealCLM.contDiff.comp hf).continuous_fderiv (by simp)).aestronglyMeasurable + (hf.continuous_fderiv (by simp)).aestronglyMeasurable ?_ exact Eventually.of_forall fun x => norm_fderiv_ofReal ((contDiff_infty.1 hf 1).differentiable (by simp) x) @@ -2573,8 +2588,9 @@ theorem norm_holder_pair_le {f : Space → ℝ} {g : Space → ℂ} have he : eLpNorm (fun x => (f x : ℂ) * g x) 1 volume ≤ eLpNorm (fun x => (f x : ℂ)) (6 / 5) volume * eLpNorm g 6 volume := by simpa only [ENNReal.coe_one, one_mul] using - eLpNorm_le_eLpNorm_mul_eLpNorm_of_nnnorm hfc.1 hg.1 - (fun a b : ℂ => a * b) 1 + eLpNorm_le_eLpNorm_mul_eLpNorm_of_nnnorm + (fun a b : ℂ => a * b) 1 continuous_mul + hfc.aestronglyMeasurable hg.aestronglyMeasurable (Eventually.of_forall fun x => by simp [nnnorm_mul]) have ht := ENNReal.toReal_mono (ENNReal.mul_ne_top hfc.eLpNorm_ne_top hg.eLpNorm_ne_top) he change comparisonLpNorm 1 (fun x => (f x : ℂ) * g x) ≤ diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/PressureFunctionals.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/PressureFunctionals.lean index 386e1642c6..a80c9f4422 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/PressureFunctionals.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/PressureFunctionals.lean @@ -328,7 +328,7 @@ theorem integrable_l2_pair {W : Space → ℝ} (hW : MemLp W 2) (ψ : ComplexTes have hprod : Integrable (fun x : Space => ‖W x‖ * ‖ψ x‖) := hW.norm.integrable_mul (ψ.memLp 2).norm apply hprod.mono' - · exact (Complex.continuous_ofReal.comp_aestronglyMeasurable hW.1).mul + · exact (Complex.continuous_ofReal.comp_aestronglyMeasurable hW.aestronglyMeasurable).mul ψ.continuous.aestronglyMeasurable · exact Filter.Eventually.of_forall fun x => by simp [Complex.norm_real] diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/RieszTestOperators.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/RieszTestOperators.lean index 732b4056cb..23ec7b4764 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/RieszTestOperators.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/RieszTestOperators.lean @@ -412,7 +412,8 @@ theorem lpNorm_two_fderiv_rieszTest_le (i j : Fin 3) (ψ : ComplexTest) : ‖Comparison.partialD k (rieszTest i j ψ) x‖) := lpNorm_two_fin3_sum_le _ (fun k => (memLp_partial_rieszTest i j ψ k).norm) _ = ∑ k : Fin 3, comparisonLpNorm 2 (Comparison.partialD k (rieszTest i j ψ)) := by - simp only [comparisonLpNorm, eLpNorm_norm] + exact Finset.sum_congr rfl fun k _ => congrArg ENNReal.toReal + (eLpNorm_norm _ (memLp_partial_rieszTest i j ψ k).aestronglyMeasurable) _ ≤ ∑ k : Fin 3, comparisonLpNorm 2 (Comparison.partialD k (fun y => ψ y)) := by exact Finset.sum_le_sum fun k _ => lpNorm_two_partial_rieszTest_le i j ψ k _ ≤ ∑ _k : Fin 3, comparisonLpNorm 2 (fderiv ℝ (fun y => ψ y)) := by diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/WeightedInterpolation.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/WeightedInterpolation.lean index 53dfc42411..a8a3724018 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/WeightedInterpolation.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/WeightedInterpolation.lean @@ -50,6 +50,7 @@ theorem eLpNorm_le_rpow_mul {p q r : ℝ≥0∞} {a b : ℝ} (hf : AEStronglyMeasurable f volume) (hg : AEStronglyMeasurable g volume) + (hhm : AEStronglyMeasurable h volume) (hp : 0 < p.toReal) (hq : 0 < q.toReal) (hr : 0 < r.toReal) (ha : 0 < a) (hb : 0 < b) (hra : r.toReal < p.toReal / a) @@ -59,9 +60,9 @@ theorem eLpNorm_le_rpow_mul obtain ⟨hp0, hpt⟩ := ENNReal.toReal_pos_iff.mp hp obtain ⟨hq0, hqt⟩ := ENNReal.toReal_pos_iff.mp hq obtain ⟨hr0, hrt⟩ := ENNReal.toReal_pos_iff.mp hr - rw [eLpNorm_eq_eLpNorm' hr0.ne' hrt.ne, - eLpNorm_eq_eLpNorm' hp0.ne' hpt.ne, - eLpNorm_eq_eLpNorm' hq0.ne' hqt.ne] + rw [eLpNorm_eq_eLpNorm' hr0.ne' hrt.ne hhm, + eLpNorm_eq_eLpNorm' hp0.ne' hpt.ne hf, + eLpNorm_eq_eLpNorm' hq0.ne' hqt.ne hg] calc eLpNorm' h r.toReal volume ≤ eLpNorm' (fun x => ‖f x‖ ^ a * ‖g x‖ ^ b) r.toReal volume := by @@ -96,12 +97,13 @@ theorem memLp_and_lpNorm_le_rpow_mul (hh : ∀ᵐ x ∂volume, ‖h x‖ ≤ ‖f x‖ ^ a * ‖g x‖ ^ b) : MemLp h r volume ∧ comparisonLpNorm r h ≤ comparisonLpNorm p f ^ a * comparisonLpNorm q g ^ b := by - have hbound := eLpNorm_le_rpow_mul hf.1 hg.1 hp hq hr ha hb hra hab hh + have hbound := eLpNorm_le_rpow_mul hf.aestronglyMeasurable hg.aestronglyMeasurable hhm + hp hq hr ha hb hra hab hh have hfinite : eLpNorm f p volume ^ a * eLpNorm g q volume ^ b < ∞ := ENNReal.mul_lt_top (ENNReal.rpow_lt_top_of_nonneg ha.le hf.eLpNorm_ne_top) (ENNReal.rpow_lt_top_of_nonneg hb.le hg.eLpNorm_ne_top) - refine ⟨⟨hhm, hbound.trans_lt hfinite⟩, ?_⟩ + refine ⟨hbound.trans_lt hfinite, ?_⟩ simpa only [comparisonLpNorm, ENNReal.toReal_mul, ENNReal.toReal_rpow] using ENNReal.toReal_mono hfinite.ne hbound @@ -160,7 +162,7 @@ theorem cutoff_interpolation comparisonLpNorm r (fun x => (φ x ^ k) • w x) ≤ comparisonLpNorm 2 w ^ (1 - (k : ℝ) / 4) * comparisonLpNorm 6 (fun x => (φ x ^ 4) • w x) ^ ((k : ℝ) / 4) := by - apply memLp_and_lpNorm_le_rpow_mul hw hweighted ((hφm.pow k).smul hw.1) + apply memLp_and_lpNorm_le_rpow_mul hw hweighted ((hφm.pow k).smul hw.aestronglyMeasurable) (by norm_num) (by norm_num) hr ha hb · simpa using hra · simpa using hab @@ -419,9 +421,9 @@ energies. -/ theorem l2Sq_sub_le {E : Type*} [NormedAddCommGroup E] {f g : Space → E} (hf : MemLp f 2 volume) (hg : MemLp g 2 volume) : l2Sq (fun x => f x - g x) ≤ 2 * (l2Sq f + l2Sq g) := by - have hf_sq := (memLp_two_iff_integrable_sq_norm hf.1).1 hf - have hg_sq := (memLp_two_iff_integrable_sq_norm hg.1).1 hg - have hfg_sq := (memLp_two_iff_integrable_sq_norm (hf.sub hg).1).1 (hf.sub hg) + have hf_sq := (memLp_two_iff_integrable_sq_norm hf.aestronglyMeasurable).1 hf + have hg_sq := (memLp_two_iff_integrable_sq_norm hg.aestronglyMeasurable).1 hg + have hfg_sq := (memLp_two_iff_integrable_sq_norm (hf.sub hg).aestronglyMeasurable).1 (hf.sub hg) calc l2Sq (fun x => f x - g x) ≤ ∫ x : Space, 2 * (‖f x‖ ^ 2 + ‖g x‖ ^ 2) := @@ -506,9 +508,10 @@ theorem tensorDiff_integrable {u v : VelocityField} {t : ℝ} (hu : MemLp (fun x : Space => u (t, x)) 2 volume) (hv : MemLp (fun x : Space => v (t, x)) 2 volume) (i j : Fin 3) : Integrable (tensorDiff u v t i j) volume := by - have hu_sq := (memLp_two_iff_integrable_sq_norm hu.1).1 hu - have hv_sq := (memLp_two_iff_integrable_sq_norm hv.1).1 hv - exact (hu_sq.add hv_sq).mono' (tensorDiff_aestronglyMeasurable hu.1 hv.1 i j) + have hu_sq := (memLp_two_iff_integrable_sq_norm hu.aestronglyMeasurable).1 hu + have hv_sq := (memLp_two_iff_integrable_sq_norm hv.aestronglyMeasurable).1 hv + exact (hu_sq.add hv_sq).mono' + (tensorDiff_aestronglyMeasurable hu.aestronglyMeasurable hv.aestronglyMeasurable i j) (ae_of_all _ (tensorDiff_norm_le u v t i j)) /-- Its `L¹` norm is bounded using only the two ordinary energies. -/ @@ -517,8 +520,8 @@ theorem tensorDiff_norm_integral_le {u v : VelocityField} {t : ℝ} (hv : MemLp (fun x : Space => v (t, x)) 2 volume) (i j : Fin 3) : (∫ x : Space, ‖tensorDiff u v t i j x‖) ≤ l2Sq (fun x => u (t, x)) + l2Sq (fun x => v (t, x)) := by - have hu_sq := (memLp_two_iff_integrable_sq_norm hu.1).1 hu - have hv_sq := (memLp_two_iff_integrable_sq_norm hv.1).1 hv + have hu_sq := (memLp_two_iff_integrable_sq_norm hu.aestronglyMeasurable).1 hu + have hv_sq := (memLp_two_iff_integrable_sq_norm hv.aestronglyMeasurable).1 hv calc (∫ x : Space, ‖tensorDiff u v t i j x‖) ≤ ∫ x : Space, ‖u (t, x)‖ ^ 2 + ‖v (t, x)‖ ^ 2 := diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/WeightedSobolev.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/WeightedSobolev.lean index 4c70b8b703..29d10b0493 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/WeightedSobolev.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/WeightedSobolev.lean @@ -206,7 +206,8 @@ theorem lpNorm_fderiv_cutoff_four_le {φ : Space → ℝ} {w : Space → Space} have hGeq := lpNorm_cutoffGradientAmplitude hφ.continuous hs hw change comparisonLpNorm 2 G = _ at hGeq rw [hGeq] - simp [comparisonLpNorm, eLpNorm_norm, Real.norm_eq_abs, abs_of_nonneg hL0] + simp [comparisonLpNorm, eLpNorm_norm _ hw2.aestronglyMeasurable, Real.norm_eq_abs, + abs_of_nonneg hL0] /-- A positive, fixed constant for the cutoff Sobolev estimate. -/ def weightedSobolevConstant : ℝ := 4 * sobolevConstant + 1 diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/WholeSpaceUniqueness.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/WholeSpaceUniqueness.lean index 6e1deaf610..ec38080101 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3/WholeSpaceUniqueness.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3/WholeSpaceUniqueness.lean @@ -979,7 +979,7 @@ theorem weight_iteratedFDeriv_two_le {R : ℝ} (hR : 0 < R) (x : Space) : apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) calc ∏ _ : Fin 2, ‖weightDilation R‖ ≤ ∏ _ : Fin 2, R⁻¹ := - Finset.prod_le_prod (fun _ _ => norm_nonneg _) (fun _ _ => norm_weightDilation_le hR) + Finset.prod_le_prod₀ (fun _ _ => norm_nonneg _) (fun _ _ => norm_weightDilation_le hR) _ = (R⁻¹) ^ 2 := by simp _ ≤ weightSecondDerivativeConstant * (R⁻¹) ^ 2 := mul_le_mul_of_nonneg_right (baseWeight_iteratedFDeriv_two_le _) (by positivity) @@ -1554,7 +1554,7 @@ theorem uniformFiniteEnergy_of_compact_slab {T : ℝ} {u : VelocityField} have hLp : MemLp (fun x : Space => u (t, x)) 2 volume := (CompactTimeIntegral.continuous_slice hu.continuousOn ht).memLp_of_hasCompactSupport (hasCompactSupport_slice hK hsupp ht) - refine ⟨(memLp_two_iff_integrable_sq_norm hLp.1).1 hLp, ?_⟩ + refine ⟨(memLp_two_iff_integrable_sq_norm hLp.aestronglyMeasurable).1 hLp, ?_⟩ have hbound : (∫ x : Space, ‖u (t, x)‖ ^ 2) ≤ max C 0 := (le_abs_self _).trans ((hC t ht).trans (le_max_left _ _)) exact mul_le_mul_of_nonneg_left hbound (by norm_num : (0 : ℝ) ≤ 1 / 2) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/R3FiniteEnergyComparison.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/R3FiniteEnergyComparison.lean index cc693620f1..c0d7a16d3c 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/R3FiniteEnergyComparison.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/R3FiniteEnergyComparison.lean @@ -123,7 +123,8 @@ theorem GlobalSolutionRn.uniformFiniteEnergy {f v : VelocityField} {q : Pressure intro t ht constructor · simpa only [NavierStokesR3.ProblemStatement.SquareIntegrableAtTime, norm_norm] using! - (memLp_two_iff_integrable_sq_norm (h.integrable t ht.1).1).mp (h.integrable t ht.1) + (memLp_two_iff_integrable_sq_norm (h.integrable t ht.1).aestronglyMeasurable).mp + (h.integrable t ht.1) · change (1 / 2 : ℝ) * (∫ x : Space, ‖v (t, x)‖ ^ 2) ≤ max 0 (E / 2) have hb := (hE t ht.1).le have hm := le_max_right 0 (E / 2) diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/RadialPullback.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/RadialPullback.lean index c97abfa559..a7b293a587 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/RadialPullback.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/RadialPullback.lean @@ -837,7 +837,7 @@ theorem cutoff_finiteJet_bound (a b : ℝ) (χ : ℝ → ℝ) (hχ : ContDiff ContinuousMultilinearMap.norm_compContinuousLinearMap_le _ _ _ ≤ ‖iteratedFDeriv ℝ j χ z.1‖ * 1 := by apply mul_le_mul_of_nonneg_left _ (norm_nonneg _) - exact Finset.prod_le_one (fun _ _ => norm_nonneg _) (fun _ _ => + exact Finset.prod_le_one₀ (fun _ _ => norm_nonneg _) (fun _ _ => ContinuousLinearMap.norm_fst_le _ _ _) _ = ‖iteratedFDeriv ℝ j χ z.1‖ := mul_one _ _ ≤ C j' := hb j' z.1 hz diff --git a/LeanPool/NavierStokesAndEuler/NavierStokes/TangentODE.lean b/LeanPool/NavierStokesAndEuler/NavierStokes/TangentODE.lean index 7c4e0dbea0..70dd4583bd 100644 --- a/LeanPool/NavierStokesAndEuler/NavierStokes/TangentODE.lean +++ b/LeanPool/NavierStokesAndEuler/NavierStokes/TangentODE.lean @@ -186,7 +186,7 @@ theorem linear_uniform_lipschitz {a b : ℝ} (hab : a ≤ b) have hC0 : 0 ≤ C := (norm_nonneg (A a)).trans (hC a ⟨le_rfl, hab⟩) refine ⟨⟨C, hC0⟩, fun t ht => LipschitzWith.of_dist_le_mul fun x y => ?_⟩ rw [dist_add_right] - exact ((A t).lipschitz.dist_le_mul x y).trans + exact ((A t).lipschitzWith.dist_le_mul x y).trans (mul_le_mul_of_nonneg_right (hC t ht) dist_nonneg) /-- Actual existence for a continuous-coefficient inhomogeneous linear ODE diff --git a/LeanPool/Neukirch/ExtensionOfDedekindDomains.lean b/LeanPool/Neukirch/ExtensionOfDedekindDomains.lean index c00138029f..581fd56de2 100644 --- a/LeanPool/Neukirch/ExtensionOfDedekindDomains.lean +++ b/LeanPool/Neukirch/ExtensionOfDedekindDomains.lean @@ -50,15 +50,14 @@ theorem ramificationIdx_algebra_tower_of_eq [IsDedekindDomain S] [IsDedekindDoma ramificationIdx' p P * ramificationIdx' P Q := ramificationIdx'_algebra_tower hg0 hfg (map_le_iff_le_comap.mpr (le_of_eq hg)) +variable (R) in /-- Multiplicativity of the inertia degree in a tower of Dedekind domains, stated with the hypotheses used by the Hilbert ramification development. -/ -theorem inertiaDeg_algebra_tower_of_eq {p : Ideal R} {P : Ideal S} {I : Ideal T} [IsMaximal p] - [IsMaximal P] (hp : p = comap (algebraMap R S) P) - (hP : P = comap (algebraMap S T) I) : inertiaDeg' p I = - inertiaDeg' p P * inertiaDeg' P I := - letI : P.LiesOver p := ⟨hp⟩ +theorem inertiaDeg_algebra_tower_of_eq {P : Ideal S} {I : Ideal T} + (hP : P = comap (algebraMap S T) I) : I.inertiaDeg R = + P.inertiaDeg R * I.inertiaDeg S := letI : I.LiesOver P := ⟨hP⟩ - inertiaDeg'_algebra_tower p P I + inertiaDeg_tower P I /-- The decomposition of a prime in a tower is `Nonsplit` when there is a unique prime above. -/ class Nonsplit {R S : Type*} [CommRing R] [CommRing S] (f : R →+* S) (p : Ideal R) : Prop where diff --git a/LeanPool/Neukirch/HilbertRamificationTheory.lean b/LeanPool/Neukirch/HilbertRamificationTheory.lean index 2e627c2b94..5758feb08e 100644 --- a/LeanPool/Neukirch/HilbertRamificationTheory.lean +++ b/LeanPool/Neukirch/HilbertRamificationTheory.lean @@ -311,12 +311,12 @@ variable [P lies_over p] /-- If `P` is a maximal ideal of `𝓞 L`, then the intersection of `P` and `𝓞 K` is also a maximal ideal. -/ instance IdealBelow_IsMaximal : IsMaximal (IdealBelow K P) := - isMaximal_comap_of_isIntegral_of_isMaximal P + isMaximal_under_of_isIntegral_of_isMaximal P /-- In particular, if `p` is a maximal ideal of `ringOfIntegers`, then the intersection of `p` and `ℤ` is also a maximal ideal. -/ instance Ideal_comap_int_IsMaximal (p : Ideal (𝓞 K)) [p.IsMaximal] : - IsMaximal (comap (algebraMap ℤ (𝓞 K)) p) := isMaximal_comap_of_isIntegral_of_isMaximal p + IsMaximal (comap (algebraMap ℤ (𝓞 K)) p) := isMaximal_under_of_isIntegral_of_isMaximal p /-- For any maximal idela `p` in `𝓞 K`, there exists a maximal ideal in `𝓞 L` lying over `p`. -/ theorem exists_ideal_over_maximal_of_ringOfIntegers (p : Ideal (𝓞 K)) [p.IsMaximal] @@ -420,7 +420,7 @@ omit [NumberField L] [NumberField E] in theorem ideal_lies_over_tower_bot [hp : P lies_over p] [hP : P lies_over 𝔓] : 𝔓 lies_over p where liesOver_eq := by rw [hp.liesOver_eq, hP.liesOver_eq, comap_comap, ← IsScalarTower.algebraMap_eq] -omit [NumberField E] in +omit [NumberField L] [NumberField E] in theorem ideal_unique_lies_over_trans [hp : 𝔓 unique_lies_over p] [hP : P unique_lies_over 𝔓] : P unique_lies_over p := { ideal_lies_over_trans p 𝔓 P with unique := fun Q _ _ ↦ @@ -487,9 +487,10 @@ instance residue_field_instFiniteDimensional {K L : Type*} [Field K] [NumberFiel Module.Finite.of_restrictScalars_finite (𝓞 K) ((𝓞 K) ⧸ p) ((𝓞 L) ⧸ P) theorem inertiaDeg_pos {K L : Type*} [Field K] [NumberField K] [Field L] [NumberField L] - [Algebra K L] (p : Ideal (𝓞 K)) (P : Ideal (𝓞 L)) [p.IsMaximal] - [P lies_over p] : inertiaDeg' p P > 0 := - Ideal.inertiaDeg'_pos p P + [Algebra K L] (p : Ideal (𝓞 K)) (P : Ideal (𝓞 L)) [p.IsMaximal] [P.IsMaximal] + [P lies_over p] : P.inertiaDeg (𝓞 K) > 0 := by + rw [Ideal.inertiaDeg_eq_of_isMaximal p P] + exact Module.finrank_pos -- Hilbert's Ramification Theory @@ -510,7 +511,7 @@ def mapAlgHomOfClass {k K L F : Type*} [Field k] [Field K] [Field L] [Algebra k [Algebra k L] [FunLike F K L] [AlgHomClass F k K L] (f : F) : (𝓞 K) →ₐ[𝓞 k] (𝓞 L) where toRingHom := mapRingHomOfClass f commutes' x := - SetCoe.ext (AlgHomClass.commutes ((AlgHomClass.toAlgHom f).restrictScalars (𝓞 k)) x) + SetCoe.ext (AlgHomClass.commutes ((AlgHom.ofClass f).restrictScalars (𝓞 k)) x) /-- The `AlgEquiv` of elements of Galois group `Gal(K/L)` restricted to `𝓞 L`. -/ def GalAlgEquiv (σ : L ≃ₐ[K] L) : (𝓞 L) ≃ₐ[𝓞 K] (𝓞 L) := @@ -694,12 +695,11 @@ def residueFieldGalAlgEquiv {P : Ideal (𝓞 L)} [P lies_over p] {Q : Ideal ( exact congrArg (Ideal.Quotient.mk Q) (AlgEquiv.commutes (GalAlgEquiv σ) x) } -omit [p.IsMaximal] in /-- In the case of Galois extension, all the `inertiaDeg` are the same. -/ theorem inertiaDeg_eq_of_isGalois (Q : Ideal (𝓞 L)) [Q.IsMaximal] [Q lies_over p] [IsGalois K L] : - inertiaDeg' p P = inertiaDeg' p Q := by + P.inertiaDeg (𝓞 K) = Q.inertiaDeg (𝓞 K) := by rcases IsMaximal_conjugates p P Q with ⟨σ, hs⟩ - rw [inertiaDeg'_algebraMap, inertiaDeg'_algebraMap] + rw [inertiaDeg_eq_of_isMaximal p P, inertiaDeg_eq_of_isMaximal p Q] exact LinearEquiv.finrank_eq (residueFieldGalAlgEquiv p hs).toLinearEquiv /-- In the case of Galois extension, it can be seen from the Theorem @@ -714,8 +714,7 @@ noncomputable def ramificationIdxOfIsGalois (p : Ideal (𝓞 K)) [p.IsMaximal] that all `inertiaDeg` are the same, which we define as the `inertiaDegOfIsGalois`. -/ noncomputable def inertiaDegOfIsGalois (p : Ideal (𝓞 K)) [p.IsMaximal] (L : Type*) [Field L] [NumberField L] [Algebra K L] : ℕ := - inertiaDeg' p <| - Classical.choose (exists_ideal_over_maximal_of_ringOfIntegers p L) + Ideal.inertiaDeg (Classical.choose (exists_ideal_over_maximal_of_ringOfIntegers p L)) (𝓞 K) /-- In the case of Galois extension, all ramification indices are equal to the `ramificationIdxOfIsGalois`. This completes the property mentioned in our previous definition. -/ @@ -728,7 +727,7 @@ theorem ramificationIdx_eq_ramificationIdxOfIsGalois [IsGalois K L] : /-- In the case of Galois extension, all inertia degrees are equal to the `inertiaDegOfIsGalois`. This completes the property mentioned in our previous definition. -/ theorem inertiaDeg_eq_inertiaDegOfIsGalois [IsGalois K L] : - inertiaDeg' p P = inertiaDegOfIsGalois p L := by + P.inertiaDeg (𝓞 K) = inertiaDegOfIsGalois p L := by rcases Classical.choose_spec (exists_ideal_over_maximal_of_ringOfIntegers p L) with ⟨_, _⟩ rw [inertiaDegOfIsGalois] exact inertiaDeg_eq_of_isGalois p P _ @@ -738,7 +737,7 @@ in the Galois case. Restates the retired `Ideal.sum_ramification_inertia` via th Mathlib form `Ideal.sum_ramification_inertia_eq_card` applied to the Galois group. -/ private theorem sum_ramification_inertia_of_isGalois (L : Type*) [Field L] [NumberField L] [Algebra K L] [IsGalois K L] (hp0 : p ≠ ⊥) : - ∑ P ∈ primesOver p L, ramificationIdx' p P * inertiaDeg' p P = Module.finrank K L := by + ∑ P ∈ primesOver p L, ramificationIdx' p P * P.inertiaDeg (𝓞 K) = Module.finrank K L := by classical have : Fintype (p.primesOver (𝓞 L)) := (Algebra.QuasiFinite.finite_primesOver p).fintype rw [← IsGaloisGroup.card_eq_finrank (L ≃ₐ[K] L) K L, @@ -749,7 +748,7 @@ private theorem sum_ramification_inertia_of_isGalois (L : Type*) [Field L] [Numb · obtain ⟨Q, hQ⟩ := Q have h1 : Q.IsMaximal := ((primesOver_mem p Q).mp hQ).1 have h2 : Q lies_over p := ((primesOver_mem p Q).mp hQ).2 - rw [ramificationIdx'_eq_ramificationIdx p Q hp0, inertiaDeg'_eq_inertiaDeg p Q] + rw [ramificationIdx'_eq_ramificationIdx p Q hp0] rfl /-- The form of the **fundamental identity** in the case of Galois extension. -/ @@ -763,7 +762,7 @@ theorem ramificationIdx_mul_inertiaDegOfIsGalois (L : Type*) [Field L] [NumberFi intro P hp let := ((primesOver_mem p P).mp hp).1 let := ((primesOver_mem p P).mp hp).2 - rw [ramificationIdx_eq_ramificationIdxOfIsGalois, inertiaDeg_eq_inertiaDegOfIsGalois] + rw [ramificationIdx_eq_ramificationIdxOfIsGalois, inertiaDeg_eq_inertiaDegOfIsGalois p P] @@ -881,9 +880,9 @@ theorem ramificationIdx_and_inertiaDeg_of_DecompositionIdeal [IsGalois K L] : have hr := Nat.le_of_dvd h0 <| Dvd.intro_left _ <| Eq.symm <| ramificationIdx_algebra_tower_of_eq (map_isMaximal_ne_bot p E) (map_isMaximal_ne_bot Pz L) (map_isMaximal_ne_bot p L) (ne_bot_ofIsMaximal Pz) (ne_bot_ofIsMaximal P) rfl - have h0 : inertiaDeg' p P > 0 := inertiaDeg_pos p P - have hi := Nat.le_of_dvd h0 <| Dvd.intro_left _ <| Eq.symm <| inertiaDeg_algebra_tower_of_eq - (Ideal_comap_IntermediateField p P (DecompositionField p P)) (IdealBelow_def E P) + have h0 : P.inertiaDeg (𝓞 K) > 0 := inertiaDeg_pos p P + have hi := Nat.le_of_dvd h0 <| Dvd.intro_left _ <| Eq.symm <| + inertiaDeg_algebra_tower_of_eq (𝓞 K) (IdealBelow_def E P) rw [ramificationIdx_eq_ramificationIdxOfIsGalois Pz P, ramificationIdx_eq_ramificationIdxOfIsGalois p P] at hr rw [inertiaDeg_eq_inertiaDegOfIsGalois Pz P, inertiaDeg_eq_inertiaDegOfIsGalois p P] at hi @@ -918,13 +917,12 @@ theorem ramificationIdx_of_DecompositionIdeal_over_bot_eq_one [IsGalois K L] : /-- The residue class field corresponding to `DecompositionField p P` is isomorphic to residue class field corresponding to `p`. -/ theorem inertiaDeg_of_DecompositionIdeal_over_bot_eq_one [IsGalois K L] : - inertiaDeg' p (DecompositionIdeal p P) = 1 := by - have h := inertiaDeg_algebra_tower_of_eq - (Ideal_comap_IntermediateField p P (DecompositionField p P)) + (DecompositionIdeal p P).inertiaDeg (𝓞 K) = 1 := by + have h := inertiaDeg_algebra_tower_of_eq (𝓞 K) (IdealBelow_def (DecompositionField p P) P) rw [inertiaDeg_eq_inertiaDegOfIsGalois (IdealBelow (DecompositionField p P) P) P, inertiaDeg_of_DecompositionIdeal p P, ← inertiaDeg_eq_inertiaDegOfIsGalois p P] at h - nth_rw 1 [← one_mul (inertiaDeg' p P)] at h + nth_rw 1 [← one_mul (P.inertiaDeg (𝓞 K))] at h exact mul_right_cancel₀ (ne_of_gt (inertiaDeg_pos p P)) h.symm @@ -1159,9 +1157,9 @@ theorem finrank_eq_ramificationIdx_mul_inertiaDeg (P : Ideal (𝓞 L)) theorem finrank_bot_InertiaField_eq_inertiaDeg_of_unique : finrank K (InertiaField' K P) = inertiaDegOfIsGalois p L := by let := InertiaField_isGalois_of_unique p P - rw [← inertiaDeg_eq_inertiaDegOfIsGalois p P, inertiaDeg', ← card_aut_eq_finrank, - Nat.card_congr (InertiaFieldAutEquivResidueFieldAut p P).toEquiv, - card_aut_eq_finrank, dite_eq_left hp.liesOver_eq.symm] + rw [← inertiaDeg_eq_inertiaDegOfIsGalois p P, inertiaDeg_eq_of_isMaximal p P, + ← card_aut_eq_finrank, Nat.card_congr (InertiaFieldAutEquivResidueFieldAut p P).toEquiv, + card_aut_eq_finrank] /-- The extension degree `[L : InertiaField' p P]` is equal to the ramification index of `p` in `L`. -/ @@ -1192,7 +1190,8 @@ theorem inertiaDeg_over_InertiaIdeal_eq_one_of_unique (p : Ideal (𝓞 K)) (P : inertiaDegOfIsGalois (InertiaIdeal' K P) L = 1 := by let := ideal_unique_lies_over_tower_top p (InertiaIdeal' K P) P let := InertiaGroup_Normal (InertiaIdeal' K P) P - rw [← inertiaDeg_eq_inertiaDegOfIsGalois (InertiaIdeal' K P) P, inertiaDeg', dite_eq_left rfl, + rw [← inertiaDeg_eq_inertiaDegOfIsGalois (InertiaIdeal' K P) P, + inertiaDeg_eq_of_isMaximal (InertiaIdeal' K P) P, ← card_aut_eq_finrank, ← Nat.card_congr <| MulEquiv.toEquiv <| autQuoutientInertiaGroupEquivResidueFieldAut (InertiaIdeal' K P) P, Nat.card_eq_fintype_card] @@ -1228,11 +1227,11 @@ theorem ramificationIdx_below_InertiaIdeal_eq_one_of_unique : theorem InertiaDeg_below_InertiaIdeal_eq_inertiaDeg_of_unique : inertiaDegOfIsGalois p (InertiaField' K P) = inertiaDegOfIsGalois p L := by let := InertiaField_isGalois_of_unique p P - have h := inertiaDeg_algebra_tower_of_eq (Ideal_comap_IntermediateField p P (InertiaField' K P)) - (IdealBelow_def (InertiaField' K P) P) + have h := inertiaDeg_algebra_tower_of_eq (𝓞 K) (IdealBelow_def (InertiaField' K P) P) nth_rw 1 [inertiaDeg_eq_inertiaDegOfIsGalois (InertiaIdeal' K P) P, inertiaDeg_over_InertiaIdeal_eq_one_of_unique p P, mul_one] at h - simp_rw [inertiaDeg_eq_inertiaDegOfIsGalois] at h + rw [inertiaDeg_eq_inertiaDegOfIsGalois p P, + inertiaDeg_eq_inertiaDegOfIsGalois p (IdealBelow (InertiaField' K P) P)] at h exact h.symm diff --git a/LeanPool/NonSoficGroup/Spectral.lean b/LeanPool/NonSoficGroup/Spectral.lean index 7345ca4db2..c39483cd7a 100644 --- a/LeanPool/NonSoficGroup/Spectral.lean +++ b/LeanPool/NonSoficGroup/Spectral.lean @@ -5566,7 +5566,7 @@ private theorem scalarOperatorKernel_posSemidef {I : Type u} (K : Matrix I I ℂ) (hK : K.PosSemidef) : (scalarOperatorKernel K).PosSemidef := by apply ((RKHS.posSemidef_tfae - (K := scalarOperatorKernel K)).out 2 0).mp + (K := scalarOperatorKernel K)).out 3 1).mp constructor · apply Matrix.IsHermitian.ext intro g h @@ -6444,7 +6444,7 @@ private theorem kazhdan_generator_displacement_of_orthogonal_invariants (orthogonalRepresentation π) (orthogonalRepresentation_no_fixed π) z hz refine ⟨g, hg, ?_⟩ - simpa only [Submodule.coe_norm, orthogonalRepresentation, MonoidHom.coe_mk, OneHom.coe_mk, + simpa only [← Submodule.norm_coe, orthogonalRepresentation, MonoidHom.coe_mk, OneHom.coe_mk, orthogonalLinearIsometryEquiv, map_inv, LinearIsometryEquiv.coe_inv, LinearIsometryEquiv.coe_mk, LinearEquiv.coe_mk, LinearMap.coe_mk, AddHom.coe_mk, AddSubgroupClass.coe_sub] using hgap diff --git a/LeanPool/OSforGFF/Bochner/PositiveDefinite.lean b/LeanPool/OSforGFF/Bochner/PositiveDefinite.lean index 14cbc03793..53b236ad88 100644 --- a/LeanPool/OSforGFF/Bochner/PositiveDefinite.lean +++ b/LeanPool/OSforGFF/Bochner/PositiveDefinite.lean @@ -5,7 +5,7 @@ Authors: Michael R. Douglas -/ -import Mathlib.Data.Complex.Basic +import Mathlib.Basic.Complex.Basic import Mathlib.Analysis.Complex.Order import Mathlib.Algebra.BigOperators.Group.Finset.Basic import Mathlib.Data.Fintype.Basic diff --git a/LeanPool/OSforGFF/Covariance/Momentum.lean b/LeanPool/OSforGFF/Covariance/Momentum.lean index 3bb2116695..bf71aec5fd 100644 --- a/LeanPool/OSforGFF/Covariance/Momentum.lean +++ b/LeanPool/OSforGFF/Covariance/Momentum.lean @@ -12,7 +12,7 @@ import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.Analysis.InnerProductSpace.Basic import Mathlib.Analysis.Distribution.SchwartzSpace.Deriv import Mathlib.MeasureTheory.Integral.Bochner.Basic -import Mathlib.Data.Complex.Basic +import Mathlib.Basic.Complex.Basic import Mathlib.Analysis.Complex.Exponential import Mathlib.Analysis.SpecialFunctions.Gaussian.GaussianIntegral import Mathlib.Analysis.SpecialFunctions.Gaussian.FourierTransform @@ -72,7 +72,7 @@ lemma schwartz_L2_integrable (f : TestFunctionℂ) : -- Using Mathlib's `SchwartzMap.memLp` we know any Schwartz function lies in every `L^p` space. have hf_memLp : MemLp f 2 volume := f.memLp 2 volume - have hf_meas : AEStronglyMeasurable f volume := hf_memLp.1 + have hf_meas : AEStronglyMeasurable f volume := hf_memLp.aestronglyMeasurable -- Translate the `L^2` membership into integrability of the squared norm. simpa using (memLp_two_iff_integrable_sq_norm hf_meas).1 hf_memLp diff --git a/LeanPool/OSforGFF/Covariance/Position.lean b/LeanPool/OSforGFF/Covariance/Position.lean index 61afab4435..90087e965b 100644 --- a/LeanPool/OSforGFF/Covariance/Position.lean +++ b/LeanPool/OSforGFF/Covariance/Position.lean @@ -12,7 +12,7 @@ import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.Analysis.InnerProductSpace.Basic import Mathlib.Analysis.Distribution.SchwartzSpace.Deriv import Mathlib.MeasureTheory.Integral.Bochner.Basic -import Mathlib.Data.Complex.Basic +import Mathlib.Basic.Complex.Basic import Mathlib.Analysis.Complex.Exponential import Mathlib.Analysis.SpecialFunctions.Gaussian.GaussianIntegral diff --git a/LeanPool/OSforGFF/Covariance/RealForm.lean b/LeanPool/OSforGFF/Covariance/RealForm.lean index 7121da4c75..36c36fa998 100644 --- a/LeanPool/OSforGFF/Covariance/RealForm.lean +++ b/LeanPool/OSforGFF/Covariance/RealForm.lean @@ -12,7 +12,7 @@ import Mathlib.Data.Nat.Factorial.DoubleFactorial import Mathlib.Analysis.InnerProductSpace.Basic import Mathlib.Analysis.Distribution.SchwartzSpace.Deriv import Mathlib.MeasureTheory.Integral.Bochner.Basic -import Mathlib.Data.Complex.Basic +import Mathlib.Basic.Complex.Basic import LeanPool.OSforGFF.Spacetime.Basic import LeanPool.OSforGFF.Spacetime.PositiveTimeTestFunction @@ -125,7 +125,7 @@ lemma sqrtPropagatorMap_sq_integrable (m : ℝ) [Fact (0 < m)] (f : TestFunction set F := SchwartzMap.fourierTransformCLM ℂ (toComplex f) have hF_sq : Integrable (fun k => ‖F k‖ ^ 2) volume := schwartz_L2_integrable F - have hF_meas : AEStronglyMeasurable F volume := (F.memLp 2 volume).1 + have hF_meas : AEStronglyMeasurable F volume := (F.memLp 2 volume).aestronglyMeasurable have h_weight_meas : AEStronglyMeasurable (momentumWeightSqrtMathlib m) volume := (momentumWeightSqrt_mathlib_measurable (m := m)).aestronglyMeasurable have h_map_meas : AEStronglyMeasurable (sqrtPropagatorMap m f) volume := by @@ -177,7 +177,7 @@ lemma sqrtPropagatorMap_memLp (m : ℝ) [Fact (0 < m)] (f : TestFunction) : MemLp (sqrtPropagatorMap m f) 2 volume := by classical set F := SchwartzMap.fourierTransformCLM ℂ (toComplex f) - have hF_meas : AEStronglyMeasurable F volume := (F.memLp 2 volume).1 + have hF_meas : AEStronglyMeasurable F volume := (F.memLp 2 volume).aestronglyMeasurable have h_weight_meas : AEStronglyMeasurable (momentumWeightSqrtMathlib m) volume := (momentumWeightSqrt_mathlib_measurable (m := m)).aestronglyMeasurable have h_weight_C : AEStronglyMeasurable (fun k => (momentumWeightSqrtMathlib m k : ℂ)) volume := @@ -344,6 +344,7 @@ lemma embeddingMap_norm_sq (m : ℝ) [Fact (0 < m)] (f : TestFunction) : congr 1 have h_eq := MeasureTheory.eLpNorm_nnreal_pow_eq_lintegral (f := sqrtPropagatorMap m f) (p := 2) (μ := volume) h_two_ne + h_memLp.aestronglyMeasurable simp only [ENNReal.coe_ofNat, NNReal.coe_ofNat] at h_eq have h_pow_cast : (eLpNorm (sqrtPropagatorMap m f) 2 volume) ^ (2 : ℕ) = (eLpNorm (sqrtPropagatorMap m f) 2 volume) ^ (2 : ℝ) := by diff --git a/LeanPool/OSforGFF/GaussianField/Nuclear/NuclearTensorProduct.lean b/LeanPool/OSforGFF/GaussianField/Nuclear/NuclearTensorProduct.lean index 7e8115d777..e56de642da 100644 --- a/LeanPool/OSforGFF/GaussianField/Nuclear/NuclearTensorProduct.lean +++ b/LeanPool/OSforGFF/GaussianField/Nuclear/NuclearTensorProduct.lean @@ -155,7 +155,7 @@ theorem rapidDecay_withSeminorms : ⟨rfl⟩ instance instIsTopologicalAddGroup : IsTopologicalAddGroup RapidDecaySeq := - rapidDecay_withSeminorms.topologicalAddGroup + rapidDecay_withSeminorms.isTopologicalAddGroup instance instContinuousSMul : ContinuousSMul ℝ RapidDecaySeq := rapidDecay_withSeminorms.continuousSMul diff --git a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/HermiteTensorProduct.lean b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/HermiteTensorProduct.lean index b9129aaf79..15f821bd90 100644 --- a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/HermiteTensorProduct.lean +++ b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/HermiteTensorProduct.lean @@ -838,7 +838,7 @@ private lemma norm_iteratedFDeriv_hermite_comp_proj_le (d : ℕ) (n : ℕ) (i : L.iteratedFDeriv_comp_right hf_smooth x (i := m) (mod_cast le_top) have h_prod_le : ∏ _j : Fin m, ‖L‖ ≤ 1 := by calc ∏ _j : Fin m, ‖L‖ ≤ ∏ _j : Fin m, (1 : ℝ) := - Finset.prod_le_prod (fun _ _ => norm_nonneg _) (fun _ _ => hL_le) + Finset.prod_le_prod₀ (fun _ _ => norm_nonneg _) (fun _ _ => hL_le) _ = 1 := by simp rw [hcomp, hiFD] calc ‖(iteratedFDeriv ℝ m (hermiteFunction n) (L x)).compContinuousLinearMap @@ -972,7 +972,7 @@ private lemma hermiteFunctionNd_decay (d : ℕ) (α : MultiIndex d) (k n : ℕ) (Finset.mem_univ j₀)).symm, ← mul_assoc] exact mul_le_mul ((hC_dec j₀ ((p : Multiset (Fin (d + 1))).count j₀)).2 x) - (Finset.prod_le_prod (fun j _ => norm_nonneg _) + (Finset.prod_le_prod₀ (fun j _ => norm_nonneg _) (fun j _ => (hM j ((p : Multiset (Fin (d + 1))).count j)).2 x)) (Finset.prod_nonneg fun j _ => norm_nonneg _) ((hC_dec j₀ ((p : Multiset (Fin (d + 1))).count j₀)).1) @@ -1618,7 +1618,7 @@ private lemma schwartzHermiteBasisNd_weighted_product_bound (d k l : ℕ) (C₁ * (1 + (MultiIndex.abs α : ℝ)) ^ s₁) := by apply mul_le_mul · exact hC_poly α j₀ _ (h_count_le p j₀) x - · exact Finset.prod_le_prod (fun j _ => norm_nonneg _) + · exact Finset.prod_le_prod₀ (fun j _ => norm_nonneg _) (fun j _ => hM_poly α j _ (h_count_le p j) x) · exact Finset.prod_nonneg fun j _ => norm_nonneg _ · positivity diff --git a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/SchwartzHermiteExpansion.lean b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/SchwartzHermiteExpansion.lean index 5c7a5aba55..32145465d8 100644 --- a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/SchwartzHermiteExpansion.lean +++ b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/SchwartzHermiteExpansion.lean @@ -959,14 +959,13 @@ private lemma hermite_series_memLp (f : SchwartzMap ℝ ℝ) : aestronglyMeasurable_of_tendsto_ae Filter.atTop (fun N => (hS_memLp N).aestronglyMeasurable) (ae_of_all _ hS_tendsto) - -- Split: MemLp = AEStronglyMeasurable ∧ eLpNorm < ∞ - refine ⟨h_aesm, ?_⟩ + -- `MemLp` unfolds to `eLpNorm < ∞` -- Use Fatou for eLpNorm: eLpNorm(limit) ≤ liminf eLpNorm(S_N) -- Then bound liminf by eLpNorm(f) using Bessel inequality apply lt_of_le_of_lt -- Step 1: Fatou gives eLpNorm(tsum) ≤ liminf eLpNorm(S_N) · exact Lp.eLpNorm_lim_le_liminf_eLpNorm - (fun N => (hS_memLp N).aestronglyMeasurable) _ (ae_of_all _ hS_tendsto) + (fun N => (hS_memLp N).aestronglyMeasurable) _ h_aesm (ae_of_all _ hS_tendsto) -- Step 2: liminf eLpNorm(S_N) ≤ eLpNorm(f) < ∞ -- Helper: convert ∫⁻ ‖g‖ₑ^(ENNReal.toReal 2) to ENNReal.ofReal (∫ g^2) have h_lintegral_sq : ∀ (g : ℝ → ℝ) (hg : Integrable (fun x => g x ^ 2) volume), @@ -983,8 +982,10 @@ private lemma hermite_series_memLp (f : SchwartzMap ℝ ℝ) : -- Helper: eLpNorm(S_N) ≤ eLpNorm(f) for all N have h_eLpNorm_le : ∀ N, eLpNorm (S N) 2 volume ≤ eLpNorm f 2 volume := by intro N - rw [eLpNorm_eq_lintegral_rpow_enorm_toReal two_ne_zero ENNReal.ofNat_ne_top, - eLpNorm_eq_lintegral_rpow_enorm_toReal two_ne_zero ENNReal.ofNat_ne_top] + rw [eLpNorm_eq_lintegral_rpow_enorm_toReal two_ne_zero ENNReal.ofNat_ne_top + (hS_memLp N).aestronglyMeasurable, + eLpNorm_eq_lintegral_rpow_enorm_toReal two_ne_zero ENNReal.ofNat_ne_top + (f.memLp 2 volume).aestronglyMeasurable] apply ENNReal.rpow_le_rpow _ (by positivity) rw [h_lintegral_sq (S N) (hS_memLp N).integrable_sq, h_lintegral_sq f (f.memLp 2 volume).integrable_sq] @@ -992,7 +993,7 @@ private lemma hermite_series_memLp (f : SchwartzMap ℝ ℝ) : apply lt_of_le_of_lt · apply Filter.liminf_le_of_frequently_le' exact Filter.Frequently.of_forall (fun N => h_eLpNorm_le N) - · exact (f.memLp 2 volume).2 + · exact f.memLp 2 volume -- Helper: integral of tsum · ψₘ equals tsum of integrals -- Uses integral_tsum with dominated convergence diff --git a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/SchwartzSlicing.lean b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/SchwartzSlicing.lean index 94d1fa0e16..94c584dcde 100644 --- a/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/SchwartzSlicing.lean +++ b/LeanPool/OSforGFF/GaussianField/SchwartzNuclear/SchwartzSlicing.lean @@ -383,7 +383,7 @@ private lemma schwartz_slice_y_le_seminorm (d : ℕ) _ ≤ ‖iteratedFDeriv ℝ m f' (L y)‖ * 1 := by gcongr calc ∏ _ : Fin m, ‖L‖ ≤ ∏ _ : Fin m, (1 : ℝ) := - Finset.prod_le_prod (fun _ _ => norm_nonneg _) + Finset.prod_le_prod₀ (fun _ _ => norm_nonneg _) (fun _ _ => euclideanSnoc_linearCLM_norm_le d) _ = 1 := by simp _ = ‖iteratedFDeriv ℝ m f (c + L y)‖ := by rw [mul_one, h_trans] @@ -745,7 +745,7 @@ noncomputable def schwartzSlicePartial (d : ℕ) ContinuousMultilinearMap.norm_compContinuousLinearMap_le _ _ _ ≤ ‖iteratedFDeriv ℝ b G' (L_t t)‖ * 1 := by gcongr; calc ∏ _ : Fin b, ‖L_t‖ ≤ ∏ _ : Fin b, (1 : ℝ) := - Finset.prod_le_prod (fun _ _ => norm_nonneg _) (fun _ _ => h_Lt_norm) + Finset.prod_le_prod₀ (fun _ _ => norm_nonneg _) (fun _ _ => h_Lt_norm) _ = 1 := by simp _ = ‖iteratedFDeriv ℝ b G (c₀ + L_t t)‖ := by rw [mul_one]; congr 1; exact iteratedFDeriv_comp_add_left b c₀ (L_t t) @@ -985,7 +985,7 @@ private lemma schwartz_slice_partial_pointwise_bound (d : ℕ) ContinuousMultilinearMap.norm_compContinuousLinearMap_le _ _ _ ≤ ‖iteratedFDeriv ℝ b G' (L_t t)‖ * 1 := by gcongr; calc ∏ _ : Fin b, ‖L_t‖ ≤ ∏ _ : Fin b, (1 : ℝ) := - Finset.prod_le_prod (fun _ _ => norm_nonneg _) (fun _ _ => h_Lt_norm) + Finset.prod_le_prod₀ (fun _ _ => norm_nonneg _) (fun _ _ => h_Lt_norm) _ = 1 := by simp _ = ‖iteratedFDeriv ℝ b G (c₀ + L_t t)‖ := by rw [mul_one]; congr 1; exact iteratedFDeriv_comp_add_left b c₀ (L_t t) @@ -1063,7 +1063,7 @@ lemma schwartz_slice_partial_seminorm_bound (d : ℕ) (k' l' a b : ℕ) : calc ‖A w‖ ≤ ‖A‖ * ∏ i, ‖w i‖ := A.le_opNorm w _ = (∏ i, ‖w i‖) * ‖A‖ := mul_comm _ _ _ ≤ ∏ i, ‖v i‖ := by - apply Finset.prod_le_prod (fun _ _ => norm_nonneg _) + apply Finset.prod_le_prod₀ (fun _ _ => norm_nonneg _) intro i _ calc ‖w i‖ = ‖L (v i)‖ := rfl _ ≤ ‖L‖ * ‖v i‖ := ContinuousLinearMap.le_opNorm L (v i) diff --git a/LeanPool/OSforGFF/General/FunctionalAnalysis.lean b/LeanPool/OSforGFF/General/FunctionalAnalysis.lean index 5aac04424f..99fc670a60 100644 --- a/LeanPool/OSforGFF/General/FunctionalAnalysis.lean +++ b/LeanPool/OSforGFF/General/FunctionalAnalysis.lean @@ -161,7 +161,7 @@ noncomputable def liftMeasureRealToComplex (fun φ : Lp ℝ 2 μ => Complex.ofRealCLM.compLp φ : Lp ℝ 2 μ → Lp ℂ 2 μ) := Complex.ofRealCLM_continuous_compLp exact this - have h_is_prob := isProbabilityMeasure_map h_ae + have h_is_prob := (Measure.isProbabilityMeasure_map_iff h_ae).mpr inferInstance ⟨dμ_complex_measure, h_is_prob⟩ end LiftMeasure @@ -264,9 +264,10 @@ theorem linfty_mul_L2_CLM_norm_bound {μ : Measure α} _ ≤ ‖(ContinuousLinearMap.mul ℂ ℂ)‖ * ‖hg_mem.toLp‖ * ‖f‖ := by apply ContinuousLinearMap.norm_holder_apply_apply_le _ ≤ C * ‖f‖ := by - simp only [ContinuousLinearMap.opNorm_mul, Lp.norm_toLp, eLpNorm_exponent_top, one_mul] + simp only [ContinuousLinearMap.opNorm_mul, Lp.norm_toLp, one_mul] gcongr refine toReal_le_of_le_ofReal hC ?_ + rw [eLpNorm_exponent_top hg_meas.aestronglyMeasurable] exact eLpNormEssSup_le_of_ae_bound hg_bound /-! ## Local Integrability of Power-Law Decay Functions @@ -533,10 +534,7 @@ theorem schwartz_bilinear_integrable_of_translationInvariant_L1 -- The map preserves measure (translation invariance of Lebesgue measure) have he_preserves : MeasurePreserving e (volume.prod volume) (volume.prod volume) := by -- Use measurePreserving_sub_prod: (x, y) ↦ (x - y, y) preserves measure - have := measurePreserving_sub_prod (G := EuclideanSpace ℝ (Fin d)) volume volume - convert this using 1 - ext p : 1 - rfl + exact measurePreserving_sub_prod (G := EuclideanSpace ℝ (Fin d)) volume volume have hchange : Integrable (fun p : EuclideanSpace ℝ (Fin d) × EuclideanSpace ℝ (Fin d) => ‖K₀ (p.1 - p.2)‖ * ‖g p.2‖) (volume.prod volume) := by -- We have hprod : Integrable (fun p => ‖K₀ p.1‖ * ‖g p.2‖) diff --git a/LeanPool/OSforGFF/General/L2TimeIntegral.lean b/LeanPool/OSforGFF/General/L2TimeIntegral.lean index cfb0d12042..52af406011 100644 --- a/LeanPool/OSforGFF/General/L2TimeIntegral.lean +++ b/LeanPool/OSforGFF/General/L2TimeIntegral.lean @@ -878,7 +878,7 @@ private lemma memLp_two_lintegral_nnnorm_sq {α ε : Type*} [MeasurableSpace α] ∫⁻ x, ↑‖f x‖₊ ^ (2 : ℕ) ∂μ < ⊤ := by have h := hf.eLpNorm_lt_top rw [eLpNorm_eq_lintegral_rpow_enorm_toReal (by norm_num : (2 : ℝ≥0∞) ≠ 0) - (by norm_num : (2 : ℝ≥0∞) ≠ ⊤)] at h + (by norm_num : (2 : ℝ≥0∞) ≠ ⊤) hf.aestronglyMeasurable] at h simp only [toReal_ofNat] at h rw [rpow_lt_top_iff_of_pos (by positivity : (0:ℝ) < 1/2)] at h refine lt_of_eq_of_lt ?_ h diff --git a/LeanPool/OSforGFF/General/PositiveDefinite.lean b/LeanPool/OSforGFF/General/PositiveDefinite.lean index 3a5ebb1b31..3d5a0cab9a 100644 --- a/LeanPool/OSforGFF/General/PositiveDefinite.lean +++ b/LeanPool/OSforGFF/General/PositiveDefinite.lean @@ -5,7 +5,7 @@ Authors: Michael R. Douglas, Sarah Hoback, Anna Mei, Ron Nissim -/ -import Mathlib.Data.Complex.Basic +import Mathlib.Basic.Complex.Basic import Mathlib.Algebra.BigOperators.Group.Finset.Basic import Mathlib.Data.Fintype.Basic import Mathlib.Algebra.Module.LinearMap.Defs diff --git a/LeanPool/OSforGFF/General/SchwartzTranslationDecay.lean b/LeanPool/OSforGFF/General/SchwartzTranslationDecay.lean index fac39fe265..fe22f764dc 100644 --- a/LeanPool/OSforGFF/General/SchwartzTranslationDecay.lean +++ b/LeanPool/OSforGFF/General/SchwartzTranslationDecay.lean @@ -441,10 +441,7 @@ theorem schwartz_bilinear_prod_integrable measurable_toFun := Measurable.prodMk (measurable_fst.sub measurable_snd) measurable_snd measurable_invFun := Measurable.prodMk (measurable_fst.add measurable_snd) measurable_snd } have he_preserves : MeasurePreserving e (volume.prod volume) (volume.prod volume) := by - have := measurePreserving_sub_prod (G := E) volume volume - convert this using 1 - ext p : 1 - rfl + exact measurePreserving_sub_prod (G := E) volume volume have h_Ks_shifted : Integrable (fun p : E × E => (K_sing (p.1 - p.2) : ℂ) * g (p.2 - a)) (volume.prod volume) := by have heq : (fun p : E × E => (K_sing (p.1 - p.2) : ℂ) * g (p.2 - a)) = diff --git a/LeanPool/OSforGFF/KolmogorovExtension4/KolmogorovExtension.lean b/LeanPool/OSforGFF/KolmogorovExtension4/KolmogorovExtension.lean index 0fafdd16ac..9827266864 100644 --- a/LeanPool/OSforGFF/KolmogorovExtension4/KolmogorovExtension.lean +++ b/LeanPool/OSforGFF/KolmogorovExtension4/KolmogorovExtension.lean @@ -8,6 +8,7 @@ import LeanPool.OSforGFF.KolmogorovExtension4.RegularContent import Mathlib.MeasureTheory.Constructions.ProjectiveFamilyContent import Mathlib.MeasureTheory.Measure.RegularityCompacts import Mathlib.MeasureTheory.OuterMeasure.OfAddContent +import Mathlib.Topology.MetricSpace.Polish /-! # Kolmogorov Extension diff --git a/LeanPool/OSforGFF/Measure/Construct.lean b/LeanPool/OSforGFF/Measure/Construct.lean index 575c173793..cab798c90d 100644 --- a/LeanPool/OSforGFF/Measure/Construct.lean +++ b/LeanPool/OSforGFF/Measure/Construct.lean @@ -223,7 +223,8 @@ private lemma gff_pushforward_charFun Complex.exp (-(1/2 : ℂ) * t^2 * (freeCovarianceFormR m φ φ : ℝ)) := by have : IsProbabilityMeasure ((gaussianFreeFieldFree m).toMeasure.map (distributionPairingCLM φ)) := - Measure.isProbabilityMeasure_map ((distributionPairingCLM_measurable φ).aemeasurable) + (Measure.isProbabilityMeasure_map_iff + ((distributionPairingCLM_measurable φ).aemeasurable)).mpr inferInstance rw [charFun_eq_GJGeneratingFunctional] have h_char := gff_real_characteristic m (t • φ) rw [h_char] @@ -241,7 +242,8 @@ theorem gff_pairing_is_gaussian = gaussianReal 0 (freeCovarianceFormR m φ φ).toNNReal := by have : IsProbabilityMeasure ((gaussianFreeFieldFree m).toMeasure.map (distributionPairingCLM φ)) := - Measure.isProbabilityMeasure_map ((distributionPairingCLM_measurable φ).aemeasurable) + (Measure.isProbabilityMeasure_map_iff + ((distributionPairingCLM_measurable φ).aemeasurable)).mpr inferInstance apply charFun_implies_gaussian intro t rw [gff_pushforward_charFun] diff --git a/LeanPool/OSforGFF/Measure/GaussianFreeField.lean b/LeanPool/OSforGFF/Measure/GaussianFreeField.lean index 24dc8b4e69..91c593e0fc 100644 --- a/LeanPool/OSforGFF/Measure/GaussianFreeField.lean +++ b/LeanPool/OSforGFF/Measure/GaussianFreeField.lean @@ -9,7 +9,7 @@ import Mathlib.Analysis.Analytic.Basic import Mathlib.Analysis.Analytic.Constructions import Mathlib.Analysis.SpecialFunctions.Complex.Analytic import Mathlib.LinearAlgebra.BilinearMap -import Mathlib.Data.Complex.Basic +import Mathlib.Basic.Complex.Basic import Mathlib.Data.Finset.Basic import Mathlib.Tactic.Ring import Mathlib.Tactic.Linarith diff --git a/LeanPool/OSforGFF/Measure/Minlos.lean b/LeanPool/OSforGFF/Measure/Minlos.lean index 4780278a2e..a90e6adac3 100644 --- a/LeanPool/OSforGFF/Measure/Minlos.lean +++ b/LeanPool/OSforGFF/Measure/Minlos.lean @@ -5,7 +5,7 @@ Authors: Michael R. Douglas, Sarah Hoback, Anna Mei, Ron Nissim -/ -import Mathlib.Data.Complex.Basic +import Mathlib.Basic.Complex.Basic import Mathlib.Analysis.InnerProductSpace.Basic import Mathlib.MeasureTheory.Measure.ProbabilityMeasure import LeanPool.OSforGFF.General.PositiveDefinite diff --git a/LeanPool/OSforGFF/Measure/MinlosAnalytic.lean b/LeanPool/OSforGFF/Measure/MinlosAnalytic.lean index 94feb4a049..fffc12a9e8 100644 --- a/LeanPool/OSforGFF/Measure/MinlosAnalytic.lean +++ b/LeanPool/OSforGFF/Measure/MinlosAnalytic.lean @@ -5,7 +5,7 @@ Authors: Michael R. Douglas, Sarah Hoback, Anna Mei, Ron Nissim -/ -import Mathlib.Data.Complex.Basic +import Mathlib.Basic.Complex.Basic import Mathlib.Analysis.LocallyConvex.Basic import Mathlib.Topology.Algebra.Module.Spaces.WeakDual import Mathlib.Analysis.Distribution.SchwartzSpace.Deriv @@ -99,7 +99,8 @@ lemma integral_neg_invariance -- Step 1: Define the pushforward measure let μneg := μ.toMeasure.map negMap have hμneg_prob : IsProbabilityMeasure μneg := by - exact Measure.isProbabilityMeasure_map (Measurable.aemeasurable negMap_measurable) + exact (Measure.isProbabilityMeasure_map_iff + (Measurable.aemeasurable negMap_measurable)).mpr inferInstance -- Step 2: Show characteristic functionals are equal have hCF_equal : ∀ g : TestFunction, ∫ ω, Complex.exp (Complex.I * (distributionPairing ω g)) ∂μneg diff --git a/LeanPool/OSforGFF/Minlos/MeasurableModification.lean b/LeanPool/OSforGFF/Minlos/MeasurableModification.lean index 95f40de95d..5cc602c24e 100644 --- a/LeanPool/OSforGFF/Minlos/MeasurableModification.lean +++ b/LeanPool/OSforGFF/Minlos/MeasurableModification.lean @@ -87,7 +87,7 @@ lemma weakDualEmbed_injective : Function.Injective (weakDualEmbed E) := by w.r.t. the cylinder σ-algebra (by definition). -/ lemma measurable_weakDualEmbed : Measurable (weakDualEmbed E) := by - apply measurable_pi_lambda + apply Measurable.of_eval intro f exact WeakDual.eval_measurable f @@ -1029,7 +1029,8 @@ theorem projection_ae_eq [SeparableSpace E] [IsHilbertNuclear E] [Nonempty E] lemma isProbabilityMeasure_map_projection [SeparableSpace E] [IsHilbertNuclear E] [Nonempty E] (ν : Measure (E → ℝ)) [IsProbabilityMeasure ν] : IsProbabilityMeasure (ν.map (measurableProjection (E := E))) := - Measure.isProbabilityMeasure_map measurable_measurableProjection.aemeasurable + (Measure.isProbabilityMeasure_map_iff + measurable_measurableProjection.aemeasurable).mpr inferInstance /-- The characteristic functional of ν.map P equals Φ. -/ lemma charFunctional_map_projection [SeparableSpace E] [IsHilbertNuclear E] [Nonempty E] diff --git a/LeanPool/OSforGFF/Minlos/MinlosConcentration.lean b/LeanPool/OSforGFF/Minlos/MinlosConcentration.lean index a4206d7e3e..5e164d285e 100644 --- a/LeanPool/OSforGFF/Minlos/MinlosConcentration.lean +++ b/LeanPool/OSforGFF/Minlos/MinlosConcentration.lean @@ -316,7 +316,7 @@ lemma pushforward_charfun_eq ∫ y : Fin k → ℝ, exp (I * ↑(∑ j, v j * y j)) ∂(ν.map (fun ω j => ω (e j))) = Φ (∑ j, v j • e j) := by have hg : Measurable (fun ω : E → ℝ => (fun j => ω (e j) : Fin k → ℝ)) := - measurable_pi_lambda _ (fun j => measurable_pi_apply (e j)) + Measurable.of_eval (fun j => measurable_pi_apply (e j)) rw [integral_map hg.aemeasurable (Continuous.aestronglyMeasurable (by fun_prop))] exact h_cf_joint k v e @@ -847,10 +847,10 @@ private lemma joint_kernel_bound_finite let toLp := MeasurableEquiv.toLp (p := 2) (X := Fin (n + 1) → ℝ) let eval_z : (E → ℝ) → V := fun ω => toLp (fun j => ω (z j)) have h_meas_z : Measurable eval_z := - toLp.measurable.comp (measurable_pi_lambda _ (fun j => measurable_pi_apply (z j))) + toLp.measurable.comp (Measurable.of_eval (fun j => measurable_pi_apply (z j))) let μ := ν.map eval_z have h_prob : IsProbabilityMeasure μ := - Measure.isProbabilityMeasure_map h_meas_z.aemeasurable + (Measure.isProbabilityMeasure_map_iff h_meas_z.aemeasurable).mpr inferInstance let μ' : ProbabilityMeasure V := ⟨μ, h_prob⟩ -- Step 1: Coordinate access: (eval_z ω) i = ω (z i) have h_coord : ∀ (ω : E → ℝ) (i : Fin (n + 1)), (eval_z ω) i = ω (z i) := fun _ _ => rfl @@ -1290,10 +1290,10 @@ private lemma tail_bound_uniform_gaussian_average let toLp := MeasurableEquiv.toLp (p := 2) (X := Fin (k + 1) → ℝ) let eval_e : (E → ℝ) → V := fun ω => toLp (fun j => ω (e j)) have h_meas_e : Measurable eval_e := - toLp.measurable.comp (measurable_pi_lambda _ (fun j => measurable_pi_apply (e j))) + toLp.measurable.comp (Measurable.of_eval (fun j => measurable_pi_apply (e j))) let μ := ν.map eval_e have h_prob : IsProbabilityMeasure μ := - Measure.isProbabilityMeasure_map h_meas_e.aemeasurable + (Measure.isProbabilityMeasure_map_iff h_meas_e.aemeasurable).mpr inferInstance let μ' : ProbabilityMeasure V := ⟨μ, h_prob⟩ have h_coord : ∀ (ω : E → ℝ) (i : Fin (k + 1)), (eval_e ω) i = ω (e i) := fun _ _ => rfl have h_inner_V : ∀ (ω : E → ℝ) (v : V), diff --git a/LeanPool/OSforGFF/Minlos/ProjectiveFamily.lean b/LeanPool/OSforGFF/Minlos/ProjectiveFamily.lean index 38830040a5..ced46eda14 100644 --- a/LeanPool/OSforGFF/Minlos/ProjectiveFamily.lean +++ b/LeanPool/OSforGFF/Minlos/ProjectiveFamily.lean @@ -37,8 +37,8 @@ def finsetReindexEquiv (J : Finset E) : invFun := fun t j => t (J.equivFin j) left_inv := fun x => by ext j; simp right_inv := fun t => by ext i; simp } - measurable_toFun := measurable_pi_lambda _ (fun i => measurable_pi_apply _) - measurable_invFun := measurable_pi_lambda _ (fun j => measurable_pi_apply _) + measurable_toFun := Measurable.of_eval (fun i => measurable_pi_apply _) + measurable_invFun := Measurable.of_eval (fun j => measurable_pi_apply _) /-- Measurable equivalence between `∀ j : J, ℝ` and `EuclideanSpace ℝ (Fin |J|)`. Composition of reindexing by `J.equivFin` and `MeasurableEquiv.toLp`. @@ -83,7 +83,8 @@ instance marginalFamilyIsFiniteMeasure (Φ : E → ℂ) (hΦ_cont : Continuous instance marginalFamilyIsProbabilityMeasure (Φ : E → ℂ) (hΦ_cont : Continuous Φ) (hΦ_pd : IsPositiveDefinite Φ) (hΦ_norm : Φ 0 = 1) (J : Finset E) : IsProbabilityMeasure (marginalFamily Φ hΦ_cont hΦ_pd hΦ_norm J) := - Measure.isProbabilityMeasure_map (finsetPiMeasEquiv J).symm.measurable.aemeasurable + (Measure.isProbabilityMeasure_map_iff + (finsetPiMeasEquiv J).symm.measurable.aemeasurable).mpr inferInstance /-! ## Projectivity @@ -117,7 +118,7 @@ omit [AddCommGroup E] [Module ℝ E] [TopologicalSpace E] [IsTopologicalAddGroup private lemma euclideanProject_measurable (I J : Finset E) (hJI : J ⊆ I) : Measurable (euclideanProject I J hJI) := by apply (MeasurableEquiv.toLp 2 (Fin J.card → ℝ)).measurable.comp - exact measurable_pi_lambda _ fun k => + exact Measurable.of_eval fun k => (measurable_pi_apply (finsetIndexInj I J hJI k)).comp (MeasurableEquiv.toLp 2 (Fin I.card → ℝ)).symm.measurable diff --git a/LeanPool/OSforGFF/OS/Axioms.lean b/LeanPool/OSforGFF/OS/Axioms.lean index 21f74f3ea9..f2ccf0ea5f 100644 --- a/LeanPool/OSforGFF/OS/Axioms.lean +++ b/LeanPool/OSforGFF/OS/Axioms.lean @@ -27,7 +27,7 @@ import Mathlib.Tactic.Set import Mathlib.Tactic.Polyrith import Mathlib.Tactic.SplitIfs import Mathlib.Tactic.Generalize -import Mathlib.Data.Complex.Basic +import Mathlib.Basic.Complex.Basic import Mathlib.Analysis.Complex.Exponential import Mathlib.Algebra.Group.Support import Mathlib.Analysis.InnerProductSpace.LinearMap diff --git a/LeanPool/OSforGFF/OS/OS0Analyticity.lean b/LeanPool/OSforGFF/OS/OS0Analyticity.lean index 75110d33a0..54f39fc14a 100644 --- a/LeanPool/OSforGFF/OS/OS0Analyticity.lean +++ b/LeanPool/OSforGFF/OS/OS0Analyticity.lean @@ -200,8 +200,7 @@ lemma gff_exp_abs_pairing_memLp (f : TestFunction) (p : ENNReal) (hp : p ≠ ⊤ apply h_dom.mono' ((Real.continuous_exp.measurable.comp (measurable_const.mul (continuous_abs.measurable.comp (WeakDual.eval_measurable f)))).aestronglyMeasurable) simp_all - refine ⟨h_aesm, ?_⟩ - rw [eLpNorm_lt_top_iff_lintegral_rpow_enorm_lt_top hp_pos hp] + rw [memLp_iff, eLpNorm_lt_top_iff_lintegral_rpow_enorm_lt_top hp_pos hp h_aesm] -- ‖exp(|x|)‖ₑ^p = exp(p|x|), reducing finiteness to h_exp_p_integrable. have h_eq : ∀ ω : FieldConfiguration, (‖Real.exp |ω f|‖ₑ : ENNReal) ^ p.toReal = ENNReal.ofReal (Real.exp (p.toReal * |ω f|)) := by @@ -225,7 +224,7 @@ lemma gff_exp_abs_pairing_integrable (f : TestFunction) : /-- Product of exponentials of absolute pairings is in L². If we have k test functions g₁, ..., gₖ, then exp(∑ᵢ |ω gᵢ|) = ∏ᵢ exp(|ω gᵢ|). Each exp(|ω gᵢ|) ∈ L^(2k) by gff_exp_abs_pairing_memLp. - By generalized Hölder (MemLp.prod'), a product of k functions in L^(2k) is in L². + By generalized Hölder (MemLp.fun_prod), a product of k functions in L^(2k) is in L². -/ lemma gff_exp_abs_sum_memLp {ι : Type*} (s : Finset ι) (g : ι → TestFunction) : MemLp (fun ω : FieldConfiguration => Real.exp (∑ i ∈ s, |ω (g i)|)) 2 (muGFF m).toMeasure := by @@ -239,7 +238,7 @@ lemma gff_exp_abs_sum_memLp {ι : Type*} (s : Finset ι) (g : ι → TestFunctio -- For nonempty s, each factor is in L^(2·card s); generalized Hölder gives L². have hk_ne_zero : (s.card : ENNReal) ≠ 0 := by simpa using (Finset.card_pos.mpr hs).ne' have hk_ne_top : (s.card : ENNReal) ≠ ⊤ := ENNReal.natCast_ne_top s.card - have h_prod := MemLp.prod' (s := s) (p := fun _ => (2 * s.card : ℕ)) + have h_prod := MemLp.fun_prod (s := s) (p := fun _ => (2 * s.card : ℕ)) (f := fun i (ω : FieldConfiguration) => Real.exp |ω (g i)|) (fun i _ => gff_exp_abs_pairing_memLp m (g i) (2 * s.card : ℕ) (ENNReal.natCast_ne_top _)) -- The resulting exponent is (∑ i ∈ s, (2·card s)⁻¹)⁻¹ = (card s · (2·card s)⁻¹)⁻¹ = 2. diff --git a/LeanPool/OSforGFF/OS/OS1Regularity.lean b/LeanPool/OSforGFF/OS/OS1Regularity.lean index bb62072760..1ac4c4efd0 100644 --- a/LeanPool/OSforGFF/OS/OS1Regularity.lean +++ b/LeanPool/OSforGFF/OS/OS1Regularity.lean @@ -330,7 +330,7 @@ lemma covariance_imaginary_L2_bound (m : ℝ) [Fact (0 < m)] (f : TestFunction simpa [one_div] using this -- Show integrability of ‖F‖² via MemLp → Integrable (square norm) have hF_memLp : MemLp F 2 volume := F.memLp 2 volume - have hF_meas : AEStronglyMeasurable F volume := hF_memLp.1 + have hF_meas : AEStronglyMeasurable F volume := hF_memLp.aestronglyMeasurable have hF_sq_int : Integrable (fun k => ‖F k‖^2) volume := (memLp_two_iff_integrable_sq_norm hF_meas).1 hF_memLp -- The weighted integrand measurability (not strictly needed for the monotonicity helper) @@ -388,11 +388,11 @@ lemma covariance_imaginary_L2_bound (m : ℝ) [Fact (0 < m)] (f : TestFunction simpa [hL, fIm, complexTestFunctionDecompose] using hsq -- Show integrability of both sides to apply integral monotonicity have hIm_memLp : MemLp (toComplex fIm) 2 volume := (toComplex fIm).memLp 2 volume - have hIm_meas : AEStronglyMeasurable (toComplex fIm) volume := hIm_memLp.1 + have hIm_meas : AEStronglyMeasurable (toComplex fIm) volume := hIm_memLp.aestronglyMeasurable have hIm_sq_int : Integrable (fun x => ‖(toComplex fIm) x‖^2) volume := (memLp_two_iff_integrable_sq_norm hIm_meas).1 hIm_memLp have hf_memLp : MemLp f 2 volume := f.memLp 2 volume - have hf_meas : AEStronglyMeasurable f volume := hf_memLp.1 + have hf_meas : AEStronglyMeasurable f volume := hf_memLp.aestronglyMeasurable have hf_sq_int : Integrable (fun x => ‖f x‖^2) volume := (memLp_two_iff_integrable_sq_norm hf_meas).1 hf_memLp have h_imag_bound : ∫ x, ‖(toComplex fIm) x‖^2 ∂volume ≤ ∫ x, ‖f x‖^2 ∂volume := by diff --git a/LeanPool/OSforGFF/OS/OS4Ergodicity.lean b/LeanPool/OSforGFF/OS/OS4Ergodicity.lean index 5ace347f62..f0f143e886 100644 --- a/LeanPool/OSforGFF/OS/OS4Ergodicity.lean +++ b/LeanPool/OSforGFF/OS/OS4Ergodicity.lean @@ -346,8 +346,7 @@ lemma time_average_memLp_two (m : ℝ) [Fact (0 < m)] (f : TestFunctionℂ) (T : have h_int_meas : AEStronglyMeasurable (fun ω => ∫ s in Set.Icc 0 T, A s ω) μ := AEStronglyMeasurable.integral_prod_right' h_swap -- c * f = c • f for ℂ - convert AEStronglyMeasurable.const_smul h_int_meas (1/T : ℂ) using 2 with ω - simp [Pi.smul_apply, smul_eq_mul] + convert AEStronglyMeasurable.const_smul h_int_meas (1/T : ℂ) using 2 -- Apply the proved theorem from L2TimeIntegral exact OSforGFF.time_average_memLp_two μ A T hT h_As_L2 h_uniform h_joint_meas h_avg_meas @@ -372,12 +371,11 @@ lemma gff_err_sq_integrable (m : ℝ) [Fact (0 < m)] (T : ℝ) (hT : T > 0) (f : -- Step 3: Difference is in L² (L² is a vector space) have h_diff_L2 : MemLp (fun ω => (1/T : ℂ) * (∫ s in Set.Icc (0 : ℝ) T, A s ω) - EA) 2 μ := by have h := h_avg_L2.sub h_const_L2 - convert h using 2 with ω - simp [Pi.sub_apply] + convert h using 2 -- Step 4: L² function has integrable square have h_sq_int : Integrable (fun ω => ‖(1/T : ℂ) * (∫ s in Set.Icc (0 : ℝ) T, A s ω) - EA‖^2) μ := by - have h_meas := h_diff_L2.1 + have h_meas := h_diff_L2.aestronglyMeasurable rwa [memLp_two_iff_integrable_sq_norm h_meas] at h_diff_L2 -- Goal matches h_sq_int up to notation: smul ↔ mul, and ∫ ω' ... ↔ EA have h_EA : ∫ ω' : FieldConfiguration, Complex.exp (distributionPairingℂReal ω' f) ∂μ = EA := by diff --git a/LeanPool/OSforGFF/Schwinger/GaussianMoments.lean b/LeanPool/OSforGFF/Schwinger/GaussianMoments.lean index 6612b01fd9..cdc5845e01 100644 --- a/LeanPool/OSforGFF/Schwinger/GaussianMoments.lean +++ b/LeanPool/OSforGFF/Schwinger/GaussianMoments.lean @@ -10,7 +10,7 @@ import Mathlib.MeasureTheory.Integral.IntegrableOn import Mathlib.MeasureTheory.Measure.ProbabilityMeasure import Mathlib.Data.Matrix.Basic import Mathlib.Data.Finset.Basic -import Mathlib.Data.ENNReal.Holder +import Mathlib.Basic.ENNReal.Holder import Mathlib.MeasureTheory.Function.LpSeminorm.CompareExp import LeanPool.OSforGFF.Spacetime.Basic diff --git a/LeanPool/OSforGFF/Spacetime/ComplexTestFunction.lean b/LeanPool/OSforGFF/Spacetime/ComplexTestFunction.lean index e24a7e3fe5..b575420b19 100644 --- a/LeanPool/OSforGFF/Spacetime/ComplexTestFunction.lean +++ b/LeanPool/OSforGFF/Spacetime/ComplexTestFunction.lean @@ -5,7 +5,7 @@ Authors: Michael R. Douglas, Sarah Hoback, Anna Mei, Ron Nissim -/ -import Mathlib.Data.Complex.Basic +import Mathlib.Basic.Complex.Basic import Mathlib.Analysis.Distribution.SchwartzSpace.Deriv import Mathlib.Topology.Algebra.Module.Multilinear.Basic import Mathlib.Analysis.Complex.OperatorNorm diff --git a/LeanPool/OSforGFF/Spacetime/DiscreteSymmetry.lean b/LeanPool/OSforGFF/Spacetime/DiscreteSymmetry.lean index b36c27dceb..614aafde11 100644 --- a/LeanPool/OSforGFF/Spacetime/DiscreteSymmetry.lean +++ b/LeanPool/OSforGFF/Spacetime/DiscreteSymmetry.lean @@ -27,7 +27,7 @@ import Mathlib.Tactic.Set import Mathlib.Tactic.Polyrith import Mathlib.Tactic.SplitIfs import Mathlib.Tactic.Generalize -import Mathlib.Data.Complex.Basic +import Mathlib.Basic.Complex.Basic import Mathlib.Analysis.Complex.Exponential import Mathlib.Algebra.Group.Support import Mathlib.Algebra.Star.Basic diff --git a/LeanPool/OSforGFF/Spacetime/TimeTranslation.lean b/LeanPool/OSforGFF/Spacetime/TimeTranslation.lean index 3f5e684ffc..a71ee49549 100644 --- a/LeanPool/OSforGFF/Spacetime/TimeTranslation.lean +++ b/LeanPool/OSforGFF/Spacetime/TimeTranslation.lean @@ -132,7 +132,7 @@ lemma timeShift_isometry (s : ℝ) : Isometry (timeShift s) := by /-- Time shift is antilipschitz (follows from being an isometry). -/ lemma timeShift_antilipschitz (s : ℝ) : AntilipschitzWith 1 (timeShift s) := - (timeShift_isometry s).antilipschitz + (timeShift_isometry s).antilipschitzWith /-- The constant vector used to express timeShift as id + const. -/ def timeShiftConst (s : ℝ) : SpaceTime := diff --git a/LeanPool/Odlyzko/CompletedZeta/FractionalShapeTheta.lean b/LeanPool/Odlyzko/CompletedZeta/FractionalShapeTheta.lean index 0f74e6c646..dddf6586c7 100644 --- a/LeanPool/Odlyzko/CompletedZeta/FractionalShapeTheta.lean +++ b/LeanPool/Odlyzko/CompletedZeta/FractionalShapeTheta.lean @@ -1032,7 +1032,7 @@ theorem mk0_fractionalIdealNumerator FractionalIdeal (𝓞 K)⁰ (FractionRing (𝓞 K))) grind -omit [IsTotallyComplex K] in +omit [NumberField K] [IsTotallyComplex K] in open Classical in theorem fractionalIdeal_den_ne_zero (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) : @@ -1049,7 +1049,7 @@ noncomputable def numeratorRadii w (algebraMap (𝓞 K) K ((I : FractionalIdeal (𝓞 K)⁰ K).den : 𝓞 K)) -omit [IsTotallyComplex K] in +omit [NumberField K] [IsTotallyComplex K] in open Classical in theorem numeratorRadii_ne_zero (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) diff --git a/LeanPool/Odlyzko/CompletedZeta/FunctionalEquationLogDeriv.lean b/LeanPool/Odlyzko/CompletedZeta/FunctionalEquationLogDeriv.lean index 72aaa18da2..3ddb5125f9 100644 --- a/LeanPool/Odlyzko/CompletedZeta/FunctionalEquationLogDeriv.lean +++ b/LeanPool/Odlyzko/CompletedZeta/FunctionalEquationLogDeriv.lean @@ -76,12 +76,12 @@ theorem logDeriv_completedDedekindXi_rightHalfPlane {s : ℂ} (differentiableAt_dedekindZeta K hs) change logDeriv (fun z : ℂ ↦ z * (z - 1) * CompletedZeta.completed K z) s = _ - rw [logDeriv_mul (f := fun z : ℂ ↦ z * (z - 1)) + rw [logDeriv_fun_mul (f := fun z : ℂ ↦ z * (z - 1)) (g := CompletedZeta.completed K) s hprod0 (completedDedekindZeta_ne_zero_of_one_lt_re K hs) (hdiffS.mul hdiffS1) hdiffCompleted, - logDeriv_mul (f := fun z : ℂ ↦ z) (g := fun z : ℂ ↦ z - 1) + logDeriv_fun_mul (f := fun z : ℂ ↦ z) (g := fun z : ℂ ↦ z - 1) s hs0 hs1 hdiffS hdiffS1, logDeriv_apply, logDeriv_apply] simp only [deriv_id'', deriv_sub_const, one_div] diff --git a/LeanPool/Odlyzko/CompletedZeta/GammaFactor.lean b/LeanPool/Odlyzko/CompletedZeta/GammaFactor.lean index 565cc28121..cd03730be2 100644 --- a/LeanPool/Odlyzko/CompletedZeta/GammaFactor.lean +++ b/LeanPool/Odlyzko/CompletedZeta/GammaFactor.lean @@ -78,7 +78,7 @@ theorem logDeriv_complexPlaceGammaFactor_of_re_pos {s : ℂ} (hs : 0 < s.re) : have hn : 0 < (-n : ℂ).re := h ▸ hs simp only [neg_re, natCast_re, neg_pos] at hn grind - have hmul := logDeriv_mul + have hmul := logDeriv_fun_mul (f := fun z : ℂ ↦ (2 * (Real.pi : ℂ)) ^ (-z)) (g := Complex.Gamma) s (cpow_ne_zero_iff.mpr <| Or.inl hbase) diff --git a/LeanPool/Odlyzko/CompletedZeta/RightHalfPlane.lean b/LeanPool/Odlyzko/CompletedZeta/RightHalfPlane.lean index 03d98adb07..e7a3c7fdd4 100644 --- a/LeanPool/Odlyzko/CompletedZeta/RightHalfPlane.lean +++ b/LeanPool/Odlyzko/CompletedZeta/RightHalfPlane.lean @@ -116,10 +116,10 @@ theorem logDeriv_completedDedekindZeta_of_isTotallyComplex {s : ℂ} (hs : 0 < s differentiable_dedekindDiscriminantFactor K s have hdA : DifferentiableAt ℂ (CompletedZeta.archimedeanFactor K) s := differentiableAt_dedekindArchimedeanFactor_of_isTotallyComplex K hs - rw [logDeriv_mul + rw [logDeriv_fun_mul (f := fun z ↦ CompletedZeta.discriminantFactor K z * CompletedZeta.archimedeanFactor K z) (g := dedekindZeta K) s (mul_ne_zero hD hA) hζne (hdD.mul hdA) hζdiff, - logDeriv_mul + logDeriv_fun_mul (f := CompletedZeta.discriminantFactor K) (g := CompletedZeta.archimedeanFactor K) s hD hA hdD hdA, logDeriv_dedekindDiscriminantFactor, diff --git a/LeanPool/Odlyzko/CompletedZeta/UnitSlabRadial.lean b/LeanPool/Odlyzko/CompletedZeta/UnitSlabRadial.lean index cc64c4cb41..dfbc5f4e17 100644 --- a/LeanPool/Odlyzko/CompletedZeta/UnitSlabRadial.lean +++ b/LeanPool/Odlyzko/CompletedZeta/UnitSlabRadial.lean @@ -88,8 +88,7 @@ theorem nonnegativeRadialHalfSpace_ae_eq_positive : positiveRadialHalfSpace (K := K) := by rw [MeasureTheory.volume_pi] filter_upwards [Measure.ae_eval_ne (fun _ ↦ volume) w₀ 0] with y hy - simp only [nonnegativeRadialHalfSpace, positiveRadialHalfSpace] - apply propext + simp only [nonnegativeRadialHalfSpace, positiveRadialHalfSpace, Set.mem_ofPred_eq, eq_iff_iff] constructor · intro h exact lt_of_le_of_ne h hy.symm @@ -100,7 +99,7 @@ theorem nonnegativeUnitFundamentalParamSet_ae_eq_positive : nonnegativeUnitFundamentalParamSet (K := K) =ᵐ[ (volume : Measure (mixedEmbedding.realSpace K))] positiveUnitFundamentalParamSet (K := K) := - (ae_eq_refl (unitFundamentalParamSet K)).inter + Filter.EventuallyEqSet.inter (Filter.EventuallyEqSet.refl _ (unitFundamentalParamSet K)) nonnegativeRadialHalfSpace_ae_eq_positive open Classical in diff --git a/LeanPool/Odlyzko/CompletedZeta/VerticalLowerBound.lean b/LeanPool/Odlyzko/CompletedZeta/VerticalLowerBound.lean index 265a9e6341..28badd47aa 100644 --- a/LeanPool/Odlyzko/CompletedZeta/VerticalLowerBound.lean +++ b/LeanPool/Odlyzko/CompletedZeta/VerticalLowerBound.lean @@ -118,7 +118,7 @@ theorem norm_inv_dedekindZeta_two_add_mul_I_le (t : ℝ) : ∏ P ∈ S, ‖1 + -inverseNormPower (primeIdealNorm K P) (2 + t * Complex.I)‖ ≤ ∏ P ∈ S, (1 + (primeIdealNorm K P : ℝ) ^ (-(2 : ℝ))) := by - exact Finset.prod_le_prod + exact Finset.prod_le_prod₀ (fun _ _ ↦ norm_nonneg _) (fun P _ ↦ norm_one_sub_inverseNormPower_two_add_mul_I_le K P t) _ ≤ Real.exp (∑ P ∈ S, (primeIdealNorm K P : ℝ) ^ (-(2 : ℝ))) := diff --git a/LeanPool/Odlyzko/ExplicitFormula/CompletedZetaCenterLogBound.lean b/LeanPool/Odlyzko/ExplicitFormula/CompletedZetaCenterLogBound.lean index 488352264f..dae677cde2 100644 --- a/LeanPool/Odlyzko/ExplicitFormula/CompletedZetaCenterLogBound.lean +++ b/LeanPool/Odlyzko/ExplicitFormula/CompletedZetaCenterLogBound.lean @@ -555,7 +555,7 @@ theorem logDeriv_centeredCanonicalZeroProduct (centeredCanonicalZeroFactor c R u w) ^ D u := by funext w simp - rw [hpoint, logDeriv_prod] + rw [hpoint, logDeriv_fun_prod] · rw [finsum_eq_sum_of_support_subset] · apply Finset.sum_congr rfl intro u hu diff --git a/LeanPool/Odlyzko/ExplicitFormula/GaussDigammaEqDigamma.lean b/LeanPool/Odlyzko/ExplicitFormula/GaussDigammaEqDigamma.lean index 36d5728c41..26c1aa495e 100644 --- a/LeanPool/Odlyzko/ExplicitFormula/GaussDigammaEqDigamma.lean +++ b/LeanPool/Odlyzko/ExplicitFormula/GaussDigammaEqDigamma.lean @@ -553,7 +553,7 @@ theorem logDeriv_GammaSeq unfold denominator fun_prop change logDeriv (fun z : ℂ ↦ numerator z / denominator z) s = _ - rw [logDeriv_div s hnum hden hdnum hdden] + rw [logDeriv_fun_div s hnum hden hdnum hdden] have hnumFormula : logDeriv numerator s = Complex.log (n : ℂ) := by unfold numerator @@ -563,7 +563,7 @@ theorem logDeriv_GammaSeq logDeriv denominator s = ∑ j ∈ Finset.range (n + 1), (s + j)⁻¹ := by unfold denominator - rw [logDeriv_prod hs] + rw [logDeriv_fun_prod hs] · apply Finset.sum_congr rfl intro j hj exact logDeriv_add_nat s j diff --git a/LeanPool/Odlyzko/ExplicitFormula/RegularizedPoitouContourLimit.lean b/LeanPool/Odlyzko/ExplicitFormula/RegularizedPoitouContourLimit.lean index 49b37ea27a..64d5381ac1 100644 --- a/LeanPool/Odlyzko/ExplicitFormula/RegularizedPoitouContourLimit.lean +++ b/LeanPool/Odlyzko/ExplicitFormula/RegularizedPoitouContourLimit.lean @@ -499,7 +499,7 @@ theorem logDeriv_completedZetaPoleFactor_eq logDeriv completedZetaPoleFactor s = completedZetaPoleLogDeriv s := by unfold completedZetaPoleFactor completedZetaPoleLogDeriv - rw [logDeriv_mul] + rw [logDeriv_fun_mul] · simp only [logDeriv_apply, deriv_sub_const, deriv_id'', one_div] · simp_all diff --git a/LeanPool/Odlyzko/TestFunction/ComplexFourier.lean b/LeanPool/Odlyzko/TestFunction/ComplexFourier.lean index cd26a54995..efd4bade8e 100644 --- a/LeanPool/Odlyzko/TestFunction/ComplexFourier.lean +++ b/LeanPool/Odlyzko/TestFunction/ComplexFourier.lean @@ -305,10 +305,9 @@ theorem cosineTransform_tartarTestFunction (t : ℝ) : (2 * Real.pi)⁻¹ * Poitou.cosineTransform Tartar.testFunction t := by rw [Poitou.cosineTransform] convert hchange using 1 - · apply integral_congr_ae - filter_upwards [] with v - grind - · simp + apply integral_congr_ae + filter_upwards [] with v + grind have hre' : (16 / 9 : ℝ) * (∫ v : ℝ, Tartar.testFunction (2 * Real.pi * v) * diff --git a/LeanPool/Odlyzko/Theta/PoissonSummation.lean b/LeanPool/Odlyzko/Theta/PoissonSummation.lean index eee5842702..5e9617064a 100644 --- a/LeanPool/Odlyzko/Theta/PoissonSummation.lean +++ b/LeanPool/Odlyzko/Theta/PoissonSummation.lean @@ -325,7 +325,7 @@ theorem summable_latticeGaussian [NormedSpace ℝ E] [FiniteDimensional ℝ E] have hclosed : IsClosed (L : Set E) := by change IsClosed (L.toAddSubgroup : Set E) - exact AddSubgroup.isClosed_of_discrete + exact AddSubgroup.isClosed_of_discreteTopology have htend : Tendsto (norm ∘ ((↑) : L → E)) cofinite atTop := tendsto_norm_comp_cofinite_atTop_of_isClosedEmbedding diff --git a/LeanPool/OrderPQ/Basic.lean b/LeanPool/OrderPQ/Basic.lean index 265845f021..ff9ffd3145 100644 --- a/LeanPool/OrderPQ/Basic.lean +++ b/LeanPool/OrderPQ/Basic.lean @@ -148,8 +148,7 @@ lemma nonempty_mulEquiv_semidirectProduct_of_card_eq_prime_mul_prime have hQ_normal : Subgroup.Normal (Q : Subgroup G) := by rw [← Subgroup.normalizer_eq_top_iff, ← Subgroup.index_eq_one] trans Nat.card (Sylow q G) - · convert Q.card_eq_index_normalizer.symm using 3 - exact Q.coe_coe + · exact Q.card_eq_index_normalizer.symm refine (Nat.Prime.eq_one_or_self_of_dvd (hp.elim) (Nat.card (Sylow q G)) ?_).resolve_right ?_ · convert Sylow.card_dvd_index Q using 1; symm rw [← Nat.mul_left_cancel_iff (Nat.zero_lt_of_ne_zero hq.elim.ne_zero), mul_comm] diff --git a/LeanPool/OrderPQ/MonoidHom.lean b/LeanPool/OrderPQ/MonoidHom.lean index 81e57f713a..bfb96c5400 100644 --- a/LeanPool/OrderPQ/MonoidHom.lean +++ b/LeanPool/OrderPQ/MonoidHom.lean @@ -33,7 +33,7 @@ lemma nat_card_range_of_injective {f : α →* β} (hf : Function.Injective f) : Nat.card (range f) = Nat.card α := by convert Set.nat_card_range_of_injective f hf using 1 - exact Nat.card_congr (Equiv.setCongr (MonoidHom.coe_range f)) + exact Nat.card_congr (Set.equivOfEq (MonoidHom.coe_range f)) end MonoidHom diff --git a/LeanPool/PCFTheory/Background/Club.lean b/LeanPool/PCFTheory/Background/Club.lean index 8bbe47f8d6..d8f9092897 100644 --- a/LeanPool/PCFTheory/Background/Club.lean +++ b/LeanPool/PCFTheory/Background/Club.lean @@ -311,7 +311,8 @@ theorem inter {Ϟ : Ordinal.{u}} (hCof : ℵ₀ < Ϟ.cof) {C D : Set Ordinal} · have hne : C ∉ ({D} : Set (Set Ordinal)) := by simp [h] rw [show ({C, D} : Set (Set Ordinal)) = insert C {D} from rfl, Cardinal.mk_insert hne, mk_singleton] - rw [show ((1 : Cardinal.{u + 1}) + 1) = Cardinal.lift.{u + 1, u} 2 by simp; norm_num, + rw [show ((1 : Cardinal.{u + 1}) + 1) = Cardinal.lift.{u + 1, u} 2 by + simp [one_add_one_eq_two], Cardinal.lift_lt] exact two_lt_aleph0.trans hCof diff --git a/LeanPool/PCFTheory/Background/Ordinal.lean b/LeanPool/PCFTheory/Background/Ordinal.lean index 8add3fdf02..bd9c55b4ab 100644 --- a/LeanPool/PCFTheory/Background/Ordinal.lean +++ b/LeanPool/PCFTheory/Background/Ordinal.lean @@ -90,14 +90,14 @@ all predecessors `o' : Iio o`, we get a function `(o : Iio l) → C o`. -/ @[elab_as_elim] def boundedRec {l : Ordinal} {C : Iio l → Sort*} (H : (o : Iio l) → ((o' : Iio o) → C o') → C o) (o : Iio l) : C o := - lt_wf.fix (C := fun p ↦ (h : p < l) → C ⟨p, h⟩) + WellFoundedLT.fix (motive := fun p ↦ (h : p < l) → C ⟨p, h⟩) (fun o h h' ↦ H ⟨o, h'⟩ fun o' ↦ h o'.1 o'.2 (o'.2.trans h')) o o.2 theorem boundedRec_eq {l} {C} (H o) : @boundedRec l C H o = H o (fun o' ↦ @boundedRec l C H o') := by rcases o with ⟨o, ho⟩ unfold boundedRec - rw [WellFounded.fix_eq] + rw [WellFoundedLT.fix_eq] rfl /-- Bounded version of `limitRecOn`: an `Iio l` version that mirrors the deprecated diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/CurvAbsorb/Algebraic.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/CurvAbsorb/Algebraic.lean index 221ebad6b6..0e89b259b1 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/CurvAbsorb/Algebraic.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/CurvAbsorb/Algebraic.lean @@ -72,9 +72,8 @@ theorem xi_bound_mvt (P : E d →L[ℝ] E d) (π : E d → E d) (x y c : E d) (r rw [hfg, ← norm_neg, neg_sub]; exact hbound z hz have hmvt := (convex_ball c r).norm_image_sub_le_of_norm_fderiv_le hg_diff hg_bound hxs hys convert hmvt using 2 - · rfl - · simp only [Pi.sub_apply, map_sub] - abel + simp only [Pi.sub_apply, map_sub] + abel /-- If Dπ(π x) kills (x - π x) and ‖Dπ(π x) - P‖ ≤ ε₁, then ‖P(x - π x)‖ ≤ ε₁·‖x - π x‖. -/ theorem proj_normal_bound (P : E d →L[ℝ] E d) (π : E d → E d) (x : E d) diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry/SegmentEstimate.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry/SegmentEstimate.lean index fd72465fab..ecfeb6768c 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry/SegmentEstimate.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/LocalGeometry/SegmentEstimate.lean @@ -101,12 +101,7 @@ theorem fiber_path_second_deriv {d : ℕ} (f : E d → ℝ) (m v : E d) have h := ((hasDerivAt_id s).smul_const v).const_add m convert h using 1 · rfl - · rfl - · rfl - · funext r - change (fun s => m + s • v) r = m + r • v - rfl - · simp + · rw [one_smul] have hf_diffAt : DifferentiableAt ℝ f (ψ t) := hf_C2.differentiableAt (by norm_num : (2 : WithTop ℕ∞) ≠ 0) -- f is differentiable in a neighborhood of ψ(t) diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/FlatCaseArithmetic.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/FlatCaseArithmetic.lean index 9aff9ed2c3..f2759ac825 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/FlatCaseArithmetic.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/FlatCaseArithmetic.lean @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Max Obreiter, Tobias Steinbrecher, Robert Foerster -/ -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic import Mathlib.Tactic.Linarith import Mathlib.Tactic.FieldSimp diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/Step1.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/Step1.lean index 0201c9b971..cc38fa461c 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/Step1.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/LyapunovContraction/Step1.lean @@ -125,17 +125,10 @@ theorem lsmooth_qub {d : ℕ} (f : E d → ℝ) (L : ℝ≥0) have h := ((hasDerivAt_const t ((↑L : ℝ) / 2)).mul hpow).mul_const cn simp only [zero_mul, zero_add] at h convert h using 1 - · rfl - · rfl - · simp_all - · ring + ring have h_comb := ((h1.sub h2).sub h3).sub h4 simp only [sub_zero] at h_comb convert h_comb using 1 - · rfl - · rfl - · funext s - simp [ψ] -- ψ continuous on [0,1] have hψ_cont : ContinuousOn ψ (Set.Icc 0 1) := by intro t ht diff --git a/LeanPool/PLAcceleratedNesterovLean/Convergence/RateArithmetic.lean b/LeanPool/PLAcceleratedNesterovLean/Convergence/RateArithmetic.lean index 00cd77d458..a5a1418b9c 100644 --- a/LeanPool/PLAcceleratedNesterovLean/Convergence/RateArithmetic.lean +++ b/LeanPool/PLAcceleratedNesterovLean/Convergence/RateArithmetic.lean @@ -52,7 +52,7 @@ theorem prod_one_add_geometric_le {C r : ℝ} (hC : 0 ≤ C) (hr0 : 0 ≤ r) linarith [Real.add_one_le_exp (C * r ^ (k + 1))] calc ∏ k ∈ range K, (1 + C * r ^ (k + 1)) ≤ ∏ k ∈ range K, Real.exp (C * r ^ (k + 1)) := by - apply Finset.prod_le_prod + apply Finset.prod_le_prod₀ · intro k _; linarith [mul_nonneg hC (pow_nonneg hr0 (k + 1))] · exact hfactors _ = Real.exp (∑ k ∈ range K, C * r ^ (k + 1)) := by diff --git a/LeanPool/PLAcceleratedNesterovLean/MorseBott/GradAlign.lean b/LeanPool/PLAcceleratedNesterovLean/MorseBott/GradAlign.lean index 8ef66b864e..a87b229bba 100644 --- a/LeanPool/PLAcceleratedNesterovLean/MorseBott/GradAlign.lean +++ b/LeanPool/PLAcceleratedNesterovLean/MorseBott/GradAlign.lean @@ -89,11 +89,7 @@ private lemma taylor_remainder_bound' {f : E → ℝ} {x v : E} (hasDerivAt_id s |>.mul_const _).hasDerivWithinAt have := (h1.sub h2).sub h3 convert this using 1 - · rfl - · rfl - · funext t - rfl - · rw [sub_zero, one_mul] + rw [sub_zero, one_mul] have hk_bound : ∀ s ∈ Ico (0:ℝ) 1, ‖fderiv ℝ f (x + s • v) v - fderiv ℝ f x v‖ ≤ C * ‖v‖ ^ 2 := by intro s hs diff --git a/LeanPool/PLAcceleratedNesterovLean/MorseBott/TubularProjection/IFT.lean b/LeanPool/PLAcceleratedNesterovLean/MorseBott/TubularProjection/IFT.lean index 5b6e495b2e..1833286d15 100644 --- a/LeanPool/PLAcceleratedNesterovLean/MorseBott/TubularProjection/IFT.lean +++ b/LeanPool/PLAcceleratedNesterovLean/MorseBott/TubularProjection/IFT.lean @@ -155,12 +155,7 @@ lemma optimalityEqn_partial_v_eq_neg_id have hιV_hfd : HasFDerivAt (fun v : V => (v : E)) (ιV : V →L[ℝ] E) 0 := by simpa [ιV] using ιV.hasFDerivAt convert hιV_hfd.add h_φE using 1 - · rfl - · rfl - · rfl - · funext v - rfl - · simp_all + rw [add_zero] exact h_vE.neg.congr_of_eventuallyEq (Filter.Eventually.of_forall fun v => by change (0 : E) - (v : E) - (φ v : E) = -((v : E) + (φ v : E)); abel) have hterm1 : HasFDerivAt diff --git a/LeanPool/PentagonalNumberTheorem/Complex.lean b/LeanPool/PentagonalNumberTheorem/Complex.lean index abfd3ecae9..13eb43451f 100644 --- a/LeanPool/PentagonalNumberTheorem/Complex.lean +++ b/LeanPool/PentagonalNumberTheorem/Complex.lean @@ -30,7 +30,7 @@ theorem gamma_bound (k n : ℕ) {x : K} (hx : ‖x‖ < 1) : refine mul_le_mul_of_nonneg_left ?_ (by simp) trans ∏ i ∈ Finset.Ico (k + 1) (n + 1 + (k + 1)), (1 + ‖x‖ ^ i) · rw [Finset.prod_Ico_eq_prod_range, Nat.add_sub_cancel] - apply Finset.prod_le_prod (by simp) fun _ _ ↦ (norm_sub_le _ _).trans_eq ?_ + apply Finset.prod_le_prod₀ (by simp) fun _ _ ↦ (norm_sub_le _ _).trans_eq ?_ rw [norm_one, norm_pow] ring have : Multipliable (1 + ‖x‖ ^ ·) := multipliable_one_add_of_summable (by simpa using hx) diff --git a/LeanPool/PentagonalNumberTheorem/Partition.lean b/LeanPool/PentagonalNumberTheorem/Partition.lean index 0edfe5b0ee..1606802ffb 100644 --- a/LeanPool/PentagonalNumberTheorem/Partition.lean +++ b/LeanPool/PentagonalNumberTheorem/Partition.lean @@ -65,7 +65,6 @@ theorem hasProd_powerSeriesMk_card_partition [IsTopologicalSemiring R] : HasProd (fun i ↦ ∑' j : ℕ, X ^ ((i + 1) * j)) (PowerSeries.mk fun n ↦ (Fintype.card n.Partition : R)) := by convert hasProd_powerSeriesMk_card_restricted R (fun _ ↦ True) - · rfl · simp · simp [restricted] diff --git a/LeanPool/PermanentFormulaLowerBound.lean b/LeanPool/PermanentFormulaLowerBound.lean index 35a838b566..e2473298de 100644 --- a/LeanPool/PermanentFormulaLowerBound.lean +++ b/LeanPool/PermanentFormulaLowerBound.lean @@ -849,7 +849,7 @@ variable {Y : Type u} {Z : Type v} {F : Type w} [Field F] private noncomputable def coefficientPolynomial (f : MvPolynomial (Y ⊕ Z) F) (α : Y →₀ ℕ) : MvPolynomial Z F := - MvPolynomial.coeff α (MvPolynomial.sumAlgEquiv F Y Z f) + (MvPolynomial.sumAlgEquiv F Y Z f).coeff α private noncomputable def coefficientField (f : MvPolynomial (Y ⊕ Z) F) : IntermediateField F (FractionRing (MvPolynomial Z F)) := @@ -996,7 +996,7 @@ private theorem totalDegree_succ_le_of_mem_pderiv_support [CommSemiring F] (hm : m ∈ (MvPolynomial.pderiv i p).support) : Multiset.card (Finsupp.toMultiset m) + 1 ≤ p.totalDegree := by classical - have hmcoeff : MvPolynomial.coeff m (MvPolynomial.pderiv i p) ≠ 0 := + have hmcoeff : (MvPolynomial.pderiv i p).coeff m ≠ 0 := MvPolynomial.mem_support_iff.mp hm have hparent : m + Finsupp.single i 1 ∈ p.support := by apply MvPolynomial.mem_support_iff.mpr @@ -1026,7 +1026,7 @@ private theorem totalDegree_pderiv_lt_of_ne_zero [CommSemiring F] private theorem eq_C_of_forall_pderiv_eq_zero [Field F] [CharZero F] (p : MvPolynomial ι F) (hp : ∀ i : ι, MvPolynomial.pderiv i p = 0) : - p = MvPolynomial.C (MvPolynomial.coeff 0 p) := by + p = MvPolynomial.C (p.coeff 0) := by classical apply MvPolynomial.ext _ _ intro m @@ -1042,11 +1042,12 @@ private theorem eq_C_of_forall_pderiv_eq_zero [Field F] [CharZero F] let m' : ι →₀ ℕ := m - Finsupp.single i 1 have hcancel : m' + Finsupp.single i 1 = m := by exact Finsupp.sub_add_single_one_cancel hi - have hder := congrArg (MvPolynomial.coeff m') (hp i) - rw [MvPolynomial.coeff_pderiv, hcancel, MvPolynomial.coeff_zero] at hder + have hder := congrArg (AddMonoidAlgebra.coeff · m') (hp i) + rw [MvPolynomial.coeff_pderiv, hcancel] at hder + simp only [AddMonoidAlgebra.coeff_zero, Finsupp.coe_zero, Pi.zero_apply] at hder have hcast : (↑(m' i) + 1 : F) ≠ 0 := Nat.cast_add_one_ne_zero _ - have hcoeff : MvPolynomial.coeff m p = 0 := + have hcoeff : p.coeff m = 0 := (mul_eq_zero.mp hder).resolve_right hcast simpa only [MvPolynomial.coeff_C, Ne.symm hm, ↓reduceIte] using hcoeff @@ -1109,14 +1110,14 @@ private theorem polynomialCoefficientProjection_map_mul apply MvPolynomial.ext intro s have hcoeff (g : MvPolynomial ι E) (index : ι →₀ ℕ) : - MvPolynomial.coeff index (polynomialCoefficientProjection φ g) = - φ (MvPolynomial.coeff index g) := rfl + (polynomialCoefficientProjection φ g).coeff index = + φ (g.coeff index) := rfl simp only [hcoeff, MvPolynomial.coeff_mul, MvPolynomial.coeff_map, map_sum] apply Finset.sum_congr rfl intro a ha simpa [Algebra.smul_def] using - φ.map_smul (MvPolynomial.coeff a.1 q) (MvPolynomial.coeff a.2 f) + φ.map_smul (q.coeff a.1) (f.coeff a.2) private theorem polynomialCoefficientProjection_map (φ : E →ₗ[K] K) @@ -1127,9 +1128,9 @@ private theorem polynomialCoefficientProjection_map apply MvPolynomial.ext intro s change - φ (MvPolynomial.coeff s (MvPolynomial.map (algebraMap K E) p)) = - MvPolynomial.coeff s p - simpa only [MvPolynomial.coeff_map] using hφ (MvPolynomial.coeff s p) + φ ((MvPolynomial.map (algebraMap K E) p).coeff s) = + p.coeff s + simpa only [MvPolynomial.coeff_map] using hφ (p.coeff s) private theorem polynomial_intersection_of_mul (f : MvPolynomial ι E) (p q : MvPolynomial ι K) @@ -2129,13 +2130,13 @@ private theorem rational_skeleton_trdeg [Field F] IntermediateField.adjoin F (s : Set E) have hcoeff : algebraMap (IntermediateField.adjoin F (s : Set E)) E - (MvPolynomial.coeff α g) = + (g.coeff α) = algebraMap (MvPolynomial Z F) E (coefficientPolynomial p α) := by simpa [pY, MvPolynomial.coeff_map, coefficientPolynomial] - using congrArg (MvPolynomial.coeff α) hg + using congrArg (AddMonoidAlgebra.coeff · α) hg rw [← hcoeff] - exact (MvPolynomial.coeff α g).property + exact (g.coeff α).property exact TranscendenceBounds.trdeg_intermediateField_le_of_adjoin_card_le (coefficientField p) s hfield hcard @@ -3604,7 +3605,7 @@ private theorem matchingPolynomialEvaluationMatrix_det_ne_zero apply mul_ne_zero · exact Matrix.det_vandermonde_ne_zero_iff.mpr hp · rw [Matrix.det_of_isUpperTriangular - (Matrix.matrixOfPolynomials_blockTriangular g + (Matrix.matrixOfPolynomials_isUpperTriangular g (fun d => (hdegree d).le))] apply Finset.prod_ne_zero_iff.mpr intro d _ @@ -4245,7 +4246,7 @@ private noncomputable def matchingRemainingIndexEquiv (Equiv.ofInjective (matchingRemainingIndexEmbedding e S a) (matchingRemainingIndexEmbedding e S a).injective).trans - (Equiv.setCongr (matchingRemainingIndexEmbedding_range e S a)) + (Set.equivOfEq (matchingRemainingIndexEmbedding_range e S a)) private noncomputable def matchingReducedEquiv {ell m : ℕ} (S : Finset (Fin ell ⊕ Fin ell)) @@ -5853,16 +5854,16 @@ private theorem coefficientPolynomial_rename_outside MvPolynomial.coeff_C, MvPolynomial.mapAlgHom_apply, AlgEquiv.toAlgHom_toRingHom, MvPolynomial.map_C, RingHom.coe_coe, L, R] - change MvPolynomial.coeff α + change AddMonoidAlgebra.coeff ((MvPolynomial.sumAlgEquiv F Y W) (MvPolynomial.renameEquiv F - (Equiv.sumCongr (Equiv.refl Y) e) f)) = _ - change MvPolynomial.coeff α (L f) = _ + (Equiv.sumCongr (Equiv.refl Y) e) f)) α = _ + change AddMonoidAlgebra.coeff (L f) α = _ rw [h] - change MvPolynomial.coeff α + change AddMonoidAlgebra.coeff (MvPolynomial.map (MvPolynomial.renameEquiv F e).toRingHom - ((MvPolynomial.sumAlgEquiv F Y Z) f)) = _ + ((MvPolynomial.sumAlgEquiv F Y Z) f)) α = _ rw [MvPolynomial.coeff_map] rfl diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Auxiliary.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Auxiliary.lean index dfbd2f3ac8..8f3b8d91d4 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Auxiliary.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Auxiliary.lean @@ -403,12 +403,12 @@ private theorem explicitGaussianL2DistanceSq_phase_eq_l2_norm_sq have hdiff : MeasureTheory.MemLp (fun z => P z - θ.1 * Q z) 2 (explicitGamma d) := hP.sub hθQ have hsqrt := - sqrt_explicitGaussianL2DistanceSq_eq_lpNorm P (fun z => θ.1 * Q z) hdiff.1 + sqrt_explicitGaussianL2DistanceSq_eq_lpNorm P (fun z => θ.1 * Q z) hdiff.aestronglyMeasurable have hnorm : ‖(hP.sub hθQ).toLp (fun z => P z - θ.1 * Q z)‖ = MeasureTheory.lpNorm (fun z => P z - θ.1 * Q z) 2 (explicitGamma d) := by rw [MeasureTheory.Lp.norm_toLp] - exact MeasureTheory.toReal_eLpNorm hdiff.1 + exact MeasureTheory.toReal_eLpNorm have htoLp : (hP.sub hθQ).toLp (fun z => P z - θ.1 * Q z) = hP.toLp P - θ.1 • hQ.toLp Q := by @@ -533,8 +533,8 @@ private theorem explicitClosure_subset_explicitSequentialClosure (⇑((hQn_mem n).toLp (Qn n)) - ⇑(hQ_mem.toLp Q)) 2 (explicitGamma d) = MeasureTheory.eLpNorm (fun z => Qn n z - Q z) 2 (explicitGamma d) := MeasureTheory.eLpNorm_congr_ae hae - rw [sqrt_explicitGaussianL2DistanceSq_eq_lpNorm (Qn n) Q hsub_mem.1, - ← MeasureTheory.toReal_eLpNorm hsub_mem.1, heLp] + rw [sqrt_explicitGaussianL2DistanceSq_eq_lpNorm (Qn n) Q hsub_mem.aestronglyMeasurable, + ← MeasureTheory.toReal_eLpNorm, heLp] have hsqrt_tendsto : Filter.Tendsto (fun n => Real.sqrt (explicitGaussianL2DistanceSq (Qn n) Q)) @@ -599,9 +599,9 @@ private theorem explicitPhaseOptimized_bound_of_l2_closure Real.sqrt (explicitGaussianL2DistanceSq P (fun z => θ * Qn n z)) + δ n := by rw [sqrt_explicitGaussianL2DistanceSq_eq_lpNorm P (fun z => θ * Q z) - hPQθ_mem.1, + hPQθ_mem.aestronglyMeasurable, sqrt_explicitGaussianL2DistanceSq_eq_lpNorm P (fun z => θ * Qn n z) - hPQnθ_mem.1] + hPQnθ_mem.aestronglyMeasurable] have hdecomp : (fun z => P z - θ * Q z) = fun z => (P z - θ * Qn n z) + θ * (Qn n z - Q z) := by @@ -627,7 +627,9 @@ private theorem explicitPhaseOptimized_bound_of_l2_closure rw [hscale] at htri have hδ_eq : MeasureTheory.lpNorm (fun z => Qn n z - Q z) 2 (explicitGamma d) = - δ n := by rw [← sqrt_explicitGaussianL2DistanceSq_eq_lpNorm (Qn n) Q hQnQ_mem.1] + δ n := by + rw [← sqrt_explicitGaussianL2DistanceSq_eq_lpNorm (Qn n) Q + hQnQ_mem.aestronglyMeasurable] rw [hδ_eq] at htri rw [show (fun z => P z - θ * Qn n z + θ * (Qn n z - Q z)) = (fun z => P z - θ * Qn n z) + fun z => θ * (Qn n z - Q z) from rfl] @@ -655,8 +657,8 @@ private theorem explicitPhaseOptimized_bound_of_l2_closure MeasureTheory.MemLp (fun z => ‖Q z‖ - ‖Qn n z‖) 2 (explicitGamma d) := hQ_mem.norm.sub hQn_mem.norm - rw [sqrt_explicitModulusDistanceSq_eq_lpNorm P (Qn n) hmodQn_mem.1, - sqrt_explicitModulusDistanceSq_eq_lpNorm P Q hmodQ_mem.1] + rw [sqrt_explicitModulusDistanceSq_eq_lpNorm P (Qn n) hmodQn_mem.aestronglyMeasurable, + sqrt_explicitModulusDistanceSq_eq_lpNorm P Q hmodQ_mem.aestronglyMeasurable] change MeasureTheory.lpNorm (fun z => ‖P z‖ - ‖Qn n z‖) 2 (explicitGamma d) ≤ MeasureTheory.lpNorm (fun z => ‖P z‖ - ‖Q z‖) 2 (explicitGamma d) + @@ -686,10 +688,12 @@ private theorem explicitPhaseOptimized_bound_of_l2_closure have h := abs_norm_sub_norm_le (Q z) (Qn n z) simpa [Real.norm_eq_abs, norm_sub_rev] using h _ = MeasureTheory.lpNorm (fun z => Qn n z - Q z) 2 - (explicitGamma d) := by rw [MeasureTheory.lpNorm_norm hQnQ_mem.1] + (explicitGamma d) := by rw [MeasureTheory.lpNorm_norm hQnQ_mem.aestronglyMeasurable] have hδ_eq : MeasureTheory.lpNorm (fun z => Qn n z - Q z) 2 (explicitGamma d) = - δ n := by rw [← sqrt_explicitGaussianL2DistanceSq_eq_lpNorm (Qn n) Q hQnQ_mem.1] + δ n := by + rw [← sqrt_explicitGaussianL2DistanceSq_eq_lpNorm (Qn n) Q + hQnQ_mem.aestronglyMeasurable] rw [hδ_eq] at hsecond exact htri.trans (add_le_add_right hsecond _) have hsqrt_total : diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/CoefficientLimitRigidity.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/CoefficientLimitRigidity.lean index a487625a25..79559a33e2 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/CoefficientLimitRigidity.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/CoefficientLimitRigidity.lean @@ -236,7 +236,7 @@ private theorem summable_sq_Phi_eval_wip (fun n : Nat => ‖phi1D (kappa q) n (z q)‖ ^ 2)) <= Finset.prod Finset.univ (fun q : Fin d => - ∑' n : Nat, ‖phi1D (kappa q) n (z q)‖ ^ 2) := Finset.prod_le_prod + ∑' n : Nat, ‖phi1D (kappa q) n (z q)‖ ^ 2) := Finset.prod_le_prod₀ (by intro q hq exact Finset.sum_nonneg fun n hn => sq_nonneg _) @@ -1519,7 +1519,7 @@ private theorem evalPkappa_lpNorm_eq_norm_coeff_wip (∫ z : Cd d, ‖evalPkappa kappa F z‖ ^ (2 : ℝ) ∂ gammaD d) := by symm exact gaussianL2Norm_eq_lpNorm_coeff_wip (evalPkappa kappa F) - (memLp_two_evalPkappa_coeff_wip hd kappa F).1 + (memLp_two_evalPkappa_coeff_wip hd kappa F).aestronglyMeasurable _ = Real.sqrt (∫ z : Cd d, ‖evalPkappa kappa F z‖ ^ 2 ∂ gammaD d) := by rw [hpow] _ = ‖F‖ := by @@ -1576,7 +1576,7 @@ private theorem defect_lpNorm_eq_coeff_wip let _ := hd simpa [defect, defectFunctionPkappa_coeff_wip, Real.norm_eq_abs, sq_abs] using gaussianL2Norm_eq_lpNorm_coeff_wip (defectFunctionPkappa_coeff_wip kappa F G) - (memLp_two_defectFunctionPkappa_coeff_wip hd kappa F G).1 + (memLp_two_defectFunctionPkappa_coeff_wip hd kappa F G).aestronglyMeasurable private theorem finite_head_bad_limit_eval_tendsto_wip {d : Nat} {kappa : MultiIndex d} @@ -1670,11 +1670,6 @@ private theorem finite_head_bad_limit_defect_ae_tendsto_zero_wip (fun m => defect F (t (φ m) • H (φ m))) Filter.atTop (nhds 0) := finite_head_bad_limit_defect_tendsto_zero_wip hφ_strict ht_le hdef - have hf_meas : - ∀ m, MeasureTheory.AEStronglyMeasurable (f m) (gammaD d) := by - intro m - exact (continuous_defectFunctionPkappa_coeff_wip kappa F - (t (φ m) • H (φ m))).stronglyMeasurable.aestronglyMeasurable have hf_mem : ∀ m, MeasureTheory.MemLp (f m) 2 (gammaD d) := by intro m @@ -1703,16 +1698,12 @@ private theorem finite_head_bad_limit_defect_ae_tendsto_zero_wip simp_all rw [hfun] simpa using ENNReal.tendsto_ofReal hdef_tendsto - have hzero_meas : - MeasureTheory.AEStronglyMeasurable (fun _ : Cd d => (0 : ℝ)) (gammaD d) := - (continuous_const : Continuous (fun _ : Cd d => (0 : ℝ))) - |>.stronglyMeasurable.aestronglyMeasurable have hInMeasure : MeasureTheory.TendstoInMeasure (gammaD d) f Filter.atTop (fun _ : Cd d => (0 : ℝ)) := MeasureTheory.tendstoInMeasure_of_tendsto_eLpNorm (p := (2 : ENNReal)) (μ := gammaD d) (f := f) (g := fun _ : Cd d => (0 : ℝ)) - (by norm_num) hf_meas hzero_meas heLp_tendsto + (by norm_num) heLp_tendsto obtain ⟨ψ, hψ_strict, hψ_ae⟩ := hInMeasure.exists_seq_tendsto_ae refine ⟨ψ, hψ_strict, ?_⟩ filter_upwards [hψ_ae] with z hz @@ -1743,15 +1734,6 @@ private theorem finite_head_bad_limit_defect_quotient_ae_tendsto_zero_wip intro m funext z simp [f, Pi.smul_apply, div_eq_mul_inv, mul_comm] - have hf_meas : - ∀ m, MeasureTheory.AEStronglyMeasurable (f m) (gammaD d) := by - intro m - change MeasureTheory.AEStronglyMeasurable - (fun z : Cd d => - defectFunctionPkappa_coeff_wip kappa F (t (φ m) • H (φ m)) z / t (φ m)) - (gammaD d) - exact ((continuous_defectFunctionPkappa_coeff_wip kappa F - (t (φ m) • H (φ m))).div_const (t (φ m))).stronglyMeasurable.aestronglyMeasurable have hf_mem : ∀ m, MeasureTheory.MemLp (f m) 2 (gammaD d) := by intro m @@ -1764,9 +1746,9 @@ private theorem finite_head_bad_limit_defect_quotient_ae_tendsto_zero_wip ENNReal.ofReal (1 / ((m + 1 : Nat) : ℝ)) := by intro m have hf_mem_m := hf_mem m - have hfin : MeasureTheory.eLpNorm (f m) 2 (gammaD d) ≠ ⊤ := by simpa using hf_mem_m.2.ne + have hfin : MeasureTheory.eLpNorm (f m) 2 (gammaD d) ≠ ⊤ := by simpa using hf_mem_m.ne refine (ENNReal.le_ofReal_iff_toReal_le hfin (by positivity)).2 ?_ - rw [MeasureTheory.toReal_eLpNorm hf_mem_m.1, hf_eq m, + rw [MeasureTheory.toReal_eLpNorm, hf_eq m, MeasureTheory.lpNorm_const_smul] rw [← defect_lpNorm_eq_coeff_wip hd kappa F (t (φ m) • H (φ m))] have hratio : @@ -1816,16 +1798,12 @@ private theorem finite_head_bad_limit_defect_quotient_ae_tendsto_zero_wip intro eps heps filter_upwards [(ENNReal.tendsto_nhds_zero.mp htarget) eps heps] with m hm exact le_trans (hbound m) hm - have hzero_meas : - MeasureTheory.AEStronglyMeasurable (fun _ : Cd d => (0 : ℝ)) (gammaD d) := - (continuous_const : Continuous (fun _ : Cd d => (0 : ℝ))) - |>.stronglyMeasurable.aestronglyMeasurable have hInMeasure : MeasureTheory.TendstoInMeasure (gammaD d) f Filter.atTop (fun _ : Cd d => (0 : ℝ)) := MeasureTheory.tendstoInMeasure_of_tendsto_eLpNorm (p := (2 : ENNReal)) (μ := gammaD d) (f := f) (g := fun _ : Cd d => (0 : ℝ)) - (by norm_num) hf_meas hzero_meas heLp_tendsto + (by norm_num) heLp_tendsto obtain ⟨ψ, hψ_strict, hψ_ae⟩ := hInMeasure.exists_seq_tendsto_ae refine ⟨ψ, hψ_strict, ?_⟩ filter_upwards [hψ_ae] with z hz diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/ExactModulusRecovery.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/ExactModulusRecovery.lean index 2230ab8a1b..f4f8649e67 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/ExactModulusRecovery.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/ExactModulusRecovery.lean @@ -123,16 +123,16 @@ theorem realHermiteGenerating_hasDerivAt (t : ℝ) (u : ℂ) : have hquad : HasDerivAt (fun v : ℂ => v ^ 2 / 2) u u := by simpa [id, two_mul] using HasDerivAt.div_const ((hasDerivAt_id u).fun_pow 2) 2 - convert ((hlin.add_const (-(((t : ℂ) ^ 2) / 2))).sub hquad) using 1 <;> - first - | rfl - | (funext v; simp only [Pi.sub_apply]; ring_nf) + convert ((hlin.add_const (-(((t : ℂ) ^ 2) / 2))).sub hquad) using 1 + first + | rfl + | (funext v; simp only [Pi.sub_apply]; ring_nf) unfold realHermiteGenerating convert HasDerivAt.const_mul - (((Real.pi ^ (-(1 / 4 : ℝ)) : ℝ) : ℂ)) hpoly.cexp using 1 <;> - first - | rfl - | ring + (((Real.pi ^ (-(1 / 4 : ℝ)) : ℝ) : ℂ)) hpoly.cexp using 1 + first + | rfl + | ring theorem realHermiteGenerating_integral_mul (u w : ℂ) : (∫ t : ℝ, realHermiteGenerating t u * realHermiteGenerating t w) = @@ -5463,9 +5463,9 @@ private lemma rankOneKernel_memLp_two ((volume : Measure (RealVec d)).prod (volume : Measure (RealVec d))) := by exact - (hf.1.comp_quasiMeasurePreserving + (hf.aestronglyMeasurable.comp_quasiMeasurePreserving Measure.quasiMeasurePreserving_fst).mul - ((hg.1.comp_quasiMeasurePreserving + ((hg.aestronglyMeasurable.comp_quasiMeasurePreserving Measure.quasiMeasurePreserving_snd).star) exact (integrable_norm_rpow_iff @@ -5584,7 +5584,8 @@ private lemma memLp_two_prod_right_ae have hF_prod : MemLp F 2 (μ.prod μ) := by simpa [μ, MeasureTheory.Measure.volume_eq_prod] using hF have hmeas_sec : ∀ᵐ x ∂μ, - AEStronglyMeasurable (fun t : RealVec d => F (x, t)) μ := hF_prod.1.prodMk_left + AEStronglyMeasurable (fun t : RealVec d => F (x, t)) μ := + hF_prod.aestronglyMeasurable.prodMk_left have hint_global : Integrable (fun p : PhaseSpace d => ‖F p‖ ^ 2) (μ.prod μ) := by simpa using hF_prod.integrable_norm_pow (by norm_num : (2 : ℕ) ≠ 0) @@ -5753,7 +5754,7 @@ theorem equalAmbiguity_to_rankOneKernel_ae (by have hcenter_prod : MemLp centerDiff 2 (μ.prod μ) := by simpa [μ, MeasureTheory.Measure.volume_eq_prod] using hcenter_mem - exact hcenter_prod.1) + exact hcenter_prod.aestronglyMeasurable) hcenter_zero_sections have hendpoint_zero : endpointDiff =ᵐ[μ.prod μ] fun _ => (0 : ℂ) := by diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/BlockLocalization.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/BlockLocalization.lean index 0e43e6f640..06038ab1ef 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/BlockLocalization.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/BlockLocalization.lean @@ -302,7 +302,6 @@ private lemma integrable_oneDimPhi_cross_gaussian funext z simp [Algebra.smul_def, mul_left_comm, mul_comm] convert hsmul.const_mul (1 / Real.pi) using 1 - case e'_5 => rfl funext z have hnonneg : 0 ≤ π⁻¹ * rexp (-‖z 0‖ ^ 2) := by positivity simp only [gaussianDensity, pow_one, one_div, univ_unique, Fin.default_eq_zero, @@ -702,7 +701,7 @@ theorem productBasisLocalization Real.exp (-(cq q) * max (((Nat.dist (j q) (ℓ q) : ℕ) : ℝ) - ((κ q + 5 : ℕ) : ℝ)) 0 ^ 2)) := by - refine Finset.prod_le_prod ?_ ?_ + refine Finset.prod_le_prod₀ ?_ ?_ · intro q hq unfold annulusMass positivity diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ImportedAnalyticInputs.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ImportedAnalyticInputs.lean index 2b5edcee2d..131140d39b 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ImportedAnalyticInputs.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ImportedAnalyticInputs.lean @@ -145,7 +145,6 @@ private lemma integrable_oneDimPhi_cross_gaussian funext z simp [Algebra.smul_def, mul_left_comm, mul_comm] convert hsmul.const_mul (1 / Real.pi) using 1 - case e'_5 => rfl funext z have hnonneg : 0 ≤ π⁻¹ * rexp (-‖z 0‖ ^ 2) := by positivity simp only [gaussianDensity, pow_one, one_div, univ_unique, Fin.default_eq_zero, Fin.isValue, @@ -1141,7 +1140,6 @@ theorem tensorGaussianFactorization (gaussianMeasure d) := by rw [gaussianMeasure, MeasureTheory.integrable_withDensity_iff_integrable_smul'] · convert hprod_volume using 1 - case e'_5 => rfl funext z exact density_smul_prod_identity d F G z · exact measurable_ofReal_gaussianDensity d diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ProductBasisAndAnnuli.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ProductBasisAndAnnuli.lean index 4178b80e6e..79cae9ab34 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ProductBasisAndAnnuli.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermite1Dimd/ProductBasisAndAnnuli.lean @@ -58,7 +58,6 @@ private lemma integrable_oneDimPhi_cross_gaussian funext z simp [Algebra.smul_def, mul_left_comm, mul_comm] convert hsmul.const_mul (1 / Real.pi) using 1 - case e'_5 => rfl funext z have hnonneg : 0 ≤ π⁻¹ * rexp (-‖z 0‖ ^ 2) := by positivity simp only [gaussianDensity, pow_one, one_div, univ_unique, Fin.default_eq_zero, Fin.isValue, @@ -593,7 +592,6 @@ private lemma annulusInner_finite_sum convert (((integrable_productBasis_cross κ α β).indicator (measurableSet_productAnnulus j)).const_mul (conj (b β) * a α)) using 1 - case e'_3 => rfl funext z by_cases hz : z ∈ productAnnulus j · simp [Set.indicator, hz, mul_left_comm, mul_comm] diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/TrueLevelBasis.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/TrueLevelBasis.lean index 7eef59a202..08d2d7e459 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/TrueLevelBasis.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/Hermitek/TrueLevelBasis.lean @@ -1335,8 +1335,6 @@ theorem integrable_weightedDiag (k n : ℕ) : intro hC apply hf convert hC.re using 1 - funext x - exact (RCLike.ofReal_re (f x)).symm have hzero : weightedInner (Phi k n) (Phi k n) = 0 := by unfold weightedInner HermiteLEAN.weightedInner calc @@ -4494,7 +4492,7 @@ private theorem weightedInner_norm_le_of_integrable _ = MeasureTheory.lpNorm (gaussianScale G) 2 volume * MeasureTheory.lpNorm (gaussianScale F) 2 volume := by rw [MeasureTheory.Lp.norm_toLp, MeasureTheory.Lp.norm_toLp, - ← MeasureTheory.toReal_eLpNorm hGmem.1, ← MeasureTheory.toReal_eLpNorm hFmem.1] + ← MeasureTheory.toReal_eLpNorm, ← MeasureTheory.toReal_eLpNorm] _ = weightedNorm G * weightedNorm F := by rw [← weightedNorm_eq_lpNorm_gaussianScale hGmeas hGint, ← weightedNorm_eq_lpNorm_gaussianScale hFmeas hFint] diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/ImportedAnalyticInputs.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/ImportedAnalyticInputs.lean index c1bdb1f5cf..d595e229a8 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/ImportedAnalyticInputs.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/ImportedAnalyticInputs.lean @@ -1052,7 +1052,7 @@ private theorem exists_schwartz_lpNorm_sub_le_realVec {d : Nat} have hg₃' : MeasureTheory.eLpNorm (f - (s : RealVec d -> ℂ)) 2 μ ≤ ENNReal.ofReal ε := hg₃ refine ⟨s, ?_⟩ - rw [← MeasureTheory.toReal_eLpNorm hs.aestronglyMeasurable] + rw [← MeasureTheory.toReal_eLpNorm] exact (ENNReal.toReal_le_toReal hs.eLpNorm_ne_top (by simp)).mpr hg₃' |>.trans_eq (ENNReal.toReal_ofReal hε.le) @@ -1206,7 +1206,7 @@ private theorem schwartzApproxRealVec_toLp_tendsto {d : Nat} (f : L2Real d) : rw [MeasureTheory.Lp.edist_toLp_toLp] _ = MeasureTheory.lpNorm ((s : RealVec d -> ℂ) - (f : RealVec d -> ℂ)) 2 μ := by - rw [MeasureTheory.toReal_eLpNorm hsub.aestronglyMeasurable] + rw [MeasureTheory.toReal_eLpNorm] have hraw : Tendsto (fun n : Nat => @@ -1403,7 +1403,8 @@ private theorem stftRep_schwartz_eq_fourier_apply {d : Nat} fun t : RealVec d => h (t - x) := by simpa [Function.comp_def] using (MeasureTheory.measurePreserving_sub_right - (MeasureTheory.volume : MeasureTheory.Measure (RealVec d)) x).quasiMeasurePreserving.ae_eq + (MeasureTheory.volume : MeasureTheory.Measure (RealVec d)) + x).quasiMeasurePreserving.ae_eq_comp (h.coeFn_toLp 2 (MeasureTheory.volume : MeasureTheory.Measure (RealVec d))) filter_upwards [hf_ae, hh_ae] with t hft hht rw [hft, hht] @@ -1941,7 +1942,8 @@ theorem norm_modulateL2 {d : Nat} (ω : RealVec d) (f : L2Real d) : ‖modulateL2 ω f‖ = ‖f‖ := by rw [MeasureTheory.Lp.norm_def, MeasureTheory.Lp.norm_def] apply congrArg ENNReal.toReal - apply MeasureTheory.eLpNorm_congr_norm_ae + refine MeasureTheory.eLpNorm_congr_norm_ae (MeasureTheory.Lp.aestronglyMeasurable _) + (MeasureTheory.Lp.aestronglyMeasurable _) ?_ filter_upwards [modulateL2_coeFn ω f] with t hmod rw [hmod, norm_mul, modulationPhase_norm] simp @@ -1970,8 +1972,7 @@ private theorem tendsto_lintegral_filter_of_dominated_convergence_ae · refine h_lim.mono fun a h_lim => ?_ apply @Tendsto.comp _ _ _ (fun n => x (n + k)) fun n => F n a · assumption - rw [tendsto_add_atTop_iff_nat] - assumption + rwa [tendsto_add_atTop_iff_nat] private theorem modulation_eLpNorm_tendsto_zero {d : Nat} (f : L2Real d) (ω0 : RealVec d) : Tendsto @@ -2037,7 +2038,7 @@ private theorem modulation_eLpNorm_tendsto_zero {d : Nat} (f : L2Real d) (ω0 : (p := (2 : ℝ≥0∞)) (μ := (MeasureTheory.volume : MeasureTheory.Measure (RealVec d))) (f := fun t : RealVec d => (2 : ℂ) * (f : RealVec d -> ℂ) t) - (by norm_num) (by norm_num) hmul_mem.2).ne + (by norm_num) (by norm_num) hmul_mem).ne · exact Filter.Eventually.of_forall fun t => by have hphase : Tendsto (fun ω : RealVec d => modulationPhase ω t) (𝓝 ω0) (𝓝 (modulationPhase ω0 t)) := by @@ -2080,8 +2081,16 @@ private theorem modulation_eLpNorm_tendsto_zero {d : Nat} (f : L2Real d) (ω0 : ENNReal.continuous_rpow_const simpa [Function.comp_def, ENNReal.zero_rpow_of_pos (by norm_num : 0 < (1 / (2 : ℝ)))] using (hpow_cont.tendsto (0 : ℝ≥0∞)).comp hInt - simpa [MeasureTheory.eLpNorm_eq_lintegral_rpow_enorm_toReal - (by norm_num : (2 : ℝ≥0∞) ≠ 0) (by norm_num : (2 : ℝ≥0∞) ≠ ∞)] using hpow + have hmeas : ∀ ω : RealVec d, MeasureTheory.AEStronglyMeasurable + (fun t : RealVec d => + modulationPhase ω t * (f : RealVec d -> ℂ) t - + modulationPhase ω0 t * (f : RealVec d -> ℂ) t) + (MeasureTheory.volume : MeasureTheory.Measure (RealVec d)) := fun ω => + (modulateL2_mem ω f).aestronglyMeasurable.sub (modulateL2_mem ω0 f).aestronglyMeasurable + refine hpow.congr fun ω => ?_ + rw [MeasureTheory.eLpNorm_eq_lintegral_rpow_enorm_toReal + (by norm_num : (2 : ℝ≥0∞) ≠ 0) (by norm_num : (2 : ℝ≥0∞) ≠ ∞) (hmeas ω)] + norm_num theorem continuous_modulateL2_apply {d : Nat} (f : L2Real d) : Continuous fun ω : RealVec d => modulateL2 ω f := by @@ -2146,7 +2155,9 @@ theorem ambiguityRep_eq_lpPairing theorem edist_modulateL2 {d : Nat} (ω : RealVec d) (f g : L2Real d) : edist (modulateL2 ω f) (modulateL2 ω g) = edist f g := by rw [MeasureTheory.Lp.edist_def, MeasureTheory.Lp.edist_def] - apply MeasureTheory.eLpNorm_congr_norm_ae + refine MeasureTheory.eLpNorm_congr_norm_ae + ((MeasureTheory.Lp.aestronglyMeasurable _).sub (MeasureTheory.Lp.aestronglyMeasurable _)) + ((MeasureTheory.Lp.aestronglyMeasurable _).sub (MeasureTheory.Lp.aestronglyMeasurable _)) ?_ filter_upwards [ modulateL2_coeFn ω f, modulateL2_coeFn ω g] with t hmf hmg @@ -2180,7 +2191,9 @@ theorem continuous_modulateL2 {d : Nat} {X : Type*} [TopologicalSpace X] theorem edist_star_L2 {d : Nat} (f g : L2Real d) : edist (star f) (star g) = edist f g := by rw [MeasureTheory.Lp.edist_def, MeasureTheory.Lp.edist_def] - apply MeasureTheory.eLpNorm_congr_norm_ae + refine MeasureTheory.eLpNorm_congr_norm_ae + ((MeasureTheory.Lp.aestronglyMeasurable _).sub (MeasureTheory.Lp.aestronglyMeasurable _)) + ((MeasureTheory.Lp.aestronglyMeasurable _).sub (MeasureTheory.Lp.aestronglyMeasurable _)) ?_ filter_upwards [ MeasureTheory.Lp.coeFn_star f, MeasureTheory.Lp.coeFn_star g] with t hf hg @@ -2205,7 +2218,8 @@ theorem norm_star_L2 {d : Nat} (f : L2Real d) : ‖star f‖ = ‖f‖ := by rw [MeasureTheory.Lp.norm_def, MeasureTheory.Lp.norm_def] apply congrArg ENNReal.toReal - apply MeasureTheory.eLpNorm_congr_norm_ae + refine MeasureTheory.eLpNorm_congr_norm_ae (MeasureTheory.Lp.aestronglyMeasurable _) + (MeasureTheory.Lp.aestronglyMeasurable _) ?_ filter_upwards [MeasureTheory.Lp.coeFn_star f] with t hf rw [hf] simp only [Pi.star_apply] @@ -2620,7 +2634,8 @@ private theorem eLpNorm_stftRep_le {d : Nat} (h f : L2Real d) : have hliminf : MeasureTheory.eLpNorm F 2 μP ≤ atTop.liminf (fun n : Nat => MeasureTheory.eLpNorm (Fₙ n) 2 μP) := - MeasureTheory.Lp.eLpNorm_lim_le_liminf_eLpNorm hmeas F hpoint + MeasureTheory.Lp.eLpNorm_lim_le_liminf_eLpNorm hmeas F + (stftRep_aestronglyMeasurable h f) hpoint have hprod : Tendsto (fun n : Nat => @@ -2683,8 +2698,7 @@ private theorem stftRep_sq_integrable {d : Nat} (h f : L2Real d) : ENNReal.ofReal_lt_top have hfin : MeasureTheory.eLpNorm (stftRep h f) 2 μP < ⊤ := lt_of_le_of_lt (eLpNorm_stftRep_le h f) hfinite_rhs - have hmem : MeasureTheory.MemLp (stftRep h f) 2 μP := - ⟨stftRep_aestronglyMeasurable h f, hfin⟩ + have hmem : MeasureTheory.MemLp (stftRep h f) 2 μP := hfin exact (MeasureTheory.memLp_two_iff_integrable_sq_norm (stftRep_aestronglyMeasurable h f)).mp hmem @@ -2703,7 +2717,7 @@ private theorem lpNorm_coeFn_L2Real_eq_norm {d : Nat} (f : L2Real d) : MeasureTheory.lpNorm (f : RealVec d -> ℂ) 2 (MeasureTheory.volume : MeasureTheory.Measure (RealVec d)) = ‖f‖ := by rw [MeasureTheory.Lp.norm_def, - MeasureTheory.toReal_eLpNorm (MeasureTheory.Lp.memLp f).aestronglyMeasurable] + MeasureTheory.toReal_eLpNorm] private theorem lpNorm_stftRep_le_lpNorm {d : Nat} (h f : L2Real d) : MeasureTheory.lpNorm (stftRep h f) 2 @@ -2714,7 +2728,7 @@ private theorem lpNorm_stftRep_le_lpNorm {d : Nat} (h f : L2Real d) : (MeasureTheory.volume : MeasureTheory.Measure (RealVec d)) := by let μP : MeasureTheory.Measure (PhaseSpace d) := MeasureTheory.volume have hmem : MeasureTheory.MemLp (stftRep h f) 2 μP := stftRep_memLp h f - rw [← MeasureTheory.toReal_eLpNorm hmem.aestronglyMeasurable] + rw [← MeasureTheory.toReal_eLpNorm] simpa using (ENNReal.toReal_le_toReal hmem.eLpNorm_ne_top ENNReal.ofReal_ne_top).mpr (eLpNorm_stftRep_le h f) @@ -2834,7 +2848,7 @@ private theorem lpNorm_mul_le_real have hmem : MeasureTheory.MemLp (fun x => f x * g x) 1 μ := by refine MeasureTheory.MemLp.ae_eq ?_ (hg.mul hf) filter_upwards with x - simp [Pi.mul_apply] + simp [Pi.mul_apply, mul_comm] rw [MeasureTheory.lpNorm_one_eq_integral_norm hmem.aestronglyMeasurable] have hpq : Real.HolderConjugate 2 2 := by constructor <;> norm_num have hf_abs : MeasureTheory.MemLp (fun x => |f x|) (ENNReal.ofReal (2 : ℝ)) μ := by @@ -2855,7 +2869,7 @@ private theorem lpNorm_mul_le_real norm_num at h have h' := congrArg ENNReal.toReal h rw [ENNReal.toReal_ofReal (by positivity), - MeasureTheory.toReal_eLpNorm hf.aestronglyMeasurable] at h' + MeasureTheory.toReal_eLpNorm] at h' simpa [Real.norm_eq_abs] using h'.symm have hg_lp : (∫ x, |g x| ^ (2 : ℝ) ∂μ) ^ (1 / (2 : ℝ)) = @@ -2865,7 +2879,7 @@ private theorem lpNorm_mul_le_real norm_num at h have h' := congrArg ENNReal.toReal h rw [ENNReal.toReal_ofReal (by positivity), - MeasureTheory.toReal_eLpNorm hg.aestronglyMeasurable] at h' + MeasureTheory.toReal_eLpNorm] at h' simpa [Real.norm_eq_abs] using h'.symm have hleft : ∫ x, ‖f x * g x‖ ∂μ = ∫ x, |f x| * |g x| ∂μ := by @@ -2943,7 +2957,7 @@ private theorem lpNorm_stftRep_sq_sub_tendsto_zero {d : Nat} have hHmem : MeasureTheory.MemLp (fun ξ : PhaseSpace d => Aₙ n ξ * Bₙ n ξ) 1 μP := by refine MeasureTheory.MemLp.ae_eq ?_ (hBmem.mul hAmem) filter_upwards with ξ - simp [Pi.mul_apply] + simp [Pi.mul_apply, mul_comm] have hpoint : ∀ ξ : PhaseSpace d, ‖Dₙ n ξ‖ ≤ Aₙ n ξ * Bₙ n ξ := by intro ξ have hsum_nonneg : 0 ≤ ‖Fₙ n ξ‖ + ‖F ξ‖ := by positivity diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/OrthogonalCoercivity.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/OrthogonalCoercivity.lean index ab7981be1a..b72b62f9b9 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/OrthogonalCoercivity.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/OrthogonalCoercivity.lean @@ -341,7 +341,7 @@ private theorem evalPkappa_lpNorm_eq_norm_wip MeasureTheory.lpNorm (evalPkappa kappa F) 2 (gammaD d) = Real.sqrt (∫ z : Cd d, ‖evalPkappa kappa F z‖ ^ (2 : ℝ) ∂ gammaD d) := (gaussianL2Norm_eq_lpNorm_wip (evalPkappa kappa F) - (memLp_two_evalPkappa_wip hd kappa F).1).symm + (memLp_two_evalPkappa_wip hd kappa F).aestronglyMeasurable).symm _ = ‖F‖ := by have hpow : (∫ z : Cd d, ‖evalPkappa kappa F z‖ ^ (2 : ℝ) ∂ gammaD d) = @@ -409,7 +409,7 @@ private theorem defect_lpNorm_eq_wip let _ := hd simpa [defect, defectFunctionPkappa_wip, Real.norm_eq_abs, sq_abs] using gaussianL2Norm_eq_lpNorm_wip (defectFunctionPkappa_wip kappa F G) - (memLp_two_defectFunctionPkappa_wip hd kappa F G).1 + (memLp_two_defectFunctionPkappa_wip hd kappa F G).aestronglyMeasurable private theorem evalPkappa_add_apply_wip {d : Nat} (kappa : MultiIndex d) (F G : Pkappa d kappa) (z : Cd d) : diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/OrthogonalReduction/OrthogonalReduction.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/OrthogonalReduction/OrthogonalReduction.lean index 53d7ba55ca..7b9e5a7245 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/OrthogonalReduction/OrthogonalReduction.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/OrthogonalReduction/OrthogonalReduction.lean @@ -39,10 +39,10 @@ private lemma lpNorm_mono_real_ae {f : Ω → ℝ} {g : Ω → ℝ} (hg : MeasureTheory.MemLp g 2 μ) (hfg : ∀ᵐ x ∂μ, ‖f x‖ ≤ g x) : MeasureTheory.lpNorm f 2 μ ≤ MeasureTheory.lpNorm g 2 μ := by by_cases hf : AEStronglyMeasurable f μ - · rw [← MeasureTheory.toReal_eLpNorm hf, - ← MeasureTheory.toReal_eLpNorm hg.aestronglyMeasurable] + · rw [← MeasureTheory.toReal_eLpNorm, + ← MeasureTheory.toReal_eLpNorm] exact ENNReal.toNNReal_mono hg.eLpNorm_ne_top - (MeasureTheory.eLpNorm_mono_ae_real hfg) + (MeasureTheory.eLpNorm_mono_ae_real hf hfg) · simp_all omit [SigmaFinite μ] in @@ -51,7 +51,7 @@ private lemma lpNorm_coe_l2 {E : Type*} [NormedAddCommGroup E] MeasureTheory.lpNorm (fun x : Ω => F x) 2 μ = ‖F‖ := by have hmeas : AEStronglyMeasurable (fun x : Ω => F x) μ := by fun_prop rw [MeasureTheory.Lp.norm_def] - exact (MeasureTheory.toReal_eLpNorm hmeas).symm + exact (MeasureTheory.toReal_eLpNorm).symm omit [SigmaFinite μ] in private lemma lpNorm_norm_l2 (F : MeasureTheory.Lp ℂ 2 μ) : @@ -203,17 +203,17 @@ theorem local_stability have hf0' : ‖f0‖ = 1 := by simpa [hF_norm] using hf0 have hXnorm : ‖X‖ = ‖A‖ := by dsimp [X] - rw [MeasureTheory.Lp.norm_toLp, MeasureTheory.toReal_eLpNorm hX_mem.1] + rw [MeasureTheory.Lp.norm_toLp, MeasureTheory.toReal_eLpNorm] simpa [Xfun] using lpNorm_norm_l2 μ A have hYnorm : ‖Y‖ = ‖F‖ := by dsimp [Y] - rw [MeasureTheory.Lp.norm_toLp, MeasureTheory.toReal_eLpNorm hY_mem.1] + rw [MeasureTheory.Lp.norm_toLp, MeasureTheory.toReal_eLpNorm] simpa [Yfun] using lpNorm_norm_l2 μ F have hsubnorm : ‖X - Y‖ = defect h := by have hsub : X - Y = (hX_mem.sub hY_mem).toLp (Xfun - Yfun) := by dsimp [X, Y] exact (MeasureTheory.MemLp.toLp_sub hX_mem hY_mem).symm - rw [hsub, MeasureTheory.Lp.norm_toLp, MeasureTheory.toReal_eLpNorm (hX_mem.sub hY_mem).1] + rw [hsub, MeasureTheory.Lp.norm_toLp, MeasureTheory.toReal_eLpNorm] rfl have hsum_bound : ‖X + Y‖ ≤ 2 + ‖h‖ := by calc diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/PhaseStability.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/PhaseStability.lean index 3c993669de..334ec62ae3 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/PhaseStability.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/PhaseStability.lean @@ -94,12 +94,7 @@ private theorem lpNorm_congr_ae {α E : Type*} [MeasurableSpace α] [NormedAddCo {f g : α → E} {p : ENNReal} {μ : Measure α} (hfg : f =ᵐ[μ] g) : lpNorm f p μ = lpNorm g p μ := by unfold lpNorm - have hmeas : AEStronglyMeasurable f μ ↔ AEStronglyMeasurable g μ := - aestronglyMeasurable_congr hfg - by_cases hf : AEStronglyMeasurable f μ - · have hg : AEStronglyMeasurable g μ := hmeas.mp hf - simp [hf, hg, eLpNorm_congr_ae hfg] - · simp_all + rw [eLpNorm_congr_ae hfg] private theorem gaussianL2Norm_eq_lpNorm {d : Nat} {α : Type*} [NormedAddCommGroup α] @@ -127,7 +122,7 @@ theorem evalPkappa_lpNorm_eq_norm lpNorm (evalPkappa kappa F) 2 (gammaD d) = Real.sqrt (∫ z : Cd d, ‖evalPkappa kappa F z‖ ^ (2 : ℝ) ∂ gammaD d) := (gaussianL2Norm_eq_lpNorm (evalPkappa kappa F) - (memLp_two_evalPkappa hd kappa F).1).symm + (memLp_two_evalPkappa hd kappa F).aestronglyMeasurable).symm _ = ‖F‖ := by have hpow : (∫ z : Cd d, ‖evalPkappa kappa F z‖ ^ (2 : ℝ) ∂ gammaD d) = @@ -141,7 +136,7 @@ theorem evalPkappaL2_norm ‖evalPkappaL2 kappa F‖ = ‖F‖ := by rw [evalPkappaL2_eq_toLp hd kappa F, MeasureTheory.Lp.norm_toLp, - MeasureTheory.toReal_eLpNorm (memLp_two_evalPkappa hd kappa F).1] + MeasureTheory.toReal_eLpNorm] exact evalPkappa_lpNorm_eq_norm hd kappa F theorem evalPkappaL2_sub diff --git a/LeanPool/PhaseRetrieval/DimdPoly/Internal/TensorBasis.lean b/LeanPool/PhaseRetrieval/DimdPoly/Internal/TensorBasis.lean index e1f9aa1d95..4b2f02edac 100644 --- a/LeanPool/PhaseRetrieval/DimdPoly/Internal/TensorBasis.lean +++ b/LeanPool/PhaseRetrieval/DimdPoly/Internal/TensorBasis.lean @@ -456,7 +456,7 @@ theorem summable_sq_Phi_eval Finset.prod Finset.univ (fun q : Fin d => ∑' n : Nat, ‖phi1D (kappa q) n (z q)‖ ^ 2) := - Finset.prod_le_prod + Finset.prod_le_prod₀ (fun q _ => Finset.sum_nonneg fun n _ => sq_nonneg _) (fun q _ => (summable_sq_phi1D_eval (kappa q) (z q)).sum_le_tsum (Finset.range (J q + 1)) (fun n _ => sq_nonneg _)) @@ -1113,7 +1113,7 @@ private lemma phiMajorant_multi_sq_summable (fun n : Nat => phiMajorant (kappa q) n R ^ 2)) ≤ Finset.prod Finset.univ (fun q : Fin d => ∑' n : Nat, phiMajorant (kappa q) n R ^ 2) := - Finset.prod_le_prod + Finset.prod_le_prod₀ (fun q _ => Finset.sum_nonneg fun n _ => sq_nonneg _) (fun q _ => (summable_phiMajorant_sq (kappa q) hR).sum_le_tsum (Finset.range (J q + 1)) (fun n _ => sq_nonneg _)) @@ -1216,7 +1216,7 @@ private lemma partialSum_uniformCauchy_on_compact Finset.prod Finset.univ (fun q : Fin d => ‖phi1D (kappa q) (alpha q) (z q)‖) by simp [Phi, norm_prod]] - exact Finset.prod_le_prod + exact Finset.prod_le_prod₀ (by intro q _; exact norm_nonneg _) (by intro q _; exact phi1D_norm_le_majorant hR (hcoord z hzK q)) rw [norm_mul] diff --git a/LeanPool/PoincareThreeBody/OrbitHomologicalEquation.lean b/LeanPool/PoincareThreeBody/OrbitHomologicalEquation.lean index 8893df692d..a01d308827 100644 --- a/LeanPool/PoincareThreeBody/OrbitHomologicalEquation.lean +++ b/LeanPool/PoincareThreeBody/OrbitHomologicalEquation.lean @@ -53,10 +53,8 @@ theorem continuousAt_poissonBracket_comp have hdg2 := continuousAt_clm_apply.mp hdg (coordinateVector 2) have hdg3 := continuousAt_clm_apply.mp hdg (coordinateVector 3) unfold poissonBracket - convert ((hdf0.mul hdg2).sub (hdf2.mul hdg0)).add - ((hdf1.mul hdg3).sub (hdf3.mul hdg1)) using 1 - funext argument - rfl + exact ((hdf0.mul hdg2).sub (hdf2.mul hdg0)).add + ((hdf1.mul hdg3).sub (hdf3.mul hdg1)) /-- The exact challenge hypotheses imply the explicit first homological equation at every point of an interior resonant Kepler ellipse. -/ diff --git a/LeanPool/PointwiseBirkhoff/Main.lean b/LeanPool/PointwiseBirkhoff/Main.lean index 0d0b9f67ce..4c93e08c30 100644 --- a/LeanPool/PointwiseBirkhoff/Main.lean +++ b/LeanPool/PointwiseBirkhoff/Main.lean @@ -37,7 +37,7 @@ def birkhoffMax (f : α → α) (φ : α → ℝ) : ℕ →o (α → ℝ) := lemma birkhoffMax_succ : birkhoffMax f φ n.succ x = φ x + 0 ⊔ birkhoffMax f φ n (f x) := by have : birkhoffSum f φ ∘ .succ = fun k ↦ φ + birkhoffSum f φ k ∘ f := by funext k x; dsimp - rw [add_comm k 1, birkhoffSum_add f φ 1, birkhoffSum_one]; + rw [add_comm k 1, birkhoffSum_add_right_apply f φ 1, birkhoffSum_one_apply]; rfl nth_rw 1 [birkhoffMax, this, partialSups_const_add] simp only [Pi.add_apply, add_right_inj] @@ -114,7 +114,7 @@ lemma divergentSet_invariant : f x ∈ divergentSet f φ ↔ x ∈ divergentSet | coe a => rcases hx ↑(- φ x + a) (EReal.coe_lt_top _) with ⟨N, hN⟩ norm_cast at * - rw [neg_add_lt_iff_lt_add, ← birkhoffSum_succ'] at hN + rw [neg_add_lt_iff_lt_add, ← birkhoffSum_succ_apply'] at hN use N + 1 · intro hx simp only [divergentSet, Set.mem_preimage, birkhoffSup, Set.mem_singleton_iff, @@ -129,7 +129,7 @@ lemma divergentSet_invariant : f x ∈ divergentSet f φ ↔ x ∈ divergentSet conv => congr intro i - rw [← add_lt_add_iff_left (φ x), ← birkhoffSum_succ'] + rw [← add_lt_add_iff_left (φ x), ← birkhoffSum_succ_apply'] cases N with | zero => rcases hx ↑(birkhoffSum f φ 1 x) (EReal.coe_lt_top _) with ⟨N, hNN⟩ diff --git a/LeanPool/PolynomialMethodRestrictedSums/ANRPolynomialMethod.lean b/LeanPool/PolynomialMethodRestrictedSums/ANRPolynomialMethod.lean index 2dc9357bbf..2135965984 100644 --- a/LeanPool/PolynomialMethodRestrictedSums/ANRPolynomialMethod.lean +++ b/LeanPool/PolynomialMethodRestrictedSums/ANRPolynomialMethod.lean @@ -40,6 +40,7 @@ variable {R : Type*} [CommRing R] variable {p : ℕ} [Fact (Nat.Prime p)] {k : ℕ} open MvPolynomial +open AddMonoidAlgebra (coeff) open Finsupp @@ -145,13 +146,7 @@ lemma totalDegree_sumX_sub_C_first {p k : ℕ} [Fact (Nat.Prime p)] (a : ZMod p) simp [totalDegree_C, h_sumX] · refine le_trans ?_ (Finset.le_sup <| show Finsupp.single 0 1 ∈ (∑ i : Fin (k + 1), MvPolynomial.X i - MvPolynomial.C a |> MvPolynomial.support) from ?_) <;> norm_num - rw [MvPolynomial.coeff_sum]; - simp_all only [coeff_single_X, true_and, Finset.sum_ite_eq', Finset.mem_univ, ↓reduceIte] - apply Aesop.BuiltinRules.not_intro - intro a_1 - split at a_1 - next h => simpa using congr_arg (fun f => f 0) h.symm - next h => simp_all only [sub_zero, one_ne_zero] + simp [eq_comm, Finsupp.single_eq_zero] /-- Lemma 2.1.3.2 : Another version of the previous lemma -/ lemma totalDegree_sumX_sub_C_second (e : ZMod p) : @@ -190,7 +185,8 @@ lemma totalDegree_prod_sumX_sub_C_eq_card (E : Multiset (ZMod p)) : obtain ⟨a, a_mem, rid⟩ := rid have := congr($(rid).coeff (fun₀ | 0 => 1)) simp only [coeff_sub, coeff_sum, coeff_single_X, true_and, Finset.sum_ite_eq', - Finset.mem_univ, ↓reduceIte, coeff_C, coeff_zero] at this + Finset.mem_univ, ↓reduceIte, coeff_C, AddMonoidAlgebra.coeff_zero, Finsupp.coe_zero, + Pi.zero_apply] at this rw [ite_eq_right] at this · norm_num at this · rw [eq_comm, Finsupp.single_eq_zero] @@ -227,9 +223,9 @@ same as in $S^{|E|}$ lemma coeff_prod_sumX_minus_C_eq_coeff_sumX_pow_of_degree_eq {p : ℕ} [Fact (Nat.Prime p)] {k : ℕ} (E : Multiset (ZMod p)) (x : (Fin (k + 1)) →₀ ℕ) (hx : ∑ i, x i = Multiset.card E) : - MvPolynomial.coeff x ((E.map (fun e => (∑ i : Fin (k + 1), - MvPolynomial.X i) - MvPolynomial.C e)).prod) = - MvPolynomial.coeff x ((∑ i : Fin (k + 1), MvPolynomial.X i) ^ Multiset.card E) := by + coeff ((E.map (fun e => (∑ i : Fin (k + 1), + MvPolynomial.X i) - MvPolynomial.C e)).prod) x = + coeff ((∑ i : Fin (k + 1), MvPolynomial.X i) ^ Multiset.card E) x := by revert x induction E using Multiset.induction with | empty => intro x _; simp @@ -246,7 +242,7 @@ lemma coeff_prod_sumX_minus_C_eq_coeff_sumX_pow_of_degree_eq have hx_sum : ∑ x, (fst x + snd x) = E.card + 1 := by simpa [Finsupp.add_apply, Finset.sum_add_distrib] using hx by_cases h : 0 = fst - · -- in the pos branch, coeff 0 (C a) = a + · -- in the pos branch, coeff (C a) 0 = a subst h simp only [MvPolynomial.coeff_C, ↓reduceIte] -- carry hx in the simplified form (snd = E.card + 1) for the legacy bullet @@ -275,9 +271,9 @@ lemma coeff_prod_sumX_minus_C_eq_coeff_sumX_pow_of_degree_eq rw [MvPolynomial.coeff_C, ite_eq_right h, zero_mul, sub_zero] -- rewrite the goal as a disjunction expected by the legacy bullet 2 suffices h_disj : - coeff snd (Multiset.map (fun e => (∑ i, X i) - C e) E).prod = - coeff snd ((∑ i, X i) ^ E.card) ∨ - coeff fst ((∑ i, X i) : MvPolynomial (Fin (k + 1)) (ZMod p)) = 0 by + coeff (Multiset.map (fun e => (∑ i, X i) - C e) E).prod snd = + coeff ((∑ i, X i) ^ E.card) snd ∨ + coeff ((∑ i, X i) : MvPolynomial (Fin (k + 1)) (ZMod p)) fst = 0 by rcases h_disj with h_eq | h_zero · rw [h_eq] · rw [h_zero, zero_mul, zero_mul] @@ -312,36 +308,34 @@ certain conditions lemma constructionPolynomial_coeff_target_generalized (h : MvPolynomial (Fin (k + 1)) (ZMod p)) (c : Fin (k + 1) → ℕ) (m : ℕ) (hm : m + h.totalDegree = ∑ i, c i) - (h_coeff : coeff (Finsupp.equivFunOnFinite.symm c) ((∑ i, X i) ^ m * h) ≠ 0) + (h_coeff : coeff ((∑ i, X i) ^ m * h) (Finsupp.equivFunOnFinite.symm c) ≠ 0) (E : Multiset (ZMod p)) (hE_card : E.card = m) (coeff_prod_sumX_minus_C_target : - coeff (Finsupp.equivFunOnFinite.symm c) ((E.map (fun e => (∑ i, X i) - C e)).prod) = - coeff (Finsupp.equivFunOnFinite.symm c) ((∑ i, X i) ^ m)) + coeff ((E.map (fun e => (∑ i, X i) - C e)).prod) (Finsupp.equivFunOnFinite.symm c) = + coeff ((∑ i, X i) ^ m) (Finsupp.equivFunOnFinite.symm c)) (other_terms_vanish : ∀ (d : (Fin (k + 1)) →₀ ℕ), d ≠ 0 → - coeff d h * coeff (Finsupp.equivFunOnFinite.symm c - d) - ((E.map (fun e => (∑ i, X i) - C e)).prod) = 0) - (h_constant_term_nonzero : coeff 0 h ≠ 0) : - coeff (Finsupp.equivFunOnFinite.symm c) (constructionPolynomial h E) ≠ 0 := by + coeff h d * coeff ((E.map (fun e => (∑ i, X i) - C e)).prod) + (Finsupp.equivFunOnFinite.symm c - d) = 0) + (h_constant_term_nonzero : coeff h 0 ≠ 0) : + coeff (constructionPolynomial h E) (Finsupp.equivFunOnFinite.symm c) ≠ 0 := by -- By combining the results from `coeff_prod_sumX_minus_C_target` and `other_terms_vanish`, we -- can conclude that the coefficient of $c$ in the product is equal to the coefficient of $c$ -- in $S^m$ times the constant term of $h$. have h_final : - MvPolynomial.coeff - ((Finsupp.equivFunOnFinite.symm : (Fin (k + 1) → ℕ) → Fin (k + 1) →₀ ℕ) c) - (constructionPolynomial h E) = - MvPolynomial.coeff - ((Finsupp.equivFunOnFinite.symm : (Fin (k + 1) → ℕ) → Fin (k + 1) →₀ ℕ) c) - (Multiset.prod - (Multiset.map (fun e => (∑ i, MvPolynomial.X i) - MvPolynomial.C e) E)) * - MvPolynomial.coeff 0 h := by + coeff (constructionPolynomial h E) + ((Finsupp.equivFunOnFinite.symm : (Fin (k + 1) → ℕ) → Fin (k + 1) →₀ ℕ) c) = + coeff (Multiset.prod + (Multiset.map (fun e => (∑ i, MvPolynomial.X i) - MvPolynomial.C e) E)) + ((Finsupp.equivFunOnFinite.symm : (Fin (k + 1) → ℕ) → Fin (k + 1) →₀ ℕ) c) * + coeff h 0 := by rw [constructionPolynomial, MvPolynomial.coeff_mul] rw [Finset.sum_eq_single (0, (Finsupp.equivFunOnFinite.symm c))] · -- the diagonal term - change coeff 0 h * - coeff (Finsupp.equivFunOnFinite.symm c) - (Multiset.map (fun e => sumXPolynomial - C e) E).prod = - coeff (Finsupp.equivFunOnFinite.symm c) - (Multiset.map (fun e => (∑ i, X i) - C e) E).prod * coeff 0 h + change coeff h 0 * + coeff (Multiset.map (fun e => sumXPolynomial - C e) E).prod + (Finsupp.equivFunOnFinite.symm c) = + coeff (Multiset.map (fun e => (∑ i, X i) - C e) E).prod + (Finsupp.equivFunOnFinite.symm c) * coeff h 0 simp only [sumXPolynomial] rw [mul_comm] · -- the off-diagonal terms vanish @@ -366,10 +360,10 @@ lemma constructionPolynomial_coeff_target_generalized simp_all +decide only [ne_eq, mul_eq_zero, mul_comm, zero_eq_mul, false_or] rw [MvPolynomial.coeff_mul] rw [Finset.sum_eq_single (0, (Finsupp.equivFunOnFinite.symm c))] - · -- the diagonal term: coeff 0 h * coeff (sym c) ((∑ X)^m) = 0 via h_final - change coeff 0 h * - coeff (Finsupp.equivFunOnFinite.symm c) - ((∑ i, X i : MvPolynomial (Fin (k + 1)) (ZMod p)) ^ m) = 0 + · -- the diagonal term: coeff h 0 * coeff ((∑ X)^m) (sym c) = 0 via h_final + change coeff h 0 * + coeff ((∑ i, X i : MvPolynomial (Fin (k + 1)) (ZMod p)) ^ m) + (Finsupp.equivFunOnFinite.symm c) = 0 rw [h_final, mul_zero] · -- the off-diagonal terms vanish rintro ⟨fst, snd⟩ hmem hne @@ -384,19 +378,19 @@ lemma constructionPolynomial_coeff_target_generalized rw [← hmem, add_tsub_cancel_left] rcases other_terms_vanish fst h_fst with h_zero | h_prod_zero · rw [h_zero, zero_mul] - · -- h_prod_zero : coeff (sym c - fst) (∏ (∑ X - C e)) = 0 - -- Branch on whether coeff fst h is zero - by_cases h_coeff_fst : coeff fst h = 0 + · -- h_prod_zero : coeff (∏ (∑ X - C e)) (sym c - fst) = 0 + -- Branch on whether coeff h fst is zero + by_cases h_coeff_fst : coeff h fst = 0 · rw [h_coeff_fst, zero_mul] - · -- coeff fst h ≠ 0, so fst ∈ h.support + · -- coeff h fst ≠ 0, so fst ∈ h.support by_cases h_deg : ∑ i, snd i = E.card · -- snd has degree E.card; rewrite via the helper lemma have h_eq : - coeff snd ((∑ i, X i : MvPolynomial (Fin (k + 1)) (ZMod p)) ^ E.card) = - coeff snd (Multiset.map (fun e => (∑ i, X i) - C e) E).prod := by + coeff ((∑ i, X i : MvPolynomial (Fin (k + 1)) (ZMod p)) ^ E.card) snd = + coeff (Multiset.map (fun e => (∑ i, X i) - C e) E).prod snd := by rw [← coeff_prod_sumX_minus_C_eq_coeff_sumX_pow_of_degree_eq E snd h_deg] rw [← hE_card, h_eq, h_snd_eq, h_prod_zero, mul_zero] - · -- snd has wrong degree; show coeff snd ((∑ X)^m) = 0 + · -- snd has wrong degree; show coeff ((∑ X)^m) snd = 0 have h_left : fst ∈ h.support := MvPolynomial.mem_support_iff.mpr h_coeff_fst have h_sum_eq : (∑ i, fst i) + (∑ i, snd i) = ∑ i, c i := by @@ -416,8 +410,8 @@ lemma constructionPolynomial_coeff_target_generalized have h_total_pow : ((∑ i, X i : MvPolynomial (Fin (k+1)) (ZMod p)) ^ E.card).totalDegree ≤ E.card := totalDegree_sumX_pow_le E.card - have h_snd_zero : coeff snd ((∑ i, X i) ^ E.card : - MvPolynomial (Fin (k + 1)) (ZMod p)) = 0 := by + have h_snd_zero : coeff ((∑ i, X i) ^ E.card : + MvPolynomial (Fin (k + 1)) (ZMod p)) snd = 0 := by rw [MvPolynomial.coeff_eq_zero_of_totalDegree_lt] refine lt_of_le_of_lt h_total_pow ?_ by_contra h_not_lt @@ -457,7 +451,7 @@ private lemma equivFun_symm_support_sum_eq (c : Fin (k + 1) → ℕ) : private lemma coeff_equivFun_eq_zero_of_totalDegree_lt (P : MvPolynomial (Fin (k + 1)) (ZMod p)) (c : Fin (k + 1) → ℕ) (hP : P.totalDegree < ∑ i, c i) : - coeff (Finsupp.equivFunOnFinite.symm c) P = 0 := by + coeff P (Finsupp.equivFunOnFinite.symm c) = 0 := by apply MvPolynomial.coeff_eq_zero_of_totalDegree_lt rw [equivFun_symm_support_sum_eq] exact hP @@ -481,12 +475,12 @@ private lemma elimination_polynomial_degreeOf_eq rw [MvPolynomial.degreeOf_eq_sup] -- The leading coefficient of the product of linear factors is 1. have h_leading_coeff : - (MvPolynomial.coeff (Finsupp.single i #(A i)) (∏ a ∈ A i, - (MvPolynomial.X i - MvPolynomial.C a))) = 1 := by + (coeff (∏ a ∈ A i, + (MvPolynomial.X i - MvPolynomial.C a)) (Finsupp.single i #(A i))) = 1 := by induction (A i) using Finset.induction with | empty => simp_all only [gt_iff_lt, Finset.card_pos, Finset.card_empty, single_zero, - Finset.prod_empty, coeff_zero_one] + Finset.prod_empty, AddMonoidAlgebra.coeff_one_zero] | @insert a s a_1 a_2 => simp_all only [gt_iff_lt, Finset.card_pos, not_false_eq_true, Finset.card_insert_of_notMem, single_add, Finset.prod_insert] @@ -549,13 +543,13 @@ private lemma elimination_polynomial_degreeOf_eq /-- Helper for `elimination_polynomial_properties`: leading coefficient of $g_i$ equals 1. -/ private lemma elimination_polynomial_coeff_top_eq_one (A : Fin (k + 1) → Finset (ZMod p)) (i : Fin (k + 1)) (h_card : (A i).card > 0) : - coeff (Finsupp.single i ((A i).card)) (eliminationPolynomials A i) = 1 := by + coeff (eliminationPolynomials A i) (Finsupp.single i ((A i).card)) = 1 := by have h_leading_coeff : ∀ (s : Finset (ZMod p)), (∏ a ∈ s, (MvPolynomial.X i - MvPolynomial.C a)).coeff (Finsupp.single i (s.card)) = 1 := by intro s induction s using Finset.induction with - | empty => simp +decide [MvPolynomial.coeff_one] + | empty => simp +decide | @insert a s ha ih => simp_all? +decide [Finset.prod_insert ha, MvPolynomial.coeff_mul] -- The only non-zero term in the sum is when $x = (fun | i => 1)$ and $y = (fun | i => @@ -563,8 +557,8 @@ private lemma elimination_polynomial_coeff_top_eq_one have h_nonzero_term : ∀ x y : (Fin (k + 1)) →₀ ℕ, x + y = (fun₀ | i => #s) + (fun₀ | i => 1) → - (MvPolynomial.coeff x (MvPolynomial.X i) - if 0 = x then a else 0) * - MvPolynomial.coeff y (∏ a ∈ s, (MvPolynomial.X i - MvPolynomial.C a)) = + (coeff (MvPolynomial.X i) x - if 0 = x then a else 0) * + coeff (∏ a ∈ s, (MvPolynomial.X i - MvPolynomial.C a)) y = if x = (fun₀ | i => 1) ∧ y = (fun₀ | i => #s) then 1 else 0 := by intro x y hxy by_cases hx : x = (fun₀ | i => 1) @@ -691,7 +685,7 @@ private lemma elimination_polynomial_sub_top_totalDegree_lt -- that's a constant, which can't contribute to the coefficient of snd unless -- snd is zero. have h_snd_zero : ∀ (c : ZMod p), - MvPolynomial.coeff snd (MvPolynomial.C c) = if snd = 0 then c else 0 := by + coeff (MvPolynomial.C c) snd = if snd = 0 then c else 0 := by intro c; rw [MvPolynomial.coeff_C] split next h => @@ -770,7 +764,7 @@ lemma elimination_polynomial_properties (A : Fin (k + 1) → Finset (ZMod p)) (i (h_card : (A i).card > 0) : let g := eliminationPolynomials A i g.degreeOf i = (A i).card ∧ - coeff (Finsupp.single i ((A i).card)) g = 1 ∧ + coeff g (Finsupp.single i ((A i).card)) = 1 ∧ (∀ x, x i ∈ A i → eval x g = 0) ∧ (g - X i ^ (A i).card).totalDegree < (A i).card := by refine ⟨elimination_polynomial_degreeOf_eq A i h_card, @@ -790,8 +784,8 @@ lemma monomial_reduction_step (m : Fin (k + 1) →₀ ℕ) (i : Fin (k + 1)) Q.totalDegree < m.sum (fun _ n => n) ∧ (∀ x, (∀ j, x j ∈ A j) → eval x Q = eval x (monomial m 1)) ∧ (m.sum (fun _ n => n) ≤ ∑ j, c j → - coeff (Finsupp.equivFunOnFinite.symm c) Q = coeff (Finsupp.equivFunOnFinite.symm c) ( - monomial m 1)) := by + coeff Q (Finsupp.equivFunOnFinite.symm c) = coeff ( + monomial m 1) (Finsupp.equivFunOnFinite.symm c)) := by -- Define Q as X^{m'} * (X_i^{c_i+1} - g_i). set Q : MvPolynomial (Fin (k + 1)) (ZMod p) := MvPolynomial.monomial (m - Finsupp.single i (c i + 1)) 1 * @@ -865,7 +859,7 @@ lemma monomial_reduction_step (m : Fin (k + 1) →₀ ℕ) (i : Fin (k + 1)) have := congr_arg (fun f : Fin (k+1) →₀ ℕ => f i) hm_eq simp [Finsupp.equivFunOnFinite_symm_apply_apply] at this omega - rw [show coeff (equivFunOnFinite.symm c) ((monomial m) (1:ZMod p)) = 0 from by + rw [show coeff ((monomial m) (1:ZMod p)) (equivFunOnFinite.symm c) = 0 from by rw [MvPolynomial.coeff_monomial, ite_eq_right hm_ne]] · rw [elimination_polynomial_eval_eq_zero A i x (a i), sub_zero] simp +decide [MvPolynomial.eval_monomial] @@ -894,7 +888,7 @@ lemma exists_remainder (Q : MvPolynomial (Fin (k + 1)) (ZMod p)) ∃ R : MvPolynomial (Fin (k + 1)) (ZMod p), (∀ i, R.degreeOf i ≤ c i) ∧ (∀ x, (∀ i, x i ∈ A i) → eval x R = eval x Q) ∧ - (coeff (Finsupp.equivFunOnFinite.symm c) R = coeff (Finsupp.equivFunOnFinite.symm c) Q) := by + (coeff R (Finsupp.equivFunOnFinite.symm c) = coeff Q (Finsupp.equivFunOnFinite.symm c)) := by by_contra h_contra -- Apply induction on the total degree of Q. induction hQ_deg : Q.totalDegree using Nat.strong_induction_on generalizing Q with @@ -965,7 +959,7 @@ lemma coeff_target_eq_zero_of_vanishes_on_grid (hA : ∀ i, (A i).card = c i + 1) (hQ_deg : Q.totalDegree ≤ ∑ i, c i) (hQ_vanishes : ∀ x, (∀ i, x i ∈ A i) → eval x Q = 0) : - coeff (Finsupp.equivFunOnFinite.symm c) Q = 0 := by + coeff Q (Finsupp.equivFunOnFinite.symm c) = 0 := by -- Apply `exists_remainder` to $Q$ to get $R$. obtain ⟨R, hR⟩ := exists_remainder Q A c hA hQ_deg -- By `eq_zero_of_eval_zero_at_prod_finset`, $R = 0$. @@ -985,8 +979,8 @@ lemma coeff_mul_eq_of_degree_bound (m : ℕ) (h_deg : h.totalDegree + m = ∑ i, c i) (h_diff : P = Q ∨ (P - Q).totalDegree < m) : - coeff (Finsupp.equivFunOnFinite.symm c) (h * P) = - coeff (Finsupp.equivFunOnFinite.symm c) (h * Q) := by + coeff (h * P) (Finsupp.equivFunOnFinite.symm c) = + coeff (h * Q) (Finsupp.equivFunOnFinite.symm c) := by cases h_diff with | inl h_1 => subst h_1 @@ -998,7 +992,7 @@ lemma coeff_mul_eq_of_degree_bound lt_of_le_of_lt (totalDegree_mul h (P - Q)) (by linarith) -- Since the total degree of $h * (P - Q)$ is less than the sum of $c_i$, the coefficient of -- the monomial $c$ in $h * (P - Q)$ must be zero. - have h_coeff_zero : MvPolynomial.coeff (Finsupp.equivFunOnFinite.symm c) (h * (P - Q)) = 0 := + have h_coeff_zero : coeff (h * (P - Q)) (Finsupp.equivFunOnFinite.symm c) = 0 := coeff_equivFun_eq_zero_of_totalDegree_lt _ c (h_deg ▸ h_total_degree) simp_all? +decide [mul_sub] exact eq_of_sub_eq_zero h_coeff_zero @@ -1015,17 +1009,17 @@ lemma degree_product_minus_pow_lt {p : ℕ} [Fact (Nat.Prime p)] {k : ℕ} -- Since every monomial of degree $|E|$ in $P$ has the same coefficient as in $Q$, the -- difference $P - Q$ has no terms of degree $|E|$. have h_coeff_eq : ∀ x : (Fin (k + 1)) →₀ ℕ, x.sum (fun _ n => n) = E.card → - MvPolynomial.coeff x ((E.map (fun e => (∑ i : Fin (k + 1), + coeff ((E.map (fun e => (∑ i : Fin (k + 1), MvPolynomial.X i) - MvPolynomial.C e)).prod - (∑ i : Fin (k + 1), - MvPolynomial.X i) ^ E.card) = 0 := by + MvPolynomial.X i) ^ E.card) x = 0 := by -- Apply the lemma that states the coefficients of monomials of degree $|E|$ in $P$ and -- $Q$ are equal. intros x hx have h_coeff_eq : - MvPolynomial.coeff x ((E.map (fun e => (∑ i : Fin (k + 1), - MvPolynomial.X i) - MvPolynomial.C e)).prod) - = MvPolynomial.coeff x ((∑ i : Fin (k + 1), - MvPolynomial.X i) ^ E.card) := by + coeff ((E.map (fun e => (∑ i : Fin (k + 1), + MvPolynomial.X i) - MvPolynomial.C e)).prod) x + = coeff ((∑ i : Fin (k + 1), + MvPolynomial.X i) ^ E.card) x := by convert coeff_prod_sumX_minus_C_eq_coeff_sumX_pow_of_degree_eq E x _ simpa [Finsupp.sum_fintype] using hx aesop @@ -1033,9 +1027,9 @@ lemma degree_product_minus_pow_lt {p : ℕ} [Fact (Nat.Prime p)] {k : ℕ} -- strictly less than $|E|$. have h_total_degree_lt : ∀ x : (Fin (k + 1)) →₀ ℕ, x.sum (fun _ n => n) ≥ E.card → - MvPolynomial.coeff x ((E.map (fun e => (∑ i : Fin (k + 1), + coeff ((E.map (fun e => (∑ i : Fin (k + 1), MvPolynomial.X i) - MvPolynomial.C e)).prod - (∑ i : Fin (k + 1), - MvPolynomial.X i) ^ E.card) = 0 := by + MvPolynomial.X i) ^ E.card) x = 0 := by -- If x has degree greater than E.card, then since P and Q both have total degree E.card, -- their difference P - Q can't have any terms of degree higher than E.card. Therefore, the -- coefficient of x in P - Q must be zero because there are no such terms. @@ -1046,7 +1040,7 @@ lemma degree_product_minus_pow_lt {p : ℕ} [Fact (Nat.Prime p)] {k : ℕ} -- hence its coefficient in $P - Q$ is zero. have h_support : ∀ (P : MvPolynomial (Fin (k + 1)) (ZMod p)), P.totalDegree ≤ E.card → ∀ x : (Fin (k + 1)) →₀ ℕ, - x.sum (fun _ n => n) > E.card → MvPolynomial.coeff x P = 0 := by + x.sum (fun _ n => n) > E.card → coeff P x = 0 := by intro P hP x hx rw [MvPolynomial.coeff_eq_zero_of_totalDegree_lt] exact lt_of_le_of_lt hP hx @@ -1100,8 +1094,8 @@ theorem ANR_polynomial_method (h : MvPolynomial (Fin (k + 1)) (ZMod p)) (c : Fin (k + 1) → ℕ) (hA : ∀ i, (A i).card = c i + 1) (m : ℕ) (hm : m + h.totalDegree = ∑ i, c i) - (h_coeff : MvPolynomial.coeff (Finsupp.equivFunOnFinite.symm c) - ((∑ i : Fin (k + 1), MvPolynomial.X i) ^ m * h) ≠ 0) : + (h_coeff : coeff ((∑ i : Fin (k + 1), MvPolynomial.X i) ^ m * h) + (Finsupp.equivFunOnFinite.symm c) ≠ 0) : let S : Finset (ZMod p) := (Fintype.piFinset A).filter (fun f => h.eval f ≠ 0) |>.image (fun f => ∑ i, f i) S.card ≥ m + 1 ∧ m < p := by @@ -1109,8 +1103,8 @@ theorem ANR_polynomial_method (h : MvPolynomial (Fin (k + 1)) (ZMod p)) intro S have h_ne_zero : h ≠ 0 := by intro h_zero - rw [h_zero, mul_zero, coeff_zero] at h_coeff - exact h_coeff rfl + rw [h_zero, mul_zero] at h_coeff + exact h_coeff (by simp) -- Step 1: Prove |S| >= m + 1 by contradiction have hS_card : S.card ≥ m + 1 := by by_contra! H @@ -1130,7 +1124,7 @@ theorem ANR_polynomial_method (h : MvPolynomial (Fin (k + 1)) (ZMod p)) have h_prod_ne_zero : productPolynomial k E ≠ 0 := productPolynomial_ne_zero k E have hQ_total_deg : Q.totalDegree = ∑ i, c i := constructionPolynomial_totalDegree h h_ne_zero c m E hm hE_card h_prod_ne_zero - have hQ_coeff : MvPolynomial.coeff (Finsupp.equivFunOnFinite.symm c) Q ≠ 0 := by + have hQ_coeff : coeff Q (Finsupp.equivFunOnFinite.symm c) ≠ 0 := by rw [hQ_def] apply constructionPolynomial_coeff_target_generalized h c m hm h_coeff E hE_card · -- The product of (sumX - e) over E is equal to (sumX)^m plus a polynomial of degree less @@ -1165,17 +1159,17 @@ theorem ANR_polynomial_method (h : MvPolynomial (Fin (k + 1)) (ZMod p)) · rw [sub_eq_zero.mp h_diff_zero] · -- Since the difference has a lower degree, the coefficient of the term with degree m in -- the product must be equal to the coefficient of the term with degree m in (sumX)^m. - have h_coeff_eq : MvPolynomial.coeff (Finsupp.equivFunOnFinite.symm c) ( + have h_coeff_eq : coeff ( (E.map (fun e => (∑ i : Fin (k + 1), MvPolynomial.X i) - MvPolynomial.C e)).prod - (∑ i : Fin (k + 1), - MvPolynomial.X i) ^ m) = 0 := by + MvPolynomial.X i) ^ m) (Finsupp.equivFunOnFinite.symm c) = 0 := by -- Since the total degree of the difference is less than m, any term with degree m must -- have a coefficient of zero. have h_coeff_zero : ∀ (P : MvPolynomial (Fin (k + 1)) (ZMod p)), - P.totalDegree < m → MvPolynomial.coeff (Finsupp.equivFunOnFinite.symm c) P = 0 := by + P.totalDegree < m → coeff P (Finsupp.equivFunOnFinite.symm c) = 0 := by intros P hP_deg have h_coeff_zero : ∀ (m : (Fin (k + 1)) →₀ ℕ), - m.sum (fun _ n => n) > P.totalDegree → MvPolynomial.coeff m P = 0 := + m.sum (fun _ n => n) > P.totalDegree → coeff P m = 0 := fun m a => coeff_eq_zero_of_totalDegree_lt a exact h_coeff_zero _ (by simpa [Finsupp.sum_fintype] using by @@ -1186,17 +1180,17 @@ theorem ANR_polynomial_method (h : MvPolynomial (Fin (k + 1)) (ZMod p)) · intro d hd_ne_zero by_contra h_contra -- Apply the lemma `coeff_target_eq_zero_of_vanishes_on_grid` to $Q$. - have h_coeff_zero : MvPolynomial.coeff (Finsupp.equivFunOnFinite.symm c) Q = 0 := by + have h_coeff_zero : coeff Q (Finsupp.equivFunOnFinite.symm c) = 0 := by apply coeff_target_eq_zero_of_vanishes_on_grid any_goals tauto linarith -- Apply the lemma `coeff_mul_eq_of_degree_bound` with $h, P, P_{lead}, c, m$. - have h_coeff_mul_eq : MvPolynomial.coeff (Finsupp.equivFunOnFinite.symm c) ( + have h_coeff_mul_eq : coeff ( h * (E.map (fun e => ∑ i : Fin (k + 1), - MvPolynomial.X i - MvPolynomial.C e)).prod) - = MvPolynomial.coeff (Finsupp.equivFunOnFinite.symm c) (h * (∑ i : Fin (k + 1), - MvPolynomial.X i) ^ m) := by + MvPolynomial.X i - MvPolynomial.C e)).prod) (Finsupp.equivFunOnFinite.symm c) + = coeff (h * (∑ i : Fin (k + 1), + MvPolynomial.X i) ^ m) (Finsupp.equivFunOnFinite.symm c) := by apply coeff_mul_eq_of_degree_bound any_goals exact m · linarith @@ -1217,17 +1211,16 @@ theorem ANR_polynomial_method (h : MvPolynomial (Fin (k + 1)) (ZMod p)) by_contra h_const_zero -- If the constant term of h is zero, then the constant term of h * (∑ i, X i)^m is also -- zero. - have h_const_zero_prod : MvPolynomial.coeff 0 (h * (∑ i, MvPolynomial.X i) ^ m) = 0 := by + have h_const_zero_prod : coeff (h * (∑ i, MvPolynomial.X i) ^ m) 0 = 0 := by rw [MvPolynomial.coeff_mul, Finset.sum_eq_zero]; aesop -- By the properties of the product of polynomials, we can show that the coefficient of the -- target term in h * (∑ i, X i)^m is equal to the coefficient of the target term in h * -- P_{lead}. - have h_coeff_eq : MvPolynomial.coeff (Finsupp.equivFunOnFinite.symm c) ( + have h_coeff_eq : coeff ( h * (∑ i, - MvPolynomial.X i) ^ m) - = MvPolynomial.coeff (Finsupp.equivFunOnFinite.symm c) - (h * (productPolynomial k E)) := by + MvPolynomial.X i) ^ m) (Finsupp.equivFunOnFinite.symm c) + = coeff (h * (productPolynomial k E)) (Finsupp.equivFunOnFinite.symm c) := by -- By the properties of polynomial multiplication, if the difference between two -- polynomials has a lower total degree, then their coefficients for the highest-degree -- term are equal. @@ -1262,8 +1255,9 @@ theorem ANR_polynomial_method (h : MvPolynomial (Fin (k + 1)) (ZMod p)) rw [show E.card = m from hE_card] at key exact key have h_coeff_eq : ∀ (P Q : MvPolynomial (Fin (k + 1)) (ZMod p)), - (P - Q).totalDegree < m → MvPolynomial.coeff (Finsupp.equivFunOnFinite.symm c) ( - h * P) = MvPolynomial.coeff (Finsupp.equivFunOnFinite.symm c) (h * Q) := by + (P - Q).totalDegree < m → + coeff (h * P) (Finsupp.equivFunOnFinite.symm c) = + coeff (h * Q) (Finsupp.equivFunOnFinite.symm c) := by intros P Q h_diff_deg apply coeff_mul_eq_of_degree_bound all_goals norm_cast @@ -1277,7 +1271,7 @@ theorem ANR_polynomial_method (h : MvPolynomial (Fin (k + 1)) (ZMod p)) -- Since Q vanishes on the grid, the coefficient of the target monomial in Q is zero, -- contradicting hQ_coeff. have hQ_coeff_zero : - MvPolynomial.coeff (Finsupp.equivFunOnFinite.symm c) Q = 0 := + coeff Q (Finsupp.equivFunOnFinite.symm c) = 0 := coeff_target_eq_zero_of_vanishes_on_grid Q A c hA hQ_total_deg.le hQ_zero contradiction -- Step 2: Prove m < p first (this is needed for the main argument) diff --git a/LeanPool/PolynomialMethodRestrictedSums/CauchyDavenportTheorem.lean b/LeanPool/PolynomialMethodRestrictedSums/CauchyDavenportTheorem.lean index fc7015c6ab..a2a95fd55b 100644 --- a/LeanPool/PolynomialMethodRestrictedSums/CauchyDavenportTheorem.lean +++ b/LeanPool/PolynomialMethodRestrictedSums/CauchyDavenportTheorem.lean @@ -22,6 +22,7 @@ from the Alon-Nathanson-Ruzsa polynomial method. open Finsupp open scoped Finset open MvPolynomial +open AddMonoidAlgebra (coeff) open BigOperators -- 2.1 @@ -86,7 +87,7 @@ lemma cauchy_davenport_small_sum (A B S : Finset (ZMod p)) (hp : p.Prime) have h_A_neg_zero : 1 ≤ A.card := Finset.one_le_card.mpr hA have h_B_neg_zero : 1 ≤ B.card := Finset.one_le_card.mpr hB rw [Nat.add_comm, Nat.add_sub_assoc h_A_neg_zero, add_comm,← Nat.add_sub_assoc h_B_neg_zero] - have h_coeff_ne_zero : coeff (equivFunOnFinite.symm cs) ((∑ i : Fin 2, X i) ^ m * h_poly) ≠ 0 := + have h_coeff_ne_zero : coeff ((∑ i : Fin 2, X i) ^ m * h_poly) (equivFunOnFinite.symm cs) ≠ 0 := by simp only [h_poly, mul_one, Fin.sum_univ_two] rw [add_pow] @@ -109,7 +110,7 @@ lemma cauchy_davenport_small_sum (A B S : Finset (ZMod p)) (hp : p.Prime) dsimp [m] have h2 : 0 < p := hp.pos omega - · simp only [X, monomial_pow, monomial_mul] + · simp only [X, monomial_pow, monomial_mul_monomial] rw [coeff_monomial] rw [ite_eq_left] · rw [one_pow, one_pow, one_mul]; exact one_ne_zero @@ -121,7 +122,7 @@ lemma cauchy_davenport_small_sum (A B S : Finset (ZMod p)) (hp : p.Prime) intro b hb_range h_ne rw [show (↑(m.choose b) : MvPolynomial (Fin 2) (ZMod p)) = C (m.choose b : ZMod p) by simp] rw [mul_comm, coeff_C_mul] - simp only [X, monomial_pow, monomial_mul] + simp only [X, monomial_pow, monomial_mul_monomial] rw [coeff_monomial] rw [ite_eq_right] · simp -- 0 * = 0 diff --git a/LeanPool/PolynomialMethodRestrictedSums/RestrictedSumDistinctSizes.lean b/LeanPool/PolynomialMethodRestrictedSums/RestrictedSumDistinctSizes.lean index 74ff3e8198..8d84960343 100644 --- a/LeanPool/PolynomialMethodRestrictedSums/RestrictedSumDistinctSizes.lean +++ b/LeanPool/PolynomialMethodRestrictedSums/RestrictedSumDistinctSizes.lean @@ -29,6 +29,7 @@ sets `A i` have distinct sizes. -/ open MvPolynomial +open AddMonoidAlgebra (coeff) open Finset @@ -189,9 +190,8 @@ lemma vandermonde_coeff_nonzero (c : Fin (k + 1) → ℕ) (m : ℕ) (h_distinct : ∀ i j, i < j → c i ≠ c j) (hm : m < p) (h_sum : ∑ i, c i = m + (k + 1).choose 2) : - MvPolynomial.coeff (toFinsupp c) - ((∑ i : Fin (k + 1), (X i : MvPolynomial (Fin (k + 1)) (ZMod p))) ^ m * - vandermondePolynomial k) ≠ 0 := by + coeff ((∑ i : Fin (k + 1), (X i : MvPolynomial (Fin (k + 1)) (ZMod p))) ^ m * + vandermondePolynomial k) (toFinsupp c) ≠ 0 := by -- Therefore, the coefficient in ZMod p is non-zero because none of the factors in -- `expectedValue c m` are divisible by `p`. intro h_coeff_zero_in_charP @@ -202,9 +202,10 @@ lemma vandermonde_coeff_nonzero (c : Fin (k + 1) → ℕ) (m : ℕ) fun i j => by split_ifs <;> norm_num; exact sub_ne_zero_of_ne <| mod_cast Ne.symm <| by aesop⟩, fun i => Nat.factorial_ne_zero _⟩; have h_coeff_not_zero_in_K : - (MvPolynomial.coeff (Finsupp.equivFunOnFinite.symm c) ((∑ i : Fin (k + 1), + (coeff ((∑ i : Fin (k + 1), MvPolynomial.X i) ^ m * ∏ i : Fin (k + 1), ∏ j : Fin (k + 1), - if j.val < i.val then (X i - X j) else 1 : MvPolynomial (Fin (k + 1)) (ℤ))) + if j.val < i.val then (X i - X j) else 1 : MvPolynomial (Fin (k + 1)) (ℤ)) + (Finsupp.equivFunOnFinite.symm c)) = expectedValue c m := by have h_index : (Finsupp.equivFunOnFinite.symm c : (Fin (k + 1)) →₀ ℕ) = toFinsupp c := by ext i @@ -217,12 +218,12 @@ lemma vandermonde_coeff_nonzero (c : Fin (k + 1) → ℕ) (m : ℕ) have h_coeff_eq : ∀ (f : MvPolynomial (Fin (k + 1)) ℤ) ( g : MvPolynomial (Fin (k + 1)) ℤ), - MvPolynomial.coeff (Finsupp.equivFunOnFinite.symm c) (f * g) - = MvPolynomial.coeff (Finsupp.equivFunOnFinite.symm c) - (MvPolynomial.map (algebraMap ℤ ℚ) (f * g)) := by + coeff (f * g) (Finsupp.equivFunOnFinite.symm c) + = coeff (MvPolynomial.map (algebraMap ℤ ℚ) (f * g)) + (Finsupp.equivFunOnFinite.symm c) := by intros f g; rw [MvPolynomial.coeff_map]; aesop; rw [h_coeff_eq, h_index, ← Vandermonde_coefficient_formula c m h_sum] - congr 1 + congr 2 -- Push `map` through the polynomial product. rw [map_mul, map_pow, map_sum, map_prod] refine congrArg₂ (· * ·) ?_ ?_ @@ -235,19 +236,20 @@ lemma vandermonde_coeff_nonzero (c : Fin (k + 1) → ℕ) (m : ℕ) rw [apply_ite (MvPolynomial.map (algebraMap ℤ ℚ))] simp only [Fin.val_fin_lt, map_sub, MvPolynomial.map_X, map_one] have h_coeff_not_zero_in_K' : (algebraMap ℤ (ZMod p)) ( - MvPolynomial.coeff (Finsupp.equivFunOnFinite.symm c) ( + coeff ( (∑ i : Fin (k + 1), MvPolynomial.X i) ^ m * ∏ i : Fin (k + 1), ∏ j : Fin (k + 1), - if j.val < i.val then (X i - X j) else 1 : MvPolynomial (Fin (k + 1)) (ℤ))) = 0 := by + if j.val < i.val then (X i - X j) else 1 : MvPolynomial (Fin (k + 1)) (ℤ)) + (Finsupp.equivFunOnFinite.symm c)) = 0 := by convert h_coeff_zero_in_charP using 1; unfold vandermondePolynomial; -- By definition of polynomial multiplication and the fact that the coefficients are -- integers, the coefficient of the polynomial in ZMod p is the same as the coefficient -- of the polynomial in ℤ. have h_coeff_eq : ∀ (P : MvPolynomial (Fin (k + 1)) ℤ), - MvPolynomial.coeff (toFinsupp c) ( - MvPolynomial.map (algebraMap ℤ (ZMod p)) P) + coeff ( + MvPolynomial.map (algebraMap ℤ (ZMod p)) P) (toFinsupp c) = (algebraMap ℤ (ZMod p)) - (MvPolynomial.coeff (Finsupp.equivFunOnFinite.symm c) P) := by + (coeff P (Finsupp.equivFunOnFinite.symm c)) := by intro P; erw [MvPolynomial.coeff_map] simp_all only [ne_eq, Fin.val_fin_lt, algebraMap_int_eq, eq_intCast]; congr! 2; @@ -303,9 +305,9 @@ theorem restricted_sum_distinct_sizes (A : Fin (k + 1) → Finset (ZMod p)) -- \text{vandermonde}$ is non-zero modulo $p$. have hm_lt_p : m < p := restricted_sum_m_bound A h_nonempty h_sum_bound have h_coeff_nonzero : - (MvPolynomial.coeff (toFinsupp c) ((∑ i, + (coeff ((∑ i, (X i : MvPolynomial (Fin (k + 1)) (ZMod p))) ^ m * - vandermondePolynomial k)) ≠ 0 := by + vandermondePolynomial k) (toFinsupp c)) ≠ 0 := by -- Since $|A_i|$ are distinct, $c_i$ are distinct. have hc_distinct : ∀ i j, i < j → c i ≠ c j := fun i j hij => fun h => h_sizes_distinct i j hij <| diff --git a/LeanPool/PolynomialMethodRestrictedSums/VandermondeCoefficientFormula.lean b/LeanPool/PolynomialMethodRestrictedSums/VandermondeCoefficientFormula.lean index 632c46b248..b19fc82ee9 100644 --- a/LeanPool/PolynomialMethodRestrictedSums/VandermondeCoefficientFormula.lean +++ b/LeanPool/PolynomialMethodRestrictedSums/VandermondeCoefficientFormula.lean @@ -41,6 +41,7 @@ culminating in `Vandermonde_coefficient_formula`. -/ open MvPolynomial +open AddMonoidAlgebra (coeff) open Finset open Matrix open BigOperators @@ -415,8 +416,8 @@ private lemma sum_X_pow_eq_multinomial_sum (m : ℕ) : lemma coeff_term (c : Fin (k + 1) → ℕ) (m : ℕ) (σ : Equiv.Perm (Fin (k + 1))) (h_sum : ∑ i, c i = m + ((k + 1).choose 2)) : - MvPolynomial.coeff (toFinsupp c) ( - (∑ i : Fin (k + 1), X i) ^ m * ∏ i : Fin (k + 1), X i ^ (σ i : ℕ)) = + coeff ( + (∑ i : Fin (k + 1), X i) ^ m * ∏ i : Fin (k + 1), X i ^ (σ i : ℕ)) (toFinsupp c) = if (∀ i, σ i ≤ c i) then (m.factorial : ℚ) / ∏ i : Fin (k + 1), ((c i - (σ i : ℕ)).factorial : ℚ) else 0 := by rw [MvPolynomial.coeff_mul] @@ -508,8 +509,8 @@ lemma coeff_term (c : Fin (k + 1) → ℕ) (m : ℕ) (σ : Equiv.Perm (Fin (k + MvPolynomial.monomial (∑ i, Finsupp.single i (σ i : ℕ)) 1 := by induction (Finset.univ : Finset (Fin (k + 1))) using Finset.induction · simp_all only [prod_empty, sum_empty, monomial_zero', C_1] - · simp_all only [not_false_eq_true, prod_insert, monomial_mul, mul_one, - sum_insert] + · simp_all only [not_false_eq_true, prod_insert, monomial_mul_monomial, + mul_one, sum_insert] simp_all only [coeff_monomial, ite_eq_right_iff, one_ne_zero, imp_false, Decidable.not_not] exact h_snd_support @@ -562,19 +563,18 @@ end AristotleLemmas theorem Vandermonde_coefficient_formula (c : Fin (k + 1) → ℕ) (m : ℕ) (h_sum : ∑ i : Fin (k + 1), c i = m + ((k + 1).choose 2)) : - MvPolynomial.coeff (toFinsupp c) - ((∑ i : Fin (k + 1), X i) ^ m * - ∏ i : Fin (k + 1), ∏ j : Fin (k + 1), if j < i then (X i - X j) else 1) + coeff ((∑ i : Fin (k + 1), X i) ^ m * + ∏ i : Fin (k + 1), ∏ j : Fin (k + 1), if j < i then (X i - X j) else 1) (toFinsupp c) = expectedValue c m := by -- The coefficient of $X^c$ in $P$ is the sum over $\sigma$ of $\text{sgn}(\sigma)$ times the -- coefficient of $X^c$ in $(\sum X_i)^m \prod_i X_i^{\sigma(i)}$. - have h_coeff : MvPolynomial.coeff (toFinsupp c) ( + have h_coeff : coeff ( (∑ i, MvPolynomial.X i) ^ m * ∏ i, (∏ j, - if j < i then (MvPolynomial.X i - MvPolynomial.X j) else 1)) + if j < i then (MvPolynomial.X i - MvPolynomial.X j) else 1)) (toFinsupp c) = ∑ σ : Equiv.Perm (Fin (k + 1)), ((σ.sign : ℤ) : ℚ) - * MvPolynomial.coeff (toFinsupp c) ((∑ i, MvPolynomial.X i) ^ m * ∏ i, - (MvPolynomial.X i) ^ (σ i : ℕ)) := by + * coeff ((∑ i, MvPolynomial.X i) ^ m * ∏ i, + (MvPolynomial.X i) ^ (σ i : ℕ)) (toFinsupp c) := by -- The Vandermonde determinant is equal to the sum over permutations of the sign of the -- permutation times the product of x^((i)). have h_vandermonde : ∏ i : Fin (k + 1), ∏ j : Fin (k + 1), diff --git a/LeanPool/PythagoreanPolynomialParametrization/Explanatory.lean b/LeanPool/PythagoreanPolynomialParametrization/Explanatory.lean index 413ba45c11..d049ffef69 100644 --- a/LeanPool/PythagoreanPolynomialParametrization/Explanatory.lean +++ b/LeanPool/PythagoreanPolynomialParametrization/Explanatory.lean @@ -63,41 +63,39 @@ private lemma rat_scaled_num_den_cast_eq (N : ℕ) (q : ℚ) (hdiv : q.den ∣ N private lemma coeff_mapRange_scaled_rat {n : ℕ} (F : RatPoly n) (N : ℕ) (hf_map : (fun q : ℚ => (N : ℤ) / (q.den : ℤ) * q.num) 0 = 0) - (hdiv : ∀ s ∈ MvPolynomial.support F, (MvPolynomial.coeff s F).den ∣ N) + (hdiv : ∀ s ∈ MvPolynomial.support F, (F.coeff s).den ∣ N) (s : Fin n →₀ ℕ) : let P : MvPolynomial (Fin n) ℤ := AddMonoidAlgebra.ofCoeff <| Finsupp.mapRange (fun q : ℚ => (N : ℤ) / (q.den : ℤ) * q.num) hf_map (AddMonoidAlgebra.coeff F) - (Int.cast (MvPolynomial.coeff s P) : ℚ) = (N : ℚ) * MvPolynomial.coeff s F := by + (Int.cast (P.coeff s) : ℚ) = (N : ℚ) * F.coeff s := by intro P change - (Int.cast (MvPolynomial.coeff s - (AddMonoidAlgebra.ofCoeff <| + (Int.cast + ((AddMonoidAlgebra.ofCoeff <| Finsupp.mapRange (fun q : ℚ => (N : ℤ) / (q.den : ℤ) * q.num) hf_map - (AddMonoidAlgebra.coeff F))) : + (AddMonoidAlgebra.coeff F)).coeff s) : ℚ) = - (N : ℚ) * MvPolynomial.coeff s F + (N : ℚ) * F.coeff s by_cases hs : s ∈ MvPolynomial.support F · have hdiv_s := hdiv s hs have h1 : - MvPolynomial.coeff s - (AddMonoidAlgebra.ofCoeff <| + (AddMonoidAlgebra.ofCoeff <| Finsupp.mapRange (fun q : ℚ => (N : ℤ) / (q.den : ℤ) * q.num) hf_map - (AddMonoidAlgebra.coeff F)) = - (N / (MvPolynomial.coeff s F).den : ℤ) * (MvPolynomial.coeff s F).num := by - simp [MvPolynomial.coeff, Finsupp.mapRange_apply] + (AddMonoidAlgebra.coeff F)).coeff s = + (N / (F.coeff s).den : ℤ) * (F.coeff s).num := by + simp [Finsupp.mapRange_apply] rw [h1] - exact rat_scaled_num_den_cast_eq N (MvPolynomial.coeff s F) hdiv_s - · have hq : MvPolynomial.coeff s F = 0 := by + exact rat_scaled_num_den_cast_eq N (F.coeff s) hdiv_s + · have hq : F.coeff s = 0 := by rwa [MvPolynomial.notMem_support_iff] at hs - unfold MvPolynomial.coeff at hq ⊢ simp [Finsupp.mapRange_apply, hq] private lemma map_intPoly_eq_nat_smul_of_coeff {n : ℕ} (F : RatPoly n) (P : MvPolynomial (Fin n) ℤ) (N : ℕ) (hcoeff : ∀ s : Fin n →₀ ℕ, - (Int.cast (MvPolynomial.coeff s P) : ℚ) = (N : ℚ) * MvPolynomial.coeff s F) : + (Int.cast (P.coeff s) : ℚ) = (N : ℚ) * F.coeff s) : MvPolynomial.map (Int.castRingHom ℚ) P = (N : ℚ) • F := by apply MvPolynomial.ext intro s @@ -194,11 +192,11 @@ theorem single_intValued_parametrization_yields_finite_intPoly_parametrization rcases hF with ⟨hF_int, hF_eq⟩ have hD : ∀ i : Fin k, ∃ D : ℕ, 0 < D ∧ - ∀ s, s ∈ (F i).support → (MvPolynomial.coeff s (F i)).den ∣ D := by + ∀ s, s ∈ (F i).support → ((F i).coeff s).den ∣ D := by intro i - refine ⟨Finset.prod (F i).support fun s => (MvPolynomial.coeff s (F i)).den, ?_, ?_⟩ + refine ⟨Finset.prod (F i).support fun s => ((F i).coeff s).den, ?_, ?_⟩ · exact Finset.prod_pos fun s _ => - Nat.pos_of_ne_zero (Rat.den_ne_zero (MvPolynomial.coeff s (F i))) + Nat.pos_of_ne_zero (Rat.den_ne_zero ((F i).coeff s)) · intro s hs exact Finset.dvd_prod_of_mem _ hs choose D hD_pos hD_div using hD @@ -206,7 +204,7 @@ theorem single_intValued_parametrization_yields_finite_intPoly_parametrization have hD_total_pos : 0 < D_total := Finset.prod_pos fun i _ => hD_pos i have hD_total_div : ∀ (i : Fin k) (s : Fin n →₀ ℕ), - s ∈ (F i).support → (MvPolynomial.coeff s (F i)).den ∣ D_total := by + s ∈ (F i).support → ((F i).coeff s).den ∣ D_total := by intro i s hs exact dvd_trans (hD_div i s hs) (Finset.dvd_prod_of_mem _ (Finset.mem_univ i)) have hf_map : (fun q : ℚ => (D_total / q.den : ℤ) * q.num) 0 = 0 := by simp @@ -216,8 +214,8 @@ theorem single_intValued_parametrization_yields_finite_intPoly_parametrization (AddMonoidAlgebra.coeff (F i)) have hP_coeff : ∀ (i : Fin k) (s : Fin n →₀ ℕ), - (Int.cast (MvPolynomial.coeff s (P i)) : ℚ) = - D_total * MvPolynomial.coeff s (F i) := by + (Int.cast ((P i).coeff s) : ℚ) = + D_total * (F i).coeff s := by intro i s exact coeff_mapRange_scaled_rat (F i) D_total hf_map (hD_total_div i) s have hP_eval : diff --git a/LeanPool/QuadraticIterates/ArchMath1992/Main.lean b/LeanPool/QuadraticIterates/ArchMath1992/Main.lean index f8cb595af1..b4b7b79e32 100644 --- a/LeanPool/QuadraticIterates/ArchMath1992/Main.lean +++ b/LeanPool/QuadraticIterates/ArchMath1992/Main.lean @@ -188,7 +188,7 @@ theorem section1_equiv (ha : ¬IsSquare (-a : ℚ)) (n : ℕ) : theorem section1_squarefree (ha : ¬IsSquare (-a : ℚ)) (n : ℕ) (h : ∀ k ≥ 2, k ≤ n → ¬IsSquare |bSeq a k|) : Nonempty (GaloisGroup a n ≃* WreathPower n) := by - refine ((section1_equiv a ha n).out 2 0).mp ?_ + refine ((section1_equiv a ha n).out 3 1).mp ?_ refine ⟨fun i ↦ by simpa using bSeq_ne_zero a ha (Nat.le_add_left 1 (i : ℕ)), fun S hS hsq ↦ ?_⟩ have hsq_int : IsSquare (∏ i ∈ S, bSeq a ((i : ℕ) + 1)) := by rwa [show (∏ i ∈ S, (bSeq a ((i : ℕ) + 1) : ℚ)) diff --git a/LeanPool/QuadraticIterates/Mathlib/FieldTheory/Multiquadratic.lean b/LeanPool/QuadraticIterates/Mathlib/FieldTheory/Multiquadratic.lean index b4b569fac1..1ca469235e 100644 --- a/LeanPool/QuadraticIterates/Mathlib/FieldTheory/Multiquadratic.lean +++ b/LeanPool/QuadraticIterates/Mathlib/FieldTheory/Multiquadratic.lean @@ -871,9 +871,9 @@ theorem multiquadratic_degree_family {ι : Type*} [Fintype ι] {L : Type*} [Fiel have hs_ne : ∀ y ∈ s, cf y ≠ 0 := by intro y hy; obtain ⟨i, -, rfl⟩ := Finset.mem_image.mp (hs ▸ hy); rw [hcf_x]; exact hr i set e : ↥(s : Set E) ≃ ι := - (Equiv.setCongr hrange).trans (Equiv.ofInjective x hxinj).symm with he + (Set.equivOfEq hrange).trans (Equiv.ofInjective x hxinj).symm with he have hxe (y : ↥(s : Set E)) : x (e y) = (y : E) := - congrArg Subtype.val ((Equiv.ofInjective x hxinj).apply_symm_apply (Equiv.setCongr hrange y)) + congrArg Subtype.val ((Equiv.ofInjective x hxinj).apply_symm_apply (Set.equivOfEq hrange y)) have hdim : Module.finrank (ZMod 2) (multiquadraticRelations s cf) = Module.finrank (ZMod 2) (rootRelations r) := (multiquadraticRelations_finrank_eq_rootRelations s cf).trans diff --git a/LeanPool/QuadraticIterates/Mathlib/GroupTheory/PGroup.lean b/LeanPool/QuadraticIterates/Mathlib/GroupTheory/PGroup.lean index a913ff4722..2676d5962f 100644 --- a/LeanPool/QuadraticIterates/Mathlib/GroupTheory/PGroup.lean +++ b/LeanPool/QuadraticIterates/Mathlib/GroupTheory/PGroup.lean @@ -77,7 +77,9 @@ private theorem exists_ne_zero_orbit_const_mem {G : Type*} [Group G] [Finite G] let mulActV : MulAction Gᵈᵐᵃ ↥V := { smulV with one_smul := fun v ↦ by ext i; simp [hsmulV_coe] - mul_smul := fun g h v ↦ by ext i; simp [hsmulV_coe, mul_smul] } + mul_smul := fun g h v ↦ by + ext i + simp [hsmulV_coe, DomMulAct.smul_apply, mul_smul] } let distribV : DistribMulAction Gᵈᵐᵃ ↥V := { mulActV with smul_zero := fun g ↦ by ext i; simp [hsmulV_coe] diff --git a/LeanPool/QuadraticIterates/Mathlib/RingTheory/MoebiusFactor.lean b/LeanPool/QuadraticIterates/Mathlib/RingTheory/MoebiusFactor.lean index 1f1befc49e..96d29f7e89 100644 --- a/LeanPool/QuadraticIterates/Mathlib/RingTheory/MoebiusFactor.lean +++ b/LeanPool/QuadraticIterates/Mathlib/RingTheory/MoebiusFactor.lean @@ -85,6 +85,7 @@ lemma prod_moebiusFactorK {c : ℕ → R} (hc : ∀ d ≥ 1, c d ≠ 0) (n : ℕ (fun k hk ↦ by rw [ne_eq, FaithfulSMul.algebraMap_eq_zero_iff]; exact hc k hk)).mpr (fun n _ ↦ by simp [moebiusFactorK]) n hn).symm +omit [IsDomain R] in /-- `algebraMap a / algebraMap b` is integral iff `b ∣ a` (for `b ≠ 0`). -/ theorem isInteger_div_iff_dvd (a b : R) (hb : b ≠ 0) : IsLocalization.IsInteger R (algebraMap R K a / algebraMap R K b) ↔ b ∣ a := by diff --git a/LeanPool/QuantumParallelRepetition/Part01.lean b/LeanPool/QuantumParallelRepetition/Part01.lean index d51740a2ef..1c622725b6 100644 --- a/LeanPool/QuantumParallelRepetition/Part01.lean +++ b/LeanPool/QuantumParallelRepetition/Part01.lean @@ -2385,7 +2385,7 @@ theorem posSemidef_kernel_of_sub_posSemidef (hA : A.PosSemidef) (hsub : (F - A).PosSemidef) {x : d → ℂ} (hx : F *ᵥ x = 0) : A *ᵥ x = 0 := by - apply (hA.dotProduct_mulVec_zero_iff x).mp + apply hA.dotProduct_mulVec_zero_iff.mp have hA_nonneg : 0 ≤ star x ⬝ᵥ (A *ᵥ x) := hA.dotProduct_mulVec_nonneg x have hsub_nonneg : 0 ≤ star x ⬝ᵥ ((F - A) *ᵥ x) := @@ -4864,7 +4864,7 @@ theorem fullHistoryHiddenAliceWeight_sum_le_one fullHistoryHiddenAliceWeight G h hidden) ≤ 1 := by unfold fullHistoryHiddenAliceWeight rw [← Fintype.prod_sum] - apply Finset.prod_le_one + apply Finset.prod_le_one₀ · intro i _ exact Finset.sum_nonneg fun x _ => G.conditionalXGivenY_nonneg (h.bobRemaining i) x @@ -4879,7 +4879,7 @@ theorem fullHistoryHiddenBobWeight_sum_le_one fullHistoryHiddenBobWeight G h hidden) ≤ 1 := by unfold fullHistoryHiddenBobWeight rw [← Fintype.prod_sum] - apply Finset.prod_le_one + apply Finset.prod_le_one₀ · intro i _ exact Finset.sum_nonneg fun y _ => G.conditionalYGivenX_nonneg (h.aliceRevealed i) y diff --git a/LeanPool/QuantumParallelRepetition/Part10.lean b/LeanPool/QuantumParallelRepetition/Part10.lean index a1cc4b765b..9137015dd3 100644 --- a/LeanPool/QuantumParallelRepetition/Part10.lean +++ b/LeanPool/QuantumParallelRepetition/Part10.lean @@ -1114,9 +1114,9 @@ theorem unconditionalActualFairSourceVerifier_norm_le_one 0 ≤ integratorActualC485WinningEffect (P := P) (N := N) (m := m) G n S D a₀ b₀ j x y := - (ContinuousLinearMap.nonneg_iff_isPositive _).mpr positive + ContinuousLinearMap.nonneg_iff_isPositive.mpr positive apply (CStarAlgebra.norm_le_one_iff_of_nonneg _ nonnegative).mpr - exact (ContinuousLinearMap.le_def _ _).mpr + exact ContinuousLinearMap.le_def.mpr (unconditionalActualFairSourceVerifier_complement_isPositive (P := P) (N := N) (m := m) G n S D a₀ b₀ j x y) diff --git a/LeanPool/QuasiBorelSpaces/Defs.lean b/LeanPool/QuasiBorelSpaces/Defs.lean index 03d39941ef..ec0269c643 100644 --- a/LeanPool/QuasiBorelSpaces/Defs.lean +++ b/LeanPool/QuasiBorelSpaces/Defs.lean @@ -6,7 +6,7 @@ Authors: Anthony Vandikas, Kiarash Sotoudeh import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic import LeanPool.QuasiBorelSpaces.MeasureTheory.Cases -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic import Mathlib.MeasureTheory.MeasurableSpace.Defs import LeanPool.QuasiBorelSpaces.MeasureTheory.Instances diff --git a/LeanPool/QuasiBorelSpaces/MeasureTheory/List.lean b/LeanPool/QuasiBorelSpaces/MeasureTheory/List.lean index 4d5ecff9e5..2e6f89cfd2 100644 --- a/LeanPool/QuasiBorelSpaces/MeasureTheory/List.lean +++ b/LeanPool/QuasiBorelSpaces/MeasureTheory/List.lean @@ -32,7 +32,7 @@ lemma measurable_cons : Measurable (fun x : A × Encoding A ↦ cons x.1 x.2) := intro n simp only [cons] apply Sigma.measurable_mk' - apply measurable_pi_lambda + apply Measurable.of_eval rintro ⟨i, _⟩ cases i with | zero => diff --git a/LeanPool/QuasiBorelSpaces/MeasureTheory/Quantile.lean b/LeanPool/QuasiBorelSpaces/MeasureTheory/Quantile.lean index 1394315a1f..2932430881 100644 --- a/LeanPool/QuasiBorelSpaces/MeasureTheory/Quantile.lean +++ b/LeanPool/QuasiBorelSpaces/MeasureTheory/Quantile.lean @@ -51,9 +51,7 @@ private noncomputable def cdf (μ : Measure I) (i : I) : I where @[simp] private lemma cdf_apply_val (μ : Measure I) [IsProbabilityMeasure μ] (i : I) : (cdf μ i).val = (μ (Set.Iic i)).toReal := by - have : IsProbabilityMeasure (μ.map Subtype.val) := by - apply Measure.isProbabilityMeasure_map - fun_prop + have : IsProbabilityMeasure (μ.map Subtype.val) := inferInstance simp only [cdf, ProbabilityTheory.cdf_eq_real, Measure.real] rw [Measure.map_apply] · rfl @@ -65,9 +63,7 @@ private lemma measurable_cdf {μ : A → Measure I} [∀ x, IsProbabilityMeasure (μ x)] (hμ : Measurable μ) {i : A → I} (hi : Measurable i) : Measurable fun x ↦ cdf (μ x) (i x) := by - have {x} : IsProbabilityMeasure ((μ x).map Subtype.val) := by - apply Measure.isProbabilityMeasure_map - fun_prop + have {x} : IsProbabilityMeasure ((μ x).map Subtype.val) := inferInstance have : ProbabilityTheory.IsFiniteKernel ⟨μ, hμ⟩ := by use 1 simp only [ENNReal.one_lt_top, measure_univ, le_refl, implies_true, and_self] diff --git a/LeanPool/QuasiBorelSpaces/MeasureTheory/Randomization.lean b/LeanPool/QuasiBorelSpaces/MeasureTheory/Randomization.lean index 711392fd84..6f16a83d1b 100644 --- a/LeanPool/QuasiBorelSpaces/MeasureTheory/Randomization.lean +++ b/LeanPool/QuasiBorelSpaces/MeasureTheory/Randomization.lean @@ -131,9 +131,7 @@ private lemma unpackI_packI private instance [StandardBorelSpace A] {μ : Measure A} [IsProbabilityMeasure μ] - : IsProbabilityMeasure (μ.map packI) := by - apply Measure.isProbabilityMeasure_map - fun_prop + : IsProbabilityMeasure (μ.map packI) := inferInstance /-- The function `det μ` is a function such that `volume.map (det μ) = μ`. -/ noncomputable def det [StandardBorelSpace A] (μ : Measure A) [IsProbabilityMeasure μ] : I → A := @@ -206,8 +204,8 @@ lemma eq_detf_volume simp only [Measure.map_zero] have : NeZero μ := ⟨hμ⟩ change map (((μ Set.univ)⁻¹ • μ).det ∘ normalize) (_ • comap normalize volume) = μ - simp only [ne_eq, measure_ne_top, not_false_eq_true, ENNReal.ofReal_toReal, Measure.map_smul] - rw [← map_map, MeasurableEmbedding.map_comap] + simp only [ne_eq, measure_ne_top, not_false_eq_true, ENNReal.ofReal_toReal] + rw [Measure.map_smul _ (by fun_prop), ← map_map, MeasurableEmbedding.map_comap] · have : 0 < (μ Set.univ).toReal := by rw [(by simp : 0 = ENNReal.toReal 0), ENNReal.toReal_lt_toReal] · simp only [measure_univ_pos, ne_eq, hμ, not_false_eq_true] diff --git a/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Basic.lean b/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Basic.lean index 335cdf9a84..3f7c807859 100644 --- a/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Basic.lean +++ b/LeanPool/QuasiBorelSpaces/OmegaCompletePartialOrder/Basic.lean @@ -8,7 +8,7 @@ import Mathlib.MeasureTheory.Integral.Lebesgue.Add import Mathlib.Order.OmegaCompletePartialOrder import LeanPool.QuasiBorelSpaces.OmegaCompletePartialOrder.Chain.Const import Mathlib.MeasureTheory.MeasurableSpace.Defs -import Mathlib.Data.ENNReal.Basic +import Mathlib.Basic.ENNReal.Basic import Mathlib.MeasureTheory.Measure.MeasureSpaceDef import Mathlib.MeasureTheory.Constructions.BorelSpace.Basic import Mathlib.MeasureTheory.Integral.Lebesgue.Basic diff --git a/LeanPool/QuasiBorelSpaces/PreProbabilityMeasure.lean b/LeanPool/QuasiBorelSpaces/PreProbabilityMeasure.lean index 0419d75484..7522a0515c 100644 --- a/LeanPool/QuasiBorelSpaces/PreProbabilityMeasure.lean +++ b/LeanPool/QuasiBorelSpaces/PreProbabilityMeasure.lean @@ -79,7 +79,7 @@ noncomputable def mk' eval := have : Nonempty A := base.nonempty .mk fun x ↦ eval (unpack x) - base := base.map measurable_pack.aemeasurable + base := base.map pack @[simp] lemma lintegral_mk' @@ -331,10 +331,10 @@ noncomputable def cases · fun_prop · fun_prop } - base r := ((φ (ix r)).base r).map (f := fun x ↦ pack (ix r, x)) (by fun_prop) + base r := ((φ (ix r)).base r).map (fun x ↦ pack (ix r, x)) measurable_base := by apply measurable_cases (f := fun n r ↦ - ((φ n).base r).map (f := fun x ↦ pack (n, x)) (by fun_prop)) + ((φ n).base r).map (fun x ↦ pack (n, x))) · exact hix · intro i apply Measurable.subtype_mk @@ -638,7 +638,7 @@ namespace Var /-- The functorial `str`ength operation, lifted to variables. -/ noncomputable def str {φ : ℝ → A} (hφ : IsHom φ) (ψ : Var B) : Var (A × B) where eval := .mk fun r ↦ (φ (unpack r : ℝ × ℝ).1, ψ.eval (unpack r : ℝ × ℝ).2) - base r := (ψ r).base.map (f := fun x ↦ pack (r, x)) (by fun_prop) + base r := (ψ r).base.map (fun x ↦ pack (r, x)) measurable_base := by apply Measurable.subtype_mk apply Measure.measurable_map' diff --git a/LeanPool/RamanujanNagell/Helpers.lean b/LeanPool/RamanujanNagell/Helpers.lean index 2e89a655ac..a5e1459bd4 100644 --- a/LeanPool/RamanujanNagell/Helpers.lean +++ b/LeanPool/RamanujanNagell/Helpers.lean @@ -298,7 +298,7 @@ noncomputable instance instEuclideanDomain : EuclideanDomain R where /-- `R` is a principal ideal ring, since every Euclidean domain is one. -/ instance instPrincipalIdealRing : IsPrincipalIdealRing R := - EuclideanDomain.to_principal_ideal_domain + EuclideanDomain.instIsPrincipalIdealRing /-- `R` is a unique factorization domain, since every principal ideal ring is one. -/ instance instUniqueFactorizationMonoid : UniqueFactorizationMonoid R := inferInstance diff --git a/LeanPool/RamanujanTauMissesPrimes/Solution.lean b/LeanPool/RamanujanTauMissesPrimes/Solution.lean index beafcb6074..40208c99df 100644 --- a/LeanPool/RamanujanTauMissesPrimes/Solution.lean +++ b/LeanPool/RamanujanTauMissesPrimes/Solution.lean @@ -975,8 +975,6 @@ lemma E2_ysq_le_x11_add_X_int_step (X : ℝ) (p : ℕ+ × ℤ) (p.2 : ℝ) ^ 2 - ((p.1 : ℕ) : ℝ) ^ 11 ≤ X := by have h3' : |((↑↑p.1 : ℝ) ^ 11 - (↑p.2 : ℝ) ^ 2)| ≤ X := by convert h3 using 2 - push_cast - ring linarith [neg_le_abs ((↑↑p.1 : ℝ) ^ 11 - (↑p.2 : ℝ) ^ 2)] lemma E2_ysq_le_x11_add_X_helper (X : ℝ) (p : ℕ+ × ℤ) @@ -1174,7 +1172,7 @@ lemma primeFactors_mem_one_le (n : ℕ) (p : ℕ) (hp : p ∈ n.primeFactors) : (Nat.mem_primeFactors.mp hp).1.one_le lemma one_le_prod_primeFactors (n : ℕ) : - 1 ≤ ∏ p ∈ n.primeFactors, p := Finset.one_le_prod' (fun p hp => primeFactors_mem_one_le n p hp) + 1 ≤ ∏ p ∈ n.primeFactors, p := Finset.one_le_prod (fun p hp => primeFactors_mem_one_le n p hp) lemma radical_mul_le_aux (m n : ℕ) (_hm : 0 < m) (_hn : 0 < n) : (∏ p ∈ (m * n).primeFactors, p) ≤ @@ -3103,7 +3101,7 @@ lemma radical_dvd_le (d n : ℕ) (hd : 0 < d) (hn : 0 < n) (hdvd : d ∣ n) : Nat.radical d ≤ Nat.radical n := by unfold Nat.radical simp only [Nat.pos_iff_ne_zero.mp hd, Nat.pos_iff_ne_zero.mp hn, ↓reduceIte] - apply Finset.prod_le_prod_of_subset_of_one_le' + apply Finset.prod_le_prod_of_subset_of_one_le · exact Nat.primeFactors_mono hdvd (Nat.pos_iff_ne_zero.mp hn) · intro p hp _ exact Nat.Prime.one_le (Nat.prime_of_mem_primeFactors hp) diff --git a/LeanPool/Redhill/Common/SubsumCondition.lean b/LeanPool/Redhill/Common/SubsumCondition.lean index a0edafbfde..96d6bce338 100644 --- a/LeanPool/Redhill/Common/SubsumCondition.lean +++ b/LeanPool/Redhill/Common/SubsumCondition.lean @@ -6,8 +6,9 @@ Authors: Jeremy Tan import Mathlib.Algebra.BigOperators.Fin import Mathlib.Algebra.Order.BigOperators.Group.Finset +import Mathlib.Algebra.Order.Ring.Nat +import Mathlib.Basic.Sign.Defs import Mathlib.Data.Finset.Sort -import Mathlib.Data.Sign.Defs /-! # Subsum conditions diff --git a/LeanPool/Redhill/General/Defs.lean b/LeanPool/Redhill/General/Defs.lean index e6cbceae67..4f18d47dfe 100644 --- a/LeanPool/Redhill/General/Defs.lean +++ b/LeanPool/Redhill/General/Defs.lean @@ -113,7 +113,7 @@ lemma le_Y_of_mem_F : f ≤ Y F := _ ≤ (F.erase 0).prod id := by obtain rfl | f0 := eq_or_ne f 0 · simp - · exact single_le_prod' (f := id) (by grind) (by simp_all) + · exact single_le_prod (f := id) (by grind) (by simp_all) _ ≤ _ := by grind [Y] lemma lt_primeChain_of_mem_F : f < primeChain (100 * Y F ^ 6) n := diff --git a/LeanPool/Redhill/KonyaginPrelude.lean b/LeanPool/Redhill/KonyaginPrelude.lean index f83674c488..13ca74ef8e 100644 --- a/LeanPool/Redhill/KonyaginPrelude.lean +++ b/LeanPool/Redhill/KonyaginPrelude.lean @@ -224,7 +224,8 @@ lemma strongSSC_tup : StrongSSC (tup k) := by decide +kernel have hk' : 10 ≤ 6 ^ 2 ^ k := by apply (show 10 ≤ 6 ^ 2 ^ 1 by lia).trans - gcongr <;> lia + gcongr + lia convert strongSSC_tupReduced (6 ^ 2 ^ k) hk' using 1 ext i fin_cases i <;> simp [tup, tupReduced] @@ -268,15 +269,15 @@ lemma maxAbs_tup : maxAbs (tup k) = (6 ^ 2 ^ k + 1) ^ 3 := by rw [neg_mul, Int.natAbs_neg, ← pow_mul', ← pow_succ', Int.natAbs_pow] simp_rw [Int.reduceAbs, sup_eq_left] apply (show 31 ≤ 6 ^ (2 * 2 ^ 0 + 1) by lia).trans - gcongr <;> lia + gcongr + lia rw [e2, sup_le_iff, Int.natAbs_neg, Int.natAbs_pow] refine ⟨pow_le_pow_left₀ zero_le (by lia) _, ?_⟩ calc _ ≤ 6 ^ (3 * 2 ^ k) := by rw [Nat.succ_mul 2] gcongr - · lia - · exact Nat.one_le_two_pow + exact Nat.one_le_two_pow _ ≤ _ := by rw [pow_mul'] gcongr diff --git a/LeanPool/Redhill/ToMathlib/NatSumProd.lean b/LeanPool/Redhill/ToMathlib/NatSumProd.lean index de04c674d4..301a083807 100644 --- a/LeanPool/Redhill/ToMathlib/NatSumProd.lean +++ b/LeanPool/Redhill/ToMathlib/NatSumProd.lean @@ -29,7 +29,7 @@ lemma sum_le_prod {ι : Type*} {s : Finset ι} {f : ι → ℕ} (hf : ∀ i ∈ simp_rw [Finset.mem_insert, forall_eq_or_imp] at hf refine (Nat.add_le_add_left (ih hf.2) _).trans (Nat.add_le_mul hf.1 ?_) obtain ⟨b, hb⟩ := hs - refine (hf.2 _ hb).trans (Finset.single_le_prod' (fun j mj ↦ ?_) hb) + refine (hf.2 _ hb).trans (Finset.single_le_prod (fun j mj ↦ ?_) hb) exact one_le_two.trans (hf.2 _ mj) /-- The sum of three natural numbers is strictly less than their product diff --git a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/Approximation.lean b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/Approximation.lean index b10107d5b7..9f450935e6 100644 --- a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/Approximation.lean +++ b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/L2Compactness/Approximation.lean @@ -433,7 +433,7 @@ lemma norm_sq_smoothL2_sub_extendByZeroL2_le_integral_norm_sq_translateL2_sub_ex MeasureTheory.AEStronglyMeasurable f (Measure.map Prod.fst ((volume : Measure E).prod μ)) := by - simpa [Measure.map_fst_prod] using hf_mem.1 + simpa [Measure.map_fst_prod] using hf_mem.aestronglyMeasurable exact MeasureTheory.AEStronglyMeasurable.comp_measurable (μ := (volume : Measure E).prod μ) (f := Prod.fst) (g := f) hf_map measurable_fst diff --git a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/TranslationEstimateL2.lean b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/TranslationEstimateL2.lean index 791dddd384..a858571708 100644 --- a/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/TranslationEstimateL2.lean +++ b/LeanPool/RellichKondrachov/Analysis/FunctionalSpaces/Sobolev/Euclidean/TranslationEstimateL2.lean @@ -297,8 +297,20 @@ lemma enorm_translateL2_sub_toL2_le (a : E) (f : ↥(C1c (E := E))) : -- Expand the definition of `eLpNorm` at exponent `2`. have h2_ne0 : (2 : ℝ≥0∞) ≠ 0 := by simp have h2_netop : (2 : ℝ≥0∞) ≠ ∞ := by simp - simp_rw [MeasureTheory.eLpNorm_eq_lintegral_rpow_enorm_toReal - h2_ne0 h2_netop, ENNReal.toReal_ofNat] at * + have hf_meas : MeasureTheory.AEStronglyMeasurable (fun x : E => f.1 x) μ := + (memLp_of_mem_C1c (μ := μ) (E := E) f.2).aestronglyMeasurable + have hshift_meas : + MeasureTheory.AEStronglyMeasurable (fun x : E => f.1 (x + a) - f.1 x) μ := by + have hshift : MeasureTheory.AEStronglyMeasurable (fun x : E => f.1 (x + a)) μ := + hf_meas.comp_quasiMeasurePreserving + (MeasureTheory.measurePreserving_add_right μ a).quasiMeasurePreserving + exact hshift.sub hf_meas + have hgrad_meas : + MeasureTheory.AEStronglyMeasurable (fun x : E => grad (E := E) f.1 x) μ := + (memLp_grad_of_mem_C1c (μ := μ) (E := E) f.2).aestronglyMeasurable + rw [MeasureTheory.eLpNorm_eq_lintegral_rpow_enorm_toReal h2_ne0 h2_netop hshift_meas, + MeasureTheory.eLpNorm_eq_lintegral_rpow_enorm_toReal h2_ne0 h2_netop hgrad_meas, + ENNReal.toReal_ofNat] -- It suffices to compare the squared integrals. have hsq := lintegral_enorm_sub_sq_le (μ := μ) a f -- Take the `1/2` power on both sides and simplify. diff --git a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/RellichKondrachovRiemannian/Chartwise.lean b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/RellichKondrachovRiemannian/Chartwise.lean index 7c238053e9..73d4b2a991 100644 --- a/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/RellichKondrachovRiemannian/Chartwise.lean +++ b/LeanPool/RellichKondrachov/Geometry/Manifold/Sobolev/RellichKondrachovRiemannian/Chartwise.lean @@ -498,7 +498,7 @@ private lemma l2ChartToVolumeOnRhoSupportImage_toL2_of_tsupport_subset (i : dR.d simpa using (memLp_of_mem_C1c (μ := (volume : Measure E).restrict K) (E := E) (f := g.1) g.2) - exact hgmem.1.aemeasurable + exact hgmem.aestronglyMeasurable.aemeasurable have hez : ((ez (e (r x)) : E →₂[(volume : Measure E)] ℝ) : E → ℝ) =ᵐ[(volume : Measure E)] K.indicator fun z : E => (e (r x) : E → ℝ) z := by @@ -621,7 +621,7 @@ private lemma l2ChartToVolumeOnRhoSupportImage_toL2Grad_of_tsupport_subset (i : simpa using (memLp_grad_of_mem_C1c (μ := (volume : Measure E).restrict K) (E := E) (f := g.1) g.2) - exact hgmem.1.aemeasurable + exact hgmem.aestronglyMeasurable.aemeasurable have hez : ((ez (e (r x)) : E →₂[(volume : Measure E)] E) : E → E) =ᵐ[(volume : Measure E)] K.indicator fun z : E => (e (r x) : E → E) z := by diff --git a/LeanPool/RellichKondrachov/MeasureTheory/Function/LpSpace/ChangeMeasureLeSmul.lean b/LeanPool/RellichKondrachov/MeasureTheory/Function/LpSpace/ChangeMeasureLeSmul.lean index c295ffa22a..4a7e402abb 100644 --- a/LeanPool/RellichKondrachov/MeasureTheory/Function/LpSpace/ChangeMeasureLeSmul.lean +++ b/LeanPool/RellichKondrachov/MeasureTheory/Function/LpSpace/ChangeMeasureLeSmul.lean @@ -145,16 +145,17 @@ private lemma norm_changeMeasureFun_le {c : ℝ≥0∞} (hc : c ≠ ∞) (hν : (c ^ (1 / p).toReal) * MeasureTheory.eLpNorm (fun x : α => f x) p μ := by simpa [ENNReal.smul_def, mul_assoc, mul_left_comm, mul_comm] using (MeasureTheory.eLpNorm_smul_measure_of_ne_top - (μ := μ) (p := p) (f := fun x : α => f x) hp c) + (μ := μ) (p := p) (f := fun x : α => f x) hp c + (MeasureTheory.Lp.aestronglyMeasurable f)) exact hmono.trans_eq hscale have htoReal : ENNReal.toReal (MeasureTheory.eLpNorm (fun x : α => f x) p ν) ≤ ENNReal.toReal ((c ^ (1 / p).toReal) * MeasureTheory.eLpNorm (fun x : α => f x) p μ) := by refine (ENNReal.toReal_le_toReal ?_ ?_).2 hle_eLpNorm - · exact hfν.2.ne + · exact hfν.eLpNorm_ne_top · have hfμ : MeasureTheory.MemLp (fun x : α => f x) p μ := by simpa using (MeasureTheory.Lp.memLp f) - have hfμ_ne : MeasureTheory.eLpNorm (fun x : α => f x) p μ ≠ ∞ := hfμ.2.ne + have hfμ_ne : MeasureTheory.eLpNorm (fun x : α => f x) p μ ≠ ∞ := hfμ.eLpNorm_ne_top have hcPow : c ^ (1 / p).toReal ≠ ∞ := by have hy0 : 0 ≤ (1 / p).toReal := by exact ENNReal.toReal_nonneg diff --git a/LeanPool/RiemannMappingTheorem/DerivInj.lean b/LeanPool/RiemannMappingTheorem/DerivInj.lean index 18b2213c9f..8993b88fa1 100644 --- a/LeanPool/RiemannMappingTheorem/DerivInj.lean +++ b/LeanPool/RiemannMappingTheorem/DerivInj.lean @@ -108,7 +108,6 @@ lemma tendsto_uniformly_on_add_const : convert (tendsto_uniformly_on_const (f := g)).add this using 2 · ext ε simp - · simp lemma deriv_ne_zero_of_inj_aux {g : ℂ → ℂ} (hU : IsOpen U) (hg : DifferentiableOn ℂ g U) (hi : InjOn g U) (hz₀ : z₀ ∈ U) (hgz₀ : g z₀ = 0) : diff --git a/LeanPool/RiemannMappingTheorem/ToMathlib.lean b/LeanPool/RiemannMappingTheorem/ToMathlib.lean index ce62dc494e..9b065fed5f 100644 --- a/LeanPool/RiemannMappingTheorem/ToMathlib.lean +++ b/LeanPool/RiemannMappingTheorem/ToMathlib.lean @@ -50,7 +50,7 @@ lemma has_deriv_at_integral_of_continuous_of_lip have h5 : Integrable (fun _ => C) μ := integrable_const _ have h6 : ∀ᵐ t ∂μ, HasDerivAt (fun z => φ z t) (ψ t) z₀ := (ae_restrict_iff' measurableSet_Ioc).mpr (Eventually.of_forall φ_der) - exact (hasDerivAt_integral_of_dominated_loc_of_lip (Metric.ball_mem_nhds z₀ δ_pos) + exact (_root_.hasDerivAt_integral_of_dominated_loc_of_lip (Metric.ball_mem_nhds z₀ δ_pos) h1 h2 h3 h4 h5 h6).2 section uIoo diff --git a/LeanPool/RiemannRochFunctionFields/EllipticCurve/Dedekind.lean b/LeanPool/RiemannRochFunctionFields/EllipticCurve/Dedekind.lean index 27e4489697..423554e0e7 100644 --- a/LeanPool/RiemannRochFunctionFields/EllipticCurve/Dedekind.lean +++ b/LeanPool/RiemannRochFunctionFields/EllipticCurve/Dedekind.lean @@ -243,7 +243,7 @@ theorem isDiscreteValuationRing_atPrime_of_derivative_not_mem infer_instance exact ((IsDiscreteValuationRing.TFAE (Localization.AtPrime P) (IsLocalization.AtPrime.not_isField (AdjoinRoot f) hP0 - (Localization.AtPrime P))).out 4 0).mp hprincipal + (Localization.AtPrime P))).out 5 1).mp hprincipal theorem isDiscreteValuationRing_atPrime_of_derivative_eq_not_mem [IsNoetherianRing R] [IsPrincipalIdealRing R] diff --git a/LeanPool/RiemannRochFunctionFields/EllipticCurve/Infinity.lean b/LeanPool/RiemannRochFunctionFields/EllipticCurve/Infinity.lean index 4cfd060b7f..11f07dc70e 100644 --- a/LeanPool/RiemannRochFunctionFields/EllipticCurve/Infinity.lean +++ b/LeanPool/RiemannRochFunctionFields/EllipticCurve/Infinity.lean @@ -267,7 +267,7 @@ omit [WeierstrassCurve.IsElliptic W] in lemma infinity_sum_ramification_inertia : let p := IsLocalRing.maximalIdeal A∞ ∑ P ∈ IsDedekindDomain.primesOverFinset p S∞, - p.ramificationIdx' P * p.inertiaDeg' P = 2 := by + p.ramificationIdx' P * P.inertiaDeg A∞ = 2 := by dsimp have hp0 : IsLocalRing.maximalIdeal A∞ ≠ ⊥ := Ring.ne_bot_of_isMaximal_of_not_isField (IsLocalRing.maximalIdeal.isMaximal A∞) @@ -279,7 +279,7 @@ include W in omit [WeierstrassCurve.IsElliptic W] in lemma infinity_inertiaDeg_eq_one (v : IsDedekindDomain.HeightOneSpectrum S∞) : - (IsLocalRing.maximalIdeal A∞).inertiaDeg' v.asIdeal = 1 := by + v.asIdeal.inertiaDeg A∞ = 1 := by let p := IsLocalRing.maximalIdeal A∞ let P := v.asIdeal have hp0 : p ≠ ⊥ := @@ -291,17 +291,17 @@ lemma infinity_inertiaDeg_eq_one have hP : P ∈ IsDedekindDomain.primesOverFinset p S∞ := (IsDedekindDomain.mem_primesOverFinset_iff hp0 (P := P)).2 ⟨v.isPrime, (show P.LiesOver p from inferInstance)⟩ - let g : Ideal S∞ → ℕ := fun Q => p.ramificationIdx' Q * p.inertiaDeg' Q + let g : Ideal S∞ → ℕ := fun Q => p.ramificationIdx' Q * Q.inertiaDeg A∞ have hsum : (∑ Q ∈ IsDedekindDomain.primesOverFinset p S∞, g Q) = 2 := by simpa [g] using infinity_sum_ramification_inertia W K have hterm : g P ≤ 2 := by rw [← hsum, ← Finset.add_sum_erase _ _ hP] omega have he : p.ramificationIdx' P = 2 := infinity_ramificationIdx_eq_two W K v - have hfpos : 0 < p.inertiaDeg' P := Ideal.inertiaDeg'_pos p P + have hfpos : 0 < P.inertiaDeg A∞ := Ideal.inertiaDeg_pos P A∞ dsimp [g] at hterm rw [he] at hterm - change p.inertiaDeg' P = 1 + change P.inertiaDeg A∞ = 1 omega include W in @@ -328,7 +328,7 @@ lemma infinity_heightOne_unique (IsDedekindDomain.mem_primesOverFinset_iff hp0 (P := Q)).2 ⟨w.isPrime, (show Q.LiesOver p from inferInstance)⟩ by_contra hne - let g : Ideal S∞ → ℕ := fun R => p.ramificationIdx' R * p.inertiaDeg' R + let g : Ideal S∞ → ℕ := fun R => p.ramificationIdx' R * R.inertiaDeg A∞ let F := IsDedekindDomain.primesOverFinset p S∞ have hsum : F.sum g = 2 := by simpa [F, g] using infinity_sum_ramification_inertia W K @@ -341,8 +341,8 @@ lemma infinity_heightOne_unique _ = 2 := hsum have heP : p.ramificationIdx' P = 2 := infinity_ramificationIdx_eq_two W K v have heQ : p.ramificationIdx' Q = 2 := infinity_ramificationIdx_eq_two W K w - have hfP : 0 < p.inertiaDeg' P := Ideal.inertiaDeg'_pos p P - have hfQ : 0 < p.inertiaDeg' Q := Ideal.inertiaDeg'_pos p Q + have hfP : 0 < P.inertiaDeg A∞ := Ideal.inertiaDeg_pos P A∞ + have hfQ : 0 < Q.inertiaDeg A∞ := Ideal.inertiaDeg_pos Q A∞ dsimp [g] at hQle hdecomp rw [heP] at hdecomp rw [heQ] at hQle @@ -367,11 +367,6 @@ include W in omit [WeierstrassCurve.IsElliptic W] in theorem infinityPlace_deg_one : placeDegree k K (infinityPlace K) = 1 := by rw [infinityPlace, placeDegree_infinite_eq_inertiaDeg] - have hunder : (infinityHeightOne (k := k) K).asIdeal.under A∞ = - IsLocalRing.maximalIdeal A∞ := - IsLocalRing.eq_maximalIdeal - (Ideal.IsMaximal.under A∞ (infinityHeightOne (k := k) K).asIdeal) - rw [hunder] exact infinity_inertiaDeg_eq_one W K (infinityHeightOne (k := k) K) end diff --git a/LeanPool/RiemannRochFunctionFields/EllipticCurve/Instances.lean b/LeanPool/RiemannRochFunctionFields/EllipticCurve/Instances.lean index a79b3e7344..b7af98cac6 100644 --- a/LeanPool/RiemannRochFunctionFields/EllipticCurve/Instances.lean +++ b/LeanPool/RiemannRochFunctionFields/EllipticCurve/Instances.lean @@ -254,6 +254,7 @@ theorem isSeparable [W.IsElliptic] : Algebra.IsSeparable k⟮X⟯ K := by exact hle hz have : Algebra.IsSeparable k⟮X⟯ (IntermediateField.adjoin k⟮X⟯ {W.yCoord K}) := (IntermediateField.isSeparable_adjoin_simple_iff_isSeparable k⟮X⟯ K).mpr hsep + let : Algebra k⟮X⟯ (⊤ : IntermediateField k⟮X⟯ K) := IntermediateField.algebra' ⊤ exact AlgEquiv.Algebra.isSeparable ((IntermediateField.equivOfEq htop).trans IntermediateField.topEquiv) diff --git a/LeanPool/RiemannRochFunctionFields/FunctionField/Divisor.lean b/LeanPool/RiemannRochFunctionFields/FunctionField/Divisor.lean index 5e85335181..f993989d66 100644 --- a/LeanPool/RiemannRochFunctionFields/FunctionField/Divisor.lean +++ b/LeanPool/RiemannRochFunctionFields/FunctionField/Divisor.lean @@ -65,7 +65,7 @@ place at infinity of `k(X)`. -/ theorem placeDegree_infinite_eq_inertiaDeg (v : IsDedekindDomain.HeightOneSpectrum (infiniteIntegers k K)) : placeDegree k K (Sum.inr v) = - (v.asIdeal.under (inftyValuationSubring k)).inertiaDeg' v.asIdeal := by + v.asIdeal.inertiaDeg (inftyValuationSubring k) := by let A := inftyValuationSubring k let S := infiniteIntegers k K let p : Ideal A := v.asIdeal.under A @@ -81,13 +81,13 @@ theorem placeDegree_infinite_eq_inertiaDeg rw [hp] exact inftyValuationSubring.finiteDimensionalResidueField k let : FiniteDimensional (A ⧸ p) (S ⧸ v.asIdeal) := by - have hfin := Ideal.inertiaDeg'_pos p v.asIdeal - rw [Ideal.inertiaDeg'_algebraMap] at hfin + have hfin := Ideal.inertiaDeg_pos v.asIdeal A + rw [Ideal.inertiaDeg_eq_of_isMaximal p v.asIdeal] at hfin exact FiniteDimensional.of_finrank_pos hfin let : IsScalarTower k (A ⧸ p) (S ⧸ v.asIdeal) := IsScalarTower.of_algebraMap_eq fun _ => rfl - change Module.finrank k (S ⧸ v.asIdeal) = p.inertiaDeg' v.asIdeal - rw [Ideal.inertiaDeg'_algebraMap] + change Module.finrank k (S ⧸ v.asIdeal) = v.asIdeal.inertiaDeg A + rw [Ideal.inertiaDeg_eq_of_isMaximal p v.asIdeal] have htower := Module.finrank_mul_finrank k (A ⧸ p) (S ⧸ v.asIdeal) have hbase : Module.finrank k (A ⧸ p) = 1 := by rw [hp] @@ -101,7 +101,7 @@ theorem placeDegree_finite_eq_base_mul_inertiaDeg (v : IsDedekindDomain.HeightOneSpectrum (ringOfIntegers k K)) : placeDegree k K (Sum.inl v) = Module.finrank k (k[X] ⧸ v.asIdeal.under k[X]) * - (v.asIdeal.under k[X]).inertiaDeg' v.asIdeal := by + v.asIdeal.inertiaDeg k[X] := by let S := ringOfIntegers k K let p : Ideal k[X] := v.asIdeal.under k[X] let : v.asIdeal.IsMaximal := v.isPrime.isMaximal v.ne_bot @@ -114,14 +114,14 @@ theorem placeDegree_finite_eq_base_mul_inertiaDeg let : FiniteDimensional k (k[X] ⧸ p) := finite_of_finite_type_of_isJacobsonRing k _ let : FiniteDimensional (k[X] ⧸ p) (S ⧸ v.asIdeal) := by - have hfin := Ideal.inertiaDeg'_pos p v.asIdeal - rw [Ideal.inertiaDeg'_algebraMap] at hfin + have hfin := Ideal.inertiaDeg_pos v.asIdeal k[X] + rw [Ideal.inertiaDeg_eq_of_isMaximal p v.asIdeal] at hfin exact FiniteDimensional.of_finrank_pos hfin let : IsScalarTower k (k[X] ⧸ p) (S ⧸ v.asIdeal) := IsScalarTower.of_algebraMap_eq fun _ => rfl change Module.finrank k (S ⧸ v.asIdeal) = - Module.finrank k (k[X] ⧸ p) * p.inertiaDeg' v.asIdeal - rw [Ideal.inertiaDeg'_algebraMap] + Module.finrank k (k[X] ⧸ p) * v.asIdeal.inertiaDeg k[X] + rw [Ideal.inertiaDeg_eq_of_isMaximal p v.asIdeal] exact (Module.finrank_mul_finrank k (k[X] ⧸ p) (S ⧸ v.asIdeal)).symm /-- The relative ideal norm of a finite coordinate prime has exponent equal to its inertia @@ -130,7 +130,7 @@ hypothesis. -/ theorem relNorm_asIdeal_finite (v : IsDedekindDomain.HeightOneSpectrum (ringOfIntegers k K)) : Ideal.relNorm k[X] v.asIdeal = - (v.asIdeal.under k[X]) ^ (v.asIdeal.under k[X]).inertiaDeg' v.asIdeal := by + (v.asIdeal.under k[X]) ^ v.asIdeal.inertiaDeg k[X] := by let S := ringOfIntegers k K let : Algebra k[X] (FractionRing S) := inferInstance let : FaithfulSMul k[X] (FractionRing S) := inferInstance @@ -157,7 +157,7 @@ theorem relNorm_asIdeal_infinite (v : IsDedekindDomain.HeightOneSpectrum (infiniteIntegers k K)) : Ideal.relNorm (inftyValuationSubring k) v.asIdeal = (v.asIdeal.under (inftyValuationSubring k)) ^ - (v.asIdeal.under (inftyValuationSubring k)).inertiaDeg' v.asIdeal := by + v.asIdeal.inertiaDeg (inftyValuationSubring k) := by let A := inftyValuationSubring k let S := infiniteIntegers k K let : Algebra A (FractionRing S) := inferInstance @@ -182,7 +182,7 @@ theorem relNorm_asIdeal_infinite /-- Weighted factor degree on the finite chart is preserved by relative ideal norm. -/ theorem finite_factorDegree_eq_relNorm (I : Ideal (ringOfIntegers k K)) (hI : I ≠ ⊥) : ((UniqueFactorizationMonoid.normalizedFactors I).map fun P => - Module.finrank k (k[X] ⧸ P.under k[X]) * (P.under k[X]).inertiaDeg' P).sum = + Module.finrank k (k[X] ⧸ P.under k[X]) * P.inertiaDeg k[X]).sum = ((UniqueFactorizationMonoid.normalizedFactors (Ideal.relNorm k[X] I)).map fun p => Module.finrank k (k[X] ⧸ p)).sum := by let S := ringOfIntegers k K @@ -210,7 +210,7 @@ omit [Algebra k[X] K] [IsScalarTower k[X] k⟮X⟯ K] in theorem infinite_factorDegree_eq_relNorm (I : Ideal (infiniteIntegers k K)) (hI : I ≠ ⊥) : ((UniqueFactorizationMonoid.normalizedFactors I).map fun P => - (P.under (inftyValuationSubring k)).inertiaDeg' P).sum = + P.inertiaDeg (inftyValuationSubring k)).sum = ((UniqueFactorizationMonoid.normalizedFactors (Ideal.relNorm (inftyValuationSubring k) I)).map fun _ => 1).sum := by let A := inftyValuationSubring k @@ -393,11 +393,11 @@ theorem infinite_intNorm_div_eq_norm (x : Kˣ) (n : infiniteIntegers k K) /-- The ideal-valued weight whose restriction to finite height-one primes is `placeDegree`. -/ noncomputable def finiteIdealWeight (P : Ideal (ringOfIntegers k K)) : ℕ := - Module.finrank k (k[X] ⧸ P.under k[X]) * (P.under k[X]).inertiaDeg' P + Module.finrank k (k[X] ⧸ P.under k[X]) * P.inertiaDeg k[X] /-- The ideal-valued weight whose restriction to infinite height-one primes is `placeDegree`. -/ noncomputable def infiniteIdealWeight (P : Ideal (infiniteIntegers k K)) : ℕ := - (P.under (inftyValuationSubring k)).inertiaDeg' P + P.inertiaDeg (inftyValuationSubring k) /-- The finite-chart contribution of a principal divisor is the degree at infinity of the field norm. -/ @@ -497,12 +497,12 @@ theorem infinitePrincipalDegree_eq_neg_intDegree_norm (x : Kˣ) : have hnormdZ := congrArg (fun m : ℕ => (m : ℤ)) hnormd have hupn : ((((UniqueFactorizationMonoid.normalizedFactors (Ideal.span {n})).map - (fun P => (P.under (inftyValuationSubring k)).inertiaDeg' P)).sum : ℕ) : ℤ) = + (fun P => P.inertiaDeg (inftyValuationSubring k))).sum : ℕ) : ℤ) = -RatFunc.intDegree (qn : k⟮X⟯) := hnormnZ.trans hbaseqn have hupd : ((((UniqueFactorizationMonoid.normalizedFactors (Ideal.span {(d : S)})).map - (fun P => (P.under (inftyValuationSubring k)).inertiaDeg' P)).sum : ℕ) : ℤ) = + (fun P => P.inertiaDeg (inftyValuationSubring k))).sum : ℕ) : ℤ) = -RatFunc.intDegree (qd : k⟮X⟯) := hnormdZ.trans hbaseqd change diff --git a/LeanPool/RiemannRochFunctionFields/FundamentalIdentity.lean b/LeanPool/RiemannRochFunctionFields/FundamentalIdentity.lean index a99e06e5e8..87d411617d 100644 --- a/LeanPool/RiemannRochFunctionFields/FundamentalIdentity.lean +++ b/LeanPool/RiemannRochFunctionFields/FundamentalIdentity.lean @@ -15,7 +15,7 @@ public import Mathlib.LinearAlgebra.Dimension.Localization Mathlib's `Ideal.sum_ramification_inertia_eq_finrank` states the fundamental identity `∑ e · f = [L : K]` for the localization-based `Ideal.ramificationIdx` and `Ideal.inertiaDeg`, summed over the subtype `p.primesOver S`. The rest of this development works with the -quotient-based `Ideal.ramificationIdx'` and `Ideal.inertiaDeg'` over the finite set +quotient-based `Ideal.ramificationIdx'` over the finite set `IsDedekindDomain.primesOverFinset`, so this file transports the identity to that form and records the resulting bound `e ≤ [L : K]` for a single prime. -/ @@ -35,7 +35,7 @@ variable {R S : Type*} [CommRing R] [IsDedekindDomain R] [CommRing S] [IsDedekin /-- The fundamental identity `∑ e · f = [L : K]` for the quotient-based ramification index and inertia degree, summed over the finite set of primes above a nonzero maximal ideal `p`. -/ theorem sum_ramificationIdx'_mul_inertiaDeg' {p : Ideal R} [p.IsMaximal] (hp0 : p ≠ ⊥) : - ∑ P ∈ IsDedekindDomain.primesOverFinset p S, ramificationIdx' p P * inertiaDeg' p P = + ∑ P ∈ IsDedekindDomain.primesOverFinset p S, ramificationIdx' p P * P.inertiaDeg R = finrank K L := by classical rw [IsFractionRing.finrank_eq R K S L, ← sum_ramification_inertia_eq_finrank p S, @@ -43,7 +43,7 @@ theorem sum_ramificationIdx'_mul_inertiaDeg' {p : Ideal R} [p.IsMaximal] (hp0 : (fun P => IsDedekindDomain.mem_primesOverFinset_iff hp0 S (P := P))] refine Finset.sum_congr rfl fun q _ => ?_ have : q.1.IsMaximal := IsMaximal.of_liesOver_isMaximal q.1 p - rw [ramificationIdx'_eq_ramificationIdx p q.1 hp0, inertiaDeg'_eq_inertiaDeg p q.1] + rw [ramificationIdx'_eq_ramificationIdx p q.1 hp0] /-- The quotient-based ramification index of a prime above a nonzero maximal ideal is bounded by the degree of the extension of fraction fields. -/ @@ -53,6 +53,6 @@ theorem ramificationIdx'_le_finrank {p : Ideal R} [p.IsMaximal] (hp0 : p ≠ ⊥ have hP : P ∈ IsDedekindDomain.primesOverFinset p S := (IsDedekindDomain.mem_primesOverFinset_iff hp0 S).mpr ⟨hP₁, hP₂⟩ rw [← sum_ramificationIdx'_mul_inertiaDeg' (S := S) K L hp0, ← Finset.add_sum_erase _ _ hP] - exact le_trans (Nat.le_mul_of_pos_right _ (inertiaDeg'_pos p P)) (Nat.le_add_right _ _) + exact le_trans (Nat.le_mul_of_pos_right _ (P.inertiaDeg_pos R)) (Nat.le_add_right _ _) end Ideal diff --git a/LeanPool/RiemannRochFunctionFields/Genus/Ramification.lean b/LeanPool/RiemannRochFunctionFields/Genus/Ramification.lean index b80c737a69..3b33b385eb 100644 --- a/LeanPool/RiemannRochFunctionFields/Genus/Ramification.lean +++ b/LeanPool/RiemannRochFunctionFields/Genus/Ramification.lean @@ -290,7 +290,7 @@ theorem deg_polarDivisor_XK_eq_primesOverFinset_sum : ∑ P ∈ IsDedekindDomain.primesOverFinset (IsLocalRing.maximalIdeal (inftyValuationSubring k)) (infiniteIntegers k K), (ramIdxInfty k K P : ℤ) * - ((IsLocalRing.maximalIdeal (inftyValuationSubring k)).inertiaDeg' P : ℤ) := by + (P.inertiaDeg (inftyValuationSubring k) : ℤ) := by classical rw [deg, Finsupp.sum] let A := inftyValuationSubring k @@ -348,9 +348,7 @@ theorem deg_polarDivisor_XK_eq_primesOverFinset_sum : simp only [Finset.mem_filter, pred, inftyIdealOfPlace] at hv ⊢ rcases v with v | v · simp at hv - · have hpw : v.asIdeal.under A = p := - IsLocalRing.eq_maximalIdeal (Ideal.IsMaximal.under A v.asIdeal) - rw [polarDivisor_XK_at_infinite k K v, ramIdxInfty, placeDegree_infinite_eq_inertiaDeg, hpw] + · rw [polarDivisor_XK_at_infinite k K v, ramIdxInfty, placeDegree_infinite_eq_inertiaDeg] omit [IsFullConstantField k K] in /-- Stichtenoth 1.4.11 ramification half for the chart variable: `deg (X_K)_∞ ≤ [K : k(X)]`. -/ @@ -367,7 +365,7 @@ theorem deg_polarX_le_finrank : have hsum := Ideal.sum_ramificationIdx'_mul_inertiaDeg' (R := A) (S := S) k⟮X⟯ K hp have heq : (∑ P ∈ IsDedekindDomain.primesOverFinset p S, - (ramIdxInfty k K P : ℤ) * (p.inertiaDeg' P : ℤ)) = + (ramIdxInfty k K P : ℤ) * (P.inertiaDeg A : ℤ)) = Module.finrank k⟮X⟯ K := by dsimp [ramIdxInfty] norm_cast diff --git a/LeanPool/RiemannRochFunctionFields/Place.lean b/LeanPool/RiemannRochFunctionFields/Place.lean index aebe414fc8..2600e250db 100644 --- a/LeanPool/RiemannRochFunctionFields/Place.lean +++ b/LeanPool/RiemannRochFunctionFields/Place.lean @@ -9,6 +9,7 @@ public import LeanPool.RiemannRochFunctionFields.Divisor public import Mathlib.NumberTheory.FunctionField public import Mathlib.RingTheory.Jacobson.Ring public import Mathlib.RingTheory.LocalRing.ResidueField.Basic +public import Mathlib.RingTheory.RamificationInertia.Inertia public import Mathlib.RingTheory.Valuation.AlgebraInstances public import Mathlib.RingTheory.Valuation.Discrete.Basic public import Mathlib.RingTheory.Valuation.Discrete.RankOne @@ -488,8 +489,8 @@ instance finiteDimensionalResidueFieldInfinite rw [hp] exact inftyValuationSubring.finiteDimensionalResidueField k let : FiniteDimensional (A ⧸ p) (S ⧸ v.asIdeal) := by - have hfin := Ideal.inertiaDeg'_pos p v.asIdeal - rw [Ideal.inertiaDeg'_algebraMap] at hfin + have hfin := Ideal.inertiaDeg_pos v.asIdeal A + rw [Ideal.inertiaDeg_eq_of_isMaximal p v.asIdeal] at hfin exact FiniteDimensional.of_finrank_pos hfin let : IsScalarTower k (A ⧸ p) (S ⧸ v.asIdeal) := IsScalarTower.of_algebraMap_eq fun _ => rfl @@ -521,7 +522,7 @@ theorem principalDivisorA_apply_finite (x : Additive Kˣ) Finsupp.mapDomain Sum.inr (FractionalIdeal.principalDivisor (R := infiniteIntegers k K) (K := K) x) (Sum.inl v) = _ - rw [Finsupp.mapDomain_apply Sum.inl_injective] + rw [Finsupp.mapDomain_apply_of_injective Sum.inl_injective] rw [Finsupp.mapDomain_of_notMem_range] · simp · rintro ⟨w, h⟩ @@ -539,7 +540,7 @@ theorem principalDivisorA_apply_infinite (x : Additive Kˣ) Finsupp.mapDomain Sum.inr (FractionalIdeal.principalDivisor (R := infiniteIntegers k K) (K := K) x) (Sum.inr v) = _ - rw [Finsupp.mapDomain_apply Sum.inr_injective] + rw [Finsupp.mapDomain_apply_of_injective Sum.inr_injective] rw [Finsupp.mapDomain_of_notMem_range] · simp · rintro ⟨w, h⟩ diff --git a/LeanPool/RiemannRochFunctionFields/SeparableRelNorm.lean b/LeanPool/RiemannRochFunctionFields/SeparableRelNorm.lean index f23eb0e1dc..d829a57813 100644 --- a/LeanPool/RiemannRochFunctionFields/SeparableRelNorm.lean +++ b/LeanPool/RiemannRochFunctionFields/SeparableRelNorm.lean @@ -36,7 +36,7 @@ theorem relNorm_eq_pow_of_isMaximal_of_isSeparable [@Algebra.IsSeparable (FractionRing R) (FractionRing S) _ _ (FractionRing.liftAlgebra R (FractionRing S))] (P : Ideal S) (p : Ideal R) [P.LiesOver p] [P.IsMaximal] [p.IsMaximal] : - relNorm R P = p ^ p.inertiaDeg' P := by + relNorm R P = p ^ P.inertiaDeg R := by let K := FractionRing R let L := FractionRing S let : Algebra K L := FractionRing.liftAlgebra R L @@ -66,6 +66,9 @@ theorem relNorm_eq_pow_of_isMaximal_of_isSeparable intro x y hxy apply (algebraMap L E).injective.comp (IsFractionRing.injective S L) exact congrArg (fun z : T => (algebraMap T E) z) hxy + let : FaithfulSMul S E := (faithfulSMul_iff_algebraMap_injective S E).2 <| + (FaithfulSMul.algebraMap_injective L E).comp (IsFractionRing.injective S L) + let : IsTorsionFree S T := Subalgebra.instIsTorsionFree (integralClosure S E) let : FaithfulSMul R T := (faithfulSMul_iff_algebraMap_injective R T).2 <| by rw [IsScalarTower.algebraMap_eq R S T] exact (FaithfulSMul.algebraMap_injective S T).comp @@ -117,7 +120,6 @@ theorem relNorm_eq_pow_of_isMaximal_of_isSeparable have h := relNorm_eq_pow_of_isPrime_isGalois Q p let : IsGalois (FractionRing S) (FractionRing T) := IsGalois.tower_top_of_isGalois (FractionRing R) (FractionRing S) (FractionRing T) - rw [inertiaDeg'_eq_inertiaDeg p P] rwa [← relNorm_relNorm R S, relNorm_eq_pow_of_isPrime_isGalois Q P, map_pow, inertiaDeg_tower (R := R) P Q, pow_mul, pow_left_inj (inertiaDeg_pos Q S).ne'] at h @@ -129,13 +131,13 @@ theorem sum_normalizedFactors_relNorm_of_isSeparable (I : Ideal S) (hI : I ≠ ⊥) (w : Ideal R → ℕ) : ((normalizedFactors (relNorm R I)).map w).sum = ((normalizedFactors I).map fun P => - (P.under R).inertiaDeg' P * w (P.under R)).sum := by + P.inertiaDeg R * w (P.under R)).sum := by classical let : Algebra (FractionRing R) (FractionRing S) := FractionRing.liftAlgebra R (FractionRing S) have aux : ∀ s : Multiset (Ideal S), (∀ P ∈ s, Prime P) → ((normalizedFactors (relNorm R s.prod)).map w).sum = - (s.map fun P => (P.under R).inertiaDeg' P * w (P.under R)).sum := by + (s.map fun P => P.inertiaDeg R * w (P.under R)).sum := by intro s hs induction s using Multiset.induction_on with | empty => @@ -155,7 +157,7 @@ theorem sum_normalizedFactors_relNorm_of_isSeparable intro hp have : P.LiesOver (⊥ : Ideal R) := hp ▸ (inferInstance : P.LiesOver p) exact hP0 (Ideal.eq_bot_of_liesOver_bot R P) - have hnorm : relNorm R P = p ^ p.inertiaDeg' P := + have hnorm : relNorm R P = p ^ P.inertiaDeg R := relNorm_eq_pow_of_isMaximal_of_isSeparable P p have hnormP0 : relNorm R P ≠ ⊥ := (relNorm_eq_bot_iff.not.mpr hP0) have hnorms0 : relNorm R s.prod ≠ ⊥ := @@ -172,11 +174,11 @@ theorem sum_normalizedFactors_relNorm_of_isSeparable calc ((normalizedFactors (relNorm R I)).map w).sum = ((normalizedFactors (relNorm R s.prod)).map w).sum := by rw [hsprod] - _ = (s.map fun P => (P.under R).inertiaDeg' P * w (P.under R)).sum := by + _ = (s.map fun P => P.inertiaDeg R * w (P.under R)).sum := by apply aux s intro P hP exact UniqueFactorizationMonoid.prime_of_normalized_factor P hP _ = ((normalizedFactors I).map fun P => - (P.under R).inertiaDeg' P * w (P.under R)).sum := rfl + P.inertiaDeg R * w (P.under R)).sum := rfl end Ideal diff --git a/LeanPool/RlTheoryInLean/Data/Matrix/Mul.lean b/LeanPool/RlTheoryInLean/Data/Matrix/Mul.lean index bdf8204da7..c8c3f8b084 100644 --- a/LeanPool/RlTheoryInLean/Data/Matrix/Mul.lean +++ b/LeanPool/RlTheoryInLean/Data/Matrix/Mul.lean @@ -7,7 +7,7 @@ import Mathlib.Data.Matrix.Mul import Mathlib.Tactic.Linarith.Frontend import Mathlib.Tactic.Ring.RingNF -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic /-! # LeanPool.RlTheoryInLean.Data.Matrix.Mul diff --git a/LeanPool/RlTheoryInLean/Data/Matrix/Stochastic.lean b/LeanPool/RlTheoryInLean/Data/Matrix/Stochastic.lean index ae8c79afed..7da730c838 100644 --- a/LeanPool/RlTheoryInLean/Data/Matrix/Stochastic.lean +++ b/LeanPool/RlTheoryInLean/Data/Matrix/Stochastic.lean @@ -14,7 +14,7 @@ import Mathlib.Topology.MetricSpace.Contracting import Mathlib.Data.Matrix.Basic import Mathlib.Logic.Function.Defs import Mathlib.Data.Nat.Basic -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic import Mathlib.Topology.MetricSpace.ProperSpace import Mathlib.Topology.MetricSpace.Bounded import Mathlib.Topology.UniformSpace.Cauchy @@ -67,13 +67,17 @@ abbrev Simplex (S : Type u) [Fintype S] := {x : l1Space S | StochasticVec x.ofLp instance (x : ↑(Simplex S)) : @StochasticVec S _ x.val.ofLp := x.property instance : IsClosed (Simplex S) := by + have hofLp : Continuous fun x : l1Space S => x.ofLp := PiLp.continuous_ofLp 1 _ have hsimplex : {x : l1Space S | StochasticVec x.ofLp} = - {x : l1Space S | x.ofLp ∈ stdSimplex ℝ S} := by + (⋂ s : S, {x : l1Space S | 0 ≤ x.ofLp s}) ∩ {x : l1Space S | ∑ s, x.ofLp s = 1} := by ext x + simp only [Set.mem_ofPred_eq, Set.mem_inter_iff, Set.mem_iInter] exact ⟨fun h => ⟨h.nonneg, h.rowsum⟩, fun h => ⟨h.1, h.2⟩⟩ change IsClosed {x : l1Space S | StochasticVec x.ofLp} rw [hsimplex] - exact (isClosed_stdSimplex ℝ S).preimage (PiLp.continuous_ofLp 1 _) + refine .inter (isClosed_iInter fun s => ?_) (isClosed_eq ?_ continuous_const) + · exact isClosed_le continuous_const ((continuous_apply s).comp hofLp) + · exact continuous_finsetSum _ fun s _ => (continuous_apply s).comp hofLp instance : CompleteSpace (Simplex S) := IsClosed.completeSpace_coe diff --git a/LeanPool/RlTheoryInLean/Order/Filter/Basic.lean b/LeanPool/RlTheoryInLean/Order/Filter/Basic.lean index 9d0a834afb..9c9e858f4e 100644 --- a/LeanPool/RlTheoryInLean/Order/Filter/Basic.lean +++ b/LeanPool/RlTheoryInLean/Order/Filter/Basic.lean @@ -7,7 +7,7 @@ import Mathlib.Order.Filter.Basic import Mathlib.Data.Finset.Basic import Mathlib.Algebra.BigOperators.Group.Finset.Defs import Mathlib.Algebra.BigOperators.Group.Finset.Basic -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic /-! # LeanPool.RlTheoryInLean.Order.Filter.Basic diff --git a/LeanPool/RlTheoryInLean/Probability/MarkovChain/Trajectory.lean b/LeanPool/RlTheoryInLean/Probability/MarkovChain/Trajectory.lean index 7daff2315c..c61cb0aaba 100644 --- a/LeanPool/RlTheoryInLean/Probability/MarkovChain/Trajectory.lean +++ b/LeanPool/RlTheoryInLean/Probability/MarkovChain/Trajectory.lean @@ -76,11 +76,7 @@ noncomputable def trajProb (M : HomMarkovChainSpec S) : ProbabilityMeasure (ℕ → S) := by let κ := traj (X := fun _ : ℕ => S) (expandKernel M) 0 let f : S → (Iic 0 → S) := fun s => (fun _ : Iic 0 => s) - have hf : Measurable f := by - apply measurable_pi_iff.mpr - intro x - apply measurable_id - let init := M.init.map hf.aemeasurable + let init := M.init.map f haveI : IsProbabilityMeasure init.1 := init.2 let prob := init.1.bind κ exact ⟨prob, inferInstance⟩ diff --git a/LeanPool/RlTheoryInLean/StochasticApproximation/DiscreteGronwall.lean b/LeanPool/RlTheoryInLean/StochasticApproximation/DiscreteGronwall.lean index fe0c6f6b0b..0f4de2b968 100644 --- a/LeanPool/RlTheoryInLean/StochasticApproximation/DiscreteGronwall.lean +++ b/LeanPool/RlTheoryInLean/StochasticApproximation/DiscreteGronwall.lean @@ -49,14 +49,14 @@ private theorem prod_one_add_le_prod_one_add_of_le intro i hi simp only [mem_Ico] at hi linarith [hc i (by linarith)] - · apply Finset.one_le_prod + · apply Finset.one_le_prod₀ simp_all private theorem prod_one_add_le_exp_sum {n₀ n : ℕ} (hc : ∀ m ≥ n₀, c m ≥ 0) : ∏ i ∈ Ico n₀ n, (1 + c i) ≤ exp (∑ i ∈ Ico n₀ n, c i) := by rw [exp_sum] - apply prod_le_prod + apply prod_le_prod₀ · intro i hi simp only [mem_Ico] at hi linarith [hc i (by linarith)] diff --git a/LeanPool/SardMoreira/ContDiff.lean b/LeanPool/SardMoreira/ContDiff.lean index 48f91c07c0..383245b2e2 100644 --- a/LeanPool/SardMoreira/ContDiff.lean +++ b/LeanPool/SardMoreira/ContDiff.lean @@ -82,7 +82,8 @@ theorem length_eq_iff : c.length = n ↔ c = atomic n := by suffices ∀ i, emb i 0 = i by ext i j : 2 convert this i - rw [← funext_iff, ← StrictMono.range_inj, Surjective.range_eq, Surjective.range_eq] + rw [← funext_iff, ← StrictMono.range_inj_of_wellFoundedLT, Surjective.range_eq, + Surjective.range_eq] exacts [surjective_id, Finite.surjective_of_injective parts_strictMono.injective, parts_strictMono, strictMono_id] rfl diff --git a/LeanPool/SardMoreira/LinearAlgebra.lean b/LeanPool/SardMoreira/LinearAlgebra.lean index f90e2d9f19..1fa9eb0ab1 100644 --- a/LeanPool/SardMoreira/LinearAlgebra.lean +++ b/LeanPool/SardMoreira/LinearAlgebra.lean @@ -9,7 +9,7 @@ import Mathlib.LinearAlgebra.Dimension.LinearMap import Mathlib.LinearAlgebra.FiniteDimensional.Basic import Mathlib.LinearAlgebra.Prod import Mathlib.LinearAlgebra.Quotient.Basic -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic import Mathlib.Tactic.Common import Mathlib.Tactic.Linarith import Mathlib.Tactic.Ring diff --git a/LeanPool/SardMoreira/LocalEstimates.lean b/LeanPool/SardMoreira/LocalEstimates.lean index 8cc8e09c39..8ff5e22d40 100644 --- a/LeanPool/SardMoreira/LocalEstimates.lean +++ b/LeanPool/SardMoreira/LocalEstimates.lean @@ -21,7 +21,7 @@ open Asymptotics Filter MeasureTheory AffineMap Set Metric theorem UniformSpace.Completion.hasFDerivAt_coe {𝕜 E : Type*} [NontriviallyNormedField 𝕜] [NormedAddCommGroup E] [NormedSpace 𝕜 E] {a : E} : HasFDerivAt ((↑) : E → Completion E) (toComplL : E →L[𝕜] Completion E) a := by - simpa using (toComplL (𝕜 := 𝕜) (E := E)).hasFDerivAt + simpa using (toComplL (S := 𝕜) (α := E)).hasFDerivAt section NormedField diff --git a/LeanPool/SardMoreira/MainTheorem.lean b/LeanPool/SardMoreira/MainTheorem.lean index 92dd653bc8..6da98ab2f8 100644 --- a/LeanPool/SardMoreira/MainTheorem.lean +++ b/LeanPool/SardMoreira/MainTheorem.lean @@ -674,7 +674,7 @@ theorem hausdorffMeasure_image_nhdsWithin_null_of_finrank_eq · exact Filter.image_mem_map self_mem_nhdsWithin · have := hausdorffMeasure_image_piProd_fst_null_of_finrank_eq hgt hk hgdim rw [hdimKer, hdimRange, Nat.add_sub_cancel' hp_dom.le] at this - convert (eCod.symm.lipschitz.hausdorffMeasure_image_null (by positivity) this) using 2 + convert (eCod.symm.lipschitzWith.hausdorffMeasure_image_null (by positivity) this) using 2 rw [Set.image_image, Set.image_image] apply Set.EqOn.image_eq intro x hx diff --git a/LeanPool/SardMoreira/ToMathlib/PR32186.lean b/LeanPool/SardMoreira/ToMathlib/PR32186.lean index b03cdf4f29..05b9bda111 100644 --- a/LeanPool/SardMoreira/ToMathlib/PR32186.lean +++ b/LeanPool/SardMoreira/ToMathlib/PR32186.lean @@ -33,8 +33,8 @@ lemma dist_le_integral_of_norm_deriv_le_of_le {f : ℝ → E} {B : ℝ → ℝ} have hdg : ∀ t ∈ Ioo a b, deriv g t = deriv f t := by intro t ht have : HasFDerivAt (𝕜 := ℝ) (↑) UniformSpace.Completion.toComplL (f t) := by - rw [← UniformSpace.Completion.coe_toComplL (𝕜 := ℝ)] - exact (UniformSpace.Completion.toComplL (E := E) (𝕜 := ℝ)).hasFDerivAt + rw [← UniformSpace.Completion.coe_toComplL (S := ℝ)] + exact (UniformSpace.Completion.toComplL (α := E) (S := ℝ)).hasFDerivAt have hdft : HasDerivAt f (deriv f t) t := hfd.hasDerivAt <| Ioo_mem_nhds ht.1 ht.2 rw [hg, (this.comp_hasDerivAt t hdft).deriv, UniformSpace.Completion.coe_toComplL] have hgn : ∀ᵐ t, t ∈ Ioo a b → ‖deriv g t‖ ≤ B t := diff --git a/LeanPool/SardMoreira/ToMathlib/PR32986.lean b/LeanPool/SardMoreira/ToMathlib/PR32986.lean index 39aaac9354..ae10daf547 100644 --- a/LeanPool/SardMoreira/ToMathlib/PR32986.lean +++ b/LeanPool/SardMoreira/ToMathlib/PR32986.lean @@ -25,7 +25,7 @@ open MeasureTheory Measure Metric instance IsLocallyFiniteMeasure.prod {X Y : Type*} [TopologicalSpace X] [TopologicalSpace Y] [MeasurableSpace X] [MeasurableSpace Y] (μ : Measure X) (ν : Measure Y) - [IsLocallyFiniteMeasure μ] [IsLocallyFiniteMeasure ν] : + [IsLocallyFiniteMeasure μ] [IsLocallyFiniteMeasure ν] [SFinite ν] : IsLocallyFiniteMeasure (μ.prod ν) where finiteAtNhds := by rintro ⟨x, y⟩ diff --git a/LeanPool/SardMoreira/ToMathlib/PR32993.lean b/LeanPool/SardMoreira/ToMathlib/PR32993.lean index 5cd1dae785..c7dd67a76d 100644 --- a/LeanPool/SardMoreira/ToMathlib/PR32993.lean +++ b/LeanPool/SardMoreira/ToMathlib/PR32993.lean @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Yury G. Kudryashov -/ -import Mathlib.Data.ENNReal.Basic +import Mathlib.Basic.ENNReal.Basic /-! # LeanPool.SardMoreira.ToMathlib.PR32993 diff --git a/LeanPool/SardMoreira/Unused.lean b/LeanPool/SardMoreira/Unused.lean index df087b3586..cf95875a9b 100644 --- a/LeanPool/SardMoreira/Unused.lean +++ b/LeanPool/SardMoreira/Unused.lean @@ -61,8 +61,11 @@ namespace Submodule variable {R M N : Type*} [Semiring R] [AddCommMonoid M] [Module R M] [AddCommMonoid N] [Module R N] -/-- Linear equivalence between a product submodule and the product of submodules. -/ -def prodEquiv +/-- Linear equivalence between a product submodule and the product of submodules. + +This duplicates `Submodule.prodEquiv`, which Mathlib has since acquired; it is kept under a +primed name to avoid the clash. -/ +def prodEquiv' (s : Submodule R M) (t : Submodule R N) : s.prod t ≃ₗ[R] s × t := { (Equiv.Set.prod (s : Set M) (t : Set N)) with map_add' _ _ := rfl @@ -72,13 +75,13 @@ def prodEquiv theorem rank_prod_eq_lift [StrongRankCondition R] (s : Submodule R M) (t : Submodule R N) [Module.Free R s] [Module.Free R t] : Module.rank R (s.prod t) = (Module.rank R s).lift + (Module.rank R t).lift := by - simp [(s.prodEquiv t).rank_eq] + simp [(s.prodEquiv' t).rank_eq] @[simp] theorem finrank_prod [StrongRankCondition R] (s : Submodule R M) (t : Submodule R N) [Module.Free R s] [Module.Free R t] [Module.Finite R s] [Module.Finite R t] : Module.finrank R (s.prod t) = Module.finrank R s + Module.finrank R t := by - simp [(s.prodEquiv t).finrank_eq] + simp [(s.prodEquiv' t).finrank_eq] end Submodule @@ -126,7 +129,7 @@ theorem iteratedFDerivWithin_comp_of_eventually refine .symm <| (hgu.comp hfu (mapsTo_image _ _)).eq_iteratedFDerivWithin_of_uniqueDiffOn le_rfl hu (mem_of_mem_nhdsWithin ha hau) |>.trans ?_ refine iteratedFDerivWithin_congr_set (hus.eventuallyLE.antisymm ?_) _ - exact set_eventuallyLE_iff_mem_inf_principal.mpr hau + exact eventuallySubset_iff_mem_inf_principal.mpr hau end ContDiff @@ -169,7 +172,8 @@ theorem length_eq_one_iff (hn : n ≠ 0) : c.length = 1 ↔ c = single n hn := b rw [funext_iff, Fin.forall_fin_one] simpa using hsum obtain rfl : emb = fun _ ↦ id := by - rw [funext_iff, Fin.forall_fin_one, ← (emb_strictMono 0).range_inj strictMono_id] + rw [funext_iff, Fin.forall_fin_one, + ← (emb_strictMono 0).range_inj_of_wellFoundedLT strictMono_id] simpa [eq_univ_iff_forall, Fin.exists_fin_one] using cover rfl diff --git a/LeanPool/SelbergSieve4/ForArithmeticFunction.lean b/LeanPool/SelbergSieve4/ForArithmeticFunction.lean index ee46201a31..15a04cffc7 100644 --- a/LeanPool/SelbergSieve4/ForArithmeticFunction.lean +++ b/LeanPool/SelbergSieve4/ForArithmeticFunction.lean @@ -3,12 +3,12 @@ Copyright (c) 2026 Arend Mellendijk. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Arend Mellendijk -/ +import Mathlib.Basic.Real.Basic import Mathlib.NumberTheory.ArithmeticFunction.Defs import Mathlib.NumberTheory.ArithmeticFunction.Misc import Mathlib.NumberTheory.ArithmeticFunction.Moebius import Mathlib.NumberTheory.ArithmeticFunction.VonMangoldt import Mathlib.NumberTheory.ArithmeticFunction.Zeta -import Mathlib.Data.Real.Basic import LeanPool.SelbergSieve4.Tactic.Multiplicativity /-! diff --git a/LeanPool/SelbergSieve4/ForMathlib/Basic.lean b/LeanPool/SelbergSieve4/ForMathlib/Basic.lean index ef1277ae69..66e0f9e037 100644 --- a/LeanPool/SelbergSieve4/ForMathlib/Basic.lean +++ b/LeanPool/SelbergSieve4/ForMathlib/Basic.lean @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Arend Mellendijk -/ import Mathlib.Algebra.BigOperators.Finprod -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic import Mathlib.Data.Nat.Prime.Basic import Mathlib.Data.Nat.Squarefree import Mathlib.NumberTheory.ArithmeticFunction.Defs diff --git a/LeanPool/SelbergSieve4/Selberg.lean b/LeanPool/SelbergSieve4/Selberg.lean index 794bbc4aee..28e6fd17e4 100644 --- a/LeanPool/SelbergSieve4/Selberg.lean +++ b/LeanPool/SelbergSieve4/Selberg.lean @@ -421,7 +421,7 @@ theorem selberg_bound_muPlus (n : ℕ) (hn : n ∈ divisors P) : simp only [f] by_cases h : n = d1.lcm d2 · rw [ite_eq_left h, ite_eq_left h] - apply mul_le_one₀ (s.selberg_bound_weights d1) (abs_nonneg <| γ d2) + exact (mul_le_of_le_one_left (abs_nonneg <| γ d2) (s.selberg_bound_weights d1)).trans (s.selberg_bound_weights d2) · rw [ite_eq_right h, ite_eq_right h] · rw [← Finset.sum_product'] diff --git a/LeanPool/SelbergSieve4/SieveLemmas.lean b/LeanPool/SelbergSieve4/SieveLemmas.lean index 178bfda91b..4d798d6f00 100644 --- a/LeanPool/SelbergSieve4/SieveLemmas.lean +++ b/LeanPool/SelbergSieve4/SieveLemmas.lean @@ -157,7 +157,7 @@ theorem nu_lt_self_of_dvd_prodPrimes : ∀ d : ℕ, d ∣ P → d ≠ 1 → ν d eq_comm.mp (prod_factors_of_mult ν s.nu_mult hd_sq) _ < ∏ p ∈ d.primeFactors, 1 := by have hd_ne_zero : d ≠ 0 := by aesopDiv - apply prod_lt_prod_of_nonempty + apply prod_lt_prod_of_nonempty₀ · intro p hp simp only [mem_primeFactors] at hp apply s.nu_pos_of_prime p (by aesop) (by aesopDiv) diff --git a/LeanPool/SelbergSieve4/UpperBoundSieve.lean b/LeanPool/SelbergSieve4/UpperBoundSieve.lean index e58f48b54f..0c933fdf8a 100644 --- a/LeanPool/SelbergSieve4/UpperBoundSieve.lean +++ b/LeanPool/SelbergSieve4/UpperBoundSieve.lean @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Arend Mellendijk -/ import Mathlib.Algebra.BigOperators.Group.Finset.Basic -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic import Mathlib.NumberTheory.ArithmeticFunction.Defs import Mathlib.NumberTheory.ArithmeticFunction.Misc import Mathlib.NumberTheory.ArithmeticFunction.Moebius diff --git a/LeanPool/SetTheory/KunenInconsistency.lean b/LeanPool/SetTheory/KunenInconsistency.lean index 202d89fff4..b5de44e799 100644 --- a/LeanPool/SetTheory/KunenInconsistency.lean +++ b/LeanPool/SetTheory/KunenInconsistency.lean @@ -155,7 +155,8 @@ def s (α : ν.ToType) : ℕ → κω := by have s' (β : Set.Iio α) : ℕ → κω := s β.1 suffices {x : ℕ → κω | (∀ n, ↑(x n) ∈ X α) ∧ ∀ β, s' β ≠ x}.Nonempty from this.some convert_to ({x : ℕ → κω | ∀ n, ↑(x n) ∈ X α} \ Set.range s').Nonempty using 1 - · ext x; simp + · ext x + simp only [Set.mem_ofPred_eq, Set.mem_sdiff, Set.mem_range, not_exists, ne_eq] · apply sdiff_nonempty_of_mk_lt_mk refine lt_of_le_of_lt mk_range_le ?_ refine lt_of_lt_of_le (mk_Iio_ToType_lt _) ?_ @@ -178,14 +179,14 @@ lemma injective_s : Injective s := by · exact eq · exact this s_eq.symm (lt_of_le_of_ne (not_lt.mp lt) eq.symm) |>.symm · nth_rw 2 [s] at s_eq - generalize_proofs hβ at s_eq + generalize_proofs _ hβ at s_eq dsimp only at hβ exact (hβ.some_mem.2 ⟨_, lt⟩ s_eq).elim lemma s_mem_X : ∀ α n, (s α n).1 ∈ X α := by intro α n simp only [s] - generalize_proofs hα + generalize_proofs _ hα exact hα.some_mem.1 n /-- The `f` declaration. -/ @@ -220,7 +221,7 @@ lemma exists_γ_and_X_eq {β H : M} (hβ : β ∈ κω) (hH : H ⊆ κω) (card_ lemma f_s_eq_γ {α : ν.ToType} : ↑(f (s α)) = γ α := by rw [f, s] - generalize_proofs hne_ν hne_s γ_mem + generalize_proofs hne_ν _ hne_s γ_mem dsimp only congr 1 suffices s α = hne_s.some by diff --git a/LeanPool/SetTheory/Omega.lean b/LeanPool/SetTheory/Omega.lean index c4b155e64d..5ad79befb6 100644 --- a/LeanPool/SetTheory/Omega.lean +++ b/LeanPool/SetTheory/Omega.lean @@ -46,9 +46,9 @@ namespace SetTheory simpa using fun hz _ => hz @[toZFSet_simps] lemma IsWellFoundedRevMem.toZFSet (x : M) : - IsWellFoundedRevMem x ↔ IsWellFounded ⇓x fun a b => b ∈ a := by + IsWellFoundedRevMem x ↔ WellFounded fun a b : ⇓x => b ∈ a := by rw [← IsWellFoundedRevMem.toV] - simp only [IsWellFoundedRevMem, isWellFounded_iff, WellFounded.wellFounded_iff_has_min, + simp only [IsWellFoundedRevMem, WellFounded.wellFounded_iff_has_min, powerset.spec, toZFSet_simps, Subtype.forall, Subtype.exists, Set.mem_ofPred_eq, mem_inside_ZFSet, exists_and_left, exists_prop] conv => @@ -94,14 +94,13 @@ lemma eq_natCast_of_mem_ωₛ {α} (hα : α ∈ ωₛ) : ∃ n : ℕ, α = Ordi obtain ⟨α, ⟨_⟩⟩ := isOrdinal_iff_mem_range_toZFSet.mp ord_α simpa [ωₛ, toZFSet_mem_toZFSet_iff, lt_omega0, toZFSet_strictMono.injective.eq_iff] using hα -lemma nwf_rev_of_ωₛ_le {α} (hα : ωₛ ≤ α) : ¬IsWellFounded α (fun x y => y ∈ x) := by - intro ⟨h⟩ +lemma nwf_rev_of_ωₛ_le {α} (hα : ωₛ ≤ α) : ¬WellFounded (fun x y : α => y ∈ x) := by + intro h rw [wellFounded_iff_isEmpty_descending_chain] at h refine h.false ⟨fun n => ⟨Ordinal.toZFSet n, hα toZFSet_nat_mem_ωₛ⟩, ?_⟩ simpa only [mem_inside_ZFSet] using fun n => toZFSet_mem_toZFSet_iff.mpr (by simp) -lemma wf_rev_of_lt_ωₛ {α} (hα : α ∈ ωₛ) : IsWellFounded α (fun x y => y ∈ x) := by - rw [isWellFounded_iff] +lemma wf_rev_of_lt_ωₛ {α} (hα : α ∈ ωₛ) : WellFounded (fun x y : α => y ∈ x) := by refine @Finite.wellFounded_of_trans_of_irrefl _ ?_ _ ?_ ?_ · obtain ⟨n, ⟨_⟩⟩ := eq_natCast_of_mem_ωₛ hα erw [← mk_lt_aleph0_iff, cardinalMk_coe_sort] diff --git a/LeanPool/SetTheory/Ordinals.lean b/LeanPool/SetTheory/Ordinals.lean index 1339d86f7b..f9e1c131b0 100644 --- a/LeanPool/SetTheory/Ordinals.lean +++ b/LeanPool/SetTheory/Ordinals.lean @@ -192,15 +192,15 @@ instance : LinearOrder (Ordinals M) where have := hx.mem_trichotomous hy tauto -instance : WellFoundedLT (Ordinals M) where - wf := by - have : (· < · : Ordinals M → _ → _) = ((· ∈ ·) on (⇓·.1)) := by - ext x y - rw [onFun, ← ToZFSet.mem, x.2.mem_iff_lt y.2, Subtype.coe_lt_coe] - rw [this] - refine RelEmbedding.wellFounded ⟨⟨(⇓·.1), ?_⟩, ?_⟩ ZFSet.mem_wf - · simp [Injective, toZFSet_simps] - · rfl +instance : WellFoundedLT (Ordinals M) := by + change WellFounded (· < · : Ordinals M → _ → _) + have : (· < · : Ordinals M → _ → _) = ((· ∈ ·) on (⇓·.1)) := by + ext x y + rw [onFun, ← ToZFSet.mem, x.2.mem_iff_lt y.2, Subtype.coe_lt_coe] + rw [this] + refine RelEmbedding.wellFounded ⟨⟨(⇓·.1), ?_⟩, ?_⟩ ZFSet.mem_wf + · simp [Injective, toZFSet_simps] + · rfl instance : OrderBot (Ordinals M) where bot := ⟨∅, isOrdinal_empty⟩ diff --git a/LeanPool/SpectralPositivity/Matrix/NonnegPower.lean b/LeanPool/SpectralPositivity/Matrix/NonnegPower.lean index ddfed61b94..e7c302ea89 100644 --- a/LeanPool/SpectralPositivity/Matrix/NonnegPower.lean +++ b/LeanPool/SpectralPositivity/Matrix/NonnegPower.lean @@ -5,7 +5,7 @@ Authors: Michael R. Douglas -/ import Mathlib.LinearAlgebra.Matrix.NonsingularInverse -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic /-! # Nonneg Matrix Powers and Positivity diff --git a/LeanPool/SpectralPositivity/Matrix/PerronFrobenius.lean b/LeanPool/SpectralPositivity/Matrix/PerronFrobenius.lean index 42b7852ddb..2a0671442b 100644 --- a/LeanPool/SpectralPositivity/Matrix/PerronFrobenius.lean +++ b/LeanPool/SpectralPositivity/Matrix/PerronFrobenius.lean @@ -311,13 +311,17 @@ theorem allpos_has_pos_eigenvec (hn : Nonempty n) have h2 : IsClosed { v : n → ℝ | ∑ i, v i = 1 } := isClosed_eq (continuous_finsetSum _ fun i _ => continuous_apply i) continuous_const exact h1.inter h2 - -- S ⊆ stdSimplex - have hS_sub : S ⊆ stdSimplex ℝ n := by + -- S is contained in the cube [ε, 1]^n: each entry is bounded above by the total sum 1 + have hS_sub : S ⊆ Set.Icc (fun _ => ε) (fun _ => 1 : n → ℝ) := by intro v ⟨hv_lb, hv_sum⟩ - exact ⟨fun i => le_trans (le_of_lt hε_pos) (hv_lb i), hv_sum⟩ + refine ⟨hv_lb, fun i => ?_⟩ + calc v i ≤ ∑ j, v j := + Finset.single_le_sum + (fun j _ => le_trans (le_of_lt hε_pos) (hv_lb j)) (Finset.mem_univ i) + _ = 1 := hv_sum -- S is compact have hS_compact : IsCompact S := - (isCompact_stdSimplex ℝ n).of_isClosed_subset hS_closed hS_sub + isCompact_Icc.of_isClosed_subset hS_closed hS_sub -- Step 2: ψ(v) = Bv / ‖Bv‖₁ maps the standard simplex into S -- For v ∈ stdSimplex: v ≥ 0, ∑v = 1, v ≠ 0 -- (Bv)_i ≥ c·∑v = c > 0, so ‖Bv‖₁ > 0 and ψ(v)_i = (Bv)_i/‖Bv‖₁ diff --git a/LeanPool/SpectralPositivity/Operator/JentzschProof.lean b/LeanPool/SpectralPositivity/Operator/JentzschProof.lean index becf4e89ab..ea792290fd 100644 --- a/LeanPool/SpectralPositivity/Operator/JentzschProof.lean +++ b/LeanPool/SpectralPositivity/Operator/JentzschProof.lean @@ -264,7 +264,7 @@ theorem abs_eigenvector_of_top_eigenvector {Ω : Type*} [MeasureSpace Ω] calc @inner ℝ _ _ y (T y) ≤ lam₀ * ‖y‖ ^ 2 := hlam₀_top y _ = lam₀ * ‖h‖ ^ 2 := by rw [hy] -- Step 5: Apply eq_smul_self_of_isLocalExtrOn - have h_eig := hT_sa.eq_smul_self_of_isLocalExtrOn (Or.inr h_max.localize) + have h_eig := hT_sa.eq_smul_self_of_isLocalExtrOn (Or.inr h_max.isLocalMaxOn) -- h_eig : T h = T.rayleighQuotient h • h -- Step 6: Compute rayleighQuotient h = lam₀ have h_rq : T.rayleighQuotient h = lam₀ := by @@ -587,7 +587,7 @@ theorem spectral_gap {Ω : Type*} [MeasureSpace Ω] [(ae (volume : Measure Ω)). calc @inner ℝ _ _ y (T y) ≤ lam₀ * ‖y‖ ^ 2 := hlam₀_top y _ = lam₀ * ‖(|g| : Lp ℝ 2 _)‖ ^ 2 := by rw [hy] have h_abs_eig := hT_sa.eq_smul_self_of_isLocalExtrOn - (Or.inr h_abs_max.localize) + (Or.inr h_abs_max.isLocalMaxOn) have h_rq : T.rayleighQuotient (|g| : Lp ℝ 2 _) = lam₀ := by unfold ContinuousLinearMap.rayleighQuotient simp only [ContinuousLinearMap.reApplyInnerSelf_apply] @@ -844,8 +844,7 @@ theorem exists_pos_eigenvalue {Ω : Type*} [MeasureSpace Ω] -- |bj| = 0 in Lp: f =ᵐ 0 → eLpNorm = 0 → ‖f‖ = 0 → f = 0 have h_snorm : MeasureTheory.eLpNorm ((|b j| : Lp ℝ 2 (volume : Measure (Ω))).1) 2 volume = 0 := by - rw [(eLpNorm_eq_zero_iff (Lp.aestronglyMeasurable _) - (by norm_num : (2 : ENNReal) ≠ 0)).mpr h_abs_ae] + rw [(eLpNorm_eq_zero_iff (by norm_num : (2 : ENNReal) ≠ 0)).mpr h_abs_ae] have h_norm_zero : ‖(|b j| : Lp ℝ 2 (volume : Measure (Ω)))‖ = 0 := by simp [Lp.norm_def, h_snorm] exact habs_ne ((Lp.norm_eq_zero_iff diff --git a/LeanPool/SpherePacking/Foundations.lean b/LeanPool/SpherePacking/Foundations.lean index 80214246b1..4735edafa4 100644 --- a/LeanPool/SpherePacking/Foundations.lean +++ b/LeanPool/SpherePacking/Foundations.lean @@ -5077,7 +5077,7 @@ private theorem complexGamma_vertical_polynomial_bound {z : ℂ} |z.im| ^ k ≤ ∏ j ∈ Finset.range k, ‖z + (j : ℂ)‖ := by simpa only [Finset.prod_const, Finset.card_range] using! - (Finset.prod_le_prod + (Finset.prod_le_prod₀ (s := Finset.range k) (f := fun _ : ℕ => |z.im|) (g := fun j : ℕ => ‖z + (j : ℂ)‖) @@ -5117,7 +5117,7 @@ private theorem complexGamma_shifted_vertical_polynomial_bound |z.im| ^ k ≤ ∏ j ∈ Finset.range k, ‖z + (j : ℂ)‖ := by simpa only [Finset.prod_const, Finset.card_range] using! - (Finset.prod_le_prod + (Finset.prod_le_prod₀ (s := Finset.range k) (f := fun _ : ℕ => |z.im|) (g := fun j : ℕ => ‖z + (j : ℂ)‖) @@ -6964,8 +6964,8 @@ private theorem saddleGaussianPoleRepresentative_weighted_horizontalStrip_bound _ ≤ (r ^ (-a) * Real.exp ((a + ((2 * n : ℕ) : ℝ)) ^ 2)) * 1 := by apply mul_le_mul_of_nonneg_left - (mul_le_one₀ hexp - (div_nonneg (abs_nonneg t) (norm_nonneg _)) hfrac) + ((mul_le_of_le_one_left + (div_nonneg (abs_nonneg t) (norm_nonneg _)) hexp).trans hfrac) positivity _ = r ^ (-a) * Real.exp ((a + ((2 * n : ℕ) : ℝ)) ^ 2) := diff --git a/LeanPool/SpherePacking/HarmonicAnalysis.lean b/LeanPool/SpherePacking/HarmonicAnalysis.lean index 6712f90b97..f62b27f847 100644 --- a/LeanPool/SpherePacking/HarmonicAnalysis.lean +++ b/LeanPool/SpherePacking/HarmonicAnalysis.lean @@ -7,6 +7,7 @@ Authors: OpenAI, Sidharth Hariharan, Gareth Ma, Dean Cureton module import all LeanPool.SpherePacking.SaddleAnalysis +public import Mathlib.Analysis.SpecialFunctions.Gamma.Digamma public import Mathlib.Analysis.SpecialFunctions.Pow.Real /-! @@ -1481,7 +1482,7 @@ private noncomputable def saddleGaussianTailSet (R : ℝ) : Set ℝ := private theorem saddleGaussianTailSet_measurable (R : ℝ) : MeasurableSet (saddleGaussianTailSet R) := by unfold saddleGaussianTailSet - exact measurableSet_le measurable_const measurable_abs + exact measurableSet_le measurable_const _root_.continuous_abs.measurable private theorem saddleGaussian_cubic_tail_integral_le {k R : ℝ} (hk : 6 ≤ k) (hR : 0 ≤ R) : diff --git a/LeanPool/SpherePacking/MellinAnalysis.lean b/LeanPool/SpherePacking/MellinAnalysis.lean index e070c864be..694eb7090c 100644 --- a/LeanPool/SpherePacking/MellinAnalysis.lean +++ b/LeanPool/SpherePacking/MellinAnalysis.lean @@ -2885,7 +2885,7 @@ private noncomputable def radialSchwartzProfile {d : ℕ} (hd : 0 < d) (f : TestFunction d) : 𝓢(ℝ, ℂ) := SchwartzMap.compCLMOfAntilipschitz ℂ (radialLineIsometry hd).toContinuousLinearMap.hasTemperateGrowth - (radialLineIsometry hd).isometry.antilipschitz f + (radialLineIsometry hd).isometry.antilipschitzWith f @[simp] private theorem radialSchwartzProfile_apply {d : ℕ} (hd : 0 < d) (f : TestFunction d) (r : ℝ) : diff --git a/LeanPool/SpherePacking/PackingBound.lean b/LeanPool/SpherePacking/PackingBound.lean index c7119cfa96..982d643c6b 100644 --- a/LeanPool/SpherePacking/PackingBound.lean +++ b/LeanPool/SpherePacking/PackingBound.lean @@ -530,7 +530,7 @@ private protected theorem tsum_le_reindex_surjection {φ : α → β} (hφ : Sur ∑' y, g y ≤ ∑' x, g (φ x) := calc ∑' y, g y = ∑' y, g (φ (surjInv hφ y)) := by simp only [surjInv_eq hφ] _ ≤ ∑' x, g (φ x) := - ENat.tsum_reindex_injective_le (injective_surjInv hφ) _ + ENat.tsum_reindex_injective_le (injective_surjInv hφ) (fun x => g (φ x)) private protected theorem tsum_reindex_bijection {φ : α → β} (hφ : φ.Bijective) (g : β → ℕ∞) : ∑' x, g (φ x) = ∑' y, g y := @@ -3206,7 +3206,7 @@ private lemma finite_reference_lattice_points_of_norm_bound (r : ℝ) : have hfinE : Set.Finite (Metric.closedBall (0 : (EuclideanSpace ℝ (Fin d))) r ∩ (((SchwartzMap.referenceIntegerLattice d)).toAddSubgroup : Set (EuclideanSpace ℝ (Fin d)))) := Metric.finite_isBounded_inter_isClosed DiscreteTopology.isDiscrete - Metric.isBounded_closedBall AddSubgroup.isClosed_of_discrete + Metric.isBounded_closedBall AddSubgroup.isClosed_of_discreteTopology let e : (SchwartzMap.referenceIntegerLattice d) ↪ (EuclideanSpace ℝ (Fin d)) := ⟨fun ℓ => (ℓ : (EuclideanSpace ℝ (Fin d))), Subtype.coe_injective⟩ have hfin_pre : (e ⁻¹' (Metric.closedBall (0 : (EuclideanSpace ℝ (Fin d))) r ∩ @@ -4446,7 +4446,7 @@ private lemma summable_norm_on_translated_integral_lattice (f : 𝓢(EuclideanSp (Metric.closedBall (0 : EuclideanSpace ℝ (Fin d)) R ∩ (Λ.toAddSubgroup : Set (EuclideanSpace ℝ (Fin d)))).Finite := Metric.finite_isBounded_inter_isClosed DiscreteTopology.isDiscrete - Metric.isBounded_closedBall AddSubgroup.isClosed_of_discrete + Metric.isBounded_closedBall AddSubgroup.isClosed_of_discreteTopology let e : Λ ↪ EuclideanSpace ℝ (Fin d) := ⟨fun ℓ => (ℓ : EuclideanSpace ℝ (Fin d)), Subtype.coe_injective⟩ have hpreimage : diff --git a/LeanPool/SpherePacking/SaddleAnalysis.lean b/LeanPool/SpherePacking/SaddleAnalysis.lean index 0ae9701ba5..7cee39c57b 100644 --- a/LeanPool/SpherePacking/SaddleAnalysis.lean +++ b/LeanPool/SpherePacking/SaddleAnalysis.lean @@ -7,7 +7,7 @@ Authors: OpenAI, Sidharth Hariharan, Gareth Ma, Dean Cureton module import all LeanPool.SpherePacking.GammaAnalysis -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.Order.Filter.AtTopBot.Defs import Mathlib.Analysis.SpecialFunctions.SmoothTransition diff --git a/LeanPool/Sundogcert/VarWheel.lean b/LeanPool/Sundogcert/VarWheel.lean index 783a281178..d4e7afbf1e 100644 --- a/LeanPool/Sundogcert/VarWheel.lean +++ b/LeanPool/Sundogcert/VarWheel.lean @@ -8,7 +8,7 @@ import Mathlib.Data.Fintype.Pi import Mathlib.Data.Fin.Basic import Mathlib.Data.Fin.VecNotation import Mathlib.Algebra.Group.Fin.Basic -import Mathlib.Logic.Basic +import Mathlib.Basic.Logic.Basic /-! Sundogcert/VarWheel.lean — MILESTONE 2 of the `3SAT ≤ 3DM` marathon. diff --git a/LeanPool/Vlasov/Basic.lean b/LeanPool/Vlasov/Basic.lean index 19cb268f89..49339b3f49 100644 --- a/LeanPool/Vlasov/Basic.lean +++ b/LeanPool/Vlasov/Basic.lean @@ -15,7 +15,8 @@ import Mathlib.Analysis.ODE.Gronwall import Mathlib.MeasureTheory.Function.L2Space import Mathlib.MeasureTheory.Integral.IntervalIntegral.Basic import Mathlib.MeasureTheory.Integral.IntervalIntegral.FundThmCalculus -import Mathlib.MeasureTheory.Measure.Dirac +import Mathlib.MeasureTheory.Measure.Dirac.Basic +import Mathlib.MeasureTheory.Measure.Dirac.Def import Mathlib.MeasureTheory.Measure.ProbabilityMeasure import Mathlib.MeasureTheory.Measure.Prokhorov import Mathlib.MeasureTheory.Measure.Tight diff --git a/LeanPool/Vlasov/OT/CharacteristicFlow.lean b/LeanPool/Vlasov/OT/CharacteristicFlow.lean index aa276601a3..e65596b193 100644 --- a/LeanPool/Vlasov/OT/CharacteristicFlow.lean +++ b/LeanPool/Vlasov/OT/CharacteristicFlow.lean @@ -4752,7 +4752,7 @@ theorem Phi_isProbabilityMeasure {d : ℕ} (t : ℝ) : IsProbabilityMeasure (Phi charX f₀ t) := by unfold Phi - exact MeasureTheory.Measure.isProbabilityMeasure_map (h_meas t) + exact (MeasureTheory.Measure.isProbabilityMeasure_map_iff (h_meas t)).mpr inferInstance /-- Uniform first-moment bound on `Phi charX f₀` under a per-z position growth hypothesis `‖charX t z‖ ≤ C_T · (‖z‖ + 1)`. @@ -6400,9 +6400,9 @@ theorem Phi_supW1_contraction {d : ℕ} ENNReal.ofReal C_T := by intro t ht have hΦρ_t : IsProbabilityMeasure (Measure.map (fun z => charX_ρ t z) f₀) := - MeasureTheory.Measure.isProbabilityMeasure_map (h_meas_ρ t ht) + (MeasureTheory.Measure.isProbabilityMeasure_map_iff (h_meas_ρ t ht)).mpr inferInstance have hΦσ_t : IsProbabilityMeasure (Measure.map (fun z => charX_σ t z) f₀) := - MeasureTheory.Measure.isProbabilityMeasure_map (h_meas_σ t ht) + (MeasureTheory.Measure.isProbabilityMeasure_map_iff (h_meas_σ t ht)).mpr inferInstance -- W₁ is finite (probability + finite first moment). have h_W1_t_ne_top : wasserstein1 (Measure.map (fun z => charX_ρ t z) f₀) diff --git a/LeanPool/Vlasov/OT/Coupling.lean b/LeanPool/Vlasov/OT/Coupling.lean index 31b05097ab..f88e205279 100644 --- a/LeanPool/Vlasov/OT/Coupling.lean +++ b/LeanPool/Vlasov/OT/Coupling.lean @@ -941,7 +941,7 @@ def transportProperCone (Cost : m → n → ℝ) : rw [Finset.mul_sum] · change (c : ℝ) * ((∑ i, ∑ j, Cost i j * P i j) + s) = (∑ i, ∑ j, Cost i j * ((c : ℝ) * P i j)) + (c : ℝ) * s - simp_rw [mul_add, Finset.mul_sum]; ring } + simp_rw [mul_add, Finset.mul_sum]; ring_nf } isClosed' := isClosed_transport_cone Cost /-- **Per-ε Farkas separation.** Given the optimal plan `P` (primal value `V = ⟨Cost,P⟩`), @@ -1158,9 +1158,9 @@ theorem finiteRange_transportation_dual have ha_nn : ∀ i, 0 ≤ a i := fun _ => ENNReal.toReal_nonneg have hb_nn : ∀ j, 0 ≤ b j := fun _ => ENNReal.toReal_nonneg have hμP : IsProbabilityMeasure (Measure.map T μ) := - Measure.isProbabilityMeasure_map hT.aemeasurable + (Measure.isProbabilityMeasure_map_iff hT.aemeasurable).mpr inferInstance have hνP : IsProbabilityMeasure (Measure.map S ν) := - Measure.isProbabilityMeasure_map hS.aemeasurable + (Measure.isProbabilityMeasure_map_iff hS.aemeasurable).mpr inferInstance -- atom decompositions of the finite-range pushforwards have hμmap : Measure.map T μ = ∑ x ∈ hTfin.toFinset, (Measure.map T μ {x}) • Measure.dirac x := by @@ -1648,8 +1648,10 @@ theorem wassersteinCostCoupling_le_dual obtain ⟨S, hS, hSfin, hScost⟩ := exists_finiteRange_map_cost_le c hc_nonneg hc_le_dist ν x₀ hν_cm ((ε : ℝ) / 4) hε4 - have : IsProbabilityMeasure (Measure.map T μ) := Measure.isProbabilityMeasure_map hT.aemeasurable - have : IsProbabilityMeasure (Measure.map S ν) := Measure.isProbabilityMeasure_map hS.aemeasurable + have : IsProbabilityMeasure (Measure.map T μ) := + (Measure.isProbabilityMeasure_map_iff hT.aemeasurable).mpr inferInstance + have : IsProbabilityMeasure (Measure.map S ν) := + (Measure.isProbabilityMeasure_map_iff hS.aemeasurable).mpr inferInstance set q : ℝ≥0∞ := ENNReal.ofReal ((ε : ℝ) / 4) with hq -- triangle through the two approximants have htri1 := wassersteinCostCoupling_triangle c hc_triangle hc_cont.measurable diff --git a/LeanPool/Vlasov/OT/Wasserstein.lean b/LeanPool/Vlasov/OT/Wasserstein.lean index cd0ba6009b..1409c433e4 100644 --- a/LeanPool/Vlasov/OT/Wasserstein.lean +++ b/LeanPool/Vlasov/OT/Wasserstein.lean @@ -614,7 +614,7 @@ theorem integral_boundedContinuous_eq_of_integral_lipschitz_eq (integrable_thickenedIndicator (μ := ν) F (δs_pos n))] congr 1 exact h_lip_eq _ _ - ((NNReal.isometry_coe.lipschitz).comp (lipschitzWith_thickenedIndicator (δs_pos n) F)) + ((NNReal.isometry_coe.lipschitzWith).comp (lipschitzWith_thickenedIndicator (δs_pos n) F)) (integrable_thickenedIndicator (μ := μ) F (δs_pos n)) (integrable_thickenedIndicator (μ := ν) F (δs_pos n)) simp_rw [hlint_eq] at hμ_lim diff --git a/LeanPool/Vlasov/OT/WeakToLagrangian.lean b/LeanPool/Vlasov/OT/WeakToLagrangian.lean index 9c646ca4e6..2561fece53 100644 --- a/LeanPool/Vlasov/OT/WeakToLagrangian.lean +++ b/LeanPool/Vlasov/OT/WeakToLagrangian.lean @@ -390,7 +390,8 @@ lemma measure_eq_of_forall_Cc_integral_eq {μ ν : Measure (PhaseSpace d)} rw [show (volume : Measure (PhaseSpace d)) = (volume : Measure (PhysSpace d)).prod volume from Measure.volume_eq_prod _ _] infer_instance - have hvolReg : (volume : Measure (PhaseSpace d)).Regular := inferInstance + have hvolReg : (volume : Measure (PhaseSpace d)).Regular := + Measure.Regular.of_sigmaCompactSpace_of_isLocallyFiniteMeasure _ have hμreg : μ.Regular := inferInstance have hνreg : ν.Regular := inferInstance -- Reduce `μ = ν` to equality of integrals against continuous compactly-supported `g`. @@ -3112,7 +3113,7 @@ lemma convolveField_window_setup intro σ hσ have : IsProbabilityMeasure (f σ) := (hf_mom σ hσ).1 have hprob_m : IsProbabilityMeasure (spatialMarginal (f σ)) := - Measure.isProbabilityMeasure_map measurable_fst.aemeasurable + (Measure.isProbabilityMeasure_map_iff measurable_fst.aemeasurable).mpr inferInstance -- ‖·‖ integrable wrt the spatial marginal (from the finite first moment of f σ) have h_y_int : Integrable (fun y : PhysSpace d => ‖y‖) (spatialMarginal (f σ)) := by unfold spatialMarginal @@ -3252,7 +3253,8 @@ theorem weakEvolution_test_C1c_On rw [show (volume : Measure (PhaseSpace d)) = (volume : Measure (PhysSpace d)).prod volume from Measure.volume_eq_prod _ _] infer_instance - have hvolReg : (volume : Measure (PhaseSpace d)).Regular := inferInstance + have hvolReg : (volume : Measure (PhaseSpace d)).Regular := + Measure.Regular.of_sigmaCompactSpace_of_isLocallyFiniteMeasure _ -- mollifier family (shrinking bumps); copy of #9's set φ : ℕ → ContDiffBump (0 : PhaseSpace d) := fun n => ⟨1 / (n + 2), 2 / (n + 2), by positivity, by @@ -4318,7 +4320,7 @@ theorem frozenFlow_inverse_On intro s hs x_pt have : IsProbabilityMeasure (f s) := (hf_mom s hs).1 have : IsProbabilityMeasure (spatialMarginal (f s)) := - Measure.isProbabilityMeasure_map measurable_fst.aemeasurable + (Measure.isProbabilityMeasure_map_iff measurable_fst.aemeasurable).mpr inferInstance have h_aesm : AEStronglyMeasurable (fun y : PhysSpace d => gradW (x_pt - y)) (spatialMarginal (f s)) := (hL.continuous.comp (continuous_const.sub continuous_id)).aestronglyMeasurable @@ -4366,7 +4368,7 @@ theorem frozenFlow_inverse_On have hρ'_prob : ∀ s, IsProbabilityMeasure (ρ' s) := by intro s have : IsProbabilityMeasure (f (clampT s)) := (hf_mom (clampT s) (hclampT_mem s)).1 - exact Measure.isProbabilityMeasure_map measurable_fst.aemeasurable + exact (Measure.isProbabilityMeasure_map_iff measurable_fst.aemeasurable).mpr inferInstance have h_int' : ∀ s (x : PhysSpace d), Integrable (fun y => gradW (x - y)) (ρ' s) := fun s x => h_int_win (clampT s) (hclampT_mem s) x have hf_cont' : ∀ x, Continuous (fun s => convolveFunctionMeasure gradW (ρ' s) x) := @@ -4617,7 +4619,7 @@ theorem weak_eq_frozenField_pushforward_On have hρ'_prob : ∀ t, IsProbabilityMeasure (ρ' t) := by intro t have : IsProbabilityMeasure (f (clampT t)) := (hf_mom (clampT t) (hclampT_mem t)).1 - exact Measure.isProbabilityMeasure_map measurable_fst.aemeasurable + exact (Measure.isProbabilityMeasure_map_iff measurable_fst.aemeasurable).mpr inferInstance have h_int' : ∀ t (x : PhysSpace d), Integrable (fun y => gradW (x - y)) (ρ' t) := fun t x => h_int_window (clampT t) (hclampT_mem t) x -- `ρ'`-flavoured velocity ODE on `Ioo 0 T` (clamp = id there, so the field is unchanged). @@ -4645,7 +4647,7 @@ theorem weak_eq_frozenField_pushforward_On (hΦ_meas t ht).aemeasurable have hmap_prob : IsProbabilityMeasure (Measure.map (fun z : PhaseSpace d => (charX t z, charV t z)) (f 0)) := - Measure.isProbabilityMeasure_map hΦt_aem + (Measure.isProbabilityMeasure_map_iff hΦt_aem).mpr inferInstance refine measure_eq_of_forall_Cc_integral_eq (fun φ hφ hφc => ?_) rw [integral_map hΦt_aem hφ.continuous.aestronglyMeasurable] exact weak_eq_frozenField_pushforward_dualCore W gradW hgradW L hL f T hT hf_weak hf_mom hf_narrow @@ -4696,7 +4698,7 @@ theorem weak_isLagrangianVlasovSolutionOn have hρ_prob : ∀ t ∈ Set.Icc (0 : ℝ) T, IsProbabilityMeasure (spatialMarginal (f t)) := by intro t ht have : IsProbabilityMeasure (f t) := (hf_mom t ht).1 - exact Measure.isProbabilityMeasure_map measurable_fst.aemeasurable + exact (Measure.isProbabilityMeasure_map_iff measurable_fst.aemeasurable).mpr inferInstance have hsetup := convolveField_window_setup gradW L hL f T hf_mom M_ρ hM_ρ (‖gradW 0‖ + (L : ℝ) * M_ρ) rfl have h_y_int : ∀ t ∈ Set.Icc (0 : ℝ) T, @@ -4720,15 +4722,32 @@ theorem weak_isLagrangianVlasovSolutionOn hf_cont_deriv M_ρ hM_ρ_nn hM_ρ charX charV hflow hinit hcontIcc hderivIco -- Assemble the localized Lagrangian witness. refine ⟨hf_weak, charX, charV, hflow, hpush, ?_, hcontIcc⟩ - -- AEMeasurability of the flow at each window time, from the pushforward identity: a - -- non-measurable map would force `Measure.map _ (f 0) = 0 ≠ f s` (the latter a probability). - intro s hs - have hfs_prob : IsProbabilityMeasure (f s) := (hf_mom s hs).1 - by_contra hcon - have h0 : f s = 0 := by - rw [hpush s hs]; exact Measure.map_of_not_aemeasurable hcon - have hone : (f s) Set.univ = 1 := measure_univ - rw [h0] at hone - simp at hone + -- AEMeasurability of the flow at each window time, from the Grönwall Lipschitz-in-`z` + -- bound (`charFlow_measurable_via_gronwall_Ioo`), applied to the frozen field clamped + -- into the window (L11) so that its universal-in-`t` hypotheses are available. + set clampT : ℝ → ℝ := fun t => max 0 (min t T) with hclampT_def + have hclampT_mem : ∀ t, clampT t ∈ Set.Icc (0 : ℝ) T := by + intro t; simp only [hclampT_def, Set.mem_Icc] + exact ⟨le_max_left _ _, max_le hT.le (min_le_right _ _)⟩ + have hclampT_id : ∀ t ∈ Set.Icc (0 : ℝ) T, clampT t = t := by + intro t ht; simp only [hclampT_def, min_eq_left ht.2, max_eq_right ht.1] + set ρ' : ℝ → Measure (PhysSpace d) := fun t => spatialMarginal (f (clampT t)) with hρ'_def + have hρ'_prob : ∀ t, IsProbabilityMeasure (ρ' t) := by + intro t; simp only [hρ'_def]; exact hρ_prob (clampT t) (hclampT_mem t) + have h_int' : ∀ t (x : PhysSpace d), Integrable (fun y => gradW (x - y)) (ρ' t) := + fun t x => h_int (clampT t) (hclampT_mem t) x + have h_deriv_Ioo' : ∀ z, ∀ s ∈ Set.Ioo (0 : ℝ) T, + HasDerivWithinAt (fun s' => (charX s' z, charV s' z)) + (vlasovVectorField gradW ρ' s (charX s z, charV s z)) (Set.Ici s) s := by + intro z s hs + have h := hderivIco z s (Set.Ioo_subset_Ico_self hs) + have hρeq : ρ' s = spatialMarginal (f s) := by + simp only [hρ'_def, hclampT_id s (Set.Ioo_subset_Icc_self hs)] + have hfield : vlasovVectorField gradW ρ' s (charX s z, charV s z) + = vlasovVectorField gradW (fun t => spatialMarginal (f t)) s (charX s z, charV s z) := by + simp only [vlasovVectorField, hρeq] + rw [hfield]; exact h + exact fun s hs => (charFlow_measurable_via_gronwall_Ioo gradW L hL ρ' h_int' charX charV T hT.le + hinit hcontIcc h_deriv_Ioo' s hs).aemeasurable end Vlasov diff --git a/LeanPool/Vlasov/OT/WellPosedness.lean b/LeanPool/Vlasov/OT/WellPosedness.lean index 5b4cf46821..159ae054f1 100644 --- a/LeanPool/Vlasov/OT/WellPosedness.lean +++ b/LeanPool/Vlasov/OT/WellPosedness.lean @@ -480,7 +480,7 @@ private lemma picardLimit_fixed_point_eq intro t ht have hP1 : IsProbabilityMeasure (ρl.ρ t) := ρl.isProb t have hP2 : IsProbabilityMeasure (Measure.map (fun z => charX t z) f₀) := - Measure.isProbabilityMeasure_map (h_aem_lim t ht) + (Measure.isProbabilityMeasure_map_iff (h_aem_lim t ht)).mpr inferInstance refine (wasserstein1_eq_zero_iff_measure_eq (ρl.ρ t) (Measure.map (fun z => charX t z) f₀)).mp ?_ have h_le_seq : ∀ n, wasserstein1 (ρl.ρ t) (Measure.map (fun z => charX t z) f₀) @@ -500,7 +500,7 @@ private lemma picardLimit_fixed_point_eq have h_fin : wasserstein1 (Measure.map (fun z => charXs n t z) f₀) (Measure.map (fun z => charX t z) f₀) ≠ ⊤ := by have : IsProbabilityMeasure (Measure.map (fun z => charXs n t z) f₀) := - Measure.isProbabilityMeasure_map (h_aem_n n t ht) + (Measure.isProbabilityMeasure_map_iff (h_aem_n n t ht)).mpr inferInstance exact wasserstein1_ne_top_of_finite_moment _ _ (h_mom_n n t ht) (h_mom_lim t ht) rw [← ENNReal.ofReal_toReal h_fin] @@ -886,7 +886,7 @@ theorem vlasovWellPosedness_local_picard_fixedPointFlow -- Integrable ‖·‖ μ₀ from hf₀_int via integral_map on Prod.fst. -- ============================================================ have hμ₀_prob : IsProbabilityMeasure (spatialMarginal f₀) := - Measure.isProbabilityMeasure_map measurable_fst.aemeasurable + (Measure.isProbabilityMeasure_map_iff measurable_fst.aemeasurable).mpr inferInstance have hμ₀_int : Integrable (fun y : PhysSpace d => ‖y‖) (spatialMarginal f₀) := by unfold spatialMarginal rw [integrable_map_measure @@ -1125,13 +1125,13 @@ theorem vlasovWellPosedness_local_moment intro s unfold spatialMarginal vlasovSolutionViaPushforward -- Need IsProbabilityMeasure (Measure.map Prod.fst (Measure.map (fun z => ...) f₀)) - -- Use Measure.map_map to compose, then isProbabilityMeasure_map on the composition. + -- Use Measure.map_map to compose, then isProbabilityMeasure_map_iff on the composition. have h_aemeas_pair : AEMeasurable (fun z : PhaseSpace d => (charX s z, charV s z)) f₀ := h_aemeas s have h_prob_inner : IsProbabilityMeasure (Measure.map (fun z : PhaseSpace d => (charX s z, charV s z)) f₀) := - Measure.isProbabilityMeasure_map h_aemeas_pair - exact Measure.isProbabilityMeasure_map measurable_fst.aemeasurable + (Measure.isProbabilityMeasure_map_iff h_aemeas_pair).mpr inferInstance + exact (Measure.isProbabilityMeasure_map_iff measurable_fst.aemeasurable).mpr inferInstance -- Step 1: Extract h_init, h_cont_Icc, h_deriv_Ico via boundary transport. obtain ⟨h_init, h_cont_Icc, h_deriv_Ico⟩ := characteristicFlow_boundary_regularity gradW @@ -1146,7 +1146,7 @@ theorem vlasovWellPosedness_local_moment M_ρ hM_ρ_nn hM_ρ_bound h_y_int_ρ h_int_conv -- Step 3: Conclude HasFiniteFirstMoment. unfold HasFiniteFirstMoment vlasovSolutionViaPushforward - refine ⟨Measure.isProbabilityMeasure_map (h_aemeas t), ?_⟩ + refine ⟨(Measure.isProbabilityMeasure_map_iff (h_aemeas t)).mpr inferInstance, ?_⟩ -- Integrable ‖·‖ wrt Measure.map (fun z => (charX t z, charV t z)) f₀. rw [integrable_map_measure (Continuous.aestronglyMeasurable continuous_norm) (h_aemeas t)] @@ -1249,8 +1249,8 @@ theorem vlasovWellPosedness_local_isLagrangian h_aemeas s have _h_prob_inner : IsProbabilityMeasure (Measure.map (fun z : PhaseSpace d => (charX s z, charV s z)) f₀) := - Measure.isProbabilityMeasure_map h_aemeas_pair - exact Measure.isProbabilityMeasure_map measurable_fst.aemeasurable + (Measure.isProbabilityMeasure_map_iff h_aemeas_pair).mpr inferInstance + exact (Measure.isProbabilityMeasure_map_iff measurable_fst.aemeasurable).mpr inferInstance -- Step 1: Extract h_init, h_cont_Icc, h_deriv_Ico via boundary transport. obtain ⟨h_init, h_cont_Icc, h_deriv_Ico⟩ := characteristicFlow_boundary_regularity gradW @@ -2072,7 +2072,7 @@ private lemma dobrushinFlow_marginal_gradW_integrable intro t ht x_pt have : IsProbabilityMeasure (μ t) := (hμ_mom t ht).1 have : IsProbabilityMeasure (spatialMarginal (μ t)) := - Measure.isProbabilityMeasure_map measurable_fst.aemeasurable + (Measure.isProbabilityMeasure_map_iff measurable_fst.aemeasurable).mpr inferInstance have h_y_int : Integrable (fun y : PhysSpace d => ‖y‖) (spatialMarginal (μ t)) := by unfold spatialMarginal rw [integrable_map_measure @@ -2300,7 +2300,7 @@ private lemma vlasovGlue_flow_growthBound intro t have : IsProbabilityMeasure (μ (clampT t)) := (hμ_mom (clampT t) (hclampT_mem t)).1 - exact Measure.isProbabilityMeasure_map measurable_fst.aemeasurable + exact (Measure.isProbabilityMeasure_map_iff measurable_fst.aemeasurable).mpr inferInstance have hM_ρ : ∀ t ∈ Set.Icc (0 : ℝ) T, ∫ y, ‖y‖ ∂(ρc t) ≤ M := by intro t _ht rw [hρc_def] @@ -2582,7 +2582,7 @@ private lemma vlasovGlue_seam_contLeft intro s hs have : IsProbabilityMeasure (f_prev s) := (h_prev_mom s hs).1 have : IsProbabilityMeasure (spatialMarginal (f_prev s)) := - Measure.isProbabilityMeasure_map measurable_fst.aemeasurable + (Measure.isProbabilityMeasure_map_iff measurable_fst.aemeasurable).mpr inferInstance exact (convolveFunctionMeasure_lipschitz_in_x gradW L hL (spatialMarginal (f_prev s)) (h_int_marg s hs)).continuous.comp continuous_fst have h_integrand_cont : ∀ s ∈ Set.Icc (0 : ℝ) T, @@ -2662,7 +2662,7 @@ private lemma vlasovGlue_seam_contLeft T (Set.Iic T) (Set.Icc 0 T) h_nhd_L (fun s hs => by have : IsProbabilityMeasure (f_prev s) := (h_prev_mom s hs).1 - exact Measure.isProbabilityMeasure_map measurable_fst.aemeasurable) + exact (Measure.isProbabilityMeasure_map_iff measurable_fst.aemeasurable).mpr inferInstance) M_ρ hM_ρ h_y_int_marg h_int_marg C_T hC_T_pair (fun s hs => h_prev_init ▸ h_prev_aemeas s hs) h_X_cont h_V_cont h_conv_cwn @@ -3021,7 +3021,7 @@ private lemma vlasovGlue_seam_contRight intro τ hτ have : IsProbabilityMeasure (g τ) := (hg_mom τ hτ).1 have : IsProbabilityMeasure (spatialMarginal (g τ)) := - Measure.isProbabilityMeasure_map measurable_fst.aemeasurable + (Measure.isProbabilityMeasure_map_iff measurable_fst.aemeasurable).mpr inferInstance exact (convolveFunctionMeasure_lipschitz_in_x gradW L hL (spatialMarginal (g τ)) (h_int_marg_g τ hτ)).continuous.comp continuous_fst have h_integrand_cont : ∀ τ ∈ Set.Icc (0 : ℝ) T_0, @@ -3084,7 +3084,7 @@ private lemma vlasovGlue_seam_contRight have hsT_Icc : s - T ∈ Set.Icc (0 : ℝ) T_0 := ⟨by linarith [hs.1], by linarith [hs.2]⟩ have : IsProbabilityMeasure (g (s - T)) := (hg_mom (s - T) hsT_Icc).1 - exact Measure.isProbabilityMeasure_map measurable_fst.aemeasurable) + exact (Measure.isProbabilityMeasure_map_iff measurable_fst.aemeasurable).mpr inferInstance) M_g (fun s hs => hM_g_bd (s - T) ⟨by linarith [hs.1], by linarith [hs.2]⟩) (fun s hs => h_y_int_marg_g (s - T) ⟨by linarith [hs.1], by linarith [hs.2]⟩) @@ -5205,10 +5205,10 @@ private theorem dobrushin_integrated_flow_bound_On fun s x => h_int_g (clampT s) (hclampT_mem s) x have hfc_isProb : ∀ s, IsProbabilityMeasure (spatialMarginal (f (clampT s))) := by intro s; have := hf_isProb (clampT s) (hclampT_mem s) - exact Measure.isProbabilityMeasure_map measurable_fst.aemeasurable + exact (Measure.isProbabilityMeasure_map_iff measurable_fst.aemeasurable).mpr inferInstance have hgc_isProb : ∀ s, IsProbabilityMeasure (spatialMarginal (g (clampT s))) := by intro s; have := hg_isProb (clampT s) (hclampT_mem s) - exact Measure.isProbabilityMeasure_map measurable_fst.aemeasurable + exact (Measure.isProbabilityMeasure_map_iff measurable_fst.aemeasurable).mpr inferInstance -- Universal (max 1 L)-Lipschitz of the clamped vector fields. have hL_f : ∀ s, LipschitzWith (max 1 L) (b_f s) := fun s => vlasovVectorField_lipschitzWith gradW L hL @@ -6043,8 +6043,8 @@ private lemma vlasovWellPosedness_zeroForce_solutionOn {d : ℕ} h_flow_meas s have _h_prob_inner : IsProbabilityMeasure (Measure.map (fun z : PhaseSpace d => (charX s z, charV s z)) f₀) := - Measure.isProbabilityMeasure_map _hpair - exact Measure.isProbabilityMeasure_map measurable_fst.aemeasurable + (Measure.isProbabilityMeasure_map_iff _hpair).mpr inferInstance + exact (Measure.isProbabilityMeasure_map_iff measurable_fst.aemeasurable).mpr inferInstance have h_init0 : ∀ z : PhaseSpace d, (charX 0 z, charV 0 z) = z := by intro z; simp [charX, charV] have hnorm_bound : ∀ (s : ℝ) (z : PhaseSpace d), ‖charX s z‖ ≤ (1 + |s|) * ‖z‖ := by @@ -6208,8 +6208,7 @@ theorem vlasovWellPosedness constructor · -- IsProbabilityMeasure: pushforward of a probability measure under measurable map. have := hf₀.1 - apply Measure.isProbabilityMeasure_map - fun_prop + exact (Measure.isProbabilityMeasure_map_iff (by fun_prop)).mpr inferInstance · -- Integrable ‖·‖: reduce to f₀ via integral_map, then bound by (1+|t|)·‖z‖. have := hf₀.1 rw [integrable_map_measure (by fun_prop) (by fun_prop)] diff --git a/LeanPool/ZFLean/Naturals.lean b/LeanPool/ZFLean/Naturals.lean index aed8123beb..d2e2fcbda0 100644 --- a/LeanPool/ZFLean/Naturals.lean +++ b/LeanPool/ZFLean/Naturals.lean @@ -6,7 +6,9 @@ Authors: Vincent Trélat import LeanPool.ZFLean.Basic import Mathlib.Algebra.Ring.Defs +import Mathlib.Order.WellFounded import Mathlib.Tactic.Ring +import Mathlib.Util.Delaborators /-! # ZFC Natural numbers diff --git a/LeanPool/Zeta3Irrational/Basic.lean b/LeanPool/Zeta3Irrational/Basic.lean index da2274718c..8c21d95be1 100644 --- a/LeanPool/Zeta3Irrational/Basic.lean +++ b/LeanPool/Zeta3Irrational/Basic.lean @@ -212,9 +212,9 @@ lemma integrableOn_JJ' (n : ℕ) : MeasureTheory.Integrable (fun (x : ℝ × ℝ · rw [abs_eq_self.2, abs_eq_self.2, abs_eq_self.2, abs_eq_self.2, abs_eq_self.2, abs_eq_self.2] <;> nlinarith · simp only [abs_eq_self, sub_nonneg] - apply mul_le_one₀ (by nlinarith) (by linarith) (by linarith) + exact (mul_le_of_le_one_left (by linarith) (by nlinarith)).trans (by linarith) · simp only [abs_eq_self, sub_nonneg] - apply mul_le_one₀ (by nlinarith) (by linarith) (by linarith) + exact (mul_le_of_le_one_left (by linarith) (by nlinarith)).trans (by linarith) · positivity · exact JJ'_nonneg x hx n · simp only [hx, ↓reduceIte] @@ -615,7 +615,7 @@ lemma ineq_aux (x : ℝ × ℝ) (z : ℝ) constructor · apply div_nonneg (by linarith) simp only [sub_nonneg] - apply mul_le_one₀ _ (by linarith) (by linarith) + refine (mul_le_of_le_one_left (by linarith) ?_).trans (by linarith) simp only [tsub_le_iff_right, le_add_iff_nonneg_right] nlinarith · rw [div_le_iff₀] diff --git a/LeanPool/Zeta3Irrational/D.lean b/LeanPool/Zeta3Irrational/D.lean index bd4fd2d368..e5e2d1ce2d 100644 --- a/LeanPool/Zeta3Irrational/D.lean +++ b/LeanPool/Zeta3Irrational/D.lean @@ -296,7 +296,7 @@ theorem d_le_pow_counting (n : ℕ) : d (Finset.Icc 1 n) ≤ n ^ (n.primeCountin rw [d_eq_prod_pow n] calc _ ≤ ∏ _ ∈ ((n + 1).primesBelow), n := by - apply Finset.prod_le_prod + apply Finset.prod_le_prod₀ · simp_all · intro p hp rw [Nat.mem_primesBelow] at hp diff --git a/LeanPool/Zeta3Irrational/Integral.lean b/LeanPool/Zeta3Irrational/Integral.lean index 1b2adc85cb..9b0f154d63 100644 --- a/LeanPool/Zeta3Irrational/Integral.lean +++ b/LeanPool/Zeta3Irrational/Integral.lean @@ -405,8 +405,7 @@ lemma integrableOn_aux (x : ℝ × ℝ) simp at hy apply div_nonneg (by norm_num) simp only [sub_nonneg] - apply mul_le_one₀ _ (by linarith) (by linarith) - linarith + exact (mul_le_of_le_one_left (by linarith) (by linarith)).trans (by linarith) lemma JENN_eq_triple_aux' (x : ℝ × ℝ) (hx : x ∈ Set.Ioo 0 1 ×ˢ Set.Ioo 0 1) : ∫⁻ (w : ℝ) in Set.Ioo 0 1, ENNReal.ofReal (1 / (1 - (1 - x.1 * x.2) * w)) = @@ -435,8 +434,7 @@ lemma JENN_eq_triple_aux' (x : ℝ × ℝ) (hx : x ∈ Set.Ioo 0 1 ×ˢ Set.Ioo · simp only [h, true_and] at hs apply div_nonneg (by norm_num) simp only [sub_nonneg] - apply mul_le_one₀ _ (by linarith) (by linarith) - linarith + exact (mul_le_of_le_one_left (by linarith) (by linarith)).trans (by linarith) · tauto lemma JENN_eq_triple_aux (x : ℝ × ℝ) (hx : x ∈ Set.Ioo 0 1 ×ˢ Set.Ioo 0 1) : @@ -467,9 +465,9 @@ lemma JENN_eq_triple_aux (x : ℝ × ℝ) (hx : x ∈ Set.Ioo 0 1 ×ˢ Set.Ioo 0 · simp only [Left.nonneg_neg_iff] apply Real.log_nonpos · apply mul_nonneg (by linarith) (by linarith) - · apply mul_le_one₀ (by linarith) (by linarith) (by linarith) + · exact (mul_le_of_le_one_left (by linarith) (by linarith)).trans (by linarith) · simp only [sub_nonneg] - apply mul_le_one₀ (by linarith) (by linarith) (by linarith) + exact (mul_le_of_le_one_left (by linarith) (by linarith)).trans (by linarith) lemma JENN_eq_triple (r s : ℕ) : JENN r s = ∫⁻ (x : ℝ × ℝ × ℝ) in Set.Ioo 0 1 ×ˢ Set.Ioo 0 1 ×ˢ Set.Ioo 0 1, diff --git a/LeanPool/ZetaZeros/Hilbert/AlphaExpansion.lean b/LeanPool/ZetaZeros/Hilbert/AlphaExpansion.lean index 1cd672b5c5..a35a939ea0 100644 --- a/LeanPool/ZetaZeros/Hilbert/AlphaExpansion.lean +++ b/LeanPool/ZetaZeros/Hilbert/AlphaExpansion.lean @@ -1800,15 +1800,17 @@ theorem sum_sq_pairing_le_integral_norm_sq {lam : ℝ} {N : ℕ} /-- The tensor product of two `L²` functions is `L²` for the product measure. -/ theorem memLp_tensor_two {alpha beta : Type*} [MeasurableSpace alpha] [MeasurableSpace beta] - {mu : Measure alpha} {nu : Measure beta} + {mu : Measure alpha} {nu : Measure beta} [SFinite nu] {f : alpha → ℂ} {g : beta → ℂ} (hf : MemLp f 2 mu) (hg : MemLp g 2 nu) : MemLp (fun p : alpha × beta => f p.1 * g p.2) 2 (mu.prod nu) := by - have h1 : Integrable (fun x => ‖f x‖ ^ 2) mu := (memLp_two_iff_integrable_sq_norm hf.1).mp hf - have h2 : Integrable (fun y => ‖g y‖ ^ 2) nu := (memLp_two_iff_integrable_sq_norm hg.1).mp hg + have h1 : Integrable (fun x => ‖f x‖ ^ 2) mu := + (memLp_two_iff_integrable_sq_norm hf.aestronglyMeasurable).mp hf + have h2 : Integrable (fun y => ‖g y‖ ^ 2) nu := + (memLp_two_iff_integrable_sq_norm hg.aestronglyMeasurable).mp hg have hmul : Integrable (fun z : alpha × beta => ‖f z.1‖ ^ 2 * ‖g z.2‖ ^ 2) (mu.prod nu) := h1.mul_prod h2 have hmeas : AEStronglyMeasurable (fun p : alpha × beta => f p.1 * g p.2) (mu.prod nu) := - hf.1.comp_fst.mul hg.1.comp_snd + hf.aestronglyMeasurable.comp_fst.mul hg.aestronglyMeasurable.comp_snd rw [memLp_two_iff_integrable_sq_norm hmeas] refine hmul.congr ?_ filter_upwards with z diff --git a/LeanPool/ZetaZeros/Hilbert/L2.lean b/LeanPool/ZetaZeros/Hilbert/L2.lean index e31c44702f..cd7d3c4ac2 100644 --- a/LeanPool/ZetaZeros/Hilbert/L2.lean +++ b/LeanPool/ZetaZeros/Hilbert/L2.lean @@ -70,7 +70,7 @@ private lemma norm_fz_le (z : ℂ) {u : ℝ} (hu : u ∈ Set.Ioo (-lam) lam) : private lemma aestronglyMeasurable_fz (h : IsAdmissible lam eta) (z : ℂ) (s : Set ℝ) : AEStronglyMeasurable (fz eta z) (volume.restrict s) := by have he : AEStronglyMeasurable (fun u : ℝ => ((eta u : ℝ) : ℂ)) (volume.restrict s) := - Complex.continuous_ofReal.comp_aestronglyMeasurable (h.memLp.1.restrict) + Complex.continuous_ofReal.comp_aestronglyMeasurable (h.memLp.aestronglyMeasurable.restrict) exact he.mul (continuous_twist z).aestronglyMeasurable /-- **The twisted function is square-integrable on the interval.** -/ diff --git a/LeanPool/ZetaZeros/Zeta/Kernel.lean b/LeanPool/ZetaZeros/Zeta/Kernel.lean index 38f65cd632..dfd0fe52d7 100644 --- a/LeanPool/ZetaZeros/Zeta/Kernel.lean +++ b/LeanPool/ZetaZeros/Zeta/Kernel.lean @@ -408,9 +408,8 @@ lemma unweightedKernelSum_cutoffTest_tendsto (hPC : PairCorrelation) {delta : (fun T : ℝ => ((((4 * Real.log T ^ 2 : ℝ) : ℂ)))⁻¹) Filter.atTop (nhds 0) := by convert (Complex.continuous_ofReal.tendsto 0).comp hinv_real using 1 - · funext T - exact (Complex.ofReal_inv _).symm - · rfl + funext T + exact (Complex.ofReal_inv _).symm have hQ2_small : Filter.Tendsto (fun T => (pairCorrelationSum (iteratedDeriv 2 (cutoffSelfConv psi)) T / diff --git a/LeanPool/ZhangYeungInequality/EntropyRegion.lean b/LeanPool/ZhangYeungInequality/EntropyRegion.lean index 2106241c8b..987b677663 100644 --- a/LeanPool/ZhangYeungInequality/EntropyRegion.lean +++ b/LeanPool/ZhangYeungInequality/EntropyRegion.lean @@ -167,7 +167,7 @@ theorem entropyFnN_restrictFirstFour cases hj simpa using hValueEq have h_meas : Measurable (fun ω : Ω => fun j : α.map e => X j.1 ω) := - measurable_pi_lambda _ (fun j => hX j.1) + Measurable.of_eval (fun j => hX j.1) change H[(fun ω : Ω => fun j : α.map e => X j.1 ω); μ] = H[(fun ω : Ω => fun i : α => X (e i.1) ω); μ] simpa [π, Function.comp_def] using (entropy_comp_of_injective μ h_meas π hπ).symm diff --git a/LeanPool/ZhangYeungInequality/PFR/ForMathlib/ConditionalIndependence.lean b/LeanPool/ZhangYeungInequality/PFR/ForMathlib/ConditionalIndependence.lean index 6a07b05991..74291c9d88 100644 --- a/LeanPool/ZhangYeungInequality/PFR/ForMathlib/ConditionalIndependence.lean +++ b/LeanPool/ZhangYeungInequality/PFR/ForMathlib/ConditionalIndependence.lean @@ -195,7 +195,7 @@ lemma _root_.ProbabilityTheory.condIndep_copies simp [m] have h5 {y : β} (hy : μ (Y ⁻¹' {y}) ≠ 0) : IsProbabilityMeasure (m' y) := by have : IsProbabilityMeasure (μ[|Y ← y]) := cond_isProbabilityMeasure hy - exact isProbabilityMeasure_map hX.aemeasurable + infer_instance have h1 : ν.map Prod.snd = μ.map Y := by rw [← sum_meas_smul_cond_fiber' hY μ, ← Measure.mapₗ_apply_of_measurable measurable_snd, ← Measure.mapₗ_apply_of_measurable hY] diff --git a/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Basic.lean b/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Basic.lean index c25fe6ddde..15eb22e047 100644 --- a/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Basic.lean +++ b/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Basic.lean @@ -461,7 +461,8 @@ lemma _root_.ProbabilityTheory.condEntropy_le_log_card [MeasurableSingletonClass refine (integral_mono_of_nonneg ?_ (integrable_const (log (Fintype.card S))) ?_).trans ?_ · exact ae_of_all _ (fun _ ↦ entropy_nonneg _ _) · exact ae_of_all _ (fun _ ↦ entropy_le_log_card _ _) - · have : IsProbabilityMeasure (μ.map Y) := isProbabilityMeasure_map hY.aemeasurable + · have : IsProbabilityMeasure (μ.map Y) := + (Measure.isProbabilityMeasure_map_iff hY.aemeasurable).mpr ‹_› simp /-- `H[X|Y] = ∑_y P[Y=y] H[X|Y=y]`. -/ diff --git a/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Kernel/Basic.lean b/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Kernel/Basic.lean index 0787bdb1d6..aea6a835f7 100644 --- a/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Kernel/Basic.lean +++ b/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Kernel/Basic.lean @@ -205,7 +205,6 @@ lemma entropy_comap_equiv [MeasurableSingletonClass T] rw [entropy_comap] · exact f.measurableEmbedding · rw [← MeasurableEquiv.coe_toEquiv, Equiv.range_eq_univ] - exact Filter.EventuallyEq.rfl · exact FiniteSupport.comap_equiv f lemma entropy_comap_swap [MeasurableSingletonClass T] diff --git a/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Measure.lean b/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Measure.lean index 5c2ace8c35..cc248781eb 100644 --- a/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Measure.lean +++ b/LeanPool/ZhangYeungInequality/PFR/ForMathlib/Entropy/Measure.lean @@ -157,8 +157,13 @@ lemma ae_mem_of_finiteRange {μ : Measure Ω} {X : Ω instance finiteSupport_of_finiteRange {μ : Measure Ω} {X : Ω → S} [hX' : FiniteRange X] : FiniteSupport (μ.map X) := by - use hX'.toFinset - exact FiniteRange.null_of_compl μ X + by_cases hX : AEMeasurable X μ + · exact ⟨hX'.toFinset, FiniteRange.null_of_compl μ X hX⟩ + rcases eq_or_ne μ 0 with rfl | hμ + · rw [Measure.map_zero] + infer_instance + · rw [Measure.map_of_not_aemeasurable_of_ne_zero hX hμ] + infer_instance instance finiteSupport_of_prod {μ : Measure S} [FiniteSupport μ] {ν : Measure T} [SigmaFinite ν] [FiniteSupport ν] : @@ -587,14 +592,14 @@ lemma _root_.ProbabilityTheory.measureMutualInfo_univ_smul rw [measureMutualInfo_def, measureMutualInfo_def] congr 1 · congr 1 - · convert measureEntropy_univ_smul - simp only [Measure.map_smul]; congr; symm - convert Measure.map_apply measurable_fst MeasurableSet.univ - rw [Set.preimage_univ] - · convert measureEntropy_univ_smul - simp only [Measure.map_smul]; congr; symm - convert Measure.map_apply measurable_snd MeasurableSet.univ - rw [Set.preimage_univ] + · have hfst : (Measure.map Prod.fst μ) Set.univ = μ Set.univ := by + rw [Measure.map_apply measurable_fst MeasurableSet.univ, Set.preimage_univ] + rw [Measure.map_smul _ measurable_fst.aemeasurable, ← hfst] + exact measureEntropy_univ_smul + · have hsnd : (Measure.map Prod.snd μ) Set.univ = μ Set.univ := by + rw [Measure.map_apply measurable_snd MeasurableSet.univ, Set.preimage_univ] + rw [Measure.map_smul _ measurable_snd.aemeasurable, ← hsnd] + exact measureEntropy_univ_smul convert measureEntropy_univ_smul variable [MeasurableSingletonClass S] [MeasurableSingletonClass T] [MeasurableSingletonClass U] @@ -635,10 +640,6 @@ lemma _root_.ProbabilityTheory.measureMutualInfo_nonneg_aux μ.real {p} = (μ.map Prod.fst).real {p.1} * (μ.map Prod.snd).real {p.2}) := by rcases eq_zero_or_isProbabilityMeasure μ with rfl | hμ · simp - have : IsProbabilityMeasure (μ.map Prod.fst) := - Measure.isProbabilityMeasure_map measurable_fst.aemeasurable - have : IsProbabilityMeasure (μ.map Prod.snd) := - Measure.isProbabilityMeasure_map measurable_snd.aemeasurable let E := μ.finiteSupport have hE := measure_compl_support μ classical diff --git a/LeanPool/ZhangYeungInequality/PFR/ForMathlib/FiniteRange/Defs.lean b/LeanPool/ZhangYeungInequality/PFR/ForMathlib/FiniteRange/Defs.lean index 604aba9e05..0dec4724b4 100644 --- a/LeanPool/ZhangYeungInequality/PFR/ForMathlib/FiniteRange/Defs.lean +++ b/LeanPool/ZhangYeungInequality/PFR/ForMathlib/FiniteRange/Defs.lean @@ -162,16 +162,18 @@ lemma FiniteRange.real_full {Ω G : Type*} [MeasurableSpace Ω] [MeasurableSpace (μ.map X).real (FiniteRange.toFinset X) = μ.real Set.univ := by simp [measureReal_def, FiniteRange.full hX] +-- `AEMeasurable X μ` is needed: without it `μ.map X` is an arbitrary Dirac mass (for `μ ≠ 0`), +-- which need not be supported on the range of `X`. lemma FiniteRange.null_of_compl {Ω G : Type*} [MeasurableSpace Ω] [MeasurableSpace G] - [MeasurableSingletonClass G] (μ : Measure Ω) (X : Ω → G) [FiniteRange X] : + [MeasurableSingletonClass G] (μ : Measure Ω) (X : Ω → G) (hX : AEMeasurable X μ) + [FiniteRange X] : (μ.map X) (FiniteRange.toFinset X : Set G)ᶜ = 0 := by - by_cases hX : AEMeasurable X μ - · rw [Measure.map_apply₀ hX (by measurability)] - convert measure_empty (μ := μ) - ext ω - simp - · simp [hX] + rw [Measure.map_apply₀ hX (by measurability)] + convert measure_empty (μ := μ) + ext ω + simp lemma FiniteRange.ae_mem_toFinset {Ω G : Type*} [MeasurableSpace Ω] [MeasurableSpace G] - [MeasurableSingletonClass G] (μ : Measure Ω) (X : Ω → G) [FiniteRange X] : - ∀ᵐ x ∂(μ.map X), x ∈ (FiniteRange.toFinset X : Set G) := FiniteRange.null_of_compl .. + [MeasurableSingletonClass G] (μ : Measure Ω) (X : Ω → G) (hX : AEMeasurable X μ) + [FiniteRange X] : + ∀ᵐ x ∂(μ.map X), x ∈ (FiniteRange.toFinset X : Set G) := FiniteRange.null_of_compl μ X hX diff --git a/LeanPool/ZhangYeungInequality/PFR/Mathlib/MeasureTheory/Measure/Dirac.lean b/LeanPool/ZhangYeungInequality/PFR/Mathlib/MeasureTheory/Measure/Dirac.lean index e1e3eda5f6..4c686cff40 100644 --- a/LeanPool/ZhangYeungInequality/PFR/Mathlib/MeasureTheory/Measure/Dirac.lean +++ b/LeanPool/ZhangYeungInequality/PFR/Mathlib/MeasureTheory/Measure/Dirac.lean @@ -6,7 +6,8 @@ Authors: PFR contributors module -public import Mathlib.MeasureTheory.Measure.Dirac +public import Mathlib.MeasureTheory.Measure.Dirac.Def +public import Mathlib.MeasureTheory.Measure.Dirac.Basic /-! # LeanPool.ZhangYeungInequality.PFR.Mathlib.MeasureTheory.Measure.Dirac diff --git a/LeanPool/ZhangYeungInequality/PFR/Mathlib/Probability/IdentDistrib.lean b/LeanPool/ZhangYeungInequality/PFR/Mathlib/Probability/IdentDistrib.lean index 1a721f0135..eec3b5f4e5 100644 --- a/LeanPool/ZhangYeungInequality/PFR/Mathlib/Probability/IdentDistrib.lean +++ b/LeanPool/ZhangYeungInequality/PFR/Mathlib/Probability/IdentDistrib.lean @@ -186,7 +186,7 @@ lemma _root_.ProbabilityTheory.AEMeasurable.piMk AEMeasurable (F i) μ) : AEMeasurable (fun x i => F i x) μ := by refine ⟨fun x i => (hF i).mk (F i) x, - measurable_pi_lambda _ (fun i => (hF i).measurable_mk), ?_ ⟩ + .of_eval (fun i => (hF i).measurable_mk), ?_ ⟩ filter_upwards [eventually_countable_forall.mpr (fun i ↦ (hF i).ae_eq_mk)] with ω hω ext i; exact hω i @@ -291,8 +291,6 @@ lemma independent_copies {X : Ω → α} {Y : Ω' → β} (hX : Measurable X) (h IsProbabilityMeasure ν ∧ Measurable X' ∧ Measurable Y' ∧ IndepFun X' Y' ν ∧ IdentDistrib X' X ν μ ∧ IdentDistrib Y' Y ν μ' := by - have := Measure.isProbabilityMeasure_map hX.aemeasurable (μ := μ) - have := Measure.isProbabilityMeasure_map hY.aemeasurable (μ := μ') exact ⟨(μ.map X).prod (μ'.map Y), _, _, inferInstance, measurable_fst, measurable_snd, indepFun_fst_snd, ⟨measurable_fst.aemeasurable, hX.aemeasurable, by simp⟩, measurable_snd.aemeasurable, hY.aemeasurable, by simp⟩ diff --git a/LeanPool/ZhangYeungInequality/PFR/Mathlib/Probability/Independence/Basic.lean b/LeanPool/ZhangYeungInequality/PFR/Mathlib/Probability/Independence/Basic.lean index 7848feb3c1..55a285cc71 100644 --- a/LeanPool/ZhangYeungInequality/PFR/Mathlib/Probability/Independence/Basic.lean +++ b/LeanPool/ZhangYeungInequality/PFR/Mathlib/Probability/Independence/Basic.lean @@ -353,21 +353,13 @@ lemma _root_.ProbabilityTheory.iIndepFun.prod variable {β β' Ω : Type*} {mΩ : MeasurableSpace Ω} {μ : Measure Ω} -/-- The new Mathlib tool `Finset.eventuallyEq_iInter` will supersede this result. -/ +/-- The Mathlib tool `Finset.eventuallyEqSet_iInter` supersedes this result. -/ theorem _root_.ProbabilityTheory.EventuallyEq.finite_iInter {ι : Type*} {α : Type u_2} {l : Filter α} (s : Finset ι) {E : ι → Set α} {F : ι → Set α} (h : ∀ i ∈ s, E i =ᶠ[l] F i) : - ⋂ i ∈ s, E i =ᶠ[l] ⋂ i ∈ s, F i := by - unfold Filter.EventuallyEq Filter.Eventually at h ⊢ - simp only [eq_iff_iff] at h ⊢ - rw [← Filter.biInter_finset_mem] at h - apply Filter.mem_of_superset h - intro a ha - change a ∈ ⋂ i ∈ s, E i ↔ a ∈ ⋂ i ∈ s, F i - simp only [mem_iInter, mem_ofPred_eq] at ha ⊢ - change ∀ i ∈ s, a ∈ E i ↔ a ∈ F i at ha - exact forall₂_congr ha + ⋂ i ∈ s, E i =ᶠ[l] ⋂ i ∈ s, F i := + Finset.eventuallyEqSet_iInter s h /-- TODO: a kernel version of this theorem -/ theorem _root_.ProbabilityTheory.iIndepFun.ae_eq {ι : Type*} {β : ι → Type*} diff --git a/LeanPool/ZhangYeungInequality/PFR/Mathlib/Probability/Kernel/Disintegration.lean b/LeanPool/ZhangYeungInequality/PFR/Mathlib/Probability/Kernel/Disintegration.lean index a3ad8deaaf..bf68b2b687 100644 --- a/LeanPool/ZhangYeungInequality/PFR/Mathlib/Probability/Kernel/Disintegration.lean +++ b/LeanPool/ZhangYeungInequality/PFR/Mathlib/Probability/Kernel/Disintegration.lean @@ -223,7 +223,7 @@ lemma _root_.ProbabilityTheory.condDistrib_apply' [IsFiniteMeasure μ] (x : T) (hYx : μ (Y ⁻¹' {x}) ≠ 0) {s : Set S} (hs : MeasurableSet s) : condDistrib X Y μ x s = (μ (Y ⁻¹' {x}))⁻¹ * μ (Y ⁻¹' {x} ∩ X ⁻¹' s) := by - rw [condDistrib_apply_of_ne_zero hX] + rw [condDistrib_apply_of_ne_zero hY hX] · rw [Measure.map_apply hY (.singleton _), Measure.map_apply (hY.prodMk hX) ((measurableSet_singleton _).prod hs)] congr diff --git a/LeanPool/ZhangYeungInequality/Test/Theorem5.lean b/LeanPool/ZhangYeungInequality/Test/Theorem5.lean index 50dd78f3d6..eb50247094 100644 --- a/LeanPool/ZhangYeungInequality/Test/Theorem5.lean +++ b/LeanPool/ZhangYeungInequality/Test/Theorem5.lean @@ -94,7 +94,7 @@ example let Xtuple : Ω → ∀ j : Fin 2, S j := fun ω j => X j ω let πe := MeasurableEquiv.piFinTwo S let π : (∀ j : Fin 2, S j) → S 0 × S 1 := πe - have hXtuple : Measurable Xtuple := measurable_pi_lambda _ hX + have hXtuple : Measurable Xtuple := Measurable.of_eval hX change H[Xtuple; μ] = H[π ∘ Xtuple; μ] exact (entropy_comp_of_injective μ hXtuple π πe.injective).symm have hRaw : diff --git a/LeanPool/ZhangYeungInequality/Theorem2.lean b/LeanPool/ZhangYeungInequality/Theorem2.lean index 518a753196..e503d8e9f3 100644 --- a/LeanPool/ZhangYeungInequality/Theorem2.lean +++ b/LeanPool/ZhangYeungInequality/Theorem2.lean @@ -853,8 +853,7 @@ private lemma ptilde_sum_eq_one (μ : Measure Ω) [IsProbabilityMeasure μ] : ∑ t : S₁ × S₂ × S₃ × S₄, ptilde X Y Z U μ t = 1 := by have hZU_meas : Measurable (fun ω => (Z ω, U ω)) := hZ.prodMk hU - have : IsProbabilityMeasure (μ.map (fun ω => (Z ω, U ω))) := - Measure.isProbabilityMeasure_map hZU_meas.aemeasurable + have : IsProbabilityMeasure (μ.map (fun ω => (Z ω, U ω))) := inferInstance let e : S₃ × S₄ × S₁ × S₂ ≃ S₁ × S₂ × S₃ × S₄ := { toFun := fun ⟨z, u, x, y⟩ => (x, y, z, u) invFun := fun ⟨x, y, z, u⟩ => (z, u, x, y) @@ -1150,7 +1149,7 @@ private lemma phat_sum_eq_one rw [sum_map_pair_first hY hU μ u] field_simp simp_rw [h_sum_y, sum_map_pair_first hX hU μ] - have : IsProbabilityMeasure (μ.map U) := Measure.isProbabilityMeasure_map hU.aemeasurable + have : IsProbabilityMeasure (μ.map U) := inferInstance simp_all /-! ### Δ-to-log-ratio identities -/ diff --git a/LeanPool/ZhangYeungInequality/Theorem4.lean b/LeanPool/ZhangYeungInequality/Theorem4.lean index 448c82aeba..1aa5f9fde5 100644 --- a/LeanPool/ZhangYeungInequality/Theorem4.lean +++ b/LeanPool/ZhangYeungInequality/Theorem4.lean @@ -626,7 +626,7 @@ lemma entropyFn_singleton (hX : ∀ i, Measurable (X i)) (i : Fin 4) : -- The joint RV is measurable: each coordinate `X j.1` is measurable. have h_meas : Measurable (fun ω : Ω => fun j : ({i} : Finset (Fin 4)) => X j.1 ω) := - measurable_pi_lambda _ (fun j => hX j.1) + Measurable.of_eval (fun j => hX j.1) -- π ∘ joint = X i definitionally, so the composed entropy collapses. exact (entropy_comp_of_injective μ h_meas π hπ).symm @@ -659,7 +659,7 @@ lemma entropyFn_pair (hX : ∀ i, Measurable (X i)) subst this; exact h₂ have h_meas : Measurable (fun ω : Ω => fun k : ({i, j} : Finset (Fin 4)) => X k.1 ω) := - measurable_pi_lambda _ (fun k => hX k.1) + Measurable.of_eval (fun k => hX k.1) -- π ∘ joint = ⟨X i, X j⟩ definitionally. exact (entropy_comp_of_injective μ h_meas π hπ).symm @@ -696,7 +696,7 @@ lemma entropyFn_triple (hX : ∀ i, Measurable (X i)) subst this; exact h₃ have h_meas : Measurable (fun ω : Ω => fun m : ({i, j, k} : Finset (Fin 4)) => X m.1 ω) := - measurable_pi_lambda _ (fun m => hX m.1) + Measurable.of_eval (fun m => hX m.1) exact (entropy_comp_of_injective μ h_meas π hπ).symm omit [IsProbabilityMeasure μ] in @@ -736,7 +736,7 @@ lemma entropyFn_quad (hX : ∀ i, Measurable (X i)) : · exact e4 have h_meas : Measurable (fun ω : Ω => fun m : ({0, 1, 2, 3} : Finset (Fin 4)) => X m.1 ω) := - measurable_pi_lambda _ (fun m => hX m.1) + Measurable.of_eval (fun m => hX m.1) exact (entropy_comp_of_injective μ h_meas π hπ).symm end EntropyFnEvaluation diff --git a/LeanPool/ZhangYeungInequality/Theorem5.lean b/LeanPool/ZhangYeungInequality/Theorem5.lean index 1f6eba3955..9d9047558f 100644 --- a/LeanPool/ZhangYeungInequality/Theorem5.lean +++ b/LeanPool/ZhangYeungInequality/Theorem5.lean @@ -182,8 +182,8 @@ private lemma mutualInfo_add_n_way_inequality let Btuple : Ω → (∀ k : Fin (n + 1), β k) := fun ω k => B k ω have hBinit : ∀ k : Fin n, Measurable (Binit k) := fun k => hB k.castSucc have hBlast : Measurable Blast := hB (Fin.last n) - have hBinitTuple : Measurable BinitTuple := measurable_pi_lambda _ hBinit - have hBtuple : Measurable Btuple := measurable_pi_lambda _ hB + have hBinitTuple : Measurable BinitTuple := Measurable.of_eval hBinit + have hBtuple : Measurable Btuple := Measurable.of_eval hB have h_tail := ih (β := fun k => β k.castSucc) (B := Binit) hBinit let pack : (∀ k : Fin (n + 1), β k) → (∀ k : Fin n, β k.castSucc) × β (Fin.last n) := @@ -274,7 +274,7 @@ theorem _root_.ZhangYeung.theorem5 intro _hn let Xtuple : Ω → (∀ j : Fin n, S j) := fun ω j => X j ω let ZU : Ω → S_Z × S_U := fun ω => (Z ω, U ω) - have hXtuple : Measurable Xtuple := measurable_pi_lambda _ hX + have hXtuple : Measurable Xtuple := Measurable.of_eval hX have hZU : Measurable ZU := hZ.prodMk hU obtain ⟨Ω', mΩ', Xprime, Xstar, V, ν, hν, hXprime, hXstar, hV, hCond, hFirst, hSecond⟩ := condIndep_copies Xtuple ZU hXtuple hZU μ From e70741e3c8578ce5fa0ff1e2f84989d73241359a Mon Sep 17 00:00:00 2001 From: Vasily Ilin Date: Tue, 15 Sep 2026 21:18:01 +0000 Subject: [PATCH 3/8] Complete Lean 4.34 compatibility repairs and preserve project semantics --- Challenge/McKay.lean | 2 +- LeanPool/AharoniKorman/Counterexample.lean | 2 +- LeanPool/BooleanIsoperimetry/CoherentGap.lean | 3 +- LeanPool/Brouwer/Brouwer.lean | 93 ++++++++++--------- LeanPool/Brouwer/BrouwerProduct.lean | 22 +++-- LeanPool/Brouwer/Nash.lean | 40 ++++---- LeanPool/Brouwer/ScarfPath.lean | 2 +- LeanPool/Brouwer/Simplex.lean | 53 ++++++++--- LeanPool/CencovPetz/Uniform.lean | 4 +- LeanPool/ChannelCapacity/Counterexample.lean | 3 +- LeanPool/Chudnovsky/DivisionValues.lean | 7 +- .../Composition/Isomorphisms.lean | 3 +- LeanPool/CompositionAlgebras/Octonions.lean | 2 +- LeanPool/ComputableReal/ComputableRSeq.lean | 2 +- .../SpecialFunctions/Basic.lean | 5 +- .../Construction/PaperActionInstances.lean | 12 +-- .../Paper/Section3/DualCoordinates.lean | 3 +- .../Paper/Section3/DualShearMeasure.lean | 6 +- .../Paper/Section3/DualTopology.lean | 4 +- .../Paper/Section3/FourierCoordinates.lean | 3 +- .../Section4/SpectralDetectorBridge.lean | 2 +- .../Paper/Section5/ICCOrbits.lean | 9 +- .../Paper/Section6/ModuleSemisimple.lean | 4 +- LeanPool/CutAndProject/Basic.lean | 2 +- LeanPool/DemazureOperatorsLean/Demazure.lean | 9 +- LeanPool/Erdos132ConvexK3/Basic.lean | 2 +- .../Erdos132ConvexK3/RegressionWitnesses.lean | 2 +- LeanPool/Erdos132ThreeChain/Basic.lean | 2 +- LeanPool/Erdos132ThreeChain/CaroWei.lean | 2 +- LeanPool/ErdosMoser/Basic.lean | 2 +- .../FactorizationSystems/Orthogonality.lean | 3 +- .../FiniteGraphFundamentalGroup/Proof.lean | 8 +- .../TopologicalComparison.lean | 52 +++++------ .../Theorem/Extended.lean | 3 +- LeanPool/FriezePatterns/Chapter1.lean | 2 +- LeanPool/GapCVP/Part01A.lean | 2 +- LeanPool/Incompleteness/Arith/Theory.lean | 17 +++- .../Arithmetization/Basic/IOpen.lean | 2 +- .../ISigmaOne/Metamath/Formula/Functions.lean | 20 +++- .../Modal/Kripke/SimpleExtension.lean | 3 +- LeanPool/Isoperimetric/PrekopaLeindler.lean | 4 +- LeanPool/JacobianDiffgeo/Abel.lean | 4 +- LeanPool/JacobianDiffgeo/Abel/OfCurveInj.lean | 4 +- .../PeriodLattice/Discreteness.lean | 5 +- LeanPool/Kuramoto/Frontier.lean | 13 +-- LeanPool/LeanBooleanfun/AuxLemmas.lean | 3 +- LeanPool/LeanModelChecking/LTLNBWResult.lean | 2 +- .../LeanModelChecking/LTLNBWStatement.lean | 3 +- LeanPool/MinimumDegreeMatching/BKLO.lean | 2 +- .../MinimumDegreeMatching/BKLOSelection.lean | 2 +- .../Neukirch/HilbertRamificationTheory.lean | 13 ++- LeanPool/PFR/AddCombi/BSG.lean | 2 +- .../PFR/AddCombi/Convolution/Finite/Defs.lean | 4 +- LeanPool/PFR/Endgame.lean | 10 +- .../PFR/ForMathlib/Entropy/RuzsaDist.lean | 29 +++--- .../PFR/ForMathlib/Entropy/RuzsaSetDist.lean | 2 +- LeanPool/PFR/HundredPercent.lean | 2 +- LeanPool/PFR/ImprovedPFR.lean | 8 +- LeanPool/PFR/Kullback.lean | 10 +- LeanPool/PFR/MoreRuzsaDist.lean | 8 +- LeanPool/PFR/MultiTauFunctional.lean | 5 +- LeanPool/PFR/RhoFunctional.lean | 33 +++---- LeanPool/PFR/TauFunctional.lean | 3 +- LeanPool/PFR/TorsionEndgame.lean | 6 +- LeanPool/PFR/WeakPFR.lean | 8 +- LeanPool/PartialRegularity/Extension.lean | 2 +- LeanPool/Rado/Surface/Assembly.lean | 2 +- .../FunctionField/Divisor.lean | 30 ++++-- LeanPool/Sabidussi/LoopMultigraph.lean | 2 +- .../SemicircleLaw/SemicircleDistribution.lean | 3 +- LeanPool/SteinhausThreeGap/Basic.lean | 2 +- LeanPool/SyntheticEuclid4/Axioms.lean | 2 +- LeanPool/ThreeGap/ChevallierGapBound.lean | 2 +- LeanPool/Turan3/Turans3rdProof.lean | 11 ++- LeanPool/VirasoroProject/IndexTri.lean | 2 +- LeanPool/VirasoroProject/LieVerma.lean | 2 +- .../WittAlgebraCohomology.lean | 2 +- LeanPool/Wallace/FullTopology.lean | 2 +- LeanPool/Wallace/Result.lean | 2 +- LeanPool/Wallace/SeparationInterface.lean | 2 +- .../WhiteheadTheorem/CWComplex/Basic.lean | 2 +- .../WhiteheadTheorem/CWComplex/IProd/Def.lean | 24 ++--- .../Compressible/CWComplex.lean | 6 +- scripts/challenge/pins.env | 4 +- 84 files changed, 405 insertions(+), 303 deletions(-) diff --git a/Challenge/McKay.lean b/Challenge/McKay.lean index 2091a94eb7..271db32440 100644 --- a/Challenge/McKay.lean +++ b/Challenge/McKay.lean @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Clawristotle contributors -/ -import Mathlib.Data.Complex.Basic +import Mathlib.Basic.Complex.Basic import Mathlib.GroupTheory.Sylow import Mathlib.RepresentationTheory.Character diff --git a/LeanPool/AharoniKorman/Counterexample.lean b/LeanPool/AharoniKorman/Counterexample.lean index b6ec9a3aec..e4a2b009ef 100644 --- a/LeanPool/AharoniKorman/Counterexample.lean +++ b/LeanPool/AharoniKorman/Counterexample.lean @@ -7,7 +7,7 @@ Authors: Bhavik Mehta import Mathlib.Algebra.Order.Field.Basic import Mathlib.Algebra.Order.Field.Rat import Mathlib.Algebra.Order.Star.Basic -import Mathlib.Data.Countable.Basic +import Mathlib.Basic.Countable.Basic import Mathlib.Data.Setoid.Partition import Mathlib.Order.Filter.AtTopBot.Basic import Mathlib.Order.Interval.Set.Infinite diff --git a/LeanPool/BooleanIsoperimetry/CoherentGap.lean b/LeanPool/BooleanIsoperimetry/CoherentGap.lean index 6c641f6f0b..3e7108893a 100644 --- a/LeanPool/BooleanIsoperimetry/CoherentGap.lean +++ b/LeanPool/BooleanIsoperimetry/CoherentGap.lean @@ -4,8 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Egor Lyfar -/ import Mathlib.Algebra.BigOperators.Fin -import Mathlib.Data.Real.Basic - +import Mathlib.Basic.Real.Basic /-! # Coherent-gap certificates diff --git a/LeanPool/Brouwer/Brouwer.lean b/LeanPool/Brouwer/Brouwer.lean index 238675f6f3..b77725cc1c 100644 --- a/LeanPool/Brouwer/Brouwer.lean +++ b/LeanPool/Brouwer/Brouwer.lean @@ -4,11 +4,11 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Math_XMUM -/ import LeanPool.Brouwer.ScarfPath +import LeanPool.Brouwer.Simplex import Mathlib.Data.PNat.Basic import Mathlib.Order.PiLex import Mathlib.Algebra.BigOperators.Field import Mathlib.Order.Filter.AtTopBot.Archimedean -import Mathlib.Analysis.Convex.StdSimplex import Mathlib.Analysis.Convex.Topology import Mathlib.Topology.MetricSpace.Bounded import Mathlib.Topology.MetricSpace.Sequences @@ -30,6 +30,8 @@ finer and finer subdivisions and passing to a convergent subsequence of the resulting colorful points produces a fixed point. -/ +open Brouwer (standardSimplex) + attribute [local instance] Classical.propDecidable section @@ -68,8 +70,8 @@ instance TT.funlike : FunLike (TT n l) (Fin n) (Fin (l+1)) where variable {n l} in /-- The point of the standard simplex associated to an integer point of `TT n l`. -/ -def TTtostdSimplex (x : TT n l) : stdSimplex ℝ (Fin n) := ⟨fun i => x i / l, by - rw [stdSimplex] +def TTtostdSimplex (x : TT n l) : standardSimplex ℝ (Fin n) := ⟨fun i => x i / l, by + rw [standardSimplex] constructor · intro;simp only[] apply div_nonneg <;> simp @@ -79,7 +81,7 @@ def TTtostdSimplex (x : TT n l) : stdSimplex ℝ (Fin n) := ⟨fun i => x i / l, · exact Iff.mpr Nat.cast_ne_zero (PNat.ne_zero l) ⟩ -instance TT.CoestdSimplex : CoeOut (TT n l) (stdSimplex ℝ (Fin n)) where +instance TT.CoestdSimplex : CoeOut (TT n l) (standardSimplex ℝ (Fin n)) where coe := TTtostdSimplex @@ -352,13 +354,13 @@ theorem size_bound_out (σ : Finset (TT n l)) (C : Finset (Fin n)) (h : TT.ILO.i section Brouwer ---instance stdSimplex.cpt : CompactSpace ↑(stdSimplex ℝ (Fin n)) := inferInstance +--instance stdSimplex.cpt : CompactSpace ↑(standardSimplex ℝ (Fin n)) := inferInstance -variable (f : stdSimplex ℝ (Fin n) → stdSimplex ℝ (Fin n)) +variable (f : standardSimplex ℝ (Fin n) → standardSimplex ℝ (Fin n)) variable {n l} -instance stdSimplex.upidx (x y : stdSimplex ℝ (Fin n)) : Nonempty { i | x.1 i ≤ y.1 i} := by +instance stdSimplex.upidx (x y : standardSimplex ℝ (Fin n)) : Nonempty { i | x.1 i ≤ y.1 i} := by by_contra h push Not at h have sum_x_eq_1 := x.2.2 @@ -375,7 +377,7 @@ instance stdSimplex.upidx (x y : stdSimplex ℝ (Fin n)) : Nonempty { i | x.1 i /-- A chosen index where `x` does not exceed `y`, for two simplex points. -/ -noncomputable def stdSimplex.pick (x y : stdSimplex ℝ (Fin n)) +noncomputable def stdSimplex.pick (x y : standardSimplex ℝ (Fin n)) := Classical.choice <| stdSimplex.upidx x y @@ -485,11 +487,11 @@ abbrev g1 := gpkg f |>.1.2 open Topology open Filter -/- roomSeq ∘ g1 ∘ hpkg.1.2 converge to a point in stdSimplex-/ +/- roomSeq ∘ g1 ∘ hpkg.1.2 converge to a point in standardSimplex-/ -lemma dominant_coords_tend_to_zero (f : stdSimplex ℝ (Fin n) → stdSimplex ℝ (Fin n)) +lemma dominant_coords_tend_to_zero (f : standardSimplex ℝ (Fin n) → standardSimplex ℝ (Fin n)) (C : Finset (Fin n)) (g : ℕ ↪o ℕ) (h_const : ∀ l', (roomSeq f (g l')).1.2 = C) : - ∀ i ∉ C, Filter.Tendsto (fun l' => ((roomPointSeq f (g l')) : stdSimplex ℝ (Fin n)).1 i) + ∀ i ∉ C, Filter.Tendsto (fun l' => ((roomPointSeq f (g l')) : standardSimplex ℝ (Fin n)).1 i) Filter.atTop (𝓝 0) := by intro i hiC have h_tendsto_bound : Filter.Tendsto (fun l' => ((n : ℝ) + 1) / ((g l' : ℝ) + 1)) @@ -507,7 +509,7 @@ lemma dominant_coords_tend_to_zero (f : stdSimplex ℝ (Fin n) → stdSimplex apply tendsto_of_tendsto_of_tendsto_of_le_of_le (tendsto_const_nhds : Tendsto (fun _ : ℕ => (0 : ℝ)) atTop (𝓝 0)) h_tendsto_bound · intro l' - exact ((roomPointSeq f (g l')) : stdSimplex ℝ (Fin n)).2.1 i + exact ((roomPointSeq f (g l')) : standardSimplex ℝ (Fin n)).2.1 i · intro l' let l_pnat : PNat := (g l').succPNat let rs := roomSeq f (g l') @@ -529,11 +531,11 @@ lemma dominant_coords_tend_to_zero (f : stdSimplex ℝ (Fin n) → stdSimplex exact le_of_lt h_bound_real lemma hpkgAux : - Nonempty {(z , h) : (stdSimplex ℝ (Fin n)) × (ℕ → ℕ) | StrictMono h ∧ Filter.Tendsto - ((fun l' => (roomPointSeq f (g1 f l'): stdSimplex ℝ (Fin n))) ∘ h) + Nonempty {(z , h) : (standardSimplex ℝ (Fin n)) × (ℕ → ℕ) | StrictMono h ∧ Filter.Tendsto + ((fun l' => (roomPointSeq f (g1 f l'): standardSimplex ℝ (Fin n))) ∘ h) Filter.atTop (𝓝 z) } := by - let u := fun l' : ℕ => (roomPointSeq f (g1 f l') : stdSimplex ℝ (Fin n)) - have h_compact : IsCompact (Set.univ : Set (stdSimplex ℝ (Fin n))) := isCompact_univ + let u := fun l' : ℕ => (roomPointSeq f (g1 f l') : standardSimplex ℝ (Fin n)) + have h_compact : IsCompact (Set.univ : Set (standardSimplex ℝ (Fin n))) := isCompact_univ have h_in_univ : ∀ n, u n ∈ Set.univ := fun _ => Set.mem_univ _ obtain ⟨z, hz, φ, φ_mono, h_tendsto⟩ := h_compact.tendsto_subseq h_in_univ use ⟨z, φ⟩ @@ -548,18 +550,18 @@ Use -- OrderEmbedding.strictMono: (f : α ↪o β), StrictMono ⇑f -/ -theorem tendsto_diam_to_zero (f : stdSimplex ℝ (Fin n) → stdSimplex ℝ (Fin n)) : +theorem tendsto_diam_to_zero (f : standardSimplex ℝ (Fin n) → standardSimplex ℝ (Fin n)) : Tendsto (fun k => Metric.diam ((((roomSeq f (g1 f ((hpkg f).1.2 k))).1.1.image (fun x => TTtostdSimplex x)) : - Set (stdSimplex ℝ (Fin n))))) + Set (standardSimplex ℝ (Fin n))))) atTop (𝓝 0) := by let l k := g1 f ((hpkg f).1.2 k) let σ k := (roomSeq f (l k)).1.1 let projected_σ k := (σ k).image (fun x => TTtostdSimplex x) - have h_diam_bounded : ∃ (C : ℝ), ∀ k, Metric.diam ((projected_σ k : Set (stdSimplex ℝ (Fin n)))) - ≤ C / (l k + 1) := by + have h_diam_bounded : ∃ (C : ℝ), ∀ k, + Metric.diam ((projected_σ k : Set (standardSimplex ℝ (Fin n)))) ≤ C / (l k + 1) := by use 2 * Real.sqrt (n : ℝ) * ((n : ℝ) + 1) intro k let l_pnat : PNat := (l k).succPNat @@ -620,13 +622,15 @@ theorem tendsto_diam_to_zero (f : stdSimplex ℝ (Fin n) → stdSimplex ℝ (Fin exact tendsto_of_tendsto_of_tendsto_of_le_of_le (tendsto_const_nhds : Tendsto (fun _ => (0:ℝ)) atTop (𝓝 0)) h_C_div_l_tends_to_zero (fun _ => Metric.diam_nonneg) hC_bound -theorem f_coords_ge_z_coords (f : stdSimplex ℝ (Fin n) → stdSimplex ℝ (Fin n)) (hf : Continuous f) : +theorem f_coords_ge_z_coords (f : standardSimplex ℝ (Fin n) → standardSimplex ℝ (Fin n)) + (hf : Continuous f) : ∀ i ∈ (gpkg f).1.1, (f (hpkg f).1.1).1 i ≥ ((hpkg f).1.1).1 i := by let z := (hpkg f).1.1 let C := (gpkg f).1.1 let φ := (hpkg f).1.2 - have convergence_to_z : Filter.Tendsto ((fun l' => (roomPointSeq f (g1 f l'): stdSimplex ℝ - (Fin n))) ∘ φ) Filter.atTop (𝓝 z) := (hpkg f).2.2 + have convergence_to_z : Filter.Tendsto + ((fun l' => (roomPointSeq f (g1 f l') : standardSimplex ℝ (Fin n))) ∘ φ) + Filter.atTop (𝓝 z) := (hpkg f).2.2 have constant_color_set : ∀ l', (roomSeq f (g1 f l')).1.2 = C := (gpkg f).2 intro idx h_idx_C have h_exists_point : ∀ l', ∃ y, @@ -662,27 +666,28 @@ theorem f_coords_ge_z_coords (f : stdSimplex ℝ (Fin n) → stdSimplex ℝ (Fin @Fcolor n l_pnat f chosen_point) = idx := h_spec.2 let l_pnat : PNat := ((g1 f) l').succPNat unfold Fcolor at h_color - have h_pick_property : ∃ h : Nonempty {i | (chosen_point : stdSimplex ℝ (Fin n)).1 i ≤ (f - (chosen_point : stdSimplex ℝ (Fin n))).1 i}, + have h_pick_property : ∃ h : Nonempty + {i | (chosen_point : standardSimplex ℝ (Fin n)).1 i ≤ + (f (chosen_point : standardSimplex ℝ (Fin n))).1 i}, @Classical.choice _ h = idx := by rw [← h_color] - use stdSimplex.upidx (chosen_point : stdSimplex ℝ (Fin n)) - (f (chosen_point : stdSimplex ℝ (Fin n))) + use stdSimplex.upidx (chosen_point : standardSimplex ℝ (Fin n)) + (f (chosen_point : standardSimplex ℝ (Fin n))) rfl obtain ⟨h_nonempty, h_choice_eq⟩ := h_pick_property - have h_mem : idx ∈ {i | (chosen_point : stdSimplex ℝ (Fin n)).1 i ≤ (f (chosen_point : - stdSimplex ℝ (Fin n))).1 i} := by + have h_mem : idx ∈ {i | (chosen_point : standardSimplex ℝ (Fin n)).1 i ≤ (f (chosen_point : + standardSimplex ℝ (Fin n))).1 i} := by rw [← h_choice_eq] exact (Classical.choice h_nonempty).property exact h_mem have y_seq_φ_converges_to_z : Filter.Tendsto (y_seq ∘ φ) Filter.atTop (𝓝 z) := by have h_dist_tends_to_zero : Filter.Tendsto (fun k => dist (y_seq (φ k)) - ((fun l' => (roomPointSeq f (g1 f l') : stdSimplex ℝ (Fin n))) (φ k))) + ((fun l' => (roomPointSeq f (g1 f l') : standardSimplex ℝ (Fin n))) (φ k))) Filter.atTop (𝓝 0) := by have h_bound : ∀ k, dist (y_seq (φ k)) ((roomPointSeq f (g1 f (φ k)) - : stdSimplex ℝ (Fin n))) ≤ + : standardSimplex ℝ (Fin n))) ≤ Metric.diam ((((roomSeq f (g1 f (φ k))).1.1.image (fun x => TTtostdSimplex x)) - : Set (stdSimplex ℝ (Fin n)))) := by + : Set (standardSimplex ℝ (Fin n)))) := by intro k apply Metric.dist_le_diam_of_mem · exact Set.Finite.isBounded (Finset.finite_toSet _) @@ -690,7 +695,7 @@ theorem f_coords_ge_z_coords (f : stdSimplex ℝ (Fin n) → stdSimplex ℝ (Fin · exact Finset.mem_image_of_mem TTtostdSimplex (pickColorfulPoint ((Finset.mem_filter.1 (roomSeq f (g1 f (φ k))).2).2)).2 have h_diam_tendsto : Tendsto (fun k => Metric.diam ((((roomSeq f (g1 f (φ - k))).1.1.image TTtostdSimplex) : Set (stdSimplex ℝ (Fin n))))) atTop (𝓝 0) := by + k))).1.1.image TTtostdSimplex) : Set (standardSimplex ℝ (Fin n))))) atTop (𝓝 0) := by exact tendsto_diam_to_zero f exact tendsto_of_tendsto_of_tendsto_of_le_of_le' tendsto_const_nhds h_diam_tendsto (Eventually.of_forall (fun _ => dist_nonneg)) (Eventually.of_forall h_bound) @@ -701,8 +706,9 @@ theorem f_coords_ge_z_coords (f : stdSimplex ℝ (Fin n) → stdSimplex ℝ (Fin apply (h1.and h2).mono intro k ⟨hk1, hk2⟩ calc dist (y_seq (φ k)) z - ≤ dist (y_seq (φ k)) ((roomPointSeq f (g1 f (φ k)) : stdSimplex ℝ (Fin n))) - + dist ((roomPointSeq f (g1 f (φ k)) : stdSimplex ℝ (Fin n))) z := dist_triangle _ _ _ + ≤ dist (y_seq (φ k)) ((roomPointSeq f (g1 f (φ k)) : standardSimplex ℝ (Fin n))) + + dist ((roomPointSeq f (g1 f (φ k)) : standardSimplex ℝ (Fin n))) z := + dist_triangle _ _ _ _ < ε / 2 + ε / 2 := add_lt_add (by simp only [dist_zero_right, Real.norm_eq_abs, abs_dist] at hk2; exact hk2) hk1 @@ -711,12 +717,12 @@ theorem f_coords_ge_z_coords (f : stdSimplex ℝ (Fin n) → stdSimplex ℝ (Fin exact hf.continuousAt.tendsto.comp y_seq_φ_converges_to_z have f_y_seq_φ_coord_converges : Filter.Tendsto (fun l' => (f (y_seq (φ l'))).1 idx) Filter.atTop (𝓝 ((f z).1 idx)) := by - have h_continuous : Continuous (fun x : stdSimplex ℝ (Fin n) => x.1 idx) := + have h_continuous : Continuous (fun x : standardSimplex ℝ (Fin n) => x.1 idx) := Continuous.comp (continuous_apply idx) continuous_subtype_val exact h_continuous.continuousAt.tendsto.comp f_y_seq_φ_converges_to_f_z have y_seq_φ_coord_converges : Filter.Tendsto (fun l' => (y_seq (φ l')).1 idx) Filter.atTop (𝓝 (z.1 idx)) := by - have h_continuous : Continuous (fun x : stdSimplex ℝ (Fin n) => x.1 idx) := + have h_continuous : Continuous (fun x : standardSimplex ℝ (Fin n) => x.1 idx) := Continuous.comp (continuous_apply idx) continuous_subtype_val exact h_continuous.continuousAt.tendsto.comp y_seq_φ_converges_to_z exact le_of_tendsto_of_tendsto y_seq_φ_coord_converges f_y_seq_φ_coord_converges @@ -728,20 +734,20 @@ theorem Brouwer (hf : Continuous f) : ∃ x , f x = x := by let φ := (hpkg f).1.2 use z have tendsto_diam_to_zero := tendsto_diam_to_zero f - have convergence_to_z : Filter.Tendsto ((fun l' => (roomPointSeq f (g1 f l'): stdSimplex ℝ (Fin - n))) ∘ φ) Filter.atTop (𝓝 z) := + have convergence_to_z : Filter.Tendsto + ((fun l' => (roomPointSeq f (g1 f l') : standardSimplex ℝ (Fin n))) ∘ φ) Filter.atTop (𝓝 z) := (hpkg f).2.2 have constant_color_set : ∀ l', (roomSeq f (g1 f l')).1.2 = C := (gpkg f).2 have coords_outside_C_zero : ∀ i_1 ∉ C, z.1 i_1 = 0 := by intro i_1 hi_not_C - have h_continuous : Continuous (fun x : stdSimplex ℝ (Fin n) => x.1 i_1) := + have h_continuous : Continuous (fun x : standardSimplex ℝ (Fin n) => x.1 i_1) := Continuous.comp (continuous_apply i_1) continuous_subtype_val have h_tendsto_coord_z : Tendsto (fun k => ((roomPointSeq f (g1 f (φ k))) - : stdSimplex ℝ (Fin n)).1 i_1) atTop (𝓝 (z.1 i_1)) := + : standardSimplex ℝ (Fin n)).1 i_1) atTop (𝓝 (z.1 i_1)) := h_continuous.continuousAt.tendsto.comp convergence_to_z have tendsto_zero_subseq : Tendsto (fun k => ((roomPointSeq f (g1 f (φ k))) - : stdSimplex ℝ (Fin n)).1 i_1) atTop (𝓝 0) := + : standardSimplex ℝ (Fin n)).1 i_1) atTop (𝓝 0) := (dominant_coords_tend_to_zero f C (g1 f) constant_color_set i_1 hi_not_C).comp (hpkg f).2.1.tendsto_atTop exact tendsto_nhds_unique h_tendsto_coord_z tendsto_zero_subseq @@ -787,8 +793,7 @@ theorem Brouwer (hf : Continuous f) : ∃ x , f x = x := by ext i_1 by_cases hi : i_1 ∈ C · exact f_coords_eq_z_coords i_1 hi - · change (f z).1 i_1 = z.1 i_1 - rw [f_coords_outside_C_zero i_1 hi, coords_outside_C_zero i_1 hi] + · rw [f_coords_outside_C_zero i_1 hi, coords_outside_C_zero i_1 hi] end Brouwer diff --git a/LeanPool/Brouwer/BrouwerProduct.lean b/LeanPool/Brouwer/BrouwerProduct.lean index 7796d4a478..752fad0072 100644 --- a/LeanPool/Brouwer/BrouwerProduct.lean +++ b/LeanPool/Brouwer/BrouwerProduct.lean @@ -14,6 +14,8 @@ simplex onto the product, so a fixed point of a continuous self-map of the produ is obtained from the single-simplex theorem. -/ +open Brouwer (standardSimplex) + open Filter section Brouwer.ProductRetraction @@ -35,10 +37,10 @@ private lemma card_pos_real (i : I) : 0 < (card i : ℝ) := by norm_cast; exact PNat.pos (card i) /-- The big simplex on `totalCard card` coordinates. -/ -abbrev BigSimplex := stdSimplex ℝ (Fin (totalCard card)) +abbrev BigSimplex := standardSimplex ℝ (Fin (totalCard card)) /-- The product of simplices indexed by `I`. -/ -abbrev ProductSimplices := (i : I) → stdSimplex ℝ (Fin (card i)) +abbrev ProductSimplices := (i : I) → standardSimplex ℝ (Fin (card i)) @@ -68,7 +70,7 @@ lemma index_split_existence (k : Fin (totalCard card)) : ∃ (p : Σ i, Fin (car have i₀_in_S : i₀ ∈ S := WellFounded.min_mem wellFounded_lt S s_nonempty have i₀_is_min : ∀ j < i₀, j ∉ S := fun j hlt => by intro hj - have := WellFounded.min_le wellFounded_lt hj + have := WellFoundedLT.min_le hj exact not_le_of_gt hlt this have h_lt : k.val < prefixSum card i₀ + (card i₀ : ℕ) := by change k.val < (∑ j ∈ Finset.univ.filter (· ≤ i₀), (card j : ℕ)) at i₀_in_S @@ -241,16 +243,16 @@ noncomputable def blockSum (i : I) (x : BigSimplex card) : ℝ := noncomputable def uniformProduct : ProductSimplices card := fun i => (⟨fun _ => (1 : ℝ) / (card i : ℝ), by - simp only [stdSimplex, Set.mem_ofPred_eq] + simp only [standardSimplex, Set.mem_ofPred_eq] constructor · intro _; apply div_nonneg <;> positivity · simp [Finset.sum_const] - ⟩ : stdSimplex ℝ (Fin (card i))) + ⟩ : standardSimplex ℝ (Fin (card i))) /-- The uniform point in the big simplex. -/ noncomputable def zUniform : BigSimplex card := ⟨fun _ => (1 : ℝ) / (totalCard card : ℝ), by - simp only [stdSimplex, Set.mem_ofPred_eq] + simp only [standardSimplex, Set.mem_ofPred_eq] constructor · intro _ apply div_nonneg @@ -276,7 +278,7 @@ noncomputable def tPush (x : BigSimplex card) : ℝ := /-- Convex push of `x` toward `zUniform` by amount `tPush`. -/ noncomputable def pushTowardsZ (x : BigSimplex card) : BigSimplex card := ⟨fun k => (1 - tPush card x) * x.1 k + (tPush card x) * (zUniform card).1 k, by - simp only [stdSimplex, Set.mem_ofPred_eq] + simp only [standardSimplex, Set.mem_ofPred_eq] constructor · intro k; have hx_nonneg : 0 ≤ x.1 k := x.2.1 k @@ -389,7 +391,7 @@ noncomputable def projectToProduct (x : BigSimplex card) : ProductSimplices card let s := blockSum card i y have hspos : 0 < s := blockSum_pushTowardsZ_pos card i x (⟨fun j => y.1 (indexCombine card ⟨i, j⟩) / s, by - simp only [stdSimplex, Set.mem_ofPred_eq] + simp only [standardSimplex, Set.mem_ofPred_eq] constructor · intro j have hy := y.2.1 (indexCombine card ⟨i, j⟩) @@ -402,14 +404,14 @@ noncomputable def projectToProduct (x : BigSimplex card) : ProductSimplices card have hsum : (∑ j : Fin (card i), y.1 (indexCombine card ⟨i, j⟩)) = s := rfl rw [h, hsum] field_simp - ⟩ : stdSimplex ℝ (Fin (card i))) + ⟩ : standardSimplex ℝ (Fin (card i))) /-- Embedding of the product of simplices into the big simplex. -/ noncomputable def embedFromProduct (y : ProductSimplices card) : BigSimplex card := ⟨fun k => let p := indexSplit card k (y p.1).1 p.2 * (card p.1 : ℝ) / (totalCard card : ℝ), by - simp only [stdSimplex, Set.mem_ofPred_eq] + simp only [standardSimplex, Set.mem_ofPred_eq] constructor · intro k let p := indexSplit card k diff --git a/LeanPool/Brouwer/Nash.lean b/LeanPool/Brouwer/Nash.lean index 921a30a0eb..b2e079f768 100644 --- a/LeanPool/Brouwer/Nash.lean +++ b/LeanPool/Brouwer/Nash.lean @@ -16,6 +16,8 @@ simplices, and `ExistsNashEq` derives the existence of a mixed Nash equilibrium every finite game from Brouwer's fixed-point theorem on a product of simplices. -/ +open Brouwer (standardSimplex) + attribute [local instance] Classical.propDecidable open BigOperators open Function @@ -80,7 +82,7 @@ instance {G : FinGame} {i : G.I} : Fintype (G.SS i) := G.FinSS i variable (G) in /-- A mixed strategy profile of a finite game: a simplex point per player. -/ -abbrev mixedS := (i : G.I) → stdSimplex ℝ (G.SS i) +abbrev mixedS := (i : G.I) → standardSimplex ℝ (G.SS i) /-- The expected payoff of player `i` under a mixed strategy profile. -/ def mixedG (i : G.I) (m : Π i, MixedStrategy (G.SS i)) : ℝ := @@ -174,11 +176,11 @@ variable {G : FinGame} variable {n : ℕ} (eI : G.I ≃ Fin n) /-- Reindex a mixed strategy profile along an equivalence `G.I ≃ Fin n`. -/ -def reindex : G.mixedS → ((k : Fin n) → stdSimplex ℝ (G.SS (eI.symm k))) := +def reindex : G.mixedS → ((k : Fin n) → standardSimplex ℝ (G.SS (eI.symm k))) := fun x k => x (eI.symm k) /-- The inverse of `reindex`, transporting along the equivalence. -/ -def reindexInv : ((k : Fin n) → stdSimplex ℝ (G.SS (eI.symm k))) → G.mixedS := +def reindexInv : ((k : Fin n) → standardSimplex ℝ (G.SS (eI.symm k))) → G.mixedS := fun z i => (eI.symm_apply_apply i) ▸ z (eI i) lemma reindex_right_inv : @@ -198,9 +200,9 @@ lemma reindex_right_inv : lemma reindex_left_inv {n : ℕ} (eI : G.I ≃ Fin n) : - let reindex : G.mixedS → ((k : Fin n) → stdSimplex ℝ (G.SS (eI.symm k))) := + let reindex : G.mixedS → ((k : Fin n) → standardSimplex ℝ (G.SS (eI.symm k))) := fun w k => w (eI.symm k) - let reindexInv : ((k : Fin n) → stdSimplex ℝ (G.SS (eI.symm k))) → G.mixedS := + let reindexInv : ((k : Fin n) → standardSimplex ℝ (G.SS (eI.symm k))) → G.mixedS := fun z i => (eI.symm_apply_apply i) ▸ z (eI i) ∀ x, reindexInv (reindex x) = x := by intro reindex reindexInv x; funext i @@ -212,9 +214,9 @@ lemma reindex_left_inv {n : ℕ} (eI : G.I ≃ Fin n) : /-- Lifts an equivalence `e : n ≃ m` to a function between simplices. -/ def mapSimplex {n m : Type*} [Fintype n] [Fintype m] (e : n ≃ m) : - stdSimplex ℝ n → stdSimplex ℝ m := + standardSimplex ℝ n → standardSimplex ℝ m := fun x => ⟨fun i => x.1 (e.symm i), by - simp only [stdSimplex, Set.mem_ofPred_eq] + simp only [standardSimplex, Set.mem_ofPred_eq] constructor · intro i; exact x.2.1 (e.symm i) · have h_sum : ∑ i : m, x.1 (e.symm i) = ∑ j : n, x.1 j := by @@ -224,13 +226,13 @@ def mapSimplex {n m : Type*} [Fintype n] [Fintype m] (e : n ≃ m) : rw [h_sum, x.2.2]⟩ @[simp] -lemma map_simplex_apply {n m : Type*} [Fintype n] [Fintype m] (e : n ≃ m) (x : stdSimplex ℝ n) +lemma map_simplex_apply {n m : Type*} [Fintype n] [Fintype m] (e : n ≃ m) (x : standardSimplex ℝ n) (i : m) : (mapSimplex e x).1 i = x.1 (e.symm i) := rfl /-- The simplex map induced by an equivalence is itself an equivalence. -/ def mapSimplexEquiv {n m : Type*} [Fintype n] [Fintype m] (e : n ≃ m) : - (stdSimplex ℝ n) ≃ (stdSimplex ℝ m) where + (standardSimplex ℝ n) ≃ (standardSimplex ℝ m) where toFun := mapSimplex e invFun := mapSimplex e.symm left_inv x := by @@ -244,7 +246,7 @@ def mapSimplexEquiv {n m : Type*} [Fintype n] [Fintype m] (e : n ≃ m) : /-- Lifts component-wise equivalences to an equivalence on the space of mixed strategies. -/ def mapMixedSEquiv {G : FinGame} (e : (i : G.I) → G.SS i ≃ Fin (Fintype.card (G.SS i))) : - FinGame.mixedS G ≃ ((i : G.I) → stdSimplex ℝ (Fin (Fintype.card (G.SS i)))) where + FinGame.mixedS G ≃ ((i : G.I) → standardSimplex ℝ (Fin (Fintype.card (G.SS i)))) where toFun x i := mapSimplex (e i) (x i) invFun x i := mapSimplex (e i).symm (x i) left_inv x := by @@ -274,18 +276,18 @@ theorem Brouwer.mixedGame (f : G.mixedS → G.mixedS) (hf : Continuous f) : ∃ have : Inhabited (G.SS i) := inferInstance exact Fintype.card_pos_iff.mpr inferInstance let card' : Fin n → ℕ+ := fun k => ⟨Fintype.card (G.SS (eI.symm k)), card_pos (eI.symm k)⟩ - let reindex : G.mixedS → ((k : Fin n) → stdSimplex ℝ (G.SS (eI.symm k))) := + let reindex : G.mixedS → ((k : Fin n) → standardSimplex ℝ (G.SS (eI.symm k))) := fun x k => x (eI.symm k) - let reindexInv : ((k : Fin n) → stdSimplex ℝ (G.SS (eI.symm k))) → G.mixedS := + let reindexInv : ((k : Fin n) → standardSimplex ℝ (G.SS (eI.symm k))) → G.mixedS := fun y i => (eI.symm_apply_apply i) ▸ y (eI i) have reindex_left : ∀ x, reindexInv (reindex x) = x := reindex_left_inv eI have reindex_right : ∀ y, reindex (reindexInv y) = y := reindex_right_inv eI let eS : (k : Fin n) → G.SS (eI.symm k) ≃ Fin (card' k) := fun k => Fintype.equivFin _ - let map_idx : ((k : Fin n) → stdSimplex ℝ (G.SS (eI.symm k))) → ((k : Fin n) - → stdSimplex ℝ (Fin (card' k))) := + let map_idx : ((k : Fin n) → standardSimplex ℝ (G.SS (eI.symm k))) → ((k : Fin n) + → standardSimplex ℝ (Fin (card' k))) := fun y k => mapSimplex (eS k) (y k) - let map_idx_inv : ((k : Fin n) → stdSimplex ℝ (Fin (card' k))) → ((k : Fin n) - → stdSimplex ℝ (G.SS (eI.symm k))) := + let map_idx_inv : ((k : Fin n) → standardSimplex ℝ (Fin (card' k))) → ((k : Fin n) + → standardSimplex ℝ (G.SS (eI.symm k))) := fun z k => mapSimplex (eS k).symm (z k) have map_idx_left : ∀ y, map_idx_inv (map_idx y) = y := by intro y; funext k; ext j @@ -410,8 +412,8 @@ noncomputable def nashMap (σ : G.mixedS) : G.mixedS := lemma cg : Continuous fun a => gFunction (G:=G) i a s := by unfold gFunction apply Continuous.add - · let f : G.mixedS → stdSimplex ℝ (G.SS i) := fun σ => σ i - let g : stdSimplex ℝ (G.SS i) → ℝ := fun a => a s + · let f : G.mixedS → standardSimplex ℝ (G.SS i) := fun σ => σ i + let g : standardSimplex ℝ (G.SS i) → ℝ := fun a => a s have hfg: g ∘ f = fun σ => σ i s := by ext σ; rfl rw [<-hfg] @@ -517,7 +519,7 @@ theorem ExistsNashEq : ∃ σ : G.mixedS , mixedNashEquilibrium σ := by { have h2 : 1 ≠ ∑ b : G.SS i, gFunction i σ b := by intro h2 replace h2 : ∑ b : G.SS i, σ i b = ∑ b : G.SS i, gFunction i σ b := by - simp_all + exact (σ i).2.2.trans h2 unfold gFunction at h2 replace h2 : ∑ s : G.SS i, max 0 (mixedG i (update σ i (stdSimplex.pure s)) - mixedG i σ) = 0 := by diff --git a/LeanPool/Brouwer/ScarfPath.lean b/LeanPool/Brouwer/ScarfPath.lean index 2e5dbae402..8385ba4641 100644 --- a/LeanPool/Brouwer/ScarfPath.lean +++ b/LeanPool/Brouwer/ScarfPath.lean @@ -624,7 +624,7 @@ theorem maximal_component_path_no_escape_of_degree_le_two by_cases hxv : x = v · subst hxv let p' : G.Walk u y := p.concat hxy - have hp' : p'.IsPath := (SimpleGraph.Walk.concat_isPath_iff hxy).2 ⟨hp, hyNot⟩ + have hp' : p'.IsPath := (SimpleGraph.Walk.isPath_concat hxy).2 ⟨hp, hyNot⟩ have hp'_sub : {z : α | z ∈ p'.support} ⊆ component.supp := by intro z hz simp only [SimpleGraph.Walk.support_concat, List.mem_append, List.mem_cons, diff --git a/LeanPool/Brouwer/Simplex.lean b/LeanPool/Brouwer/Simplex.lean index 417d11e1a7..70f8506ffb 100644 --- a/LeanPool/Brouwer/Simplex.lean +++ b/LeanPool/Brouwer/Simplex.lean @@ -3,7 +3,7 @@ Copyright (c) 2026 Math_XMUM. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Math_XMUM -/ -import Mathlib.Analysis.Convex.StdSimplex +import Mathlib.Analysis.Convex.Topology import Mathlib.Algebra.Order.BigOperators.Group.Finset import Mathlib.Algebra.Order.Ring.Defs import Mathlib.Tactic.Push @@ -12,12 +12,43 @@ import Mathlib.Tactic.Common /-! # Mixed strategies on the standard simplex -This file equips `stdSimplex` over a finite type with a `FunLike` coercion and +This file equips `standardSimplex` over a finite type with a `FunLike` coercion and records the basic arithmetic facts about pure strategies and weighted sums used when reasoning about mixed strategies, including the key inequality `wsum_magic_ineq` relating a weighted sum to a uniform bound. -/ +namespace Brouwer + +/-- The standard simplex as a set of coordinate functions. Keeping this representation gives +its points the subspace topology of the finite product used in the fixed-point proof. -/ +def standardSimplex (k α : Type*) [Semiring k] [PartialOrder k] [Fintype α] : Set (α → k) := + {f | (∀ i, 0 ≤ f i) ∧ ∑ i, f i = 1} + +/-- The real standard simplex is a closed subset of the unit cube. -/ +theorem isCompact_standardSimplex (α : Type*) [Fintype α] : + IsCompact (standardSimplex ℝ α) := by + have closed : IsClosed (standardSimplex ℝ α) := by + have description : standardSimplex ℝ α = + (⋂ i, {f : α → ℝ | 0 ≤ f i}) ∩ {f | ∑ i, f i = 1} := by + ext f + simp only [standardSimplex, Set.mem_inter_iff, Set.mem_iInter, Set.mem_ofPred_eq] + rw [description] + exact (isClosed_iInter fun i => isClosed_le continuous_const (continuous_apply i)).inter + (isClosed_eq (by fun_prop) continuous_const) + refine IsCompact.of_isClosed_subset + (isCompact_Icc : IsCompact (Set.Icc (0 : α → ℝ) 1)) closed ?_ + intro f hf + exact ⟨fun i => hf.1 i, fun i => + (Finset.single_le_sum (fun j _ => hf.1 j) (Finset.mem_univ i)).trans_eq hf.2⟩ + +instance (α : Type*) [Fintype α] : CompactSpace (standardSimplex ℝ α) := + isCompact_iff_compactSpace.mp (isCompact_standardSimplex α) + +end Brouwer + +open Brouwer (standardSimplex) + /- We use `MixedStrategy` to denote a mixed strategy over a finite type. -/ variable (α : Type*) [Fintype α] [DecidableEq α] @@ -25,19 +56,19 @@ variable (α : Type*) [Fintype α] [DecidableEq α] namespace stdSimplex variable (k : Type*) [CommRing k] [LinearOrder k] [IsStrictOrderedRing k] (α : Type*) [Fintype α] -instance funlike : FunLike (stdSimplex k α) α k where +instance funlike : FunLike (standardSimplex k α) α k where coe := Subtype.val coe_injective := Subtype.val_injective omit [IsStrictOrderedRing k] in -lemma funlike_eval1 (f : stdSimplex k α) : f = f.val := rfl +lemma funlike_eval1 (f : standardSimplex k α) : f = f.val := rfl omit [IsStrictOrderedRing k] in -lemma funlike_eval2 (f : stdSimplex k α) (x : α) : f.val x = f x := rfl +lemma funlike_eval2 (f : standardSimplex k α) (x : α) : f.val x = f x := rfl variable {k α} in /-- The pure strategy concentrated at `i`, as a point of the standard simplex. -/ -abbrev pure [DecidableEq α] (i : α) : stdSimplex k α := ⟨fun j => if i = j then 1 else 0, +abbrev pure [DecidableEq α] (i : α) : standardSimplex k α := ⟨fun j => if i = j then 1 else 0, by constructor · intro j @@ -58,17 +89,17 @@ lemma pure_eval_neq [DecidableEq α] {i j : α} (h : ¬ i = j) : pure i j = (0 : noncomputable instance SInhabitedOfInhabited [DecidableEq α] [Inhabited α] : - Inhabited (stdSimplex k α) where + Inhabited (standardSimplex k α) where default := pure (default : α) open scoped Classical in noncomputable instance SNonempty_of_Inhabited {α : Type*} [Fintype α] - [Inhabited α] : Nonempty (stdSimplex k α) := - Nonempty.intro (default : stdSimplex k α) + [Inhabited α] : Nonempty (standardSimplex k α) := + Nonempty.intro (default : standardSimplex k α) variable {k α} in lemma wsum_magic_ineq [PosMulMono k] - {σ : stdSimplex k α} {f : α → k} {c : k} : + {σ : standardSimplex k α} {f : α → k} {c : k} : ∑ i : α, (σ i) * f i = c → ∃ i, 0 < σ i ∧ f i ≤ c := by intro H1 by_contra H2 @@ -101,4 +132,4 @@ end stdSimplex /-- The standard simplex over `α` with real coefficients, used as mixed strategies. -/ -abbrev MixedStrategy := stdSimplex ℝ α +abbrev MixedStrategy := standardSimplex ℝ α diff --git a/LeanPool/CencovPetz/Uniform.lean b/LeanPool/CencovPetz/Uniform.lean index 6b2c63b763..ccbef8bc7e 100644 --- a/LeanPool/CencovPetz/Uniform.lean +++ b/LeanPool/CencovPetz/Uniform.lean @@ -5,9 +5,7 @@ Authors: Adam Benenson -/ import Mathlib.Algebra.BigOperators.Group.Finset.Basic import Mathlib.Data.Fintype.Card -import Mathlib.Data.Real.Basic - - +import Mathlib.Basic.Real.Basic /-! # `CencovPetz.Uniform` diff --git a/LeanPool/ChannelCapacity/Counterexample.lean b/LeanPool/ChannelCapacity/Counterexample.lean index 479d80d127..5ee947d0b8 100644 --- a/LeanPool/ChannelCapacity/Counterexample.lean +++ b/LeanPool/ChannelCapacity/Counterexample.lean @@ -4,7 +4,8 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Adam Benenson -/ import LeanPool.ChannelCapacity.Capacity -import Mathlib.MeasureTheory.Measure.Dirac +import Mathlib.MeasureTheory.Measure.Dirac.Def +import Mathlib.MeasureTheory.Measure.Dirac.Basic import Mathlib.Probability.ProbabilityMassFunction.Constructions /-! diff --git a/LeanPool/Chudnovsky/DivisionValues.lean b/LeanPool/Chudnovsky/DivisionValues.lean index 6b77870d41..ca464d0abb 100644 --- a/LeanPool/Chudnovsky/DivisionValues.lean +++ b/LeanPool/Chudnovsky/DivisionValues.lean @@ -135,10 +135,13 @@ private theorem sigma_add_period_aux {ω η : ℂ} (hω : ω ∈ L.lattice) (hω rw [logDeriv_apply, hd.deriv, mul_comm, mul_div_assoc, div_self (Complex.exp_ne_zero _), mul_one] have hlogden : logDeriv den x = η + L.weierstrassZeta x := by - rw [hden, logDeriv_mul (f := fun z ↦ Complex.exp (η * (z + ω / 2))) + change logDeriv ((fun z ↦ Complex.exp (η * (z + ω / 2))) * + L.weierstrassSigma) x = _ + rw [logDeriv_mul (f := fun z ↦ Complex.exp (η * (z + ω / 2))) (g := L.weierstrassSigma) x (Complex.exp_ne_zero _) (L.weierstrassSigma_ne_zero hx) (hexpdiff x) (hσdiff x), hlogexp, L.logDeriv_weierstrassSigma x hx] - rw [hF, logDeriv_div x (hnum_ne x hx) (hden_ne x hx) (hnumdiff x) (hdendiff x), + change logDeriv ((fun z ↦ L.weierstrassSigma (z + ω)) / den) x = 0 + rw [logDeriv_div x (hnum_ne x hx) (hden_ne x hx) (hnumdiff x) (hdendiff x), hlognum, hlogden, hquasi x hx] ring -- hence `deriv F = 0` on `Lᶜ` diff --git a/LeanPool/CompositionAlgebras/Composition/Isomorphisms.lean b/LeanPool/CompositionAlgebras/Composition/Isomorphisms.lean index 51189ec3e8..519e433a3a 100644 --- a/LeanPool/CompositionAlgebras/Composition/Isomorphisms.lean +++ b/LeanPool/CompositionAlgebras/Composition/Isomorphisms.lean @@ -238,8 +238,7 @@ theorem cdQuaternionEquiv_isCompIso : IsCompIso cdQuaternionEquiv where map_mul x y := by change (_ : Octonion) = Octonion.mul _ _ ext i; fin_cases i <;> - simp [Octonion.mul, Quaternion.re_mul, Quaternion.imI_mul, Quaternion.imJ_mul, - Quaternion.imK_mul] <;> ring + simp [Octonion.mul] <;> ring map_nf x := by rw [CD.nf_eq, Octonion.nf_eq, Quaternion.nf_eq, Quaternion.nf_eq] simp [cdQuaternionEquiv_coords] diff --git a/LeanPool/CompositionAlgebras/Octonions.lean b/LeanPool/CompositionAlgebras/Octonions.lean index 717222c17e..a222e33ab8 100644 --- a/LeanPool/CompositionAlgebras/Octonions.lean +++ b/LeanPool/CompositionAlgebras/Octonions.lean @@ -3,7 +3,7 @@ Copyright (c) 2026 Bryan Ehrlich. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Bryan Ehrlich -/ -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic import Mathlib.LinearAlgebra.FiniteDimensional.Defs import Mathlib.Tactic.NormNum diff --git a/LeanPool/ComputableReal/ComputableRSeq.lean b/LeanPool/ComputableReal/ComputableRSeq.lean index 795d05b4c9..67d656d62d 100644 --- a/LeanPool/ComputableReal/ComputableRSeq.lean +++ b/LeanPool/ComputableReal/ComputableRSeq.lean @@ -5,7 +5,7 @@ Authors: Alex Meiburg -/ import Mathlib.Algebra.Order.Interval.Basic import Mathlib.Algebra.Order.Archimedean.Real.Basic -import Mathlib.Data.Sign.Defs +import Mathlib.Basic.Sign.Defs import Mathlib.Tactic.Rify import LeanPool.ComputableReal.AuxLemmas diff --git a/LeanPool/ComputableReal/SpecialFunctions/Basic.lean b/LeanPool/ComputableReal/SpecialFunctions/Basic.lean index 1e6756c9fb..1c6244331f 100644 --- a/LeanPool/ComputableReal/SpecialFunctions/Basic.lean +++ b/LeanPool/ComputableReal/SpecialFunctions/Basic.lean @@ -4,9 +4,8 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Alex Meiburg -/ import LeanPool.ComputableReal.IsComputable -import Mathlib.Data.Real.Sign -import Mathlib.Data.Real.ConjExponents - +import Mathlib.Basic.Real.Sign +import Mathlib.Basic.Real.ConjExponents /-! # `IsComputable` instances for basic real operations diff --git a/LeanPool/ConnesRigidity/Construction/PaperActionInstances.lean b/LeanPool/ConnesRigidity/Construction/PaperActionInstances.lean index a99c9c2428..bb7a420a1f 100644 --- a/LeanPool/ConnesRigidity/Construction/PaperActionInstances.lean +++ b/LeanPool/ConnesRigidity/Construction/PaperActionInstances.lean @@ -50,8 +50,7 @@ def avStarActionHom : H →* (AVStar ≃ₗ[k] AVStar) where map_one' := by apply LinearEquiv.ext intro u - refine TensorProduct.induction_on u ?_ ?_ ?_ - · simp [avStarAction] + refine TensorProduct.inductionOn u ?_ ?_ · intro a f simp [avStarAction] · intro x y hx hy @@ -59,8 +58,7 @@ def avStarActionHom : H →* (AVStar ≃ₗ[k] AVStar) where map_mul' h h' := by apply LinearEquiv.ext intro u - refine TensorProduct.induction_on u ?_ ?_ ?_ - · simp [avStarAction] + refine TensorProduct.inductionOn u ?_ ?_ · intro a f simp [avStarAction] · intro x y hx hy @@ -72,8 +70,7 @@ theorem sl3TensorAction_mul (l m : SpecialLinear.SL3) : (sl3TensorAction l).comp (sl3TensorAction m) := by apply LinearMap.ext intro x - refine TensorProduct.induction_on x ?_ ?_ ?_ - · simp + refine TensorProduct.inductionOn x ?_ ?_ · intro a b simp [sl3TensorAction] · intro x y hx hy @@ -84,8 +81,7 @@ theorem sl3TensorAction_one : sl3TensorAction (1 : SpecialLinear.SL3) = LinearMap.id := by apply LinearMap.ext intro x - refine TensorProduct.induction_on x ?_ ?_ ?_ - · simp + refine TensorProduct.inductionOn x ?_ ?_ · intro a b simp [sl3TensorAction] · intro x y hx hy diff --git a/LeanPool/ConnesRigidity/Paper/Section3/DualCoordinates.lean b/LeanPool/ConnesRigidity/Paper/Section3/DualCoordinates.lean index b08ac11b62..6d77c5470d 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/DualCoordinates.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/DualCoordinates.lean @@ -189,8 +189,7 @@ theorem partialToDual_left_inverse (f : Module.Dual k AVStar) : partialToDual (dualTensorToPartial f) = f := by apply LinearMap.ext intro x - refine TensorProduct.induction_on x ?_ ?_ ?_ - · simp + refine TensorProduct.inductionOn x ?_ ?_ · intro a φ rfl · intro x y hx hy diff --git a/LeanPool/ConnesRigidity/Paper/Section3/DualShearMeasure.lean b/LeanPool/ConnesRigidity/Paper/Section3/DualShearMeasure.lean index 182ca6e99c..6f74e11630 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/DualShearMeasure.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/DualShearMeasure.lean @@ -446,8 +446,7 @@ theorem characterProductHaar_map : characterProductHomeomorph.continuous characterProductHomeomorph.symm.continuous have _ : IsProbabilityMeasure (Measure.map characterProductEquiv μ) := - μ.isProbabilityMeasure_map - characterProductHomeomorph.continuous.measurable.aemeasurable + inferInstance rw [NormalizedHaar.productHaar_eq_normalizedAddHaar] exact NormalizedHaar.normalizedAddHaar_unique _ (Measure.map characterProductEquiv μ) @@ -521,8 +520,7 @@ theorem coordinateHaar_map : coordinateProductHomeomorph.continuous coordinateProductHomeomorph.symm.continuous have _ : IsProbabilityMeasure (Measure.map coordinateProductEquiv μ) := - μ.isProbabilityMeasure_map - coordinateProductHomeomorph.continuous.measurable.aemeasurable + inferInstance rw [NormalizedHaar.productHaar_eq_normalizedAddHaar] exact NormalizedHaar.normalizedAddHaar_unique _ (Measure.map coordinateProductEquiv μ) diff --git a/LeanPool/ConnesRigidity/Paper/Section3/DualTopology.lean b/LeanPool/ConnesRigidity/Paper/Section3/DualTopology.lean index b2606c5110..d7e0714ceb 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/DualTopology.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/DualTopology.lean @@ -162,9 +162,7 @@ theorem continuous_character_quadratic_eval (c : PaperKernel.C) : exact (character_coordinate_eval χ a i).symm have hq : ∀ x : TensorAA, Continuous (fun χ => qfun (zfun χ) x) := by intro x - refine TensorProduct.induction_on x ?_ ?_ ?_ - · simpa [qfun] using - (continuous_const : Continuous (fun _ : CharacterSpace => (0 : k))) + refine TensorProduct.inductionOn x ?_ ?_ · intro a b dsimp [qfun] have h := ((hcoord a (Sum.inl 0)).mul (hcoord b (Sum.inr 0))).add diff --git a/LeanPool/ConnesRigidity/Paper/Section3/FourierCoordinates.lean b/LeanPool/ConnesRigidity/Paper/Section3/FourierCoordinates.lean index c2d19d4813..50ee4360df 100644 --- a/LeanPool/ConnesRigidity/Paper/Section3/FourierCoordinates.lean +++ b/LeanPool/ConnesRigidity/Paper/Section3/FourierCoordinates.lean @@ -86,8 +86,7 @@ theorem characterCoordinates_measurePreserving : characterCoordinatesHomeomorph.symm.continuous have _ : IsProbabilityMeasure (Measure.map characterCoordinatesMeasurableEquiv μ) := - μ.isProbabilityMeasure_map - characterCoordinatesHomeomorph.continuous.measurable.aemeasurable + inferInstance refine ⟨characterCoordinatesMeasurableEquiv.measurable, ?_⟩ change Measure.map characterCoordinatesMeasurableEquiv μ = coordinatesHaar unfold coordinatesHaar diff --git a/LeanPool/ConnesRigidity/Paper/Section4/SpectralDetectorBridge.lean b/LeanPool/ConnesRigidity/Paper/Section4/SpectralDetectorBridge.lean index 50257fadb3..8aa6073ad6 100644 --- a/LeanPool/ConnesRigidity/Paper/Section4/SpectralDetectorBridge.lean +++ b/LeanPool/ConnesRigidity/Paper/Section4/SpectralDetectorBridge.lean @@ -70,7 +70,7 @@ The `paperMeasureOfRaw` construction used in the Connes rigidity formalization. -/ def paperMeasureOfRaw (μ : ProbabilityMeasure Raw) : ProbabilityMeasure Paper := - μ.map rawToPaper_measurable.aemeasurable + μ.map rawToPaper /- The two definitions of the dual action agree under the type-tag equivalence. Paper: §4. -/ theorem raw_action_to_paper diff --git a/LeanPool/ConnesRigidity/Paper/Section5/ICCOrbits.lean b/LeanPool/ConnesRigidity/Paper/Section5/ICCOrbits.lean index 44d246045f..42c07e2131 100644 --- a/LeanPool/ConnesRigidity/Paper/Section5/ICCOrbits.lean +++ b/LeanPool/ConnesRigidity/Paper/Section5/ICCOrbits.lean @@ -37,8 +37,7 @@ lemma paper_avStar_coeff_sl3 (s : SpecialLinear.SL3) (u : PaperKernel.AVStar) (avStarAction s (1 : PaperKernel.Q) u)) i = sl3AAction s ((TensorProduct.equivFinsuppOfBasisRight paperVStarBasis u) i) := by - refine TensorProduct.induction_on u ?_ ?_ ?_ - · simp + refine TensorProduct.inductionOn u ?_ ?_ · intro a f simp [avStarAction, paperVStarBasis] · intro x y hx hy @@ -144,8 +143,7 @@ lemma paperContractRight_basisCoord (p : PaperKernel.OrderedBasisIndex) (x : PaperKernel.TensorAA) : paperContractRight (PaperKernel.orderedBasis.coord p) x = (TensorProduct.equivFinsuppOfBasisRight PaperKernel.orderedBasis x) p := by - induction x using TensorProduct.induction_on with - | zero => simp + induction x using TensorProduct.inductionOn with | tmul a b => simp [Module.Basis.coord_apply] | add x y hx hy => @@ -164,8 +162,7 @@ lemma paperContractRight_equivariant (sl3AAction (Matrix.SpecialLinearGroup.transvection hij a) b) = φ b := by intro b exact paper_ordered_coord_transvection_invariant hij (Ne.symm hr) a b - induction x using TensorProduct.induction_on with - | zero => simp [paperContractRight] + induction x using TensorProduct.inductionOn with | tmul u v => have hv := hφ v change (orderedBasis.repr diff --git a/LeanPool/ConnesRigidity/Paper/Section6/ModuleSemisimple.lean b/LeanPool/ConnesRigidity/Paper/Section6/ModuleSemisimple.lean index f422138045..7e9cc5c6d9 100644 --- a/LeanPool/ConnesRigidity/Paper/Section6/ModuleSemisimple.lean +++ b/LeanPool/ConnesRigidity/Paper/Section6/ModuleSemisimple.lean @@ -209,9 +209,7 @@ def tensorDirectSumEquiv : AV ≃ₗ[k] DS := theorem tensorDirectSumEquiv_intertwines (q : Q) (x : AV) : tensorDirectSumEquiv (avStarRepresentation q x) = directSumRepresentation q (tensorDirectSumEquiv x) := by - refine TensorProduct.induction_on x ?_ ?_ ?_ - · simp [tensorDirectSumEquiv, avStarRepresentation, - directSumRepresentation] + refine TensorProduct.inductionOn x ?_ ?_ · intro a f apply DirectSum.ext intro i diff --git a/LeanPool/CutAndProject/Basic.lean b/LeanPool/CutAndProject/Basic.lean index d95e743637..81c54a7431 100644 --- a/LeanPool/CutAndProject/Basic.lean +++ b/LeanPool/CutAndProject/Basic.lean @@ -8,7 +8,7 @@ import Mathlib.Algebra.BigOperators.Ring.Finset import Mathlib.Algebra.Order.Floor.Defs import Mathlib.Analysis.SpecialFunctions.Pow.Real import Mathlib.Data.Int.CardIntervalMod -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic import Mathlib.Data.ZMod.Basic import Mathlib.GroupTheory.OrderOfElement import Mathlib.Tactic.FieldSimp diff --git a/LeanPool/DemazureOperatorsLean/Demazure.lean b/LeanPool/DemazureOperatorsLean/Demazure.lean index 60753a1a73..2c33ecb08e 100644 --- a/LeanPool/DemazureOperatorsLean/Demazure.lean +++ b/LeanPool/DemazureOperatorsLean/Demazure.lean @@ -4,13 +4,16 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Óscar Álvarez Sánchez -/ -import Mathlib.Data.Set.Lattice +import Mathlib.Data.Set.Lattice.Bounded +import Mathlib.Data.Set.Lattice.Disjoint +import Mathlib.Data.Set.Lattice.Image +import Mathlib.Data.Set.Lattice.Indexed +import Mathlib.Data.Set.Lattice.Order import Mathlib.Data.Set.Function import Mathlib.Analysis.Complex.Polynomial.Basic import Init.System.IO -import Mathlib.Data.Complex.Basic - +import Mathlib.Basic.Complex.Basic import Mathlib.Algebra.Polynomial.Basic import Mathlib.Algebra.MvPolynomial.Basic import Mathlib.Algebra.MvPolynomial.CommRing diff --git a/LeanPool/Erdos132ConvexK3/Basic.lean b/LeanPool/Erdos132ConvexK3/Basic.lean index 61bfe3ad37..27877c0176 100644 --- a/LeanPool/Erdos132ConvexK3/Basic.lean +++ b/LeanPool/Erdos132ConvexK3/Basic.lean @@ -6,7 +6,7 @@ Authors: Egor Lyfar import Mathlib.Combinatorics.SimpleGraph.Basic import Mathlib.Data.Finset.Card import Mathlib.Data.List.FinRange -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic import Mathlib.Tactic.Linarith import Mathlib.Tactic.Ring diff --git a/LeanPool/Erdos132ConvexK3/RegressionWitnesses.lean b/LeanPool/Erdos132ConvexK3/RegressionWitnesses.lean index 8902a8dff4..2ad1ec8db5 100644 --- a/LeanPool/Erdos132ConvexK3/RegressionWitnesses.lean +++ b/LeanPool/Erdos132ConvexK3/RegressionWitnesses.lean @@ -67,7 +67,7 @@ theorem heptagon_x_degree : vertexDegree heptagon 7225 6649 5353 0 = 5 := by ({2, 3, 4, 5, 6} : Finset (Fin 7)).card := by apply vertexDegree_eq_of_neighbors intro j - fin_cases j <;> norm_num [heptagon, sqDist] <;> decide + fin_cases j <;> norm_num [heptagon, sqDist] _ = 5 := by decide /-- Attempt 3's exact nine-point low-altitude insertion witness. -/ diff --git a/LeanPool/Erdos132ThreeChain/Basic.lean b/LeanPool/Erdos132ThreeChain/Basic.lean index 0bed03a21e..f0c2e2b6e6 100644 --- a/LeanPool/Erdos132ThreeChain/Basic.lean +++ b/LeanPool/Erdos132ThreeChain/Basic.lean @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Egor Lyfar -/ -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic import Mathlib.Tactic.Linarith import Mathlib.Tactic.Positivity import Mathlib.Tactic.Ring diff --git a/LeanPool/Erdos132ThreeChain/CaroWei.lean b/LeanPool/Erdos132ThreeChain/CaroWei.lean index d280ceb2e6..95a0eafce8 100644 --- a/LeanPool/Erdos132ThreeChain/CaroWei.lean +++ b/LeanPool/Erdos132ThreeChain/CaroWei.lean @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Egor Lyfar -/ -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic import Mathlib.Data.Finset.Max import Mathlib.Algebra.Order.BigOperators.Group.Finset import Mathlib.Algebra.BigOperators.Field diff --git a/LeanPool/ErdosMoser/Basic.lean b/LeanPool/ErdosMoser/Basic.lean index ab43080671..384844863f 100644 --- a/LeanPool/ErdosMoser/Basic.lean +++ b/LeanPool/ErdosMoser/Basic.lean @@ -12,7 +12,7 @@ import Mathlib.Algebra.Order.BigOperators.Group.Finset import Mathlib.Data.Finset.Card import Mathlib.Data.Finset.Max import Mathlib.Data.Finset.Powerset -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic import Mathlib.Tactic.NormNum /-! diff --git a/LeanPool/FactorizationSystems/Orthogonality.lean b/LeanPool/FactorizationSystems/Orthogonality.lean index 8c5012d22e..7bc9655f93 100644 --- a/LeanPool/FactorizationSystems/Orthogonality.lean +++ b/LeanPool/FactorizationSystems/Orthogonality.lean @@ -12,8 +12,7 @@ import Mathlib.CategoryTheory.Limits.Types.Pullbacks import Mathlib.CategoryTheory.Limits.IsLimit import Mathlib.CategoryTheory.Iso import Mathlib.CategoryTheory.Types.Basic -import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts - +import Mathlib.CategoryTheory.Limits.Shapes.BinaryProducts.ProdComparison /-! # LeanPool.FactorizationSystems.Orthogonality -/ diff --git a/LeanPool/FiniteGraphFundamentalGroup/Proof.lean b/LeanPool/FiniteGraphFundamentalGroup/Proof.lean index c63ee45e98..d5caa2a06d 100644 --- a/LeanPool/FiniteGraphFundamentalGroup/Proof.lean +++ b/LeanPool/FiniteGraphFundamentalGroup/Proof.lean @@ -176,7 +176,7 @@ lemma no_reverse_edges (T : WideSubquiver (Symmetrify V)) [Arborescence T] def symEdgeForget (T : WideSubquiver (Symmetrify V)) (e : Quiver.Total T) : Quiver.Total (wideSubquiverSymmetrify T) := by rcases e with ⟨a, b, ⟨f, hf⟩⟩ - cases f with + cases f using Sum.casesOn with | inl f => exact ⟨a, b, ⟨f, Or.inl hf⟩⟩ | inr f => exact ⟨b, a, ⟨f, Or.inr hf⟩⟩ @@ -193,7 +193,7 @@ lemma symEdgeForgetInv_forget (T : WideSubquiver (Symmetrify V)) [Arborescence T (e : Quiver.Total T) : symEdgeForgetInv T (symEdgeForget T e) = e := by rcases e with ⟨a, b, ⟨f, hf⟩⟩ change V at a b - cases f with + cases f using Sum.casesOn with | inl f => simp only [symEdgeForget, symEdgeForgetInv] exact dite_eq_left hf @@ -214,14 +214,14 @@ lemma symEdgeForget_forgetInv (T : WideSubquiver (Symmetrify V)) simp only [symEdgeForgetInv] exact dite_eq_left h rw [hinv] - simp [symEdgeForget] + rfl · have h' := hf.resolve_left h have hinv : symEdgeForgetInv T ⟨a, b, ⟨f, hf⟩⟩ = ⟨b, a, ⟨Sum.inr f, h'⟩⟩ := by simp only [symEdgeForgetInv] exact dite_eq_right h rw [hinv] - simp [symEdgeForget] + rfl /-- Equates oriented tree edges with the underlying edges of the symmetrified subquiver. -/ def symEdgeEquiv (T : WideSubquiver (Symmetrify V)) [Arborescence T] : diff --git a/LeanPool/FiniteGraphFundamentalGroup/TopologicalComparison.lean b/LeanPool/FiniteGraphFundamentalGroup/TopologicalComparison.lean index 9a17156365..6e054351dc 100644 --- a/LeanPool/FiniteGraphFundamentalGroup/TopologicalComparison.lean +++ b/LeanPool/FiniteGraphFundamentalGroup/TopologicalComparison.lean @@ -65,7 +65,7 @@ theorem graphCoverSymmetricFreeGroupoidMap_endpoint {root : V} (y : graphCoverVertex root).2 ≫ (graphCoverSymmetricFreeGroupoidMap root).map e := by change graphCoverVertex root at y z - cases e with + cases e using Sum.casesOn with | inl e => exact e.property.symm | inr e => @@ -104,7 +104,7 @@ theorem coverSymPathValue_eq_baseSymPathValue {root : V} | nil => rfl | cons p e ih => rw [coverSymPathValue_cons, ih] - cases e <;> rfl + cases e using Sum.casesOn <;> rfl /-- Sends every graph edge to its generator in the free group on total edges. -/ def graphFreeGroupPrefunctor {V : Type u} [Quiver.{u} V] : V ⥤q CategoryTheory.SingleObj (FreeGroup (Quiver.Total V)) where @@ -126,7 +126,7 @@ def coverSymEdgeLetter {root : V} (e : @Quiver.Hom (Symmetrify (graphCoverVertex root)) (Quiver.symmetrifyQuiver (graphCoverVertex root)) a b) : Quiver.Total V × Bool := by - cases e with + cases e using Sum.casesOn with | inl e => exact (⟨_, _, e.1⟩, true) | inr e => exact (⟨_, _, e.1⟩, false) @@ -211,9 +211,9 @@ theorem coverSymEdgeLetter_cancel {root : V} (⟨b, c, e⟩ : Quiver.Total (Symmetrify (graphCoverVertex root))) = ⟨b, a, Quiver.reverse f⟩ := by change graphCoverVertex root at a b c - cases e with + cases e using Sum.casesOn with | inl e => - cases f with + cases f using Sum.casesOn with | inl f => simp [coverSymEdgeLetter] at hbool | inr f => have htot : @@ -228,7 +228,7 @@ theorem coverSymEdgeLetter_cancel {root : V} cases htotal rfl | inr e => - cases f with + cases f using Sum.casesOn with | inr f => simp [coverSymEdgeLetter] at hbool | inl f => have htot : @@ -324,7 +324,7 @@ theorem coverFreeGroupMap_letter {root : V} singleObjHomValue ((graphFreeGroupoidToFreeGroup (V := V)).map ((graphCoverSymmetricFreeGroupoidMap root).map e)) = FreeGroup.mk [coverSymEdgeLetter e] := by - cases e with + cases e using Sum.casesOn with | inl e => rw [graphCoverSymmetricFreeGroupoidMap_map_pos] have h := graphFreeGroupoidToFreeGroup_map_pos @@ -399,9 +399,9 @@ theorem coverSymEdge_star_eq_of_letter_eq {root : V} (h : coverSymEdgeLetter e = coverSymEdgeLetter f) : (⟨b, e⟩ : Quiver.Star a) = ⟨c, f⟩ := by change graphCoverVertex root at a b c - cases e with + cases e using Sum.casesOn with | inl e => - cases f with + cases f using Sum.casesOn with | inl f => have htot : (⟨a.1, b.1, e.1⟩ : Quiver.Total V) = @@ -414,7 +414,7 @@ theorem coverSymEdge_star_eq_of_letter_eq {root : V} rfl | inr f => simp [coverSymEdgeLetter] at h | inr e => - cases f with + cases f using Sum.casesOn with | inl f => simp [coverSymEdgeLetter] at h | inr f => have htot : @@ -761,7 +761,7 @@ def graphCoverTreeEdgeBase {V : Type u} [Quiver.{u} V] Quiver.Total (graphCoverVertex root) := by rcases d with ⟨a, b, ⟨f, hf⟩⟩ change graphCoverVertex root at a b - cases f with + cases f using Sum.casesOn with | inl e => exact ⟨a, b, e⟩ | inr e => exact ⟨b, a, e⟩ @@ -769,7 +769,7 @@ def graphCoverTreeEdgeBase {V : Type u} [Quiver.{u} V] def graphCoverTreeEdgeSign {V : Type u} [Quiver.{u} V] (root : V) (d : Quiver.Total (graphCoverSymmetricTree root)) : Bool := by - cases d.hom.1 with + cases d.hom.1 using Sum.casesOn with | inl _ => exact true | inr _ => exact false @@ -840,7 +840,7 @@ def graphCoverTreeFoldCoordinate {V : Type u} [Quiver.{u} V] (d : Quiver.Total (graphCoverSymmetricTree root)) : C(I, I) := by rcases d with ⟨a, b, ⟨f, hf⟩⟩ change graphCoverVertex root at a b - cases f with + cases f using Sum.casesOn with | inl _ => exact ContinuousMap.id I | inr _ => exact graphRealizationIntervalSymm @@ -866,7 +866,7 @@ theorem graphCoverTreeFold_h0 {V : Type u} [Quiver.{u} V] graphVertex (graphCoverTreeVertexForget root d.left) := by rcases d with ⟨a, b, ⟨f, hf⟩⟩ change graphCoverVertex root at a b - cases f with + cases f using Sum.casesOn with | inl e => change graphEdgePath (⟨a, b, e⟩ : Quiver.Total (graphCoverVertex root)) 0 = graphVertex (graphCoverTreeVertexForget root a) @@ -889,7 +889,7 @@ theorem graphCoverTreeFold_h1 {V : Type u} [Quiver.{u} V] graphVertex (graphCoverTreeVertexForget root d.right) := by rcases d with ⟨a, b, ⟨f, hf⟩⟩ change graphCoverVertex root at a b - cases f with + cases f using Sum.casesOn with | inl e => change graphEdgePath (⟨a, b, e⟩ : Quiver.Total (graphCoverVertex root)) 1 = graphVertex (graphCoverTreeVertexForget root b) @@ -977,7 +977,7 @@ theorem graphCoverSection_h0 {V : Type u} [Quiver.{u} V] rw [hd] rcases d with ⟨a, b, ⟨f, hf⟩⟩ change graphCoverVertex root at a b - cases f with + cases f using Sum.casesOn with | inl f => change graphEdgePath (⟨a, b, ⟨Sum.inl f, hf⟩⟩ : @@ -1022,7 +1022,7 @@ theorem graphCoverSection_h1 {V : Type u} [Quiver.{u} V] rw [hd] rcases d with ⟨a, b, ⟨f, hf⟩⟩ change graphCoverVertex root at a b - cases f with + cases f using Sum.casesOn with | inl f => change graphEdgePath (⟨a, b, ⟨Sum.inl f, hf⟩⟩ : @@ -1092,7 +1092,7 @@ theorem graphRealization_map_ext {U W : Type u} [Quiver.{u} U] [Quiver.{u} W] funext x refine Quotient.inductionOn x ?_ intro x - cases x with + cases x using Sum.casesOn with | inl v => exact hv (graphVertexUnderlying v) | inr z => rcases z with ⟨e, t⟩ @@ -1126,7 +1126,7 @@ theorem graphCoverTreeToCover_comp_graphCoverToTree rw [hd] rcases d with ⟨a, b, ⟨f, hf⟩⟩ change graphCoverVertex root at a b - cases f with + cases f using Sum.casesOn with | inl f => change graphEdgePath (⟨a, b, f⟩ : Quiver.Total (graphCoverVertex root)) @@ -1161,9 +1161,9 @@ theorem graphCoverTreeEdgeBase_injective rcases d₁ with ⟨a, b, ⟨f, hf⟩⟩ rcases d₂ with ⟨c, d, ⟨g, hg⟩⟩ change graphCoverVertex root at a b c d - cases f with + cases f using Sum.casesOn with | inl f => - cases g with + cases g using Sum.casesOn with | inl g => have htotal : (⟨a, b, f⟩ : Quiver.Total (graphCoverVertex root)) = ⟨c, d, g⟩ := by @@ -1184,7 +1184,7 @@ theorem graphCoverTreeEdgeBase_injective exact False.elim (no_reverse_edges (graphCoverSymmetricTree root) f hf hg) | inr f => - cases g with + cases g using Sum.casesOn with | inl g => have htotal : (⟨b, a, f⟩ : Quiver.Total (graphCoverVertex root)) = ⟨c, d, g⟩ := by @@ -1230,7 +1230,7 @@ theorem graphCoverToTree_comp_graphCoverTreeToCover rw [hchoice] rcases d with ⟨a, b, ⟨f, hf⟩⟩ change graphCoverVertex root at a b - cases f with + cases f using Sum.casesOn with | inl f => dsimp [graphCoverSectionCoordinate, graphCoverTreeFoldCoordinate] change graphEdgePath @@ -1322,7 +1322,7 @@ theorem graphFreeGroupoidToTopological_map_path {V : Type u} [Quiver.{u} V] (@graphRealizationQuiverPath V _ _ _ p)) := by exact ih rw [ih'] - cases e with + cases e using Sum.casesOn with | inl e => rfl | inr e => @@ -1337,7 +1337,7 @@ theorem graphCoverRealization_fiber_vertex revert hz refine Quotient.inductionOn z ?_ intro z hz - cases z with + cases z using Sum.casesOn with | inl v => let x : graphCoverVertex root := graphVertexUnderlying v have hzx : graphRealizationQuotient (Sum.inl v) = graphVertex x := by @@ -1407,7 +1407,7 @@ theorem graphCoverRealizationQuiverPath_map (@Quiver.Path.cons (Symmetrify (graphCoverVertex root)) (Quiver.symmetrifyQuiver (graphCoverVertex root)) _ _ _ p e)) rw [Prefunctor.mapPath_cons, Path.map_trans, ih] - cases e with + cases e using Sum.casesOn with | inl e => rfl | inr e => diff --git a/LeanPool/FormalLearningTheory/Theorem/Extended.lean b/LeanPool/FormalLearningTheory/Theorem/Extended.lean index 05971c355a..4e4f394ed3 100644 --- a/LeanPool/FormalLearningTheory/Theorem/Extended.lean +++ b/LeanPool/FormalLearningTheory/Theorem/Extended.lean @@ -487,7 +487,8 @@ private lemma adviceBadVal_measurable {X : Type u} [MeasurableSpace X] exact measurableSet_eq_fun h_eval_j h_c_j · exact measurable_const · exact measurable_const - exact (h_trueR.sub h_empR).abs measurableSet_Ici + simpa only [Real.norm_eq_abs, Pi.sub_apply, Set.preimage, Set.mem_Ici] using + (h_trueR.sub h_empR).norm measurableSet_Ici private theorem adviceGoodPair_subset_success {X : Type u} [MeasurableSpace X] {A : Type*} [Fintype A] [Nonempty A] diff --git a/LeanPool/FriezePatterns/Chapter1.lean b/LeanPool/FriezePatterns/Chapter1.lean index 4f3fc3ce2c..f986a41655 100644 --- a/LeanPool/FriezePatterns/Chapter1.lean +++ b/LeanPool/FriezePatterns/Chapter1.lean @@ -5,7 +5,7 @@ Authors: Antoine de Saint-Germain, Akselai, Jon Cheah, Bockman Cheung, Eaton Liu -/ import Mathlib.Algebra.Field.Basic -import Mathlib.Data.Finite.Prod +import Mathlib.Basic.Finite.Prod import Mathlib.Data.Nat.Basic import Mathlib.Data.Set.Finite.Range import Mathlib.Tactic.Cases diff --git a/LeanPool/GapCVP/Part01A.lean b/LeanPool/GapCVP/Part01A.lean index 44d6b5bbe5..7c7c3ad533 100644 --- a/LeanPool/GapCVP/Part01A.lean +++ b/LeanPool/GapCVP/Part01A.lean @@ -201,7 +201,7 @@ private theorem isClosed_of_subset_euclidean_integer_grid Submodule.span ℤ (Set.range b) have hclosed : IsClosed (G : Set (EuclideanSpace ℝ (Fin n))) := by change IsClosed (G.toAddSubgroup : Set (EuclideanSpace ℝ (Fin n))) - exact AddSubgroup.isClosed_of_discrete + exact AddSubgroup.isClosed_of_discreteTopology have hsub' : s ⊆ (G : Set (EuclideanSpace ℝ (Fin n))) := hsub let inside : Set G := ((↑) : G → EuclideanSpace ℝ (Fin n)) ⁻¹' s have hinside : IsClosed inside := isClosed_discrete inside diff --git a/LeanPool/Incompleteness/Arith/Theory.lean b/LeanPool/Incompleteness/Arith/Theory.lean index 093306c658..7e58286147 100644 --- a/LeanPool/Incompleteness/Arith/Theory.lean +++ b/LeanPool/Incompleteness/Arith/Theory.lean @@ -732,9 +732,22 @@ variable (T) def _root_.LO.FirstOrder.Theory.provableₐ : Sg1.Semisentence 1 := .mkSigma “p. !(T + 𝐑₀').tDef.prv p” (by simp) +-- Keep the substitution proof generic so kernel checking does not expand the provability formula. +omit [V ⊧ₘ* 𝐈Sg1] in +private lemma predicate_defined_identity_substitution (φ : Sg1.Semisentence 1) (P : V → Prop) + (h : Sg1-Predicate P via φ) : + Sg1-Predicate P via (.mkSigma “p. !φ p” (by simp)) := by + intro v + have hv : (fun _ : Fin 1 => v 0) = v := by + funext i + have hi : i = 0 := Fin.eq_zero i + subst i + rfl + simpa [hv] using h v + lemma provableₐ_defined : Sg1-Predicate (T.Provableₐ : V → Prop) via T.provableₐ := by - intro v; simp [FirstOrder.Theory.provableₐ, FirstOrder.Theory.Provableₐ, - ((T + 𝐑₀').codeIn V).provable_defined.df.iff] + exact predicate_defined_identity_substitution (T + 𝐑₀').tDef.prv + ((T + 𝐑₀').codeIn V).Provable ((T + 𝐑₀').codeIn V).provable_defined @[simp] lemma eval_provableₐ (v) : Semiformula.Evalbm V v T.provableₐ.val ↔ T.Provableₐ (v 0) := (provableₐ_defined T).df.iff v diff --git a/LeanPool/Incompleteness/Arithmetization/Basic/IOpen.lean b/LeanPool/Incompleteness/Arithmetization/Basic/IOpen.lean index ca27b84f2e..06223393cf 100644 --- a/LeanPool/Incompleteness/Arithmetization/Basic/IOpen.lean +++ b/LeanPool/Incompleteness/Arithmetization/Basic/IOpen.lean @@ -5,7 +5,7 @@ Authors: Palalansoukî -/ import LeanPool.Incompleteness.Arithmetization.Basic.Ind -import Mathlib.Logic.Nonempty +import Mathlib.Basic.Nonempty /-! # IOpen -/ diff --git a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Functions.lean b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Functions.lean index 0ed011131c..bd62faefd9 100644 --- a/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Functions.lean +++ b/LeanPool/Incompleteness/Arithmetization/ISigmaOne/Metamath/Formula/Functions.lean @@ -474,6 +474,22 @@ def blueprint (pL : LDef) : Language.UformulaRec1.Blueprint pL where variable (L) +-- Prove identity substitution before instantiating the large formula, avoiding its repeated +-- expansion when the kernel checks the construction's two parameter-change proof fields. +omit [V ⊧ₘ* 𝐈Sg1] in +private lemma defined_identity_substitution (φ : Sg1.Semisentence 2) (f : V → V) + (h : Sg1-Function₁ f via φ) : + Sg1-Function₁ f via (.mkSigma “y param. !φ y param” (by simp)) := by + intro v + have hv : (fun i : Fin 2 => + Semiterm.val (standardModel V) v Empty.elim (![#0, #1] i)) = v := by + funext i + refine Fin.cases rfl (fun i => ?_) i + have hi : i = 0 := Fin.eq_zero i + subst i + rfl + simpa [hv] using h v + /-- Imported declaration from the Incompleteness formalization. -/ def construction : Language.UformulaRec1.Construction V L (blueprint pL) where rel (param) := fun k R v ↦ ^rel k R (L.termSubstVec k param v) @@ -494,8 +510,8 @@ def construction : Language.UformulaRec1.Construction V L (blueprint pL) where or_defined := by intro v; simp [blueprint] all_defined := by intro v; simp [blueprint] ex_defined := by intro v; simp [blueprint] - allChanges_defined := by intro v; simp [blueprint, L.qVec_defined.df.iff] - exChanges_defined := by intro v; simp [blueprint, L.qVec_defined.df.iff] + allChanges_defined := defined_identity_substitution pL.qVecDef L.qVec L.qVec_defined + exChanges_defined := defined_identity_substitution pL.qVecDef L.qVec L.qVec_defined end Substs diff --git a/LeanPool/Incompleteness/Foundation/Modal/Kripke/SimpleExtension.lean b/LeanPool/Incompleteness/Foundation/Modal/Kripke/SimpleExtension.lean index dc057d3755..8f276e213d 100644 --- a/LeanPool/Incompleteness/Foundation/Modal/Kripke/SimpleExtension.lean +++ b/LeanPool/Incompleteness/Foundation/Modal/Kripke/SimpleExtension.lean @@ -6,8 +6,7 @@ Authors: Palalansoukî import LeanPool.Incompleteness.Foundation.Modal.Kripke.Tree import LeanPool.Incompleteness.Foundation.Modal.Kripke.Preservation -import Mathlib.Data.Finite.Sum - +import Mathlib.Basic.Finite.Sum /-! # SimpleExtension -/ diff --git a/LeanPool/Isoperimetric/PrekopaLeindler.lean b/LeanPool/Isoperimetric/PrekopaLeindler.lean index 9ab3b69e22..c74da55a4d 100644 --- a/LeanPool/Isoperimetric/PrekopaLeindler.lean +++ b/LeanPool/Isoperimetric/PrekopaLeindler.lean @@ -504,7 +504,7 @@ def append {d : ℕ} (x : Fin d → ℝ) (t : Fin 1 → ℝ) : Fin (d + 1) → @[fun_prop] lemma append_measurable {d : ℕ} (x : Fin d → ℝ) : Measurable (append x) := by unfold append - apply measurable_pi_lambda + apply Measurable.of_eval intro split · fun_prop @@ -514,7 +514,7 @@ lemma append_measurable {d : ℕ} (x : Fin d → ℝ) : Measurable (append x) := @[fun_prop] lemma append_measurable' {d : ℕ} (t : Fin 1 → ℝ) : Measurable (fun x : Fin d → ℝ ↦ append x t) := by unfold append - apply measurable_pi_lambda + apply Measurable.of_eval intro split · fun_prop diff --git a/LeanPool/JacobianDiffgeo/Abel.lean b/LeanPool/JacobianDiffgeo/Abel.lean index a14e3d2d71..e127109ce9 100644 --- a/LeanPool/JacobianDiffgeo/Abel.lean +++ b/LeanPool/JacobianDiffgeo/Abel.lean @@ -132,7 +132,7 @@ every breakpoint, including the case where the path revisits its own basepoint). * **`OfCurveInj.lean`** (§4.4 D4): `Jacobian.ofCurve_inj'` (gated on `[DiscreteTopology (RS.periodSubgroup X)]`, Forster 21.4(i) exactly — proved via the frozen - ordering-resolution bridge `AddSubgroup.isClosed_of_discrete` + `AddSubgroup. + ordering-resolution bridge `AddSubgroup.isClosed_of_discreteTopology` + `AddSubgroup. topologicalClosure_minimal`/`le_topologicalClosure`, spike-verified in the design §9 — AND on the explicit hypothesis `RS.Abel.WeakSolutionUpgrade X`) and `Jacobian.ofCurve_inj` (same two gates — see the file's own docstring for why the design's literal UNGATED final shape cannot be @@ -151,7 +151,7 @@ every breakpoint, including the case where the path revisits its own basepoint). register **both** `instance : DiscreteTopology (RS.periodSubgroup X)` (feeds `ofCurve_inj'` directly) and `instance : DiscreteTopology (RS.periodSubgroup X).topologicalClosure` (feeds `jacobian-construction`'s existing gates) — both are cheap corollaries of the same - discreteness proof via `AddSubgroup.isClosed_of_discrete` (§4.4/§9 of the design). + discreteness proof via `AddSubgroup.isClosed_of_discreteTopology` (§4.4/§9 of the design). 3. **Final assembly discharge shape**: once (1) `RS.Abel.WeakSolutionUpgrade`/ `WeakSolutionUpgradeFinset` are proved (design steps 5+7 — `serre-duality-tails`'s own external blocker has already cleared, see `DolbeaultBridge.lean`) and (2) the diff --git a/LeanPool/JacobianDiffgeo/Abel/OfCurveInj.lean b/LeanPool/JacobianDiffgeo/Abel/OfCurveInj.lean index 67f5b037da..62e30446f0 100644 --- a/LeanPool/JacobianDiffgeo/Abel/OfCurveInj.lean +++ b/LeanPool/JacobianDiffgeo/Abel/OfCurveInj.lean @@ -13,7 +13,7 @@ import LeanPool.JacobianDiffgeo.Abel.UpgradeDischarge Unit: abel-theorem. Namespace `Jacobian`. The challenge's `ofCurve_inj` (`docs/Jacobian_challenge.lean:99`), assembled from `RS.Abel.genus_eq_zero_of_pathIntegral_mem` (`Sufficiency.lean`) via the frozen ordering-resolution bridge -(`AddSubgroup.isClosed_of_discrete`, §1.3/§9 of the design, spike-verified). +(`AddSubgroup.isClosed_of_discreteTopology`, §1.3/§9 of the design, spike-verified). Both theorems below are stated exactly at their design shape and type-check; `ofCurve_inj'`'s PROOF calls `RS.Abel.genus_eq_zero_of_pathIntegral_mem`, so it inherits that theorem's one @@ -44,7 +44,7 @@ theorem ofCurve_inj' (hupgrade : RS.Abel.WeakSolutionUpgrade X) (P : X) (h : 0 < by_contra hne -- The bridge: discreteness ⟹ closedness ⟹ `closure = self` (design §1.3/§9, spike-verified). have hclosed : IsClosed (RS.periodSubgroup X : Set (Fin (genus X) → ℂ)) := - AddSubgroup.isClosed_of_discrete + AddSubgroup.isClosed_of_discreteTopology have hclosure_eq : (RS.periodSubgroup X).topologicalClosure = RS.periodSubgroup X := le_antisymm (AddSubgroup.topologicalClosure_minimal _ le_rfl hclosed) (AddSubgroup.le_topologicalClosure _) diff --git a/LeanPool/JacobianDiffgeo/PeriodLattice/Discreteness.lean b/LeanPool/JacobianDiffgeo/PeriodLattice/Discreteness.lean index 687aa117bf..1713611c67 100644 --- a/LeanPool/JacobianDiffgeo/PeriodLattice/Discreteness.lean +++ b/LeanPool/JacobianDiffgeo/PeriodLattice/Discreteness.lean @@ -476,11 +476,12 @@ theorem discreteTopology_periodSubgroup (hupgrade : DiscretenessHyp X) : rwa [hseteq] at hUopen /-- The closure of `periodSubgroup X` is itself, once it is discrete: discreteness implies -closedness (`AddSubgroup.isClosed_of_discrete`). -/ +closedness (`AddSubgroup.isClosed_of_discreteTopology`). -/ theorem periodSubgroup_topologicalClosure_eq (hupgrade : DiscretenessHyp X) : (periodSubgroup X).topologicalClosure = periodSubgroup X := by have := discreteTopology_periodSubgroup hupgrade - exact SetLike.coe_injective (AddSubgroup.isClosed_of_discrete (H := periodSubgroup X)).closure_eq + exact SetLike.coe_injective + (AddSubgroup.isClosed_of_discreteTopology (U := periodSubgroup X)).closure_eq /-- The gated `DiscreteTopology` instance for the closure, the shape `jacobian-construction`'s ledger needs directly. -/ diff --git a/LeanPool/Kuramoto/Frontier.lean b/LeanPool/Kuramoto/Frontier.lean index 387e496934..5075afa7e0 100644 --- a/LeanPool/Kuramoto/Frontier.lean +++ b/LeanPool/Kuramoto/Frontier.lean @@ -677,9 +677,10 @@ private theorem sum_F_sq_tendsto_zero ⟨ by linarith [ abs_le.mp ( h_term_bound i ), abs_le.mp ( h_term_bound j ) ], by linarith [ abs_le.mp ( h_term_bound i ), abs_le.mp ( h_term_bound j ) ] ⟩; rw [ abs_mul, abs_mul ]; - exact le_trans ( mul_le_of_le_one_left ( abs_nonneg _ ) ( mul_le_one₀ - ( abs_le.mpr ⟨ by cases eq_or_ne i j <;> aesop, by cases eq_or_ne i j <;> aesop ⟩ ) - ( abs_nonneg _ ) ( Real.abs_cos_le_one _ ) ) ) h_term_bound; + exact le_trans (mul_le_of_le_one_left (abs_nonneg _) + ((mul_le_of_le_one_left (abs_nonneg _) + (abs_le.mpr ⟨by cases eq_or_ne i j <;> aesop, + by cases eq_or_ne i j <;> aesop⟩)).trans (Real.abs_cos_le_one _))) h_term_bound; refine ⟨ K * ( 2 * K * N * N ), ?_, ?_ ⟩ <;> norm_num [ h_deriv ]; · positivity; · exact fun t i => by @@ -733,9 +734,9 @@ private theorem sum_F_sq_tendsto_zero refine le_trans ( Finset.abs_sum_le_sum_abs _ _ ) ?_; exact le_trans ( Finset.sum_le_sum fun _ _ => show |_| ≤ 1 by rw [ abs_mul ] - exact mul_le_one₀ - ( abs_le.mpr ⟨ by cases eq_or_ne i ‹_› <;> aesop, by cases eq_or_ne i ‹_› <;> aesop ⟩ ) - ( abs_nonneg _ ) ( Real.abs_sin_le_one _ ) ) ( by norm_num ); + exact (mul_le_of_le_one_left (abs_nonneg _) + (abs_le.mpr ⟨by cases eq_or_ne i ‹_› <;> aesop, + by cases eq_or_ne i ‹_› <;> aesop⟩)).trans (Real.abs_sin_le_one _)) (by norm_num); rw [ ← Finset.sum_sub_distrib ]; refine le_trans ( Finset.abs_sum_le_sum_abs _ _ ) ?_; refine le_trans ( Finset.sum_le_sum (g := fun i => 2 * K * N * C * |s - t|) diff --git a/LeanPool/LeanBooleanfun/AuxLemmas.lean b/LeanPool/LeanBooleanfun/AuxLemmas.lean index 039b5699ed..3f05644e22 100644 --- a/LeanPool/LeanBooleanfun/AuxLemmas.lean +++ b/LeanPool/LeanBooleanfun/AuxLemmas.lean @@ -5,8 +5,7 @@ Authors: Joris Roos -/ import Mathlib.Algebra.BigOperators.Group.Finset.Basic import Mathlib.Algebra.BigOperators.Finprod -import Mathlib.Data.Real.Basic - +import Mathlib.Basic.Real.Basic /-! General lemmas not specific to analysis of Boolean functions. -/ diff --git a/LeanPool/LeanModelChecking/LTLNBWResult.lean b/LeanPool/LeanModelChecking/LTLNBWResult.lean index 0001148d8b..26aa6fbcc2 100644 --- a/LeanPool/LeanModelChecking/LTLNBWResult.lean +++ b/LeanPool/LeanModelChecking/LTLNBWResult.lean @@ -3,7 +3,7 @@ Copyright (c) 2026 György Kurucz. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: György Kurucz -/ -import Mathlib.Data.Finite.Prod +import Mathlib.Basic.Finite.Prod import Mathlib.Data.Fintype.Powerset import LeanPool.LeanModelChecking.LTLNBWStatement diff --git a/LeanPool/LeanModelChecking/LTLNBWStatement.lean b/LeanPool/LeanModelChecking/LTLNBWStatement.lean index dfe0dc194a..b3b8c30ae8 100644 --- a/LeanPool/LeanModelChecking/LTLNBWStatement.lean +++ b/LeanPool/LeanModelChecking/LTLNBWStatement.lean @@ -4,8 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: György Kurucz -/ import Mathlib.Data.Set.Basic -import Mathlib.Data.Finite.Defs - +import Mathlib.Basic.Finite.Defs /-! # Linear Temporal Logic and Büchi automata diff --git a/LeanPool/MinimumDegreeMatching/BKLO.lean b/LeanPool/MinimumDegreeMatching/BKLO.lean index 46949b8fb4..16389541e5 100644 --- a/LeanPool/MinimumDegreeMatching/BKLO.lean +++ b/LeanPool/MinimumDegreeMatching/BKLO.lean @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Juan Pablo Traverso Giannini, Aristotle -/ import LeanPool.MinimumDegreeMatching.BKLOSelection -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic import Mathlib.Tactic.FieldSimp import Mathlib.Tactic.Linarith import Mathlib.Tactic.NormNum diff --git a/LeanPool/MinimumDegreeMatching/BKLOSelection.lean b/LeanPool/MinimumDegreeMatching/BKLOSelection.lean index 25df98a679..6f185e3854 100644 --- a/LeanPool/MinimumDegreeMatching/BKLOSelection.lean +++ b/LeanPool/MinimumDegreeMatching/BKLOSelection.lean @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Juan Pablo Traverso Giannini, Aristotle -/ import LeanPool.MinimumDegreeMatching.BKLOInfrastructure -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic import Mathlib.Tactic.Linarith import Mathlib.Tactic.NormNum import Mathlib.Tactic.Order diff --git a/LeanPool/Neukirch/HilbertRamificationTheory.lean b/LeanPool/Neukirch/HilbertRamificationTheory.lean index 5758feb08e..aa9e3b2411 100644 --- a/LeanPool/Neukirch/HilbertRamificationTheory.lean +++ b/LeanPool/Neukirch/HilbertRamificationTheory.lean @@ -486,11 +486,20 @@ instance residue_field_instFiniteDimensional {K L : Type*} [Field K] [NumberFiel [P lies_over p] : FiniteDimensional ((𝓞 K) ⧸ p) ((𝓞 L) ⧸ P) := Module.Finite.of_restrictScalars_finite (𝓞 K) ((𝓞 K) ⧸ p) ((𝓞 L) ⧸ P) +/-- A quotient by any ideal lying over a maximal ideal has positive dimension, even when the +ideal upstairs is not prime. This retains the generality of the former quotient-based inertia +degree. -/ +theorem quotient_finrank_pos_of_lies_over {K L : Type*} [Field K] [NumberField K] + [Field L] [NumberField L] [Algebra K L] (p : Ideal (𝓞 K)) (P : Ideal (𝓞 L)) + [p.IsMaximal] [P lies_over p] : 0 < Module.finrank ((𝓞 K) ⧸ p) ((𝓞 L) ⧸ P) := by + let : Nontrivial ((𝓞 L) ⧸ P) := Ideal.Quotient.nontrivial_of_liesOver_of_isPrime P p + exact Module.finrank_pos + theorem inertiaDeg_pos {K L : Type*} [Field K] [NumberField K] [Field L] [NumberField L] [Algebra K L] (p : Ideal (𝓞 K)) (P : Ideal (𝓞 L)) [p.IsMaximal] [P.IsMaximal] [P lies_over p] : P.inertiaDeg (𝓞 K) > 0 := by rw [Ideal.inertiaDeg_eq_of_isMaximal p P] - exact Module.finrank_pos + exact quotient_finrank_pos_of_lies_over p P -- Hilbert's Ramification Theory @@ -695,9 +704,11 @@ def residueFieldGalAlgEquiv {P : Ideal (𝓞 L)} [P lies_over p] {Q : Ideal ( exact congrArg (Ideal.Quotient.mk Q) (AlgEquiv.commutes (GalAlgEquiv σ) x) } +omit [p.IsMaximal] in /-- In the case of Galois extension, all the `inertiaDeg` are the same. -/ theorem inertiaDeg_eq_of_isGalois (Q : Ideal (𝓞 L)) [Q.IsMaximal] [Q lies_over p] [IsGalois K L] : P.inertiaDeg (𝓞 K) = Q.inertiaDeg (𝓞 K) := by + let : p.IsMaximal := Ideal.IsMaximal.of_isMaximal_liesOver P p rcases IsMaximal_conjugates p P Q with ⟨σ, hs⟩ rw [inertiaDeg_eq_of_isMaximal p P, inertiaDeg_eq_of_isMaximal p Q] exact LinearEquiv.finrank_eq (residueFieldGalAlgEquiv p hs).toLinearEquiv diff --git a/LeanPool/PFR/AddCombi/BSG.lean b/LeanPool/PFR/AddCombi/BSG.lean index a208705ab3..338c7ba557 100644 --- a/LeanPool/PFR/AddCombi/BSG.lean +++ b/LeanPool/PFR/AddCombi/BSG.lean @@ -6,7 +6,7 @@ Authors: Yaël Dillies, Bhavik Mehta module public import LeanPool.PFR.AddCombi.Mathlib.Combinatorics.Additive.Energy -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import LeanPool.PFR.AddCombi.Convolution.Finite.Order public import LeanPool.PFR.AddCombi.Mathlib.Algebra.Star.Pi diff --git a/LeanPool/PFR/AddCombi/Convolution/Finite/Defs.lean b/LeanPool/PFR/AddCombi/Convolution/Finite/Defs.lean index 43e6591382..727712d05d 100644 --- a/LeanPool/PFR/AddCombi/Convolution/Finite/Defs.lean +++ b/LeanPool/PFR/AddCombi/Convolution/Finite/Defs.lean @@ -11,8 +11,8 @@ public import Mathlib.Algebra.Group.Action.Pointwise.Finset public import Mathlib.Algebra.Group.Translate public import Mathlib.Algebra.Star.Conjneg public import Mathlib.Analysis.RCLike.Basic -public import Mathlib.Data.Complex.Basic -public import Mathlib.Data.NNReal.Star +public import Mathlib.Basic.Complex.Basic +public import Mathlib.Basic.NNReal.Star public import LeanPool.PFR.AddCombi.Mathlib.Algebra.GroupWithZero.Indicator public import LeanPool.PFR.AddCombi.Mathlib.Algebra.Star.Pi diff --git a/LeanPool/PFR/Endgame.lean b/LeanPool/PFR/Endgame.lean index 2ae54f1061..f867687af2 100644 --- a/LeanPool/PFR/Endgame.lean +++ b/LeanPool/PFR/Endgame.lean @@ -345,7 +345,7 @@ lemma cond_c_eq_integral [IsProbabilityMeasure (ℙ : Measure Ω')] simp_rw [← integral_fintype .of_finite] rw [← condRuzsaDist'_eq_integral _ hY hZ, ← condRuzsaDist'_eq_integral _ hY hZ, integral_const, integral_const] - have : IsProbabilityMeasure (Measure.map Z ℙ) := Measure.isProbabilityMeasure_map hZ.aemeasurable + have : IsProbabilityMeasure (Measure.map Z ℙ) := inferInstance simp variable {T₁ T₂ T₃ : Ω' → G} (hT : T₁ + T₂ + T₃ = 0) @@ -378,7 +378,7 @@ lemma construct_good_prelim : let sum4 : ℝ := (Measure.map T₃ ℙ)[fun t ↦ ψ[T₁; ℙ[|T₃ ⁻¹' {t}] # T₂; ℙ[|T₃ ⁻¹' {t}]]] have hp.η : 0 ≤ p.η := by linarith [p.hη] have hP : IsProbabilityMeasure (Measure.map T₃ ℙ) := - Measure.isProbabilityMeasure_map hT₃.aemeasurable + inferInstance have h2T₃ : T₃ = T₁ + T₂ := calc T₃ = T₁ + T₂ + T₃ - T₃ := by rw [hT, zero_sub]; simp [ZModModule.neg_eq_self] _ = T₁ + T₂ := by rw [add_sub_cancel_right] @@ -396,7 +396,7 @@ lemma construct_good_prelim : have : sum2 = d[p.X₀₁ # T₁ | T₃] - d[p.X₀₁ # X₁] := by simp only [integral_sub .of_finite .of_finite, integral_const, smul_eq_mul, sum2] simp [condRuzsaDist'_eq_sum hT₁ hT₃, integral_eq_setIntegral - (FiniteRange.ae_mem_toFinset _ T₃), setIntegral_finset _ .finset, + (FiniteRange.ae_mem_toFinset _ T₃ hT₃.aemeasurable), setIntegral_finset _ .finset, map_measureReal_apply hT₃ (.singleton _)] gcongr linarith [condRuzsaDist_le' ℙ ℙ p.hmeas1 hT₁ hT₃] @@ -404,7 +404,7 @@ lemma construct_good_prelim : have : sum3 = d[p.X₀₂ # T₂ | T₃] - d[p.X₀₂ # X₂] := by simp only [integral_sub .of_finite .of_finite, integral_const, smul_eq_mul, sum3] simp [condRuzsaDist'_eq_sum hT₂ hT₃, - integral_eq_setIntegral (FiniteRange.ae_mem_toFinset _ T₃), + integral_eq_setIntegral (FiniteRange.ae_mem_toFinset _ T₃ hT₃.aemeasurable), setIntegral_finset _ .finset, map_measureReal_apply hT₃ (.singleton _)] gcongr @@ -474,7 +474,7 @@ lemma cond_construct_good : simp_rw [integral_fintype .of_finite, ← Finset.sum_add_distrib, ← smul_add, Finset.mul_sum, mul_smul_comm, ← Finset.sum_add_distrib, ← smul_add] simp_rw [← integral_fintype .of_finite] - have : IsProbabilityMeasure (Measure.map R ℙ) := Measure.isProbabilityMeasure_map (by fun_prop) + have : IsProbabilityMeasure (Measure.map R ℙ) := inferInstance calc k = (Measure.map R ℙ)[fun _r => k] := by rw [integral_const]; simp diff --git a/LeanPool/PFR/ForMathlib/Entropy/RuzsaDist.lean b/LeanPool/PFR/ForMathlib/Entropy/RuzsaDist.lean index f3a774a89b..fc10d95545 100644 --- a/LeanPool/PFR/ForMathlib/Entropy/RuzsaDist.lean +++ b/LeanPool/PFR/ForMathlib/Entropy/RuzsaDist.lean @@ -176,15 +176,15 @@ lemma tendsto_rdist_probabilityMeasure {α : Type*} {l : Filter α} Tendsto (fun n ↦ d[X; (μ n : Measure Ω) # Y; (μ n : Measure Ω)]) l (𝓝 (d[X; ν # Y; ν])) := by have J (η : ProbabilityMeasure Ω) : - d[X; η # Y; η] = d[(id : G → G); η.map hX.aemeasurable # id; η.map hY.aemeasurable] := by + d[X; η # Y; η] = d[(id : G → G); η.map X # id; η.map Y] := by apply ProbabilityTheory.IdentDistrib.rdist_congr · exact ⟨hX.aemeasurable, aemeasurable_id, by simp⟩ · exact ⟨hY.aemeasurable, aemeasurable_id, by simp⟩ simp_rw [J] have Z := ((continuous_rdist_restrict_probabilityMeasure (G := G)).tendsto - ((ν.map hX.aemeasurable), (ν.map hY.aemeasurable))) - have T : Tendsto (fun n ↦ (((μ n).map hX.aemeasurable), ((μ n).map hY.aemeasurable))) - l (𝓝 (((ν.map hX.aemeasurable), (ν.map hY.aemeasurable)))) := by + ((ν.map X), (ν.map Y))) + have T : Tendsto (fun n ↦ (((μ n).map X), ((μ n).map Y))) + l (𝓝 (((ν.map X), (ν.map Y)))) := by apply Tendsto.prodMk_nhds · exact ProbabilityMeasure.tendsto_map_of_tendsto_of_continuous μ ν hμ hX · exact ProbabilityMeasure.tendsto_map_of_tendsto_of_continuous μ ν hμ hY @@ -361,10 +361,10 @@ lemma ent_of_proj_le {UH : Ω' → G} [FiniteRange UH] have h_one : ∑ x ∈ FiniteRange.toFinset (π ∘ X'), νq.real {x} = 1 := by rewrite [sum_measureReal_singleton] apply (ENNReal.toReal_eq_one_iff _).mpr - have := isProbabilityMeasure_map (μ := ν) <| .of_discrete (f := π ∘ X') + have : IsProbabilityMeasure (ν.map (π ∘ X')) := inferInstance rewrite [← measure_univ (μ := νq), ← FiniteRange.range] let rng := Set.range (π ∘ X') - have h_compl : νq rngᶜ = 0 := ae_map_mem_range (π ∘ X') .of_discrete ν + have h_compl : νq rngᶜ = 0 := ae_map_mem_range .of_discrete (by fun_prop) rw [← measure_add_measure_compl (MeasurableSet.of_discrete (s := rng)), h_compl, add_zero] have := FiniteRange.sub X' UH' @@ -591,8 +591,10 @@ lemma condRuzsaDist_symm [Countable T] (hW : Measurable W) [IsProbabilityMeasure μ] [IsProbabilityMeasure μ'] [FiniteRange Z] [FiniteRange W] : d[X | Z; μ # Y | W; μ'] = d[Y | W; μ' # X | Z; μ] := by - have : IsProbabilityMeasure (μ.map Z) := isProbabilityMeasure_map hZ.aemeasurable - have : IsProbabilityMeasure (μ'.map W) := isProbabilityMeasure_map hW.aemeasurable + have : IsProbabilityMeasure (μ.map Z) := + (Measure.isProbabilityMeasure_map_iff hZ.aemeasurable).mpr inferInstance + have : IsProbabilityMeasure (μ'.map W) := + (Measure.isProbabilityMeasure_map_iff hW.aemeasurable).mpr inferInstance rw [condRuzsaDist_def, condRuzsaDist_def, Kernel.rdist_symm] public @@ -603,8 +605,8 @@ lemma condRuzsaDist_nonneg [Countable T] {X : Ω → G} (hX : Measurable X) [Fin [IsProbabilityMeasure μ] [IsProbabilityMeasure μ'] : 0 ≤ d[X | Z; μ # Y | W; μ'] := by rw [condRuzsaDist_def] - have : IsProbabilityMeasure (μ.map Z) := isProbabilityMeasure_map hZ.aemeasurable - have : IsProbabilityMeasure (μ'.map W) := isProbabilityMeasure_map hW.aemeasurable + have : IsProbabilityMeasure (μ.map Z) := inferInstance + have : IsProbabilityMeasure (μ'.map W) := inferInstance refine Kernel.rdist_nonneg ?_ ?_ · exact Kernel.aefiniteKernelSupport_condDistrib _ _ _ hX hZ · exact Kernel.aefiniteKernelSupport_condDistrib _ _ _ hY hW @@ -773,8 +775,8 @@ lemma condRuzsaDist_of_indep (μ : Measure Ω) [IsProbabilityMeasure μ] (h : IndepFun (⟨X, Z⟩) (⟨Y, W⟩) μ) [FiniteRange Z] [FiniteRange W] : d[X | Z; μ # Y | W; μ] = H[X - Y | ⟨Z, W⟩; μ] - H[X | Z; μ]/2 - H[Y | W; μ]/2 := by - have : IsProbabilityMeasure (μ.map Z) := isProbabilityMeasure_map hZ.aemeasurable - have : IsProbabilityMeasure (μ.map W) := isProbabilityMeasure_map hW.aemeasurable + have : IsProbabilityMeasure (μ.map Z) := inferInstance + have : IsProbabilityMeasure (μ.map W) := inferInstance rw [condRuzsaDist_def, Kernel.rdist_eq', condEntropy_eq_kernel_entropy _ (hZ.prodMk hW), condEntropy_eq_kernel_entropy hX hZ, condEntropy_eq_kernel_entropy hY hW] swap; · exact hX.sub hY @@ -786,7 +788,8 @@ lemma condRuzsaDist_of_indep refine Kernel.entropy_congr ?_ have : Kernel.map (condDistrib (⟨X, Y⟩) (⟨Z, W⟩) μ) (fun x ↦ x.1 - x.2) =ᵐ[μ.map (⟨Z, W⟩)] condDistrib (X - Y) (⟨Z, W⟩) μ := - (condDistrib_comp _ (by fun_prop) (by fun_prop)).symm + (condDistrib_comp (hZ.prodMk hW).aemeasurable + (hX.prodMk hY).aemeasurable (by fun_prop)).symm refine (this.symm.trans ?_).symm suffices Kernel.prodMkRight T (condDistrib X Z μ) ×ₖ Kernel.prodMkLeft S (condDistrib Y W μ) diff --git a/LeanPool/PFR/ForMathlib/Entropy/RuzsaSetDist.lean b/LeanPool/PFR/ForMathlib/Entropy/RuzsaSetDist.lean index d4d1a461e2..0746875bb5 100644 --- a/LeanPool/PFR/ForMathlib/Entropy/RuzsaSetDist.lean +++ b/LeanPool/PFR/ForMathlib/Entropy/RuzsaSetDist.lean @@ -117,7 +117,7 @@ lemma setRuzsaDist_le (A B : Set G) [h'A : Finite A] [h'B : Finite B] convert measureEntropy_le_card_aux (A-B).toFinite.toFinset ?_ · rw [Nat.card_coe_set_eq] exact Set.ncard_eq_toFinset_card (A - B) - · exact Measure.isProbabilityMeasure_map (Measurable.aemeasurable measurable_sub) + · exact inferInstance rw [Measure.map_apply measurable_sub .of_discrete] apply measure_mono_null (t := (Aᶜ ×ˢ Set.univ) ∪ (Set.univ ×ˢ Bᶜ)) · intro (x, y) diff --git a/LeanPool/PFR/HundredPercent.lean b/LeanPool/PFR/HundredPercent.lean index 0acf177c83..33032a0724 100644 --- a/LeanPool/PFR/HundredPercent.lean +++ b/LeanPool/PFR/HundredPercent.lean @@ -166,7 +166,7 @@ theorem exists_isUniform_of_rdist_self_eq_zero (hX : Measurable X) (hdist : d[X rw [← Measure.sum_smul_dirac (μ := (ℙ : Measure Ω).map X)] simp [A] have : IsProbabilityMeasure ((ℙ : Measure Ω).map X) := - Measure.isProbabilityMeasure_map hX.aemeasurable + inferInstance exact IsProbabilityMeasure.ne_zero _ B refine ⟨symmGroup X hX, fun ω ↦ X ω - x₀, hX.sub_const _, isUniform_sub_const_of_rdist_eq_zero hX hdist h₀, ?_⟩ diff --git a/LeanPool/PFR/ImprovedPFR.lean b/LeanPool/PFR/ImprovedPFR.lean index 0f31a95c64..8199f333ee 100644 --- a/LeanPool/PFR/ImprovedPFR.lean +++ b/LeanPool/PFR/ImprovedPFR.lean @@ -342,7 +342,7 @@ lemma construct_good_prelim' : k ≤ δ + p.η * c[T₁ | T₃ # T₂ | T₃] := calc T₃ = T₁ + T₂ + T₃ - T₃ := by simp [hT, ZModModule.neg_eq_self] _ = T₁ + T₂ := by rw [add_sub_cancel_right] have hP : IsProbabilityMeasure (Measure.map T₃ ℙ) := - Measure.isProbabilityMeasure_map hT₃.aemeasurable + inferInstance -- control sum1 with entropic BSG have h1 : sum1 ≤ δ := by have h1 : sum1 ≤ 3 * I[T₁ : T₂] + 2 * H[T₃] - H[T₁] - H[T₂] := by @@ -356,12 +356,14 @@ lemma construct_good_prelim' : k ≤ δ + p.η * c[T₁ | T₃ # T₂ | T₃] := have h2 : sum2 = d[p.X₀₁ # T₁ | T₃] - d[p.X₀₁ # X₁] := by simp only [sum2, integral_sub .of_finite .of_finite, integral_const, smul_eq_mul] simp [condRuzsaDist'_eq_sum hT₁ hT₃, - integral_eq_setIntegral (FiniteRange.ae_mem_toFinset _ T₃), setIntegral_finset _ .finset, + integral_eq_setIntegral (FiniteRange.ae_mem_toFinset _ T₃ hT₃.aemeasurable), + setIntegral_finset _ .finset, map_measureReal_apply hT₃ (.singleton _), smul_eq_mul] have h3 : sum3 = d[p.X₀₂ # T₂ | T₃] - d[p.X₀₂ # X₂] := by simp only [sum3, integral_sub .of_finite .of_finite, integral_const, smul_eq_mul] simp [condRuzsaDist'_eq_sum hT₂ hT₃, - integral_eq_setIntegral (FiniteRange.ae_mem_toFinset _ T₃), setIntegral_finset _ .finset, + integral_eq_setIntegral (FiniteRange.ae_mem_toFinset _ T₃ hT₃.aemeasurable), + setIntegral_finset _ .finset, map_measureReal_apply hT₃ (.singleton _)] -- put all these estimates together to bound sum4 have h4 : sum4 ≤ δ + p.η * ((d[p.X₀₁ # T₁ | T₃] - d[p.X₀₁ # X₁]) diff --git a/LeanPool/PFR/Kullback.lean b/LeanPool/PFR/Kullback.lean index 83f775e9d7..d7774f55f1 100644 --- a/LeanPool/PFR/Kullback.lean +++ b/LeanPool/PFR/Kullback.lean @@ -99,8 +99,10 @@ lemma KLDiv_nonneg [Finite G] [MeasurableSingletonClass G] [IsZeroOrProbabilityM rcases eq_zero_or_isProbabilityMeasure μ' with rfl | hμ' · simp apply le_trans ?_ (sum_mul_log_div_leq (by simp) (by simp) ?_) - · have : IsProbabilityMeasure (μ'.map Y) := Measure.isProbabilityMeasure_map hY.aemeasurable - have : IsProbabilityMeasure (μ.map X) := Measure.isProbabilityMeasure_map hX.aemeasurable + · have : IsProbabilityMeasure (μ'.map Y) := + (Measure.isProbabilityMeasure_map_iff hY.aemeasurable).mpr inferInstance + have : IsProbabilityMeasure (μ.map X) := + (Measure.isProbabilityMeasure_map_iff hX.aemeasurable).mpr inferInstance simp · intro i _ hi simp only [Measure.real, ENNReal.toReal_eq_zero_iff, measure_ne_top, or_false] at hi @@ -311,7 +313,7 @@ lemma KLDiv_add_le_KLDiv_of_indep [Finite G] [AddCommGroup G] [DiscreteMeasurabl simp [sub_eq_add_neg] let w (s : G) : ℝ := (μ.map Z).real {s} have sum_w : ∑ s, w s = 1 := by - have : IsProbabilityMeasure (μ.map Z) := Measure.isProbabilityMeasure_map hZ.aemeasurable + have : IsProbabilityMeasure (μ.map Z) := inferInstance simp [w] have A x : (μ.map (X + Z)).real {x} = ∑ s, w s * (μ.map (X' s)).real {x} := by have : IndepFun X Z μ := h_indep.comp (φ := Prod.fst) (ψ := id) measurable_fst measurable_id @@ -376,7 +378,7 @@ lemma condKLDiv_eq {S : Type*} [MeasurableSpace S] [Finite S] [MeasurableSinglet have : Measure.map X μ {g} = Measure.map X (∑ x, μ (Z ⁻¹' {x}) • μ[|Z ⁻¹' {x}]) {g} := by rw [sum_meas_smul_cond_fiber hZ μ] rw [← MeasureTheory.Measure.sum_fintype, Measure.map_sum hX.aemeasurable] at this - simpa using this + simpa [Measure.map_smul _ hX.aemeasurable] using this have : (Measure.map X μ).real {g} = ∑ x, (Measure.map Z μ).real {x} * (Measure.map X μ[|Z ⁻¹' {x}]).real {g} := by rw [measureReal_def, A, ENNReal.toReal_sum (fun a ha ↦ by finiteness)] diff --git a/LeanPool/PFR/MoreRuzsaDist.lean b/LeanPool/PFR/MoreRuzsaDist.lean index 4f9ff22ae2..45553e7468 100644 --- a/LeanPool/PFR/MoreRuzsaDist.lean +++ b/LeanPool/PFR/MoreRuzsaDist.lean @@ -959,7 +959,7 @@ lemma multiDist_of_perm {m : ℕ} {Ω : Fin m → Type*} · apply Finset.measurable_sum intro i _ exact measurable_pi_apply i - apply measurable_pi_lambda + apply Measurable.of_eval intro i have : (fun x : Fin m → G ↦ perm x i) = (fun x : Fin m → G ↦ x (φ.symm i)) := by ext x @@ -1700,7 +1700,7 @@ lemma condMultiDist_eq {m : ℕ} ext x simp only [Set.mem_iInter, Set.mem_preimage, Set.mem_singleton_iff, E'] exact Iff.symm funext_iff - exact measurable_pi_lambda (fun ω i ↦ Y i ω) hY + exact Measurable.of_eval hY ext i calc _ = ∑ y, f y * H[X i; cond ℙ (E i (y i))] := by @@ -1988,7 +1988,7 @@ lemma cond_multiDist_chainRule {G H : Type*} [hG : MeasurableSpace G] [Measurabl intro _ exact Iff.symm funext_iff exact MeasurableSet.preimage (.singleton x) hmes - exact Measurable.prodMk hmes (measurable_pi_lambda (fun ω i ↦ Y i ω) hY) + exact Measurable.prodMk hmes (Measurable.of_eval hY) /-- Let `m` be a positive integer. Suppose one has a sequence `G_m → G_{m - 1} → ... → G_1 → G_0 = {0}` of homomorphisms between abelian groups `G_0, ...,G_m`, @@ -2124,7 +2124,7 @@ theorem multiDist_of_hom' {G G' : Type*} [MeasurableSpace G] [MeasurableSingleto convert (Measure.map_of_pi (f := fun i x ↦ ι x + a i) _ _).symm with i · rw [Measure.map_map] <;> try fun_prop congr - · intro i; exact isProbabilityMeasure_map (by fun_prop) + · intro i; exact inferInstance intro i; fun_prop congr 2; ext i apply entropy_comp_of_injective _ (hX i) (fun x ↦ ι x + a i) _ diff --git a/LeanPool/PFR/MultiTauFunctional.lean b/LeanPool/PFR/MultiTauFunctional.lean index dbd151b13b..61bdfe4de8 100644 --- a/LeanPool/PFR/MultiTauFunctional.lean +++ b/LeanPool/PFR/MultiTauFunctional.lean @@ -118,7 +118,7 @@ lemma multiTau_continuous {G Ω₀ : Type u} [MeasurableFinGroup G] [Topological · let f : (Fin p.m → G) → G := fun x ↦ ∑ i, x i have fcont : Continuous f := by fun_prop change Continuous fun (x : Fin p.m → ProbabilityMeasure G) ↦ - Hm[(ProbabilityMeasure.map (ProbabilityMeasure.pi x) fcont.aemeasurable : Measure G)] + Hm[(ProbabilityMeasure.map (ProbabilityMeasure.pi x) f : Measure G)] apply continuous_measureEntropy_probabilityMeasure.comp exact (ProbabilityMeasure.continuous_map fcont).comp ProbabilityMeasure.continuous_pi · apply Continuous.mul continuous_const @@ -172,8 +172,7 @@ lemma multiTau_min_exists {G Ω₀ : Type u} [MeasurableFinGroup G] [MeasureSpac rw [← this] apply (multiTau_min_exists_measure p).choose_spec.2 intro i - apply Measure.isProbabilityMeasure_map - exact (hX i).aemeasurable + infer_instance /-- If $(X_i)_{1 \leq i \leq m}$ is a $\tau$-minimizer, then $\sum_{i=1}^m d[X_i; X^0] \leq \frac{2m}{\eta} d[X^0; X^0]$. -/ diff --git a/LeanPool/PFR/RhoFunctional.lean b/LeanPool/PFR/RhoFunctional.lean index 19921ccc6b..415156e1f2 100644 --- a/LeanPool/PFR/RhoFunctional.lean +++ b/LeanPool/PFR/RhoFunctional.lean @@ -133,7 +133,7 @@ lemma rhoMinus_le [IsZeroOrProbabilityMeasure μ] (habs : ∀ y, (μ'.map (T + U)) {y} = 0 → μ.map X {y} = 0) : ρ⁻[X; μ # A] ≤ KL[X; μ # T + U; μ'] := by cases nonempty_fintype G - have : IsProbabilityMeasure (μ'.map T) := isProbabilityMeasure_map hT.aemeasurable + have : IsProbabilityMeasure (μ'.map T) := inferInstance have : IsProbabilityMeasure (uniformOn (A : Set G)) := isProbabilityMeasure_uniformOn A.finite_toSet hA have E : μ'.map U = uniformOn (A : Set G) := hunif.map_eq_uniformOn hU A.finite_toSet hA @@ -148,7 +148,7 @@ lemma rhoMinus_le [IsZeroOrProbabilityMeasure μ] simp [E] apply csInf_le (bddBelow_rhoMinusSet hX) simp only [rhoMinusSet, Set.mem_ofPred_eq] - exact ⟨μ'.map T, isProbabilityMeasure_map hT.aemeasurable, by rwa [M], by simp [KLDiv, M]⟩ + exact ⟨μ'.map T, inferInstance, by rwa [M], by simp [KLDiv, M]⟩ /-- We have $\rho^-(X) \geq 0$. -/ public @@ -203,7 +203,8 @@ private lemma rhoMinus_continuous_aux1 (hX : Measurable X) (hA : A.Nonempty) have C : Continuous (Prod.fst + Prod.snd : G × G → G) := by fun_prop have Z := ProbabilityMeasure.tendsto_map_of_tendsto_of_continuous _ _ this (f := Prod.fst + Prod.snd) C - have M : ∀ (x : G), ((μ₀.prod PA).map C.aemeasurable) {x} = 0 → (Measure.map X μ) {x} = 0 := by + have M : ∀ (x : G), ((μ₀.prod PA).map (Prod.fst + Prod.snd)) {x} = 0 → + (Measure.map X μ) {x} = 0 := by intro x hx apply habs simpa [hPA] using hx @@ -601,7 +602,7 @@ private lemma rhoMinus_le_of_subgroup [IsProbabilityMeasure μ] {H : AddSubgroup have : IsProbabilityMeasure (uniformOn (A : Set G)) := isProbabilityMeasure_uniformOn A.finite_toSet hA have : IsProbabilityMeasure μ' := - isProbabilityMeasure_map (Measurable.aemeasurable (by fun_prop)) + inferInstance have h_indep : IndepFun Prod.fst Prod.snd (μ'.prod (uniformOn (A : Set G))) := indepFun_fst_snd apply csInf_le (bddBelow_rhoMinusSet hU) simp only [rhoMinusSet, Nat.card_eq_fintype_card, Fintype.card_coe, mem_ofPred_eq] @@ -795,12 +796,12 @@ lemma tendsto_rho_probabilityMeasure {α : Type*} {l : Filter α} {μ : α → ProbabilityMeasure Ω} {ν : ProbabilityMeasure Ω} (hμ : Tendsto μ l (𝓝 ν)) : Tendsto (fun n ↦ ρ[X; (μ n : Measure Ω) # A]) l (𝓝 (ρ[X; ν # A])) := by have J (η : ProbabilityMeasure Ω) : - ρ[X; η # A] = ρ[(id : G → G); η.map hX.aemeasurable # A] := by + ρ[X; η # A] = ρ[(id : G → G); η.map X # A] := by apply rho_eq_of_identDistrib exact ⟨hX.aemeasurable, aemeasurable_id, by simp⟩ simp_rw [J] - have Z := ((rho_continuous hA).tendsto ((ν.map hX.aemeasurable))) - have T : Tendsto (fun n ↦ (μ n).map hX.aemeasurable) l (𝓝 (ν.map hX.aemeasurable)) := + have Z := ((rho_continuous hA).tendsto ((ν.map X))) + have T : Tendsto (fun n ↦ (μ n).map X) l (𝓝 (ν.map X)) := ProbabilityMeasure.tendsto_map_of_tendsto_of_continuous μ ν hμ hX apply Z.comp T @@ -1010,7 +1011,7 @@ lemma condRhoPlus_le [IsProbabilityMeasure μ] {S : Type*} [MeasurableSpace S] {Z : Ω → S} (hX : Measurable X) (hZ : Measurable Z) (hA : A.Nonempty) : ρ⁺[X | Z; μ # A] ≤ ρ⁺[X; μ # A] := by cases nonempty_fintype S - have : IsProbabilityMeasure (Measure.map Z μ) := isProbabilityMeasure_map hZ.aemeasurable + have : IsProbabilityMeasure (Measure.map Z μ) := inferInstance have I₁ := condRhoMinus_le hX hZ hA (μ := μ) simp_rw [condRhoPlus, rhoPlus, tsum_fintype] simp only [Nat.card_eq_fintype_card, Fintype.card_coe, mul_sub, mul_add, Finset.sum_sub_distrib, @@ -1237,7 +1238,7 @@ lemma phi_min_exists (hA : A.Nonempty) : ∃ (μ : Measure (G × G)), IsProbabil refine ⟨μ, by infer_instance, ?_⟩ intro Ω' mΩ' X' Y' hP hX' hY' let ν : Measure (G × G) := Measure.map (⟨X', Y'⟩) ℙ - have : IsProbabilityMeasure ν := isProbabilityMeasure_map (by fun_prop) + have : IsProbabilityMeasure ν := inferInstance let ν' : ProbabilityMeasure (G × G) := ⟨ν, this⟩ have : pfrPhi Prod.fst Prod.snd η A ↑μ ≤ pfrPhi Prod.fst Prod.snd η A ↑ν' := hμ (mem_univ _) apply this.trans_eq @@ -1275,8 +1276,8 @@ lemma le_rdist_of_phiMinimizes (h_min : phiMinimizes X₁ X₂ η A ℙ) d[X₁ # X₂] - η * (ρ[X₁'; μ₁ # A] - ρ[X₁ # A]) - η * (ρ[X₂'; μ₂ # A] - ρ[X₂ # A]) ≤ d[X₁'; μ₁ # X₂'; μ₂] := by let Ω' : Type uG := G × G - have : IsProbabilityMeasure (Measure.map X₁' μ₁) := isProbabilityMeasure_map hX₁'.aemeasurable - have : IsProbabilityMeasure (Measure.map X₂' μ₂) := isProbabilityMeasure_map hX₂'.aemeasurable + have : IsProbabilityMeasure (Measure.map X₁' μ₁) := inferInstance + have : IsProbabilityMeasure (Measure.map X₂' μ₂) := inferInstance let m : Measure Ω' := (Measure.map X₁' μ₁).prod (Measure.map X₂' μ₂) have m_prob : IsProbabilityMeasure m := by infer_instance let _ : MeasureSpace Ω' := ⟨m⟩ @@ -1317,8 +1318,8 @@ lemma condRho_le_condRuzsaDist_of_phiMinimizes {S T : Type*} ≤ d[X₁' | Z # X₂' | W] := by cases nonempty_fintype S cases nonempty_fintype T - have : IsProbabilityMeasure (Measure.map Z ℙ) := isProbabilityMeasure_map hZ.aemeasurable - have : IsProbabilityMeasure (Measure.map W ℙ) := isProbabilityMeasure_map hW.aemeasurable + have : IsProbabilityMeasure (Measure.map Z ℙ) := inferInstance + have : IsProbabilityMeasure (Measure.map W ℙ) := inferInstance have hz (a : ℝ) : a = ∑ z, (Measure.real ℙ (Z ⁻¹' {z})) * a := by simp_rw [← Finset.sum_mul, ← map_measureReal_apply hZ (MeasurableSet.singleton _), sum_measureReal_singleton] @@ -1549,7 +1550,7 @@ lemma dist_le_of_sum_zero {Ω' : Type*} [MeasurableSpace Ω'] {μ : Measure Ω'} have : k ≤ ∑ x : G, (Measure.real ℙ (T₃ ⁻¹' {x})) * d[T₁; ℙ[|T₃ ← x] # T₂; ℙ[|T₃ ← x]] + η * (ρ[T₁ | T₃ # A] - ρ[X₁ # A]) + η * (ρ[T₂ | T₃ # A] - ρ[X₂ # A]) := by have S : ∑ i : G, (Measure.real ℙ (T₃ ⁻¹' {i})) = 1 := by - have : IsProbabilityMeasure (Measure.map T₃ ℙ) := isProbabilityMeasure_map hT₃.aemeasurable + have : IsProbabilityMeasure (Measure.map T₃ ℙ) := inferInstance simp [← map_measureReal_apply hT₃ (measurableSet_singleton _)] simp_rw [← Finset.sum_mul, S, mul_add, Finset.sum_add_distrib, ← mul_assoc, mul_comm _ η, mul_assoc, ← Finset.mul_sum, mul_sub, Finset.sum_sub_distrib, mul_sub, @@ -1579,7 +1580,7 @@ lemma dist_le_of_sum_zero_cond {Ω' : Type*} [MeasureSpace Ω'] + η * (ρ[T₁ | ⟨T₃, S⟩ # A] + ρ[T₂ | ⟨T₃, S⟩ # A] - ρ[X₁ # A] - ρ[X₂ # A]) := by cases nonempty_fintype G have hw (a : ℝ) : a = ∑ w, (Measure.real ℙ (S ⁻¹' {w})) * a := by - have : IsProbabilityMeasure (map S ℙ) := isProbabilityMeasure_map hS.aemeasurable + have : IsProbabilityMeasure (map S ℙ) := inferInstance simp_rw [← Finset.sum_mul, ← map_measureReal_apply hS (MeasurableSet.singleton _), sum_measureReal_singleton] simp @@ -2015,7 +2016,7 @@ theorem rho_PFR_conjecture [MeasurableSpace G] [DiscreteMeasurableSpace G] rw [← Measure.sum_smul_dirac (μ := (ℙ : Measure Ω').map X₁)] simp [A] have : IsProbabilityMeasure ((ℙ : Measure Ω').map X₁) := - isProbabilityMeasure_map hX₁.aemeasurable + inferInstance exact IsProbabilityMeasure.ne_zero _ B have h_unif : IsUniform (symmGroup X₁ hX₁) (fun ω ↦ X₁ ω - x₀) := by have h' : d[X₁ # X₁] = 0 := by diff --git a/LeanPool/PFR/TauFunctional.lean b/LeanPool/PFR/TauFunctional.lean index 2a6bdcd99e..867db18841 100644 --- a/LeanPool/PFR/TauFunctional.lean +++ b/LeanPool/PFR/TauFunctional.lean @@ -192,8 +192,7 @@ lemma is_tau_min (h : tauMinimizes p X₁ X₂) (h1 : Measurable X₁') (h2 : Me let ν₂ := (ℙ : Measure Ω'₂).map X₂' have B : τ[X₁' # X₂' | p] = τ[id; ν₁ # id; ν₂ | p] := (identDistrib_id_right h1.aemeasurable).tau_eq p (identDistrib_id_right h2.aemeasurable) - convert h ν₁ ν₂ (Measure.isProbabilityMeasure_map h1.aemeasurable) - (Measure.isProbabilityMeasure_map h2.aemeasurable) + convert h ν₁ ν₂ inferInstance inferInstance omit [IsProbabilityMeasure (ℙ : Measure Ω₀₁)] [IsProbabilityMeasure (ℙ : Measure Ω₀₂)] [Finite G] [IsProbabilityMeasure (ℙ : Measure Ω)] in diff --git a/LeanPool/PFR/TorsionEndgame.lean b/LeanPool/PFR/TorsionEndgame.lean index dea9763dda..bf406103aa 100644 --- a/LeanPool/PFR/TorsionEndgame.lean +++ b/LeanPool/PFR/TorsionEndgame.lean @@ -576,7 +576,8 @@ lemma dist_of_U_add_le {G : Type*} [MeasurableFinGroup G] {Ω : Type u} [hΩ : M rw [←entropy_add_left', ←entropy_neg_left] <;> try fun_prop congr!; rw [←add_eq_zero_iff_neg_eq, ←hsum]; abel let _hG : MeasureSpace G := ⟨Measure.map (T₁ + T₂) ℙ⟩ - let _ : IsProbabilityMeasure (ℙ: Measure G) := Measure.isProbabilityMeasure_map (by fun_prop) + let _ : IsProbabilityMeasure (ℙ: Measure G) := + inferInstanceAs (IsProbabilityMeasure (Measure.map (T₁ + T₂) ℙ)) change ∫ x, (fun z ↦ d[T₁; ℙ[|(T₁ + T₂) ⁻¹' {z}] # T₂; ℙ[|(T₁ + T₂) ⁻¹' {z}]]) x ≤ 3 * I[T₁ : T₂] + 2 * H[T₁ + T₂] - H[T₁] - H[T₂] at h1 @@ -667,7 +668,8 @@ lemma k_eq_zero (hη_eq : p.η = 1 / (32 * p.m ^ 3)) : k = 0 := by exact mutual_information_le_t_23 hΩ h_min h_mes h_indep hident _ = _ := by ring let _ : MeasureSpace G := ⟨Measure.map W ℙ⟩ - have _ : IsProbabilityMeasure (ℙ: Measure G) := Measure.isProbabilityMeasure_map (by fun_prop) + have _ : IsProbabilityMeasure (ℙ: Measure G) := + inferInstanceAs (IsProbabilityMeasure (Measure.map W ℙ)) let δ' : G → ℝ := fun w ↦ p.m * (2 + p.η / 2) * (δ w) + p.η * ∑ i, d[X i; ℙ # Z2; ℙ[|W ⁻¹' {w}]] have main_est {w:G} (hw: ℙ {w} ≠ 0) : k ≤ δ' w := by let μ : Measure Ω' := ℙ[|W ⁻¹' {w}] diff --git a/LeanPool/PFR/WeakPFR.lean b/LeanPool/PFR/WeakPFR.lean index aef0c09f05..2c0b642cc2 100644 --- a/LeanPool/PFR/WeakPFR.lean +++ b/LeanPool/PFR/WeakPFR.lean @@ -547,9 +547,9 @@ lemma single_fibres {G H Ω Ω' : Type*} unfold M unfold entropy have : IsProbabilityMeasure (.map (φ ∘ UA) ℙ) := - Measure.isProbabilityMeasure_map (.comp_measurable .of_discrete hUA') + inferInstance have : IsProbabilityMeasure (.map (φ ∘ UB) ℙ) := - Measure.isProbabilityMeasure_map (.comp_measurable .of_discrete hUB') + inferInstance rewrite [← Finset.sum_product', ← tsum_eq_sum (L := SummationFilter.unconditional _) fun _ ↦ h_compl, ← measureEntropy_prod] apply tsum_congr; intro; congr @@ -750,7 +750,7 @@ lemma weak_PFR_asymm_prelim (A B : Set G) [A_fin : Finite A] [B_fin : Finite B] simp only [one_div, gt_iff_lt, inv_pos, Nat.cast_pos, Finset.card_pos] exact (Finite.toFinset_nonempty (toFinite A)).mpr hnA have _ : IsProbabilityMeasure ((ℙ).map UA) := - Measure.isProbabilityMeasure_map (Measurable.aemeasurable hUA_mes) + inferInstance replace this := single ((ℙ).map UA) hx this rwa [Set.mem_preimage, Set.mem_singleton_iff] at this have hxx : Ax = A := by @@ -774,7 +774,7 @@ lemma weak_PFR_asymm_prelim (A B : Set G) [A_fin : Finite A] [B_fin : Finite B] simp only [one_div, gt_iff_lt, inv_pos, Nat.cast_pos, Finset.card_pos] exact (Finite.toFinset_nonempty (toFinite B)).mpr hnB have _ : IsProbabilityMeasure ((ℙ).map UB) := - Measure.isProbabilityMeasure_map (Measurable.aemeasurable hUB_mes) + inferInstance replace this := single ((ℙ).map UB) hy this rwa [Set.mem_preimage, Set.mem_singleton_iff] at this have hyy : By = B := by diff --git a/LeanPool/PartialRegularity/Extension.lean b/LeanPool/PartialRegularity/Extension.lean index 0ad1510646..813b78d001 100644 --- a/LeanPool/PartialRegularity/Extension.lean +++ b/LeanPool/PartialRegularity/Extension.lean @@ -154,7 +154,7 @@ lemma factorial_le_prod_primes (S : Finset ℕ) (hS : ∀ p ∈ S, Nat.Prime p) rw [hprod_eq] calc ∏ i ∈ Finset.range l.length, (i + 2) = ∏ i : Fin l.length, (i.val + 2) := (Fin.prod_univ_eq_prod_range _ _).symm - _ ≤ ∏ i : Fin l.length, l.get i := Finset.prod_le_prod' fun i _ => + _ ≤ ∏ i : Fin l.length, l.get i := Finset.prod_le_prod fun i _ => sorted_primes_get_ge l hl_sorted hl_ge2 i lemma primeFactors_factorial_le_1 (n : ℕ) (hn : 0 < n) : diff --git a/LeanPool/Rado/Surface/Assembly.lean b/LeanPool/Rado/Surface/Assembly.lean index 8f870f85fc..67f134b3b8 100644 --- a/LeanPool/Rado/Surface/Assembly.lean +++ b/LeanPool/Rado/Surface/Assembly.lean @@ -152,7 +152,7 @@ theorem secondCountable_configY {e : OpenPartialHomeomorph X ℂ} exact ⟨⟨q, hqC⟩, hqT, Subtype.ext hqy⟩ rw [himg] exact (ConjEtale.isOpenMap_proj _ (hT'.inter hCopen)).preimage continuous_subtype_val - exact (hgopen.isQuotientMap hgcont hgsurj).secondCountableTopology hgopen + exact (show IsOpenQuotientMap g from ⟨hgsurj, hgcont, hgopen⟩).secondCountableTopology /-- **Radó's theorem**, instance form: a connected Hausdorff Riemann surface is second countable. `X = configY e ∪ (chart ball)`, both open and second diff --git a/LeanPool/RiemannRochFunctionFields/FunctionField/Divisor.lean b/LeanPool/RiemannRochFunctionFields/FunctionField/Divisor.lean index f993989d66..e441bb8f9b 100644 --- a/LeanPool/RiemannRochFunctionFields/FunctionField/Divisor.lean +++ b/LeanPool/RiemannRochFunctionFields/FunctionField/Divisor.lean @@ -393,11 +393,30 @@ theorem infinite_intNorm_div_eq_norm (x : Kˣ) (n : infiniteIntegers k K) /-- The ideal-valued weight whose restriction to finite height-one primes is `placeDegree`. -/ noncomputable def finiteIdealWeight (P : Ideal (ringOfIntegers k K)) : ℕ := - Module.finrank k (k[X] ⧸ P.under k[X]) * P.inertiaDeg k[X] + Module.finrank k (k[X] ⧸ P.under k[X]) * + Module.finrank (k[X] ⧸ P.under k[X]) (ringOfIntegers k K ⧸ P) /-- The ideal-valued weight whose restriction to infinite height-one primes is `placeDegree`. -/ noncomputable def infiniteIdealWeight (P : Ideal (infiniteIntegers k K)) : ℕ := - P.inertiaDeg (inftyValuationSubring k) + Module.finrank (inftyValuationSubring k ⧸ P.under (inftyValuationSubring k)) + (infiniteIntegers k K ⧸ P) + +/-- At a maximal ideal, the quotient-based finite weight agrees with the residue-field formula. -/ +theorem finiteIdealWeight_eq_inertiaDeg (P : Ideal (ringOfIntegers k K)) [P.IsMaximal] : + finiteIdealWeight k K P = + Module.finrank k (k[X] ⧸ P.under k[X]) * P.inertiaDeg k[X] := by + let : (P.under k[X]).IsMaximal := Ideal.IsMaximal.under k[X] P + rw [finiteIdealWeight, Ideal.inertiaDeg_eq_of_isMaximal (P.under k[X]) P] + +omit [Algebra k[X] K] [IsScalarTower k[X] k⟮X⟯ K] [FunctionField k K] + [Algebra.IsSeparable k⟮X⟯ K] in +/-- At a maximal ideal, the quotient-based infinite weight is its residue-field inertia degree. -/ +theorem infiniteIdealWeight_eq_inertiaDeg (P : Ideal (infiniteIntegers k K)) [P.IsMaximal] : + infiniteIdealWeight k K P = P.inertiaDeg (inftyValuationSubring k) := by + let : (P.under (inftyValuationSubring k)).IsMaximal := + Ideal.IsMaximal.under (inftyValuationSubring k) P + rw [infiniteIdealWeight, + Ideal.inertiaDeg_eq_of_isMaximal (P.under (inftyValuationSubring k)) P] /-- The finite-chart contribution of a principal divisor is the degree at infinity of the field norm. -/ @@ -415,7 +434,8 @@ theorem finitePrincipalDegree_eq_intDegree_norm (x : Kˣ) : have hd : (d : S) ≠ 0 := by simpa only [mem_nonZeroDivisors_iff_ne_zero] using d.property have hdeg := FractionalIdeal.weightedDegree_principal_mk' - (R := S) (K := K) (finiteIdealWeight k K) x n d hnd + (R := S) (K := K) + (fun P => Module.finrank k (k[X] ⧸ P.under k[X]) * P.inertiaDeg k[X]) x n d hnd have hnormn := finite_factorDegree_eq_relNorm k K (Ideal.span {n}) (Ideal.span_singleton_eq_bot.not.mpr hn) have hnormd := finite_factorDegree_eq_relNorm k K (Ideal.span {(d : S)}) @@ -442,7 +462,6 @@ theorem finitePrincipalDegree_eq_intDegree_norm (x : Kˣ) : (fun v m => m * (placeDegree k K (Sum.inl v) : ℤ)) = (pn.natDegree : ℤ) - (pd.natDegree : ℤ) := by rw [← hnormn, ← hnormd] - unfold finiteIdealWeight at hdeg simpa only [FractionalIdeal.weightedDegree_apply, placeDegree_finite_eq_base_mul_inertiaDeg] using hdeg have hratio := finite_intNorm_div_eq_norm k K x n d hnd @@ -475,7 +494,7 @@ theorem infinitePrincipalDegree_eq_neg_intDegree_norm (x : Kˣ) : have hd : (d : S) ≠ 0 := by simpa only [mem_nonZeroDivisors_iff_ne_zero] using d.property have hdeg := FractionalIdeal.weightedDegree_principal_mk' - (R := S) (K := K) (infiniteIdealWeight k K) x n d hnd + (R := S) (K := K) (fun P => P.inertiaDeg A) x n d hnd have hnormn := infinite_factorDegree_eq_relNorm k K (Ideal.span {n}) (Ideal.span_singleton_eq_bot.not.mpr hn) have hnormd := infinite_factorDegree_eq_relNorm k K (Ideal.span {(d : S)}) @@ -516,7 +535,6 @@ theorem infinitePrincipalDegree_eq_neg_intDegree_norm (x : Kˣ) : -RatFunc.intDegree (qn : k⟮X⟯) - (-RatFunc.intDegree (qd : k⟮X⟯)) := by have hdeg' := hdeg - unfold infiniteIdealWeight at hdeg' simp only [FractionalIdeal.weightedDegree_apply] at hdeg' rw [hupn, hupd] at hdeg' simpa only [placeDegree_infinite_eq_inertiaDeg] using hdeg' diff --git a/LeanPool/Sabidussi/LoopMultigraph.lean b/LeanPool/Sabidussi/LoopMultigraph.lean index 928bad1a08..98637f1441 100644 --- a/LeanPool/Sabidussi/LoopMultigraph.lean +++ b/LeanPool/Sabidussi/LoopMultigraph.lean @@ -8,7 +8,7 @@ import LeanPool.Sabidussi.Statement import Mathlib.Data.Fin.Rev import Mathlib.Logic.Equiv.Fin.Rotate import Mathlib.Data.Finset.Card -import Mathlib.Data.Finite.Set +import Mathlib.Basic.Finite.Set import Mathlib.Data.Fintype.Sets /-! diff --git a/LeanPool/SemicircleLaw/SemicircleDistribution.lean b/LeanPool/SemicircleLaw/SemicircleDistribution.lean index 2654ab85ad..ad632cfec8 100644 --- a/LeanPool/SemicircleLaw/SemicircleDistribution.lean +++ b/LeanPool/SemicircleLaw/SemicircleDistribution.lean @@ -11,7 +11,8 @@ import Mathlib.MeasureTheory.Function.JacobianOneDim import Mathlib.MeasureTheory.Integral.IntegrableOn import Mathlib.MeasureTheory.Integral.Bochner.ContinuousLinearMap import Mathlib.MeasureTheory.Measure.Decomposition.RadonNikodym -import Mathlib.MeasureTheory.Measure.Dirac +import Mathlib.MeasureTheory.Measure.Dirac.Def +import Mathlib.MeasureTheory.Measure.Dirac.Basic import Mathlib.MeasureTheory.Measure.Lebesgue.Basic import Mathlib.MeasureTheory.Measure.WithDensity import Mathlib.MeasureTheory.Group.Integral diff --git a/LeanPool/SteinhausThreeGap/Basic.lean b/LeanPool/SteinhausThreeGap/Basic.lean index 15546b9aec..3a3d549fc5 100644 --- a/LeanPool/SteinhausThreeGap/Basic.lean +++ b/LeanPool/SteinhausThreeGap/Basic.lean @@ -10,7 +10,7 @@ import Mathlib.Algebra.Order.Floor.Ring import Mathlib.Data.Finset.Card import Mathlib.Data.Finset.Max import Mathlib.Data.Finset.Sort -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic import Mathlib.Order.Interval.Set.Basic import Mathlib.Tactic.Linarith import Mathlib.Tactic.NormNum diff --git a/LeanPool/SyntheticEuclid4/Axioms.lean b/LeanPool/SyntheticEuclid4/Axioms.lean index 18132ecea1..ae83018aa8 100644 --- a/LeanPool/SyntheticEuclid4/Axioms.lean +++ b/LeanPool/SyntheticEuclid4/Axioms.lean @@ -3,7 +3,7 @@ Copyright (c) 2026 André Hernandez-Espiet, Vladimir Sedlacek. All rights reserv Released under Apache 2.0 license as described in the file LICENSE. Authors: André Hernandez-Espiet, Vladimir Sedlacek -/ -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic import Mathlib.Data.Set.Finite.Basic /-! diff --git a/LeanPool/ThreeGap/ChevallierGapBound.lean b/LeanPool/ThreeGap/ChevallierGapBound.lean index b3120faeb3..970c476860 100644 --- a/LeanPool/ThreeGap/ChevallierGapBound.lean +++ b/LeanPool/ThreeGap/ChevallierGapBound.lean @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Vico Bonfioli -/ -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic import Mathlib.Data.Nat.Find import Mathlib.Order.Monotone.Basic import Mathlib.Tactic.Linarith diff --git a/LeanPool/Turan3/Turans3rdProof.lean b/LeanPool/Turan3/Turans3rdProof.lean index cd6e4a7216..58d5df8d7b 100644 --- a/LeanPool/Turan3/Turans3rdProof.lean +++ b/LeanPool/Turan3/Turans3rdProof.lean @@ -7,7 +7,7 @@ Authors: Rodrigo Gutierrez, Yves Jäckle import Mathlib.Combinatorics.SimpleGraph.Clique import Mathlib.Combinatorics.SimpleGraph.DegreeSum import Mathlib.Data.Sym.Card -import Mathlib.Data.NNReal.Basic +import Mathlib.Basic.NNReal.Basic import Mathlib.Analysis.SpecialFunctions.Pow.NNReal import Mathlib.Tactic.WLOG import Mathlib.Tactic.FieldSimp @@ -199,6 +199,7 @@ def Improve (W : FunToMax G) (loose gain : α) (h_neq : gain ≠ loose) : FunToM rw [Finset.mem_filter] at h; exact ⟨h.2.2, h.2.1⟩ rw[filter_eq_S, ←h_sum, remember] +omit [DecidableEq α] in /-- Helper lemma: Given that an edge e is part of gain's incidence set, this lemma proves that gain is in e. @@ -208,6 +209,7 @@ lemma helper_gain_mem {gain : α} (e : Sym2 α) (he : e ∈ G.incidenceFinset ga rw [mem_incidenceFinset] at he exact (edge_mem_incidenceSet_iff (e := ⟨e, G.incidenceSet_subset _ he⟩)).mp he +omit [DecidableEq α] in /-- Helper lemma : Calculates the value (`vp`) of an edge e, where gain is one of the vertices in e, as the product of gain and the other vertex v, in e. @@ -229,6 +231,7 @@ lemma gain_edge_decomp (W : FunToMax G) (gain : α) ) _ s(x,y) help rw [Quot.liftOn_mk] +omit [DecidableEq α] in /-- Helper lemma : Shows that the sum of values of the edges incident to gain is equal to the product of the weight of gain and the sum of the other vertices incident to gain. -/ lemma gain_edge_sum (W : FunToMax G) (gain : α) : @@ -238,6 +241,7 @@ lemma gain_edge_sum (W : FunToMax G) (gain : α) : rw [mul_sum, ← sum_attach] exact sum_congr rfl fun x _ => gain_edge_decomp _ _ gain _ x.prop +omit [DecidableEq α] in /-- Helper lemma : Shows that the sum of values of the edges incident to loose is equal to the product of the weight of loose and the sum of the other vertices incident to loose. -/ lemma loose_edge_sum (W : FunToMax G) (loose : α) : @@ -254,6 +258,7 @@ set corresponding to them. lemma edge_mem_iff {v w : α} : G.Adj v w ↔ ∃ e ∈ G.edgeSet, e = s(v, w) := by simp_all +omit [DecidableEq α] in /-- Helper lemma : States that the incidence set of any vertex is a subset of the entire edge set. -/ @@ -286,6 +291,7 @@ lemma Improve_loose_weight_zero (W : FunToMax G) (loose gain : α) (h_neq : gain (Improve G W loose gain h_neq).w loose = 0 := by dsimp [Improve]; simp only [↓reduceIte] +omit [DecidableEq α] in /-- Helper lemma: Shows that the incidence sets of gain and loose are disjoint (Assuming they are not adjacent). @@ -293,6 +299,7 @@ adjacent). lemma Improve_gain_loose_disjoint {loose gain : α} (h_neq : gain ≠ loose) (h_adj : ¬ G.Adj gain loose) : Disjoint (G.incidenceFinset gain) (G.incidenceFinset loose) := by + classical simp_rw [disjoint_iff_inter_eq_empty, eq_empty_iff_forall_notMem, mem_inter] rintro x ⟨xg,xl⟩ rw [incidenceFinset_eq_filter, mem_filter, mem_edgeFinset] at * @@ -814,6 +821,7 @@ noncomputable def supEdgeFinset (W : FunToMax G) := G.edgeFinset.filter (inSupport G W) +omit [DecidableEq α] in /-- Helper lemma: Explicitly characterizes the definition of supIncidenceFinset: - edges are incident to the vertex - edges are supported -/ @@ -830,6 +838,7 @@ lemma mem_supEdgeFinset {W : FunToMax G} {e : Sym2 α} : e ∈ supEdgeFinset G W ↔ e ∈ (G.edgeFinset) ∧ inSupport G W e := by dsimp [supEdgeFinset]; rw [mem_filter] +omit [DecidableEq α] in /-- Helper lemma: Shows that any edge part of an supported incident set of a vertex, is also part of whole incident set of v. diff --git a/LeanPool/VirasoroProject/IndexTri.lean b/LeanPool/VirasoroProject/IndexTri.lean index 449a6a0563..9707cbcf9b 100644 --- a/LeanPool/VirasoroProject/IndexTri.lean +++ b/LeanPool/VirasoroProject/IndexTri.lean @@ -6,7 +6,7 @@ Authors: Kalle Kytölä import Mathlib.Algebra.Order.Ring.Star import Mathlib.Analysis.Normed.Ring.Lemmas import Mathlib.Data.Int.Star -import Mathlib.Data.Sign.Defs +import Mathlib.Basic.Sign.Defs import Mathlib.Order.CompletePartialOrder /-! diff --git a/LeanPool/VirasoroProject/LieVerma.lean b/LeanPool/VirasoroProject/LieVerma.lean index e6477877bf..166d2c4f2b 100644 --- a/LeanPool/VirasoroProject/LieVerma.lean +++ b/LeanPool/VirasoroProject/LieVerma.lean @@ -3,7 +3,7 @@ Copyright (c) 2026 Kalle Kytölä. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Authors: Kalle Kytölä -/ -import Mathlib.Data.Sign.Defs +import Mathlib.Basic.Sign.Defs import LeanPool.VirasoroProject.LieAlgebraModuleUEA import LeanPool.VirasoroProject.ToMathlib.LinearAlgebra.Basis.FinsumRepr import LeanPool.VirasoroProject.VermaModule diff --git a/LeanPool/VirasoroProject/WittAlgebraCohomology.lean b/LeanPool/VirasoroProject/WittAlgebraCohomology.lean index 3b6e59bf13..6bd7786b38 100644 --- a/LeanPool/VirasoroProject/WittAlgebraCohomology.lean +++ b/LeanPool/VirasoroProject/WittAlgebraCohomology.lean @@ -130,7 +130,7 @@ lemma exists_add_bdry_eq_smul_virasoroCocycle : · -- k = 0 case is true for any cocycle by skew-symmetry simp · -- k = 1 case follows due to the choice of the normalizing coboundary - convert add_bdry_normalizingCochain_apply_lgen_one γ <;> norm_num + convert add_bdry_normalizingCochain_apply_lgen_one γ; norm_num · -- k = 2 case is what determines the multiplicative factor r rw [hr] norm_num diff --git a/LeanPool/Wallace/FullTopology.lean b/LeanPool/Wallace/FullTopology.lean index 6942a897fe..a4880c535d 100644 --- a/LeanPool/Wallace/FullTopology.lean +++ b/LeanPool/Wallace/FullTopology.lean @@ -126,7 +126,7 @@ theorem evaluation_injective (C : FullCharacterPackage G) : theorem initial_isTopologicalAddGroup (C : FullCharacterPackage G) : @IsTopologicalAddGroup G C.initialTopology _ := - topologicalAddGroup_induced C.evaluation + isTopologicalAddGroup_induced C.evaluation theorem initial_t2Space (C : FullCharacterPackage G) : @T2Space G C.initialTopology := by diff --git a/LeanPool/Wallace/Result.lean b/LeanPool/Wallace/Result.lean index 3837a719ea..e314d9765a 100644 --- a/LeanPool/Wallace/Result.lean +++ b/LeanPool/Wallace/Result.lean @@ -6,7 +6,7 @@ Authors: Juliane Trianon Fraga, Vinicius de Oliveira Rodrigues import Mathlib.Algebra.Group.Finsupp import Mathlib.Algebra.Group.Units.Defs -import Mathlib.Data.Real.Basic +import Mathlib.Basic.Real.Basic import Mathlib.Order.Filter.Ultrafilter.Basic import Mathlib.Topology.Algebra.Group.Basic import Mathlib.Topology.Compactness.CountablyCompact diff --git a/LeanPool/Wallace/SeparationInterface.lean b/LeanPool/Wallace/SeparationInterface.lean index 43ebeaab50..ed4489fced 100644 --- a/LeanPool/Wallace/SeparationInterface.lean +++ b/LeanPool/Wallace/SeparationInterface.lean @@ -95,7 +95,7 @@ theorem evaluation_injective (C : SeparationPackage I) : theorem initial_isTopologicalAddGroup (C : SeparationPackage I) : @IsTopologicalAddGroup (I →₀ ℤ) C.initialTopology _ := by - exact topologicalAddGroup_induced C.evaluation + exact isTopologicalAddGroup_induced C.evaluation theorem initial_t2Space (C : SeparationPackage I) : @T2Space (I →₀ ℤ) C.initialTopology := by diff --git a/LeanPool/WhiteheadTheorem/CWComplex/Basic.lean b/LeanPool/WhiteheadTheorem/CWComplex/Basic.lean index 041dc9cadc..65b3b0a16c 100644 --- a/LeanPool/WhiteheadTheorem/CWComplex/Basic.lean +++ b/LeanPool/WhiteheadTheorem/CWComplex/Basic.lean @@ -162,7 +162,7 @@ noncomputable abbrev pushoutInr := lemma attachMaps_apply_eq_ι_desc : att.attachMaps α = Limits.Sigma.ι (fun _ ↦ S) α ≫ Limits.Sigma.desc att.attachMaps := - (Limits.Sigma.ι_desc _ _).symm + (Limits.Sigma.ι_comp_desc _ _).symm /-- ``` diff --git a/LeanPool/WhiteheadTheorem/CWComplex/IProd/Def.lean b/LeanPool/WhiteheadTheorem/CWComplex/IProd/Def.lean index 7d690097ac..3f42483a6d 100644 --- a/LeanPool/WhiteheadTheorem/CWComplex/IProd/Def.lean +++ b/LeanPool/WhiteheadTheorem/CWComplex/IProd/Def.lean @@ -228,7 +228,7 @@ lemma commSqSkSk (n : ℕ) : -- The underlying morphism equality follows from the universal property of the coproduct. apply Limits.Sigma.hom_ext intro α - simp only [Limits.Sigma.ι_desc_assoc, Limits.Sigma.ι_map_assoc, + simp only [Limits.Sigma.ι_comp_desc_assoc, Limits.Sigma.ι_map_assoc, ] -- Now we need to show `attachMaps α ≫ skInclSucc X n = diskBoundaryIncl (n+1) ≫ -- Sigma.ι _ α ≫ sigmaDisksInclToSk X n`. @@ -239,7 +239,7 @@ lemma commSqSkSk (n : ℕ) : (diskPair.homeoCubePairULift (n + 1)).hom.right ≫ cubeSplitAtLast.hom ≫ ofHom ((ContinuousMap.id I).prodMap (X.cubeInclToSk α).hom)) ≫ Limits.pushout.inr (l X (n + 1)) (r X (n + 1))) - rw [Limits.Sigma.ι_desc] + rw [Limits.Sigma.ι_comp_desc] -- Use `Arrow.Hom.w` to move `diskBoundaryIncl` past `right`. have hw : diskBoundaryIncl (n + 1) ≫ (diskPair.homeoCubePairULift (n + 1)).hom.right = (diskPair.homeoCubePairULift (n + 1)).hom.left ≫ cubeBoundaryIncl (n + 1) := @@ -341,7 +341,7 @@ lemma w' : xskl X n ≫ l' X n Z = xskr X n ≫ r' X n Z := by apply Limits.Sigma.hom_ext intro α unfold IProd.xskl IProd.xskr - rw [Limits.Sigma.ι_desc_assoc, Limits.Sigma.ι_map_assoc] + rw [Limits.Sigma.ι_comp_desc_assoc, Limits.Sigma.ι_map_assoc] change _ = diskBoundaryIncl n ≫ Limits.Sigma.ι (fun _ ↦ 𝔻 n) α ≫ r' .. ext x t unfold l' r' @@ -356,7 +356,7 @@ lemma w' : xskl X n ≫ l' X n Z = xskr X n ≫ r' X n Z := by (Limits.Sigma.ι (fun _ ↦ ∂𝔻 (n + 1)) α ≫ Limits.Sigma.desc (IProd.attachMaps X)) xt := by unfold IProd.attachMaps xt - rw [Limits.Sigma.ι_desc] + rw [Limits.Sigma.ι_comp_desc] change _ = ((diskPair.homeoCubePairULift _).inv.left ≫ (diskPair.homeoCubePairULift _).hom.left ≫ cubeBoundary.mapOfBotTopSides (cubeAttBotOrTop X α) (cubeAttSides X α) @@ -392,7 +392,7 @@ lemma w' : xskl X n ≫ l' X n Z = xskr X n ≫ r' X n Z := by change (Limits.Sigma.ι (fun _ ↦ ∂𝔻 (n + 1)) α ≫ (Limits.Sigma.map fun _ ↦ diskBoundaryIncl (n + 1)) ≫ Z.inr) xt = (Limits.Sigma.ι (fun _ ↦ 𝔻 n) α ≫ r' X n Z) (diskBoundaryIncl n x) t - rw [Limits.Sigma.ι_map_assoc, Limits.Sigma.ι_desc] + rw [Limits.Sigma.ι_map_assoc, Limits.Sigma.ι_comp_desc] rfl /-- `d'` -/ @@ -481,7 +481,7 @@ lemma w'' : l X (n + 1) ≫ l'' X n Z = r X (n + 1) ≫ r'' X n Z := by refine Limits.Sigma.hom_ext _ _ fun α ↦ ?_ change _ = (Limits.Sigma.ι (fun x ↦ 𝔻 n) α ≫ r' ..) ≫ eₜ unfold r' eₜ - rw [Limits.Sigma.ι_desc] + rw [Limits.Sigma.ι_comp_desc] have : Limits.Sigma.ι (fun _ ↦ 𝔻 n) α ≫ Limits.pushout.inr (xskl X n) (xskr X n) ≫ (X.attachCells n).isoPushout.inv ≫ X.skIncl (n + 1) ≫ ofHom ⟨fun x ↦ ⟨t, x⟩, by fun_prop⟩ ≫ Limits.pushout.inl (l X n) (r X n) = @@ -510,7 +510,7 @@ lemma w'' : l X (n + 1) ≫ l'' X n Z = r X (n + 1) ≫ r'' X n Z := by = (diskPair.homeoCubePairULift (n + 1)).inv.left ≫ IProd.attachMaps X α := by congr 1 - exact Limits.Sigma.ι_desc _ α + exact Limits.Sigma.ι_comp_desc _ α _ = cubeBoundary.mapOfBotTopSides (IProd.cubeAttBotOrTop X α) (IProd.cubeAttSides X α) (IProd.cubeAtt_compatible X α) := by unfold IProd.attachMaps @@ -663,7 +663,7 @@ lemma coconeInr (n : ℕ) (Z : Limits.PushoutCocone _ _) : Limits.pushout.desc (l'' X n Z) (r'' X n Z) (w'' X n Z)) = Z.inr rw [Limits.pushout.inr_desc] refine Limits.Sigma.hom_ext _ _ fun α ↦ ?_ - rw [← Category.assoc, Limits.Sigma.ι_desc] + rw [← Category.assoc, Limits.Sigma.ι_comp_desc] apply CategoryTheory.eq_of_comp_right_iso_eq (diskPair.homeoCubePairULift (n + 1)).inv.right simp only [Category.assoc, Arrow.inv_hom_id_right_assoc] apply CategoryTheory.eq_of_comp_right_iso_eq cubeSplitAtLast.inv @@ -682,7 +682,7 @@ lemma coconeInr (n : ℕ) (Z : Limits.PushoutCocone _ _) : simp only [Category.assoc, Iso.inv_hom_id, Category.comp_id] -- Compute `Sigma.ι α ≫ r' = (diskPair.homeoCubePairULift n).hom.right ≫ ofHom (curry ...)`. have hι : Limits.Sigma.ι (fun (_ : (X.attachCells n).cells) ↦ 𝔻 n) α ≫ r' X n Z = _ := - Limits.Sigma.ι_desc _ α + Limits.Sigma.ι_comp_desc _ α ext ⟨t, y⟩ unfold r'' simp only [ContinuousMap.argSwap, TopCat.hom_comp, ContinuousMap.coe_mk, ofHom_comp, hom_ofHom, @@ -811,7 +811,7 @@ lemma pushoutSkSk (n : ℕ) : rw [← hdr, (by rfl : (cocone X n).inr = IProd.sigmaDisksInclToSk X n)] -- Combine nested `Hom.hom` applications into a single composition. simp only [← TopCat.comp_app] - -- Reduce the RHS `(Sigma.desc f).hom (Sigma.ι α x) t` via `Sigma.ι_desc` at morphism level. + -- Reduce the RHS via `Sigma.ι_comp_desc` at the morphism level. have hsi : Limits.Sigma.ι (fun (_ : (X.attachCells n).cells) ↦ 𝔻 n) α ≫ (Limits.Sigma.desc fun α ↦ Arrow.Hom.right (diskPair.homeoCubePairULift n).hom ≫ @@ -824,7 +824,7 @@ lemma pushoutSkSk (n : ℕ) : ((Hom.hom (Limits.Sigma.ι (fun _ ↦ 𝔻 (n + 1)) α)).comp ((Hom.hom (Arrow.Hom.right (diskPair.homeoCubePairULift (n + 1)).inv)).comp ((Hom.hom cubeSplitAtLast.inv).comp ContinuousMap.prodSwap)))).curry := - Limits.Sigma.ι_desc _ α + Limits.Sigma.ι_comp_desc _ α -- Provide the morphism-level identity for the LHS. have hci : (Limits.Sigma.ι (fun (_ : (X.attachCells n).cells) ↦ 𝔻 n) α ≫ Limits.pushout.inr (Limits.Sigma.desc (X.attachCells n).attachMaps) @@ -877,7 +877,7 @@ lemma pushoutSkSk (n : ℕ) : Arrow.Hom.right (diskPair.homeoCubePairULift (n + 1)).hom ≫ cubeSplitAtLast.hom ≫ ofHom ((ContinuousMap.id ↑I).prodMap (Hom.hom (X.cubeInclToSk α))) := - Limits.Sigma.ι_desc _ α + Limits.Sigma.ι_comp_desc _ α -- Evaluate the curried form on the RHS manually so the result matches the LHS. change (Hom.hom d) ((Hom.hom (Limits.pushout.inr (l X (n + 1)) (r X (n + 1)))) (t, (Hom.hom (Arrow.Hom.right (diskPair.homeoCubePairULift n).hom ≫ diff --git a/LeanPool/WhiteheadTheorem/Compressible/CWComplex.lean b/LeanPool/WhiteheadTheorem/Compressible/CWComplex.lean index 4ed345c4b1..dbddf2cc5a 100644 --- a/LeanPool/WhiteheadTheorem/Compressible/CWComplex.lean +++ b/LeanPool/WhiteheadTheorem/Compressible/CWComplex.lean @@ -108,7 +108,7 @@ lemma coprod {A B X Y : TopCat.{u}} {i : A ⟶ X} {j : B ⟶ Y} let H := Limits.Sigma.desc fun c ↦ ofHom (h c) have hmap c : Limits.Sigma.ι (fun _ ↦ A) c ≫ Limits.Sigma.map (fun _ : cells ↦ i) = i ≫ Limits.Sigma.ι (fun _ ↦ X) c := Limits.Sigma.ι_map _ _ - have hιH c : Limits.Sigma.ι (fun _ ↦ X) c ≫ H = (l c).curriedH := Limits.Sigma.ι_desc _ _ + have hιH c : Limits.Sigma.ι (fun _ ↦ X) c ≫ H = (l c).curriedH := Limits.Sigma.ι_comp_desc _ _ refine ⟨Nonempty.intro <| LiftStructUpToRelHomotopy.curriedMk L ?_ H ?_ ?_ fun t ↦ ?_⟩ · apply Limits.Sigma.hom_ext intro c @@ -116,7 +116,7 @@ lemma coprod {A B X Y : TopCat.{u}} {i : A ⟶ X} {j : B ⟶ Y} change Limits.Sigma.ι (fun _ ↦ A) c ≫ (Limits.Sigma.map fun _ ↦ i) ≫ L = _ rw [← Category.assoc, hmap, Category.assoc] change i ≫ Limits.Sigma.ι (fun _ ↦ X) c ≫ Limits.Sigma.desc (fun c ↦ (l c).l) = _ - rw [Limits.Sigma.ι_desc] + rw [Limits.Sigma.ι_comp_desc] exact hfac · apply Limits.Sigma.hom_ext intro c @@ -126,7 +126,7 @@ lemma coprod {A B X Y : TopCat.{u}} {i : A ⟶ X} {j : B ⟶ Y} · apply Limits.Sigma.hom_ext intro c have h1 := (l c).curriedH_apply_one - have hιL : Limits.Sigma.ι (fun _ ↦ X) c ≫ L = (l c).l := Limits.Sigma.ι_desc _ _ + have hιL : Limits.Sigma.ι (fun _ ↦ X) c ≫ L = (l c).l := Limits.Sigma.ι_comp_desc _ _ change Limits.Sigma.ι (fun _ ↦ X) c ≫ H ≫ PathSpace.eval₁ Y = Limits.Sigma.ι (fun _ ↦ X) c ≫ L ≫ j rw [← Category.assoc, hιH, h1, ← Category.assoc, hιL] diff --git a/scripts/challenge/pins.env b/scripts/challenge/pins.env index 6620d7e65f..ae04cfab1d 100644 --- a/scripts/challenge/pins.env +++ b/scripts/challenge/pins.env @@ -14,7 +14,7 @@ LANDRUN_COMMIT=5ed4a3db3a4ad930d577215c6b9abaa19df7f99f # lean4export must match this repository's lean-toolchain: it reads the oleans # our build produced. The workflow asserts that, and prints the right SHA. -# This is refs/tags/v4.34.0-rc1, matching this branch's toolchain. -LEAN4EXPORT_COMMIT=b18d673bd29b476466a51a3be1012df2ed322b10 +# This is refs/tags/v4.34.0, matching this branch's toolchain. +LEAN4EXPORT_COMMIT=076e8e57707e813375e8f9da8bf989799ace9680 COMPARATOR_COMMIT=71b52ec29e06d4b7d882726553b1ceb99a2499e0 From 6e37332559cee0849b92663dbcece94f0b285e8b Mon Sep 17 00:00:00 2001 From: Vasily Ilin Date: Tue, 15 Sep 2026 21:26:34 +0000 Subject: [PATCH 4/8] Resolve new tactic documentation and simp normal-form lint findings --- LeanPool/Lentil/ProofMode/Tactics/Clear.lean | 22 +++++++++++-------- LeanPool/Lentil/ProofMode/Tactics/Have.lean | 3 +++ .../ForMathlib/SmoothnessOrder.lean | 2 +- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/LeanPool/Lentil/ProofMode/Tactics/Clear.lean b/LeanPool/Lentil/ProofMode/Tactics/Clear.lean index 209a70692c..83ec81cc90 100644 --- a/LeanPool/Lentil/ProofMode/Tactics/Clear.lean +++ b/LeanPool/Lentil/ProofMode/Tactics/Clear.lean @@ -26,15 +26,6 @@ theorem Entails_clear_except {σ : Type u} {hyps : List (NamedPred σ)} {goal : letI hyps' := hyps.filter fun h => toKeep.contains h.name Entails hyps' goal → Entails hyps goal := Entails_drop_hyps _ (by grind) -/-- -`tla_clear * - h₁ h₂ ...` removes every temporal hypothesis except the named -ones. The kept hypotheses stay in their original order. For example, from -`hp : p`, `hq : q`, `hr : r`, -```lean -tla_clear * - hq -``` -leaves only `hq : q`. --/ syntax (name := tlaClearExceptTac) "tla_clear" "*" " -" (ppSpace colGt ident)* : tactic /-- `tla_clear h₁ h₂ ...` removes temporal hypotheses from the proof-mode context. @@ -49,6 +40,19 @@ leaves only `hq : q` in the proof-mode context. -/ syntax (name := tlaClearTac) "tla_clear" (ppSpace colGt ident)+ : tactic +/-- +`tla_clear * - h₁ h₂ ...` removes every temporal hypothesis except the named +ones. The kept hypotheses stay in their original order. For example, from +`hp : p`, `hq : q`, `hr : r`, +```lean +tla_clear * - hq +``` +leaves only `hq : q`. +-/ +tactic_extension tlaClearTac + +attribute [tactic_alt tlaClearTac] tlaClearExceptTac + private def clearTacDSimps := #[``List.filter, ``List.contains, ``List.elem, ``or, ``and, ``not, ``String.reduceBEq, ``String.reduceBNe, ``Bool.false_or, ``Bool.or_false] diff --git a/LeanPool/Lentil/ProofMode/Tactics/Have.lean b/LeanPool/Lentil/ProofMode/Tactics/Have.lean index 18747bf75e..2a2fea2e35 100644 --- a/LeanPool/Lentil/ProofMode/Tactics/Have.lean +++ b/LeanPool/Lentil/ProofMode/Tactics/Have.lean @@ -207,6 +207,9 @@ tla_have := lemma hp ``` adds a new hypothesis named `this` containing the result of `lemma hp`. -/ +tactic_extension tlaHaveTac + +@[tactic_alt tlaHaveTac] syntax (name := tlaHaveAnonTac) "tla_have" " := " term : tactic /-- `tla_replace h := t` replaces the named proof-mode hypothesis `h` by the diff --git a/LeanPool/NavierStokesAndEuler/ForMathlib/SmoothnessOrder.lean b/LeanPool/NavierStokesAndEuler/ForMathlib/SmoothnessOrder.lean index 245cade209..c678064c4b 100644 --- a/LeanPool/NavierStokesAndEuler/ForMathlib/SmoothnessOrder.lean +++ b/LeanPool/NavierStokesAndEuler/ForMathlib/SmoothnessOrder.lean @@ -20,7 +20,7 @@ public section namespace NavierStokesAndEuler -@[simp] theorem le_infinity_iff_ne_top (n : WithTop ℕ∞) : +theorem le_infinity_iff_ne_top (n : WithTop ℕ∞) : n ≤ (⊤ : ℕ∞) ↔ n ≠ ⊤ := by cases n with | top => simp From b78457bf01610d1d80228eae2da861bf2148c12c Mon Sep 17 00:00:00 2001 From: Vasily Ilin Date: Tue, 15 Sep 2026 23:00:44 +0000 Subject: [PATCH 5/8] Preserve coefficient references in minimal theorem exports --- .../PolynomialMethodRestrictedSums/ANRPolynomialMethod.lean | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LeanPool/PolynomialMethodRestrictedSums/ANRPolynomialMethod.lean b/LeanPool/PolynomialMethodRestrictedSums/ANRPolynomialMethod.lean index 2135965984..9b5465760f 100644 --- a/LeanPool/PolynomialMethodRestrictedSums/ANRPolynomialMethod.lean +++ b/LeanPool/PolynomialMethodRestrictedSums/ANRPolynomialMethod.lean @@ -1094,7 +1094,7 @@ theorem ANR_polynomial_method (h : MvPolynomial (Fin (k + 1)) (ZMod p)) (c : Fin (k + 1) → ℕ) (hA : ∀ i, (A i).card = c i + 1) (m : ℕ) (hm : m + h.totalDegree = ∑ i, c i) - (h_coeff : coeff ((∑ i : Fin (k + 1), MvPolynomial.X i) ^ m * h) + (h_coeff : AddMonoidAlgebra.coeff ((∑ i : Fin (k + 1), MvPolynomial.X i) ^ m * h) (Finsupp.equivFunOnFinite.symm c) ≠ 0) : let S : Finset (ZMod p) := (Fintype.piFinset A).filter (fun f => h.eval f ≠ 0) |>.image (fun f => ∑ i, f i) From cd324dd09f113a4900d7f14507f6ea8ffb0aa712 Mon Sep 17 00:00:00 2001 From: Vasily Ilin Date: Thu, 17 Sep 2026 20:36:39 +0000 Subject: [PATCH 6/8] Preserve incoming projects and quotient tower results on Lean 4.34 --- LeanPool/Chvatal/Fourier.lean | 2 +- LeanPool/Chvatal/LayerCake.lean | 2 +- LeanPool/Chvatal/Optimization.lean | 2 +- .../FiniteWitness/Characterization.lean | 2 +- .../FiniteWitness/Simplified/Checkpoints.lean | 2 +- .../FiniteWitness/Width/Endpoints.lean | 2 +- LeanPool/MassFormula/Discriminant.lean | 100 ++++++++---- LeanPool/MassFormula/EisensteinMonogenic.lean | 154 +++++++----------- LeanPool/MassFormula/First.lean | 81 +++++---- LeanPool/MassFormula/RootLifting.lean | 7 +- .../PrimeNumberTheoremAnd/Fourier.lean | 2 - .../PrimeNumberTheoremAnd/Wiener.lean | 13 +- .../Neukirch/ExtensionOfDedekindDomains.lean | 20 +++ .../ANRPolynomialMethod.lean | 5 +- .../SumDifferenceExponent/Quantitative.lean | 17 +- 15 files changed, 217 insertions(+), 194 deletions(-) diff --git a/LeanPool/Chvatal/Fourier.lean b/LeanPool/Chvatal/Fourier.lean index 2b1b6d5941..93cde37077 100644 --- a/LeanPool/Chvatal/Fourier.lean +++ b/LeanPool/Chvatal/Fourier.lean @@ -6,7 +6,7 @@ Authors: Chvatal formalization contributors module public import Mathlib.Data.Fintype.Powerset -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.Algebra.BigOperators.Field public import Mathlib.Algebra.BigOperators.Group.Finset.Sigma public import Mathlib.Algebra.Order.BigOperators.Group.Finset diff --git a/LeanPool/Chvatal/LayerCake.lean b/LeanPool/Chvatal/LayerCake.lean index 7affdc3583..7daec7517b 100644 --- a/LeanPool/Chvatal/LayerCake.lean +++ b/LeanPool/Chvatal/LayerCake.lean @@ -7,7 +7,7 @@ module public import Mathlib.Data.Finset.Max public import Mathlib.Data.Fintype.BigOperators -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic public import Mathlib.Order.UpperLower.Basic public import Mathlib.Algebra.Order.BigOperators.Group.Finset public import Mathlib.Algebra.BigOperators.Ring.Finset diff --git a/LeanPool/Chvatal/Optimization.lean b/LeanPool/Chvatal/Optimization.lean index 3fbdc6a079..4aa5d46e71 100644 --- a/LeanPool/Chvatal/Optimization.lean +++ b/LeanPool/Chvatal/Optimization.lean @@ -5,7 +5,7 @@ Authors: Chvatal formalization contributors -/ module -public import Mathlib.Data.Real.Basic +public import Mathlib.Basic.Real.Basic import Mathlib.Tactic.FieldSimp import Mathlib.Tactic.Linarith import Mathlib.Tactic.Ring diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Characterization.lean b/LeanPool/LanguageGeneration/FiniteWitness/Characterization.lean index 8abd2d81e7..249c05995f 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Characterization.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Characterization.lean @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Xiaoyu Li, Andi Han, Jiaojiao Jiang, Junbin Gao -/ import LeanPool.LanguageGeneration.FiniteWitness.Confirmation -import Mathlib.Logic.Denumerable +import Mathlib.Basic.Denumerable /-! # The complete ordinary-generation finite-witness characterization -/ diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Simplified/Checkpoints.lean b/LeanPool/LanguageGeneration/FiniteWitness/Simplified/Checkpoints.lean index a83cb5191c..b126e2c49c 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Simplified/Checkpoints.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Simplified/Checkpoints.lean @@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE. Authors: Xiaoyu Li, Andi Han, Jiaojiao Jiang, Junbin Gao -/ import LeanPool.LanguageGeneration.FiniteWitness.Simplified.FirstPoints -import Mathlib.Logic.Denumerable +import Mathlib.Basic.Denumerable /-! # Checkpoint interface and its construction from an enumeration diff --git a/LeanPool/LanguageGeneration/FiniteWitness/Width/Endpoints.lean b/LeanPool/LanguageGeneration/FiniteWitness/Width/Endpoints.lean index 1335947a81..6f11c14825 100644 --- a/LeanPool/LanguageGeneration/FiniteWitness/Width/Endpoints.lean +++ b/LeanPool/LanguageGeneration/FiniteWitness/Width/Endpoints.lean @@ -5,7 +5,7 @@ Authors: Xiaoyu Li, Andi Han, Jiaojiao Jiang, Junbin Gao -/ import LeanPool.LanguageGeneration.FiniteWitness.Width.Divergence import LeanPool.LanguageGeneration.FiniteWitness.Width.Singleton -import Mathlib.Logic.Denumerable +import Mathlib.Basic.Denumerable /-! # Endpoint examples and realization of the entire width range diff --git a/LeanPool/MassFormula/Discriminant.lean b/LeanPool/MassFormula/Discriminant.lean index b3172203cc..f1dadf9909 100644 --- a/LeanPool/MassFormula/Discriminant.lean +++ b/LeanPool/MassFormula/Discriminant.lean @@ -178,20 +178,12 @@ private theorem eisenstein_shape {R A : Type*} [CommRing R] [IsLocalRing R] [Com exact ⟨hdegeq, fun i hi => hcoeff i (by rw [hdegeq]; exact hi), hc0⟩ omit [IsUniformAddGroup K] in -/-- Every member of `sigma K n` is generated by a root of an Eisenstein polynomial—the extraction -converse to `isTotallyRamified_adjoin`. Route: `integers L` is a Dedekind domain (Krull–Akizuki -through the separable-finite route, `IsIntegralClosure.isDedekindDomain`); *any* maximal ideal `Q` -of `integers L` lies over `𝓂[K]` (integrality) and contains `maximalIdealAbove L`, so -`IsTotallyRamified` puts the extension of `𝓂[K]` inside `Q ^ n`; an element `ξ` of `Q` outside -`Q ^ 2` then satisfies `eisenstein_shape`, so its minimal polynomial is Eisenstein of degree exactly -`n` and `ξ` generates `L` by dimension count. No fundamental identity summing the `e i * f i` to -`n`, no localness of `integers L`, and no norm computation is needed—the paper's valuation-based -argument (p.1032, around eq. (5)) is replaced by divisibility of ideal powers. -/ -theorem exists_eisenstein_generator (n : ℕ) (hn : 0 < n) +private theorem exists_ramified_ideal_element (n : ℕ) (hn : 0 < n) (L : IntermediateField K (SeparableClosure K)) (hL : L ∈ sigma K n) : - ∃ (x : SeparableClosure K) (π : 𝒪[K]), Irreducible π ∧ IsIntegral 𝒪[K] x ∧ - (minpoly 𝒪[K] x).IsEisensteinAt (Submodule.span 𝒪[K] {π}) ∧ - IntermediateField.adjoin K {x} = L ∧ (minpoly 𝒪[K] x).natDegree = n := by + ∃ (π : 𝒪[K]) (Q : Ideal ↥(integers L)) (ξ : ↥(integers L)), + Irreducible π ∧ Q.IsPrime ∧ + Ideal.map (algebraMap ↥𝒪[K] ↥(integers L)) 𝓂[K] ≤ Q ^ n ∧ + ξ ∈ Q ∧ ξ ∉ Q ^ 2 := by classical obtain ⟨hLn, hLram⟩ := hL have : IsFractionRing ↥𝒪[K] K := @@ -221,7 +213,7 @@ theorem exists_eisenstein_generator (n : ℕ) (hn : 0 < n) obtain ⟨Q, hQmax⟩ := Ideal.exists_maximal ↥(integers L) have := hQmax have hcom : Ideal.comap (algebraMap ↥𝒪[K] ↥(integers L)) Q = 𝓂[K] := - IsLocalRing.eq_maximalIdeal (Ideal.isMaximal_comap_of_isIntegral_of_isMaximal Q) + IsLocalRing.eq_maximalIdeal (Ideal.isMaximal_under_of_isIntegral_of_isMaximal Q) have hmapQ : Ideal.map (algebraMap ↥𝒪[K] ↥(integers L)) 𝓂[K] ≤ Q := by rw [← hcom] exact Ideal.map_comap_le @@ -253,6 +245,39 @@ theorem exists_eisenstein_generator (n : ℕ) (hn : 0 < n) obtain ⟨ξ, hξQ, hξQ2⟩ : ∃ y ∈ Q ^ 1, y ∉ Q ^ 2 := by simpa using Q.exists_mem_pow_notMem_pow_succ hQbot hQmax.ne_top 1 rw [pow_one] at hξQ + exact ⟨π, Q, ξ, hπ, hQmax.isPrime, hpow, hξQ, hξQ2⟩ + +omit [IsUniformAddGroup K] in +/-- Every member of `sigma K n` is generated by a root of an Eisenstein polynomial—the extraction +converse to `isTotallyRamified_adjoin`. Route: `integers L` is a Dedekind domain (Krull–Akizuki +through the separable-finite route, `IsIntegralClosure.isDedekindDomain`); *any* maximal ideal `Q` +of `integers L` lies over `𝓂[K]` (integrality) and contains `maximalIdealAbove L`, so +`IsTotallyRamified` puts the extension of `𝓂[K]` inside `Q ^ n`; an element `ξ` of `Q` outside +`Q ^ 2` then satisfies `eisenstein_shape`, so its minimal polynomial is Eisenstein of degree exactly +`n` and `ξ` generates `L` by dimension count. No fundamental identity summing the `e i * f i` to +`n`, no localness of `integers L`, and no norm computation is needed—the paper's valuation-based +argument (p.1032, around eq. (5)) is replaced by divisibility of ideal powers. -/ +theorem exists_eisenstein_generator (n : ℕ) (hn : 0 < n) + (L : IntermediateField K (SeparableClosure K)) (hL : L ∈ sigma K n) : + ∃ (x : SeparableClosure K) (π : 𝒪[K]), Irreducible π ∧ IsIntegral 𝒪[K] x ∧ + (minpoly 𝒪[K] x).IsEisensteinAt (Submodule.span 𝒪[K] {π}) ∧ + IntermediateField.adjoin K {x} = L ∧ (minpoly 𝒪[K] x).natDegree = n := by + classical + obtain ⟨hLn, hLram⟩ := hL + have : IsFractionRing ↥𝒪[K] K := + inferInstanceAs (IsFractionRing (valuation K).valuationSubring K) + have : FiniteDimensional K ↥L := + FiniteDimensional.of_finrank_pos (by rw [hLn]; exact hn) + have hIC : IsIntegralClosure ↥(integers L) ↥𝒪[K] ↥L := + inferInstanceAs (IsIntegralClosure ↥(integralClosure ↥𝒪[K] ↥L) ↥𝒪[K] ↥L) + have hDed : IsDedekindDomain ↥(integers L) := + IsIntegralClosure.isDedekindDomain ↥𝒪[K] K ↥L ↥(integers L) + have hInt : Algebra.IsIntegral ↥𝒪[K] ↥(integers L) := + IsIntegralClosure.isIntegral_algebra ↥𝒪[K] (A := ↥(integers L)) ↥L + obtain ⟨π, Q, ξ, hπ, hQprime, hpow, hξQ, hξQ2⟩ := + exists_ramified_ideal_element K n hn L ⟨hLn, hLram⟩ + have hπspan : 𝓂[K] = Ideal.span {π} := + (IsDiscreteValuationRing.irreducible_iff_uniformizer π).mp hπ -- the minimal polynomial of `ξ` over `𝒪[K]` have hξint : IsIntegral ↥𝒪[K] ξ := Algebra.IsIntegral.isIntegral ξ set G : Polynomial ↥𝒪[K] := minpoly ↥𝒪[K] ξ with hG @@ -281,7 +306,7 @@ theorem exists_eisenstein_generator (n : ℕ) (hn : 0 < n) rwa [hmKx, hGmonic.natDegree_map, hLn] at h1 -- the abstract core obtain ⟨hdegeq, hcoeffs, hc0⟩ := - eisenstein_shape hn hQmax.isPrime hpow hξQ hξQ2 hGmonic hGa hdegle + eisenstein_shape hn hQprime hpow hξQ hξQ2 hGmonic hGa hdegle -- Eisenstein packaging have heis : G.IsEisensteinAt (Submodule.span ↥𝒪[K] {π}) := by refine ⟨?_, ?_, ?_⟩ @@ -318,6 +343,29 @@ theorem exists_eisenstein_generator (n : ℕ) (hn : 0 < n) · rw [hminx] exact hdegeq +private lemma aeval_derivative_mem_pow {R A : Type*} [CommRing R] [CommRing A] + [Algebra R A] {g : Polynomial R} {ξ : A} (hgmonic : g.Monic) + (hn : 0 < g.natDegree) (hcoeffmem : ∀ k, k < g.natDegree → + algebraMap R A (g.coeff k) ∈ Ideal.span {ξ} ^ g.natDegree) : + Polynomial.aeval ξ (Polynomial.derivative g) ∈ Ideal.span {ξ} ^ (g.natDegree - 1) := by + let n := g.natDegree + have hdeg : (Polynomial.derivative g).natDegree < n := + Polynomial.natDegree_derivative_lt hn.ne' + rw [Polynomial.aeval_eq_sum_range' hdeg] + refine Ideal.sum_mem _ fun i hi => ?_ + rw [Finset.mem_range] at hi + rw [Polynomial.coeff_derivative, Algebra.smul_def, map_mul] + rcases Nat.lt_or_ge (i + 1) n with hi1 | hi1 + · exact Ideal.mul_mem_right _ _ (Ideal.mul_mem_right _ _ + (Ideal.pow_le_pow_right (by omega) (hcoeffmem (i + 1) hi1))) + · have hieq : i = n - 1 := by omega + have hcoeff : g.coeff (i + 1) = 1 := by + rw [show i + 1 = n from by omega] + exact hgmonic.coeff_natDegree + rw [hcoeff] + refine Ideal.mul_mem_left _ _ ?_ + rw [hieq, Ideal.span_singleton_pow, Ideal.mem_span_singleton] + omit [IsUniformAddGroup K] in /-- The norm of the derivative of `g` at an Eisenstein root has a preimage in the `n - 1`-st power of `𝓂[K]`—the derivative lies in the `n - 1`-st power of the ideal `(ξ)` inside the integral @@ -380,23 +428,8 @@ private theorem norm_derivative_core {π : 𝒪[K]} (hπ : Irreducible π) {x : rw [he, map_mul] exact Ideal.mul_mem_right _ _ hb₀mem -- the derivative at `ξ` sits in `(ξ) ^ (n - 1)` - have hYmem : Polynomial.aeval ξ (Polynomial.derivative g) ∈ Ideal.span {ξ} ^ (n - 1) := by - have hdeg : (Polynomial.derivative g).natDegree < n := - Polynomial.natDegree_derivative_lt hn.ne' - rw [Polynomial.aeval_eq_sum_range' hdeg] - refine Ideal.sum_mem _ fun i hi => ?_ - rw [Finset.mem_range] at hi - rw [Polynomial.coeff_derivative, Algebra.smul_def, map_mul] - rcases Nat.lt_or_ge (i + 1) n with hi1 | hi1 - · exact Ideal.mul_mem_right _ _ (Ideal.mul_mem_right _ _ - (Ideal.pow_le_pow_right (by omega) (hcoeffmem (i + 1) hi1))) - · have hieq : i = n - 1 := by omega - have hcoeff : g.coeff (i + 1) = 1 := by - rw [show i + 1 = n from by omega] - exact hgmonic.coeff_natDegree - rw [hcoeff] - refine Ideal.mul_mem_left _ _ ?_ - rw [hieq, Ideal.span_singleton_pow, Ideal.mem_span_singleton] + have hYmem : Polynomial.aeval ξ (Polynomial.derivative g) ∈ Ideal.span {ξ} ^ (n - 1) := + aeval_derivative_mem_pow hgmonic hn hcoeffmem -- extract the cofactor and take norms obtain ⟨w, hw⟩ : ∃ w : ↥(integers L'), Polynomial.aeval ξ (Polynomial.derivative g) = ξ ^ (n - 1) * w := by @@ -478,8 +511,7 @@ theorem discIdeal_eq_span {π : 𝒪[K]} (hπ : Irreducible π) {x : SeparableCl have hb₀int : ∀ i, IsIntegral 𝒪[K] (b₀ i) := by intro i rw [hb₀, Module.Basis.reindex_apply, PowerBasis.basis_eq_pow] - exact ((isIntegral_algebraMap_iff - (algebraMap ↥L' (SeparableClosure K)).injective).mp hint).pow _ + exact ((isIntegral_algebraMap_iff (B := SeparableClosure K)).mp hint).pow _ -- the nonzero witness: the discriminant of the reindexed power basis have hd₀int : IsIntegral 𝒪[K] (Algebra.discr K ⇑b₀) := Algebra.discr_isIntegral K hb₀int obtain ⟨D, hD⟩ := IsIntegrallyClosed.isIntegral_iff.mp hd₀int diff --git a/LeanPool/MassFormula/EisensteinMonogenic.lean b/LeanPool/MassFormula/EisensteinMonogenic.lean index 8a71c34a24..2ad772c95f 100644 --- a/LeanPool/MassFormula/EisensteinMonogenic.lean +++ b/LeanPool/MassFormula/EisensteinMonogenic.lean @@ -107,8 +107,7 @@ theorem integers_eq_adjoin {π : 𝒪[K]} (hπ : Irreducible π) {x : SeparableC have hgen : B.gen = IntermediateField.AdjoinSimple.gen K x := rfl have hval : algebraMap ↥(IntermediateField.adjoin K {x}) (SeparableClosure K) B.gen = x := rfl have hint' : IsIntegral 𝒪[K] B.gen := - (isIntegral_algebraMap_iff - (algebraMap ↥(IntermediateField.adjoin K {x}) (SeparableClosure K)).injective).mp hint + (isIntegral_algebraMap_iff (B := SeparableClosure K)).mp hint have hminmap : minpoly 𝒪[K] B.gen = minpoly 𝒪[K] x := (minpoly.algebraMap_eq (algebraMap ↥(IntermediateField.adjoin K {x}) (SeparableClosure K)).injective B.gen).symm @@ -150,8 +149,7 @@ theorem integers_eq_adjoin {π : 𝒪[K]} (hπ : Irreducible π) {x : SeparableC rw [Set.mem_singleton_iff] at hy subst hy change IsIntegral 𝒪[K] _ - exact (isIntegral_algebraMap_iff - (algebraMap ↥(IntermediateField.adjoin K {x}) (SeparableClosure K)).injective).mp hint + exact (isIntegral_algebraMap_iff (B := SeparableClosure K)).mp hint /-! ## Total ramifiedness of the adjoined root field @@ -292,90 +290,16 @@ private lemma ramificationIdx_eq_of_span {R A : Type*} [CommRing R] [CommRing A] /-! ## Total ramifiedness of the adjoined root field -/ -omit [IsUniformAddGroup K] in -/-- The unit relation behind total ramifiedness, exposed for the discriminant bound of -`sub_one_le_d_adjoin`: the constant coefficient of the minimal polynomial becomes a unit multiple of -`-ξ ^ n` inside the integral closure. -/ -theorem exists_unit_relation {π : 𝒪[K]} (hπ : Irreducible π) {x : SeparableClosure K} - (hint : IsIntegral 𝒪[K] x) - (hei : (minpoly 𝒪[K] x).IsEisensteinAt (Submodule.span 𝒪[K] {π})) : - ∃ ξ u : ↥(integers (IntermediateField.adjoin K {x})), - (ξ : ↥(IntermediateField.adjoin K {x})) = IntermediateField.AdjoinSimple.gen K x ∧ - IsUnit u ∧ - algebraMap 𝒪[K] ↥(integers (IntermediateField.adjoin K {x})) - ((minpoly 𝒪[K] x).coeff 0) * u = - -ξ ^ (minpoly 𝒪[K] x).natDegree := by +private lemma exists_unit_relation_of_coeff_dvd {R A : Type*} [CommRing R] [CommRing A] + [Algebra R A] {g : Polynomial R} {ξ : A} (hgmonic : g.Monic) + (hn : 0 < g.natDegree) (hdvd : ∀ i, i < g.natDegree → g.coeff 0 ∣ g.coeff i) + (haev : Polynomial.aeval ξ g = 0) : + ∃ u : A, IsUnit u ∧ algebraMap R A (g.coeff 0) * u = -ξ ^ g.natDegree := by classical - have : IsFractionRing 𝒪[K] K := - inferInstanceAs (IsFractionRing (valuation K).valuationSubring K) - set L' := IntermediateField.adjoin K {x} with hL' - set x' : ↥L' := IntermediateField.AdjoinSimple.gen K x with hx' - have hx'mem : x' ∈ integers L' := - (isIntegral_algebraMap_iff - (algebraMap ↥L' (SeparableClosure K)).injective).mp hint - set ξ : ↥(integers L') := ⟨x', hx'mem⟩ with hξ - set g : Polynomial 𝒪[K] := minpoly 𝒪[K] x with hg - set n : ℕ := g.natDegree with hn' - have hn : 0 < n := minpoly.natDegree_pos hint - have hgmonic : g.Monic := minpoly.monic hint - -- the evaluation identities - have hvalinj : Function.Injective (Subtype.val : ↥(integers L') → ↥L') := - Subtype.val_injective - have haevx' : ∀ P : Polynomial 𝒪[K], - (Polynomial.aeval x' P : ↥L') = 0 ↔ Polynomial.aeval x P = 0 := by - intro P - have h2 : Polynomial.aeval x P = - algebraMap ↥L' (SeparableClosure K) (Polynomial.aeval x' P) := by - rw [← Polynomial.aeval_algebraMap_apply] - rfl - constructor - · intro h - rw [h2, h, map_zero] - · intro h - exact (algebraMap ↥L' (SeparableClosure K)).injective - (by rw [← h2, h, map_zero]) - have haevξ : ∀ P : Polynomial 𝒪[K], - Polynomial.aeval ξ P = 0 ↔ Polynomial.aeval x P = 0 := by - intro P - rw [← haevx' P] - have h2 : Polynomial.aeval x' P = - algebraMap ↥(integers L') ↥L' (Polynomial.aeval ξ P) := by - rw [← Polynomial.aeval_algebraMap_apply] - rfl - constructor - · intro h - rw [h2, h, map_zero] - · intro h - refine hvalinj ?_ - rw [show ((0 : ↥(integers L')) : ↥L') = 0 from rfl, - show ((Polynomial.aeval ξ P : ↥(integers L')) : ↥L') = - algebraMap ↥(integers L') ↥L' (Polynomial.aeval ξ P) from rfl, - ← h2, h] - have haev : Polynomial.aeval ξ g = 0 := (haevξ g).mpr (minpoly.aeval 𝒪[K] x) - have hvalaev : ∀ P : Polynomial 𝒪[K], - (↑(Polynomial.aeval ξ P) : ↥L') = Polynomial.aeval x' P := by - intro P - have h2 : Polynomial.aeval x' P = - algebraMap ↥(integers L') ↥L' (Polynomial.aeval ξ P) := by - rw [← Polynomial.aeval_algebraMap_apply] - rfl - calc (↑(Polynomial.aeval ξ P) : ↥L') - = algebraMap ↥(integers L') ↥L' (Polynomial.aeval ξ P) := rfl - _ = Polynomial.aeval x' P := h2.symm - -- the coefficient structure - have hg₀ne : g.coeff 0 ≠ 0 := by - intro h0 - exact hei.notMem (h0 ▸ zero_mem _) - have hπg₀ : Associated π (g.coeff 0) := associated_pi_coeff_zero hπ hint hei - have hdvd : ∀ i, i < n → g.coeff 0 ∣ g.coeff i := by - intro i hi - have h1 : π ∣ g.coeff i := by - have := hei.mem hi - rwa [Ideal.submodule_span_eq, Ideal.mem_span_singleton] at this - exact (hπg₀.symm.dvd).trans h1 + let n := g.natDegree -- the Eisenstein relation, rearranged around the constant coefficient obtain ⟨m, hm⟩ : ∃ m, n = m + 1 := ⟨n - 1, by omega⟩ - set b : ℕ → ↥(integers L') := fun i => algebraMap 𝒪[K] ↥(integers L') (g.coeff i) with hb + set b : ℕ → A := fun i => algebraMap R A (g.coeff i) with hb have hrel : ξ ^ n + ∑ i ∈ Finset.range n, b i * ξ ^ i = 0 := by calc ξ ^ n + ∑ i ∈ Finset.range n, b i * ξ ^ i = ∑ i ∈ Finset.range (n + 1), g.coeff i • ξ ^ i := by @@ -384,34 +308,77 @@ theorem exists_unit_relation {π : 𝒪[K]} (hπ : Irreducible π) {x : Separabl exact Finset.sum_congr rfl fun i _ => (Algebra.smul_def _ _).symm _ = Polynomial.aeval ξ g := (Polynomial.aeval_eq_sum_range _).symm _ = 0 := haev - have hex : ∀ i : ℕ, ∃ d : 𝒪[K], i + 1 < n → g.coeff (i + 1) = g.coeff 0 * d := by + have hex : ∀ i : ℕ, ∃ d : R, i + 1 < n → g.coeff (i + 1) = g.coeff 0 * d := by intro i by_cases h : i + 1 < n · obtain ⟨d, hd⟩ := hdvd (i + 1) h exact ⟨d, fun _ => hd⟩ · exact ⟨0, fun hh => absurd hh h⟩ choose c hc using hex - obtain ⟨t, ht⟩ : ∃ t : ↥(integers L'), t = ∑ i ∈ Finset.range m, - algebraMap 𝒪[K] ↥(integers L') (c i) * ξ ^ i := ⟨_, rfl⟩ - obtain ⟨u, hu'⟩ : ∃ u : ↥(integers L'), u = 1 + ξ * t := ⟨_, rfl⟩ + obtain ⟨t, ht⟩ : ∃ t : A, t = ∑ i ∈ Finset.range m, + algebraMap R A (c i) * ξ ^ i := ⟨_, rfl⟩ + obtain ⟨u, hu'⟩ : ∃ u : A, u = 1 + ξ * t := ⟨_, rfl⟩ have hbu : b 0 * u = -ξ ^ n := by have h2 : ∑ i ∈ Finset.range n, b i * ξ ^ i = b 0 * u := by rw [hu', ht, hm, Finset.sum_range_succ'] have h3 : ∀ i ∈ Finset.range m, b (i + 1) * ξ ^ (i + 1) = - b 0 * (algebraMap 𝒪[K] ↥(integers L') (c i) * ξ ^ i * ξ) := by + b 0 * (algebraMap R A (c i) * ξ ^ i * ξ) := by intro i hi rw [Finset.mem_range] at hi rw [hb] dsimp only rw [hc i (by omega), map_mul, pow_succ] - ring + ac_rfl rw [Finset.sum_congr rfl h3, ← Finset.mul_sum, ← Finset.sum_mul] - ring + simp only [pow_zero, mul_one, mul_add, mul_comm ξ, add_comm] rw [h2] at hrel exact eq_neg_of_add_eq_zero_right hrel have hu : IsUnit u := by rw [hu'] exact isUnit_one_add_of_mul_eq_neg_pow (c := b 0) (n := n) (by rw [← hu']; exact hbu) + exact ⟨u, hu, hbu⟩ + +omit [IsUniformAddGroup K] in +/-- The unit relation behind total ramifiedness, exposed for the discriminant bound of +`sub_one_le_d_adjoin`: the constant coefficient of the minimal polynomial becomes a unit multiple of +`-ξ ^ n` inside the integral closure. -/ +theorem exists_unit_relation {π : 𝒪[K]} (hπ : Irreducible π) {x : SeparableClosure K} + (hint : IsIntegral 𝒪[K] x) + (hei : (minpoly 𝒪[K] x).IsEisensteinAt (Submodule.span 𝒪[K] {π})) : + ∃ ξ u : ↥(integers (IntermediateField.adjoin K {x})), + (ξ : ↥(IntermediateField.adjoin K {x})) = IntermediateField.AdjoinSimple.gen K x ∧ + IsUnit u ∧ + algebraMap 𝒪[K] ↥(integers (IntermediateField.adjoin K {x})) + ((minpoly 𝒪[K] x).coeff 0) * u = + -ξ ^ (minpoly 𝒪[K] x).natDegree := by + classical + have : IsFractionRing 𝒪[K] K := + inferInstanceAs (IsFractionRing (valuation K).valuationSubring K) + set L' := IntermediateField.adjoin K {x} with hL' + set x' : ↥L' := IntermediateField.AdjoinSimple.gen K x with hx' + have hx'mem : x' ∈ integers L' := + (isIntegral_algebraMap_iff (B := SeparableClosure K)).mp hint + set ξ : ↥(integers L') := ⟨x', hx'mem⟩ with hξ + set g : Polynomial 𝒪[K] := minpoly 𝒪[K] x with hg + set n : ℕ := g.natDegree with hn' + have hn : 0 < n := minpoly.natDegree_pos hint + have hgmonic : g.Monic := minpoly.monic hint + have haev : Polynomial.aeval ξ g = 0 := by + apply Subtype.val_injective + change algebraMap ↥(integers L') ↥L' (Polynomial.aeval ξ g) = 0 + rw [← Polynomial.aeval_algebraMap_apply] + apply (algebraMap ↥L' (SeparableClosure K)).injective + rw [← Polynomial.aeval_algebraMap_apply, map_zero] + exact minpoly.aeval 𝒪[K] x + -- the coefficient structure + have hπg₀ : Associated π (g.coeff 0) := associated_pi_coeff_zero hπ hint hei + have hdvd : ∀ i, i < n → g.coeff 0 ∣ g.coeff i := by + intro i hi + have h1 : π ∣ g.coeff i := by + have := hei.mem hi + rwa [Ideal.submodule_span_eq, Ideal.mem_span_singleton] at this + exact (hπg₀.symm.dvd).trans h1 + obtain ⟨u, hu, hbu⟩ := exists_unit_relation_of_coeff_dvd hgmonic hn hdvd haev exact ⟨ξ, u, rfl, hu, hbu⟩ omit [IsUniformAddGroup K] in @@ -425,8 +392,7 @@ theorem isTotallyRamified_adjoin {π : 𝒪[K]} (hπ : Irreducible π) {x : Sepa set L' := IntermediateField.adjoin K {x} with hL' set x' : ↥L' := IntermediateField.AdjoinSimple.gen K x with hx' have hx'mem : x' ∈ integers L' := - (isIntegral_algebraMap_iff - (algebraMap ↥L' (SeparableClosure K)).injective).mp hint + (isIntegral_algebraMap_iff (B := SeparableClosure K)).mp hint set ξ : ↥(integers L') := ⟨x', hx'mem⟩ with hξ set g : Polynomial 𝒪[K] := minpoly 𝒪[K] x with hg set n : ℕ := g.natDegree with hn' diff --git a/LeanPool/MassFormula/First.lean b/LeanPool/MassFormula/First.lean index dee3ab8c26..9f6506c4ea 100644 --- a/LeanPool/MassFormula/First.lean +++ b/LeanPool/MassFormula/First.lean @@ -1212,6 +1212,15 @@ private lemma irreducible_of_addVal_eq_one {a : A} (h : addVal A a = 1) : Irredu exact ((associated_of_addVal_eq (a := a) (b := ϖ) (by rw [h, addVal_uniformizer hϖ])).symm).irreducible hϖ +/-- A perturbation of valuation greater than one preserves a uniformizer's valuation. -/ +private lemma addVal_eq_one_of_close {w v : A} (hw : Irreducible w) + (hdist : (1 : ℕ∞) < addVal A (v - w)) : addVal A v = 1 := by + have hlt : addVal A w < addVal A (v - w) := by + rwa [addVal_uniformizer hw] + rw [show v = w + (v - w) by rw [add_comm, sub_add_cancel], + (addVal A).map_add_eq_of_lt_left hlt] + exact addVal_uniformizer hw + /-- Any two uniformizers are associated. -/ private lemma associated_of_irreducible {a b : A} (ha : Irreducible a) (hb : Irreducible b) : Associated a b := @@ -1363,6 +1372,27 @@ private lemma intModel_map {n : ℕ} (a : Fin n → K) (ha : ∀ i, a i ∈ 𝒪 rw [Polynomial.map_mul, Polynomial.map_C, Polynomial.map_pow, Polynomial.map_X] rfl +omit [UniformSpace K] [IsUniformAddGroup K] [IsNonarchimedeanLocalField K] in +private lemma integral_of_root_toPoly (L : IntermediateField K (SeparableClosure K)) {n : ℕ} + (a : Fin n → K) (ha : ∀ i, a i ∈ 𝒪[K]) (y : ↥L) + (hy : Polynomial.aeval y (toPoly a) = 0) : y ∈ integers L := by + have h5 : Polynomial.aeval y (intModel a ha) = 0 := by + rw [← Polynomial.aeval_map_algebraMap K, intModel_map a ha] + exact hy + exact ⟨intModel a ha, intModel_monic a ha, by rwa [Polynomial.aeval_def] at h5⟩ + +omit [UniformSpace K] [IsUniformAddGroup K] [IsNonarchimedeanLocalField K] in +private lemma intModel_root_iff (L : IntermediateField K (SeparableClosure K)) {n : ℕ} + (a : Fin n → K) (ha : ∀ i, a i ∈ 𝒪[K]) (w : ↥(integers L)) : + Polynomial.eval w ((intModel a ha).map (algebraMap 𝒪[K] ↥(integers L))) = 0 ↔ + Polynomial.aeval (w : ↥L) (toPoly a) = 0 := by + have hval_aeval : ((Polynomial.aeval w (intModel a ha) : ↥(integers L)) : ↥L) = + Polynomial.aeval (w : ↥L) (toPoly a) := by + rw [← intModel_map a ha, Polynomial.aeval_map_algebraMap] + exact (Polynomial.aeval_algHom_apply (Subalgebra.val _) w (intModel a ha)).symm + rw [Polynomial.eval_map, ← Polynomial.aeval_def, ← hval_aeval] + exact ⟨fun h => by rw [h]; rfl, fun h => Subtype.val_injective (by rw [h]; rfl)⟩ + /-! ### The annihilator package at an arbitrary uniformizer of `integers L` The cubes decomposing the set of uniformizers are centered at arbitrary uniformizers `η` of @@ -1406,7 +1436,8 @@ private noncomputable def annihAt (hπ : Irreducible π) (hint : IsIntegral 𝒪 (hei : (minpoly 𝒪[K] x).IsEisensteinAt (Submodule.span 𝒪[K] {π})) [IsDiscreteValuationRing ↥(integers (IntermediateField.adjoin K {x}))] (η : ↥(integers (IntermediateField.adjoin K {x}))) : Polynomial 𝒪[K] := - annih (basisAt hπ hint hei η) η + annih (R := 𝒪[K]) (A := ↥(integers (IntermediateField.adjoin K {x}))) + (n := (minpoly 𝒪[K] x).natDegree) (basisAt hπ hint hei η) η omit [IsUniformAddGroup K] in private lemma annihAt_monic (hπ : Irreducible π) (hint : IsIntegral 𝒪[K] x) @@ -2188,28 +2219,8 @@ private theorem rootCount_eq_sum_indicator {π : 𝒪[K]} (hπ : Irreducible π) exact ((intModel_monic a ha).map _).ne_zero have hnodup : ((toPoly a).aroots ↥(IntermediateField.adjoin K {x})).Nodup := Polynomial.nodup_roots hsep.map - have hint_y : ∀ y : ↥(IntermediateField.adjoin K {x}), Polynomial.aeval y (toPoly a) = 0 → - y ∈ integers (IntermediateField.adjoin K {x}) := by - intro y hy - have h5 : Polynomial.aeval y (intModel a ha) = 0 := by - rw [← Polynomial.aeval_map_algebraMap K, intModel_map a ha] - exact hy - exact ⟨intModel a ha, intModel_monic a ha, by rwa [Polynomial.aeval_def] at h5⟩ - have hval_aeval : ∀ w : ↥(integers (IntermediateField.adjoin K {x})), - ((Polynomial.aeval w (intModel a ha) : - ↥(integers (IntermediateField.adjoin K {x}))) : - ↥(IntermediateField.adjoin K {x})) = - Polynomial.aeval (w : ↥(IntermediateField.adjoin K {x})) (toPoly a) := by - intro w - rw [← intModel_map a ha, Polynomial.aeval_map_algebraMap] - exact (Polynomial.aeval_algHom_apply (Subalgebra.val _) w (intModel a ha)).symm - have hroot_iff : ∀ w : ↥(integers (IntermediateField.adjoin K {x})), - Polynomial.eval w ((intModel a ha).map - (algebraMap 𝒪[K] ↥(integers (IntermediateField.adjoin K {x})))) = 0 ↔ - Polynomial.aeval (w : ↥(IntermediateField.adjoin K {x})) (toPoly a) = 0 := by - intro w - rw [Polynomial.eval_map, ← Polynomial.aeval_def, ← hval_aeval w] - exact ⟨fun h => by rw [h]; rfl, fun h => Subtype.val_injective (by rw [h]; rfl)⟩ + have hint_y := integral_of_root_toPoly (IntermediateField.adjoin K {x}) a ha + have hroot_iff := intModel_root_iff (IntermediateField.adjoin K {x}) a ha have hind : ∑ t ∈ T, (boxAt hπ hint hei ρ (rep t)).indicator (1 : (Fin (minpoly 𝒪[K] x).natDegree → K) → ℝ≥0∞) a = ((T.filter fun t => a ∈ boxAt hπ hint hei ρ (rep t)).card : ℝ≥0∞) := by @@ -2421,30 +2432,16 @@ theorem lintegral_rootCount (n : ℕ) (hn : 0 < n) Irreducible (rep (Ideal.Quotient.mk I w)) := by intro w hw have hdist := (hclass (Ideal.Quotient.mk I w) w).mp rfl - have hlt : addVal ↥(integers (IntermediateField.adjoin K {x})) w < - addVal ↥(integers (IntermediateField.adjoin K {x})) - (rep (Ideal.Quotient.mk I w) - w) := by - rw [addVal_uniformizer hw, - (addVal ↥(integers (IntermediateField.adjoin K {x}))).map_sub_swap] - exact lt_of_lt_of_le (by exact_mod_cast hNρ1) hdist - refine irreducible_of_addVal_eq_one ?_ - have h8 : rep (Ideal.Quotient.mk I w) = w + (rep (Ideal.Quotient.mk I w) - w) := by ring - rw [h8, (addVal ↥(integers (IntermediateField.adjoin K {x}))).map_add_eq_of_lt_left hlt] - exact addVal_uniformizer hw + apply irreducible_of_addVal_eq_one + apply addVal_eq_one_of_close hw + rw [(addVal ↥(integers (IntermediateField.adjoin K {x}))).map_sub_swap] + exact lt_of_lt_of_le (by exact_mod_cast hNρ1) hdist have hval_of_class : ∀ w : ↥(integers (IntermediateField.adjoin K {x})), Irreducible (rep (Ideal.Quotient.mk I w)) → addVal ↥(integers (IntermediateField.adjoin K {x})) w = 1 := by intro w hrw have hdist := (hclass (Ideal.Quotient.mk I w) w).mp rfl - have hlt : addVal ↥(integers (IntermediateField.adjoin K {x})) - (rep (Ideal.Quotient.mk I w)) < - addVal ↥(integers (IntermediateField.adjoin K {x})) - (w - rep (Ideal.Quotient.mk I w)) := by - rw [addVal_uniformizer hrw] - exact lt_of_lt_of_le (by exact_mod_cast hNρ1) hdist - have h8 : w = rep (Ideal.Quotient.mk I w) + (w - rep (Ideal.Quotient.mk I w)) := by ring - rw [h8, (addVal ↥(integers (IntermediateField.adjoin K {x}))).map_add_eq_of_lt_left hlt] - exact addVal_uniformizer hrw + exact addVal_eq_one_of_close hrw (lt_of_lt_of_le (by exact_mod_cast hNρ1) hdist) -- the normalization, and the cubes of the chart at the Eisenstein generator have hone : muCoeff K (minpoly 𝒪[K] x).natDegree (integerBox K (minpoly 𝒪[K] x).natDegree) = 1 := diff --git a/LeanPool/MassFormula/RootLifting.lean b/LeanPool/MassFormula/RootLifting.lean index 5b2aea5116..e674ef9134 100644 --- a/LeanPool/MassFormula/RootLifting.lean +++ b/LeanPool/MassFormula/RootLifting.lean @@ -260,8 +260,7 @@ noncomputable def integralGen (hint : IsIntegral 𝒪[K] x) : have : IsScalarTower ↥𝒪[K] ↥(IntermediateField.adjoin K {x}) (SeparableClosure K) := IsScalarTower.of_algebraMap_eq' rfl exact ⟨IntermediateField.AdjoinSimple.gen K x, - (isIntegral_algebraMap_iff - (algebraMap ↥(IntermediateField.adjoin K {x}) (SeparableClosure K)).injective).mp hint⟩ + (isIntegral_algebraMap_iff (B := SeparableClosure K)).mp hint⟩ omit [UniformSpace K] [IsUniformAddGroup K] [IsNonarchimedeanLocalField K] in /-- Evaluation at `integralGen` vanishes exactly when evaluation at `x` does: the two sit under the @@ -522,7 +521,7 @@ theorem eq_span_integralGen_of_isMaximal (hπ : Irreducible π) (hint : IsIntegr have := hQ have hcom : Ideal.comap (algebraMap ↥𝒪[K] ↥(integers (IntermediateField.adjoin K {x}))) Q = 𝓂[K] := - IsLocalRing.eq_maximalIdeal (Ideal.isMaximal_comap_of_isIntegral_of_isMaximal Q) + IsLocalRing.eq_maximalIdeal (Ideal.isMaximal_under_of_isIntegral_of_isMaximal Q) have hc0m : (minpoly 𝒪[K] x).coeff 0 ∈ 𝓂[K] := by have h1 := hei.mem (minpoly.natDegree_pos hint) rw [Ideal.submodule_span_eq] at h1 @@ -602,7 +601,7 @@ theorem isDiscreteValuationRing_integers (hπ : Irreducible π) (hint : IsIntegr rw [IsLocalRing.isField_iff_maximalIdeal_eq, hmax, Ideal.span_singleton_eq_bot] exact integralGen_ne_zero hint hei exact ((IsDiscreteValuationRing.TFAE ↥(integers (IntermediateField.adjoin K {x})) - hnf).out 0 2).mpr hDed + hnf).out 1 3).mpr hDed /-- The integral closure is complete for its maximal-adic topology. `IsHausdorff` is Krull intersection; for `IsPrecomplete`, a coherent sequence for the powers of diff --git a/LeanPool/MooreBound/PrimeNumberTheoremAnd/Fourier.lean b/LeanPool/MooreBound/PrimeNumberTheoremAnd/Fourier.lean index a6674cc5fb..fe8b3b18cf 100644 --- a/LeanPool/MooreBound/PrimeNumberTheoremAnd/Fourier.lean +++ b/LeanPool/MooreBound/PrimeNumberTheoremAnd/Fourier.lean @@ -30,10 +30,8 @@ local instance realFunctionComplexCoe {E : Type*} : Coe (E → ℝ) (E → ℂ) section lemmas -@[simp] theorem nnnorm_eq_of_mem_circle (z : Circle) : ‖z.val‖₊ = 1 := NNReal.coe_eq_one.mp z.norm_coe -@[simp] theorem nnnorm_circle_smul (z : Circle) (s : ℂ) : ‖z • s‖₊ = ‖s‖₊ := by simp [show z • s = z.val * s from rfl] diff --git a/LeanPool/MooreBound/PrimeNumberTheoremAnd/Wiener.lean b/LeanPool/MooreBound/PrimeNumberTheoremAnd/Wiener.lean index 74bec8ec62..ecec2d4469 100644 --- a/LeanPool/MooreBound/PrimeNumberTheoremAnd/Wiener.lean +++ b/LeanPool/MooreBound/PrimeNumberTheoremAnd/Wiener.lean @@ -583,7 +583,8 @@ lemma dirichlet_test' {a b : ℕ → ℝ} (ha : 0 ≤ a) (hb : 0 ≤ b) (h : Summable (shift (cumsum a) * nnabla b)) : Summable (a * b) := by have l1 : ∀ᶠ n in atTop, 0 ≤ (shift (cumsum a) * nnabla b) n := by filter_upwards [hbb] with n hb - exact mul_nonneg (by simpa [shift] using! Finset.sum_nonneg' ha) (sub_nonneg.mpr hb) + exact mul_nonneg (by simpa [shift] using! Finset.sum_nonneg (fun i _ => ha i)) + (sub_nonneg.mpr hb) rw [summable_iff_bounded (mul_nonneg ha hb)] rw [summable_iff_bounded' l1] at h apply bounded_of_shift @@ -1227,10 +1228,10 @@ lemma cancel_aux {C : ℝ} {f g : ℕ → ℝ} (hf : 0 ≤ f) (hg : 0 ≤ g) ((n - 1 - 1) • (C * g 0) - ∑ x ∈ Finset.range (n - 1 - 1), C * g (x + 1))) := by have l1 (n : ℕ) : (g n - g (n + 1)) * ∑ i ∈ Finset.range (n + 1), f i ≤ (g n - g (n + 1)) * (C * (n + 1)) := by - apply mul_le_mul le_rfl (by simpa using! hf' (n + 1)) (Finset.sum_nonneg' hf) ?_ + apply mul_le_mul le_rfl (by simpa using! hf' (n + 1)) (Finset.sum_nonneg (fun i _ => hf i)) ?_ simp only [sub_nonneg]; apply hg'; simp have l2 (x : ℕ) : C * (↑(x + 1) + 1) - C * (↑x + 1) = C := by simp; ring - have l3 (n : ℕ) : 0 ≤ cumsum f n := Finset.sum_nonneg' hf + have l3 (n : ℕ) : 0 ≤ cumsum f n := Finset.sum_nonneg (fun i _ => hf i) convert_to ∑ i ∈ Finset.range n, (g i) • (f i) ≤ _ · simp [mul_comm] rw [Finset.sum_range_by_parts, sub_eq_add_neg, ← Finset.sum_neg_distrib] @@ -1384,8 +1385,10 @@ lemma hh_integrable_aux (ha : 0 < a) (hb : 0 < b) (hc : 0 < c) : have k3 : ContinuousWithinAt g₀ (Ici 0) 0 := by rw [Metric.continuousWithinAt_iff] rw [Metric.tendsto_nhdsWithin_nhds] at k2 - peel k2 with ε hε δ hδ x h - intro (hx : 0 ≤ x) + intro ε hε + obtain ⟨δ, hδ, h⟩ := k2 ε hε + refine ⟨δ, hδ, ?_⟩ + intro x (hx : 0 ≤ x) have := le_iff_lt_or_eq.mp hx cases this with | inl hx => exact h hx diff --git a/LeanPool/Neukirch/ExtensionOfDedekindDomains.lean b/LeanPool/Neukirch/ExtensionOfDedekindDomains.lean index 581fd56de2..671228b248 100644 --- a/LeanPool/Neukirch/ExtensionOfDedekindDomains.lean +++ b/LeanPool/Neukirch/ExtensionOfDedekindDomains.lean @@ -50,6 +50,26 @@ theorem ramificationIdx_algebra_tower_of_eq [IsDedekindDomain S] [IsDedekindDoma ramificationIdx' p P * ramificationIdx' P Q := ramificationIdx'_algebra_tower hg0 hfg (map_le_iff_le_comap.mpr (le_of_eq hg)) +/-- The quotient-dimension tower law retains the former inertia-degree formula even when the +ideal upstairs is not prime, where the residue-field inertia degree is zero. -/ +theorem quotient_finrank_algebra_tower_of_eq {p : Ideal R} {P : Ideal S} {I : Ideal T} + [IsMaximal p] [IsMaximal P] (hp : p = comap (algebraMap R S) P) + (hP : P = comap (algebraMap S T) I) : + let : P.LiesOver p := ⟨hp⟩ + let : I.LiesOver P := ⟨hP⟩ + let : I.LiesOver p := LiesOver.trans I P p + Module.finrank (R ⧸ p) (T ⧸ I) = + Module.finrank (R ⧸ p) (S ⧸ P) * Module.finrank (S ⧸ P) (T ⧸ I) := by + let : P.LiesOver p := ⟨hp⟩ + let : I.LiesOver P := ⟨hP⟩ + let : I.LiesOver p := LiesOver.trans I P p + let : IsScalarTower (R ⧸ p) (S ⧸ P) (T ⧸ I) := + IsScalarTower.of_algebraMap_eq fun x => Quot.inductionOn x fun r => by + change Ideal.Quotient.mk I (algebraMap R T r) = + Ideal.Quotient.mk I (algebraMap S T (algebraMap R S r)) + rw [IsScalarTower.algebraMap_apply R S T] + exact (Module.finrank_mul_finrank (R ⧸ p) (S ⧸ P) (T ⧸ I)).symm + variable (R) in /-- Multiplicativity of the inertia degree in a tower of Dedekind domains, stated with the hypotheses used by the Hilbert ramification development. -/ diff --git a/LeanPool/PolynomialMethodRestrictedSums/ANRPolynomialMethod.lean b/LeanPool/PolynomialMethodRestrictedSums/ANRPolynomialMethod.lean index 162ccb0d31..2bc84145d7 100644 --- a/LeanPool/PolynomialMethodRestrictedSums/ANRPolynomialMethod.lean +++ b/LeanPool/PolynomialMethodRestrictedSums/ANRPolynomialMethod.lean @@ -244,7 +244,7 @@ lemma coeff_prod_sumX_minus_C_eq_coeff_sumX_pow_of_degree_eq obtain ⟨left, right⟩ := h subst right norm_num [MvPolynomial.totalDegree] - intro b hb; contrapose! hb; simp_all +decide only [zero_add, coeff_sum, coeff_X, + intro b hb; contrapose! hb; simp_all +decide only [zero_add, coeff_X, Finset.sum_boole] rw [Finset.card_eq_zero.mpr] <;> aesop · rw [Finset.sum_subset (Finset.subset_univ snd.support)] <;> aesop @@ -950,7 +950,8 @@ lemma coeff_target_eq_zero_of_vanishes_on_grid _root_.eq_zero_of_eval_zero_at_prod_finset R A (fun i => hA i ▸ Nat.lt_succ_of_le (hdegree i)) (fun x hx => (heval x hx).trans (hQ_vanishes x hx)) - rw [← hcoeff, hzero, coeff_zero] + rw [← hcoeff, hzero] + rfl /-- Lemma 2.1.11 : If two polynomials P and Q are equal or their difference has a total degree less diff --git a/LeanPool/SumDifferenceExponent/Quantitative.lean b/LeanPool/SumDifferenceExponent/Quantitative.lean index 15403a1629..f2acacddcc 100644 --- a/LeanPool/SumDifferenceExponent/Quantitative.lean +++ b/LeanPool/SumDifferenceExponent/Quantitative.lean @@ -19,8 +19,17 @@ def quantitativeScale : ℕ := 10 ^ 999 /-- An exponent large enough to force the logarithmic error below the tolerance. -/ def quantitativePower : ℕ := 100 * quantitativeScale +-- Keep kernel conversion from evaluating the enormous closed power in the witness. +private def powerOfTwo (n : ℕ) : ℕ := 2 ^ n + +private theorem two_le_powerOfTwo (n : ℕ) (hn : 0 < n) : 2 ≤ powerOfTwo n := + Nat.le_pow hn + +private theorem cast_powerOfTwo (n : ℕ) : (powerOfTwo n : ℝ) = (2 : ℝ) ^ n := + Nat.cast_pow 2 n + /-- The row parameter used for the explicit quantitative witness. -/ -def quantitativeIndex : ℕ := 2 ^ quantitativePower +def quantitativeIndex : ℕ := powerOfTwo quantitativePower /-- An explicit finite integer set whose growth exponent is within `10⁻⁹⁹⁹` of two. -/ abbrev quantitativeSet : Finset ℤ := @@ -33,8 +42,7 @@ theorem quantitativePower_pos : 0 < quantitativePower := by exact Nat.mul_pos (by norm_num) quantitativeScale_pos theorem quantitativeIndex_two_le : 2 ≤ quantitativeIndex := by - rw [quantitativeIndex] - exact le_trans (by norm_num) (Nat.le_pow quantitativePower_pos) + exact two_le_powerOfTwo quantitativePower quantitativePower_pos theorem log_constant_lt_twenty_three : Real.log 2 + 2 * Real.log 12 < 23 := by @@ -56,8 +64,7 @@ theorem quantitative_denominator_gt : (quantitativePower : ℝ) * Real.log 2 := by have hcast : (quantitativeIndex : ℝ) = (2 : ℝ) ^ quantitativePower := by - rw [quantitativeIndex] - exact Nat.cast_pow 2 quantitativePower + exact cast_powerOfTwo quantitativePower rw [hcast, Real.log_pow] rw [hpow] have h2 : (1 / 2 : ℝ) < Real.log 2 := From 8dc7b3c63f28295671f308b42316fae0463ef2e6 Mon Sep 17 00:00:00 2001 From: Vasily Ilin Date: Thu, 17 Sep 2026 21:33:53 +0000 Subject: [PATCH 7/8] Refresh metadata after upstream project removals --- NOTICE | 7 ------- NOTICE.extra.yml | 8 -------- README.md | 2 +- 3 files changed, 1 insertion(+), 16 deletions(-) diff --git a/NOTICE b/NOTICE index 923072afc6..588f481fb3 100644 --- a/NOTICE +++ b/NOTICE @@ -284,9 +284,6 @@ MIT permission notice that follows them. "Copyright (c) 2026" with no name; the repository owner of record is "SamuelSchlesinger". - LeanPool/SpecialNumbers https://github.com/provables/special-numbers - Copyright (c) 2024 Walter Moreira, Joe Stubbs - LeanPool/SteinhausThreeGap https://github.com/dkunert/three-gap-theorem-lean Copyright (c) 2026 Dirk Kunert @@ -324,10 +321,6 @@ Projects relicensed by their original author These projects were relicensed by their sole author before import. LeanPool/Clawristotle https://github.com/Vilin97/Clawristotle - LeanPool/ForwardEuler https://github.com/Vilin97/forward_euler - Originally distributed without a license file, then placed under the - Apache License, Version 2.0, by its sole author. - LeanPool/GrothendieckVanishing https://github.com/Vilin97/Clawristotle Originally distributed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International license, then diff --git a/NOTICE.extra.yml b/NOTICE.extra.yml index a9ff63f2c9..9e9f9758e3 100644 --- a/NOTICE.extra.yml +++ b/NOTICE.extra.yml @@ -59,11 +59,6 @@ FormalizationOfBoundedArithmetic: template text "Copyright (c) [year] [fullname]"; the repository owner of record is "ruplet". -ForwardEuler: - relicensed: |- - Originally distributed without a license file, then placed under the - Apache License, Version 2.0, by its sole author. - GrothendieckVanishing: relicensed: |- Originally distributed under the Creative Commons @@ -131,9 +126,6 @@ Shannon1948Formalization: "Copyright (c) 2026" with no name; the repository owner of record is "SamuelSchlesinger". -SpecialNumbers: - note: Copyright (c) 2024 Walter Moreira, Joe Stubbs - SteinhausThreeGap: note: Copyright (c) 2026 Dirk Kunert diff --git a/README.md b/README.md index a3ff7653a7..15013f823a 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Lean Pool sits between [`mathlib`](https://github.com/leanprover-community/mathl Semantic search is also available via the [API](https://search.octo.axiomatic-ai.com/api/search). -**199** formalization projects · **2,850,381** lines of Lean · **2** open challenges +**197** formalization projects · **2,849,492** lines of Lean · **2** open challenges (stats above are refreshed automatically by the [generated-metadata workflow](.github/workflows/notice.yml) — edit [`python/lean_pool/stats.py`](python/lean_pool/stats.py), not the numbers) From b32aeac47e1924b8007d318e81e1a5a61f81b86f Mon Sep 17 00:00:00 2001 From: Vasily Ilin Date: Thu, 17 Sep 2026 22:08:17 +0000 Subject: [PATCH 8/8] fix: adapt PDL to Lean and Mathlib 4.34 --- LeanPool/PDL/Flip.lean | 3 +-- LeanPool/PDL/Interpolation/ClusterInterpolation.lean | 4 ++-- LeanPool/PDL/Interpolation/ClusterSatDown.lean | 2 +- LeanPool/PDL/Local/Tableau.lean | 6 +++--- LeanPool/PDL/Semantics.lean | 9 ++++++--- LeanPool/PDL/TableauPath.lean | 11 ++++------- 6 files changed, 17 insertions(+), 18 deletions(-) diff --git a/LeanPool/PDL/Flip.lean b/LeanPool/PDL/Flip.lean index e9ef3545cf..359fc7f1da 100644 --- a/LeanPool/PDL/Flip.lean +++ b/LeanPool/PDL/Flip.lean @@ -312,8 +312,7 @@ def LoadedPathRepeat.flip {Hist X} : LoadedPathRepeat Hist X → · rcases hk with ⟨same, path_loaded⟩ constructor · simp only [List.get_eq_getElem, List.getElem_map, Sequent.flip_eq_flip_iff] - convert same - simp [List.get_eq_getElem] + exact same · simp only [List.get_eq_getElem, List.getElem_map, Sequent.flip_isLoaded] intro m m_lt apply path_loaded ⟨m, by grind⟩ diff --git a/LeanPool/PDL/Interpolation/ClusterInterpolation.lean b/LeanPool/PDL/Interpolation/ClusterInterpolation.lean index 92ed45da1f..7112fc4c2e 100644 --- a/LeanPool/PDL/Interpolation/ClusterInterpolation.lean +++ b/LeanPool/PDL/Interpolation/ClusterInterpolation.lean @@ -1276,7 +1276,7 @@ lemma isLrep_of_mem_nodesWithFine (C : LoadedCluster tab) {Δ : Sequent} (hR : C.nodesWithFineRight Δ = []) : ∀ f ∈ C.nodesWithFine Δ, f.base.isLrep := by have key : ∀ Y : Sequent, ∀ f ∈ C.nodesWithFine Δ, f.label = Y → f.base.isLrep := by intro Y - induction Y using IsWellFounded.induction ltSequent with + induction Y using WellFounded.induction instIsWellFoundedSequentLt with | _ Y IH => intro f hf hlab by_contra hnl @@ -1456,7 +1456,7 @@ lemma leftPropagation_of_proper (C : LoadedCluster tab) : -- The claim at all nodes of `C⁺_Δ`, by well-founded induction on the label. have key : ∀ Y : Sequent, ∀ t ∈ C.plusNodesWithFine Δ, t.label = Y → t.leftEntails φ := by intro Y - induction Y using IsWellFounded.induction ltSequent with + induction Y using WellFounded.induction instIsWellFoundedSequentLt with | _ Y IH => intro t ht hlab have ht' := (C.mem_plusNodesWithFine_iff Δ t).mp ht diff --git a/LeanPool/PDL/Interpolation/ClusterSatDown.lean b/LeanPool/PDL/Interpolation/ClusterSatDown.lean index b654524884..fe219b25be 100644 --- a/LeanPool/PDL/Interpolation/ClusterSatDown.lean +++ b/LeanPool/PDL/Interpolation/ClusterSatDown.lean @@ -278,7 +278,7 @@ lemma build_repeat_basicBetween (C : LoadedCluster tab) · rw [← delta_def] at hlt exact hlt · exact ltSequent.trans delta_lt_step hlt - exact instIsWellFoundedSequentLt.wf.asymmetric _ _ hself hself + exact instIsWellFoundedSequentLt.asymmetric _ _ hself hself · rw [heq] at hbb exact hbb.mono (by simp) · obtain ⟨s, hs, rfl⟩ := prefix_sandwich hxc hcpre diff --git a/LeanPool/PDL/Local/Tableau.lean b/LeanPool/PDL/Local/Tableau.lean index 1e20ea8b67..8c3258c41e 100644 --- a/LeanPool/PDL/Local/Tableau.lean +++ b/LeanPool/PDL/Local/Tableau.lean @@ -441,8 +441,8 @@ the `lmOfFormula` measures of the formulas of `X` is smaller than the one of `Y` def ltSequent (X Y : Sequent) : Prop := Multiset.IsDershowitzMannaLT (nodeMeasure X) (nodeMeasure Y) -instance instIsWellFoundedSequentLt : IsWellFounded Sequent ltSequent := - ⟨InvImage.wf nodeMeasure Multiset.wellFounded_isDershowitzMannaLT⟩ +instance instIsWellFoundedSequentLt : WellFounded ltSequent := + InvImage.wf nodeMeasure Multiset.wellFounded_isDershowitzMannaLT theorem ltSequent.trans {X Y Z : Sequent} (h1 : ltSequent X Y) (h2 : ltSequent Y Z) : ltSequent X Z := @@ -467,7 +467,7 @@ The key facts are: definitions of local tableaux. This would also better belong to `Pdl/Local/Tableau.lean`, where the commented-out `termination_by` of `endNodesOf` refers to it. -/ instance instWellFoundedRelationSequent : WellFoundedRelation Sequent := - ⟨ltSequent, IsWellFounded.wf⟩ + ⟨ltSequent, instIsWellFoundedSequentLt⟩ /-- The multiset of a union of two disjoint finite sets is the sum of the two multisets. -/ lemma Finset.union_val_of_disjoint {α : Type*} [DecidableEq α] {A C : Finset α} diff --git a/LeanPool/PDL/Semantics.lean b/LeanPool/PDL/Semantics.lean index d8d2e61361..88b1832412 100644 --- a/LeanPool/PDL/Semantics.lean +++ b/LeanPool/PDL/Semantics.lean @@ -6,7 +6,11 @@ Authors: PDL formalization contributors (see project card) import Mathlib.Data.Finset.Basic import Mathlib.Data.Vector.Basic -import Mathlib.Data.Set.Lattice +import Mathlib.Data.Set.Lattice.Bounded +import Mathlib.Data.Set.Lattice.Disjoint +import Mathlib.Data.Set.Lattice.Image +import Mathlib.Data.Set.Lattice.Indexed +import Mathlib.Data.Set.Lattice.Order import Mathlib.Logic.Relation import Mathlib.Order.CompleteLattice.Basic @@ -512,8 +516,7 @@ theorem SemImplyAnyNegFormula_loadBoxes_iff {M : KripkeModel W} {ξ : AnyFormula simp only [relateSeq_cons] constructor · use u - · convert z_ - rfl + · exact z_ · rintro ⟨v, w_v, v_⟩ simp only [relateSeq_cons] at w_v rcases w_v with ⟨u, w_u, u_v⟩ diff --git a/LeanPool/PDL/TableauPath.lean b/LeanPool/PDL/TableauPath.lean index 33b3d910fb..c3f951cba1 100644 --- a/LeanPool/PDL/TableauPath.lean +++ b/LeanPool/PDL/TableauPath.lean @@ -400,14 +400,11 @@ also `⋖_` is well-founded via `RelHomClass.wellFounded`. -/ theorem edge.wellFounded {Hist : History} {X : Sequent} {tab : Tableau Hist X} : WellFounded (@edge Hist X tab) := by apply @RelHomClass.wellFounded _ Nat (@edge Hist X tab) Nat.lt _ _ _ edgeNatLTRelHom - have := instWellFoundedLTNat - rcases this with ⟨nat_wf⟩ - exact nat_wf + exact instWellFoundedLTNat instance edge.isAsymm {Hist : History} {X : Sequent} {tab : Tableau Hist X} : @Std.Asymm - (PathIn tab) edge := by - constructor - apply WellFounded.asymmetric edge.wellFounded + (PathIn tab) edge := + edge.wellFounded.asymm theorem edge_is_strict_ordering {Hist X} {tab : Tableau Hist X} {s t : PathIn tab} : s ⋖_ t → s ≠ t := by @@ -510,7 +507,7 @@ instance {Hist X} {tab : Tableau Hist X} : LE (PathIn tab) := ⟨Relation.ReflTr /-- The "<" in a tableau is antisymmetric. -/ instance edge.TransGen_isAsymm {Hist : History} {X : Sequent} {tab : Tableau Hist X} : @Std.Asymm (PathIn tab) (Relation.TransGen edge) := - ⟨WellFounded.asymmetric (WellFounded.transGen wellFounded)⟩ + (WellFounded.transGen wellFounded).asymm theorem not_path_nil {Hist X} {tab : Tableau Hist X} {a : PathIn tab} : ¬(a < PathIn.nil) := by intro con