From 766ff5c9a0e64d97f299e8c9f66473bd460c7b37 Mon Sep 17 00:00:00 2001 From: Kevin Buzzard Date: Sat, 11 Jul 2026 10:52:39 +0100 Subject: [PATCH] chore: replace haveI/letI with have/let in tactic proofs of propositions The `haveI`/`letI` tactics differ from `have`/`let` only in that they inline their value into the proof term rather than binding it. In a tactic proof of a proposition this difference is invisible by proof irrelevance, so `have`/`let` should be used instead. This applies the fixes flagged by the `linter.style.haveILetI` linter across Mathlib, Archive and Counterexamples: 2649 sites in 964 files, each an elaborator-certified use of the `haveI`/`letI` *tactic* whose main goal is a proposition. Term-mode `haveI`/`letI` and uses whose goal is data are left untouched. One site (`CategoryTheory/Galois/Basic.lean`) additionally needed an explicit universe annotation `FintypeCat.{w}`, because the `have` tactic checks the declared type's universe eagerly whereas `haveI`, elaborated in term mode, defers it until the value pins it down. Co-Authored-By: Claude Opus 4.8 (1M context) --- Archive/Imo/Imo2008Q3.lean | 2 +- Archive/Imo/Imo2019Q2.lean | 8 +-- Archive/Wiedijk100Theorems/BallotProblem.lean | 6 +- Archive/Wiedijk100Theorems/CubingACube.lean | 2 +- .../Wiedijk100Theorems/FriendshipGraphs.lean | 2 +- .../CliffordAlgebraNotInjective.lean | 2 +- Counterexamples/Phillips.lean | 2 +- Counterexamples/SorgenfreyLine.lean | 4 +- .../ZeroDivisorsInAddMonoidAlgebras.lean | 4 +- Mathlib/Algebra/Algebra/Operations.lean | 2 +- .../Algebra/Subalgebra/IsSimpleOrder.lean | 4 +- Mathlib/Algebra/Algebra/Subalgebra/Rank.lean | 8 +-- Mathlib/Algebra/AlgebraicCard.lean | 2 +- Mathlib/Algebra/BigOperators/Associated.lean | 2 +- Mathlib/Algebra/BigOperators/Finprod.lean | 6 +- .../BigOperators/Group/Finset/Basic.lean | 4 +- Mathlib/Algebra/Category/Grp/Images.lean | 4 +- .../Category/ModuleCat/ChangeOfRings.lean | 14 ++--- .../ModuleCat/Differentials/Basic.lean | 4 +- Mathlib/Algebra/Category/ModuleCat/Free.lean | 2 +- .../Algebra/Category/ModuleCat/Kernels.lean | 2 +- .../ModuleCat/Monoidal/Adjunction.lean | 2 +- Mathlib/Algebra/Category/ModuleCat/Stalk.lean | 2 +- Mathlib/Algebra/Category/Ring/Epi.lean | 2 +- .../Category/Ring/FinitePresentation.lean | 2 +- .../Algebra/Category/Ring/LinearAlgebra.lean | 2 +- Mathlib/Algebra/Central/Basic.lean | 2 +- Mathlib/Algebra/CharP/Algebra.lean | 8 +-- Mathlib/Algebra/CharP/Defs.lean | 4 +- Mathlib/Algebra/CharP/Invertible.lean | 2 +- Mathlib/Algebra/CharP/Lemmas.lean | 2 +- Mathlib/Algebra/CharP/LocalRing.lean | 8 +-- Mathlib/Algebra/CharP/MixedCharZero.lean | 4 +- Mathlib/Algebra/CharP/Quotient.lean | 2 +- Mathlib/Algebra/DirectSum/Decomposition.lean | 2 +- Mathlib/Algebra/DualNumber.lean | 2 +- Mathlib/Algebra/EuclideanDomain/Basic.lean | 2 +- Mathlib/Algebra/Exact/Basic.lean | 2 +- Mathlib/Algebra/Exact/Sequence.lean | 8 +-- Mathlib/Algebra/Field/Subfield/Basic.lean | 2 +- Mathlib/Algebra/Group/Subgroup/Finite.lean | 2 +- Mathlib/Algebra/Group/Subgroup/Lattice.lean | 2 +- .../Algebra/Group/Submonoid/Membership.lean | 2 +- Mathlib/Algebra/Group/TransferInstance.lean | 8 +-- Mathlib/Algebra/Homology/Additive.lean | 4 +- .../Homology/DerivedCategory/Ext/Basic.lean | 32 +++++------ .../DerivedCategory/Ext/EnoughInjectives.lean | 4 +- .../Ext/EnoughProjectives.lean | 4 +- .../DerivedCategory/Ext/ExactSequences.lean | 12 ++-- .../DerivedCategory/Ext/ExtClass.lean | 6 +- .../DerivedCategory/Ext/TStructure.lean | 2 +- .../Homology/DerivedCategory/KInjective.lean | 2 +- .../Homology/DerivedCategory/KProjective.lean | 2 +- .../DerivedCategory/SmallShiftedHom.lean | 2 +- Mathlib/Algebra/Homology/HomotopyCofiber.lean | 10 ++-- Mathlib/Algebra/Homology/ImageToKernel.lean | 2 +- .../Algebra/Homology/ShortComplex/Exact.lean | 18 +++--- .../Homology/ShortComplex/Homology.lean | 2 +- .../Homology/ShortComplex/LeftHomology.lean | 2 +- .../Homology/ShortComplex/QuasiIso.lean | 4 +- .../Homology/ShortComplex/RightHomology.lean | 4 +- Mathlib/Algebra/Lie/Engel.lean | 8 +-- Mathlib/Algebra/Lie/Extension.lean | 2 +- Mathlib/Algebra/Lie/Loop.lean | 2 +- Mathlib/Algebra/Module/PID.lean | 4 +- Mathlib/Algebra/Module/SnakeLemma.lean | 6 +- Mathlib/Algebra/Module/SpanRank.lean | 2 +- Mathlib/Algebra/Module/Submodule/Lattice.lean | 2 +- Mathlib/Algebra/Module/Torsion/Basic.lean | 2 +- Mathlib/Algebra/Module/TransferInstance.lean | 2 +- Mathlib/Algebra/Module/ZLattice/Basic.lean | 2 +- Mathlib/Algebra/Notation/Indicator.lean | 2 +- .../Algebra/Order/Group/Unbundled/Abs.lean | 2 +- .../Algebra/Order/Monoid/Unbundled/Basic.lean | 8 +-- .../Algebra/Polynomial/Degree/Operations.lean | 2 +- Mathlib/Algebra/Polynomial/Div.lean | 20 +++---- Mathlib/Algebra/Polynomial/Expand.lean | 2 +- Mathlib/Algebra/Polynomial/Inductions.lean | 2 +- Mathlib/Algebra/Polynomial/Module/Basic.lean | 2 +- Mathlib/Algebra/Ring/Subring/Basic.lean | 2 +- Mathlib/Algebra/Ring/Subsemiring/Basic.lean | 2 +- Mathlib/Algebra/Squarefree/Basic.lean | 2 +- Mathlib/Algebra/TrivSqZeroExt/Basic.lean | 6 +- Mathlib/AlgebraicGeometry/AffineScheme.lean | 18 +++--- .../AffineTransitionLimit.lean | 6 +- Mathlib/AlgebraicGeometry/ColimitsOver.lean | 2 +- .../EllipticCurve/IsomOfJ.lean | 18 +++--- .../EllipticCurve/NormalForms.lean | 14 ++--- Mathlib/AlgebraicGeometry/FunctionField.lean | 2 +- .../AlgebraicGeometry/IdealSheaf/Basic.lean | 2 +- .../IdealSheaf/Subscheme.lean | 8 +-- Mathlib/AlgebraicGeometry/Limits.lean | 8 +-- Mathlib/AlgebraicGeometry/Modules/Tilde.lean | 10 ++-- .../AlgebraicGeometry/Morphisms/Affine.lean | 6 +- .../Morphisms/AffineAnd.lean | 6 +- .../AlgebraicGeometry/Morphisms/Basic.lean | 16 +++--- .../Morphisms/ClosedImmersion.lean | 4 +- .../Morphisms/Constructors.lean | 12 ++-- .../AlgebraicGeometry/Morphisms/Finite.lean | 4 +- .../Morphisms/FormallyUnramified.lean | 2 +- .../Morphisms/OpenImmersion.lean | 2 +- .../AlgebraicGeometry/Morphisms/Proper.lean | 4 +- .../Morphisms/QuasiCompact.lean | 6 +- .../Morphisms/QuasiSeparated.lean | 4 +- .../Morphisms/RingHomProperties.lean | 20 +++---- .../Morphisms/Separated.lean | 2 +- .../AlgebraicGeometry/Morphisms/Smooth.lean | 4 +- Mathlib/AlgebraicGeometry/Normalization.lean | 10 ++-- .../ProjectiveSpectrum/Basic.lean | 4 +- .../ProjectiveSpectrum/Proper.lean | 2 +- .../ProjectiveSpectrum/Scheme.lean | 8 +-- Mathlib/AlgebraicGeometry/Properties.lean | 14 ++--- Mathlib/AlgebraicGeometry/Pullbacks.lean | 2 +- Mathlib/AlgebraicGeometry/Sites/Etale.lean | 2 +- .../Sites/MorphismProperty.lean | 2 +- Mathlib/AlgebraicGeometry/Sites/Small.lean | 6 +- Mathlib/AlgebraicGeometry/SpreadingOut.lean | 8 +-- Mathlib/AlgebraicGeometry/Stalk.lean | 2 +- Mathlib/AlgebraicGeometry/StructureSheaf.lean | 12 ++-- .../AlgebraicGeometry/ValuativeCriterion.lean | 6 +- .../DoldKan/NReflectsIso.lean | 2 +- .../SimplexCategory/Basic.lean | 12 ++-- .../SimplicialSet/HomotopyCat.lean | 2 +- .../Analysis/BoxIntegral/Integrability.lean | 6 +- .../Instances.lean | 2 +- .../Calculus/ContDiff/Convolution.lean | 2 +- .../ApproximatesLinearOn.lean | 2 +- .../FiniteDimensional.lean | 2 +- .../Calculus/LagrangeMultipliers.lean | 2 +- Mathlib/Analysis/Calculus/LogDeriv.lean | 2 +- Mathlib/Analysis/Calculus/MeanValue.lean | 14 ++--- .../Analysis/Calculus/ParametricIntegral.lean | 2 +- Mathlib/Analysis/Calculus/SmoothSeries.lean | 6 +- .../Analysis/Calculus/UniformLimitsDeriv.lean | 10 ++-- .../Analysis/Complex/Polynomial/Basic.lean | 2 +- .../Complex/UpperHalfPlane/Metric.lean | 4 +- Mathlib/Analysis/ConstantSpeed.lean | 2 +- .../Analysis/Convex/Cone/TensorProduct.lean | 2 +- Mathlib/Analysis/Convex/EGauge.lean | 2 +- Mathlib/Analysis/Convex/Extreme.lean | 2 +- Mathlib/Analysis/Convex/Integral.lean | 6 +- Mathlib/Analysis/Convex/Intrinsic.lean | 8 +-- Mathlib/Analysis/Convex/KreinMilman.lean | 2 +- Mathlib/Analysis/Convex/MetricSpace.lean | 2 +- Mathlib/Analysis/Convex/Side.lean | 8 +-- Mathlib/Analysis/Convex/StdSimplex.lean | 2 +- .../Distribution/AEEqOfIntegralContDiff.lean | 2 +- .../Distribution/TemperedDistribution.lean | 2 +- Mathlib/Analysis/Fourier/AddCircle.lean | 6 +- Mathlib/Analysis/Hofer.lean | 2 +- .../Analysis/InnerProductSpace/Adjoint.lean | 16 +++--- Mathlib/Analysis/InnerProductSpace/Basic.lean | 6 +- Mathlib/Analysis/InnerProductSpace/Defs.lean | 4 +- .../InnerProductSpace/LaxMilgram.lean | 2 +- .../InnerProductSpace/Orientation.lean | 8 +-- Mathlib/Analysis/InnerProductSpace/PiL2.lean | 4 +- .../InnerProductSpace/Projection/Basic.lean | 2 +- .../Projection/FiniteDimensional.lean | 12 ++-- .../InnerProductSpace/Projection/Minimal.lean | 8 +-- .../Analysis/InnerProductSpace/Rayleigh.lean | 6 +- .../Analysis/InnerProductSpace/Spectrum.lean | 2 +- .../Analysis/InnerProductSpace/l2Space.lean | 2 +- Mathlib/Analysis/LocallyConvex/Bounded.lean | 4 +- .../Analysis/LocallyConvex/HahnBanach.lean | 8 +-- Mathlib/Analysis/LocallyConvex/WeakDual.lean | 8 +-- Mathlib/Analysis/Matrix/LDL.lean | 4 +- .../Normed/Affine/AddTorsorBases.lean | 4 +- Mathlib/Analysis/Normed/Affine/MazurUlam.lean | 2 +- .../Analysis/Normed/Algebra/Exponential.lean | 2 +- .../Normed/Algebra/QuaternionExponential.lean | 2 +- Mathlib/Analysis/Normed/Algebra/Spectrum.lean | 2 +- Mathlib/Analysis/Normed/Field/Dense.lean | 4 +- Mathlib/Analysis/Normed/Group/Uniform.lean | 2 +- Mathlib/Analysis/Normed/Lp/PiLp.lean | 6 +- Mathlib/Analysis/Normed/Lp/ProdLp.lean | 4 +- Mathlib/Analysis/Normed/Lp/lpSpace.lean | 8 +-- Mathlib/Analysis/Normed/Module/Basic.lean | 10 ++-- .../Analysis/Normed/Module/Complemented.lean | 2 +- Mathlib/Analysis/Normed/Module/Dual.lean | 2 +- .../Normed/Module/FiniteDimension.lean | 6 +- .../Normed/Module/Multilinear/Basic.lean | 2 +- .../Module/MultipliableUniformlyOn.lean | 4 +- .../PiTensorProduct/InjectiveSeminorm.lean | 4 +- Mathlib/Analysis/Normed/Operator/Banach.lean | 4 +- .../Analysis/Normed/Operator/NormedSpace.lean | 2 +- Mathlib/Analysis/Normed/Order/UpperLower.lean | 2 +- .../Normed/Unbundled/FiniteExtension.lean | 4 +- .../Normed/Unbundled/SpectralNorm.lean | 14 ++--- Mathlib/Analysis/RCLike/TangentCone.lean | 4 +- Mathlib/Analysis/Seminorm.lean | 12 ++-- .../Analysis/SpecialFunctions/Bernstein.lean | 2 +- .../Gaussian/FourierTransform.lean | 2 +- .../SpecialFunctions/Pow/Integral.lean | 2 +- .../Trigonometric/Complex.lean | 2 +- Mathlib/Analysis/SpecificLimits/Basic.lean | 2 +- Mathlib/CategoryTheory/Abelian/Basic.lean | 8 +-- .../Abelian/GrothendieckAxioms/Basic.lean | 12 ++-- .../GrothendieckCategory/Subobject.lean | 2 +- .../Abelian/Injective/Basic.lean | 2 +- .../Abelian/Injective/Dimension.lean | 22 ++++---- .../Abelian/NonPreadditive.lean | 12 ++-- .../Abelian/Projective/Basic.lean | 2 +- .../Abelian/Projective/Dimension.lean | 22 ++++---- .../Abelian/Pseudoelements.lean | 4 +- .../Abelian/SerreClass/Localization.lean | 10 ++-- Mathlib/CategoryTheory/Abelian/Transfer.lean | 4 +- Mathlib/CategoryTheory/Adhesive/Basic.lean | 4 +- .../CategoryTheory/Adjunction/Reflective.lean | 8 +-- .../CategoryTheory/Category/Cat/Limit.lean | 4 +- Mathlib/CategoryTheory/CofilteredSystem.lean | 18 +++--- Mathlib/CategoryTheory/Comma/Final.lean | 4 +- .../ConcreteCategory/ReflectsIso.lean | 4 +- Mathlib/CategoryTheory/Extensive.lean | 4 +- .../FiberedCategory/Cartesian.lean | 2 +- .../Filtered/CostructuredArrow.lean | 4 +- Mathlib/CategoryTheory/Filtered/Final.lean | 8 +-- Mathlib/CategoryTheory/Functor/Flat.lean | 8 +-- .../Functor/KanExtension/Basic.lean | 4 +- .../Functor/ReflectsIso/Balanced.lean | 4 +- .../Functor/ReflectsIso/Basic.lean | 2 +- Mathlib/CategoryTheory/Galois/Basic.lean | 18 +++--- .../CategoryTheory/Galois/Equivalence.lean | 2 +- Mathlib/CategoryTheory/Galois/EssSurj.lean | 8 +-- Mathlib/CategoryTheory/Galois/Examples.lean | 6 +- .../Galois/Prorepresentability.lean | 2 +- Mathlib/CategoryTheory/Galois/Topology.lean | 4 +- Mathlib/CategoryTheory/Generator/Abelian.lean | 4 +- Mathlib/CategoryTheory/Generator/Basic.lean | 12 ++-- Mathlib/CategoryTheory/Groupoid/Basic.lean | 2 +- .../GuitartExact/VerticalComposition.lean | 4 +- Mathlib/CategoryTheory/Idempotents/Basic.lean | 6 +- .../Idempotents/FunctorCategories.lean | 2 +- Mathlib/CategoryTheory/Limits/Comma.lean | 16 +++--- Mathlib/CategoryTheory/Limits/Cones.lean | 4 +- .../FiniteProductsOfBinaryProducts.lean | 12 ++-- .../LimitsOfProductsAndEqualizers.lean | 6 +- .../Limits/Constructions/WeaklyInitial.lean | 4 +- Mathlib/CategoryTheory/Limits/Final.lean | 10 ++-- Mathlib/CategoryTheory/Limits/HasLimits.lean | 16 +++--- .../CategoryTheory/Limits/IsConnected.lean | 4 +- Mathlib/CategoryTheory/Limits/Lattice.lean | 4 +- Mathlib/CategoryTheory/Limits/MonoCoprod.lean | 4 +- .../Limits/MorphismProperty.lean | 4 +- .../Limits/Preserves/Bifunctor.lean | 4 +- .../Limits/Preserves/Filtered.lean | 8 +-- .../Limits/Preserves/Finite.lean | 14 ++--- .../Limits/Preserves/Grothendieck.lean | 2 +- .../Limits/Preserves/Shapes/Biproducts.lean | 2 +- .../Limits/Preserves/Shapes/Equalizers.lean | 2 +- .../Limits/Preserves/Shapes/Terminal.lean | 4 +- .../Limits/Shapes/Biproducts.lean | 2 +- .../Limits/Shapes/Equalizers.lean | 4 +- .../Limits/Shapes/FiniteLimits.lean | 8 +-- .../Limits/Shapes/FiniteProducts.lean | 4 +- .../CategoryTheory/Limits/Shapes/Images.lean | 4 +- .../Limits/Shapes/IsTerminal.lean | 4 +- .../Limits/Shapes/NormalMono/Basic.lean | 4 +- .../Limits/Shapes/Opposites/Products.lean | 2 +- .../Limits/Shapes/Opposites/Pullbacks.lean | 4 +- .../Limits/Shapes/Reflexive.lean | 4 +- .../Limits/Shapes/RegularMono.lean | 4 +- .../Limits/Shapes/StrictInitial.lean | 10 ++-- Mathlib/CategoryTheory/Limits/Sifted.lean | 4 +- Mathlib/CategoryTheory/Limits/VanKampen.lean | 12 ++-- .../Localization/Adjunction.lean | 4 +- .../Localization/CalculusOfFractions.lean | 12 ++-- .../Localization/Construction.lean | 2 +- .../OfLocalizedEquivalences.lean | 4 +- .../Localization/Equivalence.lean | 2 +- .../CategoryTheory/Localization/HomEquiv.lean | 2 +- .../CategoryTheory/Localization/Linear.lean | 2 +- .../Localization/LocalizerMorphism.lean | 8 +-- .../Localization/Monoidal/Functor.lean | 2 +- Mathlib/CategoryTheory/Localization/Pi.lean | 6 +- .../Localization/Predicate.lean | 4 +- Mathlib/CategoryTheory/Localization/Prod.lean | 6 +- .../Localization/Resolution.lean | 8 +-- .../CategoryTheory/Localization/SmallHom.lean | 4 +- .../CategoryTheory/Monad/Comonadicity.lean | 2 +- Mathlib/CategoryTheory/Monad/Limits.lean | 16 +++--- Mathlib/CategoryTheory/Monad/Monadicity.lean | 2 +- .../Monoidal/Action/Opposites.lean | 8 +-- .../Monoidal/Cartesian/Basic.lean | 4 +- .../Monoidal/Cartesian/CommMon_.lean | 2 +- .../Monoidal/Cartesian/FunctorCategory.lean | 2 +- .../Monoidal/Cartesian/Grp.lean | 2 +- .../Monoidal/Cartesian/Mon.lean | 2 +- .../Monoidal/Closed/Cartesian.lean | 8 +-- .../CategoryTheory/Monoidal/Closed/Ideal.lean | 4 +- .../Monoidal/DayConvolution.lean | 14 ++--- .../Monoidal/DayConvolution/Braided.lean | 4 +- .../ExternalProduct/KanExtension.lean | 4 +- Mathlib/CategoryTheory/Monoidal/Functor.lean | 6 +- Mathlib/CategoryTheory/Monoidal/Mon.lean | 2 +- .../Monoidal/NaturalTransformation.lean | 2 +- .../MorphismProperty/IsInvertedBy.lean | 10 ++-- .../MorphismProperty/Limits.lean | 4 +- .../TransfiniteComposition.lean | 2 +- .../ObjectProperty/FiniteProducts.lean | 4 +- .../ObjectProperty/Kernels.lean | 4 +- Mathlib/CategoryTheory/PUnit.lean | 2 +- .../Preadditive/Biproducts.lean | 26 ++++----- .../Preadditive/Injective/Basic.lean | 4 +- .../CategoryTheory/Preadditive/LeftExact.lean | 20 +++---- .../Preadditive/Projective/Basic.lean | 2 +- Mathlib/CategoryTheory/Preadditive/Schur.lean | 4 +- .../Presentable/CardinalDirectedPoset.lean | 4 +- .../Presentable/SharplyLT/Basic.lean | 4 +- Mathlib/CategoryTheory/Quotient/Linear.lean | 2 +- Mathlib/CategoryTheory/Shift/Adjunction.lean | 8 +-- Mathlib/CategoryTheory/Shift/CommShift.lean | 6 +- .../CategoryTheory/Shift/Localization.lean | 4 +- Mathlib/CategoryTheory/Simple.lean | 6 +- .../Sites/ConcreteSheafification.lean | 2 +- .../Sites/EqualizerSheafCondition.lean | 2 +- Mathlib/CategoryTheory/Sites/Equivalence.lean | 2 +- Mathlib/CategoryTheory/Sites/IsSheafFor.lean | 4 +- Mathlib/CategoryTheory/Sites/LeftExact.lean | 4 +- Mathlib/CategoryTheory/Sites/Point/Basic.lean | 2 +- Mathlib/CategoryTheory/Sites/Sheaf.lean | 2 +- .../IsCardinalForSmallObjectArgument.lean | 20 +++---- .../CategoryTheory/Subobject/MonoOver.lean | 2 +- .../Triangulated/LocalizingSubcategory.lean | 6 +- .../Additive/ErdosGinzburgZiv.lean | 4 +- .../Combinatorics/Additive/RuzsaCovering.lean | 2 +- Mathlib/Combinatorics/Configuration.lean | 6 +- .../Enumerative/IncidenceAlgebra.lean | 4 +- .../Extremal/RuzsaSzemeredi.lean | 6 +- Mathlib/Combinatorics/Hall/Basic.lean | 6 +- Mathlib/Combinatorics/Hall/Finite.lean | 10 ++-- Mathlib/Combinatorics/Nullstellensatz.lean | 4 +- .../Combinatorics/SimpleGraph/DegreeSum.lean | 4 +- .../SimpleGraph/Finsubgraph.lean | 4 +- .../Combinatorics/SimpleGraph/Matching.lean | 6 +- .../Combinatorics/SimpleGraph/Operations.lean | 2 +- Mathlib/Combinatorics/SimpleGraph/Prod.lean | 14 ++--- .../SimpleGraph/StronglyRegular.lean | 2 +- .../SimpleGraph/UniversalVerts.lean | 2 +- Mathlib/Computability/Primrec/Basic.lean | 8 +-- Mathlib/Computability/Primrec/List.lean | 4 +- .../TuringMachine/PostTuringMachine.lean | 2 +- .../Condensed/Discrete/Characterization.lean | 8 +-- .../Condensed/Discrete/LocallyConstant.lean | 2 +- Mathlib/Data/Analysis/Topology.lean | 2 +- Mathlib/Data/DFinsupp/Defs.lean | 2 +- Mathlib/Data/DFinsupp/FiniteInfinite.lean | 2 +- Mathlib/Data/DFinsupp/WellFounded.lean | 8 +-- Mathlib/Data/ENNReal/Operations.lean | 2 +- Mathlib/Data/ENat/Lattice.lean | 2 +- .../Data/Fin/Tuple/BubbleSortInduction.lean | 2 +- Mathlib/Data/Finite/Prod.lean | 10 ++-- Mathlib/Data/Finite/Sigma.lean | 4 +- Mathlib/Data/Finite/Sum.lean | 4 +- Mathlib/Data/Finite/Vector.lean | 4 +- Mathlib/Data/Finset/Fold.lean | 2 +- Mathlib/Data/Finset/Image.lean | 2 +- Mathlib/Data/Finset/Lattice/Fold.lean | 6 +- Mathlib/Data/Finset/Preimage.lean | 2 +- Mathlib/Data/Finset/Slice.lean | 2 +- Mathlib/Data/Finset/Sort.lean | 2 +- Mathlib/Data/Fintype/CardEmbedding.lean | 2 +- Mathlib/Data/Fintype/EquivFin.lean | 2 +- Mathlib/Data/Fintype/Pi.lean | 2 +- Mathlib/Data/Fintype/Prod.lean | 2 +- Mathlib/Data/Holor.lean | 2 +- Mathlib/Data/Int/ModEq.lean | 2 +- Mathlib/Data/List/AList.lean | 2 +- Mathlib/Data/List/OffDiag.lean | 4 +- Mathlib/Data/Multiset/Powerset.lean | 4 +- Mathlib/Data/Multiset/ZeroCons.lean | 2 +- Mathlib/Data/Nat/Cast/Defs.lean | 2 +- Mathlib/Data/Nat/Choose/Lucas.lean | 4 +- Mathlib/Data/Nat/Choose/Multinomial.lean | 2 +- Mathlib/Data/Nat/Nth.lean | 2 +- Mathlib/Data/Nat/Totient.lean | 12 ++-- Mathlib/Data/PFunctor/Univariate/M.lean | 2 +- Mathlib/Data/Prod/Basic.lean | 4 +- Mathlib/Data/Seq/Computation.lean | 4 +- Mathlib/Data/Seq/Parallel.lean | 4 +- Mathlib/Data/Set/Card.lean | 4 +- Mathlib/Data/Set/Countable.lean | 2 +- Mathlib/Data/Set/Finite/Basic.lean | 4 +- Mathlib/Data/Set/Finite/Lattice.lean | 12 ++-- Mathlib/Data/Set/Finite/Range.lean | 2 +- Mathlib/Data/Set/Function.lean | 2 +- Mathlib/Data/Set/Lattice.lean | 2 +- Mathlib/Data/Set/Lattice/Image.lean | 2 +- Mathlib/Data/Sym/NatCard.lean | 6 +- Mathlib/Data/ZMod/Basic.lean | 10 ++-- Mathlib/Data/ZMod/QuotientGroup.lean | 2 +- Mathlib/Data/ZMod/Units.lean | 2 +- Mathlib/Dynamics/Ergodic/Function.lean | 2 +- Mathlib/FieldTheory/AbelRuffini.lean | 6 +- Mathlib/FieldTheory/AxGrothendieck.lean | 6 +- Mathlib/FieldTheory/CardinalEmb.lean | 2 +- Mathlib/FieldTheory/Cardinality.lean | 4 +- Mathlib/FieldTheory/ChevalleyWarning.lean | 4 +- Mathlib/FieldTheory/Differential/Basic.lean | 6 +- .../FieldTheory/Differential/Liouville.lean | 2 +- Mathlib/FieldTheory/Extension.lean | 6 +- Mathlib/FieldTheory/Finite/Basic.lean | 12 ++-- Mathlib/FieldTheory/Finite/Extension.lean | 4 +- Mathlib/FieldTheory/Finite/GaloisField.lean | 14 ++--- Mathlib/FieldTheory/Finite/Trace.lean | 2 +- Mathlib/FieldTheory/Galois/Basic.lean | 2 +- Mathlib/FieldTheory/Galois/IsGaloisGroup.lean | 10 ++-- Mathlib/FieldTheory/Galois/Profinite.lean | 4 +- .../IntermediateField/Adjoin/Basic.lean | 10 ++-- .../IntermediateField/Algebraic.lean | 2 +- .../FieldTheory/IntermediateField/Basic.lean | 2 +- Mathlib/FieldTheory/IsAlgClosed/Basic.lean | 4 +- .../IsAlgClosed/Classification.lean | 12 ++-- Mathlib/FieldTheory/KrullTopology.lean | 2 +- Mathlib/FieldTheory/KummerExtension.lean | 14 ++--- Mathlib/FieldTheory/LinearDisjoint.lean | 10 ++-- Mathlib/FieldTheory/Minpoly/Basic.lean | 4 +- Mathlib/FieldTheory/Normal/Basic.lean | 6 +- Mathlib/FieldTheory/Normal/Closure.lean | 2 +- Mathlib/FieldTheory/Perfect.lean | 2 +- .../FieldTheory/PolynomialGaloisGroup.lean | 10 ++-- Mathlib/FieldTheory/PrimitiveElement.lean | 10 ++-- .../FieldTheory/PurelyInseparable/Basic.lean | 22 ++++---- .../PurelyInseparable/PerfectClosure.lean | 22 ++++---- .../FieldTheory/PurelyInseparable/Tower.lean | 16 +++--- Mathlib/FieldTheory/RatFunc/Basic.lean | 2 +- .../RatFunc/IntermediateField.lean | 2 +- Mathlib/FieldTheory/Relrank.lean | 14 ++--- Mathlib/FieldTheory/Separable.lean | 8 +-- Mathlib/FieldTheory/SeparableClosure.lean | 8 +-- Mathlib/FieldTheory/SeparableDegree.lean | 24 ++++---- Mathlib/Geometry/Euclidean/Altitude.lean | 4 +- .../Geometry/Euclidean/Angle/Bisector.lean | 10 ++-- .../Euclidean/Angle/Oriented/Projection.lean | 2 +- .../Euclidean/Angle/Oriented/Rotation.lean | 4 +- Mathlib/Geometry/Euclidean/Angle/Sphere.lean | 2 +- .../Angle/Unoriented/Projection.lean | 2 +- Mathlib/Geometry/Euclidean/Circumcenter.lean | 6 +- Mathlib/Geometry/Euclidean/Incenter.lean | 6 +- Mathlib/Geometry/Euclidean/MongePoint.lean | 2 +- .../Geometry/Euclidean/NinePointCircle.lean | 2 +- Mathlib/Geometry/Euclidean/Projection.lean | 2 +- Mathlib/Geometry/Euclidean/Sphere/Basic.lean | 2 +- Mathlib/Geometry/Euclidean/Sphere/Power.lean | 2 +- Mathlib/Geometry/Manifold/ChartedSpace.lean | 12 ++-- .../Geometry/Manifold/ContMDiff/Basic.lean | 4 +- Mathlib/Geometry/Manifold/Diffeomorph.lean | 6 +- .../Geometry/Manifold/IsManifold/Basic.lean | 28 +++++----- .../Manifold/IsManifold/ExtChartAt.lean | 4 +- Mathlib/Geometry/Manifold/Metrizable.lean | 6 +- .../Geometry/Manifold/PartitionOfUnity.lean | 8 +-- .../Geometry/Manifold/Riemannian/Basic.lean | 2 +- .../Geometry/Manifold/VectorBundle/Basic.lean | 4 +- .../Geometry/Manifold/WhitneyEmbedding.lean | 6 +- .../LocallyRingedSpace/HasColimits.lean | 4 +- .../Geometry/RingedSpace/OpenImmersion.lean | 6 +- .../Geometry/RingedSpace/PresheafedSpace.lean | 4 +- Mathlib/GroupTheory/CommutingProbability.lean | 2 +- Mathlib/GroupTheory/Exponent.lean | 2 +- Mathlib/GroupTheory/FiniteAbelian/Basic.lean | 8 +-- Mathlib/GroupTheory/Finiteness.lean | 4 +- Mathlib/GroupTheory/GroupAction/Defs.lean | 4 +- .../GroupTheory/GroupAction/DomAct/Basic.lean | 2 +- .../GroupAction/MultipleTransitivity.lean | 4 +- .../GroupTheory/GroupAction/Primitive.lean | 2 +- Mathlib/GroupTheory/Nilpotent.lean | 4 +- Mathlib/GroupTheory/NoncommPiCoprod.lean | 6 +- Mathlib/GroupTheory/Order/Min.lean | 2 +- Mathlib/GroupTheory/OrderOfElement.lean | 2 +- Mathlib/GroupTheory/PGroup.lean | 10 ++-- Mathlib/GroupTheory/Perm/Cycle/Basic.lean | 6 +- Mathlib/GroupTheory/Perm/Cycle/Factors.lean | 2 +- Mathlib/GroupTheory/Perm/Cycle/Type.lean | 2 +- Mathlib/GroupTheory/PushoutI.lean | 4 +- Mathlib/GroupTheory/Rank.lean | 2 +- Mathlib/GroupTheory/Schreier.lean | 12 ++-- Mathlib/GroupTheory/SchurZassenhaus.lean | 16 +++--- Mathlib/GroupTheory/Solvable.lean | 2 +- .../SpecificGroups/Quaternion.lean | 4 +- Mathlib/GroupTheory/Sylow.lean | 14 ++--- Mathlib/GroupTheory/Transfer.lean | 8 +-- Mathlib/LinearAlgebra/AffineSpace/Basis.lean | 2 +- .../AffineSpace/FiniteDimensional.lean | 6 +- .../AffineSpace/Independent.lean | 2 +- .../AffineSpace/Simplex/Basic.lean | 4 +- .../AffineSpace/Simplex/Centroid.lean | 6 +- Mathlib/LinearAlgebra/Alternating/Basic.lean | 2 +- Mathlib/LinearAlgebra/Basis/VectorSpace.lean | 2 +- .../BilinearForm/DualLattice.lean | 6 +- Mathlib/LinearAlgebra/Charpoly/Basic.lean | 2 +- .../CliffordAlgebra/BaseChange.lean | 4 +- .../CliffordAlgebra/Inversion.lean | 6 +- .../CliffordAlgebra/SpinGroup.lean | 28 +++++----- Mathlib/LinearAlgebra/Coevaluation.lean | 4 +- Mathlib/LinearAlgebra/DFinsupp.lean | 2 +- Mathlib/LinearAlgebra/Determinant.lean | 6 +- .../Dimension/ErdosKaplansky.lean | 6 +- Mathlib/LinearAlgebra/Dimension/Finite.lean | 4 +- Mathlib/LinearAlgebra/Dimension/Free.lean | 2 +- .../Dimension/FreeAndStrongRankCondition.lean | 32 +++++------ .../LinearAlgebra/Dimension/RankNullity.lean | 4 +- .../Dimension/StrongRankCondition.lean | 28 +++++----- Mathlib/LinearAlgebra/Dual/Basis.lean | 2 +- Mathlib/LinearAlgebra/Dual/Lemmas.lean | 4 +- .../Eigenspace/Triangularizable.lean | 2 +- .../LinearAlgebra/ExteriorAlgebra/Basic.lean | 12 ++-- .../LinearAlgebra/ExteriorPower/Basis.lean | 2 +- .../FiniteDimensional/Basic.lean | 4 +- .../FiniteDimensional/Lemmas.lean | 10 ++-- .../Finsupp/LinearCombination.lean | 2 +- Mathlib/LinearAlgebra/Finsupp/Supported.lean | 4 +- .../LinearAlgebra/FreeModule/Determinant.lean | 2 +- Mathlib/LinearAlgebra/FreeModule/Norm.lean | 2 +- Mathlib/LinearAlgebra/FreeModule/PID.lean | 2 +- Mathlib/LinearAlgebra/LinearDisjoint.lean | 4 +- .../LinearIndependent/Basic.lean | 4 +- .../LinearAlgebra/LinearIndependent/Defs.lean | 4 +- .../LinearIndependent/Lemmas.lean | 2 +- Mathlib/LinearAlgebra/Matrix/Adjugate.lean | 4 +- Mathlib/LinearAlgebra/Matrix/Basis.lean | 8 +-- Mathlib/LinearAlgebra/Matrix/Block.lean | 8 +-- .../Matrix/Charpoly/FiniteField.lean | 2 +- Mathlib/LinearAlgebra/Matrix/Invertible.lean | 6 +- .../Matrix/Irreducible/Defs.lean | 10 ++-- .../Matrix/NonsingularInverse.lean | 20 +++---- .../LinearAlgebra/Matrix/SchurComplement.lean | 16 +++--- Mathlib/LinearAlgebra/Matrix/ToLin.lean | 4 +- .../LinearAlgebra/Matrix/ToLinearEquiv.lean | 2 +- Mathlib/LinearAlgebra/Multilinear/Basic.lean | 16 +++--- Mathlib/LinearAlgebra/Multilinear/Curry.lean | 16 +++--- .../LinearAlgebra/Multilinear/DirectSum.lean | 4 +- .../Multilinear/FiniteDimensional.lean | 2 +- .../Multilinear/TensorProduct.lean | 8 +-- Mathlib/LinearAlgebra/Orientation.lean | 6 +- .../LinearAlgebra/PiTensorProduct/Basis.lean | 2 +- .../LinearAlgebra/PiTensorProduct/Dual.lean | 8 +-- .../Projectivization/Cardinality.lean | 6 +- .../Projectivization/PSL/PSL2.lean | 2 +- .../LinearAlgebra/QuadraticForm/Basic.lean | 2 +- .../LinearAlgebra/QuadraticForm/Basis.lean | 2 +- .../QuadraticForm/TensorProduct.lean | 2 +- Mathlib/LinearAlgebra/RootSystem/Base.lean | 12 ++-- .../LinearAlgebra/RootSystem/BaseExists.lean | 14 ++--- Mathlib/LinearAlgebra/RootSystem/Chain.lean | 14 ++--- .../LinearAlgebra/RootSystem/Finite/G2.lean | 2 +- .../RootSystem/GeckConstruction/Basic.lean | 4 +- .../RootSystem/GeckConstruction/Lemmas.lean | 6 +- .../GeckConstruction/Relations.lean | 10 ++-- .../GeckConstruction/Semisimple.lean | 8 +-- Mathlib/LinearAlgebra/RootSystem/Hom.lean | 2 +- Mathlib/LinearAlgebra/Semisimple.lean | 2 +- .../LinearAlgebra/TensorAlgebra/Basic.lean | 4 +- Mathlib/LinearAlgebra/Trace.lean | 8 +-- Mathlib/Logic/Denumerable.lean | 2 +- Mathlib/Logic/Equiv/Fin/Rotate.lean | 4 +- Mathlib/Logic/Equiv/List.lean | 2 +- Mathlib/Logic/Nontrivial/Basic.lean | 2 +- .../Constructions/BorelSpace/Metric.lean | 2 +- .../Constructions/BorelSpace/Metrizable.lean | 2 +- .../Constructions/BorelSpace/Order.lean | 10 ++-- Mathlib/MeasureTheory/Constructions/Pi.lean | 8 +-- .../Constructions/Polish/Basic.lean | 44 +++++++-------- .../Polish/StronglyMeasurable.lean | 2 +- .../Constructions/Projective.lean | 2 +- .../MeasureTheory/Covering/Besicovitch.lean | 4 +- .../Covering/Differentiation.lean | 4 +- Mathlib/MeasureTheory/Covering/Vitali.lean | 2 +- .../Function/AEEqOfIntegral.lean | 8 +-- .../Function/AEMeasurableOrder.lean | 4 +- .../ConditionalExpectation/AEMeasurable.lean | 2 +- .../ConditionalExpectation/CondexpL2.lean | 2 +- .../ConditionalExpectation/Indicator.lean | 4 +- .../Function/FactorsThrough.lean | 2 +- Mathlib/MeasureTheory/Function/Jacobian.lean | 4 +- .../Function/L1Space/Integrable.lean | 4 +- .../Function/LocallyIntegrable.lean | 2 +- .../Function/LpSeminorm/Count.lean | 2 +- .../LpSeminorm/TriangleInequality.lean | 2 +- .../MeasureTheory/Function/SimpleFunc.lean | 2 +- .../Function/SimpleFuncDense.lean | 6 +- .../Function/SimpleFuncDenseLp.lean | 2 +- .../AEStronglyMeasurable.lean | 2 +- .../Function/StronglyMeasurable/Basic.lean | 12 ++-- .../Function/StronglyMeasurable/Lp.lean | 2 +- Mathlib/MeasureTheory/Group/AddCircle.lean | 4 +- .../Group/FundamentalDomain.lean | 4 +- .../MeasureTheory/Integral/Asymptotics.lean | 2 +- Mathlib/MeasureTheory/Integral/Average.lean | 6 +- .../MeasureTheory/Integral/Bochner/Basic.lean | 4 +- .../MeasureTheory/Integral/Bochner/Set.lean | 4 +- .../Integral/CurveIntegral/Basic.lean | 12 ++-- .../Integral/CurveIntegral/Poincare.lean | 2 +- .../Integral/FinMeasAdditive.lean | 2 +- .../MeasureTheory/Integral/IntegrableOn.lean | 4 +- .../IntervalIntegral/FundThmCalculus.lean | 2 +- .../IntervalIntegral/IntegrationByParts.lean | 2 +- .../Integral/IntervalIntegral/Periodic.lean | 2 +- .../Integral/Lebesgue/Basic.lean | 2 +- Mathlib/MeasureTheory/Integral/SetToL1.lean | 2 +- .../MeasurableSpace/CountablyGenerated.lean | 4 +- .../MeasurableSpace/MeasurablyGenerated.lean | 4 +- .../MeasureTheory/Measure/AEMeasurable.lean | 4 +- Mathlib/MeasureTheory/Measure/Content.lean | 4 +- .../Measure/FiniteMeasureExt.lean | 2 +- .../Measure/FiniteMeasurePi.lean | 2 +- .../Measure/FiniteMeasureProd.lean | 4 +- Mathlib/MeasureTheory/Measure/Haar/Basic.lean | 6 +- .../Measure/Haar/InnerProductSpace.lean | 2 +- .../MeasureTheory/Measure/Haar/Quotient.lean | 6 +- .../Measure/HasOuterApproxClosed.lean | 2 +- Mathlib/MeasureTheory/Measure/Hausdorff.lean | 12 ++-- .../MeasureTheory/Measure/Lebesgue/Basic.lean | 2 +- .../Measure/Lebesgue/EqHaar.lean | 8 +-- .../Measure/Lebesgue/VolumeOfBalls.lean | 20 +++---- .../Measure/LevyConvergence.lean | 2 +- .../Measure/LevyProkhorovMetric.lean | 2 +- .../MeasureTheory/Measure/MeasureSpace.lean | 6 +- .../MeasureTheory/Measure/Portmanteau.lean | 2 +- Mathlib/MeasureTheory/Measure/Prod.lean | 2 +- Mathlib/MeasureTheory/Measure/Regular.lean | 16 +++--- .../Measure/RegularityCompacts.lean | 2 +- Mathlib/MeasureTheory/Measure/Restrict.lean | 4 +- .../Measure/Typeclasses/Finite.lean | 2 +- .../Typeclasses/NullSingletonClass.lean | 2 +- .../Measure/Typeclasses/SFinite.lean | 2 +- .../OuterMeasure/OfFunction.lean | 8 +-- .../VectorMeasure/Decomposition/Lebesgue.lean | 8 +-- .../VectorMeasure/SetIntegral.lean | 2 +- .../VectorMeasure/WithDensity.lean | 6 +- .../Algebra/Ring/Definability.lean | 4 +- .../Arithmetic/Presburger/Definability.lean | 2 +- .../Presburger/Semilinear/Basic.lean | 14 ++--- Mathlib/ModelTheory/Definability.lean | 4 +- Mathlib/ModelTheory/Fraisse.lean | 2 +- Mathlib/ModelTheory/Graph.lean | 2 +- Mathlib/ModelTheory/LanguageMap.lean | 6 +- Mathlib/ModelTheory/Order.lean | 20 +++---- Mathlib/ModelTheory/Satisfiability.lean | 26 ++++----- Mathlib/ModelTheory/Substructures.lean | 6 +- .../ClassNumber/AdmissibleAbsoluteValue.lean | 2 +- Mathlib/NumberTheory/Cyclotomic/Basic.lean | 16 +++--- .../Cyclotomic/CyclotomicCharacter.lean | 6 +- .../NumberTheory/Cyclotomic/Discriminant.lean | 8 +-- Mathlib/NumberTheory/Cyclotomic/Gal.lean | 2 +- .../Cyclotomic/PrimitiveRoots.lean | 16 +++--- .../NumberTheory/LSeries/HurwitzZetaEven.lean | 2 +- .../NumberTheory/LegendreSymbol/Basic.lean | 2 +- .../LegendreSymbol/GaussEisensteinLemmas.lean | 2 +- .../LegendreSymbol/JacobiSymbol.lean | 2 +- Mathlib/NumberTheory/LocalField/Basic.lean | 12 ++-- Mathlib/NumberTheory/LucasLehmer.lean | 2 +- Mathlib/NumberTheory/Modular.lean | 4 +- .../ModularForms/CongruenceSubgroups.lean | 4 +- .../NumberTheory/ModularForms/QExpansion.lean | 2 +- .../NumberField/Cyclotomic/Basic.lean | 10 ++-- .../NumberField/Discriminant/Basic.lean | 6 +- .../NumberField/InfinitePlace/Embeddings.lean | 6 +- .../InfinitePlace/Ramification.lean | 4 +- Mathlib/NumberTheory/NumberField/Norm.lean | 6 +- Mathlib/NumberTheory/Padics/Complex.lean | 4 +- Mathlib/NumberTheory/Padics/RingHoms.lean | 2 +- Mathlib/NumberTheory/Pell.lean | 2 +- Mathlib/NumberTheory/PrimesCongruentOne.lean | 4 +- .../RamificationInertia/Basic.lean | 8 +-- .../RamificationInertia/Inertia.lean | 8 +-- .../RamificationInertia/Ramification.lean | 2 +- Mathlib/NumberTheory/WellApproximable.lean | 2 +- Mathlib/NumberTheory/Wilson.lean | 2 +- Mathlib/NumberTheory/Zsqrtd/Basic.lean | 2 +- Mathlib/Order/Category/NonemptyFinLinOrd.lean | 6 +- Mathlib/Order/CompleteLattice/Basic.lean | 4 +- .../ConditionallyCompleteLattice/Indexed.lean | 2 +- .../Indexed.lean | 4 +- Mathlib/Order/CountableDenseLinearOrder.lean | 2 +- Mathlib/Order/Disjoint.lean | 4 +- Mathlib/Order/Extension/Linear.lean | 12 ++-- .../Order/Filter/AtTopBot/BigOperators.lean | 2 +- Mathlib/Order/Filter/Basic.lean | 4 +- Mathlib/Order/Filter/CountableInter.lean | 6 +- Mathlib/Order/Filter/Finite.lean | 4 +- Mathlib/Order/Filter/IsBounded.lean | 2 +- Mathlib/Order/Filter/Map.lean | 2 +- Mathlib/Order/Filter/Pi.lean | 2 +- Mathlib/Order/Filter/Prod.lean | 2 +- Mathlib/Order/Filter/Ultrafilter/Defs.lean | 6 +- Mathlib/Order/KrullDimension.lean | 2 +- Mathlib/Order/Monotone/MonovaryOrder.lean | 2 +- Mathlib/Order/Partition/Equipartition.lean | 2 +- Mathlib/Order/WellFoundedSet.lean | 4 +- Mathlib/Order/WellQuasiOrder.lean | 4 +- Mathlib/Probability/CDF.lean | 2 +- Mathlib/Probability/Independence/ZeroOne.lean | 2 +- Mathlib/Probability/Kernel/Defs.lean | 2 +- .../Kernel/MeasurableIntegral.lean | 2 +- .../Probability/Martingale/Convergence.lean | 2 +- Mathlib/Probability/Process/Filtration.lean | 12 ++-- Mathlib/Probability/Process/Predictable.lean | 16 +++--- Mathlib/Probability/Process/Stopping.lean | 2 +- Mathlib/Probability/StrongLaw.lean | 2 +- Mathlib/Probability/UniformOn.lean | 2 +- Mathlib/RepresentationTheory/Coinduced.lean | 2 +- Mathlib/RepresentationTheory/Maschke.lean | 4 +- .../Subrepresentation.lean | 2 +- Mathlib/RingTheory/Adjoin/Field.lean | 6 +- Mathlib/RingTheory/Adjoin/PowerBasis.lean | 2 +- Mathlib/RingTheory/AdjoinRoot.lean | 2 +- Mathlib/RingTheory/Algebraic/Basic.lean | 6 +- .../AlgebraicIndependent/Basic.lean | 2 +- .../RankAndCardinality.lean | 14 ++--- .../TranscendenceBasis.lean | 12 ++-- Mathlib/RingTheory/ChainOfDivisors.lean | 14 ++--- Mathlib/RingTheory/Coprime/Ideal.lean | 2 +- .../RingTheory/DedekindDomain/Different.lean | 18 +++--- Mathlib/RingTheory/DedekindDomain/Dvr.lean | 12 ++-- .../DedekindDomain/Factorization.lean | 2 +- .../DedekindDomain/Ideal/Lemmas.lean | 4 +- .../DedekindDomain/IntegralClosure.lean | 20 +++---- Mathlib/RingTheory/DedekindDomain/PID.lean | 10 ++-- .../DiscreteValuationRing/Basic.lean | 10 ++-- .../DiscreteValuationRing/TFAE.lean | 2 +- Mathlib/RingTheory/Discriminant.lean | 2 +- Mathlib/RingTheory/EssentialFiniteness.lean | 2 +- Mathlib/RingTheory/Etale/Basic.lean | 4 +- Mathlib/RingTheory/Etale/Kaehler.lean | 18 +++--- Mathlib/RingTheory/Etale/StandardEtale.lean | 2 +- Mathlib/RingTheory/Extension/Basic.lean | 2 +- .../RingTheory/Extension/Cotangent/Basic.lean | 2 +- Mathlib/RingTheory/Extension/Generators.lean | 2 +- Mathlib/RingTheory/FinitePresentation.lean | 12 ++-- Mathlib/RingTheory/FiniteType.lean | 16 +++--- Mathlib/RingTheory/Finiteness/Basic.lean | 8 +-- .../Finiteness/FiniteTypeLocal.lean | 2 +- Mathlib/RingTheory/Finiteness/Finsupp.lean | 8 +-- Mathlib/RingTheory/Finiteness/Ideal.lean | 8 +-- .../Finiteness/ModuleFinitePresentation.lean | 2 +- Mathlib/RingTheory/Flat/Basic.lean | 6 +- .../RingTheory/Flat/EquationalCriterion.lean | 2 +- .../RingTheory/Flat/FaithfullyFlat/Basic.lean | 6 +- Mathlib/RingTheory/FormalGroup/Basic.lean | 4 +- Mathlib/RingTheory/FreeCommRing.lean | 2 +- .../HomogeneousLocalization.lean | 2 +- .../RingTheory/HahnSeries/Multiplication.lean | 4 +- Mathlib/RingTheory/Henselian.lean | 2 +- .../Ideal/AssociatedPrime/Basic.lean | 2 +- Mathlib/RingTheory/Ideal/GoingUp.lean | 4 +- Mathlib/RingTheory/Ideal/Maps.lean | 4 +- Mathlib/RingTheory/Ideal/Norm/AbsNorm.lean | 4 +- Mathlib/RingTheory/Ideal/Operations.lean | 2 +- Mathlib/RingTheory/Ideal/Prod.lean | 2 +- Mathlib/RingTheory/Ideal/Quotient/Basic.lean | 4 +- .../RingTheory/Ideal/Quotient/Nilpotent.lean | 2 +- .../RingTheory/Ideal/Quotient/Operations.lean | 2 +- .../IntegralClosure/Algebra/Basic.lean | 4 +- .../IntegralClosure/Algebra/Ideal.lean | 2 +- .../IntegralClosure/IntegralRestrict.lean | 56 +++++++++---------- .../IntegralClosure/IntegrallyClosed.lean | 2 +- .../IntegralClosure/IsIntegral/Basic.lean | 8 +-- .../IsIntegralClosure/Basic.lean | 4 +- Mathlib/RingTheory/IntegralDomain.lean | 2 +- Mathlib/RingTheory/Invariant/Basic.lean | 4 +- Mathlib/RingTheory/Invariant/Galois.lean | 2 +- Mathlib/RingTheory/IsTensorProduct.lean | 12 ++-- Mathlib/RingTheory/Jacobson/Ideal.lean | 4 +- Mathlib/RingTheory/Jacobson/Polynomial.lean | 2 +- Mathlib/RingTheory/Jacobson/Ring.lean | 4 +- Mathlib/RingTheory/Kaehler/Basic.lean | 2 +- Mathlib/RingTheory/Kaehler/JacobiZariski.lean | 6 +- Mathlib/RingTheory/KrullDimension/Basic.lean | 2 +- Mathlib/RingTheory/LaurentSeries.lean | 2 +- Mathlib/RingTheory/LinearDisjoint.lean | 24 ++++---- Mathlib/RingTheory/LittleWedderburn.lean | 8 +-- Mathlib/RingTheory/LocalProperties/Basic.lean | 16 +++--- .../RingTheory/LocalProperties/Exactness.lean | 8 +-- Mathlib/RingTheory/LocalRing/Module.lean | 8 +-- .../LocalRing/ResidueField/Instances.lean | 8 +-- .../LocalRing/ResidueField/Polynomial.lean | 2 +- Mathlib/RingTheory/LocalRing/Subring.lean | 2 +- .../RingTheory/Localization/Away/Basic.lean | 2 +- .../RingTheory/Localization/Away/Lemmas.lean | 2 +- .../RingTheory/Localization/BaseChange.lean | 12 ++-- Mathlib/RingTheory/Localization/Basic.lean | 2 +- Mathlib/RingTheory/Localization/Defs.lean | 4 +- .../RingTheory/Localization/FractionRing.lean | 4 +- Mathlib/RingTheory/Localization/Ideal.lean | 2 +- Mathlib/RingTheory/Localization/Integer.lean | 2 +- Mathlib/RingTheory/Localization/Integral.lean | 16 +++--- .../LocalizationLocalization.lean | 4 +- .../RingTheory/Localization/NormTrace.lean | 8 +-- Mathlib/RingTheory/Morita/Matrix.lean | 4 +- Mathlib/RingTheory/MvPowerSeries/Expand.lean | 2 +- .../MvPowerSeries/Substitution.lean | 32 +++++------ Mathlib/RingTheory/Noetherian/Orzech.lean | 2 +- .../RingTheory/NonUnitalSubring/Basic.lean | 2 +- .../NonUnitalSubsemiring/Basic.lean | 2 +- Mathlib/RingTheory/Norm/Basic.lean | 22 ++++---- Mathlib/RingTheory/Norm/Defs.lean | 2 +- Mathlib/RingTheory/Norm/Transitivity.lean | 2 +- Mathlib/RingTheory/NormTrace.lean | 2 +- .../RingTheory/OrderOfVanishing/Basic.lean | 2 +- Mathlib/RingTheory/OreLocalization/Ring.lean | 4 +- Mathlib/RingTheory/OrzechProperty.lean | 8 +-- Mathlib/RingTheory/Perfection.lean | 4 +- Mathlib/RingTheory/PiTensorProduct.lean | 4 +- Mathlib/RingTheory/Polynomial/Basic.lean | 2 +- .../Polynomial/Cyclotomic/Basic.lean | 2 +- .../Polynomial/Cyclotomic/Eval.lean | 4 +- .../Polynomial/Cyclotomic/Expand.lean | 8 +-- .../Polynomial/Cyclotomic/Roots.lean | 10 ++-- Mathlib/RingTheory/Polynomial/Dickson.lean | 2 +- .../Polynomial/Eisenstein/IsIntegral.lean | 2 +- .../RingTheory/Polynomial/RationalRoot.lean | 2 +- .../Polynomial/Resultant/Basic.lean | 10 ++-- Mathlib/RingTheory/Polynomial/ScaleRoots.lean | 2 +- .../Polynomial/SeparableDegree.lean | 2 +- .../Polynomial/UniqueFactorization.lean | 2 +- .../UniversalFactorizationRing.lean | 28 +++++----- .../RingTheory/PowerSeries/Substitution.lean | 8 +-- Mathlib/RingTheory/PrincipalIdealDomain.lean | 2 +- Mathlib/RingTheory/RingHom/Finite.lean | 12 ++-- Mathlib/RingTheory/RingHom/Integral.lean | 6 +- Mathlib/RingTheory/RingHom/Locally.lean | 26 ++++----- Mathlib/RingTheory/RingHom/Surjective.lean | 2 +- Mathlib/RingTheory/RingHom/Unramified.lean | 2 +- Mathlib/RingTheory/RingHomProperties.lean | 4 +- Mathlib/RingTheory/RootsOfUnity/Minpoly.lean | 4 +- .../RootsOfUnity/PrimitiveRoots.lean | 2 +- Mathlib/RingTheory/SimpleModule/Basic.lean | 10 ++-- Mathlib/RingTheory/Smooth/Basic.lean | 16 +++--- Mathlib/RingTheory/Smooth/Kaehler.lean | 8 +-- .../Smooth/StandardSmoothCotangent.lean | 2 +- .../RingTheory/Spectrum/Prime/FreeLocus.lean | 10 ++-- .../RingTheory/Spectrum/Prime/Topology.lean | 4 +- Mathlib/RingTheory/SurjectiveOnStalks.lean | 2 +- Mathlib/RingTheory/TensorProduct/Finite.lean | 2 +- .../TensorProduct/IsBaseChangePi.lean | 6 +- Mathlib/RingTheory/TensorProduct/Maps.lean | 4 +- .../RingTheory/TensorProduct/Nontrivial.lean | 4 +- Mathlib/RingTheory/Trace/Basic.lean | 26 ++++----- Mathlib/RingTheory/Trace/Defs.lean | 6 +- Mathlib/RingTheory/Trace/Quotient.lean | 16 +++--- .../UniqueFactorizationDomain/Basic.lean | 4 +- .../UniqueFactorizationDomain/ClassGroup.lean | 2 +- .../UniqueFactorizationDomain/FactorSet.lean | 2 +- .../UniqueFactorizationDomain/GCDMonoid.lean | 2 +- .../Multiplicative.lean | 16 +++--- .../Multiplicity.lean | 2 +- .../NormalizedFactors.lean | 2 +- Mathlib/RingTheory/Unramified/Basic.lean | 18 +++--- Mathlib/RingTheory/Unramified/Field.lean | 4 +- Mathlib/RingTheory/Unramified/LocalRing.lean | 2 +- .../RingTheory/Valuation/ValuationRing.lean | 2 +- Mathlib/RingTheory/WittVector/Compare.lean | 2 +- Mathlib/RingTheory/WittVector/Frobenius.lean | 2 +- Mathlib/RingTheory/WittVector/InitTail.lean | 2 +- Mathlib/RingTheory/WittVector/Isocrystal.lean | 2 +- Mathlib/RingTheory/ZariskisMainTheorem.lean | 16 +++--- Mathlib/SetTheory/Cardinal/Arithmetic.lean | 4 +- Mathlib/SetTheory/Cardinal/Basic.lean | 4 +- .../Cardinal/Cofinality/Ordinal.lean | 4 +- Mathlib/SetTheory/Cardinal/Finite.lean | 14 ++--- Mathlib/SetTheory/Cardinal/NatCard.lean | 26 ++++----- Mathlib/SetTheory/Cardinal/Order.lean | 2 +- Mathlib/SetTheory/Ordinal/Family.lean | 2 +- .../Ordinal/FundamentalSequence.lean | 2 +- Mathlib/SetTheory/Ordinal/Notation.lean | 34 +++++------ Mathlib/SetTheory/Ordinal/Rank.lean | 2 +- Mathlib/Tactic/Lift.lean | 2 +- Mathlib/Tactic/NormNum/LegendreSymbol.lean | 2 +- Mathlib/Topology/Algebra/ConstMulAction.lean | 2 +- .../Topology/Algebra/ContinuousAffineMap.lean | 4 +- Mathlib/Topology/Algebra/FilterBasis.lean | 6 +- .../Topology/Algebra/Group/GroupTopology.lean | 10 ++-- .../Topology/Algebra/InfiniteSum/Defs.lean | 2 +- .../Topology/Algebra/InfiniteSum/Group.lean | 6 +- .../Algebra/InfiniteSum/SummationFilter.lean | 2 +- .../Algebra/IsUniformGroup/Basic.lean | 6 +- .../IsUniformGroup/DiscreteSubgroup.lean | 2 +- .../Algebra/Module/FiniteDimension.lean | 10 ++-- .../Algebra/Module/LocallyConvex.lean | 8 +-- .../Algebra/Module/ModuleTopology.lean | 12 ++-- .../Algebra/Module/Multilinear/Topology.lean | 10 ++-- .../Module/Spaces/UniformConvergenceCLM.lean | 42 +++++++------- .../Algebra/Module/TopDualPairing.lean | 4 +- .../Algebra/Module/UniformConvergence.lean | 2 +- Mathlib/Topology/Algebra/Monoid.lean | 8 +-- .../Algebra/Nonarchimedean/AdicTopology.lean | 6 +- .../Algebra/Nonarchimedean/Bases.lean | 8 +-- .../RestrictedProduct/TopologicalSpace.lean | 6 +- Mathlib/Topology/Algebra/Semigroup.lean | 6 +- Mathlib/Topology/Algebra/UniformField.lean | 6 +- .../Topology/Algebra/UniformFilterBasis.lean | 4 +- .../ValuativeRel/ValuativeTopology.lean | 4 +- .../Topology/Algebra/Valued/NormedValued.lean | 4 +- .../Algebra/Valued/ValuationTopology.lean | 2 +- Mathlib/Topology/Baire/Lemmas.lean | 4 +- Mathlib/Topology/Bases.lean | 10 ++-- .../Topology/CWComplex/Classical/Basic.lean | 2 +- Mathlib/Topology/Category/CompHaus/Basic.lean | 4 +- .../Category/Profinite/CofilteredLimit.lean | 6 +- Mathlib/Topology/Category/Stonean/Basic.lean | 6 +- .../Category/TopCat/Limits/Konig.lean | 2 +- .../Category/TopCat/Limits/Products.lean | 4 +- Mathlib/Topology/CompactOpen.lean | 4 +- .../Topology/Compactification/StoneCech.lean | 4 +- Mathlib/Topology/Compactness/Compact.lean | 6 +- Mathlib/Topology/Compactness/Lindelof.lean | 2 +- Mathlib/Topology/Connected/Basic.lean | 2 +- .../Connected/LocallyPathConnected.lean | 2 +- Mathlib/Topology/Connected/PathConnected.lean | 2 +- Mathlib/Topology/Constructions.lean | 4 +- Mathlib/Topology/ContinuousMap/Algebra.lean | 4 +- .../ContinuousMap/Bounded/ArzelaAscoli.lean | 2 +- Mathlib/Topology/Covering/Quotient.lean | 6 +- Mathlib/Topology/DenseEmbedding.lean | 2 +- Mathlib/Topology/DiscreteSubset.lean | 2 +- Mathlib/Topology/ExtendFrom.lean | 2 +- Mathlib/Topology/ExtremallyDisconnected.lean | 2 +- Mathlib/Topology/FiberBundle/Basic.lean | 12 ++-- Mathlib/Topology/GDelta/Basic.lean | 2 +- .../Homotopy/LocallyContractible.lean | 4 +- .../Homotopy/TopCat/ZerothHomotopy.lean | 2 +- Mathlib/Topology/Instances/Complex.lean | 6 +- Mathlib/Topology/IsLocalHomeomorph.lean | 2 +- Mathlib/Topology/LocallyConstant/Basic.lean | 8 +-- Mathlib/Topology/Maps/Basic.lean | 2 +- Mathlib/Topology/MetricSpace/Contracting.lean | 2 +- .../MetricSpace/HausdorffDimension.lean | 2 +- Mathlib/Topology/MetricSpace/HolderNorm.lean | 4 +- Mathlib/Topology/MetricSpace/Kuratowski.lean | 2 +- Mathlib/Topology/MetricSpace/Perfect.lean | 2 +- Mathlib/Topology/MetricSpace/PiNat.lean | 4 +- Mathlib/Topology/MetricSpace/Polish.lean | 18 +++--- .../Topology/MetricSpace/Pseudo/Basic.lean | 4 +- Mathlib/Topology/MetricSpace/Pseudo/Pi.lean | 2 +- .../Metrizable/CompletelyMetrizable.lean | 18 +++--- Mathlib/Topology/Metrizable/Uniformity.lean | 4 +- Mathlib/Topology/Metrizable/Urysohn.lean | 6 +- Mathlib/Topology/NhdsWithin.lean | 2 +- .../OpenPartialHomeomorph/Constructions.lean | 8 +-- Mathlib/Topology/Order.lean | 8 +-- Mathlib/Topology/Order/Compact.lean | 4 +- Mathlib/Topology/Order/IntermediateValue.lean | 2 +- Mathlib/Topology/Order/IsLUB.lean | 2 +- Mathlib/Topology/Order/LawsonTopology.lean | 4 +- Mathlib/Topology/Order/LeftRightLim.lean | 12 ++-- Mathlib/Topology/Order/LeftRightNhds.lean | 2 +- .../Topology/Order/LowerUpperTopology.lean | 2 +- Mathlib/Topology/Order/ScottTopology.lean | 4 +- .../Topology/Order/UpperLowerSetTopology.lean | 4 +- Mathlib/Topology/PartitionOfUnity.lean | 2 +- .../Separation/CompletelyRegular.lean | 2 +- Mathlib/Topology/Separation/Connected.lean | 2 +- Mathlib/Topology/Separation/Profinite.lean | 4 +- Mathlib/Topology/Sequences.lean | 4 +- .../SheafCondition/PairwiseIntersections.lean | 2 +- .../Sheaves/SheafCondition/Sites.lean | 2 +- Mathlib/Topology/Sheaves/Stalks.lean | 2 +- Mathlib/Topology/ShrinkingLemma.lean | 6 +- Mathlib/Topology/UniformSpace/Cauchy.lean | 8 +-- .../LocallyUniformConvergence.lean | 2 +- .../Topology/UniformSpace/OfCompactT2.lean | 2 +- .../UniformSpace/Ultra/Constructions.lean | 8 +-- .../UniformConvergenceTopology.lean | 2 +- Mathlib/Topology/VectorBundle/Basic.lean | 4 +- Mathlib/Topology/VectorBundle/Riemannian.lean | 2 +- 964 files changed, 2626 insertions(+), 2626 deletions(-) diff --git a/Archive/Imo/Imo2008Q3.lean b/Archive/Imo/Imo2008Q3.lean index fcb23b005b7df6..3542bbdbf4bada 100644 --- a/Archive/Imo/Imo2008Q3.lean +++ b/Archive/Imo/Imo2008Q3.lean @@ -34,7 +34,7 @@ namespace Imo2008Q3 theorem p_lemma (p : ℕ) (hpp : Nat.Prime p) (hp_mod_4_eq_1 : p ≡ 1 [MOD 4]) (hp_gt_20 : p > 20) : ∃ n : ℕ, p ∣ n ^ 2 + 1 ∧ (p : ℝ) > 2 * n + sqrt (2 * n) := by - haveI := Fact.mk hpp + have := Fact.mk hpp have hp_mod_4_ne_3 : p % 4 ≠ 3 := by linarith [show p % 4 = 1 from hp_mod_4_eq_1] obtain ⟨y, hy⟩ := ZMod.exists_sq_eq_neg_one_iff.mpr hp_mod_4_ne_3 let m := ZMod.valMinAbs y diff --git a/Archive/Imo/Imo2019Q2.lean b/Archive/Imo/Imo2019Q2.lean index 9a8aafe704dd53..edb820b39851ee 100644 --- a/Archive/Imo/Imo2019Q2.lean +++ b/Archive/Imo/Imo2019Q2.lean @@ -275,7 +275,7 @@ theorem A₁_ne_B : cfg.A₁ ≠ cfg.B := by rw [AffineSubspace.eq_iff_direction_eq_of_mem (left_mem_affineSpan_pair _ _ _) hwbtw.mem_affineSpan] exact cfg.PQ_parallel_AB.direction_eq - haveI := someOrientation V + have := someOrientation V have haQ : (2 : ℤ) • ∡ cfg.C cfg.B cfg.Q = (2 : ℤ) • ∡ cfg.C cfg.B cfg.A := by rw [Collinear.two_zsmul_oangle_eq_right _ cfg.A_ne_B cfg.Q_ne_B] rw [Set.pair_comm, Set.insert_comm] @@ -389,7 +389,7 @@ end Oriented theorem not_collinear_QPA₂ : ¬Collinear ℝ ({cfg.Q, cfg.P, cfg.A₂} : Set Pt) := by - haveI := someOrientation V + have := someOrientation V rw [collinear_iff_of_two_zsmul_oangle_eq cfg.two_zsmul_oangle_QPA₂_eq_two_zsmul_oangle_BAA₂, ← affineIndependent_iff_not_collinear_set] have h : Cospherical ({cfg.B, cfg.A, cfg.A₂} : Set Pt) := by @@ -515,13 +515,13 @@ end Oriented theorem not_collinear_CA₂A₁ : ¬Collinear ℝ ({cfg.C, cfg.A₂, cfg.A₁} : Set Pt) := by - haveI := someOrientation V + have := someOrientation V rw [collinear_iff_of_two_zsmul_oangle_eq cfg.two_zsmul_oangle_CA₂A₁_eq_two_zsmul_oangle_CBA, Set.pair_comm, Set.insert_comm, Set.pair_comm] exact cfg.not_collinear_ABC theorem cospherical_A₁Q₁CA₂ : Cospherical ({cfg.A₁, cfg.Q₁, cfg.C, cfg.A₂} : Set Pt) := by - haveI := someOrientation V + have := someOrientation V rw [Set.insert_comm cfg.Q₁, Set.insert_comm cfg.A₁, Set.pair_comm, Set.insert_comm cfg.A₁, Set.pair_comm] exact cospherical_of_two_zsmul_oangle_eq_of_not_collinear diff --git a/Archive/Wiedijk100Theorems/BallotProblem.lean b/Archive/Wiedijk100Theorems/BallotProblem.lean index b7fb68ef7f0ef7..75d1aba8ad8c0f 100644 --- a/Archive/Wiedijk100Theorems/BallotProblem.lean +++ b/Archive/Wiedijk100Theorems/BallotProblem.lean @@ -316,9 +316,9 @@ theorem ballot_problem' : rw [div_self] exact Nat.cast_add_one_ne_zero p · intro q p qp h₁ h₂ - haveI := isProbabilityMeasure_uniformOn + have := isProbabilityMeasure_uniformOn (countedSequence_finite p (q + 1)) (countedSequence_nonempty _ _) - haveI := isProbabilityMeasure_uniformOn + have := isProbabilityMeasure_uniformOn (countedSequence_finite (p + 1) q) (countedSequence_nonempty _ _) have h₃ : 0 < p + 1 + (q + 1) := Nat.add_pos_left (Nat.succ_pos _) _ rw [← uniformOn_add_compl_eq {l : List ℤ | l.headI = 1} _ (countedSequence_finite _ _), @@ -345,7 +345,7 @@ theorem ballot_problem' : theorem ballot_problem : ∀ q p, q < p → uniformOn (countedSequence p q) staysPositive = (p - q) / (p + q) := by intro q p qp - haveI := + have := isProbabilityMeasure_uniformOn (countedSequence_finite p q) (countedSequence_nonempty _ _) have : (uniformOn (countedSequence p q) staysPositive).toReal = diff --git a/Archive/Wiedijk100Theorems/CubingACube.lean b/Archive/Wiedijk100Theorems/CubingACube.lean index 647fcef5884878..a887eacf71218f 100644 --- a/Archive/Wiedijk100Theorems/CubingACube.lean +++ b/Archive/Wiedijk100Theorems/CubingACube.lean @@ -378,7 +378,7 @@ variable (h v) direction will intersect one of the neighbouring cubes on the same boundary as `mi`. -/ theorem mi_not_onBoundary (j : Fin n) : ¬OnBoundary (mi_mem_bcubes : mi h v ∈ _) j := by let i := mi h v; have hi : i ∈ bcubes cs c := mi_mem_bcubes - haveI := h.nontrivial_fin + have := h.nontrivial_fin rcases exists_ne j with ⟨j', hj'⟩ intro hj rcases smallest_onBoundary hj with ⟨x, ⟨hx, h2x⟩, h3x⟩ diff --git a/Archive/Wiedijk100Theorems/FriendshipGraphs.lean b/Archive/Wiedijk100Theorems/FriendshipGraphs.lean index 7e473acaac194f..f89670f53633d2 100644 --- a/Archive/Wiedijk100Theorems/FriendshipGraphs.lean +++ b/Archive/Wiedijk100Theorems/FriendshipGraphs.lean @@ -249,7 +249,7 @@ theorem false_of_three_le_degree (hd : G.IsRegularOfDegree d) (h : 3 ≤ d) : Fa have p_dvd_d_pred := (ZMod.natCast_eq_zero_iff _ _).mpr (d - 1).minFac_dvd have dpos : 1 ≤ d := by lia have d_cast : ↑(d - 1) = (d : ℤ) - 1 := by norm_cast - haveI : Fact p.Prime := ⟨Nat.minFac_prime (by lia)⟩ + have : Fact p.Prime := ⟨Nat.minFac_prime (by lia)⟩ have hp2 : 2 ≤ p := (Fact.out (p := p.Prime)).two_le have dmod : (d : ZMod p) = 1 := by rw [← Nat.succ_pred_eq_of_pos dpos, Nat.succ_eq_add_one, Nat.pred_eq_sub_one] diff --git a/Counterexamples/CliffordAlgebraNotInjective.lean b/Counterexamples/CliffordAlgebraNotInjective.lean index f47f319b0e9f62..f8395af42d4dd9 100644 --- a/Counterexamples/CliffordAlgebraNotInjective.lean +++ b/Counterexamples/CliffordAlgebraNotInjective.lean @@ -154,7 +154,7 @@ theorem sq_map_add_char_two {ι R : Type*} [CommRing R] [CharP R 2] (i : ι) (a theorem sq_map_sub_char_two {ι R : Type*} [CommRing R] [CharP R 2] (i : ι) (a b : ι → R) : sq i (a - b) = sq i a - sq i b := by - haveI : Nonempty ι := ⟨i⟩ + have : Nonempty ι := ⟨i⟩ rw [CharTwo.sub_eq_add, CharTwo.sub_eq_add, sq_map_add_char_two] /-- The quadratic form (metric) is just Euclidean -/ diff --git a/Counterexamples/Phillips.lean b/Counterexamples/Phillips.lean index 384d1931679214..437f642880574e 100644 --- a/Counterexamples/Phillips.lean +++ b/Counterexamples/Phillips.lean @@ -247,7 +247,7 @@ theorem exists_discrete_support_nonpos (f : BoundedAdditiveMeasure α) : -- convenient to formalize the inductive construction. let A : Set (Set α) := {t | t.Countable} let empty : A := ⟨∅, countable_empty⟩ - haveI : Nonempty A := ⟨empty⟩ + have : Nonempty A := ⟨empty⟩ -- given a countable set `s`, one can find a set `t` in its complement with measure close to -- maximal. have : ∀ s : A, ∃ t : A, ∀ u : A, f (↑u \ ↑s) ≤ 2 * f (↑t \ ↑s) := by diff --git a/Counterexamples/SorgenfreyLine.lean b/Counterexamples/SorgenfreyLine.lean index 3aa441118c278a..0a795f97f8e120 100644 --- a/Counterexamples/SorgenfreyLine.lean +++ b/Counterexamples/SorgenfreyLine.lean @@ -67,7 +67,7 @@ theorem isOpen_Ici (a : ℝₗ) : IsOpen (Ici a) := theorem nhds_basis_Ico (a : ℝₗ) : (𝓝 a).HasBasis (a < ·) (Ico a ·) := by rw [TopologicalSpace.nhds_generateFrom] - haveI : Nonempty { x // x ≤ a } := Set.nonempty_Iic_subtype + have : Nonempty { x // x ≤ a } := Set.nonempty_Iic_subtype have : (⨅ x : { i // i ≤ a }, 𝓟 (Ici ↑x)) = 𝓟 (Ici a) := by refine (IsLeast.isGLB ?_).iInf_eq exact ⟨⟨⟨a, le_rfl⟩, rfl⟩, forall_mem_range.2 fun b => principal_mono.2 <| Ici_subset_Ici.2 b.2⟩ @@ -312,7 +312,7 @@ theorem not_separatedNhds_rat_irrational_antidiag : /-- Topology on the Sorgenfrey line is not metrizable. -/ theorem not_metrizableSpace : ¬MetrizableSpace ℝₗ := by intro - letI := metrizableSpaceMetric ℝₗ + let := metrizableSpaceMetric ℝₗ exact not_normalSpace_prod inferInstance /-- Topology on the Sorgenfrey line is not second countable. -/ diff --git a/Counterexamples/ZeroDivisorsInAddMonoidAlgebras.lean b/Counterexamples/ZeroDivisorsInAddMonoidAlgebras.lean index 08f0094e39a030..f89ed38e560348 100644 --- a/Counterexamples/ZeroDivisorsInAddMonoidAlgebras.lean +++ b/Counterexamples/ZeroDivisorsInAddMonoidAlgebras.lean @@ -241,8 +241,8 @@ example : ¬UniqueProds ℕ := by /-- Some Types that do not have `UniqueSums`. -/ example (n : ℕ) (n2 : 2 ≤ n) : ¬UniqueSums (ZMod n) := by - haveI : Fintype (ZMod n) := @ZMod.fintype n ⟨(zero_lt_two.trans_le n2).ne'⟩ - haveI : Nontrivial (ZMod n) := CharP.nontrivial_of_char_ne_one (one_lt_two.trans_le n2).ne' + have : Fintype (ZMod n) := @ZMod.fintype n ⟨(zero_lt_two.trans_le n2).ne'⟩ + have : Nontrivial (ZMod n) := CharP.nontrivial_of_char_ne_one (one_lt_two.trans_le n2).ne' rintro ⟨h⟩ refine not_not.mpr (h Finset.univ_nonempty Finset.univ_nonempty) ?_ suffices ∀ x y : ZMod n, ∃ x' y' : ZMod n, x' + y' = x + y ∧ (x' = x → ¬y' = y) by diff --git a/Mathlib/Algebra/Algebra/Operations.lean b/Mathlib/Algebra/Algebra/Operations.lean index d31f10ca1de085..ac958fba49be6a 100644 --- a/Mathlib/Algebra/Algebra/Operations.lean +++ b/Mathlib/Algebra/Algebra/Operations.lean @@ -806,7 +806,7 @@ instance : IdemCommSemiring (Submodule R A) := theorem prod_span {ι : Type*} (s : Finset ι) (M : ι → Set A) : (∏ i ∈ s, Submodule.span R (M i)) = Submodule.span R (∏ i ∈ s, M i) := by - letI := Classical.decEq ι + let := Classical.decEq ι refine Finset.induction_on s ?_ ?_ · simp [one_eq_span, Set.singleton_one] · intro _ _ H ih diff --git a/Mathlib/Algebra/Algebra/Subalgebra/IsSimpleOrder.lean b/Mathlib/Algebra/Algebra/Subalgebra/IsSimpleOrder.lean index 176d9f6b6125ee..29926876684415 100644 --- a/Mathlib/Algebra/Algebra/Subalgebra/IsSimpleOrder.lean +++ b/Mathlib/Algebra/Algebra/Subalgebra/IsSimpleOrder.lean @@ -24,8 +24,8 @@ theorem Subalgebra.isSimpleOrder_of_finrank_prime (F A) [Field F] [Ring A] [IsDo ⟨⟨⊥, ⊤, fun he => Nat.not_prime_one ((Subalgebra.bot_eq_top_iff_finrank_eq_one.1 he).subst hp)⟩⟩ eq_bot_or_eq_top := fun K => by - haveI : FiniteDimensional _ _ := .of_finrank_pos hp.pos - letI := divisionRingOfFiniteDimensional F K + have : FiniteDimensional _ _ := .of_finrank_pos hp.pos + let := divisionRingOfFiniteDimensional F K refine (hp.eq_one_or_self_of_dvd _ ⟨_, (finrank_mul_finrank F K A).symm⟩).imp ?_ fun h => ?_ · exact fun h' => Subalgebra.eq_bot_of_finrank_one h' · exact diff --git a/Mathlib/Algebra/Algebra/Subalgebra/Rank.lean b/Mathlib/Algebra/Algebra/Subalgebra/Rank.lean index ae303f1a4a8955..3c630fa255c73c 100644 --- a/Mathlib/Algebra/Algebra/Subalgebra/Rank.lean +++ b/Mathlib/Algebra/Algebra/Subalgebra/Rank.lean @@ -35,11 +35,11 @@ variable [Module.Free R A] [Module.Free A (Algebra.adjoin A (B : Set S))] theorem rank_sup_eq_rank_left_mul_rank_of_free : Module.rank R ↥(A ⊔ B) = Module.rank R A * Module.rank A (Algebra.adjoin A (B : Set S)) := by rcases subsingleton_or_nontrivial R with _ | _ - · haveI := Module.subsingleton R S; simp + · have := Module.subsingleton R S; simp nontriviality S using rank_subsingleton' - letI : Algebra A (Algebra.adjoin A (B : Set S)) := Subalgebra.algebra _ - letI : SMul A (Algebra.adjoin A (B : Set S)) := Algebra.toSMul - haveI : IsScalarTower R A (Algebra.adjoin A (B : Set S)) := + let : Algebra A (Algebra.adjoin A (B : Set S)) := Subalgebra.algebra _ + let : SMul A (Algebra.adjoin A (B : Set S)) := Algebra.toSMul + have : IsScalarTower R A (Algebra.adjoin A (B : Set S)) := IsScalarTower.of_algebraMap_eq (congrFun rfl) rw [rank_mul_rank R A (Algebra.adjoin A (B : Set S))] change _ = Module.rank R ((Algebra.adjoin A (B : Set S)).restrictScalars R) diff --git a/Mathlib/Algebra/AlgebraicCard.lean b/Mathlib/Algebra/AlgebraicCard.lean index af9f9351e40e20..d5ef0674d10f08 100644 --- a/Mathlib/Algebra/AlgebraicCard.lean +++ b/Mathlib/Algebra/AlgebraicCard.lean @@ -31,7 +31,7 @@ namespace Algebraic theorem infinite_of_charZero (R A : Type*) [CommRing R] [Ring A] [Algebra R A] [CharZero A] : { x : A | IsAlgebraic R x }.Infinite := by - letI := MulActionWithZero.nontrivial R A + let := MulActionWithZero.nontrivial R A exact infinite_of_injective_forall_mem Nat.cast_injective isAlgebraic_nat theorem aleph0_le_cardinalMk_of_charZero (R A : Type*) [CommRing R] [Ring A] diff --git a/Mathlib/Algebra/BigOperators/Associated.lean b/Mathlib/Algebra/BigOperators/Associated.lean index 897989824e09f6..a5fb4e8c160e0b 100644 --- a/Mathlib/Algebra/BigOperators/Associated.lean +++ b/Mathlib/Algebra/BigOperators/Associated.lean @@ -178,7 +178,7 @@ theorem prod_eq_one_iff {p : Multiset (Associates M)} : (by simp +contextual [mul_eq_one, or_imp, forall_and]) theorem prod_le_prod {p q : Multiset (Associates M)} (h : p ≤ q) : p.prod ≤ q.prod := by - haveI := Classical.decEq (Associates M) + have := Classical.decEq (Associates M) suffices p.prod ≤ (p + (q - p)).prod by rwa [add_tsub_cancel_of_le h] at this suffices p.prod * 1 ≤ p.prod * (q - p).prod by simpa exact mul_mono (le_refl p.prod) one_le diff --git a/Mathlib/Algebra/BigOperators/Finprod.lean b/Mathlib/Algebra/BigOperators/Finprod.lean index c930a7b8c6efdf..63ce51e2fa6fe3 100644 --- a/Mathlib/Algebra/BigOperators/Finprod.lean +++ b/Mathlib/Algebra/BigOperators/Finprod.lean @@ -226,9 +226,9 @@ theorem finprod_true (f : True → M) : ∏ᶠ i, f i = f trivial := theorem finprod_eq_dif {p : Prop} [Decidable p] (f : p → M) : ∏ᶠ i, f i = if h : p then f h else 1 := by split_ifs with h - · haveI : Unique p := ⟨⟨h⟩, fun _ => rfl⟩ + · have : Unique p := ⟨⟨h⟩, fun _ => rfl⟩ exact finprod_unique f - · haveI : IsEmpty p := ⟨h⟩ + · have : IsEmpty p := ⟨h⟩ exact finprod_of_isEmpty f @[to_additive] @@ -1065,7 +1065,7 @@ over `a ∈ ⋃ i ∈ I, t i` is equal to the product over `i ∈ I` of the prod over `a ∈ t i`. -/] theorem finprod_mem_biUnion {I : Set ι} {t : ι → Set α} (h : I.PairwiseDisjoint t) (hI : I.Finite) (ht : ∀ i ∈ I, (t i).Finite) : ∏ᶠ a ∈ ⋃ x ∈ I, t x, f a = ∏ᶠ i ∈ I, ∏ᶠ j ∈ t i, f j := by - haveI := hI.fintype + have := hI.fintype rw [biUnion_eq_iUnion, finprod_mem_iUnion, ← finprod_set_coe_eq_finprod_mem] exacts [fun x y hxy => h x.2 y.2 (Subtype.coe_injective.ne hxy), fun b => ht b b.2] diff --git a/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean b/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean index 2d6a839ae18056..dee886ca770a7d 100644 --- a/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean +++ b/Mathlib/Algebra/BigOperators/Group/Finset/Basic.lean @@ -393,7 +393,7 @@ lemma prod_congr_of_eq_on_inter {ι M : Type*} {s₁ s₂ : Finset ι} {f g : ι @[to_additive] theorem prod_eq_mul_of_mem {s : Finset ι} {f : ι → M} (a b : ι) (ha : a ∈ s) (hb : b ∈ s) (hn : a ≠ b) (h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 1) : ∏ x ∈ s, f x = f a * f b := by - haveI := Classical.decEq ι; let s' := ({a, b} : Finset ι) + have := Classical.decEq ι; let s' := ({a, b} : Finset ι) have hu : s' ⊆ s := by grind have hf : ∀ c ∈ s, c ∉ s' → f c = 1 := by grind rw [← Finset.prod_subset hu hf] @@ -403,7 +403,7 @@ theorem prod_eq_mul_of_mem {s : Finset ι} {f : ι → M} (a b : ι) (ha : a ∈ theorem prod_eq_mul {s : Finset ι} {f : ι → M} (a b : ι) (hn : a ≠ b) (h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 1) (ha : a ∉ s → f a = 1) (hb : b ∉ s → f b = 1) : ∏ x ∈ s, f x = f a * f b := by - haveI := Classical.decEq ι; by_cases h₁ : a ∈ s <;> by_cases h₂ : b ∈ s + have := Classical.decEq ι; by_cases h₁ : a ∈ s <;> by_cases h₂ : b ∈ s · exact prod_eq_mul_of_mem a b h₁ h₂ hn h₀ · rw [hb h₂, mul_one] apply prod_eq_single_of_mem a h₁ diff --git a/Mathlib/Algebra/Category/Grp/Images.lean b/Mathlib/Algebra/Category/Grp/Images.lean index af3773c9aa8ccf..3d103f20cbe859 100644 --- a/Mathlib/Algebra/Category/Grp/Images.lean +++ b/Mathlib/Algebra/Category/Grp/Images.lean @@ -60,14 +60,14 @@ noncomputable def image.lift (F' : MonoFactorisation f) : image f ⟶ F'.I := ofHom { toFun := (fun x => F'.e (Classical.indefiniteDescription _ x.2).1 : image f → F'.I) map_zero' := by - haveI := F'.m_mono + have := F'.m_mono apply injective_of_mono F'.m change (F'.e ≫ F'.m) _ = _ rw [F'.fac, map_zero] exact (Classical.indefiniteDescription (fun y => f y = 0) _).2 map_add' := by intro x y - haveI := F'.m_mono + have := F'.m_mono apply injective_of_mono F'.m rw [map_add] change (F'.e ≫ F'.m) _ = (F'.e ≫ F'.m) _ + (F'.e ≫ F'.m) _ diff --git a/Mathlib/Algebra/Category/ModuleCat/ChangeOfRings.lean b/Mathlib/Algebra/Category/ModuleCat/ChangeOfRings.lean index b162815dd0a236..bdafae24b18577 100644 --- a/Mathlib/Algebra/Category/ModuleCat/ChangeOfRings.lean +++ b/Mathlib/Algebra/Category/ModuleCat/ChangeOfRings.lean @@ -427,7 +427,7 @@ lemma hom_ext {M : ModuleCat R} {N : ModuleCat S} {α β : (extendScalars f).obj M ⟶ N} (h : ∀ (m : M), α ((1 : S) ⊗ₜ m) = β ((1 : S) ⊗ₜ m)) : α = β := by apply (restrictScalars f).map_injective - letI := f.toAlgebra + let := f.toAlgebra ext : 1 apply TensorProduct.ext' intro (s : S) m @@ -765,7 +765,7 @@ def homEquiv {X : ModuleCat R} {Y : ModuleCat S} : toFun := HomEquiv.toRestrictScalars.{u₁, u₂, v} f invFun := HomEquiv.fromExtendScalars.{u₁, u₂, v} f left_inv g := by - letI m1 : Module R S := Module.compHom S f; letI m2 : Module R Y := Module.compHom Y f + let m1 : Module R S := Module.compHom S f; let m2 : Module R Y := Module.compHom Y f apply hom_ext apply LinearMap.ext; intro z induction z using TensorProduct.induction_on with @@ -779,7 +779,7 @@ def homEquiv {X : ModuleCat R} {Y : ModuleCat S} : rfl | add _ _ ih1 ih2 => rw [map_add, map_add, ih1, ih2] right_inv g := by - letI m1 : Module R S := Module.compHom S f; letI m2 : Module R Y := Module.compHom Y f + let m1 : Module R S := Module.compHom S f; let m2 : Module R Y := Module.compHom Y f ext x rw [HomEquiv.toRestrictScalars_hom_apply] -- This needs to be `erw` because of some unfolding in `fromExtendScalars` @@ -801,7 +801,7 @@ def Unit.map {X : ModuleCat R} : X ⟶ (extendScalars f ⋙ restrictScalars f).o { toFun := fun x => (1 : S) ⊗ₜ[R,f] x map_add' := fun x x' => by dsimp; rw [TensorProduct.tmul_add] map_smul' := fun r x => by - letI m1 : Module R S := Module.compHom S f + let m1 : Module R S := Module.compHom S f dsimp; rw [← TensorProduct.smul_tmul, TensorProduct.smul_tmul'] } /-- @@ -860,9 +860,9 @@ def counit : restrictScalars.{max v u₂, u₁, u₂} f ⋙ extendScalars f ⟶ app _ := Counit.map.{u₁, u₂, v} f naturality Y Y' g := by -- Porting note: this is very annoying; fix instances in concrete categories - letI m1 : Module R S := Module.compHom S f - letI m2 : Module R Y := Module.compHom Y f - letI m2 : Module R Y' := Module.compHom Y' f + let m1 : Module R S := Module.compHom S f + let m2 : Module R Y := Module.compHom Y f + let m2 : Module R Y' := Module.compHom Y' f ext z induction z using TensorProduct.induction_on with | zero => rw [map_zero, map_zero] diff --git a/Mathlib/Algebra/Category/ModuleCat/Differentials/Basic.lean b/Mathlib/Algebra/Category/ModuleCat/Differentials/Basic.lean index 6457b8aeb1a7ae..af3967d4d00478 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Differentials/Basic.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Differentials/Basic.lean @@ -175,8 +175,8 @@ noncomputable def desc : CommRingCat.KaehlerDifferential f ⟶ M := set_option backward.isDefEq.respectTransparency false in @[simp] lemma desc_d (b : B) : D.desc (CommRingCat.KaehlerDifferential.d b) = D.d b := by - letI := f.hom.toAlgebra - letI := Module.compHom M f.hom + let := f.hom.toAlgebra + let := Module.compHom M f.hom apply D.liftKaehlerDifferential_comp_D end ModuleCat.Derivation diff --git a/Mathlib/Algebra/Category/ModuleCat/Free.lean b/Mathlib/Algebra/Category/ModuleCat/Free.lean index 7b4c01add2785e..e5317f64219849 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Free.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Free.lean @@ -172,7 +172,7 @@ theorem free_shortExact [Module.Free R S.X₁] [Module.Free R S.X₃] : theorem free_shortExact_rank_add [Module.Free R S.X₁] [Module.Free R S.X₃] [StrongRankCondition R] : Module.rank R S.X₂ = Module.rank R S.X₁ + Module.rank R S.X₃ := by - haveI := free_shortExact hS' + have := free_shortExact hS' rw [Module.Free.rank_eq_card_chooseBasisIndex, Module.Free.rank_eq_card_chooseBasisIndex R S.X₁, Module.Free.rank_eq_card_chooseBasisIndex R S.X₃, Cardinal.add_def, Cardinal.eq] exact ⟨Basis.indexEquiv (Module.Free.chooseBasis R S.X₂) (Basis.ofShortExact hS' diff --git a/Mathlib/Algebra/Category/ModuleCat/Kernels.lean b/Mathlib/Algebra/Category/ModuleCat/Kernels.lean index 9561c889cadc06..dae26944b28243 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Kernels.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Kernels.lean @@ -64,7 +64,7 @@ def cokernelIsColimit : IsColimit (cokernelCocone f) := (fun s => ofHom <| (LinearMap.range f.hom).liftQ (Cofork.π s).hom <| LinearMap.range_le_ker_iff.2 <| ModuleCat.hom_ext_iff.mp <| CokernelCofork.condition s) (fun s => hom_ext <| (LinearMap.range f.hom).liftQ_mkQ (Cofork.π s).hom _) fun s m h => by - haveI : Epi (ofHom f.hom.range.mkQ) := + have : Epi (ofHom f.hom.range.mkQ) := (epi_iff_range_eq_top _).mpr (Submodule.range_mkQ _) apply (cancel_epi (ofHom f.hom.range.mkQ)).1 exact h diff --git a/Mathlib/Algebra/Category/ModuleCat/Monoidal/Adjunction.lean b/Mathlib/Algebra/Category/ModuleCat/Monoidal/Adjunction.lean index 2f8ad3328e1090..61d9e40861ab29 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Monoidal/Adjunction.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Monoidal/Adjunction.lean @@ -111,7 +111,7 @@ noncomputable instance : (restrictScalars f).LaxMonoidal := @[simp] lemma restrictScalars_η (r : R) : ε (restrictScalars f) r = f r := by - letI := f.toAlgebra + let := f.toAlgebra dsimp [Adjunction.rightAdjointLaxMonoidal_ε] rw [extendRestrictScalarsAdj_homEquiv_apply, extendScalars_η] erw [AlgebraTensorModule.rid_tmul] diff --git a/Mathlib/Algebra/Category/ModuleCat/Stalk.lean b/Mathlib/Algebra/Category/ModuleCat/Stalk.lean index 96073610f7a15f..e1dc19ba163ba2 100644 --- a/Mathlib/Algebra/Category/ModuleCat/Stalk.lean +++ b/Mathlib/Algebra/Category/ModuleCat/Stalk.lean @@ -136,7 +136,7 @@ lemma IsColimit.ι_smul {cR : Cocone R} (hcR : IsColimit cR) {cM : Cocone M} letI := IsColimit.module R M H hcR hcM cM.ι.app i (r • m) = HSMul.hSMul (α := cR.pt) (β := cM.pt) (cR.ι.app i r) (cM.ι.app i m) := by - letI := filteredColimitsModule R M H + let := filteredColimitsModule R M H let α := IsColimit.coconePointUniqueUpToIso hcM (AddCommGrpCat.FilteredColimits.colimitCoconeIsColimit M) let β := IsColimit.coconePointUniqueUpToIso hcR diff --git a/Mathlib/Algebra/Category/Ring/Epi.lean b/Mathlib/Algebra/Category/Ring/Epi.lean index eb1928f837b191..fbd4bf461dadf5 100644 --- a/Mathlib/Algebra/Category/Ring/Epi.lean +++ b/Mathlib/Algebra/Category/Ring/Epi.lean @@ -34,7 +34,7 @@ lemma CommRingCat.epi_iff_epi {R S : Type u} [CommRing R] [CommRing S] [Algebra simp only [Algebra.algebraMap_eq_smul_one, smul_tmul]) exact RingHom.congr_fun (congrArg Hom.hom this) · refine fun H ↦ ⟨fun {T} f g e ↦ ?_⟩ - letI : Algebra R T := (ofHom (algebraMap R S) ≫ g).hom.toAlgebra + let : Algebra R T := (ofHom (algebraMap R S) ≫ g).hom.toAlgebra let f' : S →ₐ[R] T := ⟨f.hom, RingHom.congr_fun (congrArg Hom.hom e)⟩ let g' : S →ₐ[R] T := ⟨g.hom, fun _ ↦ rfl⟩ ext s diff --git a/Mathlib/Algebra/Category/Ring/FinitePresentation.lean b/Mathlib/Algebra/Category/Ring/FinitePresentation.lean index a6af210fb9b3b5..4094799bcb8e31 100644 --- a/Mathlib/Algebra/Category/Ring/FinitePresentation.lean +++ b/Mathlib/Algebra/Category/Ring/FinitePresentation.lean @@ -83,7 +83,7 @@ lemma RingHom.EssFiniteType.exists_eq_comp_ι_app_of_isColimit (hf : f.hom.Finit ∃ (i : J) (g' : S ⟶ F.obj i), f ≫ g' = α.app i ∧ g = g' ≫ c.ι.app i := by classical have hc' := isColimitOfPreserves (forget _) hc - letI := f.hom.toAlgebra + let := f.hom.toAlgebra obtain ⟨n, hn⟩ := hf let P := CommRingCat.of (MvPolynomial (Fin n) R) let iP : R ⟶ P := CommRingCat.ofHom MvPolynomial.C diff --git a/Mathlib/Algebra/Category/Ring/LinearAlgebra.lean b/Mathlib/Algebra/Category/Ring/LinearAlgebra.lean index d75dbaba623be5..6ac8b2885b8974 100644 --- a/Mathlib/Algebra/Category/Ring/LinearAlgebra.lean +++ b/Mathlib/Algebra/Category/Ring/LinearAlgebra.lean @@ -31,7 +31,7 @@ lemma nontrivial_of_isPushout_of_isField {A B C D : CommRingCat.{u}} (hA : IsField A) {f : A ⟶ B} {g : A ⟶ C} {inl : B ⟶ D} {inr : C ⟶ D} [Nontrivial B] [Nontrivial C] (h : IsPushout f g inl inr) : Nontrivial D := by - letI : Field A := hA.toField + let : Field A := hA.toField algebraize [f.hom, g.hom] let e : D ≅ .of (B ⊗[A] C) := IsColimit.coconePointUniqueUpToIso h.isColimit (CommRingCat.pushoutCoconeIsColimit A B C) diff --git a/Mathlib/Algebra/Central/Basic.lean b/Mathlib/Algebra/Central/Basic.lean index 3f810abca4111e..932b5ef110a970 100644 --- a/Mathlib/Algebra/Central/Basic.lean +++ b/Mathlib/Algebra/Central/Basic.lean @@ -47,7 +47,7 @@ lemma baseField_essentially_unique [Algebra k K] [Algebra K D] [Algebra k D] [IsScalarTower k K D] [IsCentral k D] : Function.Bijective (algebraMap k K) := by - haveI : IsCentral K D := + have : IsCentral K D := { out := fun x ↦ show x ∈ Subalgebra.center k D → _ by simp only [center_eq_bot, mem_bot, Set.mem_range, forall_exists_index] rintro x rfl diff --git a/Mathlib/Algebra/CharP/Algebra.lean b/Mathlib/Algebra/CharP/Algebra.lean index c3fdd42442d0d7..3141dd3a9d40d4 100644 --- a/Mathlib/Algebra/CharP/Algebra.lean +++ b/Mathlib/Algebra/CharP/Algebra.lean @@ -97,16 +97,16 @@ lemma expChar_of_injective_ringHom [NonAssocSemiring R] [NonAssocSemiring A] {f : R →+* A} (h : Function.Injective f) (q : ℕ) [hR : ExpChar R q] : ExpChar A q := by rcases hR with _ | hprime - · haveI := charZero_of_injective_ringHom h; exact .zero - haveI := charP_of_injective_ringHom h q; exact .prime hprime + · have := charZero_of_injective_ringHom h; exact .zero + have := charP_of_injective_ringHom h q; exact .prime hprime /-- If `R →+* A` is injective, and `A` is of exponential characteristic `p`, then `R` is also of exponential characteristic `p`. Similar to `RingHom.charZero`. -/ lemma RingHom.expChar [NonAssocSemiring R] [NonAssocSemiring A] (f : R →+* A) (H : Function.Injective f) (p : ℕ) [ExpChar A p] : ExpChar R p := by cases ‹ExpChar A p› with - | zero => haveI := f.charZero; exact .zero - | prime hp => haveI := f.charP H p; exact .prime hp + | zero => have := f.charZero; exact .zero + | prime hp => have := f.charP H p; exact .prime hp /-- If `R →+* A` is injective, then `R` is of exponential characteristic `p` if and only if `A` is also of exponential characteristic `p`. Similar to `RingHom.charZero_iff`. -/ diff --git a/Mathlib/Algebra/CharP/Defs.lean b/Mathlib/Algebra/CharP/Defs.lean index f875bbc401e213..4e0b15fedbe75f 100644 --- a/Mathlib/Algebra/CharP/Defs.lean +++ b/Mathlib/Algebra/CharP/Defs.lean @@ -156,7 +156,7 @@ namespace ringChar variable [NonAssocSemiring R] lemma spec : ∀ x : ℕ, (x : R) = 0 ↔ ringChar R ∣ x := by - letI : CharP R (ringChar R) := (Classical.choose_spec (CharP.existsUnique R)).1 + let : CharP R (ringChar R) := (Classical.choose_spec (CharP.existsUnique R)).1 exact CharP.cast_eq_zero_iff R (ringChar R) lemma eq (p : ℕ) [C : CharP R p] : ringChar R = p := @@ -388,7 +388,7 @@ noncomputable def ringExpChar : ℕ := max (ringChar R) 1 lemma ringExpChar.eq (q : ℕ) [h : ExpChar R q] : ringExpChar R = q := by rcases h with _ | h - · haveI := CharP.ofCharZero R + · have := CharP.ofCharZero R rw [ringExpChar, ringChar.eq R 0]; rfl rw [ringExpChar, ringChar.eq R q] exact Nat.max_eq_left h.one_lt.le diff --git a/Mathlib/Algebra/CharP/Invertible.lean b/Mathlib/Algebra/CharP/Invertible.lean index 7b36b94527fc62..2f2598a2400b9d 100644 --- a/Mathlib/Algebra/CharP/Invertible.lean +++ b/Mathlib/Algebra/CharP/Invertible.lean @@ -65,7 +65,7 @@ def invertibleOfCoprime {n : ℕ} (h : n.Coprime p) : theorem invOf_eq_of_coprime {n : ℕ} [Invertible (n : R)] (h : n.Coprime p) : ⅟(n : R) = n.gcdA p := by - letI : Invertible (n : R) := invertibleOfCoprime h + let : Invertible (n : R) := invertibleOfCoprime h convert! (rfl : ⅟(n : R) = _) theorem CharP.isUnit_natCast_iff {n : ℕ} (hp : p.Prime) : IsUnit (n : R) ↔ ¬p ∣ n where diff --git a/Mathlib/Algebra/CharP/Lemmas.lean b/Mathlib/Algebra/CharP/Lemmas.lean index c5f7ad678800e2..a824b4a0dc2a5d 100644 --- a/Mathlib/Algebra/CharP/Lemmas.lean +++ b/Mathlib/Algebra/CharP/Lemmas.lean @@ -285,7 +285,7 @@ variable (R) [NonAssocRing R] /-- The characteristic of a finite ring cannot be zero. -/ theorem char_ne_zero_of_finite (p : ℕ) [CharP R p] [Finite R] : p ≠ 0 := by rintro rfl - haveI : CharZero R := charP_to_charZero R + have : CharZero R := charP_to_charZero R exact absurd Nat.cast_injective (not_injective_infinite_finite ((↑) : ℕ → R)) theorem ringChar_ne_zero_of_finite [Finite R] : ringChar R ≠ 0 := diff --git a/Mathlib/Algebra/CharP/LocalRing.lean b/Mathlib/Algebra/CharP/LocalRing.lean index e741303f7b6b22..d9a382728f54a8 100644 --- a/Mathlib/Algebra/CharP/LocalRing.lean +++ b/Mathlib/Algebra/CharP/LocalRing.lean @@ -30,7 +30,7 @@ theorem charP_zero_or_prime_power (R : Type*) [CommRing R] [IsLocalRing R] (q : apply or_iff_not_imp_left.2 intro q_pos let K := IsLocalRing.ResidueField R - haveI RM_char := ringChar.charP K + have RM_char := ringChar.charP K let r := ringChar K let n := q.factorization r -- `r := char(R/m)` is either prime or zero: @@ -58,9 +58,9 @@ theorem charP_zero_or_prime_power (R : Type*) [CommRing R] [IsLocalRing R] (q : absurd (by simpa [n_zero] using q_eq_rn) (CharP.char_ne_one R q) -- Definition of prime power: `∃ r n, Prime r ∧ 0 < n ∧ r ^ n = q`. exact ⟨r, ⟨n, ⟨r_prime.prime, ⟨pos_iff_ne_zero.mpr n_pos, q_eq_rn.symm⟩⟩⟩⟩ - · haveI K_char_p_0 := ringChar.of_eq r_zero - haveI K_char_zero : CharZero K := CharP.charP_to_charZero K - haveI R_char_zero := RingHom.charZero (IsLocalRing.residue R) + · have K_char_p_0 := ringChar.of_eq r_zero + have K_char_zero : CharZero K := CharP.charP_to_charZero K + have R_char_zero := RingHom.charZero (IsLocalRing.residue R) -- Finally, `r = 0` would lead to a contradiction: have q_zero := CharP.eq R char_R_q (CharP.ofCharZero R) exact absurd q_zero q_pos diff --git a/Mathlib/Algebra/CharP/MixedCharZero.lean b/Mathlib/Algebra/CharP/MixedCharZero.lean index 6d184970dc9fdb..25e505bb05cced 100644 --- a/Mathlib/Algebra/CharP/MixedCharZero.lean +++ b/Mathlib/Algebra/CharP/MixedCharZero.lean @@ -278,7 +278,7 @@ theorem nonempty_algebraRat_iff : Nonempty (Algebra ℚ R) ↔ ∀ I : Ideal R, I ≠ ⊤ → CharZero (R ⧸ I) := by constructor · intro h_alg - haveI h_alg' : Algebra ℚ R := h_alg.some + have h_alg' : Algebra ℚ R := h_alg.some apply of_algebraRat · intro h apply Nonempty.intro @@ -333,7 +333,7 @@ theorem split_by_characteristic (h_pos : ∀ p : ℕ, p ≠ 0 → CharP R p → | intro p p_charP => by_cases h : p = 0 · rw [h] at p_charP - haveI h0 : CharZero R := CharP.charP_to_charZero R + have h0 : CharZero R := CharP.charP_to_charZero R exact split_equalCharZero_mixedCharZero R h_equal h_mixed · exact h_pos p h p_charP diff --git a/Mathlib/Algebra/CharP/Quotient.lean b/Mathlib/Algebra/CharP/Quotient.lean index 8372e3c8a1599e..e2ab5e0b296440 100644 --- a/Mathlib/Algebra/CharP/Quotient.lean +++ b/Mathlib/Algebra/CharP/Quotient.lean @@ -72,5 +72,5 @@ theorem Ideal.Quotient.index_eq_zero (I : Ideal R) : (↑I.toAddSubgroup.index : rw [AddSubgroup.index, Nat.card_eq] split_ifs with hq; swap · simp - letI : Fintype (R ⧸ I) := @Fintype.ofFinite _ hq + let : Fintype (R ⧸ I) := @Fintype.ofFinite _ hq exact Nat.cast_card_eq_zero (R ⧸ I) diff --git a/Mathlib/Algebra/DirectSum/Decomposition.lean b/Mathlib/Algebra/DirectSum/Decomposition.lean index 32e9581ec7509f..ab7887ab66ded5 100644 --- a/Mathlib/Algebra/DirectSum/Decomposition.lean +++ b/Mathlib/Algebra/DirectSum/Decomposition.lean @@ -108,7 +108,7 @@ protected theorem Decomposition.inductionOn {motive : M → Prop} (zero : motive (add : ∀ m m' : M, motive m → motive m' → motive (m + m')) : ∀ m, motive m := by let ℳ' : ι → AddSubmonoid M := fun i ↦ (⟨⟨ℳ i, fun x y ↦ AddMemClass.add_mem x y⟩, (ZeroMemClass.zero_mem _)⟩ : AddSubmonoid M) - haveI t : DirectSum.Decomposition ℳ' := + have t : DirectSum.Decomposition ℳ' := { decompose' := DirectSum.decompose ℳ left_inv := fun _ ↦ (decompose ℳ).left_inv _ right_inv := fun _ ↦ (decompose ℳ).right_inv _ } diff --git a/Mathlib/Algebra/DualNumber.lean b/Mathlib/Algebra/DualNumber.lean index 561d689b864acd..b45c31f70b77dd 100644 --- a/Mathlib/Algebra/DualNumber.lean +++ b/Mathlib/Algebra/DualNumber.lean @@ -127,7 +127,7 @@ on `R` and its value on `ε`. -/ lemma ringHom_ext {R' : Type*} [CommSemiring R'] {f g : R[ε] →+* R'} (h₀ : f.comp (algebraMap R R[ε]) = g.comp (algebraMap R R[ε])) (hε : f ε = g ε) : f = g := by - letI : Algebra R R' := by + let : Algebra R R' := by letI := f.toAlgebra exact Algebra.compHom _ (algebraMap R R[ε]) let f' : R[ε] →ₐ[R] R' := diff --git a/Mathlib/Algebra/EuclideanDomain/Basic.lean b/Mathlib/Algebra/EuclideanDomain/Basic.lean index ca7cbc827090dc..1af3e541f14667 100644 --- a/Mathlib/Algebra/EuclideanDomain/Basic.lean +++ b/Mathlib/Algebra/EuclideanDomain/Basic.lean @@ -55,7 +55,7 @@ theorem mod_eq_zero {a b : R} : a % b = 0 ↔ b ∣ a := rw [← div_add_mod a b, h, add_zero] exact dvd_mul_right _ _, fun ⟨c, e⟩ => by rw [e, ← add_left_cancel_iff, div_add_mod, add_zero] - haveI := Classical.dec + have := Classical.dec by_cases b0 : b = 0 · simp only [b0, zero_mul] · rw [mul_div_cancel_left₀ _ b0]⟩ diff --git a/Mathlib/Algebra/Exact/Basic.lean b/Mathlib/Algebra/Exact/Basic.lean index c06babd2e4c995..5aae5f12791023 100644 --- a/Mathlib/Algebra/Exact/Basic.lean +++ b/Mathlib/Algebra/Exact/Basic.lean @@ -90,7 +90,7 @@ may not apply if the zero of `Set.range g` is not definitionally equal to `⟨0, lemma iff_rangeFactorization [One P] (hg : 1 ∈ Set.range g) : letI : One (Set.range g) := ⟨⟨1, hg⟩⟩ MulExact f g ↔ MulExact ((↑) : Set.range f → N) (Set.rangeFactorization g) := by - letI : One (Set.range g) := ⟨⟨1, hg⟩⟩ + let : One (Set.range g) := ⟨⟨1, hg⟩⟩ have : ((1 : Set.range g) : P) = 1 := rfl simp [MulExact, Subtype.ext_iff, this] diff --git a/Mathlib/Algebra/Exact/Sequence.lean b/Mathlib/Algebra/Exact/Sequence.lean index 5cc990339f1579..2987f4d772de49 100644 --- a/Mathlib/Algebra/Exact/Sequence.lean +++ b/Mathlib/Algebra/Exact/Sequence.lean @@ -84,14 +84,14 @@ private lemma sum_neg_one_pow_finrank_eq_zero_of_exact_six_aux {V₀ V₁ V₂ V (surj : Surjective f₄) : (finrank k V₀ : ℤ) - finrank k V₁ + finrank k V₂ - finrank k V₃ + finrank k V₄ - finrank k V₅ = 0 := by - letI Vs := ![V₀, V₁, V₂, V₃, V₄, V₅] - letI (i : Fin 6) : AddCommGroup (Vs i) := match i with + let Vs := ![V₀, V₁, V₂, V₃, V₄, V₅] + let (i : Fin 6) : AddCommGroup (Vs i) := match i with | 0 => ‹_› | 1 => ‹_› | 2 => ‹_› | 3 => ‹_› | 4 => ‹_› | 5 => ‹_› - letI (i : Fin 6) : Module k (Vs i) := match i with + let (i : Fin 6) : Module k (Vs i) := match i with | 0 => ‹_› | 1 => ‹_› | 2 => ‹_› | 3 => ‹_› | 4 => ‹_› | 5 => ‹_› have (i : Fin 6) : FiniteDimensional k (Vs i) := match i with | 0 => ‹_› | 1 => ‹_› | 2 => ‹_› | 3 => ‹_› | 4 => ‹_› | 5 => ‹_› - letI fs (i : Fin 5) : Vs i.castSucc →ₗ[k] Vs i.succ := match i with + let fs (i : Fin 5) : Vs i.castSucc →ₗ[k] Vs i.succ := match i with | 0 => f₀ | 1 => f₁ | 2 => f₂ | 3 => f₃ | 4 => f₄ simpa [Fin.sum_univ_six] using! Module.sum_neg_one_pow_finrank_eq_zero_of_exact Vs fs inj (fun i ↦ by fin_cases i; exacts [exact₁, exact₂, exact₃, exact₄]) surj diff --git a/Mathlib/Algebra/Field/Subfield/Basic.lean b/Mathlib/Algebra/Field/Subfield/Basic.lean index a2b1f72211ab4f..4c2d2f09e3d340 100644 --- a/Mathlib/Algebra/Field/Subfield/Basic.lean +++ b/Mathlib/Algebra/Field/Subfield/Basic.lean @@ -424,7 +424,7 @@ theorem coe_iSup_of_directed {ι} [hι : Nonempty ι] {S : ι → Subfield K} (h theorem mem_sSup_of_directedOn {S : Set (Subfield K)} (Sne : S.Nonempty) (hS : DirectedOn (· ≤ ·) S) {x : K} : x ∈ sSup S ↔ ∃ s ∈ S, x ∈ s := by - haveI : Nonempty S := Sne.to_subtype + have : Nonempty S := Sne.to_subtype simp only [sSup_eq_iSup', mem_iSup_of_directed hS.directed_val, Subtype.exists, exists_prop] theorem coe_sSup_of_directedOn {S : Set (Subfield K)} (Sne : S.Nonempty) diff --git a/Mathlib/Algebra/Group/Subgroup/Finite.lean b/Mathlib/Algebra/Group/Subgroup/Finite.lean index caee3abfd81122..8e1697265de47d 100644 --- a/Mathlib/Algebra/Group/Subgroup/Finite.lean +++ b/Mathlib/Algebra/Group/Subgroup/Finite.lean @@ -217,7 +217,7 @@ section Normalizer theorem mem_normalizer_fintype {S : Set G} [Finite S] {x : G} (h : ∀ n, n ∈ S → x * n * x⁻¹ ∈ S) : x ∈ Subgroup.normalizer S := by - haveI := Classical.propDecidable; cases nonempty_fintype S + have := Classical.propDecidable; cases nonempty_fintype S exact fun n => ⟨h n, fun h₁ => have heq : (fun n => x * n * x⁻¹) '' S = S := diff --git a/Mathlib/Algebra/Group/Subgroup/Lattice.lean b/Mathlib/Algebra/Group/Subgroup/Lattice.lean index 04aeb1ddde5112..0101300c46195a 100644 --- a/Mathlib/Algebra/Group/Subgroup/Lattice.lean +++ b/Mathlib/Algebra/Group/Subgroup/Lattice.lean @@ -579,7 +579,7 @@ theorem coe_iSup_of_directed {ι} [Nonempty ι] {S : ι → Subgroup G} (hS : Di @[to_additive] theorem mem_sSup_of_directedOn {K : Set (Subgroup G)} (Kne : K.Nonempty) (hK : DirectedOn (· ≤ ·) K) {x : G} : x ∈ sSup K ↔ ∃ s ∈ K, x ∈ s := by - haveI : Nonempty K := Kne.to_subtype + have : Nonempty K := Kne.to_subtype simp only [sSup_eq_iSup', mem_iSup_of_directed hK.directed_val, SetCoe.exists, exists_prop] @[to_additive] diff --git a/Mathlib/Algebra/Group/Submonoid/Membership.lean b/Mathlib/Algebra/Group/Submonoid/Membership.lean index 0e5c544e78d9ea..e9e109c8842c1a 100644 --- a/Mathlib/Algebra/Group/Submonoid/Membership.lean +++ b/Mathlib/Algebra/Group/Submonoid/Membership.lean @@ -88,7 +88,7 @@ theorem coe_iSup_of_directed {ι} [Nonempty ι] {S : ι → Submonoid M} (hS : D @[to_additive] theorem mem_sSup_of_directedOn {S : Set (Submonoid M)} (Sne : S.Nonempty) (hS : DirectedOn (· ≤ ·) S) {x : M} : x ∈ sSup S ↔ ∃ s ∈ S, x ∈ s := by - haveI : Nonempty S := Sne.to_subtype + have : Nonempty S := Sne.to_subtype simp [sSup_eq_iSup', mem_iSup_of_directed hS.directed_val] @[to_additive] diff --git a/Mathlib/Algebra/Group/TransferInstance.lean b/Mathlib/Algebra/Group/TransferInstance.lean index 41a945e1b28f44..0f0e4bfef9779e 100644 --- a/Mathlib/Algebra/Group/TransferInstance.lean +++ b/Mathlib/Algebra/Group/TransferInstance.lean @@ -118,21 +118,21 @@ protected abbrev commSemigroup [CommSemigroup β] : CommSemigroup α := by protected lemma isLeftCancelMul [Mul β] [IsLeftCancelMul β] : letI := e.mul IsLeftCancelMul α := by - letI := e.mul; exact e.injective.isLeftCancelMul _ fun _ _ ↦ e.apply_symm_apply _ + let := e.mul; exact e.injective.isLeftCancelMul _ fun _ _ ↦ e.apply_symm_apply _ /-- Transfer `IsRightCancelMul` across an `Equiv` -/ @[to_additive /-- Transfer `IsRightCancelAdd` across an `Equiv` -/] protected lemma isRightCancelMul [Mul β] [IsRightCancelMul β] : letI := e.mul IsRightCancelMul α := by - letI := e.mul; exact e.injective.isRightCancelMul _ fun _ _ ↦ e.apply_symm_apply _ + let := e.mul; exact e.injective.isRightCancelMul _ fun _ _ ↦ e.apply_symm_apply _ /-- Transfer `IsCancelMul` across an `Equiv` -/ @[to_additive /-- Transfer `IsCancelAdd` across an `Equiv` -/] protected lemma isCancelMul [Mul β] [IsCancelMul β] : letI := e.mul IsCancelMul α := by - letI := e.mul; exact e.injective.isCancelMul _ fun _ _ ↦ e.apply_symm_apply _ + let := e.mul; exact e.injective.isCancelMul _ fun _ _ ↦ e.apply_symm_apply _ /-- Transfer `MulOneClass` across an `Equiv` -/ @[to_additive /-- Transfer `AddZeroClass` across an `Equiv` -/] @@ -191,7 +191,7 @@ lemma exists_type_univ_nonempty_mulEquiv.{u, v} (G : Type u) [Group G] [Finite G obtain ⟨n, ⟨e⟩⟩ := Finite.exists_equiv_fin G let f : Fin n ≃ ULift (Fin n) := Equiv.ulift.symm let e : G ≃ ULift (Fin n) := e.trans f - letI groupH : Group (ULift (Fin n)) := e.symm.group + let groupH : Group (ULift (Fin n)) := e.symm.group exact ⟨ULift (Fin n), groupH, inferInstance, ⟨MulEquiv.symm <| e.symm.mulEquiv⟩⟩ end Finite diff --git a/Mathlib/Algebra/Homology/Additive.lean b/Mathlib/Algebra/Homology/Additive.lean index 56b8a7c83daa15..6b9c84d330b1bd 100644 --- a/Mathlib/Algebra/Homology/Additive.lean +++ b/Mathlib/Algebra/Homology/Additive.lean @@ -135,10 +135,10 @@ instance Functor.mapHomologicalComplex_reflects_iso (F : W₁ ⥤ W₂) [F.Prese ReflectsIsomorphisms (F.mapHomologicalComplex c) := ⟨fun f => by intro - haveI : ∀ n : ι, IsIso (F.map (f.f n)) := fun n => + have : ∀ n : ι, IsIso (F.map (f.f n)) := fun n => ((HomologicalComplex.eval W₂ c n).mapIso (asIso ((F.mapHomologicalComplex c).map f))).isIso_hom - haveI := fun n => isIso_of_reflects_iso (f.f n) F + have := fun n => isIso_of_reflects_iso (f.f n) F exact HomologicalComplex.Hom.isIso_of_components f⟩ instance (F : V ⥤ W) [F.Additive] (c : ComplexShape ι) [F.Faithful] : diff --git a/Mathlib/Algebra/Homology/DerivedCategory/Ext/Basic.lean b/Mathlib/Algebra/Homology/DerivedCategory/Ext/Basic.lean index ff26fc2ef8b227..f63799346ef521 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/Ext/Basic.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/Ext/Basic.lean @@ -91,7 +91,7 @@ lemma hasExt_of_hasDerivedCategory [HasDerivedCategory.{w} C] : HasExt.{w} C := infer_instance lemma HasExt.standard : HasExt.{max u v} C := by - letI := HasDerivedCategory.standard + let := HasDerivedCategory.standard exact hasExt_of_hasDerivedCategory _ set_option backward.isDefEq.respectTransparency false in @@ -192,7 +192,7 @@ lemma mk₀_hom [HasDerivedCategory.{w'} C] (f : X ⟶ Y) : @[simp] lemma mk₀_comp_mk₀ (f : X ⟶ Y) (g : Y ⟶ Z) : (mk₀ f).comp (mk₀ g) (zero_add 0) = mk₀ (f ≫ g) := by - letI := HasDerivedCategory.standard C; ext; simp + let := HasDerivedCategory.standard C; ext; simp @[simp] lemma mk₀_comp_mk₀_assoc (f : X ⟶ Y) (g : Y ⟶ Z) {n : ℕ} (α : Ext Z T n) : @@ -204,7 +204,7 @@ lemma mk₀_comp_mk₀_assoc (f : X ⟶ Y) (g : Y ⟶ Z) {n : ℕ} (α : Ext Z T variable (X Y) in lemma mk₀_bijective : Function.Bijective (mk₀ (X := X) (Y := Y)) := by - letI := HasDerivedCategory.standard C + let := HasDerivedCategory.standard C have h : (singleFunctor C 0).FullyFaithful := Functor.FullyFaithful.ofFullyFaithful _ let e : (X ⟶ Y) ≃ Ext X Y 0 := (h.homEquiv.trans (ShiftedHom.homEquiv _ (by simp))).trans homEquiv.symm @@ -268,51 +268,51 @@ private lemma zero_hom' : (0 : Ext X Y n).hom' = 0 := @[simp] lemma add_comp (α₁ α₂ : Ext X Y n) {m : ℕ} (β : Ext Y Z m) {p : ℕ} (h : n + m = p) : (α₁ + α₂).comp β h = α₁.comp β h + α₂.comp β h := by - letI := HasDerivedCategory.standard C; ext; simp [this, add_hom'] + let := HasDerivedCategory.standard C; ext; simp [this, add_hom'] @[simp] lemma comp_add (α : Ext X Y n) {m : ℕ} (β₁ β₂ : Ext Y Z m) {p : ℕ} (h : n + m = p) : α.comp (β₁ + β₂) h = α.comp β₁ h + α.comp β₂ h := by - letI := HasDerivedCategory.standard C; ext; simp [this, add_hom'] + let := HasDerivedCategory.standard C; ext; simp [this, add_hom'] @[simp] lemma neg_comp (α : Ext X Y n) {m : ℕ} (β : Ext Y Z m) {p : ℕ} (h : n + m = p) : (-α).comp β h = -α.comp β h := by - letI := HasDerivedCategory.standard C; ext; simp [this, neg_hom'] + let := HasDerivedCategory.standard C; ext; simp [this, neg_hom'] @[simp] lemma comp_neg (α : Ext X Y n) {m : ℕ} (β : Ext Y Z m) {p : ℕ} (h : n + m = p) : α.comp (-β) h = -α.comp β h := by - letI := HasDerivedCategory.standard C; ext; simp [this, neg_hom'] + let := HasDerivedCategory.standard C; ext; simp [this, neg_hom'] variable (X n) in @[simp] lemma zero_comp {m : ℕ} (β : Ext Y Z m) (p : ℕ) (h : n + m = p) : (0 : Ext X Y n).comp β h = 0 := by - letI := HasDerivedCategory.standard C; ext; simp [this, zero_hom'] + let := HasDerivedCategory.standard C; ext; simp [this, zero_hom'] @[simp] lemma comp_zero (α : Ext X Y n) (Z : C) (m : ℕ) (p : ℕ) (h : n + m = p) : α.comp (0 : Ext Y Z m) h = 0 := by - letI := HasDerivedCategory.standard C; ext; simp [this, zero_hom'] + let := HasDerivedCategory.standard C; ext; simp [this, zero_hom'] @[simp] lemma mk₀_id_comp (α : Ext X Y n) : (mk₀ (𝟙 X)).comp α (zero_add n) = α := by - letI := HasDerivedCategory.standard C; ext; simp + let := HasDerivedCategory.standard C; ext; simp @[simp] lemma comp_mk₀_id (α : Ext X Y n) : α.comp (mk₀ (𝟙 Y)) (add_zero n) = α := by - letI := HasDerivedCategory.standard C; ext; simp + let := HasDerivedCategory.standard C; ext; simp variable (X Y) in @[simp] lemma mk₀_zero : mk₀ (0 : X ⟶ Y) = 0 := by - letI := HasDerivedCategory.standard C; ext; simp [zero_hom'] + let := HasDerivedCategory.standard C; ext; simp [zero_hom'] lemma mk₀_add (f g : X ⟶ Y) : mk₀ (f + g) = mk₀ f + mk₀ g := by - letI := HasDerivedCategory.standard C; ext; simp [add_hom', ShiftedHom.mk₀] + let := HasDerivedCategory.standard C; ext; simp [add_hom', ShiftedHom.mk₀] /-- The additive bijection `Ext X Y 0 ≃+ (X ⟶ Y)`. -/ @[simps! symm_apply] @@ -333,7 +333,7 @@ lemma mk₀_eq_zero_iff {M N : C} (f : M ⟶ N) : @[simp] lemma mk₀_neg (f : X ⟶ Y) : mk₀ (-f) = -mk₀ f := by - letI := HasDerivedCategory.standard C; ext; simp [neg_hom'] + let := HasDerivedCategory.standard C; ext; simp [neg_hom'] section @@ -342,7 +342,7 @@ lemma biprod_ext {X₁ X₂ : C} {α β : Ext (X₁ ⊞ X₂) Y n} (h₁ : (mk₀ biprod.inl).comp α (zero_add n) = (mk₀ biprod.inl).comp β (zero_add n)) (h₂ : (mk₀ biprod.inr).comp α (zero_add n) = (mk₀ biprod.inr).comp β (zero_add n)) : α = β := by - letI := HasDerivedCategory.standard C + let := HasDerivedCategory.standard C rw [Ext.ext_iff] at h₁ h₂ ⊢ simp only [comp_hom, mk₀_hom, ShiftedHom.mk₀_comp] at h₁ h₂ apply BinaryCofan.IsColimit.hom_ext @@ -557,7 +557,7 @@ open Abelian variable (C) in lemma hasExt_iff_small_ext : HasExt.{w'} C ↔ ∀ (X Y : C) (n : ℕ), Small.{w'} (Ext.{w} X Y n) := by - letI := HasDerivedCategory.standard C + let := HasDerivedCategory.standard C simp only [hasExt_iff, small_congr Ext.homEquiv] constructor · intro h X Y n diff --git a/Mathlib/Algebra/Homology/DerivedCategory/Ext/EnoughInjectives.lean b/Mathlib/Algebra/Homology/DerivedCategory/Ext/EnoughInjectives.lean index 4de85b619e0a04..d7b9f8c1a97059 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/Ext/EnoughInjectives.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/Ext/EnoughInjectives.lean @@ -101,7 +101,7 @@ lemma eq_zero_of_injective [HasExt.{w} C] {X I : C} {n : ℕ} [Injective I] (e : Ext X I (n + 1)) : e = 0 := by let K := (CochainComplex.singleFunctor C 0).obj X have := K.isStrictlyGE_of_ge (-n) 0 (by lia) - letI := HasDerivedCategory.standard C + let := HasDerivedCategory.standard C apply homEquiv.injective simp only [← cancel_mono (((singleFunctors C).shiftIso (n + 1) (-(n + 1)) 0 (by lia)).hom.app _), zero_hom, Limits.zero_comp] @@ -125,7 +125,7 @@ instances, we would have to specify the universe explicitly almost everywhere, which would be an inconvenience. Then, we must be very selective regarding `HasExt` instances. -/ lemma hasExt_of_enoughInjectives [LocallySmall.{w} C] [EnoughInjectives C] : HasExt.{w} C := by - letI := HasDerivedCategory.standard C + let := HasDerivedCategory.standard C have := hasExt_of_hasDerivedCategory C rw [hasExt_iff_small_ext.{w}] intro X Y n diff --git a/Mathlib/Algebra/Homology/DerivedCategory/Ext/EnoughProjectives.lean b/Mathlib/Algebra/Homology/DerivedCategory/Ext/EnoughProjectives.lean index ee9256913f59a8..2dc52050bd2d7d 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/Ext/EnoughProjectives.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/Ext/EnoughProjectives.lean @@ -99,7 +99,7 @@ open DerivedCategory set_option backward.isDefEq.respectTransparency false in lemma eq_zero_of_projective [HasExt.{w} C] {P Y : C} {n : ℕ} [Projective P] (e : Ext P Y (n + 1)) : e = 0 := by - letI := HasDerivedCategory.standard C + let := HasDerivedCategory.standard C apply homEquiv.injective simp only [← cancel_mono (((singleFunctors C).shiftIso (n + 1) (-(n + 1)) 0 (by lia)).hom.app _), zero_hom, Limits.zero_comp] @@ -124,7 +124,7 @@ instances, we would have to specify the universe explicitly almost everywhere, which would be an inconvenience. Then, we must be very selective regarding `HasExt` instances. -/ lemma hasExt_of_enoughProjectives [LocallySmall.{w} C] [EnoughProjectives C] : HasExt.{w} C := by - letI := HasDerivedCategory.standard C + let := HasDerivedCategory.standard C have := hasExt_of_hasDerivedCategory C rw [hasExt_iff_small_ext.{w}] intro X Y n diff --git a/Mathlib/Algebra/Homology/DerivedCategory/Ext/ExactSequences.lean b/Mathlib/Algebra/Homology/DerivedCategory/Ext/ExactSequences.lean index 2f6cac77be8ef4..565031ebfe26c7 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/Ext/ExactSequences.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/Ext/ExactSequences.lean @@ -67,7 +67,7 @@ lemma covariant_sequence_exact₂' (n : ℕ) : dsimp simp only [comp_assoc_of_third_deg_zero, mk₀_comp_mk₀, ShortComplex.zero, mk₀_zero, comp_zero])).Exact := by - letI := HasDerivedCategory.standard C + let := HasDerivedCategory.standard C have := (preadditiveCoyoneda.obj (op ((singleFunctor C 0).obj X))).homologySequence_exact₂ _ (hS.singleTriangle_distinguished) n rw [ShortComplex.ab_exact_iff_function_exact] at this ⊢ @@ -88,7 +88,7 @@ lemma covariant_sequence_exact₃' : dsimp simp only [comp_assoc_of_second_deg_zero, ShortComplex.ShortExact.comp_extClass, comp_zero])).Exact := by - letI := HasDerivedCategory.standard C + let := HasDerivedCategory.standard C have := (preadditiveCoyoneda.obj (op ((singleFunctor C 0).obj X))).homologySequence_exact₃ _ (hS.singleTriangle_distinguished) n₀ n₁ (by lia) rw [ShortComplex.ab_exact_iff_function_exact] at this ⊢ @@ -108,7 +108,7 @@ lemma covariant_sequence_exact₁' : dsimp simp only [comp_assoc_of_third_deg_zero, ShortComplex.ShortExact.extClass_comp, comp_zero])).Exact := by - letI := HasDerivedCategory.standard C + let := HasDerivedCategory.standard C have := (preadditiveCoyoneda.obj (op ((singleFunctor C 0).obj X))).homologySequence_exact₁ _ (hS.singleTriangle_distinguished) n₀ n₁ (by lia) rw [ShortComplex.ab_exact_iff_function_exact] at this ⊢ @@ -204,7 +204,7 @@ lemma contravariant_sequence_exact₂' (n : ℕ) : ext dsimp simp only [mk₀_comp_mk₀_assoc, ShortComplex.zero, mk₀_zero, zero_comp])).Exact := by - letI := HasDerivedCategory.standard C + let := HasDerivedCategory.standard C have := (preadditiveYoneda.obj ((singleFunctor C 0).obj Y)).homologySequence_exact₂ _ (op_distinguished _ hS.singleTriangle_distinguished) n rw [ShortComplex.ab_exact_iff_function_exact] at this ⊢ @@ -224,7 +224,7 @@ lemma contravariant_sequence_exact₁' : ext dsimp simp only [ShortComplex.ShortExact.extClass_comp_assoc])).Exact := by - letI := HasDerivedCategory.standard C + let := HasDerivedCategory.standard C have := (preadditiveYoneda.obj ((singleFunctor C 0).obj Y)).homologySequence_exact₃ _ (op_distinguished _ hS.singleTriangle_distinguished) n₀ n₁ (by lia) rw [ShortComplex.ab_exact_iff_function_exact] at this ⊢ @@ -241,7 +241,7 @@ lemma contravariant_sequence_exact₃' : ext dsimp simp only [ShortComplex.ShortExact.comp_extClass_assoc])).Exact := by - letI := HasDerivedCategory.standard C + let := HasDerivedCategory.standard C have := (preadditiveYoneda.obj ((singleFunctor C 0).obj Y)).homologySequence_exact₁ _ (op_distinguished _ hS.singleTriangle_distinguished) n₀ n₁ (by lia) rw [ShortComplex.ab_exact_iff_function_exact] at this ⊢ diff --git a/Mathlib/Algebra/Homology/DerivedCategory/Ext/ExtClass.lean b/Mathlib/Algebra/Homology/DerivedCategory/Ext/ExtClass.lean index 4e34a0c256f55b..8a82a5f8467b09 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/Ext/ExtClass.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/Ext/ExtClass.lean @@ -102,7 +102,7 @@ end @[simp] lemma comp_extClass : (Ext.mk₀ S.g).comp hS.extClass (zero_add 1) = 0 := by - letI := HasDerivedCategory.standard C + let := HasDerivedCategory.standard C ext simp only [Ext.comp_hom, Ext.mk₀_hom, extClass_hom, Ext.zero_hom, ShiftedHom.mk₀_comp] @@ -116,7 +116,7 @@ lemma comp_extClass_assoc {Y : C} {n : ℕ} (γ : Ext S.X₁ Y n) {n' : ℕ} (h @[simp] lemma extClass_comp : hS.extClass.comp (Ext.mk₀ S.f) (add_zero 1) = 0 := by - letI := HasDerivedCategory.standard C + let := HasDerivedCategory.standard C ext simp only [Ext.comp_hom, Ext.mk₀_hom, extClass_hom, Ext.zero_hom, ShiftedHom.comp_mk₀] @@ -132,7 +132,7 @@ lemma extClass_naturality {S₁ S₂ : ShortComplex C} (h₁ : S₁.ShortExact) (h₂ : S₂.ShortExact) (f : S₁ ⟶ S₂) : h₁.extClass.comp (Ext.mk₀ f.τ₁) (add_zero 1) = (Ext.mk₀ f.τ₃).comp h₂.extClass (zero_add 1) := by - letI := HasDerivedCategory.standard C + let := HasDerivedCategory.standard C ext simpa [ShiftedHom.comp_mk₀, ShiftedHom.mk₀_comp] using! (singleTriangle.map h₁ h₂ f).comm₃ diff --git a/Mathlib/Algebra/Homology/DerivedCategory/Ext/TStructure.lean b/Mathlib/Algebra/Homology/DerivedCategory/Ext/TStructure.lean index 73889aef11cd9a..27705d8ad2371a 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/Ext/TStructure.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/Ext/TStructure.lean @@ -44,7 +44,7 @@ lemma hasSmallLocalizedShiftedHom_of_isLE_of_isGE (a b : ℤ) [K.IsGE a] [K.IsLE a] [L.IsGE b] [L.IsLE b] : HasSmallLocalizedShiftedHom.{w} (HomologicalComplex.quasiIso C (ComplexShape.up ℤ)) ℤ K L := by - letI := HasDerivedCategory.standard + let := HasDerivedCategory.standard obtain ⟨X, ⟨eX⟩⟩ := DerivedCategory.exists_iso_singleFunctor_obj_of_isGE_of_isLE (Q.obj K) a obtain ⟨Y, ⟨eY⟩⟩ := DerivedCategory.exists_iso_singleFunctor_obj_of_isGE_of_isLE (Q.obj L) b simp only [hasSmallLocalizedShiftedHom_iff _ _ Q] diff --git a/Mathlib/Algebra/Homology/DerivedCategory/KInjective.lean b/Mathlib/Algebra/Homology/DerivedCategory/KInjective.lean index e9e9457c504b1d..221f901691d12c 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/KInjective.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/KInjective.lean @@ -69,7 +69,7 @@ variable (K L : CochainComplex C ℤ) (n : ℤ) set_option backward.isDefEq.respectTransparency false in lemma bijective_toSmallShiftedHom_of_isKInjective [L.IsKInjective] : Function.Bijective (toSmallShiftedHom.{w} (K := K) (L := L) (n := n)) := by - letI := HasDerivedCategory.standard C + let := HasDerivedCategory.standard C rw [← Function.Bijective.of_comp_iff' (SmallShiftedHom.equiv _ DerivedCategory.Q).bijective, ← Function.Bijective.of_comp_iff' (Iso.homCongr ((quotientCompQhIso C).symm.app K) diff --git a/Mathlib/Algebra/Homology/DerivedCategory/KProjective.lean b/Mathlib/Algebra/Homology/DerivedCategory/KProjective.lean index a97dc2065d1291..62bc40a28b8297 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/KProjective.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/KProjective.lean @@ -70,7 +70,7 @@ variable (K L : CochainComplex C ℤ) (n : ℤ) set_option backward.isDefEq.respectTransparency false in lemma bijective_toSmallShiftedHom_of_isKProjective [K.IsKProjective] : Function.Bijective (toSmallShiftedHom.{w} (K := K) (L := L) (n := n)) := by - letI := HasDerivedCategory.standard C + let := HasDerivedCategory.standard C rw [← Function.Bijective.of_comp_iff' (SmallShiftedHom.equiv _ DerivedCategory.Q).bijective, ← Function.Bijective.of_comp_iff' (Iso.homCongr ((quotientCompQhIso C).symm.app K) diff --git a/Mathlib/Algebra/Homology/DerivedCategory/SmallShiftedHom.lean b/Mathlib/Algebra/Homology/DerivedCategory/SmallShiftedHom.lean index 8c977e12d1cf47..b56ffa0b408a35 100644 --- a/Mathlib/Algebra/Homology/DerivedCategory/SmallShiftedHom.lean +++ b/Mathlib/Algebra/Homology/DerivedCategory/SmallShiftedHom.lean @@ -40,7 +40,7 @@ to the `x`. -/ noncomputable def toSmallShiftedHom (x : CohomologyClass K L n) : SmallShiftedHom.{w} (HomologicalComplex.quasiIso C (.up ℤ)) K L n := Quotient.lift (fun y ↦ SmallShiftedHom.mk _ (Cocycle.equivHomShift.symm y)) (by - letI := HasDerivedCategory.standard C + let := HasDerivedCategory.standard C intro y₁ y₂ h refine (SmallShiftedHom.equiv _ DerivedCategory.Q).injective ?_ simp only [SmallShiftedHom.equiv_mk, ShiftedHom.map] diff --git a/Mathlib/Algebra/Homology/HomotopyCofiber.lean b/Mathlib/Algebra/Homology/HomotopyCofiber.lean index 96920cb78c75bc..36be79f5f5c90a 100644 --- a/Mathlib/Algebra/Homology/HomotopyCofiber.lean +++ b/Mathlib/Algebra/Homology/HomotopyCofiber.lean @@ -83,7 +83,7 @@ lemma isZero_X (i : ι) (hG : IsZero (G.X i)) (hF : ∀ (j : ι), c.Rel i j → IsZero (F.X j)) : IsZero (X φ i) := by by_cases h : c.Rel i (c.next i) - · haveI := HasHomotopyCofiber.hasBinaryBiproduct φ _ _ h + · have := HasHomotopyCofiber.hasBinaryBiproduct φ _ _ h refine IsZero.of_iso ?_ (XIsoBiprod φ _ _ h) simp only [biprod_isZero_iff] exact ⟨hF _ h, hG⟩ @@ -149,7 +149,7 @@ lemma inrX_fstX (i j : ι) (hij : c.Rel i j) : lemma inlX_XIsoBiprod_hom (i j : ι) (hij : c.Rel j i) : haveI := HasHomotopyCofiber.hasBinaryBiproduct φ _ _ hij inlX φ i j hij ≫ (XIsoBiprod φ j i hij).hom = biprod.inl := by - haveI := HasHomotopyCofiber.hasBinaryBiproduct φ _ _ hij + have := HasHomotopyCofiber.hasBinaryBiproduct φ _ _ hij simp [inlX] @[reassoc (attr := simp)] @@ -163,7 +163,7 @@ lemma inrX_XIsoBiprod_hom (i j : ι) (hij : c.Rel j i) : haveI := HasHomotopyCofiber.hasBinaryBiproduct φ _ _ hij inrX φ j ≫ (XIsoBiprod φ j i hij).hom = biprod.inr := by obtain rfl := c.next_eq' hij - haveI := HasHomotopyCofiber.hasBinaryBiproduct φ _ _ hij + have := HasHomotopyCofiber.hasBinaryBiproduct φ _ _ hij simp [inrX, XIsoBiprod, dif_pos hij] @[reassoc (attr := simp)] @@ -184,7 +184,7 @@ noncomputable def d (i j : ι) : X φ i ⟶ X φ j := lemma ext_to_X (i j : ι) (hij : c.Rel i j) {A : C} {f g : A ⟶ X φ i} (h₁ : f ≫ fstX φ i j hij = g ≫ fstX φ i j hij) (h₂ : f ≫ sndX φ i = g ≫ sndX φ i) : f = g := by - haveI := HasHomotopyCofiber.hasBinaryBiproduct φ _ _ hij + have := HasHomotopyCofiber.hasBinaryBiproduct φ _ _ hij rw [← cancel_mono (XIsoBiprod φ i j hij).hom] apply biprod.hom_ext · simpa using! h₁ @@ -199,7 +199,7 @@ lemma ext_to_X' (i : ι) (hi : ¬ c.Rel i (c.next i)) {A : C} {f g : A ⟶ X φ lemma ext_from_X (i j : ι) (hij : c.Rel j i) {A : C} {f g : X φ j ⟶ A} (h₁ : inlX φ i j hij ≫ f = inlX φ i j hij ≫ g) (h₂ : inrX φ j ≫ f = inrX φ j ≫ g) : f = g := by - haveI := HasHomotopyCofiber.hasBinaryBiproduct φ _ _ hij + have := HasHomotopyCofiber.hasBinaryBiproduct φ _ _ hij rw [← cancel_epi (XIsoBiprod φ j i hij).inv] apply biprod.hom_ext' · simpa diff --git a/Mathlib/Algebra/Homology/ImageToKernel.lean b/Mathlib/Algebra/Homology/ImageToKernel.lean index 47916e78e08c29..000ea09d602d06 100644 --- a/Mathlib/Algebra/Homology/ImageToKernel.lean +++ b/Mathlib/Algebra/Homology/ImageToKernel.lean @@ -137,7 +137,7 @@ instance imageToKernel_epi_of_zero_of_mono [HasKernels V] [HasZeroObject V] [Mon instance imageToKernel_epi_of_epi_of_zero [HasImages V] [Epi f] : Epi (imageToKernel f (0 : B ⟶ C) (by simp)) := by simp only [imageToKernel_zero_right] - haveI := epi_image_of_epi f + have := epi_image_of_epi f rw [← imageSubobject_arrow] infer_instance diff --git a/Mathlib/Algebra/Homology/ShortComplex/Exact.lean b/Mathlib/Algebra/Homology/ShortComplex/Exact.lean index fee0ba6b919258..9916143396dc42 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/Exact.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/Exact.lean @@ -92,12 +92,12 @@ variable {S} lemma HomologyData.exact_iff (h : S.HomologyData) : S.Exact ↔ IsZero h.left.H := by - haveI := HasHomology.mk' h + have := HasHomology.mk' h exact LeftHomologyData.exact_iff h.left lemma HomologyData.exact_iff' (h : S.HomologyData) : S.Exact ↔ IsZero h.right.H := by - haveI := HasHomology.mk' h + have := HasHomology.mk' h exact RightHomologyData.exact_iff h.right variable (S) @@ -148,7 +148,7 @@ variable {S} lemma HomologyData.exact_iff_i_p_zero (h : S.HomologyData) : S.Exact ↔ h.left.i ≫ h.right.p = 0 := by - haveI := HasHomology.mk' h + have := HasHomology.mk' h rw [h.left.exact_iff, ← h.comm] constructor · intro z @@ -171,8 +171,8 @@ lemma exact_iff_iCycles_pOpcycles_zero [S.HasHomology] : lemma exact_iff_kernel_ι_comp_cokernel_π_zero [S.HasHomology] [HasKernel S.g] [HasCokernel S.f] : S.Exact ↔ kernel.ι S.g ≫ cokernel.π S.f = 0 := by - haveI := HasLeftHomology.hasCokernel S - haveI := HasRightHomology.hasKernel S + have := HasLeftHomology.hasCokernel S + have := HasRightHomology.hasKernel S exact S.exact_iff_i_p_zero (LeftHomologyData.ofHasKernelOfHasCokernel S) (RightHomologyData.ofHasCokernelOfHasKernel S) @@ -295,8 +295,8 @@ lemma exact_iff_epi [HasZeroObject C] (hg : S.g = 0) : · intro h have := h.hasHomology simp only [exact_iff_isZero_homology] at h - haveI := S.isIso_iCycles hg - haveI : Epi S.toCycles := epi_of_isZero_cokernel' _ S.homologyIsCokernel h + have := S.isIso_iCycles hg + have : Epi S.toCycles := epi_of_isZero_cokernel' _ S.homologyIsCokernel h rw [← S.toCycles_i] apply epi_comp · intro @@ -310,14 +310,14 @@ variable {S} set_option backward.defeqAttrib.useBackward true in lemma Exact.epi_f' (hS : S.Exact) (h : LeftHomologyData S) : Epi h.f' := epi_of_isZero_cokernel' _ h.hπ (by - haveI := hS.hasHomology + have := hS.hasHomology dsimp simpa only [← h.exact_iff] using hS) set_option backward.defeqAttrib.useBackward true in lemma Exact.mono_g' (hS : S.Exact) (h : RightHomologyData S) : Mono h.g' := mono_of_isZero_kernel' _ h.hι (by - haveI := hS.hasHomology + have := hS.hasHomology dsimp simpa only [← h.exact_iff] using hS) diff --git a/Mathlib/Algebra/Homology/ShortComplex/Homology.lean b/Mathlib/Algebra/Homology/ShortComplex/Homology.lean index 123c6e89fc7520..b68c0c098a0417 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/Homology.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/Homology.lean @@ -727,7 +727,7 @@ lemma hasHomology_of_isIso_leftRightHomologyComparison' lemma hasHomology_of_isIsoLeftRightHomologyComparison [S.HasLeftHomology] [S.HasRightHomology] [h : IsIso S.leftRightHomologyComparison] : S.HasHomology := by - haveI : IsIso (leftRightHomologyComparison' S.leftHomologyData S.rightHomologyData) := h + have : IsIso (leftRightHomologyComparison' S.leftHomologyData S.rightHomologyData) := h exact hasHomology_of_isIso_leftRightHomologyComparison' S.leftHomologyData S.rightHomologyData section diff --git a/Mathlib/Algebra/Homology/ShortComplex/LeftHomology.lean b/Mathlib/Algebra/Homology/ShortComplex/LeftHomology.lean index 56c1b1fb4575e4..866f7a60ff3579 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/LeftHomology.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/LeftHomology.lean @@ -1085,7 +1085,7 @@ set_option backward.isDefEq.respectTransparency false in lemma hasCokernel [S.HasLeftHomology] [HasKernel S.g] : HasCokernel (kernel.lift S.g S.f S.zero) := by let h := S.leftHomologyData - haveI : HasColimit (parallelPair h.f' 0) := ⟨⟨⟨_, h.hπ'⟩⟩⟩ + have : HasColimit (parallelPair h.f' 0) := ⟨⟨⟨_, h.hπ'⟩⟩⟩ let e : parallelPair (kernel.lift S.g S.f S.zero) 0 ≅ parallelPair h.f' 0 := parallelPair.ext (Iso.refl _) (IsLimit.conePointUniqueUpToIso (kernelIsKernel S.g) h.hi) (by cat_disch) (by simp) diff --git a/Mathlib/Algebra/Homology/ShortComplex/QuasiIso.lean b/Mathlib/Algebra/Homology/ShortComplex/QuasiIso.lean index 725a4d870788b3..03660942f87188 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/QuasiIso.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/QuasiIso.lean @@ -104,7 +104,7 @@ lemma LeftHomologyMapData.quasiIso_iff {φ : S₁ ⟶ S₂} {h₁ : S₁.LeftHom rw [ShortComplex.quasiIso_iff, γ.homologyMap_eq] constructor · intro h - haveI : IsIso (γ.φH ≫ (LeftHomologyData.homologyIso h₂).inv) := + have : IsIso (γ.φH ≫ (LeftHomologyData.homologyIso h₂).inv) := IsIso.of_isIso_comp_left (LeftHomologyData.homologyIso h₁).hom _ exact IsIso.of_isIso_comp_right _ (LeftHomologyData.homologyIso h₂).inv · intro h @@ -116,7 +116,7 @@ lemma RightHomologyMapData.quasiIso_iff {φ : S₁ ⟶ S₂} {h₁ : S₁.RightH rw [ShortComplex.quasiIso_iff, γ.homologyMap_eq] constructor · intro h - haveI : IsIso (γ.φH ≫ (RightHomologyData.homologyIso h₂).inv) := + have : IsIso (γ.φH ≫ (RightHomologyData.homologyIso h₂).inv) := IsIso.of_isIso_comp_left (RightHomologyData.homologyIso h₁).hom _ exact IsIso.of_isIso_comp_right _ (RightHomologyData.homologyIso h₂).inv · intro h diff --git a/Mathlib/Algebra/Homology/ShortComplex/RightHomology.lean b/Mathlib/Algebra/Homology/ShortComplex/RightHomology.lean index d3ee48beba9abc..8d67f596bcdfee 100644 --- a/Mathlib/Algebra/Homology/ShortComplex/RightHomology.lean +++ b/Mathlib/Algebra/Homology/ShortComplex/RightHomology.lean @@ -1240,7 +1240,7 @@ instance (φ : S₁ ⟶ S₂) (h₁ : S₁.RightHomologyData) (h₂ : S₂.Right [Epi φ.τ₁] [IsIso φ.τ₂] [Mono φ.τ₃] : IsIso (rightHomologyMap' φ h₁ h₂) := by let h₂' := RightHomologyData.ofEpiOfIsIsoOfMono φ h₁ - haveI : IsIso (rightHomologyMap' φ h₁ h₂') := by + have : IsIso (rightHomologyMap' φ h₁ h₂') := by rw [(RightHomologyMapData.ofEpiOfIsIsoOfMono φ h₁).rightHomologyMap'_eq] dsimp infer_instance @@ -1386,7 +1386,7 @@ set_option backward.isDefEq.respectTransparency false in lemma hasKernel [S.HasRightHomology] [HasCokernel S.f] : HasKernel (cokernel.desc S.f S.g S.zero) := by let h := S.rightHomologyData - haveI : HasLimit (parallelPair h.g' 0) := ⟨⟨⟨_, h.hι'⟩⟩⟩ + have : HasLimit (parallelPair h.g' 0) := ⟨⟨⟨_, h.hι'⟩⟩⟩ let e : parallelPair (cokernel.desc S.f S.g S.zero) 0 ≅ parallelPair h.g' 0 := parallelPair.ext (IsColimit.coconePointUniqueUpToIso (colimit.isColimit _) h.hp) (Iso.refl _) (coequalizer.hom_ext (by simp)) (by simp) diff --git a/Mathlib/Algebra/Lie/Engel.lean b/Mathlib/Algebra/Lie/Engel.lean index 3214cfa5c41c7b..881677545bfc3c 100644 --- a/Mathlib/Algebra/Lie/Engel.lean +++ b/Mathlib/Algebra/Lie/Engel.lean @@ -171,11 +171,11 @@ theorem LieAlgebra.isEngelian_of_subsingleton [Subsingleton L] : LieAlgebra.IsEn theorem Function.Surjective.isEngelian {f : L →ₗ⁅R⁆ L₂} (hf : Function.Surjective f) (h : LieAlgebra.IsEngelian.{u₁, u₂, u₄} R L) : LieAlgebra.IsEngelian.{u₁, u₃, u₄} R L₂ := by intro M _i1 _i2 _i3 _i4 h' - letI : LieRingModule L M := LieRingModule.compLieHom M f - letI : LieModule R L M := compLieHom M f + let : LieRingModule L M := LieRingModule.compLieHom M f + let : LieModule R L M := compLieHom M f have hnp : ∀ x, IsNilpotent (toEnd R L M x) := fun x => h' (f x) have surj_id : Function.Surjective (LinearMap.id : M →ₗ[R] M) := Function.surjective_id - haveI : LieModule.IsNilpotent L M := h M hnp + have : LieModule.IsNilpotent L M := h M hnp apply hf.lieModuleIsNilpotent _ surj_id aesop @@ -250,7 +250,7 @@ theorem LieAlgebra.isEngelian_of_isNoetherian [IsNoetherian R L] : LieAlgebra.Is LieSubalgebra.mem_toSubmodule] exact LieSubalgebra.lie_mem K x.prop HX exact nontrivial_max_triv_of_isNilpotent R K (L' ⧸ K.toLieSubmodule) - haveI _i5 : IsNoetherian R L' := by + have _i5 : IsNoetherian R L' := by refine isNoetherian_of_surjective (LieHom.rangeRestrict (toEnd R L M)).toLinearMap ?_ simp only [LinearMap.range_eq_top] exact LieHom.surjective_rangeRestrict (toEnd R L M) diff --git a/Mathlib/Algebra/Lie/Extension.lean b/Mathlib/Algebra/Lie/Extension.lean index 54f1fa462d7f6a..a8476d586df5d1 100644 --- a/Mathlib/Algebra/Lie/Extension.lean +++ b/Mathlib/Algebra/Lie/Extension.lean @@ -355,7 +355,7 @@ one extension. -/ lemma lieModuleOf [IsLieAbelian M] (E : Extension R M L) : letI := E.ringModuleOf LieModule R L M := by - letI := E.ringModuleOf + let := E.ringModuleOf set h := E.proj_surjective.hasRightInverse exact { smul_lie r x m := by diff --git a/Mathlib/Algebra/Lie/Loop.lean b/Mathlib/Algebra/Lie/Loop.lean index 52d448747dc5b4..2b9b690e70e189 100644 --- a/Mathlib/Algebra/Lie/Loop.lean +++ b/Mathlib/Algebra/Lie/Loop.lean @@ -122,7 +122,7 @@ def twoCochainOfBilinear [CommRing A] [IsAddTorsionFree R] [Algebra A R] val := (residuePairing R A L Φ).compr₂ (TrivialLieModule.equiv R (loopAlgebra R A L) R).symm property := by refine Cohomology.mem_twoCochain_iff.mpr fun f ↦ ?_ - letI F := toFinsupp R A L + let F := toFinsupp R A L suffices ((F f).sum fun a v ↦ a • Φ (F f (-a)) v) = 0 by simpa classical set s := (F f).support ∪ (F f).support.image (Equiv.neg A) with hs diff --git a/Mathlib/Algebra/Module/PID.lean b/Mathlib/Algebra/Module/PID.lean index afc20225a1d2ba..499a385da36705 100644 --- a/Mathlib/Algebra/Module/PID.lean +++ b/Mathlib/Algebra/Module/PID.lean @@ -95,7 +95,7 @@ theorem Submodule.exists_isInternal_prime_power_torsion_of_pid [Module.Finite R · exact Finset.fintypeCoeSort _ · rintro ⟨p, hp⟩ have hP := prime_of_factor p (Multiset.mem_toFinset.mp hp) - haveI := Ideal.isPrime_of_prime hP + have := Ideal.isPrime_of_prime hP exact (IsPrincipal.prime_generator_of_isPrime p hP.ne_zero).irreducible namespace Module @@ -177,7 +177,7 @@ theorem torsion_by_prime_power_decomposition (hM : Module.IsTorsion' M (Submonoi | zero => use finZeroElim rw [Set.range_eq_empty, Submodule.span_empty] at hs - haveI : Unique M := + have : Unique M := ⟨⟨0⟩, fun x => by dsimp; rw [← Submodule.mem_bot R, hs]; exact Submodule.mem_top⟩ exact ⟨0⟩ | succ d IH => diff --git a/Mathlib/Algebra/Module/SnakeLemma.lean b/Mathlib/Algebra/Module/SnakeLemma.lean index 7c694eb66871e1..bb7a8776f1f85d 100644 --- a/Mathlib/Algebra/Module/SnakeLemma.lean +++ b/Mathlib/Algebra/Module/SnakeLemma.lean @@ -151,8 +151,8 @@ such that `f₂` is surjective with a (set-theoretic) section `σ`, `g₁` is in lemma SnakeLemma.exact_δ_right (F : K₂ →ₗ[R] K₃) (hF : f₂.comp ι₂ = ι₃.comp F) (h : Injective ι₃) : Exact F (δ i₁ i₂ i₃ f₁ f₂ hf g₁ g₂ hg h₁ h₂ σ hσ ρ hρ ι₃ hι₃ π₁ hπ₁) := by - haveI H₁ : ∀ x, f₂ (σ x) = x := congr_fun hσ - haveI H₂ := δ_aux i₂ i₃ f₂ g₁ g₂ hg h₂ σ hσ ρ hρ ι₃ hι₃ + have H₁ : ∀ x, f₂ (σ x) = x := congr_fun hσ + have H₂ := δ_aux i₂ i₃ f₂ g₁ g₂ hg h₂ σ hσ ρ hρ ι₃ hι₃ intro x constructor · intro H @@ -189,7 +189,7 @@ such that `f₂` is surjective with a (set-theoretic) section `σ`, `g₁` is in -/ lemma SnakeLemma.exact_δ_left (G : C₁ →ₗ[R] C₂) (hF : G.comp π₁ = π₂.comp g₁) (h : Surjective π₁) : Exact (δ i₁ i₂ i₃ f₁ f₂ hf g₁ g₂ hg h₁ h₂ σ hσ ρ hρ ι₃ hι₃ π₁ hπ₁) G := by - haveI H₂ := δ_aux i₂ i₃ f₂ g₁ g₂ hg h₂ σ hσ ρ hρ ι₃ hι₃ + have H₂ := δ_aux i₂ i₃ f₂ g₁ g₂ hg h₂ σ hσ ρ hρ ι₃ hι₃ intro x constructor · intro H diff --git a/Mathlib/Algebra/Module/SpanRank.lean b/Mathlib/Algebra/Module/SpanRank.lean index b987823c938eba..757379deaad90d 100644 --- a/Mathlib/Algebra/Module/SpanRank.lean +++ b/Mathlib/Algebra/Module/SpanRank.lean @@ -433,7 +433,7 @@ lemma Module.Basis.mk_eq_spanRank [RankCondition R] {ι : Type*} (v : Basis ι R theorem Submodule.rank_eq_spanRank_of_free [Module.Free R M] [StrongRankCondition R] : Module.rank R M = (⊤ : Submodule R M).spanRank := by - haveI := nontrivial_of_invariantBasisNumber R + have := nontrivial_of_invariantBasisNumber R obtain ⟨I, B⟩ := ‹Module.Free R M› rw [← Basis.mk_eq_rank'' B, ← Basis.mk_eq_spanRank B, ← Cardinal.lift_id #(Set.range B), Cardinal.mk_range_eq_of_injective B.injective, Cardinal.lift_id _] diff --git a/Mathlib/Algebra/Module/Submodule/Lattice.lean b/Mathlib/Algebra/Module/Submodule/Lattice.lean index 8f2375d8309044..1b5678a24211e4 100644 --- a/Mathlib/Algebra/Module/Submodule/Lattice.lean +++ b/Mathlib/Algebra/Module/Submodule/Lattice.lean @@ -222,7 +222,7 @@ theorem coe_sInf (P : Set (Submodule R M)) : (↑(sInf P) : Set M) = ⋂ p ∈ P @[simp] theorem coe_finsetInf {ι} (s : Finset ι) (p : ι → Submodule R M) : (↑(s.inf p) : Set M) = ⋂ i ∈ s, ↑(p i) := by - letI := Classical.decEq ι + let := Classical.decEq ι refine s.induction_on ?_ fun i s _ ih ↦ ?_ · simp · rw [Finset.inf_insert, coe_inf, ih] diff --git a/Mathlib/Algebra/Module/Torsion/Basic.lean b/Mathlib/Algebra/Module/Torsion/Basic.lean index 6719c23989257c..5ec9aad55261ff 100644 --- a/Mathlib/Algebra/Module/Torsion/Basic.lean +++ b/Mathlib/Algebra/Module/Torsion/Basic.lean @@ -808,7 +808,7 @@ theorem _root_.Submodule.annihilator_top_inter_nonZeroDivisors [Module.Finite R refine ⟨_, ?_, (∏ x ∈ S, (@hM x).choose : R⁰).prop⟩ rw [Submonoid.coe_finsetProd, SetLike.mem_coe, ← hS, mem_annihilator_span] intro n - letI := Classical.decEq M + let := Classical.decEq M rw [← Finset.prod_erase_mul _ _ n.prop, mul_smul, ← Submonoid.smul_def, (@hM n).choose_spec, smul_zero] diff --git a/Mathlib/Algebra/Module/TransferInstance.lean b/Mathlib/Algebra/Module/TransferInstance.lean index 9913582e578408..f3e43ed03f1560 100644 --- a/Mathlib/Algebra/Module/TransferInstance.lean +++ b/Mathlib/Algebra/Module/TransferInstance.lean @@ -94,7 +94,7 @@ lemma LinearEquiv.isScalarTower [Module R α] [Module R β] [IsScalarTower R A (e : α ≃ₗ[R] β) : letI := e.toAddEquiv.module A IsScalarTower R A α := by - letI := e.toAddEquiv.module A + let := e.toAddEquiv.module A constructor intro x y z simp only [Equiv.smul_def, smul_assoc] diff --git a/Mathlib/Algebra/Module/ZLattice/Basic.lean b/Mathlib/Algebra/Module/ZLattice/Basic.lean index a7546316ed9cbe..cac18e0e8dd386 100644 --- a/Mathlib/Algebra/Module/ZLattice/Basic.lean +++ b/Mathlib/Algebra/Module/ZLattice/Basic.lean @@ -339,7 +339,7 @@ theorem setFinite_inter [ProperSpace E] [Finite ι] {s : Set E} (hs : Bornology. theorem fundamentalDomain_measurableSet [MeasurableSpace E] [OpensMeasurableSpace E] [Finite ι] : MeasurableSet (fundamentalDomain b) := by cases nonempty_fintype ι - haveI : FiniteDimensional ℝ E := b.finiteDimensional_of_finite + have : FiniteDimensional ℝ E := b.finiteDimensional_of_finite let D : Set (ι → ℝ) := Set.pi Set.univ fun _ : ι => Set.Ico (0 : ℝ) 1 rw [(_ : fundamentalDomain b = b.equivFun.toLinearMap ⁻¹' D)] · refine measurableSet_preimage (LinearMap.continuous_of_finiteDimensional _).measurable ?_ diff --git a/Mathlib/Algebra/Notation/Indicator.lean b/Mathlib/Algebra/Notation/Indicator.lean index 9b4f555409ac5d..ba7178798403bd 100644 --- a/Mathlib/Algebra/Notation/Indicator.lean +++ b/Mathlib/Algebra/Notation/Indicator.lean @@ -203,7 +203,7 @@ lemma mulIndicator_inter_mulSupport (s : Set α) (f : α → M) : @[to_additive] lemma comp_mulIndicator (h : M → β) (f : α → M) {s : Set α} {x : α} [DecidablePred (· ∈ s)] : h (s.mulIndicator f x) = s.piecewise (h ∘ f) (const α (h 1)) x := by - letI := Classical.decPred (· ∈ s) + let := Classical.decPred (· ∈ s) convert! s.apply_piecewise f (const α 1) (fun _ => h) (x := x) using 2 @[to_additive] diff --git a/Mathlib/Algebra/Order/Group/Unbundled/Abs.lean b/Mathlib/Algebra/Order/Group/Unbundled/Abs.lean index b8bef6562b9299..e45ec70e41eee1 100644 --- a/Mathlib/Algebra/Order/Group/Unbundled/Abs.lean +++ b/Mathlib/Algebra/Order/Group/Unbundled/Abs.lean @@ -159,7 +159,7 @@ lemma inf_sq_eq_mul_div_mabs_div (a b : α) : (a ⊓ b) ^ 2 = a * b / |b / a|ₘ @[to_additive] lemma mabs_div_sup_mul_mabs_div_inf (a b c : α) : |(a ⊔ c) / (b ⊔ c)|ₘ * |(a ⊓ c) / (b ⊓ c)|ₘ = |a / b|ₘ := by - letI : DistribLattice α := CommGroup.toDistribLattice α + let : DistribLattice α := CommGroup.toDistribLattice α calc |(a ⊔ c) / (b ⊔ c)|ₘ * |(a ⊓ c) / (b ⊓ c)|ₘ = (b ⊔ c ⊔ (a ⊔ c)) / ((b ⊔ c) ⊓ (a ⊔ c)) * |(a ⊓ c) / (b ⊓ c)|ₘ := by diff --git a/Mathlib/Algebra/Order/Monoid/Unbundled/Basic.lean b/Mathlib/Algebra/Order/Monoid/Unbundled/Basic.lean index 7b4f64e055890f..ebf96411e49c3a 100644 --- a/Mathlib/Algebra/Order/Monoid/Unbundled/Basic.lean +++ b/Mathlib/Algebra/Order/Monoid/Unbundled/Basic.lean @@ -292,8 +292,8 @@ alias mul_right_cancel'' := mul_right_cancel @[to_additive] lemma mul_le_mul_iff_of_ge [MulLeftStrictMono α] [MulRightStrictMono α] {a₁ a₂ b₁ b₂ : α} (ha : a₁ ≤ a₂) (hb : b₁ ≤ b₂) : a₂ * b₂ ≤ a₁ * b₁ ↔ a₁ = a₂ ∧ b₁ = b₂ := by - haveI := mulLeftMono_of_mulLeftStrictMono α - haveI := mulRightMono_of_mulRightStrictMono α + have := mulLeftMono_of_mulLeftStrictMono α + have := mulRightMono_of_mulRightStrictMono α refine ⟨fun h ↦ ?_, by rintro ⟨rfl, rfl⟩; rfl⟩ simp only [eq_iff_le_not_lt, ha, hb, true_and] refine ⟨fun ha ↦ h.not_gt ?_, fun hb ↦ h.not_gt ?_⟩ @@ -302,8 +302,8 @@ alias mul_right_cancel'' := mul_right_cancel @[to_additive] theorem mul_eq_mul_iff_eq_and_eq [MulLeftStrictMono α] [MulRightStrictMono α] {a b c d : α} (hac : a ≤ c) (hbd : b ≤ d) : a * b = c * d ↔ a = c ∧ b = d := by - haveI := mulLeftMono_of_mulLeftStrictMono α - haveI := mulRightMono_of_mulRightStrictMono α + have := mulLeftMono_of_mulLeftStrictMono α + have := mulRightMono_of_mulRightStrictMono α rw [le_antisymm_iff, eq_true (mul_le_mul' hac hbd), true_and, mul_le_mul_iff_of_ge hac hbd] @[to_additive] diff --git a/Mathlib/Algebra/Polynomial/Degree/Operations.lean b/Mathlib/Algebra/Polynomial/Degree/Operations.lean index 47254f2cbeae4d..470a8b06b11dbe 100644 --- a/Mathlib/Algebra/Polynomial/Degree/Operations.lean +++ b/Mathlib/Algebra/Polynomial/Degree/Operations.lean @@ -470,7 +470,7 @@ theorem degree_smul_of_isRightRegular_leadingCoeff (ha : a ≠ 0) exact hp.mul_right_eq_zero_iff.ne.mpr ha theorem degree_lt_degree_mul_X (hp : p ≠ 0) : p.degree < (p * X).degree := by - haveI := Nontrivial.of_polynomial_ne hp + have := Nontrivial.of_polynomial_ne hp have : leadingCoeff p * leadingCoeff X ≠ 0 := by simpa rw [degree_mul' this, degree_eq_natDegree hp, degree_X, ← Nat.cast_one, ← Nat.cast_add] norm_cast diff --git a/Mathlib/Algebra/Polynomial/Div.lean b/Mathlib/Algebra/Polynomial/Div.lean index 7ee00bdddb3f4f..b9d85f8880e297 100644 --- a/Mathlib/Algebra/Polynomial/Div.lean +++ b/Mathlib/Algebra/Polynomial/Div.lean @@ -174,7 +174,7 @@ theorem natDegree_modByMonic_lt (p : R[X]) {q : R[X]} (hmq : Monic q) (hq : q · rw [hpq, natDegree_zero, Nat.pos_iff_ne_zero] contrapose hq exact eq_one_of_monic_natDegree_zero hmq hq - · haveI := Nontrivial.of_polynomial_ne hpq + · have := Nontrivial.of_polynomial_ne hpq exact natDegree_lt_natDegree hpq (degree_modByMonic_lt p hmq) @[simp] @@ -189,7 +189,7 @@ theorem zero_divByMonic (p : R[X]) : 0 /ₘ p = 0 := by theorem modByMonic_zero (p : R[X]) : p %ₘ 0 = p := letI := Classical.decEq R if h : Monic (0 : R[X]) then by - haveI := monic_zero_iff_subsingleton.mp h + have := monic_zero_iff_subsingleton.mp h simp [eq_iff_true_of_subsingleton] else by unfold modByMonic divModByMonicAux; rw [dif_neg h] @@ -197,7 +197,7 @@ theorem modByMonic_zero (p : R[X]) : p %ₘ 0 = p := theorem divByMonic_zero (p : R[X]) : p /ₘ 0 = 0 := letI := Classical.decEq R if h : Monic (0 : R[X]) then by - haveI := monic_zero_iff_subsingleton.mp h + have := monic_zero_iff_subsingleton.mp h simp [eq_iff_true_of_subsingleton] else by unfold divByMonic divModByMonicAux; rw [dif_neg h] @@ -301,7 +301,7 @@ theorem degree_divByMonic_le (p q : R[X]) : degree (p /ₘ q) ≤ degree p := else if hq : Monic q then if h : degree q ≤ degree p then by - haveI := Nontrivial.of_polynomial_ne hp0 + have := Nontrivial.of_polynomial_ne hp0 rw [← degree_add_divByMonic hq h, degree_eq_natDegree hq.ne_zero, degree_eq_natDegree (mt (divByMonic_eq_zero_iff hq).1 (not_lt.2 h))] exact WithBot.coe_le_coe.2 (Nat.le_add_left _ _) @@ -315,11 +315,11 @@ theorem degree_divByMonic_lt (p q : R[X]) (hp0 : p ≠ 0) letI := Classical.decEq R if hq : q.Monic then if hpq : degree p < degree q then by - haveI := Nontrivial.of_polynomial_ne hp0 + have := Nontrivial.of_polynomial_ne hp0 rw [(divByMonic_eq_zero_iff hq).2 hpq, degree_eq_natDegree hp0] exact WithBot.bot_lt_coe _ else by - haveI := Nontrivial.of_polynomial_ne hp0 + have := Nontrivial.of_polynomial_ne hp0 rw [← degree_add_divByMonic hq (not_lt.1 hpq), degree_eq_natDegree hq.ne_zero, degree_eq_natDegree (mt (divByMonic_eq_zero_iff hq).1 hpq)] exact @@ -375,7 +375,7 @@ theorem div_modByMonic_unique {f g} (q r : R[X]) (hg : Monic g) theorem map_mod_divByMonic [Ring S] (f : R →+* S) (hq : Monic q) : (p /ₘ q).map f = p.map f /ₘ q.map f ∧ (p %ₘ q).map f = p.map f %ₘ q.map f := by nontriviality S - haveI : Nontrivial R := f.domain_nontrivial + have : Nontrivial R := f.domain_nontrivial have : map f p /ₘ map f q = map f (p /ₘ q) ∧ map f p %ₘ map f q = map f (p %ₘ q) := div_modByMonic_unique ((p /ₘ q).map f) _ (hq.map f) ⟨Eq.symm <| by rw [← Polynomial.map_mul, ← Polynomial.map_add, modByMonic_add_div], @@ -487,7 +487,7 @@ variable (R) in theorem not_isField : ¬IsField R[X] := by nontriviality R intro h - letI := h.toField + let := h.toField simpa using congr_arg natDegree (monic_X.eq_one_of_isUnit <| monic_X (R := R).ne_zero.isUnit) section multiplicity @@ -500,7 +500,7 @@ def decidableDvdMonic [DecidableEq R] (p : R[X]) (hq : Monic q) : Decidable (q decidable_of_iff (p %ₘ q = 0) (modByMonic_eq_zero_iff_dvd hq) theorem finiteMultiplicity_X_sub_C (a : R) (h0 : p ≠ 0) : FiniteMultiplicity (X - C a) p := by - haveI := Nontrivial.of_polynomial_ne h0 + have := Nontrivial.of_polynomial_ne h0 refine finiteMultiplicity_of_degree_pos_of_monic ?_ (monic_X_sub_C _) h0 rw [degree_X_sub_C] decide @@ -652,7 +652,7 @@ theorem rootMultiplicity_pos {p : R[X]} (hp : p ≠ 0) {x : R} : theorem eval_divByMonic_pow_rootMultiplicity_ne_zero {p : R[X]} (a : R) (hp : p ≠ 0) : eval a (p /ₘ (X - C a) ^ rootMultiplicity a p) ≠ 0 := by classical - haveI : Nontrivial R := Nontrivial.of_polynomial_ne hp + have : Nontrivial R := Nontrivial.of_polynomial_ne hp rw [Ne, ← IsRoot, ← dvd_iff_isRoot] rintro ⟨q, hq⟩ have := pow_mul_divByMonic_rootMultiplicity_eq p a diff --git a/Mathlib/Algebra/Polynomial/Expand.lean b/Mathlib/Algebra/Polynomial/Expand.lean index 8f46371e485833..cfc9f72596a0da 100644 --- a/Mathlib/Algebra/Polynomial/Expand.lean +++ b/Mathlib/Algebra/Polynomial/Expand.lean @@ -257,7 +257,7 @@ theorem expand_contract' [NoZeroDivisors R] {f : R[X]} (hf : Polynomial.derivati expand R p (contract p f) = f := by obtain _ | @⟨_, hprime, hchar⟩ := ‹ExpChar R p› · rw [expand_one, contract_one] - · haveI := Fact.mk hchar; exact expand_contract p hf hprime.ne_zero + · have := Fact.mk hchar; exact expand_contract p hf hprime.ne_zero theorem map_frobenius_expand (f : R[X]) : map (frobenius R p) (expand R p f) = f ^ p := by refine f.induction_on' (fun a b ha hb => ?_) fun n a => ?_ diff --git a/Mathlib/Algebra/Polynomial/Inductions.lean b/Mathlib/Algebra/Polynomial/Inductions.lean index 4b7167ad718b36..897336644d5b5d 100644 --- a/Mathlib/Algebra/Polynomial/Inductions.lean +++ b/Mathlib/Algebra/Polynomial/Inductions.lean @@ -106,7 +106,7 @@ theorem divX_C_mul_X_pow : divX (C a * X ^ n) = if n = 0 then 0 else C a * X ^ ( simp only [divX_C_mul, divX_X_pow, mul_ite, mul_zero] theorem degree_divX_lt (hp0 : p ≠ 0) : (divX p).degree < p.degree := by - haveI := Nontrivial.of_polynomial_ne hp0 + have := Nontrivial.of_polynomial_ne hp0 calc degree (divX p) < (divX p * X + C (p.coeff 0)).degree := if h : degree p ≤ 0 then by diff --git a/Mathlib/Algebra/Polynomial/Module/Basic.lean b/Mathlib/Algebra/Polynomial/Module/Basic.lean index 962263ec309547..aa72d371907c63 100644 --- a/Mathlib/Algebra/Polynomial/Module/Basic.lean +++ b/Mathlib/Algebra/Polynomial/Module/Basic.lean @@ -181,7 +181,7 @@ lemma smul_def (f : R[X]) (m : PolynomialModule R M) : instance isScalarTower' (M : Type u) [AddCommGroup M] [Module R M] [Module S M] [IsScalarTower S R M] : IsScalarTower S R[X] (PolynomialModule R M) := by - haveI : IsScalarTower R R[X] (PolynomialModule R M) := + have : IsScalarTower R R[X] (PolynomialModule R M) := inferInstanceAs <| IsScalarTower R R[X] <| Module.AEval' <| (coeffLinearEquiv R R).symm.comp <| (Finsupp.lmapDomain M R Nat.succ).comp (coeffLinearEquiv R R).toLinearMap constructor diff --git a/Mathlib/Algebra/Ring/Subring/Basic.lean b/Mathlib/Algebra/Ring/Subring/Basic.lean index 26fdd10daf025d..7e59b08ac1fbca 100644 --- a/Mathlib/Algebra/Ring/Subring/Basic.lean +++ b/Mathlib/Algebra/Ring/Subring/Basic.lean @@ -774,7 +774,7 @@ theorem coe_iSup_of_directed {ι} [hι : Nonempty ι] {S : ι → Subring R} (hS theorem mem_sSup_of_directedOn {S : Set (Subring R)} (Sne : S.Nonempty) (hS : DirectedOn (· ≤ ·) S) {x : R} : x ∈ sSup S ↔ ∃ s ∈ S, x ∈ s := by - haveI : Nonempty S := Sne.to_subtype + have : Nonempty S := Sne.to_subtype simp only [sSup_eq_iSup', mem_iSup_of_directed hS.directed_val, SetCoe.exists, exists_prop] theorem coe_sSup_of_directedOn {S : Set (Subring R)} (Sne : S.Nonempty) diff --git a/Mathlib/Algebra/Ring/Subsemiring/Basic.lean b/Mathlib/Algebra/Ring/Subsemiring/Basic.lean index 0a393c2b0c391b..7741dffd137f91 100644 --- a/Mathlib/Algebra/Ring/Subsemiring/Basic.lean +++ b/Mathlib/Algebra/Ring/Subsemiring/Basic.lean @@ -692,7 +692,7 @@ theorem coe_iSup_of_directed {ι} [hι : Nonempty ι] {S : ι → Subsemiring R} theorem mem_sSup_of_directedOn {S : Set (Subsemiring R)} (Sne : S.Nonempty) (hS : DirectedOn (· ≤ ·) S) {x : R} : x ∈ sSup S ↔ ∃ s ∈ S, x ∈ s := by - haveI : Nonempty S := Sne.to_subtype + have : Nonempty S := Sne.to_subtype simp only [sSup_eq_iSup', mem_iSup_of_directed hS.directed_val, SetCoe.exists, exists_prop] theorem coe_sSup_of_directedOn {S : Set (Subsemiring R)} (Sne : S.Nonempty) diff --git a/Mathlib/Algebra/Squarefree/Basic.lean b/Mathlib/Algebra/Squarefree/Basic.lean index af8d698b23388d..0730696dc86763 100644 --- a/Mathlib/Algebra/Squarefree/Basic.lean +++ b/Mathlib/Algebra/Squarefree/Basic.lean @@ -270,7 +270,7 @@ theorem squarefree_iff_nodup_normalizedFactors [NormalizationMonoid R] {x : R} (x0 : x ≠ 0) : Squarefree x ↔ Multiset.Nodup (normalizedFactors x) := by classical rw [squarefree_iff_emultiplicity_le_one, Multiset.nodup_iff_count_le_one] - haveI := nontrivial_of_ne x 0 x0 + have := nontrivial_of_ne x 0 x0 constructor <;> intro h a · by_cases hmem : a ∈ normalizedFactors x · have ha := irreducible_of_normalized_factor _ hmem diff --git a/Mathlib/Algebra/TrivSqZeroExt/Basic.lean b/Mathlib/Algebra/TrivSqZeroExt/Basic.lean index d1559a84faf99a..f6a64330b62810 100644 --- a/Mathlib/Algebra/TrivSqZeroExt/Basic.lean +++ b/Mathlib/Algebra/TrivSqZeroExt/Basic.lean @@ -708,7 +708,7 @@ abbrev invertibleFstOfInvertible (x : tsze R M) [Invertible x] : Invertible x.fs mul_invOf_self := by rw [← fst_mul, mul_invOf_self, fst_one] theorem fst_invOf (x : tsze R M) [Invertible x] [Invertible x.fst] : (⅟x).fst = ⅟(x.fst) := by - letI := invertibleFstOfInvertible x + let := invertibleFstOfInvertible x convert! (rfl : _ = ⅟x.fst) theorem mul_left_eq_one (r : R) (x : tsze R M) (h : r * x.fst = 1) : @@ -738,7 +738,7 @@ abbrev invertibleOfInvertibleFst (x : tsze R M) [Invertible x.fst] : Invertible theorem snd_invOf (x : tsze R M) [Invertible x] [Invertible x.fst] : (⅟x).snd = -(⅟x.fst •> x.snd <• ⅟x.fst) := by - letI := invertibleOfInvertibleFst x + let := invertibleOfInvertibleFst x convert! congr_arg (TrivSqZeroExt.snd (R := R) (M := M)) (_ : _ = ⅟x) convert! rfl @@ -796,7 +796,7 @@ protected theorem inv_mul_cancel {x : tsze R M} (hx : fst x ≠ 0) : x⁻¹ * x variable [SMulCommClass R Rᵐᵒᵖ M] @[simp] theorem invOf_eq_inv (x : tsze R M) [Invertible x] : ⅟x = x⁻¹ := by - letI := invertibleFstOfInvertible x + let := invertibleFstOfInvertible x ext <;> simp [fst_invOf, snd_invOf] protected theorem mul_inv_cancel {x : tsze R M} (hx : fst x ≠ 0) : x * x⁻¹ = 1 := by diff --git a/Mathlib/AlgebraicGeometry/AffineScheme.lean b/Mathlib/AlgebraicGeometry/AffineScheme.lean index fb0f92073d1e68..e77c7685f5ec3c 100644 --- a/Mathlib/AlgebraicGeometry/AffineScheme.lean +++ b/Mathlib/AlgebraicGeometry/AffineScheme.lean @@ -229,8 +229,8 @@ instance hasColimits : HasColimits AffineScheme.{u} := Adjunction.has_colimits_of_equivalence.{u} (opOpEquivalence AffineScheme.{u}).inverse instance hasLimits : HasLimits AffineScheme.{u} := by - haveI := Adjunction.has_colimits_of_equivalence Γ.{u} - haveI : HasLimits AffineScheme.{u}ᵒᵖᵒᵖ := Limits.hasLimits_op_of_hasColimits + have := Adjunction.has_colimits_of_equivalence Γ.{u} + have : HasLimits AffineScheme.{u}ᵒᵖᵒᵖ := Limits.hasLimits_op_of_hasColimits exact Adjunction.has_limits_of_equivalence (opOpEquivalence AffineScheme.{u}).inverse noncomputable instance Γ_preservesLimits : PreservesLimits Γ.{u}.rightOp := inferInstance @@ -464,7 +464,7 @@ set_option backward.isDefEq.respectTransparency false in theorem map_fromSpec {V : X.Opens} (hV : IsAffineOpen V) (f : op U ⟶ op V) : Spec.map (X.presheaf.map f) ≫ hU.fromSpec = hV.fromSpec := by have : IsAffine U := hU - haveI : IsAffine _ := hV + have : IsAffine _ := hV conv_rhs => rw [fromSpec, ← X.homOfLE_ι (V := U) f.unop.le, isoSpec_inv, Category.assoc, ← Scheme.isoSpec_inv_naturality_assoc, @@ -685,8 +685,8 @@ lemma appLE_eq_away_map {X Y : Scheme.{u}} (f : X ⟶ Y) {U : Y.Opens} (hU : IsA letI := hV.isLocalization_basicOpen (f.appLE U V e r) f.appLE (Y.basicOpen r) (X.basicOpen (f.appLE U V e r)) (by simp [Scheme.Hom.appLE]) = CommRingCat.ofHom (IsLocalization.Away.map _ _ (f.appLE U V e).hom r) := by - letI := hU.isLocalization_basicOpen r - letI := hV.isLocalization_basicOpen (f.appLE U V e r) + let := hU.isLocalization_basicOpen r + let := hV.isLocalization_basicOpen (f.appLE U V e r) ext : 1 apply IsLocalization.ringHom_ext (.powers r) rw [IsLocalization.Away.map, CommRingCat.hom_ofHom, IsLocalization.map_comp, @@ -702,8 +702,8 @@ lemma app_basicOpen_eq_away_map {X Y : Scheme.{u}} (f : X ⟶ Y) {U : Y.Opens} (CommRingCat.ofHom (IsLocalization.Away.map Γ(Y, Y.basicOpen r) Γ(X, X.basicOpen (f.app U r)) (f.app U).hom r) ≫ X.presheaf.map (eqToHom (by simp)).op) := by - haveI := hU.isLocalization_basicOpen r - haveI := h.isLocalization_basicOpen (f.app U r) + have := hU.isLocalization_basicOpen r + have := h.isLocalization_basicOpen (f.app U r) ext : 1 apply IsLocalization.ringHom_ext (.powers r) rw [IsLocalization.Away.map, CommRingCat.hom_comp, RingHom.comp_assoc, CommRingCat.hom_ofHom, @@ -831,7 +831,7 @@ lemma stalkMap_injective (f : X ⟶ Y) {U : Opens Y} (hU : IsAffineOpen U) (x : (h : ∀ g, f.stalkMap x (Y.presheaf.germ U (f x) hx g) = 0 → Y.presheaf.germ U (f x) hx g = 0) : Function.Injective (f.stalkMap x) := by - letI := Y.presheaf.algebra_section_stalk ⟨f x, hx⟩ + let := Y.presheaf.algebra_section_stalk ⟨f x, hx⟩ apply (hU.isLocalization_stalk ⟨f x, hx⟩).injective_of_map_algebraMap_zero exact h @@ -839,7 +839,7 @@ include hU in lemma mem_ideal_iff {s : Γ(X, U)} {I : Ideal Γ(X, U)} : s ∈ I ↔ ∀ (x : X) (h : x ∈ U), X.presheaf.germ U x h s ∈ I.map (X.presheaf.germ U x h).hom := by refine ⟨fun hs x hxU ↦ Ideal.mem_map_of_mem _ hs, fun H ↦ ?_⟩ - letI (x : _) : Algebra Γ(X, U) (X.presheaf.stalk (hU.fromSpec x)) := + let (x : _) : Algebra Γ(X, U) (X.presheaf.stalk (hU.fromSpec x)) := TopCat.Presheaf.algebra_section_stalk X.presheaf _ have (P : Ideal Γ(X, U)) [hP : P.IsPrime] : IsLocalization.AtPrime _ P := hU.isLocalization_stalk' ⟨P, hP⟩ (hU.isoSpec.inv _).2 diff --git a/Mathlib/AlgebraicGeometry/AffineTransitionLimit.lean b/Mathlib/AlgebraicGeometry/AffineTransitionLimit.lean index 0bfee543aed3b0..40adc99197af29 100644 --- a/Mathlib/AlgebraicGeometry/AffineTransitionLimit.lean +++ b/Mathlib/AlgebraicGeometry/AffineTransitionLimit.lean @@ -122,12 +122,12 @@ lemma exists_mem_of_isClosed_of_nonempty map_id _ := by simp [← cancel_mono (subschemeι _)] map_comp _ _ := by simp [← cancel_mono (subschemeι _)] } let ι : D' ⟶ D := { app i := subschemeι _, naturality _ _ _ := by simp [D'] } - haveI {i j} (f : i ⟶ j) : IsAffineHom (D'.map f) := by + have {i j} (f : i ⟶ j) : IsAffineHom (D'.map f) := by suffices IsAffineHom (D'.map f ≫ ι.app j) from .of_comp _ (ι.app j) simp only [subschemeMap_subschemeι, D', ι] infer_instance - haveI _ (i) : Nonempty (D'.obj i) := Set.nonempty_coe_sort.mpr (hZne i) - haveI _ (i) : CompactSpace (D'.obj i) := isCompact_iff_compactSpace.mp (hZcpt i) + have _ (i) : Nonempty (D'.obj i) := Set.nonempty_coe_sort.mpr (hZne i) + have _ (i) : CompactSpace (D'.obj i) := isCompact_iff_compactSpace.mp (hZcpt i) let c' : Cone D' := { pt := (⨆ i, (vanishingIdeal ⟨Z i, hZc i⟩).comap (c.π.app i)).subscheme π := diff --git a/Mathlib/AlgebraicGeometry/ColimitsOver.lean b/Mathlib/AlgebraicGeometry/ColimitsOver.lean index 583a137e8bbe08..644a9c6e82f97a 100644 --- a/Mathlib/AlgebraicGeometry/ColimitsOver.lean +++ b/Mathlib/AlgebraicGeometry/ColimitsOver.lean @@ -259,7 +259,7 @@ def isColimitGluedCocone : IsColimit d.gluedCocone := by rw [reassoc_of% this] simp · intro s a - letI 𝒲 (a : J) : (D.obj a).left.OpenCover := 𝒰.pullback₁ (D.obj a).hom + let 𝒲 (a : J) : (D.obj a).left.OpenCover := 𝒰.pullback₁ (D.obj a).hom ext refine (𝒲 a).hom_ext _ _ fun i ↦ ?_ dsimp diff --git a/Mathlib/AlgebraicGeometry/EllipticCurve/IsomOfJ.lean b/Mathlib/AlgebraicGeometry/EllipticCurve/IsomOfJ.lean index f183afc8eca54e..5ef4ba3b118a6a 100644 --- a/Mathlib/AlgebraicGeometry/EllipticCurve/IsomOfJ.lean +++ b/Mathlib/AlgebraicGeometry/EllipticCurve/IsomOfJ.lean @@ -60,7 +60,7 @@ private lemma exists_variableChange_of_char_two_of_j_eq_zero rw [E.coe_Δ', Δ_of_isCharTwoJEqZeroNF_of_char_two, pow_ne_zero_iff (Nat.succ_ne_zero _)] at ha₃ have ha₃' := E'.Δ'.ne_zero rw [E'.coe_Δ', Δ_of_isCharTwoJEqZeroNF_of_char_two, pow_ne_zero_iff (Nat.succ_ne_zero _)] at ha₃' - haveI : NeZero (3 : F) := NeZero.mk <| by + have : NeZero (3 : F) := NeZero.mk <| by rw [show (3 : F) = 1 by linear_combination CharP.cast_eq_zero F 2] exact one_ne_zero obtain ⟨u, hu⟩ := IsSepClosed.exists_pow_nat_eq (E.a₃ / E'.a₃) 3 @@ -126,7 +126,7 @@ private lemma exists_variableChange_of_char_three_of_j_ne_zero rw [E'.coe_Δ', Δ_of_isCharThreeJNeZeroNF_of_char_three, mul_ne_zero_iff, neg_ne_zero, pow_ne_zero_iff three_ne_zero] at h obtain ⟨ha₂', ha₆'⟩ := h - haveI : NeZero (2 : F) := NeZero.mk <| by + have : NeZero (2 : F) := NeZero.mk <| by rw [show (2 : F) = -1 by linear_combination CharP.cast_eq_zero F 3, neg_ne_zero] exact one_ne_zero obtain ⟨u, hu⟩ := IsSepClosed.exists_pow_nat_eq (E.a₂ / E'.a₂) 2 @@ -158,7 +158,7 @@ private lemma exists_variableChange_of_char_three_of_j_eq_zero rw [E.coe_Δ', Δ_of_isShortNF_of_char_three, neg_ne_zero, pow_ne_zero_iff three_ne_zero] at ha₄ have ha₄' := E'.Δ'.ne_zero rw [E'.coe_Δ', Δ_of_isShortNF_of_char_three, neg_ne_zero, pow_ne_zero_iff three_ne_zero] at ha₄' - haveI : NeZero (4 : F) := NeZero.mk <| by + have : NeZero (4 : F) := NeZero.mk <| by rw [show (4 : F) = 1 by linear_combination CharP.cast_eq_zero F 3] exact one_ne_zero obtain ⟨u, hu⟩ := IsSepClosed.exists_pow_nat_eq (E.a₄ / E'.a₄) 4 @@ -213,17 +213,17 @@ private lemma exists_variableChange_of_char_ne_two_or_three ∃ C : VariableChange F, C • E = E' := by replace hchar2 : (2 : F) ≠ 0 := CharP.cast_ne_zero_of_ne_of_prime F Nat.prime_two hchar2 replace hchar3 : (3 : F) ≠ 0 := CharP.cast_ne_zero_of_ne_of_prime F Nat.prime_three hchar3 - haveI := NeZero.mk hchar2 - haveI : NeZero (4 : F) := NeZero.mk <| by + have := NeZero.mk hchar2 + have : NeZero (4 : F) := NeZero.mk <| by have := pow_ne_zero 2 hchar2 norm_num1 at this exact this - haveI : NeZero (6 : F) := NeZero.mk <| by + have : NeZero (6 : F) := NeZero.mk <| by have := mul_ne_zero hchar2 hchar3 norm_num1 at this exact this - letI : Invertible (2 : F) := invertibleOfNonzero hchar2 - letI : Invertible (3 : F) := invertibleOfNonzero hchar3 + let : Invertible (2 : F) := invertibleOfNonzero hchar2 + let : Invertible (3 : F) := invertibleOfNonzero hchar3 wlog _ : E.IsShortNF generalizing E · obtain ⟨C, hE⟩ := E.exists_variableChange_isShortNF rw [← variableChange_j E C] at heq @@ -237,7 +237,7 @@ private lemma exists_variableChange_of_char_ne_two_or_three simp_rw [j, Units.val_inv_eq_inv_val, inv_mul_eq_div, div_eq_div_iff E.Δ'.ne_zero E'.Δ'.ne_zero, coe_Δ', Δ_of_isShortNF, c₄_of_isShortNF] at heq replace heq : E.a₄ ^ 3 * E'.a₆ ^ 2 = E'.a₄ ^ 3 * E.a₆ ^ 2 := by - letI : Invertible (47775744 : F) := invertibleOfNonzero <| by + let : Invertible (47775744 : F) := invertibleOfNonzero <| by have := mul_ne_zero (pow_ne_zero 16 hchar2) (pow_ne_zero 6 hchar3) norm_num1 at this exact this diff --git a/Mathlib/AlgebraicGeometry/EllipticCurve/NormalForms.lean b/Mathlib/AlgebraicGeometry/EllipticCurve/NormalForms.lean index 294a9ebfcb05d9..8187a52e0f7046 100644 --- a/Mathlib/AlgebraicGeometry/EllipticCurve/NormalForms.lean +++ b/Mathlib/AlgebraicGeometry/EllipticCurve/NormalForms.lean @@ -400,7 +400,7 @@ lemma toShortNFOfCharThree_a₂ : (W.toShortNFOfCharThree • W).a₂ = W.b₂ : theorem toShortNFOfCharThree_spec (hb₂ : W.b₂ = 0) : (W.toShortNFOfCharThree • W).IsShortNF := by have h : (2 : R) * 2 = 1 := by linear_combination CharP.cast_eq_zero R 3 - letI : Invertible (2 : R) := ⟨2, h, h⟩ + let : Invertible (2 : R) := ⟨2, h, h⟩ have H := W.toCharNeTwoNF_spec exact ⟨H.a₁, hb₂ ▸ W.toShortNFOfCharThree_a₂, H.a₃⟩ @@ -419,10 +419,10 @@ def toCharThreeNF : VariableChange F := theorem toCharThreeNF_spec_of_b₂_ne_zero (hb₂ : W.b₂ ≠ 0) : (W.toCharThreeNF • W).IsCharThreeJNeZeroNF := by have h : (2 : F) * 2 = 1 := by linear_combination CharP.cast_eq_zero F 3 - letI : Invertible (2 : F) := ⟨2, h, h⟩ + let : Invertible (2 : F) := ⟨2, h, h⟩ rw [toCharThreeNF, mul_smul] set W' := W.toShortNFOfCharThree • W - haveI : W'.IsCharNeTwoNF := W.toCharNeTwoNF_spec + have : W'.IsCharNeTwoNF := W.toCharNeTwoNF_spec constructor · simp [variableChange_a₁] · simp [variableChange_a₃] @@ -436,9 +436,9 @@ theorem toCharThreeNF_spec_of_b₂_eq_zero (hb₂ : W.b₂ = 0) : (W.toCharThree instance toCharThreeNF_spec : (W.toCharThreeNF • W).IsCharThreeNF := by by_cases hb₂ : W.b₂ = 0 - · haveI := W.toCharThreeNF_spec_of_b₂_eq_zero hb₂ + · have := W.toCharThreeNF_spec_of_b₂_eq_zero hb₂ infer_instance - · haveI := W.toCharThreeNF_spec_of_b₂_ne_zero hb₂ + · have := W.toCharThreeNF_spec_of_b₂_ne_zero hb₂ infer_instance theorem exists_variableChange_isCharThreeNF : ∃ C : VariableChange F, (C • W).IsCharThreeNF := @@ -686,10 +686,10 @@ def toCharTwoNF [DecidableEq F] : VariableChange F := instance toCharTwoNF_spec [DecidableEq F] : (W.toCharTwoNF • W).IsCharTwoNF := by by_cases ha₁ : W.a₁ = 0 · rw [toCharTwoNF, dif_pos ha₁] - haveI := W.toCharTwoJEqZeroNF_spec ha₁ + have := W.toCharTwoJEqZeroNF_spec ha₁ infer_instance · rw [toCharTwoNF, dif_neg ha₁] - haveI := W.toCharTwoJNeZeroNF_spec ha₁ + have := W.toCharTwoJNeZeroNF_spec ha₁ infer_instance theorem exists_variableChange_isCharTwoNF : ∃ C : VariableChange F, (C • W).IsCharTwoNF := by diff --git a/Mathlib/AlgebraicGeometry/FunctionField.lean b/Mathlib/AlgebraicGeometry/FunctionField.lean index 0c18e17f26aaf6..a5179e3e7b3c1b 100644 --- a/Mathlib/AlgebraicGeometry/FunctionField.lean +++ b/Mathlib/AlgebraicGeometry/FunctionField.lean @@ -59,7 +59,7 @@ theorem germ_injective_of_isIntegral [IsIntegral X] {U : X.Opens} (x : X) (hx : rw [← (X.presheaf.germ U x hx).hom.map_zero] at hy obtain ⟨W, hW, iU, iV, e⟩ := X.presheaf.germ_eq _ hx hx _ _ hy cases Subsingleton.elim iU iV - haveI : Nonempty W := ⟨⟨_, hW⟩⟩ + have : Nonempty W := ⟨⟨_, hW⟩⟩ exact map_injective_of_isIntegral X iU e theorem Scheme.germToFunctionField_injective [IsIntegral X] (U : X.Opens) [Nonempty U] : diff --git a/Mathlib/AlgebraicGeometry/IdealSheaf/Basic.lean b/Mathlib/AlgebraicGeometry/IdealSheaf/Basic.lean index c03fc7a53b0c76..7de8d2ec266ecc 100644 --- a/Mathlib/AlgebraicGeometry/IdealSheaf/Basic.lean +++ b/Mathlib/AlgebraicGeometry/IdealSheaf/Basic.lean @@ -577,7 +577,7 @@ noncomputable nonrec def vanishingIdeal (Z : Closeds X) : IdealSheafData X := (Spec.map (X.presheaf.map (homOfLE _).op) x) ?_ rwa [Set.mem_preimage, ← Scheme.Hom.comp_apply, IsAffineOpen.map_fromSpec _ (X.affineBasicOpen f).2] - · letI : Algebra Γ(X, U) Γ(X, X.affineBasicOpen f) := F.hom.toAlgebra + · let : Algebra Γ(X, U) Γ(X, X.affineBasicOpen f) := F.hom.toAlgebra have : IsLocalization.Away f Γ(X, X.basicOpen f) := U.2.isLocalization_of_eq_basicOpen _ _ rfl intro x hx diff --git a/Mathlib/AlgebraicGeometry/IdealSheaf/Subscheme.lean b/Mathlib/AlgebraicGeometry/IdealSheaf/Subscheme.lean index d767fc855ecdee..275e08d6618fed 100644 --- a/Mathlib/AlgebraicGeometry/IdealSheaf/Subscheme.lean +++ b/Mathlib/AlgebraicGeometry/IdealSheaf/Subscheme.lean @@ -110,8 +110,8 @@ lemma isLocalization_away {U V : X.affineOpens} (h : U ≤ V) (f : Γ(X, V.1)) (hU : U = X.affineBasicOpen f) : letI := (Ideal.quotientMap _ _ (I.ideal_le_comap_ideal h)).toAlgebra IsLocalization.Away (Ideal.Quotient.mk (I.ideal V) f) (Γ(X, U) ⧸ (I.ideal U)) := by - letI := (Ideal.quotientMap _ _ (I.ideal_le_comap_ideal h)).toAlgebra - letI := (X.presheaf.map (homOfLE (X := X.Opens) h).op).hom.toAlgebra + let := (Ideal.quotientMap _ _ (I.ideal_le_comap_ideal h)).toAlgebra + let := (X.presheaf.map (homOfLE (X := X.Opens) h).op).hom.toAlgebra have : IsLocalization.Away f Γ(X, U) := by subst hU; exact V.2.isLocalization_of_eq_basicOpen _ _ rfl simp only [IsLocalization.Away, ← Submonoid.map_powers] @@ -122,14 +122,14 @@ lemma isLocalization_away {U V : X.affineOpens} instance isOpenImmersion_glueDataObjMap {V : X.affineOpens} (f : Γ(X, V.1)) : IsOpenImmersion (I.glueDataObjMap (X.affineBasicOpen_le f)) := by - letI := (Ideal.quotientMap _ _ (I.ideal_le_comap_ideal (X.affineBasicOpen_le f))).toAlgebra + let := (Ideal.quotientMap _ _ (I.ideal_le_comap_ideal (X.affineBasicOpen_le f))).toAlgebra have := I.isLocalization_away (X.affineBasicOpen_le f) f rfl exact IsOpenImmersion.of_isLocalization (Ideal.Quotient.mk _ f) lemma opensRange_glueDataObjMap {V : X.affineOpens} (f : Γ(X, V.1)) : (I.glueDataObjMap (X.affineBasicOpen_le f)).opensRange = (I.glueDataObjι V) ⁻¹ᵁ (V.1.ι ⁻¹ᵁ X.basicOpen f) := by - letI := (Ideal.quotientMap _ _ (I.ideal_le_comap_ideal (X.affineBasicOpen_le f))).toAlgebra + let := (Ideal.quotientMap _ _ (I.ideal_le_comap_ideal (X.affineBasicOpen_le f))).toAlgebra let f' : Γ(X, V) ⧸ I.ideal V := Ideal.Quotient.mk _ f have := I.isLocalization_away (X.affineBasicOpen_le f) f rfl ext1 diff --git a/Mathlib/AlgebraicGeometry/Limits.lean b/Mathlib/AlgebraicGeometry/Limits.lean index d2058253707e20..1c72fd31fb288e 100644 --- a/Mathlib/AlgebraicGeometry/Limits.lean +++ b/Mathlib/AlgebraicGeometry/Limits.lean @@ -112,7 +112,7 @@ instance (priority := 100) isOpenImmersion_of_isEmpty {X Y : Scheme} (f : X ⟶ instance (priority := 100) isIso_of_isEmpty {X Y : Scheme} (f : X ⟶ Y) [IsEmpty Y] : IsIso f := by - haveI : IsEmpty X := f.base.hom.1.isEmpty + have : IsEmpty X := f.base.hom.1.isEmpty have : Epi f.base := by rw [TopCat.epi_iff_surjective]; rintro (x : Y) exact isEmptyElim x @@ -546,7 +546,7 @@ lemma isIso_stalkMap_coprodSpec (x) : rw [← IsIso.comp_inv_eq, Scheme.Hom.stalkMap_congr_hom _ (Spec.map _) (coprodSpec_inl R S)] at this rw [coprodMk_inl, ← this] - letI := (RingHom.fst R S).toAlgebra + let := (RingHom.fst R S).toAlgebra have : IsOpenImmersion (Spec.map (CommRingCat.ofHom (RingHom.fst R S))) := IsOpenImmersion.of_isLocalization (1, 0) infer_instance @@ -554,7 +554,7 @@ lemma isIso_stalkMap_coprodSpec (x) : rw [← IsIso.comp_inv_eq, Scheme.Hom.stalkMap_congr_hom _ (Spec.map _) (coprodSpec_inr R S)] at this rw [coprodMk_inr, ← this] - letI := (RingHom.snd R S).toAlgebra + let := (RingHom.snd R S).toAlgebra have : IsOpenImmersion (Spec.map (CommRingCat.ofHom (RingHom.snd R S))) := IsOpenImmersion.of_isLocalization (0, 1) infer_instance @@ -614,7 +614,7 @@ lemma ι_sigmaSpec (R : ι → CommRingCat) (i) : instance (i) (R : ι → Type _) [∀ i, CommRing (R i)] : IsOpenImmersion (Spec.map (CommRingCat.ofHom (Pi.evalRingHom (R ·) i))) := by classical - letI := (Pi.evalRingHom R i).toAlgebra + let := (Pi.evalRingHom R i).toAlgebra have : IsLocalization.Away (Function.update (β := R) 0 i 1) (R i) := by apply IsLocalization.away_of_isIdempotentElem_of_mul · ext j; by_cases h : j = i <;> aesop diff --git a/Mathlib/AlgebraicGeometry/Modules/Tilde.lean b/Mathlib/AlgebraicGeometry/Modules/Tilde.lean index d32e5611a85a5b..f63ea0d48789dd 100644 --- a/Mathlib/AlgebraicGeometry/Modules/Tilde.lean +++ b/Mathlib/AlgebraicGeometry/Modules/Tilde.lean @@ -67,12 +67,12 @@ def SpecModulesToSheafFullyFaithful : (modulesSpecToSheaf (R := R)).FullyFaithfu congr($(f.1.naturality (homOfLE hrU).op).hom x) rw [← this, ← this, M.val.map_smul] generalize (Spec R).ringCatSheaf.obj.map (homOfLE hrU).op t = t - letI := Module.compHom (R := Γ(Spec R, basicOpen r)) Γ(M, basicOpen r) + let := Module.compHom (R := Γ(Spec R, basicOpen r)) Γ(M, basicOpen r) (algebraMap R Γ(Spec R, basicOpen r)) - haveI : IsScalarTower R Γ(Spec R, basicOpen r) Γ(M, basicOpen r) := + have : IsScalarTower R Γ(Spec R, basicOpen r) Γ(M, basicOpen r) := .of_algebraMap_smul fun _ _ ↦ rfl - letI := Module.compHom Γ(N, basicOpen r) (algebraMap R Γ(Spec R, basicOpen r)) - haveI : IsScalarTower R Γ(Spec R, basicOpen r) Γ(N, basicOpen r) := + let := Module.compHom Γ(N, basicOpen r) (algebraMap R Γ(Spec R, basicOpen r)) + have : IsScalarTower R Γ(Spec R, basicOpen r) Γ(N, basicOpen r) := .of_algebraMap_smul fun _ _ ↦ rfl exact (IsLocalization.linearMap_compatibleSMul (.powers (M := R) r) Γ(Spec R, basicOpen r) Γ(M, basicOpen r) Γ(N, basicOpen r)).map_smul @@ -260,7 +260,7 @@ noncomputable def Scheme.Modules.fromTildeΓ (M : (Spec (.of R)).Modules) : simp only [inducedFunctor_obj, Submonoid.powers_le, Submonoid.mem_comap] exact M.isUnit_algebraMap_end_of_le_basicOpen f.unop le_rfl naturality {f g : Rᵒᵖ} i := by - letI N := (modulesSpecToSheaf.obj M).presheaf.obj (.op ⊤) + let N := (modulesSpecToSheaf.obj M).presheaf.obj (.op ⊤) ext1 apply IsLocalizedModule.ext (.powers (M := R) f.unop) (tilde.toOpen _ (PrimeSpectrum.basicOpen (R := R) f.unop)).hom diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Affine.lean b/Mathlib/AlgebraicGeometry/Morphisms/Affine.lean index e2615dd23bd633..3339ee558dc2ef 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Affine.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Affine.lean @@ -171,7 +171,7 @@ instance : HasAffineProperty @IsAffineHom fun X _ _ _ ↦ IsAffine X where instance isAffineHom_isStableUnderBaseChange : MorphismProperty.IsStableUnderBaseChange @IsAffineHom := by apply HasAffineProperty.isStableUnderBaseChange - letI := HasAffineProperty.isLocal_affineProperty + let := HasAffineProperty.isLocal_affineProperty apply AffineTargetMorphismProperty.IsStableUnderBaseChange.mk introv X hX H infer_instance @@ -295,8 +295,8 @@ theorem diagonal_isAffine_iff_forall_isAffineOpen_inf [IsAffine Y] (f : X ⟶ Y) constructor · intro H U V hU hV dsimp at H - haveI : IsAffine _ := hU - haveI : IsAffine _ := hV + have : IsAffine _ := hU + have : IsAffine _ := hV let g : pullback U.ι V.ι ⟶ X := pullback.fst _ _ ≫ U.ι have := IsOpenImmersion.isPullback (X.homOfLE inf_le_left) (X.homOfLE inf_le_right) U.ι V.ι (by simp) (by ext; simp) diff --git a/Mathlib/AlgebraicGeometry/Morphisms/AffineAnd.lean b/Mathlib/AlgebraicGeometry/Morphisms/AffineAnd.lean index 795563aef108b4..a1a71e44c80c3d 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/AffineAnd.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/AffineAnd.lean @@ -82,7 +82,7 @@ lemma affineAnd_isLocal (hPi : RingHom.RespectsIso Q) (hQl : RingHom.Localizatio exact hf of_basicOpenCover {X Y _} f s hs hf := by dsimp [affineAnd] at hf - haveI : IsAffine X := by + have : IsAffine X := by apply isAffine_of_isAffineOpen_basicOpen (f.appTop '' s) · apply_fun Ideal.map (f.appTop).hom at hs rwa [Ideal.map_span, Ideal.map_top] at hs @@ -109,7 +109,7 @@ lemma affineAnd_isLocal_of_propertyIsLocal lemma affineAnd_isStableUnderBaseChange (hQi : RingHom.RespectsIso Q) (hQb : RingHom.IsStableUnderBaseChange Q) : (affineAnd Q).IsStableUnderBaseChange := by - haveI : (affineAnd Q).toProperty.RespectsIso := affineAnd_respectsIso hQi + have : (affineAnd Q).toProperty.RespectsIso := affineAnd_respectsIso hQi apply AffineTargetMorphismProperty.IsStableUnderBaseChange.mk intro X Y S _ _ f g ⟨hY, hg⟩ exact ⟨inferInstance, hQb.pullback_fst_appTop _ hQi f _ hg⟩ @@ -143,7 +143,7 @@ set_option backward.isDefEq.respectTransparency false in lemma targetAffineLocally_affineAnd_iff_affineLocally (hQ : RingHom.PropertyIsLocal Q) {X Y : Scheme.{u}} (f : X ⟶ Y) : targetAffineLocally (affineAnd Q) f ↔ IsAffineHom f ∧ affineLocally Q f := by - haveI : HasRingHomProperty (affineLocally Q) Q := ⟨hQ, rfl⟩ + have : HasRingHomProperty (affineLocally Q) Q := ⟨hQ, rfl⟩ rw [targetAffineLocally_affineAnd_iff' hQ.respectsIso] simp only [and_congr_right_iff] intro hf diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Basic.lean b/Mathlib/AlgebraicGeometry/Morphisms/Basic.lean index 466c4f3dba1f9d..caf16cd0d2b9e6 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Basic.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Basic.lean @@ -465,7 +465,7 @@ instance (P : AffineTargetMorphismProperty) [P.toProperty.RespectsIso] : exact H U · introv H rintro ⟨U, hU : IsAffineOpen U⟩; dsimp - haveI : IsAffine _ := hU.preimage_of_isIso e.hom + have : IsAffine _ := hU.preimage_of_isIso e.hom rw [morphismRestrict_comp, P.cancel_right_of_respectsIso] exact H ⟨(Opens.map e.hom.base).obj U, hU.preimage_of_isIso e.hom⟩ @@ -527,7 +527,7 @@ theorem restrict (hf : P f) (U : Y.affineOpens) : of_isPullback (isPullback_morphismRestrict f U).flip hf instance (priority := 900) : P.RespectsIso := by - letI := isLocal_affineProperty P + let := isLocal_affineProperty P rw [eq_targetAffineLocally P] infer_instance @@ -535,7 +535,7 @@ theorem of_iSup_eq_top {ι} (U : ι → Y.affineOpens) (hU : ⨆ i, (U i : Y.Opens) = ⊤) (hU' : ∀ i, Q (f ∣_ U i)) : P f := by - letI := isLocal_affineProperty P + let := isLocal_affineProperty P rw [eq_targetAffineLocally P] classical intro V @@ -568,14 +568,14 @@ theorem of_openCover theorem iff_of_openCover (𝒰 : Y.OpenCover) [∀ i, IsAffine (𝒰.X i)] : P f ↔ ∀ i, Q (𝒰.pullbackHom f i) := by - letI := isLocal_affineProperty P + let := isLocal_affineProperty P rw [iff_of_iSup_eq_top (P := P) (fun i ↦ ⟨_, isAffineOpen_opensRange _⟩) 𝒰.iSup_opensRange] exact forall_congr' fun i ↦ Q.arrow_mk_iso_iff (morphismRestrictOpensRange f _) theorem iff_of_isAffine [IsAffine Y] : P f ↔ Q f := by - letI := isLocal_affineProperty P + let := isLocal_affineProperty P rw [iff_of_openCover (P := P) (Scheme.coverOfIsIso.{0} (𝟙 Y))] trans Q (pullback.snd f (𝟙 _)) · exact ⟨fun H => H PUnit.unit, fun H _ => H⟩ @@ -584,7 +584,7 @@ theorem iff_of_isAffine [IsAffine Y] : P f ↔ Q f := by set_option backward.isDefEq.respectTransparency false in instance (priority := 900) : IsZariskiLocalAtTarget P := by - letI := isLocal_affineProperty P + let := isLocal_affineProperty P apply IsZariskiLocalAtTarget.mk' · rw [eq_targetAffineLocally P] intro X Y f U H V @@ -612,7 +612,7 @@ set_option backward.isDefEq.respectTransparency false in private theorem pullback_fst_of_right (hP' : Q.IsStableUnderBaseChange) {X Y S : Scheme} (f : X ⟶ S) (g : Y ⟶ S) [IsAffine S] (H : Q g) : P (pullback.fst f g) := by - letI := isLocal_affineProperty P + let := isLocal_affineProperty P rw [iff_of_openCover (P := P) X.affineCover] intro i let e := pullbackSymmetry _ _ ≪≫ pullbackRightPullbackFstIso f g (X.affineCover.f i) @@ -641,7 +641,7 @@ theorem isStableUnderBaseChange (hP' : Q.IsStableUnderBaseChange) : simp [e] rw [← this, P.cancel_left_of_respectsIso] apply HasAffineProperty.pullback_fst_of_right hP' - letI := isLocal_affineProperty P + let := isLocal_affineProperty P rw [← pullbackSymmetry_hom_comp_snd, Q.cancel_left_of_respectsIso] apply of_isPullback (.of_hasPullback _ _) H) diff --git a/Mathlib/AlgebraicGeometry/Morphisms/ClosedImmersion.lean b/Mathlib/AlgebraicGeometry/Morphisms/ClosedImmersion.lean index 87d9a352ed1bba..611c7195607cc3 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/ClosedImmersion.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/ClosedImmersion.lean @@ -100,7 +100,7 @@ theorem spec_of_surjective {R S : CommRingCat} (f : R ⟶ S) (h : Function.Surje IsClosedImmersion (Spec.map f) where isClosedEmbedding := PrimeSpectrum.isClosedEmbedding_comap_of_surjective _ _ h stalkMap_surjective x := by - haveI : (RingHom.toMorphismProperty (fun f ↦ Function.Surjective f)).RespectsIso := by + have : (RingHom.toMorphismProperty (fun f ↦ Function.Surjective f)).RespectsIso := by rw [← RingHom.toMorphismProperty_respectsIso_iff] exact RingHom.surjective_respectsIso apply (MorphismProperty.arrow_mk_iso_iff @@ -370,7 +370,7 @@ lemma Scheme.Hom.app_surjective (f : X ⟶ Y) (U : Y.Opens) (hU : IsAffineOpen U instance IsClosedImmersion.isStableUnderBaseChange : MorphismProperty.IsStableUnderBaseChange @IsClosedImmersion := by apply HasAffineProperty.isStableUnderBaseChange - haveI := HasAffineProperty.isLocal_affineProperty @IsClosedImmersion + have := HasAffineProperty.isLocal_affineProperty @IsClosedImmersion apply AffineTargetMorphismProperty.IsStableUnderBaseChange.mk intro X Y S _ _ f g ⟨ha, hsurj⟩ exact ⟨inferInstance, RingHom.surjective_isStableUnderBaseChange.pullback_fst_appTop _ diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Constructors.lean b/Mathlib/AlgebraicGeometry/Morphisms/Constructors.lean index 211e8505231f67..c04919f3ce1fe3 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Constructors.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Constructors.lean @@ -72,7 +72,7 @@ theorem HasAffineProperty.diagonal_of_openCover (P) {Q} [HasAffineProperty P Q] (h𝒰' : ∀ i j k, Q (pullback.mapDesc ((𝒰' i).f j) ((𝒰' i).f k) (𝒰.pullbackHom f i))) : P.diagonal f := by - letI := isLocal_affineProperty P + let := isLocal_affineProperty P let 𝒱 := (Scheme.Pullback.openCoverOfBase 𝒰 f f).bind fun i => Scheme.Pullback.openCoverOfLeftRight.{u} (𝒰' i) (𝒰' i) (pullback.snd _ _) (pullback.snd _ _) have i1 : ∀ i, IsAffine (𝒱.X i) := fun i => by dsimp [𝒱]; infer_instance @@ -108,7 +108,7 @@ theorem HasAffineProperty.diagonal_of_diagonal_of_isPullback [IsAffine U] [IsOpenImmersion g] {iV : V ⟶ X} {f' : V ⟶ U} (h : IsPullback iV f' f g) (H : P.diagonal f) : Q.diagonal f' := by - letI := isLocal_affineProperty P + let := isLocal_affineProperty P rw [← Q.diagonal.cancel_left_of_respectsIso h.isoPullback.inv, h.isoPullback_inv_snd] rintro U V f₁ f₂ hU hV hf₁ hf₂ @@ -122,7 +122,7 @@ set_option backward.defeqAttrib.useBackward true in theorem HasAffineProperty.diagonal_iff (P) {Q} [HasAffineProperty P Q] {X Y : Scheme.{u}} {f : X ⟶ Y} [IsAffine Y] : Q.diagonal f ↔ P.diagonal f := by - letI := isLocal_affineProperty P + let := isLocal_affineProperty P refine ⟨fun hf ↦ ?_, diagonal_of_diagonal_of_isPullback P .of_id_fst⟩ rw [← Q.diagonal.cancel_left_of_respectsIso (pullback.fst (f := f) (g := 𝟙 Y)), pullback.condition, Category.comp_id] at hf @@ -175,7 +175,7 @@ instance (P) {Q} [HasAffineProperty P Q] : HasAffineProperty P.diagonal Q.diagon isLocal_affineProperty := letI := HasAffineProperty.isLocal_affineProperty P; inferInstance eq_targetAffineLocally' := by ext X Y f - letI := HasAffineProperty.isLocal_affineProperty P + let := HasAffineProperty.isLocal_affineProperty P constructor · exact fun H U ↦ HasAffineProperty.diagonal_of_diagonal_of_isPullback P (isPullback_morphismRestrict f U).flip H @@ -374,7 +374,7 @@ lemma stalkwiseIsZariskiLocalAtTarget_of_respectsIso (hP : RingHom.RespectsIso P IsZariskiLocalAtTarget (stalkwise P) := by have hP' : (RingHom.toMorphismProperty P).RespectsIso := RingHom.toMorphismProperty_respectsIso_iff.mp hP - letI := stalkwise_respectsIso hP + let := stalkwise_respectsIso hP apply IsZariskiLocalAtTarget.mk' · intro X Y f U hf x apply ((RingHom.toMorphismProperty P).arrow_mk_iso_iff <| @@ -389,7 +389,7 @@ set_option backward.isDefEq.respectTransparency false in /-- If `P` respects isos, then `stalkwise P` is local at the source. -/ lemma stalkwise_isZariskiLocalAtSource_of_respectsIso (hP : RingHom.RespectsIso P) : IsZariskiLocalAtSource (stalkwise P) := by - letI := stalkwise_respectsIso hP + let := stalkwise_respectsIso hP apply IsZariskiLocalAtSource.mk' · intro X Y f U hf x rw [Scheme.Hom.stalkMap_comp, CommRingCat.hom_comp, hP.cancel_right_isIso] diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Finite.lean b/Mathlib/AlgebraicGeometry/Morphisms/Finite.lean index e57a1ed93c8f18..5c22386c082a28 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Finite.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Finite.lean @@ -185,8 +185,8 @@ lemma isFinite_iff_locallyOfFiniteType_of_jacobsonSpace obtain ⟨φ, rfl⟩ := Spec.map_surjective f rw [IsFinite.SpecMap_iff, HasRingHomProperty.Spec_iff (P := @LocallyOfFiniteType)] have := (PrimeSpectrum.t1Space_iff_isField (R := R)).mp (show T1Space (Spec R) by infer_instance) - letI := this.toField - letI := φ.hom.toAlgebra + let := this.toField + let := φ.hom.toAlgebra have := PrimeSpectrum.isJacobsonRing_iff_jacobsonSpace.mpr ‹_› change Module.Finite _ _ ↔ Algebra.FiniteType _ _ exact ⟨fun _ ↦ inferInstance, fun _ ↦ finite_of_finite_type_of_isJacobsonRing _ _⟩ diff --git a/Mathlib/AlgebraicGeometry/Morphisms/FormallyUnramified.lean b/Mathlib/AlgebraicGeometry/Morphisms/FormallyUnramified.lean index 49fe5adb97ebef..e946dfff6dcb03 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/FormallyUnramified.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/FormallyUnramified.lean @@ -240,7 +240,7 @@ protected lemma of_hom_ext (f : X ⟶ Y) (_ : Spec.map φ ≫ g₁ = Spec.map φ ≫ g₂) (_ : g₁ ≫ f = g₂ ≫ f), g₁ = g₂) : FormallyUnramified f := by refine ⟨fun {U hU V hV hVU} ↦ ?_⟩ - letI := (f.appLE U V hVU).hom.toAlgebra + let := (f.appLE U V hVU).hom.toAlgebra refine Algebra.FormallyUnramified.iff_comp_injective.mpr fun R _ _ I hI g₁ g₂ hg₁g₂ ↦ ?_ have hg₁ : f.appLE U V hVU ≫ CommRingCat.ofHom g₁ = CommRingCat.ofHom (algebraMap _ R) := CommRingCat.hom_ext g₁.comp_algebraMap diff --git a/Mathlib/AlgebraicGeometry/Morphisms/OpenImmersion.lean b/Mathlib/AlgebraicGeometry/Morphisms/OpenImmersion.lean index 8779719cf080a2..501572d427a8dd 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/OpenImmersion.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/OpenImmersion.lean @@ -59,7 +59,7 @@ lemma isOpenImmersion_SpecMap_iff_of_surjective {R S : CommRingCat} ← RingHom.ker_eq_comap_bot] simp [φ] · rintro ⟨e, he, he'⟩ - letI := f.hom.toAlgebra + let := f.hom.toAlgebra have : IsLocalization.Away (1 - e) S := IsLocalization.away_of_isIdempotentElem he.one_sub (by simpa using! he') hf exact IsOpenImmersion.of_isLocalization (1 - e) diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Proper.lean b/Mathlib/AlgebraicGeometry/Morphisms/Proper.lean index 5baa0b7f663642..615fdaa507af14 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Proper.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Proper.lean @@ -157,9 +157,9 @@ theorem finite_appTop_of_universallyClosed (f : X ⟶ (Spec <| .of K)) have x : X := Nonempty.some inferInstance obtain ⟨_, ⟨U, hU, rfl⟩, hxU, -⟩ := X.isBasis_affineOpens.exists_subset_of_mem_open (Set.mem_univ x) isOpen_univ - letI := ((Scheme.ΓSpecIso (.of K)).commRingCatIsoToRingEquiv.toMulEquiv.isField + let := ((Scheme.ΓSpecIso (.of K)).commRingCatIsoToRingEquiv.toMulEquiv.isField (Field.toIsField K)).toField - letI := (isField_of_universallyClosed K f).toField + let := (isField_of_universallyClosed K f).toField have : Nonempty U := ⟨⟨x, hxU⟩⟩ apply RingHom.finite_of_algHom_finiteType_of_isJacobsonRing (A := Γ(X, U)) (g := (X.presheaf.map (homOfLE le_top).op).hom) diff --git a/Mathlib/AlgebraicGeometry/Morphisms/QuasiCompact.lean b/Mathlib/AlgebraicGeometry/Morphisms/QuasiCompact.lean index 26d5fefa8013e3..52850472c76fda 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/QuasiCompact.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/QuasiCompact.lean @@ -111,7 +111,7 @@ theorem isCompact_basicOpen (X : Scheme) {U : X.Opens} (hU : IsCompact (U : Set let g : s → X.affineOpens := fun V ↦ ⟨V.1 ⊓ X.basicOpen f, by rw [← X.basicOpen_res _ (homOfLE ((le_iSup₂ V.1 V.2).trans_eq e.symm)).op] exact V.1.2.basicOpen _⟩ - haveI : Finite s := hs.to_subtype + have : Finite s := hs.to_subtype refine ⟨Set.range g, Set.finite_range g, ?_⟩ rw [iSup_range, ← iSup_inf_eq, iSup_subtype, ← e, inf_eq_right.mpr (X.basicOpen_le f)] @@ -163,7 +163,7 @@ set_option backward.defeqAttrib.useBackward true in set_option backward.isDefEq.respectTransparency false in instance quasiCompact_isStableUnderBaseChange : MorphismProperty.IsStableUnderBaseChange @QuasiCompact := by - letI := HasAffineProperty.isLocal_affineProperty @QuasiCompact + let := HasAffineProperty.isLocal_affineProperty @QuasiCompact apply HasAffineProperty.isStableUnderBaseChange apply AffineTargetMorphismProperty.IsStableUnderBaseChange.mk intro X Y S _ _ f g h @@ -274,7 +274,7 @@ theorem exists_pow_mul_eq_zero_of_res_basicOpen_eq_zero_of_isCompact (X : Scheme · rw [map_zero] · simp only [Scheme.basicOpen_res, inf_le_right] choose n hn using H' - haveI := hs.to_subtype + have := hs.to_subtype cases nonempty_fintype s use Finset.univ.sup n suffices ∀ i : s, X.presheaf.map (homOfLE (h₁ i)).op (f ^ Finset.univ.sup n * x) = 0 by diff --git a/Mathlib/AlgebraicGeometry/Morphisms/QuasiSeparated.lean b/Mathlib/AlgebraicGeometry/Morphisms/QuasiSeparated.lean index b4af43fadb9d62..f590788e7494fa 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/QuasiSeparated.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/QuasiSeparated.lean @@ -174,7 +174,7 @@ theorem Scheme.quasiSeparatedSpace_of_isOpenCover {I : Type*} (U : I → X.Opens) (hU : IsOpenCover U) (hU₁ : ∀ i, IsAffineOpen (U i)) (hU₂ : ∀ i j, IsCompact (X := X) (U i ∩ U j)) : QuasiSeparatedSpace X := by - letI := HasAffineProperty.isLocal_affineProperty @QuasiCompact + let := HasAffineProperty.isLocal_affineProperty @QuasiCompact rw [← quasiCompact_affineProperty_iff_quasiSeparatedSpace X.toSpecΓ] have : ∀ i, IsAffine ((X.openCoverOfIsOpenCover U hU).X i) := hU₁ refine AffineTargetMorphismProperty.diagonal_of_openCover_source _ @@ -337,7 +337,7 @@ theorem exists_eq_pow_mul_of_isCompact_of_isQuasiSeparated (X : Scheme.{u}) (U : ⟨hSU _ _ Set.subset_union_left S.2 hS Set.subset_union_right U.1.2 U.2.isCompact, (S ⊓ U.1).2⟩ - haveI := hs'.to_subtype + have := hs'.to_subtype cases nonempty_fintype s replace hs : S ⊓ U.1 = iSup fun i : s => (i : X.Opens) := by ext1; simpa using hs have hs₁ (i : s) : i.1.1 ≤ S := by diff --git a/Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean b/Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean index 942a7ce2461eaa..496276ab0b9e2d 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/RingHomProperties.lean @@ -206,9 +206,9 @@ lemma exists_basicOpen_le_appLE_of_appLE_of_isAffine have hxa : x ∈ X.basicOpen (f.appLE U₂ V₂ e₂ r') := by simpa [Scheme.Hom.appLE, ← Scheme.preimage_basicOpen] using And.intro hx₂ (hBrr' ▸ hBfx) obtain ⟨s, s', hBss', hBx⟩ := exists_basicOpen_le_affine_inter V₁.2 ha x ⟨hx₁, hxa⟩ - haveI := V₂.2.isLocalization_basicOpen (f.appLE U₂ V₂ e₂ r') - haveI := U₂.2.isLocalization_basicOpen r' - haveI := ha.isLocalization_basicOpen s' + have := V₂.2.isLocalization_basicOpen (f.appLE U₂ V₂ e₂ r') + have := U₂.2.isLocalization_basicOpen r' + have := ha.isLocalization_basicOpen s' have ers : X.basicOpen s ≤ f ⁻¹ᵁ Y.basicOpen r := by rw [hBss', hBrr'] apply le_trans (X.basicOpen_le _) @@ -541,7 +541,7 @@ set_option backward.isDefEq.respectTransparency false in lemma isStableUnderBaseChange (hP : RingHom.IsStableUnderBaseChange Q) : P.IsStableUnderBaseChange := by apply HasAffineProperty.isStableUnderBaseChange - letI := HasAffineProperty.isLocal_affineProperty P + let := HasAffineProperty.isLocal_affineProperty P apply AffineTargetMorphismProperty.IsStableUnderBaseChange.mk intro X Y S _ _ f g H rw [← HasAffineProperty.iff_of_isAffine (P := P)] at H ⊢ @@ -633,12 +633,12 @@ lemma iff_exists_appLE_locally obtain ⟨r, hr, hrs⟩ := this refine ⟨⟨U, hU⟩, ⟨X.basicOpen r, hV.basicOpen r⟩, hrs, (X.basicOpen_le r).trans e, ?_⟩ rw [← f.appLE_map e (homOfLE (X.basicOpen_le r)).op] - haveI : IsLocalization.Away r Γ(X, X.basicOpen r) := hV.isLocalization_basicOpen r + have : IsLocalization.Away r Γ(X, X.basicOpen r) := hV.isLocalization_basicOpen r exact hfs r hr _ · obtain ⟨U, V, hxV, e, hf⟩ := hf x use U, V, hxV, e simp only [iff_of_isAffine (P := P), Scheme.Hom.appLE, homOfLE_leOfHom] at hf ⊢ - haveI : (toMorphismProperty (Locally Q)).RespectsIso := toMorphismProperty_respectsIso_iff.mp <| + have : (toMorphismProperty (Locally Q)).RespectsIso := toMorphismProperty_respectsIso_iff.mp <| (isLocal_ringHomProperty P).respectsIso exact (MorphismProperty.arrow_mk_iso_iff (toMorphismProperty (Locally Q)) (arrowResLEAppIso f U V e)).mpr (locally_of hQi _ hf) @@ -648,8 +648,8 @@ lemma iff_exists_appLE (hQ : StableUnderCompositionWithLocalizationAwaySource Q) : P f ↔ ∀ (x : X), ∃ (U : Y.affineOpens) (V : X.affineOpens) (_ : x ∈ V.1) (e : V.1 ≤ f ⁻¹ᵁ U.1), Q (f.appLE U V e).hom := by - haveI inst : HasRingHomProperty P Q := inferInstance - haveI : HasRingHomProperty P (Locally Q) := by + have inst : HasRingHomProperty P Q := inferInstance + have : HasRingHomProperty P (Locally Q) := by apply @copy (P := P) (P' := P) (Q := Q) (Q' := Locally Q) · infer_instance · rfl @@ -657,7 +657,7 @@ lemma iff_exists_appLE exact (locally_iff_of_localizationSpanTarget (isLocal_ringHomProperty P).respectsIso (isLocal_ringHomProperty P).ofLocalizationSpanTarget _).symm rw [iff_exists_appLE_locally (P := P) hQ] - haveI : HasRingHomProperty P Q := inst + have : HasRingHomProperty P Q := inst apply (isLocal_ringHomProperty P (Q := Q)).respectsIso omit [HasRingHomProperty P Q] in @@ -668,7 +668,7 @@ lemma locally_of_iff (hQl : LocalizationAwayPreserves Q) Q (f.appLE U V e).hom) : HasRingHomProperty P (Locally Q) where isLocal_ringHomProperty := locally_propertyIsLocal hQl hQa eq_affineLocally' := by - haveI : HasRingHomProperty (affineLocally (Locally Q)) (Locally Q) := + have : HasRingHomProperty (affineLocally (Locally Q)) (Locally Q) := ⟨locally_propertyIsLocal hQl hQa, rfl⟩ ext X Y f rw [h, iff_exists_appLE_locally (P := affineLocally (Locally Q)) hQa.left hQa.respectsIso] diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Separated.lean b/Mathlib/AlgebraicGeometry/Morphisms/Separated.lean index 853b0ae33aa695..ec6d7babd6592f 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Separated.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Separated.lean @@ -101,7 +101,7 @@ instance (f : X ⟶ Y) (U : X.Opens) (V : Y.Opens) (e) [IsSeparated f] : instance (R S : CommRingCat.{u}) (f : R ⟶ S) : IsSeparated (Spec.map f) := by constructor - letI := f.hom.toAlgebra + let := f.hom.toAlgebra change IsClosedImmersion (Limits.pullback.diagonal (Spec.map (CommRingCat.ofHom (algebraMap R S)))) rw [diagonal_SpecMap, MorphismProperty.cancel_right_of_respectsIso @IsClosedImmersion] diff --git a/Mathlib/AlgebraicGeometry/Morphisms/Smooth.lean b/Mathlib/AlgebraicGeometry/Morphisms/Smooth.lean index c2148914765695..e20cdadb21aa32 100644 --- a/Mathlib/AlgebraicGeometry/Morphisms/Smooth.lean +++ b/Mathlib/AlgebraicGeometry/Morphisms/Smooth.lean @@ -220,7 +220,7 @@ instance smoothOfRelativeDimension_comp {Z : Scheme.{u}} (g : Y ⟶ Z) g.appLE_map_assoc, Scheme.Hom.appLE_comp_appLE] refine ⟨U₂, hU₂, X.basicOpen s, hV₁'.basicOpen s, hx₁, e, heq ▸ ?_⟩ apply IsStandardSmoothOfRelativeDimension.comp ?_ hf₂ - haveI : IsLocalization.Away r Γ(Y, Y.basicOpen r) := hV₂.isLocalization_basicOpen r + have : IsLocalization.Away r Γ(Y, Y.basicOpen r) := hV₂.isLocalization_basicOpen r exact (isStandardSmoothOfRelativeDimension_stableUnderCompositionWithLocalizationAway n).left _ r _ hf₁ @@ -246,7 +246,7 @@ lemma formallySmooth_stalkMap_iff {f : X ⟶ Y} {x : X} (U : Y.Opens) letI := (f.appLE U V hVU).hom.toAlgebra (f.stalkMap x).hom.FormallySmooth ↔ hV.primeIdealOf ⟨x, hx⟩ ∈ Algebra.smoothLocus Γ(Y, U) Γ(X, V) := by - letI := (f.appLE U V hVU).hom.toAlgebra + let := (f.appLE U V hVU).hom.toAlgebra let p := (hU.primeIdealOf ⟨f x, hVU hx⟩).asIdeal let q := (hV.primeIdealOf ⟨x, hx⟩).asIdeal have : q.LiesOver p := diff --git a/Mathlib/AlgebraicGeometry/Normalization.lean b/Mathlib/AlgebraicGeometry/Normalization.lean index c46bb56d0fbf37..bba3c77eb14d13 100644 --- a/Mathlib/AlgebraicGeometry/Normalization.lean +++ b/Mathlib/AlgebraicGeometry/Normalization.lean @@ -99,7 +99,7 @@ lemma coequifibered_normalizationDiagramMap : (f.isQuasiSeparated_preimage U.2.isQuasiSeparated) (f.app _ r) change IsLocalization.Away ((algebraMap Γ(Y, U.1) (integralClosure Γ(Y, U.1) Γ(X, f ⁻¹ᵁ U.1))) r) (integralClosure Γ(Y, Y.basicOpen r) Γ(X, f ⁻¹ᵁ Y.basicOpen r)) - letI : Algebra ↑Γ(Y, U.1) ↑Γ(X, f ⁻¹ᵁ Y.basicOpen r) := + let : Algebra ↑Γ(Y, U.1) ↑Γ(X, f ⁻¹ᵁ Y.basicOpen r) := (f.appLE _ _ (f.preimage_mono (Y.basicOpen_le _))).hom.toAlgebra have : IsScalarTower Γ(Y, U.1) Γ(X, f ⁻¹ᵁ U.1) Γ(X, f ⁻¹ᵁ Y.basicOpen r) := .of_algebraMap_eq' rfl have : IsScalarTower Γ(Y, U.1) Γ(Y, Y.basicOpen r) Γ(X, f ⁻¹ᵁ Y.basicOpen r) := @@ -204,7 +204,7 @@ instance : IsIntegralHom f.fromNormalization := by rw [← MorphismProperty.cancel_left_of_respectsIso @IsIntegralHom e.inv, ← MorphismProperty.cancel_right_of_respectsIso @IsIntegralHom _ U.2.isoSpec.hom] have : (f.normalizationDiagramMap.app (.op U)).hom.IsIntegral := by - letI := (f.app U).hom.toAlgebra + let := (f.app U).hom.toAlgebra change (algebraMap Γ(Y, U) (integralClosure Γ(Y, U) Γ(X, f ⁻¹ᵁ U))).IsIntegral exact algebraMap_isIntegral_iff.mpr inferInstance convert! IsIntegralHom.SpecMap_iff.mpr this @@ -256,7 +256,7 @@ set_option backward.isDefEq.respectTransparency false in lemma fromNormalization_app {U : Y.Opens} (hU : IsAffineOpen U) : f.fromNormalization.app U = CommRingCat.ofHom (algebraMap _ _) ≫ (f.normalizationObjIso hU).inv := by - letI := (f.app U).hom.toAlgebra + let := (f.app U).hom.toAlgebra have : IsIso (((normalizationOpenCover f).f ⟨U, hU⟩).app (f.fromNormalization ⁻¹ᵁ U)) := Scheme.Hom.isIso_app _ _ (by simp [← fromNormalization_preimage]) have H : ⊤ = ((normalizationOpenCover f).f ⟨U, hU⟩ ≫ fromNormalization f) ⁻¹ᵁ U := by @@ -289,7 +289,7 @@ instance [IsIntegralHom f] : IsIso f.toNormalization := by Hom.opensRange_pullbackFst, ← f.fromNormalization_preimage, ← Scheme.Hom.comp_preimage]) rw [← MorphismProperty.cancel_left_of_respectsIso (.isomorphisms _) (e ≪≫ (U.2.preimage f).isoSpec).inv] - letI := (f.app U.1).hom.toAlgebra + let := (f.app U.1).hom.toAlgebra convert_to! IsIso (Spec.map (CommRingCat.ofHom (integralClosure Γ(Y, U.1) Γ(X, f ⁻¹ᵁ U.1)).val.toRingHom)) · rw [← cancel_mono (f.normalizationOpenCover.f U), ← cancel_epi (U.2.preimage f).isoSpec.hom] @@ -400,7 +400,7 @@ lemma toNormalization_normalizationDesc (H : f = f₁ ≫ f₂) : f.toNormalization ≫ f.normalizationDesc f₁ f₂ H = f₁ := by refine Scheme.Cover.hom_ext (X.openCoverOfIsOpenCover _ (.comap (iSup_affineOpens_eq_top Y) f.base.hom)) _ _ fun U ↦ ?_ - letI := (f.app U.1).hom.toAlgebra + let := (f.app U.1).hom.toAlgebra refine (Scheme.Hom.ι_toNormalization_assoc ..).trans ?_ dsimp [normalizationOpenCover, normalizationDesc] simp only [colimit.ι_desc, ← Spec.map_comp_assoc] diff --git a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Basic.lean b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Basic.lean index b3d1dc0389c669..2d3a1472a40f32 100644 --- a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Basic.lean +++ b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Basic.lean @@ -310,8 +310,8 @@ lemma awayι_preimage_basicOpen : (pullbackAwayιIso 𝒜 f_deg hm g_deg hm' rfl).inv.homeomorph.surjective), ← opensRange_awayι _ _ g_deg hm'] simp [IsOpenImmersion.range_pullbackFst] - · letI := (awayMap (f := f) 𝒜 g_deg rfl).toAlgebra - letI := HomogeneousLocalization.Away.isLocalization_mul f_deg g_deg rfl hm.ne' + · let := (awayMap (f := f) 𝒜 g_deg rfl).toAlgebra + let := HomogeneousLocalization.Away.isLocalization_mul f_deg g_deg rfl hm.ne' exact PrimeSpectrum.localization_away_comap_range _ _ open TopologicalSpace.Opens in diff --git a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Proper.lean b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Proper.lean index 10c2bdfa34cc70..421865fdbc6e94 100644 --- a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Proper.lean +++ b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Proper.lean @@ -218,7 +218,7 @@ theorem valuativeCriterion_existence_aux simp only [ψ, map_pow, pow_eq_zero_iff', map_eq_zero, ne_eq] at this have : φ 1 = 0 := by convert! (this j).1; ext; simp simp only [map_one, one_ne_zero] at this - letI := (awayMap 𝒜 (f := x j) (hxdi i₀) rfl).toAlgebra + let := (awayMap 𝒜 (f := x j) (hxdi i₀) rfl).toAlgebra have := Away.isLocalization_mul (hxdi j) (hxdi i₀) rfl (hdi _).ne' have hunit : IsUnit (φ (Away.isLocalizationElem (hxdi j) (hxdi i₀))) := isUnit_iff_ne_zero.mpr fun rid ↦ hKmax.ne' (.symm (by simpa [ψ, rid, Finset.prod_eq_zero_iff, (hdi _).ne'] using hi1)) diff --git a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean index b56912df297135..b5584e1c408462 100644 --- a/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean +++ b/Mathlib/AlgebraicGeometry/ProjectiveSpectrum/Scheme.lean @@ -725,7 +725,7 @@ lemma isLocalization_atPrime (f) (x : pbo f) {m} (f_deg : f ∈ 𝒜 m) (hm : 0 @IsLocalization (Away 𝒜 f) _ ((toSpec 𝒜 f).base x).asIdeal.primeCompl (AtPrime 𝒜 x.1.asHomogeneousIdeal.toIdeal) _ (mapId 𝒜 (Submonoid.powers_le.mpr x.2)).toAlgebra := by - letI : Algebra (Away 𝒜 f) (AtPrime 𝒜 x.1.asHomogeneousIdeal.toIdeal) := + let : Algebra (Away 𝒜 f) (AtPrime 𝒜 x.1.asHomogeneousIdeal.toIdeal) := (mapId 𝒜 (Submonoid.powers_le.mpr x.2)).toAlgebra constructor; constructor · rintro ⟨y, hy⟩ @@ -817,10 +817,10 @@ lemma stalkMap_toSpec (f) (x : pbo f) {m} (f_deg : f ∈ 𝒜 m) (hm : 0 < m) : set_option backward.isDefEq.respectTransparency false in lemma isIso_toSpec (f) {m} (f_deg : f ∈ 𝒜 m) (hm : 0 < m) : IsIso (toSpec 𝒜 f) := by - haveI : IsIso (toSpec 𝒜 f).base := toSpec_base_isIso 𝒜 f_deg hm - haveI _ (x) : IsIso ((toSpec 𝒜 f).stalkMap x) := by + have : IsIso (toSpec 𝒜 f).base := toSpec_base_isIso 𝒜 f_deg hm + have _ (x) : IsIso ((toSpec 𝒜 f).stalkMap x) := by rw [stalkMap_toSpec 𝒜 f x f_deg hm]; infer_instance - haveI : LocallyRingedSpace.IsOpenImmersion (toSpec 𝒜 f) := + have : LocallyRingedSpace.IsOpenImmersion (toSpec 𝒜 f) := LocallyRingedSpace.IsOpenImmersion.of_stalk_iso (toSpec 𝒜 f) (TopCat.homeoOfIso (asIso <| (toSpec 𝒜 f).base)).isOpenEmbedding exact LocallyRingedSpace.IsOpenImmersion.to_iso _ diff --git a/Mathlib/AlgebraicGeometry/Properties.lean b/Mathlib/AlgebraicGeometry/Properties.lean index 6d7e1302696a37..760c2610436a9c 100644 --- a/Mathlib/AlgebraicGeometry/Properties.lean +++ b/Mathlib/AlgebraicGeometry/Properties.lean @@ -192,7 +192,7 @@ theorem eq_zero_of_basicOpen_eq_bot {X : Scheme} [hX : IsReduced X] {U : X.Opens | h₂ X Y f => refine ⟨f ⁻¹ᵁ f.opensRange, f.opensRange, by simp, rfl, ?_⟩ rintro H hX s hs _ ⟨x, rfl⟩ - haveI := isReduced_of_isOpenImmersion f + have := isReduced_of_isOpenImmersion f specialize H (f.app _ s) _ x ⟨x, rfl⟩ · rw [← Scheme.preimage_basicOpen, hs]; ext1; simp [Opens.map] · have H : (X.presheaf.germ _ x _).hom _ = 0 := H @@ -249,10 +249,10 @@ instance (priority := 900) isReduced_of_isIntegral [IsIntegral X] : IsReduced X intro U rcases U.1.eq_empty_or_nonempty with h | h · have : U = ⊥ := SetLike.ext' h - haveI : Subsingleton Γ(X, U) := + have : Subsingleton Γ(X, U) := CommRingCat.subsingleton_of_isTerminal (X.sheaf.isTerminalOfEqEmpty this) infer_instance - · haveI : Nonempty U := by simpa + · have : Nonempty U := by simpa infer_instance instance Scheme.component_nontrivial (X : Scheme.{u}) (U : X.Opens) [Nonempty U] : @@ -267,9 +267,9 @@ instance irreducibleSpace_of_isIntegral [IsIntegral X] : IrreducibleSpace X := b simp_rw [isPreirreducible_iff_isClosed_union_isClosed, not_forall, not_or] at H rcases H with ⟨S, T, hS, hT, h₁, h₂, h₃⟩ rw [Set.not_univ_subset] at h₂ h₃ - haveI : Nonempty (⟨Sᶜ, hS.1⟩ : X.Opens) := ⟨⟨_, h₂.choose_spec⟩⟩ - haveI : Nonempty (⟨Tᶜ, hT.1⟩ : X.Opens) := ⟨⟨_, h₃.choose_spec⟩⟩ - haveI : Nonempty (⟨Sᶜ, hS.1⟩ ⊔ ⟨Tᶜ, hT.1⟩ : X.Opens) := ⟨⟨_, Or.inl h₂.choose_spec⟩⟩ + have : Nonempty (⟨Sᶜ, hS.1⟩ : X.Opens) := ⟨⟨_, h₂.choose_spec⟩⟩ + have : Nonempty (⟨Tᶜ, hT.1⟩ : X.Opens) := ⟨⟨_, h₃.choose_spec⟩⟩ + have : Nonempty (⟨Sᶜ, hS.1⟩ ⊔ ⟨Tᶜ, hT.1⟩ : X.Opens) := ⟨⟨_, Or.inl h₂.choose_spec⟩⟩ let e : Γ(X, _) ≅ CommRingCat.of _ := (X.sheaf.isProductOfDisjoint ⟨_, hS.1⟩ ⟨_, hT.1⟩ ?_).conePointUniqueUpToIso (CommRingCat.prodFanIsLimit _ _) @@ -287,7 +287,7 @@ theorem isIntegral_of_irreducibleSpace_of_isReduced [IsReduced X] [H : Irreducib IsIntegral X := by constructor; · infer_instance intro U hU - haveI := (@LocallyRingedSpace.component_nontrivial X.toLocallyRingedSpace U hU).1 + have := (@LocallyRingedSpace.component_nontrivial X.toLocallyRingedSpace U hU).1 have : NoZeroDivisors (X.toLocallyRingedSpace.toSheafedSpace.toPresheafedSpace.presheaf.obj (op U)) := by refine ⟨fun {a b} e => ?_⟩ diff --git a/Mathlib/AlgebraicGeometry/Pullbacks.lean b/Mathlib/AlgebraicGeometry/Pullbacks.lean index bd40b94c85ad3f..1a38ac3c192834 100644 --- a/Mathlib/AlgebraicGeometry/Pullbacks.lean +++ b/Mathlib/AlgebraicGeometry/Pullbacks.lean @@ -507,7 +507,7 @@ def openCoverOfLeft (𝒰 : OpenCover.{v} X) (f : X ⟶ Z) (g : Y ⟶ Z) : mem₀ := by rw [ofArrows_mem_precoverage_iff] refine ⟨fun x ↦ ?_, fun i ↦ ?_⟩ - · letI 𝒱 := ((gluing 𝒰.ulift f g).openCover.pushforwardIso + · let 𝒱 := ((gluing 𝒰.ulift f g).openCover.pushforwardIso (limit.isoLimitCone ⟨_, gluedIsLimit 𝒰.ulift f g⟩).inv).copy 𝒰.ulift.I₀ (fun i => pullback (𝒰.ulift.f i ≫ f) g) (fun i => pullback.map _ _ _ _ (𝒰.ulift.f i) (𝟙 _) (𝟙 _) (Category.comp_id _) (by simp)) diff --git a/Mathlib/AlgebraicGeometry/Sites/Etale.lean b/Mathlib/AlgebraicGeometry/Sites/Etale.lean index 6bcfcdeea6eb76..357b3376c30b20 100644 --- a/Mathlib/AlgebraicGeometry/Sites/Etale.lean +++ b/Mathlib/AlgebraicGeometry/Sites/Etale.lean @@ -77,7 +77,7 @@ lemma ofArrows_mem_smallEtaleTopology_iff let V : Cover (precoverage @Etale) W.left := Cover.mkOfCovers W.left (fun w ↦ (Z (i w)).left) (fun w ↦ (f (i w)).left) (fun w ↦ ⟨_, _, hz w⟩) inferInstance - letI : Cover.Over X V := + let : Cover.Over X V := { over w := ⟨(Z (i w)).hom⟩ isOver_map w := by cat_disch } have (w : W.left) : Etale (V.X w ↘ X) := (Z (i w)).prop diff --git a/Mathlib/AlgebraicGeometry/Sites/MorphismProperty.lean b/Mathlib/AlgebraicGeometry/Sites/MorphismProperty.lean index bc84f286e65bbc..db8609d3765cc5 100644 --- a/Mathlib/AlgebraicGeometry/Sites/MorphismProperty.lean +++ b/Mathlib/AlgebraicGeometry/Sites/MorphismProperty.lean @@ -50,7 +50,7 @@ lemma IsJointlySurjectivePreserving.exists_preimage_snd_triplet_of_prop (hf : P f) (x : X) (y : Y) (h : f x = g y) : ∃ a : ↑(pullback f g), pullback.snd f g a = y := by let iso := pullbackSymmetry f g - haveI : HasPullback g f := hasPullback_symmetry f g + have : HasPullback g f := hasPullback_symmetry f g obtain ⟨a, ha⟩ := exists_preimage_fst_triplet_of_prop hf y x h.symm use (pullbackSymmetry f g).inv a rwa [← Scheme.Hom.comp_apply, pullbackSymmetry_inv_comp_snd] diff --git a/Mathlib/AlgebraicGeometry/Sites/Small.lean b/Mathlib/AlgebraicGeometry/Sites/Small.lean index 65525c1c014f1d..23bb930657eabd 100644 --- a/Mathlib/AlgebraicGeometry/Sites/Small.lean +++ b/Mathlib/AlgebraicGeometry/Sites/Small.lean @@ -113,8 +113,8 @@ lemma overGrothendieckTopology_eq_toGrothendieck_overPretopology : · intro hR obtain ⟨𝒰, hle⟩ := exists_cover_of_mem_grothendieckTopology hR rw [mem_grothendieckTopology_iff] at hR - letI (i : 𝒰.I₀) : (𝒰.X i).Over S := { hom := 𝒰.f i ≫ X.hom } - letI : 𝒰.Over S := + let (i : 𝒰.I₀) : (𝒰.X i).Over S := { hom := 𝒰.f i ≫ X.hom } + let : 𝒰.Over S := { over := inferInstance isOver_map := fun i ↦ ⟨rfl⟩ } use 𝒰.toPresieveOver, ⟨𝒰, inferInstance, rfl⟩ @@ -249,7 +249,7 @@ lemma mem_toGrothendieck_smallPretopology (X : Q.Over ⊤ S) (R : Sieve X) : mem₀ := by rw [presieve₀_mem_precoverage_iff] refine ⟨fun x ↦ ⟨x, y x, hy x⟩, hP⟩ } - letI : 𝒰.Over S := + let : 𝒰.Over S := { over := fun i ↦ inferInstance isOver_map := fun i ↦ inferInstance } refine ⟨𝒰.toPresieveOverProp fun i ↦ MorphismProperty.Comma.prop _, ?_, ?_⟩ diff --git a/Mathlib/AlgebraicGeometry/SpreadingOut.lean b/Mathlib/AlgebraicGeometry/SpreadingOut.lean index bad1ab4203d0da..e9a6e69c450d7c 100644 --- a/Mathlib/AlgebraicGeometry/SpreadingOut.lean +++ b/Mathlib/AlgebraicGeometry/SpreadingOut.lean @@ -243,16 +243,16 @@ lemma exists_lift_of_germInjective_aux {U : X.Opens} {x : X} (hxU) (e : φRA ≫ φ = φRX ≫ X.presheaf.germ U x hxU) : ∃ (V : X.Opens) (hxV : x ∈ V), V ≤ U ∧ RingHom.range φ.hom ≤ RingHom.range (X.presheaf.germ V x hxV).hom := by - letI := φRA.hom.toAlgebra + let := φRA.hom.toAlgebra obtain ⟨s, hs⟩ := hφRA choose W hxW f hf using fun t ↦ X.presheaf.exists_germ_eq (φ t) have H : x ∈ s.inf W ⊓ U := by rw [← SetLike.mem_coe, TopologicalSpace.Opens.coe_inf, TopologicalSpace.Opens.coe_finset_inf] exact ⟨by simpa using fun x _ ↦ hxW x, hxU⟩ refine ⟨s.inf W ⊓ U, H, inf_le_right, ?_⟩ - letI := φRX.hom.toAlgebra - letI := (φRX ≫ X.presheaf.germ U x hxU).hom.toAlgebra - letI := (φRX ≫ X.presheaf.map (homOfLE (inf_le_right (a := s.inf W))).op).hom.toAlgebra + let := φRX.hom.toAlgebra + let := (φRX ≫ X.presheaf.germ U x hxU).hom.toAlgebra + let := (φRX ≫ X.presheaf.map (homOfLE (inf_le_right (a := s.inf W))).op).hom.toAlgebra let φ' : A →ₐ[R] X.presheaf.stalk x := { φ.hom with commutes' := DFunLike.congr_fun (congr_arg CommRingCat.Hom.hom e) } let ψ : Γ(X, s.inf W ⊓ U) →ₐ[R] X.presheaf.stalk x := diff --git a/Mathlib/AlgebraicGeometry/Stalk.lean b/Mathlib/AlgebraicGeometry/Stalk.lean index 72a527c40f8f2e..d5819c24cc2007 100644 --- a/Mathlib/AlgebraicGeometry/Stalk.lean +++ b/Mathlib/AlgebraicGeometry/Stalk.lean @@ -79,7 +79,7 @@ theorem IsAffineOpen.fromSpecStalk_eq_fromSpecStalk {x : X} (hxU : x ∈ U) : instance IsAffineOpen.fromSpecStalk_isPreimmersion {X : Scheme.{u}} {U : Opens X} (hU : IsAffineOpen U) (x : X) (hx : x ∈ U) : IsPreimmersion (hU.fromSpecStalk hx) := by dsimp [IsAffineOpen.fromSpecStalk] - haveI : IsPreimmersion (Spec.map (X.presheaf.germ U x hx)) := + have : IsPreimmersion (Spec.map (X.presheaf.germ U x hx)) := letI : Algebra Γ(X, U) (X.presheaf.stalk x) := (X.presheaf.germ U x hx).hom.toAlgebra haveI := hU.isLocalization_stalk ⟨x, hx⟩ IsPreimmersion.of_isLocalization (R := Γ(X, U)) (S := X.presheaf.stalk x) diff --git a/Mathlib/AlgebraicGeometry/StructureSheaf.lean b/Mathlib/AlgebraicGeometry/StructureSheaf.lean index 065a8b4d8d8362..72c6d227ac68a8 100644 --- a/Mathlib/AlgebraicGeometry/StructureSheaf.lean +++ b/Mathlib/AlgebraicGeometry/StructureSheaf.lean @@ -985,9 +985,9 @@ set_option backward.isDefEq.respectTransparency false in lemma Localizations.comapFun_mk (y : PrimeSpectrum.Top S) (a : M) (b : (y.comap σ).asIdeal.primeCompl) : Localizations.comapFun f y (.mk a b) = .mk (f a) ⟨σ b.1, b.2⟩ := by - letI := Module.compHom N σ - letI := σ.toAlgebra - haveI : IsScalarTower R S N := .of_algebraMap_smul fun _ _ ↦ rfl + let := Module.compHom N σ + let := σ.toAlgebra + have : IsScalarTower R S N := .of_algebraMap_smul fun _ _ ↦ rfl apply ((Module.End.isUnit_iff _).mp (IsLocalizedModule.map_units (S := y.asIdeal.primeCompl) (LocalizedModule.mkLinearMap y.asIdeal.primeCompl N) ⟨σ b, b.2⟩)).1 dsimp @@ -1020,9 +1020,9 @@ theorem isLocallyFraction_comapFun (U : Opens (PrimeSpectrum.Top R)) (V : Opens (PrimeSpectrum.Top S)) (hUV : V.1 ⊆ PrimeSpectrum.comap σ ⁻¹' U.1) (s : ∀ x : U, Localizations M x.1) (hs : (isLocallyFraction R M).toPrelocalPredicate.pred s) : (isLocallyFraction S N).toPrelocalPredicate.pred (comapFun f U V hUV s) := by - letI := Module.compHom N σ - letI := σ.toAlgebra - haveI : IsScalarTower R S N := .of_algebraMap_smul fun _ _ ↦ rfl + let := Module.compHom N σ + let := σ.toAlgebra + have : IsScalarTower R S N := .of_algebraMap_smul fun _ _ ↦ rfl rintro ⟨p, hpV⟩ obtain ⟨W, m, iWU, a, b, h_frac⟩ := hs ⟨PrimeSpectrum.comap σ p, hUV hpV⟩ refine ⟨⟨_, (PrimeSpectrum.continuous_comap σ).isOpen_preimage _ W.2⟩ ⊓ V, diff --git a/Mathlib/AlgebraicGeometry/ValuativeCriterion.lean b/Mathlib/AlgebraicGeometry/ValuativeCriterion.lean index 0394d01b69ff79..36739968f748a9 100644 --- a/Mathlib/AlgebraicGeometry/ValuativeCriterion.lean +++ b/Mathlib/AlgebraicGeometry/ValuativeCriterion.lean @@ -144,9 +144,9 @@ set_option backward.isDefEq.respectTransparency false in lemma of_specializingMap (H : (topologically @SpecializingMap).universally f) : ValuativeCriterion.Existence f := by rintro ⟨R, K, i₁, i₂, ⟨w⟩⟩ - haveI : IsDomain (CommRingCat.of R) := ‹_› - haveI : ValuationRing (CommRingCat.of R) := ‹_› - letI : Field (CommRingCat.of K) := ‹_› + have : IsDomain (CommRingCat.of R) := ‹_› + have : ValuationRing (CommRingCat.of R) := ‹_› + let : Field (CommRingCat.of K) := ‹_› replace H := H (pullback.snd i₂ f) i₂ (pullback.fst i₂ f) (.of_hasPullback i₂ f) let lft := pullback.lift (Spec.map (CommRingCat.ofHom (algebraMap R K))) i₁ w.symm obtain ⟨x, h₁, h₂⟩ := @H (lft (closedPoint _)) _ (specializes_closedPoint (R := R) _) diff --git a/Mathlib/AlgebraicTopology/DoldKan/NReflectsIso.lean b/Mathlib/AlgebraicTopology/DoldKan/NReflectsIso.lean index b73fc26d9b4b64..74464e436023ef 100644 --- a/Mathlib/AlgebraicTopology/DoldKan/NReflectsIso.lean +++ b/Mathlib/AlgebraicTopology/DoldKan/NReflectsIso.lean @@ -43,7 +43,7 @@ instance : (N₁ : SimplicialObject C ⥤ Karoubi (ChainComplex C ℕ)).Reflects intro -- restating the result in a way that allows induction on the degree n suffices ∀ n : ℕ, IsIso (f.app (op ⦋n⦌)) by - haveI : ∀ Δ : SimplexCategoryᵒᵖ, IsIso (f.app Δ) := fun Δ => this Δ.unop.len + have : ∀ Δ : SimplexCategoryᵒᵖ, IsIso (f.app Δ) := fun Δ => this Δ.unop.len apply NatIso.isIso_of_isIso_app -- restating the assumption in a more practical form have h₁ := HomologicalComplex.congr_hom (Karoubi.hom_ext_iff.mp (IsIso.hom_inv_id (N₁.map f))) diff --git a/Mathlib/AlgebraicTopology/SimplexCategory/Basic.lean b/Mathlib/AlgebraicTopology/SimplexCategory/Basic.lean index 2aadc5ef00a66b..32e553ab4ed331 100644 --- a/Mathlib/AlgebraicTopology/SimplexCategory/Basic.lean +++ b/Mathlib/AlgebraicTopology/SimplexCategory/Basic.lean @@ -813,10 +813,10 @@ theorem eq_σ_of_epi {n : ℕ} (θ : ⦋n + 1⦌ ⟶ ⦋n⦌) [Epi θ] : ∃ i : rw [← mono_iff_injective] grind [→ le_of_mono]) use i - haveI : Epi (σ i ≫ θ') := by + have : Epi (σ i ≫ θ') := by rw [← h] infer_instance - haveI := CategoryTheory.epi_of_epi (σ i) θ' + have := CategoryTheory.epi_of_epi (σ i) θ' rw [h, eq_id_of_epi θ', Category.comp_id] theorem eq_δ_of_mono {n : ℕ} (θ : ⦋n⦌ ⟶ ⦋n + 1⦌) [Mono θ] : ∃ i : Fin (n + 2), θ = δ i := by @@ -824,10 +824,10 @@ theorem eq_δ_of_mono {n : ℕ} (θ : ⦋n⦌ ⟶ ⦋n + 1⦌) [Mono θ] : ∃ i rw [← epi_iff_surjective] grind [→ le_of_epi]) use i - haveI : Mono (θ' ≫ δ i) := by + have : Mono (θ' ≫ δ i) := by rw [← h] infer_instance - haveI := CategoryTheory.mono_of_mono θ' (δ i) + have := CategoryTheory.mono_of_mono θ' (δ i) rw [h, eq_id_of_mono θ', Category.id_comp] theorem len_lt_of_mono {Δ' Δ : SimplexCategory} (i : Δ' ⟶ Δ) [Mono i] (hi' : Δ ≠ Δ') : @@ -849,14 +849,14 @@ instance (Δ Δ' : SimplexCategory) (θ : Δ ⟶ Δ') : Epi (factorThruImage θ) theorem image_eq {Δ Δ' Δ'' : SimplexCategory} {φ : Δ ⟶ Δ''} {e : Δ ⟶ Δ'} [Epi e] {i : Δ' ⟶ Δ''} [Mono i] (fac : e ≫ i = φ) : image φ = Δ' := by - haveI := strongEpi_of_epi e + have := strongEpi_of_epi e let e := image.isoStrongEpiMono e i fac ext exact le_antisymm (len_le_of_epi e.hom) (len_le_of_mono e.hom) theorem image_ι_eq {Δ Δ'' : SimplexCategory} {φ : Δ ⟶ Δ''} {e : Δ ⟶ image φ} [Epi e] {i : image φ ⟶ Δ''} [Mono i] (fac : e ≫ i = φ) : image.ι φ = i := by - haveI := strongEpi_of_epi e + have := strongEpi_of_epi e rw [← image.isoStrongEpiMono_hom_comp_ι e i fac, SimplexCategory.eq_id_of_isIso (image.isoStrongEpiMono e i fac).hom, Category.id_comp] diff --git a/Mathlib/AlgebraicTopology/SimplicialSet/HomotopyCat.lean b/Mathlib/AlgebraicTopology/SimplicialSet/HomotopyCat.lean index 808bbc3b83a4c1..06e3c23bef6591 100644 --- a/Mathlib/AlgebraicTopology/SimplicialSet/HomotopyCat.lean +++ b/Mathlib/AlgebraicTopology/SimplicialSet/HomotopyCat.lean @@ -528,7 +528,7 @@ instance (x y : OneTruncation₂ ((truncation 2).obj Δ[0])) : Unique (x ⟶ y) obtain rfl : y = default := Unique.uniq _ _ exact 𝟙rq instUniqueOneTruncation₂DeltaZero.default uniq _ := by - letI : Subsingleton (((truncation 2).obj Δ[0]).obj (.op ⦋1⦌₂)) := + let : Subsingleton (((truncation 2).obj Δ[0]).obj (.op ⦋1⦌₂)) := inferInstanceAs (Subsingleton (ULift.{_, 0} (⦋1⦌ ⟶ ⦋0⦌))) ext exact this.allEq _ _ diff --git a/Mathlib/Analysis/BoxIntegral/Integrability.lean b/Mathlib/Analysis/BoxIntegral/Integrability.lean index 79185dec889b35..78b21d0d7a3be0 100644 --- a/Mathlib/Analysis/BoxIntegral/Integrability.lean +++ b/Mathlib/Analysis/BoxIntegral/Integrability.lean @@ -110,7 +110,7 @@ theorem HasIntegral.of_aeEq_zero {l : IntegrationParams} {I : Box ι} {f : (ι refine hasIntegral_iff.2 fun ε ε0 => ?_ lift ε to ℝ≥0 using ε0.lt.le; rw [gt_iff_lt, NNReal.coe_pos] at ε0 rcases NNReal.exists_pos_sum_of_countable ε0.ne' ℕ with ⟨δ, δ0, c, hδc, hcε⟩ - haveI := Fact.mk (I.measure_coe_lt_top μ) + have := Fact.mk (I.measure_coe_lt_top μ) change μ.restrict I {x | f x ≠ 0} = 0 at hf set N : (ι → ℝ) → ℕ := fun x => ⌈‖f x‖⌉₊ have N0 : ∀ {x}, N x = 0 ↔ f x = 0 := by simp [N] @@ -176,7 +176,7 @@ theorem hasBoxIntegral (f : SimpleFunc (ι → ℝ) E) (μ : Measure (ι → ℝ | @const y s hs => simpa [hs] using! BoxIntegral.hasIntegralIndicatorConst l hl hs I y μ | @add f g _ hfi hgi => - borelize E; haveI := Fact.mk (I.measure_coe_lt_top μ) + borelize E; have := Fact.mk (I.measure_coe_lt_top μ) rw [integral_add] exacts [hfi.add hgi, integrable_iff.2 fun _ _ => measure_lt_top _ _, integrable_iff.2 fun _ _ => measure_lt_top _ _] @@ -202,7 +202,7 @@ theorem IntegrableOn.hasBoxIntegral [CompleteSpace E] {f : (ι → ℝ) → E} { borelize E -- First we replace an `ae_strongly_measurable` function by a measurable one. rcases hf.aestronglyMeasurable with ⟨g, hg, hfg⟩ - haveI : SeparableSpace (range g ∪ {0} : Set E) := hg.separableSpace_range_union_singleton + have : SeparableSpace (range g ∪ {0} : Set E) := hg.separableSpace_range_union_singleton rw [integral_congr_ae hfg]; have hgi : IntegrableOn g I μ := (integrable_congr hfg).1 hf refine BoxIntegral.HasIntegral.congr_ae ?_ hfg.symm hl clear! f diff --git a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Instances.lean b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Instances.lean index 79341b514c28bc..acbf8358e6f475 100644 --- a/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Instances.lean +++ b/Mathlib/Analysis/CStarAlgebra/ContinuousFunctionalCalculus/Instances.lean @@ -158,7 +158,7 @@ open scoped NonUnitalContinuousFunctionalCalculus in lemma inrNonUnitalStarAlgHom_comp_cfcₙHom_eq_cfcₙAux (a : A) (ha : p a) : letI _ := RCLike.nonUnitalContinuousFunctionalCalculus hp₁ (inrNonUnitalStarAlgHom 𝕜 A).comp (cfcₙHom ha) = cfcₙAux hp₁ a ha := by - letI _ := RCLike.nonUnitalContinuousFunctionalCalculus hp₁ + let _ := RCLike.nonUnitalContinuousFunctionalCalculus hp₁ apply ContinuousMapZero.UniqueHom.eq_of_continuous_of_map_id _ _ _ (Unitization.continuous_inr.comp <| cfcₙHom_continuous ha) (continuous_cfcₙAux hp₁ a ha) diff --git a/Mathlib/Analysis/Calculus/ContDiff/Convolution.lean b/Mathlib/Analysis/Calculus/ContDiff/Convolution.lean index 36568b8076f591..211d87a80843c2 100644 --- a/Mathlib/Analysis/Calculus/ContDiff/Convolution.lean +++ b/Mathlib/Analysis/Calculus/ContDiff/Convolution.lean @@ -228,7 +228,7 @@ theorem hasFDerivAt_convolution_right_with_param {g : P → G → E'} {s : Set P rcases Metric.mem_nhds_iff.1 V_mem with ⟨δ, δpos, hδ⟩ refine ⟨min δ ε, lt_min δpos εpos, min_le_right δ ε, ?_⟩ exact (add_subset_add_left ((ball_subset_ball (min_le_left _ _)).trans hδ)).trans hV - letI := ContinuousLinearMap.hasOpNorm (𝕜 := 𝕜) (𝕜₂ := 𝕜) (E := E) + let := ContinuousLinearMap.hasOpNorm (𝕜 := 𝕜) (𝕜₂ := 𝕜) (E := E) (F := (P × G →L[𝕜] E') →L[𝕜] P × G →L[𝕜] F) (σ₁₂ := RingHom.id 𝕜) let bound : G → ℝ := indicator U fun t => ‖(L.precompR (P × G))‖ * ‖f t‖ * C have I4 : ∀ᵐ a : G ∂μ, ∀ x : P × G, dist x q₀ < δ → diff --git a/Mathlib/Analysis/Calculus/InverseFunctionTheorem/ApproximatesLinearOn.lean b/Mathlib/Analysis/Calculus/InverseFunctionTheorem/ApproximatesLinearOn.lean index 9eea53aa522cbb..4276e5a0d0b4ad 100644 --- a/Mathlib/Analysis/Calculus/InverseFunctionTheorem/ApproximatesLinearOn.lean +++ b/Mathlib/Analysis/Calculus/InverseFunctionTheorem/ApproximatesLinearOn.lean @@ -327,7 +327,7 @@ protected theorem injOn (hf : ApproximatesLinearOn f (f' : E →L[𝕜] F) s c) protected theorem surjective [CompleteSpace E] (hf : ApproximatesLinearOn f (f' : E →L[𝕜] F) univ c) (hc : Subsingleton E ∨ c < N⁻¹) : Surjective f := by rcases hc with hE | hc - · haveI : Subsingleton F := (Equiv.subsingleton_congr f'.toEquiv).1 hE + · have : Subsingleton F := (Equiv.subsingleton_congr f'.toEquiv).1 hE exact surjective_to_subsingleton _ · apply forall_of_forall_mem_closedBall (fun y : F => ∃ a, f a = y) (f 0) _ have hc' : (0 : ℝ) < N⁻¹ - c := by rw [sub_pos]; exact hc diff --git a/Mathlib/Analysis/Calculus/InverseFunctionTheorem/FiniteDimensional.lean b/Mathlib/Analysis/Calculus/InverseFunctionTheorem/FiniteDimensional.lean index 786bee9c4324cb..07e541f43ed914 100644 --- a/Mathlib/Analysis/Calculus/InverseFunctionTheorem/FiniteDimensional.lean +++ b/Mathlib/Analysis/Calculus/InverseFunctionTheorem/FiniteDimensional.lean @@ -47,7 +47,7 @@ theorem exists_homeomorph_extension {E : Type*} [NormedAddCommGroup E] [NormedSp convert! hu ext x simp only [g, add_sub_cancel_left, ContinuousLinearEquiv.coe_coe, Pi.sub_apply] - haveI : FiniteDimensional ℝ E := f'.symm.finiteDimensional + have : FiniteDimensional ℝ E := f'.symm.finiteDimensional exact ⟨hg.toHomeomorph g hc, fg⟩ end ApproximatesLinearOn diff --git a/Mathlib/Analysis/Calculus/LagrangeMultipliers.lean b/Mathlib/Analysis/Calculus/LagrangeMultipliers.lean index 60ab3b165970af..a65c966af5f657 100644 --- a/Mathlib/Analysis/Calculus/LagrangeMultipliers.lean +++ b/Mathlib/Analysis/Calculus/LagrangeMultipliers.lean @@ -111,7 +111,7 @@ theorem IsLocalExtrOn.exists_multipliers_of_hasStrictFDerivAt {ι : Type*} [Fint {f : ι → E → ℝ} {f' : ι → StrongDual ℝ E} (hextr : IsLocalExtrOn φ {x | ∀ i, f i x = f i x₀} x₀) (hf' : ∀ i, HasStrictFDerivAt (f i) (f' i) x₀) (hφ' : HasStrictFDerivAt φ φ' x₀) : ∃ (Λ : ι → ℝ) (Λ₀ : ℝ), (Λ, Λ₀) ≠ 0 ∧ (∑ i, Λ i • f' i) + Λ₀ • φ' = 0 := by - letI := Classical.decEq ι + let := Classical.decEq ι replace hextr : IsLocalExtrOn φ {x | (fun i => f i x) = fun i => f i x₀} x₀ := by simpa only [funext_iff] using hextr rcases hextr.exists_linear_map_of_hasStrictFDerivAt (hasStrictFDerivAt_pi.2 fun i => hf' i) diff --git a/Mathlib/Analysis/Calculus/LogDeriv.lean b/Mathlib/Analysis/Calculus/LogDeriv.lean index c836382083c822..a83c1b6a95c470 100644 --- a/Mathlib/Analysis/Calculus/LogDeriv.lean +++ b/Mathlib/Analysis/Calculus/LogDeriv.lean @@ -133,7 +133,7 @@ lemma logDeriv_eqOn_iff [IsRCLikeNormedField 𝕜] {f g : 𝕜 → 𝕜'} {s : S simp only [Pi.sub_apply, Pi.mul_apply, Pi.inv_apply, Pi.div_apply, Pi.pow_apply, Pi.zero_apply] grind [logDeriv_apply, Pi.div_apply] - letI := IsRCLikeNormedField.rclike 𝕜 + let := IsRCLikeNormedField.rclike 𝕜 obtain ⟨a, ha⟩ := hs2.exists_is_const_of_deriv_eq_zero hsc (hf.mul (hg.inv hgn)) hfg grind [Pi.mul_apply, Pi.inv_apply, Pi.smul_apply, smul_eq_mul] · rintro ⟨z, hz0, hz⟩ x hx diff --git a/Mathlib/Analysis/Calculus/MeanValue.lean b/Mathlib/Analysis/Calculus/MeanValue.lean index fabcfd43dc9227..de2f76a7db82e1 100644 --- a/Mathlib/Analysis/Calculus/MeanValue.lean +++ b/Mathlib/Analysis/Calculus/MeanValue.lean @@ -415,7 +415,7 @@ variable {𝕜 G : Type*} [NontriviallyNormedField 𝕜] [IsRCLikeNormedField {f g : E → G} {C : ℝ} {s : Set E} {x y : E} {f' g' : E → E →L[𝕜] G} {φ : E →L[𝕜] G} instance (priority := 100) : PathConnectedSpace 𝕜 := by - letI : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 + let : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 infer_instance /-- The mean value theorem on a convex set: if the derivative of a function is bounded by `C`, then @@ -423,8 +423,8 @@ the function is `C`-Lipschitz. Version with `HasFDerivWithinAt`. -/ theorem norm_image_sub_le_of_norm_hasFDerivWithin_le (hf : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (bound : ∀ x ∈ s, ‖f' x‖ ≤ C) (hs : Convex ℝ s) (xs : x ∈ s) (ys : y ∈ s) : ‖f y - f x‖ ≤ C * ‖y - x‖ := by - letI : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 - letI : NormedSpace ℝ G := .restrictScalars ℝ 𝕜 G + let : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 + let : NormedSpace ℝ G := .restrictScalars ℝ 𝕜 G /- By composition with `AffineMap.lineMap x y`, we reduce to a statement for functions defined on `[0,1]`, for which it is proved in `norm_image_sub_le_of_norm_deriv_le_segment`. We just have to check the differentiability of the composition and bounds on its derivative, @@ -516,7 +516,7 @@ theorem _root_.lipschitzWith_of_nnnorm_fderiv_le {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {f : E → G} {C : ℝ≥0} (hf : Differentiable 𝕜 f) (bound : ∀ x, ‖fderiv 𝕜 f x‖₊ ≤ C) : LipschitzWith C f := by - letI : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 + let : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 let A : NormedSpace ℝ E := .restrictScalars ℝ 𝕜 E rw [← lipschitzOnWith_univ] exact lipschitzOnWith_of_nnnorm_fderiv_le (fun x _ ↦ hf x) (fun x _ ↦ bound x) convex_univ @@ -566,7 +566,7 @@ theorem _root_.is_const_of_fderiv_eq_zero {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {f : E → G} (hf : Differentiable 𝕜 f) (hf' : ∀ x, fderiv 𝕜 f x = 0) (x y : E) : f x = f y := by - letI : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 + let : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 let A : NormedSpace ℝ E := .restrictScalars ℝ 𝕜 E exact convex_univ.is_const_of_fderivWithin_eq_zero hf.differentiableOn (fun x _ => by rw [fderivWithin_univ]; exact hf' x) trivial trivial @@ -643,7 +643,7 @@ theorem _root_.eq_of_fderiv_eq {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] {f g : E → G} (hf : Differentiable 𝕜 f) (hg : Differentiable 𝕜 g) (hf' : ∀ x, fderiv 𝕜 f x = fderiv 𝕜 g x) (x : E) (hfgx : f x = g x) : f = g := by - letI : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 + let : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 let A : NormedSpace ℝ E := .restrictScalars ℝ 𝕜 E suffices Set.univ.EqOn f g from funext fun x => this <| mem_univ x exact convex_univ.eqOn_of_fderivWithin_eq hf.differentiableOn hg.differentiableOn @@ -820,7 +820,7 @@ theorem hasStrictFDerivAt_of_hasFDerivAt_of_continuousAt rw [← dist_eq_norm] exact le_of_lt (hε H').2 -- apply mean value theorem - letI : NormedSpace ℝ G := .restrictScalars ℝ 𝕜 G + let : NormedSpace ℝ G := .restrictScalars ℝ 𝕜 G refine (convex_ball _ _).norm_image_sub_le_of_norm_hasFDerivWithin_le' ?_ hf' h.2 h.1 exact fun y hy => (hε hy).1.hasFDerivWithinAt diff --git a/Mathlib/Analysis/Calculus/ParametricIntegral.lean b/Mathlib/Analysis/Calculus/ParametricIntegral.lean index a6a6365b699152..451dcdc1010172 100644 --- a/Mathlib/Analysis/Calculus/ParametricIntegral.lean +++ b/Mathlib/Analysis/Calculus/ParametricIntegral.lean @@ -214,7 +214,7 @@ theorem hasFDerivAt_integral_of_dominated_of_fderiv_le {F' : H → α → H →L (bound_integrable : Integrable (bound : α → ℝ) μ) (h_diff : ∀ᵐ a ∂μ, ∀ x ∈ s, HasFDerivAt (F · a) (F' x a) x) : HasFDerivAt (fun x ↦ ∫ a, F x a ∂μ) (∫ a, F' x₀ a ∂μ) x₀ := by - letI : NormedSpace ℝ H := NormedSpace.restrictScalars ℝ 𝕜 H + let : NormedSpace ℝ H := NormedSpace.restrictScalars ℝ 𝕜 H rcases Metric.mem_nhds_iff.1 hs with ⟨ε, ε_pos, hε⟩ have x₀_in : x₀ ∈ ball x₀ ε := mem_ball_self ε_pos have diff_x₀ : ∀ᵐ a ∂μ, HasFDerivAt (F · a) (F' x₀ a) x₀ := diff --git a/Mathlib/Analysis/Calculus/SmoothSeries.lean b/Mathlib/Analysis/Calculus/SmoothSeries.lean index a4e9ff00e3668c..fa903770b9abc9 100644 --- a/Mathlib/Analysis/Calculus/SmoothSeries.lean +++ b/Mathlib/Analysis/Calculus/SmoothSeries.lean @@ -46,7 +46,7 @@ theorem summable_of_summable_hasFDerivAt_of_isPreconnected (hu : Summable u) (hs (h's : IsPreconnected s) (hf : ∀ n x, x ∈ s → HasFDerivAt (f n) (f' n x) x) (hf' : ∀ n x, x ∈ s → ‖f' n x‖ ≤ u n) (hx₀ : x₀ ∈ s) (hf0 : Summable (f · x₀)) (hx : x ∈ s) : Summable fun n => f n x := by - haveI := Classical.decEq α + have := Classical.decEq α rw [summable_iff_cauchySeq_finset] at hf0 ⊢ have A : UniformCauchySeqOn (fun t : Finset α => fun x => ∑ i ∈ t, f' i x) atTop s := (tendstoUniformlyOn_tsum hu hf').uniformCauchySeqOn @@ -103,7 +103,7 @@ then the series converges everywhere. -/ theorem summable_of_summable_hasFDerivAt (hu : Summable u) (hf : ∀ n x, HasFDerivAt (f n) (f' n x) x) (hf' : ∀ n x, ‖f' n x‖ ≤ u n) (hf0 : Summable fun n => f n x₀) (x : E) : Summable fun n => f n x := by - letI : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 + let : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 let _ : NormedSpace ℝ E := NormedSpace.restrictScalars ℝ 𝕜 _ exact summable_of_summable_hasFDerivAt_of_isPreconnected hu isOpen_univ isPreconnected_univ (fun n x _ => hf n x) (fun n x _ => hf' n x) (mem_univ _) hf0 (mem_univ _) @@ -123,7 +123,7 @@ then the series is differentiable and its derivative is the sum of the derivativ theorem hasFDerivAt_tsum (hu : Summable u) (hf : ∀ n x, HasFDerivAt (f n) (f' n x) x) (hf' : ∀ n x, ‖f' n x‖ ≤ u n) (hf0 : Summable fun n => f n x₀) (x : E) : HasFDerivAt (fun y => ∑' n, f n y) (∑' n, f' n x) x := by - letI : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 + let : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 let A : NormedSpace ℝ E := NormedSpace.restrictScalars ℝ 𝕜 _ exact hasFDerivAt_tsum_of_isPreconnected hu isOpen_univ isPreconnected_univ (fun n x _ => hf n x) (fun n x _ => hf' n x) (mem_univ _) hf0 (mem_univ _) diff --git a/Mathlib/Analysis/Calculus/UniformLimitsDeriv.lean b/Mathlib/Analysis/Calculus/UniformLimitsDeriv.lean index 894bf7351a290e..56d6e1172fca6e 100644 --- a/Mathlib/Analysis/Calculus/UniformLimitsDeriv.lean +++ b/Mathlib/Analysis/Calculus/UniformLimitsDeriv.lean @@ -115,8 +115,8 @@ sequence in a neighborhood of `x`. -/ theorem uniformCauchySeqOnFilter_of_fderiv (hf' : UniformCauchySeqOnFilter f' l (𝓝 x)) (hf : ∀ᶠ n : ι × E in l ×ˢ 𝓝 x, HasFDerivAt (f n.1) (f' n.1 n.2) n.2) (hfg : Cauchy (map (fun n => f n x) l)) : UniformCauchySeqOnFilter f l (𝓝 x) := by - letI : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 - letI : NormedSpace ℝ E := NormedSpace.restrictScalars ℝ 𝕜 _ + let : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 + let : NormedSpace ℝ E := NormedSpace.restrictScalars ℝ 𝕜 _ rw [SeminormedAddGroup.uniformCauchySeqOnFilter_iff_tendstoUniformlyOnFilter_zero] at hf' ⊢ suffices TendstoUniformlyOnFilter (fun (n : ι × ι) (z : E) => f n.1 z - f n.2 z - (f n.1 x - f n.2 x)) 0 @@ -179,8 +179,8 @@ convergence. See `cauchy_map_of_uniformCauchySeqOn_fderiv`. theorem uniformCauchySeqOn_ball_of_fderiv {r : ℝ} (hf' : UniformCauchySeqOn f' l (Metric.ball x r)) (hf : ∀ n : ι, ∀ y : E, y ∈ Metric.ball x r → HasFDerivAt (f n) (f' n y) y) (hfg : Cauchy (map (fun n => f n x) l)) : UniformCauchySeqOn f l (Metric.ball x r) := by - letI : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 - letI : NormedSpace ℝ E := NormedSpace.restrictScalars ℝ 𝕜 _ + let : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 + let : NormedSpace ℝ E := NormedSpace.restrictScalars ℝ 𝕜 _ have : NeBot l := (cauchy_map_iff.1 hfg).1 rcases le_or_gt r 0 with (hr | hr) · simp only [Metric.ball_eq_empty.2 hr, UniformCauchySeqOn, Set.mem_empty_iff_false, @@ -310,7 +310,7 @@ theorem hasFDerivAt_of_tendstoUniformlyOnFilter [NeBot l] (hf' : TendstoUniformlyOnFilter f' g' l (𝓝 x)) (hf : ∀ᶠ n : ι × E in l ×ˢ 𝓝 x, HasFDerivAt (f n.1) (f' n.1 n.2) n.2) (hfg : ∀ᶠ y in 𝓝 x, Tendsto (fun n => f n y) l (𝓝 (g y))) : HasFDerivAt g (g' x) x := by - letI : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 + let : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 -- The proof strategy follows several steps: -- 1. The quantifiers in the definition of the derivative are -- `∀ ε > 0, ∃ δ > 0, ∀ y ∈ B_δ(x)`. We will introduce a quantifier in the middle: diff --git a/Mathlib/Analysis/Complex/Polynomial/Basic.lean b/Mathlib/Analysis/Complex/Polynomial/Basic.lean index 33f5a14955277e..7706f87cd22de0 100644 --- a/Mathlib/Analysis/Complex/Polynomial/Basic.lean +++ b/Mathlib/Analysis/Complex/Polynomial/Basic.lean @@ -77,7 +77,7 @@ theorem card_complex_roots_eq_card_real_add_card_not_gal_inv (p : ℚ[X]) : (galActionHom p ℂ (restrict p ℂ (AlgEquiv.restrictScalars ℚ Complex.conjAe))).support.card := by by_cases hp : p = 0 - · haveI : IsEmpty (p.rootSet ℂ) := by rw [hp, rootSet_zero]; infer_instance + · have : IsEmpty (p.rootSet ℂ) := by rw [hp, rootSet_zero]; infer_instance simp_rw [(galActionHom p ℂ _).support.eq_empty_of_isEmpty, hp, rootSet_zero, Set.toFinset_empty, Finset.card_empty] have inj : Function.Injective (IsScalarTower.toAlgHom ℚ ℝ ℂ) := (algebraMap ℝ ℂ).injective diff --git a/Mathlib/Analysis/Complex/UpperHalfPlane/Metric.lean b/Mathlib/Analysis/Complex/UpperHalfPlane/Metric.lean index 1d0e7e65be6fbf..aaa307340c876b 100644 --- a/Mathlib/Analysis/Complex/UpperHalfPlane/Metric.lean +++ b/Mathlib/Analysis/Complex/UpperHalfPlane/Metric.lean @@ -155,7 +155,7 @@ theorem dist_coe_center (z w : ℍ) (r : ℝ) : dist (z : ℂ) (w.center r) = theorem cmp_dist_eq_cmp_dist_coe_center (z w : ℍ) (r : ℝ) : cmp (dist z w) r = cmp (dist (z : ℂ) (w.center r)) (w.im * Real.sinh r) := by - letI := metricSpaceAux + let := metricSpaceAux rcases lt_or_ge r 0 with hr₀ | hr₀ · trans Ordering.gt exacts [(hr₀.trans_le dist_nonneg).cmp_eq_gt, @@ -258,7 +258,7 @@ instance : MetricSpace ℍ := apply_rules [Continuous.div, Continuous.mul, continuous_const, Continuous.arsinh, Continuous.dist, continuous_coe.comp, continuous_fst, continuous_snd, Real.continuous_sqrt.comp, continuous_im.comp] - · letI : MetricSpace ℍ := metricSpaceAux + · let : MetricSpace ℍ := metricSpaceAux refine le_of_nhds_le_nhds fun z => ?_ rw [nhds_induced] refine (nhds_basis_ball.le_basis_iff (nhds_basis_ball.comap _)).2 fun R hR => ?_ diff --git a/Mathlib/Analysis/ConstantSpeed.lean b/Mathlib/Analysis/ConstantSpeed.lean index 7eef2a7b6988ce..4f9bcae76ac79d 100644 --- a/Mathlib/Analysis/ConstantSpeed.lean +++ b/Mathlib/Analysis/ConstantSpeed.lean @@ -233,7 +233,7 @@ theorem edist_naturalParameterization_eq_zero {f : α → E} {s : Set α} (hf : LocallyBoundedVariationOn f s) {a : α} (as : a ∈ s) {b : α} (bs : b ∈ s) : edist (naturalParameterization f s a (variationOnFromTo f s a b)) (f b) = 0 := by dsimp only [naturalParameterization] - haveI : Nonempty α := ⟨a⟩ + have : Nonempty α := ⟨a⟩ obtain ⟨cs, hc⟩ := Function.invFunOn_pos (b := variationOnFromTo f s a b) ⟨b, bs, rfl⟩ rw [variationOnFromTo.eq_left_iff hf as cs bs] at hc apply variationOnFromTo.edist_zero_of_eq_zero hf cs bs hc diff --git a/Mathlib/Analysis/Convex/Cone/TensorProduct.lean b/Mathlib/Analysis/Convex/Cone/TensorProduct.lean index 635db471ec4b07..b3b1cc6bb9d9c6 100644 --- a/Mathlib/Analysis/Convex/Cone/TensorProduct.lean +++ b/Mathlib/Analysis/Convex/Cone/TensorProduct.lean @@ -88,7 +88,7 @@ theorem minTensorProduct_eq_max_of_simplicial_generating_left (C₁ : PointedCon minTensorProduct C₁ C₂.toPointedCone = maxTensorProduct C₁ C₂.toPointedCone := by classical obtain ⟨s, hs_fin, hs_lin, hs_span⟩ := h₁_simp - haveI : Fintype s := hs_fin.fintype + have : Fintype s := hs_fin.fintype -- The conic hull (R≥0-span) is contained in the linear span (ℝ-span) have hull_sub_span : (hull ℝ s : Set E) ⊆ Submodule.span ℝ s := by intro x hx diff --git a/Mathlib/Analysis/Convex/EGauge.lean b/Mathlib/Analysis/Convex/EGauge.lean index 51780123318d2d..92f81aab4b4549 100644 --- a/Mathlib/Analysis/Convex/EGauge.lean +++ b/Mathlib/Analysis/Convex/EGauge.lean @@ -335,7 +335,7 @@ variable {c : 𝕜} {x : E} {r : ℝ≥0} lemma egauge_ball_le_of_one_lt_norm (hc : 1 < ‖c‖) (h₀ : r ≠ 0 ∨ ‖x‖ ≠ 0) : egauge 𝕜 (ball 0 r) x ≤ ‖c‖ₑ * ‖x‖ₑ / r := by - letI : NontriviallyNormedField 𝕜 := ⟨c, hc⟩ + let : NontriviallyNormedField 𝕜 := ⟨c, hc⟩ rcases eq_zero_or_pos r with rfl | hr · rw [ENNReal.coe_zero, ENNReal.div_zero (mul_ne_zero _ _)] · apply le_top diff --git a/Mathlib/Analysis/Convex/Extreme.lean b/Mathlib/Analysis/Convex/Extreme.lean index 8f564a9b141487..a3daff0007e3da 100644 --- a/Mathlib/Analysis/Convex/Extreme.lean +++ b/Mathlib/Analysis/Convex/Extreme.lean @@ -117,7 +117,7 @@ theorem isExtreme_iInter {ι : Sort*} [Nonempty ι] {F : ι → Set E} theorem isExtreme_biInter {F : Set (Set E)} (hF : F.Nonempty) (hA : ∀ B ∈ F, IsExtreme 𝕜 A B) : IsExtreme 𝕜 A (⋂ B ∈ F, B) := by - haveI := hF.to_subtype + have := hF.to_subtype simpa only [iInter_subtype] using isExtreme_iInter fun i : F ↦ hA _ i.2 theorem isExtreme_sInter {F : Set (Set E)} (hF : F.Nonempty) (hAF : ∀ B ∈ F, IsExtreme 𝕜 A B) : diff --git a/Mathlib/Analysis/Convex/Integral.lean b/Mathlib/Analysis/Convex/Integral.lean index b3b35f2b7c8076..fbb93244a6bb2d 100644 --- a/Mathlib/Analysis/Convex/Integral.lean +++ b/Mathlib/Analysis/Convex/Integral.lean @@ -58,7 +58,7 @@ theorem Convex.integral_mem [IsProbabilityMeasure μ] (hs : Convex ℝ s) (hsc : (hf : ∀ᵐ x ∂μ, f x ∈ s) (hfi : Integrable f μ) : (∫ x, f x ∂μ) ∈ s := by borelize E rcases hfi.aestronglyMeasurable with ⟨g, hgm, hfg⟩ - haveI : SeparableSpace (range g ∩ s : Set E) := + have : SeparableSpace (range g ∩ s : Set E) := (hgm.isSeparable_range.mono inter_subset_left).separableSpace obtain ⟨y₀, h₀⟩ : (range g ∩ s).Nonempty := by rcases (hf.and hfg).exists with ⟨x₀, h₀⟩ @@ -314,7 +314,7 @@ theorem ae_eq_const_or_norm_average_lt_of_norm_le_const [StrictConvexSpace ℝ E · simp [average_eq, integral_undef hfi, hC0] rcases (le_top : μ univ ≤ ∞).eq_or_lt with hμt | hμt · simp [average_eq, measureReal_def, hμt, hC0] - haveI : IsFiniteMeasure μ := ⟨hμt⟩ + have : IsFiniteMeasure μ := ⟨hμt⟩ replace h_le : ∀ᵐ x ∂μ, f x ∈ closedBall (0 : E) C := by simpa only [mem_closedBall_zero_iff] simpa only [interior_closedBall _ hC0.ne', mem_ball_zero_iff] using (strictConvex_closedBall ℝ (0 : E) C).ae_eq_const_or_average_mem_interior isClosed_closedBall @@ -339,6 +339,6 @@ a.e. on a set `t` of finite measure, then either this function is a.e. equal to theorem ae_eq_const_or_norm_setIntegral_lt_of_norm_le_const [StrictConvexSpace ℝ E] (ht : μ t ≠ ∞) (h_le : ∀ᵐ x ∂μ.restrict t, ‖f x‖ ≤ C) : f =ᵐ[μ.restrict t] const α (⨍ x in t, f x ∂μ) ∨ ‖∫ x in t, f x ∂μ‖ < μ.real t * C := by - haveI := Fact.mk ht.lt_top + have := Fact.mk ht.lt_top rw [← measureReal_restrict_apply_univ] exact ae_eq_const_or_norm_integral_lt_of_norm_le_const h_le diff --git a/Mathlib/Analysis/Convex/Intrinsic.lean b/Mathlib/Analysis/Convex/Intrinsic.lean index 6c1f2aabafd068..d57a8c3d9b594a 100644 --- a/Mathlib/Analysis/Convex/Intrinsic.lean +++ b/Mathlib/Analysis/Convex/Intrinsic.lean @@ -256,7 +256,7 @@ private theorem intrinsicInterior_image_of_homeomorph_affineSpan : intrinsicInterior 𝕜 (f '' s) = f '' intrinsicInterior 𝕜 s := by rcases s.eq_empty_or_nonempty with rfl | hs · simp - · haveI : Nonempty s := hs.to_subtype + · have : Nonempty s := hs.to_subtype rw [intrinsicInterior, ← image_interior_preimage_comp e he_homeo, (funext he : (↑) ∘ e = f ∘ (↑)), preimage_image_eq_of_homeomorph_affineSpan e he_homeo he, image_comp]; rfl @@ -268,7 +268,7 @@ private theorem intrinsicFrontier_image_of_homeomorph_affineSpan : intrinsicFrontier 𝕜 (f '' s) = f '' intrinsicFrontier 𝕜 s := by rcases s.eq_empty_or_nonempty with rfl | hs · simp - · haveI : Nonempty s := hs.to_subtype + · have : Nonempty s := hs.to_subtype rw [intrinsicFrontier, ← image_frontier_preimage_comp e he_homeo, (funext he : (↑) ∘ e = f ∘ (↑)), preimage_image_eq_of_homeomorph_affineSpan e he_homeo he, image_comp]; rfl @@ -280,7 +280,7 @@ private theorem intrinsicClosure_image_of_homeomorph_affineSpan : intrinsicClosure 𝕜 (f '' s) = f '' intrinsicClosure 𝕜 s := by rcases s.eq_empty_or_nonempty with rfl | hs · simp - · haveI : Nonempty s := hs.to_subtype + · have : Nonempty s := hs.to_subtype rw [intrinsicClosure, ← image_closure_preimage_comp e he_homeo, (funext he : (↑) ∘ e = f ∘ (↑)), preimage_image_eq_of_homeomorph_affineSpan e he_homeo he, image_comp]; rfl @@ -449,7 +449,7 @@ variable [NormedAddCommGroup V] [NormedSpace ℝ V] [FiniteDimensional ℝ V] {s /-- The intrinsic interior of a nonempty convex set is nonempty. -/ protected theorem Set.Nonempty.intrinsicInterior (hscv : Convex ℝ s) (hsne : s.Nonempty) : (intrinsicInterior ℝ s).Nonempty := by - haveI := hsne.coe_sort + have := hsne.coe_sort obtain ⟨p, hp⟩ := hsne let p' : _root_.affineSpan ℝ s := ⟨p, subset_affineSpan _ _ hp⟩ rw [intrinsicInterior, image_nonempty, diff --git a/Mathlib/Analysis/Convex/KreinMilman.lean b/Mathlib/Analysis/Convex/KreinMilman.lean index 6661d3ac8102d4..e75e1d19d09e82 100644 --- a/Mathlib/Analysis/Convex/KreinMilman.lean +++ b/Mathlib/Analysis/Convex/KreinMilman.lean @@ -82,7 +82,7 @@ theorem IsCompact.extremePoints_nonempty (hscomp : IsCompact s) (hsnemp : s.None · exact ⟨s, ⟨hsnemp, hscomp.isClosed, IsExtreme.rfl⟩, fun _ => False.elim⟩ refine ⟨⋂₀ F, ⟨?_, isClosed_sInter fun t ht => (hFS ht).2.1, isExtreme_sInter hFnemp fun t ht => (hFS ht).2.2⟩, fun t ht => sInter_subset_of_mem ht⟩ - haveI : Nonempty (↥F) := hFnemp.to_subtype + have : Nonempty (↥F) := hFnemp.to_subtype rw [sInter_eq_iInter] refine IsCompact.nonempty_iInter_of_directed_nonempty_isCompact_isClosed _ (fun t u => ?_) (fun t => (hFS t.mem).1) diff --git a/Mathlib/Analysis/Convex/MetricSpace.lean b/Mathlib/Analysis/Convex/MetricSpace.lean index 848ed2f4e6d82d..32c1b7127a55bc 100644 --- a/Mathlib/Analysis/Convex/MetricSpace.lean +++ b/Mathlib/Analysis/Convex/MetricSpace.lean @@ -276,7 +276,7 @@ instance (priority := low) {V P : Type*} instance IsConvexDist.subtype (s : Set X) (hs : IsConvexSet ℝ s) : letI : ConvexSpace ℝ s := .subtype s hs IsConvexDist s := by - letI : ConvexSpace ℝ s := .subtype s hs + let : ConvexSpace ℝ s := .subtype s hs refine ⟨fun f ↦ ?_⟩ convert dist_iConvexComb_fst_snd_le (X := X) (f.map fun x ↦ (x.1, x.2)) <;> simp [Subtype.dist_eq, Finsupp.sum_mapDomain_index, add_mul] diff --git a/Mathlib/Analysis/Convex/Side.lean b/Mathlib/Analysis/Convex/Side.lean index 6cf3ee3d020915..3a8f2fc1e56e81 100644 --- a/Mathlib/Analysis/Convex/Side.lean +++ b/Mathlib/Analysis/Convex/Side.lean @@ -780,7 +780,7 @@ variable [NormedAddTorsor V P] theorem isConnected_setOf_wSameSide {s : AffineSubspace ℝ P} (x : P) (h : (s : Set P).Nonempty) : IsConnected { y | s.WSameSide x y } := by obtain ⟨p, hp⟩ := h - haveI : Nonempty s := ⟨⟨p, hp⟩⟩ + have : Nonempty s := ⟨⟨p, hp⟩⟩ by_cases hx : x ∈ s · simp only [wSameSide_of_left_mem, hx] have := AddTorsor.connectedSpace V P @@ -801,7 +801,7 @@ theorem isPreconnected_setOf_wSameSide (s : AffineSubspace ℝ P) (x : P) : theorem isConnected_setOf_sSameSide {s : AffineSubspace ℝ P} {x : P} (hx : x ∉ s) (h : (s : Set P).Nonempty) : IsConnected { y | s.SSameSide x y } := by obtain ⟨p, hp⟩ := h - haveI : Nonempty s := ⟨⟨p, hp⟩⟩ + have : Nonempty s := ⟨⟨p, hp⟩⟩ rw [setOf_sSameSide_eq_image2 hx hp, ← Set.image_prod] refine (isConnected_Ioi.prod (isConnected_iff_connectedSpace.2 ?_)).image _ ((continuous_fst.smul continuous_const).vadd continuous_snd).continuousOn @@ -821,7 +821,7 @@ theorem isPreconnected_setOf_sSameSide (s : AffineSubspace ℝ P) (x : P) : theorem isConnected_setOf_wOppSide {s : AffineSubspace ℝ P} (x : P) (h : (s : Set P).Nonempty) : IsConnected { y | s.WOppSide x y } := by obtain ⟨p, hp⟩ := h - haveI : Nonempty s := ⟨⟨p, hp⟩⟩ + have : Nonempty s := ⟨⟨p, hp⟩⟩ by_cases hx : x ∈ s · simp only [wOppSide_of_left_mem, hx] have := AddTorsor.connectedSpace V P @@ -842,7 +842,7 @@ theorem isPreconnected_setOf_wOppSide (s : AffineSubspace ℝ P) (x : P) : theorem isConnected_setOf_sOppSide {s : AffineSubspace ℝ P} {x : P} (hx : x ∉ s) (h : (s : Set P).Nonempty) : IsConnected { y | s.SOppSide x y } := by obtain ⟨p, hp⟩ := h - haveI : Nonempty s := ⟨⟨p, hp⟩⟩ + have : Nonempty s := ⟨⟨p, hp⟩⟩ rw [setOf_sOppSide_eq_image2 hx hp, ← Set.image_prod] refine (isConnected_Iio.prod (isConnected_iff_connectedSpace.2 ?_)).image _ ((continuous_fst.smul continuous_const).vadd continuous_snd).continuousOn diff --git a/Mathlib/Analysis/Convex/StdSimplex.lean b/Mathlib/Analysis/Convex/StdSimplex.lean index 46b59101d93b89..89f918927fa058 100644 --- a/Mathlib/Analysis/Convex/StdSimplex.lean +++ b/Mathlib/Analysis/Convex/StdSimplex.lean @@ -162,7 +162,7 @@ theorem Set.Finite.convexHull_eq_image {E : Type*} [AddCommGroup E] [Module R E] haveI := hs.fintype (⇑(∑ x : s, (LinearMap.proj (R := R) x).smulRight x.1)) '' stdSimplex R s := by classical - letI := hs.fintype + let := hs.fintype rw [← convexHull_basis_eq_stdSimplex, LinearMap.image_convexHull, ← Set.range_comp] apply congr_arg aesop diff --git a/Mathlib/Analysis/Distribution/AEEqOfIntegralContDiff.lean b/Mathlib/Analysis/Distribution/AEEqOfIntegralContDiff.lean index 5f229581b1a28e..08ff71a07bec34 100644 --- a/Mathlib/Analysis/Distribution/AEEqOfIntegralContDiff.lean +++ b/Mathlib/Analysis/Distribution/AEEqOfIntegralContDiff.lean @@ -132,7 +132,7 @@ theorem IsOpen.ae_eq_zero_of_integral_contMDiff_smul_eq_zero' {U : Set M} (hU : rw [← ae_restrict_iff' meas_U, ae_restrict_iff_subtype meas_U] let U : Opens M := ⟨U, hU⟩ change ∀ᵐ (x : U) ∂_, _ - haveI : SigmaCompactSpace U := isSigmaCompact_iff_sigmaCompactSpace.mp hSig + have : SigmaCompactSpace U := isSigmaCompact_iff_sigmaCompactSpace.mp hSig refine ae_eq_zero_of_integral_contMDiff_smul_eq_zero I ?_ fun g g_smth g_supp ↦ ?_ · exact (locallyIntegrable_comap meas_U).mpr hf specialize h (Subtype.val.extend g 0) (g_smth.extend_zero g_supp) diff --git a/Mathlib/Analysis/Distribution/TemperedDistribution.lean b/Mathlib/Analysis/Distribution/TemperedDistribution.lean index 871955ee5ae633..713e7dd5da0358 100644 --- a/Mathlib/Analysis/Distribution/TemperedDistribution.lean +++ b/Mathlib/Analysis/Distribution/TemperedDistribution.lean @@ -201,7 +201,7 @@ def toTemperedDistributionCLM (μ : Measure E := by volume_tac) [μ.HasTemperate cont := by apply PointwiseConvergenceCLM.continuous_of_continuous_eval intro g - haveI : Fact (1 ≤ (1 - p⁻¹)⁻¹) := by simp [fact_iff] + have : Fact (1 ≤ (1 - p⁻¹)⁻¹) := by simp [fact_iff] have hpq : ENNReal.HolderConjugate p (1 - p⁻¹)⁻¹ := ENNReal.HolderConjugate.inv_one_sub_inv' hp.out exact (((lsmul ℂ ℂ (E := F)).flip.lpPairing μ p (1 - p⁻¹)⁻¹).flip (g.toLp (1 - p⁻¹)⁻¹ μ)).cont diff --git a/Mathlib/Analysis/Fourier/AddCircle.lean b/Mathlib/Analysis/Fourier/AddCircle.lean index 36d822059852c1..7a045982cec4ca 100644 --- a/Mathlib/Analysis/Fourier/AddCircle.lean +++ b/Mathlib/Analysis/Fourier/AddCircle.lean @@ -356,7 +356,7 @@ def fourierCoeffOn {a b : ℝ} (hab : a < b) (f : ℝ → E) (n : ℤ) : E := theorem fourierCoeffOn_eq_integral {a b : ℝ} (f : ℝ → E) (n : ℤ) (hab : a < b) : fourierCoeffOn hab f n = (1 / (b - a)) • ∫ x in a..b, fourier (-n) (x : AddCircle (b - a)) • f x := by - haveI := Fact.mk (by linarith : 0 < b - a) + have := Fact.mk (by linarith : 0 < b - a) rw [fourierCoeffOn, fourierCoeff_eq_intervalIntegral _ _ a, add_sub, add_sub_cancel_left] congr 1 simp_rw [intervalIntegral.integral_of_le hab.le] @@ -366,7 +366,7 @@ theorem fourierCoeffOn_eq_integral {a b : ℝ} (f : ℝ → E) (n : ℤ) (hab : theorem fourierCoeffOn.const_smul {a b : ℝ} (f : ℝ → E) (c : ℂ) (n : ℤ) (hab : a < b) : fourierCoeffOn hab (c • f) n = c • fourierCoeffOn hab f n := by - haveI := Fact.mk (by linarith : 0 < b - a) + have := Fact.mk (by linarith : 0 < b - a) apply fourierCoeff.const_smul theorem fourierCoeffOn.const_mul {a b : ℝ} (f : ℝ → ℂ) (c : ℂ) (n : ℤ) (hab : a < b) : @@ -458,7 +458,7 @@ the sum of the squared norms of the Fourier coefficients equals the `L²` norm o theorem hasSum_sq_fourierCoeffOn {a b : ℝ} {f : ℝ → ℂ} (hab : a < b) (hL2 : MemLp f 2 (volume.restrict (Ioc a b))) : HasSum (fun i => ‖fourierCoeffOn hab f i‖ ^ 2) ((b - a)⁻¹ • ∫ x in a..b, ‖f x‖ ^ 2) := by - haveI := Fact.mk (by linarith : 0 < b - a) + have := Fact.mk (by linarith : 0 < b - a) rw [← add_sub_cancel a b] at hL2 have h := hL2.memLp_liftIoc.haarAddCircle convert hasSum_sq_fourierCoeff h.toLp diff --git a/Mathlib/Analysis/Hofer.lean b/Mathlib/Analysis/Hofer.lean index 0b7bb7279de384..198fc7866ba3e2 100644 --- a/Mathlib/Analysis/Hofer.lean +++ b/Mathlib/Analysis/Hofer.lean @@ -40,7 +40,7 @@ theorem hofer {X : Type*} [MetricSpace X] [CompleteSpace X] (x : X) (ε : ℝ) ( intro k x' have := H (ε / 2 ^ k) (by positivity) x' (div_le_self ε_pos.le <| one_le_pow₀ one_le_two) simpa [reformulation] using! this - haveI : Nonempty X := ⟨x⟩ + have : Nonempty X := ⟨x⟩ choose! F hF using H -- Use the axiom of choice -- Now define u by induction starting at x, with u_{n+1} = F(n, u_n) diff --git a/Mathlib/Analysis/InnerProductSpace/Adjoint.lean b/Mathlib/Analysis/InnerProductSpace/Adjoint.lean index 61d64cedb022f6..58848c1045874c 100644 --- a/Mathlib/Analysis/InnerProductSpace/Adjoint.lean +++ b/Mathlib/Analysis/InnerProductSpace/Adjoint.lean @@ -605,21 +605,21 @@ lemma adjoint_one : (1 : E →ₗ[𝕜] E).adjoint = 1 := by simp /-- 7.6(b) from [axler2024]. See `ContinuousLinearMap.orthogonal_ker` for the infinite-dimensional version. -/ lemma orthogonal_ker (A : E →ₗ[𝕜] F) : A.kerᗮ = A.adjoint.range := by - haveI := FiniteDimensional.complete 𝕜 E - haveI := FiniteDimensional.complete 𝕜 F + have := FiniteDimensional.complete 𝕜 E + have := FiniteDimensional.complete 𝕜 F simpa using! A.toContinuousLinearMap.orthogonal_ker /-- 7.6(a) from [axler2024]. See `ContinuousLinearMap.orthogonal_range` for the infinite-dimensional version. -/ lemma orthogonal_range (A : E →ₗ[𝕜] F) : A.rangeᗮ = A.adjoint.ker := by - haveI := FiniteDimensional.complete 𝕜 E - haveI := FiniteDimensional.complete 𝕜 F + have := FiniteDimensional.complete 𝕜 E + have := FiniteDimensional.complete 𝕜 F simpa using! A.toContinuousLinearMap.orthogonal_range /-- 7.64(b) in [axler2024] -/ lemma ker_adjoint_comp_self (A : E →ₗ[𝕜] F) : (A.adjoint ∘ₗ A).ker = A.ker := by - haveI := FiniteDimensional.complete 𝕜 E - haveI := FiniteDimensional.complete 𝕜 F + have := FiniteDimensional.complete 𝕜 E + have := FiniteDimensional.complete 𝕜 F simpa using! A.toContinuousLinearMap.ker_adjoint_comp_self lemma ker_self_comp_adjoint (A : E →ₗ[𝕜] F) : (A ∘ₗ A.adjoint).ker = A.adjoint.ker := by @@ -1055,7 +1055,7 @@ theorem LinearIsometry.adjoint_comp_self' {E E' : Type*} [NormedAddCommGroup E] [InnerProductSpace 𝕜 E] [FiniteDimensional 𝕜 E] [NormedAddCommGroup E'] [InnerProductSpace 𝕜 E'] [FiniteDimensional 𝕜 E'] (f : E →ₗᵢ[𝕜] E') : f.adjoint ∘ₗ f.toLinearMap = LinearMap.id := by - haveI := FiniteDimensional.complete 𝕜 E - haveI := FiniteDimensional.complete 𝕜 E' + have := FiniteDimensional.complete 𝕜 E + have := FiniteDimensional.complete 𝕜 E' ext x exact congr($(f.adjoint_comp_self) x) diff --git a/Mathlib/Analysis/InnerProductSpace/Basic.lean b/Mathlib/Analysis/InnerProductSpace/Basic.lean index 6171f8318e2fb8..f4c81e88568377 100644 --- a/Mathlib/Analysis/InnerProductSpace/Basic.lean +++ b/Mathlib/Analysis/InnerProductSpace/Basic.lean @@ -455,7 +455,7 @@ theorem norm_sub_mul_self_real (x y : F) : /-- Cauchy–Schwarz inequality with norm -/ theorem norm_inner_le_norm (x y : E) : ‖⟪x, y⟫‖ ≤ ‖x‖ * ‖y‖ := by rw [norm_eq_sqrt_re_inner (𝕜 := 𝕜) x, norm_eq_sqrt_re_inner (𝕜 := 𝕜) y] - letI : PreInnerProductSpace.Core 𝕜 E := PreInnerProductSpace.toCore + let : PreInnerProductSpace.Core 𝕜 E := PreInnerProductSpace.toCore exact InnerProductSpace.Core.norm_inner_le_norm x y theorem nnnorm_inner_le_nnnorm (x y : E) : ‖⟪x, y⟫‖₊ ≤ ‖x‖₊ * ‖y‖₊ := @@ -712,7 +712,7 @@ theorem norm_inner_eq_norm_tfae (x y : E) : rw [← sq_eq_sq₀, mul_pow, ← mul_right_inj' this, eq_comm, ← sub_eq_zero, ← mul_sub] at h <;> try positivity simp only [@norm_sq_eq_re_inner 𝕜] at h - letI : InnerProductSpace.Core 𝕜 E := InnerProductSpace.toCore + let : InnerProductSpace.Core 𝕜 E := InnerProductSpace.toCore erw [← InnerProductSpace.Core.cauchy_schwarz_aux (𝕜 := 𝕜) (F := E)] at h rw [InnerProductSpace.Core.normSq_eq_zero, sub_eq_zero] at h rw [div_eq_inv_mul, mul_smul, h, inv_smul_smul₀] @@ -952,7 +952,7 @@ abbrev InnerProductSpace.rclikeToReal : InnerProductSpace ℝ E := add_left := fun x y z => by simp +instances only [Inner.rclikeToReal, inner_add_left, map_add] smul_left := fun x y r => by - letI := NormedSpace.restrictScalars ℝ 𝕜 E + let := NormedSpace.restrictScalars ℝ 𝕜 E have : r • x = (r : 𝕜) • x := rfl simp +instances only [Inner.rclikeToReal, this, conj_trivial, inner_smul_left, conj_ofReal, re_ofReal_mul] } diff --git a/Mathlib/Analysis/InnerProductSpace/Defs.lean b/Mathlib/Analysis/InnerProductSpace/Defs.lean index 2bc916e9ff9f00..7c03c08f0564e5 100644 --- a/Mathlib/Analysis/InnerProductSpace/Defs.lean +++ b/Mathlib/Analysis/InnerProductSpace/Defs.lean @@ -427,7 +427,7 @@ omit c in lemma toSeminormedSpaceCore (c : PreInnerProductSpace.Core 𝕜 F) : SeminormedSpace.Core 𝕜 F where norm_nonneg x := norm_nonneg x norm_smul c x := by - letI : NormedSpace 𝕜 F := toNormedSpace + let : NormedSpace 𝕜 F := toNormedSpace exact _root_.norm_smul c x norm_triangle x y := norm_add_le x y @@ -494,7 +494,7 @@ lemma toNormedSpaceCore (cd : InnerProductSpace.Core 𝕜 F) : NormedSpace.Core norm_nonneg x := norm_nonneg x norm_eq_zero_iff x := norm_eq_zero norm_smul c x := by - letI : NormedSpace 𝕜 F := toNormedSpace + let : NormedSpace 𝕜 F := toNormedSpace exact _root_.norm_smul c x norm_triangle x y := norm_add_le x y diff --git a/Mathlib/Analysis/InnerProductSpace/LaxMilgram.lean b/Mathlib/Analysis/InnerProductSpace/LaxMilgram.lean index 3acc990035f6e7..c789ad39fcb3e0 100644 --- a/Mathlib/Analysis/InnerProductSpace/LaxMilgram.lean +++ b/Mathlib/Analysis/InnerProductSpace/LaxMilgram.lean @@ -81,7 +81,7 @@ theorem isClosed_range (coercive : IsCoercive B) : IsClosed (B♯.range : Set V) exact antilipschitz.isClosed_range B♯.uniformContinuous theorem range_eq_top (coercive : IsCoercive B) : B♯.range = ⊤ := by - haveI := coercive.isClosed_range.completeSpace_coe + have := coercive.isClosed_range.completeSpace_coe rw [← B♯.range.orthogonal_orthogonal] rw [Submodule.eq_top_iff'] intro v w mem_w_orthogonal diff --git a/Mathlib/Analysis/InnerProductSpace/Orientation.lean b/Mathlib/Analysis/InnerProductSpace/Orientation.lean index 7ff0181b423f2e..8dcdff2be957b9 100644 --- a/Mathlib/Analysis/InnerProductSpace/Orientation.lean +++ b/Mathlib/Analysis/InnerProductSpace/Orientation.lean @@ -155,8 +155,8 @@ protected def finOrthonormalBasis (hn : 0 < n) (h : finrank ℝ E = n) (x : Orie @[simp] theorem finOrthonormalBasis_orientation (hn : 0 < n) (h : finrank ℝ E = n) (x : Orientation ℝ E (Fin n)) : (x.finOrthonormalBasis hn h).toBasis.orientation = x := by - haveI := Fin.pos_iff_nonempty.1 hn - haveI : FiniteDimensional ℝ E := .of_finrank_pos <| h.symm ▸ hn + have := Fin.pos_iff_nonempty.1 hn + have : FiniteDimensional ℝ E := .of_finrank_pos <| h.symm ▸ hn exact ((@stdOrthonormalBasis _ _ _ _ _ this).reindex <| finCongr h).orientation_adjustToOrientation x @@ -244,7 +244,7 @@ value by the product of the norms of the vectors `v i`. -/ theorem abs_volumeForm_apply_le (v : Fin n → E) : |o.volumeForm v| ≤ ∏ i : Fin n, ‖v i‖ := by rcases n with - | n · refine o.eq_or_eq_neg_of_isEmpty.elim ?_ ?_ <;> rintro rfl <;> simp - haveI : FiniteDimensional ℝ E := .of_fact_finrank_eq_succ n + have : FiniteDimensional ℝ E := .of_fact_finrank_eq_succ n have : finrank ℝ E = Fintype.card (Fin n.succ) := by simpa using _i.out let b : OrthonormalBasis (Fin n.succ) ℝ E := gramSchmidtOrthonormalBasis this v have hb : b.toBasis.det v = ∏ i, ⟪b i, v i⟫ := gramSchmidtOrthonormalBasis_det this v @@ -266,7 +266,7 @@ theorem abs_volumeForm_apply_of_pairwise_orthogonal {v : Fin n → E} (hv : Pairwise fun i j => ⟪v i, v j⟫ = 0) : |o.volumeForm v| = ∏ i : Fin n, ‖v i‖ := by rcases n with - | n · refine o.eq_or_eq_neg_of_isEmpty.elim ?_ ?_ <;> rintro rfl <;> simp - haveI : FiniteDimensional ℝ E := .of_fact_finrank_eq_succ n + have : FiniteDimensional ℝ E := .of_fact_finrank_eq_succ n have hdim : finrank ℝ E = Fintype.card (Fin n.succ) := by simpa using _i.out let b : OrthonormalBasis (Fin n.succ) ℝ E := gramSchmidtOrthonormalBasis hdim v have hb : b.toBasis.det v = ∏ i, ⟪b i, v i⟫ := gramSchmidtOrthonormalBasis_det hdim v diff --git a/Mathlib/Analysis/InnerProductSpace/PiL2.lean b/Mathlib/Analysis/InnerProductSpace/PiL2.lean index 297d9435e95b06..2e113640ce7dfe 100644 --- a/Mathlib/Analysis/InnerProductSpace/PiL2.lean +++ b/Mathlib/Analysis/InnerProductSpace/PiL2.lean @@ -756,9 +756,9 @@ protected def mkOfOrthogonalEqBot (hon : Orthonormal 𝕜 v) (hsp : (span 𝕜 ( OrthonormalBasis.mk hon (by refine Eq.ge ?_ - haveI : FiniteDimensional 𝕜 (span 𝕜 (range v)) := + have : FiniteDimensional 𝕜 (span 𝕜 (range v)) := FiniteDimensional.span_of_finite 𝕜 (finite_range v) - haveI : CompleteSpace (span 𝕜 (range v)) := FiniteDimensional.complete 𝕜 _ + have : CompleteSpace (span 𝕜 (range v)) := FiniteDimensional.complete 𝕜 _ rwa [orthogonal_eq_bot_iff] at hsp) @[simp] diff --git a/Mathlib/Analysis/InnerProductSpace/Projection/Basic.lean b/Mathlib/Analysis/InnerProductSpace/Projection/Basic.lean index 09797f0b3d9bc8..3919f4b8a549a6 100644 --- a/Mathlib/Analysis/InnerProductSpace/Projection/Basic.lean +++ b/Mathlib/Analysis/InnerProductSpace/Projection/Basic.lean @@ -82,7 +82,7 @@ instance HasOrthogonalProjection.map_linearIsometryEquiv' [K.HasOrthogonalProjec instance : (⊤ : Submodule 𝕜 E).HasOrthogonalProjection := ⟨fun v ↦ ⟨v, trivial, by simp⟩⟩ instance (K : ClosedSubmodule 𝕜 E) [CompleteSpace E] : K.HasOrthogonalProjection := by - letI := K.isClosed' + let := K.isClosed' infer_instance /-- If `K` admits an orthogonal projection, `K` and `Kᗮ` are complements of each other. -/ diff --git a/Mathlib/Analysis/InnerProductSpace/Projection/FiniteDimensional.lean b/Mathlib/Analysis/InnerProductSpace/Projection/FiniteDimensional.lean index f1542dd9fe6327..cfa7199aec6241 100644 --- a/Mathlib/Analysis/InnerProductSpace/Projection/FiniteDimensional.lean +++ b/Mathlib/Analysis/InnerProductSpace/Projection/FiniteDimensional.lean @@ -91,7 +91,7 @@ orthogonal subspace with `K₂` add to that of `K₂`. -/ theorem finrank_add_inf_finrank_orthogonal {K₁ K₂ : Submodule 𝕜 E} [FiniteDimensional 𝕜 K₂] (h : K₁ ≤ K₂) : finrank 𝕜 K₁ + finrank 𝕜 (K₁ᗮ ⊓ K₂ : Submodule 𝕜 E) = finrank 𝕜 K₂ := by - haveI : FiniteDimensional 𝕜 K₁ := Submodule.finiteDimensional_of_le h + have : FiniteDimensional 𝕜 K₁ := Submodule.finiteDimensional_of_le h have hd := Submodule.finrank_sup_add_finrank_inf_eq K₁ (K₁ᗮ ⊓ K₂) rw [← inf_assoc, (Submodule.orthogonal_disjoint K₁).eq_bot, bot_inf_eq, finrank_bot, Submodule.sup_orthogonal_inf_of_hasOrthogonalProjection h] at hd @@ -126,7 +126,7 @@ theorem finrank_add_finrank_orthogonal' [FiniteDimensional 𝕜 E] {K : Submodul span of a nonzero vector is one less than the dimension of the space. -/ theorem finrank_orthogonal_span_singleton {n : ℕ} [_i : Fact (finrank 𝕜 E = n + 1)] {v : E} (hv : v ≠ 0) : finrank 𝕜 (𝕜 ∙ v)ᗮ = n := by - haveI : FiniteDimensional 𝕜 E := .of_fact_finrank_eq_succ n + have : FiniteDimensional 𝕜 E := .of_fact_finrank_eq_succ n exact finrank_add_finrank_orthogonal' <| by simp [finrank_span_singleton hv, _i.elim, add_comm] @@ -136,7 +136,7 @@ theorem mem_span_singleton_of_inner_eq_zero_of_inner_eq_zero [Fact (finrank 𝕜 E = 2)] {u v w : E} (hv : v ≠ 0) (hw : w ≠ 0) (huv : ⟪v, u⟫_𝕜 = 0) (hwv : ⟪v, w⟫_𝕜 = 0) : u ∈ 𝕜 ∙ w := by - haveI : FiniteDimensional 𝕜 E := .of_fact_finrank_eq_succ 1 + have : FiniteDimensional 𝕜 E := .of_fact_finrank_eq_succ 1 suffices heq : (𝕜 ∙ v)ᗮ = 𝕜 ∙ w by rwa [← heq, mem_orthogonal_singleton_iff_inner_right] exact eq_span_singleton_of_mem_of_finrank_eq_one (finrank_orthogonal_span_singleton (n := 1) hv) @@ -173,7 +173,7 @@ theorem LinearIsometryEquiv.reflections_generate_dim_aux [FiniteDimensional ℝ · obtain ⟨V, hV₁, hV₂⟩ := IH φ hn' exact ⟨V, hV₁.trans n.le_succ, hV₂⟩ -- Take a nonzero element `v` of the orthogonal complement of `W`. - haveI : Nontrivial Wᗮ := nontrivial_of_finrank_pos (by lia : 0 < finrank ℝ Wᗮ) + have : Nontrivial Wᗮ := nontrivial_of_finrank_pos (by lia : 0 < finrank ℝ Wᗮ) obtain ⟨v, hv⟩ := exists_ne (0 : Wᗮ) have hφv : φ v ∈ Wᗮ := by intro w hw @@ -255,7 +255,7 @@ orthogonal complement. -/ theorem OrthogonalFamily.isInternal_iff_of_isComplete [DecidableEq ι] {V : ι → Submodule 𝕜 E} (hV : OrthogonalFamily 𝕜 (fun i => V i) fun i => (V i).subtypeₗᵢ) (hc : IsComplete (↑(iSup V) : Set E)) : DirectSum.IsInternal V ↔ (iSup V)ᗮ = ⊥ := by - haveI : CompleteSpace (↥(iSup V)) := hc.completeSpace_coe + have : CompleteSpace (↥(iSup V)) := hc.completeSpace_coe simp only [DirectSum.isInternal_submodule_iff_iSupIndep_and_iSup_eq_top, hV.independent, true_and, orthogonal_eq_bot_iff] @@ -321,7 +321,7 @@ noncomputable abbrev OrthogonalFamily.decomposition decompose' x := DFinsupp.equivFunOnFintype.symm fun i => (V i).orthogonalProjectionOnto x left_inv x := by dsimp only - letI := fun i => Classical.decEq (V i) + let := fun i => Classical.decEq (V i) rw [DirectSum.coeAddMonoidHom, DirectSum.toAddMonoid, DFinsupp.liftAddHom_apply] -- This used to be `rw`, but we need `erw` after https://github.com/leanprover/lean4/pull/2644 erw [DFinsupp.sumAddHom_apply]; rw [DFinsupp.sum_eq_sum_fintype] diff --git a/Mathlib/Analysis/InnerProductSpace/Projection/Minimal.lean b/Mathlib/Analysis/InnerProductSpace/Projection/Minimal.lean index 6e1e5fbdfe7621..8310c62e48e4ce 100644 --- a/Mathlib/Analysis/InnerProductSpace/Projection/Minimal.lean +++ b/Mathlib/Analysis/InnerProductSpace/Projection/Minimal.lean @@ -34,7 +34,7 @@ Then there exists a (unique) `v` in `K` that minimizes the distance `‖u - v‖ theorem exists_norm_eq_iInf_of_complete_convex {K : Set F} (ne : K.Nonempty) (h₁ : IsComplete K) (h₂ : Convex ℝ K) : ∀ u : F, ∃ v ∈ K, ‖u - v‖ = ⨅ w : K, ‖u - w‖ := fun u => by let δ := ⨅ w : K, ‖u - w‖ - letI : Nonempty K := ne.to_subtype + let : Nonempty K := ne.to_subtype have zero_le_δ : 0 ≤ δ := le_ciInf fun _ => norm_nonneg _ have δ_le : ∀ w : K, δ ≤ ‖u - w‖ := ciInf_le ⟨0, Set.forall_mem_range.2 fun _ => norm_nonneg _⟩ have δ_le' : ∀ w ∈ K, δ ≤ ‖u - w‖ := fun w hw => δ_le ⟨w, hw⟩ @@ -137,7 +137,7 @@ theorem exists_norm_eq_iInf_of_complete_convex {K : Set F} (ne : K.Nonempty) (h space. -/ theorem norm_eq_iInf_iff_real_inner_le_zero {K : Set F} (h : Convex ℝ K) {u : F} {v : F} (hv : v ∈ K) : (‖u - v‖ = ⨅ w : K, ‖u - w‖) ↔ ∀ w ∈ K, ⟪u - v, w - v⟫_ℝ ≤ 0 := by - letI : Nonempty K := ⟨⟨v, hv⟩⟩ + let : Nonempty K := ⟨⟨v, hv⟩⟩ constructor · intro eq w hw let δ := ⨅ w : K, ‖u - w‖ @@ -229,7 +229,7 @@ This point `v` is usually called the orthogonal projection of `u` onto `K`. -/ theorem exists_norm_eq_iInf_of_complete_subspace (h : IsComplete (↑K : Set E)) : ∀ u : E, ∃ v ∈ K, ‖u - v‖ = ⨅ w : (K : Set E), ‖u - w‖ := by - letI : InnerProductSpace ℝ E := InnerProductSpace.rclikeToReal 𝕜 E + let : InnerProductSpace ℝ E := InnerProductSpace.rclikeToReal 𝕜 E let K' : Submodule ℝ E := Submodule.restrictScalars ℝ K exact exists_norm_eq_iInf_of_complete_convex ⟨0, K'.zero_mem⟩ h K'.convex @@ -284,7 +284,7 @@ for all `w ∈ K`, `⟪u - v, w⟫ = 0` (i.e., `u - v` is orthogonal to the subs -/ theorem norm_eq_iInf_iff_inner_eq_zero {u : E} {v : E} (hv : v ∈ K) : (‖u - v‖ = ⨅ w : K, ‖u - w‖) ↔ ∀ w ∈ K, ⟪u - v, w⟫ = 0 := by - letI : InnerProductSpace ℝ E := InnerProductSpace.rclikeToReal 𝕜 E + let : InnerProductSpace ℝ E := InnerProductSpace.rclikeToReal 𝕜 E let K' : Submodule ℝ E := K.restrictScalars ℝ constructor · intro H diff --git a/Mathlib/Analysis/InnerProductSpace/Rayleigh.lean b/Mathlib/Analysis/InnerProductSpace/Rayleigh.lean index d1eb401d913e89..7a2eb7a76150d8 100644 --- a/Mathlib/Analysis/InnerProductSpace/Rayleigh.lean +++ b/Mathlib/Analysis/InnerProductSpace/Rayleigh.lean @@ -257,7 +257,7 @@ variable [CompleteSpace E] {T : E →L[𝕜] E} theorem eq_smul_self_of_isLocalExtrOn (hT : IsSelfAdjoint T) {x₀ : E} (hextr : IsLocalExtrOn T.reApplyInnerSelf (sphere (0 : E) ‖x₀‖) x₀) : T x₀ = (T.rayleighQuotient x₀ : 𝕜) • x₀ := by - letI := InnerProductSpace.rclikeToReal 𝕜 E + let := InnerProductSpace.rclikeToReal 𝕜 E let hSA := hT.isSymmetric.restrictScalars.toSelfAdjoint.prop exact hSA.eq_smul_self_of_isLocalExtrOn_real hextr @@ -324,7 +324,7 @@ namespace IsSymmetric finite-dimensional vector space is an eigenvalue for that operator. -/ theorem hasEigenvalue_iSup_of_finiteDimensional [Nontrivial E] (hT : T.IsSymmetric) : HasEigenvalue T (⨆ x : { x : E // x ≠ 0 }, RCLike.re ⟪T x, x⟫ / ‖(x : E)‖ ^ 2 : ℝ) := by - haveI := FiniteDimensional.proper_rclike 𝕜 E + have := FiniteDimensional.proper_rclike 𝕜 E let T' := hT.toSelfAdjoint obtain ⟨x, hx⟩ : ∃ x : E, x ≠ 0 := exists_ne 0 have H₁ : IsCompact (sphere (0 : E) ‖x‖) := isCompact_sphere _ _ @@ -343,7 +343,7 @@ theorem hasEigenvalue_iSup_of_finiteDimensional [Nontrivial E] (hT : T.IsSymmetr finite-dimensional vector space is an eigenvalue for that operator. -/ theorem hasEigenvalue_iInf_of_finiteDimensional [Nontrivial E] (hT : T.IsSymmetric) : HasEigenvalue T (⨅ x : { x : E // x ≠ 0 }, RCLike.re ⟪T x, x⟫ / ‖(x : E)‖ ^ 2 : ℝ) := by - haveI := FiniteDimensional.proper_rclike 𝕜 E + have := FiniteDimensional.proper_rclike 𝕜 E let T' := hT.toSelfAdjoint obtain ⟨x, hx⟩ : ∃ x : E, x ≠ 0 := exists_ne 0 have H₁ : IsCompact (sphere (0 : E) ‖x‖) := isCompact_sphere _ _ diff --git a/Mathlib/Analysis/InnerProductSpace/Spectrum.lean b/Mathlib/Analysis/InnerProductSpace/Spectrum.lean index 5e27101335fda7..b6eaae80d2bd5e 100644 --- a/Mathlib/Analysis/InnerProductSpace/Spectrum.lean +++ b/Mathlib/Analysis/InnerProductSpace/Spectrum.lean @@ -140,7 +140,7 @@ theorem orthogonalComplement_iSup_eigenspaces_eq_bot (hT : T.IsSymmetric) : have hT' : IsSymmetric _ := hT.restrict_invariant hT.orthogonalComplement_iSup_eigenspaces_invariant -- a self-adjoint operator on a nontrivial inner product space has an eigenvalue - haveI := + have := hT'.subsingleton_of_no_eigenvalue_finiteDimensional hT.orthogonalComplement_iSup_eigenspaces exact Submodule.eq_bot_of_subsingleton diff --git a/Mathlib/Analysis/InnerProductSpace/l2Space.lean b/Mathlib/Analysis/InnerProductSpace/l2Space.lean index a4d66041103696..f91432211feb98 100644 --- a/Mathlib/Analysis/InnerProductSpace/l2Space.lean +++ b/Mathlib/Analysis/InnerProductSpace/l2Space.lean @@ -430,7 +430,7 @@ protected theorem hasSum_repr_symm (b : HilbertBasis ι 𝕜 E) (f : ℓ²(ι, exact (↑b.repr.symm.toContinuousLinearEquiv : ℓ²(ι, 𝕜) →L[𝕜] E).hasSum this ext i apply b.repr.injective - letI : NormedSpace 𝕜 (lp (fun _i : ι => 𝕜) 2) := by infer_instance + let : NormedSpace 𝕜 (lp (fun _i : ι => 𝕜) 2) := by infer_instance have : lp.single (E := (fun _ : ι => 𝕜)) 2 i (f i * 1) = f i • lp.single 2 i 1 := lp.single_smul (E := (fun _ : ι => 𝕜)) 2 i (f i) (1 : 𝕜) rw [mul_one] at this diff --git a/Mathlib/Analysis/LocallyConvex/Bounded.lean b/Mathlib/Analysis/LocallyConvex/Bounded.lean index e566bef73d8e25..14832b54bbd622 100644 --- a/Mathlib/Analysis/LocallyConvex/Bounded.lean +++ b/Mathlib/Analysis/LocallyConvex/Bounded.lean @@ -390,7 +390,7 @@ variable [UniformSpace E] [IsUniformAddGroup E] [ContinuousSMul 𝕜 E] theorem TotallyBounded.isVonNBounded {s : Set E} (hs : TotallyBounded s) : Bornology.IsVonNBounded 𝕜 s := by if h : ∃ x : 𝕜, 1 < ‖x‖ then - letI : NontriviallyNormedField 𝕜 := ⟨h⟩ + let : NontriviallyNormedField 𝕜 := ⟨h⟩ rw [totallyBounded_iff_subset_finite_iUnion_nhds_zero] at hs intro U hU have h : Filter.Tendsto (fun x : E × E => x.fst + x.snd) (𝓝 0) (𝓝 0) := @@ -406,7 +406,7 @@ theorem TotallyBounded.isVonNBounded {s : Set E} (hs : TotallyBounded s) : refine fun y _ => Absorbs.mono_left ?_ hx_fstsnd exact (absorbent_nhds_zero hx.1.1).vadd_absorbs hx.2.2.absorbs_self else - haveI : BoundedSpace 𝕜 := ⟨Metric.isBounded_iff.2 ⟨1, by simp_all [dist_eq_norm]⟩⟩ + have : BoundedSpace 𝕜 := ⟨Metric.isBounded_iff.2 ⟨1, by simp_all [dist_eq_norm]⟩⟩ exact Bornology.IsVonNBounded.of_boundedSpace end IsUniformAddGroup diff --git a/Mathlib/Analysis/LocallyConvex/HahnBanach.lean b/Mathlib/Analysis/LocallyConvex/HahnBanach.lean index 1082d18d304e88..7036a95558e333 100644 --- a/Mathlib/Analysis/LocallyConvex/HahnBanach.lean +++ b/Mathlib/Analysis/LocallyConvex/HahnBanach.lean @@ -51,9 +51,9 @@ variable [NormedField 𝕜] [IsRCLikeNormedField 𝕜] theorem Module.Dual.exists_extension_of_le_seminorm [Module 𝕜 E] (S : Submodule 𝕜 E) (f : Dual 𝕜 S) {p : Seminorm 𝕜 E} (hp : ∀ x, ‖f x‖ ≤ p x) : ∃ g : Dual 𝕜 E, (∀ x : S, g x = f x) ∧ ∀ x, ‖g x‖ ≤ p x := by - letI : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 - letI : Module ℝ E := .restrictScalars ℝ 𝕜 E - letI : IsScalarTower ℝ 𝕜 E := .restrictScalars _ _ _ + let : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 + let : Module ℝ E := .restrictScalars ℝ 𝕜 E + let : IsScalarTower ℝ 𝕜 E := .restrictScalars _ _ _ let fr : Dual ℝ S := reLm.comp (f.restrictScalars ℝ) obtain ⟨g, (hg : ∀ x : S, g x = fr x), hgp⟩ := fr.exists_extension_of_le_seminorm_real (S.restrictScalars ℝ) (p := p.restrictScalars ℝ) @@ -106,7 +106,7 @@ space. -/ lemma ContinuousLinearMap.exist_extension_of_finiteDimensional_range {S : Submodule 𝕜 E} (f : S →L[𝕜] F) [FiniteDimensional 𝕜 f.range] : ∃ g : E →L[𝕜] F, f = g.comp S.subtypeL := by - letI : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 + let : RCLike 𝕜 := IsRCLikeNormedField.rclike 𝕜 let b := Module.finBasis 𝕜 f.range let e := b.equivFunL let fi := fun i ↦ (LinearMap.toContinuousLinearMap (b.coord i)).comp diff --git a/Mathlib/Analysis/LocallyConvex/WeakDual.lean b/Mathlib/Analysis/LocallyConvex/WeakDual.lean index 92f685b76fa21a..881346ba1a82e5 100644 --- a/Mathlib/Analysis/LocallyConvex/WeakDual.lean +++ b/Mathlib/Analysis/LocallyConvex/WeakDual.lean @@ -137,9 +137,9 @@ functionals. -/ theorem mem_span_iff_continuous {f : ι → E →ₗ[𝕜] 𝕜} (φ : E →ₗ[𝕜] 𝕜) : φ ∈ Submodule.span 𝕜 (Set.range f) ↔ Continuous[⨅ i, induced (f i) inferInstance, inferInstance] φ := by - letI t𝕜 : TopologicalSpace 𝕜 := inferInstance - letI t₁ : TopologicalSpace E := ⨅ i, induced (f i) t𝕜 - letI t₂ (s : Finset ι) : TopologicalSpace E := ⨅ i : s, induced (f i) t𝕜 + let t𝕜 : TopologicalSpace 𝕜 := inferInstance + let t₁ : TopologicalSpace E := ⨅ i, induced (f i) t𝕜 + let t₂ (s : Finset ι) : TopologicalSpace E := ⨅ i : s, induced (f i) t𝕜 suffices Continuous[t₁, t𝕜] φ ↔ ∃ s : Finset ι, Continuous[t₂ s, t𝕜] φ by simp_rw [this, ← mem_span_iff_continuous_of_finite, Submodule.span_range_eq_iSup, @@ -163,7 +163,7 @@ theorem mem_span_iff_bound {f : ι → E →ₗ[𝕜] 𝕜} (φ : E →ₗ[𝕜] φ ∈ Submodule.span 𝕜 (Set.range f) ↔ ∃ s : Finset ι, ∃ c : ℝ≥0, φ.toSeminorm ≤ c • (s.sup fun i ↦ (f i).toSeminorm) := by - letI t𝕜 : TopologicalSpace 𝕜 := inferInstance + let t𝕜 : TopologicalSpace 𝕜 := inferInstance let t := ⨅ i, induced (f i) t𝕜 have : IsTopologicalAddGroup E := topologicalAddGroup_iInf fun _ ↦ topologicalAddGroup_induced _ have : WithSeminorms (fun i ↦ (f i).toSeminorm) := by diff --git a/Mathlib/Analysis/Matrix/LDL.lean b/Mathlib/Analysis/Matrix/LDL.lean index f9e34f9e8eec95..83f01ab263e5a5 100644 --- a/Mathlib/Analysis/Matrix/LDL.lean +++ b/Mathlib/Analysis/Matrix/LDL.lean @@ -59,8 +59,8 @@ theorem LDL.lowerInv_eq_gramSchmidtBasis : ((Pi.basisFun 𝕜 n).toMatrix (@gramSchmidtBasis 𝕜 (n → 𝕜) _ (Sᵀ.toNormedAddCommGroup hS.transpose) (Sᵀ.toInnerProductSpace hS.transpose.posSemidef) n _ _ _ (Pi.basisFun 𝕜 n)))ᵀ := by - letI := (Sᵀ.toNormedAddCommGroup hS.transpose) - letI := (Sᵀ.toInnerProductSpace hS.transpose.posSemidef) + let := (Sᵀ.toNormedAddCommGroup hS.transpose) + let := (Sᵀ.toInnerProductSpace hS.transpose.posSemidef) ext i j rw [LDL.lowerInv, Basis.coePiBasisFun.toMatrix_eq_transpose, coe_gramSchmidtBasis] rfl diff --git a/Mathlib/Analysis/Normed/Affine/AddTorsorBases.lean b/Mathlib/Analysis/Normed/Affine/AddTorsorBases.lean index 9ce6fe4f1ad9a8..559c5ad9cf6dd6 100644 --- a/Mathlib/Analysis/Normed/Affine/AddTorsorBases.lean +++ b/Mathlib/Analysis/Normed/Affine/AddTorsorBases.lean @@ -63,7 +63,7 @@ theorem AffineBasis.interior_convexHull {ι E : Type*} [Finite ι] [NormedAddCom AffineSubspace.eq_univ_of_subsingleton_span_eq_top (subsingleton_range _) b.tot simp [this] · -- The positive-dimensional case. - haveI : FiniteDimensional ℝ E := b.finiteDimensional + have : FiniteDimensional ℝ E := b.finiteDimensional have : convexHull ℝ (range b) = ⋂ i, b.coord i ⁻¹' Ici 0 := by rw [b.convexHull_eq_nonneg_coord, setOf_forall]; rfl ext @@ -126,7 +126,7 @@ theorem affineSpan_eq_top_of_nonempty_interior {s : Set V} theorem AffineBasis.centroid_mem_interior_convexHull {ι} [Fintype ι] (b : AffineBasis ι ℝ V) : Finset.univ.centroid ℝ b ∈ interior (convexHull ℝ (range b)) := by - haveI := b.nonempty + have := b.nonempty simp only [b.interior_convexHull, mem_setOf_eq, b.coord_apply_centroid (Finset.mem_univ _), inv_pos, Nat.cast_pos, Finset.card_pos, Finset.univ_nonempty, forall_true_iff] diff --git a/Mathlib/Analysis/Normed/Affine/MazurUlam.lean b/Mathlib/Analysis/Normed/Affine/MazurUlam.lean index 64159ec8e19bc6..7b9dafac98dbc3 100644 --- a/Mathlib/Analysis/Normed/Affine/MazurUlam.lean +++ b/Mathlib/Analysis/Normed/Affine/MazurUlam.lean @@ -49,7 +49,7 @@ theorem midpoint_fixed {x y : PE} : set z := midpoint ℝ x y -- Consider the set of `e : E ≃ᵢ E` such that `e x = x` and `e y = y` set s := { e : PE ≃ᵢ PE | e x = x ∧ e y = y } - haveI : Nonempty s := ⟨⟨IsometryEquiv.refl PE, rfl, rfl⟩⟩ + have : Nonempty s := ⟨⟨IsometryEquiv.refl PE, rfl, rfl⟩⟩ -- On the one hand, `e` cannot send the midpoint `z` of `[x, y]` too far have h_bdd : BddAbove (range fun e : s => dist ((e : PE ≃ᵢ PE) z) z) := by refine ⟨dist x z + dist x z, forall_mem_range.2 <| Subtype.forall.2 ?_⟩ diff --git a/Mathlib/Analysis/Normed/Algebra/Exponential.lean b/Mathlib/Analysis/Normed/Algebra/Exponential.lean index a1a169cb33b4c4..899c00549cd086 100644 --- a/Mathlib/Analysis/Normed/Algebra/Exponential.lean +++ b/Mathlib/Analysis/Normed/Algebra/Exponential.lean @@ -377,7 +377,7 @@ theorem isUnit_exp_of_mem_ball [CharZero 𝕂] {x : 𝔸} theorem invOf_exp_of_mem_ball [CharZero 𝕂] {x : 𝔸} (hx : x ∈ Metric.eball (0 : 𝔸) (expSeries 𝕂 𝔸).radius) [Invertible (exp x)] : ⅟(exp x) = exp (-x) := by - letI := invertibleExpOfMemBall hx; convert! (rfl : ⅟(exp x) = _) + let := invertibleExpOfMemBall hx; convert! (rfl : ⅟(exp x) = _) /-- Any continuous ring homomorphism commutes with `NormedSpace.exp`. -/ theorem map_exp_of_mem_ball [Algebra 𝕂 𝔹] [CharZero 𝕂] {F} [FunLike F 𝔸 𝔹] [RingHomClass F 𝔸 𝔹] diff --git a/Mathlib/Analysis/Normed/Algebra/QuaternionExponential.lean b/Mathlib/Analysis/Normed/Algebra/QuaternionExponential.lean index a9da2d7116e7fc..1fa83cb1e4a22a 100644 --- a/Mathlib/Analysis/Normed/Algebra/QuaternionExponential.lean +++ b/Mathlib/Analysis/Normed/Algebra/QuaternionExponential.lean @@ -42,7 +42,7 @@ theorem expSeries_even_of_imaginary {q : Quaternion ℝ} (hq : q.re = 0) (n : ↑((-1 : ℝ) ^ n * ‖q‖ ^ (2 * n) / (2 * n)!) := by rw [expSeries_apply_eq] have hq2 : q ^ 2 = -normSq q := sq_eq_neg_normSq.mpr hq - letI k : ℝ := ↑(2 * n)! + let k : ℝ := ↑(2 * n)! calc k⁻¹ • q ^ (2 * n) = k⁻¹ • (-normSq q) ^ n := by rw [pow_mul, hq2] _ = k⁻¹ • ↑((-1 : ℝ) ^ n * ‖q‖ ^ (2 * n)) := ?_ diff --git a/Mathlib/Analysis/Normed/Algebra/Spectrum.lean b/Mathlib/Analysis/Normed/Algebra/Spectrum.lean index 152771a3d46fe5..3e85035d51555c 100644 --- a/Mathlib/Analysis/Normed/Algebra/Spectrum.lean +++ b/Mathlib/Analysis/Normed/Algebra/Spectrum.lean @@ -120,7 +120,7 @@ theorem mem_resolventSet_of_norm_lt_mul {a : A} {k : 𝕜} (h : ‖a‖ * ‖(1 nontriviality A have hk : k ≠ 0 := ne_zero_of_norm_ne_zero ((mul_nonneg (norm_nonneg _) (norm_nonneg _)).trans_lt h).ne' - letI ku := Units.map ↑ₐ.toMonoidHom (Units.mk0 k hk) + let ku := Units.map ↑ₐ.toMonoidHom (Units.mk0 k hk) rw [← inv_inv ‖(1 : A)‖, mul_inv_lt_iff₀' (inv_pos.2 <| norm_pos_iff.2 (one_ne_zero : (1 : A) ≠ 0))] at h have hku : ‖-a‖ < ‖(↑ku⁻¹ : A)‖⁻¹ := by simpa [ku, norm_algebraMap] using h diff --git a/Mathlib/Analysis/Normed/Field/Dense.lean b/Mathlib/Analysis/Normed/Field/Dense.lean index 8925e7da7400f5..36f04de14093ee 100644 --- a/Mathlib/Analysis/Normed/Field/Dense.lean +++ b/Mathlib/Analysis/Normed/Field/Dense.lean @@ -51,8 +51,8 @@ theorem IsAlgClosed.of_denseRange {K L : Type*} [Field K] [NontriviallyNormedFie intro f fmon firr have fnatdeg0 : f.natDegree ≠ 0 := (Irreducible.natDegree_pos firr).ne' let F := f.SplittingField - letI : NormedField F := spectralNorm.normedField L F - letI : NormedAlgebra L F := spectralNorm.normedAlgebra L F + let : NormedField F := spectralNorm.normedField L F + let : NormedAlgebra L F := spectralNorm.normedAlgebra L F let a := rootOfSplits (SplittingField.splits f) (by simpa using degree_ne_of_natDegree_ne fnatdeg0) have fa0 : f.aeval a = 0 := by diff --git a/Mathlib/Analysis/Normed/Group/Uniform.lean b/Mathlib/Analysis/Normed/Group/Uniform.lean index f3b432ea05b8e2..82be8e8e0979af 100644 --- a/Mathlib/Analysis/Normed/Group/Uniform.lean +++ b/Mathlib/Analysis/Normed/Group/Uniform.lean @@ -347,7 +347,7 @@ namespace AntilipschitzWith @[to_additive] theorem mul_lipschitzWith (hf : AntilipschitzWith Kf f) (hg : LipschitzWith Kg g) (hK : Kg < Kf⁻¹) : AntilipschitzWith (Kf⁻¹ - Kg)⁻¹ fun x => f x * g x := by - letI : PseudoMetricSpace α := PseudoEMetricSpace.toPseudoMetricSpace hf.edist_ne_top + let : PseudoMetricSpace α := PseudoEMetricSpace.toPseudoMetricSpace hf.edist_ne_top refine AntilipschitzWith.of_le_mul_dist fun x y => ?_ rw [NNReal.coe_inv, ← _root_.div_eq_inv_mul] rw [le_div_iff₀ (NNReal.coe_pos.2 <| tsub_pos_iff_lt.2 hK)] diff --git a/Mathlib/Analysis/Normed/Lp/PiLp.lean b/Mathlib/Analysis/Normed/Lp/PiLp.lean index 29f923f2419acb..4be115938cf607 100644 --- a/Mathlib/Analysis/Normed/Lp/PiLp.lean +++ b/Mathlib/Analysis/Normed/Lp/PiLp.lean @@ -1013,7 +1013,7 @@ variable [DecidableEq ι] @[simp] theorem nnnorm_single (i : ι) (b : β i) : ‖single p i b‖₊ = ‖b‖₊ := by - haveI : Nonempty ι := ⟨i⟩ + have : Nonempty ι := ⟨i⟩ induction p generalizing hp with | top => simp_rw [nnnorm_eq_ciSup] @@ -1262,7 +1262,7 @@ lemma isBoundedSMulSeminormedAddCommGroupToPi [∀ i, Module R (α i)] [∀ i, IsBoundedSMul R (α i)] : letI := pseudoMetricSpaceToPi p α IsBoundedSMul R (Π i, α i) := by - letI := pseudoMetricSpaceToPi p α + let := pseudoMetricSpaceToPi p α refine ⟨fun x y z ↦ ?_, fun x y z ↦ ?_⟩ · simpa [dist_pseudoMetricSpaceToPi] using dist_smul_pair x (toLp p y) (toLp p z) · simpa [dist_pseudoMetricSpaceToPi] using dist_pair_smul x y (toLp p z) @@ -1272,7 +1272,7 @@ lemma normSMulClassSeminormedAddCommGroupToPi [∀ i, Module R (α i)] [∀ i, NormSMulClass R (α i)] : letI := seminormedAddCommGroupToPi p α NormSMulClass R (Π i, α i) := by - letI := seminormedAddCommGroupToPi p α + let := seminormedAddCommGroupToPi p α refine ⟨fun x y ↦ ?_⟩ simp [norm_seminormedAddCommGroupToPi, norm_smul] diff --git a/Mathlib/Analysis/Normed/Lp/ProdLp.lean b/Mathlib/Analysis/Normed/Lp/ProdLp.lean index 739a0034d95587..3e83aac3ee4109 100644 --- a/Mathlib/Analysis/Normed/Lp/ProdLp.lean +++ b/Mathlib/Analysis/Normed/Lp/ProdLp.lean @@ -1047,7 +1047,7 @@ lemma isBoundedSMulSeminormedAddCommGroupToProd [Module R α] [Module R β] [IsBoundedSMul R α] [IsBoundedSMul R β] : letI := pseudoMetricSpaceToProd p α β IsBoundedSMul R (α × β) := by - letI := pseudoMetricSpaceToProd p α β + let := pseudoMetricSpaceToProd p α β refine ⟨fun x y z ↦ ?_, fun x y z ↦ ?_⟩ · simpa [dist_pseudoMetricSpaceToProd] using dist_smul_pair x (toLp p y) (toLp p z) · simpa [dist_pseudoMetricSpaceToProd] using dist_pair_smul x y (toLp p z) @@ -1057,7 +1057,7 @@ lemma normSMulClassSeminormedAddCommGroupToProd [Module R α] [Module R β] [NormSMulClass R α] [NormSMulClass R β] : letI := seminormedAddCommGroupToProd p α β NormSMulClass R (α × β) := by - letI := seminormedAddCommGroupToProd p α β + let := seminormedAddCommGroupToProd p α β exact ⟨fun x y ↦ norm_smul x (toLp p y)⟩ /-- This definition allows to endow `α × β` with a normed space structure corresponding to diff --git a/Mathlib/Analysis/Normed/Lp/lpSpace.lean b/Mathlib/Analysis/Normed/Lp/lpSpace.lean index 172f73b6945bf4..e3ecc77a6213e8 100644 --- a/Mathlib/Analysis/Normed/Lp/lpSpace.lean +++ b/Mathlib/Analysis/Normed/Lp/lpSpace.lean @@ -283,7 +283,7 @@ theorem sub {f g : ∀ i, E i} (hf : Memℓp f p) (hg : Memℓp g p) : Memℓp ( theorem finsetSum {ι} (s : Finset ι) {f : ι → ∀ i, E i} (hf : ∀ i ∈ s, Memℓp (f i) p) : Memℓp (fun a => ∑ i ∈ s, f i a) p := by - haveI : DecidableEq ι := Classical.decEq _ + have : DecidableEq ι := Classical.decEq _ revert hf refine Finset.induction_on s ?_ ?_ · simp only [zero_mem_ℓp', Finset.sum_empty, imp_true_iff] @@ -599,7 +599,7 @@ section ComparePointwise theorem norm_apply_le_norm (hp : p ≠ 0) (f : lp E p) (i : α) : ‖f i‖ ≤ ‖f‖ := by rcases eq_or_ne p ∞ with (rfl | hp') - · haveI : Nonempty α := ⟨i⟩ + · have : Nonempty α := ⟨i⟩ exact (isLUB_norm f).1 ⟨i, rfl⟩ have hp'' : 0 < p.toReal := ENNReal.toReal_pos hp hp' have : ∀ i, 0 ≤ ‖f i‖ ^ p.toReal := fun i ↦ by positivity @@ -712,7 +712,7 @@ theorem norm_const_smul_le (hp : p ≠ 0) (c : 𝕜) (f : lp E p) : ‖c • f simp_rw [← Set.range_comp, Function.comp_def] at hfc exact norm_le_of_forall_le (by positivity) fun i ↦ norm_smul_le c (f i) |>.trans <| hfc.1 ⟨i, rfl⟩ - · letI inst : NNNorm (lp E p) := ⟨fun f => ⟨‖f‖, norm_nonneg' _⟩⟩ + · let inst : NNNorm (lp E p) := ⟨fun f => ⟨‖f‖, norm_nonneg' _⟩⟩ have coe_nnnorm : ∀ f : lp E p, ↑‖f‖₊ = ‖f‖ := fun _ => rfl suffices ‖c • f‖₊ ^ p.toReal ≤ (‖c‖₊ * ‖f‖₊) ^ p.toReal by rwa [NNReal.rpow_le_rpow_iff hp] at this @@ -1095,7 +1095,7 @@ protected theorem norm_sum_single (hp : 0 < p.toReal) (f : ∀ i, E i) (s : Fins @[simp] protected theorem norm_single (hp : 0 < p) (i : α) (x : E i) : ‖lp.single p i x‖ = ‖x‖ := by - haveI : Nonempty α := ⟨i⟩ + have : Nonempty α := ⟨i⟩ induction p with | top => simp only [norm_eq_ciSup, lp.coeFn_single] diff --git a/Mathlib/Analysis/Normed/Module/Basic.lean b/Mathlib/Analysis/Normed/Module/Basic.lean index af6d6e2b774a5c..430def7cd51eb1 100644 --- a/Mathlib/Analysis/Normed/Module/Basic.lean +++ b/Mathlib/Analysis/Normed/Module/Basic.lean @@ -236,7 +236,7 @@ Lean would have to search for `NormedSpace 𝕜 E` with unknown `𝕜`. We register this as an instance in two cases: `𝕜 = E` and `𝕜 = ℝ`. -/ protected theorem NormedSpace.noncompactSpace : NoncompactSpace E := by by_cases! H : ∃ c : 𝕜, c ≠ 0 ∧ ‖c‖ ≠ 1 - · letI := NontriviallyNormedField.ofNormNeOne H + · let := NontriviallyNormedField.ofNormNeOne H exact ⟨fun h ↦ NormedSpace.unbounded_univ 𝕜 E h.isBounded⟩ · rcases exists_ne (0 : E) with ⟨x, hx⟩ suffices IsClosedEmbedding (Infinite.natEmbedding 𝕜 · • x) from this.noncompactSpace @@ -689,7 +689,7 @@ See note [reducible non-instances]. -/ abbrev NormedAddCommGroup.ofCore (core : NormedSpace.Core 𝕜 E) : NormedAddCommGroup E := { SeminormedAddCommGroup.ofCore core.toCore with eq_of_dist_eq_zero := by - letI := SeminormedAddCommGroup.ofCore core.toCore + let := SeminormedAddCommGroup.ofCore core.toCore intro x y h rw [← sub_eq_zero, ← core.norm_eq_zero_iff, ← norm_neg_add] exact h } @@ -703,7 +703,7 @@ abbrev NormedAddCommGroup.ofCoreReplaceUniformity [U : UniformSpace E] (core : N NormedAddCommGroup E := { SeminormedAddCommGroup.ofCoreReplaceUniformity core.toCore H with eq_of_dist_eq_zero := by - letI := SeminormedAddCommGroup.ofCore core.toCore + let := SeminormedAddCommGroup.ofCore core.toCore intro x y h rw [← sub_eq_zero, ← core.norm_eq_zero_iff, ← norm_neg_add] exact h } @@ -718,7 +718,7 @@ abbrev NormedAddCommGroup.ofCoreReplaceTopology [T : TopologicalSpace E] NormedAddCommGroup E := { SeminormedAddCommGroup.ofCoreReplaceTopology core.toCore H with eq_of_dist_eq_zero := by - letI := SeminormedAddCommGroup.ofCore core.toCore + let := SeminormedAddCommGroup.ofCore core.toCore intro x y h rw [← sub_eq_zero, ← core.norm_eq_zero_iff, ← norm_neg_add] exact h } @@ -737,7 +737,7 @@ abbrev NormedAddCommGroup.ofCoreReplaceAll [U : UniformSpace E] [B : Bornology E NormedAddCommGroup E := { SeminormedAddCommGroup.ofCoreReplaceAll core.toCore HU HB with eq_of_dist_eq_zero := by - letI := SeminormedAddCommGroup.ofCore core.toCore + let := SeminormedAddCommGroup.ofCore core.toCore intro x y h rw [← sub_eq_zero, ← core.norm_eq_zero_iff, ← norm_neg_add] exact h } diff --git a/Mathlib/Analysis/Normed/Module/Complemented.lean b/Mathlib/Analysis/Normed/Module/Complemented.lean index 077e5edb4a4ac7..3483b2bb18d340 100644 --- a/Mathlib/Analysis/Normed/Module/Complemented.lean +++ b/Mathlib/Analysis/Normed/Module/Complemented.lean @@ -81,7 +81,7 @@ variable [CompleteSpace E] {p q : Subspace 𝕜 E} theorem IsCompl.isTopCompl_of_isClosed (h : IsCompl p q) (hp : IsClosed (p : Set E)) (hq : IsClosed (q : Set E)) : IsTopCompl p q := by - haveI := hp.completeSpace_coe; haveI := hq.completeSpace_coe + have := hp.completeSpace_coe; have := hq.completeSpace_coe rw [isTopCompl_iff_continuous_symm_prodEquivOfIsCompl h] exact (p.prodEquivOfIsCompl q h).continuous_symm (continuous_prodEquivOfIsCompl h) diff --git a/Mathlib/Analysis/Normed/Module/Dual.lean b/Mathlib/Analysis/Normed/Module/Dual.lean index bfe7243f4aa58e..c879c34369bd60 100644 --- a/Mathlib/Analysis/Normed/Module/Dual.lean +++ b/Mathlib/Analysis/Normed/Module/Dual.lean @@ -117,7 +117,7 @@ theorem polar_closedBall {𝕜 E : Type*} [RCLike 𝕜] [NormedAddCommGroup E] [ theorem polar_ball {𝕜 E : Type*} [RCLike 𝕜] [NormedAddCommGroup E] [NormedSpace 𝕜 E] {r : ℝ} (hr : 0 < r) : StrongDual.polar 𝕜 (ball (0 : E) r) = closedBall (0 : StrongDual 𝕜 E) r⁻¹ := by - letI : NormedSpace ℝ E := .restrictScalars ℝ 𝕜 E + let : NormedSpace ℝ E := .restrictScalars ℝ 𝕜 E rw [← polar_closedBall hr, ← closure_ball _ hr.ne', polar_closure] /-- Given a neighborhood `s` of the origin in a normed space `E`, the dual norms of all elements of diff --git a/Mathlib/Analysis/Normed/Module/FiniteDimension.lean b/Mathlib/Analysis/Normed/Module/FiniteDimension.lean index efa1834193c4dc..e0dfb1aab6f191 100644 --- a/Mathlib/Analysis/Normed/Module/FiniteDimension.lean +++ b/Mathlib/Analysis/Normed/Module/FiniteDimension.lean @@ -184,7 +184,7 @@ theorem ContinuousLinearMap.continuous_det : Continuous fun f : E →L[𝕜] E = -- TODO: this could be easier with `det_cases` by_cases h : ∃ s : Finset E, Nonempty (Basis (↥s) 𝕜 E) · rcases h with ⟨s, ⟨b⟩⟩ - haveI : FiniteDimensional 𝕜 E := b.finiteDimensional_of_finite + have : FiniteDimensional 𝕜 E := b.finiteDimensional_of_finite classical simp_rw [LinearMap.det_eq_det_toMatrix_of_finset b] refine Continuous.matrix_det ?_ @@ -347,7 +347,7 @@ theorem isOpen_setOf_affineIndependent {ι : Type*} [Finite ι] : · simp_rw [affineIndependent_iff_linearIndependent_vsub 𝕜 _ i₀] let ι' := { x // x ≠ i₀ } cases nonempty_fintype ι - haveI : Fintype ι' := Subtype.fintype _ + have : Fintype ι' := Subtype.fintype _ convert_to! IsOpen ((fun (p : ι → E) (i : ι') ↦ p i -ᵥ p i₀) ⁻¹' {p : ι' → E | LinearIndependent 𝕜 p}) exact isOpen_setOf_linearIndependent.preimage (by fun_prop) @@ -418,7 +418,7 @@ theorem exists_norm_le_le_norm_sub_of_finset {c : 𝕜} (hc : 1 < ‖c‖) {R : (h : ¬FiniteDimensional 𝕜 E) (s : Finset E) : ∃ x : E, ‖x‖ ≤ R ∧ ∀ y ∈ s, 1 ≤ ‖y - x‖ := by let F := Submodule.span 𝕜 (s : Set E) have hF : F.FG := ⟨s, rfl⟩ - haveI : FiniteDimensional 𝕜 F := .of_fg hF + have : FiniteDimensional 𝕜 F := .of_fg hF have Fclosed : IsClosed (F : Set E) := Submodule.closed_of_finiteDimensional _ have : ∃ x, x ∉ F := by contrapose! h diff --git a/Mathlib/Analysis/Normed/Module/Multilinear/Basic.lean b/Mathlib/Analysis/Normed/Module/Multilinear/Basic.lean index d179029f25fa13..39bf5c820a5533 100644 --- a/Mathlib/Analysis/Normed/Module/Multilinear/Basic.lean +++ b/Mathlib/Analysis/Normed/Module/Multilinear/Basic.lean @@ -559,7 +559,7 @@ section @[simp] theorem norm_ofSubsingleton [Subsingleton ι] (i : ι) (f : G →L[𝕜] G') : ‖ofSubsingleton 𝕜 G G' i f‖ = ‖f‖ := by - letI : Unique ι := uniqueOfSubsingleton i + let : Unique ι := uniqueOfSubsingleton i simp [norm_def, ContinuousLinearMap.norm_def, (Equiv.funUnique _ _).symm.surjective.forall] @[simp] diff --git a/Mathlib/Analysis/Normed/Module/MultipliableUniformlyOn.lean b/Mathlib/Analysis/Normed/Module/MultipliableUniformlyOn.lean index 2f96bba86fc9c1..a57b8fa378a933 100644 --- a/Mathlib/Analysis/Normed/Module/MultipliableUniformlyOn.lean +++ b/Mathlib/Analysis/Normed/Module/MultipliableUniformlyOn.lean @@ -91,8 +91,8 @@ lemma hasProdUniformlyOn_one_add (hK : IsCompact K) (hu : Summable u) tendstoUniformlyOn_iff_tendstoUniformly_comp_coe] by_cases hKe : K = ∅ · simp [TendstoUniformly, hKe] - · haveI hCK : CompactSpace K := isCompact_iff_compactSpace.mp hK - haveI hne : Nonempty K := by rwa [Set.nonempty_coe_sort, Set.nonempty_iff_ne_empty] + · have hCK : CompactSpace K := isCompact_iff_compactSpace.mp hK + have hne : Nonempty K := by rwa [Set.nonempty_coe_sort, Set.nonempty_iff_ne_empty] let f' i : C(K, R) := ⟨_, continuousOn_iff_continuous_restrict.mp (hcts i)⟩ have hf'_bd : ∀ᶠ i in cofinite, ‖f' i‖ ≤ u i := by simp only [ContinuousMap.norm_le_of_nonempty] diff --git a/Mathlib/Analysis/Normed/Module/PiTensorProduct/InjectiveSeminorm.lean b/Mathlib/Analysis/Normed/Module/PiTensorProduct/InjectiveSeminorm.lean index 6c07e93e422bf7..85d108520eaa5c 100644 --- a/Mathlib/Analysis/Normed/Module/PiTensorProduct/InjectiveSeminorm.lean +++ b/Mathlib/Analysis/Normed/Module/PiTensorProduct/InjectiveSeminorm.lean @@ -123,8 +123,8 @@ theorem norm_eval_le_injectiveSeminorm (f : ContinuousMultilinearMap 𝕜 E F) ( set G := (⨂[𝕜] i, E i) ⧸ LinearMap.ker (lift f.toMultilinearMap) set G' := LinearMap.range (lift f.toMultilinearMap) set e := LinearMap.quotKerEquivRange (lift f.toMultilinearMap) - letI := SeminormedAddCommGroup.induced G G' e - letI := NormedSpace.induced 𝕜 G G' e + let := SeminormedAddCommGroup.induced G G' e + let := NormedSpace.induced 𝕜 G G' e set f'₀ := lift.symm (e.symm.toLinearMap ∘ₗ LinearMap.rangeRestrict (lift f.toMultilinearMap)) have hf'₀ : ∀ (x : Π (i : ι), E i), ‖f'₀ x‖ ≤ ‖f‖ * ∏ i, ‖x i‖ := fun x ↦ by change ‖e (f'₀ x)‖ ≤ _ diff --git a/Mathlib/Analysis/Normed/Operator/Banach.lean b/Mathlib/Analysis/Normed/Operator/Banach.lean index ba85918fe33a85..26a7925b5d0952 100644 --- a/Mathlib/Analysis/Normed/Operator/Banach.lean +++ b/Mathlib/Analysis/Normed/Operator/Banach.lean @@ -518,7 +518,7 @@ theorem closed_complemented_range_of_isCompl_of_ker_eq_bot {F : Type*} [NormedAd [NormedSpace 𝕜 F] [CompleteSpace F] (f : E →L[𝕜] F) (G : Submodule 𝕜 F) (h : IsCompl f.range G) (hG : IsClosed (G : Set F)) (hker : f.ker = ⊥) : IsClosed (f.range : Set F) := by - haveI : CompleteSpace G := hG.completeSpace_coe + have : CompleteSpace G := hG.completeSpace_coe let g := coprodSubtypeLEquivOfIsCompl f h hker rw [range_eq_map_coprodSubtypeLEquivOfIsCompl f h hker] apply g.toHomeomorph.isClosed_image.2 @@ -535,7 +535,7 @@ variable {F : Type*} [NormedAddCommGroup F] [NormedSpace 𝕜 F] [CompleteSpace is continuous. -/ theorem LinearMap.continuous_of_isClosed_graph (hg : IsClosed (g.graph : Set <| E × F)) : Continuous g := by - letI : CompleteSpace g.graph := completeSpace_coe_iff_isComplete.mpr hg.isComplete + let : CompleteSpace g.graph := completeSpace_coe_iff_isComplete.mpr hg.isComplete let φ₀ : E →ₗ[𝕜] E × F := LinearMap.id.prod g have : Function.LeftInverse Prod.fst φ₀ := fun x => rfl let φ : E ≃ₗ[𝕜] g.graph := diff --git a/Mathlib/Analysis/Normed/Operator/NormedSpace.lean b/Mathlib/Analysis/Normed/Operator/NormedSpace.lean index 74ba95d31cf2bd..7272c4bbf258d3 100644 --- a/Mathlib/Analysis/Normed/Operator/NormedSpace.lean +++ b/Mathlib/Analysis/Normed/Operator/NormedSpace.lean @@ -303,7 +303,7 @@ variable (𝕜) @[simp] theorem coord_norm (x : E) (h : x ≠ 0) : ‖coord 𝕜 x h‖ = ‖x‖⁻¹ := by have hx : 0 < ‖x‖ := norm_pos_iff.mpr h - haveI : Nontrivial (𝕜 ∙ x) := Submodule.nontrivial_span_singleton h + have : Nontrivial (𝕜 ∙ x) := Submodule.nontrivial_span_singleton h exact ContinuousLinearMap.homothety_norm _ fun y => homothety_inverse _ hx _ (LinearEquiv.toSpanNonzeroSingleton_homothety 𝕜 x h) _ diff --git a/Mathlib/Analysis/Normed/Order/UpperLower.lean b/Mathlib/Analysis/Normed/Order/UpperLower.lean index 1002ad60b906cd..364b117e86af48 100644 --- a/Mathlib/Analysis/Normed/Order/UpperLower.lean +++ b/Mathlib/Analysis/Normed/Order/UpperLower.lean @@ -212,7 +212,7 @@ protected lemma IsClosed.lowerClosure_pi (hs : IsClosed s) (hs' : BddAbove s) : cases nonempty_fintype ι refine IsSeqClosed.isClosed fun f x hf hx ↦ ?_ choose g hg hfg using hf - haveI : BoundedGENhdsClass ℝ := by infer_instance + have : BoundedGENhdsClass ℝ := by infer_instance obtain ⟨a, ha⟩ := hx.bddBelow_range obtain ⟨b, hb, φ, hφ, hbf⟩ := tendsto_subseq_of_bounded (hs'.isBounded_inter bddBelow_Ici) fun n ↦ ⟨hg n, (ha <| mem_range_self _).trans <| hfg _⟩ diff --git a/Mathlib/Analysis/Normed/Unbundled/FiniteExtension.lean b/Mathlib/Analysis/Normed/Unbundled/FiniteExtension.lean index f887dd057b06cd..466d40538cf042 100644 --- a/Mathlib/Analysis/Normed/Unbundled/FiniteExtension.lean +++ b/Mathlib/Analysis/Normed/Unbundled/FiniteExtension.lean @@ -176,8 +176,8 @@ theorem exists_nonarchimedean_pow_mul_seminorm_of_finiteDimensional (hfd : Finit have h1 : LinearIndepOn K id ({1} : Set L) := .singleton one_ne_zero set ι := { x // x ∈ LinearIndepOn.extend h1 (Set.subset_univ ({1} : Set L)) } set B : Basis ι K L := Basis.extend h1 - letI hfin : Fintype ι := FiniteDimensional.fintypeBasisIndex B - haveI hem : Nonempty ι := B.index_nonempty + let hfin : Fintype ι := FiniteDimensional.fintypeBasisIndex B + have hem : Nonempty ι := B.index_nonempty have h1L : (1 : L) ∈ LinearIndepOn.extend h1 _ := Basis.subset_extend _ (Set.mem_singleton (1 : L)) have hB1 : B ⟨1, h1L⟩ = (1 : L) := by rw [Basis.coe_extend, Subtype.coe_mk] diff --git a/Mathlib/Analysis/Normed/Unbundled/SpectralNorm.lean b/Mathlib/Analysis/Normed/Unbundled/SpectralNorm.lean index e8e8c4ef5c0ea9..be9786239df23c 100644 --- a/Mathlib/Analysis/Normed/Unbundled/SpectralNorm.lean +++ b/Mathlib/Analysis/Normed/Unbundled/SpectralNorm.lean @@ -583,7 +583,7 @@ variable [IsUltrametricDist K] theorem spectralNorm_neg {y : L} (hy : IsAlgebraic K y) : spectralNorm K L (-y) = spectralNorm K L y := by set E := K⟮y⟯ - haveI h_finiteDimensional_E : FiniteDimensional K E := + have h_finiteDimensional_E : FiniteDimensional K E := IntermediateField.adjoin.finiteDimensional hy.isIntegral set g := IntermediateField.AdjoinSimple.gen K y have hy : -y = (algebraMap K⟮y⟯ L) (-g) := rfl @@ -596,7 +596,7 @@ theorem spectralNorm_neg {y : L} (hy : IsAlgebraic K y) : theorem spectralNorm_smul (k : K) {y : L} (hy : IsAlgebraic K y) : spectralNorm K L (k • y) = ‖k‖₊ * spectralNorm K L y := by set E := K⟮y⟯ - haveI h_finiteDimensional_E : FiniteDimensional K E := + have h_finiteDimensional_E : FiniteDimensional K E := IntermediateField.adjoin.finiteDimensional hy.isIntegral set g := IntermediateField.AdjoinSimple.gen K y have hgy : k • y = (algebraMap (↥K⟮y⟯) L) (k • g) := rfl @@ -612,7 +612,7 @@ theorem spectralNorm_smul (k : K) {y : L} (hy : IsAlgebraic K y) : theorem spectralNorm_mul {x y : L} (hx : IsAlgebraic K x) (hy : IsAlgebraic K y) : spectralNorm K L (x * y) ≤ spectralNorm K L x * spectralNorm K L y := by set E := K⟮x, y⟯ - haveI h_finiteDimensional_E : FiniteDimensional K E := + have h_finiteDimensional_E : FiniteDimensional K E := IntermediateField.finiteDimensional_adjoin_pair hx.isIntegral hy.isIntegral set gx := IntermediateField.AdjoinPair.gen₁ K x y set gy := IntermediateField.AdjoinPair.gen₂ K x y @@ -631,7 +631,7 @@ variable [h_alg : Algebra.IsAlgebraic K L] theorem isPowMul_spectralNorm : IsPowMul (spectralNorm K L) := by intro x n hn set E := K⟮x⟯ - haveI h_finiteDimensional_E : FiniteDimensional K E := + have h_finiteDimensional_E : FiniteDimensional K E := IntermediateField.adjoin.finiteDimensional (h_alg.isAlgebraic x).isIntegral set g := IntermediateField.AdjoinSimple.gen K x with hg have h_map : algebraMap E L g ^ n = x ^ n := rfl @@ -644,7 +644,7 @@ theorem isPowMul_spectralNorm : IsPowMul (spectralNorm K L) := by theorem isNonarchimedean_spectralNorm : IsNonarchimedean (spectralNorm K L) := by intro x y set E := K⟮x, y⟯ - haveI h_finiteDimensional_E : FiniteDimensional K E := + have h_finiteDimensional_E : FiniteDimensional K E := IntermediateField.finiteDimensional_adjoin_pair (h_alg.isAlgebraic x).isIntegral (h_alg.isAlgebraic y).isIntegral set gx := IntermediateField.AdjoinPair.gen₁ K x y @@ -935,8 +935,8 @@ def uniformSpace : UniformSpace L := (metricSpace K L).toUniformSpace by the spectral norm. -/ instance (priority := 100) completeSpace [h_fin : FiniteDimensional K L] : @CompleteSpace L (uniformSpace K L) := by - letI := (normedAddCommGroup K L) - letI := (normedSpace K L) + let := (normedAddCommGroup K L) + let := (normedSpace K L) exact FiniteDimensional.complete K L omit [Algebra.IsAlgebraic K L] in diff --git a/Mathlib/Analysis/RCLike/TangentCone.lean b/Mathlib/Analysis/RCLike/TangentCone.lean index 2720c6f8d38bce..39cf5b82497327 100644 --- a/Mathlib/Analysis/RCLike/TangentCone.lean +++ b/Mathlib/Analysis/RCLike/TangentCone.lean @@ -23,12 +23,12 @@ variable {𝕜 : Type*} [NontriviallyNormedField 𝕜] [h𝕜 : IsRCLikeNormedFi theorem tangentConeAt_real_subset_isRCLikeNormedField : tangentConeAt ℝ s x ⊆ tangentConeAt 𝕜 s x := by - letI := h𝕜.rclike + let := h𝕜.rclike exact tangentConeAt_mono_field theorem UniqueDiffWithinAt.of_real (hs : UniqueDiffWithinAt ℝ s x) : UniqueDiffWithinAt 𝕜 s x := by - letI := h𝕜.rclike + let := h𝕜.rclike exact hs.mono_field theorem UniqueDiffOn.of_real (hs : UniqueDiffOn ℝ s) : diff --git a/Mathlib/Analysis/Seminorm.lean b/Mathlib/Analysis/Seminorm.lean index 0a455fc7dc5380..dac1475227039f 100644 --- a/Mathlib/Analysis/Seminorm.lean +++ b/Mathlib/Analysis/Seminorm.lean @@ -501,7 +501,7 @@ noncomputable instance instSupSet : SupSet (Seminorm 𝕜 E) where rcases h with ⟨q, hq⟩ obtain rfl | h := s.eq_empty_or_nonempty · simp [Real.iSup_of_isEmpty] - haveI : Nonempty ↑s := h.coe_sort + have : Nonempty ↑s := h.coe_sort simp only [iSup_apply] refine ciSup_le fun i => ((i : Seminorm 𝕜 E).add_le' x y).trans <| add_le_add @@ -568,7 +568,7 @@ protected theorem sSup_empty : sSup (∅ : Set (Seminorm 𝕜 E)) = ⊥ := by set_option backward.privateInPublic true in private theorem isLUB_sSup (s : Set (Seminorm 𝕜 E)) (hs₁ : BddAbove s) (hs₂ : s.Nonempty) : IsLUB s (sSup s) := by - refine ⟨fun p hp x => ?_, fun p hp x => ?_⟩ <;> haveI : Nonempty ↑s := hs₂.coe_sort <;> + refine ⟨fun p hp x => ?_, fun p hp x => ?_⟩ <;> have : Nonempty ↑s := hs₂.coe_sort <;> dsimp <;> rw [Seminorm.coe_sSup_eq hs₁, iSup_apply] · rcases hs₁ with ⟨q, hq⟩ exact le_ciSup ⟨q x, forall_mem_range.mpr fun i : s => hq i.2 x⟩ ⟨p, hp⟩ @@ -738,12 +738,12 @@ lemma closedBall_eq_metric : /-- The image of a ball under addition with a singleton is another ball. -/ theorem vadd_ball (p : Seminorm 𝕜 E) : x +ᵥ p.ball y r = p.ball (x +ᵥ y) r := by - letI := AddGroupSeminorm.toSeminormedAddCommGroup p.toAddGroupSeminorm + let := AddGroupSeminorm.toSeminormedAddCommGroup p.toAddGroupSeminorm simp [ball_eq_metric] /-- The image of a closed ball under addition with a singleton is another closed ball. -/ theorem vadd_closedBall (p : Seminorm 𝕜 E) : x +ᵥ p.closedBall y r = p.closedBall (x +ᵥ y) r := by - letI := AddGroupSeminorm.toSeminormedAddCommGroup p.toAddGroupSeminorm + let := AddGroupSeminorm.toSeminormedAddCommGroup p.toAddGroupSeminorm simp [closedBall_eq_metric] end SMul @@ -1106,8 +1106,8 @@ protected theorem uniformContinuous_of_continuousAt_zero [UniformSpace E] [IsUni protected theorem continuous_of_continuousAt_zero [TopologicalSpace E] [IsTopologicalAddGroup E] {p : Seminorm 𝕝 E} (hp : ContinuousAt p 0) : Continuous p := by - letI := IsTopologicalAddGroup.rightUniformSpace E - haveI : IsUniformAddGroup E := isUniformAddGroup_of_addCommGroup + let := IsTopologicalAddGroup.rightUniformSpace E + have : IsUniformAddGroup E := isUniformAddGroup_of_addCommGroup exact (Seminorm.uniformContinuous_of_continuousAt_zero hp).continuous /-- A seminorm is uniformly continuous if `p.ball 0 r ∈ 𝓝 0` for *all* `r > 0`. diff --git a/Mathlib/Analysis/SpecialFunctions/Bernstein.lean b/Mathlib/Analysis/SpecialFunctions/Bernstein.lean index b6bbf6d738c11c..2b2dbd9b9e2f95 100644 --- a/Mathlib/Analysis/SpecialFunctions/Bernstein.lean +++ b/Mathlib/Analysis/SpecialFunctions/Bernstein.lean @@ -181,7 +181,7 @@ and reproduced on wikipedia. -/ theorem bernsteinApproximation_uniform [LocallyConvexSpace ℝ E] (f : C(I, E)) : Tendsto (fun n : ℕ => bernsteinApproximation n f) atTop (𝓝 f) := by - letI : UniformSpace E := IsTopologicalAddGroup.rightUniformSpace E + let : UniformSpace E := IsTopologicalAddGroup.rightUniformSpace E have : IsUniformAddGroup E := isUniformAddGroup_of_addCommGroup /- Topology on a locally convex TVS is given by a family of seminorms `‖x‖_U = gauge U x`, where the open symmetric convex sets `U` form a basis of neighborhoods in this topology, diff --git a/Mathlib/Analysis/SpecialFunctions/Gaussian/FourierTransform.lean b/Mathlib/Analysis/SpecialFunctions/Gaussian/FourierTransform.lean index 0a67f28fa8aa8e..924eb23fb2ce45 100644 --- a/Mathlib/Analysis/SpecialFunctions/Gaussian/FourierTransform.lean +++ b/Mathlib/Analysis/SpecialFunctions/Gaussian/FourierTransform.lean @@ -207,7 +207,7 @@ theorem _root_.fourierIntegral_gaussian (hb : 0 < b.re) (t : ℂ) : theorem _root_.fourier_gaussian_pi' (hb : 0 < b.re) (c : ℂ) : (𝓕 fun x : ℝ => cexp (-π * b * x ^ 2 + 2 * π * c * x)) = fun t : ℝ => 1 / b ^ (1 / 2 : ℂ) * cexp (-π / b * (t + I * c) ^ 2) := by - haveI : b ≠ 0 := by contrapose! hb; rw [hb, zero_re] + have : b ≠ 0 := by contrapose! hb; rw [hb, zero_re] have h : (-↑π * b).re < 0 := by simpa only [neg_mul, neg_re, re_ofReal_mul, neg_lt_zero] using mul_pos pi_pos hb ext1 t diff --git a/Mathlib/Analysis/SpecialFunctions/Pow/Integral.lean b/Mathlib/Analysis/SpecialFunctions/Pow/Integral.lean index 98d734a4e48889..4f759ed2004a92 100644 --- a/Mathlib/Analysis/SpecialFunctions/Pow/Integral.lean +++ b/Mathlib/Analysis/SpecialFunctions/Pow/Integral.lean @@ -110,7 +110,7 @@ lemma integrableOn_ball_of_norm_le_rpow (hd : 1 ≤ Module.finrank ℝ E) {f : E (hα : α < Module.finrank ℝ E) (h_decay : ∀ᵐ x ∂μ.restrict (ball 0 r), ‖f x‖ ≤ C * ‖x‖ ^ (-α)) (h_meas : AEStronglyMeasurable f μ) : IntegrableOn f (ball 0 r) μ := by - haveI : Nontrivial E := by + have : Nontrivial E := by apply Module.nontrivial_of_finrank_pos (R := ℝ) positivity have hint : IntegrableOn (fun y ↦ y ^ (Module.finrank ℝ E - 1) • (C * y ^ (-α))) (Ioo 0 r) := by diff --git a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Complex.lean b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Complex.lean index 7932da5e271491..940d207a167d3a 100644 --- a/Mathlib/Analysis/SpecialFunctions/Trigonometric/Complex.lean +++ b/Mathlib/Analysis/SpecialFunctions/Trigonometric/Complex.lean @@ -126,7 +126,7 @@ theorem tan_add {x y : ℂ} add_div, sub_div] simp only [← div_mul_div_comm, tan, mul_one, one_mul, div_self (cos_ne_zero_iff.mpr h1), div_self (cos_ne_zero_iff.mpr h2)] - · haveI t := tan_int_mul_pi_div_two + · have t := tan_int_mul_pi_div_two obtain ⟨hx, hy, hxy⟩ := t (2 * k + 1), t (2 * l + 1), t (2 * k + 1 + (2 * l + 1)) simp only [Int.cast_add, Int.cast_two, Int.cast_mul, Int.cast_one] at hx hy hxy rw [hx, hy, add_zero, zero_div, mul_div_assoc, mul_div_assoc, ← diff --git a/Mathlib/Analysis/SpecificLimits/Basic.lean b/Mathlib/Analysis/SpecificLimits/Basic.lean index 38df94ff449430..3e6f9b38f9ce90 100644 --- a/Mathlib/Analysis/SpecificLimits/Basic.lean +++ b/Mathlib/Analysis/SpecificLimits/Basic.lean @@ -604,7 +604,7 @@ def posSumOfEncodable {ε : ℝ} (hε : 0 < ε) (ι) [Encodable ι] : theorem Set.Countable.exists_pos_hasSum_le {ι : Type*} {s : Set ι} (hs : s.Countable) {ε : ℝ} (hε : 0 < ε) : ∃ ε' : ι → ℝ, (∀ i, 0 < ε' i) ∧ ∃ c, HasSum (fun i : s ↦ ε' i) c ∧ c ≤ ε := by classical - haveI := hs.toEncodable + have := hs.toEncodable rcases posSumOfEncodable hε s with ⟨f, hf0, ⟨c, hfc, hcε⟩⟩ refine ⟨fun i ↦ if h : i ∈ s then f ⟨i, h⟩ else 1, fun i ↦ ?_, ⟨c, ?_, hcε⟩⟩ · conv_rhs => simp diff --git a/Mathlib/CategoryTheory/Abelian/Basic.lean b/Mathlib/CategoryTheory/Abelian/Basic.lean index 40f6ab0cf38964..1b63f75a0ce1fc 100644 --- a/Mathlib/CategoryTheory/Abelian/Basic.lean +++ b/Mathlib/CategoryTheory/Abelian/Basic.lean @@ -718,13 +718,13 @@ instance epi_pullback_of_epi_g [Epi g] : Epi (pullback.fst f g) := set_option backward.isDefEq.respectTransparency false in theorem epi_snd_of_isLimit [Epi f] {s : PullbackCone f g} (hs : IsLimit s) : Epi s.snd := by - haveI : Epi (NatTrans.app (limit.cone (cospan f g)).π WalkingCospan.right) := + have : Epi (NatTrans.app (limit.cone (cospan f g)).π WalkingCospan.right) := Abelian.epi_pullback_of_epi_f f g apply epi_of_epi_fac (IsLimit.conePointUniqueUpToIso_hom_comp (limit.isLimit _) hs _) set_option backward.isDefEq.respectTransparency false in theorem epi_fst_of_isLimit [Epi g] {s : PullbackCone f g} (hs : IsLimit s) : Epi s.fst := by - haveI : Epi (NatTrans.app (limit.cone (cospan f g)).π WalkingCospan.left) := + have : Epi (NatTrans.app (limit.cone (cospan f g)).π WalkingCospan.left) := Abelian.epi_pullback_of_epi_g f g apply epi_of_epi_fac (IsLimit.conePointUniqueUpToIso_hom_comp (limit.isLimit _) hs _) @@ -790,14 +790,14 @@ instance mono_pushout_of_mono_g [Mono g] : Mono (pushout.inl f g) := set_option backward.isDefEq.respectTransparency false in theorem mono_inr_of_isColimit [Mono f] {s : PushoutCocone f g} (hs : IsColimit s) : Mono s.inr := by - haveI : Mono (NatTrans.app (colimit.cocone (span f g)).ι WalkingCospan.right) := + have : Mono (NatTrans.app (colimit.cocone (span f g)).ι WalkingCospan.right) := Abelian.mono_pushout_of_mono_f f g apply mono_of_mono_fac (IsColimit.comp_coconePointUniqueUpToIso_hom hs (colimit.isColimit _) _) set_option backward.isDefEq.respectTransparency false in theorem mono_inl_of_isColimit [Mono g] {s : PushoutCocone f g} (hs : IsColimit s) : Mono s.inl := by - haveI : Mono (NatTrans.app (colimit.cocone (span f g)).ι WalkingCospan.left) := + have : Mono (NatTrans.app (colimit.cocone (span f g)).ι WalkingCospan.left) := Abelian.mono_pushout_of_mono_g f g apply mono_of_mono_fac (IsColimit.comp_coconePointUniqueUpToIso_hom hs (colimit.isColimit _) _) diff --git a/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Basic.lean b/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Basic.lean index 8e4f0f73a84f83..3de366e5bce4db 100644 --- a/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Basic.lean +++ b/Mathlib/CategoryTheory/Abelian/GrothendieckAxioms/Basic.lean @@ -143,7 +143,7 @@ lemma HasExactColimitsOfShape.of_codomain_equivalence (J : Type*) [Category* J] [Category* D] (e : C ≌ D) [HasColimitsOfShape J C] [HasExactColimitsOfShape J C] : haveI : HasColimitsOfShape J D := Adjunction.hasColimitsOfShape_of_equivalence e.inverse HasExactColimitsOfShape J D := by - haveI : HasColimitsOfShape J D := Adjunction.hasColimitsOfShape_of_equivalence e.inverse + have : HasColimitsOfShape J D := Adjunction.hasColimitsOfShape_of_equivalence e.inverse refine ⟨⟨fun _ _ _ => ⟨@fun K => ?_⟩⟩⟩ refine preservesLimit_of_natIso K (?_ : e.congrRight.inverse ⋙ colim ⋙ e.functor ≅ colim) apply e.symm.congrRight.fullyFaithfulFunctor.preimageIso @@ -167,7 +167,7 @@ lemma HasExactLimitsOfShape.of_codomain_equivalence (J : Type*) [Category* J] {D [Category* D] (e : C ≌ D) [HasLimitsOfShape J C] [HasExactLimitsOfShape J C] : haveI : HasLimitsOfShape J D := Adjunction.hasLimitsOfShape_of_equivalence e.inverse HasExactLimitsOfShape J D := by - haveI : HasLimitsOfShape J D := Adjunction.hasLimitsOfShape_of_equivalence e.inverse + have : HasLimitsOfShape J D := Adjunction.hasLimitsOfShape_of_equivalence e.inverse refine ⟨⟨fun _ _ _ => ⟨@fun K => ?_⟩⟩⟩ refine preservesColimit_of_natIso K (?_ : e.congrRight.inverse ⋙ lim ⋙ e.functor ≅ lim) apply e.symm.congrRight.fullyFaithfulFunctor.preimageIso @@ -311,10 +311,10 @@ lemma AB5OfSize_of_univLE [HasFilteredColimitsOfSize.{w₂, w₂'} C] [UnivLE.{w [UnivLE.{w', w₂'}] [AB5OfSize.{w₂, w₂'} C] : haveI : HasFilteredColimitsOfSize.{w, w'} C := hasFilteredColimitsOfSize_of_univLE.{w} AB5OfSize.{w, w'} C := by - haveI : HasFilteredColimitsOfSize.{w, w'} C := hasFilteredColimitsOfSize_of_univLE.{w} + have : HasFilteredColimitsOfSize.{w, w'} C := hasFilteredColimitsOfSize_of_univLE.{w} constructor intro J _ _ - haveI := IsFiltered.of_equivalence ((ShrinkHoms.equivalence.{w₂} J).trans <| + have := IsFiltered.of_equivalence ((ShrinkHoms.equivalence.{w₂} J).trans <| Shrink.equivalence.{w₂', w₂} (ShrinkHoms.{w'} J)) exact HasExactColimitsOfShape.of_domain_equivalence _ ((ShrinkHoms.equivalence.{w₂} J).trans <| Shrink.equivalence.{w₂', w₂} (ShrinkHoms.{w'} J)).symm @@ -345,10 +345,10 @@ lemma AB5StarOfSize_of_univLE [HasCofilteredLimitsOfSize.{w₂, w₂'} C] [UnivL [UnivLE.{w', w₂'}] [AB5StarOfSize.{w₂, w₂'} C] : haveI : HasCofilteredLimitsOfSize.{w, w'} C := hasCofilteredLimitsOfSize_of_univLE.{w} AB5StarOfSize.{w, w'} C := by - haveI : HasCofilteredLimitsOfSize.{w, w'} C := hasCofilteredLimitsOfSize_of_univLE.{w} + have : HasCofilteredLimitsOfSize.{w, w'} C := hasCofilteredLimitsOfSize_of_univLE.{w} constructor intro J _ _ - haveI := IsCofiltered.of_equivalence ((ShrinkHoms.equivalence.{w₂} J).trans <| + have := IsCofiltered.of_equivalence ((ShrinkHoms.equivalence.{w₂} J).trans <| Shrink.equivalence.{w₂', w₂} (ShrinkHoms.{w'} J)) exact HasExactLimitsOfShape.of_domain_equivalence _ ((ShrinkHoms.equivalence.{w₂} J).trans <| Shrink.equivalence.{w₂', w₂} (ShrinkHoms.{w'} J)).symm diff --git a/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/Subobject.lean b/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/Subobject.lean index 5962d1650bdae0..44e4b91088e15f 100644 --- a/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/Subobject.lean +++ b/Mathlib/CategoryTheory/Abelian/GrothendieckCategory/Subobject.lean @@ -65,7 +65,7 @@ the objects in the image of the functor `F`. -/ lemma subobjectMk_of_isColimit_eq_iSup : haveI := mono_of_isColimit_monoOver F hc f hf Subobject.mk f = ⨆ j, Subobject.mk (F.obj j).obj.hom := by - haveI := mono_of_isColimit_monoOver F hc f hf + have := mono_of_isColimit_monoOver F hc f hf apply le_antisymm · rw [le_iSup_iff] intro s H diff --git a/Mathlib/CategoryTheory/Abelian/Injective/Basic.lean b/Mathlib/CategoryTheory/Abelian/Injective/Basic.lean index 446af0e0b77b05..59b2fa5b3b4c23 100644 --- a/Mathlib/CategoryTheory/Abelian/Injective/Basic.lean +++ b/Mathlib/CategoryTheory/Abelian/Injective/Basic.lean @@ -34,7 +34,7 @@ variable {C : Type u} [Category.{v} C] [Abelian C] /-- The preadditive Yoneda functor on `J` preserves homology if `J` is injective. -/ instance preservesHomology_preadditiveYonedaObj_of_injective (J : C) [hJ : Injective J] : (preadditiveYonedaObj J).PreservesHomology := by - letI := (injective_iff_preservesEpimorphisms_preadditive_yoneda_obj' J).mp hJ + let := (injective_iff_preservesEpimorphisms_preadditive_yoneda_obj' J).mp hJ apply Functor.preservesHomology_of_preservesEpis_and_kernels /-- The preadditive Yoneda functor on `J` preserves colimits if `J` is injective. -/ diff --git a/Mathlib/CategoryTheory/Abelian/Injective/Dimension.lean b/Mathlib/CategoryTheory/Abelian/Injective/Dimension.lean index 80480ea8fccd10..b1353b7fcfb467 100644 --- a/Mathlib/CategoryTheory/Abelian/Injective/Dimension.lean +++ b/Mathlib/CategoryTheory/Abelian/Injective/Dimension.lean @@ -58,7 +58,7 @@ variable [HasExt.{w} C] (X : C) (n : ℕ) lemma subsingleton [hX : HasInjectiveDimensionLT X n] (i : ℕ) (hi : n ≤ i) (Y : C) : Subsingleton (Ext.{w} Y X i) := by - letI := HasExt.standard C + let := HasExt.standard C have := hX.subsingleton' i hi exact Ext.chgUniv.{w, max u v}.symm.subsingleton @@ -67,7 +67,7 @@ lemma mk (hX : ∀ (i : ℕ) (_ : n ≤ i) ⦃Y : C⦄, ∀ (e : Ext Y X i), e = HasInjectiveDimensionLT X n where subsingleton' i hi Y := by have : Subsingleton (Ext Y X i) := ⟨fun e₁ e₂ ↦ by simp only [hX i hi]⟩ - letI := HasExt.standard C + let := HasExt.standard C exact Ext.chgUniv.{max u v, w}.symm.subsingleton end HasInjectiveDimensionLT @@ -90,7 +90,7 @@ lemma hasInjectiveDimensionLT_iff [HasExt.{w} C] : variable {X} in lemma Limits.IsZero.hasInjectiveDimensionLT_zero (hX : IsZero X) : HasInjectiveDimensionLT X 0 := by - letI := HasExt.standard C + let := HasExt.standard C rw [hasInjectiveDimensionLT_iff] intro i hi Y e rw [← e.comp_mk₀_id, hX.eq_zero_of_tgt (𝟙 X), Ext.mk₀_zero, Ext.comp_zero] @@ -99,7 +99,7 @@ instance : HasInjectiveDimensionLT (0 : C) 0 := (isZero_zero C).hasInjectiveDimensionLT_zero lemma isZero_of_hasInjectiveDimensionLT_zero [HasInjectiveDimensionLT X 0] : IsZero X := by - letI := HasExt.standard C + let := HasExt.standard C rw [IsZero.iff_id_eq_zero] apply Ext.homEquiv₀.symm.injective simpa only [Ext.homEquiv₀_symm_apply, Ext.mk₀_zero] @@ -111,7 +111,7 @@ lemma hasInjectiveDimensionLT_zero_iff_isZero : HasInjectiveDimensionLT X 0 ↔ lemma hasInjectiveDimensionLT_of_ge (m : ℕ) (h : n ≤ m) [HasInjectiveDimensionLT X n] : HasInjectiveDimensionLT X m := by - letI := HasExt.standard C + let := HasExt.standard C rw [hasInjectiveDimensionLT_iff] intro i hi Y e exact e.eq_zero_of_hasInjectiveDimensionLT n (by lia) @@ -129,7 +129,7 @@ instance [HasInjectiveDimensionLT X n] : inferInstanceAs (HasInjectiveDimensionLT X (n + 1)) instance [Injective X] : HasInjectiveDimensionLT X 1 := by - letI := HasExt.standard C + let := HasExt.standard C rw [hasInjectiveDimensionLT_iff] intro i hi Y e obtain _ | i := i @@ -149,7 +149,7 @@ lemma injective_iff_subsingleton_ext_one [HasExt.{w} C] : variable {X} in lemma injective_iff_hasInjectiveDimensionLT_one : Injective X ↔ HasInjectiveDimensionLT X 1 := by - letI := HasExt.standard C + let := HasExt.standard C exact ⟨fun _ ↦ inferInstance, fun _ ↦ injective_iff_subsingleton_ext_one.2 (HasInjectiveDimensionLT.subsingleton X 1 1 (by rfl))⟩ @@ -161,7 +161,7 @@ end lemma Retract.hasInjectiveDimensionLT {X Y : C} (h : Retract X Y) (n : ℕ) [HasInjectiveDimensionLT Y n] : HasInjectiveDimensionLT X n := by - letI := HasExt.standard C + let := HasExt.standard C rw [hasInjectiveDimensionLT_iff] intro i hi T x rw [← x.comp_mk₀_id, ← h.retract, ← Ext.mk₀_comp_mk₀, ← Ext.comp_assoc_of_second_deg_zero, @@ -186,7 +186,7 @@ include hS lemma hasInjectiveDimensionLT_X₂ (h₁ : HasInjectiveDimensionLT S.X₁ n) (h₃ : HasInjectiveDimensionLT S.X₃ n) : HasInjectiveDimensionLT S.X₂ n := by - letI := HasExt.standard C + let := HasExt.standard C rw [hasInjectiveDimensionLT_iff] intro i hi Y x₂ obtain ⟨x₃, rfl⟩ := Ext.covariant_sequence_exact₂ _ hS x₂ @@ -196,7 +196,7 @@ lemma hasInjectiveDimensionLT_X₂ (h₁ : HasInjectiveDimensionLT S.X₁ n) lemma hasInjectiveDimensionLT_X₁ (h₁ : HasInjectiveDimensionLT S.X₃ n) (h₂ : HasInjectiveDimensionLT S.X₂ (n + 1)) : HasInjectiveDimensionLT S.X₁ (n + 1) := by - letI := HasExt.standard C + let := HasExt.standard C rw [hasInjectiveDimensionLT_iff] rintro (_ | i) hi Y x₃ · simp at hi @@ -207,7 +207,7 @@ lemma hasInjectiveDimensionLT_X₁ (h₁ : HasInjectiveDimensionLT S.X₃ n) lemma hasInjectiveDimensionLT_X₃ (h₂ : HasInjectiveDimensionLT S.X₂ n) (h₃ : HasInjectiveDimensionLT S.X₁ (n + 1)) : HasInjectiveDimensionLT S.X₃ n := by - letI := HasExt.standard C + let := HasExt.standard C rw [hasInjectiveDimensionLT_iff] intro i hi Y x₁ obtain ⟨x₂, rfl⟩ := Ext.covariant_sequence_exact₃ _ hS x₁ (add_comm _ _) diff --git a/Mathlib/CategoryTheory/Abelian/NonPreadditive.lean b/Mathlib/CategoryTheory/Abelian/NonPreadditive.lean index 6363c73b342102..9c61dd118dcb4e 100644 --- a/Mathlib/CategoryTheory/Abelian/NonPreadditive.lean +++ b/Mathlib/CategoryTheory/Abelian/NonPreadditive.lean @@ -116,7 +116,7 @@ instance : Epi (Abelian.factorThruImage f) := _ fun R (g : I ⟶ R) (hpg : p ≫ g = 0) => by -- Since C is abelian, u := ker g ≫ i is the kernel of some morphism h. let u := kernel.ι g ≫ i - haveI hu := normalMonoOfMono u + have hu := normalMonoOfMono u let h := hu.g -- By hypothesis, p factors through the kernel of g via some t. obtain ⟨t, ht⟩ := kernel.lift' g p hpg @@ -137,7 +137,7 @@ instance : Epi (Abelian.factorThruImage f) := -- i factors through u = ker h via some s. obtain ⟨s, hs⟩ := NormalMono.lift' u i hih have hs' : (s ≫ kernel.ι g) ≫ i = 𝟙 I ≫ i := by rw [Category.assoc, hs, Category.id_comp] - haveI : Epi (kernel.ι g) := epi_of_epi_fac ((cancel_mono _).1 hs') + have : Epi (kernel.ι g) := epi_of_epi_fac ((cancel_mono _).1 hs') -- ker g is an epimorphism, but ker g ≫ g = 0 = ker g ≫ 0, so g = 0 as required. exact zero_of_epi_comp _ (kernel.condition g) @@ -152,7 +152,7 @@ instance : Mono (Abelian.factorThruCoimage f) := NormalEpiCategory.mono_of_cancel_zero _ fun R (g : R ⟶ I) (hgi : g ≫ i = 0) => by -- Since C is abelian, u := p ≫ coker g is the cokernel of some morphism h. let u := p ≫ cokernel.π g - haveI hu := normalEpiOfEpi u + have hu := normalEpiOfEpi u let h := hu.g -- By hypothesis, i factors through the cokernel of g via some t. obtain ⟨t, ht⟩ := cokernel.desc' g i hgi @@ -173,7 +173,7 @@ instance : Mono (Abelian.factorThruCoimage f) := -- p factors through u = coker h via some s. obtain ⟨s, hs⟩ := NormalEpi.desc' u p hhp have hs' : p ≫ cokernel.π g ≫ s = p ≫ 𝟙 I := by rw [← Category.assoc, hs, Category.comp_id] - haveI : Mono (cokernel.π g) := mono_of_mono_fac ((cancel_epi _).1 hs') + have : Mono (cokernel.π g) := mono_of_mono_fac ((cancel_epi _).1 hs') -- coker g is a monomorphism, but g ≫ coker g = 0 = 0 ≫ coker g, so g = 0 as required. exact zero_of_comp_mono _ (cokernel.condition g) @@ -232,7 +232,7 @@ instance mono_r {A : C} : Mono (r A) := by have hyy : y = 0 := by erw [← Category.comp_id y, ← Limits.prod.lift_snd (𝟙 A) (𝟙 A), ← Category.assoc, hy, Category.assoc, prod.lift_snd, HasZeroMorphisms.comp_zero] - haveI : Mono (prod.lift (𝟙 A) (0 : A ⟶ A)) := mono_of_mono_fac (prod.lift_fst _ _) + have : Mono (prod.lift (𝟙 A) (0 : A ⟶ A)) := mono_of_mono_fac (prod.lift_fst _ _) apply (cancel_mono (prod.lift (𝟙 A) (0 : A ⟶ A))).1 rw [← hy, hyy, zero_comp, zero_comp] @@ -245,7 +245,7 @@ instance epi_r {A : C} : Epi (r A) := by · intro s apply Limits.prod.hom_ext <;> simp · intro s m h - haveI : Mono (prod.lift (𝟙 A) (0 : A ⟶ A)) := mono_of_mono_fac (prod.lift_fst _ _) + have : Mono (prod.lift (𝟙 A) (0 : A ⟶ A)) := mono_of_mono_fac (prod.lift_fst _ _) apply (cancel_mono (prod.lift (𝟙 A) (0 : A ⟶ A))).1 convert! h apply Limits.prod.hom_ext <;> simp diff --git a/Mathlib/CategoryTheory/Abelian/Projective/Basic.lean b/Mathlib/CategoryTheory/Abelian/Projective/Basic.lean index 39d166dd681b0a..101094ad0d7280 100644 --- a/Mathlib/CategoryTheory/Abelian/Projective/Basic.lean +++ b/Mathlib/CategoryTheory/Abelian/Projective/Basic.lean @@ -33,7 +33,7 @@ variable {C : Type u} [Category.{v} C] [Abelian C] noncomputable instance preservesHomology_preadditiveCoyonedaObj_of_projective (P : C) [hP : Projective P] : (preadditiveCoyonedaObj P).PreservesHomology := by - haveI := (projective_iff_preservesEpimorphisms_preadditiveCoyonedaObj P).mp hP + have := (projective_iff_preservesEpimorphisms_preadditiveCoyonedaObj P).mp hP apply Functor.preservesHomology_of_preservesEpis_and_kernels /-- The preadditive co-Yoneda functor on `P` preserves finite colimits if `P` is projective. -/ diff --git a/Mathlib/CategoryTheory/Abelian/Projective/Dimension.lean b/Mathlib/CategoryTheory/Abelian/Projective/Dimension.lean index 84d39c8c75290e..8c4f17c08fec88 100644 --- a/Mathlib/CategoryTheory/Abelian/Projective/Dimension.lean +++ b/Mathlib/CategoryTheory/Abelian/Projective/Dimension.lean @@ -58,7 +58,7 @@ variable [HasExt.{w} C] (X : C) (n : ℕ) lemma subsingleton [hX : HasProjectiveDimensionLT X n] (i : ℕ) (hi : n ≤ i) (Y : C) : Subsingleton (Ext.{w} X Y i) := by - letI := HasExt.standard C + let := HasExt.standard C have := hX.subsingleton' i hi exact Ext.chgUniv.{w, max u v}.symm.subsingleton @@ -67,7 +67,7 @@ lemma mk (hX : ∀ (i : ℕ) (_ : n ≤ i) ⦃Y : C⦄, ∀ (e : Ext X Y i), e = HasProjectiveDimensionLT X n where subsingleton' i hi Y := by have : Subsingleton (Ext X Y i) := ⟨fun e₁ e₂ ↦ by simp only [hX i hi]⟩ - letI := HasExt.standard C + let := HasExt.standard C exact Ext.chgUniv.{max u v, w}.symm.subsingleton end HasProjectiveDimensionLT @@ -90,7 +90,7 @@ lemma hasProjectiveDimensionLT_iff [HasExt.{w} C] : variable {X} in lemma Limits.IsZero.hasProjectiveDimensionLT_zero (hX : IsZero X) : HasProjectiveDimensionLT X 0 := by - letI := HasExt.standard C + let := HasExt.standard C rw [hasProjectiveDimensionLT_iff] intro i hi Y e rw [← e.mk₀_id_comp, hX.eq_of_src (𝟙 X) 0, Ext.mk₀_zero, Ext.zero_comp] @@ -99,7 +99,7 @@ instance : HasProjectiveDimensionLT (0 : C) 0 := (isZero_zero C).hasProjectiveDimensionLT_zero lemma isZero_of_hasProjectiveDimensionLT_zero [HasProjectiveDimensionLT X 0] : IsZero X := by - letI := HasExt.standard C + let := HasExt.standard C rw [IsZero.iff_id_eq_zero] apply Ext.homEquiv₀.symm.injective simpa only [Ext.homEquiv₀_symm_apply, Ext.mk₀_zero] @@ -111,7 +111,7 @@ lemma hasProjectiveDimensionLT_zero_iff_isZero : HasProjectiveDimensionLT X 0 lemma hasProjectiveDimensionLT_of_ge (m : ℕ) (h : n ≤ m) [HasProjectiveDimensionLT X n] : HasProjectiveDimensionLT X m := by - letI := HasExt.standard C + let := HasExt.standard C rw [hasProjectiveDimensionLT_iff] intro i hi Y e exact e.eq_zero_of_hasProjectiveDimensionLT n (by lia) @@ -129,7 +129,7 @@ instance [HasProjectiveDimensionLT X n] : inferInstanceAs (HasProjectiveDimensionLT X (n + 1)) instance [Projective X] : HasProjectiveDimensionLT X 1 := by - letI := HasExt.standard C + let := HasExt.standard C rw [hasProjectiveDimensionLT_iff] intro i hi Y e obtain _ | i := i @@ -150,7 +150,7 @@ lemma projective_iff_subsingleton_ext_one [HasExt.{w} C] : variable {X} in lemma projective_iff_hasProjectiveDimensionLT_one : Projective X ↔ HasProjectiveDimensionLT X 1 := by - letI := HasExt.standard C + let := HasExt.standard C exact ⟨fun _ ↦ inferInstance, fun _ ↦ projective_iff_subsingleton_ext_one.2 (HasProjectiveDimensionLT.subsingleton X 1 1 (by rfl))⟩ @@ -165,7 +165,7 @@ end lemma Retract.hasProjectiveDimensionLT {X Y : C} (h : Retract X Y) (n : ℕ) [HasProjectiveDimensionLT Y n] : HasProjectiveDimensionLT X n := by - letI := HasExt.standard C + let := HasExt.standard C rw [hasProjectiveDimensionLT_iff] intro i hi T x rw [← x.mk₀_id_comp, ← h.retract, ← Ext.mk₀_comp_mk₀, @@ -192,7 +192,7 @@ include hS lemma hasProjectiveDimensionLT_X₂ (h₁ : HasProjectiveDimensionLT S.X₁ n) (h₃ : HasProjectiveDimensionLT S.X₃ n) : HasProjectiveDimensionLT S.X₂ n := by - letI := HasExt.standard C + let := HasExt.standard C rw [hasProjectiveDimensionLT_iff] intro i hi Y x₂ obtain ⟨x₃, rfl⟩ := Ext.contravariant_sequence_exact₂ hS _ x₂ @@ -202,7 +202,7 @@ lemma hasProjectiveDimensionLT_X₂ (h₁ : HasProjectiveDimensionLT S.X₁ n) lemma hasProjectiveDimensionLT_X₃ (h₁ : HasProjectiveDimensionLT S.X₁ n) (h₂ : HasProjectiveDimensionLT S.X₂ (n + 1)) : HasProjectiveDimensionLT S.X₃ (n + 1) := by - letI := HasExt.standard C + let := HasExt.standard C rw [hasProjectiveDimensionLT_iff] rintro (_ | i) hi Y x₃ · simp at hi @@ -213,7 +213,7 @@ lemma hasProjectiveDimensionLT_X₃ (h₁ : HasProjectiveDimensionLT S.X₁ n) lemma hasProjectiveDimensionLT_X₁ (h₂ : HasProjectiveDimensionLT S.X₂ n) (h₃ : HasProjectiveDimensionLT S.X₃ (n + 1)) : HasProjectiveDimensionLT S.X₁ n := by - letI := HasExt.standard C + let := HasExt.standard C rw [hasProjectiveDimensionLT_iff] intro i hi Y x₁ obtain ⟨x₂, rfl⟩ := Ext.contravariant_sequence_exact₁ hS _ x₁ (add_comm _ _) diff --git a/Mathlib/CategoryTheory/Abelian/Pseudoelements.lean b/Mathlib/CategoryTheory/Abelian/Pseudoelements.lean index 80c12cda020d5c..69fd41dc0feb2c 100644 --- a/Mathlib/CategoryTheory/Abelian/Pseudoelements.lean +++ b/Mathlib/CategoryTheory/Abelian/Pseudoelements.lean @@ -382,11 +382,11 @@ theorem exact_of_pseudo_exact (S : ShortComplex C) -- Let's give a name to the second pullback morphism. let j : pullback (kernel.ι (cokernel.π S.f)) (kernel.ι S.g) ⟶ kernel S.g := pullback.snd _ _ -- Since `q` is an epimorphism, in particular this means that `j` is an epimorphism. - haveI pe : Epi j := epi_of_epi_fac hz₂ + have pe : Epi j := epi_of_epi_fac hz₂ -- But it is also a monomorphism, because `kernel.ι (cokernel.π f)` is: A kernel is -- always a monomorphism and the pullback of a monomorphism is a monomorphism. -- But mono + epi = iso, so `j` is an isomorphism. - haveI : IsIso j := isIso_of_mono_of_epi _ + have : IsIso j := isIso_of_mono_of_epi _ -- But then `kernel.ι g` can be expressed using all of the maps of the pullback square, and we -- are done. rw [(Iso.eq_inv_comp (asIso j)).2 pullback.condition.symm] diff --git a/Mathlib/CategoryTheory/Abelian/SerreClass/Localization.lean b/Mathlib/CategoryTheory/Abelian/SerreClass/Localization.lean index 6c7b58e5c62803..a2f3aa0b411a9e 100644 --- a/Mathlib/CategoryTheory/Abelian/SerreClass/Localization.lean +++ b/Mathlib/CategoryTheory/Abelian/SerreClass/Localization.lean @@ -431,20 +431,20 @@ lemma hasZeroObject : HasZeroObject D := Abelian.hasZeroObject lemma preservesFiniteLimits : PreservesFiniteLimits L := by - letI := abelian L P + let := abelian L P rw [((Functor.preservesFiniteLimits_tfae L).out 3 2 :)] intro _ _ f exact preservesKernel L P f lemma preservesFiniteColimits : PreservesFiniteColimits L := by - letI := abelian L P + let := abelian L P rw [((Functor.preservesFiniteColimits_tfae L).out 3 2 :)] intro _ _ f exact preservesCokernel L P f lemma isIso_map_iff {X Y : C} (f : X ⟶ Y) : IsIso (L.map f) ↔ P.isoModSerre f := by - letI := abelian L P + let := abelian L P rw [isIso_iff_mono_and_epi, mono_map_iff L P, epi_map_iff L P, isoModSerre_iff] lemma inverseImage_isomorphisms : @@ -457,7 +457,7 @@ variable (G : D ⥤ E) set_option backward.isDefEq.respectTransparency false in lemma preservesFiniteLimits_comp_iff : PreservesFiniteLimits (L ⋙ G) ↔ PreservesFiniteLimits G := by - letI := abelian L P + let := abelian L P have := preservesFiniteLimits L P refine ⟨fun _ ↦ ?_, fun _ ↦ comp_preservesFiniteLimits _ _⟩ have := (Localization.functor_additive_iff L P.isoModSerre G).mpr @@ -479,7 +479,7 @@ lemma preservesFiniteLimits_comp_iff : set_option backward.isDefEq.respectTransparency false in lemma preservesFiniteColimits_comp_iff : PreservesFiniteColimits (L ⋙ G) ↔ PreservesFiniteColimits G := by - letI := abelian L P + let := abelian L P have := preservesFiniteColimits L P refine ⟨fun _ ↦ ?_, fun _ ↦ comp_preservesFiniteColimits _ _⟩ have := (Localization.functor_additive_iff L P.isoModSerre G).mpr (by diff --git a/Mathlib/CategoryTheory/Abelian/Transfer.lean b/Mathlib/CategoryTheory/Abelian/Transfer.lean index 099e982bca1390..5bba283bc30c19 100644 --- a/Mathlib/CategoryTheory/Abelian/Transfer.lean +++ b/Mathlib/CategoryTheory/Abelian/Transfer.lean @@ -61,7 +61,7 @@ theorem hasKernels [PreservesFiniteLimits G] (i : F ⋙ G ≅ 𝟭 C) : HasKerne have : i.inv.app X ≫ G.map (F.map f) ≫ i.hom.app Y = f := by simpa using NatIso.naturality_1 i f rw [← this] - haveI : HasKernel (G.map (F.map f) ≫ i.hom.app _) := Limits.hasKernel_comp_mono _ _ + have : HasKernel (G.map (F.map f) ≫ i.hom.app _) := Limits.hasKernel_comp_mono _ _ apply Limits.hasKernel_iso_comp } set_option backward.isDefEq.respectTransparency false in @@ -72,7 +72,7 @@ theorem hasCokernels (i : F ⋙ G ≅ 𝟭 C) (adj : G ⊣ F) : HasCokernels C : have : i.inv.app X ≫ G.map (F.map f) ≫ i.hom.app Y = f := by simpa using NatIso.naturality_1 i f rw [← this] - haveI : HasCokernel (G.map (F.map f) ≫ i.hom.app _) := Limits.hasCokernel_comp_iso _ _ + have : HasCokernel (G.map (F.map f) ≫ i.hom.app _) := Limits.hasCokernel_comp_iso _ _ apply Limits.hasCokernel_epi_comp } end AbelianOfAdjunction diff --git a/Mathlib/CategoryTheory/Adhesive/Basic.lean b/Mathlib/CategoryTheory/Adhesive/Basic.lean index b10b4cf4c2cf85..25aeddb6b46e12 100644 --- a/Mathlib/CategoryTheory/Adhesive/Basic.lean +++ b/Mathlib/CategoryTheory/Adhesive/Basic.lean @@ -480,9 +480,9 @@ theorem adhesive_of_preserves_and_reflects_isomorphism (F : C ⥤ D) [PreservesColimitsOfShape WalkingSpan F] [F.ReflectsIsomorphisms] : Adhesive C := by - haveI : ReflectsLimitsOfShape WalkingCospan F := + have : ReflectsLimitsOfShape WalkingCospan F := reflectsLimitsOfShape_of_reflectsIsomorphisms - haveI : ReflectsColimitsOfShape WalkingSpan F := + have : ReflectsColimitsOfShape WalkingSpan F := reflectsColimitsOfShape_of_reflectsIsomorphisms exact adhesive_of_preserves_and_reflects F diff --git a/Mathlib/CategoryTheory/Adjunction/Reflective.lean b/Mathlib/CategoryTheory/Adjunction/Reflective.lean index b582845ff693cd..71c357b1d7d589 100644 --- a/Mathlib/CategoryTheory/Adjunction/Reflective.lean +++ b/Mathlib/CategoryTheory/Adjunction/Reflective.lean @@ -94,13 +94,13 @@ set_option backward.isDefEq.respectTransparency false in theorem mem_essImage_of_unit_isSplitMono [Reflective i] {A : C} [IsSplitMono ((reflectorAdjunction i).unit.app A)] : i.essImage A := by let η : 𝟭 C ⟶ reflector i ⋙ i := (reflectorAdjunction i).unit - haveI : IsIso (η.app (i.obj ((reflector i).obj A))) := + have : IsIso (η.app (i.obj ((reflector i).obj A))) := Functor.essImage.unit_isIso ((i.obj_mem_essImage _)) have : Epi (η.app A) := by refine @epi_of_epi _ _ _ _ _ (retraction (η.app A)) (η.app A) ?_ rw [show retraction _ ≫ η.app A = _ from η.naturality (retraction (η.app A))] apply epi_comp (η.app (i.obj ((reflector i).obj A))) - haveI := isIso_of_epi_of_isSplitMono (η.app A) + have := isIso_of_epi_of_isSplitMono (η.app A) exact (reflectorAdjunction i).mem_essImage_of_unit_isIso A /-- Composition of reflective functors. -/ @@ -225,13 +225,13 @@ set_option backward.isDefEq.respectTransparency false in lemma mem_essImage_of_counit_isSplitEpi [Coreflective j] {A : D} [IsSplitEpi ((coreflectorAdjunction j).counit.app A)] : j.essImage A := by let ε : coreflector j ⋙ j ⟶ 𝟭 D := (coreflectorAdjunction j).counit - haveI : IsIso (ε.app (j.obj ((coreflector j).obj A))) := + have : IsIso (ε.app (j.obj ((coreflector j).obj A))) := Functor.essImage.counit_isIso ((j.obj_mem_essImage _)) have : Mono (ε.app A) := by refine @mono_of_mono _ _ _ _ _ (ε.app A) (section_ (ε.app A)) ?_ rw [show ε.app A ≫ section_ _ = _ from (ε.naturality (section_ (ε.app A))).symm] apply mono_comp _ (ε.app (j.obj ((coreflector j).obj A))) - haveI := isIso_of_mono_of_isSplitEpi (ε.app A) + have := isIso_of_mono_of_isSplitEpi (ε.app A) exact (coreflectorAdjunction j).mem_essImage_of_counit_isIso A instance Coreflective.comp (F : C ⥤ D) (G : D ⥤ E) [Coreflective F] [Coreflective G] : diff --git a/Mathlib/CategoryTheory/Category/Cat/Limit.lean b/Mathlib/CategoryTheory/Category/Cat/Limit.lean index 85c58e1dcad83f..623bb8e47b117e 100644 --- a/Mathlib/CategoryTheory/Category/Cat/Limit.lean +++ b/Mathlib/CategoryTheory/Category/Cat/Limit.lean @@ -55,11 +55,11 @@ def homDiagram {F : J ⥤ Cat.{v, v}} (X Y : limit (F ⋙ Cat.objects.{v, v})) : · exact congr_hom (limit.w (F ⋙ Cat.objects) f) Y map_id X := by ext f - letI : Category (objects.obj (F.obj X)) := (inferInstance : Category (F.obj X)) + let : Category (objects.obj (F.obj X)) := (inferInstance : Category (F.obj X)) simp [Functor.congr_hom congr($(F.map_id X).toFunctor) f] map_comp {_ _ Z} f g := by ext h - letI : Category (objects.obj (F.obj Z)) := (inferInstance : Category (F.obj Z)) + let : Category (objects.obj (F.obj Z)) := (inferInstance : Category (F.obj Z)) simp [Functor.congr_hom congr($(F.map_comp f g).toFunctor) h, eqToHom_map] set_option backward.isDefEq.respectTransparency false in diff --git a/Mathlib/CategoryTheory/CofilteredSystem.lean b/Mathlib/CategoryTheory/CofilteredSystem.lean index 3d73003635fa6c..f6e31d4a2d6347 100644 --- a/Mathlib/CategoryTheory/CofilteredSystem.lean +++ b/Mathlib/CategoryTheory/CofilteredSystem.lean @@ -67,9 +67,9 @@ theorem nonempty_sections_of_finite_cofiltered_system.init {J : Type u} [SmallCa [IsCofilteredOrEmpty J] (F : J ⥤ Type u) [hf : ∀ j, Finite (F.obj j)] [hne : ∀ j, Nonempty (F.obj j)] : F.sections.Nonempty := by let F' : J ⥤ TopCat := F ⋙ TopCat.discrete - haveI : ∀ j, DiscreteTopology (F'.obj j) := fun _ => ⟨rfl⟩ - haveI : ∀ j, Finite (F'.obj j) := hf - haveI : ∀ j, Nonempty (F'.obj j) := hne + have : ∀ j, DiscreteTopology (F'.obj j) := fun _ => ⟨rfl⟩ + have : ∀ j, Finite (F'.obj j) := hf + have : ∀ j, Nonempty (F'.obj j) := hne obtain ⟨⟨u, hu⟩⟩ := TopCat.nonempty_limitCone_of_compact_t2_cofiltered_system.{u} F' exact ⟨u, hu⟩ @@ -83,12 +83,12 @@ theorem nonempty_sections_of_finite_cofiltered_system {J : Type u} [Category.{w} let J' : Type max w v u := AsSmall.{max w v} J let down : J' ⥤ J := AsSmall.down let F' : J' ⥤ Type (max u v w) := down ⋙ F ⋙ uliftFunctor.{max u w, v} - haveI : ∀ i, Nonempty (F'.obj i) := fun i => ⟨⟨Classical.arbitrary (F.obj (down.obj i))⟩⟩ - haveI : ∀ i, Finite (F'.obj i) := fun i => Finite.of_equiv (F.obj (down.obj i)) Equiv.ulift.symm + have : ∀ i, Nonempty (F'.obj i) := fun i => ⟨⟨Classical.arbitrary (F.obj (down.obj i))⟩⟩ + have : ∀ i, Finite (F'.obj i) := fun i => Finite.of_equiv (F.obj (down.obj i)) Equiv.ulift.symm -- Step 2: apply the bootstrap theorem cases isEmpty_or_nonempty J · fconstructor <;> apply isEmptyElim - haveI : IsCofiltered J := ⟨⟩ + have : IsCofiltered J := ⟨⟩ obtain ⟨u, hu⟩ := nonempty_sections_of_finite_cofiltered_system.init F' -- Step 3: interpret the results use fun j => (u ⟨j⟩).down @@ -311,7 +311,7 @@ set_option backward.defeqAttrib.useBackward true in theorem eval_section_surjective_of_surjective (i : J) : (fun s : F.sections => s.val i).Surjective := fun x => by let s : Set (F.obj i) := {x} - haveI := F.toPreimages_nonempty_of_surjective s Fsur (singleton_nonempty x) + have := F.toPreimages_nonempty_of_surjective s Fsur (singleton_nonempty x) obtain ⟨sec, h⟩ := nonempty_sections_of_finite_cofiltered_system (F.toPreimages s) refine ⟨⟨fun j => (sec j).val, fun jk => by simpa [Subtype.ext_iff] using! h jk⟩, ?_⟩ · have := (sec i).prop @@ -321,8 +321,8 @@ theorem eval_section_surjective_of_surjective (i : J) : theorem eventually_injective [Nonempty J] [Finite F.sections] : ∃ j, ∀ (i) (f : i ⟶ j), Function.Injective (F.map f) := by - haveI : ∀ j, Fintype (F.obj j) := fun j => Fintype.ofFinite (F.obj j) - haveI : Fintype F.sections := Fintype.ofFinite F.sections + have : ∀ j, Fintype (F.obj j) := fun j => Fintype.ofFinite (F.obj j) + have : Fintype F.sections := Fintype.ofFinite F.sections have card_le : ∀ j, Fintype.card (F.obj j) ≤ Fintype.card F.sections := fun j => Fintype.card_le_of_surjective _ (F.eval_section_surjective_of_surjective Fsur j) let fn j := Fintype.card F.sections - Fintype.card (F.obj j) diff --git a/Mathlib/CategoryTheory/Comma/Final.lean b/Mathlib/CategoryTheory/Comma/Final.lean index 04608f5d124a3e..c1c46db052aa44 100644 --- a/Mathlib/CategoryTheory/Comma/Final.lean +++ b/Mathlib/CategoryTheory/Comma/Final.lean @@ -158,7 +158,7 @@ lemma map_final {A : Type u₁} [Category.{v₁} A] {B : Type u₂} [Category.{v {G : B ⥤ B'} {H : T ⥤ T'} (iL : F ⋙ L' ≅ L ⋙ H) (iR : G ⋙ R' ≅ R ⋙ H) [IsFiltered B] [R.Final] [R'.Final] [F.Final] [G.Final] : (Comma.map iL.hom iR.inv).Final := ⟨fun ⟨i₂, j₂, u₂⟩ => by - haveI := final_of_natIso iR + have := final_of_natIso iR rw [isConnected_iff_of_equivalence (StructuredArrow.commaMapEquivalence iL.hom iR.inv _)] have : StructuredArrow.map₂ u₂ iR.hom ≅ StructuredArrow.post j₂ G R' ⋙ StructuredArrow.map₂ (G := 𝟭 _) (F := 𝟭 _) (R' := R ⋙ H) u₂ iR.hom ⋙ @@ -171,7 +171,7 @@ lemma map_final {A : Type u₁} [Category.{v₁} A] {B : Type u₂} [Category.{v isoWhiskerLeft _ ((StructuredArrow.map₂CompMap₂Iso _ _ _ _).symm ≪≫ isoWhiskerLeft _ (StructuredArrow.preIsoMap₂ _ _ _).symm) ≪≫ isoWhiskerRight (StructuredArrow.postIsoMap₂ j₂ G R').symm _ - haveI := final_of_natIso this.symm + have := final_of_natIso this.symm rw [IsIso.Iso.inv_inv] infer_instance⟩ diff --git a/Mathlib/CategoryTheory/ConcreteCategory/ReflectsIso.lean b/Mathlib/CategoryTheory/ConcreteCategory/ReflectsIso.lean index c21e8beff8e233..f847a89d7e6491 100644 --- a/Mathlib/CategoryTheory/ConcreteCategory/ReflectsIso.lean +++ b/Mathlib/CategoryTheory/ConcreteCategory/ReflectsIso.lean @@ -34,8 +34,8 @@ where `forget C` reflects isomorphisms, itself reflects isomorphisms. -/ instance reflectsIsomorphisms_forget₂ [HasForget₂ C D] [(forget C).ReflectsIsomorphisms] : (forget₂ C D).ReflectsIsomorphisms := { reflects := fun X Y f {i} => by - haveI i' : IsIso ((forget D).map ((forget₂ C D).map f)) := Functor.map_isIso (forget D) _ - haveI : IsIso ((forget C).map f) := by + have i' : IsIso ((forget D).map ((forget₂ C D).map f)) := Functor.map_isIso (forget D) _ + have : IsIso ((forget C).map f) := by rwa [← @HasForget₂.forget_comp C _ _ _ _ _ D _ _ _ _ _] apply isIso_of_reflects_iso f (forget C) } diff --git a/Mathlib/CategoryTheory/Extensive.lean b/Mathlib/CategoryTheory/Extensive.lean index 3f5988a12aa152..7b6f27b595f43c 100644 --- a/Mathlib/CategoryTheory/Extensive.lean +++ b/Mathlib/CategoryTheory/Extensive.lean @@ -420,8 +420,8 @@ theorem finitaryExtensive_of_preserves_and_reflects_isomorphism (F : C ⥤ D) [F [HasFiniteCoproducts C] [HasPullbacks C] [PreservesLimitsOfShape WalkingCospan F] [PreservesColimitsOfShape (Discrete WalkingPair) F] [F.ReflectsIsomorphisms] : FinitaryExtensive C := by - haveI : ReflectsLimitsOfShape WalkingCospan F := reflectsLimitsOfShape_of_reflectsIsomorphisms - haveI : ReflectsColimitsOfShape (Discrete WalkingPair) F := + have : ReflectsLimitsOfShape WalkingCospan F := reflectsLimitsOfShape_of_reflectsIsomorphisms + have : ReflectsColimitsOfShape (Discrete WalkingPair) F := reflectsColimitsOfShape_of_reflectsIsomorphisms exact finitaryExtensive_of_preserves_and_reflects F diff --git a/Mathlib/CategoryTheory/FiberedCategory/Cartesian.lean b/Mathlib/CategoryTheory/FiberedCategory/Cartesian.lean index 49c62e0554ec61..64a7f20c18169f 100644 --- a/Mathlib/CategoryTheory/FiberedCategory/Cartesian.lean +++ b/Mathlib/CategoryTheory/FiberedCategory/Cartesian.lean @@ -390,7 +390,7 @@ instance domainUniqueUpToIso_inv_isHomLift (h : f' = g.hom ≫ f) (φ : a ⟶ b) instance domainUniqueUpToIso_hom_isHomLift (h : f' = g.hom ≫ f) (φ : a ⟶ b) (φ' : a' ⟶ b) [IsStronglyCartesian p f φ] [IsStronglyCartesian p f' φ'] : IsHomLift p g.inv (domainIsoOfBaseIso p h φ φ').inv := by - haveI : p.IsHomLift ((fun x ↦ g.inv ≫ x) (g.hom ≫ f)) φ := by + have : p.IsHomLift ((fun x ↦ g.inv ≫ x) (g.hom ≫ f)) φ := by simpa using IsCartesian.toIsHomLift simpa using IsStronglyCartesian.map_isHomLift p f' φ' (congrArg (g.inv ≫ ·) h.symm) φ diff --git a/Mathlib/CategoryTheory/Filtered/CostructuredArrow.lean b/Mathlib/CategoryTheory/Filtered/CostructuredArrow.lean index c972b51e66f4c0..eca167cd40f154 100644 --- a/Mathlib/CategoryTheory/Filtered/CostructuredArrow.lean +++ b/Mathlib/CategoryTheory/Filtered/CostructuredArrow.lean @@ -69,9 +69,9 @@ theorem isFiltered_of_isFiltered_costructuredArrow (L : A ⥤ T) (R : B ⥤ T) ((sB.inverse ⋙ R ⋙ sT.functor).obj ⟨b⟩) ≌ CostructuredArrow L (R.obj b) := fun b => (CostructuredArrow.pre sA.inverse (L ⋙ sT.functor) _).asEquivalence.trans (CostructuredArrow.post L sT.functor _).asEquivalence.symm - haveI : ∀ b, IsFiltered (CostructuredArrow _ ((sB.inverse ⋙ R ⋙ sT.functor).obj b)) := + have : ∀ b, IsFiltered (CostructuredArrow _ ((sB.inverse ⋙ R ⋙ sT.functor).obj b)) := fun b => IsFiltered.of_equivalence (sC b.1).symm - haveI := isFiltered_of_isFiltered_costructuredArrow_small + have := isFiltered_of_isFiltered_costructuredArrow_small (sA.inverse ⋙ L ⋙ sT.functor) (sB.inverse ⋙ R ⋙ sT.functor) exact IsFiltered.of_equivalence sA.symm diff --git a/Mathlib/CategoryTheory/Filtered/Final.lean b/Mathlib/CategoryTheory/Filtered/Final.lean index 3a35baf057910e..506f1e8bc02c20 100644 --- a/Mathlib/CategoryTheory/Filtered/Final.lean +++ b/Mathlib/CategoryTheory/Filtered/Final.lean @@ -314,7 +314,7 @@ theorem Functor.initial_iff_isCofiltered_costructuredArrow [IsCofilteredOrEmpty /-- If `C` is filtered, then the structured arrow category on the diagonal functor `C ⥤ C × C` is filtered as well. -/ instance [IsFilteredOrEmpty C] (X : C × C) : IsFiltered (StructuredArrow X (diag C)) := by - haveI : ∀ Y, IsFiltered (StructuredArrow Y (Under.forget X.1)) := by + have : ∀ Y, IsFiltered (StructuredArrow Y (Under.forget X.1)) := by rw [← final_iff_isFiltered_structuredArrow (Under.forget X.1)] infer_instance apply IsFiltered.of_equivalence (StructuredArrow.ofDiagEquivalence X).symm @@ -334,7 +334,7 @@ theorem IsFiltered.isSifted [IsFiltered C] : IsSifted C where /-- If `C` is cofiltered, then the costructured arrow category on the diagonal functor `C ⥤ C × C` is cofiltered as well. -/ instance [IsCofilteredOrEmpty C] (X : C × C) : IsCofiltered (CostructuredArrow (diag C) X) := by - haveI : ∀ Y, IsCofiltered (CostructuredArrow (Over.forget X.1) Y) := by + have : ∀ Y, IsCofiltered (CostructuredArrow (Over.forget X.1) Y) := by rw [← initial_iff_isCofiltered_costructuredArrow (Over.forget X.1)] infer_instance apply IsCofiltered.of_equivalence (CostructuredArrow.ofDiagEquivalence X).symm @@ -385,7 +385,7 @@ instance StructuredArrow.final_map₂_id [IsFiltered C] {E : Type u₃} [Categor {T : C ⥤ D} [T.Final] {S : D ⥤ E} [S.Final] {T' : C ⥤ E} {d : D} {e : E} (u : e ⟶ S.obj d) (α : T ⋙ S ⟶ T') [IsIso α] : Final (map₂ (F := 𝟭 _) u α) := by - haveI : IsFiltered (StructuredArrow e (T ⋙ S)) := + have : IsFiltered (StructuredArrow e (T ⋙ S)) := (T ⋙ S).final_iff_isFiltered_structuredArrow.mp inferInstance e apply final_of_natIso (map₂IsoPreEquivalenceInverseCompProj d e u α).symm @@ -393,7 +393,7 @@ set_option backward.isDefEq.respectTransparency false in /-- `StructuredArrow.map` is final if the functor `T` is final and its domain is filtered. -/ instance StructuredArrow.final_map [IsFiltered C] {S S' : D} (f : S ⟶ S') (T : C ⥤ D) [T.Final] : Final (map (T := T) f) := by - haveI := NatIso.isIso_of_isIso_app (𝟙 T) + have := NatIso.isIso_of_isIso_app (𝟙 T) have : (map₂ (F := 𝟭 C) (G := 𝟭 D) f (𝟙 T)).Final := by apply StructuredArrow.final_map₂_id (S := 𝟭 D) (T := T) (T' := T) f (𝟙 T) apply final_of_natIso (mapIsoMap₂ f).symm diff --git a/Mathlib/CategoryTheory/Functor/Flat.lean b/Mathlib/CategoryTheory/Functor/Flat.lean index 665c09322a853a..99352559888677 100644 --- a/Mathlib/CategoryTheory/Functor/Flat.lean +++ b/Mathlib/CategoryTheory/Functor/Flat.lean @@ -332,7 +332,7 @@ noncomputable instance lan_preservesFiniteLimits_of_flat (F : C ⥤ D) [Represen intro J _ _ apply preservesLimitsOfShape_of_evaluation (F.op.lan : (Cᵒᵖ ⥤ E) ⥤ Dᵒᵖ ⥤ E) J intro K - haveI : IsFiltered (CostructuredArrow F.op K) := + have : IsFiltered (CostructuredArrow F.op K) := IsFiltered.of_equivalence (structuredArrowOpEquivalence F (unop K)) exact preservesLimitsOfShape_of_natIso (lanEvaluationIsoColim _ _ _).symm @@ -344,14 +344,14 @@ variable [HasFiniteLimits C] instance lan_preservesFiniteLimits_of_preservesFiniteLimits (F : C ⥤ D) [PreservesFiniteLimits F] : PreservesFiniteLimits (F.op.lan : _ ⥤ Dᵒᵖ ⥤ E) := by - haveI := flat_of_preservesFiniteLimits F + have := flat_of_preservesFiniteLimits F infer_instance theorem flat_iff_lan_flat (F : C ⥤ D) : RepresentablyFlat F ↔ RepresentablyFlat (F.op.lan : _ ⥤ Dᵒᵖ ⥤ Type u₁) := ⟨fun _ => inferInstance, fun H => by - haveI := preservesFiniteLimits_of_flat (F.op.lan : _ ⥤ Dᵒᵖ ⥤ Type u₁) - haveI : PreservesFiniteLimits F := by + have := preservesFiniteLimits_of_flat (F.op.lan : _ ⥤ Dᵒᵖ ⥤ Type u₁) + have : PreservesFiniteLimits F := by apply preservesFiniteLimits_of_preservesFiniteLimitsOfSize.{u₁} intros; apply preservesLimit_of_lan_preservesLimit apply flat_of_preservesFiniteLimits⟩ diff --git a/Mathlib/CategoryTheory/Functor/KanExtension/Basic.lean b/Mathlib/CategoryTheory/Functor/KanExtension/Basic.lean index 8f258c7b23fce8..ddda48b185e5df 100644 --- a/Mathlib/CategoryTheory/Functor/KanExtension/Basic.lean +++ b/Mathlib/CategoryTheory/Functor/KanExtension/Basic.lean @@ -647,8 +647,8 @@ def LeftExtension.isUniversalPrecomp₂ refine ⟨⟨StructuredArrow.homMk (hb.desc u) <| by ext x - haveI hb_fac_app := congr_app (hb.fac u) (L.obj x) - haveI hα_fac_app := + have hb_fac_app := congr_app (hb.fac u) (L.obj x) + have hα_fac_app := congr_app (hα.fac <| LeftExtension.mk _ <| y.hom ≫ (L.associator L' y.right).hom) x dsimp at hα_fac_app hb_fac_app diff --git a/Mathlib/CategoryTheory/Functor/ReflectsIso/Balanced.lean b/Mathlib/CategoryTheory/Functor/ReflectsIso/Balanced.lean index 958801256b9cb0..1f2f7530845fc1 100644 --- a/Mathlib/CategoryTheory/Functor/ReflectsIso/Balanced.lean +++ b/Mathlib/CategoryTheory/Functor/ReflectsIso/Balanced.lean @@ -32,8 +32,8 @@ instance (priority := 100) reflectsIsomorphisms_of_reflectsMonomorphisms_of_refl [Balanced C] (F : C ⥤ D) [ReflectsMonomorphisms F] [ReflectsEpimorphisms F] : F.ReflectsIsomorphisms where reflects f hf := by - haveI : Epi f := epi_of_epi_map F inferInstance - haveI : Mono f := mono_of_mono_map F inferInstance + have : Epi f := epi_of_epi_map F inferInstance + have : Mono f := mono_of_mono_map F inferInstance exact isIso_of_mono_of_epi f lemma Functor.balanced_of_preserves (F : C ⥤ D) diff --git a/Mathlib/CategoryTheory/Functor/ReflectsIso/Basic.lean b/Mathlib/CategoryTheory/Functor/ReflectsIso/Basic.lean index 9c09661cfabb0d..b317846095c902 100644 --- a/Mathlib/CategoryTheory/Functor/ReflectsIso/Basic.lean +++ b/Mathlib/CategoryTheory/Functor/ReflectsIso/Basic.lean @@ -63,7 +63,7 @@ instance reflectsIsomorphisms_comp (F : C ⥤ D) (G : D ⥤ E) [F.ReflectsIsomorphisms] [G.ReflectsIsomorphisms] : (F ⋙ G).ReflectsIsomorphisms := ⟨fun f (hf : IsIso (G.map _)) => by - haveI := isIso_of_reflects_iso (F.map f) G + have := isIso_of_reflects_iso (F.map f) G exact isIso_of_reflects_iso f F⟩ set_option backward.defeqAttrib.useBackward true in diff --git a/Mathlib/CategoryTheory/Galois/Basic.lean b/Mathlib/CategoryTheory/Galois/Basic.lean index dc171180037365..ff17a03715ffe3 100644 --- a/Mathlib/CategoryTheory/Galois/Basic.lean +++ b/Mathlib/CategoryTheory/Galois/Basic.lean @@ -156,22 +156,22 @@ instance {G : Type*} [Group G] [Finite G] : /-- Fiber functors reflect monomorphisms. -/ instance : ReflectsMonomorphisms F := ReflectsMonomorphisms.mk <| by intro X Y f _ - haveI : IsIso (pullback.fst (F.map f) (F.map f)) := + have : IsIso (pullback.fst (F.map f) (F.map f)) := isIso_fst_of_mono (F.map f) - haveI : IsIso (F.map (pullback.fst f f)) := by + have : IsIso (F.map (pullback.fst f f)) := by rw [← PreservesPullback.iso_hom_fst] exact IsIso.comp_isIso - haveI : IsIso (pullback.fst f f) := isIso_of_reflects_iso (pullback.fst _ _) F + have : IsIso (pullback.fst f f) := isIso_of_reflects_iso (pullback.fst _ _) F exact (pullback.diagonal_isKernelPair f).mono_of_isIso_fst /-- Fiber functors are faithful. -/ instance : F.Faithful where map_injective {X Y} f g h := by - haveI : IsIso (equalizer.ι (F.map f) (F.map g)) := equalizer.ι_of_eq h - haveI : IsIso (F.map (equalizer.ι f g)) := by + have : IsIso (equalizer.ι (F.map f) (F.map g)) := equalizer.ι_of_eq h + have : IsIso (F.map (equalizer.ι f g)) := by rw [← equalizerComparison_comp_π f g F] exact IsIso.comp_isIso - haveI : IsIso (equalizer.ι f g) := isIso_of_reflects_iso _ F + have : IsIso (equalizer.ι f g) := isIso_of_reflects_iso _ F exact eq_of_epi_equalizer section @@ -220,10 +220,10 @@ variable [PreGaloisCategory C] [FiberFunctor F] /-- An object is initial if and only if its fiber is empty. -/ lemma initial_iff_fiber_empty (X : C) : Nonempty (IsInitial X) ↔ IsEmpty (F.obj X) := by rw [(IsInitial.isInitialIffObj F X).nonempty_congr] - haveI : PreservesFiniteColimits (forget FintypeCat) := by + have : PreservesFiniteColimits (forget FintypeCat.{w}) := by change PreservesFiniteColimits FintypeCat.incl infer_instance - haveI : ReflectsColimit (Functor.empty.{0} _) (forget FintypeCat) := by + have : ReflectsColimit (Functor.empty.{0} _) (forget FintypeCat.{w}) := by change ReflectsColimit (Functor.empty.{0} _) FintypeCat.incl infer_instance exact Concrete.initial_iff_empty_of_preserves_of_reflects (F.obj X) @@ -314,7 +314,7 @@ lemma fiberBinaryProductEquiv_symm_snd_apply {X Y : C} (x : F.obj X) (y : F.obj lemma evaluation_injective_of_isConnected (A X : C) [IsConnected A] (a : F.obj A) : Function.Injective (fun (f : A ⟶ X) ↦ F.map f a) := by intro f g (h : F.map f a = F.map g a) - haveI : IsIso (equalizer.ι f g) := by + have : IsIso (equalizer.ι f g) := by apply IsConnected.noTrivialComponent _ (equalizer.ι f g) exact not_initial_of_inhabited F ((fiberEqualizerEquiv F f g).symm ⟨a, h⟩) exact eq_of_epi_equalizer diff --git a/Mathlib/CategoryTheory/Galois/Equivalence.lean b/Mathlib/CategoryTheory/Galois/Equivalence.lean index 67a3796c5440fb..e9629f623eefa8 100644 --- a/Mathlib/CategoryTheory/Galois/Equivalence.lean +++ b/Mathlib/CategoryTheory/Galois/Equivalence.lean @@ -54,7 +54,7 @@ instance {F : C ⥤ FintypeCat.{u₁}} [FiberFunctor F] : (functorToContAction F instance : (functorToContAction F).EssSurj := by let F' : C ⥤ FintypeCat.{u₁} := F ⋙ FintypeCat.uSwitch.{w, u₁} - letI : FiberFunctor F' := FiberFunctor.comp_right _ + let : FiberFunctor F' := FiberFunctor.comp_right _ have : (functorToContAction F').EssSurj := inferInstance let f : Aut F ≃ₜ* Aut F' := (autEquivAutWhiskerRight F (FintypeCat.uSwitchEquivalence.{w, u₁}).fullyFaithfulFunctor) diff --git a/Mathlib/CategoryTheory/Galois/EssSurj.lean b/Mathlib/CategoryTheory/Galois/EssSurj.lean index 8ee8df169abd5d..70857ca5969333 100644 --- a/Mathlib/CategoryTheory/Galois/EssSurj.lean +++ b/Mathlib/CategoryTheory/Galois/EssSurj.lean @@ -75,8 +75,8 @@ lemma has_decomp_quotients (X : Action FintypeCat G) ∃ (ι : Type) (_ : Finite ι) (f : ι → OpenSubgroup (G)), Nonempty ((∐ fun i ↦ G ⧸ₐ (f i).toSubgroup) ≅ X) := by obtain ⟨ι, hf, f, u, hc⟩ := has_decomp_connected_components' X - letI (i : ι) : TopologicalSpace (f i).V := ⊥ - haveI (i : ι) : DiscreteTopology (f i).V := ⟨rfl⟩ + let (i : ι) : TopologicalSpace (f i).V := ⊥ + have (i : ι) : DiscreteTopology (f i).V := ⟨rfl⟩ have (i : ι) : ContinuousSMul G (f i).V := ContinuousSMul.mk <| by let r : f i ⟶ X := Sigma.ι f i ≫ u.hom let r'' (p : G × (f i).V) : G × X.V := (p.1, r.hom p.2) @@ -227,8 +227,8 @@ set_option backward.isDefEq.respectTransparency false in lemma exists_lift_of_quotient_openSubgroup (V : OpenSubgroup (Aut F)) : ∃ (X : C), Nonempty ((functorToAction F).obj X ≅ Aut F ⧸ₐ V.toSubgroup) := by obtain ⟨I, hf, hc, hi⟩ := exists_set_ker_evaluation_subset_of_isOpen F (one_mem V) V.isOpen' - haveI (X : I) : IsConnected X.val := hc X X.property - haveI (X : I) : Nonempty (F.obj X.val) := nonempty_fiber_of_isConnected F X + have (X : I) : IsConnected X.val := hc X X.property + have (X : I) : Nonempty (F.obj X.val) := nonempty_fiber_of_isConnected F X have hn : Nonempty (F.obj <| (∏ᶜ fun X : I => X)) := nonempty_fiber_pi_of_nonempty_of_finite F _ obtain ⟨A, f, hgal⟩ := exists_hom_from_galois_of_fiber_nonempty F (∏ᶜ fun X : I => X) hn obtain ⟨a⟩ := nonempty_fiber_of_isConnected F A diff --git a/Mathlib/CategoryTheory/Galois/Examples.lean b/Mathlib/CategoryTheory/Galois/Examples.lean index 7b3b1937554876..63002611a87534 100644 --- a/Mathlib/CategoryTheory/Galois/Examples.lean +++ b/Mathlib/CategoryTheory/Galois/Examples.lean @@ -113,7 +113,7 @@ theorem Action.pretransitive_of_isConnected (X : Action FintypeCat G) connectedness, the orbit equals `X.V`. -/ let T : Set X.V := MulAction.orbit G x have : Fintype T := Fintype.ofFinite T - letI : MulAction G (FintypeCat.of T) := inferInstanceAs <| MulAction G + let : MulAction G (FintypeCat.of T) := inferInstanceAs <| MulAction G ↑(MulAction.orbit G x) let T' : Action FintypeCat G := Action.FintypeCat.ofMulAction G (FintypeCat.of T) let i : T' ⟶ X := ⟨FintypeCat.homMk Subtype.val, fun _ ↦ rfl⟩ @@ -140,9 +140,9 @@ theorem Action.isConnected_of_transitive (X : FintypeCat) [MulAction G X] obtain ⟨(y : Y.V)⟩ := (not_initial_iff_fiber_nonempty (Action.forget _ _) Y).mp hni have : IsIso i.hom := by refine (ConcreteCategory.isIso_iff_bijective i.hom).mpr ⟨?_, fun x' ↦ ?_⟩ - · haveI : Mono i.hom := map_mono (forget₂ _ _) i + · have : Mono i.hom := map_mono (forget₂ _ _) i exact ConcreteCategory.injective_of_mono_of_preservesPullback i.hom - · letI x : X := i.hom y + · let x : X := i.hom y obtain ⟨σ, hσ⟩ := MulAction.exists_smul_eq G x x' use σ • y change (Y.ρ σ ≫ i.hom) y = x' diff --git a/Mathlib/CategoryTheory/Galois/Prorepresentability.lean b/Mathlib/CategoryTheory/Galois/Prorepresentability.lean index d33c328d858baa..753fe0ed691300 100644 --- a/Mathlib/CategoryTheory/Galois/Prorepresentability.lean +++ b/Mathlib/CategoryTheory/Galois/Prorepresentability.lean @@ -452,7 +452,7 @@ instance FiberFunctor.isPretransitive_of_isConnected (X : C) [IsConnected X] : MulAction.IsPretransitive (Aut F) (F.obj X) where exists_smul_eq x y := by let F' : C ⥤ FintypeCat.{u₂} := F ⋙ FintypeCat.uSwitch.{w, u₂} - letI : FiberFunctor F' := FiberFunctor.comp_right _ + let : FiberFunctor F' := FiberFunctor.comp_right _ let e (Y : C) : F'.obj Y ≃ F.obj Y := (F.obj Y).uSwitchEquiv set x' : F'.obj X := (e X).symm x with hx' set y' : F'.obj X := (e X).symm y with hy' diff --git a/Mathlib/CategoryTheory/Galois/Topology.lean b/Mathlib/CategoryTheory/Galois/Topology.lean index b3075869aaa53e..c22fed5b109f45 100644 --- a/Mathlib/CategoryTheory/Galois/Topology.lean +++ b/Mathlib/CategoryTheory/Galois/Topology.lean @@ -209,8 +209,8 @@ lemma nhds_one_has_basis_stabilizers : (nhds (1 : Aut F)).HasBasis (fun _ ↦ Tr intro t (ht : t.hom.app A a = a) apply hU apply hmem - haveI (X : I) : IsConnected X.val := hc X.val X.property - haveI (X : I) : Nonempty (F.obj X.val) := nonempty_fiber_of_isConnected F X + have (X : I) : IsConnected X.val := hc X.val X.property + have (X : I) : Nonempty (F.obj X.val) := nonempty_fiber_of_isConnected F X intro X ext x simp only [FintypeCat.id_apply] diff --git a/Mathlib/CategoryTheory/Generator/Abelian.lean b/Mathlib/CategoryTheory/Generator/Abelian.lean index b67595ab22abd7..97ece904d2a5c8 100644 --- a/Mathlib/CategoryTheory/Generator/Abelian.lean +++ b/Mathlib/CategoryTheory/Generator/Abelian.lean @@ -36,8 +36,8 @@ variable {C : Type u} [Category.{v} C] [Abelian C] theorem has_injective_coseparator [HasLimits C] [EnoughInjectives C] (G : C) (hG : IsSeparator G) : ∃ G : C, Injective G ∧ IsCoseparator G := by - haveI : WellPowered.{v} C := wellPowered_of_isDetector G hG.isDetector - haveI : HasProductsOfShape (Subobject (op G)) C := hasProductsOfShape_of_small.{v} _ _ + have : WellPowered.{v} C := wellPowered_of_isDetector G hG.isDetector + have : HasProductsOfShape (Subobject (op G)) C := hasProductsOfShape_of_small.{v} _ _ let T : C := Injective.under (piObj fun P : Subobject (op G) => unop P) refine ⟨T, inferInstance, (Preadditive.isCoseparator_iff _).2 fun X Y f hf => ?_⟩ refine (Preadditive.isSeparator_iff _).1 hG _ fun h => ?_ diff --git a/Mathlib/CategoryTheory/Generator/Basic.lean b/Mathlib/CategoryTheory/Generator/Basic.lean index 64fa142dd8cc16..734040759580d7 100644 --- a/Mathlib/CategoryTheory/Generator/Basic.lean +++ b/Mathlib/CategoryTheory/Generator/Basic.lean @@ -432,9 +432,9 @@ theorem hasInitial_of_isCoseparating [LocallySmall.{w} C] [WellPowered.{w} C] [HasLimitsOfSize.{w, w} C] {P : ObjectProperty C} [ObjectProperty.Small.{w} P] (hP : P.IsCoseparating) : HasInitial C := by have := hasFiniteLimits_of_hasLimitsOfSize C - haveI := hasProductsOfShape_of_small C (Subtype P) - haveI := fun A => hasProductsOfShape_of_small.{w} C (StructuredArrow A P.ι) - letI := completeLatticeOfCompleteSemilatticeInf (Subobject (piObj (Subtype.val : Subtype P → C))) + have := hasProductsOfShape_of_small C (Subtype P) + have := fun A => hasProductsOfShape_of_small.{w} C (StructuredArrow A P.ι) + let := completeLatticeOfCompleteSemilatticeInf (Subobject (piObj (Subtype.val : Subtype P → C))) suffices ∀ A : C, Unique (((⊥ : Subobject (piObj (Subtype.val : Subtype P → C))) : C) ⟶ A) by exact hasInitial_of_unique ((⊥ : Subobject (piObj (Subtype.val : Subtype P → C))) : C) have := hP.mono_productTo @@ -459,7 +459,7 @@ theorem hasInitial_of_isCoseparating [LocallySmall.{w} C] [WellPowered.{w} C] theorem hasTerminal_of_isSeparating [LocallySmall.{w} Cᵒᵖ] [WellPowered.{w} Cᵒᵖ] [HasColimitsOfSize.{w, w} C] {P : ObjectProperty C} [ObjectProperty.Small.{w} P] (hP : P.IsSeparating) : HasTerminal C := by - haveI : HasInitial Cᵒᵖ := hasInitial_of_isCoseparating (P.isCoseparating_op_iff.2 hP) + have : HasInitial Cᵒᵖ := hasInitial_of_isCoseparating (P.isCoseparating_op_iff.2 hP) exact hasTerminal_of_hasInitial_op section WellPowered @@ -663,7 +663,7 @@ theorem isSeparator_iff_epi (G : C) [∀ A : C, HasCoproduct fun _ : G ⟶ A => rw [isSeparator_def] refine ⟨fun h A => ⟨fun u v huv => h _ _ fun i => ?_⟩, fun h X Y f g hh => ?_⟩ · simpa using Sigma.ι _ i ≫= huv - · haveI := h X + · have := h X refine (cancel_epi (Sigma.desc fun f : G ⟶ X => f)).1 (colimit.hom_ext fun j => ?_) simpa using hh j.as @@ -673,7 +673,7 @@ theorem isCoseparator_iff_mono (G : C) [∀ A : C, HasProduct fun _ : A ⟶ G => rw [isCoseparator_def] refine ⟨fun h A => ⟨fun u v huv => h _ _ fun i => ?_⟩, fun h X Y f g hh => ?_⟩ · simpa using huv =≫ Pi.π _ i - · haveI := h Y + · have := h Y refine (cancel_mono (Pi.lift fun f : Y ⟶ G => f)).1 (limit.hom_ext fun j => ?_) simpa using hh j.as diff --git a/Mathlib/CategoryTheory/Groupoid/Basic.lean b/Mathlib/CategoryTheory/Groupoid/Basic.lean index 40e3094a1d7a21..4f91ccc3a22d6b 100644 --- a/Mathlib/CategoryTheory/Groupoid/Basic.lean +++ b/Mathlib/CategoryTheory/Groupoid/Basic.lean @@ -24,7 +24,7 @@ section Thin theorem isThin_iff : Quiver.IsThin C ↔ ∀ c : C, Subsingleton (c ⟶ c) := by refine ⟨fun h c => h c c, fun h c d => Subsingleton.intro fun f g => ?_⟩ - haveI := h d + have := h d calc f = f ≫ inv g ≫ g := by simp only [inv_eq_inv, IsIso.inv_hom_id, Category.comp_id] _ = f ≫ inv f ≫ g := by congr 1 diff --git a/Mathlib/CategoryTheory/GuitartExact/VerticalComposition.lean b/Mathlib/CategoryTheory/GuitartExact/VerticalComposition.lean index 220d795a454a37..f4b2708127ba9e 100644 --- a/Mathlib/CategoryTheory/GuitartExact/VerticalComposition.lean +++ b/Mathlib/CategoryTheory/GuitartExact/VerticalComposition.lean @@ -153,9 +153,9 @@ lemma vComp_iff_of_equivalences (eL : C₂ ≌ C₃) (eR : D₂ ≌ D₃) (w ≫ᵥ w'.hom).GuitartExact ↔ w.GuitartExact := by constructor · intro hww' - letI : CatCommSq H₂ eL.functor eR.functor H₃ := ⟨w'⟩ + let : CatCommSq H₂ eL.functor eR.functor H₃ := ⟨w'⟩ have hw' : CatCommSq.iso H₂ eL.functor eR.functor H₃ = w' := rfl - letI : CatCommSq H₃ eL.inverse eR.inverse H₂ := CatCommSq.vInvEquiv _ _ _ _ inferInstance + let : CatCommSq H₃ eL.inverse eR.inverse H₂ := CatCommSq.vInvEquiv _ _ _ _ inferInstance let w'' := CatCommSq.iso H₃ eL.inverse eR.inverse H₂ let α : (L₁ ⋙ eL.functor) ⋙ eL.inverse ≅ L₁ := Functor.associator _ _ _ ≪≫ Functor.isoWhiskerLeft L₁ eL.unitIso.symm ≪≫ L₁.rightUnitor diff --git a/Mathlib/CategoryTheory/Idempotents/Basic.lean b/Mathlib/CategoryTheory/Idempotents/Basic.lean index 1c4be74659cbe9..634afd5e7ed2d0 100644 --- a/Mathlib/CategoryTheory/Idempotents/Basic.lean +++ b/Mathlib/CategoryTheory/Idempotents/Basic.lean @@ -84,7 +84,7 @@ theorem isIdempotentComplete_iff_hasEqualizer_of_id_and_idempotent : · intro h refine ⟨?_⟩ intro X p hp - haveI : HasEqualizer (𝟙 X) p := h X p hp + have : HasEqualizer (𝟙 X) p := h X p hp refine ⟨equalizer (𝟙 X) p, equalizer.ι (𝟙 X) p, equalizer.lift p (show p ≫ 𝟙 X = p ≫ p by rw [hp, comp_id]), ?_, equalizer.lift_ι _ _⟩ ext @@ -105,11 +105,11 @@ theorem isIdempotentComplete_iff_idempotents_have_kernels [Preadditive C] : rw [isIdempotentComplete_iff_hasEqualizer_of_id_and_idempotent] constructor · intro h X p hp - haveI : HasEqualizer (𝟙 X) (𝟙 X - p) := h X (𝟙 _ - p) (idem_of_id_sub_idem p hp) + have : HasEqualizer (𝟙 X) (𝟙 X - p) := h X (𝟙 _ - p) (idem_of_id_sub_idem p hp) convert! hasKernel_of_hasEqualizer (𝟙 X) (𝟙 X - p) rw [sub_sub_cancel] · intro h X p hp - haveI : HasKernel (𝟙 _ - p) := h X (𝟙 _ - p) (idem_of_id_sub_idem p hp) + have : HasKernel (𝟙 _ - p) := h X (𝟙 _ - p) (idem_of_id_sub_idem p hp) apply Preadditive.hasEqualizer_of_hasKernel /-- An abelian category is idempotent complete. -/ diff --git a/Mathlib/CategoryTheory/Idempotents/FunctorCategories.lean b/Mathlib/CategoryTheory/Idempotents/FunctorCategories.lean index 75d3640e2a9a42..113db5b6ae5b34 100644 --- a/Mathlib/CategoryTheory/Idempotents/FunctorCategories.lean +++ b/Mathlib/CategoryTheory/Idempotents/FunctorCategories.lean @@ -61,7 +61,7 @@ instance functor_category_isIdempotentComplete [IsIdempotentComplete C] : IsIdempotentComplete (J ⥤ C) := by refine ⟨fun F p hp => ?_⟩ have hC := (isIdempotentComplete_iff_hasEqualizer_of_id_and_idempotent C).mp inferInstance - haveI : ∀ j : J, HasEqualizer (𝟙 _) (p.app j) := fun j => hC _ _ (congr_app hp j) + have : ∀ j : J, HasEqualizer (𝟙 _) (p.app j) := fun j => hC _ _ (congr_app hp j) /- We construct the direct factor `Y` associated to `p : F ⟶ F` by computing the equalizer of the identity and `p.app j` on each object `(j : J)`. -/ let Y : J ⥤ C := diff --git a/Mathlib/CategoryTheory/Limits/Comma.lean b/Mathlib/CategoryTheory/Limits/Comma.lean index 31172ac7aeb408..a8fdbc1630c0d0 100644 --- a/Mathlib/CategoryTheory/Limits/Comma.lean +++ b/Mathlib/CategoryTheory/Limits/Comma.lean @@ -192,8 +192,8 @@ namespace Arrow set_option backward.isDefEq.respectTransparency false in instance hasLimit (F : J ⥤ Arrow T) [i₁ : HasLimit (F ⋙ leftFunc)] [i₂ : HasLimit (F ⋙ rightFunc)] : HasLimit F := by - haveI : HasLimit (F ⋙ Comma.fst _ _) := i₁ - haveI : HasLimit (F ⋙ Comma.snd _ _) := i₂ + have : HasLimit (F ⋙ Comma.fst _ _) := i₁ + have : HasLimit (F ⋙ Comma.snd _ _) := i₂ apply Comma.hasLimit instance hasLimitsOfShape [HasLimitsOfShape J T] : HasLimitsOfShape J (Arrow T) where @@ -207,8 +207,8 @@ instance hasLimits [HasLimits T] : HasLimits (Arrow T) := set_option backward.isDefEq.respectTransparency false in instance hasColimit (F : J ⥤ Arrow T) [i₁ : HasColimit (F ⋙ leftFunc)] [i₂ : HasColimit (F ⋙ rightFunc)] : HasColimit F := by - haveI : HasColimit (F ⋙ Comma.fst _ _) := i₁ - haveI : HasColimit (F ⋙ Comma.snd _ _) := i₂ + have : HasColimit (F ⋙ Comma.fst _ _) := i₁ + have : HasColimit (F ⋙ Comma.snd _ _) := i₂ apply Comma.hasColimit instance hasColimitsOfShape [HasColimitsOfShape J T] : HasColimitsOfShape J (Arrow T) where @@ -239,8 +239,8 @@ instance [G.Faithful] [G.Full] {Y : A} : HasInitial (StructuredArrow (G.obj Y) G set_option backward.isDefEq.respectTransparency false in instance hasLimit [i₁ : HasLimit (F ⋙ proj X G)] [i₂ : PreservesLimit (F ⋙ proj X G) G] : HasLimit F := by - haveI : HasLimit (F ⋙ Comma.snd (Functor.fromPUnit X) G) := i₁ - haveI : PreservesLimit (F ⋙ Comma.snd (Functor.fromPUnit X) G) _ := i₂ + have : HasLimit (F ⋙ Comma.snd (Functor.fromPUnit X) G) := i₁ + have : PreservesLimit (F ⋙ Comma.snd (Functor.fromPUnit X) G) _ := i₂ apply Comma.hasLimit instance hasLimitsOfShape [HasLimitsOfShape J A] [PreservesLimitsOfShape J G] : @@ -294,8 +294,8 @@ instance hasTerminal [G.Faithful] [G.Full] {Y : A} : set_option backward.isDefEq.respectTransparency false in instance hasColimit [i₁ : HasColimit (F ⋙ proj G X)] [i₂ : PreservesColimit (F ⋙ proj G X) G] : HasColimit F := by - haveI : HasColimit (F ⋙ Comma.fst G (Functor.fromPUnit X)) := i₁ - haveI : PreservesColimit (F ⋙ Comma.fst G (Functor.fromPUnit X)) _ := i₂ + have : HasColimit (F ⋙ Comma.fst G (Functor.fromPUnit X)) := i₁ + have : PreservesColimit (F ⋙ Comma.fst G (Functor.fromPUnit X)) _ := i₂ apply Comma.hasColimit instance hasColimitsOfShape [HasColimitsOfShape J A] [PreservesColimitsOfShape J G] : diff --git a/Mathlib/CategoryTheory/Limits/Cones.lean b/Mathlib/CategoryTheory/Limits/Cones.lean index 0d406a66ca30b3..4900b0cd05359c 100644 --- a/Mathlib/CategoryTheory/Limits/Cones.lean +++ b/Mathlib/CategoryTheory/Limits/Cones.lean @@ -500,9 +500,9 @@ instance reflects_cone_isomorphism (F : C ⥤ D) [F.ReflectsIsomorphisms] (K : J (functoriality K F).ReflectsIsomorphisms := by constructor intro A B f _ - haveI : IsIso (F.map f.hom) := + have : IsIso (F.map f.hom) := (forget (K ⋙ F)).map_isIso ((functoriality K F).map f) - haveI := ReflectsIsomorphisms.reflects F f.hom + have := ReflectsIsomorphisms.reflects F f.hom apply cone_iso_of_hom_iso end diff --git a/Mathlib/CategoryTheory/Limits/Constructions/FiniteProductsOfBinaryProducts.lean b/Mathlib/CategoryTheory/Limits/Constructions/FiniteProductsOfBinaryProducts.lean index cb582d90a1552c..c5da7450894746 100644 --- a/Mathlib/CategoryTheory/Limits/Constructions/FiniteProductsOfBinaryProducts.lean +++ b/Mathlib/CategoryTheory/Limits/Constructions/FiniteProductsOfBinaryProducts.lean @@ -126,11 +126,11 @@ set_option backward.defeqAttrib.useBackward true in lemma preservesFinOfPreservesBinaryAndTerminal : ∀ (n : ℕ) (f : Fin n → C), PreservesLimit (Discrete.functor f) F | 0 => fun f => by - letI : PreservesLimitsOfShape (Discrete (Fin 0)) F := + let : PreservesLimitsOfShape (Discrete (Fin 0)) F := preservesLimitsOfShape_of_equiv.{0, 0} (Discrete.equivalence finZeroEquiv'.symm) _ infer_instance | n + 1 => by - haveI := preservesFinOfPreservesBinaryAndTerminal n + have := preservesFinOfPreservesBinaryAndTerminal n intro f apply preservesLimit_of_preserves_limit_cone @@ -157,7 +157,7 @@ lemma Limits.PreservesFiniteProducts.of_preserves_binary_and_terminal : preserves n := by refine ⟨fun {K} ↦ ?_⟩ let that : (Discrete.functor fun n => K.obj ⟨n⟩) ≅ K := Discrete.natIso fun ⟨i⟩ => Iso.refl _ - haveI := preservesFinOfPreservesBinaryAndTerminal F n fun n => K.obj ⟨n⟩ + have := preservesFinOfPreservesBinaryAndTerminal F n fun n => K.obj ⟨n⟩ apply preservesLimit_of_iso_diagram F that end Preserves @@ -251,11 +251,11 @@ set_option backward.defeqAttrib.useBackward true in lemma preserves_fin_of_preserves_binary_and_initial : ∀ (n : ℕ) (f : Fin n → C), PreservesColimit (Discrete.functor f) F | 0 => fun f => by - letI : PreservesColimitsOfShape (Discrete (Fin 0)) F := + let : PreservesColimitsOfShape (Discrete (Fin 0)) F := preservesColimitsOfShape_of_equiv.{0, 0} (Discrete.equivalence finZeroEquiv'.symm) _ infer_instance | n + 1 => by - haveI := preserves_fin_of_preserves_binary_and_initial n + have := preserves_fin_of_preserves_binary_and_initial n intro f apply preservesColimit_of_preserves_colimit_cocone @@ -282,7 +282,7 @@ lemma preservesShape_fin_of_preserves_binary_and_initial (n : ℕ) : PreservesColimitsOfShape (Discrete (Fin n)) F where preservesColimit {K} := by let that : (Discrete.functor fun n => K.obj ⟨n⟩) ≅ K := Discrete.natIso fun ⟨i⟩ => Iso.refl _ - haveI := preserves_fin_of_preserves_binary_and_initial F n fun n => K.obj ⟨n⟩ + have := preserves_fin_of_preserves_binary_and_initial F n fun n => K.obj ⟨n⟩ apply preservesColimit_of_iso_diagram F that /-- If `F` preserves the initial object and binary coproducts then it preserves finite products. -/ diff --git a/Mathlib/CategoryTheory/Limits/Constructions/LimitsOfProductsAndEqualizers.lean b/Mathlib/CategoryTheory/Limits/Constructions/LimitsOfProductsAndEqualizers.lean index 5915e5f70240f2..4306b75fe86e82 100644 --- a/Mathlib/CategoryTheory/Limits/Constructions/LimitsOfProductsAndEqualizers.lean +++ b/Mathlib/CategoryTheory/Limits/Constructions/LimitsOfProductsAndEqualizers.lean @@ -555,10 +555,10 @@ theorem hasFiniteColimits_of_hasInitial_and_pushouts [HasInitial C] [HasPushouts lemma preservesFiniteColimits_of_preservesInitial_and_pushouts [HasInitial C] [HasPushouts C] (G : C ⥤ D) [PreservesColimitsOfShape (Discrete.{0} PEmpty) G] [PreservesColimitsOfShape WalkingSpan G] : PreservesFiniteColimits G := by - haveI : HasFiniteColimits C := hasFiniteColimits_of_hasInitial_and_pushouts - haveI : PreservesColimitsOfShape (Discrete WalkingPair) G := + have : HasFiniteColimits C := hasFiniteColimits_of_hasInitial_and_pushouts + have : PreservesColimitsOfShape (Discrete WalkingPair) G := preservesBinaryCoproducts_of_preservesInitial_and_pushouts G - haveI : PreservesColimitsOfShape (WalkingParallelPair) G := + have : PreservesColimitsOfShape (WalkingParallelPair) G := (preservesCoequalizers_of_preservesPushouts_and_binaryCoproducts G) refine @preservesFiniteColimits_of_preservesCoequalizers_and_finiteCoproducts _ _ _ _ _ _ G _ ?_ diff --git a/Mathlib/CategoryTheory/Limits/Constructions/WeaklyInitial.lean b/Mathlib/CategoryTheory/Limits/Constructions/WeaklyInitial.lean index a6eac607f7df52..d65f644094c053 100644 --- a/Mathlib/CategoryTheory/Limits/Constructions/WeaklyInitial.lean +++ b/Mathlib/CategoryTheory/Limits/Constructions/WeaklyInitial.lean @@ -47,7 +47,7 @@ theorem hasInitial_of_weakly_initial_and_hasWideEqualizers [HasWideEqualizers.{v (hT : ∀ X, Nonempty (T ⟶ X)) : HasInitial C := by let endos := T ⟶ T let i := wideEqualizer.ι (id : endos → endos) - haveI : Nonempty endos := ⟨𝟙 _⟩ + have : Nonempty endos := ⟨𝟙 _⟩ have : ∀ X : C, Unique (wideEqualizer (id : endos → endos) ⟶ X) := by intro X refine ⟨⟨i ≫ Classical.choice (hT X)⟩, fun a => ?_⟩ @@ -58,7 +58,7 @@ theorem hasInitial_of_weakly_initial_and_hasWideEqualizers [HasWideEqualizers.{v rw [Category.assoc, Category.assoc] apply wideEqualizer.condition (id : endos → endos) (h ≫ e ≫ i) rw [Category.comp_id, cancel_mono_id i] at this - haveI : IsSplitEpi e := IsSplitEpi.mk' ⟨i ≫ h, this⟩ + have : IsSplitEpi e := IsSplitEpi.mk' ⟨i ≫ h, this⟩ rw [← cancel_epi e] apply equalizer.condition exact hasInitial_of_unique (wideEqualizer (id : endos → endos)) diff --git a/Mathlib/CategoryTheory/Limits/Final.lean b/Mathlib/CategoryTheory/Limits/Final.lean index 40de447a51ef95..7083e202e084c2 100644 --- a/Mathlib/CategoryTheory/Limits/Final.lean +++ b/Mathlib/CategoryTheory/Limits/Final.lean @@ -928,15 +928,15 @@ variable {C : Type u₁} [Category.{v₁} C] {c : C} lemma final_fromPUnit_of_isTerminal (hc : Limits.IsTerminal c) : (fromPUnit c).Final where out c' := by - letI : Inhabited (StructuredArrow c' (fromPUnit c)) := ⟨.mk (Y := default) (hc.from c')⟩ - letI : Subsingleton (StructuredArrow c' (fromPUnit c)) := + let : Inhabited (StructuredArrow c' (fromPUnit c)) := ⟨.mk (Y := default) (hc.from c')⟩ + let : Subsingleton (StructuredArrow c' (fromPUnit c)) := ⟨fun i j ↦ StructuredArrow.obj_ext _ _ (by cat_disch) (hc.hom_ext _ _)⟩ infer_instance lemma initial_fromPUnit_of_isInitial (hc : Limits.IsInitial c) : (fromPUnit c).Initial where out c' := by - letI : Inhabited (CostructuredArrow (fromPUnit c) c') := ⟨.mk (Y := default) (hc.to c')⟩ - letI : Subsingleton (CostructuredArrow (fromPUnit c) c') := + let : Inhabited (CostructuredArrow (fromPUnit c) c') := ⟨.mk (Y := default) (hc.to c')⟩ + let : Subsingleton (CostructuredArrow (fromPUnit c) c') := ⟨fun i j ↦ CostructuredArrow.obj_ext _ _ (by cat_disch) (hc.hom_ext _ _)⟩ infer_instance @@ -1102,7 +1102,7 @@ instance Grothendieck.final_pre [hG : Final G] : (Grothendieck.pre F G).Final := constructor rintro ⟨d, f⟩ let ⟨u, c, g⟩ : Nonempty (StructuredArrow d G) := inferInstance - letI : Nonempty (StructuredArrow ⟨d, f⟩ (pre F G)) := + let : Nonempty (StructuredArrow ⟨d, f⟩ (pre F G)) := ⟨u, ⟨c, (F.map g).toFunctor.obj f⟩, ⟨(by exact g), (by exact 𝟙 _)⟩⟩ apply zigzag_isConnected rintro ⟨⟨⟨⟩⟩, ⟨bi, fi⟩, ⟨gbi, gfi⟩⟩ ⟨⟨⟨⟩⟩, ⟨bj, fj⟩, ⟨gbj, gfj⟩⟩ diff --git a/Mathlib/CategoryTheory/Limits/HasLimits.lean b/Mathlib/CategoryTheory/Limits/HasLimits.lean index 32b9ff4f07b696..167bdd3d91ff3f 100644 --- a/Mathlib/CategoryTheory/Limits/HasLimits.lean +++ b/Mathlib/CategoryTheory/Limits/HasLimits.lean @@ -387,7 +387,7 @@ variable (D : L ⥤ K) @[simp] theorem limit.pre_pre [h : HasLimit (D ⋙ E ⋙ F)] : haveI : HasLimit ((D ⋙ E) ⋙ F) := h limit.pre F E ≫ limit.pre (E ⋙ F) D = limit.pre F (D ⋙ E) := by - haveI : HasLimit ((D ⋙ E) ⋙ F) := h + have : HasLimit ((D ⋙ E) ⋙ F) := h ext j; erw [assoc, limit.pre_π, limit.pre_π, limit.pre_π]; rfl variable {E F} @@ -432,7 +432,7 @@ theorem limit.post_post {E : Type u''} [Category.{v''} E] (H : D ⥤ E) [h : Has -- H G (limit F) ⟶ limit (F ⋙ (G ⋙ H)) haveI : HasLimit (F ⋙ G ⋙ H) := h H.map (limit.post F G) ≫ limit.post (F ⋙ G) H = limit.post F (G ⋙ H) := by - haveI : HasLimit (F ⋙ G ⋙ H) := h + have : HasLimit (F ⋙ G ⋙ H) := h ext; erw [assoc, limit.post_π, ← H.map_comp, limit.post_π, limit.post_π]; rfl end Post @@ -444,7 +444,7 @@ theorem limit.pre_post {D : Type u'} [Category.{v'} D] (E : K ⥤ J) (F : J ⥤ -- G (limit F) ⟶ limit F ⋙ G ⟶ limit (E ⋙ (F ⋙ G)) or haveI : HasLimit (E ⋙ F ⋙ G) := h G.map (limit.pre F E) ≫ limit.post (E ⋙ F) G = limit.post F G ≫ limit.pre (F ⋙ G) E := by - haveI : HasLimit (E ⋙ F ⋙ G) := h + have : HasLimit (E ⋙ F ⋙ G) := h ext; erw [assoc, limit.post_π, ← G.map_comp, limit.pre_π, assoc, limit.pre_π, limit.post_π] open CategoryTheory.Equivalence @@ -458,7 +458,7 @@ instance hasLimit_equivalence_comp (e : K ≌ J) [HasLimit F] : HasLimit (e.func /-- If a `E ⋙ F` has a limit, and `E` is an equivalence, we can construct a limit of `F`. -/ theorem hasLimit_of_equivalence_comp (e : K ≌ J) [HasLimit (e.functor ⋙ F)] : HasLimit F := by - haveI : HasLimit (e.inverse ⋙ e.functor ⋙ F) := Limits.hasLimit_equivalence_comp e.symm + have : HasLimit (e.inverse ⋙ e.functor ⋙ F) := Limits.hasLimit_equivalence_comp e.symm apply hasLimit_of_iso (e.invFunIdAssoc F) lemma hasLimit_equivalence_comp_iff (e : K ≌ J) : HasLimit (e.functor ⋙ F) ↔ HasLimit F := @@ -976,7 +976,7 @@ theorem colimit.pre_pre [h : HasColimit (D ⋙ E ⋙ F)] : colimit.pre (E ⋙ F) D ≫ colimit.pre F E = colimit.pre F (D ⋙ E) := by ext j rw [← assoc, colimit.ι_pre, colimit.ι_pre] - haveI : HasColimit ((D ⋙ E) ⋙ F) := h + have : HasColimit ((D ⋙ E) ⋙ F) := h exact (colimit.ι_pre F (D ⋙ E) j).symm variable {E F} @@ -1029,7 +1029,7 @@ theorem colimit.post_post {E : Type u''} [Category.{v''} E] (H : D ⥤ E) colimit.post (F ⋙ G) H ≫ H.map (colimit.post F G) = colimit.post F (G ⋙ H) := by ext j rw [← assoc, colimit.ι_post, ← H.map_comp, colimit.ι_post] - haveI : HasColimit (F ⋙ G ⋙ H) := h + have : HasColimit (F ⋙ G ⋙ H) := h exact (colimit.ι_post F (G ⋙ H) j).symm end Post @@ -1044,7 +1044,7 @@ theorem colimit.pre_post {D : Type u'} [Category.{v'} D] (E : K ⥤ J) (F : J colimit.pre (F ⋙ G) E ≫ colimit.post F G := by ext j rw [← assoc, colimit.ι_post, ← G.map_comp, colimit.ι_pre, ← assoc] - haveI : HasColimit (E ⋙ F ⋙ G) := h + have : HasColimit (E ⋙ F ⋙ G) := h erw [colimit.ι_pre (F ⋙ G) E j, colimit.ι_post] open CategoryTheory.Equivalence @@ -1057,7 +1057,7 @@ instance hasColimit_equivalence_comp (e : K ≌ J) [HasColimit F] : HasColimit ( /-- If a `E ⋙ F` has a colimit, and `E` is an equivalence, we can construct a colimit of `F`. -/ theorem hasColimit_of_equivalence_comp (e : K ≌ J) [HasColimit (e.functor ⋙ F)] : HasColimit F := by - haveI : HasColimit (e.inverse ⋙ e.functor ⋙ F) := Limits.hasColimit_equivalence_comp e.symm + have : HasColimit (e.inverse ⋙ e.functor ⋙ F) := Limits.hasColimit_equivalence_comp e.symm apply hasColimit_of_iso (e.invFunIdAssoc F).symm lemma hasColimit_equivalence_comp_iff (e : K ≌ J) : HasColimit (e.functor ⋙ F) ↔ HasColimit F := diff --git a/Mathlib/CategoryTheory/Limits/IsConnected.lean b/Mathlib/CategoryTheory/Limits/IsConnected.lean index 72d660634779fe..13144ac27ef694 100644 --- a/Mathlib/CategoryTheory/Limits/IsConnected.lean +++ b/Mathlib/CategoryTheory/Limits/IsConnected.lean @@ -149,7 +149,7 @@ variable (C : Type*) [Category* C] /-- Prove that a category is connected by supplying an explicit initial object. -/ lemma isConnected_of_isInitial {x : C} (h : Limits.IsInitial x) : IsConnected C := by - letI : Nonempty C := ⟨x⟩ + let : Nonempty C := ⟨x⟩ apply isConnected_of_zigzag intro j₁ j₂ use [x, j₂] @@ -159,7 +159,7 @@ lemma isConnected_of_isInitial {x : C} (h : Limits.IsInitial x) : IsConnected C /-- Prove that a category is connected by supplying an explicit terminal object. -/ lemma isConnected_of_isTerminal {x : C} (h : Limits.IsTerminal x) : IsConnected C := by - letI : Nonempty C := ⟨x⟩ + let : Nonempty C := ⟨x⟩ apply isConnected_of_zigzag intro j₁ j₂ use [x, j₂] diff --git a/Mathlib/CategoryTheory/Limits/Lattice.lean b/Mathlib/CategoryTheory/Limits/Lattice.lean index 324785f5ee4e52..260e9f9e176599 100644 --- a/Mathlib/CategoryTheory/Limits/Lattice.lean +++ b/Mathlib/CategoryTheory/Limits/Lattice.lean @@ -99,7 +99,7 @@ theorem finite_coproduct_eq_finset_sup [SemilatticeSup α] [OrderBot α] {ι : T -- see Note [lower instance priority] instance (priority := 100) [SemilatticeInf α] [OrderTop α] : HasBinaryProducts α := by have : ∀ x y : α, HasLimit (pair x y) := by - letI := hasFiniteLimits_of_hasFiniteLimits_of_size.{u} α + let := hasFiniteLimits_of_hasFiniteLimits_of_size.{u} α infer_instance apply hasBinaryProducts_of_hasLimit_pair @@ -118,7 +118,7 @@ theorem prod_eq_inf [SemilatticeInf α] [OrderTop α] (x y : α) : Limits.prod x -- see Note [lower instance priority] instance (priority := 100) [SemilatticeSup α] [OrderBot α] : HasBinaryCoproducts α := by have : ∀ x y : α, HasColimit (pair x y) := by - letI := hasFiniteColimits_of_hasFiniteColimits_of_size.{u} α + let := hasFiniteColimits_of_hasFiniteColimits_of_size.{u} α infer_instance apply hasBinaryCoproducts_of_hasColimit_pair diff --git a/Mathlib/CategoryTheory/Limits/MonoCoprod.lean b/Mathlib/CategoryTheory/Limits/MonoCoprod.lean index 8f6fd6777fbe73..3229ffa052a6a5 100644 --- a/Mathlib/CategoryTheory/Limits/MonoCoprod.lean +++ b/Mathlib/CategoryTheory/Limits/MonoCoprod.lean @@ -54,7 +54,7 @@ variable {C} instance (priority := 100) monoCoprodOfHasZeroMorphisms [HasZeroMorphisms C] : MonoCoprod C := ⟨fun A B c hc => by - haveI : IsSplitMono c.inl := + have : IsSplitMono c.inl := IsSplitMono.mk' (SplitMono.mk (BinaryCofan.IsColimit.desc hc (𝟙 A) 0) (IsColimit.fac _ _ _)) infer_instance⟩ @@ -63,7 +63,7 @@ namespace MonoCoprod set_option backward.isDefEq.respectTransparency false in theorem binaryCofan_inr {A B : C} [MonoCoprod C] (c : BinaryCofan A B) (hc : IsColimit c) : Mono c.inr := by - haveI hc' : IsColimit (BinaryCofan.mk c.inr c.inl) := + have hc' : IsColimit (BinaryCofan.mk c.inr c.inl) := BinaryCofan.IsColimit.mk _ (fun f₁ f₂ => BinaryCofan.IsColimit.desc (s := c) hc f₂ f₁) (by simp) (by simp) diff --git a/Mathlib/CategoryTheory/Limits/MorphismProperty.lean b/Mathlib/CategoryTheory/Limits/MorphismProperty.lean index 66f8eb57f06f89..8016311053c3b0 100644 --- a/Mathlib/CategoryTheory/Limits/MorphismProperty.lean +++ b/Mathlib/CategoryTheory/Limits/MorphismProperty.lean @@ -101,7 +101,7 @@ instance CostructuredArrow.closedUnderLimitsOfShape_discrete_empty [L.Faithful] (P.costructuredArrowObj L (X := L.obj Y)).IsClosedUnderLimitsOfShape (Discrete PEmpty.{1}) where limitsOfShape_le := by rintro X p - letI t : IsTerminal X := (ObjectProperty.limitsOfShape_isEmpty_iff _ _ _ |>.mp p).some + let t : IsTerminal X := (ObjectProperty.limitsOfShape_isEmpty_iff _ _ _ |>.mp p).some let e : X ≅ CostructuredArrow.mk (𝟙 (L.obj Y)) := t.uniqueUpToIso CostructuredArrow.mkIdTerminal simpa [MorphismProperty.costructuredArrowObj_iff, P.costructuredArrow_iso_iff e] using P.id_mem (L.obj Y) @@ -183,7 +183,7 @@ instance StructuredArrow.closedUnderColimitsOfShape_discrete_empty [L.Faithful] (P.structuredArrowObj L (X := L.obj Y)).IsClosedUnderColimitsOfShape (Discrete PEmpty.{1}) where colimitsOfShape_le := by rintro X p - letI t : IsInitial X := (ObjectProperty.colimitsOfShape_isEmpty_iff _ _ _ |>.mp p).some + let t : IsInitial X := (ObjectProperty.colimitsOfShape_isEmpty_iff _ _ _ |>.mp p).some let e : X ≅ StructuredArrow.mk (𝟙 (L.obj Y)) := t.uniqueUpToIso StructuredArrow.mkIdInitial simpa [MorphismProperty.structuredArrowObj_iff, P.structuredArrow_iso_iff e] using P.id_mem (L.obj Y) diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Bifunctor.lean b/Mathlib/CategoryTheory/Limits/Preserves/Bifunctor.lean index 5dbce868ff5ce4..2e76a7699b92dc 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Bifunctor.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Bifunctor.lean @@ -231,7 +231,7 @@ instance of_preservesColimits_in_each_variable symm apply (P j₁).hom_ext intro j₂ - haveI := (P j₁).fac s j₂ + have := (P j₁).fac s j₂ simp only [Functor.mapCocone_pt, Functor.mapCocone_ι_app, Q₀, s] at this simp only [Functor.mapCocone_pt, Functor.mapCocone_ι_app, NatTrans.naturality, this, Q₀, s]) @@ -361,7 +361,7 @@ instance of_preservesLimits_in_each_variable symm apply (P j₁).hom_ext intro j₂ - haveI := (P j₁).fac s j₂ + have := (P j₁).fac s j₂ simp only [whiskeringLeft₂_obj_obj_obj_obj_obj, Functor.mapCone_pt, Functor.mapCone_π_app, s, Q₀] at this simp only [whiskeringLeft₂_obj_obj_obj_obj_obj, diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Filtered.lean b/Mathlib/CategoryTheory/Limits/Preserves/Filtered.lean index 6e746297d1eeca..5b428c617faf3a 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Filtered.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Filtered.lean @@ -79,7 +79,7 @@ lemma preservesFilteredColimitsOfSize_of_univLE (F : C ⥤ D) [UnivLE.{w, w'}] PreservesFilteredColimitsOfSize.{w, w₂} F where preserves_filtered_colimits J _ _ := by let e := ((ShrinkHoms.equivalence.{w'} J).trans <| Shrink.equivalence _).symm - haveI := IsFiltered.of_equivalence e.symm + have := IsFiltered.of_equivalence e.symm exact preservesColimitsOfShape_of_equiv e F /-- @@ -135,7 +135,7 @@ lemma reflectsFilteredColimitsOfSize_of_univLE (F : C ⥤ D) [UnivLE.{w, w'}] ReflectsFilteredColimitsOfSize.{w, w₂} F where reflects_filtered_colimits J _ _ := by let e := ((ShrinkHoms.equivalence.{w'} J).trans <| Shrink.equivalence _).symm - haveI := IsFiltered.of_equivalence e.symm + have := IsFiltered.of_equivalence e.symm exact reflectsColimitsOfShape_of_equiv e F /-- @@ -195,7 +195,7 @@ lemma preservesCofilteredLimitsOfSize_of_univLE (F : C ⥤ D) [UnivLE.{w, w'}] PreservesCofilteredLimitsOfSize.{w, w₂} F where preserves_cofiltered_limits J _ _ := by let e := ((ShrinkHoms.equivalence.{w'} J).trans <| Shrink.equivalence _).symm - haveI := IsCofiltered.of_equivalence e.symm + have := IsCofiltered.of_equivalence e.symm exact preservesLimitsOfShape_of_equiv e F /-- @@ -251,7 +251,7 @@ lemma reflectsCofilteredLimitsOfSize_of_univLE (F : C ⥤ D) [UnivLE.{w, w'}] ReflectsCofilteredLimitsOfSize.{w, w₂} F where reflects_cofiltered_limits J _ _ := by let e := ((ShrinkHoms.equivalence.{w'} J).trans <| Shrink.equivalence _).symm - haveI := IsCofiltered.of_equivalence e.symm + have := IsCofiltered.of_equivalence e.symm exact reflectsLimitsOfShape_of_equiv e F /-- diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Finite.lean b/Mathlib/CategoryTheory/Limits/Preserves/Finite.lean index e70dd1385a60ee..53a5e58d2c29a3 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Finite.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Finite.lean @@ -59,7 +59,7 @@ instance (priority := 100) preservesLimitsOfShapeOfPreservesFiniteLimits (F : C lemma PreservesLimitsOfSize.preservesFiniteLimits (F : C ⥤ D) [PreservesLimitsOfSize.{w, w₂} F] : PreservesFiniteLimits F where preservesFiniteLimits J (sJ : SmallCategory J) fJ := by - haveI := preservesSmallestLimits_of_preservesLimits F + have := preservesSmallestLimits_of_preservesLimits F exact preservesLimitsOfShape_of_equiv (FinCategory.equivAsType J) F -- Added as a specialization of the dangerous instance above, for limits indexed in Type 0. @@ -80,7 +80,7 @@ lemma preservesFiniteLimits_of_preservesFiniteLimitsOfSize (F : C ⥤ D) ∀ (J : Type w) {𝒥 : SmallCategory J} (_ : @FinCategory J 𝒥), PreservesLimitsOfShape J F) : PreservesFiniteLimits F where preservesFiniteLimits J (_ : SmallCategory J) _ := by - haveI := h (ULiftHom (ULift J)) CategoryTheory.finCategoryUlift + have := h (ULiftHom (ULift J)) CategoryTheory.finCategoryUlift exact preservesLimitsOfShape_of_equiv (ULiftHomULiftCategory.equiv J).symm F /-- The composition of two left exact functors is left exact. -/ @@ -143,7 +143,7 @@ instance (priority := 100) (F : C ⥤ D) [ReflectsFiniteProducts F] (J : Type u) lemma ReflectsLimitsOfSize.reflectsFiniteLimits (F : C ⥤ D) [ReflectsLimitsOfSize.{w, w₂} F] : ReflectsFiniteLimits F where reflects J (sJ : SmallCategory J) fJ := by - haveI := reflectsSmallestLimits_of_reflectsLimits F + have := reflectsSmallestLimits_of_reflectsLimits F exact reflectsLimitsOfShape_of_equiv (FinCategory.equivAsType J) F -- Added as a specialization of the dangerous instance above, for colimits indexed in Type 0. @@ -214,7 +214,7 @@ instance (priority := 100) preservesColimitsOfShapeOfPreservesFiniteColimits lemma PreservesColimitsOfSize.preservesFiniteColimits (F : C ⥤ D) [PreservesColimitsOfSize.{w, w₂} F] : PreservesFiniteColimits F where preservesFiniteColimits J (sJ : SmallCategory J) fJ := by - haveI := preservesSmallestColimits_of_preservesColimits F + have := preservesSmallestColimits_of_preservesColimits F exact preservesColimitsOfShape_of_equiv (FinCategory.equivAsType J) F -- Added as a specialization of the dangerous instance above, for colimits indexed in Type 0. @@ -235,8 +235,8 @@ lemma preservesFiniteColimits_of_preservesFiniteColimitsOfSize (F : C ⥤ D) ∀ (J : Type w) {𝒥 : SmallCategory J} (_ : @FinCategory J 𝒥), PreservesColimitsOfShape J F) : PreservesFiniteColimits F where preservesFiniteColimits J (_ : SmallCategory J) _ := by - letI : Category (ULiftHom (ULift J)) := ULiftHom.category - haveI := h (ULiftHom (ULift J)) CategoryTheory.finCategoryUlift + let : Category (ULiftHom (ULift J)) := ULiftHom.category + have := h (ULiftHom (ULift J)) CategoryTheory.finCategoryUlift exact preservesColimitsOfShape_of_equiv (ULiftHomULiftCategory.equiv J).symm F /-- The composition of two right exact functors is right exact. -/ @@ -284,7 +284,7 @@ attribute [instance] ReflectsFiniteColimits.reflects lemma ReflectsColimitsOfSize.reflectsFiniteColimits (F : C ⥤ D) [ReflectsColimitsOfSize.{w, w₂} F] : ReflectsFiniteColimits F where reflects J (sJ : SmallCategory J) fJ := by - haveI := reflectsSmallestColimits_of_reflectsColimits F + have := reflectsSmallestColimits_of_reflectsColimits F exact reflectsColimitsOfShape_of_equiv (FinCategory.equivAsType J) F -- Added as a specialization of the dangerous instance above, for colimits indexed in Type 0. diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Grothendieck.lean b/Mathlib/CategoryTheory/Limits/Preserves/Grothendieck.lean index 5e460381f09c30..62183f262e47b8 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Grothendieck.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Grothendieck.lean @@ -84,7 +84,7 @@ instance preservesLimitsOfShape_colim_grothendieck [HasColimitsOfShape C H] [Has _ ≅ limit (K ⋙ colim) := HasLimit.isoOfNatIso (associator _ _ _ ≪≫ isoWhiskerLeft _ fiberwiseColimCompColimIso) - haveI : IsIso (limit.post K colim) := by + have : IsIso (limit.post K colim) := by convert! Iso.isIso_hom i₂ ext simp only [colim_obj, Functor.comp_obj, limit.post_π, colim_map, Iso.trans_def, diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Biproducts.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Biproducts.lean index b6f53dbfb62472..648b8b55d7e5d8 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Biproducts.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Biproducts.lean @@ -144,7 +144,7 @@ lemma preservesBiproducts_shrink (F : C ⥤ D) [PreservesZeroMorphisms F] instance (priority := 100) preservesFiniteBiproductsOfPreservesBiproducts (F : C ⥤ D) [PreservesZeroMorphisms F] [PreservesBiproducts.{w₁} F] : PreservesFiniteBiproducts F where - preserves {J} _ := by letI := preservesBiproducts_shrink.{0} F; infer_instance + preserves {J} _ := by let := preservesBiproducts_shrink.{0} F; infer_instance /-- A functor `F` preserves binary biproducts of `X` and `Y` if `F` maps every bilimit bicone over `X` and `Y` to a bilimit bicone over `F.obj X` and `F.obj Y`. -/ diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Equalizers.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Equalizers.lean index df1b7a6308947f..a4e859af2ebd2e 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Equalizers.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Equalizers.lean @@ -189,7 +189,7 @@ instance : IsIso (coequalizerComparison f g G) := by instance map_π_epi : Epi (G.map (coequalizer.π f g)) := ⟨fun {W} h k => by rw [← ι_comp_coequalizerComparison] - haveI : Epi (coequalizer.π (G.map f) (G.map g) ≫ coequalizerComparison f g G) := by + have : Epi (coequalizer.π (G.map f) (G.map g) ≫ coequalizerComparison f g G) := by apply epi_comp apply (cancel_epi _).1⟩ diff --git a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Terminal.lean b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Terminal.lean index e5f61fbbd735ea..f222b8dc7366be 100644 --- a/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Terminal.lean +++ b/Mathlib/CategoryTheory/Limits/Preserves/Shapes/Terminal.lean @@ -86,7 +86,7 @@ has limits of shape `J` and `G` preserves them, then `D` does not necessarily ha -/ theorem hasTerminal_of_hasTerminal_of_preservesLimit [PreservesLimit (Functor.empty.{0} C) G] : HasTerminal D := ⟨fun F => by - haveI := HasLimit.mk ⟨_, isLimitOfHasTerminalOfPreservesLimit G⟩ + have := HasLimit.mk ⟨_, isLimitOfHasTerminalOfPreservesLimit G⟩ apply hasLimit_of_iso F.uniqueFromEmpty.symm⟩ variable [HasTerminal D] @@ -178,7 +178,7 @@ shape `J`. theorem hasInitial_of_hasInitial_of_preservesColimit [PreservesColimit (Functor.empty.{0} C) G] : HasInitial D := ⟨fun F => by - haveI := HasColimit.mk ⟨_, isColimitOfHasInitialOfPreservesColimit G⟩ + have := HasColimit.mk ⟨_, isColimitOfHasInitialOfPreservesColimit G⟩ apply hasColimit_of_iso F.uniqueFromEmpty⟩ variable [HasInitial D] diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Biproducts.lean b/Mathlib/CategoryTheory/Limits/Shapes/Biproducts.lean index 168fcf4e55e9dc..a6508413d63fe5 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Biproducts.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Biproducts.lean @@ -391,7 +391,7 @@ theorem hasBiproductsOfShape_of_equiv {K : Type w'} [HasBiproductsOfShape K C] ( instance (priority := 100) hasBiproductsOfShape_finite [HasFiniteBiproducts C] [Finite J] : HasBiproductsOfShape J C := by rcases Finite.exists_equiv_fin J with ⟨n, ⟨e⟩⟩ - haveI : HasBiproductsOfShape (Fin n) C := HasFiniteBiproducts.out n + have : HasBiproductsOfShape (Fin n) C := HasFiniteBiproducts.out n exact hasBiproductsOfShape_of_equiv C e instance (priority := 100) hasFiniteProducts_of_hasFiniteBiproducts [HasFiniteBiproducts C] : diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Equalizers.lean b/Mathlib/CategoryTheory/Limits/Shapes/Equalizers.lean index e02b96e3fe1a9b..a788f7f375946a 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Equalizers.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Equalizers.lean @@ -1347,7 +1347,7 @@ def splitMonoOfIdempotentOfIsLimitFork {X : C} {f : X ⟶ X} (hf : f ≫ f = f) (i : IsLimit c) : SplitMono c.ι where retraction := i.lift (Fork.ofι f (by simp [hf])) id := by - letI := mono_of_isLimit_fork i + let := mono_of_isLimit_fork i rw [← cancel_mono_id c.ι, Category.assoc, Fork.IsLimit.lift_ι, Fork.ι_ofι, ← c.condition] exact Category.comp_id c.ι @@ -1427,7 +1427,7 @@ def splitEpiOfIdempotentOfIsColimitCofork {X : C} {f : X ⟶ X} (hf : f ≫ f = (i : IsColimit c) : SplitEpi c.π where section_ := i.desc (Cofork.ofπ f (by simp [hf])) id := by - letI := epi_of_isColimit_cofork i + let := epi_of_isColimit_cofork i rw [← cancel_epi_id c.π, ← Category.assoc, Cofork.IsColimit.π_desc, Cofork.π_ofπ, ← c.condition] exact Category.id_comp _ diff --git a/Mathlib/CategoryTheory/Limits/Shapes/FiniteLimits.lean b/Mathlib/CategoryTheory/Limits/Shapes/FiniteLimits.lean index 8103b89be052e2..08c3f7e8ea6ad8 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/FiniteLimits.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/FiniteLimits.lean @@ -73,7 +73,7 @@ theorem hasFiniteLimits_of_hasFiniteLimits_of_size (h : ∀ (J : Type w) {𝒥 : SmallCategory J} (_ : @FinCategory J 𝒥), HasLimitsOfShape J C) : HasFiniteLimits C where out := fun J hJ hhJ => by - haveI := h (ULiftHom.{w} (ULift.{w} J)) <| @CategoryTheory.finCategoryUlift J hJ hhJ + have := h (ULiftHom.{w} (ULift.{w} J)) <| @CategoryTheory.finCategoryUlift J hJ hhJ have l : @Equivalence J (ULiftHom (ULift J)) hJ (@ULiftHom.category (ULift J) (@uliftCategory J hJ)) := @ULiftHomULiftCategory.equiv J hJ @@ -117,7 +117,7 @@ theorem hasFiniteColimits_of_hasFiniteColimits_of_size (h : ∀ (J : Type w) {𝒥 : SmallCategory J} (_ : @FinCategory J 𝒥), HasColimitsOfShape J C) : HasFiniteColimits C where out := fun J hJ hhJ => by - haveI := h (ULiftHom.{w} (ULift.{w} J)) <| @CategoryTheory.finCategoryUlift J hJ hhJ + have := h (ULiftHom.{w} (ULift.{w} J)) <| @CategoryTheory.finCategoryUlift J hJ hhJ have l : @Equivalence J (ULiftHom (ULift J)) hJ (@ULiftHom.category (ULift J) (@uliftCategory J hJ)) := @ULiftHomULiftCategory.equiv J hJ @@ -224,7 +224,7 @@ class HasFiniteWidePullbacks : Prop where instance hasLimitsOfShape_widePullbackShape (J : Type) [Finite J] [HasFiniteWidePullbacks C] : HasLimitsOfShape (WidePullbackShape J) C := by - haveI := @HasFiniteWidePullbacks.out C _ _ J + have := @HasFiniteWidePullbacks.out C _ _ J infer_instance /-- A category `HasFiniteWidePushouts` if it has all colimits of shape `WidePushoutShape J` for @@ -236,7 +236,7 @@ class HasFiniteWidePushouts : Prop where instance hasColimitsOfShape_widePushoutShape (J : Type) [Finite J] [HasFiniteWidePushouts C] : HasColimitsOfShape (WidePushoutShape J) C := by - haveI := @HasFiniteWidePushouts.out C _ _ J + have := @HasFiniteWidePushouts.out C _ _ J infer_instance /-- Finite wide pullbacks are finite limits, so if `C` has all finite limits, diff --git a/Mathlib/CategoryTheory/Limits/Shapes/FiniteProducts.lean b/Mathlib/CategoryTheory/Limits/Shapes/FiniteProducts.lean index 38f8a5716013e6..ffa74e33e699b6 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/FiniteProducts.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/FiniteProducts.lean @@ -43,7 +43,7 @@ instance (priority := 10) hasFiniteProducts_of_hasFiniteLimits [HasFiniteLimits instance hasLimitsOfShape_discrete [HasFiniteProducts C] (ι : Type w) [Finite ι] : HasLimitsOfShape (Discrete ι) C := by rcases Finite.exists_equiv_fin ι with ⟨n, ⟨e⟩⟩ - haveI : HasLimitsOfShape (Discrete (Fin n)) C := HasFiniteProducts.out n + have : HasLimitsOfShape (Discrete (Fin n)) C := HasFiniteProducts.out n exact hasLimitsOfShape_of_equivalence (Discrete.equivalence e.symm) /-- We can now write this for powers. -/ @@ -68,7 +68,7 @@ class HasFiniteCoproducts : Prop where instance hasColimitsOfShape_discrete [HasFiniteCoproducts C] (ι : Type w) [Finite ι] : HasColimitsOfShape (Discrete ι) C := by rcases Finite.exists_equiv_fin ι with ⟨n, ⟨e⟩⟩ - haveI : HasColimitsOfShape (Discrete (Fin n)) C := HasFiniteCoproducts.out n + have : HasColimitsOfShape (Discrete (Fin n)) C := HasFiniteCoproducts.out n exact hasColimitsOfShape_of_equivalence (Discrete.equivalence e.symm) /-- If `C` has finite colimits then it has finite coproducts. -/ diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Images.lean b/Mathlib/CategoryTheory/Limits/Shapes/Images.lean index 7a32afb6b3122a..db0925d48b3637 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Images.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Images.lean @@ -1029,8 +1029,8 @@ theorem hasStrongEpiMonoFactorisations_imp_of_isEquivalence (F : C ⥤ D) [IsEqu ⟨fun {X} {Y} f => by let em : StrongEpiMonoFactorisation (F.inv.map f) := (HasStrongEpiMonoFactorisations.has_fac (F.inv.map f)).some - haveI : Mono (F.map em.m ≫ F.asEquivalence.counitIso.hom.app Y) := mono_comp _ _ - haveI : StrongEpi (F.asEquivalence.counitIso.inv.app X ≫ F.map em.e) := strongEpi_comp _ _ + have : Mono (F.map em.m ≫ F.asEquivalence.counitIso.hom.app Y) := mono_comp _ _ + have : StrongEpi (F.asEquivalence.counitIso.inv.app X ≫ F.map em.e) := strongEpi_comp _ _ exact Nonempty.intro { I := F.obj em.I diff --git a/Mathlib/CategoryTheory/Limits/Shapes/IsTerminal.lean b/Mathlib/CategoryTheory/Limits/Shapes/IsTerminal.lean index f68d561c9176f3..2336b2f854393f 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/IsTerminal.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/IsTerminal.lean @@ -193,11 +193,11 @@ theorem IsInitial.isSplitEpi_to {X Y : C} (t : IsInitial X) (f : Y ⟶ X) : IsSp /-- Any morphism from a terminal object is mono. -/ theorem IsTerminal.mono_from {X Y : C} (t : IsTerminal X) (f : X ⟶ Y) : Mono f := by - haveI := t.isSplitMono_from f; infer_instance + have := t.isSplitMono_from f; infer_instance /-- Any morphism to an initial object is epi. -/ theorem IsInitial.epi_to {X Y : C} (t : IsInitial X) (f : Y ⟶ X) : Epi f := by - haveI := t.isSplitEpi_to f; infer_instance + have := t.isSplitEpi_to f; infer_instance /-- If `T` and `T'` are terminal, they are isomorphic. -/ @[simps] diff --git a/Mathlib/CategoryTheory/Limits/Shapes/NormalMono/Basic.lean b/Mathlib/CategoryTheory/Limits/Shapes/NormalMono/Basic.lean index b440455edad094..2fa2ad31bce3b6 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/NormalMono/Basic.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/NormalMono/Basic.lean @@ -158,7 +158,7 @@ def normalMonoOfMono [IsNormalMonoCategory C] (f : X ⟶ Y) [Mono f] : NormalMon instance (priority := 100) regularMonoCategoryOfNormalMonoCategory [IsNormalMonoCategory C] : IsRegularMonoCategory C where regularMonoOfMono f _ := by - haveI := normalMonoOfMono f + have := normalMonoOfMono f infer_instance end @@ -326,7 +326,7 @@ def normalEpiOfEpi [IsNormalEpiCategory C] (f : X ⟶ Y) [Epi f] : NormalEpi f : instance (priority := 100) regularEpiCategoryOfNormalEpiCategory [IsNormalEpiCategory C] : IsRegularEpiCategory C where regularEpiOfEpi f _ := by - haveI := normalEpiOfEpi f + have := normalEpiOfEpi f infer_instance end CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Products.lean b/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Products.lean index 7ed24f4290765c..0ffb967cc20582 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Products.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Products.lean @@ -36,7 +36,7 @@ variable (X : Type v₂) /-- If `C` has products indexed by `X`, then `Cᵒᵖ` has coproducts indexed by `X`. -/ instance hasCoproductsOfShape_opposite [HasProductsOfShape X C] : HasCoproductsOfShape X Cᵒᵖ := by - haveI : HasLimitsOfShape (Discrete X)ᵒᵖ C := + have : HasLimitsOfShape (Discrete X)ᵒᵖ C := hasLimitsOfShape_of_equivalence (Discrete.opposite X).symm infer_instance diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Pullbacks.lean b/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Pullbacks.lean index ffe8ab9e0a96bc..d24b7e08387847 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Pullbacks.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Opposites/Pullbacks.lean @@ -33,12 +33,12 @@ variable {C : Type u₁} [Category.{v₁} C] variable {J : Type u₂} [Category.{v₂} J] instance hasPullbacks_opposite [HasPushouts C] : HasPullbacks Cᵒᵖ := by - haveI : HasColimitsOfShape WalkingCospanᵒᵖ C := + have : HasColimitsOfShape WalkingCospanᵒᵖ C := hasColimitsOfShape_of_equivalence walkingCospanOpEquiv.symm apply hasLimitsOfShape_op_of_hasColimitsOfShape instance hasPushouts_opposite [HasPullbacks C] : HasPushouts Cᵒᵖ := by - haveI : HasLimitsOfShape WalkingSpanᵒᵖ C := + have : HasLimitsOfShape WalkingSpanᵒᵖ C := hasLimitsOfShape_of_equivalence walkingSpanOpEquiv.symm infer_instance diff --git a/Mathlib/CategoryTheory/Limits/Shapes/Reflexive.lean b/Mathlib/CategoryTheory/Limits/Shapes/Reflexive.lean index 3d08f695eb27e5..1b283d8e6d6d7b 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/Reflexive.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/Reflexive.lean @@ -159,12 +159,12 @@ attribute [instance 1] HasCoreflexiveEqualizers.has_eq theorem hasCoequalizer_of_common_section [HasReflexiveCoequalizers C] {A B : C} {f g : A ⟶ B} (r : B ⟶ A) (rf : r ≫ f = 𝟙 _) (rg : r ≫ g = 𝟙 _) : HasCoequalizer f g := by - letI := IsReflexivePair.mk' r rf rg + let := IsReflexivePair.mk' r rf rg infer_instance theorem hasEqualizer_of_common_retraction [HasCoreflexiveEqualizers C] {A B : C} {f g : A ⟶ B} (r : B ⟶ A) (fr : f ≫ r = 𝟙 _) (gr : g ≫ r = 𝟙 _) : HasEqualizer f g := by - letI := IsCoreflexivePair.mk' r fr gr + let := IsCoreflexivePair.mk' r fr gr infer_instance /-- If `C` has coequalizers, then it has reflexive coequalizers. -/ diff --git a/Mathlib/CategoryTheory/Limits/Shapes/RegularMono.lean b/Mathlib/CategoryTheory/Limits/Shapes/RegularMono.lean index 260c995a2118c9..f7436a1a3ab60b 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/RegularMono.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/RegularMono.lean @@ -709,13 +709,13 @@ def regularEpiOfEpi [IsRegularEpiCategory C] (f : X ⟶ Y) [Epi f] : RegularEpi instance (priority := 100) regularEpiCategoryOfSplitEpiCategory [SplitEpiCategory C] : IsRegularEpiCategory C where regularEpiOfEpi f _ := by - haveI := isSplitEpi_of_epi f + have := isSplitEpi_of_epi f infer_instance instance (priority := 100) strongEpiCategory_of_regularEpiCategory [IsRegularEpiCategory C] : StrongEpiCategory C where strongEpi_of_epi f _ := by - haveI := isRegularEpi_of_regularEpi <| regularEpiOfEpi f + have := isRegularEpi_of_regularEpi <| regularEpiOfEpi f infer_instance end CategoryTheory diff --git a/Mathlib/CategoryTheory/Limits/Shapes/StrictInitial.lean b/Mathlib/CategoryTheory/Limits/Shapes/StrictInitial.lean index 4b0713b479ab5b..15fc725c4ae7a2 100644 --- a/Mathlib/CategoryTheory/Limits/Shapes/StrictInitial.lean +++ b/Mathlib/CategoryTheory/Limits/Shapes/StrictInitial.lean @@ -71,8 +71,8 @@ theorem IsInitial.isIso_to (hI : IsInitial I) {A : C} (f : A ⟶ I) : IsIso f := HasStrictInitialObjects.out f hI theorem IsInitial.strict_hom_ext (hI : IsInitial I) {A : C} (f g : A ⟶ I) : f = g := by - haveI := hI.isIso_to f - haveI := hI.isIso_to g + have := hI.isIso_to f + have := hI.isIso_to g exact eq_of_inv_eq_inv (hI.hom_ext (inv f) (inv g)) theorem IsInitial.subsingleton_to (hI : IsInitial I) {A : C} : Subsingleton (A ⟶ I) := @@ -184,8 +184,8 @@ theorem IsTerminal.isIso_from (hI : IsTerminal I) {A : C} (f : I ⟶ A) : IsIso HasStrictTerminalObjects.out f hI theorem IsTerminal.strict_hom_ext (hI : IsTerminal I) {A : C} (f g : I ⟶ A) : f = g := by - haveI := hI.isIso_from f - haveI := hI.isIso_from g + have := hI.isIso_from f + have := hI.isIso_from g exact eq_of_inv_eq_inv (hI.hom_ext (inv f) (inv g)) /-- If `X ⟶ Y` with `Y` being a strict terminal object, then `X` is also a terminal object. -/ @@ -219,7 +219,7 @@ theorem limit_π_isIso_of_is_strict_terminal (F : J ⥤ C) [HasLimit F] (i : J) obtain rfl : f = 𝟙 _ := Subsingleton.elim _ _ simp · cases h - haveI : IsIso (F.map f) := (H _ h_1).isIso_from _ + have : IsIso (F.map f) := (H _ h_1).isIso_from _ rw [← IsIso.comp_inv_eq] apply (H _ h_1).hom_ext · cases h_1 diff --git a/Mathlib/CategoryTheory/Limits/Sifted.lean b/Mathlib/CategoryTheory/Limits/Sifted.lean index f52aaf77e2cf86..e8151ee9fabd95 100644 --- a/Mathlib/CategoryTheory/Limits/Sifted.lean +++ b/Mathlib/CategoryTheory/Limits/Sifted.lean @@ -70,7 +70,7 @@ set_option backward.defeqAttrib.useBackward true in /-- Being sifted is preserved by equivalences of categories -/ lemma isSifted_of_equiv [IsSifted C] {D : Type u₁} [Category.{v₁} D] (e : D ≌ C) : IsSifted D := letI : Final (diag D) := by - letI : D × D ≌ C × C := Equivalence.prod e e + let : D × D ≌ C × C := Equivalence.prod e e have sq : (e.inverse ⋙ diag D ⋙ this.functor ≅ diag C) := NatIso.ofComponents (fun c ↦ by dsimp [this] exact Iso.prod (e.counitIso.app c) (e.counitIso.app c)) @@ -104,7 +104,7 @@ set_option backward.isDefEq.respectTransparency false in instance [HasBinaryCoproducts C] : IsSiftedOrEmpty C := by constructor rintro ⟨c₁, c₂⟩ - haveI : _root_.Nonempty <| StructuredArrow (c₁, c₂) (diag C) := + have : _root_.Nonempty <| StructuredArrow (c₁, c₂) (diag C) := ⟨.mk ((coprod.inl : c₁ ⟶ c₁ ⨿ c₂), (coprod.inr : c₂ ⟶ c₁ ⨿ c₂))⟩ apply isConnected_of_zigzag rintro ⟨_, c, f⟩ ⟨_, c', g⟩ diff --git a/Mathlib/CategoryTheory/Limits/VanKampen.lean b/Mathlib/CategoryTheory/Limits/VanKampen.lean index 4b7e5be79c6a66..7ddb3cd3e86064 100644 --- a/Mathlib/CategoryTheory/Limits/VanKampen.lean +++ b/Mathlib/CategoryTheory/Limits/VanKampen.lean @@ -68,7 +68,7 @@ noncomputable def IsUniversalColimit.isColimit {F : J ⥤ C} {c : Cocone F} (h : IsUniversalColimit c) : IsColimit c := by refine ((h c (𝟙 F) (𝟙 c.pt :) (by rw [Functor.map_id, Category.comp_id, Category.id_comp]) (.of_isIso _)) fun j => ?_).some - haveI : IsIso (𝟙 c.pt) := inferInstance + have : IsIso (𝟙 c.pt) := inferInstance exact IsPullback.of_vert_isIso ⟨by simp⟩ /-- A van Kampen colimit is a colimit. -/ @@ -82,7 +82,7 @@ theorem IsInitial.isVanKampenColimit [HasStrictInitialObjects C] {X : C} (h : Is intro F' c' α f hf hα have : F' = Functor.empty C := by apply Functor.hext <;> rintro ⟨⟨⟩⟩ subst this - haveI := h.isIso_to f + have := h.isIso_to f refine ⟨by rintro _ ⟨⟨⟩⟩, fun _ => ⟨IsColimit.ofIsoColimit h (Cocone.ext (asIso f).symm <| by rintro ⟨⟨⟩⟩)⟩⟩ @@ -109,7 +109,7 @@ theorem IsVanKampenColimit.of_iso {F : J ⥤ C} {c c' : Cocone F} (H : IsVanKamp apply forall_congr' intro j conv_lhs => rw [← Category.comp_id (α.app j)] - haveI : IsIso e.inv.hom := Functor.map_isIso (Cocone.forget _) e.inv + have : IsIso e.inv.hom := Functor.map_isIso (Cocone.forget _) e.inv exact (IsPullback.of_vert_isIso ⟨by simp⟩).paste_vert_iff (NatTrans.congr_app h j).symm set_option backward.isDefEq.respectTransparency false in @@ -279,7 +279,7 @@ theorem IsUniversalColimit.map_reflective intro X apply IsIso.eq_inv_of_inv_hom_id exact adj.left_triangle_components _ - haveI : ∀ X, IsIso (Gl.map (adj.unit.app X)) := by + have : ∀ X, IsIso (Gl.map (adj.unit.app X)) := by simp_rw [hadj] infer_instance have hα'' : ∀ j, Gl.map (Gr.map <| α'.app j) = adj.counit.app _ ≫ α.app j := by @@ -503,13 +503,13 @@ theorem BinaryCofan.isVanKampen_mk {X Y : C} (c : BinaryCofan X Y) obtain ⟨hl, hr⟩ := h₁ αX αY (e.inv ≫ f) (by simp [e, hX]) (by simp [e, hY]) constructor · rw [← Category.id_comp αX, ← Iso.hom_inv_id_assoc e f] - haveI : IsIso (𝟙 X') := inferInstance + have : IsIso (𝟙 X') := inferInstance have : c'.inl ≫ e.hom = 𝟙 X' ≫ (cofans X' Y').inl := by dsimp [e] simp exact (IsPullback.of_vert_isIso ⟨this⟩).paste_vert hl · rw [← Category.id_comp αY, ← Iso.hom_inv_id_assoc e f] - haveI : IsIso (𝟙 Y') := inferInstance + have : IsIso (𝟙 Y') := inferInstance have : c'.inr ≫ e.hom = 𝟙 Y' ≫ (cofans X' Y').inr := by dsimp [e] simp diff --git a/Mathlib/CategoryTheory/Localization/Adjunction.lean b/Mathlib/CategoryTheory/Localization/Adjunction.lean index d9ca2264034a1f..9c6875b1f54b96 100644 --- a/Mathlib/CategoryTheory/Localization/Adjunction.lean +++ b/Mathlib/CategoryTheory/Localization/Adjunction.lean @@ -56,7 +56,7 @@ lemma ε_app (X₁ : C₁) : (ε adj L₁ W₁ L₂ G' F').app (L₁.obj X₁) = L₁.map (adj.unit.app X₁) ≫ (CatCommSq.iso F L₂ L₁ F').hom.app (G.obj X₁) ≫ F'.map ((CatCommSq.iso G L₁ L₂ G').hom.app X₁) := by - letI : Lifting L₁ W₁ ((G ⋙ F) ⋙ L₁) (G' ⋙ F') := + let : Lifting L₁ W₁ ((G ⋙ F) ⋙ L₁) (G' ⋙ F') := Lifting.mk (CatCommSq.hComp G F L₁ L₂ L₁ G' F').iso.symm simp only [ε, liftNatTrans_app, Lifting.iso, Iso.symm, Functor.id_obj, Functor.comp_obj, Functor.rightUnitor_hom_app, @@ -74,7 +74,7 @@ lemma η_app (X₂ : C₂) : G'.map ((CatCommSq.iso F L₂ L₁ F').inv.app X₂) ≫ (CatCommSq.iso G L₁ L₂ G').inv.app (F.obj X₂) ≫ L₂.map (adj.counit.app X₂) := by - letI : Lifting L₂ W₂ ((F ⋙ G) ⋙ L₂) (F' ⋙ G') := + let : Lifting L₂ W₂ ((F ⋙ G) ⋙ L₂) (F' ⋙ G') := Lifting.mk (CatCommSq.hComp F G L₂ L₁ L₂ F' G').iso.symm simp only [η, liftNatTrans_app, Lifting.iso, Iso.symm, CatCommSq.hComp_iso_inv_app, whiskerRight_app, Functor.rightUnitor_inv_app, comp_id, assoc] diff --git a/Mathlib/CategoryTheory/Localization/CalculusOfFractions.lean b/Mathlib/CategoryTheory/Localization/CalculusOfFractions.lean index 74cf1be098c1f4..964a49b51ab50c 100644 --- a/Mathlib/CategoryTheory/Localization/CalculusOfFractions.lean +++ b/Mathlib/CategoryTheory/Localization/CalculusOfFractions.lean @@ -80,7 +80,7 @@ noncomputable def map (φ : W.LeftFraction X Y) (L : C ⥤ D) (hL : W.IsInverted @[reassoc (attr := simp)] lemma map_comp_map_s (φ : W.LeftFraction X Y) (L : C ⥤ D) (hL : W.IsInvertedBy L) : φ.map L hL ≫ L.map φ.s = L.map φ.f := by - letI := hL _ φ.hs + let := hL _ φ.hs simp [map] variable (W) @@ -94,14 +94,14 @@ set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma map_ofInv_hom_id (s : Y ⟶ X) (hs : W s) (L : C ⥤ D) (hL : W.IsInvertedBy L) : (ofInv s hs).map L hL ≫ L.map s = 𝟙 _ := by - letI := hL _ hs + let := hL _ hs simp [map] set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma map_hom_ofInv_id (s : Y ⟶ X) (hs : W s) (L : C ⥤ D) (hL : W.IsInvertedBy L) : L.map s ≫ (ofInv s hs).map L hL = 𝟙 _ := by - letI := hL _ hs + let := hL _ hs simp [map] variable {W} @@ -155,7 +155,7 @@ noncomputable def map (φ : W.RightFraction X Y) (L : C ⥤ D) (hL : W.IsInverte @[reassoc (attr := simp)] lemma map_s_comp_map (φ : W.RightFraction X Y) (L : C ⥤ D) (hL : W.IsInvertedBy L) : L.map φ.s ≫ φ.map L hL = L.map φ.f := by - letI := hL _ φ.hs + let := hL _ φ.hs simp [map] variable (W) @@ -170,14 +170,14 @@ set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma map_ofInv_hom_id (s : Y ⟶ X) (hs : W s) (L : C ⥤ D) (hL : W.IsInvertedBy L) : (ofInv s hs).map L hL ≫ L.map s = 𝟙 _ := by - letI := hL _ hs + let := hL _ hs simp [map] set_option backward.defeqAttrib.useBackward true in @[reassoc (attr := simp)] lemma map_hom_ofInv_id (s : Y ⟶ X) (hs : W s) (L : C ⥤ D) (hL : W.IsInvertedBy L) : L.map s ≫ (ofInv s hs).map L hL = 𝟙 _ := by - letI := hL _ hs + let := hL _ hs simp [map] variable {W} diff --git a/Mathlib/CategoryTheory/Localization/Construction.lean b/Mathlib/CategoryTheory/Localization/Construction.lean index 25bf8f4eb82a31..639507424e0f57 100644 --- a/Mathlib/CategoryTheory/Localization/Construction.lean +++ b/Mathlib/CategoryTheory/Localization/Construction.lean @@ -219,7 +219,7 @@ theorem morphismProperty_eq_top (P : MorphismProperty W.Localization) apply MorphismProperty.top_apply · intro let G : _ ⥤ W.Localization := Quotient.functor _ - haveI : G.Full := Quotient.full_functor _ + have : G.Full := Quotient.full_functor _ suffices ∀ (X₁ X₂ : Paths (LocQuiver W)) (f : X₁ ⟶ X₂), P (G.map f) by rcases X with ⟨⟨X⟩⟩ rcases Y with ⟨⟨Y⟩⟩ diff --git a/Mathlib/CategoryTheory/Localization/DerivabilityStructure/OfLocalizedEquivalences.lean b/Mathlib/CategoryTheory/Localization/DerivabilityStructure/OfLocalizedEquivalences.lean index 77ffa0d7158fb2..0cc96c9149d8a3 100644 --- a/Mathlib/CategoryTheory/Localization/DerivabilityStructure/OfLocalizedEquivalences.lean +++ b/Mathlib/CategoryTheory/Localization/DerivabilityStructure/OfLocalizedEquivalences.lean @@ -71,8 +71,8 @@ lemma isLeftDerivabilityStructure_of_isLocalizedEquivalence hw := (W₂'.arrow_mk_iso_iff (Arrow.isoMk (iso.app _) e₂)).1 (R.map _ ρ.hw) }⟩ let F := B.localizedFunctor W₁'.Q W₂'.Q let e' := CatCommSq.iso B.functor W₁'.Q W₂'.Q F - letI iso' : CatCommSq T.functor L.functor R.functor B.functor := ⟨iso⟩ - letI : CatCommSq T.functor (L.functor ⋙ W₁'.Q) (R.functor ⋙ W₂'.Q) F := + let iso' : CatCommSq T.functor L.functor R.functor B.functor := ⟨iso⟩ + let : CatCommSq T.functor (L.functor ⋙ W₁'.Q) (R.functor ⋙ W₂'.Q) F := CatCommSq.vComp (H₂ := B.functor) _ _ _ _ _ _ have : (TwoSquare.hComp iso.inv e'.inv).GuitartExact := by convert! diff --git a/Mathlib/CategoryTheory/Localization/Equivalence.lean b/Mathlib/CategoryTheory/Localization/Equivalence.lean index dd2c17808661b4..826484251ba969 100644 --- a/Mathlib/CategoryTheory/Localization/Equivalence.lean +++ b/Mathlib/CategoryTheory/Localization/Equivalence.lean @@ -108,7 +108,7 @@ lemma of_equivalences (L₁ : C₁ ⥤ D₁) (W₁ : MorphismProperty C₁) [L (E : C₁ ≌ C₂) (E' : D₁ ≌ D₂) [CatCommSq E.functor L₁ L₂ E'.functor] (hW₁ : W₁ ≤ W₂.isoClosure.inverseImage E.functor) (hW₂ : W₂.IsInvertedBy L₂) : L₂.IsLocalization W₂ := by - haveI : (E.functor ⋙ L₂).IsLocalization W₁ := + have : (E.functor ⋙ L₂).IsLocalization W₁ := of_equivalence_target L₁ W₁ _ E' ((CatCommSq.iso _ _ _ _).symm) exact of_equivalence_source (E.functor ⋙ L₂) W₁ L₂ W₂ E hW₁ hW₂ (Iso.refl _) diff --git a/Mathlib/CategoryTheory/Localization/HomEquiv.lean b/Mathlib/CategoryTheory/Localization/HomEquiv.lean index b77ff45803589b..6a6c9df9dff9ae 100644 --- a/Mathlib/CategoryTheory/Localization/HomEquiv.lean +++ b/Mathlib/CategoryTheory/Localization/HomEquiv.lean @@ -77,7 +77,7 @@ lemma homMap_apply (G : D₁ ⥤ D₂) (e : Φ.functor ⋙ L₂ ≅ L₁ ⋙ G) let G' := Φ.localizedFunctor L₁ L₂ let e' := CatCommSq.iso Φ.functor L₁ L₂ G' change e'.hom.app X ≫ G'.map f ≫ e'.inv.app Y = _ - letI : Localization.Lifting L₁ W₁ (Φ.functor ⋙ L₂) G := ⟨e.symm⟩ + let : Localization.Lifting L₁ W₁ (Φ.functor ⋙ L₂) G := ⟨e.symm⟩ let α : G' ≅ G := Localization.liftNatIso L₁ W₁ (L₁ ⋙ G') (Φ.functor ⋙ L₂) _ _ e'.symm have : e = e' ≪≫ Functor.isoWhiskerLeft _ α := by ext diff --git a/Mathlib/CategoryTheory/Localization/Linear.lean b/Mathlib/CategoryTheory/Localization/Linear.lean index 4accef731aee7e..f190e5f4ede621 100644 --- a/Mathlib/CategoryTheory/Localization/Linear.lean +++ b/Mathlib/CategoryTheory/Localization/Linear.lean @@ -41,7 +41,7 @@ noncomputable def linear : Linear R D := Linear.ofRingMorphism lemma functor_linear : letI := linear R L W Functor.Linear R L := by - letI := linear R L W + let := linear R L W constructor intro X Y f r change L.map (r • f) = ((Linear.toCatCenter R C r).localization L W).app (L.obj X) ≫ L.map f diff --git a/Mathlib/CategoryTheory/Localization/LocalizerMorphism.lean b/Mathlib/CategoryTheory/Localization/LocalizerMorphism.lean index 2be304d60b9ec4..c169d37975d6ba 100644 --- a/Mathlib/CategoryTheory/Localization/LocalizerMorphism.lean +++ b/Mathlib/CategoryTheory/Localization/LocalizerMorphism.lean @@ -183,7 +183,7 @@ lemma isEquivalence [h : Φ.IsLocalizedEquivalence] [CatCommSq Φ.functor L₁ L instance [Φ.IsLocalizedEquivalence] : Φ.op.IsLocalizedEquivalence := by let G := Φ.localizedFunctor W₁.Q W₂.Q - letI : CatCommSq Φ.op.functor W₁.Q.op W₂.Q.op G.op := + let : CatCommSq Φ.op.functor W₁.Q.op W₂.Q.op G.op := ⟨NatIso.op (CatCommSq.iso Φ.functor W₁.Q W₂.Q G).symm⟩ have := Φ.isEquivalence W₁.Q W₂.Q G exact IsLocalizedEquivalence.mk' Φ.op W₁.Q.op W₂.Q.op G.op @@ -208,7 +208,7 @@ an equivalence of categories and that `W₁` and `W₂` essentially correspond t other via this equivalence, then `Φ` is a localized equivalence. -/ lemma IsLocalizedEquivalence.of_equivalence [Φ.functor.IsEquivalence] (h : W₂ ≤ W₁.map Φ.functor) : IsLocalizedEquivalence Φ := by - haveI : Functor.IsLocalization (Φ.functor ⋙ MorphismProperty.Q W₂) W₁ := by + have : Functor.IsLocalization (Φ.functor ⋙ MorphismProperty.Q W₂) W₁ := by refine Functor.IsLocalization.of_equivalence_source W₂.Q W₂ (Φ.functor ⋙ W₂.Q) W₁ (asEquivalence Φ.functor).symm ?_ (Φ.inverts W₂.Q) ((associator _ _ _).symm ≪≫ isoWhiskerRight ((Equivalence.unitIso _).symm) _ ≪≫ @@ -305,7 +305,7 @@ instance [Φ.IsLocalizedFullyFaithful] : (Φ.localizedFunctor L₁ L₂).Faithfu instance [Φ.IsLocalizedFullyFaithful] : Φ.op.IsLocalizedFullyFaithful := by let G := Φ.localizedFunctor W₁.Q W₂.Q - letI : CatCommSq Φ.op.functor W₁.Q.op W₂.Q.op G.op := + let : CatCommSq Φ.op.functor W₁.Q.op W₂.Q.op G.op := ⟨NatIso.op (CatCommSq.iso Φ.functor W₁.Q W₂.Q G).symm⟩ exact IsLocalizedFullyFaithful.mk' Φ.op W₁.Q.op W₂.Q.op G.op (Φ.fullyFaithful W₁.Q W₂.Q G).op @@ -328,7 +328,7 @@ lemma isLocalization_of_isLocalizedFullyFaithful (Arrow.isoOfNatIso iso f)).1 (Localization.inverts L₂ W₂ _ (Φ.map _ hf)) let G := Localization.lift L₁ h W₁.Q let e : W₁.Q ⋙ G ≅ L₁ := Localization.fac L₁ h W₁.Q - letI : CatCommSq Φ.functor W₁.Q L₂ (G ⋙ F) := + let : CatCommSq Φ.functor W₁.Q L₂ (G ⋙ F) := ⟨iso ≪≫ isoWhiskerRight e.symm _ ≪≫ associator _ _ _⟩ have hG : G.FullyFaithful := Functor.FullyFaithful.ofCompFaithful (Φ.fullyFaithful W₁.Q L₂ (G ⋙ F)) diff --git a/Mathlib/CategoryTheory/Localization/Monoidal/Functor.lean b/Mathlib/CategoryTheory/Localization/Monoidal/Functor.lean index 5fa9970fc17379..5c493fa695cb7c 100644 --- a/Mathlib/CategoryTheory/Localization/Monoidal/Functor.lean +++ b/Mathlib/CategoryTheory/Localization/Monoidal/Functor.lean @@ -156,7 +156,7 @@ transformation. instance lifting_isMonoidal : letI : F.Monoidal := functorMonoidalOfComp L W F G (Lifting.iso L W G F).hom.IsMonoidal := by - letI : F.Monoidal := functorMonoidalOfComp L W F G + let : F.Monoidal := functorMonoidalOfComp L W F G refine ⟨?_, fun _ _ ↦ ?_⟩ · simp [functorMonoidalOfComp_ε] · simp [functorMonoidalOfComp_μ] diff --git a/Mathlib/CategoryTheory/Localization/Pi.lean b/Mathlib/CategoryTheory/Localization/Pi.lean index 2c5c8a508c3ec2..5d4d0ffcce0cb3 100644 --- a/Mathlib/CategoryTheory/Localization/Pi.lean +++ b/Mathlib/CategoryTheory/Localization/Pi.lean @@ -39,7 +39,7 @@ instance pi {J : Type w} [Finite J] {C : J → Type u₁} {D : J → Type u₂} let L₁ := fun j => (L₂ (e j)) let E := Pi.equivalenceOfEquiv C₂ e let E' := Pi.equivalenceOfEquiv D₂ e - haveI : CatCommSq E.functor (Functor.pi L₁) (Functor.pi L₂) E'.functor := + have : CatCommSq E.functor (Functor.pi L₁) (Functor.pi L₂) E'.functor := (CatCommSq.hInvEquiv E (Functor.pi L₁) (Functor.pi L₂) E').symm ⟨Iso.refl _⟩ refine IsLocalization.of_equivalences (Functor.pi L₁) (MorphismProperty.pi (fun j => (W₂ (e j)))) (Functor.pi L₂) @@ -53,13 +53,13 @@ instance pi {J : Type w} [Finite J] {C : J → Type u₁} {D : J → Type u₂} exact hg exact H (e.apply_symm_apply i) _ (hf (e.symm i)) · intro C D _ _ L W _ _ - haveI : ∀ j, IsEquivalence (L j) := by rintro ⟨⟩ + have : ∀ j, IsEquivalence (L j) := by rintro ⟨⟩ refine IsLocalization.of_isEquivalence _ _ (fun _ _ _ _ => ?_) rw [MorphismProperty.isomorphisms.iff, isIso_pi_iff] rintro ⟨⟩ · intro J _ hJ C D _ _ L W _ _ let L₁ := (L none).prod (Functor.pi (fun j => L (some j))) - haveI : CatCommSq (Pi.optionEquivalence C).symm.functor L₁ (Functor.pi L) + have : CatCommSq (Pi.optionEquivalence C).symm.functor L₁ (Functor.pi L) (Pi.optionEquivalence D).symm.functor := ⟨NatIso.pi' (by rintro (_ | i) <;> apply Iso.refl)⟩ refine IsLocalization.of_equivalences L₁ diff --git a/Mathlib/CategoryTheory/Localization/Predicate.lean b/Mathlib/CategoryTheory/Localization/Predicate.lean index c882cb52d75bcb..312e74a3cf0c8f 100644 --- a/Mathlib/CategoryTheory/Localization/Predicate.lean +++ b/Mathlib/CategoryTheory/Localization/Predicate.lean @@ -285,7 +285,7 @@ variable {E} theorem natTrans_ext (L : C ⥤ D) (W) [L.IsLocalization W] {F₁ F₂ : D ⥤ E} {τ τ' : F₁ ⟶ F₂} (h : ∀ X : C, τ.app (L.obj X) = τ'.app (L.obj X)) : τ = τ' := by - haveI := essSurj L W + have := essSurj L W ext Y rw [← cancel_epi (F₁.map (L.objObjPreimageIso Y).hom), τ.naturality, τ'.naturality, h] @@ -422,7 +422,7 @@ instance (F : D ⥤ E) [F.IsEquivalence] [L.IsLocalization W] : lemma of_isEquivalence (L : C ⥤ D) (W : MorphismProperty C) (hW : W ≤ MorphismProperty.isomorphisms C) [IsEquivalence L] : L.IsLocalization W := by - haveI : (𝟭 C).IsLocalization W := for_id W hW + have : (𝟭 C).IsLocalization W := for_id W hW exact of_equivalence_target (𝟭 C) W L L.asEquivalence L.leftUnitor end IsLocalization diff --git a/Mathlib/CategoryTheory/Localization/Prod.lean b/Mathlib/CategoryTheory/Localization/Prod.lean index 8668c963f58658..f4835488c1efec 100644 --- a/Mathlib/CategoryTheory/Localization/Prod.lean +++ b/Mathlib/CategoryTheory/Localization/Prod.lean @@ -62,7 +62,7 @@ noncomputable def prodLift₁ [W₂.ContainsIdentities] (hF : (W₁.prod W₂).IsInvertedBy F) : W₁.Localization ⥤ C₂ ⥤ E := Construction.lift (curry.obj F) (fun _ _ f₁ hf₁ => by - haveI : ∀ (X₂ : C₂), IsIso (((curry.obj F).map f₁).app X₂) := + have : ∀ (X₂ : C₂), IsIso (((curry.obj F).map f₁).app X₂) := fun X₂ => hF _ ⟨hf₁, MorphismProperty.id_mem _ _⟩ apply NatIso.isIso_of_isIso_app) @@ -80,7 +80,7 @@ noncomputable def prodLift : W₁.Localization × W₂.Localization ⥤ E := by refine uncurry.obj (Construction.lift (prodLift₁ F hF).flip ?_).flip intro _ _ f₂ hf₂ - haveI : ∀ (X₁ : W₁.Localization), + have : ∀ (X₁ : W₁.Localization), IsIso (((Functor.flip (prodLift₁ F hF)).map f₂).app X₁) := fun X₁ => by obtain ⟨X₁, rfl⟩ := (Construction.objEquiv W₁).surjective X₁ exact ((MorphismProperty.isomorphisms E).arrow_mk_iso_iff @@ -138,7 +138,7 @@ and if both `W₁` and `W₂` contain identities, then the product functor `L₁.prod L₂ : C₁ × C₂ ⥤ D₁ × D₂` is a localization functor for `W₁.prod W₂`. -/ instance prod [L₁.IsLocalization W₁] [L₂.IsLocalization W₂] : (L₁.prod L₂).IsLocalization (W₁.prod W₂) := by - haveI := Construction.prodIsLocalization W₁ W₂ + have := Construction.prodIsLocalization W₁ W₂ exact of_equivalence_target (W₁.Q.prod W₂.Q) (W₁.prod W₂) (L₁.prod L₂) ((uniq W₁.Q L₁ W₁).prod (uniq W₂.Q L₂ W₂)) (NatIso.prod (compUniqFunctor W₁.Q L₁ W₁) (compUniqFunctor W₂.Q L₂ W₂)) diff --git a/Mathlib/CategoryTheory/Localization/Resolution.lean b/Mathlib/CategoryTheory/Localization/Resolution.lean index b8f5c6f731127f..33c4e815e81fc6 100644 --- a/Mathlib/CategoryTheory/Localization/Resolution.lean +++ b/Mathlib/CategoryTheory/Localization/Resolution.lean @@ -389,7 +389,7 @@ lemma hasRightResolutions_arrow_of_essSurj_of_full [R.functor.EssSurj] [R.functor.Full] [W₂'.RespectsIso] (iso : T.functor ⋙ R.functor ≅ L.functor ⋙ B.functor) [T.arrow.HasRightResolutions] : B.arrow.HasRightResolutions := by - letI : CatCommSq T.functor L.functor R.functor B.functor := ⟨iso⟩ + let : CatCommSq T.functor L.functor R.functor B.functor := ⟨iso⟩ exact hasRightResolutions_of_iso_of_essSurj (CatCommSq.iso T.arrow.functor L.arrow.functor R.arrow.functor B.arrow.functor) @@ -397,7 +397,7 @@ lemma hasLeftResolutions_arrow_of_essSurj_of_full [R.functor.EssSurj] [R.functor.Full] [W₂'.RespectsIso] (iso : T.functor ⋙ R.functor ≅ L.functor ⋙ B.functor) [T.arrow.HasLeftResolutions] : B.arrow.HasLeftResolutions := by - letI : CatCommSq T.functor L.functor R.functor B.functor := ⟨iso⟩ + let : CatCommSq T.functor L.functor R.functor B.functor := ⟨iso⟩ exact hasLeftResolutions_of_iso_of_essSurj (CatCommSq.iso T.arrow.functor L.arrow.functor R.arrow.functor B.arrow.functor) @@ -405,7 +405,7 @@ lemma hasRightResolutions_arrow_iff_of_equivalences [R.functor.IsEquivalence] [R.IsInduced] [L.functor.IsEquivalence] [W₂'.RespectsIso] (iso : T.functor ⋙ R.functor ≅ L.functor ⋙ B.functor) : T.arrow.HasRightResolutions ↔ B.arrow.HasRightResolutions := by - letI : CatCommSq T.functor L.functor R.functor B.functor := ⟨iso⟩ + let : CatCommSq T.functor L.functor R.functor B.functor := ⟨iso⟩ exact hasRightResolutions_iff_iso_of_essSurj_of_full (CatCommSq.iso T.arrow.functor L.arrow.functor R.arrow.functor B.arrow.functor) @@ -413,7 +413,7 @@ lemma hasLeftResolutions_arrow_iff_of_equivalences [R.functor.IsEquivalence] [R.IsInduced] [L.functor.IsEquivalence] [W₂'.RespectsIso] (iso : T.functor ⋙ R.functor ≅ L.functor ⋙ B.functor) : T.arrow.HasLeftResolutions ↔ B.arrow.HasLeftResolutions := by - letI : CatCommSq T.functor L.functor R.functor B.functor := ⟨iso⟩ + let : CatCommSq T.functor L.functor R.functor B.functor := ⟨iso⟩ exact hasLeftResolutions_iff_iso_of_essSurj_of_full (CatCommSq.iso T.arrow.functor L.arrow.functor R.arrow.functor B.arrow.functor) diff --git a/Mathlib/CategoryTheory/Localization/SmallHom.lean b/Mathlib/CategoryTheory/Localization/SmallHom.lean index 4f51495bb7d588..dac9d35fa0eb80 100644 --- a/Mathlib/CategoryTheory/Localization/SmallHom.lean +++ b/Mathlib/CategoryTheory/Localization/SmallHom.lean @@ -163,8 +163,8 @@ lemma equiv_comp (L : C ⥤ D) [L.IsLocalization W] {X Y Z : C} [HasSmallLocaliz [HasSmallLocalizedHom.{w} W Y Z] [HasSmallLocalizedHom.{w} W X Z] (α : SmallHom.{w} W X Y) (β : SmallHom.{w} W Y Z) : equiv W L (α.comp β) = equiv W L α ≫ equiv W L β := by - letI := small_of_hasSmallLocalizedHom.{w} W W.Q X Y - letI := small_of_hasSmallLocalizedHom.{w} W W.Q Y Z + let := small_of_hasSmallLocalizedHom.{w} W W.Q X Y + let := small_of_hasSmallLocalizedHom.{w} W W.Q Y Z obtain ⟨α, rfl⟩ := (equivShrink _).surjective α obtain ⟨β, rfl⟩ := (equivShrink _).surjective β dsimp [equiv, comp] diff --git a/Mathlib/CategoryTheory/Monad/Comonadicity.lean b/Mathlib/CategoryTheory/Monad/Comonadicity.lean index 70e929cac334bb..d609e4248e6660 100644 --- a/Mathlib/CategoryTheory/Monad/Comonadicity.lean +++ b/Mathlib/CategoryTheory/Monad/Comonadicity.lean @@ -302,7 +302,7 @@ def comonadicOfHasPreservesReflectsFSplitEqualizers [HasEqualizerOfIsCosplitPair change IsIso (IsLimit.conePointUniqueUpToIso _ ?_).inv · infer_instance apply @unitEqualizerOfCoreflectsEqualizer _ _ _ _ _ _ _ _ ?_ - letI _ : + let _ : F.IsCosplitPair (G.map (F.map (adj.unit.app Y))) (adj.unit.app (G.obj (F.obj Y))) := ComonadicityInternal.main_pair_F_cosplit _ ((comparison adj).obj Y) diff --git a/Mathlib/CategoryTheory/Monad/Limits.lean b/Mathlib/CategoryTheory/Monad/Limits.lean index e74d2fc24dc126..06482610e5a70a 100644 --- a/Mathlib/CategoryTheory/Monad/Limits.lean +++ b/Mathlib/CategoryTheory/Monad/Limits.lean @@ -352,7 +352,7 @@ theorem hasColimitsOfShape_of_reflective (R : D ⥤ C) [Reflective R] [HasColimi HasColimitsOfShape J D where has_colimit := fun F => by let c := (monadicLeftAdjoint R).mapCocone (colimit.cocone (F ⋙ R)) - letI : PreservesColimitsOfShape J _ := + let : PreservesColimitsOfShape J _ := (monadicAdjunction R).leftAdjoint_preservesColimits.1 let t : IsColimit c := isColimitOfPreserves (monadicLeftAdjoint R) (colimit.isColimit _) apply HasColimit.mk ⟨_, (IsColimit.precomposeInvEquiv _ _).symm t⟩ @@ -371,11 +371,11 @@ lemma leftAdjoint_preservesTerminal_of_reflective (R : D ⥤ C) [Reflective R] : PreservesLimitsOfShape (Discrete.{v} PEmpty) (monadicLeftAdjoint R) where preservesLimit {K} := by let F := Functor.empty.{v} D - letI : PreservesLimit (F ⋙ R) (monadicLeftAdjoint R) := by + let : PreservesLimit (F ⋙ R) (monadicLeftAdjoint R) := by constructor intro c h - haveI : HasLimit (F ⋙ R) := ⟨⟨⟨c, h⟩⟩⟩ - haveI : HasLimit F := hasLimit_of_reflective F R + have : HasLimit (F ⋙ R) := ⟨⟨⟨c, h⟩⟩⟩ + have : HasLimit F := hasLimit_of_reflective F R constructor apply isLimitChangeEmptyCone D (limit.isLimit F) apply (asIso ((monadicAdjunction R).counit.app _)).symm.trans @@ -681,7 +681,7 @@ theorem hasLimitsOfShape_of_coreflective (R : D ⥤ C) [Coreflective R] [HasLimi HasLimitsOfShape J D where has_limit := fun F => by let c := (comonadicRightAdjoint R).mapCone (limit.cone (F ⋙ R)) - letI : PreservesLimitsOfShape J _ := + let : PreservesLimitsOfShape J _ := (comonadicAdjunction R).rightAdjoint_preservesLimits.1 let t : IsLimit c := isLimitOfPreserves (comonadicRightAdjoint R) (limit.isLimit _) apply HasLimit.mk ⟨_, (IsLimit.postcomposeHomEquiv _ _).symm t⟩ @@ -700,11 +700,11 @@ lemma rightAdjoint_preservesInitial_of_coreflective (R : D ⥤ C) [Coreflective PreservesColimitsOfShape (Discrete.{v} PEmpty) (comonadicRightAdjoint R) where preservesColimit {K} := by let F := Functor.empty.{v} D - letI : PreservesColimit (F ⋙ R) (comonadicRightAdjoint R) := by + let : PreservesColimit (F ⋙ R) (comonadicRightAdjoint R) := by constructor intro c h - haveI : HasColimit (F ⋙ R) := ⟨⟨⟨c, h⟩⟩⟩ - haveI : HasColimit F := hasColimit_of_coreflective F R + have : HasColimit (F ⋙ R) := ⟨⟨⟨c, h⟩⟩⟩ + have : HasColimit F := hasColimit_of_coreflective F R constructor apply isColimitChangeEmptyCocone D (colimit.isColimit F) apply (asIso ((comonadicAdjunction R).unit.app _)).trans diff --git a/Mathlib/CategoryTheory/Monad/Monadicity.lean b/Mathlib/CategoryTheory/Monad/Monadicity.lean index 1fc4d6a64f9c32..1c7aa77231f9a3 100644 --- a/Mathlib/CategoryTheory/Monad/Monadicity.lean +++ b/Mathlib/CategoryTheory/Monad/Monadicity.lean @@ -319,7 +319,7 @@ def monadicOfHasPreservesReflectsGSplitCoequalizers [HasCoequalizerOfIsSplitPair · infer_instance -- Porting note: passing instances through apply @counitCoequalizerOfReflectsCoequalizer _ _ _ _ _ _ _ _ ?_ - letI _ : + let _ : G.IsSplitPair (F.map (G.map (adj.counit.app Y))) (adj.counit.app (F.obj (G.obj Y))) := MonadicityInternal.main_pair_G_split _ ((comparison adj).obj Y) diff --git a/Mathlib/CategoryTheory/Monoidal/Action/Opposites.lean b/Mathlib/CategoryTheory/Monoidal/Action/Opposites.lean index ffd1a2eb940b39..b71d35582b3161 100644 --- a/Mathlib/CategoryTheory/Monoidal/Action/Opposites.lean +++ b/Mathlib/CategoryTheory/Monoidal/Action/Opposites.lean @@ -135,7 +135,7 @@ def oppositeLeftAction [MonoidalLeftAction C D] : actionAssocIso_hom_naturality | op f, op g, op h => by apply Quiver.Hom.unop_inj - haveI := (αₗ (unop _) (unop _) (unop _)).inv ≫= + have := (αₗ (unop _) (unop _) (unop _)).inv ≫= MonoidalLeftAction.actionAssocIso_hom_naturality f g h simp only [Iso.inv_hom_id_assoc] at this simp [← this] @@ -175,7 +175,7 @@ def leftActionOfOppositeLeftAction [MonoidalLeftAction Cᵒᵖ Dᵒᵖ] : MonoidalLeftAction.actionHom_def f.op g.op actionAssocIso_hom_naturality f g h := by apply Quiver.Hom.op_inj - haveI := (αₗ (op _) (op _) (op _)).inv ≫= + have := (αₗ (op _) (op _) (op _)).inv ≫= MonoidalLeftAction.actionAssocIso_hom_naturality f.op g.op h.op simp only [Iso.inv_hom_id_assoc] at this simp [← this] @@ -347,7 +347,7 @@ def oppositeRightAction [MonoidalRightAction C D] : actionAssocIso_hom_naturality | op f, op g, op h => by apply Quiver.Hom.unop_inj - haveI := (αᵣ (unop _) (unop _) (unop _)).inv ≫= + have := (αᵣ (unop _) (unop _) (unop _)).inv ≫= MonoidalRightAction.actionAssocIso_hom_naturality f g h simp only [Iso.inv_hom_id_assoc] at this simp [← this] @@ -387,7 +387,7 @@ def rightActionOfOppositeRightAction [MonoidalRightAction Cᵒᵖ Dᵒᵖ] : MonoidalRightAction.actionHom_def f.op g.op actionAssocIso_hom_naturality f g h := by apply Quiver.Hom.op_inj - haveI := (αᵣ (op _) (op _) (op _)).inv ≫= + have := (αᵣ (op _) (op _) (op _)).inv ≫= MonoidalRightAction.actionAssocIso_hom_naturality f.op g.op h.op simp only [Iso.inv_hom_id_assoc] at this simp [← this] diff --git a/Mathlib/CategoryTheory/Monoidal/Cartesian/Basic.lean b/Mathlib/CategoryTheory/Monoidal/Cartesian/Basic.lean index b02b3fafc21679..198b65045a1c60 100644 --- a/Mathlib/CategoryTheory/Monoidal/Cartesian/Basic.lean +++ b/Mathlib/CategoryTheory/Monoidal/Cartesian/Basic.lean @@ -688,12 +688,12 @@ theorem prodComparisonBifunctorNatTrans_comp : prodComparisonBifunctorNatTrans ( ext; simp [prodComparison_comp] instance (A : C) [∀ B, IsIso (prodComparison F A B)] : IsIso (prodComparisonNatTrans F A) := by - letI : ∀ X, IsIso ((prodComparisonNatTrans F A).app X) := by assumption + let : ∀ X, IsIso ((prodComparisonNatTrans F A).app X) := by assumption apply NatIso.isIso_of_isIso_app set_option backward.defeqAttrib.useBackward true in instance [∀ A B, IsIso (prodComparison F A B)] : IsIso (prodComparisonBifunctorNatTrans F) := by - letI : ∀ X, IsIso ((prodComparisonBifunctorNatTrans F).app X) := + let : ∀ X, IsIso ((prodComparisonBifunctorNatTrans F).app X) := fun _ ↦ by dsimp; apply NatIso.isIso_of_isIso_app apply NatIso.isIso_of_isIso_app diff --git a/Mathlib/CategoryTheory/Monoidal/Cartesian/CommMon_.lean b/Mathlib/CategoryTheory/Monoidal/Cartesian/CommMon_.lean index df898edd0bd41f..b8c8c1b9e0505d 100644 --- a/Mathlib/CategoryTheory/Monoidal/Cartesian/CommMon_.lean +++ b/Mathlib/CategoryTheory/Monoidal/Cartesian/CommMon_.lean @@ -26,7 +26,7 @@ variable (X) in lemma IsCommMonObj.ofRepresentableBy (F : Cᵒᵖ ⥤ CommMonCat) (α : (F ⋙ forget _).RepresentableBy X) : letI : MonObj X := .ofRepresentableBy X (F ⋙ forget₂ CommMonCat MonCat) α IsCommMonObj X := by - letI : MonObj X := .ofRepresentableBy X (F ⋙ forget₂ CommMonCat MonCat) α + let : MonObj X := .ofRepresentableBy X (F ⋙ forget₂ CommMonCat MonCat) α have : μ = α.homEquiv'.symm (α.homEquiv' (fst X X) * α.homEquiv' (snd X X)) := rfl constructor simp_rw [this, ← α.homEquiv'.apply_eq_iff_eq, α.homEquiv'_comp, diff --git a/Mathlib/CategoryTheory/Monoidal/Cartesian/FunctorCategory.lean b/Mathlib/CategoryTheory/Monoidal/Cartesian/FunctorCategory.lean index 81119fa7777267..29c9809982535a 100644 --- a/Mathlib/CategoryTheory/Monoidal/Cartesian/FunctorCategory.lean +++ b/Mathlib/CategoryTheory/Monoidal/Cartesian/FunctorCategory.lean @@ -148,7 +148,7 @@ instance {K : Type*} [Category* K] [HasColimitsOfShape K C] PreservesColimitsOfShape K (tensorLeft F) := by apply preservesColimitsOfShape_of_evaluation intro k - haveI : tensorLeft F ⋙ (evaluation J C).obj k ≅ (evaluation J C).obj k ⋙ tensorLeft (F.obj k) := + have : tensorLeft F ⋙ (evaluation J C).obj k ≅ (evaluation J C).obj k ⋙ tensorLeft (F.obj k) := NatIso.ofComponents (fun _ ↦ Iso.refl _) exact preservesColimitsOfShape_of_natIso this.symm diff --git a/Mathlib/CategoryTheory/Monoidal/Cartesian/Grp.lean b/Mathlib/CategoryTheory/Monoidal/Cartesian/Grp.lean index 0ebc7b3a240160..575be853529bf0 100644 --- a/Mathlib/CategoryTheory/Monoidal/Cartesian/Grp.lean +++ b/Mathlib/CategoryTheory/Monoidal/Cartesian/Grp.lean @@ -148,7 +148,7 @@ lemma essImage_yonedaGrp : · rintro ⟨G, ⟨α⟩⟩ exact ⟨G.X, ⟨Functor.representableByEquiv.symm (Functor.isoWhiskerRight α (forget _))⟩⟩ · rintro ⟨X, ⟨e⟩⟩ - letI := GrpObj.ofRepresentableBy X F e + let := GrpObj.ofRepresentableBy X F e exact ⟨⟨X⟩, ⟨yonedaGrpObjIsoOfRepresentableBy X F e⟩⟩ @[to_additive (attr := reassoc)] diff --git a/Mathlib/CategoryTheory/Monoidal/Cartesian/Mon.lean b/Mathlib/CategoryTheory/Monoidal/Cartesian/Mon.lean index aebc3e41b449ac..ebabebe691e8fe 100644 --- a/Mathlib/CategoryTheory/Monoidal/Cartesian/Mon.lean +++ b/Mathlib/CategoryTheory/Monoidal/Cartesian/Mon.lean @@ -417,7 +417,7 @@ lemma essImage_yonedaMon : · rintro ⟨M, ⟨α⟩⟩ exact ⟨M.X, ⟨Functor.representableByEquiv.symm (Functor.isoWhiskerRight α (forget _))⟩⟩ · rintro ⟨X, ⟨e⟩⟩ - letI := MonObj.ofRepresentableBy X F e + let := MonObj.ofRepresentableBy X F e exact ⟨Mon.mk X, ⟨yonedaMonObjIsoOfRepresentableBy X F e⟩⟩ @[to_additive (attr := reassoc (attr := simp))] diff --git a/Mathlib/CategoryTheory/Monoidal/Closed/Cartesian.lean b/Mathlib/CategoryTheory/Monoidal/Closed/Cartesian.lean index 02f96505e73e9e..bcc03e4a3b0405 100644 --- a/Mathlib/CategoryTheory/Monoidal/Closed/Cartesian.lean +++ b/Mathlib/CategoryTheory/Monoidal/Closed/Cartesian.lean @@ -115,10 +115,10 @@ This actually shows a slightly stronger version: any morphism to an initial obje exponentiable object is an isomorphism. -/ theorem strict_initial {I : C} (t : IsInitial I) (f : A ⟶ I) : IsIso f := by - haveI : Mono f := by + have : Mono f := by rw [← lift_snd (𝟙 A) f, ← zeroMul_hom t] exact mono_comp _ _ - haveI : IsSplitEpi f := IsSplitEpi.mk' ⟨t.to _, t.hom_ext _ _⟩ + have : IsSplitEpi f := IsSplitEpi.mk' ⟨t.to _, t.hom_ext _ _⟩ apply isIso_of_mono_of_isSplitEpi instance to_initial_isIso [HasInitial C] (f : A ⟶ ⊥_ C) : IsIso f := @@ -127,8 +127,8 @@ instance to_initial_isIso [HasInitial C] (f : A ⟶ ⊥_ C) : IsIso f := /-- If an initial object `0` exists in a CCC then every morphism from it is monic. -/ theorem initial_mono {I : C} (B : C) (t : IsInitial I) [MonoidalClosed C] : Mono (t.to B) := ⟨fun g h _ => by - haveI := strict_initial t g - haveI := strict_initial t h + have := strict_initial t g + have := strict_initial t h exact eq_of_inv_eq_inv (t.hom_ext _ _)⟩ instance Initial.mono_to [HasInitial C] (B : C) [MonoidalClosed C] : Mono (initial.to B) := diff --git a/Mathlib/CategoryTheory/Monoidal/Closed/Ideal.lean b/Mathlib/CategoryTheory/Monoidal/Closed/Ideal.lean index 7f13bdcd60cb0a..70d9ed282599c7 100644 --- a/Mathlib/CategoryTheory/Monoidal/Closed/Ideal.lean +++ b/Mathlib/CategoryTheory/Monoidal/Closed/Ideal.lean @@ -147,7 +147,7 @@ abbrev CartesianMonoidalCategory.ofReflective [CartesianMonoidalCategory C] [Ref · change (reflector i ⋙ i).obj (i.obj X ⊗ i.obj Y) ≅ (𝟭 C).obj (i.obj X ⊗ i.obj Y) letI : IsIso ((reflectorAdjunction i).unit.app (i.obj X ⊗ i.obj Y)) := by apply Functor.essImage.unit_isIso - haveI := reflective_products i + have := reflective_products i use Limits.prod X Y constructor apply Limits.PreservesLimitPair.iso i _ _ |>.trans @@ -187,7 +187,7 @@ instance (priority := 10) exponentialIdeal_of_preservesBinaryProducts prodComparison_natural_whiskerLeft_assoc, ← whiskerLeft_comp_assoc, ir.left_triangle_components, whiskerLeft_id, Category.id_comp] apply IsIso.hom_inv_id_assoc - haveI : IsSplitMono (η.app (A ⟹ i.obj B)) := IsSplitMono.mk' ⟨_, this⟩ + have : IsSplitMono (η.app (A ⟹ i.obj B)) := IsSplitMono.mk' ⟨_, this⟩ apply mem_essImage_of_unit_isSplitMono variable [ExponentialIdeal i] diff --git a/Mathlib/CategoryTheory/Monoidal/DayConvolution.lean b/Mathlib/CategoryTheory/Monoidal/DayConvolution.lean index a1f3dfdb59c13e..c5771c09092832 100644 --- a/Mathlib/CategoryTheory/Monoidal/DayConvolution.lean +++ b/Mathlib/CategoryTheory/Monoidal/DayConvolution.lean @@ -1004,23 +1004,23 @@ def monoidalOfLawfulDayConvolutionMonoidalCategoryStruct simp only [Functor.map_comp, Functor.map_id, ι_map_tensorHom_hom_eq_tensorHom, ι_map_associator_hom_eq_associator_hom] -- this is a bit painful... - letI : DayConvolution + let : DayConvolution (((ι C V D |>.obj a) ⊛ (ι C V D |>.obj b)) ⊛ (ι C V D |>.obj c)) (ι C V D |>.obj d) := convolution C V D _ _ - letI : DayConvolution + let : DayConvolution ((ι C V D |>.obj a) ⊛ (ι C V D |>.obj b)) ((ι C V D |>.obj c) ⊛ (ι C V D |>.obj d)) := convolution C V D _ _ - letI : DayConvolution + let : DayConvolution ((ι C V D |>.obj a) ⊛ ((ι C V D |>.obj b) ⊛ (ι C V D |>.obj c))) (ι C V D |>.obj d) := convolution C V D _ _ - letI : DayConvolution + let : DayConvolution (ι C V D |>.obj a) ((ι C V D |>.obj b) ⊛ ((ι C V D |>.obj c) ⊛ (ι C V D |>.obj d))) := convolution C V D _ _ - letI : DayConvolution + let : DayConvolution (ι C V D |>.obj a) (((ι C V D |>.obj b) ⊛ (ι C V D |>.obj c)) ⊛ (ι C V D |>.obj d)) := convolution C V D _ _ @@ -1232,9 +1232,9 @@ def mkLawfulDayConvolutionMonoidalCategoryStruct : associator_hom_unit_unit d₁ d₂ d₃ x₁ x₂ x₃ := by simp only [externalProductBifunctor_obj_obj, Functor.comp_obj, tensor_obj, associator, Functor.FullyFaithful.preimageIso_hom, Functor.FullyFaithful.map_preimage] - letI : DayConvolution (ι C V D |>.obj d₁) ((ι C V D |>.obj d₂) ⊛ (ι C V D |>.obj d₃)) := + let : DayConvolution (ι C V D |>.obj d₁) ((ι C V D |>.obj d₂) ⊛ (ι C V D |>.obj d₃)) := convolutions C V _ _ - letI : DayConvolution ((ι C V D |>.obj d₁) ⊛ (ι C V D |>.obj d₂)) (ι C V D |>.obj d₃) := + let : DayConvolution ((ι C V D |>.obj d₁) ⊛ (ι C V D |>.obj d₂)) (ι C V D |>.obj d₃) := convolutions C V _ _ apply DayConvolution.associator_hom_unit_unit leftUnitor_hom_unit_app _ _ := by diff --git a/Mathlib/CategoryTheory/Monoidal/DayConvolution/Braided.lean b/Mathlib/CategoryTheory/Monoidal/DayConvolution/Braided.lean index 801982829465fa..9d96cdbb66f7fb 100644 --- a/Mathlib/CategoryTheory/Monoidal/DayConvolution/Braided.lean +++ b/Mathlib/CategoryTheory/Monoidal/DayConvolution/Braided.lean @@ -157,7 +157,7 @@ lemma hexagon_forward (H : C ⥤ V) externalProductBifunctor_obj_obj, unit_app_map_app_assoc, NatTrans.id_app, id_tensorHom] rw [← BraidedCategory.hexagon_reverse, ← whiskerLeft_comp_assoc] - haveI := unit_app_braiding_hom_app F H x z =≫ (H ⊛ F).map (β_ z x).inv + have := unit_app_braiding_hom_app F H x z =≫ (H ⊛ F).map (β_ z x).inv dsimp at this simp only [Category.assoc, Iso.map_hom_inv_id, Category.comp_id] at this rw [← this, whiskerLeft_comp_assoc] @@ -197,7 +197,7 @@ lemma hexagon_reverse (H : C ⥤ V) unit_app_map_app_assoc, NatTrans.id_app, tensorHom_id] congr 2 rw [← BraidedCategory.hexagon_forward, ← comp_whiskerRight_assoc] - haveI := unit_app_braiding_hom_app F H x z =≫ (H ⊛ F).map (β_ z x).inv + have := unit_app_braiding_hom_app F H x z =≫ (H ⊛ F).map (β_ z x).inv dsimp at this simp only [Category.assoc, Iso.map_hom_inv_id, Category.comp_id] at this rw [← this, comp_whiskerRight_assoc] diff --git a/Mathlib/CategoryTheory/Monoidal/ExternalProduct/KanExtension.lean b/Mathlib/CategoryTheory/Monoidal/ExternalProduct/KanExtension.lean index a3e22d97ec9d8a..8e95ecf5431765 100644 --- a/Mathlib/CategoryTheory/Monoidal/ExternalProduct/KanExtension.lean +++ b/Mathlib/CategoryTheory/Monoidal/ExternalProduct/KanExtension.lean @@ -63,7 +63,7 @@ def isPointwiseLeftKanExtensionAtExtensionUnitLeft (prod.rightUnitorEquivalence (CostructuredArrow L d)).inverse ⋙ (𝟭 _).prod (Functor.fromPUnit.{0} <| .mk <| 𝟙 _) letI : I.Final := by - letI : Functor.fromPUnit.{0} (.mk (𝟙 e) : CostructuredArrow (𝟭 E) e) |>.Final := + let : Functor.fromPUnit.{0} (.mk (𝟙 e) : CostructuredArrow (𝟭 E) e) |>.Final := Functor.final_fromPUnit_of_isTerminal <| CostructuredArrow.mkIdTerminal (S := 𝟭 E) (Y := e) apply Iff.mp <| Functor.final_iff_final_comp (F := (prod.rightUnitorEquivalence <| CostructuredArrow L d).inverse) @@ -111,7 +111,7 @@ def isPointwiseLeftKanExtensionAtExtensionUnitRight (prod.leftUnitorEquivalence <| CostructuredArrow L d).inverse ⋙ (Functor.fromPUnit.{0} <| .mk <| 𝟙 _).prod (𝟭 _) letI : I.Final := by - letI : Functor.fromPUnit.{0} (.mk (𝟙 e) : CostructuredArrow (𝟭 E) e) |>.Final := + let : Functor.fromPUnit.{0} (.mk (𝟙 e) : CostructuredArrow (𝟭 E) e) |>.Final := Functor.final_fromPUnit_of_isTerminal <| CostructuredArrow.mkIdTerminal (S := 𝟭 E) (Y := e) apply Iff.mp <| Functor.final_iff_final_comp (F := (prod.leftUnitorEquivalence <| CostructuredArrow L d).inverse) diff --git a/Mathlib/CategoryTheory/Monoidal/Functor.lean b/Mathlib/CategoryTheory/Monoidal/Functor.lean index 41ce57b77f91ea..08dc1192c212ce 100644 --- a/Mathlib/CategoryTheory/Monoidal/Functor.lean +++ b/Mathlib/CategoryTheory/Monoidal/Functor.lean @@ -924,7 +924,7 @@ def rightAdjointLaxMonoidal : G.LaxMonoidal where counit_naturality, counit_naturality_assoc, left_triangle_components_assoc, MonoidalCategory.whiskerLeft_comp] rw [← δ_natural_left_assoc, ← δ_natural_left_assoc, ← δ_natural_left_assoc] - haveI := @NatTrans.whiskerRight_app_tensor_app_assoc _ _ _ _ _ _ _ _ _ adj.counit adj.counit + have := @NatTrans.whiskerRight_app_tensor_app_assoc _ _ _ _ _ _ _ _ _ adj.counit adj.counit dsimp only [id_obj, comp_obj, Functor.comp_map, Functor.id_map] at this rw [this, this, tensorHom_def, assoc, ← comp_whiskerRight_assoc, left_triangle_components, id_whiskerRight, id_comp, @@ -967,7 +967,7 @@ class IsMonoidal [G.LaxMonoidal] : Prop where instance : letI := adj.rightAdjointLaxMonoidal adj.IsMonoidal := by - letI := adj.rightAdjointLaxMonoidal + let := adj.rightAdjointLaxMonoidal constructor · rfl · intro _ _ @@ -1070,7 +1070,7 @@ set_option backward.defeqAttrib.useBackward true in instance : letI := adj.leftAdjointOplaxMonoidal adj.IsMonoidal := by - letI := adj.leftAdjointOplaxMonoidal + let := adj.leftAdjointOplaxMonoidal refine ⟨?_, fun X Y ↦ ?_⟩ · simp [homEquiv_counit, leftAdjointOplaxMonoidal_η] · simp [homEquiv_counit, ← μ_natural, leftAdjointOplaxMonoidal_δ] diff --git a/Mathlib/CategoryTheory/Monoidal/Mon.lean b/Mathlib/CategoryTheory/Monoidal/Mon.lean index 511a06c6329210..1b4d8bdd2e1464 100644 --- a/Mathlib/CategoryTheory/Monoidal/Mon.lean +++ b/Mathlib/CategoryTheory/Monoidal/Mon.lean @@ -228,7 +228,7 @@ instance instIsMonHomComp (f : M ⟶ N) (g : N ⟶ O) [IsMonHom f] [IsMonHom g] attribute [local simp] MonObj.ofIso_one MonObj.ofIso_mul in @[to_additive] instance isMonHom_ofIso (e : M ≅ X) : letI := MonObj.ofIso e; IsMonHom e.hom := by - letI := MonObj.ofIso e; exact { } + let := MonObj.ofIso e; exact { } @[to_additive] instance (f : M ≅ N) [IsMonHom f.hom] : IsMonHom f.inv where diff --git a/Mathlib/CategoryTheory/Monoidal/NaturalTransformation.lean b/Mathlib/CategoryTheory/Monoidal/NaturalTransformation.lean index 76b62391d25e68..9ac6d9c937c4a6 100644 --- a/Mathlib/CategoryTheory/Monoidal/NaturalTransformation.lean +++ b/Mathlib/CategoryTheory/Monoidal/NaturalTransformation.lean @@ -236,7 +236,7 @@ a monoidal natural transformation. lemma natTransIsMonoidal_of_transport {F G : C ⥤ D} [F.Monoidal] (e : F ≅ G) : letI : G.Monoidal := transport e e.hom.IsMonoidal := by - letI : G.Monoidal := transport e + let : G.Monoidal := transport e refine ⟨rfl, fun X Y ↦ ?_⟩ simp [transport_μ, tensorHom_comp_tensorHom_assoc] diff --git a/Mathlib/CategoryTheory/MorphismProperty/IsInvertedBy.lean b/Mathlib/CategoryTheory/MorphismProperty/IsInvertedBy.lean index 2f3a35a8d1f94f..25c2e189fcb983 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/IsInvertedBy.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/IsInvertedBy.lean @@ -45,35 +45,35 @@ set_option backward.defeqAttrib.useBackward true in theorem of_comp {C₁ C₂ C₃ : Type*} [Category* C₁] [Category* C₂] [Category* C₃] (W : MorphismProperty C₁) (F : C₁ ⥤ C₂) (hF : W.IsInvertedBy F) (G : C₂ ⥤ C₃) : W.IsInvertedBy (F ⋙ G) := fun X Y f hf => by - haveI := hF f hf + have := hF f hf dsimp infer_instance set_option backward.defeqAttrib.useBackward true in theorem op {W : MorphismProperty C} {L : C ⥤ D} (h : W.IsInvertedBy L) : W.op.IsInvertedBy L.op := fun X Y f hf => by - haveI := h f.unop hf + have := h f.unop hf dsimp infer_instance set_option backward.defeqAttrib.useBackward true in theorem rightOp {W : MorphismProperty C} {L : Cᵒᵖ ⥤ D} (h : W.op.IsInvertedBy L) : W.IsInvertedBy L.rightOp := fun X Y f hf => by - haveI := h f.op hf + have := h f.op hf dsimp infer_instance set_option backward.defeqAttrib.useBackward true in theorem leftOp {W : MorphismProperty C} {L : C ⥤ Dᵒᵖ} (h : W.IsInvertedBy L) : W.op.IsInvertedBy L.leftOp := fun X Y f hf => by - haveI := h f.unop hf + have := h f.unop hf dsimp infer_instance set_option backward.defeqAttrib.useBackward true in theorem unop {W : MorphismProperty C} {L : Cᵒᵖ ⥤ Dᵒᵖ} (h : W.op.IsInvertedBy L) : W.IsInvertedBy L.unop := fun X Y f hf => by - haveI := h f.op hf + have := h f.op hf dsimp infer_instance diff --git a/Mathlib/CategoryTheory/MorphismProperty/Limits.lean b/Mathlib/CategoryTheory/MorphismProperty/Limits.lean index 88affa6db43406..c9cab609ae86aa 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/Limits.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/Limits.lean @@ -183,7 +183,7 @@ theorem IsStableUnderBaseChange.mk' [RespectsIso P] P (pullback.fst f g)) : IsStableUnderBaseChange P where of_isPullback {X Y Y' S f g f' g'} sq hg := by - haveI : HasPullback f g := sq.flip.hasPullback + have : HasPullback f g := sq.flip.hasPullback let e := sq.flip.isoPullback rw [← P.cancel_left_of_respectsIso e.inv, sq.flip.isoPullback_inv_fst] exact hP₂ _ _ _ f g hg @@ -311,7 +311,7 @@ theorem IsStableUnderCobaseChange.mk' [RespectsIso P] P (pushout.inr f g)) : IsStableUnderCobaseChange P where of_isPushout {A A' B B' f g f' g'} sq hf := by - haveI : HasPushout f g := sq.flip.hasPushout + have : HasPushout f g := sq.flip.hasPushout let e := sq.flip.isoPushout rw [← P.cancel_right_of_respectsIso _ e.hom, sq.flip.inr_isoPushout_hom] exact hP₂ _ _ _ f g hf diff --git a/Mathlib/CategoryTheory/MorphismProperty/TransfiniteComposition.lean b/Mathlib/CategoryTheory/MorphismProperty/TransfiniteComposition.lean index 4fa14df20f1198..a1b2326ce82d73 100644 --- a/Mathlib/CategoryTheory/MorphismProperty/TransfiniteComposition.lean +++ b/Mathlib/CategoryTheory/MorphismProperty/TransfiniteComposition.lean @@ -257,7 +257,7 @@ lemma mem_map_bot_le {j : J} (g : ⊥ ⟶ j) : W (hf.F.map g) := by rw [← homOfLE_comp bot_le (Order.le_succ j), hf.F.map_comp] exact W.comp_mem _ _ hj' (hf.map_mem j hj) | isSuccLimit j hj hj' => - letI : OrderBot (Set.Iio j) := + let : OrderBot (Set.Iio j) := { bot := ⟨⊥, Order.IsSuccLimit.bot_lt hj⟩ bot_le j := bot_le } exact MorphismProperty.colimitsOfShape_le _ diff --git a/Mathlib/CategoryTheory/ObjectProperty/FiniteProducts.lean b/Mathlib/CategoryTheory/ObjectProperty/FiniteProducts.lean index e6c2ab7b09469c..e27291f6378e69 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/FiniteProducts.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/FiniteProducts.lean @@ -78,7 +78,7 @@ lemma binaryProductsClosure_le_iff [HasTerminal C] {P Q : ObjectProperty C} [Q.IsClosedUnderBinaryProducts] [Q.IsClosedUnderLimitsOfShape (Discrete.{0} PEmpty)] : P.binaryProductsClosure ≤ Q ↔ P ≤ Q := by refine ⟨fun h ↦ (P.le_limitsClosure _).trans h, fun h ↦ ?_⟩ - letI : Q.IsClosedUnderIsomorphisms := IsClosedUnderBinaryProducts.closedUnderIsomorphisms Q + let : Q.IsClosedUnderIsomorphisms := IsClosedUnderBinaryProducts.closedUnderIsomorphisms Q exact limitsClosure_le h /-- The typeclass saying that `P : ObjectProperty C` is stable under finite products. -/ @@ -182,7 +182,7 @@ lemma binaryCoproductsClosure_le_iff [HasInitial C] {P Q : ObjectProperty C} [Q.IsClosedUnderBinaryCoproducts] [Q.IsClosedUnderColimitsOfShape (Discrete.{0} PEmpty)] : P.binaryCoproductsClosure ≤ Q ↔ P ≤ Q := by refine ⟨fun h ↦ (P.le_colimitsClosure _).trans h, fun h ↦ ?_⟩ - letI : Q.IsClosedUnderIsomorphisms := IsClosedUnderBinaryCoproducts.closedUnderIsomorphisms Q + let : Q.IsClosedUnderIsomorphisms := IsClosedUnderBinaryCoproducts.closedUnderIsomorphisms Q exact colimitsClosure_le h /-- The typeclass saying that `P : ObjectProperty C` is stable under finite coproducts. -/ diff --git a/Mathlib/CategoryTheory/ObjectProperty/Kernels.lean b/Mathlib/CategoryTheory/ObjectProperty/Kernels.lean index 36c2163b861617..004b18e3f7bd2c 100644 --- a/Mathlib/CategoryTheory/ObjectProperty/Kernels.lean +++ b/Mathlib/CategoryTheory/ObjectProperty/Kernels.lean @@ -88,7 +88,7 @@ lemma prop_kernel [P.IsClosedUnderKernels] {X Y : C} (f : X ⟶ Y) [HasKernel f] instance [P.IsClosedUnderSubobjects] : P.IsClosedUnderKernels where kernels_le := by intro _ ⟨_, k, hk, hf⟩ - letI := Fork.IsLimit.mono hk + let := Fork.IsLimit.mono hk exact P.prop_of_mono k.ι hf.1 lemma hasLimit_parallelPair_comp_ι {X Y : P.FullSubcategory} (f : X ⟶ Y) [HasKernel f.hom] : @@ -136,7 +136,7 @@ lemma prop_cokernel [P.IsClosedUnderCokernels] {X Y : C} (f : X ⟶ Y) [HasCoker instance [P.IsClosedUnderQuotients] : P.IsClosedUnderCokernels where cokernels_le := by intro _ ⟨_, k, hk, hf⟩ - letI := Cofork.IsColimit.epi hk + let := Cofork.IsColimit.epi hk exact P.prop_of_epi k.π hf.2 lemma hasColimit_parallelPair_comp_ι {X Y : P.FullSubcategory} (f : X ⟶ Y) [HasCokernel f.hom] : diff --git a/Mathlib/CategoryTheory/PUnit.lean b/Mathlib/CategoryTheory/PUnit.lean index 90e23fb3a72964..489efd80680371 100644 --- a/Mathlib/CategoryTheory/PUnit.lean +++ b/Mathlib/CategoryTheory/PUnit.lean @@ -84,7 +84,7 @@ theorem equiv_punit_iff_unique : apply ULift.ext simp [eq_iff_true_of_subsingleton] · rintro ⟨⟨p⟩, h⟩ - haveI := fun x y => (h x y).some + have := fun x y => (h x y).some refine Nonempty.intro (CategoryTheory.Equivalence.mk ((Functor.const _).obj ⟨⟨⟩⟩) diff --git a/Mathlib/CategoryTheory/Preadditive/Biproducts.lean b/Mathlib/CategoryTheory/Preadditive/Biproducts.lean index 003a6a2ae4b31b..3f68199fadb03c 100644 --- a/Mathlib/CategoryTheory/Preadditive/Biproducts.lean +++ b/Mathlib/CategoryTheory/Preadditive/Biproducts.lean @@ -513,7 +513,7 @@ def binaryBiconeOfIsSplitMonoOfCokernel {X Y : C} {f : X ⟶ Y} [IsSplitMono f] rw [splitEpiOfIdempotentOfIsColimitCofork_section_, isColimitCoforkOfCokernelCofork_desc, isCokernelEpiComp_desc] dsimp only [cokernelCoforkOfCofork_ofπ] - letI := epi_of_isColimit_cofork i + let := epi_of_isColimit_cofork i apply zero_of_epi_comp c.π simp only [sub_comp, comp_sub, Category.comp_id, Category.assoc, IsSplitMono.id, sub_self, Cofork.IsColimit.π_desc_assoc, CokernelCofork.π_ofπ, IsSplitMono.id_assoc] @@ -627,7 +627,7 @@ def binaryBiconeOfIsSplitEpiOfKernel {X Y : C} {f : X ⟶ Y} [IsSplitEpi f] {c : rw [splitMonoOfIdempotentOfIsLimitFork_retraction, isLimitForkOfKernelFork_lift, isKernelCompMono_lift] dsimp only [kernelForkOfFork_ι] - letI := mono_of_isLimit_fork i + let := mono_of_isLimit_fork i apply zero_of_comp_mono c.ι simp only [comp_sub, Category.comp_id, Category.assoc, sub_self, Fork.IsLimit.lift_ι, Fork.ι_ofι, IsSplitEpi.id_assoc] @@ -916,7 +916,7 @@ set_option backward.isDefEq.respectTransparency false in preserves the biproduct of `f`. For the converse, see `mapBiproduct`. -/ lemma preservesBiproduct_of_mono_biproductComparison {f : J → C} [HasBiproduct f] [HasBiproduct (F.obj ∘ f)] [Mono (biproductComparison F f)] : PreservesBiproduct f F := by - haveI : HasProduct fun b => F.obj (f b) := by + have : HasProduct fun b => F.obj (f b) := by change HasProduct (F.obj ∘ f) infer_instance have that : piComparison F f = @@ -924,19 +924,19 @@ lemma preservesBiproduct_of_mono_biproductComparison {f : J → C} [HasBiproduct biproductComparison F f ≫ (biproduct.isoProduct _).hom := by ext j convert! piComparison_comp_π F f j; simp [← Function.comp_def, ← Functor.map_comp] - haveI : IsIso (biproductComparison F f) := isIso_of_mono_of_isSplitEpi _ - haveI : IsIso (piComparison F f) := by + have : IsIso (biproductComparison F f) := isIso_of_mono_of_isSplitEpi _ + have : IsIso (piComparison F f) := by rw [that] infer_instance - haveI := PreservesProduct.of_iso_comparison F f + have := PreservesProduct.of_iso_comparison F f apply preservesBiproduct_of_preservesProduct /-- If the (coproduct-like) biproduct comparison for `F` and `f` is an epimorphism, then `F` preserves the biproduct of `F` and `f`. For the converse, see `mapBiproduct`. -/ lemma preservesBiproduct_of_epi_biproductComparison' {f : J → C} [HasBiproduct f] [HasBiproduct (F.obj ∘ f)] [Epi (biproductComparison' F f)] : PreservesBiproduct f F := by - haveI : Epi (splitEpiBiproductComparison F f).section_ := by simpa - haveI : IsIso (biproductComparison F f) := + have : Epi (splitEpiBiproductComparison F f).section_ := by simpa + have : IsIso (biproductComparison F f) := IsIso.of_epi_section' (splitEpiBiproductComparison F f) apply preservesBiproduct_of_mono_biproductComparison @@ -1039,11 +1039,11 @@ lemma preservesBinaryBiproduct_of_mono_biprodComparison {X Y : C} [HasBinaryBipr prodComparison F X Y = (F.mapIso (biprod.isoProd X Y)).inv ≫ biprodComparison F X Y ≫ (biprod.isoProd _ _).hom := by ext <;> simp [← Functor.map_comp] - haveI : IsIso (biprodComparison F X Y) := isIso_of_mono_of_isSplitEpi _ - haveI : IsIso (prodComparison F X Y) := by + have : IsIso (biprodComparison F X Y) := isIso_of_mono_of_isSplitEpi _ + have : IsIso (prodComparison F X Y) := by rw [that] infer_instance - haveI := PreservesLimitPair.of_iso_prod_comparison F X Y + have := PreservesLimitPair.of_iso_prod_comparison F X Y apply preservesBinaryBiproduct_of_preservesBinaryProduct /-- If the (coproduct-like) biproduct comparison for `F`, `X` and `Y` is an epimorphism, then @@ -1051,8 +1051,8 @@ lemma preservesBinaryBiproduct_of_mono_biprodComparison {X Y : C} [HasBinaryBipr lemma preservesBinaryBiproduct_of_epi_biprodComparison' {X Y : C} [HasBinaryBiproduct X Y] [HasBinaryBiproduct (F.obj X) (F.obj Y)] [Epi (biprodComparison' F X Y)] : PreservesBinaryBiproduct X Y F := by - haveI : Epi (splitEpiBiprodComparison F X Y).section_ := by simpa - haveI : IsIso (biprodComparison F X Y) := + have : Epi (splitEpiBiprodComparison F X Y).section_ := by simpa + have : IsIso (biprodComparison F X Y) := IsIso.of_epi_section' (splitEpiBiprodComparison F X Y) apply preservesBinaryBiproduct_of_mono_biprodComparison diff --git a/Mathlib/CategoryTheory/Preadditive/Injective/Basic.lean b/Mathlib/CategoryTheory/Preadditive/Injective/Basic.lean index 4e6e7ca93aa2af..b4447e823ae67e 100644 --- a/Mathlib/CategoryTheory/Preadditive/Injective/Basic.lean +++ b/Mathlib/CategoryTheory/Preadditive/Injective/Basic.lean @@ -291,7 +291,7 @@ theorem injective_of_map_injective (adj : F ⊣ G) [G.Full] [G.Faithful] (I : D) (hI : Injective (G.obj I)) : Injective I := ⟨fun {X} {Y} f g => by intro - haveI : PreservesLimitsOfSize.{0, 0} G := adj.rightAdjoint_preservesLimits + have : PreservesLimitsOfSize.{0, 0} G := adj.rightAdjoint_preservesLimits rcases hI.factors (G.map f) (G.map g) with ⟨w,h⟩ use inv (adj.counit.app _) ≫ F.map w ≫ adj.counit.app _ exact G.map_injective (by simpa)⟩ @@ -304,7 +304,7 @@ def mapInjectivePresentation (adj : F ⊣ G) [F.PreservesMonomorphisms] (X : D) injective := adj.map_injective _ I.injective f := G.map I.f mono := by - haveI : PreservesLimitsOfSize.{0, 0} G := adj.rightAdjoint_preservesLimits; infer_instance + have : PreservesLimitsOfSize.{0, 0} G := adj.rightAdjoint_preservesLimits; infer_instance /-- Given an adjunction `F ⊣ G` such that `F` preserves monomorphisms and is faithful, then any injective presentation of `F(X)` can be pulled back to an injective presentation of `X`. diff --git a/Mathlib/CategoryTheory/Preadditive/LeftExact.lean b/Mathlib/CategoryTheory/Preadditive/LeftExact.lean index def108ecf37a58..afead0faa8e030 100644 --- a/Mathlib/CategoryTheory/Preadditive/LeftExact.lean +++ b/Mathlib/CategoryTheory/Preadditive/LeftExact.lean @@ -86,8 +86,8 @@ morphisms if it preserves all kernels. -/ lemma preservesEqualizer_of_preservesKernels [∀ {X Y} (f : X ⟶ Y), PreservesLimit (parallelPair f 0) F] {X Y : C} (f g : X ⟶ Y) : PreservesLimit (parallelPair f g) F := by - letI := preservesBinaryBiproducts_of_preservesBinaryProducts F - haveI := additive_of_preservesBinaryBiproducts F + let := preservesBinaryBiproducts_of_preservesBinaryProducts F + have := additive_of_preservesBinaryBiproducts F constructor; intro c i let c' := isLimitKernelForkOfFork (i.ofIsoLimit (Fork.isoForkOfι c)) dsimp only [kernelForkOfFork_ofι] at c' @@ -108,7 +108,7 @@ lemma preservesEqualizers_of_preservesKernels [∀ {X Y} (f : X ⟶ Y), PreservesLimit (parallelPair f 0) F] : PreservesLimitsOfShape WalkingParallelPair F where preservesLimit {K} := by - letI := preservesEqualizer_of_preservesKernels F (K.map WalkingParallelPairHom.left) + let := preservesEqualizer_of_preservesKernels F (K.map WalkingParallelPairHom.left) (K.map WalkingParallelPairHom.right) apply preservesLimit_of_iso_diagram F (diagramIsoParallelPair K).symm @@ -169,8 +169,8 @@ morphisms if it preserves all cokernels. -/ lemma preservesCoequalizer_of_preservesCokernels [∀ {X Y} (f : X ⟶ Y), PreservesColimit (parallelPair f 0) F] {X Y : C} (f g : X ⟶ Y) : PreservesColimit (parallelPair f g) F := by - letI := preservesBinaryBiproducts_of_preservesBinaryCoproducts F - haveI := additive_of_preservesBinaryBiproducts F + let := preservesBinaryBiproducts_of_preservesBinaryCoproducts F + have := additive_of_preservesBinaryBiproducts F constructor intro c i let c' := isColimitCokernelCoforkOfCofork (i.ofIsoColimit (Cofork.isoCoforkOfπ c)) @@ -193,7 +193,7 @@ lemma preservesCoequalizers_of_preservesCokernels [∀ {X Y} (f : X ⟶ Y), PreservesColimit (parallelPair f 0) F] : PreservesColimitsOfShape WalkingParallelPair F where preservesColimit {K} := by - letI := preservesCoequalizer_of_preservesCokernels F (K.map Limits.WalkingParallelPairHom.left) + let := preservesCoequalizer_of_preservesCokernels F (K.map Limits.WalkingParallelPairHom.left) (K.map Limits.WalkingParallelPairHom.right) apply preservesColimit_of_iso_diagram F (diagramIsoParallelPair K).symm @@ -202,10 +202,10 @@ colimits. -/ lemma preservesFiniteColimits_of_preservesCokernels [HasFiniteCoproducts C] [HasCoequalizers C] [HasZeroObject C] [HasZeroObject D] [∀ {X Y} (f : X ⟶ Y), PreservesColimit (parallelPair f 0) F] : PreservesFiniteColimits F := by - letI := preservesCoequalizers_of_preservesCokernels F - letI := preservesInitialObject_of_preservesZeroMorphisms F - letI := preservesColimitsOfShape_pempty_of_preservesInitial F - letI : PreservesFiniteCoproducts F := + let := preservesCoequalizers_of_preservesCokernels F + let := preservesInitialObject_of_preservesZeroMorphisms F + let := preservesColimitsOfShape_pempty_of_preservesInitial F + let : PreservesFiniteCoproducts F := ⟨fun _ ↦ PreservesFiniteCoproducts.of_preserves_binary_and_initial F _⟩ exact preservesFiniteColimits_of_preservesCoequalizers_and_finiteCoproducts F diff --git a/Mathlib/CategoryTheory/Preadditive/Projective/Basic.lean b/Mathlib/CategoryTheory/Preadditive/Projective/Basic.lean index 98949b25140fc5..99fbffc078481d 100644 --- a/Mathlib/CategoryTheory/Preadditive/Projective/Basic.lean +++ b/Mathlib/CategoryTheory/Preadditive/Projective/Basic.lean @@ -214,7 +214,7 @@ set_option backward.isDefEq.respectTransparency false in theorem projective_of_map_projective (adj : F ⊣ G) [F.Full] [F.Faithful] (P : C) (hP : Projective (F.obj P)) : Projective P where factors f g _ := by - haveI := Adjunction.leftAdjoint_preservesColimits.{0, 0} adj + have := Adjunction.leftAdjoint_preservesColimits.{0, 0} adj rcases (@hP).1 (F.map f) (F.map g) with ⟨f', hf'⟩ use adj.unit.app _ ≫ G.map f' ≫ (inv <| adj.unit.app _) exact F.map_injective (by simpa) diff --git a/Mathlib/CategoryTheory/Preadditive/Schur.lean b/Mathlib/CategoryTheory/Preadditive/Schur.lean index 4b32d29f7232e4..3f7acddcd52ef2 100644 --- a/Mathlib/CategoryTheory/Preadditive/Schur.lean +++ b/Mathlib/CategoryTheory/Preadditive/Schur.lean @@ -68,7 +68,7 @@ noncomputable instance [HasKernels C] {X : C} [Simple X] : DivisionRing (End X) mul_inv_cancel f hf := by dsimp rw [dif_neg hf] - haveI := isIso_of_hom_simple hf + have := isIso_of_hom_simple hf exact IsIso.inv_hom_id f nnqsmul := _ nnqsmul_def := fun _ _ => rfl @@ -160,7 +160,7 @@ theorem finrank_hom_simple_simple_le_one (X Y : C) [FiniteDimensional 𝕜 (X · rw [finrank_zero_of_subsingleton] exact zero_le_one · obtain ⟨f, nz⟩ := (nontrivial_iff_exists_ne 0).mp h - haveI fi := (isIso_iff_nonzero f).mpr nz + have fi := (isIso_iff_nonzero f).mpr nz refine finrank_le_one f ?_ intro g obtain ⟨c, w⟩ := endomorphism_simple_eq_smul_id 𝕜 (g ≫ inv f) diff --git a/Mathlib/CategoryTheory/Presentable/CardinalDirectedPoset.lean b/Mathlib/CategoryTheory/Presentable/CardinalDirectedPoset.lean index d4745dd6b9f4a7..47ac60b78f5665 100644 --- a/Mathlib/CategoryTheory/Presentable/CardinalDirectedPoset.lean +++ b/Mathlib/CategoryTheory/Presentable/CardinalDirectedPoset.lean @@ -64,7 +64,7 @@ variable {κ} {J : Type u} [SmallCategory J] [IsCardinalFiltered J κ] lemma isCardinalFiltered_pt (hF : ∀ j, IsCardinalFiltered (F.obj j) κ) : haveI := isFiltered_of_isCardinalFiltered J κ IsCardinalFiltered (CoconePt hc) κ := by - haveI := isFiltered_of_isCardinalFiltered J κ + have := isFiltered_of_isCardinalFiltered J κ refine isCardinalFiltered_preorder _ _ (fun K f hK ↦ ?_) rw [← hasCardinalLT_iff_cardinal_mk_lt] at hK choose j₀ x₀ hx₀ using fun k ↦ Types.jointly_surjective_of_isColimit hc (f k) @@ -208,7 +208,7 @@ instance : ObjectProperty.EssentiallySmall.{u} (hasCardinalLTWithTerminal κ) wh obtain ⟨f⟩ : Cardinal.mk J.obj ≤ Cardinal.mk X := by simpa [hX] using ((hasCardinalLT_iff_cardinal_mk_lt _ _).1 hJ).le let e := Equiv.ofInjective _ f.injective - letI : PartialOrder (Set.range f) := PartialOrder.lift _ e.symm.injective + let : PartialOrder (Set.range f) := PartialOrder.lift _ e.symm.injective let e' : Set.range f ≃o J.obj := { toEquiv := e.symm, map_rel_iff' := by rfl } exact ⟨_, ⟨⟨Set.range f, inferInstance, ⟨⟨IsCardinalFiltered.of_equivalence κ e'.symm.equivalence⟩⟩⟩⟩, diff --git a/Mathlib/CategoryTheory/Presentable/SharplyLT/Basic.lean b/Mathlib/CategoryTheory/Presentable/SharplyLT/Basic.lean index 5a9df97b791eff..2574454c5dec62 100644 --- a/Mathlib/CategoryTheory/Presentable/SharplyLT/Basic.lean +++ b/Mathlib/CategoryTheory/Presentable/SharplyLT/Basic.lean @@ -174,7 +174,7 @@ lemma hasCardinalLT_transfiniteIterate_φ (j : κ₁.ord.ToType) : induction j using SuccOrder.limitRecOn with | isMin j hj => have := Cardinal.nonempty_ord_toType (c := κ₁) (IsRegular.ne_zero Fact.out) - letI := WellFoundedLT.toOrderBot κ₁.ord.ToType + let := WellFoundedLT.toOrderBot κ₁.ord.ToType simpa [hj.eq_bot] | succ j hj hj' => have hκ₂ : κ₂.IsRegular := Fact.out @@ -204,7 +204,7 @@ lemma monotone_transfiniteIterate_φ : omit [PartialOrder X] [Fact κ₂.IsRegular] in lemma subset_iUnion : A ⊆ ⋃ (j : κ₁.ord.ToType), transfiniteIterate (φ Y m) j A := by have := Cardinal.nonempty_ord_toType (c := κ₁) (IsRegular.ne_zero Fact.out) - letI := WellFoundedLT.toOrderBot κ₁.ord.ToType + let := WellFoundedLT.toOrderBot κ₁.ord.ToType exact subset_trans (by simp) (Set.subset_iUnion _ ⊥) include h₀ hY hY' hm hA in diff --git a/Mathlib/CategoryTheory/Quotient/Linear.lean b/Mathlib/CategoryTheory/Quotient/Linear.lean index d17a32660e0f4b..25882519774864 100644 --- a/Mathlib/CategoryTheory/Quotient/Linear.lean +++ b/Mathlib/CategoryTheory/Quotient/Linear.lean @@ -116,7 +116,7 @@ instance linear_functor (hr : ∀ (a : R) ⦃X Y : C⦄ (f₁ f₂ : X ⟶ Y) (_ : r f₁ f₂), r (a • f₁) (a • f₂)) [Preadditive (Quotient r)] [(functor r).Additive] : letI := linear R r hr; Functor.Linear R (functor r) := by - letI := linear R r hr; exact { } + let := linear R r hr; exact { } end Quotient diff --git a/Mathlib/CategoryTheory/Shift/Adjunction.lean b/Mathlib/CategoryTheory/Shift/Adjunction.lean index e83e02ed9beffc..ba1a8caa4a0e1b 100644 --- a/Mathlib/CategoryTheory/Shift/Adjunction.lean +++ b/Mathlib/CategoryTheory/Shift/Adjunction.lean @@ -413,7 +413,7 @@ set_option backward.defeqAttrib.useBackward true in lemma commShift_of_leftAdjoint [F.CommShift A] : letI := adj.rightAdjointCommShift A adj.CommShift A := by - letI := adj.rightAdjointCommShift A + let := adj.rightAdjointCommShift A refine CommShift.mk' _ _ ⟨fun a ↦ ?_⟩ ext X dsimp @@ -502,7 +502,7 @@ set_option backward.defeqAttrib.useBackward true in lemma commShift_of_rightAdjoint [G.CommShift A] : letI := adj.leftAdjointCommShift A adj.CommShift A := by - letI := adj.leftAdjointCommShift A + let := adj.leftAdjointCommShift A refine CommShift.mk' _ _ ⟨fun a ↦ ?_⟩ ext X dsimp @@ -620,7 +620,7 @@ noncomputable def commShiftInverse [E.functor.CommShift A] : E.inverse.CommShift lemma commShift_of_functor [E.functor.CommShift A] : letI := E.commShiftInverse A E.CommShift A := by - letI := E.commShiftInverse A + let := E.commShiftInverse A exact CommShift.mk' _ _ (E.toAdjunction.commShift_of_leftAdjoint A).commShift_unit /-- @@ -635,7 +635,7 @@ set_option backward.isDefEq.respectTransparency false in lemma commShift_of_inverse [E.inverse.CommShift A] : letI := E.commShiftFunctor A E.CommShift A := by - letI := E.commShiftFunctor A + let := E.commShiftFunctor A have := E.symm.commShift_of_functor A exact inferInstanceAs (E.symm.symm.CommShift A) diff --git a/Mathlib/CategoryTheory/Shift/CommShift.lean b/Mathlib/CategoryTheory/Shift/CommShift.lean index 7f8d6bd467a2dd..c36d2531705d21 100644 --- a/Mathlib/CategoryTheory/Shift/CommShift.lean +++ b/Mathlib/CategoryTheory/Shift/CommShift.lean @@ -414,7 +414,7 @@ instance of_iso_symm [NatTrans.CommShift e.hom A] : NatTrans.CommShift e.symm.ho lemma of_isIso [IsIso τ] [NatTrans.CommShift τ A] : NatTrans.CommShift (inv τ) A := by - haveI : NatTrans.CommShift (asIso τ).hom A := by assumption + have : NatTrans.CommShift (asIso τ).hom A := by assumption change NatTrans.CommShift (asIso τ).inv A infer_instance @@ -481,7 +481,7 @@ def ofIso : G.CommShift A where lemma ofIso_compatibility : letI := ofIso e A NatTrans.CommShift e.hom A := by - letI := ofIso e A + let := ofIso e A exact ⟨fun a => by ext; simp [ofIso_commShiftIso_hom_app]⟩ end CommShift @@ -602,7 +602,7 @@ set_option backward.isDefEq.respectTransparency false in lemma ofComp_compatibility : letI := ofComp e NatTrans.CommShift e.hom A := by - letI := ofComp e + let := ofComp e refine ⟨fun a ↦ ?_⟩ ext X simp [commShiftIso_comp_hom_app, show F.commShiftIso a = OfComp.iso e a from rfl, diff --git a/Mathlib/CategoryTheory/Shift/Localization.lean b/Mathlib/CategoryTheory/Shift/Localization.lean index ba1303396ea965..c98abdc19b2de0 100644 --- a/Mathlib/CategoryTheory/Shift/Localization.lean +++ b/Mathlib/CategoryTheory/Shift/Localization.lean @@ -241,7 +241,7 @@ set_option backward.isDefEq.respectTransparency false in instance NatTrans.commShift_iso_hom_of_localization : letI := Functor.commShiftOfLocalization L W A F F' NatTrans.CommShift (Lifting.iso L W F F').hom A := by - letI := Functor.commShiftOfLocalization L W A F F' + let := Functor.commShiftOfLocalization L W A F F' constructor intro a ext X @@ -307,7 +307,7 @@ set_option backward.isDefEq.respectTransparency false in lemma natTransCommShift_hom : letI := Φ.commShift M L₁ L₂ G e NatTrans.CommShift e.hom M := by - letI := Φ.commShift M L₁ L₂ G e + let := Φ.commShift M L₁ L₂ G e refine ⟨fun m ↦ ?_⟩ ext X simp [Functor.commShiftIso_comp_hom_app, commShift_iso_hom_app, ← Functor.map_comp_assoc] diff --git a/Mathlib/CategoryTheory/Simple.lean b/Mathlib/CategoryTheory/Simple.lean index b433d6015c5c0f..0db17621155756 100644 --- a/Mathlib/CategoryTheory/Simple.lean +++ b/Mathlib/CategoryTheory/Simple.lean @@ -102,7 +102,7 @@ theorem kernel_zero_of_nonzero_from_simple {X Y : C} [Simple X] {f : X ⟶ Y} [H (w : f ≠ 0) : kernel.ι f = 0 := by classical by_contra h - haveI := isIso_of_mono_of_nonzero h + have := isIso_of_mono_of_nonzero h exact w (eq_zero_of_epi_kernel f) -- See also `mono_of_nonzero_from_simple`, which requires `Preadditive C`. @@ -112,7 +112,7 @@ theorem kernel_zero_of_nonzero_from_simple {X Y : C} [Simple X] {f : X ⟶ Y} [H theorem epi_of_nonzero_to_simple [HasEqualizers C] {X Y : C} [Simple Y] {f : X ⟶ Y} [HasImage f] (w : f ≠ 0) : Epi f := by rw [← image.fac f] - haveI : IsIso (image.ι f) := isIso_of_mono_of_nonzero fun h => w (eq_zero_of_image_eq_zero h) + have : IsIso (image.ι f) := isIso_of_mono_of_nonzero fun h => w (eq_zero_of_image_eq_zero h) apply epi_comp theorem mono_to_simple_zero_of_not_iso {X Y : C} [Simple Y] {f : X ⟶ Y} [Mono f] @@ -180,7 +180,7 @@ theorem cokernel_zero_of_nonzero_to_simple {X Y : C} [Simple Y] {f : X ⟶ Y} (w cokernel.π f = 0 := by classical by_contra h - haveI := isIso_of_epi_of_nonzero h + have := isIso_of_epi_of_nonzero h exact w (eq_zero_of_mono_cokernel f) theorem epi_from_simple_zero_of_not_iso {X Y : C} [Simple X] {f : X ⟶ Y} [Epi f] diff --git a/Mathlib/CategoryTheory/Sites/ConcreteSheafification.lean b/Mathlib/CategoryTheory/Sites/ConcreteSheafification.lean index e4fea004e81e05..577e18af7001ad 100644 --- a/Mathlib/CategoryTheory/Sites/ConcreteSheafification.lean +++ b/Mathlib/CategoryTheory/Sites/ConcreteSheafification.lean @@ -493,7 +493,7 @@ variable {D} set_option backward.isDefEq.respectTransparency false in theorem isIso_toSheafify {P : Cᵒᵖ ⥤ D} (hP : Presheaf.IsSheaf J P) : IsIso (J.toSheafify P) := by dsimp [toSheafify] - haveI := isIso_toPlus_of_isSheaf J P hP + have := isIso_toPlus_of_isSheaf J P hP change (IsIso (toPlus J P ≫ (J.plusFunctor D).map (toPlus J P))) infer_instance diff --git a/Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean b/Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean index 407c524ae3f725..120b4161042a90 100644 --- a/Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean +++ b/Mathlib/CategoryTheory/Sites/EqualizerSheafCondition.lean @@ -214,7 +214,7 @@ theorem w : forkMap P R ≫ firstMap P R = forkMap P R ≫ secondMap P R := by ext fg simp only [firstMap, secondMap, forkMap] simp only [limit.lift_π, limit.lift_π_assoc, assoc, Fan.mk_π_app] - haveI := Presieve.HasPairwisePullbacks.has_pullbacks fg.1.2.2 fg.2.2.2 + have := Presieve.HasPairwisePullbacks.has_pullbacks fg.1.2.2 fg.2.2.2 rw [← P.map_comp, ← op_comp, pullback.condition] simp diff --git a/Mathlib/CategoryTheory/Sites/Equivalence.lean b/Mathlib/CategoryTheory/Sites/Equivalence.lean index f9db07fde0ed3b..5925f220ae84e9 100644 --- a/Mathlib/CategoryTheory/Sites/Equivalence.lean +++ b/Mathlib/CategoryTheory/Sites/Equivalence.lean @@ -289,7 +289,7 @@ lemma PreservesSheafification.transport rw [← J.W_whiskerLeft_iff (G := G) (K := K)] at hf have := K.W_of_preservesSheafification F (whiskerLeft G.op f) hf rw [whiskerRight_left] at this - haveI := K.W.of_postcomp (W' := MorphismProperty.isomorphisms _) _ _ (Iso.isIso_inv _) <| + have := K.W.of_postcomp (W' := MorphismProperty.isomorphisms _) _ _ (Iso.isIso_inv _) <| K.W.of_precomp (W' := MorphismProperty.isomorphisms _) _ _ (Iso.isIso_hom _) this rwa [K.W_whiskerLeft_iff (G := G) (J := J) (f := whiskerRight f F)] at this diff --git a/Mathlib/CategoryTheory/Sites/IsSheafFor.lean b/Mathlib/CategoryTheory/Sites/IsSheafFor.lean index c80ad160c9acd2..0fb018ee82765d 100644 --- a/Mathlib/CategoryTheory/Sites/IsSheafFor.lean +++ b/Mathlib/CategoryTheory/Sites/IsSheafFor.lean @@ -184,10 +184,10 @@ theorem pullbackCompatible_iff (x : FamilyOfElements P R) [R.HasPairwisePullback constructor · intro t Y₁ Y₂ f₁ f₂ hf₁ hf₂ apply t - haveI := HasPairwisePullbacks.has_pullbacks hf₁ hf₂ + have := HasPairwisePullbacks.has_pullbacks hf₁ hf₂ apply pullback.condition · intro t Y₁ Y₂ Z g₁ g₂ f₁ f₂ hf₁ hf₂ comm - haveI := HasPairwisePullbacks.has_pullbacks hf₁ hf₂ + have := HasPairwisePullbacks.has_pullbacks hf₁ hf₂ rw [← pullback.lift_fst _ _ comm, op_comp, Functor.map_comp, comp_apply, t hf₁ hf₂, ← comp_apply, ← Functor.map_comp, ← op_comp, pullback.lift_snd] diff --git a/Mathlib/CategoryTheory/Sites/LeftExact.lean b/Mathlib/CategoryTheory/Sites/LeftExact.lean index 2b595f5006ae30..6b603310282077 100644 --- a/Mathlib/CategoryTheory/Sites/LeftExact.lean +++ b/Mathlib/CategoryTheory/Sites/LeftExact.lean @@ -257,9 +257,9 @@ instance preservesLimitsOfShape_presheafToSheaf [PreservesLimits (forget D)] [∀ X : C, Small.{t, max u v} (J.Cover X)ᵒᵖ] : PreservesLimitsOfShape K (plusPlusSheaf J D) := by let e := (FinCategory.equivAsType K).symm.trans (AsSmall.equiv.{0, 0, t}) - haveI : HasLimitsOfShape (AsSmall.{t} (FinCategory.AsType K)) D := + have : HasLimitsOfShape (AsSmall.{t} (FinCategory.AsType K)) D := Limits.hasLimitsOfShape_of_equivalence e - haveI : FinCategory (AsSmall.{t} (FinCategory.AsType K)) := by + have : FinCategory (AsSmall.{t} (FinCategory.AsType K)) := by constructor · change Fintype (ULift _) infer_instance diff --git a/Mathlib/CategoryTheory/Sites/Point/Basic.lean b/Mathlib/CategoryTheory/Sites/Point/Basic.lean index c9421f9d5182a2..2ed8ce616fc0d4 100644 --- a/Mathlib/CategoryTheory/Sites/Point/Basic.lean +++ b/Mathlib/CategoryTheory/Sites/Point/Basic.lean @@ -343,7 +343,7 @@ lemma toPresheafFiber_presheafFiberCompIso_hom_app (X : C) (x : Φ.fiber.obj X) (P : Cᵒᵖ ⥤ A) : Φ.toPresheafFiber X x (P ⋙ F) ≫ (Φ.presheafFiberCompIso F).hom.app P = F.map (Φ.toPresheafFiber X x P) := by - haveI := Functor.Final.preservesColimitsOfShape_of_final + have := Functor.Final.preservesColimitsOfShape_of_final (FinallySmall.fromFilteredFinalModel.{w} (Φ.fiber.Elementsᵒᵖ)) F simp only [presheafFiberCompIso] exact ι_preservesColimitIso_inv F ((CategoryOfElements.π Φ.fiber).op ⋙ P) _ diff --git a/Mathlib/CategoryTheory/Sites/Sheaf.lean b/Mathlib/CategoryTheory/Sites/Sheaf.lean index 1ee14826e07ea4..c9003c0cae617f 100644 --- a/Mathlib/CategoryTheory/Sites/Sheaf.lean +++ b/Mathlib/CategoryTheory/Sites/Sheaf.lean @@ -706,7 +706,7 @@ theorem isSheaf_comp_of_isSheaf (s : A ⥤ B) [PreservesLimitsOfSize.{v₁, max theorem isSheaf_iff_isSheaf_comp (s : A ⥤ B) [HasLimitsOfSize.{v₁, max v₁ u₁} A] [PreservesLimitsOfSize.{v₁, max v₁ u₁} s] [s.ReflectsIsomorphisms] : IsSheaf J P ↔ IsSheaf J (P ⋙ s) := by - letI : ReflectsLimitsOfSize s := reflectsLimits_of_reflectsIsomorphisms + let : ReflectsLimitsOfSize s := reflectsLimits_of_reflectsIsomorphisms exact ⟨isSheaf_comp_of_isSheaf J P s, isSheaf_of_isSheaf_comp J P s⟩ /-- diff --git a/Mathlib/CategoryTheory/SmallObject/IsCardinalForSmallObjectArgument.lean b/Mathlib/CategoryTheory/SmallObject/IsCardinalForSmallObjectArgument.lean index eaeabf4d62d737..9382c3e2e8ca4e 100644 --- a/Mathlib/CategoryTheory/SmallObject/IsCardinalForSmallObjectArgument.lean +++ b/Mathlib/CategoryTheory/SmallObject/IsCardinalForSmallObjectArgument.lean @@ -118,9 +118,9 @@ lemma preservesColimit {A B X Y : C} (i : A ⟶ B) (hi : I i) (f : X ⟶ Y) lemma hasColimitsOfShape_discrete (X Y : C) (p : X ⟶ Y) : HasColimitsOfShape (Discrete (FunctorObjIndex I.homFamily p)) C := by - haveI := locallySmall I κ - haveI := isSmall I κ - haveI := hasCoproducts I κ + have := locallySmall I κ + have := isSmall I κ + have := hasCoproducts I κ exact hasColimitsOfShape_of_equivalence (Discrete.equivalence (equivShrink.{w} _)).symm @@ -157,10 +157,10 @@ def propArrow : MorphismProperty (Arrow C) := fun _ _ f ↦ set_option backward.defeqAttrib.useBackward true in lemma succStruct_prop_le_propArrow : (succStruct I κ).prop ≤ (propArrow.{w} I).functorCategory (Arrow C) := by - haveI := locallySmall I κ - haveI := isSmall I κ - haveI := hasColimitsOfShape_discrete I κ - haveI := hasPushouts I κ + have := locallySmall I κ + have := isSmall I κ + have := hasColimitsOfShape_discrete I κ + have := hasPushouts I κ intro _ _ _ ⟨F⟩ f constructor · nth_rw 1 [← I.ofHoms_homFamily] @@ -382,9 +382,9 @@ set_option backward.defeqAttrib.useBackward true in set_option backward.isDefEq.respectTransparency false in lemma hasRightLiftingProperty_πObj {A B : C} (i : A ⟶ B) (hi : I i) (f : X ⟶ Y) : HasLiftingProperty i (πObj I κ f) := ⟨by - haveI := hasColimitsOfShape_discrete I κ - haveI := hasPushouts I κ - haveI := preservesColimit I κ i hi _ (relativeCellComplexιObj I κ f) + have := hasColimitsOfShape_discrete I κ + have := hasPushouts I κ + have := preservesColimit I κ i hi _ (relativeCellComplexιObj I κ f) intro g b sq obtain ⟨j, t, ht⟩ := Types.jointly_surjective _ (isColimitOfPreserves (coyoneda.obj (Opposite.op A)) diff --git a/Mathlib/CategoryTheory/Subobject/MonoOver.lean b/Mathlib/CategoryTheory/Subobject/MonoOver.lean index a6f4efb7ff6877..7e71cef9cfd97a 100644 --- a/Mathlib/CategoryTheory/Subobject/MonoOver.lean +++ b/Mathlib/CategoryTheory/Subobject/MonoOver.lean @@ -288,7 +288,7 @@ variable [HasPullbacks C] by pulling back a monomorphism along `f`. -/ def pullback (f : X ⟶ Y) : MonoOver Y ⥤ MonoOver X := MonoOver.lift (Over.pullback f) (fun g => by - haveI : Mono ((forget Y).obj g).hom := (inferInstance : Mono g.arrow) + have : Mono ((forget Y).obj g).hom := (inferInstance : Mono g.arrow) apply pullback.snd_of_mono) /-- pullback commutes with composition (up to a natural isomorphism) -/ diff --git a/Mathlib/CategoryTheory/Triangulated/LocalizingSubcategory.lean b/Mathlib/CategoryTheory/Triangulated/LocalizingSubcategory.lean index 46e9f82dc19dd8..dc0576d7f7409a 100644 --- a/Mathlib/CategoryTheory/Triangulated/LocalizingSubcategory.lean +++ b/Mathlib/CategoryTheory/Triangulated/LocalizingSubcategory.lean @@ -241,8 +241,8 @@ instance [Preadditive D₁] [Preadditive D₂] [L₁.Additive] [L₂.Additive] : set_option backward.defeqAttrib.useBackward true in instance : ((A.triangulatedLocalizerMorphism B).localizedFunctor L₁ L₂).Faithful := by - letI := Localization.preadditive L₁ (B.inverseImage A.ι).trW - letI := Localization.preadditive L₂ B.trW + let := Localization.preadditive L₁ (B.inverseImage A.ι).trW + let := Localization.preadditive L₂ B.trW have := Localization.functor_additive L₁ (B.inverseImage A.ι).trW have := Localization.functor_additive L₂ B.trW let F := (A.triangulatedLocalizerMorphism B).localizedFunctor L₁ L₂ @@ -276,7 +276,7 @@ instance [A.IsVerdierLeftLocalizing B] : let L₂ := B.trW.Q let F : (B.inverseImage A.ι).trW.Localization ⥤ B.trW.Localization := (A.triangulatedLocalizerMorphism B).localizedFunctor L₁ L₂ - letI : CatCommSq (A.op.triangulatedLocalizerMorphism B.op).functor + let : CatCommSq (A.op.triangulatedLocalizerMorphism B.op).functor (A.opEquivalence.functor ⋙ L₁.op) L₂.op F.op := ⟨Functor.isoWhiskerLeft A.opEquivalence.functor (NatIso.op (CatCommSq.iso (A.triangulatedLocalizerMorphism B).functor L₁ L₂ F).symm)⟩ diff --git a/Mathlib/Combinatorics/Additive/ErdosGinzburgZiv.lean b/Mathlib/Combinatorics/Additive/ErdosGinzburgZiv.lean index 0015ed2a201246..d2ba7f2eab74e6 100644 --- a/Mathlib/Combinatorics/Additive/ErdosGinzburgZiv.lean +++ b/Mathlib/Combinatorics/Additive/ErdosGinzburgZiv.lean @@ -54,7 +54,7 @@ Any sequence of `2 * p - 1` elements of `ZMod p` contains a subsequence of `p` e zero. -/ private theorem ZMod.erdos_ginzburg_ziv_prime (a : ι → ZMod p) (hs : #s = 2 * p - 1) : ∃ t ⊆ s, #t = p ∧ ∑ i ∈ t, a i = 0 := by - haveI : NeZero p := inferInstance + have : NeZero p := inferInstance classical -- Let `N` be the number of common roots of our polynomials `f₁` and `f₂` (`f s ff` and `f s tt`). set N := Fintype.card {x // eval x (f₁ s a) = 0 ∧ eval x (f₂ s a) = 0} @@ -118,7 +118,7 @@ theorem Int.erdos_ginzburg_ziv (a : ι → ℤ) (hs : 2 * n - 1 ≤ #s) : | one => simpa using exists_subset_card_eq hs -- When `n := p` is prime, we use the prime case `Int.erdos_ginzburg_ziv_prime`. | prime p hp => - haveI := Fact.mk hp + have := Fact.mk hp obtain ⟨t, hts, ht⟩ := exists_subset_card_eq hs obtain ⟨u, hut, hu⟩ := Int.erdos_ginzburg_ziv_prime a ht exact ⟨u, hut.trans hts, hu⟩ diff --git a/Mathlib/Combinatorics/Additive/RuzsaCovering.lean b/Mathlib/Combinatorics/Additive/RuzsaCovering.lean index 9f37658ccf961e..2482cd65e1d471 100644 --- a/Mathlib/Combinatorics/Additive/RuzsaCovering.lean +++ b/Mathlib/Combinatorics/Additive/RuzsaCovering.lean @@ -31,7 +31,7 @@ variable [DecidableEq G] {A B : Finset G} @[to_additive /-- **Ruzsa's covering lemma** -/] theorem ruzsa_covering_mul (hB : B.Nonempty) (hK : #(A * B) ≤ K * #B) : ∃ F ⊆ A, #F ≤ K ∧ A ⊆ F * (B / B) := by - haveI : ∀ F, Decidable ((F : Set G).PairwiseDisjoint (· • B)) := fun F ↦ Classical.dec _ + have : ∀ F, Decidable ((F : Set G).PairwiseDisjoint (· • B)) := fun F ↦ Classical.dec _ set C := {F ∈ A.powerset | (SetLike.coe F).PairwiseDisjoint (· • B)} obtain ⟨F, hFmax⟩ := C.exists_maximal <| filter_nonempty_iff.2 ⟨∅, empty_mem_powerset _, by simp [coe_empty]⟩ diff --git a/Mathlib/Combinatorics/Configuration.lean b/Mathlib/Combinatorics/Configuration.lean index 051a7cb6b3de49..8d730c597aa006 100644 --- a/Mathlib/Combinatorics/Configuration.lean +++ b/Mathlib/Combinatorics/Configuration.lean @@ -194,7 +194,7 @@ theorem HasLines.pointCount_le_lineCount [HasLines P L] {p : P} {l : L} (h : p [Finite { l : L // p ∈ l }] : pointCount P l ≤ lineCount L p := by by_cases hf : Infinite { p : P // p ∈ l } · simp [pointCount] - haveI := fintypeOfNotInfinite hf + have := fintypeOfNotInfinite hf cases nonempty_fintype { l : L // p ∈ l } rw [lineCount, pointCount, Nat.card_eq_fintype_card, Nat.card_eq_fintype_card] have : ∀ p' : { p // p ∈ l }, p ≠ p' := fun p' hp' => h ((congr_arg (· ∈ l) hp').mpr p'.2) @@ -289,8 +289,8 @@ noncomputable def HasLines.hasPoints [HasLines P L] [Fintype P] [Fintype L] let this : ∀ l₁ l₂ : L, l₁ ≠ l₂ → ∃ p : P, p ∈ l₁ ∧ p ∈ l₂ := fun l₁ l₂ hl => by classical obtain ⟨f, _, hf2⟩ := HasLines.exists_bijective_of_card_eq h - haveI : Nontrivial L := ⟨⟨l₁, l₂, hl⟩⟩ - haveI := Fintype.one_lt_card_iff_nontrivial.mp ((congr_arg _ h).mpr Fintype.one_lt_card) + have : Nontrivial L := ⟨⟨l₁, l₂, hl⟩⟩ + have := Fintype.one_lt_card_iff_nontrivial.mp ((congr_arg _ h).mpr Fintype.one_lt_card) have h₁ : ∀ p : P, 0 < lineCount L p := fun p => Exists.elim (exists_ne p) fun q hq => (congr_arg _ Nat.card_eq_fintype_card).mpr diff --git a/Mathlib/Combinatorics/Enumerative/IncidenceAlgebra.lean b/Mathlib/Combinatorics/Enumerative/IncidenceAlgebra.lean index ecfe13df569322..22b6f2466c672e 100644 --- a/Mathlib/Combinatorics/Enumerative/IncidenceAlgebra.lean +++ b/Mathlib/Combinatorics/Enumerative/IncidenceAlgebra.lean @@ -501,7 +501,7 @@ variable (𝕜) [Ring 𝕜] [PartialOrder α] [LocallyFiniteOrder α] [Decidable @[simp] lemma mu_toDual (a b : α) : mu 𝕜 (toDual a) (toDual b) = mu 𝕜 b a := by - letI : DecidableLE α := Classical.decRel _ + let : DecidableLE α := Classical.decRel _ let mud : IncidenceAlgebra 𝕜 αᵒᵈ := { toFun := fun a b ↦ mu 𝕜 (ofDual b) (ofDual a) eq_zero_of_not_le' := fun a b hab ↦ apply_eq_zero_of_not_le (by exact hab) _ } @@ -536,7 +536,7 @@ variable [Ring 𝕜] [PartialOrder α] [OrderTop α] [LocallyFiniteOrder α] [De O'Donnell. -/ lemma moebius_inversion_top (f g : α → 𝕜) (h : ∀ x, g x = ∑ y ∈ Ici x, f y) (x : α) : f x = ∑ y ∈ Ici x, mu 𝕜 x y * g y := by - letI : DecidableLE α := Classical.decRel _ + let : DecidableLE α := Classical.decRel _ symm calc ∑ y ∈ Ici x, mu 𝕜 x y * g y = ∑ y ∈ Ici x, mu 𝕜 x y * ∑ z ∈ Ici y, f z := by simp_rw [h] diff --git a/Mathlib/Combinatorics/Extremal/RuzsaSzemeredi.lean b/Mathlib/Combinatorics/Extremal/RuzsaSzemeredi.lean index 364d1fc78694b8..74801a7646491f 100644 --- a/Mathlib/Combinatorics/Extremal/RuzsaSzemeredi.lean +++ b/Mathlib/Combinatorics/Extremal/RuzsaSzemeredi.lean @@ -166,7 +166,7 @@ private lemma locallyLinear (hs : ThreeAPFree (s : Set α)) : private lemma card_edgeFinset (hs : ThreeAPFree (s : Set α)) [DecidableEq α] : #(graph <| triangleIndices s).edgeFinset = 3 * card α * #s := by - haveI := noAccidental hs + have := noAccidental hs rw [(locallyLinear hs).card_edgeFinset, card_triangles, card_triangleIndices, mul_assoc] end RuzsaSzemeredi @@ -176,7 +176,7 @@ variable (α) [Fintype α] [DecidableEq α] [CommRing α] [Fact <| IsUnit (2 : lemma addRothNumber_le_ruzsaSzemerediNumber : card α * addRothNumber (univ : Finset α) ≤ ruzsaSzemerediNumber (Sum α (Sum α α)) := by obtain ⟨s, -, hscard, hs⟩ := addRothNumber_spec (univ : Finset α) - haveI := noAccidental hs + have := noAccidental hs rw [← hscard, ← card_triangleIndices, ← card_triangles] exact (locallyLinear hs).le_ruzsaSzemerediNumber @@ -184,7 +184,7 @@ lemma rothNumberNat_le_ruzsaSzemerediNumberNat (n : ℕ) : (2 * n + 1) * rothNumberNat n ≤ ruzsaSzemerediNumberNat (6 * n + 3) := by let α := Fin (2 * n + 1) have : Nat.Coprime 2 (2 * n + 1) := by simp - haveI : Fact (IsUnit (2 : Fin (2 * n + 1))) := ⟨by simpa + have : Fact (IsUnit (2 : Fin (2 * n + 1))) := ⟨by simpa using! (ZMod.unitOfCoprime 2 this).isUnit⟩ open scoped Fin.CommRing in calc diff --git a/Mathlib/Combinatorics/Hall/Basic.lean b/Mathlib/Combinatorics/Hall/Basic.lean index 7d0a04f1b1a91b..df8abd2574ee75 100644 --- a/Mathlib/Combinatorics/Hall/Basic.lean +++ b/Mathlib/Combinatorics/Hall/Basic.lean @@ -120,10 +120,10 @@ theorem Finset.all_card_le_biUnion_card_iff_exists_injective {ι : Type u} {α : constructor · intro h -- Set up the functor - haveI : ∀ ι' : (Finset ι)ᵒᵖ, Nonempty ((hallMatchingsFunctor t).obj ι') := fun ι' => + have : ∀ ι' : (Finset ι)ᵒᵖ, Nonempty ((hallMatchingsFunctor t).obj ι') := fun ι' => hallMatchingsOn.nonempty t h ι'.unop classical - haveI : ∀ ι' : (Finset ι)ᵒᵖ, Finite ((hallMatchingsFunctor t).obj ι') := by + have : ∀ ι' : (Finset ι)ᵒᵖ, Finite ((hallMatchingsFunctor t).obj ι') := by intro ι' rw [hallMatchingsFunctor] infer_instance @@ -196,7 +196,7 @@ rather than `Rel.image`. theorem Fintype.all_card_le_filter_rel_iff_exists_injective {α : Type u} {β : Type v} [Fintype β] (r : α → β → Prop) [DecidableRel r] : (∀ A : Finset α, #A ≤ #{b | ∃ a ∈ A, r a b}) ↔ ∃ f : α → β, Injective f ∧ ∀ x, r x (f x) := by - haveI := Classical.decEq β + have := Classical.decEq β let r' a : Finset β := {b | r a b} have h : ∀ A : Finset α, ({b | ∃ a ∈ A, r a b} : Finset _) = A.biUnion r' := by intro A diff --git a/Mathlib/Combinatorics/Hall/Finite.lean b/Mathlib/Combinatorics/Hall/Finite.lean index 3bd50b4a414a08..12bc02d8426363 100644 --- a/Mathlib/Combinatorics/Hall/Finite.lean +++ b/Mathlib/Combinatorics/Hall/Finite.lean @@ -54,7 +54,7 @@ set_option backward.isDefEq.respectTransparency false in theorem hall_cond_of_erase {x : ι} (a : α) (ha : ∀ s : Finset ι, s.Nonempty → s ≠ univ → #s < #(s.biUnion t)) (s' : Finset { x' : ι | x' ≠ x }) : #s' ≤ #(s'.biUnion fun x' => (t x').erase a) := by - haveI := Classical.decEq ι + have := Classical.decEq ι specialize ha (s'.image fun z => z.1) rw [image_nonempty, Finset.card_image_of_injective s' Subtype.coe_injective] at ha by_cases! he : s'.Nonempty @@ -86,8 +86,8 @@ theorem hall_hard_inductive_step_A {n : ℕ} (hn : Fintype.card ι = n + 1) ∃ f : ι' → α, Function.Injective f ∧ ∀ x, f x ∈ t' x) (ha : ∀ s : Finset ι, s.Nonempty → s ≠ univ → #s < #(s.biUnion t)) : ∃ f : ι → α, Function.Injective f ∧ ∀ x, f x ∈ t x := by - haveI : Nonempty ι := Fintype.card_pos_iff.mp (hn.symm ▸ Nat.succ_pos _) - haveI := Classical.decEq ι + have : Nonempty ι := Fintype.card_pos_iff.mp (hn.symm ▸ Nat.succ_pos _) + have := Classical.decEq ι -- Choose an arbitrary element `x : ι` and `y : t x`. let x := Classical.arbitrary ι have tx_ne : (t x).Nonempty := by @@ -134,7 +134,7 @@ theorem hall_cond_of_restrict {ι : Type u} {t : ι → Finset α} {s : Finset theorem hall_cond_of_compl {ι : Type u} {t : ι → Finset α} {s : Finset ι} (hus : #s = #(s.biUnion t)) (ht : ∀ s : Finset ι, #s ≤ #(s.biUnion t)) (s' : Finset (sᶜ : Set ι)) : #s' ≤ #(s'.biUnion fun x' => t x' \ s.biUnion t) := by - haveI := Classical.decEq ι + have := Classical.decEq ι have disj : Disjoint s (s'.image fun z => z.1) := by simp only [disjoint_left, not_exists, mem_image, SetCoe.exists, exists_and_right, exists_eq_right] @@ -169,7 +169,7 @@ theorem hall_hard_inductive_step_B {n : ℕ} (hn : Fintype.card ι = n + 1) ∃ f : ι' → α, Function.Injective f ∧ ∀ x, f x ∈ t' x) (s : Finset ι) (hs : s.Nonempty) (hns : s ≠ univ) (hus : #s = #(s.biUnion t)) : ∃ f : ι → α, Function.Injective f ∧ ∀ x, f x ∈ t x := by - haveI := Classical.decEq ι + have := Classical.decEq ι -- Restrict to `s` rw [Nat.add_one] at hn have card_ι'_le : Fintype.card s ≤ n := by diff --git a/Mathlib/Combinatorics/Nullstellensatz.lean b/Mathlib/Combinatorics/Nullstellensatz.lean index 22bb48f127226e..5fc5d84d50ed2a 100644 --- a/Mathlib/Combinatorics/Nullstellensatz.lean +++ b/Mathlib/Combinatorics/Nullstellensatz.lean @@ -178,7 +178,7 @@ private lemma Alon.of_mem_P_support {ι : Type*} (i : ι) (S : Finset R) (m : ι rw [hP, support_rename_of_injective (Function.injective_of_subsingleton _)] at hm simp only [Finset.mem_image, mem_support_iff, ne_eq] at hm obtain ⟨e, he, hm⟩ := hm - haveI : Nontrivial R := nontrivial_of_ne _ _ he + have : Nontrivial R := nontrivial_of_ne _ _ he refine ⟨e (), ?_, ?_⟩ · suffices e ≼[lex] single () #S by simpa [MonomialOrder.lex_le_iff_of_unique] using this @@ -210,7 +210,7 @@ theorem combinatorial_nullstellensatz_exists_linearCombination ∃ (h : σ →₀ MvPolynomial σ R), (∀ i, ((∏ s ∈ S i, (X i - C s)) * h i).totalDegree ≤ f.totalDegree) ∧ f = linearCombination (MvPolynomial σ R) (fun i ↦ ∏ r ∈ S i, (X i - C r)) h := by - letI : LinearOrder σ := WellOrderingRel.isWellOrder.linearOrder + let : LinearOrder σ := WellOrderingRel.isWellOrder.linearOrder obtain ⟨h, r, hf, hh, hr⟩ := degLex.div (b := fun i ↦ Alon.P (S i) i) (fun i ↦ by simp only [(Alon.monic_P ..).leadingCoeff_eq_one, isUnit_one]) f use h diff --git a/Mathlib/Combinatorics/SimpleGraph/DegreeSum.lean b/Mathlib/Combinatorics/SimpleGraph/DegreeSum.lean index 3b62bb027300c8..fdd7d3948251ce 100644 --- a/Mathlib/Combinatorics/SimpleGraph/DegreeSum.lean +++ b/Mathlib/Combinatorics/SimpleGraph/DegreeSum.lean @@ -69,7 +69,7 @@ theorem dart_fst_fiber_card_eq_degree [DecidableEq V] (v : V) : card_image_of_injective univ (G.dartOfNeighborSet_injective v) theorem dart_card_eq_sum_degrees : Fintype.card G.Dart = ∑ v, G.degree v := by - haveI := Classical.decEq V + have := Classical.decEq V simp only [← card_univ, ← dart_fst_fiber_card_eq_degree] exact card_eq_sum_card_fiberwise (by simp) @@ -160,7 +160,7 @@ theorem odd_card_odd_degree_vertices_ne [Fintype V] [DecidableEq V] [DecidableRe theorem exists_ne_odd_degree_of_exists_odd_degree [Fintype V] [DecidableRel G.Adj] (v : V) (h : Odd (G.degree v)) : ∃ w : V, w ≠ v ∧ Odd (G.degree w) := by - haveI := Classical.decEq V + have := Classical.decEq V rcases G.odd_card_odd_degree_vertices_ne v h with ⟨k, hg⟩ have hg' : 0 < #{w | w ≠ v ∧ Odd (G.degree w)} := by rw [hg] diff --git a/Mathlib/Combinatorics/SimpleGraph/Finsubgraph.lean b/Mathlib/Combinatorics/SimpleGraph/Finsubgraph.lean index 41eeb98124fe6b..91a74d9b7585aa 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Finsubgraph.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Finsubgraph.lean @@ -156,9 +156,9 @@ theorem nonempty_hom_of_forall_finite_subgraph_hom [Finite W] -- Obtain a `Fintype` instance for `W`. cases nonempty_fintype W -- Establish the required interface instances. - haveI : ∀ G' : G.Finsubgraphᵒᵖ, Nonempty ((finsubgraphHomFunctor G F).obj G') := fun G' => + have : ∀ G' : G.Finsubgraphᵒᵖ, Nonempty ((finsubgraphHomFunctor G F).obj G') := fun G' => ⟨h G'.unop G'.unop.property⟩ - haveI : ∀ G' : G.Finsubgraphᵒᵖ, Fintype ((finsubgraphHomFunctor G F).obj G') := by + have : ∀ G' : G.Finsubgraphᵒᵖ, Fintype ((finsubgraphHomFunctor G F).obj G') := by intro G' haveI : Fintype (G'.unop.val.verts : Type u) := G'.unop.property.fintype haveI : Fintype (↥G'.unop.val.verts → W) := by classical exact Pi.instFintype diff --git a/Mathlib/Combinatorics/SimpleGraph/Matching.lean b/Mathlib/Combinatorics/SimpleGraph/Matching.lean index 376f0441c1051e..a6592bb1a4592d 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Matching.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Matching.lean @@ -309,7 +309,7 @@ lemma even_card_of_isPerfectMatching [Fintype V] [DecidableEq V] [DecidableRel G `[SetLike X], X → Set α → Sort _` are blocked by the discrimination tree. This can be fixed by redeclaring the instance for `X` using the double coercion but the proper fix seems to avoid the double coercion. -/ - letI : DecidablePred fun x ↦ x ∈ (M.induce c.supp).verts := fun a ↦ G.instDecidableMemSupp c a + let : DecidablePred fun x ↦ x ∈ (M.induce c.supp).verts := fun a ↦ G.instDecidableMemSupp c a have := (hM.induce_connectedComponent_isMatching c).even_card simp only [Subgraph.induce_verts, Set.toFinset_card] at this exact this @@ -331,9 +331,9 @@ lemma odd_matches_node_outside [Finite V] {u : Set V} and_true] at hv' ⊢ trivial apply Nat.not_even_iff_odd.2 c.prop - haveI : Fintype ↑(Subgraph.induce M (Subtype.val '' supp c.val)).verts := Fintype.ofFinite _ + have : Fintype ↑(Subgraph.induce M (Subtype.val '' supp c.val)).verts := Fintype.ofFinite _ classical - haveI := Fintype.ofFinite c.val.supp + have := Fintype.ofFinite c.val.supp simpa [Finset.card_image_of_injective] using hMmatch.even_card end Finite diff --git a/Mathlib/Combinatorics/SimpleGraph/Operations.lean b/Mathlib/Combinatorics/SimpleGraph/Operations.lean index 43932a8732e0b1..19ba94a37b0bfa 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Operations.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Operations.lean @@ -220,7 +220,7 @@ instance : Fintype (edge s t).edgeSet := by rw [edge]; infer_instance theorem edgeFinset_sup_edge [Fintype (edgeSet (G ⊔ edge s t))] (hn : ¬G.Adj s t) (h : s ≠ t) : (G ⊔ edge s t).edgeFinset = G.edgeFinset.cons s(s, t) (by simp_all) := by - letI := Classical.decEq V + let := Classical.decEq V rw [edgeFinset_sup, cons_eq_insert, insert_eq, union_comm] simp_rw [edgeFinset, edgeSet_edge_of_ne h]; rfl diff --git a/Mathlib/Combinatorics/SimpleGraph/Prod.lean b/Mathlib/Combinatorics/SimpleGraph/Prod.lean index 77766e4de029b2..6523376a74b33c 100644 --- a/Mathlib/Combinatorics/SimpleGraph/Prod.lean +++ b/Mathlib/Combinatorics/SimpleGraph/Prod.lean @@ -208,18 +208,18 @@ protected theorem Preconnected.ofBoxProdRight [Nonempty α] (h : (G □ H).Preco exact ⟨w.ofBoxProdRight⟩ protected theorem Connected.boxProd (hG : G.Connected) (hH : H.Connected) : (G □ H).Connected := by - haveI := hG.nonempty - haveI := hH.nonempty + have := hG.nonempty + have := hH.nonempty exact ⟨hG.preconnected.boxProd hH.preconnected⟩ protected theorem Connected.ofBoxProdLeft (h : (G □ H).Connected) : G.Connected := by - haveI := (nonempty_prod.1 h.nonempty).1 - haveI := (nonempty_prod.1 h.nonempty).2 + have := (nonempty_prod.1 h.nonempty).1 + have := (nonempty_prod.1 h.nonempty).2 exact ⟨h.preconnected.ofBoxProdLeft⟩ protected theorem Connected.ofBoxProdRight (h : (G □ H).Connected) : H.Connected := by - haveI := (nonempty_prod.1 h.nonempty).1 - haveI := (nonempty_prod.1 h.nonempty).2 + have := (nonempty_prod.1 h.nonempty).1 + have := (nonempty_prod.1 h.nonempty).2 exact ⟨h.preconnected.ofBoxProdRight⟩ @[simp] @@ -243,7 +243,7 @@ theorem neighborFinset_boxProd (x : α × β) (G.neighborFinset x.1 ×ˢ {x.2}).disjUnion ({x.1} ×ˢ H.neighborFinset x.2) (Finset.disjoint_product.mpr <| Or.inl <| neighborFinset_disjoint_singleton _ _) := by -- swap out the fintype instance for the canonical one - letI : Fintype ((G □ H).neighborSet x) := SimpleGraph.boxProdFintypeNeighborSet _ + let : Fintype ((G □ H).neighborSet x) := SimpleGraph.boxProdFintypeNeighborSet _ convert_to (G □ H).neighborFinset x = _ using 2 exact Eq.trans (Finset.map_map _ _ _) Finset.attach_map_val diff --git a/Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean b/Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean index bda19262960e8e..c4e84e9b3d8ae7 100644 --- a/Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean +++ b/Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean @@ -173,7 +173,7 @@ theorem IsSRGWith.param_eq {V : Type u} [Fintype V] (G : SimpleGraph V) [DecidableRel G.Adj] (h : G.IsSRGWith n k ℓ μ) (hn : 0 < n) : k * (k - ℓ - 1) = (n - k - 1) * μ := by - letI := Classical.decEq V + let := Classical.decEq V rw [← h.card, Fintype.card_pos_iff] at hn obtain ⟨v⟩ := hn convert! card_mul_eq_card_mul G.Adj (s := G.neighborFinset v) (t := Gᶜ.neighborFinset v) _ _ diff --git a/Mathlib/Combinatorics/SimpleGraph/UniversalVerts.lean b/Mathlib/Combinatorics/SimpleGraph/UniversalVerts.lean index 79107f325d24c5..730fae530d9c62 100644 --- a/Mathlib/Combinatorics/SimpleGraph/UniversalVerts.lean +++ b/Mathlib/Combinatorics/SimpleGraph/UniversalVerts.lean @@ -52,7 +52,7 @@ lemma Subgraph.IsMatching.exists_of_universalVerts [Finite V] {s : Set V} refine ⟨t, ht.1, ?_⟩ obtain ⟨f⟩ : Nonempty (s ≃ t) := by rw [← Cardinal.eq, ← t.cast_ncard t.toFinite, ← s.cast_ncard s.toFinite, ht.2] - letI hd := Set.disjoint_of_subset_left ht.1 h + let hd := Set.disjoint_of_subset_left ht.1 h have hadj (v : s) : G.Adj v (f v) := ht.1 (f v).2 (hd.ne_of_mem (f v).2 v.2) |>.symm exact Subgraph.IsMatching.exists_of_disjoint_sets_of_equiv hd.symm f hadj diff --git a/Mathlib/Computability/Primrec/Basic.lean b/Mathlib/Computability/Primrec/Basic.lean index f120385f6f3f83..54aec2d4fd1113 100644 --- a/Mathlib/Computability/Primrec/Basic.lean +++ b/Mathlib/Computability/Primrec/Basic.lean @@ -683,7 +683,7 @@ theorem list_idxOf₁ [DecidableEq α] (l : List α) : Primrec fun a => l.idxOf theorem dom_finite [Finite α] (f : α → σ) : Primrec f := let ⟨l, _, m⟩ := Finite.exists_univ_list α option_some_iff.1 <| by - haveI := decidableEqOfEncodable α + have := decidableEqOfEncodable α refine ((list_getElem?₁ (l.map f)).comp (list_idxOf₁ l)).of_eq fun a => ?_ rw [List.getElem?_map, List.getElem?_idxOf (m a), Option.map_some] @@ -857,14 +857,14 @@ variable [Primcodable α] [Primcodable β] [Primcodable σ] theorem subtype_val {p : α → Prop} [DecidablePred p] {hp : PrimrecPred p} : haveI := Primcodable.subtype hp Primrec (@Subtype.val α p) := by - letI := Primcodable.subtype hp + let := Primcodable.subtype hp refine (Primcodable.prim (Subtype p)).of_eq fun n => ?_ rcases @decode (Subtype p) _ n with (_ | ⟨a, h⟩) <;> rfl theorem subtype_val_iff {p : β → Prop} [DecidablePred p] {hp : PrimrecPred p} {f : α → Subtype p} : haveI := Primcodable.subtype hp (Primrec fun a => (f a).1) ↔ Primrec f := by - letI := Primcodable.subtype hp + let := Primcodable.subtype hp refine ⟨fun h => ?_, fun hf => subtype_val.comp hf⟩ refine Nat.Primrec.of_eq h fun n => ?_ rcases @decode α _ n with - | a; · rfl @@ -892,7 +892,7 @@ theorem ulower_up : Primrec (ULower.up : ULower α → α) := option_get (Primrec.decode₂.comp (subtype_val (hp := Primcodable.mem_range_encode))) theorem fin_val_iff {n} {f : α → Fin n} : (Primrec fun a => (f a).1) ↔ Primrec f := by - letI : Primcodable { a // a < n } := Primcodable.subtype (nat_lt.comp .id (const _)) + let : Primcodable { a // a < n } := Primcodable.subtype (nat_lt.comp .id (const _)) exact (Iff.trans (by rfl) subtype_val_iff).trans (of_equiv_iff _) theorem fin_val {n} : Primrec (fun (i : Fin n) => (i : ℕ)) := diff --git a/Mathlib/Computability/Primrec/List.lean b/Mathlib/Computability/Primrec/List.lean index d27fe68baba292..1149e4f5cb9e22 100644 --- a/Mathlib/Computability/Primrec/List.lean +++ b/Mathlib/Computability/Primrec/List.lean @@ -55,7 +55,7 @@ set_option backward.privateInPublic true in private theorem list_foldl' {f : α → List β} {g : α → σ} {h : α → σ × β → σ} (hf : haveI := prim H; Primrec f) (hg : Primrec g) (hh : haveI := prim H; Primrec₂ h) : Primrec fun a => (f a).foldl (fun s b => h a (s, b)) (g a) := by - letI := prim H + let := prim H let G (a : α) (IH : σ × List β) : σ × List β := List.casesOn IH.2 IH fun b l => (h a (IH.1, b), l) have hG : Primrec₂ G := list_casesOn' H (snd.comp snd) snd <| to₂ <| @@ -306,7 +306,7 @@ theorem nat_omega_rec' (f : β → σ) {m : β → ℕ} {l : β → List β} {g (hm : Primrec m) (hl : Primrec l) (hg : Primrec₂ g) (Ord : ∀ b, ∀ b' ∈ l b, m b' < m b) (H : ∀ b, g b ((l b).map f) = some (f b)) : Primrec f := by - haveI : DecidableEq β := Encodable.decidableEqOfEncodable β + have : DecidableEq β := Encodable.decidableEqOfEncodable β let mapGraph (M : List (β × σ)) (bs : List β) : List σ := bs.flatMap (Option.toList <| M.lookup ·) let bindList (b : β) : ℕ → List β := fun n ↦ n.rec [b] fun _ bs ↦ bs.flatMap l let graph (b : β) : ℕ → List (β × σ) := fun i ↦ i.rec [] fun i ih ↦ diff --git a/Mathlib/Computability/TuringMachine/PostTuringMachine.lean b/Mathlib/Computability/TuringMachine/PostTuringMachine.lean index e0d80394355756..5d510545c4cbba 100644 --- a/Mathlib/Computability/TuringMachine/PostTuringMachine.lean +++ b/Mathlib/Computability/TuringMachine/PostTuringMachine.lean @@ -635,7 +635,7 @@ theorem exists_enc_dec [Inhabited Γ] [Finite Γ] : ∃ (n : ℕ) (enc : Γ → List.Vector Bool n) (dec : List.Vector Bool n → Γ), enc default = List.Vector.replicate n false ∧ ∀ a, dec (enc a) = a := by rcases Finite.exists_equiv_fin Γ with ⟨n, ⟨e⟩⟩ - letI : DecidableEq Γ := e.decidableEq + let : DecidableEq Γ := e.decidableEq let G : Fin n ↪ Fin n → Bool := ⟨fun a b ↦ a = b, fun a b h ↦ Bool.of_decide_true <| (congr_fun h b).trans <| Bool.decide_true rfl⟩ diff --git a/Mathlib/Condensed/Discrete/Characterization.lean b/Mathlib/Condensed/Discrete/Characterization.lean index 4ec71ead5d9179..50046d821d15f9 100644 --- a/Mathlib/Condensed/Discrete/Characterization.lean +++ b/Mathlib/Condensed/Discrete/Characterization.lean @@ -148,13 +148,13 @@ theorem isDiscrete_tfae (M : CondensedMod.{u} R) : intro h rw [isDiscrete_iff_isDiscrete_forget, ((CondensedSet.isDiscrete_tfae _).out 0 6 :)] intro S - letI : PreservesFilteredColimitsOfSize.{u, u} (forget (ModuleCat R)) := + let : PreservesFilteredColimitsOfSize.{u, u} (forget (ModuleCat R)) := preservesFilteredColimitsOfSize_shrink.{u, u + 1, u, u + 1} _ exact ⟨isColimitOfPreserves (forget (ModuleCat R)) (h S).some⟩ tfae_have 1 → 7 := by intro h S rw [isDiscrete_iff_isDiscrete_forget, ((CondensedSet.isDiscrete_tfae _).out 0 6 :)] at h - letI : ReflectsFilteredColimitsOfSize.{u, u} (forget (ModuleCat R)) := + let : ReflectsFilteredColimitsOfSize.{u, u} (forget (ModuleCat R)) := reflectsFilteredColimitsOfSize_shrink.{u, u + 1, u, u + 1} _ exact ⟨isColimitOfReflects (forget (ModuleCat R)) (h S).some⟩ tfae_finish @@ -252,13 +252,13 @@ theorem isDiscrete_tfae (M : LightCondMod.{u} R) : intro h rw [isDiscrete_iff_isDiscrete_forget, ((LightCondSet.isDiscrete_tfae _).out 0 5 :)] intro S - letI : PreservesFilteredColimitsOfSize.{0, 0} (forget (ModuleCat R)) := + let : PreservesFilteredColimitsOfSize.{0, 0} (forget (ModuleCat R)) := preservesFilteredColimitsOfSize_shrink.{0, u, 0, u} _ exact ⟨isColimitOfPreserves (forget (ModuleCat R)) (h S).some⟩ tfae_have 1 → 6 := by intro h S rw [isDiscrete_iff_isDiscrete_forget, ((LightCondSet.isDiscrete_tfae _).out 0 5 :)] at h - letI : ReflectsFilteredColimitsOfSize.{0, 0} (forget (ModuleCat R)) := + let : ReflectsFilteredColimitsOfSize.{0, 0} (forget (ModuleCat R)) := reflectsFilteredColimitsOfSize_shrink.{0, u, 0, u} _ exact ⟨isColimitOfReflects (forget (ModuleCat R)) (h S).some⟩ tfae_finish diff --git a/Mathlib/Condensed/Discrete/LocallyConstant.lean b/Mathlib/Condensed/Discrete/LocallyConstant.lean index aeadb3ecb9f5d6..243892767a9913 100644 --- a/Mathlib/Condensed/Discrete/LocallyConstant.lean +++ b/Mathlib/Condensed/Discrete/LocallyConstant.lean @@ -350,7 +350,7 @@ noncomputable def adjunction [HasExplicitFiniteCoproducts.{u} P] : ext (x : X.obj.obj _) dsimp have := CompHausLike.preregular hs - letI : PreservesFiniteProducts ((sheafToPresheaf (coherentTopology _) _).obj X) := + let : PreservesFiniteProducts ((sheafToPresheaf (coherentTopology _) _).obj X) := inferInstanceAs (PreservesFiniteProducts X.obj) apply presheaf_ext ((unit P hs).app _ x) intro a diff --git a/Mathlib/Data/Analysis/Topology.lean b/Mathlib/Data/Analysis/Topology.lean index 8af8bb6e22b76f..bb9c59b9a76c52 100644 --- a/Mathlib/Data/Analysis/Topology.lean +++ b/Mathlib/Data/Analysis/Topology.lean @@ -135,7 +135,7 @@ theorem isClosed_iff [TopologicalSpace α] (F : Realizer α) {s : Set α} : F.isOpen_iff.trans <| forall_congr' fun a ↦ show (a ∉ s → ∃ b : F.σ, a ∈ F.F b ∧ ∀ z ∈ F.F b, z ∉ s) ↔ _ by - haveI := Classical.propDecidable; rw [not_imp_comm] + have := Classical.propDecidable; rw [not_imp_comm] simp [not_exists, not_and, not_forall, and_comm] theorem mem_interior_iff [TopologicalSpace α] (F : Realizer α) {s : Set α} {a : α} : diff --git a/Mathlib/Data/DFinsupp/Defs.lean b/Mathlib/Data/DFinsupp/Defs.lean index feccf9203b85e9..eeb6c9478f63da 100644 --- a/Mathlib/Data/DFinsupp/Defs.lean +++ b/Mathlib/Data/DFinsupp/Defs.lean @@ -884,7 +884,7 @@ instance decidableZero [∀ (i) (x : β i), Decidable (x = 0)] (f : Π₀ i, β case mp => intro hs₁; ext i -- This instance prevent consuming `DecidableEq ι` in the next `by_cases`. - letI := Classical.propDecidable + let := Classical.propDecidable by_cases hs₂ : i ∈ s.val case pos => exact hs₁ _ hs₂ case neg => exact (s.prop i).resolve_left hs₂ diff --git a/Mathlib/Data/DFinsupp/FiniteInfinite.lean b/Mathlib/Data/DFinsupp/FiniteInfinite.lean index a1efaa0e13f44d..f87d0596508b63 100644 --- a/Mathlib/Data/DFinsupp/FiniteInfinite.lean +++ b/Mathlib/Data/DFinsupp/FiniteInfinite.lean @@ -34,7 +34,7 @@ instance DFinsupp.fintype {ι : Sort _} {π : ι → Sort _} [DecidableEq ι] [ instance DFinsupp.infinite_of_left {ι : Sort _} {π : ι → Sort _} [∀ i, Nontrivial (π i)] [∀ i, Zero (π i)] [Infinite ι] : Infinite (Π₀ i, π i) := by - letI := Classical.decEq ι; choose m hm using fun i => exists_ne (0 : π i) + let := Classical.decEq ι; choose m hm using fun i => exists_ne (0 : π i) exact Infinite.of_injective _ (DFinsupp.single_left_injective hm) /-- See `DFinsupp.infinite_of_right` for this in instance form, with the drawback that diff --git a/Mathlib/Data/DFinsupp/WellFounded.lean b/Mathlib/Data/DFinsupp/WellFounded.lean index 9826cab5551827..811b6320f24fe2 100644 --- a/Mathlib/Data/DFinsupp/WellFounded.lean +++ b/Mathlib/Data/DFinsupp/WellFounded.lean @@ -189,8 +189,8 @@ theorem Pi.Lex.wellFounded [IsStrictTotalOrder ι r] [Finite ι] (hs : ∀ i, We WellFounded (Pi.Lex r (fun {i} ↦ s i)) := by obtain h | ⟨⟨x⟩⟩ := isEmpty_or_nonempty (∀ i, α i) · convert! emptyWf.wf - letI : ∀ i, Zero (α i) := fun i => ⟨(hs i).min ⊤ ⟨x i, trivial⟩⟩ - haveI := Fintype.ofFinite ι + let : ∀ i, Zero (α i) := fun i => ⟨(hs i).min ⊤ ⟨x i, trivial⟩⟩ + have := Fintype.ofFinite ι refine InvImage.wf equivFunOnFintype.symm (Lex.wellFounded' (fun i a => ?_) hs ?_) exacts [(hs i).not_lt_min ⊤ trivial, Finite.wellFounded_of_trans_of_irrefl (Function.swap r)] @@ -246,8 +246,8 @@ instance Pi.wellFoundedLT [Finite ι] [∀ i, Preorder (α i)] [hw : ∀ i, Well ⟨by obtain h | ⟨⟨x⟩⟩ := isEmpty_or_nonempty (∀ i, α i) · convert! emptyWf.wf - letI : ∀ i, Zero (α i) := fun i => ⟨(hw i).wf.min ⊤ ⟨x i, trivial⟩⟩ - haveI := Fintype.ofFinite ι + let : ∀ i, Zero (α i) := fun i => ⟨(hw i).wf.min ⊤ ⟨x i, trivial⟩⟩ + have := Fintype.ofFinite ι refine InvImage.wf equivFunOnFintype.symm (DFinsupp.wellFoundedLT fun i a => ?_).wf exact (hw i).wf.not_lt_min ⊤ trivial⟩ diff --git a/Mathlib/Data/ENNReal/Operations.lean b/Mathlib/Data/ENNReal/Operations.lean index 6b159c27b59719..188771aeb1a05e 100644 --- a/Mathlib/Data/ENNReal/Operations.lean +++ b/Mathlib/Data/ENNReal/Operations.lean @@ -644,7 +644,7 @@ lemma iSup_add [Nonempty ι] (f : ι → ℝ≥0∞) : (⨆ i, f i) + a = ⨆ i, lemma add_biSup' {p : ι → Prop} (h : ∃ i, p i) (f : ι → ℝ≥0∞) : a + ⨆ i, ⨆ _ : p i, f i = ⨆ i, ⨆ _ : p i, a + f i := by - haveI : Nonempty {i // p i} := nonempty_subtype.2 h + have : Nonempty {i // p i} := nonempty_subtype.2 h simp only [iSup_subtype', add_iSup] lemma biSup_add' {p : ι → Prop} (h : ∃ i, p i) (f : ι → ℝ≥0∞) : diff --git a/Mathlib/Data/ENat/Lattice.lean b/Mathlib/Data/ENat/Lattice.lean index b01e851d604887..ded4493d69fee1 100644 --- a/Mathlib/Data/ENat/Lattice.lean +++ b/Mathlib/Data/ENat/Lattice.lean @@ -195,7 +195,7 @@ lemma iSup_add [Nonempty ι] (f : ι → ℕ∞) : (⨆ i, f i) + a = ⨆ i, f i lemma add_biSup' {p : ι → Prop} (h : ∃ i, p i) (f : ι → ℕ∞) : a + ⨆ i, ⨆ _ : p i, f i = ⨆ i, ⨆ _ : p i, a + f i := by - haveI : Nonempty {i // p i} := nonempty_subtype.2 h + have : Nonempty {i // p i} := nonempty_subtype.2 h simp only [iSup_subtype', add_iSup] lemma biSup_add' {p : ι → Prop} (h : ∃ i, p i) (f : ι → ℕ∞) : diff --git a/Mathlib/Data/Fin/Tuple/BubbleSortInduction.lean b/Mathlib/Data/Fin/Tuple/BubbleSortInduction.lean index 34f9abdd539be6..e52150e65f7b90 100644 --- a/Mathlib/Data/Fin/Tuple/BubbleSortInduction.lean +++ b/Mathlib/Data/Fin/Tuple/BubbleSortInduction.lean @@ -40,7 +40,7 @@ theorem bubble_sort_induction' {n : ℕ} {α : Type*} [LinearOrder α] {f : Fin (h : ∀ (σ : Equiv.Perm (Fin n)) (i j : Fin n), i < j → (f ∘ σ) j < (f ∘ σ) i → P (f ∘ σ) → P (f ∘ σ ∘ Equiv.swap i j)) : P (f ∘ sort f) := by - letI := @Preorder.lift _ (Lex (Fin n → α)) _ fun σ : Equiv.Perm (Fin n) => toLex (f ∘ σ) + let := @Preorder.lift _ (Lex (Fin n → α)) _ fun σ : Equiv.Perm (Fin n) => toLex (f ∘ σ) refine @WellFounded.induction_bot' _ _ _ (IsWellFounded.wf : WellFounded (· < ·)) (Equiv.refl _) (sort f) P (fun σ => f ∘ σ) (fun σ hσ hfσ => ?_) hf diff --git a/Mathlib/Data/Finite/Prod.lean b/Mathlib/Data/Finite/Prod.lean index 7b421a871790c3..50cf574e7cb635 100644 --- a/Mathlib/Data/Finite/Prod.lean +++ b/Mathlib/Data/Finite/Prod.lean @@ -25,8 +25,8 @@ variable {α β : Type*} namespace Finite instance [Finite α] [Finite β] : Finite (α × β) := by - haveI := Fintype.ofFinite α - haveI := Fintype.ofFinite β + have := Fintype.ofFinite α + have := Fintype.ofFinite β infer_instance instance {α β : Sort*} [Finite α] [Finite β] : Finite (PProd α β) := @@ -47,8 +47,8 @@ lemma Prod.finite_iff [Nonempty α] [Nonempty β] : Finite (α × β) ↔ Finite instance Pi.finite {α : Sort*} {β : α → Sort*} [Finite α] [∀ a, Finite (β a)] : Finite (∀ a, β a) := by classical - haveI := Fintype.ofFinite (PLift α) - haveI := fun a => Fintype.ofFinite (PLift (β a)) + have := Fintype.ofFinite (PLift α) + have := fun a => Fintype.ofFinite (PLift (β a)) exact Finite.of_equiv (∀ a : PLift α, PLift (β (Equiv.plift a))) (Equiv.piCongr Equiv.plift fun _ => Equiv.plift) @@ -57,7 +57,7 @@ instance Function.Embedding.finite {α β : Sort*} [Finite β] : Finite (α ↪ rcases isEmpty_or_nonempty (α ↪ β) with _ | h · infer_instance · refine h.elim fun f => ?_ - haveI : Finite α := Finite.of_injective _ f.injective + have : Finite α := Finite.of_injective _ f.injective exact Finite.of_injective _ DFunLike.coe_injective instance Equiv.finite_right {α β : Sort*} [Finite β] : Finite (α ≃ β) := diff --git a/Mathlib/Data/Finite/Sigma.lean b/Mathlib/Data/Finite/Sigma.lean index b9c65110831698..256c3465df9a6a 100644 --- a/Mathlib/Data/Finite/Sigma.lean +++ b/Mathlib/Data/Finite/Sigma.lean @@ -19,8 +19,8 @@ variable {α : Type*} namespace Finite instance {β : α → Type*} [Finite α] [∀ a, Finite (β a)] : Finite (Σ a, β a) := by - letI := Fintype.ofFinite α - letI := fun a => Fintype.ofFinite (β a) + let := Fintype.ofFinite α + let := fun a => Fintype.ofFinite (β a) infer_instance instance {ι : Sort*} {π : ι → Sort*} [Finite ι] [∀ i, Finite (π i)] : Finite (Σ' i, π i) := diff --git a/Mathlib/Data/Finite/Sum.lean b/Mathlib/Data/Finite/Sum.lean index 62f7e64b2e818d..674e91adacfcb6 100644 --- a/Mathlib/Data/Finite/Sum.lean +++ b/Mathlib/Data/Finite/Sum.lean @@ -18,8 +18,8 @@ variable {α β : Type*} namespace Finite instance [Finite α] [Finite β] : Finite (α ⊕ β) := by - haveI := Fintype.ofFinite α - haveI := Fintype.ofFinite β + have := Fintype.ofFinite α + have := Fintype.ofFinite β infer_instance theorem sum_left (β) [Finite (α ⊕ β)] : Finite α := diff --git a/Mathlib/Data/Finite/Vector.lean b/Mathlib/Data/Finite/Vector.lean index d7aceb37ae1446..045144d62cebb7 100644 --- a/Mathlib/Data/Finite/Vector.lean +++ b/Mathlib/Data/Finite/Vector.lean @@ -16,10 +16,10 @@ public section variable {α : Type*} instance List.Vector.finite [Finite α] {n : ℕ} : Finite (Vector α n) := by - haveI := Fintype.ofFinite α + have := Fintype.ofFinite α infer_instance instance [Finite α] {n : ℕ} : Finite (Sym α n) := by classical - haveI := Fintype.ofFinite α + have := Fintype.ofFinite α infer_instance diff --git a/Mathlib/Data/Finset/Fold.lean b/Mathlib/Data/Finset/Fold.lean index 29130f8c9aca33..16aa414d5ab191 100644 --- a/Mathlib/Data/Finset/Fold.lean +++ b/Mathlib/Data/Finset/Fold.lean @@ -116,7 +116,7 @@ theorem fold_image_idem [DecidableEq α] {g : γ → α} {s : Finset γ} [hi : S induction s using Finset.cons_induction with | empty => rw [fold_empty, image_empty, fold_empty] | cons x xs hx ih => - haveI := Classical.decEq γ + have := Classical.decEq γ rw [fold_cons, cons_eq_insert, image_insert, fold_insert_idem, ih] simp only [Function.comp_apply] diff --git a/Mathlib/Data/Finset/Image.lean b/Mathlib/Data/Finset/Image.lean index bb0fd4f4d7885c..bd611c05839777 100644 --- a/Mathlib/Data/Finset/Image.lean +++ b/Mathlib/Data/Finset/Image.lean @@ -688,7 +688,7 @@ theorem subset_set_image_iff [DecidableEq β] {s : Set α} {t : Finset β} {f : ↑t ⊆ f '' s ↔ ∃ s' : Finset α, ↑s' ⊆ s ∧ s'.image f = t := by constructor · intro h - letI : CanLift β s (f ∘ (↑)) fun y => y ∈ f '' s := ⟨fun y ⟨x, hxt, hy⟩ => ⟨⟨x, hxt⟩, hy⟩⟩ + let : CanLift β s (f ∘ (↑)) fun y => y ∈ f '' s := ⟨fun y ⟨x, hxt, hy⟩ => ⟨⟨x, hxt⟩, hy⟩⟩ lift t to Finset s using h refine ⟨t.map (Embedding.subtype _), map_subtype_subset _, ?_⟩ ext y; simp diff --git a/Mathlib/Data/Finset/Lattice/Fold.lean b/Mathlib/Data/Finset/Lattice/Fold.lean index 6b25b519cddedc..d16bab002decea 100644 --- a/Mathlib/Data/Finset/Lattice/Fold.lean +++ b/Mathlib/Data/Finset/Lattice/Fold.lean @@ -193,8 +193,8 @@ theorem sup_coe {P : α → Prop} {Pbot : P ⊥} {Psup : ∀ ⦃x y⦄, P x → letI := Subtype.semilatticeSup Psup letI := Subtype.orderBot Pbot (t.sup f).val = t.sup fun x => ↑(f x) := by - letI := Subtype.semilatticeSup Psup - letI := Subtype.orderBot Pbot + let := Subtype.semilatticeSup Psup + let := Subtype.orderBot Pbot apply apply_sup_eq_sup_comp Subtype.val <;> intros <;> rfl @[simp] @@ -771,7 +771,7 @@ theorem map_finset_sup [DecidableEq α] [DecidableEq β] (s : Finset γ) (f : γ theorem count_finset_sup [DecidableEq β] (s : Finset α) (f : α → Multiset β) (b : β) : count b (s.sup f) = s.sup fun a => count b (f a) := by - letI := Classical.decEq α + let := Classical.decEq α refine s.induction ?_ ?_ · exact count_zero _ · intro i s _ ih diff --git a/Mathlib/Data/Finset/Preimage.lean b/Mathlib/Data/Finset/Preimage.lean index ce8b341335b897..b84ccb84d821d5 100644 --- a/Mathlib/Data/Finset/Preimage.lean +++ b/Mathlib/Data/Finset/Preimage.lean @@ -156,7 +156,7 @@ lemma sup_preimage_val_id [Lattice α] [OrderBot α] {P : α → Prop} letI := Subtype.orderBot Pbot (t.preimage Subtype.val Subtype.val_injective.injOn).sup id = (⟨t.sup id, sup_induction Pbot (fun _ h _ => Psup h) ht⟩ : Subtype P) := by - letI : OrderBot (Subtype P) := Subtype.orderBot Pbot + let : OrderBot (Subtype P) := Subtype.orderBot Pbot ext simp only [sup_coe, id_eq] apply sup_preimage_self diff --git a/Mathlib/Data/Finset/Slice.lean b/Mathlib/Data/Finset/Slice.lean index 8f693aee928be5..7a146bd63ee4f4 100644 --- a/Mathlib/Data/Finset/Slice.lean +++ b/Mathlib/Data/Finset/Slice.lean @@ -148,7 +148,7 @@ theorem biUnion_slice [DecidableEq α] : (Iic <| Fintype.card α).biUnion 𝒜.s @[simp] theorem sum_card_slice : ∑ r ∈ Iic (Fintype.card α), #(𝒜 # r) = #𝒜 := by - letI := Classical.decEq α + let := Classical.decEq α rw [← card_biUnion, biUnion_slice] exact Finset.pairwiseDisjoint_slice.subset (Set.subset_univ _) diff --git a/Mathlib/Data/Finset/Sort.lean b/Mathlib/Data/Finset/Sort.lean index 90932d88a4603e..438ad29e01cf7e 100644 --- a/Mathlib/Data/Finset/Sort.lean +++ b/Mathlib/Data/Finset/Sort.lean @@ -350,7 +350,7 @@ def Fintype.orderIsoFinOfCardEq lemma nonempty_orderEmbedding_of_finite_infinite (α : Type*) [LinearOrder α] [hα : Finite α] (β : Type*) [LinearOrder β] [hβ : Infinite β] : Nonempty (α ↪o β) := by - haveI := Fintype.ofFinite α + have := Fintype.ofFinite α obtain ⟨s, hs⟩ := Infinite.exists_subset_card_eq β (Fintype.card α) exact ⟨((Fintype.orderIsoFinOfCardEq α rfl).symm.toOrderEmbedding).trans (s.orderEmbOfFin hs)⟩ diff --git a/Mathlib/Data/Fintype/CardEmbedding.lean b/Mathlib/Data/Fintype/CardEmbedding.lean index 08e24c7ad64839..a73e45ac82c8f3 100644 --- a/Mathlib/Data/Fintype/CardEmbedding.lean +++ b/Mathlib/Data/Fintype/CardEmbedding.lean @@ -42,7 +42,7 @@ theorem card_embedding_eq {α β : Type*} [Fintype α] [Fintype β] [emb : Finty rw [Subsingleton.elim emb Embedding.fintype] refine Fintype.induction_empty_option (P := fun t ↦ ‖t ↪ β‖ = ‖β‖.descFactorial ‖t‖) (fun α₁ α₂ h₂ e ih ↦ ?_) (?_) (fun γ h ih ↦ ?_) α <;> clear! α - · letI := Fintype.ofEquiv _ e.symm + · let := Fintype.ofEquiv _ e.symm rw [← card_congr (Equiv.embeddingCongr e (Equiv.refl β)), ih, card_congr e] · rw [card_pempty, Nat.descFactorial_zero, card_eq_one_iff] exact ⟨Embedding.ofIsEmpty, fun x ↦ DFunLike.ext _ _ isEmptyElim⟩ diff --git a/Mathlib/Data/Fintype/EquivFin.lean b/Mathlib/Data/Fintype/EquivFin.lean index 5d004ad9f28f5f..00976b3e45105a 100644 --- a/Mathlib/Data/Fintype/EquivFin.lean +++ b/Mathlib/Data/Fintype/EquivFin.lean @@ -535,7 +535,7 @@ set_option backward.privateInPublic true in private theorem natEmbeddingAux_injective (α : Type*) [Infinite α] : Function.Injective (natEmbeddingAux α) := by rintro m n h - letI := Classical.decEq α + let := Classical.decEq α wlog hmlen : m ≤ n generalizing m n · exact (this h.symm <| le_of_not_ge hmlen).symm by_contra hmn diff --git a/Mathlib/Data/Fintype/Pi.lean b/Mathlib/Data/Fintype/Pi.lean index ff970b9c1b4ac9..e04e7d7d844da2 100644 --- a/Mathlib/Data/Fintype/Pi.lean +++ b/Mathlib/Data/Fintype/Pi.lean @@ -103,7 +103,7 @@ lemma eval_image_piFinset (t : ∀ a, Finset (δ a)) (a : α) [DecidableEq (δ a lemma eval_image_piFinset_const {β} [DecidableEq β] (t : Finset β) (a : α) : ((piFinset fun _i : α ↦ t).image fun f ↦ f a) = t := by obtain rfl | ht := t.eq_empty_or_nonempty - · haveI : Nonempty α := ⟨a⟩ + · have : Nonempty α := ⟨a⟩ simp · exact eval_image_piFinset (fun _ ↦ t) a fun _ _ ↦ ht diff --git a/Mathlib/Data/Fintype/Prod.lean b/Mathlib/Data/Fintype/Prod.lean index af15f7d4eba125..3af498bdeb3901 100644 --- a/Mathlib/Data/Fintype/Prod.lean +++ b/Mathlib/Data/Fintype/Prod.lean @@ -70,7 +70,7 @@ theorem infinite_prod : Infinite (α × β) ↔ Infinite α ∧ Nonempty β ∨ H.elim (and_imp.2 <| @Prod.infinite_of_left α β) (and_imp.2 <| @Prod.infinite_of_right α β)⟩ rw [and_comm] rcases Infinite.nonempty (α × β) with ⟨a, b⟩ - contrapose! H; haveI := H.1 ⟨b⟩; haveI := H.2 ⟨a⟩ + contrapose! H; have := H.1 ⟨b⟩; have := H.2 ⟨a⟩ infer_instance instance Pi.infinite_of_left {ι : Sort*} {π : ι → Type*} [∀ i, Nontrivial <| π i] [Infinite ι] : diff --git a/Mathlib/Data/Holor.lean b/Mathlib/Data/Holor.lean index 0e22f8fdc84e3d..b7475620ba7423 100644 --- a/Mathlib/Data/Holor.lean +++ b/Mathlib/Data/Holor.lean @@ -218,7 +218,7 @@ theorem slice_zero [Zero α] (i : ℕ) (hid : i < d) : slice (0 : Holor α (d :: theorem slice_sum [AddCommMonoid α] {β : Type} (i : ℕ) (hid : i < d) (s : Finset β) (f : β → Holor α (d :: ds)) : (∑ x ∈ s, slice (f x) i hid) = slice (∑ x ∈ s, f x) i hid := by - letI := Classical.decEq β + let := Classical.decEq β refine Finset.induction_on s ?_ ?_ · simp [slice_zero] · intro _ _ h_not_in ih diff --git a/Mathlib/Data/Int/ModEq.lean b/Mathlib/Data/Int/ModEq.lean index 2af03e37ca02ab..af9eb4fd26e2d1 100644 --- a/Mathlib/Data/Int/ModEq.lean +++ b/Mathlib/Data/Int/ModEq.lean @@ -207,7 +207,7 @@ lemma of_mul_right (m : ℤ) : a ≡ b [ZMOD n * m] → a ≡ b [ZMOD n] := /-- To cancel a common factor `c` from a `ModEq` we must divide the modulus `m` by `gcd m c`. -/ theorem cancel_right_div_gcd (hm : 0 < m) (h : a * c ≡ b * c [ZMOD m]) : a ≡ b [ZMOD m / gcd m c] := by - letI d := gcd m c + let d := gcd m c rw [modEq_iff_dvd] at h ⊢ refine Int.dvd_of_dvd_mul_right_of_gcd_one (?_ : m / d ∣ c / d * (b - a)) ?_ · rw [mul_comm, ← Int.mul_ediv_assoc (b - a) (gcd_dvd_right ..), Int.sub_mul] diff --git a/Mathlib/Data/List/AList.lean b/Mathlib/Data/List/AList.lean index 69b8bcdd3809c6..25f3e41c871cf4 100644 --- a/Mathlib/Data/List/AList.lean +++ b/Mathlib/Data/List/AList.lean @@ -172,7 +172,7 @@ end theorem keys_subset_keys_of_entries_subset_entries {s₁ s₂ : AList β} (h : s₁.entries ⊆ s₂.entries) : s₁.keys ⊆ s₂.keys := by intro k hk - letI : DecidableEq α := Classical.decEq α + let : DecidableEq α := Classical.decEq α have := h (mem_lookup_iff.1 (Option.get_mem (lookup_isSome.2 hk))) rw [← mem_lookup_iff, Option.mem_def] at this rw [← mem_keys, ← lookup_isSome, this] diff --git a/Mathlib/Data/List/OffDiag.lean b/Mathlib/Data/List/OffDiag.lean index 14faa79e5d657f..59d9ea7e995ea7 100644 --- a/Mathlib/Data/List/OffDiag.lean +++ b/Mathlib/Data/List/OffDiag.lean @@ -84,14 +84,14 @@ protected theorem Perm.offDiag {l₁ l₂ : List α} (h : l₁ ~ l₂) : l₁.of classical simp_all [perm_iff_count, count_offDiag_eq_mul_sub_ite] protected theorem Nodup.offDiag (h : l.Nodup) : l.offDiag.Nodup := by - letI := Classical.decEq α + let := Classical.decEq α rw [nodup_iff_count_le_one] rintro ⟨x, y⟩ rw [count_offDiag_eq_mul_sub_ite l x y] grind protected theorem Nodup.of_offDiag (h : l.offDiag.Nodup) : l.Nodup := by - letI := Classical.decEq α + let := Classical.decEq α simp only [nodup_iff_count_le_one, Prod.forall, count_offDiag_eq_mul_sub_ite] at * intro a specialize h a a diff --git a/Mathlib/Data/Multiset/Powerset.lean b/Mathlib/Data/Multiset/Powerset.lean index ca861d006ad89e..b5341d26df26ec 100644 --- a/Mathlib/Data/Multiset/Powerset.lean +++ b/Mathlib/Data/Multiset/Powerset.lean @@ -150,13 +150,13 @@ theorem revzip_powersetAux_lemma {α : Type*} [DecidableEq α] (l : List α) {l' theorem revzip_powersetAux_perm_aux' {l : List α} : revzip (powersetAux l) ~ revzip (powersetAux' l) := by - haveI := Classical.decEq α + have := Classical.decEq α rw [revzip_powersetAux_lemma l revzip_powersetAux, revzip_powersetAux_lemma l revzip_powersetAux'] exact powersetAux_perm_powersetAux'.map _ theorem revzip_powersetAux_perm {l₁ l₂ : List α} (p : l₁ ~ l₂) : revzip (powersetAux l₁) ~ revzip (powersetAux l₂) := by - haveI := Classical.decEq α + have := Classical.decEq α simp only [fun l : List α => revzip_powersetAux_lemma l revzip_powersetAux, coe_eq_coe.2 p] exact (powersetAux_perm p).map _ diff --git a/Mathlib/Data/Multiset/ZeroCons.lean b/Mathlib/Data/Multiset/ZeroCons.lean index cf8fd0a7193fa7..bba540882d9761 100644 --- a/Mathlib/Data/Multiset/ZeroCons.lean +++ b/Mathlib/Data/Multiset/ZeroCons.lean @@ -218,7 +218,7 @@ theorem cons_ne_zero {a : α} {m : Multiset α} : a ::ₘ m ≠ 0 := theorem cons_eq_cons {a b : α} {as bs : Multiset α} : a ::ₘ as = b ::ₘ bs ↔ a = b ∧ as = bs ∨ a ≠ b ∧ ∃ cs, as = b ::ₘ cs ∧ bs = a ::ₘ cs := by - haveI : DecidableEq α := Classical.decEq α + have : DecidableEq α := Classical.decEq α constructor · intro eq by_cases h : a = b diff --git a/Mathlib/Data/Nat/Cast/Defs.lean b/Mathlib/Data/Nat/Cast/Defs.lean index 2c5591c4b1ac85..aa0ed1759839b7 100644 --- a/Mathlib/Data/Nat/Cast/Defs.lean +++ b/Mathlib/Data/Nat/Cast/Defs.lean @@ -156,7 +156,7 @@ protected abbrev AddMonoidWithOne.binary [AddMonoid R] [One R] : AddMonoidWithOn natCast := Nat.binCast, natCast_zero := by simp only [Nat.binCast], natCast_succ := fun n => by - letI : AddMonoidWithOne R := AddMonoidWithOne.unary + let : AddMonoidWithOne R := AddMonoidWithOne.unary rw [Nat.binCast_eq, Nat.binCast_eq, Nat.cast_succ] } theorem one_add_one_eq_two [AddMonoidWithOne R] : 1 + 1 = (2 : R) := by diff --git a/Mathlib/Data/Nat/Choose/Lucas.lean b/Mathlib/Data/Nat/Choose/Lucas.lean index b2192eea6d83e0..491d55b7b34fff 100644 --- a/Mathlib/Data/Nat/Choose/Lucas.lean +++ b/Mathlib/Data/Nat/Choose/Lucas.lean @@ -192,7 +192,7 @@ lemma primeFactors_gcd_choose_of_isPrimePow (h : IsPrimePow n) : intro p hp simp only [mem_primeFactors, ne_eq] at hp obtain ⟨hp₁, hp₂, hp₃⟩ := hp - haveI : Fact (Nat.Prime p) := ⟨hp₁⟩ + have : Fact (Nat.Prime p) := ⟨hp₁⟩ simp_rw [Finset.dvd_gcd_iff, ← modEq_zero_iff_dvd] at hp₂ have := eq_pow_multiplicity_of_choose_modEq_zero_nat h.pos hp₂ have dvd_pow : n.minFac ∣ p ^ multiplicity p n := this ▸ minFac_dvd _ @@ -218,7 +218,7 @@ theorem gcd_choose_eq_one_of_not_isPrimePow (hn : 1 < n) (hpn : ¬ IsPrimePow n) contrapose! hpn obtain ⟨q, hq, h⟩ := Nat.exists_prime_and_dvd hpn simp_rw [Finset.dvd_gcd_iff, ← modEq_zero_iff_dvd] at h - haveI : Fact (Nat.Prime q) := ⟨hq⟩ + have : Fact (Nat.Prime q) := ⟨hq⟩ have := eq_pow_multiplicity_of_choose_modEq_zero_nat (zero_lt_of_lt hn) h refine (isPrimePow_nat_iff n).mpr ⟨q, _, hq, Dvd.multiplicity_pos ?_, this.symm⟩ specialize h 1 (by grind) diff --git a/Mathlib/Data/Nat/Choose/Multinomial.lean b/Mathlib/Data/Nat/Choose/Multinomial.lean index a9ed09a52cd00c..964228f88bc058 100644 --- a/Mathlib/Data/Nat/Choose/Multinomial.lean +++ b/Mathlib/Data/Nat/Choose/Multinomial.lean @@ -326,7 +326,7 @@ theorem sum_pow_of_commute (x : α → R) (s : Finset α) convert! @Nat.cast_one R _ simp · rw [_root_.pow_succ, mul_zero] - haveI : IsEmpty (Finset.sym (∅ : Finset α) n.succ) := Finset.instIsEmpty + have : IsEmpty (Finset.sym (∅ : Finset α) n.succ) := Finset.instIsEmpty apply (Fintype.sum_empty _).symm | insert a s ha ih => ?_ intro n; specialize ih (hc.mono <| s.subset_insert a) diff --git a/Mathlib/Data/Nat/Nth.lean b/Mathlib/Data/Nat/Nth.lean index 11e306887a5938..6b7f6d039fd65b 100644 --- a/Mathlib/Data/Nat/Nth.lean +++ b/Mathlib/Data/Nat/Nth.lean @@ -157,7 +157,7 @@ theorem nth_le_nth (hf : (setOf p).Infinite) {k n} : nth p k ≤ nth p n ↔ k theorem range_nth_of_infinite (hf : (setOf p).Infinite) : Set.range (nth p) = setOf p := by rw [nth_eq_orderIsoOfNat hf] - haveI := hf.to_subtype + have := hf.to_subtype classical exact Nat.Subtype.coe_comp_ofNat_range theorem nth_mem_of_infinite (hf : (setOf p).Infinite) (n : ℕ) : p (nth p n) := diff --git a/Mathlib/Data/Nat/Totient.lean b/Mathlib/Data/Nat/Totient.lean index c31f22ad920296..5c3cada18691a7 100644 --- a/Mathlib/Data/Nat/Totient.lean +++ b/Mathlib/Data/Nat/Totient.lean @@ -121,8 +121,8 @@ theorem _root_.ZMod.card_units_eq_totient (n : ℕ) [NeZero n] [Fintype (ZMod n) rfl theorem totient_even {n : ℕ} (hn : 2 < n) : Even n.totient := by - haveI : Fact (1 < n) := ⟨one_lt_two.trans hn⟩ - haveI : NeZero n := NeZero.of_gt hn + have : Fact (1 < n) := ⟨one_lt_two.trans hn⟩ + have : NeZero n := NeZero.of_gt hn suffices 2 = orderOf (-1 : (ZMod n)ˣ) by rw [← ZMod.card_units_eq_totient, even_iff_two_dvd, this] exact orderOf_dvd_card @@ -133,9 +133,9 @@ theorem totient_mul {m n : ℕ} (h : m.Coprime n) : φ (m * n) = φ m * φ n := rcases Nat.mul_eq_zero.1 hmn0 with h | h <;> simp only [totient_zero, mul_zero, zero_mul, h] else by - haveI : NeZero (m * n) := ⟨hmn0⟩ - haveI : NeZero m := ⟨left_ne_zero_of_mul hmn0⟩ - haveI : NeZero n := ⟨right_ne_zero_of_mul hmn0⟩ + have : NeZero (m * n) := ⟨hmn0⟩ + have : NeZero m := ⟨left_ne_zero_of_mul hmn0⟩ + have : NeZero n := ⟨right_ne_zero_of_mul hmn0⟩ simp only [← ZMod.card_units_eq_totient] rw [Fintype.card_congr (Units.mapEquiv (ZMod.chineseRemainder h).toMulEquiv).toEquiv, Fintype.card_congr (@MulEquiv.prodUnits (ZMod m) (ZMod n) _ _).toEquiv, Fintype.card_prod] @@ -231,7 +231,7 @@ theorem totient_eq_iff_prime {p : ℕ} (hp : 0 < p) : p.totient = p - 1 ↔ p.Pr theorem card_units_zmod_lt_sub_one {p : ℕ} (hp : 1 < p) [Fintype (ZMod p)ˣ] : Fintype.card (ZMod p)ˣ ≤ p - 1 := by - haveI : NeZero p := ⟨(pos_of_gt hp).ne'⟩ + have : NeZero p := ⟨(pos_of_gt hp).ne'⟩ rw [ZMod.card_units_eq_totient p] exact Nat.le_sub_one_of_lt (Nat.totient_lt p hp) diff --git a/Mathlib/Data/PFunctor/Univariate/M.lean b/Mathlib/Data/PFunctor/Univariate/M.lean index ed201bd32b8416..5eff067e410d48 100644 --- a/Mathlib/Data/PFunctor/Univariate/M.lean +++ b/Mathlib/Data/PFunctor/Univariate/M.lean @@ -570,7 +570,7 @@ theorem bisim (R : M P → M P → Prop) (h : ∀ x y, R x y → ∃ a f f', M.dest x = ⟨a, f⟩ ∧ M.dest y = ⟨a, f'⟩ ∧ ∀ i, R (f i) (f' i)) : ∀ x y, R x y → x = y := by introv h' - haveI := Inhabited.mk x.head + have := Inhabited.mk x.head apply eq_of_bisim R _ _ _ h'; clear h' x y constructor <;> introv ih <;> rcases h _ _ ih with ⟨a'', g, g', h₀, h₁, h₂⟩ <;> clear h · replace h₀ := congr_arg Sigma.fst h₀ diff --git a/Mathlib/Data/Prod/Basic.lean b/Mathlib/Data/Prod/Basic.lean index afaeaafe82632a..e3141291db236b 100644 --- a/Mathlib/Data/Prod/Basic.lean +++ b/Mathlib/Data/Prod/Basic.lean @@ -277,8 +277,8 @@ theorem map_surjective [Nonempty γ] [Nonempty δ] {f : α → γ} {g : β → @[simp] theorem map_bijective [Nonempty α] [Nonempty β] {f : α → γ} {g : β → δ} : Bijective (map f g) ↔ Bijective f ∧ Bijective g := by - haveI := Nonempty.map f ‹_› - haveI := Nonempty.map g ‹_› + have := Nonempty.map f ‹_› + have := Nonempty.map g ‹_› exact (map_injective.and map_surjective).trans and_and_and_comm @[simp] diff --git a/Mathlib/Data/Seq/Computation.lean b/Mathlib/Data/Seq/Computation.lean index 07b1fbbd784efd..829450471c9fda 100644 --- a/Mathlib/Data/Seq/Computation.lean +++ b/Mathlib/Data/Seq/Computation.lean @@ -446,7 +446,7 @@ theorem Results.val_unique {s : Computation α} {a b m n} (h1 : Results s a m) ( mem_unique h1.mem h2.mem theorem Results.len_unique {s : Computation α} {a b m n} (h1 : Results s a m) (h2 : Results s b n) : - m = n := by haveI := h1.terminates; haveI := h2.terminates; rw [← h1.length, h2.length] + m = n := by have := h1.terminates; have := h2.terminates; rw [← h1.length, h2.length] theorem exists_results_of_mem {s : Computation α} {a} (h : a ∈ s) : ∃ n, Results s a n := haveI := terminates_of_mem h @@ -482,7 +482,7 @@ theorem results_think {s : Computation α} {a n} (h : Results s a n) : Results ( theorem of_results_think {s : Computation α} {a n} (h : Results (think s) a n) : ∃ m, Results s a m ∧ n = m + 1 := by - haveI := of_think_terminates h.terminates + have := of_think_terminates h.terminates have := results_of_terminates' _ (of_think_mem h.mem) exact ⟨_, this, Results.len_unique h (results_think this)⟩ diff --git a/Mathlib/Data/Seq/Parallel.lean b/Mathlib/Data/Seq/Parallel.lean index e484882e53299b..3a7e7bcb34e7ea 100644 --- a/Mathlib/Data/Seq/Parallel.lean +++ b/Mathlib/Data/Seq/Parallel.lean @@ -325,8 +325,8 @@ theorem parallel_promises {S : WSeq (Computation α)} {a} (H : ∀ s ∈ S, s ~> theorem mem_parallel {S : WSeq (Computation α)} {a} (H : ∀ s ∈ S, s ~> a) {c} (cs : c ∈ S) (ac : a ∈ c) : a ∈ parallel S := by - haveI := terminates_of_mem ac - haveI := terminates_parallel cs + have := terminates_of_mem ac + have := terminates_parallel cs exact mem_of_promises _ (parallel_promises H) theorem parallel_congr_lem {S T : WSeq (Computation α)} {a} (H : S.LiftRel Equiv T) : diff --git a/Mathlib/Data/Set/Card.lean b/Mathlib/Data/Set/Card.lean index b3bbdde0aaf5aa..d3fbeb48451339 100644 --- a/Mathlib/Data/Set/Card.lean +++ b/Mathlib/Data/Set/Card.lean @@ -983,8 +983,8 @@ theorem inj_on_of_surj_on_of_ncard_le {t : Set β} (f : ∀ a ∈ s, β) (hf : obtain ⟨a, ha, rfl⟩ := hsurj y hy simp only [Subtype.exists] exact ⟨_, ha, rfl⟩ - haveI := hs.fintype - haveI := Fintype.ofSurjective _ hsurj + have := hs.fintype + have := Fintype.ofSurjective _ hsurj set f'' : ∀ a, a ∈ s.toFinset → β := fun a h ↦ f a (by simpa using h) exact @Finset.inj_on_of_surj_on_of_card_le _ _ _ t.toFinset f'' diff --git a/Mathlib/Data/Set/Countable.lean b/Mathlib/Data/Set/Countable.lean index 6aaf912cdda781..15939332431531 100644 --- a/Mathlib/Data/Set/Countable.lean +++ b/Mathlib/Data/Set/Countable.lean @@ -195,7 +195,7 @@ theorem exists_seq_iSup_eq_top_iff_countable [CompleteLattice α] {p : α → Pr · rintro ⟨S, hSc, hps, hS⟩ rcases eq_empty_or_nonempty S with (rfl | hne) · rw [sSup_empty] at hS - haveI := subsingleton_of_bot_eq_top hS + have := subsingleton_of_bot_eq_top hS rcases h with ⟨x, hx⟩ exact ⟨fun _ => x, fun _ => hx, Subsingleton.elim _ _⟩ · rcases (Set.countable_iff_exists_surjective hne).1 hSc with ⟨s, hs⟩ diff --git a/Mathlib/Data/Set/Finite/Basic.lean b/Mathlib/Data/Set/Finite/Basic.lean index 5c1a0dd85ed32e..164da8b8cc5640 100644 --- a/Mathlib/Data/Set/Finite/Basic.lean +++ b/Mathlib/Data/Set/Finite/Basic.lean @@ -751,7 +751,7 @@ so `u n` is related to the image of `{0, 1, ..., n-1}` under `u`. -/ theorem seq_of_forall_finite_exists {γ : Type*} {P : γ → Set γ → Prop} (h : ∀ t : Set γ, t.Finite → ∃ c, P c t) : ∃ u : ℕ → γ, ∀ n, P (u n) (u '' Iio n) := by - haveI : Nonempty γ := (h ∅ finite_empty).nonempty + have : Nonempty γ := (h ∅ finite_empty).nonempty choose! c hc using h set f : (n : ℕ) → (g : (m : ℕ) → m < n → γ) → γ := fun n g => c (range fun k : Iio n => g k.1 k.2) set u : ℕ → γ := fun n ↦ Nat.strongRecOn n f @@ -816,7 +816,7 @@ theorem Finite.card_toFinset {s : Set α} [Fintype s] (h : s.Finite) : theorem card_ne_eq [Fintype α] (a : α) [Fintype { x : α | x ≠ a }] : Fintype.card { x : α | x ≠ a } = Fintype.card α - 1 := by - haveI := Classical.decEq α + have := Classical.decEq α rw [← toFinset_card, toFinset_setOf, Finset.filter_ne', Finset.card_erase_of_mem (Finset.mem_univ _), Finset.card_univ] diff --git a/Mathlib/Data/Set/Finite/Lattice.lean b/Mathlib/Data/Set/Finite/Lattice.lean index 5722f01641983a..1092899d5557cd 100644 --- a/Mathlib/Data/Set/Finite/Lattice.lean +++ b/Mathlib/Data/Set/Finite/Lattice.lean @@ -102,7 +102,7 @@ instance finite_sUnion {s : Set (Set α)} [Finite s] [H : ∀ t : s, Finite (t : theorem finite_biUnion {ι : Type*} (s : Set ι) [Finite s] (t : ι → Set α) (H : ∀ i ∈ s, Finite (t i)) : Finite (⋃ x ∈ s, t x) := by rw [biUnion_eq_iUnion] - haveI : ∀ i : s, Finite (t i) := fun i => H i i.property + have : ∀ i : s, Finite (t i) := fun i => H i i.property infer_instance instance finite_biUnion' {ι : Type*} (s : Set ι) [Finite s] (t : ι → Set α) [∀ i, Finite (t i)] : @@ -361,7 +361,7 @@ theorem iUnion_pi_of_monotone {ι ι' : Type*} [LinearOrder ι'] [Nonempty ι'] {I : Set ι} {s : ∀ i, ι' → Set (α i)} (hI : I.Finite) (hs : ∀ i ∈ I, Monotone (s i)) : ⋃ j : ι', I.pi (fun i => s i j) = I.pi fun i => ⋃ j, s i j := by simp only [pi_def, biInter_eq_iInter, preimage_iUnion] - haveI := hI.fintype.finite + have := hI.fintype.finite refine iUnion_iInter_of_monotone (ι' := ι') (fun (i : I) j₁ j₂ h => ?_) exact preimage_mono <| hs i i.2 h @@ -395,12 +395,12 @@ theorem Finite.biInf_iSup_eq {ι : Type v} {κ : ι → Sort w} [Nonempty (Π a, classical suffices h : ∀ {κ : ι → Type w} [Nonempty (Π a, κ a)] (f : Π a, κ a → α), ⨅ a ∈ s, ⨆ b, f a b = ⨆ g : (Π a, κ a), ⨅ a ∈ s, f a (g a) by - haveI : Nonempty (Π a, PLift (κ a)) := (Equiv.piCongrRight fun _ => Equiv.plift).nonempty + have : Nonempty (Π a, PLift (κ a)) := (Equiv.piCongrRight fun _ => Equiv.plift).nonempty simpa [← Equiv.plift.symm.iSup_comp, ← (Equiv.piCongrRight fun _ => Equiv.plift).symm.iSup_comp] using h (κ := fun a => PLift (κ a)) fun a b => f a b.down intro κ _ f - haveI := hs.to_subtype - haveI : Nonempty (Π a : { a // a ∉ s }, κ ↑a) := ‹Nonempty (Π a, κ a)›.map fun f a ↦ f a + have := hs.to_subtype + have : Nonempty (Π a : { a // a ∉ s }, κ ↑a) := ‹Nonempty (Π a, κ a)›.map fun f a ↦ f a simp [← iInf_subtype'', iInf_iSup_eq_of_finite (ι := s), ← Equiv.piEquivPiSubtypeProd (· ∈ s) _ |>.symm.iSup_comp, iSup_prod, iSup_const] @@ -471,7 +471,7 @@ theorem DirectedOn.exists_mem_subset_of_finset_subset_biUnion {α ι : Type*} {f {c : Set ι} (hn : c.Nonempty) (hc : DirectedOn (fun i j => f i ⊆ f j) c) {s : Finset α} (hs : (s : Set α) ⊆ ⋃ i ∈ c, f i) : ∃ i ∈ c, (s : Set α) ⊆ f i := by rw [Set.biUnion_eq_iUnion] at hs - haveI := hn.coe_sort + have := hn.coe_sort simpa using (directed_comp.2 hc.directed_val).exists_mem_subset_of_finset_subset_biUnion hs theorem DirectedOn.exists_mem_subset_of_finite_of_subset_sUnion {α : Type*} {c : Set (Set α)} diff --git a/Mathlib/Data/Set/Finite/Range.lean b/Mathlib/Data/Set/Finite/Range.lean index 20c10cfdb777a2..fe0b2c694b6e6e 100644 --- a/Mathlib/Data/Set/Finite/Range.lean +++ b/Mathlib/Data/Set/Finite/Range.lean @@ -63,7 +63,7 @@ namespace Finite.Set instance finite_range (f : ι → α) [Finite ι] : Finite (range f) := by classical - haveI := Fintype.ofFinite (PLift ι) + have := Fintype.ofFinite (PLift ι) infer_instance instance finite_replacement [Finite α] (f : α → β) : diff --git a/Mathlib/Data/Set/Function.lean b/Mathlib/Data/Set/Function.lean index 409e09c29778d0..e7386cd4f81f6a 100644 --- a/Mathlib/Data/Set/Function.lean +++ b/Mathlib/Data/Set/Function.lean @@ -1048,7 +1048,7 @@ theorem surjOn_iff_exists_bijOn_subset : SurjOn f s t ↔ ∃ s' ⊆ s, BijOn f · rcases eq_empty_or_nonempty t with (rfl | ht) · exact fun _ => ⟨∅, empty_subset _, bijOn_empty f⟩ · intro h - haveI : Nonempty α := ⟨Classical.choose (h.comap_nonempty ht)⟩ + have : Nonempty α := ⟨Classical.choose (h.comap_nonempty ht)⟩ exact ⟨_, h.mapsTo_invFunOn.image_subset, h.bijOn_subset⟩ · rintro ⟨s', hs', hfs'⟩ exact hfs'.surjOn.mono hs' (Subset.refl _) diff --git a/Mathlib/Data/Set/Lattice.lean b/Mathlib/Data/Set/Lattice.lean index f83b4087cb7c9f..ed47b589df1942 100644 --- a/Mathlib/Data/Set/Lattice.lean +++ b/Mathlib/Data/Set/Lattice.lean @@ -737,7 +737,7 @@ theorem biInter_pair (a b : α) (s : α → Set β) : ⋂ x ∈ ({a, b} : Set α theorem biInter_inter {ι α : Type*} {s : Set ι} (hs : s.Nonempty) (f : ι → Set α) (t : Set α) : ⋂ i ∈ s, f i ∩ t = (⋂ i ∈ s, f i) ∩ t := by - haveI : Nonempty s := hs.to_subtype + have : Nonempty s := hs.to_subtype simp [biInter_eq_iInter, ← iInter_inter] theorem inter_biInter {ι α : Type*} {s : Set ι} (hs : s.Nonempty) (f : ι → Set α) (t : Set α) : diff --git a/Mathlib/Data/Set/Lattice/Image.lean b/Mathlib/Data/Set/Lattice/Image.lean index ed904b54db22b2..a95c83b908a008 100644 --- a/Mathlib/Data/Set/Lattice/Image.lean +++ b/Mathlib/Data/Set/Lattice/Image.lean @@ -231,7 +231,7 @@ theorem InjOn.image_biInter_eq {p : ι → Prop} {s : ∀ i, p i → Set α} (hp {f : α → β} (h : InjOn f (⋃ (i) (hi), s i hi)) : (f '' ⋂ (i) (hi), s i hi) = ⋂ (i) (hi), f '' s i hi := by simp only [iInter, iInf_subtype'] - haveI : Nonempty { i // p i } := nonempty_subtype.2 hp + have : Nonempty { i // p i } := nonempty_subtype.2 hp apply InjOn.image_iInter_eq simpa only [iUnion, iSup_subtype'] using h diff --git a/Mathlib/Data/Sym/NatCard.lean b/Mathlib/Data/Sym/NatCard.lean index d4422769418e61..58c579fe634c26 100644 --- a/Mathlib/Data/Sym/NatCard.lean +++ b/Mathlib/Data/Sym/NatCard.lean @@ -32,7 +32,7 @@ instance {k : ℕ} [Infinite α] [NeZero k] : Infinite (Sym α k) := theorem natCard_sym_eq_multichoose (k : ℕ) : Nat.card (Sym α k) = multichoose (Nat.card α) k := by cases finite_or_infinite α - · obtain ⟨_⟩ := nonempty_fintype α; letI := Classical.decEq α + · obtain ⟨_⟩ := nonempty_fintype α; let := Classical.decEq α simp_rw [Nat.card_eq_fintype_card] exact card_sym_eq_multichoose _ _ cases k <;> simp @@ -62,7 +62,7 @@ theorem natCard_subtype_diag : Nat.card { a : Sym2 α // a.IsDiag } = Nat.card theorem natCard_subtype_not_diag : Nat.card { a : Sym2 α // ¬a.IsDiag } = (Nat.card α).choose 2 := by cases finite_or_infinite α - · obtain ⟨_⟩ := nonempty_fintype α; letI := Classical.decEq α + · obtain ⟨_⟩ := nonempty_fintype α; let := Classical.decEq α simp_rw [Nat.card_eq_fintype_card] exact card_subtype_not_diag · simp @@ -76,7 +76,7 @@ lemma ncard_diagSet_compl : (diagSetᶜ : Set (Sym2 α)).ncard = (Nat.card α).c /-- Type **stars and bars** for the case `n = 2`. -/ protected theorem natCard : Nat.card (Sym2 α) = Nat.choose (Nat.card α + 1) 2 := by cases finite_or_infinite α - · obtain ⟨_⟩ := nonempty_fintype α; letI := Classical.decEq α + · obtain ⟨_⟩ := nonempty_fintype α; let := Classical.decEq α simp_rw [Nat.card_eq_fintype_card] exact Sym2.card · simp diff --git a/Mathlib/Data/ZMod/Basic.lean b/Mathlib/Data/ZMod/Basic.lean index 492558652011b0..d634b3c113afa1 100644 --- a/Mathlib/Data/ZMod/Basic.lean +++ b/Mathlib/Data/ZMod/Basic.lean @@ -397,7 +397,7 @@ theorem castHom_injective : Function.Injective (ZMod.castHom (dvd_refl n) R) := theorem castHom_bijective [Fintype R] (h : Fintype.card R = n) : Function.Bijective (ZMod.castHom (dvd_refl n) R) := by - haveI : NeZero n := + have : NeZero n := ⟨by intro hn rw [hn] at h @@ -778,7 +778,7 @@ theorem coe_mul_inv_eq_one {n : ℕ} (x : ℕ) (h : Nat.Coprime x n) : lemma mul_val_inv (hmn : m.Coprime n) : (m * (m⁻¹ : ZMod n).val : ZMod n) = 1 := by obtain rfl | hn := eq_or_ne n 0 · simp [m.coprime_zero_right.1 hmn] - haveI : NeZero n := ⟨hn⟩ + have : NeZero n := ⟨hn⟩ rw [ZMod.natCast_zmod_val, ZMod.coe_mul_inv_eq_one _ hmn] lemma val_inv_mul (hmn : m.Coprime n) : ((m⁻¹ : ZMod n).val * m : ZMod n) = 1 := by @@ -901,9 +901,9 @@ def chineseRemainder {m n : ℕ} (h : m.Coprime n) : ZMod (m * n) ≃+* ZMod m fin_cases x simp [to_fun, inv_fun, castHom, Prod.ext_iff, eq_iff_true_of_subsingleton] else by - haveI : NeZero (m * n) := ⟨hmn0⟩ - haveI : NeZero m := ⟨left_ne_zero_of_mul hmn0⟩ - haveI : NeZero n := ⟨right_ne_zero_of_mul hmn0⟩ + have : NeZero (m * n) := ⟨hmn0⟩ + have : NeZero m := ⟨left_ne_zero_of_mul hmn0⟩ + have : NeZero n := ⟨right_ne_zero_of_mul hmn0⟩ have left_inv : Function.LeftInverse inv_fun to_fun := by intro x dsimp only [to_fun, inv_fun, ZMod.castHom_apply] diff --git a/Mathlib/Data/ZMod/QuotientGroup.lean b/Mathlib/Data/ZMod/QuotientGroup.lean index 008f9fc2161340..9501f74a766c66 100644 --- a/Mathlib/Data/ZMod/QuotientGroup.lean +++ b/Mathlib/Data/ZMod/QuotientGroup.lean @@ -144,7 +144,7 @@ instance minimalPeriod_pos [Finite <| orbit (zpowers a) b] : NeZero <| minimalPeriod (a • ·) b := ⟨by cases nonempty_fintype (orbit (zpowers a) b) - haveI : Nonempty (orbit (zpowers a) b) := (nonempty_orbit b).to_subtype + have : Nonempty (orbit (zpowers a) b) := (nonempty_orbit b).to_subtype rw [minimalPeriod_eq_card] exact Fintype.card_ne_zero⟩ diff --git a/Mathlib/Data/ZMod/Units.lean b/Mathlib/Data/ZMod/Units.lean index 202fac6b751b8d..c93c732e5bedd1 100644 --- a/Mathlib/Data/ZMod/Units.lean +++ b/Mathlib/Data/ZMod/Units.lean @@ -119,7 +119,7 @@ theorem coe_int_mul_inv_eq_one {n : ℕ} {x : ℤ} (h : IsCoprime x n) : by_cases hn : n = 0 · simp only [hn, Nat.cast_zero, isCoprime_zero_right] at h rcases Int.isUnit_eq_one_or h with h | h <;> simp [h] - haveI : NeZero n := ⟨hn⟩ + have : NeZero n := ⟨hn⟩ rw [← natCast_zmod_val x] apply coe_mul_inv_eq_one rwa [Int.isCoprime_iff_gcd_eq_one, ← Int.gcd_emod, ← val_intCast] at h diff --git a/Mathlib/Dynamics/Ergodic/Function.lean b/Mathlib/Dynamics/Ergodic/Function.lean index 86b366bccf56d5..63d8939bc590ff 100644 --- a/Mathlib/Dynamics/Ergodic/Function.lean +++ b/Mathlib/Dynamics/Ergodic/Function.lean @@ -82,7 +82,7 @@ theorem ae_eq_const_of_ae_eq_comp_ae {g : α → X} (h : QuasiErgodic f μ) (hgm : AEStronglyMeasurable g μ) (hg_eq : g ∘ f =ᵐ[μ] g) : ∃ c, g =ᵐ[μ] const α c := by borelize X rcases hgm.isSeparable_ae_range with ⟨t, ht, hgt⟩ - haveI := ht.secondCountableTopology + have := ht.secondCountableTopology exact h.ae_eq_const_of_ae_eq_comp_of_ae_range₀ hgt hgm.aemeasurable.nullMeasurable hg_eq theorem eq_const_of_compQuasiMeasurePreserving_eq (h : QuasiErgodic f μ) {g : α →ₘ[μ] X} diff --git a/Mathlib/FieldTheory/AbelRuffini.lean b/Mathlib/FieldTheory/AbelRuffini.lean index 2b3433e54375e0..b3f2131950000a 100644 --- a/Mathlib/FieldTheory/AbelRuffini.lean +++ b/Mathlib/FieldTheory/AbelRuffini.lean @@ -67,12 +67,12 @@ theorem gal_isSolvable_tower (p q : F[X]) (hpq : (p.map (algebraMap F q.Splittin IsSolvable q.Gal := by let K := p.SplittingField let L := q.SplittingField - haveI : Fact ((p.map (algebraMap F L)).Splits) := ⟨hpq⟩ + have : Fact ((p.map (algebraMap F L)).Splits) := ⟨hpq⟩ let ϕ : Gal(L/K) ≃* (q.map (algebraMap F K)).Gal := (IsSplittingField.algEquiv L (q.map (algebraMap F K))).autCongr have ϕ_inj : Function.Injective ϕ.toMonoidHom := ϕ.injective - haveI : IsSolvable Gal(K/F) := hp - haveI : IsSolvable Gal(L/K) := solvable_of_solvable_injective ϕ_inj + have : IsSolvable Gal(K/F) := hp + have : IsSolvable Gal(L/K) := solvable_of_solvable_injective ϕ_inj exact isSolvable_of_isScalarTower F p.SplittingField q.SplittingField section GalXPowSubC diff --git a/Mathlib/FieldTheory/AxGrothendieck.lean b/Mathlib/FieldTheory/AxGrothendieck.lean index 94d369434cca0b..67e15d8a62a70f 100644 --- a/Mathlib/FieldTheory/AxGrothendieck.lean +++ b/Mathlib/FieldTheory/AxGrothendieck.lean @@ -173,7 +173,7 @@ theorem ACF_models_genericPolyMapSurjOnOfInjOn_of_prime [Finite ι] Theory.ACF p ⊨ᵇ genericPolyMapSurjOnOfInjOn φ mons := by classical have : Fact p.Prime := ⟨hp⟩ - letI := compatibleRingOfRing (AlgebraicClosure (ZMod p)) + let := compatibleRingOfRing (AlgebraicClosure (ZMod p)) rw [← (ACF_isComplete (Or.inl hp)).realize_sentence_iff _ (AlgebraicClosure (ZMod p)), realize_genericPolyMapSurjOnOfInjOn] rintro v ⟨f, _⟩ @@ -207,7 +207,7 @@ theorem ax_grothendieck_of_definable [CompatibleRing K] {c : Set K} S.MapsTo (fun v i => eval v (ps i)) S → S.InjOn (fun v i => eval v (ps i)) → S.SurjOn (fun v i => eval v (ps i)) S := by - letI := Fintype.ofFinite ι + let := Fintype.ofFinite ι let p : ℕ := ringChar K rw [Set.definable_iff_finitely_definable] at hS rcases hS with ⟨c, _, hS⟩ @@ -232,7 +232,7 @@ theorem ax_grothendieck_zeroLocus S.MapsTo (fun v i => eval v (p i)) S → S.InjOn (fun v i => eval v (p i)) → S.SurjOn (fun v i => eval v (p i)) S := by - letI := compatibleRingOfRing K + let := compatibleRingOfRing K intro S obtain ⟨s, rfl⟩ : I.FG := IsNoetherian.noetherian I exact ax_grothendieck_of_definable S (mvPolynomial_zeroLocus_definable s) p diff --git a/Mathlib/FieldTheory/CardinalEmb.lean b/Mathlib/FieldTheory/CardinalEmb.lean index 7530ef2bb6bb7d..6aa5f50b7d418e 100644 --- a/Mathlib/FieldTheory/CardinalEmb.lean +++ b/Mathlib/FieldTheory/CardinalEmb.lean @@ -327,7 +327,7 @@ variable {F E} theorem cardinal_eq_two_pow_rank [Algebra.IsSeparable F E] (rank_inf : ℵ₀ ≤ Module.rank F E) : #(Field.Emb F E) = 2 ^ Module.rank F E := by - haveI := Fact.mk rank_inf + have := Fact.mk rank_inf rw [Emb.Cardinal.embEquivPi.cardinal_eq, mk_pi] apply le_antisymm · rw [← power_eq_two_power rank_inf natCast_le_aleph0 rank_inf] diff --git a/Mathlib/FieldTheory/Cardinality.lean b/Mathlib/FieldTheory/Cardinality.lean index e7907e72b100c1..61407dfbda7bc7 100644 --- a/Mathlib/FieldTheory/Cardinality.lean +++ b/Mathlib/FieldTheory/Cardinality.lean @@ -46,8 +46,8 @@ theorem Fintype.isPrimePow_card_of_field {α} [Fintype α] [Field α] : IsPrimeP theorem Fintype.nonempty_field_iff {α} [Fintype α] : Nonempty (Field α) ↔ IsPrimePow ‖α‖ := by refine ⟨fun ⟨h⟩ => Fintype.isPrimePow_card_of_field, ?_⟩ rintro ⟨p, n, hp, hn, hα⟩ - haveI := Fact.mk hp.nat_prime - haveI : Fintype (GaloisField p n) := Fintype.ofFinite (GaloisField p n) + have := Fact.mk hp.nat_prime + have : Fintype (GaloisField p n) := Fintype.ofFinite (GaloisField p n) exact ⟨(Fintype.equivOfCardEq (((Fintype.card_eq_nat_card).trans (GaloisField.card p n hn.ne')).trans hα)).symm.field⟩ diff --git a/Mathlib/FieldTheory/ChevalleyWarning.lean b/Mathlib/FieldTheory/ChevalleyWarning.lean index 19623e48580c95..7f32608376b302 100644 --- a/Mathlib/FieldTheory/ChevalleyWarning.lean +++ b/Mathlib/FieldTheory/ChevalleyWarning.lean @@ -54,7 +54,7 @@ local notation "q" => Fintype.card K theorem MvPolynomial.sum_eval_eq_zero (f : MvPolynomial σ K) (h : f.totalDegree < (q - 1) * Fintype.card σ) : ∑ x, eval x f = 0 := by - haveI : DecidableEq K := Classical.decEq K + have : DecidableEq K := Classical.decEq K calc ∑ x, eval x f = ∑ x : σ → K, ∑ d ∈ f.support, f.coeff d * ∏ i, x i ^ d i := by simp only [eval_eq'] @@ -81,7 +81,7 @@ theorem MvPolynomial.sum_eval_eq_zero (f : MvPolynomial σ K) _ = 0 := by rw [sum_pow_lt_card_sub_one K _ hi, mul_zero] intro a let e' : { j // j = i } ⊕ { j // j ≠ i } ≃ σ := Equiv.sumCompl _ - letI : Unique { j // j = i } := + let : Unique { j // j = i } := { default := ⟨i, rfl⟩ uniq := fun ⟨j, h⟩ => Subtype.val_injective h } calc diff --git a/Mathlib/FieldTheory/Differential/Basic.lean b/Mathlib/FieldTheory/Differential/Basic.lean index 0c26b95d62dc6e..d3151b3e0c6f4c 100644 --- a/Mathlib/FieldTheory/Differential/Basic.lean +++ b/Mathlib/FieldTheory/Differential/Basic.lean @@ -148,9 +148,9 @@ lemma differentialAlgebraFiniteDimensional [FiniteDimensional F K] : letI := differentialFiniteDimensional F K DifferentialAlgebra F K := by let k := (Field.exists_primitive_element F K).choose - haveI h : F⟮k⟯ = ⊤ := (Field.exists_primitive_element F K).choose_spec - haveI : Fact (minpoly F k).Monic := ⟨minpoly.monic (IsAlgebraic.of_finite ..).isIntegral⟩ - haveI : Fact (Irreducible (minpoly F k)) := + have h : F⟮k⟯ = ⊤ := (Field.exists_primitive_element F K).choose_spec + have : Fact (minpoly F k).Monic := ⟨minpoly.monic (IsAlgebraic.of_finite ..).isIntegral⟩ + have : Fact (Irreducible (minpoly F k)) := ⟨minpoly.irreducible (IsAlgebraic.of_finite ..).isIntegral⟩ apply DifferentialAlgebra.equiv diff --git a/Mathlib/FieldTheory/Differential/Liouville.lean b/Mathlib/FieldTheory/Differential/Liouville.lean index cf3775cc229db0..284d70fa8567fe 100644 --- a/Mathlib/FieldTheory/Differential/Liouville.lean +++ b/Mathlib/FieldTheory/Differential/Liouville.lean @@ -124,7 +124,7 @@ private local instance isLiouville_of_finiteDimensional_galois [FiniteDimensiona [IsGalois F K] : IsLiouville F K where isLiouville (a : F) (ι : Type) [Fintype ι] (c : ι → F) (hc : ∀ x, (c x)′ = 0) (u : ι → K) (v : K) (h : a = ∑ x, c x * logDeriv (u x) + v′) := by - haveI : CharZero K := charZero_of_injective_algebraMap + have : CharZero K := charZero_of_injective_algebraMap (FaithfulSMul.algebraMap_injective F K) -- We sum `e x` over all isomorphisms `e : K ≃ₐ[F] K`. -- Because this is a Galois extension each of the relevant values will be in `F`. diff --git a/Mathlib/FieldTheory/Extension.lean b/Mathlib/FieldTheory/Extension.lean index 7406aef78c527b..498bfcae6415e8 100644 --- a/Mathlib/FieldTheory/Extension.lean +++ b/Mathlib/FieldTheory/Extension.lean @@ -238,8 +238,8 @@ private theorem exists_algHom_adjoin_of_splits'' {L : IntermediateField F E} (fun c _ hc _ _ ↦ Lifts.exists_upper_bound c hc) ⟨L, f⟩ le_rfl refine ⟨φ.emb.comp (inclusion <| (le_extendScalars_iff hfφ.1 <| adjoin L S).mp <| adjoin_le_iff.mpr fun s h ↦ ?_), AlgHom.ext hfφ.2⟩ - letI := (inclusion hfφ.1).toAlgebra - letI : SMul L φ.carrier := Algebra.toSMul + let := (inclusion hfφ.1).toAlgebra + let : SMul L φ.carrier := Algebra.toSMul have : IsScalarTower L φ.carrier E := ⟨fun x y ↦ smul_assoc x (y : E)⟩ have := φ.exists_lift_of_splits' (hK s h).1.tower_top ((hK s h).1.minpoly_splits_tower_top' ?_) · obtain ⟨y, h1, h2⟩ := this @@ -264,7 +264,7 @@ theorem exists_algHom_adjoin_of_splits' : refine Eq.trans congr($hφ y) ?_ simp only [AlgHom.coe_comp, Function.comp_apply, f'] exact congr_arg f (AlgEquiv.symm_apply_apply _ _) - letI : Algebra L L' := (AlgEquiv.ofInjectiveField _).toRingHom.toAlgebra + let : Algebra L L' := (AlgEquiv.ofInjectiveField _).toRingHom.toAlgebra have : IsScalarTower L L' E := IsScalarTower.of_algebraMap_eq' rfl refine ⟨(hK s hs).1.tower_top, (hK s hs).1.minpoly_splits_tower_top' ?_⟩ convert! (hK s hs).2 diff --git a/Mathlib/FieldTheory/Finite/Basic.lean b/Mathlib/FieldTheory/Finite/Basic.lean index edee55fb926e4b..fa6d6d9a573729 100644 --- a/Mathlib/FieldTheory/Finite/Basic.lean +++ b/Mathlib/FieldTheory/Finite/Basic.lean @@ -254,8 +254,8 @@ variable (K) [Field K] [Fintype K] /-- The cardinality `q` is a power of the characteristic of `K`. -/ @[stacks 09HY "first part"] theorem card (p : ℕ) [CharP K p] : ∃ n : ℕ+, Nat.Prime p ∧ q = p ^ (n : ℕ) := by - haveI hp : Fact p.Prime := ⟨CharP.char_is_prime K p⟩ - letI : Module (ZMod p) K := { (ZMod.castHom dvd_rfl K : ZMod p →+* _).toModule with } + have hp : Fact p.Prime := ⟨CharP.char_is_prime K p⟩ + let : Module (ZMod p) K := { (ZMod.castHom dvd_rfl K : ZMod p →+* _).toModule with } obtain ⟨n, h⟩ := VectorSpace.card_fintype (ZMod p) K rw [ZMod.card] at h refine ⟨⟨n, ?_⟩, hp.1, h⟩ @@ -487,7 +487,7 @@ open Polynomial theorem expand_card (f : K[X]) : expand K q f = f ^ q := by obtain ⟨p, hp⟩ := CharP.exists K rcases FiniteField.card K p with ⟨⟨n, npos⟩, ⟨hp, hn⟩⟩ - haveI : Fact p.Prime := ⟨hp⟩ + have : Fact p.Prime := ⟨hp⟩ dsimp at hn rw [hn, ← map_iterateFrobenius_expand, iterateFrobenius_eq_pow, frobenius_pow hn, RingHom.one_def, map_id] @@ -540,7 +540,7 @@ namespace CharP theorem sq_add_sq (R : Type*) [Ring R] [IsDomain R] (p : ℕ) [NeZero p] [CharP R p] (x : ℤ) : ∃ a b : ℕ, ((a : R) ^ 2 + (b : R) ^ 2) = x := by - haveI := char_is_prime_of_pos R p + have := char_is_prime_of_pos R p obtain ⟨a, b, hab⟩ := ZMod.sq_add_sq p x refine ⟨a.val, b.val, ?_⟩ simpa using congr_arg (ZMod.castHom dvd_rfl R) hab @@ -638,7 +638,7 @@ end ZMod `a ^ (p - 1) ≡ 1 [ZMOD p]`. -/ theorem Int.ModEq.pow_card_sub_one_eq_one {p : ℕ} (hp : Nat.Prime p) {n : ℤ} (hpn : IsCoprime n p) : n ^ (p - 1) ≡ 1 [ZMOD p] := by - haveI : Fact p.Prime := ⟨hp⟩ + have : Fact p.Prime := ⟨hp⟩ have : ¬(n : ZMod p) = 0 := by rw [CharP.intCast_eq_zero_iff _ p, ← (Nat.prime_iff_prime_int.mp hp).coprime_iff_not_dvd] · exact hpn.symm @@ -649,7 +649,7 @@ theorem Int.prime_dvd_pow_sub_one {p : ℕ} (hp : Nat.Prime p) {n : ℤ} (hpn : (ModEq.pow_card_sub_one_eq_one hp hpn).symm.dvd theorem Int.ModEq.pow_prime_eq_self {p : ℕ} (hp : Nat.Prime p) (n : ℤ) : n ^ p ≡ n [ZMOD p] := by - haveI : Fact p.Prime := ⟨hp⟩ + have : Fact p.Prime := ⟨hp⟩ simp [← ZMod.intCast_eq_intCast_iff] theorem Int.prime_dvd_pow_self_sub {p : ℕ} (hp : Nat.Prime p) (n : ℤ) : (p : ℤ) ∣ n ^ p - n := diff --git a/Mathlib/FieldTheory/Finite/Extension.lean b/Mathlib/FieldTheory/Finite/Extension.lean index 299773369de76c..328fc12eeb24f6 100644 --- a/Mathlib/FieldTheory/Finite/Extension.lean +++ b/Mathlib/FieldTheory/Finite/Extension.lean @@ -52,7 +52,7 @@ def Extension : Type := theorem finrank_zmod_extension [Algebra (ZMod p) k] : Module.finrank (ZMod p) (Extension k p n) = Module.finrank (ZMod p) k * n := by - letI := ZMod.algebra k p + let := ZMod.algebra k p unfold Extension convert! GaloisField.finrank p (n := Module.finrank (ZMod p) k * n) <| @@ -75,7 +75,7 @@ instance [Algebra (ZMod p) k] : IsScalarTower (ZMod p) k (Extension k p n) := .of_algebraMap_eq' <| Subsingleton.elim _ _ theorem natCard_extension : Nat.card (Extension k p n) = Nat.card k ^ n := by - letI := ZMod.algebra k p + let := ZMod.algebra k p rw [← pow_finrank_eq_natCard p, ← pow_finrank_eq_natCard p, finrank_zmod_extension, pow_mul] theorem finrank_extension : Module.finrank k (Extension k p n) = n := by diff --git a/Mathlib/FieldTheory/Finite/GaloisField.lean b/Mathlib/FieldTheory/Finite/GaloisField.lean index a3cc93bce9b2e4..59fe36a193b68b 100644 --- a/Mathlib/FieldTheory/Finite/GaloisField.lean +++ b/Mathlib/FieldTheory/Finite/GaloisField.lean @@ -79,7 +79,7 @@ variable (p : ℕ) [h_prime : Fact p.Prime] (n : ℕ) set_option backward.isDefEq.respectTransparency false in theorem finrank {n} (h : n ≠ 0) : Module.finrank (ZMod p) (GaloisField p n) = n := by - haveI : Fintype (GaloisField p n) := Fintype.ofFinite (GaloisField p n) + have : Fintype (GaloisField p n) := Fintype.ofFinite (GaloisField p n) set g_poly := (X ^ p ^ n - X : (ZMod p)[X]) have hp : 1 < p := h_prime.out.one_lt have aux : g_poly ≠ 0 := FiniteField.X_pow_card_pow_sub_X_ne_zero _ h hp @@ -130,7 +130,7 @@ theorem finrank {n} (h : n ≠ 0) : Module.finrank (ZMod p) (GaloisField p n) = theorem card (h : n ≠ 0) : Nat.card (GaloisField p n) = p ^ n := by let b := IsNoetherian.finsetBasis (ZMod p) (GaloisField p n) - haveI : Fintype (GaloisField p n) := Fintype.ofFinite (GaloisField p n) + have : Fintype (GaloisField p n) := Fintype.ofFinite (GaloisField p n) rw [Nat.card_eq_fintype_card, Module.card_fintype b, ← Module.finrank_eq_card_basis b, ZMod.card, finrank p h] @@ -175,14 +175,14 @@ variable {K : Type*} [Field K] [Algebra (ZMod p) K] theorem _root_.FiniteField.splits_X_pow_nat_card_sub_X [Finite K] : Splits (map (algebraMap (ZMod p) K) (X ^ Nat.card K - X)) := by - haveI : Fintype K := Fintype.ofFinite K + have : Fintype K := Fintype.ofFinite K rw [Nat.card_eq_fintype_card] exact (FiniteField.isSplittingField_sub K (ZMod p)).splits theorem _root_.FiniteField.isSplittingField_of_nat_card_eq (h : Nat.card K = p ^ n) : IsSplittingField (ZMod p) K (X ^ p ^ n - X) := by - haveI : Finite K := (Nat.card_pos_iff.mp (h ▸ pow_pos h_prime.1.pos n)).2 - haveI : Fintype K := Fintype.ofFinite K + have : Finite K := (Nat.card_pos_iff.mp (h ▸ pow_pos h_prime.1.pos n)).2 + have : Fintype K := Fintype.ofFinite K rw [← h, Nat.card_eq_fintype_card] exact FiniteField.isSplittingField_sub K (ZMod p) @@ -198,8 +198,8 @@ instance (priority := 100) {K K' : Type*} [Field K] [Field K'] [Finite K'] [Alge IsGalois K K' := by cases nonempty_fintype K' obtain ⟨p, hp⟩ := CharP.exists K - haveI : CharP K p := hp - haveI : CharP K' p := charP_of_injective_algebraMap' K p + have : CharP K p := hp + have : CharP K' p := charP_of_injective_algebraMap' K p exact IsGalois.of_separable_splitting_field (galois_poly_separable p (Fintype.card K') (let ⟨n, _, hn⟩ := FiniteField.card K' p diff --git a/Mathlib/FieldTheory/Finite/Trace.lean b/Mathlib/FieldTheory/Finite/Trace.lean index 390d29ce143aea..d6723889a553c7 100644 --- a/Mathlib/FieldTheory/Finite/Trace.lean +++ b/Mathlib/FieldTheory/Finite/Trace.lean @@ -37,7 +37,7 @@ open Fintype theorem trace_to_zmod_nondegenerate (F : Type*) [Field F] [Finite F] [Algebra (ZMod (ringChar F)) F] {a : F} (ha : a ≠ 0) : ∃ b : F, Algebra.trace (ZMod (ringChar F)) F (a * b) ≠ 0 := by - haveI : Fact (ringChar F).Prime := ⟨CharP.char_is_prime F _⟩ + have : Fact (ringChar F).Prime := ⟨CharP.char_is_prime F _⟩ have htr := (traceForm_nondegenerate (ZMod (ringChar F)) F).1 a simp_rw [Algebra.traceForm_apply] at htr by_contra! hf diff --git a/Mathlib/FieldTheory/Galois/Basic.lean b/Mathlib/FieldTheory/Galois/Basic.lean index 1f888afb4d915f..7c801194e20be2 100644 --- a/Mathlib/FieldTheory/Galois/Basic.lean +++ b/Mathlib/FieldTheory/Galois/Basic.lean @@ -522,7 +522,7 @@ theorem of_separable_splitting_field_aux [hFE : FiniteDimensional F E] [sp : p.I Σ f : K →ₐ[F] E, @AlgHom K K⟮x⟯ E _ _ _ _ (RingHom.toAlgebra f) := by change (K⟮x⟯ →ₐ[F] E) ≃ Σ f : K →ₐ[F] E, _ exact algHomEquivSigma - haveI : ∀ f : K →ₐ[F] E, Finite (@AlgHom K K⟮x⟯ E _ _ _ _ (RingHom.toAlgebra f)) := fun f => by + have : ∀ f : K →ₐ[F] E, Finite (@AlgHom K K⟮x⟯ E _ _ _ _ (RingHom.toAlgebra f)) := fun f => by have := Finite.of_equiv _ key_equiv apply Finite.of_injective (Sigma.mk f) fun _ _ H => eq_of_heq (Sigma.ext_iff.mp H).2 have : FiniteDimensional F K := FiniteDimensional.left F K E diff --git a/Mathlib/FieldTheory/Galois/IsGaloisGroup.lean b/Mathlib/FieldTheory/Galois/IsGaloisGroup.lean index 718a1f72439570..507a2b42dbd982 100644 --- a/Mathlib/FieldTheory/Galois/IsGaloisGroup.lean +++ b/Mathlib/FieldTheory/Galois/IsGaloisGroup.lean @@ -418,11 +418,11 @@ theorem algebraMap_quotientMulEquiv_smul [Finite G] [Finite G'] (N : Subgroup G) [MulSemiringAction G C] [IsGaloisGroup G A C] [IsGaloisGroup N B C] [MulSemiringAction G' B] [IsGaloisGroup G' A B] (g : G) (x : B) : algebraMap B C (quotientMulEquiv G G' A B C N g • x) = g • algebraMap B C x := by - haveI : IsDomain B := (FaithfulSMul.algebraMap_injective B C).isDomain - letI := mulSemiringActionOfNormal G B C N - letI := mulSemiringActionQuotient G B C N - haveI := smulCommClassQuotient G A B C N - haveI := quotient G A B C N + have : IsDomain B := (FaithfulSMul.algebraMap_injective B C).isDomain + let := mulSemiringActionOfNormal G B C N + let := mulSemiringActionQuotient G B C N + have := smulCommClassQuotient G A B C N + have := quotient G A B C N rw [← algebraMap_smulOfNormal G B C N g x] congr apply mulEquivCongr_apply_smul diff --git a/Mathlib/FieldTheory/Galois/Profinite.lean b/Mathlib/FieldTheory/Galois/Profinite.lean index 8c3ec86b00cdbf..1fa9e055db3ca3 100644 --- a/Mathlib/FieldTheory/Galois/Profinite.lean +++ b/Mathlib/FieldTheory/Galois/Profinite.lean @@ -190,8 +190,8 @@ lemma proj_of_le (L : FiniteGaloisIntermediateField k K) (proj L g x).val = (proj L' g ⟨x, h x.2⟩).val := by induction L with | _ L => ?_ induction L' with | _ L' => ?_ - letI : Algebra L L' := RingHom.toAlgebra (Subsemiring.inclusion h) - letI : IsScalarTower k L L' := IsScalarTower.of_algebraMap_eq (congrFun rfl) + let : Algebra L L' := RingHom.toAlgebra (Subsemiring.inclusion h) + let : IsScalarTower k L L' := IsScalarTower.of_algebraMap_eq (congrFun rfl) rw [← finGaloisGroupFunctor_map_proj_eq_proj g h.hom] change (algebraMap L' K (algebraMap L L' (AlgEquiv.restrictNormal (proj (mk L') g) L x))) = _ rw [AlgEquiv.restrictNormal_commutes (proj (mk L') g) L] diff --git a/Mathlib/FieldTheory/IntermediateField/Adjoin/Basic.lean b/Mathlib/FieldTheory/IntermediateField/Adjoin/Basic.lean index b6280f1e11761d..8dd79bbbdeb15e 100644 --- a/Mathlib/FieldTheory/IntermediateField/Adjoin/Basic.lean +++ b/Mathlib/FieldTheory/IntermediateField/Adjoin/Basic.lean @@ -399,7 +399,7 @@ noncomputable def adjoinRootEquivAdjoin (h : IsIntegral F α) : (AdjoinRoot.liftAlgHom (minpoly F α) _ (AdjoinSimple.gen F α) (aeval_gen_minpoly F α)) (by set f := AdjoinRoot.lift _ _ (aeval_gen_minpoly F α :) - haveI := Fact.mk (minpoly.irreducible h) + have := Fact.mk (minpoly.irreducible h) constructor · exact RingHom.injective f · suffices F⟮α⟯.toSubfield ≤ RingHom.fieldRange (F⟮α⟯.toSubfield.subtype.comp f) by @@ -526,7 +526,7 @@ theorem exists_lt_finrank_of_infinite_dimensional rw [show L = ⊤ from eq_top_iff.2 fun x _ ↦ hnfd x] at fin exact topEquiv.toLinearEquiv.finiteDimensional let L' := L ⊔ F⟮x⟯ - haveI := adjoin.finiteDimensional (Algebra.IsIntegral.isIntegral (R := F) x) + have := adjoin.finiteDimensional (Algebra.IsIntegral.isIntegral (R := F) x) refine ⟨L', inferInstance, by_contra fun h ↦ ?_⟩ have h1 : L = L' := eq_of_le_of_finrank_le le_sup_left ((not_lt.1 h).trans hn) have h2 : F⟮x⟯ ≤ L' := le_sup_right @@ -563,7 +563,7 @@ theorem isAlgebraic_iSup {ι : Type*} {t : ι → IntermediateField K L} rintro ⟨x, hx⟩ obtain ⟨s, hx⟩ := exists_finset_of_mem_supr' hx rw [isAlgebraic_iff, Subtype.coe_mk, ← Subtype.coe_mk (p := (· ∈ _)) x hx, ← isAlgebraic_iff] - haveI : ∀ i : Σ i, t i, FiniteDimensional K K⟮(i.2 : L)⟯ := fun ⟨i, x⟩ ↦ + have : ∀ i : Σ i, t i, FiniteDimensional K K⟮(i.2 : L)⟯ := fun ⟨i, x⟩ ↦ adjoin.finiteDimensional (isIntegral_iff.1 (Algebra.IsIntegral.isIntegral x)) apply IsAlgebraic.of_finite @@ -578,7 +578,7 @@ A direct corollary of `finiteDimensional_iSup_of_finite`. -/ theorem finiteDimensional_adjoin {S : Set L} [Finite S] (hS : ∀ x ∈ S, IsIntegral K x) : FiniteDimensional K (adjoin K S) := by rw [← biSup_adjoin_simple, ← iSup_subtype''] - haveI (x : S) := adjoin.finiteDimensional (hS x.1 x.2) + have (x : S) := adjoin.finiteDimensional (hS x.1 x.2) exact finiteDimensional_iSup_of_finite end PowerBasis @@ -637,7 +637,7 @@ theorem _root_.Polynomial.irreducible_comp {f g : K[X]} (hfm : f.Monic) (hgm : g (this.trans natDegree_comp.symm).ge).irreducible hp₁ have := Fact.mk hp₁ let Kx := AdjoinRoot p - letI := (AdjoinRoot.powerBasis hp₁.ne_zero).finite + let := (AdjoinRoot.powerBasis hp₁.ne_zero).finite have key₁ : f = minpoly K (aeval (root p) g) := by refine minpoly.eq_of_irreducible_of_monic hf ?_ hfm rw [← aeval_comp] diff --git a/Mathlib/FieldTheory/IntermediateField/Algebraic.lean b/Mathlib/FieldTheory/IntermediateField/Algebraic.lean index 0898d2e4d45ed6..89785371530833 100644 --- a/Mathlib/FieldTheory/IntermediateField/Algebraic.lean +++ b/Mathlib/FieldTheory/IntermediateField/Algebraic.lean @@ -115,7 +115,7 @@ theorem eq_iff_finrank_eq_of_le' [FiniteDimensional F L] (h_le : F ≤ E) : lemma finrank_lt_of_gt [FiniteDimensional F L] (H : F < E) : Module.finrank E L < Module.finrank F L := by - letI := (IntermediateField.inclusion H.le).toAlgebra + let := (IntermediateField.inclusion H.le).toAlgebra have : IsScalarTower F E L := .of_algebraMap_eq' rfl refine lt_of_le_of_ne ?_ ?_ · exact Module.finrank_top_le_finrank_of_isScalarTower _ _ _ diff --git a/Mathlib/FieldTheory/IntermediateField/Basic.lean b/Mathlib/FieldTheory/IntermediateField/Basic.lean index 3e4e49af1025a5..32c932c6c3b446 100644 --- a/Mathlib/FieldTheory/IntermediateField/Basic.lean +++ b/Mathlib/FieldTheory/IntermediateField/Basic.lean @@ -286,7 +286,7 @@ def Subalgebra.toIntermediateField' (S : Subalgebra K L) (hS : IsField S) : Inte by_cases hx0 : x = 0 · rw [hx0, inv_zero] exact S.zero_mem - letI hS' := hS.toField + let hS' := hS.toField obtain ⟨y, hy⟩ := hS.mul_inv_cancel (show (⟨x, hx⟩ : S) ≠ 0 from Subtype.coe_ne_coe.1 hx0) rw [Subtype.ext_iff, S.coe_mul, S.coe_one, Subtype.coe_mk, mul_eq_one_iff_inv_eq₀ hx0] at hy exact hy.symm ▸ y.2 diff --git a/Mathlib/FieldTheory/IsAlgClosed/Basic.lean b/Mathlib/FieldTheory/IsAlgClosed/Basic.lean index 93456508dc1f3a..d506815e10ab59 100644 --- a/Mathlib/FieldTheory/IsAlgClosed/Basic.lean +++ b/Mathlib/FieldTheory/IsAlgClosed/Basic.lean @@ -346,8 +346,8 @@ private instance FractionRing.isAlgebraic : letI : IsDomain R := (FaithfulSMul.algebraMap_injective R S).isDomain _ letI : Algebra (FractionRing R) (FractionRing S) := FractionRing.liftAlgebra R _ Algebra.IsAlgebraic (FractionRing R) (FractionRing S) := by - letI : IsDomain R := (FaithfulSMul.algebraMap_injective R S).isDomain _ - letI : Algebra (FractionRing R) (FractionRing S) := FractionRing.liftAlgebra R _ + let : IsDomain R := (FaithfulSMul.algebraMap_injective R S).isDomain _ + let : Algebra (FractionRing R) (FractionRing S) := FractionRing.liftAlgebra R _ have := FractionRing.isScalarTower_liftAlgebra R (FractionRing S) have := (IsFractionRing.isAlgebraic_iff' R S (FractionRing S)).1 inferInstance exact ⟨fun _ ↦ (IsFractionRing.isAlgebraic_iff R (FractionRing R) (FractionRing S)).1 diff --git a/Mathlib/FieldTheory/IsAlgClosed/Classification.lean b/Mathlib/FieldTheory/IsAlgClosed/Classification.lean index f68f24028abb3f..755fe0c8892a40 100644 --- a/Mathlib/FieldTheory/IsAlgClosed/Classification.lean +++ b/Mathlib/FieldTheory/IsAlgClosed/Classification.lean @@ -95,7 +95,7 @@ theorem cardinal_le_max_transcendence_basis (hv : IsTranscendenceBasis R v) : calc Cardinal.lift.{max u w} #K ≤ Cardinal.lift.{max u w} (max #(Algebra.adjoin R (Set.range v)) ℵ₀) := by - letI := isAlgClosure_of_transcendence_basis v hv + let := isAlgClosure_of_transcendence_basis v hv simpa using Algebra.IsAlgebraic.cardinalMk_le_max (Algebra.adjoin R (Set.range v)) K _ = Cardinal.lift.{v} (max #(MvPolynomial ι R) ℵ₀) := by rw [lift_max, ← Cardinal.lift_mk_eq.2 ⟨hv.1.aevalEquiv.toEquiv⟩, lift_aleph0, @@ -173,8 +173,8 @@ theorem ringEquiv_of_equiv_of_charZero [CharZero K] [CharZero L] (hK : ℵ₀ < private theorem ringEquiv_of_Cardinal_eq_of_charP (p : ℕ) [Fact p.Prime] [CharP K p] [CharP L p] (hK : ℵ₀ < #K) (hKL : Nonempty (K ≃ L)) : Nonempty (K ≃+* L) := by - letI : Algebra (ZMod p) K := ZMod.algebra _ _ - letI : Algebra (ZMod p) L := ZMod.algebra _ _ + let : Algebra (ZMod p) K := ZMod.algebra _ _ + let : Algebra (ZMod p) L := ZMod.algebra _ _ obtain ⟨s, hs⟩ := exists_isTranscendenceBasis (ZMod p) K obtain ⟨t, ht⟩ := exists_isTranscendenceBasis (ZMod p) L have hL : ℵ₀ < #L := by @@ -193,11 +193,11 @@ if they have the same cardinality and the same characteristic. -/ theorem ringEquiv_of_equiv_of_char_eq (p : ℕ) [CharP K p] [CharP L p] (hK : ℵ₀ < #K) (hKL : Nonempty (K ≃ L)) : Nonempty (K ≃+* L) := by rcases CharP.char_is_prime_or_zero K p with (hp | hp) - · haveI : Fact p.Prime := ⟨hp⟩ + · have : Fact p.Prime := ⟨hp⟩ exact ringEquiv_of_Cardinal_eq_of_charP p hK hKL · simp only [hp] at * - letI : CharZero K := CharP.charP_to_charZero K - letI : CharZero L := CharP.charP_to_charZero L + let : CharZero K := CharP.charP_to_charZero K + let : CharZero L := CharP.charP_to_charZero L exact ringEquiv_of_equiv_of_charZero hK hKL end IsAlgClosed diff --git a/Mathlib/FieldTheory/KrullTopology.lean b/Mathlib/FieldTheory/KrullTopology.lean index 2388afc6796f00..e92eb2b63fae20 100644 --- a/Mathlib/FieldTheory/KrullTopology.lean +++ b/Mathlib/FieldTheory/KrullTopology.lean @@ -231,7 +231,7 @@ instance {K L : Type*} [Field K] [Field L] [Algebra K L] [Algebra.IsIntegral K L have hστ : σ⁻¹ * τ ≠ 1 := by rwa [Ne, inv_mul_eq_one] rcases DFunLike.exists_ne hστ with ⟨x, hx : (σ⁻¹ * τ) x ≠ x⟩ let E := IntermediateField.adjoin K ({x} : Set L) - haveI := IntermediateField.adjoin.finiteDimensional + have := IntermediateField.adjoin.finiteDimensional (Algebra.IsIntegral.isIntegral (R := K) x) refine ⟨σ • E.fixingSubgroup, ⟨E.fixingSubgroup_isClosed.leftCoset σ, E.fixingSubgroup_isOpen.leftCoset σ⟩, diff --git a/Mathlib/FieldTheory/KummerExtension.lean b/Mathlib/FieldTheory/KummerExtension.lean index d20b29ba748424..72af873d95f851 100644 --- a/Mathlib/FieldTheory/KummerExtension.lean +++ b/Mathlib/FieldTheory/KummerExtension.lean @@ -179,8 +179,8 @@ section AdjoinRoot include hζ H in /-- Also see `Polynomial.separable_X_pow_sub_C_unit` -/ theorem Polynomial.separable_X_pow_sub_C_of_irreducible : (X ^ n - C a).Separable := by - letI := Fact.mk H - letI : Algebra K K[n√a] := inferInstance + let := Fact.mk H + let : Algebra K K[n√a] := inferInstance have hn := Nat.pos_iff_ne_zero.mpr (ne_zero_of_irreducible_X_pow_sub_C H) by_cases hn' : n = 1 · rw [hn', pow_one]; exact separable_X_sub_C @@ -253,7 +253,7 @@ def autAdjoinRootXPowSubCEquiv [NeZero n] : intro η have := Fact.mk H have : IsDomain K[n√a] := inferInstance - letI : Algebra K K[n√a] := inferInstance + let : Algebra K K[n√a] := inferInstance apply (rootsOfUnityEquivOfPrimitiveRoots (algebraMap K K[n√a]).injective hζ).injective ext simp only [AdjoinRoot.algebraMap_eq, OneHom.toFun_eq_coe, MonoidHom.toOneHom_coe, @@ -268,7 +268,7 @@ def autAdjoinRootXPowSubCEquiv [NeZero n] : right_inv := by intro e have := Fact.mk H - letI : Algebra K K[n√a] := inferInstance + let : Algebra K K[n√a] := inferInstance apply AlgEquiv.coe_toAlgHom_injective apply AdjoinRoot.algHom_ext simp only [AdjoinRootXPowSubCEquivToRootsOfUnity, AdjoinRoot.algebraMap_eq, OneHom.toFun_eq_coe, @@ -311,7 +311,7 @@ lemma isSplittingField_AdjoinRoot_X_pow_sub_C : letI : Algebra K K[n√a] := inferInstance IsSplittingField K K[n√a] (X ^ n - C a) := by have := Fact.mk H - letI : Algebra K K[n√a] := inferInstance + let : Algebra K K[n√a] := inferInstance constructor · rw [Polynomial.map_sub, Polynomial.map_pow, Polynomial.map_C, Polynomial.map_X] @@ -333,8 +333,8 @@ noncomputable def adjoinRootXPowSubCEquiv (hζ : (primitiveRoots n K).Nonempty) (H : Irreducible (X ^ n - C a)) (hα : α ^ n = algebraMap K L a) : K[n√a] ≃ₐ[K] L := .ofBijective (AdjoinRoot.liftAlgHom (X ^ n - C a) (Algebra.ofId _ _) α (by simp [hα])) <| by - haveI := Fact.mk H - letI := isSplittingField_AdjoinRoot_X_pow_sub_C hζ H + have := Fact.mk H + let := isSplittingField_AdjoinRoot_X_pow_sub_C hζ H refine ⟨(liftAlgHom (X ^ n - C a) _ α _).injective, ?_⟩ rw [← AlgHom.range_eq_top, ← IsSplittingField.adjoin_rootSet _ (X ^ n - C a), eq_comm, Splits.adjoin_rootSet_eq_range, IsSplittingField.adjoin_rootSet] diff --git a/Mathlib/FieldTheory/LinearDisjoint.lean b/Mathlib/FieldTheory/LinearDisjoint.lean index 5894be8689642f..5405cd8891701d 100644 --- a/Mathlib/FieldTheory/LinearDisjoint.lean +++ b/Mathlib/FieldTheory/LinearDisjoint.lean @@ -630,10 +630,10 @@ theorem isDomain' {A B : Type*} [Field A] [Algebra F A] [Field B] [Algebra F B] theorem of_isField (H : IsField (A ⊗[F] L)) : A.LinearDisjoint L := by apply Subalgebra.LinearDisjoint.of_isField -- need these otherwise the `exact` will stuck at typeclass - haveI : SMulCommClass F A A := SMulCommClass.of_commMonoid F A A - haveI : SMulCommClass F A.toSubalgebra A.toSubalgebra := ‹SMulCommClass F A A› - letI : Mul (A ⊗[F] L) := Algebra.TensorProduct.instMul - letI : Mul (A.toSubalgebra ⊗[F] (IsScalarTower.toAlgHom F L E).range) := + have : SMulCommClass F A A := SMulCommClass.of_commMonoid F A A + have : SMulCommClass F A.toSubalgebra A.toSubalgebra := ‹SMulCommClass F A A› + let : Mul (A ⊗[F] L) := Algebra.TensorProduct.instMul + let : Mul (A.toSubalgebra ⊗[F] (IsScalarTower.toAlgHom F L E).range) := Algebra.TensorProduct.instMul exact Algebra.TensorProduct.congr (AlgEquiv.refl : A ≃ₐ[F] A) (AlgEquiv.ofInjective (IsScalarTower.toAlgHom F L E) (RingHom.injective _)) @@ -674,7 +674,7 @@ theorem isField_of_forall (A : Type v) [Field A] (B : Type w) [Field B] obtain ⟨M, hM⟩ := Ideal.exists_maximal (A ⊗[F] B) apply not_imp_not.1 (Ring.ne_bot_of_isMaximal_of_not_isField hM) let K : Type (max v w) := A ⊗[F] B ⧸ M - letI : Field K := Ideal.Quotient.field _ + let : Field K := Ideal.Quotient.field _ let i := IsScalarTower.toAlgHom F (A ⊗[F] B) K let fa := i.comp (Algebra.TensorProduct.includeLeft : A →ₐ[F] _) let fb := i.comp (Algebra.TensorProduct.includeRight : B →ₐ[F] _) diff --git a/Mathlib/FieldTheory/Minpoly/Basic.lean b/Mathlib/FieldTheory/Minpoly/Basic.lean index 60a802900b6e8f..ca19e0abb3af52 100644 --- a/Mathlib/FieldTheory/Minpoly/Basic.lean +++ b/Mathlib/FieldTheory/Minpoly/Basic.lean @@ -112,7 +112,7 @@ theorem map_ne_one [Nontrivial B] {R : Type*} [Semiring R] [Nontrivial R] (f : A /-- A minimal polynomial is not a unit. -/ theorem not_isUnit [Nontrivial B] : ¬IsUnit (minpoly A x) := by - haveI : Nontrivial A := (algebraMap A B).domain_nontrivial + have : Nontrivial A := (algebraMap A B).domain_nontrivial by_cases hx : IsIntegral A x · exact mt (monic hx).eq_one_of_isUnit (ne_one A x) · rw [eq_zero hx] @@ -213,7 +213,7 @@ open Polynomial in theorem degree_eq_one_iff : (minpoly A x).degree = 1 ↔ x ∈ (algebraMap A B).range := by refine ⟨minpoly.mem_range_of_degree_eq_one _ _, ?_⟩ rintro ⟨x, rfl⟩ - haveI := Module.nontrivial A B + have := Module.nontrivial A B exact (degree_X_sub_C x ▸ minpoly.min A (algebraMap A B x) (monic_X_sub_C x) (by simp)).antisymm (Nat.WithBot.add_one_le_of_lt <| minpoly.degree_pos isIntegral_algebraMap) diff --git a/Mathlib/FieldTheory/Normal/Basic.lean b/Mathlib/FieldTheory/Normal/Basic.lean index 96b5e118c94bab..bdd25a16e7bbf0 100644 --- a/Mathlib/FieldTheory/Normal/Basic.lean +++ b/Mathlib/FieldTheory/Normal/Basic.lean @@ -67,7 +67,7 @@ theorem Normal.of_isSplittingField (p : F[X]) [hFEp : IsSplittingField F E p] : exact Normal.of_algEquiv (AlgEquiv.ofBijective (Algebra.ofId F E) (Algebra.bijective_algebraMap_iff.2 this.symm)) refine normal_iff.mpr fun x ↦ ?_ - haveI : FiniteDimensional F E := IsSplittingField.finiteDimensional E p + have : FiniteDimensional F E := IsSplittingField.finiteDimensional E p have hx := IsIntegral.of_finite F x let L := (p * minpoly F x).SplittingField have hL := SplittingField.splits (p * minpoly F x) @@ -77,7 +77,7 @@ theorem Normal.of_isSplittingField (p : F[X]) [hFEp : IsSplittingField F E p] : rw [← j.comp_algebraMap, ← Polynomial.map_map] at hL2 refine ⟨hx, Splits.of_splits_map (j : E →+* L) hL2 fun a ha ↦ ?_⟩ rw [Polynomial.map_map, j.comp_algebraMap] at ha - letI : Algebra F⟮x⟯ L := ((algHomAdjoinIntegralEquiv F hx).symm ⟨a, ha⟩).toRingHom.toAlgebra + let : Algebra F⟮x⟯ L := ((algHomAdjoinIntegralEquiv F hx).symm ⟨a, ha⟩).toRingHom.toAlgebra let j' : E →ₐ[F⟮x⟯] L := IsSplittingField.lift E (p.map (algebraMap F F⟮x⟯)) ?_ · change a ∈ j.range rw [← IsSplittingField.adjoin_rootSet_eq_range E p j, @@ -100,7 +100,7 @@ instance normal_iSup {ι : Type*} (t : ι → IntermediateField F K) [h : ∀ i, obtain ⟨s, hx⟩ := exists_finset_of_mem_supr'' (fun i => (h i).1) x.2 let E : IntermediateField F K := ⨆ i ∈ s, adjoin F ((minpoly F (i.2 :)).rootSet K) have hF : Normal F E := by - haveI : IsSplittingField F E (∏ i ∈ s, minpoly F i.snd) := by + have : IsSplittingField F E (∏ i ∈ s, minpoly F i.snd) := by refine isSplittingField_iSup ?_ fun i _ => adjoin_rootSet_isSplittingField ?_ · exact Finset.prod_ne_zero_iff.mpr fun i _ => minpoly.ne_zero ((h i.1).isIntegral i.2) · simpa [Polynomial.map_map] using! ((h i.1).splits i.2).map (algebraMap (t i.1) K) diff --git a/Mathlib/FieldTheory/Normal/Closure.lean b/Mathlib/FieldTheory/Normal/Closure.lean index 38be50328034fd..75e15cd4f7e671 100644 --- a/Mathlib/FieldTheory/Normal/Closure.lean +++ b/Mathlib/FieldTheory/Normal/Closure.lean @@ -174,7 +174,7 @@ instance normal [h : Normal F L] : Normal F (normalClosure F K L) := by @[stacks 0BMG "When `L` is normal over `K`, this agrees with 0BMG (1) finiteness."] instance is_finiteDimensional [FiniteDimensional F K] : FiniteDimensional F (normalClosure F K L) := by - haveI : ∀ f : K →ₐ[F] L, FiniteDimensional F f.fieldRange := fun f ↦ + have : ∀ f : K →ₐ[F] L, FiniteDimensional F f.fieldRange := fun f ↦ f.toLinearMap.finiteDimensional_range apply IntermediateField.finiteDimensional_iSup_of_finite diff --git a/Mathlib/FieldTheory/Perfect.lean b/Mathlib/FieldTheory/Perfect.lean index b3987a9aa0062b..f84e7d48620242 100644 --- a/Mathlib/FieldTheory/Perfect.lean +++ b/Mathlib/FieldTheory/Perfect.lean @@ -299,7 +299,7 @@ lemma PerfectRing.toPerfectField (K : Type*) (p : ℕ) refine PerfectField.mk fun hf ↦ ?_ rcases separable_or p hf with h | ⟨-, g, -, rfl⟩ · assumption - · exfalso; revert hf; haveI := Fact.mk hp; simp + · exfalso; revert hf; have := Fact.mk hp; simp namespace PerfectField diff --git a/Mathlib/FieldTheory/PolynomialGaloisGroup.lean b/Mathlib/FieldTheory/PolynomialGaloisGroup.lean index fc229f5e2f5dd5..b752e99329a38f 100644 --- a/Mathlib/FieldTheory/PolynomialGaloisGroup.lean +++ b/Mathlib/FieldTheory/PolynomialGaloisGroup.lean @@ -230,7 +230,7 @@ theorem restrictDvd_def [Decidable (q = 0)] (hpq : p ∣ q) : theorem restrictDvd_surjective (hpq : p ∣ q) (hq : q ≠ 0) : Function.Surjective (restrictDvd hpq) := by classical - haveI := Fact.mk <| + have := Fact.mk <| (SplittingField.splits q).of_dvd (map_ne_zero hq) ((map_dvd_map' _).mpr hpq) simpa only [restrictDvd_def, dif_neg hq] using! restrict_surjective _ _ @@ -253,7 +253,7 @@ theorem restrictProd_injective : Function.Injective (restrictProd p q) := by ext (x hx) rw [rootSet_def, aroots_mul hpq] at hx rcases Multiset.mem_add.mp (Multiset.mem_toFinset.mp hx) with h | h - · haveI : Fact ((p.map (algebraMap F (p * q).SplittingField)).Splits) := + · have : Fact ((p.map (algebraMap F (p * q).SplittingField)).Splits) := ⟨(SplittingField.splits (p * q)).of_dvd (map_ne_zero hpq) ((map_dvd_map' _).mpr (dvd_mul_right p q))⟩ have key : @@ -264,7 +264,7 @@ theorem restrictProd_injective : Function.Injective (restrictProd p q) := by Subtype.ext_iff.mp (Equiv.apply_symm_apply (rootsEquivRoots p _) ⟨x, _⟩).symm rw [key, ← AlgEquiv.restrictNormal_commutes, ← AlgEquiv.restrictNormal_commutes] exact congr_arg _ (AlgEquiv.ext_iff.mp hfg.1 _) - · haveI : Fact ((q.map (algebraMap F (p * q).SplittingField)).Splits) := + · have : Fact ((q.map (algebraMap F (p * q).SplittingField)).Splits) := ⟨(SplittingField.splits (p * q)).of_dvd (map_ne_zero hpq) ((map_dvd_map' _).mpr (dvd_mul_left q p))⟩ have key : @@ -335,7 +335,7 @@ def restrictComp (hq : q.natDegree ≠ 0) : (p.comp q).Gal →* p.Gal := theorem restrictComp_surjective (hq : q.natDegree ≠ 0) : Function.Surjective (restrictComp p q hq) := by - haveI : Fact (Splits (p.map (algebraMap F (SplittingField (comp p q))))) := + have : Fact (Splits (p.map (algebraMap F (SplittingField (comp p q))))) := ⟨splits_in_splittingField_of_comp p q hq⟩ simpa only [restrictComp] using! restrict_surjective _ _ @@ -359,7 +359,7 @@ theorem prime_degree_dvd_card [CharZero F] (p_irr : Irreducible p) (p_deg : p.na have hα : IsIntegral F α := .of_finite F α use Module.finrank F⟮α⟯ p.SplittingField suffices (minpoly F α).natDegree = p.natDegree by - letI _ : AddCommGroup F⟮α⟯ := Ring.toAddCommGroup + let _ : AddCommGroup F⟮α⟯ := Ring.toAddCommGroup rw [← Module.finrank_mul_finrank F F⟮α⟯ p.SplittingField, IntermediateField.adjoin.finrank hα, this] suffices minpoly F α ∣ p by diff --git a/Mathlib/FieldTheory/PrimitiveElement.lean b/Mathlib/FieldTheory/PrimitiveElement.lean index 7808f3e877d094..bf7018053ae58d 100644 --- a/Mathlib/FieldTheory/PrimitiveElement.lean +++ b/Mathlib/FieldTheory/PrimitiveElement.lean @@ -218,7 +218,7 @@ theorem exists_primitive_element : ∃ α : E, F⟮α⟯ = ⊤ := by intro K β hK obtain ⟨α, hK⟩ := hK rw [← hK, adjoin_simple_adjoin_simple] - haveI : Infinite F := isEmpty_fintype.mp F_inf + have : Infinite F := isEmpty_fintype.mp F_inf obtain ⟨γ, hγ⟩ := primitive_element_inf_aux F α β exact ⟨γ, hγ.symm⟩ exact induction_on_adjoin P base ih ⊤ @@ -279,7 +279,7 @@ theorem FiniteDimensional.of_finite_intermediateField [Finite (IntermediateField F E)] : FiniteDimensional F E := by let IF := { K : IntermediateField F E // ∃ x, K = F⟮x⟯ } have := isAlgebraic_of_finite_intermediateField F E - haveI : ∀ K : IF, FiniteDimensional F K.1 := fun ⟨_, x, rfl⟩ ↦ adjoin.finiteDimensional + have : ∀ K : IF, FiniteDimensional F K.1 := fun ⟨_, x, rfl⟩ ↦ adjoin.finiteDimensional (Algebra.IsIntegral.isIntegral _) have hfin := finiteDimensional_iSup_of_finite (t := fun K : IF ↦ K.1) have htop : ⨆ K : IF, K.1 = ⊤ := le_top.antisymm fun x _ ↦ @@ -289,7 +289,7 @@ theorem FiniteDimensional.of_finite_intermediateField theorem exists_primitive_element_of_finite_intermediateField [Finite (IntermediateField F E)] (K : IntermediateField F E) : ∃ α : E, F⟮α⟯ = K := by - haveI := FiniteDimensional.of_finite_intermediateField F E + have := FiniteDimensional.of_finite_intermediateField F E rcases finite_or_infinite F with (_ | _) · obtain ⟨α, h⟩ := exists_primitive_element_of_finite_bot F K exact ⟨α, by simpa only [lift_adjoin_simple, lift_top] using congr_arg lift h⟩ @@ -308,7 +308,7 @@ theorem FiniteDimensional.of_exists_primitive_element [Algebra.IsAlgebraic F E] -- A finite simple extension has only finitely many intermediate fields theorem finite_intermediateField_of_exists_primitive_element [Algebra.IsAlgebraic F E] (h : ∃ α : E, F⟮α⟯ = ⊤) : Finite (IntermediateField F E) := by - haveI := FiniteDimensional.of_exists_primitive_element F E h + have := FiniteDimensional.of_exists_primitive_element F E h obtain ⟨α, hprim⟩ := h -- Let `f` be the minimal polynomial of `α ∈ E` over `F` let f : F[X] := minpoly F α @@ -401,7 +401,7 @@ theorem primitive_element_iff_algHom_eq_of_eval (α : E) (φ : E →ₐ[F] A) : F⟮α⟯ = ⊤ ↔ ∀ ψ : E →ₐ[F] A, φ α = ψ α → φ = ψ := by refine ⟨fun h ψ hψ ↦ (Field.primitive_element_iff_algHom_eq_of_eval' F A hA α).mp h hψ, fun h ↦ eq_of_le_of_finrank_eq' le_top ?_⟩ - letI : Algebra F⟮α⟯ A := (φ.comp F⟮α⟯.val).toAlgebra + let : Algebra F⟮α⟯ A := (φ.comp F⟮α⟯.val).toAlgebra rw [IntermediateField.finrank_top, ← AlgHom.card_of_splits _ _ A, Fintype.card_eq_one_iff] · exact ⟨{ __ := φ, commutes' := fun _ ↦ rfl }, fun ψ ↦ AlgHom.restrictScalars_injective F <| Eq.symm <| h _ (ψ.commutes <| AdjoinSimple.gen F α).symm⟩ diff --git a/Mathlib/FieldTheory/PurelyInseparable/Basic.lean b/Mathlib/FieldTheory/PurelyInseparable/Basic.lean index e737a97e815e7d..74c9d3744a1090 100644 --- a/Mathlib/FieldTheory/PurelyInseparable/Basic.lean +++ b/Mathlib/FieldTheory/PurelyInseparable/Basic.lean @@ -248,7 +248,7 @@ then `K / E` is also purely inseparable. -/ theorem IsPurelyInseparable.tower_top [Algebra E K] [IsScalarTower F E K] [h : IsPurelyInseparable F K] : IsPurelyInseparable E K := by obtain ⟨q, _⟩ := ExpChar.exists F - haveI := expChar_of_injective_algebraMap (algebraMap F E).injective q + have := expChar_of_injective_algebraMap (algebraMap F E).injective q rw [isPurelyInseparable_iff_pow_mem _ q] at h ⊢ intro x obtain ⟨n, y, h⟩ := h x @@ -260,7 +260,7 @@ purely inseparable. -/ theorem IsPurelyInseparable.trans [Algebra E K] [IsScalarTower F E K] [h1 : IsPurelyInseparable F E] [h2 : IsPurelyInseparable E K] : IsPurelyInseparable F K := by obtain ⟨q, _⟩ := ExpChar.exists F - haveI := expChar_of_injective_algebraMap (algebraMap F E).injective q + have := expChar_of_injective_algebraMap (algebraMap F E).injective q rw [isPurelyInseparable_iff_pow_mem _ q] at h1 h2 ⊢ intro x obtain ⟨n, y, h2⟩ := h2 x @@ -375,7 +375,7 @@ theorem injective_comp_algebraMap [CommRing L] [IsReduced L] : replace heq := congr($heq y) simp_rw [RingHom.comp_apply, h, map_pow] at heq nontriviality L - haveI := expChar_of_injective_ringHom (f.comp (algebraMap F E)).injective q + have := expChar_of_injective_ringHom (f.comp (algebraMap F E)).injective q exact iterateFrobenius_inj L q n heq theorem injective_restrictDomain [CommRing L] [IsReduced L] [Algebra R L] [IsScalarTower R F E] : @@ -483,8 +483,8 @@ instance separableClosure.isPurelyInseparable [Algebra.IsAlgebraic F E] : set L := separableClosure F E refine ⟨(IsAlgebraic.tower_top L (Algebra.IsAlgebraic.isAlgebraic (R := F) x)).isIntegral, fun h ↦ ?_⟩ - haveI := (isSeparable_adjoin_simple_iff_isSeparable L E).2 h - haveI : Algebra.IsSeparable F (restrictScalars F L⟮x⟯) := Algebra.IsSeparable.trans F L L⟮x⟯ + have := (isSeparable_adjoin_simple_iff_isSeparable L E).2 h + have : Algebra.IsSeparable F (restrictScalars F L⟮x⟯) := Algebra.IsSeparable.trans F L L⟮x⟯ have hx : x ∈ L⟮x⟯.restrictScalars F := mem_adjoin_simple_self _ x exact ⟨⟨x, mem_separableClosure_iff.2 <| isSeparable_of_mem_isSeparable F E hx⟩, rfl⟩ @@ -511,9 +511,9 @@ separable closure of `F` in `E` if and only if `E` is purely inseparable over it theorem separableClosure_le_iff [Algebra.IsAlgebraic F E] (L : IntermediateField F E) : separableClosure F E ≤ L ↔ IsPurelyInseparable L E := by refine ⟨fun h ↦ ?_, fun _ ↦ separableClosure_le F E L⟩ - letI := (inclusion h).toAlgebra - letI : SMul (separableClosure F E) L := Algebra.toSMul - haveI : IsScalarTower (separableClosure F E) L E := IsScalarTower.of_algebraMap_eq (congrFun rfl) + let := (inclusion h).toAlgebra + let : SMul (separableClosure F E) L := Algebra.toSMul + have : IsScalarTower (separableClosure F E) L E := IsScalarTower.of_algebraMap_eq (congrFun rfl) exact IsPurelyInseparable.tower_top (separableClosure F E) L E /-- If an intermediate field of `E / F` is separable over `F`, and `E` is purely inseparable @@ -539,7 +539,7 @@ theorem IsPurelyInseparable.of_injective_comp_algebraMap (L : Type w) [Field L] [Nonempty (E →+* L)] (h : Function.Injective fun f : E →+* L ↦ f.comp (algebraMap F E)) : IsPurelyInseparable F E := by rw [isPurelyInseparable_iff_finSepDegree_eq_one, finSepDegree, Nat.card_eq_one_iff_unique] - letI := (Classical.arbitrary (E →+* L)).toAlgebra + let := (Classical.arbitrary (E →+* L)).toAlgebra let j : AlgebraicClosure E →ₐ[E] L := IsAlgClosed.lift exact ⟨⟨fun f g ↦ DFunLike.ext' <| j.injective.comp_left (congr_arg (⇑) <| @h (j.toRingHom.comp f) (j.toRingHom.comp g) (by ext; simp))⟩, inferInstance⟩ @@ -558,7 +558,7 @@ purely inseparable. -/ theorem isSepClosed_iff_isPurelyInseparable_algebraicClosure [IsAlgClosure F E] : IsSepClosed F ↔ IsPurelyInseparable F E := ⟨fun _ ↦ inferInstance, fun H ↦ by - haveI := IsAlgClosure.isAlgClosed F (K := E) + have := IsAlgClosure.isAlgClosed F (K := E) rwa [← separableClosure.eq_bot_iff, IsSepClosed.separableClosure_eq_bot_iff] at H⟩ variable {F E} in @@ -627,7 +627,7 @@ theorem adjoin_eq_of_isAlgebraic [Algebra.IsAlgebraic F E] : set S := separableClosure E K have h := congr_arg lift (adjoin_eq_of_isAlgebraic_of_isSeparable (F := F) S) rw [lift_top, lift_adjoin] at h - haveI : IsScalarTower F S K := IsScalarTower.of_algebraMap_eq (congrFun rfl) + have : IsScalarTower F S K := IsScalarTower.of_algebraMap_eq (congrFun rfl) rw [← h, ← map_eq_of_separableClosure_eq_bot F (separableClosure_eq_bot E K)] simp only [S, coe_map, IsScalarTower.coe_toAlgHom', IntermediateField.algebraMap_apply] diff --git a/Mathlib/FieldTheory/PurelyInseparable/PerfectClosure.lean b/Mathlib/FieldTheory/PurelyInseparable/PerfectClosure.lean index d22f0846dcb214..46234c6a9314fb 100644 --- a/Mathlib/FieldTheory/PurelyInseparable/PerfectClosure.lean +++ b/Mathlib/FieldTheory/PurelyInseparable/PerfectClosure.lean @@ -179,7 +179,7 @@ end map `perfectClosure F E` is perfect. -/ instance perfectClosure.perfectRing (p : ℕ) [ExpChar E p] [PerfectRing E p] : PerfectRing (perfectClosure F E) p := .ofSurjective _ p fun x ↦ by - haveI := RingHom.expChar _ (algebraMap F E).injective p + have := RingHom.expChar _ (algebraMap F E).injective p obtain ⟨x', hx⟩ := surjective_frobenius E p x.1 obtain ⟨n, y, hy⟩ := (mem_perfectClosure_iff_pow_mem p).1 x.2 rw [frobenius_def] at hx @@ -240,10 +240,10 @@ theorem adjoin_eq_adjoin_pow_expChar_pow_of_isSeparable (S : Set E) rw [adjoin_le_iff] rintro _ ⟨y, hy, rfl⟩ exact pow_mem (subset_adjoin F S hy) _ - letI := (inclusion hi).toAlgebra - haveI : Algebra.IsSeparable M (extendScalars hi) := + let := (inclusion hi).toAlgebra + have : Algebra.IsSeparable M (extendScalars hi) := Algebra.isSeparable_tower_top_of_isSeparable F M L - haveI : IsPurelyInseparable M (extendScalars hi) := by + have : IsPurelyInseparable M (extendScalars hi) := by rw [extendScalars_adjoin hi, isPurelyInseparable_adjoin_iff_pow_mem M _ q] exact fun x hx ↦ ⟨n, ⟨x ^ q ^ n, subset_adjoin F _ ⟨x, hx, rfl⟩⟩, rfl⟩ simpa only [extendScalars_restrictScalars, restrictScalars_bot_eq_self] using congr_arg @@ -275,7 +275,7 @@ theorem adjoin_eq_adjoin_pow_expChar_of_isSeparable' [Algebra.IsSeparable F E] ( `F⟮a⟯ = F⟮a ^ q ^ n⟯` for any natural number `n`. -/ theorem adjoin_simple_eq_adjoin_pow_expChar_pow_of_isSeparable {a : E} (ha : IsSeparable F a) (q : ℕ) [ExpChar F q] (n : ℕ) : F⟮a⟯ = F⟮a ^ q ^ n⟯ := by - haveI := (isSeparable_adjoin_simple_iff_isSeparable F E).mpr ha + have := (isSeparable_adjoin_simple_iff_isSeparable F E).mpr ha simpa using adjoin_eq_adjoin_pow_expChar_pow_of_isSeparable F E {a} q n /-- If `E / F` is a separable field extension of exponential characteristic `q`, then @@ -318,7 +318,7 @@ theorem Field.span_map_pow_expChar_pow_eq_top_of_isSeparable [Algebra.IsSeparabl rw [this] refine (Submodule.span_mono <| Set.range_comp_subset_range _ _).antisymm (Submodule.span_le.2 ?_) rw [Set.range_comp, ← Set.image_univ] - haveI := expChar_of_injective_algebraMap (algebraMap F E).injective q + have := expChar_of_injective_algebraMap (algebraMap F E).injective q apply h ▸ Submodule.image_span_subset_span (LinearMap.iterateFrobenius F E q n) _ /-- If `E / F` is a finite separable extension of exponential characteristic `q`, if `{ u_i }` is a @@ -332,7 +332,7 @@ private theorem LinearIndependent.map_pow_expChar_pow_of_fd_isSeparable have h' := h.linearIndepOn_id let ι' := h'.extend (Set.range v).subset_univ let b : Basis ι' F E := Basis.extend h' - letI : Fintype ι' := FiniteDimensional.fintypeBasisIndex b + let : Fintype ι' := FiniteDimensional.fintypeBasisIndex b have H := linearIndependent_of_top_le_span_of_card_eq_finrank (Field.span_map_pow_expChar_pow_eq_top_of_isSeparable q n b.span_eq).ge (Module.finrank_eq_card_basis b).symm @@ -350,7 +350,7 @@ theorem LinearIndependent.map_pow_expChar_pow_of_isSeparable [Algebra.IsSeparabl rw [linearIndependent_iff_finset_linearIndependent] at h ⊢ intro s let E' := adjoin F (s.image v : Set E) - haveI : FiniteDimensional F E' := finiteDimensional_adjoin + have : FiniteDimensional F E' := finiteDimensional_adjoin fun x _ ↦ Algebra.IsIntegral.isIntegral x let v' (i : s) : E' := ⟨v i.1, subset_adjoin F _ (Finset.mem_image.2 ⟨i.1, i.2, rfl⟩)⟩ have h' : LinearIndependent F v' := (h s).of_comp E'.val.toLinearMap @@ -364,7 +364,7 @@ theorem LinearIndependent.map_pow_expChar_pow_of_isSeparable' (hsep : ∀ i : ι, IsSeparable F (v i)) (h : LinearIndependent F v) : LinearIndependent F (v · ^ q ^ n) := by let E' := adjoin F (Set.range v) - haveI : Algebra.IsSeparable F E' := (isSeparable_adjoin_iff_isSeparable F _).2 <| by + have : Algebra.IsSeparable F E' := (isSeparable_adjoin_iff_isSeparable F _).2 <| by rintro _ ⟨y, rfl⟩; exact hsep y let v' (i : ι) : E' := ⟨v i, subset_adjoin F _ ⟨i, rfl⟩⟩ have h' : LinearIndependent F v' := h.of_comp E'.val.toLinearMap @@ -410,8 +410,8 @@ end theorem perfectField_of_perfectClosure_eq_bot [h : PerfectField E] (eq : perfectClosure F E = ⊥) : PerfectField F := by let p := ringExpChar F - haveI := expChar_of_injective_algebraMap (algebraMap F E).injective p - haveI := PerfectRing.ofSurjective F p fun x ↦ by + have := expChar_of_injective_algebraMap (algebraMap F E).injective p + have := PerfectRing.ofSurjective F p fun x ↦ by obtain ⟨y, h⟩ := surjective_frobenius E p (algebraMap F E x) have : y ∈ perfectClosure F E := ⟨1, x, by rw [← h, pow_one, frobenius_def, ringExpChar.eq F p]⟩ obtain ⟨z, rfl⟩ := eq ▸ this diff --git a/Mathlib/FieldTheory/PurelyInseparable/Tower.lean b/Mathlib/FieldTheory/PurelyInseparable/Tower.lean index 832583fd13a49b..f34105fab10298 100644 --- a/Mathlib/FieldTheory/PurelyInseparable/Tower.lean +++ b/Mathlib/FieldTheory/PurelyInseparable/Tower.lean @@ -66,7 +66,7 @@ theorem LinearIndependent.map_of_isPurelyInseparable_of_isSeparable [IsPurelyIns {ι : Type*} {v : ι → K} (hsep : ∀ i : ι, IsSeparable F (v i)) (h : LinearIndependent F v) : LinearIndependent E v := by obtain ⟨q, _⟩ := ExpChar.exists F - haveI := expChar_of_injective_algebraMap (algebraMap F K).injective q + have := expChar_of_injective_algebraMap (algebraMap F K).injective q refine linearIndependent_iff.mpr fun l hl ↦ Finsupp.ext fun i ↦ ?_ choose f hf using fun i ↦ (isPurelyInseparable_iff_pow_mem F q).1 ‹_› (l i) let n := l.support.sup f @@ -149,7 +149,7 @@ intermediate result used to prove it. -/ lemma sepDegree_eq_of_isPurelyInseparable [IsPurelyInseparable F E] : sepDegree F K = sepDegree E K := by convert! sepDegree_eq_of_isPurelyInseparable_of_isSeparable F E (separableClosure E K) - haveI : IsScalarTower F (separableClosure E K) K := IsScalarTower.of_algebraMap_eq (congrFun rfl) + have : IsScalarTower F (separableClosure E K) K := IsScalarTower.of_algebraMap_eq (congrFun rfl) rw [sepDegree, ← separableClosure.map_eq_of_separableClosure_eq_bot F (separableClosure.separableClosure_eq_bot E K)] exact (separableClosure F (separableClosure E K)).equivMap @@ -227,10 +227,10 @@ theorem IntermediateField.sepDegree_adjoin_eq_of_isAlgebraic_of_isPurelyInsepara rw [restrictScalars_adjoin_of_algEquiv (E := K) j rfl, restrictScalars_adjoin] exact adjoin.mono _ _ _ Set.subset_union_right let i : M →+* L := Subsemiring.inclusion hi - letI : Algebra M L := i.toAlgebra - letI : SMul M L := Algebra.toSMul - haveI : IsScalarTower F M L := IsScalarTower.of_algebraMap_eq (congrFun rfl) - haveI : IsPurelyInseparable M L := by + let : Algebra M L := i.toAlgebra + let : SMul M L := Algebra.toSMul + have : IsScalarTower F M L := IsScalarTower.of_algebraMap_eq (congrFun rfl) + have : IsPurelyInseparable M L := by change IsPurelyInseparable M (extendScalars hi) obtain ⟨q, _⟩ := ExpChar.exists F have : extendScalars hi = adjoin M (E' : Set K) := restrictScalars_injective F <| by @@ -270,8 +270,8 @@ theorem minpoly.map_eq_of_isSeparable_of_isPurelyInseparable (x : K) refine eq_of_monic_of_dvd_of_natDegree_le (monic hi') ((monic hi).map (algebraMap F E)) (dvd_map_of_isScalarTower F E x) (le_of_eq ?_) have hsep' := IsSeparable.tower_top E hsep - haveI := (isSeparable_adjoin_simple_iff_isSeparable _ _).2 hsep - haveI := (isSeparable_adjoin_simple_iff_isSeparable _ _).2 hsep' + have := (isSeparable_adjoin_simple_iff_isSeparable _ _).2 hsep + have := (isSeparable_adjoin_simple_iff_isSeparable _ _).2 hsep' have := Algebra.IsSeparable.isAlgebraic F F⟮x⟯ rw [Polynomial.natDegree_map, ← adjoin.finrank hi, ← adjoin.finrank hi', ← finSepDegree_eq_finrank_of_isSeparable F _, ← finSepDegree_eq_finrank_of_isSeparable E _, diff --git a/Mathlib/FieldTheory/RatFunc/Basic.lean b/Mathlib/FieldTheory/RatFunc/Basic.lean index d99cb6ca38a10a..4425d45880ab37 100644 --- a/Mathlib/FieldTheory/RatFunc/Basic.lean +++ b/Mathlib/FieldTheory/RatFunc/Basic.lean @@ -198,7 +198,7 @@ variable [Monoid R] [DistribMulAction R K[X]] variable [IsScalarTower R K[X] K[X]] theorem mk_smul (c : R) (p q : K[X]) : RatFunc.mk (c • p) q = c • RatFunc.mk p q := by - letI : SMulZeroClass R (FractionRing K[X]) := inferInstance + let : SMulZeroClass R (FractionRing K[X]) := inferInstance by_cases hq : q = 0 · rw [hq, mk_zero, mk_zero, ← ofFractionRing_smul, smul_zero] · rw [mk_eq_localization_mk _ hq, mk_eq_localization_mk _ hq, ← Localization.smul_mk, ← diff --git a/Mathlib/FieldTheory/RatFunc/IntermediateField.lean b/Mathlib/FieldTheory/RatFunc/IntermediateField.lean index 5fd7aeac0fe1f0..e12687c9a206da 100644 --- a/Mathlib/FieldTheory/RatFunc/IntermediateField.lean +++ b/Mathlib/FieldTheory/RatFunc/IntermediateField.lean @@ -148,7 +148,7 @@ theorem irreducible_minpolyX' (hf : ¬∃ c, f = C c) : Irreducible (f.minpolyX exact sub_eq_add_neg (Polynomial.C f.num) (Polynomial.C f.denom * Polynomial.X) theorem irreducible_minpolyX (hf : ¬∃ c, f = C c) : Irreducible (f.minpolyX K⟮f⟯) := by - haveI : UniqueFactorizationMonoid K[f] := + have : UniqueFactorizationMonoid K[f] := (f.transcendental_of_ne_C hf).uniqueFactorizationMonoid_adjoin rw [← f.minpolyX_map K[f] K⟮f⟯, ← IsPrimitive.irreducible_iff_irreducible_map_fraction_map] diff --git a/Mathlib/FieldTheory/Relrank.lean b/Mathlib/FieldTheory/Relrank.lean index 0c5de1459a4ff3..b4cc9090b0c348 100644 --- a/Mathlib/FieldTheory/Relrank.lean +++ b/Mathlib/FieldTheory/Relrank.lean @@ -107,8 +107,8 @@ alias ⟨_, relfinrank_eq_one_of_le⟩ := relfinrank_eq_one_iff theorem relrank_mul_rank_top (h : A ≤ B) : relrank A B * Module.rank B E = Module.rank A E := by rw [relrank_eq_rank_of_le h] - letI : Algebra A B := (inclusion h).toAlgebra - haveI : IsScalarTower A B E := IsScalarTower.of_algebraMap_eq' rfl + let : Algebra A B := (inclusion h).toAlgebra + have : IsScalarTower A B E := IsScalarTower.of_algebraMap_eq' rfl exact rank_mul_rank A B E theorem relfinrank_mul_finrank_top (h : A ≤ B) : relfinrank A B * finrank B E = finrank A E := by @@ -230,10 +230,10 @@ theorem relrank_mul_relrank (h1 : A ≤ B) (h2 : B ≤ C) : relrank A B * relrank B C = relrank A C := by have h3 := h1.trans h2 rw [relrank_eq_rank_of_le h1, relrank_eq_rank_of_le h2, relrank_eq_rank_of_le h3] - letI : Algebra A B := (inclusion h1).toAlgebra - letI : Algebra B C := (inclusion h2).toAlgebra - letI : Algebra A C := (inclusion h3).toAlgebra - haveI : IsScalarTower A B C := IsScalarTower.of_algebraMap_eq' rfl + let : Algebra A B := (inclusion h1).toAlgebra + let : Algebra B C := (inclusion h2).toAlgebra + let : Algebra A C := (inclusion h3).toAlgebra + have : IsScalarTower A B C := IsScalarTower.of_algebraMap_eq' rfl exact rank_mul_rank A B C variable {A B C} in @@ -436,7 +436,7 @@ theorem relfinrank_mul_finrank_top (h : A ≤ B) : relfinrank A B * finrank B E variable {A B} in theorem rank_bot_mul_relrank (h : A ≤ B) : Module.rank F A * relrank A B = Module.rank F B := by rw [relrank_eq_rank_of_le h] - letI : Algebra A B := (inclusion h).toAlgebra + let : Algebra A B := (inclusion h).toAlgebra exact rank_mul_rank F A B variable {A B} in diff --git a/Mathlib/FieldTheory/Separable.lean b/Mathlib/FieldTheory/Separable.lean index 6fe3e6458fa074..f118e695465557 100644 --- a/Mathlib/FieldTheory/Separable.lean +++ b/Mathlib/FieldTheory/Separable.lean @@ -345,11 +345,11 @@ theorem separable_or {f : F[X]} (hf : Irreducible f) : classical exact if H : derivative f = 0 then by rcases p.eq_zero_or_pos with (rfl | hp) - · haveI := CharP.charP_to_charZero F + · have := CharP.charP_to_charZero F have := derivative_eq_zero.1 H have := (natDegree_pos_iff_degree_pos.mpr <| degree_pos_of_irreducible hf).ne' contradiction - haveI := isLocalHom_expand F hp + have := isLocalHom_expand F hp exact Or.inr ⟨by rw [separable_iff_derivative_ne_zero hf, Classical.not_not, H], contract p f, @@ -565,7 +565,7 @@ variable {F} in because the minimal polynomial of a non-integral element is `0`, which is not separable. -/ theorem IsSeparable.isIntegral {x : K} (h : IsSeparable F x) : IsIntegral F x := by cases subsingleton_or_nontrivial F - · haveI := Module.subsingleton F K + · have := Module.subsingleton F K exact ⟨1, monic_one, Subsingleton.elim _ _⟩ · exact of_not_not (h.ne_zero <| minpoly.eq_zero ·) @@ -702,7 +702,7 @@ include f variable {F} in theorem IsSeparable.of_algHom {x : E} (h : IsSeparable F (f x)) : IsSeparable F x := by let _ : Algebra E E' := RingHom.toAlgebra f.toRingHom - haveI : IsScalarTower F E E' := IsScalarTower.of_algebraMap_eq fun x => (f.commutes x).symm + have : IsScalarTower F E E' := IsScalarTower.of_algebraMap_eq fun x => (f.commutes x).symm exact h.tower_bot diff --git a/Mathlib/FieldTheory/SeparableClosure.lean b/Mathlib/FieldTheory/SeparableClosure.lean index 43518d5675b070..e8344ba55beafe 100644 --- a/Mathlib/FieldTheory/SeparableClosure.lean +++ b/Mathlib/FieldTheory/SeparableClosure.lean @@ -436,7 +436,7 @@ theorem insepDegree_bot' : insepDegree F (⊥ : IntermediateField E K) = insepDe variable (F) in lemma _root_.Field.insepDegree_top_le_insepDegree_of_isScalarTower : insepDegree E K ≤ insepDegree F K := by - letI := (IntermediateField.inclusion (separableClosure.le_restrictScalars F E K)).toAlgebra + let := (IntermediateField.inclusion (separableClosure.le_restrictScalars F E K)).toAlgebra have : IsScalarTower (separableClosure F K) ((separableClosure E K).restrictScalars F) K := .of_algebraMap_eq' rfl exact Module.rank_top_le_rank_of_isScalarTower @@ -445,14 +445,14 @@ lemma _root_.Field.insepDegree_top_le_insepDegree_of_isScalarTower : variable {K} in lemma _root_.Field.insepDegree_le_of_left_le {E₁ E₂ : IntermediateField F K} (H : E₁ ≤ E₂) : insepDegree E₂ K ≤ insepDegree E₁ K := by - letI := (IntermediateField.inclusion H).toAlgebra + let := (IntermediateField.inclusion H).toAlgebra have : IsScalarTower E₁ E₂ K := .of_algebraMap_eq' rfl exact insepDegree_top_le_insepDegree_of_isScalarTower _ _ _ variable (F) in lemma _root_.Field.finInsepDegree_top_le_finInsepDegree_of_isScalarTower [Module.Finite F K] : finInsepDegree E K ≤ finInsepDegree F K := by - letI := (IntermediateField.inclusion (separableClosure.le_restrictScalars F E K)).toAlgebra + let := (IntermediateField.inclusion (separableClosure.le_restrictScalars F E K)).toAlgebra have : IsScalarTower (separableClosure F K) ((separableClosure E K).restrictScalars F) K := .of_algebraMap_eq' rfl exact Module.finrank_top_le_finrank_of_isScalarTower @@ -461,7 +461,7 @@ lemma _root_.Field.finInsepDegree_top_le_finInsepDegree_of_isScalarTower [Module variable {K} in lemma finInsepDegree_le_of_left_le {E₁ E₂ : IntermediateField F K} (H : E₁ ≤ E₂) [Module.Finite E₁ K] : finInsepDegree E₂ K ≤ finInsepDegree E₁ K := by - letI := (IntermediateField.inclusion H).toAlgebra + let := (IntermediateField.inclusion H).toAlgebra have : IsScalarTower E₁ E₂ K := .of_algebraMap_eq' rfl exact finInsepDegree_top_le_finInsepDegree_of_isScalarTower _ _ _ diff --git a/Mathlib/FieldTheory/SeparableDegree.lean b/Mathlib/FieldTheory/SeparableDegree.lean index 690441f0b98017..65e870ea96ac4c 100644 --- a/Mathlib/FieldTheory/SeparableDegree.lean +++ b/Mathlib/FieldTheory/SeparableDegree.lean @@ -485,7 +485,7 @@ theorem natSepDegree_expand (q : ℕ) [hF : ExpChar F q] {n : ℕ} : (expand F (q ^ n) f).natSepDegree = f.natSepDegree := by obtain - | hprime := hF · simp only [one_pow, expand_one] - haveI := Fact.mk hprime + have := Fact.mk hprime classical simpa only [natSepDegree_eq_of_isAlgClosed (AlgebraicClosure F), aroots_def, map_expand, Fintype.card_coe] using Fintype.card_eq.2 @@ -585,7 +585,7 @@ theorem eq_X_pow_char_pow_sub_C_of_natSepDegree_eq_one_of_irreducible (q : ℕ) exact ⟨0, y, .inl rfl, hf⟩ | prime hq => refine ⟨n, y, (em _).imp id fun hn ⟨z, hy⟩ ↦ ?_, hf⟩ - haveI := expChar_of_injective_ringHom (R := F) C_injective q + have := expChar_of_injective_ringHom (R := F) C_injective q rw [hf, ← Nat.succ_pred hn, pow_succ, pow_mul, ← hy, frobenius_def, map_pow, ← sub_pow_expChar] at hi exact not_irreducible_pow hq.ne_one hi @@ -671,8 +671,8 @@ separable degree one if and only if the minimal polynomial is of the form `(X - x) ^ (q ^ n)` for some `n : ℕ`. -/ theorem natSepDegree_eq_one_iff_eq_X_sub_C_pow : (minpoly F x).natSepDegree = 1 ↔ ∃ n : ℕ, (minpoly F x).map (algebraMap F E) = (X - C x) ^ q ^ n := by - haveI := expChar_of_injective_algebraMap (algebraMap F E).injective q - haveI := expChar_of_injective_ringHom (C_injective (R := E)) q + have := expChar_of_injective_algebraMap (algebraMap F E).injective q + have := expChar_of_injective_ringHom (C_injective (R := E)) q refine ⟨fun h ↦ ?_, fun ⟨n, h⟩ ↦ (natSepDegree_eq_one_iff_pow_mem q).2 ?_⟩ · obtain ⟨n, y, h⟩ := (natSepDegree_eq_one_iff_eq_X_pow_sub_C q).1 h have hx := congr_arg (Polynomial.aeval x) h.symm @@ -716,7 +716,7 @@ private theorem finSepDegree_adjoin_simple_dvd_finrank (α : E) : algebraic over `F`. -/ theorem finSepDegree_adjoin_simple_le_finrank (α : E) (halg : IsAlgebraic F α) : finSepDegree F F⟮α⟯ ≤ finrank F F⟮α⟯ := by - haveI := adjoin.finiteDimensional halg.isIntegral + have := adjoin.finiteDimensional halg.isIntegral exact Nat.le_of_dvd finrank_pos <| finSepDegree_adjoin_simple_dvd_finrank F E α /-- If `α` is algebraic over `F`, then the separable degree of `F⟮α⟯ / F` is equal to the degree @@ -800,7 +800,7 @@ theorem IntermediateField.isSeparable_adjoin_simple_iff_isSeparable {x : E} : refine ⟨fun _ ↦ ?_, fun hsep ↦ ?_⟩ · exact isSeparable_of_mem_isSeparable F E <| mem_adjoin_simple_self F x · have h := IsSeparable.isIntegral hsep - haveI := adjoin.finiteDimensional h + have := adjoin.finiteDimensional h rwa [← finSepDegree_eq_finrank_iff, finSepDegree_adjoin_simple_eq_finrank_iff F E x h.isAlgebraic] @@ -811,7 +811,7 @@ theorem IsSeparable.of_algebra_isSeparable_of_isSeparable [Algebra E K] [IsScala [Algebra.IsSeparable F E] {x : K} (hsep : IsSeparable E x) : IsSeparable F x := by set f := minpoly E x with hf let E' : IntermediateField F E := adjoin F f.coeffs - haveI : FiniteDimensional F E' := + have : FiniteDimensional F E' := finiteDimensional_adjoin fun x _ ↦ Algebra.IsSeparable.isIntegral F x let g : E'[X] := f.toSubring E'.toSubring (subset_adjoin F _) have h : g.map (algebraMap E' E) = f := f.map_toSubring E'.toSubring (subset_adjoin F _) @@ -823,10 +823,10 @@ theorem IsSeparable.of_algebra_isSeparable_of_isSeparable [Algebra E K] [IsScala isIntegral_trans (R := F) (A := E) _ (IsSeparable.isIntegral hsep) |>.tower_top simp only [IsSeparable, ← hf, ← h, separable_map] at hsep replace hsep := hsep.of_dvd <| minpoly.dvd E' x hzero - haveI : Algebra.IsSeparable F E' := Algebra.isSeparable_tower_bot_of_isSeparable F E' E - haveI := (isSeparable_adjoin_simple_iff_isSeparable _ _).2 hsep - haveI := adjoin.finiteDimensional halg - haveI : FiniteDimensional F E'⟮x⟯ := FiniteDimensional.trans F E' E'⟮x⟯ + have : Algebra.IsSeparable F E' := Algebra.isSeparable_tower_bot_of_isSeparable F E' E + have := (isSeparable_adjoin_simple_iff_isSeparable _ _).2 hsep + have := adjoin.finiteDimensional halg + have : FiniteDimensional F E'⟮x⟯ := FiniteDimensional.trans F E' E'⟮x⟯ have := finSepDegree_mul_finSepDegree_of_isAlgebraic F E' E'⟮x⟯ rw [finSepDegree_eq_finrank_of_isSeparable F E', finSepDegree_eq_finrank_of_isSeparable E' E'⟮x⟯, @@ -908,7 +908,7 @@ theorem perfectField_iff_splits_of_natSepDegree_eq_one (F : Type*) [Field F] : rw [h.natSepDegree_eq_natDegree, hf] at key exact Splits.of_natDegree_le_one key obtain ⟨p, _⟩ := ExpChar.exists F - haveI := PerfectRing.ofSurjective F p fun x ↦ by + have := PerfectRing.ofSurjective F p fun x ↦ by obtain ⟨y, hy⟩ := Splits.exists_eval_eq_zero (h _ (pow_one p ▸ natSepDegree_X_pow_char_pow_sub_C p 1 x)) ((degree_X_pow_sub_C (expChar_pos F p) x).symm ▸ Nat.cast_pos.2 (expChar_pos F p)).ne' diff --git a/Mathlib/Geometry/Euclidean/Altitude.lean b/Mathlib/Geometry/Euclidean/Altitude.lean index cf2c704ce1e916..25cda183f866e8 100644 --- a/Mathlib/Geometry/Euclidean/Altitude.lean +++ b/Mathlib/Geometry/Euclidean/Altitude.lean @@ -106,7 +106,7 @@ lemma altitude_restrict_eq_comap_subtype {n : ℕ} (s : Simplex ℝ P n) (S : Af (hS : affineSpan ℝ (Set.range s.points) ≤ S) (i : Fin (n + 1)) : haveI := Nonempty.map (AffineSubspace.inclusion hS) inferInstance (s.restrict S hS).altitude i = (s.altitude i).comap S.subtype := by - haveI := Nonempty.map (AffineSubspace.inclusion hS) inferInstance + have := Nonempty.map (AffineSubspace.inclusion hS) inferInstance rw [← s.map_altitude_restrict S hS, comap_map_eq_of_injective S.subtype_injective] open Module @@ -287,7 +287,7 @@ variable {n : ℕ} (s : Simplex ℝ P n) lemma inner_vsub_altitudeFoot_vsub_altitudeFoot_eq_zero {i j : Fin (n + 1)} (h : i ≠ j) : have : NeZero n := by grind [neZero_iff] ⟪s.points j -ᵥ s.altitudeFoot i, s.points i -ᵥ s.altitudeFoot i⟫ = 0 := by - haveI : NeZero n := by grind [neZero_iff] + have : NeZero n := by grind [neZero_iff] refine Submodule.inner_right_of_mem_orthogonal (K := vectorSpan ℝ (s.points '' {i}ᶜ)) (vsub_mem_vectorSpan_of_mem_affineSpan_of_mem_affineSpan diff --git a/Mathlib/Geometry/Euclidean/Angle/Bisector.lean b/Mathlib/Geometry/Euclidean/Angle/Bisector.lean index a560ad1adffb1b..32f422e6e20709 100644 --- a/Mathlib/Geometry/Euclidean/Angle/Bisector.lean +++ b/Mathlib/Geometry/Euclidean/Angle/Bisector.lean @@ -142,9 +142,9 @@ lemma oangle_eq_of_dist_orthogonalProjection_eq {p p' : P} {s₁ s₂ : AffineSu dist p (orthogonalProjection s₁ p) = dist p (orthogonalProjection s₂ p) → ∡ (orthogonalProjection s₁ p : P) p' p = ∡ p p' (orthogonalProjection s₂ p) := by intro hne h - haveI : Nonempty s₁ := ⟨p', hp'₁⟩ - haveI : Nonempty s₂ := ⟨p', hp'₂⟩ - haveI : Nonempty (s₁ ⊓ s₂ : AffineSubspace ℝ P) := ⟨p', hp'₁, hp'₂⟩ + have : Nonempty s₁ := ⟨p', hp'₁⟩ + have : Nonempty s₂ := ⟨p', hp'₂⟩ + have : Nonempty (s₁ ⊓ s₂ : AffineSubspace ℝ P) := ⟨p', hp'₁, hp'₂⟩ have hp₁ : orthogonalProjection s₁ p ≠ p' := by intro hp rw [hp, eq_comm, dist_orthogonalProjection_eq_dist_iff_eq_of_mem hp'₂] at h @@ -217,8 +217,8 @@ lemma dist_orthogonalProjection_eq_of_two_zsmul_oangle_eq {p p' : P} (2 : ℤ) • ∡ p p' (orthogonalProjection s₂ p) → dist p (orthogonalProjection s₁ p) = dist p (orthogonalProjection s₂ p) := by intro hp₁ hp₂ h - haveI : Nonempty s₁ := ⟨p', hp'₁⟩ - haveI : Nonempty s₂ := ⟨p', hp'₂⟩ + have : Nonempty s₁ := ⟨p', hp'₁⟩ + have : Nonempty s₂ := ⟨p', hp'₂⟩ have h' : ∡ (orthogonalProjection s₁ p : P) p' p = ∡ p p' (orthogonalProjection s₂ p) := oangle_eq_oangle_rev_of_two_zsmul_eq_of_angle_eq_pi_div_two h (angle_self_orthogonalProjection _ hp'₁) (angle_self_orthogonalProjection _ hp'₂) diff --git a/Mathlib/Geometry/Euclidean/Angle/Oriented/Projection.lean b/Mathlib/Geometry/Euclidean/Angle/Oriented/Projection.lean index f044c886ffed2f..bd93a5cc6c1879 100644 --- a/Mathlib/Geometry/Euclidean/Angle/Oriented/Projection.lean +++ b/Mathlib/Geometry/Euclidean/Angle/Oriented/Projection.lean @@ -32,7 +32,7 @@ lemma oangle_self_orthogonalProjection (p : P) {p' : P} {s : AffineSubspace ℝ haveI : Nonempty s := ⟨p', h⟩ ∡ p (orthogonalProjection s p) p' = (π / 2 : ℝ) ∨ ∡ p (orthogonalProjection s p) p' = (-π / 2 : ℝ) := by - haveI : Nonempty s := ⟨p', h⟩ + have : Nonempty s := ⟨p', h⟩ have hpne : p ≠ orthogonalProjection s p := Ne.symm (orthogonalProjection_eq_self_iff.not.2 hp) have ha := oangle_eq_angle_or_eq_neg_angle hpne hp' rw [angle_self_orthogonalProjection p h] at ha diff --git a/Mathlib/Geometry/Euclidean/Angle/Oriented/Rotation.lean b/Mathlib/Geometry/Euclidean/Angle/Oriented/Rotation.lean index 7e56474c341b6e..495f17778b3708 100644 --- a/Mathlib/Geometry/Euclidean/Angle/Oriented/Rotation.lean +++ b/Mathlib/Geometry/Euclidean/Angle/Oriented/Rotation.lean @@ -105,7 +105,7 @@ theorem rotation_eq_matrix_toLin (θ : Real.Angle) {x : V} (hx : x ≠ 0) : /-- The determinant of `rotation` (as a linear map) is equal to `1`. -/ @[simp] theorem det_rotation (θ : Real.Angle) : LinearMap.det (o.rotation θ).toLinearMap = 1 := by - haveI : Nontrivial V := nontrivial_of_finrank_eq_succ (@Fact.out (finrank ℝ V = 2) _) + have : Nontrivial V := nontrivial_of_finrank_eq_succ (@Fact.out (finrank ℝ V = 2) _) obtain ⟨x, hx⟩ : ∃ x, x ≠ (0 : V) := exists_ne (0 : V) rw [o.rotation_eq_matrix_toLin θ hx] simpa [sq] using θ.cos_sq_add_sin_sq @@ -329,7 +329,7 @@ theorem oangle_eq_iff_eq_pos_smul_rotation_or_eq_zero {x y : V} (θ : Real.Angle theorem exists_linearIsometryEquiv_eq_of_det_pos {f : V ≃ₗᵢ[ℝ] V} (hd : 0 < LinearMap.det (f.toLinearEquiv : V →ₗ[ℝ] V)) : ∃ θ : Real.Angle, f = o.rotation θ := by - haveI : Nontrivial V := nontrivial_of_finrank_eq_succ (@Fact.out (finrank ℝ V = 2) _) + have : Nontrivial V := nontrivial_of_finrank_eq_succ (@Fact.out (finrank ℝ V = 2) _) obtain ⟨x, hx⟩ : ∃ x, x ≠ (0 : V) := exists_ne (0 : V) use o.oangle x (f x) apply LinearIsometryEquiv.toLinearEquiv_injective diff --git a/Mathlib/Geometry/Euclidean/Angle/Sphere.lean b/Mathlib/Geometry/Euclidean/Angle/Sphere.lean index eb8f55b8d8c157..884fb30fa6fba4 100644 --- a/Mathlib/Geometry/Euclidean/Angle/Sphere.lean +++ b/Mathlib/Geometry/Euclidean/Angle/Sphere.lean @@ -114,7 +114,7 @@ theorem isDiameter_of_angle_eq_pi_div_two {p₁ p₂ p₃ : P} {s : Sphere P} (hne₁₂ : p₁ ≠ p₂) (hne₂₃ : p₂ ≠ p₃) (hangle : ∠ p₁ p₂ p₃ = π / 2) : s.IsDiameter p₁ p₃ := by - haveI : FiniteDimensional ℝ V := .of_finrank_eq_succ (Fact.out : finrank ℝ V = 2) + have : FiniteDimensional ℝ V := .of_finrank_eq_succ (Fact.out : finrank ℝ V = 2) have hne₁₃ : p₁ ≠ p₃ := fun h ↦ by rw [h, angle_self_of_ne hne₂₃.symm] at hangle; linarith [Real.pi_pos] have hd := Sphere.isDiameter_ofDiameter p₁ p₃ diff --git a/Mathlib/Geometry/Euclidean/Angle/Unoriented/Projection.lean b/Mathlib/Geometry/Euclidean/Angle/Unoriented/Projection.lean index e78798f049de94..5c87eda1e0a9c6 100644 --- a/Mathlib/Geometry/Euclidean/Angle/Unoriented/Projection.lean +++ b/Mathlib/Geometry/Euclidean/Angle/Unoriented/Projection.lean @@ -29,7 +29,7 @@ open scoped Real [s.direction.HasOrthogonalProjection] (h : p' ∈ s) : haveI : Nonempty s := ⟨p', h⟩ ∠ p (orthogonalProjection s p) p' = π / 2 := by - haveI : Nonempty s := ⟨p', h⟩ + have : Nonempty s := ⟨p', h⟩ rw [angle, ← InnerProductGeometry.inner_eq_zero_iff_angle_eq_pi_div_two] exact Submodule.inner_left_of_mem_orthogonal (K := s.direction) (AffineSubspace.vsub_mem_direction h (orthogonalProjection_mem _)) diff --git a/Mathlib/Geometry/Euclidean/Circumcenter.lean b/Mathlib/Geometry/Euclidean/Circumcenter.lean index 4f79e5b964beae..38f13272631a25 100644 --- a/Mathlib/Geometry/Euclidean/Circumcenter.lean +++ b/Mathlib/Geometry/Euclidean/Circumcenter.lean @@ -56,7 +56,7 @@ theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P} (hp : p ∉ s) (hu : ∃! cs : Sphere P, cs.center ∈ s ∧ ps ⊆ (cs : Set P)) : ∃! cs₂ : Sphere P, cs₂.center ∈ affineSpan ℝ (insert p (s : Set P)) ∧ insert p ps ⊆ (cs₂ : Set P) := by - haveI : Nonempty s := Set.Nonempty.to_subtype (hnps.mono hps) + have : Nonempty s := Set.Nonempty.to_subtype (hnps.mono hps) rcases hu with ⟨⟨cc, cr⟩, ⟨hcc, hcr⟩, hcccru⟩ simp only at hcc hcr hcccru let x := dist cc (orthogonalProjection s p) @@ -143,7 +143,7 @@ theorem _root_.AffineIndependent.existsUnique_dist_eq {ι : Type*} [hne : Nonemp rcases m with - | m · rw [Fintype.card_eq_one_iff] at hn obtain ⟨i, hi⟩ := hn - haveI : Unique ι := ⟨⟨i⟩, hi⟩ + have : Unique ι := ⟨⟨i⟩, hi⟩ use ⟨p i, 0⟩ simp only [Set.range_unique, AffineSubspace.mem_affineSpan_singleton] constructor @@ -162,7 +162,7 @@ theorem _root_.AffineIndependent.existsUnique_dist_eq {ι : Type*} [hne : Nonemp Finset.card_sdiff, Finset.card_univ, hn] simp · simp - haveI : Nonempty ι2 := Fintype.card_pos_iff.1 (hc.symm ▸ Nat.zero_lt_succ _) + have : Nonempty ι2 := Fintype.card_pos_iff.1 (hc.symm ▸ Nat.zero_lt_succ _) have ha2 : AffineIndependent ℝ fun i2 : ι2 => p i2 := ha.subtype _ replace hm := hm ha2 _ hc have hr : Set.range p = insert (p i) (Set.range fun i2 : ι2 => p i2) := by diff --git a/Mathlib/Geometry/Euclidean/Incenter.lean b/Mathlib/Geometry/Euclidean/Incenter.lean index 2d2c443c690725..4a8fbcee5d77f2 100644 --- a/Mathlib/Geometry/Euclidean/Incenter.lean +++ b/Mathlib/Geometry/Euclidean/Incenter.lean @@ -386,7 +386,7 @@ variable {s} in haveI := Nonempty.map (AffineSubspace.inclusion hS) inferInstance (s.restrict S hS).excenter signs = s.excenter signs := by rw [← s.excenterExists_restrict S hS] at h - haveI := Nonempty.map (AffineSubspace.inclusion hS) inferInstance + have := Nonempty.map (AffineSubspace.inclusion hS) inferInstance exact (h.excenter_map S.subtypeₐᵢ).symm /-- The incenter of a simplex. -/ @@ -798,7 +798,7 @@ variable {s} in haveI := Nonempty.map (AffineSubspace.inclusion hS) inferInstance (s.restrict S hS).touchpoint signs i = s.touchpoint signs i := by rw [← s.excenterExists_restrict S hS] at h - haveI := Nonempty.map (AffineSubspace.inclusion hS) inferInstance + have := Nonempty.map (AffineSubspace.inclusion hS) inferInstance exact (h.touchpoint_map S.subtypeₐᵢ i).symm lemma touchpoint_mem_affineSpan (signs : Finset (Fin (n + 1))) (i : Fin (n + 1)) : @@ -1146,7 +1146,7 @@ variable {s} in haveI := Nonempty.map (AffineSubspace.inclusion hS) inferInstance (s.restrict S hS).touchpointWeights signs = s.touchpointWeights signs := by rw [← s.excenterExists_restrict S hS] at h - haveI := Nonempty.map (AffineSubspace.inclusion hS) inferInstance + have := Nonempty.map (AffineSubspace.inclusion hS) inferInstance exact (h.touchpointWeights_map S.subtypeₐᵢ).symm variable {s} in diff --git a/Mathlib/Geometry/Euclidean/MongePoint.lean b/Mathlib/Geometry/Euclidean/MongePoint.lean index dbd753a21e81b8..fdda4bdaf6ad67 100644 --- a/Mathlib/Geometry/Euclidean/MongePoint.lean +++ b/Mathlib/Geometry/Euclidean/MongePoint.lean @@ -127,7 +127,7 @@ theorem mongePoint_restrict {n : ℕ} (s : Simplex ℝ P n) (S : AffineSubspace (hS : affineSpan ℝ (Set.range s.points) ≤ S) : haveI := Nonempty.map (AffineSubspace.inclusion hS) inferInstance (s.restrict S hS).mongePoint = s.mongePoint := by - haveI := Nonempty.map (AffineSubspace.inclusion hS) inferInstance + have := Nonempty.map (AffineSubspace.inclusion hS) inferInstance simp_rw [mongePoint] rw [← Simplex.centroid, ← Simplex.centroid] simp [centroid_restrict, circumcenter_restrict] diff --git a/Mathlib/Geometry/Euclidean/NinePointCircle.lean b/Mathlib/Geometry/Euclidean/NinePointCircle.lean index 3bd274ff36de7d..f0f77ee351ab70 100644 --- a/Mathlib/Geometry/Euclidean/NinePointCircle.lean +++ b/Mathlib/Geometry/Euclidean/NinePointCircle.lean @@ -139,7 +139,7 @@ theorem eulerPoint_restrict {n : ℕ} (s : Simplex ℝ P n) (S : AffineSubspace (hS : affineSpan ℝ (Set.range s.points) ≤ S) (i : Fin (n + 1)) : haveI := Nonempty.map (AffineSubspace.inclusion hS) inferInstance (s.restrict S hS).eulerPoint i = s.eulerPoint i := by - haveI := Nonempty.map (AffineSubspace.inclusion hS) inferInstance + have := Nonempty.map (AffineSubspace.inclusion hS) inferInstance simp [eulerPoint] theorem points_vsub_eulerPoint {n : ℕ} (s : Simplex ℝ P n) (i : Fin (n + 1)) : diff --git a/Mathlib/Geometry/Euclidean/Projection.lean b/Mathlib/Geometry/Euclidean/Projection.lean index 0e40071d98d269..5232d7dd2f158e 100644 --- a/Mathlib/Geometry/Euclidean/Projection.lean +++ b/Mathlib/Geometry/Euclidean/Projection.lean @@ -306,7 +306,7 @@ lemma dist_orthogonalProjection_eq_dist_iff_eq_of_mem {s : AffineSubspace 𝕜 P [s.direction.HasOrthogonalProjection] {p₁ p₂ : P} (hp₂ : p₂ ∈ s) : haveI : Nonempty s := ⟨p₂, hp₂⟩ dist p₁ (orthogonalProjection s p₁) = dist p₁ p₂ ↔ orthogonalProjection s p₁ = p₂ := by - haveI : Nonempty s := ⟨p₂, hp₂⟩ + have : Nonempty s := ⟨p₂, hp₂⟩ constructor · intro h rwa [← sq_eq_sq₀ dist_nonneg dist_nonneg, pow_two, pow_two, dist_comm _ p₂, diff --git a/Mathlib/Geometry/Euclidean/Sphere/Basic.lean b/Mathlib/Geometry/Euclidean/Sphere/Basic.lean index 89c2f614e760ed..14bf842b552b13 100644 --- a/Mathlib/Geometry/Euclidean/Sphere/Basic.lean +++ b/Mathlib/Geometry/Euclidean/Sphere/Basic.lean @@ -379,7 +379,7 @@ inclusion into a larger affine subspace `S₂` is cospherical. -/ theorem Cospherical.inclusion_iff {S₁ S₂ : AffineSubspace ℝ P} [Nonempty S₁] {ps : Set S₁} [S₁.direction.HasOrthogonalProjection] [S₂.direction.HasOrthogonalProjection] (hS : S₁ ≤ S₂) : Cospherical (AffineSubspace.inclusion hS '' ps) ↔ Cospherical ps := by - haveI : Nonempty S₂ := by obtain ⟨p⟩ := ‹Nonempty S₁›; exact ⟨⟨p, hS p.property⟩⟩ + have : Nonempty S₂ := by obtain ⟨p⟩ := ‹Nonempty S₁›; exact ⟨⟨p, hS p.property⟩⟩ simp [(Cospherical.subtype_val_iff (S := S₂) (ps := AffineSubspace.inclusion hS '' ps)).symm, Set.image_image] diff --git a/Mathlib/Geometry/Euclidean/Sphere/Power.lean b/Mathlib/Geometry/Euclidean/Sphere/Power.lean index c1fc4fbcd7aa5c..a79253fd8dd3e4 100644 --- a/Mathlib/Geometry/Euclidean/Sphere/Power.lean +++ b/Mathlib/Geometry/Euclidean/Sphere/Power.lean @@ -198,7 +198,7 @@ theorem cospherical_of_mul_dist_eq_mul_dist_of_angle_eq_pi {p₁ p₂ p₃ p₄ have hf2 : Fact (finrank ℝ S.direction = 2) := ⟨by rw [hS, direction_affineSpan, t.independent.finrank_vectorSpan] simp⟩ - letI : Module.Oriented ℝ S.direction (Fin 2) := + let : Module.Oriented ℝ S.direction (Fin 2) := ⟨Basis.orientation (finBasisOfFinrankEq _ _ hf2.out)⟩ have hncol : ¬ Collinear ℝ {p₁', p', p₃'} := by rw [← affineIndependent_iff_not_collinear_set, diff --git a/Mathlib/Geometry/Manifold/ChartedSpace.lean b/Mathlib/Geometry/Manifold/ChartedSpace.lean index b74ab6fd4af0cc..31e0e7f45ed0db 100644 --- a/Mathlib/Geometry/Manifold/ChartedSpace.lean +++ b/Mathlib/Geometry/Manifold/ChartedSpace.lean @@ -223,9 +223,9 @@ open TopologicalSpace theorem ChartedSpace.secondCountable_of_countable_cover [SecondCountableTopology H] {s : Set M} (hs : ⋃ (x) (_ : x ∈ s), (chartAt H x).source = univ) (hsc : s.Countable) : SecondCountableTopology M := by - haveI : ∀ x : M, SecondCountableTopology (chartAt H x).source := + have : ∀ x : M, SecondCountableTopology (chartAt H x).source := fun x ↦ (chartAt (H := H) x).secondCountableTopology_source - haveI := hsc.toEncodable + have := hsc.toEncodable rw [biUnion_eq_iUnion] at hs exact secondCountableTopology_of_countable_cover (fun x : s ↦ (chartAt H (x : M)).open_source) hs @@ -546,13 +546,13 @@ lemma ChartedSpace.sum_chartAt_inr (x' : M') : @[simp, mfld_simps] lemma sum_chartAt_inl_apply {x y : M} : (chartAt H (.inl x : M ⊕ M')) (Sum.inl y) = (chartAt H x) y := by - haveI : Nonempty H := nonempty_of_chartedSpace x + have : Nonempty H := nonempty_of_chartedSpace x rw [ChartedSpace.sum_chartAt_inl] exact OpenPartialHomeomorph.lift_openEmbedding_apply _ _ @[simp, mfld_simps] lemma sum_chartAt_inr_apply {x y : M'} : (chartAt H (.inr x : M ⊕ M')) (Sum.inr y) = (chartAt H x) y := by - haveI : Nonempty H := nonempty_of_chartedSpace x + have : Nonempty H := nonempty_of_chartedSpace x rw [ChartedSpace.sum_chartAt_inr] exact OpenPartialHomeomorph.lift_openEmbedding_apply _ _ @@ -656,7 +656,7 @@ protected def openPartialHomeomorph (e : PartialEquiv M H) (he : e ∈ c.atlas) open_source := by convert! c.open_source' he open_target := by convert! c.open_target he continuousOn_toFun := by - letI : TopologicalSpace M := c.toTopologicalSpace + let : TopologicalSpace M := c.toTopologicalSpace rw [continuousOn_open_iff (c.open_source' he)] intro s s_open rw [inter_comm] @@ -664,7 +664,7 @@ protected def openPartialHomeomorph (e : PartialEquiv M H) (he : e ∈ c.atlas) simp only [exists_prop, mem_iUnion, mem_singleton_iff] exact ⟨e, he, ⟨s, s_open, rfl⟩⟩ continuousOn_invFun := by - letI : TopologicalSpace M := c.toTopologicalSpace + let : TopologicalSpace M := c.toTopologicalSpace apply continuousOn_isOpen_of_generateFrom intro t ht simp only [exists_prop, mem_iUnion, mem_singleton_iff] at ht diff --git a/Mathlib/Geometry/Manifold/ContMDiff/Basic.lean b/Mathlib/Geometry/Manifold/ContMDiff/Basic.lean index fa43fc3ba3dfaa..0e744acc5bf41a 100644 --- a/Mathlib/Geometry/Manifold/ContMDiff/Basic.lean +++ b/Mathlib/Geometry/Manifold/ContMDiff/Basic.lean @@ -415,7 +415,7 @@ variable {e : M → H} (h : IsOpenEmbedding e) {n : ℕ∞ω} then `e` is `C^n`. -/ lemma contMDiff_isOpenEmbedding [Nonempty M] : haveI := h.singletonChartedSpace; ContMDiff I I n e := by - haveI := h.isManifold_singleton (I := I) (n := ω) + have := h.isManifold_singleton (I := I) (n := ω) rw [@contMDiff_iff _ _ _ _ _ _ _ _ _ _ h.singletonChartedSpace] use h.continuous intro x y @@ -441,7 +441,7 @@ then the inverse of `e` is `C^n`. -/ lemma contMDiffOn_isOpenEmbedding_symm [Nonempty M] : haveI := h.singletonChartedSpace; ContMDiffOn I I n (IsOpenEmbedding.toOpenPartialHomeomorph e h).symm (range e) := by - haveI := h.isManifold_singleton (I := I) (n := ω) + have := h.isManifold_singleton (I := I) (n := ω) rw [@contMDiffOn_iff] constructor · rw [← h.toOpenPartialHomeomorph_target] diff --git a/Mathlib/Geometry/Manifold/Diffeomorph.lean b/Mathlib/Geometry/Manifold/Diffeomorph.lean index 8aec58763bbdb0..51fefea662bdd4 100644 --- a/Mathlib/Geometry/Manifold/Diffeomorph.lean +++ b/Mathlib/Geometry/Manifold/Diffeomorph.lean @@ -403,9 +403,9 @@ def transContinuousLinearEquiv : ModelWithCorners 𝕜 E' H where · simp only [PartialEquiv.coe_trans, Equiv.toPartialEquiv_apply, LinearEquiv.coe_toEquiv, ContinuousLinearEquiv.coe_toLinearEquiv, toPartialEquiv_coe] rw [range_comp] - letI := h.rclike - letI := NormedSpace.restrictScalars ℝ 𝕜 E - letI := NormedSpace.restrictScalars ℝ 𝕜 E' + let := h.rclike + let := NormedSpace.restrictScalars ℝ 𝕜 E + let := NormedSpace.restrictScalars ℝ 𝕜 E' let eR : E →L[ℝ] E' := ContinuousLinearMap.restrictScalars ℝ (e : E →L[𝕜] E') change Convex ℝ (⇑eR '' range ↑I) apply I.convex_range.linear_image diff --git a/Mathlib/Geometry/Manifold/IsManifold/Basic.lean b/Mathlib/Geometry/Manifold/IsManifold/Basic.lean index 5dc7b8202b1ab3..4be4e83777f6a7 100644 --- a/Mathlib/Geometry/Manifold/IsManifold/Basic.lean +++ b/Mathlib/Geometry/Manifold/IsManifold/Basic.lean @@ -196,8 +196,8 @@ def ModelWithCorners.ofTargetUniv (𝕜 : Type*) [NontriviallyNormedField 𝕜] have : range φ = φ.target := by rw [← φ.image_source_eq_target, hsource, image_univ.symm] simp only [this, htarget, dite_else_true] intro h - letI := h.rclike 𝕜 - letI := NormedSpace.restrictScalars ℝ 𝕜 E + let := h.rclike 𝕜 + let := NormedSpace.restrictScalars ℝ 𝕜 E exact convex_univ nonempty_interior' := by have : range φ = φ.target := by rw [← φ.image_source_eq_target, hsource, image_univ.symm] @@ -311,8 +311,8 @@ lemma _root_.Convex.convex_isRCLikeNormedField [NormedSpace ℝ E] [h : IsRCLike letI := h.rclike letI := NormedSpace.restrictScalars ℝ 𝕜 E Convex ℝ s := by - letI := h.rclike - letI := NormedSpace.restrictScalars ℝ 𝕜 E + let := h.rclike + let := NormedSpace.restrictScalars ℝ 𝕜 E simp only [Convex, StarConvex] at hs ⊢ intro u hu v hv a b ha hb hab convert! hs hu hv ha hb hab using 2 @@ -340,7 +340,7 @@ def ofConvexRange theorem convex_range [NormedSpace ℝ E] : Convex ℝ (range I) := by by_cases h : IsRCLikeNormedField 𝕜 - · letI : RCLike 𝕜 := h.rclike + · let : RCLike 𝕜 := h.rclike have W := I.convex_range' simp only [h, ↓reduceDIte, toPartialEquiv_coe] at W simp only [Convex, StarConvex] at W ⊢ @@ -354,16 +354,16 @@ theorem convex_range [NormedSpace ℝ E] : Convex ℝ (range I) := by protected theorem uniqueDiffOn : UniqueDiffOn 𝕜 (range I) := by by_cases h : IsRCLikeNormedField 𝕜 - · letI := h.rclike 𝕜 - letI := NormedSpace.restrictScalars ℝ 𝕜 E + · let := h.rclike 𝕜 + let := NormedSpace.restrictScalars ℝ 𝕜 E apply uniqueDiffOn_convex_of_isRCLikeNormedField _ I.nonempty_interior simpa [h] using I.convex_range · simp [range_eq_univ_of_not_isRCLikeNormedField I h, uniqueDiffOn_univ] theorem range_subset_closure_interior : range I ⊆ closure (interior (range I)) := by by_cases h : IsRCLikeNormedField 𝕜 - · letI := h.rclike 𝕜 - letI := NormedSpace.restrictScalars ℝ 𝕜 E + · let := h.rclike 𝕜 + let := NormedSpace.restrictScalars ℝ 𝕜 E rw [Convex.closure_interior_eq_closure_of_nonempty_interior (𝕜 := ℝ)] · apply subset_closure · apply I.convex_range @@ -513,8 +513,8 @@ def ModelWithCorners.prod {𝕜 : Type u} [NontriviallyNormedField 𝕜] {E : Ty have : range (fun (x : ModelProd H H') ↦ (I x.1, I' x.2)) = range (Prod.map I I') := rfl rw [this, Set.range_prodMap] split_ifs with h - · letI := h.rclike - letI := NormedSpace.restrictScalars ℝ 𝕜 E; letI := NormedSpace.restrictScalars ℝ 𝕜 E' + · let := h.rclike + let := NormedSpace.restrictScalars ℝ 𝕜 E; let := NormedSpace.restrictScalars ℝ 𝕜 E' exact I.convex_range.prod I'.convex_range · simp [range_eq_univ_of_not_isRCLikeNormedField, h] nonempty_interior' := by @@ -536,8 +536,8 @@ def ModelWithCorners.pi {𝕜 : Type u} [NontriviallyNormedField 𝕜] {ι : Typ convex_range' := by rw [PartialEquiv.pi_apply, Set.range_piMap] split_ifs with h - · letI := h.rclike - letI := fun i ↦ NormedSpace.restrictScalars ℝ 𝕜 (E i) + · let := h.rclike + let := fun i ↦ NormedSpace.restrictScalars ℝ 𝕜 (E i) exact convex_pi fun i _hi ↦ (I i).convex_range · simp [range_eq_univ_of_not_isRCLikeNormedField, h] nonempty_interior' := by @@ -805,7 +805,7 @@ theorem isManifold_of_contDiffOn {𝕜 : Type*} [NontriviallyNormedField 𝕜] ContDiffOn 𝕜 n (I ∘ e.symm ≫ₕ e' ∘ I.symm) (I.symm ⁻¹' (e.symm ≫ₕ e').source ∩ range I)) : IsManifold I n M where compatible := by - haveI : HasGroupoid M (contDiffGroupoid n I) := hasGroupoid_of_pregroupoid _ (h _ _) + have : HasGroupoid M (contDiffGroupoid n I) := hasGroupoid_of_pregroupoid _ (h _ _) apply StructureGroupoid.compatible /-- For any model with corners, the model space is a `C^n` manifold -/ diff --git a/Mathlib/Geometry/Manifold/IsManifold/ExtChartAt.lean b/Mathlib/Geometry/Manifold/IsManifold/ExtChartAt.lean index 0388d393f42a59..35af7c80c9d15e 100644 --- a/Mathlib/Geometry/Manifold/IsManifold/ExtChartAt.lean +++ b/Mathlib/Geometry/Manifold/IsManifold/ExtChartAt.lean @@ -874,14 +874,14 @@ theorem extChartAt_comp [ChartedSpace H H'] (x : M') : theorem writtenInExtChartAt_chartAt_comp [ChartedSpace H H'] (x : M') {y} (hy : y ∈ letI := ChartedSpace.comp H H' M'; (extChartAt I x).target) : (letI := ChartedSpace.comp H H' M'; writtenInExtChartAt I I x (chartAt H' x) y) = y := by - letI := ChartedSpace.comp H H' M' + let := ChartedSpace.comp H H' M' simp_all only [mfld_simps, chartAt_comp] theorem writtenInExtChartAt_chartAt_symm_comp [ChartedSpace H H'] (x : M') {y} (hy : y ∈ letI := ChartedSpace.comp H H' M'; (extChartAt I x).target) : (letI := ChartedSpace.comp H H' M' writtenInExtChartAt I I (chartAt H' x x) (chartAt H' x).symm y) = y := by - letI := ChartedSpace.comp H H' M' + let := ChartedSpace.comp H H' M' simp_all only [mfld_simps, chartAt_comp] end ExtendedCharts diff --git a/Mathlib/Geometry/Manifold/Metrizable.lean b/Mathlib/Geometry/Manifold/Metrizable.lean index 9c8f856fbaba3c..cdd13fd5f4efb4 100644 --- a/Mathlib/Geometry/Manifold/Metrizable.lean +++ b/Mathlib/Geometry/Manifold/Metrizable.lean @@ -28,7 +28,7 @@ theorem Manifold.metrizableSpace {E : Type*} [NormedAddCommGroup E] [NormedSpace [FiniteDimensional ℝ E] {H : Type*} [TopologicalSpace H] (I : ModelWithCorners ℝ E H) (M : Type*) [TopologicalSpace M] [ChartedSpace H M] [SigmaCompactSpace M] [T2Space M] : MetrizableSpace M := by - haveI := I.locallyCompactSpace; haveI := ChartedSpace.locallyCompactSpace H M - haveI := I.secondCountableTopology - haveI := ChartedSpace.secondCountable_of_sigmaCompact H M + have := I.locallyCompactSpace; have := ChartedSpace.locallyCompactSpace H M + have := I.secondCountableTopology + have := ChartedSpace.secondCountable_of_sigmaCompact H M exact metrizableSpace_of_t3_secondCountable M diff --git a/Mathlib/Geometry/Manifold/PartitionOfUnity.lean b/Mathlib/Geometry/Manifold/PartitionOfUnity.lean index 9eea8726d755ad..a916bb439155ec 100644 --- a/Mathlib/Geometry/Manifold/PartitionOfUnity.lean +++ b/Mathlib/Geometry/Manifold/PartitionOfUnity.lean @@ -365,8 +365,8 @@ theorem exists_isSubordinate [T2Space M] [SigmaCompactSpace M] (hs : IsClosed s) (hU : ∀ x ∈ s, U x ∈ 𝓝 x) : ∃ (ι : Type uM) (f : SmoothBumpCovering ι I M s), f.IsSubordinate U := by -- First we deduce some missing instances - haveI : LocallyCompactSpace H := I.locallyCompactSpace - haveI : LocallyCompactSpace M := ChartedSpace.locallyCompactSpace H M + have : LocallyCompactSpace H := I.locallyCompactSpace + have : LocallyCompactSpace M := ChartedSpace.locallyCompactSpace H M -- Next we choose a covering by supports of smooth bump functions have hB := fun x hx => SmoothBumpFunction.nhds_basis_support (I := I) (hU x hx) rcases refinement_of_locallyCompact_sigmaCompact_of_nhds_basis_set hs hB with @@ -562,8 +562,8 @@ variable [T2Space M] [SigmaCompactSpace M] `s`, then there exists a `SmoothPartitionOfUnity ι M s` that is subordinate to `U`. -/ theorem exists_isSubordinate {s : Set M} (hs : IsClosed s) (U : ι → Set M) (ho : ∀ i, IsOpen (U i)) (hU : s ⊆ ⋃ i, U i) : ∃ f : SmoothPartitionOfUnity ι I M s, f.IsSubordinate U := by - haveI : LocallyCompactSpace H := I.locallyCompactSpace - haveI : LocallyCompactSpace M := ChartedSpace.locallyCompactSpace H M + have : LocallyCompactSpace H := I.locallyCompactSpace + have : LocallyCompactSpace M := ChartedSpace.locallyCompactSpace H M -- porting note(https://github.com/leanprover-community/batteries/issues/116): -- split `rcases` into `have` + `rcases` have := BumpCovering.exists_isSubordinate_of_prop (ContMDiff I 𝓘(ℝ) ∞) ?_ hs U ho hU diff --git a/Mathlib/Geometry/Manifold/Riemannian/Basic.lean b/Mathlib/Geometry/Manifold/Riemannian/Basic.lean index aca6592592b743..687abb5f64b7f8 100644 --- a/Mathlib/Geometry/Manifold/Riemannian/Basic.lean +++ b/Mathlib/Geometry/Manifold/Riemannian/Basic.lean @@ -529,7 +529,7 @@ manifold satisfies the `IsRiemannianManifold I M` predicate. -/ instance [RegularSpace M] : letI : PseudoEMetricSpace M := .ofRiemannianMetric I M IsRiemannianManifold I M := by - letI : PseudoEMetricSpace M := .ofRiemannianMetric I M + let : PseudoEMetricSpace M := .ofRiemannianMetric I M exact ⟨fun x y ↦ rfl⟩ variable (M) in diff --git a/Mathlib/Geometry/Manifold/VectorBundle/Basic.lean b/Mathlib/Geometry/Manifold/VectorBundle/Basic.lean index e120727df246fe..5c09cb521e7377 100644 --- a/Mathlib/Geometry/Manifold/VectorBundle/Basic.lean +++ b/Mathlib/Geometry/Manifold/VectorBundle/Basic.lean @@ -426,8 +426,8 @@ instance ContMDiffFiberwiseLinear.hasGroupoid : HasGroupoid (TotalSpace F E) (contMDiffFiberwiseLinear B F IB n) where compatible := by rintro _ _ ⟨e, he, rfl⟩ ⟨e', he', rfl⟩ - haveI : MemTrivializationAtlas e := ⟨he⟩ - haveI : MemTrivializationAtlas e' := ⟨he'⟩ + have : MemTrivializationAtlas e := ⟨he⟩ + have : MemTrivializationAtlas e' := ⟨he'⟩ rw [mem_contMDiffFiberwiseLinear_iff] refine ⟨_, _, e.open_baseSet.inter e'.open_baseSet, contMDiffOn_coordChangeL e e', contMDiffOn_symm_coordChangeL e e', ?_⟩ diff --git a/Mathlib/Geometry/Manifold/WhitneyEmbedding.lean b/Mathlib/Geometry/Manifold/WhitneyEmbedding.lean index 84b12fa4431b1b..cbf721d805019f 100644 --- a/Mathlib/Geometry/Manifold/WhitneyEmbedding.lean +++ b/Mathlib/Geometry/Manifold/WhitneyEmbedding.lean @@ -113,8 +113,8 @@ public theorem exists_immersion_euclidean {ι : Type*} [Finite ι] (f : SmoothBu CMDiff ∞ e ∧ Injective e ∧ ∀ x : M, Injective (mfderiv% e x) := by cases nonempty_fintype ι set F := EuclideanSpace ℝ (Fin <| finrank ℝ (ι → E × ℝ)) - letI : IsNoetherian ℝ (E × ℝ) := IsNoetherian.iff_fg.2 inferInstance - letI : FiniteDimensional ℝ (ι → E × ℝ) := IsNoetherian.iff_fg.1 inferInstance + let : IsNoetherian ℝ (E × ℝ) := IsNoetherian.iff_fg.2 inferInstance + let : FiniteDimensional ℝ (ι → E × ℝ) := IsNoetherian.iff_fg.1 inferInstance set eEF : (ι → E × ℝ) ≃L[ℝ] F := ContinuousLinearEquiv.ofFinrankEq finrank_euclideanSpace_fin.symm refine ⟨_, eEF ∘ f.embeddingPiTangent, @@ -135,6 +135,6 @@ public theorem exists_embedding_euclidean_of_compact [T2Space M] [CompactSpace M CMDiff ∞ e ∧ IsClosedEmbedding e ∧ ∀ x : M, Injective (mfderiv% e x) := by rcases SmoothBumpCovering.exists_isSubordinate I isClosed_univ fun (x : M) _ => univ_mem with ⟨ι, f, -⟩ - haveI := f.fintype + have := f.fintype rcases f.exists_immersion_euclidean with ⟨n, e, hsmooth, hinj, hinj_mfderiv⟩ exact ⟨n, e, hsmooth, hsmooth.continuous.isClosedEmbedding hinj, hinj_mfderiv⟩ diff --git a/Mathlib/Geometry/RingedSpace/LocallyRingedSpace/HasColimits.lean b/Mathlib/Geometry/RingedSpace/LocallyRingedSpace/HasColimits.lean index aa7cc3a65ffbc6..47476b21365096 100644 --- a/Mathlib/Geometry/RingedSpace/LocallyRingedSpace/HasColimits.lean +++ b/Mathlib/Geometry/RingedSpace/LocallyRingedSpace/HasColimits.lean @@ -68,7 +68,7 @@ noncomputable def coproduct : LocallyRingedSpace where (F ⋙ forgetToSheafedSpace) isLocalRing x := by obtain ⟨i, y, ⟨⟩⟩ := SheafedSpace.colimit_exists_rep (F ⋙ forgetToSheafedSpace) x - haveI : IsLocalRing (((F ⋙ forgetToSheafedSpace).obj i).presheaf.stalk y) := + have : IsLocalRing (((F ⋙ forgetToSheafedSpace).obj i).presheaf.stalk y) := (F.obj i).isLocalRing _ exact (asIso ((colimit.ι (C := SheafedSpace.{u + 1, u, u} CommRingCat.{u}) @@ -139,7 +139,7 @@ theorem coequalizer_π_app_isLocalHom rw [← this, PresheafedSpace.comp_c_app, ← PresheafedSpace.colimitPresheafObjIsoComponentwiseLimit_hom_π] -- Porting note (https://github.com/leanprover-community/mathlib4/issues/10754): this instance has to be manually added - haveI : IsIso (PreservesCoequalizer.iso + have : IsIso (PreservesCoequalizer.iso SheafedSpace.forgetToPresheafedSpace f.toShHom g.toShHom).hom.c := inferInstance apply +allowSynthFailures RingHom.isLocalHom_comp diff --git a/Mathlib/Geometry/RingedSpace/OpenImmersion.lean b/Mathlib/Geometry/RingedSpace/OpenImmersion.lean index 0d6bdc89118317..9c5c5cb048acd4 100644 --- a/Mathlib/Geometry/RingedSpace/OpenImmersion.lean +++ b/Mathlib/Geometry/RingedSpace/OpenImmersion.lean @@ -499,7 +499,7 @@ instance forget_preservesLimitsOfRight : PreservesLimit (cospan g f) (forget C) set_option backward.isDefEq.respectTransparency false in theorem pullback_snd_isIso_of_range_subset (H : Set.range g.base ⊆ Set.range f.base) : IsIso (pullback.snd f g) := by - haveI := TopCat.snd_iso_of_left_embedding_range_subset hf.base_open.isEmbedding g.base H + have := TopCat.snd_iso_of_left_embedding_range_subset hf.base_open.isEmbedding g.base H have : IsIso (pullback.snd f g).base := by delta pullback.snd rw [← limit.isoLimitCone_hom_π ⟨_, pullbackConeOfLeftIsLimit f g⟩ WalkingCospan.right] @@ -776,7 +776,7 @@ theorem of_stalk_iso {X Y : SheafedSpace C} (f : X ⟶ Y) (hf : IsOpenEmbedding rintro ⟨_, y, hy, rfl⟩ specialize H y delta PresheafedSpace.Hom.stalkMap at H - haveI H' := TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_isInducing C + have H' := TopCat.Presheaf.stalkPushforward.stalkPushforward_iso_of_isInducing C hf.toIsInducing X.presheaf y have := IsIso.comp_isIso' H (@IsIso.inv_isIso _ _ _ _ _ H') rwa [Category.assoc, IsIso.hom_inv_id, Category.comp_id] at this } @@ -864,7 +864,7 @@ theorem ofRestrict_invApp {C : Type*} [Category* C] (X : SheafedSpace C) {Y : To /-- An open immersion is an iso if the underlying continuous map is epi. -/ theorem to_iso [h' : Epi f.hom.base] : IsIso f := by - haveI : IsIso (forgetToPresheafedSpace.map f) := PresheafedSpace.IsOpenImmersion.to_iso f.hom + have : IsIso (forgetToPresheafedSpace.map f) := PresheafedSpace.IsOpenImmersion.to_iso f.hom apply isIso_of_reflects_iso _ (SheafedSpace.forgetToPresheafedSpace) instance stalk_iso [HasColimits C] (x : X) : diff --git a/Mathlib/Geometry/RingedSpace/PresheafedSpace.lean b/Mathlib/Geometry/RingedSpace/PresheafedSpace.lean index 57306bd71776d9..1371a4be78e12e 100644 --- a/Mathlib/Geometry/RingedSpace/PresheafedSpace.lean +++ b/Mathlib/Geometry/RingedSpace/PresheafedSpace.lean @@ -286,7 +286,7 @@ def ofRestrict {U : TopCat} (X : PresheafedSpace C) {f : U ⟶ (X : TopCat)} set_option backward.isDefEq.respectTransparency false in instance ofRestrict_mono {U : TopCat} (X : PresheafedSpace C) (f : U ⟶ X.1) (hf : IsOpenEmbedding f) : Mono (X.ofRestrict hf) := by - haveI : Mono f := (TopCat.mono_iff_injective _).mpr hf.injective + have : Mono f := (TopCat.mono_iff_injective _).mpr hf.injective constructor intro Z g₁ g₂ eq ext1 @@ -298,7 +298,7 @@ instance ofRestrict_mono {U : TopCat} (X : PresheafedSpace C) (f : U ⟶ X.1) have hV : (Opens.map (X.ofRestrict hf).base).obj (hf.functor.obj V) = V := by ext1 exact Set.preimage_image_eq _ hf.injective - haveI : + have : IsIso (hf.isOpenMap.adjunction.counit.app (unop (op (hf.functor.obj V)))) := NatIso.isIso_app_of_isIso (whiskerLeft hf.functor hf.isOpenMap.adjunction.counit) V diff --git a/Mathlib/GroupTheory/CommutingProbability.lean b/Mathlib/GroupTheory/CommutingProbability.lean index bb35843efbde61..e1f4c40a973d8e 100644 --- a/Mathlib/GroupTheory/CommutingProbability.lean +++ b/Mathlib/GroupTheory/CommutingProbability.lean @@ -81,7 +81,7 @@ variable {M} theorem commProb_eq_one_iff [h : Nonempty M] : commProb M = 1 ↔ IsMulCommutative M := by classical - haveI := Fintype.ofFinite M + have := Fintype.ofFinite M rw [commProb, ← Set.coe_setOf, Nat.card_eq_fintype_card, Nat.card_eq_fintype_card] rw [div_eq_one_iff_eq, ← Nat.cast_pow, Nat.cast_inj, sq, ← card_prod, set_fintype_card_eq_univ_iff, Set.eq_univ_iff_forall] diff --git a/Mathlib/GroupTheory/Exponent.lean b/Mathlib/GroupTheory/Exponent.lean index 370941c0f6b2b0..baa75fb99d4236 100644 --- a/Mathlib/GroupTheory/Exponent.lean +++ b/Mathlib/GroupTheory/Exponent.lean @@ -236,7 +236,7 @@ theorem lcm_orderOf_dvd_exponent [Fintype G] : @[to_additive exists_addOrderOf_eq_pow_padic_val_nat_add_exponent] theorem _root_.Nat.Prime.exists_orderOf_eq_pow_factorization_exponent {p : ℕ} (hp : p.Prime) : ∃ g : G, orderOf g = p ^ (exponent G).factorization p := by - haveI := Fact.mk hp + have := Fact.mk hp rcases eq_or_ne ((exponent G).factorization p) 0 with (h | h) · refine ⟨1, by rw [h, pow_zero, orderOf_one]⟩ have he : 0 < exponent G := diff --git a/Mathlib/GroupTheory/FiniteAbelian/Basic.lean b/Mathlib/GroupTheory/FiniteAbelian/Basic.lean index 6b780fe470f485..cdbd825b6e0b2b 100644 --- a/Mathlib/GroupTheory/FiniteAbelian/Basic.lean +++ b/Mathlib/GroupTheory/FiniteAbelian/Basic.lean @@ -97,11 +97,11 @@ variable (M : Type u) theorem finite_of_fg_torsion [AddCommGroup M] [Module ℤ M] [Module.Finite ℤ M] (hM : Module.IsTorsion ℤ M) : _root_.Finite M := by rcases Module.equiv_directSum_of_isTorsion hM with ⟨ι, _, p, h, e, ⟨l⟩⟩ - haveI : ∀ i : ι, NeZero (p i ^ e i).natAbs := fun i => + have : ∀ i : ι, NeZero (p i ^ e i).natAbs := fun i => ⟨Int.natAbs_ne_zero.mpr <| pow_ne_zero (e i) (h i).ne_zero⟩ - haveI : ∀ i : ι, _root_.Finite <| ℤ ⧸ Submodule.span ℤ {p i ^ e i} := fun i => + have : ∀ i : ι, _root_.Finite <| ℤ ⧸ Submodule.span ℤ {p i ^ e i} := fun i => Finite.of_equiv _ (p i ^ e i).quotientSpanEquivZMod.symm.toEquiv - haveI : _root_.Finite (⨁ i, ℤ ⧸ (Submodule.span ℤ {p i ^ e i} : Submodule ℤ ℤ)) := + have : _root_.Finite (⨁ i, ℤ ⧸ (Submodule.span ℤ {p i ^ e i} : Submodule ℤ ℤ)) := Finite.of_equiv _ DFinsupp.equivFunOnFintype.symm exact Finite.of_equiv _ l.symm.toEquiv @@ -141,7 +141,7 @@ theorem equiv_directSum_zmod_of_finite [Finite G] : · have : Unique (Fin Nat.zero →₀ ℤ) := { uniq := by subsingleton } exact ⟨ι, fι, p, hp, e, ⟨f.trans AddEquiv.uniqueProd⟩⟩ - · haveI := @Fintype.prodLeft _ _ _ (Fintype.ofEquiv G f.toEquiv) _ + · have := @Fintype.prodLeft _ _ _ (Fintype.ofEquiv G f.toEquiv) _ exact (Fintype.ofSurjective (fun f : Fin n.succ →₀ ℤ => f 0) fun a => ⟨Finsupp.single 0 a, Finsupp.single_eq_same⟩).false.elim diff --git a/Mathlib/GroupTheory/Finiteness.lean b/Mathlib/GroupTheory/Finiteness.lean index b23c7420082cfc..9fb6565793c25a 100644 --- a/Mathlib/GroupTheory/Finiteness.lean +++ b/Mathlib/GroupTheory/Finiteness.lean @@ -126,7 +126,7 @@ variable {ι : Type*} [Finite ι] {M : ι → Type*} [∀ i, Monoid (M i)] {P : @[to_additive] theorem Submonoid.iSup_map_mulSingle [DecidableEq ι] : ⨆ i, map (MonoidHom.mulSingle M i) (P i) = pi Set.univ P := by - haveI := Fintype.ofFinite ι + have := Fintype.ofFinite ι refine iSup_map_mulSingle_le.antisymm fun x hx => ?_ rw [← Finset.noncommProd_mulSingle x] exact noncommProd_mem _ _ _ _ fun i _ => mem_iSup_of_mem _ (mem_map_of_mem _ (hx i trivial)) @@ -136,7 +136,7 @@ theorem Submonoid.iSup_map_mulSingle [DecidableEq ι] : /-- Finite product of finitely generated additive submonoids is finitely generated. -/] theorem Submonoid.FG.pi (hP : ∀ i, (P i).FG) : (pi Set.univ P).FG := by classical - haveI := Fintype.ofFinite ι + have := Fintype.ofFinite ι choose s hs using hP refine ⟨Finset.univ.biUnion fun i => (s i).image (MonoidHom.mulSingle M i), ?_⟩ simp_rw [Finset.coe_biUnion, Finset.coe_univ, Set.biUnion_univ, closure_iUnion, Finset.coe_image, diff --git a/Mathlib/GroupTheory/GroupAction/Defs.lean b/Mathlib/GroupTheory/GroupAction/Defs.lean index 6293a15c31103f..caf5017f31ea4b 100644 --- a/Mathlib/GroupTheory/GroupAction/Defs.lean +++ b/Mathlib/GroupTheory/GroupAction/Defs.lean @@ -297,7 +297,7 @@ of the orbit of `U` under `G`. -/] theorem quotient_preimage_image_eq_union_mul (U : Set α) : letI := orbitRel G α Quotient.mk' ⁻¹' Quotient.mk' '' U = ⋃ g : G, (g • ·) '' U := by - letI := orbitRel G α + let := orbitRel G α set f : α → Quotient (MulAction.orbitRel G α) := Quotient.mk' ext a constructor @@ -318,7 +318,7 @@ theorem quotient_preimage_image_eq_union_mul (U : Set α) : theorem disjoint_image_image_iff {U V : Set α} : letI := orbitRel G α Disjoint (Quotient.mk' '' U) (Quotient.mk' '' V) ↔ ∀ x ∈ U, ∀ g : G, g • x ∉ V := by - letI := orbitRel G α + let := orbitRel G α set f : α → Quotient (MulAction.orbitRel G α) := Quotient.mk' refine ⟨fun h a a_in_U g g_in_V => diff --git a/Mathlib/GroupTheory/GroupAction/DomAct/Basic.lean b/Mathlib/GroupTheory/GroupAction/DomAct/Basic.lean index 3e8b3da14ed0d0..c9ed16172396e6 100644 --- a/Mathlib/GroupTheory/GroupAction/DomAct/Basic.lean +++ b/Mathlib/GroupTheory/GroupAction/DomAct/Basic.lean @@ -183,7 +183,7 @@ instance [SMul M α] [FaithfulSMul M α] [Nontrivial β] : FaithfulSMul Mᵈᵐ eq_of_smul_eq_smul {c₁ c₂} h := mk.symm.injective <| eq_of_smul_eq_smul fun a : α ↦ by rcases exists_pair_ne β with ⟨x, y, hne⟩ contrapose! hne - haveI := Classical.decEq α + have := Classical.decEq α replace h := congr_fun (h (update (const α x) (mk.symm c₂ • a) y)) a simpa [smul_apply, hne] using h diff --git a/Mathlib/GroupTheory/GroupAction/MultipleTransitivity.lean b/Mathlib/GroupTheory/GroupAction/MultipleTransitivity.lean index 102af46eb06390..05007575b5599e 100644 --- a/Mathlib/GroupTheory/GroupAction/MultipleTransitivity.lean +++ b/Mathlib/GroupTheory/GroupAction/MultipleTransitivity.lean @@ -631,7 +631,7 @@ theorem _root_.IsMultiplyPretransitive.alternatingGroup_le theorem isPretransitive_of_three_le_card (h : 3 ≤ Nat.card α) : IsPretransitive (alternatingGroup α) α := by rw [← is_one_pretransitive_iff] - letI := isMultiplyPretransitive α + let := isMultiplyPretransitive α apply isMultiplyPretransitive_of_le (n := Nat.card α - 2) _ (sub_le _ _) rwa [← add_le_add_iff_right 2, Nat.sub_add_cancel (le_trans (by norm_num) h)] @@ -652,7 +652,7 @@ theorem isTrivialBlock_of_isBlock {B : Set α} (hB : IsBlock (alternatingGroup suffices IsPreprimitive (alternatingGroup α) α by apply IsPreprimitive.isTrivialBlock_of_isBlock hB apply isPreprimitive_of_is_two_pretransitive - letI := isMultiplyPretransitive α + let := isMultiplyPretransitive α apply isMultiplyPretransitive_of_le (n := Nat.card α - 2) _ (sub_le _ _) rwa [← add_le_add_iff_right 2, Nat.sub_add_cancel (le_of_lt h2)] diff --git a/Mathlib/GroupTheory/GroupAction/Primitive.lean b/Mathlib/GroupTheory/GroupAction/Primitive.lean index 9758266c463384..7d5ddb7cdaac33 100644 --- a/Mathlib/GroupTheory/GroupAction/Primitive.lean +++ b/Mathlib/GroupTheory/GroupAction/Primitive.lean @@ -216,7 +216,7 @@ theorem isPreprimitive_congr (hφ : Function.Surjective φ) (hf : Function.Bijec · intro _ apply IsPreprimitive.of_surjective hf.surjective · intro _ - haveI := (isPretransitive_congr hφ hf).mpr toIsPretransitive + have := (isPretransitive_congr hφ hf).mpr toIsPretransitive exact { isTrivialBlock_of_isBlock {B} hB := by rw [← Set.preimage_image_eq B hf.injective] diff --git a/Mathlib/GroupTheory/Nilpotent.lean b/Mathlib/GroupTheory/Nilpotent.lean index f8c36afe217b70..5ede368ffb7b41 100644 --- a/Mathlib/GroupTheory/Nilpotent.lean +++ b/Mathlib/GroupTheory/Nilpotent.lean @@ -912,7 +912,7 @@ theorem nilpotent_center_quotient_ind {P : ∀ (G) [Group G] [IsNilpotent G], Pr obtain ⟨n, h⟩ : ∃ n, Group.nilpotencyClass G = n := ⟨_, rfl⟩ induction n generalizing G with | zero => - haveI := nilpotencyClass_zero_iff_subsingleton.mp h + have := nilpotencyClass_zero_iff_subsingleton.mp h exact hbase _ | succ n ih => have hn : Group.nilpotencyClass (G ⧸ center G) = n := by @@ -1235,7 +1235,7 @@ theorem Group.isNilpotent_of_product_of_sylow_group let ps := (Nat.card G).primeFactors have : ∀ (p : ps) (P : Sylow p G), IsNilpotent (↑P : Subgroup G) := by intro p P - haveI : Fact (Nat.Prime ↑p) := Fact.mk <| Nat.prime_of_mem_primeFactors p.2 + have : Fact (Nat.Prime ↑p) := Fact.mk <| Nat.prime_of_mem_primeFactors p.2 exact P.isPGroup'.isNilpotent exact nilpotent_of_mulEquiv e diff --git a/Mathlib/GroupTheory/NoncommPiCoprod.lean b/Mathlib/GroupTheory/NoncommPiCoprod.lean index bf213e8c34802c..58eb9fa5e654e8 100644 --- a/Mathlib/GroupTheory/NoncommPiCoprod.lean +++ b/Mathlib/GroupTheory/NoncommPiCoprod.lean @@ -157,7 +157,7 @@ def noncommPiCoprodEquiv [DecidableEq ι] : @[to_additive] theorem noncommPiCoprod_mrange : MonoidHom.mrange (noncommPiCoprod ϕ hcomm) = ⨆ i : ι, MonoidHom.mrange (ϕ i) := by - letI := Classical.decEq ι + let := Classical.decEq ι apply le_antisymm · rintro x ⟨f, rfl⟩ refine Submonoid.noncommProd_mem _ _ _ (fun _ _ _ _ h => hcomm h _ _) (fun i _ => ?_) @@ -215,7 +215,7 @@ namespace MonoidHom theorem noncommPiCoprod_range [Fintype ι] {hcomm : Pairwise fun i j : ι => ∀ (x : H i) (y : H j), Commute (ϕ i x) (ϕ j y)} : (noncommPiCoprod ϕ hcomm).range = ⨆ i : ι, (ϕ i).range := by - letI := Classical.decEq ι + let := Classical.decEq ι apply le_antisymm · rintro x ⟨f, rfl⟩ refine Subgroup.noncommProd_mem _ (fun _ _ _ _ h => hcomm h _ _) ?_ @@ -250,7 +250,7 @@ theorem independent_range_of_coprime_order (hcoprime : Pairwise fun i j => Nat.Coprime (Fintype.card (H i)) (Fintype.card (H j))) : iSupIndep fun i => (ϕ i).range := by cases nonempty_fintype ι - letI := Classical.decEq ι + let := Classical.decEq ι rintro i rw [disjoint_iff_inf_le] rintro f ⟨hxi, hxp⟩ diff --git a/Mathlib/GroupTheory/Order/Min.lean b/Mathlib/GroupTheory/Order/Min.lean index b57ab12b6d13c1..1a01d16637880b 100644 --- a/Mathlib/GroupTheory/Order/Min.lean +++ b/Mathlib/GroupTheory/Order/Min.lean @@ -101,7 +101,7 @@ protected lemma minOrder {n : ℕ} (hn : n ≠ 0) (hn₁ : n ≠ 1) : minOrder ( le_minOrder_iff_forall_addSubgroup.2 fun s hs _ ↦ ?_ · rw [Nat.card_zmultiples, ZMod.addOrderOf_coe _ hn, gcd_eq_right (div_dvd_of_dvd n.minFac_dvd), Nat.div_div_self n.minFac_dvd hn] - · haveI : Nontrivial s := s.bot_or_nontrivial.resolve_left hs + · have : Nontrivial s := s.bot_or_nontrivial.resolve_left hs exact WithTop.coe_le_coe.2 <| minFac_le_of_dvd Finite.one_lt_card <| (card_addSubgroup_dvd_card _).trans n.card_zmod.dvd diff --git a/Mathlib/GroupTheory/OrderOfElement.lean b/Mathlib/GroupTheory/OrderOfElement.lean index b7ee3e5669e10e..1cfda9fa4845f1 100644 --- a/Mathlib/GroupTheory/OrderOfElement.lean +++ b/Mathlib/GroupTheory/OrderOfElement.lean @@ -1254,7 +1254,7 @@ lemma Nat.Coprime.pow_left_bijective {G} [Group G] (hn : (Nat.card G).Coprime n) theorem image_range_orderOf [DecidableEq G] : letI : Fintype (zpowers x) := (Subgroup.zpowers x).instFintypeSubtypeMemOfDecidablePred Finset.image (fun i => x ^ i) (Finset.range (orderOf x)) = (zpowers x : Set G).toFinset := by - letI : Fintype (zpowers x) := (Subgroup.zpowers x).instFintypeSubtypeMemOfDecidablePred + let : Fintype (zpowers x) := (Subgroup.zpowers x).instFintypeSubtypeMemOfDecidablePred ext x rw [Set.mem_toFinset, SetLike.mem_coe, mem_zpowers_iff_mem_range_orderOf] diff --git a/Mathlib/GroupTheory/PGroup.lean b/Mathlib/GroupTheory/PGroup.lean index dc5803d822673a..11d41f6cb5dcc7 100644 --- a/Mathlib/GroupTheory/PGroup.lean +++ b/Mathlib/GroupTheory/PGroup.lean @@ -57,7 +57,7 @@ theorem iff_card [Fact p.Prime] [Finite G] : IsPGroup p G ↔ ∃ n : ℕ, Nat.c rw [← List.prod_replicate, ← List.eq_replicate_of_mem this, Nat.prod_primeFactorsList hG] intro q hq obtain ⟨hq1, hq2⟩ := (Nat.mem_primeFactorsList hG).mp hq - haveI : Fact q.Prime := ⟨hq1⟩ + have : Fact q.Prime := ⟨hq1⟩ obtain ⟨g, hg⟩ := exists_prime_orderOf_dvd_card' q hq2 obtain ⟨k, hk⟩ := (iff_orderOf.mp h) g exact (hq1.pow_eq_iff.mp (hg.symm.trans hk).symm).1.symm @@ -152,8 +152,8 @@ variable {α : Type*} [MulAction G α] theorem card_orbit (a : α) [Finite (orbit G a)] : ∃ n : ℕ, Nat.card (orbit G a) = p ^ n := by let ϕ := orbitEquivQuotientStabilizer G a - haveI := Finite.of_equiv (orbit G a) ϕ - haveI := (stabilizer G a).finiteIndex_of_finite_quotient + have := Finite.of_equiv (orbit G a) ϕ + have := (stabilizer G a).finiteIndex_of_finite_quotient rw [Nat.card_congr ϕ] exact hG.index (stabilizer G a) @@ -230,7 +230,7 @@ theorem center_nontrivial [Nontrivial G] [Finite G] : Nontrivial (Subgroup.cente exact ⟨⟨1, ⟨g, hg.1⟩, mt Subtype.ext_iff.mp hg.2⟩⟩ theorem bot_lt_center [Nontrivial G] [Finite G] : ⊥ < Subgroup.center G := by - haveI := center_nontrivial hG + have := center_nontrivial hG classical exact bot_lt_iff_ne_bot.mpr ((Subgroup.center G).one_lt_card_iff_ne_bot.mp Finite.one_lt_card) @@ -358,7 +358,7 @@ theorem card_center_eq_prime_pow (hGpn : Nat.card G = p ^ n) (hn : 0 < n) : have : Finite G := Nat.finite_of_card_ne_zero (hGpn ▸ pow_ne_zero n (NeZero.ne p)) have hcG := to_subgroup (of_card hGpn) (center G) rcases iff_card.1 hcG with _ - haveI : Nontrivial G := (nontrivial_iff_card <| of_card hGpn).2 ⟨n, hn, hGpn⟩ + have : Nontrivial G := (nontrivial_iff_card <| of_card hGpn).2 ⟨n, hn, hGpn⟩ exact (nontrivial_iff_card hcG).mp (center_nontrivial (of_card hGpn)) /-- The quotient by the center of a group of cardinality `p ^ 2` is cyclic. -/ diff --git a/Mathlib/GroupTheory/Perm/Cycle/Basic.lean b/Mathlib/GroupTheory/Perm/Cycle/Basic.lean index 4b876072012319..98e68a7c38bdb5 100644 --- a/Mathlib/GroupTheory/Perm/Cycle/Basic.lean +++ b/Mathlib/GroupTheory/Perm/Cycle/Basic.lean @@ -734,7 +734,7 @@ theorem IsCycleOn.isCycle_subtypePerm (hf : f.IsCycleOn s) (hs : s.Nontrivial) : protected theorem IsCycleOn.subtypePerm (hf : f.IsCycleOn s) : (f.subtypePerm fun _ => hf.apply_mem_iff : Perm s).IsCycleOn _root_.Set.univ := by obtain hs | hs := s.subsingleton_or_nontrivial - · haveI := hs.coe_sort + · have := hs.coe_sort exact isCycleOn_of_subsingleton _ _ convert! (hf.isCycle_subtypePerm hs).isCycleOn rw [eq_comm, Set.eq_univ_iff_forall] @@ -872,8 +872,8 @@ theorem Countable.exists_cycleOn (hs : s.Countable) : simpa using List.mem_of_formPerm_apply_ne hx⟩ convert! hs'.toFinset.nodup_toList.isCycleOn_formPerm simp - · haveI := hs.to_subtype - haveI := hs'.to_subtype + · have := hs.to_subtype + have := hs'.to_subtype obtain ⟨f⟩ : Nonempty (ℤ ≃ s) := inferInstance refine ⟨(Equiv.addRight 1).extendDomain f, ?_, fun x hx => of_not_not fun h => hx <| Perm.extendDomain_apply_not_subtype _ _ h⟩ diff --git a/Mathlib/GroupTheory/Perm/Cycle/Factors.lean b/Mathlib/GroupTheory/Perm/Cycle/Factors.lean index 7d9885f7fbb800..e344b1014b5d2e 100644 --- a/Mathlib/GroupTheory/Perm/Cycle/Factors.lean +++ b/Mathlib/GroupTheory/Perm/Cycle/Factors.lean @@ -252,7 +252,7 @@ instance instDecidableRelSameCycle [DecidableEq α] [Fintype α] (f : Perm α) : rcases hxy.exists_pow_eq_of_mem_support_aux hx with ⟨i, hixy, hi⟩ refine ⟨i, lt_of_lt_of_le hixy (card_le_univ _), hi⟩ case neg => - haveI : Nonempty α := ⟨x⟩ + have : Nonempty α := ⟨x⟩ rw [notMem_support] at hx exact ⟨0, Fintype.card_pos, hxy.eq_of_left hx⟩ diff --git a/Mathlib/GroupTheory/Perm/Cycle/Type.lean b/Mathlib/GroupTheory/Perm/Cycle/Type.lean index 598fc03b84d568..a86e7903c97fe1 100644 --- a/Mathlib/GroupTheory/Perm/Cycle/Type.lean +++ b/Mathlib/GroupTheory/Perm/Cycle/Type.lean @@ -549,7 +549,7 @@ end Cauchy theorem subgroup_eq_top_of_swap_mem [DecidableEq α] {H : Subgroup (Perm α)} [d : DecidablePred (· ∈ H)] {τ : Perm α} (h0 : (Fintype.card α).Prime) (h1 : Fintype.card α ∣ Fintype.card H) (h2 : τ ∈ H) (h3 : IsSwap τ) : H = ⊤ := by - haveI : Fact (Fintype.card α).Prime := ⟨h0⟩ + have : Fact (Fintype.card α).Prime := ⟨h0⟩ obtain ⟨σ, hσ⟩ := exists_prime_orderOf_dvd_card (Fintype.card α) h1 have hσ1 : orderOf (σ : Perm α) = Fintype.card α := (Subgroup.orderOf_coe σ).trans hσ have hσ2 : IsCycle ↑σ := isCycle_of_prime_order'' h0 hσ1 diff --git a/Mathlib/GroupTheory/PushoutI.lean b/Mathlib/GroupTheory/PushoutI.lean index 64677d3c0e3f85..4ad57f1eb9e609 100644 --- a/Mathlib/GroupTheory/PushoutI.lean +++ b/Mathlib/GroupTheory/PushoutI.lean @@ -561,8 +561,8 @@ noncomputable def equiv : PushoutI φ ≃ NormalWord d := theorem prod_injective {ι : Type*} {G : ι → Type*} [(i : ι) → Group (G i)] {φ : (i : ι) → H →* G i} {d : Transversal φ} : Function.Injective (prod : NormalWord d → PushoutI φ) := by - letI := Classical.decEq ι - letI := fun i => Classical.decEq (G i) + let := Classical.decEq ι + let := fun i => Classical.decEq (G i) classical exact equiv.symm.injective instance : FaithfulSMul (PushoutI φ) (NormalWord d) := diff --git a/Mathlib/GroupTheory/Rank.lean b/Mathlib/GroupTheory/Rank.lean index bc8ff00d160dbc..7445f03c685340 100644 --- a/Mathlib/GroupTheory/Rank.lean +++ b/Mathlib/GroupTheory/Rank.lean @@ -102,7 +102,7 @@ lemma rank_closure_finset_le_card (s : Finset G) : rank (closure (s : Set G)) @[to_additive] lemma rank_closure_finite_le_nat_card (s : Set G) [Finite s] : rank (closure s) ≤ Nat.card s := by - haveI := Fintype.ofFinite s + have := Fintype.ofFinite s rw [Nat.card_eq_fintype_card, ← s.toFinset_card, ← rank_congr (congr_arg _ s.coe_toFinset)] exact rank_closure_finset_le_card s.toFinset diff --git a/Mathlib/GroupTheory/Schreier.lean b/Mathlib/GroupTheory/Schreier.lean index 1133fbe3ba7e88..f7707a5114912a 100644 --- a/Mathlib/GroupTheory/Schreier.lean +++ b/Mathlib/GroupTheory/Schreier.lean @@ -131,10 +131,10 @@ variable (H) theorem exists_finset_card_le_mul [FiniteIndex H] {S : Finset G} (hS : closure (S : Set G) = ⊤) : ∃ T : Finset H, #T ≤ H.index * #S ∧ closure (T : Set H) = ⊤ := by - letI := H.fintypeQuotientOfFiniteIndex - haveI : DecidableEq G := Classical.decEq G + let := H.fintypeQuotientOfFiniteIndex + have : DecidableEq G := Classical.decEq G obtain ⟨R₀, hR, hR1⟩ := H.exists_isComplement_right 1 - haveI : Fintype R₀ := Fintype.ofEquiv _ hR.rightQuotientEquiv + have : Fintype R₀ := Fintype.ofEquiv _ hR.rightQuotientEquiv let R : Finset G := Set.toFinset R₀ replace hR : IsComplement (H : Set G) R := by rwa [Set.coe_toFinset] replace hR1 : (1 : G) ∈ R := by rwa [Set.mem_toFinset] @@ -158,7 +158,7 @@ instance fg_of_index_ne_zero [hG : Group.FG G] [FiniteIndex H] : Group.FG H := b theorem rank_le_index_mul_rank [hG : Group.FG G] [FiniteIndex H] : Group.rank H ≤ H.index * Group.rank G := by - haveI := H.fg_of_index_ne_zero + have := H.fg_of_index_ne_zero obtain ⟨S, hS₀, hS⟩ := Group.rank_spec G obtain ⟨T, hT₀, hT⟩ := exists_finset_card_le_mul H hS calc @@ -177,7 +177,7 @@ theorem card_commutator_dvd_index_center_pow [Finite (commutatorSet G)] : -- First handle the case when `Z(G)` has infinite index and `[G : Z(G)]` is defined to be `0` by_cases hG : (center G).index = 0 · simp_rw [hG, zero_mul, zero_add, pow_one, dvd_zero] - haveI : FiniteIndex (center G) := ⟨hG⟩ + have : FiniteIndex (center G) := ⟨hG⟩ -- Rewrite as `|Z(G) ∩ G'| * [G' : Z(G) ∩ G'] ∣ [G : Z(G)] ^ ([G : Z(G)] * n) * [G : Z(G)]` rw [← ((center G).subgroupOf (_root_.commutator G)).card_mul_index, pow_succ] -- We have `h1 : [G' : Z(G) ∩ G'] ∣ [G : Z(G)]` @@ -185,7 +185,7 @@ theorem card_commutator_dvd_index_center_pow [Finite (commutatorSet G)] : -- So we can reduce to proving `|Z(G) ∩ G'| ∣ [G : Z(G)] ^ ([G : Z(G)] * n)` refine mul_dvd_mul ?_ h1 -- We know that `[G' : Z(G) ∩ G'] < ∞` by `h1` and `hG` - haveI : FiniteIndex ((center G).subgroupOf (_root_.commutator G)) := + have : FiniteIndex ((center G).subgroupOf (_root_.commutator G)) := ⟨ne_zero_of_dvd_ne_zero hG h1⟩ -- We have `h2 : rank (Z(G) ∩ G') ≤ [G' : Z(G) ∩ G'] * rank G'` by Schreier's lemma have h2 := rank_le_index_mul_rank ((center G).subgroupOf (_root_.commutator G)) diff --git a/Mathlib/GroupTheory/SchurZassenhaus.lean b/Mathlib/GroupTheory/SchurZassenhaus.lean index a65caa3d9f5101..0052fbe5e7ca20 100644 --- a/Mathlib/GroupTheory/SchurZassenhaus.lean +++ b/Mathlib/GroupTheory/SchurZassenhaus.lean @@ -49,7 +49,7 @@ theorem smul_diff_smul' [hH : Normal H] (g : Gᵐᵒᵖ) : diff (MonoidHom.id H) (g • α) (g • β) = ⟨g.unop⁻¹ * (diff (MonoidHom.id H) α β : H) * g.unop, hH.mem_comm ((congr_arg (· ∈ H) (mul_inv_cancel_left _ _)).mpr (SetLike.coe_mem _))⟩ := by - letI := H.fintypeQuotientOfFiniteIndex + let := H.fintypeQuotientOfFiniteIndex let ϕ : H →* H := { toFun := fun h => ⟨g.unop⁻¹ * h * g.unop, @@ -80,7 +80,7 @@ noncomputable instance : MulAction G H.QuotientDiff where theorem smul_diff' (h : H) : diff (MonoidHom.id H) α (op (h : G) • β) = diff (MonoidHom.id H) α β * h ^ H.index := by - letI := H.fintypeQuotientOfFiniteIndex + let := H.fintypeQuotientOfFiniteIndex rw [diff, diff, index_eq_card, Nat.card_eq_fintype_card, ← Finset.card_univ, ← Finset.prod_const, ← Finset.prod_mul_distrib] refine Finset.prod_congr rfl fun q _ => ?_ @@ -231,25 +231,25 @@ private theorem step4 : (Nat.card N).minFac.Prime := /-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/ private theorem step5 {P : Sylow (Nat.card N).minFac N} : P.1 ≠ ⊥ := by - haveI : Fact (Nat.card N).minFac.Prime := ⟨step4 h1 h3⟩ + have : Fact (Nat.card N).minFac.Prime := ⟨step4 h1 h3⟩ apply P.ne_bot_of_dvd_card exact (Nat.card N).minFac_dvd include h2 in /-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/ private theorem step6 : IsPGroup (Nat.card N).minFac N := by - haveI : Fact (Nat.card N).minFac.Prime := ⟨step4 h1 h3⟩ + have : Fact (Nat.card N).minFac.Prime := ⟨step4 h1 h3⟩ refine Sylow.nonempty.elim fun P => P.2.of_surjective P.1.subtype ?_ rw [← MonoidHom.range_eq_top, range_subtype] - haveI : (P.1.map N.subtype).Normal := + have : (P.1.map N.subtype).Normal := normalizer_eq_top_iff.mp (step1 h1 h2 h3 _ P.normalizer_sup_eq_top) exact (step3 h1 h2 h3 P.1).resolve_left (step5 h1 h3) include h2 in /-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/ theorem step7 : IsMulCommutative N := by - haveI := N.bot_or_nontrivial.resolve_left (step0 h1 h3) - haveI : Fact (Nat.card N).minFac.Prime := ⟨step4 h1 h3⟩ + have := N.bot_or_nontrivial.resolve_left (step0 h1 h3) + have : Fact (Nat.card N).minFac.Prime := ⟨step4 h1 h3⟩ exact ⟨⟨fun g h => ((eq_top_iff.mp ((step3 h1 h2 h3 (center N)).resolve_left (step6 h1 h2 h3).bot_lt_center.ne') (mem_top h)).comm g).symm⟩⟩ @@ -266,7 +266,7 @@ private theorem exists_right_complement'_of_coprime_aux' [Finite G] (hG : Nat.ca induction n using Nat.strongRecOn with | ind n ih => ?_ rintro G _ _ rfl N _ hN refine not_forall_not.mp fun h3 => ?_ - haveI := SchurZassenhausInduction.step7 hN (fun G' _ _ hG' => by apply ih _ hG'; rfl) h3 + have := SchurZassenhausInduction.step7 hN (fun G' _ _ hG' => by apply ih _ hG'; rfl) h3 exact not_exists_of_forall_not h3 (exists_right_complement'_of_coprime_aux hN) /-- **Schur-Zassenhaus** for normal subgroups: diff --git a/Mathlib/GroupTheory/Solvable.lean b/Mathlib/GroupTheory/Solvable.lean index 9ec89956631467..81ef26cc5c3af8 100644 --- a/Mathlib/GroupTheory/Solvable.lean +++ b/Mathlib/GroupTheory/Solvable.lean @@ -113,7 +113,7 @@ instance (priority := 100) CommGroup.isSolvable {G : Type*} [CommGroup G] : IsSo theorem isSolvable_of_comm {G : Type*} [hG : Group G] (h : ∀ a b : G, a * b = b * a) : IsSolvable G := by - letI hG' : CommGroup G := { hG with mul_comm := h } + let hG' : CommGroup G := { hG with mul_comm := h } cases hG exact CommGroup.isSolvable diff --git a/Mathlib/GroupTheory/SpecificGroups/Quaternion.lean b/Mathlib/GroupTheory/SpecificGroups/Quaternion.lean index 8fb79b38b4cf4a..594a581ab4086b 100644 --- a/Mathlib/GroupTheory/SpecificGroups/Quaternion.lean +++ b/Mathlib/GroupTheory/SpecificGroups/Quaternion.lean @@ -203,7 +203,7 @@ theorem xa_pow_four (i : ZMod (2 * n)) : xa i ^ 4 = 1 := by @[simp] theorem orderOf_xa [NeZero n] (i : ZMod (2 * n)) : orderOf (xa i) = 4 := by change _ = 2 ^ 2 - haveI : Fact (Nat.Prime 2) := Fact.mk Nat.prime_two + have : Fact (Nat.Prime 2) := Fact.mk Nat.prime_two apply orderOf_eq_prime_pow · intro h simp only [pow_one, xa_sq] at h @@ -229,7 +229,7 @@ theorem orderOf_a_one : orderOf (a 1 : QuaternionGroup n) = 2 * n := by intro n h rw [one_def, a_one_pow] apply mt a.inj - haveI : CharZero (ZMod (2 * 0)) := ZMod.charZero + have : CharZero (ZMod (2 * 0)) := ZMod.charZero simpa using h.ne' apply (Nat.le_of_dvd (NeZero.pos _) (orderOf_dvd_of_pow_eq_one (@a_one_pow_n n))).lt_or_eq.resolve_left diff --git a/Mathlib/GroupTheory/Sylow.lean b/Mathlib/GroupTheory/Sylow.lean index 89411ada9907f4..cbbde606ac6498 100644 --- a/Mathlib/GroupTheory/Sylow.lean +++ b/Mathlib/GroupTheory/Sylow.lean @@ -452,9 +452,9 @@ private theorem not_dvd_index_aux [hp : Fact p.Prime] (P : Sylow p G) [P.Normal] theorem not_dvd_index' [hp : Fact p.Prime] [Finite (Sylow p G)] (P : Sylow p G) (hP : P.relIndex (normalizer P) ≠ 0) : ¬ p ∣ P.index := by rw [← relIndex_mul_index le_normalizer, P.coe_coe, ← card_eq_index_normalizer] - haveI : (P.subtype le_normalizer).Normal := + have : (P.subtype le_normalizer).Normal := Subgroup.normal_in_normalizer - haveI : (P.subtype le_normalizer).FiniteIndex := ⟨hP⟩ + have : (P.subtype le_normalizer).FiniteIndex := ⟨hP⟩ replace hP := not_dvd_index_aux (P.subtype le_normalizer) exact hp.1.not_dvd_mul hP (not_dvd_card_sylow p G) @@ -796,7 +796,7 @@ theorem normal_of_all_max_subgroups_normal [Finite G] rcases eq_top_or_exists_le_coatom (normalizer (P : Set G)) with (heq | ⟨K, hK, hNK⟩) · exact heq - · haveI := hnc _ hK + · have := hnc _ hK have hPK : P ≤ K := le_trans le_normalizer hNK refine (hK.1 ?_).elim rw [← sup_of_le_right hNK, P.normalizer_sup_eq_top' hPK]) @@ -819,8 +819,8 @@ noncomputable def directProductOfNormal [Finite G] have : ∀ p, Fintype (P p) := fun p ↦ Fintype.ofFinite (P p) have hcomm : Pairwise fun p₁ p₂ : ps => ∀ x y : G, x ∈ P p₁ → y ∈ P p₂ → Commute x y := by rintro ⟨p₁, hp₁⟩ ⟨p₂, hp₂⟩ hne - haveI hp₁' := Fact.mk (Nat.prime_of_mem_primeFactors hp₁) - haveI hp₂' := Fact.mk (Nat.prime_of_mem_primeFactors hp₂) + have hp₁' := Fact.mk (Nat.prime_of_mem_primeFactors hp₁) + have hp₂' := Fact.mk (Nat.prime_of_mem_primeFactors hp₂) have hne' : p₁ ≠ p₂ := by simpa using hne apply Subgroup.commute_of_normal_of_disjoint _ _ (hn (P p₁)) (hn (P p₂)) apply IsPGroup.disjoint_of_ne p₁ p₂ hne' _ _ (P p₁).isPGroup' (P p₂).isPGroup' @@ -838,8 +838,8 @@ noncomputable def directProductOfNormal [Finite G] · apply Subgroup.injective_noncommPiCoprod_of_iSupIndep apply independent_of_coprime_order hcomm rintro ⟨p₁, hp₁⟩ ⟨p₂, hp₂⟩ hne - haveI hp₁' := Fact.mk (Nat.prime_of_mem_primeFactors hp₁) - haveI hp₂' := Fact.mk (Nat.prime_of_mem_primeFactors hp₂) + have hp₁' := Fact.mk (Nat.prime_of_mem_primeFactors hp₁) + have hp₂' := Fact.mk (Nat.prime_of_mem_primeFactors hp₂) have hne' : p₁ ≠ p₂ := by simpa using hne simp only [← Nat.card_eq_fintype_card] apply IsPGroup.coprime_card_of_ne p₁ p₂ hne' _ _ (P p₁).isPGroup' (P p₂).isPGroup' diff --git a/Mathlib/GroupTheory/Transfer.lean b/Mathlib/GroupTheory/Transfer.lean index 1c16a59aae9e89..17c0205663b2a4 100644 --- a/Mathlib/GroupTheory/Transfer.lean +++ b/Mathlib/GroupTheory/Transfer.lean @@ -166,7 +166,7 @@ theorem transfer_eq_prod_quotient_orbitRel_zpowers_quot [FiniteIndex H] (g : G) ⟨q.out.out⁻¹ * g ^ Function.minimalPeriod (g • ·) q.out * q.out.out, QuotientGroup.out_conj_pow_minimalPeriod_mem H g q.out⟩ := by classical - letI := H.fintypeQuotientOfFiniteIndex + let := H.fintypeQuotientOfFiniteIndex calc transfer ϕ g = ∏ q : G ⧸ H, _ := transfer_def ϕ (transferTransversal H g) g _ = _ := ((quotientEquivSigmaZMod H g).symm.prod_comp _).symm @@ -189,7 +189,7 @@ theorem transfer_eq_pow_aux (g : G) by_cases hH : H.index = 0 · rw [hH, pow_zero] exact H.one_mem - letI := fintypeOfIndexNeZero hH + let := fintypeOfIndexNeZero hH classical replace key : ∀ (k : ℕ) (g₀ : G), g₀⁻¹ * g ^ k * g₀ ∈ H → g ^ k ∈ H := fun k g₀ hk => (congr_arg (· ∈ H) (key k g₀ hk)).mp hk @@ -208,7 +208,7 @@ theorem transfer_eq_pow [FiniteIndex H] (g : G) (key : ∀ (k : ℕ) (g₀ : G), g₀⁻¹ * g ^ k * g₀ ∈ H → g₀⁻¹ * g ^ k * g₀ = g ^ k) : transfer ϕ g = ϕ ⟨g ^ H.index, transfer_eq_pow_aux g key⟩ := by classical - letI := H.fintypeQuotientOfFiniteIndex + let := H.fintypeQuotientOfFiniteIndex change ∀ (k g₀) (hk : g₀⁻¹ * g ^ k * g₀ ∈ H), ↑(⟨g₀⁻¹ * g ^ k * g₀, hk⟩ : H) = g ^ k at key rw [transfer_eq_prod_quotient_orbitRel_zpowers_quot, ← Finset.prod_map_toList, ← Function.comp_def ϕ, List.prod_map_hom] @@ -255,7 +255,7 @@ variable [Fact p.Prime] [Finite (Sylow p G)] /-- Auxiliary lemma in order to state `transferSylow_eq_pow`. -/ theorem transferSylow_eq_pow_aux (g : G) (hg : g ∈ P) (k : ℕ) (g₀ : G) (h : g₀⁻¹ * g ^ k * g₀ ∈ P) : g₀⁻¹ * g ^ k * g₀ = g ^ k := by - haveI : IsMulCommutative P := + have : IsMulCommutative P := ⟨⟨fun a b => Subtype.ext (hP (le_normalizer b.2) a a.2)⟩⟩ replace hg := P.pow_mem hg k obtain ⟨n, hn, h⟩ := P.conj_eq_normalizer_conj_of_mem (g ^ k) g₀ hg h diff --git a/Mathlib/LinearAlgebra/AffineSpace/Basis.lean b/Mathlib/LinearAlgebra/AffineSpace/Basis.lean index ed2d0296154c9f..f7e58ce586ba0a 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Basis.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Basis.lean @@ -253,7 +253,7 @@ theorem coe_coord_of_subsingleton_eq_one [Subsingleton ι] (i : ι) : (b.coord i rw [← image_univ] apply Subsingleton.image apply subsingleton_of_subsingleton - haveI := AffineSubspace.subsingleton_of_subsingleton_span_eq_top hp b.tot + have := AffineSubspace.subsingleton_of_subsingleton_span_eq_top hp b.tot let s : Finset ι := {i} have hi : i ∈ s := by simp [s] have hw : s.sum (Function.const ι (1 : k)) = 1 := by simp [s] diff --git a/Mathlib/LinearAlgebra/AffineSpace/FiniteDimensional.lean b/Mathlib/LinearAlgebra/AffineSpace/FiniteDimensional.lean index 5890ae57f58b85..5f3694065a14ba 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/FiniteDimensional.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/FiniteDimensional.lean @@ -96,7 +96,7 @@ theorem finite_of_fin_dim_affineIndependent [FiniteDimensional k V] {p : ι → (hi : AffineIndependent k p) : Finite ι := by nontriviality ι; inhabit ι rw [affineIndependent_iff_linearIndependent_vsub k p default] at hi - letI : IsNoetherian k V := IsNoetherian.iff_fg.2 inferInstance + let : IsNoetherian k V := IsNoetherian.iff_fg.2 inferInstance exact (Set.finite_singleton default).finite_of_compl (Set.finite_coe_iff.1 hi.finite_of_isNoetherian) @@ -383,7 +383,7 @@ variable (k) finite-dimensional. -/ instance finiteDimensional_vectorSpan_insert_set (s : Set P) [FiniteDimensional k (vectorSpan k s)] (p : P) : FiniteDimensional k (vectorSpan k (insert p s)) := by - haveI : FiniteDimensional k (affineSpan k s).direction := + have : FiniteDimensional k (affineSpan k s).direction := (direction_affineSpan k s).symm ▸ inferInstance rw [← direction_affineSpan, ← affineSpan_insert_affineSpan, direction_affineSpan] exact finiteDimensional_vectorSpan_insert (affineSpan k s) p @@ -393,7 +393,7 @@ direction of the `affineSpan` is finite-dimensional. -/ instance finiteDimensional_direction_affineSpan_insert_set (s : Set P) [FiniteDimensional k (affineSpan k s).direction] (p : P) : FiniteDimensional k (affineSpan k (insert p s)).direction := by - haveI : FiniteDimensional k (vectorSpan k s) := (direction_affineSpan k s) ▸ inferInstance + have : FiniteDimensional k (vectorSpan k s) := (direction_affineSpan k s) ▸ inferInstance rw [direction_affineSpan] infer_instance diff --git a/Mathlib/LinearAlgebra/AffineSpace/Independent.lean b/Mathlib/LinearAlgebra/AffineSpace/Independent.lean index 77f39139c1b99f..91d9230991f1a2 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Independent.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Independent.lean @@ -797,7 +797,7 @@ theorem affineIndependent_of_ne {p₁ p₂ : P} (h : p₁ ≠ p₂) : AffineInde fin_cases i · simp at hi · simp [i₁] - haveI : Unique { x // x ≠ (0 : Fin 2) } := ⟨⟨i₁⟩, he'⟩ + have : Unique { x // x ≠ (0 : Fin 2) } := ⟨⟨i₁⟩, he'⟩ refine .of_subsingleton default ?_ rw [he' default] simpa using! h.symm diff --git a/Mathlib/LinearAlgebra/AffineSpace/Simplex/Basic.lean b/Mathlib/LinearAlgebra/AffineSpace/Simplex/Basic.lean index 734b662a501c96..6e2715dc6104ca 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Simplex/Basic.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Simplex/Basic.lean @@ -350,7 +350,7 @@ lemma face_restrict {n : ℕ} (s : Affine.Simplex k P n) {S : AffineSubspace k P (h : #fs = m + 1) : letI := Nonempty.map (AffineSubspace.inclusion hS) inferInstance (s.restrict S hS).face h = (s.face h).restrict S ((s.affineSpan_face_le h).trans hS) := by - letI := Nonempty.map (AffineSubspace.inclusion hS) inferInstance + let := Nonempty.map (AffineSubspace.inclusion hS) inferInstance ext i rw [restrict_points_coe] simp_rw [Affine.Simplex.face_points] @@ -441,7 +441,7 @@ lemma setInterior_restrict (I : Set k) {n : ℕ} (s : Simplex k P n) {S : Affine (hS : affineSpan k (Set.range s.points) ≤ S) : letI := Nonempty.map (AffineSubspace.inclusion hS) inferInstance (s.restrict S hS).setInterior I = S.subtype ⁻¹' (s.setInterior I) := by - letI := Nonempty.map (AffineSubspace.inclusion hS) inferInstance + let := Nonempty.map (AffineSubspace.inclusion hS) inferInstance rw [← S.subtype_injective.image_injective.eq_iff, Set.image_preimage_eq_of_subset (s.setInterior_subset_affineSpan.trans (by simpa using! hS)), ← (s.restrict S hS).setInterior_map I S.subtype_injective] diff --git a/Mathlib/LinearAlgebra/AffineSpace/Simplex/Centroid.lean b/Mathlib/LinearAlgebra/AffineSpace/Simplex/Centroid.lean index 2856c6aba0432c..73172cf4a5215f 100644 --- a/Mathlib/LinearAlgebra/AffineSpace/Simplex/Centroid.lean +++ b/Mathlib/LinearAlgebra/AffineSpace/Simplex/Centroid.lean @@ -220,7 +220,7 @@ theorem centroid_restrict [CharZero k] {n : ℕ} (s : Simplex k P n) (S : Affine haveI := Nonempty.map (AffineSubspace.inclusion hS) inferInstance (s.restrict S hS).centroid = s.centroid := by rw [eq_comm] - haveI := Nonempty.map (AffineSubspace.inclusion hS) inferInstance + have := Nonempty.map (AffineSubspace.inclusion hS) inferInstance have hf : Function.Injective (S.subtype) := by simp only [coe_subtype, Subtype.val_injective] exact (s.restrict S hS).centroid_map S.subtype hf @@ -403,7 +403,7 @@ theorem faceOppositeCentroid_eq_smul_vsub_vadd_point [CharZero k] (s : Simplex k haveI := Nonempty.map (AffineSubspace.inclusion hS) inferInstance (s.restrict S hS).faceOppositeCentroid i = s.faceOppositeCentroid i := by rw [eq_comm] - haveI := Nonempty.map (AffineSubspace.inclusion hS) inferInstance + have := Nonempty.map (AffineSubspace.inclusion hS) inferInstance have hf : Function.Injective (S.subtype) := by simp only [coe_subtype, Subtype.val_injective] exact (s.restrict S hS).faceOppositeCentroid_map S.subtype hf (i := i) @@ -585,7 +585,7 @@ theorem medial_restrict [CharZero k] (s : Simplex k P n) (S : AffineSubspace k P (hS : affineSpan k (Set.range s.points) ≤ S) : haveI := Nonempty.map (AffineSubspace.inclusion hS) inferInstance (s.restrict S hS).medial = s.medial.restrict S (s.affineSpan_range_medial ▸ hS) := by - haveI := Nonempty.map (AffineSubspace.inclusion hS) inferInstance + have := Nonempty.map (AffineSubspace.inclusion hS) inferInstance ext i simp [medial_points] diff --git a/Mathlib/LinearAlgebra/Alternating/Basic.lean b/Mathlib/LinearAlgebra/Alternating/Basic.lean index fde00ab331897f..fb400ee7e58883 100644 --- a/Mathlib/LinearAlgebra/Alternating/Basic.lean +++ b/Mathlib/LinearAlgebra/Alternating/Basic.lean @@ -785,7 +785,7 @@ theorem map_linearDependent {K M N : Type*} [Ring K] [IsDomain K] [AddCommGroup [AddCommGroup N] [Module K N] [IsTorsionFree K N] (f : M [⋀^ι]→ₗ[K] N) (v : ι → M) (h : ¬LinearIndependent K v) : f v = 0 := by obtain ⟨s, g, h, i, hi, hz⟩ := not_linearIndependent_iff.mp h - letI := Classical.decEq ι + let := Classical.decEq ι suffices f (update v i (g i • v i)) = 0 by rw [f.map_update_smul, Function.update_eq_self, smul_eq_zero] at this exact Or.resolve_left this hz diff --git a/Mathlib/LinearAlgebra/Basis/VectorSpace.lean b/Mathlib/LinearAlgebra/Basis/VectorSpace.lean index 8926b75a69fe96..a98476d639a01b 100644 --- a/Mathlib/LinearAlgebra/Basis/VectorSpace.lean +++ b/Mathlib/LinearAlgebra/Basis/VectorSpace.lean @@ -247,7 +247,7 @@ theorem LinearMap.exists_leftInverse_of_injective (f : V →ₗ[K] V') (hf_inj : let C := this.extend (subset_univ _) have BC := this.subset_extend (subset_univ _) let hC := Basis.extend this - haveI Vinh : Inhabited V := ⟨0⟩ + have Vinh : Inhabited V := ⟨0⟩ refine ⟨(hC.constr ℕ : _ → _) (C.restrict (invFun f)), hB.ext fun b => ?_⟩ rw [image_subset_iff] at BC have fb_eq : f b = hC ⟨f b, BC b.2⟩ := by diff --git a/Mathlib/LinearAlgebra/BilinearForm/DualLattice.lean b/Mathlib/LinearAlgebra/BilinearForm/DualLattice.lean index 628935e785ca77..efc81f12a41770 100644 --- a/Mathlib/LinearAlgebra/BilinearForm/DualLattice.lean +++ b/Mathlib/LinearAlgebra/BilinearForm/DualLattice.lean @@ -119,7 +119,7 @@ lemma dualSubmodule_dualSubmodule_flip_of_basis {ι : Type*} [Finite ι] B.dualSubmodule (B.flip.dualSubmodule (Submodule.span R (Set.range b))) = Submodule.span R (Set.range b) := by classical - letI := b.finiteDimensional_of_finite + let := b.finiteDimensional_of_finite rw [dualSubmodule_span_of_basis _ hB.flip, dualSubmodule_span_of_basis B hB, dualBasis_dualBasis_flip hB] @@ -128,7 +128,7 @@ lemma dualSubmodule_flip_dualSubmodule_of_basis {ι : Type*} [Finite ι] B.flip.dualSubmodule (B.dualSubmodule (Submodule.span R (Set.range b))) = Submodule.span R (Set.range b) := by classical - letI := b.finiteDimensional_of_finite + let := b.finiteDimensional_of_finite rw [dualSubmodule_span_of_basis B hB, dualSubmodule_span_of_basis _ hB.flip, dualBasis_flip_dualBasis hB] @@ -137,7 +137,7 @@ lemma dualSubmodule_dualSubmodule_of_basis B.dualSubmodule (B.dualSubmodule (Submodule.span R (Set.range b))) = Submodule.span R (Set.range b) := by classical - letI := b.finiteDimensional_of_finite + let := b.finiteDimensional_of_finite rw [dualSubmodule_span_of_basis B hB, dualSubmodule_span_of_basis B hB, dualBasis_dualBasis hB hB'] diff --git a/Mathlib/LinearAlgebra/Charpoly/Basic.lean b/Mathlib/LinearAlgebra/Charpoly/Basic.lean index c3e7afb498ccc3..bd9cfef2154e36 100644 --- a/Mathlib/LinearAlgebra/Charpoly/Basic.lean +++ b/Mathlib/LinearAlgebra/Charpoly/Basic.lean @@ -75,7 +75,7 @@ theorem charpoly_monic : f.charpoly.Monic := open Module in lemma charpoly_natDegree [StrongRankCondition R] : natDegree (charpoly f) = finrank R M := by - haveI := nontrivial_of_invariantBasisNumber + have := nontrivial_of_invariantBasisNumber rw [charpoly, Matrix.charpoly_natDegree_eq_dim, finrank_eq_card_chooseBasisIndex] end Coeff diff --git a/Mathlib/LinearAlgebra/CliffordAlgebra/BaseChange.lean b/Mathlib/LinearAlgebra/CliffordAlgebra/BaseChange.lean index 90023cafd4e138..49a9a2c7b20935 100644 --- a/Mathlib/LinearAlgebra/CliffordAlgebra/BaseChange.lean +++ b/Mathlib/LinearAlgebra/CliffordAlgebra/BaseChange.lean @@ -85,8 +85,8 @@ def toBaseChange (Q : QuadraticForm R V) : CliffordAlgebra (Q.baseChange A) →ₐ[A] A ⊗[R] CliffordAlgebra Q := CliffordAlgebra.lift _ <| by refine ⟨TensorProduct.AlgebraTensorModule.map (LinearMap.id : A →ₗ[A] A) (ι Q), ?_⟩ - letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm - letI : Invertible (2 : A ⊗[R] CliffordAlgebra Q) := + let : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm + let : Invertible (2 : A ⊗[R] CliffordAlgebra Q) := (Invertible.map (algebraMap R _) 2).copy 2 (map_ofNat _ _).symm suffices hpure_tensor : ∀ v w, (1 * 1) ⊗ₜ[R] (ι Q v * ι Q w) + (1 * 1) ⊗ₜ[R] (ι Q w * ι Q v) = QuadraticMap.polarBilin (Q.baseChange A) (1 ⊗ₜ[R] v) (1 ⊗ₜ[R] w) ⊗ₜ[R] 1 by diff --git a/Mathlib/LinearAlgebra/CliffordAlgebra/Inversion.lean b/Mathlib/LinearAlgebra/CliffordAlgebra/Inversion.lean index c9dfc7c666d345..0dce58a81e591e 100644 --- a/Mathlib/LinearAlgebra/CliffordAlgebra/Inversion.lean +++ b/Mathlib/LinearAlgebra/CliffordAlgebra/Inversion.lean @@ -34,12 +34,12 @@ def invertibleιOfInvertible (m : M) [Invertible (Q m)] : Invertible (ι Q m) wh /-- For a vector with invertible quadratic form, $v^{-1} = \frac{v}{Q(v)}$ -/ theorem invOf_ι (m : M) [Invertible (Q m)] [Invertible (ι Q m)] : ⅟(ι Q m) = ι Q (⅟(Q m) • m) := by - letI := invertibleιOfInvertible Q m + let := invertibleιOfInvertible Q m convert! (rfl : ⅟(ι Q m) = _) theorem isUnit_ι_of_isUnit {m : M} (h : IsUnit (Q m)) : IsUnit (ι Q m) := by cases h.nonempty_invertible - letI := invertibleιOfInvertible Q m + let := invertibleιOfInvertible Q m exact isUnit_of_invertible (ι Q m) /-- $aba^{-1}$ is a vector. -/ @@ -66,7 +66,7 @@ def invertibleOfInvertibleι (m : M) [Invertible (ι Q m)] : Invertible (Q m) := theorem isUnit_of_isUnit_ι {m : M} (h : IsUnit (ι Q m)) : IsUnit (Q m) := by cases h.nonempty_invertible - letI := invertibleOfInvertibleι Q m + let := invertibleOfInvertibleι Q m exact isUnit_of_invertible (Q m) @[simp] theorem isUnit_ι_iff {m : M} : IsUnit (ι Q m) ↔ IsUnit (Q m) := diff --git a/Mathlib/LinearAlgebra/CliffordAlgebra/SpinGroup.lean b/Mathlib/LinearAlgebra/CliffordAlgebra/SpinGroup.lean index ba083d909116e3..abfb945c6049b4 100644 --- a/Mathlib/LinearAlgebra/CliffordAlgebra/SpinGroup.lean +++ b/Mathlib/LinearAlgebra/CliffordAlgebra/SpinGroup.lean @@ -73,15 +73,15 @@ theorem conjAct_smul_ι_mem_range_ι {x : (CliffordAlgebra Q)ˣ} (hx : x ∈ lip induction hx using Subgroup.closure_induction'' generalizing m with | mem x hx => obtain ⟨a, ha⟩ := hx - letI := x.invertible - letI : Invertible (ι Q a) := by rwa [ha] - letI : Invertible (Q a) := invertibleOfInvertibleι Q a + let := x.invertible + let : Invertible (ι Q a) := by rwa [ha] + let : Invertible (Q a) := invertibleOfInvertibleι Q a simp_rw [← invOf_units x, ← ha, ι_mul_ι_mul_invOf_ι, LinearMap.mem_range_self] | inv_mem x hx => obtain ⟨a, ha⟩ := hx - letI := x.invertible - letI : Invertible (ι Q a) := by rwa [ha] - letI : Invertible (Q a) := invertibleOfInvertibleι Q a + let := x.invertible + let : Invertible (ι Q a) := by rwa [ha] + let : Invertible (Q a) := invertibleOfInvertibleι Q a simp_rw [← invOf_units x, inv_inv, ← ha, invOf_ι_mul_ι_mul_ι, LinearMap.mem_range_self] | one => simp_rw [inv_one, Units.val_one, one_mul, mul_one, LinearMap.mem_range_self] | mul y z _ _ hy hz => @@ -100,18 +100,18 @@ theorem involute_act_ι_mem_range_ι [Invertible (2 : R)] induction hx using Subgroup.closure_induction'' generalizing b with | mem x hx => obtain ⟨a, ha⟩ := hx - letI := x.invertible - letI : Invertible (ι Q a) := by rwa [ha] - letI : Invertible (Q a) := invertibleOfInvertibleι Q a + let := x.invertible + let : Invertible (ι Q a) := by rwa [ha] + let : Invertible (Q a) := invertibleOfInvertibleι Q a simp_rw [← invOf_units x, ← ha, involute_ι, neg_mul, ι_mul_ι_mul_invOf_ι Q a b, ← map_neg, LinearMap.mem_range_self] | inv_mem x hx => obtain ⟨a, ha⟩ := hx - letI := x.invertible - letI : Invertible (ι Q a) := by rwa [ha] - letI : Invertible (Q a) := invertibleOfInvertibleι Q a - letI := invertibleNeg (ι Q a) - letI := Invertible.map involute (ι Q a) + let := x.invertible + let : Invertible (ι Q a) := by rwa [ha] + let : Invertible (Q a) := invertibleOfInvertibleι Q a + let := invertibleNeg (ι Q a) + let := Invertible.map involute (ι Q a) simp_rw [← invOf_units x, inv_inv, ← ha, map_invOf, involute_ι, invOf_neg, neg_mul, invOf_ι_mul_ι_mul_ι, ← map_neg, LinearMap.mem_range_self] | one => simp_rw [inv_one, Units.val_one, map_one, one_mul, mul_one, LinearMap.mem_range_self] diff --git a/Mathlib/LinearAlgebra/Coevaluation.lean b/Mathlib/LinearAlgebra/Coevaluation.lean index c47b8e15479f78..74520c923036af 100644 --- a/Mathlib/LinearAlgebra/Coevaluation.lean +++ b/Mathlib/LinearAlgebra/Coevaluation.lean @@ -63,7 +63,7 @@ theorem contractLeft_assoc_coevaluation : (TensorProduct.assoc K _ _ _).symm.toLinearMap ∘ₗ (coevaluation K V).lTensor (Module.Dual K V) = (TensorProduct.lid K _).symm.toLinearMap ∘ₗ (TensorProduct.rid K _).toLinearMap := by - letI := Classical.decEq (Basis.ofVectorSpaceIndex K V) + let := Classical.decEq (Basis.ofVectorSpaceIndex K V) apply TensorProduct.ext apply (Basis.ofVectorSpace K V).dualBasis.ext; intro j; apply LinearMap.ext_ring rw [LinearMap.compr₂ₛₗ_apply, LinearMap.compr₂ₛₗ_apply, TensorProduct.mk_apply] @@ -81,7 +81,7 @@ theorem contractLeft_assoc_coevaluation' : (contractLeft K V).lTensor _ ∘ₗ (TensorProduct.assoc K _ _ _).toLinearMap ∘ₗ (coevaluation K V).rTensor V = (TensorProduct.rid K _).symm.toLinearMap ∘ₗ (TensorProduct.lid K _).toLinearMap := by - letI := Classical.decEq (Basis.ofVectorSpaceIndex K V) + let := Classical.decEq (Basis.ofVectorSpaceIndex K V) apply TensorProduct.ext apply LinearMap.ext_ring; apply (Basis.ofVectorSpace K V).ext; intro j rw [LinearMap.compr₂ₛₗ_apply, LinearMap.compr₂ₛₗ_apply, TensorProduct.mk_apply] diff --git a/Mathlib/LinearAlgebra/DFinsupp.lean b/Mathlib/LinearAlgebra/DFinsupp.lean index 2e04a2199f62fc..0b8fcbbf6a2712 100644 --- a/Mathlib/LinearAlgebra/DFinsupp.lean +++ b/Mathlib/LinearAlgebra/DFinsupp.lean @@ -546,7 +546,7 @@ theorem iSupIndep.dfinsupp_lsum_injective {p : ι → Submodule R N} (h : iSupIn rw [iSupIndep_iff_forall_dfinsupp] at h suffices LinearMap.ker (lsum ℕ fun i => (p i).subtype) = ⊥ by -- Lean can't find this without our help - letI thisI : AddCommGroup (Π₀ i, p i) := inferInstance + let thisI : AddCommGroup (Π₀ i, p i) := inferInstance rw [LinearMap.ker_eq_bot] at this exact this rw [LinearMap.ker_eq_bot'] diff --git a/Mathlib/LinearAlgebra/Determinant.lean b/Mathlib/LinearAlgebra/Determinant.lean index 8390d28ac03e97..41d5ba4cfd525a 100644 --- a/Mathlib/LinearAlgebra/Determinant.lean +++ b/Mathlib/LinearAlgebra/Determinant.lean @@ -211,7 +211,7 @@ theorem det_eq_det_toMatrix_of_finset [DecidableEq M] {s : Finset M} (b : Basis @[simp] theorem det_toMatrix (b : Basis ι A M) (f : M →ₗ[A] M) : Matrix.det (toMatrix b b f) = LinearMap.det f := by - haveI := Classical.decEq M + have := Classical.decEq M rw [det_eq_det_toMatrix_of_finset b.reindexFinsetRange, det_toMatrix_eq_det_toMatrix b b.reindexFinsetRange] @@ -267,7 +267,7 @@ theorem det_smul [Module.Free A M] (c : A) (f : M →ₗ[A] M) : theorem det_zero' {ι : Type*} [Finite ι] [Nonempty ι] (b : Basis ι A M) : LinearMap.det (0 : M →ₗ[A] M) = 0 := by - haveI := Classical.decEq ι + have := Classical.decEq ι cases nonempty_fintype ι rw [← det_toMatrix b, map_zero, det_zero] @@ -669,7 +669,7 @@ theorem AlternatingMap.map_basis_eq_zero_iff {ι : Type*} [Finite ι] (e : Basis (f : M [⋀^ι]→ₗ[R] R) : f e = 0 ↔ f = 0 := ⟨fun h => by cases nonempty_fintype ι - letI := Classical.decEq ι + let := Classical.decEq ι simpa [h] using f.eq_smul_basis_det e, fun h => h.symm ▸ AlternatingMap.zero_apply _⟩ diff --git a/Mathlib/LinearAlgebra/Dimension/ErdosKaplansky.lean b/Mathlib/LinearAlgebra/Dimension/ErdosKaplansky.lean index 0f9db109afca68..defc91af3f6d26 100644 --- a/Mathlib/LinearAlgebra/Dimension/ErdosKaplansky.lean +++ b/Mathlib/LinearAlgebra/Dimension/ErdosKaplansky.lean @@ -48,11 +48,11 @@ theorem max_aleph0_card_le_rank_fun_nat : max ℵ₀ #K ≤ Module.rank K (ℕ refine (Subfield.cardinalMk_closure_le_max _).trans_lt (max_lt_iff.mpr ⟨mk_range_le.trans_lt ?_, card_K⟩) rwa [mk_prod, ← aleph0, lift_uzero, bK.mk_eq_rank'', mul_aleph0_eq aleph0_le] - letI := Module.compHom K (RingHom.op L.subtype) + let := Module.compHom K (RingHom.op L.subtype) obtain ⟨⟨ιL, bL⟩⟩ := Module.Free.exists_basis (R := Lᵐᵒᵖ) (M := K) have card_ιL : ℵ₀ ≤ #ιL := by contrapose! hLK - haveI := @Fintype.ofFinite _ (lt_aleph0_iff_finite.mp hLK) + have := @Fintype.ofFinite _ (lt_aleph0_iff_finite.mp hLK) rw [bL.repr.toEquiv.cardinal_eq, mk_finsupp_of_fintype, ← MulOpposite.opEquiv.cardinal_eq] at card_K ⊢ apply power_nat_le @@ -92,7 +92,7 @@ theorem rank_fun_infinite {ι : Type v} [hι : Infinite ι] : Module.rank K (ι rw [lift_umax.{u, v}, lift_id'.{u, v}] at this have key := (lift_le.{v}.mpr <| max_aleph0_card_le_rank_fun_nat K).trans this rw [lift_max, lift_aleph0, max_le_iff] at key - haveI : Infinite ιK := by + have : Infinite ιK := by rw [← aleph0_le_mk_iff, bK.mk_eq_rank'']; exact key.1 rw [bK.repr.toEquiv.cardinal_eq, mk_finsupp_lift_of_infinite, lift_umax.{u, v}, lift_id'.{u, v}, bK.mk_eq_rank'', eq_comm, max_eq_left] diff --git a/Mathlib/LinearAlgebra/Dimension/Finite.lean b/Mathlib/LinearAlgebra/Dimension/Finite.lean index d08c8e0cf7ff44..4ab790f56909ed 100644 --- a/Mathlib/LinearAlgebra/Dimension/Finite.lean +++ b/Mathlib/LinearAlgebra/Dimension/Finite.lean @@ -412,7 +412,7 @@ theorem Module.finrank_zero_iff [IsDomain R] [IsTorsionFree R M] : /-- Similar to `rank_quotient_add_rank_le` but for `finrank` and a finite `M`. -/ lemma Module.finrank_quotient_add_finrank_le (N : Submodule R M) : finrank R (M ⧸ N) + finrank R N ≤ finrank R M := by - haveI := nontrivial_of_invariantBasisNumber R + have := nontrivial_of_invariantBasisNumber R have := rank_quotient_add_rank_le N rw [← finrank_eq_rank R M, ← finrank_eq_rank R, ← N.finrank_eq_rank] at this exact mod_cast this @@ -502,7 +502,7 @@ variable [IsDomain R] [IsTorsionFree R M] [StrongRankCondition R] then the module has dimension one. -/ theorem rank_eq_one (v : M) (n : v ≠ 0) (h : ∀ w : M, ∃ c : R, c • v = w) : Module.rank R M = 1 := by - haveI := nontrivial_of_invariantBasisNumber R + have := nontrivial_of_invariantBasisNumber R obtain ⟨b⟩ := (Basis.basis_singleton_iff.{_, _, u} PUnit).mpr ⟨v, n, h⟩ rw [rank_eq_card_basis b, Fintype.card_punit, Nat.cast_one] diff --git a/Mathlib/LinearAlgebra/Dimension/Free.lean b/Mathlib/LinearAlgebra/Dimension/Free.lean index e61fdf32557a31..e12364c8698979 100644 --- a/Mathlib/LinearAlgebra/Dimension/Free.lean +++ b/Mathlib/LinearAlgebra/Dimension/Free.lean @@ -314,7 +314,7 @@ theorem Basis.nonempty_unique_index_of_finrank_eq_one Nonempty (Unique ι) := by -- why isn't this an instance? have : Nontrivial R := nontrivial_of_invariantBasisNumber R - haveI : Module.Finite R M := + have : Module.Finite R M := Module.finite_of_finrank_pos (Nat.lt_of_sub_eq_succ d1) have : Finite ι := Module.Finite.finite_basis b have : Fintype ι := Fintype.ofFinite ι diff --git a/Mathlib/LinearAlgebra/Dimension/FreeAndStrongRankCondition.lean b/Mathlib/LinearAlgebra/Dimension/FreeAndStrongRankCondition.lean index 8907719c5773e6..5ea999facd4c73 100644 --- a/Mathlib/LinearAlgebra/Dimension/FreeAndStrongRankCondition.lean +++ b/Mathlib/LinearAlgebra/Dimension/FreeAndStrongRankCondition.lean @@ -37,7 +37,7 @@ noncomputable def Basis.ofRankEqZero [Module.Free K V] {ι : Type*} [IsEmpty ι] (hV : Module.rank K V = 0) : Basis ι K V := haveI : Subsingleton V := by obtain ⟨_, b⟩ := Module.Free.exists_basis (R := K) (M := V) - haveI := mk_eq_zero_iff.1 (hV ▸ b.mk_eq_rank'') + have := mk_eq_zero_iff.1 (hV ▸ b.mk_eq_rank'') exact b.repr.toEquiv.subsingleton Basis.empty _ @@ -47,7 +47,7 @@ theorem Basis.ofRankEqZero_apply [Module.Free K V] {ι : Type*} [IsEmpty ι] theorem le_rank_iff_exists_linearIndependent [Module.Free K V] {c : Cardinal} : c ≤ Module.rank K V ↔ ∃ s : Set V, #s = c ∧ LinearIndepOn K id s := by - haveI := nontrivial_of_invariantBasisNumber K + have := nontrivial_of_invariantBasisNumber K constructor · intro h obtain ⟨κ, t'⟩ := Module.Free.exists_basis (R := K) (M := V) @@ -104,18 +104,18 @@ theorem rank_le_one_iff [Module.Free K V] : single non-zero vector of which all vectors are multiples. -/ theorem rank_eq_one_iff [Module.Free K V] : Module.rank K V = 1 ↔ ∃ v₀ : V, v₀ ≠ 0 ∧ ∀ v, ∃ r : K, r • v₀ = v := by - haveI := nontrivial_of_invariantBasisNumber K + have := nontrivial_of_invariantBasisNumber K refine ⟨fun h ↦ ?_, fun ⟨v₀, h, hv⟩ ↦ (rank_le_one_iff.2 ⟨v₀, hv⟩).antisymm ?_⟩ · obtain ⟨v₀, hv⟩ := rank_le_one_iff.1 h.le refine ⟨v₀, fun hzero ↦ ?_, hv⟩ simp_rw [hzero, smul_zero, exists_const] at hv - haveI : Subsingleton V := .intro fun _ _ ↦ by simp_rw [← hv] + have : Subsingleton V := .intro fun _ _ ↦ by simp_rw [← hv] exact one_ne_zero (h ▸ rank_subsingleton' K V) · by_contra H rw [not_le, Cardinal.lt_one_iff] at H obtain ⟨κ, b⟩ := Module.Free.exists_basis (R := K) (M := V) - haveI := mk_eq_zero_iff.1 (H ▸ b.mk_eq_rank'') - haveI := b.repr.toEquiv.subsingleton + have := mk_eq_zero_iff.1 (H ▸ b.mk_eq_rank'') + have := b.repr.toEquiv.subsingleton exact h (Subsingleton.elim _ _) /-- A submodule has dimension at most `1` if and only if there is a @@ -146,7 +146,7 @@ single vector, not necessarily in the submodule, such that the submodule is contained in its span. -/ theorem rank_submodule_le_one_iff' (s : Submodule K V) [Module.Free K s] : Module.rank K s ≤ 1 ↔ ∃ v₀, s ≤ K ∙ v₀ := by - haveI := nontrivial_of_invariantBasisNumber K + have := nontrivial_of_invariantBasisNumber K constructor · rw [rank_submodule_le_one_iff] rintro ⟨v₀, _, h⟩ @@ -170,7 +170,7 @@ theorem Submodule.rank_le_one_iff_isPrincipal (W : Submodule K V) [Module.Free K theorem Module.rank_le_one_iff_top_isPrincipal [Module.Free K V] : Module.rank K V ≤ 1 ↔ (⊤ : Submodule K V).IsPrincipal := by - haveI := Module.Free.of_equiv (topEquiv (R := K) (M := V)).symm + have := Module.Free.of_equiv (topEquiv (R := K) (M := V)).symm rw [← Submodule.rank_le_one_iff_isPrincipal, rank_top] /-- A module has dimension 1 iff there is some `v : V` so `{v}` is a basis. @@ -210,10 +210,10 @@ theorem Module.finrank_le_one_iff_top_isPrincipal [Module.Free K V] [Module.Fini variable (K V) in theorem lift_cardinalMk_eq_lift_cardinalMk_field_pow_lift_rank [Module.Free K V] [Module.Finite K V] : lift.{u} #V = lift.{v} #K ^ lift.{u} (Module.rank K V) := by - haveI := nontrivial_of_invariantBasisNumber K + have := nontrivial_of_invariantBasisNumber K obtain ⟨s, hs⟩ := Module.Free.exists_basis (R := K) (M := V) -- `Module.Finite.finite_basis` is in a much later file, so we copy its proof to here - haveI : Finite s := by + have : Finite s := by obtain ⟨t, ht⟩ := ‹Module.Finite K V› exact basis_finite_of_finite_spans t.finite_toSet ht hs have := lift_mk_eq'.2 ⟨hs.repr.toEquiv⟩ @@ -249,8 +249,8 @@ theorem eq_bot_of_rank_le_one (h : Module.rank F S ≤ 1) [Module.Free F S] : S obtain ⟨y, hy⟩ := (bijective_algebraMap_of_linearEquiv (b.repr ≪≫ₗ Finsupp.uniqueLinearEquiv _ _ default).symm).surjective ⟨x, hx⟩ exact ⟨y, congr(Subtype.val $(hy))⟩ - haveI := mk_eq_zero_iff.1 (b.mk_eq_rank''.symm ▸ Cardinal.lt_one_iff.1 (h.lt_of_ne h1)) - haveI := b.repr.toEquiv.subsingleton + have := mk_eq_zero_iff.1 (b.mk_eq_rank''.symm ▸ Cardinal.lt_one_iff.1 (h.lt_of_ne h1)) + have := b.repr.toEquiv.subsingleton exact False.elim <| one_ne_zero congr(S.val $(Subsingleton.elim 1 0)) theorem eq_bot_of_finrank_one (h : finrank F S = 1) [Module.Free F S] : S = ⊥ := by @@ -269,8 +269,8 @@ theorem rank_eq_one_iff [Nontrivial E] [Module.Free F S] : Module.rank F S = 1 ← Algebra.toSubmodule_bot, rank_toSubmodule] at this · by_contra H rw [not_le, Cardinal.lt_one_iff] at H - haveI := mk_eq_zero_iff.1 (H ▸ b.mk_eq_rank'') - haveI := b.repr.toEquiv.subsingleton + have := mk_eq_zero_iff.1 (H ▸ b.mk_eq_rank'') + have := b.repr.toEquiv.subsingleton exact one_ne_zero congr((⊥ : Subalgebra F E).val $(Subsingleton.elim 1 0)) @[simp] @@ -280,12 +280,12 @@ theorem finrank_eq_one_iff [Nontrivial E] [Module.Free F S] : finrank F S = 1 theorem bot_eq_top_iff_rank_eq_one [Nontrivial E] [Module.Free F E] : (⊥ : Subalgebra F E) = ⊤ ↔ Module.rank F E = 1 := by - haveI := Module.Free.of_equiv (Subalgebra.topEquiv (R := F) (A := E)).toLinearEquiv.symm + have := Module.Free.of_equiv (Subalgebra.topEquiv (R := F) (A := E)).toLinearEquiv.symm rw [← rank_top, Subalgebra.rank_eq_one_iff, eq_comm] theorem bot_eq_top_iff_finrank_eq_one [Nontrivial E] [Module.Free F E] : (⊥ : Subalgebra F E) = ⊤ ↔ finrank F E = 1 := by - haveI := Module.Free.of_equiv (Subalgebra.topEquiv (R := F) (A := E)).toLinearEquiv.symm + have := Module.Free.of_equiv (Subalgebra.topEquiv (R := F) (A := E)).toLinearEquiv.symm rw [← finrank_top, ← subalgebra_top_finrank_eq_submodule_top_finrank, Subalgebra.finrank_eq_one_iff, eq_comm] diff --git a/Mathlib/LinearAlgebra/Dimension/RankNullity.lean b/Mathlib/LinearAlgebra/Dimension/RankNullity.lean index 1d820f2b0b100c..7f8caec8071cfa 100644 --- a/Mathlib/LinearAlgebra/Dimension/RankNullity.lean +++ b/Mathlib/LinearAlgebra/Dimension/RankNullity.lean @@ -77,13 +77,13 @@ attribute [local instance] nontrivial_of_hasRankNullity theorem LinearMap.lift_rank_range_add_rank_ker (f : M →ₗ[R] M') : lift.{u} (Module.rank R (LinearMap.range f)) + lift.{v} (Module.rank R (LinearMap.ker f)) = lift.{v} (Module.rank R M) := by - haveI := fun p : Submodule R M => Classical.decEq (M ⧸ p) + have := fun p : Submodule R M => Classical.decEq (M ⧸ p) rw [← f.quotKerEquivRange.lift_rank_eq, ← lift_add, rank_quotient_add_rank] /-- The **rank-nullity theorem** -/ theorem LinearMap.rank_range_add_rank_ker (f : M →ₗ[R] M₁) : Module.rank R (LinearMap.range f) + Module.rank R (LinearMap.ker f) = Module.rank R M := by - haveI := fun p : Submodule R M => Classical.decEq (M ⧸ p) + have := fun p : Submodule R M => Classical.decEq (M ⧸ p) rw [← f.quotKerEquivRange.rank_eq, rank_quotient_add_rank] theorem LinearMap.lift_rank_eq_of_surjective {f : M →ₗ[R] M'} (h : Surjective f) : diff --git a/Mathlib/LinearAlgebra/Dimension/StrongRankCondition.lean b/Mathlib/LinearAlgebra/Dimension/StrongRankCondition.lean index 368c32cb3e9fed..d7b19b667c68df 100644 --- a/Mathlib/LinearAlgebra/Dimension/StrongRankCondition.lean +++ b/Mathlib/LinearAlgebra/Dimension/StrongRankCondition.lean @@ -68,11 +68,11 @@ have the same cardinalities. -/ theorem mk_eq_mk_of_basis (v : Basis ι R M) (v' : Basis ι' R M) : Cardinal.lift.{w'} #ι = Cardinal.lift.{w} #ι' := by classical - haveI := nontrivial_of_invariantBasisNumber R + have := nontrivial_of_invariantBasisNumber R cases fintypeOrInfinite ι · -- `v` is a finite basis, so by `basis_finite_of_finite_spans` so is `v'`. -- haveI : Finite (range v) := Set.finite_range v - haveI := basis_finite_of_finite_spans (Set.finite_range v) v.span_eq v' + have := basis_finite_of_finite_spans (Set.finite_range v) v.span_eq v' cases nonempty_fintype ι' -- We clean up a little: rw [Cardinal.mk_fintype, Cardinal.mk_fintype] @@ -88,7 +88,7 @@ theorem mk_eq_mk_of_basis (v : Basis ι R M) (v' : Basis ι' R M) : -- we see they have the same cardinality. have w₁ := infinite_basis_le_maximal_linearIndependent' v _ v'.linearIndependent v'.maximal rcases Cardinal.lift_mk_le'.mp w₁ with ⟨f⟩ - haveI : Infinite ι' := Infinite.of_injective f f.2 + have : Infinite ι' := Infinite.of_injective f f.2 have w₂ := infinite_basis_le_maximal_linearIndependent' v' _ v.linearIndependent v.maximal exact le_antisymm w₁ w₂ @@ -130,8 +130,8 @@ but still assumes we have a finite spanning set. -/ theorem basis_le_span' {ι : Type*} (b : Basis ι R M) {w : Set M} [Fintype w] (s : span R w = ⊤) : #ι ≤ Fintype.card w := by - haveI := nontrivial_of_invariantBasisNumber R - haveI := basis_finite_of_finite_spans w.toFinite s b + have := nontrivial_of_invariantBasisNumber R + have := basis_finite_of_finite_spans w.toFinite s b cases nonempty_fintype ι rw [Cardinal.mk_fintype ι] simp only [Nat.cast_le] @@ -144,7 +144,7 @@ then the cardinality of any basis is bounded by the cardinality of any spanning -/ theorem Module.Basis.le_span {J : Set M} (v : Basis ι R M) (hJ : span R J = ⊤) : #(range v) ≤ #J := by - haveI := nontrivial_of_invariantBasisNumber R + have := nontrivial_of_invariantBasisNumber R cases fintypeOrInfinite J · rw [← Cardinal.lift_le, Cardinal.mk_range_eq_of_injective v.injective, Cardinal.mk_fintype J] convert! Cardinal.lift_le.{v}.2 (basis_le_span' v hJ) @@ -216,8 +216,8 @@ the cardinality of `ι` is bounded by the cardinality of `w`. -/ theorem linearIndependent_le_span' {ι : Type*} (v : ι → M) (i : LinearIndependent R v) (w : Set M) [Fintype w] (s : range v ≤ span R w) : #ι ≤ Fintype.card w := by - haveI : Finite ι := i.finite_of_le_span_finite v w s - letI := Fintype.ofFinite ι + have : Finite ι := i.finite_of_le_span_finite v w s + let := Fintype.ofFinite ι rw [Cardinal.mk_fintype] simp only [Nat.cast_le] exact linearIndependent_le_span_aux' v i w s @@ -268,7 +268,7 @@ theorem linearIndependent_le_basis {ι : Type w} (b : Basis ι R M) {κ : Type w -- We split into cases depending on whether `ι` is infinite. cases fintypeOrInfinite ι · rw [Cardinal.mk_fintype ι] -- When `ι` is finite, we have `linearIndependent_le_span`, - haveI : Nontrivial R := nontrivial_of_invariantBasisNumber R + have : Nontrivial R := nontrivial_of_invariantBasisNumber R rw [Fintype.card_congr (Equiv.ofInjective b b.injective)] exact linearIndependent_le_span v i (range b) b.span_eq · -- and otherwise we have `linearIndependent_le_infinite_basis`. @@ -317,11 +317,11 @@ theorem maximal_linearIndependent_eq_infinite_basis {ι : Type w} (b : Basis ι {κ : Type w} (v : κ → M) (i : LinearIndependent R v) (m : i.Maximal) : #κ = #ι := by apply le_antisymm · exact linearIndependent_le_basis b v i - · haveI : Nontrivial R := nontrivial_of_invariantBasisNumber R + · have : Nontrivial R := nontrivial_of_invariantBasisNumber R exact infinite_basis_le_maximal_linearIndependent b v i m theorem Module.Basis.mk_eq_rank'' {ι : Type v} (v : Basis ι R M) : #ι = Module.rank R M := by - haveI := nontrivial_of_invariantBasisNumber R + have := nontrivial_of_invariantBasisNumber R rw [Module.rank_def] apply le_antisymm · trans @@ -345,7 +345,7 @@ cardinality of the basis. -/ theorem rank_eq_card_basis {ι : Type w} [Fintype ι] (h : Basis ι R M) : Module.rank R M = Fintype.card ι := by classical - haveI := nontrivial_of_invariantBasisNumber R + have := nontrivial_of_invariantBasisNumber R rw [← h.mk_range_eq_rank, Cardinal.mk_fintype, Set.card_range_of_injective h.injective] namespace Module.Basis @@ -367,7 +367,7 @@ theorem card_le_card_of_le {N O : Submodule R M} (hNO : N ≤ O) [Fintype ι] theorem mk_eq_rank (v : Basis ι R M) : Cardinal.lift.{v} #ι = Cardinal.lift.{w} (Module.rank R M) := by - haveI := nontrivial_of_invariantBasisNumber R + have := nontrivial_of_invariantBasisNumber R rw [← v.mk_range_eq_rank, Cardinal.mk_range_eq_of_injective v.injective] theorem mk_eq_rank'.{m} (v : Basis ι R M) : @@ -378,7 +378,7 @@ end Module.Basis theorem rank_span {v : ι → M} (hv : LinearIndependent R v) : Module.rank R ↑(span R (range v)) = #(range v) := by - haveI := nontrivial_of_invariantBasisNumber R + have := nontrivial_of_invariantBasisNumber R rw [← Cardinal.lift_inj, ← (Basis.span hv).mk_eq_rank, Cardinal.mk_range_eq_of_injective (@LinearIndependent.injective ι R M v _ _ _ _ hv)] diff --git a/Mathlib/LinearAlgebra/Dual/Basis.lean b/Mathlib/LinearAlgebra/Dual/Basis.lean index 8c652b22e163be..101f08ef55c396 100644 --- a/Mathlib/LinearAlgebra/Dual/Basis.lean +++ b/Mathlib/LinearAlgebra/Dual/Basis.lean @@ -197,7 +197,7 @@ omit [DecidableEq ι] @[simp] theorem linearCombination_coord [Finite ι] (b : Basis ι R M) (f : ι →₀ R) (i : ι) : Finsupp.linearCombination R b.coord f (b i) = f i := by - haveI := Classical.decEq ι + have := Classical.decEq ι rw [← coe_dualBasis, linearCombination_dualBasis] end CommSemiring diff --git a/Mathlib/LinearAlgebra/Dual/Lemmas.lean b/Mathlib/LinearAlgebra/Dual/Lemmas.lean index 5e885ee7021604..5d76ce3ad04227 100644 --- a/Mathlib/LinearAlgebra/Dual/Lemmas.lean +++ b/Mathlib/LinearAlgebra/Dual/Lemmas.lean @@ -1027,9 +1027,9 @@ open Submodule in theorem dualAnnihilator_dualAnnihilator_eq_map (W : Subspace K V) [FiniteDimensional K W] : W.dualAnnihilator.dualAnnihilator = W.map (Dual.eval K V) := by let e1 := (Free.chooseBasis K W).toDualEquiv ≪≫ₗ W.quotAnnihilatorEquiv.symm - haveI := e1.finiteDimensional + have := e1.finiteDimensional let e2 := (Free.chooseBasis K _).toDualEquiv ≪≫ₗ W.dualAnnihilator.dualQuotEquivDualAnnihilator - haveI := LinearEquiv.finiteDimensional (V₂ := W.dualAnnihilator.dualAnnihilator) e2 + have := LinearEquiv.finiteDimensional (V₂ := W.dualAnnihilator.dualAnnihilator) e2 rw [eq_of_le_of_finrank_eq (map_le_dualAnnihilator_dualAnnihilator W)] rw [← (equivMapOfInjective _ (eval_apply_injective K (V := V)) W).finrank_eq, e1.finrank_eq] exact e2.finrank_eq diff --git a/Mathlib/LinearAlgebra/Eigenspace/Triangularizable.lean b/Mathlib/LinearAlgebra/Eigenspace/Triangularizable.lean index 909bb28e8236b7..4354cce60c81d4 100644 --- a/Mathlib/LinearAlgebra/Eigenspace/Triangularizable.lean +++ b/Mathlib/LinearAlgebra/Eigenspace/Triangularizable.lean @@ -83,7 +83,7 @@ theorem iSup_maxGenEigenspace_eq_top [IsAlgClosed K] [FiniteDimensional K V] (f · rw [← top_le_iff] simp only [Submodule.finrank_eq_zero.1 (Eq.trans (finrank_top _ _) h_dim), bot_le] -- Otherwise the vector space is nontrivial. - · haveI : Nontrivial V := finrank_pos_iff.1 (by rw [h_dim]; apply Nat.zero_lt_succ) + · have : Nontrivial V := finrank_pos_iff.1 (by rw [h_dim]; apply Nat.zero_lt_succ) -- Hence, `f` has an eigenvalue `μ₀`. obtain ⟨μ₀, hμ₀⟩ : ∃ μ₀, f.HasEigenvalue μ₀ := exists_eigenvalue f -- We define `ES` to be the generalized eigenspace diff --git a/Mathlib/LinearAlgebra/ExteriorAlgebra/Basic.lean b/Mathlib/LinearAlgebra/ExteriorAlgebra/Basic.lean index 754cc90df5e7c1..ec57052dce2f9a 100644 --- a/Mathlib/LinearAlgebra/ExteriorAlgebra/Basic.lean +++ b/Mathlib/LinearAlgebra/ExteriorAlgebra/Basic.lean @@ -216,8 +216,8 @@ theorem ι_eq_zero_iff (x : M) : ι R x = 0 ↔ x = 0 := by rw [← ι_inj R x 0 @[simp] theorem ι_eq_algebraMap_iff (x : M) (r : R) : ι R x = algebraMap R _ r ↔ x = 0 ∧ r = 0 := by refine ⟨fun h => ?_, ?_⟩ - · letI : Module Rᵐᵒᵖ M := Module.compHom _ ((RingHom.id R).fromOpposite mul_comm) - haveI : IsCentralScalar R M := ⟨fun r m => rfl⟩ + · let : Module Rᵐᵒᵖ M := Module.compHom _ ((RingHom.id R).fromOpposite mul_comm) + have : IsCentralScalar R M := ⟨fun r m => rfl⟩ have hf0 : toTrivSqZeroExt (ι R x) = (0, x) := toTrivSqZeroExt_ι _ rw [h, AlgHom.commutes] at hf0 have : r = 0 ∧ 0 = x := Prod.ext_iff.1 hf0 @@ -450,10 +450,10 @@ theorem toTrivSqZeroExt_comp_map [Module Rᵐᵒᵖ M] [IsCentralScalar R M] [Mo theorem ιInv_comp_map (f : M →ₗ[R] N) : ιInv.comp (map f).toLinearMap = f.comp ιInv := by - letI : Module Rᵐᵒᵖ M := Module.compHom _ ((RingHom.id R).fromOpposite mul_comm) - haveI : IsCentralScalar R M := ⟨fun r m => rfl⟩ - letI : Module Rᵐᵒᵖ N := Module.compHom _ ((RingHom.id R).fromOpposite mul_comm) - haveI : IsCentralScalar R N := ⟨fun r m => rfl⟩ + let : Module Rᵐᵒᵖ M := Module.compHom _ ((RingHom.id R).fromOpposite mul_comm) + have : IsCentralScalar R M := ⟨fun r m => rfl⟩ + let : Module Rᵐᵒᵖ N := Module.compHom _ ((RingHom.id R).fromOpposite mul_comm) + have : IsCentralScalar R N := ⟨fun r m => rfl⟩ unfold ιInv conv_lhs => rw [LinearMap.comp_assoc, ← AlgHom.comp_toLinearMap, toTrivSqZeroExt_comp_map, AlgHom.comp_toLinearMap, ← LinearMap.comp_assoc, TrivSqZeroExt.sndHom_comp_map] diff --git a/Mathlib/LinearAlgebra/ExteriorPower/Basis.lean b/Mathlib/LinearAlgebra/ExteriorPower/Basis.lean index 6e65099ebe6f75..50e27174fe674f 100644 --- a/Mathlib/LinearAlgebra/ExteriorPower/Basis.lean +++ b/Mathlib/LinearAlgebra/ExteriorPower/Basis.lean @@ -149,7 +149,7 @@ lemma basis_repr {I : Type*} [LinearOrder I] (b : Basis I R M) (s : powersetCard instance instFree [Module.Free R M] : Module.Free R (⋀[R]^n M) := by classical have ⟨I, b⟩ := Module.Free.exists_basis R M - letI : LinearOrder I := linearOrderOfSTO WellOrderingRel + let : LinearOrder I := linearOrderOfSTO WellOrderingRel exact Module.Free.of_basis (b.exteriorPower n) variable [Nontrivial R] diff --git a/Mathlib/LinearAlgebra/FiniteDimensional/Basic.lean b/Mathlib/LinearAlgebra/FiniteDimensional/Basic.lean index 83c1c3b59a1cf9..49794d6963ed7b 100644 --- a/Mathlib/LinearAlgebra/FiniteDimensional/Basic.lean +++ b/Mathlib/LinearAlgebra/FiniteDimensional/Basic.lean @@ -74,7 +74,7 @@ theorem _root_.Submodule.eq_top_of_finrank_eq [FiniteDimensional K V] {S : Submo simpa [bS] using bS.linearIndependent.linearIndepOn_id.image (f := Submodule.subtype S) (by simp) set b := Basis.extend this with b_eq - letI i2 : Fintype (((↑) : S → V) '' Basis.ofVectorSpaceIndex K S) := + let i2 : Fintype (((↑) : S → V) '' Basis.ofVectorSpaceIndex K S) := (LinearIndependent.set_finite_of_isNoetherian this).fintype have : (↑) '' Basis.ofVectorSpaceIndex K S = this.extend (Set.subset_univ _) := Set.eq_of_subset_of_card_le (this.subset_extend _) @@ -586,7 +586,7 @@ lemma exists_smul_eq_of_finrank_eq_one theorem eq_span_singleton_of_mem_of_finrank_eq_one {S : Submodule K V} {w : V} (hS : finrank K S = 1) (hw : w ∈ S) (hw0 : w ≠ 0) : S = K ∙ w := by - haveI : FiniteDimensional K S := Module.finite_of_finrank_pos (by lia) + have : FiniteDimensional K S := Module.finite_of_finrank_pos (by lia) exact Eq.symm <| eq_of_le_of_finrank_le (by simpa) (by rw [hS, finrank_span_singleton hw0]) diff --git a/Mathlib/LinearAlgebra/FiniteDimensional/Lemmas.lean b/Mathlib/LinearAlgebra/FiniteDimensional/Lemmas.lean index cc7f05239646e7..7fc2c784f0d21b 100644 --- a/Mathlib/LinearAlgebra/FiniteDimensional/Lemmas.lean +++ b/Mathlib/LinearAlgebra/FiniteDimensional/Lemmas.lean @@ -324,7 +324,7 @@ noncomputable def finsetBasisOfLinearIndependentOfCardEqFinrank {s : Finset V} ( theorem coe_finsetBasisOfLinearIndependentOfCardEqFinrank {s : Finset V} (hs : s.Nonempty) (lin_ind : LinearIndependent K ((↑) : s → V)) (card_eq : s.card = finrank K V) : ⇑(finsetBasisOfLinearIndependentOfCardEqFinrank hs lin_ind card_eq) = ((↑) : s → V) := by - haveI : Nonempty s := ⟨⟨hs.choose, hs.choose_spec⟩⟩ + have : Nonempty s := ⟨⟨hs.choose, hs.choose_spec⟩⟩ simp [finsetBasisOfLinearIndependentOfCardEqFinrank] /-- A linear independent set of `finrank K V`-many vectors forms a basis. -/ @@ -351,10 +351,10 @@ section finrank_eq_one /-- Any `K`-algebra module that is 1-dimensional over `K` is simple. -/ theorem is_simple_module_of_finrank_eq_one {A} [Semiring A] [Module A V] [SMul K A] [IsScalarTower K A V] (h : finrank K V = 1) : IsSimpleOrder (Submodule A V) := by - haveI := nontrivial_of_finrank_eq_succ h + have := nontrivial_of_finrank_eq_succ h refine ⟨fun S => or_iff_not_imp_left.2 fun hn => ?_⟩ rw [← restrictScalars_inj K] at hn ⊢ - haveI : FiniteDimensional _ _ := .of_finrank_eq_succ h + have : FiniteDimensional _ _ := .of_finrank_eq_succ h refine eq_top_of_finrank_eq ((Submodule.finrank_le _).antisymm ?_) simpa only [h, finrank_bot] using! Submodule.finrank_strictMono (Ne.bot_lt hn) @@ -375,8 +375,8 @@ theorem Subalgebra.isSimpleOrder_of_finrank (hr : finrank F E = 2) : ⟨⟨⊥, ⊤, fun h => by cases hr.symm.trans (Subalgebra.bot_eq_top_iff_finrank_eq_one.1 h)⟩⟩ eq_bot_or_eq_top := by intro S - haveI : FiniteDimensional F E := .of_finrank_eq_succ hr - haveI : FiniteDimensional F S := + have : FiniteDimensional F E := .of_finrank_eq_succ hr + have : FiniteDimensional F S := FiniteDimensional.finiteDimensional_submodule (Subalgebra.toSubmodule S) have : finrank F S ≤ 2 := hr ▸ S.toSubmodule.finrank_le have : 0 < finrank F S := finrank_pos_iff.mpr inferInstance diff --git a/Mathlib/LinearAlgebra/Finsupp/LinearCombination.lean b/Mathlib/LinearAlgebra/Finsupp/LinearCombination.lean index 925148ef6dc70f..68ad97b090c321 100644 --- a/Mathlib/LinearAlgebra/Finsupp/LinearCombination.lean +++ b/Mathlib/LinearAlgebra/Finsupp/LinearCombination.lean @@ -192,7 +192,7 @@ theorem span_image_eq_map_linearCombination (s : Set α) : · refine map_le_iff_le_comap.2 fun z hz => ?_ have : ∀ i, z i • v i ∈ span R (v '' s) := by intro c - haveI := Classical.decPred fun x => x ∈ s + have := Classical.decPred fun x => x ∈ s by_cases h : c ∈ s · exact smul_mem _ _ (subset_span (Set.mem_image_of_mem _ h)) · simp [(Finsupp.mem_supported' R _).1 hz _ h] diff --git a/Mathlib/LinearAlgebra/Finsupp/Supported.lean b/Mathlib/LinearAlgebra/Finsupp/Supported.lean index a774d2ba9954e7..49591e6219a67a 100644 --- a/Mathlib/LinearAlgebra/Finsupp/Supported.lean +++ b/Mathlib/LinearAlgebra/Finsupp/Supported.lean @@ -136,7 +136,7 @@ theorem supported_univ : supported M R (Set.univ : Set α) = ⊤ := theorem supported_iUnion {δ : Type*} (s : δ → Set α) : supported M R (⋃ i, s i) = ⨆ i, supported M R (s i) := by refine le_antisymm ?_ (iSup_le fun i => supported_mono <| Set.subset_iUnion _ _) - haveI := Classical.decPred fun x => x ∈ ⋃ i, s i + have := Classical.decPred fun x => x ∈ ⋃ i, s i suffices LinearMap.range ((Submodule.subtype _).comp (restrictDom M R (⋃ i, s i))) ≤ ⨆ i, supported M R (s i) by @@ -248,7 +248,7 @@ theorem lmapDomain_disjoint_ker (f : α → α') {s : Set α} rintro l ⟨h₁, h₂⟩ rw [SetLike.mem_coe, mem_ker, lmapDomain_apply, mapDomain] at h₂ simp only [mem_bot]; ext x - haveI := Classical.decPred fun x => x ∈ s + have := Classical.decPred fun x => x ∈ s by_cases xs : x ∈ s · have : Finsupp.sum l (fun a => Finsupp.single (f a)) (f x) = 0 := by rw [h₂] diff --git a/Mathlib/LinearAlgebra/FreeModule/Determinant.lean b/Mathlib/LinearAlgebra/FreeModule/Determinant.lean index 46f48f44a9699a..d9c34213b74c2e 100644 --- a/Mathlib/LinearAlgebra/FreeModule/Determinant.lean +++ b/Mathlib/LinearAlgebra/FreeModule/Determinant.lean @@ -26,6 +26,6 @@ public section @[simp high] theorem LinearMap.det_zero'' {R M : Type*} [CommRing R] [AddCommGroup M] [Module R M] [Module.Free R M] [Module.Finite R M] [Nontrivial M] : LinearMap.det (0 : M →ₗ[R] M) = 0 := by - letI : Nonempty (Module.Free.ChooseBasisIndex R M) := (Module.Free.chooseBasis R M).index_nonempty + let : Nonempty (Module.Free.ChooseBasisIndex R M) := (Module.Free.chooseBasis R M).index_nonempty nontriviality R exact LinearMap.det_zero' (Module.Free.chooseBasis R M) diff --git a/Mathlib/LinearAlgebra/FreeModule/Norm.lean b/Mathlib/LinearAlgebra/FreeModule/Norm.lean index 995a84b92d811b..2962cae544ddf3 100644 --- a/Mathlib/LinearAlgebra/FreeModule/Norm.lean +++ b/Mathlib/LinearAlgebra/FreeModule/Norm.lean @@ -62,7 +62,7 @@ instance (b : Basis ι F[X] S) {I : Ideal S} (hI : I ≠ ⊥) (i : ι) : theorem finrank_quotient_span_eq_natDegree_norm [Algebra F S] [IsScalarTower F F[X] S] (b : Basis ι F[X] S) {f : S} (hf : f ≠ 0) : Module.finrank F (S ⧸ span ({f} : Set S)) = (Algebra.norm F[X] f).natDegree := by - haveI := Fintype.ofFinite ι + have := Fintype.ofFinite ι have h := span_singleton_eq_bot.not.2 hf rw [natDegree_eq_of_degree_eq (degree_eq_degree_of_associated <| associated_norm_prod_smith b hf)] diff --git a/Mathlib/LinearAlgebra/FreeModule/PID.lean b/Mathlib/LinearAlgebra/FreeModule/PID.lean index 52b563a86523fb..fc285a3509f0c2 100644 --- a/Mathlib/LinearAlgebra/FreeModule/PID.lean +++ b/Mathlib/LinearAlgebra/FreeModule/PID.lean @@ -278,7 +278,7 @@ See also the stronger version `Submodule.smithNormalForm`. -/ theorem Submodule.nonempty_basis_of_pid {ι : Type*} [Finite ι] (b : Basis ι R M) (N : Submodule R M) : ∃ n : ℕ, Nonempty (Basis (Fin n) R N) := by - haveI := Classical.decEq M + have := Classical.decEq M cases nonempty_fintype ι induction N using inductionOnRank b with | ih N ih => let b' := (b.reindex (Fintype.equivFin ι)).map (LinearEquiv.ofTop _ rfl).symm diff --git a/Mathlib/LinearAlgebra/LinearDisjoint.lean b/Mathlib/LinearAlgebra/LinearDisjoint.lean index 92b016cadf3c42..25b17df3e801df 100644 --- a/Mathlib/LinearAlgebra/LinearDisjoint.lean +++ b/Mathlib/LinearAlgebra/LinearDisjoint.lean @@ -491,7 +491,7 @@ theorem not_linearIndependent_pair_of_commute_of_flat_left [Module.Flat R M] let n : Fin 2 → N := (inclusion inf_le_right) ∘ ![a, b] have hn : LinearIndependent R n := h.map' _ (ker_inclusion _ _ _) -- need this instance otherwise it only has semigroup structure - letI : AddCommGroup (Fin 2 →₀ M) := Finsupp.instAddCommGroup + let : AddCommGroup (Fin 2 →₀ M) := Finsupp.instAddCommGroup let m : Fin 2 →₀ M := .single 0 ⟨b.1, b.2.1⟩ - .single 1 ⟨a.1, a.2.1⟩ have hm : mulRightMap M n m = 0 := by simp [m, n, show _ * _ = _ * _ from hc] rw [← LinearMap.mem_ker, H.linearIndependent_right_of_flat hn, mem_bot] at hm @@ -507,7 +507,7 @@ theorem not_linearIndependent_pair_of_commute_of_flat_right [Module.Flat R N] let m : Fin 2 → M := (inclusion inf_le_left) ∘ ![a, b] have hm : LinearIndependent R m := h.map' _ (ker_inclusion _ _ _) -- need this instance otherwise it only has semigroup structure - letI : AddCommGroup (Fin 2 →₀ N) := Finsupp.instAddCommGroup + let : AddCommGroup (Fin 2 →₀ N) := Finsupp.instAddCommGroup let n : Fin 2 →₀ N := .single 0 ⟨b.1, b.2.2⟩ - .single 1 ⟨a.1, a.2.2⟩ have hn : mulLeftMap N m n = 0 := by simp [m, n, show _ * _ = _ * _ from hc] rw [← LinearMap.mem_ker, H.linearIndependent_left_of_flat hm, mem_bot] at hn diff --git a/Mathlib/LinearAlgebra/LinearIndependent/Basic.lean b/Mathlib/LinearAlgebra/LinearIndependent/Basic.lean index 4ed7daffa65bde..fb44bd661aa109 100644 --- a/Mathlib/LinearAlgebra/LinearIndependent/Basic.lean +++ b/Mathlib/LinearAlgebra/LinearIndependent/Basic.lean @@ -496,8 +496,8 @@ theorem LinearIndepOn.image {s : Set M} {f : M →ₗ[R] M'} @[stacks 0CKL] theorem linearIndependent_monoidHom (G : Type*) [MulOneClass G] (L : Type*) [CommRing L] [IsDomain L] : LinearIndependent L (M := G → L) (fun f => f : (G →* L) → G → L) := by - letI := Classical.decEq (G →* L) - letI : MulAction L L := DistribMulAction.toMulAction + let := Classical.decEq (G →* L) + let : MulAction L L := DistribMulAction.toMulAction -- We prove linear independence by showing that only the trivial linear combination vanishes. apply linearIndependent_iff'.2 intro s diff --git a/Mathlib/LinearAlgebra/LinearIndependent/Defs.lean b/Mathlib/LinearAlgebra/LinearIndependent/Defs.lean index 057bfa60361098..b44f5c5518aaf4 100644 --- a/Mathlib/LinearAlgebra/LinearIndependent/Defs.lean +++ b/Mathlib/LinearAlgebra/LinearIndependent/Defs.lean @@ -593,8 +593,8 @@ theorem linearIndependent_iffₒₛ : ∀ (s t : Finset ι) (f : ι → R), Disjoint s t → ∑ i ∈ s, f i • v i = ∑ i ∈ t, f i • v i → (∀ i ∈ s, f i = 0) ∧ ∀ i ∈ t, f i = 0 := by classical - letI : Sub R := CanonicallyOrderedAdd.toSub - haveI : OrderedSub R := CanonicallyOrderedAdd.toOrderedSub + let : Sub R := CanonicallyOrderedAdd.toSub + have : OrderedSub R := CanonicallyOrderedAdd.toOrderedSub rw [linearIndependent_iff'ₛ] refine ⟨fun h s t f hst heq => ?_, fun h s f g heq => ?_⟩ · specialize h (s ∪ t) (fun i => if i ∈ s then f i else 0) (fun i => if i ∈ t then f i else 0) ?_ diff --git a/Mathlib/LinearAlgebra/LinearIndependent/Lemmas.lean b/Mathlib/LinearAlgebra/LinearIndependent/Lemmas.lean index ab631ec1d803f9..0cbe3abb88dfd9 100644 --- a/Mathlib/LinearAlgebra/LinearIndependent/Lemmas.lean +++ b/Mathlib/LinearAlgebra/LinearIndependent/Lemmas.lean @@ -206,7 +206,7 @@ theorem exists_maximal_linearIndepOn' (v : ι → M) : intro f hfsupp g hgsupp hsum rcases eq_empty_or_nonempty c with (rfl | hn) · rw [show f = 0 by simpa using! hfsupp, show g = 0 by simpa using! hgsupp] - haveI : Std.Refl r := ⟨fun _ => Set.Subset.refl _⟩ + have : Std.Refl r := ⟨fun _ => Set.Subset.refl _⟩ classical obtain ⟨I, _I_mem, hI⟩ : ∃ I ∈ c, (f.support ∪ g.support : Set ι) ⊆ I := f.support.coe_union _ ▸ hc.directedOn.exists_mem_subset_of_finset_subset_biUnion hn <| by diff --git a/Mathlib/LinearAlgebra/Matrix/Adjugate.lean b/Mathlib/LinearAlgebra/Matrix/Adjugate.lean index 8d43586fa43715..6f4e185c30b71c 100644 --- a/Mathlib/LinearAlgebra/Matrix/Adjugate.lean +++ b/Mathlib/LinearAlgebra/Matrix/Adjugate.lean @@ -341,7 +341,7 @@ theorem _root_.AlgHom.map_adjugate {R A B : Type*} [CommSemiring R] [CommRing A] theorem det_adjugate (A : Matrix n n α) : (adjugate A).det = A.det ^ (Fintype.card n - 1) := by -- get rid of the `- 1` rcases (Fintype.card n).eq_zero_or_pos with h_card | h_card - · haveI : IsEmpty n := Fintype.card_eq_zero_iff.mp h_card + · have : IsEmpty n := Fintype.card_eq_zero_iff.mp h_card rw [h_card, Nat.zero_sub, pow_zero, adjugate_subsingleton, det_one] replace h_card := tsub_add_cancel_of_le h_card.nat_succ_le -- express `A` as an evaluation of a polynomial in n^2 variables, and solve in the polynomial ring @@ -406,7 +406,7 @@ theorem adjugate_fin_three_of (a b c d e f g h i : α) : theorem det_eq_sum_mul_adjugate_row (A : Matrix n n α) (i : n) : det A = ∑ j : n, A i j * adjugate A j i := by - haveI : Nonempty n := ⟨i⟩ + have : Nonempty n := ⟨i⟩ obtain ⟨n', hn'⟩ := Nat.exists_eq_succ_of_ne_zero (Fintype.card_ne_zero : Fintype.card n ≠ 0) obtain ⟨e⟩ := Fintype.truncEquivFinOfCardEq hn' let A' := reindex e e A diff --git a/Mathlib/LinearAlgebra/Matrix/Basis.lean b/Mathlib/LinearAlgebra/Matrix/Basis.lean index 226675ca15bc1d..39fe6645ead7f2 100644 --- a/Mathlib/LinearAlgebra/Matrix/Basis.lean +++ b/Mathlib/LinearAlgebra/Matrix/Basis.lean @@ -181,7 +181,7 @@ variable [Fintype ι'] theorem basis_toMatrix_mul_linearMap_toMatrix [Finite κ] [Fintype κ'] [DecidableEq ι'] : c.toMatrix c' * LinearMap.toMatrix b' c' f = LinearMap.toMatrix b' c f := (Matrix.toLin b' c).injective <| by - haveI := Classical.decEq κ' + have := Classical.decEq κ' rw [toLin_toMatrix, toLin_mul b' c' c, toLin_toMatrix, c.toLin_toMatrix, LinearMap.id_comp] theorem basis_toMatrix_mul [Fintype κ] [Finite ι] [DecidableEq κ] @@ -244,9 +244,9 @@ namespace Module.Basis @[simp] theorem toMatrix_mul_toMatrix {ι'' : Type*} [Fintype ι'] (b'' : ι'' → M) : b.toMatrix b' * b'.toMatrix b'' = b.toMatrix b'' := by - haveI := Classical.decEq ι - haveI := Classical.decEq ι' - haveI := Classical.decEq ι'' + have := Classical.decEq ι + have := Classical.decEq ι' + have := Classical.decEq ι'' ext i j simp only [Matrix.mul_apply, toMatrix_apply, sum_repr_mul_repr] diff --git a/Mathlib/LinearAlgebra/Matrix/Block.lean b/Mathlib/LinearAlgebra/Matrix/Block.lean index 33723314f1fcab..8778b6bd5c30d8 100644 --- a/Mathlib/LinearAlgebra/Matrix/Block.lean +++ b/Mathlib/LinearAlgebra/Matrix/Block.lean @@ -323,7 +323,7 @@ theorem BlockTriangular.det_fintype [DecidableEq α] [Fintype α] [LinearOrder theorem det_of_upperTriangular [LinearOrder m] (h : M.BlockTriangular id) : M.det = ∏ i : m, M i i := by - haveI : DecidableEq R := Classical.decEq _ + have : DecidableEq R := Classical.decEq _ simp_rw [h.det, image_id, det_toSquareBlock_id] theorem det_of_lowerTriangular [LinearOrder m] (M : Matrix m m R) (h : M.BlockTriangular toDual) : @@ -395,7 +395,7 @@ theorem toBlock_inverse_eq_zero [LinearOrder α] [Invertible M] (hM : BlockTrian ext i j simpa using hM (lt_of_lt_of_le j.2 <| le_of_not_gt i.2) have h_mul_eq_zero : M⁻¹.toBlock q p * M.toBlock p p = 0 := by simpa [h_zero] using h_sum - haveI : Invertible (M.toBlock p p) := hM.invertibleToBlock k + have : Invertible (M.toBlock p p) := hM.invertibleToBlock k have : (fun i => k ≤ b i) = q := by ext exact not_lt.symm @@ -410,7 +410,7 @@ theorem blockTriangular_inv_of_blockTriangular [LinearOrder α] [Invertible M] induction s using Finset.strongInduction generalizing m with | H s ih => subst hs intro i j hij - haveI : Inhabited m := ⟨i⟩ + have : Inhabited m := ⟨i⟩ let k := (univ.image b).max' (univ_nonempty.image _) let b' := fun i : { a // b a < k } => b ↑i let A := M.toBlock (fun i => b i < k) fun j => b j < k @@ -418,7 +418,7 @@ theorem blockTriangular_inv_of_blockTriangular [LinearOrder α] [Invertible M] · have : M⁻¹.toBlock (fun i => k ≤ b i) (fun i => b i < k) ⟨i, hbi.ge⟩ ⟨j, hbi ▸ hij⟩ = 0 := by simp only [toBlock_inverse_eq_zero hM k, Matrix.zero_apply] simp [this.symm] - haveI : Invertible A := hM.invertibleToBlock _ + have : Invertible A := hM.invertibleToBlock _ have hA : A.BlockTriangular b' := hM.submatrix have hb' : image b' univ ⊂ image b univ := by convert! image_subtype_univ_ssubset_image_univ k b _ (fun a => a < k) (lt_irrefl _) diff --git a/Mathlib/LinearAlgebra/Matrix/Charpoly/FiniteField.lean b/Mathlib/LinearAlgebra/Matrix/Charpoly/FiniteField.lean index 646f43ace77764..d58ead18bb217d 100644 --- a/Mathlib/LinearAlgebra/Matrix/Charpoly/FiniteField.lean +++ b/Mathlib/LinearAlgebra/Matrix/Charpoly/FiniteField.lean @@ -30,7 +30,7 @@ theorem FiniteField.Matrix.charpoly_pow_card {K : Type*} [Field K] [Fintype K] ( cases (isEmpty_or_nonempty n).symm · obtain ⟨p, hp⟩ := CharP.exists K rcases FiniteField.card K p with ⟨⟨k, kpos⟩, ⟨hp, hk⟩⟩ - haveI : Fact p.Prime := ⟨hp⟩ + have : Fact p.Prime := ⟨hp⟩ dsimp at hk; rw [hk] apply (frobenius_inj K[X] p).iterate k repeat' rw [iterate_frobenius (R := K[X])]; rw [← hk] diff --git a/Mathlib/LinearAlgebra/Matrix/Invertible.lean b/Mathlib/LinearAlgebra/Matrix/Invertible.lean index 1ddc70e5caf5e9..656fe672d4883b 100644 --- a/Mathlib/LinearAlgebra/Matrix/Invertible.lean +++ b/Mathlib/LinearAlgebra/Matrix/Invertible.lean @@ -111,7 +111,7 @@ instance invertibleTranspose [Invertible A] : Invertible Aᵀ where mul_invOf_self := by rw [← transpose_mul, invOf_mul_self, transpose_one] lemma transpose_invOf [Invertible A] [Invertible Aᵀ] : (⅟A)ᵀ = ⅟(Aᵀ) := by - letI := invertibleTranspose A + let := invertibleTranspose A convert! (rfl : _ = ⅟(Aᵀ)) /-- `Aᵀ` is invertible when `A` is. -/ @@ -198,7 +198,7 @@ def invertibleAddMulMul : Invertible (A + U * C * V) where See `Matrix.invOf_add_mul_mul'` for the Binomial Inverse Theorem. -/ theorem invOf_add_mul_mul [Invertible (A + U * C * V)] : ⅟(A + U * C * V) = ⅟A - ⅟A * U * ⅟(⅟C + V * ⅟A * U) * V * ⅟A := by - letI := invertibleAddMulMul A U C V + let := invertibleAddMulMul A U C V convert! (rfl : ⅟(A + U * C * V) = _) end Woodbury @@ -242,7 +242,7 @@ def invertibleAddMulMul' : Invertible (A + U * C * V) where See `Matrix.invOf_add_mul_mul` for the Woodbury identity. -/ theorem invOf_add_mul_mul' [Invertible (A + U * C * V)] : ⅟(A + U * C * V) = ⅟A - ⅟A * U * C * ⅟(C + C * V * ⅟A * U * C) * C * V * ⅟A := by - letI := invertibleAddMulMul' A U C V + let := invertibleAddMulMul' A U C V convert! (rfl : ⅟(A + U * C * V) = _) end BinomialInverseTheorem diff --git a/Mathlib/LinearAlgebra/Matrix/Irreducible/Defs.lean b/Mathlib/LinearAlgebra/Matrix/Irreducible/Defs.lean index f98961391940e6..58c6e2d0a85b46 100644 --- a/Mathlib/LinearAlgebra/Matrix/Irreducible/Defs.lean +++ b/Mathlib/LinearAlgebra/Matrix/Irreducible/Defs.lean @@ -95,7 +95,7 @@ variable {A : Matrix n n R} lemma IsIrreducible.exists_pos [Nontrivial n] (h_irr : IsIrreducible A) (i : n) : ∃ j, 0 < A i j := by - letI : Quiver n := toQuiver A + let : Quiver n := toQuiver A by_contra h_row have no_out : ∀ j : n, IsEmpty (i ⟶ j) := fun j => ⟨fun e => h_row ⟨j, e.down⟩⟩ @@ -117,7 +117,7 @@ theorem pow_apply_pos_iff_nonempty_path (hA : ∀ i j, 0 ≤ A i j) (k : ℕ) (i j : n) : letI := toQuiver A 0 < (A ^ k) i j ↔ Nonempty {p : Path i j // p.length = k} := by - letI := toQuiver A + let := toQuiver A induction k generalizing i j with | zero => refine ⟨fun h_pos ↦ ?_, fun ⟨p, hp⟩ ↦ ?_⟩ @@ -160,7 +160,7 @@ theorem isIrreducible_iff_exists_pow_pos [Fintype n] [IsOrderedRing R] [PosMulStrictMono R] [Nontrivial R] [DecidableEq n] (hA : ∀ i j, 0 ≤ A i j) : IsIrreducible A ↔ ∀ i j, ∃ k > 0, 0 < (A ^ k) i j := by - letI : Quiver n := toQuiver A + let : Quiver n := toQuiver A constructor · intro h_irr i j obtain ⟨p, hp_len⟩ := h_irr.2 i j @@ -207,14 +207,14 @@ theorem IsIrreducible.transpose (hA : IsIrreducible A) : IsIrreducible Aᵀ := b simpa [Matrix.transpose_apply] using hA.nonneg j i refine ⟨hA_T_nonneg, ?_⟩ intro i j - letI : Quiver n := toQuiver A + let : Quiver n := toQuiver A obtain ⟨p, hp_pos⟩ := hA.connected j i cases p with | nil => simp at hp_pos | @cons b _ q e => let qT := transposePath (A := A) (q.cons e) - letI : Quiver n := toQuiver Aᵀ + let : Quiver n := toQuiver Aᵀ use qT simp [qT, transposePath, Quiver.Path.length_comp, Quiver.Path.length_toPath] diff --git a/Mathlib/LinearAlgebra/Matrix/NonsingularInverse.lean b/Mathlib/LinearAlgebra/Matrix/NonsingularInverse.lean index 0cda6cc66b8de5..3daaf66b9fea83 100644 --- a/Mathlib/LinearAlgebra/Matrix/NonsingularInverse.lean +++ b/Mathlib/LinearAlgebra/Matrix/NonsingularInverse.lean @@ -84,7 +84,7 @@ def invertibleOfDetInvertible [Invertible A.det] : Invertible A where rw [smul_mul_assoc, adjugate_mul, smul_smul, invOf_mul_self, one_smul] theorem invOf_eq [Invertible A.det] [Invertible A] : ⅟A = ⅟A.det • A.adjugate := by - letI := invertibleOfDetInvertible A + let := invertibleOfDetInvertible A convert! (rfl : ⅟A = _) /-- `A.det` is invertible if `A` has a left inverse. -/ @@ -107,7 +107,7 @@ def detInvertibleOfInvertible [Invertible A] : Invertible A.det := detInvertibleOfLeftInverse A (⅟A) (invOf_mul_self _) theorem det_invOf [Invertible A] [Invertible A.det] : (⅟A).det = ⅟A.det := by - letI := detInvertibleOfInvertible A + let := detInvertibleOfInvertible A convert! (rfl : _ = ⅟A.det) /-- Together `Matrix.detInvertibleOfInvertible` and `Matrix.invertibleOfDetInvertible` form an @@ -181,14 +181,14 @@ theorem nonsing_inv_apply (h : IsUnit A.det) : A⁻¹ = (↑h.unit⁻¹ : α) /-- The nonsingular inverse is the same as `invOf` when `A` is invertible. -/ @[simp] theorem invOf_eq_nonsing_inv [Invertible A] : ⅟A = A⁻¹ := by - letI := detInvertibleOfInvertible A + let := detInvertibleOfInvertible A rw [inv_def, Ring.inverse_invertible, invOf_eq] /-- Coercing the result of `Units.instInv` is the same as coercing first and applying the nonsingular inverse. -/ @[simp, norm_cast] theorem coe_units_inv (A : (Matrix n n α)ˣ) : ↑A⁻¹ = (A⁻¹ : Matrix n n α) := by - letI := A.invertible + let := A.invertible rw [← invOf_eq_nonsing_inv, invOf_units] /-- The nonsingular inverse is the same as the general `Ring.inverse`. -/ @@ -412,7 +412,7 @@ theorem det_nonsing_inv_mul_det (h : IsUnit A.det) : A⁻¹.det * A.det = 1 := b theorem det_nonsing_inv : A⁻¹.det = A.det⁻¹ʳ := by by_cases h : IsUnit A.det · cases h.nonempty_invertible - letI := invertibleOfDetInvertible A + let := invertibleOfDetInvertible A rw [Ring.inverse_invertible, ← invOf_eq_nonsing_inv, det_invOf] cases isEmpty_or_nonempty n · rw [det_isEmpty, det_isEmpty, Ring.inverse_one] @@ -535,14 +535,14 @@ def invertibleOfDiagonalInvertible (v : n → α) [Invertible (diagonal v)] : In invOf := diag (⅟(diagonal v)) invOf_mul_self := funext fun i => by - letI : Invertible (diagonal v).det := detInvertibleOfInvertible _ + let : Invertible (diagonal v).det := detInvertibleOfInvertible _ rw [invOf_eq, diag_smul, adjugate_diagonal, diag_diagonal] dsimp rw [mul_assoc, prod_erase_mul _ _ (Finset.mem_univ _), ← det_diagonal] exact mul_invOf_self _ mul_invOf_self := funext fun i => by - letI : Invertible (diagonal v).det := detInvertibleOfInvertible _ + let : Invertible (diagonal v).det := detInvertibleOfInvertible _ rw [invOf_eq, diag_smul, adjugate_diagonal, diag_diagonal] dsimp rw [mul_left_comm, mul_prod_erase _ _ (Finset.mem_univ _), ← det_diagonal] @@ -607,7 +607,7 @@ theorem add_mul_mul_inv_eq_sub (hA : IsUnit A) (hC : IsUnit C) (hAC : IsUnit (C obtain ⟨_⟩ := hC.nonempty_invertible obtain ⟨iAC⟩ := hAC.nonempty_invertible simp only [← invOf_eq_nonsing_inv] at iAC - letI := invertibleAddMulMul A U C V + let := invertibleAddMulMul A U C V simp only [← invOf_eq_nonsing_inv] apply invOf_add_mul_mul @@ -617,7 +617,7 @@ theorem add_mul_mul_inv_eq_sub' (hA : IsUnit A) (h : IsUnit (C + C * V * A⁻¹ obtain ⟨_⟩ := hA.nonempty_invertible obtain ⟨ih⟩ := h.nonempty_invertible simp only [← invOf_eq_nonsing_inv] at ih - letI := invertibleAddMulMul' A U C V + let := invertibleAddMulMul' A U C V simp only [← invOf_eq_nonsing_inv] apply invOf_add_mul_mul' @@ -723,7 +723,7 @@ theorem inv_submatrix_equiv (A : Matrix m m α) (e₁ e₂ : n ≃ m) : (A.submatrix e₁ e₂)⁻¹ = A⁻¹.submatrix e₂ e₁ := by by_cases h : IsUnit A · cases h.nonempty_invertible - letI := submatrixEquivInvertible A e₁ e₂ + let := submatrixEquivInvertible A e₁ e₂ rw [← invOf_eq_nonsing_inv, ← invOf_eq_nonsing_inv, invOf_submatrix_equiv_eq A] · have := (isUnit_submatrix_equiv e₁ e₂).not.mpr h simp_rw [nonsing_inv_eq_ringInverse, Ring.inverse_non_unit _ h, Ring.inverse_non_unit _ this, diff --git a/Mathlib/LinearAlgebra/Matrix/SchurComplement.lean b/Mathlib/LinearAlgebra/Matrix/SchurComplement.lean index e0b537b11e3d75..46694f098cc12e 100644 --- a/Mathlib/LinearAlgebra/Matrix/SchurComplement.lean +++ b/Mathlib/LinearAlgebra/Matrix/SchurComplement.lean @@ -96,13 +96,13 @@ def fromBlocksZero₁₂Invertible (A : Matrix m m α) (C : Matrix n m α) (D : theorem invOf_fromBlocks_zero₂₁_eq (A : Matrix m m α) (B : Matrix m n α) (D : Matrix n n α) [Invertible A] [Invertible D] [Invertible (fromBlocks A B 0 D)] : ⅟(fromBlocks A B 0 D) = fromBlocks (⅟A) (-(⅟A * B * ⅟D)) 0 (⅟D) := by - letI := fromBlocksZero₂₁Invertible A B D + let := fromBlocksZero₂₁Invertible A B D convert! (rfl : ⅟(fromBlocks A B 0 D) = _) theorem invOf_fromBlocks_zero₁₂_eq (A : Matrix m m α) (C : Matrix n m α) (D : Matrix n n α) [Invertible A] [Invertible D] [Invertible (fromBlocks A 0 C D)] : ⅟(fromBlocks A 0 C D) = fromBlocks (⅟A) 0 (-(⅟D * C * ⅟A)) (⅟D) := by - letI := fromBlocksZero₁₂Invertible A C D + let := fromBlocksZero₁₂Invertible A C D convert! (rfl : ⅟(fromBlocks A 0 C D) = _) /-- Both diagonal entries of an invertible upper-block-triangular matrix are invertible (by reading @@ -192,7 +192,7 @@ theorem inv_fromBlocks_zero₂₁_of_isUnit_iff (A : Matrix m m α) (B : Matrix · have hD := hAD.mp hA cases hA.nonempty_invertible cases hD.nonempty_invertible - letI := fromBlocksZero₂₁Invertible A B D + let := fromBlocksZero₂₁Invertible A B D simp_rw [← invOf_eq_nonsing_inv, invOf_fromBlocks_zero₂₁_eq] · have hD := hAD.not.mp hA have : ¬IsUnit (fromBlocks A B 0 D) := @@ -209,7 +209,7 @@ theorem inv_fromBlocks_zero₁₂_of_isUnit_iff (A : Matrix m m α) (C : Matrix · have hD := hAD.mp hA cases hA.nonempty_invertible cases hD.nonempty_invertible - letI := fromBlocksZero₁₂Invertible A C D + let := fromBlocksZero₁₂Invertible A C D simp_rw [← invOf_eq_nonsing_inv, invOf_fromBlocks_zero₁₂_eq] · have hD := hAD.not.mp hA have : ¬IsUnit (fromBlocks A 0 C D) := @@ -280,7 +280,7 @@ theorem invOf_fromBlocks₂₂_eq (A : Matrix m m α) (B : Matrix m n α) (C : M ⅟(fromBlocks A B C D) = fromBlocks (⅟(A - B * ⅟D * C)) (-(⅟(A - B * ⅟D * C) * B * ⅟D)) (-(⅟D * C * ⅟(A - B * ⅟D * C))) (⅟D + ⅟D * C * ⅟(A - B * ⅟D * C) * B * ⅟D) := by - letI := fromBlocks₂₂Invertible A B C D + let := fromBlocks₂₂Invertible A B C D convert! (rfl : ⅟(fromBlocks A B C D) = _) theorem invOf_fromBlocks₁₁_eq (A : Matrix m m α) (B : Matrix m n α) (C : Matrix n m α) @@ -289,7 +289,7 @@ theorem invOf_fromBlocks₁₁_eq (A : Matrix m m α) (B : Matrix m n α) (C : M ⅟(fromBlocks A B C D) = fromBlocks (⅟A + ⅟A * B * ⅟(D - C * ⅟A * B) * C * ⅟A) (-(⅟A * B * ⅟(D - C * ⅟A * B))) (-(⅟(D - C * ⅟A * B) * C * ⅟A)) (⅟(D - C * ⅟A * B)) := by - letI := fromBlocks₁₁Invertible A B C D + let := fromBlocks₁₁Invertible A B C D convert! (rfl : ⅟(fromBlocks A B C D) = _) /-- If a block matrix is invertible and so is its bottom left element, then so is the corresponding @@ -376,7 +376,7 @@ theorem det_fromBlocks₁₁ (A : Matrix m m α) (B : Matrix m n α) (C : Matrix @[simp] theorem det_fromBlocks_one₁₁ (B : Matrix m n α) (C : Matrix n m α) (D : Matrix n n α) : (Matrix.fromBlocks 1 B C D).det = det (D - C * B) := by - haveI : Invertible (1 : Matrix m m α) := invertibleOne + have : Invertible (1 : Matrix m m α) := invertibleOne rw [det_fromBlocks₁₁, invOf_one, Matrix.mul_one, det_one, one_mul] /-- Determinant of a 2×2 block matrix, expanded around an invertible bottom right element in terms @@ -393,7 +393,7 @@ theorem det_fromBlocks₂₂ (A : Matrix m m α) (B : Matrix m n α) (C : Matrix @[simp] theorem det_fromBlocks_one₂₂ (A : Matrix m m α) (B : Matrix m n α) (C : Matrix n m α) : (Matrix.fromBlocks A B C 1).det = det (A - B * C) := by - haveI : Invertible (1 : Matrix n n α) := invertibleOne + have : Invertible (1 : Matrix n n α) := invertibleOne rw [det_fromBlocks₂₂, invOf_one, Matrix.mul_one, det_one, one_mul] /-- The **Weinstein–Aronszajn identity**. Note the `1` on the LHS is of shape m×m, while the `1` on diff --git a/Mathlib/LinearAlgebra/Matrix/ToLin.lean b/Mathlib/LinearAlgebra/Matrix/ToLin.lean index bbd8ec8bd71fcd..239eaf34325b88 100644 --- a/Mathlib/LinearAlgebra/Matrix/ToLin.lean +++ b/Mathlib/LinearAlgebra/Matrix/ToLin.lean @@ -173,7 +173,7 @@ variable [Fintype m] theorem range_vecMulLinear (M : Matrix m n R) : LinearMap.range M.vecMulLinear = span R (range M.row) := by - letI := Classical.decEq m + let := Classical.decEq m simp_rw [range_eq_map, ← iSup_range_single, Submodule.map_iSup, range_eq_map, ← Ideal.span_singleton_one, Ideal.span, Submodule.map_span, image_image, image_singleton, Matrix.vecMulLinear_apply, iSup_span, range_eq_iUnion, iUnion_singleton_eq_range, @@ -772,7 +772,7 @@ lemma LinearMap.toMatrix_pow (f : M₁ →ₗ[R] M₁) (k : ℕ) : theorem Matrix.toLin_mul [Finite l] [DecidableEq m] (A : Matrix l m R) (B : Matrix m n R) : Matrix.toLin v₁ v₃ (A * B) = (Matrix.toLin v₂ v₃ A).comp (Matrix.toLin v₁ v₂ B) := by apply (LinearMap.toMatrix v₁ v₃).injective - haveI : DecidableEq l := fun _ _ ↦ Classical.propDecidable _ + have : DecidableEq l := fun _ _ ↦ Classical.propDecidable _ rw [LinearMap.toMatrix_comp v₁ v₂ v₃] repeat' rw [LinearMap.toMatrix_toLin] diff --git a/Mathlib/LinearAlgebra/Matrix/ToLinearEquiv.lean b/Mathlib/LinearAlgebra/Matrix/ToLinearEquiv.lean index 0fff49a15762ba..5aa01b1e6aa10f 100644 --- a/Mathlib/LinearAlgebra/Matrix/ToLinearEquiv.lean +++ b/Mathlib/LinearAlgebra/Matrix/ToLinearEquiv.lean @@ -136,7 +136,7 @@ private theorem exists_mulVec_eq_zero_iff' {A : Type*} (K : Type*) [DecidableEq · ext i refine (RingHom.map_mulVec _ _ _ i).symm.trans ?_ rw [mul_eq, Pi.zero_apply, map_zero, Pi.zero_apply] - · letI := Classical.decEq K + · let := Classical.decEq K obtain ⟨⟨b, hb⟩, ba_eq⟩ := IsLocalization.exist_integer_multiples_of_finset (nonZeroDivisors A) (Finset.univ.image v) choose f hf using ba_eq diff --git a/Mathlib/LinearAlgebra/Multilinear/Basic.lean b/Mathlib/LinearAlgebra/Multilinear/Basic.lean index 6c744b0fe0734a..c65bd76e461ac7 100644 --- a/Mathlib/LinearAlgebra/Multilinear/Basic.lean +++ b/Mathlib/LinearAlgebra/Multilinear/Basic.lean @@ -486,7 +486,7 @@ coordinate. Here, we give an auxiliary statement tailored for an inductive proof `map_sum_finset`. -/ theorem map_sum_finset_aux [DecidableEq ι] [Fintype ι] {n : ℕ} (h : (∑ i, #(A i)) = n) : (f fun i => ∑ j ∈ A i, g i j) = ∑ r ∈ piFinset A, f fun i => g i (r i) := by - letI := fun i => Classical.decEq (α i) + let := fun i => Classical.decEq (α i) induction n using Nat.strong_induction_on generalizing A with | h n IH => -- If one of the sets is empty, then all the sums are zero by_cases! Ai_empty : ∃ i, A i = ∅ @@ -678,11 +678,11 @@ def domDomCongr (σ : ι₁ ≃ ι₂) (m : MultilinearMap R (fun _ : ι₁ => M MultilinearMap R (fun _ : ι₂ => M₂) M₃ where toFun v := m fun i => v (σ i) map_update_add' v i a b := by - letI := σ.injective.decidableEq + let := σ.injective.decidableEq simp_rw [Function.update_apply_equiv_apply v] rw [m.map_update_add] map_update_smul' v i a b := by - letI := σ.injective.decidableEq + let := σ.injective.decidableEq simp_rw [Function.update_apply_equiv_apply v] rw [m.map_update_smul] @@ -947,24 +947,24 @@ def domDomCongrLinearEquiv' {ι' : Type*} (σ : ι ≃ ι') : toFun f := { toFun := f ∘ (σ.piCongrLeft' M₁).symm map_update_add' := fun m i => by - letI := σ.decidableEq + let := σ.decidableEq rw [← σ.apply_symm_apply i] intro x y simp only [comp_apply, piCongrLeft'_symm_update, f.map_update_add] map_update_smul' := fun m i c => by - letI := σ.decidableEq + let := σ.decidableEq rw [← σ.apply_symm_apply i] intro x simp only [Function.comp, piCongrLeft'_symm_update, f.map_update_smul] } invFun f := { toFun := f ∘ σ.piCongrLeft' M₁ map_update_add' := fun m i => by - letI := σ.symm.decidableEq + let := σ.symm.decidableEq rw [← σ.symm_apply_apply i] intro x y simp only [comp_apply, piCongrLeft'_update, f.map_update_add] map_update_smul' := fun m i c => by - letI := σ.symm.decidableEq + let := σ.symm.decidableEq rw [← σ.symm_apply_apply i] intro x simp only [Function.comp, piCongrLeft'_update, f.map_update_smul] } @@ -1424,7 +1424,7 @@ def map [Nonempty ι] (f : MultilinearMap R M₁ M₂) (p : ∀ i, Submodule R ( carrier := f '' { v | ∀ i, v i ∈ p i } smul_mem' := fun c _ ⟨x, hx, hf⟩ => by let ⟨i⟩ := ‹Nonempty ι› - letI := Classical.decEq ι + let := Classical.decEq ι refine ⟨update x i (c • x i), fun j => if hij : j = i then ?_ else ?_, hf ▸ ?_⟩ · rw [hij, update_self] exact (p i).smul_mem _ (hx i) diff --git a/Mathlib/LinearAlgebra/Multilinear/Curry.lean b/Mathlib/LinearAlgebra/Multilinear/Curry.lean index 6b7e3551c8a396..59033dde003028 100644 --- a/Mathlib/LinearAlgebra/Multilinear/Curry.lean +++ b/Mathlib/LinearAlgebra/Multilinear/Curry.lean @@ -240,12 +240,12 @@ def currySum (f : MultilinearMap R N M₂) : MultilinearMap R (fun i : ι ↦ N (.inl i)) (MultilinearMap R (fun i : ι' ↦ N (.inr i)) M₂) where toFun u := { toFun v := f (Sum.rec u v) - map_update_add' := by letI := Classical.decEq ι; simp - map_update_smul' := by letI := Classical.decEq ι; simp } + map_update_add' := by let := Classical.decEq ι; simp + map_update_smul' := by let := Classical.decEq ι; simp } map_update_add' u i x y := - ext fun _ ↦ by letI := Classical.decEq ι'; simp + ext fun _ ↦ by let := Classical.decEq ι'; simp map_update_smul' u i c x := - ext fun _ ↦ by letI := Classical.decEq ι'; simp + ext fun _ ↦ by let := Classical.decEq ι'; simp @[simp low] theorem currySum_apply (f : MultilinearMap R N M₂) @@ -276,12 +276,12 @@ def uncurrySum MultilinearMap R N M₂ where toFun u := g (fun i ↦ u (.inl i)) (fun i' ↦ u (.inr i')) map_update_add' := by - letI := Classical.decEq ι - letI := Classical.decEq ι' + let := Classical.decEq ι + let := Classical.decEq ι' rintro _ _ (_ | _) _ _ <;> simp map_update_smul' := by - letI := Classical.decEq ι - letI := Classical.decEq ι' + let := Classical.decEq ι + let := Classical.decEq ι' rintro _ _ (_ | _) _ _ <;> simp @[simp] diff --git a/Mathlib/LinearAlgebra/Multilinear/DirectSum.lean b/Mathlib/LinearAlgebra/Multilinear/DirectSum.lean index 3215af10f7219b..0074a6ba6151b3 100644 --- a/Mathlib/LinearAlgebra/Multilinear/DirectSum.lean +++ b/Mathlib/LinearAlgebra/Multilinear/DirectSum.lean @@ -57,7 +57,7 @@ theorem fromDirectSumEquiv_lof [Finite ι] [(i : ι) → DecidableEq (κ i)] (f : (p : (i : ι) → κ i) → MultilinearMap R (fun i ↦ M i (p i)) M') (p : (i : ι) → κ i) (x : (i : ι) → M i (p i)) : fromDirectSumEquiv f (fun i => lof R _ _ _ (x i)) = f p x := by - haveI : Fintype ι := Fintype.ofFinite ι + have : Fintype ι := Fintype.ofFinite ι rw [fromDirectSumEquiv, ← fromDFinsuppEquiv_single] convert! rfl @@ -78,7 +78,7 @@ theorem fromDirectSumEquiv_symm_apply [Finite ι] [(i : ι) → DecidableEq (κ (f : MultilinearMap R (fun i ↦ ⨁ j : κ i, M i j) M') (p : (i : ι) → κ i) : fromDirectSumEquiv.symm f p = f.compLinearMap (fun i ↦ DirectSum.lof _ _ _ (p i)) := by - haveI : Fintype ι := Fintype.ofFinite ι + have : Fintype ι := Fintype.ofFinite ι simp_rw [fromDirectSumEquiv, DirectSum.lof, ← fromDFinsuppEquiv_symm_apply] convert! rfl diff --git a/Mathlib/LinearAlgebra/Multilinear/FiniteDimensional.lean b/Mathlib/LinearAlgebra/Multilinear/FiniteDimensional.lean index bf870eaf711596..d91d38f741877f 100644 --- a/Mathlib/LinearAlgebra/Multilinear/FiniteDimensional.lean +++ b/Mathlib/LinearAlgebra/Multilinear/FiniteDimensional.lean @@ -35,7 +35,7 @@ private theorem free_and_finite_fin (n : ℕ) (N : Fin n → Type*) [∀ i, AddC Module.Free R (MultilinearMap R N M₂) ∧ Module.Finite R (MultilinearMap R N M₂) := by induction n with | zero => - haveI : IsEmpty (Fin Nat.zero) := inferInstanceAs (IsEmpty (Fin 0)) + have : IsEmpty (Fin Nat.zero) := inferInstanceAs (IsEmpty (Fin 0)) exact ⟨Module.Free.of_equiv (constLinearEquivOfIsEmpty R R N M₂), Module.Finite.equiv (constLinearEquivOfIsEmpty R R N M₂)⟩ diff --git a/Mathlib/LinearAlgebra/Multilinear/TensorProduct.lean b/Mathlib/LinearAlgebra/Multilinear/TensorProduct.lean index a9282df0563c9a..9d3c31d33af7b4 100644 --- a/Mathlib/LinearAlgebra/Multilinear/TensorProduct.lean +++ b/Mathlib/LinearAlgebra/Multilinear/TensorProduct.lean @@ -42,12 +42,12 @@ def domCoprodDep (a : MultilinearMap R (fun i₁ ↦ N (.inl i₁)) N₁) toFun v := a (fun i₁ ↦ v (.inl i₁)) ⊗ₜ b (fun i₂ ↦ v (.inr i₂)) map_update_add' := by rintro _ _ (_ | _) _ _ - · letI := Classical.decEq ι₁; simp - · letI := Classical.decEq ι₂; simp + · let := Classical.decEq ι₁; simp + · let := Classical.decEq ι₂; simp map_update_smul' := by rintro _ m (i₁ | i₂) p q - · letI := Classical.decEq ι₁; simp - · letI := Classical.decEq ι₂; simp + · let := Classical.decEq ι₁; simp + · let := Classical.decEq ι₂; simp /-- A more bundled version of `MultilinearMap.domCoprodDep`, as a linear map from the tensor product of spaces of multilinear maps. -/ diff --git a/Mathlib/LinearAlgebra/Orientation.lean b/Mathlib/LinearAlgebra/Orientation.lean index 197742e8649f8b..f6633180871c65 100644 --- a/Mathlib/LinearAlgebra/Orientation.lean +++ b/Mathlib/LinearAlgebra/Orientation.lean @@ -149,7 +149,7 @@ of `f.det`. -/ theorem map_orientation_eq_det_inv_smul [Finite ι] (e : Basis ι R M) (x : Orientation R M ι) (f : M ≃ₗ[R] M) : Orientation.map ι f x = (LinearEquiv.det f)⁻¹ • x := by cases nonempty_fintype ι - letI := Classical.decEq ι + let := Classical.decEq ι induction x using Module.Ray.ind with | h g hg => rw [Orientation.map_apply, smul_rayOfNeZero, ray_eq_iff, Units.smul_def, (g.compLinearMap f.symm).eq_smul_basis_det e, g.eq_smul_basis_det e, @@ -338,7 +338,7 @@ equal or negations. -/ theorem eq_or_eq_neg [FiniteDimensional R M] (x₁ x₂ : Orientation R M ι) (h : Fintype.card ι = finrank R M) : x₁ = x₂ ∨ x₁ = -x₂ := by have e := (finBasis R M).reindex (Fintype.equivFinOfCardEq h).symm - letI := Classical.decEq ι + let := Classical.decEq ι rcases e.orientation_eq_or_eq_neg x₁ with (h₁ | h₁) <;> rcases e.orientation_eq_or_eq_neg x₂ with (h₂ | h₂) <;> simp [h₁, h₂] @@ -379,7 +379,7 @@ theorem map_eq_neg_iff_det_neg (x : Orientation R M ι) (f : M ≃ₗ[R] M) have H : 0 < finrank R M := by rw [← h] exact Fintype.card_pos - haveI : FiniteDimensional R M := of_finrank_pos H + have : FiniteDimensional R M := of_finrank_pos H rw [map_eq_det_inv_smul _ _ h, units_inv_smul, units_smul_eq_neg_iff, LinearEquiv.coe_det] /-- If the index type has cardinality equal to the finite dimension, a basis with the given diff --git a/Mathlib/LinearAlgebra/PiTensorProduct/Basis.lean b/Mathlib/LinearAlgebra/PiTensorProduct/Basis.lean index 07b38727efe4e6..e9b880da072aa9 100644 --- a/Mathlib/LinearAlgebra/PiTensorProduct/Basis.lean +++ b/Mathlib/LinearAlgebra/PiTensorProduct/Basis.lean @@ -48,7 +48,7 @@ theorem Basis.piTensorProduct_repr_tprod_apply [Fintype ι] (b : Π i, Basis (κ @[simp] theorem Basis.piTensorProduct_apply [Finite ι] (b : Π i, Basis (κ i) R (M i)) (p : Π i, κ i) : Basis.piTensorProduct b p = ⨂ₜ[R] i, (b i) (p i) := by - haveI := Fintype.ofFinite ι + have := Fintype.ofFinite ι classical refine (Basis.piTensorProduct b).ext_elem (fun q ↦ ?_) simp [Finsupp.single_apply, Fintype.prod_ite_zero, ← funext_iff] diff --git a/Mathlib/LinearAlgebra/PiTensorProduct/Dual.lean b/Mathlib/LinearAlgebra/PiTensorProduct/Dual.lean index e8a27bfb9e26cd..eb6fc3f8c96cf2 100644 --- a/Mathlib/LinearAlgebra/PiTensorProduct/Dual.lean +++ b/Mathlib/LinearAlgebra/PiTensorProduct/Dual.lean @@ -80,8 +80,8 @@ theorem dualDistribInvOfBasis_apply [Fintype ι] [∀ i, Fintype (κ i)] (b : Π theorem dualDistrib_dualDistribInvOfBasis_left_inverse [Finite ι] [∀ i, Finite (κ i)] (b : Π i, Basis (κ i) R (M i)) : (dualDistrib) ∘ₗ (dualDistribInvOfBasis b) = LinearMap.id := by - haveI := Fintype.ofFinite ι - haveI := fun i => Fintype.ofFinite (κ i) + have := Fintype.ofFinite ι + have := fun i => Fintype.ofFinite (κ i) classical refine (Basis.piTensorProduct b).dualBasis.ext (fun p ↦ ?_) refine (Basis.piTensorProduct b).ext (fun q ↦ ?_) @@ -90,8 +90,8 @@ theorem dualDistrib_dualDistribInvOfBasis_left_inverse [Finite ι] [∀ i, Finit theorem dualDistrib_dualDistribInvOfBasis_right_inverse [Finite ι] [∀ i, Finite (κ i)] (b : Π i, Basis (κ i) R (M i)) : (dualDistribInvOfBasis b) ∘ₗ dualDistrib = LinearMap.id := by - haveI := Fintype.ofFinite ι - haveI := fun i => Fintype.ofFinite (κ i) + have := Fintype.ofFinite ι + have := fun i => Fintype.ofFinite (κ i) classical refine (Basis.piTensorProduct (fun i => (b i).dualBasis)).ext (fun p ↦ ?_) refine (Basis.piTensorProduct (fun i => (b i).dualBasis)).ext_elem (fun q ↦ ?_) diff --git a/Mathlib/LinearAlgebra/Projectivization/Cardinality.lean b/Mathlib/LinearAlgebra/Projectivization/Cardinality.lean index 0c4023612a4ee1..66e92dd580e37e 100644 --- a/Mathlib/LinearAlgebra/Projectivization/Cardinality.lean +++ b/Mathlib/LinearAlgebra/Projectivization/Cardinality.lean @@ -77,9 +77,9 @@ lemma card : Nat.card V - 1 = Nat.card (ℙ k V) * (Nat.card k - 1) := by simp | inl h => classical - haveI : Fintype V := Fintype.ofFinite V - haveI : Fintype (ℙ k V) := Fintype.ofFinite (ℙ k V) - haveI : Fintype k := Fintype.ofFinite k + have : Fintype V := Fintype.ofFinite V + have : Fintype (ℙ k V) := Fintype.ofFinite (ℙ k V) + have : Fintype k := Fintype.ofFinite k have hV : Fintype.card { v : V // v ≠ 0 } = Fintype.card V - 1 := by simp simp_rw [← Fintype.card_eq_nat_card, ← Fintype.card_units (α := k), ← hV] rw [Fintype.card_congr (nonZeroEquivProjectivizationProdUnits k V), Fintype.card_prod] diff --git a/Mathlib/LinearAlgebra/Projectivization/PSL/PSL2.lean b/Mathlib/LinearAlgebra/Projectivization/PSL/PSL2.lean index 32a6e3158224af..eb34a5fc7acebb 100644 --- a/Mathlib/LinearAlgebra/Projectivization/PSL/PSL2.lean +++ b/Mathlib/LinearAlgebra/Projectivization/PSL/PSL2.lean @@ -101,7 +101,7 @@ open Matrix.SpecialLinearGroup lemma PSL_commutator_eq_top (hF : ∃ a : F, a ≠ 0 ∧ a ^ 2 ≠ 1) : commutator PSL(2, F) = ⊤ := by obtain ⟨a, ha, hasq⟩ := hF - haveI : Group.IsPerfect SL(2, F) := ⟨SL2.commutator_eq_top ha hasq⟩ + have : Group.IsPerfect SL(2, F) := ⟨SL2.commutator_eq_top ha hasq⟩ have : Group.IsPerfect (Matrix.ProjectiveSpecialLinearGroup (Fin 2) F) := inferInstance exact this.commutator_eq_top diff --git a/Mathlib/LinearAlgebra/QuadraticForm/Basic.lean b/Mathlib/LinearAlgebra/QuadraticForm/Basic.lean index 1bd2bf12f0d792..fa61690db36e59 100644 --- a/Mathlib/LinearAlgebra/QuadraticForm/Basic.lean +++ b/Mathlib/LinearAlgebra/QuadraticForm/Basic.lean @@ -1065,7 +1065,7 @@ alias ⟨IsOrtho.symm, _⟩ := isOrtho_comm theorem _root_.LinearMap.BilinForm.toQuadraticMap_isOrtho [IsCancelAdd R] [NoZeroDivisors R] [CharZero R] {B : BilinMap R M R} {x y : M} (h : B.IsSymm) : B.toQuadraticMap.IsOrtho x y ↔ B x y = 0 := by - letI : AddCancelMonoid R := { ‹IsCancelAdd R›, (inferInstance : AddCommMonoid R) with } + let : AddCancelMonoid R := { ‹IsCancelAdd R›, (inferInstance : AddCommMonoid R) with } simp_rw [isOrtho_def, B.toQuadraticMap_apply, map_add, LinearMap.add_apply, add_comm _ (B y y), add_add_add_comm _ _ (B y y), add_comm (B y y)] rw [add_eq_left (a := B x x + B y y), ← h.eq, RingHom.id_apply, add_self_eq_zero] diff --git a/Mathlib/LinearAlgebra/QuadraticForm/Basis.lean b/Mathlib/LinearAlgebra/QuadraticForm/Basis.lean index 3344cb5b23f2f6..6bd56e82995fa4 100644 --- a/Mathlib/LinearAlgebra/QuadraticForm/Basis.lean +++ b/Mathlib/LinearAlgebra/QuadraticForm/Basis.lean @@ -116,7 +116,7 @@ theorem _root_.LinearMap.BilinMap.toQuadraticMap_surjective [Module.Free R M] : Function.Surjective (LinearMap.BilinMap.toQuadraticMap : LinearMap.BilinMap R M N → _) := by intro Q obtain ⟨ι, b⟩ := Module.Free.exists_basis (R := R) (M := M) - letI : LinearOrder ι := IsWellOrder.linearOrder WellOrderingRel + let : LinearOrder ι := IsWellOrder.linearOrder WellOrderingRel exact ⟨_, toQuadraticMap_toBilin _ b⟩ @[simp] diff --git a/Mathlib/LinearAlgebra/QuadraticForm/TensorProduct.lean b/Mathlib/LinearAlgebra/QuadraticForm/TensorProduct.lean index f2e5f4e238dccb..9f201320904a8a 100644 --- a/Mathlib/LinearAlgebra/QuadraticForm/TensorProduct.lean +++ b/Mathlib/LinearAlgebra/QuadraticForm/TensorProduct.lean @@ -72,7 +72,7 @@ protected abbrev tmul (Q₁ : QuadraticMap A M₁ N₁) theorem associated_tmul [Invertible (2 : A)] (Q₁ : QuadraticMap A M₁ N₁) (Q₂ : QuadraticMap R M₂ N₂) : (Q₁.tmul Q₂).associated = Q₁.associated.tmul Q₂.associated := by - letI : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm + let : Invertible (2 : A) := (Invertible.map (algebraMap R A) 2).copy 2 (map_ofNat _ _).symm rw [QuadraticMap.tmul, BilinMap.tmul] have : Subsingleton (Invertible (2 : A)) := inferInstance convert! diff --git a/Mathlib/LinearAlgebra/RootSystem/Base.lean b/Mathlib/LinearAlgebra/RootSystem/Base.lean index 022a13c4005114..0bc7398af7dc34 100644 --- a/Mathlib/LinearAlgebra/RootSystem/Base.lean +++ b/Mathlib/LinearAlgebra/RootSystem/Base.lean @@ -434,7 +434,7 @@ lemma height_ne_zero (i : ι) : lemma height_reflectionPerm_self (i : ι) : letI := P.indexNeg b.height (-i) = -b.height i := by - letI := P.indexNeg + let := P.indexNeg obtain ⟨f, hf₀, hf₁, hf₂⟩ := b.exists_root_eq_sum_int i have hf₃ : P.root (-i) = ∑ j ∈ b.support, (-f) j • P.root j := by simpa simp only [height_eq_sum hf₂, height_eq_sum hf₃, Pi.neg_apply, Finset.sum_neg_distrib] @@ -458,7 +458,7 @@ lemma height_add {i j k : ι} (hk : P.root k = P.root i + P.root j) : lemma height_sub {i j k : ι} (hk : P.root k = P.root i - P.root j) : b.height k = b.height i - b.height j := by - letI := P.indexNeg + let := P.indexNeg replace hk : P.root k = P.root i + P.root (-j) := by simpa [← sub_eq_add_neg] rw [sub_eq_add_neg, ← b.height_reflectionPerm_self, b.height_add hk] @@ -553,7 +553,7 @@ lemma IsPos.add_zsmul {i j k : ι} {z : ℤ} (hij : i ≠ j) b.IsPos k := by replace hij : LinearIndependent R ![P.root j, P.root i] := by refine IsReduced.linearIndependent P hij.symm fun contra ↦ ?_ - letI := P.indexNeg + let := P.indexNeg replace contra : i = -j := by rw [eq_comm, neg_eq_iff_eq_neg]; simpa using contra rw [contra, isPos_iff, height_reflectionPerm_self, height_one_of_mem_support hj] at hi lia @@ -630,7 +630,7 @@ lemma induction_add (i : ι) {p : ι → Prop} (h₁ : ∀ i ∈ b.support, p i) (h₂ : ∀ i j k, P.root k = P.root i + P.root j → p i → j ∈ b.support → p k) : p i := by - letI := P.indexNeg + let := P.indexNeg rcases IsPos.or_neg b i with hi | hi · exact hi.induction_on_add h₁ h₂ · suffices p (-i) by rw [← neg_neg i]; exact h₀ (-i) this @@ -667,7 +667,7 @@ lemma induction_reflect (i : ι) {p : ι → Prop} (h₁ : ∀ i ∈ b.support, p i) (h₂ : ∀ i j, p i → j ∈ b.support → p (P.reflectionPerm j i)) : p i := by - letI := P.indexNeg + let := P.indexNeg rcases IsPos.or_neg b i with hi | hi · exact hi.induction_on_reflect h₁ h₂ · suffices p (-i) by rw [← neg_neg i]; exact h₀ (-i) this @@ -677,7 +677,7 @@ lemma forall_mem_support_invtSubmodule_iff (q : Submodule R M) : (∀ i ∈ b.support, q ∈ invtSubmodule (P.reflection i)) ↔ (∀ i, q ∈ invtSubmodule (P.reflection i)) := by refine ⟨fun hq i ↦ ?_, fun hq i _ ↦ hq i⟩ - letI := P.indexNeg + let := P.indexNeg have (j : ι) : P.reflection (-j) = P.reflection j := by ext x; simp [reflection_apply, two_smul] refine b.induction_reflect i (by simp_all) hq ?_ clear i diff --git a/Mathlib/LinearAlgebra/RootSystem/BaseExists.lean b/Mathlib/LinearAlgebra/RootSystem/BaseExists.lean index 45bc346053560a..c34209445d9585 100644 --- a/Mathlib/LinearAlgebra/RootSystem/BaseExists.lean +++ b/Mathlib/LinearAlgebra/RootSystem/BaseExists.lean @@ -53,7 +53,7 @@ variable [CommRing R] [Module R M] [Module R N] (P : RootPairing ι R M N) lemma baseOf_pairwise_pairing_le_zero [CharZero R] [IsDomain R] [P.IsCrystallographic] (hf : ∀ i, f (P.root i) ≠ 0) : (baseOf P.root f).Pairwise fun i j ↦ P.pairingIn ℤ i j ≤ 0 := by - letI _i := P.indexNeg + let _i := P.indexNeg intro i hi j hj hne have := IsAddIndecomposable.pairwise_baseOf_sub_notMem P.root (by simp) f hf hi hj hne contrapose! this @@ -117,7 +117,7 @@ lemma linearIndepOn_root_baseOf (f : M →+ ℚ) (hf : ∀ i, f (P.root i) ≠ 0 LinearIndepOn R P.root (baseOf P.root f) := by let _i : Module ℚ M := Module.compHom M (algebraMap ℚ R) let _i : Module ℚ N := Module.compHom N (algebraMap ℚ R) - letI := P.indexNeg + let := P.indexNeg have : Fintype (baseOf P.root f) := Fintype.ofFinite _ let v (i : baseOf P.root f) : P.rootSpan ℚ := P.rootSpanMem ℚ i change LinearIndependent R ((P.rootSpan ℚ).subtype ∘ v) @@ -155,7 +155,7 @@ lemma eq_baseOf_of_linearIndepOn_of_mem_or_neg_mem_closure -P.root i ∈ AddSubmonoid.closure (P.root '' s)) (f : M →+ ℚ) (hf : ∀ i ∈ s, f (P.root i) = 1) : s = baseOf P.root f := by - letI _i := P.indexNeg + let _i := P.indexNeg have h_card : (baseOf P.root f).ncard = s.ncard := by have hf' (i : ι) : f (P.root i) ≠ 0 := AddSubmonoid.apply_ne_zero_of_mem_or_neg_mem_closure P.root f s (by aesop) i (P.ne_zero i) (by simp) (hsp i) @@ -187,7 +187,7 @@ lemma eq_baseOf_iff (s : Set ι) (f : M →+ ℚ) LinearIndepOn R P.root s ∧ ∀ i, P.root i ∈ AddSubmonoid.closure (P.root '' s) ∨ -P.root i ∈ AddSubmonoid.closure (P.root '' s) := by - letI := P.indexNeg + let := P.indexNeg refine ⟨?_, fun ⟨hli, sp⟩ ↦ P.eq_baseOf_of_linearIndepOn_of_mem_or_neg_mem_closure s hli sp f hf⟩ rintro rfl exact ⟨P.linearIndepOn_root_baseOf f hf', fun i ↦ @@ -281,8 +281,8 @@ lemma coroot_mem_or_neg_mem_closure_of_root (s : Set ι) (i : ι) : P.coroot i ∈ AddSubmonoid.closure (P.coroot '' s) ∨ -P.coroot i ∈ AddSubmonoid.closure (P.coroot '' s) := by - letI _i := P.indexNeg - letI _i : Fintype ι := Fintype.ofFinite ι + let _i := P.indexNeg + let _i : Fintype ι := Fintype.ofFinite ι let _i : Module ℚ M := Module.compHom M (algebraMap ℚ R) let _i : Module ℚ N := Module.compHom N (algebraMap ℚ R) obtain ⟨f, hf'⟩ := exists_dual_forall_apply_eq_one (hli.restrict_scalars' ℚ) @@ -323,7 +323,7 @@ lemma nonempty_base : Nonempty P.Base := by let _i : Module ℚ N := Module.compHom N (algebraMap ℚ R) obtain ⟨f, hf⟩ : ∃ f : Dual ℚ M, ∀ i, f (P.root i) ≠ 0 := exists_dual_forall_apply_ne_zero P.root <| by simp [P.ne_zero] - letI := P.indexNeg + let := P.indexNeg exact ⟨Base.mk' P (baseOf P.root (f : M →+ ℚ)) (P.linearIndepOn_root_baseOf f hf) (fun i ↦ mem_or_neg_mem_closure_baseOf P.root (f : M →+ ℚ) i (hf i) (by simp))⟩ diff --git a/Mathlib/LinearAlgebra/RootSystem/Chain.lean b/Mathlib/LinearAlgebra/RootSystem/Chain.lean index 32e447d5562087..6cf43c476911c9 100644 --- a/Mathlib/LinearAlgebra/RootSystem/Chain.lean +++ b/Mathlib/LinearAlgebra/RootSystem/Chain.lean @@ -226,7 +226,7 @@ private lemma chainCoeff_reflectionPerm_left_aux : letI := P.indexNeg Icc (-P.chainTopCoeff i j : ℤ) (P.chainBotCoeff i j) = Icc (-P.chainBotCoeff (-i) j : ℤ) (P.chainTopCoeff (-i) j) := by - letI := P.indexNeg + let := P.indexNeg by_cases h : LinearIndependent R ![P.root i, P.root j] · have h' : LinearIndependent R ![P.root (-i), P.root j] := by simpa ext z @@ -241,7 +241,7 @@ private lemma chainCoeff_reflectionPerm_right_aux : letI := P.indexNeg Icc (-P.chainTopCoeff i j : ℤ) (P.chainBotCoeff i j) = Icc (-P.chainBotCoeff i (-j) : ℤ) (P.chainTopCoeff i (-j)) := by - letI := P.indexNeg + let := P.indexNeg by_cases h : LinearIndependent R ![P.root i, P.root j] · have h' : LinearIndependent R ![P.root i, P.root (-j)] := by simpa ext z @@ -255,7 +255,7 @@ private lemma chainCoeff_reflectionPerm_right_aux : @[simp] lemma chainTopCoeff_reflectionPerm_left : P.chainTopCoeff (P.reflectionPerm i i) j = P.chainBotCoeff i j := by - letI := P.indexNeg + let := P.indexNeg have (z : ℤ) : z ∈ Icc (-P.chainTopCoeff i j : ℤ) (P.chainBotCoeff i j) ↔ z ∈ Icc (-P.chainBotCoeff (-i) j : ℤ) (P.chainTopCoeff (-i) j) := by rw [P.chainCoeff_reflectionPerm_left_aux] @@ -266,7 +266,7 @@ lemma chainTopCoeff_reflectionPerm_left : @[simp] lemma chainBotCoeff_reflectionPerm_left : P.chainBotCoeff (P.reflectionPerm i i) j = P.chainTopCoeff i j := by - letI := P.indexNeg + let := P.indexNeg have (z : ℤ) : z ∈ Icc (-P.chainTopCoeff i j : ℤ) (P.chainBotCoeff i j) ↔ z ∈ Icc (-P.chainBotCoeff (-i) j : ℤ) (P.chainTopCoeff (-i) j) := by rw [P.chainCoeff_reflectionPerm_left_aux] @@ -277,7 +277,7 @@ lemma chainBotCoeff_reflectionPerm_left : @[simp] lemma chainTopCoeff_reflectionPerm_right : P.chainTopCoeff i (P.reflectionPerm j j) = P.chainBotCoeff i j := by - letI := P.indexNeg + let := P.indexNeg have (z : ℤ) : z ∈ Icc (-P.chainTopCoeff i j : ℤ) (P.chainBotCoeff i j) ↔ z ∈ Icc (-P.chainBotCoeff i (-j) : ℤ) (P.chainTopCoeff i (-j)) := by rw [P.chainCoeff_reflectionPerm_right_aux] @@ -288,7 +288,7 @@ lemma chainTopCoeff_reflectionPerm_right : @[simp] lemma chainBotCoeff_reflectionPerm_right : P.chainBotCoeff i (P.reflectionPerm j j) = P.chainTopCoeff i j := by - letI := P.indexNeg + let := P.indexNeg have (z : ℤ) : z ∈ Icc (-P.chainTopCoeff i j : ℤ) (P.chainBotCoeff i j) ↔ z ∈ Icc (-P.chainBotCoeff i (-j) : ℤ) (P.chainTopCoeff i (-j)) := by rw [P.chainCoeff_reflectionPerm_right_aux] @@ -335,7 +335,7 @@ lemma chainBotCoeff_of_add {k : ι} (hk : P.root k = P.root j + P.root i) : lemma chainTopCoeff_of_sub {k : ι} (hk : P.root k = P.root j - P.root i) : P.chainTopCoeff i k = P.chainTopCoeff i j + 1 := by - letI := P.indexNeg + let := P.indexNeg replace hk : P.root k = P.root j + P.root (-i) := by simpa [sub_eq_add_neg] using hk simpa using chainBotCoeff_of_add (by simpa) hk diff --git a/Mathlib/LinearAlgebra/RootSystem/Finite/G2.lean b/Mathlib/LinearAlgebra/RootSystem/Finite/G2.lean index e557a7f8d6b6e1..5ae51fa834e485 100644 --- a/Mathlib/LinearAlgebra/RootSystem/Finite/G2.lean +++ b/Mathlib/LinearAlgebra/RootSystem/Finite/G2.lean @@ -191,7 +191,7 @@ lemma chainBotCoeff_if_one_zero [P.IsNotG2] (h : P.root i + P.root j ∈ range P lemma chainTopCoeff_if_one_zero [P.IsNotG2] (h : P.root i - P.root j ∈ range P.root) : P.chainTopCoeff i j = if P.pairingIn ℤ i j = 0 then 1 else 0 := by - letI := P.indexNeg + let := P.indexNeg replace h : P.root i + P.root (-j) ∈ range P.root := by simpa [← sub_eq_add_neg] using h simpa using P.chainBotCoeff_if_one_zero h diff --git a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Basic.lean b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Basic.lean index a91cfa25f73804..f78200eabdb85e 100644 --- a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Basic.lean +++ b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Basic.lean @@ -260,7 +260,7 @@ lemma ω_mul_h [Fintype ι] (i : b.support) : lemma ω_mul_e [Fintype ι] (i : b.support) : ω b * e i = f i * ω b := by - letI := P.indexNeg + let := P.indexNeg classical ext (k | k) (l | l) · simp [ω, e, f] @@ -351,7 +351,7 @@ lemma e_lie_u (i j : b.support) : lemma e_lie_v_ne {i j : ι} {k : b.support} (h : P.root j = P.root k + P.root i) : ⁅e k, v b i⁆ = (P.chainBotCoeff k i + 1 : R) • v b j := by - letI := P.indexNeg + let := P.indexNeg ext (l | l) · replace h : i ≠ -k := by rintro rfl; exact P.ne_zero j <| by simpa using h simp [e, h, -indexNeg_neg] diff --git a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Lemmas.lean b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Lemmas.lean index f5504e6ef84b64..d28b0e379d952a 100644 --- a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Lemmas.lean +++ b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Lemmas.lean @@ -212,7 +212,7 @@ private lemma chainBotCoeff_mul_chainTopCoeff.aux_1 intro _ him_mem hjl_mem hjk_mem /- Setup some typeclasses and name the 6th root `n`. -/ have := chainBotCoeff_mul_chainTopCoeff.isNotG2 hi hj hij h₁ h₂ h₃ - letI := P.indexNeg + let := P.indexNeg have : IsAddTorsionFree M := .of_isTorsionFree R M obtain ⟨n, hn⟩ := h₃ /- Establish basic relationships about roots and their sums / differences. -/ @@ -272,7 +272,7 @@ private lemma chainBotCoeff_mul_chainTopCoeff.aux_2 P.root j + P.root (-k) ∈ range P.root → ¬ (P.chainBotCoeff i m = 1 ∧ P.chainBotCoeff j (-l) = 0) := by intro _ him_mem hjl_mem hjk_mem - letI := P.indexNeg + let := P.indexNeg /- Setup some typeclasses. -/ have := chainBotCoeff_mul_chainTopCoeff.isNotG2 hi hj hij h₁ h₂ h₃ have : IsAddTorsionFree M := .of_isTorsionFree R M @@ -338,7 +338,7 @@ lemma chainBotCoeff_mul_chainTopCoeff : (P.chainTopCoeff j l + 1) * (P.chainBotCoeff i k + 1) := by /- Setup some typeclasses. -/ have := chainBotCoeff_mul_chainTopCoeff.isNotG2 hi hj hij h₁ h₂ h₃ - letI := P.indexNeg + let := P.indexNeg suffices (P.chainBotCoeff i m + 1) * (P.chainBotCoeff j (-k) + 1) = (P.chainBotCoeff j (-l) + 1) * (P.chainBotCoeff i k + 1) by simpa /- Establish basic relationships about roots and their sums / differences. -/ diff --git a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Relations.lean b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Relations.lean index d593b9de77e832..adc05655bb9d2e 100644 --- a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Relations.lean +++ b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Relations.lean @@ -139,7 +139,7 @@ private lemma lie_e_f_same_aux (k : ι) (hki : k ≠ i) (hki' : k ≠ P.reflecti /-- Lemma 3.4 from [Geck](Geck2017). -/ lemma lie_e_f_same : ⁅e i, f i⁆ = h i := by - letI := P.indexNeg + let := P.indexNeg have : Module.IsReflexive R M := .of_isPerfPair P.toLinearMap have : IsAddTorsionFree M := .of_isTorsionFree R M classical @@ -205,7 +205,7 @@ omit [P.IsReduced] private lemma lie_e_f_ne_aux₀ (k : b.support) (l : ι) : ⁅e i, f j⁆ (Sum.inl k) (Sum.inr l) = 0 := by classical - letI := P.indexNeg + let := P.indexNeg have aux₁ : ∀ x ∈ Finset.univ, ¬ (P.root x = P.root i + P.root l ∧ k = j ∧ x = j) := by rintro x - ⟨hl, -, rfl⟩ exact b.sub_notMem_range_root i.property j.property ⟨-l, by simp [hl]⟩ @@ -221,7 +221,7 @@ include hij private lemma lie_e_f_ne_aux₁ : ⁅e i, f j⁆ᵀ (Sum.inr j) = 0 := by have hij' : (i : ι) ≠ (j : ι) := hij ∘ SetLike.coe_eq_coe.mp - letI := P.indexNeg + let := P.indexNeg classical ext (k | k) · rw [Matrix.transpose_apply, lie_e_f_ne_aux₀, Pi.zero_apply] @@ -252,7 +252,7 @@ private lemma lie_e_f_ne_aux₁ : private lemma lie_e_f_ne_aux₂ : letI := P.indexNeg ⁅e i, f j⁆ᵀ (Sum.inr (-i)) = 0 := by - letI := P.indexNeg + let := P.indexNeg classical ext (k | k) · rw [Matrix.transpose_apply, lie_e_f_ne_aux₀, Pi.zero_apply] @@ -265,7 +265,7 @@ private lemma lie_e_f_ne_aux₂ : lemma lie_e_f_ne [P.IsReduced] [P.IsIrreducible] : ⁅e i, f j⁆ = 0 := by have hij' : (i : ι) ≠ (j : ι) := hij ∘ SetLike.coe_eq_coe.mp - letI := P.indexNeg + let := P.indexNeg classical ext (k | k) (l | l) · rw [ne_comm] at hij diff --git a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Semisimple.lean b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Semisimple.lean index 80afc55a86c57b..c076a6eb4574ff 100644 --- a/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Semisimple.lean +++ b/Mathlib/LinearAlgebra/RootSystem/GeckConstruction/Semisimple.lean @@ -54,7 +54,7 @@ private lemma isNilpotent_e_aux {j : ι} (n : ℕ) (h : letI _i := P.indexNeg; j (e i ^ n).col (.inr j) = x • Pi.single (.inr k) 1 := by have : Module.IsReflexive R M := .of_isPerfPair P.toLinearMap have : IsAddTorsionFree M := .of_isTorsionFree R M - letI := P.indexNeg + let := P.indexNeg have aux (n : ℕ) : (e i ^ (n + 1)).col (.inr j) = (e i).mulVec ((e i ^ n).col (.inr j)) := by rw [pow_succ', ← Matrix.mulVec_single_one, ← Matrix.mulVec_mulVec]; simp induction n with @@ -100,7 +100,7 @@ lemma isNilpotent_e : classical have : Module.IsReflexive R M := .of_isPerfPair P.toLinearMap have : IsAddTorsionFree M := .of_isTorsionFree R M - letI := P.indexNeg + let := P.indexNeg rw [Matrix.isNilpotent_iff_forall_col] have case_inl (j : b.support) : (e i ^ 2).col (Sum.inl j) = 0 := by ext (k | k) @@ -151,7 +151,7 @@ omit [P.IsReduced] [IsDomain R] [DecidableEq ι] in @[simp] lemma trace_h_eq_zero : (h i).trace = 0 := by classical - letI _i := P.indexNeg + let _i := P.indexNeg suffices ∑ j, P.pairingIn ℤ j i = 0 by simp only [h_eq_diagonal, Matrix.trace_diagonal, Fintype.sum_sum_type, Finset.univ_eq_attach, Sum.elim_inl, Pi.zero_apply, Finset.sum_const_zero, Sum.elim_inr, zero_add] @@ -270,7 +270,7 @@ omit [P.IsRootSystem] in private lemma instIsIrreducible_aux₂ [P.IsReduced] [P.IsIrreducible] {U : LieSubmodule K (lieAlgebra b) (b.support ⊕ ι → K)} {i : ι} (hi : v b i ∈ U) : U = ⊤ := by - letI _i := P.indexNeg + let _i := P.indexNeg have hωu (i : b.support) : ω b *ᵥ (u i) = u i := by ext (j | j) <;> simp [ω, u, Pi.single_apply, one_apply] have hωv (i : ι) : ω b *ᵥ (v b i) = v b (-i) := by ext (j | j) <;> simp [ω, v, Pi.single_apply] diff --git a/Mathlib/LinearAlgebra/RootSystem/Hom.lean b/Mathlib/LinearAlgebra/RootSystem/Hom.lean index 8bf34ac72f09d8..8b3cac1a050cf5 100644 --- a/Mathlib/LinearAlgebra/RootSystem/Hom.lean +++ b/Mathlib/LinearAlgebra/RootSystem/Hom.lean @@ -226,7 +226,7 @@ lemma coweightHom_injective (P : RootPairing ι R M N) : Injective (coweightHom have h := congrArg (LinearMap.comp (M₃ := Module.Dual R M) (σ₂₃ := .id R) P.flip.toPerfPair) hfg rw [← f.weight_coweight_transpose, ← g.weight_coweight_transpose] at h have : f.weightMap = g.weightMap := by - haveI : Module.IsReflexive R M := .of_isPerfPair P.toLinearMap + have : Module.IsReflexive R M := .of_isPerfPair P.toLinearMap refine (Module.dualMap_dualMap_eq_iff R M).mp (congrArg LinearMap.dualMap ((LinearEquiv.eq_comp_toLinearMap_iff f.weightMap.dualMap g.weightMap.dualMap).mp h)) exact congrFun (congrArg DFunLike.coe this) x diff --git a/Mathlib/LinearAlgebra/Semisimple.lean b/Mathlib/LinearAlgebra/Semisimple.lean index 120bc5cbeda127..1abf2e6298e153 100644 --- a/Mathlib/LinearAlgebra/Semisimple.lean +++ b/Mathlib/LinearAlgebra/Semisimple.lean @@ -228,7 +228,7 @@ theorem isSemisimple_of_squarefree_aeval_eq_zero {p : K[X]} have : FiniteDimensional K R := (AdjoinRoot.powerBasis hp.ne_zero).finite have : IsArtinianRing R := .of_finite K R have : IsSemisimpleRing R := IsArtinianRing.isSemisimpleRing_of_isReduced R - letI : Module R (AEval' f) := Module.IsTorsionBySet.module hpf + let : Module R (AEval' f) := Module.IsTorsionBySet.module hpf let e : AEval' f →ₛₗ[Ideal.Quotient.mk (Ideal.span {p})] AEval' f := { AddMonoidHom.id _ with map_smul' := fun _ _ ↦ rfl } exact (e.isSemisimpleModule_iff_of_bijective bijective_id).mpr inferInstance diff --git a/Mathlib/LinearAlgebra/TensorAlgebra/Basic.lean b/Mathlib/LinearAlgebra/TensorAlgebra/Basic.lean index 704c34f0748b31..0c7432ee0cca7a 100644 --- a/Mathlib/LinearAlgebra/TensorAlgebra/Basic.lean +++ b/Mathlib/LinearAlgebra/TensorAlgebra/Basic.lean @@ -286,8 +286,8 @@ variable {R} @[simp] theorem ι_eq_algebraMap_iff (x : M) (r : R) : ι R x = algebraMap R _ r ↔ x = 0 ∧ r = 0 := by refine ⟨fun h => ?_, ?_⟩ - · letI : Module Rᵐᵒᵖ M := Module.compHom _ ((RingHom.id R).fromOpposite mul_comm) - haveI : IsCentralScalar R M := ⟨fun r m => rfl⟩ + · let : Module Rᵐᵒᵖ M := Module.compHom _ ((RingHom.id R).fromOpposite mul_comm) + have : IsCentralScalar R M := ⟨fun r m => rfl⟩ have hf0 : toTrivSqZeroExt (ι R x) = (0, x) := lift_ι_apply _ _ rw [h, AlgHom.commutes] at hf0 have : r = 0 ∧ 0 = x := Prod.ext_iff.1 hf0 diff --git a/Mathlib/LinearAlgebra/Trace.lean b/Mathlib/LinearAlgebra/Trace.lean index 74e07668dda7cc..e963d728cee9ab 100644 --- a/Mathlib/LinearAlgebra/Trace.lean +++ b/Mathlib/LinearAlgebra/Trace.lean @@ -302,10 +302,10 @@ theorem trace_conj' (f : M →ₗ[R] M) (e : M ≃ₗ[R] N) : trace R N (e.conj classical by_cases hM : ∃ s : Finset M, Nonempty (Basis s R M) · obtain ⟨s, ⟨b⟩⟩ := hM - haveI := Module.Finite.of_basis b - haveI := (Module.free_def R M).mpr ⟨_, ⟨b⟩⟩ - haveI := Module.Finite.of_basis (b.map e) - haveI := (Module.free_def R N).mpr ⟨_, ⟨(b.map e).reindex (e.toEquiv.image _)⟩⟩ + have := Module.Finite.of_basis b + have := (Module.free_def R M).mpr ⟨_, ⟨b⟩⟩ + have := Module.Finite.of_basis (b.map e) + have := (Module.free_def R N).mpr ⟨_, ⟨(b.map e).reindex (e.toEquiv.image _)⟩⟩ rw [e.conj_apply, trace_comp_comm', ← comp_assoc, LinearEquiv.comp_coe, LinearEquiv.self_trans_symm, LinearEquiv.refl_toLinearMap, id_comp] · rw [trace, trace, dif_neg hM, dif_neg ?_, zero_apply, zero_apply] diff --git a/Mathlib/Logic/Denumerable.lean b/Mathlib/Logic/Denumerable.lean index 64df6daf6dd46f..5aaaa995d10a59 100644 --- a/Mathlib/Logic/Denumerable.lean +++ b/Mathlib/Logic/Denumerable.lean @@ -94,7 +94,7 @@ def ofEquiv (α) {β} [Denumerable α] (e : β ≃ α) : Denumerable β := @[simp] theorem ofEquiv_ofNat (α) {β} [Denumerable α] (e : β ≃ α) (n) : @ofNat β (ofEquiv _ e) n = e.symm (ofNat α n) := by - letI := ofEquiv _ e + let := ofEquiv _ e refine ofNat_of_decode ?_ rw [decode_ofEquiv e] simp diff --git a/Mathlib/Logic/Equiv/Fin/Rotate.lean b/Mathlib/Logic/Equiv/Fin/Rotate.lean index 81a6d5d4778c7a..8553b11f066640 100644 --- a/Mathlib/Logic/Equiv/Fin/Rotate.lean +++ b/Mathlib/Logic/Equiv/Fin/Rotate.lean @@ -128,8 +128,8 @@ theorem finRotate_symm_lt_iff_ne_zero [NeZero n] (i : Fin n) : def finCycle (k : Fin n) : Equiv.Perm (Fin n) where toFun i := i + k invFun i := i - k - left_inv i := by haveI := NeZero.of_pos k.pos; simp - right_inv i := by haveI := NeZero.of_pos k.pos; simp + left_inv i := by have := NeZero.of_pos k.pos; simp + right_inv i := by have := NeZero.of_pos k.pos; simp lemma finCycle_eq_finRotate_iterate {k : Fin n} : finCycle k = (finRotate n)^[k.1] := by match n with diff --git a/Mathlib/Logic/Equiv/List.lean b/Mathlib/Logic/Equiv/List.lean index 06a9ad7ac808f8..e0925ea0fd802b 100644 --- a/Mathlib/Logic/Equiv/List.lean +++ b/Mathlib/Logic/Equiv/List.lean @@ -64,7 +64,7 @@ instance _root_.List.encodable : Encodable (List α) := ⟨encodeList, decodeList, decodeList_encodeList_eq_self⟩ instance _root_.List.countable {α : Type*} [Countable α] : Countable (List α) := by - haveI := Encodable.ofCountable α + have := Encodable.ofCountable α infer_instance @[simp] diff --git a/Mathlib/Logic/Nontrivial/Basic.lean b/Mathlib/Logic/Nontrivial/Basic.lean index 3d557a0ff7a017..d0eec00ab8e63f 100644 --- a/Mathlib/Logic/Nontrivial/Basic.lean +++ b/Mathlib/Logic/Nontrivial/Basic.lean @@ -68,7 +68,7 @@ variable {I : Type*} {f : I → Type*} theorem nontrivial_at (i' : I) [inst : ∀ i, Nonempty (f i)] [Nontrivial (f i')] : Nontrivial (∀ i : I, f i) := by classical - letI := Classical.decEq (∀ i : I, f i) + let := Classical.decEq (∀ i : I, f i) exact (Function.update_injective (fun i ↦ Classical.choice (inst i)) i').nontrivial /-- As a convenience, provide an instance automatically if `(f default)` is nontrivial. diff --git a/Mathlib/MeasureTheory/Constructions/BorelSpace/Metric.lean b/Mathlib/MeasureTheory/Constructions/BorelSpace/Metric.lean index 2a9879dab3d43c..cb37da1a32f73c 100644 --- a/Mathlib/MeasureTheory/Constructions/BorelSpace/Metric.lean +++ b/Mathlib/MeasureTheory/Constructions/BorelSpace/Metric.lean @@ -201,7 +201,7 @@ theorem exists_borelSpace_of_countablyGenerated_of_separatesPoints (α : Type*) [m : MeasurableSpace α] [CountablyGenerated α] [SeparatesPoints α] : ∃ _ : TopologicalSpace α, SecondCountableTopology α ∧ T4Space α ∧ BorelSpace α := by rcases measurableEquiv_nat_bool_of_countablyGenerated α with ⟨s, ⟨f⟩⟩ - letI := induced f inferInstance + let := induced f inferInstance let F := f.toEquiv.toHomeomorphOfIsInducing <| .induced _ exact ⟨inferInstance, F.secondCountableTopology, F.symm.t4Space, f.measurableEmbedding.borelSpace F.isInducing⟩ diff --git a/Mathlib/MeasureTheory/Constructions/BorelSpace/Metrizable.lean b/Mathlib/MeasureTheory/Constructions/BorelSpace/Metrizable.lean index 69fa66fdf6c2eb..15bbffb72192fe 100644 --- a/Mathlib/MeasureTheory/Constructions/BorelSpace/Metrizable.lean +++ b/Mathlib/MeasureTheory/Constructions/BorelSpace/Metrizable.lean @@ -31,7 +31,7 @@ measurable. -/ theorem measurable_of_tendsto_metrizable' {ι} {f : ι → α → β} {g : α → β} (u : Filter ι) [NeBot u] [IsCountablyGenerated u] (hf : ∀ i, Measurable (f i)) (lim : Tendsto f u (𝓝 g)) : Measurable g := by - letI : PseudoMetricSpace β := pseudoMetrizableSpacePseudoMetric β + let : PseudoMetricSpace β := pseudoMetrizableSpacePseudoMetric β apply measurable_of_isClosed' intro s h1s h2s h3s have : Measurable fun x => infNndist (g x) s := by diff --git a/Mathlib/MeasureTheory/Constructions/BorelSpace/Order.lean b/Mathlib/MeasureTheory/Constructions/BorelSpace/Order.lean index 20c22dc9b98969..1bc877ce80b251 100644 --- a/Mathlib/MeasureTheory/Constructions/BorelSpace/Order.lean +++ b/Mathlib/MeasureTheory/Constructions/BorelSpace/Order.lean @@ -55,7 +55,7 @@ variable [TopologicalSpace α] [SecondCountableTopology α] [LinearOrder α] [Or theorem borel_eq_generateFrom_Iio : borel α = .generateFrom (range Iio) := by refine le_antisymm ?_ (generateFrom_le ?_) · rw [borel_eq_generateFrom_of_subbasis (@OrderTopology.topology_eq_generate_intervals α _ _ _)] - letI : MeasurableSpace α := MeasurableSpace.generateFrom (range Iio) + let : MeasurableSpace α := MeasurableSpace.generateFrom (range Iio) have H : ∀ a : α, MeasurableSet (Iio a) := fun a => GenerateMeasurable.basic _ ⟨_, rfl⟩ refine generateFrom_le ?_ rintro _ ⟨a, rfl | rfl⟩ @@ -296,7 +296,7 @@ theorem Dense.borel_eq_generateFrom_Icc_mem_aux {α : Type*} [TopologicalSpace borel α = .generateFrom {S : Set α | ∃ l ∈ s, ∃ u ∈ s, l ≤ u ∧ Icc l u = S} := by set S : Set (Set α) := { S | ∃ l ∈ s, ∃ u ∈ s, l ≤ u ∧ Icc l u = S } refine le_antisymm ?_ (generateFrom_Icc_mem_le_borel _ _) - letI : MeasurableSpace α := generateFrom S + let : MeasurableSpace α := generateFrom S rw [borel_eq_generateFrom_Iio] refine generateFrom_le (forall_mem_range.2 fun a => ?_) rcases hd.exists_countable_dense_subset_bot_top with ⟨t, hts, hc, htd, htb, -⟩ @@ -357,7 +357,7 @@ theorem Dense.borel_eq_generateFrom_Ico_mem_aux {α : Type*} [TopologicalSpace borel α = .generateFrom { S : Set α | ∃ l ∈ s, ∃ u ∈ s, l < u ∧ Ico l u = S } := by set S : Set (Set α) := { S | ∃ l ∈ s, ∃ u ∈ s, l < u ∧ Ico l u = S } refine le_antisymm ?_ (generateFrom_Ico_mem_le_borel _ _) - letI : MeasurableSpace α := generateFrom S + let : MeasurableSpace α := generateFrom S rw [borel_eq_generateFrom_Iio] refine generateFrom_le (forall_mem_range.2 fun a => ?_) rcases hd.exists_countable_dense_subset_bot_top with ⟨t, hts, hc, htd, htb, -⟩ @@ -745,7 +745,7 @@ theorem AEMeasurable.isLUB {ι} {μ : Measure δ} [Countable ι] {f : ι → δ AEMeasurable g μ := by classical nontriviality α - haveI hα : Nonempty α := inferInstance + have hα : Nonempty α := inferInstance rcases isEmpty_or_nonempty ι with hι | hι · simp only [IsEmpty.exists_iff, setOf_false, isLUB_empty_iff] at hg exact aemeasurable_const' (hg.mono fun a ha => hg.mono fun b hb => (ha _).antisymm (hb _)) @@ -959,7 +959,7 @@ protected theorem Measurable.sInf {ι} {f : ι → δ → α} {s : Set ι} (hs : theorem Measurable.biSup {ι} (s : Set ι) {f : ι → δ → α} (hs : s.Countable) (hf : ∀ i ∈ s, Measurable (f i)) : Measurable fun b => ⨆ i ∈ s, f i b := by - haveI : Encodable s := hs.toEncodable + have : Encodable s := hs.toEncodable by_cases H : ∀ i, i ∈ s · have : ∀ b, ⨆ i ∈ s, f i b = ⨆ (i : s), f i b := fun b ↦ cbiSup_eq_of_forall (f := fun i ↦ f i b) H diff --git a/Mathlib/MeasureTheory/Constructions/Pi.lean b/Mathlib/MeasureTheory/Constructions/Pi.lean index c025ed63bbb813..1e8728a5b51a1f 100644 --- a/Mathlib/MeasureTheory/Constructions/Pi.lean +++ b/Mathlib/MeasureTheory/Constructions/Pi.lean @@ -219,7 +219,7 @@ theorem pi_pi_aux [∀ i, SigmaFinite (μ i)] (s : ∀ i, Set (α i)) (hs : ∀ refine le_antisymm ?_ ?_ · rw [Measure.pi, toMeasure_apply _ _ (MeasurableSet.pi countable_univ fun i _ => hs i)] apply OuterMeasure.pi_pi_le - · haveI : Encodable ι := Fintype.toEncodable ι + · have : Encodable ι := Fintype.toEncodable ι simp_rw [← pi'_pi μ s, Measure.pi, toMeasure_apply _ _ (MeasurableSet.pi countable_univ fun i _ => hs i)] suffices (pi' μ).toOuterMeasure ≤ OuterMeasure.pi fun i => (μ i).toOuterMeasure by exact this _ @@ -270,7 +270,7 @@ theorem pi_eq_generateFrom {C : ∀ i, Set (Set (α i))} (generateFrom_eq_pi hC fun i => (h3C i).isCountablySpanning).symm (IsPiSystem.pi h2C) ?_ rintro _ ⟨s, hs, rfl⟩ rw [mem_univ_pi] at hs - haveI := fun i => (h3C i).sigmaFinite + have := fun i => (h3C i).sigmaFinite simp_rw [h₁ s hs, pi_pi_aux μ s fun i => h4C i _ (hs i)] /-- A measure on a finite product space equals the product measure if they are equal on @@ -289,7 +289,7 @@ theorem pi'_eq_pi [Encodable ι] [∀ i, SigmaFinite (μ i)] : pi' μ = Measure. @[simp] theorem pi_pi [∀ i, SigmaFinite (μ i)] (s : (i : ι) → Set (α i)) : Measure.pi μ (pi univ s) = ∏ i, μ i (s i) := by - haveI : Encodable ι := Fintype.toEncodable ι + have : Encodable ι := Fintype.toEncodable ι rw [← pi'_eq_pi, pi'_pi] nonrec theorem pi_univ [∀ i, SigmaFinite (μ i)] : Measure.pi μ univ = ∏ i, μ i univ := by @@ -340,7 +340,7 @@ instance {α : ι → Type*} [∀ i, MeasureSpace (α i)] [∀ i, SigmaFinite (v theorem pi_of_empty {α : Type*} [Fintype α] [IsEmpty α] {β : α → Type*} {m : ∀ a, MeasurableSpace (β a)} (μ : ∀ a : α, Measure (β a)) (x : ∀ a, β a := isEmptyElim) : Measure.pi μ = dirac x := by - haveI : ∀ a, SigmaFinite (μ a) := isEmptyElim + have : ∀ a, SigmaFinite (μ a) := isEmptyElim refine pi_eq fun s _ => ?_ rw [Fintype.prod_empty, dirac_apply_of_mem] exact isEmptyElim (α := α) diff --git a/Mathlib/MeasureTheory/Constructions/Polish/Basic.lean b/Mathlib/MeasureTheory/Constructions/Polish/Basic.lean index c1c595f7b275db..56f184ea723ecb 100644 --- a/Mathlib/MeasureTheory/Constructions/Polish/Basic.lean +++ b/Mathlib/MeasureTheory/Constructions/Polish/Basic.lean @@ -155,7 +155,7 @@ instance pi_countable {ι : Type*} [Countable ι] {α : ι → Type*} [∀ n, Me inferInstance instance [StandardBorelSpace α] : MeasurableEq α := by - letI := upgradeStandardBorel α + let := upgradeStandardBorel α infer_instance end instances @@ -203,7 +203,7 @@ theorem analyticSet_range_of_polishSpace {β : Type*} [TopologicalSpace β] [Pol theorem _root_.IsOpen.analyticSet_image {β : Type*} [TopologicalSpace β] [PolishSpace β] {s : Set β} (hs : IsOpen s) {f : β → α} (f_cont : Continuous f) : AnalyticSet (f '' s) := by rw [image_eq_range] - haveI : PolishSpace s := hs.polishSpace + have : PolishSpace s := hs.polishSpace exact analyticSet_range_of_polishSpace (f_cont.comp continuous_subtype_val) /-- A set is analytic if and only if it is the continuous image of some Polish space. -/ @@ -255,7 +255,7 @@ theorem AnalyticSet.iInter [hι : Nonempty ι] [Countable ι] [T2Space α] {s : intro n exact isClosed_eq ((f_cont n).comp (continuous_apply n)) ((f_cont i₀).comp (continuous_apply i₀)) - haveI : PolishSpace t := t_closed.polishSpace + have : PolishSpace t := t_closed.polishSpace let F : t → α := fun x => f i₀ ((x : γ) i₀) have F_cont : Continuous F := (f_cont i₀).comp ((continuous_apply i₀).comp continuous_subtype_val) have F_range : range F = ⋂ n : ι, s n := by @@ -297,7 +297,7 @@ theorem AnalyticSet.iUnion [Countable ι] {s : ι → Set α} (hs : ∀ n, Analy theorem _root_.IsClosed.analyticSet [PolishSpace α] {s : Set α} (hs : IsClosed s) : AnalyticSet s := by - haveI : PolishSpace s := hs.polishSpace + have : PolishSpace s := hs.polishSpace rw [← @Subtype.range_val α s] exact analyticSet_range_of_polishSpace continuous_subtype_val @@ -333,7 +333,7 @@ theorem _root_.Measurable.exists_continuous {α β : Type*} [t : TopologicalSpac obtain ⟨b, b_count, -, hb⟩ : ∃ b : Set (Set (range f)), b.Countable ∧ ∅ ∉ b ∧ IsTopologicalBasis b := exists_countable_basis (range f) - haveI : Countable b := b_count.to_subtype + have : Countable b := b_count.to_subtype have : ∀ s : b, IsClopenable (rangeFactorization f ⁻¹' s) := fun s ↦ by apply MeasurableSet.isClopenable exact hf.subtype_mk (hb.isOpen s.2).measurableSet @@ -352,11 +352,11 @@ theorem _root_.MeasurableSet.analyticSet_image {X Y : Type*} [MeasurableSpace X] [StandardBorelSpace X] [TopologicalSpace Y] [MeasurableSpace Y] [OpensMeasurableSpace Y] {f : X → Y} [SecondCountableTopology (range f)] {s : Set X} (hs : MeasurableSet s) (hf : Measurable f) : AnalyticSet (f '' s) := by - letI := upgradeStandardBorel X + let := upgradeStandardBorel X rw [eq_borel_upgradeStandardBorel X] at hs rcases hf.exists_continuous with ⟨τ', hle, hfc, hτ'⟩ - letI m' : MeasurableSpace X := @borel _ τ' - haveI b' : BorelSpace X := ⟨rfl⟩ + let m' : MeasurableSpace X := @borel _ τ' + have b' : BorelSpace X := ⟨rfl⟩ have hle := borel_anti hle exact (hle _ hs).analyticSet.image_of_continuous hfc @@ -478,7 +478,7 @@ theorem measurablySeparable_range_of_disjoint [T2Space α] [MeasurableSpace α] ∃ u v : Set α, IsOpen u ∧ IsOpen v ∧ f x ∈ u ∧ g y ∈ v ∧ Disjoint u v := by apply t2_separation exact disjoint_iff_forall_ne.1 h (mem_range_self _) (mem_range_self _) - letI : MetricSpace (ℕ → ℕ) := metricSpaceNatNat + let : MetricSpace (ℕ → ℕ) := metricSpaceNatNat obtain ⟨εx, εxpos, hεx⟩ : ∃ (εx : ℝ), εx > 0 ∧ Metric.ball x εx ⊆ f ⁻¹' u := by apply Metric.mem_nhds_iff.1 exact hf.continuousAt.preimage_mem_nhds (u_open.mem_nhds xu) @@ -563,7 +563,7 @@ theorem map_measurableSpace_eq [CountablySeparated Z] theorem map_measurableSpace_eq_borel [SecondCountableTopology Y] {f : X → Y} (hf : Measurable f) (hsurj : Surjective f) : MeasurableSpace.map f ‹MeasurableSpace X› = borel Y := by have d := hf.mono le_rfl OpensMeasurableSpace.borel_le - letI := borel Y; haveI : BorelSpace Y := ⟨rfl⟩ + let := borel Y; have : BorelSpace Y := ⟨rfl⟩ exact d.map_measurableSpace_eq hsurj theorem borelSpace_codomain [SecondCountableTopology Y] {f : X → Y} (hf : Measurable f) @@ -673,10 +673,10 @@ theorem MeasureTheory.measurableSet_range_of_continuous_injective {β : Type*} [ the image `f '' (s i)` would be included in `v` by continuity of `f`, so its closure would be contained in the closure of `v`, and therefore it would be disjoint from `w`. This is a contradiction since `x` belongs both to this closure and to `w`. -/ - letI := TopologicalSpace.upgradeIsCompletelyMetrizable γ + let := TopologicalSpace.upgradeIsCompletelyMetrizable γ obtain ⟨b, b_count, b_nonempty, hb⟩ : ∃ b : Set (Set γ), b.Countable ∧ ∅ ∉ b ∧ IsTopologicalBasis b := exists_countable_basis γ - haveI : Encodable b := b_count.toEncodable + have : Encodable b := b_count.toEncodable let A := { p : b × b // Disjoint (p.1 : Set γ) p.2 } -- for each pair of disjoint sets in the topological basis `b`, consider Borel sets separating -- their images, by injectivity of `f` and the Lusin separation theorem. @@ -763,7 +763,7 @@ theorem MeasureTheory.measurableSet_range_of_continuous_injective {β : Type*} [ (add_le_add ((dist_le_diam_of_mem (hs m).1 (hy m) zsm).trans (hs m).2) ((dist_le_diam_of_mem (hs n).1 zsn (hy n)).trans (hs n).2)) _ ≤ 2 * u m := by linarith [u_anti.antitone hmn] - haveI : Nonempty γ := ⟨y 0⟩ + have : Nonempty γ := ⟨y 0⟩ -- let `z` be its limit. let z := limUnder atTop y have y_lim : Tendsto y atTop (𝓝 z) := cauchy_y.tendsto_limUnder @@ -801,7 +801,7 @@ theorem IsClosed.measurableSet_image_of_continuousOn_injOn [MeasurableSpace β] [OpensMeasurableSpace β] {s : Set γ} (hs : IsClosed s) {f : γ → β} (f_cont : ContinuousOn f s) (f_inj : InjOn f s) : MeasurableSet (f '' s) := by rw [image_eq_range] - haveI : PolishSpace s := IsClosed.polishSpace hs + have : PolishSpace s := IsClosed.polishSpace hs apply measurableSet_range_of_continuous_injective · rwa [continuousOn_iff_continuous_restrict] at f_cont · rwa [injOn_iff_injective] at f_inj @@ -831,7 +831,7 @@ theorem MeasurableSet.image_of_measurable_injOn {f : γ → α} [MeasurableSpace γ] [StandardBorelSpace γ] (hs : MeasurableSet s) (f_meas : Measurable f) (f_inj : InjOn f s) : MeasurableSet (f '' s) := by - letI := upgradeStandardBorel γ + let := upgradeStandardBorel γ let tγ : TopologicalSpace γ := inferInstance rcases exists_opensMeasurableSpace_of_countablySeparated α with ⟨τ, _, _, _⟩ -- for a finer Polish topology, `f` is continuous. Therefore, one may apply the corresponding @@ -840,8 +840,8 @@ theorem MeasurableSet.image_of_measurable_injOn {f : γ → α} ∃ t' : TopologicalSpace γ, t' ≤ tγ ∧ @Continuous γ _ t' _ f ∧ @PolishSpace γ t' := f_meas.exists_continuous have hs' := (borel_anti t't s) <| by rwa [← eq_borel_upgradeStandardBorel γ] - letI : MeasurableSpace γ := @borel γ t' - letI : BorelSpace γ := ⟨rfl⟩ + let : MeasurableSpace γ := @borel γ t' + let : BorelSpace γ := ⟨rfl⟩ exact hs'.image_of_continuousOn_injOn f_cont.continuousOn f_inj /-- An injective continuous function on a Polish space is a measurable embedding. -/ @@ -982,7 +982,7 @@ lemma MeasureTheory.measurableSet_tendsto_fun [MeasurableSpace γ] [Countable ι [OpensMeasurableSpace γ] {f : ι → β → γ} (hf : ∀ i, Measurable (f i)) {g : β → γ} (hg : Measurable g) : MeasurableSet { x | Tendsto (fun n ↦ f n x) l (𝓝 (g x)) } := by - letI := TopologicalSpace.pseudoMetrizableSpacePseudoMetric γ + let := TopologicalSpace.pseudoMetrizableSpacePseudoMetric γ simp_rw [tendsto_iff_dist_tendsto_zero (f := fun n ↦ f n _)] exact measurableSet_tendsto (𝓝 0) (fun n ↦ (hf n).dist hg) @@ -995,7 +995,7 @@ theorem MeasureTheory.measurableSet_exists_tendsto [TopologicalSpace γ] MeasurableSet { x | ∃ c, Tendsto (fun n => f n x) l (𝓝 c) } := by rcases l.eq_or_neBot with rfl | hl · simp - letI := TopologicalSpace.upgradeIsCompletelyPseudoMetrizable γ + let := TopologicalSpace.upgradeIsCompletelyPseudoMetrizable γ rcases l.exists_antitone_basis with ⟨u, hu⟩ simp_rw [← cauchy_map_iff_exists_tendsto] change MeasurableSet { x | _ ∧ _ } @@ -1092,7 +1092,7 @@ variable [MeasurableSpace α] [StandardBorelSpace α] making `s` clopen. -/ theorem MeasurableSet.isClopenable' {s : Set α} (hs : MeasurableSet s) : ∃ _ : TopologicalSpace α, BorelSpace α ∧ PolishSpace α ∧ IsClosed s ∧ IsOpen s := by - letI := upgradeStandardBorel α + let := upgradeStandardBorel α obtain ⟨t, hle, ht, s_clopen⟩ := hs.isClopenable refine ⟨t, ?_, ht, s_clopen⟩ constructor @@ -1103,7 +1103,7 @@ theorem MeasurableSet.isClopenable' {s : Set α} (hs : MeasurableSet s) : theorem MeasurableSet.standardBorel {s : Set α} (hs : MeasurableSet s) : StandardBorelSpace s := by obtain ⟨_, _, _, s_closed, _⟩ := hs.isClopenable' - haveI := s_closed.polishSpace + have := s_closed.polishSpace infer_instance end StandardBorelSpace @@ -1126,7 +1126,7 @@ noncomputable def borelSchroederBernstein {f : α → β} {g : β → α} (fmeas /-- Any uncountable standard Borel space is Borel isomorphic to the Cantor space `ℕ → Bool`. -/ noncomputable def measurableEquivNatBoolOfNotCountable (h : ¬Countable α) : α ≃ᵐ (ℕ → Bool) := by apply Nonempty.some - letI := upgradeStandardBorel α + let := upgradeStandardBorel α obtain ⟨f, -, fcts, finj⟩ := isClosed_univ.exists_nat_bool_injection_of_not_countable (α := α) (by rwa [← countable_coe_iff, (Equiv.Set.univ _).countable_iff]) diff --git a/Mathlib/MeasureTheory/Constructions/Polish/StronglyMeasurable.lean b/Mathlib/MeasureTheory/Constructions/Polish/StronglyMeasurable.lean index 2582708a2b5916..b3c9f2544b451e 100644 --- a/Mathlib/MeasureTheory/Constructions/Polish/StronglyMeasurable.lean +++ b/Mathlib/MeasureTheory/Constructions/Polish/StronglyMeasurable.lean @@ -38,7 +38,7 @@ theorem measurableSet_exists_tendsto [IsCompletelyPseudoMetrizableSpace E] obtain rfl | hl := eq_or_neBot l · simp_all borelize E - letI := upgradeIsCompletelyPseudoMetrizable E + let := upgradeIsCompletelyPseudoMetrizable E let s := closure (⋃ i, range (f i)) have : SecondCountableTopology s := @UniformSpace.secondCountable_of_separable s _ _ (IsSeparable.iUnion (fun i ↦ (hf i).isSeparable_range)).closure.separableSpace diff --git a/Mathlib/MeasureTheory/Constructions/Projective.lean b/Mathlib/MeasureTheory/Constructions/Projective.lean index 707e4c914832ab..b963e82a21221e 100644 --- a/Mathlib/MeasureTheory/Constructions/Projective.lean +++ b/Mathlib/MeasureTheory/Constructions/Projective.lean @@ -151,7 +151,7 @@ lemma measure_univ_unique (hμ : IsProjectiveLimit μ P) (hν : IsProjectiveLimi theorem unique [∀ i, IsFiniteMeasure (P i)] (hμ : IsProjectiveLimit μ P) (hν : IsProjectiveLimit ν P) : μ = ν := by - haveI : IsFiniteMeasure μ := hμ.isFiniteMeasure + have : IsFiniteMeasure μ := hμ.isFiniteMeasure refine ext_of_generate_finite (measurableCylinders α) generateFrom_measurableCylinders.symm isPiSystem_measurableCylinders (fun s hs ↦ ?_) (hμ.measure_univ_unique hν) obtain ⟨I, S, hS, rfl⟩ := (mem_measurableCylinders _).mp hs diff --git a/Mathlib/MeasureTheory/Covering/Besicovitch.lean b/Mathlib/MeasureTheory/Covering/Besicovitch.lean index efe2280ce46e21..d76c0537778d51 100644 --- a/Mathlib/MeasureTheory/Covering/Besicovitch.lean +++ b/Mathlib/MeasureTheory/Covering/Besicovitch.lean @@ -964,7 +964,7 @@ theorem exists_closedBall_covering_tsum_measure_le (μ : Measure α) [SFinite μ (∑' x : t0, μ (closedBall x (r x))) = ∑' x : t0, μ (closedBall x (r0 x)) := by congr 1; ext x; rw [r_t0 x x.2] _ = μ (⋃ x : t0, closedBall x (r0 x)) := by - haveI : Encodable t0 := t0_count.toEncodable + have : Encodable t0 := t0_count.toEncodable rw [measure_iUnion] · exact (pairwise_subtype_iff_pairwise_set _ _).2 t0_disj · exact fun i => measurableSet_closedBall @@ -986,7 +986,7 @@ theorem exists_closedBall_covering_tsum_measure_le (μ : Measure α) [SFinite μ _ = ∑' x : S i, μ (closedBall x (r1 x)) := by grind _ = μ (⋃ x : S i, closedBall x (r1 x)) := by - haveI : Encodable (S i) := (S_count i).toEncodable + have : Encodable (S i) := (S_count i).toEncodable rw [measure_iUnion] · exact (pairwise_subtype_iff_pairwise_set _ _).2 (S_disj i) · exact fun i => measurableSet_closedBall diff --git a/Mathlib/MeasureTheory/Covering/Differentiation.lean b/Mathlib/MeasureTheory/Covering/Differentiation.lean index 7daede20a4718e..d766c48e2e1982 100644 --- a/Mathlib/MeasureTheory/Covering/Differentiation.lean +++ b/Mathlib/MeasureTheory/Covering/Differentiation.lean @@ -137,7 +137,7 @@ theorem measure_le_of_frequently_le [SecondCountableTopology α] [BorelSpace α] apply Frequently.mono this rintro a ⟨ρa, _, aU⟩ exact ⟨ρa, aU⟩ - haveI : Encodable h.index := h.index_countable.toEncodable + have : Encodable h.index := h.index_countable.toEncodable calc ρ s ≤ ∑' x : h.index, ρ (h.covering x) := h.measure_le_tsum_of_absolutelyContinuous hρ _ ≤ ∑' x : h.index, ν (h.covering x) := ENNReal.tsum_le_tsum fun x => (h.covering_mem x.2).1 @@ -708,7 +708,7 @@ almost every point of `s` is a Lebesgue density point for `s`. A version for non holds, but it only gives the first conclusion, see `ae_tendsto_measure_inter_div`. -/ theorem ae_tendsto_measure_inter_div_of_measurableSet {s : Set α} (hs : MeasurableSet s) : ∀ᵐ x ∂μ, Tendsto (fun a => μ (s ∩ a) / μ a) (v.filterAt x) (𝓝 (s.indicator 1 x)) := by - haveI : IsLocallyFiniteMeasure (μ.restrict s) := + have : IsLocallyFiniteMeasure (μ.restrict s) := isLocallyFiniteMeasure_of_le restrict_le_self filter_upwards [ae_tendsto_rnDeriv v (μ.restrict s), rnDeriv_restrict_self μ hs] intro x hx h'x diff --git a/Mathlib/MeasureTheory/Covering/Vitali.lean b/Mathlib/MeasureTheory/Covering/Vitali.lean index f708ea56c5007e..431125f68cf616 100644 --- a/Mathlib/MeasureTheory/Covering/Vitali.lean +++ b/Mathlib/MeasureTheory/Covering/Vitali.lean @@ -414,7 +414,7 @@ theorem exists_disjoint_covering_ae exact subset_iUnion (fun a : { a // a ∉ w } => closedBall (c a) (3 * r a)) b'' -- now that we have proved our main inclusion, we can use it to estimate the measure of the points -- in `ball x (r x)` not covered by `u`. - haveI : Countable v := (u_count.mono vu).to_subtype + have : Countable v := (u_count.mono vu).to_subtype calc μ ((s \ ⋃ a ∈ u, B a) ∩ ball x (R x)) ≤ μ (⋃ a : { a // a ∉ w }, closedBall (c a) (3 * r a)) := measure_mono M diff --git a/Mathlib/MeasureTheory/Function/AEEqOfIntegral.lean b/Mathlib/MeasureTheory/Function/AEEqOfIntegral.lean index 78b0a17871d839..26f6a7324eb037 100644 --- a/Mathlib/MeasureTheory/Function/AEEqOfIntegral.lean +++ b/Mathlib/MeasureTheory/Function/AEEqOfIntegral.lean @@ -80,7 +80,7 @@ theorem ae_eq_zero_of_forall_dual_of_isSeparable [NormedAddCommGroup E] [NormedS (hf : ∀ c : StrongDual 𝕜 E, (fun x => ⟪f x, c⟫) =ᵐ[μ] 0) (h't : ∀ᵐ x ∂μ, f x ∈ t) : f =ᵐ[μ] 0 := by rcases ht with ⟨d, d_count, hd⟩ - haveI : Encodable d := d_count.toEncodable + have : Encodable d := d_count.toEncodable have : ∀ x : d, ∃ g : StrongDual 𝕜 E, ‖g‖ ≤ 1 ∧ g x = ‖(x : E)‖ := fun x => exists_dual_vector'' 𝕜 (x : E) choose s hs using this @@ -183,7 +183,7 @@ theorem AEFinStronglyMeasurable.ae_nonneg_of_forall_setIntegral_nonneg {f : α let t := hf.sigmaFiniteSet suffices 0 ≤ᵐ[μ.restrict t] f from ae_of_ae_restrict_of_ae_restrict_compl _ this hf.ae_eq_zero_compl.symm.le - haveI : SigmaFinite (μ.restrict t) := hf.sigmaFinite_restrict + have : SigmaFinite (μ.restrict t) := hf.sigmaFinite_restrict refine ae_nonneg_of_forall_setIntegral_nonneg_of_sigmaFinite (fun s hs hμts => ?_) fun s hs hμts => ?_ · rw [IntegrableOn, Measure.restrict_restrict hs] @@ -288,7 +288,7 @@ theorem AEFinStronglyMeasurable.ae_eq_zero_of_forall_setIntegral_eq_zero {f : α let t := hf.sigmaFiniteSet suffices f =ᵐ[μ.restrict t] 0 from ae_of_ae_restrict_of_ae_restrict_compl _ this hf.ae_eq_zero_compl - haveI : SigmaFinite (μ.restrict t) := hf.sigmaFinite_restrict + have : SigmaFinite (μ.restrict t) := hf.sigmaFinite_restrict refine ae_eq_zero_of_forall_setIntegral_eq_of_sigmaFinite ?_ ?_ · intro s hs hμs rw [IntegrableOn, Measure.restrict_restrict hs] @@ -333,7 +333,7 @@ theorem ae_eq_zero_of_forall_setIntegral_eq_of_finStronglyMeasurable_trim (hm : (hf_zero : ∀ s : Set α, MeasurableSet[m] s → μ s < ∞ → ∫ x in s, f x ∂μ = 0) (hf : FinStronglyMeasurable f (μ.trim hm)) : f =ᵐ[μ] 0 := by obtain ⟨t, ht_meas, htf_zero, htμ⟩ := hf.exists_set_sigmaFinite - haveI : SigmaFinite ((μ.restrict t).trim hm) := by rwa [restrict_trim hm μ ht_meas] at htμ + have : SigmaFinite ((μ.restrict t).trim hm) := by rwa [restrict_trim hm μ ht_meas] at htμ have htf_zero : f =ᵐ[μ.restrict tᶜ] 0 := by rw [EventuallyEq, ae_restrict_iff' (MeasurableSet.compl (hm _ ht_meas))] exact Eventually.of_forall htf_zero diff --git a/Mathlib/MeasureTheory/Function/AEMeasurableOrder.lean b/Mathlib/MeasureTheory/Function/AEMeasurableOrder.lean index 6162320fd09227..6d8e1ddff0ba21 100644 --- a/Mathlib/MeasureTheory/Function/AEMeasurableOrder.lean +++ b/Mathlib/MeasureTheory/Function/AEMeasurableOrder.lean @@ -40,7 +40,7 @@ theorem MeasureTheory.aemeasurable_of_exist_almost_disjoint_supersets {α : Type { x | f x < p } ⊆ u ∧ { x | q < f x } ⊆ v ∧ μ (u ∩ v) = 0) : AEMeasurable f μ := by classical - haveI : Encodable s := s_count.toEncodable + have : Encodable s := s_count.toEncodable have h' : ∀ p q, ∃ u v, MeasurableSet u ∧ MeasurableSet v ∧ { x | f x < p } ⊆ u ∧ { x | q < f x } ⊆ v ∧ (p ∈ s → q ∈ s → p < q → μ (u ∩ v) = 0) := by intro p q @@ -64,7 +64,7 @@ theorem MeasureTheory.aemeasurable_of_exist_almost_disjoint_supersets {α : Type μ t ≤ ∑' (p : s) (q : ↥(s ∩ Ioi p)), μ (u' p ∩ v p q) := by refine (measure_iUnion_le _).trans ?_ refine ENNReal.tsum_le_tsum fun p => ?_ - haveI := (s_count.mono (s.inter_subset_left (t := Ioi ↑p))).to_subtype + have := (s_count.mono (s.inter_subset_left (t := Ioi ↑p))).to_subtype apply measure_iUnion_le _ ≤ ∑' (p : s) (q : ↥(s ∩ Ioi p)), μ (u p q ∩ v p q) := by gcongr with p q diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/AEMeasurable.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/AEMeasurable.lean index 3fb364c2e5c72c..7a06aec3ea3e6c 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/AEMeasurable.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/AEMeasurable.lean @@ -301,7 +301,7 @@ instance [hm : Fact (m ≤ m0)] [CompleteSpace F] [hp : Fact (1 ≤ p)] : theorem isComplete_aestronglyMeasurable [hp : Fact (1 ≤ p)] [CompleteSpace F] (hm : m ≤ m0) : IsComplete {f : Lp F p μ | AEStronglyMeasurable[m] f μ} := by rw [← completeSpace_coe_iff_isComplete] - haveI : Fact (m ≤ m0) := ⟨hm⟩ + have : Fact (m ≤ m0) := ⟨hm⟩ change CompleteSpace (lpMeasSubgroup F m p μ) infer_instance diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL2.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL2.lean index 11d4636a70d5e6..a82501d2a0f100 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL2.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/CondexpL2.lean @@ -113,7 +113,7 @@ theorem condExpL2_indicator_of_measurable (hm : m ≤ m0) (hs : MeasurableSet[m] (condExpL2 E 𝕜 hm (indicatorConstLp 2 (hm s hs) hμs c) : α →₂[μ] E) = indicatorConstLp 2 (hm s hs) hμs c := by rw [condExpL2] - haveI : Fact (m ≤ m0) := ⟨hm⟩ + have : Fact (m ≤ m0) := ⟨hm⟩ have h_mem : indicatorConstLp 2 (hm s hs) hμs c ∈ lpMeas E 𝕜 m 2 μ := mem_lpMeas_indicatorConstLp hm hs hμs let ind := (⟨indicatorConstLp 2 (hm s hs) hμs c, h_mem⟩ : lpMeas E 𝕜 m 2 μ) diff --git a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Indicator.lean b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Indicator.lean index 5a13702022a906..8bcb431f846b69 100644 --- a/Mathlib/MeasureTheory/Function/ConditionalExpectation/Indicator.lean +++ b/Mathlib/MeasureTheory/Function/ConditionalExpectation/Indicator.lean @@ -43,7 +43,7 @@ theorem condExp_ae_eq_restrict_zero (hs : MeasurableSet[m] s) (hf : f =ᵐ[μ.re swap; · simp_rw [condExp_of_not_le hm]; rfl by_cases hμm : SigmaFinite (μ.trim hm) swap; · simp_rw [condExp_of_not_sigmaFinite hm hμm]; rfl - haveI : SigmaFinite (μ.trim hm) := hμm + have : SigmaFinite (μ.trim hm) := hμm have : SigmaFinite ((μ.restrict s).trim hm) := by rw [← restrict_trim hm _ hs] exact Restrict.sigmaFinite _ s @@ -78,7 +78,7 @@ theorem condExp_indicator (hf_int : Integrable f μ) (hs : MeasurableSet[m] s) : swap; · simp_rw [condExp_of_not_le hm, Set.indicator_zero']; rfl by_cases hμm : SigmaFinite (μ.trim hm) swap; · simp_rw [condExp_of_not_sigmaFinite hm hμm, Set.indicator_zero']; rfl - haveI : SigmaFinite (μ.trim hm) := hμm + have : SigmaFinite (μ.trim hm) := hμm -- use `have` to perform what should be the first calc step because of an error I don't -- understand have : s.indicator (μ[f | m]) =ᵐ[μ] s.indicator (μ[s.indicator f + sᶜ.indicator f | m]) := by diff --git a/Mathlib/MeasureTheory/Function/FactorsThrough.lean b/Mathlib/MeasureTheory/Function/FactorsThrough.lean index 11d9a0fc7c5160..43e35c7f25ffeb 100644 --- a/Mathlib/MeasureTheory/Function/FactorsThrough.lean +++ b/Mathlib/MeasureTheory/Function/FactorsThrough.lean @@ -78,7 +78,7 @@ then there exists some measurable function `h : Y → Z` such that `g = h ∘ f` theorem _root_.Measurable.exists_eq_measurable_comp [Nonempty Z] [MeasurableSpace Z] [StandardBorelSpace Z] (hg : Measurable[mY.comap f] g) : ∃ h : Y → Z, Measurable h ∧ g = h ∘ f := by - letI := upgradeStandardBorel Z + let := upgradeStandardBorel Z obtain ⟨h, mh, hh⟩ := hg.stronglyMeasurable.exists_eq_measurable_comp exact ⟨h, mh.measurable, hh⟩ diff --git a/Mathlib/MeasureTheory/Function/Jacobian.lean b/Mathlib/MeasureTheory/Function/Jacobian.lean index 4df52b8c00a28a..a641df4f1adc90 100644 --- a/Mathlib/MeasureTheory/Function/Jacobian.lean +++ b/Mathlib/MeasureTheory/Function/Jacobian.lean @@ -219,7 +219,7 @@ theorem exists_closed_cover_approximatesLinearOn_of_hasFDerivWithinAt [SecondCou isClosed_closure.inter isClosed_closedBall -- reindex the sets `K n z p`, to let them only depend on an integer parameter `q`. obtain ⟨F, hF⟩ : ∃ F : ℕ → ℕ × T × ℕ, Function.Surjective F := by - haveI : Encodable T := T_count.toEncodable + have : Encodable T := T_count.toEncodable have : Nonempty T := by rcases hs with ⟨x, xs⟩ rcases s_subset x xs with ⟨n, z, _⟩ @@ -366,7 +366,7 @@ theorem addHaar_image_le_mul_of_det_lt (A : E →L[ℝ] E) {m : ℝ≥0} (∑' x : ↥t, μ (closedBall (↑x) (r ↑x))) ≤ μ s + a := Besicovitch.exists_closedBall_covering_tsum_measure_le μ ha.ne' (fun _ => Ioi 0) s fun x _ δ δpos => ⟨δ / 2, by simp [half_pos δpos, δpos]⟩ - haveI : Encodable t := t_count.toEncodable + have : Encodable t := t_count.toEncodable calc μ (f '' s) ≤ μ (⋃ x : t, f '' (s ∩ closedBall x (r x))) := by rw [biUnion_eq_iUnion] at st diff --git a/Mathlib/MeasureTheory/Function/L1Space/Integrable.lean b/Mathlib/MeasureTheory/Function/L1Space/Integrable.lean index cc312fd5c05404..e00aada65caaf8 100644 --- a/Mathlib/MeasureTheory/Function/L1Space/Integrable.lean +++ b/Mathlib/MeasureTheory/Function/L1Space/Integrable.lean @@ -771,8 +771,8 @@ lemma integrable_count_iff : have hs' : (Function.support f).Countable := by simpa only [Ne, Pi.zero_apply, eq_comm, Function.support, norm_eq_zero] using hs.countable_support - letI : MeasurableSpace β := borel β - haveI : BorelSpace β := ⟨rfl⟩ + let : MeasurableSpace β := borel β + have : BorelSpace β := ⟨rfl⟩ refine aestronglyMeasurable_iff_aemeasurable_separable.mpr ⟨?_, ?_⟩ · refine (measurable_zero.measurable_of_countable_ne ?_).aemeasurable simpa only [Ne, Pi.zero_apply, eq_comm, Function.support] using hs' diff --git a/Mathlib/MeasureTheory/Function/LocallyIntegrable.lean b/Mathlib/MeasureTheory/Function/LocallyIntegrable.lean index 14d1260b68cf3c..d13f2470fe04c4 100644 --- a/Mathlib/MeasureTheory/Function/LocallyIntegrable.lean +++ b/Mathlib/MeasureTheory/Function/LocallyIntegrable.lean @@ -519,7 +519,7 @@ variable {a : X} theorem integrableOn_Iic_iff_integrableAtFilter_atBot [LinearOrder X] [CompactIccSpace X] : IntegrableOn f (Iic a) μ ↔ IntegrableAtFilter f atBot μ ∧ LocallyIntegrableOn f (Iic a) μ := by refine ⟨fun h ↦ ⟨⟨Iic a, Iic_mem_atBot a, h⟩, h.locallyIntegrableOn⟩, fun ⟨⟨s, hsl, hs⟩, h⟩ ↦ ?_⟩ - haveI : Nonempty X := Nonempty.intro a + have : Nonempty X := Nonempty.intro a obtain ⟨a', ha'⟩ := mem_atBot_sets.mp hsl refine (integrableOn_union.mpr ⟨hs.mono ha' le_rfl, ?_⟩).mono Iic_subset_Iic_union_Icc le_rfl exact h.integrableOn_compact_subset Icc_subset_Iic_self isCompact_Icc diff --git a/Mathlib/MeasureTheory/Function/LpSeminorm/Count.lean b/Mathlib/MeasureTheory/Function/LpSeminorm/Count.lean index 7b081115e69594..fd5d7b12a712c1 100644 --- a/Mathlib/MeasureTheory/Function/LpSeminorm/Count.lean +++ b/Mathlib/MeasureTheory/Function/LpSeminorm/Count.lean @@ -36,7 +36,7 @@ lemma enorm_le_eLpNorm_count (f : α → ε) (i : α) (hp : p ≠ 0) : omit [MeasurableSingletonClass α] in lemma eLpNorm_count_lt_top_of_lt [Finite α] (h : ∀ i, ‖f i‖ₑ < ∞) : eLpNorm f p .count < ∞ := by - haveI := Fintype.ofFinite α + have := Fintype.ofFinite α refine (eLpNorm_mono_enorm (g := fun _ ↦ Finset.univ.sup (‖f ·‖ₑ)) ?_).trans_lt ?_ · exact fun x ↦ Finset.le_sup (f := (‖f ·‖ₑ)) (Finset.mem_univ x) · exact (memLp_const_enorm <| by simp [h, LT.lt.ne]).eLpNorm_lt_top diff --git a/Mathlib/MeasureTheory/Function/LpSeminorm/TriangleInequality.lean b/Mathlib/MeasureTheory/Function/LpSeminorm/TriangleInequality.lean index 563f5f2398056d..a9a9f4f8b8065e 100644 --- a/Mathlib/MeasureTheory/Function/LpSeminorm/TriangleInequality.lean +++ b/Mathlib/MeasureTheory/Function/LpSeminorm/TriangleInequality.lean @@ -144,7 +144,7 @@ theorem MemLp.sub {f g : α → E} (hf : MemLp f p μ) (hg : MemLp g p μ) : Mem theorem memLp_finsetSum [ContinuousAdd ε'] {ι} (s : Finset ι) {f : ι → α → ε'} (hf : ∀ i ∈ s, MemLp (f i) p μ) : MemLp (fun a => ∑ i ∈ s, f i a) p μ := by - haveI : DecidableEq ι := Classical.decEq _ + have : DecidableEq ι := Classical.decEq _ revert hf refine Finset.induction_on s ?_ ?_ · simp diff --git a/Mathlib/MeasureTheory/Function/SimpleFunc.lean b/Mathlib/MeasureTheory/Function/SimpleFunc.lean index 133f5f46b0638a..831b00deb86c9b 100644 --- a/Mathlib/MeasureTheory/Function/SimpleFunc.lean +++ b/Mathlib/MeasureTheory/Function/SimpleFunc.lean @@ -308,7 +308,7 @@ def extend [MeasurableSpace β] (f₁ : α →ₛ γ) (g : α → β) (hg : Meas (f₁.finite_range.union <| f₂.finite_range.subset (image_subset_range _ _)).subset (range_extend_subset _ _ _) measurableSet_fiber' := by - letI : MeasurableSpace γ := ⊤; haveI : MeasurableSingletonClass γ := ⟨fun _ => trivial⟩ + let : MeasurableSpace γ := ⊤; have : MeasurableSingletonClass γ := ⟨fun _ => trivial⟩ exact fun x => hg.measurable_extend f₁.measurable f₂.measurable (measurableSet_singleton _) @[simp] diff --git a/Mathlib/MeasureTheory/Function/SimpleFuncDense.lean b/Mathlib/MeasureTheory/Function/SimpleFuncDense.lean index 6e73d26a9b78c4..bd88e4fb0c77ae 100644 --- a/Mathlib/MeasureTheory/Function/SimpleFuncDense.lean +++ b/Mathlib/MeasureTheory/Function/SimpleFuncDense.lean @@ -131,7 +131,7 @@ theorem approxOn_zero {f : β → α} (hf : Measurable f) {s : Set α} {y₀ : theorem approxOn_mem {f : β → α} (hf : Measurable f) {s : Set α} {y₀ : α} (h₀ : y₀ ∈ s) [SeparableSpace s] (n : ℕ) (x : β) : approxOn f hf s y₀ h₀ n x ∈ s := by - haveI : Nonempty s := ⟨⟨y₀, h₀⟩⟩ + have : Nonempty s := ⟨⟨y₀, h₀⟩⟩ suffices ∀ n, (Nat.casesOn n y₀ ((↑) ∘ denseSeq s) : α) ∈ s by apply this rintro (_ | n) exacts [h₀, Subtype.mem _] @@ -154,7 +154,7 @@ theorem approxOn_comp {γ : Type*} [MeasurableSpace γ] {f : β → α} (hf : Me theorem tendsto_approxOn {f : β → α} (hf : Measurable f) {s : Set α} {y₀ : α} (h₀ : y₀ ∈ s) [SeparableSpace s] {x : β} (hx : f x ∈ closure s) : Tendsto (fun n => approxOn f hf s y₀ h₀ n x) atTop (𝓝 <| f x) := by - haveI : Nonempty s := ⟨⟨y₀, h₀⟩⟩ + have : Nonempty s := ⟨⟨y₀, h₀⟩⟩ rw [← @Subtype.range_coe _ s, ← image_univ, ← (denseRange_denseSeq s).closure_eq] at hx simp -iota only [approxOn, coe_comp] refine tendsto_nearestPt (closure_minimal ?_ isClosed_closure hx) @@ -244,7 +244,7 @@ lemma HasCompactSupport.measurable_of_prod [TopologicalSpace α] [PseudoMetrizableSpace α] [MeasurableSpace α] [BorelSpace α] {f : X × Y → α} (hf : Continuous f) (h'f : HasCompactSupport f) : Measurable f := by - letI : PseudoMetricSpace α := TopologicalSpace.pseudoMetrizableSpacePseudoMetric α + let : PseudoMetricSpace α := TopologicalSpace.pseudoMetrizableSpacePseudoMetric α obtain ⟨u, -, u_pos, u_lim⟩ : ∃ u, StrictAnti u ∧ (∀ (n : ℕ), 0 < u n) ∧ Tendsto u atTop (𝓝 0) := exists_seq_strictAnti_tendsto (0 : ℝ) have : ∀ n, ∃ (g : SimpleFunc (X × Y) α), ∀ x, dist (f x) (g x) < u n := diff --git a/Mathlib/MeasureTheory/Function/SimpleFuncDenseLp.lean b/Mathlib/MeasureTheory/Function/SimpleFuncDenseLp.lean index 26cd321dd22ecd..f0efda5fe33c7b 100644 --- a/Mathlib/MeasureTheory/Function/SimpleFuncDenseLp.lean +++ b/Mathlib/MeasureTheory/Function/SimpleFuncDenseLp.lean @@ -652,7 +652,7 @@ lemma isDenseEmbedding (hp_ne_top : p ≠ ∞) : intro f rw [mem_closure_iff_seq_limit] have hfi' : MemLp f p μ := Lp.memLp f - haveI : SeparableSpace (range f ∪ {0} : Set E) := + have : SeparableSpace (range f ∪ {0} : Set E) := (Lp.stronglyMeasurable f).separableSpace_range_union_singleton refine ⟨fun n => diff --git a/Mathlib/MeasureTheory/Function/StronglyMeasurable/AEStronglyMeasurable.lean b/Mathlib/MeasureTheory/Function/StronglyMeasurable/AEStronglyMeasurable.lean index 2159a038b2d446..2bd25eb785e359 100644 --- a/Mathlib/MeasureTheory/Function/StronglyMeasurable/AEStronglyMeasurable.lean +++ b/Mathlib/MeasureTheory/Function/StronglyMeasurable/AEStronglyMeasurable.lean @@ -674,7 +674,7 @@ theorem _root_.MeasurableEmbedding.aestronglyMeasurable_map_iff {γ : Type*} theorem _root_.Topology.IsEmbedding.aestronglyMeasurable_comp_iff [PseudoMetrizableSpace β] [PseudoMetrizableSpace γ] {g : β → γ} {f : α → β} (hg : IsEmbedding g) : AEStronglyMeasurable (fun x => g (f x)) μ ↔ AEStronglyMeasurable f μ := by - letI := pseudoMetrizableSpacePseudoMetric γ + let := pseudoMetrizableSpacePseudoMetric γ borelize β γ refine ⟨fun H => aestronglyMeasurable_iff_aemeasurable_separable.2 ⟨?_, ?_⟩, fun H => diff --git a/Mathlib/MeasureTheory/Function/StronglyMeasurable/Basic.lean b/Mathlib/MeasureTheory/Function/StronglyMeasurable/Basic.lean index 6f81c159bb59af..3fe4713eab4477 100644 --- a/Mathlib/MeasureTheory/Function/StronglyMeasurable/Basic.lean +++ b/Mathlib/MeasureTheory/Function/StronglyMeasurable/Basic.lean @@ -252,7 +252,7 @@ theorem finStronglyMeasurable_of_set_sigmaFinite [TopologicalSpace β] [Zero β] {m : MeasurableSpace α} {μ : Measure α} (hf_meas : StronglyMeasurable f) {t : Set α} (ht : MeasurableSet t) (hft_zero : ∀ x ∈ tᶜ, f x = 0) (htμ : SigmaFinite (μ.restrict t)) : FinStronglyMeasurable f μ := by - haveI : SigmaFinite (μ.restrict t) := htμ + have : SigmaFinite (μ.restrict t) := htμ let S := spanningSets (μ.restrict t) have hS_meas : ∀ n, MeasurableSet (S n) := measurableSet_spanningSets (μ.restrict t) let f_approx := hf_meas.approx @@ -268,7 +268,7 @@ theorem finStronglyMeasurable_of_set_sigmaFinite [TopologicalSpace β] [Zero β] refine fun n => measure_biUnion_lt_top {y ∈ (fs n).range | y ≠ 0}.finite_toSet fun y hy => ?_ rw [SimpleFunc.restrict_preimage_singleton _ ((hS_meas n).inter ht)] swap - · letI : (y : β) → Decidable (y = 0) := fun y => Classical.propDecidable _ + · let : (y : β) → Decidable (y = 0) := fun y => Classical.propDecidable _ rw [Finset.mem_coe, Finset.mem_filter] at hy exact hy.2 refine (measure_mono Set.inter_subset_left).trans_lt ?_ @@ -685,7 +685,7 @@ variable {mα : MeasurableSpace α} [MeasurableSpace β] theorem _root_.Measurable.stronglyMeasurable [TopologicalSpace β] [PseudoMetrizableSpace β] [SecondCountableTopology β] [OpensMeasurableSpace β] (hf : Measurable f) : StronglyMeasurable f := by - letI := pseudoMetrizableSpacePseudoMetric β + let := pseudoMetrizableSpacePseudoMetric β nontriviality β; inhabit β exact ⟨SimpleFunc.approxOn f hf Set.univ default (Set.mem_univ _), fun x ↦ SimpleFunc.tendsto_approxOn hf (Set.mem_univ _) (by simp)⟩ @@ -732,7 +732,7 @@ theorem _root_.Continuous.stronglyMeasurable_of_mulSupport_subset_isCompact [PseudoMetrizableSpace β] [One β] {f : α → β} (hf : Continuous f) {k : Set α} (hk : IsCompact k) (h'f : mulSupport f ⊆ k) : StronglyMeasurable f := by borelize β - letI : PseudoMetricSpace β := pseudoMetrizableSpacePseudoMetric β + let : PseudoMetricSpace β := pseudoMetrizableSpacePseudoMetric β rw [stronglyMeasurable_iff_measurable_separable] exact ⟨hf.measurable, (isCompact_range_of_mulSupport_subset_isCompact hf hk h'f).isSeparable⟩ @@ -755,14 +755,14 @@ lemma _root_.HasCompactSupport.stronglyMeasurable_of_prod {X Y : Type*} [Zero α StronglyMeasurable f := by borelize α apply stronglyMeasurable_iff_measurable_separable.2 ⟨h'f.measurable_of_prod hf, ?_⟩ - letI : PseudoMetricSpace α := pseudoMetrizableSpacePseudoMetric α + let : PseudoMetricSpace α := pseudoMetrizableSpacePseudoMetric α exact IsCompact.isSeparable (s := range f) (h'f.isCompact_range hf) /-- If `g` is a topological embedding, then `f` is strongly measurable iff `g ∘ f` is. -/ theorem _root_.Embedding.comp_stronglyMeasurable_iff {m : MeasurableSpace α} [TopologicalSpace β] [PseudoMetrizableSpace β] [TopologicalSpace γ] [PseudoMetrizableSpace γ] {g : β → γ} {f : α → β} (hg : IsEmbedding g) : (StronglyMeasurable fun x => g (f x)) ↔ StronglyMeasurable f := by - letI := pseudoMetrizableSpacePseudoMetric γ + let := pseudoMetrizableSpacePseudoMetric γ borelize β γ refine ⟨fun H => stronglyMeasurable_iff_measurable_separable.2 ⟨?_, ?_⟩, fun H => diff --git a/Mathlib/MeasureTheory/Function/StronglyMeasurable/Lp.lean b/Mathlib/MeasureTheory/Function/StronglyMeasurable/Lp.lean index 9655fb43723819..1e7699373db071 100644 --- a/Mathlib/MeasureTheory/Function/StronglyMeasurable/Lp.lean +++ b/Mathlib/MeasureTheory/Function/StronglyMeasurable/Lp.lean @@ -43,7 +43,7 @@ theorem MemLp.finStronglyMeasurable_of_stronglyMeasurable (hf : MemLp f p μ) (hf_meas : StronglyMeasurable f) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) : FinStronglyMeasurable f μ := by borelize G - haveI : SeparableSpace (Set.range f ∪ {0} : Set G) := + have : SeparableSpace (Set.range f ∪ {0} : Set G) := hf_meas.separableSpace_range_union_singleton let fs := SimpleFunc.approxOn f hf_meas.measurable (Set.range f ∪ {0}) 0 (by simp) refine ⟨fs, ?_, ?_⟩ diff --git a/Mathlib/MeasureTheory/Group/AddCircle.lean b/Mathlib/MeasureTheory/Group/AddCircle.lean index 1274c8372799de..a15d9fa162de53 100644 --- a/Mathlib/MeasureTheory/Group/AddCircle.lean +++ b/Mathlib/MeasureTheory/Group/AddCircle.lean @@ -80,7 +80,7 @@ theorem isAddFundamentalDomain_of_ae_ball (I : Set <| AddCircle T) (u x : AddCir exact fun g => quasiMeasurePreserving_add_left (G := AddCircle T) volume g · -- `volume univ ≤ ∑' (g : G), volume (g +ᵥ I)` replace hI := hI.trans closedBall_ae_eq_ball.symm - haveI : Fintype G := @Fintype.ofFinite _ hu.finite_zmultiples.to_subtype + have : Fintype G := @Fintype.ofFinite _ hu.finite_zmultiples.to_subtype have hG_card : #(Finset.univ : Finset G) = n := by change _ = addOrderOf u rw [← Nat.card_zmultiples, Nat.card_eq_fintype_card]; rfl @@ -96,7 +96,7 @@ theorem volume_of_add_preimage_eq (s I : Set <| AddCircle T) (u x : AddCircle T) (hI : I =ᵐ[volume] ball x (T / (2 * addOrderOf u))) : volume s = addOrderOf u • volume (s ∩ I) := by let G := AddSubgroup.zmultiples u - haveI : Fintype G := @Fintype.ofFinite _ hu.finite_zmultiples.to_subtype + have : Fintype G := @Fintype.ofFinite _ hu.finite_zmultiples.to_subtype have hsG : ∀ g : G, (g +ᵥ s : Set <| AddCircle T) =ᵐ[volume] s := by rintro ⟨y, hy⟩; exact (vadd_ae_eq_self_of_mem_zmultiples hs hy :) rw [(isAddFundamentalDomain_of_ae_ball I u x hu hI).measure_eq_card_smul_of_vadd_ae_eq_self s hsG, diff --git a/Mathlib/MeasureTheory/Group/FundamentalDomain.lean b/Mathlib/MeasureTheory/Group/FundamentalDomain.lean index 02badc202cc9f3..630d98de3b4891 100644 --- a/Mathlib/MeasureTheory/Group/FundamentalDomain.lean +++ b/Mathlib/MeasureTheory/Group/FundamentalDomain.lean @@ -287,7 +287,7 @@ is determined by the measure of its intersection with a fundamental domain for t its intersection with a fundamental domain for the action of `G`. -/] theorem measure_eq_card_smul_of_smul_ae_eq_self [Finite G] (h : IsFundamentalDomain G s μ) (t : Set α) (ht : ∀ g : G, (g • t : Set α) =ᵐ[μ] t) : μ t = Nat.card G • μ (t ∩ s) := by - haveI : Fintype G := Fintype.ofFinite G + have : Fintype G := Fintype.ofFinite G rw [h.measure_eq_tsum] replace ht : ∀ g : G, (g • t ∩ s : Set α) =ᵐ[μ] (t ∩ s : Set α) := fun g => ae_eq_set_inter (ht g) (ae_eq_refl s) @@ -783,7 +783,7 @@ theorem IsFundamentalDomain.measurePreserving_quotient_mk MeasurePreserving π (ν.restrict 𝓕) μ where measurable := measurable_quotient_mk' (s := α_mod_G) map_eq := by - haveI : HasFundamentalDomain G α ν := ⟨𝓕, h𝓕⟩ + have : HasFundamentalDomain G α ν := ⟨𝓕, h𝓕⟩ rw [h𝓕.projection_respects_measure (μ := μ)] variable [SMulInvariantMeasure G α ν] [Countable G] [MeasurableConstSMul G α] diff --git a/Mathlib/MeasureTheory/Integral/Asymptotics.lean b/Mathlib/MeasureTheory/Integral/Asymptotics.lean index e942352e0cca11..f7b8fdb328bba5 100644 --- a/Mathlib/MeasureTheory/Integral/Asymptotics.lean +++ b/Mathlib/MeasureTheory/Integral/Asymptotics.lean @@ -72,7 +72,7 @@ theorem IsBigO.eventually_integrableOn [Norm F] obtain ⟨u, hu, v, hv, huv⟩ := Filter.mem_prod_iff.mp htl obtain ⟨w, hwl, hw⟩ := hfm.exists_mem refine eventually_iff_exists_mem.mpr ⟨w ∩ v, inter_mem hwl hv, fun x hx ↦ ?_⟩ - haveI : IsFiniteMeasure (μ.restrict s) := ⟨Measure.restrict_apply_univ s ▸ hμ⟩ + have : IsFiniteMeasure (μ.restrict s) := ⟨Measure.restrict_apply_univ s ▸ hμ⟩ refine Integrable.mono' (integrable_const (C * ‖g x‖)) (hw x hx.1) ?_ filter_upwards [MeasureTheory.self_mem_ae_restrict hs] intro y hy diff --git a/Mathlib/MeasureTheory/Integral/Average.lean b/Mathlib/MeasureTheory/Integral/Average.lean index 4e604f32d5840e..f3829d379218fa 100644 --- a/Mathlib/MeasureTheory/Integral/Average.lean +++ b/Mathlib/MeasureTheory/Integral/Average.lean @@ -379,7 +379,7 @@ theorem average_pair [CompleteSpace E] theorem measure_smul_setAverage (f : α → E) {s : Set α} (h : μ s ≠ ∞) : μ.real s • ⨍ x in s, f x ∂μ = ∫ x in s, f x ∂μ := by - haveI := Fact.mk h.lt_top + have := Fact.mk h.lt_top rw [← measure_smul_average, measureReal_restrict_apply_univ] theorem average_union {f : α → E} {s t : Set α} (hd : AEDisjoint μ s t) (ht : NullMeasurableSet t μ) @@ -387,7 +387,7 @@ theorem average_union {f : α → E} {s t : Set α} (hd : AEDisjoint μ s t) (ht ⨍ x in s ∪ t, f x ∂μ = (μ.real s / (μ.real s + μ.real t)) • ⨍ x in s, f x ∂μ + (μ.real t / (μ.real s + μ.real t)) • ⨍ x in t, f x ∂μ := by - haveI := Fact.mk hsμ.lt_top; haveI := Fact.mk htμ.lt_top + have := Fact.mk hsμ.lt_top; have := Fact.mk htμ.lt_top rw [restrict_union₀ hd ht, average_add_measure hfs hft, measureReal_restrict_apply_univ, measureReal_restrict_apply_univ] @@ -500,7 +500,7 @@ theorem measure_le_setAverage_pos (hμ : μ s ≠ 0) (hμ₁ : μ s ≠ ∞) (hf replace H : (μ.restrict s) {x | f x ≤ ⨍ a in s, f a ∂μ} = 0 := by rwa [restrict_apply₀, inter_comm] exact AEStronglyMeasurable.nullMeasurableSet_le hf.1 aestronglyMeasurable_const - haveI := Fact.mk hμ₁.lt_top + have := Fact.mk hμ₁.lt_top refine (integral_sub_average (μ.restrict s) f).not_gt ?_ refine (setIntegral_pos_iff_support_of_nonneg_ae ?_ ?_).2 ?_ · refine measure_mono_null (fun x hx ↦ ?_) H diff --git a/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean b/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean index 64877fbe3b945b..5aab70490dd61e 100644 --- a/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean +++ b/Mathlib/MeasureTheory/Integral/Bochner/Basic.lean @@ -1269,7 +1269,7 @@ theorem integral_trim (hm : m ≤ m0) {f : β → G} (hf : StronglyMeasurable[m] · have hf_int_m : ¬Integrable f (μ.trim hm) := fun hf_int_m => hf_int (integrable_of_integrable_trim hm hf_int_m) rw [integral_undef hf_int, integral_undef hf_int_m] - haveI : SeparableSpace (range f ∪ {0} : Set G) := hf.separableSpace_range_union_singleton + have : SeparableSpace (range f ∪ {0} : Set G) := hf.separableSpace_range_union_singleton let f_seq := @SimpleFunc.approxOn G β _ _ _ m _ hf.measurable (range f ∪ {0}) 0 (by simp) _ have hf_seq_meas : ∀ n, StronglyMeasurable[m] (f_seq n) := fun n => @SimpleFunc.stronglyMeasurable β G m _ (f_seq n) @@ -1325,7 +1325,7 @@ theorem eLpNorm_one_le_of_le {r : ℝ≥0} (hfint : Integrable f μ) (hfint' : 0 · exact le_top · simp [hr] · simp - haveI := hμ + have := hμ rw [integral_eq_integral_pos_part_sub_integral_neg_part hfint, sub_nonneg] at hfint' have hposbdd : ∫ ω, max (f ω) 0 ∂μ ≤ μ.real Set.univ • (r : ℝ) := by rw [← integral_const] diff --git a/Mathlib/MeasureTheory/Integral/Bochner/Set.lean b/Mathlib/MeasureTheory/Integral/Bochner/Set.lean index b1dce490b5b59a..30d05807d0b676 100644 --- a/Mathlib/MeasureTheory/Integral/Bochner/Set.lean +++ b/Mathlib/MeasureTheory/Integral/Bochner/Set.lean @@ -588,7 +588,7 @@ theorem setIntegral_map_equiv {Y} [MeasurableSpace Y] (e : X ≃ᵐ Y) (f : Y theorem norm_setIntegral_le_of_norm_le_const_ae {C : ℝ} (hs : μ s < ∞) (hC : ∀ᵐ x ∂μ.restrict s, ‖f x‖ ≤ C) : ‖∫ x in s, f x ∂μ‖ ≤ C * μ.real s := by rw [← Measure.restrict_apply_univ] at * - haveI : IsFiniteMeasure (μ.restrict s) := ⟨hs⟩ + have : IsFiniteMeasure (μ.restrict s) := ⟨hs⟩ simpa using norm_integral_le_of_norm_le_const hC theorem norm_setIntegral_le_of_norm_le_const_ae' {C : ℝ} (hs : μ s < ∞) @@ -1010,7 +1010,7 @@ theorem LpToLpRestrictCLM_coeFn [Fact (1 ≤ p)] (s : Set X) (f : Lp F p μ) : @[continuity] theorem continuous_setIntegral [NormedSpace ℝ E] (s : Set X) : Continuous fun f : X →₁[μ] E => ∫ x in s, f x ∂μ := by - haveI : Fact ((1 : ℝ≥0∞) ≤ 1) := ⟨le_rfl⟩ + have : Fact ((1 : ℝ≥0∞) ≤ 1) := ⟨le_rfl⟩ have h_comp : (fun f : X →₁[μ] E => ∫ x in s, f x ∂μ) = integral (μ.restrict s) ∘ fun f => LpToLpRestrictCLM X E ℝ μ 1 s f := by diff --git a/Mathlib/MeasureTheory/Integral/CurveIntegral/Basic.lean b/Mathlib/MeasureTheory/Integral/CurveIntegral/Basic.lean index dd62fc98ff3080..f0909f581d93b8 100644 --- a/Mathlib/MeasureTheory/Integral/CurveIntegral/Basic.lean +++ b/Mathlib/MeasureTheory/Integral/CurveIntegral/Basic.lean @@ -309,7 +309,7 @@ theorem curveIntegral_segment [NormedSpace ℝ E] [NormedSpace ℝ F] (ω : E @[simp] theorem curveIntegral_segment_const [NormedSpace ℝ E] [CompleteSpace F] (ω : E →L[𝕜] F) (a b : E) : ∫ᶜ _ in .segment a b, ω = ω (b - a) := by - letI : NormedSpace ℝ F := .restrictScalars ℝ 𝕜 F + let : NormedSpace ℝ F := .restrictScalars ℝ 𝕜 F simp [curveIntegral_segment] /-- If `‖ω z‖ ≤ C` at all points of the segment `[a -[ℝ] b]`, @@ -317,7 +317,7 @@ then the curve integral `∫ᶜ x in .segment a b, ω x` has norm at most `C * theorem norm_curveIntegral_segment_le [NormedSpace ℝ E] {C : ℝ} (h : ∀ z ∈ [a -[ℝ] b], ‖ω z‖ ≤ C) : ‖∫ᶜ x in .segment a b, ω x‖ ≤ C * ‖b - a‖ := calc ‖∫ᶜ x in .segment a b, ω x‖ ≤ C * ‖b - a‖ * |1 - 0| := by - letI : NormedSpace ℝ F := .restrictScalars ℝ 𝕜 F + let : NormedSpace ℝ F := .restrictScalars ℝ 𝕜 F rw [curveIntegral_segment] refine intervalIntegral.norm_integral_le_of_norm_le_const fun t ht ↦ ?_ rw [segment_eq_image_lineMap] at h @@ -360,7 +360,7 @@ protected theorem CurveIntegrable.add (h₁ : CurveIntegrable ω₁ γ) (h₂ : -- TODO: `to_fun` generates wrong lemma name theorem curveIntegral_add (h₁ : CurveIntegrable ω₁ γ) (h₂ : CurveIntegrable ω₂ γ) : curveIntegral (ω₁ + ω₂) γ = ∫ᶜ x in γ, ω₁ x + ∫ᶜ x in γ, ω₂ x := by - letI : NormedSpace ℝ F := .restrictScalars ℝ 𝕜 F + let : NormedSpace ℝ F := .restrictScalars ℝ 𝕜 F simp only [curveIntegral, curveIntegralFun_add] exact intervalIntegral.integral_add h₁ h₂ @@ -436,7 +436,7 @@ variable {𝕝 : Type*} [RCLike 𝕝] [NormedSpace 𝕝 F] [NormedSpace 𝕝 E] theorem curveIntegralFun_restrictScalars : curveIntegralFun (fun t ↦ (ω t).restrictScalars 𝕝) γ = curveIntegralFun ω γ := by ext - letI : NormedSpace ℝ E := .restrictScalars ℝ 𝕜 E + let : NormedSpace ℝ E := .restrictScalars ℝ 𝕜 E simp [curveIntegralFun_def] @[simp] @@ -447,7 +447,7 @@ theorem curveIntegrable_restrictScalars_iff : @[simp] theorem curveIntegral_restrictScalars : ∫ᶜ x in γ, (ω x).restrictScalars 𝕝 = ∫ᶜ x in γ, ω x := by - letI : NormedSpace ℝ F := .restrictScalars ℝ 𝕜 F + let : NormedSpace ℝ F := .restrictScalars ℝ 𝕜 F simp [curveIntegral_def] end RestrictScalars @@ -473,7 +473,7 @@ theorem curveIntegrable_smul_iff : CurveIntegrable (c • ω) γ ↔ c = 0 ∨ C @[simp] theorem curveIntegral_smul : curveIntegral (c • ω) γ = c • curveIntegral ω γ := by - letI : NormedSpace ℝ F := .restrictScalars ℝ 𝕜 F + let : NormedSpace ℝ F := .restrictScalars ℝ 𝕜 F simp [curveIntegral_def, intervalIntegral.integral_smul] @[simp] diff --git a/Mathlib/MeasureTheory/Integral/CurveIntegral/Poincare.lean b/Mathlib/MeasureTheory/Integral/CurveIntegral/Poincare.lean index 0a2ea18dc93e94..a87cb3a0d2a5d2 100644 --- a/Mathlib/MeasureTheory/Integral/CurveIntegral/Poincare.lean +++ b/Mathlib/MeasureTheory/Integral/CurveIntegral/Poincare.lean @@ -395,7 +395,7 @@ variable [CompleteSpace E] {f : 𝕜 → E} {s : Set 𝕜} then it admits a primitive. -/ theorem exists_forall_hasDerivWithinAt (hs : Convex ℝ s) (hf : DifferentiableOn 𝕜 f s) : ∃ g : 𝕜 → E, ∀ a ∈ s, HasDerivWithinAt g (f a) s a := by - letI : NormedSpace ℝ E := .restrictScalars ℝ 𝕜 E + let : NormedSpace ℝ E := .restrictScalars ℝ 𝕜 E apply hs.exists_forall_hasFDerivWithinAt_of_hasFDerivWithinAt_symmetric · intro a ha exact (ContinuousLinearMap.smulRightL 𝕜 𝕜 E 1).hasFDerivAt diff --git a/Mathlib/MeasureTheory/Integral/FinMeasAdditive.lean b/Mathlib/MeasureTheory/Integral/FinMeasAdditive.lean index 1a9b39c030e3d8..934e06eb232299 100644 --- a/Mathlib/MeasureTheory/Integral/FinMeasAdditive.lean +++ b/Mathlib/MeasureTheory/Integral/FinMeasAdditive.lean @@ -606,7 +606,7 @@ theorem setToSimpleFunc_indicator (T : Set α → F →L[ℝ] F') (hT_empty : T setToSimpleFunc_zero_apply] simp_rw [setToSimpleFunc] obtain rfl | hs_univ := eq_or_ne s univ - · haveI hα := hs_empty.to_type + · have hα := hs_empty.to_type simp [← Function.const_def] rw [range_indicator hs hs_empty hs_univ] by_cases hx0 : x = 0 diff --git a/Mathlib/MeasureTheory/Integral/IntegrableOn.lean b/Mathlib/MeasureTheory/Integral/IntegrableOn.lean index f487a4f34cfd7c..cc0a24004fb02a 100644 --- a/Mathlib/MeasureTheory/Integral/IntegrableOn.lean +++ b/Mathlib/MeasureTheory/Integral/IntegrableOn.lean @@ -470,7 +470,7 @@ theorem integrableOn_Lp_of_measure_ne_top {E} [NormedAddCommGroup E] {p : ℝ≥ refine memLp_one_iff_integrable.mp ?_ have hμ_restrict_univ : (μ.restrict s) Set.univ < ∞ := by simpa only [Set.univ_inter, MeasurableSet.univ, Measure.restrict_apply, lt_top_iff_ne_top] - haveI hμ_finite : IsFiniteMeasure (μ.restrict s) := ⟨hμ_restrict_univ⟩ + have hμ_finite : IsFiniteMeasure (μ.restrict s) := ⟨hμ_restrict_univ⟩ exact ((Lp.memLp _).restrict s).mono_exponent hp theorem Integrable.lintegral_lt_top {f : α → ℝ} (hf : Integrable f μ) : @@ -749,7 +749,7 @@ theorem ContinuousOn.aestronglyMeasurable_of_isSeparable [TopologicalSpace α] [PseudoMetrizableSpace β] {f : α → β} {s : Set α} {μ : Measure α} (hf : ContinuousOn f s) (hs : MeasurableSet s) (h's : TopologicalSpace.IsSeparable s) : AEStronglyMeasurable f (μ.restrict s) := by - letI := pseudoMetrizableSpacePseudoMetric α + let := pseudoMetrizableSpacePseudoMetric α borelize β rw [aestronglyMeasurable_iff_aemeasurable_separable] refine ⟨hf.aemeasurable hs, f '' s, hf.isSeparable_image h's, ?_⟩ diff --git a/Mathlib/MeasureTheory/Integral/IntervalIntegral/FundThmCalculus.lean b/Mathlib/MeasureTheory/Integral/IntervalIntegral/FundThmCalculus.lean index 4faffca6cfa62f..6cb4b260335c09 100644 --- a/Mathlib/MeasureTheory/Integral/IntervalIntegral/FundThmCalculus.lean +++ b/Mathlib/MeasureTheory/Integral/IntervalIntegral/FundThmCalculus.lean @@ -398,7 +398,7 @@ theorem measure_integral_sub_integral_sub_linear_isLittleO_of_tendsto_ae ((∫ x in va t..vb t, f x ∂μ) - ∫ x in ua t..ub t, f x ∂μ) - ((∫ _ in ub t..vb t, cb ∂μ) - ∫ _ in ua t..va t, ca ∂μ)) =o[lt] fun t => ‖∫ _ in ua t..va t, (1 : ℝ) ∂μ‖ + ‖∫ _ in ub t..vb t, (1 : ℝ) ∂μ‖ := by - haveI := FTCFilter.meas_gen la; haveI := FTCFilter.meas_gen lb + have := FTCFilter.meas_gen la; have := FTCFilter.meas_gen lb refine ((measure_integral_sub_linear_isLittleO_of_tendsto_ae hmeas_a ha_lim hua hva).neg_left.add_add (measure_integral_sub_linear_isLittleO_of_tendsto_ae hmeas_b hb_lim hub hvb)).congr' diff --git a/Mathlib/MeasureTheory/Integral/IntervalIntegral/IntegrationByParts.lean b/Mathlib/MeasureTheory/Integral/IntervalIntegral/IntegrationByParts.lean index 358f01e9d06fb1..b19f15eb3d8637 100644 --- a/Mathlib/MeasureTheory/Integral/IntervalIntegral/IntegrationByParts.lean +++ b/Mathlib/MeasureTheory/Integral/IntervalIntegral/IntegrationByParts.lean @@ -269,7 +269,7 @@ theorem integral_deriv_smul_comp''' (hf : ContinuousOn f [[a, b]]) exact hf.surjOn_uIcc left_mem_uIcc (Ioo_subset_Icc_self hx) have h3g : StronglyMeasurableAtFilter g (𝓝[J] f x) := hg_cont.stronglyMeasurableAtFilter_nhdsWithin measurableSet_Icc (f x) - haveI : Fact (f x ∈ J) := ⟨h2x⟩ + have : Fact (f x ∈ J) := ⟨h2x⟩ have : HasDerivWithinAt (fun u ↦ ∫ x in f a..u, g x) (g (f x)) J (f x) := intervalIntegral.integral_hasDerivWithinAt_right h2g h3g (hg_cont (f x) h2x) refine (this.scomp x ((hff' x hx).Ioo_of_Ioi hd.1) ?_).Ioi_of_Ioo hd.1 diff --git a/Mathlib/MeasureTheory/Integral/IntervalIntegral/Periodic.lean b/Mathlib/MeasureTheory/Integral/IntervalIntegral/Periodic.lean index dfcd118af50d5e..ba16fc6a18c571 100644 --- a/Mathlib/MeasureTheory/Integral/IntervalIntegral/Periodic.lean +++ b/Mathlib/MeasureTheory/Integral/IntervalIntegral/Periodic.lean @@ -350,7 +350,7 @@ theorem intervalIntegral_add_eq (hf : Periodic f T) (t s : ℝ) : simpa only [← sub_eq_add_neg, add_sub_cancel_right] using this hf.neg (t + T) (s + T) (by aesop : 0 < -T) simp only [integral_of_le, hT.le, le_add_iff_nonneg_right] - haveI : VAddInvariantMeasure (AddSubgroup.zmultiples T) ℝ volume := + have : VAddInvariantMeasure (AddSubgroup.zmultiples T) ℝ volume := ⟨fun c s _ => measure_preimage_add _ _ _⟩ apply IsAddFundamentalDomain.setIntegral_eq (G := AddSubgroup.zmultiples T) exacts [isAddFundamentalDomain_Ioc hT t, isAddFundamentalDomain_Ioc hT s, hf.map_vadd_zmultiples] diff --git a/Mathlib/MeasureTheory/Integral/Lebesgue/Basic.lean b/Mathlib/MeasureTheory/Integral/Lebesgue/Basic.lean index 2ea6517fac6fcb..8244a70061a28d 100644 --- a/Mathlib/MeasureTheory/Integral/Lebesgue/Basic.lean +++ b/Mathlib/MeasureTheory/Integral/Lebesgue/Basic.lean @@ -588,7 +588,7 @@ theorem lintegral_iUnion [Countable β] {s : β → Set α} (hm : ∀ i, Measura theorem lintegral_biUnion₀ {t : Set β} {s : β → Set α} (ht : t.Countable) (hm : ∀ i ∈ t, NullMeasurableSet (s i) μ) (hd : t.Pairwise (AEDisjoint μ on s)) (f : α → ℝ≥0∞) : ∫⁻ a in ⋃ i ∈ t, s i, f a ∂μ = ∑' i : t, ∫⁻ a in s i, f a ∂μ := by - haveI := ht.toEncodable + have := ht.toEncodable rw [biUnion_eq_iUnion, lintegral_iUnion₀ (SetCoe.forall'.1 hm) (hd.subtype _ _)] theorem lintegral_biUnion {t : Set β} {s : β → Set α} (ht : t.Countable) diff --git a/Mathlib/MeasureTheory/Integral/SetToL1.lean b/Mathlib/MeasureTheory/Integral/SetToL1.lean index 4dd785826d3770..b01e9957e1dd42 100644 --- a/Mathlib/MeasureTheory/Integral/SetToL1.lean +++ b/Mathlib/MeasureTheory/Integral/SetToL1.lean @@ -1408,7 +1408,7 @@ theorem StronglyMeasurable.setToFun_prod_right {β : Type*} {mβ : MeasurableSpa by_cases hF : CompleteSpace F; swap; · simp [setToFun, hF, stronglyMeasurable_const] borelize E - haveI : SeparableSpace (range (Function.uncurry f) ∪ {0} : Set E) := + have : SeparableSpace (range (Function.uncurry f) ∪ {0} : Set E) := hf.separableSpace_range_union_singleton let s : ℕ → SimpleFunc (β × α) E := SimpleFunc.approxOn _ hf.measurable (range (Function.uncurry f) ∪ {0}) 0 (by simp) diff --git a/Mathlib/MeasureTheory/MeasurableSpace/CountablyGenerated.lean b/Mathlib/MeasureTheory/MeasurableSpace/CountablyGenerated.lean index cdb6f9017c6a3c..532e06a0b45274 100644 --- a/Mathlib/MeasureTheory/MeasurableSpace/CountablyGenerated.lean +++ b/Mathlib/MeasureTheory/MeasurableSpace/CountablyGenerated.lean @@ -100,7 +100,7 @@ theorem CountablyGenerated.comap [m : MeasurableSpace β] [h : CountablyGenerate @CountablyGenerated α (.comap f m) := by rcases h with ⟨⟨b, hbc, rfl⟩⟩ rw [comap_generateFrom] - letI := generateFrom (preimage f '' b) + let := generateFrom (preimage f '' b) exact ⟨_, hbc.image _, rfl⟩ theorem CountablyGenerated.sup {m₁ m₂ : MeasurableSpace β} (h₁ : @CountablyGenerated β m₁) @@ -282,7 +282,7 @@ then this is witnessed by sets in `S`. -/ theorem separating_of_generateFrom (S : Set (Set α)) [h : @SeparatesPoints α (generateFrom S)] : ∀ x y : α, (∀ s ∈ S, x ∈ s ↔ y ∈ s) → x = y := by - letI := generateFrom S + let := generateFrom S intro x y hxy rw [← forall_generateFrom_mem_iff_mem_iff] at hxy exact separatesPoints_def <| fun _ hs ↦ (hxy _ hs).mp diff --git a/Mathlib/MeasureTheory/MeasurableSpace/MeasurablyGenerated.lean b/Mathlib/MeasureTheory/MeasurableSpace/MeasurablyGenerated.lean index 5c6f705086b839..f00d8bdb7368a8 100644 --- a/Mathlib/MeasureTheory/MeasurableSpace/MeasurablyGenerated.lean +++ b/Mathlib/MeasureTheory/MeasurableSpace/MeasurablyGenerated.lean @@ -33,7 +33,7 @@ namespace MeasurableSpace @[simp] theorem generateFrom_singleton (s : Set α) : generateFrom {s} = MeasurableSpace.comap (· ∈ s) ⊤ := by classical - letI : MeasurableSpace α := generateFrom {s} + let : MeasurableSpace α := generateFrom {s} refine le_antisymm (generateFrom_le fun t ht => ⟨{True}, trivial, by simp [ht.symm]⟩) ?_ rintro _ ⟨u, -, rfl⟩ exact (show MeasurableSet s from GenerateMeasurable.basic _ <| mem_singleton s).mem trivial @@ -132,7 +132,7 @@ instance iInf_isMeasurablyGenerated {f : ι → Filter α} [∀ i, IsMeasurablyG refine ⟨⋂ i : t, U i, ?_, ?_, ?_⟩ · rw [← Equiv.plift.surjective.iInf_comp, mem_iInf] exact ⟨t, ht, U, hUf, rfl⟩ - · haveI := ht.countable.toEncodable.countable + · have := ht.countable.toEncodable.countable exact MeasurableSet.iInter fun i => (hU i).1 · exact iInter_mono fun i => (hU i).2 diff --git a/Mathlib/MeasureTheory/Measure/AEMeasurable.lean b/Mathlib/MeasureTheory/Measure/AEMeasurable.lean index 3905185f5bf840..cd80effcb4f1be 100644 --- a/Mathlib/MeasureTheory/Measure/AEMeasurable.lean +++ b/Mathlib/MeasureTheory/Measure/AEMeasurable.lean @@ -243,7 +243,7 @@ end AEMeasurable theorem aemeasurable_const' (h : ∀ᵐ (x) (y) ∂μ, f x = f y) : AEMeasurable f μ := by rcases eq_or_ne μ 0 with (rfl | hμ) · exact aemeasurable_zero_measure - · haveI := ae_neBot.2 hμ + · have := ae_neBot.2 hμ rcases h.exists with ⟨x, hx⟩ exact ⟨const α (f x), measurable_const, EventuallyEq.symm hx⟩ @@ -306,7 +306,7 @@ theorem aemeasurable_Ioi_of_forall_Ioc {β} {mβ : MeasurableSpace β} [LinearOr [(atTop : Filter α).IsCountablyGenerated] {x : α} {g : α → β} (g_meas : ∀ t > x, AEMeasurable g (μ.restrict (Ioc x t))) : AEMeasurable g (μ.restrict (Ioi x)) := by - haveI : Nonempty α := ⟨x⟩ + have : Nonempty α := ⟨x⟩ obtain ⟨u, hu_tendsto⟩ := exists_seq_tendsto (atTop : Filter α) have Ioi_eq_iUnion : Ioi x = ⋃ n : ℕ, Ioc x (u n) := by rw [iUnion_Ioc_eq_Ioi_self_iff.mpr _] diff --git a/Mathlib/MeasureTheory/Measure/Content.lean b/Mathlib/MeasureTheory/Measure/Content.lean index 284f7f517b31fb..7e76aa87c9b382 100644 --- a/Mathlib/MeasureTheory/Measure/Content.lean +++ b/Mathlib/MeasureTheory/Measure/Content.lean @@ -320,7 +320,7 @@ theorem borel_le_caratheodory : S ≤ μ.outerMeasure.caratheodory := by rw [μ.outerMeasure_of_isOpen ((U' : Set G) ∩ U) (U'.isOpen.inter hU)] simp only [innerContent, iSup_subtype'] rw [Opens.coe_mk] - haveI : Nonempty { L : Compacts G // (L : Set G) ⊆ U' ∩ U } := ⟨⟨⊥, empty_subset _⟩⟩ + have : Nonempty { L : Compacts G // (L : Set G) ⊆ U' ∩ U } := ⟨⟨⊥, empty_subset _⟩⟩ rw [ENNReal.iSup_add] refine iSup_le ?_ rintro ⟨L, hL⟩ @@ -335,7 +335,7 @@ theorem borel_le_caratheodory : S ≤ μ.outerMeasure.caratheodory := by rw [μ.outerMeasure_of_isOpen (↑U' \ L') (IsOpen.sdiff U'.2 isClosed_closure)] simp only [innerContent, iSup_subtype'] rw [Opens.coe_mk] - haveI : Nonempty { M : Compacts G // (M : Set G) ⊆ ↑U' \ closure L } := ⟨⟨⊥, empty_subset _⟩⟩ + have : Nonempty { M : Compacts G // (M : Set G) ⊆ ↑U' \ closure L } := ⟨⟨⊥, empty_subset _⟩⟩ rw [ENNReal.add_iSup] refine iSup_le ?_ rintro ⟨M, hM⟩ diff --git a/Mathlib/MeasureTheory/Measure/FiniteMeasureExt.lean b/Mathlib/MeasureTheory/Measure/FiniteMeasureExt.lean index 4117ad9a102fb8..4236ff5b808afc 100644 --- a/Mathlib/MeasureTheory/Measure/FiniteMeasureExt.lean +++ b/Mathlib/MeasureTheory/Measure/FiniteMeasureExt.lean @@ -73,7 +73,7 @@ theorem ext_of_forall_mem_subalgebra_integral_eq_of_polish [TopologicalSpace E] [BorelSpace E] {P P' : Measure E} [IsFiniteMeasure P] [IsFiniteMeasure P'] {A : StarSubalgebra 𝕜 (E →ᵇ 𝕜)} (hA : (A.map (toContinuousMapStarₐ 𝕜)).SeparatesPoints) (heq : ∀ g ∈ A, ∫ x, (g : E → 𝕜) x ∂P = ∫ x, (g : E → 𝕜) x ∂P') : P = P' := by - letI := TopologicalSpace.upgradeIsCompletelyMetrizable E + let := TopologicalSpace.upgradeIsCompletelyMetrizable E exact ext_of_forall_mem_subalgebra_integral_eq_of_pseudoEMetric_complete_countable hA heq end MeasureTheory diff --git a/Mathlib/MeasureTheory/Measure/FiniteMeasurePi.lean b/Mathlib/MeasureTheory/Measure/FiniteMeasurePi.lean index 8a2fc542a13335..3f849138663f48 100644 --- a/Mathlib/MeasureTheory/Measure/FiniteMeasurePi.lean +++ b/Mathlib/MeasureTheory/Measure/FiniteMeasurePi.lean @@ -104,7 +104,7 @@ theorem continuous_pi [∀ i, TopologicalSpace (α i)] [∀ i, SecondCountableTo apply this.tendsto_probabilityMeasure_of_tendsto_of_mem · rintro - ⟨s, rfl, smeas, hs⟩ exact MeasurableSet.univ_pi smeas - · letI : ∀ i, PseudoMetricSpace (α i) := + · let : ∀ i, PseudoMetricSpace (α i) := fun i ↦ TopologicalSpace.pseudoMetrizableSpacePseudoMetric (α i) intro u u_open x xu obtain ⟨ε, εpos, hε⟩ : ∃ ε > 0, ball x ε ⊆ u := Metric.isOpen_iff.1 u_open x xu diff --git a/Mathlib/MeasureTheory/Measure/FiniteMeasureProd.lean b/Mathlib/MeasureTheory/Measure/FiniteMeasureProd.lean index c80dbc9d83fc47..a34f6dda00349d 100644 --- a/Mathlib/MeasureTheory/Measure/FiniteMeasureProd.lean +++ b/Mathlib/MeasureTheory/Measure/FiniteMeasureProd.lean @@ -165,8 +165,8 @@ theorem continuous_prod [TopologicalSpace α] [TopologicalSpace β] [SecondCount apply this.tendsto_probabilityMeasure_of_tendsto_of_mem · rintro s ⟨a, b, ameas, -, bmeas, -, rfl⟩ exact ameas.prod bmeas - · letI : PseudoMetricSpace α := TopologicalSpace.pseudoMetrizableSpacePseudoMetric α - letI : PseudoMetricSpace β := TopologicalSpace.pseudoMetrizableSpacePseudoMetric β + · let : PseudoMetricSpace α := TopologicalSpace.pseudoMetrizableSpacePseudoMetric α + let : PseudoMetricSpace β := TopologicalSpace.pseudoMetrizableSpacePseudoMetric β intro u u_open x xu obtain ⟨ε, εpos, hε⟩ : ∃ ε > 0, ball x ε ⊆ u := Metric.isOpen_iff.1 u_open x xu rcases exists_null_frontier_thickening (μ.1 : Measure α) {x.1} εpos with ⟨r, hr, μr⟩ diff --git a/Mathlib/MeasureTheory/Measure/Haar/Basic.lean b/Mathlib/MeasureTheory/Measure/Haar/Basic.lean index 0d5daf17221d2e..58fa735b161aff 100644 --- a/Mathlib/MeasureTheory/Measure/Haar/Basic.lean +++ b/Mathlib/MeasureTheory/Measure/Haar/Basic.lean @@ -536,7 +536,7 @@ instance isMulLeftInvariant_haarMeasure (K₀ : PositiveCompacts G) : @[to_additive] theorem haarMeasure_self {K₀ : PositiveCompacts G} : haarMeasure K₀ K₀ = 1 := by - haveI : LocallyCompactSpace G := K₀.locallyCompactSpace_of_group + have : LocallyCompactSpace G := K₀.locallyCompactSpace_of_group simp only [haarMeasure, coe_smul, Pi.smul_apply, smul_eq_mul] rw [← K₀.isCompact.measure_closure, Content.measure_apply _ isClosed_closure.measurableSet, ENNReal.inv_mul_cancel] @@ -546,7 +546,7 @@ theorem haarMeasure_self {K₀ : PositiveCompacts G} : haarMeasure K₀ K₀ = 1 /-- The Haar measure is regular. -/ @[to_additive /-- The additive Haar measure is regular. -/] instance regular_haarMeasure {K₀ : PositiveCompacts G} : (haarMeasure K₀).Regular := by - haveI : LocallyCompactSpace G := K₀.locallyCompactSpace_of_group + have : LocallyCompactSpace G := K₀.locallyCompactSpace_of_group apply Regular.smul rw [← K₀.isCompact.measure_closure, Content.measure_apply _ isClosed_closure.measurableSet, ENNReal.inv_ne_top] @@ -560,7 +560,7 @@ theorem haarMeasure_closure_self {K₀ : PositiveCompacts G} : haarMeasure K₀ @[to_additive /-- The additive Haar measure is sigma-finite in a second countable group. -/] instance sigmaFinite_haarMeasure [SecondCountableTopology G] {K₀ : PositiveCompacts G} : SigmaFinite (haarMeasure K₀) := by - haveI : LocallyCompactSpace G := K₀.locallyCompactSpace_of_group; infer_instance + have : LocallyCompactSpace G := K₀.locallyCompactSpace_of_group; infer_instance /-- The Haar measure is a Haar measure, i.e., it is invariant and gives finite mass to compact sets and positive mass to nonempty open sets. -/ diff --git a/Mathlib/MeasureTheory/Measure/Haar/InnerProductSpace.lean b/Mathlib/MeasureTheory/Measure/Haar/InnerProductSpace.lean index 6fdb13e36dee52..ec56bf802a7533 100644 --- a/Mathlib/MeasureTheory/Measure/Haar/InnerProductSpace.lean +++ b/Mathlib/MeasureTheory/Measure/Haar/InnerProductSpace.lean @@ -81,7 +81,7 @@ end parallelepiped spanned by any orthonormal basis. -/ theorem OrthonormalBasis.volume_parallelepiped (b : OrthonormalBasis ι ℝ F) : volume (parallelepiped b) = 1 := by - haveI : Fact (finrank ℝ F = finrank ℝ F) := ⟨rfl⟩ + have : Fact (finrank ℝ F = finrank ℝ F) := ⟨rfl⟩ let o := (stdOrthonormalBasis ℝ F).toBasis.orientation rw [← o.measure_eq_volume] exact o.measure_orthonormalBasis b diff --git a/Mathlib/MeasureTheory/Measure/Haar/Quotient.lean b/Mathlib/MeasureTheory/Measure/Haar/Quotient.lean index 568e8541bf3d58..a1cc1f702576b1 100644 --- a/Mathlib/MeasureTheory/Measure/Haar/Quotient.lean +++ b/Mathlib/MeasureTheory/Measure/Haar/Quotient.lean @@ -159,7 +159,7 @@ theorem MeasureTheory.Measure.IsMulLeftInvariant.quotientMeasureEqMeasurePreimag ext U _ have meas_π : Measurable (QuotientGroup.mk : G → G ⧸ Γ) := continuous_quotient_mk'.measurable let μ' : Measure (G ⧸ Γ) := (ν.restrict s).map π - haveI has_fund : HasFundamentalDomain Γ.op G ν := ⟨⟨s, fund_dom_s⟩⟩ + have has_fund : HasFundamentalDomain Γ.op G ν := ⟨⟨s, fund_dom_s⟩⟩ have i : QuotientMeasureEqMeasurePreimage ν μ' := fund_dom_s.quotientMeasureEqMeasurePreimage_quotientMeasure have : μ'.IsMulLeftInvariant := @@ -222,7 +222,7 @@ theorem MeasureTheory.QuotientMeasureEqMeasurePreimage.haarMeasure_quotient [Loc obtain ⟨K⟩ := PositiveCompacts.nonempty' (α := G) let K' : PositiveCompacts (G ⧸ Γ) := K.map π QuotientGroup.continuous_mk QuotientGroup.isOpenMap_coe - haveI : IsMulLeftInvariant μ := + have : IsMulLeftInvariant μ := MeasureTheory.QuotientMeasureEqMeasurePreimage.mulInvariantMeasure_quotient ν rw [haarMeasure_unique μ K'] have finiteCovol : covolume Γ.op G ν ≠ ⊤ := @@ -293,7 +293,7 @@ theorem IsFundamentalDomain.QuotientMeasureEqMeasurePreimage_smulHaarMeasure { have c_ne_top : c ≠ ∞ := measure_inter_ne_top_of_right_ne_top h𝓕_finite set μ := c • haarMeasure K have hμK : μ K = c := by simp [μ, haarMeasure_self] - haveI : SigmaFinite μ := by + have : SigmaFinite μ := by clear_value c lift c to NNReal using c_ne_top exact SMul.sigmaFinite c diff --git a/Mathlib/MeasureTheory/Measure/HasOuterApproxClosed.lean b/Mathlib/MeasureTheory/Measure/HasOuterApproxClosed.lean index 82b1e677a1f03b..2ef5d93cf2b87b 100644 --- a/Mathlib/MeasureTheory/Measure/HasOuterApproxClosed.lean +++ b/Mathlib/MeasureTheory/Measure/HasOuterApproxClosed.lean @@ -217,7 +217,7 @@ end HasOuterApproxClosed --namespace noncomputable instance (X : Type*) [TopologicalSpace X] [TopologicalSpace.PseudoMetrizableSpace X] : HasOuterApproxClosed X := by - letI : PseudoMetricSpace X := TopologicalSpace.pseudoMetrizableSpacePseudoMetric X + let : PseudoMetricSpace X := TopologicalSpace.pseudoMetrizableSpacePseudoMetric X refine ⟨fun F hF ↦ ?_⟩ use fun n ↦ thickenedIndicator (δ := (1 : ℝ) / (n + 1)) Nat.one_div_pos_of_nat F refine ⟨?_, ⟨?_, ?_⟩⟩ diff --git a/Mathlib/MeasureTheory/Measure/Hausdorff.lean b/Mathlib/MeasureTheory/Measure/Hausdorff.lean index 8a42736fa80c53..d109983459085d 100644 --- a/Mathlib/MeasureTheory/Measure/Hausdorff.lean +++ b/Mathlib/MeasureTheory/Measure/Hausdorff.lean @@ -500,7 +500,7 @@ theorem mkMetric_le_liminf_tsum {β : Type*} {ι : β → Type*} [∀ n, Countab {l : Filter β} (r : β → ℝ≥0∞) (hr : Tendsto r l (𝓝 0)) (t : ∀ n : β, ι n → Set X) (ht : ∀ᶠ n in l, ∀ i, ediam (t n i) ≤ r n) (hst : ∀ᶠ n in l, s ⊆ ⋃ i, t n i) (m : ℝ≥0∞ → ℝ≥0∞) : mkMetric m s ≤ liminf (fun n => ∑' i, m (ediam (t n i))) l := by - haveI : ∀ n, Encodable (ι n) := fun n => Encodable.ofCountable _ + have : ∀ n, Encodable (ι n) := fun n => Encodable.ofCountable _ simp only [mkMetric_apply] refine iSup₂_le fun ε hε => ?_ refine le_of_forall_gt_imp_ge_of_dense fun c hc => ?_ @@ -651,7 +651,7 @@ theorem hausdorffMeasure_le_one_of_subsingleton {s : Set X} (hs : s.Subsingleton · rw [(subsingleton_iff_singleton hx).1 hs] rcases eq_or_lt_of_le hd with (rfl | dpos) · simp only [le_refl, hausdorffMeasure_zero_singleton] - · haveI := nullSingletonClass_hausdorff X dpos + · have := nullSingletonClass_hausdorff X dpos simp only [zero_le, measure_singleton] end Measure @@ -689,7 +689,7 @@ theorem hausdorffMeasure_image_le (h : HolderOnWith C r f s) (hr : 0 < r) {d : · simp only [ENNReal.rpow_zero, one_mul, mul_zero] rw [hausdorffMeasure_zero_singleton] exact one_le_hausdorffMeasure_zero_of_nonempty ⟨x, hx⟩ - · haveI := nullSingletonClass_hausdorff Y h'd + · have := nullSingletonClass_hausdorff Y h'd simp only [zero_le, measure_singleton] -- Now assume `C ≠ 0` · have hCd0 : (C : ℝ≥0∞) ^ d ≠ 0 := by simp [hC0.ne'] @@ -771,7 +771,7 @@ theorem hausdorffMeasure_preimage_le (hf : AntilipschitzWith K f) (hd : 0 ≤ d) · rcases eq_empty_or_nonempty (f ⁻¹' s) with (hs | ⟨x, hx⟩) · simp only [hs, measure_empty, zero_le] have : f ⁻¹' s = {x} := by - haveI : Subsingleton X := hf.subsingleton + have : Subsingleton X := hf.subsingleton have : (f ⁻¹' s).Subsingleton := subsingleton_univ.anti (subset_univ _) exact (subsingleton_iff_singleton hx).1 this rw [this] @@ -779,7 +779,7 @@ theorem hausdorffMeasure_preimage_le (hf : AntilipschitzWith K f) (hd : 0 ≤ d) · simp only [ENNReal.rpow_zero, one_mul] rw [hausdorffMeasure_zero_singleton] exact one_le_hausdorffMeasure_zero_of_nonempty ⟨f x, hx⟩ - · haveI := nullSingletonClass_hausdorff X h'd + · have := nullSingletonClass_hausdorff X h'd simp only [zero_le, measure_singleton] have hKd0 : (K : ℝ≥0∞) ^ d ≠ 0 := by simp [h0] have hKd : (K : ℝ≥0∞) ^ d ≠ ∞ := by simp [hd] @@ -1027,7 +1027,7 @@ theorem hausdorffMeasure_smul_right_image [NormedAddCommGroup E] [NormedSpace [MeasurableSpace E] [BorelSpace E] (v : E) (s : Set ℝ) : μH[1] ((fun r => r • v) '' s) = ‖v‖₊ • μH[1] s := by obtain rfl | hv := eq_or_ne v 0 - · haveI := nullSingletonClass_hausdorff E one_pos + · have := nullSingletonClass_hausdorff E one_pos obtain rfl | hs := s.eq_empty_or_nonempty · simp simp [hs] diff --git a/Mathlib/MeasureTheory/Measure/Lebesgue/Basic.lean b/Mathlib/MeasureTheory/Measure/Lebesgue/Basic.lean index 817ddd25d63ce9..e1301292f1006f 100644 --- a/Mathlib/MeasureTheory/Measure/Lebesgue/Basic.lean +++ b/Mathlib/MeasureTheory/Measure/Lebesgue/Basic.lean @@ -52,7 +52,7 @@ variable {ι : Type*} [Fintype ι] /-- The volume on the real line (as a particular case of the volume on a finite-dimensional inner product space) coincides with the Stieltjes measure coming from the identity function. -/ theorem volume_eq_stieltjes_id : (volume : Measure ℝ) = StieltjesFunction.id.measure := by - haveI : IsAddLeftInvariant StieltjesFunction.id.measure := + have : IsAddLeftInvariant StieltjesFunction.id.measure := ⟨fun a => Eq.symm <| Real.measure_ext_Ioo_rat fun p q => by diff --git a/Mathlib/MeasureTheory/Measure/Lebesgue/EqHaar.lean b/Mathlib/MeasureTheory/Measure/Lebesgue/EqHaar.lean index 0f79b4b9d11fa6..c22322acd7ddfc 100644 --- a/Mathlib/MeasureTheory/Measure/Lebesgue/EqHaar.lean +++ b/Mathlib/MeasureTheory/Measure/Lebesgue/EqHaar.lean @@ -233,7 +233,7 @@ theorem map_linearMap_addHaar_eq_smul_addHaar {f : E →ₗ[ℝ] E} (hf : Linear -- we reduce to the case of `E = ι → ℝ`, for which we have already proved the result using -- matrices in `map_linearMap_addHaar_pi_eq_smul_addHaar`. let ι := Fin (finrank ℝ E) - haveI : FiniteDimensional ℝ (ι → ℝ) := by infer_instance + have : FiniteDimensional ℝ (ι → ℝ) := by infer_instance have : finrank ℝ E = finrank ℝ (ι → ℝ) := by simp [ι] have e : E ≃ₗ[ℝ] ι → ℝ := LinearEquiv.ofFinrankEq E (ι → ℝ) this -- next line is to avoid `g` getting reduced by `simp`. @@ -249,7 +249,7 @@ theorem map_linearMap_addHaar_eq_smul_addHaar {f : E →ₗ[ℝ] E} (hf : Linear have Cg : Continuous g := LinearMap.continuous_of_finiteDimensional g have Cesymm : Continuous e.symm := (e.symm : (ι → ℝ) →ₗ[ℝ] E).continuous_of_finiteDimensional rw [← map_map Cesymm.measurable (Cg.comp Ce).measurable, ← map_map Cg.measurable Ce.measurable] - haveI : IsAddHaarMeasure (map e μ) := (e : E ≃+ (ι → ℝ)).isAddHaarMeasure_map μ Ce Cesymm + have : IsAddHaarMeasure (map e μ) := (e : E ≃+ (ι → ℝ)).isAddHaarMeasure_map μ Ce Cesymm have ecomp : e.symm ∘ e = id := by ext x; simp only [id, Function.comp_apply, LinearEquiv.symm_apply_apply] rw [map_linearMap_addHaar_pi_eq_smul_addHaar hf (map e μ), Measure.map_smul, @@ -367,10 +367,10 @@ theorem addHaar_smul (r : ℝ) (s : Set E) : · simp only [measure_empty, mul_zero, smul_set_empty] rw [zero_smul_set hs, ← singleton_zero] by_cases h : finrank ℝ E = 0 - · haveI : Subsingleton E := finrank_zero_iff.1 h + · have : Subsingleton E := finrank_zero_iff.1 h simp only [h, one_mul, ENNReal.ofReal_one, abs_one, Subsingleton.eq_univ_of_nonempty hs, pow_zero, Subsingleton.eq_univ_of_nonempty (singleton_nonempty (0 : E))] - · haveI : Nontrivial E := nontrivial_of_finrank_pos (bot_lt_iff_ne_bot.2 h) + · have : Nontrivial E := nontrivial_of_finrank_pos (bot_lt_iff_ne_bot.2 h) simp only [h, zero_mul, ENNReal.ofReal_zero, abs_zero, Ne, not_false_iff, zero_pow, measure_singleton] diff --git a/Mathlib/MeasureTheory/Measure/Lebesgue/VolumeOfBalls.lean b/Mathlib/MeasureTheory/Measure/Lebesgue/VolumeOfBalls.lean index 81fef1f10b6d72..2aeca2034d8903 100644 --- a/Mathlib/MeasureTheory/Measure/Lebesgue/VolumeOfBalls.lean +++ b/Mathlib/MeasureTheory/Measure/Lebesgue/VolumeOfBalls.lean @@ -80,13 +80,13 @@ theorem MeasureTheory.measure_lt_one_eq_integral_div_gamma {p : ℝ} (hp : 0 < p μ {x : E | g x < 1} = .ofReal ((∫ (x : E), Real.exp (-(g x) ^ p) ∂μ) / Real.Gamma (finrank ℝ E / p + 1)) := by -- We copy `E` to a new type `F` on which we will put the norm defined by `g` - letI F : Type _ := E + let F : Type _ := E let p : AddGroupNorm F := ⟨⟨g, h1, h3, h2⟩, fun x hx ↦ h4 hx⟩ - letI : NormedAddCommGroup F := AddGroupNorm.toNormedAddCommGroup p - letI : NormedSpace ℝ F := { norm_smul_le := fun _ _ ↦ h5 _ _ } + let : NormedAddCommGroup F := AddGroupNorm.toNormedAddCommGroup p + let : NormedSpace ℝ F := { norm_smul_le := fun _ _ ↦ h5 _ _ } -- We put the new topology on F - letI : TopologicalSpace F := UniformSpace.toTopologicalSpace - letI : MeasurableSpace F := borel F + let : TopologicalSpace F := UniformSpace.toTopologicalSpace + let : MeasurableSpace F := borel F have : BorelSpace F := { measurable_eq := rfl } -- The map between `E` and `F` as a continuous linear equivalence let φ := @LinearEquiv.toContinuousLinearEquiv ℝ _ E _ _ tE _ _ F _ _ _ _ _ _ _ _ _ @@ -113,13 +113,13 @@ theorem MeasureTheory.measure_lt_one_eq_integral_div_gamma {p : ℝ} (hp : 0 < p theorem MeasureTheory.measure_le_eq_lt [Nontrivial E] (r : ℝ) : μ {x : E | g x ≤ r} = μ {x : E | g x < r} := by -- We copy `E` to a new type `F` on which we will put the norm defined by `g` - letI F : Type _ := E + let F : Type _ := E let p : AddGroupNorm F := ⟨⟨g, h1, h3, h2⟩, fun x hx ↦ h4 hx⟩ - letI : NormedAddCommGroup F := AddGroupNorm.toNormedAddCommGroup p - letI : NormedSpace ℝ F := { norm_smul_le := fun _ _ ↦ h5 _ _ } + let : NormedAddCommGroup F := AddGroupNorm.toNormedAddCommGroup p + let : NormedSpace ℝ F := { norm_smul_le := fun _ _ ↦ h5 _ _ } -- We put the new topology on F - letI : TopologicalSpace F := UniformSpace.toTopologicalSpace - letI : MeasurableSpace F := borel F + let : TopologicalSpace F := UniformSpace.toTopologicalSpace + let : MeasurableSpace F := borel F have : BorelSpace F := { measurable_eq := rfl } -- The map between `E` and `F` as a continuous linear equivalence let φ := @LinearEquiv.toContinuousLinearEquiv ℝ _ E _ _ tE _ _ F _ _ _ _ _ _ _ _ _ diff --git a/Mathlib/MeasureTheory/Measure/LevyConvergence.lean b/Mathlib/MeasureTheory/Measure/LevyConvergence.lean index 4294777be177cd..debad61a4c309c 100644 --- a/Mathlib/MeasureTheory/Measure/LevyConvergence.lean +++ b/Mathlib/MeasureTheory/Measure/LevyConvergence.lean @@ -158,7 +158,7 @@ lemma ProbabilityMeasure.tendsto_of_tight_of_separatesPoints (𝕜 : Type*) [RCL {A : StarSubalgebra 𝕜 (E →ᵇ 𝕜)} (hA : (A.map (toContinuousMapStarₐ 𝕜)).SeparatesPoints) (hμ : ∀ g ∈ A, Tendsto (fun n ↦ ∫ x, g x ∂(μ n)) 𝓕 (𝓝 (∫ x, g x ∂μ₀))) : Tendsto μ 𝓕 (𝓝 μ₀) := by - letI := TopologicalSpace.upgradeIsCompletelyMetrizable E + let := TopologicalSpace.upgradeIsCompletelyMetrizable E obtain rfl | _ := 𝓕.eq_or_neBot · simp refine (Filter.tendsto_iff_ultrafilter _ _ _).2 fun U hU ↦ ?_ diff --git a/Mathlib/MeasureTheory/Measure/LevyProkhorovMetric.lean b/Mathlib/MeasureTheory/Measure/LevyProkhorovMetric.lean index c33e6c53d47498..d3a7b39bf86c01 100644 --- a/Mathlib/MeasureTheory/Measure/LevyProkhorovMetric.lean +++ b/Mathlib/MeasureTheory/Measure/LevyProkhorovMetric.lean @@ -695,7 +695,7 @@ instance (X : Type*) [TopologicalSpace X] [PseudoMetrizableSpace X] [SeparableSp instance instMetrizableSpaceProbabilityMeasure (X : Type*) [TopologicalSpace X] [PseudoMetrizableSpace X] [SeparableSpace X] [MeasurableSpace X] [BorelSpace X] : MetrizableSpace (ProbabilityMeasure X) := by - letI : PseudoMetricSpace X := TopologicalSpace.pseudoMetrizableSpacePseudoMetric X + let : PseudoMetricSpace X := TopologicalSpace.pseudoMetrizableSpacePseudoMetric X exact LevyProkhorov.probabilityMeasureHomeomorph.isEmbedding.metrizableSpace end Levy_Prokhorov_metrizes_convergence_in_distribution diff --git a/Mathlib/MeasureTheory/Measure/MeasureSpace.lean b/Mathlib/MeasureTheory/Measure/MeasureSpace.lean index 11af89700356d5..6bc4c96d4b6017 100644 --- a/Mathlib/MeasureTheory/Measure/MeasureSpace.lean +++ b/Mathlib/MeasureTheory/Measure/MeasureSpace.lean @@ -160,7 +160,7 @@ theorem measure_add_measure_compl (h : MeasurableSet s) : μ s + μ sᶜ = μ un theorem measure_biUnion₀ {s : Set β} {f : β → Set α} (hs : s.Countable) (hd : s.Pairwise (AEDisjoint μ on f)) (h : ∀ b ∈ s, NullMeasurableSet (f b) μ) : μ (⋃ b ∈ s, f b) = ∑' p : s, μ (f p) := by - haveI := hs.toEncodable + have := hs.toEncodable rw [biUnion_eq_iUnion] exact measure_iUnion₀ (hd.on_injective Subtype.coe_injective fun x => x.2) fun x => h x x.2 @@ -411,7 +411,7 @@ theorem measure_iUnion_toMeasurable {ι : Sort*} [Countable ι] (s : ι → Set theorem measure_biUnion_toMeasurable {I : Set β} (hc : I.Countable) (s : β → Set α) : μ (⋃ b ∈ I, toMeasurable μ (s b)) = μ (⋃ b ∈ I, s b) := by - haveI := hc.toEncodable + have := hc.toEncodable simp only [biUnion_eq_iUnion, measure_iUnion_toMeasurable] @[simp] @@ -542,7 +542,7 @@ theorem measure_iUnion_eq_iSup_accumulate [Preorder ι] [IsDirectedOrder ι] theorem measure_biUnion_eq_iSup {s : ι → Set α} {t : Set ι} (ht : t.Countable) (hd : DirectedOn ((· ⊆ ·) on s) t) : μ (⋃ i ∈ t, s i) = ⨆ i ∈ t, μ (s i) := by - haveI := ht.to_subtype + have := ht.to_subtype rw [biUnion_eq_iUnion, hd.directed_val.measure_iUnion, ← iSup_subtype''] /-- **Continuity from above**: diff --git a/Mathlib/MeasureTheory/Measure/Portmanteau.lean b/Mathlib/MeasureTheory/Measure/Portmanteau.lean index e64bd9c2ba8bb3..1a39a02bffa3a1 100644 --- a/Mathlib/MeasureTheory/Measure/Portmanteau.lean +++ b/Mathlib/MeasureTheory/Measure/Portmanteau.lean @@ -435,7 +435,7 @@ lemma limsup_measure_closed_le_of_forall_tendsto_measure Tendsto (fun i ↦ μs i E) L (𝓝 (μ E))) (F : Set Ω) (F_closed : IsClosed F) : L.limsup (fun i ↦ μs i F) ≤ μ F := by - letI : PseudoMetricSpace Ω := TopologicalSpace.pseudoMetrizableSpacePseudoMetric Ω + let : PseudoMetricSpace Ω := TopologicalSpace.pseudoMetrizableSpacePseudoMetric Ω rcases L.eq_or_neBot with rfl | _ · simp only [limsup_bot, bot_eq_zero', zero_le] have ex := exists_null_frontiers_thickening μ F diff --git a/Mathlib/MeasureTheory/Measure/Prod.lean b/Mathlib/MeasureTheory/Measure/Prod.lean index 2f3c5ca3e1db60..cf5dd69edca651 100644 --- a/Mathlib/MeasureTheory/Measure/Prod.lean +++ b/Mathlib/MeasureTheory/Measure/Prod.lean @@ -576,7 +576,7 @@ theorem prod_eq_generateFrom {μ : Measure α} {ν : Measure β} {C : Set (Set (generateFrom_eq_prod hC hD h3C.isCountablySpanning h3D.isCountablySpanning).symm (h2C.prod h2D) ?_ rintro _ ⟨s, hs, t, ht, rfl⟩ - haveI := h3D.sigmaFinite + have := h3D.sigmaFinite rw [h₁ s hs t ht, prod_prod] /- Note that the next theorem is not true for s-finite measures: let `μ = ν = ∞ • Leb` on `[0,1]` diff --git a/Mathlib/MeasureTheory/Measure/Regular.lean b/Mathlib/MeasureTheory/Measure/Regular.lean index fb81fe7c2f5584..e7f1eb7f5721a5 100644 --- a/Mathlib/MeasureTheory/Measure/Regular.lean +++ b/Mathlib/MeasureTheory/Measure/Regular.lean @@ -1060,7 +1060,7 @@ theorem _root_.MeasurableSet.measure_eq_iSup_isClosed_of_ne_top [WeaklyRegular weakly regular. -/ theorem restrict_of_measure_ne_top [BorelSpace α] [WeaklyRegular μ] {A : Set α} (h'A : μ A ≠ ∞) : WeaklyRegular (μ.restrict A) := by - haveI : Fact (μ A < ∞) := ⟨h'A.lt_top⟩ + have : Fact (μ A < ∞) := ⟨h'A.lt_top⟩ refine InnerRegularWRT.weaklyRegular_of_finite (μ.restrict A) (fun V V_open r hr ↦ ?_) have : InnerRegularWRT (μ.restrict A) IsClosed (fun s ↦ MeasurableSet s) := InnerRegularWRT.restrict_of_measure_ne_top innerRegular_measurable h'A @@ -1088,7 +1088,7 @@ instance (priority := 100) of_pseudoMetrizableSpace_secondCountable_of_locallyFi ⟨InnerRegularWRT.of_pseudoMetrizableSpace μ⟩ protected theorem smul [WeaklyRegular μ] {x : ℝ≥0∞} (hx : x ≠ ∞) : (x • μ).WeaklyRegular := by - haveI := OuterRegular.smul μ hx + have := OuterRegular.smul μ hx exact ⟨WeaklyRegular.innerRegular.smul x⟩ instance smul_nnreal [WeaklyRegular μ] (c : ℝ≥0) : WeaklyRegular (c • μ) := @@ -1124,8 +1124,8 @@ instance (priority := 100) [Regular μ] : InnerRegularCompactLTTop μ := protected theorem map [BorelSpace α] [MeasurableSpace β] [TopologicalSpace β] [BorelSpace β] [Regular μ] (f : α ≃ₜ β) : (Measure.map f μ).Regular := by - haveI := OuterRegular.map f μ - haveI := IsFiniteMeasureOnCompacts.map μ f + have := OuterRegular.map f μ + have := IsFiniteMeasureOnCompacts.map μ f exact ⟨Regular.innerRegular.map' f.toMeasurableEquiv (fun U hU => hU.preimage f.continuous) @@ -1143,8 +1143,8 @@ open Topology in protected theorem comap' [BorelSpace α] {mβ : MeasurableSpace β} [TopologicalSpace β] [BorelSpace β] (μ : Measure β) [Regular μ] {f : α → β} (hf : IsOpenEmbedding f) : (μ.comap f).Regular := by - haveI := OuterRegular.comap' μ hf.continuous hf.measurableEmbedding - haveI := IsFiniteMeasureOnCompacts.comap' μ hf.continuous hf.measurableEmbedding + have := OuterRegular.comap' μ hf.continuous hf.measurableEmbedding + have := IsFiniteMeasureOnCompacts.comap' μ hf.continuous hf.measurableEmbedding exact ⟨InnerRegularWRT.comap Regular.innerRegular hf.measurableEmbedding (fun _ hU ↦ hf.isOpen_iff_image_isOpen.mp hU) (fun _ hKrange hK ↦ hf.isInducing.isCompact_preimage' hK hKrange)⟩ @@ -1154,8 +1154,8 @@ protected theorem comap [BorelSpace α] {mβ : MeasurableSpace β} [TopologicalS Regular.comap' μ f.isOpenEmbedding protected theorem smul [Regular μ] {x : ℝ≥0∞} (hx : x ≠ ∞) : (x • μ).Regular := by - haveI := OuterRegular.smul μ hx - haveI := IsFiniteMeasureOnCompacts.smul μ hx + have := OuterRegular.smul μ hx + have := IsFiniteMeasureOnCompacts.smul μ hx exact ⟨Regular.innerRegular.smul x⟩ instance smul_nnreal [Regular μ] (c : ℝ≥0) : Regular (c • μ) := Regular.smul coe_ne_top diff --git a/Mathlib/MeasureTheory/Measure/RegularityCompacts.lean b/Mathlib/MeasureTheory/Measure/RegularityCompacts.lean index 31eda309cefffb..604fffdc981283 100644 --- a/Mathlib/MeasureTheory/Measure/RegularityCompacts.lean +++ b/Mathlib/MeasureTheory/Measure/RegularityCompacts.lean @@ -101,7 +101,7 @@ theorem exists_isCompact_closure_measure_compl_lt [TopologicalSpace α] of natural numbers `u n`, such that `interUnionBalls seq u t`, which is the intersection over `n` of the `t n`-neighborhood of `seq 1, ..., seq (u n)`, covers the space arbitrarily well. -/ - letI := upgradeIsCompletelyPseudoMetrizable α + let := upgradeIsCompletelyPseudoMetrizable α cases isEmpty_or_nonempty α case inl => refine ⟨∅, by simp, ?_⟩ diff --git a/Mathlib/MeasureTheory/Measure/Restrict.lean b/Mathlib/MeasureTheory/Measure/Restrict.lean index 8c50c7c32662ea..64f7cae76c64bb 100644 --- a/Mathlib/MeasureTheory/Measure/Restrict.lean +++ b/Mathlib/MeasureTheory/Measure/Restrict.lean @@ -394,7 +394,7 @@ theorem restrict_iUnion_congr [Countable ι] {s : ι → Set α} : theorem restrict_biUnion_congr {s : Set ι} {t : ι → Set α} (hc : s.Countable) : μ.restrict (⋃ i ∈ s, t i) = ν.restrict (⋃ i ∈ s, t i) ↔ ∀ i ∈ s, μ.restrict (t i) = ν.restrict (t i) := by - haveI := hc.toEncodable + have := hc.toEncodable simp only [biUnion_eq_iUnion, SetCoe.forall', restrict_iUnion_congr] theorem restrict_sUnion_congr {S : Set (Set α)} (hc : S.Countable) : @@ -557,7 +557,7 @@ theorem ae_restrict_union_eq (s t : Set α) : theorem ae_restrict_biUnion_eq (s : ι → Set α) {t : Set ι} (ht : t.Countable) : ae (μ.restrict (⋃ i ∈ t, s i)) = ⨆ i ∈ t, ae (μ.restrict (s i)) := by - haveI := ht.to_subtype + have := ht.to_subtype rw [biUnion_eq_iUnion, ae_restrict_iUnion_eq, ← iSup_subtype''] theorem ae_restrict_biUnion_finset_eq (s : ι → Set α) (t : Finset ι) : diff --git a/Mathlib/MeasureTheory/Measure/Typeclasses/Finite.lean b/Mathlib/MeasureTheory/Measure/Typeclasses/Finite.lean index 18fff318c3ff61..ff9b25f67c9c75 100644 --- a/Mathlib/MeasureTheory/Measure/Typeclasses/Finite.lean +++ b/Mathlib/MeasureTheory/Measure/Typeclasses/Finite.lean @@ -430,7 +430,7 @@ theorem ext_on_measurableSpace_of_generate_finite {α} (m₀ : MeasurableSpace [IsFiniteMeasure μ] (C : Set (Set α)) (hμν : ∀ s ∈ C, μ s = ν s) {m : MeasurableSpace α} (h : m ≤ m₀) (hA : m = MeasurableSpace.generateFrom C) (hC : IsPiSystem C) (h_univ : μ Set.univ = ν Set.univ) {s : Set α} (hs : MeasurableSet[m] s) : μ s = ν s := by - haveI : IsFiniteMeasure ν := by + have : IsFiniteMeasure ν := by constructor rw [← h_univ] apply IsFiniteMeasure.measure_univ_lt_top diff --git a/Mathlib/MeasureTheory/Measure/Typeclasses/NullSingletonClass.lean b/Mathlib/MeasureTheory/Measure/Typeclasses/NullSingletonClass.lean index 05a501fdba695a..d760ba899effb4 100644 --- a/Mathlib/MeasureTheory/Measure/Typeclasses/NullSingletonClass.lean +++ b/Mathlib/MeasureTheory/Measure/Typeclasses/NullSingletonClass.lean @@ -94,7 +94,7 @@ theorem exists_accPt_of_nullSingletonClass {X : Type*} [TopologicalSpace X] [Mea {μ : Measure X} [NullSingletonClass μ] {E : Set X} [SeparableSpace E] (hE : 0 < μ E) : ∃ x, AccPt x (𝓟 E) := by by_contra! h - haveI : DiscreteTopology E := discreteTopology_of_noAccPts fun x _ => h x + have : DiscreteTopology E := discreteTopology_of_noAccPts fun x _ => h x exact hE.ne' <| (Set.countable_coe_iff.mp <| separableSpace_iff_countable.mp ‹_›).measure_zero μ @[deprecated (since := "2026-06-09")] diff --git a/Mathlib/MeasureTheory/Measure/Typeclasses/SFinite.lean b/Mathlib/MeasureTheory/Measure/Typeclasses/SFinite.lean index 4be87e7cb30e9e..bb8950924f987c 100644 --- a/Mathlib/MeasureTheory/Measure/Typeclasses/SFinite.lean +++ b/Mathlib/MeasureTheory/Measure/Typeclasses/SFinite.lean @@ -594,7 +594,7 @@ lemma Measure.sigmaFinite_iff_measure_singleton_lt_top [Countable α] : theorem sigmaFinite_bot_iff (μ : @Measure α ⊥) : SigmaFinite μ ↔ IsFiniteMeasure μ := by refine ⟨fun h => ⟨?_⟩, fun h => by infer_instance⟩ - haveI : SigmaFinite μ := h + have : SigmaFinite μ := h let s := spanningSets μ have hs_univ : ⋃ i, s i = Set.univ := iUnion_spanningSets μ have hs_meas : ∀ i, MeasurableSet[⊥] (s i) := measurableSet_spanningSets μ diff --git a/Mathlib/MeasureTheory/OuterMeasure/OfFunction.lean b/Mathlib/MeasureTheory/OuterMeasure/OfFunction.lean index 42836f08747de6..18d825d93554b2 100644 --- a/Mathlib/MeasureTheory/OuterMeasure/OfFunction.lean +++ b/Mathlib/MeasureTheory/OuterMeasure/OfFunction.lean @@ -230,7 +230,7 @@ theorem restrict_ofFunction (s : Set α) (hm : Monotone m) : theorem smul_ofFunction {c : ℝ≥0∞} (hc : c ≠ ∞) : c • OuterMeasure.ofFunction m m_empty = OuterMeasure.ofFunction (c • m) (by simp [m_empty]) := by ext1 s - haveI : Nonempty { t : ℕ → Set α // s ⊆ ⋃ i, t i } := ⟨⟨fun _ => s, subset_iUnion (fun _ => s) 0⟩⟩ + have : Nonempty { t : ℕ → Set α // s ⊆ ⋃ i, t i } := ⟨⟨fun _ => s, subset_iUnion (fun _ => s) 0⟩⟩ simp only [smul_apply, ofFunction_apply, ENNReal.tsum_mul_left, Pi.smul_apply, smul_eq_mul, iInf_subtype'] rw [ENNReal.mul_iInf fun h => (hc h).elim] @@ -391,7 +391,7 @@ the minimum value of a measure on that set: it is the infimum sum of measures of sets that covers that set, where a different measure can be used for each set in the cover. -/ theorem biInf_apply {ι} {I : Set ι} (hI : I.Nonempty) (m : ι → OuterMeasure α) (s : Set α) : (⨅ i ∈ I, m i) s = ⨅ (t : ℕ → Set α) (_ : s ⊆ iUnion t), ∑' n, ⨅ i ∈ I, m i (t n) := by - haveI := hI.to_subtype + have := hI.to_subtype simp only [← iInf_subtype'', iInf_apply] /-- The value of the Infimum of a nonempty family of outer measures on a set is not simply @@ -433,7 +433,7 @@ theorem map_iInf_comap {ι β} [Nonempty ι] {f : α → β} (m : ι → OuterMe theorem map_biInf_comap {ι β} {I : Set ι} (hI : I.Nonempty) {f : α → β} (m : ι → OuterMeasure β) : map f (⨅ i ∈ I, comap f (m i)) = ⨅ i ∈ I, map f (comap f (m i)) := by - haveI := hI.to_subtype + have := hI.to_subtype rw [← iInf_subtype'', ← iInf_subtype''] exact map_iInf_comap _ @@ -450,7 +450,7 @@ theorem restrict_iInf {ι} [Nonempty ι] (s : Set α) (m : ι → OuterMeasure theorem restrict_biInf {ι} {I : Set ι} (hI : I.Nonempty) (s : Set α) (m : ι → OuterMeasure α) : restrict s (⨅ i ∈ I, m i) = ⨅ i ∈ I, restrict s (m i) := by - haveI := hI.to_subtype + have := hI.to_subtype rw [← iInf_subtype'', ← iInf_subtype''] exact restrict_iInf _ _ diff --git a/Mathlib/MeasureTheory/VectorMeasure/Decomposition/Lebesgue.lean b/Mathlib/MeasureTheory/VectorMeasure/Decomposition/Lebesgue.lean index 11c223168aeaf3..d45d4d5a06fdd5 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/Decomposition/Lebesgue.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/Decomposition/Lebesgue.lean @@ -226,11 +226,11 @@ theorem toJordanDecomposition_eq_of_eq_add_withDensity {f : α → ℝ} (hf : Me @JordanDecomposition.mk α _ (t.toJordanDecomposition.posPart + μ.withDensity fun x => ENNReal.ofReal (f x)) (t.toJordanDecomposition.negPart + μ.withDensity fun x => ENNReal.ofReal (-f x)) - (by haveI := isFiniteMeasure_withDensity_ofReal hfi.2; infer_instance) - (by haveI := isFiniteMeasure_withDensity_ofReal hfi.neg.2; infer_instance) + (by have := isFiniteMeasure_withDensity_ofReal hfi.2; infer_instance) + (by have := isFiniteMeasure_withDensity_ofReal hfi.neg.2; infer_instance) (jordanDecomposition_add_withDensity_mutuallySingular hf htμ) := by - haveI := isFiniteMeasure_withDensity_ofReal hfi.2 - haveI := isFiniteMeasure_withDensity_ofReal hfi.neg.2 + have := isFiniteMeasure_withDensity_ofReal hfi.2 + have := isFiniteMeasure_withDensity_ofReal hfi.neg.2 refine toJordanDecomposition_eq ?_ simp_rw [JordanDecomposition.toSignedMeasure, hadd] ext i hi diff --git a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean index 47c85aa59371b4..cbd042c9ed8922 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/SetIntegral.lean @@ -520,7 +520,7 @@ theorem hasSum_setIntegral_iUnion {ι : Type*} [Countable ι] {s : ι → Set X} HasSum (fun n ↦ ∫ᵛ x in s n, f x ∂[B; μ]) (∫ᵛ x in ⋃ n, s n, f x ∂[B; μ]) := by classical rcases finite_or_infinite ι with hι | hι - · letI : Fintype ι := Fintype.ofFinite ι + · let : Fintype ι := Fintype.ofFinite ι have : ∫ᵛ x in ⋃ n, s n, f x ∂[B; μ] = ∑ i, ∫ᵛ x in s i, f x ∂[B; μ] := by rw [setIntegral_iUnion_fintype hm hd (fun i ↦ ?_)] exact hfi.mono (MeasurableSet.iUnion hm) (by simp [subset_iUnion s]) diff --git a/Mathlib/MeasureTheory/VectorMeasure/WithDensity.lean b/Mathlib/MeasureTheory/VectorMeasure/WithDensity.lean index 1bbde10a8da904..165e673a4d9498 100644 --- a/Mathlib/MeasureTheory/VectorMeasure/WithDensity.lean +++ b/Mathlib/MeasureTheory/VectorMeasure/WithDensity.lean @@ -175,7 +175,7 @@ theorem withDensityᵥ_toReal {f : α → ℝ≥0∞} (hfm : AEMeasurable f μ) (μ.withDensityᵥ fun x => (f x).toReal) = @toSignedMeasure α _ (μ.withDensity f) (isFiniteMeasure_withDensity hf) := by have hfi := integrable_toReal_of_lintegral_ne_top hfm hf - haveI := isFiniteMeasure_withDensity hf + have := isFiniteMeasure_withDensity hf ext i hi rw [withDensityᵥ_apply hfi hi, toSignedMeasure_apply_measurable hi, measureReal_def, withDensity_apply _ hi, integral_toReal hfm.restrict] @@ -190,8 +190,8 @@ theorem withDensityᵥ_eq_withDensity_pos_part_sub_withDensity_neg_part {f : α (isFiniteMeasure_withDensity_ofReal hfi.2) - @toSignedMeasure α _ (μ.withDensity fun x => ENNReal.ofReal <| -f x) (isFiniteMeasure_withDensity_ofReal hfi.neg.2) := by - haveI := isFiniteMeasure_withDensity_ofReal hfi.2 - haveI := isFiniteMeasure_withDensity_ofReal hfi.neg.2 + have := isFiniteMeasure_withDensity_ofReal hfi.2 + have := isFiniteMeasure_withDensity_ofReal hfi.neg.2 ext i hi rw [withDensityᵥ_apply hfi hi, integral_eq_lintegral_pos_part_sub_lintegral_neg_part hfi.integrableOn, diff --git a/Mathlib/ModelTheory/Algebra/Ring/Definability.lean b/Mathlib/ModelTheory/Algebra/Ring/Definability.lean index bc64fe626ef1b1..e4cdc861170563 100644 --- a/Mathlib/ModelTheory/Algebra/Ring/Definability.lean +++ b/Mathlib/ModelTheory/Algebra/Ring/Definability.lean @@ -32,8 +32,8 @@ theorem mvPolynomial_zeroLocus_definable {ι K : Type*} [Field K] (zeroLocus K (Ideal.span (S : Set (MvPolynomial ι K)))) := by rw [Set.definable_iff_exists_formula_sum] let p' := genericPolyMap (fun p : S => p.1.support) - letI := Classical.decEq ι - letI := Classical.decEq K + let := Classical.decEq ι + let := Classical.decEq K rw [MvPolynomial.zeroLocus_span] refine ⟨BoundedFormula.iInf (fun i : S => Term.equal diff --git a/Mathlib/ModelTheory/Arithmetic/Presburger/Definability.lean b/Mathlib/ModelTheory/Arithmetic/Presburger/Definability.lean index dbdb246371611b..fbd2168261ddf4 100644 --- a/Mathlib/ModelTheory/Arithmetic/Presburger/Definability.lean +++ b/Mathlib/ModelTheory/Arithmetic/Presburger/Definability.lean @@ -111,7 +111,7 @@ variable [Finite α] lemma isSemilinearSet_boundedFormula_realize {n} (φ : presburger[[A]].BoundedFormula α n) : IsSemilinearSet {v : α ⊕ Fin n → ℕ | φ.Realize (v ∘ Sum.inl) (v ∘ Sum.inr)} := by - haveI := Fintype.ofFinite α + have := Fintype.ofFinite α induction φ with simp only [BoundedFormula.Realize] | equal t₁ t₂ => rcases term_realize_eq_add_dotProduct t₁ with ⟨k₁, u₁, ht₁⟩ diff --git a/Mathlib/ModelTheory/Arithmetic/Presburger/Semilinear/Basic.lean b/Mathlib/ModelTheory/Arithmetic/Presburger/Semilinear/Basic.lean index 26520550127936..d750166966ec53 100644 --- a/Mathlib/ModelTheory/Arithmetic/Presburger/Semilinear/Basic.lean +++ b/Mathlib/ModelTheory/Arithmetic/Presburger/Semilinear/Basic.lean @@ -140,7 +140,7 @@ private theorem Nat.isSemilinearSet_of_isSlice {ι : Type*} [Finite ι] {s : Set (hs : IsSlice s) : IsSemilinearSet s := by classical suffices h : ∀ (a : ι → ℕ) (t : Finset ι), (∀ x ∈ s, ∀ i ∉ t, x i = a i) → IsSemilinearSet s by - haveI := Fintype.ofFinite ι + have := Fintype.ofFinite ι exact h 0 Finset.univ (by simp) intro a t ht induction t using Finset.strongInductionOn generalizing s a with | _ t ih @@ -249,7 +249,7 @@ public lemma IsSemilinearSet.exists_fg_eq_subtypeVal (hs : IsSemilinearSet s) : ∃ (P : AddSubmonoid M) (s' : Set P), P.FG ∧ IsSemilinearSet s' ∧ s = Subtype.val '' s' := by rcases hs with ⟨S, hS, hS', rfl⟩ choose! P t hP ht ht' using fun s hs => (hS' s hs).exists_fg_eq_subtypeVal - haveI : Finite S := hS + have : Finite S := hS refine ⟨⨆ s : S, P s, ⋃ (s : S), AddSubmonoid.inclusion (le_iSup _ s) '' t s.1, .iSup _ fun s => hP s s.2, .iUnion fun s => (ht s s.2).isSemilinearSet.image _, ?_⟩ simp_rw [sUnion_eq_iUnion, image_iUnion, image_image, AddSubmonoid.coe_inclusion, @@ -270,7 +270,7 @@ public lemma IsSemilinearSet.exists_fg_eq_subtypeVal₂ (hs₁ : IsSemilinearSet private lemma Nat.isSemilinearSet_inter_of_isLinearSet [Finite ι] {s₁ s₂ : Set (ι → ℕ)} (hs₁ : IsLinearSet s₁) (hs₂ : IsLinearSet s₂) : IsSemilinearSet (s₁ ∩ s₂) := by classical - haveI := Fintype.ofFinite ι + have := Fintype.ofFinite ι rw [isLinearSet_iff_exists_matrix] at hs₁ hs₂ rcases hs₁ with ⟨u, n, A, rfl⟩ rcases hs₂ with ⟨v, m, B, rfl⟩ @@ -440,7 +440,7 @@ private noncomputable def fundamentalDomain : Set (ι → ℕ) := private theorem finite_fundamentalDomain : hs.fundamentalDomain.Finite := by classical - haveI := Fintype.ofFinite ι + have := Fintype.ofFinite ι apply (finite_Iic (hs.base + ∑ i : hs.basisSet, i.1)).subset intro x hx rw [mem_Iic, ← toRatVec_mono, map_add, map_sum, ← add_sub_cancel (toRatVec hs.base) (toRatVec x), @@ -620,7 +620,7 @@ private theorem isSemilinearSet_setOfFractNe : IsSemilinearSet hs.setOfFractNe : apply Nat.isSemilinearSet_inter <| Nat.isSemilinearSet_preimage (.closure_of_finite hs.finite_basisSet) (LinearMap.funLeft ℕ ℕ Sum.inr) classical - haveI := Fintype.ofFinite ι + have := Fintype.ofFinite ι convert! Nat.isSemilinearSet_setOf_mulVec_eq (κ := (ι ⊕ ι) ⊕ ι) 0 i (Matrix.fromCols (Matrix.fromCols 1 0) 1) (Matrix.fromCols (Matrix.fromCols 0 1) 0) using @@ -682,7 +682,7 @@ private theorem isSemilinearSet_setOfFloorNeg : IsSemilinearSet hs.setOfFloorNeg rw [setOf_and] apply Nat.isSemilinearSet_inter <| Nat.isSemilinearSet_preimage (.closure_of_finite hs.finite_basisSet.sdiff) (LinearMap.funLeft ℕ ℕ Sum.inr) - haveI := Fintype.ofFinite ι + have := Fintype.ofFinite ι convert! Nat.isSemilinearSet_setOf_mulVec_eq (κ := ((ι ⊕ ι) ⊕ ι) ⊕ ι) i.1 hs.base (Matrix.fromCols (Matrix.fromCols (Matrix.fromCols 1 1) 0) 1) @@ -743,7 +743,7 @@ private theorem isSemilinearSet_setOfFloorPos : IsSemilinearSet hs.setOfFloorPos rw [setOf_and] apply Nat.isSemilinearSet_inter <| Nat.isSemilinearSet_preimage (.closure_of_finite hs.finite_basisSet.sdiff) (LinearMap.funLeft ℕ ℕ Sum.inr) - haveI := Fintype.ofFinite ι + have := Fintype.ofFinite ι convert! Nat.isSemilinearSet_setOf_mulVec_eq (κ := ((ι ⊕ ι) ⊕ ι) ⊕ ι) 0 (hs.base + i.1) (Matrix.fromCols (Matrix.fromCols (Matrix.fromCols 1 0) 0) 1) diff --git a/Mathlib/ModelTheory/Definability.lean b/Mathlib/ModelTheory/Definability.lean index b219893edfb6f8..01d99e26babc3a 100644 --- a/Mathlib/ModelTheory/Definability.lean +++ b/Mathlib/ModelTheory/Definability.lean @@ -149,13 +149,13 @@ theorem definable_biUnion_finset {ι : Type*} {f : ι → Set (α → M)} theorem definable_iInter_of_finite {ι : Type*} [Finite ι] {f : ι → Set (α → M)} (hf : ∀ i, A.Definable L (f i)) : A.Definable L (⋂ i, f i) := by - haveI := Fintype.ofFinite ι + have := Fintype.ofFinite ι convert! definable_finset_inf hf Finset.univ using 1 simp theorem definable_iUnion_of_finite {ι : Type*} [Finite ι] {f : ι → Set (α → M)} (hf : ∀ i, A.Definable L (f i)) : A.Definable L (⋃ i, f i) := by - haveI := Fintype.ofFinite ι + have := Fintype.ofFinite ι convert! definable_finset_sup hf Finset.univ using 1 simp diff --git a/Mathlib/ModelTheory/Fraisse.lean b/Mathlib/ModelTheory/Fraisse.lean index 9b89473fed2ffe..509a109eabc56d 100644 --- a/Mathlib/ModelTheory/Fraisse.lean +++ b/Mathlib/ModelTheory/Fraisse.lean @@ -376,7 +376,7 @@ protected theorem isExtensionPair : L.IsExtensionPair M N := by have S_in_age_N : ⟨S, inferInstance⟩ ∈ L.age N := by rw [hN.age, ← hM.age] exact ⟨(fg_iff_structure_fg S).1 S_FG, ⟨subtype _⟩⟩ - haveI nonempty_S_N : Nonempty (S ↪[L] N) := S_in_age_N.2 + have nonempty_S_N : Nonempty (S ↪[L] N) := S_in_age_N.2 let ⟨g, g_eq⟩ := hN.ultrahomogeneous.extend_embedding (f.dom.fg_iff_structure_fg.1 f_FG) ((subtype f.cod).comp f.toEquiv.toEmbedding) (inclusion (le_sup_left : _ ≤ S)) refine ⟨⟨⟨S, g.toHom.range, g.equivRange⟩, S_FG⟩, diff --git a/Mathlib/ModelTheory/Graph.lean b/Mathlib/ModelTheory/Graph.lean index 8506874b319565..deff4b767ccf25 100644 --- a/Mathlib/ModelTheory/Graph.lean +++ b/Mathlib/ModelTheory/Graph.lean @@ -77,7 +77,7 @@ theorem Theory.simpleGraph_model_iff [Language.graph.Structure V] : instance simpleGraph_model (G : SimpleGraph V) : @Theory.Model _ V G.structure Theory.simpleGraph := by - letI := G.structure + let := G.structure rw [Theory.simpleGraph_model_iff] exact ⟨G.loopless, G.symm⟩ diff --git a/Mathlib/ModelTheory/LanguageMap.lean b/Mathlib/ModelTheory/LanguageMap.lean index 19a26d6160d725..f6cb5d1463a1e0 100644 --- a/Mathlib/ModelTheory/LanguageMap.lean +++ b/Mathlib/ModelTheory/LanguageMap.lean @@ -264,7 +264,7 @@ theorem Injective.isExpansionOn_default {ϕ : L →ᴸ L'} [∀ (n) (r : L'.Relations n), Decidable (r ∈ Set.range fun r : L.Relations n => ϕ.onRelation r)] (h : ϕ.Injective) (M : Type*) [Inhabited M] [L.Structure M] : @IsExpansionOn L L' ϕ M _ (ϕ.defaultExpansion M) := by - letI := ϕ.defaultExpansion M + let := ϕ.defaultExpansion M refine ⟨fun {n} f xs => ?_, fun {n} r xs => ?_⟩ · have hf : ϕ.onFunction f ∈ Set.range fun f : L.Functions n => ϕ.onFunction f := ⟨f, rfl⟩ refine (dif_pos hf).trans ?_ @@ -361,8 +361,8 @@ def LHom.constantsOnMap (f : α → β) : constantsOn α →ᴸ constantsOn β w theorem constantsOnMap_isExpansionOn {f : α → β} {fα : α → M} {fβ : β → M} (h : fβ ∘ f = fα) : @LHom.IsExpansionOn _ _ (LHom.constantsOnMap f) M (constantsOn.structure fα) (constantsOn.structure fβ) := by - letI := constantsOn.structure fα - letI := constantsOn.structure fβ + let := constantsOn.structure fα + let := constantsOn.structure fβ exact ⟨fun {n} => Nat.casesOn n (fun F _x => (congr_fun h F :)) fun n F => isEmptyElim F, fun R => isEmptyElim R⟩ diff --git a/Mathlib/ModelTheory/Order.lean b/Mathlib/ModelTheory/Order.lean index fc01bc4c2f53c7..68783ea21debee 100644 --- a/Mathlib/ModelTheory/Order.lean +++ b/Mathlib/ModelTheory/Order.lean @@ -359,7 +359,7 @@ def leOfStructure : LE M where le a b := Structure.RelMap (leSymb : L.Relations 2) ![a, b] instance : @OrderedStructure L M _ (L.leOfStructure M) _ := by - letI := L.leOfStructure M + let := L.leOfStructure M constructor simp only [Fin.forall_fin_succ_pi, Fin.cons_zero, Fin.forall_fin_zero_pi] intros @@ -471,8 +471,8 @@ lemma dlo_isExtensionPair classical rw [isExtensionPair_iff_exists_embedding_closure_singleton_sup] intro S S_fg f m - letI := Language.order.linearOrderOfModels M - letI := Language.order.linearOrderOfModels N + let := Language.order.linearOrderOfModels M + let := Language.order.linearOrderOfModels N have := Language.order.denselyOrdered_of_dlo N have := Language.order.noBotOrder_of_dlo N have := Language.order.noTopOrder_of_dlo N @@ -499,7 +499,7 @@ lemma dlo_isExtensionPair set_option backward.isDefEq.respectTransparency false in instance (M : Type w) [Language.order.Structure M] [M ⊨ Language.order.dlo] [Nonempty M] : Infinite M := by - letI := orderStructure ℚ + let := orderStructure ℚ obtain ⟨f, _⟩ := embedding_from_cg cg_of_countable default (dlo_isExtensionPair ℚ M) exact Infinite.of_injective f f.injective @@ -511,8 +511,8 @@ lemma dlo_age [Language.order.Structure M] [Mdlo : M ⊨ Language.order.dlo] [No ext N refine ⟨fun ⟨hF, h⟩ => ⟨hF.finite, Theory.IsUniversal.models_of_embedding h.some⟩, fun ⟨hF, h⟩ => ⟨FG.of_finite, ?_⟩⟩ - letI := Language.order.linearOrderOfModels M - letI := Language.order.linearOrderOfModels N + let := Language.order.linearOrderOfModels M + let := Language.order.linearOrderOfModels N exact ⟨StrongHomClass.toEmbedding (nonempty_orderEmbedding_of_finite_infinite N M).some⟩ /-- Any countable nonempty model of the theory of dense linear orders is a Fraïssé limit of the @@ -528,7 +528,7 @@ set_option backward.isDefEq.respectTransparency false in theorem isFraisse_finite_linear_order : IsFraisse {M : CategoryTheory.Bundled.{0} Language.order.Structure | Finite M ∧ M ⊨ Language.order.linearOrderTheory} := by - letI : Language.order.Structure ℚ := orderStructure _ + let : Language.order.Structure ℚ := orderStructure _ exact (isFraisseLimit_of_countable_nonempty_dlo ℚ).isFraisse open Cardinal @@ -566,9 +566,9 @@ example (α β : Type w') [LinearOrder α] [LinearOrder β] [Countable α] [DenselyOrdered α] [NoMinOrder α] [NoMaxOrder α] [Nonempty α] [Countable β] [DenselyOrdered β] [NoMinOrder β] [NoMaxOrder β] [Nonempty β] : Nonempty (α ≃o β) := by - letI := orderStructure α - letI := orderStructure β - letI := StrongHomClass.toOrderIsoClass Language.order α β (α ≃[Language.order] β) + let := orderStructure α + let := orderStructure β + let := StrongHomClass.toOrderIsoClass Language.order α β (α ≃[Language.order] β) exact ⟨(IsFraisseLimit.nonempty_equiv (isFraisseLimit_of_countable_nonempty_dlo α) (isFraisseLimit_of_countable_nonempty_dlo β)).some⟩ diff --git a/Mathlib/ModelTheory/Satisfiability.lean b/Mathlib/ModelTheory/Satisfiability.lean index c36c9f809fde4c..0e68449bba6d96 100644 --- a/Mathlib/ModelTheory/Satisfiability.lean +++ b/Mathlib/ModelTheory/Satisfiability.lean @@ -89,7 +89,7 @@ theorem isSatisfiable_onTheory_iff {L' : Language.{w, w'}} {φ : L →ᴸ L'} (h (φ.onTheory T).IsSatisfiable ↔ T.IsSatisfiable := by classical refine ⟨isSatisfiable_of_isSatisfiable_onTheory φ, fun h' => ?_⟩ - haveI : Inhabited h'.some := Classical.inhabited_of_nonempty' + have : Inhabited h'.some := Classical.inhabited_of_nonempty' exact Model.isSatisfiable (h'.some.defaultExpansion h) theorem IsSatisfiable.isFinitelySatisfiable (h : T.IsSatisfiable) : T.IsFinitelySatisfiable := @@ -130,9 +130,9 @@ theorem isSatisfiable_union_distinctConstantsTheory_of_card_le (T : L.Theory) (s (M : Type w') [Nonempty M] [L.Structure M] [M ⊨ T] (h : Cardinal.lift.{w'} #s ≤ Cardinal.lift.{w} #M) : ((L.lhomWithConstants α).onTheory T ∪ L.distinctConstantsTheory s).IsSatisfiable := by - haveI : Inhabited M := Classical.inhabited_of_nonempty inferInstance + have : Inhabited M := Classical.inhabited_of_nonempty inferInstance rw [Cardinal.lift_mk_le'] at h - letI : (constantsOn α).Structure M := constantsOn.structure (Function.extend (↑) h.some default) + let : (constantsOn α).Structure M := constantsOn.structure (Function.extend (↑) h.some default) have : M ⊨ (L.lhomWithConstants α).onTheory T ∪ L.distinctConstantsTheory s := by refine ((LHom.onTheory_model _ _).2 inferInstance).union ?_ rw [model_distinctConstantsTheory] @@ -166,7 +166,7 @@ theorem exists_large_model_of_infinite_model (T : L.Theory) (κ : Cardinal.{w}) obtain ⟨N⟩ := isSatisfiable_union_distinctConstantsTheory_of_infinite T (Set.univ : Set κ.out) M refine ⟨(N.is_model.mono Set.subset_union_left).bundled.reduct _, ?_⟩ - haveI : N ⊨ distinctConstantsTheory _ _ := N.is_model.mono Set.subset_union_right + have : N ⊨ distinctConstantsTheory _ _ := N.is_model.mono Set.subset_union_right rw [ModelType.reduct_Carrier, coe_of] refine _root_.trans (lift_le.2 (le_of_eq (Cardinal.mk_out κ).symm)) ?_ rw [← mk_univ] @@ -229,8 +229,8 @@ theorem exists_elementaryEmbedding_card_eq_of_ge (M : Type w') [L.Structure M] [ rw [← lift_le.{w'}, lift_lift, lift_lift] at h1 exact ⟨h2, h1⟩) (hN0.trans (by rw [← lift_umax, lift_id])) - letI := (lhomWithConstants L M).reduct N - haveI h : N ⊨ L.elementaryDiagram M := + let := (lhomWithConstants L M).reduct N + have h : N ⊨ L.elementaryDiagram M := (NN0.theory_model_iff (L.elementaryDiagram M)).2 inferInstance refine ⟨Bundled.of N, ⟨?_⟩, hN⟩ apply ElementaryEmbedding.ofModelsElementaryDiagram L M N @@ -271,7 +271,7 @@ theorem exists_model_card_eq (h : ∃ M : ModelType.{u, v, max u v} T, Infinite cases h with | intro M MI => obtain ⟨N, hN, rfl⟩ := exists_elementarilyEquivalent_card_eq L M κ h1 h2 - haveI : Nonempty N := hN.nonempty + have : Nonempty N := hN.nonempty exact ⟨hN.theory_model.bundled, rfl⟩ variable (T) @@ -328,19 +328,19 @@ theorem models_formula_iff_onTheory_models_equivSentence {φ : L.Formula α} : T ⊨ᵇ φ ↔ (L.lhomWithConstants α).onTheory T ⊨ᵇ Formula.equivSentence φ := by refine ⟨fun h => models_sentence_iff.2 (fun M => ?_), fun h => models_formula_iff.2 (fun M v => ?_)⟩ - · letI := (L.lhomWithConstants α).reduct M + · let := (L.lhomWithConstants α).reduct M rw [Formula.realize_equivSentence] have : M ⊨ T := (LHom.onTheory_model _ _).1 M.is_model -- why isn't M.is_model inferInstance? let M' := Theory.ModelType.of T M exact h M' (fun a => (L.con a : M)) _ - · letI : (constantsOn α).Structure M := constantsOn.structure v + · let : (constantsOn α).Structure M := constantsOn.structure v have : M ⊨ (L.lhomWithConstants α).onTheory T := (LHom.onTheory_model _ _).2 inferInstance exact (Formula.realize_equivSentence _ _).1 (h.realize_sentence M) theorem ModelsBoundedFormula.realize_formula {φ : L.Formula α} (h : T ⊨ᵇ φ) (M : Type*) [L.Structure M] [M ⊨ T] [Nonempty M] {v : α → M} : φ.Realize v := by rw [models_formula_iff_onTheory_models_equivSentence] at h - letI : (constantsOn α).Structure M := constantsOn.structure v + let : (constantsOn α).Structure M := constantsOn.structure v have : M ⊨ (L.lhomWithConstants α).onTheory T := (LHom.onTheory_model _ _).2 inferInstance exact (Formula.realize_equivSentence _ _).1 (h.realize_sentence M) @@ -373,7 +373,7 @@ theorem models_iff_finset_models {φ : L.Sentence} : simp only [models_iff_not_satisfiable] rw [isSatisfiable_iff_isFinitelySatisfiable, IsFinitelySatisfiable] contrapose! - letI := Classical.decEq (Sentence L) + let := Classical.decEq (Sentence L) constructor · intro h T0 hT0 simpa using h (T0 ∪ {Formula.not φ}) @@ -517,8 +517,8 @@ theorem Categorical.isComplete (h : κ.Categorical T) (h1 : ℵ₀ ≤ κ) by_contra! ⟨⟨MF, hMF⟩, MT, hMT⟩ rw [Sentence.realize_not, Classical.not_not] at hMT refine hMF ?_ - haveI := hT MT - haveI := hT MF + have := hT MT + have := hT MF obtain ⟨NT, MNT, hNT⟩ := exists_elementarilyEquivalent_card_eq L MT κ h1 h2 obtain ⟨NF, MNF, hNF⟩ := exists_elementarilyEquivalent_card_eq L MF κ h1 h2 obtain ⟨TF⟩ := h (MNT.toModel T) (MNF.toModel T) hNT hNF diff --git a/Mathlib/ModelTheory/Substructures.lean b/Mathlib/ModelTheory/Substructures.lean index a7039badaf7741..934ce661ade2b7 100644 --- a/Mathlib/ModelTheory/Substructures.lean +++ b/Mathlib/ModelTheory/Substructures.lean @@ -321,7 +321,7 @@ lemma mem_closure_iff_of_isRelational [L.IsRelational] (s : Set M) (m : M) : theorem _root_.Set.Countable.substructure_closure [Countable (Σ l, L.Functions l)] (h : s.Countable) : Countable.{w + 1} (closure L s) := by - haveI : Countable s := h.to_subtype + have : Countable s := h.to_subtype rw [← mk_le_aleph0_iff, ← lift_le_aleph0] exact lift_card_closure_le_card_term.trans mk_le_aleph0 @@ -378,7 +378,7 @@ theorem closure_insert (s : Set M) (m : M) : closure L (insert m s) = closure L instance small_bot : Small.{u} (⊥ : L.Substructure M) := by rw [← closure_empty] - haveI : Small.{u} (∅ : Set M) := small_subsingleton _ + have : Small.{u} (∅ : Set M) := small_subsingleton _ exact Substructure.small_closure theorem iSup_eq_closure {ι : Sort*} (S : ι → L.Substructure M) : @@ -400,7 +400,7 @@ theorem mem_iSup_of_directed {ι : Type*} [hι : Nonempty ι] {S : ι → L.Subs theorem mem_sSup_of_directedOn {S : Set (L.Substructure M)} (Sne : S.Nonempty) (hS : DirectedOn (· ≤ ·) S) {x : M} : x ∈ sSup S ↔ ∃ s ∈ S, x ∈ s := by - haveI : Nonempty S := Sne.to_subtype + have : Nonempty S := Sne.to_subtype simp only [sSup_eq_iSup', mem_iSup_of_directed hS.directed_val, Subtype.exists, exists_prop] variable (L) (M) diff --git a/Mathlib/NumberTheory/ClassNumber/AdmissibleAbsoluteValue.lean b/Mathlib/NumberTheory/ClassNumber/AdmissibleAbsoluteValue.lean index 9bb6058a90ae1f..281104403f2f70 100644 --- a/Mathlib/NumberTheory/ClassNumber/AdmissibleAbsoluteValue.lean +++ b/Mathlib/NumberTheory/ClassNumber/AdmissibleAbsoluteValue.lean @@ -72,7 +72,7 @@ whose remainders are close together, pointwise. -/ theorem exists_approx_aux (n : ℕ) (h : abv.IsAdmissible) : ∀ {ε : ℝ} (_hε : 0 < ε) {b : R} (_hb : b ≠ 0) (A : Fin (h.card ε ^ n).succ → Fin n → R), ∃ i₀ i₁, i₀ ≠ i₁ ∧ ∀ k, (abv (A i₁ k % b - A i₀ k % b) : ℝ) < abv b • ε := by - haveI := Classical.decEq R + have := Classical.decEq R induction n with | zero => intro ε _hε b _hb A diff --git a/Mathlib/NumberTheory/Cyclotomic/Basic.lean b/Mathlib/NumberTheory/Cyclotomic/Basic.lean index 7e7c1e70257a3b..7eed25c14848e9 100644 --- a/Mathlib/NumberTheory/Cyclotomic/Basic.lean +++ b/Mathlib/NumberTheory/Cyclotomic/Basic.lean @@ -291,9 +291,9 @@ variable (A B) protected theorem equiv {C : Type*} [CommRing C] [Algebra A C] [h : IsCyclotomicExtension S A B] (f : B ≃ₐ[A] C) : IsCyclotomicExtension S A C := by - letI : Algebra B C := f.toAlgHom.toRingHom.toAlgebra - haveI : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective - haveI : IsScalarTower A B C := IsScalarTower.of_algHom f.toAlgHom + let : Algebra B C := f.toAlgHom.toRingHom.toAlgebra + have : IsCyclotomicExtension {1} B C := singleton_one_of_algebraMap_bijective f.surjective + have : IsScalarTower A B C := IsScalarTower.of_algHom f.toAlgHom exact (iff_union_singleton_one _ _ _).2 (trans S {1} A B C f.injective) theorem neZero_of_mem [IsCyclotomicExtension S A B] [IsDomain B] (hn : n ∈ S) : NeZero (n : B) := @@ -410,8 +410,8 @@ protected theorem finite [IsDomain B] [h₁ : Finite S] [h₂ : IsCyclotomicExte theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L := { to_charZero := charZero_of_injective_algebraMap (algebraMap K L).injective to_finiteDimensional := by - haveI := charZero_of_injective_algebraMap (algebraMap K L).injective - haveI := IsCyclotomicExtension.finite S K L + have := charZero_of_injective_algebraMap (algebraMap K L).injective + have := IsCyclotomicExtension.finite S K L exact Module.Finite.trans K _ } /-- If `S` is finite and `IsCyclotomicExtension S K A`, then `finiteDimensional K A`. -/ @@ -634,7 +634,7 @@ theorem splitting_field_cyclotomic : IsSplittingField K L (cyclotomic n K) := { splits' := splits_cyclotomic K L (mem_singleton n) adjoin_rootSet' := by rw [← ((iff_adjoin_eq_top {n} K L).1 inferInstance).2] - letI := Classical.decEq L + let := Classical.decEq L obtain ⟨ζ : L, hζ⟩ := IsCyclotomicExtension.exists_isPrimitiveRoot K L (mem_singleton n) (NeZero.ne _) exact adjoin_roots_cyclotomic_eq_adjoin_nth_roots hζ } @@ -675,7 +675,7 @@ instance isCyclotomicExtension [NeZero (n : K)] : IsCyclotomicExtension {n} K (CyclotomicField n K) := by have : NeZero (n : CyclotomicField n K) := NeZero.nat_of_injective (algebraMap K _).injective - letI := Classical.decEq (CyclotomicField n K) + let := Classical.decEq (CyclotomicField n K) have := (degree_cyclotomic_pos n K (NeZero.pos n)).ne' obtain ⟨ζ, hζ⟩ := Splits.exists_eval_eq_zero (SplittingField.splits (cyclotomic n K)) (by rwa [degree_map]) @@ -811,7 +811,7 @@ instance [IsFractionRing A K] [IsDomain A] [NeZero (n : A)] : obtain ⟨⟨z, w⟩, hw⟩ := this k refine ⟨⟨algebraMap A (CyclotomicRing n A K) z, algebraMap A (CyclotomicRing n A K) w, map_mem_nonZeroDivisors _ (algebraBase_injective n A K) w.2⟩, ?_⟩ - letI : IsScalarTower A K (CyclotomicField n K) := + let : IsScalarTower A K (CyclotomicField n K) := IsScalarTower.of_algebraMap_eq (congr_fun rfl) rw [← IsScalarTower.algebraMap_apply, ← IsScalarTower.algebraMap_apply, @IsScalarTower.algebraMap_apply A K _ _ _ _ _ (_root_.CyclotomicField.algebra n K) _ _ w, diff --git a/Mathlib/NumberTheory/Cyclotomic/CyclotomicCharacter.lean b/Mathlib/NumberTheory/Cyclotomic/CyclotomicCharacter.lean index eaa68d6f06b3d3..0f40c346fad4e0 100644 --- a/Mathlib/NumberTheory/Cyclotomic/CyclotomicCharacter.lean +++ b/Mathlib/NumberTheory/Cyclotomic/CyclotomicCharacter.lean @@ -309,13 +309,13 @@ noncomputable def cyclotomicCharacter (p : ℕ) [Fact p.Prime] : { toFun g := cyclotomicCharacter.toFun p g map_one' := by by_cases H : ∀ (i : ℕ), ∃ ζ : L, IsPrimitiveRoot ζ (p ^ i) - · haveI _ (i) : HasEnoughRootsOfUnity L (p ^ i) := ⟨H i, rootsOfUnity.isCyclic _ _⟩ + · have _ (i) : HasEnoughRootsOfUnity L (p ^ i) := ⟨H i, rootsOfUnity.isCyclic _ _⟩ refine PadicInt.ext_of_toZModPow.mp fun n ↦ ?_ simp [cyclotomicCharacter.toZModPow_toFun] · simp [cyclotomicCharacter.toFun, dif_neg H] map_mul' f g := by by_cases H : ∀ (i : ℕ), ∃ ζ : L, IsPrimitiveRoot ζ (p ^ i) - · haveI _ (i) : HasEnoughRootsOfUnity L (p ^ i) := ⟨H i, rootsOfUnity.isCyclic _ _⟩ + · have _ (i) : HasEnoughRootsOfUnity L (p ^ i) := ⟨H i, rootsOfUnity.isCyclic _ _⟩ refine PadicInt.ext_of_toZModPow.mp fun n ↦ ?_ simp [cyclotomicCharacter.toZModPow_toFun] · simp [cyclotomicCharacter.toFun, dif_neg H] } @@ -339,7 +339,7 @@ lemma cyclotomicCharacter.continuous (p : ℕ) [Fact p.Prime] by_cases H : ∀ (i : ℕ), ∃ ζ : L, IsPrimitiveRoot ζ (p ^ i); swap · simp only [cyclotomicCharacter, cyclotomicCharacter.toFun, dif_neg H, MonoidHom.coe_comp] exact continuous_const (y := 1) - haveI _ (i) : HasEnoughRootsOfUnity L (p ^ i) := ⟨H i, rootsOfUnity.isCyclic _ _⟩ + have _ (i) : HasEnoughRootsOfUnity L (p ^ i) := ⟨H i, rootsOfUnity.isCyclic _ _⟩ choose ζ hζ using H refine Continuous.of_coeHom_comp ?_ apply continuous_of_continuousAt_one diff --git a/Mathlib/NumberTheory/Cyclotomic/Discriminant.lean b/Mathlib/NumberTheory/Cyclotomic/Discriminant.lean index 21e681b2319ffd..dc74f022f495ea 100644 --- a/Mathlib/NumberTheory/Cyclotomic/Discriminant.lean +++ b/Mathlib/NumberTheory/Cyclotomic/Discriminant.lean @@ -40,7 +40,7 @@ variable [ce : IsCyclotomicExtension {n} ℚ K] discriminant of the power basis given by `ζ - 1`. -/ theorem discr_zeta_eq_discr_zeta_sub_one (hζ : IsPrimitiveRoot ζ n) : discr ℚ (hζ.powerBasis ℚ).basis = discr ℚ (hζ.subOnePowerBasis ℚ).basis := by - haveI : NumberField K := @NumberField.mk _ _ _ (IsCyclotomicExtension.finiteDimensional {n} ℚ K) + have : NumberField K := @NumberField.mk _ _ _ (IsCyclotomicExtension.finiteDimensional {n} ℚ K) have H₁ : (aeval (hζ.powerBasis ℚ).gen) (X - 1 : ℤ[X]) = (hζ.subOnePowerBasis ℚ).gen := by simp have H₂ : (aeval (hζ.subOnePowerBasis ℚ).gen) (X + 1 : ℤ[X]) = (hζ.powerBasis ℚ).gen := by simp refine discr_eq_discr_of_toMatrix_coeff_isIntegral _ (fun i j => toMatrix_isIntegral H₁ ?_ ?_ _ _) @@ -65,9 +65,9 @@ theorem discr_prime_pow_ne_two [IsCyclotomicExtension {p ^ (k + 1)} K L] [hp : F (hζ : IsPrimitiveRoot ζ (p ^ (k + 1))) (hirr : Irreducible (cyclotomic (p ^ (k + 1)) K)) (hk : p ^ (k + 1) ≠ 2) : discr K (hζ.powerBasis K).basis = (-1) ^ ((p ^ (k + 1)).totient / 2) * p ^ (p ^ k * ((p - 1) * (k + 1) - 1)) := by - haveI hne := IsCyclotomicExtension.neZero' (p ^ (k + 1)) K L - haveI mf : Module.Finite K L := finiteDimensional {p ^ (k + 1)} K L - haveI se : Algebra.IsSeparable K L := isSeparable {p ^ (k + 1)} K L + have hne := IsCyclotomicExtension.neZero' (p ^ (k + 1)) K L + have mf : Module.Finite K L := finiteDimensional {p ^ (k + 1)} K L + have se : Algebra.IsSeparable K L := isSeparable {p ^ (k + 1)} K L rw [discr_powerBasis_eq_norm, finrank L hirr, hζ.powerBasis_gen _, ← hζ.minpoly_eq_cyclotomic_of_irreducible hirr, totient_prime_pow hp.out (succ_pos k), Nat.add_one_sub_one] diff --git a/Mathlib/NumberTheory/Cyclotomic/Gal.lean b/Mathlib/NumberTheory/Cyclotomic/Gal.lean index fb8e0532ac4489..8d1c76196a7cfa 100644 --- a/Mathlib/NumberTheory/Cyclotomic/Gal.lean +++ b/Mathlib/NumberTheory/Cyclotomic/Gal.lean @@ -81,7 +81,7 @@ noncomputable def autEquivPow (h : Irreducible (cyclotomic n K)) : Gal(L/K) ≃* invFun := fun t => (hζ.powerBasis K).equivOfMinpoly ((hμ t).powerBasis K) (by - haveI := IsCyclotomicExtension.neZero' n K L + have := IsCyclotomicExtension.neZero' n K L simp only [IsPrimitiveRoot.powerBasis_gen] have hr := IsPrimitiveRoot.minpoly_eq_cyclotomic_of_irreducible diff --git a/Mathlib/NumberTheory/Cyclotomic/PrimitiveRoots.lean b/Mathlib/NumberTheory/Cyclotomic/PrimitiveRoots.lean index 39cdd13911878b..49dc6c38d86dd1 100644 --- a/Mathlib/NumberTheory/Cyclotomic/PrimitiveRoots.lean +++ b/Mathlib/NumberTheory/Cyclotomic/PrimitiveRoots.lean @@ -178,7 +178,7 @@ variable {K} (L) /-- If `Irreducible (cyclotomic n K)` (in particular for `K = ℚ`), then the `finrank` of a cyclotomic extension is `n.totient`. -/ theorem finrank (hirr : Irreducible (cyclotomic n K)) : finrank K L = n.totient := by - haveI := IsCyclotomicExtension.neZero' n K L + have := IsCyclotomicExtension.neZero' n K L rw [((zeta_spec n K L).powerBasis K).finrank, IsPrimitiveRoot.powerBasis_dim, ← (zeta_spec n K L).minpoly_eq_cyclotomic_of_irreducible hirr, natDegree_cyclotomic] @@ -197,7 +197,7 @@ theorem _root_.IsPrimitiveRoot.lcm_totient_le_finrank [FiniteDimensional K L] {p let z := x ^ (p / factorizationLCMLeft p q) * y ^ (q / factorizationLCMRight p q) let k := PNat.lcm ⟨p, hppos⟩ ⟨q, hqpos⟩ have : IsPrimitiveRoot z k := hx.pow_mul_pow_lcm hy hppos.ne' hqpos.ne' - haveI := IsPrimitiveRoot.adjoin_isCyclotomicExtension K this + have := IsPrimitiveRoot.adjoin_isCyclotomicExtension K this convert! Submodule.finrank_le (Subalgebra.toSubmodule (adjoin K { z })) rw [show Nat.lcm p q = (k : ℕ) from rfl] at hirr simpa using! (IsCyclotomicExtension.finrank (Algebra.adjoin K {z}) hirr).symm @@ -290,7 +290,7 @@ include hζ `1` if `n ≠ 2`. -/ theorem norm_eq_one [IsDomain L] [IsCyclotomicExtension {n} K L] (hn : n ≠ 2) (hirr : Irreducible (cyclotomic n K)) : norm K ζ = 1 := by - haveI := IsCyclotomicExtension.neZero' n K L + have := IsCyclotomicExtension.neZero' n K L by_cases h1 : n = 1 · rw [h1, one_right_iff] at hζ rw [hζ, show 1 = algebraMap K L 1 by simp, Algebra.norm_algebraMap, one_pow] @@ -332,12 +332,12 @@ include hζ `ζ - 1` is `eval 1 (cyclotomic n ℤ)`. -/ theorem sub_one_norm_eq_eval_cyclotomic [IsCyclotomicExtension {n} K L] (h : 2 < n) (hirr : Irreducible (cyclotomic n K)) : norm K (ζ - 1) = ↑(eval 1 (cyclotomic n ℤ)) := by - haveI := IsCyclotomicExtension.neZero' n K L + have := IsCyclotomicExtension.neZero' n K L let E := AlgebraicClosure L obtain ⟨z, hz⟩ := IsAlgClosed.exists_root _ (degree_cyclotomic_pos n E (NeZero.pos _)).ne.symm apply (algebraMap K E).injective - letI := IsCyclotomicExtension.finiteDimensional {n} K L - letI := IsCyclotomicExtension.isGalois {n} K L + let := IsCyclotomicExtension.finiteDimensional {n} K L + let := IsCyclotomicExtension.isGalois {n} K L rw [norm_eq_prod_embeddings] conv_lhs => congr @@ -378,7 +378,7 @@ theorem minpoly_sub_one_eq_cyclotomic_comp [Algebra K A] [IsDomain A] {ζ : A} [IsCyclotomicExtension {n} K A] (hζ : IsPrimitiveRoot ζ n) (h : Irreducible (Polynomial.cyclotomic n K)) : minpoly K (ζ - 1) = (cyclotomic n K).comp (X + 1) := by - haveI := IsCyclotomicExtension.neZero' n K A + have := IsCyclotomicExtension.neZero' n K A rw [show ζ - 1 = ζ + algebraMap K A (-1) by simp [sub_eq_add_neg], minpoly.add_algebraMap ζ, hζ.minpoly_eq_cyclotomic_of_irreducible h] @@ -467,7 +467,7 @@ theorem norm_sub_one_of_prime_ne_two' [hpri : Fact p.Prime] (hirr : Irreducible (cyclotomic p K)) (h : p ≠ 2) : norm K (ζ - 1) = p := by replace hirr : Irreducible (cyclotomic (p ^ (0 + 1)) K) := by simp [hirr] replace hζ : IsPrimitiveRoot ζ (p ^ (0 + 1)) := by simp [hζ] - haveI : IsCyclotomicExtension {p ^ (0 + 1)} K L := by simp [hcyc] + have : IsCyclotomicExtension {p ^ (0 + 1)} K L := by simp [hcyc] simpa using norm_sub_one_of_prime_ne_two hζ hirr h /-- If `Irreducible (cyclotomic (2 ^ (k + 1)) K)` (in particular for `K = ℚ`), then the norm of diff --git a/Mathlib/NumberTheory/LSeries/HurwitzZetaEven.lean b/Mathlib/NumberTheory/LSeries/HurwitzZetaEven.lean index f666358b220b7f..e24ca61b0261ee 100644 --- a/Mathlib/NumberTheory/LSeries/HurwitzZetaEven.lean +++ b/Mathlib/NumberTheory/LSeries/HurwitzZetaEven.lean @@ -183,7 +183,7 @@ lemma hasSum_int_cosKernel (a : ℝ) {t : ℝ} (ht : 0 < t) : lemma hasSum_int_evenKernel₀ (a : ℝ) {t : ℝ} (ht : 0 < t) : HasSum (fun n : ℤ ↦ if n + a = 0 then 0 else rexp (-π * (n + a) ^ 2 * t)) (evenKernel a t - if (a : UnitAddCircle) = 0 then 1 else 0) := by - haveI := Classical.propDecidable -- speed up instance search for `if / then / else` + have := Classical.propDecidable -- speed up instance search for `if / then / else` simp_rw [AddCircle.coe_eq_zero_iff, zsmul_one] split_ifs with h · obtain ⟨k, rfl⟩ := h diff --git a/Mathlib/NumberTheory/LegendreSymbol/Basic.lean b/Mathlib/NumberTheory/LegendreSymbol/Basic.lean index d7a0950ee86474..f88b8b925788ee 100644 --- a/Mathlib/NumberTheory/LegendreSymbol/Basic.lean +++ b/Mathlib/NumberTheory/LegendreSymbol/Basic.lean @@ -225,7 +225,7 @@ theorem eq_one_of_sq_sub_mul_sq_eq_zero {p : ℕ} [Fact p.Prime] {a : ℤ} (ha : of the equation `x^2 - a*y^2 = 0` with `x ≠ 0`. -/ theorem eq_one_of_sq_sub_mul_sq_eq_zero' {p : ℕ} [Fact p.Prime] {a : ℤ} (ha : (a : ZMod p) ≠ 0) {x y : ZMod p} (hx : x ≠ 0) (hxy : x ^ 2 - a * y ^ 2 = 0) : legendreSym p a = 1 := by - haveI hy : y ≠ 0 := by + have hy : y ≠ 0 := by rintro rfl rw [zero_pow two_ne_zero, mul_zero, sub_zero, sq_eq_zero_iff] at hxy exact hx hxy diff --git a/Mathlib/NumberTheory/LegendreSymbol/GaussEisensteinLemmas.lean b/Mathlib/NumberTheory/LegendreSymbol/GaussEisensteinLemmas.lean index b6bd0e447a5270..0d7e121c0a5497 100644 --- a/Mathlib/NumberTheory/LegendreSymbol/GaussEisensteinLemmas.lean +++ b/Mathlib/NumberTheory/LegendreSymbol/GaussEisensteinLemmas.lean @@ -204,7 +204,7 @@ theorem sum_mul_div_add_sum_mul_div_eq_mul (p q : ℕ) [hp : Fact p.Prime] (hq0 /-- **Eisenstein's lemma** -/ theorem eisenstein_lemma {p : ℕ} [Fact p.Prime] (hp : p ≠ 2) {a : ℕ} (ha1 : a % 2 = 1) (ha0 : (a : ZMod p) ≠ 0) : legendreSym p a = (-1) ^ ∑ x ∈ Ico 1 (p / 2).succ, x * a / p := by - haveI hp' : Fact (p % 2 = 1) := ⟨(Nat.Prime.mod_two_eq_one_iff_ne_two Fact.out).mpr hp⟩ + have hp' : Fact (p % 2 = 1) := ⟨(Nat.Prime.mod_two_eq_one_iff_ne_two Fact.out).mpr hp⟩ have ha0' : ((a : ℤ) : ZMod p) ≠ 0 := by norm_cast rw [neg_one_pow_eq_pow_mod_two, gauss_lemma hp ha0', neg_one_pow_eq_pow_mod_two, (by norm_cast : ((a : ℤ) : ZMod p) = (a : ZMod p)), diff --git a/Mathlib/NumberTheory/LegendreSymbol/JacobiSymbol.lean b/Mathlib/NumberTheory/LegendreSymbol/JacobiSymbol.lean index 501714b52998c2..64c2a695430e8a 100644 --- a/Mathlib/NumberTheory/LegendreSymbol/JacobiSymbol.lean +++ b/Mathlib/NumberTheory/LegendreSymbol/JacobiSymbol.lean @@ -140,7 +140,7 @@ theorem trichotomy (a : ℤ) (b : ℕ) : J(a | b) = 0 ∨ J(a | b) = 1 ∨ J(a | (by intro _ ha' rcases List.mem_pmap.mp ha' with ⟨p, hp, rfl⟩ - haveI : Fact p.Prime := ⟨prime_of_mem_primeFactorsList hp⟩ + have : Fact p.Prime := ⟨prime_of_mem_primeFactorsList hp⟩ exact quadraticChar_isQuadratic (ZMod p) a) /-- The symbol `J(1 | b)` has the value `1`. -/ diff --git a/Mathlib/NumberTheory/LocalField/Basic.lean b/Mathlib/NumberTheory/LocalField/Basic.lean index dd9694d4d63bb9..5d67a6c2ae686a 100644 --- a/Mathlib/NumberTheory/LocalField/Basic.lean +++ b/Mathlib/NumberTheory/LocalField/Basic.lean @@ -61,16 +61,16 @@ variable (K : Type*) [Field K] [ValuativeRel K] [TopologicalSpace K] [IsNonarchi attribute [local simp] zero_lt_iff instance : IsTopologicalDivisionRing K := by - letI := IsTopologicalAddGroup.rightUniformSpace K - haveI := isUniformAddGroup_of_addCommGroup (G := K) + let := IsTopologicalAddGroup.rightUniformSpace K + have := isUniformAddGroup_of_addCommGroup (G := K) infer_instance lemma isCompact_closedBall (γ : ValueGroupWithZero K) : IsCompact { x | valuation K x ≤ γ } := by obtain ⟨γ, rfl⟩ := ValuativeRel.valuation_surjective γ by_cases hγ : γ = 0 · simp [hγ] - letI := IsTopologicalAddGroup.rightUniformSpace K - letI := isUniformAddGroup_of_addCommGroup (G := K) + let := IsTopologicalAddGroup.rightUniformSpace K + let := isUniformAddGroup_of_addCommGroup (G := K) obtain ⟨s, hs, -, hs'⟩ := LocallyCompactSpace.local_compact_nhds (0 : K) .univ Filter.univ_mem obtain ⟨r, hr, hr1, H⟩ : ∃ r', r' ≠ 0 ∧ valuation K r' < 1 ∧ { x | valuation K x ≤ valuation K r' } ⊆ s := by @@ -115,8 +115,8 @@ instance : IsDiscreteValuationRing 𝒪[K] := noncomputable def valueGroupWithZeroIsoInt : ValueGroupWithZero K ≃*o ℤᵐ⁰ := by apply Nonempty.some - letI := IsTopologicalAddGroup.rightUniformSpace K - haveI := isUniformAddGroup_of_addCommGroup (G := K) + let := IsTopologicalAddGroup.rightUniformSpace K + have := isUniformAddGroup_of_addCommGroup (G := K) obtain ⟨_⟩ := Valued.integer.locallyFiniteOrder_units_mrange_of_isCompact_integer (isCompact_iff_compactSpace.mpr (inferInstance : CompactSpace 𝒪[K])) let e : (MonoidHom.mrange (valuation K)) ≃*o ValueGroupWithZero K := diff --git a/Mathlib/NumberTheory/LucasLehmer.lean b/Mathlib/NumberTheory/LucasLehmer.lean index 137d17b82b52ba..afc09ce76a8afc 100644 --- a/Mathlib/NumberTheory/LucasLehmer.lean +++ b/Mathlib/NumberTheory/LucasLehmer.lean @@ -555,7 +555,7 @@ theorem order_ω (p' : ℕ) (h : lucasLehmerResidue (p' + 2) = 0) : orderOf_dvd_iff_pow_eq_one.1 o have h : (1 : ZMod (q (p' + 2))) = -1 := congr_arg Prod.fst (ω_pow.symm.trans (ω_pow_eq_neg_one p' h)) - haveI : Fact (2 < (q (p' + 2) : ℕ)) := ⟨two_lt_q _⟩ + have : Fact (2 < (q (p' + 2) : ℕ)) := ⟨two_lt_q _⟩ apply ZMod.neg_one_ne_one h.symm · apply orderOf_dvd_iff_pow_eq_one.2 apply Units.ext diff --git a/Mathlib/NumberTheory/Modular.lean b/Mathlib/NumberTheory/Modular.lean index dbd0b531c022d9..9b80cbcdb1791b 100644 --- a/Mathlib/NumberTheory/Modular.lean +++ b/Mathlib/NumberTheory/Modular.lean @@ -115,7 +115,7 @@ theorem tendsto_normSq_coprime_pair : Filter.Tendsto (fun p : Fin 2 → ℤ => normSq ((p 0 : ℂ) * z + p 1)) cofinite atTop := by -- using this instance rather than the automatic `Function.module` makes unification issues in -- `LinearEquiv.isClosedEmbedding_of_injective` less bad later in the proof. - letI : Module ℝ (Fin 2 → ℝ) := NormedSpace.toModule + let : Module ℝ (Fin 2 → ℝ) := NormedSpace.toModule let π₀ : (Fin 2 → ℝ) →ₗ[ℝ] ℝ := LinearMap.proj 0 let π₁ : (Fin 2 → ℝ) →ₗ[ℝ] ℝ := LinearMap.proj 1 let f : (Fin 2 → ℝ) →ₗ[ℝ] ℂ := π₀.smulRight (z : ℂ) + π₁.smulRight 1 @@ -294,7 +294,7 @@ theorem exists_max_im : ∃ g : SL(2, ℤ), ∀ g' : SL(2, ℤ), (g' • z).im theorem exists_row_one_eq_and_min_re {cd : Fin 2 → ℤ} (hcd : IsCoprime (cd 0) (cd 1)) : ∃ g : SL(2, ℤ), g 1 = cd ∧ ∀ g' : SL(2, ℤ), g 1 = g' 1 → |(g • z).re| ≤ |(g' • z).re| := by - haveI : Nonempty { g : SL(2, ℤ) // g 1 = cd } := + have : Nonempty { g : SL(2, ℤ) // g 1 = cd } := let ⟨x, hx⟩ := bottom_row_surj hcd ⟨⟨x, hx.2⟩⟩ obtain ⟨g, hg⟩ := Filter.Tendsto.exists_forall_le (tendsto_abs_re_smul z hcd) diff --git a/Mathlib/NumberTheory/ModularForms/CongruenceSubgroups.lean b/Mathlib/NumberTheory/ModularForms/CongruenceSubgroups.lean index 0e53a993d11ea0..beb3d1992c98bb 100644 --- a/Mathlib/NumberTheory/ModularForms/CongruenceSubgroups.lean +++ b/Mathlib/NumberTheory/ModularForms/CongruenceSubgroups.lean @@ -299,7 +299,7 @@ lemma finiteIndex_conjGL (g : GL (Fin 2) ℚ) : (conjGL ⊤ (g.map <| Rat.castHo obtain ⟨N, hN, hN'⟩ := exists_Gamma_le_conj' g 1 rw [Gamma_one_top, ← MonoidHom.range_eq_map] at hN' suffices Γ(N) ≤ (t • 𝒮ℒ ⊓ 𝒮ℒ).comap (mapGL ℝ) by - haveI _ : NeZero N := ⟨hN⟩ + have _ : NeZero N := ⟨hN⟩ simpa only [index_comap] using! (finiteIndex_of_le this).index_ne_zero intro k hk simpa [mem_pointwise_smul_iff_inv_smul_mem] using! @@ -329,7 +329,7 @@ lemma IsCongruenceSubgroup.conjGL {Γ : Subgroup SL(2, ℤ)} (hΓ : IsCongruence (g : GL (Fin 2) ℚ) : IsCongruenceSubgroup (conjGL Γ (g.map <| Rat.castHom ℝ)) := by obtain ⟨M, hN, hΓM⟩ := hΓ - haveI _ : NeZero M := ⟨hN⟩ + have _ : NeZero M := ⟨hN⟩ obtain ⟨N, hN, hN'⟩ := exists_Gamma_le_conj' g M rw [Subgroup.pointwise_smul_subset_iff] at hN' refine ⟨N, ‹_›, fun x hx ↦ ?_⟩ diff --git a/Mathlib/NumberTheory/ModularForms/QExpansion.lean b/Mathlib/NumberTheory/ModularForms/QExpansion.lean index cddcd9165a1348..ddf5691779616f 100644 --- a/Mathlib/NumberTheory/ModularForms/QExpansion.lean +++ b/Mathlib/NumberTheory/ModularForms/QExpansion.lean @@ -244,7 +244,7 @@ private lemma hasFPowerSeriesOnBall_update {f : ℍ → ℂ} (hh : 0 < h) {c : rcases eq_or_ne r 0 with rfl | hr' · simp · lift r to NNReal using hr.ne_top - letI : FiniteDimensional ℝ ℂ := basisOneI.finiteDimensional_of_finite + let : FiniteDimensional ℝ ℂ := basisOneI.finiteDimensional_of_finite apply FormalMultilinearSeries.le_radius_of_summable simpa [smul_eq_mul, norm_mul, mul_comm, mul_left_comm, mul_assoc] using (hasSum_cuspFunction_of_hasSum_punctured hh hf (q := r) (by simpa using hr) diff --git a/Mathlib/NumberTheory/NumberField/Cyclotomic/Basic.lean b/Mathlib/NumberTheory/NumberField/Cyclotomic/Basic.lean index e177981d40d19d..dfc5b778061fab 100644 --- a/Mathlib/NumberTheory/NumberField/Cyclotomic/Basic.lean +++ b/Mathlib/NumberTheory/NumberField/Cyclotomic/Basic.lean @@ -90,7 +90,7 @@ theorem isIntegralClosure_adjoin_singleton_of_prime_pow [hcycl : IsCyclotomicExt let B := hζ.subOnePowerBasis ℚ have hint : IsIntegral ℤ B.gen := (hζ.isIntegral (NeZero.pos _)).sub isIntegral_one -- This can't be a `local instance` because it has metavariables. - letI := IsCyclotomicExtension.finiteDimensional {p ^ k} ℚ K + let := IsCyclotomicExtension.finiteDimensional {p ^ k} ℚ K have H := discr_mul_isIntegral_mem_adjoin ℚ hint h obtain ⟨u, n, hun⟩ := discr_prime_pow_eq_unit_mul_pow' hζ rw [hun] at H @@ -98,7 +98,7 @@ theorem isIntegralClosure_adjoin_singleton_of_prime_pow [hcycl : IsCyclotomicExt rw [← smul_assoc, ← smul_mul_assoc, Units.inv_eq_val_inv, zsmul_eq_mul, ← Int.cast_mul, Units.inv_mul, Int.cast_one, one_mul, smul_def, map_pow] at H cases k - · haveI : IsCyclotomicExtension {1} ℚ K := by simpa using hcycl + · have : IsCyclotomicExtension {1} ℚ K := by simpa using hcycl have : x ∈ (⊥ : Subalgebra ℚ K) := by rw [singleton_one ℚ K] exact mem_top @@ -255,7 +255,7 @@ theorem subOneIntegralPowerBasisOfPrimePow_gen [IsCyclotomicExtension {p ^ k} theorem zeta_sub_one_prime_of_ne_two [IsCyclotomicExtension {p ^ (k + 1)} ℚ K] (hζ : IsPrimitiveRoot ζ (p ^ (k + 1))) (hodd : p ≠ 2) : Prime (hζ.toInteger - 1) := by - letI := IsCyclotomicExtension.numberField {p ^ (k + 1)} ℚ K + let := IsCyclotomicExtension.numberField {p ^ (k + 1)} ℚ K refine Ideal.prime_of_irreducible_absNorm_span (fun h ↦ ?_) ?_ · apply hζ.pow_ne_one_of_pos_of_lt one_ne_zero (one_lt_pow₀ hp.out.one_lt (by simp)) rw [sub_eq_zero] at h @@ -664,7 +664,7 @@ Computes the absolute discriminant of the `n`-th cyclotomic field. theorem discr [hK : IsCyclotomicExtension {n} ℚ K] : haveI : NumberField K := IsCyclotomicExtension.numberField {n} ℚ K discr K = (-1) ^ (φ n / 2) * (n ^ φ n / ∏ p ∈ n.primeFactors, p ^ (φ n / (p - 1))) := by - haveI : NumberField K := IsCyclotomicExtension.numberField {n} ℚ K + have : NumberField K := IsCyclotomicExtension.numberField {n} ℚ K rw [← Int.sign_mul_natAbs (NumberField.discr K), sign_discr, nrComplexPlaces_eq_totient_div_two n] congr induction n using Nat.recOnPrimeCoprime generalizing K hn with @@ -767,7 +767,7 @@ open IntermediateField Algebra in theorem adjoin_singleton_eq_top [hK : IsCyclotomicExtension {n} ℚ K] {ζ : K} (hζ : IsPrimitiveRoot ζ n) : ℤ[hζ.toInteger] = ⊤ := by - haveI : NumberField K := IsCyclotomicExtension.numberField {n} ℚ K + have : NumberField K := IsCyclotomicExtension.numberField {n} ℚ K induction n using Nat.recOnPrimeCoprime generalizing K hn with | zero => exact (neZero_zero_iff_false.mp hn).elim | prime_pow p k hp => diff --git a/Mathlib/NumberTheory/NumberField/Discriminant/Basic.lean b/Mathlib/NumberTheory/NumberField/Discriminant/Basic.lean index b07cdf0a60b849..9144e95ea4163d 100644 --- a/Mathlib/NumberTheory/NumberField/Discriminant/Basic.lean +++ b/Mathlib/NumberTheory/NumberField/Discriminant/Basic.lean @@ -411,7 +411,7 @@ theorem finite_of_discr_bdd_of_isReal : simp_rw [Set.mem_iUnion] -- this is purely an optimization have : CharZero K := SubsemiringClass.instCharZero K - haveI : NumberField K := @NumberField.mk _ _ inferInstance hK₀ + have : NumberField K := @NumberField.mk _ _ inferInstance hK₀ obtain ⟨w₀, hw₀⟩ := hK₁ suffices minkowskiBound K ↑1 < (convexBodyLTFactor K) * B by obtain ⟨x, hx₁, hx₂⟩ := exists_primitive_element_lt_of_isReal K hw₀ this @@ -460,7 +460,7 @@ theorem finite_of_discr_bdd_of_isComplex : simp_rw [Set.mem_iUnion] -- this is purely an optimization have : CharZero K := SubsemiringClass.instCharZero K - haveI : NumberField K := @NumberField.mk _ _ inferInstance hK₀ + have : NumberField K := @NumberField.mk _ _ inferInstance hK₀ obtain ⟨w₀, hw₀⟩ := hK₁ suffices minkowskiBound K ↑1 < (convexBodyLT'Factor K) * boundOfDiscBdd N by obtain ⟨x, hx₁, hx₂⟩ := exists_primitive_element_lt_of_isComplex K hw₀ this @@ -503,7 +503,7 @@ theorem _root_.NumberField.finite_of_discr_bdd : rintro ⟨K, hK₀⟩ hK₁ -- this is purely an optimization have : CharZero K := SubsemiringClass.instCharZero K - haveI : NumberField K := @NumberField.mk _ _ inferInstance hK₀ + have : NumberField K := @NumberField.mk _ _ inferInstance hK₀ obtain ⟨w₀⟩ := (inferInstance : Nonempty (InfinitePlace K)) by_cases hw₀ : IsReal w₀ · apply Set.mem_union_left diff --git a/Mathlib/NumberTheory/NumberField/InfinitePlace/Embeddings.lean b/Mathlib/NumberTheory/NumberField/InfinitePlace/Embeddings.lean index b6646e9377dd59..2fe245f773389e 100644 --- a/Mathlib/NumberTheory/NumberField/InfinitePlace/Embeddings.lean +++ b/Mathlib/NumberTheory/NumberField/InfinitePlace/Embeddings.lean @@ -178,7 +178,7 @@ noncomputable def lift [Algebra k K] [Algebra.IsAlgebraic k K] (φ : k →+* ℂ theorem lift_comp_algebraMap [Algebra k K] [Algebra.IsAlgebraic k K] (φ : k →+* ℂ) : (lift K φ).comp (algebraMap k K) = φ := by unfold lift - letI := φ.toAlgebra + let := φ.toAlgebra rw [AlgHom.toRingHom_eq_coe, AlgHom.comp_algebraMap_of_tower, RingHom.algebraMap_toAlgebra'] @[simp] @@ -243,8 +243,8 @@ lemma isReal_comp_iff {f : k ≃+* K} {φ : K →+* ℂ} : lemma exists_comp_symm_eq_of_comp_eq [Algebra k K] [IsGalois k K] (φ ψ : K →+* ℂ) (h : φ.comp (algebraMap k K) = ψ.comp (algebraMap k K)) : ∃ σ : Gal(K/k), φ.comp σ.symm = ψ := by - letI := (φ.comp (algebraMap k K)).toAlgebra - letI := φ.toAlgebra + let := (φ.comp (algebraMap k K)).toAlgebra + let := φ.toAlgebra have : IsScalarTower k K ℂ := IsScalarTower.of_algebraMap_eq' rfl let ψ' : K →ₐ[k] ℂ := { ψ with commutes' := fun r ↦ (RingHom.congr_fun h r).symm } use (AlgHom.restrictNormal' ψ' K).symm diff --git a/Mathlib/NumberTheory/NumberField/InfinitePlace/Ramification.lean b/Mathlib/NumberTheory/NumberField/InfinitePlace/Ramification.lean index 521e28ad4eb9e7..40b1cd50282d61 100644 --- a/Mathlib/NumberTheory/NumberField/InfinitePlace/Ramification.lean +++ b/Mathlib/NumberTheory/NumberField/InfinitePlace/Ramification.lean @@ -331,8 +331,8 @@ lemma isUnramified_mk_iff_forall_isConj [IsGalois k K] {φ : K →+* ℂ} : rw [not_isUnramified_iff] at hφ rw [comap_mk, isReal_mk_iff, ← not_isReal_iff_isComplex, isReal_mk_iff, ← ComplexEmbedding.isConj_one_iff (k := k)] at hφ - letI := (φ.comp (algebraMap k K)).toAlgebra - letI := φ.toAlgebra + let := (φ.comp (algebraMap k K)).toAlgebra + let := φ.toAlgebra have : IsScalarTower k K ℂ := IsScalarTower.of_algebraMap_eq' rfl let φ' : K →ₐ[k] ℂ := { star φ with commutes' := fun r ↦ by simpa using! RingHom.congr_fun hφ.2 r } diff --git a/Mathlib/NumberTheory/NumberField/Norm.lean b/Mathlib/NumberTheory/NumberField/Norm.lean index 5df13dd08fc944..62f3cb41da6f02 100644 --- a/Mathlib/NumberTheory/NumberField/Norm.lean +++ b/Mathlib/NumberTheory/NumberField/Norm.lean @@ -97,10 +97,10 @@ theorem norm_norm [Algebra F L] [FiniteDimensional F L] [IsScalarTower K F L] (x variable {F} theorem isUnit_norm [CharZero K] {x : 𝓞 F} : IsUnit (norm K x) ↔ IsUnit x := by - letI : Algebra K (AlgebraicClosure K) := AlgebraicClosure.instAlgebra K + let : Algebra K (AlgebraicClosure K) := AlgebraicClosure.instAlgebra K let L := normalClosure K F (AlgebraicClosure F) - haveI : FiniteDimensional F L := FiniteDimensional.right K F L - haveI : IsGalois F L := IsGalois.tower_top_of_isGalois K F L + have : FiniteDimensional F L := FiniteDimensional.right K F L + have : IsGalois F L := IsGalois.tower_top_of_isGalois K F L calc IsUnit (norm K x) ↔ IsUnit ((norm K) x ^ finrank F L) := (isUnit_pow_iff (pos_iff_ne_zero.mp finrank_pos)).symm diff --git a/Mathlib/NumberTheory/Padics/Complex.lean b/Mathlib/NumberTheory/Padics/Complex.lean index 72a0247aea24b5..bd2d2d227071ed 100644 --- a/Mathlib/NumberTheory/Padics/Complex.lean +++ b/Mathlib/NumberTheory/Padics/Complex.lean @@ -206,8 +206,8 @@ theorem isNonarchimedean : IsNonarchimedean (Norm.norm : ℂ_[p] → ℝ) := theorem norm_eq_norm' : (‖·‖ : ℂ_[p] → ℝ) = Valued.v.norm := by apply UniformSpace.Completion.extension_unique (f := @norm (PadicAlgCl p) _) (g := Valued.v.norm) · exact uniformContinuous_norm - · letI S := (Valued.toNormedField ℂ_[p] NNReal).toNormedCommRing.toNormedRing.toSeminormedRing - letI := S.toNonUnitalSeminormedRing.toSeminormedAddCommGroup.toSeminormedAddGroup + · let S := (Valued.toNormedField ℂ_[p] NNReal).toNormedCommRing.toNormedRing.toSeminormedRing + let := S.toNonUnitalSeminormedRing.toSeminormedAddCommGroup.toSeminormedAddGroup exact @uniformContinuous_norm ℂ_[p] this · intro x simp only [Valued.v.norm_def, RankOne.hom_eq_embedding] diff --git a/Mathlib/NumberTheory/Padics/RingHoms.lean b/Mathlib/NumberTheory/Padics/RingHoms.lean index 7c697875793946..9556b01b05ac21 100644 --- a/Mathlib/NumberTheory/Padics/RingHoms.lean +++ b/Mathlib/NumberTheory/Padics/RingHoms.lean @@ -580,7 +580,7 @@ theorem nthHomSeq_one : nthHomSeq f_compat 1 ≈ 1 := by change _ < _ at hε use 1 intro j hj - haveI : Fact (1 < p ^ j) := ⟨Nat.one_lt_pow (by lia) hp_prime.1.one_lt⟩ + have : Fact (1 < p ^ j) := ⟨Nat.one_lt_pow (by lia) hp_prime.1.one_lt⟩ suffices (ZMod.cast (1 : ZMod (p ^ j)) : ℚ) = 1 by simp [nthHomSeq, nthHom, this, hε] rw [ZMod.cast_eq_val, ZMod.val_one, Nat.cast_one] diff --git a/Mathlib/NumberTheory/Pell.lean b/Mathlib/NumberTheory/Pell.lean index 8b68eb9388aeb0..04b6b2d6504225 100644 --- a/Mathlib/NumberTheory/Pell.lean +++ b/Mathlib/NumberTheory/Pell.lean @@ -355,7 +355,7 @@ theorem exists_of_not_isSquare (h₀ : 0 < d) (hd : ¬IsSquare d) : obtain ⟨a, ha⟩ := (Int.pow_dvd_pow_iff two_ne_zero).mp ⟨d, hq⟩ rw [ha, mul_pow, mul_right_inj' (pow_pos (Int.natCast_pos.mpr q.pos) 2).ne'] at hq exact hd ⟨a, sq a ▸ hq.symm⟩ - haveI := neZero_iff.mpr (Int.natAbs_ne_zero.mpr hm₀) + have := neZero_iff.mpr (Int.natAbs_ne_zero.mpr hm₀) let f : ℚ → ZMod m.natAbs × ZMod m.natAbs := fun q => (q.num, q.den) obtain ⟨q₁, h₁ : q₁.num ^ 2 - d * (q₁.den : ℤ) ^ 2 = m, q₂, h₂ : q₂.num ^ 2 - d * (q₂.den : ℤ) ^ 2 = m, hne, hqf⟩ := diff --git a/Mathlib/NumberTheory/PrimesCongruentOne.lean b/Mathlib/NumberTheory/PrimesCongruentOne.lean index 0d250aa0429b1a..30f10e47ed7288 100644 --- a/Mathlib/NumberTheory/PrimesCongruentOne.lean +++ b/Mathlib/NumberTheory/PrimesCongruentOne.lean @@ -39,7 +39,7 @@ theorem exists_prime_gt_modEq_one {k : ℕ} (n : ℕ) (hk0 : k ≠ 0) : _ < (eval (b : ℤ) (cyclotomic (k + 1) ℤ)).natAbs := sub_one_lt_natAbs_cyclotomic_eval hk1 (succ_le_iff.1 hb).ne' let p := minFac (eval (↑b) (cyclotomic k ℤ)).natAbs - haveI hprime : Fact p.Prime := ⟨minFac_prime (ne_of_lt hgt).symm⟩ + have hprime : Fact p.Prime := ⟨minFac_prime (ne_of_lt hgt).symm⟩ have hroot : IsRoot (cyclotomic k (ZMod p)) (castRingHom (ZMod p) b) := by have : ((b : ℤ) : ZMod p) = ↑(Int.castRingHom (ZMod p) b) := by simp rw [IsRoot.def, ← map_cyclotomic_int k (ZMod p), eval_map, coe_castRingHom, @@ -52,7 +52,7 @@ theorem exists_prime_gt_modEq_one {k : ℕ} (n : ℕ) (hk0 : k ≠ 0) : · exact hpb (dvd_mul_of_dvd_right (dvd_factorial (minFac_pos _) habs) _) · have hdiv : orderOf (b : ZMod p) ∣ p - 1 := ZMod.orderOf_dvd_card_sub_one (mt (CharP.cast_eq_zero_iff _ _ _).1 hpb) - haveI : NeZero (k : ZMod p) := + have : NeZero (k : ZMod p) := NeZero.of_not_dvd (ZMod p) fun hpk => hpb (dvd_mul_of_dvd_left hpk _) have : k = orderOf (b : ZMod p) := (isRoot_cyclotomic_iff.mp hroot).eq_orderOf rw [← this] at hdiv diff --git a/Mathlib/NumberTheory/RamificationInertia/Basic.lean b/Mathlib/NumberTheory/RamificationInertia/Basic.lean index 95df6e14862ac7..2da3a085e0caa7 100644 --- a/Mathlib/NumberTheory/RamificationInertia/Basic.lean +++ b/Mathlib/NumberTheory/RamificationInertia/Basic.lean @@ -199,7 +199,7 @@ theorem FinrankQuotientMap.linearIndependent_of_nontrivial [IsDedekindDomain R] use s obtain ⟨a, hag, j, hjs, hgI⟩ := Ideal.exist_integer_multiples_notMem hRS s g hj's hj'g choose g'' hg'' using hag - letI := Classical.propDecidable + let := Classical.propDecidable let g' i := if h : i ∈ s then g'' i h else 0 have hg' : ∀ i ∈ s, algebraMap _ _ (g' i) = a * g i := by intro i hi; exact (congr_arg _ (dif_pos hi)).trans (hg'' i hi) @@ -457,7 +457,7 @@ theorem rank_prime_pow_ramificationIdx [IsDedekindDomain S] [p.IsMaximal] [P.IsP @Module.rank (R ⧸ p) (S ⧸ P) _ _ (@Algebra.toModule _ _ _ _ <| @Quotient.algebraQuotientOfRamificationIdxNeZero _ _ _ _ _ _ _ ⟨he⟩) := by - letI : NeZero e := ⟨he⟩ + let : NeZero e := ⟨he⟩ have := rank_pow_quot p P hP0 0 (Nat.zero_le e) rw [pow_zero, Nat.sub_zero, Ideal.one_eq_top, Ideal.map_top] at this exact (rank_top (R ⧸ p) _).symm.trans this @@ -471,8 +471,8 @@ theorem finrank_prime_pow_ramificationIdx [IsDedekindDomain S] (hP0 : P ≠ ⊥) @finrank (R ⧸ p) (S ⧸ P) _ _ (@Algebra.toModule _ _ _ _ <| @Quotient.algebraQuotientOfRamificationIdxNeZero _ _ _ _ _ _ _ ⟨he⟩) := by - letI : NeZero e := ⟨he⟩ - letI : Algebra (R ⧸ p) (S ⧸ P) := Quotient.algebraQuotientOfRamificationIdxNeZero p P + let : NeZero e := ⟨he⟩ + let : Algebra (R ⧸ p) (S ⧸ P) := Quotient.algebraQuotientOfRamificationIdxNeZero p P have hdim := rank_prime_pow_ramificationIdx _ _ hP0 he by_cases hP : FiniteDimensional (R ⧸ p) (S ⧸ P) · have := (finiteDimensional_iff_of_rank_eq_nsmul he hdim).mpr hP diff --git a/Mathlib/NumberTheory/RamificationInertia/Inertia.lean b/Mathlib/NumberTheory/RamificationInertia/Inertia.lean index bb1e0e04d4fba0..355242429ca977 100644 --- a/Mathlib/NumberTheory/RamificationInertia/Inertia.lean +++ b/Mathlib/NumberTheory/RamificationInertia/Inertia.lean @@ -199,10 +199,10 @@ theorem inertiaDeg'_algebra_tower (p : Ideal R) (P : Ideal S) (I : Ideal T) [p.I have h₂ := I.over_def P have h₃ := (LiesOver.trans I P p).over simp only [inertiaDeg', dif_pos h₁.symm, dif_pos h₂.symm, dif_pos h₃.symm] - letI : Algebra (R ⧸ p) (S ⧸ P) := Ideal.Quotient.algebraQuotientOfLEComap h₁.le - letI : Algebra (S ⧸ P) (T ⧸ I) := Ideal.Quotient.algebraQuotientOfLEComap h₂.le - letI : Algebra (R ⧸ p) (T ⧸ I) := Ideal.Quotient.algebraQuotientOfLEComap h₃.le - letI : IsScalarTower (R ⧸ p) (S ⧸ P) (T ⧸ I) := IsScalarTower.of_algebraMap_eq <| by + let : Algebra (R ⧸ p) (S ⧸ P) := Ideal.Quotient.algebraQuotientOfLEComap h₁.le + let : Algebra (S ⧸ P) (T ⧸ I) := Ideal.Quotient.algebraQuotientOfLEComap h₂.le + let : Algebra (R ⧸ p) (T ⧸ I) := Ideal.Quotient.algebraQuotientOfLEComap h₃.le + let : IsScalarTower (R ⧸ p) (S ⧸ P) (T ⧸ I) := IsScalarTower.of_algebraMap_eq <| by rintro ⟨x⟩; exact congr_arg _ (IsScalarTower.algebraMap_apply R S T x) exact (finrank_mul_finrank (R ⧸ p) (S ⧸ P) (T ⧸ I)).symm diff --git a/Mathlib/NumberTheory/RamificationInertia/Ramification.lean b/Mathlib/NumberTheory/RamificationInertia/Ramification.lean index 4e5a335aecebcf..a4e30787f660b8 100644 --- a/Mathlib/NumberTheory/RamificationInertia/Ramification.lean +++ b/Mathlib/NumberTheory/RamificationInertia/Ramification.lean @@ -403,7 +403,7 @@ theorem ramificationIdx'_algebra_tower [IsDedekindDomain S] [IsDedekindDomain T] exact ne_bot_of_map_ne_bot hfg have hp0 : P ≠ ⊥ := ne_bot_of_map_ne_bot hg0 have hq0 : Q ≠ ⊥ := ne_bot_of_le_ne_bot hg0 hg - letI : P.IsMaximal := Ring.DimensionLEOne.maximalOfPrime hp0 hpm + let : P.IsMaximal := Ring.DimensionLEOne.maximalOfPrime hp0 hpm rw [IsDedekindDomain.ramificationIdx'_eq_normalizedFactors_count hf0 hpm hp0, IsDedekindDomain.ramificationIdx'_eq_normalizedFactors_count hg0 hqm hq0, IsDedekindDomain.ramificationIdx'_eq_normalizedFactors_count hfg hqm hq0, diff --git a/Mathlib/NumberTheory/WellApproximable.lean b/Mathlib/NumberTheory/WellApproximable.lean index 730fc04d079d20..cc134902446249 100644 --- a/Mathlib/NumberTheory/WellApproximable.lean +++ b/Mathlib/NumberTheory/WellApproximable.lean @@ -212,7 +212,7 @@ theorem addWellApproximable_ae_empty_or_univ (δ : ℕ → ℝ) (hδ : Tendsto `E` is almost equal to `C p` for every prime. Combining this with 3 we find that `E` is almost invariant under the map `y ↦ y + 1/p` for every prime `p`. The required result then follows from `AddCircle.ae_empty_or_univ_of_forall_vadd_ae_eq_self`. -/ - letI : SemilatticeSup Nat.Primes := Nat.Subtype.semilatticeSup _ + let : SemilatticeSup Nat.Primes := Nat.Subtype.semilatticeSup _ set μ : Measure 𝕊 := volume set u : Nat.Primes → 𝕊 := fun p => ↑((↑(1 : ℕ) : ℝ) / ((p : ℕ) : ℝ) * T) have hu₀ : ∀ p : Nat.Primes, addOrderOf (u p) = (p : ℕ) := by diff --git a/Mathlib/NumberTheory/Wilson.lean b/Mathlib/NumberTheory/Wilson.lean index 9401f7b96b43c2..97c84e9181afc8 100644 --- a/Mathlib/NumberTheory/Wilson.lean +++ b/Mathlib/NumberTheory/Wilson.lean @@ -96,7 +96,7 @@ theorem prime_of_fac_equiv_neg_one (h : ((n - 1)! : ZMod n) = -1) (h1 : n ≠ 1) /-- **Wilson's Theorem**: For `n ≠ 1`, `(n-1)!` is congruent to `-1` modulo `n` iff n is prime. -/ theorem prime_iff_fac_equiv_neg_one (h : n ≠ 1) : Prime n ↔ ((n - 1)! : ZMod n) = -1 := by refine ⟨fun h1 => ?_, fun h2 => prime_of_fac_equiv_neg_one h2 h⟩ - haveI := Fact.mk h1 + have := Fact.mk h1 exact ZMod.wilsons_lemma n end Nat diff --git a/Mathlib/NumberTheory/Zsqrtd/Basic.lean b/Mathlib/NumberTheory/Zsqrtd/Basic.lean index fd00e21c96fb49..35cd025fc370f4 100644 --- a/Mathlib/NumberTheory/Zsqrtd/Basic.lean +++ b/Mathlib/NumberTheory/Zsqrtd/Basic.lean @@ -863,7 +863,7 @@ theorem norm_eq_zero {d : ℤ} (h_nonsquare : ∀ n : ℤ, d ≠ n * n) (a : ℤ rw [sub_eq_zero] at ha by_cases! h : 0 ≤ d · obtain ⟨d', rfl⟩ := Int.eq_ofNat_of_zero_le h - haveI : Nonsquare d' := ⟨fun n h => h_nonsquare n <| mod_cast h⟩ + have : Nonsquare d' := ⟨fun n h => h_nonsquare n <| mod_cast h⟩ exact divides_sq_eq_zero_z ha · suffices a.re * a.re = 0 by rw [eq_zero_of_mul_self_eq_zero this] at ha ⊢ diff --git a/Mathlib/Order/Category/NonemptyFinLinOrd.lean b/Mathlib/Order/Category/NonemptyFinLinOrd.lean index ed2d2b2d98e1c1..da4a9663edfb35 100644 --- a/Mathlib/Order/Category/NonemptyFinLinOrd.lean +++ b/Mathlib/Order/Category/NonemptyFinLinOrd.lean @@ -210,12 +210,12 @@ instance : HasStrongEpiMonoFactorisations NonemptyFinLinOrd.{u} := let I := of (Set.image f ⊤) let e : X ⟶ I := ofHom ⟨fun x => ⟨f x, ⟨x, by tauto⟩⟩, fun x₁ x₂ h => f.hom.hom.monotone h⟩ let m : I ⟶ Y := ofHom ⟨fun y => y.1, by tauto⟩ - haveI : Epi e := by + have : Epi e := by rw [epi_iff_surjective] rintro ⟨_, y, h, rfl⟩ exact ⟨y, rfl⟩ - haveI : StrongEpi e := strongEpi_of_epi e - haveI : Mono m := ConcreteCategory.mono_of_injective _ (fun x y h => Subtype.ext h) + have : StrongEpi e := strongEpi_of_epi e + have : Mono m := ConcreteCategory.mono_of_injective _ (fun x y h => Subtype.ext h) exact ⟨⟨I, m, e, rfl⟩⟩⟩ end NonemptyFinLinOrd diff --git a/Mathlib/Order/CompleteLattice/Basic.lean b/Mathlib/Order/CompleteLattice/Basic.lean index 419c44485b3fad..9ac1a9e45d4ea7 100644 --- a/Mathlib/Order/CompleteLattice/Basic.lean +++ b/Mathlib/Order/CompleteLattice/Basic.lean @@ -470,7 +470,7 @@ theorem iSup_subtype'' {ι} (s : Set ι) (f : ι → α) : ⨆ i : s, f i = ⨆ @[to_dual] theorem biSup_const {a : α} {s : Set β} (hs : s.Nonempty) : ⨆ i ∈ s, a = a := by - haveI : Nonempty s := Set.nonempty_coe_sort.mpr hs + have : Nonempty s := Set.nonempty_coe_sort.mpr hs rw [← iSup_subtype'', iSup_const] @[to_dual] @@ -502,7 +502,7 @@ theorem sup_iSup [Nonempty ι] {f : ι → α} {a : α} : (a ⊔ ⨆ x, f x) = @[to_dual] theorem biSup_sup {p : ι → Prop} {f : ∀ i, p i → α} {a : α} (h : ∃ i, p i) : (⨆ (i) (h : p i), f i h) ⊔ a = ⨆ (i) (h : p i), f i h ⊔ a := by - haveI : Nonempty { i // p i } := + have : Nonempty { i // p i } := let ⟨i, hi⟩ := h ⟨⟨i, hi⟩⟩ rw [iSup_subtype', iSup_subtype', iSup_sup] diff --git a/Mathlib/Order/ConditionallyCompleteLattice/Indexed.lean b/Mathlib/Order/ConditionallyCompleteLattice/Indexed.lean index 65502dab75bcbf..9767efeee07a8a 100644 --- a/Mathlib/Order/ConditionallyCompleteLattice/Indexed.lean +++ b/Mathlib/Order/ConditionallyCompleteLattice/Indexed.lean @@ -578,7 +578,7 @@ theorem l_ciSup (gc : GaloisConnection l u) {f : ι → α} (hf : BddAbove (rang theorem l_ciSup_set (gc : GaloisConnection l u) {s : Set γ} {f : γ → α} (hf : BddAbove (f '' s)) (hne : s.Nonempty) : l (⨆ i : s, f i) = ⨆ i : s, l (f i) := by - haveI := hne.to_subtype + have := hne.to_subtype rw [image_eq_range] at hf exact gc.l_ciSup hf diff --git a/Mathlib/Order/ConditionallyCompletePartialOrder/Indexed.lean b/Mathlib/Order/ConditionallyCompletePartialOrder/Indexed.lean index 2de0ca976d89d7..727b409414c943 100644 --- a/Mathlib/Order/ConditionallyCompletePartialOrder/Indexed.lean +++ b/Mathlib/Order/ConditionallyCompletePartialOrder/Indexed.lean @@ -150,7 +150,7 @@ theorem Monotone.ciSup_mem_iInter_Icc_of_antitone [Preorder β] [IsDirectedOrder {f g : β → α} (hf : Monotone f) (hg : Antitone g) (h : f ≤ g) : (⨆ n, f n) ∈ ⋂ n, Icc (f n) (g n) := by refine mem_iInter.2 fun n => ?_ - haveI : Nonempty β := ⟨n⟩ + have : Nonempty β := ⟨n⟩ have h₁ : ∀ m, f m ≤ g n := fun m => hf.forall_le_of_antitone hg h m n have h₂ : Directed (· ≤ ·) f := hf.directed_le exact ⟨h₂.le_ciSup ⟨g <| n, forall_mem_range.2 h₁⟩ _, h₂.ciSup_le h₁⟩ @@ -213,7 +213,7 @@ theorem l_ciSup_of_directed (gc : GaloisConnection l u) {f : ι → α} (hd : Di theorem l_ciSup_set_of_directedOn (gc : GaloisConnection l u) {s : Set γ} {f : γ → α} (hd : DirectedOn (· ≤ ·) (f '' s)) (hf : BddAbove (f '' s)) (hne : s.Nonempty) : l (⨆ i : s, f i) = ⨆ i : s, l (f i) := by - haveI := hne.to_subtype + have := hne.to_subtype rw [image_eq_range] at hf refine gc.l_ciSup_of_directed ?_ hf simpa [← directedOn_range, ← comp_def, range_comp] diff --git a/Mathlib/Order/CountableDenseLinearOrder.lean b/Mathlib/Order/CountableDenseLinearOrder.lean index 3b331237fdc464..58be73b2115c5e 100644 --- a/Mathlib/Order/CountableDenseLinearOrder.lean +++ b/Mathlib/Order/CountableDenseLinearOrder.lean @@ -227,7 +227,7 @@ theorem embedding_from_countable_to_dense [Countable α] [DenselyOrdered β] [No cases nonempty_encodable α rcases exists_pair_lt β with ⟨x, y, hxy⟩ obtain ⟨a, ha⟩ := exists_between hxy - haveI : Nonempty (Set.Ioo x y) := ⟨⟨a, ha⟩⟩ + have : Nonempty (Set.Ioo x y) := ⟨⟨a, ha⟩⟩ let our_ideal : Ideal (PartialIso α _) := idealOfCofinals default (definedAtLeft (Set.Ioo x y)) let F a := funOfIdeal a our_ideal (cofinal_meets_idealOfCofinals _ _ a) diff --git a/Mathlib/Order/Disjoint.lean b/Mathlib/Order/Disjoint.lean index 844d5aa07f29c4..f2d81c18457c6a 100644 --- a/Mathlib/Order/Disjoint.lean +++ b/Mathlib/Order/Disjoint.lean @@ -168,8 +168,8 @@ lemma disjoint_subtype_iff {pr : α → Prop} (Pinf : ∀ ⦃s t : α⦄, pr s letI : SemilatticeInf (Subtype pr) := Subtype.semilatticeInf Pinf letI : OrderBot (Subtype pr) := Subtype.orderBot hbot Disjoint a b ↔ Disjoint a.val b.val := by - letI : SemilatticeInf (Subtype pr) := Subtype.semilatticeInf Pinf - letI : OrderBot (Subtype pr) := Subtype.orderBot hbot + let : SemilatticeInf (Subtype pr) := Subtype.semilatticeInf Pinf + let : OrderBot (Subtype pr) := Subtype.orderBot hbot rw [disjoint_iff, disjoint_iff, ← Subtype.coe_inf Pinf, ← Subtype.coe_bot hbot] exact Subtype.coe_inj.symm diff --git a/Mathlib/Order/Extension/Linear.lean b/Mathlib/Order/Extension/Linear.lean index 96bb308852051f..bd575698288406 100644 --- a/Mathlib/Order/Extension/Linear.lean +++ b/Mathlib/Order/Extension/Linear.lean @@ -27,7 +27,7 @@ theorem extend_partialOrder {α : Type u} (r : α → α → Prop) [IsPartialOrd let S := { s | IsPartialOrder α s } have hS : ∀ c, c ⊆ S → IsChain (· ≤ ·) c → ∀ y ∈ c, ∃ ub ∈ S, ∀ z ∈ c, z ≤ ub := by rintro c hc₁ hc₂ s hs - haveI := (hc₁ hs).1 + have := (hc₁ hs).1 refine ⟨sSup c, ?_, fun z hz => le_sSup hz⟩ refine { refl := ?_ @@ -37,19 +37,19 @@ theorem extend_partialOrder {α : Type u} (r : α → α → Prop) [IsPartialOrd · intro x exact ⟨s, hs, refl x⟩ · rintro x y z ⟨s₁, h₁s₁, h₂s₁⟩ ⟨s₂, h₁s₂, h₂s₂⟩ - haveI : IsPartialOrder _ _ := hc₁ h₁s₁ - haveI : IsPartialOrder _ _ := hc₁ h₁s₂ + have : IsPartialOrder _ _ := hc₁ h₁s₁ + have : IsPartialOrder _ _ := hc₁ h₁s₂ rcases hc₂.total h₁s₁ h₁s₂ with h | h · exact ⟨s₂, h₁s₂, _root_.trans (h _ _ h₂s₁) h₂s₂⟩ · exact ⟨s₁, h₁s₁, _root_.trans h₂s₁ (h _ _ h₂s₂)⟩ · rintro x y ⟨s₁, h₁s₁, h₂s₁⟩ ⟨s₂, h₁s₂, h₂s₂⟩ - haveI : IsPartialOrder _ _ := hc₁ h₁s₁ - haveI : IsPartialOrder _ _ := hc₁ h₁s₂ + have : IsPartialOrder _ _ := hc₁ h₁s₁ + have : IsPartialOrder _ _ := hc₁ h₁s₂ rcases hc₂.total h₁s₁ h₁s₂ with h | h · exact antisymm (h _ _ h₂s₁) h₂s₂ · apply antisymm h₂s₁ (h _ _ h₂s₂) obtain ⟨s, hrs, hs⟩ := zorn_le_nonempty₀ S hS r ‹_› - haveI : IsPartialOrder α s := hs.prop + have : IsPartialOrder α s := hs.prop refine ⟨s, { total := ?_, refl := hs.1.refl, trans := hs.1.trans, antisymm := hs.1.antisymm }, hrs⟩ intro x y diff --git a/Mathlib/Order/Filter/AtTopBot/BigOperators.lean b/Mathlib/Order/Filter/AtTopBot/BigOperators.lean index 6b205b40d618b4..48847d7fe443b0 100644 --- a/Mathlib/Order/Filter/AtTopBot/BigOperators.lean +++ b/Mathlib/Order/Filter/AtTopBot/BigOperators.lean @@ -57,7 +57,7 @@ the same assumptions. -/ theorem Function.Injective.map_atTop_finsetProd_eq {g : α → β} (hg : Function.Injective g) {f : β → M} (hf : ∀ x, x ∉ Set.range g → f x = 1) : map (fun s => ∏ i ∈ s, f (g i)) atTop = map (fun s => ∏ i ∈ s, f i) atTop := by - haveI := Classical.decEq β + have := Classical.decEq β apply le_antisymm <;> refine map_atTop_finsetProd_le_of_prod_eq fun s => ?_ · refine ⟨s.preimage g hg.injOn, fun t ht => ?_⟩ refine ⟨t.image g ∪ s, Finset.subset_union_right, ?_⟩ diff --git a/Mathlib/Order/Filter/Basic.lean b/Mathlib/Order/Filter/Basic.lean index c9c47c96d06c0e..255ea53e9fd563 100644 --- a/Mathlib/Order/Filter/Basic.lean +++ b/Mathlib/Order/Filter/Basic.lean @@ -488,7 +488,7 @@ theorem mem_iInf_of_directed {f : ι → Filter α} (h : Directed (· ≥ ·) f) theorem mem_biInf_of_directed {f : β → Filter α} {s : Set β} (h : DirectedOn (f ⁻¹'o (· ≥ ·)) s) (ne : s.Nonempty) {t : Set α} : (t ∈ ⨅ i ∈ s, f i) ↔ ∃ i ∈ s, t ∈ f i := by - haveI := ne.to_subtype + have := ne.to_subtype simp_rw [iInf_subtype', mem_iInf_of_directed h.directed_val, Subtype.exists, exists_prop] theorem biInf_sets_eq {f : β → Filter α} {s : Set β} (h : DirectedOn (f ⁻¹'o (· ≥ ·)) s) @@ -900,7 +900,7 @@ theorem frequently_iSup {p : α → Prop} {fs : β → Filter α} : theorem Eventually.choice {r : α → β → Prop} {l : Filter α} [l.NeBot] (h : ∀ᶠ x in l, ∃ y, r x y) : ∃ f : α → β, ∀ᶠ x in l, r x (f x) := by - haveI : Nonempty β := let ⟨_, hx⟩ := h.exists; hx.nonempty + have : Nonempty β := let ⟨_, hx⟩ := h.exists; hx.nonempty choose! f hf using fun x (hx : ∃ y, r x y) => hx exact ⟨f, h.mono hf⟩ diff --git a/Mathlib/Order/Filter/CountableInter.lean b/Mathlib/Order/Filter/CountableInter.lean index 157177640ee2e9..c4c652eb3a619d 100644 --- a/Mathlib/Order/Filter/CountableInter.lean +++ b/Mathlib/Order/Filter/CountableInter.lean @@ -55,7 +55,7 @@ theorem countable_iInter_mem [Countable ι] {s : ι → Set α} : (⋂ i, s i) theorem countable_bInter_mem {ι : Type*} {S : Set ι} (hS : S.Countable) {s : ∀ i ∈ S, Set α} : (⋂ i, ⋂ hi : i ∈ S, s i ‹_›) ∈ l ↔ ∀ i, ∀ hi : i ∈ S, s i ‹_› ∈ l := by rw [biInter_eq_iInter] - haveI := hS.toEncodable + have := hS.toEncodable exact countable_iInter_mem.trans Subtype.forall theorem eventually_countable_forall [Countable ι] {p : α → ι → Prop} : @@ -94,7 +94,7 @@ theorem EventuallyLE.countable_bUnion {ι : Type*} {S : Set ι} (hS : S.Countabl {s t : ∀ i ∈ S, Set α} (h : ∀ i hi, s i hi ≤ᶠ[l] t i hi) : ⋃ i ∈ S, s i ‹_› ≤ᶠ[l] ⋃ i ∈ S, t i ‹_› := by simp only [biUnion_eq_iUnion] - haveI := hS.toEncodable + have := hS.toEncodable exact EventuallyLE.countable_iUnion fun i => h i i.2 @[deprecated (since := "2026-03-03")] alias _root_.EventuallyLE.countable_bUnion := @@ -129,7 +129,7 @@ theorem EventuallyLE.countable_bInter {ι : Type*} {S : Set ι} (hS : S.Countabl {s t : ∀ i ∈ S, Set α} (h : ∀ i hi, s i hi ≤ᶠ[l] t i hi) : ⋂ i ∈ S, s i ‹_› ≤ᶠ[l] ⋂ i ∈ S, t i ‹_› := by simp only [biInter_eq_iInter] - haveI := hS.toEncodable + have := hS.toEncodable exact EventuallyLE.countable_iInter fun i => h i i.2 @[deprecated (since := "2026-03-03")] alias _root_.EventuallyLE.countable_bInter := diff --git a/Mathlib/Order/Filter/Finite.lean b/Mathlib/Order/Filter/Finite.lean index 9a83bbff60523e..23abbf5698b21a 100644 --- a/Mathlib/Order/Filter/Finite.lean +++ b/Mathlib/Order/Filter/Finite.lean @@ -79,7 +79,7 @@ theorem mem_generate_iff {s : Set <| Set α} {U : Set α} : theorem mem_iInf_of_iInter {ι} {s : ι → Filter α} {U : Set α} {I : Set ι} (I_fin : I.Finite) {V : I → Set α} (hV : ∀ (i : I), V i ∈ s i) (hU : ⋂ i, V i ⊆ U) : U ∈ ⨅ i, s i := by - haveI := I_fin.fintype + have := I_fin.fintype refine mem_of_superset (iInter_mem.2 fun i => ?_) hU exact mem_iInf_of_mem (i : ι) (hV _) @@ -164,7 +164,7 @@ theorem _root_.Pairwise.exists_mem_filter_of_disjoint {ι : Type*} [Finite ι] { theorem _root_.Set.PairwiseDisjoint.exists_mem_filter {ι : Type*} {l : ι → Filter α} {t : Set ι} (hd : t.PairwiseDisjoint l) (ht : t.Finite) : ∃ s : ι → Set α, (∀ i, s i ∈ l i) ∧ t.PairwiseDisjoint s := by - haveI := ht.to_subtype + have := ht.to_subtype rcases (hd.subtype _ _).exists_mem_filter_of_disjoint with ⟨s, hsl, hsd⟩ lift s to (i : t) → {s // s ∈ l i} using hsl rcases @Subtype.exists_pi_extension ι (fun i => { s // s ∈ l i }) _ _ s with ⟨s, rfl⟩ diff --git a/Mathlib/Order/Filter/IsBounded.lean b/Mathlib/Order/Filter/IsBounded.lean index ac5ddefb6eee81..66a0d929650c80 100644 --- a/Mathlib/Order/Filter/IsBounded.lean +++ b/Mathlib/Order/Filter/IsBounded.lean @@ -180,7 +180,7 @@ theorem not_isBoundedUnder_of_tendsto_atBot [Preorder β] [NoMinOrder β] {f : theorem IsBoundedUnder.bddAbove_range_of_cofinite [Preorder β] [IsDirectedOrder β] {f : α → β} (hf : IsBoundedUnder (· ≤ ·) cofinite f) : BddAbove (range f) := by rcases hf with ⟨b, hb⟩ - haveI : Nonempty β := ⟨b⟩ + have : Nonempty β := ⟨b⟩ rw [← image_univ, ← union_compl_self { x | f x ≤ b }, image_union, bddAbove_union] exact ⟨⟨b, forall_mem_image.2 fun x => id⟩, (hb.image f).bddAbove⟩ diff --git a/Mathlib/Order/Filter/Map.lean b/Mathlib/Order/Filter/Map.lean index bd63d6f641c8eb..a40528371dad5b 100644 --- a/Mathlib/Order/Filter/Map.lean +++ b/Mathlib/Order/Filter/Map.lean @@ -715,7 +715,7 @@ theorem map_iInf_eq {f : ι → Filter α} {m : α → β} (hf : Directed (· theorem map_biInf_eq {ι : Type w} {f : ι → Filter α} {m : α → β} {p : ι → Prop} (h : DirectedOn (f ⁻¹'o (· ≥ ·)) { x | p x }) (ne : ∃ i, p i) : map m (⨅ (i) (_ : p i), f i) = ⨅ (i) (_ : p i), map m (f i) := by - haveI := nonempty_subtype.2 ne + have := nonempty_subtype.2 ne simp only [iInf_subtype'] exact map_iInf_eq h.directed_val diff --git a/Mathlib/Order/Filter/Pi.lean b/Mathlib/Order/Filter/Pi.lean index f894c0f5f64fdb..0ffcaac7825635 100644 --- a/Mathlib/Order/Filter/Pi.lean +++ b/Mathlib/Order/Filter/Pi.lean @@ -245,7 +245,7 @@ theorem pi_le_pi [∀ i, NeBot (f₁ i)] : pi f₁ ≤ pi f₂ ↔ ∀ i, f₁ i theorem pi_inj [∀ i, NeBot (f₁ i)] : pi f₁ = pi f₂ ↔ f₁ = f₂ := by refine ⟨fun h => ?_, congr_arg pi⟩ have hle : f₁ ≤ f₂ := pi_le_pi.1 h.le - haveI : ∀ i, NeBot (f₂ i) := fun i => neBot_of_le (hle i) + have : ∀ i, NeBot (f₂ i) := fun i => neBot_of_le (hle i) exact hle.antisymm (pi_le_pi.1 h.ge) theorem tendsto_piMap_pi {β : ι → Type*} {f : ∀ i, α i → β i} {l : ∀ i, Filter (α i)} diff --git a/Mathlib/Order/Filter/Prod.lean b/Mathlib/Order/Filter/Prod.lean index e6f62fd24324e3..e51ef5e2b5bcf6 100644 --- a/Mathlib/Order/Filter/Prod.lean +++ b/Mathlib/Order/Filter/Prod.lean @@ -267,7 +267,7 @@ theorem prod_inj {f₁ f₂ : Filter α} {g₁ g₂ : Filter β} [NeBot f₁] [N f₁ ×ˢ g₁ = f₂ ×ˢ g₂ ↔ f₁ = f₂ ∧ g₁ = g₂ := by refine ⟨fun h => ?_, fun h => h.1 ▸ h.2 ▸ rfl⟩ have hle : f₁ ≤ f₂ ∧ g₁ ≤ g₂ := prod_le_prod.1 h.le - haveI := neBot_of_le hle.1; haveI := neBot_of_le hle.2 + have := neBot_of_le hle.1; have := neBot_of_le hle.2 exact ⟨hle.1.antisymm <| (prod_le_prod.1 h.ge).1, hle.2.antisymm <| (prod_le_prod.1 h.ge).2⟩ theorem eventually_swap_iff {p : α × β → Prop} : diff --git a/Mathlib/Order/Filter/Ultrafilter/Defs.lean b/Mathlib/Order/Filter/Ultrafilter/Defs.lean index 26b11cfb7a8b8f..ffd0bf126c9b5a 100644 --- a/Mathlib/Order/Filter/Ultrafilter/Defs.lean +++ b/Mathlib/Order/Filter/Ultrafilter/Defs.lean @@ -340,7 +340,7 @@ theorem Iic_pure (a : α) : Iic (pure a : Filter α) = {⊥, pure a} := theorem mem_iff_ultrafilter : s ∈ f ↔ ∀ g : Ultrafilter α, ↑g ≤ f → s ∈ g := by refine ⟨fun hf g hg => hg hf, fun H => by_contra fun hf => ?_⟩ set g : Filter (sᶜ : Set α) := comap (↑) f - haveI : NeBot g := comap_neBot_iff_compl_range.2 (by simpa [compl_setOf]) + have : NeBot g := comap_neBot_iff_compl_range.2 (by simpa [compl_setOf]) simpa using H ((of g).map (↑)) (map_le_iff_le_comap.mpr (of_le g)) theorem le_iff_ultrafilter {f₁ f₂ : Filter α} : f₁ ≤ f₂ ↔ ∀ g : Ultrafilter α, ↑g ≤ f₁ → ↑g ≤ f₂ := @@ -375,13 +375,13 @@ noncomputable def ofComapInfPrincipal (h : m '' s ∈ g) : Ultrafilter α := theorem ofComapInfPrincipal_mem (h : m '' s ∈ g) : s ∈ ofComapInfPrincipal h := by let f := Filter.comap m g ⊓ 𝓟 s - haveI : f.NeBot := comap_inf_principal_neBot_of_image_mem h + have : f.NeBot := comap_inf_principal_neBot_of_image_mem h have : s ∈ f := mem_inf_of_right (mem_principal_self s) exact le_def.mp (of_le _) s this theorem ofComapInfPrincipal_eq_of_map (h : m '' s ∈ g) : (ofComapInfPrincipal h).map m = g := by let f := Filter.comap m g ⊓ 𝓟 s - haveI : f.NeBot := comap_inf_principal_neBot_of_image_mem h + have : f.NeBot := comap_inf_principal_neBot_of_image_mem h apply eq_of_le calc Filter.map m (of f) ≤ Filter.map m f := map_mono (of_le _) diff --git a/Mathlib/Order/KrullDimension.lean b/Mathlib/Order/KrullDimension.lean index 05c8a6d13cb88a..f6c513b027f70f 100644 --- a/Mathlib/Order/KrullDimension.lean +++ b/Mathlib/Order/KrullDimension.lean @@ -709,7 +709,7 @@ lemma krullDim_eq_top [InfiniteDimensionalOrder α] : krullDim α = ⊤ := le_antisymm le_top <| le_iSup_iff.mpr <| fun m hm ↦ match m, hm with | ⊥, hm => False.elim <| by - haveI : Inhabited α := ⟨LTSeries.withLength _ 0 0⟩ + have : Inhabited α := ⟨LTSeries.withLength _ 0 0⟩ exact not_le_of_gt (WithBot.bot_lt_coe _ : ⊥ < (0 : WithBot (WithTop ℕ))) <| hm default | some ⊤, _ => le_refl _ | some (some m), hm => by diff --git a/Mathlib/Order/Monotone/MonovaryOrder.lean b/Mathlib/Order/Monotone/MonovaryOrder.lean index 9f5841320901e2..1117a888d63587 100644 --- a/Mathlib/Order/Monotone/MonovaryOrder.lean +++ b/Mathlib/Order/Monotone/MonovaryOrder.lean @@ -44,7 +44,7 @@ variable {f g} lemma monovaryOn_iff_exists_monotoneOn : MonovaryOn f g s ↔ ∃ (_ : LinearOrder ι), MonotoneOn f s ∧ MonotoneOn g s := by classical - letI := linearOrderOfSTO (MonovaryOrder f g) + let := linearOrderOfSTO (MonovaryOrder f g) refine ⟨fun hfg => ⟨‹_›, monotoneOn_iff_forall_lt.2 fun i hi j hj hij => ?_, monotoneOn_iff_forall_lt.2 fun i hi j hj hij => ?_⟩, ?_⟩ · obtain h | ⟨h, -⟩ := Prod.lex_iff.1 hij <;> exact h.le diff --git a/Mathlib/Order/Partition/Equipartition.lean b/Mathlib/Order/Partition/Equipartition.lean index 777f7b00b1be55..b61cbc3d87afd0 100644 --- a/Mathlib/Order/Partition/Equipartition.lean +++ b/Mathlib/Order/Partition/Equipartition.lean @@ -142,7 +142,7 @@ theorem IsEquipartition.exists_partPreservingEquiv (hP : P.IsEquipartition) : have bij : z'.Bijective := by refine (bijective_iff_injective_and_card z').mpr ⟨fun a b e ↦ ?_, by simp⟩ simp_rw [z', z, Fin.mk.injEq, mul_comm #P.parts] at e - haveI : NeZero #P.parts := ⟨((Nat.zero_le _).trans_lt (gl a)).ne'⟩ + have : NeZero #P.parts := ⟨((Nat.zero_le _).trans_lt (gl a)).ne'⟩ change (#P.parts).divModEquiv.symm (_, _) = (#P.parts).divModEquiv.symm (_, _) at e simp only [Equiv.apply_eq_iff_eq, Prod.mk.injEq] at e apply_fun f diff --git a/Mathlib/Order/WellFoundedSet.lean b/Mathlib/Order/WellFoundedSet.lean index 7ef3749a6c2000..d3312cd54e6acf 100644 --- a/Mathlib/Order/WellFoundedSet.lean +++ b/Mathlib/Order/WellFoundedSet.lean @@ -389,8 +389,8 @@ protected theorem PartiallyWellOrderedOn.pi {α : ι → Type*} [Finite ι] {r : [∀ i, IsPreorder (α i) (r i)] {s : ∀ i, Set (α i)} (hs : ∀ i, PartiallyWellOrderedOn (s i) (r i)) : PartiallyWellOrderedOn (Set.univ.pi s) fun a b : ∀ i, α i => ∀ i, r i (a i) (b i) := by - haveI := Fintype.ofFinite ι - haveI : IsPreorder (∀ i, α i) (fun a b : ∀ i, α i => ∀ i, r i (a i) (b i)) := + have := Fintype.ofFinite ι + have : IsPreorder (∀ i, α i) (fun a b : ∀ i, α i => ∀ i, r i (a i) (b i)) := { refl a i := refl (a i) trans a b c hab hbc i := _root_.trans (hab i) (hbc i) } suffices ∀ (t : Finset ι), ∀ (f : ℕ → ∀ i, α i), (∀ n i, f n i ∈ s i) → diff --git a/Mathlib/Order/WellQuasiOrder.lean b/Mathlib/Order/WellQuasiOrder.lean index 0d34ea4abd0651..127e0624eece0c 100644 --- a/Mathlib/Order/WellQuasiOrder.lean +++ b/Mathlib/Order/WellQuasiOrder.lean @@ -88,8 +88,8 @@ product of well-quasi-ordered sets and `Pi.wellQuasiOrderedLE` when the relation theorem WellQuasiOrdered.pi {ι : Type*} {α : ι → Type*} [Finite ι] {r : ∀ i, (α i → α i → Prop)} [∀ i, IsPreorder (α i) (r i)] (hr : ∀ i, WellQuasiOrdered (r i)) : WellQuasiOrdered fun a b : ∀ i, α i => ∀ i, r i (a i) (b i) := by - haveI := Fintype.ofFinite ι - haveI : IsPreorder (∀ i, α i) (fun a b : ∀ i, α i => ∀ i, r i (a i) (b i)) := + have := Fintype.ofFinite ι + have : IsPreorder (∀ i, α i) (fun a b : ∀ i, α i => ∀ i, r i (a i) (b i)) := { refl a i := refl (a i) trans a b c hab hbc i := _root_.trans (hab i) (hbc i) } suffices ∀ (s : Finset ι) (f : ℕ → ∀ i, α i), diff --git a/Mathlib/Probability/CDF.lean b/Mathlib/Probability/CDF.lean index 52656abe68af9d..ec6345bbd532f6 100644 --- a/Mathlib/Probability/CDF.lean +++ b/Mathlib/Probability/CDF.lean @@ -105,7 +105,7 @@ lemma cdf_measure_stieltjesFunction (f : StieltjesFunction ℝ) (hf0 : Tendsto f open unitInterval in lemma unitInterval.cdf_eq_real (μ : Measure I) [IsProbabilityMeasure μ] (x : I) : cdf (μ.map Subtype.val) x.1 = μ.real (Icc 0 x) := by - haveI : IsProbabilityMeasure (μ.map Subtype.val) := isProbabilityMeasure_map (by fun_prop) + have : IsProbabilityMeasure (μ.map Subtype.val) := isProbabilityMeasure_map (by fun_prop) rw [ProbabilityTheory.cdf_eq_real, map_measureReal_apply measurable_subtype_coe measurableSet_Iic, subtype_Iic_eq_Icc] diff --git a/Mathlib/Probability/Independence/ZeroOne.lean b/Mathlib/Probability/Independence/ZeroOne.lean index 8966c4a502e96d..295f864ab87c27 100644 --- a/Mathlib/Probability/Independence/ZeroOne.lean +++ b/Mathlib/Probability/Independence/ZeroOne.lean @@ -181,7 +181,7 @@ theorem Kernel.indep_iSup_limsup (h_le : ∀ n, s n ≤ m0) (h_indep : iIndep s rw [iSup_comm] refine iSup_congr fun n => ?_ have h : ⨆ (i : β) (_ : n ∈ ns i), s n = ⨆ _ : ∃ i, n ∈ ns i, s n := by rw [iSup_exists] - haveI : Nonempty (∃ i : β, n ∈ ns i) := ⟨hns_univ n⟩ + have : Nonempty (∃ i : β, n ∈ ns i) := ⟨hns_univ n⟩ rw [h, iSup_const] theorem indep_iSup_limsup diff --git a/Mathlib/Probability/Kernel/Defs.lean b/Mathlib/Probability/Kernel/Defs.lean index cf3da6bb7a5360..d490b563f55331 100644 --- a/Mathlib/Probability/Kernel/Defs.lean +++ b/Mathlib/Probability/Kernel/Defs.lean @@ -391,7 +391,7 @@ theorem IsSFiniteKernel.finsetSum {κs : ι → Kernel α β} (I : Finset ι) | empty => rw [Finset.sum_empty]; infer_instance | insert i I hi_notMem_I h_ind => rw [Finset.sum_insert hi_notMem_I] - haveI : IsSFiniteKernel (κs i) := h i (Finset.mem_insert_self _ _) + have : IsSFiniteKernel (κs i) := h i (Finset.mem_insert_self _ _) have : IsSFiniteKernel (∑ x ∈ I, κs x) := h_ind fun i hiI => h i (Finset.mem_insert_of_mem hiI) exact IsSFiniteKernel.add _ _ diff --git a/Mathlib/Probability/Kernel/MeasurableIntegral.lean b/Mathlib/Probability/Kernel/MeasurableIntegral.lean index 0adc5b18d2add3..9b08a68cd9e4e5 100644 --- a/Mathlib/Probability/Kernel/MeasurableIntegral.lean +++ b/Mathlib/Probability/Kernel/MeasurableIntegral.lean @@ -81,7 +81,7 @@ theorem StronglyMeasurable.integral_kernel_prod_right ⦃f : α → β → E⦄ by_cases hE : CompleteSpace E; swap · simp [integral, hE, stronglyMeasurable_const] borelize E - haveI : TopologicalSpace.SeparableSpace (range (uncurry f) ∪ {0} : Set E) := + have : TopologicalSpace.SeparableSpace (range (uncurry f) ∪ {0} : Set E) := hf.separableSpace_range_union_singleton let s : ℕ → SimpleFunc (α × β) E := SimpleFunc.approxOn _ hf.measurable (range (uncurry f) ∪ {0}) 0 (by simp) diff --git a/Mathlib/Probability/Martingale/Convergence.lean b/Mathlib/Probability/Martingale/Convergence.lean index f304cfd1f359f9..465482d146702d 100644 --- a/Mathlib/Probability/Martingale/Convergence.lean +++ b/Mathlib/Probability/Martingale/Convergence.lean @@ -198,7 +198,7 @@ theorem Submartingale.exists_ae_trim_tendsto_of_bdd [IsFiniteMeasure μ] (hf : S (hbdd : ∀ n, eLpNorm (f n) 1 μ ≤ R) : ∀ᵐ ω ∂μ.trim (sSup_le fun _ ⟨_, hn⟩ => hn ▸ ℱ.le _ : ⨆ n, ℱ n ≤ m0), ∃ c, Tendsto (fun n => f n ω) atTop (𝓝 c) := by - letI := (⨆ n, ℱ n) + let := (⨆ n, ℱ n) rw [ae_iff, trim_measurableSet_eq] · exact hf.exists_ae_tendsto_of_bdd hbdd · exact MeasurableSet.compl <| measurableSet_exists_tendsto diff --git a/Mathlib/Probability/Process/Filtration.lean b/Mathlib/Probability/Process/Filtration.lean index 17e0f30939b6f9..a952ae4571dee0 100644 --- a/Mathlib/Probability/Process/Filtration.lean +++ b/Mathlib/Probability/Process/Filtration.lean @@ -300,19 +300,19 @@ lemma rightCont_eq_of_nhdsGT_eq_bot [PartialOrder ι] [TopologicalSpace ι] [Ord /-- If the index type is a `SuccOrder`, then `𝓕₊ = 𝓕`. -/ @[simp] lemma rightCont_eq_self [LinearOrder ι] [SuccOrder ι] (𝓕 : Filtration ι m) : 𝓕₊ = 𝓕 := by - letI := Preorder.topology ι; haveI : OrderTopology ι := ⟨rfl⟩ + let := Preorder.topology ι; have : OrderTopology ι := ⟨rfl⟩ ext _ rw [rightCont_eq_of_nhdsGT_eq_bot _ SuccOrder.nhdsGT] lemma rightCont_eq_of_isMax [PartialOrder ι] (𝓕 : Filtration ι m) {i : ι} (hi : IsMax i) : 𝓕₊ i = 𝓕 i := by - letI := Preorder.topology ι; haveI : OrderTopology ι := ⟨rfl⟩ + let := Preorder.topology ι; have : OrderTopology ι := ⟨rfl⟩ exact rightCont_eq_of_nhdsGT_eq_bot _ (hi.Ioi_eq ▸ nhdsWithin_empty i) lemma rightCont_eq_of_exists_gt [LinearOrder ι] (𝓕 : Filtration ι m) {i : ι} (hi : ∃ j > i, Set.Ioo i j = ∅) : 𝓕₊ i = 𝓕 i := by - letI := Preorder.topology ι; haveI : OrderTopology ι := ⟨rfl⟩ + let := Preorder.topology ι; have : OrderTopology ι := ⟨rfl⟩ obtain ⟨j, hij, hIoo⟩ := hi have hcov : i ⋖ j := covBy_iff_Ioo_eq.mpr ⟨hij, hIoo⟩ exact rightCont_eq_of_nhdsGT_eq_bot _ <| CovBy.nhdsGT hcov @@ -328,7 +328,7 @@ lemma rightCont_eq_of_neBot_nhdsGT [PartialOrder ι] [TopologicalSpace ι] [Orde lemma rightCont_eq_of_not_isMax [LinearOrder ι] [DenselyOrdered ι] (𝓕 : Filtration ι m) {i : ι} (hi : ¬IsMax i) : 𝓕₊ i = ⨅ j > i, 𝓕 j := by - letI := Preorder.topology ι; haveI : OrderTopology ι := ⟨rfl⟩ + let := Preorder.topology ι; have : OrderTopology ι := ⟨rfl⟩ have : (𝓝[>] i).NeBot := nhdsGT_neBot_of_exists_gt (not_isMax_iff.mp hi) exact rightCont_eq_of_neBot_nhdsGT _ _ @@ -342,7 +342,7 @@ lemma rightCont_eq [LinearOrder ι] [DenselyOrdered ι] [NoMaxOrder ι] variable [PartialOrder ι] lemma le_rightCont (𝓕 : Filtration ι m) : 𝓕 ≤ 𝓕₊ := by - letI := Preorder.topology ι; haveI : OrderTopology ι := ⟨rfl⟩ + let := Preorder.topology ι; have : OrderTopology ι := ⟨rfl⟩ intro i by_cases hne : (𝓝[>] i).NeBot · rw [rightCont_eq_of_neBot_nhdsGT] @@ -350,7 +350,7 @@ lemma le_rightCont (𝓕 : Filtration ι m) : 𝓕 ≤ 𝓕₊ := by · rw [rightCont_apply, if_neg hne] @[simp] lemma rightCont_self (𝓕 : Filtration ι m) : 𝓕₊₊ = 𝓕₊ := by - letI := Preorder.topology ι; haveI : OrderTopology ι := ⟨rfl⟩ + let := Preorder.topology ι; have : OrderTopology ι := ⟨rfl⟩ apply le_antisymm _ 𝓕₊.le_rightCont intro i by_cases hne : (𝓝[>] i).NeBot diff --git a/Mathlib/Probability/Process/Predictable.lean b/Mathlib/Probability/Process/Predictable.lean index 5248d9c695c29d..3dcf24abbad8ac 100644 --- a/Mathlib/Probability/Process/Predictable.lean +++ b/Mathlib/Probability/Process/Predictable.lean @@ -174,8 +174,8 @@ variable [LinearOrder ι] [OrderBot ι] [MeasurableSpace ι] [TopologicalSpace lemma isStronglyProgressive {𝓕 : Filtration ι m} {u : ι → Ω → E} (h𝓕 : IsStronglyPredictable 𝓕 u) : IsStronglyProgressive 𝓕 u := by intro i - letI : MeasurableSpace (ι × Ω) := 𝓕.predictable - letI : MeasurableSpace (Set.Iic i × Ω) := Subtype.instMeasurableSpace.prod (𝓕 i) + let : MeasurableSpace (ι × Ω) := 𝓕.predictable + let : MeasurableSpace (Set.Iic i × Ω) := Subtype.instMeasurableSpace.prod (𝓕 i) let X m (x : Set.Iic i × Ω) := h𝓕.approx m ⟨x.1, x.2⟩ refine ⟨fun m ↦ SimpleFunc.mk (X m) ?_ ?_, ?_⟩ · exact fun e ↦ measurable_inclusion_predictable <| (h𝓕.approx m).measurableSet_fiber e @@ -192,8 +192,8 @@ section Discrete /-- If `u` is a discrete predictable process, then `u (n + 1)` is `𝓕 n`-measurable. -/ lemma measurable_add_one {𝓕 : Filtration ℕ m} {u : ℕ → Ω → E} (h𝓕 : IsStronglyPredictable 𝓕 u) (n : ℕ) : StronglyMeasurable[𝓕 n] (u (n + 1)) := by - letI : MeasurableSpace (ℕ × Ω) := 𝓕.predictable - letI : MeasurableSpace Ω := 𝓕 n + let : MeasurableSpace (ℕ × Ω) := 𝓕.predictable + let : MeasurableSpace Ω := 𝓕 n let X m := (Function.curry (h𝓕.approx m) (n + 1)) refine ⟨(fun m ↦ SimpleFunc.mk (X m) ?_ ?_), (fun ω ↦ h𝓕.tendsto_approx ⟨(n + 1), ω⟩)⟩ · intro s @@ -207,7 +207,7 @@ lemma measurable_add_one {𝓕 : Filtration ℕ m} {u : ℕ → Ω → E} lemma of_measurable_add_one {𝓕 : Filtration ℕ m} {u : ℕ → Ω → E} (h₀ : StronglyMeasurable[𝓕 0] (u 0)) (h : ∀ n, StronglyMeasurable[𝓕 n] (u (n + 1))) : IsStronglyPredictable 𝓕 u := by - letI : MeasurableSpace (ℕ × Ω) := 𝓕.predictable + let : MeasurableSpace (ℕ × Ω) := 𝓕.predictable -- first layer of approximation let X m (x : ℕ × Ω) := match x.1 with | 0 => h₀.approx m x.2 @@ -220,16 +220,16 @@ lemma of_measurable_add_one {𝓕 : Filtration ℕ m} {u : ℕ → Ω → E} refine MeasurableSet.iUnion <| fun n ↦ ?_ rcases n with rfl | n · apply measurableSet_predictable_singleton_bot_prod - letI : MeasurableSpace Ω := 𝓕 0 + let : MeasurableSpace Ω := 𝓕 0 exact (h₀.approx m).measurableSet_fiber s · apply measurableSet_predictable_singleton_prod by_cases! hmk : n + 1 ≤ m · rw [(by aesop : Function.curry (Y m) (n + 1) = Function.curry (X m) (n + 1))] - letI : MeasurableSpace Ω := 𝓕 n + let : MeasurableSpace Ω := 𝓕 n exact ((h n).approx m).measurableSet_fiber s · rw [(by aesop : Function.curry (Y m) (n + 1) = Function.curry (X m) 0)] apply 𝓕.mono (i := 0) (by simp) - letI : MeasurableSpace Ω := 𝓕 0 + let : MeasurableSpace Ω := 𝓕 0 exact (h₀.approx m).measurableSet_fiber s · apply Set.Finite.subset (s := ⋃ k ∈ Finset.range (m + 1), Set.range (Function.curry (X m) k)) · refine Set.Finite.biUnion' (by aesop) (fun n hn ↦ ?_) diff --git a/Mathlib/Probability/Process/Stopping.lean b/Mathlib/Probability/Process/Stopping.lean index 1f84841c8797e3..6ba494a578c8c6 100644 --- a/Mathlib/Probability/Process/Stopping.lean +++ b/Mathlib/Probability/Process/Stopping.lean @@ -954,7 +954,7 @@ theorem isStronglyProgressive_min_stopping_time [PseudoMetrizableSpace ι] suffices h_meas : @Measurable _ _ (m_set s) (f i) fun x : s ↦ (x : Set.Iic i × Ω).snd from h_meas (f.mono (min_le_left _ _) _ (hτ.measurableSet_le (min i j))) exact measurable_snd.comp (@measurable_subtype_coe _ m_prod _) - · letI sc := sᶜ + · let sc := sᶜ suffices h_min_eq_left : (fun x : sc => min (↑(x : Set.Iic i × Ω).fst) (τ (x : Set.Iic i × Ω).snd)) = fun x : sc => ↑(x : Set.Iic i × Ω).fst by diff --git a/Mathlib/Probability/StrongLaw.lean b/Mathlib/Probability/StrongLaw.lean index bd87fe5c9227cb..f783f5ad0c7665 100644 --- a/Mathlib/Probability/StrongLaw.lean +++ b/Mathlib/Probability/StrongLaw.lean @@ -219,7 +219,7 @@ theorem sum_prob_mem_Ioc_le {X : Ω → ℝ} (hint : Integrable X) (hnonneg : 0 (hKN : K ≤ N) : ∑ j ∈ range K, ℙ {ω | X ω ∈ Set.Ioc (j : ℝ) N} ≤ ENNReal.ofReal (𝔼[X] + 1) := by let ρ : Measure ℝ := Measure.map X ℙ - haveI : IsProbabilityMeasure ρ := Measure.isProbabilityMeasure_map hint.aemeasurable + have : IsProbabilityMeasure ρ := Measure.isProbabilityMeasure_map hint.aemeasurable have A : ∑ j ∈ range K, ∫ _ in j..N, (1 : ℝ) ∂ρ ≤ 𝔼[X] + 1 := calc ∑ j ∈ range K, ∫ _ in j..N, (1 : ℝ) ∂ρ = diff --git a/Mathlib/Probability/UniformOn.lean b/Mathlib/Probability/UniformOn.lean index a3e07adddf3018..dde1c39b4d0397 100644 --- a/Mathlib/Probability/UniformOn.lean +++ b/Mathlib/Probability/UniformOn.lean @@ -139,7 +139,7 @@ theorem uniformOn_self (hs : s.Finite) (hs' : s.Nonempty) : uniformOn s s = 1 := theorem uniformOn_eq_one_of (hs : s.Finite) (hs' : s.Nonempty) (ht : s ⊆ t) : uniformOn s t = 1 := by - haveI := isProbabilityMeasure_uniformOn hs hs' + have := isProbabilityMeasure_uniformOn hs hs' refine eq_of_le_of_not_lt prob_le_one ?_ rw [not_lt, ← uniformOn_self hs hs'] exact measure_mono ht diff --git a/Mathlib/RepresentationTheory/Coinduced.lean b/Mathlib/RepresentationTheory/Coinduced.lean index 44a3d67e79da9e..6ecbcedcf78141 100644 --- a/Mathlib/RepresentationTheory/Coinduced.lean +++ b/Mathlib/RepresentationTheory/Coinduced.lean @@ -136,7 +136,7 @@ noncomputable def coindFunctor : Rep.{t} k G ⥤ Rep k H where instance {G : Type v'} [Group G] (S : Subgroup G) : (coindFunctor k S.subtype).PreservesEpimorphisms where preserves {X Y} f := (epi_iff_surjective _).2 fun y => by - letI := QuotientGroup.rightRel S + let := QuotientGroup.rightRel S choose! s hs using (Rep.epi_iff_surjective f).1 ‹_› choose! i hi using Quotient.mk'_surjective (α := G) let γ (g : G) : S := ⟨g * (i (Quotient.mk' g))⁻¹, diff --git a/Mathlib/RepresentationTheory/Maschke.lean b/Mathlib/RepresentationTheory/Maschke.lean index 9c70fc1fa34db6..1d0474598e46c9 100644 --- a/Mathlib/RepresentationTheory/Maschke.lean +++ b/Mathlib/RepresentationTheory/Maschke.lean @@ -145,8 +145,8 @@ set_option backward.isDefEq.respectTransparency false in theorem exists_leftInverse_of_injective (f : V →ₗ[k[G]] W) (hf : LinearMap.ker f = ⊥) : ∃ g : W →ₗ[k[G]] V, g.comp f = .id := by let A := k[G] - letI : Module k W := .compHom W (algebraMap k A) - letI : Module k V := .compHom V (algebraMap k A) + let : Module k W := .compHom W (algebraMap k A) + let : Module k V := .compHom V (algebraMap k A) have := IsScalarTower.of_compHom k A W have := IsScalarTower.of_compHom k A V set φ := (f.restrictScalars k).leftInverse diff --git a/Mathlib/RepresentationTheory/Subrepresentation.lean b/Mathlib/RepresentationTheory/Subrepresentation.lean index f69a7d13d6d269..e855a1e861ef5e 100644 --- a/Mathlib/RepresentationTheory/Subrepresentation.lean +++ b/Mathlib/RepresentationTheory/Subrepresentation.lean @@ -154,7 +154,7 @@ def ofSubmodule' (N : Submodule A[G] ρ.asModule) : Subrepresentation ρ where toSubmodule := { N with smul_mem' a w hw := by simpa using! (N.smul_mem (algebraMap A A[G] a) hw) } apply_mem_toSubmodule g w hw := by - letI _ : Module A[G] W := ρ.instModuleMonoidAlgebraAsModule + let _ : Module A[G] W := ρ.instModuleMonoidAlgebraAsModule have h : (MonoidAlgebra.single g (1 : A)) • w ∈ N := Submodule.smul_of_tower_mem N _ hw rw [Representation.single_smul, one_smul] at h diff --git a/Mathlib/RingTheory/Adjoin/Field.lean b/Mathlib/RingTheory/Adjoin/Field.lean index f81cd0b92fe5cc..6e006ad0e1c263 100644 --- a/Mathlib/RingTheory/Adjoin/Field.lean +++ b/Mathlib/RingTheory/Adjoin/Field.lean @@ -79,10 +79,10 @@ theorem Polynomial.lift_of_splits {F K L : Type*} [Field F] [Field K] [Field L] choose H3 _ using H3 rw [coe_insert, Set.insert_eq, Set.union_comm, Algebra.adjoin_union_eq_adjoin_adjoin] set Ks := Algebra.adjoin F (s : Set K) - haveI : FiniteDimensional F Ks := ((Submodule.fg_iff_finiteDimensional _).1 + have : FiniteDimensional F Ks := ((Submodule.fg_iff_finiteDimensional _).1 (fg_adjoin_of_finite s.finite_toSet H3)).of_subalgebra_toSubmodule - letI := fieldOfFiniteDimensional F Ks - letI := (f : Ks →+* L).toAlgebra + let := fieldOfFiniteDimensional F Ks + let := (f : Ks →+* L).toAlgebra have H5 : IsIntegral Ks a := H1.tower_top have H6 : ((minpoly Ks a).map (algebraMap Ks L)).Splits := by refine Splits.of_dvd H2 (map_ne_zero (minpoly.ne_zero H1)) ?_ diff --git a/Mathlib/RingTheory/Adjoin/PowerBasis.lean b/Mathlib/RingTheory/Adjoin/PowerBasis.lean index 22eea1d4c8c47c..227d1696b5821c 100644 --- a/Mathlib/RingTheory/Adjoin/PowerBasis.lean +++ b/Mathlib/RingTheory/Adjoin/PowerBasis.lean @@ -107,7 +107,7 @@ theorem repr_gen_pow_isIntegral (hB : IsIntegral R B.gen) have hlt : Q.natDegree < B.dim := by rw [← B.natDegree_minpoly, hmin, (minpoly.monic hB).natDegree_map, natDegree_lt_natDegree_iff hQ] - letI : Nontrivial R := Nontrivial.of_polynomial_ne hQ + let : Nontrivial R := Nontrivial.of_polynomial_ne hQ exact degree_modByMonic_lt _ (minpoly.monic hB) rw [this, aeval_eq_sum_range' hlt] simp only [map_sum, Finset.sum_apply'] diff --git a/Mathlib/RingTheory/AdjoinRoot.lean b/Mathlib/RingTheory/AdjoinRoot.lean index bf58bd9bd4f793..ba52f9a5871e15 100644 --- a/Mathlib/RingTheory/AdjoinRoot.lean +++ b/Mathlib/RingTheory/AdjoinRoot.lean @@ -1069,7 +1069,7 @@ polynomial over `L` divides some monic irreducible polynomial over `K`. -/ theorem Irreducible.exists_dvd_monic_irreducible_of_isIntegral {K L : Type*} [CommRing K] [IsDomain K] [Field L] [Algebra K L] [Algebra.IsIntegral K L] {f : L[X]} (hf : Irreducible f) : ∃ g : K[X], g.Monic ∧ Irreducible g ∧ f ∣ g.map (algebraMap K L) := by - haveI := Fact.mk hf + have := Fact.mk hf have h := hf.ne_zero have h2 := isIntegral_trans (R := K) _ (AdjoinRoot.isIntegral_root h) have h3 := (AdjoinRoot.minpoly_root h) ▸ minpoly.dvd_map_of_isScalarTower K L (AdjoinRoot.root f) diff --git a/Mathlib/RingTheory/Algebraic/Basic.lean b/Mathlib/RingTheory/Algebraic/Basic.lean index e4771691dbe162..b6da8df8b8c5c3 100644 --- a/Mathlib/RingTheory/Algebraic/Basic.lean +++ b/Mathlib/RingTheory/Algebraic/Basic.lean @@ -382,7 +382,7 @@ lemma IsAlgebraic.inv_iff {K} [Field K] [Algebra R K] {x : K} : IsAlgebraic R (x⁻¹) ↔ IsAlgebraic R x := by by_cases hx : x = 0 · simp [hx] - letI := invertibleOfNonzero hx + let := invertibleOfNonzero hx exact IsAlgebraic.invOf_iff (R := R) (x := x) alias ⟨_, IsAlgebraic.inv⟩ := IsAlgebraic.inv_iff @@ -413,8 +413,8 @@ theorem IsAlgebraic.extendScalars (hinj : Function.Injective (algebraMap R S)) { theorem IsAlgebraic.tower_top_of_subalgebra_le {A B : Subalgebra R S} (hle : A ≤ B) {x : S} (h : IsAlgebraic A x) : IsAlgebraic B x := by - letI : Algebra A B := (Subalgebra.inclusion hle).toAlgebra - haveI : IsScalarTower A B S := .of_algebraMap_eq fun _ ↦ rfl + let : Algebra A B := (Subalgebra.inclusion hle).toAlgebra + have : IsScalarTower A B S := .of_algebraMap_eq fun _ ↦ rfl exact h.extendScalars (Subalgebra.inclusion_injective hle) /-- If `x` is transcendental over `S`, then `x` is transcendental over `R` when `S` is an extension diff --git a/Mathlib/RingTheory/AlgebraicIndependent/Basic.lean b/Mathlib/RingTheory/AlgebraicIndependent/Basic.lean index 94856a80f5a219..4341d511a5dfeb 100644 --- a/Mathlib/RingTheory/AlgebraicIndependent/Basic.lean +++ b/Mathlib/RingTheory/AlgebraicIndependent/Basic.lean @@ -412,7 +412,7 @@ theorem algebraicIndependent_iUnion_of_directed {η : Type*} [Nonempty η] {s : theorem algebraicIndependent_sUnion_of_directed {s : Set (Set A)} (hsn : s.Nonempty) (hs : DirectedOn (· ⊆ ·) s) (h : ∀ a ∈ s, AlgebraicIndependent R ((↑) : a → A)) : AlgebraicIndependent R ((↑) : ⋃₀ s → A) := by - letI : Nonempty s := Nonempty.to_subtype hsn + let : Nonempty s := Nonempty.to_subtype hsn rw [sUnion_eq_iUnion] exact algebraicIndependent_iUnion_of_directed hs.directed_val (by simpa using h) diff --git a/Mathlib/RingTheory/AlgebraicIndependent/RankAndCardinality.lean b/Mathlib/RingTheory/AlgebraicIndependent/RankAndCardinality.lean index 7fdf3cac0a899f..e8a89eb73dc99d 100644 --- a/Mathlib/RingTheory/AlgebraicIndependent/RankAndCardinality.lean +++ b/Mathlib/RingTheory/AlgebraicIndependent/RankAndCardinality.lean @@ -44,9 +44,9 @@ theorem IsTranscendenceBasis.lift_cardinalMk_eq_max_lift lift.{max u w} #E = lift.{max v w} #F ⊔ lift.{max u v} #ι ⊔ ℵ₀ := by let K := Algebra.adjoin F (Set.range x) suffices #E = #K by simp [K, this, ← lift_mk_eq'.2 ⟨hx.1.aevalEquiv.toEquiv⟩] - haveI : Algebra.IsAlgebraic K E := hx.isAlgebraic + have : Algebra.IsAlgebraic K E := hx.isAlgebraic refine le_antisymm ?_ (mk_le_of_injective Subtype.val_injective) - haveI : Infinite K := hx.1.aevalEquiv.infinite_iff.1 inferInstance + have : Infinite K := hx.1.aevalEquiv.infinite_iff.1 inferInstance simpa only [sup_eq_left.2 (aleph0_le_mk K)] using Algebra.IsAlgebraic.cardinalMk_le_max K E theorem IsTranscendenceBasis.lift_rank_eq_max_lift @@ -54,7 +54,7 @@ theorem IsTranscendenceBasis.lift_rank_eq_max_lift {ι : Type w} {x : ι → E} [Nonempty ι] (hx : IsTranscendenceBasis F x) : lift.{max u w} (Module.rank F E) = lift.{max v w} #F ⊔ lift.{max u v} #ι ⊔ ℵ₀ := by let K := IntermediateField.adjoin F (Set.range x) - haveI : Algebra.IsAlgebraic K E := hx.isAlgebraic_field + have : Algebra.IsAlgebraic K E := hx.isAlgebraic_field rw [← rank_mul_rank F K E, lift_mul, ← hx.1.aevalEquivField.toLinearEquiv.lift_rank_eq, MvRatFunc.rank_eq_max_lift, lift_max, lift_max, lift_lift, lift_lift, lift_aleph0] refine mul_eq_left le_sup_right ((lift_le.2 ((rank_le_card K E).trans @@ -65,7 +65,7 @@ theorem Algebra.Transcendental.rank_eq_cardinalMk (F : Type u) (E : Type v) [Field F] [Field E] [Algebra F E] [Algebra.Transcendental F E] : Module.rank F E = #E := by obtain ⟨ι, x, hx⟩ := exists_isTranscendenceBasis' F E - haveI := hx.nonempty_iff_transcendental.2 ‹_› + have := hx.nonempty_iff_transcendental.2 ‹_› simpa [← hx.lift_cardinalMk_eq_max_lift] using hx.lift_rank_eq_max_lift theorem IntermediateField.rank_sup_le @@ -76,10 +76,10 @@ theorem IntermediateField.rank_sup_le by_cases hB : Algebra.IsAlgebraic F B · exact rank_sup_le_of_isAlgebraic A B (Or.inr hB) rw [← Algebra.transcendental_iff_not_isAlgebraic] at hA hB - haveI : Algebra.Transcendental F ↥(A ⊔ B) := .ringHom_of_comp_eq (RingHom.id F) + have : Algebra.Transcendental F ↥(A ⊔ B) := .ringHom_of_comp_eq (RingHom.id F) (inclusion le_sup_left) Function.surjective_id (inclusion_injective _) rfl - haveI := Algebra.Transcendental.infinite F A - haveI := Algebra.Transcendental.infinite F B + have := Algebra.Transcendental.infinite F A + have := Algebra.Transcendental.infinite F B simp_rw [Algebra.Transcendental.rank_eq_cardinalMk] rw [sup_def, mul_mk_eq_max, ← Cardinal.lift_le.{u}] refine (lift_cardinalMk_adjoin_le _ _).trans ?_ diff --git a/Mathlib/RingTheory/AlgebraicIndependent/TranscendenceBasis.lean b/Mathlib/RingTheory/AlgebraicIndependent/TranscendenceBasis.lean index eb4677becdaabe..87083dd4ad8d06 100644 --- a/Mathlib/RingTheory/AlgebraicIndependent/TranscendenceBasis.lean +++ b/Mathlib/RingTheory/AlgebraicIndependent/TranscendenceBasis.lean @@ -142,8 +142,8 @@ lemma IsTranscendenceBasis.algebraMap_comp rw [Set.range_comp, ← AlgHom.map_adjoin] set Rx := adjoin R (range x) let e := Rx.equivMapOfInjective f (FaithfulSMul.algebraMap_injective S A) - letI := e.toRingHom.toAlgebra - haveI : IsScalarTower Rx (Rx.map f) A := .of_algebraMap_eq fun x ↦ rfl + let := e.toRingHom.toAlgebra + have : IsScalarTower Rx (Rx.map f) A := .of_algebraMap_eq fun x ↦ rfl have : Algebra.IsAlgebraic Rx S := hx.isAlgebraic have : Algebra.IsAlgebraic Rx A := .trans _ S _ exact .extendScalars e.injective @@ -158,7 +158,7 @@ lemma IsTranscendenceBasis.isAlgebraic_iff [IsDomain S] [NoZeroDivisors A] simpa [Sv, ← Subalgebra.isAlgebraic_iff, isAlgebraic_adjoin_iff] have le : Rv ≤ Sv.restrictScalars R := by rw [Subalgebra.restrictScalars_adjoin]; exact le_sup_right - letI : Algebra Rv Sv := (Subalgebra.inclusion le).toAlgebra + let : Algebra Rv Sv := (Subalgebra.inclusion le).toAlgebra have : IsScalarTower Rv Sv A := .of_algebraMap_eq fun x ↦ rfl have := (algebraMap R S).domain_nontrivial have := hv.isAlgebraic @@ -237,11 +237,11 @@ theorem IsTranscendenceBasis.nonempty_iff_transcendental [Nontrivial R] theorem IsTranscendenceBasis.isAlgebraic_field {F E : Type*} {x : ι → E} [Field F] [Field E] [Algebra F E] (hx : IsTranscendenceBasis F x) : Algebra.IsAlgebraic (IntermediateField.adjoin F (range x)) E := by - haveI := hx.isAlgebraic + have := hx.isAlgebraic set S := range x - letI : Algebra (adjoin F S) (IntermediateField.adjoin F S) := + let : Algebra (adjoin F S) (IntermediateField.adjoin F S) := (Subalgebra.inclusion (IntermediateField.algebra_adjoin_le_adjoin F S)).toRingHom.toAlgebra - haveI : IsScalarTower (adjoin F S) (IntermediateField.adjoin F S) E := + have : IsScalarTower (adjoin F S) (IntermediateField.adjoin F S) E := IsScalarTower.of_algebraMap_eq (congrFun rfl) exact Algebra.IsAlgebraic.extendScalars (R := adjoin F S) (Subalgebra.inclusion_injective _) diff --git a/Mathlib/RingTheory/ChainOfDivisors.lean b/Mathlib/RingTheory/ChainOfDivisors.lean index 9a0b005f8e0073..0d59c17bcd40db 100644 --- a/Mathlib/RingTheory/ChainOfDivisors.lean +++ b/Mathlib/RingTheory/ChainOfDivisors.lean @@ -219,10 +219,10 @@ variable {N : Type*} [CommMonoidWithZero N] theorem factor_orderIso_map_one_eq_bot [IsCancelMulZero N] {m : Associates M} {n : Associates N} (d : { l : Associates M // l ≤ m } ≃o { l : Associates N // l ≤ n }) : (d ⟨1, one_dvd m⟩ : Associates N) = 1 := by - letI : OrderBot { l : Associates M // l ≤ m } := Subtype.orderBot bot_le - letI : OrderBot { l : Associates N // l ≤ n } := Subtype.orderBot bot_le + let : OrderBot { l : Associates M // l ≤ m } := Subtype.orderBot bot_le + let : OrderBot { l : Associates N // l ≤ n } := Subtype.orderBot bot_le simp only [← Associates.bot_eq_one, Subtype.mk_bot, bot_le, Subtype.coe_eq_bot_iff] - letI : BotHomClass ({ l // l ≤ m } ≃o { l // l ≤ n }) _ _ := OrderIsoClass.toBotHomClass + let : BotHomClass ({ l // l ≤ m } ≃o { l // l ≤ n }) _ _ := OrderIsoClass.toBotHomClass exact map_bot d set_option backward.isDefEq.respectTransparency false in @@ -291,8 +291,8 @@ theorem map_prime_of_factor_orderIso {m p : Associates M} {n : Associates N} (hn · have : b ≤ n := le_trans (le_of_lt hb) (d ⟨p, dvd_of_mem_normalizedFactors hp⟩).prop obtain ⟨x, hx⟩ := d.surjective ⟨b, this⟩ rw [← Subtype.coe_mk (p := (· ≤ n)) b this, ← hx] at hb - letI : OrderBot { l : Associates M // l ≤ m } := Subtype.orderBot bot_le - letI : OrderBot { l : Associates N // l ≤ n } := Subtype.orderBot bot_le + let : OrderBot { l : Associates M // l ≤ m } := Subtype.orderBot bot_le + let : OrderBot { l : Associates N // l ≤ n } := Subtype.orderBot bot_le suffices x = ⊥ by rw [this, OrderIso.map_bot d] at hx refine (Subtype.mk_eq_bot_iff ?_ _).mp hx.symm @@ -333,7 +333,7 @@ theorem emultiplicity_prime_eq_emultiplicity_image_by_factor_orderIso {m p : Ass emultiplicity (↑(d.symm (d ⟨p, dvd_of_mem_normalizedFactors hp⟩))) m by rw [d.symm_apply_apply ⟨p, dvd_of_mem_normalizedFactors hp⟩, Subtype.coe_mk] at this exact this - letI := Classical.decEq (Associates N) + let := Classical.decEq (Associates N) simpa only [Subtype.coe_eta] using emultiplicity_prime_le_emultiplicity_image_by_factor_orderIso (mem_normalizedFactors_factor_orderIso_of_mem_normalizedFactors hn hp d) d.symm @@ -404,7 +404,7 @@ theorem mem_normalizedFactors_factor_dvd_iso_of_mem_normalizedFactors {m p : M} exact mk_dvd_mk.mpr (dvd_of_mem_normalizedFactors hp)⟩) := by rw [mkFactorOrderIsoOfFactorDvdEquiv_apply_coe] rw [← Associates.prime_mk, this] - letI := Classical.decEq (Associates M) + let := Classical.decEq (Associates M) refine map_prime_of_factor_orderIso (mk_ne_zero.mpr hn) ?_ _ obtain ⟨q, hq, hq'⟩ := exists_mem_normalizedFactors_of_dvd (mk_ne_zero.mpr hm) diff --git a/Mathlib/RingTheory/Coprime/Ideal.lean b/Mathlib/RingTheory/Coprime/Ideal.lean index d5517b7176ad6d..b6e84354e62857 100644 --- a/Mathlib/RingTheory/Coprime/Ideal.lean +++ b/Mathlib/RingTheory/Coprime/Ideal.lean @@ -34,7 +34,7 @@ When ideals are all of the form `I i = R ∙ s i`, this is equivalent to the theorem iSup_iInf_eq_top_iff_pairwise {t : Finset ι} (h : t.Nonempty) (I : ι → Ideal R) : (⨆ i ∈ t, ⨅ (j) (_ : j ∈ t) (_ : j ≠ i), I j) = ⊤ ↔ (t : Set ι).Pairwise fun i j => I i ⊔ I j = ⊤ := by - haveI : DecidableEq ι := Classical.decEq ι + have : DecidableEq ι := Classical.decEq ι rw [eq_top_iff_one, Submodule.mem_iSup_finset_iff_exists_sum] refine h.cons_induction ?_ ?_ <;> clear t h · simp only [Finset.sum_singleton, Finset.coe_singleton, Set.pairwise_singleton, iff_true] diff --git a/Mathlib/RingTheory/DedekindDomain/Different.lean b/Mathlib/RingTheory/DedekindDomain/Different.lean index 88a9307503810b..710b9c94b45ccd 100644 --- a/Mathlib/RingTheory/DedekindDomain/Different.lean +++ b/Mathlib/RingTheory/DedekindDomain/Different.lean @@ -574,9 +574,9 @@ theorem differentIdeal_eq_differentIdeal_mul_differentIdeal (C : Type*) [IsDomai isSeparable_tower_top_of_isSeparable (FractionRing A) _ _ have : Algebra.IsSeparable (FractionRing A) (FractionRing B) := isSeparable_tower_bot_of_isSeparable _ _ (FractionRing C) - haveI : FiniteDimensional (FractionRing A) (FractionRing B) := .of_isLocalization A B A⁰ - haveI : FiniteDimensional (FractionRing A) (FractionRing C) := .of_isLocalization A C A⁰ - haveI : FiniteDimensional (FractionRing B) (FractionRing C) := .of_isLocalization B C B⁰ + have : FiniteDimensional (FractionRing A) (FractionRing B) := .of_isLocalization A B A⁰ + have : FiniteDimensional (FractionRing A) (FractionRing C) := .of_isLocalization A C A⁰ + have : FiniteDimensional (FractionRing B) (FractionRing C) := .of_isLocalization B C B⁰ rw [← coeIdeal_inj (K := FractionRing C), coeIdeal_mul, coeIdeal_differentIdeal A (FractionRing A), coeIdeal_differentIdeal B (FractionRing B)] rw [← extendedHom_coeIdeal_eq_map (K := FractionRing B), coeIdeal_differentIdeal A @@ -636,7 +636,7 @@ lemma conductor_mul_differentIdeal (conductor A x) * differentIdeal A B = Ideal.span {aeval x (derivative (minpoly A x))} := by classical have hAx : IsIntegral A x := IsIntegralClosure.isIntegral A L x - haveI := IsIntegralClosure.isFractionRing_of_finite_extension A K L B + have := IsIntegralClosure.isFractionRing_of_finite_extension A K L B apply FractionalIdeal.coeIdeal_injective (K := L) simp only [FractionalIdeal.coeIdeal_mul, FractionalIdeal.coeIdeal_span_singleton] rw [coeIdeal_differentIdeal A K L B, mul_inv_eq_iff_eq_mul₀] @@ -760,7 +760,7 @@ theorem not_dvd_differentIdeal_of_intTrace_not_mem exact differentIdeal_ne_bot · obtain rfl := hxQ simp at hx - letI : Algebra (A ⧸ p) (B ⧸ Q) := Ideal.Quotient.algebraQuotientOfLEComap (by + let : Algebra (A ⧸ p) (B ⧸ Q) := Ideal.Quotient.algebraQuotientOfLEComap (by rw [← Ideal.map_le_iff_le_comap, ← hP] exact Ideal.mul_le_left) let K := FractionRing A @@ -813,13 +813,13 @@ theorem not_dvd_differentIdeal_of_isCoprime_of_isSeparable (hPQ : IsCoprime P Q) (hP : P * Q = Ideal.map (algebraMap A B) p) [Algebra.IsSeparable (A ⧸ p) (B ⧸ P)] : ¬ P ∣ differentIdeal A B := by - letI : Algebra (A ⧸ p) (B ⧸ Q) := Ideal.Quotient.algebraQuotientOfLEComap (by + let : Algebra (A ⧸ p) (B ⧸ Q) := Ideal.Quotient.algebraQuotientOfLEComap (by rw [← Ideal.map_le_iff_le_comap, ← hP] exact Ideal.mul_le_left) have : IsScalarTower A (A ⧸ p) (B ⧸ Q) := .of_algebraMap_eq' rfl have : Module.Finite (A ⧸ p) (B ⧸ Q) := Module.Finite.of_restrictScalars_finite A (A ⧸ p) (B ⧸ Q) - letI e : (B ⧸ p.map (algebraMap A B)) ≃ₐ[A ⧸ p] ((B ⧸ P) × B ⧸ Q) := + let e : (B ⧸ p.map (algebraMap A B)) ≃ₐ[A ⧸ p] ((B ⧸ P) × B ⧸ Q) := { __ := (Ideal.quotEquivOfEq hP.symm).trans (Ideal.quotientMulEquivQuotientProd P Q hPQ), commutes' := Quotient.ind fun _ ↦ rfl } obtain ⟨x, hx⟩ : ∃ x, Algebra.trace (A ⧸ p) (B ⧸ P) x ≠ 0 := by @@ -889,14 +889,14 @@ lemma dvd_differentIdeal_of_not_isSeparable ← IsScalarTower.algebraMap_apply, IsScalarTower.algebraMap_apply A B L, ← hz'] intro x hx rw [← Ideal.Quotient.eq_zero_iff_mem, ← Algebra.trace_quotient_eq_of_isDedekindDomain] - letI : Algebra (A ⧸ p) (B ⧸ a) := + let : Algebra (A ⧸ p) (B ⧸ a) := Ideal.Quotient.algebraQuotientOfLEComap (Ideal.map_le_iff_le_comap.mp (Ideal.dvd_iff_le.mp ⟨_, ha.trans (mul_comm _ _)⟩)) have : IsScalarTower A (A ⧸ p) (B ⧸ a) := .of_algebraMap_eq' rfl have : Module.Finite (A ⧸ p) (B ⧸ a) := .of_restrictScalars_finite A _ _ have := ((Ideal.prime_iff_isPrime hPbot).mpr inferInstance) rw [← this.irreducible.gcd_eq_one_iff, ← Ideal.isCoprime_iff_gcd] at hPa - letI e : (B ⧸ p.map (algebraMap A B)) ≃ₐ[A ⧸ p] ((B ⧸ P) × B ⧸ a) := + let e : (B ⧸ p.map (algebraMap A B)) ≃ₐ[A ⧸ p] ((B ⧸ P) × B ⧸ a) := { __ := (Ideal.quotEquivOfEq ha).trans (Ideal.quotientMulEquivQuotientProd P a hPa), commutes' := Quotient.ind fun _ ↦ rfl } have hx' : (e (Ideal.Quotient.mk _ x)).2 = 0 := by diff --git a/Mathlib/RingTheory/DedekindDomain/Dvr.lean b/Mathlib/RingTheory/DedekindDomain/Dvr.lean index 148e5ee14fe445..bc729ca4b09a2f 100644 --- a/Mathlib/RingTheory/DedekindDomain/Dvr.lean +++ b/Mathlib/RingTheory/DedekindDomain/Dvr.lean @@ -84,10 +84,10 @@ theorem IsLocalization.isDedekindDomain [IsDedekindDomain A] {M : Submonoid A} ( have h : ∀ y : M, IsUnit (algebraMap A (FractionRing A) y) := by rintro ⟨y, hy⟩ exact IsUnit.mk0 _ (mt IsFractionRing.to_map_eq_zero_iff.mp (nonZeroDivisors.ne_zero (hM hy))) - letI : Algebra Aₘ (FractionRing A) := RingHom.toAlgebra (IsLocalization.lift h) - haveI : IsScalarTower A Aₘ (FractionRing A) := + let : Algebra Aₘ (FractionRing A) := RingHom.toAlgebra (IsLocalization.lift h) + have : IsScalarTower A Aₘ (FractionRing A) := IsScalarTower.of_algebraMap_eq fun x => (IsLocalization.lift_eq h x).symm - haveI : IsFractionRing Aₘ (FractionRing A) := + have : IsFractionRing Aₘ (FractionRing A) := IsFractionRing.isFractionRing_of_isDomain_of_isLocalization M _ _ refine (isDedekindDomain_iff _ (FractionRing A)).mpr ⟨?_, ?_, ?_, ?_⟩ · infer_instance @@ -113,7 +113,7 @@ instance Localization.AtPrime.isDedekindDomain [IsDedekindDomain A] (P : Ideal A theorem IsLocalization.AtPrime.not_isField {P : Ideal A} (hP : P ≠ ⊥) [pP : P.IsPrime] (Aₘ : Type*) [CommRing Aₘ] [Algebra A Aₘ] [IsLocalization.AtPrime Aₘ P] : ¬ IsField Aₘ := by intro h - letI := h.toField + let := h.toField obtain ⟨x, x_mem, x_ne⟩ := P.ne_bot_iff.mp hP exact (IsLocalRing.maximalIdeal.isMaximal _).ne_top @@ -129,9 +129,9 @@ theorem IsLocalization.AtPrime.isDiscreteValuationRing_of_dedekind_domain [IsDed {P : Ideal A} (hP : P ≠ ⊥) [pP : P.IsPrime] (Aₘ : Type*) [CommRing Aₘ] [IsDomain Aₘ] [Algebra A Aₘ] [IsLocalization.AtPrime Aₘ P] : IsDiscreteValuationRing Aₘ := by classical - letI : IsNoetherianRing Aₘ := + let : IsNoetherianRing Aₘ := IsLocalization.isNoetherianRing P.primeCompl _ IsDedekindRing.toIsNoetherian - letI : IsLocalRing Aₘ := IsLocalization.AtPrime.isLocalRing Aₘ P + let : IsLocalRing Aₘ := IsLocalization.AtPrime.isLocalRing Aₘ P have hnf := IsLocalization.AtPrime.not_isField A hP Aₘ exact ((IsDiscreteValuationRing.TFAE Aₘ hnf).out 0 2).mpr diff --git a/Mathlib/RingTheory/DedekindDomain/Factorization.lean b/Mathlib/RingTheory/DedekindDomain/Factorization.lean index c25fa26cb9ebc7..359ec6f95ae2c7 100644 --- a/Mathlib/RingTheory/DedekindDomain/Factorization.lean +++ b/Mathlib/RingTheory/DedekindDomain/Factorization.lean @@ -85,7 +85,7 @@ theorem IsDedekindDomain.HeightOneSpectrum.maxPowDividing_eq_pow_multiset_count theorem Ideal.finite_factors {I : Ideal R} (hI : I ≠ 0) : {v : HeightOneSpectrum R | v.asIdeal ∣ I}.Finite := by rw [← Set.finite_coe_iff, Set.coe_setOf] - haveI h_fin := fintypeSubtypeDvd I hI + have h_fin := fintypeSubtypeDvd I hI refine Finite.of_injective (fun v => (⟨(v : HeightOneSpectrum R).asIdeal, v.2⟩ : { x // x ∣ I })) ?_ intro v w hvw diff --git a/Mathlib/RingTheory/DedekindDomain/Ideal/Lemmas.lean b/Mathlib/RingTheory/DedekindDomain/Ideal/Lemmas.lean index e5054d4f776d69..dfc773e71a5ada 100644 --- a/Mathlib/RingTheory/DedekindDomain/Ideal/Lemmas.lean +++ b/Mathlib/RingTheory/DedekindDomain/Ideal/Lemmas.lean @@ -306,7 +306,7 @@ and the lcm is their infimum, and use this to instantiate `NormalizedGCDMonoid ( @[simp] theorem sup_mul_inf (I J : Ideal A) : (I ⊔ J) * (I ⊓ J) = I * J := by - letI := UniqueFactorizationMonoid.toNormalizedGCDMonoid (Ideal A) + let := UniqueFactorizationMonoid.toNormalizedGCDMonoid (Ideal A) have hgcd : gcd I J = I ⊔ J := by rw [gcd_eq_normalize _ _, normalize_eq] · rw [dvd_iff_le, sup_le_iff, ← dvd_iff_le, ← dvd_iff_le] @@ -1230,7 +1230,7 @@ namespace IsDedekindDomain theorem primesOver_finite : (primesOver p B).Finite := by by_cases hpb : p = ⊥ · rw [hpb] at hpm ⊢ - haveI : IsDomain A := IsDomain.of_bot_isPrime A + have : IsDomain A := IsDomain.of_bot_isPrime A rw [primesOver_bot A B] exact Set.finite_singleton ⊥ · rw [← coe_primesOverFinset hpb B] diff --git a/Mathlib/RingTheory/DedekindDomain/IntegralClosure.lean b/Mathlib/RingTheory/DedekindDomain/IntegralClosure.lean index 7e8ffa3eefa9d3..7f5e41afbd3b09 100644 --- a/Mathlib/RingTheory/DedekindDomain/IntegralClosure.lean +++ b/Mathlib/RingTheory/DedekindDomain/IntegralClosure.lean @@ -61,10 +61,10 @@ include K L then `L` is the localization of the integral closure `C` of `A` in `L` at `A⁰`. -/ theorem IsIntegralClosure.isLocalization [IsDomain A] [Algebra.IsAlgebraic K L] : IsLocalization (Algebra.algebraMapSubmonoid C A⁰) L := by - haveI : IsDomain C := + have : IsDomain C := (IsIntegralClosure.equiv A C L (integralClosure A L)).toMulEquiv.isDomain (integralClosure A L) - haveI : IsTorsionFree A L := .trans_faithfulSMul A K L - haveI : IsTorsionFree A C := IsIntegralClosure.isTorsionFree A L + have : IsTorsionFree A L := .trans_faithfulSMul A K L + have : IsTorsionFree A C := IsIntegralClosure.isTorsionFree A L refine ⟨?_, fun z => ?_, fun {x y} h => ⟨1, ?_⟩⟩ · rintro ⟨_, x, hx, rfl⟩ rw [isUnit_iff_ne_zero, map_ne_zero_iff _ (IsIntegralClosure.algebraMap_injective C A L), @@ -123,7 +123,7 @@ variable (L) then `L` has a basis over `A` consisting of integral elements. -/ theorem FiniteDimensional.exists_is_basis_integral : ∃ (s : Finset L) (b : Basis s K L), ∀ x, IsIntegral A (b x) := by - letI := Classical.decEq L + let := Classical.decEq L let s' := IsNoetherian.finsetBasisIndex K L let bs' := IsNoetherian.finsetBasis K L obtain ⟨y, hy, his'⟩ := exists_integral_multiples A K (Finset.univ.image bs') @@ -150,10 +150,10 @@ integrally closed and Noetherian, the integral closure `C` of `A` in `L` is Noetherian over `A`. -/ theorem IsIntegralClosure.isNoetherian [IsIntegrallyClosed A] [IsNoetherianRing A] : IsNoetherian A C := by - haveI := Classical.decEq L + have := Classical.decEq L obtain ⟨s, b, hb_int⟩ := FiniteDimensional.exists_is_basis_integral A K L let b' := (traceForm K L).dualBasis (traceForm_nondegenerate K L) b - letI := isNoetherian_span_of_finite A (Set.finite_range b') + let := isNoetherian_span_of_finite A (Set.finite_range b') let f : C →ₗ[A] Submodule.span A (Set.range b') := (Submodule.inclusion (IsIntegralClosure.range_le_span_dualBasis C b hb_int)).comp ((Algebra.linearMap C L).restrictScalars A).rangeRestrict @@ -173,7 +173,7 @@ integrally closed and Noetherian, the integral closure `C` of `A` in `L` is finite over `A`. -/ theorem IsIntegralClosure.finite [IsIntegrallyClosed A] [IsNoetherianRing A] : Module.Finite A C := by - haveI := IsIntegralClosure.isNoetherian A K L C + have := IsIntegralClosure.isNoetherian A K L C exact Module.IsNoetherian.finite A C /-- If `L` is a finite separable extension of `K = Frac(A)`, where `A` is a principal ring @@ -190,9 +190,9 @@ and `L` has no zero smul divisors by `A`, the `A`-rank of the integral closure ` is equal to the `K`-rank of `L`. -/ theorem IsIntegralClosure.rank [IsPrincipalIdealRing A] [IsTorsionFree A L] : Module.finrank A C = Module.finrank K L := by - haveI : Module.Free A C := IsIntegralClosure.module_free A K L C - haveI : IsNoetherian A C := IsIntegralClosure.isNoetherian A K L C - haveI : IsLocalization (Algebra.algebraMapSubmonoid C A⁰) L := + have : Module.Free A C := IsIntegralClosure.module_free A K L C + have : IsNoetherian A C := IsIntegralClosure.isNoetherian A K L C + have : IsLocalization (Algebra.algebraMapSubmonoid C A⁰) L := IsIntegralClosure.isLocalization A K L C let b := Basis.localizationLocalization K A⁰ L (Module.Free.chooseBasis A C) rw [Module.finrank_eq_card_chooseBasisIndex, Module.finrank_eq_card_basis b] diff --git a/Mathlib/RingTheory/DedekindDomain/PID.lean b/Mathlib/RingTheory/DedekindDomain/PID.lean index 6472035ba9635f..87ad079d711df5 100644 --- a/Mathlib/RingTheory/DedekindDomain/PID.lean +++ b/Mathlib/RingTheory/DedekindDomain/PID.lean @@ -94,7 +94,7 @@ theorem FractionalIdeal.isPrincipal.of_finite_maximals_of_inv {A : Type*} [CommR have hinv' := hinv rw [coe_ext_iff, coe_mul] at hinv let s := hf.toFinset - haveI := Classical.decEq (Ideal R) + have := Classical.decEq (Ideal R) have coprime : ∀ M ∈ s, ∀ M' ∈ s.erase M, M ⊔ M' = ⊤ := by simp_rw [s, Finset.mem_erase, hf.mem_toFinset] rintro M hM M' ⟨hne, hM'⟩ @@ -190,8 +190,8 @@ theorem IsLocalization.OverPrime.mem_normalizedFactors_of_isPrime [IsDomain S] have non_zero_div : Algebra.algebraMapSubmonoid S p.primeCompl ≤ S⁰ := map_le_nonZeroDivisors_of_injective _ (FaithfulSMul.algebraMap_injective _ _) p.primeCompl_le_nonZeroDivisors - letI : Algebra (Localization.AtPrime p) Sₚ := localizationAlgebra p.primeCompl S - haveI : IsScalarTower R (Localization.AtPrime p) Sₚ := + let : Algebra (Localization.AtPrime p) Sₚ := localizationAlgebra p.primeCompl S + have : IsScalarTower R (Localization.AtPrime p) Sₚ := IsScalarTower.of_algebraMap_eq fun x => by rw [IsScalarTower.algebraMap_apply R S] exact (IsLocalization.map_eq (T := Algebra.algebraMapSubmonoid S (primeCompl p)) @@ -226,8 +226,8 @@ theorem IsLocalization.OverPrime.mem_normalizedFactors_of_isPrime [IsDomain S] then the localization `Sₚ` of `S` at `p` is a PID. -/ theorem IsDedekindDomain.isPrincipalIdealRing_localization_over_prime [IsDomain S] : IsPrincipalIdealRing Sₚ := by - letI := Classical.decEq (Ideal Sₚ) - letI := Classical.decPred fun P : Ideal Sₚ => P.IsPrime + let := Classical.decEq (Ideal Sₚ) + let := Classical.decPred fun P : Ideal Sₚ => P.IsPrime refine IsPrincipalIdealRing.of_finite_primes (Set.Finite.ofFinset diff --git a/Mathlib/RingTheory/DiscreteValuationRing/Basic.lean b/Mathlib/RingTheory/DiscreteValuationRing/Basic.lean index f4b52ff1919234..e964b32df78a48 100644 --- a/Mathlib/RingTheory/DiscreteValuationRing/Basic.lean +++ b/Mathlib/RingTheory/DiscreteValuationRing/Basic.lean @@ -132,7 +132,7 @@ theorem iff_pid_with_one_nonzero_prime (R : Type u) [CommRing R] [IsDomain R] : rw [irreducible_iff_uniformizer] at hQ2 exact hQ2.symm · rintro ⟨RPID, Punique⟩ - haveI : IsLocalRing R := IsLocalRing.of_unique_nonzero_prime Punique + have : IsLocalRing R := IsLocalRing.of_unique_nonzero_prime Punique refine { not_a_field' := ?_ } rcases Punique with ⟨P, ⟨hP1, hP2⟩, _⟩ have hPM : P ≤ maximalIdeal R := le_maximalIdeal hP2.1 @@ -272,7 +272,7 @@ theorem of_ufd_of_unique_irreducible {R : Type u} [CommRing R] [IsDomain R] (h₂ : ∀ ⦃p q : R⦄, Irreducible p → Irreducible q → Associated p q) : IsDiscreteValuationRing R := by rw [iff_pid_with_one_nonzero_prime] - haveI PID : IsPrincipalIdealRing R := aux_pid_of_ufd_of_unique_irreducible R h₁ h₂ + have PID : IsPrincipalIdealRing R := aux_pid_of_ufd_of_unique_irreducible R h₁ h₂ obtain ⟨p, hp⟩ := h₁ refine ⟨PID, ⟨Ideal.span {p}, ⟨?_, ?_⟩, ?_⟩⟩ · rw [Submodule.ne_bot_iff] @@ -292,7 +292,7 @@ is a discrete valuation ring. -/ theorem ofHasUnitMulPowIrreducibleFactorization {R : Type u} [CommRing R] [IsDomain R] (hR : HasUnitMulPowIrreducibleFactorization R) : IsDiscreteValuationRing R := by - letI : UniqueFactorizationMonoid R := hR.toUniqueFactorizationMonoid + let : UniqueFactorizationMonoid R := hR.toUniqueFactorizationMonoid apply of_ufd_of_unique_irreducible _ hR.unique_irreducible obtain ⟨p, hp, H⟩ := hR exact ⟨p, hp⟩ @@ -670,7 +670,7 @@ lemma maximalIdeal_eq_setOf_le_v_algebraMap : ∀ [IsDiscreteValuationRing O] {ϖ : O} (_h : Irreducible ϖ), (IsLocalRing.maximalIdeal O : Set O) = {y : O | v (algebraMap O K y) ≤ v (algebraMap O K ϖ)} := by - letI : IsDomain O := hv.hom_inj.isDomain + let : IsDomain O := hv.hom_inj.isDomain intro _ _ h rw [← hv.coe_span_singleton_eq_setOf_le_v_algebraMap, ← h.maximalIdeal_eq] @@ -679,7 +679,7 @@ lemma maximalIdeal_pow_eq_setOf_le_v_algebraMap_pow : ∀ [IsDiscreteValuationRing O] {ϖ : O} (_h : Irreducible ϖ) (n : ℕ), ((IsLocalRing.maximalIdeal O ^ n : Ideal O) : Set O) = {y : O | v (algebraMap O K y) ≤ v (algebraMap O K ϖ) ^ n} := by - letI : IsDomain O := hv.hom_inj.isDomain + let : IsDomain O := hv.hom_inj.isDomain intro _ ϖ h n have : (v (algebraMap O K ϖ)) ^ n = v (algebraMap O K (ϖ ^ n)) := by simp rw [this, ← hv.coe_span_singleton_eq_setOf_le_v_algebraMap, diff --git a/Mathlib/RingTheory/DiscreteValuationRing/TFAE.lean b/Mathlib/RingTheory/DiscreteValuationRing/TFAE.lean index f1a75c850f1310..f4c1f0e4f5cbde 100644 --- a/Mathlib/RingTheory/DiscreteValuationRing/TFAE.lean +++ b/Mathlib/RingTheory/DiscreteValuationRing/TFAE.lean @@ -229,7 +229,7 @@ variable {R} lemma IsLocalRing.finrank_CotangentSpace_eq_one_iff [IsNoetherianRing R] [IsLocalRing R] [IsDomain R] : finrank (ResidueField R) (CotangentSpace R) = 1 ↔ IsDiscreteValuationRing R := by by_cases hR : IsField R - · letI := hR.toField + · let := hR.toField simp only [finrank_cotangentSpace_eq_zero, zero_ne_one, false_iff] exact fun h ↦ h.3 maximalIdeal_eq_bot · exact (IsDiscreteValuationRing.TFAE R hR).out 5 0 diff --git a/Mathlib/RingTheory/Discriminant.lean b/Mathlib/RingTheory/Discriminant.lean index d1a54cd687e0ef..2972490392376e 100644 --- a/Mathlib/RingTheory/Discriminant.lean +++ b/Mathlib/RingTheory/Discriminant.lean @@ -203,7 +203,7 @@ theorem discr_powerBasis_eq_norm [Algebra.IsSeparable K L] : (-1) ^ (n * (n - 1) / 2) * norm K (aeval pb.gen (minpoly K pb.gen).derivative) := by let E := AlgebraicClosure L - letI := fun a b : E => Classical.propDecidable (Eq a b) + let := fun a b : E => Classical.propDecidable (Eq a b) have e : Fin pb.dim ≃ (L →ₐ[K] E) := by refine equivOfCardEq ?_ rw [Fintype.card_fin, AlgHom.card] diff --git a/Mathlib/RingTheory/EssentialFiniteness.lean b/Mathlib/RingTheory/EssentialFiniteness.lean index 0a76bea030a20b..ae39051f6bc1de 100644 --- a/Mathlib/RingTheory/EssentialFiniteness.lean +++ b/Mathlib/RingTheory/EssentialFiniteness.lean @@ -162,7 +162,7 @@ lemma essFiniteType_iff_exists_subalgebra : EssFiniteType R S ↔ ∃ (S₀ : Subalgebra R S) (M : Submonoid S₀), FiniteType R S₀ ∧ IsLocalization M S := by refine ⟨fun h ↦ ⟨subalgebra R S, submonoid R S, inferInstance, inferInstance⟩, ?_⟩ rintro ⟨S₀, M, _, _⟩ - letI := of_isLocalization S M + let := of_isLocalization S M exact comp R S₀ S instance EssFiniteType.baseChange [h : EssFiniteType R S] : EssFiniteType T (T ⊗[R] S) := by diff --git a/Mathlib/RingTheory/Etale/Basic.lean b/Mathlib/RingTheory/Etale/Basic.lean index c941952589073a..e13202a840d204 100644 --- a/Mathlib/RingTheory/Etale/Basic.lean +++ b/Mathlib/RingTheory/Etale/Basic.lean @@ -198,8 +198,8 @@ theorem localization_base [FormallyEtale R Sₘ] : FormallyEtale Rₘ Sₘ := /-- The localization of a formally étale map is formally étale. -/ theorem localization_map [FormallyEtale R S] : FormallyEtale Rₘ Sₘ := by - haveI : FormallyEtale S Sₘ := FormallyEtale.of_isLocalization (M.map (algebraMap R S)) - haveI : FormallyEtale R Sₘ := FormallyEtale.comp R S Sₘ + have : FormallyEtale S Sₘ := FormallyEtale.of_isLocalization (M.map (algebraMap R S)) + have : FormallyEtale R Sₘ := FormallyEtale.comp R S Sₘ exact FormallyEtale.localization_base M end Localization diff --git a/Mathlib/RingTheory/Etale/Kaehler.lean b/Mathlib/RingTheory/Etale/Kaehler.lean index 90b4de8ee12988..4fea33431d1202 100644 --- a/Mathlib/RingTheory/Etale/Kaehler.lean +++ b/Mathlib/RingTheory/Etale/Kaehler.lean @@ -188,11 +188,11 @@ lemma tensorCotangentInvFun_smul_mk (H : Function.Bijective ((f.mapKer halg).liftBaseChange Q.Ring)) (x : Q.Ring) (y : P.ker) : tensorCotangentInvFun f halg H (x • .mk ⟨f.toRingHom y, (f.mapKer halg y).2⟩) = x • 1 ⊗ₜ .mk y := by - letI := ((algebraMap S T).comp (algebraMap P.Ring S)).toAlgebra - haveI : IsScalarTower P.Ring S T := .of_algebraMap_eq' rfl - haveI : IsScalarTower P.Ring Q.Ring T := + let := ((algebraMap S T).comp (algebraMap P.Ring S)).toAlgebra + have : IsScalarTower P.Ring S T := .of_algebraMap_eq' rfl + have : IsScalarTower P.Ring Q.Ring T := .of_algebraMap_eq fun r ↦ halg ▸ (f.algebraMap_toRingHom r).symm - letI e := LinearEquiv.ofBijective _ H + let e := LinearEquiv.ofBijective _ H trans tensorCotangentInvFun f halg H (.mk ((f.mapKer halg).liftBaseChange Q.Ring (x ⊗ₜ y))) · simp; rfl change ((TensorProduct.mk _ _ _ 1).restrictScalars _ ∘ₗ Cotangent.mk).liftBaseChange _ @@ -352,12 +352,12 @@ lemma tensorH1CotangentOfIsLocalization_toLinearMap Extension.tensorH1CotangentOfFormallyEtale, LinearEquiv.ofBijective_apply, LinearMap.liftBaseChange_tmul, one_smul, Extension.equivH1CotangentOfFormallySmooth, LinearEquiv.trans_apply] - letI P : Extension R S := (Generators.self R S).toExtension - letI M' := M.comap (algebraMap P.Ring S) - letI fQ : Localization M' →ₐ[R] T := IsLocalization.liftAlgHom (M := M') + let P : Extension R S := (Generators.self R S).toExtension + let M' := M.comap (algebraMap P.Ring S) + let fQ : Localization M' →ₐ[R] T := IsLocalization.liftAlgHom (M := M') (f := (IsScalarTower.toAlgHom R S T).comp (IsScalarTower.toAlgHom R P.Ring S)) (fun ⟨y, hy⟩ ↦ by simpa using IsLocalization.map_units T ⟨algebraMap P.Ring S y, hy⟩) - letI Q : Extension R T := .ofSurjective fQ (by + let Q : Extension R T := .ofSurjective fQ (by intro x obtain ⟨x, ⟨s, hs⟩, rfl⟩ := IsLocalization.exists_mk'_eq M x obtain ⟨x, rfl⟩ := P.algebraMap_surjective x @@ -366,7 +366,7 @@ lemma tensorH1CotangentOfIsLocalization_toLinearMap simp only [fQ, IsLocalization.coe_liftAlgHom, AlgHom.toRingHom_eq_coe] rw [IsLocalization.lift_mk'_spec] simp) - letI f : (Generators.self R T).toExtension.Hom Q := + let f : (Generators.self R T).toExtension.Hom Q := { toRingHom := (MvPolynomial.aeval Q.σ).toRingHom toRingHom_algebraMap := (MvPolynomial.aeval Q.σ).commutes algebraMap_toRingHom := by diff --git a/Mathlib/RingTheory/Etale/StandardEtale.lean b/Mathlib/RingTheory/Etale/StandardEtale.lean index 64f44f09d4c17b..20862b46b49bb7 100644 --- a/Mathlib/RingTheory/Etale/StandardEtale.lean +++ b/Mathlib/RingTheory/Etale/StandardEtale.lean @@ -429,7 +429,7 @@ lemma IsStandardEtale.of_isLocalizationAway [IsStandardEtale R S] lemma IsStandardEtale.of_surjective [IsStandardEtale R S] [Algebra.Etale R T] (f : S →ₐ[R] T) (hf : Function.Surjective f) : IsStandardEtale R T := by - letI := f.toAlgebra + let := f.toAlgebra have : IsScalarTower R S T := .of_algebraMap_eq' f.comp_algebraMap.symm obtain ⟨e, he, hfe⟩ := (Ideal.isIdempotentElem_iff_of_fg _ (Algebra.FinitePresentation.ker_fG_of_surjective f hf)).mp diff --git a/Mathlib/RingTheory/Extension/Basic.lean b/Mathlib/RingTheory/Extension/Basic.lean index 949acefa98bf7c..46099df0ef9d58 100644 --- a/Mathlib/RingTheory/Extension/Basic.lean +++ b/Mathlib/RingTheory/Extension/Basic.lean @@ -135,7 +135,7 @@ def localization (P : Extension.{w} R S) : Extension R S' where (g := (algebraMap S S').comp (algebraMap P.Ring S)) (by simpa using fun x hx ↦ IsLocalization.map_units S' ⟨_, hx⟩)).toAlgebra isScalarTower := by - letI : Algebra (Localization (M.comap (algebraMap P.Ring S))) S' := + let : Algebra (Localization (M.comap (algebraMap P.Ring S))) S' := (IsLocalization.lift (M := (M.comap (algebraMap P.Ring S))) (g := (algebraMap S S').comp (algebraMap P.Ring S)) (by simpa using fun x hx ↦ IsLocalization.map_units S' ⟨_, hx⟩)).toAlgebra diff --git a/Mathlib/RingTheory/Extension/Cotangent/Basic.lean b/Mathlib/RingTheory/Extension/Cotangent/Basic.lean index 0f6e4172bbc0d5..0faa990a267968 100644 --- a/Mathlib/RingTheory/Extension/Cotangent/Basic.lean +++ b/Mathlib/RingTheory/Extension/Cotangent/Basic.lean @@ -218,7 +218,7 @@ lemma Hom.sub_aux (f g : Hom P P') (x y) : (P'.σ ((algebraMap P.Ring S') x) * (f.toAlgHom y - g.toAlgHom y) + P'.σ ((algebraMap P.Ring S') y) * (f.toAlgHom x - g.toAlgHom x)) ∈ P'.ker ^ 2 := by - letI := ((algebraMap S S').comp (algebraMap P.Ring S)).toAlgebra + let := ((algebraMap S S').comp (algebraMap P.Ring S)).toAlgebra have : (f.toAlgHom x - P'.σ (algebraMap P.Ring S' x)) * (f.toAlgHom y - g.toAlgHom y) + (g.toAlgHom y - P'.σ (algebraMap P.Ring S' y)) * (f.toAlgHom x - g.toAlgHom x) diff --git a/Mathlib/RingTheory/Extension/Generators.lean b/Mathlib/RingTheory/Extension/Generators.lean index 5c03910ea8864e..7bb848e62593c1 100644 --- a/Mathlib/RingTheory/Extension/Generators.lean +++ b/Mathlib/RingTheory/Extension/Generators.lean @@ -659,7 +659,7 @@ lemma ker_ofAlgEquiv (P : Generators R S ι) {T : Type*} [CommRing T] [Algebra R lemma map_toComp_ker (Q : Generators S T ι') (P : Generators R S ι) : P.ker.map (Q.toComp P).toAlgHom = RingHom.ker (Q.ofComp P).toAlgHom := by - letI : DecidableEq (ι' →₀ ℕ) := Classical.decEq _ + let : DecidableEq (ι' →₀ ℕ) := Classical.decEq _ apply le_antisymm · rw [Ideal.map_le_iff_le_comap] rintro x (hx : algebraMap P.Ring S x = 0) diff --git a/Mathlib/RingTheory/FinitePresentation.lean b/Mathlib/RingTheory/FinitePresentation.lean index cc8c128a3d64b0..e649854b1930f2 100644 --- a/Mathlib/RingTheory/FinitePresentation.lean +++ b/Mathlib/RingTheory/FinitePresentation.lean @@ -132,7 +132,7 @@ theorem iff : · rintro ⟨n, f, hf⟩ exact ⟨n, RingHom.ker f.toRingHom, Ideal.quotientKerAlgEquivOfSurjective hf.1, hf.2⟩ · rintro ⟨n, I, e, hfg⟩ - letI := (FinitePresentation.mvPolynomial_aux R _).quotient hfg + let := (FinitePresentation.mvPolynomial_aux R _).quotient hfg exact equiv e /-- An algebra is finitely presented if and only if it is a quotient of a polynomial ring whose @@ -183,7 +183,7 @@ theorem trans [Algebra A B] [IsScalarTower R A B] [FinitePresentation R A] [FinitePresentation A B] : FinitePresentation R B := by have hfpB : FinitePresentation A B := inferInstance obtain ⟨n, I, e, hfg⟩ := iff.1 hfpB - letI : FinitePresentation R (MvPolynomial (Fin n) A ⧸ I) := + let : FinitePresentation R (MvPolynomial (Fin n) A ⧸ I) := (mvPolynomial_of_finitePresentation _).quotient hfg exact equiv (e.restrictScalars R) @@ -212,8 +212,8 @@ theorem of_restrict_scalars_finitePresentation [Algebra A B] [IsScalarTower R A FinitePresentation.{w₂, w₃} A B := by classical obtain ⟨n, f, hf, s, hs⟩ := FinitePresentation.out (R := R) (A := B) - letI RX := MvPolynomial (Fin n) R - letI AX := MvPolynomial (Fin n) A + let RX := MvPolynomial (Fin n) R + let AX := MvPolynomial (Fin n) A refine ⟨n, MvPolynomial.aeval (f ∘ X), ?_, ?_⟩ · rw [← AlgHom.range_eq_top, ← Algebra.adjoin_range_eq_range_aeval, Set.range_comp f MvPolynomial.X, eq_top_iff, ← @adjoin_adjoin_of_tower R A B, @@ -230,7 +230,7 @@ theorem of_restrict_scalars_finitePresentation [Algebra A B] [IsScalarTower R A apply Subalgebra.restrictScalars_injective R rw [← adjoin_restrictScalars, adjoin_range_X, Subalgebra.restrictScalars_top, Subalgebra.restrictScalars_top] - letI g : t → AX := fun x => MvPolynomial.C (x : A) - map (algebraMap R A) (t' x) + let g : t → AX := fun x => MvPolynomial.C (x : A) - map (algebraMap R A) (t' x) refine ⟨s.image (map (algebraMap R A)) ∪ t.attach.image g, ?_⟩ rw [Finset.coe_union, Finset.coe_image, Finset.coe_image, Finset.attach_eq_univ, Finset.coe_univ, Set.image_univ] @@ -475,7 +475,7 @@ lemma polynomial_induction P R S f → Q S T g → Q R T (g.comp f)) {R : Type u} {S : Type v} [CommRing R] [CommRing S] (f : R →+* S) (hf : f.FinitePresentation) : Q R S f := by - letI := f.toAlgebra + let := f.toAlgebra obtain ⟨n, g, hg, hg'⟩ := hf let g' := g.toRingHom change Surjective g' at hg diff --git a/Mathlib/RingTheory/FiniteType.lean b/Mathlib/RingTheory/FiniteType.lean index c31975d59b8c2f..346c6ccb601fa6 100644 --- a/Mathlib/RingTheory/FiniteType.lean +++ b/Mathlib/RingTheory/FiniteType.lean @@ -154,7 +154,7 @@ theorem iff_quotient_freeAlgebra' : FiniteType R A ↔ rintro ⟨s, f, hsur⟩ use { x : A // x ∈ s }, inferInstance, f · rintro ⟨ι, hfintype, f, hsur⟩ - letI : Fintype ι := hfintype + let : Fintype ι := hfintype exact .of_surjective f hsur /-- A commutative algebra is finitely generated if and only if it is a quotient @@ -166,7 +166,7 @@ theorem iff_quotient_mvPolynomial' : FiniteType R S ↔ rintro ⟨s, f, hsur⟩ use { x : S // x ∈ s }, inferInstance, f · rintro ⟨ι, hfintype, f, hsur⟩ - letI : Fintype ι := hfintype + let : Fintype ι := hfintype exact .of_surjective f hsur /-- A commutative algebra is finitely generated if and only if it is a quotient of a polynomial ring @@ -363,7 +363,7 @@ image generates, as algebra, `R[M]`. -/ theorem exists_finset_adjoin_eq_top [h : FiniteType R R[M]] : ∃ G : Finset M, Algebra.adjoin R (of' R M '' G) = ⊤ := by obtain ⟨S, hS⟩ := h - letI : DecidableEq M := Classical.decEq M + let : DecidableEq M := Classical.decEq M use Finset.biUnion S fun f => f.coeff.support have : S.biUnion (fun f => f.coeff.support) = ⋃ f ∈ S, (f.coeff.support : Set M) := by simp only [Finset.set_biUnion_coe, Finset.coe_biUnion] @@ -512,7 +512,7 @@ generates, as algebra, `R[M]`. -/ theorem exists_finset_adjoin_eq_top [h : FiniteType R R[M]] : ∃ G : Finset M, Algebra.adjoin R (of R M '' G) = ⊤ := by obtain ⟨S, hS⟩ := h - letI : DecidableEq M := Classical.decEq M + let : DecidableEq M := Classical.decEq M use Finset.biUnion S fun f => f.coeff.support have : S.biUnion (fun f => f.coeff.support) = ⋃ f ∈ S, (f.coeff.support : Set M) := by simp only [Finset.set_biUnion_coe, Finset.coe_biUnion] @@ -631,8 +631,8 @@ A shortcut instance `commRing_strongRankCondition` is also provided. instance (priority := 100) CommRing.orzechProperty (R : Type*) [CommRing R] : OrzechProperty R := by refine ⟨fun {M} _ _ _ {N} f hf ↦ ?_⟩ - letI := addCommMonoidToAddCommGroup R (M := M) - letI := addCommMonoidToAddCommGroup R (M := N) + let := addCommMonoidToAddCommGroup R (M := M) + let := addCommMonoidToAddCommGroup R (M := N) let i := N.subtype let hi : Function.Injective i := N.injective_subtype refine LinearMap.ker_eq_bot.1 <| LinearMap.ker_eq_bot'.2 fun n hn ↦ ?_ @@ -644,9 +644,9 @@ instance (priority := 100) CommRing.orzechProperty let A := Subring.closure (Set.range b ∪ Set.range c.uncurry) let N' := span A ({n} ∪ Set.range nj) let M' := span A (Set.range mj) - haveI : IsNoetherianRing A := is_noetherian_subring_closure _ + have : IsNoetherianRing A := is_noetherian_subring_closure _ (.union (Set.finite_range _) (Set.finite_range _)) - haveI : Module.Finite A M' := span_of_finite A (Set.finite_range _) + have : Module.Finite A M' := span_of_finite A (Set.finite_range _) refine congr($((LinearMap.ker_eq_bot'.1 <| LinearMap.ker_eq_bot.2 <| IsNoetherian.injective_of_surjective_of_injective ((i.restrictScalars A).restrict fun x hx ↦ ?_ : N' →ₗ[A] M') diff --git a/Mathlib/RingTheory/Finiteness/Basic.lean b/Mathlib/RingTheory/Finiteness/Basic.lean index 7cb4b5fed17525..33801af9098662 100644 --- a/Mathlib/RingTheory/Finiteness/Basic.lean +++ b/Mathlib/RingTheory/Finiteness/Basic.lean @@ -382,15 +382,15 @@ lemma of_equiv_equiv {A₁ B₁ A₂ B₂ : Type*} [CommSemiring A₁] [CommSemi (e₂ : B₁ ≃+* B₂) (he : RingHom.comp (algebraMap A₂ B₂) ↑e₁ = RingHom.comp ↑e₂ (algebraMap A₁ B₁)) [Module.Finite A₁ B₁] : Module.Finite A₂ B₂ := by - letI := e₁.toRingHom.toAlgebra - letI := ((algebraMap A₁ B₁).comp e₁.symm.toRingHom).toAlgebra - haveI : IsScalarTower A₁ A₂ B₁ := IsScalarTower.of_algebraMap_eq + let := e₁.toRingHom.toAlgebra + let := ((algebraMap A₁ B₁).comp e₁.symm.toRingHom).toAlgebra + have : IsScalarTower A₁ A₂ B₁ := IsScalarTower.of_algebraMap_eq (fun x ↦ by simp [RingHom.algebraMap_toAlgebra]) let e : B₁ ≃ₐ[A₂] B₂ := { e₂ with commutes' := fun r ↦ by simpa [RingHom.algebraMap_toAlgebra] using DFunLike.congr_fun he.symm (e₁.symm r) } - haveI := of_restrictScalars_finite A₁ A₂ B₁ + have := of_restrictScalars_finite A₁ A₂ B₁ exact equiv e.toLinearEquiv end Algebra diff --git a/Mathlib/RingTheory/Finiteness/FiniteTypeLocal.lean b/Mathlib/RingTheory/Finiteness/FiniteTypeLocal.lean index f41af9b621f778..d5d18975af94cc 100644 --- a/Mathlib/RingTheory/Finiteness/FiniteTypeLocal.lean +++ b/Mathlib/RingTheory/Finiteness/FiniteTypeLocal.lean @@ -138,7 +138,7 @@ lemma Algebra.FiniteType.of_span_eq_top_source (s : Set R) (hs : Ideal.span (s : obtain ⟨s, h₁, hs⟩ := (Ideal.span_eq_top_iff_finite s).mp hs replace h (i : s) := h i.val (h₁ i.property) classical - letI := fun r : s => (Localization.awayMap (algebraMap R S) r).toAlgebra + let := fun r : s => (Localization.awayMap (algebraMap R S) r).toAlgebra set f := algebraMap R S constructor replace H := fun r => (h r).1 diff --git a/Mathlib/RingTheory/Finiteness/Finsupp.lean b/Mathlib/RingTheory/Finiteness/Finsupp.lean index 5a453d26a34539..49ff8576b1177a 100644 --- a/Mathlib/RingTheory/Finiteness/Finsupp.lean +++ b/Mathlib/RingTheory/Finiteness/Finsupp.lean @@ -34,9 +34,9 @@ finitely generated then so is M. -/ theorem fg_of_fg_map_of_fg_inf_ker (f : M →ₗ[R] P) {s : Submodule R M} (hs1 : (s.map f).FG) (hs2 : (s ⊓ LinearMap.ker f).FG) : s.FG := by - haveI := Classical.decEq R - haveI := Classical.decEq M - haveI := Classical.decEq P + have := Classical.decEq R + have := Classical.decEq M + have := Classical.decEq P obtain ⟨t1, ht1⟩ := hs1 obtain ⟨t2, ht2⟩ := hs2 have : ∀ y ∈ t1, ∃ x ∈ s, f x = y := by @@ -80,7 +80,7 @@ theorem fg_of_fg_map_of_fg_inf_ker (f : M →ₗ[R] P) {s : Submodule R M} add_sub_cancel _ _⟩ · rw [← Set.image_id (g '' ↑t1), Finsupp.mem_span_image_iff_linearCombination] refine ⟨_, ?_, rfl⟩ - haveI : Inhabited P := ⟨0⟩ + have : Inhabited P := ⟨0⟩ rw [← Finsupp.lmapDomain_supported _ _ g, mem_map] refine ⟨l, hl1, ?_⟩ rfl diff --git a/Mathlib/RingTheory/Finiteness/Ideal.lean b/Mathlib/RingTheory/Finiteness/Ideal.lean index 55320f6c2a1488..d672469d49a5a8 100644 --- a/Mathlib/RingTheory/Finiteness/Ideal.lean +++ b/Mathlib/RingTheory/Finiteness/Ideal.lean @@ -35,10 +35,10 @@ theorem fg_ker_comp {R S A : Type*} [CommRing R] [CommRing S] [CommRing A] (f : (g : S →+* A) (hf : (RingHom.ker f).FG) (hg : (RingHom.ker g).FG) (hsur : Function.Surjective f) : (RingHom.ker (g.comp f)).FG := by - letI : Algebra R S := RingHom.toAlgebra f - letI : Algebra R A := RingHom.toAlgebra (g.comp f) - letI : Algebra S A := RingHom.toAlgebra g - letI : IsScalarTower R S A := IsScalarTower.of_algebraMap_eq fun _ => rfl + let : Algebra R S := RingHom.toAlgebra f + let : Algebra R A := RingHom.toAlgebra (g.comp f) + let : Algebra S A := RingHom.toAlgebra g + let : IsScalarTower R S A := IsScalarTower.of_algebraMap_eq fun _ => rfl let f₁ := Algebra.linearMap R S let g₁ := (IsScalarTower.toAlgHom R S A).toLinearMap exact Submodule.fg_ker_comp f₁ g₁ hf diff --git a/Mathlib/RingTheory/Finiteness/ModuleFinitePresentation.lean b/Mathlib/RingTheory/Finiteness/ModuleFinitePresentation.lean index e4a319f6b9aa12..0403a963280364 100644 --- a/Mathlib/RingTheory/Finiteness/ModuleFinitePresentation.lean +++ b/Mathlib/RingTheory/Finiteness/ModuleFinitePresentation.lean @@ -82,7 +82,7 @@ lemma Module.FinitePresentation.of_finite_of_finitePresentation Module.FinitePresentation R S := by classical obtain ⟨R', _, _, _, _, _, f, hf⟩ := Module.Finite.exists_free_surjective R S - letI := f.toRingHom.toAlgebra + let := f.toRingHom.toAlgebra have : IsScalarTower R R' S := .of_algebraMap_eq' f.comp_algebraMap.symm have : Module.FinitePresentation R R' := Module.finitePresentation_of_projective R R' diff --git a/Mathlib/RingTheory/Flat/Basic.lean b/Mathlib/RingTheory/Flat/Basic.lean index 4a47d982cc92fc..b82c8eaaa79e71 100644 --- a/Mathlib/RingTheory/Flat/Basic.lean +++ b/Mathlib/RingTheory/Flat/Basic.lean @@ -233,7 +233,7 @@ instance of_free [Free R M] : Flat R M := inferInstance instance {S} [CommSemiring S] [Algebra R S] [Module S M] [IsScalarTower R S M] [Flat S M] [Flat R N] : Flat S (M ⊗[R] N) := iff_rTensor_injectiveₛ.mpr fun P _ _ I ↦ by - letI := RestrictScalars.moduleOrig R S P + let := RestrictScalars.moduleOrig R S P change Submodule S (RestrictScalars R S P) at I change Function.Injective (rTensor _ I.subtype) simpa [AlgebraTensorModule.rTensor_tensor] using! @@ -290,8 +290,8 @@ lemma iff_rTensor_preserves_injective_linearMap' [Small.{v'} R] : Flat R M ↔ (f : N →ₗ[R] N'), Function.Injective f → Function.Injective (f.rTensor M) := ⟨by introv _; apply rTensor_preserves_injective_linearMap, fun h ↦ iff_rTensor_preserves_injective_linearMapₛ.mpr fun P N _ _ _ _ ↦ by - letI := Module.addCommMonoidToAddCommGroup R (M := P) - letI := Module.addCommMonoidToAddCommGroup R (M := N) + let := Module.addCommMonoidToAddCommGroup R (M := P) + let := Module.addCommMonoidToAddCommGroup R (M := N) apply h⟩ /-- `M` is flat if and only if `f ⊗ 𝟙 M` is injective whenever `f` is an injective linear map. diff --git a/Mathlib/RingTheory/Flat/EquationalCriterion.lean b/Mathlib/RingTheory/Flat/EquationalCriterion.lean index d574fc160be643..8b72cfa8d36a6b 100644 --- a/Mathlib/RingTheory/Flat/EquationalCriterion.lean +++ b/Mathlib/RingTheory/Flat/EquationalCriterion.lean @@ -272,7 +272,7 @@ theorem exists_factorization_of_finitePresentation [Flat R M] {P : Type*} [AddCo [Module R P] [FinitePresentation R P] (h₁ : P →ₗ[R] M) : ∃ (k : ℕ) (h₂ : P →ₗ[R] (Fin k →₀ R)) (h₃ : (Fin k →₀ R) →ₗ[R] M), h₁ = h₃ ∘ₗ h₂ := by have ⟨_, K, ϕ, hK⟩ := FinitePresentation.exists_fin R P - haveI : Module.Finite R K := .of_fg hK + have : Module.Finite R K := .of_fg hK have : (h₁ ∘ₗ ϕ.symm ∘ₗ K.mkQ) ∘ₗ K.subtype = 0 := by simp_rw [comp_assoc, (LinearMap.exact_subtype_mkQ K).linearMap_comp_eq_zero, comp_zero] obtain ⟨k, a, y, hay, ha⟩ := exists_factorization_of_comp_eq_zero_of_free this diff --git a/Mathlib/RingTheory/Flat/FaithfullyFlat/Basic.lean b/Mathlib/RingTheory/Flat/FaithfullyFlat/Basic.lean index 6456743c4165d5..c2d6c3c609d283 100644 --- a/Mathlib/RingTheory/Flat/FaithfullyFlat/Basic.lean +++ b/Mathlib/RingTheory/Flat/FaithfullyFlat/Basic.lean @@ -127,7 +127,7 @@ lemma lTensor_reflects_triviality [FaithfullyFlat R M] (N : Type*) [AddCommGroup N] [Module R N] [Subsingleton (M ⊗[R] N)] : Subsingleton N := by - haveI : Subsingleton (N ⊗[R] M) := (TensorProduct.comm R N M).toEquiv.injective.subsingleton + have : Subsingleton (N ⊗[R] M) := (TensorProduct.comm R N M).toEquiv.injective.subsingleton apply rTensor_reflects_triviality R M attribute [-simp] Ideal.Quotient.mk_eq_mk in @@ -139,7 +139,7 @@ lemma iff_flat_and_rTensor_faithful : refine ⟨fun fl => ⟨inferInstance, rTensor_nontrivial R M⟩, fun ⟨flat, faithful⟩ => ⟨?_⟩⟩ intro m hm rid specialize faithful (ULift (R ⧸ m)) inferInstance - haveI : Nontrivial ((R ⧸ m) ⊗[R] M) := + have : Nontrivial ((R ⧸ m) ⊗[R] M) := (congr (ULift.moduleEquiv : ULift (R ⧸ m) ≃ₗ[R] R ⧸ m) (LinearEquiv.refl R M)).symm.toEquiv.nontrivial have := (quotTensorEquivQuotSMul M m).toEquiv.symm.nontrivial @@ -195,7 +195,7 @@ instance directSum {ι : Type*} [Nonempty ι] (M : ι → Type*) [∀ i, AddComm refine ⟨inferInstance, fun N _ _ hN ↦ ?_⟩ obtain ⟨i⟩ := ‹Nonempty ι› obtain ⟨x, y, hxy⟩ := Nontrivial.exists_pair_ne (α := M i ⊗[R] N) - haveI : Nontrivial (⨁ (i : ι), M i ⊗[R] N) := + have : Nontrivial (⨁ (i : ι), M i ⊗[R] N) := ⟨DirectSum.of _ i x, DirectSum.of _ i y, fun h ↦ hxy (DirectSum.of_injective i h)⟩ apply (TensorProduct.directSumLeft R R M N).toEquiv.nontrivial diff --git a/Mathlib/RingTheory/FormalGroup/Basic.lean b/Mathlib/RingTheory/FormalGroup/Basic.lean index 4c6d3bf0156cb7..a397d7a32fbbee 100644 --- a/Mathlib/RingTheory/FormalGroup/Basic.lean +++ b/Mathlib/RingTheory/FormalGroup/Basic.lean @@ -242,7 +242,7 @@ lemma Xzero_subst_Xzero : F.Xzero.subst F.Xzero = F.Xzero := by PowerSeries.HasSubst.X', PowerSeries.HasSubst] lemma Xzero_eq_X : F.Xzero = PowerSeries.X := by - haveI : Invertible (F.Xzero.coeff 1) := (coeff_one_Xzero F) ▸ invertibleOne + have : Invertible (F.Xzero.coeff 1) := (coeff_one_Xzero F) ▸ invertibleOne calc _ = F.Xzero.substInv.subst (F.Xzero.subst F.Xzero) := by have aux₀ : PowerSeries.HasSubst F.Xzero := @@ -292,7 +292,7 @@ lemma zeroX_subst_zeroX : F.zeroX.subst F.zeroX = F.zeroX := by PowerSeries.HasSubst.X', PowerSeries.HasSubst] lemma zeroX_eq_X : F.zeroX = PowerSeries.X := by - haveI : Invertible (F.zeroX.coeff 1) := (coeff_one_zeroX F) ▸ invertibleOne + have : Invertible (F.zeroX.coeff 1) := (coeff_one_zeroX F) ▸ invertibleOne calc _ = F.zeroX.substInv.subst (F.zeroX.subst F.zeroX) := by have aux₀ : PowerSeries.HasSubst F.zeroX := diff --git a/Mathlib/RingTheory/FreeCommRing.lean b/Mathlib/RingTheory/FreeCommRing.lean index d04ee6c24b36e5..3123cb440278fd 100644 --- a/Mathlib/RingTheory/FreeCommRing.lean +++ b/Mathlib/RingTheory/FreeCommRing.lean @@ -239,7 +239,7 @@ theorem isSupported_of {p} {s : Set α} : IsSupported (of p) s ↔ p ∈ s := suffices IsSupported (of p) s → p ∈ s from ⟨this, fun hps => Subring.subset_closure ⟨p, hps, rfl⟩⟩ fun hps : IsSupported (of p) s => by classical - haveI := Classical.decPred (· ∈ s) + have := Classical.decPred (· ∈ s) have : ∀ x, IsSupported x s → ∃ n : ℤ, lift (fun a => if a ∈ s then (0 : ℤ[X]) else Polynomial.X) x = n := by intro x hx diff --git a/Mathlib/RingTheory/GradedAlgebra/HomogeneousLocalization.lean b/Mathlib/RingTheory/GradedAlgebra/HomogeneousLocalization.lean index 4658ca2c7240e3..30c4f373268c3d 100644 --- a/Mathlib/RingTheory/GradedAlgebra/HomogeneousLocalization.lean +++ b/Mathlib/RingTheory/GradedAlgebra/HomogeneousLocalization.lean @@ -883,7 +883,7 @@ variable {x : A} (hx : x = f * g) theorem Away.isLocalization_mul (hd : d ≠ 0) : letI := (awayMap 𝒜 hg hx).toAlgebra IsLocalization.Away (isLocalizationElem hf hg) (Away 𝒜 x) := by - letI := (awayMap 𝒜 hg hx).toAlgebra + let := (awayMap 𝒜 hg hx).toAlgebra constructor; constructor · rintro ⟨r, n, rfl⟩ rw [map_pow, RingHom.algebraMap_toAlgebra] diff --git a/Mathlib/RingTheory/HahnSeries/Multiplication.lean b/Mathlib/RingTheory/HahnSeries/Multiplication.lean index 035bbf98a04d5b..910f8186cdf59c 100644 --- a/Mathlib/RingTheory/HahnSeries/Multiplication.lean +++ b/Mathlib/RingTheory/HahnSeries/Multiplication.lean @@ -967,7 +967,7 @@ variable [NonUnitalNonAssocSemiring R] instance [IsCancelAdd R] [IsCancelMulZero R] : IsCancelMulZero R⟦Γ⟧ where -- TODO: This proof is painful because `coeff_mul` isn't stated in terms of `Finsupp.sum`. mul_left_cancel_of_ne_zero {x} hx y z hyz := by - letI : AddCancelCommMonoid R := ⟨⟩ + let : AddCancelCommMonoid R := ⟨⟩ contrapose! hyz simp only [ne_eq, ← coeff_inj, funext_iff, not_forall] at ⊢ hyz have : Set.IsWF {a | y.coeff a ≠ z.coeff a} := @@ -989,7 +989,7 @@ instance [IsCancelAdd R] [IsCancelMulZero R] : IsCancelMulZero R⟦Γ⟧ where · simp +contextual [← and_or_left, ← or_and_right] · simp +contextual [← and_or_left, ← or_and_right] mul_right_cancel_of_ne_zero {x} hx y z hyz := by - letI : AddCancelCommMonoid R := ⟨⟩ + let : AddCancelCommMonoid R := ⟨⟩ contrapose! hyz simp only [ne_eq, ← coeff_inj, funext_iff, not_forall] at ⊢ hyz have : Set.IsWF {a | y.coeff a ≠ z.coeff a} := diff --git a/Mathlib/RingTheory/Henselian.lean b/Mathlib/RingTheory/Henselian.lean index 574b704be8d90f..a107dd2c746fa2 100644 --- a/Mathlib/RingTheory/Henselian.lean +++ b/Mathlib/RingTheory/Henselian.lean @@ -198,7 +198,7 @@ instance (priority := 100) IsAdicComplete.henselianRing (R : Type*) [CommRing R] exact (ih.eval f).trans h₁ have hf'c : ∀ n, IsUnit (f'.eval (c n)) := by intro n - haveI := isLocalHom_of_le_jacobson_bot I (IsAdicComplete.le_jacobson_bot I) + have := isLocalHom_of_le_jacobson_bot I (IsAdicComplete.le_jacobson_bot I) apply IsUnit.of_map (Ideal.Quotient.mk I) convert! h₂ using 1 exact SModEq.def.mp ((hc_mod n).eval _) diff --git a/Mathlib/RingTheory/Ideal/AssociatedPrime/Basic.lean b/Mathlib/RingTheory/Ideal/AssociatedPrime/Basic.lean index 4643bb3748d6f5..abbeef599d2cc3 100644 --- a/Mathlib/RingTheory/Ideal/AssociatedPrime/Basic.lean +++ b/Mathlib/RingTheory/Ideal/AssociatedPrime/Basic.lean @@ -287,7 +287,7 @@ theorem associatedPrimes.eq_singleton_of_isPrimary [IsNoetherianRing R] (hI : I. rw [Set.mem_singleton_iff] refine ⟨IsAssociatedPrime.eq_radical hI, ?_⟩ rintro rfl - haveI : Nontrivial (R ⧸ I) := by + have : Nontrivial (R ⧸ I) := by refine ⟨(Ideal.Quotient.mk I :) 1, (Ideal.Quotient.mk I :) 0, ?_⟩ rw [Ne, Ideal.Quotient.eq, sub_zero, ← Ideal.eq_top_iff_one] exact hI.1 diff --git a/Mathlib/RingTheory/Ideal/GoingUp.lean b/Mathlib/RingTheory/Ideal/GoingUp.lean index 3c9b3441e4d7fe..1488b729f7051d 100644 --- a/Mathlib/RingTheory/Ideal/GoingUp.lean +++ b/Mathlib/RingTheory/Ideal/GoingUp.lean @@ -204,7 +204,7 @@ theorem eq_bot_of_comap_eq_bot [Nontrivial R] [IsDomain S] [Algebra.IsIntegral R theorem isMaximal_comap_of_isIntegral_of_isMaximal [Algebra.IsIntegral R S] (I : Ideal S) [hI : I.IsMaximal] : IsMaximal (I.comap (algebraMap R S)) := by refine Ideal.Quotient.maximal_of_isField _ ?_ - haveI : IsPrime (I.comap (algebraMap R S)) := comap_isPrime _ _ + have : IsPrime (I.comap (algebraMap R S)) := comap_isPrime _ _ exact isField_of_isIntegral_of_isField algebraMap_quotient_injective (by rwa [← Quotient.maximal_ideal_iff_isField_quotient]) @@ -286,7 +286,7 @@ theorem exists_ideal_over_prime_of_isIntegral_of_isDomain [Algebra.IsIntegral R exact absurd (hP x0) hx let Rₚ := Localization P.primeCompl let Sₚ := Localization (Algebra.algebraMapSubmonoid S P.primeCompl) - letI : IsDomain (Localization (Algebra.algebraMapSubmonoid S P.primeCompl)) := + let : IsDomain (Localization (Algebra.algebraMapSubmonoid S P.primeCompl)) := IsLocalization.isDomain_localization (le_nonZeroDivisors_of_noZeroDivisors hP0) obtain ⟨Qₚ : Ideal Sₚ, Qₚ_maximal⟩ := exists_maximal Sₚ let _ : Algebra Rₚ Sₚ := localizationAlgebra P.primeCompl S diff --git a/Mathlib/RingTheory/Ideal/Maps.lean b/Mathlib/RingTheory/Ideal/Maps.lean index 62de906cb2c249..135e2a6ff1a219 100644 --- a/Mathlib/RingTheory/Ideal/Maps.lean +++ b/Mathlib/RingTheory/Ideal/Maps.lean @@ -1140,11 +1140,11 @@ theorem map_radical_of_surjective {f : R →+* S} (hf : Function.Surjective f) { ext j constructor · rintro ⟨hj, hj'⟩ - haveI : j.IsPrime := hj' + have : j.IsPrime := hj' exact ⟨comap f j, ⟨⟨map_le_iff_le_comap.1 hj, comap_isPrime f j⟩, map_comap_of_surjective f hf j⟩⟩ · rintro ⟨J, ⟨hJ, hJ'⟩⟩ - haveI : J.IsPrime := hJ.right + have : J.IsPrime := hJ.right exact ⟨hJ' ▸ map_mono hJ.left, hJ' ▸ map_isPrime_of_surjective hf (le_trans h hJ.left)⟩ end CommRing diff --git a/Mathlib/RingTheory/Ideal/Norm/AbsNorm.lean b/Mathlib/RingTheory/Ideal/Norm/AbsNorm.lean index a8f308649071e7..96a0b40221f664 100644 --- a/Mathlib/RingTheory/Ideal/Norm/AbsNorm.lean +++ b/Mathlib/RingTheory/Ideal/Norm/AbsNorm.lean @@ -187,7 +187,7 @@ end PPrime theorem cardQuot_mul [IsDedekindDomain S] [Module.Free ℤ S] (I J : Ideal S) : cardQuot (I * J) = cardQuot I * cardQuot J := by let b := Module.Free.chooseBasis ℤ S - haveI : Infinite S := Infinite.of_surjective _ b.repr.toEquiv.surjective + have : Infinite S := Infinite.of_surjective _ b.repr.toEquiv.surjective exact UniqueFactorizationMonoid.multiplicative_of_coprime cardQuot I J (cardQuot_bot _ _) (fun {I J} hI => by simp [Ideal.isUnit_iff.mp hI, Ideal.mul_top]) (fun {I} i hI => @@ -371,7 +371,7 @@ lemma exists_prime_and_absNorm_eq_pow (P : Ideal S) [P.IsMaximal] : (Ideal.finrank_eq_finrank (Module.Free.chooseBasis _ _) _ (Ideal.IsMaximal.ne_bot_of_isIntegral_int P)) cases nonempty_fintype (S ⧸ P) - letI := Ideal.Quotient.field P + let := Ideal.Quotient.field P obtain ⟨p, hpR⟩ := CharP.exists (S ⧸ P) obtain ⟨n, hp, e⟩ := FiniteField.card (S ⧸ P) p have hP : P.absNorm = p ^ (n : ℕ) := (Nat.card_eq_fintype_card.trans e:) diff --git a/Mathlib/RingTheory/Ideal/Operations.lean b/Mathlib/RingTheory/Ideal/Operations.lean index 7017583d9e6b72..bad9e2f9428107 100644 --- a/Mathlib/RingTheory/Ideal/Operations.lean +++ b/Mathlib/RingTheory/Ideal/Operations.lean @@ -181,7 +181,7 @@ theorem mem_ideal_smul_span_iff_exists_sum {ι : Type*} (f : ι → M) (x : M) : refine fun hx => span_induction ?_ ?_ ?_ ?_ (mem_smul_span.mp hx) · rintro x ⟨y, hy, x, ⟨i, rfl⟩, rfl⟩ refine ⟨Finsupp.single i y, fun j => ?_, ?_⟩ - · letI := Classical.decEq ι + · let := Classical.decEq ι rw [Finsupp.single_apply] split_ifs · assumption diff --git a/Mathlib/RingTheory/Ideal/Prod.lean b/Mathlib/RingTheory/Ideal/Prod.lean index 2f9f38b8b60868..afa0e0c1703ebb 100644 --- a/Mathlib/RingTheory/Ideal/Prod.lean +++ b/Mathlib/RingTheory/Ideal/Prod.lean @@ -172,7 +172,7 @@ theorem isPrime_ideal_prod_top {I : Ideal R} [h : I.IsPrime] : (prod I (⊤ : Id mem_or_mem' {x y} := by simpa using h.mem_or_mem theorem isPrime_ideal_prod_top' {I : Ideal S} [h : I.IsPrime] : (prod (⊤ : Ideal R) I).IsPrime := by - letI : IsPrime (prod I (⊤ : Ideal R)) := isPrime_ideal_prod_top + let : IsPrime (prod I (⊤ : Ideal R)) := isPrime_ideal_prod_top rw [← map_prodComm_prod] -- Note: couldn't synthesize the right instances without the `R` and `S` hints exact map_isPrime_of_equiv (RingEquiv.prodComm (R := S) (S := R)) diff --git a/Mathlib/RingTheory/Ideal/Quotient/Basic.lean b/Mathlib/RingTheory/Ideal/Quotient/Basic.lean index cd2056327ea71e..8b928643d7d8e6 100644 --- a/Mathlib/RingTheory/Ideal/Quotient/Basic.lean +++ b/Mathlib/RingTheory/Ideal/Quotient/Basic.lean @@ -93,10 +93,10 @@ instance isDomain [hI : I.IsPrime] : IsDomain (R ⧸ I) := theorem isDomain_iff_prime : IsDomain (R ⧸ I) ↔ I.IsPrime := by refine ⟨fun H => ⟨zero_ne_one_iff.1 ?_, fun {x y} h => ?_⟩, fun h => inferInstance⟩ - · haveI : Nontrivial (R ⧸ I) := ⟨H.2.1⟩ + · have : Nontrivial (R ⧸ I) := ⟨H.2.1⟩ exact zero_ne_one · simp only [← eq_zero_iff_mem, (mk I).map_mul] at h ⊢ - haveI := @IsDomain.to_noZeroDivisors (R ⧸ I) _ H + have := @IsDomain.to_noZeroDivisors (R ⧸ I) _ H exact eq_zero_or_eq_zero_of_mul_eq_zero h set_option backward.isDefEq.respectTransparency false in diff --git a/Mathlib/RingTheory/Ideal/Quotient/Nilpotent.lean b/Mathlib/RingTheory/Ideal/Quotient/Nilpotent.lean index 1776fae04849ee..103265071af86a 100644 --- a/Mathlib/RingTheory/Ideal/Quotient/Nilpotent.lean +++ b/Mathlib/RingTheory/Ideal/Quotient/Nilpotent.lean @@ -37,7 +37,7 @@ theorem Ideal.IsNilpotent.induction_on (hI : IsNilpotent I) rw [← Ideal.zero_eq_bot, zero_pow two_ne_zero] rcases n with - | n · rw [pow_zero, Ideal.one_eq_top] at hI - haveI := subsingleton_of_bot_eq_top hI.symm + have := subsingleton_of_bot_eq_top hI.symm exact (hI' (Subsingleton.elim _ _)).elim rcases n with - | n · rw [pow_one] at hI diff --git a/Mathlib/RingTheory/Ideal/Quotient/Operations.lean b/Mathlib/RingTheory/Ideal/Quotient/Operations.lean index 49867700683d63..b96f1f0e99050a 100644 --- a/Mathlib/RingTheory/Ideal/Quotient/Operations.lean +++ b/Mathlib/RingTheory/Ideal/Quotient/Operations.lean @@ -175,7 +175,7 @@ theorem bot_quotient_isMaximal_iff (I : Ideal R) [I.IsTwoSided] : mk_ker (I := I) ▸ comap_isMaximal_of_surjective (Quotient.mk I) Quotient.mk_surjective (K := ⊥) (H := hI), fun hI => by - letI := Quotient.divisionRing I + let := Quotient.divisionRing I exact bot_isMaximal⟩ /-- See also `Ideal.mem_quotient_iff_mem` in case `I ≤ J`. -/ diff --git a/Mathlib/RingTheory/IntegralClosure/Algebra/Basic.lean b/Mathlib/RingTheory/IntegralClosure/Algebra/Basic.lean index 2d92eb83d2fc27..0ec0236f41a634 100644 --- a/Mathlib/RingTheory/IntegralClosure/Algebra/Basic.lean +++ b/Mathlib/RingTheory/IntegralClosure/Algebra/Basic.lean @@ -118,7 +118,7 @@ theorem isIntegral_of_smul_mem_submodule [IsDomain A] {M : Type*} [AddCommGroup exact Subtype.ext ((smul_eq_zero_iff_left ha₂).1 this) change IsIntegral R (A'.val ⟨x, hx⟩) rw [isIntegral_algHom_iff A'.val Subtype.val_injective, ← isIntegral_algHom_iff f this] - haveI : Module.Finite R N := by rwa [Module.Finite.iff_fg] + have : Module.Finite R N := by rwa [Module.Finite.iff_fg] apply Algebra.IsIntegral.isIntegral variable {f} @@ -134,7 +134,7 @@ variable (f) theorem RingHom.IsIntegralElem.of_mem_closure {x y z : S} (hx : f.IsIntegralElem x) (hy : f.IsIntegralElem y) (hz : z ∈ Subring.closure ({x, y} : Set S)) : f.IsIntegralElem z := by - letI : Algebra R S := f.toAlgebra + let : Algebra R S := f.toAlgebra have := (IsIntegral.fg_adjoin_singleton hx).mul (IsIntegral.fg_adjoin_singleton hy) rw [← Algebra.adjoin_union_coe_submodule, Set.singleton_union] at this exact diff --git a/Mathlib/RingTheory/IntegralClosure/Algebra/Ideal.lean b/Mathlib/RingTheory/IntegralClosure/Algebra/Ideal.lean index 554bb37bc74460..c7983e5e6eb587 100644 --- a/Mathlib/RingTheory/IntegralClosure/Algebra/Ideal.lean +++ b/Mathlib/RingTheory/IntegralClosure/Algebra/Ideal.lean @@ -75,7 +75,7 @@ lemma exists_monic_aeval_eq_zero_forall_mem_pow_of_mem_map [Algebra.IsIntegral R ∃ p : R[X], p.Monic ∧ aeval x p = 0 ∧ ∀ i, p.coeff i ∈ I ^ (p.natDegree - i) := by classical let A : Subalgebra R R[X] := Algebra.adjoin R { C r * X | r ∈ I } - letI := Polynomial.algebra R S + let := Polynomial.algebra R S refine exists_monic_aeval_eq_zero_forall_mem_pow_of_isIntegral ?_ induction hx using Submodule.span_induction with | zero => simp [isIntegral_zero] diff --git a/Mathlib/RingTheory/IntegralClosure/IntegralRestrict.lean b/Mathlib/RingTheory/IntegralClosure/IntegralRestrict.lean index a5c4644937b610..fbf6632c550b9b 100644 --- a/Mathlib/RingTheory/IntegralClosure/IntegralRestrict.lean +++ b/Mathlib/RingTheory/IntegralClosure/IntegralRestrict.lean @@ -272,15 +272,15 @@ variable {A B} lemma Algebra.algebraMap_intTrace (x : B) : algebraMap A K (Algebra.intTrace A B x) = Algebra.trace K L (algebraMap B L x) := by - haveI : IsIntegralClosure B A (FractionRing B) := + have : IsIntegralClosure B A (FractionRing B) := IsIntegralClosure.of_isIntegrallyClosed _ _ _ -- TODO: How is this even supposed to fire? `R` and `S` cannot be inferred. - haveI : Algebra.IsAlgebraic (FractionRing A) (FractionRing B) := + have : Algebra.IsAlgebraic (FractionRing A) (FractionRing B) := isAlgebraic_of_isFractionRing A B .. - haveI : IsLocalization (algebraMapSubmonoid B A⁰) (FractionRing B) := + have : IsLocalization (algebraMapSubmonoid B A⁰) (FractionRing B) := IsIntegralClosure.isLocalization _ (FractionRing A) _ _ - haveI : FiniteDimensional (FractionRing A) (FractionRing B) := .of_isLocalization A B A⁰ - haveI := IsIntegralClosure.isFractionRing_of_finite_extension A K L B + have : FiniteDimensional (FractionRing A) (FractionRing B) := .of_isLocalization A B A⁰ + have := IsIntegralClosure.isFractionRing_of_finite_extension A K L B apply (FractionRing.algEquiv A K).symm.injective rw [AlgEquiv.commutes, Algebra.intTrace, Algebra.map_intTraceAux, ← AlgEquiv.commutes (FractionRing.algEquiv B L)] @@ -292,26 +292,26 @@ lemma Algebra.algebraMap_intTrace (x : B) : lemma Algebra.algebraMap_intTrace_fractionRing (x : B) : algebraMap A (FractionRing A) (Algebra.intTrace A B x) = Algebra.trace (FractionRing A) (FractionRing B) (algebraMap B _ x) := by - haveI : IsIntegralClosure B A (FractionRing B) := + have : IsIntegralClosure B A (FractionRing B) := IsIntegralClosure.of_isIntegrallyClosed _ _ _ -- TODO: How is this even supposed to fire? `R` and `S` cannot be inferred. - haveI : Algebra.IsAlgebraic (FractionRing A) (FractionRing B) := + have : Algebra.IsAlgebraic (FractionRing A) (FractionRing B) := isAlgebraic_of_isFractionRing A B .. - haveI : IsLocalization (algebraMapSubmonoid B A⁰) (FractionRing B) := + have : IsLocalization (algebraMapSubmonoid B A⁰) (FractionRing B) := IsIntegralClosure.isLocalization _ (FractionRing A) _ _ - haveI : FiniteDimensional (FractionRing A) (FractionRing B) := .of_isLocalization A B A⁰ + have : FiniteDimensional (FractionRing A) (FractionRing B) := .of_isLocalization A B A⁰ exact Algebra.map_intTraceAux x variable (A B) lemma Algebra.intTrace_eq_trace [Module.Free A B] : Algebra.intTrace A B = Algebra.trace A B := by ext x - haveI : IsIntegralClosure B A (FractionRing B) := + have : IsIntegralClosure B A (FractionRing B) := IsIntegralClosure.of_isIntegrallyClosed _ _ _ -- TODO: How is this even supposed to fire? `R` and `S` cannot be inferred. - haveI : Algebra.IsAlgebraic (FractionRing A) (FractionRing B) := + have : Algebra.IsAlgebraic (FractionRing A) (FractionRing B) := isAlgebraic_of_isFractionRing A B .. - haveI : IsLocalization (algebraMapSubmonoid B A⁰) (FractionRing B) := + have : IsLocalization (algebraMapSubmonoid B A⁰) (FractionRing B) := IsIntegralClosure.isLocalization _ (FractionRing A) _ _ apply IsFractionRing.injective A (FractionRing A) rw [Algebra.algebraMap_intTrace_fractionRing, Algebra.trace_localization A A⁰] @@ -333,22 +333,22 @@ lemma Algebra.intTrace_eq_of_isLocalization have : IsIntegralClosure B A L := IsIntegralClosure.of_isIntegrallyClosed _ _ _ -- TODO: How is this even supposed to fire? `R` and `S` cannot be inferred. - haveI : Algebra.IsAlgebraic (FractionRing A) (FractionRing B) := + have : Algebra.IsAlgebraic (FractionRing A) (FractionRing B) := isAlgebraic_of_isFractionRing A B .. have : IsLocalization (algebraMapSubmonoid B A⁰) L := IsIntegralClosure.isLocalization _ (FractionRing A) _ _ let f : Aₘ →+* K := IsLocalization.map _ (T := A⁰) (RingHom.id A) hM - letI := f.toAlgebra + let := f.toAlgebra have : IsScalarTower A Aₘ K := IsScalarTower.of_algebraMap_eq' (by rw [RingHom.algebraMap_toAlgebra, IsLocalization.map_comp, RingHomCompTriple.comp_eq]) - letI := IsFractionRing.isFractionRing_of_isDomain_of_isLocalization M Aₘ K + let := IsFractionRing.isFractionRing_of_isDomain_of_isLocalization M Aₘ K let g : Bₘ →+* L := IsLocalization.map _ (M := algebraMapSubmonoid B M) (T := algebraMapSubmonoid B A⁰) (RingHom.id B) (Submonoid.monotone_map hM) - letI := g.toAlgebra + let := g.toAlgebra have : IsScalarTower B Bₘ L := IsScalarTower.of_algebraMap_eq' (by rw [RingHom.algebraMap_toAlgebra, IsLocalization.map_comp, RingHomCompTriple.comp_eq]) - letI := ((algebraMap K L).comp f).toAlgebra + let := ((algebraMap K L).comp f).toAlgebra have : IsScalarTower Aₘ K L := IsScalarTower.of_algebraMap_eq' rfl have : IsScalarTower Aₘ Bₘ L := by apply IsScalarTower.of_algebraMap_eq' @@ -357,7 +357,7 @@ lemma Algebra.intTrace_eq_of_isLocalization RingHom.comp_assoc, ← IsScalarTower.algebraMap_eq, IsScalarTower.algebraMap_eq A B Bₘ, IsLocalization.map_comp, RingHom.comp_id, ← RingHom.comp_assoc, IsLocalization.map_comp, RingHom.comp_id, ← IsScalarTower.algebraMap_eq, ← IsScalarTower.algebraMap_eq] - letI := IsFractionRing.isFractionRing_of_isDomain_of_isLocalization + let := IsFractionRing.isFractionRing_of_isDomain_of_isLocalization (algebraMapSubmonoid B M) Bₘ L have : FiniteDimensional K L := .of_isLocalization A B A⁰ have : IsIntegralClosure Bₘ Aₘ L := @@ -404,7 +404,7 @@ variable {A B} lemma Algebra.algebraMap_intNorm (x : B) : algebraMap A K (Algebra.intNorm A B x) = Algebra.norm K (algebraMap B L x) := by - haveI := IsIntegralClosure.isFractionRing_of_finite_extension A K L B + have := IsIntegralClosure.isFractionRing_of_finite_extension A K L B apply (FractionRing.algEquiv A K).symm.injective rw [AlgEquiv.commutes, Algebra.intNorm, Algebra.map_intNormAux, ← AlgEquiv.commutes (FractionRing.algEquiv B L)] @@ -432,7 +432,7 @@ theorem Algebra.intNorm_intNorm {C : Type*} [CommRing C] [IsDomain C] [IsIntegra lemma Algebra.intNorm_eq_norm [Module.Free A B] [Module.Finite A B] : Algebra.intNorm A B = Algebra.norm A := by ext x - haveI : IsIntegralClosure B A (FractionRing B) := + have : IsIntegralClosure B A (FractionRing B) := IsIntegralClosure.of_isIntegrallyClosed _ _ _ apply IsFractionRing.injective A (FractionRing A) rw [Algebra.algebraMap_intNorm_fractionRing, Algebra.norm_localization A A⁰] @@ -440,7 +440,7 @@ lemma Algebra.intNorm_eq_norm [Module.Free A B] [Module.Finite A B] : @[simp] lemma Algebra.intNorm_zero [FiniteDimensional (FractionRing A) (FractionRing B)] : Algebra.intNorm A B 0 = 0 := by - haveI : IsIntegralClosure B A (FractionRing B) := + have : IsIntegralClosure B A (FractionRing B) := IsIntegralClosure.of_isIntegrallyClosed _ _ _ apply IsFractionRing.injective A (FractionRing A) simp @@ -482,17 +482,17 @@ lemma Algebra.intNorm_eq_of_isLocalization [FiniteDimensional (FractionRing A) ( let K := FractionRing A let L := FractionRing B let f : Aₘ →+* K := IsLocalization.map _ (T := A⁰) (RingHom.id A) hM - letI := f.toAlgebra + let := f.toAlgebra have : IsScalarTower A Aₘ K := IsScalarTower.of_algebraMap_eq' (by rw [RingHom.algebraMap_toAlgebra, IsLocalization.map_comp, RingHomCompTriple.comp_eq]) - letI := IsFractionRing.isFractionRing_of_isDomain_of_isLocalization M Aₘ K + let := IsFractionRing.isFractionRing_of_isDomain_of_isLocalization M Aₘ K let g : Bₘ →+* L := IsLocalization.map _ (M := algebraMapSubmonoid B M) (T := algebraMapSubmonoid B A⁰) (RingHom.id B) (Submonoid.monotone_map hM) - letI := g.toAlgebra + let := g.toAlgebra have : IsScalarTower B Bₘ L := IsScalarTower.of_algebraMap_eq' (by rw [RingHom.algebraMap_toAlgebra, IsLocalization.map_comp, RingHomCompTriple.comp_eq]) - letI := ((algebraMap K L).comp f).toAlgebra + let := ((algebraMap K L).comp f).toAlgebra have : IsScalarTower Aₘ K L := IsScalarTower.of_algebraMap_eq' rfl have : IsScalarTower Aₘ Bₘ L := by apply IsScalarTower.of_algebraMap_eq' @@ -501,7 +501,7 @@ lemma Algebra.intNorm_eq_of_isLocalization [FiniteDimensional (FractionRing A) ( RingHom.comp_assoc, ← IsScalarTower.algebraMap_eq, IsScalarTower.algebraMap_eq A B Bₘ, IsLocalization.map_comp, RingHom.comp_id, ← RingHom.comp_assoc, IsLocalization.map_comp, RingHom.comp_id, ← IsScalarTower.algebraMap_eq, ← IsScalarTower.algebraMap_eq] - letI := IsFractionRing.isFractionRing_of_isDomain_of_isLocalization + let := IsFractionRing.isFractionRing_of_isDomain_of_isLocalization (algebraMapSubmonoid B M) Bₘ L have : IsIntegralClosure Bₘ Aₘ L := IsIntegralClosure.of_isIntegrallyClosed _ _ _ @@ -516,7 +516,7 @@ variable [IsDomain A] [IsIntegrallyClosed A] [IsDomain B] [IsIntegrallyClosed B] lemma Algebra.algebraMap_intNorm_of_isGalois [IsGalois (FractionRing A) (FractionRing B)] {x : B} : algebraMap A B (Algebra.intNorm A B x) = ∏ σ : B ≃ₐ[A] B, σ x := by - haveI : FiniteDimensional (FractionRing A) (FractionRing B) := .of_isLocalization A B A⁰ + have : FiniteDimensional (FractionRing A) (FractionRing B) := .of_isLocalization A B A⁰ rw [← (galRestrict A (FractionRing A) (FractionRing B) B).toEquiv.prod_comp] simp only [MulEquiv.toEquiv_eq_coe, EquivLike.coe_coe] convert! (prod_galRestrict_eq_norm A (FractionRing A) (FractionRing B) B x).symm @@ -524,7 +524,7 @@ lemma Algebra.algebraMap_intNorm_of_isGalois [IsGalois (FractionRing A) (Fractio open Polynomial IsScalarTower in theorem Algebra.dvd_algebraMap_intNorm_self (x : B) : x ∣ algebraMap A B (intNorm A B x) := by classical - haveI : FiniteDimensional (FractionRing A) (FractionRing B) := .of_isLocalization A B A⁰ + have : FiniteDimensional (FractionRing A) (FractionRing B) := .of_isLocalization A B A⁰ by_cases hx : x = 0 · exact ⟨1, by simp [hx]⟩ let K := FractionRing A diff --git a/Mathlib/RingTheory/IntegralClosure/IntegrallyClosed.lean b/Mathlib/RingTheory/IntegralClosure/IntegrallyClosed.lean index 1d3a91951ec546..1175bf4626029c 100644 --- a/Mathlib/RingTheory/IntegralClosure/IntegrallyClosed.lean +++ b/Mathlib/RingTheory/IntegralClosure/IntegrallyClosed.lean @@ -379,7 +379,7 @@ lemma isIntegrallyClosed_of_isLocalization [IsIntegrallyClosed R] [IsDomain R] ( (hM : M ≤ R⁰) [IsLocalization M S] : IsIntegrallyClosed S := by let K := FractionRing R let g : S →+* K := IsLocalization.map _ (T := R⁰) (RingHom.id R) hM - letI := g.toAlgebra + let := g.toAlgebra have : IsScalarTower R S K := IsScalarTower.of_algebraMap_eq' (by rw [RingHom.algebraMap_toAlgebra, IsLocalization.map_comp, RingHomCompTriple.comp_eq]) have := IsFractionRing.isFractionRing_of_isDomain_of_isLocalization M S K diff --git a/Mathlib/RingTheory/IntegralClosure/IsIntegral/Basic.lean b/Mathlib/RingTheory/IntegralClosure/IsIntegral/Basic.lean index 19edd42a3f3ac5..ebfa202d4bf401 100644 --- a/Mathlib/RingTheory/IntegralClosure/IsIntegral/Basic.lean +++ b/Mathlib/RingTheory/IntegralClosure/IsIntegral/Basic.lean @@ -170,15 +170,15 @@ theorem RingEquiv.isIntegral_iff {R S T : Type*} [CommRing R] [Ring S] [CommRing (h : (algebraMap T S).comp φ.toRingHom = algebraMap R S) (a : S) : IsIntegral R a ↔ IsIntegral T a := by constructor <;> intro ha - · letI : Algebra R T := φ.toRingHom.toAlgebra - letI : IsScalarTower R T S := + · let : Algebra R T := φ.toRingHom.toAlgebra + let : IsScalarTower R T S := ⟨fun r t s ↦ by simp only [Algebra.smul_def, map_mul, ← h, mul_assoc]; rfl⟩ exact IsIntegral.tower_top ha · have h' : (algebraMap T S) = (algebraMap R S).comp φ.symm.toRingHom := by have : RingHomInvPair (φ : R →+* T) φ.symm := RingHomInvPair.of_ringEquiv _ simp only [← h, RingHom.comp_assoc, RingEquiv.toRingHom_eq_coe, RingHomCompTriple.comp_eq] - letI : Algebra T R := φ.symm.toRingHom.toAlgebra - letI : IsScalarTower T R S := + let : Algebra T R := φ.symm.toRingHom.toAlgebra + let : IsScalarTower T R S := ⟨fun r t s ↦ by simp only [Algebra.smul_def, map_mul, h', mul_assoc]; rfl⟩ exact IsIntegral.tower_top ha diff --git a/Mathlib/RingTheory/IntegralClosure/IsIntegralClosure/Basic.lean b/Mathlib/RingTheory/IntegralClosure/IsIntegralClosure/Basic.lean index 865dc6869a9008..4321faad608df6 100644 --- a/Mathlib/RingTheory/IntegralClosure/IsIntegralClosure/Basic.lean +++ b/Mathlib/RingTheory/IntegralClosure/IsIntegralClosure/Basic.lean @@ -46,7 +46,7 @@ theorem isField_of_isIntegral_of_isField' [CommRing R] [CommRing S] [IsDomain S] exists_pair_ne := ⟨0, 1, zero_ne_one⟩ mul_comm := mul_comm mul_inv_cancel {x} hx := by - letI := hR.toField + let := hR.toField obtain ⟨y, rfl⟩ := (Algebra.IsIntegral.isIntegral (R := R) x).isUnit hx exact ⟨y.inv, y.val_inv⟩ @@ -492,7 +492,7 @@ theorem isIntegral_trans [Algebra.IsIntegral R A] (x : B) (hx : IsIntegral A x) refine .of_mem_of_fg ((S[x]).restrictScalars R) ?_ _ ((Subalgebra.mem_restrictScalars R).mpr <| subset_adjoin rfl) rw [← Module.Finite.iff_fg] - letI : SMul S Sx := { MSx with } -- need this even though MSx is there + let : SMul S Sx := { MSx with } -- need this even though MSx is there have : IsScalarTower R S Sx := Submodule.isScalarTower Sx -- Lean looks for `Module A Sx` without this exact Module.Finite.trans S Sx diff --git a/Mathlib/RingTheory/IntegralDomain.lean b/Mathlib/RingTheory/IntegralDomain.lean index 952c02b282160e..4e328a55a6da5d 100644 --- a/Mathlib/RingTheory/IntegralDomain.lean +++ b/Mathlib/RingTheory/IntegralDomain.lean @@ -120,7 +120,7 @@ variable [CommRing R] [IsDomain R] [Group G] theorem card_nthRoots_subgroup_units [Fintype G] [DecidableEq G] (f : G →* R) (hf : Injective f) {n : ℕ} (hn : 0 < n) (g₀ : G) : #{g | g ^ n = g₀} ≤ Multiset.card (nthRoots n (f g₀)) := by - haveI : DecidableEq R := Classical.decEq _ + have : DecidableEq R := Classical.decEq _ calc _ ≤ #(nthRoots n (f g₀)).toFinset := card_le_card_of_injOn f (by aesop (add safe unfold Set.MapsTo)) hf.injOn diff --git a/Mathlib/RingTheory/Invariant/Basic.lean b/Mathlib/RingTheory/Invariant/Basic.lean index e06ded1554491a..0021fbed57dec6 100644 --- a/Mathlib/RingTheory/Invariant/Basic.lean +++ b/Mathlib/RingTheory/Invariant/Basic.lean @@ -425,9 +425,9 @@ lemma Ideal.Quotient.exists_algHom_fixedPoint_quotient_under cases nonempty_fintype G algebraize [(algebraMap (A ⧸ P) k).comp (algebraMap A (A ⧸ P)), (algebraMap (B ⧸ Q) k).comp (algebraMap B (B ⧸ Q))] - haveI : IsScalarTower A (B ⧸ Q) k := .of_algebraMap_eq fun x ↦ + have : IsScalarTower A (B ⧸ Q) k := .of_algebraMap_eq fun x ↦ (IsScalarTower.algebraMap_apply (A ⧸ P) (B ⧸ Q) k (mk P x)) - haveI : IsScalarTower A B k := .of_algebraMap_eq fun x ↦ + have : IsScalarTower A B k := .of_algebraMap_eq fun x ↦ (IsScalarTower.algebraMap_apply (A ⧸ P) (B ⧸ Q) k (mk P x)) obtain ⟨P, hp⟩ := Algebra.IsInvariant.charpoly_mem_lifts A B G x have : Polynomial.aeval x P = 0 := by diff --git a/Mathlib/RingTheory/Invariant/Galois.lean b/Mathlib/RingTheory/Invariant/Galois.lean index c86f93056fb6d5..d72831064475ce 100644 --- a/Mathlib/RingTheory/Invariant/Galois.lean +++ b/Mathlib/RingTheory/Invariant/Galois.lean @@ -46,7 +46,7 @@ theorem Algebra.isInvariant_of_isGalois [FiniteDimensional K L] [h : IsGalois K letI := IsIntegralClosure.MulSemiringAction A K L B Algebra.IsInvariant A B Gal(L/K) := by replace h := ((IsGalois.tfae (F := K) (E := L)).out 0 1).mp h - letI := IsIntegralClosure.MulSemiringAction A K L B + let := IsIntegralClosure.MulSemiringAction A K L B refine ⟨fun b hb ↦ ?_⟩ replace hb : algebraMap B L b ∈ IntermediateField.fixedField (⊤ : Subgroup Gal(L/K)) := by rintro ⟨g, -⟩ diff --git a/Mathlib/RingTheory/IsTensorProduct.lean b/Mathlib/RingTheory/IsTensorProduct.lean index bd60b3fdb3bbeb..a01b7253707b93 100644 --- a/Mathlib/RingTheory/IsTensorProduct.lean +++ b/Mathlib/RingTheory/IsTensorProduct.lean @@ -540,8 +540,8 @@ theorem IsBaseChange.comp {f : M →ₗ[R] N} (hf : IsBaseChange S f) {g : N → (hg : IsBaseChange T g) : IsBaseChange T ((g.restrictScalars R).comp f) := by apply IsBaseChange.of_lift_unique intro Q _ _ _ _ i - letI := Module.compHom Q (algebraMap S T) - haveI : IsScalarTower S T Q := + let := Module.compHom Q (algebraMap S T) + have : IsScalarTower S T Q := ⟨fun x y z => by rw [Algebra.smul_def, mul_smul] rfl⟩ @@ -563,9 +563,9 @@ lemma IsBaseChange.of_comp {f : M →ₗ[R] N} (hf : IsBaseChange S f) {h : N IsBaseChange T h := by apply IsBaseChange.of_lift_unique intro Q _ _ _ _ r - letI : Module R Q := .restrictScalars R S Q - haveI : IsScalarTower R S Q := .restrictScalars R S Q - haveI : IsScalarTower R T Q := IsScalarTower.of_algebraMap_smul fun r x ↦ by + let : Module R Q := .restrictScalars R S Q + have : IsScalarTower R S Q := .restrictScalars R S Q + have : IsScalarTower R T Q := IsScalarTower.of_algebraMap_smul fun r x ↦ by simp [IsScalarTower.algebraMap_apply R S T] let r' : M →ₗ[R] Q := r ∘ₗ f let q : O →ₗ[T] Q := hc.lift r' @@ -760,7 +760,7 @@ lemma Algebra.IsPushout.comp_iff {T' : Type*} [CommSemiring T'] [Algebra R T'] [Algebra.IsPushout R S R' S'] : Algebra.IsPushout R T R' T' ↔ Algebra.IsPushout S T S' T' := by let f : R' →ₗ[R] S' := (IsScalarTower.toAlgHom R R' S').toLinearMap - haveI : IsScalarTower R S T' := .of_algebraMap_eq fun x ↦ by + have : IsScalarTower R S T' := .of_algebraMap_eq fun x ↦ by rw [algebraMap_apply R S' T', algebraMap_apply R S S', ← algebraMap_apply S S' T'] have heq : (toAlgHom S S' T').toLinearMap.restrictScalars R ∘ₗ f = (toAlgHom R R' T').toLinearMap := by diff --git a/Mathlib/RingTheory/Jacobson/Ideal.lean b/Mathlib/RingTheory/Jacobson/Ideal.lean index 0004ab71fe433a..dcda2cf703aa6d 100644 --- a/Mathlib/RingTheory/Jacobson/Ideal.lean +++ b/Mathlib/RingTheory/Jacobson/Ideal.lean @@ -185,7 +185,7 @@ theorem map_jacobson_of_surjective {f : R →+* S} (hf : Function.Surjective f) · refine sInf_le_sInf fun J hJ => ⟨comap f J, ⟨⟨le_comap_of_map_le hJ.1, ?_⟩, map_comap_of_surjective f hf J⟩⟩ - haveI : J.IsMaximal := hJ.right + have : J.IsMaximal := hJ.right exact comap_isMaximal_of_surjective f hf · refine sInf_le_sInf_of_subset_insert_top fun j hj => hj.recOn fun J hJ => ?_ rw [← hJ.2] @@ -218,7 +218,7 @@ theorem comap_jacobson_of_surjective {f : R →+* S} (hf : Function.Surjective f this⟩ · simp_rw [comap_sInf, le_iInf_iff] intro J hJ - haveI : J.IsMaximal := hJ.right + have : J.IsMaximal := hJ.right exact sInf_le ⟨comap_mono hJ.left, comap_isMaximal_of_surjective _ hf⟩ @[gcongr, mono] diff --git a/Mathlib/RingTheory/Jacobson/Polynomial.lean b/Mathlib/RingTheory/Jacobson/Polynomial.lean index 316e2f8f031888..f41906e35fedef 100644 --- a/Mathlib/RingTheory/Jacobson/Polynomial.lean +++ b/Mathlib/RingTheory/Jacobson/Polynomial.lean @@ -25,7 +25,7 @@ variable {R : Type*} [CommRing R] theorem jacobson_bot_polynomial_le_sInf_map_maximal : jacobson (⊥ : Ideal R[X]) ≤ sInf (map (C : R →+* R[X]) '' { J : Ideal R | J.IsMaximal }) := by refine le_sInf fun J => exists_imp.2 fun j hj => ?_ - haveI : j.IsMaximal := hj.1 + have : j.IsMaximal := hj.1 refine Trans.trans (jacobson_mono bot_le) (le_of_eq ?_ : J.jacobson ≤ J) suffices t : (⊥ : Ideal (Polynomial (R ⧸ j))).jacobson = ⊥ by rw [← hj.2, jacobson_eq_iff_jacobson_quotient_eq_bot] diff --git a/Mathlib/RingTheory/Jacobson/Ring.lean b/Mathlib/RingTheory/Jacobson/Ring.lean index 19f44282274054..7ac3933093829f 100644 --- a/Mathlib/RingTheory/Jacobson/Ring.lean +++ b/Mathlib/RingTheory/Jacobson/Ring.lean @@ -329,7 +329,7 @@ theorem jacobson_bot_of_integral_localization (⊥ : Ideal S).jacobson = (⊥ : Ideal S) := by have hM : ((Submonoid.powers x).map φ : Submonoid S) ≤ nonZeroDivisors S := map_le_nonZeroDivisors_of_injective φ hφ (powers_le_nonZeroDivisors_of_noZeroDivisors hx) - letI : IsDomain Sₘ := IsLocalization.isDomain_of_le_nonZeroDivisors _ hM + let : IsDomain Sₘ := IsLocalization.isDomain_of_le_nonZeroDivisors _ hM let φ' : Rₘ →+* Sₘ := IsLocalization.map _ φ (Submonoid.powers x).le_comap_map suffices ∀ I : Ideal Sₘ, I.IsMaximal → (I.comap (algebraMap S Sₘ)).IsMaximal by have hϕ' : comap (algebraMap S Sₘ) (⊥ : Ideal Sₘ) = (⊥ : Ideal S) := by @@ -703,7 +703,7 @@ theorem finite_of_algHom_finiteType_of_isJacobsonRing [Algebra.FiniteType K A] (f : L →ₐ[K] A) : Module.Finite K L := by obtain ⟨m, hm⟩ := Ideal.exists_maximal A - letI := Ideal.Quotient.field m + let := Ideal.Quotient.field m have := finite_of_finite_type_of_isJacobsonRing K (A ⧸ m) exact Module.Finite.of_injective ((Ideal.Quotient.mkₐ K m).comp f).toLinearMap (RingHom.injective _) diff --git a/Mathlib/RingTheory/Kaehler/Basic.lean b/Mathlib/RingTheory/Kaehler/Basic.lean index c1c64b7ac4ba81..7ea020e7aa01b1 100644 --- a/Mathlib/RingTheory/Kaehler/Basic.lean +++ b/Mathlib/RingTheory/Kaehler/Basic.lean @@ -504,7 +504,7 @@ theorem KaehlerDifferential.kerTotal_mkQ_single_algebraMap_one (x) : (x𝖣1) = rw [← (algebraMap R S).map_one, KaehlerDifferential.kerTotal_mkQ_single_algebraMap] theorem KaehlerDifferential.kerTotal_mkQ_single_smul (r : R) (x y) : (y𝖣r • x) = r • y𝖣x := by - letI : SMulZeroClass R S := inferInstance + let : SMulZeroClass R S := inferInstance rw [Algebra.smul_def, KaehlerDifferential.kerTotal_mkQ_single_mul, KaehlerDifferential.kerTotal_mkQ_single_algebraMap, add_zero, ← LinearMap.map_smul_of_tower, Finsupp.smul_single, mul_comm, Algebra.smul_def] diff --git a/Mathlib/RingTheory/Kaehler/JacobiZariski.lean b/Mathlib/RingTheory/Kaehler/JacobiZariski.lean index b0793212737291..58f83e3c6511f7 100644 --- a/Mathlib/RingTheory/Kaehler/JacobiZariski.lean +++ b/Mathlib/RingTheory/Kaehler/JacobiZariski.lean @@ -267,7 +267,7 @@ variable {Q} {Q'} in lemma δAux_toAlgHom (f : Hom Q Q') (x) : δAux R Q' (f.toAlgHom x) = δAux R Q x + Finsupp.linearCombination _ (δAux R Q' ∘ f.val) (Q.cotangentSpaceBasis.repr ((1 : T) ⊗ₜ[Q.Ring] D S Q.Ring x :)) := by - letI : AddCommGroup (T ⊗[S] Ω[S⁄R]) := inferInstance + let : AddCommGroup (T ⊗[S] Ω[S⁄R]) := inferInstance have : IsScalarTower Q.Ring Q.Ring T := IsScalarTower.left _ induction x using MvPolynomial.induction_on with | C s => simp [MvPolynomial.algebraMap_eq, δAux_C] @@ -289,7 +289,7 @@ lemma δAux_ofComp (x : (Q.comp P).Ring) : δAux R Q ((Q.ofComp P).toAlgHom x) = P.toExtension.toKaehler.baseChange T (CotangentSpace.compEquiv Q P (1 ⊗ₜ[(Q.comp P).Ring] (D R (Q.comp P).Ring) x : _)).2 := by - letI : AddCommGroup (T ⊗[S] Ω[S⁄R]) := inferInstance + let : AddCommGroup (T ⊗[S] Ω[S⁄R]) := inferInstance have : IsScalarTower (Q.comp P).Ring (Q.comp P).Ring T := IsScalarTower.left _ induction x using MvPolynomial.induction_on with | C s => @@ -437,7 +437,7 @@ lemma exact_map_δ : set_option backward.isDefEq.respectTransparency false in lemma δ_map (f : Hom Q' Q) (x) : δ Q P (Extension.H1Cotangent.map f.toExtensionHom x) = δ Q' P' x := by - letI : AddCommGroup (T ⊗[S] Ω[S⁄R]) := inferInstance + let : AddCommGroup (T ⊗[S] Ω[S⁄R]) := inferInstance obtain ⟨x, hx⟩ := x obtain ⟨⟨y, hy⟩, rfl⟩ := Extension.Cotangent.mk_surjective x change δ _ _ ⟨_, _⟩ = δ _ _ _ diff --git a/Mathlib/RingTheory/KrullDimension/Basic.lean b/Mathlib/RingTheory/KrullDimension/Basic.lean index f0903f03690d4c..b6cb632903383f 100644 --- a/Mathlib/RingTheory/KrullDimension/Basic.lean +++ b/Mathlib/RingTheory/KrullDimension/Basic.lean @@ -164,7 +164,7 @@ lemma Ring.KrullDimLE.mk₁ (H : ∀ I : Ideal R, I.IsPrime → I ∈ minimalPri lemma Ring.krullDimLE_one_iff_of_isPrime_bot [(⊥ : Ideal R).IsPrime] : Ring.KrullDimLE 1 R ↔ ∀ I : Ideal R, I ≠ ⊥ → I.IsPrime → I.IsMaximal := by - letI : OrderBot (PrimeSpectrum R) := { bot := ⟨⊥, ‹_›⟩, bot_le I := bot_le (a := I.1) } + let : OrderBot (PrimeSpectrum R) := { bot := ⟨⊥, ‹_›⟩, bot_le I := bot_le (a := I.1) } simp_rw [Ring.KrullDimLE, Order.krullDimLE_iff, Nat.cast_one, Order.krullDim_le_one_iff_forall_isMax, (PrimeSpectrum.equivSubtype R).forall_congr_left, Subtype.forall, PrimeSpectrum.isMax_iff, forall_comm (α := _ ≠ ⊥), diff --git a/Mathlib/RingTheory/LaurentSeries.lean b/Mathlib/RingTheory/LaurentSeries.lean index 2de61dbc423458..592d8e47617017 100644 --- a/Mathlib/RingTheory/LaurentSeries.lean +++ b/Mathlib/RingTheory/LaurentSeries.lean @@ -1103,7 +1103,7 @@ theorem valuation_compare (f : K⸨X⸩) : (Valued.v : (RatFuncAdicCompl K) → ℤᵐ⁰) (AbstractCompletion.compare (LaurentSeriesPkg K) ratfuncAdicComplPkg f) = Valued.v f := by - letI : UniformSpace (ratfuncAdicComplPkg (K := K).space) := + let : UniformSpace (ratfuncAdicComplPkg (K := K).space) := ratfuncAdicComplPkg.uniformStruct rw [← valuation_LaurentSeries_equal_extension, ← compare_comp_eq_compare ratfuncAdicComplPkg _] · exact congr_fun (ratfuncAdicComplPkg.isDenseInducing.extend_unique diff --git a/Mathlib/RingTheory/LinearDisjoint.lean b/Mathlib/RingTheory/LinearDisjoint.lean index fe0d53ff6a84e6..74ebfb88e9564f 100644 --- a/Mathlib/RingTheory/LinearDisjoint.lean +++ b/Mathlib/RingTheory/LinearDisjoint.lean @@ -593,9 +593,9 @@ theorem exists_field_of_isDomain_of_injective (A : Type v) [CommRing A] (B : Typ theorem of_isField (H : IsField (A ⊗[R] B)) : A.LinearDisjoint B := by nontriviality S rw [linearDisjoint_iff_injective] - letI : Field (A ⊗[R] B) := H.toField + let : Field (A ⊗[R] B) := H.toField -- need this otherwise `RingHom.injective` does not work - letI : NonAssocRing (A ⊗[R] B) := Ring.toNonAssocRing + let : NonAssocRing (A ⊗[R] B) := Ring.toNonAssocRing exact RingHom.injective _ /-- If `A ⊗[R] B` is a field, then for any `R`-algebra `S` @@ -617,7 +617,7 @@ theorem _root_.Algebra.TensorProduct.not_isField_of_transcendental (A : Type v) [CommRing A] (B : Type w) [CommRing B] [Algebra R A] [Algebra R B] [Module.Flat R A] [Module.Flat R B] [Algebra.Transcendental R A] [Algebra.Transcendental R B] : ¬IsField (A ⊗[R] B) := fun H ↦ by - letI := H.toField + let := H.toField obtain ⟨a, hta⟩ := ‹Algebra.Transcendental R A› obtain ⟨b, htb⟩ := ‹Algebra.Transcendental R B› have ha : Function.Injective (algebraMap R A) := Algebra.injective_of_transcendental @@ -626,10 +626,10 @@ theorem _root_.Algebra.TensorProduct.not_isField_of_transcendental let fb : B →ₐ[R] A ⊗[R] B := Algebra.TensorProduct.includeRight have hfa : Function.Injective fa := Algebra.TensorProduct.includeLeft_injective hb have hfb : Function.Injective fb := Algebra.TensorProduct.includeRight_injective ha - haveI := hfa.isDomain fa.toRingHom - haveI := hfb.isDomain fb.toRingHom - haveI := ha.isDomain _ - haveI : Module.Flat R (toSubmodule fa.range) := + have := hfa.isDomain fa.toRingHom + have := hfb.isDomain fb.toRingHom + have := ha.isDomain _ + have : Module.Flat R (toSubmodule fa.range) := .of_linearEquiv (AlgEquiv.ofInjective fa hfa).symm.toLinearEquiv have key1 : Module.rank R ↥(fa.range ⊓ fb.range) ≤ 1 := (include_range R A B).rank_inf_le_one_of_flat_left @@ -641,7 +641,7 @@ theorem _root_.Algebra.TensorProduct.not_isField_of_transcendental have htab : Function.Injective gab := hfa.comp hta algebraize_only [ga.toRingHom, gb.toRingHom] let f := Algebra.TensorProduct.mapOfCompatibleSMul R[X] R R A B - haveI := Algebra.TensorProduct.nontrivial_of_algebraMap_injective_of_isDomain R[X] A B hta htb + have := Algebra.TensorProduct.nontrivial_of_algebraMap_injective_of_isDomain R[X] A B hta htb have hf : Function.Injective f := RingHom.injective _ have key2 : gab.range ≤ fa.range ⊓ fb.range := by simp_rw [gab, ga, ← aeval_algHom] @@ -723,7 +723,7 @@ theorem of_finrank_sup_of_free [Module.Free R A] [Module.Free R B] (LinearEquiv.ofFinrankEq (A ⊗[R] B) _ (by simp)).toLinearMap replace hj : Function.Injective j' := by simpa [j'] have hf : Function.Surjective (mulMap' A B).toLinearMap := mulMap'_surjective A B - haveI := Subalgebra.finite_sup A B + have := Subalgebra.finite_sup A B rw [linearDisjoint_iff, Submodule.linearDisjoint_iff] exact Subtype.val_injective.comp (OrzechProperty.injective_of_surjective_of_injective j' _ hj hf) @@ -761,9 +761,9 @@ theorem of_finrank_coprime_of_free [Module.Free R A] [Module.Free R B] · rw [h2, Nat.coprime_zero_right] at H rw [eq_bot_of_finrank_one H] exact bot_left _ - haveI := Module.finite_of_finrank_pos (Nat.pos_of_ne_zero h1) - haveI := Module.finite_of_finrank_pos (Nat.pos_of_ne_zero h2) - haveI := finite_sup A B + have := Module.finite_of_finrank_pos (Nat.pos_of_ne_zero h1) + have := Module.finite_of_finrank_pos (Nat.pos_of_ne_zero h2) + have := finite_sup A B have : Module.finrank R A ≤ Module.finrank R ↥(A ⊔ B) := LinearMap.finrank_le_finrank_of_injective <| Submodule.inclusion_injective (show toSubmodule A ≤ toSubmodule (A ⊔ B) by simp) diff --git a/Mathlib/RingTheory/LittleWedderburn.lean b/Mathlib/RingTheory/LittleWedderburn.lean index 20425e0914f877..86782b487874f1 100644 --- a/Mathlib/RingTheory/LittleWedderburn.lean +++ b/Mathlib/RingTheory/LittleWedderburn.lean @@ -69,7 +69,7 @@ private theorem center_eq_top [Finite D] (hD : InductionHyp D) : Subring.center set Z := Subring.center D -- We proceed by contradiction; that is, we assume the center is strictly smaller than `D`. by_contra! hZ - letI : Field Z := hD.field hZ.lt_top + let : Field Z := hD.field hZ.lt_top set q := card Z with card_Z have hq : 1 < q := by rw [card_Z]; exact one_lt_card let n := finrank Z D @@ -118,12 +118,12 @@ private theorem center_eq_top [Finite D] (hD : InductionHyp D) : Subring.center by_contra! hZx refine (ConjClasses.mk_bijOn (Dˣ)).mapsTo (Set.subset_center_units ?_) hx exact Subring.centralizer_eq_top_iff_subset.mp hZx <| Set.mem_singleton _ - letI : Field Zx := hD.field hZx.lt_top - letI : Algebra Z Zx := (Subring.inclusion <| Subring.center_le_centralizer {(x : D)}).toAlgebra + let : Field Zx := hD.field hZx.lt_top + let : Algebra Z Zx := (Subring.inclusion <| Subring.center_le_centralizer {(x : D)}).toAlgebra let d := finrank Z Zx have card_Zx : card Zx = q ^ d := Module.card_eq_pow_finrank have h1qd : 1 ≤ q ^ d := by rw [← card_Zx]; exact card_pos - haveI : IsScalarTower Z Zx D := ⟨fun x y z ↦ mul_assoc _ _ _⟩ + have : IsScalarTower Z Zx D := ⟨fun x y z ↦ mul_assoc _ _ _⟩ rw [card_units, card_Zx] push_cast [h1qd, h1qn] apply Int.dvd_div_of_mul_dvd diff --git a/Mathlib/RingTheory/LocalProperties/Basic.lean b/Mathlib/RingTheory/LocalProperties/Basic.lean index 93684cdd70eae3..0ad855e9bca672 100644 --- a/Mathlib/RingTheory/LocalProperties/Basic.lean +++ b/Mathlib/RingTheory/LocalProperties/Basic.lean @@ -258,7 +258,7 @@ lemma RingHom.HoldsForLocalization.isLocalizationMap {f : R →+* S} (hy : M ≤ Submonoid.comap f T) (hf : P f) : P (IsLocalization.map (S := R') S' f hy) := by have hle : Submonoid.map f M ≤ T := by simpa [Submonoid.map_le_iff_le_comap] - letI : Algebra (Localization (M.map f)) S' := + let : Algebra (Localization (M.map f)) S' := IsLocalization.localizationAlgebraOfSubmonoidLe _ _ (M.map f) T hle have : IsScalarTower S (Localization (Submonoid.map f M)) S' := IsLocalization.localization_isScalarTower_of_submonoid_le _ _ _ _ _ @@ -286,7 +286,7 @@ end HoldsForLocalization theorem RingHom.HoldsForLocalizationAway.of_bijective (H : RingHom.HoldsForLocalizationAway P) (hf : Function.Bijective f) : P f := by - letI := f.toAlgebra + let := f.toAlgebra have := IsLocalization.of_le_isUnit (S := .powers (1 : R)) (by simp) have := IsLocalization.isLocalization_of_algEquiv (.powers (1 : R)) (AlgEquiv.ofBijective (Algebra.ofId R S) hf) @@ -312,7 +312,7 @@ lemma RingHom.LocalizationAwayPreserves.respectsIso (hP : LocalizationAwayPreserves P) : RespectsIso P where left {R S T} _ _ _ f e hf := by - letI := e.toRingHom.toAlgebra + let := e.toRingHom.toAlgebra have : IsLocalization.Away (1 : R) R := IsLocalization.away_of_isUnit_of_bijective _ isUnit_one (Equiv.refl _).bijective have : IsLocalization.Away (f 1) T := @@ -322,7 +322,7 @@ lemma RingHom.LocalizationAwayPreserves.respectsIso · rw [IsLocalization.Away.map, IsLocalization.map_comp]; rfl · rfl right {R S T} _ _ _ f e hf := by - letI := e.symm.toRingHom.toAlgebra + let := e.symm.toRingHom.toAlgebra have : IsLocalization.Away (1 : S) R := IsLocalization.away_of_isUnit_of_bijective _ isUnit_one e.symm.bijective have : IsLocalization.Away (f 1) T := @@ -338,12 +338,12 @@ lemma RingHom.StableUnderCompositionWithLocalizationAway.respectsIso (hP : StableUnderCompositionWithLocalizationAway P) : RespectsIso P where left {R S T} _ _ _ f e hf := by - letI := e.toRingHom.toAlgebra + let := e.toRingHom.toAlgebra have : IsLocalization.Away (1 : S) T := IsLocalization.away_of_isUnit_of_bijective _ isUnit_one e.bijective exact hP.right T (1 : S) f hf right {R S T} _ _ _ f e hf := by - letI := e.toRingHom.toAlgebra + let := e.toRingHom.toAlgebra have : IsLocalization.Away (1 : R) S := IsLocalization.away_of_isUnit_of_bijective _ isUnit_one e.bijective exact hP.left S (1 : R) f hf @@ -500,9 +500,9 @@ lemma RingHom.IsStableUnderBaseChange.isLocalization_map (M : Submonoid R) [IsLo P (IsLocalization.map Sᵣ f M.le_comap_map : Rᵣ →+* Sᵣ) := by algebraize [f, IsLocalization.map (S := Rᵣ) Sᵣ f M.le_comap_map, (IsLocalization.map (S := Rᵣ) Sᵣ f M.le_comap_map).comp (algebraMap R Rᵣ)] - haveI : IsScalarTower R S Sᵣ := IsScalarTower.of_algebraMap_eq' + have : IsScalarTower R S Sᵣ := IsScalarTower.of_algebraMap_eq' (IsLocalization.map_comp M.le_comap_map) - haveI : IsLocalization (Algebra.algebraMapSubmonoid S M) Sᵣ := + have : IsLocalization (Algebra.algebraMapSubmonoid S M) Sᵣ := inferInstanceAs <| IsLocalization (M.map f) Sᵣ apply hP.of_isLocalization M hf diff --git a/Mathlib/RingTheory/LocalProperties/Exactness.lean b/Mathlib/RingTheory/LocalProperties/Exactness.lean index 0458f36bcea7eb..cd1c1b94c7b3b1 100644 --- a/Mathlib/RingTheory/LocalProperties/Exactness.lean +++ b/Mathlib/RingTheory/LocalProperties/Exactness.lean @@ -299,10 +299,10 @@ lemma injective_of_isLocalization_of_span_eq_top (h : ∀ r : s, Function.Injective (IsLocalization.Away.map (Rᵣ r) (Sᵣ r) f r.1)) : Function.Injective f := by algebraize [f] - letI (r : s) : Algebra R (Sᵣ r) := (algebraMap S (Sᵣ r)).comp f |>.toAlgebra + let (r : s) : Algebra R (Sᵣ r) := (algebraMap S (Sᵣ r)).comp f |>.toAlgebra have (r : s) : IsScalarTower R S (Sᵣ r) := IsScalarTower.of_algebraMap_eq' rfl have : ∀ r, IsLocalization.Away (algebraMap R S r.val) (Sᵣ r) := ‹_› - letI (r : s) : Algebra (Rᵣ r) (Sᵣ r) := localizationAlgebra (.powers r.val) S + let (r : s) : Algebra (Rᵣ r) (Sᵣ r) := localizationAlgebra (.powers r.val) S have (r : s) : IsScalarTower R (Rᵣ r) (Sᵣ r) := .of_algebraMap_eq <| by simp [RingHom.algebraMap_toAlgebra] apply injective_of_isLocalized_span s hs Rᵣ (fun r : s ↦ Algebra.linearMap _ _) _ @@ -313,10 +313,10 @@ lemma surjective_of_isLocalization_of_span_eq_top (h : ∀ r : s, Function.Surjective (IsLocalization.Away.map (Rᵣ r) (Sᵣ r) f r.1)) : Function.Surjective f := by algebraize [f] - letI (r : s) : Algebra R (Sᵣ r) := (algebraMap S (Sᵣ r)).comp f |>.toAlgebra + let (r : s) : Algebra R (Sᵣ r) := (algebraMap S (Sᵣ r)).comp f |>.toAlgebra have (r : s) : IsScalarTower R S (Sᵣ r) := IsScalarTower.of_algebraMap_eq' rfl have : ∀ r, IsLocalization.Away (algebraMap R S r.val) (Sᵣ r) := ‹_› - letI (r : s) : Algebra (Rᵣ r) (Sᵣ r) := localizationAlgebra (.powers r.val) S + let (r : s) : Algebra (Rᵣ r) (Sᵣ r) := localizationAlgebra (.powers r.val) S have (r : s) : IsScalarTower R (Rᵣ r) (Sᵣ r) := .of_algebraMap_eq <| by simp [RingHom.algebraMap_toAlgebra] apply surjective_of_isLocalized_span s hs Rᵣ (fun r : s ↦ Algebra.linearMap _ _) _ diff --git a/Mathlib/RingTheory/LocalRing/Module.lean b/Mathlib/RingTheory/LocalRing/Module.lean index 6bbcdde8c76e2d..44da2179c9b467 100644 --- a/Mathlib/RingTheory/LocalRing/Module.lean +++ b/Mathlib/RingTheory/LocalRing/Module.lean @@ -77,9 +77,9 @@ theorem map_tensorProduct_mk_eq_top {N : Submodule R M} [Module.Finite R M] : N.map (TensorProduct.mk R k M 1) = ⊤ ↔ N = ⊤ := by constructor · intro hN - letI : Module k (M ⧸ (𝔪 • ⊤ : Submodule R M)) := + let : Module k (M ⧸ (𝔪 • ⊤ : Submodule R M)) := inferInstanceAs (Module (R ⧸ 𝔪) (M ⧸ 𝔪 • (⊤ : Submodule R M))) - letI : IsScalarTower R k (M ⧸ (𝔪 • ⊤ : Submodule R M)) := + let : IsScalarTower R k (M ⧸ (𝔪 • ⊤ : Submodule R M)) := inferInstanceAs (IsScalarTower R (R ⧸ 𝔪) (M ⧸ 𝔪 • (⊤ : Submodule R M))) let f := AlgebraTensorModule.lift (((LinearMap.ringLmapEquivSelf k k _).symm (Submodule.mkQ (𝔪 • ⊤ : Submodule R M))).restrictScalars R) @@ -170,8 +170,8 @@ lemma exists_basis_of_basis_baseChange [Module.FinitePresentation R M] (H : Function.Injective ((𝔪).subtype.rTensor M)) : ∃ (b : Basis ι R M), ∀ i, b i = v i := by let bk : Basis ι k (k ⊗[R] M) := Basis.mk hli (by rw [hsp]) - haveI : Finite ι := Module.Finite.finite_basis bk - letI : Fintype ι := Fintype.ofFinite ι + have : Finite ι := Module.Finite.finite_basis bk + let : Fintype ι := Fintype.ofFinite ι let i := Finsupp.linearCombination R v have hi : Surjective i := by rw [← LinearMap.range_eq_top, Finsupp.range_linearCombination] diff --git a/Mathlib/RingTheory/LocalRing/ResidueField/Instances.lean b/Mathlib/RingTheory/LocalRing/ResidueField/Instances.lean index f3c37bcdb40462..3fec529a17962f 100644 --- a/Mathlib/RingTheory/LocalRing/ResidueField/Instances.lean +++ b/Mathlib/RingTheory/LocalRing/ResidueField/Instances.lean @@ -68,10 +68,10 @@ instance [Algebra.IsIntegral A B] : Algebra.IsAlgebraic p.ResidueField q.ResidueField := by have : Algebra.IsIntegral (A ⧸ p) (B ⧸ q) := .tower_top A - letI := ((algebraMap (B ⧸ q) q.ResidueField).comp (algebraMap (A ⧸ p) (B ⧸ q))).toAlgebra - haveI : IsScalarTower (A ⧸ p) (B ⧸ q) q.ResidueField := .of_algebraMap_eq' rfl - haveI : Algebra.IsAlgebraic (A ⧸ p) q.ResidueField := .trans _ (B ⧸ q) _ - haveI : IsScalarTower (A ⧸ p) p.ResidueField q.ResidueField := by + let := ((algebraMap (B ⧸ q) q.ResidueField).comp (algebraMap (A ⧸ p) (B ⧸ q))).toAlgebra + have : IsScalarTower (A ⧸ p) (B ⧸ q) q.ResidueField := .of_algebraMap_eq' rfl + have : Algebra.IsAlgebraic (A ⧸ p) q.ResidueField := .trans _ (B ⧸ q) _ + have : IsScalarTower (A ⧸ p) p.ResidueField q.ResidueField := by refine .of_algebraMap_eq fun x ↦ ?_ obtain ⟨x, rfl⟩ := Ideal.Quotient.mk_surjective x simp [RingHom.algebraMap_toAlgebra, ← IsScalarTower.algebraMap_apply] diff --git a/Mathlib/RingTheory/LocalRing/ResidueField/Polynomial.lean b/Mathlib/RingTheory/LocalRing/ResidueField/Polynomial.lean index 84fafcea4a8714..93440dd039a746 100644 --- a/Mathlib/RingTheory/LocalRing/ResidueField/Polynomial.lean +++ b/Mathlib/RingTheory/LocalRing/ResidueField/Polynomial.lean @@ -131,7 +131,7 @@ theorem _root_.Ideal.exists_mem_span_singleton_map_residueField_eq I.map (mapRingHom (algebraMap R P.ResidueField)) := by obtain ⟨p, hp : _ = Ideal.span _⟩ := (inferInstance : (I.map (mapRingHom (algebraMap R P.ResidueField))).IsPrincipal) - letI := (mapRingHom (algebraMap (R ⧸ P) P.ResidueField)).toAlgebra + let := (mapRingHom (algebraMap (R ⧸ P) P.ResidueField)).toAlgebra have := Polynomial.isLocalization (R ⧸ P)⁰ P.ResidueField have : p ∈ (I.map (mapRingHom (algebraMap R (R ⧸ P)))).map (algebraMap _ _) := by rw [Ideal.map_map, RingHom.algebraMap_toAlgebra, mapRingHom_comp, diff --git a/Mathlib/RingTheory/LocalRing/Subring.lean b/Mathlib/RingTheory/LocalRing/Subring.lean index 40cb004025a5fb..c8e97022a9411c 100644 --- a/Mathlib/RingTheory/LocalRing/Subring.lean +++ b/Mathlib/RingTheory/LocalRing/Subring.lean @@ -27,7 +27,7 @@ open nonZeroDivisors embeds in a local (semi)ring `S`, then `R` is local. -/ theorem of_injective [IsLocalRing S] {f : R →+* S} (hf : Function.Injective f) (h : ∀ a, a ∈ R⁰ → IsUnit a) : IsLocalRing R := by - haveI : Nontrivial R := f.domain_nontrivial + have : Nontrivial R := f.domain_nontrivial refine .of_is_unit_or_is_unit_of_add_one fun {a b} hab ↦ (IsLocalRing.isUnit_or_isUnit_of_add_one (map_add f .. ▸ map_one f ▸ congrArg f hab)).imp ?_ ?_ <;> exact h _ ∘ mem_nonZeroDivisors_of_injective hf ∘ IsUnit.mem_nonZeroDivisors diff --git a/Mathlib/RingTheory/Localization/Away/Basic.lean b/Mathlib/RingTheory/Localization/Away/Basic.lean index 8f68522c0189c5..fafd44416928b5 100644 --- a/Mathlib/RingTheory/Localization/Away/Basic.lean +++ b/Mathlib/RingTheory/Localization/Away/Basic.lean @@ -724,7 +724,7 @@ theorem exists_reduced_fraction' {b : B} (hb : b ≠ 0) (hx : Irreducible x) : obtain ⟨⟨a₀, y⟩, H⟩ := surj (Submonoid.powers x) b obtain ⟨d, hy⟩ := (Submonoid.mem_powers_iff y.1 x).mp y.2 have ha₀ : a₀ ≠ 0 := by - haveI := isDomain_of_le_nonZeroDivisors B + have := isDomain_of_le_nonZeroDivisors B (powers_le_nonZeroDivisors_of_noZeroDivisors hx.ne_zero) simp only [← hy, map_pow] at H apply ((injective_iff_map_eq_zero' (algebraMap R B)).mp _ a₀).mpr.mt diff --git a/Mathlib/RingTheory/Localization/Away/Lemmas.lean b/Mathlib/RingTheory/Localization/Away/Lemmas.lean index 36c6b0d1ac3b95..8106e24f68cd01 100644 --- a/Mathlib/RingTheory/Localization/Away/Lemmas.lean +++ b/Mathlib/RingTheory/Localization/Away/Lemmas.lean @@ -38,7 +38,7 @@ lemma span_range_mulNumerator_eq_top {s : Set R} Ideal.span (Set.range (IsLocalization.Away.mulNumerator s p)) = ⊤ := by rw [← Ideal.radical_eq_top, eq_top_iff, ← hsone, Ideal.span_le] intro a ha - haveI : IsLocalization (Submonoid.powers a) (Rₜ ⟨a, ha⟩) := + have : IsLocalization (Submonoid.powers a) (Rₜ ⟨a, ha⟩) := inferInstanceAs <| IsLocalization.Away (⟨a, ha⟩ : s).val (Rₜ ⟨a, ha⟩) have h₁ : Ideal.span (p ⟨a, ha⟩) ≤ Ideal.span (algebraMap R (Rₜ ⟨a, ha⟩) '' Set.range (IsLocalization.Away.mulNumerator s p)) := by diff --git a/Mathlib/RingTheory/Localization/BaseChange.lean b/Mathlib/RingTheory/Localization/BaseChange.lean index 1ee7a99f5f08af..1e14534c377786 100644 --- a/Mathlib/RingTheory/Localization/BaseChange.lean +++ b/Mathlib/RingTheory/Localization/BaseChange.lean @@ -46,7 +46,7 @@ given by `m/s ↦ (1/s) ⊗ₜ m`. -/ theorem isLocalizedModule_iff_isBaseChange : IsLocalizedModule S f ↔ IsBaseChange A f := by refine ⟨fun _ ↦ IsLocalizedModule.isBaseChange S A f, fun h ↦ ?_⟩ - letI : Module A (LocalizedModule S M) := LocalizedModule.moduleOfIsLocalization .. + let : Module A (LocalizedModule S M) := LocalizedModule.moduleOfIsLocalization .. have : IsBaseChange A (LocalizedModule.mkLinearMap S M) := IsLocalizedModule.isBaseChange S A _ let e := (this.equiv.symm.trans h.equiv).restrictScalars R convert! IsLocalizedModule.of_linearEquiv S (LocalizedModule.mkLinearMap S M) e @@ -240,9 +240,9 @@ open TensorProduct instance IsLocalizedModule.rTensor (g : M →ₗ[A] M') [h : IsLocalizedModule S g] : IsLocalizedModule S (AlgebraTensorModule.rTensor R N g) := by let Aₚ := Localization S - letI : Module Aₚ M' := (IsLocalizedModule.iso S g).symm.toAddEquiv.module Aₚ - haveI : IsScalarTower A Aₚ M' := (IsLocalizedModule.iso S g).symm.isScalarTower Aₚ - haveI : IsScalarTower R Aₚ M' := + let : Module Aₚ M' := (IsLocalizedModule.iso S g).symm.toAddEquiv.module Aₚ + have : IsScalarTower A Aₚ M' := (IsLocalizedModule.iso S g).symm.isScalarTower Aₚ + have : IsScalarTower R Aₚ M' := IsScalarTower.of_algebraMap_smul <| fun r x ↦ by simp [IsScalarTower.algebraMap_apply R A Aₚ] rw [isLocalizedModule_iff_isBaseChange (S := S) (A := Aₚ)] at h ⊢ exact isBaseChange_tensorProduct_map _ h @@ -318,7 +318,7 @@ theorem tensorLeftAlgEquiv_apply_one_tmul (x : Localization M) : let Rₘ := Localization M let Sₘ := Localization (Algebra.algebraMapSubmonoid S M) obtain ⟨x, y, rfl⟩ := IsLocalization.exists_mk'_eq M x - letI : Algebra Rₘ (S ⊗[R] Rₘ) := Algebra.TensorProduct.rightAlgebra + let : Algebra Rₘ (S ⊗[R] Rₘ) := Algebra.TensorProduct.rightAlgebra have h1 : (1 : S) ⊗ₜ[R] IsLocalization.mk' Rₘ x y = algebraMap _ _ (IsLocalization.mk' Rₘ x y) := rfl rw [h1, tensorLeftAlgEquiv, algEquiv_symm_apply, @@ -411,7 +411,7 @@ lemma IsLocalization.tensorProductEquivOfMapIncludeRight_tmul (M : Submonoid A) (x : S) (a : A) : IsLocalization.tensorProductEquivOfMapIncludeRight R S M B C (x ⊗ₜ algebraMap A B a) = algebraMap _ _ (x ⊗ₜ[R] a) := by - letI : Algebra (S ⊗[R] A) (S ⊗[R] B) := + let : Algebra (S ⊗[R] A) (S ⊗[R] B) := (Algebra.TensorProduct.map (AlgHom.id R S) (IsScalarTower.toAlgHom R _ _)).toAlgebra have heq : x ⊗ₜ[R] (algebraMap A B) a = algebraMap _ _ (x ⊗ₜ[R] a) := rfl simp [heq, IsLocalization.tensorProductEquivOfMapIncludeRight] diff --git a/Mathlib/RingTheory/Localization/Basic.lean b/Mathlib/RingTheory/Localization/Basic.lean index c59a1127945cf0..f70e235d540cbd 100644 --- a/Mathlib/RingTheory/Localization/Basic.lean +++ b/Mathlib/RingTheory/Localization/Basic.lean @@ -489,7 +489,7 @@ open IsLocalization theorem IsField.localization_map_bijective {R Rₘ : Type*} [CommRing R] [CommRing Rₘ] {M : Submonoid R} (hM : (0 : R) ∉ M) (hR : IsField R) [Algebra R Rₘ] [IsLocalization M Rₘ] : Function.Bijective (algebraMap R Rₘ) := by - letI := hR.toField + let := hR.toField replace hM := le_nonZeroDivisors_of_noZeroDivisors hM refine ⟨IsLocalization.injective _ hM, fun x => ?_⟩ obtain ⟨r, ⟨m, hm⟩, rfl⟩ := exists_mk'_eq M x diff --git a/Mathlib/RingTheory/Localization/Defs.lean b/Mathlib/RingTheory/Localization/Defs.lean index 3c0cedffbbf9aa..a15f5a259dadfc 100644 --- a/Mathlib/RingTheory/Localization/Defs.lean +++ b/Mathlib/RingTheory/Localization/Defs.lean @@ -736,7 +736,7 @@ variable (M) theorem isLocalization_of_base_ringEquiv [IsLocalization M S] (h : R ≃+* P) : haveI := ((algebraMap R S).comp h.symm.toRingHom).toAlgebra IsLocalization (M.map h) S := by - letI : Algebra P S := ((algebraMap R S).comp h.symm.toRingHom).toAlgebra + let : Algebra P S := ((algebraMap R S).comp h.symm.toRingHom).toAlgebra constructor; constructor · rintro ⟨_, ⟨y, hy, rfl⟩⟩ convert! IsLocalization.map_units S ⟨y, hy⟩ @@ -756,7 +756,7 @@ theorem isLocalization_iff_of_base_ringEquiv (h : R ≃+* P) : IsLocalization M S ↔ haveI := ((algebraMap R S).comp h.symm.toRingHom).toAlgebra IsLocalization (M.map h) S := by - letI : Algebra P S := ((algebraMap R S).comp h.symm.toRingHom).toAlgebra + let : Algebra P S := ((algebraMap R S).comp h.symm.toRingHom).toAlgebra refine ⟨fun _ => isLocalization_of_base_ringEquiv M S h, ?_⟩ intro (H : IsLocalization (Submonoid.map (h : R ≃* P) M) S) convert! isLocalization_of_base_ringEquiv (Submonoid.map (h : R ≃* P) M) S h.symm diff --git a/Mathlib/RingTheory/Localization/FractionRing.lean b/Mathlib/RingTheory/Localization/FractionRing.lean index 54d432f40eba71..c403caf19d5c84 100644 --- a/Mathlib/RingTheory/Localization/FractionRing.lean +++ b/Mathlib/RingTheory/Localization/FractionRing.lean @@ -270,11 +270,11 @@ theorem isUnit_map_of_injective (hg : Function.Injective g) (y : nonZeroDivisors theorem mk'_eq_zero_iff_eq_zero [Algebra R K] [IsFractionRing R K] {x : R} {y : nonZeroDivisors R} : mk' K x y = 0 ↔ x = 0 := by - haveI := (algebraMap R K).domain_nontrivial + have := (algebraMap R K).domain_nontrivial simp [nonZeroDivisors.ne_zero] theorem mk'_eq_one_iff_eq {x : A} {y : nonZeroDivisors A} : mk' K x y = 1 ↔ x = y := by - haveI := (algebraMap A K).domain_nontrivial + have := (algebraMap A K).domain_nontrivial refine ⟨?_, fun hxy => by rw [hxy, mk'_self']⟩ intro hxy have hy : (algebraMap A K) ↑y ≠ (0 : K) := diff --git a/Mathlib/RingTheory/Localization/Ideal.lean b/Mathlib/RingTheory/Localization/Ideal.lean index 35ae3cd89208ca..1d231e301dfe06 100644 --- a/Mathlib/RingTheory/Localization/Ideal.lean +++ b/Mathlib/RingTheory/Localization/Ideal.lean @@ -348,7 +348,7 @@ open nonZeroDivisors theorem bot_lt_under_prime [IsDomain R] (hM : M ≤ R⁰) (p : Ideal S) [hpp : p.IsPrime] (hp0 : p ≠ ⊥) : ⊥ < p.under R := by - haveI : IsDomain S := isDomain_of_le_nonZeroDivisors _ hM + have : IsDomain S := isDomain_of_le_nonZeroDivisors _ hM rw [← Ideal.comap_bot_of_injective (algebraMap R S) (IsLocalization.injective _ hM)] convert! (orderIsoOfPrime M S).lt_iff_lt.mpr diff --git a/Mathlib/RingTheory/Localization/Integer.lean b/Mathlib/RingTheory/Localization/Integer.lean index 021a6a1474c278..2d307a6a86a984 100644 --- a/Mathlib/RingTheory/Localization/Integer.lean +++ b/Mathlib/RingTheory/Localization/Integer.lean @@ -86,7 +86,7 @@ theorem exists_integer_multiple (a : S) : ∃ b : M, IsInteger R ((b : R) • a) /-- We can clear the denominators of a `Finset`-indexed family of fractions. -/ theorem exist_integer_multiples {ι : Type*} (s : Finset ι) (f : ι → S) : ∃ b : M, ∀ i ∈ s, IsLocalization.IsInteger R ((b : R) • f i) := by - haveI := Classical.propDecidable + have := Classical.propDecidable refine ⟨∏ i ∈ s, (sec M (f i)).2, fun i hi => ⟨?_, ?_⟩⟩ · exact (∏ j ∈ s.erase i, (sec M (f j)).2) * (sec M (f i)).1 rw [map_mul, sec_spec', ← mul_assoc, ← (algebraMap R S).map_mul, ← Algebra.smul_def] diff --git a/Mathlib/RingTheory/Localization/Integral.lean b/Mathlib/RingTheory/Localization/Integral.lean index 8d608d1116c9c8..cd0fc56ae9e91a 100644 --- a/Mathlib/RingTheory/Localization/Integral.lean +++ b/Mathlib/RingTheory/Localization/Integral.lean @@ -86,9 +86,9 @@ variable {M} in theorem integerNormalization_eq_zero_iff [IsDomain R] (hM : M ≤ nonZeroDivisors R) (p : S[X]) : integerNormalization M p = 0 ↔ p = 0 := by obtain ⟨_, hb₁, hb₂⟩ := integerNormalization_spec M p - letI := isDomain_of_le_nonZeroDivisors S hM - letI := (faithfulSMul_iff_algebraMap_injective R S).mpr <| IsLocalization.injective S hM - letI : Function.Injective <| mapRingHom (algebraMap R S) := by + let := isDomain_of_le_nonZeroDivisors S hM + let := (faithfulSMul_iff_algebraMap_injective R S).mpr <| IsLocalization.injective S hM + let : Function.Injective <| mapRingHom (algebraMap R S) := by rw [coe_mapRingHom, map_injective_iff] exact IsLocalization.injective S hM rw [← _root_.map_eq_zero_iff (mapRingHom (algebraMap R S)) this, coe_mapRingHom, hb₂] @@ -173,7 +173,7 @@ theorem RingHom.isIntegralElem_localization_at_leadingCoeff {R S : Type*} [CommS (map Sₘ f M.le_comap_map : Rₘ →+* _).IsIntegralElem (algebraMap S Sₘ x) := by by_cases triv : (1 : Rₘ) = 0 · exact ⟨0, ⟨_root_.trans leadingCoeff_zero triv.symm, eval₂_zero _ _⟩⟩ - haveI : Nontrivial Rₘ := nontrivial_of_ne 1 0 triv + have : Nontrivial Rₘ := nontrivial_of_ne 1 0 triv obtain ⟨b, hb⟩ := isUnit_iff_exists_inv.mp (map_units Rₘ ⟨p.leadingCoeff, hM⟩) refine ⟨p.map (algebraMap R Rₘ) * C b, ⟨?_, ?_⟩⟩ · refine monic_mul_C_of_leadingCoeff_mul_eq_one ?_ @@ -254,7 +254,7 @@ theorem IsLocalization.scaleRoots_commonDenom_mem_lifts (p : Rₘ[X]) theorem IsIntegral.exists_multiple_integral_of_isLocalization [Algebra Rₘ S] [IsScalarTower R Rₘ S] (x : S) (hx : IsIntegral Rₘ x) : ∃ m : M, IsIntegral R (m • x) := by rcases subsingleton_or_nontrivial Rₘ with _ | nontriv - · haveI := (algebraMap Rₘ S).codomain_trivial + · have := (algebraMap Rₘ S).codomain_trivial exact ⟨1, Polynomial.X, Polynomial.monic_X, Subsingleton.elim _ _⟩ obtain ⟨p, hp₁, hp₂⟩ := hx -- Porting note: obtain doesn't support side goals @@ -331,7 +331,7 @@ lemma isIntegral_of_isIntegral_adjoin_of_mul_eq_one · simp_all let q' := q.sum fun i r ↦ X ^ i * r.reflect N have (i : _) : aeval t (reflect N (q.coeff i)) = t ^ N * (aeval s (q.coeff i)) := by - letI : Invertible t := ⟨s, hst, (mul_comm _ _).trans hst⟩ + let : Invertible t := ⟨s, hst, (mul_comm _ _).trans hst⟩ rw [aeval_def, ← eval₂_reflect_mul_pow _ _ N _ ((natDegree_reflect_le ..).trans (by simp [hN]))] simp +instances [mul_comm, this, aeval_def] refine ⟨q', ?_, ?_⟩ @@ -494,8 +494,8 @@ theorem isAlgebraic_iff' [Field K] [IsDomain R] [Algebra R K] [Algebra S K] simp only [Algebra.isAlgebraic_def] constructor · intro h x - letI := MulActionWithZero.nontrivial S K - letI := FractionRing.liftAlgebra R K + let := MulActionWithZero.nontrivial S K + let := FractionRing.liftAlgebra R K have := FractionRing.isScalarTower_liftAlgebra R K rw [IsFractionRing.isAlgebraic_iff R (FractionRing R) K, isAlgebraic_iff_isIntegral] obtain ⟨a : S, b, ha, rfl⟩ := div_surjective S x diff --git a/Mathlib/RingTheory/Localization/LocalizationLocalization.lean b/Mathlib/RingTheory/Localization/LocalizationLocalization.lean index fb4c01dd8d196d..bfbe023e990663 100644 --- a/Mathlib/RingTheory/Localization/LocalizationLocalization.lean +++ b/Mathlib/RingTheory/Localization/LocalizationLocalization.lean @@ -277,8 +277,8 @@ theorem isFractionRing_of_isLocalization (S T : Type*) [CommRing S] [CommRing T] theorem isFractionRing_of_isDomain_of_isLocalization [IsDomain R] (S T : Type*) [CommRing S] [CommRing T] [Algebra R S] [Algebra R T] [Algebra S T] [IsScalarTower R S T] [IsLocalization M S] [IsFractionRing R T] : IsFractionRing S T := by - haveI := IsFractionRing.nontrivial R T - haveI := (algebraMap S T).domain_nontrivial + have := IsFractionRing.nontrivial R T + have := (algebraMap S T).domain_nontrivial apply isFractionRing_of_isLocalization M S T intro x hx rw [mem_nonZeroDivisors_iff_ne_zero] diff --git a/Mathlib/RingTheory/Localization/NormTrace.lean b/Mathlib/RingTheory/Localization/NormTrace.lean index 0ac9bdc4c3e206..1fb45d4bd9dca2 100644 --- a/Mathlib/RingTheory/Localization/NormTrace.lean +++ b/Mathlib/RingTheory/Localization/NormTrace.lean @@ -63,10 +63,10 @@ Then the norm of `a : Sₘ` over `Rₘ` is the norm of `a : S` over `R` if `S` i theorem Algebra.norm_localization [Module.Free R S] [Module.Finite R S] (a : S) : Algebra.norm Rₘ (algebraMap S Sₘ a) = algebraMap R Rₘ (Algebra.norm R a) := by cases subsingleton_or_nontrivial R - · haveI : Subsingleton Rₘ := Module.subsingleton R Rₘ + · have : Subsingleton Rₘ := Module.subsingleton R Rₘ simp [eq_iff_true_of_subsingleton] let b := Module.Free.chooseBasis R S - letI := Classical.decEq (Module.Free.ChooseBasisIndex R S) + let := Classical.decEq (Module.Free.ChooseBasisIndex R S) rw [Algebra.norm_eq_matrix_det (b.localizationLocalization Rₘ M Sₘ), Algebra.norm_eq_matrix_det b, RingHom.map_det, ← Algebra.map_leftMulMatrix_localization] @@ -84,10 +84,10 @@ Then the trace of `a : Sₘ` over `Rₘ` is the trace of `a : S` over `R` if `S` theorem Algebra.trace_localization [Module.Free R S] [Module.Finite R S] (a : S) : Algebra.trace Rₘ Sₘ (algebraMap S Sₘ a) = algebraMap R Rₘ (Algebra.trace R S a) := by cases subsingleton_or_nontrivial R - · haveI : Subsingleton Rₘ := Module.subsingleton R Rₘ + · have : Subsingleton Rₘ := Module.subsingleton R Rₘ simp [eq_iff_true_of_subsingleton] let b := Module.Free.chooseBasis R S - letI := Classical.decEq (Module.Free.ChooseBasisIndex R S) + let := Classical.decEq (Module.Free.ChooseBasisIndex R S) rw [Algebra.trace_eq_matrix_trace (b.localizationLocalization Rₘ M Sₘ), Algebra.trace_eq_matrix_trace b, ← Algebra.map_leftMulMatrix_localization] exact (AddMonoidHom.map_trace (algebraMap R Rₘ).toAddMonoidHom _).symm diff --git a/Mathlib/RingTheory/Morita/Matrix.lean b/Mathlib/RingTheory/Morita/Matrix.lean index aedf27525a3d56..a02d768515c31b 100644 --- a/Mathlib/RingTheory/Morita/Matrix.lean +++ b/Mathlib/RingTheory/Morita/Matrix.lean @@ -149,8 +149,8 @@ def toModuleCatFromModuleCatLinearEquiv (M : ModuleCat (Matrix ι ι R)) (j : ι simp [← mul_smul]⟩ map_add' _ _ := by ext; simp map_smul' x m := funext fun i ↦ Subtype.ext <| by - letI := Module.compHom M (Matrix.scalar (α := R) ι) - haveI := MatrixModCat.isScalarTower_toModuleCat R M + let := Module.compHom M (Matrix.scalar (α := R) ι) + have := MatrixModCat.isScalarTower_toModuleCat R M simp only [← mul_smul, RingHom.id_apply, Module.smul_apply, AddSubmonoidClass.coe_finsetSum, SetLike.val_smul, ← smul_assoc, ← Finset.sum_smul] congr diff --git a/Mathlib/RingTheory/MvPowerSeries/Expand.lean b/Mathlib/RingTheory/MvPowerSeries/Expand.lean index 7a2504c80c23c3..1df40bfe1c3eee 100644 --- a/Mathlib/RingTheory/MvPowerSeries/Expand.lean +++ b/Mathlib/RingTheory/MvPowerSeries/Expand.lean @@ -140,7 +140,7 @@ theorem support_expand_subset (φ : MvPowerSeries σ R) : (expand p hp φ).support ⊆ φ.support.image (p • ·) := by intro d hd have : ∀ i, p ∣ d i := fun _ => by_contra fun hc => hd (coeff_expand_of_not_dvd p hp φ hc) - letI m := d.mapRange (fun n => n / p) (Nat.zero_div p) + let m := d.mapRange (fun n => n / p) (Nat.zero_div p) have eq_aux : p • m = d := (Finsupp.ext fun a => Nat.eq_mul_of_div_eq_right (this a) rfl).symm rw [Function.mem_support, ← eq_aux, ← coeff_apply (expand p hp φ), coeff_expand_smul, coeff_apply] at hd diff --git a/Mathlib/RingTheory/MvPowerSeries/Substitution.lean b/Mathlib/RingTheory/MvPowerSeries/Substitution.lean index 4bf62eae37dcea..10ff8630dd1051 100644 --- a/Mathlib/RingTheory/MvPowerSeries/Substitution.lean +++ b/Mathlib/RingTheory/MvPowerSeries/Substitution.lean @@ -98,19 +98,19 @@ theorem HasSubst.hasEval [TopologicalSpace S] (ha : HasSubst a) : (@hasSubst_iff_hasEval_of_discreteTopology σ τ _ _ a ⊥ (@DiscreteTopology.mk S ⊥ rfl)).mp ha theorem HasSubst.zero : HasSubst (fun (_ : σ) ↦ (0 : MvPowerSeries τ S)) := by - letI : UniformSpace S := ⊥ + let : UniformSpace S := ⊥ simpa [hasSubst_iff_hasEval_of_discreteTopology] using! HasEval.zero theorem HasSubst.add {a b : σ → MvPowerSeries τ S} (ha : HasSubst a) (hb : HasSubst b) : HasSubst (a + b) := by - letI : UniformSpace S := ⊥ + let : UniformSpace S := ⊥ rw [hasSubst_iff_hasEval_of_discreteTopology] at ha hb ⊢ exact ha.add hb theorem HasSubst.mul_left (b : σ → MvPowerSeries τ S) {a : σ → MvPowerSeries τ S} (ha : HasSubst a) : HasSubst (b * a) := by - letI : UniformSpace S := ⊥ + let : UniformSpace S := ⊥ rw [hasSubst_iff_hasEval_of_discreteTopology] at ha ⊢ exact ha.mul_left b @@ -123,7 +123,7 @@ theorem HasSubst.smul (r : MvPowerSeries τ S) {a : σ → MvPowerSeries τ S} ( HasSubst (r • a) := ha.mul_left _ protected theorem HasSubst.X : HasSubst (fun (s : σ) ↦ (X s : MvPowerSeries σ S)) := by - letI : UniformSpace S := ⊥ + let : UniformSpace S := ⊥ simpa [hasSubst_iff_hasEval_of_discreteTopology] using HasEval.X omit [Algebra R S] in @@ -200,8 +200,8 @@ theorem subst_eq_eval₂ theorem subst_coe (p : MvPolynomial σ R) : subst (R := R) a p = MvPolynomial.aeval a p := by - letI : UniformSpace R := ⊥ - letI : UniformSpace S := ⊥ + let : UniformSpace R := ⊥ + let : UniformSpace S := ⊥ rw [subst_eq_eval₂, eval₂_coe, MvPolynomial.aeval_def] variable {a : σ → MvPowerSeries τ S} @@ -228,13 +228,13 @@ theorem substAlgHom_eq_aeval @[simp] theorem coe_substAlgHom (ha : HasSubst a) : ⇑(substAlgHom ha) = subst (R := R) a := by - letI : UniformSpace R := ⊥ - letI : UniformSpace S := ⊥ + let : UniformSpace R := ⊥ + let : UniformSpace S := ⊥ rw [substAlgHom_eq_aeval, coe_aeval ha.hasEval, subst_eq_eval₂] theorem subst_self : subst (MvPowerSeries.X : σ → MvPowerSeries σ R) = id := by rw [← coe_substAlgHom HasSubst.X] - letI : UniformSpace R := ⊥ + let : UniformSpace R := ⊥ ext1 f simp only [substAlgHom_eq_aeval] have := aeval_unique (ε := AlgHom.id R (MvPowerSeries σ R)) continuous_id @@ -310,8 +310,8 @@ theorem coeff_subst_finite (ha : HasSubst a) (f : MvPowerSeries σ R) (e : τ theorem coeff_subst (ha : HasSubst a) (f : MvPowerSeries σ R) (e : τ →₀ ℕ) : coeff e (subst a f) = finsum (fun d ↦ coeff d f • (coeff e (d.prod fun s e => (a s) ^ e))) := by - letI : UniformSpace R := ⊥ - letI : UniformSpace S := ⊥ + let : UniformSpace R := ⊥ + let : UniformSpace S := ⊥ have := ((hasSum_aeval ha.hasEval f).map (coeff e) (continuous_coeff S e)) simp [← coe_substAlgHom ha, substAlgHom, ← this.tsum_eq, tsum_eq_finsum (coeff_subst_finite ha f e)] @@ -451,17 +451,17 @@ theorem HasSubst.comp (ha : HasSubst a) (hb : HasSubst b) : HasSubst (fun s ↦ substAlgHom hb (a s)) where const_coeff s := IsNilpotent_substAlgHom hb (ha.const_coeff s) coeff_zero := by - letI : UniformSpace S := ⊥ - letI : UniformSpace T := ⊥ + let : UniformSpace S := ⊥ + let : UniformSpace T := ⊥ rw [← coeff_zero_iff] apply Filter.Tendsto.comp _ (ha.hasEval.tendsto_zero) simpa [← map_zero (substAlgHom (R := S) hb)] using! (continuous_subst hb).continuousAt theorem substAlgHom_comp_substAlgHom (ha : HasSubst a) (hb : HasSubst b) : ((substAlgHom hb).restrictScalars R).comp (substAlgHom ha) = substAlgHom (ha.comp hb) := by - letI : UniformSpace R := ⊥ - letI : UniformSpace S := ⊥ - letI : UniformSpace T := ⊥ + let : UniformSpace R := ⊥ + let : UniformSpace S := ⊥ + let : UniformSpace T := ⊥ apply comp_aeval (R := R) (ε := (substAlgHom hb).restrictScalars R) ha.hasEval simpa [AlgHom.coe_restrictScalars'] using continuous_subst (R := S) hb diff --git a/Mathlib/RingTheory/Noetherian/Orzech.lean b/Mathlib/RingTheory/Noetherian/Orzech.lean index ed2d8f1243cb19..eb3f64234d857f 100644 --- a/Mathlib/RingTheory/Noetherian/Orzech.lean +++ b/Mathlib/RingTheory/Noetherian/Orzech.lean @@ -43,7 +43,7 @@ utilizing `LinearMap.iterateMapComap`. See also Orzech's original paper: *Onto endomorphisms are isomorphisms* [orzech1971]. -/ theorem IsNoetherian.injective_of_surjective_of_injective (i f : N →ₗ[R] M) (hi : Injective i) (hf : Surjective f) : Injective f := by - haveI := isNoetherian_of_injective i hi + have := isNoetherian_of_injective i hi obtain ⟨n, H⟩ := monotone_stabilizes_iff_noetherian.2 ‹_› ⟨_, monotone_nat_of_le_succ <| f.iterateMapComap_le_succ i ⊥ (by simp)⟩ exact LinearMap.ker_eq_bot.1 <| bot_unique <| diff --git a/Mathlib/RingTheory/NonUnitalSubring/Basic.lean b/Mathlib/RingTheory/NonUnitalSubring/Basic.lean index 2032ab1081b90b..6a2cec329d3935 100644 --- a/Mathlib/RingTheory/NonUnitalSubring/Basic.lean +++ b/Mathlib/RingTheory/NonUnitalSubring/Basic.lean @@ -696,7 +696,7 @@ theorem coe_iSup_of_directed {ι} [Nonempty ι] {S : ι → NonUnitalSubring R} theorem mem_sSup_of_directedOn {S : Set (NonUnitalSubring R)} (Sne : S.Nonempty) (hS : DirectedOn (· ≤ ·) S) {x : R} : x ∈ sSup S ↔ ∃ s ∈ S, x ∈ s := by - haveI : Nonempty S := Sne.to_subtype + have : Nonempty S := Sne.to_subtype simp only [sSup_eq_iSup', mem_iSup_of_directed hS.directed_val, SetCoe.exists, exists_prop] diff --git a/Mathlib/RingTheory/NonUnitalSubsemiring/Basic.lean b/Mathlib/RingTheory/NonUnitalSubsemiring/Basic.lean index 188f76c8320d9d..7dc6408d1a7b31 100644 --- a/Mathlib/RingTheory/NonUnitalSubsemiring/Basic.lean +++ b/Mathlib/RingTheory/NonUnitalSubsemiring/Basic.lean @@ -631,7 +631,7 @@ theorem coe_iSup_of_directed {ι} [hι : Nonempty ι] {S : ι → NonUnitalSubse theorem mem_sSup_of_directedOn {S : Set (NonUnitalSubsemiring R)} (Sne : S.Nonempty) (hS : DirectedOn (· ≤ ·) S) {x : R} : x ∈ sSup S ↔ ∃ s ∈ S, x ∈ s := by - haveI : Nonempty S := Sne.to_subtype + have : Nonempty S := Sne.to_subtype simp only [sSup_eq_iSup', mem_iSup_of_directed hS.directed_val, Subtype.exists, exists_prop] theorem coe_sSup_of_directedOn {S : Set (NonUnitalSubsemiring R)} (Sne : S.Nonempty) diff --git a/Mathlib/RingTheory/Norm/Basic.lean b/Mathlib/RingTheory/Norm/Basic.lean index 57096d1816ef5f..3d824925a0be44 100644 --- a/Mathlib/RingTheory/Norm/Basic.lean +++ b/Mathlib/RingTheory/Norm/Basic.lean @@ -72,7 +72,7 @@ theorem PowerBasis.norm_gen_eq_coeff_zero_minpoly (pb : PowerBasis R S) : theorem PowerBasis.norm_gen_eq_prod_roots [Algebra R F] (pb : PowerBasis R S) (hf : ((minpoly R pb.gen).map (algebraMap R F)).Splits) : algebraMap R F (norm R pb.gen) = ((minpoly R pb.gen).aroots F).prod := by - haveI := Module.nontrivial R F + have := Module.nontrivial R F have := minpoly.monic pb.isIntegral_gen rw [PowerBasis.norm_gen_eq_coeff_zero_minpoly, ← pb.natDegree_minpoly, map_mul, ← coeff_map, @@ -119,8 +119,8 @@ theorem norm_eq_zero_iff' [IsDomain R] [IsDomain S] [Module.Free R S] [Module.Fi theorem norm_eq_zero_iff_of_basis [IsDomain R] [IsDomain S] (b : Basis ι R S) {x : S} : Algebra.norm R x = 0 ↔ x = 0 := by - haveI : Module.Free R S := Module.Free.of_basis b - haveI : Module.Finite R S := Module.Finite.of_basis b + have : Module.Free R S := Module.Free.of_basis b + have : Module.Finite R S := Module.Finite.of_basis b exact norm_eq_zero_iff theorem norm_ne_zero_iff_of_basis [IsDomain R] [IsDomain S] (b : Basis ι R S) {x : S} : @@ -179,7 +179,7 @@ theorem norm_eq_prod_embeddings_gen [Algebra R F] (pb : PowerBasis R S) (hE : ((minpoly R pb.gen).map (algebraMap R F)).Splits) (hfx : IsSeparable R pb.gen) : algebraMap R F (norm R pb.gen) = (@Finset.univ _ (PowerBasis.AlgHom.fintype pb)).prod fun σ => σ pb.gen := by - letI := Classical.decEq F + let := Classical.decEq F rw [PowerBasis.norm_gen_eq_prod_roots pb hE] rw [@Fintype.prod_equiv (S →ₐ[R] F) _ _ (PowerBasis.AlgHom.fintype pb) _ _ pb.liftEquiv' (fun σ => σ pb.gen) (fun x => x) ?_] @@ -194,13 +194,13 @@ theorem prod_embeddings_eq_finrank_pow [Algebra L F] [IsScalarTower K L F] [IsAl ∏ σ : F →ₐ[K] E, σ (algebraMap L F pb.gen) = ((@Finset.univ _ (PowerBasis.AlgHom.fintype pb)).prod fun σ : L →ₐ[K] E => σ pb.gen) ^ finrank L F := by - haveI : FiniteDimensional L F := FiniteDimensional.right K L F - haveI : Algebra.IsSeparable L F := Algebra.isSeparable_tower_top_of_isSeparable K L F - letI : Fintype (L →ₐ[K] E) := PowerBasis.AlgHom.fintype pb + have : FiniteDimensional L F := FiniteDimensional.right K L F + have : Algebra.IsSeparable L F := Algebra.isSeparable_tower_top_of_isSeparable K L F + let : Fintype (L →ₐ[K] E) := PowerBasis.AlgHom.fintype pb rw [Fintype.prod_equiv algHomEquivSigma (fun σ : F →ₐ[K] E => _) fun σ => σ.1 pb.gen, ← Finset.univ_sigma_univ, Finset.prod_sigma, ← Finset.prod_pow] · refine Finset.prod_congr rfl fun σ _ => ?_ - letI : Algebra L E := σ.toRingHom.toAlgebra + let : Algebra L E := σ.toRingHom.toAlgebra simp_rw [Finset.prod_const] congr exact AlgHom.card L F E @@ -220,8 +220,8 @@ lemma norm_eq_of_ringEquiv {A B C : Type*} [CommRing A] [CommRing B] [Ring C] classical by_cases h : ∃ s : Finset C, Nonempty (Basis s B C) · obtain ⟨s, ⟨b⟩⟩ := h - letI : Algebra A B := RingHom.toAlgebra e - letI : IsScalarTower A B C := IsScalarTower.of_algebraMap_eq' he.symm + let : Algebra A B := RingHom.toAlgebra e + let : IsScalarTower A B C := IsScalarTower.of_algebraMap_eq' he.symm rw [Algebra.norm_eq_matrix_det b, Algebra.norm_eq_matrix_det (b.mapCoeffs e.symm (by simp [Algebra.smul_def, ← he])), e.map_det] @@ -236,7 +236,7 @@ lemma norm_eq_of_equiv_equiv {A₁ B₁ A₂ B₂ : Type*} [CommRing A₁] [Ring [CommRing A₂] [Ring B₂] [Algebra A₁ B₁] [Algebra A₂ B₂] (e₁ : A₁ ≃+* A₂) (e₂ : B₁ ≃+* B₂) (he : RingHom.comp (algebraMap A₂ B₂) ↑e₁ = RingHom.comp ↑e₂ (algebraMap A₁ B₁)) (x) : Algebra.norm A₁ x = e₁.symm (Algebra.norm A₂ (e₂ x)) := by - letI := (RingHom.comp (e₂ : B₁ →+* B₂) (algebraMap A₁ B₁)).toAlgebra' ?_ + let := (RingHom.comp (e₂ : B₁ →+* B₂) (algebraMap A₁ B₁)).toAlgebra' ?_ · let e' : B₁ ≃ₐ[A₁] B₂ := { e₂ with commutes' := fun _ ↦ rfl } rw [← Algebra.norm_eq_of_ringEquiv e₁ he, ← Algebra.norm_eq_of_algEquiv e'] simp [e'] diff --git a/Mathlib/RingTheory/Norm/Defs.lean b/Mathlib/RingTheory/Norm/Defs.lean index ead7185cfdb2e1..401d4bd8d9a15d 100644 --- a/Mathlib/RingTheory/Norm/Defs.lean +++ b/Mathlib/RingTheory/Norm/Defs.lean @@ -86,7 +86,7 @@ theorem norm_eq_matrix_det [Fintype ι] [DecidableEq ι] (b : Basis ι R S) (s : /-- If `x` is in the base ring `K`, then the norm is `x ^ [L : K]`. -/ theorem norm_algebraMap_of_basis [Fintype ι] (b : Basis ι R S) (x : R) : norm R (algebraMap R S x) = x ^ Fintype.card ι := by - haveI := Classical.decEq ι + have := Classical.decEq ι rw [norm_apply, ← det_toMatrix b, lmul_algebraMap] simp diff --git a/Mathlib/RingTheory/Norm/Transitivity.lean b/Mathlib/RingTheory/Norm/Transitivity.lean index 298a5e942acb68..88c2e96d9e241d 100644 --- a/Mathlib/RingTheory/Norm/Transitivity.lean +++ b/Mathlib/RingTheory/Norm/Transitivity.lean @@ -266,7 +266,7 @@ theorem norm_eq_prod_embeddings [Algebra.IsSeparable K L] [IsAlgClosed E] rw [norm_eq_norm_adjoin K x, map_pow, ← adjoin.powerBasis_gen hx, norm_eq_prod_embeddings_gen E (adjoin.powerBasis hx) (IsAlgClosed.splits _)] · exact (prod_embeddings_eq_finrank_pow L (L := K⟮x⟯) E (adjoin.powerBasis hx)).symm - · haveI := Algebra.isSeparable_tower_bot_of_isSeparable K K⟮x⟯ L + · have := Algebra.isSeparable_tower_bot_of_isSeparable K K⟮x⟯ L exact Algebra.IsSeparable.isSeparable K _ theorem norm_eq_prod_automorphisms [IsGalois K L] (x : L) : diff --git a/Mathlib/RingTheory/NormTrace.lean b/Mathlib/RingTheory/NormTrace.lean index c3b48a4a7c32f2..5d36a5568caa8a 100644 --- a/Mathlib/RingTheory/NormTrace.lean +++ b/Mathlib/RingTheory/NormTrace.lean @@ -22,7 +22,7 @@ lemma Algebra.norm_one_add_smul {A B} [CommRing A] [CommRing B] [Algebra A B] classical let ι := Module.Free.ChooseBasisIndex A B let b : Basis ι A B := Module.Free.chooseBasis _ _ - haveI : Fintype ι := inferInstance + have : Fintype ι := inferInstance clear_value ι b simp_rw [Algebra.norm_eq_matrix_det b, Algebra.trace_eq_matrix_trace b] simp only [map_add, map_one, map_smul, Matrix.det_one_add_smul a] diff --git a/Mathlib/RingTheory/OrderOfVanishing/Basic.lean b/Mathlib/RingTheory/OrderOfVanishing/Basic.lean index bf20bae55d0e2e..d02efdebb4f831 100644 --- a/Mathlib/RingTheory/OrderOfVanishing/Basic.lean +++ b/Mathlib/RingTheory/OrderOfVanishing/Basic.lean @@ -218,7 +218,7 @@ theorem ord_of_irreducible {ϖ : R} (hϖ : Irreducible ϖ) : ord R ϖ = 1 := by PrincipalIdealRing.isMaximal_of_irreducible hϖ rw [isSimpleModule_iff_isSimpleModule_of_algebraMap_surjective (S := R ⧸ Ideal.span {ϖ}) Ideal.Quotient.mk_surjective] - letI := Ideal.Quotient.field (Ideal.span {ϖ}) + let := Ideal.Quotient.field (Ideal.span {ϖ}) exact instIsSimpleModule _ end IsPrincipalIdealRing diff --git a/Mathlib/RingTheory/OreLocalization/Ring.lean b/Mathlib/RingTheory/OreLocalization/Ring.lean index b0baae937aea9f..b7435248b22793 100644 --- a/Mathlib/RingTheory/OreLocalization/Ring.lean +++ b/Mathlib/RingTheory/OreLocalization/Ring.lean @@ -99,7 +99,7 @@ instance {R₀} [Semiring R₀] [Module R₀ X] [Module R₀ R] lemma nsmul_eq_nsmul (n : ℕ) (x : X[S⁻¹]) : letI inst := OreLocalization.instModuleOfIsScalarTower (R₀ := ℕ) (R := R) (X := X) (S := S) HSMul.hSMul (self := @instHSMul _ _ inst.toSMul) n x = n • x := by - letI inst := OreLocalization.instModuleOfIsScalarTower (R₀ := ℕ) (R := R) (X := X) (S := S) + let inst := OreLocalization.instModuleOfIsScalarTower (R₀ := ℕ) (R := R) (X := X) (S := S) exact congr($(AddCommMonoid.uniqueNatModule.2 inst).smul n x) /-- The ring homomorphism from `R` to `R[S⁻¹]`, mapping `r : R` to the fraction `r /ₒ 1`. -/ @@ -185,7 +185,7 @@ instance : Ring R[S⁻¹] where lemma zsmul_eq_zsmul (n : ℤ) (x : X[S⁻¹]) : letI inst := OreLocalization.instModuleOfIsScalarTower (R₀ := ℤ) (R := R) (X := X) (S := S) HSMul.hSMul (self := @instHSMul _ _ inst.toSMul) n x = n • x := by - letI inst := OreLocalization.instModuleOfIsScalarTower (R₀ := ℤ) (R := R) (X := X) (S := S) + let inst := OreLocalization.instModuleOfIsScalarTower (R₀ := ℤ) (R := R) (X := X) (S := S) exact congr($(AddCommGroup.uniqueIntModule.2 inst).smul n x) open nonZeroDivisors diff --git a/Mathlib/RingTheory/OrzechProperty.lean b/Mathlib/RingTheory/OrzechProperty.lean index 8e6baa2b9e669a..facc0d1a7bd74d 100644 --- a/Mathlib/RingTheory/OrzechProperty.lean +++ b/Mathlib/RingTheory/OrzechProperty.lean @@ -80,11 +80,11 @@ theorem injective_of_surjective_of_injective {N : Type w} [AddCommMonoid N] [Module R N] (i f : N →ₗ[R] M) (hi : Injective i) (hf : Surjective f) : Injective f := by obtain ⟨n, g, hg⟩ := Module.Finite.exists_fin' R M - haveI := small_of_surjective hg - letI := Equiv.addCommMonoid (equivShrink M).symm - letI := Equiv.module R (equivShrink M).symm + have := small_of_surjective hg + let := Equiv.addCommMonoid (equivShrink M).symm + let := Equiv.module R (equivShrink M).symm let j : Shrink.{u} M ≃ₗ[R] M := Equiv.linearEquiv R (equivShrink M).symm - haveI := Module.Finite.equiv j.symm + have := Module.Finite.equiv j.symm let i' := j.symm.toLinearMap ∘ₗ i replace hi : Injective i' := by simpa [i'] using hi let f' := j.symm.toLinearMap ∘ₗ f ∘ₗ (LinearEquiv.ofInjective i' hi).symm.toLinearMap diff --git a/Mathlib/RingTheory/Perfection.lean b/Mathlib/RingTheory/Perfection.lean index a8705f4554fb14..c841ec2ffa7d45 100644 --- a/Mathlib/RingTheory/Perfection.lean +++ b/Mathlib/RingTheory/Perfection.lean @@ -809,8 +809,8 @@ include hv theorem isDomain : IsDomain (PreTilt O p) := by have hp : Nat.Prime p := Fact.out - haveI : Nontrivial (PreTilt O p) := ⟨(CharP.nontrivial_of_char_ne_one hp.ne_one).1⟩ - haveI : NoZeroDivisors (PreTilt O p) := + have : Nontrivial (PreTilt O p) := ⟨(CharP.nontrivial_of_char_ne_one hp.ne_one).1⟩ + have : NoZeroDivisors (PreTilt O p) := ⟨fun hfg => by simp_rw [← map_eq_zero hv] at hfg ⊢; contrapose! hfg; rw [Valuation.map_mul] exact mul_ne_zero hfg.1 hfg.2⟩ diff --git a/Mathlib/RingTheory/PiTensorProduct.lean b/Mathlib/RingTheory/PiTensorProduct.lean index df1663a1d5ae85..d83268dbd3e17c 100644 --- a/Mathlib/RingTheory/PiTensorProduct.lean +++ b/Mathlib/RingTheory/PiTensorProduct.lean @@ -276,9 +276,9 @@ noncomputable def constantBaseRingEquiv : (⨂[R] _ : ι, R) ≃ₐ[R] R := ((lift.tprod _).trans Finset.prod_const_one) (by -- one of these is required, the other is a performance optimization - letI : IsScalarTower R (⨂[R] x : ι, R) (⨂[R] x : ι, R) := + let : IsScalarTower R (⨂[R] x : ι, R) (⨂[R] x : ι, R) := IsScalarTower.right (R := R) (A := ⨂[R] (x : ι), R) - letI : SMulCommClass R (⨂[R] x : ι, R) (⨂[R] x : ι, R) := + let : SMulCommClass R (⨂[R] x : ι, R) (⨂[R] x : ι, R) := Algebra.to_smulCommClass (R := R) (A := ⨂[R] x : ι, R) rw [LinearMap.map_mul_iff] ext diff --git a/Mathlib/RingTheory/Polynomial/Basic.lean b/Mathlib/RingTheory/Polynomial/Basic.lean index bc3e957ea17a99..d52a25d2cc4d2d 100644 --- a/Mathlib/RingTheory/Polynomial/Basic.lean +++ b/Mathlib/RingTheory/Polynomial/Basic.lean @@ -815,7 +815,7 @@ protected theorem Polynomial.isNoetherianRing [inst : IsNoetherianRing R] : IsNo refine (mul_one _).symm.trans ?_ rw [← h, mul_zero] rfl - haveI : Nontrivial R := ⟨⟨0, 1, this⟩⟩ + have : Nontrivial R := ⟨⟨0, 1, this⟩⟩ have : p.leadingCoeff ∈ I.leadingCoeffNth N := by rw [HN] exact hm2 k ((I.mem_leadingCoeffNth _ _).2 diff --git a/Mathlib/RingTheory/Polynomial/Cyclotomic/Basic.lean b/Mathlib/RingTheory/Polynomial/Cyclotomic/Basic.lean index 05e37ed8dd0363..91c2afa5a82764 100644 --- a/Mathlib/RingTheory/Polynomial/Cyclotomic/Basic.lean +++ b/Mathlib/RingTheory/Polynomial/Cyclotomic/Basic.lean @@ -517,7 +517,7 @@ theorem cyclotomic_prime_pow_eq_geom_sum {R : Type*} [CommRing R] {p n : ℕ} (h rw [eq_comm] at this rw [this, Nat.prod_properDivisors_prime_pow hp] induction n with - | zero => haveI := Fact.mk hp; simp [cyclotomic_prime] + | zero => have := Fact.mk hp; simp [cyclotomic_prime] | succ n_n n_ih => rw [← (eq_cyclotomic_iff (pow_pos hp.pos (n_n + 1 + 1)) _).mpr ?_] rw [Nat.prod_properDivisors_prime_pow hp, Finset.prod_range_succ, n_ih] diff --git a/Mathlib/RingTheory/Polynomial/Cyclotomic/Eval.lean b/Mathlib/RingTheory/Polynomial/Cyclotomic/Eval.lean index eb538bb3c80dae..8171fbd7afb2de 100644 --- a/Mathlib/RingTheory/Polynomial/Cyclotomic/Eval.lean +++ b/Mathlib/RingTheory/Polynomial/Cyclotomic/Eval.lean @@ -50,7 +50,7 @@ theorem eval₂_one_cyclotomic_prime_pow {R S : Type*} [CommRing R] [Semiring S] private theorem cyclotomic_neg_one_pos {n : ℕ} (hn : 2 < n) {R} [CommRing R] [PartialOrder R] [IsStrictOrderedRing R] : 0 < eval (-1 : R) (cyclotomic n R) := by - haveI := NeZero.of_gt hn + have := NeZero.of_gt hn rw [← map_cyclotomic_int, ← Int.cast_one, ← Int.cast_neg, eval_intCast_map, Int.coe_castRingHom, Int.cast_pos] suffices 0 < eval (↑(-1 : ℤ)) (cyclotomic n ℝ) by @@ -146,7 +146,7 @@ theorem eval_one_cyclotomic_not_prime_pow {R : Type*} [Ring R] {n : ℕ} linarith [cyclotomic_nonneg n (le_refl (1 : ℤ))] rw [← Int.natAbs_eq_natAbs_iff, Int.natAbs_one, Nat.eq_one_iff_not_exists_prime_dvd] intro p hp hpe - haveI := Fact.mk hp + have := Fact.mk hp have := prod_cyclotomic_eq_geom_sum hn' ℤ apply_fun eval 1 at this rw [eval_geom_sum, one_geom_sum, eval_prod, eq_comm, ← diff --git a/Mathlib/RingTheory/Polynomial/Cyclotomic/Expand.lean b/Mathlib/RingTheory/Polynomial/Cyclotomic/Expand.lean index 01a6f5ec86d5b5..035a90fba78551 100644 --- a/Mathlib/RingTheory/Polynomial/Cyclotomic/Expand.lean +++ b/Mathlib/RingTheory/Polynomial/Cyclotomic/Expand.lean @@ -40,7 +40,7 @@ theorem cyclotomic_expand_eq_cyclotomic_mul {p n : ℕ} (hp : Nat.Prime p) (hdiv expand R p (cyclotomic n R) = cyclotomic (n * p) R * cyclotomic n R := by rcases Nat.eq_zero_or_pos n with (rfl | hnpos) · simp - haveI := NeZero.of_pos hnpos + have := NeZero.of_pos hnpos suffices expand ℤ p (cyclotomic n ℤ) = cyclotomic (n * p) ℤ * cyclotomic n ℤ by rw [← map_cyclotomic_int, ← map_expand, this, Polynomial.map_mul, map_cyclotomic_int, map_cyclotomic] @@ -89,7 +89,7 @@ theorem cyclotomic_expand_eq_cyclotomic {p n : ℕ} (hp : Nat.Prime p) (hdiv : p [CommRing R] : expand R p (cyclotomic n R) = cyclotomic (n * p) R := by rcases n.eq_zero_or_pos with (rfl | hzero) · simp - haveI := NeZero.of_pos hzero + have := NeZero.of_pos hzero suffices expand ℤ p (cyclotomic n ℤ) = cyclotomic (n * p) ℤ by rw [← map_cyclotomic_int, ← map_expand, this, map_cyclotomic_int] refine eq_of_monic_of_dvd_of_natDegree_le (cyclotomic.monic _ ℤ) @@ -131,7 +131,7 @@ section CharP `cyclotomic (n * p) R = (cyclotomic n R) ^ (p - 1)`. -/ theorem cyclotomic_mul_prime_eq_pow_of_not_dvd (R : Type*) {p n : ℕ} [hp : Fact (Nat.Prime p)] [Ring R] [CharP R p] (hn : ¬p ∣ n) : cyclotomic (n * p) R = cyclotomic n R ^ (p - 1) := by - letI : Algebra (ZMod p) R := ZMod.algebra _ _ + let : Algebra (ZMod p) R := ZMod.algebra _ _ suffices cyclotomic (n * p) (ZMod p) = cyclotomic n (ZMod p) ^ (p - 1) by rw [← map_cyclotomic _ (algebraMap (ZMod p) R), ← map_cyclotomic _ (algebraMap (ZMod p) R), this, Polynomial.map_pow] @@ -145,7 +145,7 @@ theorem cyclotomic_mul_prime_eq_pow_of_not_dvd (R : Type*) {p n : ℕ} [hp : Fac `cyclotomic (n * p) R = (cyclotomic n R) ^ p`. -/ theorem cyclotomic_mul_prime_dvd_eq_pow (R : Type*) {p n : ℕ} [hp : Fact (Nat.Prime p)] [Ring R] [CharP R p] (hn : p ∣ n) : cyclotomic (n * p) R = cyclotomic n R ^ p := by - letI : Algebra (ZMod p) R := ZMod.algebra _ _ + let : Algebra (ZMod p) R := ZMod.algebra _ _ suffices cyclotomic (n * p) (ZMod p) = cyclotomic n (ZMod p) ^ p by rw [← map_cyclotomic _ (algebraMap (ZMod p) R), ← map_cyclotomic _ (algebraMap (ZMod p) R), this, Polynomial.map_pow] diff --git a/Mathlib/RingTheory/Polynomial/Cyclotomic/Roots.lean b/Mathlib/RingTheory/Polynomial/Cyclotomic/Roots.lean index 34cec1230f631d..c0f81b1c22540f 100644 --- a/Mathlib/RingTheory/Polynomial/Cyclotomic/Roots.lean +++ b/Mathlib/RingTheory/Polynomial/Cyclotomic/Roots.lean @@ -98,7 +98,7 @@ private theorem isRoot_cyclotomic_iff' {n : ℕ} {K : Type*} [Field K] {μ : K} theorem isRoot_cyclotomic_iff [NeZero (n : R)] {μ : R} : IsRoot (cyclotomic n R) μ ↔ IsPrimitiveRoot μ n := by have hf : Function.Injective _ := IsFractionRing.injective R (FractionRing R) - haveI : NeZero (n : FractionRing R) := NeZero.nat_of_injective hf + have : NeZero (n : FractionRing R) := NeZero.nat_of_injective hf rw [← isRoot_map_iff hf, ← IsPrimitiveRoot.map_iff_of_injective hf, map_cyclotomic, ← isRoot_cyclotomic_iff'] @@ -137,7 +137,7 @@ theorem cyclotomic_injective [CharZero R] : Function.Injective fun n => cyclotom · rw [cyclotomic_zero] at hnm replace hnm := congr_arg natDegree hnm rwa [natDegree_one, natDegree_cyclotomic, eq_comm, Nat.totient_eq_zero, eq_comm] at hnm - · haveI := NeZero.mk hzero + · have := NeZero.mk hzero rw [← map_cyclotomic_int _ R, ← map_cyclotomic_int _ R] at hnm replace hnm := map_injective (Int.castRingHom R) Int.cast_injective hnm replace hnm := congr_arg (map (Int.castRingHom ℂ)) hnm @@ -145,7 +145,7 @@ theorem cyclotomic_injective [CharZero R] : Function.Injective fun n => cyclotom have hprim := Complex.isPrimitiveRoot_exp _ hzero have hroot := isRoot_cyclotomic_iff (R := ℂ).2 hprim rw [hnm] at hroot - haveI hmzero : NeZero m := ⟨fun h => by simp [h] at hroot⟩ + have hmzero : NeZero m := ⟨fun h => by simp [h] at hroot⟩ rw [isRoot_cyclotomic_iff (R := ℂ)] at hroot replace hprim := hprim.eq_orderOf rwa [← IsPrimitiveRoot.eq_orderOf hroot] at hprim @@ -163,7 +163,7 @@ open IsPrimitiveRoot Complex theorem _root_.IsPrimitiveRoot.minpoly_eq_cyclotomic_of_irreducible {K : Type*} [Field K] {R : Type*} [CommRing R] [IsDomain R] {μ : R} {n : ℕ} [Algebra K R] (hμ : IsPrimitiveRoot μ n) (h : Irreducible <| cyclotomic n K) [NeZero (n : K)] : cyclotomic n K = minpoly K μ := by - haveI := NeZero.of_faithfulSMul K R n + have := NeZero.of_faithfulSMul K R n refine minpoly.eq_of_irreducible_of_monic h ?_ (cyclotomic.monic n K) rwa [aeval_def, eval₂_eq_eval_map, map_cyclotomic, ← IsRoot.def, isRoot_cyclotomic_iff] @@ -221,7 +221,7 @@ coefficients `αᵢ` are equal. This follows from the irreducibility of the `p`- polynomial. See de Launey–Flannery, *Algebraic Design Theory*, Lemma 2.8.5. -/ lemma sum_eq_zero_iff_forall_eq (hp : p.Prime) (hζ : IsPrimitiveRoot ζ p) (α : Fin p → ℚ) : ∑ i, α i * ζ ^ i.val = 0 ↔ ∀ i j, α i = α j := by - haveI : Fact p.Prime := ⟨hp⟩ + have : Fact p.Prime := ⟨hp⟩ let P : ℚ[X] := ∑ i, C (α i) * X ^ i.1 have hP (i : Fin p) : α i = P.coeff i := by simp [P, ← Fin.ext_iff] have hP' : P.degree ≤ ↑(p - 1) := diff --git a/Mathlib/RingTheory/Polynomial/Dickson.lean b/Mathlib/RingTheory/Polynomial/Dickson.lean index 99c6d0c632f322..d9f18bf30d1bac 100644 --- a/Mathlib/RingTheory/Polynomial/Dickson.lean +++ b/Mathlib/RingTheory/Polynomial/Dickson.lean @@ -211,7 +211,7 @@ theorem dickson_one_one_zmod_p (p : ℕ) [Fact p.Prime] : dickson 1 (1 : ZMod p) have : CharP K p := by rw [← f.charP_iff_charP] infer_instance - haveI : Infinite K := + have : Infinite K := Infinite.of_injective (algebraMap (Polynomial (ZMod p)) (FractionRing (Polynomial (ZMod p)))) (IsFractionRing.injective _ _) refine ⟨K, ?_, ?_, ?_⟩ <;> infer_instance diff --git a/Mathlib/RingTheory/Polynomial/Eisenstein/IsIntegral.lean b/Mathlib/RingTheory/Polynomial/Eisenstein/IsIntegral.lean index c8a0f9e6b53d1f..2c6da18b541028 100644 --- a/Mathlib/RingTheory/Polynomial/Eisenstein/IsIntegral.lean +++ b/Mathlib/RingTheory/Polynomial/Eisenstein/IsIntegral.lean @@ -138,7 +138,7 @@ theorem dvd_coeff_zero_of_aeval_eq_prime_smul_of_minpoly_isEisensteinAt {B : Pow (hp : Prime p) (hBint : IsIntegral R B.gen) {z : L} {Q : R[X]} (hQ : aeval B.gen Q = p • z) (hzint : IsIntegral R z) (hei : (minpoly R B.gen).IsEisensteinAt 𝓟) : p ∣ Q.coeff 0 := by -- First define some abbreviations. - letI := B.finite + let := B.finite let P := minpoly R B.gen obtain ⟨n, hn⟩ := Nat.exists_eq_succ_of_ne_zero B.dim_pos.ne' have finrank_K_L : Module.finrank K L = B.dim := B.finrank diff --git a/Mathlib/RingTheory/Polynomial/RationalRoot.lean b/Mathlib/RingTheory/Polynomial/RationalRoot.lean index aac878274cb055..ce4be7bb114adf 100644 --- a/Mathlib/RingTheory/Polynomial/RationalRoot.lean +++ b/Mathlib/RingTheory/Polynomial/RationalRoot.lean @@ -69,7 +69,7 @@ then the numerator of `r` divides the constant coefficient -/ theorem num_dvd_of_is_root {p : A[X]} {r : K} (hr : aeval r p = 0) : num A r ∣ p.coeff 0 := by suffices num A r ∣ (scaleRoots p (den A r)).coeff 0 by simp only [coeff_scaleRoots] at this - haveI inst := Classical.propDecidable + have inst := Classical.propDecidable by_cases hr : num A r = 0 · simp_all [nonZeroDivisors.coe_ne_zero] · refine dvd_of_dvd_mul_left_of_no_prime_factors hr ?_ this diff --git a/Mathlib/RingTheory/Polynomial/Resultant/Basic.lean b/Mathlib/RingTheory/Polynomial/Resultant/Basic.lean index 8ca60864c4d48a..6dfd433663cb7c 100644 --- a/Mathlib/RingTheory/Polynomial/Resultant/Basic.lean +++ b/Mathlib/RingTheory/Polynomial/Resultant/Basic.lean @@ -490,7 +490,7 @@ nonrec lemma resultant_eq_prod_eval [IsDomain R] by_cases hf0 : f = 0 · simp [hf0] wlog hfm : f.Monic - · letI inst := hR.toField + · let inst := hR.toField have H : (C f.leadingCoeff⁻¹ * f).Monic := by rw [Monic, ← coeff_natDegree, natDegree_C_mul (by simp [hf0]), coeff_C_mul]; simp [hf0] have := this (C f.leadingCoeff⁻¹ * f) g n hg (.mul (.C _) hf) hR (by simpa) H @@ -504,12 +504,12 @@ nonrec lemma resultant_eq_prod_eval [IsDomain R] · obtain ⟨r, rfl⟩ := hfm.natDegree_eq_zero.mp hf'; simp simp [← hf.natDegree_eq_card_roots, hf'] wlog hgm : g.Monic - · letI inst := hR.toField + · let inst := hR.toField have := this f (C g.leadingCoeff⁻¹ * g) n (by simpa [hg0, natDegree_C_mul]) hf hR hfm (by simpa) (by rw [Monic, ← coeff_natDegree, natDegree_C_mul (by simp [hg0]), coeff_C_mul]; simp [hg0]) rw [resultant_C_mul_right, inv_pow, inv_mul_eq_iff_eq_mul₀ (by simp [hg0])] at this simpa [← hf.natDegree_eq_card_roots, inv_pow, mul_left_comm (_ ^ g.natDegree), hg0] using this - letI inst := hR.toField + let inst := hR.toField let L := g.SplittingField apply (algebraMap R L).injective have := resultant_eq_prod_roots_sub (f.map (algebraMap R L)) @@ -545,10 +545,10 @@ nonrec lemma induction_of_Splits_of_injective_of_surjective.{u} · exact injective _ _ _ (FaithfulSMul.algebraMap_injective R (FractionRing R)) _ (this _ inferInstance (Field.toIsField _)) wlog hp : p.Splits generalizing R - · letI inst := hR.toField + · let inst := hR.toField exact injective _ _ _ (algebraMap R p.SplittingField).injective _ (this _ inferInstance (Field.toIsField _) (SplittingField.splits _)) - letI inst := hR.toField + let inst := hR.toField exact Splits _ _ hp /-- `Res(f, g₁ * g₂) = Res(f, g₁) * Res(f, g₂)`. -/ diff --git a/Mathlib/RingTheory/Polynomial/ScaleRoots.lean b/Mathlib/RingTheory/Polynomial/ScaleRoots.lean index 1ba2255c027ed2..c4e282e6618058 100644 --- a/Mathlib/RingTheory/Polynomial/ScaleRoots.lean +++ b/Mathlib/RingTheory/Polynomial/ScaleRoots.lean @@ -66,7 +66,7 @@ theorem support_scaleRoots_eq (p : R[X]) {s : R} (hs : s ∈ nonZeroDivisors R) @[simp] theorem degree_scaleRoots (p : R[X]) {s : R} : degree (scaleRoots p s) = degree p := by - haveI := Classical.propDecidable + have := Classical.propDecidable by_cases hp : p = 0 · rw [hp, zero_scaleRoots] refine le_antisymm (Finset.sup_mono (support_scaleRoots_le p s)) (degree_le_degree ?_) diff --git a/Mathlib/RingTheory/Polynomial/SeparableDegree.lean b/Mathlib/RingTheory/Polynomial/SeparableDegree.lean index 85c755c07fd0dc..7bf6632b6fcbae 100644 --- a/Mathlib/RingTheory/Polynomial/SeparableDegree.lean +++ b/Mathlib/RingTheory/Polynomial/SeparableDegree.lean @@ -131,7 +131,7 @@ theorem IsSeparableContraction.degree_eq [hF : ExpChar F q] (g : F[X]) · rcases hg with ⟨hg, m, hm⟩ let g' := Classical.choose hf obtain ⟨hg', m', hm'⟩ := Classical.choose_spec hf - haveI : Fact q.Prime := ⟨by assumption⟩ + have : Fact q.Prime := ⟨by assumption⟩ refine contraction_degree_eq_or_insep q g g' m m' ?_ hg hg' rw [hm, hm'] diff --git a/Mathlib/RingTheory/Polynomial/UniqueFactorization.lean b/Mathlib/RingTheory/Polynomial/UniqueFactorization.lean index 2c4bffb6833eac..4641cfdd30c492 100644 --- a/Mathlib/RingTheory/Polynomial/UniqueFactorization.lean +++ b/Mathlib/RingTheory/Polynomial/UniqueFactorization.lean @@ -90,7 +90,7 @@ open UniqueFactorizationMonoid namespace Polynomial instance (priority := 100) uniqueFactorizationMonoid : UniqueFactorizationMonoid D[X] := by - letI := Classical.arbitrary (NormalizedGCDMonoid D) + let := Classical.arbitrary (NormalizedGCDMonoid D) exact ufm_of_decomposition_of_wfDvdMonoid /-- If `D` is a unique factorization domain, `f` is a non-zero polynomial in `D[X]`, then `f` has diff --git a/Mathlib/RingTheory/Polynomial/UniversalFactorizationRing.lean b/Mathlib/RingTheory/Polynomial/UniversalFactorizationRing.lean index cc868eaae619d9..647ddd0effbdf7 100644 --- a/Mathlib/RingTheory/Polynomial/UniversalFactorizationRing.lean +++ b/Mathlib/RingTheory/Polynomial/UniversalFactorizationRing.lean @@ -292,7 +292,7 @@ lemma universalFactorizationMapPresentation_jacobiMatrix : ((freeMonic R m).map (((mapAlgHom (Algebra.ofId _ _)).comp (rename Sum.inl)).toRingHom)) ((freeMonic R k).map (((mapAlgHom (Algebra.ofId _ _)).comp (rename Sum.inr)).toRingHom)) m k).reindex (finCongr (by lia)) (finCongr (by lia))).transpose := by - letI := (universalFactorizationMap R n m k hn).toAlgebra + let := (universalFactorizationMap R n m k hn).toAlgebra subst hn ext i j : 1 dsimp [Polynomial.sylvester] @@ -310,7 +310,7 @@ lemma universalFactorizationMapPresentation_jacobian : ((freeMonic R k).map Algebra.TensorProduct.includeRight.toRingHom)) := by cases subsingleton_or_nontrivial R · exact Subsingleton.elim _ _ - letI := (universalFactorizationMap R n m k hn).toAlgebra + let := (universalFactorizationMap R n m k hn).toAlgebra rw [Algebra.PreSubmersivePresentation.jacobian_eq_jacobiMatrix_det, MvPolynomial.universalFactorizationMapPresentation_jacobiMatrix] simp only [AlgHom.toRingHom_eq_coe, Matrix.det_neg, Matrix.det_transpose, Matrix.det_reindex_self, @@ -335,10 +335,10 @@ lemma finite_universalFactorizationMap : (universalFactorizationMap R n m k hn).Finite := by refine RingHom.IsIntegral.to_finite ?_ (.of_finitePresentation (finitePresentation_universalFactorizationMap R n m k hn)) - letI := (universalFactorizationMap R n m k hn).toAlgebra + let := (universalFactorizationMap R n m k hn).toAlgebra have : IsDomain (MvPolynomial (Fin m) ℤ ⊗[ℤ] MvPolynomial (Fin k) ℤ) := (MvPolynomial.tensorEquivSum ℤ (Fin m) (Fin k) ℤ).toRingEquiv.isDomain_iff.mpr inferInstance - letI := (universalFactorizationMap ℤ n m k hn).toAlgebra + let := (universalFactorizationMap ℤ n m k hn).toAlgebra let F : MvPolynomial (Fin m) ℤ ⊗[ℤ] MvPolynomial (Fin k) ℤ →ₐ[ℤ] MvPolynomial (Fin m) R ⊗[R] MvPolynomial (Fin k) R := Algebra.TensorProduct.lift @@ -417,8 +417,8 @@ def UniversalFactorizationRing.fromTensor : lemma UniversalFactorizationRing.fromTensor_comp_universalFactorizationMap : (fromTensor m k hn p).comp (MvPolynomial.universalFactorizationMap R n m k hn) = (Algebra.ofId R _).comp ((MvPolynomial.mapEquivMonic R _ n).symm p) := by - letI := (MvPolynomial.universalFactorizationMap R n m k hn).toAlgebra - letI := ((MvPolynomial.mapEquivMonic R _ n).symm p).toAlgebra + let := (MvPolynomial.universalFactorizationMap R n m k hn).toAlgebra + let := ((MvPolynomial.mapEquivMonic R _ n).symm p).toAlgebra exact AlgHom.ext fun x ↦ (Algebra.TensorProduct.tmul_one_eq_one_tmul x).symm lemma UniversalFactorizationRing.fromTensor_comp_universalFactorizationMap' : @@ -465,10 +465,10 @@ def UniversalFactorizationRing.homEquiv : commutes' r := congr($(f.2) r).trans (by simp [MvPolynomial.mapEquivMonic_symm_map_algebraMap]; rfl) } fun _ _ ↦ .all _ _ left_inv f := by - letI := (MvPolynomial.universalFactorizationMap R n m k hn).toAlgebra - letI := ((MvPolynomial.mapEquivMonic R _ n).symm p).toAlgebra - letI := Algebra.compHom S ((MvPolynomial.mapEquivMonic R _ n).symm p).toRingHom - haveI : IsScalarTower (MvPolynomial (Fin n) R) R S := .of_algebraMap_eq' rfl + let := (MvPolynomial.universalFactorizationMap R n m k hn).toAlgebra + let := ((MvPolynomial.mapEquivMonic R _ n).symm p).toAlgebra + let := Algebra.compHom S ((MvPolynomial.mapEquivMonic R _ n).symm p).toRingHom + have : IsScalarTower (MvPolynomial (Fin n) R) R S := .of_algebraMap_eq' rfl have : IsScalarTower R (MvPolynomial (Fin n) R) S := .of_algebraMap_eq fun r ↦ by simp [Algebra.compHom_algebraMap_apply] refine Algebra.TensorProduct.ext (by ext) ?_ @@ -478,8 +478,8 @@ def UniversalFactorizationRing.homEquiv : · ext; simp [MvPolynomial.universalFactorizationMapLiftEquiv, MvPolynomial.mapEquivMonic, UniversalFactorizationRing.factor₂, coeff_freeMonic]; rfl right_inv q := by - letI := (MvPolynomial.universalFactorizationMap R n m k hn).toAlgebra - letI := ((MvPolynomial.mapEquivMonic R _ n).symm p).toAlgebra + let := (MvPolynomial.universalFactorizationMap R n m k hn).toAlgebra + let := ((MvPolynomial.mapEquivMonic R _ n).symm p).toAlgebra simp only [UniversalFactorizationRing, MvPolynomial.mapEquivMonic, AlgHom.toRingHom_eq_coe, Equiv.coe_fn_symm_mk, MvPolynomial.coe_aeval_eq_eval, factor₁, MvPolynomial.universalFactorizationMapLiftEquiv, Equiv.coe_fn_mk, fromTensor, factor₂] @@ -518,8 +518,8 @@ lemma UniversalFactorizationRing.jacobian_resentation : · dsimp [UniversalFactorizationRing]; exact Subsingleton.elim _ _ cases subsingleton_or_nontrivial R · dsimp [UniversalFactorizationRing]; exact Subsingleton.elim _ _ - letI := (MvPolynomial.universalFactorizationMap R n m k hn).toAlgebra - letI := ((MvPolynomial.mapEquivMonic R _ n).symm p).toAlgebra + let := (MvPolynomial.universalFactorizationMap R n m k hn).toAlgebra + let := ((MvPolynomial.mapEquivMonic R _ n).symm p).toAlgebra refine (Algebra.PreSubmersivePresentation.baseChange_jacobian _ _).trans ?_ change fromTensor _ _ _ _ _ = _ rw [MvPolynomial.universalFactorizationMapPresentation_jacobian] diff --git a/Mathlib/RingTheory/PowerSeries/Substitution.lean b/Mathlib/RingTheory/PowerSeries/Substitution.lean index 594ec0f9357e8b..388287f3320eff 100644 --- a/Mathlib/RingTheory/PowerSeries/Substitution.lean +++ b/Mathlib/RingTheory/PowerSeries/Substitution.lean @@ -540,7 +540,7 @@ lemma coeff_one_substInv : P.substInv.coeff 1 = ⅟(P.coeff 1) := by include hP in lemma subst_substInv_left : P.substInv.subst P = X := by - haveI : Invertible (P.substInv.coeff 1) := by simpa using invertibleInvOf + have : Invertible (P.substInv.coeff 1) := by simpa using invertibleInvOf let Q := P.substInv.substInv have hQ : HasSubst Q := HasSubst.substInv P.substInv have eq_aux : P.substInv.subst Q = X := subst_substInv_right P.substInv P.constantCoeff_substInv @@ -580,18 +580,18 @@ lemma HasSubst.substInvOfIsUnit : HasSubst (P.substInvOfIsUnit hP') := by @[simp] lemma coeff_one_substInvOfIsUnit : (P.substInvOfIsUnit hP').coeff 1 = hP'.unit⁻¹ := by - letI := hP'.invertible + let := hP'.invertible rw [substInvOfIsUnit_eq_substInv, coeff_one_substInv] exact Units.mul_eq_one_iff_eq_inv.mp Invertible.invOf_mul_self include hP in lemma subst_substInvOfIsUnit_right : P.subst (substInvOfIsUnit P hP') = X := by - letI := hP'.invertible + let := hP'.invertible rw [P.substInvOfIsUnit_eq_substInv hP', P.subst_substInv_right hP] include hP in lemma subst_substInvOfIsUnit_left : (P.substInvOfIsUnit hP').subst P = X := by - letI := hP'.invertible + let := hP'.invertible rw [P.substInvOfIsUnit_eq_substInv hP', P.subst_substInv_left hP] end IsUnit diff --git a/Mathlib/RingTheory/PrincipalIdealDomain.lean b/Mathlib/RingTheory/PrincipalIdealDomain.lean index b0e4c092c9bd35..e8fcb4a82691f8 100644 --- a/Mathlib/RingTheory/PrincipalIdealDomain.lean +++ b/Mathlib/RingTheory/PrincipalIdealDomain.lean @@ -482,7 +482,7 @@ theorem Prime.coprime_iff_not_dvd {p n : R} (hp : Prime p) : IsCoprime p n ↔ theorem exists_associated_pow_of_mul_eq_pow' {a b c : R} (hab : IsCoprime a b) {k : ℕ} (h : a * b = c ^ k) : ∃ d : R, Associated (d ^ k) a := by classical - letI := IsBezout.toGCDDomain R + let := IsBezout.toGCDDomain R exact exists_associated_pow_of_mul_eq_pow ((gcd_isUnit_iff _ _).mpr hab) h theorem exists_associated_pow_of_associated_pow_mul {a b c : R} (hab : IsCoprime a b) {k : ℕ} diff --git a/Mathlib/RingTheory/RingHom/Finite.lean b/Mathlib/RingTheory/RingHom/Finite.lean index 0f28149a7f48b5..d1cb1140d4587e 100644 --- a/Mathlib/RingTheory/RingHom/Finite.lean +++ b/Mathlib/RingTheory/RingHom/Finite.lean @@ -63,10 +63,10 @@ variable [Algebra R R'] [Algebra S S'] /-- If `S` is a finite `R`-algebra, then `S' = M⁻¹S` is a finite `R' = M⁻¹R`-algebra. -/ theorem RingHom.finite_localizationPreserves : RingHom.LocalizationPreserves @RingHom.Finite := by introv R hf - letI := f.toAlgebra - letI := ((algebraMap S S').comp f).toAlgebra + let := f.toAlgebra + let := ((algebraMap S S').comp f).toAlgebra let f' : R' →+* S' := IsLocalization.map S' f (Submonoid.le_comap_map M) - letI := f'.toAlgebra + let := f'.toAlgebra have : IsScalarTower R R' S' := IsScalarTower.of_algebraMap_eq' (IsLocalization.map_comp M.le_comap_map).symm have : IsScalarTower R S S' := IsScalarTower.of_algebraMap_eq' rfl @@ -88,12 +88,12 @@ theorem RingHom.finite_ofLocalizationSpan : RingHom.OfLocalizationSpan @RingHom. rw [RingHom.ofLocalizationSpan_iff_finite] introv R hs H -- We first setup the instances - letI := f.toAlgebra - letI := fun r : s => (Localization.awayMap f r).toAlgebra + let := f.toAlgebra + let := fun r : s => (Localization.awayMap f r).toAlgebra have (r : s) : IsLocalization ((Submonoid.powers (r : R)).map (algebraMap R S)) (Localization.Away (f r)) := by rw [Submonoid.map_powers]; exact Localization.isLocalization - haveI : ∀ r : s, IsScalarTower R (Localization.Away (r : R)) (Localization.Away (f r)) := + have : ∀ r : s, IsScalarTower R (Localization.Away (r : R)) (Localization.Away (f r)) := fun r => IsScalarTower.of_algebraMap_eq' (IsLocalization.map_comp (Submonoid.powers (r : R)).le_comap_map).symm -- By the hypothesis, we may find a finite generating set for each `Sᵣ`. This set can then be diff --git a/Mathlib/RingTheory/RingHom/Integral.lean b/Mathlib/RingTheory/RingHom/Integral.lean index 2ff7ff779b31bd..495900ac63e75d 100644 --- a/Mathlib/RingTheory/RingHom/Integral.lean +++ b/Mathlib/RingTheory/RingHom/Integral.lean @@ -44,12 +44,12 @@ open Polynomial in theorem isIntegral_ofLocalizationSpan : OfLocalizationSpan (RingHom.IsIntegral ·) := by introv R hs H r - letI := f.toAlgebra + let := f.toAlgebra change r ∈ (integralClosure R S).toSubmodule apply Submodule.mem_of_span_eq_top_of_smul_pow_mem _ s hs rintro ⟨t, ht⟩ - letI := (Localization.awayMap f t).toAlgebra - haveI : IsScalarTower R (Localization.Away t) (Localization.Away (f t)) := .of_algebraMap_eq' + let := (Localization.awayMap f t).toAlgebra + have : IsScalarTower R (Localization.Away t) (Localization.Away (f t)) := .of_algebraMap_eq' (IsLocalization.lift_comp _).symm have : _root_.IsIntegral (Localization.Away t) (algebraMap S (Localization.Away (f t)) r) := H ⟨t, ht⟩ (algebraMap _ _ r) diff --git a/Mathlib/RingTheory/RingHom/Locally.lean b/Mathlib/RingTheory/RingHom/Locally.lean index cc1a4f61fe5336..12c4aefc52ef3c 100644 --- a/Mathlib/RingTheory/RingHom/Locally.lean +++ b/Mathlib/RingTheory/RingHom/Locally.lean @@ -160,7 +160,7 @@ lemma locally_ofLocalizationSpanTarget (hP : RespectsIso P) : refine ⟨(a : s) × t a, IsLocalization.Away.mulNumerator s t, IsLocalization.Away.span_range_mulNumerator_eq_top hsone htone, fun ⟨a, b⟩ ↦ Localization.Away b.val, inferInstance, inferInstance, fun ⟨a, b⟩ ↦ ?_, ?_⟩ - · haveI : IsLocalization.Away ((algebraMap S (Localization.Away a.val)) + · have : IsLocalization.Away ((algebraMap S (Localization.Away a.val)) (IsLocalization.Away.sec a.val b.val).1) (Localization.Away b.val) := by apply IsLocalization.Away.of_associated (r := b.val) rw [← IsLocalization.Away.sec_spec] @@ -202,7 +202,7 @@ lemma locally_holdsForLocalizationAway (hPa : HoldsForLocalizationAway P) : simp only [Set.mem_singleton_iff, forall_eq, Ideal.span_singleton_one, exists_const] let e : S ≃ₐ[R] (Localization.Away (1 : S)) := (IsLocalization.atUnits S (Submonoid.powers 1) (by simp)).restrictScalars R - haveI : IsLocalization.Away r (Localization.Away (1 : S)) := + have : IsLocalization.Away r (Localization.Away (1 : S)) := IsLocalization.isLocalization_of_algEquiv (Submonoid.powers r) e rw [← IsScalarTower.algebraMap_eq] apply hPa _ r @@ -254,18 +254,18 @@ lemma locally_stableUnderCompositionWithLocalizationAwayTarget refine ⟨algebraMap S T '' s, ?_, ?_⟩ · rw [← Ideal.map_span, hsone, Ideal.map_top] · rintro - ⟨a, ha, rfl⟩ - letI : Algebra (Localization.Away a) (Localization.Away (algebraMap S T a)) := + let : Algebra (Localization.Away a) (Localization.Away (algebraMap S T a)) := (IsLocalization.Away.map _ _ (algebraMap S T) a).toAlgebra have : (algebraMap (Localization.Away a) (Localization.Away (algebraMap S T a))).comp (algebraMap S (Localization.Away a)) = (algebraMap T (Localization.Away (algebraMap S T a))).comp (algebraMap S T) := by simp [algebraMap_toAlgebra, IsLocalization.Away.map] rw [← comp_assoc, ← this, comp_assoc] - haveI : IsScalarTower S (Localization.Away a) (Localization.Away ((algebraMap S T) a)) := by + have : IsScalarTower S (Localization.Away a) (Localization.Away ((algebraMap S T) a)) := by apply IsScalarTower.of_algebraMap_eq intro x simp [algebraMap_toAlgebra, IsLocalization.Away.map, ← IsScalarTower.algebraMap_apply] - haveI : IsLocalization.Away (algebraMap S (Localization.Away a) t) + have : IsLocalization.Away (algebraMap S (Localization.Away a) t) (Localization.Away (algebraMap S T a)) := IsLocalization.Away.commutes _ T ((Localization.Away (algebraMap S T a))) a t apply hPa _ (algebraMap S (Localization.Away a) t) @@ -312,19 +312,19 @@ lemma locally_localizationAwayPreserves (hPl : LocalizationAwayPreserves P) : rw [locally_iff_exists hPl.respectsIso] let rₐ (a : s) : Localization.Away a.val := algebraMap _ _ (f r) let Sₐ (a : s) := Localization.Away (rₐ a) - haveI (a : s) : + have (a : s) : IsLocalization.Away (((algebraMap S (Localization.Away a.val)).comp f) r) (Sₐ a) := inferInstanceAs (IsLocalization.Away (rₐ a) (Sₐ a)) - haveI (a : s) : IsLocalization (Algebra.algebraMapSubmonoid (Localization.Away a.val) + have (a : s) : IsLocalization (Algebra.algebraMapSubmonoid (Localization.Away a.val) (Submonoid.map f (Submonoid.powers r))) (Sₐ a) := by convert! (inferInstance : IsLocalization.Away (rₐ a) (Sₐ a)) simp [rₐ, Algebra.algebraMapSubmonoid] have H (a : s) : Submonoid.powers (f r) ≤ (Submonoid.powers (rₐ a)).comap (algebraMap S (Localization.Away a.val)) := by simp [rₐ, Submonoid.powers_le] - letI (a : s) : Algebra S' (Sₐ a) := + let (a : s) : Algebra S' (Sₐ a) := (IsLocalization.map (Sₐ a) (algebraMap S (Localization.Away a.val)) (H a)).toAlgebra - haveI (a : s) : IsScalarTower S S' (Sₐ a) := + have (a : s) : IsScalarTower S S' (Sₐ a) := IsScalarTower.of_algebraMap_eq' (IsLocalization.map_comp (H a)).symm refine ⟨s, fun a ↦ algebraMap S S' a.val, ?_, Sₐ, inferInstance, inferInstance, fun a ↦ ?_, fun a ↦ ?_⟩ @@ -347,17 +347,17 @@ lemma locally_localizationPreserves (hPl : LocalizationPreserves P) : let Sₐ (a : s) := Localization (Mₐ a) have hM (a : s) : M.map ((algebraMap S (Localization.Away a.val)).comp f) = Mₐ a := (M.map_map _ _).symm - haveI (a : s) : + have (a : s) : IsLocalization (M.map ((algebraMap S (Localization.Away a.val)).comp f)) (Sₐ a) := by rw [hM] infer_instance - haveI (a : s) : + have (a : s) : IsLocalization (Algebra.algebraMapSubmonoid (Localization.Away a.val) (M.map f)) (Sₐ a) := inferInstanceAs <| IsLocalization (Mₐ a) (Sₐ a) - letI (a : s) : Algebra S' (Sₐ a) := + let (a : s) : Algebra S' (Sₐ a) := (IsLocalization.map (Sₐ a) (algebraMap S (Localization.Away a.val)) (M.map f).le_comap_map).toAlgebra - haveI (a : s) : IsScalarTower S S' (Sₐ a) := + have (a : s) : IsScalarTower S S' (Sₐ a) := IsScalarTower.of_algebraMap_eq' (IsLocalization.map_comp (M.map f).le_comap_map).symm refine ⟨s, fun a ↦ algebraMap S S' a.val, ?_, Sₐ, inferInstance, inferInstance, fun a ↦ ?_, fun a ↦ ?_⟩ diff --git a/Mathlib/RingTheory/RingHom/Surjective.lean b/Mathlib/RingTheory/RingHom/Surjective.lean index 96a4740065392f..9b8437a99e13a8 100644 --- a/Mathlib/RingTheory/RingHom/Surjective.lean +++ b/Mathlib/RingTheory/RingHom/Surjective.lean @@ -70,7 +70,7 @@ theorem surjective_localizationPreserves : theorem surjective_ofLocalizationSpan : OfLocalizationSpan surjective := by introv R e H rw [← Set.range_eq_univ, Set.eq_univ_iff_forall] - letI := f.toAlgebra + let := f.toAlgebra intro x apply Submodule.mem_of_span_eq_top_of_smul_pow_mem (LinearMap.range (Algebra.linearMap R S)) s e diff --git a/Mathlib/RingTheory/RingHom/Unramified.lean b/Mathlib/RingTheory/RingHom/Unramified.lean index bd73f63ea5d797..04d1583687db14 100644 --- a/Mathlib/RingTheory/RingHom/Unramified.lean +++ b/Mathlib/RingTheory/RingHom/Unramified.lean @@ -85,7 +85,7 @@ lemma ofLocalizationPrime : intro x let Rₓ := Localization.AtPrime (x.asIdeal.comap f) let Sₓ := Localization.AtPrime x.asIdeal - letI : Algebra Rₓ Sₓ := (Localization.localRingHom _ _ _ rfl).toAlgebra + let : Algebra Rₓ Sₓ := (Localization.localRingHom _ _ _ rfl).toAlgebra have : IsScalarTower R Rₓ Sₓ := .of_algebraMap_eq fun x ↦ (Localization.localRingHom_to_map _ _ _ rfl x).symm have : Algebra.FormallyUnramified Rₓ Sₓ := H _ _ diff --git a/Mathlib/RingTheory/RingHomProperties.lean b/Mathlib/RingTheory/RingHomProperties.lean index 84c8c5b3541f61..45359262e1ec24 100644 --- a/Mathlib/RingTheory/RingHomProperties.lean +++ b/Mathlib/RingTheory/RingHomProperties.lean @@ -166,8 +166,8 @@ set_option backward.isDefEq.respectTransparency false in theorem IsStableUnderBaseChange.pushout_inl (hP : RingHom.IsStableUnderBaseChange @P) (hP' : RingHom.RespectsIso @P) {R S T : CommRingCat} (f : R ⟶ S) (g : R ⟶ T) (H : P g.hom) : P (pushout.inl _ _ : S ⟶ pushout f g).hom := by - letI := f.hom.toAlgebra - letI := g.hom.toAlgebra + let := f.hom.toAlgebra + let := g.hom.toAlgebra rw [← show _ = pushout.inl f g from colimit.isoColimitCocone_ι_inv ⟨_, CommRingCat.pushoutCoconeIsColimit R S T⟩ WalkingSpan.left, CommRingCat.hom_comp, hP'.cancel_right_isIso] diff --git a/Mathlib/RingTheory/RootsOfUnity/Minpoly.lean b/Mathlib/RingTheory/RootsOfUnity/Minpoly.lean index cee6484f6fc28b..7e78dabeb6bb17 100644 --- a/Mathlib/RingTheory/RootsOfUnity/Minpoly.lean +++ b/Mathlib/RingTheory/RootsOfUnity/Minpoly.lean @@ -78,7 +78,7 @@ theorem minpoly_dvd_expand {p : ℕ} (hdiv : ¬p ∣ n) : minpoly ℤ μ ∣ expand ℤ p (minpoly ℤ (μ ^ p)) := by rcases n.eq_zero_or_pos with (rfl | hpos) · simp_all - letI : IsIntegrallyClosed ℤ := GCDMonoid.toIsIntegrallyClosed + let : IsIntegrallyClosed ℤ := GCDMonoid.toIsIntegrallyClosed refine minpoly.isIntegrallyClosed_dvd (h.isIntegral hpos) ?_ rw [aeval_def, coe_expand, ← comp, eval₂_eq_eval_map, map_comp, Polynomial.map_pow, map_X, eval_comp, eval_X_pow, ← eval₂_eq_eval_map, ← aeval_def] @@ -175,7 +175,7 @@ theorem minpoly_eq_pow_coprime {m : ℕ} (hcop : Nat.Coprime m n) : rw [hind h (Nat.Coprime.coprime_mul_left hcop)]; clear hind replace hprime := hprime.nat_prime have hdiv := (Nat.Prime.coprime_iff_not_dvd hprime).1 (Nat.Coprime.coprime_mul_right hcop) - haveI := Fact.mk hprime + have := Fact.mk hprime rw [minpoly_eq_pow (h.pow_of_coprime a (Nat.Coprime.coprime_mul_left hcop)) hdiv] congr 1 ring diff --git a/Mathlib/RingTheory/RootsOfUnity/PrimitiveRoots.lean b/Mathlib/RingTheory/RootsOfUnity/PrimitiveRoots.lean index 7195f3618a935e..dbe8ecc7c6226a 100644 --- a/Mathlib/RingTheory/RootsOfUnity/PrimitiveRoots.lean +++ b/Mathlib/RingTheory/RootsOfUnity/PrimitiveRoots.lean @@ -523,7 +523,7 @@ theorem zpowers_eq {k : ℕ} [NeZero k] {ζ : Rˣ} (h : IsPrimitiveRoot ζ k) : lemma map_rootsOfUnity {S F} [CommRing S] [IsDomain S] [FunLike F R S] [MonoidHomClass F R S] {ζ : R} {n : ℕ} [NeZero n] (hζ : IsPrimitiveRoot ζ n) {f : F} (hf : Function.Injective f) : (rootsOfUnity n R).map (Units.map f) = rootsOfUnity n S := by - letI : CommMonoid Sˣ := inferInstance + let : CommMonoid Sˣ := inferInstance replace hζ := hζ.isUnit_unit NeZero.out rw [← hζ.zpowers_eq, ← (hζ.map_of_injective (Units.map_injective (f := (f : R →* S)) hf)).zpowers_eq, diff --git a/Mathlib/RingTheory/SimpleModule/Basic.lean b/Mathlib/RingTheory/SimpleModule/Basic.lean index cf045c20aa2d96..20361d3251f00c 100644 --- a/Mathlib/RingTheory/SimpleModule/Basic.lean +++ b/Mathlib/RingTheory/SimpleModule/Basic.lean @@ -445,7 +445,7 @@ open LinearMap in /-- A finite product of semisimple rings is semisimple. -/ instance {ι} [Finite ι] (R : ι → Type*) [Π i, Ring (R i)] [∀ i, IsSemisimpleRing (R i)] : IsSemisimpleRing (Π i, R i) := by - letI _ (i) : Module (Π i, R i) (R i) := Module.compHom _ (Pi.evalRingHom R i) + let _ (i) : Module (Π i, R i) (R i) := Module.compHom _ (Pi.evalRingHom R i) let e (i) : R i →ₛₗ[Pi.evalRingHom R i] R i := { AddMonoidHom.id (R i) with map_smul' := fun _ _ ↦ rfl } have (i : _) : IsSemisimpleModule (Π i, R i) (R i) := @@ -455,8 +455,8 @@ instance {ι} [Finite ι] (R : ι → Type*) [Π i, Ring (R i)] [∀ i, IsSemisi set_option backward.isDefEq.respectTransparency false in /-- A binary product of semisimple rings is semisimple. -/ instance [hR : IsSemisimpleRing R] [hS : IsSemisimpleRing S] : IsSemisimpleRing (R × S) := by - letI : Module (R × S) R := Module.compHom _ (.fst R S) - letI : Module (R × S) S := Module.compHom _ (.snd R S) + let : Module (R × S) R := Module.compHom _ (.fst R S) + let : Module (R × S) S := Module.compHom _ (.snd R S) -- e₁, e₂ got falsely flagged by the unused argument linter let _e₁ : R →ₛₗ[.fst R S] R := { AddMonoidHom.id R with map_smul' := fun _ _ ↦ rfl } let _e₂ : S →ₛₗ[.snd R S] S := { AddMonoidHom.id S with map_smul' := fun _ _ ↦ rfl } @@ -468,8 +468,8 @@ instance [hR : IsSemisimpleRing R] [hS : IsSemisimpleRing S] : IsSemisimpleRing theorem RingHom.isSemisimpleRing_of_surjective (f : R →+* S) (hf : Function.Surjective f) [IsSemisimpleRing R] : IsSemisimpleRing S := by - letI : Module R S := Module.compHom _ f - haveI : RingHomSurjective f := ⟨hf⟩ + let : Module R S := Module.compHom _ f + have : RingHomSurjective f := ⟨hf⟩ let e : S →ₛₗ[f] S := { AddMonoidHom.id S with map_smul' := fun _ _ ↦ rfl } rw [IsSemisimpleRing, ← e.isSemisimpleModule_iff_of_bijective Function.bijective_id] infer_instance diff --git a/Mathlib/RingTheory/Smooth/Basic.lean b/Mathlib/RingTheory/Smooth/Basic.lean index 54640dfe993ab0..4a78899f4fded7 100644 --- a/Mathlib/RingTheory/Smooth/Basic.lean +++ b/Mathlib/RingTheory/Smooth/Basic.lean @@ -332,7 +332,7 @@ Geometric intuition: we require that a first-order thickening of `Spec A` inside a retraction. -/ theorem iff_split_surjection (f : P →ₐ[R] A) (hf : Function.Surjective f) : FormallySmooth R A ↔ ∃ g, f.kerSquareLift.comp g = AlgHom.id R A := by - letI := f.toAlgebra + let := f.toAlgebra rw [iff_split_injection hf, ← nonempty_subtype, ← nonempty_subtype, (retractionKerCotangentToTensorEquivSection hf).nonempty_congr] rfl @@ -410,7 +410,7 @@ variable (B : Type*) [CommRing B] [Algebra R B] [Algebra A B] [IsScalarTower R A theorem comp [FormallySmooth R A] [FormallySmooth A B] : FormallySmooth R B := by refine .of_comp_surjective fun C _ _ I hI f ↦ ?_ obtain ⟨f', e⟩ := FormallySmooth.comp_surjective _ _ I hI (f.comp (IsScalarTower.toAlgHom R A B)) - letI := f'.toRingHom.toAlgebra + let := f'.toRingHom.toAlgebra obtain ⟨f'', e'⟩ := comp_surjective _ _ I hI { f with commutes' := AlgHom.congr_fun e.symm } apply_fun AlgHom.restrictScalars R at e' exact ⟨f''.restrictScalars _, e'.trans (AlgHom.ext fun _ => rfl)⟩ @@ -460,8 +460,8 @@ variable (B : Type*) [CommRing B] [Algebra R B] instance [FormallySmooth R A] : FormallySmooth B (B ⊗[R] A) := by refine .of_comp_surjective fun C _ _ I hI f ↦ ?_ - letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra - haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl + let := ((algebraMap B C).comp (algebraMap R B)).toAlgebra + have : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl refine ⟨TensorProduct.productLeftAlgHom (Algebra.ofId B C) ?_, ?_⟩ · exact FormallySmooth.lift I ⟨2, hI⟩ ((f.restrictScalars R).comp TensorProduct.includeRight) · apply AlgHom.restrictScalars_injective R @@ -502,8 +502,8 @@ instance [FormallySmooth R A] (M : Submonoid A) : FormallySmooth R (Localization theorem localization_base [FormallySmooth R Sₘ] : FormallySmooth Rₘ Sₘ := by refine .of_comp_surjective fun Q _ _ I e f ↦ ?_ - letI := ((algebraMap Rₘ Q).comp (algebraMap R Rₘ)).toAlgebra - letI : IsScalarTower R Rₘ Q := IsScalarTower.of_algebraMap_eq' rfl + let := ((algebraMap Rₘ Q).comp (algebraMap R Rₘ)).toAlgebra + let : IsScalarTower R Rₘ Q := IsScalarTower.of_algebraMap_eq' rfl let f : Sₘ →ₐ[Rₘ] Q := by refine { FormallySmooth.lift I ⟨2, e⟩ (f.restrictScalars R) with commutes' := ?_ } intro r @@ -521,8 +521,8 @@ theorem localization_base [FormallySmooth R Sₘ] : FormallySmooth Rₘ Sₘ := simp [f] theorem localization_map [FormallySmooth R A] : FormallySmooth Rₘ Sₘ := by - haveI : FormallySmooth A Sₘ := FormallySmooth.of_isLocalization (M.map (algebraMap R A)) - haveI : FormallySmooth R Sₘ := FormallySmooth.comp R A Sₘ + have : FormallySmooth A Sₘ := FormallySmooth.of_isLocalization (M.map (algebraMap R A)) + have : FormallySmooth R Sₘ := FormallySmooth.comp R A Sₘ exact FormallySmooth.localization_base M end Localization diff --git a/Mathlib/RingTheory/Smooth/Kaehler.lean b/Mathlib/RingTheory/Smooth/Kaehler.lean index a183f5d5c81e51..ab6c8d22956433 100644 --- a/Mathlib/RingTheory/Smooth/Kaehler.lean +++ b/Mathlib/RingTheory/Smooth/Kaehler.lean @@ -88,7 +88,7 @@ include hf' hg lemma isScalarTower_of_section_of_ker_sqZero : letI := g.toRingHom.toAlgebra; IsScalarTower P S (RingHom.ker (algebraMap P S)) := by - letI := g.toRingHom.toAlgebra + let := g.toRingHom.toAlgebra constructor intro p s m ext @@ -116,8 +116,8 @@ def retractionOfSectionOfKerSqZero : S ⊗[P] Ω[P⁄R] →ₗ[P] RingHom.ker (a lemma retractionOfSectionOfKerSqZero_tmul_D (s : S) (t : P) : retractionOfSectionOfKerSqZero g hf' hg (s ⊗ₜ .D _ _ t) = g s * t - g s * g (algebraMap _ _ t) := by - letI := g.toRingHom.toAlgebra - haveI := isScalarTower_of_section_of_ker_sqZero g hf' hg + let := g.toRingHom.toAlgebra + have := isScalarTower_of_section_of_ker_sqZero g hf' hg simp only [retractionOfSectionOfKerSqZero, LinearMap.coe_restrictScalars, LinearMap.liftBaseChange_tmul, SetLike.val_smul_of_tower] -- The issue is a mismatch between `RingHom.ker (algebraMap P S)` and @@ -376,7 +376,7 @@ lemma CotangentSpace.map_toInfinitesimal_bijective (P : Extension.{u} R S) : suffices CotangentSpace.map P.toInfinitesimal = (tensorKaehlerQuotKerSqEquiv _ _ _).symm.toLinearMap by rw [this]; exact (tensorKaehlerQuotKerSqEquiv _ _ _).symm.bijective - letI : Algebra P.Ring P.infinitesimal.Ring := inferInstanceAs (Algebra P.Ring (P.Ring ⧸ _)) + let : Algebra P.Ring P.infinitesimal.Ring := inferInstanceAs (Algebra P.Ring (P.Ring ⧸ _)) have : IsScalarTower P.Ring P.infinitesimal.Ring S := .of_algebraMap_eq' rfl apply LinearMap.restrictScalars_injective P.Ring ext x a diff --git a/Mathlib/RingTheory/Smooth/StandardSmoothCotangent.lean b/Mathlib/RingTheory/Smooth/StandardSmoothCotangent.lean index ae194ff26df03b..e793f5a4f983c4 100644 --- a/Mathlib/RingTheory/Smooth/StandardSmoothCotangent.lean +++ b/Mathlib/RingTheory/Smooth/StandardSmoothCotangent.lean @@ -329,7 +329,7 @@ instance IsStandardSmoothOfRelativeDimension.subsingleton_kaehlerDifferential [IsStandardSmoothOfRelativeDimension 0 R S] : Subsingleton Ω[S⁄R] := by cases subsingleton_or_nontrivial S · exact Module.subsingleton S _ - haveI : IsStandardSmooth R S := IsStandardSmoothOfRelativeDimension.isStandardSmooth 0 + have : IsStandardSmooth R S := IsStandardSmoothOfRelativeDimension.isStandardSmooth 0 exact Module.subsingleton_of_rank_zero (IsStandardSmoothOfRelativeDimension.rank_kaehlerDifferential 0) diff --git a/Mathlib/RingTheory/Spectrum/Prime/FreeLocus.lean b/Mathlib/RingTheory/Spectrum/Prime/FreeLocus.lean index 50ad1fe06dcaa0..6aa5cc8f74220b 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/FreeLocus.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/FreeLocus.lean @@ -91,7 +91,7 @@ lemma comap_freeLocus_le {A} [CommRing A] [Algebra R A] : let Aₚ := Localization.AtPrime p.asIdeal rw [Set.mem_preimage, mem_freeLocus_iff_tensor _ Rₚ] at hp rw [mem_freeLocus_iff_tensor _ Aₚ] - letI algebra : Algebra Rₚ Aₚ := (Localization.localRingHom + let algebra : Algebra Rₚ Aₚ := (Localization.localRingHom (comap (algebraMap R A) p).asIdeal p.asIdeal (algebraMap R A) rfl).toAlgebra have : IsScalarTower R Rₚ Aₚ := IsScalarTower.of_algebraMap_eq' (by simp [Rₚ, Aₚ, algebra, RingHom.algebraMap_toAlgebra, Localization.localRingHom, @@ -110,7 +110,7 @@ lemma freeLocus_localization (S : Submonoid R) : p.isPrime.ne_top (Ideal.eq_top_of_isUnit_mem _ H (IsLocalization.map_units _ ⟨x, hx⟩)) let Rₚ := Localization.AtPrime p' let Mₚ := LocalizedModule p'.primeCompl M - letI : Algebra (Localization S) Rₚ := + let : Algebra (Localization S) Rₚ := IsLocalization.localizationAlgebraOfSubmonoidLe _ _ S p'.primeCompl hp' have : IsScalarTower R (Localization S) Rₚ := IsLocalization.localization_isScalarTower_of_submonoid_le .. @@ -124,7 +124,7 @@ lemma freeLocus_localization (S : Submonoid R) : refine ⟨algebraMap _ _ s.1, x, fun H ↦ hx ?_, by simp⟩ rw [IsLocalization.mk'_eq_mul_mk'_one] exact Ideal.mul_mem_right _ _ H - letI : Module (Localization S) Mₚ := Module.compHom Mₚ (algebraMap _ Rₚ) + let : Module (Localization S) Mₚ := Module.compHom Mₚ (algebraMap _ Rₚ) have : IsScalarTower R (Localization S) Mₚ := ⟨fun r r' m ↦ show algebraMap _ Rₚ (r • r') • m = _ by simp [p', Rₚ, Mₚ, Algebra.smul_def, ← IsScalarTower.algebraMap_apply, mul_smul]; rfl⟩ @@ -197,11 +197,11 @@ lemma isLocallyConstant_rankAtStalk_freeLocus [Module.FinitePresentation R M] : simpa [Submonoid.powers_le, Ideal.primeCompl] let Rₚ := Localization.AtPrime p.asIdeal let Mₚ := LocalizedModule p.asIdeal.primeCompl M - letI : Algebra (Localization.Away f) Rₚ := + let : Algebra (Localization.Away f) Rₚ := IsLocalization.localizationAlgebraOfSubmonoidLe _ _ (.powers f) p.asIdeal.primeCompl hp' have : IsScalarTower R (Localization.Away f) Rₚ := IsLocalization.localization_isScalarTower_of_submonoid_le .. - letI : Module (Localization.Away f) Mₚ := Module.compHom Mₚ (algebraMap _ Rₚ) + let : Module (Localization.Away f) Mₚ := Module.compHom Mₚ (algebraMap _ Rₚ) have : IsScalarTower R (Localization.Away f) Mₚ := ⟨fun r r' m ↦ show algebraMap _ Rₚ (r • r') • m = _ by simp [Rₚ, Mₚ, Algebra.smul_def, ← IsScalarTower.algebraMap_apply, mul_smul]; rfl⟩ diff --git a/Mathlib/RingTheory/Spectrum/Prime/Topology.lean b/Mathlib/RingTheory/Spectrum/Prime/Topology.lean index 6a73b5aede0902..9d42b9f5ad0864 100644 --- a/Mathlib/RingTheory/Spectrum/Prime/Topology.lean +++ b/Mathlib/RingTheory/Spectrum/Prime/Topology.lean @@ -220,7 +220,7 @@ theorem t1Space_iff_isField [IsDomain R] : T1Space (PrimeSpectrum R) ↔ IsField (by simp)) · refine ⟨fun x => (isClosed_singleton_iff_isMaximal x).2 ?_⟩ by_cases hx : x.asIdeal = ⊥ - · letI := h.toSemifield + · let := h.toSemifield exact hx.symm ▸ Ideal.bot_isMaximal · exact absurd h (Ring.not_isField_iff_exists_prime.2 ⟨x.asIdeal, ⟨hx, x.2⟩⟩) @@ -660,7 +660,7 @@ lemma range_comap_algebraMap_localization_compl_eq_range_comap_quotientMk letI := (mapRingHom (algebraMap R (Away c))).toAlgebra (range (comap (algebraMap R[X] (Away c)[X])))ᶜ = range (comap (mapRingHom (Ideal.Quotient.mk (.span {c})))) := by - letI := (mapRingHom (algebraMap R (Away c))).toAlgebra + let := (mapRingHom (algebraMap R (Away c))).toAlgebra have := Polynomial.isLocalization (.powers c) (Away c) rw [Submonoid.map_powers] at this have surj : Function.Surjective (mapRingHom (Ideal.Quotient.mk (.span {c}))) := diff --git a/Mathlib/RingTheory/SurjectiveOnStalks.lean b/Mathlib/RingTheory/SurjectiveOnStalks.lean index 7c1ee5de1a3fbb..5e13b5ab1860a3 100644 --- a/Mathlib/RingTheory/SurjectiveOnStalks.lean +++ b/Mathlib/RingTheory/SurjectiveOnStalks.lean @@ -200,7 +200,7 @@ private lemma SurjectiveOnStalks.tensorProductMap_id {S' : Type*} [CommRing S'] [Algebra R S] [Algebra R T] [Algebra R S'] {f : S →ₐ[R] S'} (Hf : f.SurjectiveOnStalks) : (Algebra.TensorProduct.map f (AlgHom.id R T)).SurjectiveOnStalks := by - letI := f.toRingHom.toAlgebra + let := f.toRingHom.toAlgebra have := IsScalarTower.of_algebraMap_eq' f.comp_algebraMap.symm change (Algebra.TensorProduct.map (Algebra.ofId S S') (AlgHom.id R T)).SurjectiveOnStalks convert_to ((Algebra.TensorProduct.cancelBaseChange R S S S' T).toAlgHom.comp diff --git a/Mathlib/RingTheory/TensorProduct/Finite.lean b/Mathlib/RingTheory/TensorProduct/Finite.lean index 9a44ca5362dbec..bc887b9d279e33 100644 --- a/Mathlib/RingTheory/TensorProduct/Finite.lean +++ b/Mathlib/RingTheory/TensorProduct/Finite.lean @@ -161,7 +161,7 @@ private lemma RingHom.Finite.tensorProductMap_id [Algebra R S] [Algebra R T] [Algebra R S'] {f : S →ₐ[R] S'} (Hf : f.Finite) : (Algebra.TensorProduct.map f (AlgHom.id R T)).toRingHom.Finite := by - letI := f.toRingHom.toAlgebra + let := f.toRingHom.toAlgebra have := IsScalarTower.of_algebraMap_eq' f.comp_algebraMap.symm have : Module.Finite S S' := finite_algebraMap.mp Hf change (Algebra.TensorProduct.map (Algebra.ofId S S') (AlgHom.id R T)).Finite diff --git a/Mathlib/RingTheory/TensorProduct/IsBaseChangePi.lean b/Mathlib/RingTheory/TensorProduct/IsBaseChangePi.lean index e972002da41e3a..c1b6dfe3f1630c 100644 --- a/Mathlib/RingTheory/TensorProduct/IsBaseChangePi.lean +++ b/Mathlib/RingTheory/TensorProduct/IsBaseChangePi.lean @@ -80,8 +80,8 @@ instance prodMap {M N M' N' : Type*} (f : M →ₗ[R] M') (g : N →ₗ[R] N') [IsLocalizedModule S f] [IsLocalizedModule S g] : IsLocalizedModule S (f.prodMap g) := by - letI : Module (Localization S) M' := IsLocalizedModule.module S f - letI : Module (Localization S) N' := IsLocalizedModule.module S g + let : Module (Localization S) M' := IsLocalizedModule.module S f + let : Module (Localization S) N' := IsLocalizedModule.module S g rw [isLocalizedModule_iff_isBaseChange S (Localization S)] apply IsBaseChange.prodMap · rw [← isLocalizedModule_iff_isBaseChange S] @@ -95,7 +95,7 @@ instance pi {ι : Type*} [Finite ι] [∀ i, Module R (M i)] [∀ i, Module R (M' i)] (f : ∀ i, M i →ₗ[R] M' i) [∀ i, IsLocalizedModule S (f i)] : IsLocalizedModule S (.pi fun i ↦ f i ∘ₗ .proj i) := by - letI (i : ι) : Module (Localization S) (M' i) := IsLocalizedModule.module S (f i) + let (i : ι) : Module (Localization S) (M' i) := IsLocalizedModule.module S (f i) rw [isLocalizedModule_iff_isBaseChange S (Localization S)] apply IsBaseChange.pi intro i diff --git a/Mathlib/RingTheory/TensorProduct/Maps.lean b/Mathlib/RingTheory/TensorProduct/Maps.lean index bc903ffb8e07dd..69acc938b4f36a 100644 --- a/Mathlib/RingTheory/TensorProduct/Maps.lean +++ b/Mathlib/RingTheory/TensorProduct/Maps.lean @@ -87,8 +87,8 @@ lemma _root_.LinearMap.map_mul_of_map_mul_tmul {f : A ⊗[R] B →ₗ[S] C} (x y : A ⊗[R] B) : f (x * y) = f x * f y := f.map_mul_iff.2 (by -- these instances are needed by the statement of `ext`, but not by the current definition. - letI : Algebra R C := .restrictScalars R S C - letI : IsScalarTower R S C := .restrictScalars R S C + let : Algebra R C := .restrictScalars R S C + let : IsScalarTower R S C := .restrictScalars R S C ext dsimp exact hf _ _ _ _) x y diff --git a/Mathlib/RingTheory/TensorProduct/Nontrivial.lean b/Mathlib/RingTheory/TensorProduct/Nontrivial.lean index a32958caefdce0..93358ea2d6f9e5 100644 --- a/Mathlib/RingTheory/TensorProduct/Nontrivial.lean +++ b/Mathlib/RingTheory/TensorProduct/Nontrivial.lean @@ -30,7 +30,7 @@ theorem nontrivial_of_algebraMap_injective_of_isDomain (R A B : Type*) [CommRing R] [CommRing A] [CommRing B] [Algebra R A] [Algebra R B] (ha : Function.Injective (algebraMap R A)) (hb : Function.Injective (algebraMap R B)) [IsDomain A] [IsDomain B] : Nontrivial (A ⊗[R] B) := by - haveI := ha.isDomain _ + have := ha.isDomain _ let FR := FractionRing R let FA := FractionRing A let FB := FractionRing B @@ -39,7 +39,7 @@ theorem nontrivial_of_algebraMap_injective_of_isDomain let fb : FR →ₐ[R] FB := IsFractionRing.liftAlgHom (g := Algebra.ofId R FB) ((IsFractionRing.injective B FB).comp hb) algebraize_only [fa.toRingHom, fb.toRingHom] - letI : CompatibleSMul FR R FA FB := CompatibleSMul.isScalarTower + let : CompatibleSMul FR R FA FB := CompatibleSMul.isScalarTower exact Algebra.TensorProduct.mapOfCompatibleSMul FR R R FA FB |>.comp (Algebra.TensorProduct.map (IsScalarTower.toAlgHom R A FA) (IsScalarTower.toAlgHom R B FB)) |>.toRingHom.domain_nontrivial diff --git a/Mathlib/RingTheory/Trace/Basic.lean b/Mathlib/RingTheory/Trace/Basic.lean index 071d0cb4105ce0..6a1ebb4d996197 100644 --- a/Mathlib/RingTheory/Trace/Basic.lean +++ b/Mathlib/RingTheory/Trace/Basic.lean @@ -80,7 +80,7 @@ theorem PowerBasis.trace_gen_eq_nextCoeff_minpoly [Nontrivial S] (pb : PowerBasi Algebra.trace K S pb.gen = -(minpoly K pb.gen).nextCoeff := by have d_pos : 0 < pb.dim := PowerBasis.dim_pos pb have d_pos' : 0 < (minpoly K pb.gen).natDegree := by simpa - haveI : Nonempty (Fin pb.dim) := ⟨⟨0, d_pos⟩⟩ + have : Nonempty (Fin pb.dim) := ⟨⟨0, d_pos⟩⟩ rw [trace_eq_matrix_trace pb.basis, trace_eq_neg_charpoly_coeff, charpoly_leftMulMatrix, ← pb.natDegree_minpoly, Fintype.card_fin, ← nextCoeff_of_natDegree_pos d_pos'] @@ -184,8 +184,8 @@ lemma Algebra.trace_eq_of_ringEquiv {A B C : Type*} [CommRing A] [CommRing B] [C classical by_cases h : ∃ s : Finset C, Nonempty (Basis s B C) · obtain ⟨s, ⟨b⟩⟩ := h - letI : Algebra A B := RingHom.toAlgebra e - letI : IsScalarTower A B C := IsScalarTower.of_algebraMap_eq' he.symm + let : Algebra A B := RingHom.toAlgebra e + let : IsScalarTower A B C := IsScalarTower.of_algebraMap_eq' he.symm rw [Algebra.trace_eq_matrix_trace b, Algebra.trace_eq_matrix_trace (b.mapCoeffs e.symm (by simp [Algebra.smul_def, ← he]))] rw [AddMonoidHom.map_trace] @@ -201,7 +201,7 @@ lemma Algebra.trace_eq_of_equiv_equiv {A₁ B₁ A₂ B₂ : Type*} [CommRing A [CommRing A₂] [CommRing B₂] [Algebra A₁ B₁] [Algebra A₂ B₂] (e₁ : A₁ ≃+* A₂) (e₂ : B₁ ≃+* B₂) (he : RingHom.comp (algebraMap A₂ B₂) ↑e₁ = RingHom.comp ↑e₂ (algebraMap A₁ B₁)) (x) : Algebra.trace A₁ B₁ x = e₁.symm (Algebra.trace A₂ B₂ (e₂ x)) := by - letI := (RingHom.comp (e₂ : B₁ →+* B₂) (algebraMap A₁ B₁)).toAlgebra + let := (RingHom.comp (e₂ : B₁ →+* B₂) (algebraMap A₁ B₁)).toAlgebra let e' : B₁ ≃ₐ[A₁] B₂ := { e₂ with commutes' := fun _ ↦ rfl } rw [← Algebra.trace_eq_of_ringEquiv e₁ he, ← Algebra.trace_eq_of_algEquiv e', RingEquiv.symm_apply_apply] @@ -219,8 +219,8 @@ theorem trace_eq_sum_embeddings_gen (pb : PowerBasis K L) (hE : ((minpoly K pb.gen).map (algebraMap K E)).Splits) (hfx : IsSeparable K pb.gen) : algebraMap K E (Algebra.trace K L pb.gen) = (@Finset.univ _ (PowerBasis.AlgHom.fintype pb)).sum fun σ => σ pb.gen := by - letI := Classical.decEq E - letI : Fintype (L →ₐ[K] E) := PowerBasis.AlgHom.fintype pb + let := Classical.decEq E + let : Fintype (L →ₐ[K] E) := PowerBasis.AlgHom.fintype pb rw [pb.trace_gen_eq_sum_roots hE, Fintype.sum_equiv pb.liftEquiv', Finset.sum_mem_multiset, Finset.sum_eq_multiset_sum, Multiset.toFinset_val, Multiset.dedup_eq_self.mpr _, Multiset.map_id] @@ -237,13 +237,13 @@ theorem sum_embeddings_eq_finrank_mul [FiniteDimensional K F] [Algebra.IsSeparab ∑ σ : F →ₐ[K] E, σ (algebraMap L F pb.gen) = finrank L F • (@Finset.univ _ (PowerBasis.AlgHom.fintype pb)).sum fun σ : L →ₐ[K] E => σ pb.gen := by - haveI : FiniteDimensional L F := FiniteDimensional.right K L F - haveI : Algebra.IsSeparable L F := Algebra.isSeparable_tower_top_of_isSeparable K L F - letI : Fintype (L →ₐ[K] E) := PowerBasis.AlgHom.fintype pb + have : FiniteDimensional L F := FiniteDimensional.right K L F + have : Algebra.IsSeparable L F := Algebra.isSeparable_tower_top_of_isSeparable K L F + let : Fintype (L →ₐ[K] E) := PowerBasis.AlgHom.fintype pb rw [Fintype.sum_equiv algHomEquivSigma (fun σ : F →ₐ[K] E => _) fun σ => σ.1 pb.gen, ← Finset.univ_sigma_univ, Finset.sum_sigma, ← Finset.sum_nsmul] · refine Finset.sum_congr rfl fun σ _ => ?_ - letI : Algebra L E := σ.toRingHom.toAlgebra + let : Algebra L E := σ.toRingHom.toAlgebra simp_rw [Finset.sum_const, Finset.card_univ, ← AlgHom.card L F E] · intro σ simp only [algHomEquivSigma, Equiv.coe_fn_mk, AlgHom.restrictDomain, AlgHom.comp_apply, @@ -257,7 +257,7 @@ theorem trace_eq_sum_embeddings [FiniteDimensional K L] [Algebra.IsSeparable K L trace_eq_sum_embeddings_gen E pb (IsAlgClosed.splits _), ← Algebra.smul_def, algebraMap_smul] · exact (sum_embeddings_eq_finrank_mul L E pb).symm - · haveI := Algebra.isSeparable_tower_bot_of_isSeparable K K⟮x⟯ L + · have := Algebra.isSeparable_tower_bot_of_isSeparable K K⟮x⟯ L exact Algebra.IsSeparable.isSeparable K _ theorem trace_eq_sum_automorphisms (x : L) [FiniteDimensional K L] [IsGalois K L] : @@ -463,7 +463,7 @@ theorem det_traceMatrix_ne_zero' [Algebra.IsSeparable K L] : det (traceMatrix K suffices algebraMap K (AlgebraicClosure L) (det (traceMatrix K pb.basis)) ≠ 0 by refine mt (fun ht => ?_) this rw [ht, map_zero] - haveI : FiniteDimensional K L := pb.finite + have : FiniteDimensional K L := pb.finite let e : Fin pb.dim ≃ (L →ₐ[K] AlgebraicClosure L) := (Fintype.equivFinOfCardEq ?_).symm · rw [RingHom.map_det, RingHom.mapMatrix_apply, traceMatrix_eq_embeddingsMatrixReindex_mul_trans K _ _ e, @@ -477,7 +477,7 @@ theorem det_traceMatrix_ne_zero' [Algebra.IsSeparable K L] : det (traceMatrix K theorem det_traceForm_ne_zero [Algebra.IsSeparable K L] [Fintype ι] [DecidableEq ι] (b : Basis ι K L) : det ((traceForm K L).toMatrix b) ≠ 0 := by - haveI : FiniteDimensional K L := b.finiteDimensional_of_finite + have : FiniteDimensional K L := b.finiteDimensional_of_finite let pb : PowerBasis K L := Field.powerBasisOfFiniteOfSeparable _ _ rw [← LinearMap.BilinForm.toMatrix_mul_basis_toMatrix pb.basis b, ← det_comm' (pb.basis.toMatrix_mul_toMatrix_flip b) _, ← Matrix.mul_assoc, det_mul] diff --git a/Mathlib/RingTheory/Trace/Defs.lean b/Mathlib/RingTheory/Trace/Defs.lean index 20bbbbb9f42612..54134b72751ed2 100644 --- a/Mathlib/RingTheory/Trace/Defs.lean +++ b/Mathlib/RingTheory/Trace/Defs.lean @@ -91,7 +91,7 @@ theorem trace_eq_matrix_trace [DecidableEq ι] (b : Basis ι R S) (s : S) : /-- If `x` is in the base field `K`, then the trace is `[L : K] * x`. -/ theorem trace_algebraMap_of_basis (b : Basis ι R S) (x : R) : trace R S (algebraMap R S x) = Fintype.card ι • x := by - haveI := Classical.decEq ι + have := Classical.decEq ι rw [trace_apply, LinearMap.trace_eq_matrix_trace R b, Matrix.trace] convert! Finset.sum_const x simp [-coe_lmul_eq_mul] @@ -118,8 +118,8 @@ set_option backward.isDefEq.respectTransparency false in theorem trace_trace_of_basis [Algebra S T] [IsScalarTower R S T] {ι κ : Type*} [Finite ι] [Finite κ] (b : Basis ι R S) (c : Basis κ S T) (x : T) : trace R S (trace S T x) = trace R T x := by - haveI := Classical.decEq ι - haveI := Classical.decEq κ + have := Classical.decEq ι + have := Classical.decEq κ cases nonempty_fintype ι cases nonempty_fintype κ rw [trace_eq_matrix_trace (b.smulTower c), trace_eq_matrix_trace b, trace_eq_matrix_trace c, diff --git a/Mathlib/RingTheory/Trace/Quotient.lean b/Mathlib/RingTheory/Trace/Quotient.lean index b54e87e655bc4a..a5c312a83dd7c5 100644 --- a/Mathlib/RingTheory/Trace/Quotient.lean +++ b/Mathlib/RingTheory/Trace/Quotient.lean @@ -93,28 +93,28 @@ lemma Algebra.trace_quotient_eq_of_isDedekindDomain (x) [IsDedekindDomain R] [Is Ideal.Quotient.mk p (Algebra.intTrace R S x) := by let Rₚ := Localization.AtPrime p let Sₚ := Localization (Algebra.algebraMapSubmonoid S p.primeCompl) - letI : Algebra Rₚ Sₚ := localizationAlgebra p.primeCompl S - haveI : IsScalarTower R Rₚ Sₚ := IsScalarTower.of_algebraMap_eq' + let : Algebra Rₚ Sₚ := localizationAlgebra p.primeCompl S + have : IsScalarTower R Rₚ Sₚ := IsScalarTower.of_algebraMap_eq' (by rw [RingHom.algebraMap_toAlgebra, IsLocalization.map_comp, ← IsScalarTower.algebraMap_eq]) - haveI : IsLocalization (Submonoid.map (algebraMap R S) (Ideal.primeCompl p)) Sₚ := + have : IsLocalization (Submonoid.map (algebraMap R S) (Ideal.primeCompl p)) Sₚ := inferInstanceAs (IsLocalization (Algebra.algebraMapSubmonoid S p.primeCompl) Sₚ) have e : Algebra.algebraMapSubmonoid S p.primeCompl ≤ S⁰ := Submonoid.map_le_of_le_comap _ <| p.primeCompl_le_nonZeroDivisors.trans (nonZeroDivisors_le_comap_nonZeroDivisors_of_injective _ (FaithfulSMul.algebraMap_injective _ _)) - haveI : IsDomain Sₚ := IsLocalization.isDomain_of_le_nonZeroDivisors _ e - haveI : IsTorsionFree Rₚ Sₚ := by + have : IsDomain Sₚ := IsLocalization.isDomain_of_le_nonZeroDivisors _ e + have : IsTorsionFree Rₚ Sₚ := by rw [isTorsionFree_iff_algebraMap_injective, RingHom.injective_iff_ker_eq_bot, RingHom.ker_eq_bot_iff_eq_zero] simp - haveI : Module.Finite Rₚ Sₚ := .of_isLocalization R S p.primeCompl - haveI : IsIntegrallyClosed Sₚ := isIntegrallyClosed_of_isLocalization _ _ e + have : Module.Finite Rₚ Sₚ := .of_isLocalization R S p.primeCompl + have : IsIntegrallyClosed Sₚ := isIntegrallyClosed_of_isLocalization _ _ e have : IsPrincipalIdealRing Rₚ := by by_cases hp : p = ⊥ · infer_instance · have := (IsDedekindDomain.isDedekindDomainDvr R).2 p hp inferInstance infer_instance - haveI : Module.Free Rₚ Sₚ := Module.free_of_finite_type_torsion_free' + have : Module.Free Rₚ Sₚ := Module.free_of_finite_type_torsion_free' apply (equivQuotMaximalIdeal p Rₚ).injective rw [trace_quotient_eq_trace_localization_quotient S p Rₚ Sₚ, IsScalarTower.algebraMap_eq S Sₚ, RingHom.comp_apply, Ideal.Quotient.algebraMap_eq, Algebra.trace_quotient_mk, diff --git a/Mathlib/RingTheory/UniqueFactorizationDomain/Basic.lean b/Mathlib/RingTheory/UniqueFactorizationDomain/Basic.lean index 8dd5a1c99d6929..5b22e5d6662b01 100644 --- a/Mathlib/RingTheory/UniqueFactorizationDomain/Basic.lean +++ b/Mathlib/RingTheory/UniqueFactorizationDomain/Basic.lean @@ -88,7 +88,7 @@ theorem prime_factors_unique [CommMonoidWithZero α] [IsCancelMulZero α] : let ⟨b, hbg, hb⟩ := (exists_associated_mem_of_dvd_prod (hf p (by simp)) fun q hq => hg _ hq) <| hfg.dvd_iff_dvd_right.1 (show p ∣ (p ::ₘ f).prod by simp) - haveI := Classical.decEq α + have := Classical.decEq α rw [← Multiset.cons_erase hbg] exact Multiset.Rel.cons hb @@ -122,7 +122,7 @@ end UniqueFactorizationMonoid then it is an associate of one of its prime factors. -/ theorem prime_factors_irreducible [CommMonoidWithZero α] {a : α} {f : Multiset α} (ha : Irreducible a) (pfa : (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a) : ∃ p, a ~ᵤ p ∧ f = {p} := by - haveI := Classical.decEq α + have := Classical.decEq α refine @Multiset.induction_on _ (fun g => (g.prod ~ᵤ a) → (∀ b ∈ g, Prime b) → ∃ p, a ~ᵤ p ∧ g = {p}) f ?_ ?_ pfa.2 pfa.1 · intro h; exact (ha.not_isUnit (associated_one_iff_isUnit.1 (Associated.symm h))).elim diff --git a/Mathlib/RingTheory/UniqueFactorizationDomain/ClassGroup.lean b/Mathlib/RingTheory/UniqueFactorizationDomain/ClassGroup.lean index d71c4fdea1e966..ee5b7a2acd2f8b 100644 --- a/Mathlib/RingTheory/UniqueFactorizationDomain/ClassGroup.lean +++ b/Mathlib/RingTheory/UniqueFactorizationDomain/ClassGroup.lean @@ -35,7 +35,7 @@ namespace NormalizedGCDMonoid lemma isPrincipal_of_exists_mul_ne_zero_isPrincipal {J : Ideal R} (hJ : ∃ K : Ideal R, J * K ≠ 0 ∧ (J * K).IsPrincipal) : J.IsPrincipal := by - letI : NormalizedGCDMonoid R := + let : NormalizedGCDMonoid R := Classical.choice (inferInstance : Nonempty (NormalizedGCDMonoid R)) obtain ⟨K, hJK0, hK⟩ := hJ rcases hK.principal with ⟨x, hJK⟩ diff --git a/Mathlib/RingTheory/UniqueFactorizationDomain/FactorSet.lean b/Mathlib/RingTheory/UniqueFactorizationDomain/FactorSet.lean index 2ec546c11e0d2b..0c9c53795fab29 100644 --- a/Mathlib/RingTheory/UniqueFactorizationDomain/FactorSet.lean +++ b/Mathlib/RingTheory/UniqueFactorizationDomain/FactorSet.lean @@ -356,7 +356,7 @@ theorem dvd_of_mem_factors {a p : Associates α} (hm : p ∈ factors a) : theorem dvd_of_mem_factors' {a : α} {p : Associates α} {hp : Irreducible p} {hz : a ≠ 0} (h_mem : Subtype.mk p hp ∈ factors' a) : p ∣ Associates.mk a := by - haveI := Classical.decEq (Associates α) + have := Classical.decEq (Associates α) apply dvd_of_mem_factors rw [factors_mk _ hz] apply mem_factorSet_some.2 h_mem diff --git a/Mathlib/RingTheory/UniqueFactorizationDomain/GCDMonoid.lean b/Mathlib/RingTheory/UniqueFactorizationDomain/GCDMonoid.lean index abb5e77d5c3859..054f48d2443311 100644 --- a/Mathlib/RingTheory/UniqueFactorizationDomain/GCDMonoid.lean +++ b/Mathlib/RingTheory/UniqueFactorizationDomain/GCDMonoid.lean @@ -73,7 +73,7 @@ noncomputable def UniqueFactorizationMonoid.toNormalizedGCDMonoid (α : Type*) instance (α) [CommMonoidWithZero α] [UniqueFactorizationMonoid α] : Nonempty (NormalizedGCDMonoid α) := by - letI := UniqueFactorizationMonoid.normalizationMonoid (α := α) + let := UniqueFactorizationMonoid.normalizationMonoid (α := α) classical exact ⟨UniqueFactorizationMonoid.toNormalizedGCDMonoid α⟩ end diff --git a/Mathlib/RingTheory/UniqueFactorizationDomain/Multiplicative.lean b/Mathlib/RingTheory/UniqueFactorizationDomain/Multiplicative.lean index 19dca9ea9ba773..c06e277b705693 100644 --- a/Mathlib/RingTheory/UniqueFactorizationDomain/Multiplicative.lean +++ b/Mathlib/RingTheory/UniqueFactorizationDomain/Multiplicative.lean @@ -58,7 +58,7 @@ theorem induction_on_prime_power {P : α → Prop} (s : Finset α) (i : α → (h1 : ∀ {x}, IsUnit x → P x) (hpr : ∀ {p} (i : ℕ), Prime p → P (p ^ i)) (hcp : ∀ {x y}, IsRelPrime x y → P x → P y → P (x * y)) : P (∏ p ∈ s, p ^ i p) := by - letI := Classical.decEq α + let := Classical.decEq α induction s using Finset.induction_on with | empty => simpa using h1 isUnit_one | insert p f' hpf' ih => @@ -76,14 +76,14 @@ then `P` holds on all `a : α`. -/ theorem induction_on_coprime {P : α → Prop} (a : α) (h0 : P 0) (h1 : ∀ {x}, IsUnit x → P x) (hpr : ∀ {p} (i : ℕ), Prime p → P (p ^ i)) (hcp : ∀ {x y}, IsRelPrime x y → P x → P y → P (x * y)) : P a := by - letI := Classical.decEq α + let := Classical.decEq α have P_of_associated : ∀ {x y}, Associated x y → P x → P y := by rintro x y ⟨u, rfl⟩ hx exact hcp (fun p _ hpx => isUnit_of_dvd_unit hpx u.isUnit) hx (h1 u.isUnit) by_cases ha0 : a = 0 · rwa [ha0] - haveI : Nontrivial α := ⟨⟨_, _, ha0⟩⟩ - letI : NormalizationMonoid α := UniqueFactorizationMonoid.normalizationMonoid + have : Nontrivial α := ⟨⟨_, _, ha0⟩⟩ + let : NormalizationMonoid α := UniqueFactorizationMonoid.normalizationMonoid refine P_of_associated (prod_normalizedFactors ha0) ?_ rw [← (normalizedFactors a).map_id, Finset.prod_multiset_map_count] refine induction_on_prime_power _ _ ?_ ?_ @h1 @hpr @hcp <;> simp only [Multiset.mem_toFinset] @@ -98,7 +98,7 @@ theorem multiplicative_prime_power {f : α → β} (s : Finset α) (i j : α → (hpr : ∀ {p} (i : ℕ), Prime p → f (p ^ i) = f p ^ i) (hcp : ∀ {x y}, IsRelPrime x y → f (x * y) = f x * f y) : f (∏ p ∈ s, p ^ (i p + j p)) = f (∏ p ∈ s, p ^ i p) * f (∏ p ∈ s, p ^ j p) := by - letI := Classical.decEq α + let := Classical.decEq α induction s using Finset.induction_on with | empty => simpa using h1 isUnit_one | insert p s hps ih => @@ -118,7 +118,7 @@ theorem multiplicative_of_coprime (f : α → β) (a b : α) (h0 : f 0 = 0) (hpr : ∀ {p} (i : ℕ), Prime p → f (p ^ i) = f p ^ i) (hcp : ∀ {x y}, IsRelPrime x y → f (x * y) = f x * f y) : f (a * b) = f a * f b := by - letI := Classical.decEq α + let := Classical.decEq α by_cases ha0 : a = 0 · rw [ha0, zero_mul, h0, zero_mul] by_cases hb0 : b = 0 @@ -129,8 +129,8 @@ theorem multiplicative_of_coprime (f : α → β) (a b : α) (h0 : f 0 = 0) _ = 0 := by simp only [h1 isUnit_one, hf1, mul_zero] _ = f a * f (b * 1) := by simp only [h1 isUnit_one, hf1, mul_zero] _ = f a * f b := by rw [mul_one] - haveI : Nontrivial α := ⟨⟨_, _, ha0⟩⟩ - letI : NormalizationMonoid α := UniqueFactorizationMonoid.normalizationMonoid + have : Nontrivial α := ⟨⟨_, _, ha0⟩⟩ + let : NormalizationMonoid α := UniqueFactorizationMonoid.normalizationMonoid suffices f (∏ p ∈ (normalizedFactors a).toFinset ∪ (normalizedFactors b).toFinset, p ^ ((normalizedFactors a).count p + (normalizedFactors b).count p)) = diff --git a/Mathlib/RingTheory/UniqueFactorizationDomain/Multiplicity.lean b/Mathlib/RingTheory/UniqueFactorizationDomain/Multiplicity.lean index e0f095c0f440fe..718eadf19275f9 100644 --- a/Mathlib/RingTheory/UniqueFactorizationDomain/Multiplicity.lean +++ b/Mathlib/RingTheory/UniqueFactorizationDomain/Multiplicity.lean @@ -157,7 +157,7 @@ lemma dvd_iff_emultiplicity_le {a b : R} (ha : a ≠ 0) : refine ⟨fun h _ _ ↦ emultiplicity_le_emultiplicity_of_dvd_right h, fun h ↦ ?_⟩ by_cases hb : b = 0 · simp_all - letI : NormalizationMonoid R := UniqueFactorizationMonoid.normalizationMonoid + let : NormalizationMonoid R := UniqueFactorizationMonoid.normalizationMonoid rw [dvd_iff_normalizedFactors_le_normalizedFactors ha hb, Multiset.le_iff_count] intro q by_cases hq : q ∈ normalizedFactors a diff --git a/Mathlib/RingTheory/UniqueFactorizationDomain/NormalizedFactors.lean b/Mathlib/RingTheory/UniqueFactorizationDomain/NormalizedFactors.lean index 3db98f8f11a8b3..ac7caa84fa9aad 100644 --- a/Mathlib/RingTheory/UniqueFactorizationDomain/NormalizedFactors.lean +++ b/Mathlib/RingTheory/UniqueFactorizationDomain/NormalizedFactors.lean @@ -184,7 +184,7 @@ theorem normalizedFactors_prod_eq (s : Multiset α) (hs : ∀ a ∈ s, Irreducib obtain rfl | ⟨b, hb⟩ := s.empty_or_exists_mem · rw [Multiset.cons_zero, Multiset.prod_singleton, Multiset.map_singleton, normalizedFactors_irreducible ia] - haveI := nontrivial_of_ne b 0 (ib b hb).ne_zero + have := nontrivial_of_ne b 0 (ib b hb).ne_zero rw [Multiset.prod_cons, Multiset.map_cons, normalizedFactors_mul ia.ne_zero (Multiset.prod_ne_zero fun h => (ib 0 h).ne_zero rfl), normalizedFactors_irreducible ia, ih ib, Multiset.singleton_add] diff --git a/Mathlib/RingTheory/Unramified/Basic.lean b/Mathlib/RingTheory/Unramified/Basic.lean index e92075346fa9e3..0c33400a02463d 100644 --- a/Mathlib/RingTheory/Unramified/Basic.lean +++ b/Mathlib/RingTheory/Unramified/Basic.lean @@ -73,8 +73,8 @@ variable {B : Type w} [CommRing B] [Algebra R B] (I : Ideal B) theorem comp_injective [FormallyUnramified R A] (hI : I ^ 2 = ⊥) : Function.Injective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I) := by intro f₁ f₂ e - letI := f₁.toRingHom.toAlgebra - haveI := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm + let := f₁.toRingHom.toAlgebra + have := IsScalarTower.of_algebraMap_eq' f₁.comp_algebraMap.symm have := ((KaehlerDifferential.linearMapEquivDerivation R A).toEquiv.trans (derivationToSquareZeroEquivLift I hI)).surjective.subsingleton @@ -220,7 +220,7 @@ theorem comp [FormallyUnramified R A] [FormallyUnramified A B] : have e' := FormallyUnramified.lift_unique I ⟨2, hI⟩ (f₁.comp <| IsScalarTower.toAlgHom R A B) (f₂.comp <| IsScalarTower.toAlgHom R A B) (by rw [← AlgHom.comp_assoc, e, AlgHom.comp_assoc]) - letI := (f₁.restrictDomain A).toAlgebra + let := (f₁.restrictDomain A).toAlgebra let F₁ : B →ₐ[A] C := { f₁ with commutes' := fun r => rfl } let F₂ : B →ₐ[A] C := { f₂ with commutes' := AlgHom.congr_fun e'.symm } ext1 x @@ -231,8 +231,8 @@ theorem comp [FormallyUnramified R A] [FormallyUnramified A B] : theorem of_restrictScalars [FormallyUnramified R B] : FormallyUnramified A B := by rw [iff_comp_injective] intro Q _ _ I e f₁ f₂ e' - letI := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra - letI : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl + let := ((algebraMap A Q).comp (algebraMap R A)).toAlgebra + let : IsScalarTower R A Q := IsScalarTower.of_algebraMap_eq' rfl refine AlgHom.restrictScalars_injective R ?_ refine FormallyUnramified.ext I ⟨2, e⟩ ?_ intro x @@ -278,8 +278,8 @@ instance base_change [FormallyUnramified R A] : FormallyUnramified B (B ⊗[R] A) := by rw [iff_comp_injective] intro C _ _ I hI f₁ f₂ e - letI := ((algebraMap B C).comp (algebraMap R B)).toAlgebra - haveI : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl + let := ((algebraMap B C).comp (algebraMap R B)).toAlgebra + have : IsScalarTower R B C := IsScalarTower.of_algebraMap_eq' rfl ext : 1 exact FormallyUnramified.ext I ⟨2, hI⟩ fun x => AlgHom.congr_fun e (1 ⊗ₜ x) @@ -323,9 +323,9 @@ theorem localization_base [FormallyUnramified R Sₘ] : FormallyUnramified Rₘ theorem localization_map [FormallyUnramified R S] : FormallyUnramified Rₘ Sₘ := by - haveI : FormallyUnramified S Sₘ := + have : FormallyUnramified S Sₘ := FormallyUnramified.of_isLocalization (M.map (algebraMap R S)) - haveI : FormallyUnramified R Sₘ := FormallyUnramified.comp R S Sₘ + have : FormallyUnramified R Sₘ := FormallyUnramified.comp R S Sₘ exact FormallyUnramified.localization_base M end Localization diff --git a/Mathlib/RingTheory/Unramified/Field.lean b/Mathlib/RingTheory/Unramified/Field.lean index 3c67cf6d23e714..f7256c8feb9b05 100644 --- a/Mathlib/RingTheory/Unramified/Field.lean +++ b/Mathlib/RingTheory/Unramified/Field.lean @@ -147,7 +147,7 @@ theorem isReduced_of_field : (Localization.AtPrime M) have := comp (AlgebraicClosure K) (AlgebraicClosure K ⊗[K] A) (Localization.AtPrime M) - letI := (isField_of_isAlgClosed_of_isLocalRing (AlgebraicClosure K) + let := (isField_of_isAlgClosed_of_isLocalRing (AlgebraicClosure K) (A := Localization.AtPrime M)).toField exact hy.eq_zero @@ -234,7 +234,7 @@ theorem Algebra.IsUnramifiedAt.not_minpoly_sq_dvd have := IsArtinianRing.of_finite K (Localization.AtPrime Q) have := Algebra.FormallyUnramified.isReduced_of_field K (Localization.AtPrime Q) IsArtinianRing.isField_of_isReduced_of_isLocalRing _ - letI := this.toField + let := this.toField set q := minpoly K (algebraMap A Q.ResidueField x) have : algebraMap A (Localization.AtPrime Q) (aeval x q) = 0 := by apply (algebraMap (Localization.AtPrime Q) Q.ResidueField).injective diff --git a/Mathlib/RingTheory/Unramified/LocalRing.lean b/Mathlib/RingTheory/Unramified/LocalRing.lean index 96a592af9c44bc..efd3e2940341f6 100644 --- a/Mathlib/RingTheory/Unramified/LocalRing.lean +++ b/Mathlib/RingTheory/Unramified/LocalRing.lean @@ -69,7 +69,7 @@ lemma FormallyUnramified.isField_quotient_map_maximalIdeal [FormallyUnramified R IsField (S ⧸ (maximalIdeal R).map (algebraMap R S)) := by let mR := (maximalIdeal R).map (algebraMap R S) have hmR : mR ≤ maximalIdeal S := ((local_hom_TFAE (algebraMap R S)).out 0 2 rfl rfl).mp ‹_› - letI : Algebra (ResidueField R) (S ⧸ mR) := (inferInstanceAs <| Algebra (R ⧸ _) _) + let : Algebra (ResidueField R) (S ⧸ mR) := (inferInstanceAs <| Algebra (R ⧸ _) _) have : IsScalarTower R (ResidueField R) (S ⧸ mR) := (inferInstanceAs <| IsScalarTower R (R ⧸ _) _) have : FormallyUnramified (ResidueField R) (S ⧸ mR) := .of_restrictScalars R _ _ have : EssFiniteType (ResidueField R) (S ⧸ mR) := .of_comp R _ _ diff --git a/Mathlib/RingTheory/Valuation/ValuationRing.lean b/Mathlib/RingTheory/Valuation/ValuationRing.lean index e82a9b454cd51f..d5f1081b0d5122 100644 --- a/Mathlib/RingTheory/Valuation/ValuationRing.lean +++ b/Mathlib/RingTheory/Valuation/ValuationRing.lean @@ -468,7 +468,7 @@ is a valuation ring. -/ theorem of_integers (v : Valuation K Γ) (hh : v.Integers 𝒪) : haveI := hh.hom_inj.isDomain ValuationRing 𝒪 := by - haveI := hh.hom_inj.isDomain + have := hh.hom_inj.isDomain suffices PreValuationRing 𝒪 from .mk constructor intro a b diff --git a/Mathlib/RingTheory/WittVector/Compare.lean b/Mathlib/RingTheory/WittVector/Compare.lean index f5084263c587bf..ea78a6c16ebf03 100644 --- a/Mathlib/RingTheory/WittVector/Compare.lean +++ b/Mathlib/RingTheory/WittVector/Compare.lean @@ -51,7 +51,7 @@ theorem eq_of_le_of_cast_pow_eq_zero [CharP R p] (i : ℕ) (hin : i ≤ n) rw [this, ne_eq, TruncatedWittVector.ext_iff, not_forall]; clear this use ⟨i, hin⟩ rw [WittVector.coeff_truncate, coeff_zero, Fin.val_mk, WittVector.coeff_p_pow] - haveI : Nontrivial R := CharP.nontrivial_of_char_ne_one hp.1.ne_one + have : Nontrivial R := CharP.nontrivial_of_char_ne_one hp.1.ne_one exact one_ne_zero section Iso diff --git a/Mathlib/RingTheory/WittVector/Frobenius.lean b/Mathlib/RingTheory/WittVector/Frobenius.lean index 83e2d0296f451b..bfddfffd959711 100644 --- a/Mathlib/RingTheory/WittVector/Frobenius.lean +++ b/Mathlib/RingTheory/WittVector/Frobenius.lean @@ -257,7 +257,7 @@ variable [CharP R p] @[simp] theorem coeff_frobenius_charP (x : 𝕎 R) (n : ℕ) : coeff (frobenius x) n = x.coeff n ^ p := by rw [coeff_frobenius] - letI : Algebra (ZMod p) R := ZMod.algebra _ _ + let : Algebra (ZMod p) R := ZMod.algebra _ _ -- outline of the calculation, proofs follow below calc aeval (fun k => x.coeff k) (frobeniusPoly p n) = diff --git a/Mathlib/RingTheory/WittVector/InitTail.lean b/Mathlib/RingTheory/WittVector/InitTail.lean index c3117a433dd17d..aa0b1f9d1673fe 100644 --- a/Mathlib/RingTheory/WittVector/InitTail.lean +++ b/Mathlib/RingTheory/WittVector/InitTail.lean @@ -108,7 +108,7 @@ theorem select_add_select_not : ∀ x : 𝕎 R, select P x + select (fun i => ¬ theorem coeff_add_of_disjoint (x y : 𝕎 R) (h : ∀ n, x.coeff n = 0 ∨ y.coeff n = 0) : (x + y).coeff n = x.coeff n + y.coeff n := by let P : ℕ → Prop := fun n => y.coeff n = 0 - haveI : DecidablePred P := Classical.decPred P + have : DecidablePred P := Classical.decPred P set z := mk p fun n => if P n then x.coeff n else y.coeff n have hx : select P z = x := by ext1 n; rw [select, coeff_mk, coeff_mk] diff --git a/Mathlib/RingTheory/WittVector/Isocrystal.lean b/Mathlib/RingTheory/WittVector/Isocrystal.lean index a91b60b777cdcc..e4f803497f2e1d 100644 --- a/Mathlib/RingTheory/WittVector/Isocrystal.lean +++ b/Mathlib/RingTheory/WittVector/Isocrystal.lean @@ -180,7 +180,7 @@ admits an isomorphism to one of the standard (indexed by `m : ℤ`) one-dimensio theorem isocrystal_classification (k : Type*) [Field k] [IsAlgClosed k] [CharP k p] (V : Type*) [AddCommGroup V] [Isocrystal p k V] (h_dim : finrank K(p, k) V = 1) : ∃ m : ℤ, Nonempty (StandardOneDimIsocrystal p k m ≃ᶠⁱ[p, k] V) := by - haveI : Nontrivial V := Module.nontrivial_of_finrank_eq_succ h_dim + have : Nontrivial V := Module.nontrivial_of_finrank_eq_succ h_dim obtain ⟨x, hx⟩ : ∃ x : V, x ≠ 0 := exists_ne 0 have : Φ(p, k) x ≠ 0 := by simpa only [map_zero] using Φ(p, k).injective.ne hx obtain ⟨a, ha, hax⟩ : ∃ a : K(p, k), a ≠ 0 ∧ Φ(p, k) x = a • x := by diff --git a/Mathlib/RingTheory/ZariskisMainTheorem.lean b/Mathlib/RingTheory/ZariskisMainTheorem.lean index 1d7ad580fa7bd8..c0e5a825954c65 100644 --- a/Mathlib/RingTheory/ZariskisMainTheorem.lean +++ b/Mathlib/RingTheory/ZariskisMainTheorem.lean @@ -149,10 +149,10 @@ lemma isIntegral_of_isIntegralElem_of_monic_of_natDegree_lt have ht't : t' * algebraMap S St t = 1 := by rw [mul_comm, IsLocalization.Away.mul_invSelf] let R₁ := Algebra.adjoin R {t'} let R₂ := Algebra.adjoin R₁ {algebraMap S St (φ X)} - letI : Algebra R₁ R₂ := R₂.algebra - letI : Algebra R₂ St := R₂.toAlgebra - letI : Algebra R₁ St := R₁.toAlgebra - haveI : IsScalarTower R₁ R₂ St := Subalgebra.isScalarTower_mid _ + let : Algebra R₁ R₂ := R₂.algebra + let : Algebra R₂ St := R₂.toAlgebra + let : Algebra R₁ St := R₁.toAlgebra + have : IsScalarTower R₁ R₂ St := Subalgebra.isScalarTower_mid _ have : Algebra.IsIntegral R₁ R₂ := by cases subsingleton_or_nontrivial R₁ · have := (algebraMap R₁ R₂).codomain_trivial; exact ⟨(Subsingleton.elim · 0 ▸ isIntegral_zero)⟩ @@ -194,7 +194,7 @@ lemma exists_isIntegral_leadingCoeff_pow_smul_sub_of_isIntegralElem_of_mul_mem_r set a := p.leadingCoeff let R' := Localization.Away a let S' := Localization.Away (algebraMap R S a) - letI : Algebra R' S' := (Localization.awayMap (algebraMap R S) a).toAlgebra + let : Algebra R' S' := (Localization.awayMap (algebraMap R S) a).toAlgebra have : IsScalarTower R R' S' := .of_algebraMap_eq (by simp +zetaDelta [RingHom.algebraMap_toAlgebra, IsLocalization.Away.map, ← algebraMap_apply R S]) have ha : IsUnit (algebraMap R R' a) := IsLocalization.Away.algebraMap_isUnit a @@ -464,7 +464,7 @@ private lemma ZariskisMainProperty.of_adjoin_eq_top (p : Ideal S) [p.IsPrime] [Algebra.WeaklyQuasiFiniteAt R p] (x : S) (hx : Algebra.adjoin R {x} = ⊤) : ZariskisMainProperty R p := by wlog H : integralClosure R S = ⊥ - · letI inst : Algebra (integralClosure R S) (Localization.AtPrime p) := + · let inst : Algebra (integralClosure R S) (Localization.AtPrime p) := OreLocalization.instAlgebra have inst : Algebra.WeaklyQuasiFiniteAt (integralClosure R S) p := .of_restrictScalars R (integralClosure R S) _ @@ -508,7 +508,7 @@ private lemma ZariskisMainProperty.of_algHom_polynomial (p : Ideal S) [p.IsPrime] [Algebra.WeaklyQuasiFiniteAt R p] (f : R[X] →ₐ[R] S) (hf : f.Finite) : ZariskisMainProperty R p := by wlog H : integralClosure R S = ⊥ - · letI inst : Algebra (integralClosure R S) (Localization.AtPrime p) := + · let inst : Algebra (integralClosure R S) (Localization.AtPrime p) := OreLocalization.instAlgebra have inst : Algebra.WeaklyQuasiFiniteAt (integralClosure R S) p := .of_restrictScalars R (integralClosure R S) _ @@ -595,7 +595,7 @@ private lemma ZariskisMainProperty.of_algHom_mvPolynomial MvPolynomial.aeval fun i ↦ ⟨f (.X i.succ), Algebra.subset_adjoin (by simp)⟩ have := IH (R := R) (S := R') (p.under R') φ <| by refine RingHom.finite_iff_isIntegral_and_finiteType.mpr ⟨?_, ?_⟩ - · letI := φ.toAlgebra + · let := φ.toAlgebra have : IsScalarTower (MvPolynomial (Fin n) R) R' S := .of_algebraMap_eq' <| by ext <;> simp [φ, (f'.toRingHom.comp C).algebraMap_toAlgebra, φ.algebraMap_toAlgebra, f', MvPolynomial.finSuccEquiv, MvPolynomial.optionEquivLeft] diff --git a/Mathlib/SetTheory/Cardinal/Arithmetic.lean b/Mathlib/SetTheory/Cardinal/Arithmetic.lean index 98b12da1d49fa8..be12df1074de38 100644 --- a/Mathlib/SetTheory/Cardinal/Arithmetic.lean +++ b/Mathlib/SetTheory/Cardinal/Arithmetic.lean @@ -840,7 +840,7 @@ theorem mk_compl_eq_mk_compl_finite_lift {α : Type u} {β : Type v} [Finite α] (h2 : lift.{v, u} #s = lift.{u, v} #t) : lift.{v} #(sᶜ : Set α) = lift.{u} #(tᶜ : Set β) := by cases nonempty_fintype α - rcases lift_mk_eq'.1 h1 with ⟨e⟩; letI : Fintype β := Fintype.ofEquiv α e + rcases lift_mk_eq'.1 h1 with ⟨e⟩; let : Fintype β := Fintype.ofEquiv α e replace h1 : Fintype.card α = Fintype.card β := (Fintype.ofEquiv_card _).symm classical lift s to Finset α using s.toFinite @@ -886,7 +886,7 @@ theorem extend_function_of_lt {α β : Type*} {s : Set α} (f : s ↪ β) (hs : · exact extend_function_finite f h · apply extend_function f obtain ⟨g⟩ := id h - haveI := Infinite.of_injective _ g.injective + have := Infinite.of_injective _ g.injective rw [← lift_mk_eq'] at h ⊢ rwa [mk_compl_of_infinite s hs, mk_compl_of_infinite] rwa [← lift_lt, mk_range_eq_of_injective f.injective, ← h, lift_lt] diff --git a/Mathlib/SetTheory/Cardinal/Basic.lean b/Mathlib/SetTheory/Cardinal/Basic.lean index b95ae55919b8f8..e5c1792351d83c 100644 --- a/Mathlib/SetTheory/Cardinal/Basic.lean +++ b/Mathlib/SetTheory/Cardinal/Basic.lean @@ -80,7 +80,7 @@ theorem prod_eq_of_fintype {α : Type u} [h : Fintype α] (f : α → Cardinal.{ revert f refine Fintype.induction_empty_option ?_ ?_ ?_ α (h_fintype := h) · intro α β hβ e h f - letI := Fintype.ofEquiv β e.symm + let := Fintype.ofEquiv β e.symm rw [← e.prod_comp f, ← h] exact mk_congr (e.piCongrLeft _).symm · intro f @@ -362,7 +362,7 @@ theorem lt_aleph0 {c : Cardinal} : c < ℵ₀ ↔ ∃ n : ℕ, c = n := lift S to Finset ℕ using this simp contrapose! h' - haveI := Infinite.to_subtype h' + have := Infinite.to_subtype h' exact ⟨Infinite.natEmbedding S⟩, fun ⟨_, e⟩ => e.symm ▸ natCast_lt_aleph0⟩ lemma succ_eq_of_lt_aleph0 {c : Cardinal} (h : c < ℵ₀) : Order.succ c = c + 1 := by diff --git a/Mathlib/SetTheory/Cardinal/Cofinality/Ordinal.lean b/Mathlib/SetTheory/Cardinal/Cofinality/Ordinal.lean index 2b981eef602627..53c57336de09aa 100644 --- a/Mathlib/SetTheory/Cardinal/Cofinality/Ordinal.lean +++ b/Mathlib/SetTheory/Cardinal/Cofinality/Ordinal.lean @@ -558,7 +558,7 @@ theorem mk_bounded_subset {α : Type*} (h : IsStrongPrelimit #α) {r : α → α [IsWellOrder α r] (hr : (#α).ord = type r) : #{ s : Set α // Bounded r s } = #α := by rcases eq_or_ne #α 0 with (ha | ha) · rw [ha] - haveI := mk_eq_zero_iff.1 ha + have := mk_eq_zero_iff.1 ha rw [mk_eq_zero_iff] constructor rintro ⟨s, hs⟩ @@ -589,7 +589,7 @@ theorem mk_subset_mk_lt_cof {α : Type*} (h : IsStrongPrelimit #α) : have h' : IsStrongLimit #α := ⟨ha, @h⟩ rcases exists_ord_eq α with ⟨r, wo, hr⟩ classical - letI := linearOrderOfSTO r + let := linearOrderOfSTO r apply le_antisymm · conv_rhs => rw [← mk_bounded_subset h hr] apply mk_subtype_le_of_subset diff --git a/Mathlib/SetTheory/Cardinal/Finite.lean b/Mathlib/SetTheory/Cardinal/Finite.lean index e765a8b236bf85..7fe453bef977ab 100644 --- a/Mathlib/SetTheory/Cardinal/Finite.lean +++ b/Mathlib/SetTheory/Cardinal/Finite.lean @@ -191,7 +191,7 @@ def equivFinOfCardPos {α : Type*} (h : Nat.card α ≠ 0) : α ≃ Fin (Nat.car · simp only [card_eq_zero_of_infinite, ne_eq, not_true_eq_false] at h theorem card_of_subsingleton (a : α) [Subsingleton α] : Nat.card α = 1 := by - letI := Fintype.ofSubsingleton a + let := Fintype.ofSubsingleton a rw [card_eq_fintype_card, Fintype.card_ofSubsingleton a] theorem card_eq_one_iff_unique : Nat.card α = 1 ↔ Subsingleton α ∧ Nonempty α := @@ -235,14 +235,14 @@ theorem card_plift (α : Type*) : Nat.card (PLift α) = Nat.card α := theorem card_sigma {β : α → Type*} [Fintype α] [∀ a, Finite (β a)] : Nat.card (Sigma β) = ∑ a, Nat.card (β a) := by - letI _ (a : α) : Fintype (β a) := Fintype.ofFinite (β a) + let _ (a : α) : Fintype (β a) := Fintype.ofFinite (β a) simp_rw [Nat.card_eq_fintype_card, Fintype.card_sigma] theorem card_pi {β : α → Type*} [Fintype α] : Nat.card (∀ a, β a) = ∏ a, Nat.card (β a) := by simp_rw [Nat.card, mk_pi, prod_eq_of_fintype, toNat_lift, _root_.map_prod] theorem card_fun [Finite α] : Nat.card (α → β) = Nat.card β ^ Nat.card α := by - haveI := Fintype.ofFinite α + have := Fintype.ofFinite α rw [Nat.card_pi, Finset.prod_const, Finset.card_univ, ← Nat.card_eq_fintype_card] @[simp] @@ -393,8 +393,8 @@ lemma card_fun {α β : Type*} : card (α → β) = card β ^ card α := by · simp [(card_eq_zero_iff_empty α).2 α_emp] rcases finite_or_infinite α · rcases finite_or_infinite β - · letI := Fintype.ofFinite α - letI := Fintype.ofFinite β + · let := Fintype.ofFinite α + let := Fintype.ofFinite β simp · simp only [card_eq_top_of_infinite] rw [top_epow] @@ -406,9 +406,9 @@ lemma card_fun {α β : Type*} : card (α → β) = card β ^ card α := by simp [b_0] · rw [b_1, one_epow] apply le_antisymm - · letI := (card_le_one_iff_subsingleton β).1 b_1.le + · let := (card_le_one_iff_subsingleton β).1 b_1.le exact (card_le_one_iff_subsingleton (α → β)).2 Pi.instSubsingleton - · letI := (one_le_card_iff_nonempty β).1 b_1.ge + · let := (one_le_card_iff_nonempty β).1 b_1.ge exact (one_le_card_iff_nonempty (α → β)).2 Pi.instNonempty · rw [epow_top b_2, card_eq_top] rw [one_lt_card_iff_nontrivial β] at b_2 diff --git a/Mathlib/SetTheory/Cardinal/NatCard.lean b/Mathlib/SetTheory/Cardinal/NatCard.lean index 9ab54e13a093c5..742c5bd2782791 100644 --- a/Mathlib/SetTheory/Cardinal/NatCard.lean +++ b/Mathlib/SetTheory/Cardinal/NatCard.lean @@ -49,12 +49,12 @@ open scoped Classical in theorem Nat.card_eq (α : Type*) : Nat.card α = if _ : Finite α then @Fintype.card α (Fintype.ofFinite α) else 0 := by cases finite_or_infinite α - · letI := Fintype.ofFinite α + · let := Fintype.ofFinite α simp only [this, *, Nat.card_eq_fintype_card, dif_pos] · simp only [*, card_eq_zero_of_infinite, not_finite_iff_infinite.mpr, dite_false] theorem Finite.card_pos_iff [Finite α] : 0 < Nat.card α ↔ Nonempty α := by - haveI := Fintype.ofFinite α + have := Fintype.ofFinite α rw [Nat.card_eq_fintype_card, Fintype.card_pos_iff] theorem Finite.card_pos [Finite α] [h : Nonempty α] : 0 < Nat.card α := @@ -63,16 +63,16 @@ theorem Finite.card_pos [Finite α] [h : Nonempty α] : 0 < Nat.card α := namespace Finite theorem card_eq [Finite α] [Finite β] : Nat.card α = Nat.card β ↔ Nonempty (α ≃ β) := by - haveI := Fintype.ofFinite α - haveI := Fintype.ofFinite β + have := Fintype.ofFinite α + have := Fintype.ofFinite β simp only [Nat.card_eq_fintype_card, Fintype.card_eq] theorem card_le_one_iff_subsingleton [Finite α] : Nat.card α ≤ 1 ↔ Subsingleton α := by - haveI := Fintype.ofFinite α + have := Fintype.ofFinite α simp only [Nat.card_eq_fintype_card, Fintype.card_le_one_iff_subsingleton] theorem one_lt_card_iff_nontrivial [Finite α] : 1 < Nat.card α ↔ Nontrivial α := by - haveI := Fintype.ofFinite α + have := Fintype.ofFinite α simp only [Nat.card_eq_fintype_card, Fintype.one_lt_card_iff_nontrivial] theorem one_lt_card [Finite α] [h : Nontrivial α] : 1 < Nat.card α := @@ -80,14 +80,14 @@ theorem one_lt_card [Finite α] [h : Nontrivial α] : 1 < Nat.card α := @[simp] theorem card_option [Finite α] : Nat.card (Option α) = Nat.card α + 1 := by - haveI := Fintype.ofFinite α + have := Fintype.ofFinite α simp only [Nat.card_eq_fintype_card, Fintype.card_option] theorem card_le_of_embedding [Finite β] (f : α ↪ β) : Nat.card α ≤ Nat.card β := Nat.card_le_card_of_injective _ f.injective theorem card_eq_zero_iff [Finite α] : Nat.card α = 0 ↔ IsEmpty α := by - haveI := Fintype.ofFinite α + have := Fintype.ofFinite α simp only [Nat.card_eq_fintype_card, Fintype.card_eq_zero_iff] /-- If `f` is injective, then `Nat.card α ≤ Nat.card β`. We must also assume @@ -114,10 +114,10 @@ theorem card_le_of_surjective' {f : α → β} (hf : Function.Surjective f) theorem card_eq_zero_of_surjective {f : α → β} (hf : Function.Surjective f) (h : Nat.card β = 0) : Nat.card α = 0 := by cases finite_or_infinite β - · haveI := card_eq_zero_iff.mp h - haveI := Function.isEmpty f + · have := card_eq_zero_iff.mp h + have := Function.isEmpty f exact Nat.card_of_isEmpty - · haveI := Infinite.of_surjective f hf + · have := Infinite.of_surjective f hf exact Nat.card_eq_zero_of_infinite /-- NB: `Nat.card` is defined to be `0` for infinite types. -/ @@ -137,13 +137,13 @@ theorem card_range_le [Finite α] (f : α → β) : Nat.card (Set.range f) ≤ N theorem card_subtype_le [Finite α] (p : α → Prop) : Nat.card { x // p x } ≤ Nat.card α := by classical - haveI := Fintype.ofFinite α + have := Fintype.ofFinite α simpa only [Nat.card_eq_fintype_card] using Fintype.card_subtype_le p theorem card_subtype_lt [Finite α] {p : α → Prop} {x : α} (hx : ¬p x) : Nat.card { x // p x } < Nat.card α := by classical - haveI := Fintype.ofFinite α + have := Fintype.ofFinite α simpa only [Nat.card_eq_fintype_card, gt_iff_lt] using Fintype.card_subtype_lt hx end Finite diff --git a/Mathlib/SetTheory/Cardinal/Order.lean b/Mathlib/SetTheory/Cardinal/Order.lean index 600df08519e708..bee5851a6a4934 100644 --- a/Mathlib/SetTheory/Cardinal/Order.lean +++ b/Mathlib/SetTheory/Cardinal/Order.lean @@ -362,7 +362,7 @@ protected theorem lt_wf : @WellFounded Cardinal.{u} (· < ·) := by_contradiction fun h => by let ι := { c : Cardinal // ¬Acc (· < ·) c } let f : ι → Cardinal := Subtype.val - haveI hι : Nonempty ι := ⟨⟨_, h⟩⟩ + have hι : Nonempty ι := ⟨⟨_, h⟩⟩ obtain ⟨⟨c : Cardinal, hc : ¬Acc (· < ·) c⟩, ⟨h_1 : ∀ j, (f ⟨c, hc⟩).out ↪ (f j).out⟩⟩ := Embedding.min_injective fun i => (f i).out refine hc (Acc.intro _ fun j h' => by_contradiction fun hj => h'.2 ?_) diff --git a/Mathlib/SetTheory/Ordinal/Family.lean b/Mathlib/SetTheory/Ordinal/Family.lean index 4f0fe3e266cc60..6fb387982ff065 100644 --- a/Mathlib/SetTheory/Ordinal/Family.lean +++ b/Mathlib/SetTheory/Ordinal/Family.lean @@ -424,7 +424,7 @@ theorem lt_bsup {o : Ordinal.{u}} (f : ∀ a < o, Ordinal.{max u v}) {a} : theorem IsNormal.bsup {f : Ordinal → Ordinal} (H : IsNormal f) {o : Ordinal} : ∀ (g : ∀ a < o, Ordinal), o ≠ 0 → f (bsup o g) = bsup o fun a h => f (g a h) := inductionOn o fun α r _ g h => by - haveI := type_ne_zero_iff_nonempty.1 h + have := type_ne_zero_iff_nonempty.1 h rw [← iSup'_eq_bsup r, Order.IsNormal.map_iSup H bddAbove_of_small, ← iSup'_eq_bsup r] <;> rfl diff --git a/Mathlib/SetTheory/Ordinal/FundamentalSequence.lean b/Mathlib/SetTheory/Ordinal/FundamentalSequence.lean index d97e03ca2ebe51..4c11897bc95496 100644 --- a/Mathlib/SetTheory/Ordinal/FundamentalSequence.lean +++ b/Mathlib/SetTheory/Ordinal/FundamentalSequence.lean @@ -206,7 +206,7 @@ theorem exists_fundamental_sequence (a : Ordinal.{u}) : rcases ord_eq ι with ⟨r, wo, hr⟩ let r' := Subrel r fun i ↦ ∀ j, r j i → f j < f i let hrr' : r' ↪r r := Subrel.relEmbedding _ _ - haveI := hrr'.isWellOrder + have := hrr'.isWellOrder refine ⟨_, _, hrr'.ordinal_type_le.trans ?_, @fun i j _ h _ => (enum r' ⟨j, h⟩).prop _ ?_, le_antisymm (blsub_le fun i hi => lsub_le_iff.1 hf.le _) ?_⟩ diff --git a/Mathlib/SetTheory/Ordinal/Notation.lean b/Mathlib/SetTheory/Ordinal/Notation.lean index 5adbc6f5b49997..ec87ed35068b7a 100644 --- a/Mathlib/SetTheory/Ordinal/Notation.lean +++ b/Mathlib/SetTheory/Ordinal/Notation.lean @@ -425,14 +425,14 @@ instance add_nf (o₁ o₂) : ∀ [NF o₁] [NF o₂], NF (o₁ + o₂) theorem repr_add : ∀ (o₁ o₂) [NF o₁] [NF o₂], repr (o₁ + o₂) = repr o₁ + repr o₂ | 0, o, _, _ => by simp | oadd e n a, o, h₁, h₂ => by - haveI := h₁.snd; have h' := repr_add a o + have := h₁.snd; have h' := repr_add a o conv_lhs at h' => simp [HAdd.hAdd, Add.add] have nf := ONote.add_nf a o conv at nf => simp [HAdd.hAdd, Add.add] conv in _ + o => simp [HAdd.hAdd, Add.add] rcases h : add a o with - | ⟨e', n', a'⟩ <;> simp only [add, addAux, h'.symm, h, add_assoc, repr] at nf h₁ ⊢ - have := h₁.fst; haveI := nf.fst; have ee := cmp_compares e e' + have := h₁.fst; have := nf.fst; have ee := cmp_compares e e' cases he : cmp e e' <;> simp only [he, Ordering.compares_gt, Ordering.compares_lt, Ordering.compares_eq, repr, gt_iff_lt, PNat.add_coe, Nat.cast_add] at ee ⊢ · rw [← add_assoc, @add_of_omega0_opow_le _ (repr e') (ω ^ repr e' * (n' : ℕ))] @@ -472,7 +472,7 @@ theorem repr_sub : ∀ (o₁ o₂) [NF o₁] [NF o₂], repr (o₁ - o₂) = rep | 0, o, _, h₂ => by cases o <;> exact (Ordinal.zero_sub _).symm | oadd _ _ _, 0, _, _ => (Ordinal.sub_zero _).symm | oadd e₁ n₁ a₁, oadd e₂ n₂ a₂, h₁, h₂ => by - haveI := h₁.snd; haveI := h₂.snd; have h' := repr_sub a₁ a₂ + have := h₁.snd; have := h₂.snd; have h' := repr_sub a₁ a₂ conv_lhs at h' => dsimp [HSub.hSub, Sub.sub, sub] conv_lhs => dsimp only [HSub.hSub, Sub.sub]; dsimp only [sub] have ee := @cmp_compares _ _ h₁.fst h₂.fst @@ -530,8 +530,8 @@ theorem oadd_mul_nfBelow {e₁ n₁ a₁ b₁} (h₁ : NFBelow (oadd e₁ n₁ a by_cases e0 : e₂ = 0 <;> simp only [e0, oadd_mul, ↓reduceIte] · apply NFBelow.oadd h₁.fst h₁.snd grw [← h₂.lt.pos, add_zero] - · haveI := h₁.fst - haveI := h₂.fst + · have := h₁.fst + have := h₂.fst apply NFBelow.oadd · infer_instance · rwa [repr_add] @@ -560,8 +560,8 @@ theorem repr_mul : ∀ (o₁ o₂) [NF o₁] [NF o₂], repr (o₁ * o₂) = rep simp only [xe, h₂.zero_of_zero e0, repr_zero, add_zero] rw [Nat.cast_add_one x, add_mul_add_one _ ao, mul_assoc] · simp only [repr] - haveI := h₁.fst - haveI := h₂.fst + have := h₁.fst + have := h₂.fst simp only [Mul.mul, mul, e0, ite_false, repr.eq_2, repr_add, opow_add, IH, repr, mul_add] rw [← mul_assoc] congr 2 @@ -641,8 +641,8 @@ theorem split_eq_scale_split' : ∀ {o o' m} [NF o], split' o = (o', m) → spli exact ⟨rfl, rfl⟩ · revert p rcases h' : split' a with ⟨a', m'⟩ - haveI := h.fst - haveI := h.snd + have := h.fst + have := h.snd simp only [split_eq_scale_split' h', and_imp] have : 1 + (e - 1) = e := by refine repr_inj.1 ?_ @@ -662,8 +662,8 @@ theorem nf_repr_split' : ∀ {o o' m} [NF o], split' o = (o', m) → NF o' ∧ r simp [h.zero_of_zero e0, NF.zero] · revert p rcases h' : split' a with ⟨a', m'⟩ - haveI := h.fst - haveI := h.snd + have := h.fst + have := h.snd obtain ⟨IH₁, IH₂⟩ := nf_repr_split' h' simp only [IH₂, and_imp] intros @@ -684,7 +684,7 @@ theorem scale_eq_mul (x) [NF x] : ∀ (o) [NF o], scale x o = oadd x 1 0 * o | 0, _ => rfl | oadd e n a, h => by simp only [HMul.hMul]; simp only [scale] - haveI := h.snd + have := h.snd by_cases e0 : e = 0 · simp_rw [scale_eq_mul] simp [Mul.mul, mul, e0, h.zero_of_zero, @@ -734,14 +734,14 @@ instance nf_opowAux (e a0 a) [NF e] [NF a0] [NF a] : ∀ k m, NF (opowAux e a0 a cases k with | zero => exact NF.oadd_zero _ _ | succ k => - haveI := nf_opowAux e a0 a k + have := nf_opowAux e a0 a k simp only [mulNat_eq_mul]; infer_instance instance nf_opow (o₁ o₂) [NF o₁] [NF o₂] : NF (o₁ ^ o₂) := by rcases e₁ : split o₁ with ⟨a, m⟩ have na := (nf_repr_split e₁).1 rcases e₂ : split' o₂ with ⟨b', k⟩ - haveI := (nf_repr_split' e₂).1 + have := (nf_repr_split' e₂).1 obtain - | ⟨a0, n, a'⟩ := a #adaptation_note /-- Proof repaired after leanprover/lean4#13363. The next branch was previously @@ -820,7 +820,7 @@ theorem repr_opow_aux₂ {a0 a'} [N0 : NF a0] [Na' : NF a'] (m : ℕ) (d : ω ((ω ^ repr a0) ^ (k : Ordinal)) * ((ω ^ repr a0) * (n : ℕ) + repr a') + R = ((ω ^ repr a0) * (n : ℕ) + repr a' + m) ^ succ (k : Ordinal) := by intro R' - haveI No : NF (oadd a0 n a') := + have No : NF (oadd a0 n a') := N0.oadd n (Na'.below_of_lt' <| lt_of_le_of_lt le_self_add h) induction k with | zero => cases m <;> simp [R', opowAux] @@ -944,8 +944,8 @@ theorem repr_opow (o₁ o₂) [NF o₁] [NF o₂] : repr (o₁ ^ o₂) = repr o · simpa [Nat.one_le_iff_ne_zero] · rw [← Nat.cast_succ, lt_omega0] exact ⟨_, rfl⟩ - · haveI := N₁.fst - haveI := N₁.snd + · have := N₁.fst + have := N₁.snd obtain ⟨a00, ad⟩ := N₁.of_dvd_omega0 (split_dvd e₁) have al := split_add_lt e₁ have aa : repr (a' + ofNat m) = repr a' + m := by diff --git a/Mathlib/SetTheory/Ordinal/Rank.lean b/Mathlib/SetTheory/Ordinal/Rank.lean index cba2406e83081f..906dcaf237c9b0 100644 --- a/Mathlib/SetTheory/Ordinal/Rank.lean +++ b/Mathlib/SetTheory/Ordinal/Rank.lean @@ -94,7 +94,7 @@ theorem WellFoundedGT.rank_strictAnti [Preorder α] [WellFoundedGT α] : @[simp] theorem IsWellFounded.rank_eq_typein (r) [IsWellOrder α r] : rank r = Ordinal.typein r := by classical - letI := linearOrderOfSTO r + let := linearOrderOfSTO r ext a exact InitialSeg.eq (⟨(OrderEmbedding.ofStrictMono _ WellFoundedLT.rank_strictMono).ltEmbedding, fun a b h ↦ mem_range_rank_of_le h.le⟩) (Ordinal.typein r) a diff --git a/Mathlib/Tactic/Lift.lean b/Mathlib/Tactic/Lift.lean index c8746ed165379f..3657f9327185a0 100644 --- a/Mathlib/Tactic/Lift.lean +++ b/Mathlib/Tactic/Lift.lean @@ -52,7 +52,7 @@ instance Prod.instCanLift {α β γ δ : Type*} {coeβα condβα coeδγ condδ theorem Subtype.exists_pi_extension {ι : Sort*} {α : ι → Sort*} [ne : ∀ i, Nonempty (α i)] {p : ι → Prop} (f : ∀ i : Subtype p, α i) : ∃ g : ∀ i : ι, α i, (fun i : Subtype p => g i) = f := by - haveI : DecidablePred p := fun i ↦ Classical.propDecidable (p i) + have : DecidablePred p := fun i ↦ Classical.propDecidable (p i) exact ⟨fun i => if hi : p i then f ⟨i, hi⟩ else Classical.choice (ne i), funext fun i ↦ dif_pos i.2⟩ diff --git a/Mathlib/Tactic/NormNum/LegendreSymbol.lean b/Mathlib/Tactic/NormNum/LegendreSymbol.lean index 25a5be8211c825..7dac2cf1af7259 100644 --- a/Mathlib/Tactic/NormNum/LegendreSymbol.lean +++ b/Mathlib/Tactic/NormNum/LegendreSymbol.lean @@ -116,7 +116,7 @@ theorem jacobiSymNat.odd_even (a b c : ℕ) (r : ℤ) (ha : a % 2 = 1) (hb : b % decide rcases eq_or_ne c 0 with (rfl | hc') · rw [← hr, Nat.eq_zero_of_dvd_of_div_eq_zero (Nat.dvd_of_mod_eq_zero hb) hc] - · haveI : NeZero c := ⟨hc'⟩ + · have : NeZero c := ⟨hc'⟩ -- for `jacobiSym.mul_right` rwa [← Nat.mod_add_div b 2, hb, hc, Nat.zero_add, jacobiSymNat, jacobiSym.mul_right, ← jacobiSym.legendreSym.to_jacobiSym, ha', one_mul] diff --git a/Mathlib/Topology/Algebra/ConstMulAction.lean b/Mathlib/Topology/Algebra/ConstMulAction.lean index 69f48dd54a30fe..4a1d99ad78a349 100644 --- a/Mathlib/Topology/Algebra/ConstMulAction.lean +++ b/Mathlib/Topology/Algebra/ConstMulAction.lean @@ -580,7 +580,7 @@ space is T₂. -/] instance (priority := 100) t2Space_of_properlyDiscontinuousSMul_of_t2Space [T2Space T] [LocallyCompactSpace T] [ContinuousConstSMul Γ T] [ProperlyDiscontinuousSMul Γ T] : T2Space (Quotient (MulAction.orbitRel Γ T)) := by - letI := MulAction.orbitRel Γ T + let := MulAction.orbitRel Γ T set Q := Quotient (MulAction.orbitRel Γ T) rw [t2Space_iff_nhds] let f : T → Q := Quotient.mk' diff --git a/Mathlib/Topology/Algebra/ContinuousAffineMap.lean b/Mathlib/Topology/Algebra/ContinuousAffineMap.lean index 3a30c39adfc806..10e1a5f31ba0f2 100644 --- a/Mathlib/Topology/Algebra/ContinuousAffineMap.lean +++ b/Mathlib/Topology/Algebra/ContinuousAffineMap.lean @@ -498,7 +498,7 @@ def decompEquiv : (V →ᴬ[R] Q) ≃ Q × (V →L[R] W) where simp_rw [vadd_apply, f.contLinear.coe_toContinuousAffineMap, coe_const, Function.const_apply, ← f.map_vadd, vadd_eq_add, add_zero] right_inv := by - haveI := IsTopologicalAddTorsor.to_isTopologicalAddGroup W Q + have := IsTopologicalAddTorsor.to_isTopologicalAddGroup W Q rintro ⟨v, f⟩; ext <;> simp @[simp] @@ -519,7 +519,7 @@ theorem decompEquiv_symm_apply (p : Q × (V →L[R] W)) (x : V) : @[simp] theorem decompEquiv_symm_contLinear (p : Q × (V →L[R] W)) : ((decompEquiv R V Q).symm p).contLinear = p.2 := by - haveI := IsTopologicalAddTorsor.to_isTopologicalAddGroup W Q + have := IsTopologicalAddTorsor.to_isTopologicalAddGroup W Q ext; simp [decompEquiv] end diff --git a/Mathlib/Topology/Algebra/FilterBasis.lean b/Mathlib/Topology/Algebra/FilterBasis.lean index fa2f92fdcbbf81..15d529335c60eb 100644 --- a/Mathlib/Topology/Algebra/FilterBasis.lean +++ b/Mathlib/Topology/Algebra/FilterBasis.lean @@ -190,7 +190,7 @@ topological group. -/ additive group filter basis, then it's an additive topological group. -/] instance (priority := 100) isTopologicalGroup (B : GroupFilterBasis G) : @IsTopologicalGroup G B.topology _ := by - letI := B.topology + let := B.topology have basis := B.nhds_one_hasBasis have basis' := basis.prod basis refine IsTopologicalGroup.of_nhds_one ?_ ?_ ?_ ?_ @@ -264,10 +264,10 @@ a ring filter basis then it's a topological ring. -/ instance (priority := 100) isTopologicalRing {R : Type u} [Ring R] (B : RingFilterBasis R) : @IsTopologicalRing R B.topology _ := by let B' := B.toAddGroupFilterBasis - letI := B'.topology + let := B'.topology have basis := B'.nhds_zero_hasBasis have basis' := basis.prod basis - haveI := B'.isTopologicalAddGroup + have := B'.isTopologicalAddGroup apply IsTopologicalRing.of_addGroup_of_nhds_zero · rw [basis'.tendsto_iff basis] suffices ∀ U ∈ B', ∃ V W, (V ∈ B' ∧ W ∈ B') ∧ ∀ a b, a ∈ V → b ∈ W → a * b ∈ U by simpa diff --git a/Mathlib/Topology/Algebra/Group/GroupTopology.lean b/Mathlib/Topology/Algebra/Group/GroupTopology.lean index 43dfdcf1f08f9c..5074ba1bd69c40 100644 --- a/Mathlib/Topology/Algebra/Group/GroupTopology.lean +++ b/Mathlib/Topology/Algebra/Group/GroupTopology.lean @@ -50,8 +50,8 @@ variable [Group α] theorem continuous_mul' (g : GroupTopology α) : haveI := g.toTopologicalSpace Continuous fun p : α × α => p.1 * p.2 := by - letI := g.toTopologicalSpace - haveI := g.toIsTopologicalGroup + let := g.toTopologicalSpace + have := g.toIsTopologicalGroup exact continuous_mul /-- A version of the global `continuous_inv` suitable for dot notation. -/ @@ -59,8 +59,8 @@ theorem continuous_mul' (g : GroupTopology α) : theorem continuous_inv' (g : GroupTopology α) : haveI := g.toTopologicalSpace Continuous (Inv.inv : α → α) := by - letI := g.toTopologicalSpace - haveI := g.toIsTopologicalGroup + let := g.toTopologicalSpace + have := g.toIsTopologicalGroup exact continuous_inv @[to_additive] @@ -102,7 +102,7 @@ theorem toTopologicalSpace_top : (⊤ : GroupTopology α).toTopologicalSpace = instance : Bot (GroupTopology α) := let _t : TopologicalSpace α := ⊥ ⟨{ continuous_mul := by - haveI := discreteTopology_bot α + have := discreteTopology_bot α fun_prop continuous_inv := continuous_bot }⟩ diff --git a/Mathlib/Topology/Algebra/InfiniteSum/Defs.lean b/Mathlib/Topology/Algebra/InfiniteSum/Defs.lean index 01c9ccbcfcd3fa..bcff99254b71ce 100644 --- a/Mathlib/Topology/Algebra/InfiniteSum/Defs.lean +++ b/Mathlib/Topology/Algebra/InfiniteSum/Defs.lean @@ -183,7 +183,7 @@ Note that in this case `HasSum f a` is satisfied for *every* element `a` of the value assigned to the `tsum` is a question of conventions. -/] lemma tprod_bot (hL : ¬L.NeBot) (f : β → α) : ∏'[L] b, f b = ∏ᶠ b, f b := by simp only [tprod_def, dif_pos (multipliable_bot hL f)] - haveI : L.LeAtTop := L.leAtTop_of_not_NeBot hL + have : L.LeAtTop := L.leAtTop_of_not_NeBot hL rw [L.support_eq_univ, Set.inter_univ, Set.mulIndicator_univ] by_cases hf : (mulSupport f).Finite · rw [eq_true_intro hf, if_pos] diff --git a/Mathlib/Topology/Algebra/InfiniteSum/Group.lean b/Mathlib/Topology/Algebra/InfiniteSum/Group.lean index 59d7d6eb32c464..1a4cbbe72bc654 100644 --- a/Mathlib/Topology/Algebra/InfiniteSum/Group.lean +++ b/Mathlib/Topology/Algebra/InfiniteSum/Group.lean @@ -329,7 +329,7 @@ variable {G : Type*} [TopologicalSpace G] [CommGroup G] [IsTopologicalGroup G] { theorem Multipliable.vanishing (hf : Multipliable f) ⦃e : Set G⦄ (he : e ∈ 𝓝 (1 : G)) : ∃ s : Finset α, ∀ t, Disjoint t s → (∏ k ∈ t, f k) ∈ e := by classical - letI : UniformSpace G := IsTopologicalGroup.rightUniformSpace G + let : UniformSpace G := IsTopologicalGroup.rightUniformSpace G have : IsUniformGroup G := isUniformGroup_of_commGroup exact cauchySeq_finset_iff_prod_vanishing.1 hf.hasProd.cauchySeq e he @@ -337,7 +337,7 @@ theorem Multipliable.vanishing (hf : Multipliable f) ⦃e : Set G⦄ (he : e ∈ theorem Multipliable.tprod_vanishing (hf : Multipliable f) ⦃e : Set G⦄ (he : e ∈ 𝓝 1) : ∃ s : Finset α, ∀ t : Set α, Disjoint t s → (∏' b : t, f b) ∈ e := by classical - letI : UniformSpace G := IsTopologicalGroup.rightUniformSpace G + let : UniformSpace G := IsTopologicalGroup.rightUniformSpace G have : IsUniformGroup G := isUniformGroup_of_commGroup exact cauchySeq_finset_iff_tprod_vanishing.1 hf.hasProd.cauchySeq e he @@ -404,7 +404,7 @@ theorem multipliable_const_iff [Infinite β] [T2Space G] (a : G) : @[to_additive (attr := simp)] theorem tprod_const [T2Space G] (a : G) : ∏' _ : β, a = a ^ (Nat.card β) := by rcases finite_or_infinite β with hβ | hβ - · letI : Fintype β := Fintype.ofFinite β + · let : Fintype β := Fintype.ofFinite β rw [tprod_eq_prod (s := univ) (fun x hx ↦ (hx (mem_univ x)).elim)] simp only [prod_const, Nat.card_eq_fintype_card, Fintype.card] · simp only [Nat.card_eq_zero_of_infinite, pow_zero] diff --git a/Mathlib/Topology/Algebra/InfiniteSum/SummationFilter.lean b/Mathlib/Topology/Algebra/InfiniteSum/SummationFilter.lean index 4f65111db79aaf..3fa8bd6d7034fc 100644 --- a/Mathlib/Topology/Algebra/InfiniteSum/SummationFilter.lean +++ b/Mathlib/Topology/Algebra/InfiniteSum/SummationFilter.lean @@ -193,7 +193,7 @@ instance [Countable β] : IsCountablyGenerated (unconditional β).filter := lemma eq_unconditional_of_finite {β} [Finite β] (L : SummationFilter β) [L.LeAtTop] [L.NeBot] : L = unconditional β := by classical - haveI := Fintype.ofFinite β + have := Fintype.ofFinite β have hAtTop : (atTop : Filter (Finset β)) = pure Finset.univ := by rw [(isTop_iff_eq_top.mpr rfl).atTop_eq (a := Finset.univ), ← Finset.top_eq_univ, Ici_top, principal_singleton] diff --git a/Mathlib/Topology/Algebra/IsUniformGroup/Basic.lean b/Mathlib/Topology/Algebra/IsUniformGroup/Basic.lean index ac1b694b34f284..a24630c413160c 100644 --- a/Mathlib/Topology/Algebra/IsUniformGroup/Basic.lean +++ b/Mathlib/Topology/Algebra/IsUniformGroup/Basic.lean @@ -629,9 +629,9 @@ instance QuotientGroup.completeSpace_right' (G : Type u) [Group G] [TopologicalS sequential antitone neighborhood basis `u` for `𝓝 (1 : G)` so that `(u (n + 1)) ^ 2 ⊆ u n`, and this descends to an antitone neighborhood basis `v` for `𝓝 (1 : G ⧸ N)`. Since `𝓤 (G ⧸ N)` is countably generated, it suffices to show any Cauchy sequence `x` converges. -/ - letI : UniformSpace (G ⧸ N) := IsTopologicalGroup.rightUniformSpace (G ⧸ N) - letI : UniformSpace G := IsTopologicalGroup.rightUniformSpace G - haveI : (𝓤 (G ⧸ N)).IsCountablyGenerated := comap.isCountablyGenerated _ _ + let : UniformSpace (G ⧸ N) := IsTopologicalGroup.rightUniformSpace (G ⧸ N) + let : UniformSpace G := IsTopologicalGroup.rightUniformSpace G + have : (𝓤 (G ⧸ N)).IsCountablyGenerated := comap.isCountablyGenerated _ _ obtain ⟨u, hu, u_mul⟩ := IsTopologicalGroup.exists_antitone_basis_nhds_one G obtain ⟨hv, v_anti⟩ := hu.map ((↑) : G → G ⧸ N) rw [← QuotientGroup.nhds_eq N 1, QuotientGroup.mk_one] at hv diff --git a/Mathlib/Topology/Algebra/IsUniformGroup/DiscreteSubgroup.lean b/Mathlib/Topology/Algebra/IsUniformGroup/DiscreteSubgroup.lean index a77292075775c4..a600331bc4a9b0 100644 --- a/Mathlib/Topology/Algebra/IsUniformGroup/DiscreteSubgroup.lean +++ b/Mathlib/Topology/Algebra/IsUniformGroup/DiscreteSubgroup.lean @@ -64,7 +64,7 @@ lemma Subgroup.discreteTopology_iff_of_finiteIndex {H : Subgroup G} [H.FiniteInd @[to_additive] lemma Subgroup.discreteTopology_iff_of_isFiniteRelIndex {H K : Subgroup G} (hHK : H ≤ K) [IsFiniteRelIndex H K] : DiscreteTopology H ↔ DiscreteTopology K := by - haveI : (H.subgroupOf K).FiniteIndex := IsFiniteRelIndex.to_finiteIndex_subgroupOf + have : (H.subgroupOf K).FiniteIndex := IsFiniteRelIndex.to_finiteIndex_subgroupOf rw [← (subgroupOfContinuousMulEquivOfLe hHK).discreteTopology_iff, discreteTopology_iff_of_finiteIndex] diff --git a/Mathlib/Topology/Algebra/Module/FiniteDimension.lean b/Mathlib/Topology/Algebra/Module/FiniteDimension.lean index 9e16cef2540d80..c8d5e23728599a 100644 --- a/Mathlib/Topology/Algebra/Module/FiniteDimension.lean +++ b/Mathlib/Topology/Algebra/Module/FiniteDimension.lean @@ -210,8 +210,8 @@ variable [CompleteSpace 𝕜] private theorem continuous_equivFun_basis_aux [T2Space E] {ι : Type v} [Finite ι] (ξ : Basis ι 𝕜 E) : Continuous ξ.equivFun := by have := Fintype.ofFinite ι - letI : UniformSpace E := IsTopologicalAddGroup.rightUniformSpace E - letI : IsUniformAddGroup E := isUniformAddGroup_of_addCommGroup + let : UniformSpace E := IsTopologicalAddGroup.rightUniformSpace E + let : IsUniformAddGroup E := isUniformAddGroup_of_addCommGroup suffices ∀ n, Fintype.card ι = n → Continuous ξ.equivFun by exact this _ rfl intro n hn induction n generalizing ι E with @@ -219,12 +219,12 @@ private theorem continuous_equivFun_basis_aux [T2Space E] {ι : Type v} [Finite rw [Fintype.card_eq_zero_iff] at hn exact continuous_of_const fun x y => funext hn.elim | succ n IH => - haveI : FiniteDimensional 𝕜 E := ξ.finiteDimensional_of_finite + have : FiniteDimensional 𝕜 E := ξ.finiteDimensional_of_finite -- first step: thanks to the induction hypothesis, any n-dimensional subspace is equivalent -- to a standard space of dimension n, hence it is complete and therefore closed. have H₁ : ∀ s : Submodule 𝕜 E, finrank 𝕜 s = n → IsClosed (s : Set E) := by intro s s_dim - letI : IsUniformAddGroup s := s.toAddSubgroup.isUniformAddGroup + let : IsUniformAddGroup s := s.toAddSubgroup.isUniformAddGroup let b := Basis.ofVectorSpace 𝕜 s have U : IsUniformEmbedding b.equivFun.symm.toEquiv := by have : Fintype.card (Basis.ofVectorSpaceIndex 𝕜 s) = n := by @@ -629,7 +629,7 @@ theorem FiniteDimensional.of_totallyBounded_nhds_zero {U : Set Eᵤ} (hU_nhds : obtain ⟨F, hF_finite, hF_cover⟩ := totallyBounded_iff_subset_finite_iUnion_nhds_zero.mp hU_tb (c • U) ((set_smul_mem_nhds_zero_iff hc_ne).mpr hU_nhds) let M : Submodule 𝕜 Eᵤ := Submodule.span 𝕜 F - letI : FiniteDimensional 𝕜 M := Finite.span_of_finite 𝕜 hF_finite + let : FiniteDimensional 𝕜 M := Finite.span_of_finite 𝕜 hF_finite have h_cover : U ⊆ M + c • U := fun x hx ↦ by obtain ⟨f, hf, y, hy, rfl⟩ := Set.mem_iUnion₂.mp <| hF_cover hx exact ⟨f, Submodule.subset_span hf, y, hy, rfl⟩ diff --git a/Mathlib/Topology/Algebra/Module/LocallyConvex.lean b/Mathlib/Topology/Algebra/Module/LocallyConvex.lean index c73f0cfd0adb75..e4cf4206fca136 100644 --- a/Mathlib/Topology/Algebra/Module/LocallyConvex.lean +++ b/Mathlib/Topology/Algebra/Module/LocallyConvex.lean @@ -144,8 +144,8 @@ is closed admit disjoint convex open neighborhoods. -/ theorem Disjoint.exists_open_convexes (disj : Disjoint s t) (hs₁ : Convex 𝕜 s) (hs₂ : IsCompact s) (ht₁ : Convex 𝕜 t) (ht₂ : IsClosed t) : ∃ u v, IsOpen u ∧ IsOpen v ∧ Convex 𝕜 u ∧ Convex 𝕜 v ∧ s ⊆ u ∧ t ⊆ v ∧ Disjoint u v := by - letI : UniformSpace E := IsTopologicalAddGroup.rightUniformSpace E - haveI : IsUniformAddGroup E := isUniformAddGroup_of_addCommGroup + let : UniformSpace E := IsTopologicalAddGroup.rightUniformSpace E + have : IsUniformAddGroup E := isUniformAddGroup_of_addCommGroup have := (LocallyConvexSpace.convex_open_basis_zero 𝕜 E).comap fun x : E × E => x.2 - x.1 rw [← uniformity_eq_comap_nhds_zero] at this rcases disj.exists_uniform_thickening_of_basis this hs₂ ht₂ with ⟨V, ⟨hV0, hVopen, hVconvex⟩, hV⟩ @@ -173,7 +173,7 @@ variable {ι : Sort*} {𝕜 E F : Type*} [Semiring 𝕜] [PartialOrder 𝕜] protected theorem LocallyConvexSpace.sInf {ts : Set (TopologicalSpace E)} (h : ∀ t ∈ ts, @LocallyConvexSpace 𝕜 E _ _ _ _ t) : @LocallyConvexSpace 𝕜 E _ _ _ _ (sInf ts) := by - letI : TopologicalSpace E := sInf ts + let : TopologicalSpace E := sInf ts refine .ofBases 𝕜 E (fun _ => fun If : Set ts × (ts → Set E) => ⋂ i ∈ If.1, If.2 i) (fun x => fun If : Set ts × (ts → Set E) => If.1.Finite ∧ ∀ i ∈ If.1, If.2 i ∈ @nhds _ (↑i) x ∧ Convex 𝕜 (If.2 i)) @@ -195,7 +195,7 @@ protected theorem LocallyConvexSpace.inf {t₁ t₂ : TopologicalSpace E} protected theorem LocallyConvexSpace.induced {t : TopologicalSpace F} [LocallyConvexSpace 𝕜 F] (f : E →ₗ[𝕜] F) : @LocallyConvexSpace 𝕜 E _ _ _ _ (t.induced f) := by - letI : TopologicalSpace E := t.induced f + let : TopologicalSpace E := t.induced f refine LocallyConvexSpace.ofBases 𝕜 E (fun _ => preimage f) (fun x => fun s : Set F => s ∈ 𝓝 (f x) ∧ Convex 𝕜 s) (fun x => ?_) fun x s ⟨_, hs⟩ => hs.linear_preimage f diff --git a/Mathlib/Topology/Algebra/Module/ModuleTopology.lean b/Mathlib/Topology/Algebra/Module/ModuleTopology.lean index a38676b41761ee..081eab5bf1b32d 100644 --- a/Mathlib/Topology/Algebra/Module/ModuleTopology.lean +++ b/Mathlib/Topology/Algebra/Module/ModuleTopology.lean @@ -387,8 +387,8 @@ theorem isQuotientMap_of_surjectiveₛₗ [τB : TopologicalSpace B'] [IsModuleT eq_coinduced := by -- We need to prove that the topology on B is coinduced from that on A. -- First tell the typeclass inference system that A and B are topological groups. - haveI := IsModuleTopology.toContinuousAdd R A - haveI := IsModuleTopology.toContinuousAdd S B' + have := IsModuleTopology.toContinuousAdd R A + have := IsModuleTopology.toContinuousAdd S B' -- Because φ is linear, it's continuous for the module topologies (by a previous result). have this : Continuous φ := continuous_of_linearMapₛₗ hσ.continuous φ -- So the coinduced topology is finer than the module topology on B. @@ -400,7 +400,7 @@ theorem isQuotientMap_of_surjectiveₛₗ [τB : TopologicalSpace B'] [IsModuleT clear! τB -- and replace it with the coinduced topology (which will be the same, but that's what we're -- trying to prove). This means we don't have to fight with the typeclass system. - letI : TopologicalSpace B' := .coinduced φ inferInstance + let : TopologicalSpace B' := .coinduced φ inferInstance -- With this new topology on `B`, φ is a quotient map by definition, -- and hence an open quotient map by a result in the library. have hφo : IsOpenQuotientMap φ := AddMonoidHom.isOpenQuotientMap_of_isQuotientMap ⟨⟨rfl⟩, hφ⟩ @@ -494,8 +494,8 @@ theorem isOpenMap_of_surjective [TopologicalSpace B] [IsModuleTopology R B] lemma _root_.ModuleTopology.eq_coinduced_of_surjectiveₛₗ {σ : R →+* S} (hσ : IsOpenQuotientMap σ) (φ : A →ₛₗ[σ] B') (hφ : Function.Surjective φ) : moduleTopology S B' = TopologicalSpace.coinduced φ inferInstance := by - letI : TopologicalSpace B' := moduleTopology S B' - haveI : IsModuleTopology S B' := ⟨rfl⟩ + let : TopologicalSpace B' := moduleTopology S B' + have : IsModuleTopology S B' := ⟨rfl⟩ exact (isQuotientMap_of_surjectiveₛₗ hσ φ hφ).eq_coinduced lemma _root_.ModuleTopology.eq_coinduced_of_surjective @@ -627,7 +627,7 @@ theorem continuous_bilinear_of_pi_fintype (ι : Type*) [Finite ι] rw [h] -- But this map is obviously continuous, because for a fixed `i`, `bil (single i 1)` is -- linear and thus continuous, and scalar multiplication and finite sums are continuous - haveI : ContinuousAdd C := toContinuousAdd R C + have : ContinuousAdd C := toContinuousAdd R C fun_prop end semiring diff --git a/Mathlib/Topology/Algebra/Module/Multilinear/Topology.lean b/Mathlib/Topology/Algebra/Module/Multilinear/Topology.lean index 047fedc1e464bc..897509f1d31a82 100644 --- a/Mathlib/Topology/Algebra/Module/Multilinear/Topology.lean +++ b/Mathlib/Topology/Algebra/Module/Multilinear/Topology.lean @@ -162,7 +162,7 @@ set_option backward.isDefEq.respectTransparency false in theorem isUniformEmbedding_restrictScalars : IsUniformEmbedding (restrictScalars 𝕜' : ContinuousMultilinearMap 𝕜 E F → ContinuousMultilinearMap 𝕜' E F) := by - letI : NontriviallyNormedField 𝕜 := + let : NontriviallyNormedField 𝕜 := ⟨let ⟨x, hx⟩ := @NontriviallyNormedField.non_trivial 𝕜' _; ⟨algebraMap 𝕜' 𝕜 x, by simpa⟩⟩ rw [← isUniformEmbedding_toUniformOnFun.of_comp_iff] convert! isUniformEmbedding_toUniformOnFun using 4 with s @@ -188,8 +188,8 @@ instance instIsTopologicalAddGroup : IsTopologicalAddGroup (ContinuousMultilinea instance instContinuousConstSMul {M : Type*} [Monoid M] [DistribMulAction M F] [SMulCommClass 𝕜 M F] [ContinuousConstSMul M F] : ContinuousConstSMul M (ContinuousMultilinearMap 𝕜 E F) := by - letI := IsTopologicalAddGroup.rightUniformSpace F - haveI := isUniformAddGroup_of_addCommGroup (G := F) + let := IsTopologicalAddGroup.rightUniformSpace F + have := isUniformAddGroup_of_addCommGroup (G := F) infer_instance instance instContinuousSMul [ContinuousSMul 𝕜 F] : @@ -206,8 +206,8 @@ theorem hasBasis_nhds_zero_of_basis {ι : Type*} {p : ι → Prop} {b : ι → S (𝓝 (0 : ContinuousMultilinearMap 𝕜 E F)).HasBasis (fun Si : Set (Π i, E i) × ι => IsVonNBounded 𝕜 Si.1 ∧ p Si.2) fun Si => { f | MapsTo f Si.1 (b Si.2) } := by - letI : UniformSpace F := IsTopologicalAddGroup.rightUniformSpace F - haveI : IsUniformAddGroup F := isUniformAddGroup_of_addCommGroup + let : UniformSpace F := IsTopologicalAddGroup.rightUniformSpace F + have : IsUniformAddGroup F := isUniformAddGroup_of_addCommGroup rw [nhds_induced] refine (UniformOnFun.hasBasis_nhds_zero_of_basis _ ?_ ?_ h).comap DFunLike.coe · exact ⟨∅, isVonNBounded_empty _ _⟩ diff --git a/Mathlib/Topology/Algebra/Module/Spaces/UniformConvergenceCLM.lean b/Mathlib/Topology/Algebra/Module/Spaces/UniformConvergenceCLM.lean index 79e68720233db2..1a1b414cc74f97 100644 --- a/Mathlib/Topology/Algebra/Module/Spaces/UniformConvergenceCLM.lean +++ b/Mathlib/Topology/Algebra/Module/Spaces/UniformConvergenceCLM.lean @@ -202,24 +202,24 @@ instance instIsUniformAddGroup [UniformSpace F] [IsUniformAddGroup F] (𝔖 : Se instance instIsTopologicalAddGroup [TopologicalSpace F] [IsTopologicalAddGroup F] (𝔖 : Set (Set E)) : IsTopologicalAddGroup (E →SLᵤ[σ, 𝔖] F) := by - letI : UniformSpace F := IsTopologicalAddGroup.rightUniformSpace F - haveI : IsUniformAddGroup F := isUniformAddGroup_of_addCommGroup + let : UniformSpace F := IsTopologicalAddGroup.rightUniformSpace F + have : IsUniformAddGroup F := isUniformAddGroup_of_addCommGroup infer_instance theorem continuousEvalConst [TopologicalSpace F] [IsTopologicalAddGroup F] (𝔖 : Set (Set E)) (h𝔖 : ⋃₀ 𝔖 = Set.univ) : ContinuousEvalConst (E →SLᵤ[σ, 𝔖] F) E F where continuous_eval_const x := by - letI : UniformSpace F := IsTopologicalAddGroup.rightUniformSpace F - haveI : IsUniformAddGroup F := isUniformAddGroup_of_addCommGroup + let : UniformSpace F := IsTopologicalAddGroup.rightUniformSpace F + have : IsUniformAddGroup F := isUniformAddGroup_of_addCommGroup exact (UniformOnFun.uniformContinuous_eval h𝔖 x).continuous.comp (isEmbedding_coeFn σ F 𝔖).continuous theorem t2Space [TopologicalSpace F] [IsTopologicalAddGroup F] [T2Space F] (𝔖 : Set (Set E)) (h𝔖 : ⋃₀ 𝔖 = univ) : T2Space (E →SLᵤ[σ, 𝔖] F) := by - letI : UniformSpace F := IsTopologicalAddGroup.rightUniformSpace F - haveI : IsUniformAddGroup F := isUniformAddGroup_of_addCommGroup - haveI : T2Space (E →ᵤ[𝔖] F) := UniformOnFun.t2Space_of_covering h𝔖 + let : UniformSpace F := IsTopologicalAddGroup.rightUniformSpace F + have : IsUniformAddGroup F := isUniformAddGroup_of_addCommGroup + have : T2Space (E →ᵤ[𝔖] F) := UniformOnFun.t2Space_of_covering h𝔖 exact (isEmbedding_coeFn σ F 𝔖).t2Space instance instDistribMulAction (M : Type*) [Monoid M] [DistribMulAction M F] [SMulCommClass 𝕜₂ M F] @@ -259,8 +259,8 @@ theorem continuousSMul [RingHomSurjective σ] [RingHomIsometric σ] [TopologicalSpace F] [IsTopologicalAddGroup F] [ContinuousSMul 𝕜₂ F] (𝔖 : Set (Set E)) (h𝔖₃ : ∀ S ∈ 𝔖, IsVonNBounded 𝕜₁ S) : ContinuousSMul 𝕜₂ (E →SLᵤ[σ, 𝔖] F) := by - letI : UniformSpace F := IsTopologicalAddGroup.rightUniformSpace F - haveI : IsUniformAddGroup F := isUniformAddGroup_of_addCommGroup + let : UniformSpace F := IsTopologicalAddGroup.rightUniformSpace F + have : IsUniformAddGroup F := isUniformAddGroup_of_addCommGroup let φ : (E →SLᵤ[σ, 𝔖] F) →ₗ[𝕜₂] E → F := ⟨⟨DFunLike.coe, fun _ _ => rfl⟩, fun _ _ => rfl⟩ exact UniformOnFun.continuousSMul_induced_of_image_bounded 𝕜₂ E F (E →SLᵤ[σ, 𝔖] F) φ @@ -272,8 +272,8 @@ theorem hasBasis_nhds_zero_of_basis [TopologicalSpace F] [IsTopologicalAddGroup (𝓝 (0 : E →SLᵤ[σ, 𝔖] F)).HasBasis (fun Si : Set E × ι => Si.1 ∈ 𝔖 ∧ p Si.2) fun Si => { f : E →SLᵤ[σ, 𝔖] F | ∀ x ∈ Si.1, f x ∈ b Si.2 } := by - letI : UniformSpace F := IsTopologicalAddGroup.rightUniformSpace F - haveI : IsUniformAddGroup F := isUniformAddGroup_of_addCommGroup + let : UniformSpace F := IsTopologicalAddGroup.rightUniformSpace F + have : IsUniformAddGroup F := isUniformAddGroup_of_addCommGroup rw [(isEmbedding_coeFn σ F 𝔖).isInducing.nhds_eq_comap] exact (UniformOnFun.hasBasis_nhds_zero_of_basis 𝔖 h𝔖₁ h𝔖₂ h).comap DFunLike.coe @@ -289,8 +289,8 @@ theorem nhds_zero_eq_of_basis [TopologicalSpace F] [IsTopologicalAddGroup F] ( 𝓝 (0 : E →SLᵤ[σ, 𝔖] F) = ⨅ (s : Set E) (_ : s ∈ 𝔖) (i : ι) (_ : p i), 𝓟 {f : E →SLᵤ[σ, 𝔖] F | MapsTo f s (b i)} := by - letI : UniformSpace F := IsTopologicalAddGroup.rightUniformSpace F - haveI : IsUniformAddGroup F := isUniformAddGroup_of_addCommGroup + let : UniformSpace F := IsTopologicalAddGroup.rightUniformSpace F + have : IsUniformAddGroup F := isUniformAddGroup_of_addCommGroup rw [(isEmbedding_coeFn σ F 𝔖).isInducing.nhds_eq_comap, UniformOnFun.nhds_eq_of_basis _ _ h.uniformity_of_nhds_zero] simp [MapsTo] @@ -408,8 +408,8 @@ theorem uniformSpace_mono [UniformSpace F] [IsUniformAddGroup F] (h : 𝔖₂ theorem topologicalSpace_mono [TopologicalSpace F] [IsTopologicalAddGroup F] (h : 𝔖₂ ⊆ 𝔖₁) : instTopologicalSpace σ F 𝔖₁ ≤ instTopologicalSpace σ F 𝔖₂ := by - letI := IsTopologicalAddGroup.rightUniformSpace F - haveI : IsUniformAddGroup F := isUniformAddGroup_of_addCommGroup + let := IsTopologicalAddGroup.rightUniformSpace F + have : IsUniformAddGroup F := isUniformAddGroup_of_addCommGroup simp_rw [← uniformity_toTopologicalSpace_eq] exact UniformSpace.toTopologicalSpace_mono (uniformSpace_mono σ F h) @@ -492,8 +492,8 @@ def precompUniformConvergenceCLM [IsTopologicalAddGroup G] [ContinuousConstSMul map_add' f g := add_comp f g L map_smul' a f := smul_comp a f L cont := by - letI : UniformSpace G := IsTopologicalAddGroup.rightUniformSpace G - haveI : IsUniformAddGroup G := isUniformAddGroup_of_addCommGroup + let : UniformSpace G := IsTopologicalAddGroup.rightUniformSpace G + have : IsUniformAddGroup G := isUniformAddGroup_of_addCommGroup rw [(UniformConvergenceCLM.isEmbedding_coeFn _ _ _).continuous_iff] exact (UniformOnFun.precomp_uniformContinuous hL).continuous.comp (UniformConvergenceCLM.isEmbedding_coeFn _ _ _).continuous @@ -514,10 +514,10 @@ def postcompUniformConvergenceCLM [IsTopologicalAddGroup F] [IsTopologicalAddGro map_add' := comp_add L map_smul' := comp_smulₛₗ L cont := by - letI : UniformSpace G := IsTopologicalAddGroup.rightUniformSpace G - haveI : IsUniformAddGroup G := isUniformAddGroup_of_addCommGroup - letI : UniformSpace F := IsTopologicalAddGroup.rightUniformSpace F - haveI : IsUniformAddGroup F := isUniformAddGroup_of_addCommGroup + let : UniformSpace G := IsTopologicalAddGroup.rightUniformSpace G + have : IsUniformAddGroup G := isUniformAddGroup_of_addCommGroup + let : UniformSpace F := IsTopologicalAddGroup.rightUniformSpace F + have : IsUniformAddGroup F := isUniformAddGroup_of_addCommGroup rw [(UniformConvergenceCLM.isEmbedding_coeFn _ _ _).continuous_iff] exact (UniformOnFun.postcomp_uniformContinuous L.uniformContinuous).continuous.comp diff --git a/Mathlib/Topology/Algebra/Module/TopDualPairing.lean b/Mathlib/Topology/Algebra/Module/TopDualPairing.lean index 8aea033ca55dc5..1892ad9a632657 100644 --- a/Mathlib/Topology/Algebra/Module/TopDualPairing.lean +++ b/Mathlib/Topology/Algebra/Module/TopDualPairing.lean @@ -35,8 +35,8 @@ variable [FiniteDimensional 𝕜 E] [T2Space E] Hausdorff spaces over complete nontrivially normed fields. -/ instance topDualPairing_isContPerfPair : (topDualPairing 𝕜 E).IsContPerfPair where continuous_uncurry := by - haveI : IsModuleTopology 𝕜 E := isModuleTopologyOfFiniteDimensional - haveI : IsModuleTopology 𝕜 (E →L[𝕜] 𝕜) := isModuleTopologyOfFiniteDimensional + have : IsModuleTopology 𝕜 E := isModuleTopologyOfFiniteDimensional + have : IsModuleTopology 𝕜 (E →L[𝕜] 𝕜) := isModuleTopologyOfFiniteDimensional exact IsModuleTopology.continuous_bilinear_of_finite_left (topDualPairing 𝕜 E) bijective_left := Function.bijective_id bijective_right := by diff --git a/Mathlib/Topology/Algebra/Module/UniformConvergence.lean b/Mathlib/Topology/Algebra/Module/UniformConvergence.lean index 998531ca974c38..06ac7590c5fb73 100644 --- a/Mathlib/Topology/Algebra/Module/UniformConvergence.lean +++ b/Mathlib/Topology/Algebra/Module/UniformConvergence.lean @@ -100,7 +100,7 @@ lemma UniformOnFun.continuousSMul_induced_of_image_bounded (φ : hom) (hφ : IsI obtain rfl := hφ.eq_induced; clear hφ simp +instances only [induced_iInf, UniformOnFun.topologicalSpace_eq, induced_compose] refine continuousSMul_iInf fun s ↦ continuousSMul_iInf fun hs ↦ ?_ - letI : TopologicalSpace H := + let : TopologicalSpace H := .induced (UniformFun.ofFun ∘ s.restrict ∘ φ) (UniformFun.topologicalSpace s E) set φ' : H →ₗ[𝕜] (s → E) := { toFun := s.restrict ∘ φ, diff --git a/Mathlib/Topology/Algebra/Monoid.lean b/Mathlib/Topology/Algebra/Monoid.lean index b175611ea822d6..4a02297524b5d3 100644 --- a/Mathlib/Topology/Algebra/Monoid.lean +++ b/Mathlib/Topology/Algebra/Monoid.lean @@ -540,10 +540,10 @@ theorem tendsto_mul_cocompact_nhds_zero [TopologicalSpace α] [TopologicalSpace theorem tendsto_mul_cofinite_nhds_zero {f : α → M} {g : β → M} (hf : Tendsto f cofinite (𝓝 0)) (hg : Tendsto g cofinite (𝓝 0)) : Tendsto (fun i : α × β ↦ f i.1 * g i.2) cofinite (𝓝 0) := by - letI : TopologicalSpace α := ⊥ - haveI : DiscreteTopology α := discreteTopology_bot α - letI : TopologicalSpace β := ⊥ - haveI : DiscreteTopology β := discreteTopology_bot β + let : TopologicalSpace α := ⊥ + have : DiscreteTopology α := discreteTopology_bot α + let : TopologicalSpace β := ⊥ + have : DiscreteTopology β := discreteTopology_bot β rw [← cocompact_eq_cofinite] at * exact tendsto_mul_cocompact_nhds_zero continuous_of_discreteTopology continuous_of_discreteTopology hf hg diff --git a/Mathlib/Topology/Algebra/Nonarchimedean/AdicTopology.lean b/Mathlib/Topology/Algebra/Nonarchimedean/AdicTopology.lean index f2f0b97c865a8a..945815ac73ecce 100644 --- a/Mathlib/Topology/Algebra/Nonarchimedean/AdicTopology.lean +++ b/Mathlib/Topology/Algebra/Nonarchimedean/AdicTopology.lean @@ -109,7 +109,7 @@ theorem hasBasis_nhds_zero_adic (I : Ideal R) : theorem hasBasis_nhds_adic (I : Ideal R) (x : R) : HasBasis (@nhds R I.adicTopology x) (fun _n : ℕ => True) fun n => (fun y => x + y) '' (I ^ n : Ideal R) := by - letI := I.adicTopology + let := I.adicTopology have := I.hasBasis_nhds_zero_adic.map fun y => x + y rwa [map_add_left_nhds_zero x] at this @@ -166,7 +166,7 @@ theorem isAdic_iff [top : TopologicalSpace R] [IsTopologicalRing R] {J : Ideal R · intro H change _ = _ at H rw [H] - letI := J.adicTopology + let := J.adicTopology constructor · intro n exact (J.openAddSubgroup n).isOpen' @@ -177,7 +177,7 @@ theorem isAdic_iff [top : TopologicalSpace R] [IsTopologicalRing R] {J : Ideal R · apply @IsTopologicalRing.to_topologicalAddGroup · apply (RingSubgroupsBasis.toRingFilterBasis _).toAddGroupFilterBasis.isTopologicalAddGroup · ext s - letI := Ideal.adic_basis J + let := Ideal.adic_basis J rw [J.hasBasis_nhds_zero_adic.mem_iff] constructor <;> intro H · rcases H₂ s H with ⟨n, h⟩ diff --git a/Mathlib/Topology/Algebra/Nonarchimedean/Bases.lean b/Mathlib/Topology/Algebra/Nonarchimedean/Bases.lean index bd3527ceffa655..08e03275544bba 100644 --- a/Mathlib/Topology/Algebra/Nonarchimedean/Bases.lean +++ b/Mathlib/Topology/Algebra/Nonarchimedean/Bases.lean @@ -186,7 +186,7 @@ def openAddSubgroup (i : ι) : @OpenAddSubgroup A _ hB.topology := -- See note [non-Archimedean non-instances] theorem nonarchimedean : @NonarchimedeanRing A _ hB.topology := by - letI := hB.topology + let := hB.topology constructor intro U hU obtain ⟨i, -, hi : (B i : Set A) ⊆ U⟩ := hB.hasBasis_nhds_zero.mem_iff.mp hU @@ -313,7 +313,7 @@ def openAddSubgroup (i : ι) : @OpenAddSubgroup M _ hB.topology := let _ := hB.topology { (B i).toAddSubgroup with isOpen' := by - letI := hB.topology + let := hB.topology rw [isOpen_iff_mem_nhds] intro a a_in rw [(hB.toModuleFilterBasis.toAddGroupFilterBasis.nhds_hasBasis a).mem_iff] @@ -325,7 +325,7 @@ def openAddSubgroup (i : ι) : @OpenAddSubgroup M _ hB.topology := -- See note [non-Archimedean non-instances] theorem nonarchimedean (hB : SubmodulesBasis B) : @NonarchimedeanAddGroup M _ hB.topology := by - letI := hB.topology + let := hB.topology constructor intro U hU obtain ⟨-, ⟨i, rfl⟩, hi : (B i : Set M) ⊆ U⟩ := @@ -378,7 +378,7 @@ theorem RingFilterBasis.submodulesBasisIsBasis (BR : RingFilterBasis R) {B : ι let _ := BR.topology { inter := hB.inter smul := by - letI := BR.topology + let := BR.topology intro m i rcases hB.smul m i with ⟨V, V_in, hV⟩ exact mem_of_superset (BR.toAddGroupFilterBasis.mem_nhds_zero V_in) hV } diff --git a/Mathlib/Topology/Algebra/RestrictedProduct/TopologicalSpace.lean b/Mathlib/Topology/Algebra/RestrictedProduct/TopologicalSpace.lean index 47b0e8187ea3cc..8f6efb7479c26c 100644 --- a/Mathlib/Topology/Algebra/RestrictedProduct/TopologicalSpace.lean +++ b/Mathlib/Topology/Algebra/RestrictedProduct/TopologicalSpace.lean @@ -410,7 +410,7 @@ theorem weaklyLocallyCompactSpace_of_cofinite [∀ i, WeaklyLocallyCompactSpace have hS : cofinite ≤ 𝓟 S := le_principal_iff.mpr (hAcompact.and x.2) have hSx : ∀ i ∈ S, x i ∈ A i := fun i hi ↦ hi.2 have hSA : ∀ i ∈ S, IsCompact (A i) := fun i hi ↦ hi.1 - haveI := weaklyLocallyCompactSpace_of_principal hS hSA + have := weaklyLocallyCompactSpace_of_principal hS hSA rcases exists_inclusion_eq_of_eventually R A hS hSx with ⟨x', hxx'⟩ rw [← hxx', nhds_eq_map_inclusion hAopen] rcases exists_compact_mem_nhds x' with ⟨K, K_compact, hK⟩ @@ -529,7 +529,7 @@ instance [Π i, Inv (R i)] [∀ i, InvMemClass (S i) (R i)] [∀ i, ContinuousIn continuous_inv := by rw [continuous_dom] intro T hT - haveI : ContinuousInv (Πʳ i, [R i, B i]_[𝓟 T]) := + have : ContinuousInv (Πʳ i, [R i, B i]_[𝓟 T]) := isEmbedding_coe_of_principal.continuousInv fun _ ↦ rfl exact (continuous_inclusion hT).comp continuous_inv @@ -540,7 +540,7 @@ instance {G : Type*} [Π i, SMul G (R i)] [∀ i, SMulMemClass (S i) G (R i)] continuous_const_smul g := by rw [continuous_dom] intro T hT - haveI : ContinuousConstSMul G (Πʳ i, [R i, B i]_[𝓟 T]) := + have : ContinuousConstSMul G (Πʳ i, [R i, B i]_[𝓟 T]) := isEmbedding_coe_of_principal.continuousConstSMul id rfl exact (continuous_inclusion hT).comp (continuous_const_smul g) diff --git a/Mathlib/Topology/Algebra/Semigroup.lean b/Mathlib/Topology/Algebra/Semigroup.lean index 98f129280c3c51..ad53ea93e5cab3 100644 --- a/Mathlib/Topology/Algebra/Semigroup.lean +++ b/Mathlib/Topology/Algebra/Semigroup.lean @@ -83,11 +83,11 @@ theorem exists_idempotent_in_compact_subsemigroup {M} [Semigroup M] [Topological (s_compact : IsCompact s) (s_add : ∀ᵉ (x ∈ s) (y ∈ s), x * y ∈ s) : ∃ m ∈ s, m * m = m := by let M' := { m // m ∈ s } - letI : Semigroup M' := + let : Semigroup M' := { mul := fun p q => ⟨p.1 * q.1, s_add _ p.2 _ q.2⟩ mul_assoc := fun p q r => Subtype.ext (mul_assoc _ _ _) } - haveI : CompactSpace M' := isCompact_iff_compactSpace.mp s_compact - haveI : Nonempty M' := nonempty_subtype.mpr snemp + have : CompactSpace M' := isCompact_iff_compactSpace.mp s_compact + have : Nonempty M' := nonempty_subtype.mpr snemp have : ∀ p : M', Continuous (· * p) := fun p => ((continuous_const_mul p.1).comp continuous_subtype_val).subtype_mk _ obtain ⟨⟨m, hm⟩, idem⟩ := exists_idempotent_of_compact_t2_of_continuous_mul_left this diff --git a/Mathlib/Topology/Algebra/UniformField.lean b/Mathlib/Topology/Algebra/UniformField.lean index b983eddb5bd019..8f853c718e5b0f 100644 --- a/Mathlib/Topology/Algebra/UniformField.lean +++ b/Mathlib/Topology/Algebra/UniformField.lean @@ -81,7 +81,7 @@ theorem continuous_hatInv [CompletableTopField K] {x : hat K} (h : x ≠ 0) : rw [this, ← Filter.map_map] apply Cauchy.map _ (Completion.uniformContinuous_coe K) apply CompletableTopField.nice - · haveI := isDenseInducing_coe.comap_nhds_neBot y + · have := isDenseInducing_coe.comap_nhds_neBot y apply cauchy_nhds.comap rw [Completion.comap_coe_eq_uniformity] · have eq_bot : 𝓝 (0 : hat K) ⊓ 𝓝 y = ⊥ := by @@ -122,7 +122,7 @@ theorem coe_inv (x : K) : (x : hat K)⁻¹ = ((x⁻¹ : K) : hat K) := by variable [IsUniformAddGroup K] theorem mul_hatInv_cancel {x : hat K} (x_ne : x ≠ 0) : x * hatInv x = 1 := by - haveI : T1Space (hat K) := T2Space.t1Space + have : T1Space (hat K) := T2Space.t1Space let f := fun x : hat K => x * hatInv x let c := (fun (x : K) => (x : hat K)) change f x = 1 @@ -186,7 +186,7 @@ instance Subfield.completableTopField (K : Subfield L) : CompletableTopField K w instance (priority := 100) completableTopField_of_complete (L : Type*) [Field L] [UniformSpace L] [IsTopologicalDivisionRing L] [T0Space L] [CompleteSpace L] : CompletableTopField L where nice F cau_F hF := by - haveI : NeBot F := cau_F.1 + have : NeBot F := cau_F.1 rcases CompleteSpace.complete cau_F with ⟨x, hx⟩ have hx' : x ≠ 0 := by rintro rfl diff --git a/Mathlib/Topology/Algebra/UniformFilterBasis.lean b/Mathlib/Topology/Algebra/UniformFilterBasis.lean index 2de650e0e88f03..8299736fad5ee2 100644 --- a/Mathlib/Topology/Algebra/UniformFilterBasis.lean +++ b/Mathlib/Topology/Algebra/UniformFilterBasis.lean @@ -43,8 +43,8 @@ protected theorem isUniformAddGroup : @IsUniformAddGroup G B.uniformSpace _ := theorem cauchy_iff {F : Filter G} : @Cauchy G B.uniformSpace F ↔ F.NeBot ∧ ∀ U ∈ B, ∃ M ∈ F, ∀ᵉ (x ∈ M) (y ∈ M), y - x ∈ U := by - letI := B.uniformSpace - haveI := B.isUniformAddGroup + let := B.uniformSpace + have := B.isUniformAddGroup suffices F ×ˢ F ≤ uniformity G ↔ ∀ U ∈ B, ∃ M ∈ F, ∀ᵉ (x ∈ M) (y ∈ M), y - x ∈ U by constructor <;> rintro ⟨h', h⟩ <;> refine ⟨h', ?_⟩ <;> [rwa [← this]; rwa [this]] rw [uniformity_eq_comap_nhds_zero G, ← map_le_iff_le_comap] diff --git a/Mathlib/Topology/Algebra/ValuativeRel/ValuativeTopology.lean b/Mathlib/Topology/Algebra/ValuativeRel/ValuativeTopology.lean index b565a57c266789..fb2f8c4d60c1bb 100644 --- a/Mathlib/Topology/Algebra/ValuativeRel/ValuativeTopology.lean +++ b/Mathlib/Topology/Algebra/ValuativeRel/ValuativeTopology.lean @@ -235,8 +235,8 @@ variable [_t : TopologicalSpace R] [IsValuativeTopology R] (v : Valuation R Γ theorem toTopologicalSpace_eq : _t = v.subgroups_basis.topology := by - letI u := IsTopologicalAddGroup.rightUniformSpace R - letI := isUniformAddGroup_of_addCommGroup (G := R) + let u := IsTopologicalAddGroup.rightUniformSpace R + let := isUniformAddGroup_of_addCommGroup (G := R) exact congrArg (fun u ↦ @UniformSpace.toTopologicalSpace R u) v.toUniformSpace_eq instance (priority := low) _root_.IsValuativeTopology.isTopologicalRing : IsTopologicalRing R := by diff --git a/Mathlib/Topology/Algebra/Valued/NormedValued.lean b/Mathlib/Topology/Algebra/Valued/NormedValued.lean index 828583db4053db..cd0ee47f892877 100644 --- a/Mathlib/Topology/Algebra/Valued/NormedValued.lean +++ b/Mathlib/Topology/Algebra/Valued/NormedValued.lean @@ -164,7 +164,7 @@ def toNormedField : NormedField L := norm_mul := fun x y => by simp only [Valuation.norm, ← NNReal.coe_mul, map_mul] toUniformSpace := Valued.toUniformSpace uniformity_dist := by - haveI : Nonempty { ε : ℝ // ε > 0 } := nonempty_Ioi_subtype + have : Nonempty { ε : ℝ // ε > 0 } := nonempty_Ioi_subtype ext U rw [hasBasis_iff.mp (Valued.hasBasis_uniformity L Γ₀), iInf_subtype', mem_iInf_of_directed] · simp only [true_and, mem_principal, Subtype.exists, gt_iff_lt, exists_prop] @@ -179,7 +179,7 @@ def toNormedField : NormedField L := simp only [mem_setOf_eq, Valuation.norm, hδ, NNReal.coe_lt_coe] at hx rw [mem_setOf, ← neg_sub, Valuation.map_neg] exact (RankOne.strictMono Valued.v).lt_iff_lt.mp hx - · haveI : Nontrivial Γ₀ˣ := (nontrivial_iff_exists_ne (1 : Γ₀ˣ)).mpr + · have : Nontrivial Γ₀ˣ := (nontrivial_iff_exists_ne (1 : Γ₀ˣ)).mpr ⟨RankOne.unit val.v, RankOne.unit_ne_one val.v⟩ obtain ⟨u, hu⟩ := Real.exists_lt_of_strictMono hv.strictMono hr_pos use u diff --git a/Mathlib/Topology/Algebra/Valued/ValuationTopology.lean b/Mathlib/Topology/Algebra/Valued/ValuationTopology.lean index de9f51ff05bed3..7515edaf066add 100644 --- a/Mathlib/Topology/Algebra/Valued/ValuationTopology.lean +++ b/Mathlib/Topology/Algebra/Valued/ValuationTopology.lean @@ -139,7 +139,7 @@ def mk' (v : Valuation R Γ₀) : Valued R Γ₀ := toUniformSpace := @IsTopologicalAddGroup.rightUniformSpace R _ v.subgroups_basis.topology _ toIsUniformAddGroup := @isUniformAddGroup_of_addCommGroup _ _ v.subgroups_basis.topology _ is_topological_valuation := by - letI := @IsTopologicalAddGroup.rightUniformSpace R _ v.subgroups_basis.topology _ + let := @IsTopologicalAddGroup.rightUniformSpace R _ v.subgroups_basis.topology _ intro s rw [Filter.hasBasis_iff.mp v.subgroups_basis.hasBasis_nhds_zero s] simp_rw [restrict_lt_iff_lt_embedding] diff --git a/Mathlib/Topology/Baire/Lemmas.lean b/Mathlib/Topology/Baire/Lemmas.lean index 7d9c592d303eeb..280eb034d31ce2 100644 --- a/Mathlib/Topology/Baire/Lemmas.lean +++ b/Mathlib/Topology/Baire/Lemmas.lean @@ -190,7 +190,7 @@ an index set which is a countable set in any type. -/ theorem dense_biInter_of_Gδ {S : Set α} {f : ∀ x ∈ S, Set X} (ho : ∀ s (H : s ∈ S), IsGδ (f s H)) (hS : S.Countable) (hd : ∀ s (H : s ∈ S), Dense (f s H)) : Dense (⋂ s ∈ S, f s ‹_›) := by rw [biInter_eq_iInter] - haveI := hS.to_subtype + have := hS.to_subtype exact dense_iInter_of_Gδ (fun s => ho s s.2) fun s => hd s s.2 /-- Baire theorem: the intersection of two dense Gδ sets is dense. -/ @@ -221,7 +221,7 @@ is dense. Formulated here with a union over a countable set in any type. -/ theorem IsGδ.dense_biUnion_interior_of_closed {t : Set α} {s : Set X} (hs : IsGδ s) (hd : Dense s) (ht : t.Countable) {f : α → Set X} (hc : ∀ i ∈ t, IsClosed (f i)) (hU : s ⊆ ⋃ i ∈ t, f i) : Dense (⋃ i ∈ t, interior (f i)) := by - haveI := ht.to_subtype + have := ht.to_subtype simp only [biUnion_eq_iUnion, SetCoe.forall'] at * exact hs.dense_iUnion_interior_of_closed hd hc hU diff --git a/Mathlib/Topology/Bases.lean b/Mathlib/Topology/Bases.lean index bbfba69335b6d4..ee125a1602e517 100644 --- a/Mathlib/Topology/Bases.lean +++ b/Mathlib/Topology/Bases.lean @@ -82,7 +82,7 @@ structure IsTopologicalBasis (s : Set (Set α)) : Prop where subcollections of `s` form a topological basis. -/ theorem isTopologicalBasis_of_subbasis {s : Set (Set α)} (hs : t = generateFrom s) : IsTopologicalBasis ((fun f => ⋂₀ f) '' { f : Set (Set α) | f.Finite ∧ f ⊆ s }) := by - subst t; letI := generateFrom s + subst t; let := generateFrom s refine ⟨?_, ?_, le_antisymm (le_generateFrom ?_) <| generateFrom_anti fun t ht => ?_⟩ · rintro _ ⟨t₁, ⟨hft₁, ht₁b⟩, rfl⟩ _ ⟨t₂, ⟨hft₂, ht₂b⟩, rfl⟩ x h exact ⟨_, ⟨_, ⟨hft₁.union hft₂, union_subset ht₁b ht₂b⟩, sInter_union t₁ t₂⟩, h, Subset.rfl⟩ @@ -416,7 +416,7 @@ instance [TopologicalSpace β] [SeparableSpace α] [SeparableSpace β] : Separab instance {ι : Type*} {X : ι → Type*} [∀ i, TopologicalSpace (X i)] [∀ i, SeparableSpace (X i)] [Countable ι] : SeparableSpace (∀ i, X i) := by choose t htc htd using (exists_countable_dense <| X ·) - haveI := fun i ↦ (htc i).to_subtype + have := fun i ↦ (htc i).to_subtype nontriviality ∀ i, X i; inhabit ∀ i, X i classical set f : (Σ I : Finset ι, ∀ i : I, t i) → ∀ i, X i := fun ⟨I, g⟩ i ↦ @@ -528,7 +528,7 @@ theorem IsSeparable.univ_pi {ι : Type*} [Countable ι] {X : ι → Type*} {s : · rw [he] exact countable_empty.isSeparable · choose c c_count hc using h - haveI := fun i ↦ (c_count i).to_subtype + have := fun i ↦ (c_count i).to_subtype set g : (I : Finset ι) × ((i : I) → c i) → (i : ι) → X i := fun ⟨I, f⟩ i ↦ if hi : i ∈ I then f ⟨i, hi⟩ else f₀ i refine ⟨range g, countable_range g, fun f hf ↦ mem_closure_iff.2 fun o ho hfo ↦ ?_⟩ @@ -866,7 +866,7 @@ instance (priority := 100) [Countable α] [FirstCountableTopology α] : theorem secondCountableTopology_induced (α β) [t : TopologicalSpace β] [SecondCountableTopology β] (f : α → β) : @SecondCountableTopology α (t.induced f) := by rcases @SecondCountableTopology.is_open_generated_countable β _ _ with ⟨b, hb, eq⟩ - letI := t.induced f + let := t.induced f refine { is_open_generated_countable := ⟨preimage f '' b, hb.image _, ?_⟩ } rw [eq, induced_generateFrom_eq] @@ -915,7 +915,7 @@ theorem isOpen_iUnion_countable [SecondCountableTopology α] {ι} (s : ι → Se (H : ∀ i, IsOpen (s i)) : ∃ T : Set ι, T.Countable ∧ ⋃ i ∈ T, s i = ⋃ i, s i := by let B := { b ∈ countableBasis α | ∃ i, b ⊆ s i } choose f hf using fun b : B => b.2.2 - haveI : Countable B := ((countable_countableBasis α).mono (sep_subset _ _)).to_subtype + have : Countable B := ((countable_countableBasis α).mono (sep_subset _ _)).to_subtype refine ⟨_, countable_range f, (iUnion₂_subset_iUnion _ _).antisymm (sUnion_subset ?_)⟩ rintro _ ⟨i, rfl⟩ x xs rcases (isBasis_countableBasis α).exists_subset_of_mem_open xs (H _) with ⟨b, hb, xb, bs⟩ diff --git a/Mathlib/Topology/CWComplex/Classical/Basic.lean b/Mathlib/Topology/CWComplex/Classical/Basic.lean index 78eab46d614820..705253ee4cc7aa 100644 --- a/Mathlib/Topology/CWComplex/Classical/Basic.lean +++ b/Mathlib/Topology/CWComplex/Classical/Basic.lean @@ -407,7 +407,7 @@ lemma RelCWComplex.cellFrontier_zero_eq_empty [RelCWComplex C D] {j : cell C 0} @[alias_in CWComplex] lemma RelCWComplex.nonempty_cellFrontier [CWComplex C] {n : ℕ} (hn : n ≠ 0) (j : cell C n) : (cellFrontier n j).Nonempty := by - letI : NeZero n := ⟨hn⟩ + let : NeZero n := ⟨hn⟩ use map n j (Pi.single 0 1) simp only [cellFrontier, mem_image, mem_sphere_iff_norm, sub_zero] use Pi.single 0 1, by simp [Pi.norm_single] diff --git a/Mathlib/Topology/Category/CompHaus/Basic.lean b/Mathlib/Topology/Category/CompHaus/Basic.lean index 3d82ef12851a4c..b90b4b4da53606 100644 --- a/Mathlib/Topology/Category/CompHaus/Basic.lean +++ b/Mathlib/Topology/Category/CompHaus/Basic.lean @@ -192,8 +192,8 @@ theorem epi_iff_surjective {X Y : CompHaus.{u}} (f : X ⟶ Y) : Epi f ↔ Functi rintro ⟨y', hy'⟩ exact hy y' hy' obtain ⟨φ, hφ0, hφ1, hφ01⟩ := exists_continuous_zero_one_of_isClosed hC hD hCD - haveI : CompactSpace (ULift.{u} <| Set.Icc (0 : ℝ) 1) := Homeomorph.ulift.symm.compactSpace - haveI : T2Space (ULift.{u} <| Set.Icc (0 : ℝ) 1) := Homeomorph.ulift.symm.t2Space + have : CompactSpace (ULift.{u} <| Set.Icc (0 : ℝ) 1) := Homeomorph.ulift.symm.compactSpace + have : T2Space (ULift.{u} <| Set.Icc (0 : ℝ) 1) := Homeomorph.ulift.symm.t2Space let Z := of (ULift.{u} <| Set.Icc (0 : ℝ) 1) let g : Y ⟶ Z := ofHom _ ⟨fun y' => ⟨⟨φ y', hφ01 y'⟩⟩, diff --git a/Mathlib/Topology/Category/Profinite/CofilteredLimit.lean b/Mathlib/Topology/Category/Profinite/CofilteredLimit.lean index dfa0f583b04854..ec025ce5116a93 100644 --- a/Mathlib/Topology/Category/Profinite/CofilteredLimit.lean +++ b/Mathlib/Topology/Category/Profinite/CofilteredLimit.lean @@ -202,10 +202,10 @@ theorem exists_locallyConstant {α : Type*} (hC : IsLimit C) (f : LocallyConstan · ext x exact hj.elim' (C.π.app j x) by_contra! h - haveI : ∀ j : J, Nonempty ((F ⋙ Profinite.toTopCat).obj j) := h - haveI : ∀ j : J, T2Space ((F ⋙ Profinite.toTopCat).obj j) := fun j => + have : ∀ j : J, Nonempty ((F ⋙ Profinite.toTopCat).obj j) := h + have : ∀ j : J, T2Space ((F ⋙ Profinite.toTopCat).obj j) := fun j => (inferInstance : T2Space (F.obj j)) - haveI : ∀ j : J, CompactSpace ((F ⋙ Profinite.toTopCat).obj j) := fun j => + have : ∀ j : J, CompactSpace ((F ⋙ Profinite.toTopCat).obj j) := fun j => (inferInstance : CompactSpace (F.obj j)) have cond := TopCat.nonempty_limitCone_of_compact_t2_cofiltered_system.{u} (F ⋙ Profinite.toTopCat) diff --git a/Mathlib/Topology/Category/Stonean/Basic.lean b/Mathlib/Topology/Category/Stonean/Basic.lean index df64fba6809a24..ae6333485f8843 100644 --- a/Mathlib/Topology/Category/Stonean/Basic.lean +++ b/Mathlib/Topology/Category/Stonean/Basic.lean @@ -154,7 +154,7 @@ lemma epi_iff_surjective {X Y : Stonean} (f : X ⟶ Y) : instance instProjectiveCompHausCompHaus (X : Stonean) : Projective (toCompHaus.obj X) where factors := by intro B C φ f _ - haveI : ExtremallyDisconnected (toCompHaus.obj X).toTop := X.prop + have : ExtremallyDisconnected (toCompHaus.obj X).toTop := X.prop have hf : Function.Surjective f := by rwa [← CompHaus.epi_iff_surjective] obtain ⟨f', h⟩ := CompactT2.ExtremallyDisconnected.projective φ.hom.hom.continuous f.hom.hom.continuous @@ -167,7 +167,7 @@ instance instProjectiveCompHausCompHaus (X : Stonean) : Projective (toCompHaus.o instance (X : Stonean) : Projective (toProfinite.obj X) where factors := by intro B C φ f _ - haveI : ExtremallyDisconnected (toProfinite.obj X) := X.prop + have : ExtremallyDisconnected (toProfinite.obj X) := X.prop have hf : Function.Surjective f := by rwa [← Profinite.epi_iff_surjective] obtain ⟨f', h⟩ := CompactT2.ExtremallyDisconnected.projective φ.hom.hom.continuous f.hom.hom.continuous @@ -180,7 +180,7 @@ instance (X : Stonean) : Projective (toProfinite.obj X) where instance (X : Stonean) : Projective X where factors := by intro B C φ f _ - haveI : ExtremallyDisconnected X.toTop := X.prop + have : ExtremallyDisconnected X.toTop := X.prop have hf : Function.Surjective f := by rwa [← Stonean.epi_iff_surjective] obtain ⟨f', h⟩ := CompactT2.ExtremallyDisconnected.projective φ.hom.hom.continuous f.hom.hom.continuous diff --git a/Mathlib/Topology/Category/TopCat/Limits/Konig.lean b/Mathlib/Topology/Category/TopCat/Limits/Konig.lean index 419cca5e85072f..62a504a5a47ba4 100644 --- a/Mathlib/Topology/Category/TopCat/Limits/Konig.lean +++ b/Mathlib/Topology/Category/TopCat/Limits/Konig.lean @@ -73,7 +73,7 @@ theorem partialSections.nonempty [IsCofilteredOrEmpty J] [h : ∀ j : J, Nonempt classical cases isEmpty_or_nonempty J · exact ⟨isEmptyElim, fun {j} => IsEmpty.elim' inferInstance j.1⟩ - haveI : IsCofiltered J := ⟨⟩ + have : IsCofiltered J := ⟨⟩ use fun j : J => if hj : j ∈ G then F.map (IsCofiltered.infTo G H hj) (h (IsCofiltered.inf G H)).some else (h _).some diff --git a/Mathlib/Topology/Category/TopCat/Limits/Products.lean b/Mathlib/Topology/Category/TopCat/Limits/Products.lean index b67db81e7d0fe4..13a4314451693a 100644 --- a/Mathlib/Topology/Category/TopCat/Limits/Products.lean +++ b/Mathlib/Topology/Category/TopCat/Limits/Products.lean @@ -222,8 +222,8 @@ theorem isInducing_prodMap {W X Y Z : TopCat.{u}} {f : W ⟶ X} {g : Y ⟶ Z} (h theorem isEmbedding_prodMap {W X Y Z : TopCat.{u}} {f : W ⟶ X} {g : Y ⟶ Z} (hf : IsEmbedding f) (hg : IsEmbedding g) : IsEmbedding (Limits.prod.map f g) := ⟨isInducing_prodMap hf.isInducing hg.isInducing, by - haveI := (TopCat.mono_iff_injective _).mpr hf.injective - haveI := (TopCat.mono_iff_injective _).mpr hg.injective + have := (TopCat.mono_iff_injective _).mpr hf.injective + have := (TopCat.mono_iff_injective _).mpr hg.injective exact (TopCat.mono_iff_injective _).mp inferInstance⟩ end Prod diff --git a/Mathlib/Topology/CompactOpen.lean b/Mathlib/Topology/CompactOpen.lean index f691e208772d12..f9a1d7a83bf422 100644 --- a/Mathlib/Topology/CompactOpen.lean +++ b/Mathlib/Topology/CompactOpen.lean @@ -375,8 +375,8 @@ theorem exists_tendsto_compactOpen_iff_forall [WeaklyLocallyCompactSpace X] [T2S ∀ (s₁) (hs₁ : IsCompact s₁) (s₂) (hs₂ : IsCompact s₂) (x : X) (hxs₁ : x ∈ s₁) (hxs₂ : x ∈ s₂), f s₁ hs₁ ⟨x, hxs₁⟩ = f s₂ hs₂ ⟨x, hxs₂⟩ := by rintro s₁ hs₁ s₂ hs₂ x hxs₁ hxs₂ - haveI := isCompact_iff_compactSpace.mp hs₁ - haveI := isCompact_iff_compactSpace.mp hs₂ + have := isCompact_iff_compactSpace.mp hs₁ + have := isCompact_iff_compactSpace.mp hs₂ have h₁ := (continuous_eval_const (⟨x, hxs₁⟩ : s₁)).continuousAt.tendsto.comp (hf s₁ hs₁) have h₂ := (continuous_eval_const (⟨x, hxs₂⟩ : s₂)).continuousAt.tendsto.comp (hf s₂ hs₂) exact tendsto_nhds_unique h₁ h₂ diff --git a/Mathlib/Topology/Compactification/StoneCech.lean b/Mathlib/Topology/Compactification/StoneCech.lean index d2e261792e3636..c6b25c9fc81e38 100644 --- a/Mathlib/Topology/Compactification/StoneCech.lean +++ b/Mathlib/Topology/Compactification/StoneCech.lean @@ -178,8 +178,8 @@ variable [T2Space γ] @[simp] lemma ultrafilter_extend_extends (f : α → γ) : Ultrafilter.extend f ∘ pure = f := by - letI : TopologicalSpace α := ⊥ - haveI : DiscreteTopology α := ⟨rfl⟩ + let : TopologicalSpace α := ⊥ + have : DiscreteTopology α := ⟨rfl⟩ exact funext (isDenseInducing_pure.extend_eq continuous_of_discreteTopology) @[simp] diff --git a/Mathlib/Topology/Compactness/Compact.lean b/Mathlib/Topology/Compactness/Compact.lean index 4df746261b2037..46fd7adce3589c 100644 --- a/Mathlib/Topology/Compactness/Compact.lean +++ b/Mathlib/Topology/Compactness/Compact.lean @@ -110,7 +110,7 @@ theorem IsCompact.image_of_continuousOn {f : X → Y} (hs : IsCompact s) (hf : C have : NeBot (l.comap f ⊓ 𝓟 s) := comap_inf_principal_neBot_of_image_mem lne (le_principal_iff.1 ls) obtain ⟨x, hxs, hx⟩ : ∃ x ∈ s, ClusterPt x (l.comap f ⊓ 𝓟 s) := @hs _ this inf_le_right - haveI := hx.neBot + have := hx.neBot use f x, mem_image_of_mem f hxs have : Tendsto f (𝓝 x ⊓ (comap f l ⊓ 𝓟 s)) (𝓝 (f x) ⊓ l) := by convert! (hf x hxs).inf (@tendsto_comap _ _ f l) using 1 @@ -627,7 +627,7 @@ theorem Tendsto.isCompact_insert_range_of_cocompact {f : X → Y} {y} theorem Tendsto.isCompact_insert_range_of_cofinite {f : ι → X} {x} (hf : Tendsto f cofinite (𝓝 x)) : IsCompact (insert x (range f)) := by - letI : TopologicalSpace ι := ⊥; haveI h : DiscreteTopology ι := ⟨rfl⟩ + let : TopologicalSpace ι := ⊥; have h : DiscreteTopology ι := ⟨rfl⟩ rw [← cocompact_eq_cofinite ι] at hf exact hf.isCompact_insert_range_of_cocompact continuous_of_discreteTopology @@ -1214,7 +1214,7 @@ theorem IsClosed.exists_minimal_nonempty_closed_subset [CompactSpace X] {S : Set zorn_subset opens fun c hc hz => by by_cases hcne : c.Nonempty · obtain ⟨U₀, hU₀⟩ := hcne - haveI : Nonempty { U // U ∈ c } := ⟨⟨U₀, hU₀⟩⟩ + have : Nonempty { U // U ∈ c } := ⟨⟨U₀, hU₀⟩⟩ obtain ⟨U₀compl, -, -⟩ := hc hU₀ use ⋃₀ c refine ⟨⟨?_, ?_, ?_⟩, fun U hU _ hx => ⟨U, hU, hx⟩⟩ diff --git a/Mathlib/Topology/Compactness/Lindelof.lean b/Mathlib/Topology/Compactness/Lindelof.lean index 1a5ec276e008cf..91b7679bff0d00 100644 --- a/Mathlib/Topology/Compactness/Lindelof.lean +++ b/Mathlib/Topology/Compactness/Lindelof.lean @@ -105,7 +105,7 @@ theorem IsLindelof.image_of_continuousOn {f : X → Y} (hs : IsLindelof s) (hf : have : NeBot (l.comap f ⊓ 𝓟 s) := comap_inf_principal_neBot_of_image_mem lne (le_principal_iff.1 ls) obtain ⟨x, hxs, hx⟩ : ∃ x ∈ s, ClusterPt x (l.comap f ⊓ 𝓟 s) := @hs _ this _ inf_le_right - haveI := hx.neBot + have := hx.neBot use f x, mem_image_of_mem f hxs have : Tendsto f (𝓝 x ⊓ (comap f l ⊓ 𝓟 s)) (𝓝 (f x) ⊓ l) := by convert! (hf x hxs).inf (@tendsto_comap _ _ f l) using 1 diff --git a/Mathlib/Topology/Connected/Basic.lean b/Mathlib/Topology/Connected/Basic.lean index 905b1b9ea09162..5caac6abf7f4d1 100644 --- a/Mathlib/Topology/Connected/Basic.lean +++ b/Mathlib/Topology/Connected/Basic.lean @@ -700,7 +700,7 @@ theorem connectedSpace_iff_connectedComponent : exact ⟨x, eq_univ_of_univ_subset <| isPreconnected_univ.subset_connectedComponent (mem_univ x)⟩ · rintro ⟨x, h⟩ - haveI : PreconnectedSpace α := + have : PreconnectedSpace α := ⟨by rw [← h]; exact isPreconnected_connectedComponent⟩ exact ⟨⟨x⟩⟩ diff --git a/Mathlib/Topology/Connected/LocallyPathConnected.lean b/Mathlib/Topology/Connected/LocallyPathConnected.lean index d26494a7700b2a..b5ff93d8531de0 100644 --- a/Mathlib/Topology/Connected/LocallyPathConnected.lean +++ b/Mathlib/Topology/Connected/LocallyPathConnected.lean @@ -181,7 +181,7 @@ alias IsOpen.locPathConnectedSpace := IsOpen.locallyPathConnectedSpace theorem IsOpen.isConnected_iff_isPathConnected {U : Set X} (U_op : IsOpen U) : IsConnected U ↔ IsPathConnected U := by rw [isConnected_iff_connectedSpace, isPathConnected_iff_pathConnectedSpace] - haveI := U_op.locallyPathConnectedSpace + have := U_op.locallyPathConnectedSpace exact pathConnectedSpace_iff_connectedSpace.symm /-- Locally path-connected spaces are locally connected. -/ diff --git a/Mathlib/Topology/Connected/PathConnected.lean b/Mathlib/Topology/Connected/PathConnected.lean index d2302fd0ec8004..d7f11b7f0b6646 100644 --- a/Mathlib/Topology/Connected/PathConnected.lean +++ b/Mathlib/Topology/Connected/PathConnected.lean @@ -547,7 +547,7 @@ class PathConnectedSpace (X : Type*) [TopologicalSpace X] : Prop where theorem pathConnectedSpace_iff_zerothHomotopy : PathConnectedSpace X ↔ Nonempty (ZerothHomotopy X) ∧ Subsingleton (ZerothHomotopy X) := by - letI := pathSetoid X + let := pathSetoid X constructor · intro h refine ⟨(nonempty_quotient_iff _).mpr h.1, ⟨?_⟩⟩ diff --git a/Mathlib/Topology/Constructions.lean b/Mathlib/Topology/Constructions.lean index 03c4a57177fd18..de701393db9592 100644 --- a/Mathlib/Topology/Constructions.lean +++ b/Mathlib/Topology/Constructions.lean @@ -1130,7 +1130,7 @@ theorem pi_generateFrom_eq {A : ι → Type*} {g : ∀ a, Set (Set (A a))} : refine le_antisymm ?_ ?_ · apply le_generateFrom rintro _ ⟨s, i, hi, rfl⟩ - letI := fun a => generateFrom (g a) + let := fun a => generateFrom (g a) exact isOpen_set_pi i.finite_toSet (fun a ha => GenerateOpen.basic _ (hi a ha)) · classical refine le_iInf fun i => coinduced_le_iff_le_induced.1 <| le_generateFrom fun s hs => ?_ @@ -1155,7 +1155,7 @@ theorem pi_generateFrom_eq_finite {X : ι → Type*} {g : ∀ a, Set (Set (X a)) refine le_antisymm (generateFrom_anti ?_) (le_generateFrom ?_) · exact fun s ⟨t, ht, Eq⟩ => ⟨t, Finset.univ, by simp [ht, Eq]⟩ · rintro s ⟨t, i, ht, rfl⟩ - letI := generateFrom { t | ∃ s : ∀ a, Set (X a), (∀ a, s a ∈ g a) ∧ t = pi univ s } + let := generateFrom { t | ∃ s : ∀ a, Set (X a), (∀ a, s a ∈ g a) ∧ t = pi univ s } refine isOpen_iff_forall_mem_open.2 fun f hf => ?_ choose c hcg hfc using fun a => sUnion_eq_univ_iff.1 (hg a) (f a) refine ⟨pi i t ∩ pi ((↑i)ᶜ : Set ι) c, inter_subset_left, ?_, ⟨hf, fun a _ => hfc a⟩⟩ diff --git a/Mathlib/Topology/ContinuousMap/Algebra.lean b/Mathlib/Topology/ContinuousMap/Algebra.lean index 4857f9538804c2..0170d061412772 100644 --- a/Mathlib/Topology/ContinuousMap/Algebra.lean +++ b/Mathlib/Topology/ContinuousMap/Algebra.lean @@ -337,7 +337,7 @@ instance instCommGroupContinuousMap [CommGroup β] [IsTopologicalGroup β] : @[to_additive] instance [CommGroup β] [IsTopologicalGroup β] : IsTopologicalGroup C(α, β) where continuous_mul := by - letI : UniformSpace β := IsTopologicalGroup.rightUniformSpace β + let : UniformSpace β := IsTopologicalGroup.rightUniformSpace β have : IsUniformGroup β := isUniformGroup_of_commGroup rw [continuous_iff_continuousAt] rintro ⟨f, g⟩ @@ -347,7 +347,7 @@ instance [CommGroup β] [IsTopologicalGroup β] : IsTopologicalGroup C(α, β) w ((tendsto_iff_forall_isCompact_tendstoUniformlyOn.mp Filter.tendsto_id K hK).prodMk (tendsto_iff_forall_isCompact_tendstoUniformlyOn.mp Filter.tendsto_id K hK)) continuous_inv := by - letI : UniformSpace β := IsTopologicalGroup.rightUniformSpace β + let : UniformSpace β := IsTopologicalGroup.rightUniformSpace β have : IsUniformGroup β := isUniformGroup_of_commGroup rw [continuous_iff_continuousAt] intro f diff --git a/Mathlib/Topology/ContinuousMap/Bounded/ArzelaAscoli.lean b/Mathlib/Topology/ContinuousMap/Bounded/ArzelaAscoli.lean index 4a249f8526e741..82d7e1bd8e8524 100644 --- a/Mathlib/Topology/ContinuousMap/Bounded/ArzelaAscoli.lean +++ b/Mathlib/Topology/ContinuousMap/Bounded/ArzelaAscoli.lean @@ -96,7 +96,7 @@ theorem arzela_ascoli₂ (s : Set β) (hs : IsCompact s) (A : Set (α →ᵇ β) let F : (α →ᵇ s) → α →ᵇ β := comp (↑) M refine IsCompact.of_isClosed_subset ((?_ : IsCompact (F ⁻¹' A)).image (continuous_comp M)) closed fun f hf => ?_ - · haveI : CompactSpace s := isCompact_iff_compactSpace.1 hs + · have : CompactSpace s := isCompact_iff_compactSpace.1 hs refine arzela_ascoli₁ _ (continuous_iff_isClosed.1 (continuous_comp M) _ closed) ?_ rw [isUniformEmbedding_subtype_val.isUniformInducing.equicontinuous_iff] exact H.comp (A.restrictPreimage F) diff --git a/Mathlib/Topology/Covering/Quotient.lean b/Mathlib/Topology/Covering/Quotient.lean index 476030c955bc6e..7296d6dae34a9d 100644 --- a/Mathlib/Topology/Covering/Quotient.lean +++ b/Mathlib/Topology/Covering/Quotient.lean @@ -123,7 +123,7 @@ noncomputable def fiberEquivGroup {x : X} (e : f ⁻¹' {x}) : f ⁻¹' {x} ≃ lemma mulActionFiber_isPretransitive (x : X) : letI := hf.mulActionFiber x MulAction.IsPretransitive G (f ⁻¹' {x}) := by - letI := hf.mulActionFiber x + let := hf.mulActionFiber x constructor intro e e' obtain ⟨g, hg⟩ := hf.apply_eq_iff_mem_orbit.mp (e'.2.trans e.2.symm) @@ -143,7 +143,7 @@ theorem toPermFiber_injective (x : X) : Function.Injective (hf.toPermFiber x) := fun _ _ eq ↦ hf.toPermFiber_ext x ⟨e, he⟩ congr($eq _) theorem exists_toPermFiber_eq {x : X} (e e' : f ⁻¹' {x}) : ∃ g, hf.toPermFiber x g e = e' := by - letI := hf.mulActionFiber x + let := hf.mulActionFiber x have := hf.mulActionFiber_isPretransitive x obtain ⟨g, rfl⟩ := MulAction.IsPretransitive.exists_smul_eq e e' (M := G) use g @@ -206,7 +206,7 @@ noncomputable def trivializationOfSMulDisjoint [TopologicalSpace G] [DiscreteTop @[to_additive] lemma isCoveringMapOn_of_smul_disjoint (disjoint : ∀ e : E, ∃ U ∈ 𝓝 e, ∀ g : G, ((g • ·) '' U ∩ U).Nonempty → g • e = e) : IsCoveringMapOn f (f '' {e | MulAction.stabilizer G e = ⊥}) := by - letI : TopologicalSpace G := ⊥; have : DiscreteTopology G := ⟨rfl⟩ + let : TopologicalSpace G := ⊥; have : DiscreteTopology G := ⟨rfl⟩ suffices ∀ x ∈ f '' {e | MulAction.stabilizer G e = ⊥}, ∃ t : Trivialization G f, x ∈ t.baseSet by choose t ht using this; exact IsCoveringMapOn.mk _ _ _ _ fun x ↦ ht x x.2 rintro x ⟨e, he, rfl⟩ diff --git a/Mathlib/Topology/DenseEmbedding.lean b/Mathlib/Topology/DenseEmbedding.lean index cf3e63756da367..92af2caba8769b 100644 --- a/Mathlib/Topology/DenseEmbedding.lean +++ b/Mathlib/Topology/DenseEmbedding.lean @@ -192,7 +192,7 @@ theorem extend_unique [T2Space γ] {f : α → γ} {g : β → γ} (di : IsDense theorem continuousAt_extend [T3Space γ] {b : β} {f : α → γ} (di : IsDenseInducing i) (hf : ∀ᶠ x in 𝓝 b, ∃ c, Tendsto f (comap i <| 𝓝 x) (𝓝 c)) : ContinuousAt (di.extend f) b := by set φ := di.extend f - haveI := di.comap_nhds_neBot + have := di.comap_nhds_neBot suffices ∀ V' ∈ 𝓝 (φ b), IsClosed V' → φ ⁻¹' V' ∈ 𝓝 b by simpa [ContinuousAt, (closed_nhds_basis (φ b)).tendsto_right_iff] intro V' V'_in V'_closed diff --git a/Mathlib/Topology/DiscreteSubset.lean b/Mathlib/Topology/DiscreteSubset.lean index 6b7212902f7641..462917d266d631 100644 --- a/Mathlib/Topology/DiscreteSubset.lean +++ b/Mathlib/Topology/DiscreteSubset.lean @@ -167,7 +167,7 @@ lemma IsDiscrete.preimage' {s : Set Y} (hs : IsDiscrete s) lemma IsDiscrete.eq_of_specializes (hs : IsDiscrete s) {a b : X} (hab : a ⤳ b) (ha : a ∈ s) (hb : b ∈ s) : a = b := by - letI := hs.1 + let := hs.1 simpa only [← Topology.IsInducing.subtypeVal.specializes_iff, hab, Subtype.mk.injEq, true_iff] using specializes_iff_eq (X := s) (x := ⟨a, ha⟩) (y := ⟨b, hb⟩) diff --git a/Mathlib/Topology/ExtendFrom.lean b/Mathlib/Topology/ExtendFrom.lean index e796c7663e3dd6..1fc4b88965207d 100644 --- a/Mathlib/Topology/ExtendFrom.lean +++ b/Mathlib/Topology/ExtendFrom.lean @@ -72,7 +72,7 @@ theorem continuousOn_extendFrom [RegularSpace Y] {f : X → Y} {A B : Set X} (hB suffices ∀ y ∈ V ∩ B, φ y ∈ V' from mem_of_superset (inter_mem_inf V_in <| mem_principal_self B) this rintro y ⟨hyV, hyB⟩ - haveI := mem_closure_iff_nhdsWithin_neBot.mp (hB hyB) + have := mem_closure_iff_nhdsWithin_neBot.mp (hB hyB) have limy : Tendsto f (𝓝[A] y) (𝓝 <| φ y) := tendsto_extendFrom (hf y hyB) have hVy : V ∈ 𝓝 y := IsOpen.mem_nhds V_op hyV have : V ∩ A ∈ 𝓝[A] y := by simpa only [inter_comm] using inter_mem_nhdsWithin A hVy diff --git a/Mathlib/Topology/ExtremallyDisconnected.lean b/Mathlib/Topology/ExtremallyDisconnected.lean index 1916abbee2f674..f20d78a916ddb2 100644 --- a/Mathlib/Topology/ExtremallyDisconnected.lean +++ b/Mathlib/Topology/ExtremallyDisconnected.lean @@ -111,7 +111,7 @@ protected theorem CompactT2.Projective.extremallyDisconnected [CompactSpace X] [ by_cases hx : x ∈ U · exact ⟨⟨(x, false), Or.inr ⟨subset_closure hx, mem_singleton _⟩⟩, rfl⟩ · exact ⟨⟨(x, true), Or.inl ⟨hx, mem_singleton _⟩⟩, rfl⟩ - haveI : CompactSpace Z := isCompact_iff_compactSpace.mp hZ.isCompact + have : CompactSpace Z := isCompact_iff_compactSpace.mp hZ.isCompact obtain ⟨g, hg, g_sec⟩ := h continuous_id f_cont f_sur let φ := Subtype.val ∘ g have hφ : Continuous φ := continuous_subtype_val.comp hg diff --git a/Mathlib/Topology/FiberBundle/Basic.lean b/Mathlib/Topology/FiberBundle/Basic.lean index 81c8a34b2ded66..bddcb12e1ae666 100644 --- a/Mathlib/Topology/FiberBundle/Basic.lean +++ b/Mathlib/Topology/FiberBundle/Basic.lean @@ -783,7 +783,7 @@ theorem isOpen_source (e : Pretrivialization F (π F E)) : theorem isOpen_target_of_mem_pretrivializationAtlas_inter (e e' : Pretrivialization F (π F E)) (he' : e' ∈ a.pretrivializationAtlas) : IsOpen (e'.toPartialEquiv.target ∩ e'.toPartialEquiv.symm ⁻¹' e.source) := by - letI := a.totalSpaceTopology + let := a.totalSpaceTopology obtain ⟨u, hu1, hu2⟩ := continuousOn_iff'.mp (a.continuous_symm_of_mem_pretrivializationAtlas he') e.source (a.isOpen_source e) rw [inter_comm, hu2] @@ -822,7 +822,7 @@ theorem totalSpaceMk_preimage_source (b : B) : @[continuity] theorem continuous_totalSpaceMk (b : B) : Continuous[_, a.totalSpaceTopology] (TotalSpace.mk b) := by - letI := a.totalSpaceTopology + let := a.totalSpaceTopology let e := a.trivializationOfMemPretrivializationAtlas (a.pretrivialization_mem_atlas b) rw [e.toOpenPartialHomeomorph.continuous_iff_continuous_comp_left (a.totalSpaceMk_preimage_source b)] @@ -831,7 +831,7 @@ theorem continuous_totalSpaceMk (b : B) : theorem inducing_totalSpaceMk_of_inducing_comp (b : B) (h : IsInducing (a.pretrivializationAt b ∘ TotalSpace.mk b)) : @IsInducing _ _ _ a.totalSpaceTopology (TotalSpace.mk b) := by - letI := a.totalSpaceTopology + let := a.totalSpaceTopology rw [← restrict_comp_codRestrict (a.mem_pretrivializationAt_source b)] at h apply IsInducing.of_codRestrict (a.mem_pretrivializationAt_source b) refine h.of_comp ?_ (continuousOn_iff_continuous_restrict.mp @@ -858,8 +858,8 @@ def toFiberBundle : @FiberBundle B F _ _ E a.totalSpaceTopology _ := trivialization_mem_atlas' := fun x ↦ ⟨_, a.pretrivialization_mem_atlas x, rfl⟩ } theorem continuous_proj : @Continuous _ _ a.totalSpaceTopology _ (π F E) := by - letI := a.totalSpaceTopology - letI := a.toFiberBundle + let := a.totalSpaceTopology + let := a.toFiberBundle exact FiberBundle.continuous_proj F E instance {e₀} (he₀ : e₀ ∈ a.pretrivializationAtlas) : @@ -875,7 +875,7 @@ theorem continuousOn_of_comp_right {X : Type*} [TopologicalSpace X] {f : TotalSp ContinuousOn (f ∘ (a.pretrivializationAt b).toPartialEquiv.symm) ((s ∩ (a.pretrivializationAt b).baseSet) ×ˢ (Set.univ : Set F))) : @ContinuousOn _ _ a.totalSpaceTopology _ f (π F E ⁻¹' s) := by - letI := a.totalSpaceTopology + let := a.totalSpaceTopology intro z hz let e : Trivialization F (π F E) := a.trivializationOfMemPretrivializationAtlas (a.pretrivialization_mem_atlas z.proj) diff --git a/Mathlib/Topology/GDelta/Basic.lean b/Mathlib/Topology/GDelta/Basic.lean index 66109db6c0356e..a2ee08f033db7f 100644 --- a/Mathlib/Topology/GDelta/Basic.lean +++ b/Mathlib/Topology/GDelta/Basic.lean @@ -111,7 +111,7 @@ protected theorem IsGδ.iInter [Countable ι'] {s : ι' → Set X} (hs : ∀ i, theorem IsGδ.biInter {s : Set ι} (hs : s.Countable) {t : ∀ i ∈ s, Set X} (ht : ∀ (i) (hi : i ∈ s), IsGδ (t i hi)) : IsGδ (⋂ i ∈ s, t i ‹_›) := by rw [biInter_eq_iInter] - haveI := hs.to_subtype + have := hs.to_subtype exact .iInter fun x => ht x x.2 diff --git a/Mathlib/Topology/Homotopy/LocallyContractible.lean b/Mathlib/Topology/Homotopy/LocallyContractible.lean index 1f2349bda7e995..90b414ec0e1f54 100644 --- a/Mathlib/Topology/Homotopy/LocallyContractible.lean +++ b/Mathlib/Topology/Homotopy/LocallyContractible.lean @@ -158,8 +158,8 @@ instance [StronglyLocallyContractibleSpace X] [StronglyLocallyContractibleSpace rw [nhds_prod_eq] exact (contractible_basis x).prod (contractible_basis y) · intro (x, y) (Ux, Uy) ⟨hUx, hUy⟩ - haveI : ContractibleSpace Ux := hUx.2 - haveI : ContractibleSpace Uy := hUy.2 + have : ContractibleSpace Ux := hUx.2 + have : ContractibleSpace Uy := hUy.2 exact (Homeomorph.Set.prod Ux Uy).contractibleSpace end Products diff --git a/Mathlib/Topology/Homotopy/TopCat/ZerothHomotopy.lean b/Mathlib/Topology/Homotopy/TopCat/ZerothHomotopy.lean index 5e833eaa0a3ae7..a0c1a429a28a30 100644 --- a/Mathlib/Topology/Homotopy/TopCat/ZerothHomotopy.lean +++ b/Mathlib/Topology/Homotopy/TopCat/ZerothHomotopy.lean @@ -98,7 +98,7 @@ lemma zerothHomotopyEquiv_symm_mk (x : (toSSet.obj X) _⦋0⦌) : zerothHomotopyEquiv.symm (.mk x) = .mk (toSSetObj₀Equiv x) := rfl instance [PathConnectedSpace X] : (toSSet.obj X).IsConnected := by - letI : Unique (ZerothHomotopy X) := Nonempty.some (by + let : Unique (ZerothHomotopy X) := Nonempty.some (by rw [unique_iff_subsingleton_and_nonempty] constructor <;> infer_instance) rw [SSet.isConnected_iff_nonempty_unique] diff --git a/Mathlib/Topology/Instances/Complex.lean b/Mathlib/Topology/Instances/Complex.lean index f476d7ae6403fc..713a64e09c69f9 100644 --- a/Mathlib/Topology/Instances/Complex.lean +++ b/Mathlib/Topology/Instances/Complex.lean @@ -52,8 +52,8 @@ continuous, then `ψ` is either the inclusion map or the composition of the incl complex conjugation. -/ theorem Complex.uniformContinuous_ringHom_eq_id_or_conj (K : Subfield ℂ) {ψ : K →+* ℂ} (hc : UniformContinuous ψ) : ψ.toFun = K.subtype ∨ ψ.toFun = conj ∘ K.subtype := by - letI : IsTopologicalDivisionRing ℂ := IsTopologicalDivisionRing.mk - letI : IsTopologicalRing K.topologicalClosure := + let : IsTopologicalDivisionRing ℂ := IsTopologicalDivisionRing.mk + let : IsTopologicalRing K.topologicalClosure := Subring.instIsTopologicalRing K.topologicalClosure.toSubring set ι : K → K.topologicalClosure := ⇑(Subfield.inclusion K.le_topologicalClosure) have ui : IsUniformInducing ι := @@ -63,7 +63,7 @@ theorem Complex.uniformContinuous_ringHom_eq_id_or_conj (K : Subfield ℂ) {ψ : let di := ui.isDenseInducing (?_ : DenseRange ι) · -- extψ : closure(K) →+* ℂ is the extension of ψ : K →+* ℂ let extψ := IsDenseInducing.extendRingHom ui di.dense hc - haveI hψ := (uniformContinuous_uniformly_extend ui di.dense hc).continuous + have hψ := (uniformContinuous_uniformly_extend ui di.dense hc).continuous rcases Complex.subfield_eq_of_closed (Subfield.isClosed_topologicalClosure K) with h | h · left let j := RingEquiv.subfieldCongr h diff --git a/Mathlib/Topology/IsLocalHomeomorph.lean b/Mathlib/Topology/IsLocalHomeomorph.lean index b4874b31b09838..46a7c4376cbfe5 100644 --- a/Mathlib/Topology/IsLocalHomeomorph.lean +++ b/Mathlib/Topology/IsLocalHomeomorph.lean @@ -53,7 +53,7 @@ theorem isLocalHomeomorphOn_iff_isOpenEmbedding_restrict {f : X → Y} : refine emb.comp ⟨.inclusion interior_subset, ?_⟩ rw [Set.range_inclusion]; exact isOpen_induced isOpen_interior obtain ⟨cont, inj, openMap⟩ := isOpenEmbedding_iff_continuous_injective_isOpenMap.mp this - haveI : Nonempty X := ⟨x⟩ + have : Nonempty X := ⟨x⟩ exact ⟨OpenPartialHomeomorph.ofContinuousOpenRestrict (Set.injOn_iff_injective.mpr inj).toPartialEquiv (continuousOn_iff_continuous_restrict.mpr cont) openMap isOpen_interior, diff --git a/Mathlib/Topology/LocallyConstant/Basic.lean b/Mathlib/Topology/LocallyConstant/Basic.lean index aa3f28e9167a39..8bd260514e4ecc 100644 --- a/Mathlib/Topology/LocallyConstant/Basic.lean +++ b/Mathlib/Topology/LocallyConstant/Basic.lean @@ -153,7 +153,7 @@ theorem iff_is_const [PreconnectedSpace X] {f : X → Y} : IsLocallyConstant f theorem range_finite [CompactSpace X] {f : X → Y} (hf : IsLocallyConstant f) : (Set.range f).Finite := by - letI : TopologicalSpace Y := ⊥; haveI := discreteTopology_bot Y + let : TopologicalSpace Y := ⊥; have := discreteTopology_bot Y exact (isCompact_range hf.continuous).finite_of_discrete @[to_additive] @@ -525,7 +525,7 @@ def piecewise {C₁ C₂ : Set X} (h₁ : IsClosed C₁) (h₂ : IsClosed C₂) toFun i := if hi : i ∈ C₁ then f ⟨i, hi⟩ else g ⟨i, (Set.compl_subset_iff_union.mpr h) hi⟩ isLocallyConstant := by let dZ : TopologicalSpace Z := ⊥ - haveI : DiscreteTopology Z := discreteTopology_bot Z + have : DiscreteTopology Z := discreteTopology_bot Z obtain ⟨f, hf⟩ := f obtain ⟨g, hg⟩ := g rw [IsLocallyConstant.iff_continuous] at hf hg ⊢ @@ -584,7 +584,7 @@ lemma piecewise'_apply_left {C₀ C₁ C₂ : Set X} (h₀ : C₀ ⊆ C₁ ∪ C [DecidablePred (· ∈ C₁)] (hf : ∀ x (hx : x ∈ C₁ ∩ C₂), f₁ ⟨x, hx.1⟩ = f₂ ⟨x, hx.2⟩) (x : C₀) (hx : x.val ∈ C₁) : piecewise' h₀ h₁ h₂ f₁ f₂ hf x = f₁ ⟨x.val, hx⟩ := by - letI : ∀ j : C₀, Decidable (j ∈ Subtype.val ⁻¹' C₁) := fun j ↦ decidable_of_iff (↑j ∈ C₁) Iff.rfl + let : ∀ j : C₀, Decidable (j ∈ Subtype.val ⁻¹' C₁) := fun j ↦ decidable_of_iff (↑j ∈ C₁) Iff.rfl rw [piecewise', piecewise_apply_left (f := (f₁.comap ⟨(restrictPreimage C₁ ((↑) : C₀ → X)), continuous_subtype_val.restrictPreimage⟩)) (hx := hx)] @@ -596,7 +596,7 @@ lemma piecewise'_apply_right {C₀ C₁ C₂ : Set X} (h₀ : C₀ ⊆ C₁ ∪ [DecidablePred (· ∈ C₁)] (hf : ∀ x (hx : x ∈ C₁ ∩ C₂), f₁ ⟨x, hx.1⟩ = f₂ ⟨x, hx.2⟩) (x : C₀) (hx : x.val ∈ C₂) : piecewise' h₀ h₁ h₂ f₁ f₂ hf x = f₂ ⟨x.val, hx⟩ := by - letI : ∀ j : C₀, Decidable (j ∈ Subtype.val ⁻¹' C₁) := fun j ↦ decidable_of_iff (↑j ∈ C₁) Iff.rfl + let : ∀ j : C₀, Decidable (j ∈ Subtype.val ⁻¹' C₁) := fun j ↦ decidable_of_iff (↑j ∈ C₁) Iff.rfl rw [piecewise', piecewise_apply_right (f := (f₁.comap ⟨(restrictPreimage C₁ ((↑) : C₀ → X)), continuous_subtype_val.restrictPreimage⟩)) (hx := hx)] diff --git a/Mathlib/Topology/Maps/Basic.lean b/Mathlib/Topology/Maps/Basic.lean index 4efc1e7e0b3e4e..f05bc5d51367aa 100644 --- a/Mathlib/Topology/Maps/Basic.lean +++ b/Mathlib/Topology/Maps/Basic.lean @@ -176,7 +176,7 @@ theorem indiscreteTopology [IndiscreteTopology Y] {f : X → Y} (hf : IsInducing IndiscreteTopology X where eq_top := by cases IndiscreteTopology.eq_top Y - letI : TopologicalSpace Y := ⊤ + let : TopologicalSpace Y := ⊤ rw [hf.eq_induced, induced_top] theorem nontrivialTopology [NontrivialTopology X] {f : X → Y} (hf : IsInducing f) : diff --git a/Mathlib/Topology/MetricSpace/Contracting.lean b/Mathlib/Topology/MetricSpace/Contracting.lean index f5f8402044f70f..c4bd6fe2e61b90 100644 --- a/Mathlib/Topology/MetricSpace/Contracting.lean +++ b/Mathlib/Topology/MetricSpace/Contracting.lean @@ -153,7 +153,7 @@ theorem exists_fixedPoint' {s : Set α} (hsc : IsComplete s) (hsf : MapsTo f s s (hf : ContractingWith K <| hsf.restrict f s s) {x : α} (hxs : x ∈ s) (hx : edist x (f x) ≠ ∞) : ∃ y ∈ s, IsFixedPt f y ∧ Tendsto (fun n ↦ f^[n] x) atTop (𝓝 y) ∧ ∀ n : ℕ, edist (f^[n] x) y ≤ edist x (f x) * (K : ℝ≥0∞) ^ n / (1 - K) := by - haveI := hsc.completeSpace_coe + have := hsc.completeSpace_coe rcases hf.exists_fixedPoint ⟨x, hxs⟩ hx with ⟨y, hfy, h_tendsto, hle⟩ refine ⟨y, y.2, Subtype.ext_iff.1 hfy, ?_, fun n ↦ ?_⟩ · convert! (continuous_subtype_val.tendsto _).comp h_tendsto diff --git a/Mathlib/Topology/MetricSpace/HausdorffDimension.lean b/Mathlib/Topology/MetricSpace/HausdorffDimension.lean index ed5a2c477ce67d..fd7cd37ef566b4 100644 --- a/Mathlib/Topology/MetricSpace/HausdorffDimension.lean +++ b/Mathlib/Topology/MetricSpace/HausdorffDimension.lean @@ -197,7 +197,7 @@ theorem dimH_iUnion {ι : Sort*} [Countable ι] (s : ι → Set X) : @[simp] theorem dimH_bUnion {s : Set ι} (hs : s.Countable) (t : ι → Set X) : dimH (⋃ i ∈ s, t i) = ⨆ i ∈ s, dimH (t i) := by - haveI := hs.toEncodable + have := hs.toEncodable rw [biUnion_eq_iUnion, dimH_iUnion, ← iSup_subtype''] @[simp] diff --git a/Mathlib/Topology/MetricSpace/HolderNorm.lean b/Mathlib/Topology/MetricSpace/HolderNorm.lean index 966b5a9b538ed3..fdc37615f136da 100644 --- a/Mathlib/Topology/MetricSpace/HolderNorm.lean +++ b/Mathlib/Topology/MetricSpace/HolderNorm.lean @@ -148,7 +148,7 @@ lemma MemHolder.of_le' {s : ℝ≥0} (hf : MemHolder r f) (hs : s ≤ r) (hX : ∃ C : ℝ≥0, ∀ x y : X, edist x y ≤ C) : MemHolder s f := by obtain ⟨C, hX⟩ := hX - letI := PseudoEMetricSpace.toPseudoMetricSpace + let := PseudoEMetricSpace.toPseudoMetricSpace fun x y ↦ ne_top_of_le_ne_top ENNReal.coe_ne_top (hX x y) have := Metric.boundedSpace_iff_edist.2 ⟨C, hX⟩ exact hf.of_le hs @@ -171,7 +171,7 @@ lemma HolderOnWith.exists_holderOnWith_of_le' {D s : ℝ≥0} {A : Set X} (hA : ∀ ⦃x⦄, x ∈ A → ∀ ⦃y⦄, y ∈ A → edist x y ≤ D) : ∃ C, HolderOnWith C s f A := by simp_rw [← HolderWith.restrict_iff] at * - letI := PseudoEMetricSpace.toPseudoMetricSpace + let := PseudoEMetricSpace.toPseudoMetricSpace fun x y : A ↦ ne_top_of_le_ne_top ENNReal.coe_ne_top (hA x.2 y.2) have : BoundedSpace A := Metric.boundedSpace_iff_edist.2 ⟨D, fun x y ↦ hA x.2 y.2⟩ exact MemHolder.of_le hf hs diff --git a/Mathlib/Topology/MetricSpace/Kuratowski.lean b/Mathlib/Topology/MetricSpace/Kuratowski.lean index b09bddacde1d24..4770c93a1d7d19 100644 --- a/Mathlib/Topology/MetricSpace/Kuratowski.lean +++ b/Mathlib/Topology/MetricSpace/Kuratowski.lean @@ -88,7 +88,7 @@ theorem exists_isometric_embedding (α : Type u) [MetricSpace α] [SeparableSpac · use fun _ => 0; intro x; exact absurd h (Nonempty.ne_empty ⟨x, mem_univ x⟩) · -- We construct a map x : ℕ → α with dense image rcases h with ⟨basepoint⟩ - haveI : Inhabited α := ⟨basepoint⟩ + have : Inhabited α := ⟨basepoint⟩ have : ∃ s : Set α, s.Countable ∧ Dense s := exists_countable_dense α rcases this with ⟨S, ⟨S_countable, S_dense⟩⟩ rcases Set.countable_iff_exists_subset_range.1 S_countable with ⟨x, x_range⟩ diff --git a/Mathlib/Topology/MetricSpace/Perfect.lean b/Mathlib/Topology/MetricSpace/Perfect.lean index b128c20a2c79d9..aa0ef95fe13ac0 100644 --- a/Mathlib/Topology/MetricSpace/Perfect.lean +++ b/Mathlib/Topology/MetricSpace/Perfect.lean @@ -135,7 +135,7 @@ from the Cantor space `ℕ → Bool`. -/ theorem IsClosed.exists_nat_bool_injection_of_not_countable {α : Type*} [TopologicalSpace α] [PolishSpace α] {C : Set α} (hC : IsClosed C) (hunc : ¬C.Countable) : ∃ f : (ℕ → Bool) → α, range f ⊆ C ∧ Continuous f ∧ Function.Injective f := by - letI := TopologicalSpace.upgradeIsCompletelyMetrizable α + let := TopologicalSpace.upgradeIsCompletelyMetrizable α obtain ⟨D, hD, Dnonempty, hDC⟩ := exists_perfect_nonempty_of_isClosed_of_not_countable hC hunc obtain ⟨f, hfD, hf⟩ := hD.exists_nat_bool_injection Dnonempty exact ⟨f, hfD.trans hDC, hf⟩ diff --git a/Mathlib/Topology/MetricSpace/PiNat.lean b/Mathlib/Topology/MetricSpace/PiNat.lean index a503e533a8f72a..3627d695d61500 100644 --- a/Mathlib/Topology/MetricSpace/PiNat.lean +++ b/Mathlib/Topology/MetricSpace/PiNat.lean @@ -702,7 +702,7 @@ theorem exists_nat_nat_continuous_surjective_of_completeSpace (α : Type*) [Metr balls `closedBall (u xₙ) (1/2^n)` have a nonempty intersection. This set is closed, and we define `f x` there to be the unique point in the intersection. This function is continuous and surjective by design. -/ - letI : MetricSpace (ℕ → ℕ) := PiNat.metricSpaceNatNat + let : MetricSpace (ℕ → ℕ) := PiNat.metricSpaceNatNat have I0 : (0 : ℝ) < 1 / 2 := by simp have I1 : (1 / 2 : ℝ) < 1 := by norm_num rcases exists_dense_seq α with ⟨u, hu⟩ @@ -1075,7 +1075,7 @@ variable [TopologicalSpace X] [CompactSpace X] lemma isHomeomorph_toPiNat (continuous_f : ∀ i, Continuous (f i)) (separating_f : Pairwise fun x y ↦ ∃ i, f i x ≠ f i y) : IsHomeomorph (toPiNat : X → PiNatEmbed X Y f) := by - letI := emetricSpace separating_f + let := emetricSpace separating_f rw [isHomeomorph_iff_continuous_bijective] exact ⟨continuous_toPiNat continuous_f, (toPiNatEquiv X Y f).bijective⟩ diff --git a/Mathlib/Topology/MetricSpace/Polish.lean b/Mathlib/Topology/MetricSpace/Polish.lean index d42f8b1fadc484..ec205e848d4f8e 100644 --- a/Mathlib/Topology/MetricSpace/Polish.lean +++ b/Mathlib/Topology/MetricSpace/Polish.lean @@ -64,8 +64,8 @@ class PolishSpace (α : Type*) [h : TopologicalSpace α] : Prop instance [TopologicalSpace α] [SeparableSpace α] [IsCompletelyMetrizableSpace α] : PolishSpace α := by - letI := upgradeIsCompletelyMetrizable α - haveI := UniformSpace.secondCountable_of_separable α + let := upgradeIsCompletelyMetrizable α + have := UniformSpace.secondCountable_of_separable α constructor namespace PolishSpace @@ -79,9 +79,9 @@ theorem exists_nat_nat_continuous_surjective (α : Type*) [TopologicalSpace α] /-- Given a closed embedding into a Polish space, the source space is also Polish. -/ theorem _root_.Topology.IsClosedEmbedding.polishSpace [TopologicalSpace α] [TopologicalSpace β] [PolishSpace β] {f : α → β} (hf : IsClosedEmbedding f) : PolishSpace α := by - letI := upgradeIsCompletelyMetrizable β - letI : MetricSpace α := hf.isEmbedding.comapMetricSpace f - haveI : SecondCountableTopology α := hf.isEmbedding.secondCountableTopology + let := upgradeIsCompletelyMetrizable β + let : MetricSpace α := hf.isEmbedding.comapMetricSpace f + have : SecondCountableTopology α := hf.isEmbedding.secondCountableTopology have : CompleteSpace α := by rw [completeSpace_iff_isComplete_range hf.isEmbedding.to_isometry.isUniformInducing] exact hf.isClosed_range.isComplete @@ -122,7 +122,7 @@ protected theorem iInf {ι : Type*} [Countable ι] {t : ι → TopologicalSpace have : @SecondCountableTopology α u.toTopologicalSpace := htop.symm ▸ secondCountableTopology_iInf fun i ↦ letI := t i; (ht i).toSecondCountableTopology have : @T1Space α u.toTopologicalSpace := - htop.symm ▸ t1Space_antitone (iInf_le _ i₀) (by letI := t i₀; haveI := ht i₀; infer_instance) + htop.symm ▸ t1Space_antitone (iInf_le _ i₀) (by let := t i₀; have := ht i₀; infer_instance) infer_instance /-- Given a Polish space, and countably many finer Polish topologies, there exists another Polish @@ -244,7 +244,7 @@ instance instCompleteSpace [CompleteSpace α] : CompleteSpace (CompleteCopy s) : /-- An open subset of a Polish space is also Polish. -/ theorem _root_.IsOpen.polishSpace {α : Type*} [TopologicalSpace α] [PolishSpace α] {s : Set α} (hs : IsOpen s) : PolishSpace s := by - letI := upgradeIsCompletelyMetrizable α + let := upgradeIsCompletelyMetrizable α lift s to Opens α using hs exact inferInstanceAs (PolishSpace s.CompleteCopy) @@ -270,9 +270,9 @@ theorem _root_.IsClosed.isClopenable [TopologicalSpace α] [PolishSpace α] {s : Pulling back this topology by the canonical bijection with `α` gives the desired Polish topology in which `s` is both open and closed. -/ classical - haveI : PolishSpace s := hs.polishSpace + have : PolishSpace s := hs.polishSpace let t : Set α := sᶜ - haveI : PolishSpace t := hs.isOpen_compl.polishSpace + have : PolishSpace t := hs.isOpen_compl.polishSpace let f : s ⊕ t ≃ α := Equiv.Set.sumCompl s have hle : TopologicalSpace.coinduced f instTopologicalSpaceSum ≤ ‹_› := by simp only [instTopologicalSpaceSum, coinduced_sup, coinduced_compose, sup_le_iff, diff --git a/Mathlib/Topology/MetricSpace/Pseudo/Basic.lean b/Mathlib/Topology/MetricSpace/Pseudo/Basic.lean index 107e604e11d6c1..c41d8cca739342 100644 --- a/Mathlib/Topology/MetricSpace/Pseudo/Basic.lean +++ b/Mathlib/Topology/MetricSpace/Pseudo/Basic.lean @@ -106,7 +106,7 @@ theorem totallyBounded_of_finite_discretization {s : Set α} · rw [hs] exact totallyBounded_empty rcases hs with ⟨x0, hx0⟩ - haveI : Inhabited s := ⟨⟨x0, hx0⟩⟩ + have : Inhabited s := ⟨⟨x0, hx0⟩⟩ refine totallyBounded_iff.2 fun ε ε0 => ?_ rcases H ε ε0 with ⟨β, fβ, F, hF⟩ let Finv := Function.invFun F @@ -214,7 +214,7 @@ namespace Topology protected lemma IsInducing.isSeparable_preimage {α : Type*} [TopologicalSpace α] [PseudoMetrizableSpace α] {f : β → α} [TopologicalSpace β] (hf : IsInducing f) {s : Set α} (hs : IsSeparable s) : IsSeparable (f ⁻¹' s) := by - letI : UniformSpace α := TopologicalSpace.pseudoMetrizableSpaceUniformity α + let : UniformSpace α := TopologicalSpace.pseudoMetrizableSpaceUniformity α have := pseudoMetrizableSpaceUniformity_countably_generated have : SeparableSpace s := hs.separableSpace have : SecondCountableTopology s := UniformSpace.secondCountable_of_separable _ diff --git a/Mathlib/Topology/MetricSpace/Pseudo/Pi.lean b/Mathlib/Topology/MetricSpace/Pseudo/Pi.lean index dacf17f4201767..023a65d4d1cb14 100644 --- a/Mathlib/Topology/MetricSpace/Pseudo/Pi.lean +++ b/Mathlib/Topology/MetricSpace/Pseudo/Pi.lean @@ -140,7 +140,7 @@ lemma sphere_pi (x : ∀ b, X b) {r : ℝ} (h : 0 < r ∨ Nonempty β) : obtain hr | rfl | hr := lt_trichotomy r 0 · simp [hr] · rw [closedBall_eq_sphere_of_nonpos le_rfl, eq_comm, Set.inter_eq_right] - letI := h.resolve_left (lt_irrefl _) + let := h.resolve_left (lt_irrefl _) inhabit β refine subset_iUnion_of_subset default ?_ intro x hx diff --git a/Mathlib/Topology/Metrizable/CompletelyMetrizable.lean b/Mathlib/Topology/Metrizable/CompletelyMetrizable.lean index e03365274cc588..6cf8b5e81c2ee6 100644 --- a/Mathlib/Topology/Metrizable/CompletelyMetrizable.lean +++ b/Mathlib/Topology/Metrizable/CompletelyMetrizable.lean @@ -102,14 +102,14 @@ namespace IsCompletelyPseudoMetrizableSpace completeness. -/ instance (priority := 90) PseudoMetrizableSpace [TopologicalSpace X] [IsCompletelyPseudoMetrizableSpace X] : PseudoMetrizableSpace X := by - letI := upgradeIsCompletelyPseudoMetrizable X + let := upgradeIsCompletelyPseudoMetrizable X infer_instance /-- A countable product of completely pseudometrizable spaces is completely pseudometrizable. -/ instance pi_countable {ι : Type*} [Countable ι] {X : ι → Type*} [∀ i, TopologicalSpace (X i)] [∀ i, IsCompletelyPseudoMetrizableSpace (X i)] : IsCompletelyPseudoMetrizableSpace (Π i, X i) := by - letI := fun i ↦ upgradeIsCompletelyPseudoMetrizable (X i) + let := fun i ↦ upgradeIsCompletelyPseudoMetrizable (X i) infer_instance /-- The product of two completely pseudometrizable spaces is completely pseudometrizable. -/ @@ -132,8 +132,8 @@ theorem _root_.Topology.IsClosedEmbedding.IsCompletelyPseudoMetrizableSpace [Top [TopologicalSpace Y] [IsCompletelyPseudoMetrizableSpace Y] {f : X → Y} (hf : IsClosedEmbedding f) : IsCompletelyPseudoMetrizableSpace X := by - letI := upgradeIsCompletelyPseudoMetrizable Y - letI : PseudoMetricSpace X := hf.isEmbedding.comapPseudoMetricSpace + let := upgradeIsCompletelyPseudoMetrizable Y + let : PseudoMetricSpace X := hf.isEmbedding.comapPseudoMetricSpace have : CompleteSpace X := by rw [completeSpace_iff_isComplete_range hf.isEmbedding.to_isometry.isUniformInducing] exact hf.isClosed_range.isComplete @@ -165,7 +165,7 @@ instance IsCompletelyMetrizableSpace.toIsCompletelyPseudoMetrizableSpace [Topolo lemma IsCompletelyMetrizableSpace_of_isCompletelyPseudoMetrizableSpace [TopologicalSpace X] [IsCompletelyPseudoMetrizableSpace X] [T0Space X] : IsCompletelyMetrizableSpace X := by - letI := upgradeIsCompletelyPseudoMetrizable X + let := upgradeIsCompletelyPseudoMetrizable X use MetricSpace.ofT0PseudoMetricSpace X exact ⟨rfl, by infer_instance⟩ @@ -213,13 +213,13 @@ namespace IsCompletelyMetrizableSpace `EMetricSpace.metrizableSpace`. This prevents unnecessary attempts to infer completeness. -/ instance (priority := 90) MetrizableSpace [TopologicalSpace X] [IsCompletelyMetrizableSpace X] : MetrizableSpace X := by - letI := upgradeIsCompletelyMetrizable X + let := upgradeIsCompletelyMetrizable X infer_instance /-- A countable product of completely metrizable spaces is completely metrizable. -/ instance pi_countable {ι : Type*} [Countable ι] {X : ι → Type*} [∀ i, TopologicalSpace (X i)] [∀ i, IsCompletelyMetrizableSpace (X i)] : IsCompletelyMetrizableSpace (Π i, X i) := by - letI := fun i ↦ upgradeIsCompletelyMetrizable (X i) + let := fun i ↦ upgradeIsCompletelyMetrizable (X i) infer_instance /-- A disjoint union of completely metrizable spaces is completely metrizable. -/ @@ -249,8 +249,8 @@ the source space is also completely metrizable. -/ theorem _root_.Topology.IsClosedEmbedding.IsCompletelyMetrizableSpace [TopologicalSpace X] [TopologicalSpace Y] [IsCompletelyMetrizableSpace Y] {f : X → Y} (hf : IsClosedEmbedding f) : IsCompletelyMetrizableSpace X := by - letI := upgradeIsCompletelyMetrizable Y - letI : MetricSpace X := hf.isEmbedding.comapMetricSpace f + let := upgradeIsCompletelyMetrizable Y + let : MetricSpace X := hf.isEmbedding.comapMetricSpace f have : CompleteSpace X := by rw [completeSpace_iff_isComplete_range hf.isEmbedding.to_isometry.isUniformInducing] exact hf.isClosed_range.isComplete diff --git a/Mathlib/Topology/Metrizable/Uniformity.lean b/Mathlib/Topology/Metrizable/Uniformity.lean index 65a49d6ea9e06f..6814c779443e60 100644 --- a/Mathlib/Topology/Metrizable/Uniformity.lean +++ b/Mathlib/Topology/Metrizable/Uniformity.lean @@ -114,7 +114,7 @@ theorem le_two_mul_dist_ofPreNNDist (d : X → X → ℝ≥0) (dist_self : ∀ x Then `d x₀ xₖ ≤ L`, `d xₖ xₖ₊₁ ≤ L`, and `d xₖ₊₁ xₙ ≤ L`, thus `d x₀ xₙ ≤ 2 * L`. -/ rw [dist_ofPreNNDist, ← NNReal.coe_two, ← NNReal.coe_mul, NNReal.mul_iInf, NNReal.coe_le_coe] refine le_ciInf fun l => ?_ - haveI : IsTrans X fun x y => d x y = 0 := by + have : IsTrans X fun x y => d x y = 0 := by refine ⟨fun a b c hab hbc ↦ ?_⟩ rw [← nonpos_iff_eq_zero] simpa only [nonpos_iff_eq_zero, hab, hbc, dist_self c, max_self, mul_zero] using hd a b c c @@ -209,7 +209,7 @@ protected theorem UniformSpace.metrizable_uniformity (X : Type*) [UniformSpace X · simpa only [not_exists, Classical.not_not, eq_self_iff_true, true_iff] using h have hd_symm x y : d x y = d y x := by simp only [d, (U _).comm] have hr : (1 / 2 : ℝ≥0) ∈ Ioo (0 : ℝ≥0) 1 := ⟨half_pos one_pos, NNReal.half_lt_self one_ne_zero⟩ - letI I := PseudoMetricSpace.ofPreNNDist d (fun x => hd₀.2 rfl) hd_symm + let I := PseudoMetricSpace.ofPreNNDist d (fun x => hd₀.2 rfl) hd_symm have hdist_le : ∀ x y, dist x y ≤ d x y := PseudoMetricSpace.dist_ofPreNNDist_le _ _ _ have hle_d : ∀ {x y : X} {n : ℕ}, (1 / 2) ^ n ≤ d x y ↔ (x, y) ∉ U n := by intro x y n diff --git a/Mathlib/Topology/Metrizable/Urysohn.lean b/Mathlib/Topology/Metrizable/Urysohn.lean index 4bc1411538a7c5..ce8c6c66c541d6 100644 --- a/Mathlib/Topology/Metrizable/Urysohn.lean +++ b/Mathlib/Topology/Metrizable/Urysohn.lean @@ -42,11 +42,11 @@ theorem exists_isInducing_l_infty : ∃ f : X → ℕ →ᵇ ℝ, IsInducing f : rcases exists_countable_basis X with ⟨B, hBc, -, hB⟩ let s : Set (Set X × Set X) := { UV ∈ B ×ˢ B | closure UV.1 ⊆ UV.2 } -- `s` is a countable set. - haveI : Encodable s := ((hBc.prod hBc).mono (sep_subset _ _)).toEncodable + have : Encodable s := ((hBc.prod hBc).mono (sep_subset _ _)).toEncodable -- We don't have the space of bounded (possibly discontinuous) functions, so we equip `s` -- with the discrete topology and deal with `s →ᵇ ℝ` instead. - letI : TopologicalSpace s := ⊥ - haveI : DiscreteTopology s := ⟨rfl⟩ + let : TopologicalSpace s := ⊥ + have : DiscreteTopology s := ⟨rfl⟩ rsuffices ⟨f, hf⟩ : ∃ f : X → s →ᵇ ℝ, IsInducing f · exact ⟨fun x => (f x).extend (Encodable.encode' s) 0, (BoundedContinuousFunction.isometry_extend (Encodable.encode' s) diff --git a/Mathlib/Topology/NhdsWithin.lean b/Mathlib/Topology/NhdsWithin.lean index eb0c67cc29d980..1b865516dd12dd 100644 --- a/Mathlib/Topology/NhdsWithin.lean +++ b/Mathlib/Topology/NhdsWithin.lean @@ -593,7 +593,7 @@ lemma nhdsSetWithin_prod_le {s s' : Set α} {t t' : Set β} : lemma mem_nhdsSet_induced {α β : Type*} {t : TopologicalSpace β} (f : α → β) (s u : Set α) : u ∈ @nhdsSet α (t.induced f) s ↔ ∃ v ∈ 𝓝ˢ (f '' s), f ⁻¹' v ⊆ u := by - letI := t.induced f + let := t.induced f simp_rw [mem_nhdsSet_iff_exists, isOpen_induced_iff] refine ⟨fun ⟨v, ⟨v', hv'⟩, hv⟩ ↦ ?_, fun ⟨v, ⟨v', hv'⟩, hv⟩ ↦ ?_⟩ · refine ⟨v', ⟨v', hv'.1, ?_, subset_rfl⟩, hv'.2.trans_subset hv.2⟩ diff --git a/Mathlib/Topology/OpenPartialHomeomorph/Constructions.lean b/Mathlib/Topology/OpenPartialHomeomorph/Constructions.lean index 39cc3938b52177..bda74e60b811cb 100644 --- a/Mathlib/Topology/OpenPartialHomeomorph/Constructions.lean +++ b/Mathlib/Topology/OpenPartialHomeomorph/Constructions.lean @@ -111,10 +111,10 @@ theorem prod_eq_prod_of_nonempty {eX eX' : OpenPartialHomeomorph X X'} {eY eY' : OpenPartialHomeomorph Y Y'} (h : (eX.prod eY).source.Nonempty) : eX.prod eY = eX'.prod eY' ↔ eX = eX' ∧ eY = eY' := by obtain ⟨⟨x, y⟩, -⟩ := id h - haveI : Nonempty X := ⟨x⟩ - haveI : Nonempty X' := ⟨eX x⟩ - haveI : Nonempty Y := ⟨y⟩ - haveI : Nonempty Y' := ⟨eY y⟩ + have : Nonempty X := ⟨x⟩ + have : Nonempty X' := ⟨eX x⟩ + have : Nonempty Y := ⟨y⟩ + have : Nonempty Y' := ⟨eY y⟩ simp_rw [OpenPartialHomeomorph.ext_iff, prod_apply, prod_symm_apply, prod_source, Prod.ext_iff, Set.prod_eq_prod_iff_of_nonempty h, forall_and, Prod.forall, forall_const, and_assoc, and_left_comm] diff --git a/Mathlib/Topology/Order.lean b/Mathlib/Topology/Order.lean index 56f78491229fab..4cdc12c5c91af1 100644 --- a/Mathlib/Topology/Order.lean +++ b/Mathlib/Topology/Order.lean @@ -77,7 +77,7 @@ theorem isOpen_generateFrom_of_mem {g : Set (Set α)} {s : Set α} (hs : s ∈ g theorem nhds_generateFrom {g : Set (Set α)} {a : α} : @nhds α (generateFrom g) a = ⨅ s ∈ { s | a ∈ s ∧ s ∈ g }, 𝓟 s := by - letI := generateFrom g + let := generateFrom g rw [nhds_def] refine le_antisymm (biInf_mono fun s ⟨as, sg⟩ => ⟨as, .basic _ sg⟩) <| le_iInf₂ ?_ rintro s ⟨ha, hs⟩ @@ -408,7 +408,7 @@ theorem isOpen_induced_iff [t : TopologicalSpace β] {s : Set α} {f : α → β theorem isClosed_induced_iff [t : TopologicalSpace β] {s : Set α} {f : α → β} : IsClosed[t.induced f] s ↔ ∃ t, IsClosed t ∧ f ⁻¹' t = s := by - letI := t.induced f + let := t.induced f simp only [← isOpen_compl_iff, isOpen_induced_iff] exact compl_surjective.exists.trans (by simp only [preimage_compl, compl_inj_iff]) @@ -422,7 +422,7 @@ theorem isClosed_coinduced {t : TopologicalSpace α} {s : Set β} {f : α → β theorem preimage_nhds_coinduced [TopologicalSpace α] {π : α → β} {s : Set β} {a : α} (hs : s ∈ @nhds β (TopologicalSpace.coinduced π ‹_›) (π a)) : π ⁻¹' s ∈ 𝓝 a := by - letI := TopologicalSpace.coinduced π ‹_› + let := TopologicalSpace.coinduced π ‹_› rcases mem_nhds_iff.mp hs with ⟨V, hVs, V_op, mem_V⟩ exact mem_nhds_iff.mpr ⟨π ⁻¹' V, Set.preimage_mono hVs, V_op, mem_V⟩ @@ -882,7 +882,7 @@ theorem continuous_id_of_le {t t' : TopologicalSpace α} (h : t ≤ t') : Contin -- 𝓝 in the induced topology theorem mem_nhds_induced [T : TopologicalSpace α] (f : β → α) (a : β) (s : Set β) : s ∈ @nhds β (TopologicalSpace.induced f T) a ↔ ∃ u ∈ 𝓝 (f a), f ⁻¹' u ⊆ s := by - letI := T.induced f + let := T.induced f simp_rw [mem_nhds_iff, isOpen_induced_iff] constructor · rintro ⟨u, usub, ⟨v, openv, rfl⟩, au⟩ diff --git a/Mathlib/Topology/Order/Compact.lean b/Mathlib/Topology/Order/Compact.lean index f0d3709f69b256..36108625e44d6b 100644 --- a/Mathlib/Topology/Order/Compact.lean +++ b/Mathlib/Topology/Order/Compact.lean @@ -145,7 +145,7 @@ variable {α β γ : Type*} [LinearOrder α] [TopologicalSpace α] theorem IsCompact.exists_isLeast [ClosedIicTopology α] {s : Set α} (hs : IsCompact s) (ne_s : s.Nonempty) : ∃ x, IsLeast s x := by - haveI : Nonempty s := ne_s.to_subtype + have : Nonempty s := ne_s.to_subtype suffices (s ∩ ⋂ x ∈ s, Iic x).Nonempty from ⟨this.choose, this.choose_spec.1, mem_iInter₂.mp this.choose_spec.2⟩ rw [biInter_eq_iInter] @@ -195,7 +195,7 @@ theorem atBot_le_cocompact [NoMinOrder α] [ClosedIicTopology α] : refine (Set.eq_empty_or_nonempty t).casesOn (fun h_empty ↦ ?_) (fun h_nonempty ↦ ?_) · rewrite [compl_univ_iff.mpr h_empty, univ_subset_iff] at hts convert! univ_mem - · haveI := h_nonempty.nonempty + · have := h_nonempty.nonempty obtain ⟨a, ha⟩ := ht.exists_isLeast h_nonempty obtain ⟨b, hb⟩ := exists_lt a exact Filter.mem_atBot_sets.mpr ⟨b, fun b' hb' ↦ hts <| Classical.byContradiction diff --git a/Mathlib/Topology/Order/IntermediateValue.lean b/Mathlib/Topology/Order/IntermediateValue.lean index 3bcb0694485bac..fa9dd6b2eb6481 100644 --- a/Mathlib/Topology/Order/IntermediateValue.lean +++ b/Mathlib/Topology/Order/IntermediateValue.lean @@ -830,7 +830,7 @@ or antitone (increasing or decreasing). -/ theorem ContinuousOn.strictMonoOn_of_injOn_Ioo {a b : α} {f : α → δ} (hab : a < b) (hf_c : ContinuousOn f (Ioo a b)) (hf_i : InjOn f (Ioo a b)) : StrictMonoOn f (Ioo a b) ∨ StrictAntiOn f (Ioo a b) := by - haveI : Inhabited (Ioo a b) := Classical.inhabited_of_nonempty (nonempty_Ioo_subtype hab) + have : Inhabited (Ioo a b) := Classical.inhabited_of_nonempty (nonempty_Ioo_subtype hab) let g : Ioo a b → δ := Set.restrict (Ioo a b) f have : StrictMono g ∨ StrictAnti g := Continuous.strictMono_of_inj hf_c.restrict hf_i.injective diff --git a/Mathlib/Topology/Order/IsLUB.lean b/Mathlib/Topology/Order/IsLUB.lean index b764d8851c42fb..c3dcdc6ce80b07 100644 --- a/Mathlib/Topology/Order/IsLUB.lean +++ b/Mathlib/Topology/Order/IsLUB.lean @@ -89,7 +89,7 @@ theorem IsLUB.mem_upperBounds_of_tendsto [Preorder γ] [TopologicalSpace γ] [Or (hb : Tendsto f (𝓝[s] a) (𝓝 b)) : b ∈ upperBounds (f '' s) := by rintro _ ⟨x, hx, rfl⟩ replace ha := ha.inter_Ici_of_mem hx - haveI := ha.nhdsWithin_neBot ⟨x, hx, le_rfl⟩ + have := ha.nhdsWithin_neBot ⟨x, hx, le_rfl⟩ refine ge_of_tendsto (hb.mono_left (nhdsWithin_mono a (inter_subset_left (t := Ici x)))) ?_ exact mem_of_superset self_mem_nhdsWithin fun y hy => hf hx hy.1 hy.2 diff --git a/Mathlib/Topology/Order/LawsonTopology.lean b/Mathlib/Topology/Order/LawsonTopology.lean index f55cea77976f08..b72e46d693d0f1 100644 --- a/Mathlib/Topology/Order/LawsonTopology.lean +++ b/Mathlib/Topology/Order/LawsonTopology.lean @@ -100,9 +100,9 @@ protected theorem isTopologicalBasis : TopologicalSpace.IsTopologicalBasis (laws (isTopologicalBasis_opens (α := WithScott α)) WithLower.toLower WithScott.toScott rw [@topology_eq_lawson α _ _ _, lawson] apply (congrArg₂ min _) _ - · letI _ := lower α + · let _ := lower α exact (@IsLower.withLowerHomeomorph α ‹_› (lower α) ⟨rfl⟩).isInducing.eq_induced - · letI _ := scott α univ + · let _ := scott α univ exact (@IsScott.withScottHomeomorph α _ (scott α univ) ⟨rfl⟩).isInducing.eq_induced end Preorder diff --git a/Mathlib/Topology/Order/LeftRightLim.lean b/Mathlib/Topology/Order/LeftRightLim.lean index 349daa40030a6a..0d580b39379eb8 100644 --- a/Mathlib/Topology/Order/LeftRightLim.lean +++ b/Mathlib/Topology/Order/LeftRightLim.lean @@ -281,8 +281,8 @@ theorem rightLim_eq_sInf [TopologicalSpace α] [OrderTopology α] [(𝓝[>] x).N rightLim_eq_of_tendsto (hf.tendsto_nhdsGT x) theorem leftLim_le (h : x ≤ y) : leftLim f x ≤ f y := by - letI : TopologicalSpace α := Preorder.topology α - haveI : OrderTopology α := ⟨rfl⟩ + let : TopologicalSpace α := Preorder.topology α + have : OrderTopology α := ⟨rfl⟩ rcases eq_or_neBot (𝓝[<] x) with h' | h' · simpa [leftLim, h'] using hf h rw [leftLim_eq_sSup hf] @@ -294,8 +294,8 @@ theorem leftLim_le (h : x ≤ y) : leftLim f x ≤ f y := by exact hf (hz.le.trans h) theorem le_leftLim (h : x < y) : f x ≤ leftLim f y := by - letI : TopologicalSpace α := Preorder.topology α - haveI : OrderTopology α := ⟨rfl⟩ + let : TopologicalSpace α := Preorder.topology α + have : OrderTopology α := ⟨rfl⟩ rcases eq_or_neBot (𝓝[<] y) with h' | h' · rw [leftLim_eq_of_eq_bot _ h'] exact hf h.le @@ -326,8 +326,8 @@ theorem leftLim_le_rightLim (h : x ≤ y) : leftLim f x ≤ rightLim f y := (hf.leftLim_le le_rfl).trans (hf.le_rightLim h) theorem rightLim_le_leftLim (h : x < y) : rightLim f x ≤ leftLim f y := by - letI : TopologicalSpace α := Preorder.topology α - haveI : OrderTopology α := ⟨rfl⟩ + let : TopologicalSpace α := Preorder.topology α + have : OrderTopology α := ⟨rfl⟩ rcases eq_or_neBot (𝓝[<] y) with (h' | h') · simpa [leftLim, h'] using rightLim_le hf h obtain ⟨a, ⟨xa, ay⟩⟩ : (Ioo x y).Nonempty := nonempty_of_mem (Ioo_mem_nhdsLT h) diff --git a/Mathlib/Topology/Order/LeftRightNhds.lean b/Mathlib/Topology/Order/LeftRightNhds.lean index 6d518605ac27d8..5767a8b5ac527d 100644 --- a/Mathlib/Topology/Order/LeftRightNhds.lean +++ b/Mathlib/Topology/Order/LeftRightNhds.lean @@ -368,7 +368,7 @@ theorem orderTopology_of_nhds_mabs {α : Type*} [TopologicalSpace α] [CommGroup (h_nhds : ∀ a : α, 𝓝 a = ⨅ r > 1, 𝓟 { b | |a / b|ₘ < r }) : OrderTopology α := by refine ⟨TopologicalSpace.ext_nhds fun a => ?_⟩ rw [h_nhds] - letI := Preorder.topology α; letI : OrderTopology α := ⟨rfl⟩ + let := Preorder.topology α; let : OrderTopology α := ⟨rfl⟩ exact (nhds_eq_iInf_mabs_div a).symm @[to_additive] diff --git a/Mathlib/Topology/Order/LowerUpperTopology.lean b/Mathlib/Topology/Order/LowerUpperTopology.lean index dea040dc9c0ff3..ff2580b0367db9 100644 --- a/Mathlib/Topology/Order/LowerUpperTopology.lean +++ b/Mathlib/Topology/Order/LowerUpperTopology.lean @@ -287,7 +287,7 @@ protected theorem isTopologicalBasis : IsTopologicalBasis (lowerBasis α) := by refine ⟨(fun a => (Ici a)ᶜ) '' F, ⟨hF.image _, image_subset_iff.2 fun _ _ => ⟨_, rfl⟩⟩, ?_⟩ simp only [sInter_image] · rintro ⟨F, ⟨hF, hs⟩, rfl⟩ - haveI := hF.to_subtype + have := hF.to_subtype rw [subset_def, Subtype.forall'] at hs choose f hf using hs exact ⟨_, finite_range f, by simp_rw [biInter_range, hf, sInter_eq_iInter]⟩ diff --git a/Mathlib/Topology/Order/ScottTopology.lean b/Mathlib/Topology/Order/ScottTopology.lean index 5e77f371f9f738..6f1d54273abad6 100644 --- a/Mathlib/Topology/Order/ScottTopology.lean +++ b/Mathlib/Topology/Order/ScottTopology.lean @@ -298,11 +298,11 @@ lemma isOpen_iff_Iic_compl_or_univ [TopologicalSpace α] [Topology.IsScott α un -- N.B. A number of conditions equivalent to `scott α = upper α` are given in Gierz _et al_, -- Chapter III, Exercise 3.23. lemma scott_eq_upper_of_completeLinearOrder : scott α univ = upper α := by - letI := upper α + let := upper α ext U rw [@Topology.IsUpper.isTopologicalSpace_basis _ _ (upper α) ({ topology_eq_upperTopology := rfl }) U] - letI := scott α univ + let := scott α univ rw [@isOpen_iff_Iic_compl_or_univ _ _ (scott α univ) ({ topology_eq_scott := rfl }) U] /-- The upper topology on a complete linear order is the Scott topology -/ diff --git a/Mathlib/Topology/Order/UpperLowerSetTopology.lean b/Mathlib/Topology/Order/UpperLowerSetTopology.lean index f5ef45ca370159..701388137247f8 100644 --- a/Mathlib/Topology/Order/UpperLowerSetTopology.lean +++ b/Mathlib/Topology/Order/UpperLowerSetTopology.lean @@ -197,7 +197,7 @@ attribute [nolint docBlame] IsUpperSet.topology_eq_upperSetTopology instance [Preorder α] : Topology.IsUpperSet (WithUpperSet α) := ⟨rfl⟩ instance [Preorder α] : @Topology.IsUpperSet α (upperSet α) _ := by - letI := upperSet α + let := upperSet α exact ⟨rfl⟩ /-- @@ -212,7 +212,7 @@ attribute [nolint docBlame] IsLowerSet.topology_eq_lowerSetTopology instance [Preorder α] : Topology.IsLowerSet (WithLowerSet α) := ⟨rfl⟩ instance [Preorder α] : @Topology.IsLowerSet α (lowerSet α) _ := by - letI := lowerSet α + let := lowerSet α exact ⟨rfl⟩ namespace IsUpperSet diff --git a/Mathlib/Topology/PartitionOfUnity.lean b/Mathlib/Topology/PartitionOfUnity.lean index 4f168a7c767a55..0816828b7d7e68 100644 --- a/Mathlib/Topology/PartitionOfUnity.lean +++ b/Mathlib/Topology/PartitionOfUnity.lean @@ -522,7 +522,7 @@ theorem sum_toPOUFun_eq (x : X) : ∑ᶠ i, f.toPOUFun i x = 1 - ∏ᶠ i, (1 - rw [hs, mulSupport_one_sub] exact fun i => id classical - letI : LinearOrder ι := linearOrderOfSTO WellOrderingRel + let : LinearOrder ι := linearOrderOfSTO WellOrderingRel rw [finsum_eq_sum_of_support_subset _ A, finprod_eq_prod_of_mulSupport_subset _ B, Finset.prod_one_sub_ordered, sub_sub_cancel] refine Finset.sum_congr rfl fun i _ => ?_ diff --git a/Mathlib/Topology/Separation/CompletelyRegular.lean b/Mathlib/Topology/Separation/CompletelyRegular.lean index 383562b85614ae..e1060e5e9b5b65 100644 --- a/Mathlib/Topology/Separation/CompletelyRegular.lean +++ b/Mathlib/Topology/Separation/CompletelyRegular.lean @@ -130,7 +130,7 @@ lemma completelyRegularSpace_induced lemma completelyRegularSpace_iInf {ι X : Type*} {t : ι → TopologicalSpace X} (ht : ∀ i, @CompletelyRegularSpace X (t i)) : @CompletelyRegularSpace X (⨅ i, t i) := by - letI := (⨅ i, t i) -- register this as default topological space to reduce `@`s + let := (⨅ i, t i) -- register this as default topological space to reduce `@`s rw [completelyRegularSpace_iff_isOpen] intro x K hK hxK simp_rw [← hK.mem_nhds_iff, nhds_iInf, mem_iInf, exists_finite_iff_finset, diff --git a/Mathlib/Topology/Separation/Connected.lean b/Mathlib/Topology/Separation/Connected.lean index 76fc3d5e5cbfd0..99d9e1285f2ce7 100644 --- a/Mathlib/Topology/Separation/Connected.lean +++ b/Mathlib/Topology/Separation/Connected.lean @@ -36,7 +36,7 @@ theorem PreconnectedSpace.trivial_of_discrete [PreconnectedSpace X] [DiscreteTop theorem IsPreconnected.infinite_of_nontrivial [T1Space X] {s : Set X} (h : IsPreconnected s) (hs : s.Nontrivial) : s.Infinite := by refine mt (fun hf => (subsingleton_coe s).mp ?_) (not_subsingleton_iff.mpr hs) - haveI := @Finite.instDiscreteTopology s _ _ hf.to_subtype + have := @Finite.instDiscreteTopology s _ _ hf.to_subtype exact @PreconnectedSpace.trivial_of_discrete _ _ (Subtype.preconnectedSpace h) _ theorem PreconnectedSpace.infinite [PreconnectedSpace X] [Nontrivial X] [T1Space X] : Infinite X := diff --git a/Mathlib/Topology/Separation/Profinite.lean b/Mathlib/Topology/Separation/Profinite.lean index e39c13acfcdf7d..1bc259a4f9b820 100644 --- a/Mathlib/Topology/Separation/Profinite.lean +++ b/Mathlib/Topology/Separation/Profinite.lean @@ -50,7 +50,7 @@ theorem nhds_basis_clopen (x : X) : (𝓝 x).HasBasis (fun s : Set X => x ∈ s let N := { s // IsClopen s ∧ x ∈ s } rsuffices ⟨⟨s, hs, hs'⟩, hs''⟩ : ∃ s : N, s.val ⊆ U · exact ⟨s, ⟨hs', hs⟩, hs''⟩ - haveI : Nonempty N := ⟨⟨univ, isClopen_univ, mem_univ x⟩⟩ + have : Nonempty N := ⟨⟨univ, isClopen_univ, mem_univ x⟩⟩ have hNcl : ∀ s : N, IsClosed s.val := fun s => s.property.1.1 have hdir : Directed GE.ge fun s : N => s.val := by rintro ⟨s, hs, hxs⟩ ⟨t, ht, hxt⟩ @@ -91,7 +91,7 @@ theorem loc_compact_Haus_tot_disc_of_zero_dim [TotallyDisconnectedSpace H] : let u : Set s := ((↑) : s → H) ⁻¹' interior s have u_open_in_s : IsOpen u := isOpen_interior.preimage continuous_subtype_val lift x to s using interior_subset xs - haveI : CompactSpace s := isCompact_iff_compactSpace.1 comp + have : CompactSpace s := isCompact_iff_compactSpace.1 comp obtain ⟨V : Set s, VisClopen, Vx, V_sub⟩ := compact_exists_isClopen_in_isOpen u_open_in_s xs have VisClopen' : IsClopen (((↑) : s → H) '' V) := by refine ⟨comp.isClosed.isClosedEmbedding_subtypeVal.isClosed_iff_image_isClosed.1 VisClopen.1, diff --git a/Mathlib/Topology/Sequences.lean b/Mathlib/Topology/Sequences.lean index 7fc21d9d8bcf05..2f4e07b6c7fd82 100644 --- a/Mathlib/Topology/Sequences.lean +++ b/Mathlib/Topology/Sequences.lean @@ -230,9 +230,9 @@ theorem SequentialSpace.coinduced [SequentialSpace X] {Y} (f : X → Y) : protected theorem SequentialSpace.iSup {X} {ι : Sort*} {t : ι → TopologicalSpace X} (h : ∀ i, @SequentialSpace X (t i)) : @SequentialSpace X (⨆ i, t i) := by - letI : TopologicalSpace X := ⨆ i, t i + let : TopologicalSpace X := ⨆ i, t i refine ⟨fun s hs ↦ isClosed_iSup_iff.2 fun i ↦ ?_⟩ - letI := t i + let := t i exact IsSeqClosed.isClosed fun u x hus hux ↦ hs hus <| hux.mono_right <| nhds_mono <| le_iSup _ _ protected theorem SequentialSpace.sup {X} {t₁ t₂ : TopologicalSpace X} diff --git a/Mathlib/Topology/Sheaves/SheafCondition/PairwiseIntersections.lean b/Mathlib/Topology/Sheaves/SheafCondition/PairwiseIntersections.lean index 10e884c34da052..37913946b61507 100644 --- a/Mathlib/Topology/Sheaves/SheafCondition/PairwiseIntersections.lean +++ b/Mathlib/Topology/Sheaves/SheafCondition/PairwiseIntersections.lean @@ -294,7 +294,7 @@ theorem isSheaf_iff_isSheafPreservesLimitPairwiseIntersections : F.IsSheaf ↔ F.IsSheafPreservesLimitPairwiseIntersections := by refine ⟨fun h U ↦ h.isSheafPreservesLimitPairwiseIntersections, fun h ↦ F.isSheaf_iff_isSheafPairwiseIntersections.mpr fun ι U ↦ ?_⟩ - haveI := h U + have := h U exact ⟨isLimitOfPreserves _ (Pairwise.coconeIsColimit U).op⟩ end TopCat.Presheaf diff --git a/Mathlib/Topology/Sheaves/SheafCondition/Sites.lean b/Mathlib/Topology/Sheaves/SheafCondition/Sites.lean index 392e27c8a3faf4..5ed46c6d44c791 100644 --- a/Mathlib/Topology/Sheaves/SheafCondition/Sites.lean +++ b/Mathlib/Topology/Sheaves/SheafCondition/Sites.lean @@ -147,7 +147,7 @@ variable {X Y : TopCat.{w}} {f : X ⟶ Y} {F : Y.Presheaf C} theorem Topology.IsOpenEmbedding.compatiblePreserving (hf : IsOpenEmbedding f) : CompatiblePreserving (Opens.grothendieckTopology Y) hf.functor := by - haveI : Mono f := (TopCat.mono_iff_injective f).mpr hf.injective + have : Mono f := (TopCat.mono_iff_injective f).mpr hf.injective apply compatiblePreservingOfDownwardsClosed intro U V i refine ⟨(Opens.map f).obj V, eqToIso <| Opens.ext <| Set.image_preimage_eq_of_subset fun x h ↦ ?_⟩ diff --git a/Mathlib/Topology/Sheaves/Stalks.lean b/Mathlib/Topology/Sheaves/Stalks.lean index b700bd02c76c02..00d6b1c30ba650 100644 --- a/Mathlib/Topology/Sheaves/Stalks.lean +++ b/Mathlib/Topology/Sheaves/Stalks.lean @@ -219,7 +219,7 @@ theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : theorem stalkPushforward_iso_of_isInducing {f : X ⟶ Y} (hf : IsInducing f) (F : X.Presheaf C) (x : X) : IsIso (F.stalkPushforward _ f x) := by - haveI := Functor.initial_of_adjunction (hf.adjunctionNhds x) + have := Functor.initial_of_adjunction (hf.adjunctionNhds x) convert! (Functor.Final.colimitIso (OpenNhds.map f x).op ((OpenNhds.inclusion x).op ⋙ F)).isIso_hom refine stalk_hom_ext _ fun U hU ↦ (stalkPushforward_germ _ f F _ x hU).trans ?_ diff --git a/Mathlib/Topology/ShrinkingLemma.lean b/Mathlib/Topology/ShrinkingLemma.lean index 770cac4e18c0b6..6f7f11eb5d5499 100644 --- a/Mathlib/Topology/ShrinkingLemma.lean +++ b/Mathlib/Topology/ShrinkingLemma.lean @@ -140,7 +140,7 @@ def chainSup (c : Set (PartialRefinement u s p)) (hc : IsChain (· ≤ ·) c) (n · use i simpa only [(find c ne i).apply_eq (mt (mem_find_carrier_iff _).1 hi)] · simp_rw [not_exists, not_and, not_imp_not, chainSupCarrier, mem_iUnion₂] at hx - haveI : Nonempty (PartialRefinement u s p) := ⟨ne.some⟩ + have : Nonempty (PartialRefinement u s p) := ⟨ne.some⟩ choose! v hvc hiv using hx rcases (hfin x hxs).exists_maximalFor v _ (mem_iUnion.1 (hU hxs)) with ⟨i, hxi : x ∈ u i, hmax : ∀ j, x ∈ u j → v i ≤ v j → v j ≤ v i⟩ @@ -216,7 +216,7 @@ corresponding original open set. -/ theorem exists_subset_iUnion_closure_subset (hs : IsClosed s) (uo : ∀ i, IsOpen (u i)) (uf : ∀ x ∈ s, { i | x ∈ u i }.Finite) (us : s ⊆ ⋃ i, u i) : ∃ v : ι → Set X, s ⊆ iUnion v ∧ (∀ i, IsOpen (v i)) ∧ ∀ i, closure (v i) ⊆ u i := by - haveI : Nonempty (PartialRefinement u s ⊤) := + have : Nonempty (PartialRefinement u s ⊤) := ⟨⟨u, ∅, uo, us, False.elim, False.elim, fun _ => rfl⟩⟩ have : ∀ c : Set (PartialRefinement u s ⊤), IsChain (· ≤ ·) c → c.Nonempty → ∃ ub, ∀ v ∈ c, v ≤ ub := @@ -344,7 +344,7 @@ theorem exists_subset_iUnion_closure_subset_t2space (hs : IsCompact s) (uo : ∀ (uf : ∀ x ∈ s, { i | x ∈ u i }.Finite) (us : s ⊆ ⋃ i, u i) : ∃ v : ι → Set X, s ⊆ iUnion v ∧ (∀ i, IsOpen (v i)) ∧ (∀ i, closure (v i) ⊆ u i) ∧ (∀ i, IsCompact (closure (v i))) := by - haveI : Nonempty (PartialRefinement u s (fun w => IsCompact (closure w))) := + have : Nonempty (PartialRefinement u s (fun w => IsCompact (closure w))) := ⟨⟨u, ∅, uo, us, False.elim, False.elim, fun _ => rfl⟩⟩ have : ∀ c : Set (PartialRefinement u s (fun w => IsCompact (closure w))), IsChain (· ≤ ·) c → c.Nonempty → ∃ ub, ∀ v ∈ c, v ≤ ub := diff --git a/Mathlib/Topology/UniformSpace/Cauchy.lean b/Mathlib/Topology/UniformSpace/Cauchy.lean index 74fd21c99e4b5b..346f9f6d9e8159 100644 --- a/Mathlib/Topology/UniformSpace/Cauchy.lean +++ b/Mathlib/Topology/UniformSpace/Cauchy.lean @@ -57,7 +57,7 @@ lemma cauchy_iff_le {l : Filter α} [hl : l.NeBot] : theorem Cauchy.ultrafilter_of {l : Filter α} (h : Cauchy l) : Cauchy (@Ultrafilter.of _ l h.1 : Filter α) := by - haveI := h.1 + have := h.1 have := Ultrafilter.of_le l exact ⟨Ultrafilter.neBot _, (Filter.prod_mono this this).trans h.2⟩ @@ -195,7 +195,7 @@ theorem CauchySeq.nonempty [Preorder β] {u : β → α} (hu : CauchySeq u) : No theorem CauchySeq.mem_entourage {β : Type*} [SemilatticeSup β] {u : β → α} (h : CauchySeq u) {V : SetRel α α} (hV : V ∈ 𝓤 α) : ∃ k₀, ∀ i j, k₀ ≤ i → k₀ ≤ j → (u i, u j) ∈ V := by - haveI := h.nonempty + have := h.nonempty have := h.tendsto_uniformity; rw [← prod_atTop_atTop_eq] at this simpa [MapsTo] using atTop_basis.prod_self.tendsto_left_iff.1 this V hV @@ -329,7 +329,7 @@ theorem isComplete_iff_clusterPt {s : Set α} : theorem isComplete_iff_ultrafilter {s : Set α} : IsComplete s ↔ ∀ l : Ultrafilter α, Cauchy (l : Filter α) → ↑l ≤ 𝓟 s → ∃ x ∈ s, ↑l ≤ 𝓝 x := by refine ⟨fun h l => h l, fun H => isComplete_iff_clusterPt.2 fun l hl hls => ?_⟩ - haveI := hl.1 + have := hl.1 rcases H (Ultrafilter.of l) hl.ultrafilter_of ((Ultrafilter.of_le l).trans hls) with ⟨x, hxs, hxl⟩ exact ⟨x, hxs, (ClusterPt.of_le_nhds hxl).mono (Ultrafilter.of_le l)⟩ @@ -505,7 +505,7 @@ theorem Filter.TotallyBounded.exists_subset_of_mem {f : Filter α} (hf : f.Total choose g hgs hgr using fun x : u => x.coe_prop.2 refine ⟨range g, ?_, ?_, ?_⟩ · exact range_subset_iff.2 hgs - · haveI : Fintype u := (fk.inter_of_left _).fintype + · have : Fintype u := (fk.inter_of_left _).fintype exact finite_range g · filter_upwards [hs, ks] with x xs ⟨y, hy, xy⟩ simp_rw [SetRel.preimage, exists_range_iff] diff --git a/Mathlib/Topology/UniformSpace/LocallyUniformConvergence.lean b/Mathlib/Topology/UniformSpace/LocallyUniformConvergence.lean index c86814c50bb786..b4092ca5e7bab6 100644 --- a/Mathlib/Topology/UniformSpace/LocallyUniformConvergence.lean +++ b/Mathlib/Topology/UniformSpace/LocallyUniformConvergence.lean @@ -141,7 +141,7 @@ theorem tendstoLocallyUniformly_iff_tendstoUniformly_of_compactSpace [CompactSpa /-- For a compact set `s`, locally uniform convergence on `s` is just uniform convergence on `s`. -/ theorem tendstoLocallyUniformlyOn_iff_tendstoUniformlyOn_of_compact (hs : IsCompact s) : TendstoLocallyUniformlyOn F f p s ↔ TendstoUniformlyOn F f p s := by - haveI : CompactSpace s := isCompact_iff_compactSpace.mp hs + have : CompactSpace s := isCompact_iff_compactSpace.mp hs refine ⟨fun h => ?_, TendstoUniformlyOn.tendstoLocallyUniformlyOn⟩ rwa [tendstoLocallyUniformlyOn_iff_tendstoLocallyUniformly_comp_coe, tendstoLocallyUniformly_iff_tendstoUniformly_of_compactSpace, ← diff --git a/Mathlib/Topology/UniformSpace/OfCompactT2.lean b/Mathlib/Topology/UniformSpace/OfCompactT2.lean index 6f639c9f41ad79..d6d172b2e99a59 100644 --- a/Mathlib/Topology/UniformSpace/OfCompactT2.lean +++ b/Mathlib/Topology/UniformSpace/OfCompactT2.lean @@ -57,7 +57,7 @@ def uniformSpaceOfCompactR1 [TopologicalSpace γ] [CompactSpace γ] [R1Space γ] rw [le_iff_forall_inf_principal_compl] intro V V_in by_contra H - haveI : NeBot (F ⊓ 𝓟 Vᶜ) := ⟨H⟩ + have : NeBot (F ⊓ 𝓟 Vᶜ) := ⟨H⟩ -- Hence compactness would give us a cluster point (x, y) for F ⊓ 𝓟 Vᶜ obtain ⟨⟨x, y⟩, hxy⟩ : ∃ p : γ × γ, ClusterPt p (F ⊓ 𝓟 Vᶜ) := exists_clusterPt_of_compactSpace _ -- In particular (x, y) is a cluster point of 𝓟 Vᶜ, hence is not in the interior of V, diff --git a/Mathlib/Topology/UniformSpace/Ultra/Constructions.lean b/Mathlib/Topology/UniformSpace/Ultra/Constructions.lean index 452694a5ae1732..d95ba71c68bdcf 100644 --- a/Mathlib/Topology/UniformSpace/Ultra/Constructions.lean +++ b/Mathlib/Topology/UniformSpace/Ultra/Constructions.lean @@ -37,7 +37,7 @@ instance SetRel.isTrans_entourageProd {s : SetRel X X} {t : SetRel Y Y} [s.IsTra lemma IsUltraUniformity.comap {u : UniformSpace Y} (h : IsUltraUniformity Y) (f : X → Y) : @IsUltraUniformity _ (u.comap f) := by - letI := u.comap f + let := u.comap f refine .mk_of_hasBasis (h.hasBasis.comap (Prod.map f f)) ?_ ?_ <;> · dsimp rintro _ ⟨_, _, _⟩ @@ -46,7 +46,7 @@ lemma IsUltraUniformity.comap {u : UniformSpace Y} (h : IsUltraUniformity Y) (f lemma IsUltraUniformity.inf {u u' : UniformSpace X} (h : @IsUltraUniformity _ u) (h' : @IsUltraUniformity _ u') : @IsUltraUniformity _ (u ⊓ u') := by - letI := u ⊓ u' + let := u ⊓ u' refine .mk_of_hasBasis (h.hasBasis.inf h'.hasBasis) ?_ ?_ <;> · dsimp rintro _ ⟨⟨_, _, _⟩, _, _, _⟩ @@ -62,7 +62,7 @@ instance IsUltraUniformity.prod [UniformSpace X] [UniformSpace Y] lemma IsUltraUniformity.iInf {ι : Type*} {U : (i : ι) → UniformSpace X} (hU : ∀ i, @IsUltraUniformity X (U i)) : @IsUltraUniformity _ (⨅ i, U i : UniformSpace X) := by - letI : UniformSpace X := ⨅ i, U i + let : UniformSpace X := ⨅ i, U i refine .mk_of_hasBasis (iInf_uniformity ▸ Filter.HasBasis.iInf fun i ↦ (hU i).hasBasis) ?_ ?_ <;> · simp only [forall_and, Subtype.forall, id_eq, Set.iInter_coe_set, and_imp] rintro _ _ _ _ _ @@ -83,7 +83,7 @@ instance IsUltraUniformity.bot [UniformSpace X] [DiscreteUniformity X] : IsUltra apply mk_of_hasBasis this <;> { rw [forall_const]; infer_instance } lemma IsUltraUniformity.top : @IsUltraUniformity X (⊤ : UniformSpace X) := by - letI : UniformSpace X := ⊤ + let : UniformSpace X := ⊤ have := Filter.hasBasis_top (α := (X × X)) rw [← top_uniformity] at this apply mk_of_hasBasis this <;> { rw [forall_const]; infer_instance } diff --git a/Mathlib/Topology/UniformSpace/UniformConvergenceTopology.lean b/Mathlib/Topology/UniformSpace/UniformConvergenceTopology.lean index 57505e711eab51..7d76a76a21dc7e 100644 --- a/Mathlib/Topology/UniformSpace/UniformConvergenceTopology.lean +++ b/Mathlib/Topology/UniformSpace/UniformConvergenceTopology.lean @@ -392,7 +392,7 @@ protected theorem postcomp_isUniformEmbedding [UniformSpace γ] {f : γ → β} `𝒰(α, γ, comap f u) = comap (fun g ↦ f ∘ g) 𝒰(α, γ, u₁)`. -/ protected theorem comap_eq {f : γ → β} : 𝒰(α, γ, ‹UniformSpace β›.comap f) = 𝒰(α, β, _).comap (f ∘ ·) := by - letI : UniformSpace γ := .comap f ‹_› + let : UniformSpace γ := .comap f ‹_› exact (UniformFun.postcomp_isUniformInducing (f := f) ⟨rfl⟩).comap_uniformSpace.symm set_option backward.isDefEq.respectTransparency false in diff --git a/Mathlib/Topology/VectorBundle/Basic.lean b/Mathlib/Topology/VectorBundle/Basic.lean index a2f4df1e3a9076..8c57a42fefaa60 100644 --- a/Mathlib/Topology/VectorBundle/Basic.lean +++ b/Mathlib/Topology/VectorBundle/Basic.lean @@ -925,8 +925,8 @@ theorem toVectorBundle : @VectorBundle R _ F E _ _ _ _ _ _ a.totalSpaceTopology rintro _ _ ⟨e, he, rfl⟩ ⟨e', he', rfl⟩ refine (a.continuousOn_coordChange he he').congr fun b hb ↦ ?_ ext v - haveI h₁ := a.linear_trivializationOfMemPretrivializationAtlas he - haveI h₂ := a.linear_trivializationOfMemPretrivializationAtlas he' + have h₁ := a.linear_trivializationOfMemPretrivializationAtlas he + have h₂ := a.linear_trivializationOfMemPretrivializationAtlas he' rw [trivializationOfMemPretrivializationAtlas] at h₁ h₂ rw [a.coordChange_apply he he' hb v, ContinuousLinearEquiv.coe_coe, Trivialization.coordChangeL_apply] diff --git a/Mathlib/Topology/VectorBundle/Riemannian.lean b/Mathlib/Topology/VectorBundle/Riemannian.lean index a5ae4263dd779a..3df28f7e7b68da 100644 --- a/Mathlib/Topology/VectorBundle/Riemannian.lean +++ b/Mathlib/Topology/VectorBundle/Riemannian.lean @@ -498,7 +498,7 @@ that the bundle is a continuous Riemannian bundle. -/ instance (g : ContinuousRiemannianMetric F E) : letI : RiemannianBundle E := ⟨g.toRiemannianMetric⟩; IsContinuousRiemannianBundle F E := by - letI : RiemannianBundle E := ⟨g.toRiemannianMetric⟩ + let : RiemannianBundle E := ⟨g.toRiemannianMetric⟩ exact ⟨⟨g.inner, g.continuous, fun b v w ↦ rfl⟩⟩ end Construction