protected theorem fderivWithin_aeval (hxs : UniqueDiffWithinAt 𝕜 s x) :
    fderivWithin 𝕜 (fun x => aeval x q) s x = smulRight (1 : 𝕜 →L[𝕜] 𝕜) (aeval x (derivative q))

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{s : Set 𝕜}
{R : Type u_1}
[CommSemiring R]
[Algebra R 𝕜]
(q : R[X])
(hxs : UniqueDiffWithinAt 𝕜 s x)

fderivWithin 𝕜 (fun x => (Polynomial.aeval x) q) s x =
  ContinuousLinearMap.smulRight 1 ((Polynomial.aeval x) (Polynomial.derivative q))


@[simp]
theorem inducedMap_self (b : β) : inducedMap β β b = b


theorem le_sInf : (∀ b ∈ s, a ≤ b) → a ≤ sInf s

{α : Type u_1}
[CompleteSemilatticeInf α]
{s : Set α}
{a : α}


@[to_additive (attr := simp)]
theorem smul_bot : f • (⊥ : Filter β) = ⊥

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


@[to_additive]
lemma Subgroup.coe_topologicalClosure_bot :
    ((⊥ : Subgroup G).topologicalClosure : Set G) = _root_.closure ({1} : Set G)

(G : Type w)
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]


theorem IsRelPrime.of_squarefree_mul [CommMonoid R] {m n : R} (h : Squarefree (m * n)) :
    IsRelPrime m n

{R : Type u_1}
[CommMonoid R]
{m n : R}
(h : Squarefree (m * n))


@[simp] lemma lift_lt_comp : lift a < comp b ↔ Disjoint a b

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

Booleanisation.lift a < Booleanisation.comp b ↔ Disjoint a b


theorem nonarchimedean (I : Ideal R) : @NonarchimedeanRing R _ I.adicTopology

{R : Type u_1}
[CommRing R]
(I : Ideal R)


@[simp]
theorem contractLeft_apply (f : Module.Dual R M) (m : M) : contractLeft R M (f ⊗ₜ m) = f m

{R : Type u}
{M : Type v₁}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(f : Module.Dual R M)
(m : M)


theorem Convex.is_linear_image (hs : Convex 𝕜 s) {f : E → F} (hf : IsLinearMap 𝕜 f) :
    Convex 𝕜 (f '' s)

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


theorem Valid.merge {l r} (hl : Valid l) (hr : Valid r)
    (sep : l.All fun x => r.All fun y => x < y) : Valid (@merge α l r)

(sep : Ordnode.All (fun x => Ordnode.All (fun y => x < y) r) l)


theorem viaEmbeddingHom_apply : viaEmbeddingHom ι e = viaEmbedding e ι

{α : Type u_1}
{β : Type u_2}
(e : Equiv.Perm α)
(ι : α ↪ β)

(Equiv.Perm.viaEmbeddingHom ι) e = e.viaEmbedding ι


theorem TendstoUniformlyOn.prod {ι' β' : Type*} [UniformSpace β'] {F' : ι' → α → β'} {f' : α → β'}
    {p' : Filter ι'} (h : TendstoUniformlyOn F f p s) (h' : TendstoUniformlyOn F' f' p' s) :
    TendstoUniformlyOn (fun (i : ι × ι') a => (F i.1 a, F' i.2 a)) (fun a => (f a, f' a))
      (p.prod p') s

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

TendstoUniformlyOn (fun i a => (F i.1 a, F' i.2 a)) (fun a => (f a, f' a)) (p.prod p') s


@[simp]
protected theorem ratCast (x : ℚ) : IsSelfAdjoint (x : R)

{R : Type u_1}
[DivisionRing R]
[StarRing R]
(x : ℚ)


@[to_additive]
theorem eq_inv_of_mul_eq_one_right (h : a * b = 1) : b = a⁻¹

{α : Type u_1}
[SubtractionMonoid α]
{a b : α}
(h : a + b = 0)


@[reassoc (attr := simp)]
lemma liftHomotopyZeroZero_comp {Y Z : C} {P : ProjectiveResolution Y} {Q : ProjectiveResolution Z}
    (f : P.complex ⟶ Q.complex) (comm : f ≫ Q.π = 0) :
    liftHomotopyZeroZero f comm ≫ Q.complex.d 1 0 = f.f 0

{P : CategoryTheory.ProjectiveResolution Y}

{Q : CategoryTheory.ProjectiveResolution Z}

(comm : CategoryTheory.CategoryStruct.comp f Q.π = 0)

CategoryTheory.CategoryStruct.comp (CategoryTheory.ProjectiveResolution.liftHomotopyZeroZero f comm) (Q.complex.d 1 0) =
  f.f 0


@[simp]
theorem natCast_mem_center [NonAssocSemiring M] (n : ℕ) : (n : M) ∈ Set.center M

(M : Type u_1)
[NonAssocSemiring M]
(n : ℕ)


/-- When `G` is finite, the Frattini subgroup is nilpotent. -/
theorem frattini_nilpotent [Finite G] : Group.IsNilpotent (frattini G)


@[simp]
theorem Iio_insert [DecidableEq α] (b : α) : insert b (Iio b) = Iic b

{α : Type u_2}
[PartialOrder α]
[LocallyFiniteOrderBot α]
[DecidableEq α]
(b : α)


theorem int_mul (h : LiouvilleWith p x) (hm : m ≠ 0) : LiouvilleWith p (m * x)

{p x : ℝ}
{m : ℤ}
(h : LiouvilleWith p x)
(hm : m ≠ 0)


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

{S₁ S₂ : CategoryTheory.ShortComplex Cᵒᵖ}

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


/-- The change-of-basis matrix between two orthonormal bases with the same orientation has
determinant 1. -/
theorem det_to_matrix_orthonormalBasis_of_same_orientation
    (h : e.toBasis.orientation = f.toBasis.orientation) : e.toBasis.det f = 1


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

[MeasureTheory.VAddInvariantMeasure M α μ]


/-- The `n`-smooth numbers agree with the `Finset.range n`-factored numbers. -/
lemma smoothNumbers_eq_factoredNumbers (n : ℕ) :
    smoothNumbers n = factoredNumbers (Finset.range n)

n.smoothNumbers = Nat.factoredNumbers (Finset.range n)


theorem map_subtype_val_restriction {x} (s : Set α) [DecidablePred (· ∈ s)]
    (hxs : IsSupported x s) : map (↑) (restriction s x) = x

{α : Type u}
{x : FreeCommRing α}
(s : Set α)
[DecidablePred fun x => x ∈ s]
(hxs : x.IsSupported s)

(FreeCommRing.map Subtype.val) ((FreeCommRing.restriction s) x) = x


/-- If a multiplicative indicator function is not equal to `1` at a point, then that point is in the
set. -/
@[to_additive
      "If an additive indicator function is not equal to `0` at a point, then that point is
      in the set."]
theorem mem_of_mulIndicator_ne_one (h : mulIndicator s f a ≠ 1) : a ∈ s

{α : Type u_1}
{M : Type u_4}
[Zero M]
{s : Set α}
{f : α → M}
{a : α}
(h : s.indicator f a ≠ 0)


lemma sparsePairs_mono {ε ε' : 𝕜} (h : ε ≤ ε') : P.sparsePairs G ε ⊆ P.sparsePairs G ε'

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


@[to_additive (attr := simp, norm_cast)]
theorem coe_prod (U : OpenSubgroup G) (V : OpenSubgroup H) :
    (U.prod V : Set (G × H)) = (U : Set G) ×ˢ (V : Set H)

{G : Type u_1}
[Group G]
[TopologicalSpace G]
{H : Type u_2}
[Group H]
[TopologicalSpace H]
(U : OpenSubgroup G)
(V : OpenSubgroup H)


@[to_additive (attr := simp, norm_cast)]
theorem coe_comap (H : OpenSubgroup N) (f : G →* N) (hf : Continuous f) :
    (H.comap f hf : Set G) = f ⁻¹' H

{G : Type u_1}
[Group G]
[TopologicalSpace G]
{N : Type u_2}
[Group N]
[TopologicalSpace N]
(H : OpenSubgroup N)
(f : G →* N)
(hf : Continuous ⇑f)

↑(OpenSubgroup.comap f hf H) = ⇑f ⁻¹' ↑H


protected lemma IsSelfAdjoint.algebraMap {r : R} (hr : IsSelfAdjoint r) :
    IsSelfAdjoint (algebraMap R A r)

{R : Type u_1}
(A : Type u_2)
[CommSemiring R]
[StarRing R]
[Semiring A]
[StarMul A]
[Algebra R A]
[StarModule R A]
{r : R}
(hr : IsSelfAdjoint r)


@[simp]
theorem LieIdeal.coe_toSubalgebra (I : LieIdeal R L) : ((I : LieSubalgebra R L) : Set L) = I

(R : Type u)
(L : Type v)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(I : LieIdeal R L)


/-- The **Fortuin-Kastelyn-Ginibre Inequality**. -/
lemma fkg (hμ₀ : 0 ≤ μ) (hf₀ : 0 ≤ f) (hg₀ : 0 ≤ g) (hf : Monotone f) (hg : Monotone g)
    (hμ : ∀ a b, μ a * μ b ≤ μ (a ⊓ b) * μ (a ⊔ b)) :
    (∑ a, μ a * f a) * ∑ a, μ a * g a ≤ (∑ a, μ a) * ∑ a, μ a * (f a * g a)

(hμ : ∀ (a b : α), μ a * μ b ≤ μ (a ⊓ b) * μ (a ⊔ b))

(∑ a : α, μ a * f a) * ∑ a : α, μ a * g a ≤ (∑ a : α, μ a) * ∑ a : α, μ a * (f a * g a)


@[simp]
theorem tfae_singleton (p) : TFAE [p]


@[simp]
theorem mk_mul_moveRight_inl {xl xr yl yr} {xL xR yL yR} {i j} :
    (mk xl xr xL xR * mk yl yr yL yR).moveRight (Sum.inl (i, j)) =
      xL i * mk yl yr yL yR + mk xl xr xL xR * yR j - xL i * yR j

{xl xr yl yr : Type u_1}
{xL : xl → SetTheory.PGame}
{xR : xr → SetTheory.PGame}
{yL : yl → SetTheory.PGame}
{yR : yr → SetTheory.PGame}
{i : xl}
{j : yr}

(SetTheory.PGame.mk xl xr xL xR * SetTheory.PGame.mk yl yr yL yR).moveRight (Sum.inl (i, j)) =
  xL i * SetTheory.PGame.mk yl yr yL yR + SetTheory.PGame.mk xl xr xL xR * yR j - xL i * yR j


theorem forall_restrictGermPredicate_iff {P : ∀ x : X, Germ (𝓝 x) Y → Prop} :
    (∀ x, RestrictGermPredicate P A x f) ↔ ∀ᶠ x in 𝓝ˢ A, P x f

{X : Type u_3}
{Y : Type u_4}
[TopologicalSpace X]
{f : X → Y}
{A : Set X}
{P : (x : X) → (𝓝 x).Germ Y → Prop}

(∀ (x : X), RestrictGermPredicate P A x ↑f) ↔ ∀ᶠ (x : X) in 𝓝ˢ A, P x ↑f


@[simp]
protected theorem liftOn_eq {φ} (p : Set ℕ) (f : Set ℕ → φ)
    (h : ∀ p q, ManyOneEquiv p q → f p = f q) : (of p).liftOn f h = f p

(h : ∀ (p q : ℕ → Prop), ManyOneEquiv p q → f p = f q)


theorem Reaches₁.to₀ {σ} {f : σ → Option σ} {a b : σ} (h : Reaches₁ f a b) : Reaches₀ f a b

{σ : Type u_1}
{f : σ → Option σ}
{a b : σ}
(h : Turing.Reaches₁ f a b)


@[nontriviality]
theorem of_subsingleton' [Subsingleton R] (x y : M) : SameRay R x y

{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
[Subsingleton R]
(x y : M)


@[simp]
theorem cyclicPermutations_ne_nil : ∀ l : List α, cyclicPermutations l ≠ []


theorem u_inf : u (b₁ ⊓ b₂) = u b₁ ⊓ u b₂

{α : Type u}
{β : Type v}
{b₁ b₂ : β}
[SemilatticeInf α]
[SemilatticeInf β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)


@[simp] lemma isZero_neg : (-α).IsZero ↔ α.IsZero

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


theorem mkHom_apply {M N : SemiNormedGrp} (f : M ⟶ N) (i : f.NormNoninc) (x) :
    mkHom f i x = f x

{M N : SemiNormedGrp}
(f : M ⟶ N)
(i : NormedAddGroupHom.NormNoninc f)
(x : ↑(SemiNormedGrp₁.of ↑M))


@[mono]
theorem offDiag_mono : Monotone (offDiag : Finset α → Finset (α × α))


theorem sin_sub_pi_div_two (θ : Angle) : sin (θ - ↑(π / 2)) = -cos θ


theorem differentiableWithinAt_inter (ht : t ∈ 𝓝 x) :
    DifferentiableWithinAt 𝕜 f (s ∩ t) x ↔ DifferentiableWithinAt 𝕜 f s x

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


@[simp] theorem homotopicRel_empty {f₀ f₁ : C(X, Y)} : HomotopicRel f₀ f₁ ∅ ↔ Homotopic f₀ f₁

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{f₀ f₁ : C(X, Y)}


@[to_additive (attr := simp)]
theorem ball_mul : ball x δ * s = x • thickening δ s

{E : Type u_1}
[SeminormedCommGroup E]
(δ : ℝ)
(s : Set E)
(x : E)

Metric.ball x δ * s = x • Metric.thickening δ s


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

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


theorem lift_one : q.lift (1 : ℍ[R,c₁,c₂]) = 1

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[Ring A]
[Algebra R A]
{c₁ c₂ : R}
(q : QuaternionAlgebra.Basis A c₁ c₂)


theorem Memℒp.integrable_norm_rpow {f : α → β} {p : ℝ≥0∞} (hf : Memℒp f p μ) (hp_ne_zero : p ≠ 0)
    (hp_ne_top : p ≠ ∞) : Integrable (fun x : α => ‖f x‖ ^ p.toReal) μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
{f : α → β}
{p : ℝ≥0∞}
(hf : MeasureTheory.Memℒp f p μ)
(hp_ne_zero : p ≠ 0)
(hp_ne_top : p ≠ ⊤)

MeasureTheory.Integrable (fun x => ‖f x‖ ^ p.toReal) μ


theorem cardFactors_multiset_prod {s : Multiset ℕ} (h0 : s.prod ≠ 0) :
    Ω s.prod = (Multiset.map Ω s).sum

ArithmeticFunction.cardFactors s.prod = (Multiset.map (⇑ArithmeticFunction.cardFactors) s).sum


theorem Forall₂.imp (H : ∀ a b, R a b → S a b) {l₁ l₂} (h : Forall₂ R l₁ l₂) : Forall₂ S l₁ l₂

{α : Type u_1}
{β : Type u_2}
{R S : α → β → Prop}
(H : ∀ (a : α) (b : β), R a b → S a b)
{l₁ : List α}
{l₂ : List β}
(h : List.Forall₂ R l₁ l₂)


/-- In a second-countable space, an open set, given as a union of open sets,
is equal to the union of countably many of those sets.
In particular, any open covering of `α` has a countable subcover: α is a Lindelöf space. -/
theorem isOpen_iUnion_countable [SecondCountableTopology α] {ι} (s : ι → Set α)
    (H : ∀ i, IsOpen (s i)) : ∃ T : Set ι, T.Countable ∧ ⋃ i ∈ T, s i = ⋃ i, s i

{α : Type u}
[t : TopologicalSpace α]
[SecondCountableTopology α]
{ι : Type u_1}
(s : ι → Set α)
(H : ∀ (i : ι), IsOpen (s i))

∃ T, T.Countable ∧ ⋃ i ∈ T, s i = ⋃ i, s i


@[simp]
theorem const_compTendsto' {l : Filter α} (b : β) {lc : Filter γ} {g : Germ lc α}
    (hg : g.Tendsto l) : (↑b : Germ l β).compTendsto' g hg = ↑b

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{l : Filter α}
(b : β)
{lc : Filter γ}
{g : lc.Germ α}
(hg : g.Tendsto l)


@[to_additive]
theorem comp_symm_eq {α : Type*} (e : M ≃* N) (f : N → α) (g : M → α) :
    g ∘ e.symm = f ↔ g = f ∘ e

{M : Type u_6}
{N : Type u_7}
[Mul M]
[Mul N]
{α : Type u_12}
(e : M ≃* N)
(f : N → α)
(g : M → α)


theorem mem_iSup_of_mem {ι : Sort*} {S : ι → Ideal R} (i : ι) : ∀ {x : R}, x ∈ S i → x ∈ iSup S

{R : Type u}
[Semiring R]
{ι : Sort u_1}
{S : ι → Ideal R}
(i : ι)
{x : R}


/-- Constructs an equivalence between Boolean algebras from an order isomorphism between them. -/
@[simps]
def Iso.mk {α β : BoolAlg.{u}} (e : α ≃o β) : α ≅ β

(BoolAlg.Iso.mk e).inv.toSupHom a = e.symm a


@[simp] lemma exterior_exterior (s : Set α) : exterior (exterior s) = exterior s

{α : Type u_3}
[TopologicalSpace α]
[AlexandrovDiscrete α]
(s : Set α)


/-- A sequential limit of measurable `ℝ≥0∞` valued functions is measurable. -/
theorem measurable_of_tendsto {f : ℕ → α → ℝ≥0∞} {g : α → ℝ≥0∞} (hf : ∀ i, Measurable (f i))
    (lim : Tendsto f atTop (𝓝 g)) : Measurable g

{f : ℕ → α → ℝ≥0∞}

{g : α → ℝ≥0∞}

(lim : Filter.Tendsto f Filter.atTop (𝓝 g))


@[simp]
theorem mem_finsupport {i : ι} : i ∈ ρ.finsupport x₀ ↔ i ∈ support fun i ↦ ρ i x₀

{ι : Type uι}
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{s : Set M}
(ρ : SmoothPartitionOfUnity ι I M s)
(x₀ : M)
{i : ι}

i ∈ ρ.finsupport x₀ ↔ i ∈ Function.support fun i => (ρ i) x₀


theorem not_bddBelow_Iio : ¬BddBelow (Iio a)

{α : Type u_1}
[Preorder α]
(a : α)
[NoMinOrder α]


@[simp]
theorem degreeOf_zero (n : σ) : degreeOf n (0 : MvPolynomial σ R) = 0

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(n : σ)


/-- A map `f : E × F → G` satisfies `IsBoundedBilinearMap 𝕜 f` if it is bilinear and
continuous. -/
structure IsBoundedBilinearMap (f : E × F → G) : Prop where
  add_left : ∀ (x₁ x₂ : E) (y : F), f (x₁ + x₂, y) = f (x₁, y) + f (x₂, y)
  smul_left : ∀ (c : 𝕜) (x : E) (y : F), f (c • x, y) = c • f (x, y)
  add_right : ∀ (x : E) (y₁ y₂ : F), f (x, y₁ + y₂) = f (x, y₁) + f (x, y₂)
  smul_right : ∀ (c : 𝕜) (x : E) (y : F), f (x, c • y) = c • f (x, y)
  bound : ∃ C > 0, ∀ (x : E) (y : F), ‖f (x, y)‖ ≤ C * ‖x‖ * ‖y‖

{𝕜 : 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]
{f : E × F → G}
(self : IsBoundedBilinearMap 𝕜 f)
(c : 𝕜)
(x : E)
(y : F)


theorem IsLUB.iSup_eq (h : IsLUB (range f) a) : ⨆ j, f j = a

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
{f : ι → α}
{a : α}
(h : IsLUB (Set.range f) a)


theorem get_pmap {p : α → Prop} (f : ∀ a, p a → β) {l : List α} (h : ∀ a ∈ l, p a) {n : ℕ}
    (hn : n < (pmap f l h).length) :
    get (pmap f l h) ⟨n, hn⟩ =
      f (get l ⟨n, @length_pmap _ _ p f l h ▸ hn⟩)
        (h _ (get_mem l n (@length_pmap _ _ p f l h ▸ hn)))

{α : Type u}
{β : Type v}
{p : α → Prop}
(f : (a : α) → p a → β)
{l : List α}
(h : ∀ (a : α), a ∈ l → p a)
{n : ℕ}
(hn : n < (List.pmap f l h).length)

(List.pmap f l h).get ⟨n, hn⟩ = f (l.get ⟨n, ⋯⟩) ⋯


theorem iff_of_iSup_eq_top {ι} (U : ι → X.Opens) (hU : iSup U = ⊤) :
    P f ↔ ∀ i, P ((U i).ι ≫ f)

{P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme}


theorem le_partialSups (f : ℕ → α) : f ≤ partialSups f

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


theorem Periodic.comp_addHom [Add α] [Add γ] (h : Periodic f c) (g : AddHom γ α) (g_inv : α → γ)
    (hg : RightInverse g_inv g) : Periodic (f ∘ g) (g_inv c)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : α → β}
{c : α}
[Add α]
[Add γ]
(h : Function.Periodic f c)
(g : AddHom γ α)
(g_inv : α → γ)
(hg : Function.RightInverse g_inv ⇑g)


@[to_additive]
protected theorem eq_inv_of_mul_eq_one_left {a : α} (h : ↑u * a = 1) : a = ↑u⁻¹

{α : Type u}
[Monoid α]
{u : αˣ}
{a : α}
(h : ↑u * a = 1)


@[simp]
theorem mulHead_prod {i j : ι} (w : NeWord M i j) (x : M i) (hnotone : x * w.head ≠ 1) :
    (mulHead w x hnotone).prod = of x * w.prod

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
{i j : ι}
(w : Monoid.CoprodI.NeWord M i j)
(x : M i)
(hnotone : x * w.head ≠ 1)

(w.mulHead x hnotone).prod = Monoid.CoprodI.of x * w.prod


theorem small_subset {α : Type v} {s t : Set α} (hts : t ⊆ s) [Small.{u} s] : Small.{u} t

{α : Type v}
{s t : Set α}
(hts : t ⊆ s)
[Small.{u, v} ↑s]


@[simp]
theorem lie_tmul_right (x : L) (m : M) (n : N) : ⁅x, m ⊗ₜ[R] n⁆ = ⁅x, m⁆ ⊗ₜ n + m ⊗ₜ ⁅x, n⁆

{R : Type u}
[CommRing R]
{L : Type v}
{M : Type w}
{N : Type w₁}
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[AddCommGroup N]
[Module R N]
[LieRingModule L N]
[LieModule R L N]
(x : L)
(m : M)
(n : N)

⁅x, m ⊗ₜ[R] n⁆ = ⁅x, m⁆ ⊗ₜ[R] n + m ⊗ₜ[R] ⁅x, n⁆


lemma nonsingular_iff_of_Y_eq_negY {P : Fin 3 → F} (hPz : P z ≠ 0) (hy : P y = W.negY P) :
    W.Nonsingular P ↔ W.Equation P ∧ eval P W.polynomialX ≠ 0

{F : Type v}
[Field F]
{W : WeierstrassCurve.Jacobian F}
{P : Fin 3 → F}
(hPz : P z ≠ 0)
(hy : P y = W.negY P)

W.Nonsingular P ↔ W.Equation P ∧ (MvPolynomial.eval P) W.polynomialX ≠ 0


@[simp]
theorem ae_restrict_eq (hs : MeasurableSet s) : ae (μ.restrict s) = ae μ ⊓ 𝓟 s

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

MeasureTheory.ae (μ.restrict s) = MeasureTheory.ae μ ⊓ 𝓟 s


@[to_additive]
theorem MulAction.isClosedMap_quotient [CompactSpace α] :
    letI := orbitRel α β
    IsClosedMap (Quotient.mk' : β → Quotient (orbitRel α β))

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
[Group α]
[MulAction α β]
[ContinuousInv α]
[ContinuousSMul α β]
[CompactSpace α]


theorem coe_essSup {f : α → ℝ≥0} (hf : IsBoundedUnder (· ≤ ·) (ae μ) f) :
    ((essSup f μ : ℝ≥0) : ℝ≥0∞) = essSup (fun x => (f x : ℝ≥0∞)) μ

(hf : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) (MeasureTheory.ae μ) f)

↑(essSup f μ) = essSup (fun x => ↑(f x)) μ


@[to_additive]
lemma mulIndicator_le_self' (hf : ∀ x ∉ s, 1 ≤ f x) : mulIndicator s f ≤ f

{α : Type u_2}
{M : Type u_4}
[Preorder M]
[Zero M]
{s : Set α}
{f : α → M}
(hf : ∀ x ∉ s, 0 ≤ f x)


lemma pow_right_injective (h : 1 < a.natAbs) : ((a ^ ·) : ℕ → ℤ).Injective


lemma hasMap_comp [X.HasMap p] [(X.mapObj p).HasMap q] : X.HasMap r

{I : Type u_1}
{J : Type u_2}
{K : Type u_3}
{C : Type u_4}
[CategoryTheory.Category.{u_5, u_4} C]
(X : CategoryTheory.GradedObject I C)
(p : I → J)
(q : J → K)
(r : I → K)
(hpqr : ∀ (i : I), q (p i) = r i)
[X.HasMap p]
[(X.mapObj p).HasMap q]


lemma nhds_compactOpen (f : C(X, Y)) :
    𝓝 f = ⨅ (K : Set X) (_ : IsCompact K) (U : Set Y) (_ : IsOpen U) (_ : MapsTo f K U),
      𝓟 {g : C(X, Y) | MapsTo g K U}

{X : Type u_2}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(f : C(X, Y))

𝓝 f = ⨅ K, ⨅ (_ : IsCompact K), ⨅ U, ⨅ (_ : IsOpen U), ⨅ (_ : Set.MapsTo (⇑f) K U), 𝓟 {g | Set.MapsTo (⇑g) K U}


lemma snd_map_prod (κ : Kernel α β) {f : β → γ} {g : β → δ}
    (hf : Measurable f) (hg : Measurable g) :
    snd (map κ (fun x ↦ (f x, g x)) (hf.prod_mk hg)) = map κ g hg

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{δ : Type u_4}
{mδ : MeasurableSpace δ}
{γ : Type u_5}
{mγ : MeasurableSpace γ}
(κ : ProbabilityTheory.Kernel α β)
{f : β → γ}
{g : β → δ}
(hf : Measurable f)
(hg : Measurable g)

(κ.map (fun x => (f x, g x)) ⋯).snd = κ.map g hg


theorem range_add_eq_union (a b : ℕ) : range (a + b) = range a ∪ (range b).map (a + ·)

Multiset.range (a + b) = Multiset.range a ∪ Multiset.map (fun x => a + x) (Multiset.range b)


theorem SetCoe.exists {s : Set α} {p : s → Prop} :
    (∃ x : s, p x) ↔ ∃ (x : _) (h : x ∈ s), p ⟨x, h⟩

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

(∃ x, p x) ↔ ∃ x, ∃ (h : x ∈ s), p ⟨x, h⟩


lemma lift'_unique (f : WithZero α →*₀ β) : f = lift' (f.toMonoidHom.comp coeMonoidHom)

{α : Type u_1}
{β : Type u_2}
[MulOneClass α]
[MulZeroOneClass β]
(f : WithZero α →*₀ β)

f = WithZero.lift' ((↑f).comp WithZero.coeMonoidHom)


theorem to_inf_right {H K : Subgroup G} (hK : IsPGroup p K) : IsPGroup p (H ⊓ K : Subgroup G)

{p : ℕ}
{G : Type u_1}
[Group G]
{H K : Subgroup G}
(hK : IsPGroup p ↥K)


theorem any_iff {t : RBNode α} : t.any p ↔ t.Any (p ·)

{α : Type u_1}
{p : α → Bool}
{t : Batteries.RBNode α}

Batteries.RBNode.any p t = true ↔ Batteries.RBNode.Any (fun x => p x = true) t


theorem abv_one [Nontrivial R] : abv 1 = 1

{S : Type u_5}
[OrderedRing S]
{R : Type u_6}
[Semiring R]
(abv : R → S)
[IsAbsoluteValue abv]
[IsDomain S]
[Nontrivial R]


@[simp]
theorem mapLe_isCycle {G G' : SimpleGraph V} (h : G ≤ G') {u : V} {p : G.Walk u u} :
    (p.mapLe h).IsCycle ↔ p.IsCycle

{V : Type u}
{G G' : SimpleGraph V}
(h : G ≤ G')
{u : V}
{p : G.Walk u u}

(SimpleGraph.Walk.mapLe h p).IsCycle ↔ p.IsCycle


@[simp]
protected lemma univ : Absorbs G₀ univ s

{G₀ : Type u_1}
{α : Type u_2}
[GroupWithZero G₀]
[Bornology G₀]
[MulAction G₀ α]
{s : Set α}


@[simp]
theorem app_zero (X : C) : (0 : F ⟶ G).app X = 0

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_3, u_2} D]
[CategoryTheory.Preadditive D]
{F G : CategoryTheory.Functor C D}
(X : C)


@[simp] theorem zero_or (x : Nat) : 0 ||| x = x


@[to_additive (attr := simp)]
theorem smul_eq {R : Type*} (y : PUnit) (r : R) : r • y = unit


@[to_additive]
theorem Contravariant.MulLECancellable [Mul α] [LE α] [ContravariantClass α α (· * ·) (· ≤ ·)]
    {a : α} :
    MulLECancellable a

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


@[simp] theorem elim_lam_const_lam_const (c : γ) :
    Sum.elim (fun _ : α => c) (fun _ : β => c) = fun _ => c

{γ : Sort u_1}
{α : Type u_2}
{β : Type u_3}
(c : γ)

(Sum.elim (fun x => c) fun x => c) = fun x => c


/-- A family of additive subgroups on a ring `A` is a subgroups basis if it satisfies some
axioms ensuring there is a topology on `A` which is compatible with the ring structure and
admits this family as a basis of neighborhoods of zero. -/
structure RingSubgroupsBasis {A ι : Type*} [Ring A] (B : ι → AddSubgroup A) : Prop where
  /-- Condition for `B` to be a filter basis on `A`. -/
  inter : ∀ i j, ∃ k, B k ≤ B i ⊓ B j
  /-- For each set `B` in the submodule basis on `A`, there is another basis element `B'` such
   that the set-theoretic product `B' * B'` is in `B`. -/
  mul : ∀ i, ∃ j, (B j : Set A) * B j ⊆ B i
  /-- For any element `x : A` and any set `B` in the submodule basis on `A`,
    there is another basis element `B'` such that `B' * x` is in `B`. -/
  leftMul : ∀ x : A, ∀ i, ∃ j, (B j : Set A) ⊆ (x * ·) ⁻¹' B i
  /-- For any element `x : A` and any set `B` in the submodule basis on `A`,
    there is another basis element `B'` such that `x * B'` is in `B`. -/
  rightMul : ∀ x : A, ∀ i, ∃ j, (B j : Set A) ⊆ (· * x) ⁻¹' B i

{A : Type u_1}
{ι : Type u_2}
[Ring A]
{B : ι → AddSubgroup A}
(self : RingSubgroupsBasis B)
(x : A)
(i : ι)

∃ j, ↑(B j) ⊆ (fun x_1 => x * x_1) ⁻¹' ↑(B i)


theorem disjoint_map {m : α → β} (hm : Injective m) {f₁ f₂ : Filter α} :
    Disjoint (map m f₁) (map m f₂) ↔ Disjoint f₁ f₂

{α : Type u}
{β : Type v}
{m : α → β}
(hm : Function.Injective m)
{f₁ f₂ : Filter α}

Disjoint (Filter.map m f₁) (Filter.map m f₂) ↔ Disjoint f₁ f₂


theorem last_pos : (0 : Fin (n + 2)) < last (n + 1)


/-- If the vector passed to `secondInter` is given by a subtraction involving the point in
`secondInter`, and the second point is inside the sphere, the second point is strictly between
the first point and the result of `secondInter`. -/
theorem Sphere.sbtw_secondInter {s : Sphere P} {p p' : P} (hp : p ∈ s)
    (hp' : dist p' s.center < s.radius) : Sbtw ℝ p p' (s.secondInter p (p' -ᵥ p))

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{s : EuclideanGeometry.Sphere P}
{p p' : P}
(hp : p ∈ s)
(hp' : dist p' s.center < s.radius)


@[simp]
theorem lift.of (x : G) : lift f (of x) = f x

{G : Type u}
[Group G]
{A : Type v}
[CommGroup A]
(f : G →* A)
(x : G)

(Abelianization.lift f) (Abelianization.of x) = f x


lemma map_preΨ₄ : (W.map f).preΨ₄ = W.preΨ₄.map f

{R : Type r}
{S : Type s}
[CommRing R]
[CommRing S]
(W : WeierstrassCurve R)
(f : R →+* S)

(W.map f).preΨ₄ = Polynomial.map f W.preΨ₄


/-- Double integrals commute with addition. -/
theorem integral_integral_add ⦃f g : α × β → E⦄ (hf : Integrable f (μ.prod ν))
    (hg : Integrable g (μ.prod ν)) :
    (∫ x, ∫ y, f (x, y) + g (x, y) ∂ν ∂μ) = (∫ x, ∫ y, f (x, y) ∂ν ∂μ) + ∫ x, ∫ y, g (x, y) ∂ν ∂μ

⦃f g : α × β → E⦄

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

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

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


theorem le_add_tsub_swap : a ≤ b + a - b


theorem dartOfNeighborSet_injective (v : V) : Function.Injective (G.dartOfNeighborSet v)

{V : Type u_1}
(G : SimpleGraph V)
(v : V)


@[simp] theorem zip_coe (c₀ : Chain α) (c₁ : Chain β) (n : ℕ) : c₀.zip c₁ n = (c₀ n, c₁ n)

(c₀ : OmegaCompletePartialOrder.Chain α)

(c₁ : OmegaCompletePartialOrder.Chain β)


theorem adjMatrix_mulVec_const_apply_of_regular [NonAssocSemiring α] {d : ℕ} {a : α}
    (hd : G.IsRegularOfDegree d) {v : V} : (G.adjMatrix α *ᵥ Function.const _ a) v = d * a

{V : Type u_1}
{α : Type u_2}
{G : SimpleGraph V}
[DecidableRel G.Adj]
[Fintype V]
[NonAssocSemiring α]
{d : ℕ}
{a : α}
(hd : G.IsRegularOfDegree d)
{v : V}

(SimpleGraph.adjMatrix α G *ᵥ Function.const V a) v = ↑d * a


/-- This is a generic version which allows us to prove both
`NonUnitalSubalgebra.unitization_injective` and `NonUnitalStarSubalgebra.unitization_injective`. -/
theorem _root_.AlgHomClass.unitization_injective {F R S A : Type*} [Field R] [Ring A]
    [Algebra R A] [SetLike S A] [hSA : NonUnitalSubringClass S A] [hSRA : SMulMemClass S R A]
    (s : S) (h1 : 1 ∉ s) [FunLike F (Unitization R s) A] [AlgHomClass F R (Unitization R s) A]
    (f : F) (hf : ∀ x : s, f x = x) : Function.Injective f

{F : Type u_1}
{R : Type u_2}
{S : Type u_3}
{A : Type u_4}
[Field R]
[Ring A]
[Algebra R A]
[SetLike S A]
[hSA : NonUnitalSubringClass S A]
[hSRA : SMulMemClass S R A]
(s : S)
(h1 : 1 ∉ s)
[FunLike F (Unitization R ↥s) A]
[AlgHomClass F R (Unitization R ↥s) A]
(f : F)
(hf : ∀ (x : ↥s), f ↑x = ↑x)


/-- An unbundled description of lax monoidal functors. -/
class LaxMonoidal (F : C → D) [Functorial.{v₁, v₂} F] where
  /-- unit morphism -/
  ε : 𝟙_ D ⟶ F (𝟙_ C)
  /-- tensorator -/
  μ : ∀ X Y : C, F X ⊗ F Y ⟶ F (X ⊗ Y)
  μ_natural_left :
    ∀ {X Y : C} (f : X ⟶ Y) (X' : C),
      map F f ▷ F X' ≫ μ Y X' = μ X X' ≫ map F (f ▷ X') := by
    aesop_cat
  μ_natural_right :
    ∀ {X Y : C} (X' : C) (f : X ⟶ Y) ,
      F X' ◁ map F f ≫ μ X' Y = μ X' X ≫ map F (X' ◁ f) := by
    aesop_cat
  /-- associativity of the tensorator -/
  associativity :
    ∀ X Y Z : C,
      μ X Y ▷ F Z ≫ μ (X ⊗ Y) Z ≫ map F (α_ X Y Z).hom =
        (α_ (F X) (F Y) (F Z)).hom ≫ F X ◁ μ Y Z ≫ μ X (Y ⊗ Z) := by
    aesop_cat
  /-- left unitality -/
  left_unitality : ∀ X : C, (λ_ (F X)).hom = ε ▷ F X ≫ μ (𝟙_ C) X ≫ map F (λ_ X).hom := by
    aesop_cat
  /-- right unitality -/
  right_unitality : ∀ X : C, (ρ_ (F X)).hom = F X ◁ ε ≫ μ X (𝟙_ C) ≫ map F (ρ_ X).hom := by
    aesop_cat

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
[CategoryTheory.MonoidalCategory D]
{F : C → D}
[CategoryTheory.Functorial F]
[self : CategoryTheory.LaxMonoidal F]
{X Y : C}
(f : X ⟶ Y)
(X' : C)

CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.map F f) (F X') ≫ CategoryTheory.LaxMonoidal.μ Y X' =
  CategoryTheory.LaxMonoidal.μ X X' ≫ CategoryTheory.map F (CategoryTheory.MonoidalCategory.whiskerRight f X')


theorem sign_eq_neg_one_iff : sign a = -1 ↔ a < 0

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


theorem list_casesOn {f : α → List β} {g : α → σ} {h : α → β × List β → σ} :
    Primrec f →
      Primrec g →
        Primrec₂ h → @Primrec _ σ _ _ fun a => List.casesOn (f a) (g a) fun b l => h a (b, l)

{α : Type u_1}
{β : Type u_2}
{σ : Type u_4}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
{f : α → List β}
{g : α → σ}
{h : α → β × List β → σ}

Primrec f → Primrec g → Primrec₂ h → Primrec fun a => List.casesOn (f a) (g a) fun b l => h a (b, l)


theorem comp_mul (g : β →*₀o γ) (f₁ f₂ : α →*₀o β) : g.comp (f₁ * f₂) = g.comp f₁ * g.comp f₂

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[LinearOrderedCommMonoidWithZero α]
[LinearOrderedCommMonoidWithZero β]
[LinearOrderedCommMonoidWithZero γ]
(g : β →*₀o γ)
(f₁ f₂ : α →*₀o β)


@[simp]
theorem arcsin_lt_pi_div_two {x : ℝ} : arcsin x < π / 2 ↔ x < 1


lemma image_subset_infs_right : a ∈ s → t.image (a ⊓ ·) ⊆ s ⊼ t

{α : Type u_2}
[DecidableEq α]
[SemilatticeInf α]
{s t : Finset α}
{a : α}

a ∈ s → Finset.image (fun x => a ⊓ x) t ⊆ s ⊼ t


/--
Construct an equivalence of rings from unital homomorphisms in both directions, which are inverses.
-/
@[simps]
def ofHomInv {R S F G : Type*} [NonAssocSemiring R] [NonAssocSemiring S]
    [FunLike F R S] [FunLike G S R] [RingHomClass F R S]
    [RingHomClass G S R] (hom : F) (inv : G)
    (hom_inv_id : (inv : S →+* R).comp (hom : R →+* S) = RingHom.id R)
    (inv_hom_id : (hom : R →+* S).comp (inv : S →+* R) = RingHom.id S) :
    R ≃+* S

(hom_inv_id : (↑inv).comp ↑hom = RingHom.id R)

(inv_hom_id : (↑hom).comp ↑inv = RingHom.id S)

(RingEquiv.ofHomInv hom inv hom_inv_id inv_hom_id) a = hom a


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

{α : Type u_1}
{β : Type u_2}
[AddCommGroup α]
[TopologicalSpace α]
[TopologicalAddGroup α]
{f g : β → α}
(hg : Summable g)
(hfg : Summable fun b => f b - g b)


@[simp]
theorem ofMonotone_coe [IsTrichotomous α r] [IsAsymm β s] (f : α → β) (H) :
    (@ofMonotone _ _ r s _ _ f H : α → β) = f

(H : ∀ (a b : α), r a b → s (f a) (f b))


@[to_additive vadd_eq_of_mul_dvd]
theorem smul_eq_of_mul_dvd (hn : 0 < n) (han : orderOf a ^ 2 ∣ n) :
    a • approxOrderOf A n δ = approxOrderOf A n δ

{A : Type u_1}
[SeminormedCommGroup A]
{a : A}
{n : ℕ}
(δ : ℝ)
(hn : 0 < n)
(han : orderOf a ^ 2 ∣ n)


theorem smoothAt_proj {p : TotalSpace F E} : SmoothAt (IB.prod 𝓘(𝕜, F)) IB (π F E) p

[TopologicalSpace (Bundle.TotalSpace F E)]

SmoothAt (IB.prod 𝓘(𝕜, F)) IB Bundle.TotalSpace.proj p


theorem rel_bind {r : α → β → Prop} {p : γ → δ → Prop} {s t} {f : α → Multiset γ}
    {g : β → Multiset δ} (h : (r ⇒ Rel p) f g) (hst : Rel r s t) :
    Rel p (s.bind f) (t.bind g)

{α : Type u_1}
{β : Type v}
{γ : Type u_2}
{δ : Type u_3}
{r : α → β → Prop}
{p : γ → δ → Prop}
{s : Multiset α}
{t : Multiset β}
{f : α → Multiset γ}
{g : β → Multiset δ}
(h : (r ⇒ Multiset.Rel p) f g)
(hst : Multiset.Rel r s t)


@[to_additive]
theorem inter_mul_subset : s₁ ∩ s₂ * t ⊆ s₁ * t ∩ (s₂ * t)

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


theorem NeBot.zero_mul_nonneg (hg : g.NeBot) : 0 ≤ 0 * g

{α : Type u_2}
[MulZeroClass α]
{g : Filter α}
(hg : g.NeBot)


theorem HasFDerivWithinAt.csin (hf : HasFDerivWithinAt f f' s x) :
    HasFDerivWithinAt (fun x => Complex.sin (f x)) (Complex.cos (f x) • f') s x

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


(α : Type u_1)
[Preorder α]
[TopologicalSpace α]
[Topology.IsUpper α]


@[simp]
theorem cancel_right {g₁ g₂ : BoundedLatticeHom β γ} {f : BoundedLatticeHom α β}
    (hf : Surjective f) : g₁.comp f = g₂.comp f ↔ g₁ = g₂

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Lattice α]
[Lattice β]
[Lattice γ]
[BoundedOrder α]
[BoundedOrder β]
[BoundedOrder γ]
{g₁ g₂ : BoundedLatticeHom β γ}
{f : BoundedLatticeHom α β}
(hf : Function.Surjective ⇑f)


@[simp]
theorem ofEq_symm (h : S₁ = S₂) : (ofEq S₁ S₂ h).symm = ofEq S₂ S₁ h.symm

{k : Type u_1}
{V₁ : Type u_2}
{P₁ : Type u_3}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
(S₁ S₂ : AffineSubspace k P₁)
[Nonempty ↥S₁]
[Nonempty ↥S₂]
(h : S₁ = S₂)

(AffineEquiv.ofEq S₁ S₂ h).symm = AffineEquiv.ofEq S₂ S₁ ⋯


/-- The second morphism of triangles given an octahedron. -/
@[simps]
def triangleMorphism₂ : Triangle.mk u₁₃ v₁₃ w₁₃ ⟶ Triangle.mk u₂₃ v₂₃ w₂₃

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

{comm : CategoryTheory.CategoryStruct.comp u₁₂ u₂₃ = u₁₃}

{v₁₂ : X₂ ⟶ Z₁₂}

{w₁₂ : Z₁₂ ⟶ (CategoryTheory.shiftFunctor C 1).obj X₁}

{h₁₂ : CategoryTheory.Pretriangulated.Triangle.mk u₁₂ v₁₂ w₁₂ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles}

{v₂₃ : X₃ ⟶ Z₂₃}

{w₂₃ : Z₂₃ ⟶ (CategoryTheory.shiftFunctor C 1).obj X₂}

{h₂₃ : CategoryTheory.Pretriangulated.Triangle.mk u₂₃ v₂₃ w₂₃ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles}

{v₁₃ : X₃ ⟶ Z₁₃}

{w₁₃ : Z₁₃ ⟶ (CategoryTheory.shiftFunctor C 1).obj X₁}

{h₁₃ : CategoryTheory.Pretriangulated.Triangle.mk u₁₃ v₁₃ w₁₃ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles}

(h : CategoryTheory.Triangulated.Octahedron comm h₁₂ h₂₃ h₁₃)


@[reassoc]
theorem associator_inv_naturality_middle (f : a ⟶ b) {g g' : b ⟶ c} (η : g ⟶ g') (h : c ⟶ d) :
    f ◁ η ▷ h ≫ (α_ f g' h).inv = (α_ f g h).inv ≫ (f ◁ η) ▷ h

{B : Type u}
[CategoryTheory.Bicategory B]
{a b c d : B}
(f : a ⟶ b)
{g g' : b ⟶ c}
(η : g ⟶ g')
(h : c ⟶ d)

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.whiskerRight η h))
    (CategoryTheory.Bicategory.associator f g' h).inv =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.associator f g h).inv
    (CategoryTheory.Bicategory.whiskerRight (CategoryTheory.Bicategory.whiskerLeft f η) h)


theorem setIntegral_eq_zero_iff_of_nonneg_ae {f : X → ℝ} (hf : 0 ≤ᵐ[μ.restrict s] f)
    (hfi : IntegrableOn f s μ) : ∫ x in s, f x ∂μ = 0 ↔ f =ᵐ[μ.restrict s] 0

(hfi : MeasureTheory.IntegrableOn f s μ)

∫ (x : X) in s, f x ∂μ = 0 ↔ f =ᵐ[μ.restrict s] 0


theorem mem_ofSet_iff {s : Set α} [DecidablePred (· ∈ s)] {a b : α} :
    a ∈ ofSet s b ↔ a = b ∧ a ∈ s

{α : Type u}
{s : Set α}
[DecidablePred fun x => x ∈ s]
{a b : α}


theorem Nontrivial.mono (hs : s.Nontrivial) (hst : s ⊆ t) : t.Nontrivial

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


@[simp]
theorem Iic_union_Ioi : Iic a ∪ Ioi a = univ


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

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

f ×ˢ g₁ ≤ f ×ˢ g₂


/-- The left unitor functor `1 × C ⥤ C` -/
@[simps]
def leftUnitor : Discrete (PUnit : Type w) × C ⥤ C

(X : CategoryTheory.Discrete PUnit.{w + 1} × C)

(CategoryTheory.prod.leftUnitor C).obj X = X.2


theorem approx_mem_approxChain {i} : approx f i ∈ approxChain f

(f : ((a : α) → Part (β a)) →o (a : α) → Part (β a))

Part.Fix.approx (⇑f) i ∈ Part.Fix.approxChain f


@[simp]
theorem univBall_source (c : P) (r : ℝ) : (univBall c r).source = univ

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

(PartialHomeomorph.univBall c r).source = Set.univ


@[to_additive]
theorem orderOf_units {y : Gˣ} : orderOf (y : G) = orderOf y


@[simp]
theorem symm_image_image (e : α ≃o β) (s : Set α) : e.symm '' (e '' s) = s

{α : Type u_2}
{β : Type u_3}
[LE α]
[LE β]
(e : α ≃o β)
(s : Set α)


theorem adjoint_apply_of_not_dense (hT : ¬Dense (T.domain : Set E)) (y : T†.domain) : T† y = 0

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
{T : E →ₗ.[𝕜] F}
[CompleteSpace E]
(hT : ¬Dense ↑T.domain)
(y : ↥T.adjoint.domain)


/-- Let `s : Finset (ι × ℝ)` be a set of hyperplanes `{x : ι → ℝ | x i = r}` in `ι → ℝ` encoded as
pairs `(i, r)`. Suppose that this set contains all faces of a box `J`. The hyperplanes of `s` split
a box `I` into subboxes. Let `Js` be one of them. If `J` and `Js` have nonempty intersection, then
`Js` is a subbox of `J`.  -/
theorem not_disjoint_imp_le_of_subset_of_mem_splitMany {I J Js : Box ι} {s : Finset (ι × ℝ)}
    (H : ∀ i, {(i, J.lower i), (i, J.upper i)} ⊆ s) (HJs : Js ∈ splitMany I s)
    (Hn : ¬Disjoint (J : WithBot (Box ι)) Js) : Js ≤ J

(H : ∀ (i : ι), {(i, J.lower i), (i, J.upper i)} ⊆ s)

(HJs : Js ∈ BoxIntegral.Prepartition.splitMany I s)


@[to_additive]
protected theorem Specializes.mul {a b c d : M} (hab : a ⤳ b) (hcd : c ⤳ d) : (a * c) ⤳ (b * d)

{M : Type u_3}
[TopologicalSpace M]
[Mul M]
[ContinuousMul M]
{a b c d : M}
(hab : a ⤳ b)
(hcd : c ⤳ d)


/-- An `OrderedSemiring` is a semiring with a partial order such that addition is monotone and
multiplication by a nonnegative number is monotone. -/
class OrderedSemiring (α : Type u) extends Semiring α, OrderedAddCommMonoid α where
  /-- `0 ≤ 1` in any ordered semiring. -/
  protected zero_le_one : (0 : α) ≤ 1
  /-- In an ordered semiring, we can multiply an inequality `a ≤ b` on the left
  by a non-negative element `0 ≤ c` to obtain `c * a ≤ c * b`. -/
  protected mul_le_mul_of_nonneg_left : ∀ a b c : α, a ≤ b → 0 ≤ c → c * a ≤ c * b
  /-- In an ordered semiring, we can multiply an inequality `a ≤ b` on the right
  by a non-negative element `0 ≤ c` to obtain `a * c ≤ b * c`. -/
  protected mul_le_mul_of_nonneg_right : ∀ a b c : α, a ≤ b → 0 ≤ c → a * c ≤ b * c

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


theorem ContDiff.div_const {f : E → 𝕜'} {n} (hf : ContDiff 𝕜 n f) (c : 𝕜') :
    ContDiff 𝕜 n fun x => f x / c

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{𝕜' : Type u_6}
[NormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{f : E → 𝕜'}
{n : ℕ∞}
(hf : ContDiff 𝕜 n f)
(c : 𝕜')


/-- `ULift α` is equivalent to `α`. -/
@[simps (config := .asFn) apply]
protected def ulift {α : Type v} : ULift.{u} α ≃ α


theorem isVanKampenColimit_of_isEmpty [HasStrictInitialObjects C] [IsEmpty J] {F : J ⥤ C}
    (c : Cocone F) (hc : IsColimit c) : IsVanKampenColimit c

(hc : CategoryTheory.Limits.IsColimit c)


theorem foldMap_map [Monoid γ] (f : α → β) (g : β → γ) (xs : t α) :
    foldMap g (f <$> xs) = foldMap (g ∘ f) xs

{α β γ : Type u}
{t : Type u → Type u}
[Traversable t]
[LawfulTraversable t]
[Monoid γ]
(f : α → β)
(g : β → γ)
(xs : t α)

Traversable.foldMap g (f <$> xs) = Traversable.foldMap (g ∘ f) xs


theorem linearIndependent : LinearIndependent R x

{ι : Type u_1}
{R : Type u_3}
{A : Type u_5}
{x : ι → A}
[CommRing R]
[CommRing A]
[Algebra R A]
(hx : AlgebraicIndependent R x)


/-- Construct an isomorphism in `C × D` out of two isomorphisms in `C` and `D`. -/
@[simps]
def Iso.prod {P Q : C} {S T : D} (f : P ≅ Q) (g : S ≅ T) : (P, S) ≅ (Q, T)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{P Q : C}
{S T : D}
(f : P ≅ Q)
(g : S ≅ T)


theorem perm_iff_count {l₁ l₂ : List α} : l₁ ~ l₂ ↔ ∀ a, count a l₁ = count a l₂

{α : Type u_1}
[DecidableEq α]
{l₁ l₂ : List α}

l₁ ~ l₂ ↔ ∀ (a : α), List.count a l₁ = List.count a l₂


@[mono]
protected theorem transpose_mono {μ ν : YoungDiagram} (h_le : μ ≤ ν) : μ.transpose ≤ ν.transpose


theorem exp_antiperiodic : Function.Antiperiodic exp (π * I)

Function.Antiperiodic Complex.exp (↑Real.pi * Complex.I)


@[simp]
theorem card_sum [Finite α] [Finite β] : Nat.card (α ⊕ β) = Nat.card α + Nat.card β

{α : Type u_1}
{β : Type u_2}
[Finite α]
[Finite β]


@[simp]
protected theorem LinearMap.deriv : deriv e x = e 1

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{x : 𝕜}
(e : 𝕜 →ₗ[𝕜] F)


theorem restrictStalkIso_inv_eq_ofRestrict {U : TopCat} (X : PresheafedSpace.{_, _, v} C)
    {f : U ⟶ (X : TopCat.{v})} (h : OpenEmbedding f) (x : U) :
    (X.restrictStalkIso h x).inv = (X.ofRestrict h).stalkMap x

(X : AlgebraicGeometry.PresheafedSpace C)

(X.restrictStalkIso h x).inv = AlgebraicGeometry.PresheafedSpace.Hom.stalkMap (X.ofRestrict h) x


/-- All generalized eigenvalues are eigenvalues. -/
theorem hasEigenvalue_of_hasGenEigenvalue {f : End R M} {μ : R} {k : ℕ}
    (hμ : f.HasGenEigenvalue μ k) : f.HasEigenvalue μ

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


theorem Decidable.not_iff_comm [Decidable a] [Decidable b] : (¬a ↔ b) ↔ (¬b ↔ a)

{a b : Prop}
[Decidable a]
[Decidable b]


/-- Construct a cone over a wide cospan. -/
@[simps]
def mkCone {F : WidePullbackShape J ⥤ C} {X : C} (f : X ⟶ F.obj none) (π : ∀ j, X ⟶ F.obj (some j))
    (w : ∀ j, π j ≫ F.map (Hom.term j) = f) : Cone F

{F : CategoryTheory.Limits.WidePullbackShape J ⥤ C}

(w : ∀ (j : J), π j ≫ F.map (CategoryTheory.Limits.WidePullbackShape.Hom.term j) = f)

(CategoryTheory.Limits.WidePullbackShape.mkCone f π w).pt = X


lemma mul_left_eq_self_iff (hb : 0 < b) : a * b = b ↔ a = 1


theorem neg_one_left (x : R) : SemiconjBy (-1) x x

{R : Type x}
[MulOneClass R]
[HasDistribNeg R]
(x : R)


nonrec theorem HasDerivAt.add (hf : HasDerivAt f f' x) (hg : HasDerivAt g g' x) :
    HasDerivAt (fun x => f x + g x) (f' + g') x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : 𝕜 → F}
{f' g' : F}
{x : 𝕜}
(hf : HasDerivAt f f' x)
(hg : HasDerivAt g g' x)


lemma nil_iff_support_eq {p : G.Walk v w} : p.Nil ↔ p.support = [v]

{V : Type u}
{G : SimpleGraph V}
{v w : V}
{p : G.Walk v w}


theorem negOfNat_eq_subNatNat_zero (n) : negOfNat n = subNatNat 0 n


/-- Any mono factorisation of `f` gives a mono factorisation of `f ≫ g` when `g` is a mono. -/
@[simps]
def compMono (F : MonoFactorisation f) {Y' : C} (g : Y ⟶ Y') [Mono g] :
    MonoFactorisation (f ≫ g)

(F : CategoryTheory.Limits.MonoFactorisation f)


@[to_additive]
theorem range_le_ker_iff (f : G →* G') (g : G' →* G'') : f.range ≤ g.ker ↔ g.comp f = 1

{G : Type u_1}
{G' : Type u_2}
{G'' : Type u_3}
[AddGroup G]
[AddGroup G']
[AddGroup G'']
(f : G →+ G')
(g : G' →+ G'')


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

{M : Type u}
⦃m₁ m₂ : Monoid M⦄
(h_mul : HMul.hMul = HMul.hMul)


/-- Any category with pushouts and initial object has binary coproducts. -/
theorem hasBinaryCoproducts_of_hasInitial_and_pushouts [HasInitial C] [HasPushouts C] :
    HasBinaryCoproducts C

(C : Type u)
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Limits.HasInitial C]
[CategoryTheory.Limits.HasPushouts C]


{α : Type u}
[PartialOrder α]
[OrderBot α]
{a : α}
(h : a ≠ ⊥)


theorem inducing_mk : Inducing (mk : X → SeparationQuotient X)


theorem IsBoundedUnder.mono_ge [Preorder β] {l : Filter α} {u v : α → β}
    (hu : IsBoundedUnder (· ≥ ·) l u) (hv : u ≤ᶠ[l] v) : IsBoundedUnder (· ≥ ·) l v

(hu : Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) l u)

Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) l v


theorem List.trop_sum [AddMonoid R] (l : List R) : trop l.sum = List.prod (l.map trop)

{R : Type u_1}
[AddMonoid R]
(l : List R)

Tropical.trop l.sum = (List.map Tropical.trop l).prod


@[simp]
theorem onFormula_apply (φ : L ≃ᴸ L') :
    (φ.onFormula : L.Formula α → L'.Formula α) = φ.toLHom.onFormula

{L : FirstOrder.Language}
{L' : FirstOrder.Language}
{α : Type u'}
(φ : L ≃ᴸ L')


@[simp]
theorem unop_pow {β} [Pow α β] (a : αᵃᵒᵖ) (b : β) : unop (a ^ b) = unop a ^ b

{α : Type u_1}
{β : Type u_2}
[Pow α β]
(a : αᵃᵒᵖ)
(b : β)

AddOpposite.unop (a ^ b) = AddOpposite.unop a ^ b


theorem iInf₂ {κ : Sort*} {κ' : κ → Sort*} {f : ∀ i, κ' i → Ideal A}
    (h : ∀ i j, (f i j).IsHomogeneous 𝒜) : (⨅ (i) (j), f i j).IsHomogeneous 𝒜

(h : ∀ (i : κ) (j : κ' i), Ideal.IsHomogeneous 𝒜 (f i j))


@[fun_prop]
theorem ContinuousOn.div₀ (hf : ContinuousOn f s) (hg : ContinuousOn g s) (h₀ : ∀ x ∈ s, g x ≠ 0) :
    ContinuousOn (fun x => f x / g x) s

{α : Type u_1}
{G₀ : Type u_3}
[GroupWithZero G₀]
[TopologicalSpace G₀]
[HasContinuousInv₀ G₀]
[ContinuousMul G₀]
{f g : α → G₀}
[TopologicalSpace α]
{s : Set α}
(hf : ContinuousOn f s)
(hg : ContinuousOn g s)
(h₀ : ∀ x ∈ s, g x ≠ 0)


/-- A composition of natural transformations gives the composition of corresponding functors. -/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransComp {F₀ F₁ F₂ : C ⥤ C} (α : F₀ ⟶ F₁) (β : F₁ ⟶ F₂) :
    functorOfNatTrans (α ≫ β) ≅ functorOfNatTrans α ⋙ functorOfNatTrans β

(X : CategoryTheory.Endofunctor.Coalgebra F₀)

((CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransComp α β).hom.app X).f = CategoryTheory.CategoryStruct.id X.V


/-- The functor sending an object `X` in the comma category to `X.right`. -/
@[simps]
def snd : Comma L R ⥤ B

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

(CategoryTheory.Comma.snd L R).obj X = X.right


@[simp]
protected theorem lineDeriv (f : QuadraticMap 𝕜 E F) : lineDeriv 𝕜 f = polar f

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(f : QuadraticMap 𝕜 E F)


@[to_additive (attr := simp)]
theorem card_smul_finset (a : α) (s : Finset β) : (a • s).card = s.card

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


@[simp]
theorem tprod_apply (g : G) : (ρV ⊗ ρW) g = TensorProduct.map (ρV g) (ρW g)

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

(ρV.tprod ρW) g = TensorProduct.map (ρV g) (ρW g)


theorem map_subtype_embedding_uIcc : (uIcc a b).map (Embedding.subtype _) = uIcc ↑a ↑b

Finset.map (Function.Embedding.subtype fun n => 0 < n) (Finset.uIcc a b) = Finset.uIcc ↑a ↑b


@[simp, norm_cast]
theorem cast_inj [AddMonoidWithOne α] [CharZero α] {m n : PosNum} : (m : α) = n ↔ m = n

{α : Type u_1}
[AddMonoidWithOne α]
[CharZero α]
{m n : PosNum}


protected theorem mul_assoc : ∀ (n m k : Nat), (n * m) * k = n * (m * k)


@[ext]
theorem derivation_ext {D₁ D₂ : Derivation R (MvPolynomial σ R) A} (h : ∀ i, D₁ (X i) = D₂ (X i)) :
    D₁ = D₂

(h : ∀ (i : σ), D₁ (MvPolynomial.X i) = D₂ (MvPolynomial.X i))


@[simp]
theorem blockDiag_blockDiagonal [DecidableEq o] (M : o → Matrix m n α) :
    blockDiag (blockDiagonal M) = M

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type u_12}
[Zero α]
[DecidableEq o]
(M : o → Matrix m n α)


lemma ediv_of_neg_of_pos {a b : ℤ} (Ha : a < 0) (Hb : 0 < b) : ediv a b = -((-a - 1) / b + 1)


/-- In the characteristic zero case, the weights in the centroid sum
to 1 if the number of points is not zero. -/
theorem sum_centroidWeights_eq_one_of_card_ne_zero [CharZero k] (h : card s ≠ 0) :
    ∑ i ∈ s, s.centroidWeights k i = 1

(k : Type u_1)
[DivisionRing k]
{ι : Type u_4}
(s : Finset ι)
[CharZero k]
(h : s.card ≠ 0)

∑ i ∈ s, Finset.centroidWeights k s i = 1


/-- A map `f : α → β` between uniform spaces is called *uniform inducing* if the uniformity filter
on `α` is the pullback of the uniformity filter on `β` under `Prod.map f f`. If `α` is a separated
space, then this implies that `f` is injective, hence it is a `UniformEmbedding`. -/
@[mk_iff]
structure UniformInducing (f : α → β) : Prop where
  /-- The uniformity filter on the domain is the pullback of the uniformity filter on the codomain
  under `Prod.map f f`. -/
  comap_uniformity : comap (fun x : α × α => (f x.1, f x.2)) (𝓤 β) = 𝓤 α

{α : Type u}
{β : Type v}
[UniformSpace α]
[UniformSpace β]
{f : α → β}
(self : UniformInducing f)

Filter.comap (fun x => (f x.1, f x.2)) (𝓤 β) = 𝓤 α


@[to_additive (attr := simp)]
theorem fst_prod_snd : (fst : M ∗ N →* M).prod snd = toProd

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

Monoid.Coprod.fst.prod Monoid.Coprod.snd = Monoid.Coprod.toProd


@[to_additive]
protected theorem mul_smul (x y : R[S⁻¹]) (z : X[S⁻¹]) : (x * y) • z = x • y • z

{R : Type u_1}
[Monoid R]
{S : Submonoid R}
[OreLocalization.OreSet S]
{X : Type u_2}
[MulAction R X]
(x y : OreLocalization S R)
(z : OreLocalization S X)


theorem exists_nat_measurableEquiv_range_coe_fin_of_finite [Finite α] :
    ∃ n : ℕ, Nonempty (α ≃ᵐ range ((↑) : Fin n → ℝ))

(α : Type u_1)
[MeasurableSpace α]
[StandardBorelSpace α]
[Finite α]

∃ n, Nonempty (α ≃ᵐ ↑(Set.range fun x => ↑↑x))


theorem exists_modelType_is_realized_in (p : T.CompleteType α) :
    ∃ M : Theory.ModelType.{u, v, max u v w} T, p ∈ T.realizedTypes M α

{L : FirstOrder.Language}
(T : L.Theory)
{α : Type w}
(p : T.CompleteType α)


theorem Disjoint.mem_imp (h : Disjoint f g) {x : α} (hx : x ∈ f.support) : x ∉ g.support

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{f g : Equiv.Perm α}
(h : f.Disjoint g)
{x : α}
(hx : x ∈ f.support)


/-- Various statements equivalent to the fact that `f n` grows exponentially slower than `R ^ n`.

* 0: $f n = o(a ^ n)$ for some $-R < a < R$;
* 1: $f n = o(a ^ n)$ for some $0 < a < R$;
* 2: $f n = O(a ^ n)$ for some $-R < a < R$;
* 3: $f n = O(a ^ n)$ for some $0 < a < R$;
* 4: there exist `a < R` and `C` such that one of `C` and `R` is positive and $|f n| ≤ Ca^n$
     for all `n`;
* 5: there exists `0 < a < R` and a positive `C` such that $|f n| ≤ Ca^n$ for all `n`;
* 6: there exists `a < R` such that $|f n| ≤ a ^ n$ for sufficiently large `n`;
* 7: there exists `0 < a < R` such that $|f n| ≤ a ^ n$ for sufficiently large `n`.

NB: For backwards compatibility, if you add more items to the list, please append them at the end of
the list. -/
theorem TFAE_exists_lt_isLittleO_pow (f : ℕ → ℝ) (R : ℝ) :
    TFAE
      [∃ a ∈ Ioo (-R) R, f =o[atTop] (a ^ ·), ∃ a ∈ Ioo 0 R, f =o[atTop] (a ^ ·),
        ∃ a ∈ Ioo (-R) R, f =O[atTop] (a ^ ·), ∃ a ∈ Ioo 0 R, f =O[atTop] (a ^ ·),
        ∃ a < R, ∃ C : ℝ, (0 < C ∨ 0 < R) ∧ ∀ n, |f n| ≤ C * a ^ n,
        ∃ a ∈ Ioo 0 R, ∃ C > 0, ∀ n, |f n| ≤ C * a ^ n, ∃ a < R, ∀ᶠ n in atTop, |f n| ≤ a ^ n,
        ∃ a ∈ Ioo 0 R, ∀ᶠ n in atTop, |f n| ≤ a ^ n]

[∃ a ∈ Set.Ioo (-R) R, f =o[Filter.atTop] fun x => a ^ x, ∃ a ∈ Set.Ioo 0 R, f =o[Filter.atTop] fun x => a ^ x,
    ∃ a ∈ Set.Ioo (-R) R, f =O[Filter.atTop] fun x => a ^ x, ∃ a ∈ Set.Ioo 0 R, f =O[Filter.atTop] fun x => a ^ x,
    ∃ a < R, ∃ C, (0 < C ∨ 0 < R) ∧ ∀ (n : ℕ), |f n| ≤ C * a ^ n,
    ∃ a ∈ Set.Ioo 0 R, ∃ C > 0, ∀ (n : ℕ), |f n| ≤ C * a ^ n, ∃ a < R, ∀ᶠ (n : ℕ) in Filter.atTop, |f n| ≤ a ^ n,
    ∃ a ∈ Set.Ioo 0 R, ∀ᶠ (n : ℕ) in Filter.atTop, |f n| ≤ a ^ n].TFAE


/--
Over any nontrivial ring, the existence of a finite spanning set implies that any basis is finite.
-/
lemma basis_finite_of_finite_spans (w : Set M) (hw : w.Finite) (s : span R w = ⊤) {ι : Type w}
    (b : Basis ι R M) : Finite ι

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Nontrivial R]
[Module R M]
(w : Set M)
(hw : w.Finite)
(s : Submodule.span R w = ⊤)
{ι : Type w}
(b : Basis ι R M)


theorem mul_le_one [ZeroLEOneClass α] [PosMulMono α] [MulPosMono α]
    (ha : a ≤ 1) (hb' : 0 ≤ b) (hb : b ≤ 1) : a * b ≤ 1

{α : Type u}
[Semiring α]
[Preorder α]
{a b : α}
[ZeroLEOneClass α]
[PosMulMono α]
[MulPosMono α]
(ha : a ≤ 1)
(hb' : 0 ≤ b)
(hb : b ≤ 1)


@[simp]
theorem mk_mem_carrier (z : HomogeneousLocalization.NumDenSameDeg 𝒜 (.powers f)) :
    HomogeneousLocalization.mk z ∈ carrier x ↔ z.num.1 ∈ x.1.asHomogeneousIdeal

(x : ↑((AlgebraicGeometry.Proj.toLocallyRingedSpace 𝒜).restrict ⋯).toTopCat)

(z : HomogeneousLocalization.NumDenSameDeg 𝒜 (Submonoid.powers f))

HomogeneousLocalization.mk z ∈ AlgebraicGeometry.ProjIsoSpecTopComponent.ToSpec.carrier x ↔
  ↑z.num ∈ (↑x).asHomogeneousIdeal


@[simp] theorem neg_lt_neg_iff {a b : EReal} : -a < -b ↔ b < a


/-- A oplax monoidal functor is a functor `F : C ⥤ D` between monoidal categories,
equipped with morphisms `η : F.obj (𝟙_ C) ⟶ 𝟙 _D` and `δ X Y : F.obj (X ⊗ Y) ⟶ F.obj X ⊗ F.obj Y`,
satisfying the appropriate coherences. -/
structure OplaxMonoidalFunctor extends C ⥤ D where
  /-- counit morphism -/
  η : obj (𝟙_ C) ⟶ 𝟙_ D
  /-- cotensorator -/
  δ : ∀ X Y : C, obj (X ⊗ Y) ⟶ obj X ⊗ obj Y
  δ_natural_left :
    ∀ {X Y : C} (f : X ⟶ Y) (X' : C),
      δ X X' ≫ map f ▷ obj X' = map (f ▷ X') ≫ δ Y X' := by
    aesop_cat
  δ_natural_right :
    ∀ {X Y : C} (X' : C) (f : X ⟶ Y) ,
      δ X' X ≫ obj X' ◁ map f = map (X' ◁ f) ≫ δ X' Y := by
    aesop_cat
  /-- associativity of the tensorator -/
  associativity :
    ∀ X Y Z : C,
      δ (X ⊗ Y) Z ≫ δ X Y ▷ obj Z ≫ (α_ (obj X) (obj Y) (obj Z)).hom =
        map (α_ X Y Z).hom ≫ δ X (Y ⊗ Z) ≫ obj X ◁ δ Y Z := by
    aesop_cat
  -- unitality
  left_unitality : ∀ X : C, (λ_ (obj X)).inv = map (λ_ X).inv ≫ δ (𝟙_ C) X ≫ η ▷ obj X := by
    aesop_cat
  right_unitality : ∀ X : C, (ρ_ (obj X)).inv = map (ρ_ X).inv ≫ δ X (𝟙_ C) ≫ obj X ◁ η := by
    aesop_cat

(self : CategoryTheory.OplaxMonoidalFunctor C D)

(CategoryTheory.MonoidalCategory.rightUnitor (self.obj X)).inv =
  self.map (CategoryTheory.MonoidalCategory.rightUnitor X).inv ≫
    self.δ X (𝟙_ C) ≫ CategoryTheory.MonoidalCategory.whiskerLeft (self.obj X) self.η


/-- Cancellation adding the results of two subtractions. -/
@[simp]
theorem vsub_add_vsub_cancel (p₁ p₂ p₃ : P) : p₁ -ᵥ p₂ + (p₂ -ᵥ p₃) = p₁ -ᵥ p₃

{G : Type u_1}
{P : Type u_2}
[AddGroup G]
[T : AddTorsor G P]
(p₁ p₂ p₃ : P)


theorem image2_singleton : image2 f {a} {b} = {f a b}

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{f : α → β → γ}
{a : α}
{b : β}


theorem withDensity_add_measure {m : MeasurableSpace α} (μ ν : Measure α) (f : α → ℝ≥0∞) :
    (μ + ν).withDensity f = μ.withDensity f + ν.withDensity f

{α : Type u_1}
{m : MeasurableSpace α}
(μ ν : MeasureTheory.Measure α)
(f : α → ℝ≥0∞)


protected lemma map_mul (f : α →*₀ β) (a b : α) : f (a * b) = f a * f b

{α : Type u_2}
{β : Type u_3}
[MulZeroOneClass α]
[MulZeroOneClass β]
(f : α →*₀ β)
(a b : α)


/-- An equivalence of categories `e` between `C` and `D` induces an equivalence between
    `MonoOver X` and `MonoOver (e.functor.obj X)` whenever `X` is an object of `C`. -/
@[simps]
def congr (e : C ≌ D) : MonoOver X ≌ MonoOver (e.functor.obj X)

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

(CategoryTheory.MonoOver.congr X e).inverse =
  (CategoryTheory.MonoOver.lift (CategoryTheory.Over.post e.inverse) ⋯).comp
    (CategoryTheory.MonoOver.mapIso (e.unitIso.symm.app X)).functor


@[simp]
theorem prod_fst_snd : prod (fst R A B) (snd R A B) = 1

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]

(AlgHom.fst R A B).prod (AlgHom.snd R A B) = 1


theorem Ioc_pred_left_of_not_isMin (ha : ¬IsMin a) : Ioc (pred a) b = Icc a b

{α : Type u_1}
[Preorder α]
[PredOrder α]
{a b : α}
(ha : ¬IsMin a)


@[simp] lemma basisOf_vadd (v : V) (b : AffineBasis ι k P) : (v +ᵥ b).basisOf = b.basisOf

{ι : Type u_1}
{k : Type u_3}
{V : Type u_4}
{P : Type u_5}
[AddCommGroup V]
[AffineSpace V P]
[Ring k]
[Module k V]
(v : V)
(b : AffineBasis ι k P)


/-- An `AddTorsor` for a connected space is a connected space. This is not an instance because
it loops for a group as a torsor over itself. -/
protected theorem AddTorsor.connectedSpace : ConnectedSpace P

(G : Type u_1)
(P : Type u_2)
[AddGroup G]
[AddTorsor G P]
[TopologicalSpace G]
[PreconnectedSpace G]
[TopologicalSpace P]
[ContinuousVAdd G P]


theorem Matrix.toLin_finTwoProd (a b c d : R) :
    Matrix.toLin (Basis.finTwoProd R) (Basis.finTwoProd R) !![a, b; c, d] =
      (a • LinearMap.fst R R R + b • LinearMap.snd R R R).prod
        (c • LinearMap.fst R R R + d • LinearMap.snd R R R)

{R : Type u_1}
[CommSemiring R]
(a b c d : R)

(Matrix.toLin (Basis.finTwoProd R) (Basis.finTwoProd R)) !![a, b; c, d] =
  (a • LinearMap.fst R R R + b • LinearMap.snd R R R).prod (c • LinearMap.fst R R R + d • LinearMap.snd R R R)


theorem applyId_injective [DecidableEq α] {xs ys : List α} (h₀ : List.Nodup xs) (h₁ : xs ~ ys) :
    Injective.{u + 1, u + 1} (List.applyId (xs.zip ys))

{α : Type u}
[DecidableEq α]
{xs ys : List α}
(h₀ : xs.Nodup)
(h₁ : xs ~ ys)

Function.Injective (SlimCheck.InjectiveFunction.List.applyId (xs.zip ys))


@[simp]
lemma natDegree_polynomial [Nontrivial R] : W.polynomial.natDegree = 2

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Affine R)
[Nontrivial R]


/-- A small family of games is bounded below. -/
lemma bddBelow_range_of_small {ι : Type*} [Small.{u} ι] (f : ι → Game.{u}) :
    BddBelow (Set.range f)

{ι : Type u_1}
[Small.{u, u_1} ι]
(f : ι → SetTheory.Game)


theorem Multiset.toFinset_card_eq_card_iff_nodup {m : Multiset α} :
    m.toFinset.card = card m ↔ m.Nodup

{α : Type u_1}
[DecidableEq α]
{m : Multiset α}

m.toFinset.card = Multiset.card m ↔ m.Nodup


@[to_additive]
theorem TopologicalGroup.tendstoUniformly_iff {ι α : Type*} (F : ι → α → G) (f : α → G)
    (p : Filter ι) :
    @TendstoUniformly α G ι (TopologicalGroup.toUniformSpace G) F f p ↔
      ∀ u ∈ 𝓝 (1 : G), ∀ᶠ i in p, ∀ a, F i a / f a ∈ u

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]
[TopologicalAddGroup G]
{ι : Type u_2}
{α : Type u_3}
(F : ι → α → G)
(f : α → G)
(p : Filter ι)

TendstoUniformly F f p ↔ ∀ u ∈ 𝓝 0, ∀ᶠ (i : ι) in p, ∀ (a : α), F i a - f a ∈ u


theorem not_sameRay_iff_of_norm_eq (h : ‖x‖ = ‖y‖) : ¬SameRay ℝ x y ↔ x ≠ y

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


@[simp]
theorem cramer_one : cramer (1 : Matrix n n α) = 1

{n : Type v}
{α : Type w}
[DecidableEq n]
[Fintype n]
[CommRing α]


theorem pred_lt_top (a : α) : pred a < ⊤

{α : Type u_1}
[PartialOrder α]
[PredOrder α]
[OrderTop α]
[Nontrivial α]
(a : α)


theorem nodup_iff_get?_ne_get? {l : List α} :
    l.Nodup ↔ ∀ i j : ℕ, i < j → j < l.length → l.get? i ≠ l.get? j

l.Nodup ↔ ∀ (i j : ℕ), i < j → j < l.length → l.get? i ≠ l.get? j


@[simp]
theorem DFinsupp.toFinsupp_coe (f : Π₀ _ : ι, M) : ⇑f.toFinsupp = f

{ι : Type u_1}
{M : Type u_3}
[DecidableEq ι]
[Zero M]
[(m : M) → Decidable (m ≠ 0)]
(f : Π₀ (x : ι), M)


@[simp]
theorem lineMap_eq_lineMap_iff [NoZeroSMulDivisors k V1] {p₀ p₁ : P1} {c₁ c₂ : k} :
    lineMap p₀ p₁ c₁ = lineMap p₀ p₁ c₂ ↔ p₀ = p₁ ∨ c₁ = c₂

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
[NoZeroSMulDivisors k V1]
{p₀ p₁ : P1}
{c₁ c₂ : k}

(AffineMap.lineMap p₀ p₁) c₁ = (AffineMap.lineMap p₀ p₁) c₂ ↔ p₀ = p₁ ∨ c₁ = c₂


theorem _root_.minpoly.natDegree_le (x : L) [FiniteDimensional K L] :
    (minpoly K x).natDegree ≤ finrank K L

{K : Type u}
[Field K]
{L : Type u_3}
[Field L]
[Algebra K L]
(x : L)
[FiniteDimensional K L]

(minpoly K x).natDegree ≤ FiniteDimensional.finrank K L


@[simp]
lemma map_lift_mapCone (c : Cone F) :
    A.map (limit.lift (F ⋙ π A) ((π A).mapCone c)) c.pt.snd = liftedConeElement F

(F : CategoryTheory.Functor I A.Elements)

A.map
    (CategoryTheory.Limits.limit.lift (F.comp (CategoryTheory.CategoryOfElements.π A))
      ((CategoryTheory.CategoryOfElements.π A).mapCone c))
    c.pt.snd =
  CategoryTheory.CategoryOfElements.CreatesLimitsAux.liftedConeElement F


@[simp] theorem toNat_xor (x y : BitVec v) :
    BitVec.toNat (x ^^^ y) = BitVec.toNat x ^^^ BitVec.toNat y


theorem smeval_commute_left (hc : Commute x y) : Commute (p.smeval x) y

(R : Type u_1)
[Semiring R]
(p : Polynomial R)
{S : Type u_2}
[Semiring S]
[Module R S]
[IsScalarTower R S S]
[SMulCommClass R S S]
{x y : S}
(hc : Commute x y)


theorem _root_.stronglyMeasurable_of_restrict_of_restrict_compl {_ : MeasurableSpace α}
    [TopologicalSpace β] {f : α → β} {s : Set α} (hs : MeasurableSet s)
    (h₁ : StronglyMeasurable (s.restrict f)) (h₂ : StronglyMeasurable (sᶜ.restrict f)) :
    StronglyMeasurable f

∀ {x : MeasurableSpace α} [inst : TopologicalSpace β] {f : α → β} {s : Set α},
  MeasurableSet s →
    MeasureTheory.StronglyMeasurable (s.restrict f) →
      MeasureTheory.StronglyMeasurable (sᶜ.restrict f) → MeasureTheory.StronglyMeasurable f


theorem condCount_inter (hs : s.Finite) :
    condCount s (t ∩ u) = condCount (s ∩ t) u * condCount s t

{Ω : Type u_1}
[MeasurableSpace Ω]
[MeasurableSingletonClass Ω]
{s t u : Set Ω}
(hs : s.Finite)

(ProbabilityTheory.condCount s) (t ∩ u) = (ProbabilityTheory.condCount (s ∩ t)) u * (ProbabilityTheory.condCount s) t


theorem isPreconnected_Ioc : IsPreconnected (Ioc a b)

{α : Type u}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[DenselyOrdered α]
{a b : α}


@[simp] lemma nil : IsWeaklyRegular M ([] : List R)

(R : Type u_1)
(M : Type u_3)
[CommRing R]
[AddCommGroup M]
[Module R M]


@[simp]
theorem comp_zero (g : M₂ →ₛₗ[σ₂₃] M₃) : (g.comp (0 : M →ₛₗ[σ₁₂] M₂) : M →ₛₗ[σ₁₃] M₃) = 0

{R₁ : Type u_2}
{R₂ : Type u_3}
{R₃ : Type u_4}
{M : Type u_9}
{M₂ : Type u_11}
{M₃ : Type u_12}
[Semiring R₁]
[Semiring R₂]
[Semiring R₃]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R₁ M]
[Module R₂ M₂]
[Module R₃ M₃]
{σ₁₂ : R₁ →+* R₂}
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R₁ →+* R₃}
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
(g : M₂ →ₛₗ[σ₂₃] M₃)


theorem transpose {M : Matrix n n R} (hM : M.PosSemidef) : Mᵀ.PosSemidef

{n : Type u_2}
{R : Type u_3}
[Fintype n]
[CommRing R]
[PartialOrder R]
[StarRing R]
{M : Matrix n n R}
(hM : M.PosSemidef)


theorem le_mul_of_one_le_left [MulPosMono α] (hb : 0 ≤ b) (h : 1 ≤ a) : b ≤ a * b

{α : Type u_1}
{a b : α}
[MulOneClass α]
[Zero α]
[Preorder α]
[MulPosMono α]
(hb : 0 ≤ b)
(h : 1 ≤ a)


/-- If a compact closed set is everywhere positive with respect to a left-invariant measure on a
topological group, then it is a Gδ set. This is nontrivial, as there is no second-countability or
metrizability assumption in the statement, so a general compact closed set has no reason to be
a countable intersection of open sets. -/
@[to_additive]
lemma IsEverywherePos.IsGdelta_of_isMulLeftInvariant
    {k : Set G} (h : μ.IsEverywherePos k) (hk : IsCompact k) (h'k : IsClosed k) :
    IsGδ k


private theorem testBit_succ_zero : testBit (x + 1) 0 = not (testBit x 0)


/-- A natural transformation `P ⟶ Q` induces a natural transformation
between diagrams whose colimits define the values of `plus`. -/
@[simps]
def diagramNatTrans {P Q : Cᵒᵖ ⥤ D} (η : P ⟶ Q) (X : C) : J.diagram P X ⟶ J.diagram Q X

(J : CategoryTheory.GrothendieckTopology C)

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

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

(J.diagramNatTrans η X).app W =
  CategoryTheory.Limits.Multiequalizer.lift ((Opposite.unop W).index Q) ((J.diagram P X).obj W)
    (fun i =>
      CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.Multiequalizer.ι ((Opposite.unop W).index P) i)
        (η.app (Opposite.op i.Y)))
    ⋯


theorem biSup_add {ι} {s : Set ι} (hs : s.Nonempty) {f : ι → ℝ≥0∞} :
    (⨆ i ∈ s, f i) + a = ⨆ i ∈ s, f i + a

{a : ℝ≥0∞}
{ι : Type u_4}
{s : Set ι}
(hs : s.Nonempty)
{f : ι → ℝ≥0∞}


@[simp]
theorem toAlgHom_eq_coe (f : A →A[R] B) : f.toAlgHom = f

{R : Type u_1}
[CommSemiring R]
{A : Type u_2}
[Semiring A]
[TopologicalSpace A]
{B : Type u_3}
[Semiring B]
[TopologicalSpace B]
[Algebra R A]
[Algebra R B]
(f : A →A[R] B)


protected theorem map_smul (f : X →[M'] Y) (m : M') (x : X) : f (m • x) = m • f x

{M' : Type u_1}
{X : Type u_5}
[SMul M' X]
{Y : Type u_6}
[SMul M' Y]
(f : X →ₑ[id] Y)
(m : M')
(x : X)


lemma charmatrix_fromBlocks :
    charmatrix (fromBlocks M₁₁ M₁₂ M₂₁ M₂₂) =
      fromBlocks (charmatrix M₁₁) (- M₁₂.map C) (- M₂₁.map C) (charmatrix M₂₂)

{R : Type u_1}
[CommRing R]
{m : Type u_3}
{n : Type u_4}
[DecidableEq m]
[DecidableEq n]
[Fintype m]
[Fintype n]
(M₁₁ : Matrix m m R)
(M₁₂ : Matrix m n R)
(M₂₁ : Matrix n m R)
(M₂₂ : Matrix n n R)

(Matrix.fromBlocks M₁₁ M₁₂ M₂₁ M₂₂).charmatrix =
  Matrix.fromBlocks M₁₁.charmatrix (-M₁₂.map ⇑Polynomial.C) (-M₂₁.map ⇑Polynomial.C) M₂₂.charmatrix


theorem hasDerivAt_circleMap (c : ℂ) (R : ℝ) (θ : ℝ) :
    HasDerivAt (circleMap c R) (circleMap 0 R θ * I) θ

HasDerivAt (circleMap c R) (circleMap 0 R θ * Complex.I) θ


theorem Ideal.Quotient.norm_mk_le (r : R) : ‖Ideal.Quotient.mk I r‖ ≤ ‖r‖

{R : Type u_3}
[SeminormedCommRing R]
(I : Ideal R)
(r : R)


@[simp]
theorem coe_refl : ⇑(refl : A ≃⋆ₐ[R] A) = id

{R : Type u_2}
{A : Type u_3}
[Add A]
[Mul A]
[SMul R A]
[Star A]


@[simp]
theorem antidiagonal_single (a : α) (n : ℕ) :
    antidiagonal (single a n) = (antidiagonal n).map
      (Function.Embedding.prodMap ⟨_, single_injective a⟩ ⟨_, single_injective a⟩)

{α : Type u}
[DecidableEq α]
(a : α)
(n : ℕ)

Finset.antidiagonal (Finsupp.single a n) =
  Finset.map ({ toFun := Finsupp.single a, inj' := ⋯ }.prodMap { toFun := Finsupp.single a, inj' := ⋯ })
    (Finset.antidiagonal n)


/-- The obvious homotopy between two equal morphisms of short complexes. -/
@[simps]
def ofEq (h : φ₁ = φ₂) : Homotopy φ₁ φ₂

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

(CategoryTheory.ShortComplex.Homotopy.ofEq h).h₀ = 0


theorem contMDiffAt_iff_contDiffAt {f : E → E'} {x : E} :
    ContMDiffAt 𝓘(𝕜, E) 𝓘(𝕜, E') n f x ↔ ContDiffAt 𝕜 n f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{n : ℕ∞}
{f : E → E'}
{x : E}


theorem nhds_eq_comap_uniformity' {x : α} : 𝓝 x = (𝓤 α).comap fun y => (y, x)

𝓝 x = Filter.comap (fun y => (y, x)) (𝓤 α)


/-- Let `s` be a closed set in a separable space. If the induced topology on `s` is discrete and `s`
has cardinality at least continuum, then the ambient space is not a normal space. -/
theorem IsClosed.not_normal_of_continuum_le_mk {s : Set X} (hs : IsClosed s) [DiscreteTopology s]
    (hmk : 𝔠 ≤ #s) : ¬NormalSpace X

{X : Type u}
[TopologicalSpace X]
[TopologicalSpace.SeparableSpace X]
{s : Set X}
(hs : IsClosed s)
[DiscreteTopology ↑s]
(hmk : 𝔠 ≤ #↑s)


@[simp]
theorem nodup_union [DecidableEq α] {s t : Multiset α} : Nodup (s ∪ t) ↔ Nodup s ∧ Nodup t

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


theorem age.nonempty : (L.age M).Nonempty

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


theorem w : forkMap P (S : Presieve X) ≫ firstMap P S = forkMap P S ≫ secondMap P S

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.Equalizer.forkMap P S.arrows)
    (CategoryTheory.Equalizer.Sieve.firstMap P S) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Equalizer.forkMap P S.arrows)
    (CategoryTheory.Equalizer.Sieve.secondMap P S)


theorem toMultiset_sum {f : ι → α →₀ ℕ} (s : Finset ι) :
    Finsupp.toMultiset (∑ i ∈ s, f i) = ∑ i ∈ s, Finsupp.toMultiset (f i)

{α : Type u_1}
{ι : Type u_3}
{f : ι → α →₀ ℕ}
(s : Finset ι)


protected theorem Surjective.right_cancellable (hf : Surjective f) {g₁ g₂ : β → γ} :
    g₁ ∘ f = g₂ ∘ f ↔ g₁ = g₂

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
{f : α → β}
(hf : Function.Surjective f)
{g₁ g₂ : β → γ}


@[to_additive (attr := simp)]
theorem coe_srange (f : M →ₙ* N) : (f.srange : Set N) = Set.range f

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
(f : M →ₙ* N)


@[simp]
lemma leftUnshift_add {n' a : ℤ} (γ₁ γ₂ : Cochain (K⟦a⟧) L n') (n : ℤ) (hn : n + a = n') :
    (γ₁ + γ₂).leftUnshift n hn = γ₁.leftUnshift n hn + γ₂.leftUnshift n hn

(γ₁ γ₂ : CochainComplex.HomComplex.Cochain ((CategoryTheory.shiftFunctor (CochainComplex C ℤ) a).obj K) L n')


theorem flip_isReduced : (flip u).IsReduced ↔ u.IsReduced


theorem blockDiagonal_apply (M : o → Matrix m n α) (ik jk) :
    blockDiagonal M ik jk = if ik.2 = jk.2 then M ik.2 ik.1 jk.1 else 0

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type u_12}
[DecidableEq o]
[Zero α]
(M : o → Matrix m n α)
(ik : m × o)
(jk : n × o)

Matrix.blockDiagonal M ik jk = if ik.2 = jk.2 then M ik.2 ik.1 jk.1 else 0


@[simp]
lemma leftHomologyMap_sub : leftHomologyMap (φ - φ') = leftHomologyMap φ - leftHomologyMap φ'

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

CategoryTheory.ShortComplex.leftHomologyMap (φ - φ') =
  CategoryTheory.ShortComplex.leftHomologyMap φ - CategoryTheory.ShortComplex.leftHomologyMap φ'


/-- The open sets of an open subscheme corresponds to the open sets containing in the subset. -/
@[simps!]
def opensRestrict :
    Scheme.Opens U ≃ { V : X.Opens // V ≤ U }

{X : AlgebraicGeometry.Scheme}
(U : X.Opens)

∀ (a : (↑U).Opens), ↑↑((AlgebraicGeometry.opensRestrict U) a) = ⇑U.ι.val.base '' ↑a


theorem isωSup_iff_isLUB {α : Type u} [Preorder α] {c : Chain α} {x : α} :
    IsωSup c x ↔ IsLUB (range c) x

{α : Type u}
[Preorder α]
{c : OmegaCompletePartialOrder.Chain α}
{x : α}

Scott.IsωSup c x ↔ IsLUB (Set.range ⇑c) x


theorem derivative_zero (n : ℕ) :
    Polynomial.derivative (bernsteinPolynomial R n 0) = -n * bernsteinPolynomial R (n - 1) 0

Polynomial.derivative (bernsteinPolynomial R n 0) = -↑n * bernsteinPolynomial R (n - 1) 0


@[norm_cast, simp]
theorem dist_cast (x y : ℚ) : dist (x : ℝ) y = dist x y


theorem max_assoc (a b c : α) : max (max a b) c = max a (max b c)

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


protected theorem hasFDerivWithinAt_aeval (x : 𝕜) :
    HasFDerivWithinAt (fun x => aeval x q) (smulRight (1 : 𝕜 →L[𝕜] 𝕜)
      (aeval x (derivative q))) s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{s : Set 𝕜}
{R : Type u_1}
[CommSemiring R]
[Algebra R 𝕜]
(q : R[X])
(x : 𝕜)

HasFDerivWithinAt (fun x => (Polynomial.aeval x) q)
  (ContinuousLinearMap.smulRight 1 ((Polynomial.aeval x) (Polynomial.derivative q))) s x


@[simp]
theorem IsInternal.ofBijective_coeLinearMap_of_ne (h : IsInternal A)
    {i j : ι} (hij : i ≠ j) (x : A i) :
    (LinearEquiv.ofBijective (coeLinearMap A) h).symm x j = 0

{R : Type u}
[Semiring R]
{ι : Type v}
[dec_ι : DecidableEq ι]
{M : Type u_1}
[AddCommMonoid M]
[Module R M]
{A : ι → Submodule R M}
(h : DirectSum.IsInternal A)
{i j : ι}
(hij : i ≠ j)
(x : ↥(A i))

((LinearEquiv.ofBijective (DirectSum.coeLinearMap A) h).symm ↑x) j = 0


lemma _root_.AddEquiv.finsuppUnique_symm {M : Type*} [AddZeroClass M] (d : M) :
    AddEquiv.finsuppUnique.symm d = single () d

{M : Type u_13}
[AddZeroClass M]
(d : M)

AddEquiv.finsuppUnique.symm d = Finsupp.single () d


@[simp, norm_cast]
theorem coe_natCast (n : ℕ) : ((n : α →ᵇ R) : α → R) = n

{α : Type u}
[TopologicalSpace α]
{R : Type u_2}
[SeminormedRing R]
(n : ℕ)


theorem isOpen_ne_top : IsOpen { a : ℝ≥0∞ | a ≠ ∞ }


@[to_additive]
theorem continuous_comp_left (f : ContinuousMonoidHom A B) :
    Continuous fun g : ContinuousMonoidHom B C => g.comp f

{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
[AddMonoid A]
[AddMonoid B]
[AddMonoid C]
[TopologicalSpace A]
[TopologicalSpace B]
[TopologicalSpace C]
(f : ContinuousAddMonoidHom A B)


@[to_additive (attr := simp)]
theorem one_prod_one [One β] : (1 : Filter α) ×ˢ (1 : Filter β) = 1

{α : Type u_2}
{β : Type u_3}
[One α]
[One β]


theorem degrees_monomial_eq (s : σ →₀ ℕ) (a : R) (ha : a ≠ 0) :
    degrees (monomial s a) = toMultiset s

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(s : σ →₀ ℕ)
(a : R)
(ha : a ≠ 0)

((MvPolynomial.monomial s) a).degrees = Finsupp.toMultiset s


theorem prod_apply {s : Set (α × β)} (hs : MeasurableSet s) :
    μ.prod ν s = ∫⁻ x, ν (Prod.mk x ⁻¹' s) ∂μ

{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{ν : MeasureTheory.Measure β}
[MeasureTheory.SFinite ν]
{s : Set (α × β)}
(hs : MeasurableSet s)

(μ.prod ν) s = ∫⁻ (x : α), ν (Prod.mk x ⁻¹' s) ∂μ


theorem pos_iff_nonempty {n : Nat} : 0 < n ↔ Nonempty (Fin n)


theorem NullMeasurableSet.image {β} [MeasurableSpace α] {mβ : MeasurableSpace β} (f : α → β)
    (μ : Measure β) (hfi : Injective f) (hf : ∀ s, MeasurableSet s → NullMeasurableSet (f '' s) μ)
    {s : Set α} (hs : NullMeasurableSet s (μ.comap f)) : NullMeasurableSet (f '' s) μ

(hf : ∀ (s : Set α), MeasurableSet s → MeasureTheory.NullMeasurableSet (f '' s) μ)

(hs : MeasureTheory.NullMeasurableSet s (MeasureTheory.Measure.comap f μ))


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

(P : CategoryTheory.Idempotents.Karoubi C)

(((CategoryTheory.Idempotents.functorExtension₂ C D).obj X).obj P).X = X.obj P.X


@[simp] lemma transGen_reflGen : TransGen (ReflGen r) = ReflTransGen r

Relation.TransGen (Relation.ReflGen r) = Relation.ReflTransGen r


@[to_additive]
theorem ball_div_one : ball 1 δ / s = thickening δ s⁻¹

{E : Type u_1}
[SeminormedCommGroup E]
(δ : ℝ)
(s : Set E)

Metric.ball 1 δ / s = Metric.thickening δ s⁻¹


@[to_additive (attr := simp)]
theorem mul_inv_cancel_left (a : αˣ) (b : α) : (a : α) * (↑a⁻¹ * b) = b

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


theorem inv_pos_lt_iff_one_lt_mul (ha : 0 < a) : a⁻¹ < b ↔ 1 < b * a

{α : Type u_2}
[LinearOrderedSemifield α]
{a b : α}
(ha : 0 < a)


theorem epi_of_epi_image {X Y : C} (f : X ⟶ Y) [HasImage f] [Epi (image.ι f)]
    [Epi (factorThruImage f)] : Epi f


/-- The bounded supremum of a family of commutative additive submonoids is equal to the range of
`DFinsupp.sumAddHom` composed with `DFinsupp.filter_add_monoid_hom`; that is, every element in the
bounded `iSup` can be produced from taking a finite number of non-zero elements from the `S i` that
satisfy `p i`, coercing them to `γ`, and summing them. -/
theorem biSup_eq_range_dfinsupp_lsum (p : ι → Prop) [DecidablePred p] (S : ι → Submodule R N) :
    ⨆ (i) (_ : p i), S i =
      LinearMap.range
        (LinearMap.comp
          (DFinsupp.lsum ℕ (M := fun i ↦ ↥(S i)) (fun i => (S i).subtype))
            (DFinsupp.filterLinearMap R _ p))

{ι : Type u_1}
{R : Type u_2}
{N : Type u_5}
[Semiring R]
[AddCommMonoid N]
[Module R N]
[DecidableEq ι]
(p : ι → Prop)
[DecidablePred p]
(S : ι → Submodule R N)

⨆ i, ⨆ (_ : p i), S i =
  LinearMap.range (((DFinsupp.lsum ℕ) fun i => (S i).subtype) ∘ₗ DFinsupp.filterLinearMap R (fun i => ↥(S i)) p)


@[to_additive (attr := simp)]
theorem length_of (x : α) : (of x).length = 1


lemma polynomial_ne_zero [Nontrivial R] : W.polynomial ≠ 0

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Affine R)
[Nontrivial R]


@[to_additive (attr := simp)]
theorem relindex_self : H.relindex H = 1

{G : Type u_1}
[Group G]
(H : Subgroup G)


/-- The `NormalWord` representing an element `g` of the group `G`, which is just the element `g`
itself. -/
@[simps]
def ofGroup (g : G) : NormalWord d

{d : HNNExtension.NormalWord.TransversalPair G A B}

(HNNExtension.NormalWord.ofGroup g).toList = []


theorem orElse_eq_lt (o₁ o₂) : orElse o₁ o₂ = lt ↔ o₁ = lt ∨ o₁ = eq ∧ o₂ = lt

o₁.orElse o₂ = Ordering.lt ↔ o₁ = Ordering.lt ∨ o₁ = Ordering.eq ∧ o₂ = Ordering.lt


@[reassoc (attr := simp)]
theorem coev_app_comp_pre_app (f : B ⟶ A) :
    (ihom.coev A).app X ≫ (pre f).app (A ⊗ X) = (ihom.coev B).app X ≫ (ihom B).map (f ▷ _)

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

CategoryTheory.CategoryStruct.comp ((CategoryTheory.ihom.coev A).app X)
    ((CategoryTheory.MonoidalClosed.pre f).app (CategoryTheory.MonoidalCategory.tensorObj A X)) =
  CategoryTheory.CategoryStruct.comp ((CategoryTheory.ihom.coev B).app X)
    ((CategoryTheory.ihom B).map (CategoryTheory.MonoidalCategory.whiskerRight f X))


/-- The non-units of the stalk at `x` of the sheaf of smooth functions from `M` to `𝕜`, considered
as a sheaf of commutative rings, are the functions whose values at `x` are zero. -/
theorem smoothSheafCommRing.nonunits_stalk (x : M) :
    nonunits ((smoothSheafCommRing IM 𝓘(𝕜) M 𝕜).presheaf.stalk x)
    = RingHom.ker (smoothSheafCommRing.eval IM 𝓘(𝕜) M 𝕜 x)

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
[CompleteSpace 𝕜]
{EM : Type u_1}
[NormedAddCommGroup EM]
[NormedSpace 𝕜 EM]
{HM : Type u_2}
[TopologicalSpace HM]
(IM : ModelWithCorners 𝕜 EM HM)
{M : Type u}
[TopologicalSpace M]
[ChartedSpace HM M]
(x : M)

nonunits ↑((smoothSheafCommRing IM 𝓘(𝕜, 𝕜) M 𝕜).presheaf.stalk x) =
  ↑(RingHom.ker (smoothSheafCommRing.eval IM 𝓘(𝕜, 𝕜) M 𝕜 x))


theorem nonempty_of_measure_ne_zero (h : μ s ≠ 0) : s.Nonempty

{α : Type u_1}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{s : Set α}
(h : μ s ≠ 0)


@[to_additive (attr := simp 1100)]
theorem smul_closedBall_one : x • closedBall (1 : E) δ = closedBall x δ

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

x +ᵥ Metric.closedBall 0 δ = Metric.closedBall x δ


/-- If `ringChar R = 2`, where `R` is a finite reduced commutative ring,
then every `a : R` is a square. -/
theorem isSquare_of_charTwo' {R : Type*} [Finite R] [CommRing R] [IsReduced R] [CharP R 2]
    (a : R) : IsSquare a

{R : Type u_1}
[Finite R]
[CommRing R]
[IsReduced R]
[CharP R 2]
(a : R)


@[to_additive]
theorem mem_inv_smul_set_iff : x ∈ a⁻¹ • A ↔ a • x ∈ A

{α : Type u_2}
{β : Type u_3}
[Group α]
[MulAction α β]
{A : Set β}
{a : α}
{x : β}

x ∈ a⁻¹ • A ↔ a • x ∈ A


theorem card_of_bijective {f : α → β} (hf : Bijective f) : card α = card β

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
{f : α → β}
(hf : Function.Bijective f)


theorem mulVec_transpose [Fintype m] (A : Matrix m n α) (x : m → α) : Aᵀ *ᵥ x = x ᵥ* A

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[NonUnitalCommSemiring α]
[Fintype m]
(A : Matrix m n α)
(x : m → α)


Polynomial.Chebyshev.U R 2 = 4 * Polynomial.X ^ 2 - 1


theorem StrictMono.isMax_of_apply (hf : StrictMono f) (ha : IsMax (f a)) : IsMax a

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
{a : α}
(hf : StrictMono f)
(ha : IsMax (f a))


/-- The Fourier integral converts right-translation into scalar multiplication by a phase factor. -/
theorem fourierIntegral_comp_add_right [MeasurableAdd V] (e : AddChar 𝕜 𝕊) (μ : Measure V)
    [μ.IsAddRightInvariant] (L : V →ₗ[𝕜] W →ₗ[𝕜] 𝕜) (f : V → E) (v₀ : V) :
    fourierIntegral e μ L (f ∘ fun v ↦ v + v₀) =
      fun w ↦ e (L v₀ w) • fourierIntegral e μ L f w

{𝕜 : Type u_1}
[CommRing 𝕜]
{V : Type u_2}
[AddCommGroup V]
[Module 𝕜 V]
[MeasurableSpace V]
{W : Type u_3}
[AddCommGroup W]
[Module 𝕜 W]
{E : Type u_4}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
[MeasurableAdd V]
(e : AddChar 𝕜 ↥𝕊)
(μ : MeasureTheory.Measure V)
[μ.IsAddRightInvariant]
(L : V →ₗ[𝕜] W →ₗ[𝕜] 𝕜)
(f : V → E)
(v₀ : V)

VectorFourier.fourierIntegral e μ L (f ∘ fun v => v + v₀) = fun w =>
  e ((L v₀) w) • VectorFourier.fourierIntegral e μ L f w


@[norm_cast] --Porting note (#10618): `simp` can prove it
theorem coe_prod {ι : Type*} [Fintype ι] (f : ι → S) : (↑(∏ i, f i) : L) = ∏ i, (f i : L)

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(S : IntermediateField K L)
{ι : Type u_4}
[Fintype ι]
(f : ι → ↥S)


theorem exists_ne_none {p : Option α → Prop} : (∃ x ≠ none, p x) ↔ (∃ x : α, p x)


@[simp]
theorem fromEdgeSet_univ : fromEdgeSet (Set.univ : Set (Sym2 V)) = ⊤


protected theorem ClosedEmbedding.nonLindelofSpace [NonLindelofSpace X] {f : X → Y}
    (hf : ClosedEmbedding f) : NonLindelofSpace Y

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
[NonLindelofSpace X]
{f : X → Y}
(hf : ClosedEmbedding f)


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

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


@[simp]
theorem pnatDen_one : (1 : ℚ).pnatDen = 1


@[simp] theorem lt_ofFin (x : BitVec n) (y : Fin (2^n)) :
  x < BitVec.ofFin y ↔ x.toFin < y

{n : Nat}
(x : BitVec n)
(y : Fin (2 ^ n))


theorem leftUnitor_naturality {M N : ModuleCat R} (f : M ⟶ N) :
    tensorHom (𝟙 (ModuleCat.of R R)) f ≫ (leftUnitor N).hom = (leftUnitor M).hom ≫ f

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

ModuleCat.MonoidalCategory.tensorHom (𝟙 (ModuleCat.of R R)) f ≫ (ModuleCat.MonoidalCategory.leftUnitor N).hom =
  (ModuleCat.MonoidalCategory.leftUnitor M).hom ≫ f


theorem map_erase [DecidableEq α] [DecidableEq β] (f : α → β) (hf : Function.Injective f) (x : α)
    (s : Multiset α) : (s.erase x).map f = (s.map f).erase (f x)

{α : Type u_1}
{β : Type v}
[DecidableEq α]
[DecidableEq β]
(f : α → β)
(hf : Function.Injective f)
(x : α)
(s : Multiset α)

Multiset.map f (s.erase x) = (Multiset.map f s).erase (f x)


theorem integrableOn_Icc_iff_integrableOn_Ioc :
    IntegrableOn f (Icc a b) μ ↔ IntegrableOn f (Ioc a b) μ

{α : Type u_1}
{E : Type u_3}
[MeasurableSpace α]
[NormedAddCommGroup E]
[PartialOrder α]
[MeasurableSingletonClass α]
{f : α → E}
{μ : MeasureTheory.Measure α}
{a b : α}
[MeasureTheory.NoAtoms μ]

MeasureTheory.IntegrableOn f (Set.Icc a b) μ ↔ MeasureTheory.IntegrableOn f (Set.Ioc a b) μ


lemma natDegree_minpolyDiv :
    natDegree (minpolyDiv R x) = natDegree (minpoly R x) - 1

{R : Type u_2}
{S : Type u_1}
[CommRing R]
[CommRing S]
[Algebra R S]
{x : S}

(minpolyDiv R x).natDegree = (minpoly R x).natDegree - 1


protected theorem image_eq_preimage (e : P₁ ≃ᵃL[k] P₂) (s : Set P₁) : e '' s = e.symm ⁻¹' s

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


theorem not_mem_support_iff (x : X) (a : FreeAbelianGroup X) : x ∉ a.support ↔ coeff x a = 0

{X : Type u_1}
(x : X)
(a : FreeAbelianGroup X)

x ∉ a.support ↔ (FreeAbelianGroup.coeff x) a = 0


@[to_additive (attr := simp)]
theorem MulHom.coe_copy {_ : Mul M} {_ : Mul N} (f : M →ₙ* N) (f' : M → N) (h : f' = f) :
    (f.copy f' h) = f'

∀ {x : Add M} {x_1 : Add N} (f : AddHom M N) (f' : M → N) (h : f' = ⇑f), ⇑(f.copy f' h) = f'


theorem exists_mul_pow_lt_factorial (a : ℕ) (c : ℕ) : ∃ n0, ∀ n ≥ n0, a * c ^ n < (n - 1)!


/-- If `A` is a family of enough low-degree polynomials over a finite semiring, there is a
pair of equal elements in `A`. -/
theorem exists_eq_polynomial [Semiring Fq] {d : ℕ} {m : ℕ} (hm : Fintype.card Fq ^ d ≤ m)
    (b : Fq[X]) (hb : natDegree b ≤ d) (A : Fin m.succ → Fq[X])
    (hA : ∀ i, degree (A i) < degree b) : ∃ i₀ i₁, i₀ ≠ i₁ ∧ A i₁ = A i₀

(hA : ∀ (i : Fin m.succ), (A i).degree < b.degree)


theorem snd_expSeries_of_smul_comm
    (x : tsze R M) (hx : MulOpposite.op x.fst • x.snd = x.fst • x.snd) (n : ℕ) :
    snd (expSeries 𝕜 (tsze R M) (n + 1) fun _ => x) = (expSeries 𝕜 R n fun _ => x.fst) • x.snd

((NormedSpace.expSeries 𝕜 (tsze R M) (n + 1)) fun x_1 => x).snd =
  ((NormedSpace.expSeries 𝕜 R n) fun x_1 => x.fst) • x.snd


theorem support_finRotate_of_le {n : ℕ} (h : 2 ≤ n) : support (finRotate n) = Finset.univ


/-- Prefunctors between two `SingleObj` quivers correspond to functions between the corresponding
arrows types.
-/
@[simps]
def toPrefunctor : (α → β) ≃ SingleObj α ⥤q SingleObj β

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

∀ {X Y : Quiver.SingleObj α} (a : α), (Quiver.SingleObj.toPrefunctor f).map a = f a


/-- The pdf of the exponential distribution integrates to 1 -/
@[simp]
lemma lintegral_exponentialPDF_eq_one {r : ℝ} (hr : 0 < r) : ∫⁻ x, exponentialPDF r x = 1

∫⁻ (x : ℝ), ProbabilityTheory.exponentialPDF r x = 1


lemma homMk_comp_homMk {X Y Z : C} (z₁ : W.LeftFraction X Y) (z₂ : W.LeftFraction Y Z)
    (z₃ : W.LeftFraction z₁.Y' z₂.Y') (h₃ : z₂.f ≫ z₃.s = z₁.s ≫ z₃.f) :
    homMk z₁ ≫ homMk z₂ = homMk (z₁.comp₀ z₂ z₃)

(h₃ : CategoryTheory.CategoryStruct.comp z₂.f z₃.s = CategoryTheory.CategoryStruct.comp z₁.s z₃.f)

CategoryTheory.CategoryStruct.comp (CategoryTheory.MorphismProperty.LeftFraction.Localization.homMk z₁)
    (CategoryTheory.MorphismProperty.LeftFraction.Localization.homMk z₂) =
  CategoryTheory.MorphismProperty.LeftFraction.Localization.homMk (z₁.comp₀ z₂ z₃)


@[simp, norm_cast]
theorem coe_pow (x : Ioc (0 : α) 1) (n : ℕ) : ↑(x ^ n) = ((x : α) ^ n)

{α : Type u_1}
[StrictOrderedSemiring α]
(x : ↑(Set.Ioc 0 1))
(n : ℕ)


@[to_additive (attr := simp)]
theorem ofList_toList (xs : FreeMonoid α) : ofList (toList xs) = xs

FreeAddMonoid.ofList (FreeAddMonoid.toList xs) = xs


/-- A version of `Pi.single_smul` for non-dependent functions. It is useful in cases where Lean
fails to apply `Pi.single_smul`. -/
theorem single_smul' {α β} [Monoid α] [AddMonoid β] [DistribMulAction α β] [DecidableEq I] (i : I)
    (r : α) (x : β) : single (f := fun _ => β) i (r • x) = r • single (f := fun _ => β) i x

{I : Type u}
{α : Type u_1}
{β : Type u_2}
[Monoid α]
[AddMonoid β]
[DistribMulAction α β]
[DecidableEq I]
(i : I)
(r : α)
(x : β)


theorem TopologicalSpace.IsTopologicalBasis.nhds_basis_closure {B : Set (Set X)}
    (hB : IsTopologicalBasis B) (x : X) :
    (𝓝 x).HasBasis (fun s : Set X => x ∈ s ∧ s ∈ B) closure

(hB : TopologicalSpace.IsTopologicalBasis B)

(𝓝 x).HasBasis (fun s => x ∈ s ∧ s ∈ B) closure


/-- If `R` and `A` have a bijective `algebraMap R A` and act identically on `M`,
then a basis for `M` as `R`-module is also a basis for `M` as `R'`-module. -/
@[simps! repr_apply_support_val repr_apply_toFun]
noncomputable def Basis.algebraMapCoeffs : Basis ι A M

(h : Function.Bijective ⇑(algebraMap R A))

∀ (a : M) (a_1 : ι), ((Basis.algebraMapCoeffs A b h).repr a) a_1 = (algebraMap R A) ((b.repr a) a_1)


theorem congr [IsSemisimpleModule R N] (e : M ≃ₗ[R] N) : IsSemisimpleModule R M

{R : Type u_2}
[Ring R]
{M : Type u_4}
[AddCommGroup M]
[Module R M]
{N : Type u_5}
[AddCommGroup N]
[Module R N]
[IsSemisimpleModule R N]
(e : M ≃ₗ[R] N)


theorem SetLike.Homogeneous.smul [CommSemiring S] [Semiring R] [Algebra S R] {A : ι → Submodule S R}
    {s : S} {r : R} (hr : SetLike.Homogeneous A r) : SetLike.Homogeneous A (s • r)

{ι : Type u_1}
{S : Type u_3}
{R : Type u_4}
[CommSemiring S]
[Semiring R]
[Algebra S R]
{A : ι → Submodule S R}
{s : S}
{r : R}
(hr : SetLike.Homogeneous A r)


lemma cases' ⦃a' b' : ActionCategory G X⦄ (f : a' ⟶ b') :
    ∃ (a b : X) (g : G) (ha : a' = a) (hb : b' = b) (hg : a = g⁻¹ • b),
      f = eqToHom (by rw [ha, hg]) ≫ homOfPair b g ≫ eqToHom (by rw [hb])

⦃a' b' : CategoryTheory.ActionCategory G X⦄

∃ a b g,
  ∃ (ha : a' = ⟨(), a⟩) (hb : b' = ⟨(), b⟩) (hg : a = g⁻¹ • b),
    f =
      CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom ⋯)
        (CategoryTheory.CategoryStruct.comp (CategoryTheory.ActionCategory.homOfPair b g) (CategoryTheory.eqToHom ⋯))


theorem setIntegral_congr_ae₀ (hs : NullMeasurableSet s μ) (h : ∀ᵐ x ∂μ, x ∈ s → f x = g x) :
    ∫ x in s, f x ∂μ = ∫ x in s, g x ∂μ

(hs : MeasureTheory.NullMeasurableSet s μ)

∫ (x : X) in s, f x ∂μ = ∫ (x : X) in s, g x ∂μ


/-- An orthogonal basis with respect to a right-separating bilinear map has no self-orthogonal
elements. -/
theorem IsOrthoᵢ.not_isOrtho_basis_self_of_separatingRight [Nontrivial R]
    {B : M →ₛₗ[I] M →ₛₗ[I'] M₁} {v : Basis n R M} (h : B.IsOrthoᵢ v) (hB : B.SeparatingRight)
    (i : n) : ¬B.IsOrtho (v i) (v i)

{R : Type u_1}
{M : Type u_5}
{M₁ : Type u_6}
{n : Type u_19}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup M₁]
[Module R M₁]
{I I' : R →+* R}
[Nontrivial R]
{B : M →ₛₗ[I] M →ₛₗ[I'] M₁}
{v : Basis n R M}
(h : B.IsOrthoᵢ ⇑v)
(hB : B.SeparatingRight)
(i : n)


@[simp, norm_cast]
theorem coe_one : ↑(1 : Ioc (0 : α) 1) = (1 : α)

{α : Type u_1}
[StrictOrderedSemiring α]


theorem count_ne_zero [MeasurableSingletonClass α] (hs' : s.Nonempty) : count s ≠ 0

{α : Type u_1}
[MeasurableSpace α]
{s : Set α}
[MeasurableSingletonClass α]
(hs' : s.Nonempty)


theorem pred_lt_pred_iff_of_not_isMin (ha : ¬IsMin a) (hb : ¬IsMin b) :
    pred a < pred b ↔ a < b

{α : Type u_1}
[Preorder α]
[PredOrder α]
{a b : α}
(ha : ¬IsMin a)
(hb : ¬IsMin b)


protected theorem neg_mem {x : L} (hx : x ∈ S) : -x ∈ S

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(S : IntermediateField K L)
{x : L}
(hx : x ∈ S)


theorem DifferentiableWithinAt.norm_sq (hf : DifferentiableWithinAt ℝ f s x) :
    DifferentiableWithinAt ℝ (fun y => ‖f y‖ ^ 2) s x

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedSpace ℝ E]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{f : G → E}
{s : Set G}
{x : G}
(hf : DifferentiableWithinAt ℝ f s x)


@[simp]
theorem coe_trans (e₁ : P ≃ᵃⁱ[𝕜] P₂) (e₂ : P₂ ≃ᵃⁱ[𝕜] P₃) : ⇑(e₁.trans e₂) = e₂ ∘ e₁

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
{V₃ : Type u_6}
{P : Type u_10}
{P₂ : Type u_11}
{P₃ : Type u_12}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]
[SeminormedAddCommGroup V₃]
[NormedSpace 𝕜 V₃]
[PseudoMetricSpace P₃]
[NormedAddTorsor V₃ P₃]
(e₁ : P ≃ᵃⁱ[𝕜] P₂)
(e₂ : P₂ ≃ᵃⁱ[𝕜] P₃)


@[simp] theorem norm_exponent_zero (f : Lp E 0 μ) : ‖f‖ = 0

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
(f : ↥(MeasureTheory.Lp E 0 μ))


/-- A special case of the equivalence closure of an equivalence relation r equalling r. -/
theorem mapOfSurjective_eq_map (h : ker f ≤ r) (hf : Surjective f) :
    map r f = mapOfSurjective r f h hf

{α : Type u_1}
{β : Type u_2}
{r : Setoid α}
{f : α → β}
(h : Setoid.ker f ≤ r)
(hf : Function.Surjective f)


@[simp]
theorem cyclotomic_three (R : Type*) [Ring R] : cyclotomic 3 R = X ^ 2 + X + 1

Polynomial.cyclotomic 3 R = Polynomial.X ^ 2 + Polynomial.X + 1


protected theorem le_of_add_le_add_right {a b c : Int} (h : a + b ≤ c + b) : a ≤ c


/-- We construct the (candidate) limit of a functor `F : J ⥤ Mon_ C`
by interpreting it as a functor `Mon_ (J ⥤ C)`,
and noting that taking limits is a lax monoidal functor,
and hence sends monoid objects to monoid objects.
-/
@[simps!]
def limit (F : J ⥤ Mon_ C) : Mon_ C

(Mon_.limit F).X = CategoryTheory.Limits.limit (F ⋙ Mon_.forget C)


/-- If `n` is a natural number, then `ψ ^ n = mulShift ψ n`. -/
theorem pow_mulShift (ψ : AddChar R M) (n : ℕ) : ψ ^ n = mulShift ψ n

{R : Type u_1}
{M : Type u_2}
[Ring R]
[CommMonoid M]
(ψ : AddChar R M)
(n : ℕ)


theorem unitization_range : (unitization s).range = Algebra.adjoin R (s : Set A)

{R : Type u_1}
{S : Type u_2}
{A : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[SetLike S A]
[hSA : NonUnitalSubsemiringClass S A]
[hSRA : SMulMemClass S R A]
(s : S)

(NonUnitalSubalgebra.unitization s).range = Algebra.adjoin R ↑s


theorem isConnected_Ioo (h : a < b) : IsConnected (Ioo a b)

{α : Type u}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[DenselyOrdered α]
{a b : α}
(h : a < b)


/-- If `l ≥ Filter.cofinite` is a countably generated filter, then `l.ker` is cocountable. -/
theorem countable_compl_ker [l.IsCountablyGenerated] (h : cofinite ≤ l) : Set.Countable l.kerᶜ

{α : Type u_2}
{l : Filter α}
[l.IsCountablyGenerated]
(h : Filter.cofinite ≤ l)


@[simp] lemma odd_neg : Odd (-a) ↔ Odd a


@[simp]
theorem isoApp_refl (X : ∀ i, C i) (i : I) : isoApp (Iso.refl X) i = Iso.refl (X i)

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

CategoryTheory.Pi.isoApp (CategoryTheory.Iso.refl X) i = CategoryTheory.Iso.refl (X i)


/-- A multiplicative isomorphism preserves multiplication. -/
@[to_additive "An additive isomorphism preserves addition."]
protected theorem map_mul (f : M ≃* N) : ∀ x y, f (x * y) = f x * f y

{M : Type u_6}
{N : Type u_7}
[Mul M]
[Mul N]
(f : M ≃* N)
(x y : M)


theorem inter_inter_inter_comm (s t u v : Finset α) : s ∩ t ∩ (u ∩ v) = s ∩ u ∩ (t ∩ v)

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


/-- Naturally isomorphic endofunctors give equivalent categories of algebras.
Furthermore, they are equivalent as categories over `C`, that is,
we have `equiv_of_nat_iso h ⋙ forget = forget`.
-/
@[simps]
def equivOfNatIso {F G : C ⥤ C} (α : F ≅ G) : Algebra F ≌ Algebra G

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{F G : CategoryTheory.Functor C C}
(α : F ≅ G)

(CategoryTheory.Endofunctor.Algebra.equivOfNatIso α).unitIso =
  CategoryTheory.Endofunctor.Algebra.functorOfNatTransId.symm ≪≫
    CategoryTheory.Endofunctor.Algebra.functorOfNatTransEq ⋯ ≪≫
      CategoryTheory.Endofunctor.Algebra.functorOfNatTransComp α.hom α.inv


/-- `e.symm` is a left inverse of `e`, written as `e.symm (e y) = y`. -/
@[to_additive (attr := simp) "`e.symm` is a left inverse of `e`, written as `e.symm (e y) = y`."]
theorem symm_apply_apply (e : M ≃* N) (x : M) : e.symm (e x) = x

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


@[simp]
theorem rightAngleRotation_symm :
    LinearIsometryEquiv.symm J = LinearIsometryEquiv.trans J (LinearIsometryEquiv.neg ℝ)

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

o.rightAngleRotation.symm = o.rightAngleRotation.trans (LinearIsometryEquiv.neg ℝ)


@[to_additive (attr := simp, norm_cast)]
theorem coe_lt_coe : (p : E → ℝ) < q ↔ p < q

{E : Type u_4}
[AddGroup E]
{p q : AddGroupSeminorm E}


@[to_additive]
protected lemma inv_mul_eq_iff_eq_mul (h : IsUnit a) : a⁻¹ * b = c ↔ b = a * c

{α : Type u}
[DivisionMonoid α]
{a b c : α}
(h : IsUnit a)


@[to_additive]
theorem epic_of_localizationMap {j k : N →* P} (h : ∀ a, j.comp f.toMap a = k.comp f.toMap a) :
    j = k

(h : ∀ (a : M), (j.comp f.toMap) a = (k.comp f.toMap) a)


/-- Restriction of a semigroup hom to a subsemigroup of the codomain. -/
@[to_additive (attr := simps)
  "Restriction of an `AddSemigroup` hom to an `AddSubsemigroup` of the codomain."]
def codRestrict [SetLike σ N] [MulMemClass σ N] (f : M →ₙ* N) (S : σ) (h : ∀ x, f x ∈ S) :
    M →ₙ* S

{M : Type u_1}
{N : Type u_2}
{σ : Type u_4}
[Mul M]
[Mul N]
[SetLike σ N]
[MulMemClass σ N]
(f : M →ₙ* N)
(S : σ)
(h : ∀ (x : M), f x ∈ S)
(n : M)


@[to_additive]
theorem prod_filter_of_ne {p : α → Prop} [DecidablePred p] (hp : ∀ x ∈ s, f x ≠ 1 → p x) :
    ∏ x ∈ s.filter p, f x = ∏ x ∈ s, f x

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
{f : α → β}
[AddCommMonoid β]
{p : α → Prop}
[DecidablePred p]
(hp : ∀ x ∈ s, f x ≠ 0 → p x)

∑ x ∈ Finset.filter p s, f x = ∑ x ∈ s, f x


theorem bit_zero (b : Bool) : (b :: zero b) = zero b


theorem evalFacProp {l : Products I} (J : I → Prop)
    (h : ∀ a, a ∈ l.val → J a) [∀ j, Decidable (J j)] :
    l.eval (π C J) ∘ ProjRestrict C J = l.eval C

{l : Profinite.NobelingProof.Products I}

⇑(Profinite.NobelingProof.Products.eval (Profinite.NobelingProof.π C J) l) ∘ Profinite.NobelingProof.ProjRestrict C J =
  ⇑(Profinite.NobelingProof.Products.eval C l)


theorem exists_irreducible_of_natDegree_ne_zero {R : Type u} [CommRing R] [IsDomain R]
    [WfDvdMonoid R] {f : R[X]} (hf : f.natDegree ≠ 0) : ∃ g, Irreducible g ∧ g ∣ f


@[to_additive (attr := simp)]
theorem smul_filter_neBot_iff : (a • f).NeBot ↔ f.NeBot

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


theorem openEmbedding {X : TopCat.{u}} (U : Opens X) : OpenEmbedding (inclusion U)

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


theorem comp_assoc (r : FormalMultilinearSeries 𝕜 G H) (q : FormalMultilinearSeries 𝕜 F G)
    (p : FormalMultilinearSeries 𝕜 E F) : (r.comp q).comp p = r.comp (q.comp p)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
{G : Type u_4}
{H : Type u_5}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
[NormedAddCommGroup H]
[NormedSpace 𝕜 H]
(r : FormalMultilinearSeries 𝕜 G H)
(q : FormalMultilinearSeries 𝕜 F G)
(p : FormalMultilinearSeries 𝕜 E F)


/-- Restrict the codomain of a multilinear map to a submodule.

This is the multilinear version of `LinearMap.codRestrict`. -/
@[simps]
def codRestrict (f : MultilinearMap R M₁ M₂) (p : Submodule R M₂) (h : ∀ v, f v ∈ p) :
    MultilinearMap R M₁ p

{R : Type uR}
{ι : Type uι}
{M₁ : ι → Type v₁}
{M₂ : Type v₂}
[Semiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
(f : MultilinearMap R M₁ M₂)
(p : Submodule R M₂)
(h : ∀ (v : (i : ι) → M₁ i), f v ∈ p)
(v : (i : ι) → M₁ i)


theorem iInter_mono {s t : ι → Set α} (h : ∀ i, s i ⊆ t i) : ⋂ i, s i ⊆ ⋂ i, t i

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


/-- Composition in the "underlying" category of an enriched category. -/
@[simp]
theorem forgetEnrichment_comp {X Y Z : ForgetEnrichment W C} (f : X ⟶ Y) (g : Y ⟶ Z) :
    ForgetEnrichment.homTo W (f ≫ g) =
      ((λ_ (𝟙_ W)).inv ≫ (ForgetEnrichment.homTo W f ⊗ ForgetEnrichment.homTo W g)) ≫
        eComp W _ _ _

{X Y Z : CategoryTheory.ForgetEnrichment W C}

CategoryTheory.ForgetEnrichment.homTo W (CategoryTheory.CategoryStruct.comp f g) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.leftUnitor (𝟙_ W)).inv
      (CategoryTheory.MonoidalCategory.tensorHom (CategoryTheory.ForgetEnrichment.homTo W f)
        (CategoryTheory.ForgetEnrichment.homTo W g)))
    (CategoryTheory.eComp W (CategoryTheory.ForgetEnrichment.to W X) (CategoryTheory.ForgetEnrichment.to W Y)
      (CategoryTheory.ForgetEnrichment.to W Z))


theorem bot_mem [OrderBot α] (s : Flag α) : (⊥ : α) ∈ s

{α : Type u_1}
[LE α]
[OrderBot α]
(s : Flag α)


/--
If there exists an injective, multiplication-preserving map from `G` to `H`,
then the exponent of `G` divides the exponent of `H`.
-/
@[to_additive "If there exists an injective, addition-preserving map from `G` to `H`,
then the exponent of `G` divides the exponent of `H`."]
theorem exponent_dvd_of_monoidHom (e : G →* H) (e_inj : Function.Injective e) :
    Monoid.exponent G ∣ Monoid.exponent H

{G : Type u}
[AddMonoid G]
{H : Type u_1}
[AddMonoid H]
(e : G →+ H)
(e_inj : Function.Injective ⇑e)

AddMonoid.exponent G ∣ AddMonoid.exponent H


/-- If `R` is a ring, then prime ideals in the localization at `M`
correspond to prime ideals in the original ring `R` that are disjoint from `M`.
This lemma gives the particular case for an ideal and its comap,
see `le_rel_iso_of_prime` for the more general relation isomorphism -/
theorem isPrime_iff_isPrime_disjoint (J : Ideal S) :
    J.IsPrime ↔
      (Ideal.comap (algebraMap R S) J).IsPrime ∧
        Disjoint (M : Set R) ↑(Ideal.comap (algebraMap R S) J)

{R : Type u_1}
[CommSemiring R]
(M : Submonoid R)
(S : Type u_2)
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
(J : Ideal S)

J.IsPrime ↔ (Ideal.comap (algebraMap R S) J).IsPrime ∧ Disjoint ↑M ↑(Ideal.comap (algebraMap R S) J)