@[to_additive mem_rightAddCoset]
theorem mem_rightCoset {s : Set α} {x : α} (a : α) (hxS : x ∈ s) : x * a ∈ op a • s

{α : Type u_1}
[Mul α]
{s : Set α}
{x : α}
(a : α)
(hxS : x ∈ s)


theorem Function.Surjective.wellFounded_iff {f : α → β} (hf : Surjective f)
    (o : ∀ {a b}, r a b ↔ s (f a) (f b)) :
    WellFounded r ↔ WellFounded s

(o : ∀ {a b : α}, r a b ↔ s (f a) (f b))


@[simp]
theorem gcd_zero_right (a : R) : gcd a 0 = a

{R : Type u}
[EuclideanDomain R]
[DecidableEq R]
(a : R)


theorem to_group_eq_one_of_mem_closure : ∀ x ∈ Subgroup.normalClosure rels, F x = 1

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

x ∈ Subgroup.normalClosure rels → (FreeGroup.lift f) x = 1


theorem sInf_caratheodory (s : Set α) (hs : MeasurableSet s) :
    MeasurableSet[(sInf (toOuterMeasure '' m)).caratheodory] s

{α : Type u_1}
{m0 : MeasurableSpace α}
{m : Set (MeasureTheory.Measure α)}
(s : Set α)
(hs : MeasurableSet s)


/-- If `K / E / F` is a field extension tower, such that `E / F` is purely inseparable,
then $[K:F]_s = [K:E]_s$.
It is a special case of `Field.lift_sepDegree_mul_lift_sepDegree_of_isAlgebraic`, and is an
intermediate result used to prove it. -/
lemma sepDegree_eq_of_isPurelyInseparable [IsPurelyInseparable F E] :
    sepDegree F K = sepDegree E K

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
(K : Type w)
[Field K]
[Algebra F K]
[Algebra E K]
[IsScalarTower F E K]
[IsPurelyInseparable F E]

Field.sepDegree F K = Field.sepDegree E K


/-- In a preconnected set, if a symmetric transitive relation `P x y` is true for `y` close
enough to `x`, then it holds for all `x, y`. This is a version of the fact that, if an equivalence
relation has open classes, then it has a single equivalence class. -/
lemma IsPreconnected.induction₂ {s : Set α} (hs : IsPreconnected s) (P : α → α → Prop)
    (h : ∀ x ∈ s, ∀ᶠ y in 𝓝[s] x, P x y)
    (h' : ∀ x y z, x ∈ s → y ∈ s → z ∈ s → P x y → P y z → P x z)
    (h'' : ∀ x y, x ∈ s → y ∈ s → P x y → P y x)
    {x y : α} (hx : x ∈ s) (hy : y ∈ s) : P x y

(h : ∀ x ∈ s, ∀ᶠ (y : α) in 𝓝[s] x, P x y)

(h' : ∀ (x y z : α), x ∈ s → y ∈ s → z ∈ s → P x y → P y z → P x z)

(h'' : ∀ (x y : α), x ∈ s → y ∈ s → P x y → P y x)


lemma mk_surjective (f : StructuredArrow S T) :
    ∃ (Y : C) (g : S ⟶ T.obj Y), f = mk g

(f : CategoryTheory.StructuredArrow S T)

∃ Y g, f = CategoryTheory.StructuredArrow.mk g


@[simp] theorem run_monadMap [Monad m] [MonadFunctor n m] (f : {β : Type u} → n β → n β) (x : StateT σ m α) (s : σ)
    : (monadMap @f x : StateT σ m α).run s = monadMap @f (x.run s)

{m : Type u → Type u_1}
{n : Type u → Type u_2}
{σ α : Type u}
[Monad m]
[MonadFunctor n m]
(f : {β : Type u} → n β → n β)
(x : StateT σ m α)
(s : σ)

(monadMap f x).run s = monadMap f (x.run s)


lemma iIndep.meas_iInter [Fintype ι] (hμ : iIndep m μ) (hs : ∀ i, MeasurableSet[m i] (s i)) :
    μ (⋂ i, s i) = ∏ i, μ (s i)

{Ω : Type u_1}
{ι : Type u_2}
{m : ι → MeasurableSpace Ω}

∀ {x : MeasurableSpace Ω} {μ : MeasureTheory.Measure Ω} {s : ι → Set Ω} [inst : Fintype ι],
  ProbabilityTheory.iIndep m μ → (∀ (i : ι), MeasurableSet (s i)) → μ (⋂ i, s i) = ∏ i : ι, μ (s i)


theorem _root_.AlgebraicGeometry.Scheme.Hom.isAffineOpen_iff_of_isOpenImmersion
    (f : AlgebraicGeometry.Scheme.Hom X Y) [H : IsOpenImmersion f] {U : X.Opens} :
    IsAffineOpen (f ''ᵁ U) ↔ IsAffineOpen U

[H : AlgebraicGeometry.IsOpenImmersion f]

AlgebraicGeometry.IsAffineOpen (f.opensFunctor.obj U) ↔ AlgebraicGeometry.IsAffineOpen U


@[to_additive]
theorem pow_eq_mod_exponent {n : ℕ} (g : G) : g ^ n = g ^ (n % exponent G)


theorem smul_mono (hij : I ≤ J) (hnp : N ≤ P) : I • N ≤ J • P

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{I J : Ideal R}
{N P : Submodule R M}
(hij : I ≤ J)
(hnp : N ≤ P)


/-- If `f₀, f₁, f₂, ...` and `g₀, g₁, g₂, ...` are both multipliable, then the product of the
`ℤ`-indexed sequence: `..., g₂, g₁, g₀, f₀, f₁, f₂, ...` (with `f₀` at the `0`-th position) is
`(∏' n, f n) * ∏' n, g n`. -/
@[to_additive "If `f₀, f₁, f₂, ...` and `g₀, g₁, g₂, ...` are both summable, then the sum of the
`ℤ`-indexed sequence: `..., g₂, g₁, g₀, f₀, f₁, f₂, ...` (with `f₀` at the `0`-th position) is
`∑' n, f n + ∑' n, g n`."]
lemma tprod_int_rec [T2Space M] {f g : ℕ → M} (hf : Multipliable f) (hg : Multipliable g) :
    ∏' n : ℤ, Int.rec f g n = (∏' n : ℕ, f n) * ∏' n : ℕ, g n

{M : Type u_1}
[AddCommMonoid M]
[TopologicalSpace M]
[ContinuousAdd M]
[T2Space M]
{f g : ℕ → M}
(hf : Summable f)
(hg : Summable g)

∑' (n : ℤ), Int.rec f g n = ∑' (n : ℕ), f n + ∑' (n : ℕ), g n


theorem nnnorm_fst_eq_snd (a : 𝓜(𝕜, A)) : ‖a.fst‖₊ = ‖a.snd‖₊

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[SMulCommClass 𝕜 A A]
[IsScalarTower 𝕜 A A]
[StarRing A]
[CstarRing A]
(a : 𝓜(𝕜, A))


@[simp]
lemma map_self : IsCartesian.map p f φ φ = 𝟙 a

{𝒮 : Type u₁}
{𝒳 : Type u₂}
[CategoryTheory.Category.{v₁, u₁} 𝒮]
[CategoryTheory.Category.{v₂, u₂} 𝒳]
(p : 𝒳 ⥤ 𝒮)
{R S : 𝒮}
{a b : 𝒳}
(f : R ⟶ S)
(φ : a ⟶ b)
[p.IsCartesian f φ]

CategoryTheory.Functor.IsCartesian.map p f φ φ = 𝟙 a


theorem convexBodyLT'Factor_ne_zero : convexBodyLT'Factor K ≠ 0

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

NumberField.mixedEmbedding.convexBodyLT'Factor K ≠ 0


@[to_additive (attr := simp)]
lemma mulDissociated_singleton : MulDissociated ({a} : Set α) ↔ a ≠ 1


@[simp]
theorem id_apply (a : α) : sInfHom.id α a = a


@[to_additive vadd_filter.instNeBot]
lemma smul_filter.instNeBot [NeBot f] : NeBot (a • f)

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{f : Filter β}
{a : α}
[f.NeBot]


@[simp]
theorem coe_comp [MeasurableSpace β] (f : β →ₛ γ) {g : α → β} (hgm : Measurable g) :
    ⇑(f.comp g hgm) = f ∘ g

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
(f : MeasureTheory.SimpleFunc β γ)
{g : α → β}
(hgm : Measurable g)


@[simp]
theorem integral_sin : ∫ x in a..b, sin x = cos a - cos b

∫ (x : ℝ) in a..b, Real.sin x = Real.cos a - Real.cos b


theorem HasFDerivAt.comp_hasDerivWithinAt_of_eq (hl : HasFDerivAt l l' y)
    (hf : HasDerivWithinAt f f' s x) (hy : y = f x) :
    HasDerivWithinAt (l ∘ f) (l' f') s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type w}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : 𝕜 → F}
{f' : F}
(x : 𝕜)
{s : Set 𝕜}
{l : F → E}
{l' : F →L[𝕜] E}
{y : F}
(hl : HasFDerivAt l l' y)
(hf : HasDerivWithinAt f f' s x)
(hy : y = f x)


theorem locallyConvexSpace_inf {t₁ t₂ : TopologicalSpace E} (h₁ : @LocallyConvexSpace 𝕜 E _ _ _ t₁)
    (h₂ : @LocallyConvexSpace 𝕜 E _ _ _ t₂) : @LocallyConvexSpace 𝕜 E _ _ _ (t₁ ⊓ t₂)

{𝕜 : Type u_2}
{E : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{t₁ t₂ : TopologicalSpace E}
(h₁ : LocallyConvexSpace 𝕜 E)
(h₂ : LocallyConvexSpace 𝕜 E)


@[to_additive le_add_of_nonneg_right]
theorem le_mul_of_one_le_right' [CovariantClass α α (· * ·) (· ≤ ·)] {a b : α} (h : 1 ≤ b) :
    a ≤ a * b

[CovariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1]


@[simp]
theorem mapRange.addEquiv_refl :
    (mapRange.addEquiv fun i => AddEquiv.refl (β₁ i)) = AddEquiv.refl _

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

(DFinsupp.mapRange.addEquiv fun i => AddEquiv.refl (β₁ i)) = AddEquiv.refl (Π₀ (i : ι), β₁ i)


theorem re_tsum {f : α → 𝕜} (h : Summable f) : re (∑' a, f a) = ∑' a, re (f a)

{α : Type u_1}
(𝕜 : Type u_2)
[RCLike 𝕜]
{f : α → 𝕜}
(h : Summable f)

RCLike.re (∑' (a : α), f a) = ∑' (a : α), RCLike.re (f a)


@[simp]
theorem prod_Ico_one_prime : ∏ x ∈ Ico 1 p, (x : ZMod p) = -1


theorem iterate_pos_le_iff_map_le (h : Commute f g) (hf : Monotone f) (hg : StrictMono g) {x n}
    (hn : 0 < n) : f^[n] x ≤ g^[n] x ↔ f x ≤ g x

{α : Type u_1}
[LinearOrder α]
{f g : α → α}
(h : Function.Commute f g)
(hf : Monotone f)
(hg : StrictMono g)
{x : α}
{n : ℕ}
(hn : 0 < n)


/-- The fact that `t` is a lawful traversable functor carries over the
equivalences to `t'`, with the traversable functor structure given by
`Equiv.traversable`. -/
protected theorem isLawfulTraversable : @LawfulTraversable t' (Equiv.traversable eqv)

{t t' : Type u → Type u}
(eqv : (α : Type u) → t α ≃ t' α)
[Traversable t]
[LawfulTraversable t]


/-- This core description of a uniform space is outside of the type class hierarchy. It is useful
  for constructions of uniform spaces, when the topology is derived from the uniform space. -/
structure UniformSpace.Core (α : Type u) where
  /-- The uniformity filter. Once `UniformSpace` is defined, `𝓤 α` (`_root_.uniformity`) becomes the
  normal form. -/
  uniformity : Filter (α × α)
  /-- Every set in the uniformity filter includes the diagonal. -/
  refl : 𝓟 idRel ≤ uniformity
  /-- If `s ∈ uniformity`, then `Prod.swap ⁻¹' s ∈ uniformity`. -/
  symm : Tendsto Prod.swap uniformity uniformity
  /-- For every set `u ∈ uniformity`, there exists `v ∈ uniformity` such that `v ○ v ⊆ u`. -/
  comp : (uniformity.lift' fun s => s ○ s) ≤ uniformity

{α : Type u}
(self : UniformSpace.Core α)


theorem FractionalIdeal.isPrincipal_of_unit_of_comap_mul_span_singleton_eq_top {R A : Type*}
    [CommRing R] [CommRing A] [Algebra R A] {S : Submonoid R} [IsLocalization S A]
    (I : (FractionalIdeal S A)ˣ) {v : A} (hv : v ∈ (↑I⁻¹ : FractionalIdeal S A))
    (h : Submodule.comap (Algebra.linearMap R A) ((I : Submodule R A) * Submodule.span R {v}) = ⊤) :
    Submodule.IsPrincipal (I : Submodule R A)

(h : Submodule.comap (Algebra.linearMap R A) (↑↑I * Submodule.span R {v}) = ⊤)


theorem kernelSubobject_factors_iff {W : C} (h : W ⟶ X) :
    (kernelSubobject f).Factors h ↔ h ≫ f = 0

(CategoryTheory.Limits.kernelSubobject f).Factors h ↔ h ≫ f = 0


@[simp] theorem length_map (as : List α) (f : α → β) : (as.map f).length = as.length

{α : Type u_1}
{β : Type u_2}
(as : List α)
(f : α → β)


theorem univ_inaccessible : IsInaccessible univ.{u, v}


/-- The functor which sends `X, Y` to the product type `X × Y`. -/
@[simps]
def binaryProductFunctor : Type u ⥤ Type u ⥤ Type u

(CategoryTheory.Limits.Types.binaryProductFunctor.obj X).obj Y = (X × Y)


/-- Two linear maps from the graded tensor product agree if they agree on the underlying tensor
product. -/
@[ext]
theorem hom_ext {M} [AddCommMonoid M] [Module R M] ⦃f g : 𝒜 ᵍ⊗[R] ℬ →ₗ[R] M⦄
    (h : f ∘ₗ of R 𝒜 ℬ = (g ∘ₗ of R 𝒜 ℬ : A ⊗[R] B →ₗ[R] M)) :
    f = g

(h : f ∘ₗ ↑(GradedTensorProduct.of R 𝒜 ℬ) = g ∘ₗ ↑(GradedTensorProduct.of R 𝒜 ℬ))


theorem single_mul_single [Add G] {a₁ a₂ : G} {b₁ b₂ : k} :
    single a₁ b₁ * single a₂ b₂ = single (a₁ + a₂) (b₁ * b₂)

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[Add G]
{a₁ a₂ : G}
{b₁ b₂ : k}

AddMonoidAlgebra.single a₁ b₁ * AddMonoidAlgebra.single a₂ b₂ = AddMonoidAlgebra.single (a₁ + a₂) (b₁ * b₂)


@[simp, norm_cast]
theorem Units.coe_prod {M : Type*} [CommMonoid M] (f : α → Mˣ) (s : Finset α) :
    (↑(∏ i ∈ s, f i) : M) = ∏ i ∈ s, (f i : M)

{α : Type u_3}
{M : Type u_6}
[CommMonoid M]
(f : α → Mˣ)
(s : Finset α)


theorem toReal_nonneg_iff_sign_nonneg {θ : Angle} : 0 ≤ θ.toReal ↔ 0 ≤ θ.sign


theorem localRingHom_to_map (J : Ideal P) [J.IsPrime] (f : R →+* P) (hIJ : I = J.comap f)
    (x : R) : localRingHom I J f hIJ (algebraMap _ _ x) = algebraMap _ _ (f x)

{R : Type u_1}
[CommSemiring R]
{P : Type u_3}
[CommSemiring P]
(I : Ideal R)
[hI : I.IsPrime]
(J : Ideal P)
[J.IsPrime]
(f : R →+* P)
(hIJ : I = Ideal.comap f J)
(x : R)

(Localization.localRingHom I J f hIJ) ((algebraMap R (Localization.AtPrime I)) x) =
  (algebraMap P (Localization.AtPrime J)) (f x)


@[simp]
theorem quotAdjoinRootEquivQuotPolynomialQuot_mk_of (p : R[X]) :
    quotAdjoinRootEquivQuotPolynomialQuot I f (Ideal.Quotient.mk (I.map (of f)) (mk f p)) =
      Ideal.Quotient.mk (span ({f.map (Ideal.Quotient.mk I)} : Set (R ⧸ I)[X]))
      (p.map (Ideal.Quotient.mk I))

{R : Type u}
[CommRing R]
(I : Ideal R)
(f p : R[X])

(AdjoinRoot.quotAdjoinRootEquivQuotPolynomialQuot I f)
    ((Ideal.Quotient.mk (Ideal.map (AdjoinRoot.of f) I)) ((AdjoinRoot.mk f) p)) =
  (Ideal.Quotient.mk (Ideal.span {Polynomial.map (Ideal.Quotient.mk I) f})) (Polynomial.map (Ideal.Quotient.mk I) p)


theorem three_le_nValue (hN : 64 ≤ N) : 3 ≤ nValue N


theorem coe_image_subset_range : ↑(s.image f) ⊆ Set.range f

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
{f : α → β}
{s : Finset α}


theorem Ico_subset_Ico_union_Ico {a b c : α} : Ico a c ⊆ Ico a b ∪ Ico b c

{α : Type u_2}
[LinearOrder α]
[LocallyFiniteOrder α]
{a b c : α}

Finset.Ico a c ⊆ Finset.Ico a b ∪ Finset.Ico b c


@[to_additive]
theorem subset_mul_right {s : Finset α} (t : Finset α) (hs : (1 : α) ∈ s) : t ⊆ s * t

{α : Type u_2}
[DecidableEq α]
[MulOneClass α]
{s : Finset α}
(t : Finset α)
(hs : 1 ∈ s)


theorem isField_iff_maximalIdeal_eq : IsField R ↔ maximalIdeal R = ⊥

{R : Type u_1}
[CommSemiring R]
[LocalRing R]

IsField R ↔ LocalRing.maximalIdeal R = ⊥


@[simp]
theorem x_one : (1 : Solution₁ d).x = 1


theorem LiftRel.refl (R : α → α → Prop) (H : Reflexive R) : Reflexive (LiftRel R)

{α : Type u}
(R : α → α → Prop)
(H : Reflexive R)


/-- `Subfield R` is the type of subfields of `R`. A subfield of `R` is a subset `s` that is a
  multiplicative submonoid and an additive subgroup. Note in particular that it shares the
  same 0 and 1 as R. -/
structure Subfield (K : Type u) [DivisionRing K] extends Subring K where
  /-- A subfield is closed under multiplicative inverses. -/
  inv_mem' : ∀ x ∈ carrier, x⁻¹ ∈ carrier

{K : Type u}
[DivisionRing K]
(self : Subfield K)
(x : K)


@[to_additive]
theorem inv_absolutelyContinuous : μ.inv ≪ μ

{G : Type u_1}
[MeasurableSpace G]
[AddGroup G]
[MeasurableAdd₂ G]
(μ : MeasureTheory.Measure G)
[MeasureTheory.SFinite μ]
[MeasurableNeg G]
[μ.IsAddLeftInvariant]


@[simp]
theorem inner_rightAngleRotationAux₁_right (x y : E) :
    ⟪x, o.rightAngleRotationAux₁ y⟫ = -ω x y

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

⟪x, o.rightAngleRotationAux₁ y⟫_ℝ = -(o.areaForm x) y


theorem mk_denom_ne_zero_of_ne_zero {q : ℚ} {n d : ℤ} (hq : q ≠ 0) (hqnd : q = n /. d) : d ≠ 0

{q : ℚ}
{n d : ℤ}
(hq : q ≠ 0)
(hqnd : q = Rat.divInt n d)


theorem eq_iff_principalUnitGroup {A B : ValuationSubring K} :
    A = B ↔ A.principalUnitGroup = B.principalUnitGroup

{K : Type u}
[Field K]
{A B : ValuationSubring K}


@[simp]
theorem bot_mul (S : AddSubmonoid R) : ⊥ * S = ⊥

{R : Type u_4}
[NonUnitalNonAssocSemiring R]
(S : AddSubmonoid R)


protected lemma dvd_add_right (h : a ∣ b) : a ∣ b + c ↔ a ∣ c


theorem pi_Ioi_ae_eq_pi_Ici {s : Set ι} {f : ∀ i, α i} :
    (pi s fun i => Ioi (f i)) =ᵐ[Measure.pi μ] pi s fun i => Ici (f i)

{μ : (i : ι) → MeasureTheory.Measure (α i)}

[∀ (i : ι), MeasureTheory.SigmaFinite (μ i)]

[∀ (i : ι), MeasureTheory.NoAtoms (μ i)]

(s.pi fun i => Set.Ioi (f i)) =ᵐ[MeasureTheory.Measure.pi μ] s.pi fun i => Set.Ici (f i)


@[to_additive]
theorem QuotientGroup.isOpenMap_coe : IsOpenMap ((↑) : G → G ⧸ N)

{G : Type w}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
(N : AddSubgroup G)


lemma surjectiveOnStalks_iff_of_isLocalRingHom [LocalRing S] [IsLocalRingHom f] :
    f.SurjectiveOnStalks ↔ Function.Surjective f

{R : Type u_1}
[CommRing R]
{S : Type u_2}
[CommRing S]
{f : R →+* S}
[LocalRing S]
[IsLocalRingHom f]

f.SurjectiveOnStalks ↔ Function.Surjective ⇑f


theorem stoppedValue_hitting_mem [ConditionallyCompleteLinearOrder ι] [IsWellOrder ι (· < ·)]
    {u : ι → Ω → β} {s : Set β} {n m : ι} {ω : Ω} (h : ∃ j ∈ Set.Icc n m, u j ω ∈ s) :
    stoppedValue u (hitting u s n m) ω ∈ s

{Ω : Type u_1}
{β : Type u_2}
{ι : Type u_3}
[ConditionallyCompleteLinearOrder ι]
[IsWellOrder ι fun x x_1 => x < x_1]
{u : ι → Ω → β}
{s : Set β}
{n m : ι}
{ω : Ω}
(h : ∃ j ∈ Set.Icc n m, u j ω ∈ s)

MeasureTheory.stoppedValue u (MeasureTheory.hitting u s n m) ω ∈ s


@[functor_norm]
theorem fish_pure {α β} (f : α → m β) : f >=> pure = f

{m : Type u → Type v}
[Monad m]
[LawfulMonad m]
{α : Type u_1}
{β : Type u}
(f : α → m β)


theorem summable_measure_toReal [hμ : IsFiniteMeasure μ] {f : ℕ → Set α}
    (hf₁ : ∀ i : ℕ, MeasurableSet (f i)) (hf₂ : Pairwise (Disjoint on f)) :
    Summable fun x => (μ (f x)).toReal

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[hμ : MeasureTheory.IsFiniteMeasure μ]
{f : ℕ → Set α}
(hf₁ : ∀ (i : ℕ), MeasurableSet (f i))
(hf₂ : Pairwise (Disjoint on f))


@[simp]
lemma mem_zeroLocus_iff {U : X.Opens} (s : Set Γ(X, U)) (x : X) :
    x ∈ X.zeroLocus s ↔ ∀ f ∈ s, x ∉ X.basicOpen f

(s : Set ↑(X.presheaf.obj (Opposite.op U)))


theorem mem_support_iff {f : Π₀ i, β i} {i : ι} : i ∈ f.support ↔ f i ≠ 0

[(i : ι) → (x : β i) → Decidable (x ≠ 0)]


theorem exists_measurable_le_withDensity_eq [SFinite μ] (f : α → ℝ≥0∞) :
    ∃ g, Measurable g ∧ g ≤ f ∧ μ.withDensity g = μ.withDensity f

{α : Type u_1}
{m0 : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
[MeasureTheory.SFinite μ]
(f : α → ℝ≥0∞)


@[reassoc (attr := simp)]
theorem pullbackSymmetry_hom_comp_snd [HasPullback f g] :
    (pullbackSymmetry f g).hom ≫ pullback.snd g f = pullback.fst f g

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y Z : C}
(f : X ⟶ Z)
(g : Y ⟶ Z)
[CategoryTheory.Limits.HasPullback f g]

(CategoryTheory.Limits.pullbackSymmetry f g).hom ≫ CategoryTheory.Limits.pullback.snd g f =
  CategoryTheory.Limits.pullback.fst f g


/-- The inner product of two vectors, divided by the product of their
norms, has value 1 if and only if they are nonzero and one is
a positive multiple of the other. -/
theorem real_inner_div_norm_mul_norm_eq_one_iff (x y : F) :
    ⟪x, y⟫_ℝ / (‖x‖ * ‖y‖) = 1 ↔ x ≠ 0 ∧ ∃ r : ℝ, 0 < r ∧ y = r • x

{F : Type u_3}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
(x y : F)

⟪x, y⟫_ℝ / (‖x‖ * ‖y‖) = 1 ↔ x ≠ 0 ∧ ∃ r, 0 < r ∧ y = r • x


theorem add_eq_max_of_ne {q r : ℚ_[p]} (h : ‖q‖ ≠ ‖r‖) : ‖q + r‖ = max ‖q‖ ‖r‖

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{q r : ℚ_[p]}
(h : ‖q‖ ≠ ‖r‖)


theorem ι_image_preimage_eq (i j : D.J) (U : Opens (D.U i).carrier) :
    (Opens.map (𝖣.ι j).base).obj ((D.ι_openEmbedding i).isOpenMap.functor.obj U) =
      (opensFunctor (D.f j i)).obj
        ((Opens.map (𝖣.t j i).base).obj ((Opens.map (𝖣.f i j).base).obj U))

(D : AlgebraicGeometry.PresheafedSpace.GlueData C)

(TopologicalSpace.Opens.map (D.ι j).base).obj (⋯.functor.obj U) =
  (AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.opensFunctor (D.f j i)).obj
    ((TopologicalSpace.Opens.map (D.t j i).base).obj ((TopologicalSpace.Opens.map (D.f i j).base).obj U))


@[simp]
theorem proj_linear (i : ι) : (@proj k _ ι V P _ _ _ i).linear = @LinearMap.proj k ι _ V _ _ i

{k : Type u_1}
[Ring k]
{ι : Type u_10}
{V : ι → Type u_11}
{P : ι → Type u_12}
[(i : ι) → AddCommGroup (V i)]
[(i : ι) → Module k (V i)]
[(i : ι) → AffineSpace (V i) (P i)]
(i : ι)

(AffineMap.proj i).linear = LinearMap.proj i


@[fun_prop]
nonrec theorem ContinuousAt.log (hf : ContinuousAt f a) (h₀ : f a ≠ 0) :
    ContinuousAt (fun x => log (f x)) a

{α : Type u_1}
[TopologicalSpace α]
{f : α → ℝ}
{a : α}
(hf : ContinuousAt f a)
(h₀ : f a ≠ 0)

ContinuousAt (fun x => Real.log (f x)) a


@[simp]
theorem inter_star [Star α] : (s ∩ t)⋆ = s⋆ ∩ t⋆


@[local simp] protected theorem neg_add {a b : Int} : -(a + b) = -a + -b


@[to_additive (attr := simp)]
protected lemma comap_inv : comap Inv.inv f = f⁻¹

{α : Type u_2}
[InvolutiveNeg α]
{f : Filter α}


@[simp]
theorem toMultiset_le_toMultiset : toMultiset f ≤ toMultiset g ↔ f ≤ g

{α : Type u_1}
[DecidableEq α]
{f g : Π₀ (_a : α), ℕ}

DFinsupp.toMultiset f ≤ DFinsupp.toMultiset g ↔ f ≤ g


/-- Main theorem on differentiation of measures: given a Vitali family `v` for a locally finite
measure `μ`, and another locally finite measure `ρ`, then for `μ`-almost every `x` the
ratio `ρ a / μ a` converges, when `a` shrinks to `x` along the Vitali family, towards the
Radon-Nikodym derivative of `ρ` with respect to `μ`. -/
theorem ae_tendsto_rnDeriv :
    ∀ᵐ x ∂μ, Tendsto (fun a => ρ a / μ a) (v.filterAt x) (𝓝 (ρ.rnDeriv μ x))

∀ᵐ (x : α) ∂μ, Filter.Tendsto (fun a => ρ a / μ a) (v.filterAt x) (𝓝 (ρ.rnDeriv μ x))


@[simp]
theorem lcs_zero : I.lcs M 0 = ⊤

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(I : LieIdeal R L)
(M : Type u_3)
[AddCommGroup M]
[Module R M]
[LieRingModule L M]


theorem SymmetricRel.inter {U V : Set (α × α)} (hU : SymmetricRel U) (hV : SymmetricRel V) :
    SymmetricRel (U ∩ V)

{α : Type ua}
{U V : Set (α × α)}
(hU : SymmetricRel U)
(hV : SymmetricRel V)


@[to_additive leftAddCoset_assoc]
theorem leftCoset_assoc (s : Set α) (a b : α) : a • (b • s) = (a * b) • s

{α : Type u_1}
[Semigroup α]
(s : Set α)
(a b : α)


/-- The gamma pdf is nonnegative -/
lemma gammaPDFReal_nonneg {a r : ℝ} (ha : 0 < a) (hr : 0 < r) (x : ℝ) :
    0 ≤ gammaPDFReal a r x

0 ≤ ProbabilityTheory.gammaPDFReal a r x


theorem Poly.of_isNonZero (ctx : Context) {p : Poly} (h : isNonZero p = true) : p.denote ctx > 0

(ctx : Nat.Linear.Context)
{p : Nat.Linear.Poly}
(h : p.isNonZero = true)


theorem subOneIntegralPowerBasis_gen_prime [IsCyclotomicExtension {p ^ (k + 1)} ℚ K]
    (hζ : IsPrimitiveRoot ζ ↑(p ^ (k + 1))) :
    Prime hζ.subOneIntegralPowerBasis.gen


/-- `x⁻¹` is analytic away from zero -/
theorem AnalyticOn.inv {f : E → 𝕝} {s : Set E} (fa : AnalyticOn 𝕜 f s) (f0 : ∀ x ∈ s, f x ≠ 0) :
    AnalyticOn 𝕜 (fun x ↦ (f x)⁻¹) s

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{𝕝 : Type u_7}
[NontriviallyNormedField 𝕝]
[NormedAlgebra 𝕜 𝕝]
{f : E → 𝕝}
{s : Set E}
(fa : AnalyticOn 𝕜 f s)
(f0 : ∀ x ∈ s, f x ≠ 0)


@[to_additive]
theorem mem_iSup {ι : Sort*} (p : ι → Subsemigroup M) {m : M} :
    (m ∈ ⨆ i, p i) ↔ ∀ N, (∀ i, p i ≤ N) → m ∈ N

{M : Type u_1}
[Mul M]
{ι : Sort u_4}
(p : ι → Subsemigroup M)
{m : M}

m ∈ ⨆ i, p i ↔ ∀ (N : Subsemigroup M), (∀ (i : ι), p i ≤ N) → m ∈ N


@[to_additive (attr := simp)]
theorem mulIndicator_apply_eq_one : mulIndicator s f a = 1 ↔ a ∈ s → f a = 1

{α : Type u_1}
{M : Type u_4}
[One M]
{s : Set α}
{f : α → M}
{a : α}

s.mulIndicator f a = 1 ↔ a ∈ s → f a = 1


structure LazyStep where
  preState : Meta.SavedState
  preGoal : MVarId
  /--
  A nonempty list of tactic builders. During script generation, Aesop tries to
  execute the builders from left to right. It then uses the first builder that
  succceds (in the sense that when run in `preState` on `preGoal` it produces
  the `postState` and `postGoals`). The last builder must succeed and is used
  unconditionally.
  -/
  tacticBuilders : Array TacticBuilder
  tacticBuilders_ne : 0 < tacticBuilders.size := by simp
  postState : Meta.SavedState
  postGoals : Array MVarId


/-- *Lebesgue differentiation theorem*: for almost every point `x`, the
average of `f` on `a` tends to `f x` as `a` shrinks to `x` along a Vitali family. -/
theorem ae_tendsto_average [NormedSpace ℝ E] [CompleteSpace E] {f : α → E}
    (hf : LocallyIntegrable f μ) :
    ∀ᵐ x ∂μ, Tendsto (fun a => ⨍ y in a, f y ∂μ) (v.filterAt x) (𝓝 (f x))

(hf : MeasureTheory.LocallyIntegrable f μ)

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


/-- In order to define a natural isomorphism `F ≅ G` with `F G : Quotient r ⥤ D`, it suffices
to do so after precomposing with `Quotient.functor r`. -/
@[simps]
def natIsoLift {F G : Quotient r ⥤ D} (τ : Quotient.functor r ⋙ F ≅ Quotient.functor r ⋙ G) :
    F ≅ G

{F G : CategoryTheory.Functor (CategoryTheory.Quotient r) D}

(τ : (CategoryTheory.Quotient.functor r).comp F ≅ (CategoryTheory.Quotient.functor r).comp G)

(CategoryTheory.Quotient.natIsoLift r τ).hom = CategoryTheory.Quotient.natTransLift r τ.hom


@[fun_prop]
protected nonrec theorem HasFDerivAt.snd (h : HasFDerivAt f₂ f₂' x) :
    HasFDerivAt (fun x => (f₂ x).2) ((snd 𝕜 F G).comp f₂') x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{x : E}
{f₂ : E → F × G}
{f₂' : E →L[𝕜] F × G}
(h : HasFDerivAt f₂ f₂' x)

HasFDerivAt (fun x => (f₂ x).2) ((ContinuousLinearMap.snd 𝕜 F G).comp f₂') x


theorem embedding_of_pullback_embeddings {X Y S : TopCat} {f : X ⟶ S} {g : Y ⟶ S} (H₁ : Embedding f)
    (H₂ : Embedding g) : Embedding (limit.π (cospan f g) WalkingCospan.one)

{X Y S : TopCat}
{f : X ⟶ S}
{g : Y ⟶ S}
(H₁ : Embedding ⇑f)
(H₂ : Embedding ⇑g)

Embedding ⇑(CategoryTheory.Limits.limit.π (CategoryTheory.Limits.cospan f g) CategoryTheory.Limits.WalkingCospan.one)


/-- The colimit cocone for the coproduct over an index type with exactly one term. -/
@[simps]
def colimitCoconeOfUnique : ColimitCocone (Discrete.functor f)

{β : Type w}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
[Unique β]
(f : β → C)

(CategoryTheory.Limits.colimitCoconeOfUnique f).cocone.ι =
  CategoryTheory.Discrete.natTrans fun x =>
    match x with
    | { as := j } => CategoryTheory.eqToHom ⋯


/-- A nonempty preorder with no maximal element is infinite. This is not an instance to avoid
a cycle with `Infinite α → Nontrivial α → Nonempty α`. -/
theorem NoMaxOrder.infinite [Nonempty α] [NoMaxOrder α] : Infinite α

{α : Type u_1}
[Preorder α]
[Nonempty α]
[NoMaxOrder α]


/-- Every edge in a walk's edge list is an edge of the graph.
It is written in this form (rather than using `⊆`) to avoid unsightly coercions. -/
theorem edges_subset_edgeSet {u v : V} :
    ∀ (p : G.Walk u v) ⦃e : Sym2 V⦄, e ∈ p.edges → e ∈ G.edgeSet

{V : Type u}
{G : SimpleGraph V}
{u v : V}
(p : G.Walk u v)
⦃e : Sym2 V⦄


@[to_additive]
lemma prod_map_eq_pow_single [DecidableEq α] {l : List α} (a : α) (f : α → M)
    (hf : ∀ a', a' ≠ a → a' ∈ l → f a' = 1) : (l.map f).prod = f a ^ l.count a

(hf : ∀ (a' : α), a' ≠ a → a' ∈ l → f a' = 0)

(List.map f l).sum = List.count a l • f a


@[simp]
theorem prod_inner_apply (x y : WithLp 2 (E × F)) :
    inner (𝕜 := 𝕜) x y = inner x.fst y.fst + inner x.snd y.snd

{𝕜 : Type u_1}
{E : Type u_4}
{F : Type u_5}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
(x y : WithLp 2 (E × F))


theorem eq_mk_iff_exists {X : C} {P : Cᵒᵖ ⥤ D} {S T : J.Cover X} (x : Meq P S) (y : Meq P T) :
    mk x = mk y ↔ ∃ (W : J.Cover X) (h1 : W ⟶ S) (h2 : W ⟶ T), x.refine h1 = y.refine h2

{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)]

CategoryTheory.GrothendieckTopology.Plus.mk x = CategoryTheory.GrothendieckTopology.Plus.mk y ↔
  ∃ W h1 h2, x.refine h1 = y.refine h2


@[simp]
theorem restrict_empty : v.restrict ∅ = 0

{α : Type u_1}
[MeasurableSpace α]
{M : Type u_3}
[AddCommMonoid M]
[TopologicalSpace M]
(v : MeasureTheory.VectorMeasure α M)


/-- `leftDual` maps every element `J` to `rightFixedPoints`. -/
theorem leftDual_mem_rightFixedPoint (J : Set α) : R.leftDual J ∈ R.rightFixedPoints

{α : Type u_1}
{β : Type u_2}
(R : Rel α β)
(J : Set α)


@[mono]
theorem degreeLT_mono {m n : ℕ} (H : m ≤ n) : degreeLT R m ≤ degreeLT R n

{R : Type u}
[Semiring R]
{m n : ℕ}
(H : m ≤ n)

Polynomial.degreeLT R m ≤ Polynomial.degreeLT R n


theorem cons_left_injective (s : Seq α) : Function.Injective fun x => cons x s

Function.Injective fun x => Stream'.Seq.cons x s


@[simp]
theorem card_plift (α : Type*) : Nat.card (PLift α) = Nat.card α


/-- Every split mono `f` with a cokernel induces a binary bicone with `f` as its `inl` and
the cokernel map as its `snd`.
We will show in `is_bilimit_binary_bicone_of_split_mono_of_cokernel` that this binary bicone is in
fact already a biproduct. -/
@[simps]
def binaryBiconeOfIsSplitMonoOfCokernel {X Y : C} {f : X ⟶ Y} [IsSplitMono f] {c : CokernelCofork f}
    (i : IsColimit c) : BinaryBicone X c.pt

{c : CategoryTheory.Limits.CokernelCofork f}

(CategoryTheory.Limits.binaryBiconeOfIsSplitMonoOfCokernel i).inl = f


@[simp]
theorem translate_apply (x y : ℝ) : translate (Multiplicative.ofAdd x) y = x + y

↑(CircleDeg1Lift.translate (Multiplicative.ofAdd x)) y = x + y


theorem isBigOWith_fst_prod : IsBigOWith 1 l f' fun x => (f' x, g' x)

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

Asymptotics.IsBigOWith 1 l f' fun x => (f' x, g' x)


/-- A localizer morphism `Φ : LocalizerMorphism W₁ W₂` is a right derivability
structure if it has right resolutions and the 2-square where the left and right functors
are localizations functors for `W₁` and `W₂` are Guitart exact. -/
class IsRightDerivabilityStructure : Prop where
  hasRightResolutions : Φ.HasRightResolutions := by infer_instance
  guitartExact' : TwoSquare.GuitartExact ((Φ.catCommSq W₁.Q W₂.Q).iso).hom

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

{Φ : CategoryTheory.LocalizerMorphism W₁ W₂}


theorem Indep.inter_right (hI : M.Indep I) (X : Set α) : M.Indep (I ∩ X)

{α : Type u_1}
{M : Matroid α}
{I : Set α}
(hI : M.Indep I)
(X : Set α)


@[to_additive]
theorem le_def : p ≤ q ↔ (p : E → ℝ) ≤ q

{E : Type u_4}
[Group E]
{p q : GroupNorm E}

p ≤ q ↔ ⇑p ≤ ⇑q


lemma box_succ_eq_sdiff (n : ℕ) :
    box (n + 1) = Icc (-n.succ : α) n.succ \ Icc (-n) n

{α : Type u_1}
[OrderedRing α]
[LocallyFiniteOrder α]
[DecidableEq α]
(n : ℕ)

Finset.box (n + 1) = Finset.Icc (-↑n.succ) ↑n.succ \ Finset.Icc (-↑n) ↑n


/-- If a point in a topological group has a compact neighborhood, then the group is
locally compact. -/
@[to_additive]
theorem IsCompact.locallyCompactSpace_of_mem_nhds_of_group {K : Set G} (hK : IsCompact K) {x : G}
    (h : K ∈ 𝓝 x) : LocallyCompactSpace G

{G : Type w}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
{K : Set G}
(hK : IsCompact K)
{x : G}
(h : K ∈ 𝓝 x)


@[reassoc (attr := simp)]
theorem whiskerLeft_naturality_id (f : a' ⟶ G.obj a) :
    f ◁ θ.naturality (𝟙 a) ≫ f ◁ θ.app a ◁ H.mapId a =
      f ◁ G.mapId a ▷ θ.app a ≫ f ◁ (λ_ (θ.app a)).hom ≫ f ◁ (ρ_ (θ.app a)).inv

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
{G H : CategoryTheory.OplaxFunctor B C}
(θ : CategoryTheory.OplaxNatTrans G H)
{a : B}
{a' : C}
(f : a' ⟶ G.obj a)

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerLeft f (θ.naturality (CategoryTheory.CategoryStruct.id a)))
    (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.whiskerLeft (θ.app a) (H.mapId a))) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.whiskerRight (G.mapId a) (θ.app a)))
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.leftUnitor (θ.app a)).hom)
      (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.rightUnitor (θ.app a)).inv))


/-- The L-series of the convolution product `f ⍟ g` of two sequences `f` and `g`
equals the product of their L-series, assuming both L-series converge. -/
lemma LSeries_convolution' {f g : ℕ → ℂ} {s : ℂ} (hf : LSeriesSummable f s)
    (hg : LSeriesSummable g s) :
    LSeries (f ⍟ g) s = LSeries f s * LSeries g s


/-- A triple is still a triple if you multiply `x`, `y` and `z`
by a constant `k`. -/
theorem mul (k : ℤ) : PythagoreanTriple (k * x) (k * y) (k * z)

{x y z : ℤ}
(h : PythagoreanTriple x y z)
(k : ℤ)


@[simp]
theorem disjSum_empty : s.disjSum (∅ : Finset β) = s.map Embedding.inl

{α : Type u_1}
{β : Type u_2}
(s : Finset α)

s.disjSum ∅ = Finset.map Function.Embedding.inl s


@[to_additive (attr := simp)]
lemma locallyLipschitz_inv_iff : LocallyLipschitz f⁻¹ ↔ LocallyLipschitz f

{α : Type u_5}
{E : Type u_6}
[SeminormedCommGroup E]
[PseudoEMetricSpace α]
{f : α → E}


@[simp]
theorem sub_cons (a : α) (s t : Multiset α) : s - a ::ₘ t = s.erase a - t

{α : Type u_1}
[DecidableEq α]
(a : α)
(s t : Multiset α)


@[to_additive]
theorem HasProd.hasProd_iff_compl {s : Set β} (hf : HasProd (f ∘ (↑) : s → α) a₁) :
    HasProd f a₂ ↔ HasProd (f ∘ (↑) : ↑sᶜ → α) (a₂ / a₁)

{α : Type u_1}
{β : Type u_2}
[CommGroup α]
[TopologicalSpace α]
[TopologicalGroup α]
{f : β → α}
{a₁ a₂ : α}
{s : Set β}
(hf : HasProd (f ∘ Subtype.val) a₁)

HasProd f a₂ ↔ HasProd (f ∘ Subtype.val) (a₂ / a₁)


/-- The canonical functor `(C ⥤ D) ⥤ (Karoubi C ⥤ Karoubi D)` -/
@[simps!]
def functorExtension₂ : (C ⥤ D) ⥤ Karoubi C ⥤ Karoubi D

(C : Type u_1)
(D : Type u_2)
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
(X : CategoryTheory.Functor C D)

∀ {X_1 Y : CategoryTheory.Idempotents.Karoubi C} (f : X_1 ⟶ Y),
  (((CategoryTheory.Idempotents.functorExtension₂ C D).obj X).map f).f = X.map f.f


@[to_additive]
theorem NeBot.of_mul_left : (f * g).NeBot → f.NeBot


@[simp]
-- Porting note: had to add an extra coercion arrow on the right hand side.
theorem coe_quotQuotEquivQuotSupₐ_symm :
    ⇑(quotQuotEquivQuotSupₐ R I J).symm = ⇑(quotQuotEquivQuotSup I J).symm

(R : Type u)
{A : Type u_1}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(I J : Ideal A)

⇑(DoubleQuot.quotQuotEquivQuotSupₐ R I J).symm = ⇑(DoubleQuot.quotQuotEquivQuotSup I J).symm


/-- If `0 ≤ r < 1`, then `n ^ k r ^ n` tends to zero for any natural `k`.
This is a specialized version of `tendsto_pow_const_mul_const_pow_of_abs_lt_one`, singled out
for ease of application. -/
theorem tendsto_pow_const_mul_const_pow_of_lt_one (k : ℕ) {r : ℝ} (hr : 0 ≤ r) (h'r : r < 1) :
    Tendsto (fun n ↦ (n : ℝ) ^ k * r ^ n : ℕ → ℝ) atTop (𝓝 0)

Filter.Tendsto (fun n => ↑n ^ k * r ^ n) Filter.atTop (𝓝 0)


@[to_additive (attr := simp)]
theorem preimage_mul_right_one : (· * b) ⁻¹' 1 = {b⁻¹}


@[simp]
theorem unzip_revzip (l : List α) : (revzip l).unzip = (l, l.reverse)


@[simp]
theorem truncation_zero (f : α → ℝ) : truncation f 0 = 0


/-- The canonical isomorphism relating `(Span f g).op` and `Cospan f.op g.op` -/
@[simps!]
def opSpan {X Y Z : C} (f : X ⟶ Y) (g : X ⟶ Z) :
    (span f g).op ≅ walkingSpanOpEquiv.functor ⋙ cospan f.op g.op

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

∀ (X_1 : CategoryTheory.Limits.WalkingSpanᵒᵖ),
  (CategoryTheory.Limits.opSpan f g).hom.app X_1 =
    (Option.rec (CategoryTheory.Iso.refl (Opposite.op X))
        (fun val =>
          CategoryTheory.Limits.WalkingPair.rec (CategoryTheory.Iso.refl (Opposite.op Y))
            (CategoryTheory.Iso.refl (Opposite.op Z)) val)
        (Opposite.unop X_1)).inv


theorem integral_interval_sub_interval_comm' (hab : IntervalIntegrable f μ a b)
    (hcd : IntervalIntegrable f μ c d) (hac : IntervalIntegrable f μ a c) :
    ((∫ x in a..b, f x ∂μ) - ∫ x in c..d, f x ∂μ) =
      (∫ x in d..b, f x ∂μ) - ∫ x in c..a, f x ∂μ

{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{a b c d : ℝ}
{f : ℝ → E}
{μ : MeasureTheory.Measure ℝ}
(hab : IntervalIntegrable f μ a b)
(hcd : IntervalIntegrable f μ c d)
(hac : IntervalIntegrable f μ a c)

∫ (x : ℝ) in a..b, f x ∂μ - ∫ (x : ℝ) in c..d, f x ∂μ = ∫ (x : ℝ) in d..b, f x ∂μ - ∫ (x : ℝ) in c..a, f x ∂μ


theorem hasGradientAt_iff_tendsto :
    HasGradientAt f f' x ↔
    Tendsto (fun x' => ‖x' - x‖⁻¹ * ‖f x' - f x - ⟪f', x' - x⟫‖) (𝓝 x) (𝓝 0)

{𝕜 : Type u_1}
{F : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
{f : F → 𝕜}
{f' x : F}

HasGradientAt f f' x ↔ Filter.Tendsto (fun x' => ‖x' - x‖⁻¹ * ‖f x' - f x - ⟪f', x' - x⟫_𝕜‖) (𝓝 x) (𝓝 0)


lemma geometricPMFRealSum (hp_pos : 0 < p) (hp_le_one : p ≤ 1) :
    HasSum (fun n ↦ geometricPMFReal p n) 1

{p : ℝ}
(hp_pos : 0 < p)
(hp_le_one : p ≤ 1)

HasSum (fun n => ProbabilityTheory.geometricPMFReal p n) 1


@[to_additive existing]
theorem le_map_div_add_map_div [Group α] [AddCommSemigroup β] [LE β] [MulLEAddHomClass F α β]
    (f : F) (a b c : α) : f (a / c) ≤ f (a / b) + f (b / c)

{F : Type u_2}
{α : Type u_3}
{β : Type u_4}
[FunLike F α β]
[Group α]
[AddCommSemigroup β]
[LE β]
[MulLEAddHomClass F α β]
(f : F)
(a b c : α)


theorem dist_comm (n m : ℕ) : dist n m = dist m n


@[simp]
theorem coe_some (a : α) : (Option.some a : Part α) = some a


/-- `m` is not divisible by `n` if it is between `n * k` and `n * (k + 1)` for some `k`. -/
theorem not_dvd_of_between_consec_multiples (h1 : n * k < m) (h2 : m < n * (k + 1)) : ¬n ∣ m


private theorem Gamma_integrand_deriv_integrable_A {s : ℂ} (hs : 0 < s.re) {X : ℝ} (hX : 0 ≤ X) :
    IntervalIntegrable (fun x => -((-x).exp * x ^ s) : ℝ → ℂ) volume 0 X

IntervalIntegrable (fun x => -(↑(rexp (-x)) * ↑x ^ s)) MeasureTheory.volume 0 X


theorem counitInv_app_functor (e : C ≌ D) (X : C) :
    e.counitInv.app (e.functor.obj X) = e.functor.map (e.unit.app X)

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


protected theorem tendsto (x : E) (hf : IsBoundedLinearMap 𝕜 f) : Tendsto f (𝓝 x) (𝓝 (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}
(x : E)
(hf : IsBoundedLinearMap 𝕜 f)


theorem tendsto_nhds_iff {ι : Type*} {f : α → β} {g : ι → α} {a : Filter ι} {b : α}
    (hf : Isometry f) : Filter.Tendsto g a (𝓝 b) ↔ Filter.Tendsto (f ∘ g) a (𝓝 (f b))

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{ι : Type u_2}
{f : α → β}
{g : ι → α}
{a : Filter ι}
{b : α}
(hf : Isometry f)


theorem tsum_geometric_of_lt_one {r : ℝ} (h₁ : 0 ≤ r) (h₂ : r < 1) : ∑' n : ℕ, r ^ n = (1 - r)⁻¹


theorem map_apply_ofFractionRing_mk [MonoidHomClass F R[X] S[X]] (φ : F)
    (hφ : R[X]⁰ ≤ S[X]⁰.comap φ) (n : R[X]) (d : R[X]⁰) :
    map φ hφ (ofFractionRing (Localization.mk n d)) =
      ofFractionRing (Localization.mk (φ n) ⟨φ d, hφ d.prop⟩)

{R : Type u_3}
{S : Type u_4}
{F : Type u_5}
[CommRing R]
[CommRing S]
[FunLike F R[X] S[X]]
[MonoidHomClass F R[X] S[X]]
(φ : F)
(hφ : R[X]⁰ ≤ Submonoid.comap φ S[X]⁰)
(n : R[X])
(d : ↥R[X]⁰)

(RatFunc.map φ hφ) { toFractionRing := Localization.mk n d } = { toFractionRing := Localization.mk (φ n) ⟨φ ↑d, ⋯⟩ }


/-- Forward direction of Vitali's convergence theorem: if `f` is a sequence of uniformly integrable
functions that converge in measure to some function `g` in a finite measure space, then `f`
converge in Lp to `g`. -/
theorem tendsto_Lp_finite_of_tendstoInMeasure [IsFiniteMeasure μ] (hp : 1 ≤ p) (hp' : p ≠ ∞)
    (hf : ∀ n, AEStronglyMeasurable (f n) μ) (hg : Memℒp g p μ) (hui : UnifIntegrable f p μ)
    (hfg : TendstoInMeasure μ f atTop g) : Tendsto (fun n ↦ eLpNorm (f n - g) p μ) atTop (𝓝 0)

{f : ℕ → α → β}

(hf : ∀ (n : ℕ), MeasureTheory.AEStronglyMeasurable (f n) μ)

(hui : MeasureTheory.UnifIntegrable f p μ)

(hfg : MeasureTheory.TendstoInMeasure μ f Filter.atTop g)

Filter.Tendsto (fun n => MeasureTheory.eLpNorm (f n - g) p μ) Filter.atTop (𝓝 0)


theorem image₂_swap (f : α → β → γ) (s : Finset α) (t : Finset β) :
    image₂ f s t = image₂ (fun a b => f b a) t s

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
[DecidableEq γ]
(f : α → β → γ)
(s : Finset α)
(t : Finset β)

Finset.image₂ f s t = Finset.image₂ (fun a b => f b a) t s


@[simp] lemma lift_inf_lift (a b : α) : lift a ⊓ lift b = lift (a ⊓ b)

{α : Type u_1}
[GeneralizedBooleanAlgebra α]
(a b : α)

Booleanisation.lift a ⊓ Booleanisation.lift b = Booleanisation.lift (a ⊓ b)


@[reassoc] lemma comp_τ₁ (φ₁₂ : S₁ ⟶ S₂) (φ₂₃ : S₂ ⟶ S₃) :
    (φ₁₂ ≫ φ₂₃).τ₁ = φ₁₂.τ₁ ≫ φ₂₃.τ₁

{S₁ S₂ S₃ : CategoryTheory.ShortComplex C}

(φ₁₂ : S₁ ⟶ S₂)

(φ₂₃ : S₂ ⟶ S₃)

(CategoryTheory.CategoryStruct.comp φ₁₂ φ₂₃).τ₁ = CategoryTheory.CategoryStruct.comp φ₁₂.τ₁ φ₂₃.τ₁


lemma heq_of_cons_eq_cons {p : Path a b} {p' : Path a c}
    {e : b ⟶ d} {e' : c ⟶ d} (h : p.cons e = p'.cons e') : HEq p p'

{V : Type u}
[Quiver V]
{a b c d : V}
{p : Quiver.Path a b}
{p' : Quiver.Path a c}
{e : b ⟶ d}
{e' : c ⟶ d}
(h : p.cons e = p'.cons e')


@[to_additive]
theorem tprod_inv : ∏' b, (f b)⁻¹ = (∏' b, f b)⁻¹

{α : Type u_1}
{β : Type u_2}
[AddCommGroup α]
[TopologicalSpace α]
[TopologicalAddGroup α]
{f : β → α}
[T2Space α]


@[to_additive]
theorem StrictMono.inv (hf : StrictMono f) : StrictAnti fun x => (f x)⁻¹

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

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


/-- Note that `QuadraticMap.Isometry.id` would not be well-typed as the RHS. -/
@[simp, nolint simpNF]  -- ignore the bogus "Left-hand side does not simplify" lint error
theorem Isometry.proj_comp_single_of_same [Fintype ι] [DecidableEq ι]
    (i : ι) (Q : QuadraticMap R (Mᵢ i) P) :
    (proj i Q).comp (single _ i) = .ofEq (Pi.single_eq_same _ _)

{ι : Type u_1}
{R : Type u_2}
{P : Type u_7}
{Mᵢ : ι → Type u_8}
[CommSemiring R]
[(i : ι) → AddCommMonoid (Mᵢ i)]
[AddCommMonoid P]
[(i : ι) → Module R (Mᵢ i)]
[Module R P]
[Fintype ι]
[DecidableEq ι]
(i : ι)
(Q : QuadraticMap R (Mᵢ i) P)

(QuadraticMap.Isometry.proj i Q).comp (QuadraticMap.Isometry.single (Pi.single i Q) i) = QuadraticMap.Isometry.ofEq ⋯


@[simp]
theorem map_id : Filter.map id f = f


theorem Gamma_conj (s : ℂ) : Gamma (conj s) = conj (Gamma s)

Complex.Gamma ((starRingEnd ℂ) s) = (starRingEnd ℂ) (Complex.Gamma s)


@[fun_prop]
protected theorem DifferentiableOn.iterate {f : E → E} (hf : DifferentiableOn 𝕜 f s)
    (hs : MapsTo f s s) (n : ℕ) : DifferentiableOn 𝕜 f^[n] s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{s : Set E}
{f : E → E}
(hf : DifferentiableOn 𝕜 f s)
(hs : Set.MapsTo f s s)
(n : ℕ)


/-- Composition of morphisms in the Grothendieck category.
-/
@[simps]
def comp {X Y Z : Grothendieck F} (f : Hom X Y) (g : Hom Y Z) : Hom X Z

{F : CategoryTheory.Functor C CategoryTheory.Cat}

(CategoryTheory.Grothendieck.comp f g).base = CategoryTheory.CategoryStruct.comp f.base g.base


/-- Assumes right covariance. -/
theorem Right.one_lt_mul_of_lt_of_lt [MulPosStrictMono α] (ha : 1 < a) (hb : 1 < b) (b0 : 0 < b) :
    1 < a * b

{α : Type u_1}
{a b : α}
[MulOneClass α]
[Zero α]
[Preorder α]
[MulPosStrictMono α]
(ha : 1 < a)
(hb : 1 < b)
(b0 : 0 < b)


theorem union_assoc {s₁ s₂ s₃ : Finmap β} : s₁ ∪ s₂ ∪ s₃ = s₁ ∪ (s₂ ∪ s₃)

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{s₁ s₂ s₃ : Finmap β}

s₁ ∪ s₂ ∪ s₃ = s₁ ∪ (s₂ ∪ s₃)


@[to_additive (attr := simp)]
theorem norm_smul_Lp (c : Mᵈᵐᵃ) (f : Lp E p μ) : ‖c • f‖ = ‖f‖

[MeasureTheory.VAddInvariantMeasure M α μ]

‖c +ᵥ f‖ = ‖f‖


theorem isUnit_iff_constantCoeff {φ : R⟦X⟧} :
    IsUnit φ ↔ IsUnit (constantCoeff R φ)

{R : Type u_1}
[Ring R]
{φ : PowerSeries R}

IsUnit φ ↔ IsUnit ((PowerSeries.constantCoeff R) φ)


@[to_additive]
theorem mul_ciSup (hf : BddAbove (range f)) (a : G) : (a * ⨆ i, f i) = ⨆ i, a * f i

[CovariantClass G G (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1]


/-- A line through a vertex is the altitude through that vertex if and
only if it is orthogonal to the opposite face. -/
theorem affineSpan_pair_eq_altitude_iff {n : ℕ} (s : Simplex ℝ P (n + 1)) (i : Fin (n + 2))
    (p : P) :
    line[ℝ, p, s.points i] = s.altitude i ↔
      p ≠ s.points i ∧
        p ∈ affineSpan ℝ (Set.range s.points) ∧
          p -ᵥ s.points i ∈ (affineSpan ℝ (s.points '' ↑(Finset.univ.erase i))).directionᗮ

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{n : ℕ}
(s : Affine.Simplex ℝ P (n + 1))
(i : Fin (n + 2))
(p : P)

affineSpan ℝ {p, s.points i} = s.altitude i ↔
  p ≠ s.points i ∧
    p ∈ affineSpan ℝ (Set.range s.points) ∧
      p -ᵥ s.points i ∈ (affineSpan ℝ (s.points '' ↑(Finset.univ.erase i))).directionᗮ


theorem comp_le_of_antitoneOn (f : α → E) {s : Set α} {t : Set β} (φ : β → α) (hφ : AntitoneOn φ t)
    (φst : MapsTo φ t s) : eVariationOn (f ∘ φ) t ≤ eVariationOn f s

{α : Type u_1}
[LinearOrder α]
{E : Type u_2}
[PseudoEMetricSpace E]
{β : Type u_3}
[LinearOrder β]
(f : α → E)
{s : Set α}
{t : Set β}
(φ : β → α)
(hφ : AntitoneOn φ t)
(φst : Set.MapsTo φ t s)


theorem convex_segment (x y : E) : Convex 𝕜 [x -[𝕜] y]

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
(x y : E)


@[simp]
theorem fract_add_floor (a : α) : fract a + ⌊a⌋ = a

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


@[to_additive (attr := simp)]
theorem prod_append : (l₁ ++ l₂).prod = l₁.prod * l₂.prod

{M : Type u_4}
[Monoid M]
{l₁ l₂ : List M}


theorem inter_frequently_image_mem_ae_eq (hf : Conservative f μ) (hs : NullMeasurableSet s μ) :
    (s ∩ { x | ∃ᶠ n in atTop, f^[n] x ∈ s } : Set α) =ᵐ[μ] s

(hs : MeasureTheory.NullMeasurableSet s μ)

s ∩ {x | ∃ᶠ (n : ℕ) in Filter.atTop, f^[n] x ∈ s} =ᵐ[μ] s


private lemma aux_add (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a + b = 1) :
    a * (f x + m / (2 : ℝ) * ‖x‖ ^ 2) + b * (f y + m / (2 : ℝ) * ‖y‖ ^ 2) -
      m / (2 : ℝ) * ‖a • x + b • y‖ ^ 2
      = a * f x + b * f y + m / (2 : ℝ) * a * b * ‖x - y‖ ^ 2

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
{a b m : ℝ}
{x y : E}
{f : E → ℝ}
(ha : 0 ≤ a)
(hb : 0 ≤ b)
(hab : a + b = 1)


@[simp]
lemma mul_le_iff_le_one_right [PosMulMono α] [PosMulReflectLE α] (a0 : 0 < a) : a * b ≤ a ↔ b ≤ 1

{α : Type u_1}
{a b : α}
[MulOneClass α]
[Zero α]
[Preorder α]
[PosMulMono α]
[PosMulReflectLE α]
(a0 : 0 < a)


/-- The second projection of a product is a non-unital ⋆-algebra homomorphism. -/
@[simps!]
def snd : A × B →⋆ₙₐ[R] B

(R : Type u_1)
(A : Type u_2)
(B : Type u_3)
[Monoid R]
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[Star A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction R B]
[Star B]
(self : A × B)

(NonUnitalStarAlgHom.snd R A B) self = self.2


/-- The forgetful functor from bimonoid objects to comonoid objects. -/
@[simps!]
def toComon_ : Bimon_ C ⥤ Comon_ C

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.BraidedCategory C]
(A : Comon_ (Mon_ C))

((Bimon_.toComon_ C).obj A).counit = A.counit.hom


/-- Expressing locally uniform convergence using `dist`. -/
theorem tendstoLocallyUniformly_iff [TopologicalSpace β] {F : ι → β → α} {f : β → α}
    {p : Filter ι} :
    TendstoLocallyUniformly F f p ↔
      ∀ ε > 0, ∀ x : β, ∃ t ∈ 𝓝 x, ∀ᶠ n in p, ∀ y ∈ t, dist (f y) (F n y) < ε

{α : Type u}
{β : Type v}
{ι : Type u_2}
[PseudoMetricSpace α]
[TopologicalSpace β]
{F : ι → β → α}
{f : β → α}
{p : Filter ι}

TendstoLocallyUniformly F f p ↔ ∀ ε > 0, ∀ (x : β), ∃ t ∈ 𝓝 x, ∀ᶠ (n : ι) in p, ∀ y ∈ t, dist (f y) (F n y) < ε


@[simp]
theorem choose_self (n : ℕ) : choose n n = 1


theorem IsQF.induction_on_inf_not {P : L.BoundedFormula α n → Prop} {φ : L.BoundedFormula α n}
    (h : IsQF φ) (hf : P (⊥ : L.BoundedFormula α n))
    (ha : ∀ ψ : L.BoundedFormula α n, IsAtomic ψ → P ψ)
    (hinf : ∀ {φ₁ φ₂}, P φ₁ → P φ₂ → P (φ₁ ⊓ φ₂)) (hnot : ∀ {φ}, P φ → P φ.not)
    (hse :
      ∀ {φ₁ φ₂ : L.BoundedFormula α n}, Theory.SemanticallyEquivalent ∅ φ₁ φ₂ → (P φ₁ ↔ P φ₂)) :
    P φ

(ha : ∀ (ψ : L.BoundedFormula α n), ψ.IsAtomic → P ψ)

(hinf : ∀ {φ₁ φ₂ : L.BoundedFormula α n}, P φ₁ → P φ₂ → P (φ₁ ⊓ φ₂))

(hnot : ∀ {φ : L.BoundedFormula α n}, P φ → P φ.not)

(hse : ∀ {φ₁ φ₂ : L.BoundedFormula α n}, ∅.SemanticallyEquivalent φ₁ φ₂ → (P φ₁ ↔ P φ₂))


lemma one_tmul_mul_elem
    (s : S) : (1 ⊗ₜ s) * elem R S = (s ⊗ₜ 1) * elem R S

{R S : Type u_2}
[CommRing R]
[CommRing S]
[Algebra R S]
[Algebra.FormallyUnramified R S]
[Algebra.EssFiniteType R S]
(s : S)

1 ⊗ₜ[R] s * Algebra.FormallyUnramified.elem R S = s ⊗ₜ[R] 1 * Algebra.FormallyUnramified.elem R S


/-- `vectorSpan` is monotone. -/
theorem vectorSpan_mono {s₁ s₂ : Set P} (h : s₁ ⊆ s₂) : vectorSpan k s₁ ≤ vectorSpan k s₂

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s₁ s₂ : Set P}
(h : s₁ ⊆ s₂)


lemma piecewise_mem_Icc_of_mem_of_mem (hf : f ∈ Set.Icc f' g') (hg : g ∈ Set.Icc f' g') :
    s.piecewise f g ∈ Set.Icc f' g'

{ι : Type u_1}
(s : Finset ι)
[(j : ι) → Decidable (j ∈ s)]
{π : ι → Type u_3}
{f g f' g' : (i : ι) → π i}
[(i : ι) → Preorder (π i)]
(hf : f ∈ Set.Icc f' g')
(hg : g ∈ Set.Icc f' g')


@[simp]
lemma ofReal_lt_natCast {p : ℝ} {n : ℕ} (hn : n ≠ 0) : ENNReal.ofReal p < n ↔ p < n


/-- An induction principle for closure membership. If `p` holds for `1`, and all elements
of `s`, and is preserved under addition, negation, and multiplication, then `p` holds for all
elements of the closure of `s`. -/
@[elab_as_elim]
theorem closure_induction {s : Set K} {p : K → Prop} {x} (h : x ∈ closure s) (mem : ∀ x ∈ s, p x)
    (one : p 1) (add : ∀ x y, p x → p y → p (x + y)) (neg : ∀ x, p x → p (-x))
    (inv : ∀ x, p x → p x⁻¹) (mul : ∀ x y, p x → p y → p (x * y)) : p x

(add : ∀ (x y : K), p x → p y → p (x + y))

(mul : ∀ (x y : K), p x → p y → p (x * y))


/-- `fderivWithin 𝕜 f s` is smooth at `x₀` within `s`. -/
theorem ContDiffWithinAt.fderivWithin_right (hf : ContDiffWithinAt 𝕜 n f s x₀)
    (hs : UniqueDiffOn 𝕜 s) (hmn : (m + 1 : ℕ∞) ≤ n) (hx₀s : x₀ ∈ s) :
    ContDiffWithinAt 𝕜 m (fderivWithin 𝕜 f s) s x₀

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{x₀ : E}
{m n : ℕ∞}
(hf : ContDiffWithinAt 𝕜 n f s x₀)
(hs : UniqueDiffOn 𝕜 s)
(hmn : m + 1 ≤ n)
(hx₀s : x₀ ∈ s)


@[simp] lemma norm_toDual (x : E) : ‖toDual x‖ = ‖x‖


/-- Integrals commute with addition inside another integral. `F` can be any function. -/
theorem integral_fn_integral_add ⦃f g : α × β → E⦄ (F : E → E') (hf : Integrable f (μ.prod ν))
    (hg : Integrable g (μ.prod ν)) :
    (∫ x, F (∫ y, f (x, y) + g (x, y) ∂ν) ∂μ) =
      ∫ x, F ((∫ y, f (x, y) ∂ν) + ∫ y, g (x, y) ∂ν) ∂μ

⦃f g : α × β → E⦄

(hf : MeasureTheory.Integrable f (μ.prod ν))

(hg : MeasureTheory.Integrable g (μ.prod ν))

∫ (x : α), F (∫ (y : β), f (x, y) + g (x, y) ∂ν) ∂μ = ∫ (x : α), F (∫ (y : β), f (x, y) ∂ν + ∫ (y : β), g (x, y) ∂ν) ∂μ


@[to_additive addIndex_empty]
theorem index_empty {V : Set G} : index ∅ V = 0

MeasureTheory.Measure.haar.index ∅ V = 0


@[simp, rclike_simps]
theorem inv_im (z : K) : im z⁻¹ = -im z / normSq z

RCLike.im z⁻¹ = -RCLike.im z / RCLike.normSq z


theorem one_le_rpow {x z : ℝ} (hx : 1 ≤ x) (hz : 0 ≤ z) : 1 ≤ x ^ z


lemma hasRightHomology_of_epi_of_isIso_of_mono (φ : S₁ ⟶ S₂) [HasRightHomology S₁]
    [Epi φ.τ₁] [IsIso φ.τ₂] [Mono φ.τ₃] : HasRightHomology S₂


protected theorem Commute.div_add_div (hbc : Commute b c) (hbd : Commute b d) (hb : b ≠ 0)
    (hd : d ≠ 0) : a / b + c / d = (a * d + b * c) / (b * d)

{α : Type u_1}
[DivisionSemiring α]
{a b c d : α}
(hbc : Commute b c)
(hbd : Commute b d)
(hb : b ≠ 0)
(hd : d ≠ 0)


theorem constVAdd_zsmul (z : ℤ) (v : V₁) : constVAdd k P₁ (z • v) = constVAdd k P₁ v ^ z

(k : Type u_1)
(P₁ : Type u_2)
{V₁ : Type u_6}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
(z : ℤ)
(v : V₁)

AffineEquiv.constVAdd k P₁ (z • v) = AffineEquiv.constVAdd k P₁ v ^ z


/-- The equivalence of functor categories induced by `leftOp` and `rightOp`.
-/
@[simps!]
def leftOpRightOpEquiv : (Cᵒᵖ ⥤ D)ᵒᵖ ≌ C ⥤ Dᵒᵖ

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
(D : Type u₂)
[CategoryTheory.Category.{v₂, u₂} D]
(F : (CategoryTheory.Functor Cᵒᵖ D)ᵒᵖ)
(X : C)

((CategoryTheory.Functor.leftOpRightOpEquiv C D).functor.obj F).obj X =
  Opposite.op ((Opposite.unop F).obj (Opposite.op X))


@[simp]
protected theorem neg_def (r : X) (s : S) : -(r /ₒ s) = -r /ₒ s

{R : Type u_1}
[Monoid R]
{S : Submonoid R}
[OreLocalization.OreSet S]
{X : Type u_2}
[AddGroup X]
[DistribMulAction R X]
(r : X)
(s : ↥S)


theorem isTopologicalBasis_cylinders :
    IsTopologicalBasis { s : Set (∀ n, E n) | ∃ (x : ∀ n, E n) (n : ℕ), s = cylinder x n }

(E : ℕ → Type u_1)
[(n : ℕ) → TopologicalSpace (E n)]
[∀ (n : ℕ), DiscreteTopology (E n)]

TopologicalSpace.IsTopologicalBasis {s | ∃ x n, s = PiNat.cylinder x n}


theorem StructureGroupoid.trans (G : StructureGroupoid H) {e e' : PartialHomeomorph H H}
    (he : e ∈ G) (he' : e' ∈ G) : e ≫ₕ e' ∈ G

{H : Type u}
[TopologicalSpace H]
(G : StructureGroupoid H)
{e e' : PartialHomeomorph H H}
(he : e ∈ G)
(he' : e' ∈ G)


theorem scalar_eq_self_of_mem_center
    {A : SpecialLinearGroup n R} (hA : A ∈ center (SpecialLinearGroup n R)) (i : n) :
    scalar n (A i i) = A

(hA : A ∈ Subgroup.center (Matrix.SpecialLinearGroup n R))


@[simp]
theorem coe_inclusion {I₁ I₂ : LieIdeal R L} (h : I₁ ≤ I₂) (x : I₁) : (inclusion h x : L) = x

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{I₁ I₂ : LieIdeal R L}
(h : I₁ ≤ I₂)
(x : ↥I₁)


theorem coeff_root (h : IsAdjoinRootMonic S f) (hdeg : 1 < natDegree f) :
    h.coeff h.root = Pi.single 1 1

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
(h : IsAdjoinRootMonic S f)
(hdeg : 1 < f.natDegree)


theorem cmpEq_iff [TransCmp cmp] : cmpEq cmp x y ↔ cmp x y = .eq

∀ {α : Sort u_1} {cmp : α → α → Ordering} {x y : α} [inst : Batteries.TransCmp cmp],
  Batteries.RBNode.cmpEq cmp x y ↔ cmp x y = Ordering.eq


/-- `Invertible a` gives a two-sided multiplicative inverse of `a`. -/
class Invertible [Mul α] [One α] (a : α) : Type u where
  /-- The inverse of an `Invertible` element -/
  invOf : α
  /-- `invOf a` is a left inverse of `a` -/
  invOf_mul_self : invOf * a = 1
  /-- `invOf a` is a right inverse of `a` -/
  mul_invOf_self : a * invOf = 1

{α : Type u}
[Mul α]
[One α]
{a : α}
[self : Invertible a]


@[simp]
theorem homOfPair.val (t : X) (g : G) : (homOfPair t g).val = g

{X : Type u}
{G : Type u_2}
[Group G]
[MulAction G X]
(t : X)
(g : G)

↑(CategoryTheory.ActionCategory.homOfPair t g) = g


theorem Icc_bot_top [PartialOrder α] [BoundedOrder α] : Icc (⊥ : α) ⊤ = univ

{α : Type u_1}
[PartialOrder α]
[BoundedOrder α]


theorem isPreconnected_connectedComponent {x : α} : IsPreconnected (connectedComponent x)

{α : Type u}
[TopologicalSpace α]
{x : α}


@[simps neg]
instance instNeg [Preadditive C] {P Q : Karoubi C} : Neg (P ⟶ Q)

{P Q : CategoryTheory.Idempotents.Karoubi C}


@[to_additive]
theorem eq_bot_of_card_eq (h : card S = 1) : S = ⊥

{M : Type u_1}
[Monoid M]
{S : Submonoid M}
[Fintype ↥S]
(h : Fintype.card ↥S = 1)


@[simp]
theorem fract_int : (Int.fract : ℤ → ℤ) = 0


theorem fundamentalSequence_has_prop (o) : FundamentalSequenceProp o (fundamentalSequence o)


@[simp] theorem foldrM_append [Monad m] [LawfulMonad m] (f : α → β → m β) (b) (l l' : List α) :
    (l ++ l').foldrM f b = l'.foldrM f b >>= l.foldrM f

{m : Type u_1 → Type u_2}
{α : Type u_3}
{β : Type u_1}
[Monad m]
[LawfulMonad m]
(f : α → β → m β)
(b : β)
(l l' : List α)

List.foldrM f b (l ++ l') = do
  let init ← List.foldrM f b l'
  List.foldrM f init l


theorem monic_of_a_eq_one (ha : P.a = 1) : P.toPoly.Monic

{R : Type u_1}
{P : Cubic R}
[Semiring R]
(ha : P.a = 1)


lemma Even.pow_nonneg (hn : Even n) (a : R) : 0 ≤ a ^ n

{R : Type u_3}
[LinearOrderedSemiring R]
{n : ℕ}
[ExistsAddOfLE R]
(hn : Even n)
(a : R)


@[simp]
theorem sub_int_iff : LiouvilleWith p (x - m) ↔ LiouvilleWith p x

LiouvilleWith p (x - ↑m) ↔ LiouvilleWith p x


/-- The extensive topology on a finitary pre-extensive category is subcanonical. -/
theorem extensiveTopology.subcanonical : Sheaf.Subcanonical (extensiveTopology C)

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.FinitaryPreExtensive C]


theorem IsMin.mono (ha : IsMin a) (h : b ≤ a) : IsMin b

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


@[simp]
theorem verschiebung_coeff_succ (x : 𝕎 R) (n : ℕ) : (verschiebung x).coeff n.succ = x.coeff n

{p : ℕ}
{R : Type u_1}
[hp : Fact (Nat.Prime p)]
[CommRing R]
(x : WittVector p R)
(n : ℕ)

(WittVector.verschiebung x).coeff n.succ = x.coeff n


@[to_additive (attr := simp)]
theorem prod_mk : prod (mk L) = List.prod (L.map fun x => cond x.2 x.1 x.1⁻¹)

{α : Type u}
{L : List (α × Bool)}
[AddGroup α]

FreeAddGroup.sum (FreeAddGroup.mk L) = (List.map (fun x => bif x.2 then x.1 else -x.1) L).sum


/-- If `f` has a derivative at `x`, then `fderiv 𝕜 f x` is such a derivative. Otherwise, it is
set to `0`. -/
irreducible_def fderiv (f : E → F) (x : E) : E →L[𝕜] F

(𝕜 : Type u_6)
[NontriviallyNormedField 𝕜]
{E : Type u_7}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_8}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(f : E → F)
(x : E)

fderiv 𝕜 f x = if h : ∃ f', HasFDerivAt f f' x then Classical.choose h else 0


theorem le_toNNRat_iff_coe_le {q : ℚ≥0} (hp : 0 ≤ p) : q ≤ toNNRat p ↔ ↑q ≤ p


@[to_additive (attr := simp)]
theorem map_mk (M : Subgroup H) [M.Normal] (f : G →* H) (h : N ≤ M.comap f) (x : G) :
    map N M f h ↑x = ↑(f x)

{G : Type u}
[Group G]
(N : Subgroup G)
[nN : N.Normal]
{H : Type v}
[Group H]
(M : Subgroup H)
[M.Normal]
(f : G →* H)
(h : N ≤ Subgroup.comap f M)
(x : G)


@[to_additive (attr := simp)]
theorem pow_smul_mod_minimalPeriod (n : ℕ) :
    a ^ (n % minimalPeriod (a • ·) b) • b = a ^ n • b

{α : Type v}
{G : Type u}
[Group G]
[MulAction G α]
(a : G)
(b : α)
(n : ℕ)

a ^ (n % Function.minimalPeriod (fun x => a • x) b) • b = a ^ n • b


theorem StrictRestriction.irrefl (M : Matroid α) : ¬ (M <r M)


@[to_additive]
theorem exists_list_of_mem_closure {s : Set M} {x : M} (hx : x ∈ closure s) :
    ∃ l : List M, (∀ y ∈ l, y ∈ s) ∧ l.prod = x

{M : Type u_1}
[Monoid M]
{s : Set M}
{x : M}
(hx : x ∈ Submonoid.closure s)


theorem isCrystallographic_rootSystem : (rootSystem H).IsCrystallographic

{K : Type u_1}
{L : Type u_2}
[Field K]
[CharZero K]
[LieRing L]
[LieAlgebra K L]
[LieAlgebra.IsKilling K L]
[FiniteDimensional K L]
(H : LieSubalgebra K L)
[H.IsCartanSubalgebra]
[LieModule.IsTriangularizable K (↥H) L]


theorem span_singleton_mem_isPrincipalSubmonoid (a : R) :
    span {a} ∈ isPrincipalSubmonoid R

Ideal.span {a} ∈ Ideal.isPrincipalSubmonoid R


theorem contDiffAt_arccos {x : ℝ} (h₁ : x ≠ -1) (h₂ : x ≠ 1) {n : ℕ∞} : ContDiffAt ℝ n arccos x


theorem derivative_X_add_C_pow (c : R) (m : ℕ) :
    derivative ((X + C c) ^ m) = C (m : R) * (X + C c) ^ (m - 1)

{R : Type u}
[CommSemiring R]
(c : R)
(m : ℕ)

Polynomial.derivative ((Polynomial.X + Polynomial.C c) ^ m) =
  Polynomial.C ↑m * (Polynomial.X + Polynomial.C c) ^ (m - 1)


@[simp]
theorem whiskering_linearYoneda :
    linearYoneda R C ⋙ (whiskeringRight _ _ _).obj (forget (ModuleCat.{v} R)) = yoneda

(R : Type w)
[Ring R]
(C : Type u)
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.Linear R C]

(CategoryTheory.linearYoneda R C).comp
    ((CategoryTheory.whiskeringRight Cᵒᵖ (ModuleCat R) (Type v)).obj (CategoryTheory.forget (ModuleCat R))) =
  CategoryTheory.yoneda


/-- If a left-invariant measure gives finite mass to a nonempty open set, then it gives finite mass
to any compact set. -/
@[to_additive
"If a left-invariant measure gives finite mass to a nonempty open set, then it gives finite mass to
any compact set."]
theorem measure_lt_top_of_isCompact_of_isMulLeftInvariant (U : Set G) (hU : IsOpen U)
    (h'U : U.Nonempty) (h : μ U ≠ ∞) {K : Set G} (hK : IsCompact K) : μ K < ∞

{G : Type u_2}
[MeasurableSpace G]
[TopologicalSpace G]
[BorelSpace G]
{μ : MeasureTheory.Measure G}
[AddGroup G]
[TopologicalAddGroup G]
[μ.IsAddLeftInvariant]
(U : Set G)
(hU : IsOpen U)
(h'U : U.Nonempty)
(h : μ U ≠ ⊤)
{K : Set G}
(hK : IsCompact K)


theorem tan_sub_nat_mul_pi (x : ℂ) (n : ℕ) : tan (x - n * π) = tan x

Complex.tan (x - ↑n * ↑Real.pi) = Complex.tan x


/-- The quotient map `𝕜 → AddCircle p` as a partial homeomorphism. -/
@[simps] def partialHomeomorphCoe [DiscreteTopology (zmultiples p)] :
    PartialHomeomorph 𝕜 (AddCircle p)

(AddCircle.partialHomeomorphCoe p a).source = Set.Ioo a (a + p)


/-- Constructs an equivalence between nonempty finite linear orders from an order isomorphism
between them. -/
@[simps]
def Iso.mk {α β : NonemptyFinLinOrd.{u}} (e : α ≃o β) : α ≅ β

{α β : NonemptyFinLinOrd}
(e : ↑α ≃o ↑β)


/-- The projections of `Functor.pi' F` are isomorphic to the functors of the family `F` -/
@[simps!]
def pi'CompEval {A : Type*} [Category A] (F : ∀ i, A ⥤ C i) (i : I) :
    pi' F ⋙ Pi.eval C i ≅ F i

[(i : I) → CategoryTheory.Category.{v₁, u₁} (C i)]

(F : (i : I) → CategoryTheory.Functor A (C i))

(CategoryTheory.Functor.pi'CompEval F i).hom.app X = CategoryTheory.CategoryStruct.id ((F i).obj X)


@[to_additive]
theorem left_dom_of_div_dom [Div α] {a b : Part α} (hab : Dom (a / b)) : a.Dom

{α : Type u_1}
[Sub α]
{a b : Part α}
(hab : (a - b).Dom)


@[simp]
theorem disjoint_principal_right {f : Filter α} {s : Set α} : Disjoint f (𝓟 s) ↔ sᶜ ∈ f

{α : Type u_1}
{f : Filter α}
{s : Set α}


/-- If a continuous map with dense range maps a dense set to a subset of `t`, then `t` is a dense
set. -/
theorem DenseRange.dense_of_mapsTo {f : X → Y} (hf' : DenseRange f) (hf : Continuous f)
    (hs : Dense s) {t : Set Y} (ht : MapsTo f s t) : Dense t

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{s : Set X}
{f : X → Y}
(hf' : DenseRange f)
(hf : Continuous f)
(hs : Dense s)
{t : Set Y}
(ht : Set.MapsTo f s t)


theorem midpoint_eq_smul_add (x y : V) : midpoint R x y = (⅟ 2 : R) • (x + y)

(R : Type u_1)
{V : Type u_2}
[Ring R]
[Invertible 2]
[AddCommGroup V]
[Module R V]
(x y : V)


theorem inj (f : r ↪r s) {a b} : f a = f b ↔ a = b

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
(f : r ↪r s)
{a b : α}


@[to_additive]
lemma coe_inv_val_mul_coe_val (S : Submonoid M) {x : Sˣ} :
    ((x⁻¹ : Sˣ) : M) * ((x : Sˣ) : M) = 1

{M : Type u_1}
[Monoid M]
(S : Submonoid M)
{x : (↥S)ˣ}

↑↑x⁻¹ * ↑↑x = 1


theorem IsWF.min_of_subset_not_lt_min {hs : s.IsWF} {hsn : s.Nonempty} {ht : t.IsWF}
    {htn : t.Nonempty} (hst : s ⊆ t) : ¬hs.min hsn < ht.min htn

{α : Type u_2}
[Preorder α]
{s t : Set α}
{hs : s.IsWF}
{hsn : s.Nonempty}
{ht : t.IsWF}
{htn : t.Nonempty}
(hst : s ⊆ t)


theorem HasMFDerivAt.hasMFDerivWithinAt (h : HasMFDerivAt I I' f x f') :
    HasMFDerivWithinAt I I' f s x f'

{f' : TangentSpace I x →L[𝕜] TangentSpace I' (f x)}


@[simp]
lemma preΨ_three : W.preΨ 3 = W.Ψ₃

{R : Type r}
[CommRing R]
(W : WeierstrassCurve R)


theorem Wbtw.trans_right {w x y z : P} (h₁ : Wbtw R w x z) (h₂ : Wbtw R x y z) : Wbtw R w y z

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[OrderedRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{w x y z : P}
(h₁ : Wbtw R w x z)
(h₂ : Wbtw R x y z)


protected lemma le_total : a ≤ b ∨ b ≤ a


@[continuity, fun_prop]
theorem continuous_cosh : Continuous cosh


@[to_additive]
theorem iUnion_smul_left_image : ⋃ a ∈ s, a • t = s • t

{α : Type u_2}
{β : Type u_3}
[VAdd α β]
{s : Set α}
{t : Set β}


@[to_additive (attr := simp) coe_comp_nnnorm]
theorem coe_comp_nnnorm' : (toReal : ℝ≥0 → ℝ) ∘ (nnnorm : E → ℝ≥0) = norm


theorem const_le {x y : α} : const x ≤ const y ↔ x ≤ y

{α : Type u_1}
[LinearOrderedField α]
{x y : α}

CauSeq.const abs x ≤ CauSeq.const abs y ↔ x ≤ y


@[simp]
theorem id_comp (F : L →ᴸ L') : LHom.id L' ∘ᴸ F = F

{L : FirstOrder.Language}
{L' : FirstOrder.Language}
(F : L →ᴸ L')

(FirstOrder.Language.LHom.id L').comp F = F


theorem t1Space_of_injective_of_continuous [TopologicalSpace Y] {f : X → Y}
    (hf : Function.Injective f) (hf' : Continuous f) [T1Space Y] : T1Space X

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
(hf : Function.Injective f)
(hf' : Continuous f)
[T1Space Y]


theorem self_le_zpow_clog {b : ℕ} (hb : 1 < b) (r : R) : r ≤ (b : R) ^ clog b r

{R : Type u_1}
[LinearOrderedSemifield R]
[FloorSemiring R]
{b : ℕ}
(hb : 1 < b)
(r : R)


@[simp]
theorem decompose_symm_neg (x : ⨁ i, ℳ i) : (decompose ℳ).symm (-x) = -(decompose ℳ).symm x

{ι : Type u_1}
{M : Type u_3}
{σ : Type u_4}
[DecidableEq ι]
[AddCommGroup M]
[SetLike σ M]
[AddSubgroupClass σ M]
(ℳ : ι → σ)
[DirectSum.Decomposition ℳ]
(x : ⨁ (i : ι), ↥(ℳ i))

(DirectSum.decompose ℳ).symm (-x) = -(DirectSum.decompose ℳ).symm x


/-- If `(p : ι → Prop, s : ι → Set α)` is a basis of a filter `f`, `g` is a monotone function
`Set α → Filter γ`, and for each `i`, `(pg : β i → Prop, sg : β i → Set α)` is a basis
of the filter `g (s i)`, then
`(fun (i : ι) (x : β i) ↦ p i ∧ pg i x, fun (i : ι) (x : β i) ↦ sg i x)`
is a basis of the filter `f.lift g`.

This basis is parametrized by `i : ι` and `x : β i`, so in order to formulate this fact using
`has_basis` one has to use `Σ i, β i` as the index type. See also `Filter.HasBasis.mem_lift_iff`
for the corresponding `mem_iff` statement formulated without using a sigma type. -/
theorem HasBasis.lift {ι} {p : ι → Prop} {s : ι → Set α} {f : Filter α} (hf : f.HasBasis p s)
    {β : ι → Type*} {pg : ∀ i, β i → Prop} {sg : ∀ i, β i → Set γ} {g : Set α → Filter γ}
    (hg : ∀ i, (g (s i)).HasBasis (pg i) (sg i)) (gm : Monotone g) :
    (f.lift g).HasBasis (fun i : Σi, β i => p i.1 ∧ pg i.1 i.2) fun i : Σi, β i => sg i.1 i.2

(hg : ∀ (i : ι), (g (s i)).HasBasis (pg i) (sg i))

(f.lift g).HasBasis (fun i => p i.fst ∧ pg i.fst i.snd) fun i => sg i.fst i.snd


@[to_additive]
theorem _root_.Multiset.periodic_prod [Add α] [CommMonoid β] (s : Multiset (α → β))
    (hs : ∀ f ∈ s, Periodic f c) : Periodic s.prod c

{α : Type u_1}
{β : Type u_2}
{c : α}
[Add α]
[AddCommMonoid β]
(s : Multiset (α → β))
(hs : ∀ f ∈ s, Function.Periodic f c)


@[to_additive (attr := ext)]
theorem CancelCommMonoid.ext {M : Type*} ⦃m₁ m₂ : CancelCommMonoid M⦄
    (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M)) :
    m₁ = m₂

{M : Type u_1}
⦃m₁ m₂ : AddCancelCommMonoid M⦄
(h_mul : HAdd.hAdd = HAdd.hAdd)


protected theorem min_def (n m : Int) : min n m = if n ≤ m then n else m


@[simp]
theorem not_mem_bot : a ∉ (⊥ : LowerSet α)


@[simp]
theorem inclusion_obj (x : X) (U) (p) : (inclusion x).obj ⟨U, p⟩ = U

{X : TopCat}
(x : ↑X)
(U : TopologicalSpace.Opens ↑X)
(p : x ∈ U)

(TopologicalSpace.OpenNhds.inclusion x).obj { obj := U, property := p } = U


theorem sub_div (a b c : ℝ≥0) : (a - b) / c = a / c - b / c


theorem eq_iff (hf : Injective2 f) {a₁ a₂ b₁ b₂} : f a₁ b₁ = f a₂ b₂ ↔ a₁ = a₂ ∧ b₁ = b₂

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
{f : α → β → γ}
(hf : Function.Injective2 f)
{a₁ a₂ : α}
{b₁ b₂ : β}


@[simp]
theorem bliminf_sup_le_inf_aux_left :
    (blimsup u f fun x => p x ∧ q x) ≤ blimsup u f p

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
{f : Filter β}
{p q : β → Prop}
{u : β → α}

(Filter.blimsup u f fun x => p x ∧ q x) ≤ Filter.blimsup u f p


theorem nhdsWithin_le_comap {x : α} {s : Set α} {f : α → β} (ctsf : ContinuousWithinAt f s x) :
    𝓝[s] x ≤ comap f (𝓝[f '' s] f x)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{x : α}
{s : Set α}
{f : α → β}
(ctsf : ContinuousWithinAt f s x)


theorem minimum_concat (a : α) (l : List α) : minimum (l ++ [a]) = min (minimum l) a

{α : Type u_1}
[LinearOrder α]
(a : α)
(l : List α)


theorem single_trans_single_of_ne {b₁ b₂ : β} (h : b₁ ≠ b₂) (a : α) (c : γ) :
    (single a b₁).trans (single b₂ c) = ⊥

{α : Type u}
{β : Type v}
{γ : Type w}
[DecidableEq α]
[DecidableEq β]
[DecidableEq γ]
{b₁ b₂ : β}
(h : b₁ ≠ b₂)
(a : α)
(c : γ)

(PEquiv.single a b₁).trans (PEquiv.single b₂ c) = ⊥


/-- **Urysohn's lemma**: if `s` and `t` are two disjoint closed sets in a normal topological
space `X`, then there exists a continuous function `f : X → ℝ` such that

* `f` equals zero on `s`;
* `f` equals one on `t`;
* `0 ≤ f x ≤ 1` for all `x`.
-/
theorem exists_bounded_zero_one_of_closed {X : Type*} [TopologicalSpace X] [NormalSpace X]
    {s t : Set X} (hs : IsClosed s) (ht : IsClosed t) (hd : Disjoint s t) :
    ∃ f : X →ᵇ ℝ, EqOn f 0 s ∧ EqOn f 1 t ∧ ∀ x, f x ∈ Icc (0 : ℝ) 1

{X : Type u_1}
[TopologicalSpace X]
[NormalSpace X]
{s t : Set X}
(hs : IsClosed s)
(ht : IsClosed t)
(hd : Disjoint s t)

∃ f, Set.EqOn (⇑f) 0 s ∧ Set.EqOn (⇑f) 1 t ∧ ∀ (x : X), f x ∈ Set.Icc 0 1


/-- Whiskering by an equivalence gives an equivalence between categories of cones.
-/
@[simps]
def whiskeringEquivalence (e : K ≌ J) : Cocone F ≌ Cocone (e.functor ⋙ F)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{K : Type u₂}
[CategoryTheory.Category.{v₂, u₂} K]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
(e : K ≌ J)

(CategoryTheory.Limits.Cocones.whiskeringEquivalence e).inverse =
  CategoryTheory.Limits.Cocones.whiskering e.inverse ⋙
    CategoryTheory.Limits.Cocones.precompose
      (F.leftUnitor.inv ≫ CategoryTheory.whiskerRight e.counitIso.inv F ≫ (e.inverse.associator e.functor F).inv)


theorem RestrictScalars.addEquiv_symm_map_smul_smul (r : R) (s : S) (x : M) :
    (RestrictScalars.addEquiv R S M).symm ((r • s) • x) =
      r • (RestrictScalars.addEquiv R S M).symm (s • x)

(R : Type u_1)
(S : Type u_2)
(M : Type u_3)
[AddCommMonoid M]
[CommSemiring R]
[Semiring S]
[Algebra R S]
[Module S M]
(r : R)
(s : S)
(x : M)


theorem destutter'_is_chain' (a) : (l.destutter' R a).Chain' R

{α : Type u_1}
(l : List α)
(R : α → α → Prop)
[DecidableRel R]
(a : α)


@[mono]
theorem pi_mono (h : ∀ i, f₁ i ≤ f₂ i) : pi f₁ ≤ pi f₂

{ι : Type u_1}
{α : ι → Type u_2}
{f₁ f₂ : (i : ι) → Filter (α i)}
(h : ∀ (i : ι), f₁ i ≤ f₂ i)


@[simp] lemma mem_Iic : x ∈ Iic b ↔ x ≤ b

{α : Type u_1}
[Preorder α]
[LocallyFiniteOrderBot α]
{b x : α}


/-- **Almost everywhere martingale convergence theorem**: An L¹-bounded submartingale converges
almost everywhere to a `⨆ n, ℱ n`-measurable function. -/
theorem Submartingale.ae_tendsto_limitProcess [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ)
    (hbdd : ∀ n, eLpNorm (f n) 1 μ ≤ R) :
    ∀ᵐ ω ∂μ, Tendsto (fun n => f n ω) atTop (𝓝 (ℱ.limitProcess f μ ω))

{f : ℕ → Ω → ℝ}

(hf : MeasureTheory.Submartingale f ℱ μ)

(hbdd : ∀ (n : ℕ), MeasureTheory.eLpNorm (f n) 1 μ ≤ ↑R)

∀ᵐ (ω : Ω) ∂μ, Filter.Tendsto (fun n => f n ω) Filter.atTop (𝓝 (MeasureTheory.Filtration.limitProcess f ℱ μ ω))


/-- A *⋆-algebra* equivalence is an equivalence preserving addition, multiplication, scalar
multiplication and the star operation, which allows for considering both unital and non-unital
equivalences with a single structure. Currently, `AlgEquiv` requires unital algebras, which is
why this structure does not extend it. -/
structure StarAlgEquiv (R A B : Type*) [Add A] [Add B] [Mul A] [Mul B] [SMul R A] [SMul R B]
  [Star A] [Star B] extends A ≃+* B where
  /-- By definition, a ⋆-algebra equivalence preserves the `star` operation. -/
  map_star' : ∀ a : A, toFun (star a) = star (toFun a)
  /-- By definition, a ⋆-algebra equivalence commutes with the action of scalars. -/
  map_smul' : ∀ (r : R) (a : A), toFun (r • a) = r • toFun a

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[Add A]
[Add B]
[Mul A]
[Mul B]
[SMul R A]
[SMul R B]
[Star A]
[Star B]
(self : A ≃⋆ₐ[R] B)
(a : A)

self.toFun (star a) = star (self.toFun a)


theorem mem_Iio_self_add : x ≠ ∞ → ε ≠ 0 → x ∈ Iio (x + ε)


@[to_additive (attr := simp)] lemma mulEnergy_pos_iff : 0 < Eₘ[s, t] ↔ s.Nonempty ∧ t.Nonempty

{α : Type u_1}
[DecidableEq α]
[Add α]
{s t : Finset α}

0 < s.addEnergy t ↔ s.Nonempty ∧ t.Nonempty


protected theorem pow_two (a : Nat) : a ^ 2 = a * a


theorem AnalyticOn.mono {s t : Set E} (hf : AnalyticOn 𝕜 f t) (hst : s ⊆ t) : AnalyticOn 𝕜 f s

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{s t : Set E}
(hf : AnalyticOn 𝕜 f t)
(hst : s ⊆ t)


/-- A faithful linear monoidal functor to a linear monoidal category
ensures that the domain is linear monoidal. -/
theorem monoidalLinearOfFaithful {D : Type*} [Category D] [Preadditive D] [Linear R D]
    [MonoidalCategory D] [MonoidalPreadditive D] (F : MonoidalFunctor D C) [F.Faithful]
    [F.toFunctor.Additive] [F.toFunctor.Linear R] : MonoidalLinear R D

(F : CategoryTheory.MonoidalFunctor D C)


/-- The forward direction of the equivalence between the decomposed category and the original. -/
@[simps!]
def decomposedTo (J : Type u₁) [Category.{v₁} J] : Decomposed J ⥤ J

(X : (i : CategoryTheory.ConnectedComponents J) × CategoryTheory.Component i)

(CategoryTheory.decomposedTo J).obj X = X.snd.obj


lemma Monotone.mapsTo_Iic (h : Monotone f) : MapsTo f (Iic b) (Iic (f b))

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[Preorder α]
[Preorder β]
{b : α}
(h : Monotone f)

Set.MapsTo f (Set.Iic b) (Set.Iic (f b))


@[simp]
theorem ediam_Icc (a b : ℝ) : EMetric.diam (Icc a b) = ENNReal.ofReal (b - a)

EMetric.diam (Set.Icc a b) = ENNReal.ofReal (b - a)


@[to_additive]
lemma prod_Ioc_mul_eq_prod_Icc (h : a ≤ b) : (∏ x ∈ Ioc a b, f x) * f a = ∏ x ∈ Icc a b, f x

{α : Type u_1}
{M : Type u_2}
[PartialOrder α]
[AddCommMonoid M]
{f : α → M}
{a b : α}
[LocallyFiniteOrder α]
(h : a ≤ b)

∑ x ∈ Finset.Ioc a b, f x + f a = ∑ x ∈ Finset.Icc a b, f x


@[simp]
theorem prev_getLast_cons (h : x ∈ x :: l) :
    prev (x :: l) x h = getLast (x :: l) (cons_ne_nil _ _)

{α : Type u_1}
[DecidableEq α]
(l : List α)
(x : α)
(h : x ∈ x :: l)


theorem ContDiff.div [CompleteSpace 𝕜] {f g : E → 𝕜} {n} (hf : ContDiff 𝕜 n f) (hg : ContDiff 𝕜 n g)
    (h0 : ∀ x, g x ≠ 0) : ContDiff 𝕜 n fun x => f x / g x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace 𝕜]
{f g : E → 𝕜}
{n : ℕ∞}
(hf : ContDiff 𝕜 n f)
(hg : ContDiff 𝕜 n g)
(h0 : ∀ (x : E), g x ≠ 0)


@[mono]
theorem lintegral_mono' {m : MeasurableSpace α} ⦃μ ν : Measure α⦄ (hμν : μ ≤ ν) ⦃f g : α → ℝ≥0∞⦄
    (hfg : f ≤ g) : ∫⁻ a, f a ∂μ ≤ ∫⁻ a, g a ∂ν

{α : Type u_1}
{m : MeasurableSpace α}
⦃μ ν : MeasureTheory.Measure α⦄
(hμν : μ ≤ ν)
⦃f g : α → ℝ≥0∞⦄
(hfg : f ≤ g)


@[simp]
theorem toConstProdContinuousLinearMap_snd (f : V →ᴬ[𝕜] W) :
    (toConstProdContinuousLinearMap 𝕜 V W f).snd = f.contLinear

(𝕜 : Type u_1)
(V : Type u_3)
(W : Type u_4)
[NormedAddCommGroup V]
[NormedAddCommGroup W]
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 V]
[NormedSpace 𝕜 W]
(f : V →ᴬ[𝕜] W)

((ContinuousAffineMap.toConstProdContinuousLinearMap 𝕜 V W) f).2 = f.contLinear


lemma setLIntegral_condKernel_univ_left (hf : Measurable f) (a : α) {t : Set Ω}
    (ht : MeasurableSet t) :
    ∫⁻ b, ∫⁻ ω in t, f (b, ω) ∂(Kernel.condKernel κ (a, b)) ∂(Kernel.fst κ a)
      = ∫⁻ x in Set.univ ×ˢ t, f x ∂(κ a)

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

{f : β × Ω → ℝ≥0∞}

∫⁻ (b : β), ∫⁻ (ω : Ω) in t, f (b, ω) ∂κ.condKernel (a, b) ∂κ.fst a = ∫⁻ (x : β × Ω) in Set.univ ×ˢ t, f x ∂κ a


theorem lt_of_succ_lt_succ {n m : Nat} : succ n < succ m → n < m


@[simp]
theorem slope_vadd_const (f : k → E) (c : PE) : (slope fun x => f x +ᵥ c) = slope f

{k : Type u_1}
{E : Type u_2}
{PE : Type u_3}
[Field k]
[AddCommGroup E]
[Module k E]
[AddTorsor E PE]
(f : k → E)
(c : PE)


@[simp]
theorem id_apply_self (M : Mat R) (i : M) : (𝟙 M : Matrix M M R) i i = 1

(R : Type u)
[Semiring R]
(M : CategoryTheory.Mat R)
(i : ↑M)


@[simp]
theorem order_neg [Zero Γ] {f : HahnSeries Γ R} : (-f).order = f.order

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[AddGroup R]
[Zero Γ]
{f : HahnSeries Γ R}


@[simp]
theorem sign_coe (x : ℝ) : sign (x : EReal) = sign x


theorem mem_tangentConeAt_of_pow_smul {r : 𝕜} (hr₀ : r ≠ 0) (hr : ‖r‖ < 1)
    (hs : ∀ᶠ n : ℕ in atTop, x + r ^ n • y ∈ s) : y ∈ tangentConeAt 𝕜 s x

(hs : ∀ᶠ (n : ℕ) in Filter.atTop, x + r ^ n • y ∈ s)


theorem Fix.rec_unique {α : Type u} (g : F α → α) (h : Fix F → α)
    (hyp : ∀ x, h (Fix.mk x) = g (h <$> x)) : Fix.rec g = h

(hyp : ∀ (x : F (QPF.Fix F)), h (QPF.Fix.mk x) = g (h <$> x))


@[simp] theorem mem_erase_of_ne [LawfulBEq α] {a b : α} {l : List α} (ab : a ≠ b) :
    a ∈ l.erase b ↔ a ∈ l

{α : Type u_1}
[BEq α]
[LawfulBEq α]
{a b : α}
{l : List α}
(ab : a ≠ b)


lemma continuous_mk : Continuous (mk : X → t2Quotient X)


@[simp]
theorem prod_inj {f₁ f₂ : Filter α} {g₁ g₂ : Filter β} [NeBot f₁] [NeBot g₁] :
    f₁ ×ˢ g₁ = f₂ ×ˢ g₂ ↔ f₁ = f₂ ∧ g₁ = g₂

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

f₁ ×ˢ g₁ = f₂ ×ˢ g₂ ↔ f₁ = f₂ ∧ g₁ = g₂


theorem PInfty_f (n : ℕ) : (PInfty.f n : X _[n] ⟶ X _[n]) = (P n).f n

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{X : CategoryTheory.SimplicialObject C}
(n : ℕ)

AlgebraicTopology.DoldKan.PInfty.f n = (AlgebraicTopology.DoldKan.P n).f n


theorem eq_of_le_of_isDetecting {𝒢 : Set C} (h𝒢 : IsDetecting 𝒢) {X : C} (P Q : Subobject X)
    (h₁ : P ≤ Q) (h₂ : ∀ G ∈ 𝒢, ∀ {f : G ⟶ X}, Q.Factors f → P.Factors f) : P = Q


theorem IsClosed.isGreatest_csSup {s : Set α} (hc : IsClosed s) (hs : s.Nonempty) (B : BddAbove s) :
    IsGreatest s (sSup s)

{α : Type u_1}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
{s : Set α}
(hc : IsClosed s)
(hs : s.Nonempty)
(B : BddAbove s)


theorem ofDual_inj {a b : αᵒᵈ} : ofDual a = ofDual b ↔ a = b

OrderDual.ofDual a = OrderDual.ofDual b ↔ a = b


@[to_additive]
theorem prod_eq_pow_single [DecidableEq α] (a : α) (h : ∀ a' ≠ a, a' ∈ s → a' = 1) :
    s.prod = a ^ s.count a

(h : ∀ (a' : α), a' ≠ a → a' ∈ s → a' = 0)


protected theorem _root_.Finsupp.log_prod {α β : Type*} [Zero β] (f : α →₀ β) (g : α → β → ℝ)
    (hg : ∀ a, g a (f a) = 0 → f a = 0) : log (f.prod g) = f.sum fun a b ↦ log (g a b)

(f : α →₀ β)

(g : α → β → ℝ)

Real.log (f.prod g) = f.sum fun a b => Real.log (g a b)


lemma lt_slope_of_hasDerivAt (hfc : StrictConcaveOn ℝ S f) (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y)
    (hf' : HasDerivAt f f' y) :
    f' < slope f x y

{S : Set ℝ}
{f : ℝ → ℝ}
{x y f' : ℝ}
(hfc : StrictConcaveOn ℝ S f)
(hx : x ∈ S)
(hy : y ∈ S)
(hxy : x < y)
(hf' : HasDerivAt f f' y)


@[simp]
theorem toConvexCone_le_iff {S T : Submodule 𝕜 E} : S.toConvexCone ≤ T.toConvexCone ↔ S ≤ T

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{S T : Submodule 𝕜 E}


theorem tendsto_measure_Ico_atTop [SemilatticeSup α] [NoMaxOrder α]
    [(atTop : Filter α).IsCountablyGenerated] (μ : Measure α) (a : α) :
    Tendsto (fun x => μ (Ico a x)) atTop (𝓝 (μ (Ici a)))

{α : Type u_1}
{m0 : MeasurableSpace α}
[SemilatticeSup α]
[NoMaxOrder α]
[Filter.atTop.IsCountablyGenerated]
(μ : MeasureTheory.Measure α)
(a : α)

Filter.Tendsto (fun x => μ (Set.Ico a x)) Filter.atTop (nhds (μ (Set.Ici a)))


@[to_additive]
theorem IsCompact.closedBall_mul (hs : IsCompact s) (hδ : 0 ≤ δ) (x : E) :
    closedBall x δ * s = x • cthickening δ s

{E : Type u_1}
[SeminormedAddCommGroup E]
{δ : ℝ}
{s : Set E}
(hs : IsCompact s)
(hδ : 0 ≤ δ)
(x : E)

Metric.closedBall x δ + s = x +ᵥ Metric.cthickening δ s


@[to_additive (attr := simp)]
theorem inv_mul_le_iff_le_mul : b⁻¹ * a ≤ c ↔ a ≤ b * c

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


@[to_additive (attr := simp)]
theorem inv_inv_symm_iff : SemiconjBy a⁻¹ x⁻¹ y⁻¹ ↔ SemiconjBy a y x

{G : Type u_1}
[SubtractionMonoid G]
{a x y : G}

AddSemiconjBy (-a) (-x) (-y) ↔ AddSemiconjBy a y x


/-- If the image of a set under an injective map is a subsingleton, the set is a subsingleton. -/
theorem subsingleton_of_image {f : α → β} (hf : Function.Injective f) (s : Set α)
    (hs : (f '' s).Subsingleton) : s.Subsingleton

{α : Type u_1}
{β : Type u_2}
{f : α → β}
(hf : Function.Injective f)
(s : Set α)
(hs : (f '' s).Subsingleton)


@[simp]
theorem «exists» {p : α × β → Prop} : (∃ x, p x) ↔ ∃ a b, p (a, b)

{α : Type u_1}
{β : Type u_2}
{p : α × β → Prop}


theorem getLast?_cons : @getLast? α (a::l) = getLastD l a


/-- If `IsCyclotomicExtension {n} K L`, then `L` is the splitting field of `X ^ n - 1`. -/
theorem isSplittingField_X_pow_sub_one : IsSplittingField K L (X ^ (n : ℕ) - 1)

(n : ℕ+)
(K : Type w)
(L : Type z)
[Field K]
[Field L]
[Algebra K L]
[IsCyclotomicExtension {n} K L]

Polynomial.IsSplittingField K L (Polynomial.X ^ ↑n - 1)


/-- The `i`-th sublist in the splitting of a list `l` along a composition `c`, is the slice of `l`
between the indices `c.sizeUpTo i` and `c.sizeUpTo (i+1)`, i.e., the indices in the `i`-th
block of the composition. -/
@[deprecated getElem_splitWrtComposition' (since := "2024-06-12")]
theorem get_splitWrtComposition' (l : List α) (c : Composition n) {i : ℕ}
    (hi : i < (l.splitWrtComposition c).length) :
    (l.splitWrtComposition c).get ⟨i, hi⟩ = (l.take (c.sizeUpTo (i + 1))).drop (c.sizeUpTo i)

(l.splitWrtComposition c).get ⟨i, hi⟩ = List.drop (c.sizeUpTo i) (List.take (c.sizeUpTo (i + 1)) l)


theorem findIdxs_cons_aux (p : α → Bool) :
    foldrIdx (fun i a is => if p a = true then (i + 1) :: is else is) [] xs s =
      map (· + 1) (foldrIdx (fun i a is => if p a = true then i :: is else is) [] xs s)

{α : Type u_1}
{xs : List α}
{s : Nat}
(p : α → Bool)

List.foldrIdx (fun i a is => if p a = true then (i + 1) :: is else is) [] xs s =
  List.map (fun x => x + 1) (List.foldrIdx (fun i a is => if p a = true then i :: is else is) [] xs s)


theorem inv_symm_left₀ (h : SemiconjBy a x y) : SemiconjBy a⁻¹ y x

{G₀ : Type u_3}
[GroupWithZero G₀]
{a x y : G₀}
(h : SemiconjBy a x y)


protected theorem restrict (h : IsPartition π) (hJ : J ≤ I) : IsPartition (π.restrict J)

{ι : Type u_1}
{I J : BoxIntegral.Box ι}
{π : BoxIntegral.Prepartition I}
(h : π.IsPartition)
(hJ : J ≤ I)


@[reassoc]
lemma mapHomologyIso'_hom_naturality [S₁.HasHomology] [S₂.HasHomology]
    [(S₁.map F).HasHomology] [(S₂.map F).HasHomology]
    [F.PreservesRightHomologyOf S₁] [F.PreservesRightHomologyOf S₂] :
    @homologyMap _ _ _ (S₁.map F) (S₂.map F) (F.mapShortComplex.map φ) _ _ ≫
      (S₂.mapHomologyIso' F).hom = (S₁.mapHomologyIso' F).hom ≫ F.map (homologyMap φ)

CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.homologyMap (F.mapShortComplex.map φ))
    (S₂.mapHomologyIso' F).hom =
  CategoryTheory.CategoryStruct.comp (S₁.mapHomologyIso' F).hom (F.map (CategoryTheory.ShortComplex.homologyMap φ))


theorem div_nonneg_iff_of_pos {a b : Int} (h : 0 < b) : a / b ≥ 0 ↔ a ≥ 0


theorem map_comp (f : β → γ) (g : α → β) (hf : Continuous f) (hg : Continuous g) (hf' : IsOpenMap f)
    (hg' : IsOpenMap g) (K : PositiveCompacts α) :
    K.map (f ∘ g) (hf.comp hg) (hf'.comp hg') = (K.map g hg hg').map f hf hf'

(K : TopologicalSpace.PositiveCompacts α)

TopologicalSpace.PositiveCompacts.map (f ∘ g) ⋯ ⋯ K =
  TopologicalSpace.PositiveCompacts.map f hf hf' (TopologicalSpace.PositiveCompacts.map g hg hg' K)


@[simp]
theorem inr_mul_inr [Semiring R] [AddCommMonoid M] [Module R M] [Module Rᵐᵒᵖ M] (m₁ m₂ : M) :
    (inr m₁ * inr m₂ : tsze R M) = 0

(R : Type u)
{M : Type v}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Module Rᵐᵒᵖ M]
(m₁ m₂ : M)

TrivSqZeroExt.inr m₁ * TrivSqZeroExt.inr m₂ = 0


@[simp]
theorem span_nat_eq (s : AddSubmonoid M) : (span ℕ (s : Set M)).toAddSubmonoid = s

{M : Type u_4}
[AddCommMonoid M]
(s : AddSubmonoid M)

(Submodule.span ℕ ↑s).toAddSubmonoid = s


@[simp]
theorem toFinset_inj {s t : Set α} [Fintype s] [Fintype t] : s.toFinset = t.toFinset ↔ s = t

{α : Type u_1}
{s t : Set α}
[Fintype ↑s]
[Fintype ↑t]


@[simp]
theorem Ico_bot : Ico ⊥ a = Iio a

{α : Type u_1}
[Preorder α]
[OrderBot α]
{a : α}


@[to_additive (attr := simp)]
theorem smul_eq_empty : s • t = ∅ ↔ s = ∅ ∨ t = ∅

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{s : Set α}
{t : Set β}


protected theorem hasMFDerivWithinAt : HasMFDerivWithinAt 𝓘(𝕜, E) 𝓘(𝕜, E') f s x f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
(f : E →L[𝕜] E')
{s : Set E}
{x : E}

HasMFDerivWithinAt 𝓘(𝕜, E) 𝓘(𝕜, E') (⇑f) s x f


theorem liminf_le_liminf {α : Type*} [ConditionallyCompleteLattice β] {f : Filter α} {u v : α → β}
    (h : ∀ᶠ a in f, u a ≤ v a)
    (hu : f.IsBoundedUnder (· ≥ ·) u := by isBoundedDefault)
    (hv : f.IsCoboundedUnder (· ≥ ·) v := by isBoundedDefault) :
    liminf u f ≤ liminf v f

(hu : Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) f u := by isBoundedDefault)

(hv : Filter.IsCoboundedUnder (fun x x_1 => x ≥ x_1) f v := by isBoundedDefault)


theorem lift'_smul (g : M →ₗ[R] M'') (h : ∀ x : S, IsUnit ((algebraMap R (Module.End R M'')) x))
    (r : R) (m) : r • LocalizedModule.lift' S g h m = LocalizedModule.lift' S g h (r • m)

(h : ∀ (x : ↥S), IsUnit ((algebraMap R (Module.End R M'')) ↑x))


/-- In finite dimensions, over an algebraically closed field, the generalized eigenspaces of any
linear endomorphism span the whole space. -/
theorem iSup_genEigenspace_eq_top [IsAlgClosed K] [FiniteDimensional K V] (f : End K V) :
    ⨆ (μ : K) (k : ℕ), f.genEigenspace μ k = ⊤

{K : Type u_1}
{V : Type u_2}
[Field K]
[AddCommGroup V]
[Module K V]
[IsAlgClosed K]
[FiniteDimensional K V]
(f : Module.End K V)


@[simp]
theorem tsub_le_iff_right [LE α] [Add α] [Sub α] [OrderedSub α] {a b c : α} :
    a - b ≤ c ↔ a ≤ c + b

{α : Type u_1}
[LE α]
[Add α]
[Sub α]
[OrderedSub α]
{a b c : α}


theorem isWide_iff_objs_eq_univ : S.IsWide ↔ S.objs = Set.univ

{C : Type u}
[CategoryTheory.Groupoid C]
(S : CategoryTheory.Subgroupoid C)


/-- In a finite-dimensional space, linear maps are inverse to each other on one side if and only if
they are inverse to each other on the other side. -/
theorem mul_eq_one_comm [FiniteDimensional K V] {f g : V →ₗ[K] V} : f * g = 1 ↔ g * f = 1

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
[FiniteDimensional K V]
{f g : V →ₗ[K] V}


/-- A ring is Noetherian if and only if all its ideals are finitely-generated. -/
theorem isNoetherianRing_iff_ideal_fg (R : Type*) [Semiring R] :
    IsNoetherianRing R ↔ ∀ I : Ideal R, I.FG

IsNoetherianRing R ↔ ∀ (I : Ideal R), I.FG


/-- Morphisms to a single object cochain complex with `X` concentrated in degree 0
to an `ℕ`-indexed cochain complex `C` are the same as morphisms `f : C.X 0 ⟶ X`.
-/
@[simps apply]
noncomputable def toSingle₀Equiv (C : CochainComplex V ℕ) (X : V) :
    (C ⟶ (single₀ V).obj X) ≃ (C.X 0 ⟶ X)

(f : C ⟶ (CochainComplex.single₀ V).obj X)


@[simp]
theorem imI_star : (star a).imI = -a.imI

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(a : ℍ[R,c₁,c₂])


theorem le_liftLinear_apply {f : OuterMeasure α →ₗ[ℝ≥0∞] OuterMeasure β} (hf) (s : Set β) :
    f μ.toOuterMeasure s ≤ liftLinear f hf μ s

{f : MeasureTheory.OuterMeasure α →ₗ[ENNReal] MeasureTheory.OuterMeasure β}

(hf : ∀ (μ : MeasureTheory.Measure α), inst✝ ≤ (f μ.toOuterMeasure).caratheodory)

(f μ.toOuterMeasure) s ≤ ((MeasureTheory.Measure.liftLinear f hf) μ) s


theorem div_add_mod (m n : Nat) : n * (m / n) + m % n = m


@[simp] theorem extract_empty (start stop : Nat) : (#[] : Array α).extract start stop = #[]


@[to_additive (attr := simp)]
theorem coe_mkHomeomorph_symm : ⇑(mkHomeomorph : M ≃ₜ Mᵈᵐᵃ).symm = mk.symm


theorem torusIntegral_add (hf : TorusIntegrable f c R) (hg : TorusIntegrable g c R) :
    (∯ x in T(c, R), f x + g x) = (∯ x in T(c, R), f x) + ∯ x in T(c, R), g x

{n : ℕ}
{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f g : (Fin n → ℂ) → E}
{c : Fin n → ℂ}
{R : Fin n → ℝ}
(hf : TorusIntegrable f c R)
(hg : TorusIntegrable g c R)

(∯ (x : Fin n → ℂ) in T(c, R), f x + g x) = (∯ (x : Fin n → ℂ) in T(c, R), f x) + ∯ (x : Fin n → ℂ) in T(c, R), g x


theorem span_gramSchmidt_Iic (f : ι → E) (c : ι) :
    span 𝕜 (gramSchmidt 𝕜 f '' Set.Iic c) = span 𝕜 (f '' Set.Iic c)

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_3}
[LinearOrder ι]
[LocallyFiniteOrderBot ι]
[IsWellOrder ι fun x x_1 => x < x_1]
(f : ι → E)
(c : ι)

Submodule.span 𝕜 (gramSchmidt 𝕜 f '' Set.Iic c) = Submodule.span 𝕜 (f '' Set.Iic c)


@[simp]
theorem wittSub_zero : wittSub p 0 = X (0, 0) - X (1, 0)

WittVector.wittSub p 0 = MvPolynomial.X (0, 0) - MvPolynomial.X (1, 0)


theorem coe_balanced (s : AbsConvexOpenSets 𝕜 E) : Balanced 𝕜 (s : Set E)

{𝕜 : Type u_1}
{E : Type u_2}
[TopologicalSpace E]
[AddCommMonoid E]
[Zero E]
[SeminormedRing 𝕜]
[SMul 𝕜 E]
[SMul ℝ E]
(s : AbsConvexOpenSets 𝕜 E)


@[simp]
theorem self_comp_symm (e : α ≃ᵐ β) : e ∘ e.symm = id

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


@[simp]
theorem ofAdd_symm_eq : (@ofAdd α).symm = toAdd


@[to_additive (attr := simp)]
theorem finprod_mem_mulSupport (f : α → M) (a : α) : ∏ᶠ _ : f a ≠ 1, f a = f a

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
(f : α → M)
(a : α)


lemma isZero₁_iff_isIso₂ :
    IsZero T.obj₁ ↔ IsIso T.mor₂

[∀ (n : ℤ), (CategoryTheory.shiftFunctor C n).Additive]

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

CategoryTheory.Limits.IsZero T.obj₁ ↔ CategoryTheory.IsIso T.mor₂


/-- The `p`-adic norm is nonarchimedean: the norm of `p + q` is at most the max of the norm of `p`
and the norm of `q`. -/
protected theorem nonarchimedean {q r : ℚ} :
    padicNorm p (q + r) ≤ max (padicNorm p q) (padicNorm p r)

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{q r : ℚ}


theorem continuous_iff (hg : Inducing g) :
    Continuous f ↔ Continuous (g ∘ f)

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
{f : X → Y}
{g : Y → Z}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(hg : Inducing g)


theorem cutExpand_le_invImage_lex [DecidableEq α] [IsIrrefl α r] :
    CutExpand r ≤ InvImage (Finsupp.Lex (rᶜ ⊓ (· ≠ ·)) (· < ·)) toFinsupp

{α : Type u_1}
{r : α → α → Prop}
[DecidableEq α]
[IsIrrefl α r]

Relation.CutExpand r ≤ InvImage (Finsupp.Lex (rᶜ ⊓ fun x x_1 => x ≠ x_1) fun x x_1 => x < x_1) ⇑Multiset.toFinsupp


/-- Two different points are affinely independent. -/
theorem affineIndependent_of_ne {p₁ p₂ : P} (h : p₁ ≠ p₂) : AffineIndependent k ![p₁, p₂]

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{p₁ p₂ : P}
(h : p₁ ≠ p₂)


theorem traceMatrix_of_basis [Fintype κ] [DecidableEq κ] (b : Basis κ A B) :
    traceMatrix A b = BilinForm.toMatrix b (traceForm A B)

{κ : Type w}
{A : Type u}
{B : Type v}
[CommRing A]
[CommRing B]
[Algebra A B]
[Fintype κ]
[DecidableEq κ]
(b : Basis κ A B)

Algebra.traceMatrix A ⇑b = (BilinForm.toMatrix b) (Algebra.traceForm A B)


lemma addPolynomial_slope {x₁ x₂ y₁ y₂ : F} (h₁ : W.Equation x₁ y₁) (h₂ : W.Equation x₂ y₂)
    (hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂) : W.addPolynomial x₁ y₁ (W.slope x₁ x₂ y₁ y₂) =
      -((X - C x₁) * (X - C x₂) * (X - C (W.addX x₁ x₂ <| W.slope x₁ x₂ y₁ y₂)))

{F : Type u}
[Field F]
{W : WeierstrassCurve.Affine F}
{x₁ x₂ y₁ y₂ : F}
(h₁ : W.Equation x₁ y₁)
(h₂ : W.Equation x₂ y₂)
(hxy : x₁ = x₂ → y₁ ≠ W.negY x₂ y₂)

W.addPolynomial x₁ y₁ (W.slope x₁ x₂ y₁ y₂) =
  -((Polynomial.X - Polynomial.C x₁) * (Polynomial.X - Polynomial.C x₂) *
      (Polynomial.X - Polynomial.C (W.addX x₁ x₂ (W.slope x₁ x₂ y₁ y₂))))


theorem inter_iUnion (s : Set β) (t : ι → Set β) : (s ∩ ⋃ i, t i) = ⋃ i, s ∩ t i

{β : Type u_2}
{ι : Sort u_4}
(s : Set β)
(t : ι → Set β)


lemma IsSelfAdjoint.le_algebraMap_norm_self {a : A} (ha : IsSelfAdjoint a := by cfc_tac) :
    a ≤ algebraMap ℝ A ‖a‖

{A : Type u_1}
[NormedRing A]
[StarRing A]
[CstarRing A]
[CompleteSpace A]
[NormedAlgebra ℂ A]
[StarModule ℂ A]
[PartialOrder A]
[StarOrderedRing A]
{a : A}
(ha : IsSelfAdjoint a := by cfc_tac)


theorem _root_.ContinuousOn.prod_map_equivL {f : X → M₁ ≃L[𝕜] M₂} {g : X → M₃ ≃L[𝕜] M₄} {s : Set X}
    (hf : ContinuousOn (fun x => (f x : M₁ →L[𝕜] M₂)) s)
    (hg : ContinuousOn (fun x => (g x : M₃ →L[𝕜] M₄)) s) :
    ContinuousOn (fun x => ((f x).prod (g x) : M₁ × M₃ →L[𝕜] M₂ × M₄)) s

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
{M₁ : Type u_5}
{M₂ : Type u_6}
{M₃ : Type u_7}
{M₄ : Type u_8}
[SeminormedAddCommGroup M₁]
[NormedSpace 𝕜 M₁]
[SeminormedAddCommGroup M₂]
[NormedSpace 𝕜 M₂]
[SeminormedAddCommGroup M₃]
[NormedSpace 𝕜 M₃]
[SeminormedAddCommGroup M₄]
[NormedSpace 𝕜 M₄]
{X : Type u_9}
[TopologicalSpace X]
{f : X → M₁ ≃L[𝕜] M₂}
{g : X → M₃ ≃L[𝕜] M₄}
{s : Set X}
(hf : ContinuousOn (fun x => ↑(f x)) s)
(hg : ContinuousOn (fun x => ↑(g x)) s)

ContinuousOn (fun x => ↑((f x).prod (g x))) s


/-- (Implementation) The object part of the compactification functor from topological spaces to
compact Hausdorff spaces.
-/
@[simps!]
def stoneCechObj (X : TopCat) : CompHaus

(s : Set (Quotient (t2Setoid (PreStoneCech ↑X))))

TopologicalSpace.IsOpen s = IsOpen (Quotient.mk' ⁻¹' s)


theorem singularPart_add (s t : SignedMeasure α) (μ : Measure α) [s.HaveLebesgueDecomposition μ]
    [t.HaveLebesgueDecomposition μ] :
    (s + t).singularPart μ = s.singularPart μ + t.singularPart μ

{α : Type u_1}
{m : MeasurableSpace α}
(s t : MeasureTheory.SignedMeasure α)
(μ : MeasureTheory.Measure α)
[s.HaveLebesgueDecomposition μ]
[t.HaveLebesgueDecomposition μ]


@[simp]
theorem ofReal_le_ofReal_iff {p q : ℝ} (h : 0 ≤ q) :
    ENNReal.ofReal p ≤ ENNReal.ofReal q ↔ p ≤ q


protected theorem IsLimit.ne_zero {c} (h : IsLimit c) : c ≠ 0


@[simp]
protected theorem smul_def (f : A₁ ≃ₐ[R] A₁) (a : A₁) : f • a = f a

{R : Type uR}
{A₁ : Type uA₁}
[CommSemiring R]
[Semiring A₁]
[Algebra R A₁]
(f : A₁ ≃ₐ[R] A₁)
(a : A₁)


@[simp]
theorem orderIsoIicOneBirational_symm_apply (x : Iic (1 : ℝ≥0∞)) :
    orderIsoIicOneBirational.symm x = (x.1⁻¹ - 1)⁻¹

ENNReal.orderIsoIicOneBirational.symm x = ((↑x)⁻¹ - 1)⁻¹


@[to_additive (attr := simp)]
lemma ofHom_apply {X Y : Type u} [Monoid X] [Monoid Y] (f : X →* Y) (x : X) :
    (ofHom f) x = f x

{X Y : Type u}
[AddMonoid X]
[AddMonoid Y]
(f : X →+ Y)
(x : X)


theorem mem_splitSupport_iff_nonzero (i : ι) : i ∈ splitSupport l ↔ split l i ≠ 0

{ι : Type u_4}
{M : Type u_5}
{αs : ι → Type u_13}
[Zero M]
(l : (i : ι) × αs i →₀ M)
(i : ι)


theorem factorization_eq_zero_of_remainder {p r : ℕ} (i : ℕ) (hr : ¬p ∣ r) :
    (p * i + r).factorization p = 0


@[simp]
theorem mem_toAddSubmonoid (p : Submodule R M) (x : M) : x ∈ p.toAddSubmonoid ↔ x ∈ p

{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(p : Submodule R M)
(x : M)


theorem pi_Iic_mem_nhds' (ha : ∀ i, x' i < a' i) : Iic a' ∈ 𝓝 x'

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{ι : Type u_1}
[Finite ι]
{a' x' : ι → α}
(ha : ∀ (i : ι), x' i < a' i)


theorem Wbtw.right_mem_image_Ici_of_left_ne {x y z : P} (h : Wbtw R x y z) (hne : x ≠ y) :
    z ∈ lineMap x y '' Set.Ici (1 : R)

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{x y z : P}
(h : Wbtw R x y z)
(hne : x ≠ y)

z ∈ ⇑(AffineMap.lineMap x y) '' Set.Ici 1


/-- `SatisfiesM` distributes over `<$>`, general version. -/
protected theorem map [Functor m] [LawfulFunctor m] {x : m α}
    (hx : SatisfiesM p x) (hf : ∀ {a}, p a → q (f a)) : SatisfiesM q (f <$> x)

{m : Type u_1 → Type u_2}
{α : Type u_1}
{p : α → Prop}

∀ {α_1 : Type u_1} {q : α_1 → Prop} {f : α → α_1} [inst : Functor m] [inst_1 : LawfulFunctor m] {x : m α},
  SatisfiesM p x → (∀ {a : α}, p a → q (f a)) → SatisfiesM q (f <$> x)


/--
Cost structure given by a function.
Delete and insert cost the same, and substitution costs the greater value.
-/
@[simps]
def weightCost (f : α → ℕ) : Cost α α ℕ

(Levenshtein.weightCost f).insert b = f b


theorem continuousOn_iff_isClosed {f : α → β} {s : Set α} :
    ContinuousOn f s ↔ ∀ t : Set β, IsClosed t → ∃ u, IsClosed u ∧ f ⁻¹' t ∩ s = u ∩ s

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
{s : Set α}

ContinuousOn f s ↔ ∀ (t : Set β), IsClosed t → ∃ u, IsClosed u ∧ f ⁻¹' t ∩ s = u ∩ s


/-- The restriction of scalars by a ring morphism that is the identity identify to the
identity functor. -/
@[simps! hom_app inv_app]
def restrictScalarsId' : ModuleCat.restrictScalars.{v} f ≅ 𝟭 _

{R : Type u₁}
[Ring R]
(f : R →+* R)
(hf : f = RingHom.id R)
(X : ModuleCat R)

(ModuleCat.restrictScalarsId' f hf).inv.app X = (ModuleCat.restrictScalarsId'App f hf X).inv


theorem continuousOn_setToFun_of_dominated (hT : DominatedFinMeasAdditive μ T C) {fs : X → α → E}
    {bound : α → ℝ} {s : Set X} (hfs_meas : ∀ x ∈ s, AEStronglyMeasurable (fs x) μ)
    (h_bound : ∀ x ∈ s, ∀ᵐ a ∂μ, ‖fs x a‖ ≤ bound a) (bound_integrable : Integrable bound μ)
    (h_cont : ∀ᵐ a ∂μ, ContinuousOn (fun x => fs x a) s) :
    ContinuousOn (fun x => setToFun μ T hT (fs x)) s

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(hfs_meas : ∀ x ∈ s, MeasureTheory.AEStronglyMeasurable (fs x) μ)

(h_bound : ∀ x ∈ s, ∀ᵐ (a : α) ∂μ, ‖fs x a‖ ≤ bound a)

(bound_integrable : MeasureTheory.Integrable bound μ)

(h_cont : ∀ᵐ (a : α) ∂μ, ContinuousOn (fun x => fs x a) s)

ContinuousOn (fun x => MeasureTheory.setToFun μ T hT (fs x)) s


theorem univBall_target (c : P) {r : ℝ} (hr : 0 < r) : (univBall c r).target = ball c r

{E : Type u_1}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{P : Type u_2}
[PseudoMetricSpace P]
[NormedAddTorsor E P]
(c : P)
{r : ℝ}
(hr : 0 < r)

(PartialHomeomorph.univBall c r).target = Metric.ball c r


/-- A version of `le_refl` where the argument is implicit -/
theorem le_rfl {a : α} : a ≤ a


@[to_additive]
theorem iSup_eq_closure {ι : Sort*} (p : ι → Submonoid M) :
    ⨆ i, p i = Submonoid.closure (⋃ i, (p i : Set M))

{M : Type u_1}
[MulOneClass M]
{ι : Sort u_4}
(p : ι → Submonoid M)

⨆ i, p i = Submonoid.closure (⋃ i, ↑(p i))


theorem restrict_finite {R : Set α} (hR : R.Finite) : (M ↾ R).Finite

{α : Type u_1}
{M : Matroid α}
{R : Set α}
(hR : R.Finite)


theorem singleton_nonempty (u : ZFSet) : ZFSet.Nonempty {u}


@[simp]
theorem isClosed_preimage (h : X ≃ₜ Y) {s : Set Y} : IsClosed (h ⁻¹' s) ↔ IsClosed s

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(h : X ≃ₜ Y)
{s : Set Y}


@[simp]
theorem coeff_mul_X_pow (p : R[X]) (n d : ℕ) :
    coeff (p * Polynomial.X ^ n) (d + n) = coeff p d

{R : Type u}
[Semiring R]
(p : R[X])
(n d : ℕ)

(p * Polynomial.X ^ n).coeff (d + n) = p.coeff d


@[to_additive]
theorem continuousInv_iInf {ts' : ι' → TopologicalSpace G}
    (h' : ∀ i, @ContinuousInv G (ts' i) _) : @ContinuousInv G (⨅ i, ts' i) _

{G : Type w}
{ι' : Sort u_1}
[Neg G]
{ts' : ι' → TopologicalSpace G}
(h' : ∀ (i : ι'), ContinuousNeg G)


protected theorem Embedding.t0Space [TopologicalSpace Y] [T0Space Y] {f : X → Y}
    (hf : Embedding f) : T0Space X

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[T0Space Y]
{f : X → Y}
(hf : Embedding f)


@[simp]
theorem liftCover_coe {i : ι} (x : S i) : liftCover S φ hφ hS x = φ i x

{hφ : ∀ (i j : ι) (x : α) (hxi : x ∈ S i) (hxj : x ∈ S j), (φ i) ⟨x, hxi⟩ = (φ j) ⟨x, hxj⟩}

(ContinuousMap.liftCover S φ hφ hS) ↑x = (φ i) x


theorem sInf_image2 {f : β → γ → α} {s : Set β} {t : Set γ} :
    sInf (image2 f s t) = ⨅ (a ∈ s) (b ∈ t), f a b

{α : Type u_1}
{β : Type u_2}
{γ : Type u_4}
[CompleteLattice α]
{f : β → γ → α}
{s : Set β}
{t : Set γ}

sInf (Set.image2 f s t) = ⨅ a ∈ s, ⨅ b ∈ t, f a b


theorem nndist_triangle_left (x y z : α) : nndist x y ≤ nndist z x + nndist z y

{α : Type u}
[PseudoMetricSpace α]
(x y z : α)


nonrec theorem SmoothAt.smul {f : M → 𝕜} {g : M → V} (hf : SmoothAt I 𝓘(𝕜) f x)
    (hg : SmoothAt I 𝓘(𝕜, V) g x) : SmoothAt I 𝓘(𝕜, V) (fun p => f p • g p) x

{𝕜 : 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]
{x : M}
{V : Type u_18}
[NormedAddCommGroup V]
[NormedSpace 𝕜 V]
{f : M → 𝕜}
{g : M → V}
(hf : SmoothAt I 𝓘(𝕜, 𝕜) f x)
(hg : SmoothAt I 𝓘(𝕜, V) g x)


theorem mem_interedges_iff {x : α × α} : x ∈ G.interedges s t ↔ x.1 ∈ s ∧ x.2 ∈ t ∧ G.Adj x.1 x.2

{α : Type u_4}
(G : SimpleGraph α)
[DecidableRel G.Adj]
{s t : Finset α}
{x : α × α}


theorem compl_mem_kernMap {s : Set β} : sᶜ ∈ kernMap m f ↔ ∃ t, tᶜ ∈ f ∧ m '' t = s

{α : Type u}
{β : Type v}
{m : α → β}
{f : Filter α}
{s : Set β}

sᶜ ∈ Filter.kernMap m f ↔ ∃ t, tᶜ ∈ f ∧ m '' t = s


@[to_additive (attr := mono)]
theorem mul_subset_mul : s₁ ⊆ t₁ → s₂ ⊆ t₂ → s₁ * s₂ ⊆ t₁ * t₂

{α : Type u_2}
[Mul α]
{s₁ s₂ t₁ t₂ : Set α}

s₁ ⊆ t₁ → s₂ ⊆ t₂ → s₁ * s₂ ⊆ t₁ * t₂