protected theorem inducing (h : X ≃ₜ Y) : Inducing h

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


theorem ContinuousLinearMap.fderivWithin_of_bilinear {f : G' → E} {g : G' → F} {x : G'} {s : Set G'}
    (hf : DifferentiableWithinAt 𝕜 f s x) (hg : DifferentiableWithinAt 𝕜 g s x)
    (hs : UniqueDiffWithinAt 𝕜 s x) :
    fderivWithin 𝕜 (fun y => B (f y) (g y)) s x =
      B.precompR G' (f x) (fderivWithin 𝕜 g s x) + B.precompL G' (fderivWithin 𝕜 f s x) (g x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{G' : Type u_5}
[NormedAddCommGroup G']
[NormedSpace 𝕜 G']
(B : E →L[𝕜] F →L[𝕜] G)
{f : G' → E}
{g : G' → F}
{x : G'}
{s : Set G'}
(hf : DifferentiableWithinAt 𝕜 f s x)
(hg : DifferentiableWithinAt 𝕜 g s x)
(hs : UniqueDiffWithinAt 𝕜 s x)

fderivWithin 𝕜 (fun y => (B (f y)) (g y)) s x =
  ((ContinuousLinearMap.precompR G' B) (f x)) (fderivWithin 𝕜 g s x) +
    ((ContinuousLinearMap.precompL G' B) (fderivWithin 𝕜 f s x)) (g x)


/-- An element of an algebra over a field is algebraic if and only if it is integral. -/
theorem isAlgebraic_iff_isIntegral {x : A} : IsAlgebraic K x ↔ IsIntegral K x

{K : Type u}
{A : Type v}
[Field K]
[Ring A]
[Algebra K A]
{x : A}


@[simp]
theorem restrictScalarsIsometry_toLinearMap :
    (restrictScalarsIsometry 𝕜 E Fₗ 𝕜' 𝕜'').toLinearMap = restrictScalarsₗ 𝕜 E Fₗ 𝕜' 𝕜''

(𝕜 : Type u_1)
(E : Type u_4)
(Fₗ : Type u_7)
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup Fₗ]
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 Fₗ]
(𝕜' : Type u_11)
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜' 𝕜]
[NormedSpace 𝕜' E]
[IsScalarTower 𝕜' 𝕜 E]
[NormedSpace 𝕜' Fₗ]
[IsScalarTower 𝕜' 𝕜 Fₗ]
{𝕜'' : Type u_12}
[Ring 𝕜'']
[Module 𝕜'' Fₗ]
[ContinuousConstSMul 𝕜'' Fₗ]
[SMulCommClass 𝕜 𝕜'' Fₗ]
[SMulCommClass 𝕜' 𝕜'' Fₗ]

(ContinuousLinearMap.restrictScalarsIsometry 𝕜 E Fₗ 𝕜' 𝕜'').toLinearMap =
  ContinuousLinearMap.restrictScalarsₗ 𝕜 E Fₗ 𝕜' 𝕜''


/-- The decomposition of elements of a star module into their self- and skew-adjoint parts,
as a linear equivalence. -/
-- Porting note: This attribute causes a `timeout at 'whnf'`.
@[simps!]
def StarModule.decomposeProdAdjoint : A ≃ₗ[R] selfAdjoint A × skewAdjoint A

(a : ↥(selfAdjoint A) × ↥(skewAdjoint A))

(StarModule.decomposeProdAdjoint R A).symm a =
  (selfAdjoint.submodule R A).subtype a.1 + (skewAdjoint.submodule R A).subtype a.2


theorem singularPart_smul_nnreal (s : SignedMeasure α) (μ : Measure α) (r : ℝ≥0) :
    (r • s).singularPart μ = r • s.singularPart μ

{α : Type u_1}
{m : MeasurableSpace α}
(s : MeasureTheory.SignedMeasure α)
(μ : MeasureTheory.Measure α)
(r : ℝ≥0)


theorem div_ne_zero (ha : a ≠ 0) (hb : b ≠ 0) : a / b ≠ 0

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


protected theorem Chain.pairwise [IsTrans α R] :
    ∀ {a : α} {l : List α}, Chain R a l → Pairwise R (a :: l)

{α : Type u}
{R : α → α → Prop}
[IsTrans α R]
{a : α}
{l : List α}

List.Chain R a l → List.Pairwise R (a :: l)


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

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


theorem K'.elim_aux (a b c d) : K'.elim a b c d K'.aux = c

Turing.PartrecToTM2.K'.elim a b c d Turing.PartrecToTM2.K'.aux = c


theorem one_apply (x : L₁) : (1 : L₁ →ₗ⁅R⁆ L₁) x = x

{R : Type u}
{L₁ : Type v}
[CommRing R]
[LieRing L₁]
[LieAlgebra R L₁]
(x : L₁)


theorem le_findIdx_of_not {p : α → Bool} {xs : List α} {i : ℕ} (h : i < xs.length)
    (h2 : ∀ j (hji : j < i), ¬p (xs.get ⟨j, hji.trans h⟩)) : i ≤ xs.findIdx p

(h2 : ∀ (j : ℕ) (hji : j < i), ¬p (xs.get ⟨j, ⋯⟩) = true)


nonrec theorem half_le_self (a : ℝ≥0) : a / 2 ≤ a


theorem differentiable_Λ₀ : Differentiable ℂ P.Λ₀

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(P : WeakFEPair E)


theorem Embedding.continuous_iff (hg : Embedding g) :
    Continuous f ↔ Continuous (g ∘ f)

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


/-- Universe lift functor for commutative groups. -/
@[to_additive (attr := simps)
  "Universe lift functor for additive commutative groups."]
def uliftFunctor : CommGrp.{u} ⥤ CommGrp.{max u v}

AddCommGrp.uliftFunctor.obj X = AddCommGrp.of (ULift.{v, u} ↑X)


/-- A limit cone for `X : Discrete α ⥤ C` that is given
by `∏ᶜ (fun j => X.obj (Discrete.mk j))`. -/
@[simps]
def Pi.cone : Cone X

[CategoryTheory.Limits.HasProduct fun j => X.obj { as := j }]

(CategoryTheory.Limits.Pi.cone X).π =
  CategoryTheory.Discrete.natTrans fun x => CategoryTheory.Limits.Pi.π (fun j => X.obj { as := j }) x.as


/-- Eta rule for structured arrows. Prefer `StructuredArrow.eta` for rewriting, since equality of
    objects tends to cause problems. -/
theorem eq_mk (f : StructuredArrow S T) : f = mk f.hom

(f : CategoryTheory.StructuredArrow S T)

f = CategoryTheory.StructuredArrow.mk f.hom


/-- The opposite of a functor, i.e. considering a functor `F : C ⥤ D` as a functor `Cᵒᵖ ⥤ Dᵒᵖ`.
In informal mathematics no distinction is made between these. -/
@[simps]
protected def op (F : C ⥤ D) : Cᵒᵖ ⥤ Dᵒᵖ

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

F.op.obj X = Opposite.op (F.obj (Opposite.unop X))


/--
Upgrade a linear equivalence to an algebra equivalence,
given that it distributes over multiplication and the identity
-/
@[simps apply]
def ofLinearEquiv : A₁ ≃ₐ[R] A₂

(map_mul : ∀ (x y : A₁), l (x * y) = l x * l y)

(AlgEquiv.ofLinearEquiv l map_one map_mul) a = l a


theorem setIntegral_indicator (ht : MeasurableSet t) :
    ∫ x in s, t.indicator f x ∂μ = ∫ x in s ∩ t, f x ∂μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : X → E}
{s t : Set X}
{μ : MeasureTheory.Measure X}
(ht : MeasurableSet t)

∫ (x : X) in s, t.indicator f x ∂μ = ∫ (x : X) in s ∩ t, f x ∂μ


/-- If `f` is a monotone function on a left neighborhood of `a` and the image of this neighborhood
under `f` meets every interval `(b, f a)`, `b < f a`, then `f` is continuous at `a` from the left.

The assumption `hfs : ∀ b < f a, ∃ c ∈ s, f c ∈ Ioo b (f a)` cannot be replaced by the weaker
assumption `hfs : ∀ b < f a, ∃ c ∈ s, f c ∈ Ico b (f a)` we use for strictly monotone functions
because otherwise the function `floor : ℝ → ℤ` would be a counter-example at `a = 0`. -/
theorem continuousWithinAt_left_of_monotoneOn_of_exists_between {f : α → β} {s : Set α} {a : α}
    (hf : MonotoneOn f s) (hs : s ∈ 𝓝[≤] a) (hfs : ∀ b < f a, ∃ c ∈ s, f c ∈ Ioo b (f a)) :
    ContinuousWithinAt f (Iic a) a

(hfs : ∀ b < f a, ∃ c ∈ s, f c ∈ Set.Ioo b (f a))


@[simp]
theorem ofLE_ofLE (h₁ : A ≤ B) (h₂ : B ≤ C) (x : A) :
    ofLE h₂ (ofLE h₁ x) = ofLE (h₁.trans h₂) x

{X : Type u_2}
[TopologicalSpace X]
{A B C : DiscreteQuotient X}
(h₁ : A ≤ B)
(h₂ : B ≤ C)
(x : Quotient A.toSetoid)

DiscreteQuotient.ofLE h₂ (DiscreteQuotient.ofLE h₁ x) = DiscreteQuotient.ofLE ⋯ x


@[simp]
theorem GLPos.coe_neg_GL (g : GLPos n R) : ↑(-g) = -(g : GL n R)

{n : Type u}
{R : Type v}
[DecidableEq n]
[Fintype n]
[LinearOrderedCommRing R]
[Fact (Even (Fintype.card n))]
(g : ↥(Matrix.GLPos n R))


/-- Given a measure upstairs (i.e., on `α`), and a choice `s` of fundamental domain, there's always
an artificial way to generate a measure downstairs such that the pair satisfies the
`QuotientMeasureEqMeasurePreimage` typeclass. -/
@[to_additive]
lemma IsFundamentalDomain.quotientMeasureEqMeasurePreimage_quotientMeasure
    {s : Set α} (fund_dom_s : IsFundamentalDomain G s ν) :
    QuotientMeasureEqMeasurePreimage ν ((ν.restrict s).map π)

[MeasureTheory.SMulInvariantMeasure G α ν]

(fund_dom_s : MeasureTheory.IsFundamentalDomain G s ν)

MeasureTheory.QuotientMeasureEqMeasurePreimage ν
  (MeasureTheory.Measure.map (Quotient.mk (MulAction.orbitRel G α)) (ν.restrict s))


theorem degree_finSuccEquiv {f : MvPolynomial (Fin (n + 1)) R} (h : f ≠ 0) :
    (finSuccEquiv R n f).degree = degreeOf 0 f

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

((MvPolynomial.finSuccEquiv R n) f).degree = ↑(MvPolynomial.degreeOf 0 f)


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


protected theorem mul' {p a b : α} (hp : Prime p) (h : (multiplicity p (a * b)).Dom) :
    get (multiplicity p (a * b)) h =
      get (multiplicity p a) ((finite_mul_iff hp).1 h).1 +
        get (multiplicity p b) ((finite_mul_iff hp).1 h).2

{α : Type u_1}
[CancelCommMonoidWithZero α]
[DecidableRel fun x x_1 => x ∣ x_1]
{p a b : α}
(hp : Prime p)
(h : (multiplicity p (a * b)).Dom)

(multiplicity p (a * b)).get h = (multiplicity p a).get ⋯ + (multiplicity p b).get ⋯


@[to_additive]
theorem mem_pow {a : α} {n : ℕ} :
    a ∈ s ^ n ↔ ∃ f : Fin n → s, (List.ofFn fun i ↦ (f i : α)).prod = a

{α : Type u_2}
[AddMonoid α]
{s : Set α}
{a : α}
{n : ℕ}

a ∈ n • s ↔ ∃ f, (List.ofFn fun i => ↑(f i)).sum = a


/-- A family `𝓕 : ι → X → α` is equicontinuous at `x₀` iff `range 𝓕` is equicontinuous at `x₀`,
i.e the family `(↑) : range F → X → α` is equicontinuous at `x₀`. -/
theorem equicontinuousAt_iff_range {F : ι → X → α} {x₀ : X} :
    EquicontinuousAt F x₀ ↔ EquicontinuousAt ((↑) : range F → X → α) x₀

{ι : Type u_1}
{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
{F : ι → X → α}
{x₀ : X}

EquicontinuousAt F x₀ ↔ EquicontinuousAt Subtype.val x₀


theorem pure_map (a : α) : (pure a).map f = pure (f a)

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


theorem cos_le_cos_of_nonneg_of_le_pi {x y : ℝ} (hx₁ : 0 ≤ x) (hy₂ : y ≤ π) (hxy : x ≤ y) :
    cos y ≤ cos x

{x y : ℝ}
(hx₁ : 0 ≤ x)
(hy₂ : y ≤ Real.pi)
(hxy : x ≤ y)


theorem sign_eq_one_iff : sign a = 1 ↔ 0 < a

{α : Type u_1}
[Zero α]
[Preorder α]
[DecidableRel fun x x_1 => x < x_1]
{a : α}


lemma δ₀_eq {x : nerve C _[n + 1]} : (nerve C).δ (0 : Fin (n + 2)) x = x.δ₀

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{n : ℕ}
{x : CategoryTheory.nerve C _[n + 1]}

CategoryTheory.SimplicialObject.δ (CategoryTheory.nerve C) 0 x = CategoryTheory.ComposableArrows.δ₀ x


theorem Prime.isRadical [CommMonoidWithZero R] {y : R} (hy : Prime y) : IsRadical y

{R : Type u_1}
[CommMonoidWithZero R]
{y : R}
(hy : Prime y)


theorem mem_span {s : Set α} (x) : x ∈ span s ↔ ∀ p : Ideal α, s ⊆ p → x ∈ p

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

x ∈ Ideal.span s ↔ ∀ (p : Ideal α), s ⊆ ↑p → x ∈ p


@[simp]
theorem associated_mul_unit_right_iff {β : Type*} [Monoid β] {a b : β} {u : Units β} :
    Associated a (b * u) ↔ Associated a b

{β : Type u_5}
[Monoid β]
{a b : β}
{u : βˣ}


theorem heq_of_eq_rec_right {φ : α → Sort v} {a a' : α} {p₁ : φ a} {p₂ : φ a'} :
    (e : a' = a) → (h₂ : p₁ = Eq.rec (motive := fun a _ ↦ φ a) p₂ e) → HEq p₁ p₂

{α : Sort u}
{φ : α → Sort v}
{a a' : α}
{p₁ : φ a}
{p₂ : φ a'}
(e : a' = a)
(h₂ : p₁ = e ▸ p₂)


theorem tendsto_prodAssoc {h : Filter γ} :
    Tendsto (Equiv.prodAssoc α β γ) ((f ×ˢ g) ×ˢ h) (f ×ˢ (g ×ˢ h))

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : Filter α}
{g : Filter β}
{h : Filter γ}

Filter.Tendsto (⇑(Equiv.prodAssoc α β γ)) ((f ×ˢ g) ×ˢ h) (f ×ˢ g ×ˢ h)


{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
(L : CategoryTheory.Functor C D)
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]


/-- The `i`-th element of a list coincides with the `i`-th element of any of its prefixes of
length `> i`. Version designed to rewrite from the big list to the small list. -/
theorem getElem_take (L : List α) {i j : Nat} (hi : i < L.length) (hj : i < j) :
    L[i] = (L.take j)[i]'(length_take .. ▸ Nat.lt_min.mpr ⟨hj, hi⟩)

{α : Type u_1}
(L : List α)
{i j : Nat}
(hi : i < L.length)
(hj : i < j)


/-- **First moment method**. The minimum of an integrable function is smaller than its integral,
while avoiding a null set. -/
theorem exists_not_mem_null_le_integral (hf : Integrable f μ) (hN : μ N = 0) :
    ∃ x, x ∉ N ∧ f x ≤ ∫ a, f a ∂μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{N : Set α}
{f : α → ℝ}
[MeasureTheory.IsProbabilityMeasure μ]
(hf : MeasureTheory.Integrable f μ)
(hN : μ N = 0)


@[gcongr]
lemma factorial_lt_of_lt {m n : ℕ} (hn : 0 < n) (h : n < m) : n ! < m !


lemma Odd.map [FunLike F α β] [RingHomClass F α β] (f : F) : Odd a → Odd (f a)

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[Semiring α]
[Semiring β]
{a : α}
[FunLike F α β]
[RingHomClass F α β]
(f : F)


theorem borel_eq_generateFrom_Ico (α : Type*) [TopologicalSpace α] [SecondCountableTopology α]
    [LinearOrder α] [OrderTopology α] :
    borel α = .generateFrom { S : Set α | ∃ (l u : α), l < u ∧ Ico l u = S }

(α : Type u_5)
[TopologicalSpace α]
[SecondCountableTopology α]
[LinearOrder α]
[OrderTopology α]

borel α = MeasurableSpace.generateFrom {S | ∃ l u, l < u ∧ Set.Ico l u = S}


/--
Associate to a `(u+1)`-small topological space the corresponding condensed set, given by
`yonedaPresheaf`.
-/
@[simps! val_obj val_map]
noncomputable def TopCat.toCondensedSet (X : TopCat.{u+1}) : CondensedSet.{u}

∀ {X_1 Y : CompHausᵒᵖ} (f : X_1 ⟶ Y) (g : C(↑(compHausToTop.obj (Opposite.unop X_1)), ↑X)),
  X.toCondensedSet.val.map f g = g.comp f.unop


@[to_additive existing (attr := simp)]
lemma zpowersHom_apply (x : α) (n : Multiplicative ℤ) : zpowersHom α x n = x ^ toAdd n

(α : Type u_3)
[Group α]
(x : α)
(n : Multiplicative ℤ)

((zpowersHom α) x) n = x ^ Multiplicative.toAdd n


/-- The norm of the difference of two non-zero vectors equals the sum of their norms
if and only the angle between the two vectors is π. -/
theorem norm_sub_eq_add_norm_iff_angle_eq_pi {x y : V} (hx : x ≠ 0) (hy : y ≠ 0) :
    ‖x - y‖ = ‖x‖ + ‖y‖ ↔ angle x y = π

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
{x y : V}
(hx : x ≠ 0)
(hy : y ≠ 0)

‖x - y‖ = ‖x‖ + ‖y‖ ↔ InnerProductGeometry.angle x y = π


@[simp]
theorem getLast_cons {a : α} {l : List α} :
    ∀ h : l ≠ nil, getLast (a :: l) (cons_ne_nil a l) = getLast l h

{α : Type u}
{a : α}
{l : List α}
(h : l ≠ [])


@[simp]
theorem normSq_le_zero : normSq a ≤ 0 ↔ a = 0

{R : Type u_1}
[LinearOrderedCommRing R]
{a : ℍ[R]}


@[simp] lemma sum'_base_iff {B} : (Matroid.sum' M).Base B ↔ ∀ i, (M i).Base (Prod.mk i ⁻¹' B)

{α : Type u_1}
{ι : Type u_2}
{M : ι → Matroid α}
{B : Set (ι × α)}

(Matroid.sum' M).Base B ↔ ∀ (i : ι), (M i).Base (Prod.mk i ⁻¹' B)


private theorem toStepOfLE'.succ (m n : ℕ) (h : m ≤ n) :
    toStepOfLE' k m (Nat.succ n) (h.trans n.le_succ) =
    (toStepSucc k n) ∘ toStepOfLE' k m n h

(k : Type u)
[Field k]
(m n : ℕ)
(h : m ≤ n)

AlgebraicClosure.toStepOfLE' k m n.succ ⋯ = ⇑(AlgebraicClosure.toStepSucc k n) ∘ AlgebraicClosure.toStepOfLE' k m n h


@[to_additive (attr := simp, to_additive) (reorder := 5 6) smul_apply]
theorem pow_apply [∀ i, Pow (f i) β] (x : ∀ i, f i) (b : β) (i : I) : (x ^ b) i = x i ^ b

{I : Type u}
{β : Type u_2}
{f : I → Type v₁}
[(i : I) → Pow (f i) β]
(x : (i : I) → f i)
(b : β)
(i : I)


theorem coprime_mul_iff_left : Coprime (m * n) k ↔ Coprime m k ∧ Coprime n k

(m * n).Coprime k ↔ m.Coprime k ∧ n.Coprime k


/-- The submodule generated by a finite set is `R`-finite. -/
theorem span_of_finite {A : Set M} (hA : Set.Finite A) :
    Module.Finite R (Submodule.span R A)

(R : Type u_1)
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{A : Set M}
(hA : A.Finite)


/-- A finite cyclotomic extension of an integral noetherian domain is integral -/
theorem integral [IsDomain B] [IsNoetherianRing A] [Finite S] [IsCyclotomicExtension S A B] :
    Algebra.IsIntegral A B

(S : Set ℕ+)
(A : Type u)
(B : Type v)
[CommRing A]
[CommRing B]
[Algebra A B]
[IsDomain B]
[IsNoetherianRing A]
[Finite ↑S]
[IsCyclotomicExtension S A B]


lemma measurableSet_nullSet (h : μ ⟂ₘ ν) : MeasurableSet h.nullSet

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


theorem coeff_inv_aux [DecidableEq σ] (n : σ →₀ ℕ) (a : R) (φ : MvPowerSeries σ R) :
    coeff R n (inv.aux a φ) =
      if n = 0 then a
      else
        -a *
          ∑ x ∈ antidiagonal n, if x.2 < n then coeff R x.1 φ * coeff R x.2 (inv.aux a φ) else 0

{σ : Type u_1}
{R : Type u_2}
[Ring R]
[DecidableEq σ]
(n : σ →₀ ℕ)
(a : R)
(φ : MvPowerSeries σ R)

(MvPowerSeries.coeff R n) (MvPowerSeries.inv.aux a φ) =
  if n = 0 then a
  else
    -a *
      ∑ x ∈ Finset.antidiagonal n,
        if x.2 < n then (MvPowerSeries.coeff R x.1) φ * (MvPowerSeries.coeff R x.2) (MvPowerSeries.inv.aux a φ) else 0


@[reassoc (attr := simp)]
theorem plusCompIso_whiskerLeft {F G : D ⥤ E} (η : F ⟶ G) (P : Cᵒᵖ ⥤ D)
    [∀ X : C, PreservesColimitsOfShape (J.Cover X)ᵒᵖ F]
    [∀ (X : C) (W : J.Cover X) (P : Cᵒᵖ ⥤ D), PreservesLimit (W.index P).multicospan F]
    [∀ X : C, PreservesColimitsOfShape (J.Cover X)ᵒᵖ G]
    [∀ (X : C) (W : J.Cover X) (P : Cᵒᵖ ⥤ D), PreservesLimit (W.index P).multicospan G] :
    whiskerLeft _ η ≫ (J.plusCompIso G P).hom =
      (J.plusCompIso F P).hom ≫ J.plusMap (whiskerLeft _ η)

(J : CategoryTheory.GrothendieckTopology C)

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

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

[∀ (α β : Type (max v u)) (fst snd : β → α),
    CategoryTheory.Limits.HasLimitsOfShape (CategoryTheory.Limits.WalkingMulticospan fst snd) D]

[∀ (α β : Type (max v u)) (fst snd : β → α),
    CategoryTheory.Limits.HasLimitsOfShape (CategoryTheory.Limits.WalkingMulticospan fst snd) E]

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

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

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

[(X : C) →
    (W : J.Cover X) →
      (P : CategoryTheory.Functor Cᵒᵖ D) → CategoryTheory.Limits.PreservesLimit (W.index P).multicospan F]

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

[(X : C) →
    (W : J.Cover X) →
      (P : CategoryTheory.Functor Cᵒᵖ D) → CategoryTheory.Limits.PreservesLimit (W.index P).multicospan G]

CategoryTheory.CategoryStruct.comp (CategoryTheory.whiskerLeft (J.plusObj P) η) (J.plusCompIso G P).hom =
  CategoryTheory.CategoryStruct.comp (J.plusCompIso F P).hom (J.plusMap (CategoryTheory.whiskerLeft P η))


@[reassoc (attr := simp)]
lemma IsColimit.inr_desc {t : PushoutCocone f g} (ht : IsColimit t) {W : C} (h : Y ⟶ W) (k : Z ⟶ W)
    (w : f ≫ h = g ≫ k) : inr t ≫ IsColimit.desc ht h k w = k

{t : CategoryTheory.Limits.PushoutCocone f g}

(ht : CategoryTheory.Limits.IsColimit t)

t.inr ≫ CategoryTheory.Limits.PushoutCocone.IsColimit.desc ht h k w = k


theorem le_generate_iff {s : Set (Set α)} {f : Filter α} : f ≤ generate s ↔ s ⊆ f.sets

{α : Type u}
{s : Set (Set α)}
{f : Filter α}


/-- The submonoid generated by an element of a monoid equals the set of natural number powers of
    the element. -/
@[to_additive
      "The `AddSubmonoid` generated by an element of an `AddMonoid` equals the set of
      natural number multiples of the element."]
theorem closure_singleton {x : M} : Closure ({x} : Set M) = powers x


@[simp]
theorem lTensorBot_one_tmul (a : A) : A.lTensorBot (1 ⊗ₜ[R] a) = a

{R : Type u}
{S : Type v}
[CommSemiring R]
[Semiring S]
[Algebra R S]
{A : Subalgebra R S}
(a : ↥A)


@[simp]
theorem Icc_mem_nhds_iff [NoMinOrder α] [NoMaxOrder α] {a b x : α} :
    Icc a b ∈ 𝓝 x ↔ x ∈ Ioo a b

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
[NoMinOrder α]
[NoMaxOrder α]
{a b x : α}


theorem le_bmex_of_forall {o : Ordinal} (f : ∀ a < o, Ordinal) {a : Ordinal}
    (H : ∀ b < a, ∃ i hi, f i hi = b) : a ≤ bmex o f

(f : (a : Ordinal.{u_4}) → a < o → Ordinal.{max u_4 u_5})

(H : ∀ b < a, ∃ i, ∃ (hi : i < o), f i hi = b)


theorem IsClosed.hypograph [TopologicalSpace β] {f : β → α} {s : Set β} (hs : IsClosed s)
    (hf : ContinuousOn f s) : IsClosed { p : β × α | p.1 ∈ s ∧ p.2 ≤ f p.1 }

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder α]
[t : OrderClosedTopology α]
[TopologicalSpace β]
{f : β → α}
{s : Set β}
(hs : IsClosed s)
(hf : ContinuousOn f s)


/-- The cartesian product of two monoidal natural transformations is monoidal. -/
@[simps]
def prod {F G : LaxMonoidalFunctor C D} {H K : LaxMonoidalFunctor C E} (α : MonoidalNatTrans F G)
    (β : MonoidalNatTrans H K) : MonoidalNatTrans (F.prod' H) (G.prod' K)

{F G : CategoryTheory.LaxMonoidalFunctor C D}

{H K : CategoryTheory.LaxMonoidalFunctor C E}

(α : CategoryTheory.MonoidalNatTrans F G)

(β : CategoryTheory.MonoidalNatTrans H K)


theorem ext_smul {w₁ w₂ : NormalWord d} (i : ι)
    (h : CoprodI.of (φ i w₁.head) • w₁.toWord =
         CoprodI.of (φ i w₂.head) • w₂.toWord) :
    w₁ = w₂

{d : Monoid.PushoutI.NormalWord.Transversal φ}

(h : Monoid.CoprodI.of ((φ i) w₁.head) • w₁.toWord = Monoid.CoprodI.of ((φ i) w₂.head) • w₂.toWord)


theorem cluster_point_of_Lindelof [LindelofSpace X] (f : Filter X) [NeBot f]
    [CountableInterFilter f] : ∃ x, ClusterPt x f

{X : Type u}
[TopologicalSpace X]
[LindelofSpace X]
(f : Filter X)
[f.NeBot]
[CountableInterFilter f]


/--
Deprecated: `algebraMap_surjective_of_isIntegral` is identical apart from the `IsIntegral` argument,
which can be found by instance synthesis
-/
@[deprecated algebraMap_surjective_of_isIntegral (since := "2024-05-08")]
theorem algebraMap_surjective_of_isAlgebraic {k K : Type*} [Field k] [Ring K] [IsDomain K]
    [IsAlgClosed k] [Algebra k K] [Algebra.IsAlgebraic k K] :
    Function.Surjective (algebraMap k K)

{k : Type u_1}
{K : Type u_2}
[Field k]
[Ring K]
[IsDomain K]
[IsAlgClosed k]
[Algebra k K]
[Algebra.IsAlgebraic k K]


@[simp]
theorem coe_addMonoidHom_refl : (RingEquiv.refl R : R →+ R) = AddMonoidHom.id R


@[simp]
theorem fork_ι : (fork F U).ι = res F U

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Limits.HasProducts C]
{X : TopCat}
(F : TopCat.Presheaf C X)
{ι : Type v'}
(U : ι → TopologicalSpace.Opens ↑X)

(TopCat.Presheaf.SheafConditionEqualizerProducts.fork F U).ι = TopCat.Presheaf.SheafConditionEqualizerProducts.res F U


@[reassoc (attr := simp)]
theorem piIsoPi_inv_π {ι : Type v} (α : ι → TopCat.{max v u}) (i : ι) :
    (piIsoPi α).inv ≫ Pi.π α i = piπ α i

(TopCat.piIsoPi α).inv ≫ CategoryTheory.Limits.Pi.π α i = TopCat.piπ α i


@[reassoc (attr := simp)]
lemma IsLimit.lift_snd {t : PullbackCone f g} (ht : IsLimit t) {W : C} (h : W ⟶ X) (k : W ⟶ Y)
    (w : h ≫ f = k ≫ g) : IsLimit.lift ht h k w ≫ snd t = k

{t : CategoryTheory.Limits.PullbackCone f g}

CategoryTheory.Limits.PullbackCone.IsLimit.lift ht h k w ≫ t.snd = k


theorem forall_and : (∀ x, p x ∧ q x) ↔ (∀ x, p x) ∧ (∀ x, q x)

(∀ (x : α), p x ∧ q x) ↔ (∀ (x : α), p x) ∧ ∀ (x : α), q x


@[to_additive (attr := simp)]
lemma coe_monoidHom_comp_coe_monoidHom_symm (e : M ≃* N) :
    (e : M →* N).comp e.symm = MonoidHom.id _

{M : Type u_6}
{N : Type u_7}
[MulOneClass M]
[MulOneClass N]
(e : M ≃* N)


@[simp, norm_cast]
theorem coe_sInf (S : Set (UpperSet α)) : (↑(sInf S) : Set α) = ⋃ s ∈ S, ↑s

{α : Type u_1}
[LE α]
(S : Set (UpperSet α))


theorem HasLineDerivAt.congr_of_eventuallyEq (h : HasLineDerivAt 𝕜 f f' x v) (h₁ : f₁ =ᶠ[𝓝 x] f) :
    HasLineDerivAt 𝕜 f₁ f' x v

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f f₁ : E → F}
{f' : F}
{x v : E}
(h : HasLineDerivAt 𝕜 f f' x v)
(h₁ : f₁ =ᶠ[𝓝 x] f)


lemma next_eq_self' (c : ComplexShape ι) (j : ι) (hj : ∀ k, ¬ c.Rel j k) :
    c.next j = j

{ι : Type u_1}
(c : ComplexShape ι)
(j : ι)
(hj : ∀ (k : ι), ¬c.Rel j k)


/-- Product of a multiset of elements in a `Subsemiring` of a `CommSemiring`
    is in the `Subsemiring`. -/
protected theorem multiset_prod_mem {R} [CommSemiring R] (s : Subsemiring R) (m : Multiset R) :
    (∀ a ∈ m, a ∈ s) → m.prod ∈ s

{R : Type u_1}
[CommSemiring R]
(s : Subsemiring R)
(m : Multiset R)


/--
Convex hull of `s` is equal to the set of all centers of masses of `Finset`s `t`, `z '' t ⊆ s`.
For universe reasons, you shouldn't use this lemma to prove that a given center of mass belongs
to the convex hull. Use convexity of the convex hull instead.
-/
theorem convexHull_eq (s : Set E) : convexHull R s =
    { x : E | ∃ (ι : Type) (t : Finset ι) (w : ι → R) (z : ι → E), (∀ i ∈ t, 0 ≤ w i) ∧
      ∑ i ∈ t, w i = 1 ∧ (∀ i ∈ t, z i ∈ s) ∧ t.centerMass w z = x }

{R : Type u_1}
{E : Type u_3}
[LinearOrderedField R]
[AddCommGroup E]
[Module R E]
(s : Set E)

(convexHull R) s = {x | ∃ ι t w z, (∀ i ∈ t, 0 ≤ w i) ∧ ∑ i ∈ t, w i = 1 ∧ (∀ i ∈ t, z i ∈ s) ∧ t.centerMass w z = x}


@[simp]
lemma homMk₅_app_two :
    (homMk₅ app₀ app₁ app₂ app₃ app₄ app₅ w₀ w₁ w₂ w₃ w₄).app ⟨2, by valid⟩ = app₂

{f g : CategoryTheory.ComposableArrows C 5}

(w₀ :
  CategoryTheory.CategoryStruct.comp (f.map' 0 1 ⋯ ⋯) app₁ = CategoryTheory.CategoryStruct.comp app₀ (g.map' 0 1 ⋯ ⋯))

(w₁ :
  CategoryTheory.CategoryStruct.comp (f.map' 1 2 ⋯ ⋯) app₂ = CategoryTheory.CategoryStruct.comp app₁ (g.map' 1 2 ⋯ ⋯))

(w₂ :
  CategoryTheory.CategoryStruct.comp (f.map' 2 3 ⋯ ⋯) app₃ = CategoryTheory.CategoryStruct.comp app₂ (g.map' 2 3 ⋯ ⋯))

(w₃ :
  CategoryTheory.CategoryStruct.comp (f.map' 3 4 ⋯ ⋯) app₄ = CategoryTheory.CategoryStruct.comp app₃ (g.map' 3 4 ⋯ ⋯))

(w₄ :
  CategoryTheory.CategoryStruct.comp (f.map' 4 5 ⋯ ⋯) app₅ = CategoryTheory.CategoryStruct.comp app₄ (g.map' 4 5 ⋯ ⋯))

(CategoryTheory.ComposableArrows.homMk₅ app₀ app₁ app₂ app₃ app₄ app₅ w₀ w₁ w₂ w₃ w₄).app ⟨2, ⋯⟩ = app₂


/-- `e` and `ε` have characteristic properties of a basis and its dual -/
-- @[nolint has_nonempty_instance] Porting note (#5171): removed
structure Module.DualBases (e : ι → M) (ε : ι → Dual R M) : Prop where
  eval : ∀ i j : ι, ε i (e j) = if i = j then 1 else 0
  protected total : ∀ {m : M}, (∀ i, ε i m = 0) → m = 0
  protected finite : ∀ m : M, { i | ε i m ≠ 0 }.Finite := by
      use_finite_instance

{R : Type u_1}
{M : Type u_2}
{ι : Type u_3}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[DecidableEq ι]
{e : ι → M}
{ε : ι → Module.Dual R M}
(self : Module.DualBases e ε)
{m : M}


theorem thin_of_isSeparating_empty (h : IsSeparating (∅ : Set C)) : Quiver.IsThin C

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
(h : CategoryTheory.IsSeparating ∅)


@[simp]
theorem fst_comp_inl [Zero M] : fst ∘ (inl : R → tsze R M) = id

TrivSqZeroExt.fst ∘ TrivSqZeroExt.inl = id


/-- A locally Lipschitz function is continuous. (The converse is false: for example,
$x ↦ \sqrt{x}$ is continuous, but not locally Lipschitz at 0.) -/
protected theorem continuous {f : α → β} (hf : LocallyLipschitz f) : Continuous f

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{f : α → β}
(hf : LocallyLipschitz f)


theorem compare_lt_iff_lt {a b : α} : (compare a b = .lt) ↔ a < b


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

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


theorem coeff_rename_ne_zero (f : σ → τ) (φ : MvPolynomial σ R) (d : τ →₀ ℕ)
    (h : (rename f φ).coeff d ≠ 0) : ∃ u : σ →₀ ℕ, u.mapDomain f = d ∧ φ.coeff u ≠ 0

(d : τ →₀ ℕ)

(h : MvPolynomial.coeff d ((MvPolynomial.rename f) φ) ≠ 0)

∃ u, Finsupp.mapDomain f u = d ∧ MvPolynomial.coeff u φ ≠ 0


/-- Any element of the spectrum of a selfadjoint is real. -/
theorem selfAdjoint.mem_spectrum_eq_re [StarModule ℂ A] (a : selfAdjoint A) {z : ℂ}
    (hz : z ∈ spectrum ℂ (a : A)) : z = z.re

{A : Type u_1}
[NormedRing A]
[NormedAlgebra ℂ A]
[CompleteSpace A]
[StarRing A]
[CstarRing A]
[StarModule ℂ A]
(a : ↥(selfAdjoint A))
{z : ℂ}
(hz : z ∈ spectrum ℂ ↑a)


lemma congr_cylinder_of_subset (hP : IsProjectiveMeasureFamily P)
    {S : Set (∀ i : I, α i)} {T : Set (∀ i : J, α i)} (hT : MeasurableSet T)
    (h_eq : cylinder I S = cylinder J T) (hJI : J ⊆ I) :
    P I S = P J T

{P : (J : Finset ι) → MeasureTheory.Measure ((j : { x // x ∈ J }) → α ↑j)}

(hP : MeasureTheory.IsProjectiveMeasureFamily P)

(h_eq : MeasureTheory.cylinder I S = MeasureTheory.cylinder J T)


theorem coe_ofIsClosedGraph (hg : IsClosed (g.graph : Set <| E × F)) :
    ↑(ContinuousLinearMap.ofIsClosedGraph hg) = g

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace E]
{F : Type u_5}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{g : E →ₗ[𝕜] F}
(hg : IsClosed ↑g.graph)


theorem nonempty_of_mem_countableBasis [SecondCountableTopology α] {s : Set α}
    (hs : s ∈ countableBasis α) : s.Nonempty

(hs : s ∈ TopologicalSpace.countableBasis α)


theorem exists_aeval_eq_zero {R : Type*} [Field R] [IsAlgClosed k] [Algebra R k] (p : R[X])
    (hp : p.degree ≠ 0) : ∃ x : k, aeval x p = 0

(k : Type u)
[Field k]
{R : Type u_1}
[Field R]
[IsAlgClosed k]
[Algebra R k]
(p : R[X])
(hp : p.degree ≠ 0)


/-- The forward direction of `Comon_ (Mon_ C) ≌ Mon_ (Comon_ C)` -/
@[simps]
def toMon_Comon_ : Bimon_ C ⥤ Mon_ (Comon_ C)

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

∀ {X Y : Bimon_ C} (f : X ⟶ Y), ((Bimon_.toMon_Comon_ C).map f).hom = (Bimon_.toComon_ C).map f


@[simp]
theorem snd_natCast [AddMonoidWithOne R] [AddMonoid M] (n : ℕ) : (n : tsze R M).snd = 0

{R : Type u}
{M : Type v}
[AddMonoidWithOne R]
[AddMonoid M]
(n : ℕ)


theorem fromBlocks_mulVec [Fintype l] [Fintype m] [NonUnitalNonAssocSemiring α] (A : Matrix n l α)
    (B : Matrix n m α) (C : Matrix o l α) (D : Matrix o m α) (x : l ⊕ m → α) :
    (fromBlocks A B C D) *ᵥ x =
      Sum.elim (A *ᵥ (x ∘ Sum.inl) + B *ᵥ (x ∘ Sum.inr))
        (C *ᵥ (x ∘ Sum.inl) + D *ᵥ (x ∘ Sum.inr))

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type u_12}
[Fintype l]
[Fintype m]
[NonUnitalNonAssocSemiring α]
(A : Matrix n l α)
(B : Matrix n m α)
(C : Matrix o l α)
(D : Matrix o m α)
(x : l ⊕ m → α)

Matrix.fromBlocks A B C D *ᵥ x = Sum.elim (A *ᵥ x ∘ Sum.inl + B *ᵥ x ∘ Sum.inr) (C *ᵥ x ∘ Sum.inl + D *ᵥ x ∘ Sum.inr)


theorem Infinitesimal.eq_zero {r : ℝ} : Infinitesimal r → r = 0


theorem span_sum : Set.range (eval C) = Set.range (Sum.elim
    (fun (l : GoodProducts (π C (ord I · < o))) ↦ Products.eval C l.1)
    (fun (l : MaxProducts C ho) ↦ Products.eval C l.1))

(hsC : Profinite.NobelingProof.contained C (Order.succ o))

(ho : o < Ordinal.type fun x x_1 => x < x_1)

Set.range (Profinite.NobelingProof.GoodProducts.eval C) =
  Set.range
    (Sum.elim (fun l => Profinite.NobelingProof.Products.eval C ↑l) fun l => Profinite.NobelingProof.Products.eval C ↑l)


@[simp]
theorem val_comp_codRestrict (f : A →ₐ[R] B) (S : Subalgebra R B) (hf : ∀ x, f x ∈ S) :
    S.val.comp (f.codRestrict S hf) = f

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
(f : A →ₐ[R] B)
(S : Subalgebra R B)
(hf : ∀ (x : A), f x ∈ S)


theorem sinh_three_mul : sinh (3 * x) = 4 * sinh x ^ 3 + 3 * sinh x

Complex.sinh (3 * x) = 4 * Complex.sinh x ^ 3 + 3 * Complex.sinh x


@[deprecated (since := "2024-07-22"), simp]
theorem bind_singleton {α} (x : LazyList α) : x.bind singleton = x


@[simp]
theorem pure_le_nhds_iff [T1Space X] {a b : X} : pure a ≤ 𝓝 b ↔ a = b

{X : Type u_1}
[TopologicalSpace X]
[T1Space X]
{a b : X}


protected theorem congr_arg (φ : A →ₐc[R] B) {x y : A} (h : x = y) : φ x = φ y

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
(φ : A →ₐc[R] B)
{x y : A}
(h : x = y)


protected theorem orthogonalProjection_eq_sum {U : Submodule 𝕜 E} [CompleteSpace U]
    (b : OrthonormalBasis ι 𝕜 U) (x : E) :
    orthogonalProjection U x = ∑ i, ⟪(b i : E), x⟫ • b i

{ι : Type u_1}
{𝕜 : Type u_3}
[RCLike 𝕜]
{E : Type u_4}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[Fintype ι]
{U : Submodule 𝕜 E}
[CompleteSpace ↥U]
(b : OrthonormalBasis ι 𝕜 ↥U)
(x : E)

(orthogonalProjection U) x = ∑ i : ι, ⟪↑(b i), x⟫_𝕜 • b i


theorem next_eq' (c : ComplexShape ι) {i j : ι} (h : c.Rel i j) : c.next i = j

{ι : Type u_1}
(c : ComplexShape ι)
{i j : ι}
(h : c.Rel i j)


/-- We relate a finite product over primes to an infinite sum over smooth numbers. -/
lemma summable_and_hasSum_smoothNumbers_prod_primesBelow_tsum
    (hsum : ∀ {p : ℕ}, p.Prime → Summable (fun n : ℕ ↦ ‖f (p ^ n)‖)) (N : ℕ) :
    Summable (fun m : N.smoothNumbers ↦ ‖f m‖) ∧
      HasSum (fun m : N.smoothNumbers ↦ f m) (∏ p ∈ N.primesBelow, ∑' n : ℕ, f (p ^ n))

(hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n)

(hsum : ∀ {p : ℕ}, Nat.Prime p → Summable fun n => ‖f (p ^ n)‖)

(Summable fun m => ‖f ↑m‖) ∧ HasSum (fun m => f ↑m) (∏ p ∈ N.primesBelow, ∑' (n : ℕ), f (p ^ n))


/-- The equivalence of functor categories given by currying/uncurrying.
-/
@[simps!]
def currying : C ⥤ D ⥤ E ≌ C × D ⥤ E

{C : Type u₂}
[CategoryTheory.Category.{v₂, u₂} C]
{D : Type u₃}
[CategoryTheory.Category.{v₃, u₃} D]
{E : Type u₄}
[CategoryTheory.Category.{v₄, u₄} E]
(X : CategoryTheory.Functor (C × D) E)

∀ (X_1 : C × D),
  (CategoryTheory.currying.counitIso.inv.app X).app X_1 = CategoryTheory.CategoryStruct.id (X.obj (X_1.1, X_1.2))


/-- A version of `MultilinearMap.cons_add` for `AlternatingMap`. -/
theorem map_vecCons_add {n : ℕ} (f : M [⋀^Fin n.succ]→ₗ[R] N) (m : Fin n → M) (x y : M) :
    f (Matrix.vecCons (x + y) m) = f (Matrix.vecCons x m) + f (Matrix.vecCons y m)

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{n : ℕ}
(f : M [⋀^Fin n.succ]→ₗ[R] N)
(m : Fin n → M)
(x y : M)


/-- `ContinuousMultilinearMap.pi` as an `Equiv`. -/
@[simps]
def piEquiv {ι' : Type*} {M' : ι' → Type*} [∀ i, AddCommMonoid (M' i)]
    [∀ i, TopologicalSpace (M' i)] [∀ i, Module R (M' i)] :
    (∀ i, ContinuousMultilinearMap R M₁ (M' i)) ≃ ContinuousMultilinearMap R M₁ (∀ i, M' i)

(f : (i : ι') → ContinuousMultilinearMap R M₁ (M' i))

ContinuousMultilinearMap.piEquiv f = ContinuousMultilinearMap.pi f


@[to_additive]
theorem lt_inv_iff_mul_lt_one : a < b⁻¹ ↔ a * b < 1

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


@[simp]
lemma equivFreeAlgebra_ι_apply (b : Basis κ R M) (i : κ) :
    equivFreeAlgebra b (ι R (b i)) = FreeAlgebra.ι R i

{κ : Type uκ}
{R : Type uR}
{M : Type uM}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(b : Basis κ R M)
(i : κ)

(TensorAlgebra.equivFreeAlgebra b) ((TensorAlgebra.ι R) (b i)) = FreeAlgebra.ι R i


@[to_additive]
theorem MonoidHomClass.antilipschitz_of_bound [MonoidHomClass 𝓕 E F] (f : 𝓕) {K : ℝ≥0}
    (h : ∀ x, ‖x‖ ≤ K * ‖f x‖) : AntilipschitzWith K f

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


@[to_additive one_lt_index_of_ne_top]
theorem one_lt_index_of_ne_top [Finite (G ⧸ H)] (hH : H ≠ ⊤) : 1 < H.index

{G : Type u_1}
[Group G]
{H : Subgroup G}
[Finite (G ⧸ H)]
(hH : H ≠ ⊤)


theorem Salient.anti {S T : ConvexCone 𝕜 E} (h : T ≤ S) : S.Salient → T.Salient

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommGroup E]
[SMul 𝕜 E]
{S T : ConvexCone 𝕜 E}
(h : T ≤ S)


theorem UniqueDiffWithinAt.mono_nhds (h : UniqueDiffWithinAt 𝕜 s x) (st : 𝓝[s] x ≤ 𝓝[t] x) :
    UniqueDiffWithinAt 𝕜 t x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{s t : Set E}
(h : UniqueDiffWithinAt 𝕜 s x)
(st : 𝓝[s] x ≤ 𝓝[t] x)


@[to_additive (attr := mono)]
theorem tprod_mono (hf : Multipliable f) (hg : Multipliable g) (h : f ≤ g) :
    ∏' n, f n ≤ ∏' n, g n

{ι : Type u_1}
{α : Type u_3}
[OrderedCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{f g : ι → α}
(hf : Multipliable f)
(hg : Multipliable g)
(h : f ≤ g)


theorem copy_eq (f : sInfHom α β) (f' : α → β) (h : f' = f) : f.copy f' h = f

{α : Type u_2}
{β : Type u_3}
[InfSet α]
[InfSet β]
(f : sInfHom α β)
(f' : α → β)
(h : f' = ⇑f)


theorem coprime_of_mul_modEq_one (b : ℕ) {a n : ℕ} (h : a * b ≡ 1 [MOD n]) : a.Coprime n


@[simp]
theorem projIcc_right : projIcc a b h b = ⟨b, right_mem_Icc.2 h⟩

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


theorem results_pure (a : α) : Results (pure a) a 0


@[to_additive eq_sub_iff_add_eq]
theorem eq_div_iff_mul_eq' : a = b / c ↔ a * c = b


theorem cast_card_eq_mk {α : Type*} [Finite α] : ↑(Nat.card α) = Cardinal.mk α


/-- **Fundamental theorem of calculus-2**, on semi-infinite intervals `(-∞, a)`.
When a function has a limit `m` at `-∞`, and its derivative is integrable, then the
integral of the derivative on `(-∞, a)` is `f a - m`. Version assuming differentiability
on `(-∞, a]`.

Note that such a function always has a limit at minus infinity,
see `tendsto_limUnder_of_hasDerivAt_of_integrableOn_Iic`. -/
theorem integral_Iic_of_hasDerivAt_of_tendsto'
    (hderiv : ∀ x ∈ Iic a, HasDerivAt f (f' x) x) (f'int : IntegrableOn f' (Iic a))
    (hf : Tendsto f atBot (𝓝 m)) : ∫ x in Iic a, f' x = f a - m

(hderiv : ∀ x ∈ Set.Iic a, HasDerivAt f (f' x) x)

(f'int : MeasureTheory.IntegrableOn f' (Set.Iic a) MeasureTheory.volume)

(hf : Filter.Tendsto f Filter.atBot (𝓝 m))


@[simp]
theorem opObjUnop_inv_app (X : Cᵒᵖ) (j : Jᵒᵖ) : (opObjUnop.{v₁, v₂} X).inv.app j = 𝟙 _

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

(CategoryTheory.Functor.const.opObjUnop X).inv.app j = 𝟙 (((CategoryTheory.Functor.const J).obj X).leftOp.obj j)


theorem mul_lt_top : a ≠ ∞ → b ≠ ∞ → a * b < ∞

a ≠ ⊤ → b ≠ ⊤ → a * b < ⊤


lemma pred_one_add (n : ℕ) : pred (1 + n) = n


/-- A seminorm is continuous if `p.closedBall 0 r ∈ 𝓝 0` for *all* `r > 0`.
Over a `NontriviallyNormedField` it is actually enough to check that this is true
for *some* `r`, see `Seminorm.continuous'`. -/
protected theorem continuous_of_forall' [TopologicalSpace E] [TopologicalAddGroup E]
    {p : Seminorm 𝕝 E} (hp : ∀ r > 0, p.closedBall 0 r ∈ (𝓝 0 : Filter E)) :
    Continuous p

{𝕝 : Type u_6}
{E : Type u_7}
[SeminormedRing 𝕝]
[AddCommGroup E]
[Module 𝕝 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
{p : Seminorm 𝕝 E}
(hp : ∀ r > 0, p.closedBall 0 r ∈ 𝓝 0)


@[gcongr] theorem lintegral_mono_fn ⦃f g : α → ℝ≥0∞⦄ (hfg : ∀ x, f x ≤ g x) :
    lintegral μ f ≤ lintegral μ g

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

MeasureTheory.lintegral μ f ≤ MeasureTheory.lintegral μ g


@[simp]
theorem toPerm_symm {f : α → α} (h : Involutive f) : (h.toPerm f).symm = h.toPerm f

{α : Sort u_1}
{f : α → α}
(h : Function.Involutive f)

Equiv.symm (Function.Involutive.toPerm f h) = Function.Involutive.toPerm f h


/-- The hypotheses also imply that `F` is initial, see `initial_of_comp_full_faithful`. -/
theorem initial_of_comp_full_faithful' [Full G] [Faithful G] [Initial (F ⋙ G)] : Initial G

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
(F : CategoryTheory.Functor C D)
(G : CategoryTheory.Functor D E)
[G.Full]
[G.Faithful]
[(F.comp G).Initial]


theorem uIcc_eq_range' :
    uIcc a b = ⟨List.range' (min a b) (max a b + 1 - min a b), List.nodup_range' _ _⟩

Finset.uIcc a b = { val := ↑(List.range' (min a b) (max a b + 1 - min a b)), nodup := ⋯ }


/-- Every Galois connection induces a closure operator given by the composition. This is the partial
order version of the statement that every adjunction induces a monad. -/
@[simps!]
def GaloisConnection.closureOperator [PartialOrder α] [Preorder β] {l : α → β} {u : β → α}
    (gc : GaloisConnection l u) : ClosureOperator α

{α : Type u_1}
{β : Type u_4}
[PartialOrder α]
[Preorder β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)
(x : α)

gc.closureOperator.IsClosed x = (u (l x) = x)


lemma isLower_orderDual [Preorder α] [TopologicalSpace α] : IsLower αᵒᵈ ↔ IsUpper α

{α : Type u_1}
[Preorder α]
[TopologicalSpace α]

Topology.IsLower αᵒᵈ ↔ Topology.IsUpper α


theorem kstar_def (a : ∀ i, π i) : a∗ = fun i ↦ (a i)∗

{ι : Type u_3}
{π : ι → Type u_4}
[(i : ι) → KleeneAlgebra (π i)]
(a : (i : ι) → π i)


theorem infinitePos_iff_infinite_of_nonneg {x : ℝ*} (hp : 0 ≤ x) : InfinitePos x ↔ Infinite x


@[simp] theorem id_val' (X : LocallyRingedSpace.{u}) : Hom.val (𝟙 X) = 𝟙 X.toSheafedSpace


@[simp]
theorem coprodᵢ_eq_bot_iff [∀ i, Nonempty (α i)] : Filter.coprodᵢ f = ⊥ ↔ f = ⊥

{ι : Type u_1}
{α : ι → Type u_2}
{f : (i : ι) → Filter (α i)}
[∀ (i : ι), Nonempty (α i)]


@[to_additive]
theorem mem_closure_inv {G : Type*} [Group G] (S : Set G) (x : G) :
    x ∈ Submonoid.closure S⁻¹ ↔ x⁻¹ ∈ Submonoid.closure S

{G : Type u_6}
[AddGroup G]
(S : Set G)
(x : G)

x ∈ AddSubmonoid.closure (-S) ↔ -x ∈ AddSubmonoid.closure S


/-- The image of the normalizer is contained in the normalizer of the image. -/
@[to_additive "The image of the normalizer is contained in the normalizer of the image."]
theorem le_normalizer_map (f : G →* N) : H.normalizer.map f ≤ (H.map f).normalizer

{G : Type u_1}
[Group G]
{H : Subgroup G}
{N : Type u_5}
[Group N]
(f : G →* N)

Subgroup.map f H.normalizer ≤ (Subgroup.map f H).normalizer


/-- Coercing the result of `Units.instInv` is the same as coercing first and applying the
nonsingular inverse. -/
@[simp, norm_cast]
theorem coe_units_inv (A : (Matrix n n α)ˣ) : ↑A⁻¹ = (A⁻¹ : Matrix n n α)

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
(A : (Matrix n n α)ˣ)

↑A⁻¹ = (↑A)⁻¹


/-- The eigenspace is a subspace of the generalized eigenspace. -/
theorem eigenspace_le_genEigenspace {f : End R M} {μ : R} {k : ℕ} (hk : 0 < k) :
    f.eigenspace μ ≤ f.genEigenspace μ k

{R : Type v}
{M : Type w}
[CommRing R]
[AddCommGroup M]
[Module R M]
{f : Module.End R M}
{μ : R}
{k : ℕ}
(hk : 0 < k)


theorem lt_div_add_one_mul_self (a : Int) {b : Int} (H : 0 < b) : a < (a.div b + 1) * b


lemma even_card_of_isPerfectMatching [DecidableEq V]
    (c : ConnectedComponent G) (hM : M.IsPerfectMatching) :
    Even (Fintype.card c.supp)

{V : Type u_1}
{G : SimpleGraph V}
{M : G.Subgraph}
[Fintype V]
[DecidableRel G.Adj]
[DecidableEq V]
(c : G.ConnectedComponent)
(hM : M.IsPerfectMatching)


@[to_additive]
theorem Multipliable.compl_add {s : Set β} (hs : Multipliable (f ∘ (↑) : (sᶜ : Set β) → α))
    (hsc : Multipliable (f ∘ (↑) : s → α)) : Multipliable f

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β → α}
[ContinuousAdd α]
{s : Set β}
(hs : Summable (f ∘ Subtype.val))
(hsc : Summable (f ∘ Subtype.val))


protected theorem Decidable.not_forall₂ [Decidable (∃ x h, ¬P x h)] [∀ x h, Decidable (P x h)] :
    (¬∀ x h, P x h) ↔ ∃ x h, ¬P x h

[(x : α) → (h : p x) → Decidable (P x h)]

(¬∀ (x : α) (h : p x), P x h) ↔ ∃ x h, ¬P x h


@[simp]
theorem HomogeneousIdeal.homogeneousHull_toIdeal_eq_self (I : HomogeneousIdeal 𝒜) :
    I.toIdeal.homogeneousHull 𝒜 = I

{ι : Type u_1}
{σ : Type u_2}
{A : Type u_4}
[Semiring A]
[DecidableEq ι]
[AddMonoid ι]
[SetLike σ A]
[AddSubmonoidClass σ A]
{𝒜 : ι → σ}
[GradedRing 𝒜]
(I : HomogeneousIdeal 𝒜)


/-- Equivalences (between types in the same universe) are the same as (isomorphic to) isomorphisms
of types. -/
@[simps]
def equivIsoIso {X Y : Type u} : X ≃ Y ≅ X ≅ Y


theorem exists_degree_lt [Fintype σ] (f : MvPolynomial σ R) (n : ℕ)
    (h : f.totalDegree < n * Fintype.card σ) {d : σ →₀ ℕ} (hd : d ∈ f.support) : ∃ i, d i < n

{d : σ →₀ ℕ}


lemma empty_not_mem_diffFinset₀ (hC : IsSetSemiring C) (hs : s ∈ C) (hI : ↑I ⊆ C) :
    ∅ ∉ hC.diffFinset₀ hs hI

{α : Type u_1}
{C : Set (Set α)}
{s : Set α}
{I : Finset (Set α)}
(hC : MeasureTheory.IsSetSemiring C)
(hs : s ∈ C)
(hI : ↑I ⊆ C)


@[simp] lemma card_ulift (α : Type*) : card (ULift α) = card α

PartENat.card (ULift.{u_4, u_3} α) = PartENat.card α


theorem toMeasure_pure : (pure a).toMeasure = Measure.dirac a

{α : Type u_1}
(a : α)
[MeasurableSpace α]

(PMF.pure a).toMeasure = MeasureTheory.Measure.dirac a


theorem LDL.lowerInv_eq_gramSchmidtBasis :
    LDL.lowerInv hS =
      ((Pi.basisFun 𝕜 n).toMatrix
          (@gramSchmidtBasis 𝕜 (n → 𝕜) _ (_ : _) (InnerProductSpace.ofMatrix hS.transpose) n _ _ _
            (Pi.basisFun 𝕜 n)))ᵀ

{𝕜 : Type u_1}
[RCLike 𝕜]
{n : Type u_2}
[LinearOrder n]
[IsWellOrder n fun x x_1 => x < x_1]
[LocallyFiniteOrderBot n]
{S : Matrix n n 𝕜}
[Fintype n]
(hS : S.PosDef)

LDL.lowerInv hS = ((Pi.basisFun 𝕜 n).toMatrix ⇑(gramSchmidtBasis (Pi.basisFun 𝕜 n))).transpose


theorem exp_eq_tsum : exp 𝕂 = fun x : 𝔸 => ∑' n : ℕ, (n !⁻¹ : 𝕂) • x ^ n

{𝕂 : Type u_1}
{𝔸 : Type u_2}
[Field 𝕂]
[Ring 𝔸]
[Algebra 𝕂 𝔸]
[TopologicalSpace 𝔸]
[TopologicalRing 𝔸]

NormedSpace.exp 𝕂 = fun x => ∑' (n : ℕ), (↑n.factorial)⁻¹ • x ^ n


theorem sub_congr_right {x y z : PGame} : (y ≈ z) → (x - y ≈ x - z)


protected theorem subset_of_eq {s t : Finset α} (h : s = t) : s ⊆ t

{α : Type u_1}
{s t : Finset α}
(h : s = t)


@[simp]
theorem ι_comp_lift (f : M →ₗ[R] A) (cond : ∀ m, f m * f m = algebraMap _ _ (Q m)) :
    (lift Q ⟨f, cond⟩).toLinearMap.comp (ι Q) = f

(cond : ∀ (m : M), f m * f m = (algebraMap R A) (Q m))

((CliffordAlgebra.lift Q) ⟨f, cond⟩).toLinearMap ∘ₗ CliffordAlgebra.ι Q = f


theorem t0Space_iff_ker_uniformity : T0Space α ↔ (𝓤 α).ker = diagonal α


theorem MapsTo.coe_iterate_restrict {f : α → α} (h : MapsTo f s s) (x : s) (k : ℕ) :
    h.restrict^[k] x = f^[k] x

{α : Type u_1}
{s : Set α}
{f : α → α}
(h : Set.MapsTo f s s)
(x : ↑s)
(k : ℕ)

↑((Set.MapsTo.restrict f s s h)^[k] x) = f^[k] ↑x


/-- Two finite measures on a Borel space are equal if they agree on all left-infinite right-closed
intervals. -/
theorem ext_of_Iic {α : Type*} [TopologicalSpace α] {m : MeasurableSpace α}
    [SecondCountableTopology α] [LinearOrder α] [OrderTopology α] [BorelSpace α] (μ ν : Measure α)
    [IsFiniteMeasure μ] (h : ∀ a, μ (Iic a) = ν (Iic a)) : μ = ν

(h : ∀ (a : α), μ (Set.Iic a) = ν (Set.Iic a))


theorem setOf_isOpen_sSup {T : Set (TopologicalSpace α)} :
    { s | IsOpen[sSup T] s } = ⋂ t ∈ T, { s | IsOpen[t] s }

{α : Type u}
{T : Set (TopologicalSpace α)}

{s | IsOpen s} = ⋂ t ∈ T, {s | IsOpen s}


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

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

f b * ∏ x ∈ Finset.Ico a b, f x = ∏ x ∈ Finset.Icc a b, f x


theorem disjSum_lt_disjSum_of_le_of_lt (hs : s₁ ≤ s₂) (ht : t₁ < t₂) :
    s₁.disjSum t₁ < s₂.disjSum t₂

{α : Type u_1}
{β : Type u_2}
{s₁ s₂ : Multiset α}
{t₁ t₂ : Multiset β}
(hs : s₁ ≤ s₂)
(ht : t₁ < t₂)


/-- A formula for `MeasureTheory.Measure.mkMetric`. -/
theorem mkMetric_apply (m : ℝ≥0∞ → ℝ≥0∞) (s : Set X) :
    mkMetric m s =
      ⨆ (r : ℝ≥0∞) (_ : 0 < r),
        ⨅ (t : ℕ → Set X) (_ : s ⊆ iUnion t) (_ : ∀ n, diam (t n) ≤ r),
          ∑' n, ⨆ _ : (t n).Nonempty, m (diam (t n))

{X : Type u_2}
[EMetricSpace X]
[MeasurableSpace X]
[BorelSpace X]
(m : ℝ≥0∞ → ℝ≥0∞)
(s : Set X)

(MeasureTheory.Measure.mkMetric m) s =
  ⨆ r,
    ⨆ (_ : 0 < r),
      ⨅ t,
        ⨅ (_ : s ⊆ Set.iUnion t),
          ⨅ (_ : ∀ (n : ℕ), EMetric.diam (t n) ≤ r), ∑' (n : ℕ), ⨆ (_ : (t n).Nonempty), m (EMetric.diam (t n))


@[to_additive]
theorem TendstoUniformlyOn.mul (hf : TendstoUniformlyOn f g l s)
    (hf' : TendstoUniformlyOn f' g' l s) : TendstoUniformlyOn (f * f') (g * g') l s

{α : Type u_1}
{β : Type u_2}
[UniformSpace α]
[Group α]
[UniformGroup α]
{ι : Type u_3}
{l : Filter ι}
{f f' : ι → β → α}
{g g' : β → α}
{s : Set β}
(hf : TendstoUniformlyOn f g l s)
(hf' : TendstoUniformlyOn f' g' l s)


/--
Reindex the indexing type of an effective epi family.
-/
lemma EffectiveEpiFamily.reindex
    {B : C} {α α' : Type*}
    (X : α → C)
    (π : (a : α) → (X a ⟶ B))
    (e : α' ≃ α)
    (h : EffectiveEpiFamily (fun a => X (e a)) (fun a => π (e a))) :
    EffectiveEpiFamily X π

(h : CategoryTheory.EffectiveEpiFamily (fun a => X (e a)) fun a => π (e a))


@[reassoc]
theorem map_π_preserves_coequalizer_inv_colimMap_desc {X' Y' : D} (f' g' : X' ⟶ Y')
    [HasCoequalizer f' g'] (p : G.obj X ⟶ X') (q : G.obj Y ⟶ Y') (wf : G.map f ≫ q = p ≫ f')
    (wg : G.map g ≫ q = p ≫ g') {Z' : D} (h : Y' ⟶ Z') (wh : f' ≫ h = g' ≫ h) :
    G.map (coequalizer.π f g) ≫
        (PreservesCoequalizer.iso G f g).inv ≫
          colimMap (parallelPairHom (G.map f) (G.map g) f' g' p q wf wg) ≫ coequalizer.desc h wh =
      q ≫ h

[CategoryTheory.Limits.HasCoequalizer (G.map f) (G.map g)]

[CategoryTheory.Limits.PreservesColimit (CategoryTheory.Limits.parallelPair f g) G]

G.map (CategoryTheory.Limits.coequalizer.π f g) ≫
    (CategoryTheory.Limits.PreservesCoequalizer.iso G f g).inv ≫
      CategoryTheory.Limits.colimMap (CategoryTheory.Limits.parallelPairHom (G.map f) (G.map g) f' g' p q wf wg) ≫
        CategoryTheory.Limits.coequalizer.desc h wh =
  q ≫ h


theorem eq_comp_δ_of_not_surjective {n : ℕ} {Δ : SimplexCategory} (θ : Δ ⟶ mk (n + 1))
    (hθ : ¬Function.Surjective θ.toOrderHom) :
    ∃ (i : Fin (n + 2)) (θ' : Δ ⟶ mk n), θ = θ' ≫ δ i

(hθ : ¬Function.Surjective ⇑(SimplexCategory.Hom.toOrderHom θ))


theorem segment_symm (x y : E) : [x -[𝕜] y] = [y -[𝕜] x]

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


theorem Nodup.map_on {f : α → β} (H : ∀ x ∈ l, ∀ y ∈ l, f x = f y → x = y) (d : Nodup l) :
    (map f l).Nodup


@[ext]
theorem ext {f g : C_c(α, β)} (h : ∀ x, f x = g x) : f = g

{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[Zero β]
{f g : α →C_c β}
(h : ∀ (x : α), f x = g x)


@[to_additive]
theorem lt_mul_inv_iff_lt : 1 < a * b⁻¹ ↔ b < a

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


theorem covBy_congr_left (hab : AntisymmRel (· ≤ ·) a b) : a ⋖ c ↔ b ⋖ c

(hab : AntisymmRel (fun x x_1 => x ≤ x_1) a b)


lemma polyCharpolyAux_eval_eq_toMatrix_charpoly_coeff (x : L) (i : ℕ) :
    MvPolynomial.eval (b.repr x) ((polyCharpolyAux φ b bₘ).coeff i) =
      (toMatrix bₘ bₘ (φ x)).charpoly.coeff i

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

(MvPolynomial.eval ⇑(b.repr x)) ((φ.polyCharpolyAux b bₘ).coeff i) = ((LinearMap.toMatrix bₘ bₘ) (φ x)).charpoly.coeff i


theorem algebraMap_ofSubsemiring (S : Subsemiring R) :
    (algebraMap S R : S →+* R) = Subsemiring.subtype S

{R : Type u}
[CommSemiring R]
(S : Subsemiring R)


theorem hasDerivWithinAt_of_bilinear
    (hu : HasDerivWithinAt u u' s x) (hv : HasDerivWithinAt v v' s x) :
    HasDerivWithinAt (fun x ↦ B (u x) (v x)) (B (u x) v' + B u' (v x)) s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type w}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{G : Type u_1}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{x : 𝕜}
{s : Set 𝕜}
{B : E →L[𝕜] F →L[𝕜] G}
{u : 𝕜 → E}
{v : 𝕜 → F}
{u' : E}
{v' : F}
(hu : HasDerivWithinAt u u' s x)
(hv : HasDerivWithinAt v v' s x)

HasDerivWithinAt (fun x => (B (u x)) (v x)) ((B (u x)) v' + (B u') (v x)) s x


@[to_additive exists_FS_of_large]
theorem exists_FP_of_large {M} [Semigroup M] (U : Ultrafilter M) (U_idem : U * U = U) (s₀ : Set M)
    (sU : s₀ ∈ U) : ∃ a, FP a ⊆ s₀

{M : Type u_1}
[AddSemigroup M]
(U : Ultrafilter M)
(U_idem : U + U = U)
(s₀ : Set M)
(sU : s₀ ∈ U)


theorem mul_sub (a b c : Ordinal) : a * (b - c) = a * b - a * c


theorem isBoundedUnder_le_finset_sup [LinearOrder β] [OrderBot β] {f : Filter α} {F : ι → α → β}
    {s : Finset ι} (h : ∀ i ∈ s, f.IsBoundedUnder (· ≤ ·) (F i)) :
    f.IsBoundedUnder (· ≤ ·) (fun a ↦ sup s (fun i ↦ F i a))

{F : ι → α → β}

(h : ∀ i ∈ s, Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) f (F i))

Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) f fun a => s.sup fun i => F i a


lemma Fin.addRothNumber_eq_rothNumberNat (hkn : 2 * k ≤ n) :
    addRothNumber (Iio k : Finset (Fin n.succ)) = rothNumberNat k

addRothNumber (Finset.Iio ↑k) = rothNumberNat k


/-- Two equivalence relations are equal iff all their equivalence classes are equal. -/
theorem eq_iff_classes_eq {r₁ r₂ : Setoid α} :
    r₁ = r₂ ↔ ∀ x, { y | r₁.Rel x y } = { y | r₂.Rel x y }

r₁ = r₂ ↔ ∀ (x : α), {y | r₁.Rel x y} = {y | r₂.Rel x y}


theorem ExprCnstr.eq_true_of_isValid (ctx : Context) (c : ExprCnstr) (h : c.toNormPoly.isValid) : c.denote ctx = True

(ctx : Nat.Linear.Context)
(c : Nat.Linear.ExprCnstr)
(h : c.toNormPoly.isValid = true)

Nat.Linear.ExprCnstr.denote ctx c = True


theorem two_le_centralBinom (n : ℕ) (n_pos : 0 < n) : 2 ≤ centralBinom n


@[simp]
theorem inl_bot [LE α] [OrderBot α] [LE β] : toLex (inl ⊥ : α ⊕ β) = ⊥

{α : Type u_1}
{β : Type u_2}
[LE α]
[OrderBot α]
[LE β]


@[simp, norm_cast]
theorem coe_eq_id {f : M₁ →L[R₁] M₁} : (f : M₁ →ₗ[R₁] M₁) = LinearMap.id ↔ f = id _ _

{R₁ : Type u_1}
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
{f : M₁ →L[R₁] M₁}

↑f = LinearMap.id ↔ f = ContinuousLinearMap.id R₁ M₁


theorem ringEquivOfRingEquiv_eq_map {j : R ≃+* P} (H : M.map j.toMonoidHom = T) :
    (ringEquivOfRingEquiv S Q j H : S →+* Q) =
      map Q (j : R →+* P) (M.le_comap_of_map_le (le_of_eq H))

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
{P : Type u_3}
[CommSemiring P]
[IsLocalization M S]
{T : Submonoid P}
{Q : Type u_4}
[CommSemiring Q]
[Algebra P Q]
[IsLocalization T Q]
{j : R ≃+* P}
(H : Submonoid.map j.toMonoidHom M = T)

↑(IsLocalization.ringEquivOfRingEquiv S Q j H) = IsLocalization.map Q ↑j ⋯


theorem conj_comp (e : M ≃ₗ[R] M₂) (f g : Module.End R M) :
    e.conj (g.comp f) = (e.conj g).comp (e.conj f)

{R : Type u_1}
{M : Type u_8}
{M₂ : Type u_10}
[CommSemiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]
(e : M ≃ₗ[R] M₂)
(f g : Module.End R M)


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


theorem map_injective_of_injective : Function.Injective (map f)

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{f : L.Hom M N}
(hf : Function.Injective ⇑f)


/-- The `(m * n)`-th Dickson polynomial of the first kind is the composition of the `m`-th and
`n`-th. -/
theorem dickson_one_one_mul (m n : ℕ) :
    dickson 1 (1 : R) (m * n) = (dickson 1 1 m).comp (dickson 1 1 n)

Polynomial.dickson 1 1 (m * n) = (Polynomial.dickson 1 1 m).comp (Polynomial.dickson 1 1 n)


theorem eq_of_forall_proj_eq [T2Space X] [CompactSpace X] [disc : TotallyDisconnectedSpace X]
    {x y : X} (h : ∀ Q : DiscreteQuotient X, Q.proj x = Q.proj y) : x = y

(h : ∀ (Q : DiscreteQuotient X), Q.proj x = Q.proj y)


/-- The natural inclusion from the functor induced by a sieve to the yoneda embedding. -/
@[simps]
def functorInclusion (S : Sieve X) : S.functor ⟶ yoneda.obj X

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X : C}
(S : CategoryTheory.Sieve X)
(Y : Cᵒᵖ)
(f : S.functor.obj Y)


theorem num_le (I : FractionalIdeal S P) :
    (I.num : FractionalIdeal S P) ≤ I

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


theorem sub_mem_posTangentConeAt_of_segment_subset (h : segment ℝ x y ⊆ s) :
    y - x ∈ posTangentConeAt s x

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{s : Set E}
{x y : E}
(h : [x-[ℝ]y] ⊆ s)


theorem seqTendstoAeSeq_succ (hfg : TendstoInMeasure μ f atTop g) {n : ℕ} :
    seqTendstoAeSeq hfg (n + 1) =
      max (seqTendstoAeSeqAux hfg (n + 1)) (seqTendstoAeSeq hfg n + 1)

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

MeasureTheory.ExistsSeqTendstoAe.seqTendstoAeSeq hfg (n + 1) =
  max (MeasureTheory.ExistsSeqTendstoAe.seqTendstoAeSeqAux hfg (n + 1))
    (MeasureTheory.ExistsSeqTendstoAe.seqTendstoAeSeq hfg n + 1)


/-- If `M` and `N` are linearly disjoint, if `N` is flat, then for any submodule `M'` of `M`,
`M'` and `N` are also linearly disjoint. -/
theorem of_le_left_of_flat (H : M.LinearDisjoint N) {M' : Submodule R S}
    (h : M' ≤ M) [Module.Flat R N] : M'.LinearDisjoint N

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
[Algebra R S]
{M N : Submodule R S}
(H : M.LinearDisjoint N)
{M' : Submodule R S}
(h : M' ≤ M)
[Module.Flat R ↥N]


theorem pi_mono (h : ∀ i ∈ s, t₁ i ⊆ t₂ i) : pi s t₁ ⊆ pi s t₂

{ι : Type u_1}
{α : ι → Type u_2}
{s : Set ι}
{t₁ t₂ : (i : ι) → Set (α i)}
(h : ∀ i ∈ s, t₁ i ⊆ t₂ i)


/-- A measurable set `s` is a *fundamental domain* for an additive action of an additive group `G`
on a measurable space `α` with respect to a measure `α` if the sets `g +ᵥ s`, `g : G`, are pairwise
a.e. disjoint and cover the whole space. -/
structure IsAddFundamentalDomain (G : Type*) {α : Type*} [Zero G] [VAdd G α] [MeasurableSpace α]
    (s : Set α) (μ : Measure α := by volume_tac) : Prop where
  protected nullMeasurableSet : NullMeasurableSet s μ
  protected ae_covers : ∀ᵐ x ∂μ, ∃ g : G, g +ᵥ x ∈ s
  protected aedisjoint : Pairwise <| (AEDisjoint μ on fun g : G => g +ᵥ s)

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

(self : MeasureTheory.IsAddFundamentalDomain G s μ)


theorem MapsTo.mono (hf : MapsTo f s₁ t₁) (hs : s₂ ⊆ s₁) (ht : t₁ ⊆ t₂) : MapsTo f s₂ t₂

{α : Type u_1}
{β : Type u_2}
{s₁ s₂ : Set α}
{t₁ t₂ : Set β}
{f : α → β}
(hf : Set.MapsTo f s₁ t₁)
(hs : s₂ ⊆ s₁)
(ht : t₁ ⊆ t₂)


@[to_additive]
theorem NeBot.of_div_left : (f / g).NeBot → f.NeBot


/-- We say that `P : AffineTargetMorphismProperty` is a local property if
1. `P` respects isomorphisms.
2. If `P` holds for `f : X ⟶ Y`, then `P` holds for `f ∣_ Y.basicOpen r` for any
  global section `r`.
3. If `P` holds for `f ∣_ Y.basicOpen r` for all `r` in a spanning set of the global sections,
  then `P` holds for `f`.
-/
class IsLocal (P : AffineTargetMorphismProperty) : Prop where
  /-- `P` as a morphism property respects isomorphisms -/
  respectsIso : P.toProperty.RespectsIso
  /-- `P` is stable under restriction to basic open set of global sections. -/
  to_basicOpen :
    ∀ {X Y : Scheme} [IsAffine Y] (f : X ⟶ Y) (r : Γ(Y, ⊤)), P f → P (f ∣_ Y.basicOpen r)
  /-- `P` for `f` if `P` holds for `f` restricted to basic sets of a spanning set of the global
    sections -/
  of_basicOpenCover :
    ∀ {X Y : Scheme} [IsAffine Y] (f : X ⟶ Y) (s : Finset Γ(Y, ⊤))
      (_ : Ideal.span (s : Set Γ(Y, ⊤)) = ⊤), (∀ r : s, P (f ∣_ Y.basicOpen r.1)) → P f


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


/-- If an element in a group has order two, then it is its own inverse. -/
@[to_additive]
lemma inv_eq_self_of_orderOf_eq_two {x : G} (hx : orderOf x = 2) :
    x⁻¹ = x

{G : Type u}
[AddGroup G]
{x : G}
(hx : addOrderOf x = 2)


@[simp]
theorem map_natCast (n : ℕ) : D (n : A) = 0

{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)
(n : ℕ)


@[to_additive add_const]
theorem StrictMonoOn.mul_const' (hf : StrictMonoOn f s) (c : α) :
    StrictMonoOn (fun x => f x * c) s

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


theorem quasiCompact_over_affine_iff {X Y : Scheme} (f : X ⟶ Y) [IsAffine Y] :
    QuasiCompact f ↔ CompactSpace X

{X Y : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)
[AlgebraicGeometry.IsAffine Y]

AlgebraicGeometry.QuasiCompact f ↔ CompactSpace ↑↑X.toPresheafedSpace


@[simp]
theorem cos_toReal (θ : Angle) : Real.cos θ.toReal = cos θ


/-- `R[X]` is never a field for any ring `R`. -/
theorem polynomial_not_isField : ¬IsField R[X]


/-- Prop-valued mixin for a monoid with zero to be equipped with a cancelling division.

The obvious use case is groups with zero, but this condition is also satisfied by `ℕ`, `ℤ` and, more
generally, any euclidean domain. -/
class MulDivCancelClass (M₀ : Type*) [MonoidWithZero M₀] [Div M₀] : Prop where
  protected mul_div_cancel (a b : M₀) : b ≠ 0 → a * b / b = a

{M₀ : Type u_4}
[MonoidWithZero M₀]
[Div M₀]
[self : MulDivCancelClass M₀]
(a b : M₀)


@[simp]
theorem toFinset_image [DecidableEq β] (f : α → β) (s : Set α) [Fintype s] [Fintype (f '' s)] :
    (f '' s).toFinset = s.toFinset.image f

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
(f : α → β)
(s : Set α)
[Fintype ↑s]
[Fintype ↑(f '' s)]

(f '' s).toFinset = Finset.image f s.toFinset


theorem Exists.elim {α : Sort u} {p : α → Prop} {b : Prop}
   (h₁ : Exists (fun x => p x)) (h₂ : ∀ (a : α), p a → b) : b

{α : Sort u}
{p : α → Prop}
{b : Prop}
(h₁ : Exists fun x => p x)
(h₂ : ∀ (a : α), p a → b)


theorem antitone_iff_map_nonneg : Antitone (f : α → β) ↔ ∀ a ≤ 0, 0 ≤ f a

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedAddCommGroup α]
[OrderedAddCommMonoid β]
[i : FunLike F α β]
(f : F)
[iamhc : AddMonoidHomClass F α β]

Antitone ⇑f ↔ ∀ (a : α), a ≤ 0 → 0 ≤ f a


/-- The sequence `B ⊗[A] Ω[A⁄R] → Ω[B⁄R] → Ω[B⁄A] → 0` is exact.
Also see `KaehlerDifferential.map_surjective`. -/
lemma KaehlerDifferential.exact_mapBaseChange_map :
    Function.Exact (mapBaseChange R A B) (map R A B B)

(R : Type u)
[CommRing R]
(A : Type u_2)
(B : Type u_3)
[CommRing A]
[CommRing B]
[Algebra R A]
[Algebra R B]
[Algebra A B]
[IsScalarTower R A B]

Function.Exact ⇑(KaehlerDifferential.mapBaseChange R A B) ⇑(KaehlerDifferential.map R A B B)


theorem transHomeomorph_eq_trans (e : PartialHomeomorph X Y) (f' : Y ≃ₜ Z) :
    e.transHomeomorph f' = e.trans f'.toPartialHomeomorph

{X : Type u_1}
{Y : Type u_3}
{Z : Type u_5}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(e : PartialHomeomorph X Y)
(f' : Y ≃ₜ Z)


nonrec theorem IsLocalMax.max (hf : IsLocalMax f a) (hg : IsLocalMax g a) :
    IsLocalMax (fun x => max (f x) (g x)) a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[LinearOrder β]
{f g : α → β}
{a : α}
(hf : IsLocalMax f a)
(hg : IsLocalMax g a)


theorem algebraMap_adicCompletion' :
    ⇑(algebraMap R <| v.adicCompletion K) = (↑) ∘ algebraMap R K

(v : IsDedekindDomain.HeightOneSpectrum R)

⇑(algebraMap R (IsDedekindDomain.HeightOneSpectrum.adicCompletion K v)) = ↑K ∘ ⇑(algebraMap R K)


/-- `Finset.cons` version of `Finset.Ioi_insert`. -/
theorem Ici_eq_cons_Ioi (a : α) : Ici a = (Ioi a).cons a not_mem_Ioi_self

{α : Type u_2}
[PartialOrder α]
[LocallyFiniteOrderTop α]
(a : α)

Finset.Ici a = Finset.cons a (Finset.Ioi a) ⋯


/-- Subsets of meagre sets are meagre. -/
lemma IsMeagre.mono {s t : Set X} (hs : IsMeagre s) (hts : t ⊆ s) : IsMeagre t

{X : Type u_5}
[TopologicalSpace X]
{s t : Set X}
(hs : IsMeagre s)
(hts : t ⊆ s)


theorem toSubsemiring_injective :
    Function.Injective (toSubsemiring : Subalgebra R A → Subsemiring A)

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


theorem localization_away_openEmbedding (S : Type v) [CommSemiring S] [Algebra R S] (r : R)
    [IsLocalization.Away r S] : OpenEmbedding (comap (algebraMap R S))

{R : Type u}
[CommSemiring R]
(S : Type v)
[CommSemiring S]
[Algebra R S]
(r : R)
[IsLocalization.Away r S]

OpenEmbedding ⇑(PrimeSpectrum.comap (algebraMap R S))


theorem Nodup.erase [DecidableEq α] (a : α) {l} : Nodup l → Nodup (l.erase a)

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


@[to_additive]
theorem prod_option_index [AddCommMonoid M] [CommMonoid N] (f : Option α →₀ M)
    (b : Option α → M → N) (h_zero : ∀ o, b o 0 = 1)
    (h_add : ∀ o m₁ m₂, b o (m₁ + m₂) = b o m₁ * b o m₂) :
    f.prod b = b none (f none) * f.some.prod fun a => b (Option.some a)

(h_add : ∀ (o : Option α) (m₁ m₂ : M), b o (m₁ + m₂) = b o m₁ * b o m₂)

f.prod b = b none (f none) * f.some.prod fun a => b (some a)


/-- On objects, the functor which sends a formal direct factor `P` of a
functor `F : J ⥤ C` to the functor `J ⥤ Karoubi C` which sends `(j : J)` to
the corresponding direct factor of `F.obj j`. -/
@[simps]
def obj (P : Karoubi (J ⥤ C)) : J ⥤ Karoubi C

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

((CategoryTheory.Idempotents.KaroubiFunctorCategoryEmbedding.obj P).map φ).f = P.p.app j ≫ P.X.map φ


theorem eventuallyLE_antisymm_iff [PartialOrder β] {l : Filter α} {f g : α → β} :
    f =ᶠ[l] g ↔ f ≤ᶠ[l] g ∧ g ≤ᶠ[l] f

{α : Type u}
{β : Type v}
[PartialOrder β]
{l : Filter α}
{f g : α → β}


theorem perm_comm {l₁ l₂ : List α} : l₁ ~ l₂ ↔ l₂ ~ l₁


theorem set_biInter_singleton (a : α) (s : α → Set β) : ⋂ x ∈ ({a} : Finset α), s x = s a

{α : Type u_2}
{β : Type u_3}
(a : α)
(s : α → Set β)


theorem ContDiffOn.snd {f : E → F × G} {s : Set E} (hf : ContDiffOn 𝕜 n f s) :
    ContDiffOn 𝕜 n (fun x => (f x).2) s

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


theorem fg_trans (h1 : (adjoin R s).toSubmodule.FG) (h2 : (adjoin (adjoin R s) t).toSubmodule.FG) :
    (adjoin R (s ∪ t)).toSubmodule.FG

(h1 : (Subalgebra.toSubmodule (Algebra.adjoin R s)).FG)

(h2 : (Subalgebra.toSubmodule (Algebra.adjoin (↥(Algebra.adjoin R s)) t)).FG)

(Subalgebra.toSubmodule (Algebra.adjoin R (s ∪ t))).FG


lemma sum_int_mod (l : List ℤ) (n : ℤ) : l.sum % n = (l.map (· % n)).sum % n

l.sum % n = (List.map (fun x => x % n) l).sum % n


/-- Given a collinear set of points, and two distinct points `p₂` and `p₃` in it, a point `p₁` is
collinear with the set if and only if it is collinear with `p₂` and `p₃`. -/
theorem Collinear.collinear_insert_iff_of_ne {s : Set P} (h : Collinear k s) {p₁ p₂ p₃ : P}
    (hp₂ : p₂ ∈ s) (hp₃ : p₃ ∈ s) (hp₂p₃ : p₂ ≠ p₃) :
    Collinear k (insert p₁ s) ↔ Collinear k ({p₁, p₂, p₃} : Set P)

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s : Set P}
(h : Collinear k s)
{p₁ p₂ p₃ : P}
(hp₂ : p₂ ∈ s)
(hp₃ : p₃ ∈ s)
(hp₂p₃ : p₂ ≠ p₃)

Collinear k (insert p₁ s) ↔ Collinear k {p₁, p₂, p₃}


/-- If `μ` is a primitive `n`th root of unity in `R`, then `∏(1≤k<n) (1-μ^k) = n`.
(Stated with `n+1` in place of `n` to avoid the condition `n ≠ 0`.) -/
lemma prod_one_sub_pow_eq_order {n : ℕ} {μ : R} (hμ : IsPrimitiveRoot μ (n + 1)) :
    ∏ k ∈ range n, (1 - μ ^ (k + 1)) = n + 1

{R : Type u_1}
[CommRing R]
[IsDomain R]
{n : ℕ}
{μ : R}
(hμ : IsPrimitiveRoot μ (n + 1))

∏ k ∈ Finset.range n, (1 - μ ^ (k + 1)) = ↑n + 1


theorem Ideal.IsHomogeneous.radical {I : Ideal A} (h : I.IsHomogeneous 𝒜) :
    I.radical.IsHomogeneous 𝒜

{ι : Type u_1}
{σ : Type u_2}
{A : Type u_3}
[CommRing A]
[LinearOrderedCancelAddCommMonoid ι]
[SetLike σ A]
[AddSubmonoidClass σ A]
{𝒜 : ι → σ}
[GradedRing 𝒜]
{I : Ideal A}
(h : Ideal.IsHomogeneous 𝒜 I)


@[simp]
lemma mk_app (X : Dᵒᵖ) : (mk d d_map).app X = d X

{M : PresheafOfModules (R ⋙ CategoryTheory.forget₂ CommRingCat RingCat)}

(d : (X : Dᵒᵖ) → (M.obj X).Derivation (φ'.app X))

(d_map : ∀ ⦃X Y : Dᵒᵖ⦄ (f : X ⟶ Y) (x : ↑(R.obj X)), (d Y).d ((R.map f) x) = (M.map f) ((d X).d x))

(PresheafOfModules.Derivation'.mk d d_map).app X = d X


theorem lift_apply' (F : G →* A) (f : MonoidAlgebra k G) :
    lift k G A F f = f.sum fun a b => algebraMap k A b * F a

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

((MonoidAlgebra.lift k G A) F) f = Finsupp.sum f fun a b => (algebraMap k A) b * F a


theorem nonempty_of_not_uniform (h : ¬P.IsUniform G ε) : P.parts.Nonempty

{α : Type u_1}
{𝕜 : Type u_2}
[LinearOrderedField 𝕜]
[DecidableEq α]
{A : Finset α}
{P : Finpartition A}
{G : SimpleGraph α}
[DecidableRel G.Adj]
{ε : 𝕜}
(h : ¬P.IsUniform G ε)


/-- The nonsingular inverse is the same as `invOf` when `A` is invertible. -/
@[simp]
theorem invOf_eq_nonsing_inv [Invertible A] : ⅟ A = A⁻¹

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
(A : Matrix n n α)
[Invertible A]


@[to_additive (attr := fun_prop, measurability)]
theorem Measurable.inv (hf : Measurable f) : Measurable fun x => (f x)⁻¹

{G : Type u_2}
{α : Type u_3}
[Inv G]
[MeasurableSpace G]
[MeasurableInv G]
{m : MeasurableSpace α}
{f : α → G}
(hf : Measurable f)


/-- Converts a `LinearEquiv` to an isomorphism in the category `FGModuleCat R`. -/
@[simps]
def _root_.LinearEquiv.toFGModuleCatIso
    {V W : Type u} [AddCommGroup V] [Module R V] [Module.Finite R V]
    [AddCommGroup W] [Module R W] [Module.Finite R W] (e : V ≃ₗ[R] W) :
    FGModuleCat.of R V ≅ FGModuleCat.of R W

{R : Type u}
[Ring R]
{V W : Type u}
[AddCommGroup V]
[Module R V]
[Module.Finite R V]
[AddCommGroup W]
[Module R W]
[Module.Finite R W]
(e : V ≃ₗ[R] W)


theorem monotone_preCDF (ρ : Measure (α × ℝ)) [IsFiniteMeasure ρ] :
    ∀ᵐ a ∂ρ.fst, Monotone fun r ↦ preCDF ρ r a

{α : Type u_1}
{mα : MeasurableSpace α}
(ρ : MeasureTheory.Measure (α × ℝ))
[MeasureTheory.IsFiniteMeasure ρ]

∀ᵐ (a : α) ∂ρ.fst, Monotone fun r => ProbabilityTheory.preCDF ρ r a


theorem frontier_inter_open_inter {s t : Set α} (ht : IsOpen t) :
    frontier (s ∩ t) ∩ t = frontier s ∩ t

{α : Type u_1}
[TopologicalSpace α]
{s t : Set α}
(ht : IsOpen t)


theorem toSubsemigroup_injective :
    Function.Injective (toSubsemigroup : NonUnitalSubring R → Subsemigroup R)


theorem rank_comp_le_right (g : V →ₗ[K] V') (f : V' →ₗ[K] V'₁) : rank (f.comp g) ≤ rank g

{K : Type u}
{V : Type v}
{V' V'₁ : Type v'}
[Ring K]
[AddCommGroup V]
[Module K V]
[AddCommGroup V']
[Module K V']
[AddCommGroup V'₁]
[Module K V'₁]
(g : V →ₗ[K] V')
(f : V' →ₗ[K] V'₁)


@[simp]
theorem coe_zero [Zero β] : ⇑(0 : C₀(α, β)) = 0

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
[Zero β]


theorem eq_preimage (f : r ↪r s) : r = f ⁻¹'o s

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


theorem binaryCofan_inr {A B : C} [MonoCoprod C] (c : BinaryCofan A B) (hc : IsColimit c) :
    Mono c.inr

(c : CategoryTheory.Limits.BinaryCofan A B)

(hc : CategoryTheory.Limits.IsColimit c)


theorem acc_iff_cluster (x : X) (F : Filter X) : AccPt x F ↔ ClusterPt x (𝓟 {x}ᶜ ⊓ F)

{X : Type u}
[TopologicalSpace X]
(x : X)
(F : Filter X)


@[simp, norm_cast]
lemma coe_indicator (s : Set α) (f : α → ℚ≥0) (a : α) :
    ((s.indicator f a : ℚ≥0) : ℚ) = s.indicator (fun x ↦ ↑(f x)) a

{α : Type u_1}
(s : Set α)
(f : α → ℚ≥0)
(a : α)

↑(s.indicator f a) = s.indicator (fun x => ↑(f x)) a


@[simp]
theorem continuousMultilinearCurryFin0_apply (f : G[×0]→L[𝕜] G') :
    continuousMultilinearCurryFin0 𝕜 G G' f = f 0

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

(continuousMultilinearCurryFin0 𝕜 G G') f = f 0


@[simp]
theorem coeff_mul_C (n : ℕ) (φ : R⟦X⟧) (a : R) : coeff R n (φ * C R a) = coeff R n φ * a

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

(PowerSeries.coeff R n) (φ * (PowerSeries.C R) a) = (PowerSeries.coeff R n) φ * a


theorem toNNReal_eq_one_iff (x : ℝ≥0∞) : x.toNNReal = 1 ↔ x = 1


theorem equivProdDFinsupp_add [∀ i, AddZeroClass (α i)] (f g : Π₀ i, α i) :
    equivProdDFinsupp (f + g) = equivProdDFinsupp f + equivProdDFinsupp g

{ι : Type u}
{α : Option ι → Type v}
[(i : Option ι) → AddZeroClass (α i)]
(f g : Π₀ (i : Option ι), α i)

DFinsupp.equivProdDFinsupp (f + g) = DFinsupp.equivProdDFinsupp f + DFinsupp.equivProdDFinsupp g


@[to_additive]
theorem tprod_eq_one_of_not_multipliable (h : ¬Multipliable f) : ∏' b, f b = 1

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β → α}
(h : ¬Summable f)


@[to_additive]
lemma Commute.div_eq_div_iff_of_isUnit (hbd : Commute b d) (hb : IsUnit b) (hd : IsUnit d) :
    a / b = c / d ↔ a * d = c * b

{M : Type u_1}
[DivisionMonoid M]
{a b c d : M}
(hbd : Commute b d)
(hb : IsUnit b)
(hd : IsUnit d)


protected theorem lt_add_of_tsub_lt_right (hc : AddLECancellable c) (h : a - c < b) :
    a < b + c

{α : Type u_1}
[PartialOrder α]
[AddCommSemigroup α]
[Sub α]
[OrderedSub α]
{a b c : α}
(hc : AddLECancellable c)
(h : a - c < b)


/-- When `α` is compact, the bounded continuous maps `α →ᵇ β` are
equivalent to `C(α, β)`.
-/
@[simps (config := .asFn)]
def equivBoundedOfCompact : C(α, β) ≃ (α →ᵇ β)

(α : Type u_1)
(β : Type u_2)
[TopologicalSpace α]
[CompactSpace α]
[MetricSpace β]

⇑(ContinuousMap.equivBoundedOfCompact α β) = BoundedContinuousFunction.mkOfCompact


/-- A subset of `L ≃ₐ[K] L` is a member of `galBasis K L` if and only if it is the underlying set
of `Gal(L/E)` for some finite subextension `E/K`-/
theorem mem_galBasis_iff (K L : Type*) [Field K] [Field L] [Algebra K L] (U : Set (L ≃ₐ[K] L)) :
    U ∈ galBasis K L ↔ U ∈ (fun g => g.carrier) '' fixedByFinite K L

(K : Type u_1)
(L : Type u_2)
[Field K]
[Field L]
[Algebra K L]
(U : Set (L ≃ₐ[K] L))


/-- Two linear isometric equivalences are equal if they are equal on basis vectors. -/
theorem Basis.ext_linearIsometryEquiv {ι : Type*} (b : Basis ι R E) {f₁ f₂ : E ≃ₛₗᵢ[σ₁₂] E₂}
    (h : ∀ i, f₁ (b i) = f₂ (b i)) : f₁ = f₂

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
{ι : Type u_11}
(b : Basis ι R E)
{f₁ f₂ : E ≃ₛₗᵢ[σ₁₂] E₂}
(h : ∀ (i : ι), f₁ (b i) = f₂ (b i))


@[simp]
theorem map_toDeleteEdges_eq (s : Set (Sym2 V)) {p : G.Walk v w} (hp) :
    Walk.map (Hom.mapSpanningSubgraphs (G.deleteEdges_le s)) (p.toDeleteEdges s hp) = p

{V : Type u}
{G : SimpleGraph V}
{v w : V}
(s : Set (Sym2 V))
{p : G.Walk v w}
(hp : ∀ e ∈ p.edges, e ∉ s)

SimpleGraph.Walk.map (SimpleGraph.Hom.mapSpanningSubgraphs ⋯) (SimpleGraph.Walk.toDeleteEdges s p hp) = p


@[simp]
theorem sum_app_inr {F G : A ⥤ B} {H I : C ⥤ D} (α : F ⟶ G) (β : H ⟶ I) (c : C) :
    (sum α β).app (inr c) = β.app c

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₁}
[CategoryTheory.Category.{v₁, u₁} B]
{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₁}
[CategoryTheory.Category.{v₁, u₁} D]
{F G : CategoryTheory.Functor A B}
{H I : CategoryTheory.Functor C D}
(α : F ⟶ G)
(β : H ⟶ I)
(c : C)

(CategoryTheory.NatTrans.sum α β).app (Sum.inr c) = β.app c


theorem le_prod_map_fst_snd {f : Filter (α × β)} : f ≤ map Prod.fst f ×ˢ map Prod.snd f

{α : Type u_1}
{β : Type u_2}
{f : Filter (α × β)}

f ≤ Filter.map Prod.fst f ×ˢ Filter.map Prod.snd f


protected theorem bijective : Function.Bijective e

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


theorem Intersecting.exists_mem_finset [DecidableEq α] {𝒜 : Set (Finset α)} (h𝒜 : 𝒜.Intersecting)
    {s t : Finset α} (hs : s ∈ 𝒜) (ht : t ∈ 𝒜) : ∃ a, a ∈ s ∧ a ∈ t

{α : Type u_1}
[DecidableEq α]
{𝒜 : Set (Finset α)}
(h𝒜 : 𝒜.Intersecting)
{s t : Finset α}
(hs : s ∈ 𝒜)
(ht : t ∈ 𝒜)


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

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

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


theorem insert_subset (ha : a ∈ t) (hs : s ⊆ t) : insert a s ⊆ t

{α : Type u}
{a : α}
{s t : Set α}
(ha : a ∈ t)
(hs : s ⊆ t)


@[to_additive]
theorem tendsto_inv_nhdsWithin_Iic {a : H} : Tendsto Inv.inv (𝓝[≤] a) (𝓝[≥] a⁻¹)

{H : Type x}
[TopologicalSpace H]
[OrderedCommGroup H]
[ContinuousInv H]
{a : H}

Filter.Tendsto Inv.inv (𝓝[≤] a) (𝓝[≥] a⁻¹)


theorem continuousOn_mul [LocallyCompactSpace X] [T2Space X] [NormedRing R]
    [SecondCountableTopologyEither X R] {f g : X → R} {s : Set X} (hf : LocallyIntegrableOn f s μ)
    (hg : ContinuousOn g s) (hs : IsOpen s) : LocallyIntegrableOn (fun x => g x * f x) s μ

(hf : MeasureTheory.LocallyIntegrableOn f s μ)

MeasureTheory.LocallyIntegrableOn (fun x => g x * f x) s μ


theorem nat_add : Primrec₂ ((· + ·) : ℕ → ℕ → ℕ)


@[simp]
theorem zsmul_f_apply (n : ℤ) (f : C ⟶ D) (i : ι) : (n • f).f i = n • f.f i

{ι : Type u_1}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{c : ComplexShape ι}
{C D : HomologicalComplex V c}
(n : ℤ)
(f : C ⟶ D)
(i : ι)


@[gcongr]
theorem iInter_mono'' {s t : ι → Set α} (h : ∀ i, s i ⊆ t i) : iInter s ⊆ iInter t

{α : Type u_1}
{ι : Sort u_4}
{s t : ι → Set α}
(h : ∀ (i : ι), s i ⊆ t i)


@[simp]
theorem ofAdd_neg [Neg α] (x : α) : ofAdd (-x) = (ofAdd x)⁻¹

Multiplicative.ofAdd (-x) = (Multiplicative.ofAdd x)⁻¹


lemma shortExact_of_iso (e : S₁ ≅ S₂) (h : S₁.ShortExact) : S₂.ShortExact


/-- On an orthogonal basis, the basis representation of `Q` is just a sum of squares. -/
theorem basisRepr_eq_of_iIsOrtho {R M} [CommRing R] [AddCommGroup M] [Module R M]
    [Invertible (2 : R)] (Q : QuadraticMap R M R) (v : Basis ι R M)
    (hv₂ : (associated (R := R) Q).IsOrthoᵢ v) :
    Q.basisRepr v = weightedSumSquares _ fun i => Q (v i)

(hv₂ : LinearMap.IsOrthoᵢ (QuadraticMap.associated Q) ⇑v)

Q.basisRepr v = QuadraticMap.weightedSumSquares R fun i => Q (v i)


protected theorem coe_eq_zero {x : S} : (x : A) = 0 ↔ x = 0

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


lemma eval_image_piFinset (t : ∀ a, Finset (δ a)) (a : α) [DecidableEq (δ a)]
    (ht : ∀ b, a ≠ b → (t b).Nonempty) : ((piFinset t).image fun f ↦ f a) = t a

(ht : ∀ (b : α), a ≠ b → (t b).Nonempty)

Finset.image (fun f => f a) (Fintype.piFinset t) = t a


@[simp]
theorem exp_ofReal_im (x : ℝ) : (exp x).im = 0


/-- Given a hom orthogonal family `s : ι → C`
for which each `End (s i)` is a ring with invariant basis number (e.g. if each `s i` is simple),
if two direct sums over `s` are isomorphic, then they have the same multiplicities.
-/
theorem equiv_of_iso (o : HomOrthogonal s) {α β : Type} [Finite α] [Finite β] {f : α → ι}
    {g : β → ι} (i : (⨁ fun a => s (f a)) ≅ ⨁ fun b => s (g b)) :
    ∃ e : α ≃ β, ∀ a, g (e a) = f a

[∀ (i : ι), InvariantBasisNumber (CategoryTheory.End (s i))]


@[simp, fun_prop]
theorem Differentiable.sub (hf : Differentiable 𝕜 f) (hg : Differentiable 𝕜 g) :
    Differentiable 𝕜 fun y => f y - g y

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : E → F}
(hf : Differentiable 𝕜 f)
(hg : Differentiable 𝕜 g)


theorem frequently_smallSets_mem (l : Filter α) : ∃ᶠ s in l.smallSets, s ∈ l


/--
A morphism `f : Y ⟶ X` is an effective epimorphism provided that `f` exhibits `X` as a colimit
of the diagram of all "relations" `R ⇉ Y`.
If `f` has a kernel pair, then this is equivalent to showing that the corresponding cofork is
a colimit.
-/
class EffectiveEpi {X Y : C} (f : Y ⟶ X) : Prop where
  /-- `f` is an effective epimorphism if there exists an `EffectiveEpiStruct` for `f`. -/
  effectiveEpi : Nonempty (EffectiveEpiStruct f)

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{X Y : C}
{f : Y ⟶ X}
[self : CategoryTheory.EffectiveEpi f]


@[simp]
theorem IsField.nontrivial {R : Type u} [Semiring R] (h : IsField R) : Nontrivial R


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

{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedCommGroupWithZero Γ₀]
(v : Valuation R Γ₀)
{x y : R}
(h : v y < v x)


theorem mul_eq_one_comm : A * B = 1 ↔ B * A = 1

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
{A B : Matrix n n α}


theorem card_eq_of_bijective (f : ∀ i, i < n → α) (hf : ∀ a ∈ s, ∃ i, ∃ h : i < n, f i h = a)
    (hf' : ∀ i (h : i < n), f i h ∈ s)
    (f_inj : ∀ i j (hi : i < n) (hj : j < n), f i hi = f j hj → i = j) : s.card = n

(hf : ∀ a ∈ s, ∃ i, ∃ (h : i < n), f i h = a)

(hf' : ∀ (i : ℕ) (h : i < n), f i h ∈ s)

(f_inj : ∀ (i j : ℕ) (hi : i < n) (hj : j < n), f i hi = f j hj → i = j)


theorem of_horiz_isIso [IsIso f] [IsIso inr] (sq : CommSq f g inl inr) : IsPushout f g inl inr

(sq : CategoryTheory.CommSq f g inl inr)


@[simp]
theorem coe_copy (f : CoheytingHom α β) (f' : α → β) (h : f' = f) : ⇑(f.copy f' h) = f'

{α : Type u_2}
{β : Type u_3}
[CoheytingAlgebra α]
[CoheytingAlgebra β]
(f : CoheytingHom α β)
(f' : α → β)
(h : f' = ⇑f)


@[simp]
theorem DifferentiableAt.cosh (hc : DifferentiableAt ℝ f x) :
    DifferentiableAt ℝ (fun x => Real.cosh (f x)) x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{x : E}
(hc : DifferentiableAt ℝ f x)


@[to_additive]
theorem Function.Injective.hasProd_iff {g : γ → β} (hg : Injective g)
    (hf : ∀ x, x ∉ Set.range g → f x = 1) : HasProd (f ∘ g) a ↔ HasProd f a

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β → α}
{a : α}
{g : γ → β}
(hg : Function.Injective g)
(hf : ∀ x ∉ Set.range g, f x = 0)


@[simp, norm_cast]
theorem toAddMonoidHom_id : (CentroidHom.id α : α →+ α) = AddMonoidHom.id α

(α : Type u_5)
[NonUnitalNonAssocSemiring α]


@[simp]
theorem ContinuousLinearMap.uncurryLeft_apply
    (f : Ei 0 →L[𝕜] ContinuousMultilinearMap 𝕜 (fun i : Fin n => Ei i.succ) G) (m : ∀ i, Ei i) :
    f.uncurryLeft m = f (m 0) (tail m)

[(i : Fin n.succ) → NormedAddCommGroup (Ei i)]

[(i : Fin n.succ) → NormedSpace 𝕜 (Ei i)]

(f : Ei 0 →L[𝕜] ContinuousMultilinearMap 𝕜 (fun i => Ei i.succ) G)

f.uncurryLeft m = (f (m 0)) (Fin.tail m)


theorem natAbs_sign_of_nonzero {z : Int} (hz : z ≠ 0) : z.sign.natAbs = 1


theorem setToSimpleFunc_smul_left' (T T' : Set α → E →L[ℝ] F') (c : ℝ)
    (h_smul : ∀ s, MeasurableSet s → μ s < ∞ → T' s = c • T s) {f : α →ₛ E} (hf : Integrable f μ) :
    setToSimpleFunc T' f = c • setToSimpleFunc T f

(h_smul : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → T' s = c • T s)

MeasureTheory.SimpleFunc.setToSimpleFunc T' f = c • MeasureTheory.SimpleFunc.setToSimpleFunc T f


theorem Module.injective_object_of_injective_module [inj : Module.Injective R Q] :
    CategoryTheory.Injective (ModuleCat.of R Q)

(R : Type u)
[Ring R]
(Q : Type v)
[AddCommGroup Q]
[Module R Q]
[inj : Module.Injective R Q]


theorem lookmap_id' (h : ∀ (a), ∀ b ∈ f a, a = b) (l : List α) : l.lookmap f = l

{α : Type u}
(f : α → Option α)
(h : ∀ (a b : α), b ∈ f a → a = b)
(l : List α)


@[to_additive]
theorem inv_toFun_mul_mem (hS : S ∈ Subgroup.leftTransversals (H : Set G)) (g : G) :
    (toFun hS g : G)⁻¹ * g ∈ H

{G : Type u_1}
[Group G]
{H : Subgroup G}
{S : Set G}
(hS : S ∈ Subgroup.leftTransversals ↑H)
(g : G)

(↑(Subgroup.MemLeftTransversals.toFun hS g))⁻¹ * g ∈ H


lemma cfc_congr {f g : R → R} {a : A} (hfg : (spectrum R a).EqOn f g) :
    cfc f a = cfc g a

{R : Type u_1}
{A : Type u_2}
{p : A → Prop}
[CommSemiring R]
[StarRing R]
[MetricSpace R]
[TopologicalSemiring R]
[ContinuousStar R]
[TopologicalSpace A]
[Ring A]
[StarRing A]
[Algebra R A]
[ContinuousFunctionalCalculus R p]
{f g : R → R}
{a : A}
(hfg : Set.EqOn f g (spectrum R a))


/-- For a functor `F : C ⥤ D` and an object `d : D`, we obtain a contravariant functor from the
category of costructured arrows `F.op.obj c ⟶ op d` to the category of structured arrows
`d ⟶ F.obj c`.
-/
@[simps]
def toStructuredArrow' (F : C ⥤ D) (d : D) :
    (CostructuredArrow F.op (op d))ᵒᵖ ⥤ StructuredArrow d F

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

∀ {X Y : (CategoryTheory.CostructuredArrow F.op (Opposite.op d))ᵒᵖ} (f : X ⟶ Y),
  (CategoryTheory.CostructuredArrow.toStructuredArrow' F d).map f =
    CategoryTheory.StructuredArrow.homMk f.unop.left.unop ⋯


theorem rfindOpt {n} {f : Vector ℕ (n + 1) → ℕ} (hf : @Partrec' (n + 1) f) :
    @Partrec' n fun v => Nat.rfindOpt fun a => ofNat (Option ℕ) (f (a ::ᵥ v))

{n : ℕ}
{f : Mathlib.Vector ℕ (n + 1) → ℕ}
(hf : Nat.Partrec' ↑f)

Nat.Partrec' fun v => Nat.rfindOpt fun a => Denumerable.ofNat (Option ℕ) (f (a ::ᵥ v))


@[simp]
theorem orderIsoSumLexPUnit_top : @orderIsoSumLexPUnit α _ ⊤ = toLex (inr PUnit.unit)

WithTop.orderIsoSumLexPUnit ⊤ = toLex (Sum.inr PUnit.unit)


/-- If for any finitely generated submodules `N'` of `N`, `M` and `N'` are linearly disjoint,
then `M` and `N` themselves are linearly disjoint. -/
theorem of_linearDisjoint_fg_right
    (H : ∀ N' : Submodule R S, N' ≤ N → N'.FG → M.LinearDisjoint N') :
    M.LinearDisjoint N

(H : ∀ N' ≤ N, N'.FG → M.LinearDisjoint N')


theorem coeIdeal_ne_one {I : Ideal R} : (I : FractionalIdeal R⁰ K) ≠ 1 ↔ I ≠ 1

{R : Type u_1}
[CommRing R]
{K : Type u_3}
[Field K]
[Algebra R K]
[IsFractionRing R K]
{I : Ideal R}

↑I ≠ 1 ↔ I ≠ 1


lemma hasSum_int_oddKernel (a : ℝ) {x : ℝ} (hx : 0 < x) :
    HasSum (fun n : ℤ ↦ (n + a) * rexp (-π * (n + a) ^ 2 * x)) (oddKernel ↑a x)

HasSum (fun n => (↑n + a) * rexp (-π * (↑n + a) ^ 2 * x)) (HurwitzZeta.oddKernel (↑a) x)


theorem coeFn_posPart (f : α →ₘ[μ] γ) : ⇑(posPart f) =ᵐ[μ] fun a => max (f a) 0

{α : Type u_1}
{γ : Type u_3}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[TopologicalSpace γ]
[LinearOrder γ]
[OrderClosedTopology γ]
[Zero γ]
(f : α →ₘ[μ] γ)


theorem IsNatPowT.bit0 : IsNatPowT (Nat.pow a b = c) a (nat_lit 2 * b) (Nat.mul c c)

Mathlib.Meta.NormNum.IsNatPowT (a.pow b = c) a (2 * b) (c.mul c)


theorem DifferentiableOn.cexp (hc : DifferentiableOn 𝕜 f s) :
    DifferentiableOn 𝕜 (fun x => Complex.exp (f x)) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[NormedAlgebra 𝕜 ℂ]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : E → ℂ}
{s : Set E}
(hc : DifferentiableOn 𝕜 f s)


/-- All derivatives of a Schwartz function are rapidly decaying. -/
theorem decay (f : 𝓢(E, F)) (k n : ℕ) :
    ∃ C : ℝ, 0 < C ∧ ∀ x, ‖x‖ ^ k * ‖iteratedFDeriv ℝ n f x‖ ≤ C

{E : Type u_4}
{F : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
(f : SchwartzMap E F)
(k n : ℕ)

∃ C, 0 < C ∧ ∀ (x : E), ‖x‖ ^ k * ‖iteratedFDeriv ℝ n (⇑f) x‖ ≤ C


@[simp]
theorem eLpNorm_zero : eLpNorm (0 : α → F) p μ = 0

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]


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

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


@[simp]
theorem finSepDegree_bot : finSepDegree F (⊥ : IntermediateField F E) = 1

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]


@[to_additive (attr := simp) zero_zsmul] theorem zpow_zero (a : G) : a ^ (0 : ℤ) = 1


@[to_additive (attr := simp)]
lemma symm_mk_zpow [DivInvMonoid M] (a : Mᵈᵐᵃ) (n : ℤ) : mk.symm (a ^ n) = mk.symm a ^ n

{M : Type u_1}
[SubNegMonoid M]
(a : Mᵈᵃᵃ)
(n : ℤ)

DomAddAct.mk.symm (n • a) = n • DomAddAct.mk.symm a


@[simp]
theorem toAddSubmonoid_restrictScalars (V : Submodule R M) :
    (V.restrictScalars S).toAddSubmonoid = V.toAddSubmonoid

(S : Type u_1)
{R : Type u_2}
{M : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Semiring S]
[Module S M]
[Module R M]
[SMul S R]
[IsScalarTower S R M]
(V : Submodule R M)

(Submodule.restrictScalars S V).toAddSubmonoid = V.toAddSubmonoid


/-- Any closed uncountable subset of a Polish space admits a continuous injection
from the Cantor space `ℕ → Bool`. -/
theorem IsClosed.exists_nat_bool_injection_of_not_countable {α : Type*} [TopologicalSpace α]
    [PolishSpace α] {C : Set α} (hC : IsClosed C) (hunc : ¬C.Countable) :
    ∃ f : (ℕ → Bool) → α, range f ⊆ C ∧ Continuous f ∧ Function.Injective f

{α : Type u_1}
[TopologicalSpace α]
[PolishSpace α]
{C : Set α}
(hC : IsClosed C)
(hunc : ¬C.Countable)

∃ f, Set.range f ⊆ C ∧ Continuous f ∧ Function.Injective f


lemma toFin_nsmul (n : ℕ) (x : BitVec w)  : toFin (n • x) = n • x.toFin


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

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


@[simp]
lemma cyclesMap'_sub :
    cyclesMap' (φ - φ') h₁ h₂ = cyclesMap' φ h₁ h₂ -
      cyclesMap' φ' h₁ h₂

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{S₁ S₂ : CategoryTheory.ShortComplex C}
{φ φ' : S₁ ⟶ S₂}
(h₁ : S₁.LeftHomologyData)
(h₂ : S₂.LeftHomologyData)

CategoryTheory.ShortComplex.cyclesMap' (φ - φ') h₁ h₂ =
  CategoryTheory.ShortComplex.cyclesMap' φ h₁ h₂ - CategoryTheory.ShortComplex.cyclesMap' φ' h₁ h₂


/-- A variant of `Matrix.mulVecLin_submatrix` that keeps around `LinearEquiv`s. -/
theorem Matrix.mulVecLin_reindex [Fintype n] [Fintype l] (e₁ : k ≃ m) (e₂ : l ≃ n)
    (M : Matrix k l R) :
    (reindex e₁ e₂ M).mulVecLin =
      ↑(LinearEquiv.funCongrLeft R R e₁.symm) ∘ₗ
        M.mulVecLin ∘ₗ ↑(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}
[Fintype n]
[Fintype l]
(e₁ : k ≃ m)
(e₂ : l ≃ n)
(M : Matrix k l R)

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


@[to_additive]
theorem mrange_inl : mrange (inl M N) = prod ⊤ ⊥

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

AddMonoidHom.mrange (AddMonoidHom.inl M N) = ⊤.prod ⊥


/-- If two predicates `p` and `q` are pointwise equivalent, then `{x // p x}` is equivalent to
`{x // q x}`. -/
@[simps!]
def subtypeEquivRight {p q : α → Prop} (e : ∀ x, p x ↔ q x) : { x // p x } ≃ { x // q x }

{α : Sort u_1}
{p q : α → Prop}
(e : ∀ (x : α), p x ↔ q x)
(b : { b // q b })

↑((Equiv.subtypeEquivRight e).symm b) = ↑b


theorem Valid'.node3R {l} {x : α} {m} {y : α} {r o₁ o₂} (hl : Valid' o₁ l x) (hm : Valid' x m y)
    (hr : Valid' y r o₂) (H1 : BalancedSz (size l) (size m + size r + 1))
    (H2 : BalancedSz (size m) (size r)) : Valid' o₁ (@node3R α l x m y r) o₂

(H1 : Ordnode.BalancedSz l.size (m.size + r.size + 1))


/-- **Phragmen-Lindelöf principle** in the second quadrant. Let `f g : ℂ → E` be functions such that

* `f` and `g` are differentiable in the open second quadrant and are continuous on its closure;
* `‖f z‖` and `‖g z‖` are bounded from above by `A * exp(B * (abs z) ^ c)` on the open second
  quadrant for some `A`, `B`, and `c < 2`;
* `f` is equal to `g` on the boundary of the second quadrant.

Then `f` is equal to `g` on the closed second quadrant. -/
theorem eqOn_quadrant_II (hdf : DiffContOnCl ℂ f (Iio 0 ×ℂ Ioi 0))
    (hBf : ∃ c < (2 : ℝ), ∃ B,
      f =O[cobounded ℂ ⊓ 𝓟 (Iio 0 ×ℂ Ioi 0)] fun z => expR (B * abs z ^ c))
    (hdg : DiffContOnCl ℂ g (Iio 0 ×ℂ Ioi 0))
    (hBg : ∃ c < (2 : ℝ), ∃ B,
      g =O[cobounded ℂ ⊓ 𝓟 (Iio 0 ×ℂ Ioi 0)] fun z => expR (B * abs z ^ c))
    (hre : ∀ x : ℝ, x ≤ 0 → f x = g x) (him : ∀ x : ℝ, 0 ≤ x → f (x * I) = g (x * I)) :
    EqOn f g {z | z.re ≤ 0 ∧ 0 ≤ z.im}

(hdf : DiffContOnCl ℂ f (Set.Iio 0 ×ℂ Set.Ioi 0))

(hBf : ∃ c < 2, ∃ B, f =O[Bornology.cobounded ℂ ⊓ 𝓟 (Set.Iio 0 ×ℂ Set.Ioi 0)] fun z => expR (B * Complex.abs z ^ c))

(hdg : DiffContOnCl ℂ g (Set.Iio 0 ×ℂ Set.Ioi 0))

(hBg : ∃ c < 2, ∃ B, g =O[Bornology.cobounded ℂ ⊓ 𝓟 (Set.Iio 0 ×ℂ Set.Ioi 0)] fun z => expR (B * Complex.abs z ^ c))

(him : ∀ (x : ℝ), 0 ≤ x → f (↑x * Complex.I) = g (↑x * Complex.I))


theorem mono_set {s t} (h : s ⊆ t) (ht : AEStronglyMeasurable f (μ.restrict t)) :
    AEStronglyMeasurable f (μ.restrict s)

(ht : MeasureTheory.AEStronglyMeasurable f (μ.restrict t))

MeasureTheory.AEStronglyMeasurable f (μ.restrict s)


theorem eq_singleton_iff_nonempty_unique_mem : s = {a} ↔ s.Nonempty ∧ ∀ x ∈ s, x = a


theorem MDifferentiable.mul (hp : MDifferentiable I 𝓘(𝕜, F') p)
    (hq : MDifferentiable I 𝓘(𝕜, F') q) : MDifferentiable I 𝓘(𝕜, F') (p * q)

{𝕜 : 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]
{F' : Type u_11}
[NormedRing F']
[NormedAlgebra 𝕜 F']
{p q : M → F'}
(hp : MDifferentiable I 𝓘(𝕜, F') p)
(hq : MDifferentiable I 𝓘(𝕜, F') q)


@[simp] theorem xor_cast {x y : BitVec w} (h : w = w') : cast h x &&& cast h y = cast h (x &&& y)

{w w' : Nat}
{x y : BitVec w}
(h : w = w')

BitVec.cast h x &&& BitVec.cast h y = BitVec.cast h (x &&& y)


protected theorem map_sum {ι} [DecidableEq ι] (Q : QuadraticMap R M N) (s : Finset ι) (f : ι → M) :
    Q (∑ i ∈ s, f i) = ∑ i ∈ s, Q (f i) +
      ∑ ij in s.sym2.filter (¬ ·.IsDiag),
        Sym2.lift ⟨fun i j => polar Q (f i) (f j), fun _ _ => polar_comm _ _ _⟩ ij

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
{ι : Type u_8}
[DecidableEq ι]
(Q : QuadraticMap R M N)
(s : Finset ι)
(f : ι → M)

Q (∑ i ∈ s, f i) =
  ∑ i ∈ s, Q (f i) +
    ∑ ij ∈ Finset.filter (fun x => ¬x.IsDiag) s.sym2, Sym2.lift ⟨fun i j => QuadraticMap.polar (⇑Q) (f i) (f j), ⋯⟩ ij


lemma isComplemented_iff : ComplementedLattice L ↔ ∀ a ∈ L, ∃ b ∈ L, IsCompl a b

{α : Type u_1}
[CompleteLattice α]
{L : CompleteSublattice α}

ComplementedLattice ↥L ↔ ∀ a ∈ L, ∃ b ∈ L, IsCompl a b


@[simp]
theorem orderEmbOfFin_mem (s : Finset α) {k : ℕ} (h : s.card = k) (i : Fin k) :
    s.orderEmbOfFin h i ∈ s

{α : Type u_1}
[LinearOrder α]
(s : Finset α)
{k : ℕ}
(h : s.card = k)
(i : Fin k)


protected theorem cond_false {α : Type u} {a b : α} : cond false a b = b


@[norm_cast] theorem Nat.cast_sub_of_lt {m n} (h : m < n) :
    ((n - m : ℕ) : R) = n - m

{R : Type u_1}
[AddGroupWithOne R]
{m n : ℕ}
(h : m < n)


theorem quasiSeparatedSpace_of_quasiSeparated {X Y : Scheme} (f : X ⟶ Y)
    [hY : QuasiSeparatedSpace Y] [QuasiSeparated f] : QuasiSeparatedSpace X

[hY : QuasiSeparatedSpace ↑↑Y.toPresheafedSpace]


@[simp] theorem getMsb_ge (x : BitVec w) (i : Nat) (ge : w ≤ i) : getMsb x i = false

{w : Nat}
(x : BitVec w)
(i : Nat)
(ge : w ≤ i)


@[simp]
theorem Biprod.ofComponents_fst :
    Biprod.ofComponents f₁₁ f₁₂ f₂₁ f₂₂ ≫ biprod.fst = biprod.fst ≫ f₁₁ + biprod.snd ≫ f₂₁

CategoryTheory.Biprod.ofComponents f₁₁ f₁₂ f₂₁ f₂₂ ≫ CategoryTheory.Limits.biprod.fst =
  CategoryTheory.Limits.biprod.fst ≫ f₁₁ + CategoryTheory.Limits.biprod.snd ≫ f₂₁


/--
In a monoidal category, we can take the tensor product of objects, `X ⊗ Y` and of morphisms `f ⊗ g`.
Tensor product does not need to be strictly associative on objects, but there is a
specified associator, `α_ X Y Z : (X ⊗ Y) ⊗ Z ≅ X ⊗ (Y ⊗ Z)`. There is a tensor unit `𝟙_ C`,
with specified left and right unitor isomorphisms `λ_ X : 𝟙_ C ⊗ X ≅ X` and `ρ_ X : X ⊗ 𝟙_ C ≅ X`.
These associators and unitors satisfy the pentagon and triangle equations.

See <https://stacks.math.columbia.edu/tag/0FFK>.
-/
-- Porting note: The Mathport did not translate the temporary notation
class MonoidalCategory (C : Type u) [𝒞 : Category.{v} C] extends MonoidalCategoryStruct C where
  tensorHom_def {X₁ Y₁ X₂ Y₂ : C} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂) :
    f ⊗ g = (f ▷ X₂) ≫ (Y₁ ◁ g) := by
      aesop_cat
  /-- Tensor product of identity maps is the identity: `(𝟙 X₁ ⊗ 𝟙 X₂) = 𝟙 (X₁ ⊗ X₂)` -/
  tensor_id : ∀ X₁ X₂ : C, 𝟙 X₁ ⊗ 𝟙 X₂ = 𝟙 (X₁ ⊗ X₂) := by aesop_cat
  /--
  Composition of tensor products is tensor product of compositions:
  `(f₁ ⊗ g₁) ∘ (f₂ ⊗ g₂) = (f₁ ∘ f₂) ⊗ (g₁ ⊗ g₂)`
  -/
  tensor_comp :
    ∀ {X₁ Y₁ Z₁ X₂ Y₂ Z₂ : C} (f₁ : X₁ ⟶ Y₁) (f₂ : X₂ ⟶ Y₂) (g₁ : Y₁ ⟶ Z₁) (g₂ : Y₂ ⟶ Z₂),
      (f₁ ≫ g₁) ⊗ (f₂ ≫ g₂) = (f₁ ⊗ f₂) ≫ (g₁ ⊗ g₂) := by
    aesop_cat
  whiskerLeft_id : ∀ (X Y : C), X ◁ 𝟙 Y = 𝟙 (X ⊗ Y) := by
    aesop_cat
  id_whiskerRight : ∀ (X Y : C), 𝟙 X ▷ Y = 𝟙 (X ⊗ Y) := by
    aesop_cat
  /-- Naturality of the associator isomorphism: `(f₁ ⊗ f₂) ⊗ f₃ ≃ f₁ ⊗ (f₂ ⊗ f₃)` -/
  associator_naturality :
    ∀ {X₁ X₂ X₃ Y₁ Y₂ Y₃ : C} (f₁ : X₁ ⟶ Y₁) (f₂ : X₂ ⟶ Y₂) (f₃ : X₃ ⟶ Y₃),
      ((f₁ ⊗ f₂) ⊗ f₃) ≫ (α_ Y₁ Y₂ Y₃).hom = (α_ X₁ X₂ X₃).hom ≫ (f₁ ⊗ (f₂ ⊗ f₃)) := by
    aesop_cat
  /--
  Naturality of the left unitor, commutativity of `𝟙_ C ⊗ X ⟶ 𝟙_ C ⊗ Y ⟶ Y` and `𝟙_ C ⊗ X ⟶ X ⟶ Y`
  -/
  leftUnitor_naturality :
    ∀ {X Y : C} (f : X ⟶ Y), 𝟙_ _ ◁ f ≫ (λ_ Y).hom = (λ_ X).hom ≫ f := by
    aesop_cat
  /--
  Naturality of the right unitor: commutativity of `X ⊗ 𝟙_ C ⟶ Y ⊗ 𝟙_ C ⟶ Y` and `X ⊗ 𝟙_ C ⟶ X ⟶ Y`
  -/
  rightUnitor_naturality :
    ∀ {X Y : C} (f : X ⟶ Y), f ▷ 𝟙_ _ ≫ (ρ_ Y).hom = (ρ_ X).hom ≫ f := by
    aesop_cat
  /--
  The pentagon identity relating the isomorphism between `X ⊗ (Y ⊗ (Z ⊗ W))` and `((X ⊗ Y) ⊗ Z) ⊗ W`
  -/
  pentagon :
    ∀ W X Y Z : C,
      (α_ W X Y).hom ▷ Z ≫ (α_ W (X ⊗ Y) Z).hom ≫ W ◁ (α_ X Y Z).hom =
        (α_ (W ⊗ X) Y Z).hom ≫ (α_ W X (Y ⊗ Z)).hom := by
    aesop_cat
  /--
  The identity relating the isomorphisms between `X ⊗ (𝟙_ C ⊗ Y)`, `(X ⊗ 𝟙_ C) ⊗ Y` and `X ⊗ Y`
  -/
  triangle :
    ∀ X Y : C, (α_ X (𝟙_ _) Y).hom ≫ X ◁ (λ_ Y).hom = (ρ_ X).hom ▷ Y := by
    aesop_cat

[self : CategoryTheory.MonoidalCategory C]

CategoryTheory.MonoidalCategory.tensorHom f g =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.whiskerRight f X₂)
    (CategoryTheory.MonoidalCategory.whiskerLeft Y₁ g)


/-- The dimensions of the domain and range of an injective linear map are equal. -/
theorem LinearMap.finrank_range_of_inj {f : M →ₗ[R] N} (hf : Function.Injective f) :
    finrank R (LinearMap.range f) = finrank R M

{R : Type u}
{M : Type v}
{N : Type w}
[Ring R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
{f : M →ₗ[R] N}
(hf : Function.Injective ⇑f)

FiniteDimensional.finrank R ↥(LinearMap.range f) = FiniteDimensional.finrank R M


/--
The property of a sheaf of being a discrete object is invariant under equivalence of sheaf
categories.
-/
lemma isDiscrete_iff_of_equivalence (F : Sheaf K A) :
    let e : Sheaf J A ≌ Sheaf K A :=
      sheafEquiv G J K A
    haveI : (constantSheaf K A).Faithful :=
      Functor.Faithful.of_iso (equivCommuteConstant J A ht K G ht')
    haveI : (constantSheaf K A).Full :=
      Functor.Full.of_iso (equivCommuteConstant J A ht K G ht')
    (e.inverse.obj F).IsDiscrete J ht ↔ IsDiscrete K ht' F

(J : CategoryTheory.GrothendieckTopology C)

(ht : CategoryTheory.Limits.IsTerminal t)

(K : CategoryTheory.GrothendieckTopology D)

[∀ (X : Dᵒᵖ), CategoryTheory.Limits.HasLimitsOfShape (CategoryTheory.StructuredArrow X G.op) A]

[CategoryTheory.Functor.IsDenseSubsite J K G]

(ht' : CategoryTheory.Limits.IsTerminal (G.obj t))

let e := CategoryTheory.Functor.IsDenseSubsite.sheafEquiv G J K A;
CategoryTheory.Sheaf.IsDiscrete J ht (e.inverse.obj F) ↔ CategoryTheory.Sheaf.IsDiscrete K ht' F


@[gcongr]
theorem div_lt_div (hac : a < c) (hbd : d ≤ b) (c0 : 0 ≤ c) (d0 : 0 < d) : a / b < c / d

{α : Type u_2}
[LinearOrderedSemifield α]
{a b c d : α}
(hac : a < c)
(hbd : d ≤ b)
(c0 : 0 ≤ c)
(d0 : 0 < d)


theorem iSup_and {p q : Prop} {s : p ∧ q → α} : iSup s = ⨆ (h₁) (h₂), s ⟨h₁, h₂⟩

{α : Type u_1}
[CompleteLattice α]
{p q : Prop}
{s : p ∧ q → α}


theorem map_add_add_add_map (x y z : M) :
    Q (x + y + z) + (Q x + Q y + Q z) = Q (x + y) + Q (y + z) + Q (z + x)

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
(Q : QuadraticMap R M N)
(x y z : M)