@[measurability]
theorem measurable_apply' [MeasurableSpace E] [OpensMeasurableSpace E] [MeasurableSpace F]
    [BorelSpace F] : Measurable fun (x : E) (f : E →L[𝕜] F) => f x

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[MeasurableSpace E]
[OpensMeasurableSpace E]
[MeasurableSpace F]
[BorelSpace F]


@[to_additive]
theorem Nonempty.of_div_left : (s / t).Nonempty → s.Nonempty

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


/-- Given two subgraphs, one a subgraph of the other, there is an induced injective homomorphism of
the subgraphs as graphs. -/
@[simps]
def inclusion {x y : Subgraph G} (h : x ≤ y) : x.coe →g y.coe

{V : Type u}
{G : SimpleGraph V}
{x y : G.Subgraph}
(h : x ≤ y)
(v : ↑x.verts)

↑((SimpleGraph.Subgraph.inclusion h) v) = ↑v


theorem list_append : Primrec₂ ((· ++ ·) : List α → List α → List α)


/-- A function `f` grows to `+∞` independent of an order-preserving embedding `e`. -/
theorem tendsto_atTop_atTop [Nonempty α] [SemilatticeSup α] [Preorder β] {f : α → β} :
    Tendsto f atTop atTop ↔ ∀ b : β, ∃ i : α, ∀ a : α, i ≤ a → b ≤ f a

{α : Type u_3}
{β : Type u_4}
[Nonempty α]
[SemilatticeSup α]
[Preorder β]
{f : α → β}

Filter.Tendsto f Filter.atTop Filter.atTop ↔ ∀ (b : β), ∃ i, ∀ (a : α), i ≤ a → b ≤ f a


theorem rootMultiplicity_X_sub_C [Nontrivial R] [DecidableEq R] {x y : R} :
    rootMultiplicity x (X - C y) = if x = y then 1 else 0

{R : Type u}
[CommRing R]
[Nontrivial R]
[DecidableEq R]
{x y : R}

Polynomial.rootMultiplicity x (Polynomial.X - Polynomial.C y) = if x = y then 1 else 0


/-- The nilpotency class of a non-trivial group is one more than its quotient by the center -/
theorem nilpotencyClass_eq_quotient_center_plus_one [hH : IsNilpotent G] [Nontrivial G] :
    Group.nilpotencyClass G = Group.nilpotencyClass (G ⧸ center G) + 1

{G : Type u_1}
[Group G]
[hH : Group.IsNilpotent G]
[Nontrivial G]

Group.nilpotencyClass G = Group.nilpotencyClass (G ⧸ Subgroup.center G) + 1


/-- **Maximum modulus principle** on a closed ball. Suppose that a function `f : E → F` from a
normed complex space to a strictly convex normed complex space has the following properties:

- it is continuous on a closed ball `Metric.closedBall z r`,
- it is complex differentiable on the corresponding open ball;
- the norm `‖f w‖` takes its maximum value on the open ball at its center.

Then `f` is a constant on the closed ball.  -/
theorem eqOn_closedBall_of_isMaxOn_norm {f : E → F} {z : E} {r : ℝ}
    (hd : DiffContOnCl ℂ f (ball z r)) (hz : IsMaxOn (norm ∘ f) (ball z r) z) :
    EqOn f (const E (f z)) (closedBall z r)

(hd : DiffContOnCl ℂ f (Metric.ball z r))

(hz : IsMaxOn (norm ∘ f) (Metric.ball z r) z)

Set.EqOn f (Function.const E (f z)) (Metric.closedBall z r)


theorem divX_eq_zero_iff : divX p = 0 ↔ p = C (p.coeff 0)

p.divX = 0 ↔ p = Polynomial.C (p.coeff 0)


@[simp] lemma zero_mem_center : (0 : M₀) ∈ center M₀


@[simp]
theorem map_id (l : Language α) : map id l = l


theorem le_of_le_of_eq {α} [OrderedSemiring α] {a b : α} (ha : a ≤ 0) (hb : b = 0) : a + b ≤ 0

{α : Type u_1}
[OrderedSemiring α]
{a b : α}
(ha : a ≤ 0)
(hb : b = 0)


theorem map_comm {f₁ : α → β} {f₂ : α → γ} {g₁ : β → δ} {g₂ : γ → δ}
    (h : g₁ ∘ f₁ = g₂ ∘ f₂) (a : α) : map g₁ (map f₁ a) = map g₂ (map f₂ a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{f₁ : α → β}
{f₂ : α → γ}
{g₁ : β → δ}
{g₂ : γ → δ}
(h : g₁ ∘ f₁ = g₂ ∘ f₂)
(a : α)

WithTop.map g₁ (WithTop.map f₁ ↑a) = WithTop.map g₂ (WithTop.map f₂ ↑a)


theorem minpoly_powerBasis_gen (hf : f ≠ 0) :
    minpoly K (powerBasis hf).gen = f * C f.leadingCoeff⁻¹

{K : Type w}
[Field K]
{f : K[X]}
(hf : f ≠ 0)

minpoly K (AdjoinRoot.powerBasis hf).gen = f * Polynomial.C f.leadingCoeff⁻¹


theorem sdiff_eq_comm (hy : y ≤ x) (hz : z ≤ x) : x \ y = z ↔ x \ z = y

{α : Type u}
{x y z : α}
[GeneralizedBooleanAlgebra α]
(hy : y ≤ x)
(hz : z ≤ x)


lemma posFittingComp_map_incl_sup_of_codisjoint [IsNoetherian R M] [IsArtinian R M]
    {N₁ N₂ : LieSubmodule R L M} (h : Codisjoint N₁ N₂) :
    (posFittingComp R L N₁).map N₁.incl ⊔ (posFittingComp R L N₂).map N₂.incl =
    posFittingComp R L M

{R : Type u_2}
{L : Type u_3}
{M : Type u_4}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsNilpotent R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[IsNoetherian R M]
[IsArtinian R M]
{N₁ N₂ : LieSubmodule R L M}
(h : Codisjoint N₁ N₂)

LieSubmodule.map N₁.incl (LieModule.posFittingComp R L ↥↑N₁) ⊔
    LieSubmodule.map N₂.incl (LieModule.posFittingComp R L ↥↑N₂) =
  LieModule.posFittingComp R L M


theorem Icc_mem_nhdsWithin_Ioi {a b c : α} (H : b ∈ Ico a c) : Icc a c ∈ 𝓝[>] b

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIciTopology α]
{a b c : α}
(H : b ∈ Set.Ico a c)


/-- A biproduct over an index type with exactly one term is just the object over that term. -/
@[simps!]
def biproductUniqueIso : ⨁ f ≅ f default

(CategoryTheory.Limits.biproductUniqueIso f).hom =
  CategoryTheory.Limits.biproduct.desc (CategoryTheory.Limits.limitBiconeOfUnique f).bicone.ι


theorem tendsto_partialGamma {s : ℂ} (hs : 0 < s.re) :
    Tendsto (fun X : ℝ => partialGamma s X) atTop (𝓝 <| GammaIntegral s)

Filter.Tendsto (fun X => s.partialGamma X) Filter.atTop (𝓝 s.GammaIntegral)


/-- The categorical equivalence between `C` and `ULift C`. -/
@[simps]
def ULift.equivalence : C ≌ ULift.{u₂} C

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

CategoryTheory.ULift.equivalence.counitIso.inv.app X =
  CategoryTheory.CategoryStruct.id ((CategoryTheory.Functor.id (ULift.{u₂, u₁} C)).obj X)


theorem cmpLT.trans_r {cmp x y} (H : cmpLT cmp x y) {a : RBNode α}
    (h : a.All (cmpLT cmp · x)) : a.All (cmpLT cmp · y)

(h : Batteries.RBNode.All (fun x_1 => Batteries.RBNode.cmpLT cmp x_1 x) a)

Batteries.RBNode.All (fun x => Batteries.RBNode.cmpLT cmp x y) a


@[simp]
theorem _root_.LinearIsometryEquiv.piLpCongrLeft_apply (e : ι ≃ ι') (v : PiLp p fun _ : ι => E) :
    LinearIsometryEquiv.piLpCongrLeft p 𝕜 E e v = Equiv.piCongrLeft' (fun _ : ι => E) e v

{p : ℝ≥0∞}
{𝕜 : Type u_1}
{ι : Type u_2}
[Fact (1 ≤ p)]
[Fintype ι]
[Semiring 𝕜]
{ι' : Type u_5}
[Fintype ι']
{E : Type u_6}
[SeminormedAddCommGroup E]
[Module 𝕜 E]
(e : ι ≃ ι')
(v : PiLp p fun x => E)

(LinearIsometryEquiv.piLpCongrLeft p 𝕜 E e) v = (Equiv.piCongrLeft' (fun x => E) e) v


theorem card_aux₂ (hP : P.IsEquipartition) (hu : u ∈ P.parts)
    (hucard : ¬u.card = m * 4 ^ P.parts.card + a) :
    (4 ^ P.parts.card - (a + 1)) * m + (a + 1) * (m + 1) = u.card


theorem gauge_norm_smul (hs : Balanced 𝕜 s) (r : 𝕜) (x : E) :
    gauge s (‖r‖ • x) = gauge s (r • x)

{𝕜 : Type u_1}
{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
[RCLike 𝕜]
[Module 𝕜 E]
[IsScalarTower ℝ 𝕜 E]
(hs : Balanced 𝕜 s)
(r : 𝕜)
(x : E)


theorem commute_X (p : R[X]) : Commute X p


theorem sum_option_index_smul [Semiring R] [AddCommMonoid M] [Module R M] (f : Option α →₀ R)
    (b : Option α → M) :
    (f.sum fun o r => r • b o) = f none • b none + f.some.sum fun a r => r • b (Option.some a)

{α : Type u_1}
{M : Type u_5}
{R : Type u_11}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(f : Option α →₀ R)
(b : Option α → M)

(f.sum fun o r => r • b o) = f none • b none + f.some.sum fun a r => r • b (some a)


/-- A complex measure is said to `HaveLebesgueDecomposition` with respect to a positive measure
if both its real and imaginary part `HaveLebesgueDecomposition` with respect to that measure. -/
class HaveLebesgueDecomposition (c : ComplexMeasure α) (μ : Measure α) : Prop where
  rePart : c.re.HaveLebesgueDecomposition μ
  imPart : c.im.HaveLebesgueDecomposition μ

{α : Type u_1}
{m : MeasurableSpace α}
{c : MeasureTheory.ComplexMeasure α}
{μ : MeasureTheory.Measure α}
[self : c.HaveLebesgueDecomposition μ]


theorem not_injective_iff : ¬ Injective f ↔ ∃ a b, f a = f b ∧ a ≠ b

{α : Sort u_1}
{β : Sort u_2}
{f : α → β}

¬Function.Injective f ↔ ∃ a b, f a = f b ∧ a ≠ b


protected theorem IsLocalMaxOn.closure (h : IsLocalMaxOn f s a) (hc : ContinuousOn f (closure s)) :
    IsLocalMaxOn f (closure s) a

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[Preorder Y]
[OrderClosedTopology Y]
{f : X → Y}
{s : Set X}
{a : X}
(h : IsLocalMaxOn f s a)
(hc : ContinuousOn f (closure s))


@[to_additive]
theorem comp_coprod {Q : Type*} [CommSemigroup Q] (h : P →ₙ* Q) (f : M →ₙ* P) (g : N →ₙ* P) :
    h.comp (f.coprod g) = (h.comp f).coprod (h.comp g)

{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[Mul M]
[Mul N]
[CommSemigroup P]
{Q : Type u_8}
[CommSemigroup Q]
(h : P →ₙ* Q)
(f : M →ₙ* P)
(g : N →ₙ* P)


@[simp]
theorem bihimp_left_inj : a ⇔ b = c ⇔ b ↔ a = c

{α : Type u_2}
[BooleanAlgebra α]
{a b c : α}


@[reassoc]
theorem rightUnitor_comp_inv (f : a ⟶ b) (g : b ⟶ c) :
    (ρ_ (f ≫ g)).inv = f ◁ (ρ_ g).inv ≫ (α_ f g (𝟙 c)).inv

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

(CategoryTheory.Bicategory.rightUnitor (CategoryTheory.CategoryStruct.comp f g)).inv =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.rightUnitor g).inv)
    (CategoryTheory.Bicategory.associator f g (CategoryTheory.CategoryStruct.id c)).inv


@[simp]
theorem fst_lineMap (p₀ p₁ : P1 × P2) (c : k) : (lineMap p₀ p₁ c).1 = lineMap p₀.1 p₁.1 c

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
{V2 : Type u_4}
{P2 : Type u_5}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
[AddCommGroup V2]
[Module k V2]
[AffineSpace V2 P2]
(p₀ p₁ : P1 × P2)
(c : k)

((AffineMap.lineMap p₀ p₁) c).1 = (AffineMap.lineMap p₀.1 p₁.1) c


@[reassoc (attr := simp)]
lemma rightHomologyIso_hom_comp_homologyι :
    S.rightHomologyIso.hom ≫ S.homologyι = S.rightHomologyι

CategoryTheory.CategoryStruct.comp S.rightHomologyIso.hom S.homologyι = S.rightHomologyι


/--
A functor `G : C ⥤ D` is locally full wrt a topology on `D` if for every `f : G.obj U ⟶ G.obj V`,
the set of `G.map fᵢ : G.obj Wᵢ ⟶ G.obj U` such that `G.map fᵢ ≫ f` is
in the image of `G` is a coverage of the topology on `D`.
-/
class IsLocallyFull : Prop where
  functorPushforward_imageSieve_mem : ∀ {U V} (f : G.obj U ⟶ G.obj V),
    (G.imageSieve f).functorPushforward G ∈ K _

{K : CategoryTheory.GrothendieckTopology D}

CategoryTheory.Sieve.functorPushforward G (G.imageSieve f) ∈ K.sieves (G.obj U)


theorem deriv_add_eq_mul_omega_add (a b : Ordinal.{u}) : deriv (a + ·) b = a * omega + b

Ordinal.deriv (fun x => a + x) b = a * Ordinal.omega + b


@[simp]
lemma sectionMap_freeMap_freeSection (i : I) :
    sectionsMap (freeMap (R := R) f) (freeSection i) = freeSection (f i)

{J : CategoryTheory.GrothendieckTopology C}

[J.HasSheafCompose (CategoryTheory.forget₂ RingCat AddCommGrp)]

∀ {J_1 : Type u} (f : I → J_1) (i : I),
  SheafOfModules.sectionsMap (SheafOfModules.freeMap f) (SheafOfModules.freeSection i) =
    SheafOfModules.freeSection (f i)


/-- If two functions agree a.e., then one is tight iff the other is tight. -/
theorem unifTight_congr_ae {g : ι → α → β} (hfg : ∀ n, f n =ᵐ[μ] g n) :
    UnifTight f p μ ↔ UnifTight g p μ

{α : Type u_1}
{β : Type u_2}
{ι : Type u_3}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
{f : ι → α → β}
{p : ENNReal}
{g : ι → α → β}
(hfg : ∀ (n : ι), f n =ᵐ[μ] g n)

MeasureTheory.UnifTight f p μ ↔ MeasureTheory.UnifTight g p μ


theorem mem_lift'_sets (hh : Monotone h) {s : Set β} : s ∈ f.lift' h ↔ ∃ t ∈ f, h t ⊆ s

{α : Type u_1}
{β : Type u_2}
{f : Filter α}
{h : Set α → Set β}
(hh : Monotone h)
{s : Set β}


@[to_additive]
theorem mem_inv : s ∈ f⁻¹ ↔ Inv.inv ⁻¹' s ∈ f

{α : Type u_2}
[Inv α]
{f : Filter α}
{s : Set α}


theorem of_algebraMap_smul [SMul R M] (h : ∀ (r : R) (x : M), algebraMap R A r • x = r • x) :
    IsScalarTower R A M

(h : ∀ (r : R) (x : M), (algebraMap R A) r • x = r • x)


@[simp]
theorem coe_curry_symm : ⇑(LinearEquiv.curry R V V₂).symm = uncurry

(R : Type u_1)
[Semiring R]
(V : Type u_18)
(V₂ : Type u_17)

⇑(LinearEquiv.curry R V V₂).symm = Function.uncurry


/-- Bundled monotone right-continuous real functions, used to construct Stieltjes measures. -/
structure StieltjesFunction where
  toFun : ℝ → ℝ
  mono' : Monotone toFun
  right_continuous' : ∀ x, ContinuousWithinAt toFun (Ici x) x

ContinuousWithinAt (↑self) (Set.Ici x) x


@[to_additive (attr := simp)]
theorem ker_id : (MonoidHom.id G).ker = ⊥


theorem mem_iInf {ι : Sort*} {S : ι → Subring R} {x : R} : (x ∈ ⨅ i, S i) ↔ ∀ i, x ∈ S i

{R : Type u}
[Ring R]
{ι : Sort u_1}
{S : ι → Subring R}
{x : R}


theorem eq_irreducibleComponent {x : X} :
    IsPreirreducible s → irreducibleComponent x ⊆ s → s = irreducibleComponent x

{X : Type u_1}
[TopologicalSpace X]
{s : Set X}
{x : X}


@[to_additive]
theorem le_nhds_mul (a b : M) : 𝓝 a * 𝓝 b ≤ 𝓝 (a * b)

{M : Type u_3}
[TopologicalSpace M]
[Add M]
[ContinuousAdd M]
(a b : M)


@[simp]
theorem preimage_sphere (h : α ≃ᵢ β) (x : β) (r : ℝ) :
    h ⁻¹' Metric.sphere x r = Metric.sphere (h.symm x) r

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
(h : α ≃ᵢ β)
(x : β)
(r : ℝ)

⇑h ⁻¹' Metric.sphere x r = Metric.sphere (h.symm x) r


/--
The forgetful functor from sheaves of modules over sheaf of ring `R` to sheaves of `R(X)`-module
when `X` is initial.
-/
@[simps]
noncomputable def forgetToSheafModuleCat
      (X : Cᵒᵖ) (hX : Limits.IsInitial X)  :
    SheafOfModules.{w} R ⥤ Sheaf J (ModuleCat.{w} (R.1.obj X))

(hX : CategoryTheory.Limits.IsInitial X)

((SheafOfModules.forgetToSheafModuleCat R X hX).obj M).val =
  (PresheafOfModules.forgetToPresheafModuleCat X hX).obj M.val


@[simp]
theorem flipₗᵢ_symm : (flipₗᵢ 𝕜 E Fₗ Gₗ).symm = flipₗᵢ 𝕜 Fₗ E Gₗ

{𝕜 : Type u_1}
{E : Type u_4}
{Fₗ : Type u_7}
{Gₗ : Type u_9}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup Fₗ]
[SeminormedAddCommGroup Gₗ]
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 Fₗ]
[NormedSpace 𝕜 Gₗ]

(ContinuousLinearMap.flipₗᵢ 𝕜 E Fₗ Gₗ).symm = ContinuousLinearMap.flipₗᵢ 𝕜 Fₗ E Gₗ


/-- If two sets intersect, the diameter of the union is bounded by the sum of the diameters. -/
theorem diam_union' {t : Set α} (h : (s ∩ t).Nonempty) : diam (s ∪ t) ≤ diam s + diam t

{α : Type u}
[PseudoMetricSpace α]
{s t : Set α}
(h : (s ∩ t).Nonempty)

Metric.diam (s ∪ t) ≤ Metric.diam s + Metric.diam t


/-- `f : α →+* β` doesn't map `1` to `0` if `β` is nontrivial -/
theorem map_one_ne_zero [Nontrivial β] : f 1 ≠ 0

∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β) [inst : Nontrivial β], f 1 ≠ 0


@[simp]
lemma Equivalence.quot_mk_eq_iff {α : Type*} {r : α → α → Prop} (h : Equivalence r) (x y : α) :
    Quot.mk r x = Quot.mk r y ↔ r x y

{α : Type u_3}
{r : α → α → Prop}
(h : Equivalence r)
(x y : α)


@[simp]
theorem coeff_C [DecidableEq σ] (m) (a) :
    coeff m (C a : MvPolynomial σ R) = if 0 = m then a else 0

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
[DecidableEq σ]
(m : σ →₀ ℕ)
(a : R)

MvPolynomial.coeff m (MvPolynomial.C a) = if 0 = m then a else 0


@[to_additive (attr := simp)]
lemma card_inv (s : Set α) : Nat.card ↥(s⁻¹) = Nat.card s

{α : Type u_2}
[InvolutiveNeg α]
(s : Set α)


@[mono]
theorem monotone_close {X : C} : Monotone (J₁.close : Sieve X → Sieve X)

(J₁ : CategoryTheory.GrothendieckTopology C)


@[simp]
theorem ContinuousMultilinearMap.curryLeft_norm (f : ContinuousMultilinearMap 𝕜 Ei G) :
    ‖f.curryLeft‖ = ‖f‖

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

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


@[simp]
theorem coe_abs (x : ℝ) : ((x : EReal).abs : EReal) = (|x| : ℝ)


theorem iSup_ι_range_eq_top : ⨆ i : ℕ, LinearMap.range (ι Q) ^ i = ⊤

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

⨆ i, LinearMap.range (CliffordAlgebra.ι Q) ^ i = ⊤


/-- If `dist (f n) (f (n+1))` is bounded by `C * r^n`, `r < 1`, then `f` is a Cauchy sequence.
Note that this lemma does not assume `0 ≤ C` or `0 ≤ r`. -/
theorem cauchySeq_of_le_geometric : CauchySeq f

(hu : ∀ (n : ℕ), dist (f n) (f (n + 1)) ≤ C * r ^ n)


/-- The mutual orthogonal complement of the eigenspaces of a self-adjoint operator on a
finite-dimensional inner product space is trivial. -/
theorem orthogonalComplement_iSup_eigenspaces_eq_bot : (⨆ μ, eigenspace T μ)ᗮ = ⊥

{𝕜 : Type u_1}
[RCLike 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{T : E →ₗ[𝕜] E}
(hT : T.IsSymmetric)
[FiniteDimensional 𝕜 E]


theorem prime_pow_le_iff_le_bcount [DecidableEq (Associates α)] {m p : Associates α}
    (h₁ : m ≠ 0) (h₂ : Irreducible p) {k : ℕ} : p ^ k ≤ m ↔ k ≤ bcount ⟨p, h₂⟩ m.factors

{α : Type u_1}
[CancelCommMonoidWithZero α]
[UniqueFactorizationMonoid α]
[DecidableEq (Associates α)]
{m p : Associates α}
(h₁ : m ≠ 0)
(h₂ : Irreducible p)
{k : ℕ}

p ^ k ≤ m ↔ k ≤ Associates.bcount ⟨p, h₂⟩ m.factors


lemma awayToSection_germ (f x) :
    awayToSection 𝒜 f ≫ (structureSheaf 𝒜).presheaf.germ x =
      (HomogeneousLocalization.mapId 𝒜 (Submonoid.powers_le.mpr x.2)) ≫
        (Proj.stalkIso' 𝒜 x).toCommRingCatIso.inv

(x : ↥(ProjectiveSpectrum.basicOpen 𝒜 f))

CategoryTheory.CategoryStruct.comp (AlgebraicGeometry.ProjectiveSpectrum.Proj.awayToSection 𝒜 f)
    ((AlgebraicGeometry.ProjectiveSpectrum.Proj.structureSheaf 𝒜).presheaf.germ x) =
  CategoryTheory.CategoryStruct.comp (HomogeneousLocalization.mapId 𝒜 ⋯)
    (AlgebraicGeometry.Proj.stalkIso' 𝒜 ↑x).toCommRingCatIso.inv


theorem exists_eq_const [PreconnectedSpace X] [Nonempty Y] {f : X → Y} (hf : IsLocallyConstant f) :
    ∃ y, f = Function.const X y

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


theorem getD_leftInvSeq_mul_wordProd (ω : List B) (j : ℕ) :
    ((lis ω).getD j 1) * π ω = π (ω.eraseIdx j)

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

(cs.leftInvSeq ω).getD j 1 * cs.wordProd ω = cs.wordProd (ω.eraseIdx j)


@[to_additive]
theorem image_finset_prod (f : F) (m : Finset ι) (s : ι → Set α) :
    ((f : α → β) '' ∏ i ∈ m, s i) = ∏ i ∈ m, f '' s i

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
{F : Type u_4}
[FunLike F α β]
[CommMonoid α]
[CommMonoid β]
[MonoidHomClass F α β]
(f : F)
(m : Finset ι)
(s : ι → Set α)


@[simp]
theorem coe_forget_to_bddOrd (X : BddLat) : ↥((forget₂ BddLat BddOrd).obj X) = ↥X

↑((CategoryTheory.forget₂ BddLat BddOrd).obj X).toPartOrd = ↑X.toLat


@[continuity]
theorem continuous_equiv_symm [∀ i, UniformSpace (β i)] :
    Continuous (WithLp.equiv p (∀ i, β i)).symm

(p : ℝ≥0∞)
{ι : Type u_2}
(β : ι → Type u_4)
[(i : ι) → UniformSpace (β i)]

Continuous ⇑(WithLp.equiv p ((i : ι) → β i)).symm


theorem le_suffixLevenshtein_append_minimum (xs : List α) (ys₁ ys₂) :
    (suffixLevenshtein C xs ys₂).1.minimum ≤ (suffixLevenshtein C xs (ys₁ ++ ys₂)).1.minimum

(↑(suffixLevenshtein C xs ys₂)).minimum ≤ (↑(suffixLevenshtein C xs (ys₁ ++ ys₂))).minimum


theorem chain_succ_range' : ∀ s n step : Nat,
    Chain (fun a b => b = a + step) s (range' (s + step) n step)

List.Chain (fun a b => b = a + step) s (List.range' (s + step) n step)


theorem card_edgeFinset_replaceVertex_of_not_adj (hn : ¬G.Adj s t) :
    (G.replaceVertex s t).edgeFinset.card = G.edgeFinset.card + G.degree s - G.degree t

{V : Type u_1}
[DecidableEq V]
(G : SimpleGraph V)
{s t : V}
[Fintype V]
[DecidableRel G.Adj]
(hn : ¬G.Adj s t)


theorem exists_of_ssubset {s t : Set α} (h : s ⊂ t) : ∃ x ∈ t, x ∉ s


@[simp]
protected theorem map_zero [Zero α] [Zero β] (f : α → β) (h : f 0 = 0) :
    (0 : Matrix m n α).map f = 0

{m : Type u_2}
{n : Type u_3}
{α : Type v}
{β : Type w}
[Zero α]
[Zero β]
(f : α → β)
(h : f 0 = 0)


protected theorem hasStrictFDerivAt :
    HasStrictFDerivAt φ.prodFun
      (φ.leftDeriv.equivProdOfSurjectiveOfIsCompl φ.rightDeriv φ.left_range φ.right_range
          φ.isCompl_ker :
        E →L[𝕜] F × G)
      φ.pt

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

HasStrictFDerivAt φ.prodFun (↑(φ.leftDeriv.equivProdOfSurjectiveOfIsCompl φ.rightDeriv ⋯ ⋯ ⋯)) φ.pt


@[simp]
theorem nhdsWithin_insert (a : α) (s : Set α) : 𝓝[insert a s] a = pure a ⊔ 𝓝[s] a

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


theorem ContinuousAt.tendsto (h : ContinuousAt f x) :
    Tendsto f (𝓝 x) (𝓝 (f x))

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
{x : X}
(h : ContinuousAt f x)


/-- `Int.natAbs` as a bundled monoid with zero hom. -/
@[simps]
def Int.natAbsHom : ℤ →*₀ ℕ


/--
the coercion from two-sided-ideals to sets is an order embedding
-/
@[simps]
def coeOrderEmbedding : TwoSidedIdeal R ↪o Set R

{R : Type u_1}
[NonUnitalNonAssocRing R]

∀ (a : TwoSidedIdeal R), TwoSidedIdeal.coeOrderEmbedding a = ↑a


@[to_additive]
theorem isClosed_setOf_map_inv [Inv G₁] [Inv G₂] [ContinuousInv G₂] :
    IsClosed { f : G₁ → G₂ | ∀ x, f x⁻¹ = (f x)⁻¹ }

(G₁ : Type u_2)
(G₂ : Type u_3)
[TopologicalSpace G₂]
[T2Space G₂]
[Inv G₁]
[Inv G₂]
[ContinuousInv G₂]

IsClosed {f | ∀ (x : G₁), f x⁻¹ = (f x)⁻¹}


@[simp]
theorem frobenius_norm_col (v : n → α) : ‖col ι v‖ = ‖(WithLp.equiv 2 _).symm v‖

{n : Type u_4}
{α : Type u_5}
{ι : Type u_7}
[Fintype n]
[Unique ι]
[SeminormedAddCommGroup α]
(v : n → α)

‖Matrix.col ι v‖ = ‖(WithLp.equiv 2 (n → α)).symm v‖


theorem smul_integral_comp_sub_mul (c d) :
    (c • ∫ x in a..b, f (d - c * x)) = ∫ x in d - c * b..d - c * a, f x

{E : Type u_3}
[NormedAddCommGroup E]
[CompleteSpace E]
[NormedSpace ℝ E]
{a b : ℝ}
(f : ℝ → E)
(c d : ℝ)

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


@[simp]
theorem fixedPoints_id : fixedPoints (@id α) = Set.univ


/-- One line is contained in another differing in the second point if the second point of the
first line is contained in the second line. -/
theorem affineSpan_pair_le_of_right_mem {p₁ p₂ p₃ : P} (h : p₁ ∈ line[k, p₂, p₃]) :
    line[k, p₂, p₁] ≤ line[k, p₂, p₃]

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{p₁ p₂ p₃ : P}
(h : p₁ ∈ affineSpan k {p₂, p₃})

affineSpan k {p₂, p₁} ≤ affineSpan k {p₂, p₃}


theorem setIndependent_iff_pairwiseDisjoint {s : Set α} :
    SetIndependent s ↔ s.PairwiseDisjoint id

{α : Type u_1}
[Order.Frame α]
{s : Set α}

CompleteLattice.SetIndependent s ↔ s.PairwiseDisjoint id


@[to_additive] lemma mulEnergy_comm (s t : Finset α) : Eₘ[s, t] = Eₘ[t, s]

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


theorem mul_mem_sup {S T : NonUnitalSubalgebra R A} {x y : A} (hx : x ∈ S) (hy : y ∈ T) :
    x * y ∈ S ⊔ T

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
{S T : NonUnitalSubalgebra R A}
{x y : A}
(hx : x ∈ S)
(hy : y ∈ T)


/-- The iterated derivative of the sum of two functions is the sum of the iterated derivatives.
This is the same as `iteratedFDerivWithin_add_apply`, but using the spelling `(fun x ↦ f x + g x)`
instead of `f + g`, which can be handy for some rewrites.
TODO: use one form consistently. -/
theorem iteratedFDerivWithin_add_apply' {f g : E → F} (hf : ContDiffOn 𝕜 i f s)
    (hg : ContDiffOn 𝕜 i g s) (hu : UniqueDiffOn 𝕜 s) (hx : x ∈ s) :
    iteratedFDerivWithin 𝕜 i (fun x => f x + g x) s x =
      iteratedFDerivWithin 𝕜 i f s x + iteratedFDerivWithin 𝕜 i g s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{x : E}
{i : ℕ}
{f g : E → F}
(hf : ContDiffOn 𝕜 (↑i) f s)
(hg : ContDiffOn 𝕜 (↑i) g s)
(hu : UniqueDiffOn 𝕜 s)
(hx : x ∈ s)


@[simp]
theorem coe_map (f : F) (s : NonUnitalSubring R) : (s.map f : Set S) = f '' s

{F : Type w}
{R : Type u}
{S : Type v}
[NonUnitalNonAssocRing R]
[NonUnitalNonAssocRing S]
[FunLike F R S]
[NonUnitalRingHomClass F R S]
(f : F)
(s : NonUnitalSubring R)


@[simp]
theorem mul_inv_of_invertible [Invertible A] : A * A⁻¹ = 1

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


@[simp]
theorem filter_dvd_eq_properDivisors (h : n ≠ 0) :
    (Finset.range n).filter (· ∣ n) = n.properDivisors

Finset.filter (fun x => x ∣ n) (Finset.range n) = n.properDivisors


theorem continuous_sup_rng_right {t₁ : TopologicalSpace α} {t₃ t₂ : TopologicalSpace β} :
    Continuous[t₁, t₃] f → Continuous[t₁, t₂ ⊔ t₃] f

{α : Type u}
{β : Type v}
{f : α → β}
{t₁ : TopologicalSpace α}
{t₃ t₂ : TopologicalSpace β}


protected theorem isField {A : Type*} (B : Type*) [Semiring A] [Semiring B] (hB : IsField B)
    (e : A ≃* B) : IsField A

{A : Type u_1}
(B : Type u_2)
[Semiring A]
[Semiring B]
(hB : IsField B)
(e : A ≃* B)


theorem testBit_two_pow_sub_succ (h₂ : x < 2 ^ n) (i : Nat) :
    testBit (2^n - (x + 1)) i = (decide (i < n) && ! testBit x i)

(2 ^ n - (x + 1)).testBit i = (decide (i < n) && !x.testBit i)


/-- The ordinal approximants of the least fixed point are stabilizing
  when reaching a fixed point of f -/
theorem gfpApprox_eq_of_mem_fixedPoints {a b : Ordinal} (h_init : f x ≤ x) (h_ab : a ≤ b)
    (h : gfpApprox f x a ∈ fixedPoints f) : gfpApprox f x b = gfpApprox f x a

(h : OrdinalApprox.gfpApprox f x a ∈ Function.fixedPoints ⇑f)

OrdinalApprox.gfpApprox f x b = OrdinalApprox.gfpApprox f x a


lemma kstar_def (l : Language α) : l∗ = {x | ∃ L : List (List α), x = L.join ∧ ∀ y ∈ L, y ∈ l}

l∗ = {x | ∃ L, x = L.join ∧ ∀ y ∈ L, y ∈ l}


@[ext]
lemma limitCone_pt_ext {x y : (limitCone F).pt}
    (w : (equivShrink F.sections).symm x = (equivShrink F.sections).symm y) : x = y

{x y : (CategoryTheory.Limits.Types.Small.limitCone F).pt}

(w : (equivShrink ↑F.sections).symm x = (equivShrink ↑F.sections).symm y)


theorem equiv_symm_toRingHom :
    (equiv i j p).symm.toRingHom = PerfectRing.lift j i p

{K : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing K]
[CommRing L]
[CommRing M]
(i : K →+* L)
(j : K →+* M)
(p : ℕ)
[ExpChar K p]
[ExpChar L p]
[ExpChar M p]
[PerfectRing L p]
[IsPerfectClosure i p]
[PerfectRing M p]
[IsPerfectClosure j p]

(IsPerfectClosure.equiv i j p).symm.toRingHom = PerfectRing.lift j i p


theorem subsingleton_short_example : ∀ x : PGame, Subsingleton (Short x)


lemma toNNRat_inv (q : ℚ) : toNNRat q⁻¹ = (toNNRat q)⁻¹


protected theorem add_right_cancel {n m k : Nat} (h : n + m = k + m) : n = k


theorem eq_zero_or_one_of_isField (hF : IsField R₁) (I : FractionalIdeal R₁⁰ K) : I = 0 ∨ I = 1

{R₁ : Type u_3}
{K : Type u_4}
[CommRing R₁]
[Field K]
[Algebra R₁ K]
[IsFractionRing R₁ K]
(hF : IsField R₁)
(I : FractionalIdeal R₁⁰ K)


/-- The set of natural number powers of an element of a monoid is closed under multiplication. -/
@[to_additive
      "The set of natural number multiples of an element of an `AddMonoid` is closed under
      addition."]
theorem powers.mul_mem {x y z : M} : y ∈ powers x → z ∈ powers x → y * z ∈ powers x

{M : Type u_1}
[AddMonoid M]
{x y z : M}

y ∈ multiples x → z ∈ multiples x → y + z ∈ multiples x


@[to_additive]
theorem nndist_eq_nnnorm_div (a b : E) : nndist a b = ‖a / b‖₊

{E : Type u_6}
[SeminormedGroup E]
(a b : E)


lemma scalarRTensor_apply_tmul_apply (p : MvPolynomial σ R) (n : N) (d : σ →₀ ℕ) :
    scalarRTensor (p ⊗ₜ[R] n) d = coeff d p • n

{R : Type u}
{N : Type w}
[CommSemiring R]
{σ : Type u_1}
[DecidableEq σ]
[AddCommMonoid N]
[Module R N]
(p : MvPolynomial σ R)
(n : N)
(d : σ →₀ ℕ)

(MvPolynomial.scalarRTensor (p ⊗ₜ[R] n)) d = MvPolynomial.coeff d p • n


@[to_additive]
theorem prod_of_support_subset (f : α →₀ M) {s : Finset α} (hs : f.support ⊆ s) (g : α → M → N)
    (h : ∀ i ∈ s, g i 0 = 1) : f.prod g = ∏ x ∈ s, g x (f x)

{α : Type u_1}
{M : Type u_8}
{N : Type u_10}
[Zero M]
[AddCommMonoid N]
(f : α →₀ M)
{s : Finset α}
(hs : f.support ⊆ s)
(g : α → M → N)
(h : ∀ i ∈ s, g i 0 = 0)


@[to_additive (attr := simp) mod_card_zsmul]
theorem zpow_mod_card (a : G) (n : ℤ) : a ^ (n % Fintype.card G : ℤ) = a ^ n

{G : Type u_1}
[AddGroup G]
[Fintype G]
(a : G)
(n : ℤ)


private theorem eps_le_card_star_div [Nonempty α] (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α)
    (hPε : ↑100 ≤ ↑4 ^ P.parts.card * ε ^ 5) (hε₁ : ε ≤ 1) (hU : U ∈ P.parts) (hV : V ∈ P.parts)
    (hUV : U ≠ V) (hunif : ¬G.IsUniform ε U V) :
    ↑4 / ↑5 * ε ≤ (star hP G ε hU V).card / ↑4 ^ P.parts.card

(hPα : P.parts.card * 16 ^ P.parts.card ≤ Fintype.card α)

4 / 5 * ε ≤ ↑(SzemerediRegularity.star hP G ε hU V).card / 4 ^ P.parts.card


theorem add_le_pair (m n : ℕ) : m + n ≤ pair m n


/-- Cauchy condensation test for antitone series of nonnegative real numbers. -/
theorem summable_condensed_iff_of_nonneg {f : ℕ → ℝ} (h_nonneg : ∀ n, 0 ≤ f n)
    (h_mono : ∀ ⦃m n⦄, 0 < m → m ≤ n → f n ≤ f m) :
    (Summable fun k : ℕ => (2 : ℝ) ^ k * f (2 ^ k)) ↔ Summable f

(h_mono : ∀ ⦃m n : ℕ⦄, 0 < m → m ≤ n → f n ≤ f m)

(Summable fun k => 2 ^ k * f (2 ^ k)) ↔ Summable f


theorem opNorm_eq_of_bounds {φ : E →SL[σ₁₂] F} {M : ℝ} (M_nonneg : 0 ≤ M)
    (h_above : ∀ x, ‖φ x‖ ≤ M * ‖x‖) (h_below : ∀ N ≥ 0, (∀ x, ‖φ x‖ ≤ N * ‖x‖) → M ≤ N) :
    ‖φ‖ = M

{σ₁₂ : 𝕜 →+* 𝕜₂}

(h_below : ∀ N ≥ 0, (∀ (x : E), ‖φ x‖ ≤ N * ‖x‖) → M ≤ N)


/-- A natural isomorphism between the functor `map (𝟭 C)` and `𝟭 (WithTerminal C)`. -/
@[simps!]
def mapId (C : Type*) [Category C] : map (𝟭 C) ≅ 𝟭 (WithTerminal C)

(C : Type u_1)
[CategoryTheory.Category.{u_2, u_1} C]
(X : CategoryTheory.WithTerminal C)

(CategoryTheory.WithTerminal.mapId C).inv.app X =
  (match X with
    | CategoryTheory.WithTerminal.of x => CategoryTheory.Iso.refl (CategoryTheory.WithTerminal.of x)
    | CategoryTheory.WithTerminal.star => CategoryTheory.Iso.refl CategoryTheory.WithTerminal.star).inv


@[simp]
theorem snd_sdiff [SDiff α] [SDiff β] (a b : α × β) : (a \ b).2 = a.2 \ b.2

{α : Type u_2}
{β : Type u_3}
[SDiff α]
[SDiff β]
(a b : α × β)


theorem mem_partOfVertex (v : V) : v ∈ P.partOfVertex v

{V : Type u}
{G : SimpleGraph V}
(P : G.Partition)
(v : V)


/-- The vertex group at `c`. -/
@[simps mul one inv]
instance vertexGroup (c : C) : Group (c ⟶ c)

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


theorem dart_edge_eq_mk'_iff :
    ∀ {d : G.Dart} {p : V × V}, d.edge = Sym2.mk p ↔ d.toProd = p ∨ d.toProd = p.swap

{V : Type u_1}
{G : SimpleGraph V}
{d : G.Dart}
{p : V × V}


theorem Matrix.Represents.smul {A : Matrix ι ι R} {f : Module.End R M} (h : A.Represents b f)
    (r : R) : (r • A).Represents b (r • f)

{ι : Type u_1}
[Fintype ι]
{M : Type u_2}
[AddCommGroup M]
{R : Type u_3}
[CommRing R]
[Module R M]
{b : ι → M}
[DecidableEq ι]
{A : Matrix ι ι R}
{f : Module.End R M}
(h : Matrix.Represents b A f)
(r : R)


theorem nontrivial_iff_ne_bot {N : LieSubmodule R L M} : Nontrivial N ↔ N ≠ ⊥

(R : Type u)
(L : Type v)
(M : Type w)
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
{N : LieSubmodule R L M}


/-- An antisymmetric bilinear form on an oriented real inner product space of dimension 2 (usual
notation `ω`). When evaluated on two vectors, it gives the oriented area of the parallelogram they
span. -/
irreducible_def areaForm : E →ₗ[ℝ] E →ₗ[ℝ] ℝ

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

o.areaForm =
  let z := AlternatingMap.constLinearEquivOfIsEmpty.symm;
  let y := (LinearMap.llcomp ℝ E (E [⋀^Fin 0]→ₗ[ℝ] ℝ) ℝ) ↑z ∘ₗ AlternatingMap.curryLeftLinearMap;
  y ∘ₗ AlternatingMap.curryLeftLinearMap o.volumeForm


theorem dvd_eq_le : ((· ∣ ·) : Associates α → Associates α → Prop) = (· ≤ ·)

(fun x x_1 => x ∣ x_1) = fun x x_1 => x ≤ x_1


@[simp] theorem sub_imI : (a - b).imI = a.imI - b.imI

{R : Type u_3}
[CommRing R]
(a b : ℍ[R])


@[to_additive]
theorem smul_toEquiv (f : F) (T : leftTransversals (H : Set G)) (q : G ⧸ H) :
    f • (toEquiv T.2 q : G) = toEquiv (f • T).2 (f • q)

{G : Type u_1}
[Group G]
{H : Subgroup G}
{F : Type u_2}
[Group F]
[MulAction F G]
[MulAction.QuotientAction F H]
(f : F)
(T : ↑(Subgroup.leftTransversals ↑H))
(q : G ⧸ H)

f • ↑((Subgroup.MemLeftTransversals.toEquiv ⋯) q) = ↑((Subgroup.MemLeftTransversals.toEquiv ⋯) (f • q))


@[simp]
theorem MonadHom.id_toNatTrans (T : Monad C) : (𝟙 T : T ⟶ T).toNatTrans = 𝟙 (T : C ⥤ C)

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

(CategoryTheory.CategoryStruct.id T).toNatTrans = CategoryTheory.CategoryStruct.id T.toFunctor


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


theorem mul_left_bijective_of_finite₀ {a : M} (ha : a ≠ 0) : Bijective fun b => b * a

{M : Type u_1}
[CancelMonoidWithZero M]
[Finite M]
{a : M}
(ha : a ≠ 0)


theorem isLittleO_iff_exists_eq_mul :
    u =o[l] v ↔ ∃ φ : α → 𝕜, Tendsto φ l (𝓝 0) ∧ u =ᶠ[l] φ * v

{α : Type u_1}
{𝕜 : Type u_15}
[NormedDivisionRing 𝕜]
{l : Filter α}
{u v : α → 𝕜}

u =o[l] v ↔ ∃ φ, Filter.Tendsto φ l (𝓝 0) ∧ u =ᶠ[l] φ * v


@[simp]
theorem comp_right_bot (r : Rel α β) : r • (⊥ : Rel β γ) = ⊥

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(r : Rel α β)


theorem lintegral_swapRight (κ : Kernel α (β × γ)) (a : α) {g : γ × β → ℝ≥0∞} (hg : Measurable g) :
    ∫⁻ c, g c ∂swapRight κ a = ∫⁻ bc : β × γ, g bc.swap ∂κ a

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

{g : γ × β → ℝ≥0∞}

∫⁻ (c : γ × β), g c ∂κ.swapRight a = ∫⁻ (bc : β × γ), g bc.swap ∂κ a


theorem unitGroup_strictMono : StrictMono (unitGroup : ValuationSubring K → Subgroup _)


@[simp]
lemma inl_comp_binaryCoproductIso_inv :
    coprod.inl ≫ (binaryCoproductIso F G).inv = (Limits.coprod.inl (X := F))

(F G : CategoryTheory.Functor C (Type w))

CategoryTheory.CategoryStruct.comp CategoryTheory.FunctorToTypes.coprod.inl
    (CategoryTheory.FunctorToTypes.binaryCoproductIso F G).inv =
  CategoryTheory.Limits.coprod.inl


@[simp]
theorem withDensityᵥ_zero : μ.withDensityᵥ (0 : α → E) = 0

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]


theorem transfer_self : p.transfer G p.edges_subset_edgeSet = p

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


{R : Type u_1}
{S : Type u_6}
{M : Type u_9}
{M₃ : Type u_12}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₃]
[Module R M]
[Module S M₃]
{σ : R →+* S}
(f : M →ₛₗ[σ] M₃)


/-- Construct an augmented cosimplicial object in the opposite
category from an augmented simplicial object. -/
@[simps!]
def SimplicialObject.Augmented.rightOp (X : SimplicialObject.Augmented C) :
    CosimplicialObject.Augmented Cᵒᵖ

(X : CategoryTheory.SimplicialObject.Augmented C)

∀ (X_1 : SimplexCategory), X.rightOp.right.obj X_1 = Opposite.op (X.left.obj (Opposite.op X_1))


/-- **Fundamental theorem of calculus-1**, strict differentiability in both endpoints.

If `f : ℝ → E` is integrable on `a..b` and `f x` has finite limits `ca` and `cb` almost surely as
`x` tends to `a` and `b`, respectively, then
`(u, v) ↦ ∫ x in u..v, f x` has derivative `(u, v) ↦ v • cb - u • ca` at `(a, b)`
in the sense of strict differentiability. -/
theorem integral_hasStrictFDerivAt_of_tendsto_ae (hf : IntervalIntegrable f volume a b)
    (hmeas_a : StronglyMeasurableAtFilter f (𝓝 a)) (hmeas_b : StronglyMeasurableAtFilter f (𝓝 b))
    (ha : Tendsto f (𝓝 a ⊓ ae volume) (𝓝 ca)) (hb : Tendsto f (𝓝 b ⊓ ae volume) (𝓝 cb)) :
    HasStrictFDerivAt (fun p : ℝ × ℝ => ∫ x in p.1..p.2, f x)
      ((snd ℝ ℝ ℝ).smulRight cb - (fst ℝ ℝ ℝ).smulRight ca) (a, b)

(hf : IntervalIntegrable f MeasureTheory.volume a b)

(hmeas_a : StronglyMeasurableAtFilter f (𝓝 a) MeasureTheory.volume)

(hmeas_b : StronglyMeasurableAtFilter f (𝓝 b) MeasureTheory.volume)

(ha : Filter.Tendsto f (𝓝 a ⊓ MeasureTheory.ae MeasureTheory.volume) (𝓝 ca))

(hb : Filter.Tendsto f (𝓝 b ⊓ MeasureTheory.ae MeasureTheory.volume) (𝓝 cb))

HasStrictFDerivAt (fun p => ∫ (x : ℝ) in p.1 ..p.2, f x)
  ((ContinuousLinearMap.snd ℝ ℝ ℝ).smulRight cb - (ContinuousLinearMap.fst ℝ ℝ ℝ).smulRight ca) (a, b)


theorem SmoothAt.contMDiffAt (h : SmoothAt I I' f x) : ContMDiffAt I I' n f x

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


theorem interpolate_eq_nodalWeight_mul_nodal_div_X_sub_C :
    interpolate s v r = ∑ i ∈ s, C (nodalWeight s v i) * (nodal s v / (X - C (v i))) * C (r i)

{F : Type u_1}
[Field F]
{ι : Type u_2}
[DecidableEq ι]
{s : Finset ι}
{v : ι → F}
(r : ι → F)

(Lagrange.interpolate s v) r =
  ∑ i ∈ s,
    Polynomial.C (Lagrange.nodalWeight s v i) * (Lagrange.nodal s v / (Polynomial.X - Polynomial.C (v i))) *
      Polynomial.C (r i)


theorem denseEmbedding_pureCauchy : DenseEmbedding (pureCauchy : α → CauchyFilter α)


lemma Indep.insert_dep_iff (hI : M.Indep I) : M.Dep (insert e I) ↔ e ∈ M.closure I \ I

{α : Type u_2}
{M : Matroid α}
{e : α}
{I : Set α}
(hI : M.Indep I)


theorem interleave_even_odd (s₁ : Stream' α) : even s₁ ⋈ odd s₁ = s₁


lemma gaussianPDFReal_inv_mul {μ : ℝ} {v : ℝ≥0} {c : ℝ} (hc : c ≠ 0) (x : ℝ) :
    gaussianPDFReal μ v (c⁻¹ * x) = |c| * gaussianPDFReal (c * μ) (⟨c^2, sq_nonneg _⟩ * v) x

ProbabilityTheory.gaussianPDFReal μ v (c⁻¹ * x) = |c| * ProbabilityTheory.gaussianPDFReal (c * μ) (⟨c ^ 2, ⋯⟩ * v) x


theorem setIntegral_withDensity_eq_setIntegral_smul₀ {f : X → ℝ≥0} {s : Set X}
    (hf : AEMeasurable f (μ.restrict s)) (g : X → E) (hs : MeasurableSet s) :
    ∫ x in s, g x ∂μ.withDensity (fun x => f x) = ∫ x in s, f x • g x ∂μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : X → ℝ≥0}
{s : Set X}
(hf : AEMeasurable f (μ.restrict s))
(g : X → E)
(hs : MeasurableSet s)

(∫ (x : X) in s, g x ∂μ.withDensity fun x => ↑(f x)) = ∫ (x : X) in s, f x • g x ∂μ


@[to_additive norm_eq_zero']
theorem norm_eq_zero''' [T0Space E] {a : E} : ‖a‖ = 0 ↔ a = 1

{E : Type u_6}
[SeminormedGroup E]
[T0Space E]
{a : E}


theorem sInf {ℐ : Set (Ideal A)} (h : ∀ I ∈ ℐ, Ideal.IsHomogeneous 𝒜 I) :
    (sInf ℐ).IsHomogeneous 𝒜

{ι : Type u_1}
{σ : Type u_2}
{A : Type u_4}
[Semiring A]
[DecidableEq ι]
[AddMonoid ι]
[SetLike σ A]
[AddSubmonoidClass σ A]
{𝒜 : ι → σ}
[GradedRing 𝒜]
{ℐ : Set (Ideal A)}
(h : ∀ I ∈ ℐ, Ideal.IsHomogeneous 𝒜 I)


theorem Trivialization.smoothOn (e : Trivialization F (π F E)) [MemTrivializationAtlas e] :
    SmoothOn (IB.prod 𝓘(𝕜, F)) (IB.prod 𝓘(𝕜, F)) e e.source

[TopologicalSpace (Bundle.TotalSpace F E)]

(e : Trivialization F Bundle.TotalSpace.proj)

SmoothOn (IB.prod 𝓘(𝕜, F)) (IB.prod 𝓘(𝕜, F)) (↑e) e.source


theorem nilpotent_iff_mem_prime : IsNilpotent x ↔ ∀ J : Ideal R, J.IsPrime → x ∈ J

IsNilpotent x ↔ ∀ (J : Ideal R), J.IsPrime → x ∈ J


@[to_additive]
lemma iIndepFun.indepFun_div_div (hf_indep : iIndepFun (fun _ ↦ m) f κ μ)
    (hf_meas : ∀ i, Measurable (f i))
    (i j k l : ι) (hik : i ≠ k) (hil : i ≠ l) (hjk : j ≠ k) (hjl : j ≠ l) :
    IndepFun (f i / f j) (f k / f l) κ μ

{f : ι → Ω → β}

(hf_indep : ProbabilityTheory.Kernel.iIndepFun (fun x => m) f κ μ)

ProbabilityTheory.Kernel.IndepFun (f i - f j) (f k - f l) κ μ


@[simp]
nonrec theorem comap_comap (f : Ultrafilter γ) {m : α → β} {n : β → γ} (inj₀ : Injective n)
    (large₀ : range n ∈ f) (inj₁ : Injective m) (large₁ : range m ∈ f.comap inj₀ large₀)
    (inj₂ : Injective (n ∘ m) := inj₀.comp inj₁)
    (large₂ : range (n ∘ m) ∈ f :=
      (by rw [range_comp]; exact image_mem_of_mem_comap large₀ large₁)) :
    (f.comap inj₀ large₀).comap inj₁ large₁ = f.comap inj₂ large₂

(large₁ : Set.range m ∈ f.comap inj₀ large₀)

(inj₂ : Function.Injective (n ∘ m) := ⋯)


theorem rank_le {n : ℕ}
    (H : ∀ s : Finset M, (LinearIndependent R fun i : s => (i : M)) → s.card ≤ n) :
    Module.rank R M ≤ n

(H : ∀ (s : Finset M), (LinearIndependent R fun i => ↑i) → s.card ≤ n)


theorem Functor.map_isPullback [PreservesLimit (cospan h i) F] (s : IsPullback f g h i) :
    IsPullback (F.map f) (F.map g) (F.map h) (F.map i)

[CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan h i) F]

CategoryTheory.IsPullback (F.map f) (F.map g) (F.map h) (F.map i)


@[simp] lemma reverse_X_pow_mul (p : R[X]) (n : ℕ) : reverse (X ^ n * p) = reverse p

{R : Type u_1}
[Semiring R]
(p : Polynomial R)
(n : ℕ)

(Polynomial.X ^ n * p).reverse = p.reverse


lemma subsingleton_setOf_mem_iff_pairwise_disjoint {f : ι → Set α} :
    (∀ a, {i | a ∈ f i}.Subsingleton) ↔ Pairwise (Disjoint on f)

{α : Type u_1}
{ι : Type u_4}
{f : ι → Set α}

(∀ (a : α), {i | a ∈ f i}.Subsingleton) ↔ Pairwise (Disjoint on f)


@[simp] theorem sub_coeffs {l₁ l₂ : LinearCombo} : (l₁ - l₂).coeffs = l₁.coeffs - l₂.coeffs


/-- Given a finite nonempty affinely independent family of points,
there is a unique (circumcenter, circumradius) pair for those points
in the affine subspace they span. -/
theorem _root_.AffineIndependent.existsUnique_dist_eq {ι : Type*} [hne : Nonempty ι] [Finite ι]
    {p : ι → P} (ha : AffineIndependent ℝ p) :
    ∃! cs : Sphere P, cs.center ∈ affineSpan ℝ (Set.range p) ∧ Set.range p ⊆ (cs : Set P)

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{ι : Type u_3}
[hne : Nonempty ι]
[Finite ι]
{p : ι → P}
(ha : AffineIndependent ℝ p)

∃! cs, cs.center ∈ affineSpan ℝ (Set.range p) ∧ Set.range p ⊆ Metric.sphere cs.center cs.radius


@[simp] theorem ofNat_le_ofNat {n} (x y : Nat) : (BitVec.ofNat n x) ≤ (BitVec.ofNat n y) ↔ x % 2^n ≤ y % 2^n

BitVec.ofNat n x ≤ BitVec.ofNat n y ↔ x % 2 ^ n ≤ y % 2 ^ n


@[to_additive]
theorem smul_toFun (f : F) (T : leftTransversals (H : Set G)) (g : G) :
    (f • (toFun T.2 g : G)) = toFun (f • T).2 (f • g)

{G : Type u_1}
[Group G]
{H : Subgroup G}
{F : Type u_2}
[Group F]
[MulAction F G]
[MulAction.QuotientAction F H]
(f : F)
(T : ↑(Subgroup.leftTransversals ↑H))
(g : G)

f • ↑(Subgroup.MemLeftTransversals.toFun ⋯ g) = ↑(Subgroup.MemLeftTransversals.toFun ⋯ (f • g))


/-- Adding an angle to that with the order of the points reversed results in 0. -/
@[simp]
theorem oangle_add_oangle_rev (p₁ p₂ p₃ : P) : ∡ p₁ p₂ p₃ + ∡ p₃ p₂ p₁ = 0

[hd2 : Fact (FiniteDimensional.finrank ℝ V = 2)]


theorem pi_inter_distrib : (s.pi fun i => t i ∩ t₁ i) = s.pi t ∩ s.pi t₁

{ι : Type u_1}
{α : ι → Type u_2}
{s : Set ι}
{t t₁ : (i : ι) → Set (α i)}


/-- The functor `Square C ⥤ Arrow (Arrow C)` which sends a
commutative square `sq` to the obvious arrow from the top morphism of `sq`
to the bottom morphism of `sq`. -/
@[simps!]
def toArrowArrowFunctor' : Square C ⥤ Arrow (Arrow C)

{C : Type u}
[CategoryTheory.Category.{v, u} C]

∀ {X Y : CategoryTheory.Square C} (φ : X ⟶ Y), (CategoryTheory.Square.toArrowArrowFunctor'.map φ).left.right = φ.τ₂


theorem cinfi_ne_top [InfSet α] (f : ℝ≥0∞ → α) : ⨅ x : { x // x ≠ ∞ }, f x = ⨅ x : ℝ≥0, f x

{α : Type u_1}
[InfSet α]
(f : ℝ≥0∞ → α)


theorem add_left_neg_equiv (x : PGame) : -x + x ≈ 0


/-- The cardinality of the interval [a, b). -/
theorem mk_Ico_real {a b : ℝ} (h : a < b) : #(Ico a b) = 𝔠


lemma EssFiniteType.of_isLocalization (M : Submonoid R) [IsLocalization M S] :
    EssFiniteType R S

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


@[simp]
theorem trunc_c (n : σ →₀ ℕ) (hnn : n ≠ 0) (a : R) : trunc R n (C σ R a) = MvPolynomial.C a

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
(n : σ →₀ ℕ)
(hnn : n ≠ 0)
(a : R)

(MvPowerSeries.trunc R n) ((MvPowerSeries.C σ R) a) = MvPolynomial.C a


/-- Local instance for `OrientedOrd ord.opposite`. -/
theorem OrientedOrd.instOpposite [ord : Ord α] [inst : OrientedOrd α] :
    @OrientedOrd _ ord.opposite

{α : Type u_1}
[ord : Ord α]
[inst : Batteries.OrientedOrd α]


/--
Unlike `HasFDerivAt.finset_prod`, supports duplicate elements.
-/
@[fun_prop]
theorem HasFDerivAt.multiset_prod [DecidableEq ι] {u : Multiset ι} {x : E}
    (h : ∀ i ∈ u, HasFDerivAt (g i ·) (g' i) x) :
    HasFDerivAt (fun x ↦ (u.map (g · x)).prod)
      (u.map fun i ↦ ((u.erase i).map (g · x)).prod • g' i).sum x

(h : ∀ i ∈ u, HasFDerivAt (fun x => g i x) (g' i) x)

HasFDerivAt (fun x => (Multiset.map (fun x_1 => g x_1 x) u).prod)
  (Multiset.map (fun i => (Multiset.map (fun x_1 => g x_1 x) (u.erase i)).prod • g' i) u).sum x


theorem eLpNorm'_mono_ae {f : α → F} {g : α → G} (hq : 0 ≤ q) (h : ∀ᵐ x ∂μ, ‖f x‖ ≤ ‖g x‖) :
    eLpNorm' f q μ ≤ eLpNorm' g q μ

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

MeasureTheory.eLpNorm' f q μ ≤ MeasureTheory.eLpNorm' g q μ


theorem iInf_ker_lapply_le_bot : ⨅ a, ker (lapply a : (α →₀ M) →ₗ[R] M) ≤ ⊥

{α : Type u_1}
{M : Type u_2}
{R : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]

⨅ a, LinearMap.ker (Finsupp.lapply a) ≤ ⊥


theorem X_pow_card_pow_sub_X_ne_zero (hn : n ≠ 0) (hp : 1 < p) : (X ^ p ^ n - X : K'[X]) ≠ 0

(K' : Type u_3)
[Field K']
{p n : ℕ}
(hn : n ≠ 0)
(hp : 1 < p)


lemma IsPointwiseLeftKanExtension.isIso_hom [L.Full] [L.Faithful] :
    IsIso (E.hom)

{C : Type u_1}
{D : Type u_2}
{H : Type u_3}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
[CategoryTheory.Category.{u_6, u_3} H]
{L : CategoryTheory.Functor C D}
{F : CategoryTheory.Functor C H}
{E : L.LeftExtension F}
(h : E.IsPointwiseLeftKanExtension)
[L.Full]
[L.Faithful]


theorem prod_smul (d : ℕ) (u : PrimeMultiset) : (d • u).prod = u.prod ^ d


@[simp]
theorem coe_compContinuous {δ : Type*} [TopologicalSpace δ] (f : α →ᵇ β) (g : C(δ, α)) :
    ⇑(f.compContinuous g) = f ∘ g

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
{δ : Type u_2}
[TopologicalSpace δ]
(f : BoundedContinuousFunction α β)
(g : C(δ, α))


theorem extend_of_le_zero {a b : X} (γ : Path a b) {t : ℝ}
    (ht : t ≤ 0) : γ.extend t = a

{X : Type u_1}
[TopologicalSpace X]
{a b : X}
(γ : Path a b)
{t : ℝ}
(ht : t ≤ 0)


@[simp]
theorem interior_Ioo : interior (Ioo a b) = Ioo a b

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


@[simp] theorem exists_exists_eq_and {f : α → β} {p : β → Prop} :
    (∃ b, (∃ a, f a = b) ∧ p b) ↔ ∃ a, p (f a)

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


@[simp]
theorem iUnion_filter_not (π : TaggedPrepartition I) (p : Box ι → Prop) :
    (π.filter fun J => ¬p J).iUnion = π.iUnion \ (π.filter p).iUnion

{ι : Type u_1}
{I : BoxIntegral.Box ι}
(π : BoxIntegral.TaggedPrepartition I)
(p : BoxIntegral.Box ι → Prop)


theorem Nodup.of_cons (h : Nodup (a :: l)) : Nodup l

{α : Type u}
{l : List α}
{a : α}
(h : (a :: l).Nodup)


/-- Given a cartesian morphism `φ : a ⟶ b` lying over `f : R ⟶ S` in `𝒳`, and two morphisms
`ψ ψ' : a' ⟶ a` such that `ψ ≫ φ = ψ' ≫ φ`. Then we must have `ψ = ψ'`. -/
protected lemma ext (φ : a ⟶ b) [IsCartesian p f φ] {a' : 𝒳} (ψ ψ' : a' ⟶ a)
    [IsHomLift p (𝟙 R) ψ] [IsHomLift p (𝟙 R) ψ'] (h : ψ ≫ φ = ψ' ≫ φ) : ψ = ψ'

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


@[measurability]
theorem Measurable.log : Measurable fun x => log (f x)

{α : Type u_1}
{m : MeasurableSpace α}
{f : α → ℝ}
(hf : Measurable f)


@[simp] theorem perm_cons (a : α) {l₁ l₂ : List α} : a :: l₁ ~ a :: l₂ ↔ l₁ ~ l₂


/-- A homology data for a short complex `S` in the opposite category
induces a homology data for `S.unop`. -/
@[simps]
def unop {S : ShortComplex Cᵒᵖ} (h : S.HomologyData) : S.unop.HomologyData


theorem deriv_const_sub (c : F) : deriv (fun y => c - f y) x = -deriv f x

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


@[simp] lemma mem_Ioi : x ∈ Ioi a ↔ a < x

{α : Type u_1}
[Preorder α]
[LocallyFiniteOrderTop α]
{a x : α}


theorem comp_apply (g : M₂ →SL[σ₂₃] M₃) (f : M₁ →SL[σ₁₂] M₂) (x : M₁) : (g.comp f) x = g (f x)

{R₁ : Type u_1}
{R₂ : Type u_2}
{R₃ : Type u_3}
[Semiring R₁]
[Semiring R₂]
[Semiring R₃]
{σ₁₂ : R₁ →+* R₂}
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R₁ →+* R₃}
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
{M₃ : Type u_7}
[TopologicalSpace M₃]
[AddCommMonoid M₃]
[Module R₁ M₁]
[Module R₂ M₂]
[Module R₃ M₃]
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
(g : M₂ →SL[σ₂₃] M₃)
(f : M₁ →SL[σ₁₂] M₂)
(x : M₁)


protected lemma smul_zero : smul α φ r 0 = 0

{J : CategoryTheory.GrothendieckTopology C}

PresheafOfModules.Sheafify.smul α φ r 0 = 0


theorem nilpotent_iff_not_unit_of_minimal {x : Localization I.primeCompl} :
    IsNilpotent x ↔ x ∈ nonunits _

{R : Type u_1}
[CommSemiring R]
{I : Ideal R}
[hI : I.IsPrime]
(hMin : I ∈ minimalPrimes R)
{x : Localization I.primeCompl}

IsNilpotent x ↔ x ∈ nonunits (Localization I.primeCompl)


/-- If three points are not collinear, the sine of the angle between them is positive. -/
theorem sin_pos_of_not_collinear {p₁ p₂ p₃ : P} (h : ¬Collinear ℝ ({p₁, p₂, p₃} : Set P)) :
    0 < Real.sin (∠ p₁ p₂ p₃)

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p₁ p₂ p₃ : P}
(h : ¬Collinear ℝ {p₁, p₂, p₃})

0 < Real.sin (EuclideanGeometry.angle p₁ p₂ p₃)


@[simp]
theorem repr_add : ∀ (o₁ o₂) [NF o₁] [NF o₂], repr (o₁ + o₂) = repr o₁ + repr o₂


theorem toConjAct_zero : toConjAct (0 : G₀) = 0


@[simp]
theorem sub_apply (f g : M →ₛₗ[σ₁₂] N₂) (x : M) : (f - g) x = f x - g x

{R₁ : Type u_2}
{R₂ : Type u_3}
{M : Type u_9}
{N₂ : Type u_14}
[Semiring R₁]
[Semiring R₂]
[AddCommMonoid M]
[AddCommGroup N₂]
[Module R₁ M]
[Module R₂ N₂]
{σ₁₂ : R₁ →+* R₂}
(f g : M →ₛₗ[σ₁₂] N₂)
(x : M)


@[to_additive]
lemma iCondIndepFun.indepFun_div_right (hf_indep : iCondIndepFun m' hm' (fun _ ↦ m) f μ)
    (hf_meas : ∀ i, Measurable (f i)) (i j k : ι) (hij : i ≠ j) (hik : i ≠ k) :
    CondIndepFun m' hm' (f i) (f j / f k) μ

{f : ι → Ω → β}

(hf_indep : ProbabilityTheory.iCondIndepFun m' hm' (fun x => m) f μ)

ProbabilityTheory.CondIndepFun m' hm' (f i) (f j / f k) μ


@[to_additive (attr := simp)]
theorem mk_of_inr (x : N) : (mk (of (.inr x)) : M ∗ N) = inr x

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
(x : N)

AddMonoid.Coprod.mk (FreeAddMonoid.of (Sum.inr x)) = AddMonoid.Coprod.inr x


/-- Two vectors with equal norms are equal if and only if they have zero angle between them. -/
theorem eq_iff_oangle_eq_zero_of_norm_eq {x y : V} (h : ‖x‖ = ‖y‖) : x = y ↔ o.oangle x y = 0

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


@[deprecated Measure.withDensity.instSFinite (since := "2024-07-14"), nolint unusedArguments]
lemma sFinite_withDensity_of_sigmaFinite_of_measurable (μ : Measure α) [SigmaFinite μ]
    {f : α → ℝ≥0∞} (_hf : Measurable f) :
    SFinite (μ.withDensity f)

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


/--
An `R`-algebra is essentially of finite type if
it is the localization of an algebra of finite type.
See `essFiniteType_iff_exists_subalgebra`.
-/
class EssFiniteType : Prop where
  cond : ∃ s : Finset S,
    IsLocalization ((IsUnit.submonoid S).comap (algebraMap (adjoin R (s : Set S)) S)) S

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[CommRing S]
[Algebra R S]
[self : Algebra.EssFiniteType R S]

∃ s, IsLocalization (Submonoid.comap (algebraMap (↥(Algebra.adjoin R ↑s)) S) (IsUnit.submonoid S)) S


lemma map_comp (h : M →ₗ[R] N) : (map S f g h) ∘ₗ f = g ∘ₗ h

{R : Type u_1}
[CommSemiring R]
(S : Submonoid R)
{M : Type u_2}
{M' : Type u_3}
[AddCommMonoid M]
[AddCommMonoid M']
[Module R M]
[Module R M']
(f : M →ₗ[R] M')
[IsLocalizedModule S f]
{N : Type u_6}
{N' : Type u_7}
[AddCommGroup N]
[AddCommGroup N']
[Module R N]
[Module R N']
(g : N →ₗ[R] N')
[IsLocalizedModule S g]
(h : M →ₗ[R] N)

(IsLocalizedModule.map S f g) h ∘ₗ f = g ∘ₗ h


/-- This relies on `default ℕ = 0`. -/
theorem tail_sum (L : List ℕ) : L.tail.sum = L.sum - L.headI


theorem glued_cover_cocycle_fst (x y z : 𝒰.J) :
    gluedCoverT' 𝒰 x y z ≫ gluedCoverT' 𝒰 y z x ≫ gluedCoverT' 𝒰 z x y ≫ pullback.fst _ _ =
      pullback.fst _ _

{X : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)
(x y z : 𝒰.J)

𝒰.gluedCoverT' x y z ≫
    𝒰.gluedCoverT' y z x ≫
      𝒰.gluedCoverT' z x y ≫
        CategoryTheory.Limits.pullback.fst (CategoryTheory.Limits.pullback.fst (𝒰.map x) (𝒰.map y))
          (CategoryTheory.Limits.pullback.fst (𝒰.map x) (𝒰.map z)) =
  CategoryTheory.Limits.pullback.fst (CategoryTheory.Limits.pullback.fst (𝒰.map x) (𝒰.map y))
    (CategoryTheory.Limits.pullback.fst (𝒰.map x) (𝒰.map z))


theorem lpMeasSubgroupToLpTrim_sub (hm : m ≤ m0) (f g : lpMeasSubgroup F m p μ) :
    lpMeasSubgroupToLpTrim F p μ hm (f - g) =
      lpMeasSubgroupToLpTrim F p μ hm f - lpMeasSubgroupToLpTrim F p μ hm g

(f g : ↥(MeasureTheory.lpMeasSubgroup F m p μ))

MeasureTheory.lpMeasSubgroupToLpTrim F p μ hm (f - g) =
  MeasureTheory.lpMeasSubgroupToLpTrim F p μ hm f - MeasureTheory.lpMeasSubgroupToLpTrim F p μ hm g


@[simp]
theorem coe_basisRightAngleRotation (x : E) (hx : x ≠ 0) :
    ⇑(o.basisRightAngleRotation x hx) = ![x, J x]

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

⇑(o.basisRightAngleRotation x hx) = ![x, o.rightAngleRotation x]


@[simp]
theorem Subsequent.mk_right {xl xr} (xL : xl → PGame) (xR : xr → PGame) (j : xr) :
    Subsequent (xR j) (mk xl xr xL xR)

{xl xr : Type u_1}
(xL : xl → SetTheory.PGame)
(xR : xr → SetTheory.PGame)
(j : xr)

(xR j).Subsequent (SetTheory.PGame.mk xl xr xL xR)


theorem card_fintype_Ico : Fintype.card (Set.Ico a b) = b - a


theorem tendsto_translation_number₀ : Tendsto (fun n : ℕ => (f ^ n) 0 / n) atTop (𝓝 <| τ f)

Filter.Tendsto (fun n => (f ^ n) 0 / ↑n) Filter.atTop (𝓝 f.translationNumber)


theorem of_inverse {f' : Y → X} (h : Continuous f') (l_inv : LeftInverse f f')
    (r_inv : RightInverse f f') : IsOpenMap f

{X : Type u_1}
{Y : Type u_2}
{f : X → Y}
[TopologicalSpace X]
[TopologicalSpace Y]
{f' : Y → X}
(h : Continuous f')
(l_inv : Function.LeftInverse f f')
(r_inv : Function.RightInverse f f')


theorem map_le_iff (f : α → β) (a b : WithTop α)
    (mono_iff : ∀ {a b}, f a ≤ f b ↔ a ≤ b) :
    a.map f ≤ b.map f ↔ a ≤ b

(mono_iff : ∀ {a b : α}, f a ≤ f b ↔ a ≤ b)

WithTop.map f a ≤ WithTop.map f b ↔ a ≤ b


/-- If `C` has all colimits of diagrams `span f g`, then it has all pushouts -/
theorem hasPushouts_of_hasColimit_span
    [∀ {X Y Z : C} {f : X ⟶ Y} {g : X ⟶ Z}, HasColimit (span f g)] : HasPushouts C

[∀ {X Y Z : C} {f : X ⟶ Y} {g : X ⟶ Z}, CategoryTheory.Limits.HasColimit (CategoryTheory.Limits.span f g)]


theorem disjoint_disjointed (f : ℕ → α) : Pairwise (Disjoint on disjointed f)

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


lemma spec' (g : L ≃+* L) {t : Lˣ} (ht : t ∈ rootsOfUnity n L) :
    g t = t ^ ((ModularCyclotomicCharacter' L n g) : ZMod
      (Fintype.card { x // x ∈ rootsOfUnity n L })).val

(L : Type u)
[CommRing L]
[IsDomain L]
(n : ℕ+)
(g : L ≃+* L)
{t : Lˣ}
(ht : t ∈ rootsOfUnity n L)

g ↑t = ↑t ^ (↑((ModularCyclotomicCharacter' L n) g)).val


@[simp]
theorem range_finsetBasis [IsNoetherian K V] :
    Set.range (finsetBasis K V) = Basis.ofVectorSpaceIndex K V

(K : Type u)
(V : Type v)
[DivisionRing K]
[AddCommGroup V]
[Module K V]
[IsNoetherian K V]

Set.range ⇑(IsNoetherian.finsetBasis K V) = Basis.ofVectorSpaceIndex K V


/-- A characterisation of `Nat.totient` that avoids `Finset`. -/
theorem totient_eq_card_lt_and_coprime (n : ℕ) : φ n = Nat.card { m | m < n ∧ n.Coprime m }

n.totient = Nat.card ↑{m | m < n ∧ n.Coprime m}


/-- A presheaf isomorphic to the Yoneda embedding of
the `V`-object of natural transformations from `F` to `G`.
-/
@[simps]
def enrichedNatTransYoneda (F G : EnrichedFunctor V C D) : Vᵒᵖ ⥤ Type max u₁ w

(F G : CategoryTheory.EnrichedFunctor V C D)

(CategoryTheory.enrichedNatTransYoneda F G).obj A =
  CategoryTheory.GradedNatTrans ((CategoryTheory.Center.ofBraided V).obj (Opposite.unop A)) F G


@[to_additive top_prod]
theorem top_prod (s : Submonoid N) : (⊤ : Submonoid M).prod s = s.comap (MonoidHom.snd M N)

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
(s : AddSubmonoid N)

⊤.prod s = AddSubmonoid.comap (AddMonoidHom.snd M N) s


/-- The extension of `N₁` to the Karoubi envelope of `SimplicialObject C`. -/
@[simps!]
def N₂ : Karoubi (SimplicialObject C) ⥤ Karoubi (ChainComplex C ℕ)

(P : CategoryTheory.Idempotents.Karoubi (CategoryTheory.SimplicialObject C))

(AlgebraicTopology.DoldKan.N₂.obj P).p.f i =
  AlgebraicTopology.DoldKan.PInfty.f i ≫ P.p.app (Opposite.op (SimplexCategory.mk i))


/-- `QuadraticForm.dualProd` commutes (isometrically) with `QuadraticForm.prod`. -/
@[simps!]
def dualProdProdIsometry :
    (dualProd R (M × N)).IsometryEquiv ((dualProd R M).prod (dualProd R N))

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[CommSemiring R]
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]

∀ (a : Module.Dual R (M × N) × M × N),
  QuadraticForm.dualProdProdIsometry a = ((a.1 ∘ₗ LinearMap.inl R M N, a.2.1), a.1 ∘ₗ LinearMap.inr R M N, a.2.2)


@[to_additive (attr := simp)]
theorem smul_set_ae_eq (c : G) {s t : Set α} : c • s =ᵐ[μ] c • t ↔ s =ᵐ[μ] t

[MeasureTheory.VAddInvariantMeasure G α μ]


@[simp]
lemma preNormEDS_one : preNormEDS b c d 1 = 1


/-- The functor `LeftExtension L F ⥤ LeftExtension (G ⋙ L) (G ⋙ F)`
obtained by precomposition. -/
@[simps!]
def LeftExtension.precomp : LeftExtension L F ⥤ LeftExtension (G ⋙ L) (G ⋙ F)

(X : CategoryTheory.Comma (CategoryTheory.Functor.fromPUnit F) ((CategoryTheory.whiskeringLeft C D H).obj L))

∀ (X_1 : C'), ((CategoryTheory.Functor.LeftExtension.precomp L F G).obj X).hom.app X_1 = X.hom.app (G.obj X_1)


@[simp]
lemma Scheme.restrict_presheaf_map (V W) (i : V ⟶ W) :
    (X.restrict h).presheaf.map i = X.presheaf.map (homOfLE (show X.ofRestrict h ''ᵁ W.unop ≤
      X.ofRestrict h ''ᵁ V.unop from Set.image_subset _ i.unop.le)).op

{f : U ⟶ TopCat.of ↑↑X.toPresheafedSpace}

(V W : (TopologicalSpace.Opens ↑↑(X.restrict h).toPresheafedSpace)ᵒᵖ)

(X.restrict h).presheaf.map i = X.presheaf.map (CategoryTheory.homOfLE ⋯).op


theorem core_eq (f : α →. β) (s : Set β) : f.core s = f.preimage s ∪ f.Domᶜ

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


/-- Even if `s` is not measurable, `map f μ s = 0` implies that `μ (f ⁻¹' s) = 0`. -/
theorem preimage_null_of_map_null {f : α → β} (hf : AEMeasurable f μ) {s : Set β}
    (hs : μ.map f s = 0) : μ (f ⁻¹' s) = 0

(hs : (MeasureTheory.Measure.map f μ) s = 0)


@[simp]
lemma Real.rank_rat_real : Module.rank ℚ ℝ = continuum


/-- In a real vector space, a convex set with nonempty interior is a set of unique
differentiability. -/
theorem uniqueDiffOn_convex {s : Set G} (conv : Convex ℝ s) (hs : (interior s).Nonempty) :
    UniqueDiffOn ℝ s

{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{s : Set G}
(conv : Convex ℝ s)
(hs : (interior s).Nonempty)


/-- The pullback of the `Filter.cofinite` under an injective function is equal to `Filter.cofinite`.
See also `Filter.comap_cofinite_le` and `Function.Injective.tendsto_cofinite`. -/
theorem Function.Injective.comap_cofinite_eq {f : α → β} (hf : Injective f) :
    comap f cofinite = cofinite

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

Filter.comap f Filter.cofinite = Filter.cofinite


theorem map_csSup' (e : α ≃o β) {s : Set α} (hne : s.Nonempty) (hbdd : BddAbove s) :
    e (sSup s) = sSup (e '' s)

{α : Type u_1}
{β : Type u_2}
[ConditionallyCompleteLattice α]
[ConditionallyCompleteLattice β]
(e : α ≃o β)
{s : Set α}
(hne : s.Nonempty)
(hbdd : BddAbove s)


@[simp]
theorem pair_unpair (n : ℕ) : pair (unpair n).1 (unpair n).2 = n

Nat.pair (Nat.unpair n).1 (Nat.unpair n).2 = n


protected theorem injOn : InjOn e e.source

{α : Type u_1}
{β : Type u_2}
(e : PartialEquiv α β)


@[simp]
theorem flip_b : (flip u).b = u.a


/-- A family indexed by a type with a unique element
is `MulEquiv` to the element at the single index. -/
@[to_additive (attr := simps!)
  "A family indexed by a type with a unique element
  is `AddEquiv` to the element at the single index."]
def piUnique {ι : Type*} (M : ι → Type*) [∀ j, Mul (M j)] [Unique ι] :
    (∀ j, M j) ≃* M default

{ι : Type u_12}
(M : ι → Type u_13)
[(j : ι) → Add (M j)]
[Unique ι]
(x : M default)
(i : ι)

(AddEquiv.piUnique M).symm x i = uniqueElim x i


theorem catalan_eq_centralBinom_div (n : ℕ) : catalan n = n.centralBinom / (n + 1)


@[to_additive]
theorem mulIndicator_of_not_mem (hU : IsClopen U) (h : a ∉ U) : f.mulIndicator hU a = 1

{X : Type u_1}
[TopologicalSpace X]
{R : Type u_5}
[Zero R]
{U : Set X}
(f : LocallyConstant X R)
{a : X}
(hU : IsClopen U)
(h : a ∉ U)


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


theorem isLowerSet_sUnion {S : Set (Set α)} (hf : ∀ s ∈ S, IsLowerSet s) : IsLowerSet (⋃₀ S)

{α : Type u_1}
[LE α]
{S : Set (Set α)}
(hf : ∀ s ∈ S, IsLowerSet s)


theorem nonneg (i : ι) (x : X) : 0 ≤ f i x

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


theorem IsRat.to_isInt {α} [Ring α] : ∀ {a : α} {n}, IsRat a n (nat_lit 1) → IsInt a n

Mathlib.Meta.NormNum.IsRat a n 1 → Mathlib.Meta.NormNum.IsInt a n


theorem hasSum_one_div_pow_mul_fourier_mul_bernoulliFun {k : ℕ} (hk : 2 ≤ k) {x : ℝ}
    (hx : x ∈ Icc (0 : ℝ) 1) :
    HasSum (fun n : ℤ => 1 / (n : ℂ) ^ k * fourier n (x : 𝕌))
      (-(2 * π * I) ^ k / k ! * bernoulliFun k x)

{k : ℕ}
(hk : 2 ≤ k)
{x : ℝ}
(hx : x ∈ Set.Icc 0 1)

HasSum (fun n => 1 / ↑n ^ k * (fourier n) ↑x) (-(2 * ↑π * Complex.I) ^ k / ↑k ! * ↑(bernoulliFun k x))


theorem mem_fixedPoints_mul_left_cosets_iff_mem_normalizer {H : Subgroup G} [Finite (H : Set G)]
    {x : G} : (x : G ⧸ H) ∈ MulAction.fixedPoints H (G ⧸ H) ↔ x ∈ normalizer H

{G : Type u}
[Group G]
{H : Subgroup G}
[Finite ↑↑H]
{x : G}

↑x ∈ MulAction.fixedPoints (↥H) (G ⧸ H) ↔ x ∈ H.normalizer


theorem generatePiSystem_mono {α} {S T : Set (Set α)} (hST : S ⊆ T) :
    generatePiSystem S ⊆ generatePiSystem T

{α : Type u_1}
{S T : Set (Set α)}
(hST : S ⊆ T)


theorem fst_integral [CompleteSpace F] {f : X → E × F} (hf : Integrable f μ) :
    (∫ x, f x ∂μ).1 = ∫ x, (f x).1 ∂μ

{X : Type u_1}
{E : Type u_3}
{F : Type u_4}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[NormedSpace ℝ E]
[NormedSpace ℝ F]
[CompleteSpace F]
{f : X → E × F}
(hf : MeasureTheory.Integrable f μ)


/-- The augmented Čech nerve construction, as a functor from `Arrow C`. -/
@[simps!]
def augmentedCechNerve : Arrow C ⥤ SimplicialObject.Augmented C

[∀ (n : ℕ) (f : CategoryTheory.Arrow C), CategoryTheory.Limits.HasWidePullback f.right (fun x => f.left) fun x => f.hom]

∀ {X Y : CategoryTheory.Arrow C} (F : X ⟶ Y) (n : SimplexCategoryᵒᵖ),
  (CategoryTheory.SimplicialObject.augmentedCechNerve.map F).left.app n =
    CategoryTheory.Limits.WidePullback.lift ((CategoryTheory.Limits.WidePullback.base fun x => X.hom) ≫ F.right)
      (fun i => CategoryTheory.Limits.WidePullback.π (fun x => X.hom) i ≫ F.left) ⋯


theorem laverage_lt_top (hf : ∫⁻ x, f x ∂μ ≠ ∞) : ⨍⁻ x, f x ∂μ < ∞

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
(hf : ∫⁻ (x : α), f x ∂μ ≠ ⊤)


@[simp]
lemma comap_id (κ : Kernel α β) : comap κ id measurable_id = κ

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
(κ : ProbabilityTheory.Kernel α β)


theorem Inducing.r0Space [TopologicalSpace Y] {f : Y → X} (hf : Inducing f) : R0Space Y

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


theorem rootMultiplicity_eq_natTrailingDegree {p : R[X]} {t : R} :
    p.rootMultiplicity t = (p.comp (X + C t)).natTrailingDegree

{R : Type u}
[CommRing R]
{p : R[X]}
{t : R}

Polynomial.rootMultiplicity t p = (p.comp (Polynomial.X + Polynomial.C t)).natTrailingDegree


@[simp] -- Porting note: Removed `@[protected]`
theorem coe_id : ⇑(Dilation.id α) = id


theorem LinearMap.toLinearMap₂'Aux_toMatrix₂Aux (f : (n → R₁) →ₛₗ[σ₁] (m → R₂) →ₛₗ[σ₂] N₂) :
    Matrix.toLinearMap₂'Aux σ₁ σ₂
        (LinearMap.toMatrix₂Aux R (fun i => stdBasis R₁ (fun _ => R₁) i 1)
          (fun j => stdBasis R₂ (fun _ => R₂) j 1) f) =
      f

Matrix.toLinearMap₂'Aux σ₁ σ₂
    ((LinearMap.toMatrix₂Aux R (fun i => (LinearMap.stdBasis R₁ (fun x => R₁) i) 1) fun j =>
        (LinearMap.stdBasis R₂ (fun x => R₂) j) 1)
      f) =
  f


/-- The iterated differential within a set `s` at a point `x` is not modified if one intersects
`s` with an open set containing `x`. -/
theorem iteratedFDerivWithin_inter_open {n : ℕ} (hu : IsOpen u) (hx : x ∈ u) :
    iteratedFDerivWithin 𝕜 n f (s ∩ u) x = iteratedFDerivWithin 𝕜 n f s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s u : Set E}
{f : E → F}
{x : E}
{n : ℕ}
(hu : IsOpen u)
(hx : x ∈ u)


theorem inr_strictMono : StrictMono (inr : β → α ⊕ β)

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


theorem Monic.def : Monic p ↔ leadingCoeff p = 1


theorem minimalPeriod_fst_dvd : minimalPeriod f x.1 ∣ minimalPeriod (Prod.map f g) x

{α : Type u_1}
{β : Type u_2}
{f : α → α}
{g : β → β}
{x : α × β}

Function.minimalPeriod f x.1 ∣ Function.minimalPeriod (Prod.map f g) x


@[simp]
theorem equivFunOnFinite_symm_coe {α} [Finite α] (f : α →₀ M) : equivFunOnFinite.symm f = f

{M : Type u_5}
[Zero M]
{α : Type u_13}
[Finite α]
(f : α →₀ M)


@[simp, nolint simpNF]
theorem zero_apply [Zero α] (i : m) (j : n) : (0 : Matrix m n α) i j = 0

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[Zero α]
(i : m)
(j : n)


@[to_additive (attr := simp, norm_cast)]
theorem const_smul [SMul M G] (n : M) (a : G) : (↑(n • a) : Germ l G) = n • (↑a : Germ l G)

{α : Type u_1}
{l : Filter α}
{M : Type u_5}
{G : Type u_6}
[SMul M G]
(n : M)
(a : G)


theorem StrictRestriction.eq_restrict (h : N <r M) : M ↾ N.E = N

{α : Type u_1}
{M N : Matroid α}
(h : N.StrictRestriction M)


/-- If `f x ∈ s ∈ 𝓝 (f x)` for continuous `f`, then `f y ∈ s` near `x`.

This is essentially `Filter.Tendsto.eventually_mem`, but infers in more cases when applied. -/
theorem ContinuousAt.eventually_mem {f : X → Y} {x : X} (hf : ContinuousAt f x) {s : Set Y}
    (hs : s ∈ 𝓝 (f x)) : ∀ᶠ y in 𝓝 x, f y ∈ s

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
{x : X}
(hf : ContinuousAt f x)
{s : Set Y}
(hs : s ∈ 𝓝 (f x))


@[simp]
theorem mk₂'_apply (f : M → N → Pₗ) {H1 H2 H3 H4} (m : M) (n : N) :
    (mk₂' R S f H1 H2 H3 H4 : M →ₗ[R] N →ₗ[S] Pₗ) m n = f m n

{H1 : ∀ (m₁ m₂ : M) (n : N), f (m₁ + m₂) n = f m₁ n + f m₂ n}

{H2 : ∀ (c : R) (m : M) (n : N), f (c • m) n = c • f m n}

{H3 : ∀ (m : M) (n₁ n₂ : N), f m (n₁ + n₂) = f m n₁ + f m n₂}

{H4 : ∀ (c : S) (m : M) (n : N), f m (c • n) = c • f m n}

((LinearMap.mk₂' R S f H1 H2 H3 H4) m) n = f m n


@[to_additive (attr := simp, nolint simpNF)]
theorem tprod_univ (f : β → α) : ∏' x : (Set.univ : Set β), f x = ∏' x, f x

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
(f : β → α)

∏' (x : ↑Set.univ), f ↑x = ∏' (x : β), f x


/-- Let `e` be a partial homeomorphism of `B × F`.  Suppose that at every point `p` in the source of
`e`, there is some neighbourhood `s` of `p` on which `e` is equal to a bi-smooth fiberwise linear
partial homeomorphism.
Then the source of `e` is of the form `U ×ˢ univ`, for some set `U` in `B`, and, at any point `x` in
`U`, admits a neighbourhood `u` of `x` such that `e` is equal on `u ×ˢ univ` to some bi-smooth
fiberwise linear partial homeomorphism. -/
theorem SmoothFiberwiseLinear.locality_aux₁ (e : PartialHomeomorph (B × F) (B × F))
    (h : ∀ p ∈ e.source, ∃ s : Set (B × F), IsOpen s ∧ p ∈ s ∧
      ∃ (φ : B → F ≃L[𝕜] F) (u : Set B) (hu : IsOpen u)
        (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => (φ x : F →L[𝕜] F)) u)
        (h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ((φ x).symm : F →L[𝕜] F)) u),
          (e.restr s).EqOnSource
            (FiberwiseLinear.partialHomeomorph φ hu hφ.continuousOn h2φ.continuousOn)) :
    ∃ U : Set B, e.source = U ×ˢ univ ∧ ∀ x ∈ U,
        ∃ (φ : B → F ≃L[𝕜] F) (u : Set B) (hu : IsOpen u) (_huU : u ⊆ U) (_hux : x ∈ u),
          ∃ (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => (φ x : F →L[𝕜] F)) u)
            (h2φ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ((φ x).symm : F →L[𝕜] F)) u),
            (e.restr (u ×ˢ univ)).EqOnSource
              (FiberwiseLinear.partialHomeomorph φ hu hφ.continuousOn h2φ.continuousOn)

(h :
  ∀ p ∈ e.source,
    ∃ s,
      IsOpen s ∧
        p ∈ s ∧
          ∃ φ u,
            ∃ (hu : IsOpen u) (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ x)) u) (h2φ :
              SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ x).symm) u),
              (e.restr s).EqOnSource (FiberwiseLinear.partialHomeomorph φ hu ⋯ ⋯))

∃ U,
  e.source = U ×ˢ Set.univ ∧
    ∀ x ∈ U,
      ∃ φ u,
        ∃ (hu : IsOpen u) (_ : u ⊆ U) (_ : x ∈ u) (hφ : SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ x)) u) (h2φ :
          SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun x => ↑(φ x).symm) u),
          (e.restr (u ×ˢ Set.univ)).EqOnSource (FiberwiseLinear.partialHomeomorph φ hu ⋯ ⋯)


/-- Interpreting the legs of a cocone as a costructured arrow, interpreting this arrow as an arrow
    over the cocone point, and finally forgetting the arrow is the same as just applying the
    functor the cocone was over. -/
@[simps!]
def Cocone.toCostructuredArrowCompToOverCompForget {F : J ⥤ C} (c : Cocone F) :
    c.toCostructuredArrow ⋙ CostructuredArrow.toOver _ _ ⋙ Over.forget _ ≅ F

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : CategoryTheory.Functor J C}
(c : CategoryTheory.Limits.Cocone F)
(X : J)

c.toCostructuredArrowCompToOverCompForget.hom.app X = CategoryTheory.CategoryStruct.id (F.obj X)


@[to_additive]
theorem coe_mker (f : F) : (mker f : Set M) = (f : M → N) ⁻¹' {1}

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
{F : Type u_5}
[FunLike F M N]
[mc : AddMonoidHomClass F M N]
(f : F)


lemma bot_mul_of_pos {x : EReal} (h : 0 < x) : ⊥ * x = ⊥


theorem minSqFac_dvd {n d : ℕ} (h : n.minSqFac = some d) : d * d ∣ n


/-- Given a `k`-linear `G`-representation `(A, ρ₁)`, this is the 'internal Hom' functor sending
`(B, ρ₂)` to the representation `Homₖ(A, B)` that maps `g : G` and `f : A →ₗ[k] B` to
`(ρ₂ g) ∘ₗ f ∘ₗ (ρ₁ g⁻¹)`. -/
@[simps]
protected def ihom (A : Rep k G) : Rep k G ⥤ Rep k G

{k G : Type u}
[CommRing k]
[Group G]
(A B : Rep k G)


@[simp]
theorem coe_tanPartialHomeomorph : ⇑tanPartialHomeomorph = tan


theorem LECmp.cmp_iff_ge [LE α] [LECmp (α := α) cmp] : cmp x y ≠ .lt ↔ y ≤ x

{α : Type u_1}
{cmp : α → α → Ordering}
{x y : α}
[LE α]
[Batteries.LECmp cmp]


@[simp]
theorem map_atBot (e : α ≃o β) : map (e : α → β) atBot = atBot

{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
(e : α ≃o β)

Filter.map (⇑e) Filter.atBot = Filter.atBot


@[to_additive]
theorem inv_lt_div_iff_lt_mul' : b⁻¹ < a / c ↔ c < a * b

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


@[simp]
theorem toDual_lt_toDual_iff {a b : WithBot α} : WithBot.toDual a < WithBot.toDual b ↔ b < a


theorem measurableSet_inter_le_const_iff (hτ : IsStoppingTime f τ) (s : Set Ω) (i : ι) :
    MeasurableSet[hτ.measurableSpace] (s ∩ {ω | τ ω ≤ i}) ↔
      MeasurableSet[(hτ.min_const i).measurableSpace] (s ∩ {ω | τ ω ≤ i})

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[LinearOrder ι]
{f : MeasureTheory.Filtration ι m}
{τ : Ω → ι}
(hτ : MeasureTheory.IsStoppingTime f τ)
(s : Set Ω)
(i : ι)

MeasurableSet (s ∩ {ω | τ ω ≤ i}) ↔ MeasurableSet (s ∩ {ω | τ ω ≤ i})


@[simp]
theorem cocone_inl (h : IsPushout f g inl inr) : h.cocone.inl = inl

(h : CategoryTheory.IsPushout f g inl inr)


theorem lipschitzWith_smul (s : α) : LipschitzWith ‖s‖₊ (s • · : β → β)

{α : Type u_1}
{β : Type u_2}
[SeminormedAddGroup α]
[SeminormedAddGroup β]
[SMulZeroClass α β]
[BoundedSMul α β]
(s : α)


theorem iff_iff_and_or_not_and_not : (a ↔ b) ↔ a ∧ b ∨ ¬a ∧ ¬b


@[to_additive]
theorem one_mem_one : (1 : α) ∈ (1 : Interval α)


@[simp]
lemma sum_zero : Measure.sum (fun (_ : ι) ↦ (0 : Measure α)) = 0

{α : Type u_1}
{ι : Type u_5}
{m0 : MeasurableSpace α}

(MeasureTheory.Measure.sum fun x => 0) = 0


theorem ext_iff_natDegree_le {p q : R[X]} {n : ℕ} (hp : p.natDegree ≤ n) (hq : q.natDegree ≤ n) :
    p = q ↔ ∀ i ≤ n, p.coeff i = q.coeff i

{R : Type u}
[Semiring R]
{p q : R[X]}
{n : ℕ}
(hp : p.natDegree ≤ n)
(hq : q.natDegree ≤ n)


@[to_additive (attr := simp)]
theorem invRev_empty : invRev ([] : List (α × Bool)) = []


@[to_additive (attr := simp)]
lemma units_bot : (⊥ : Submonoid M).units = ⊥


@[to_additive (attr := simp)]
lemma mul_inv_cancel_comm (a b : G) : a * b * a⁻¹ = b

{G : Type u_1}
[AddCommGroup G]
(a b : G)


@[to_additive (attr := simp)]
theorem mul_val_inv (h : IsUnit a) : a * ↑h.unit⁻¹ = 1

{M : Type u_1}
[Monoid M]
{a : M}
(h : IsUnit a)


@[simp]
theorem singleton_disjoint {l : Multiset α} {a : α} : Disjoint {a} l ↔ a ∉ l


theorem nhdsWithin_Ioi_eq_bot_iff {a : α} : 𝓝[>] a = ⊥ ↔ IsTop a ∨ ∃ b, a ⋖ b

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{a : α}


@[simp]
theorem mk_eq_zero [Zero α] [Preorder α] {x : α} (hx : 0 ≤ x) :
    (⟨x, hx⟩ : { x : α // 0 ≤ x }) = 0 ↔ x = 0

{α : Type u_1}
[Zero α]
[Preorder α]
{x : α}
(hx : 0 ≤ x)


@[to_additive (attr := simp)]
theorem le_mul_iff : h ≤ f * g ↔ ∀ ⦃s⦄, s ∈ f → ∀ ⦃t⦄, t ∈ g → s * t ∈ h

{α : Type u_2}
[Mul α]
{f g h : Filter α}

h ≤ f * g ↔ ∀ ⦃s : Set α⦄, s ∈ f → ∀ ⦃t : Set α⦄, t ∈ g → s * t ∈ h


@[reassoc (attr := simp)]
lemma lift_fst {T X Y : C} (f : T ⟶ X) (g : T ⟶ Y) : lift f g ≫ fst _ _ = f

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.ChosenFiniteProducts.lift f g)
    (CategoryTheory.ChosenFiniteProducts.fst X Y) =
  f


protected theorem neg (h : Irrational x) : Irrational (-x)


theorem add : ∀ {x y : PGame} (_ : Numeric x) (_ : Numeric y), Numeric (x + y)


private theorem exists_algHom_adjoin_of_splits'' {L : IntermediateField F E}
    (f : L →ₐ[F] K) (hK : ∀ s ∈ S, IsIntegral L s ∧ (minpoly L s).Splits f.toRingHom) :
    ∃ φ : adjoin L S →ₐ[F] K, φ.comp (IsScalarTower.toAlgHom F L _) = f

(hK : ∀ s ∈ S, IsIntegral (↥L) s ∧ Polynomial.Splits f.toRingHom (minpoly (↥L) s))

∃ φ, φ.comp (IsScalarTower.toAlgHom F ↥L ↥(IntermediateField.adjoin (↥L) S)) = f


theorem finset_sum_apply {m : MeasurableSpace α} (I : Finset ι) (μ : ι → Measure α) (s : Set α) :
    (∑ i ∈ I, μ i) s = ∑ i ∈ I, μ i s

{α : Type u_1}
{ι : Type u_5}
{m : MeasurableSpace α}
(I : Finset ι)
(μ : ι → MeasureTheory.Measure α)
(s : Set α)


@[simp]
theorem Polynomial.quotQuotEquivComm_symm_mk_mk (p : R[X]) :
    (Polynomial.quotQuotEquivComm I f).symm (Ideal.Quotient.mk (span
    ({(Ideal.Quotient.mk (I.map C)) f} : Set (R[X] ⧸ (I.map C)))) (Ideal.Quotient.mk (I.map C) p)) =
      Ideal.Quotient.mk (span {f.map (Ideal.Quotient.mk I)}) (p.map (Ideal.Quotient.mk I))

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

(AdjoinRoot.Polynomial.quotQuotEquivComm I f).symm
    ((Ideal.Quotient.mk (Ideal.span {(Ideal.Quotient.mk (Ideal.map Polynomial.C I)) f}))
      ((Ideal.Quotient.mk (Ideal.map Polynomial.C I)) p)) =
  (Ideal.Quotient.mk (Ideal.span {Polynomial.map (Ideal.Quotient.mk I) f})) (Polynomial.map (Ideal.Quotient.mk I) p)


theorem pushoutCoconeOfLeftIso_ι_app_none : (pushoutCoconeOfLeftIso f g).ι.app none = g

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

(CategoryTheory.Limits.pushoutCoconeOfLeftIso f g).ι.app none = g


/-- The range of a surjective ring homomorphism is the whole of the codomain. -/
@[simp]
theorem rangeS_top_of_surjective (f : R →+* S) (hf : Function.Surjective f) :
    f.rangeS = (⊤ : Subsemiring S)

{R : Type u}
{S : Type v}
[NonAssocSemiring R]
[NonAssocSemiring S]
(f : R →+* S)
(hf : Function.Surjective ⇑f)


theorem orderHom_eq_id [Subsingleton α] (g : α →o α) : g = OrderHom.id

{α : Type u_2}
[Preorder α]
[Subsingleton α]
(g : α →o α)


lemma tendsto_densityProcess_atTop_of_antitone (κ : Kernel α (γ × β)) (ν : Kernel α γ)
    [IsFiniteKernel κ] (n : ℕ) (a : α) (x : γ)
    (seq : ℕ → Set β) (hseq : Antitone seq) (hseq_iInter : ⋂ i, seq i = ∅)
    (hseq_meas : ∀ m, MeasurableSet (seq m)) :
    Tendsto (fun m ↦ densityProcess κ ν n a x (seq m)) atTop (𝓝 0)

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

(hseq_meas : ∀ (m : ℕ), MeasurableSet (seq m))

Filter.Tendsto (fun m => κ.densityProcess ν n a x (seq m)) Filter.atTop (𝓝 0)


theorem nhds_mkOfNhds_of_hasBasis {n : α → Filter α} {ι : α → Sort*} {p : ∀ a, ι a → Prop}
    {s : ∀ a, ι a → Set α} (hb : ∀ a, (n a).HasBasis (p a) (s a))
    (hpure : ∀ a i, p a i → a ∈ s a i) (hopen : ∀ a i, p a i → ∀ᶠ x in n a, s a i ∈ n x) (a : α) :
    @nhds α (.mkOfNhds n) a = n a

(hb : ∀ (a : α), (n a).HasBasis (p a) (s a))

(hpure : ∀ (a : α) (i : ι a), p a i → a ∈ s a i)

(hopen : ∀ (a : α) (i : ι a), p a i → ∀ᶠ (x : α) in n a, s a i ∈ n x)


@[to_additive]
theorem Pi.hasProd {f : ι → ∀ x, π x} {g : ∀ x, π x} :
    HasProd f g ↔ ∀ x, HasProd (fun i ↦ f i x) (g x)

{α : Type u_1}
{ι : Type u_5}
{π : α → Type u_6}
[(x : α) → AddCommMonoid (π x)]
[(x : α) → TopologicalSpace (π x)]
{f : ι → (x : α) → π x}
{g : (x : α) → π x}

HasSum f g ↔ ∀ (x : α), HasSum (fun i => f i x) (g x)


theorem HasStrictDerivAt.div_const (hc : HasStrictDerivAt c c' x) (d : 𝕜') :
    HasStrictDerivAt (fun x => c x / d) (c' / d) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{c : 𝕜 → 𝕜'}
{c' : 𝕜'}
(hc : HasStrictDerivAt c c' x)
(d : 𝕜')


@[simp]
theorem mem_unop {x : A} {S : Subalgebra R Aᵐᵒᵖ} : x ∈ S.unop ↔ MulOpposite.op x ∈ S

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{x : A}
{S : Subalgebra R Aᵐᵒᵖ}


theorem destruct_tail (s : WSeq α) : destruct (tail s) = destruct s >>= tail.aux

s.tail.destruct = s.destruct >>= Stream'.WSeq.tail.aux


lemma Indep.insert_basis_iff_mem_closure (hI : M.Indep I) :
    M.Basis I (insert e I) ↔ e ∈ M.closure I

{α : Type u_2}
{M : Matroid α}
{e : α}
{I : Set α}
(hI : M.Indep I)


theorem tendstoLocallyUniformlyOn_sUnion (S : Set (Set α)) (hS : ∀ s ∈ S, IsOpen s)
    (h : ∀ s ∈ S, TendstoLocallyUniformlyOn F f p s) : TendstoLocallyUniformlyOn F f p (⋃₀ S)

{F : ι → α → β}


protected theorem mul_dvd_mul_right (h: a ∣ b) (c : Nat) : a * c ∣ b * c


protected theorem Function.LeftInverse.embedding {f : X → Y} {g : Y → X} (h : LeftInverse f g)
    (hf : Continuous f) (hg : Continuous g) : _root_.Embedding g

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
{g : Y → X}
(h : Function.LeftInverse f g)
(hf : Continuous f)
(hg : Continuous g)


/-- The region between two a.e.-measurable functions on a null-measurable set is null-measurable. -/
lemma nullMeasurableSet_regionBetween (μ : Measure α)
    {f g : α → ℝ} (f_mble : AEMeasurable f μ) (g_mble : AEMeasurable g μ)
    {s : Set α} (s_mble : NullMeasurableSet s μ) :
    NullMeasurableSet {p : α × ℝ | p.1 ∈ s ∧ p.snd ∈ Ioo (f p.fst) (g p.fst)} (μ.prod volume)

(s_mble : MeasureTheory.NullMeasurableSet s μ)

MeasureTheory.NullMeasurableSet {p | p.1 ∈ s ∧ p.2 ∈ Set.Ioo (f p.1) (g p.1)} (μ.prod MeasureTheory.volume)


/-- If a property of a germ of function `g` on a pointed set `(s, x)` is invariant under the
structure groupoid (by composition in the source space and in the target space), then
expressing it in charted spaces does not depend on the element of the maximal atlas one uses
both in the source and in the target manifolds, provided they are defined around `x` and `g x`
respectively, and provided `g` is continuous within `s` at `x` (otherwise, the local behavior
of `g` at `x` can not be captured with a chart in the target). -/
theorem liftPropWithinAt_indep_chart_aux (he : e ∈ G.maximalAtlas M) (xe : x ∈ e.source)
    (he' : e' ∈ G.maximalAtlas M) (xe' : x ∈ e'.source) (hf : f ∈ G'.maximalAtlas M')
    (xf : g x ∈ f.source) (hf' : f' ∈ G'.maximalAtlas M') (xf' : g x ∈ f'.source)
    (hgs : ContinuousWithinAt g s x) :
    P (f ∘ g ∘ e.symm) (e.symm ⁻¹' s) (e x) ↔ P (f' ∘ g ∘ e'.symm) (e'.symm ⁻¹' s) (e' x)

(he : e ∈ StructureGroupoid.maximalAtlas M G)

(he' : e' ∈ StructureGroupoid.maximalAtlas M G)

(hf : f ∈ StructureGroupoid.maximalAtlas M' G')

(hf' : f' ∈ StructureGroupoid.maximalAtlas M' G')

P (↑f ∘ g ∘ ↑e.symm) (↑e.symm ⁻¹' s) (↑e x) ↔ P (↑f' ∘ g ∘ ↑e'.symm) (↑e'.symm ⁻¹' s) (↑e' x)


/-- Technical lemma for `quotientEquiv`. -/
theorem unop_left_comp_ofMkLEMk_unop {A : CostructuredArrow S T} {P Q : (CostructuredArrow S T)ᵒᵖ}
    {f : P ⟶ op A} {g : Q ⟶ op A} [Mono f.unop.left.op] [Mono g.unop.left.op]
    (h : Subobject.mk f.unop.left.op ≤ Subobject.mk g.unop.left.op) :
    g.unop.left ≫ (Subobject.ofMkLEMk f.unop.left.op g.unop.left.op h).unop = f.unop.left

{A : CategoryTheory.CostructuredArrow S T}

{P Q : (CategoryTheory.CostructuredArrow S T)ᵒᵖ}

(h : CategoryTheory.Subobject.mk f.unop.left.op ≤ CategoryTheory.Subobject.mk g.unop.left.op)

CategoryTheory.CategoryStruct.comp g.unop.left
    (CategoryTheory.Subobject.ofMkLEMk f.unop.left.op g.unop.left.op h).unop =
  f.unop.left


theorem span_single_image (s : Set M) (a : α) :
    Submodule.span R (single a '' s) = (Submodule.span R s).map (lsingle a : M →ₗ[R] α →₀ M)

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

Submodule.span R (Finsupp.single a '' s) = Submodule.map (Finsupp.lsingle a) (Submodule.span R s)


@[simp]
theorem factorThruImageSubobject_comp_self_assoc {W W' : C} (k : W ⟶ W') (k' : W' ⟶ X) (h) :
    (imageSubobject f).factorThru (k ≫ k' ≫ f) h = k ≫ k' ≫ factorThruImageSubobject f

(h : (CategoryTheory.Limits.imageSubobject f).Factors (k ≫ k' ≫ f))

(CategoryTheory.Limits.imageSubobject f).factorThru (k ≫ k' ≫ f) h =
  k ≫ k' ≫ CategoryTheory.Limits.factorThruImageSubobject f


theorem top_eq_id (B : C) : (⊤ : Subobject B) = Subobject.mk (𝟙 B)

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


/-- A module facet name along with proof of its data type. -/
structure ModuleFacet (α) where
  /-- The name of the module facet. -/
  name : Name
  /-- Proof that module's facet build result is of type α. -/
  data_eq : ModuleData name = α
  deriving Repr


/-- The functor `Arrow (Arrow C) ⥤ Square C` which sends
a morphism `Arrow.mk f ⟶ Arrow.mk g` to the commutative square
with `f` on the left side and `g` on the right side. -/
@[simps!]
def fromArrowArrowFunctor : Arrow (Arrow C) ⥤ Square C

{C : Type u}
[CategoryTheory.Category.{v, u} C]

∀ {X Y : CategoryTheory.Arrow (CategoryTheory.Arrow C)} (φ : X ⟶ Y),
  (CategoryTheory.Square.fromArrowArrowFunctor.map φ).τ₄ = φ.right.right


theorem isSeparator_op_iff (G : C) : IsSeparator (op G) ↔ IsCoseparator G

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

CategoryTheory.IsSeparator (Opposite.op G) ↔ CategoryTheory.IsCoseparator G


@[to_additive (attr := simp,norm_cast)]
theorem coe_one : ((1 : UpperSet α) : Set α) = Set.Ici 1


theorem tensorFunc_map_app {X Y : F C} (f : X ⟶ Y) (n) : ((tensorFunc C).map f).app n = _ ◁ f

{X Y : CategoryTheory.FreeMonoidalCategory C}

(n : (CategoryTheory.Discrete ∘ CategoryTheory.FreeMonoidalCategory.NormalMonoidalObject) C)

((CategoryTheory.FreeMonoidalCategory.tensorFunc C).map f).app n =
  CategoryTheory.MonoidalCategory.whiskerLeft (CategoryTheory.FreeMonoidalCategory.inclusion.obj { as := n.as }) f


@[to_additive]
theorem UniformContinuous.const_smul [UniformContinuousConstSMul M X] {f : Y → X}
    (hf : UniformContinuous f) (c : M) : UniformContinuous (c • f)

{M : Type v}
{X : Type x}
{Y : Type y}
[UniformSpace X]
[UniformSpace Y]
[VAdd M X]
[UniformContinuousConstVAdd M X]
{f : Y → X}
(hf : UniformContinuous f)
(c : M)


lemma map_comp [IsDirected ι (· ≤ ·)]
    (g₁ : (i : ι) → G i →ₗ[R] G' i) (g₂ : (i : ι) → G' i →ₗ[R] G'' i)
    (hg₁ : ∀ i j h, g₁ j ∘ₗ f i j h = f' i j h ∘ₗ g₁ i)
    (hg₂ : ∀ i j h, g₂ j ∘ₗ f' i j h = f'' i j h ∘ₗ g₂ i) :
    (map g₂ hg₂ ∘ₗ map g₁ hg₁ :
      DirectLimit G f →ₗ[R] DirectLimit G'' f'') =
    (map (fun i ↦ g₂ i ∘ₗ g₁ i) fun i j h ↦ by
        rw [LinearMap.comp_assoc, hg₁ i, ← LinearMap.comp_assoc, hg₂ i, LinearMap.comp_assoc] :
      DirectLimit G f →ₗ[R] DirectLimit G'' f'')

{f' : (i j : ι) → i ≤ j → G' i →ₗ[R] G' j}

{f'' : (i j : ι) → i ≤ j → G'' i →ₗ[R] G'' j}

(hg₁ : ∀ (i j : ι) (h : i ≤ j), g₁ j ∘ₗ f i j h = f' i j h ∘ₗ g₁ i)

(hg₂ : ∀ (i j : ι) (h : i ≤ j), g₂ j ∘ₗ f' i j h = f'' i j h ∘ₗ g₂ i)

Module.DirectLimit.map g₂ hg₂ ∘ₗ Module.DirectLimit.map g₁ hg₁ = Module.DirectLimit.map (fun i => g₂ i ∘ₗ g₁ i) ⋯


protected theorem eq (a b : V) :
    (a : WeaklyConnectedComponent V) = b ↔ Nonempty (@Path (Symmetrify V) _ a b)

Quiver.WeaklyConnectedComponent.mk a = Quiver.WeaklyConnectedComponent.mk b ↔ Nonempty (Quiver.Path a b)


/-- The equivalence `Karoubi (ChainComplex C α) ≌ ChainComplex (Karoubi C) α`. -/
@[simps!]
def karoubiChainComplexEquivalence : Karoubi (ChainComplex C α) ≌ ChainComplex (Karoubi C) α

(P : CategoryTheory.Idempotents.Karoubi (HomologicalComplex C (ComplexShape.down α)))

((CategoryTheory.Idempotents.karoubiChainComplexEquivalence C α).unitIso.inv.app P).f.f n = P.p.f n


@[reassoc (attr := simp)]
theorem whiskerLeft_hom_inv' (X : C) {Y Z : C} (f : Y ⟶ Z) [IsIso f] :
    X ◁ f ≫ X ◁ inv f = 𝟙 (X ⊗ Y)

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.whiskerLeft X f)
    (CategoryTheory.MonoidalCategory.whiskerLeft X (CategoryTheory.inv f)) =
  CategoryTheory.CategoryStruct.id (CategoryTheory.MonoidalCategory.tensorObj X Y)


theorem hom_trivializationAt_apply (x₀ : B)
    (x : TotalSpace (F₁ →SL[σ] F₂) (Bundle.ContinuousLinearMap σ E₁ E₂)) :
    trivializationAt (F₁ →SL[σ] F₂) (fun x => E₁ x →SL[σ] E₂ x) x₀ x =
      ⟨x.1, inCoordinates F₁ E₁ F₂ E₂ x₀ x.1 x₀ x.1 x.2⟩

(σ : 𝕜₁ →+* 𝕜₂)

[TopologicalSpace (Bundle.TotalSpace F₁ E₁)]

[TopologicalSpace (Bundle.TotalSpace F₂ E₂)]

(x : Bundle.TotalSpace (F₁ →SL[σ] F₂) (Bundle.ContinuousLinearMap σ E₁ E₂))

↑(trivializationAt (F₁ →SL[σ] F₂) (fun x => E₁ x →SL[σ] E₂ x) x₀) x =
  (x.proj, ContinuousLinearMap.inCoordinates F₁ E₁ F₂ E₂ x₀ x.proj x₀ x.proj x.snd)


@[simp]
theorem toMulEquiv_eq_coe (f : R ≃+* S) : f.toMulEquiv = ↑f

{R : Type u_4}
{S : Type u_5}
[Mul R]
[Mul S]
[Add R]
[Add S]
(f : R ≃+* S)


/-- An ordered variant of `primeSpectrumEquiv`. -/
@[simps!]
def primeSpectrumOrderEquiv : (PrimeSpectrum A)ᵒᵈ ≃o {S // A ≤ S}

{K : Type u}
[Field K]
(A : ValuationSubring K)
(S : { S // A ≤ S })

↑((RelIso.symm A.primeSpectrumOrderEquiv) S).asIdeal = ⇑(A.inclusion ↑S ⋯) ⁻¹' ↑(LocalRing.maximalIdeal ↥↑S)


theorem absNorm_nonneg (I : FractionalIdeal R⁰ K) : 0 ≤ absNorm I

(I : FractionalIdeal (nonZeroDivisors R) K)


lemma commSq : CommSq (p.map φ) (eqToHom (domain_eq p f φ)) (eqToHom (codomain_eq p f φ)) f

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

CategoryTheory.CommSq (p.map φ) (CategoryTheory.eqToHom ⋯) (CategoryTheory.eqToHom ⋯) f


@[simp]
theorem ofDual_lt_ofDual [LT α] {a b : αᵒᵈ} : ofDual a < ofDual b ↔ b < a

OrderDual.ofDual a < OrderDual.ofDual b ↔ b < a


theorem mul_int_iff (hm : m ≠ 0) : LiouvilleWith p (x * m) ↔ LiouvilleWith p x

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


theorem Rat.den_pos (self : Rat) : 0 < self.den


theorem coeff_coe (i : ℤ) :
    ((f : PowerSeries R) : LaurentSeries R).coeff i =
      if i < 0 then 0 else PowerSeries.coeff R i.natAbs f

{R : Type u_1}
[Semiring R]
(f : PowerSeries R)
(i : ℤ)

((HahnSeries.ofPowerSeries ℤ R) f).coeff i = if i < 0 then 0 else (PowerSeries.coeff R i.natAbs) f


@[simp]
theorem toSigma_ofSigma : ∀ s : Σa : α, β a → WType β, toSigma (ofSigma s) = s

{α : Type u_1}
{β : α → Type u_2}
(s : (a : α) × (β a → WType β))


theorem inr_map_mul (b₁ b₂ : B) :
    LinearMap.inr R A B (b₁ * b₂) = LinearMap.inr R A B b₁ * LinearMap.inr R A B b₂

{R : Type u}
[Semiring R]
{A : Type u_4}
[NonUnitalNonAssocSemiring A]
[Module R A]
{B : Type u_5}
[NonUnitalNonAssocSemiring B]
[Module R B]
(b₁ b₂ : B)

(LinearMap.inr R A B) (b₁ * b₂) = (LinearMap.inr R A B) b₁ * (LinearMap.inr R A B) b₂


/-- The identity partial equivalence on a set `s` -/
@[simps! (config := mfld_cfg) apply, simps! (config := .lemmasOnly) source target]
def ofSet (s : Set X) (hs : IsOpen s) : PartialHomeomorph X X

{X : Type u_1}
[TopologicalSpace X]
(s : Set X)
(hs : IsOpen s)

(PartialHomeomorph.ofSet s hs).target = s


protected theorem Reachable.map {u v : V} {G : SimpleGraph V} {G' : SimpleGraph V'} (f : G →g G')
    (h : G.Reachable u v) : G'.Reachable (f u) (f v)

{V : Type u}
{V' : Type v}
{u v : V}
{G : SimpleGraph V}
{G' : SimpleGraph V'}
(f : G →g G')
(h : G.Reachable u v)


@[simp]
theorem untrop_max (x y : Tropical R) : untrop (max x y) = max (untrop x) (untrop y)

{R : Type u}
[LinearOrder R]
(x y : Tropical R)

Tropical.untrop (max x y) = max (Tropical.untrop x) (Tropical.untrop y)


@[simp]
lemma Functor.mapHomotopyCategory_map (F : V ⥤ W) [F.Additive] {c : ComplexShape ι}
    {K L : HomologicalComplex V c} (f : K ⟶ L) :
    (F.mapHomotopyCategory c).map ((HomotopyCategory.quotient V c).map f) =
      (HomotopyCategory.quotient W c).map ((F.mapHomologicalComplex c).map f)

{ι : Type u_2}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{W : Type u_3}
[CategoryTheory.Category.{u_4, u_3} W]
[CategoryTheory.Preadditive W]
(F : V ⥤ W)
[F.Additive]
{c : ComplexShape ι}
{K L : HomologicalComplex V c}
(f : K ⟶ L)


/-- Integral of `|x - a| ^ n` over `Ι a b`. This integral appears in the proof of the
Picard-Lindelöf/Cauchy-Lipschitz theorem. -/
theorem integral_pow_abs_sub_uIoc : ∫ x in Ι a b, |x - a| ^ n = |b - a| ^ (n + 1) / (n + 1)


@[to_additive]
theorem div_le_div_flip {α : Type*} [CommGroup α] [LinearOrder α]
    [CovariantClass α α (· * ·) (· ≤ ·)] {a b : α} : a / b ≤ b / a ↔ a ≤ b

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


lemma condIndepSet_iff (s t : Set Ω) (hs : MeasurableSet s) (ht : MeasurableSet t)
    (μ : Measure Ω) [IsFiniteMeasure μ] :
    CondIndepSet m' hm' s t μ ↔ (μ⟦s ∩ t | m'⟧) =ᵐ[μ] (μ⟦s | m'⟧) * (μ⟦t | m'⟧)

{Ω : Type u_1}
(m' : MeasurableSpace Ω)
{mΩ : MeasurableSpace Ω}
[StandardBorelSpace Ω]
[Nonempty Ω]
(hm' : m' ≤ mΩ)
(s t : Set Ω)
(hs : MeasurableSet s)
(ht : MeasurableSet t)
(μ : MeasureTheory.Measure Ω)
[MeasureTheory.IsFiniteMeasure μ]

ProbabilityTheory.CondIndepSet m' hm' s t μ ↔
  μ[(s ∩ t).indicator fun ω => 1|m'] =ᵐ[μ] μ[s.indicator fun ω => 1|m'] * μ[t.indicator fun ω => 1|m']


/-- A version of `Set.indicator_sub` for `MeasureTheory.indicatorConstLp`.-/
theorem indicatorConstLp_sub {c' : E} :
    indicatorConstLp p hs hμs c - indicatorConstLp p hs hμs c' =
    indicatorConstLp p hs hμs (c - c')

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{s : Set α}
{hs : MeasurableSet s}
{hμs : μ s ≠ ⊤}
{c c' : E}

MeasureTheory.indicatorConstLp p hs hμs c - MeasureTheory.indicatorConstLp p hs hμs c' =
  MeasureTheory.indicatorConstLp p hs hμs (c - c')


/-- Constructing an affine map and coercing back to a function
produces the same map. -/
@[simp]
theorem coe_mk (f : P1 → P2) (linear add) : ((mk f linear add : P1 →ᵃ[k] P2) : P1 → P2) = f

(add : ∀ (p : P1) (v : V1), f (v +ᵥ p) = linear v +ᵥ f p)

⇑{ toFun := f, linear := linear, map_vadd' := add } = f


/-- `IsIso` typeclass expressing that a morphism is invertible. -/
class IsIso (f : X ⟶ Y) : Prop where
  /-- The existence of an inverse morphism. -/
  out : ∃ inv : Y ⟶ X, f ≫ inv = 𝟙 X ∧ inv ≫ f = 𝟙 Y

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
{f : X ⟶ Y}
[self : CategoryTheory.IsIso f]

∃ inv,
  CategoryTheory.CategoryStruct.comp f inv = CategoryTheory.CategoryStruct.id X ∧
    CategoryTheory.CategoryStruct.comp inv f = CategoryTheory.CategoryStruct.id Y


@[simp, norm_cast] lemma coe_zero : ⇑(0 : Kernel α β) = 0

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}


theorem existsUnique_sub_zsmul_mem_Ioc {a : α} (ha : 0 < a) (b c : α) :
    ∃! m : ℤ, b - m • a ∈ Set.Ioc c (c + a)

{α : Type u_1}
[LinearOrderedAddCommGroup α]
[Archimedean α]
{a : α}
(ha : 0 < a)
(b c : α)


/-- The function
`fun t ↦ Ring.inverse (x + t) - (∑ i ∈ Finset.range n, (- x⁻¹ * t) ^ i) * x⁻¹`
is `O(t ^ n)` as `t → 0`. -/
theorem inverse_add_norm_diff_nth_order (x : Rˣ) (n : ℕ) :
    (fun t : R => inverse (↑x + t) - (∑ i ∈ range n, (-↑x⁻¹ * t) ^ i) * ↑x⁻¹) =O[𝓝 (0 : R)]
      fun t => ‖t‖ ^ n

{R : Type u_1}
[NormedRing R]
[CompleteSpace R]
(x : Rˣ)
(n : ℕ)

(fun t => Ring.inverse (↑x + t) - (∑ i ∈ Finset.range n, (-↑x⁻¹ * t) ^ i) * ↑x⁻¹) =O[𝓝 0] fun t => ‖t‖ ^ n


@[simp]
theorem iter_deriv_zpow' (m : ℤ) (k : ℕ) :
    (deriv^[k] fun x : 𝕜 => x ^ m) =
      fun x => (∏ i ∈ Finset.range k, ((m : 𝕜) - i)) * x ^ (m - k)

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(m : ℤ)
(k : ℕ)

(deriv^[k] fun x => x ^ m) = fun x => (∏ i ∈ Finset.range k, (↑m - ↑i)) * x ^ (m - ↑k)


/-- The unit isomorphism for `dgoEquivHomologicalComplex`.
-/
@[simps!]
def dgoEquivHomologicalComplexUnitIso :
    𝟭 (DifferentialObject ℤ (GradedObjectWithShift b V)) ≅
      dgoToHomologicalComplex b V ⋙ homologicalComplexToDGO b V

(X : CategoryTheory.DifferentialObject ℤ (CategoryTheory.GradedObjectWithShift b V))

((HomologicalComplex.dgoEquivHomologicalComplexUnitIso b V).inv.app X).f i = 𝟙 (X.obj i)


@[reassoc (attr := simp)]
lemma XXIsoOfEq_hom_ιTotal {x₁ y₁ : I₁} (h₁ : x₁ = y₁) {x₂ y₂ : I₂} (h₂ : x₂ = y₂)
    (i₁₂ : I₁₂) (h : ComplexShape.π c₁ c₂ c₁₂ (y₁, y₂) = i₁₂) :
    (K.XXIsoOfEq h₁ h₂).hom ≫ K.ιTotal c₁₂ y₁ y₂ i₁₂ h =
      K.ιTotal c₁₂ x₁ x₂ i₁₂ (by rw [h₁, h₂, h])

{C : Type u_1}
[CategoryTheory.Category.{u_5, u_1} C]
[CategoryTheory.Preadditive C]
{I₁ : Type u_2}
{I₂ : Type u_3}
{I₁₂ : Type u_4}
{c₁ : ComplexShape I₁}
{c₂ : ComplexShape I₂}
(K : HomologicalComplex₂ C c₁ c₂)
(c₁₂ : ComplexShape I₁₂)
[DecidableEq I₁₂]
[TotalComplexShape c₁ c₂ c₁₂]
[K.HasTotal c₁₂]
{x₁ y₁ : I₁}
(h₁ : x₁ = y₁)
{x₂ y₂ : I₂}
(h₂ : x₂ = y₂)
(i₁₂ : I₁₂)
(h : c₁.π c₂ c₁₂ (y₁, y₂) = i₁₂)

(HomologicalComplex₂.XXIsoOfEq C c₁ c₂ K h₁ h₂).hom ≫ K.ιTotal c₁₂ y₁ y₂ i₁₂ h = K.ιTotal c₁₂ x₁ x₂ i₁₂ ⋯


theorem head_zip (s₁ : Stream' α) (s₂ : Stream' β) : head (zip f s₁ s₂) = f (head s₁) (head s₂)

{α : Type u}
{β : Type v}
{δ : Type w}
(f : α → β → δ)
(s₁ : Stream' α)
(s₂ : Stream' β)

(Stream'.zip f s₁ s₂).head = f s₁.head s₂.head


lemma isomorphisms_eq_stalkwise :
    isomorphisms Scheme = (isomorphisms TopCat).inverseImage Scheme.forgetToTop ⊓
      stalkwise (fun f ↦ Function.Bijective f)

CategoryTheory.MorphismProperty.isomorphisms AlgebraicGeometry.Scheme =
  (CategoryTheory.MorphismProperty.isomorphisms TopCat).inverseImage AlgebraicGeometry.Scheme.forgetToTop ⊓
    AlgebraicGeometry.stalkwise fun {R S} [CommRing R] [CommRing S] f => Function.Bijective ⇑f


theorem eval₂Hom_rename : eval₂Hom f g (rename k p) = eval₂Hom f (g ∘ k) p

{σ : Type u_1}
{τ : Type u_2}
{R : Type u_4}
{S : Type u_5}
[CommSemiring R]
[CommSemiring S]
(f : R →+* S)
(k : σ → τ)
(g : τ → S)
(p : MvPolynomial σ R)

(MvPolynomial.eval₂Hom f g) ((MvPolynomial.rename k) p) = (MvPolynomial.eval₂Hom f (g ∘ k)) p


/-- (internal implementation) the limit cone of a functor,
implemented as flat sections of a pi type
-/
@[simps]
noncomputable def limitCone (F : J ⥤ TypeMax.{v, u}) : Cone F

(u : ((CategoryTheory.Functor.const J).obj ↑F.sections).obj j)

(CategoryTheory.Limits.Types.limitCone F).π.app j u = ↑u j


lemma strictMonoOn_one_sub_smoothingFn :
    StrictMonoOn (fun (x : ℝ) => (1 : ℝ) - ε x) (Set.Ioi 1)

StrictMonoOn (fun x => 1 - AkraBazziRecurrence.smoothingFn x) (Set.Ioi 1)


protected theorem sup {f g : ι → Ω → ℝ} (hf : Submartingale f ℱ μ) (hg : Submartingale g ℱ μ) :
    Submartingale (f ⊔ g) ℱ μ

{f g : ι → Ω → ℝ}

(hf : MeasureTheory.Submartingale f ℱ μ)

(hg : MeasureTheory.Submartingale g ℱ μ)


lemma shortExact_iff_of_iso (e : S₁ ≅ S₂) : S₁.ShortExact ↔ S₂.ShortExact


@[simp]
theorem coe_equivMapOfInjective_apply (f : R →+* S) (hf : Function.Injective f) (x : s) :
    (equivMapOfInjective s f hf x : S) = f x

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
(s : Subring R)
(f : R →+* S)
(hf : Function.Injective ⇑f)
(x : ↥s)

↑((s.equivMapOfInjective f hf) x) = f ↑x


lemma Indep.mem_closure_iff' (hI : M.Indep I) :
    x ∈ M.closure I ↔ x ∈ M.E ∧ (M.Indep (insert x I) → x ∈ I)

{α : Type u_2}
{M : Matroid α}
{I : Set α}
{x : α}
(hI : M.Indep I)


/-- The submodule containing all elements `x` of `M` such that `a • x = 0` for all `a` in `s`. -/
@[simps!]
def torsionBySet (s : Set R) : Submodule R M

(R : Type u_1)
(M : Type u_2)
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(s : Set R)

↑(Submodule.torsionBySet R M s) = ⋂ y ∈ s, ⇑(DistribMulAction.toLinearMap R M y) ⁻¹' {0}


@[simp]
lemma zero_lt_apply_root_root_iff : 0 < B (P.root i) (P.root j) ↔ 0 < P.pairing i j

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
{N : Type u_4}
[LinearOrderedCommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
{P : RootPairing ι R M N}
(B : M →ₗ[R] M →ₗ[R] R)
[P.IsRootPositive B]
(i j : ι)

0 < (B (P.root i)) (P.root j) ↔ 0 < P.pairing i j


theorem iSup₂_eq_bot {f : ∀ i, κ i → α} : ⨆ (i) (j), f i j = ⊥ ↔ ∀ i j, f i j = ⊥

{α : Type u_1}
{ι : Sort u_5}
{κ : ι → Sort u_7}
[CompleteLattice α]
{f : (i : ι) → κ i → α}

⨆ i, ⨆ j, f i j = ⊥ ↔ ∀ (i : ι) (j : κ i), f i j = ⊥


theorem isBounded_iff_forall_mem : IsBounded s ↔ ∀ x ∈ s, IsBounded s

∀ {x : Bornology α} {s : Set α}, Bornology.IsBounded s ↔ ∀ x_1 ∈ s, Bornology.IsBounded s


lemma le_slope_of_hasDerivWithinAt_Iio (hfc : ConcaveOn ℝ S f)
    (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y) (hf' : HasDerivWithinAt f f' (Iio y) y) :
    f' ≤ slope f x y

(hf' : HasDerivWithinAt f f' (Set.Iio y) y)


theorem HasBasis.eq_iInf (h : l.HasBasis (fun _ => True) s) : l = ⨅ i, 𝓟 (s i)

{α : Type u_1}
{ι : Sort u_4}
{l : Filter α}
{s : ι → Set α}
(h : l.HasBasis (fun x => True) s)


theorem subNatNat_self : ∀ n, subNatNat n n = 0


/-- If `Irreducible (cyclotomic n K)` (in particular for `K = ℚ`), the norm of `zeta n K L` is `1`
if `n` is odd. -/
theorem norm_zeta_eq_one [IsCyclotomicExtension {n} K L] (hn : n ≠ 2)
    (hirr : Irreducible (cyclotomic n K)) : norm K (zeta n K L) = 1

(hirr : Irreducible (Polynomial.cyclotomic (↑n) K))

(Algebra.norm K) (IsCyclotomicExtension.zeta n K L) = 1


@[to_additive (attr := simp)]
theorem prod_cons (a : α) (s) : prod (a ::ₘ s) = a * prod s

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


@[to_additive (attr := simp)]
theorem lift_comp_of' (f : FreeMagma α →ₙ* β) : lift (f ∘ of) = f

{α : Type u}
{β : Type v}
[Mul β]
(f : FreeMagma α →ₙ* β)


@[simp] theorem mul_ediv_mul_of_pos_left
    (a : Int) {b : Int} (c : Int) (H : 0 < b) : (a * b) / (c * b) = a / c