lemma differentialIdeal_le_fractionalIdeal_iff
    {I : FractionalIdeal B⁰ L} (hI : I ≠ 0) [NoZeroSMulDivisors A B] :
    differentIdeal A B ≤ I ↔ (((I⁻¹ : _) : Submodule B L).restrictScalars A).map
      ((Algebra.trace K L).restrictScalars A) ≤ 1

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

↑(differentIdeal A B) ≤ I ↔ Submodule.map (↑A (Algebra.trace K L)) (Submodule.restrictScalars A ↑I⁻¹) ≤ 1


@[simp]
theorem image_add_const_Ioo : (fun x => x + a) '' Ioo b c = Ioo (b + a) (c + a)

{M : Type u_1}
[OrderedCancelAddCommMonoid M]
[ExistsAddOfLE M]
(a b c : M)

(fun x => x + a) '' Set.Ioo b c = Set.Ioo (b + a) (c + a)


@[instance]
theorem nhdsWithin_Ioi_coe_neBot {r : ℝ≥0} : (𝓝[>] (r : ℝ≥0∞)).NeBot


/-- If two lifts of circle homeomorphisms have the same translation number, then they are
semiconjugate by a `CircleDeg1Lift`. This version uses arguments `f₁ f₂ : CircleDeg1Liftˣ`
to assume that `f₁` and `f₂` are homeomorphisms. -/
theorem units_semiconj_of_translationNumber_eq {f₁ f₂ : CircleDeg1Liftˣ} (h : τ f₁ = τ f₂) :
    ∃ F : CircleDeg1Lift, Semiconj F f₁ f₂

(h : (↑f₁).translationNumber = (↑f₂).translationNumber)


theorem IsPeriodicPt.eq_zero_of_lt_minimalPeriod (hx : IsPeriodicPt f n x)
    (hn : n < minimalPeriod f x) : n = 0

{α : Type u_1}
{f : α → α}
{x : α}
{n : ℕ}
(hx : Function.IsPeriodicPt f n x)
(hn : n < Function.minimalPeriod f x)


theorem intervalIntegrable_vComp (t₁ t₂ : ℝ) : IntervalIntegrable f.vComp volume t₁ t₂

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{v : PicardLindelof E}
(f : v.FunSpace)
(t₁ t₂ : ℝ)

IntervalIntegrable f.vComp MeasureTheory.volume t₁ t₂


/-- The braiding is symmetric. -/
@[simp]
theorem gradedComm_symm : (gradedComm R 𝒜 ℬ).symm = gradedComm R ℬ 𝒜

(R : Type u_1)
{ι : Type u_2}
[CommSemiring ι]
[Module ι (Additive ℤˣ)]
[DecidableEq ι]
(𝒜 : ι → Type u_5)
(ℬ : ι → Type u_6)
[CommRing R]
[(i : ι) → AddCommGroup (𝒜 i)]
[(i : ι) → AddCommGroup (ℬ i)]
[(i : ι) → Module R (𝒜 i)]
[(i : ι) → Module R (ℬ i)]

(TensorProduct.gradedComm R 𝒜 ℬ).symm = TensorProduct.gradedComm R ℬ 𝒜


@[to_additive (attr := simp)]
theorem op_inj {x y : α} : op x = op y ↔ x = y

MulOpposite.op x = MulOpposite.op y ↔ x = y


@[simp, norm_cast]
theorem up_natCast [NatCast α] (n : ℕ) : up (n : α) = n


@[to_additive]
theorem NeBot.of_smul_filter : (a • f).NeBot → f.NeBot

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


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

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

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

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

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


theorem liminf_le_liminf_of_le {α β} [ConditionallyCompleteLattice β] {f g : Filter α} (h : g ≤ f)
    {u : α → β}
    (hf : f.IsBoundedUnder (· ≥ ·) u := by isBoundedDefault)
    (hg : g.IsCoboundedUnder (· ≥ ·) u := by isBoundedDefault) :
    liminf u f ≤ liminf u g

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

(hg : Filter.IsCoboundedUnder (fun x x_1 => x ≥ x_1) g u := by isBoundedDefault)


theorem exists_lift {B : Type u} [CommRing B] [_RB : Algebra R B]
    [FormallySmooth R A] (I : Ideal B) (hI : IsNilpotent I) (g : A →ₐ[R] B ⧸ I) :
    ∃ f : A →ₐ[R] B, (Ideal.Quotient.mkₐ R I).comp f = g

{R : Type u}
[CommSemiring R]
{A : Type u}
[Semiring A]
[Algebra R A]
{B : Type u}
[CommRing B]
[_RB : Algebra R B]
[Algebra.FormallySmooth R A]
(I : Ideal B)
(hI : IsNilpotent I)
(g : A →ₐ[R] B ⧸ I)

∃ f, (Ideal.Quotient.mkₐ R I).comp f = g


@[simp]
theorem Basis.restrictScalars_repr_apply (m : span R (Set.range b)) (i : ι) :
    algebraMap R S ((b.restrictScalars R).repr m i) = b.repr m i

(m : ↥(Submodule.span R (Set.range ⇑b)))

(algebraMap R S) (((Basis.restrictScalars R b).repr m) i) = (b.repr ↑m) i


theorem asAlgebraHom_def : asAlgebraHom ρ = (lift k G _) ρ

{k : Type u_1}
{G : Type u_2}
{V : Type u_3}
[CommSemiring k]
[Monoid G]
[AddCommMonoid V]
[Module k V]
(ρ : Representation k G V)

ρ.asAlgebraHom = (MonoidAlgebra.lift k G (V →ₗ[k] V)) ρ


/-- If the Killing form of a Lie algebra is non-singular, it remains non-singular when restricted
to a Cartan subalgebra. -/
lemma ker_restrict_eq_bot_of_isCartanSubalgebra
    [IsNoetherian R L] [IsArtinian R L] (H : LieSubalgebra R L) [H.IsCartanSubalgebra] :
    LinearMap.ker ((killingForm R L).restrict H) = ⊥

(R : Type u_1)
(L : Type u_3)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsKilling R L]
[IsNoetherian R L]
[IsArtinian R L]
(H : LieSubalgebra R L)
[H.IsCartanSubalgebra]

LinearMap.ker ((killingForm R L).restrict H.toSubmodule) = ⊥


@[simp] theorem Spec.topObj_forget {R} : (forget TopCat).obj (Spec.topObj R) = PrimeSpectrum R

(CategoryTheory.forget TopCat).obj (AlgebraicGeometry.Spec.topObj R) = PrimeSpectrum ↑R


protected theorem isCompact [OrderClosedTopology 𝕜] [T2Space E] {A B : Set E}
    (hAB : IsExposed 𝕜 A B) (hA : IsCompact A) : IsCompact B

{𝕜 : Type u_1}
{E : Type u_2}
[TopologicalSpace 𝕜]
[OrderedRing 𝕜]
[AddCommMonoid E]
[TopologicalSpace E]
[Module 𝕜 E]
[OrderClosedTopology 𝕜]
[T2Space E]
{A B : Set E}
(hAB : IsExposed 𝕜 A B)
(hA : IsCompact A)


/-- If a submodule has maximal dimension in a finite dimensional space, then it is equal to the
whole space. -/
theorem _root_.Submodule.eq_top_of_finrank_eq [FiniteDimensional K V] {S : Submodule K V}
    (h : finrank K S = finrank K V) : S = ⊤

(h : FiniteDimensional.finrank K ↥S = FiniteDimensional.finrank K V)


@[to_additive (attr := simp)]
theorem closure_closure_coe_preimage {s : Set M} : closure (((↑) : closure s → M) ⁻¹' s) = ⊤

{M : Type u_1}
[AddZeroClass M]
{s : Set M}

AddSubmonoid.closure (Subtype.val ⁻¹' s) = ⊤


@[simp]
theorem reCLM_nnnorm : ‖reCLM‖₊ = 1


@[to_additive (attr := measurability)]
theorem AEMeasurable.const_smul (hf : AEMeasurable g μ) (c : M) : AEMeasurable (c • g) μ

{M : Type u_2}
{β : Type u_3}
{α : Type u_4}
[MeasurableSpace M]
[MeasurableSpace β]
[SMul M β]
{m : MeasurableSpace α}
{g : α → β}
[MeasurableSMul M β]
{μ : MeasureTheory.Measure α}
(hf : AEMeasurable g μ)
(c : M)


/-- A point in the antidiagonal is determined by its second coordinate.

See also `Finset.antidiagonal_congr`. -/
lemma antidiagonal_congr' (hp : p ∈ antidiagonal n) (hq : q ∈ antidiagonal n) :
    p = q ↔ p.2 = q.2

{A : Type u_1}
[AddCancelCommMonoid A]
[Finset.HasAntidiagonal A]
{p q : A × A}
{n : A}
(hp : p ∈ Finset.antidiagonal n)
(hq : q ∈ Finset.antidiagonal n)


theorem image : f '' spectrum S a = spectrum R a

{R : Type u_3}
{S : Type u_4}
{A : Type u_5}
[Semifield R]
[Semifield S]
[Ring A]
[Algebra R S]
[Algebra R A]
[Algebra S A]
{a : A}
{f : S → R}
[IsScalarTower R S A]
(h : SpectrumRestricts a f)


/-- Taking a product over `univ.pi t` is the same as taking the product over `Fintype.piFinset t`.
`univ.pi t` and `Fintype.piFinset t` are essentially the same `Finset`, but differ
in the type of their element, `univ.pi t` is a `Finset (Π a ∈ univ, t a)` and
`Fintype.piFinset t` is a `Finset (Π a, t a)`. -/
@[to_additive "Taking a sum over `univ.pi t` is the same as taking the sum over
`Fintype.piFinset t`. `univ.pi t` and `Fintype.piFinset t` are essentially the same `Finset`,
but differ in the type of their element, `univ.pi t` is a `Finset (Π a ∈ univ, t a)` and
`Fintype.piFinset t` is a `Finset (Π a, t a)`."]
lemma prod_univ_pi [DecidableEq ι] [Fintype ι] {κ : ι → Type*} (t : ∀ i, Finset (κ i))
    (f : (∀ i ∈ (univ : Finset ι), κ i) → β) :
    ∏ x ∈ univ.pi t, f x = ∏ x ∈ Fintype.piFinset t, f fun a _ ↦ x a

(f : ((i : ι) → i ∈ Finset.univ → κ i) → β)

∏ x ∈ Finset.univ.pi t, f x = ∏ x ∈ Fintype.piFinset t, f fun a x_1 => x a


/-- In a complete space, a function is integrable if and only if its integral sums form a Cauchy
net. Here we restate this fact in terms of `∀ ε > 0, ∃ r, ...`. -/
theorem integrable_iff_cauchy_basis [CompleteSpace F] : Integrable I l f vol ↔
    ∀ ε > (0 : ℝ), ∃ r : ℝ≥0 → ℝⁿ → Ioi (0 : ℝ), (∀ c, l.RCond (r c)) ∧
      ∀ c₁ c₂ π₁ π₂, l.MemBaseSet I c₁ (r c₁) π₁ → π₁.IsPartition → l.MemBaseSet I c₂ (r c₂) π₂ →
        π₂.IsPartition → dist (integralSum f vol π₁) (integralSum f vol π₂) ≤ ε

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

BoxIntegral.Integrable I l f vol ↔
  ∀ ε > 0,
    ∃ r,
      (∀ (c : ℝ≥0), l.RCond (r c)) ∧
        ∀ (c₁ c₂ : ℝ≥0) (π₁ π₂ : BoxIntegral.TaggedPrepartition I),
          l.MemBaseSet I c₁ (r c₁) π₁ →
            π₁.IsPartition →
              l.MemBaseSet I c₂ (r c₂) π₂ →
                π₂.IsPartition → dist (BoxIntegral.integralSum f vol π₁) (BoxIntegral.integralSum f vol π₂) ≤ ε


protected theorem add_lt_add_iff_right [CovariantClass α α (swap (· + ·)) (· < ·)]
    [ContravariantClass α α (swap (· + ·)) (· < ·)] (ha : a ≠ ⊥) : b + a < c + a ↔ b < c

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

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


theorem natDegree_finSuccEquiv (f : MvPolynomial (Fin (n + 1)) R) :
    (finSuccEquiv R n f).natDegree = degreeOf 0 f

{R : Type u}
[CommSemiring R]
{n : ℕ}
(f : MvPolynomial (Fin (n + 1)) R)

((MvPolynomial.finSuccEquiv R n) f).natDegree = MvPolynomial.degreeOf 0 f


@[to_additive (attr := simp)]
theorem Homeomorph.coe_mulLeft (a : G) : ⇑(Homeomorph.mulLeft a) = (a * ·)

{G : Type w}
[TopologicalSpace G]
[Group G]
[ContinuousMul G]
(a : G)

⇑(Homeomorph.mulLeft a) = fun x => a * x


/-- If `l : Filter ℂ` is an "exponential comparison filter", then for any complex `a₁`, `a₂` and any
real `b₁ < b₂`, we have `(fun z ↦ z ^ a₁ * exp (b₁ * z)) =o[l] (fun z ↦ z ^ a₂ * exp (b₂ * z))`. -/
theorem isLittleO_cpow_mul_exp {b₁ b₂ : ℝ} (hl : IsExpCmpFilter l) (hb : b₁ < b₂) (a₁ a₂ : ℂ) :
    (fun z => z ^ a₁ * exp (b₁ * z)) =o[l] fun z => z ^ a₂ * exp (b₂ * z)

{l : Filter ℂ}
{b₁ b₂ : ℝ}
(hl : Complex.IsExpCmpFilter l)
(hb : b₁ < b₂)
(a₁ a₂ : ℂ)

(fun z => z ^ a₁ * Complex.exp (↑b₁ * z)) =o[l] fun z => z ^ a₂ * Complex.exp (↑b₂ * z)


@[ext]
theorem ext {f g : α ≃+*o β} (h : ∀ a, f a = g a) : f = g

{α : Type u_2}
{β : Type u_3}
[Mul α]
[Add α]
[LE α]
[Mul β]
[Add β]
[LE β]
{f g : α ≃+*o β}
(h : ∀ (a : α), f a = g a)


@[deprecated map_sum (since := "2023-12-26")]
protected theorem map_sum {ι : Type*} (f : ι → A₁) (s : Finset ι) :
    e (∑ x ∈ s, f x) = ∑ x ∈ s, e (f x)

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Algebra R A₁]
[Algebra R A₂]
(e : A₁ ≃ₐ[R] A₂)
{ι : Type u_1}
(f : ι → A₁)
(s : Finset ι)


/-- In a locally compact space, any integrable function can be approximated by compactly supported
continuous functions, version in terms of `∫`. -/
theorem Integrable.exists_hasCompactSupport_integral_sub_le
    [WeaklyLocallyCompactSpace α] [μ.Regular]
    {f : α → E} (hf : Integrable f μ) {ε : ℝ} (hε : 0 < ε) :
    ∃ g : α → E, HasCompactSupport g ∧ (∫ x, ‖f x - g x‖ ∂μ) ≤ ε ∧
      Continuous g ∧ Integrable g μ

{α : Type u_1}
[TopologicalSpace α]
[NormalSpace α]
[R1Space α]
[MeasurableSpace α]
[BorelSpace α]
{E : Type u_2}
[NormedAddCommGroup E]
{μ : MeasureTheory.Measure α}
[NormedSpace ℝ E]
[WeaklyLocallyCompactSpace α]
[μ.Regular]
{f : α → E}
(hf : MeasureTheory.Integrable f μ)
{ε : ℝ}
(hε : 0 < ε)

∃ g, HasCompactSupport g ∧ ∫ (x : α), ‖f x - g x‖ ∂μ ≤ ε ∧ Continuous g ∧ MeasureTheory.Integrable g μ


@[fun_prop]
theorem DifferentiableWithinAt.clm_comp (hc : DifferentiableWithinAt 𝕜 c s x)
    (hd : DifferentiableWithinAt 𝕜 d s x) :
    DifferentiableWithinAt 𝕜 (fun y => (c y).comp (d y)) s 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}
{s : Set E}
{H : Type u_6}
[NormedAddCommGroup H]
[NormedSpace 𝕜 H]
{c : E → G →L[𝕜] H}
{d : E → F →L[𝕜] G}
(hc : DifferentiableWithinAt 𝕜 c s x)
(hd : DifferentiableWithinAt 𝕜 d s x)


@[to_additive]
theorem prod_sum_elim (s : Finset α) (t : Finset γ) (f : α → β) (g : γ → β) :
    ∏ x ∈ s.disjSum t, Sum.elim f g x = (∏ x ∈ s, f x) * ∏ x ∈ t, g x

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[CommMonoid β]
(s : Finset α)
(t : Finset γ)
(f : α → β)
(g : γ → β)


/-- The algebra isomorphism between multivariable polynomials in a sum of two types,
and multivariable polynomials in one of the types,
with coefficients in multivariable polynomials in the other type.
-/
@[simps!]
def sumAlgEquiv : MvPolynomial (S₁ ⊕ S₂) R ≃ₐ[R] MvPolynomial S₁ (MvPolynomial S₂ R)

(R : Type u)
(S₁ : Type v)
(S₂ : Type w)
[CommSemiring R]
(a : MvPolynomial (S₁ ⊕ S₂) R)

(MvPolynomial.sumAlgEquiv R S₁ S₂) a = (MvPolynomial.sumToIter R S₁ S₂) a


theorem unbounded_ge_univ [LE α] [NoBotOrder α] : Unbounded (· ≥ ·) (@Set.univ α)

Set.Unbounded (fun x x_1 => x ≥ x_1) Set.univ


@[simp]
theorem lift_const {f : Filter α} {g : Filter β} : (f.lift fun _ => g) = g

{α : Type u_1}
{β : Type u_2}
{f : Filter α}
{g : Filter β}


theorem polynomial_comp_attachBound (A : Subalgebra ℝ C(X, ℝ)) (f : A) (g : ℝ[X]) :
    (g.toContinuousMapOn (Set.Icc (-‖f‖) ‖f‖)).comp (f : C(X, ℝ)).attachBound =
      Polynomial.aeval f g

{X : Type u_1}
[TopologicalSpace X]
[CompactSpace X]
(A : Subalgebra ℝ C(X, ℝ))
(f : ↥A)
(g : Polynomial ℝ)

(g.toContinuousMapOn (Set.Icc (-‖f‖) ‖f‖)).comp (↑f).attachBound = ↑((Polynomial.aeval f) g)


@[to_additive]
theorem injective_of_trivial_ker {f : G → H} (hf : IsGroupHom f) (h : ker f = trivial G) :
    Function.Injective f

(h : IsAddGroupHom.ker f = IsAddSubgroup.trivial G)


@[reassoc]
theorem map_rightUnitor (X : C) :
    F.map (ρ_ X).hom = inv (F.μ X (𝟙_ C)) ≫ F.obj X ◁ inv F.ε ≫ (ρ_ (F.obj X)).hom

(F : CategoryTheory.MonoidalFunctor C D)

F.map (CategoryTheory.MonoidalCategory.rightUnitor X).hom =
  CategoryTheory.inv (F.μ X (𝟙_ C)) ≫
    CategoryTheory.MonoidalCategory.whiskerLeft (F.obj X) (CategoryTheory.inv F.ε) ≫
      (CategoryTheory.MonoidalCategory.rightUnitor (F.obj X)).hom


lemma insertNth_rev {α : Type*} (i : Fin (n + 1)) (a : α) (f : Fin n → α) (j : Fin (n + 1)) :
    insertNth (α := fun _ ↦ α) i a f (rev j) = insertNth (α := fun _ ↦ α) i.rev a (f ∘ rev) j

i.insertNth a f j.rev = i.rev.insertNth a (f ∘ Fin.rev) j


lemma map_injective {X Y : C} {f g : X ⟶ Y} (h : F.map f = F.map g) : f = g

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F : CategoryTheory.Functor C D}
(hF : F.FullyFaithful)
{X Y : C}
{f g : X ⟶ Y}
(h : F.map f = F.map g)


/-- When `F` and `F'` are finite fields and `χ : F → F'` is a nontrivial quadratic character,
then `(χ(-1) * #F)^(#F'/2) = χ #F'`. -/
theorem Char.card_pow_card {F : Type*} [Field F] [Fintype F] {F' : Type*} [Field F'] [Fintype F']
    {χ : MulChar F F'} (hχ₁ : χ ≠ 1) (hχ₂ : IsQuadratic χ)
    (hch₁ : ringChar F' ≠ ringChar F) (hch₂ : ringChar F' ≠ 2) :
    (χ (-1) * Fintype.card F) ^ (Fintype.card F' / 2) = χ (Fintype.card F')

{F : Type u_1}
[Field F]
[Fintype F]
{F' : Type u_2}
[Field F']
[Fintype F']
{χ : MulChar F F'}
(hχ₁ : χ ≠ 1)
(hχ₂ : χ.IsQuadratic)
(hch₁ : ringChar F' ≠ ringChar F)
(hch₂ : ringChar F' ≠ 2)

(χ (-1) * ↑(Fintype.card F)) ^ (Fintype.card F' / 2) = χ ↑(Fintype.card F')


@[to_additive (attr := simp)]
theorem prod_val [CommMonoid α] (s : Finset α) : s.1.prod = s.prod id

{α : Type u_3}
[CommMonoid α]
(s : Finset α)


theorem le_succ_iff_eq_or_le : a ≤ succ b ↔ a = succ b ∨ a ≤ b

{α : Type u_1}
[PartialOrder α]
[SuccOrder α]
{a b : α}

a ≤ Order.succ b ↔ a = Order.succ b ∨ a ≤ b


{α : Type u}
[Preorder α]
[OrderTop α]
{a : α}


theorem fix_fwd {f : α →. β ⊕ α} {b : β} {a a' : α} (hb : b ∈ f.fix a) (ha' : Sum.inr a' ∈ f a) :
    b ∈ f.fix a'

{α : Type u_1}
{β : Type u_2}
{f : α →. β ⊕ α}
{b : β}
{a a' : α}
(hb : b ∈ f.fix a)
(ha' : Sum.inr a' ∈ f a)


@[to_additive (attr := simp)]
theorem inv_eq_bot_iff : f⁻¹ = ⊥ ↔ f = ⊥


theorem mfderivWithin_eq (hs : UniqueMDiffWithinAt 𝓘(𝕜, E) s x) :
    mfderivWithin 𝓘(𝕜, E) 𝓘(𝕜, E') f s x = (f : E →L[𝕜] E')

{𝕜 : 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}
(hs : UniqueMDiffWithinAt 𝓘(𝕜, E) s x)

mfderivWithin 𝓘(𝕜, E) 𝓘(𝕜, E') (⇑f) s x = ↑f


theorem Equiv.Perm.fin_5_not_solvable : ¬IsSolvable (Equiv.Perm (Fin 5))


{C : Type u}
[CategoryTheory.Groupoid C]
(D : Set C)

(CategoryTheory.Subgroupoid.full D).objs = D


@[to_additive (attr := measurability)]
protected theorem Measurable.mabs : Measurable fun x ↦ mabs (f x)

{α : Type u_1}
{β : Type u_2}
[Lattice α]
[AddGroup α]
[MeasurableSpace α]
[MeasurableSpace β]
{f : β → α}
(hf : Measurable f)
[MeasurableNeg α]
[MeasurableSup₂ α]


theorem add_apply (m₁ m₂ : OuterMeasure α) (s : Set α) : (m₁ + m₂) s = m₁ s + m₂ s

{α : Type u_1}
(m₁ m₂ : MeasureTheory.OuterMeasure α)
(s : Set α)


lemma toLaurent_reverse (p : R[X]) :
    toLaurent p.reverse = invert (toLaurent p) * (T p.natDegree)

{R : Type u_2}
[CommSemiring R]
(p : R[X])

Polynomial.toLaurent p.reverse = LaurentPolynomial.invert (Polynomial.toLaurent p) * LaurentPolynomial.T ↑p.natDegree


@[simp]
theorem coe_forget_to_partOrd (X : SemilatInfCat) :
    ↥((forget₂ SemilatInfCat PartOrd).obj X) = ↥X

↑((CategoryTheory.forget₂ SemilatInfCat PartOrd).obj X) = X.X


/-- `Prod.fst` as an `OrderHom`. -/
@[simps]
def fst : α × β →o α

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
(self : α × β)


/-- If a monoid's only unit is `1`, then it is isomorphic to its associates. -/
@[simps]
def associatesEquivOfUniqueUnits : Associates α ≃* α

{α : Type u_1}
[CancelCommMonoidWithZero α]
[Unique αˣ]

∀ (a : Associates α), associatesEquivOfUniqueUnits a = a.out


@[simp]
theorem sin_coe (x : ℝ) : sin (x : Angle) = Real.sin x


lemma coeff_list_sum (l : List R[X]) (n : ℕ) :
    l.sum.coeff n = (l.map (lcoeff R n)).sum

{R : Type u}
[Semiring R]
(l : List R[X])
(n : ℕ)

l.sum.coeff n = (List.map (⇑(Polynomial.lcoeff R n)) l).sum


theorem normal_of_all_max_subgroups_normal [Finite G]
    (hnc : ∀ H : Subgroup G, IsCoatom H → H.Normal) {p : ℕ} [Fact p.Prime] [Finite (Sylow p G)]
    (P : Sylow p G) : (↑P : Subgroup G).Normal

(hnc : ∀ (H : Subgroup G), IsCoatom H → H.Normal)


theorem IsLowerSet.nonMemberSubfamily (h : IsLowerSet (𝒜 : Set (Finset α))) :
    IsLowerSet (𝒜.nonMemberSubfamily a : Set (Finset α))

{α : Type u_1}
[DecidableEq α]
{𝒜 : Finset (Finset α)}
{a : α}
(h : IsLowerSet ↑𝒜)

IsLowerSet ↑(Finset.nonMemberSubfamily a 𝒜)


theorem image₂_union_left [DecidableEq α] : image₂ f (s ∪ s') t = image₂ f s t ∪ image₂ f s' t

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

Finset.image₂ f (s ∪ s') t = Finset.image₂ f s t ∪ Finset.image₂ f s' t


theorem isUnit_exp (x : 𝔸) : IsUnit (exp 𝕂 x)

(𝕂 : Type u_1)
{𝔸 : Type u_2}
[RCLike 𝕂]
[NormedRing 𝔸]
[NormedAlgebra 𝕂 𝔸]
[CompleteSpace 𝔸]
(x : 𝔸)


/-- A uniform embedding from a uniform space to a metric space is an isometry with respect to the
induced metric space structure on the source space. -/
theorem UniformEmbedding.to_isometry {α β} [UniformSpace α] [MetricSpace β] {f : α → β}
    (h : UniformEmbedding f) : (letI := h.comapMetricSpace f; Isometry f)

{α : Type u_2}
{β : Type u_3}
[UniformSpace α]
[MetricSpace β]
{f : α → β}
(h : UniformEmbedding f)


/-- Let `f` be a function continuous on a convex (or, equivalently, connected) subset `D`
of the real line. If `f` is differentiable on the interior of `D` and `f'` is positive, then
`f` is a strictly monotone function on `D`.
Note that we don't require differentiability explicitly as it already implied by the derivative
being strictly positive. -/
theorem strictMonoOn_of_deriv_pos {D : Set ℝ} (hD : Convex ℝ D) {f : ℝ → ℝ}
    (hf : ContinuousOn f D) (hf' : ∀ x ∈ interior D, 0 < deriv f x) : StrictMonoOn f D


protected lemma mul_dvd_mul_left (a : ℤ) (h : b ∣ c) : a * b ∣ a * c


@[simp]
theorem constVAdd_zero : constVAdd k P₁ 0 = AffineEquiv.refl _ _

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

AffineEquiv.constVAdd k P₁ 0 = AffineEquiv.refl k P₁


lemma cast_injective : Injective (Int.cast : ℤ → α)

{α : Type u_3}
[AddGroupWithOne α]
[CharZero α]


/-- Prop-valued mixin for an ordered topological space to be
The upper set topology is the topology where the open sets are the upper sets. In general the upper
set topology does not coincide with the upper topology.
-/
protected class IsUpperSet (α : Type*) [t : TopologicalSpace α] [Preorder α] : Prop where
  topology_eq_upperSetTopology : t = upperSet α

{α : Type u_4}
[t : TopologicalSpace α]
[Preorder α]
[self : Topology.IsUpperSet α]


theorem prod_nhdsSet_le_of_disjoint_cocompact {f : Filter X} (ht : IsCompact t)
    (hf : Disjoint f (Filter.cocompact X)) :
    f ×ˢ 𝓝ˢ t ≤ 𝓝ˢ (Set.univ ×ˢ t)

{X : Type u}
[TopologicalSpace X]
{t : Set X}
{f : Filter X}
(ht : IsCompact t)
(hf : Disjoint f (Filter.cocompact X))


@[reassoc (attr := simp)]
theorem imageSubobject_arrow :
    (imageSubobjectIso f).hom ≫ image.ι f = (imageSubobject f).arrow

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

(CategoryTheory.Limits.imageSubobjectIso f).hom ≫ CategoryTheory.Limits.image.ι f =
  (CategoryTheory.Limits.imageSubobject f).arrow


@[to_additive (attr := simp) top_prod_top]
theorem top_prod_top : (⊤ : Subsemigroup M).prod (⊤ : Subsemigroup N) = ⊤

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]


theorem coeHom_injective : Function.Injective (@coeHom Γ k)


protected theorem add_lt_add_iff_left (a : Int) : a + b < a + c ↔ b < c


@[simp]
theorem smallSets_principal (s : Set α) : (𝓟 s).smallSets = 𝓟 (𝒫 s)


theorem Finite.toFinset_vsub (hs : s.Finite) (ht : t.Finite) (hf := hs.vsub ht) :
    hf.toFinset = hs.toFinset -ᵥ ht.toFinset

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[VSub α β]
{s t : Set β}
(hs : s.Finite)
(ht : t.Finite)
(hf : (s -ᵥ t).Finite := ⋯)

Set.Finite.toFinset hf = hs.toFinset -ᵥ ht.toFinset


@[mono]
theorem log_mono_right {b n m : ℕ} (h : n ≤ m) : log b n ≤ log b m


theorem integral_cos_mul_cos_pow_aux (hn : 2 ≤ n) (hz : z ≠ 0) :
    (∫ x in (0 : ℝ)..π / 2, Complex.cos (2 * z * x) * (cos x : ℂ) ^ n) =
      n / (2 * z) *
        ∫ x in (0 : ℝ)..π / 2, Complex.sin (2 * z * x) * sin x * (cos x : ℂ) ^ (n - 1)

∫ (x : ℝ) in 0 ..π / 2, Complex.cos (2 * z * ↑x) * ↑(Real.cos x) ^ n =
  ↑n / (2 * z) * ∫ (x : ℝ) in 0 ..π / 2, Complex.sin (2 * z * ↑x) * ↑(Real.sin x) * ↑(Real.cos x) ^ (n - 1)


@[to_additive]
theorem MonoidHomClass.lipschitz_of_bound_nnnorm [MonoidHomClass 𝓕 E F] (f : 𝓕) (C : ℝ≥0)
    (h : ∀ x, ‖f x‖₊ ≤ C * ‖x‖₊) : LipschitzWith C f

{𝓕 : Type u_1}
{E : Type u_3}
{F : Type u_4}
[SeminormedGroup E]
[SeminormedGroup F]
[FunLike 𝓕 E F]
[MonoidHomClass 𝓕 E F]
(f : 𝓕)
(C : ℝ≥0)
(h : ∀ (x : E), ‖f x‖₊ ≤ C * ‖x‖₊)


/-- If `gcd a (m * n) ≠ 1`, then `gcd a m ≠ 1` or `gcd a n ≠ 1`. -/
theorem gcd_ne_one_iff_gcd_mul_right_ne_one {a : ℤ} {m n : ℕ} :
    a.gcd (m * n) ≠ 1 ↔ a.gcd m ≠ 1 ∨ a.gcd n ≠ 1

a.gcd (↑m * ↑n) ≠ 1 ↔ a.gcd ↑m ≠ 1 ∨ a.gcd ↑n ≠ 1


theorem coeff_one [DecidableEq σ] : coeff R n (1 : MvPowerSeries σ R) = if n = 0 then 1 else 0

{σ : Type u_1}
{R : Type u_2}
[Semiring R]
(n : σ →₀ ℕ)
[DecidableEq σ]

(MvPowerSeries.coeff R n) 1 = if n = 0 then 1 else 0


private theorem Sum.dist_comm (x y : X ⊕ Y) : Sum.dist x y = Sum.dist y x

{X : Type u}
{Y : Type v}
[MetricSpace X]
[MetricSpace Y]
(x y : X ⊕ Y)

Metric.Sum.dist x y = Metric.Sum.dist y x


@[mono]
theorem EventuallyLE.union {s t s' t' : Set α} {l : Filter α} (h : s ≤ᶠ[l] t) (h' : s' ≤ᶠ[l] t') :
    (s ∪ s' : Set α) ≤ᶠ[l] (t ∪ t' : Set α)

{α : Type u}
{s t s' t' : Set α}
{l : Filter α}
(h : s ≤ᶠ[l] t)
(h' : s' ≤ᶠ[l] t')


@[simp]
theorem mem_comap {s : Subring S} {f : R →+* S} {x : R} : x ∈ s.comap f ↔ f x ∈ s

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
{s : Subring S}
{f : R →+* S}
{x : R}


theorem definable_finset_sup {ι : Type*} {f : ι → Set (α → M)} (hf : ∀ i, A.Definable L (f i))
    (s : Finset ι) : A.Definable L (s.sup f)

{M : Type w}
{A : Set M}
{L : FirstOrder.Language}
[L.Structure M]
{α : Type u₁}
{ι : Type u_2}
{f : ι → Set (α → M)}
(hf : ∀ (i : ι), A.Definable L (f i))
(s : Finset ι)


/-- If `x` is a fixed point of `f` and `g`, then it is a fixed point of `f ∘ g`. -/
protected theorem comp (hf : IsFixedPt f x) (hg : IsFixedPt g x) : IsFixedPt (f ∘ g) x

{α : Type u}
{f g : α → α}
{x : α}
(hf : Function.IsFixedPt f x)
(hg : Function.IsFixedPt g x)


/-- Commutative monoid objects in `C` are "just" braided lax monoidal functors from the trivial
braided monoidal category to `C`.
-/
@[simps]
def equivLaxBraidedFunctorPUnit : LaxBraidedFunctor (Discrete PUnit.{u + 1}) C ≌ CommMon_ C

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

(CommMon_.equivLaxBraidedFunctorPUnit C).inverse = CommMon_.EquivLaxBraidedFunctorPUnit.commMonToLaxBraided C


@[simp]
theorem natTrailingDegree_C (a : R) : natTrailingDegree (C a) = 0


theorem coe_to_lieModuleHom (e : M ≃ₗ⁅R,L⁆ N) : ⇑(e : M →ₗ⁅R,L⁆ N) = e

{R : Type u}
{L : Type v}
{M : Type w}
{N : Type w₁}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
[LieRingModule L M]
[LieRingModule L N]
(e : M ≃ₗ⁅R,L⁆ N)


theorem derivedSeries_map_le (k : ℕ) : (derivedSeries R L' k).map f ≤ derivedSeries R L k

{R : Type u}
{L : Type v}
{L' : Type w₁}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieRing L']
[LieAlgebra R L']
{f : L' →ₗ⁅R⁆ L}
(k : ℕ)

LieIdeal.map f (LieAlgebra.derivedSeries R L' k) ≤ LieAlgebra.derivedSeries R L k


@[simp]
theorem image_mul_const_uIcc (a b c : α) : (· * a) '' [[b, c]] = [[b * a, c * a]]

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


@[simp]
theorem kroneckerMap_apply (f : α → β → γ) (A : Matrix l m α) (B : Matrix n p β) (i j) :
    kroneckerMap f A B i j = f (A i.1 j.1) (B i.2 j.2)

{α : Type u_2}
{β : Type u_4}
{γ : Type u_6}
{l : Type u_8}
{m : Type u_9}
{n : Type u_10}
{p : Type u_11}
(f : α → β → γ)
(A : Matrix l m α)
(B : Matrix n p β)
(i : l × n)
(j : m × p)

Matrix.kroneckerMap f A B i j = f (A i.1 j.1) (B i.2 j.2)


@[simp, mfld_simps]
theorem symm_apply_mk_proj (ex : x ∈ e.source) : e.toPartialHomeomorph.symm (proj x, (e x).2) = x

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
{proj : Z → B}
[TopologicalSpace Z]
(e : Trivialization F proj)
{x : Z}
(ex : x ∈ e.source)


theorem span_singleton_inf_orthogonal_eq_bot (B : V₁ →ₛₗ[J₁] V₁ →ₛₗ[J₁'] V₂) (x : V₁)
    (hx : ¬B.IsOrtho x x) : (K₁ ∙ x) ⊓ Submodule.orthogonalBilin (K₁ ∙ x) B = ⊥

{K : Type u_13}
{K₁ : Type u_14}
{V₁ : Type u_17}
{V₂ : Type u_18}
[Field K]
[Field K₁]
[AddCommGroup V₁]
[Module K₁ V₁]
[AddCommGroup V₂]
[Module K V₂]
{J₁ J₁' : K₁ →+* K}
(B : V₁ →ₛₗ[J₁] V₁ →ₛₗ[J₁'] V₂)
(x : V₁)
(hx : ¬B.IsOrtho x x)

Submodule.span K₁ {x} ⊓ (Submodule.span K₁ {x}).orthogonalBilin B = ⊥


lemma baseChange_negPolynomial :
    (W.baseChange B).toAffine.negPolynomial =
      (W.baseChange A).toAffine.negPolynomial.map (mapRingHom f)

{R : Type r}
[CommRing R]
(W : WeierstrassCurve.Affine R)
{S : Type s}
[CommRing S]
[Algebra R S]
{A : Type u}
[CommRing A]
[Algebra R A]
[Algebra S A]
[IsScalarTower R S A]
{B : Type v}
[CommRing B]
[Algebra R B]
[Algebra S B]
[IsScalarTower R S B]
(f : A →ₐ[S] B)

(WeierstrassCurve.baseChange W B).toAffine.negPolynomial =
  Polynomial.map (Polynomial.mapRingHom ↑f) (WeierstrassCurve.baseChange W A).toAffine.negPolynomial


@[deprecated div_mul_cancel_right₀ (since := "2024-03-20")]
lemma div_mul_left (hb : b ≠ 0) : b / (a * b) = 1 / a

{G₀ : Type u_3}
[GroupWithZero G₀]
{a b : G₀}
(hb : b ≠ 0)


@[simp]
theorem map_ofLE (cond : LEComap f A B) (h : A' ≤ A) (c : A') :
    map f cond (ofLE h c) = map f (cond.mono h le_rfl) c

{X : Type u_2}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : C(X, Y)}
{A A' : DiscreteQuotient X}
{B : DiscreteQuotient Y}
(cond : DiscreteQuotient.LEComap f A B)
(h : A' ≤ A)
(c : Quotient A'.toSetoid)

DiscreteQuotient.map f cond (DiscreteQuotient.ofLE h c) = DiscreteQuotient.map f ⋯ c


/-- **Tonelli's Theorem**: For `ℝ≥0∞`-valued measurable functions on `α × β`,
  the integral of `f` is equal to the iterated integral. -/
theorem lintegral_prod_of_measurable :
    ∀ (f : α × β → ℝ≥0∞), Measurable f → ∫⁻ z, f z ∂μ.prod ν = ∫⁻ x, ∫⁻ y, f (x, y) ∂ν ∂μ

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

Measurable f → ∫⁻ (z : α × β), f z ∂μ.prod ν = ∫⁻ (x : α), ∫⁻ (y : β), f (x, y) ∂ν ∂μ


theorem copy_eq (S : StarSubalgebra R A) (s : Set A) (hs : s = ↑S) : S.copy s hs = S

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[StarRing A]
[Algebra R A]
[StarModule R A]
(S : StarSubalgebra R A)
(s : Set A)
(hs : s = ↑S)


protected theorem le_total (a b : Fin n) : a ≤ b ∨ b ≤ a


@[simp]
theorem sInf_toSubmonoid (s : Set (Subsemiring R)) :
    (sInf s).toSubmonoid = ⨅ t ∈ s, Subsemiring.toSubmonoid t

{R : Type u}
[NonAssocSemiring R]
(s : Set (Subsemiring R))

(sInf s).toSubmonoid = ⨅ t ∈ s, t.toSubmonoid


theorem mem_sum {f : α → Multiset β} (s : Finset α) (b : β) :
    (b ∈ ∑ x ∈ s, f x) ↔ ∃ a ∈ s, b ∈ f a

{α : Type u_3}
{β : Type u_4}
{f : α → Multiset β}
(s : Finset α)
(b : β)


lemma addX_of_Z_ne_zero {P Q : Fin 3 → F} (hP : W.Equation P) (hQ : W.Equation Q) (hPz : P z ≠ 0)
    (hQz : Q z ≠ 0) (hx : P x * Q z ^ 2 ≠ Q x * P z ^ 2) :
    W.addX P Q / addZ P Q ^ 2 = W.toAffine.addX (P x / P z ^ 2) (Q x / Q z ^ 2)
      (W.toAffine.slope (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3) (Q y / Q z ^ 3))

{F : Type v}
[Field F]
{W : WeierstrassCurve.Jacobian F}
{P Q : Fin 3 → F}
(hP : W.Equation P)
(hQ : W.Equation Q)
(hPz : P z ≠ 0)
(hQz : Q z ≠ 0)
(hx : P x * Q z ^ 2 ≠ Q x * P z ^ 2)

W.addX P Q / WeierstrassCurve.Jacobian.addZ P Q ^ 2 =
  W.toAffine.addX (P x / P z ^ 2) (Q x / Q z ^ 2)
    (W.toAffine.slope (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3) (Q y / Q z ^ 3))


theorem cfcHom_comp [UniqueContinuousFunctionalCalculus R A] (f : C(spectrum R a, R))
    (f' : C(spectrum R a, spectrum R (cfcHom ha f)))
    (hff' : ∀ x, f x = f' x) (g : C(spectrum R (cfcHom ha f), R)) :
    cfcHom ha (g.comp f') = cfcHom (cfcHom_predicate ha f) g

(f' : C(↑(spectrum R a), ↑(spectrum R ((cfcHom ha) f))))

(hff' : ∀ (x : ↑(spectrum R a)), f x = ↑(f' x))

(g : C(↑(spectrum R ((cfcHom ha) f)), R))


@[to_additive card_nsmul_le_sum]
theorem pow_card_le_prod (s : Finset ι) (f : ι → N) (n : N) (h : ∀ x ∈ s, n ≤ f x) :
    n ^ s.card ≤ s.prod f

{ι : Type u_1}
{N : Type u_5}
[OrderedCommMonoid N]
(s : Finset ι)
(f : ι → N)
(n : N)
(h : ∀ x ∈ s, n ≤ f x)


@[simp]
theorem ofPrime_idealOfLE (R S : ValuationSubring K) (h : R ≤ S) :
    ofPrime R (idealOfLE R S h) = S

{K : Type u}
[Field K]
(R S : ValuationSubring K)
(h : R ≤ S)


theorem inv_def (e : X ≃ᵈ X) : e⁻¹ = e.symm

{X : Type u_1}
[PseudoEMetricSpace X]
(e : X ≃ᵈ X)


lemma mul_delta {f : ℕ → ℂ} (h : f 1 = 1) : f * δ = δ


/-- If no element satisfies `p` in the list `xs`, then `xs.splitOnP p = [xs]` -/
theorem splitOnP_eq_single (h : ∀ x ∈ xs, ¬p x) : xs.splitOnP p = [xs]

{α : Type u}
(p : α → Bool)
(xs : List α)
(h : ∀ (x : α), x ∈ xs → ¬p x = true)


@[to_additive]
theorem Group.rank_le_of_surjective [Group.FG G] [Group.FG G'] (f : G →* G')
    (hf : Function.Surjective f) : Group.rank G' ≤ Group.rank G

{G : Type u_3}
[Group G]
{G' : Type u_5}
[Group G']
[Group.FG G]
[Group.FG G']
(f : G →* G')
(hf : Function.Surjective ⇑f)


theorem notConvergentSeq_measurableSet [Preorder ι] [Countable ι]
    (hf : ∀ n, StronglyMeasurable[m] (f n)) (hg : StronglyMeasurable g) :
    MeasurableSet (notConvergentSeq f g n j)

{f : ι → α → β}

(hf : ∀ (n : ι), MeasureTheory.StronglyMeasurable (f n))

(hg : MeasureTheory.StronglyMeasurable g)

MeasurableSet (MeasureTheory.Egorov.notConvergentSeq f g n j)


theorem logb_lt_logb_of_base_lt_one (hx : 0 < x) (hxy : x < y) : logb b y < logb b x


/-- Theorem of bark and tree: if a set is within a preconnected set and its closure, then it is
preconnected as well. See also `IsConnected.subset_closure`. -/
protected theorem IsPreconnected.subset_closure {s : Set α} {t : Set α} (H : IsPreconnected s)
    (Kst : s ⊆ t) (Ktcs : t ⊆ closure s) : IsPreconnected t

{α : Type u}
[TopologicalSpace α]
{s t : Set α}
(H : IsPreconnected s)
(Kst : s ⊆ t)
(Ktcs : t ⊆ closure s)


theorem isIso_of_comp_hom_eq_id (g : X ⟶ Y) [IsIso g] {f : Y ⟶ X} (h : f ≫ g = 𝟙 Y) : IsIso f

(h : CategoryTheory.CategoryStruct.comp f g = CategoryTheory.CategoryStruct.id Y)


/-- A more general version of `finprod_mem_union_inter` that requires `s ∩ mulSupport f` and
`t ∩ mulSupport f` rather than `s` and `t` to be finite. -/
@[to_additive
      "A more general version of `finsum_mem_union_inter` that requires `s ∩ support f` and
      `t ∩ support f` rather than `s` and `t` to be finite."]
theorem finprod_mem_union_inter' (hs : (s ∩ mulSupport f).Finite) (ht : (t ∩ mulSupport f).Finite) :
    ((∏ᶠ i ∈ s ∪ t, f i) * ∏ᶠ i ∈ s ∩ t, f i) = (∏ᶠ i ∈ s, f i) * ∏ᶠ i ∈ t, f i

(hs : (s ∩ Function.mulSupport f).Finite)

(ht : (t ∩ Function.mulSupport f).Finite)

(∏ᶠ (i : α) (_ : i ∈ s ∪ t), f i) * ∏ᶠ (i : α) (_ : i ∈ s ∩ t), f i =
  (∏ᶠ (i : α) (_ : i ∈ s), f i) * ∏ᶠ (i : α) (_ : i ∈ t), f i


lemma exact₃ : (ShortComplex.mk _ _ (comp_δ T hT n₀ n₁ h)).Exact

(T : CategoryTheory.Pretriangulated.Triangle (DerivedCategory C))

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

(CategoryTheory.ShortComplex.mk ((DerivedCategory.homologyFunctor C n₀).map T.mor₂)
    (DerivedCategory.HomologySequence.δ T n₀ n₁ h) ⋯).Exact


@[simp,nolint simpNF]
theorem SetLike.coe_gnpow {S : Type*} [SetLike S R] [Monoid R] [AddMonoid ι] (A : ι → S)
    [SetLike.GradedMonoid A] {i : ι} (x : A i) (n : ℕ) :
    ↑(@GradedMonoid.GMonoid.gnpow _ (fun i => A i) _ _ n _ x) = (x:R)^n

{ι : Type u_1}
{R : Type u_2}
{S : Type u_3}
[SetLike S R]
[Monoid R]
[AddMonoid ι]
(A : ι → S)
[SetLike.GradedMonoid A]
{i : ι}
(x : ↥(A i))
(n : ℕ)

↑(GradedMonoid.GMonoid.gnpow n x) = ↑x ^ n


@[to_additive]
theorem coe_sSup_of_directed_on {S : Set (Subsemigroup M)} (hS : DirectedOn (· ≤ ·) S) :
    (↑(sSup S) : Set M) = ⋃ s ∈ S, ↑s

(hS : DirectedOn (fun x x_1 => x ≤ x_1) S)


/-- Equal characteristic implies not mixed characteristic. -/
theorem to_not_mixedCharZero (h : ∀ I : Ideal R, I ≠ ⊤ → CharZero (R ⧸ I)) :
    ∀ p > 0, ¬MixedCharZero R p

(h : ∀ (I : Ideal R), I ≠ ⊤ → CharZero (R ⧸ I))


theorem Independent.setIndependent_range (ht : Independent t) : SetIndependent <| range t

{α : Type u_1}
{ι : Type u_3}
[CompleteLattice α]
{t : ι → α}
(ht : CompleteLattice.Independent t)


lemma AbsolutelyContinuous.restrict (h : μ ≪ ν) (s : Set α) : μ.restrict s ≪ ν.restrict s

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
(h : μ ≪ ν)
(s : Set α)


@[simp]
theorem finsuppTensorFinsuppLid_single_tmul_single (a : ι) (b : κ) (r : R) (n : N) :
    finsuppTensorFinsuppLid R N ι κ (Finsupp.single a r ⊗ₜ[R] Finsupp.single b n) =
      Finsupp.single (a, b) (r • n)

(R : Type u_1)
(N : Type u_4)
(ι : Type u_5)
(κ : Type u_6)
[CommSemiring R]
[AddCommMonoid N]
[Module R N]
(a : ι)
(b : κ)
(r : R)
(n : N)

(finsuppTensorFinsuppLid R N ι κ) (Finsupp.single a r ⊗ₜ[R] Finsupp.single b n) = Finsupp.single (a, b) (r • n)


theorem AddHom.le_map_tsub [Preorder β] [Add β] [Sub β] [OrderedSub β] (f : AddHom α β)
    (hf : Monotone f) (a b : α) : f a - f b ≤ f (a - b)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Add α]
[Sub α]
[OrderedSub α]
[Preorder β]
[Add β]
[Sub β]
[OrderedSub β]
(f : AddHom α β)
(hf : Monotone ⇑f)
(a b : α)


@[to_additive]
theorem closedEmbedding_mk_symm : ClosedEmbedding (@mk M).symm


theorem arccos_nonneg (x : ℝ) : 0 ≤ arccos x


theorem ContDiffAt.iteratedFDeriv_right {i : ℕ} (hf : ContDiffAt 𝕜 n f x₀)
    (hmn : (m + i : ℕ∞) ≤ n) : ContDiffAt 𝕜 m (iteratedFDeriv 𝕜 i f) x₀

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x₀ : E}
{m n : ℕ∞}
{i : ℕ}
(hf : ContDiffAt 𝕜 n f x₀)
(hmn : m + ↑i ≤ n)


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

{X : Type u}
[self : TopologicalSpace X]
(s t : Set X)

TopologicalSpace.IsOpen s → TopologicalSpace.IsOpen t → TopologicalSpace.IsOpen (s ∩ t)


theorem _root_.MeasureTheory.Integrable.integral_condDistrib_map
    (hY : AEMeasurable Y μ) (hf_int : Integrable f (μ.map fun a => (X a, Y a))) :
    Integrable (fun x => ∫ y, f (x, y) ∂condDistrib Y X μ x) (μ.map X)

(hf_int : MeasureTheory.Integrable f (MeasureTheory.Measure.map (fun a => (X a, Y a)) μ))

MeasureTheory.Integrable (fun x => ∫ (y : Ω), f (x, y) ∂(ProbabilityTheory.condDistrib Y X μ) x)
  (MeasureTheory.Measure.map X μ)


/-- Prime avoidance. Atiyah-Macdonald 1.11, Eisenbud 3.3, Stacks 00DS, Matsumura Ex.1.6. -/
theorem subset_union_prime {R : Type u} [CommRing R] {s : Finset ι} {f : ι → Ideal R} (a b : ι)
    (hp : ∀ i ∈ s, i ≠ a → i ≠ b → IsPrime (f i)) {I : Ideal R} :
    ((I : Set R) ⊆ ⋃ i ∈ (↑s : Set ι), f i) ↔ ∃ i ∈ s, I ≤ f i

(hp : ∀ i ∈ s, i ≠ a → i ≠ b → (f i).IsPrime)

↑I ⊆ ⋃ i ∈ ↑s, ↑(f i) ↔ ∃ i ∈ s, I ≤ f i


protected theorem Periodic.const_mul [DivisionSemiring α] (h : Periodic f c) (a : α) :
    Periodic (fun x => f (a * x)) (a⁻¹ * c)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c : α}
[DivisionSemiring α]
(h : Function.Periodic f c)
(a : α)

Function.Periodic (fun x => f (a * x)) (a⁻¹ * c)


theorem IsBigOWith.pow' {f : α → R} {g : α → 𝕜} (h : IsBigOWith c l f g) :
    ∀ n : ℕ, IsBigOWith (Nat.casesOn n ‖(1 : R)‖ fun n => c ^ (n + 1))
      l (fun x => f x ^ n) fun x => g x ^ n

{α : Type u_1}
{R : Type u_13}
{𝕜 : Type u_15}
[SeminormedRing R]
[NormedDivisionRing 𝕜]
{c : ℝ}
{l : Filter α}
{f : α → R}
{g : α → 𝕜}
(h : Asymptotics.IsBigOWith c l f g)
(n : ℕ)

Asymptotics.IsBigOWith (Nat.casesOn n ‖1‖ fun n => c ^ (n + 1)) l (fun x => f x ^ n) fun x => g x ^ n


/-- The expression `fun g m ↦ g (f m)` as a `MonoidHom`.
Equivalently, `(fun g ↦ MonoidHom.comp g f)` as a `MonoidHom`. -/
@[to_additive (attr := simps!)
      "The expression `fun g m ↦ g (f m)` as an `AddMonoidHom`.
      Equivalently, `(fun g ↦ AddMonoidHom.comp g f)` as an `AddMonoidHom`.

      This also exists in a `LinearMap` version, `LinearMap.lcomp`."]
def compHom' [MulOneClass M] [MulOneClass N] [CommMonoid P] (f : M →* N) : (N →* P) →* M →* P

{M : Type uM}
{N : Type uN}
{P : Type uP}
[MulOneClass M]
[MulOneClass N]
[CommMonoid P]
(f : M →* N)
(y : N →* P)
(x : M)


theorem Icc_eq_finset_map :
    Icc a b =
      (Finset.range (b + 1 - a).toNat).map (Nat.castEmbedding.trans <| addLeftEmbedding a)

Finset.Icc a b = Finset.map (Nat.castEmbedding.trans (addLeftEmbedding a)) (Finset.range (b + 1 - a).toNat)


theorem norm_I_of_ne_zero (hI : (I : K) ≠ 0) : ‖(I : K)‖ = 1

{K : Type u_1}
[RCLike K]
(hI : RCLike.I ≠ 0)


@[to_additive]
theorem mul_subset_iff : s * t ⊆ u ↔ ∀ x ∈ s, ∀ y ∈ t, x * y ∈ u


@[simp]
theorem mulIsInitial_inv (X : C) [HasBinaryProduct X I] (hI : IsInitial I) :
    (mulIsInitial X hI).inv = hI.to _

(hI : CategoryTheory.Limits.IsInitial I)

(CategoryTheory.Limits.mulIsInitial X hI).inv = hI.to (X ⨯ I)


@[simp]
theorem ret_bind (a : α) (f : α → Seq1 β) : bind (ret a) f = f a

{α : Type u}
{β : Type v}
(a : α)
(f : α → Stream'.Seq1 β)


@[simp] theorem toFun_eq_coe (f : α →o β) : f.toFun = f

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
(f : α →o β)


protected theorem extension_property (h : Module.Baer R Q)
    (f : M →ₗ[R] N) (hf : Function.Injective f) (g : M →ₗ[R] Q) : ∃ h, h ∘ₗ f = g

{R : Type u}
[Ring R]
{Q : Type v}
[AddCommGroup Q]
[Module R Q]
{M : Type u_1}
{N : Type u_2}
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
(h : Module.Baer R Q)
(f : M →ₗ[R] N)
(hf : Function.Injective ⇑f)
(g : M →ₗ[R] Q)


theorem closure_sUnion (s : Set (Set R)) : closure (⋃₀ s) = ⨆ t ∈ s, closure t

{R : Type u}
[NonAssocSemiring R]
(s : Set (Set R))

Subsemiring.closure (⋃₀ s) = ⨆ t ∈ s, Subsemiring.closure t


/-- A continuous and adapted process is progressively measurable. -/
theorem Adapted.progMeasurable_of_continuous [TopologicalSpace ι] [MetrizableSpace ι]
    [SecondCountableTopology ι] [MeasurableSpace ι] [OpensMeasurableSpace ι]
    [PseudoMetrizableSpace β] (h : Adapted f u) (hu_cont : ∀ ω, Continuous fun i => u i ω) :
    ProgMeasurable f u

{u : ι → Ω → β}

(hu_cont : ∀ (ω : Ω), Continuous fun i => u i ω)


theorem Fin.univ_image_get' [DecidableEq β] (l : List α) (f : α → β) :
    Finset.univ.image (f <| l.get ·) = (l.map f).toFinset

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
(l : List α)
(f : α → β)

Finset.image (fun x => f (l.get x)) Finset.univ = (List.map f l).toFinset


@[simp]
theorem SL_reduction_mod_hom_val (N : ℕ) (γ : SL(2, ℤ)) :
    ∀ i j : Fin 2, (SLMOD(N) γ : Matrix (Fin 2) (Fin 2) (ZMod N)) i j = ((↑ₘγ i j : ℤ) : ZMod N)

↑((Matrix.SpecialLinearGroup.map (Int.castRingHom (ZMod N))) γ) i j = ↑(↑γ i j)


theorem Injective.preimage_surjective (hf : Injective f) : Surjective (preimage f)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
(hf : Function.Injective f)


@[simp]
theorem iInf_eq_iInter (s : ι → Set α) : iInf s = iInter s

{α : Type u}
{ι : Sort v}
(s : ι → Set α)


@[simp] lemma inter_eq_univ : s ∩ t = univ ↔ s = univ ∧ t = univ

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

s ∩ t = Finset.univ ↔ s = Finset.univ ∧ t = Finset.univ


@[simp]
theorem exp_lt_exp {x y : ℝ} : exp x < exp y ↔ x < y


theorem Finset.centerMass_eq_of_sum_1 (hw : ∑ i ∈ t, w i = 1) :
    t.centerMass w z = ∑ i ∈ t, w i • z i

{R : Type u_1}
{E : Type u_3}
{ι : Type u_5}
[LinearOrderedField R]
[AddCommGroup E]
[Module R E]
(t : Finset ι)
{w : ι → R}
(z : ι → E)
(hw : ∑ i ∈ t, w i = 1)


@[simp]
theorem length_rowLens {μ : YoungDiagram} : μ.rowLens.length = μ.colLen 0


theorem nonunits_le : A.nonunits ≤ A.toSubring.toSubmonoid.toSubsemigroup

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


@[simp] theorem coe_castLT (i : Fin m) (h : i.1 < n) : (castLT i h : Nat) = i


lemma exp_neg_llr [SigmaFinite μ] [SigmaFinite ν] (hμν : μ ≪ ν) :
    (fun x ↦ exp (- llr μ ν x)) =ᵐ[μ] fun x ↦ (ν.rnDeriv μ x).toReal

{α : Type u_1}
{mα : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
[MeasureTheory.SigmaFinite μ]
[MeasureTheory.SigmaFinite ν]
(hμν : μ.AbsolutelyContinuous ν)

(fun x => rexp (-MeasureTheory.llr μ ν x)) =ᵐ[μ] fun x => (ν.rnDeriv μ x).toReal


@[simp]
theorem compl_adj (G : SimpleGraph V) (v w : V) : Gᶜ.Adj v w ↔ v ≠ w ∧ ¬G.Adj v w

{V : Type u}
(G : SimpleGraph V)
(v w : V)


@[simp]
theorem norm_const_eq [h : Nonempty α] (b : β) : ‖const α b‖ = ‖b‖

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[SeminormedAddCommGroup β]
[h : Nonempty α]
(b : β)

‖BoundedContinuousFunction.const α b‖ = ‖b‖


theorem IsLinearMap.with_bound {f : E → F} (hf : IsLinearMap 𝕜 f) (M : ℝ)
    (h : ∀ x : E, ‖f x‖ ≤ M * ‖x‖) : IsBoundedLinearMap 𝕜 f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
(hf : IsLinearMap 𝕜 f)
(M : ℝ)
(h : ∀ (x : E), ‖f x‖ ≤ M * ‖x‖)


lemma neg_iff_neg_of_smul_pos [PosSMulMono α β] [SMulPosMono α β] (hab : 0 < a • b) :
    a < 0 ↔ b < 0

{α : Type u_1}
{β : Type u_2}
{a : α}
{b : β}
[Zero α]
[Zero β]
[SMulWithZero α β]
[LinearOrder α]
[LinearOrder β]
[PosSMulMono α β]
[SMulPosMono α β]
(hab : 0 < a • b)


protected theorem surjective : Function.Surjective e

{R : Type u_1}
{S : Type u_7}
{M : Type u_8}
{M₂ : Type u_10}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₂]
{module_M : Module R M}
{module_S_M₂ : Module S M₂}
{σ : R →+* S}
{σ' : S →+* R}
{re₁ : RingHomInvPair σ σ'}
{re₂ : RingHomInvPair σ' σ}
(e : M ≃ₛₗ[σ] M₂)


theorem mem_iSup_of_mem {ι} {b : M} {N : ι → LieSubmodule R L M} (i : ι) (h : b ∈ N i) :
    b ∈ ⨆ i, N i

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
{ι : Sort u_1}
{b : M}
{N : ι → LieSubmodule R L M}
(i : ι)
(h : b ∈ N i)


theorem type_ne_zero_of_nonempty (r) [IsWellOrder α r] [h : Nonempty α] : type r ≠ 0

{α : Type u}
(r : α → α → Prop)
[IsWellOrder α r]
[h : Nonempty α]


/-- A simplified version of `TrivSqZeroExt.liftEquiv` for the commutative case. -/
@[simps! apply symm_apply_coe]
def liftEquivOfComm :
    { f : M →ₗ[R'] A // ∀ x y, f x * f y = 0 } ≃ (tsze R' M →ₐ[R'] A)

{R' : Type u}
{M : Type v}
[CommSemiring R']
[AddCommMonoid M]
[Module R' M]
[Module R'ᵐᵒᵖ M]
[IsCentralScalar R' M]
{A : Type u_2}
[Semiring A]
[Algebra R' A]

∀ (a : tsze R' M →ₐ[R'] A), ↑(TrivSqZeroExt.liftEquivOfComm.symm a) = a.toLinearMap ∘ₗ ↑R' (TrivSqZeroExt.inrHom R' M)


theorem Tendsto.atTop_mul_atBot (hf : Tendsto f l atTop) (hg : Tendsto g l atBot) :
    Tendsto (fun x => f x * g x) l atBot

{α : Type u_3}
{β : Type u_4}
[OrderedRing α]
{l : Filter β}
{f g : β → α}
(hf : Filter.Tendsto f l Filter.atTop)
(hg : Filter.Tendsto g l Filter.atBot)

Filter.Tendsto (fun x => f x * g x) l Filter.atBot


theorem exists_mem_of_length_pos : ∀ {l : List α}, 0 < length l → ∃ a, a ∈ l


@[simp] theorem mem_comap : s ∈ comap m g ↔ ∃ t ∈ g, m ⁻¹' t ⊆ s

{α : Type u}
{β : Type v}
{g : Filter β}
{m : α → β}
{s : Set α}

s ∈ Filter.comap m g ↔ ∃ t ∈ g, m ⁻¹' t ⊆ s


/-- `S.normedMk` agrees with `QuotientAddGroup.mk' S`. -/
@[simp]
theorem normedMk.apply (S : AddSubgroup M) (m : M) : normedMk S m = QuotientAddGroup.mk' S m

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

S.normedMk m = (QuotientAddGroup.mk' S) m


lemma Qh_inverts_quasiIso : (HomotopyCategory.quasiIso C c).IsInvertedBy Qh

(HomotopyCategory.quasiIso C c).IsInvertedBy HomologicalComplexUpToQuasiIso.Qh


@[simp, norm_cast]
theorem cast_div_charZero {k : Type*} [DivisionRing k] [CharZero k] {m n : ℤ} (n_dvd : n ∣ m) :
    ((m / n : ℤ) : k) = m / n

{k : Type u_3}
[DivisionRing k]
[CharZero k]
{m n : ℤ}
(n_dvd : n ∣ m)


theorem isScalarTower_of_injective [SMul R S] [CompatibleSMul M M₂ R S] [IsScalarTower R S M₂]
    (f : M →ₗ[S] M₂) (hf : Function.Injective f) : IsScalarTower R S M

{M : Type u_9}
{M₂ : Type u_11}
[AddCommMonoid M]
[AddCommMonoid M₂]
(R : Type u_17)
{S : Type u_18}
[Semiring S]
[SMul R M]
[Module S M]
[SMul R M₂]
[Module S M₂]
[SMul R S]
[LinearMap.CompatibleSMul M M₂ R S]
[IsScalarTower R S M₂]
(f : M →ₗ[S] M₂)
(hf : Function.Injective ⇑f)


theorem covBy_of_eq_or_eq (hab : a < b) (h : ∀ c, a ≤ c → c ≤ b → c = a ∨ c = b) : a ⋖ b

(h : ∀ (c : α), a ≤ c → c ≤ b → c = a ∨ c = b)


/-- This property holds if the type of morphisms between `X` and `Y`
in the localized category with respect to `W : MorphismProperty C`
is small. -/
class HasSmallLocalizedHom : Prop where
  small : Small.{w} (W.Q.obj X ⟶ W.Q.obj Y)

[self : CategoryTheory.Localization.HasSmallLocalizedHom W X Y]

Small.{w, max u₁ v₁} (W.Q.obj X ⟶ W.Q.obj Y)


/-- `Polynomial.eval` as linear map -/
@[simps]
def leval {R : Type*} [Semiring R] (r : R) : R[X] →ₗ[R] R

{R : Type u_1}
[Semiring R]
(r : R)
(f : R[X])

(Polynomial.leval r) f = Polynomial.eval r f


theorem rank_fun' : Module.rank R (η → R) = Fintype.card η

{R : Type u}
{η : Type u₁'}
[Ring R]
[StrongRankCondition R]
[Fintype η]

Module.rank R (η → R) = ↑(Fintype.card η)


@[to_additive] lemma left_inv_eq_right_inv (hba : b * a = 1) (hac : a * c = 1) : b = c

{M : Type u_2}
[AddMonoid M]
{a b c : M}
(hba : b + a = 0)
(hac : a + c = 0)


@[fun_prop]
theorem comp_aemeasurable' {f : α → δ} {g : δ → β} (hg : AEMeasurable g (μ.map f))
    (hf : AEMeasurable f μ) : AEMeasurable (fun x ↦ g (f x)) μ

(hg : AEMeasurable g (MeasureTheory.Measure.map f μ))


/-- The Lebesgue integral of the gamma pdf over nonpositive reals equals 0 -/
lemma lintegral_gammaPDF_of_nonpos {x a r : ℝ} (hx : x ≤ 0) :
    ∫⁻ y in Iio x, gammaPDF a r y = 0

∫⁻ (y : ℝ) in Set.Iio x, ProbabilityTheory.gammaPDF a r y = 0


/-- The **Plünnecke-Ruzsa inequality**. Multiplication version. Note that this is genuinely harder
than the division version because we cannot use a double counting argument. -/
@[to_additive "The **Plünnecke-Ruzsa inequality**. Addition version. Note that this is genuinely
harder than the subtraction version because we cannot use a double counting argument."]
theorem pluennecke_ruzsa_inequality_pow_div_pow_mul (hA : A.Nonempty) (B : Finset α) (m n : ℕ) :
    ((B ^ m / B ^ n).card) ≤ ((A * B).card / A.card : ℚ≥0) ^ (m + n) * A.card

{α : Type u_1}
[AddCommGroup α]
[DecidableEq α]
{A : Finset α}
(hA : A.Nonempty)
(B : Finset α)
(m n : ℕ)

↑(m • B - n • B).card ≤ (↑(A + B).card / ↑A.card) ^ (m + n) * ↑A.card


theorem IndepSets.iInter {s : ι → Set (Set Ω)} {s' : Set (Set Ω)}
    (h : ∃ n, IndepSets (s n) s' μ) :
    IndepSets (⋂ n, s n) s' μ

(h : ∃ n, ProbabilityTheory.IndepSets (s n) s' μ)

ProbabilityTheory.IndepSets (⋂ n, s n) s' μ


@[reassoc]
lemma π_homologyMap_ι [S₁.HasHomology] [S₂.HasHomology] (φ : S₁ ⟶ S₂) :
    S₁.homologyπ ≫ homologyMap φ ≫ S₂.homologyι = S₁.iCycles ≫ φ.τ₂ ≫ S₂.pOpcycles

CategoryTheory.CategoryStruct.comp S₁.homologyπ
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.homologyMap φ) S₂.homologyι) =
  CategoryTheory.CategoryStruct.comp S₁.iCycles (CategoryTheory.CategoryStruct.comp φ.τ₂ S₂.pOpcycles)


@[simp]
theorem erase_sub {β : ι → Type v} [∀ i, AddGroup (β i)] (i : ι) (f g : Π₀ i, β i) :
    (f - g).erase i = f.erase i - g.erase i

{ι : Type u}
[DecidableEq ι]
{β : ι → Type v}
[(i : ι) → AddGroup (β i)]
(i : ι)
(f g : Π₀ (i : ι), β i)

DFinsupp.erase i (f - g) = DFinsupp.erase i f - DFinsupp.erase i g


/-- The lower closure of a finite set is closed in the upper topology. -/
theorem isClosed_lowerClosure (h : s.Finite) : IsClosed (lowerClosure s : Set α)

{α : Type u_1}
[Preorder α]
[TopologicalSpace α]
[Topology.IsUpper α]
{s : Set α}
(h : s.Finite)


theorem of_irreducible_expand_pow {p : ℕ} (hp : p ≠ 0) {f : R[X]} {n : ℕ} :
    Irreducible (expand R (p ^ n) f) → Irreducible f

{R : Type u}
[CommRing R]
[IsDomain R]
{p : ℕ}
(hp : p ≠ 0)
{f : R[X]}
{n : ℕ}

Irreducible ((Polynomial.expand R (p ^ n)) f) → Irreducible f


@[simp]
lemma ofHoms_v (ψ : ∀ (p : ℤ), F.X p ⟶ G.X p) (p : ℤ) :
    (ofHoms ψ).v p p (add_zero p) = ψ p

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{F G : CochainComplex C ℤ}
(ψ : (p : ℤ) → F.X p ⟶ G.X p)
(p : ℤ)

(CochainComplex.HomComplex.Cochain.ofHoms ψ).v p p ⋯ = ψ p


@[simp, mfld_simps]
theorem mem_trivChange_source (i j : ι) (p : B × F) :
    p ∈ (Z.trivChange i j).source ↔ p.1 ∈ Z.baseSet i ∩ Z.baseSet j

{R : Type u_1}
{B : Type u_2}
{F : Type u_3}
[NontriviallyNormedField R]
[NormedAddCommGroup F]
[NormedSpace R F]
[TopologicalSpace B]
{ι : Type u_5}
(Z : VectorBundleCore R B F ι)
(i j : ι)
(p : B × F)


@[simp]
theorem map_id (γ : Path x y) : γ.map continuous_id = γ

{X : Type u_1}
[TopologicalSpace X]
{x y : X}
(γ : Path x y)


theorem formPerm_eq_formPerm_iff {l l' : List α} (hl : l.Nodup) (hl' : l'.Nodup) :
    l.formPerm = l'.formPerm ↔ l ~r l' ∨ l.length ≤ 1 ∧ l'.length ≤ 1

{α : Type u_1}
[DecidableEq α]
{l l' : List α}
(hl : l.Nodup)
(hl' : l'.Nodup)


@[simp]
theorem monomial_eq_zero_iff (t : R) (n : ℕ) : monomial n t = 0 ↔ t = 0

{R : Type u}
[Semiring R]
(t : R)
(n : ℕ)


theorem div_le_div_right_of_neg (hc : c < 0) : a / c ≤ b / c ↔ b ≤ a

{α : Type u_2}
[LinearOrderedField α]
{a b c : α}
(hc : c < 0)


@[field_simps]
theorem eq_divp_iff_mul_eq {x : α} {u : αˣ} {y : α} : x = y /ₚ u ↔ x * u = y

{α : Type u}
[Monoid α]
{x : α}
{u : αˣ}
{y : α}


/-- Primes greater than about `sqrt n` appear only to multiplicity 0 or 1
in the binomial coefficient. -/
theorem factorization_choose_le_one (p_large : n < p ^ 2) : (choose n k).factorization p ≤ 1


@[to_additive (attr := continuity) continuous_nnnorm]
theorem continuous_nnnorm' : Continuous fun a : E => ‖a‖₊


lemma smul_eq_comap : σ • w = w.comap σ.symm

{k : Type u_1}
[Field k]
{K : Type u_2}
[Field K]
[Algebra k K]
(σ : K ≃ₐ[k] K)
(w : NumberField.InfinitePlace K)


theorem fst_surjective [h : ∀ a, Nonempty (β a)] : Surjective (fst : (Σ a, β a) → α)

{α : Type u_1}
{β : α → Type u_4}
[h : ∀ (a : α), Nonempty (β a)]


@[simp] lemma isOpen_ofLowerSet_preimage {s : Set α} :
    IsOpen (ofLowerSet ⁻¹' s) ↔ IsLowerSet s

IsOpen (⇑Topology.WithLowerSet.ofLowerSet ⁻¹' s) ↔ IsLowerSet s


/-- The forgetful monoidal functor from the Drinfeld center to the original category. -/
@[simps]
def forget : MonoidalFunctor (Center C) C

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
(X : CategoryTheory.Center C)

(CategoryTheory.Center.forget C).obj X = X.fst


theorem sumCongrHom_injective {α β : Type*} : Function.Injective (sumCongrHom α β)

Function.Injective ⇑(Equiv.Perm.sumCongrHom α β)


theorem prod_rightInvSeq (ω : List B) : prod (ris ω) = (π ω)⁻¹

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

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


theorem degrees_add [DecidableEq σ] (p q : MvPolynomial σ R) :
    (p + q).degrees ≤ p.degrees ⊔ q.degrees

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
[DecidableEq σ]
(p q : MvPolynomial σ R)


theorem max_val {a : Fin n} : max (a : ℕ) n = n


/-- Data for the general version of the implicit function theorem. It holds two functions
`f : E → F` and `g : E → G` (named `leftFun` and `rightFun`) and a point `a` (named `pt`) such that

* both functions are strictly differentiable at `a`;
* the derivatives are surjective;
* the kernels of the derivatives are complementary subspaces of `E`. -/
-- Porting note(#5171): linter not yet ported @[nolint has_nonempty_instance]
structure ImplicitFunctionData (𝕜 : Type*) [NontriviallyNormedField 𝕜] (E : Type*)
    [NormedAddCommGroup E] [NormedSpace 𝕜 E] [CompleteSpace E] (F : Type*) [NormedAddCommGroup F]
    [NormedSpace 𝕜 F] [CompleteSpace F] (G : Type*) [NormedAddCommGroup G] [NormedSpace 𝕜 G]
    [CompleteSpace G] where
  leftFun : E → F
  leftDeriv : E →L[𝕜] F
  rightFun : E → G
  rightDeriv : E →L[𝕜] G
  pt : E
  left_has_deriv : HasStrictFDerivAt leftFun leftDeriv pt
  right_has_deriv : HasStrictFDerivAt rightFun rightDeriv pt
  left_range : range leftDeriv = ⊤
  right_range : range rightDeriv = ⊤
  isCompl_ker : IsCompl (ker leftDeriv) (ker rightDeriv)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
[CompleteSpace G]
(self : ImplicitFunctionData 𝕜 E F G)


/-- If ∠ABC = 0, then (dist A C) = abs ((dist A B) - (dist B C)). -/
theorem dist_eq_abs_sub_dist_of_angle_eq_zero {p1 p2 p3 : P} (h : ∠ p1 p2 p3 = 0) :
    dist p1 p3 = |dist p1 p2 - dist p3 p2|

(h : EuclideanGeometry.angle p1 p2 p3 = 0)


@[simp] theorem Basis.base_restrict (h : M.Basis I X) : (M ↾ X).Base I

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


@[simp]
theorem coe_compl (s : Subtype (MeasurableSet : Set α → Prop)) : ↑sᶜ = (sᶜ : Set α)

{α : Type u_1}
[MeasurableSpace α]
(s : Subtype MeasurableSet)


theorem eventually_injective [Nonempty J] [Finite F.sections] :
    ∃ j, ∀ (i) (f : i ⟶ j), (F.map f).Injective

(Fsur : ∀ ⦃i j : J⦄ (f : i ⟶ j), Function.Surjective (F.map f))

∃ j, ∀ (i : J) (f : i ⟶ j), Function.Injective (F.map f)


theorem Nat.ble_eq_true_of_le (h : LE.le n m) : Eq (Nat.ble n m) true


/-- The Haar measure defined by any orthonormal basis of a finite-dimensional inner product space
is equal to its volume measure. -/
theorem OrthonormalBasis.addHaar_eq_volume {ι F : Type*} [Fintype ι] [NormedAddCommGroup F]
    [InnerProductSpace ℝ F] [FiniteDimensional ℝ F] [MeasurableSpace F] [BorelSpace F]
    (b : OrthonormalBasis ι ℝ F) :
    b.toBasis.addHaar = volume

{ι : Type u_4}
{F : Type u_5}
[Fintype ι]
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
[FiniteDimensional ℝ F]
[MeasurableSpace F]
[BorelSpace F]
(b : OrthonormalBasis ι ℝ F)


theorem comp {Kg : ℝ≥0} {g : β → γ} (hg : AntilipschitzWith Kg g) {Kf : ℝ≥0} {f : α → β}
    (hf : AntilipschitzWith Kf f) : AntilipschitzWith (Kf * Kg) (g ∘ f)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
[PseudoEMetricSpace γ]
{Kg : ℝ≥0}
{g : β → γ}
(hg : AntilipschitzWith Kg g)
{Kf : ℝ≥0}
{f : α → β}
(hf : AntilipschitzWith Kf f)


@[to_additive add_const]
theorem MonotoneOn.mul_const' [CovariantClass α α (swap (· * ·)) (· ≤ ·)] (hf : MonotoneOn f s)
    (a : α) :
    MonotoneOn (fun x => f x * a) s

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


/-- Change of variables, general form. If `f` is continuous on `[a, b]` and has
right-derivative `f'` in `(a, b)`, `g` is continuous on `f '' (a, b)` and integrable on
`f '' [a, b]`, and `f' x • (g ∘ f) x` is integrable on `[a, b]`,
then we can substitute `u = f x` to get `∫ x in a..b, f' x • (g ∘ f) x = ∫ u in f a..f b, g u`.
-/
theorem integral_comp_smul_deriv''' {f f' : ℝ → ℝ} {g : ℝ → G} (hf : ContinuousOn f [[a, b]])
    (hff' : ∀ x ∈ Ioo (min a b) (max a b), HasDerivWithinAt f (f' x) (Ioi x) x)
    (hg_cont : ContinuousOn g (f '' Ioo (min a b) (max a b))) (hg1 : IntegrableOn g (f '' [[a, b]]))
    (hg2 : IntegrableOn (fun x => f' x • (g ∘ f) x) [[a, b]]) :
    (∫ x in a..b, f' x • (g ∘ f) x) = ∫ u in f a..f b, g u

(hff' : ∀ x ∈ Set.Ioo (min a b) (max a b), HasDerivWithinAt f (f' x) (Set.Ioi x) x)

(hg_cont : ContinuousOn g (f '' Set.Ioo (min a b) (max a b)))

(hg1 : MeasureTheory.IntegrableOn g (f '' [[a, b]]) MeasureTheory.volume)

(hg2 : MeasureTheory.IntegrableOn (fun x => f' x • (g ∘ f) x) [[a, b]] MeasureTheory.volume)

∫ (x : ℝ) in a..b, f' x • (g ∘ f) x = ∫ (u : ℝ) in f a..f b, g u


@[simp, deprecated get_zero_scanl (since := "2023-01-05")]
theorem nthLe_zero_scanl {h : 0 < (scanl f b l).length} : (scanl f b l).nthLe 0 h = b

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


@[simp] theorem cond_self (c : Bool) (t : α) : cond c t t = t


@[to_additive (attr := elab_as_elim)]
theorem induction_on' {C : α ⧸ s → Prop} (x : α ⧸ s) (H : ∀ z : α, C z) : C x

{α : Type u_1}
[Group α]
{s : Subgroup α}
{C : α ⧸ s → Prop}
(x : α ⧸ s)
(H : ∀ (z : α), C ↑z)


/-- Assumes right covariance. -/
theorem Right.one_lt_mul_of_lt_of_le_of_pos [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)


@[simp]
theorem Equiv.Perm.decomposeFin_symm_apply_zero {n : ℕ} (p : Fin (n + 1)) (e : Perm (Fin n)) :
    Equiv.Perm.decomposeFin.symm (p, e) 0 = p

{n : ℕ}
(p : Fin (n + 1))
(e : Equiv.Perm (Fin n))

(Equiv.Perm.decomposeFin.symm (p, e)) 0 = p


@[fun_prop]
theorem DifferentiableOn.const_add (hf : DifferentiableOn 𝕜 f s) (c : F) :
    DifferentiableOn 𝕜 (fun y => c + f y) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{s : Set E}
(hf : DifferentiableOn 𝕜 f s)
(c : F)


theorem le_of_op_hom {x y : Xᵒᵖ} (h : x ⟶ y) : unop y ≤ unop x

{X : Type u}
[Preorder X]
{x y : Xᵒᵖ}
(h : x ⟶ y)


protected theorem is_norm (q : ℚ_[p]) : ↑(padicNormE q) = ‖q‖

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


theorem reindexLinearEquiv_mul [Fintype n] [Fintype n'] (eₘ : m ≃ m') (eₙ : n ≃ n') (eₒ : o ≃ o')
    (M : Matrix m n A) (N : Matrix n o A) :
    reindexLinearEquiv R A eₘ eₙ M * reindexLinearEquiv R A eₙ eₒ N =
      reindexLinearEquiv R A eₘ eₒ (M * N)

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{m' : Type u_6}
{n' : Type u_7}
{o' : Type u_8}
(R : Type u_11)
(A : Type u_12)
[Semiring R]
[Semiring A]
[Module R A]
[Fintype n]
[Fintype n']
(eₘ : m ≃ m')
(eₙ : n ≃ n')
(eₒ : o ≃ o')
(M : Matrix m n A)
(N : Matrix n o A)

(Matrix.reindexLinearEquiv R A eₘ eₙ) M * (Matrix.reindexLinearEquiv R A eₙ eₒ) N =
  (Matrix.reindexLinearEquiv R A eₘ eₒ) (M * N)


theorem norm_restr {k n : ℕ} (f : G[×n]→L[𝕜] G') (s : Finset (Fin n)) (hk : s.card = k) (z : G) :
    ‖f.restr s hk z‖ ≤ ‖f‖ * ‖z‖ ^ (n - k)

(f : ContinuousMultilinearMap 𝕜 (fun i => G) G')


@[simp]
theorem update_self : f.update a (f a) = f

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


theorem IsOpen.eventually_mem (hs : IsOpen s) (hx : x ∈ s) :
    ∀ᶠ x in 𝓝 x, x ∈ s

{X : Type u}
{x : X}
{s : Set X}
[TopologicalSpace X]
(hs : IsOpen s)
(hx : x ∈ s)


@[simp]
theorem succ_nsmul {R} [LinearOrder R] [OrderTop R] (x : Tropical R) (n : ℕ) : (n + 1) • x = x

{R : Type u_1}
[LinearOrder R]
[OrderTop R]
(x : Tropical R)
(n : ℕ)


/-- A variant of `Cardinal.lift_mk_le` with specialized universes.
Because Lean often can not realize it should use this specialization itself,
we provide this statement separately so you don't have to solve the specialization problem either.
-/
theorem lift_mk_le' {α : Type u} {β : Type v} : lift.{v} #α ≤ lift.{u} #β ↔ Nonempty (α ↪ β)

Cardinal.lift.{v, u} (Cardinal.mk α) ≤ Cardinal.lift.{u, v} (Cardinal.mk β) ↔ Nonempty (α ↪ β)


lemma IsTree.existsUnique_path (hG : G.IsTree) : ∀ v w, ∃! p : G.Walk v w, p.IsPath

{V : Type u}
{G : SimpleGraph V}
(hG : G.IsTree)
(v w : V)


private lemma edgeDensity_badVertices_le (hε : 0 ≤ ε) (dst : 2 * ε ≤ G.edgeDensity s t) :
    G.edgeDensity (badVertices G ε s t) t ≤ G.edgeDensity s t - ε

{α : Type u_1}
(G : SimpleGraph α)
[DecidableRel G.Adj]
{ε : ℝ}
{s t : Finset α}
(hε : 0 ≤ ε)
(dst : 2 * ε ≤ ↑(G.edgeDensity s t))

↑(G.edgeDensity (SimpleGraph.badVertices G ε s t) t) ≤ ↑(G.edgeDensity s t) - ε


theorem pmap_append' {p : α → Prop} (f : ∀ a : α, p a → β) (l₁ l₂ : List α)
    (h₁ : ∀ a ∈ l₁, p a) (h₂ : ∀ a ∈ l₂, p a) :
    ((l₁ ++ l₂).pmap f fun a ha => (List.mem_append.1 ha).elim (h₁ a) (h₂ a)) =
      l₁.pmap f h₁ ++ l₂.pmap f h₂

{α : Type u}
{β : Type v}
{p : α → Prop}
(f : (a : α) → p a → β)
(l₁ l₂ : List α)
(h₁ : ∀ (a : α), a ∈ l₁ → p a)
(h₂ : ∀ (a : α), a ∈ l₂ → p a)

List.pmap f (l₁ ++ l₂) ⋯ = List.pmap f l₁ h₁ ++ List.pmap f l₂ h₂


/-- Ad hoc class stating that the closure of an upper set is an upper set. This is used to state
lemmas that do not mention algebraic operations for both the additive and multiplicative versions
simultaneously. If you find a satisfying replacement for this typeclass, please remove it! -/
class HasUpperLowerClosure (α : Type*) [TopologicalSpace α] [Preorder α] : Prop where
  isUpperSet_closure : ∀ s : Set α, IsUpperSet s → IsUpperSet (closure s)
  isLowerSet_closure : ∀ s : Set α, IsLowerSet s → IsLowerSet (closure s)
  isOpen_upperClosure : ∀ s : Set α, IsOpen s → IsOpen (upperClosure s : Set α)
  isOpen_lowerClosure : ∀ s : Set α, IsOpen s → IsOpen (lowerClosure s : Set α)

{α : Type u_1}
[TopologicalSpace α]
[Preorder α]
[self : HasUpperLowerClosure α]
(s : Set α)


protected lemma GrowsPolynomially.rpow (p : ℝ) (hf : GrowsPolynomially f)
    (hf_nonneg : ∀ᶠ x in atTop, 0 ≤ f x) : GrowsPolynomially fun x => (f x) ^ p

(hf : AkraBazziRecurrence.GrowsPolynomially f)

(hf_nonneg : ∀ᶠ (x : ℝ) in Filter.atTop, 0 ≤ f x)

AkraBazziRecurrence.GrowsPolynomially fun x => f x ^ p


@[simp]
theorem toNat_ofNat (n : ℕ) [n.AtLeastTwo] :
    Cardinal.toNat (no_index (OfNat.ofNat n)) = OfNat.ofNat n

Cardinal.toNat (OfNat.ofNat n) = OfNat.ofNat n


@[to_additive]
lemma IsComplement.mul_eq (h : IsComplement S T) : S * T = univ

{G : Type u_1}
[AddGroup G]
{S T : Set G}
(h : AddSubgroup.IsComplement S T)


@[simp]
theorem snd_star [Star R] [Star A] (x : Unitization R A) : (star x).snd = star x.snd

{R : Type u_1}
{A : Type u_2}
[Star R]
[Star A]
(x : Unitization R A)


@[simp]
theorem top_ne_coe (a : ℕ) : ⊤ ≠ (a : ℕ∞)


theorem le_of_lt_or_eq : ∀ {a b : α}, a < b ∨ a = b → a ≤ b


theorem minFacAux_has_prop {n : ℕ} (n2 : 2 ≤ n) :
    ∀ k i, k = 2 * i + 3 → (∀ m, 2 ≤ m → m ∣ n → k ≤ m) → minFacProp n (minFacAux n k)

k = 2 * i + 3 → (∀ (m : ℕ), 2 ≤ m → m ∣ n → k ≤ m) → Nat.minFacProp n (n.minFacAux k)


@[to_additive]
theorem div_mem_div : s ∈ f → t ∈ g → s / t ∈ f / g

{α : Type u_2}
[Div α]
{f g : Filter α}
{s t : Set α}


/-- A semi-ring of sets `C` is a family of sets containing `∅`, stable by intersection and such that
for all `s, t ∈ C`, `s \ t` is equal to a disjoint union of finitely many sets in `C`. -/
structure IsSetSemiring (C : Set (Set α)) : Prop where
  empty_mem : ∅ ∈ C
  inter_mem : ∀ s ∈ C, ∀ t ∈ C, s ∩ t ∈ C
  diff_eq_sUnion' : ∀ s ∈ C, ∀ t ∈ C,
    ∃ I : Finset (Set α), ↑I ⊆ C ∧ PairwiseDisjoint (I : Set (Set α)) id ∧ s \ t = ⋃₀ I

{α : Type u_1}
{C : Set (Set α)}
(self : MeasureTheory.IsSetSemiring C)
(s : Set α)


@[simp]
theorem empty_sdiff (s : Finset α) : ∅ \ s = ∅

{α : Type u_1}
[DecidableEq α]
(s : Finset α)


/-- The `LinearMap` between spaces of matrices induced by a `LinearMap` between their
coefficients. This is `Matrix.map` as a `LinearMap`. -/
@[simps]
def mapMatrix (f : α →ₗ[R] β) : Matrix m n α →ₗ[R] Matrix m n β

{m : Type u_2}
{n : Type u_3}
{R : Type u_7}
{α : Type v}
{β : Type w}
[Semiring R]
[AddCommMonoid α]
[AddCommMonoid β]
[Module R α]
[Module R β]
(f : α →ₗ[R] β)
(M : Matrix m n α)


@[simp]
theorem toJordanDecomposition_toSignedMeasure (j : JordanDecomposition α) :
    j.toSignedMeasure.toJordanDecomposition = j

(j : MeasureTheory.JordanDecomposition α)


theorem transGen_eq_self (trans : Transitive r) : TransGen r = r

{α : Type u_1}
{r : α → α → Prop}
(trans : Transitive r)


@[to_additive]
theorem forall_coe_one_iff_one (f : α →ᵇ β) : (∀ x, f x = 1) ↔ f = 1

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
[One β]
(f : BoundedContinuousFunction α β)


@[to_additive (attr := simp, norm_cast)]
theorem coe_zpow (x : H) (n : ℤ) : ((x ^ n : H) : G) = (x : G) ^ n

{G : Type u_1}
[AddGroup G]
{S : Type u_6}
{H : S}
[SetLike S G]
[AddSubgroupClass S G]
(x : ↥H)
(n : ℤ)


@[to_additive]
theorem Multipliable.div (hf : Multipliable f) (hg : Multipliable g) :
    Multipliable fun b ↦ f b / g b

{α : Type u_1}
{β : Type u_2}
[CommGroup α]
[TopologicalSpace α]
[TopologicalGroup α]
{f g : β → α}
(hf : Multipliable f)
(hg : Multipliable g)


theorem not_primrec_ack_self : ¬Primrec fun n => ack n n


lemma oddKernel_def (a x : ℝ) : ↑(oddKernel a x) = jacobiTheta₂'' a (I * x)

↑(HurwitzZeta.oddKernel (↑a) x) = HurwitzZeta.jacobiTheta₂'' (↑a) (Complex.I * ↑x)


/--
A class describing the property of preserving finite effective epimorphic families.
-/
class PreservesFiniteEffectiveEpiFamilies (F : C ⥤ D) : Prop where
  /--
  A functor preserves finite effective epimorphic families if it maps finite effective epimorphic
  families to effective epimorphic families.
  -/
  preserves : ∀ {α : Type} [Finite α] {B : C} (X : α → C) (π : (a : α) → (X a ⟶ B))
    [EffectiveEpiFamily X π],
    EffectiveEpiFamily (fun a ↦ F.obj (X a)) (fun a  ↦ F.map (π a))

CategoryTheory.EffectiveEpiFamily (fun a => F.obj (X a)) fun a => F.map (π a)


lemma zpow_add' {m n : ℤ} (h : a ≠ 0 ∨ m + n ≠ 0 ∨ m = 0 ∧ n = 0) :
    a ^ (m + n) = a ^ m * a ^ n

{G₀ : Type u_3}
[GroupWithZero G₀]
{a : G₀}
{m n : ℤ}
(h : a ≠ 0 ∨ m + n ≠ 0 ∨ m = 0 ∧ n = 0)


protected theorem ne_of_data_ne {a b : String} (h : a.data ≠ b.data) : a ≠ b


@[simp]
theorem infs_nonempty : (s ⊼ t).Nonempty ↔ s.Nonempty ∧ t.Nonempty

{α : Type u_2}
[SemilatticeInf α]
{s t : Set α}


theorem DifferentiableWithinAt.cos (hf : DifferentiableWithinAt ℝ f s x) :
    DifferentiableWithinAt ℝ (fun x => Real.cos (f x)) s x

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


theorem disjoint_of_mem_compression_of_not_mem (h : a ∈ 𝓒 u v s) (ha : a ∉ s) : Disjoint v a

{α : Type u_1}
[GeneralizedBooleanAlgebra α]
[DecidableRel Disjoint]
[DecidableRel fun x x_1 => x ≤ x_1]
{s : Finset α}
{u v a : α}
[DecidableEq α]
(h : a ∈ UV.compression u v s)
(ha : a ∉ s)


theorem fst_eq_of_dist_lt_one (x y : Σi, E i) (h : dist x y < 1) : x.1 = y.1

{ι : Type u_1}
{E : ι → Type u_2}
[(i : ι) → MetricSpace (E i)]
(x y : (i : ι) × E i)
(h : dist x y < 1)


theorem rpow_add_of_nonneg (x : ℝ≥0) {y z : ℝ} (hy : 0 ≤ y) (hz : 0 ≤ z) :
    x ^ (y + z) = x ^ y * x ^ z


theorem basicOpen :
    IsAffineOpen (X.basicOpen f)

{X : AlgebraicGeometry.Scheme}
{U : X.Opens}
(hU : AlgebraicGeometry.IsAffineOpen U)
(f : ↑(X.presheaf.obj (Opposite.op U)))


theorem tuple0_le {α : Fin 0 → Type*} [∀ i, Preorder (α i)] (f g : ∀ i, α i) : f ≤ g

{α : Fin 0 → Type u_1}
[(i : Fin 0) → Preorder (α i)]
(f g : (i : Fin 0) → α i)


theorem eq_of_forall_gt_iff [LinearOrder α] {a b : α} (h : ∀ c, a < c ↔ b < c) : a = b

{α : Type u_2}
[LinearOrder α]
{a b : α}
(h : ∀ (c : α), a < c ↔ b < c)


lemma stdAddChar_coe (j : ℤ) :
    stdAddChar (j : ZMod N) = exp (2 * π * I * j / N)

ZMod.stdAddChar ↑j = cexp (2 * ↑π * Complex.I * ↑j / ↑N)


@[to_additive]
theorem comap_norm_nhds_one : comap norm (𝓝 0) = 𝓝 (1 : E)


/-- The isomorphism in `Localization W` that is induced by a morphism in `W`. -/
@[simps]
def Qiso {X Y : C} (s : X ⟶ Y) (hs : W s) : (Q W).obj X ≅ (Q W).obj Y

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{W : CategoryTheory.MorphismProperty C}
[W.HasLeftCalculusOfFractions]
{X Y : C}
(s : X ⟶ Y)
(hs : W s)

(CategoryTheory.MorphismProperty.LeftFraction.Localization.Qiso s hs).inv =
  CategoryTheory.MorphismProperty.LeftFraction.Localization.Qinv s hs


theorem cancel_mono_id (f : X ⟶ Y) [Mono f] {g : X ⟶ X} : g ≫ f = f ↔ g = 𝟙 X

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

CategoryTheory.CategoryStruct.comp g f = f ↔ g = CategoryTheory.CategoryStruct.id X


protected theorem IsTransitive.union (hx : x.IsTransitive) (hy : y.IsTransitive) :
    (x ∪ y).IsTransitive

{x y : ZFSet}
(hx : x.IsTransitive)
(hy : y.IsTransitive)


theorem map_sup_comap_of_surjective (p q : Submodule R₂ M₂) :
    (p.comap f ⊔ q.comap f).map f = p ⊔ q

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

Submodule.map f (Submodule.comap f p ⊔ Submodule.comap f q) = p ⊔ q


theorem union_congr_left (ht : t ⊆ s ∪ u) (hu : u ⊆ s ∪ t) : s ∪ t = s ∪ u

{α : Type u}
{s t u : Set α}
(ht : t ⊆ s ∪ u)
(hu : u ⊆ s ∪ t)


lemma measurable_rnDeriv (κ η : Kernel α γ) :
    Measurable (fun p : α × γ ↦ rnDeriv κ η p.1 p.2)

[hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ]


/-- Sum of a multiset of elements in a `NonUnitalSubring` of a `NonUnitalRing` is
in the `NonUnitalSubring`. -/
protected theorem multiset_sum_mem {R} [NonUnitalNonAssocRing R] (s : NonUnitalSubring R)
    (m : Multiset R) : (∀ a ∈ m, a ∈ s) → m.sum ∈ s

{R : Type u_1}
[NonUnitalNonAssocRing R]
(s : NonUnitalSubring R)
(m : Multiset R)


lemma forall_ne_iff_eq_bot {x : WithBot α} : (∀ a : α, ↑a ≠ x) ↔ x = ⊥


@[simp]
theorem enum_singleton (x : α) : enum [x] = [(0, x)]


theorem of_comp_eq_base (i : ι) : (of i).comp (φ i) = (base φ)

{ι : Type u_1}
{G : ι → Type u_2}
{H : Type u_3}
[(i : ι) → Monoid (G i)]
[Monoid H]
{φ : (i : ι) → H →* G i}
(i : ι)

(Monoid.PushoutI.of i).comp (φ i) = Monoid.PushoutI.base φ


protected theorem em (f : Ultrafilter α) (p : α → Prop) : (∀ᶠ x in f, p x) ∨ ∀ᶠ x in f, ¬p x

{α : Type u}
(f : Ultrafilter α)
(p : α → Prop)

(∀ᶠ (x : α) in ↑f, p x) ∨ ∀ᶠ (x : α) in ↑f, ¬p x


theorem init [IsTrans β s] (f : r ≺i s) {a : α} {b : β} (h : s b (f a)) : ∃ a', f a' = b

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
[IsTrans β s]
(f : r ≺i s)
{a : α}
{b : β}
(h : s b (f.toRelEmbedding a))


@[simp] lemma odd_iff_not_even : Odd n ↔ ¬Even n


theorem Ico_eq_finset_map :
    Ico a b = (Finset.range (b - a).toNat).map (Nat.castEmbedding.trans <| addLeftEmbedding a)

Finset.Ico a b = Finset.map (Nat.castEmbedding.trans (addLeftEmbedding a)) (Finset.range (b - a).toNat)


@[to_additive]
theorem map_pos_of_ne_one [Group α] [LinearOrderedAddCommMonoid β] [GroupNormClass F α β] (f : F)
    {x : α} (hx : x ≠ 1) : 0 < f x

{F : Type u_2}
{α : Type u_3}
{β : Type u_4}
[FunLike F α β]
[Group α]
[LinearOrderedAddCommMonoid β]
[GroupNormClass F α β]
(f : F)
{x : α}
(hx : x ≠ 1)


lemma dirSupClosed_of_isClosed (h : IsClosed s) : DirSupClosed s

{α : Type u_1}
[Preorder α]
[TopologicalSpace α]
[Topology.IsScottHausdorff α]
{s : Set α}
(h : IsClosed s)


theorem eventually_imp : (∀ᶠ x in f, p x → q x) ↔ (∀ᶠ x in f, p x) → ∀ᶠ x in f, q x

{α : Type u}
{f : Ultrafilter α}
{p q : α → Prop}

(∀ᶠ (x : α) in ↑f, p x → q x) ↔ (∀ᶠ (x : α) in ↑f, p x) → ∀ᶠ (x : α) in ↑f, q x


@[simp]
theorem pure_le {a : α} {s : Semiquot α} : pure a ≤ s ↔ a ∈ s


@[to_additive (attr := simp)]
theorem mulIndicator_compl_mul_self (s : Set α) (f : α → M) :
    mulIndicator sᶜ f * mulIndicator s f = f

{α : Type u_1}
{M : Type u_4}
[MulOneClass M]
(s : Set α)
(f : α → M)

sᶜ.mulIndicator f * s.mulIndicator f = f


@[simp] theorem castLE_comp_castLE {k m n} (km : k ≤ m) (mn : m ≤ n) :
    Fin.castLE mn ∘ Fin.castLE km = Fin.castLE (Nat.le_trans km mn)

Fin.castLE mn ∘ Fin.castLE km = Fin.castLE ⋯


@[simp]
lemma coe_toMonoidHom [CommMonoid R] (χ : MulChar R R')
    (x : R) : χ.toMonoidHom x = χ x

{R : Type u_1}
{R' : Type u_2}
[CommMonoidWithZero R']
[CommMonoid R]
(χ : MulChar R R')
(x : R)


private theorem T_pow {n : ℕ} (hn : n ≠ 0) : T ^ n < 1

(hnorm : ‖Polynomial.eval a F‖ < ‖Polynomial.eval a (Polynomial.derivative F)‖ ^ 2)


protected theorem inv (h : Irrational x) : Irrational x⁻¹


/-- If `α` has no zero divisors, then the product of two elements equals zero iff one of them
equals zero. -/
@[simp]
theorem zero_eq_mul : 0 = a * b ↔ a = 0 ∨ b = 0

{M₀ : Type u_1}
[MulZeroClass M₀]
[NoZeroDivisors M₀]
{a b : M₀}


theorem diff_cylinder_same (s : Finset ι) (S T : Set (∀ i : s, α i)) :
    cylinder s S \ cylinder s T = cylinder s (S \ T)

(S T : Set ((i : { x // x ∈ s }) → α ↑i))

MeasureTheory.cylinder s S \ MeasureTheory.cylinder s T = MeasureTheory.cylinder s (S \ T)


protected theorem MeasurableSet.sUnion {s : Set (Set α)} (hs : s.Countable)
    (h : ∀ t ∈ s, MeasurableSet t) : MeasurableSet (⋃₀ s)

{α : Type u_1}
{m : MeasurableSpace α}
{s : Set (Set α)}
(hs : s.Countable)
(h : ∀ t ∈ s, MeasurableSet t)


/-- In any abelian category with enough injectives,
`InjectiveResolution.of Z` constructs an injective resolution of the object `Z`.
-/
irreducible_def of : InjectiveResolution Z

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Abelian C]
[CategoryTheory.EnoughInjectives C]
(Z : C)

CategoryTheory.InjectiveResolution.of Z =
  CategoryTheory.InjectiveResolution.mk (CategoryTheory.InjectiveResolution.ofCocomplex Z) ⋯
    (((CategoryTheory.InjectiveResolution.ofCocomplex Z).fromSingle₀Equiv Z).symm ⟨CategoryTheory.Injective.ι Z, ⋯⟩) ⋯


@[simp]
theorem coe_toNonUnitalSubalgebra (p : Submodule R A) (h_mul) :
    (p.toNonUnitalSubalgebra h_mul : Set A) = p

(h_mul : ∀ (x y : A), x ∈ p → y ∈ p → x * y ∈ p)


@[to_additive]
theorem image_mulSingle_Ico_left (i : ι) (a : α i) :
    Pi.mulSingle i '' Ico a 1 = Ico (Pi.mulSingle i a) 1

{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ι]
[(i : ι) → PartialOrder (α i)]
[(i : ι) → Zero (α i)]
(i : ι)
(a : α i)

Pi.single i '' Set.Ico a 0 = Set.Ico (Pi.single i a) 0


theorem measure_iUnion {m0 : MeasurableSpace α} {μ : Measure α} [Countable ι] {f : ι → Set α}
    (hn : Pairwise (Disjoint on f)) (h : ∀ i, MeasurableSet (f i)) :
    μ (⋃ i, f i) = ∑' i, μ (f i)

{ι : Type u_1}
{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[Countable ι]
{f : ι → Set α}
(hn : Pairwise (Disjoint on f))
(h : ∀ (i : ι), MeasurableSet (f i))


theorem mem_Ici_Ioi_of_subset_of_subset {s : Set α} (ho : Ioi a ⊆ s) (hc : s ⊆ Ici a) :
    s ∈ ({Ici a, Ioi a} : Set (Set α))

{α : Type u_1}
[PartialOrder α]
{a : α}
{s : Set α}
(ho : Set.Ioi a ⊆ s)
(hc : s ⊆ Set.Ici a)


@[to_additive]
theorem div_mem_div : a ∈ s → b ∈ t → a / b ∈ s / t

{α : Type u_2}
[Div α]
{s t : Set α}
{a b : α}


theorem HasFDerivWithinAt.log (hf : HasFDerivWithinAt f f' s x) (hx : f x ≠ 0) :
    HasFDerivWithinAt (fun x => log (f x)) ((f x)⁻¹ • f') s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{x : E}
{f' : E →L[ℝ] ℝ}
{s : Set E}
(hf : HasFDerivWithinAt f f' s x)
(hx : f x ≠ 0)

HasFDerivWithinAt (fun x => Real.log (f x)) ((f x)⁻¹ • f') s x


protected theorem map_multiset_prod [CommSemiring R] [CommSemiring S] (f : R ≃+* S)
    (s : Multiset R) : f s.prod = (s.map f).prod

{R : Type u_2}
{S : Type u_3}
[CommSemiring R]
[CommSemiring S]
(f : R ≃+* S)
(s : Multiset R)


/-- Construct an isomorphism in the Drinfeld center from
a morphism whose underlying morphism is an isomorphism.
-/
@[simps]
def isoMk {X Y : Center C} (f : X ⟶ Y) [IsIso f.f] : X ≅ Y

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

(CategoryTheory.Center.isoMk f).inv.f = CategoryTheory.inv f.f


theorem uniformCauchySeqOn_iff_uniformCauchySeqOnFilter :
    UniformCauchySeqOn F p s ↔ UniformCauchySeqOnFilter F p (𝓟 s)

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{s : Set α}
{p : Filter ι}


lemma ceilRoot_ne_zero : ceilRoot n a ≠ 0 ↔ n ≠ 0 ∧ a ≠ 0


@[simp]
theorem coe_toAlgHom' : (toAlgHom R S A : S → A) = algebraMap S A

(R : Type u)
(S : Type v)
(A : Type w)
[CommSemiring R]
[CommSemiring S]
[Semiring A]
[Algebra R S]
[Algebra S A]
[Algebra R A]
[IsScalarTower R S A]

⇑(IsScalarTower.toAlgHom R S A) = ⇑(algebraMap S A)


@[to_additive]
theorem ker_le_range_iff {I : Type w} [Group I] (f : G →* H) [f.range.Normal] (g : H →* I) :
    g.ker ≤ f.range ↔ (mk' f.range).comp g.ker.subtype = 1

{G : Type u}
[AddGroup G]
{H : Type v}
[AddGroup H]
{I : Type w}
[AddGroup I]
(f : G →+ H)
[f.range.Normal]
(g : H →+ I)

g.ker ≤ f.range ↔ (QuotientAddGroup.mk' f.range).comp g.ker.subtype = 0


@[simp]
lemma image_subtype_val_Ioo_Iic {a b : α} (c : Ioo a b) : Subtype.val '' Iic c = Ioc a c

{α : Type u_1}
[Preorder α]
{a b : α}
(c : ↑(Set.Ioo a b))


theorem addHaar_closed_unit_ball_eq_addHaar_unit_ball :
    μ (closedBall (0 : E) 1) = μ (ball 0 1)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
[FiniteDimensional ℝ E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]

μ (Metric.closedBall 0 1) = μ (Metric.ball 0 1)


@[simp]
theorem toNNRat_pos : 0 < toNNRat q ↔ 0 < q


theorem mk_eq_div' (p q : K[X]) :
    RatFunc.mk p q = ofFractionRing (algebraMap _ _ p / algebraMap _ _ q)

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

RatFunc.mk p q = { toFractionRing := (algebraMap K[X] (FractionRing K[X])) p / (algebraMap K[X] (FractionRing K[X])) q }


lemma div_eq_inv_mul (a b : EReal) : a / b = b⁻¹ * a


@[simp] protected lemma inv_zero : (0 : WithZero α)⁻¹ = 0


theorem UniformCauchySeqOn.prod {ι' β' : Type*} [UniformSpace β'] {F' : ι' → α → β'}
    {p' : Filter ι'} (h : UniformCauchySeqOn F p s) (h' : UniformCauchySeqOn F' p' s) :
    UniformCauchySeqOn (fun (i : ι × ι') a => (F i.fst a, F' i.snd a)) (p ×ˢ p') s

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{s : Set α}
{p : Filter ι}
{ι' : Type u_1}
{β' : Type u_2}
[UniformSpace β']
{F' : ι' → α → β'}
{p' : Filter ι'}
(h : UniformCauchySeqOn F p s)
(h' : UniformCauchySeqOn F' p' s)

UniformCauchySeqOn (fun i a => (F i.1 a, F' i.2 a)) (p ×ˢ p') s


@[simp]
theorem HasLimit.isoOfEquivalence_hom_π {F : J ⥤ C} [HasLimit F] {G : K ⥤ C} [HasLimit G]
    (e : J ≌ K) (w : e.functor ⋙ G ≅ F) (k : K) :
    (HasLimit.isoOfEquivalence e w).hom ≫ limit.π G k =
      limit.π F (e.inverse.obj k) ≫ w.inv.app (e.inverse.obj k) ≫ G.map (e.counit.app k)

{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}
[CategoryTheory.Limits.HasLimit F]
{G : K ⥤ C}
[CategoryTheory.Limits.HasLimit G]
(e : J ≌ K)
(w : e.functor ⋙ G ≅ F)
(k : K)

(CategoryTheory.Limits.HasLimit.isoOfEquivalence e w).hom ≫ CategoryTheory.Limits.limit.π G k =
  CategoryTheory.Limits.limit.π F (e.inverse.obj k) ≫ w.inv.app (e.inverse.obj k) ≫ G.map (e.counit.app k)


theorem frontier_Ici_subset (a : α) : frontier (Ici a) ⊆ {a}

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderClosedTopology α]
(a : α)


/-- If `M ⊕ N` embeds into `M`, for `M` noetherian over `R`, then `N` is trivial. -/
@[simps!]
def IsNoetherian.equivPUnitOfProdInjective (f : M × N →ₗ[R] M)
    (i : Injective f) : N ≃ₗ[R] PUnit.{w + 1}

{R : Type u_1}
{M : Type u_2}
{N : Type w}
[Ring R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
[IsNoetherian R M]
(f : M × N →ₗ[R] M)
(i : Function.Injective ⇑f)

∀ (x : N), (IsNoetherian.equivPUnitOfProdInjective f i) x = 0


@[to_additive]
theorem eq_mul_of_div_eq' (h : a / b = c) : a = b * c

{G : Type u_3}
[AddCommGroup G]
{a b c : G}
(h : a - b = c)


@[simp]
lemma natDegree_preΨ₄ (h : (2 : R) ≠ 0) : W.preΨ₄.natDegree = 6

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
(h : 2 ≠ 0)


@[to_additive (attr := elab_as_elim, induction_eliminator, cases_eliminator)]
theorem ind {p : Localization S → Prop} (H : ∀ y : M × S, p (mk y.1 y.2)) (x) : p x

(H : ∀ (y : M × ↥S), p (AddLocalization.mk y.1 y.2))


theorem setIntegral_map {Y} [MeasurableSpace Y] {g : X → Y} {f : Y → E} {s : Set Y}
    (hs : MeasurableSet s) (hf : AEStronglyMeasurable f (Measure.map g μ)) (hg : AEMeasurable g μ) :
    ∫ y in s, f y ∂Measure.map g μ = ∫ x in g ⁻¹' s, f (g x) ∂μ

(hf : MeasureTheory.AEStronglyMeasurable f (MeasureTheory.Measure.map g μ))

∫ (y : Y) in s, f y ∂MeasureTheory.Measure.map g μ = ∫ (x : X) in g ⁻¹' s, f (g x) ∂μ


/-- The functor `(L, R) ⥤ (L ⋙ F, R ⋙ F)` -/
@[simps]
def post (L : A ⥤ T) (R : B ⥤ T) (F : T ⥤ C) : Comma L R ⥤ Comma (L ⋙ F) (R ⋙ F)

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

((CategoryTheory.Comma.post L R F).obj X).hom = F.map X.hom


@[simp]
theorem cast_add' (a b : ZMod n) : (cast (a + b : ZMod n) : R) = cast a + cast b

{n : ℕ}
{R : Type u_1}
[Ring R]
[CharP R n]
(a b : ZMod n)


theorem isBigO_self_const_mul (c : 𝕜) (hc : c ≠ 0) (f : α → 𝕜) (l : Filter α) :
    f =O[l] fun x => c * f x

{α : Type u_1}
{𝕜 : Type u_15}
[NormedDivisionRing 𝕜]
(c : 𝕜)
(hc : c ≠ 0)
(f : α → 𝕜)
(l : Filter α)


theorem isCompact_univ_iff : IsCompact (univ : Set X) ↔ CompactSpace X


theorem Dual.order [Finite P] [Finite L] : order (Dual L) (Dual P) = order P L

(P : Type u_1)
(L : Type u_2)
[Membership P L]
[Configuration.ProjectivePlane P L]
[Finite P]
[Finite L]

Configuration.ProjectivePlane.order (Configuration.Dual L) (Configuration.Dual P) =
  Configuration.ProjectivePlane.order P L


@[to_additive]
theorem finiteIndex_iInf' {ι : Type*} {s : Finset ι}
    (f : ι → Subgroup G) (hs : ∀ i ∈ s, (f i).FiniteIndex) :
    (⨅ i ∈ s, f i).FiniteIndex

{G : Type u_1}
[Group G]
{ι : Type u_3}
{s : Finset ι}
(f : ι → Subgroup G)
(hs : ∀ i ∈ s, (f i).FiniteIndex)


theorem le_rightLim (h : x < y) : f y ≤ rightLim f x

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[ConditionallyCompleteLinearOrder β]
[TopologicalSpace β]
[OrderTopology β]
{f : α → β}
(hf : Antitone f)
{x y : α}
(h : x < y)


lemma Filter.HasBasis.nhdsSet_interior {ι : Sort*} {p : ι → Prop} {s : ι → Set X} {t : Set X}
    (h : (𝓝ˢ t).HasBasis p s) : (𝓝ˢ t).HasBasis p (interior <| s ·)

{X : Type u_1}
[TopologicalSpace X]
{ι : Sort u_3}
{p : ι → Prop}
{s : ι → Set X}
{t : Set X}
(h : (𝓝ˢ t).HasBasis p s)

(𝓝ˢ t).HasBasis p fun x => interior (s x)


/-- The derivative of the `Γ` integral, at any `s ∈ ℂ` with `1 < re s`, is given by the Mellin
transform of `log t * exp (-t)`. -/
theorem hasDerivAt_GammaIntegral {s : ℂ} (hs : 0 < s.re) :
    HasDerivAt GammaIntegral (∫ t : ℝ in Ioi 0, t ^ (s - 1) * (Real.log t * Real.exp (-t))) s

HasDerivAt Complex.GammaIntegral (∫ (t : ℝ) in Set.Ioi 0, ↑t ^ (s - 1) * (↑(Real.log t) * ↑(rexp (-t)))) s


theorem apply_eq_iff_eq {α β} (f : α ↪ β) (x y : α) : f x = f y ↔ x = y

{α : Sort u_1}
{β : Sort u_2}
(f : α ↪ β)
(x y : α)


/-- The direction of an altitude. -/
theorem direction_altitude {n : ℕ} (s : Simplex ℝ P (n + 1)) (i : Fin (n + 2)) :
    (s.altitude i).direction =
      (vectorSpan ℝ (s.points '' ↑(Finset.univ.erase i)))ᗮ ⊓ vectorSpan ℝ (Set.range s.points)

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


theorem eLpNorm_mono {f : α → F} {g : α → G} (h : ∀ x, ‖f x‖ ≤ ‖g x‖) :
    eLpNorm f p μ ≤ eLpNorm g p μ

{α : Type u_1}
{F : Type u_3}
{G : Type u_4}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
[NormedAddCommGroup G]
{f : α → F}
{g : α → G}
(h : ∀ (x : α), ‖f x‖ ≤ ‖g x‖)

MeasureTheory.eLpNorm f p μ ≤ MeasureTheory.eLpNorm g p μ


lemma finset_inf'_nhds_apply [SemilatticeInf L] [ContinuousInf L]
    (hne : s.Nonempty) (hs : ∀ i ∈ s, Tendsto (f i) l (𝓝 (g i))) :
    Tendsto (fun a ↦ s.inf' hne (f · a)) l (𝓝 (s.inf' hne g))

(hs : ∀ i ∈ s, Filter.Tendsto (f i) l (𝓝 (g i)))

Filter.Tendsto (fun a => s.inf' hne fun x => f x a) l (𝓝 (s.inf' hne g))


@[simp]
theorem interior_iInter_of_finite [Finite ι] (f : ι → Set X) :
    interior (⋂ i, f i) = ⋂ i, interior (f i)

{X : Type u}
{ι : Sort w}
[TopologicalSpace X]
[Finite ι]
(f : ι → Set X)


theorem ae_restrict_neBot {s} : (ae <| μ.restrict s).NeBot ↔ μ s ≠ 0

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}

(MeasureTheory.ae (μ.restrict s)).NeBot ↔ μ s ≠ 0


@[simp]
theorem quotQuotEquivComm_mk_mk [CommRing R] (I J : Ideal R) (x : R) :
    quotQuotEquivComm I J (Ideal.Quotient.mk _ (Ideal.Quotient.mk _ x)) = algebraMap R _ x

{R : Type u}
[CommRing R]
(I J : Ideal R)
(x : R)

(DoubleQuot.quotQuotEquivComm I J) ((Ideal.Quotient.mk (Ideal.map (Ideal.Quotient.mk I) J)) ((Ideal.Quotient.mk I) x)) =
  (algebraMap R ((R ⧸ J) ⧸ Ideal.map (Ideal.Quotient.mk J) I)) x


@[simp]
theorem tmul_tensorRId_apply
    (Q₁ : QuadraticForm R M₁) (x : M₁ ⊗[R] R) :
    Q₁ (TensorProduct.rid R M₁ x) = Q₁.tmul (sq (R := R)) x

{R : Type uR}
{M₁ : Type uM₁}
[CommRing R]
[AddCommGroup M₁]
[Module R M₁]
[Invertible 2]
(Q₁ : QuadraticForm R M₁)
(x : M₁ ⊗[R] R)

Q₁ ((TensorProduct.rid R M₁) x) = (Q₁.tmul QuadraticMap.sq) x


/-- The bifunctor combining an `I`-indexed family of objects with a `J`-indexed family of objects
to obtain an `I ⊕ J`-indexed family of objects.
-/
@[simps]
def sum : (∀ i, C i) ⥤ (∀ j, D j) ⥤ ∀ s : I ⊕ J, Sum.elim C D s

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

[(j : J) → CategoryTheory.Category.{v₁, u₁} (D j)]

((CategoryTheory.Pi.sum C).obj X).map f s =
  match s with
  | Sum.inl i => CategoryTheory.CategoryStruct.id (X i)
  | Sum.inr j => f j


@[to_additive] lemma prod_sdiff_le_prod_sdiff :
    ∏ i ∈ s \ t, f i ≤ ∏ i ∈ t \ s, f i ↔ ∏ i ∈ s, f i ≤ ∏ i ∈ t, f i

{ι : Type u_1}
{M : Type u_4}
[OrderedCancelCommMonoid M]
{f : ι → M}
{s t : Finset ι}
[DecidableEq ι]


theorem map_eq_of_lt_sub (h : v x < v (y - x)) : v y = v x

{R : Type u_3}
{Γ₀ : Type u_4}
[LinearOrderedAddCommGroupWithTop Γ₀]
[Ring R]
(v : AddValuation R Γ₀)
{x y : R}
(h : v x < v (y - x))


theorem inv_strictAntiOn : StrictAntiOn (fun x : α => x⁻¹) (Set.Ioi 0)

{α : Type u_2}
[LinearOrderedSemifield α]


@[simp]
theorem iInf_toNonUnitalSubalgebra {ι : Sort*} (S : ι → NonUnitalStarSubalgebra R A) :
    (⨅ i, S i).toNonUnitalSubalgebra = ⨅ i, (S i).toNonUnitalSubalgebra

{R : Type u}
{A : Type v}
[CommSemiring R]
[StarRing R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[StarModule R A]
{ι : Sort u_1}
(S : ι → NonUnitalStarSubalgebra R A)


/-- A graded version of `Algebra`. An instance of `DirectSum.GAlgebra R A` endows `(⨁ i, A i)`
with an `R`-algebra structure. -/
class GAlgebra where
  toFun : R →+ A 0
  map_one : toFun 1 = GradedMonoid.GOne.one
  map_mul :
    ∀ r s, GradedMonoid.mk _ (toFun (r * s)) = .mk _ (GradedMonoid.GMul.mul (toFun r) (toFun s))
  commutes : ∀ (r) (x : GradedMonoid A), .mk _ (toFun r) * x = x * .mk _ (toFun r)
  smul_def : ∀ (r) (x : GradedMonoid A), r • x = .mk _ (toFun r) * x

{ι : Type uι}
{R : Type uR}
{A : ι → Type uA}
[DecidableEq ι]
[CommSemiring R]
[(i : ι) → AddCommMonoid (A i)]
[(i : ι) → Module R (A i)]
[AddMonoid ι]
[DirectSum.GSemiring A]
[self : DirectSum.GAlgebra R A]
(r : R)
(x : GradedMonoid A)

GradedMonoid.mk 0 (DirectSum.GAlgebra.toFun r) * x = x * GradedMonoid.mk 0 (DirectSum.GAlgebra.toFun r)


@[simp]
theorem zipWith_tail (x : Vector α n) (y : Vector β n) :
    (Vector.zipWith f x y).tail = Vector.zipWith f x.tail y.tail

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{n : ℕ}
(f : α → β → γ)
(x : Mathlib.Vector α n)
(y : Mathlib.Vector β n)

(Mathlib.Vector.zipWith f x y).tail = Mathlib.Vector.zipWith f x.tail y.tail


@[simp]
theorem decompositionMonoid_iff : DecompositionMonoid (Associates α) ↔ DecompositionMonoid α


@[to_additive]
theorem div_inter_subset : s / (t₁ ∩ t₂) ⊆ s / t₁ ∩ (s / t₂)

{α : Type u_2}
[DecidableEq α]
[Sub α]
{s t₁ t₂ : Finset α}


theorem le_of_lt_add_one {x y : PartENat} (h : x < y + 1) : x ≤ y


@[simp]
theorem eval_zero : eval (0 : σ → R) = constantCoeff

{R : Type u}
{σ : Type u_1}
[CommSemiring R]

MvPolynomial.eval 0 = MvPolynomial.constantCoeff


/-- Any well-founded relation can be extended to a well-ordering on that type. -/
theorem exists_well_order_ge : ∃ s, r ≤ s ∧ IsWellOrder α s

{α : Type u}
{r : α → α → Prop}
(hwf : WellFounded r)


/-- Non-dependent version of `Function.update_comp_eq_of_not_mem_range'` -/
theorem update_comp_eq_of_not_mem_range {α : Sort*} {β : Type*} {γ : Sort*} [DecidableEq β]
    (g : β → γ) {f : α → β} {i : β} (a : γ) (h : i ∉ Set.range f) : update g i a ∘ f = g ∘ f

{α : Sort u_6}
{β : Type u_7}
{γ : Sort u_8}
[DecidableEq β]
(g : β → γ)
{f : α → β}
{i : β}
(a : γ)
(h : i ∉ Set.range f)


theorem inter_comm (s₁ s₂ : Finset α) : s₁ ∩ s₂ = s₂ ∩ s₁

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

s₁ ∩ s₂ = s₂ ∩ s₁


theorem union_assoc {s₁ s₂ s₃ : AList β} : (s₁ ∪ s₂ ∪ s₃).entries ~ (s₁ ∪ (s₂ ∪ s₃)).entries

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


@[simp]
theorem tensorObj_one (X Y : Mon_ C) : (X ⊗ Y).one = (λ_ (𝟙_ C)).inv ≫ (X.one ⊗ Y.one)

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


@[simp]
theorem Finsupp.toMultiset_toFinsupp [DecidableEq α] (f : α →₀ ℕ) :
    Multiset.toFinsupp (Finsupp.toMultiset f) = f

{α : Type u_1}
[DecidableEq α]
(f : α →₀ ℕ)


@[simp, norm_cast]
theorem coe_natCast (n : ℕ) : (↑(n : R) : c.Quotient) = n

{R : Type u_2}
[AddMonoidWithOne R]
[Mul R]
(c : RingCon R)
(n : ℕ)


theorem mem_cons_of_mem (y : α) {a : α} : ∀ {s : Seq α}, a ∈ s → a ∈ cons y s

{α : Type u}
(y : α)
{a : α}
{s : Stream'.Seq α}


lemma frequently_iff_seq_forall {ι : Type*} {l : Filter ι} {p : ι → Prop}
    [l.IsCountablyGenerated] :
    (∃ᶠ n in l, p n) ↔ ∃ ns : ℕ → ι, Tendsto ns atTop l ∧ ∀ n, p (ns n)

{ι : Type u_6}
{l : Filter ι}
{p : ι → Prop}
[l.IsCountablyGenerated]

(∃ᶠ (n : ι) in l, p n) ↔ ∃ ns, Filter.Tendsto ns Filter.atTop l ∧ ∀ (n : ℕ), p (ns n)


protected theorem map_smul (f : V →ₗ[K] V₂) (p : Submodule K V) (a : K) (h : a ≠ 0) :
    p.map (a • f) = p.map f

{K : Type u_9}
{V : Type u_10}
{V₂ : Type u_11}
[Semifield K]
[AddCommMonoid V]
[Module K V]
[AddCommMonoid V₂]
[Module K V₂]
(f : V →ₗ[K] V₂)
(p : Submodule K V)
(a : K)
(h : a ≠ 0)

Submodule.map (a • f) p = Submodule.map f p


/-- Two group isomorphisms `G ≃* G'` are equal if and only if they agree on a generator of `G`. -/
@[to_additive
   "Two isomorphisms `G ≃+ G'` of additive groups are equal if and only if they agree
   on a generator of `G`."]
lemma MulEquiv.eq_iff_eq_on_generator (f₁ f₂ : G ≃* G') : f₁ = f₂ ↔ f₁ g = f₂ g

(hg : ∀ (x : G), x ∈ Subgroup.zpowers g)


@[simp]
theorem type_def' (w : WellOrder) : ⟦w⟧ = type w.r


theorem prod_int_mod (s : Multiset ℤ) (n : ℤ) : s.prod % n = (s.map (· % n)).prod % n

s.prod % n = (Multiset.map (fun x => x % n) s).prod % n


@[simp]
theorem OrderIso.dualAntisymmetrization_apply (a : α) :
    OrderIso.dualAntisymmetrization _ (toDual <| toAntisymmetrization _ a) =
      toAntisymmetrization _ (toDual a)

(OrderIso.dualAntisymmetrization α) (OrderDual.toDual (toAntisymmetrization (fun x x_1 => x ≤ x_1) a)) =
  toAntisymmetrization (fun x x_1 => x ≤ x_1) (OrderDual.toDual a)


theorem Coprime.coprime_dvd_left (H1 : m ∣ k) (H2 : Coprime k n) : Coprime m n

{m k n : Nat}
(H1 : m ∣ k)
(H2 : k.Coprime n)


@[to_additive (attr := simp)]
theorem noncommProd_empty (h) : noncommProd (0 : Multiset α) h = 1

{α : Type u_3}
[AddMonoid α]
(h : {x | x ∈ 0}.Pairwise AddCommute)


theorem val_preimage_orbit {p : SubMulAction R M} (m : p) :
    Subtype.val ⁻¹' MulAction.orbit R (m : M) = MulAction.orbit R m

{R : Type u}
{M : Type v}
[Monoid R]
[MulAction R M]
{p : SubMulAction R M}
(m : ↥p)

Subtype.val ⁻¹' MulAction.orbit R ↑m = MulAction.orbit R m


@[simp]
theorem ofSubtype_swap_eq {p : α → Prop} [DecidablePred p] (x y : Subtype p) :
    ofSubtype (Equiv.swap x y) = Equiv.swap ↑x ↑y

{α : Type u_1}
[DecidableEq α]
{p : α → Prop}
[DecidablePred p]
(x y : Subtype p)

Equiv.Perm.ofSubtype (Equiv.swap x y) = Equiv.swap ↑x ↑y


theorem mk_preimage_of_injective_of_subset_range (f : α → β) (s : Set β) (h : Injective f)
    (h2 : s ⊆ range f) : #(f ⁻¹' s) = #s

{α β : Type u}
(f : α → β)
(s : Set β)
(h : Function.Injective f)
(h2 : s ⊆ Set.range f)


@[to_additive]
theorem IsOpen.inv (hs : IsOpen s) : IsOpen s⁻¹

{G : Type w}
[TopologicalSpace G]
[InvolutiveInv G]
[ContinuousInv G]
{s : Set G}
(hs : IsOpen s)


/-- Assumes left covariance. -/
theorem Left.mul_lt_of_le_of_lt_one_of_pos [PosMulStrictMono α] (ha : a ≤ 1) (hb : b < 1)
    (a0 : 0 < a) : a * b < 1

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


/-- A `PartialHomeomorph` is a local homeomorphism on its source. -/
lemma PartialHomeomorph.isLocalHomeomorphOn (e : PartialHomeomorph X Y) :
    IsLocalHomeomorphOn e e.source

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)


@[simp]
theorem deg_zero : (0 : NumDenSameDeg 𝒜 x).deg = 0

{ι : Type u_1}
{R : Type u_2}
{A : Type u_3}
[AddCommMonoid ι]
[DecidableEq ι]
[CommRing R]
[CommRing A]
[Algebra R A]
{𝒜 : ι → Submodule R A}
[GradedAlgebra 𝒜]
(x : Submonoid A)

HomogeneousLocalization.NumDenSameDeg.deg 0 = 0


@[simp]
theorem monovary_toDual_right : Monovary f (toDual ∘ g) ↔ Antivary f g

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
{f : ι → α}
{g : ι → β}

Monovary f (⇑OrderDual.toDual ∘ g) ↔ Antivary f g


@[simp, mfld_simps]
theorem right_inv {x : Y} (h : x ∈ e.target) : e (e.symm x) = x

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)
{x : Y}
(h : x ∈ e.target)


@[simp]
theorem leftDualIso_id {X Y : C} (p : ExactPairing X Y) : leftDualIso p p = Iso.refl X

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{X Y : C}
(p : CategoryTheory.ExactPairing X Y)

CategoryTheory.leftDualIso p p = CategoryTheory.Iso.refl X


@[simp, norm_cast] lemma even_coe_nat (n : ℕ) : Even (n : ℤ) ↔ Even n


theorem locally_const_basicOpen (U : Opens (PrimeSpectrum.Top R))
    (s : (structureSheaf R).1.obj (op U)) (x : U) :
    ∃ (f g : R) (i : PrimeSpectrum.basicOpen g ⟶ U), x.1 ∈ PrimeSpectrum.basicOpen g ∧
      (const R f g (PrimeSpectrum.basicOpen g) fun y hy => hy) =
      (structureSheaf R).1.map i.op s

(U : TopologicalSpace.Opens ↑(AlgebraicGeometry.PrimeSpectrum.Top R))

(s : ↑((AlgebraicGeometry.Spec.structureSheaf R).val.obj (Opposite.op U)))

∃ f g i,
  ↑x ∈ PrimeSpectrum.basicOpen g ∧
    AlgebraicGeometry.StructureSheaf.const R f g (PrimeSpectrum.basicOpen g) ⋯ =
      ((AlgebraicGeometry.Spec.structureSheaf R).val.map i.op) s


theorem mul_self_num (q : ℚ) : (q * q).num = q.num * q.num


@[simp 1001] -- Porting note: increase priority so that this triggers before `isLittleO_const_left`
theorem isLittleO_const_const_iff [NeBot l] {d : E''} {c : F''} :
    ((fun _x => d) =o[l] fun _x => c) ↔ d = 0

{α : Type u_1}
{E'' : Type u_9}
{F'' : Type u_10}
[NormedAddCommGroup E'']
[NormedAddCommGroup F'']
{l : Filter α}
[l.NeBot]
{d : E''}
{c : F''}


@[to_additive vadd_eq_of_mul_dvd]
theorem smul_eq_of_mul_dvd (hn : 0 < n) (han : orderOf a ^ 2 ∣ n) :
    a • approxOrderOf A n δ = approxOrderOf A n δ

{A : Type u_1}
[SeminormedAddCommGroup A]
{a : A}
{n : ℕ}
(δ : ℝ)
(hn : 0 < n)
(han : addOrderOf a ^ 2 ∣ n)

a +ᵥ approxAddOrderOf A n δ = approxAddOrderOf A n δ


@[simp]
theorem pderivCLM_apply (m : E) (f : 𝓢(E, F)) (x : E) : pderivCLM 𝕜 m f x = fderiv ℝ f x m

(𝕜 : Type u_1)
{E : Type u_4}
{F : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
[RCLike 𝕜]
[NormedSpace 𝕜 F]
[SMulCommClass ℝ 𝕜 F]
(m : E)
(f : SchwartzMap E F)
(x : E)

((SchwartzMap.pderivCLM 𝕜 m) f) x = (fderiv ℝ (⇑f) x) m


@[simp]
theorem MultilinearMap.curryLeft_apply (f : MultilinearMap R M M₂) (x : M 0)
    (m : ∀ i : Fin n, M i.succ) : f.curryLeft x m = f (cons x m)

[(i : Fin n.succ) → AddCommMonoid (M i)]


theorem congr_app {α β : F ⟶ G} (h : α = β) (X : C) : α.app X = β.app X

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F G : CategoryTheory.Functor C D}
{α β : F ⟶ G}
(h : α = β)
(X : C)