private theorem teichmuller_mul_aux₂ (x y : MvPolynomial R ℤ) :
    teichmullerFun p (x * y) = teichmullerFun p x * teichmullerFun p y

(p : ℕ)
{R : Type u_1}
[hp : Fact (Nat.Prime p)]
(x y : MvPolynomial R ℤ)

WittVector.teichmullerFun p (x * y) = WittVector.teichmullerFun p x * WittVector.teichmullerFun p y


theorem fderivWithin.comp_derivWithin {t : Set F} (hl : DifferentiableWithinAt 𝕜 l t (f x))
    (hf : DifferentiableWithinAt 𝕜 f s x) (hs : MapsTo f s t) (hxs : UniqueDiffWithinAt 𝕜 s x) :
    derivWithin (l ∘ f) s x = (fderivWithin 𝕜 l t (f x) : F → E) (derivWithin f s x)

derivWithin (l ∘ f) s x = (fderivWithin 𝕜 l t (f x)) (derivWithin f s x)


lemma tendsto_closedBall_smallSets (x : α) : Tendsto (closedBall x) (𝓝 0) (𝓝 x).smallSets

{α : Type u_2}
[PseudoMetricSpace α]
(x : α)

Filter.Tendsto (Metric.closedBall x) (𝓝 0) (𝓝 x).smallSets


/-- **Equational criterion for vanishing**
[A. Altman and S. Kleiman, *A term of commutative algebra* (Lemma 8.16)][altman2021term],
forward direction.

Assume that the $m_i$ generate $M$. If the expression $\sum_i m_i \otimes n_i$
vanishes, then it vanishes trivially. -/
theorem vanishesTrivially_of_sum_tmul_eq_zero (hm : Submodule.span R (Set.range m) = ⊤)
    (hmn : ∑ i, m i ⊗ₜ n i = (0 : M ⊗[R] N)) : VanishesTrivially R m n


theorem HasGradientAtFilter.isBigO_sub (h : HasGradientAtFilter f f' x L) :
    (fun x' => f x' - f x) =O[L] fun x' => x' - x

{𝕜 : Type u_1}
{F : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
{f : F → 𝕜}
{f' x : F}
{L : Filter F}
(h : HasGradientAtFilter f f' x L)


theorem map_map (g : S →ₙ+* T) (f : R →ₙ+* S) : (s.map f).map g = s.map (g.comp f)

{R : Type u}
{S : Type v}
{T : Type u_1}
[NonUnitalNonAssocRing R]
[NonUnitalNonAssocRing S]
[NonUnitalNonAssocRing T]
(s : NonUnitalSubring R)
(g : S →ₙ+* T)
(f : R →ₙ+* S)

NonUnitalSubring.map g (NonUnitalSubring.map f s) = NonUnitalSubring.map (g.comp f) s


@[simp]
theorem liftMonoidWithZeroHom_apply_div' {L : Type*} [CommGroupWithZero L]
    (φ : MonoidWithZeroHom K[X] L) (hφ : K[X]⁰ ≤ L⁰.comap φ) (p q : K[X]) :
    liftMonoidWithZeroHom φ hφ (algebraMap _ _ p) / liftMonoidWithZeroHom φ hφ (algebraMap _ _ q) =
      φ p / φ q

{K : Type u}
[CommRing K]
[IsDomain K]
{L : Type u_1}
[CommGroupWithZero L]
(φ : K[X] →*₀ L)
(hφ : K[X]⁰ ≤ Submonoid.comap φ L⁰)
(p q : K[X])

(RatFunc.liftMonoidWithZeroHom φ hφ) ((algebraMap K[X] (RatFunc K)) p) /
    (RatFunc.liftMonoidWithZeroHom φ hφ) ((algebraMap K[X] (RatFunc K)) q) =
  φ p / φ q


theorem isMittagLeffler_iff_eventualRange :
    F.IsMittagLeffler ↔ ∀ j : J, ∃ (i : _) (f : i ⟶ j), F.eventualRange j = range (F.map f)

{J : Type u}
[CategoryTheory.Category.{u_1, u} J]
(F : J ⥤ Type v)

F.IsMittagLeffler ↔ ∀ (j : J), ∃ i f, F.eventualRange j = Set.range (F.map f)


/-- An instance of `IsScalarTower M N α` states that the multiplicative
action of `M` on `α` is determined by the multiplicative actions of `M` on `N`
and `N` on `α`. -/
@[to_additive VAddAssocClass] -- TODO auto-translating
class IsScalarTower (M N α : Type*) [SMul M N] [SMul N α] [SMul M α] : Prop where
  /-- Associativity of `•` -/
  smul_assoc : ∀ (x : M) (y : N) (z : α), (x • y) • z = x • y • z

{M : Type u_11}
{N : Type u_12}
{α : Type u_13}
[SMul M N]
[SMul N α]
[SMul M α]
[self : IsScalarTower M N α]
(x : M)
(y : N)
(z : α)


/-- Summing `a^s.card * b^(n-s.card)` over all finite subsets `s` of a `Finset`
gives `(a + b)^s.card`. -/
theorem sum_pow_mul_eq_add_pow (a b : α) (s : Finset ι) :
    (∑ t ∈ s.powerset, a ^ t.card * b ^ (s.card - t.card)) = (a + b) ^ s.card

{ι : Type u_1}
{α : Type u_2}
[CommSemiring α]
(a b : α)
(s : Finset ι)

∑ t ∈ s.powerset, a ^ t.card * b ^ (s.card - t.card) = (a + b) ^ s.card


@[to_additive (attr := simp)]
lemma orbitRel.Quotient.orbit.coe_smul {g : G} {x : orbitRel.Quotient G α} {a : x.orbit} :
    ↑(g • a) = g • (a : α)

{G : Type u_1}
{α : Type u_2}
[Group G]
[MulAction G α]
{g : G}
{x : MulAction.orbitRel.Quotient G α}
{a : ↑x.orbit}


theorem isComplete [Nonempty M] : (L.completeTheory M).IsComplete

(L : FirstOrder.Language)
(M : Type w)
[L.Structure M]
[Nonempty M]


/-- A variant of `lift_unique` with `Z` a terminal object. -/
@[simps!]
def liftToTerminalUnique {D : Type*} [Category D] {Z : D} (F : C ⥤ D) (hZ : Limits.IsTerminal Z)
    (G : WithTerminal C ⥤ D) (h : incl ⋙ G ≅ F) (hG : G.obj star ≅ Z) : G ≅ liftToTerminal F hZ

(hZ : CategoryTheory.Limits.IsTerminal Z)

(G : CategoryTheory.Functor (CategoryTheory.WithTerminal C) D)

(h : CategoryTheory.WithTerminal.incl.comp G ≅ F)

(hG : G.obj CategoryTheory.WithTerminal.star ≅ Z)

(CategoryTheory.WithTerminal.liftToTerminalUnique F hZ G h hG).inv.app X =
  (match X with
    | CategoryTheory.WithTerminal.of x => h.app x
    | CategoryTheory.WithTerminal.star => hG).inv


lemma natCast_eq_divNat (n : ℕ) : (n : ℚ≥0) = divNat n 1


/-- Send a set of `x`s in a finite extension `L` of the fraction field of `R`
to `(y : R) • x ∈ integralClosure R L`. -/
theorem exists_integral_multiples (s : Finset L) :
    ∃ y ≠ (0 : A), ∀ x ∈ s, IsIntegral A (y • x)

(A : Type u_2)
(K : Type u_3)
[CommRing A]
[Field K]
[IsDomain A]
[Algebra A K]
[IsFractionRing A K]
{L : Type u_4}
[Field L]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[FiniteDimensional K L]
(s : Finset L)

∃ y, y ≠ 0 ∧ ∀ x ∈ s, IsIntegral A (y • x)


theorem dvd_of_mem_factors {a p : Associates α} (hm : p ∈ factors a) :
    p ∣ a

{α : Type u_1}
[CancelCommMonoidWithZero α]
[UniqueFactorizationMonoid α]
{a p : Associates α}
(hm : p ∈ a.factors)


lemma leftUnitor_inv_apply (i : I) :
    (leftUnitor X).inv i = (λ_ (X i)).inv ≫ tensorUnit₀.inv ▷ (X i) ≫
      ιTensorObj tensorUnit X 0 i i (zero_add i)

[(X₂ : C) →
    CategoryTheory.Limits.PreservesColimit (CategoryTheory.Functor.empty C)
      ((CategoryTheory.MonoidalCategory.curriedTensor C).flip.obj X₂)]

(CategoryTheory.GradedObject.Monoidal.leftUnitor X).inv i =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.leftUnitor (X i)).inv
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.MonoidalCategory.whiskerRight CategoryTheory.GradedObject.Monoidal.tensorUnit₀.inv (X i))
      (CategoryTheory.GradedObject.Monoidal.ιTensorObj CategoryTheory.GradedObject.Monoidal.tensorUnit X 0 i i ⋯))


theorem IntegrableAtFilter.inf_of_left (hl : IntegrableAtFilter f l μ) :
    IntegrableAtFilter f (l ⊓ l') μ

(hl : MeasureTheory.IntegrableAtFilter f l μ)

MeasureTheory.IntegrableAtFilter f (l ⊓ l') μ


@[to_additive tsum_nat_add_neg_add_one]
lemma tprod_nat_mul_neg_add_one [T2Space M] {f : ℤ → M} (hf : Multipliable f) :
    ∏' (n : ℕ), (f n * f (-(n + 1))) = ∏' (n : ℤ), f n

{M : Type u_1}
[CommMonoid M]
[TopologicalSpace M]
[T2Space M]
{f : ℤ → M}
(hf : Multipliable f)


@[to_additive (attr := simp)]
theorem units_inv_right_iff : Commute a ↑u⁻¹ ↔ Commute a u

{M : Type u_1}
[Monoid M]
{a : M}
{u : Mˣ}


@[simp]
theorem one_le_ceil_iff : 1 ≤ ⌈a⌉₊ ↔ 0 < a

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
{a : α}

1 ≤ ⌈a⌉₊ ↔ 0 < a


theorem sup_inf_inf_sdiff : x ⊓ y ⊓ z ⊔ y \ z = x ⊓ y ⊔ y \ z

{α : Type u}
{x y z : α}
[GeneralizedBooleanAlgebra α]


/-- Transfer the arguments to a map along an equivalence between argument indices.

The naming is derived from `Finsupp.domCongr`, noting that here the permutation applies to the
domain of the domain. -/
@[simps apply]
def domDomCongr (σ : ι₁ ≃ ι₂) (m : MultilinearMap R (fun _ : ι₁ => M₂) M₃) :
    MultilinearMap R (fun _ : ι₂ => M₂) M₃

{R : Type uR}
{M₂ : Type v₂}
{M₃ : Type v₃}
[Semiring R]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R M₂]
[Module R M₃]
{ι₁ : Type u_1}
{ι₂ : Type u_2}
(σ : ι₁ ≃ ι₂)
(m : MultilinearMap R (fun x => M₂) M₃)
(v : ι₂ → M₂)

(MultilinearMap.domDomCongr σ m) v = m fun i => v (σ i)


@[simp]
theorem fract_nat_add (n : ℕ) (a : α) : fract (↑n + a) = fract a

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


/-- Determinant of a 2×2 block matrix, expanded around an invertible bottom right element in terms
of the Schur complement. -/
theorem det_fromBlocks₂₂ (A : Matrix m m α) (B : Matrix m n α) (C : Matrix n m α)
    (D : Matrix n n α) [Invertible D] :
    (Matrix.fromBlocks A B C D).det = det D * det (A - B * ⅟ D * C)

{m : Type u_2}
{n : Type u_3}
{α : Type u_4}
[Fintype m]
[Fintype n]
[DecidableEq m]
[DecidableEq n]
[CommRing α]
(A : Matrix m m α)
(B : Matrix m n α)
(C : Matrix n m α)
(D : Matrix n n α)
[Invertible D]

(Matrix.fromBlocks A B C D).det = D.det * (A - B * ⅟D * C).det


@[to_additive (attr := simp)]
theorem one_div (a : G) : 1 / a = a⁻¹


@[simp] theorem neg_num (a : Rat) : (-a).num = -a.num


@[parity_simps] lemma even_sub_one : Even (n - 1) ↔ ¬Even n


@[simp]
theorem coe_toCompacts (s : PositiveCompacts α) : (s.toCompacts : Set α) = s

(s : TopologicalSpace.PositiveCompacts α)


@[simp]
theorem toNNRat_add (hq : 0 ≤ q) (hp : 0 ≤ p) : toNNRat (q + p) = toNNRat q + toNNRat p


theorem mem_range_le {n x : ℕ} (hx : x ∈ range n) : x ≤ n


theorem Icc_mem_vitaliFamily_at_left {x y : ℝ} (hxy : x < y) :
    Icc x y ∈ (vitaliFamily (volume : Measure ℝ) 1).setsAt y

Set.Icc x y ∈ (IsUnifLocDoublingMeasure.vitaliFamily MeasureTheory.volume 1).setsAt y


theorem fderivWithin_inter (ht : t ∈ 𝓝 x) : fderivWithin 𝕜 f (s ∩ t) x = fderivWithin 𝕜 f s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{s t : Set E}
(ht : t ∈ 𝓝 x)


theorem isClosed_range_inl : IsClosed (range (inl : X → X ⊕ Y))

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]


lemma mem_baseChange_iff {m : A ⊗[R] M} :
    m ∈ N.baseChange A ↔
    m ∈ Submodule.span A ((N : Submodule R M).map (TensorProduct.mk R A M 1))

(R : Type u_1)
(A : Type u_2)
(L : Type u_3)
(M : Type u_4)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[CommRing A]
[Algebra R A]
{N : LieSubmodule R L M}
{m : A ⊗[R] M}

m ∈ LieSubmodule.baseChange A N ↔ m ∈ Submodule.span A ↑(Submodule.map ((TensorProduct.mk R A M) 1) ↑N)


theorem zero_apply (x : M) : (0 : M ≃ₛₗ[σ₁₂] M₂) x = 0

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_8}
{M₂ : Type u_10}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[Subsingleton M]
[Subsingleton M₂]
(x : M)


theorem max_eq_sup_coe {s : Finset α} : s.max = s.sup (↑)

{α : Type u_2}
[LinearOrder α]
{s : Finset α}


theorem size_balanceR {l x r} (hl : Balanced l) (hr : Balanced r) (sl : Sized l) (sr : Sized r)
    (H : (∃ l', Raised (size l) l' ∧ BalancedSz l' (size r)) ∨
        ∃ r', Raised r' (size r) ∧ BalancedSz (size l) r') :
    size (@balanceR α l x r) = size l + size r + 1

(H :
  (∃ l', Ordnode.Raised l.size l' ∧ Ordnode.BalancedSz l' r.size) ∨
    ∃ r', Ordnode.Raised r' r.size ∧ Ordnode.BalancedSz l.size r')

(l.balanceR x r).size = l.size + r.size + 1


/-- If a measure `μ` on the quotient `G ⧸ Γ` of a group `G` by a discrete normal subgroup `Γ` having
fundamental domain, satisfies `QuotientMeasureEqMeasurePreimage` relative to a standardized choice
of Haar measure on `G`, and assuming `μ` is finite, then `μ` is itself Haar.
TODO: Is it possible to drop the assumption that `μ` is finite? -/
@[to_additive "If a measure `μ` on the quotient `G ⧸ Γ` of an additive group `G` by a discrete
normal subgroup `Γ` having fundamental domain, satisfies `AddQuotientMeasureEqMeasurePreimage`
relative to a standardized choice of Haar measure on `G`, and assuming `μ` is finite, then `μ` is
itself Haar."]
theorem MeasureTheory.QuotientMeasureEqMeasurePreimage.haarMeasure_quotient [LocallyCompactSpace G]
    [QuotientMeasureEqMeasurePreimage ν μ] [i : HasFundamentalDomain Γ.op G ν]
    [IsFiniteMeasure μ] : IsHaarMeasure μ

[i : MeasureTheory.HasFundamentalDomain (↥Γ.op) G ν]


theorem single_smul₀ {g : I → Type*} [∀ i, MonoidWithZero (f i)] [∀ i, AddMonoid (g i)]
    [∀ i, DistribMulAction (f i) (g i)] [DecidableEq I] (i : I) (r : f i) (x : g i) :
    single i (r • x) = single i r • single i x

[(i : I) → DistribMulAction (f i) (g i)]

Pi.single i (r • x) = Pi.single i r • Pi.single i x


theorem div_nat (h : Irrational x) {m : ℕ} (hm : m ≠ 0) : Irrational (x / m)

{x : ℝ}
(h : Irrational x)
{m : ℕ}
(hm : m ≠ 0)


/-- The norms of two vectors on the same ray are equal if and only if they are equal. -/
theorem SameRay.norm_eq_iff (h : SameRay ℝ x y) : ‖x‖ = ‖y‖ ↔ x = y

{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{x y : F}
(h : SameRay ℝ x y)


/-- `IsTrichotomous X lt` means that the binary relation `lt` on `X` is trichotomous, that is,
either `lt a b` or `a = b` or `lt b a` for any `a` and `b`. -/
class IsTrichotomous (α : Sort u) (lt : α → α → Prop) : Prop where
  trichotomous : ∀ a b, lt a b ∨ a = b ∨ lt b a

{α : Sort u}
{lt : α → α → Prop}
[self : IsTrichotomous α lt]
(a b : α)


@[to_additive]
theorem prod_le_hasProd (s : Finset ι) (hs : ∀ i, i ∉ s → 1 ≤ f i) (hf : HasProd f a) :
    ∏ i ∈ s, f i ≤ a

{ι : Type u_1}
{α : Type u_3}
[OrderedAddCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{f : ι → α}
{a : α}
(s : Finset ι)
(hs : ∀ i ∉ s, 0 ≤ f i)
(hf : HasSum f a)


theorem uniformity :
    𝓤 (Matrix m n 𝕜) = ⨅ (i : m) (j : n), (𝓤 𝕜).comap fun a => (a.1 i j, a.2 i j)

(m : Type u_1)
(n : Type u_2)
(𝕜 : Type u_3)
[UniformSpace 𝕜]

𝓤 (Matrix m n 𝕜) = ⨅ i, ⨅ j, Filter.comap (fun a => (a.1 i j, a.2 i j)) (𝓤 𝕜)


nonrec theorem ContinuousAt.rpow (hf : ContinuousAt f x) (hg : ContinuousAt g x)
    (h : f x ≠ 0 ∨ 0 < g x) : ContinuousAt (fun t => f t ^ g t) x

{α : Type u_1}
[TopologicalSpace α]
{f g : α → ℝ}
{x : α}
(hf : ContinuousAt f x)
(hg : ContinuousAt g x)
(h : f x ≠ 0 ∨ 0 < g x)


protected lemma Bornology.IsBounded.subset_Icc_sInf_sSup (hs : IsBounded s) :
    s ⊆ Icc (sInf s) (sSup s)

{α : Type u_1}
[Bornology α]
[ConditionallyCompleteLattice α]
[IsOrderBornology α]
{s : Set α}
(hs : Bornology.IsBounded s)


theorem d_squared (n : ℕ) : objD X n ≫ objD X (n + 1) = 0

(X : CategoryTheory.CosimplicialObject C)

AlgebraicTopology.AlternatingCofaceMapComplex.objD X n ≫ AlgebraicTopology.AlternatingCofaceMapComplex.objD X (n + 1) =
  0


/-- An equivalence between opposite categories gives an equivalence between the original categories.
-/
@[simps]
def unop (e : Cᵒᵖ ≌ Dᵒᵖ) : C ≌ D

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


/-- The defining property of an adic cauchy sequence unwrapped. -/
theorem mk_eq_mk {m n : ℕ} (hmn : m ≤ n) (f : AdicCauchySequence I M) :
    Submodule.Quotient.mk (p := (I ^ m • ⊤ : Submodule R M)) (f n) =
      Submodule.Quotient.mk (p := (I ^ m • ⊤ : Submodule R M)) (f m)

(f : AdicCompletion.AdicCauchySequence I M)

Submodule.Quotient.mk (↑f n) = Submodule.Quotient.mk (↑f m)


@[simp]
theorem divMonomial_mul_monomial (a : σ →₀ ℕ) (x : MvPolynomial σ R) :
    x * monomial a 1 /ᵐᵒⁿᵒᵐⁱᵃˡ a = x

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
(a : σ →₀ ℕ)
(x : MvPolynomial σ R)

(x * (MvPolynomial.monomial a) 1).divMonomial a = x


@[simp] lemma coe_wcovBy_coe : (s : Set α) ⩿ t ↔ s ⩿ t

↑s ⩿ ↑t ↔ s ⩿ t


/-- The order of a formal power series is exactly `n` if the `n`th coefficient is nonzero,
and the `i`th coefficient is `0` for all `i < n`. -/
theorem order_eq_nat {φ : R⟦X⟧} {n : ℕ} :
    order φ = n ↔ coeff R n φ ≠ 0 ∧ ∀ i, i < n → coeff R i φ = 0

{R : Type u_1}
[Semiring R]
{φ : PowerSeries R}
{n : ℕ}

φ.order = ↑n ↔ (PowerSeries.coeff R n) φ ≠ 0 ∧ ∀ i < n, (PowerSeries.coeff R i) φ = 0


theorem mem_span_insert' {s : Set α} {x y} : x ∈ span (insert y s) ↔ ∃ a, x + a * y ∈ span s

{α : Type u}
[Ring α]
{s : Set α}
{x y : α}

x ∈ Ideal.span (insert y s) ↔ ∃ a, x + a * y ∈ Ideal.span s


theorem isClosed (s : IrreducibleCloseds α) : IsClosed (s : Set α)

(s : TopologicalSpace.IrreducibleCloseds α)


@[elab_as_elim]
theorem inductionOn₂ {p : Cardinal → Cardinal → Prop} (c₁ : Cardinal) (c₂ : Cardinal)
    (h : ∀ α β, p #α #β) : p c₁ c₂

{p : Cardinal.{u_1} → Cardinal.{u_2} → Prop}

(h : ∀ (α : Type u_1) (β : Type u_2), p (Cardinal.mk α) (Cardinal.mk β))


@[simp]
theorem append_left :
    ∀ {m} (i : Fin2 m) (v : Vector3 α m) {n} (w : Vector3 α n), (v +-+ w) (left n i) = v i

{α : Type u_1}
{m : ℕ}
(i : Fin2 m)
(v : Vector3 α m)
{n : ℕ}
(w : Vector3 α n)


/-- A variant of `Matrix.toLin'_submatrix` that keeps around `LinearEquiv`s. -/
theorem Matrix.toLin'_reindex [Fintype l] [DecidableEq l] (e₁ : k ≃ m) (e₂ : l ≃ n)
    (M : Matrix k l R) :
    Matrix.toLin' (reindex e₁ e₂ M) =
      ↑(LinearEquiv.funCongrLeft R R e₁.symm) ∘ₗ (Matrix.toLin' M) ∘ₗ
        ↑(LinearEquiv.funCongrLeft R R e₂)

{R : Type u_1}
[CommSemiring R]
{k : Type u_2}
{l : Type u_3}
{m : Type u_4}
{n : Type u_5}
[DecidableEq n]
[Fintype n]
[Fintype l]
[DecidableEq l]
(e₁ : k ≃ m)
(e₂ : l ≃ n)
(M : Matrix k l R)

Matrix.toLin' ((Matrix.reindex e₁ e₂) M) =
  ↑(LinearEquiv.funCongrLeft R R e₁.symm) ∘ₗ Matrix.toLin' M ∘ₗ ↑(LinearEquiv.funCongrLeft R R e₂)


theorem Products.isGood_nil : Products.isGood ({fun _ ↦ false} : Set (I → Bool)) Products.nil

Profinite.NobelingProof.Products.isGood {fun x => false} Profinite.NobelingProof.Products.nil


theorem mul_apply_antidiagonal [Mul G] (f g : MonoidAlgebra k G) (x : G) (s : Finset (G × G))
    (hs : ∀ {p : G × G}, p ∈ s ↔ p.1 * p.2 = x) : (f * g) x = ∑ p ∈ s, f p.1 * g p.2


theorem sdiff_erase_self (ha : a ∈ s) : s \ s.erase a = {a}

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


/-- If `x : α` is in some `S ∈ 𝔖`, then evaluation at `x` is uniformly continuous on
`α →ᵤ[𝔖] β`. -/
theorem uniformContinuous_eval_of_mem {x : α} (hxs : x ∈ s) (hs : s ∈ 𝔖) :
    UniformContinuous ((Function.eval x : (α → β) → β) ∘ toFun 𝔖)

{α : Type u_1}
(β : Type u_2)
{s : Set α}
[UniformSpace β]
(𝔖 : Set (Set α))
{x : α}
(hxs : x ∈ s)
(hs : s ∈ 𝔖)

UniformContinuous (Function.eval x ∘ ⇑(UniformOnFun.toFun 𝔖))


protected theorem subset (hAB : IsExposed 𝕜 A B) : B ⊆ A

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


theorem of_irreducible_mul {α} [Monoid α] {x y : α} : Irreducible (x * y) → IsUnit x ∨ IsUnit y


/-- The inverse rotation of triangles gives an endofunctor on the category of triangles in `C`.
-/
@[simps]
def invRotate : Triangle C ⥤ Triangle C

(T : CategoryTheory.Pretriangulated.Triangle C)

(CategoryTheory.Pretriangulated.invRotate C).obj T = T.invRotate


@[simp]
theorem stdBasis_apply_ofIsComplex_fst (x : E K) (w : {w : InfinitePlace K // IsComplex w}) :
    (stdBasis K).repr x (Sum.inr ⟨w, 0⟩) = (x.2 w).re

(x : ({ w // w.IsReal } → ℝ) × ({ w // w.IsComplex } → ℂ))

((NumberField.mixedEmbedding.stdBasis K).repr x) (Sum.inr (w, 0)) = (x.2 w).re


theorem mkAlgHom_rel {s : A → A → Prop} {x y : A} (w : s x y) :
    mkAlgHom S s x = mkAlgHom S s y

(S : Type uS)
[CommSemiring S]
{A : Type uA}
[Semiring A]
[Algebra S A]
{s : A → A → Prop}
{x y : A}
(w : s x y)

(RingQuot.mkAlgHom S s) x = (RingQuot.mkAlgHom S s) y


theorem himp_compl_comm (a b : α) : a ⇨ bᶜ = b ⇨ aᶜ

{α : Type u_2}
[HeytingAlgebra α]
(a b : α)


theorem of_map_inf [SemilatticeInf α] [SemilatticeSup β]
    (h : ∀ x ∈ s, ∀ y ∈ s, f (x ⊓ y) = f x ⊔ f y) : AntitoneOn f s

(h : ∀ (x : α), x ∈ s → ∀ (y : α), y ∈ s → f (x ⊓ y) = f x ⊔ f y)


@[simp]
lemma id_homMap (f : L₁.obj X ⟶ L₁.obj Y) :
    (id W₁).homMap L₁ L₁ f = f

{W₁ : CategoryTheory.MorphismProperty C₁}

(CategoryTheory.LocalizerMorphism.id W₁).homMap L₁ L₁ f = f


@[to_additive (attr := simp)]
theorem quotientiInfSubgroupOfEmbedding_apply_mk {ι : Type*} (f : ι → Subgroup α) (H : Subgroup α)
    (g : H) (i : ι) :
    quotientiInfSubgroupOfEmbedding f H (QuotientGroup.mk g) i =
      (QuotientGroup.mk g : { x // x ∈ H } ⧸ subgroupOf (f i) H)

{α : Type u_1}
[Group α]
{ι : Type u_2}
(f : ι → Subgroup α)
(H : Subgroup α)
(g : ↥H)
(i : ι)

(Subgroup.quotientiInfSubgroupOfEmbedding f H) (↑g) i = ↑g


/-- If `χ` is a primitive character, then the function `a ↦ gaussSum χ (e.mulShift a)`, for any
fixed additive character `e`, is a constant multiple of `χ⁻¹`. -/
lemma gaussSum_mulShift_of_isPrimitive [IsDomain R] {χ : DirichletCharacter R N}
    (hχ : IsPrimitive χ) (a : ZMod N) :
    gaussSum χ (e.mulShift a) = χ⁻¹ a * gaussSum χ e

{N : ℕ}
[NeZero N]
{R : Type u_1}
[CommRing R]
(e : AddChar (ZMod N) R)
[IsDomain R]
{χ : DirichletCharacter R N}
(hχ : χ.IsPrimitive)
(a : ZMod N)


/-- The Radon-Nikodym derivative of `f ν` with respect to `ν` is `f`. -/
theorem rnDeriv_withDensity (ν : Measure α) [SigmaFinite ν] {f : α → ℝ≥0∞} (hf : Measurable f) :
    (ν.withDensity f).rnDeriv ν =ᵐ[ν] f

{α : Type u_1}
{m : MeasurableSpace α}
(ν : MeasureTheory.Measure α)
[MeasureTheory.SigmaFinite ν]
{f : α → ℝ≥0∞}
(hf : Measurable f)


lemma f_int_negSucc (k : ℕ) {a : ℝ} (ha : a ≤ 1) (t : ℝ) (n : ℕ) :
    f_int k a t (Int.negSucc n) = f_nat k (1 - a) t n

HurwitzKernelBounds.f_int k a t (Int.negSucc n) = HurwitzKernelBounds.f_nat k (1 - a) t n


/-- The sequence `n / (2 * n + 1)` tends to `1/2` -/
theorem tendsto_self_div_two_mul_self_add_one :
    Tendsto (fun n : ℕ => (n : ℝ) / (2 * n + 1)) atTop (𝓝 (1 / 2))

Filter.Tendsto (fun n => ↑n / (2 * ↑n + 1)) Filter.atTop (𝓝 (1 / 2))


@[to_additive (attr := simp)]
theorem preimage_mul_right_ball [IsometricSMul Gᵐᵒᵖ G] (a b : G) (r : ℝ≥0∞) :
    (fun x => x * a) ⁻¹' ball b r = ball (b / a) r

{G : Type v}
[AddGroup G]
[PseudoEMetricSpace G]
[IsometricVAdd Gᵃᵒᵖ G]
(a b : G)
(r : ℝ≥0∞)

(fun x => x + a) ⁻¹' EMetric.ball b r = EMetric.ball (b - a) r


@[to_additive]
theorem hasProd_iff_hasProd {g : γ → α}
    (h₁ : ∀ u : Finset γ, ∃ v : Finset β, ∀ v', v ⊆ v' →
      ∃ u', u ⊆ u' ∧ ∏ x ∈ u', g x = ∏ b ∈ v', f b)
    (h₂ : ∀ v : Finset β, ∃ u : Finset γ, ∀ u', u ⊆ u' →
      ∃ v', v ⊆ v' ∧ ∏ b ∈ v', f b = ∏ x ∈ u', g x) :
    HasProd f a ↔ HasProd g a

(h₁ : ∀ (u : Finset γ), ∃ v, ∀ (v' : Finset β), v ⊆ v' → ∃ u', u ⊆ u' ∧ ∑ x ∈ u', g x = ∑ b ∈ v', f b)

(h₂ : ∀ (v : Finset β), ∃ u, ∀ (u' : Finset γ), u ⊆ u' → ∃ v', v ⊆ v' ∧ ∑ b ∈ v', f b = ∑ x ∈ u', g x)


@[to_additive]
theorem ContMDiff.extend_one [T2Space M] [One M'] {n : ℕ∞} {U : Opens M} {f : U → M'}
    (supp : HasCompactMulSupport f) (diff : ContMDiff I I' n f) :
    ContMDiff I I' n (Subtype.val.extend f 1)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
[T2Space M]
[One M']
{n : ℕ∞}
{U : TopologicalSpace.Opens M}
{f : ↥U → M'}
(supp : HasCompactMulSupport f)
(diff : ContMDiff I I' n f)

ContMDiff I I' n (Function.extend Subtype.val f 1)


theorem cons_iff {r : α → α → Prop} [IsIrrefl α r] {a l₁ l₂} :
    Lex r (a :: l₁) (a :: l₂) ↔ Lex r l₁ l₂

{α : Type u}
{r : α → α → Prop}
[IsIrrefl α r]
{a : α}
{l₁ l₂ : List α}

List.Lex r (a :: l₁) (a :: l₂) ↔ List.Lex r l₁ l₂


@[mono, gcongr]
theorem prod_mono {f₁ f₂ : Filter α} {g₁ g₂ : Filter β} (hf : f₁ ≤ f₂) (hg : g₁ ≤ g₂) :
    f₁ ×ˢ g₁ ≤ f₂ ×ˢ g₂

{α : Type u_1}
{β : Type u_2}
{f₁ f₂ : Filter α}
{g₁ g₂ : Filter β}
(hf : f₁ ≤ f₂)
(hg : g₁ ≤ g₂)

f₁ ×ˢ g₁ ≤ f₂ ×ˢ g₂


/-- If `edist (f n) (f (n+1))` is bounded by `C * 2^-n`, then the distance from
`f n` to the limit of `f` is bounded above by `2 * C * 2^-n`. -/
theorem edist_le_of_edist_le_geometric_two_of_tendsto (n : ℕ) : edist (f n) a ≤ 2 * C / 2 ^ n

(ha : Filter.Tendsto f Filter.atTop (𝓝 a))


/-- If all elements of a `Finset` fail to satisfy the predicate `p`, `s.filter p` is `∅`. -/
theorem filter_false_of_mem (h : ∀ x ∈ s, ¬p x) : s.filter p = ∅

{α : Type u_1}
{p : α → Prop}
[DecidablePred p]
{s : Finset α}
(h : ∀ x ∈ s, ¬p x)


/-- Uniform equicontinuity on a subset implies equicontinuity on that subset. -/
theorem UniformEquicontinuousOn.equicontinuousOn {F : ι → β → α} {S : Set β}
    (h : UniformEquicontinuousOn F S) :
    EquicontinuousOn F S

{ι : Type u_1}
{α : Type u_7}
{β : Type u_9}
[uα : UniformSpace α]
[uβ : UniformSpace β]
{F : ι → β → α}
{S : Set β}
(h : UniformEquicontinuousOn F S)


theorem irreducible : Irreducible v.asIdeal

(v : IsDedekindDomain.HeightOneSpectrum R)


@[simp, norm_cast]
theorem cast_multiset_prod (s : Multiset ℚ) : (↑s.prod : α) = (s.map (↑)).prod

{α : Type u_2}
[Field α]
[CharZero α]
(s : Multiset ℚ)

↑s.prod = (Multiset.map Rat.cast s).prod


/-- The degree of a product of polynomials is at most the sum of the degrees,
where the degree of the zero polynomial is ⊥.
-/
theorem degree_multiset_prod_le : t.prod.degree ≤ (t.map Polynomial.degree).sum

{R : Type u}
[CommSemiring R]
(t : Multiset R[X])

t.prod.degree ≤ (Multiset.map Polynomial.degree t).sum


lemma natDegree_ΨSq_pos [NoZeroDivisors R] {n : ℤ} (hn : 1 < n.natAbs) (h : (n : R) ≠ 0) :
    0 < (W.ΨSq n).natDegree

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
[NoZeroDivisors R]
{n : ℤ}
(hn : 1 < n.natAbs)
(h : ↑n ≠ 0)


/-- Given left homology data `h₁` and `h₂` for two short complexes `S₁` and `S₂`,
a `LeftHomologyMapData` for a morphism `φ : S₁ ⟶ S₂`
consists of a description of the induced morphisms on the `K` (cycles)
and `H` (left homology) fields of `h₁` and `h₂`. -/
structure LeftHomologyMapData where
  /-- the induced map on cycles -/
  φK : h₁.K ⟶ h₂.K
  /-- the induced map on left homology -/
  φH : h₁.H ⟶ h₂.H
  /-- commutation with `i` -/
  commi : φK ≫ h₂.i = h₁.i ≫ φ.τ₂ := by aesop_cat
  /-- commutation with `f'` -/
  commf' : h₁.f' ≫ φK = φ.τ₁ ≫ h₂.f' := by aesop_cat
  /-- commutation with `π` -/
  commπ : h₁.π ≫ φH = φK ≫ h₂.π := by aesop_cat

(self : CategoryTheory.ShortComplex.LeftHomologyMapData φ h₁ h₂)

CategoryTheory.CategoryStruct.comp h₁.π self.φH = CategoryTheory.CategoryStruct.comp self.φK h₂.π


theorem reverse_apply (x : CliffordAlgebra (0 : QuadraticForm R Unit)) :
    reverse (R := R) x = x

{R : Type u_1}
[CommRing R]
(x : CliffordAlgebra 0)


@[reassoc]
theorem μ_naturality₂ {m n m' n' : M} (f : m ⟶ m') (g : n ⟶ n') (X : C) :
    (F.map g).app ((F.obj m).obj X) ≫ (F.obj n').map ((F.map f).app X) ≫ (F.μ m' n').app X =
      (F.μ m n).app X ≫ (F.map (f ⊗ g)).app X

(F : CategoryTheory.MonoidalFunctor M (CategoryTheory.Functor C C))

CategoryTheory.CategoryStruct.comp ((F.map g).app ((F.obj m).obj X))
    (CategoryTheory.CategoryStruct.comp ((F.obj n').map ((F.map f).app X)) ((F.μ m' n').app X)) =
  CategoryTheory.CategoryStruct.comp ((F.μ m n).app X) ((F.map (CategoryTheory.MonoidalCategory.tensorHom f g)).app X)


@[simp]
theorem update_eq_self (a : α) (f : ∀ a, β a) : update f a (f a) = f

{α : Sort u}
{β : α → Sort v}
[DecidableEq α]
(a : α)
(f : (a : α) → β a)


@[simp]
theorem encode_ofNat (n) : encode (ofNat α n) = n

Encodable.encode (Denumerable.ofNat α n) = n


@[simp, norm_cast]
lemma coe_toAddMonoidHomEquiv (ψ : AddChar A M) :
    ⇑(toAddMonoidHomEquiv ψ) = Additive.ofMul ∘ ψ

{A : Type u_1}
{M : Type u_3}
[AddMonoid A]
[Monoid M]
(ψ : AddChar A M)

⇑(AddChar.toAddMonoidHomEquiv ψ) = ⇑Additive.ofMul ∘ ⇑ψ


@[to_additive]
theorem list_prod_apply {α : Type*} {β : α → Type*} [∀ a, Monoid (β a)] (a : α)
    (l : List (∀ a, β a)) : l.prod a = (l.map fun f : ∀ a, β a ↦ f a).prod

{α : Type u_1}
{β : α → Type u_2}
[(a : α) → AddMonoid (β a)]
(a : α)
(l : List ((a : α) → β a))

l.sum a = (List.map (fun f => f a) l).sum


/-- A `SubNegMonoid` is an `AddMonoid` with unary `-` and binary `-` operations
satisfying `sub_eq_add_neg : ∀ a b, a - b = a + -b`.

The default for `sub` is such that `a - b = a + -b` holds by definition.

Adding `sub` as a field rather than defining `a - b := a + -b` allows us to
avoid certain classes of unification failures, for example:
Let `foo X` be a type with a `∀ X, Sub (Foo X)` instance but no
`∀ X, Neg (Foo X)`. Suppose we also have an instance
`∀ X [Cromulent X], AddGroup (Foo X)`. Then the `(-)` coming from
`AddGroup.sub` cannot be definitionally equal to the `(-)` coming from
`Foo.Sub`.

In the same way, adding a `zsmul` field makes it possible to avoid definitional failures
in diamonds. See the definition of `AddMonoid` and Note [forgetful inheritance] for more
explanations on this.
-/
class SubNegMonoid (G : Type u) extends AddMonoid G, Neg G, Sub G where
  protected sub := SubNegMonoid.sub'
  protected sub_eq_add_neg : ∀ a b : G, a - b = a + -b := by intros; rfl
  /-- Multiplication by an integer.
  Set this to `zsmulRec` unless `Module` diamonds are possible. -/
  protected zsmul : ℤ → G → G
  protected zsmul_zero' : ∀ a : G, zsmul 0 a = 0 := by intros; rfl
  protected zsmul_succ' (n : ℕ) (a : G) :
      zsmul (Int.ofNat n.succ) a = zsmul (Int.ofNat n) a + a := by
    intros; rfl
  protected zsmul_neg' (n : ℕ) (a : G) : zsmul (Int.negSucc n) a = -zsmul n.succ a := by
    intros; rfl

{G : Type u}
[self : SubNegMonoid G]
(n : ℕ)
(a : G)

SubNegMonoid.zsmul (Int.ofNat n.succ) a = SubNegMonoid.zsmul (Int.ofNat n) a + a


theorem mul_rpow_eq_ite (x y : ℝ≥0∞) (z : ℝ) :
    (x * y) ^ z = if (x = 0 ∧ y = ⊤ ∨ x = ⊤ ∧ y = 0) ∧ z < 0 then ⊤ else x ^ z * y ^ z


@[simp]
theorem mem_mk {S : NonUnitalSubsemiring R} {x : R} (h) :
    x ∈ (⟨S, h⟩ : NonUnitalSubring R) ↔ x ∈ S

(h : ∀ {x : R}, x ∈ S.carrier → -x ∈ S.carrier)

x ∈ { toNonUnitalSubsemiring := S, neg_mem' := h } ↔ x ∈ S


theorem Nat.uniformEmbedding_coe_rat : UniformEmbedding ((↑) : ℕ → ℚ)


theorem sub_coeff {x y : HahnSeries Γ R} {a : Γ} : (x - y).coeff a = x.coeff a - y.coeff a

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[AddGroup R]
{x y : HahnSeries Γ R}
{a : Γ}


theorem wellPowered_of_equiv (e : C ≌ D) [WellPowered C] : WellPowered D

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


theorem eq_pow_of_pell {m n k} :
    n ^ k = m ↔ k = 0 ∧ m = 1 ∨0 < k ∧ (n = 0 ∧ m = 0 ∨
      0 < n ∧ ∃ (w a t z : ℕ) (a1 : 1 < a), xn a1 k ≡ yn a1 k * (a - n) + m [MOD t] ∧
      2 * a * n = t + (n * n + 1) ∧ m < t ∧
      n ≤ w ∧ k ≤ w ∧ a * a - ((w + 1) * (w + 1) - 1) * (w * z) * (w * z) = 1)

n ^ k = m ↔
  k = 0 ∧ m = 1 ∨
    0 < k ∧
      (n = 0 ∧ m = 0 ∨
        0 < n ∧
          ∃ w a t z,
            ∃ (a1 : 1 < a),
              Pell.xn a1 k ≡ Pell.yn a1 k * (a - n) + m [MOD t] ∧
                2 * a * n = t + (n * n + 1) ∧
                  m < t ∧ n ≤ w ∧ k ≤ w ∧ a * a - ((w + 1) * (w + 1) - 1) * (w * z) * (w * z) = 1)


theorem lineDerivWithin_zero_of_not_lineDifferentiableWithinAt
    (h : ¬LineDifferentiableWithinAt 𝕜 f s x v) :
    lineDerivWithin 𝕜 f s x v = 0


private theorem sum_card_subset_chunk_parts_le (m_pos : (0 : ℝ) < m)
    (h𝒜 : 𝒜 ⊆ (chunk hP G ε hU).parts) (hs : s ∈ 𝒜) :
    ((𝒜.sup id).card : ℝ) ≤ 𝒜.card * s.card * ((m + 1) / m)

(m_pos : 0 < ↑(Fintype.card α / SzemerediRegularity.stepBound P.parts.card))

(h𝒜 : 𝒜 ⊆ (SzemerediRegularity.chunk hP G ε hU).parts)

↑(𝒜.sup id).card ≤
  ↑𝒜.card * ↑s.card *
    ((↑(Fintype.card α / SzemerediRegularity.stepBound P.parts.card) + 1) /
      ↑(Fintype.card α / SzemerediRegularity.stepBound P.parts.card))


theorem locallyFinite_tsupport : LocallyFinite fun i => tsupport (f i)

{ι : Type u}
{X : Type v}
[TopologicalSpace X]
{s : Set X}
(f : PartitionOfUnity ι X s)


@[to_additive (attr := simp)]
theorem div_eq_inv_self : a / b = b⁻¹ ↔ a = 1


@[to_additive]
theorem Normal.map {H : Subgroup G} (h : H.Normal) (f : G →* N) (hf : Function.Surjective f) :
    (H.map f).Normal

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
{H : AddSubgroup G}
(h : H.Normal)
(f : G →+ N)
(hf : Function.Surjective ⇑f)


theorem const_pos {x : α} : Pos (const x) ↔ 0 < x

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


@[to_additive]
theorem mulSingle_strictMono : StrictMono (Pi.mulSingle i : f i → ∀ i, f i)

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


@[simp] lemma coe_constVSub (p : P) : ⇑(constVSub p) = (p -ᵥ ·)

{G : Type u_1}
{P : Type u_2}
[AddGroup G]
[AddTorsor G P]
(p : P)


@[simp]
theorem polar_smul_left (a : R) (x y : M) : polar Q (a • x) y = a • polar Q x y

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
(Q : QuadraticMap R M N)
(a : R)
(x y : M)

QuadraticMap.polar (⇑Q) (a • x) y = a • QuadraticMap.polar (⇑Q) x y


theorem Coprime.gcd_mul (k : Nat) (h : Coprime m n) : gcd k (m * n) = gcd k m * gcd k n


/-- This property is sometimes referred to as `α` being upper continuous. -/
theorem DirectedOn.inf_sSup_eq (h : DirectedOn (· ≤ ·) s) : a ⊓ sSup s = ⨆ b ∈ s, a ⊓ b

(h : DirectedOn (fun x x_1 => x ≤ x_1) s)


theorem embDomain_add (f : Γ ↪o Γ') (x y : HahnSeries Γ R) :
    embDomain f (x + y) = embDomain f x + embDomain f y

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[AddMonoid R]
{Γ' : Type u_3}
[PartialOrder Γ']
(f : Γ ↪o Γ')
(x y : HahnSeries Γ R)

HahnSeries.embDomain f (x + y) = HahnSeries.embDomain f x + HahnSeries.embDomain f y


@[simp]
lemma comp_def (i : I) (X Y Z : C i) (f : X ⟶ Y) (g : Y ⟶ Z) : comp (mk f) (mk g) = mk (f ≫ g)

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

(CategoryTheory.Sigma.SigmaHom.mk f).comp (CategoryTheory.Sigma.SigmaHom.mk g) =
  CategoryTheory.Sigma.SigmaHom.mk (CategoryTheory.CategoryStruct.comp f g)


/-- The image under an antitone function of a set which is bounded above is bounded below. -/
theorem map_bddAbove : BddAbove s → BddBelow (f '' s)

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
(hf : Antitone f)
{s : Set α}


@[simp]
theorem unop_le_unop_iff {S₁ S₂ : Subring Rᵐᵒᵖ} : S₁.unop ≤ S₂.unop ↔ S₁ ≤ S₂

{R : Type u_2}
[Ring R]
{S₁ S₂ : Subring Rᵐᵒᵖ}


theorem SetLike.mul_mem_graded {S : Type*} [SetLike S R] [Mul R] [Add ι] {A : ι → S}
    [SetLike.GradedMul A] ⦃i j⦄ {gi gj} (hi : gi ∈ A i) (hj : gj ∈ A j) : gi * gj ∈ A (i + j)

{ι : Type u_1}
{R : Type u_2}
{S : Type u_3}
[SetLike S R]
[Mul R]
[Add ι]
{A : ι → S}
[SetLike.GradedMul A]
⦃i j : ι⦄
{gi gj : R}
(hi : gi ∈ A i)
(hj : gj ∈ A j)


theorem mapL_mul (f₁ f₂ : Π i, E i →L[𝕜] E i) :
    mapL (fun i ↦ f₁ i * f₂ i) = mapL f₁ * mapL f₂

[(i : ι) → SeminormedAddCommGroup (E i)]

(PiTensorProduct.mapL fun i => f₁ i * f₂ i) = PiTensorProduct.mapL f₁ * PiTensorProduct.mapL f₂


theorem Rel.mono {r p : α → β → Prop} {s t} (hst : Rel r s t)
    (h : ∀ a ∈ s, ∀ b ∈ t, r a b → p a b) : Rel p s t

{α : Type u_1}
{β : Type v}
{r p : α → β → Prop}
{s : Multiset α}
{t : Multiset β}
(hst : Multiset.Rel r s t)
(h : ∀ a ∈ s, ∀ b ∈ t, r a b → p a b)


theorem centralizer_le (s t : Set A) (h : s ⊆ t) : centralizer R t ≤ centralizer R s

(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]
(s t : Set A)
(h : s ⊆ t)

NonUnitalStarSubalgebra.centralizer R t ≤ NonUnitalStarSubalgebra.centralizer R s


theorem natSepDegree_mul (g : F[X]) :
    (f * g).natSepDegree ≤ f.natSepDegree + g.natSepDegree


theorem HasGradientAtFilter.hasDerivAtFilter' (h : HasGradientAtFilter g g' u L') :
    HasDerivAtFilter g g' u L'

{g : ℝ → ℝ}
{g' u : ℝ}
{L' : Filter ℝ}
(h : HasGradientAtFilter g g' u L')


theorem supports_biUnion {K : Option Γ' → Finset Λ'} {S} :
    Supports (Finset.univ.biUnion K) S ↔ ∀ a, Supports (K a) S

{K : Option Turing.PartrecToTM2.Γ' → Finset Turing.PartrecToTM2.Λ'}

Turing.PartrecToTM2.Supports (Finset.univ.biUnion K) S ↔
  ∀ (a : Option Turing.PartrecToTM2.Γ'), Turing.PartrecToTM2.Supports (K a) S


theorem LF.not_equiv {x y : PGame} (h : x ⧏ y) : ¬(x ≈ y)


@[simp]
lemma polyCharpoly_coeff_eval (x : L) (i : ℕ) :
    MvPolynomial.eval (b.repr x) ((polyCharpoly φ b).coeff i) = (φ x).charpoly.coeff i

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
{ι : Type u_5}
[CommRing R]
[AddCommGroup L]
[Module R L]
[AddCommGroup M]
[Module R M]
(φ : L →ₗ[R] Module.End R M)
[Fintype ι]
[DecidableEq ι]
[Module.Free R M]
[Module.Finite R M]
(b : Basis ι R L)
(x : L)
(i : ℕ)

(MvPolynomial.eval ⇑(b.repr x)) ((φ.polyCharpoly b).coeff i) = (LinearMap.charpoly (φ x)).coeff i


theorem disjoint_lsingle_lsingle (s t : Set α) (hs : Disjoint s t) :
    Disjoint (⨆ a ∈ s, LinearMap.range (lsingle a : M →ₗ[R] α →₀ M))
      (⨆ a ∈ t, LinearMap.range (lsingle a : M →ₗ[R] α →₀ M))

{α : Type u_1}
{M : Type u_2}
{R : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(s t : Set α)
(hs : Disjoint s t)

Disjoint (⨆ a ∈ s, LinearMap.range (Finsupp.lsingle a)) (⨆ a ∈ t, LinearMap.range (Finsupp.lsingle a))


@[to_additive]
theorem one_def : (1 : S') = ⟨1, OneMemClass.one_mem S'⟩

{A : Type u_4}
{M₁ : Type u_5}
[SetLike A M₁]
[One M₁]
[hA : OneMemClass A M₁]
(S' : A)


@[simp]
theorem integral_neg : integral I l (-f) vol = -integral I l 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}

BoxIntegral.integral I l (-f) vol = -BoxIntegral.integral I l f vol


@[simp]
theorem piEquivOfFintype_apply (x : AdicCompletion I (∀ j, M j)) :
    piEquivOfFintype I M x = pi I M x

{R : Type u_1}
[CommRing R]
(I : Ideal R)
{ι : Type u_6}
[DecidableEq ι]
(M : ι → Type u_7)
[(i : ι) → AddCommGroup (M i)]
[(i : ι) → Module R (M i)]
[Fintype ι]
(x : AdicCompletion I ((j : ι) → M j))

(AdicCompletion.piEquivOfFintype I M) x = (AdicCompletion.pi I M) x


theorem perm_lookupAll (a : α) {l₁ l₂ : List (Sigma β)} (nd₁ : l₁.NodupKeys) (nd₂ : l₂.NodupKeys)
    (p : l₁ ~ l₂) : lookupAll a l₁ = lookupAll a l₂

{α : Type u}
{β : α → Type v}
[DecidableEq α]
(a : α)
{l₁ l₂ : List (Sigma β)}
(nd₁ : l₁.NodupKeys)
(nd₂ : l₂.NodupKeys)
(p : l₁.Perm l₂)

List.lookupAll a l₁ = List.lookupAll a l₂


@[to_additive]
theorem gc_map_comap (f : G →* N) : GaloisConnection (map f) (comap f)

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
(f : G →+ N)

GaloisConnection (AddSubgroup.map f) (AddSubgroup.comap f)


/-- TODO: prove this in greater generality. -/
@[simp]
theorem rank_conjTranspose (A : Matrix m n R) : Aᴴ.rank = A.rank

{m : Type u_2}
{n : Type u_3}
{R : Type u_5}
[Fintype n]
[Fintype m]
[Field R]
[PartialOrder R]
[StarRing R]
[StarOrderedRing R]
(A : Matrix m n R)


theorem ConcaveOn.convex_gt (hf : ConcaveOn 𝕜 s f) (r : β) : Convex 𝕜 ({ x ∈ s | r < f x })

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedCancelAddCommMonoid β]
[Module 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : ConcaveOn 𝕜 s f)
(r : β)


theorem unop {A B X Y : Cᵒᵖ} {i : A ⟶ B} {p : X ⟶ Y} (h : HasLiftingProperty i p) :
    HasLiftingProperty p.unop i.unop

(h : CategoryTheory.HasLiftingProperty i p)


@[to_additive]
theorem IsOpen.iUnion_smul [IsMinimal G α] {U : Set α} (hUo : IsOpen U) (hne : U.Nonempty) :
    ⋃ g : G, g • U = univ

(G : Type u_2)
{α : Type u_3}
[Group G]
[TopologicalSpace α]
[MulAction G α]
[MulAction.IsMinimal G α]
{U : Set α}
(hUo : IsOpen U)
(hne : U.Nonempty)


theorem isBounded_pi_of_nonempty (hne : (pi univ S).Nonempty) :
    IsBounded (pi univ S) ↔ ∀ i, IsBounded (S i)

{ι : Type u_3}
{π : ι → Type u_4}
[(i : ι) → Bornology (π i)]
{S : (i : ι) → Set (π i)}
(hne : (Set.univ.pi S).Nonempty)

Bornology.IsBounded (Set.univ.pi S) ↔ ∀ (i : ι), Bornology.IsBounded (S i)


lemma isCoboundedUnder_le_of_le [Preorder α] (l : Filter ι) [NeBot l] {f : ι → α} {x : α}
    (hf : ∀ i, x ≤ f i) :
    IsCoboundedUnder (· ≤ ·) l f

{α : Type u_1}
{ι : Type u_4}
[Preorder α]
(l : Filter ι)
[l.NeBot]
{f : ι → α}
{x : α}
(hf : ∀ (i : ι), x ≤ f i)

Filter.IsCoboundedUnder (fun x x_1 => x ≤ x_1) l f


theorem deriv_rpow_const' {p : ℝ} (h : 1 ≤ p) :
    (deriv fun x : ℝ => x ^ p) = fun x => p * x ^ (p - 1)

(deriv fun x => x ^ p) = fun x => p * x ^ (p - 1)


/-- Tensoring on the right gives a monoidal functor from `C` into endofunctors of `C`.
-/
@[simps!]
def tensoringRightMonoidal [MonoidalCategory.{v} C] : MonoidalFunctor C (C ⥤ C)

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

∀ (X_1 : C),
  ((CategoryTheory.tensoringRightMonoidal C).μ X Y).app X_1 = (CategoryTheory.MonoidalCategory.associator X_1 X Y).hom


/-- Functional equation for the even Hurwitz zeta function (alternative form). -/
lemma completedCosZeta_one_sub (a : UnitAddCircle) (s : ℂ) :
    completedCosZeta a (1 - s) = completedHurwitzZetaEven a s

HurwitzZeta.completedCosZeta a (1 - s) = HurwitzZeta.completedHurwitzZetaEven a s


/-- The sigma-algebra generated by a single set `s` is `{∅, s, sᶜ, univ}`. -/
@[simp] theorem generateFrom_singleton (s : Set α) :
    generateFrom {s} = MeasurableSpace.comap (· ∈ s) ⊤

MeasurableSpace.generateFrom {s} = MeasurableSpace.comap (fun x => x ∈ s) ⊤


@[simp] lemma refl_trans (e : G ≃+c[a, b] H) : (refl a).trans e = e

{G : Type u_1}
{H : Type u_2}
[Add G]
[Add H]
{a : G}
{b : H}
(e : G ≃+c[a, b] H)


@[simp]
theorem rootSet_neg (p : T[X]) (S) [CommRing S] [IsDomain S] [Algebra T S] :
    (-p).rootSet S = p.rootSet S

{T : Type w}
[CommRing T]
(p : Polynomial T)
(S : Type u_1)
[CommRing S]
[IsDomain S]
[Algebra T S]


@[simp]
theorem natTransExtension_hcomp {F G : W.Localization ⥤ D} (τ : W.Q ⋙ F ⟶ W.Q ⋙ G) :
    𝟙 W.Q ◫ natTransExtension τ = τ

{F G : CategoryTheory.Functor W.Localization D}

CategoryTheory.CategoryStruct.id W.Q ◫ CategoryTheory.Localization.Construction.natTransExtension τ = τ


theorem tsub_tsub_tsub_cancel_right (h : c ≤ b) : a - c - (b - c) = a - b

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


@[simp]
protected theorem areaForm (w z : ℂ) : Complex.orientation.areaForm w z = (conj w * z).im

(Complex.orientation.areaForm w) z = ((starRingEnd ℂ) w * z).im


/-- The same-universe version of `Algebra.lift_rank_eq_of_equiv_equiv`. -/
theorem rank_eq_of_equiv_equiv (i : R ≃+* R') (j : S ≃+* S')
    (hc : (algebraMap R' S').comp i.toRingHom = j.toRingHom.comp (algebraMap R S)) :
    Module.rank R S = Module.rank R' S'


theorem eLpNorm_le_of_ae_bound {f : α → F} {C : ℝ} (hfC : ∀ᵐ x ∂μ, ‖f x‖ ≤ C) :
    eLpNorm f p μ ≤ μ Set.univ ^ p.toReal⁻¹ * ENNReal.ofReal C

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
{f : α → F}
{C : ℝ}
(hfC : ∀ᵐ (x : α) ∂μ, ‖f x‖ ≤ C)

MeasureTheory.eLpNorm f p μ ≤ μ Set.univ ^ p.toReal⁻¹ * ENNReal.ofReal C


@[measurability]
protected theorem ennnorm {_ : MeasurableSpace α} {β : Type*} [SeminormedAddCommGroup β]
    {f : α → β} (hf : StronglyMeasurable f) : Measurable fun a => (‖f a‖₊ : ℝ≥0∞)

∀ {x : MeasurableSpace α} {β : Type u_5} [inst : SeminormedAddCommGroup β] {f : α → β},
  MeasureTheory.StronglyMeasurable f → Measurable fun a => ↑‖f a‖₊


/-- If a function `f` with a densely ordered codomain is monotone on a right neighborhood of `a` and
the closure of the image of this neighborhood under `f` is a right neighborhood of `f a`, then `f`
is continuous at `a` from the right. -/
theorem continuousWithinAt_right_of_monotoneOn_of_closure_image_mem_nhdsWithin [DenselyOrdered β]
    {f : α → β} {s : Set α} {a : α} (h_mono : MonotoneOn f s) (hs : s ∈ 𝓝[≥] a)
    (hfs : closure (f '' s) ∈ 𝓝[≥] f a) : ContinuousWithinAt f (Ici a) a

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[LinearOrder β]
[TopologicalSpace β]
[OrderTopology β]
[DenselyOrdered β]
{f : α → β}
{s : Set α}
{a : α}
(h_mono : MonotoneOn f s)
(hs : s ∈ 𝓝[≥] a)
(hfs : closure (f '' s) ∈ 𝓝[≥] f a)


theorem support_subset_verts (H : Subgraph G) : H.support ⊆ H.verts

{V : Type u}
{G : SimpleGraph V}
(H : G.Subgraph)


theorem mul_add_right_right {x y : R} (h : IsCoprime x y) (z : R) : IsCoprime x (z * x + y)

{R : Type u}
[CommRing R]
{x y : R}
(h : IsCoprime x y)
(z : R)


theorem replaceF_cons_of_none {l : List α} (p) (h : p a = none) :
    (a :: l).replaceF p = a :: l.replaceF p

{α : Type u_1}
{a : α}
{l : List α}
(p : α → Option α)
(h : p a = none)

List.replaceF p (a :: l) = a :: List.replaceF p l


theorem inf_map_atBot_neBot_iff [SemilatticeInf α] [Nonempty α] {F : Filter β} {u : α → β} :
    NeBot (F ⊓ map u atBot) ↔ ∀ U ∈ F, ∀ N, ∃ n ≤ N, u n ∈ U

{α : Type u_3}
{β : Type u_4}
[SemilatticeInf α]
[Nonempty α]
{F : Filter β}
{u : α → β}

(F ⊓ Filter.map u Filter.atBot).NeBot ↔ ∀ U ∈ F, ∀ (N : α), ∃ n ≤ N, u n ∈ U


/-- If `H ≤ K`, then `G/H ≃ G/K × K/H` constructively, using the provided right inverse
of the quotient map `G → G/K`. The classical version is `Subgroup.quotientEquivProdOfLE`. -/
@[to_additive (attr := simps)
  "If `H ≤ K`, then `G/H ≃ G/K × K/H` constructively, using the provided right inverse
  of the quotient map `G → G/K`. The classical version is `AddSubgroup.quotientEquivSumOfLE`."]
def quotientEquivProdOfLE' (h_le : s ≤ t) (f : α ⧸ t → α)
    (hf : Function.RightInverse f QuotientGroup.mk) : α ⧸ s ≃ (α ⧸ t) × t ⧸ s.subgroupOf t

(Subgroup.quotientEquivProdOfLE' h_le f hf).symm a = Quotient.map' (fun b => f a.1 * ↑b) ⋯ a.2


/-- A `StrongFEPair` structure with `f = oddKernel a` and `g = sinKernel a`. -/
@[simps]
def hurwitzOddFEPair (a : UnitAddCircle) : StrongFEPair ℂ

∀ (a_1 : ℝ), (HurwitzZeta.hurwitzOddFEPair a).g a_1 = (Complex.ofReal' ∘ HurwitzZeta.sinKernel a) a_1


theorem sum_map_seq (κ : Kernel α β) [IsSFiniteKernel κ] (hf : Measurable f) :
    (Kernel.sum fun n => map (seq κ n) f hf) = map κ f hf

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{γ : Type u_4}
{mγ : MeasurableSpace γ}
{f : β → γ}
(κ : ProbabilityTheory.Kernel α β)
[ProbabilityTheory.IsSFiniteKernel κ]
(hf : Measurable f)

(ProbabilityTheory.Kernel.sum fun n => (κ.seq n).map f hf) = κ.map f hf


theorem liftAux_tprod (φ : MultilinearMap R s E) (f : Π i, s i) : liftAux φ (tprod R f) = φ f

{ι : Type u_1}
{R : Type u_4}
[CommSemiring R]
{s : ι → Type u_7}
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]
{E : Type u_9}
[AddCommMonoid E]
[Module R E]
(φ : MultilinearMap R s E)
(f : (i : ι) → s i)

(PiTensorProduct.liftAux φ) ((PiTensorProduct.tprod R) f) = φ f


theorem sigmaFinite_of_countable {S : Set (Set α)} (hc : S.Countable) (hμ : ∀ s ∈ S, μ s < ∞)
    (hU : ⋃₀ S = univ) : SigmaFinite μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{S : Set (Set α)}
(hc : S.Countable)
(hμ : ∀ s ∈ S, μ s < ⊤)
(hU : ⋃₀ S = Set.univ)


theorem continuous_stoneCechUnit : Continuous (stoneCechUnit : α → StoneCech α)


theorem sep_ext_iff : { x ∈ s | p x } = { x ∈ s | q x } ↔ ∀ x ∈ s, p x ↔ q x

{α : Type u}
{s : Set α}
{p q : α → Prop}

{x | x ∈ s ∧ p x} = {x | x ∈ s ∧ q x} ↔ ∀ x ∈ s, p x ↔ q x


theorem Basis.basis_inter_ground (hI : M.Basis I X) : M.Basis I (X ∩ M.E)

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


theorem monotone_iff_forall_lt : Monotone f ↔ ∀ ⦃a b⦄, a < b → f a ≤ f b

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

Monotone f ↔ ∀ ⦃a b : α⦄, a < b → f a ≤ f b


/-- A version of `Nat.exists_infinite_primes` using the `Set.Infinite` predicate. -/
theorem infinite_setOf_prime : { p | Prime p }.Infinite


theorem smul_nnreal (r : ℝ≥0) (h : ν ⟂ₘ μ) : r • ν ⟂ₘ μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
(r : ℝ≥0)
(h : ν ⟂ₘ μ)


private theorem size_push {ks : Array α} {vs : Array β} (h : ks.size = vs.size) (k : α) (v : β) : (ks.push k).size = (vs.push v).size

{α : Type u_1}
{β : Type u_2}
{ks : Array α}
{vs : Array β}
(h : ks.size = vs.size)
(k : α)
(v : β)


theorem dvd_iff_mod_eq_zero {a b : Ordinal} : b ∣ a ↔ a % b = 0


theorem succPNat_injective : Function.Injective succPNat


theorem fst_pred_mem_erase_of_mem_right {b : Board} {m : ℤ × ℤ} (h : m ∈ right b) :
    (m.1 - 1, m.2) ∈ b.erase m

(h : m ∈ SetTheory.PGame.Domineering.right b)


protected theorem pos (i : Fin n) : 0 < n


theorem prod_mono_left (t : NonUnitalSubsemiring S) :
    Monotone fun s : NonUnitalSubsemiring R => s.prod t

{R : Type u}
{S : Type v}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
(t : NonUnitalSubsemiring S)


/-- Left multiplication by a unit of a semiring as an additive automorphism. -/
@[simps! (config := { simpRhs := true })]
def mulLeft : Rˣ →* AddAut R


theorem image_eq_iff_surjOn_mapsTo : f '' s = t ↔ s.SurjOn f t ∧ s.MapsTo f t

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{f : α → β}

f '' s = t ↔ Set.SurjOn f s t ∧ Set.MapsTo f s t


theorem coeToSubmodule_eq_bot {I : FractionalIdeal S P} : (I : Submodule R P) = ⊥ ↔ I = 0

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
{I : FractionalIdeal S P}


theorem areaForm_to_volumeForm (x y : E) : ω x y = o.volumeForm ![x, y]

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


lemma ext' {f g : Hom iter₁ iter₂} (h : f.natTrans = g.natTrans) : f = g

{iter₁ iter₂ : CategoryTheory.Functor.Iteration ε j}


@[to_additive]
theorem IsUpperSet.mul_right (hs : IsUpperSet s) : IsUpperSet (s * t)

{α : Type u_1}
[OrderedAddCommGroup α]
{s t : Set α}
(hs : IsUpperSet s)


theorem map_uncurry_zip_eq_zipWith (f : α → β → γ) (l : List α) (l' : List β) :
    map (Function.uncurry f) (l.zip l') = zipWith f l l'

{α : Type u}
{β : Type u_1}
{γ : Type u_2}
(f : α → β → γ)
(l : List α)
(l' : List β)

List.map (Function.uncurry f) (l.zip l') = List.zipWith f l l'


lemma Ioo_smul_sphere_zero {a b r : ℝ} (ha : 0 ≤ a) (hr : 0 < r) :
    Ioo a b • sphere (0 : E) r = ball 0 (b * r) \ closedBall 0 (a * r)

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{a b r : ℝ}
(ha : 0 ≤ a)
(hr : 0 < r)

Set.Ioo a b • Metric.sphere 0 r = Metric.ball 0 (b * r) \ Metric.closedBall 0 (a * r)


lemma convexOn_mul_log : ConvexOn ℝ (Set.Ici (0 : ℝ)) (fun x ↦ x * log x)

ConvexOn ℝ (Set.Ici 0) fun x => x * Real.log x


theorem finrank_fixedField_eq_card [FiniteDimensional F E] [DecidablePred (· ∈ H)] :
    finrank (fixedField H) E = Fintype.card H

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
(H : Subgroup (E ≃ₐ[F] E))
[FiniteDimensional F E]
[DecidablePred fun x => x ∈ H]

FiniteDimensional.finrank (↥(IntermediateField.fixedField H)) E = Fintype.card ↥H


@[simp]
lemma homologyMap_zero [S₁.HasHomology] [S₂.HasHomology] :
    homologyMap (0 : S₁ ⟶ S₂) = 0

CategoryTheory.ShortComplex.homologyMap 0 = 0


lemma mul_div_right (a b c : EReal) : (a / b) * c = (a * c) / b


@[simp]
theorem mul_lt_mul_right_of_neg [ExistsAddOfLE α] [MulPosStrictMono α]
    [CovariantClass α α (swap (· + ·)) (· < ·)] [ContravariantClass α α (swap (· + ·)) (· < ·)]
    {a b c : α} (h : c < 0) : a * c < b * c ↔ b < a

[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]


@[simp]
theorem coequalizer_as_cokernel : coequalizer.π f 0 = cokernel.π f

CategoryTheory.Limits.coequalizer.π f 0 = CategoryTheory.Limits.cokernel.π f


theorem mem_bot {x : A} : x ∈ (⊥ : NonUnitalStarSubalgebra R A) ↔ x = 0

{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]
{x : A}


/-- Casting a scientific literal via `ℚ` is the same as casting directly. -/
@[simp, norm_cast]
theorem cast_ofScientific {K} [DivisionRing K] (m : ℕ) (s : Bool) (e : ℕ) :
    (OfScientific.ofScientific m s e : ℚ) = (OfScientific.ofScientific m s e : K)

{K : Type u_2}
[DivisionRing K]
(m : ℕ)
(s : Bool)
(e : ℕ)

↑(OfScientific.ofScientific m s e) = OfScientific.ofScientific m s e


theorem inv_norm_smul_mem_closed_unit_ball (x : E) :
    ‖x‖⁻¹ • x ∈ closedBall (0 : E) 1

{E : Type u_1}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
(x : E)


@[simp]
theorem map_aeval (P : R[X]) (x : A) :
    D (aeval x P) = aeval x (derivative P) • D x

{R : Type u_1}
{A : Type u_2}
{M : Type u_4}
[CommSemiring R]
[CommSemiring A]
[AddCommMonoid M]
[Algebra R A]
[Module A M]
[Module R M]
(D : Derivation R A M)
(P : Polynomial R)
(x : A)

D ((Polynomial.aeval x) P) = (Polynomial.aeval x) (Polynomial.derivative P) • D x


/-- The following statements are equivalent:

0. `s` is a neighborhood of `a` within `[a, +∞)`;
1. `s` is a neighborhood of `a` within `[a, b]`;
2. `s` is a neighborhood of `a` within `[a, b)`;
3. `s` includes `[a, u)` for some `u ∈ (a, b]`;
4. `s` includes `[a, u)` for some `u > a`.
-/
theorem TFAE_mem_nhdsWithin_Ici {a b : α} (hab : a < b) (s : Set α) :
    TFAE [s ∈ 𝓝[≥] a,
      s ∈ 𝓝[Icc a b] a,
      s ∈ 𝓝[Ico a b] a,
      ∃ u ∈ Ioc a b, Ico a u ⊆ s,
      ∃ u ∈ Ioi a , Ico a u ⊆ s]

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{a b : α}
(hab : a < b)
(s : Set α)

[s ∈ 𝓝[≥] a, s ∈ 𝓝[Set.Icc a b] a, s ∈ 𝓝[Set.Ico a b] a, ∃ u ∈ Set.Ioc a b, Set.Ico a u ⊆ s,
    ∃ u ∈ Set.Ioi a, Set.Ico a u ⊆ s].TFAE


theorem extract_append_left {a b : Array α} {i j : Nat} (h : j ≤ a.size) :
    (a ++ b).extract i j = a.extract i j

{α : Type u}
{a b : Array α}
{i j : Nat}
(h : j ≤ a.size)


@[simp]
theorem sInf_toSubmodule (S : Set (NonUnitalSubalgebra R A)) :
    (sInf S).toSubmodule = sInf (NonUnitalSubalgebra.toSubmodule '' S)

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
(S : Set (NonUnitalSubalgebra R A))


theorem span_gramSchmidtNormed (f : ι → E) (s : Set ι) :
    span 𝕜 (gramSchmidtNormed 𝕜 f '' s) = span 𝕜 (gramSchmidt 𝕜 f '' s)

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

Submodule.span 𝕜 (gramSchmidtNormed 𝕜 f '' s) = Submodule.span 𝕜 (gramSchmidt 𝕜 f '' s)


@[to_additive]
theorem image_mulSingle_uIcc_right (i : ι) (b : α i) :
    Pi.mulSingle i '' uIcc 1 b = uIcc 1 (Pi.mulSingle i b)

{ι : Type u_1}
{α : ι → Type u_2}
[(i : ι) → Lattice (α i)]
[DecidableEq ι]
[(i : ι) → One (α i)]
(i : ι)
(b : α i)

Pi.mulSingle i '' Set.uIcc 1 b = Set.uIcc 1 (Pi.mulSingle i b)


/-- Let `X` be a normal paracompact topological space (e.g., any extended metric space). Let `E` be
a topological real vector space. Let `t : X → Set E` be a family of convex sets. Suppose that for
each point `x : X`, there exists a vector `c : E` that belongs to `t y` for all `y` in a
neighborhood of `x`. Then there exists a continuous map `g : C(X, E)` such that `g x ∈ t x` for all
`x`. See also `exists_continuous_forall_mem_convex_of_local`. -/
theorem exists_continuous_forall_mem_convex_of_local_const (ht : ∀ x, Convex ℝ (t x))
    (H : ∀ x : X, ∃ c : E, ∀ᶠ y in 𝓝 x, c ∈ t y) : ∃ g : C(X, E), ∀ x, g x ∈ t x

(H : ∀ (x : X), ∃ c, ∀ᶠ (y : X) in 𝓝 x, c ∈ t y)


theorem measure_preimage_lt_top_of_integrable (f : α →ₛ E) (hf : Integrable f μ) {x : E}
    (hx : x ≠ 0) : μ (f ⁻¹' {x}) < ∞

{α : Type u_1}
{E : Type u_4}
[MeasurableSpace α]
[NormedAddCommGroup E]
{μ : MeasureTheory.Measure α}
(f : MeasureTheory.SimpleFunc α E)
(hf : MeasureTheory.Integrable (↑f) μ)
{x : E}
(hx : x ≠ 0)


protected lemma IsClosed.lowerClosure_pi (hs : IsClosed s) (hs' : BddAbove s) :
    IsClosed (lowerClosure s : Set (ι → ℝ))

{ι : Type u_2}
[Finite ι]
{s : Set (ι → ℝ)}
(hs : IsClosed s)
(hs' : BddAbove s)


lemma LinearEquiv.isSMulRegular_congr [AddCommMonoid N] [Module R N]
    (e : M ≃ₗ[R] N) (r : R) : IsSMulRegular M r ↔ IsSMulRegular N r

{R : Type u_2}
{M : Type u_3}
{N : Type u_1}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
(e : M ≃ₗ[R] N)
(r : R)


@[simp]
theorem mem_finRange {n : ℕ} (a : Fin n) : a ∈ finRange n


private theorem aux₀ {v : ℤ} (hv : 0 < v) : (0 : ℝ) < v ∧ (0 : ℝ) < 2 * v - 1


@[simp] theorem testBit_add_one (x i : Nat) : testBit x (i + 1) = testBit (x/2) i


theorem quot_hom_ext (f g : (M ⧸ p) →ₗ[R] M₂) (h : ∀ x : M, f (Quotient.mk x) = g (Quotient.mk x)) :
    f = g

(h : ∀ (x : M), f (Submodule.Quotient.mk x) = g (Submodule.Quotient.mk x))


@[to_additive (attr := simp)]
lemma Commute.units_zpow_left (h : Commute ↑u a) (m : ℤ) : Commute ↑(u ^ m) a

{M : Type u_1}
[AddMonoid M]
{a : M}
{u : AddUnits M}
(h : AddCommute (↑u) a)
(m : ℤ)


@[simp]
theorem sofLeftInverse'_apply {g : S → R} {f : F} (h : Function.LeftInverse g f) (x : R) :
    ↑(sofLeftInverse' h x) = f x

{R : Type u}
{S : Type v}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
{F : Type u_1}
[FunLike F R S]
[NonUnitalRingHomClass F R S]
{g : S → R}
{f : F}
(h : Function.LeftInverse g ⇑f)
(x : R)

↑((RingEquiv.sofLeftInverse' h) x) = f x


@[to_additive (attr := mono) sum_mono]
theorem prod_mono' : Monotone fun f : ι → M ↦ ∏ i, f i

{ι : Type u_1}
{M : Type u_4}
[Fintype ι]
[OrderedCommMonoid M]


@[simp, norm_cast] lemma coe_compl (s : Clopens α) : (↑sᶜ : Set α) = (↑s)ᶜ

{α : Type u_2}
[TopologicalSpace α]
(s : TopologicalSpace.Clopens α)


/-- In a smooth fiber bundle, the preimage under the projection of a set with
unique differential in the basis also has unique differential. -/
theorem UniqueMDiffOn.smooth_bundle_preimage (hs : UniqueMDiffOn I s) :
    UniqueMDiffOn (I.prod 𝓘(𝕜, F)) (π F Z ⁻¹' s)

[TopologicalSpace (Bundle.TotalSpace F Z)]

UniqueMDiffOn (I.prod 𝓘(𝕜, F)) (Bundle.TotalSpace.proj ⁻¹' s)


theorem sin_ne_zero_iff {θ : ℂ} : sin θ ≠ 0 ↔ ∀ k : ℤ, θ ≠ k * π

Complex.sin θ ≠ 0 ↔ ∀ (k : ℤ), θ ≠ ↑k * ↑Real.pi


@[simp] theorem norm_equiv (f : PiLp ∞ β) : ‖WithLp.equiv ⊤ _ f‖ = ‖f‖

[(i : ι) → SeminormedAddCommGroup (β i)]

‖(WithLp.equiv ⊤ ((i : ι) → β i)) f‖ = ‖f‖


theorem iIndepSet_iff_iIndepSets_singleton {f : ι → Set Ω} (hf : ∀ i, MeasurableSet (f i)) :
    iIndepSet f μ ↔ iIndepSets (fun i ↦ {f i}) μ

{Ω : Type u_1}
{ι : Type u_2}
{_mΩ : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsProbabilityMeasure μ]
{f : ι → Set Ω}
(hf : ∀ (i : ι), MeasurableSet (f i))

ProbabilityTheory.iIndepSet f μ ↔ ProbabilityTheory.iIndepSets (fun i => {f i}) μ


@[simp]
theorem sub_self_im : a - a.im = a.re

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


/-- A right homology map data for a morphism of short complexes induces
a left homology map data in the opposite category. -/
@[simps]
def RightHomologyMapData.op {S₁ S₂ : ShortComplex C} {φ : S₁ ⟶ S₂}
    {h₁ : S₁.RightHomologyData} {h₂ : S₂.RightHomologyData}
    (ψ : RightHomologyMapData φ h₁ h₂) : LeftHomologyMapData (opMap φ) h₂.op h₁.op

(ψ : CategoryTheory.ShortComplex.RightHomologyMapData φ h₁ h₂)


lemma Codisjoint.eq_iff (hab : Codisjoint a b) : a = b ↔ a = ⊤ ∧ b = ⊤

{α : Type u_1}
[PartialOrder α]
[OrderTop α]
{a b : α}
(hab : Codisjoint a b)


theorem fg_def {S : Subalgebra R A} : S.FG ↔ ∃ t : Set A, Set.Finite t ∧ Algebra.adjoin R t = S

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{S : Subalgebra R A}

S.FG ↔ ∃ t, t.Finite ∧ Algebra.adjoin R t = S


theorem rank_span_of_finset (s : Finset M) : Module.rank R (span R (s : Set M)) < ℵ₀

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[StrongRankCondition R]
(s : Finset M)

Module.rank R ↥(Submodule.span R ↑s) < ℵ₀


/-- Two morphisms in an exact sequence are exact on pseudoelements. -/
theorem pseudo_exact_of_exact {S : ShortComplex C} (hS : S.Exact) :
    ∀ b, S.g b = 0 → ∃ a, S.f a = b

(b : CategoryTheory.Abelian.Pseudoelement S.X₂)

CategoryTheory.Abelian.Pseudoelement.pseudoApply S.g b = 0 →
  ∃ a, CategoryTheory.Abelian.Pseudoelement.pseudoApply S.f a = b


theorem derivBFamily_fp {i hi} (H : IsNormal (f i hi)) (a : Ordinal) :
    f i hi (derivBFamily.{u, v} o f a) = derivBFamily.{u, v} o f a

{f : (b : Ordinal.{u}) → b < o → Ordinal.{max u v} → Ordinal.{max u v}}

f i hi (o.derivBFamily f a) = o.derivBFamily f a


/-- A relation is an isomorphism in `RelCat` iff it is the image of an isomorphism in
`Type`. -/
theorem rel_iso_iff {X Y : RelCat} (r : X ⟶ Y) :
    IsIso (C := RelCat) r ↔ ∃ f : (Iso (C := Type) X Y), graphFunctor.map f.hom = r

{X Y : CategoryTheory.RelCat}
(r : X ⟶ Y)

CategoryTheory.IsIso r ↔ ∃ f, CategoryTheory.RelCat.graphFunctor.map f.hom = r


theorem natDegree_multiset_prod (h : (0 : R[X]) ∉ t) :
    natDegree t.prod = (t.map natDegree).sum

{R : Type u}
[CommSemiring R]
[NoZeroDivisors R]
(t : Multiset R[X])
(h : 0 ∉ t)

t.prod.natDegree = (Multiset.map Polynomial.natDegree t).sum


theorem pow_right_strictAnti (h₀ : 0 < a) (h₁ : a < 1) : StrictAnti (a ^ ·)

{R : Type u_3}
[StrictOrderedSemiring R]
{a : R}
(h₀ : 0 < a)
(h₁ : a < 1)


/-- `piFinTwoEquiv` as an `IsometryEquiv`. -/
@[simps!]
def piFinTwo (α : Fin 2 → Type*) [∀ i, PseudoEMetricSpace (α i)] : (∀ i, α i) ≃ᵢ α 0 × α 1

[(i : Fin 2) → PseudoEMetricSpace (α i)]

(IsometryEquiv.piFinTwo α) f = (f 0, f 1)


theorem symmetrizeRel_subset_self (V : Set (α × α)) : symmetrizeRel V ⊆ V


lemma comm_comp_lTensor_comp_comm_eq (g : N →ₗ[R] P) :
    TensorProduct.comm R Q P ∘ₗ lTensor Q g ∘ₗ TensorProduct.comm R N Q =
      rTensor Q g

{R : Type u_1}
[CommSemiring R]
{N : Type u_5}
{P : Type u_6}
{Q : Type u_7}
[AddCommMonoid N]
[AddCommMonoid P]
[AddCommMonoid Q]
[Module R N]
[Module R P]
[Module R Q]
(g : N →ₗ[R] P)

↑(TensorProduct.comm R Q P) ∘ₗ LinearMap.lTensor Q g ∘ₗ ↑(TensorProduct.comm R N Q) = LinearMap.rTensor Q g


theorem kinsert_nodupKeys (a) (b : β a) {l : List (Sigma β)} (nd : l.NodupKeys) :
    (kinsert a b l).NodupKeys

{α : Type u}
{β : α → Type v}
[DecidableEq α]
(a : α)
(b : β a)
{l : List (Sigma β)}
(nd : l.NodupKeys)


theorem log_eq_iff {b m n : ℕ} (h : m ≠ 0 ∨ 1 < b ∧ n ≠ 0) :
    log b n = m ↔ b ^ m ≤ n ∧ n < b ^ (m + 1)

Nat.log b n = m ↔ b ^ m ≤ n ∧ n < b ^ (m + 1)


/-- The forgetful functor from `LocallyRingedSpace` to `Top`. -/
@[simps!]
def forgetToTop : LocallyRingedSpace.{u} ⥤ TopCat.{u}

∀ {X Y : AlgebraicGeometry.LocallyRingedSpace} (f : X ⟶ Y),
  AlgebraicGeometry.LocallyRingedSpace.forgetToTop.map f = (AlgebraicGeometry.SheafedSpace.forget CommRingCat).map f.val


@[simp, norm_cast]
theorem cast_one [AddMonoidWithOne R] : ((1 : ℕ) : R) = 1


@[simp]
theorem compMeasurable_mk (g : β → γ) (hg : Measurable g) (f : α → β)
    (hf : AEStronglyMeasurable f μ) :
    compMeasurable g hg (mk f hf : α →ₘ[μ] β) =
      mk (g ∘ f) (hg.comp_aemeasurable hf.aemeasurable).aestronglyMeasurable

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.AEEqFun.compMeasurable g hg (MeasureTheory.AEEqFun.mk f hf) = MeasureTheory.AEEqFun.mk (g ∘ f) ⋯


theorem smul_mul' (a : M) (b₁ b₂ : A) : a • (b₁ * b₂) = a • b₁ * a • b₂

{M : Type u_1}
{A : Type u_4}
[Monoid M]
[Monoid A]
[MulDistribMulAction M A]
(a : M)
(b₁ b₂ : A)


@[simp, mfld_simps]
theorem univ_prod_univ : @univ α ×ˢ @univ β = univ


theorem add_fst (a b : 𝓜(𝕜, A)) : (a + b).fst = a.fst + b.fst

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

(a + b).toProd.1 = a.toProd.1 + b.toProd.1


/-- `Matrix.blockDiagonal'` as an `AddMonoidHom`. -/
@[simps]
def blockDiagonal'AddMonoidHom [AddZeroClass α] :
    (∀ i, Matrix (m' i) (n' i) α) →+ Matrix (Σi, m' i) (Σi, n' i) α

{o : Type u_4}
(m' : o → Type u_7)
(n' : o → Type u_8)
(α : Type u_12)
[DecidableEq o]
[AddZeroClass α]
(M : (i : o) → Matrix (m' i) (n' i) α)

(Matrix.blockDiagonal'AddMonoidHom m' n' α) M = Matrix.blockDiagonal' M


protected theorem continuous [TopologicalSpace Y] {f : X → Y} (hf : IsLocallyConstant f) :
    Continuous f

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


theorem ι_mul_ι_mem_evenOdd_zero (m₁ m₂ : M) : ι Q m₁ * ι Q m₂ ∈ evenOdd Q 0

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

(CliffordAlgebra.ι Q) m₁ * (CliffordAlgebra.ι Q) m₂ ∈ CliffordAlgebra.evenOdd Q 0


/-- See also `isOpen_iff_open_ball_subset`. -/
theorem isOpen_iff_ball_subset {s : Set α} : IsOpen s ↔ ∀ x ∈ s, ∃ V ∈ 𝓤 α, ball x V ⊆ s

{α : Type ua}
[UniformSpace α]
{s : Set α}

IsOpen s ↔ ∀ x ∈ s, ∃ V ∈ 𝓤 α, UniformSpace.ball x V ⊆ s


theorem lt_nfp {a b} : a < nfp f b ↔ ∃ n, a < f^[n] b

{f : Ordinal.{u} → Ordinal.{u}}
{a b : Ordinal.{u}}


nonrec theorem _root_.MeasureTheory.Integrable.continuous_primitive (h_int : Integrable f μ)
    (a : ℝ) : Continuous fun b => ∫ x in a..b, f x ∂μ

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{μ : MeasureTheory.Measure ℝ}
{f : ℝ → E}
[MeasureTheory.NoAtoms μ]
(h_int : MeasureTheory.Integrable f μ)
(a : ℝ)

Continuous fun b => ∫ (x : ℝ) in a..b, f x ∂μ


lemma rnDeriv_withDensity_right (μ ν : Measure α) [SigmaFinite μ] [SigmaFinite ν]
    (hf : AEMeasurable f ν) (hf_ne_zero : ∀ᵐ x ∂ν, f x ≠ 0) (hf_ne_top : ∀ᵐ x ∂ν, f x ≠ ∞) :
    μ.rnDeriv (ν.withDensity f) =ᵐ[ν] fun x ↦ (f x)⁻¹ * μ.rnDeriv ν x

{α : Type u_1}
{m : MeasurableSpace α}
{f : α → ℝ≥0∞}
(μ ν : MeasureTheory.Measure α)
[MeasureTheory.SigmaFinite μ]
[MeasureTheory.SigmaFinite ν]
(hf : AEMeasurable f ν)
(hf_ne_zero : ∀ᵐ (x : α) ∂ν, f x ≠ 0)
(hf_ne_top : ∀ᵐ (x : α) ∂ν, f x ≠ ⊤)

μ.rnDeriv (ν.withDensity f) =ᵐ[ν] fun x => (f x)⁻¹ * μ.rnDeriv ν x


/-- An equivalent expression of `Subgroup.FG` in terms of `Set.Finite` instead of `Finset`. -/
@[to_additive "An equivalent expression of `AddSubgroup.fg` in terms of `Set.Finite` instead of
`Finset`."]
theorem Subgroup.fg_iff (P : Subgroup G) :
    Subgroup.FG P ↔ ∃ S : Set G, Subgroup.closure S = P ∧ S.Finite

{G : Type u_3}
[Group G]
(P : Subgroup G)

P.FG ↔ ∃ S, Subgroup.closure S = P ∧ S.Finite


@[reassoc (attr := simp)]
lemma germ_stalkPullbackInv (f : X ⟶ Y) (F : Y.Presheaf C) (x : X) (V : Opens X) (hV : x ∈ V) :
    ((pullback C f).obj F).germ ⟨x, hV⟩ ≫ stalkPullbackInv C f F x =
    F.germToPullbackStalk _ f V ⟨x, hV⟩

(C : Type u)
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Limits.HasColimits C]
{X Y : TopCat}
(f : X ⟶ Y)
(F : TopCat.Presheaf C Y)
(x : ↑X)
(V : TopologicalSpace.Opens ↑X)
(hV : x ∈ V)

((TopCat.Presheaf.pullback C f).obj F).germ ⟨x, hV⟩ ≫ TopCat.Presheaf.stalkPullbackInv C f F x =
  TopCat.Presheaf.germToPullbackStalk C f F V ⟨x, hV⟩


/-- The equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)` given by yoneda lemma. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_inv counitIso_hom counitIso_inv]
def costructuredArrowYonedaEquivalence (F : Cᵒᵖ ⥤ Type v) :
    F.Elementsᵒᵖ ≌ CostructuredArrow yoneda F

(F : CategoryTheory.Functor Cᵒᵖ (Type v))

(X : CategoryTheory.CostructuredArrow CategoryTheory.yoneda F)

(CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalence F).inverse.obj X =
  Opposite.op ((CategoryTheory.CategoryOfElements.fromCostructuredArrow F).obj (Opposite.op X))


theorem powHalf_zero_rightMoves : (powHalf 0).RightMoves = PEmpty

(SetTheory.PGame.powHalf 0).RightMoves = PEmpty.{u_1 + 1}


@[simp]
lemma map_symm_apply (f : V ≃ W) (G : SimpleGraph V) (w : W) :
    (SimpleGraph.Iso.map f G).symm w = f.symm w

{V : Type u_1}
{W : Type u_2}
(f : V ≃ W)
(G : SimpleGraph V)
(w : W)


@[simp]
theorem head_transpose (A : Matrix m' (Fin n.succ) α) :
    vecHead (of.symm Aᵀ) = vecHead ∘ of.symm A

{α : Type u}
{n : ℕ}
{m' : Type uₘ}
(A : Matrix m' (Fin n.succ) α)

Matrix.vecHead (Matrix.of.symm A.transpose) = Matrix.vecHead ∘ Matrix.of.symm A


@[simp]
theorem compContinuousLinearMapL_apply (g : ContinuousMultilinearMap 𝕜 E₁ G)
    (f : ∀ i, E i →L[𝕜] E₁ i) : compContinuousLinearMapL f g = g.compContinuousLinearMap f

[(i : ι) → SeminormedAddCommGroup (E i)]

[(i : ι) → SeminormedAddCommGroup (E₁ i)]

(ContinuousMultilinearMap.compContinuousLinearMapL f) g = g.compContinuousLinearMap f


theorem transferSylow_restrict_eq_pow : ⇑((transferSylow P hP).restrict (P : Subgroup G)) =
    (fun x : P => x ^ (P : Subgroup G).index)

(hP : (↑P).normalizer ≤ Subgroup.centralizer ↑P)

⇑((MonoidHom.transferSylow P hP).restrict ↑P) = fun x => x ^ (↑P).index


/-- The cocone at `A` for the stalk functor of `skyscraperPresheaf p₀ A` when `y ∈ closure {p₀}`
-/
@[simps]
def skyscraperPresheafCoconeOfSpecializes {y : X} (h : p₀ ⤳ y) :
    Cocone ((OpenNhds.inclusion y).op ⋙ skyscraperPresheaf p₀ A)

[(U : TopologicalSpace.Opens ↑X) → Decidable (p₀ ∈ U)]

(skyscraperPresheafCoconeOfSpecializes p₀ A h).pt = A


protected theorem withDensity_apply (κ : Kernel α β) [IsSFiniteKernel κ]
    (hf : Measurable (Function.uncurry f)) (a : α) :
    withDensity κ f a = (κ a).withDensity (f a)

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

(κ.withDensity f) a = (κ a).withDensity (f a)


/-- The pseudofunctor from `Cat` to `Cat` defined with `WithTerminal`. -/
@[simps]
def pseudofunctor : Pseudofunctor Cat Cat


lemma ThreeGPFree.smul_set₀ (hs : ThreeGPFree s) (ha : a ≠ 0) : ThreeGPFree (a • s)

{α : Type u_2}
[CancelCommMonoidWithZero α]
[NoZeroDivisors α]
{s : Set α}
{a : α}
(hs : ThreeGPFree s)
(ha : a ≠ 0)


theorem map_extChartAt_symm_nhdsWithin_range' {x y : M} (hy : y ∈ (extChartAt I x).source) :
    map (extChartAt I x).symm (𝓝[range I] extChartAt I x y) = 𝓝 y

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(I : ModelWithCorners 𝕜 E H)
[ChartedSpace H M]
{x y : M}
(hy : y ∈ (extChartAt I x).source)

Filter.map (↑(extChartAt I x).symm) (𝓝[Set.range ↑I] ↑(extChartAt I x) y) = 𝓝 y


@[simp]
theorem typein_lt_typein (r : α → α → Prop) [IsWellOrder α r] {a b : α} :
    typein r a < typein r b ↔ r a b

{α : Type u}
(r : α → α → Prop)
[IsWellOrder α r]
{a b : α}

Ordinal.typein r a < Ordinal.typein r b ↔ r a b


theorem Decidable.of_not_imp [Decidable a] (h : ¬(a → b)) : a

{a b : Prop}
[Decidable a]
(h : ¬(a → b))


@[reassoc (attr := simp)]
lemma p_descOpcycles : S.pOpcycles ≫ S.descOpcycles k hk = k

(hk : CategoryTheory.CategoryStruct.comp S.f k = 0)

CategoryTheory.CategoryStruct.comp S.pOpcycles (S.descOpcycles k hk) = k


@[simp]
theorem sigmaCurry_apply (f : ⨁ i : Σ _i, _, δ i.1 i.2) (i : ι) (j : α i) :
    sigmaCurry f i j = f ⟨i, j⟩

[(i : ι) → (j : α i) → AddCommMonoid (δ i j)]

(f : DirectSum ((_i : ι) × α _i) fun i => δ i.fst i.snd)

((DirectSum.sigmaCurry f) i) j = f ⟨i, j⟩


@[instance]
theorem comap_eval_neBot {ι : Type*} {α : ι → Type*} [∀ j, Nonempty (α j)] (i : ι)
    (f : Filter (α i)) [NeBot f] : (comap (eval i) f).NeBot

{ι : Type u_2}
{α : ι → Type u_3}
[∀ (j : ι), Nonempty (α j)]
(i : ι)
(f : Filter (α i))
[f.NeBot]

(Filter.comap (Function.eval i) f).NeBot


/-- Condition that a `LocalizerMorphism` induces an equivalence on the localized categories -/
class IsLocalizedEquivalence : Prop :=
  /-- the induced functor on the constructed localized categories is an equivalence -/
  isEquivalence : (Φ.localizedFunctor W₁.Q W₂.Q).IsEquivalence

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

{Φ : CategoryTheory.LocalizerMorphism W₁ W₂}


theorem Iio_union_Ico (h : min c d ≤ b) : Iio b ∪ Ico c d = Iio (max b d)

{α : Type u_1}
[LinearOrder α]
{b c d : α}
(h : min c d ≤ b)

Set.Iio b ∪ Set.Ico c d = Set.Iio (max b d)


/-- A central extension of nilpotent Lie algebras is nilpotent. -/
theorem LieAlgebra.nilpotent_of_nilpotent_quotient {I : LieIdeal R L} (h₁ : I ≤ center R L)
    (h₂ : IsNilpotent R (L ⧸ I)) : IsNilpotent R L

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{I : LieIdeal R L}
(h₁ : I ≤ LieAlgebra.center R L)
(h₂ : LieAlgebra.IsNilpotent R (L ⧸ I))


/-- A quaternionic basis on `A` is equivalent to a map from the quaternion algebra to `A`. -/
@[simps]
def lift : Basis A c₁ c₂ ≃ (ℍ[R,c₁,c₂] →ₐ[R] A)

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[Ring A]
[Algebra R A]
{c₁ c₂ : R}
(F : ℍ[R,c₁,c₂] →ₐ[R] A)

QuaternionAlgebra.lift.symm F = (QuaternionAlgebra.Basis.self R).compHom F


theorem encard_eq_coe_toFinset_card (s : Set α) [Fintype s] : encard s = s.toFinset.card


theorem Equiv.Perm.viaFintypeEmbedding_apply_mem_range {b : β} (h : b ∈ Set.range f) :
    e.viaFintypeEmbedding f b = f (e (f.invOfMemRange ⟨b, h⟩))

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[DecidableEq β]
(e : Equiv.Perm α)
(f : α ↪ β)
{b : β}
(h : b ∈ Set.range ⇑f)

(e.viaFintypeEmbedding f) b = f (e (f.invOfMemRange ⟨b, h⟩))


@[simp]
lemma incl_obj {i : I} (X : C i) : (incl i).obj X = ⟨i, X⟩

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

(CategoryTheory.Sigma.incl i).obj X = ⟨i, X⟩


theorem le_compProd_apply (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel (α × β) γ)
    [IsSFiniteKernel η] (a : α) (s : Set (β × γ)) :
    ∫⁻ b, η (a, b) {c | (b, c) ∈ s} ∂κ a ≤ (κ ⊗ₖ η) a s

(η : ProbabilityTheory.Kernel (α × β) γ)

∫⁻ (b : β), (η (a, b)) {c | (b, c) ∈ s} ∂κ a ≤ ((κ.compProd η) a) s


lemma cauchy_intCast (z : ℤ) : (z : ℝ).cauchy = z


@[simp]
theorem lowerCentralSeries_zero : lowerCentralSeries G 0 = ⊤


@[to_additive]
theorem uniformity_mulOpposite [UniformSpace α] :
    𝓤 αᵐᵒᵖ = comap (fun q : αᵐᵒᵖ × αᵐᵒᵖ => (q.1.unop, q.2.unop)) (𝓤 α)

𝓤 αᵐᵒᵖ = Filter.comap (fun q => (MulOpposite.unop q.1, MulOpposite.unop q.2)) (𝓤 α)


/-- This is an opaque wrapper around `Nat.pow` to prevent lean from unfolding the definition of
`Nat.pow` on numerals. The arbitrary precondition `p` is actually a formula of the form
`Nat.pow a' b' = c'` but we usually don't care to unfold this proposition so we just carry a
reference to it. -/
structure IsNatPowT (p : Prop) (a b c : Nat) : Prop where
  /-- Unfolds the assertion. -/
  run' : p → Nat.pow a b = c

(self : Mathlib.Meta.NormNum.IsNatPowT p a b c)


/-- One can reformulate smoothness as continuity and smoothness in any extended chart in the
target. -/
theorem contMDiff_iff_target :
    ContMDiff I I' n f ↔
      Continuous f ∧ ∀ y : M',
        ContMDiffOn I 𝓘(𝕜, E') n (extChartAt I' y ∘ f) (f ⁻¹' (extChartAt I' y).source)

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

ContMDiff I I' n f ↔
  Continuous f ∧ ∀ (y : M'), ContMDiffOn I 𝓘(𝕜, E') n (↑(extChartAt I' y) ∘ f) (f ⁻¹' (extChartAt I' y).source)


@[reassoc]
lemma d_snd_v (i j : ℤ) (hij : i + 1 = j) :
    (mappingCone φ).d i j ≫ (snd φ).v j j (add_zero _) =
      (fst φ).1.v i j hij ≫ φ.f j + (snd φ).v i i (add_zero i) ≫ G.d i j

(CochainComplex.mappingCone φ).d i j ≫ (CochainComplex.mappingCone.snd φ).v j j ⋯ =
  (↑(CochainComplex.mappingCone.fst φ)).v i j hij ≫ φ.f j + (CochainComplex.mappingCone.snd φ).v i i ⋯ ≫ G.d i j


@[simp]
theorem sup_empty : (∅ : Finset β).sup f = ⊥

{α : Type u_2}
{β : Type u_3}
[SemilatticeSup α]
[OrderBot α]
{f : β → α}


/-- Given a diagram of `PresheafedSpace C`s, its colimit is computed by pushing the sheaves onto
the colimit of the underlying spaces, and taking componentwise limit.
This is the componentwise diagram for an open set `U` of the colimit of the underlying spaces.
-/
@[simps]
def componentwiseDiagram (F : J ⥤ PresheafedSpace.{_, _, v} C) [HasColimit F]
    (U : Opens (Limits.colimit F).carrier) : Jᵒᵖ ⥤ C

(F : J ⥤ AlgebraicGeometry.PresheafedSpace C)

(U : TopologicalSpace.Opens ↑↑(CategoryTheory.Limits.colimit F))

(AlgebraicGeometry.PresheafedSpace.componentwiseDiagram F U).obj j =
  (F.obj (Opposite.unop j)).presheaf.obj
    (Opposite.op ((TopologicalSpace.Opens.map (CategoryTheory.Limits.colimit.ι F (Opposite.unop j)).base).obj U))


protected theorem contDiff (h : E ≃ₘ^n⟮𝓘(𝕜, E), 𝓘(𝕜, E')⟯ E') : ContDiff 𝕜 n h

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{n : ℕ∞}
(h : E ≃ₘ^n⟮𝓘(𝕜, E), 𝓘(𝕜, E')⟯ E')


theorem coe_image {p : α → Prop} {s : Set (Subtype p)} :
    (↑) '' s = { x | ∃ h : p x, (⟨x, h⟩ : Subtype p) ∈ s }

{α : Type u_1}
{p : α → Prop}
{s : Set (Subtype p)}

Subtype.val '' s = {x | ∃ (h : p x), ⟨x, h⟩ ∈ s}


theorem hasDerivAt_sin (x : ℝ) : HasDerivAt sin (cos x) x


@[to_additive (attr := simp)]
theorem one_eq_inv : 1 = a⁻¹ ↔ a = 1

{α : Type u_1}
[SubtractionMonoid α]
{a : α}


theorem restrict_le_self : μ.restrict s ≤ μ

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


theorem le_iff_forall_lt_rat_imp_le : x ≤ y ↔ ∀ q : ℚ, y < q → x ≤ q

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


theorem PartialHomeomorph.contDiff_univUnitBall : ContDiff ℝ n (univUnitBall : E → E)

{n : ℕ∞}
{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]

ContDiff ℝ n ↑PartialHomeomorph.univUnitBall


@[simp] theorem not_eq_self : ∀(b : Bool), ((!b) = b) ↔ False


theorem ennrealToMeasure {μ : VectorMeasure α ℝ≥0∞} :
    (∀ ⦃s : Set α⦄, μ.ennrealToMeasure s = 0 → v s = 0) ↔ v ≪ᵥ μ

{μ : MeasureTheory.VectorMeasure α ℝ≥0∞}

(∀ ⦃s : Set α⦄, μ.ennrealToMeasure s = 0 → ↑v s = 0) ↔ v ≪ᵥ μ


/-- On a finite-dimensional space, a linear map is injective if and only if it is surjective. -/
theorem injective_iff_surjective [FiniteDimensional K V] {f : V →ₗ[K] V} :
    Injective f ↔ Surjective f

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

Function.Injective ⇑f ↔ Function.Surjective ⇑f


theorem Icc_subset_Iic_self : Icc a b ⊆ Iic b

{α : Type u_2}
[Preorder α]
[LocallyFiniteOrder α]
{a b : α}
[LocallyFiniteOrderBot α]


/-- A topological basis is one that satisfies the necessary conditions so that
  it suffices to take unions of the basis sets to get a topology (without taking
  finite intersections as well). -/
structure IsTopologicalBasis (s : Set (Set α)) : Prop where
  /-- For every point `x`, the set of `t ∈ s` such that `x ∈ t` is directed downwards.  -/
  exists_subset_inter : ∀ t₁ ∈ s, ∀ t₂ ∈ s, ∀ x ∈ t₁ ∩ t₂, ∃ t₃ ∈ s, x ∈ t₃ ∧ t₃ ⊆ t₁ ∩ t₂
  /-- The sets from `s` cover the whole space. -/
  sUnion_eq : ⋃₀ s = univ
  /-- The topology is generated by sets from `s`. -/
  eq_generateFrom : t = generateFrom s

(self : TopologicalSpace.IsTopologicalBasis s)

t₁ ∈ s → ∀ t₂ ∈ s, ∀ x ∈ t₁ ∩ t₂, ∃ t₃ ∈ s, x ∈ t₃ ∧ t₃ ⊆ t₁ ∩ t₂


theorem image_commutatorSet_closureCommutatorRepresentatives :
    (closureCommutatorRepresentatives G).subtype ''
        commutatorSet (closureCommutatorRepresentatives G) =
      commutatorSet G

⇑(closureCommutatorRepresentatives G).subtype '' commutatorSet ↥(closureCommutatorRepresentatives G) = commutatorSet G


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

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

((CategoryTheory.Comma.mapRightIso L i).functor.obj X).hom =
  CategoryTheory.CategoryStruct.comp X.hom (i.hom.app X.right)


/-- In a strictly convex space, two vectors `x`, `y` are in the same ray if and only if the triangle
inequality for `x` and `y` becomes an equality. -/
theorem sameRay_iff_norm_add : SameRay ℝ x y ↔ ‖x + y‖ = ‖x‖ + ‖y‖

{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[StrictConvexSpace ℝ E]
{x y : E}


lemma iff_lTensor_preserves_shortComplex_exact :
    Flat R M ↔
    ∀ (C : ShortComplex $ ModuleCat R) (_ : C.Exact), (C.map (tensorLeft M) |>.Exact)

{R : Type u}
[CommRing R]
(M : ModuleCat R)

Module.Flat R ↑M ↔
  ∀ (C : CategoryTheory.ShortComplex (ModuleCat R)),
    C.Exact → (C.map (CategoryTheory.MonoidalCategory.tensorLeft M)).Exact


theorem HasFPowerSeriesOnBall.hasFDerivAt [CompleteSpace F] (h : HasFPowerSeriesOnBall f p x r)
    {y : E} (hy : (‖y‖₊ : ℝ≥0∞) < r) :
    HasFDerivAt f (continuousMultilinearCurryFin1 𝕜 E F (p.changeOrigin y 1)) (x + y)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{p : FormalMultilinearSeries 𝕜 E F}
{r : ℝ≥0∞}
{f : E → F}
{x : E}
[CompleteSpace F]
(h : HasFPowerSeriesOnBall f p x r)
{y : E}
(hy : ↑‖y‖₊ < r)

HasFDerivAt f ((continuousMultilinearCurryFin1 𝕜 E F) (p.changeOrigin y 1)) (x + y)


@[simp]
theorem map_aeval {B : Type*} [CommSemiring B] (g : σ → S₁) (φ : S₁ →+* B) (p : MvPolynomial σ R) :
    φ (aeval g p) = eval₂Hom (φ.comp (algebraMap R S₁)) (fun i => φ (g i)) p

{R : Type u}
{S₁ : Type v}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₁]
[Algebra R S₁]
{B : Type u_2}
[CommSemiring B]
(g : σ → S₁)
(φ : S₁ →+* B)
(p : MvPolynomial σ R)

φ ((MvPolynomial.aeval g) p) = (MvPolynomial.eval₂Hom (φ.comp (algebraMap R S₁)) fun i => φ (g i)) p


theorem Nontrivial.pair_subset (hs : s.Nontrivial) : ∃ x y, x ≠ y ∧ {x, y} ⊆ s

{α : Type u}
{s : Set α}
(hs : s.Nontrivial)


@[to_additive existing (attr := simp)]
lemma mulRight_mul : Equiv.mulRight (a * b) = Equiv.mulRight b * Equiv.mulRight a


theorem IsExtrFilter.hasLineDerivAt_eq_zero {l : Filter E} (h : IsExtrFilter f l a)
    (hd : HasLineDerivAt ℝ f f' a b) (h' : Tendsto (fun t : ℝ ↦ a + t • b) (𝓝 0) l) : f' = 0

(h' : Filter.Tendsto (fun t => a + t • b) (𝓝 0) l)


/-- The coalgebra instance will be defined in #11975, in
`Mathlib.RingTheory.Coalgebra.TensorProduct`. -/
@[simps] instance instCoalgebraStruct :
    CoalgebraStruct R (A ⊗[R] B)

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[AddCommMonoid A]
[AddCommMonoid B]
[Module R A]
[Module R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]

Coalgebra.comul = ↑(TensorProduct.tensorTensorTensorComm R A A B B) ∘ₗ TensorProduct.map Coalgebra.comul Coalgebra.comul


@[simp]
theorem annihilator_smul (N : Submodule R M) : annihilator N • N = ⊥

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(N : Submodule R M)


theorem IsPositive.adjoint_conj {T : E →L[𝕜] E} (hT : T.IsPositive) (S : F →L[𝕜] E) :
    (S† ∘L T ∘L S).IsPositive

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 E]
[InnerProductSpace 𝕜 F]
[CompleteSpace E]
[CompleteSpace F]
{T : E →L[𝕜] E}
(hT : T.IsPositive)
(S : F →L[𝕜] E)

((ContinuousLinearMap.adjoint S).comp (T.comp S)).IsPositive


theorem det_nonsing_inv_mul_det (h : IsUnit A.det) : A⁻¹.det * A.det = 1

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
(A : Matrix n n α)
(h : IsUnit A.det)


theorem fderiv_continuousMultilinear_apply_const (hc : DifferentiableAt 𝕜 c x) (u : ∀ i, M i) :
    (fderiv 𝕜 (fun y ↦ (c y) u) x) = (fderiv 𝕜 c x).flipMultilinear u

{c : E → ContinuousMultilinearMap 𝕜 M H}

fderiv 𝕜 (fun y => (c y) u) x = (fderiv 𝕜 c x).flipMultilinear u


@[to_additive (attr := simp)]
theorem coe_singletonMulHom : (singletonMulHom : α → Set α) = singleton


@[to_additive]
theorem tprod_sigma' {γ : β → Type*} {f : (Σb : β, γ b) → α}
    (h₁ : ∀ b, Multipliable fun c ↦ f ⟨b, c⟩) (h₂ : Multipliable f) :
    ∏' p, f p = ∏' (b) (c), f ⟨b, c⟩

(h₁ : ∀ (b : β), Multipliable fun c => f ⟨b, c⟩)

∏' (p : (b : β) × γ b), f p = ∏' (b : β) (c : γ b), f ⟨b, c⟩


lemma mulVec_eigenvectorBasis (j : n) :
    A *ᵥ ⇑(hA.eigenvectorBasis j) = (hA.eigenvalues j) • ⇑(hA.eigenvectorBasis j)

{𝕜 : Type u_1}
[RCLike 𝕜]
{n : Type u_2}
[Fintype n]
{A : Matrix n n 𝕜}
[DecidableEq n]
(hA : A.IsHermitian)
(j : n)

A.mulVec ((WithLp.equiv 2 ((i : n) → (fun x => 𝕜) i)) (hA.eigenvectorBasis j)) =
  hA.eigenvalues j • (WithLp.equiv 2 ((i : n) → (fun x => 𝕜) i)) (hA.eigenvectorBasis j)


@[simp, norm_cast]
theorem coe_inf [Inf β] (f g : α →ₛ β) : ⇑(f ⊓ g) = ⇑f ⊓ ⇑g

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[Inf β]
(f g : MeasureTheory.SimpleFunc α β)


theorem fst : IsBoundedLinearMap 𝕜 fun x : E × F => x.1

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]


/-- A function that is bounded and a.e. continuous on a box `I` is integrable on `I`. -/
theorem integrable_of_bounded_and_ae_continuousWithinAt [CompleteSpace E] {I : Box ι} {f : ℝⁿ → E}
    (hb : ∃ C : ℝ, ∀ x ∈ Box.Icc I, ‖f x‖ ≤ C) (μ : Measure ℝⁿ) [IsLocallyFiniteMeasure μ]
    (hc : ∀ᵐ x ∂(μ.restrict (Box.Icc I)), ContinuousWithinAt f (Box.Icc I) x) :
    Integrable I l f μ.toBoxAdditive.toSMul

(hb : ∃ C, ∀ x ∈ BoxIntegral.Box.Icc I, ‖f x‖ ≤ C)

(hc : ∀ᵐ (x : ι → ℝ) ∂μ.restrict (BoxIntegral.Box.Icc I), ContinuousWithinAt f (BoxIntegral.Box.Icc I) x)

BoxIntegral.Integrable I l f μ.toBoxAdditive.toSMul


theorem dvd_pow_natDegree_of_aeval_eq_zero [Algebra R A] [Nontrivial A] [NoZeroSMulDivisors R A]
    {p : R[X]} (hp : p.Monic) (x y : R) (z : A) (h : Polynomial.aeval z p = 0)
    (hz : z * algebraMap R A x = algebraMap R A y) : x ∣ y ^ p.natDegree

(hz : z * (algebraMap R A) x = (algebraMap R A) y)


@[simp]
lemma add_hom_app_obj (a b : A) (X : C) :
    (add F s i a b).hom.app (F.obj X) =
      (i (a + b)).hom.app X ≫ F.map ((shiftFunctorAdd C a b).hom.app X) ≫
        (i b).inv.app ((shiftFunctor C a).obj X) ≫ (s b).map ((i a).inv.app X)

(i : (a : A) → F.comp (s a) ≅ (CategoryTheory.shiftFunctor C a).comp F)

[((CategoryTheory.whiskeringLeft C D D).obj F).Full]

[((CategoryTheory.whiskeringLeft C D D).obj F).Faithful]

(CategoryTheory.HasShift.Induced.add F s i a b).hom.app (F.obj X) =
  CategoryTheory.CategoryStruct.comp ((i (a + b)).hom.app X)
    (CategoryTheory.CategoryStruct.comp (F.map ((CategoryTheory.shiftFunctorAdd C a b).hom.app X))
      (CategoryTheory.CategoryStruct.comp ((i b).inv.app ((CategoryTheory.shiftFunctor C a).obj X))
        ((s b).map ((i a).inv.app X))))


@[to_additive]
theorem tprod_congr {f g : β → α}
    (hfg : ∀ b, f b = g b) : ∏' b, f b = ∏' b, g b

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
{f g : β → α}
(hfg : ∀ (b : β), f b = g b)


/-- The orientation given by a basis derived using `units_smul`, in terms of the product of those
units. -/
theorem orientation_unitsSMul (e : Basis ι R M) (w : ι → Units R) :
    (e.unitsSMul w).orientation = (∏ i, w i)⁻¹ • e.orientation

{R : Type u_1}
[StrictOrderedCommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{ι : Type u_4}
[Fintype ι]
[DecidableEq ι]
(e : Basis ι R M)
(w : ι → Rˣ)

(e.unitsSMul w).orientation = (∏ i : ι, w i)⁻¹ • e.orientation


@[symm]
theorem IsOrtho.symm {U V : Submodule 𝕜 E} (h : U ⟂ V) : V ⟂ U

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{U V : Submodule 𝕜 E}
(h : U ⟂ V)


/-- `ReflGen r`: reflexive closure of `r` -/
@[mk_iff]
inductive ReflGen (r : α → α → Prop) (a : α) : α → Prop
  | refl : ReflGen r a a
  | single {b} : r a b → ReflGen r a b

{α : Type u_1}
(r : α → α → Prop)
(a : α)

∀ (a_1 : α), Relation.ReflGen r a a_1 ↔ a_1 = a ∨ r a a_1


/-- Two elements `a` and `b` are regular if and only if both products `a * b` and `b * a`
are regular. -/
@[to_additive "Two elements `a` and `b` are add-regular if and only if both sums `a + b` and
`b + a` are add-regular."]
theorem isRegular_mul_and_mul_iff :
    IsRegular (a * b) ∧ IsRegular (b * a) ↔ IsRegular a ∧ IsRegular b


/-- The reification of a singleton clause `¬⟦l⟧_v ≡ ¬⟦l⟧_v`. -/
theorem Clause.reify_one {l : Literal} {a : Prop}
    (h₁ : Literal.reify v l a) : Clause.reify v (Clause.nil.cons l) a

{v : Sat.Valuation}
{l : Sat.Literal}
{a : Prop}
(h₁ : Sat.Literal.reify v l a)

Sat.Clause.reify v (Sat.Clause.cons l Sat.Clause.nil) a


theorem continuous_map₂ {δ} [TopologicalSpace δ] {f : α → β → γ} {a : δ → Completion α}
    {b : δ → Completion β} (ha : Continuous a) (hb : Continuous b) :
    Continuous fun d : δ => Completion.map₂ f (a d) (b d)

{α : Type u_1}
[UniformSpace α]
{β : Type u_2}
[UniformSpace β]
{γ : Type u_3}
[UniformSpace γ]
{δ : Type u_4}
[TopologicalSpace δ]
{f : α → β → γ}
{a : δ → UniformSpace.Completion α}
{b : δ → UniformSpace.Completion β}
(ha : Continuous a)
(hb : Continuous b)

Continuous fun d => UniformSpace.Completion.map₂ f (a d) (b d)


theorem inv_inj (h : A⁻¹ = B⁻¹) (h' : IsUnit A.det) : A = B

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
{A B : Matrix n n α}
(h : A⁻¹ = B⁻¹)
(h' : IsUnit A.det)


lemma map_update [DecidableEq ι] (x : (i : ι) → M₁ i) (i : ι) (v : M₁ i)  :
    f (update x i v) = f x - f (update x i (x i - v))

{R : Type uR}
{ι : Type uι}
{M₁ : ι → Type v₁}
{M₂ : Type v₂}
[Semiring R]
[(i : ι) → AddCommGroup (M₁ i)]
[AddCommGroup M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
(f : MultilinearMap R M₁ M₂)
[DecidableEq ι]
(x : (i : ι) → M₁ i)
(i : ι)
(v : M₁ i)

f (Function.update x i v) = f x - f (Function.update x i (x i - v))


lemma isLocallyInjective_sheafToPresheaf_map_iff :
    Presheaf.IsLocallyInjective J ((sheafToPresheaf J D).map φ) ↔ IsLocallyInjective φ

{J : CategoryTheory.GrothendieckTopology C}

CategoryTheory.Presheaf.IsLocallyInjective J ((CategoryTheory.sheafToPresheaf J D).map φ) ↔
  CategoryTheory.Sheaf.IsLocallyInjective φ


@[simp]
theorem add_tsub_cancel_of_le (h : a ≤ b) : a + (b - a) = b

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


/-- Moving to the opposite additive commutative monoid commutes with summing. -/
@[simp]
theorem op_sum [AddCommMonoid β] {s : Finset α} (f : α → β) :
    op (∑ x ∈ s, f x) = ∑ x ∈ s, op (f x)

{α : Type u_3}
{β : Type u_4}
[AddCommMonoid β]
{s : Finset α}
(f : α → β)

MulOpposite.op (∑ x ∈ s, f x) = ∑ x ∈ s, MulOpposite.op (f x)


theorem of_mul_rat (h : Irrational (x * q)) : Irrational x

(q : ℚ)
{x : ℝ}
(h : Irrational (x * ↑q))


@[simp]
theorem swap_lt_swap_iff [LT α] [LT β] {a b : α ⊕ β} : a.swap < b.swap ↔ a < b

{α : Type u_1}
{β : Type u_2}
[LT α]
[LT β]
{a b : α ⊕ β}


protected theorem IsLittleO.insert [TopologicalSpace α] {x : α} {s : Set α} {g : α → E'}
    {g' : α → F'} (h1 : g =o[𝓝[s] x] g') (h2 : g x = 0) : g =o[𝓝[insert x s] x] g'

{α : Type u_1}
{E' : Type u_6}
{F' : Type u_7}
[SeminormedAddCommGroup E']
[SeminormedAddCommGroup F']
[TopologicalSpace α]
{x : α}
{s : Set α}
{g : α → E'}
{g' : α → F'}
(h1 : g =o[𝓝[s] x] g')
(h2 : g x = 0)


theorem divInt_ne_zero_of_ne_zero {n d : ℤ} (h : n ≠ 0) (hd : d ≠ 0) : n /. d ≠ 0


@[simp]
theorem iUnion_empty : (⋃ _ : ι, ∅ : Set α) = ∅


/-- The sum over the values of `mulShift ψ b` for `ψ` primitive is zero when `b ≠ 0`
and `#R` otherwise. -/
theorem sum_mulShift {R : Type*} [CommRing R] [Fintype R] [DecidableEq R]
    {R' : Type*} [CommRing R'] [IsDomain R'] {ψ : AddChar R R'} (b : R)
    (hψ : IsPrimitive ψ) : ∑ x : R, ψ (x * b) = if b = 0 then Fintype.card R else 0

{R : Type u_1}
[CommRing R]
[Fintype R]
[DecidableEq R]
{R' : Type u_2}
[CommRing R']
[IsDomain R']
{ψ : AddChar R R'}
(b : R)
(hψ : ψ.IsPrimitive)

∑ x : R, ψ (x * b) = ↑(if b = 0 then Fintype.card R else 0)


@[simp]
theorem snd_natCast (n : ℕ) : (n : α × β).snd = n

{α : Type u_1}
{β : Type u_2}
[AddMonoidWithOne α]
[AddMonoidWithOne β]
(n : ℕ)


protected theorem eq_mul_of_ediv_eq_left {a b c : Int}
    (H1 : b ∣ a) (H2 : a / b = c) : a = c * b


/-- Given a point `p1` in an affine subspace `s`, and a point `p2`, a point `p` is in the span of
`s` with `p2` added if and only if it is a multiple of `p2 -ᵥ p1` added to a point in `s`. -/
theorem mem_affineSpan_insert_iff {s : AffineSubspace k P} {p1 : P} (hp1 : p1 ∈ s) (p2 p : P) :
    p ∈ affineSpan k (insert p2 (s : Set P)) ↔
      ∃ r : k, ∃ p0 ∈ s, p = r • (p2 -ᵥ p1 : V) +ᵥ p0

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

p ∈ affineSpan k (insert p2 ↑s) ↔ ∃ r, ∃ p0 ∈ s, p = r • (p2 -ᵥ p1) +ᵥ p0


@[simp]
theorem hausdorffMeasure_zero_singleton (x : X) : μH[0] ({x} : Set X) = 1

{X : Type u_2}
[EMetricSpace X]
[MeasurableSpace X]
[BorelSpace X]
(x : X)


@[simp]
theorem coe_add (f g : CuspForm Γ k) : ⇑(f + g) = f + g

{Γ : Subgroup SL(2, ℤ)}
{k : ℤ}
(f g : CuspForm Γ k)


theorem forall_comm {p : α → β → Prop} : (∀ a b, p a b) ↔ (∀ b a, p a b)

{α : Sort u_2}
{β : Sort u_1}
{p : α → β → Prop}

(∀ (a : α) (b : β), p a b) ↔ ∀ (b : β) (a : α), p a b


/-- If an affine independent finset is contained in the affine span of another finset, then its
cardinality is at most the cardinality of that finset. -/
lemma AffineIndependent.card_le_card_of_subset_affineSpan {s t : Finset V}
    (hs : AffineIndependent k ((↑) : s → V)) (hst : (s : Set V) ⊆ affineSpan k (t : Set V)) :
    s.card ≤ t.card

{k : Type u_1}
{V : Type u_2}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
{s t : Finset V}
(hs : AffineIndependent k Subtype.val)
(hst : ↑s ⊆ ↑(affineSpan k ↑t))


theorem tmul_one_mul_one_tmul (a₁ : A) (b₂ : B) :
    (a₁ ᵍ⊗ₜ[R] (1 : B) * (1 : A) ᵍ⊗ₜ[R] b₂ : 𝒜 ᵍ⊗[R] ℬ) = (a₁ : A) ᵍ⊗ₜ (b₂ : B)

{R : Type u_1}
{ι : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring ι]
[Module ι (Additive ℤˣ)]
[DecidableEq ι]
[CommRing R]
[Ring A]
[Ring B]
[Algebra R A]
[Algebra R B]
(𝒜 : ι → Submodule R A)
(ℬ : ι → Submodule R B)
[GradedAlgebra 𝒜]
[GradedAlgebra ℬ]
(a₁ : A)
(b₂ : B)

a₁ ᵍ⊗ₜ[R] 1 * 1 ᵍ⊗ₜ[R] b₂ = a₁ ᵍ⊗ₜ[R] b₂


@[simp]
theorem span_zero {X Y Z : C} (f : X ⟶ Y) (g : X ⟶ Z) : (span f g).obj WalkingSpan.zero = X

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

(CategoryTheory.Limits.span f g).obj CategoryTheory.Limits.WalkingSpan.zero = X


/-- The natural isomorphism `shortComplexFunctor C c j ≅ shortComplexFunctor' C c i j k`
when `c.prev j = i` and `c.next j = k`. -/
@[simps!]
noncomputable def natIsoSc' (i j k : ι) (hi : c.prev j = i) (hk : c.next j = k) :
    shortComplexFunctor C c j ≅ shortComplexFunctor' C c i j k

((HomologicalComplex.natIsoSc' C c i j k hi hk).hom.app X).τ₁ = (X.XIsoOfEq hi).hom


/-- **Ruzsa's triangle inequality**. Div-mul-div version. -/
@[to_additive "**Ruzsa's triangle inequality**. Sub-add-sub version."]
theorem ruzsa_triangle_inequality_div_mul_div (A B C : Finset α) :
    (A / C).card * B.card ≤ (A * B).card * (B / C).card

{α : Type u_1}
[AddCommGroup α]
[DecidableEq α]
(A B C : Finset α)

(A - C).card * B.card ≤ (A + B).card * (B - C).card


theorem mul_left (x₀ : R) {U : Set R} (hU : U ∈ B) : ∃ V ∈ B, V ⊆ (fun x ↦ x₀ * x) ⁻¹' U

{R : Type u}
[Ring R]
(B : RingFilterBasis R)
(x₀ : R)
{U : Set R}
(hU : U ∈ B)


@[simp]
theorem Fintype.card_subtype_compl [Fintype α] (p : α → Prop) [Fintype { x // p x }]
    [Fintype { x // ¬p x }] :
    Fintype.card { x // ¬p x } = Fintype.card α - Fintype.card { x // p x }

{α : Type u_1}
[Fintype α]
(p : α → Prop)
[Fintype { x // p x }]
[Fintype { x // ¬p x }]


/-- The `Nat.Partrec.Code.evaln` function is primitive recursive. -/
theorem evaln_prim : Primrec fun a : (ℕ × Code) × ℕ => evaln a.1.1 a.1.2 a.2

Primrec fun a => Nat.Partrec.Code.evaln a.1.1 a.1.2 a.2


/-- Zero is never a smooth number -/
lemma ne_zero_of_mem_smoothNumbers {n m : ℕ} (h : m ∈ smoothNumbers n) : m ≠ 0


/-- Continuous equivalences from a compact space to a T2 space are homeomorphisms.

This is not true when T2 is weakened to T1
(see `Continuous.homeoOfEquivCompactToT2.t1_counterexample`). -/
@[simps toEquiv] -- Porting note: was `@[simps]`
def homeoOfEquivCompactToT2 [CompactSpace X] [T2Space Y] {f : X ≃ Y} (hf : Continuous f) : X ≃ₜ Y

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[CompactSpace X]
[T2Space Y]
{f : X ≃ Y}
(hf : Continuous ⇑f)


protected theorem single_apply (p) (i : α) (a : E i) (j : α) :
    lp.single p i a j = if h : j = i then Eq.ndrec a h.symm else 0

{α : Type u_1}
{E : α → Type u_2}
[(i : α) → NormedAddCommGroup (E i)]
[DecidableEq α]
(p : ℝ≥0∞)
(i : α)
(a : E i)
(j : α)

↑(lp.single p i a) j = if h : j = i then ⋯ ▸ a else 0


theorem integral_conj {f : X → 𝕜} : ∫ x, conj (f x) ∂μ = conj (∫ x, f x ∂μ)

{X : Type u_1}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
{𝕜 : Type u_5}
[RCLike 𝕜]
{f : X → 𝕜}

∫ (x : X), (starRingEnd 𝕜) (f x) ∂μ = (starRingEnd 𝕜) (∫ (x : X), f x ∂μ)


@[reassoc (attr := simp)]
theorem P_idem (q : ℕ) : (P q : K[X] ⟶ K[X]) ≫ P q = P q

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

AlgebraicTopology.DoldKan.P q ≫ AlgebraicTopology.DoldKan.P q = AlgebraicTopology.DoldKan.P q


@[to_additive]
theorem inv_div_inv : a⁻¹ / b⁻¹ = b / a

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


protected theorem Perm.insert (a : α) {l₁ l₂ : List α} (p : l₁ ~ l₂) :
    l₁.insert a ~ l₂.insert a

{α : Type u_1}
[DecidableEq α]
(a : α)
{l₁ l₂ : List α}
(p : l₁ ~ l₂)


/-- **First moment method**. An integrable function is smaller than its mean on a set of positive
measure. -/
theorem measure_le_average_pos (hμ : μ ≠ 0) (hf : Integrable f μ) :
    0 < μ {x | f x ≤ ⨍ a, f a ∂μ}

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ}
[MeasureTheory.IsFiniteMeasure μ]
(hμ : μ ≠ 0)
(hf : MeasureTheory.Integrable f μ)


private theorem subset_cl {X : Compactum} (A : Set X) : A ⊆ cl A


theorem coeFn_injective : @Function.Injective (P1 →ᵃ[k] P2) (P1 → P2) (⇑)

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
{V2 : Type u_4}
{P2 : Type u_5}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
[AddCommGroup V2]
[Module k V2]
[AffineSpace V2 P2]


theorem measure_union_le (s t : Set α) : μ (s ∪ t) ≤ μ s + μ t

{α : Type u_1}
{F : Type u_3}
[FunLike F (Set α) ℝ≥0∞]
[MeasureTheory.OuterMeasureClass F α]
{μ : F}
(s t : Set α)


/--
`HasRingHomProperty P Q` is a type class asserting that `P` is local at the target and the source,
and for `f : Spec B ⟶ Spec A`, it is equivalent to the ring hom property `Q`.
To make the proofs easier, we state it instead as
1. `Q` is local (See `RingHom.PropertyIsLocal`)
2. `P f` if and only if `Q` holds for every `Γ(Y, U) ⟶ Γ(X, V)` for all affine `U`, `V`.
See `HasRingHomProperty.iff_appLE`.
-/
class HasRingHomProperty (P : MorphismProperty Scheme.{u})
    (Q : outParam (∀ {R S : Type u} [CommRing R] [CommRing S], (R →+* S) → Prop)) : Prop where
  isLocal_ringHomProperty : RingHom.PropertyIsLocal Q
  eq_affineLocally' : P = affineLocally Q

{P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme}

{Q : outParam ({R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop)}

[self : AlgebraicGeometry.HasRingHomProperty P Q]

P = AlgebraicGeometry.affineLocally fun {R S} [CommRing R] [CommRing S] => Q


theorem _root_.Real.nnnorm_rpow_of_nonneg {x y : ℝ} (hx : 0 ≤ x) : ‖x ^ y‖₊ = ‖x‖₊ ^ y


theorem traceAux_eq : traceAux R b = traceAux R c

(R : Type u)
[CommSemiring R]
{M : Type v}
[AddCommMonoid M]
[Module R M]
{ι : Type w}
[DecidableEq ι]
[Fintype ι]
{κ : Type u_1}
[DecidableEq κ]
[Fintype κ]
(b : Basis ι R M)
(c : Basis κ R M)

LinearMap.traceAux R b = LinearMap.traceAux R c


@[to_additive (attr := simp) MeasureTheory.mem_addFundamentalInterior]
theorem mem_fundamentalInterior :
    x ∈ fundamentalInterior G s ↔ x ∈ s ∧ ∀ g : G, g ≠ 1 → x ∉ g • s

{G : Type u_1}
{α : Type u_3}
[Group G]
[MulAction G α]
{s : Set α}
{x : α}

x ∈ MeasureTheory.fundamentalInterior G s ↔ x ∈ s ∧ ∀ (g : G), g ≠ 1 → x ∉ g • s


@[to_additive]
lemma inf_div_right [SemilatticeInf β] [OrderTop β] (s t : Finset α) (f : α → β) :
    inf (s / t) f = inf t fun y ↦ inf s (f <| · / y)

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[Div α]
[SemilatticeInf β]
[OrderTop β]
(s t : Finset α)
(f : α → β)

(s / t).inf f = t.inf fun y => s.inf fun x => f (x / y)