theorem isLittleO_pow_exp_atTop {n : ℕ} : (fun x : ℝ => x ^ n) =o[atTop] Real.exp

(fun x => x ^ n) =o[Filter.atTop] Real.exp


/-- Given `c = lineMap a b r`, `a < c`, the point `(c, f c)` is non-strictly above the
segment `[(a, f a), (b, f b)]` if and only if `slope f a b ≤ slope f a c`. -/
theorem lineMap_le_map_iff_slope_le_slope_left (h : 0 < r * (b - a)) :
    lineMap (f a) (f b) r ≤ f c ↔ slope f a b ≤ slope f a c

{k : Type u_1}
{E : Type u_2}
[LinearOrderedField k]
[OrderedAddCommGroup E]
[Module k E]
[OrderedSMul k E]
{f : k → E}
{a b r : k}
(h : 0 < r * (b - a))

(AffineMap.lineMap (f a) (f b)) r ≤ f ((AffineMap.lineMap a b) r) ↔ slope f a b ≤ slope f a ((AffineMap.lineMap a b) r)


@[simp]
theorem coprime_self_sub_right {m n : ℕ} (h : m ≤ n) : Coprime n (n - m) ↔ Coprime n m


theorem one_le_convexBodyLTFactor : 1 ≤ convexBodyLTFactor K

(K : Type u_1)
[Field K]
[NumberField K]

1 ≤ NumberField.mixedEmbedding.convexBodyLTFactor K


/-- Precomposing `f` with `Prod.fst` is `C^n` -/
theorem ContDiff.fst' {f : E → G} (hf : ContDiff 𝕜 n f) : ContDiff 𝕜 n fun x : E × F => f x.1

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{n : ℕ∞}
{f : E → G}
(hf : ContDiff 𝕜 n f)


theorem lift_rank_lt_rank_dual {K : Type u} {V : Type v} [Field K] [AddCommGroup V] [Module K V]
    (h : ℵ₀ ≤ Module.rank K V) :
    Cardinal.lift.{u} (Module.rank K V) < Module.rank K (V →ₗ[K] K)

Cardinal.lift.{u, v} (Module.rank K V) < Module.rank K (V →ₗ[K] K)


@[simp] theorem modifyNth_succ_cons (f : α → α) (a : α) (l : List α) (n) :
    (a :: l).modifyNth f (n + 1) = a :: l.modifyNth f n

{α : Type u_1}
(f : α → α)
(a : α)
(l : List α)
(n : Nat)

List.modifyNth f (n + 1) (a :: l) = a :: List.modifyNth f n l


@[simp]
theorem toIocMod_add_left' (a b : α) : toIocMod hp (p + a) b = p + toIocMod hp a b

{α : Type u_1}
[LinearOrderedAddCommGroup α]
[hα : Archimedean α]
{p : α}
(hp : 0 < p)
(a b : α)


@[reassoc (attr := simp)]
lemma inr_descShortComplex : inr S.f ≫ descShortComplex S = S.g

(S : CategoryTheory.ShortComplex (CochainComplex C ℤ))

CochainComplex.mappingCone.inr S.f ≫ CochainComplex.mappingCone.descShortComplex S = S.g


@[reassoc (attr := simp)]
lemma inl_biprodXIso_inv (i : ι) :
    biprod.inl ≫ (biprodXIso K L i).inv = (biprod.inl : K ⟶ K ⊞ L).f i

[∀ (i : ι), CategoryTheory.Limits.HasBinaryBiproduct (K.X i) (L.X i)]

CategoryTheory.Limits.biprod.inl ≫ (K.biprodXIso L i).inv = CategoryTheory.Limits.biprod.inl.f i


theorem card_commonNeighbors_top [DecidableEq V] {v w : V} (h : v ≠ w) :
    Fintype.card ((⊤ : SimpleGraph V).commonNeighbors v w) = Fintype.card V - 2

{V : Type u_1}
[Fintype V]
[DecidableEq V]
{v w : V}
(h : v ≠ w)

Fintype.card ↑(⊤.commonNeighbors v w) = Fintype.card V - 2


theorem degree_C_lt_degree_C_mul_X (ha : a ≠ 0) : degree (C b) < degree (C a * X)

{R : Type u}
{a b : R}
[Semiring R]
(ha : a ≠ 0)

(Polynomial.C b).degree < (Polynomial.C a * Polynomial.X).degree


@[simp] theorem foldl_zero (f : α → Fin 0 → α) (x) : foldl 0 f x = x

{α : Sort u_1}
(f : α → Fin 0 → α)
(x : α)


theorem smul_ball {c : 𝕜} (hc : c ≠ 0) (x : E) (r : ℝ) : c • ball x r = ball (c • x) (‖c‖ * r)

{𝕜 : Type u_1}
{E : Type u_2}
[NormedField 𝕜]
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]
{c : 𝕜}
(hc : c ≠ 0)
(x : E)
(r : ℝ)

c • Metric.ball x r = Metric.ball (c • x) (‖c‖ * r)


theorem Matrix.range_toLin' (M : Matrix m n R) :
    LinearMap.range (Matrix.toLin' M) = span R (range Mᵀ)

{R : Type u_1}
[CommSemiring R]
{m : Type u_4}
{n : Type u_5}
[DecidableEq n]
[Fintype n]
(M : Matrix m n R)

LinearMap.range (Matrix.toLin' M) = Submodule.span R (Set.range Mᵀ)


/-- If `F` is full and faithful, and has a left adjoint which preserves binary products, then it is
cartesian closed.

TODO: Show the converse, that if `F` is cartesian closed and its left adjoint preserves binary
products, then it is full and faithful.
-/
theorem cartesianClosedFunctorOfLeftAdjointPreservesBinaryProducts (h : L ⊣ F) [F.Full] [F.Faithful]
    [PreservesLimitsOfShape (Discrete WalkingPair) L] : CartesianClosedFunctor F

[CategoryTheory.Limits.PreservesLimitsOfShape (CategoryTheory.Discrete CategoryTheory.Limits.WalkingPair) F]

[CategoryTheory.Limits.PreservesLimitsOfShape (CategoryTheory.Discrete CategoryTheory.Limits.WalkingPair) L]


@[to_additive]
theorem eventually_mul_left_iff (μ : Measure G) [IsMulLeftInvariant μ] (t : G) {p : G → Prop} :
    (∀ᵐ x ∂μ, p (t * x)) ↔ ∀ᵐ x ∂μ, p x

{G : Type u_2}
[MeasurableSpace G]
[Group G]
[MeasurableMul G]
(μ : MeasureTheory.Measure G)
[μ.IsMulLeftInvariant]
(t : G)
{p : G → Prop}

(∀ᵐ (x : G) ∂μ, p (t * x)) ↔ ∀ᵐ (x : G) ∂μ, p x


theorem sin_add_nat_mul_two_pi (x : ℂ) (n : ℕ) : sin (x + n * (2 * π)) = sin x

Complex.sin (x + ↑n * (2 * ↑Real.pi)) = Complex.sin x


lemma condIndepFun_iff {β γ : Type*} [mβ : MeasurableSpace β] [mγ : MeasurableSpace γ]
    (f : Ω → β) (g : Ω → γ) (hf : Measurable f) (hg : Measurable g)
    (μ : Measure Ω) [IsFiniteMeasure μ] :
    CondIndepFun m' hm' f g μ ↔ ∀ t1 t2, MeasurableSet[MeasurableSpace.comap f mβ] t1
      → MeasurableSet[MeasurableSpace.comap g mγ] t2
        → (μ⟦t1 ∩ t2 | m'⟧) =ᵐ[μ] (μ⟦t1 | m'⟧) * (μ⟦t2 | m'⟧)

{Ω : Type u_1}
(m' : MeasurableSpace Ω)
{mΩ : MeasurableSpace Ω}
[StandardBorelSpace Ω]
[Nonempty Ω]
(hm' : m' ≤ mΩ)
{β : Type u_3}
{γ : Type u_4}
[mβ : MeasurableSpace β]
[mγ : MeasurableSpace γ]
(f : Ω → β)
(g : Ω → γ)
(hf : Measurable f)
(hg : Measurable g)
(μ : MeasureTheory.Measure Ω)
[MeasureTheory.IsFiniteMeasure μ]

ProbabilityTheory.CondIndepFun m' hm' f g μ ↔
  ∀ (t1 t2 : Set Ω),
    MeasurableSet t1 →
      MeasurableSet t2 →
        μ[(t1 ∩ t2).indicator fun ω => 1|m'] =ᵐ[μ] μ[t1.indicator fun ω => 1|m'] * μ[t2.indicator fun ω => 1|m']


@[symm]
protected theorem Equiv.symm {x y} : Equiv x y → Equiv y x


lemma strictAnti_rpow_of_base_lt_one {b : ℝ} (hb₀ : 0 < b) (hb₁ : b < 1) :
    StrictAnti (b ^ · : ℝ → ℝ)


@[to_additive]
theorem IsCyclic.exponent_eq_card [Group α] [IsCyclic α] [Fintype α] :
    exponent α = Fintype.card α

{α : Type u}
[Group α]
[IsCyclic α]
[Fintype α]


@[to_additive]
theorem comp_closedEmbedding (hf : HasCompactMulSupport f) {g : α' → α}
    (hg : ClosedEmbedding g) : HasCompactMulSupport (f ∘ g)

{α : Type u_2}
{α' : Type u_3}
{β : Type u_4}
[TopologicalSpace α]
[TopologicalSpace α']
[Zero β]
{f : α → β}
(hf : HasCompactSupport f)
{g : α' → α}
(hg : ClosedEmbedding g)


@[simp]
theorem getElem_scanl_zero {h : 0 < (scanl f b l).length} : (scanl f b l)[0] = b

{α : Type u}
{β : Type v}
{f : β → α → β}
{b : β}
{l : List α}
{h : 0 < (List.scanl f b l).length}


theorem range_pullback_snd_of_left :
    Set.range (pullback.snd f g).1.base = (g ⁻¹ᵁ f.opensRange).1

[H : AlgebraicGeometry.IsOpenImmersion f]

Set.range ⇑(CategoryTheory.Limits.pullback.snd f g).val.base =
  ((TopologicalSpace.Opens.map g.val.base).obj (AlgebraicGeometry.Scheme.Hom.opensRange f)).carrier


/-- An ideal is trivial if its localization at every maximal ideal is trivial. -/
theorem ideal_eq_bot_of_localization' (I : Ideal R)
    (h : ∀ (J : Ideal R) (hJ : J.IsMaximal),
      Ideal.map (algebraMap R (Localization.AtPrime J)) I = ⊥) :
    I = ⊥


@[simp]
theorem factorSetMem_eq_mem (p : Associates α) (s : FactorSet α) : FactorSetMem p s = (p ∈ s)

{α : Type u_1}
[CancelCommMonoidWithZero α]
(p : Associates α)
(s : Associates.FactorSet α)


theorem ConcaveOn.add_const (hf : ConcaveOn 𝕜 s f) (b : β) :
    ConcaveOn 𝕜 s (f + fun _ => b)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedAddCommMonoid β]
[SMul 𝕜 E]
[Module 𝕜 β]
{s : Set E}
{f : E → β}
(hf : ConcaveOn 𝕜 s f)
(b : β)


(A : Type u_1)
(K : Type u_2)
{L : Type u}
{B : Type u_3}
[CommRing A]
[Field K]
[CommRing B]
[Field L]
[Algebra A K]
[Algebra B L]
[Algebra A B]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[IsScalarTower A B L]
[IsDomain A]
[IsFractionRing A K]
[IsIntegralClosure B A L]
[IsFractionRing B L]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]
[IsIntegrallyClosed A]
[IsDedekindDomain B]
{I : FractionalIdeal B⁰ L}
(hI : I ≠ 0)


@[simp]
theorem mk'_eq_zero {m : M} (s : S) : mk' f m s = 0 ↔ f m = 0

{R : Type u_1}
[CommSemiring R]
{S : Submonoid R}
{M : Type u_2}
{M' : Type u_3}
[AddCommMonoid M]
[AddCommMonoid M']
[Module R M]
[Module R M']
{f : M →ₗ[R] M'}
[IsLocalizedModule S f]
{m : M}
(s : ↥S)

IsLocalizedModule.mk' f m s = 0 ↔ f m = 0


@[simp]
theorem vecMul_natCast (x : ℕ) (v : m → α) : v ᵥ* x = MulOpposite.op (x : α) • v

{m : Type u_2}
{α : Type v}
[NonAssocSemiring α]
[Fintype m]
[DecidableEq m]
(x : ℕ)
(v : m → α)


theorem subset_union_right {s₁ s₂ : Finset α} : s₂ ⊆ s₁ ∪ s₂

{α : Type u_1}
[DecidableEq α]
{s₁ s₂ : Finset α}

s₂ ⊆ s₁ ∪ s₂


/-- Not registered as an instance because `R` is an `outParam` in `SMulMemClass S R M`. -/
lemma AddSubgroupClass.zsmulMemClass {S M : Type*} [SubNegMonoid M] [SetLike S M]
    [AddSubgroupClass S M] : SMulMemClass S ℤ M

{S : Type u_1}
{M : Type u_2}
[SubNegMonoid M]
[SetLike S M]
[AddSubgroupClass S M]


theorem induced_generateFrom_eq {α β} {b : Set (Set β)} {f : α → β} :
    (generateFrom b).induced f = generateFrom (preimage f '' b)

{α : Type u_1}
{β : Type u_2}
{b : Set (Set β)}
{f : α → β}

TopologicalSpace.induced f (TopologicalSpace.generateFrom b) = TopologicalSpace.generateFrom (Set.preimage f '' b)


theorem image_comap_zeroLocus_eq_zeroLocus_comap (hf : Surjective f) (I : Ideal S) :
    comap f '' zeroLocus I = zeroLocus (I.comap f)

{R : Type u}
(S : Type v)
[CommRing R]
[CommRing S]
(f : R →+* S)
(hf : Function.Surjective ⇑f)
(I : Ideal S)

⇑(PrimeSpectrum.comap f) '' PrimeSpectrum.zeroLocus ↑I = PrimeSpectrum.zeroLocus ↑(Ideal.comap f I)


/-- The exponential comparison map is natural in `A`. -/
theorem expComparison_whiskerLeft {A A' : C} (f : A' ⟶ A) :
    expComparison F A ≫ whiskerLeft _ (pre (F.map f)) =
      whiskerRight (pre f) _ ≫ expComparison F A'

[CategoryTheory.Limits.PreservesLimitsOfShape (CategoryTheory.Discrete CategoryTheory.Limits.WalkingPair) F]

CategoryTheory.CategoryStruct.comp (CategoryTheory.expComparison F A)
    (CategoryTheory.whiskerLeft F (CategoryTheory.pre (F.map f))) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.whiskerRight (CategoryTheory.pre f) F)
    (CategoryTheory.expComparison F A')


theorem ContMDiffOn.continuousOn (hf : ContMDiffOn I I' n f s) : ContinuousOn f s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f : M → M'}
{s : Set M}
{n : ℕ∞}
(hf : ContMDiffOn I I' n f s)


theorem ground_indep_iff_eq_freeOn : M.Indep M.E ↔ M = freeOn M.E


theorem IsVanKampenColimit.of_iso {F : J ⥤ C} {c c' : Cocone F} (H : IsVanKampenColimit c)
    (e : c ≅ c') : IsVanKampenColimit c'

(H : CategoryTheory.IsVanKampenColimit c)


lemma derivative_det_one_add_X_smul_aux {n} (M : Matrix (Fin n) (Fin n) R) :
    (derivative <| det (1 + (X : R[X]) • M.map C)).eval 0 = trace M

{R : Type u}
[CommRing R]
{n : ℕ}
(M : Matrix (Fin n) (Fin n) R)

Polynomial.eval 0 (Polynomial.derivative (1 + Polynomial.X • M.map ⇑Polynomial.C).det) = M.trace


@[simp]
lemma star_nonneg_iff {x : R} : 0 ≤ star x ↔ 0 ≤ x

{R : Type u}
[NonUnitalSemiring R]
[PartialOrder R]
[StarRing R]
[StarOrderedRing R]
{x : R}


theorem insertionSort_cons_eq_take_drop (a : α) (l : List α) :
    insertionSort r (a :: l) =
      ((insertionSort r l).takeWhile fun b => ¬a ≼ b) ++
        a :: (insertionSort r l).dropWhile fun b => ¬a ≼ b

{α : Type u}
(r : α → α → Prop)
[DecidableRel r]
(a : α)
(l : List α)

List.insertionSort r (a :: l) =
  List.takeWhile (fun b => decide ¬r a b) (List.insertionSort r l) ++
    a :: List.dropWhile (fun b => decide ¬r a b) (List.insertionSort r l)


@[simp]
theorem eval_zero : (0 : R[X]).eval x = 0


@[simp]
theorem submatrix_diagonal_embedding [Zero α] [DecidableEq m] [DecidableEq l] (d : m → α)
    (e : l ↪ m) : (diagonal d).submatrix e e = diagonal (d ∘ e)

{l : Type u_1}
{m : Type u_2}
{α : Type v}
[Zero α]
[DecidableEq m]
[DecidableEq l]
(d : m → α)
(e : l ↪ m)

(Matrix.diagonal d).submatrix ⇑e ⇑e = Matrix.diagonal (d ∘ ⇑e)


/-- The minimal distance to a set is continuous in point -/
@[continuity]
theorem continuous_infDist_pt : Continuous (infDist · s)

{α : Type u}
[PseudoMetricSpace α]
(s : Set α)


/-- Construct a bundled monoid homomorphism from a pointwise limit of monoid homomorphisms. -/
@[to_additive (attr := simps! (config := .asFn))
  "Construct a bundled additive monoid homomorphism from a pointwise limit of additive
monoid homomorphisms"]
def monoidHomOfTendsto (f : M₁ → M₂) (g : α → F) [l.NeBot]
    (h : Tendsto (fun a x => g a x) l (𝓝 f)) : M₁ →* M₂

(h : Filter.Tendsto (fun a x => (g a) x) l (𝓝 f))


lemma factorizationLCMLeft_mul_factorizationLCMRight (ha : a ≠ 0) (hb : b ≠ 0) :
    (factorizationLCMLeft a b) * (factorizationLCMRight a b) = lcm a b

a.factorizationLCMLeft b * a.factorizationLCMRight b = a.lcm b


@[simp]
theorem isAtomistic_dual_iff_isCoatomistic : IsAtomistic αᵒᵈ ↔ IsCoatomistic α


theorem characteristic_of_normal {p : ℕ} [Fact p.Prime] [Finite (Sylow p G)] (P : Sylow p G)
    (h : (P : Subgroup G).Normal) : (P : Subgroup G).Characteristic

{G : Type u}
[Group G]
{p : ℕ}
[Fact (Nat.Prime p)]
[Finite (Sylow p G)]
(P : Sylow p G)
(h : (↑P).Normal)


theorem to_subbox_aux (h : Integrable I l f vol) (hJ : J ≤ I) :
    ∃ y : F, HasIntegral J l f vol y ∧
      Tendsto (integralSum f vol) (l.toFilteriUnion I (Prepartition.single I J hJ)) (𝓝 y)

{ι : Type u}
{E : Type v}
{F : Type w}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{I J : BoxIntegral.Box ι}
[Fintype ι]
{l : BoxIntegral.IntegrationParams}
{f : (ι → ℝ) → E}
{vol : ι →ᵇᵃ[⊤] E →L[ℝ] F}
[CompleteSpace F]
(h : BoxIntegral.Integrable I l f vol)
(hJ : J ≤ I)

∃ y,
  BoxIntegral.HasIntegral J l f vol y ∧
    Filter.Tendsto (BoxIntegral.integralSum f vol) (l.toFilteriUnion I (BoxIntegral.Prepartition.single I J hJ)) (𝓝 y)


theorem exists_rep {X : C} {P : Cᵒᵖ ⥤ D} (x : (J.plusObj P).obj (op X)) :
    ∃ (S : J.Cover X) (y : Meq P S), x = mk y

{J : CategoryTheory.GrothendieckTopology C}

[CategoryTheory.Category.{max v u, w} D]

[∀ (X : C), CategoryTheory.Limits.HasColimitsOfShape (J.Cover X)ᵒᵖ D]

[∀ (P : CategoryTheory.Functor Cᵒᵖ D) (X : C) (S : J.Cover X), CategoryTheory.Limits.HasMultiequalizer (S.index P)]

[(X : C) → CategoryTheory.Limits.PreservesColimitsOfShape (J.Cover X)ᵒᵖ (CategoryTheory.forget D)]

(x : (CategoryTheory.forget D).obj ((J.plusObj P).obj (Opposite.op X)))

∃ S y, x = CategoryTheory.GrothendieckTopology.Plus.mk y


@[simp, norm_cast]
theorem toENNReal_one : ((1 : ℕ∞) : ℝ≥0∞) = 1


theorem antitone_int_of_succ_le {f : ℤ → α} (hf : ∀ n, f (n + 1) ≤ f n) : Antitone f

{α : Type u}
[Preorder α]
{f : ℤ → α}
(hf : ∀ (n : ℤ), f (n + 1) ≤ f n)


theorem exists_affine_mem_range_and_range_subset
    {X : Scheme.{u}} {x : X} {U : X.Opens} (hxU : x ∈ U) :
    ∃ (R : CommRingCat) (f : Spec R ⟶ X),
      IsOpenImmersion f ∧ x ∈ Set.range f.1.base ∧ Set.range f.1.base ⊆ U

{X : AlgebraicGeometry.Scheme}
{x : ↑↑X.toPresheafedSpace}
{U : X.Opens}
(hxU : x ∈ U)

∃ R f, AlgebraicGeometry.IsOpenImmersion f ∧ x ∈ Set.range ⇑f.val.base ∧ Set.range ⇑f.val.base ⊆ ↑U


theorem isFiltered_structuredArrow_of_isFiltered_of_exists [IsFilteredOrEmpty C]
    (h₁ : ∀ d, ∃ c, Nonempty (d ⟶ F.obj c)) (h₂ : ∀ {d : D} {c : C} (s s' : d ⟶ F.obj c),
      ∃ (c' : C) (t : c ⟶ c'), s ≫ F.map t = s' ≫ F.map t) (d : D) :
    IsFiltered (StructuredArrow d F)

(h₁ : ∀ (d : D), ∃ c, Nonempty (d ⟶ F.obj c))

(h₂ :
  ∀ {d : D} {c : C} (s s' : d ⟶ F.obj c),
    ∃ c' t, CategoryTheory.CategoryStruct.comp s (F.map t) = CategoryTheory.CategoryStruct.comp s' (F.map t))

CategoryTheory.IsFiltered (CategoryTheory.StructuredArrow d F)


@[simp]
theorem re_add_im (z : ℂ) : (z.re : ℂ) + z.im * I = z


/-- A natural isomorphism `L₁ ≅ L₂` induces an equivalence of categories
    `Comma L₁ R ≌ Comma L₂ R`. -/
@[simps!]
def mapLeftIso (i : L₁ ≅ L₂) : Comma L₁ R ≌ Comma L₂ R

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
(R : CategoryTheory.Functor B T)
{L₁ L₂ : CategoryTheory.Functor A T}
(i : L₁ ≅ L₂)
(X : CategoryTheory.Comma L₂ R)

((CategoryTheory.Comma.mapLeftIso R i).counitIso.inv.app X).right = CategoryTheory.CategoryStruct.id X.right


@[simp, norm_cast]
theorem coe_coe (e : P₁ ≃ᵃL[k] P₂) : ⇑(e : P₁ ≃ᵃ[k] P₂) = e

{k : Type u_1}
{P₁ : Type u_2}
{P₂ : Type u_3}
{V₁ : Type u_6}
{V₂ : Type u_7}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AddTorsor V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AddTorsor V₂ P₂]
[TopologicalSpace P₁]
[TopologicalSpace P₂]
(e : P₁ ≃ᵃL[k] P₂)


lemma mul_eq_neg_one_iff_eq_one_or_neg_one : u * v = -1 ↔ u = 1 ∧ v = -1 ∨ u = -1 ∧ v = 1


theorem ne_zero_of_not_isOrtho_self {B : BilinForm K V} (x : V) (hx₁ : ¬B.IsOrtho x x) : x ≠ 0

{V : Type u_5}
{K : Type u_6}
[Field K]
[AddCommGroup V]
[Module K V]
{B : LinearMap.BilinForm K V}
(x : V)
(hx₁ : ¬B.IsOrtho x x)


theorem expSeries_summable_of_mem_ball (x : 𝔸)
    (hx : x ∈ EMetric.ball (0 : 𝔸) (expSeries 𝕂 𝔸).radius) :
    Summable fun n => expSeries 𝕂 𝔸 n fun _ => x

(hx : x ∈ EMetric.ball 0 (NormedSpace.expSeries 𝕂 𝔸).radius)

Summable fun n => (NormedSpace.expSeries 𝕂 𝔸 n) fun x_1 => x


/-- If `f` is bounded, then the abscissa of absolute convergence of `f` is bounded above by `1`. -/
lemma LSeries.abscissaOfAbsConv_le_of_le_const {f : ℕ → ℂ} (h : ∃ C, ∀ n ≠ 0, ‖f n‖ ≤ C) :
    abscissaOfAbsConv f ≤ 1

{f : ℕ → ℂ}
(h : ∃ C, ∀ (n : ℕ), n ≠ 0 → ‖f n‖ ≤ C)


/-- An additive group is finitely generated if it is finitely generated as an additive submonoid of
itself. -/
class AddGroup.FG : Prop where
  out : (⊤ : AddSubgroup H).FG

{H : Type u_4}
[AddGroup H]
[self : AddGroup.FG H]


theorem toMeasurable_ae_eq (h : NullMeasurableSet s μ) : toMeasurable μ s =ᵐ[μ] s

(h : MeasureTheory.NullMeasurableSet s μ)


/-- **Darboux's theorem**: if `a ≤ b` and `f' b < m < f' a`, then `f' c = m` for some `c ∈ (a, b)`.
-/
theorem exists_hasDerivWithinAt_eq_of_lt_of_gt (hab : a ≤ b)
    (hf : ∀ x ∈ Icc a b, HasDerivWithinAt f (f' x) (Icc a b) x) {m : ℝ} (hma : m < f' a)
    (hmb : f' b < m) : m ∈ f' '' Ioo a b

(hf : ∀ x ∈ Set.Icc a b, HasDerivWithinAt f (f' x) (Set.Icc a b) x)


theorem lintegral_map {mβ : MeasurableSpace β} {f : β → ℝ≥0∞} {g : α → β} (hf : Measurable f)
    (hg : Measurable g) : ∫⁻ a, f a ∂map g μ = ∫⁻ a, f (g a) ∂μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{mβ : MeasurableSpace β}
{f : β → ℝ≥0∞}
{g : α → β}
(hf : Measurable f)
(hg : Measurable g)

∫⁻ (a : β), f a ∂MeasureTheory.Measure.map g μ = ∫⁻ (a : α), f (g a) ∂μ


@[simp]
theorem toMulBot_zero : toMulBot (0 : WithZero (Multiplicative α)) = Multiplicative.ofAdd ⊥

WithZero.toMulBot 0 = Multiplicative.ofAdd ⊥


@[simp] theorem zero_im : (0 : ℍ[R]).im = 0


@[simp]
theorem lookup_erase_ne {a a'} {s : Finmap β} (h : a ≠ a') : lookup a (erase a' s) = lookup a s

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a a' : α}
{s : Finmap β}
(h : a ≠ a')

Finmap.lookup a (Finmap.erase a' s) = Finmap.lookup a s


theorem floor_map_map_zero_le : ⌊f (g 0)⌋ ≤ ⌊f 0⌋ + ⌈g 0⌉


lemma level_mem_conductorSet : n ∈ conductorSet χ

{R : Type u_1}
[CommMonoidWithZero R]
{n : ℕ}
(χ : DirichletCharacter R n)


/-- A version of The Downward Löwenheim–Skolem theorem where the structure `N` elementarily embeds
into `M`, but is not by type a substructure of `M`, and thus can be chosen to belong to the universe
of the cardinal `κ`.
 -/
theorem exists_elementaryEmbedding_card_eq_of_le (M : Type w') [L.Structure M] [Nonempty M]
    (κ : Cardinal.{w}) (h1 : ℵ₀ ≤ κ) (h2 : lift.{w} L.card ≤ Cardinal.lift.{max u v} κ)
    (h3 : lift.{w'} κ ≤ Cardinal.lift.{w} #M) :
    ∃ N : Bundled L.Structure, Nonempty (N ↪ₑ[L] M) ∧ #N = κ

(h2 : Cardinal.lift.{w, max u v} L.card ≤ Cardinal.lift.{max u v, w} κ)

(h3 : Cardinal.lift.{w', w} κ ≤ Cardinal.lift.{w, w'} #M)


/-- If `CostructuredArrow F d` is filtered for any `d : D`, then `F : C ⥤ D` is initial. This is
    simply because cofiltered categories are connectged. More profoundly, the converse is also true
    if `C` is cofiltered, see `initial_iff_isCofiltered_costructuredArrow`. -/
theorem Functor.initial_of_isCofiltered_costructuredArrow
    [∀ d, IsCofiltered (CostructuredArrow F d)] : Initial F

[∀ (d : D), CategoryTheory.IsCofiltered (CategoryTheory.CostructuredArrow F d)]


lemma isUnramifiedIn_comap [IsGalois k K] {w : InfinitePlace K} :
    (w.comap (algebraMap k K)).IsUnramifiedIn K ↔ w.IsUnramified k

{k : Type u_1}
[Field k]
{K : Type u_2}
[Field K]
[Algebra k K]
[IsGalois k K]
{w : NumberField.InfinitePlace K}

NumberField.InfinitePlace.IsUnramifiedIn K (w.comap (algebraMap k K)) ↔ NumberField.InfinitePlace.IsUnramified k w


@[simp]
theorem trailingDegree_one : trailingDegree (1 : R[X]) = (0 : ℕ∞)

{R : Type u}
[Semiring R]
[Nontrivial R]


@[arith_mult]
theorem pmul [CommSemiring R] {f g : ArithmeticFunction R} (hf : f.IsMultiplicative)
    (hg : g.IsMultiplicative) : IsMultiplicative (f.pmul g)

{R : Type u_1}
[CommSemiring R]
{f g : ArithmeticFunction R}
(hf : f.IsMultiplicative)
(hg : g.IsMultiplicative)


theorem map_repr (h : IsAdjoinRoot S f) (x : S) : h.map (h.repr x) = x

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
(h : IsAdjoinRoot S f)
(x : S)


theorem mul_le_mul_of_nonneg_of_nonpos [ExistsAddOfLE α] [MulPosMono α] [PosMulMono α]
    [CovariantClass α α (swap (· + ·)) (· ≤ ·)] [ContravariantClass α α (swap (· + ·)) (· ≤ ·)]
    (hca : c ≤ a) (hbd : b ≤ d) (hc : 0 ≤ c) (hb : b ≤ 0) : a * b ≤ c * d

[CovariantClass α α (Function.swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]

[ContravariantClass α α (Function.swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]


@[to_additive]
theorem Nonempty.one_mem_div (h : s.Nonempty) : (1 : α) ∈ s / s

{α : Type u_2}
[AddGroup α]
{s : Set α}
(h : s.Nonempty)


theorem _root_.Measurable.lintegral_kernel_prod_left' {f : β × α → ℝ≥0∞} (hf : Measurable f) :
    Measurable fun y => ∫⁻ x, f (x, y) ∂κ y

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{κ : ProbabilityTheory.Kernel α β}
[ProbabilityTheory.IsSFiniteKernel κ]
{f : β × α → ℝ≥0∞}
(hf : Measurable f)

Measurable fun y => ∫⁻ (x : β), f (x, y) ∂κ y


theorem liftPropAt_congr_of_eventuallyEq (h : LiftPropAt P g x) (h₁ : g' =ᶠ[𝓝 x] g) :
    LiftPropAt P g' x

{H : Type u_1}
{M : Type u_2}
{H' : Type u_3}
{M' : Type u_4}
[TopologicalSpace H]
[TopologicalSpace M]
[ChartedSpace H M]
[TopologicalSpace H']
[TopologicalSpace M']
[ChartedSpace H' M']
{G : StructureGroupoid H}
{G' : StructureGroupoid H'}
{P : (H → H') → Set H → H → Prop}
{g g' : M → M'}
{x : M}
(hG : G.LocalInvariantProp G' P)
(h : ChartedSpace.LiftPropAt P g x)
(h₁ : g' =ᶠ[𝓝 x] g)


@[simp]
theorem comul_single (i : ι) (a : A) :
    comul (R := R) (Finsupp.single i a) =
      (TensorProduct.map (Finsupp.lsingle i) (Finsupp.lsingle i) : _ →ₗ[R] _) (comul a)

(R : Type u)
(ι : Type v)
(A : Type w)
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[Coalgebra R A]
(i : ι)
(a : A)

Coalgebra.comul (Finsupp.single i a) = (TensorProduct.map (Finsupp.lsingle i) (Finsupp.lsingle i)) (Coalgebra.comul a)


@[simp]
theorem integral_sub_center_inv (c : ℂ) {R : ℝ} (hR : R ≠ 0) :
    (∮ z in C(c, R), (z - c)⁻¹) = 2 * π * I

(∮ (z : ℂ) in C(c, R), (z - c)⁻¹) = 2 * ↑π * Complex.I


theorem Convex.mem_extremePoints_iff_mem_diff_convexHull_diff (hA : Convex 𝕜 A) :
    x ∈ A.extremePoints 𝕜 ↔ x ∈ A \ convexHull 𝕜 (A \ {x})

{𝕜 : Type u_1}
{E : Type u_2}
[LinearOrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[DenselyOrdered 𝕜]
[NoZeroSMulDivisors 𝕜 E]
{A : Set E}
{x : E}
(hA : Convex 𝕜 A)

x ∈ Set.extremePoints 𝕜 A ↔ x ∈ A \ (convexHull 𝕜) (A \ {x})


/-- A topology on `X`. -/
@[to_additive existing TopologicalSpace]
class TopologicalSpace (X : Type u) where
  /-- A predicate saying that a set is an open set. Use `IsOpen` in the root namespace instead. -/
  protected IsOpen : Set X → Prop
  /-- The set representing the whole space is an open set.
  Use `isOpen_univ` in the root namespace instead. -/
  protected isOpen_univ : IsOpen univ
  /-- The intersection of two open sets is an open set. Use `IsOpen.inter` instead. -/
  protected isOpen_inter : ∀ s t, IsOpen s → IsOpen t → IsOpen (s ∩ t)
  /-- The union of a family of open sets is an open set.
  Use `isOpen_sUnion` in the root namespace instead. -/
  protected isOpen_sUnion : ∀ s, (∀ t ∈ s, IsOpen t) → IsOpen (⋃₀ s)

{X : Type u}
[self : TopologicalSpace X]


/-- For maps between vector spaces, `MDifferentiableAt` and `DifferentiableAt` coincide -/
theorem mdifferentiableAt_iff_differentiableAt :
    MDifferentiableAt 𝓘(𝕜, E) 𝓘(𝕜, E') f x ↔ DifferentiableAt 𝕜 f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{f : E → E'}
{x : E}


theorem Tape.right₀_nth {Γ} [Inhabited Γ] (T : Tape Γ) (n : ℕ) : T.right₀.nth n = T.nth n

{Γ : Type u_1}
[Inhabited Γ]
(T : Turing.Tape Γ)
(n : ℕ)


theorem mem_rootsOfUnity_prime_pow_mul_iff (p k : ℕ) (m : ℕ+) [ExpChar R p]
    {ζ : Rˣ} : ζ ∈ rootsOfUnity (⟨p, expChar_pos R p⟩ ^ k * m) R ↔ ζ ∈ rootsOfUnity m R

(R : Type u_4)
[CommRing R]
[IsReduced R]
(p k : ℕ)
(m : ℕ+)
[ExpChar R p]
{ζ : Rˣ}

ζ ∈ rootsOfUnity (⟨p, ⋯⟩ ^ k * m) R ↔ ζ ∈ rootsOfUnity m R


lemma reflection_dualMap_eq_coreflection :
    (P.reflection i).dualMap ∘ₗ P.toLin.flip = P.toLin.flip ∘ₗ P.coreflection i

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
{N : Type u_4}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(P : RootPairing ι R M N)
(i : ι)

↑(P.reflection i).dualMap ∘ₗ P.toLin.flip = P.toLin.flip ∘ₗ ↑(P.coreflection i)


@[simp] theorem mul_eq_mul : mul p q = p * q


@[simp] theorem monotoneOn_univ : MonotoneOn f Set.univ ↔ Monotone f

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}


@[to_additive]
protected lemma one_div_mul_cancel (h : IsUnit a) : 1 / a * a = 1

{α : Type u}
[SubtractionMonoid α]
{a : α}
(h : IsAddUnit a)


@[reassoc (attr := simp)]
lemma appIso_inv_appLE {X Y : Scheme.{u}} (f : X ⟶ Y) [IsOpenImmersion f] {U V : X.Opens}
    (e : V ≤ f ⁻¹ᵁ f ''ᵁ U) :
    (f.appIso U).inv ≫ f.appLE (f ''ᵁ U) V e =
        X.presheaf.map (homOfLE (by rwa [preimage_image_eq] at e)).op

(e : V ≤ (TopologicalSpace.Opens.map f.val.base).obj ((AlgebraicGeometry.Scheme.Hom.opensFunctor f).obj U))

(AlgebraicGeometry.Scheme.Hom.appIso f U).inv ≫
    AlgebraicGeometry.Scheme.Hom.appLE f ((AlgebraicGeometry.Scheme.Hom.opensFunctor f).obj U) V e =
  X.presheaf.map (CategoryTheory.homOfLE ⋯).op


@[to_additive]
theorem exponent_ne_zero_of_finite : exponent G ≠ 0

{G : Type u}
[AddLeftCancelMonoid G]
[Finite G]


/-- See also `LieModule.iSup_ucs_eq_weightSpace_zero`. -/
@[simp] lemma iInf_lowerCentralSeries_eq_posFittingComp
    [IsNoetherian R M] [IsArtinian R M] :
    ⨅ k, lowerCentralSeries R L M k = posFittingComp R L M

(R : Type u_2)
(L : Type u_3)
(M : Type u_4)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsNilpotent R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[IsNoetherian R M]
[IsArtinian R M]

⨅ k, LieModule.lowerCentralSeries R L M k = LieModule.posFittingComp R L M


theorem HasFDerivAt.lim_real (hf : HasFDerivAt f f' x) (v : E) :
    Tendsto (fun c : ℝ => c • (f (x + c⁻¹ • v) - f x)) atTop (𝓝 (f' v))

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{f : E → F}
{f' : E →L[ℝ] F}
{x : E}
(hf : HasFDerivAt f f' x)
(v : E)

Filter.Tendsto (fun c => c • (f (x + c⁻¹ • v) - f x)) Filter.atTop (𝓝 (f' v))


lemma rightUnitor_hom_app {B C : Cat} (F : B ⟶ C) (X : B) : (ρ_ F).hom.app X = eqToHom (by simp)

{B C : CategoryTheory.Cat}
(F : B ⟶ C)
(X : ↑B)

(CategoryTheory.Bicategory.rightUnitor F).hom.app X = CategoryTheory.eqToHom ⋯


theorem isPath_cons' {xs : Path F} {a} {f : F.B a → M F} {i : F.B a} :
    IsPath (⟨a, i⟩ :: xs) (M.mk ⟨a, f⟩) → IsPath xs (f i)

{F : PFunctor.{u}}
{xs : PFunctor.Approx.Path F}
{a : F.A}
{f : F.B a → F.M}
{i : F.B a}

PFunctor.M.IsPath (⟨a, i⟩ :: xs) (PFunctor.M.mk ⟨a, f⟩) → PFunctor.M.IsPath xs (f i)


/-- The `(m * n)`-th Chebyshev `T` polynomial is the composition of the `m`-th and `n`-th. -/
theorem T_mul (m n : ℤ) : T R (m * n) = (T R m).comp (T R n)

Polynomial.Chebyshev.T R (m * n) = (Polynomial.Chebyshev.T R m).comp (Polynomial.Chebyshev.T R n)


@[simp]
theorem union_diff_right {s t : Set α} : (s ∪ t) \ t = s \ t


@[deprecated getElem_append_left (since := "2024-06-12")]
theorem get_append_left (as bs : List α) (h : i < as.length) {h'} : (as ++ bs).get ⟨i, h'⟩ = as.get ⟨i, h⟩

{α : Type u_1}
{i : Nat}
(as bs : List α)
(h : i < as.length)
{h' : i < (as ++ bs).length}


theorem IsUltrahomogeneous.amalgamation_age (h : L.IsUltrahomogeneous M) :
    Amalgamation (L.age M)

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
(h : L.IsUltrahomogeneous M)


theorem StarConvex.is_linear_preimage {s : Set F} {f : E → F} (hs : StarConvex 𝕜 (f x) s)
    (hf : IsLinearMap 𝕜 f) : StarConvex 𝕜 x (preimage f s)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[AddCommMonoid F]
[Module 𝕜 E]
[Module 𝕜 F]
{x : E}
{s : Set F}
{f : E → F}
(hs : StarConvex 𝕜 (f x) s)
(hf : IsLinearMap 𝕜 f)


theorem DifferentiableWithinAt.rpow (hf : DifferentiableWithinAt ℝ f s x)
    (hg : DifferentiableWithinAt ℝ g s x) (h : f x ≠ 0) :
    DifferentiableWithinAt ℝ (fun x => f x ^ g x) s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f g : E → ℝ}
{x : E}
{s : Set E}
(hf : DifferentiableWithinAt ℝ f s x)
(hg : DifferentiableWithinAt ℝ g s x)
(h : f x ≠ 0)


@[to_additive]
theorem index_inf_ne_zero (hH : H.index ≠ 0) (hK : K.index ≠ 0) : (H ⊓ K).index ≠ 0

{G : Type u_1}
[Group G]
{H K : Subgroup G}
(hH : H.index ≠ 0)
(hK : K.index ≠ 0)


@[ext]
theorem LaurentPolynomial.ext [Semiring R] {p q : R[T;T⁻¹]} (h : ∀ a, p a = q a) : p = q

{R : Type u_1}
[Semiring R]
{p q : R[T;T⁻¹]}
(h : ∀ (a : ℤ), p a = q a)


theorem ι_mem_evenOdd_one (m : M) : ι Q m ∈ evenOdd Q 1

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(Q : QuadraticForm R M)
(m : M)

(CliffordAlgebra.ι Q) m ∈ CliffordAlgebra.evenOdd Q 1


theorem logb_nonneg_of_base_lt_one (hx : 0 < x) (hx' : x ≤ 1) : 0 ≤ logb b x


theorem lintegral_iUnion_le [Countable β] (s : β → Set α) (f : α → ℝ≥0∞) :
    ∫⁻ a in ⋃ i, s i, f a ∂μ ≤ ∑' i, ∫⁻ a in s i, f a ∂μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[Countable β]
(s : β → Set α)
(f : α → ℝ≥0∞)

∫⁻ (a : α) in ⋃ i, s i, f a ∂μ ≤ ∑' (i : β), ∫⁻ (a : α) in s i, f a ∂μ


theorem Finite.preimage (I : Set.InjOn f (f ⁻¹' s)) (h : s.Finite) : (f ⁻¹' s).Finite

{α : Type u}
{β : Type v}
{f : α → β}
{s : Set β}
(I : Set.InjOn f (f ⁻¹' s))
(h : s.Finite)


theorem isPell_mul {b c : ℤ√d} (hb : IsPell b) (hc : IsPell c) : IsPell (b * c)

{d : ℤ}
{b c : ℤ√d}
(hb : Pell.IsPell b)
(hc : Pell.IsPell c)


theorem natDegree_add_eq_left_of_natDegree_lt (h : natDegree q < natDegree p) :
    natDegree (p + q) = natDegree p

{R : Type u}
[Semiring R]
{p q : R[X]}
(h : q.natDegree < p.natDegree)


protected theorem «exists» {p : Option α → Prop} :
    (∃ x, p x) ↔ p none ∨ ∃ x, p (some x)


theorem sup_def [∀ i, Sup (α' i)] (f g : ∀ i, α' i) : f ⊔ g = fun i => f i ⊔ g i

{ι : Type u_1}
{α' : ι → Type u_2}
[(i : ι) → Sup (α' i)]
(f g : (i : ι) → α' i)


theorem hom_lift (h : IsLimit t) {W : C} (m : W ⟶ t.pt) :
    m = h.lift { pt := W, π := { app := fun b => m ≫ t.π.app b } }

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
{t : CategoryTheory.Limits.Cone F}
(h : CategoryTheory.Limits.IsLimit t)
{W : C}
(m : W ⟶ t.pt)

m = h.lift { pt := W, π := { app := fun b => m ≫ t.π.app b, naturality := ⋯ } }


@[to_additive]
theorem Group.covariant_iff_contravariant [Group N] :
    Covariant N N (· * ·) r ↔ Contravariant N N (· * ·) r

{N : Type u_2}
{r : N → N → Prop}
[AddGroup N]

Covariant N N (fun x x_1 => x + x_1) r ↔ Contravariant N N (fun x x_1 => x + x_1) r


theorem IsSquare.not_prime (ha : IsSquare a) : ¬Prime a

{α : Type u_1}
[CancelCommMonoidWithZero α]
{a : α}
(ha : IsSquare a)


@[to_additive lt_add_of_pos_left]
theorem lt_mul_of_one_lt_left' [CovariantClass α α (swap (· * ·)) (· < ·)] (a : α) {b : α}
    (h : 1 < b) :
    a < b * a

[CovariantClass α α (Function.swap fun x x_1 => x * x_1) fun x x_1 => x < x_1]


@[simp]
theorem nndist_equiv_symm_snd (y₁ y₂ : β) :
    nndist ((WithLp.equiv p (α × β)).symm (0, y₁)) ((WithLp.equiv p (α × β)).symm (0, y₂)) =
      nndist y₁ y₂

(p : ℝ≥0∞)
(α : Type u_2)
(β : Type u_3)
[hp : Fact (1 ≤ p)]
[SeminormedAddCommGroup α]
[SeminormedAddCommGroup β]
(y₁ y₂ : β)


@[simp]
theorem apply_inv_self (e : AddAut A) (a : A) : e⁻¹ (e a) = a

(A : Type u_1)
[Add A]
(e : AddAut A)
(a : A)


/-- Temporary lemma that we can tag with `gcongr` -/
@[gcongr] theorem _root_.GCongr.Filter.map_le_map {F G : Filter α} (h : F ≤ G) :
    map m F ≤ map m G

{α : Type u}
{β : Type v}
{m : α → β}
{F G : Filter α}
(h : F ≤ G)


theorem subtypePreimage_symm_apply_coe_pos (x : { a // ¬p a } → β) (a : α) (h : p a) :
    ((subtypePreimage p x₀).symm x : α → β) a = x₀ ⟨a, h⟩

{α : Sort u_1}
{β : Sort u_2}
(p : α → Prop)
[DecidablePred p]
(x₀ : { a // p a } → β)
(x : { a // ¬p a } → β)
(a : α)
(h : p a)

↑((Equiv.subtypePreimage p x₀).symm x) a = x₀ ⟨a, h⟩


@[simp]
theorem Hom.cast_rfl_rfl {u v : U} (e : u ⟶ v) : e.cast rfl rfl = e

{U : Type u_1}
[Quiver U]
{u v : U}
(e : u ⟶ v)


theorem schur_complement_eq₁₁ [Fintype m] [DecidableEq m] [Fintype n] {A : Matrix m m 𝕜}
    (B : Matrix m n 𝕜) (D : Matrix n n 𝕜) (x : m → 𝕜) (y : n → 𝕜) [Invertible A]
    (hA : A.IsHermitian) :
    (star (x ⊕ᵥ y)) ᵥ* (fromBlocks A B Bᴴ D) ⬝ᵥ (x ⊕ᵥ y) =
      (star (x + (A⁻¹ * B) *ᵥ y)) ᵥ* A ⬝ᵥ (x + (A⁻¹ * B) *ᵥ y) +
        (star y) ᵥ* (D - Bᴴ * A⁻¹ * B) ⬝ᵥ y

{m : Type u_2}
{n : Type u_3}
{𝕜 : Type u_5}
[CommRing 𝕜]
[PartialOrder 𝕜]
[StarRing 𝕜]
[StarOrderedRing 𝕜]
[Fintype m]
[DecidableEq m]
[Fintype n]
{A : Matrix m m 𝕜}
(B : Matrix m n 𝕜)
(D : Matrix n n 𝕜)
(x : m → 𝕜)
(y : n → 𝕜)
[Invertible A]
(hA : A.IsHermitian)

Matrix.dotProduct (Matrix.vecMul (star (Sum.elim x y)) (Matrix.fromBlocks A B B.conjTranspose D)) (Sum.elim x y) =
  Matrix.dotProduct (Matrix.vecMul (star (x + (A⁻¹ * B).mulVec y)) A) (x + (A⁻¹ * B).mulVec y) +
    Matrix.dotProduct (Matrix.vecMul (star y) (D - B.conjTranspose * A⁻¹ * B)) y


@[to_additive]
theorem mulAntidiagonal_mono_right (h : t₁ ⊆ t₂) :
    mulAntidiagonal s t₁ a ⊆ mulAntidiagonal s t₂ a

{α : Type u_1}
[Add α]
{s t₁ t₂ : Set α}
{a : α}
(h : t₁ ⊆ t₂)

s.addAntidiagonal t₁ a ⊆ s.addAntidiagonal t₂ a


@[simp]
theorem coe_countP (l : List α) : countP p l = l.countP p

{α : Type u_1}
(p : α → Prop)
[DecidablePred p]
(l : List α)

Multiset.countP p ↑l = List.countP (fun b => decide (p b)) l


theorem Filter.EventuallyLE.isMinFilter {α β : Type*} [Preorder β] {f g : α → β} {a : α}
    {l : Filter α} (hle : f ≤ᶠ[l] g) (hfga : f a = g a) (h : IsMinFilter f l a) :
    IsMinFilter g l a

{α : Type u_1}
{β : Type u_2}
[Preorder β]
{f g : α → β}
{a : α}
{l : Filter α}
(hle : f ≤ᶠ[l] g)
(hfga : f a = g a)
(h : IsMinFilter f l a)


@[simp]
theorem _root_.WithLp.equiv_pi_apply (x : PiLp p α) (i : ι) : WithLp.equiv p _ x i = x i

(p : ℝ≥0∞)
{ι : Type u_2}
(α : ι → Type u_3)
(x : PiLp p α)
(i : ι)

(WithLp.equiv p ((i : ι) → α i)) x i = x i


theorem changeOrigin_toFormalMultilinearSeries [DecidableEq ι] :
    continuousMultilinearCurryFin1 𝕜 (∀ i, E i) F (f.toFormalMultilinearSeries.changeOrigin x 1) =
    f.linearDeriv x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{ι : Type u_2}
{E : ι → Type u_3}
[(i : ι) → NormedAddCommGroup (E i)]
[(i : ι) → NormedSpace 𝕜 (E i)]
[Fintype ι]
(f : ContinuousMultilinearMap 𝕜 E F)
(x : (i : ι) → E i)
[DecidableEq ι]

(continuousMultilinearCurryFin1 𝕜 ((i : ι) → E i) F) (f.toFormalMultilinearSeries.changeOrigin x 1) = f.linearDeriv x


theorem mem_image_const : c ∈ s.image (const α b) ↔ s.Nonempty ∧ b = c

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
{s : Finset α}
{b c : β}

c ∈ Finset.image (Function.const α b) s ↔ s.Nonempty ∧ b = c


/-- A sheaf of modules is finitely presented if it is locally the cokernel of a
morphism between coproducts of finitely many copies of the sheaf of rings.. -/
class IsFinitePresentation : Prop where
  exists_quasicoherentData :
    ∃ (σ : M.QuasicoherentData), ∀ (i : σ.I), (Finite (σ.presentation i).generators.I ∧
      Finite (σ.presentation i).relations.I)

{J : CategoryTheory.GrothendieckTopology C}

[∀ (X : C), (J.over X).HasSheafCompose (CategoryTheory.forget₂ RingCat AddCommGrp)]

[∀ (X : C), CategoryTheory.HasWeakSheafify (J.over X) AddCommGrp]

[∀ (X : C), (J.over X).WEqualsLocallyBijective AddCommGrp]

∃ σ, ∀ (i : σ.I), Finite (σ.presentation i).generators.I ∧ Finite (σ.presentation i).relations.I


lemma _root_.Set.Infinite.card_eq_zero {s : Set α} (hs : s.Infinite) : Nat.card s = 0

{α : Type u_1}
{s : Set α}
(hs : s.Infinite)


@[simp]
protected theorem LowerSet.lowerClosure (s : LowerSet α) : lowerClosure (s : Set α) = s

{α : Type u_1}
[Preorder α]
(s : LowerSet α)


/-- A set is a neighborhood of `a` within `(-∞, a]` if and only if it contains an interval `[l, a]`
with `l < a`. -/
theorem mem_nhdsWithin_Iic_iff_exists_Icc_subset [NoMinOrder α] [DenselyOrdered α] {a : α}
    {s : Set α} : s ∈ 𝓝[≤] a ↔ ∃ l, l < a ∧ Icc l a ⊆ s

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[NoMinOrder α]
[DenselyOrdered α]
{a : α}
{s : Set α}


theorem inf_left_right_swap (a b c : α) : a ⊓ b ⊓ c = c ⊓ b ⊓ a

{α : Type u}
[SemilatticeInf α]
(a b c : α)


/-- A point is in an affine subspace coerced to a set if and only if it is in that affine
subspace. -/
-- Porting note: removed `simp`, proof is `simp only [SetLike.mem_coe]`
theorem mem_coe (p : P) (s : AffineSubspace k P) : p ∈ (s : Set P) ↔ p ∈ s

(k : Type u_1)
{V : Type u_2}
(P : Type u_3)
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
(p : P)
(s : AffineSubspace k P)

p ∈ ↑s ↔ p ∈ s


theorem disjUnion_tag_of_mem_left (h : Disjoint π₁.iUnion π₂.iUnion) (hJ : J ∈ π₁) :
    (π₁.disjUnion π₂ h).tag J = π₁.tag J

{π₁ π₂ : BoxIntegral.TaggedPrepartition I}


theorem inner_self (a : ℍ) : ⟪a, a⟫ = normSq a


theorem ClusterPt.mono {f g : Filter X} (H : ClusterPt x f) (h : f ≤ g) : ClusterPt x g

{X : Type u}
{x : X}
[TopologicalSpace X]
{f g : Filter X}
(H : ClusterPt x f)
(h : f ≤ g)


theorem prod_eq_prod_of_nonempty {eX eX' : PartialHomeomorph X X'} {eY eY' : PartialHomeomorph Y Y'}
    (h : (eX.prod eY).source.Nonempty) : eX.prod eY = eX'.prod eY' ↔ eX = eX' ∧ eY = eY'

{X : Type u_1}
{X' : Type u_2}
{Y : Type u_3}
{Y' : Type u_4}
[TopologicalSpace X]
[TopologicalSpace X']
[TopologicalSpace Y]
[TopologicalSpace Y']
{eX eX' : PartialHomeomorph X X'}
{eY eY' : PartialHomeomorph Y Y'}
(h : (eX.prod eY).source.Nonempty)


theorem numDerangements_add_two (n : ℕ) :
    numDerangements (n + 2) = (n + 1) * (numDerangements n + numDerangements (n + 1))


/-- The tautological fully faithful functor `Karoubi (J ⥤ C) ⥤ (J ⥤ Karoubi C)`. -/
@[simps]
def karoubiFunctorCategoryEmbedding : Karoubi (J ⥤ C) ⥤ J ⥤ Karoubi C

(P : CategoryTheory.Idempotents.Karoubi (J ⥤ C))

(CategoryTheory.Idempotents.karoubiFunctorCategoryEmbedding J C).obj P =
  CategoryTheory.Idempotents.KaroubiFunctorCategoryEmbedding.obj P


lemma IsUnramified.comap_algHom {w : InfinitePlace F} (h : IsUnramified k w) (f : K →ₐ[k] F) :
    IsUnramified k (w.comap (f : K →+* F))

(h : NumberField.InfinitePlace.IsUnramified k w)

NumberField.InfinitePlace.IsUnramified k (w.comap ↑f)


@[fun_prop]
nonrec theorem HasFDerivAt.add_const (hf : HasFDerivAt f f' x) (c : F) :
    HasFDerivAt (fun x => f x + c) f' x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{f' : E →L[𝕜] F}
{x : E}
(hf : HasFDerivAt f f' x)
(c : F)


theorem IsMittagLeffler.eq_image_eventualRange (h : F.IsMittagLeffler) (f : j ⟶ i) :
    F.eventualRange i = F.map f '' F.eventualRange j

{J : Type u}
[CategoryTheory.Category.{u_1, u} J]
(F : J ⥤ Type v)
{i j : J}
[CategoryTheory.IsCofilteredOrEmpty J]
(h : F.IsMittagLeffler)
(f : j ⟶ i)


@[to_additive]
theorem iUnion_div_left_image : ⋃ a ∈ s, (a / ·) '' t = s / t


@[gcongr] theorem max_le_max_left (c) (h : a ≤ b) : max c a ≤ max c b

{α : Type u}
[LinearOrder α]
{a b : α}
(c : α)
(h : a ≤ b)


@[simp]
theorem map_zero (f : E →ₗ.[R] F) : f 0 = 0

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
(f : E →ₗ.[R] F)


/-- The eigenspaces of a linear operator form an independent family of subspaces of `M`.  That is,
any eigenspace has trivial intersection with the span of all the other eigenspaces. -/
theorem eigenspaces_independent [NoZeroSMulDivisors R M] (f : End R M) :
    CompleteLattice.Independent f.eigenspace

{R : Type v}
{M : Type w}
[CommRing R]
[AddCommGroup M]
[Module R M]
[NoZeroSMulDivisors R M]
(f : Module.End R M)


@[to_additive (attr := simp)]
lemma mul_of {A : Type*} [Monoid A] (a b : A) :
    @HMul.hMul (MonCat.of A) (MonCat.of A) (MonCat.of A) _ a b = a * b


lemma _root_.Filter.Tendsto.ofReal {α : Type*} {l : Filter α} {f : α → ℝ} {x : ℝ}
    (hf : Tendsto f l (𝓝 x)) : Tendsto (fun x ↦ (f x : ℂ)) l (𝓝 (x : ℂ))

{α : Type u_2}
{l : Filter α}
{f : α → ℝ}
{x : ℝ}
(hf : Filter.Tendsto f l (nhds x))

Filter.Tendsto (fun x => ↑(f x)) l (nhds ↑x)


@[simp]
theorem floor_natCast (n : ℕ) : ⌊(n : α)⌋ = n

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(n : ℕ)


@[simp]
theorem measurableSet_insert {a : α} {s : Set α} : MeasurableSet (insert a s) ↔ MeasurableSet s

{α : Type u_1}
[MeasurableSpace α]
[MeasurableSingletonClass α]
{a : α}
{s : Set α}


lemma iInf_toNat : (⨅ i, (f i : ℕ∞)).toNat = ⨅ i, f i


@[to_additive (attr := simp)]
theorem op_top : (⊤ : Submonoid M).op = ⊤


theorem isPrimePow_def : IsPrimePow n ↔ ∃ (p : R) (k : ℕ), Prime p ∧ 0 < k ∧ p ^ k = n

{R : Type u_1}
[CommMonoidWithZero R]
(n : R)

IsPrimePow n ↔ ∃ p k, Prime p ∧ 0 < k ∧ p ^ k = n


@[to_additive]
theorem Filter.EventuallyEq.of_mulIndicator_const [One β] {l : Filter α} {c : β} (hc : c ≠ 1)
    {s t : Set α} (h : s.mulIndicator (fun _ ↦ c) =ᶠ[l] t.mulIndicator fun _ ↦ c) : s =ᶠ[l] t

(h : (s.indicator fun x => c) =ᶠ[l] t.indicator fun x => c)


@[simp]
theorem bind_zero_right' (m : Measure α) : bind m (fun _ => 0 : α → Measure β) = 0

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
(m : MeasureTheory.Measure α)


@[simp]
theorem act_invAct_eq (x y : R) : x ◃ x ◃⁻¹ y = y


theorem nhds_def (x : tsze R M) : 𝓝 x = (𝓝 x.fst).prod (𝓝 x.snd)

{R : Type u_3}
{M : Type u_4}
[TopologicalSpace R]
[TopologicalSpace M]
(x : tsze R M)


theorem Periodic.nat_mul [Semiring α] (h : Periodic f c) (n : ℕ) : Periodic f (n * c)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c : α}
[Semiring α]
(h : Function.Periodic f c)
(n : ℕ)


@[simp]
theorem natCast_apply [NatCast β] (n : ℕ) (x : α) : (n : C(α, β)) x = n

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[NatCast β]
(n : ℕ)
(x : α)


theorem IsNilpotent.eq_zero [Zero R] [Pow R ℕ] [IsReduced R] (h : IsNilpotent x) : x = 0

{R : Type u_1}
{x : R}
[Zero R]
[Pow R ℕ]
[IsReduced R]
(h : IsNilpotent x)


@[to_additive (attr := simp)]
theorem self_trans_symm (e : M ≃* N) : e.trans e.symm = refl M

{M : Type u_6}
{N : Type u_7}
[Add M]
[Add N]
(e : M ≃+ N)


theorem toProd_pf (p : (a : R) = a') :
    a = a' ^ (nat_lit 1).rawCast * (nat_lit 1).rawCast

{R : Type u_1}
[CommSemiring R]
{a a' : R}
(p : a = a')


@[to_additive (attr := simp)]
theorem mk_le_mk {s t : Set M} (h_mul) (h_mul') : mk s h_mul ≤ mk t h_mul' ↔ s ⊆ t

(h_mul : ∀ {a b : M}, a ∈ s → b ∈ s → a + b ∈ s)

(h_mul' : ∀ {a b : M}, a ∈ t → b ∈ t → a + b ∈ t)

{ carrier := s, add_mem' := h_mul } ≤ { carrier := t, add_mem' := h_mul' } ↔ s ⊆ t


theorem list_headI [Inhabited α] : Primrec (@List.headI α _)

{α : Type u_1}
[Primcodable α]
[Inhabited α]


/-- If `R ⋙ U` has a left adjoint, the domain of `R` has reflexive coequalizers and `U` is a monadic
functor, then `R` has a left adjoint.
This is a special case of `adjointTriangleLift` which is often more useful in practice.
-/
lemma monadicAdjointTriangleLift (U : B ⥤ C) [MonadicRightAdjoint U] {R : A ⥤ B}
    [HasReflexiveCoequalizers A] [(R ⋙ U).IsRightAdjoint] : R.IsRightAdjoint


/-- Multiplicative congruence relations preserve multiplication. -/
@[to_additive "Additive congruence relations preserve addition."]
protected theorem mul {w x y z} : c w x → c y z → c (w * y) (x * z)

{M : Type u_1}
[Add M]
(c : AddCon M)
{w x y z : M}


theorem le_of_forall_lt_one_mul_le {x y : ℝ≥0} (h : ∀ a < 1, a * x ≤ y) : x ≤ y


/-- `Option` as a functor from types to pointed types. This is the free functor. -/
@[simps]
def typeToPointed : Type u ⥤ Pointed.{u}


protected lemma IsTheta.sqrt (hfg : f =Θ[l] g) (hf : 0 ≤ᶠ[l] f) (hg : 0 ≤ᶠ[l] g) :
    (Real.sqrt <| f ·) =Θ[l] (Real.sqrt <| g ·)

{α : Type u_1}
{l : Filter α}
{f g : α → ℝ}
(hfg : f =Θ[l] g)
(hf : 0 ≤ᶠ[l] f)
(hg : 0 ≤ᶠ[l] g)


/-- **Doob's maximal inequality**: Given a non-negative submartingale `f`, for all `ε : ℝ≥0`,
we have `ε • μ {ε ≤ f* n} ≤ ∫ ω in {ε ≤ f* n}, f n` where `f* n ω = max_{k ≤ n}, f k ω`.

In some literature, the Doob's maximal inequality refers to what we call Doob's Lp inequality
(which is a corollary of this lemma and will be proved in an upcomming PR). -/
theorem maximal_ineq [IsFiniteMeasure μ] (hsub : Submartingale f 𝒢 μ) (hnonneg : 0 ≤ f) {ε : ℝ≥0}
    (n : ℕ) : ε • μ {ω | (ε : ℝ) ≤ (range (n + 1)).sup' nonempty_range_succ fun k => f k ω} ≤
    ENNReal.ofReal (∫ ω in {ω | (ε : ℝ) ≤ (range (n + 1)).sup' nonempty_range_succ fun k => f k ω},
      f n ω ∂μ)

{f : ℕ → Ω → ℝ}

(hsub : MeasureTheory.Submartingale f 𝒢 μ)

ε • μ {ω | ↑ε ≤ (Finset.range (n + 1)).sup' ⋯ fun k => f k ω} ≤
  ENNReal.ofReal (∫ (ω : Ω) in {ω | ↑ε ≤ (Finset.range (n + 1)).sup' ⋯ fun k => f k ω}, f n ω ∂μ)


@[to_additive (attr := simp)]
theorem edist_mul_right [Mul M] [PseudoEMetricSpace M] [IsometricSMul Mᵐᵒᵖ M] (a b c : M) :
    edist (a * c) (b * c) = edist a b

{M : Type u}
[Mul M]
[PseudoEMetricSpace M]
[IsometricSMul Mᵐᵒᵖ M]
(a b c : M)


@[simp] theorem length_replace [BEq α] {a : α} : (replace a b l).length = l.length

∀ {β : Type u_2} {b : β} {l : Batteries.AssocList α β} [inst : BEq α] {a : α},
  (Batteries.AssocList.replace a b l).length = l.length


theorem closure_mono {s t : Set R} (H : s ⊆ t) : closure s ⊆ closure t

{R : Type u}
[Ring R]
{s t : Set R}
(H : s ⊆ t)


theorem all_mem_nhds_filter (x : X) (f : Set X → Set α) (hf : ∀ s t, s ⊆ t → f s ⊆ f t)
    (l : Filter α) : (∀ s ∈ 𝓝 x, f s ∈ l) ↔ ∀ s, IsOpen s → x ∈ s → f s ∈ l

(hf : ∀ (s t : Set X), s ⊆ t → f s ⊆ f t)

(∀ s ∈ 𝓝 x, f s ∈ l) ↔ ∀ (s : Set X), IsOpen s → x ∈ s → f s ∈ l


@[to_additive (attr := simp)]
protected theorem mul_cancel' {r₁ r₂ : R} {s t : S} :
    ((r₁ * s) /ₒ t) * (r₂ /ₒ s) = (r₁ * r₂) /ₒ t

{R : Type u_1}
[AddMonoid R]
{S : AddSubmonoid R}
[AddOreLocalization.AddOreSet S]
{r₁ r₂ : R}
{s t : ↥S}


lemma mono_of_mono_f {K L : HomologicalComplex V c} (φ : K ⟶ L)
    (hφ : ∀ i, Mono (φ.f i)) : Mono φ

(hφ : ∀ (i : ι), CategoryTheory.Mono (φ.f i))


@[simp]
theorem empty_ne_coe : ∅ ≠ (I : Set (ι → ℝ))


theorem unitsMap_surjective [hm : NeZero m] (h : n ∣ m) :
    Function.Surjective (unitsMap h)


/-- A `DivInvMonoid` is a `Monoid` with operations `/` and `⁻¹` satisfying
`div_eq_mul_inv : ∀ a b, a / b = a * b⁻¹`.

This deduplicates the name `div_eq_mul_inv`.
The default for `div` is such that `a / b = a * b⁻¹` holds by definition.

Adding `div` as a field rather than defining `a / b := a * b⁻¹` allows us to
avoid certain classes of unification failures, for example:
Let `Foo X` be a type with a `∀ X, Div (Foo X)` instance but no
`∀ X, Inv (Foo X)`, e.g. when `Foo X` is a `EuclideanDomain`. Suppose we
also have an instance `∀ X [Cromulent X], GroupWithZero (Foo X)`. Then the
`(/)` coming from `GroupWithZero.div` cannot be definitionally equal to
the `(/)` coming from `Foo.Div`.

In the same way, adding a `zpow` field makes it possible to avoid definitional failures
in diamonds. See the definition of `Monoid` and Note [forgetful inheritance] for more
explanations on this.
-/
class DivInvMonoid (G : Type u) extends Monoid G, Inv G, Div G where
  protected div := DivInvMonoid.div'
  /-- `a / b := a * b⁻¹` -/
  protected div_eq_mul_inv : ∀ a b : G, a / b = a * b⁻¹ := by intros; rfl
  /-- The power operation: `a ^ n = a * ··· * a`; `a ^ (-n) = a⁻¹ * ··· a⁻¹` (`n` times) -/
  protected zpow : ℤ → G → G := zpowRec npowRec
  /-- `a ^ 0 = 1` -/
  protected zpow_zero' : ∀ a : G, zpow 0 a = 1 := by intros; rfl
  /-- `a ^ (n + 1) = a ^ n * a` -/
  protected zpow_succ' (n : ℕ) (a : G) : zpow (Int.ofNat n.succ) a = zpow (Int.ofNat n) a  * a := by
    intros; rfl
  /-- `a ^ -(n + 1) = (a ^ (n + 1))⁻¹` -/
  protected zpow_neg' (n : ℕ) (a : G) : zpow (Int.negSucc n) a = (zpow n.succ a)⁻¹ := by intros; rfl

{G : Type u}
[self : DivInvMonoid G]
(a : G)


@[simp]
theorem coe_toEquiv (e : α ≃ᵐ β) : (e.toEquiv : α → β) = e

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
(e : α ≃ᵐ β)


theorem equicontinuousOn_unique [Unique ι] {F : ι → X → α} {S : Set X} :
    EquicontinuousOn F S ↔ ContinuousOn (F default) S

{ι : Type u_1}
{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
[Unique ι]
{F : ι → X → α}
{S : Set X}


theorem invOf_fromBlocks₂₂_eq (A : Matrix m m α) (B : Matrix m n α) (C : Matrix n m α)
    (D : Matrix n n α) [Invertible D] [Invertible (A - B * ⅟ D * C)]
    [Invertible (fromBlocks A B C D)] :
    ⅟ (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)

[Invertible (Matrix.fromBlocks A B C D)]

⅟(Matrix.fromBlocks A B C D) =
  Matrix.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)


@[simp] theorem getLeft?_eq_none_iff {x : α ⊕ β} : x.getLeft? = none ↔ x.isRight

{α : Type u_1}
{β : Type u_2}
{x : α ⊕ β}


/-- A side of a right-angled triangle divided by the sine of the opposite angle equals the
hypotenuse, version subtracting vectors. -/
theorem norm_div_sin_oangle_sub_right_of_oangle_eq_pi_div_two {x y : V}
    (h : o.oangle x y = ↑(π / 2)) : ‖x‖ / Real.Angle.sin (o.oangle y (y - x)) = ‖y - x‖

[hd2 : Fact (FiniteDimensional.finrank ℝ V = 2)]

‖x‖ / (o.oangle y (y - x)).sin = ‖y - x‖


theorem inf_right_idem (a b : α) : a ⊓ b ⊓ b = a ⊓ b

{α : Type u}
[SemilatticeInf α]
(a b : α)


theorem map_enumFrom (f : α → β) (n : Nat) (l : List α) :
    map (Prod.map id f) (enumFrom n l) = enumFrom n (map f l)

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(n : Nat)
(l : List α)

List.map (Prod.map id f) (List.enumFrom n l) = List.enumFrom n (List.map f l)


@[norm_cast, simp]
theorem coe_algebraMap : ⇑(algebraMap R ℍ[R,c₁,c₂]) = coe

⇑(algebraMap R ℍ[R,c₁,c₂]) = QuaternionAlgebra.coe


/-- The direct comparison test for series:  if the norm of `f` is bounded by a real function `g`
which is summable, then `f` is summable. -/
theorem Summable.of_norm_bounded [CompleteSpace E] {f : ι → E} (g : ι → ℝ) (hg : Summable g)
    (h : ∀ i, ‖f i‖ ≤ g i) : Summable f

{ι : Type u_1}
{E : Type u_3}
[SeminormedAddCommGroup E]
[CompleteSpace E]
{f : ι → E}
(g : ι → ℝ)
(hg : Summable g)
(h : ∀ (i : ι), ‖f i‖ ≤ g i)


lemma mul_bot_of_pos : ∀ {x : EReal}, 0 < x → x * ⊥ = ⊥


{X : Type u_2}
[TopologicalSpace X]
(S : DiscreteQuotient X)
(x : X)


@[simp]
theorem log_zpow (x : ℝ) (n : ℤ) : log (x ^ n) = n * log x


protected theorem IsMin.eq_of_le (ha : IsMin a) (h : b ≤ a) : b = a

{α : Type u_1}
[PartialOrder α]
{a b : α}
(ha : IsMin a)
(h : b ≤ a)


theorem _root_.aestronglyMeasurable_const_smul_iff (c : G) :
    AEStronglyMeasurable (fun x => c • f x) μ ↔ AEStronglyMeasurable f μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[TopologicalSpace β]
{f : α → β}
{G : Type u_6}
[Group G]
[MulAction G β]
[ContinuousConstSMul G β]
(c : G)

MeasureTheory.AEStronglyMeasurable (fun x => c • f x) μ ↔ MeasureTheory.AEStronglyMeasurable f μ


theorem exists_algHom_adjoin_of_splits : ∃ φ : adjoin F S →ₐ[F] K, φ.comp (inclusion hL) = f

(hK : ∀ s ∈ S, IsIntegral F s ∧ Polynomial.Splits (algebraMap F K) (minpoly F s))

∃ φ, φ.comp (IntermediateField.inclusion hL) = f


theorem closure_rels_subset_ker : Subgroup.normalClosure rels ≤ MonoidHom.ker F

(h : ∀ r ∈ rels, (FreeGroup.lift f) r = 1)

Subgroup.normalClosure rels ≤ (FreeGroup.lift f).ker


@[simp]
theorem map_sup (f : F) : map f (p ⊔ p') = map f p ⊔ map f p'

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
(p p' : Submodule R M)
{F : Type u_9}
[FunLike F M M₂]
[SemilinearMapClass F σ₁₂ M M₂]
[RingHomSurjective σ₁₂]
(f : F)

Submodule.map f (p ⊔ p') = Submodule.map f p ⊔ Submodule.map f p'


lemma specializingMap_iff_closure_singleton_subset :
    SpecializingMap f ↔ ∀ x, closure {f x} ⊆ f '' closure {x}

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}

SpecializingMap f ↔ ∀ (x : X), closure {f x} ⊆ f '' closure {x}


@[to_additive (attr := simp)]
theorem comap_subtype (H K : Subgroup G) : H.comap K.subtype = H.subgroupOf K

{G : Type u_1}
[AddGroup G]
(H K : AddSubgroup G)

AddSubgroup.comap K.subtype H = H.addSubgroupOf K


theorem set_eventuallyEq_iff_inf_principal {s t : Set α} {l : Filter α} :
    s =ᶠ[l] t ↔ l ⊓ 𝓟 s = l ⊓ 𝓟 t

{α : Type u}
{s t : Set α}
{l : Filter α}


theorem ker_eq_maximalIdeal [Field K] (φ : R →+* K) (hφ : Function.Surjective φ) :
    RingHom.ker φ = maximalIdeal R

{R : Type u_1}
{K : Type u_3}
[CommRing R]
[LocalRing R]
[Field K]
(φ : R →+* K)
(hφ : Function.Surjective ⇑φ)

RingHom.ker φ = LocalRing.maximalIdeal R


/-- A matroid as defined by the independence axioms. This is the same thing as a `Matroid`,
  and so does not need its own API; it exists to make it easier to construct a matroid from its
  independent sets. The constructed `IndepMatroid` can then be converted into a matroid
  with `IndepMatroid.matroid`. -/
structure IndepMatroid (α : Type*) where
  /-- The ground set -/
  (E : Set α)
  /-- The independence predicate -/
  (Indep : Set α → Prop)
  (indep_empty : Indep ∅)
  (indep_subset : ∀ ⦃I J⦄, Indep J → I ⊆ J → Indep I)
  (indep_aug : ∀⦃I B⦄, Indep I → I ∉ maximals (· ⊆ ·) {I | Indep I} →
      B ∈ maximals (· ⊆ ·) {I | Indep I} → ∃ x ∈ B \ I, Indep (insert x I))
  (indep_maximal : ∀ X, X ⊆ E → ExistsMaximalSubsetProperty Indep X)
  (subset_ground : ∀ I, Indep I → I ⊆ E)

{α : Type u_2}
(self : IndepMatroid α)
(I : Set α)


@[simp]
theorem preimage_const_mul_Ici (a : α) {c : α} (h : 0 < c) : (c * ·) ⁻¹' Ici a = Ici (a / c)

{α : Type u_1}
[LinearOrderedField α]
(a : α)
{c : α}
(h : 0 < c)

(fun x => c * x) ⁻¹' Set.Ici a = Set.Ici (a / c)


@[simp]
protected theorem lift_mk {α : Sort*} {X : C} (F : ∀ ⦃A : C⦄ (f : A ⟶ X) [Mono f], α) {h A}
    (f : A ⟶ X) [Mono f] : Subobject.lift F h (Subobject.mk f) = F f

(F : ⦃A : C⦄ → (f : A ⟶ X) → [inst : CategoryTheory.Mono f] → α)

{h :
  ∀ ⦃A B : C⦄ (f : A ⟶ X) (g : B ⟶ X) [inst : CategoryTheory.Mono f] [inst_1 : CategoryTheory.Mono g] (i : A ≅ B),
    CategoryTheory.CategoryStruct.comp i.hom g = f → F f = F g}

CategoryTheory.Subobject.lift F h (CategoryTheory.Subobject.mk f) = F f


/-- The indexed infimum of a function is bounded above by the value taken at one point-/
theorem ciInf_le {f : ι → α} (H : BddBelow (range f)) (c : ι) : iInf f ≤ f c

{α : Type u_1}
{ι : Sort u_4}
[ConditionallyCompleteLattice α]
{f : ι → α}
(H : BddBelow (Set.range f))
(c : ι)


theorem iUnion_decode₂_cases {f : β → Set α} {C : Set α → Prop} (H0 : C ∅) (H1 : ∀ b, C (f b)) {n} :
    C (⋃ b ∈ decode₂ β n, f b)

{α : Type u_1}
{β : Type u_2}
[Encodable β]
{f : β → Set α}
{C : Set α → Prop}
(H0 : C ∅)
(H1 : ∀ (b : β), C (f b))
{n : ℕ}


/-- Show that `FirstObj` is isomorphic to `FamilyOfElements`. -/
@[simps]
def firstObjEqFamily : FirstObj P R ≅ R.FamilyOfElements P

(P : CategoryTheory.Functor Cᵒᵖ (Type (max v u)))

∀ (a : CategoryTheory.Presieve.FamilyOfElements P R),
  (CategoryTheory.Equalizer.firstObjEqFamily P R).inv a = CategoryTheory.Limits.Pi.lift (fun f x => x ↑f.snd ⋯) a


@[simp]
theorem toNonUnitalSubsemiring_subtype :
    NonUnitalSubsemiringClass.subtype S = NonUnitalSubalgebraClass.subtype (R := R) S

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
{S : NonUnitalSubalgebra R A}

NonUnitalSubsemiringClass.subtype S = ↑(NonUnitalSubalgebraClass.subtype S)


@[to_additive]
nonrec theorem SmoothAt.mul (hf : SmoothAt I' I f x) (hg : SmoothAt I' I g x) :
    SmoothAt I' I (f * g) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[Mul G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothMul I G]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_7}
[TopologicalSpace M]
[ChartedSpace H' M]
{f g : M → G}
{x : M}
(hf : SmoothAt I' I f x)
(hg : SmoothAt I' I g x)


theorem moduleAux_apply (a : A) (b : B) (m : M) : moduleAux (a ⊗ₜ[R] b) m = a • b • m

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{M : Type u_4}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[Semiring A]
[Semiring B]
[Module A M]
[Module B M]
[Algebra R A]
[Algebra R B]
[IsScalarTower R A M]
[IsScalarTower R B M]
(a : A)
(b : B)
(m : M)

(TensorProduct.Algebra.moduleAux (a ⊗ₜ[R] b)) m = a • b • m


theorem iSup_eq_iSup_subseq_of_monotone {ι₁ ι₂ α : Type*} [Preorder ι₂] [CompleteLattice α]
    {l : Filter ι₁} [l.NeBot] {f : ι₂ → α} {φ : ι₁ → ι₂} (hf : Monotone f)
    (hφ : Tendsto φ l atTop) : ⨆ i, f i = ⨆ i, f (φ i)

{ι₁ : Type u_3}
{ι₂ : Type u_4}
{α : Type u_5}
[Preorder ι₂]
[CompleteLattice α]
{l : Filter ι₁}
[l.NeBot]
{f : ι₂ → α}
{φ : ι₁ → ι₂}
(hf : Monotone f)
(hφ : Filter.Tendsto φ l Filter.atTop)


theorem mk_finsupp_nat (α : Type u) [Nonempty α] : #(α →₀ ℕ) = max #α ℵ₀


/-- A star module `A` over a star ring `R` is a module which is a star add monoid,
and the two star structures are compatible in the sense
`star (r • a) = star r • star a`.

Note that it is up to the user of this typeclass to enforce
`[Semiring R] [StarRing R] [AddCommMonoid A] [StarAddMonoid A] [Module R A]`, and that
the statement only requires `[Star R] [Star A] [SMul R A]`.

If used as `[CommRing R] [StarRing R] [Semiring A] [StarRing A] [Algebra R A]`, this represents a
star algebra.
-/

class StarModule (R : Type u) (A : Type v) [Star R] [Star A] [SMul R A] : Prop where
  /-- `star` commutes with scalar multiplication -/
  star_smul : ∀ (r : R) (a : A), star (r • a) = star r • star a

{R : Type u}
{A : Type v}
[Star R]
[Star A]
[SMul R A]
[self : StarModule R A]
(r : R)
(a : A)


@[to_additive]
lemma zpow_neg_coe_of_pos (a : G) : ∀ {n : ℕ}, 0 < n → a ^ (-(n : ℤ)) = (a ^ n)⁻¹

{G : Type u_1}
[DivInvMonoid G]
(a : G)
{n : ℕ}


theorem rel_map {s : Multiset α} {t : Multiset β} {f : α → γ} {g : β → δ} :
    Rel p (s.map f) (t.map g) ↔ Rel (fun a b => p (f a) (g b)) s t

{α : Type u_1}
{β : Type v}
{γ : Type u_2}
{δ : Type u_3}
{p : γ → δ → Prop}
{s : Multiset α}
{t : Multiset β}
{f : α → γ}
{g : β → δ}

Multiset.Rel p (Multiset.map f s) (Multiset.map g t) ↔ Multiset.Rel (fun a b => p (f a) (g b)) s t


theorem Quot.exact {a b : α} (H : Quot.mk r a = Quot.mk r b) : EqvGen r a b

{α : Type u}
(r : α → α → Prop)
{a b : α}
(H : Quot.mk r a = Quot.mk r b)


@[reassoc (attr := simp)]
lemma opcyclesMap'_g' : opcyclesMap' φ h₁ h₂ ≫ h₂.g' = h₁.g' ≫ φ.τ₃

CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.opcyclesMap' φ h₁ h₂) h₂.g' =
  CategoryTheory.CategoryStruct.comp h₁.g' φ.τ₃


/-- The equivalence of categories
`(Φ.LeftResolution X₂)ᵒᵖ ≌ Φ.op.RightResolution (Opposite.op X₂)`. -/
@[simps]
def LeftResolution.opEquivalence (X₂ : C₂) [W₁.IsMultiplicative] :
    (Φ.LeftResolution X₂)ᵒᵖ ≌ Φ.op.RightResolution (Opposite.op X₂)

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

(Φ : CategoryTheory.LocalizerMorphism W₁ W₂)

(CategoryTheory.LocalizerMorphism.LeftResolution.opEquivalence Φ X₂).counitIso =
  CategoryTheory.Iso.refl
    ((CategoryTheory.LocalizerMorphism.RightResolution.unopFunctor Φ (Opposite.op X₂)).rightOp.comp
      (CategoryTheory.LocalizerMorphism.LeftResolution.opFunctor Φ X₂))


@[to_additive]
theorem inv_unique {u₁ u₂ : αˣ} (h : (↑u₁ : α) = ↑u₂) : (↑u₁⁻¹ : α) = ↑u₂⁻¹

{α : Type u}
[AddMonoid α]
{u₁ u₂ : AddUnits α}
(h : ↑u₁ = ↑u₂)


@[simp]
theorem algebraMap_eq_zero_iff {x : K[X]} : algebraMap K[X] (RatFunc K) x = 0 ↔ x = 0

(K : Type u)
[CommRing K]
[IsDomain K]
{x : K[X]}

(algebraMap K[X] (RatFunc K)) x = 0 ↔ x = 0


theorem _root_.NeZero.of_noZeroSMulDivisors (n : ℕ) [CommRing R] [NeZero (n : R)] [Ring A]
    [Nontrivial A] [Algebra R A] [NoZeroSMulDivisors R A] : NeZero (n : A)

(R : Type u_1)
(A : Type u_2)
(n : ℕ)
[CommRing R]
[NeZero ↑n]
[Ring A]
[Nontrivial A]
[Algebra R A]
[NoZeroSMulDivisors R A]


@[to_additive]
theorem closedEmbedding_toContinuousMap [ContinuousMul B] [T2Space B] :
    ClosedEmbedding (toContinuousMap : ContinuousMonoidHom A B → C(A, B))

(A : Type u_2)
(B : Type u_3)
[AddMonoid A]
[AddMonoid B]
[TopologicalSpace A]
[TopologicalSpace B]
[ContinuousAdd B]
[T2Space B]


/-- Congruence relations are transitive. -/
@[to_additive "Additive congruence relations are transitive."]
protected theorem trans {x y z} : c x y → c y z → c x z

{M : Type u_1}
[Mul M]
(c : Con M)
{x y z : M}


lemma even_sub' : Even (m - n) ↔ (Odd m ↔ Odd n)


@[to_additive (attr := simp)]
lemma inv_smul_finset_distrib (a : α) (s : Finset α) : (a • s)⁻¹ = op a⁻¹ • s⁻¹

{α : Type u_2}
[Group α]
[DecidableEq α]
(a : α)
(s : Finset α)


theorem iIndepSet.iIndepFun_indicator [Zero β] [One β] {m : MeasurableSpace β} {s : ι → Set Ω}
    (hs : iIndepSet s κ μ) :
    iIndepFun (fun _n => m) (fun n => (s n).indicator fun _ω => 1) κ μ

(hs : ProbabilityTheory.Kernel.iIndepSet s κ μ)

ProbabilityTheory.Kernel.iIndepFun (fun _n => m) (fun n => (s n).indicator fun _ω => 1) κ μ


@[to_additive]
theorem isMonoidHom_coe (f : M →* N) : IsMonoidHom (f : M → N)

{M : Type u_1}
{N : Type u_2}
{mM : MulOneClass M}
{mN : MulOneClass N}
(f : M →* N)


@[simp]
theorem coe_top_lt [OrderTop α] {x : WithTop α} : (⊤ : α) < x ↔ x = ⊤

{α : Type u_1}
[Preorder α]
[OrderTop α]
{x : WithTop α}

↑⊤ < x ↔ x = ⊤


@[simp]
theorem finsupp_sum_apply (t : ι →₀ γ) (g : ι → γ → M →ₛₗ[σ₁₂] M₂) (b : M) :
    (t.sum g) b = t.sum fun i d => g i d b

{R : Type u_4}
{R₂ : Type u_5}
{M : Type u_6}
{M₂ : Type u_7}
{ι : Type u_8}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
{σ₁₂ : R →+* R₂}
[Module R M]
[Module R₂ M₂]
{γ : Type u_9}
[Zero γ]
(t : ι →₀ γ)
(g : ι → γ → M →ₛₗ[σ₁₂] M₂)
(b : M)

(t.sum g) b = t.sum fun i d => (g i d) b


@[to_additive] -- Porting note: was `@[simp]`
theorem integrable_comp_div_left (f : G → F) [IsInvInvariant μ] [IsMulLeftInvariant μ] (g : G) :
    Integrable (fun t => f (g / t)) μ ↔ Integrable f μ

{G : Type u_4}
{F : Type u_6}
[MeasurableSpace G]
[NormedAddCommGroup F]
{μ : MeasureTheory.Measure G}
[Group G]
[MeasurableMul G]
[MeasurableInv G]
(f : G → F)
[μ.IsInvInvariant]
[μ.IsMulLeftInvariant]
(g : G)

MeasureTheory.Integrable (fun t => f (g / t)) μ ↔ MeasureTheory.Integrable f μ


@[simp]
theorem zeroLocus_univ : zeroLocus (Set.univ : Set R) = ∅


theorem max_rec' (p : α → Prop) (hx : p x) (hy : p y) : p (max x y)

{α : Type u_2}
[LinearOrder α]
{x y : α}
(p : α → Prop)
(hx : p x)
(hy : p y)


theorem measurable_sInf {ι} {f : ι → δ → α} {s : Set ι} (hs : s.Countable)
    (hf : ∀ i ∈ s, Measurable (f i)) :
    Measurable fun x => sInf ((fun i => f i x) '' s)

{α : Type u_1}
{δ : Type u_4}
[TopologicalSpace α]
[MeasurableSpace α]
[BorelSpace α]
[MeasurableSpace δ]
[ConditionallyCompleteLinearOrder α]
[OrderTopology α]
[SecondCountableTopology α]
{ι : Type u_5}
{f : ι → δ → α}
{s : Set ι}
(hs : s.Countable)
(hf : ∀ i ∈ s, Measurable (f i))


/-- The standard simplex in the zero-dimensional space is empty. -/
lemma stdSimplex_of_isEmpty_index [IsEmpty ι] [Nontrivial 𝕜] : stdSimplex 𝕜 ι = ∅

(𝕜 : Type u_1)
(ι : Type u_5)
[OrderedSemiring 𝕜]
[Fintype ι]
[IsEmpty ι]
[Nontrivial 𝕜]


theorem isLUB_Ico {a b : γ} (hab : a < b) : IsLUB (Ico a b) b

{γ : Type w}
[SemilatticeInf γ]
[DenselyOrdered γ]
{a b : γ}
(hab : a < b)


@[simp, nolint simpNF] -- Porting note (#10675): dsimp can not prove this
theorem mem_toSubmonoid {s : Subring R} {x : R} : x ∈ s.toSubmonoid ↔ x ∈ s

{R : Type u}
[Ring R]
{s : Subring R}
{x : R}


theorem prod_leftInvSeq (ω : List B) : prod (lis ω) = (π ω)⁻¹

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
(ω : List B)

(cs.leftInvSeq ω).prod = (cs.wordProd ω)⁻¹


/-- An add-regular element is an element `c` such that addition by `c` both on the left and
on the right is injective. -/
structure IsAddRegular {R : Type*} [Add R] (c : R) : Prop where
  /-- An add-regular element `c` is left-regular -/
  left : IsAddLeftRegular c -- Porting note: It seems like to_additive is misbehaving
  /-- An add-regular element `c` is right-regular -/
  right : IsAddRightRegular c

{R : Type u_2}
[Add R]
{c : R}
(self : IsAddRegular c)


theorem intervalIntegrable_of_integral_ne_zero {a b : ℝ} {f : ℝ → E} {μ : Measure ℝ}
    (h : (∫ x in a..b, f x ∂μ) ≠ 0) : IntervalIntegrable f μ a b

{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{a b : ℝ}
{f : ℝ → E}
{μ : MeasureTheory.Measure ℝ}
(h : ∫ (x : ℝ) in a..b, f x ∂μ ≠ 0)


theorem Finset.isCompact_biUnion (s : Finset ι) {f : ι → Set X} (hf : ∀ i ∈ s, IsCompact (f i)) :
    IsCompact (⋃ i ∈ s, f i)

{X : Type u}
{ι : Type u_1}
[TopologicalSpace X]
(s : Finset ι)
{f : ι → Set X}
(hf : ∀ i ∈ s, IsCompact (f i))


theorem IsRelPrime.of_mul_left_left (H : IsRelPrime (x * y) z) : IsRelPrime x z

{α : Type u_1}
[CommMonoid α]
{x y z : α}
(H : IsRelPrime (x * y) z)


theorem monotone_lift [Preorder γ] {f : γ → Filter α} {g : γ → Set α → Filter β} (hf : Monotone f)
    (hg : Monotone g) : Monotone fun c => (f c).lift (g c)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Preorder γ]
{f : γ → Filter α}
{g : γ → Set α → Filter β}
(hf : Monotone f)
(hg : Monotone g)


theorem PUnit.subsingleton (a b : PUnit) : a = b


/-- If two complex differentiable functions `f g : E → F` are equal on the boundary of a bounded set
`U`, then they are equal on `U`. -/
theorem eqOn_of_eqOn_frontier {f g : E → F} {U : Set E} (hU : IsBounded U) (hf : DiffContOnCl ℂ f U)
    (hg : DiffContOnCl ℂ g U) (hfg : EqOn f g (frontier U)) : EqOn f g U

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace ℂ F]
[Nontrivial E]
{f g : E → F}
{U : Set E}
(hU : Bornology.IsBounded U)
(hf : DiffContOnCl ℂ f U)
(hg : DiffContOnCl ℂ g U)
(hfg : Set.EqOn f g (frontier U))


/-- If `A` is subterminal, the unique morphism from it to a terminal object is a monomorphism.
The converse of `isSubterminal_of_mono_isTerminal_from`.
-/
theorem IsSubterminal.mono_isTerminal_from (hA : IsSubterminal A) {T : C} (hT : IsTerminal T) :
    Mono (hT.from A)

(hT : CategoryTheory.Limits.IsTerminal T)


theorem contDiff_one_iff_hasFDerivAt : ContDiff 𝕜 1 f ↔
    ∃ f' : E → E →L[𝕜] F, Continuous f' ∧ ∀ x, HasFDerivAt f (f' x) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}

ContDiff 𝕜 1 f ↔ ∃ f', Continuous f' ∧ ∀ (x : E), HasFDerivAt f (f' x) x


@[reassoc (attr := simp)]
lemma stalkMap_germ' (U : Y.Opens) (x : X) (hx : f.val.base x ∈ U) :
    Y.presheaf.germ ⟨f.val.base x, hx⟩ ≫ f.stalkMap x =
      f.app U ≫ X.presheaf.germ (U := f⁻¹ᵁ U) ⟨x, hx⟩

{X Y : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)
(U : Y.Opens)
(x : ↑↑X.toPresheafedSpace)
(hx : f.val.base x ∈ U)

Y.presheaf.germ ⟨f.val.base x, hx⟩ ≫ AlgebraicGeometry.Scheme.Hom.stalkMap f x =
  AlgebraicGeometry.Scheme.Hom.app f U ≫ X.presheaf.germ ⟨x, hx⟩


/-- `x^n`, `n : ℕ` is convex on the whole real line whenever `n` is even. -/
protected lemma Even.convexOn_pow {n : ℕ} (hn : Even n) : ConvexOn 𝕜 univ fun x : 𝕜 ↦ x ^ n

{𝕜 : Type u_1}
[LinearOrderedCommRing 𝕜]
{n : ℕ}
(hn : Even n)


theorem nonempty_of_card_le [Fintype α] [Fintype β] (h : Fintype.card α ≤ Fintype.card β) :
    Nonempty (α ↪ β)

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
(h : Fintype.card α ≤ Fintype.card β)


@[simp, norm_cast]
theorem ofReal_tan (x : ℝ) : (Real.tan x : ℂ) = tan x


theorem IsExtrFilter.comp_mono (hf : IsExtrFilter f l a) {g : β → γ} (hg : Monotone g) :
    IsExtrFilter (g ∘ f) l a

{α : Type u}
{β : Type v}
{γ : Type w}
[Preorder β]
[Preorder γ]
{f : α → β}
{l : Filter α}
{a : α}
(hf : IsExtrFilter f l a)
{g : β → γ}
(hg : Monotone g)


@[to_additive]
theorem abs_dist_sub_le_dist_mul_mul (a₁ a₂ b₁ b₂ : E) :
    |dist a₁ b₁ - dist a₂ b₂| ≤ dist (a₁ * a₂) (b₁ * b₂)

{E : Type u_3}
[SeminormedCommGroup E]
(a₁ a₂ b₁ b₂ : E)


theorem mapM_empty [Monad m] (f : α → m β) : mapM f #[] = pure #[]

{m : Type u_1 → Type u_2}
{α : Type u_3}
{β : Type u_1}
[Monad m]
(f : α → m β)


@[nontriviality]
theorem isBigO_of_subsingleton [Subsingleton E'] : f' =O[l] g'

{α : Type u_1}
{E' : Type u_6}
{F' : Type u_7}
[SeminormedAddCommGroup E']
[SeminormedAddCommGroup F']
{f' : α → E'}
{g' : α → F'}
{l : Filter α}
[Subsingleton E']


@[simp] theorem beq_not_self : ∀ (x : Bool), (x   == !x) = false


theorem of_is_bilimit' {b : BinaryBicone X Y} (h : b.IsBilimit) :
    IsPushout b.fst b.snd (0 : X ⟶ 0) (0 : Y ⟶ 0)

{b : CategoryTheory.Limits.BinaryBicone X Y}

CategoryTheory.IsPushout b.fst b.snd 0 0


@[simp] theorem getElem?_set_eq (a : Array α) (i : Fin a.size) (v : α) :
    (a.set i v)[i.1]? = v

{α : Type u_1}
(a : Array α)
(i : Fin a.size)
(v : α)


private lemma min_ne (ha : a ≠ c) (hb : b ≠ c) : min a b ≠ c

{R : Type u_2}
[LinearOrder R]
{a b c : R}
(ha : a ≠ c)
(hb : b ≠ c)


@[instance]
theorem coprod_neBot_left [NeBot f] [Nonempty β] : (f.coprod g).NeBot

{α : Type u_1}
{β : Type u_2}
{f : Filter α}
{g : Filter β}
[f.NeBot]
[Nonempty β]


@[simp]
theorem ι_range_comap_involute :
    (ι Q).range.comap (involute : CliffordAlgebra Q →ₐ[R] CliffordAlgebra Q).toLinearMap =
      LinearMap.range (ι Q)

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
(Q : QuadraticForm R M)

Submodule.comap CliffordAlgebra.involute.toLinearMap (LinearMap.range (CliffordAlgebra.ι Q)) =
  LinearMap.range (CliffordAlgebra.ι Q)


theorem toString_extract : ∀ {s}, Valid s → Valid ⟨s.toString, b, e⟩ →
    (s.extract b e).toString = s.toString.extract b e

s.Valid → { str := s.toString, startPos := b, stopPos := e }.Valid → (s.extract b e).toString = s.toString.extract b e


/--
Equivalent precoherent categories give equivalent coherent toposes.
-/
@[simps!]
def sheafCongrPrecoherent : haveI := e.precoherent
    Sheaf (coherentTopology C) A ≌ Sheaf (coherentTopology D) A

(F : CategoryTheory.Sheaf (CategoryTheory.coherentTopology D) A)

∀ {X Y : Cᵒᵖ} (f : X ⟶ Y), ((e.sheafCongrPrecoherent A).inverse.obj F).val.map f = F.val.map (e.functor.map f.unop).op


lemma NonUnitalAlgebra.adjoin_le_algebra_adjoin (s : Set A) :
    adjoin R s ≤ (Algebra.adjoin R s).toNonUnitalSubalgebra

(R : Type u_1)
{A : Type u_2}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(s : Set A)

NonUnitalAlgebra.adjoin R s ≤ (Algebra.adjoin R s).toNonUnitalSubalgebra


@[simp]
lemma locallyRingedSpaceAdjunction_counit_app' (R : Type u) [CommRing R] :
    locallyRingedSpaceAdjunction.counit.app (op <| CommRingCat.of R) =
      (toOpen R ⊤).op

AlgebraicGeometry.ΓSpec.locallyRingedSpaceAdjunction.counit.app (Opposite.op (CommRingCat.of R)) =
  (AlgebraicGeometry.StructureSheaf.toOpen R ⊤).op


/-- `Option.map₂` in terms of monadic operations. Note that this can't be taken as the definition
because of the lack of universe polymorphism. -/
theorem map₂_def {α β γ : Type u} (f : α → β → γ) (a : Option α) (b : Option β) :
    map₂ f a b = f <$> a <*> b

Option.map₂ f a b = Seq.seq (f <$> a) fun x => b


@[to_additive (attr := simp)]
theorem nndist_mul_left [PseudoMetricSpace M] [Mul M] [IsometricSMul M M] (a b c : M) :
    nndist (a * b) (a * c) = nndist b c

{M : Type u}
[PseudoMetricSpace M]
[Add M]
[IsometricVAdd M M]
(a b c : M)


/-- The powerset functor. `Set` as a functor. -/
@[simps]
def fintypeToFinBoolAlgOp : FintypeCat ⥤ FinBoolAlgᵒᵖ

fintypeToFinBoolAlgOp.obj X = Opposite.op (FinBoolAlg.of (Set ↑X))


theorem absNorm_mem (I : Ideal S) : ↑(Ideal.absNorm I) ∈ I

{S : Type u_1}
[CommRing S]
[IsDomain S]
[Nontrivial S]
[IsDedekindDomain S]
[Module.Free ℤ S]
(I : Ideal S)


/-- A gluing datum consists of
1. An index type `J`
2. An object `U i` for each `i : J`.
3. An object `V i j` for each `i j : J`.
4. A monomorphism `f i j : V i j ⟶ U i` for each `i j : J`.
5. A transition map `t i j : V i j ⟶ V j i` for each `i j : J`.
such that
6. `f i i` is an isomorphism.
7. `t i i` is the identity.
8. The pullback for `f i j` and `f i k` exists.
9. `V i j ×[U i] V i k ⟶ V i j ⟶ V j i` factors through `V j k ×[U j] V j i ⟶ V j i` via some
    `t' : V i j ×[U i] V i k ⟶ V j k ×[U j] V j i`.
10. `t' i j k ≫ t' j k i ≫ t' k i j = 𝟙 _`.
-/
-- Porting note(#5171): linter not ported yet
-- @[nolint has_nonempty_instance]
structure GlueData where
  J : Type v
  U : J → C
  V : J × J → C
  f : ∀ i j, V (i, j) ⟶ U i
  f_mono : ∀ i j, Mono (f i j) := by infer_instance
  f_hasPullback : ∀ i j k, HasPullback (f i j) (f i k) := by infer_instance
  f_id : ∀ i, IsIso (f i i) := by infer_instance
  t : ∀ i j, V (i, j) ⟶ V (j, i)
  t_id : ∀ i, t i i = 𝟙 _
  t' : ∀ i j k, pullback (f i j) (f i k) ⟶ pullback (f j k) (f j i)
  t_fac : ∀ i j k, t' i j k ≫ pullback.snd _ _ = pullback.fst _ _ ≫ t i j
  cocycle : ∀ i j k, t' i j k ≫ t' j k i ≫ t' k i j = 𝟙 _

{C : Type u₁}
[CategoryTheory.Category.{v, u₁} C]
(self : CategoryTheory.GlueData C)
(i j k : self.J)

CategoryTheory.CategoryStruct.comp (self.t' i j k)
    (CategoryTheory.CategoryStruct.comp (self.t' j k i) (self.t' k i j)) =
  CategoryTheory.CategoryStruct.id (CategoryTheory.Limits.pullback (self.f i j) (self.f i k))


/-- given a list `is` of monotonically increasing indices into `l`, getting each index
  produces a sublist of `l`.  -/
theorem map_get_sublist {l : List α} {is : List (Fin l.length)} (h : is.Pairwise (·.val < ·.val)) :
    is.map (get l) <+ l

(h : List.Pairwise (fun x x_1 => ↑x < ↑x_1) is)


@[to_additive (attr := simp) prodProdProdComm_toEquiv]
theorem prodProdProdComm_toEquiv :
    (prodProdProdComm M N M' N' : _ ≃ _) = Equiv.prodProdProdComm M N M' N'

(M : Type u_5)
(N : Type u_6)
[AddZeroClass M]
[AddZeroClass N]
(M' : Type u_8)
(N' : Type u_9)
[AddZeroClass M']
[AddZeroClass N']

↑(AddEquiv.prodProdProdComm M N M' N') = Equiv.prodProdProdComm M N M' N'


@[simp]
theorem inr_coprodZeroIso_hom (X : C) : coprod.inl ≫ (coprodZeroIso X).hom = 𝟙 X

CategoryTheory.Limits.coprod.inl ≫ (CategoryTheory.Limits.coprodZeroIso X).hom = 𝟙 X


@[simp]
theorem iUnion_iUnion_eq' {f : ι → α} {g : α → Set β} :
    ⋃ (x) (y) (_ : f y = x), g x = ⋃ y, g (f y)

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
{f : ι → α}
{g : α → Set β}

⋃ x, ⋃ y, ⋃ (_ : f y = x), g x = ⋃ y, g (f y)


theorem IsAtom.le_iff (h : IsAtom a) : x ≤ a ↔ x = ⊥ ∨ x = a

{α : Type u_2}
[PartialOrder α]
[OrderBot α]
{a x : α}
(h : IsAtom a)


lemma isRightDerivedFunctor_iff_isLeftKanExtension [L.IsLocalization W] :
    RF.IsRightDerivedFunctor α W ↔ RF.IsLeftKanExtension α

{C : Type u_1}
{D : Type u_2}
{H : Type u_5}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
[CategoryTheory.Category.{u_6, u_5} H]
(RF : CategoryTheory.Functor D H)
{F : CategoryTheory.Functor C H}
{L : CategoryTheory.Functor C D}
(α : F ⟶ L.comp RF)
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]


theorem add_congr_left {x y z : PGame} (h : x ≈ y) : x + z ≈ y + z


lemma IsOpen.stableUnderGeneralization {s : Set X} (hs : IsOpen s) :
    StableUnderGeneralization s

{X : Type u_1}
[TopologicalSpace X]
{s : Set X}
(hs : IsOpen s)


lemma integrable_fourierPowSMulRight {n : ℕ} (hf : Integrable (fun v ↦ ‖v‖ ^ n * ‖f v‖) μ)
    (h'f : AEStronglyMeasurable f μ) : Integrable (fun v ↦ fourierPowSMulRight L f v n) μ

(hf : MeasureTheory.Integrable (fun v => ‖v‖ ^ n * ‖f v‖) μ)

(h'f : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.Integrable (fun v => VectorFourier.fourierPowSMulRight L f v n) μ


@[to_additive (attr := simp, nolint simpNF)]
lemma finEquivZPowers_apply (hx) {n : Fin (orderOf x)} :
    finEquivZPowers x hx n = ⟨x ^ (n : ℕ), n, zpow_natCast x n⟩

{G : Type u_1}
[AddGroup G]
{x : G}
(hx : IsOfFinAddOrder x)
{n : Fin (addOrderOf x)}

(finEquivZMultiples x hx) n = ⟨↑n • x, ⋯⟩


@[simp]
theorem map_onRelation {M : Type*} [L.Structure M] [L'.Structure M] [ϕ.IsExpansionOn M] {n}
    (R : L.Relations n) (x : Fin n → M) : RelMap (ϕ.onRelation R) x = RelMap R x

{L : FirstOrder.Language}
{L' : FirstOrder.Language}
(ϕ : L →ᴸ L')
{M : Type u_1}
[L.Structure M]
[L'.Structure M]
[ϕ.IsExpansionOn M]
{n : ℕ}
(R : L.Relations n)
(x : Fin n → M)

FirstOrder.Language.Structure.RelMap (ϕ.onRelation R) x = FirstOrder.Language.Structure.RelMap R x


@[to_additive (attr := simp)]
theorem clift_apply_inl (f : FreeMonoid (M ⊕ N) →* P) (hM₁ hN₁ hM hN) (x : M) :
    clift f hM₁ hN₁ hM hN (inl x) = f (of (.inl x))

(hM₁ : f (FreeMonoid.of (Sum.inl 1)) = 1)

(hN₁ : f (FreeMonoid.of (Sum.inr 1)) = 1)

(hM : ∀ (x y : M), f (FreeMonoid.of (Sum.inl (x * y))) = f (FreeMonoid.of (Sum.inl x) * FreeMonoid.of (Sum.inl y)))

(hN : ∀ (x y : N), f (FreeMonoid.of (Sum.inr (x * y))) = f (FreeMonoid.of (Sum.inr x) * FreeMonoid.of (Sum.inr y)))

(Monoid.Coprod.clift f hM₁ hN₁ hM hN) (Monoid.Coprod.inl x) = f (FreeMonoid.of (Sum.inl x))


theorem mapRange.addEquiv_trans (f : ∀ i, β i ≃+ β₁ i) (f₂ : ∀ i, β₁ i ≃+ β₂ i) :
    (mapRange.addEquiv fun i => (f i).trans (f₂ i)) =
      (mapRange.addEquiv f).trans (mapRange.addEquiv f₂)

{ι : Type u}
{β : ι → Type v}
{β₁ : ι → Type v₁}
{β₂ : ι → Type v₂}
[(i : ι) → AddZeroClass (β i)]
[(i : ι) → AddZeroClass (β₁ i)]
[(i : ι) → AddZeroClass (β₂ i)]
(f : (i : ι) → β i ≃+ β₁ i)
(f₂ : (i : ι) → β₁ i ≃+ β₂ i)

(DFinsupp.mapRange.addEquiv fun i => (f i).trans (f₂ i)) =
  (DFinsupp.mapRange.addEquiv f).trans (DFinsupp.mapRange.addEquiv f₂)


@[higher_order fst_comp_fst]
theorem comp_fst {α₀ α₁ α₂ β} (f : α₀ → α₁) (f' : α₁ → α₂) (x : F α₀ β) :
    fst f' (fst f x) = fst (f' ∘ f) x

{F : Type u₀ → Type u₁ → Type u₂}
[Bifunctor F]
[LawfulBifunctor F]
{α₀ α₁ α₂ : Type u₀}
{β : Type u₁}
(f : α₀ → α₁)
(f' : α₁ → α₂)
(x : F α₀ β)

Bifunctor.fst f' (Bifunctor.fst f x) = Bifunctor.fst (f' ∘ f) x


@[to_additive (attr := simp)]
theorem ofList_join (xs : List (List α)) : ofList xs.join = (xs.map ofList).prod

FreeMonoid.ofList xs.join = (List.map (⇑FreeMonoid.ofList) xs).prod


@[fun_prop]
theorem DifferentiableOn.inv' (hf : DifferentiableOn 𝕜 h S) (hz : ∀ x ∈ S, h x ≠ 0) :
    DifferentiableOn 𝕜 (fun x => (h x)⁻¹) S

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{R : Type u_6}
[NormedDivisionRing R]
[NormedAlgebra 𝕜 R]
[CompleteSpace R]
{h : E → R}
{S : Set E}
(hf : DifferentiableOn 𝕜 h S)
(hz : ∀ x ∈ S, h x ≠ 0)


lemma condexp_densityProcess (hκν : fst κ ≤ ν) [IsFiniteKernel ν]
    {i j : ℕ} (hij : i ≤ j) (a : α) {s : Set β} (hs : MeasurableSet s) :
    (ν a)[fun x ↦ densityProcess κ ν j a x s | countableFiltration γ i]
      =ᵐ[ν a] fun x ↦ densityProcess κ ν i a x s

{κ : ProbabilityTheory.Kernel α (γ × β)}

ν a[fun x => κ.densityProcess ν j a x s|↑(ProbabilityTheory.countableFiltration γ) i] =ᵐ[ν a] fun x =>
  κ.densityProcess ν i a x s


/-- The difference of `log (1-z)⁻¹` and its `(n+1)`st Taylor polynomial can be bounded in
terms of `‖z‖`. -/
lemma norm_log_one_sub_inv_add_logTaylor_neg_le (n : ℕ) {z : ℂ} (hz : ‖z‖ < 1) :
    ‖log (1 - z)⁻¹ + logTaylor (n + 1) (-z)‖ ≤ ‖z‖ ^ (n + 1) * (1 - ‖z‖)⁻¹ / (n + 1)

‖Complex.log (1 - z)⁻¹ + Complex.logTaylor (n + 1) (-z)‖ ≤ ‖z‖ ^ (n + 1) * (1 - ‖z‖)⁻¹ / (↑n + 1)


theorem hasFDerivWithinAt_inv (x_ne_zero : x ≠ 0) :
    HasFDerivWithinAt (fun x => x⁻¹) (smulRight (1 : 𝕜 →L[𝕜] 𝕜) (-(x ^ 2)⁻¹) : 𝕜 →L[𝕜] 𝕜) s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{s : Set 𝕜}
(x_ne_zero : x ≠ 0)

HasFDerivWithinAt (fun x => x⁻¹) (ContinuousLinearMap.smulRight 1 (-(x ^ 2)⁻¹)) s x


theorem surjective_of_nonzero_of_finrank_eq_one {W A : Type*} [Semiring A] [Module A V]
    [AddCommGroup W] [Module K W] [Module A W] [LinearMap.CompatibleSMul V W K A]
    (h : finrank K W = 1) {f : V →ₗ[A] W} (w : f ≠ 0) : Surjective f

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
{W : Type u_1}
{A : Type u_2}
[Semiring A]
[Module A V]
[AddCommGroup W]
[Module K W]
[Module A W]
[LinearMap.CompatibleSMul V W K A]
(h : FiniteDimensional.finrank K W = 1)
{f : V →ₗ[A] W}
(w : f ≠ 0)


/-- For a functor `G : J ⥤ K ⥤ C`, its colimit `K ⥤ C` is given by `(G' : K ⥤ J ⥤ C) ⋙ colim`.
Note that this does not require `K` to be small.
-/
@[simps!]
def colimitIsoSwapCompColim [HasColimitsOfShape J C] (G : J ⥤ K ⥤ C) :
    colimit G ≅ curry.obj (Prod.swap K J ⋙ uncurry.obj G) ⋙ colim

(CategoryTheory.Limits.colimitIsoSwapCompColim G).inv.app X =
  CategoryTheory.Limits.colimMap ((CategoryTheory.flipIsoCurrySwapUncurry G).inv.app X) ≫
    (CategoryTheory.Limits.colimitObjIsoColimitCompEvaluation G X).inv


@[simp]
theorem zsmul_lie (a : ℤ) : ⁅a • x, m⁆ = a • ⁅x, m⁆

{L : Type v}
{M : Type w}
[LieRing L]
[AddCommGroup M]
[LieRingModule L M]
(x : L)
(m : M)
(a : ℤ)


@[to_additive]
theorem comap_injective_of_surjective : Function.Injective (comap f)

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
{F : Type u_4}
[FunLike F M N]
[mc : AddMonoidHomClass F M N]
{f : F}
(hf : Function.Surjective ⇑f)


theorem int_rawCast_neg {R} [Ring R] : (Int.rawCast (.negOfNat n) : R) = -Nat.rawCast n


protected theorem isLUB_sSup (S : Set ℝ) (h₁ : S.Nonempty) (h₂ : BddAbove S) :
    IsLUB S (sSup S)


/-- Two functions defined on two (possibly different) measure spaces are identically distributed if
their image measures coincide. This only makes sense when the functions are ae measurable
(as otherwise the image measures are not defined), so we require this as well in the definition. -/
structure IdentDistrib (f : α → γ) (g : β → γ)
    (μ : Measure α := by volume_tac)
    (ν : Measure β := by volume_tac) : Prop where
  aemeasurable_fst : AEMeasurable f μ
  aemeasurable_snd : AEMeasurable g ν
  map_eq : Measure.map f μ = Measure.map g ν

{μ : autoParam (MeasureTheory.Measure α) _auto✝}

{ν : autoParam (MeasureTheory.Measure β) _auto✝¹}

(self : ProbabilityTheory.IdentDistrib f g μ ν)


@[to_additive]
theorem ExponentExists.orderOf_pos (h : ExponentExists G) (g : G) : 0 < orderOf g

{G : Type u}
[Monoid G]
(h : Monoid.ExponentExists G)
(g : G)


theorem Basis.mk_eq_rank (v : Basis ι R M) :
    Cardinal.lift.{v} #ι = Cardinal.lift.{w} (Module.rank R M)

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
{ι : Type w}
[StrongRankCondition R]
(v : Basis ι R M)

Cardinal.lift.{v, w} #ι = Cardinal.lift.{w, v} (Module.rank R M)


theorem irreducible_isUnit_mul {a b : α} (h : IsUnit a) : Irreducible (a * b) ↔ Irreducible b

{α : Type u_1}
[Monoid α]
{a b : α}
(h : IsUnit a)


lemma isEquivalence_of_iso {F G : C ⥤ D} (e : F ≅ G) [F.IsEquivalence] : G.IsEquivalence

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F G : CategoryTheory.Functor C D}
(e : F ≅ G)
[F.IsEquivalence]


{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}


theorem continuous_algebraMap_iff_smul [TopologicalSemiring A] :
    Continuous (algebraMap R A) ↔ Continuous fun p : R × A => p.1 • p.2

(R : Type u_1)
(A : Type u)
[CommSemiring R]
[Semiring A]
[Algebra R A]
[TopologicalSpace R]
[TopologicalSpace A]
[TopologicalSemiring A]

Continuous ⇑(algebraMap R A) ↔ Continuous fun p => p.1 • p.2


theorem top_div_of_ne_top (h : a ≠ ∞) : ∞ / a = ∞


/-- The norm on the quotient satisfies `‖-x‖ = ‖x‖`. -/
theorem quotient_norm_neg {S : AddSubgroup M} (x : M ⧸ S) : ‖-x‖ = ‖x‖

{M : Type u_1}
[SeminormedAddCommGroup M]
{S : AddSubgroup M}
(x : M ⧸ S)


protected lemma MulActionWithZero.subsingleton
    [MulActionWithZero R M] [Subsingleton R] : Subsingleton M

(R : Type u_1)
(M : Type u_3)
[MonoidWithZero R]
[Zero M]
[MulActionWithZero R M]
[Subsingleton R]


@[simp] theorem Bool.not_false : (!false) = true


theorem StronglyMeasurable.aeStronglyMeasurable' {α β} {m _ : MeasurableSpace α}
    [TopologicalSpace β] {μ : Measure α} {f : α → β} (hf : StronglyMeasurable[m] f) :
    AEStronglyMeasurable' m f μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}

∀ {x : MeasurableSpace α} [inst : TopologicalSpace β] {μ : MeasureTheory.Measure α} {f : α → β},
  MeasureTheory.StronglyMeasurable f → MeasureTheory.AEStronglyMeasurable' m f μ


theorem mapsTo_id (s : Set α) : MapsTo id s s


@[to_additive]
theorem prod_biUnion [DecidableEq α] {s : Finset γ} {t : γ → Finset α}
    (hs : Set.PairwiseDisjoint (↑s) t) : ∏ x ∈ s.biUnion t, f x = ∏ x ∈ s, ∏ i ∈ t x, f i

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
{f : α → β}
[CommMonoid β]
[DecidableEq α]
{s : Finset γ}
{t : γ → Finset α}
(hs : (↑s).PairwiseDisjoint t)


theorem uniformContinuous_pi {β : Type*} [UniformSpace β] {f : β → ∀ i, α i} :
    UniformContinuous f ↔ ∀ i, UniformContinuous fun x => f x i

{ι : Type u_1}
{α : ι → Type u}
[U : (i : ι) → UniformSpace (α i)]
{β : Type u_4}
[UniformSpace β]
{f : β → (i : ι) → α i}

UniformContinuous f ↔ ∀ (i : ι), UniformContinuous fun x => f x i


/-- Two vectors with zero angle between them are equal if and only if they have equal norms. -/
theorem eq_iff_norm_eq_of_oangle_eq_zero {x y : V} (h : o.oangle x y = 0) : x = y ↔ ‖x‖ = ‖y‖

[Fact (FiniteDimensional.finrank ℝ V = 2)]


/-- A continuous function is strongly measurable when either the source space or the target space
is second-countable. -/
theorem _root_.Continuous.stronglyMeasurable [MeasurableSpace α] [TopologicalSpace α]
    [OpensMeasurableSpace α] [TopologicalSpace β] [PseudoMetrizableSpace β]
    [h : SecondCountableTopologyEither α β] {f : α → β} (hf : Continuous f) :
    StronglyMeasurable f


/-- A `BasedNatTrans` between two `BasedFunctor`s is a natural transformation `α` between the
underlying functors, such that for all `a : 𝒳`, `α.app a` lifts `𝟙 S` whenever `𝒳.p.obj a = S`. -/
structure BasedNatTrans {𝒳 : BasedCategory.{v₂, u₂} 𝒮} {𝒴 : BasedCategory.{v₃, u₃} 𝒮}
    (F G : 𝒳 ⥤ᵇ 𝒴) extends CategoryTheory.NatTrans F.toFunctor G.toFunctor where
  isHomLift' : ∀ (a : 𝒳.obj), IsHomLift 𝒴.p (𝟙 (𝒳.p.obj a)) (toNatTrans.app a) := by aesop_cat

(self : CategoryTheory.BasedNatTrans F G)

𝒴.p.IsHomLift (CategoryTheory.CategoryStruct.id (𝒳.p.obj a)) (self.app a)


/-- A language consisting of Skolem functions for another language.
Called `skolem₁` because it is the first step in building a Skolemization of a language. -/
@[simps]
def skolem₁ : Language

L.skolem₁.Functions n = L.BoundedFormula Empty (n + 1)


lemma W_isInvertedBy_whiskeringRight_presheafToSheaf :
    J.W.IsInvertedBy (((whiskeringRight Cᵒᵖ A B).obj F) ⋙ presheafToSheaf J B)

(J : CategoryTheory.GrothendieckTopology C)

J.W.IsInvertedBy (((CategoryTheory.whiskeringRight Cᵒᵖ A B).obj F).comp (CategoryTheory.presheafToSheaf J B))


/-- If `f` and `g` are two approximate solutions of the same ODE, then the distance between them
can't grow faster than exponentially. This is a simple corollary of Grönwall's inequality, and some
people call this Grönwall's inequality too.

This version assumes all inequalities to be true in the whole space. -/
theorem dist_le_of_approx_trajectories_ODE
    (hv : ∀ t, LipschitzWith K (v t))
    (hf : ContinuousOn f (Icc a b))
    (hf' : ∀ t ∈ Ico a b, HasDerivWithinAt f (f' t) (Ici t) t)
    (f_bound : ∀ t ∈ Ico a b, dist (f' t) (v t (f t)) ≤ εf)
    (hg : ContinuousOn g (Icc a b))
    (hg' : ∀ t ∈ Ico a b, HasDerivWithinAt g (g' t) (Ici t) t)
    (g_bound : ∀ t ∈ Ico a b, dist (g' t) (v t (g t)) ≤ εg)
    (ha : dist (f a) (g a) ≤ δ) :
    ∀ t ∈ Icc a b, dist (f t) (g t) ≤ gronwallBound δ K (εf + εg) (t - a)

(hf' : ∀ t ∈ Set.Ico a b, HasDerivWithinAt f (f' t) (Set.Ici t) t)

(f_bound : ∀ t ∈ Set.Ico a b, dist (f' t) (v t (f t)) ≤ εf)

(hg' : ∀ t ∈ Set.Ico a b, HasDerivWithinAt g (g' t) (Set.Ici t) t)

(g_bound : ∀ t ∈ Set.Ico a b, dist (g' t) (v t (g t)) ≤ εg)

t ∈ Set.Icc a b → dist (f t) (g t) ≤ gronwallBound δ (↑K) (εf + εg) (t - a)


theorem ae_tendsto_lintegral_div {f : α → ℝ≥0∞} (hf : AEMeasurable f μ) (h'f : (∫⁻ y, f y ∂μ) ≠ ∞) :
    ∀ᵐ x ∂μ, Tendsto (fun a => (∫⁻ y in a, f y ∂μ) / μ a) (v.filterAt x) (𝓝 (f x))

{f : α → ℝ≥0∞}

∀ᵐ (x : α) ∂μ, Filter.Tendsto (fun a => (∫⁻ (y : α) in a, f y ∂μ) / μ a) (v.filterAt x) (𝓝 (f x))


/-- If `1 < p`, then `q p`, the smallest prime factor of `mersenne p`, is more than 2. -/
theorem two_lt_q (p' : ℕ) : 2 < q (p' + 2)


protected theorem fderiv : fderiv 𝕜 iso x = iso

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{x : E}
(iso : E ≃ₗᵢ[𝕜] F)

fderiv 𝕜 (⇑iso) x = ↑{ toLinearEquiv := iso.toLinearEquiv, continuous_toFun := ⋯, continuous_invFun := ⋯ }


@[reassoc]
theorem whiskerRight_id_symm {X Y : C} (f : X ⟶ Y) :
    f = (ρ_ X).inv ≫ f ▷ 𝟙_ C ≫ (ρ_ Y).hom

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.MonoidalCategory C]
{X Y : C}
(f : X ⟶ Y)

f =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.rightUnitor X).inv
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.whiskerRight f (𝟙_ C))
      (CategoryTheory.MonoidalCategory.rightUnitor Y).hom)


theorem _root_.QuadraticMap.polarBilin_injective (h : IsUnit (2 : R)) :
    Function.Injective (polarBilin : QuadraticMap R M N → _)

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
(h : IsUnit 2)


/-- The `Finsupp` version of `Finset.univ_sum_single` -/
@[simp]
theorem univ_sum_single [Fintype α] [AddCommMonoid M] (f : α →₀ M) :
    ∑ a : α, single a (f a) = f

{α : Type u_1}
{M : Type u_8}
[Fintype α]
[AddCommMonoid M]
(f : α →₀ M)


theorem inter_congr_right (hs : t ∩ u ⊆ s) (ht : s ∩ u ⊆ t) : s ∩ u = t ∩ u

{α : Type u}
{s t u : Set α}
(hs : t ∩ u ⊆ s)
(ht : s ∩ u ⊆ t)


lemma Basis.closure_eq_closure (h : M.Basis I X) : M.closure I = M.closure X

{α : Type u_2}
{M : Matroid α}
{X I : Set α}
(h : M.Basis I X)


@[simp]
theorem linearIsometryBoundedOfCompact_of_compact_toEquiv :
    (linearIsometryBoundedOfCompact α E 𝕜).toLinearEquiv.toEquiv = equivBoundedOfCompact α E

{α : Type u_1}
{E : Type u_3}
[TopologicalSpace α]
[CompactSpace α]
[NormedAddCommGroup E]
{𝕜 : Type u_4}
[NormedField 𝕜]
[NormedSpace 𝕜 E]

(ContinuousMap.linearIsometryBoundedOfCompact α E 𝕜).toEquiv = ContinuousMap.equivBoundedOfCompact α E


@[to_additive]
theorem preimage_smul_inv (a : α) (t : Set β) : (fun x ↦ a⁻¹ • x) ⁻¹' t = a • t

{α : Type u_2}
{β : Type u_3}
[Group α]
[MulAction α β]
(a : α)
(t : Set β)


@[simp]
theorem inl_smul [Monoid S] [AddMonoid A] [SMul S R] [DistribMulAction S A] (s : S) (r : R) :
    (inl (s • r) : Unitization R A) = s • inl r

{S : Type u_2}
{R : Type u_3}
(A : Type u_4)
[Monoid S]
[AddMonoid A]
[SMul S R]
[DistribMulAction S A]
(s : S)
(r : R)

Unitization.inl (s • r) = s • Unitization.inl r


theorem map_iSup (K : ι → Ideal R) : (iSup K).map f = ⨆ i, (K i).map f

{R : Type u}
{S : Type v}
{F : Type u_1}
[Semiring R]
[Semiring S]
[FunLike F R S]
[rc : RingHomClass F R S]
(f : F)
{ι : Sort u_3}
(K : ι → Ideal R)

Ideal.map f (iSup K) = ⨆ i, Ideal.map f (K i)


protected theorem Computable₂.partrec₂ {α β σ} [Primcodable α] [Primcodable β] [Primcodable σ]
    {f : α → β → σ} (hf : Computable₂ f) : Partrec₂ fun a => (f a : β →. σ)

{α : Type u_1}
{β : Type u_2}
{σ : Type u_3}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
{f : α → β → σ}
(hf : Computable₂ f)


theorem exists_forall_closedBall_subset_aux₂ (y : X) :
    Convex ℝ
      (Ioi (0 : ℝ) ∩ ENNReal.ofReal ⁻¹' ⋂ (i) (_ : y ∈ K i), { r | closedBall y r ⊆ U i })

{ι : Type u_1}
{X : Type u_2}
[EMetricSpace X]
{K U : ι → Set X}
(y : X)

Convex ℝ (Set.Ioi 0 ∩ ENNReal.ofReal ⁻¹' ⋂ i, ⋂ (_ : y ∈ K i), {r | EMetric.closedBall y r ⊆ U i})


theorem nhds_top {a : α} : @nhds α ⊤ a = ⊤


theorem ContMDiffWithinAt.prod_mk_space {f : M → E'} {g : M → F'}
    (hf : ContMDiffWithinAt I 𝓘(𝕜, E') n f s x) (hg : ContMDiffWithinAt I 𝓘(𝕜, F') n g s x) :
    ContMDiffWithinAt I 𝓘(𝕜, E' × F') n (fun x => (f x, g x)) s x


theorem lift_of (F : G →* A) (x) : lift k G A F (of k G x) = F x

{k : Type u₁}
{G : Type u₂}
[CommSemiring k]
[Monoid G]
{A : Type u₃}
[Semiring A]
[Algebra k A]
(F : G →* A)
(x : G)

((MonoidAlgebra.lift k G A) F) ((MonoidAlgebra.of k G) x) = F x


theorem pred_ok (q₁ q₂ s v) (c d : List Γ') : ∃ s',
    Reaches₁ (TM2.step tr) ⟨some (Λ'.pred q₁ q₂), s, K'.elim (trList v) [] c d⟩
      (v.headI.rec ⟨some q₁, s', K'.elim (trList v.tail) [] c d⟩ fun n _ =>
        ⟨some q₂, s', K'.elim (trList (n::v.tail)) [] c d⟩)

(q₁ q₂ : Turing.PartrecToTM2.Λ')
(s : Option Turing.PartrecToTM2.Γ')
(v : List ℕ)
(c d : List Turing.PartrecToTM2.Γ')

∃ s',
  Turing.Reaches₁ (Turing.TM2.step Turing.PartrecToTM2.tr)
    { l := some (q₁.pred q₂), var := s, stk := Turing.PartrecToTM2.K'.elim (Turing.PartrecToTM2.trList v) [] c d }
    (Nat.rec { l := some q₁, var := s', stk := Turing.PartrecToTM2.K'.elim (Turing.PartrecToTM2.trList v.tail) [] c d }
      (fun n x =>
        { l := some q₂, var := s',
          stk := Turing.PartrecToTM2.K'.elim (Turing.PartrecToTM2.trList (n :: v.tail)) [] c d })
      v.headI)


@[simp]
theorem toLp_comp_toContinuousMap [NormedField 𝕜] [NormedSpace 𝕜 E] (f : α →ᵇ E) :
    toLp (E := E) p μ 𝕜 f.toContinuousMap = BoundedContinuousFunction.toLp (E := E) p μ 𝕜 f

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
(μ : MeasureTheory.Measure α)
[NormedAddCommGroup E]
[TopologicalSpace α]
[BorelSpace α]
[SecondCountableTopologyEither α E]
[CompactSpace α]
[MeasureTheory.IsFiniteMeasure μ]
{𝕜 : Type u_5}
[Fact (1 ≤ p)]
[NormedField 𝕜]
[NormedSpace 𝕜 E]
(f : α →ᵇ E)

(ContinuousMap.toLp p μ 𝕜) f.toContinuousMap = (BoundedContinuousFunction.toLp p μ 𝕜) f


theorem castSucc_ne_zero_of_lt {p i : Fin n} (h : p < i) : castSucc i ≠ 0


@[simp, norm_cast] lemma cast_le : (m : R) ≤ n ↔ m ≤ n

[CovariantClass R R (fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]

↑m ≤ ↑n ↔ m ≤ n


theorem factors_left_of_inf_factors {A B : C} {X Y : Subobject B} {f : A ⟶ B}
    (h : (X ⊓ Y).Factors f) : X.Factors f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Limits.HasPullbacks C]
{A B : C}
{X Y : CategoryTheory.Subobject B}
{f : A ⟶ B}
(h : (X ⊓ Y).Factors f)


/-- A finite partition of `a : α` is a pairwise disjoint finite set of elements whose supremum is
`a`. We forbid `⊥` as a part. -/
@[ext]
structure Finpartition [Lattice α] [OrderBot α] (a : α) where
  -- Porting note: Docstrings added
  /-- The elements of the finite partition of `a` -/
  parts : Finset α
  /-- The partition is supremum-independent -/
  supIndep : parts.SupIndep id
  /-- The supremum of the partition is `a` -/
  sup_parts : parts.sup id = a
  /-- No element of the partition is bottom-/
  not_bot_mem : ⊥ ∉ parts
  deriving DecidableEq

{α : Type u_1}
[Lattice α]
[OrderBot α]
{a : α}
(self : Finpartition a)


/-- **Nested intervals lemma**: if `f` is a monotone sequence, `g` is an antitone sequence, and
`f n ≤ g n` for all `n`, then `⨆ n, f n` belongs to all the intervals `[f n, g n]`. -/
theorem Monotone.ciSup_mem_iInter_Icc_of_antitone [SemilatticeSup β] {f g : β → α} (hf : Monotone f)
    (hg : Antitone g) (h : f ≤ g) : (⨆ n, f n) ∈ ⋂ n, Icc (f n) (g n)

{α : Type u_1}
{β : Type u_2}
[ConditionallyCompleteLattice α]
[SemilatticeSup β]
{f g : β → α}
(hf : Monotone f)
(hg : Antitone g)
(h : f ≤ g)


/-- If `C` has all limits of diagrams `parallelPair f g`, then it has all equalizers -/
theorem hasEqualizers_of_hasLimit_parallelPair
    [∀ {X Y : C} {f g : X ⟶ Y}, HasLimit (parallelPair f g)] : HasEqualizers C

[∀ {X Y : C} {f g : X ⟶ Y}, CategoryTheory.Limits.HasLimit (CategoryTheory.Limits.parallelPair f g)]


@[simp]
theorem center_toNonUnitalSubsemiring :
    (center R).toNonUnitalSubsemiring = NonUnitalSubsemiring.center R

(NonUnitalSubring.center R).toNonUnitalSubsemiring = NonUnitalSubsemiring.center R


private theorem add_zero' (x : LocalizedModule S M) : x + 0 = x

{R : Type u}
[CommSemiring R]
{S : Submonoid R}
{M : Type v}
[AddCommMonoid M]
[Module R M]
(x : LocalizedModule S M)


/-- If `C` is equivalent to `D`, then `E ⥤ C` is equivalent to `E ⥤ D`. -/
@[simps! functor inverse unitIso counitIso]
def congrRight (e : C ≌ D) : E ⥤ C ≌ E ⥤ D

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
(e : C ≌ D)

e.congrRight.inverse = (CategoryTheory.whiskeringRight E D C).obj e.inverse


@[simp]
theorem ofInt'_eq : ∀ n : ℤ, ZNum.ofInt' n = n


theorem Integrable.add {f g : α → β} (hf : Integrable f μ) (hg : Integrable g μ) :
    Integrable (f + g) μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
{f g : α → β}
(hf : MeasureTheory.Integrable f μ)
(hg : MeasureTheory.Integrable g μ)


@[simp]
theorem turanGraph_eq_top : turanGraph n r = ⊤ ↔ r = 0 ∨ n ≤ r

SimpleGraph.turanGraph n r = ⊤ ↔ r = 0 ∨ n ≤ r


@[to_additive]
theorem one_def [∀ i, One <| f i] : (1 : ∀ i, f i) = fun _ => 1

{I : Type u}
{f : I → Type v₁}
[(i : I) → Zero (f i)]


protected theorem congr_fun {f g : M [⋀^ι]→ₗ[R] N} (h : f = g) (x : ι → M) : f x = g x

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_7}
{f g : M [⋀^ι]→ₗ[R] N}
(h : f = g)
(x : ι → M)


@[to_additive (attr := simp, norm_cast)] lemma coe_one : ((1 : α) : WithBot α) = 1


@[simp]
theorem eraseNone_map_some (s : Finset α) : eraseNone (s.map Embedding.some) = s

Finset.eraseNone (Finset.map Function.Embedding.some s) = s


@[to_additive]
theorem comp_nat_add {f : ℕ → M} {k : ℕ} (h : Multipliable fun n ↦ f (n + k)) : Multipliable f

{M : Type u_1}
[CommMonoid M]
[TopologicalSpace M]
[ContinuousMul M]
{f : ℕ → M}
{k : ℕ}
(h : Multipliable fun n => f (n + k))


theorem gradient_eq_deriv : ∇ g u = starRingEnd 𝕜 (deriv g u)

{𝕜 : Type u_1}
[RCLike 𝕜]
{g : 𝕜 → 𝕜}
{u : 𝕜}


theorem isRelPrime_zero_right : IsRelPrime x 0 ↔ IsUnit x

{α : Type u_1}
[CommMonoidWithZero α]
{x : α}