/-- Constructs an isomorphism of complete lattices from an order isomorphism between them. -/
@[simps]
def Iso.mk {α β : CompleteLat.{u}} (e : α ≃o β) : α ≅ β

{α β : CompleteLat}
(e : ↑α ≃o ↑β)
(a : ↑α)

(CompleteLat.Iso.mk e).hom.toFun a = e a


/-- Evaluation of functions into an indexed collection of non-unital rings at a point is a
non-unital ring homomorphism. This is `Function.eval` as a `NonUnitalRingHom`. -/
@[simps!]
def Pi.evalNonUnitalRingHom (f : I → Type v) [∀ i, NonUnitalNonAssocSemiring (f i)] (i : I) :
    (∀ i, f i) →ₙ+* f i

[(i : I) → NonUnitalNonAssocSemiring (f i)]


theorem mulSupport_comp_inv_smul [One γ] (c : α) (f : β → γ) :
    (mulSupport fun x ↦ f (c⁻¹ • x)) = c • mulSupport f

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Group α]
[MulAction α β]
[One γ]
(c : α)
(f : β → γ)

(Function.mulSupport fun x => f (c⁻¹ • x)) = c • Function.mulSupport f


theorem min_le_of_eq {s : Finset α} {a b : α} (h₁ : b ∈ s) (h₂ : s.min = a) : a ≤ b

{α : Type u_2}
[LinearOrder α]
{s : Finset α}
{a b : α}
(h₁ : b ∈ s)
(h₂ : s.min = ↑a)


theorem ofLE_mk_le_mk_of_comm {B A₁ A₂ : C} {f₁ : A₁ ⟶ B} {f₂ : A₂ ⟶ B} [Mono f₁] [Mono f₂]
    (g : A₁ ⟶ A₂) (w : g ≫ f₂ = f₁) :
    ofLE _ _ (mk_le_mk_of_comm g w) = (underlyingIso _).hom ≫ g ≫ (underlyingIso _).inv

(w : CategoryTheory.CategoryStruct.comp g f₂ = f₁)

(CategoryTheory.Subobject.mk f₁).ofLE (CategoryTheory.Subobject.mk f₂) ⋯ =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Subobject.underlyingIso f₁).hom
    (CategoryTheory.CategoryStruct.comp g (CategoryTheory.Subobject.underlyingIso f₂).inv)


@[to_additive (attr := simp)]
theorem lift_apply_inr (f : M →* P) (g : N →* P) (x : N) : lift f g (inr x) = g x

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[MulOneClass M]
[MulOneClass N]
[Monoid P]
(f : M →* P)
(g : N →* P)
(x : N)

(Monoid.Coprod.lift f g) (Monoid.Coprod.inr x) = g x


theorem SOppSide.trans {s : AffineSubspace R P} {x y z : P} (hxy : s.SOppSide x y)
    (hyz : s.SOppSide y z) : s.SSameSide x z

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y z : P}
(hxy : s.SOppSide x y)
(hyz : s.SOppSide y z)


theorem lift_spec {C} [Category C] (φ : V ⥤q C) : of ⋙q (lift φ).toPrefunctor = φ

{V : Type u₁}
[Quiver V]
{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
(φ : V ⥤q C)

CategoryTheory.Paths.of ⋙q (CategoryTheory.Paths.lift φ).toPrefunctor = φ


@[reassoc (attr := simp)]
lemma XIsoOfEq_hom_comp_XIsoOfEq_inv (K : HomologicalComplex V c) {p₁ p₂ p₃ : ι}
    (h₁₂ : p₁ = p₂) (h₃₂ : p₃ = p₂) :
    (K.XIsoOfEq h₁₂).hom ≫ (K.XIsoOfEq h₃₂).inv = (K.XIsoOfEq (h₁₂.trans h₃₂.symm)).hom

(K.XIsoOfEq h₁₂).hom ≫ (K.XIsoOfEq h₃₂).inv = (K.XIsoOfEq ⋯).hom


theorem sbtw_pointReflection_of_ne {x y : P} (h : x ≠ y) : Sbtw R y x (pointReflection R x y)

(R : Type u_1)
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{x y : P}
(h : x ≠ y)

Sbtw R y x ((AffineEquiv.pointReflection R x) y)


theorem one_smul (x : X') : (1 : B) • x = x

(x : Grp.SurjectiveOfEpiAuxs.XWithInfinity f)


@[reassoc (attr := simp)]
theorem pullbackIsoUnopPushout_inv_fst {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) [HasPullback f g]
    [HasPushout f.op g.op] :
    (pullbackIsoUnopPushout f g).inv ≫ pullback.fst f g =
      (pushout.inl _ _ : _ ⟶ pushout f.op g.op).unop

(CategoryTheory.Limits.pullbackIsoUnopPushout f g).inv ≫ CategoryTheory.Limits.pullback.fst f g =
  (CategoryTheory.Limits.pushout.inl f.op g.op).unop


@[norm_cast]
theorem WithBot.coe_iInf [InfSet α] (f : ι → α) (h : BddBelow (Set.range f)) :
    ↑(⨅ i, f i) = (⨅ i, f i : WithBot α)

{α : Type u_1}
{ι : Sort u_4}
[Preorder α]
[InfSet α]
(f : ι → α)
(h : BddBelow (Set.range f))


/-- You will rarely use this typeclass directly: it is implied by the combination
`[EnoughProjectives C]` and `[Abelian C]`.
By itself it's enough to set up the basic theory of derived functors.
-/
class HasProjectiveResolutions : Prop where
  out : ∀ Z : C, HasProjectiveResolution Z

[self : CategoryTheory.HasProjectiveResolutions C]


/-- The preimage of a singleton in `connectedComponents` is the connected component
of an element in the equivalence class. -/
theorem connectedComponents_preimage_singleton {x : α} :
    (↑) ⁻¹' ({↑x} : Set (ConnectedComponents α)) = connectedComponent x

{α : Type u}
[TopologicalSpace α]
{x : α}

ConnectedComponents.mk ⁻¹' {ConnectedComponents.mk x} = connectedComponent x


theorem iterate_derivative_mul {n} (p q : R[X]) :
    derivative^[n] (p * q) =
      ∑ k ∈ range n.succ, (n.choose k • (derivative^[n - k] p * derivative^[k] q))

{R : Type u}
[Semiring R]
{n : ℕ}
(p q : R[X])

(⇑Polynomial.derivative)^[n] (p * q) =
  ∑ k ∈ Finset.range n.succ, n.choose k • ((⇑Polynomial.derivative)^[n - k] p * (⇑Polynomial.derivative)^[k] q)


/-- Precomposing `f` with `Prod.snd` is continuous at `x : X × Y` -/
theorem ContinuousAt.snd'' {f : Y → Z} {x : X × Y} (hf : ContinuousAt f x.snd) :
    ContinuousAt (fun x : X × Y => f x.snd) x

{X : Type u}
{Y : Type v}
{Z : Type u_1}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{f : Y → Z}
{x : X × Y}
(hf : ContinuousAt f x.2)


@[to_additive]
theorem eq_iff (f : G →* M) {x y : G} : f x = f y ↔ y⁻¹ * x ∈ f.ker

{G : Type u_1}
[Group G]
{M : Type u_7}
[MulOneClass M]
(f : G →* M)
{x y : G}


@[to_additive (attr := simp)]
theorem prod_map (s : Finset α) (e : α ↪ γ) (f : γ → β) :
    ∏ x ∈ s.map e, f x = ∏ x ∈ s, f (e x)

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

∑ x ∈ Finset.map e s, f x = ∑ x ∈ s, f (e x)


theorem mkRat_mul_left {a : Nat} (a0 : a ≠ 0) : mkRat (↑a * n) (a * d) = mkRat n d


theorem comap_prime (hinv : ∀ a, g (f a : β) = a) (hp : Prime (f p)) : Prime p

{α : Type u_1}
{β : Type u_2}
[CommMonoidWithZero α]
[CommMonoidWithZero β]
{F : Type u_5}
{G : Type u_6}
[FunLike F α β]
[MonoidWithZeroHomClass F α β]
[FunLike G β α]
[MulHomClass G β α]
(f : F)
(g : G)
{p : α}
(hinv : ∀ (a : α), g (f a) = a)
(hp : Prime (f p))


theorem max_eq_iff : max a b = c ↔ a = c ∧ b ≤ a ∨ b = c ∧ a ≤ b

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


protected theorem neg_inj {a b : Int} : -a = -b ↔ a = b


theorem Disjoint.commute (h : Disjoint f g) : Commute f g

{α : Type u_1}
{f g : Equiv.Perm α}
(h : f.Disjoint g)


@[simp]
theorem iUnion_iUnion_eq_left {b : β} {s : ∀ x : β, x = b → Set α} :
    ⋃ (x) (h : x = b), s x h = s b rfl

{α : Type u_1}
{β : Type u_2}
{b : β}
{s : (x : β) → x = b → Set α}


@[simp]
theorem inv_eps [DivisionRing R] : (ε : R[ε])⁻¹ = 0


@[to_additive] -- Porting note (#10618): `simp` can prove this
theorem mul_mem_ball_mul_iff {c : E} : a * c ∈ ball (b * c) r ↔ a ∈ ball b r

{E : Type u_6}
[SeminormedAddCommGroup E]
{a b : E}
{r : ℝ}
{c : E}

a + c ∈ Metric.ball (b + c) r ↔ a ∈ Metric.ball b r


@[simp] theorem casesDiagOn_succ_succ {motive : Nat → Nat → Sort _} (zero_zero : motive 0 0)
    (zero_succ : ∀ n, motive 0 (n+1)) (succ_zero : ∀ m, motive (m+1) 0)
    (succ_succ : ∀ m n, motive (m+1) (n+1)) (m n) :
    Nat.casesDiagOn (m+1) (n+1) zero_zero zero_succ succ_zero succ_succ = succ_succ m n

(zero_succ : (n : Nat) → motive 0 (n + 1))

(succ_zero : (m : Nat) → motive (m + 1) 0)

(succ_succ : (m n : Nat) → motive (m + 1) (n + 1))

Nat.casesDiagOn (m + 1) (n + 1) zero_zero zero_succ succ_zero succ_succ = succ_succ m n


/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
private theorem step2 (K : Subgroup G) [K.Normal] (hK : K ≤ N) : K = ⊥ ∨ K = N

(h2 :
  ∀ (G' : Type u) [inst : Group G'] [inst_1 : Finite G'],
    Nat.card G' < Nat.card G →
      ∀ {N' : Subgroup G'} [inst_2 : N'.Normal], (Nat.card ↥N').Coprime N'.index → ∃ H', N'.IsComplement' H')

(h3 : ∀ (H : Subgroup G), ¬N.IsComplement' H)


/-- See also `NonnegHomClass.apply_nonneg`. -/
theorem map_nonneg (ha : 0 ≤ a) : 0 ≤ f a

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[FunLike F α β]
[Preorder α]
[Zero α]
[Preorder β]
[Zero β]
[OrderHomClass F α β]
[ZeroHomClass F α β]
(f : F)
{a : α}
(ha : 0 ≤ a)


@[simp]
theorem Fork.ofCone_π {F : WalkingParallelPair ⥤ C} (t : Cone F) (j) :
    (Fork.ofCone t).π.app j = t.π.app j ≫ eqToHom (by aesop)

{F : CategoryTheory.Functor CategoryTheory.Limits.WalkingParallelPair C}

(CategoryTheory.Limits.Fork.ofCone t).π.app j =
  CategoryTheory.CategoryStruct.comp (t.π.app j) (CategoryTheory.eqToHom ⋯)


/-- A dilation from a complete emetric space is a closed embedding -/
protected theorem closedEmbedding [CompleteSpace α] [EMetricSpace β] [DilationClass F α β] (f : F) :
    ClosedEmbedding f

{α : Type u_1}
{β : Type u_2}
{F : Type u_4}
[EMetricSpace α]
[FunLike F α β]
[CompleteSpace α]
[EMetricSpace β]
[DilationClass F α β]
(f : F)


theorem prod_iInf_right [Nonempty ι] {f : Filter α} {g : ι → Filter β} :
    (f ×ˢ ⨅ i, g i) = ⨅ i, f ×ˢ g i

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_5}
[Nonempty ι]
{f : Filter α}
{g : ι → Filter β}


theorem gradient_eq_zero_of_not_differentiableAt (h : ¬DifferentiableAt 𝕜 f x) : ∇ f x = 0

{𝕜 : Type u_1}
{F : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
{f : F → 𝕜}
{x : F}
(h : ¬DifferentiableAt 𝕜 f x)


@[to_additive indicator_diff]
theorem mulIndicator_diff' (h : s ⊆ t) (f : α → G) :
    mulIndicator (t \ s) f = mulIndicator t f / mulIndicator s f

{α : Type u_1}
{G : Type u_6}
[Group G]
{s t : Set α}
(h : s ⊆ t)
(f : α → G)

(t \ s).mulIndicator f = t.mulIndicator f / s.mulIndicator f


@[simp]
lemma equivProdNatFactoredNumbers_apply {s : Finset ℕ} {p e m : ℕ} (hp : p.Prime) (hs : p ∉ s)
    (hm : m ∈ factoredNumbers s) :
    equivProdNatFactoredNumbers hp hs (e, ⟨m, hm⟩) = p ^ e * m

{s : Finset ℕ}
{p e m : ℕ}
(hp : Nat.Prime p)
(hs : p ∉ s)
(hm : m ∈ Nat.factoredNumbers s)

↑((Nat.equivProdNatFactoredNumbers hp hs) (e, ⟨m, hm⟩)) = p ^ e * m


@[to_additive]
theorem singleton_mul_ball_one : {x} * ball 1 δ = ball x δ

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


theorem fromOpenSubsetsGlue_injective : Function.Injective (fromOpenSubsetsGlue U)

{α : Type u}
[TopologicalSpace α]
{J : Type u}
(U : J → TopologicalSpace.Opens α)


theorem span_pow (s : Set A) : ∀ n : ℕ, span R s ^ n = span R (s ^ n)

{R : Type u}
[CommSemiring R]
{A : Type v}
[Semiring A]
[Algebra R A]
(s : Set A)
(n : ℕ)

Submodule.span R s ^ n = Submodule.span R (s ^ n)


@[to_additive prod_mono]
theorem prod_mono {s₁ s₂ : Subsemigroup M} {t₁ t₂ : Subsemigroup N} (hs : s₁ ≤ s₂) (ht : t₁ ≤ t₂) :
    s₁.prod t₁ ≤ s₂.prod t₂

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
{s₁ s₂ : AddSubsemigroup M}
{t₁ t₂ : AddSubsemigroup N}
(hs : s₁ ≤ s₂)
(ht : t₁ ≤ t₂)


theorem Convex.smul_mem_of_zero_mem (hs : Convex 𝕜 s) {x : E} (zero_mem : (0 : E) ∈ s) (hx : x ∈ s)
    {t : 𝕜} (ht : t ∈ Icc (0 : 𝕜) 1) : t • x ∈ s

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
(hs : Convex 𝕜 s)
{x : E}
(zero_mem : 0 ∈ s)
(hx : x ∈ s)
{t : 𝕜}
(ht : t ∈ Set.Icc 0 1)


theorem ball_subset : ball (extChartAt I c c) f.rOut ∩ range I ⊆ (extChartAt I c).target

{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{c : M}
(f : SmoothBumpFunction I c)

Metric.ball (↑(extChartAt I c) c) f.rOut ∩ Set.range ↑I ⊆ (extChartAt I c).target


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

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

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


theorem HasFDerivWithinAt.congr' (h : HasFDerivWithinAt f f' s x) (hs : EqOn f₁ f s) (hx : x ∈ s) :
    HasFDerivWithinAt f₁ f' s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f f₁ : E → F}
{f' : E →L[𝕜] F}
{x : E}
{s : Set E}
(h : HasFDerivWithinAt f f' s x)
(hs : Set.EqOn f₁ f s)
(hx : x ∈ s)


/-- A `BumpCovering ι X s` is an indexed family of functions `f i`, `i : ι`, such that

* the supports of `f i` form a locally finite family of sets, i.e., for every point `x : X` there
  exists a neighborhood `U ∋ x` such that all but finitely many functions `f i` are zero on `U`;
* for all `i`, `x` we have `0 ≤ f i x ≤ 1`;
* each point `x ∈ s` belongs to the interior of `{x | f i x = 1}` for some `i`.

One of the main use cases for a `BumpCovering` is to define a `PartitionOfUnity`, see
`BumpCovering.toPartitionOfUnity`, but some proofs can directly use a `BumpCovering` instead of
a `PartitionOfUnity`.

If `X` is a normal paracompact space, then `BumpCovering.exists_isSubordinate` guarantees that for
every open covering `U : Set (Set X)` of `s` there exists a `BumpCovering` of `s` that is
subordinate to `U`.
-/
structure BumpCovering (ι X : Type*) [TopologicalSpace X] (s : Set X := univ) where
  /-- The collections of continuous functions underlying this bump covering -/
  toFun : ι → C(X, ℝ)
  /-- the supports of the underlying functions are a locally finite family of sets -/
  locallyFinite' : LocallyFinite fun i => support (toFun i)
  /-- the functions are non-negative -/
  nonneg' : 0 ≤ toFun
  /-- the functions are each at most one -/
  le_one' : toFun ≤ 1
  /-- Each point `x ∈ s` belongs to the interior of `{x | f i x = 1}` for some `i`. -/
  eventuallyEq_one' : ∀ x ∈ s, ∃ i, toFun i =ᶠ[𝓝 x] 1

{ι : Type u_1}
{X : Type u_2}
[TopologicalSpace X]
{s : optParam (Set X) Set.univ}
(self : BumpCovering ι X s)


theorem IndepSets.inter {s₁ s' : Set (Set Ω)} (s₂ : Set (Set Ω)) {_mΩ : MeasurableSpace Ω}
    {κ : Kernel α Ω} {μ : Measure α} (h₁ : IndepSets s₁ s' κ μ) :
    IndepSets (s₁ ∩ s₂) s' κ μ

(h₁ : ProbabilityTheory.Kernel.IndepSets s₁ s' κ μ)

ProbabilityTheory.Kernel.IndepSets (s₁ ∩ s₂) s' κ μ


@[to_additive]
theorem prod_univ_six [CommMonoid β] (f : Fin 6 → β) :
    ∏ i, f i = f 0 * f 1 * f 2 * f 3 * f 4 * f 5

{β : Type u_2}
[AddCommMonoid β]
(f : Fin 6 → β)


theorem IsCompactOperator.image_ball_subset_compact [ContinuousConstSMul 𝕜₂ M₂] {f : M₁ →ₛₗ[σ₁₂] M₂}
    (hf : IsCompactOperator f) (r : ℝ) : ∃ K : Set M₂, IsCompact K ∧ f '' Metric.ball 0 r ⊆ K

{𝕜₁ : Type u_1}
{𝕜₂ : Type u_2}
[NontriviallyNormedField 𝕜₁]
[SeminormedRing 𝕜₂]
{σ₁₂ : 𝕜₁ →+* 𝕜₂}
{M₁ : Type u_3}
{M₂ : Type u_4}
[SeminormedAddCommGroup M₁]
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[NormedSpace 𝕜₁ M₁]
[Module 𝕜₂ M₂]
[ContinuousConstSMul 𝕜₂ M₂]
{f : M₁ →ₛₗ[σ₁₂] M₂}
(hf : IsCompactOperator ⇑f)
(r : ℝ)

∃ K, IsCompact K ∧ ⇑f '' Metric.ball 0 r ⊆ K


@[simp] lemma map_ofList (f : R →+* S) (rs : List R) :
    map f (ofList rs) = ofList (rs.map f)

{R : Type u_1}
{S : Type u_2}
[Semiring R]
[Semiring S]
(f : R →+* S)
(rs : List R)

Ideal.map f (Ideal.ofList rs) = Ideal.ofList (List.map (⇑f) rs)


theorem IsEquipartition.card_part_le_average_add_one (hP : P.IsEquipartition) (ht : t ∈ P.parts) :
    t.card ≤ s.card / P.parts.card + 1

{α : Type u_1}
[DecidableEq α]
{s t : Finset α}
{P : Finpartition s}
(hP : P.IsEquipartition)
(ht : t ∈ P.parts)


theorem IsWF.le_min_iff (hs : s.IsWF) (hn : s.Nonempty) : a ≤ hs.min hn ↔ ∀ b, b ∈ s → a ≤ b

{α : Type u_2}
[LinearOrder α]
{s : Set α}
{a : α}
(hs : s.IsWF)
(hn : s.Nonempty)


lemma isLocallyInjective_of_isLocallyInjective_of_isLocallySurjective
    {F₁ F₂ F₃ : Cᵒᵖ ⥤ A} (f₁ : F₁ ⟶ F₂) (f₂ : F₂ ⟶ F₃)
    [IsLocallyInjective J (f₁ ≫ f₂)] [IsLocallySurjective J f₁] :
    IsLocallyInjective J f₂

(J : CategoryTheory.GrothendieckTopology C)

[CategoryTheory.Presheaf.IsLocallyInjective J (f₁ ≫ f₂)]


theorem coe_measurableEquiv_symm :
    ⇑(EuclideanSpace.measurableEquiv ι).symm = (WithLp.equiv 2 _).symm

⇑(EuclideanSpace.measurableEquiv ι).symm = ⇑(WithLp.equiv 2 (ι → ℝ)).symm


theorem coeff_frobenius (x : 𝕎 R) (n : ℕ) :
    coeff (frobenius x) n = MvPolynomial.aeval x.coeff (frobeniusPoly p n)

{p : ℕ}
{R : Type u_1}
[hp : Fact (Nat.Prime p)]
[CommRing R]
(x : WittVector p R)
(n : ℕ)

(WittVector.frobenius x).coeff n = (MvPolynomial.aeval x.coeff) (WittVector.frobeniusPoly p n)


theorem natDegree_pow_le {p : R[X]} {n : ℕ} : (p ^ n).natDegree ≤ n * p.natDegree

{R : Type u}
[Semiring R]
{p : R[X]}
{n : ℕ}


@[mono]
theorem floor_mono : Monotone (floor : α → ℤ)

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


theorem iSup_range_stdBasis_eq_iInf_ker_proj {I J : Set ι} (hd : Disjoint I J)
    (hu : Set.univ ⊆ I ∪ J) (hI : Set.Finite I) :
    ⨆ i ∈ I, range (stdBasis R φ i) = ⨅ i ∈ J, ker (proj i : (∀ i, φ i) →ₗ[R] φ i)

(R : Type u_1)
{ι : Type u_2}
[Semiring R]
(φ : ι → Type u_3)
[(i : ι) → AddCommMonoid (φ i)]
[(i : ι) → Module R (φ i)]
[DecidableEq ι]
{I J : Set ι}
(hd : Disjoint I J)
(hu : Set.univ ⊆ I ∪ J)
(hI : I.Finite)

⨆ i ∈ I, LinearMap.range (LinearMap.stdBasis R φ i) = ⨅ i ∈ J, LinearMap.ker (LinearMap.proj i)


@[simp]
theorem coe_add (D1 D2 : LieDerivation R L M) : ⇑(D1 + D2) = D1 + D2

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(D1 D2 : LieDerivation R L M)


theorem addVal_le_iff_dvd {a b : R} : addVal R a ≤ addVal R b ↔ a ∣ b

{R : Type u_1}
[CommRing R]
[IsDomain R]
[DiscreteValuationRing R]
{a b : R}

(DiscreteValuationRing.addVal R) a ≤ (DiscreteValuationRing.addVal R) b ↔ a ∣ b


@[to_additive (attr := simp)]
lemma prod_attach_univ [Fintype ι] (f : {i // i ∈ @univ ι _} → α) :
    ∏ i ∈ univ.attach, f i = ∏ i, f ⟨i, mem_univ _⟩

{ι : Type u_1}
{α : Type u_3}
[CommMonoid α]
[Fintype ι]
(f : { i // i ∈ Finset.univ } → α)

∏ i ∈ Finset.univ.attach, f i = ∏ i : ι, f ⟨i, ⋯⟩


/-- In a linearly ordered monoid, we are happy for `bot_eq_one` to be a `@[simp]` lemma. -/
@[to_additive (attr := simp)
  "In a linearly ordered monoid, we are happy for `bot_eq_zero` to be a `@[simp]` lemma"]
theorem bot_eq_one' : (⊥ : α) = 1

{α : Type u}
[CanonicallyLinearOrderedCommMonoid α]


@[simp]
theorem bliminf_or_le_inf_aux_right : (bliminf u f fun x => p x ∨ q x) ≤ bliminf u f q

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
{f : Filter β}
{p q : β → Prop}
{u : β → α}

(Filter.bliminf u f fun x => p x ∨ q x) ≤ Filter.bliminf u f q


/-- Pythagorean theorem, if-and-if vector inner product form using square roots. -/
theorem norm_add_eq_sqrt_iff_real_inner_eq_zero {x y : F} :
    ‖x + y‖ = √(‖x‖ * ‖x‖ + ‖y‖ * ‖y‖) ↔ ⟪x, y⟫_ℝ = 0

{F : Type u_3}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
{x y : F}


theorem uniformSpace_eq_inf_precomp_of_cover {δ₁ δ₂ : Type*} (φ₁ : δ₁ → α) (φ₂ : δ₂ → α)
    (h_cover : range φ₁ ∪ range φ₂ = univ) :
    𝒰(α, β, _) =
      .comap (ofFun ∘ (· ∘ φ₁) ∘ toFun) 𝒰(δ₁, β, _) ⊓
      .comap (ofFun ∘ (· ∘ φ₂) ∘ toFun) 𝒰(δ₂, β, _)

(φ₁ : δ₁ → α)

(φ₂ : δ₂ → α)

(h_cover : Set.range φ₁ ∪ Set.range φ₂ = Set.univ)

UniformFun.uniformSpace α β =
  UniformSpace.comap (⇑UniformFun.ofFun ∘ (fun x => x ∘ φ₁) ∘ ⇑UniformFun.toFun) (UniformFun.uniformSpace δ₁ β) ⊓
    UniformSpace.comap (⇑UniformFun.ofFun ∘ (fun x => x ∘ φ₂) ∘ ⇑UniformFun.toFun) (UniformFun.uniformSpace δ₂ β)


theorem prime_C_iff : Prime (C r : MvPolynomial σ R) ↔ Prime r

{R : Type u}
(σ : Type v)
[CommRing R]
{r : R}


/-- Given an open cover `{ Yᵢ }` of `Y`, then `X ×[Z] Y` is covered by `X ×[Z] Yᵢ`. -/
@[simps! J obj map]
def openCoverOfRight (𝒰 : OpenCover Y) (f : X ⟶ Z) (g : Y ⟶ Z) : OpenCover (pullback f g)

{X Y Z : AlgebraicGeometry.Scheme}
(𝒰 : Y.OpenCover)
(f : X ⟶ Z)
(g : Y ⟶ Z)
(i : 𝒰.J)

(AlgebraicGeometry.Scheme.Pullback.openCoverOfRight 𝒰 f g).obj i = CategoryTheory.Limits.pullback f (𝒰.map i ≫ g)


@[simp]
theorem toMultiset_lt_toMultiset : toMultiset f < toMultiset g ↔ f < g

{α : Type u_1}
[DecidableEq α]
{f g : Π₀ (_a : α), ℕ}

DFinsupp.toMultiset f < DFinsupp.toMultiset g ↔ f < g


@[to_additive sub_nonneg_ae]
lemma one_le_div_ae {β : Type*} [Group β] [LE β]
    [CovariantClass β β (Function.swap (· * ·)) (· ≤ ·)] (f g : α → β) :
    1 ≤ᵐ[μ] g / f ↔ f ≤ᵐ[μ] g

[CovariantClass β β (Function.swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]


theorem rpow_inv_rpow_self {y : ℝ} (hy : y ≠ 0) (x : ℝ≥0) : (x ^ y) ^ (1 / y) = x


@[to_additive (attr := simp, norm_cast)]
theorem toSubgroup_inf : (↑(U ⊓ V) : Subgroup G) = ↑U ⊓ ↑V

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]
{U V : OpenAddSubgroup G}


/-- A `PSigma`-type is equivalent to the corresponding `Sigma`-type. -/
@[simps apply symm_apply]
def psigmaEquivSigmaPLift {α} (β : α → Sort*) : (Σ' i, β i) ≃ Σ i : PLift α, PLift (β i.down)

{α : Sort u_2}
(β : α → Sort u_1)
(a : (i : α) ×' β i)

(Equiv.psigmaEquivSigmaPLift β) a = ⟨{ down := a.fst }, { down := a.snd }⟩


theorem eq_zero_of_lt {n ν : ℕ} (h : n < ν) : bernsteinPolynomial R n ν = 0

(R : Type u_1)
[CommRing R]
{n ν : ℕ}
(h : n < ν)


theorem iSup_comm {f : ι → ι' → α} : ⨆ (i) (j), f i j = ⨆ (j) (i), f i j

{α : Type u_1}
{ι : Sort u_5}
{ι' : Sort u_6}
[CompleteLattice α]
{f : ι → ι' → α}


@[to_additive (attr := simp)]
theorem one_down [One α] : (1 : ULift α).down = 1


@[simp]
theorem sdiff_compl : x \ yᶜ = x ⊓ y

{α : Type u}
{x y : α}
[BooleanAlgebra α]


/-- The direct limit of countably many countably generated structures is countably generated. -/
theorem cg {ι : Type*} [Countable ι] [Preorder ι] [IsDirected ι (· ≤ ·)] [Nonempty ι]
    {G : ι → Type w} [∀ i, L.Structure (G i)] (f : ∀ i j, i ≤ j → G i ↪[L] G j)
    (h : ∀ i, Structure.CG L (G i)) [DirectedSystem G fun i j h => f i j h] :
    Structure.CG L (DirectLimit G f)

(h : ∀ (i : ι), FirstOrder.Language.Structure.CG L (G i))

[DirectedSystem G fun i j h => ⇑(f i j h)]

FirstOrder.Language.Structure.CG L (FirstOrder.Language.DirectLimit G f)


theorem IsLocalExtr.lineDeriv_eq_zero (h : IsLocalExtr f a) : lineDeriv ℝ f a = 0

{E : Type u_1}
[AddCommGroup E]
[Module ℝ E]
[TopologicalSpace E]
[ContinuousAdd E]
[ContinuousSMul ℝ E]
{f : E → ℝ}
{a : E}
(h : IsLocalExtr f a)


/-- The sum of two weighted homogeneous polynomials of degree `n` is weighted homogeneous of
  weighted degree `n`. -/
theorem add {w : σ → M} (hφ : IsWeightedHomogeneous w φ n) (hψ : IsWeightedHomogeneous w ψ n) :
    IsWeightedHomogeneous w (φ + ψ) n

(hφ : MvPolynomial.IsWeightedHomogeneous w φ n)

(hψ : MvPolynomial.IsWeightedHomogeneous w ψ n)

MvPolynomial.IsWeightedHomogeneous w (φ + ψ) n


@[elab_as_elim]
lemma induction_costructuredArrow (g : CostructuredArrow L (L.obj Y)) : P g

(P : CategoryTheory.CostructuredArrow L (L.obj Y) → Prop)

(hP₀ : P (CategoryTheory.CostructuredArrow.mk (CategoryTheory.CategoryStruct.id (L.obj Y))))

(hP₁ :
  ∀ ⦃X₁ X₂ : C⦄ (f : X₁ ⟶ X₂) (φ : L.obj X₂ ⟶ L.obj Y),
    P (CategoryTheory.CostructuredArrow.mk φ) →
      P (CategoryTheory.CostructuredArrow.mk (CategoryTheory.CategoryStruct.comp (L.map f) φ)))

(hP₂ :
  ∀ ⦃X₁ X₂ : C⦄ (w : X₁ ⟶ X₂) (hw : W w) (φ : L.obj X₁ ⟶ L.obj Y),
    P (CategoryTheory.CostructuredArrow.mk φ) →
      P
        (CategoryTheory.CostructuredArrow.mk
          (CategoryTheory.CategoryStruct.comp (CategoryTheory.Localization.isoOfHom L W w hw).inv φ)))

(g : CategoryTheory.CostructuredArrow L (L.obj Y))


/-- The associator for functors, a natural isomorphism `((F ⋙ G) ⋙ H) ≅ (F ⋙ (G ⋙ H))`.

(In fact, `iso.refl _` will work here, but it tends to make Lean slow later,
and it's usually best to insert explicit associators.)
-/
@[simps]
def associator (F : A ⥤ B) (G : B ⥤ C) (H : C ⥤ D) :
    (F ⋙ G) ⋙ H ≅ F ⋙ G ⋙ H

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{D : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D]
(F : CategoryTheory.Functor A B)
(G : CategoryTheory.Functor B C)
(H : CategoryTheory.Functor C D)

∀ (x : A), (F.associator G H).inv.app x = CategoryTheory.CategoryStruct.id ((F.comp (G.comp H)).obj x)


lemma smul_le_smul' [PosSMulMono α β] [SMulPosMono α β] (ha : a₁ ≤ a₂) (hb : b₁ ≤ b₂) (h₂ : 0 ≤ a₂)
    (h₁ : 0 ≤ b₁) : a₁ • b₁ ≤ a₂ • b₂

{α : Type u_1}
{β : Type u_2}
{a₁ a₂ : α}
{b₁ b₂ : β}
[SMul α β]
[Preorder α]
[Preorder β]
[Zero α]
[Zero β]
[PosSMulMono α β]
[SMulPosMono α β]
(ha : a₁ ≤ a₂)
(hb : b₁ ≤ b₂)
(h₂ : 0 ≤ a₂)
(h₁ : 0 ≤ b₁)

a₁ • b₁ ≤ a₂ • b₂


theorem ext'_iff : p = q ↔ (p : Set B) = q

{A : Type u_1}
{B : Type u_2}
[i : SetLike A B]
{p q : A}


/-- A sequential space is compactly generated. -/
lemma isCompact_of_seq [SequentialSpace X] : RestrictGenTopology {K : Set X | IsCompact K}

{X : Type u_1}
[TopologicalSpace X]
[SequentialSpace X]


/-- Balls defined using the distance or the edistance coincide -/
@[simp]
theorem Metric.emetric_ball {x : α} {ε : ℝ} : EMetric.ball x (ENNReal.ofReal ε) = ball x ε

{α : Type u}
[PseudoMetricSpace α]
{x : α}
{ε : ℝ}

EMetric.ball x (ENNReal.ofReal ε) = Metric.ball x ε


/-- A root system is a root pairing for which the roots span their ambient module.

Note that this is slightly more general than the usual definition in the sense that `N` is not
required to be the dual of `M`. -/
structure RootSystem extends RootPairing ι R M N :=
  span_eq_top : span R (range root) = ⊤

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
{N : Type u_4}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(self : RootSystem ι R M N)

Submodule.span R (Set.range ⇑self.root) = ⊤


theorem restr_eq_of_source_subset {e : PartialHomeomorph X Y} {s : Set X} (h : e.source ⊆ s) :
    e.restr s = e

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{e : PartialHomeomorph X Y}
{s : Set X}
(h : e.source ⊆ s)


theorem tendsto_rightLim_within (x : α) : Tendsto f (𝓝[>] x) (𝓝[≤] rightLim f x)

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

Filter.Tendsto f (𝓝[>] x) (𝓝[≤] Function.rightLim f x)


lemma add_def (q r : ℚ≥0) : q + r = divNat (q.num * r.den + r.num * q.den) (q.den * r.den)

q + r = NNRat.divNat (q.num * r.den + r.num * q.den) (q.den * r.den)


theorem ppow_eq_pow [Monoid M] [Pow M ℕ+] [PNatPowAssoc M] (x : M) (n : ℕ+) :
    x ^ n = x ^ (n : ℕ)

{M : Type u_1}
[Monoid M]
[Pow M ℕ+]
[PNatPowAssoc M]
(x : M)
(n : ℕ+)


@[simp]
theorem tendsto_exp_comp_atTop {f : α → ℝ} :
    Tendsto (fun x => exp (f x)) l atTop ↔ Tendsto f l atTop

{α : Type u_1}
{l : Filter α}
{f : α → ℝ}

Filter.Tendsto (fun x => Real.exp (f x)) l Filter.atTop ↔ Filter.Tendsto f l Filter.atTop


/-- The range of a surjective monoid hom is the whole of the codomain. -/
@[to_additive (attr := simp)
  "The range of a surjective `AddMonoid` hom is the whole of the codomain."]
theorem mrange_top_of_surjective (f : F) (hf : Function.Surjective f) :
    mrange f = (⊤ : Submonoid N)

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{F : Type u_5}
[FunLike F M N]
[mc : MonoidHomClass F M N]
(f : F)
(hf : Function.Surjective ⇑f)


theorem dTo_eq {i j : ι} (r : c.Rel i j) : C.dTo j = (C.xPrevIso r).hom ≫ C.d i j


theorem ContMDiffOn.congr (h : ContMDiffOn I I' n f s) (h₁ : ∀ y ∈ s, f₁ y = f y) :
    ContMDiffOn I I' n f₁ s

{𝕜 : 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 f₁ : M → M'}
{s : Set M}
{n : ℕ∞}
(h : ContMDiffOn I I' n f s)
(h₁ : ∀ y ∈ s, f₁ y = f y)


/-- You will rarely use this typeclass directly: it is implied by the combination
`[EnoughInjectives C]` and `[Abelian C]`. -/
class HasInjectiveResolutions : Prop where
  out : ∀ Z : C, HasInjectiveResolution Z

[self : CategoryTheory.HasInjectiveResolutions C]


@[simp] lemma left_eq_union : s = s ∪ t ↔ t ⊆ s

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


theorem Nodup.rotate_eq_self_iff {l : List α} (hl : l.Nodup) {n : ℕ} :
    l.rotate n = l ↔ n % l.length = 0 ∨ l = []

{α : Type u}
{l : List α}
(hl : l.Nodup)
{n : ℕ}


theorem log_lt_of_lt_pow {b x y : ℕ} (hy : y ≠ 0) : y < b ^ x → log b y < x


/-- Let `f` be a function continuous on a convex (or, equivalently, connected) subset `D`
of the real line. If `f` is differentiable on the interior of `D` and `C ≤ f'`, then
`f` grows at least as fast as `C * x` on `D`, i.e., `C * (y - x) ≤ f y - f x` whenever `x, y ∈ D`,
`x ≤ y`. -/
theorem Convex.mul_sub_le_image_sub_of_le_deriv {D : Set ℝ} (hD : Convex ℝ D) {f : ℝ → ℝ}
    (hf : ContinuousOn f D) (hf' : DifferentiableOn ℝ f (interior D)) {C}
    (hf'_ge : ∀ x ∈ interior D, C ≤ deriv f x) :
    ∀ᵉ (x ∈ D) (y ∈ D), x ≤ y → C * (y - x) ≤ f y - f x

x ∈ D → ∀ y ∈ D, x ≤ y → C * (y - x) ≤ f y - f x


@[simp]
theorem map_comp_some (f : α → β) : Option.map f ∘ some = some ∘ f

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


theorem of_d_eq_zero (ha : P.a = 0) (hb : P.b = 0) (hc : P.c = 0) (hd : P.d = 0) :
    P.toPoly = 0

{R : Type u_1}
{P : Cubic R}
[Semiring R]
(ha : P.a = 0)
(hb : P.b = 0)
(hc : P.c = 0)
(hd : P.d = 0)


@[to_additive]
theorem eq_mul_inv_iff_mul_eq {a b : α} : a = b * ↑c⁻¹ ↔ a * c = b

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


@[simp]
theorem val_mulMap'_tmul (m : M) (n : N) : (mulMap' M N (m ⊗ₜ[R] n) : S) = m.1 * n.1

{R : Type u}
{S : Type v}
[CommSemiring R]
[Semiring S]
[Algebra R S]
{M N : Submodule R S}
(m : ↥M)
(n : ↥N)


/-- If `μ` is a weakly regular measure, then any open set can be approximated by a closed subset. -/
theorem _root_.IsOpen.measure_eq_iSup_isClosed ⦃U : Set α⦄ (hU : IsOpen U) (μ : Measure α)
    [WeaklyRegular μ] : μ U = ⨆ (F) (_ : F ⊆ U) (_ : IsClosed F), μ F

{α : Type u_1}
[MeasurableSpace α]
[TopologicalSpace α]
⦃U : Set α⦄
(hU : IsOpen U)
(μ : MeasureTheory.Measure α)
[μ.WeaklyRegular]

μ U = ⨆ F, ⨆ (_ : F ⊆ U), ⨆ (_ : IsClosed F), μ F


theorem natDegree_divX_le : p.divX.natDegree ≤ p.natDegree


@[simp]
theorem wellFoundedOn_union : (s ∪ t).WellFoundedOn r ↔ s.WellFoundedOn r ∧ t.WellFoundedOn r

{α : Type u_2}
{r : α → α → Prop}
[IsStrictOrder α r]
{s t : Set α}


theorem roots_multiset_prod (m : Multiset R[X]) : (0 : R[X]) ∉ m → m.prod.roots = m.bind roots

{R : Type u}
[CommRing R]
[IsDomain R]
(m : Multiset (Polynomial R))

0 ∉ m → m.prod.roots = m.bind Polynomial.roots


@[simp]
theorem lid_tmul (r : R) (a : A) : TensorProduct.lid R A (r ⊗ₜ a) = r • a

{R : Type uR}
{A : Type uA}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(r : R)
(a : A)

(Algebra.TensorProduct.lid R A) (r ⊗ₜ[R] a) = r • a


theorem mkCoinductiveAux₃ (i j : ℕ) (h : i + 1 = j) :
    (P.xNextIso h).inv ≫ (mkCoinductiveAux₂ e zero comm_zero one comm_one succ i).2.1 =
      (mkCoinductiveAux₂ e zero comm_zero one comm_one succ j).1 ≫ (Q.xPrevIso h).hom

(comm_one : e.f 1 = zero ≫ Q.d 0 1 + P.d 1 2 ≫ one)

(HomologicalComplex.xNextIso P h).inv ≫ (Homotopy.mkCoinductiveAux₂ e zero comm_zero one comm_one succ i).snd.fst =
  (Homotopy.mkCoinductiveAux₂ e zero comm_zero one comm_one succ j).fst ≫ (HomologicalComplex.xPrevIso Q h).hom


@[simp]
theorem insert_union (a : α) (s t : Finset α) : insert a s ∪ t = insert a (s ∪ t)

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


@[simp] lemma coe_mk (f : InfHom α β) (hf) : ⇑(mk f hf) = f

{α : Type u_3}
{β : Type u_4}
[Inf α]
[Top α]
[Inf β]
[Top β]
(f : InfHom α β)
(hf : f.toFun ⊤ = ⊤)


@[to_additive (attr := simp)]
theorem inf_subgroupOf_right (H K : Subgroup G) : (H ⊓ K).subgroupOf K = H.subgroupOf K

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


@[simp]
theorem sub_apply (f g : CentroidHom α) (a : α) : (f - g) a = f a - g a

{α : Type u_5}
[NonUnitalNonAssocRing α]
(f g : CentroidHom α)
(a : α)


@[simp]
theorem comp_val {F : C ⥤ Type w} {p q r : F.Elements} {f : p ⟶ q} {g : q ⟶ r} :
    (f ≫ g).val = f.val ≫ g.val

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{F : CategoryTheory.Functor C (Type w)}
{p q r : F.Elements}
{f : p ⟶ q}
{g : q ⟶ r}

↑(CategoryTheory.CategoryStruct.comp f g) = CategoryTheory.CategoryStruct.comp ↑f ↑g


@[simp]
theorem extract_eq_nil_of_start_eq_end {a : Array α} :
    a.extract i i = #[]


/-- The functorial version of `ULift.down`. -/
@[simps]
def ULift.downFunctor : ULift.{u₂} C ⥤ C

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

CategoryTheory.ULift.downFunctor.obj self = self.down


theorem splits_zmod_X_pow_sub_X : Splits (RingHom.id (ZMod p)) (X ^ p - X)

Polynomial.Splits (RingHom.id (ZMod p)) (Polynomial.X ^ p - Polynomial.X)


theorem HasStrictDerivAt.ccosh (hf : HasStrictDerivAt f f' x) :
    HasStrictDerivAt (fun x => Complex.cosh (f x)) (Complex.sinh (f x) * f') x

{f : ℂ → ℂ}
{f' x : ℂ}
(hf : HasStrictDerivAt f f' x)


@[simp]
theorem coeFn_mk (s : ∀ x, V x)
    (hs : ContMDiff I (I.prod 𝓘(𝕜, F)) n fun x => TotalSpace.mk x (s x)) :
    (mk s hs : ∀ x, V x) = s

[TopologicalSpace (Bundle.TotalSpace F V)]

(hs : ContMDiff I (I.prod 𝓘(𝕜, F)) n fun x => { proj := x, snd := s x })

⇑{ toFun := s, contMDiff_toFun := hs } = s


@[norm_cast]
theorem cast_ne_one {n : ℕ} : (n : R) ≠ 1 ↔ n ≠ 1

{R : Type u_1}
[AddMonoidWithOne R]
[CharZero R]
{n : ℕ}

↑n ≠ 1 ↔ n ≠ 1


@[to_additive (attr := simp)]
theorem coprodAssoc_symm_apply_inl (x : M) : (coprodAssoc M N P).symm (inl x) = inl (inl x)

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[AddMonoid M]
[AddMonoid N]
[AddMonoid P]
(x : M)

(AddMonoid.MulEquiv.coprodAssoc M N P).symm (AddMonoid.Coprod.inl x) = AddMonoid.Coprod.inl (AddMonoid.Coprod.inl x)


theorem insert_val_of_not_mem {a : α} {s : Finset α} (h : a ∉ s) : (insert a s).1 = a ::ₘ s.1

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


/-- Flip a complex of complexes over the diagonal,
exchanging the horizontal and vertical directions.
-/
@[simps]
def flip (K : HomologicalComplex₂ C c₁ c₂) : HomologicalComplex₂ C c₂ c₁


@[to_additive (attr := simp)]
theorem singleton_div : {a} / t = (· / ·) a '' t

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


theorem exists' {p : α → β → Prop} : (∃ x : α × β, p x.1 x.2) ↔ ∃ a b, p a b

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


theorem getElem_setD (a : Array α) (i : Nat) (v : α) (h : i < (setD a i v).size) :
  (setD a i v)[i] = v

{α : Type u_1}
(a : Array α)
(i : Nat)
(v : α)
(h : i < (a.setD i v).size)


theorem tendsto_prod_self_iff {f : α × α → β} {x : Filter α} {y : Filter β} :
    Filter.Tendsto f (x ×ˢ x) y ↔ ∀ W ∈ y, ∃ U ∈ x, ∀ x x' : α, x ∈ U → x' ∈ U → f (x, x') ∈ W

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

Filter.Tendsto f (x ×ˢ x) y ↔ ∀ W ∈ y, ∃ U ∈ x, ∀ (x x' : α), x ∈ U → x' ∈ U → f (x, x') ∈ W


@[simp]
theorem eq_padicNorm (q : ℚ) : ‖(q : ℚ_[p])‖ = padicNorm p q

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


theorem exists_compact_not_null [Regular μ] : (∃ K, IsCompact K ∧ μ K ≠ 0) ↔ μ ≠ 0

{α : Type u_1}
[MeasurableSpace α]
[TopologicalSpace α]
{μ : MeasureTheory.Measure α}
[μ.Regular]


theorem ofReal_log {x : ℝ} (hx : 0 ≤ x) : (x.log : ℂ) = log x


@[simp]
theorem deriv_char_of_ne (h : a ≠ b) : deriv (char a) b = 0

{α : Type u_1}
[dec : DecidableEq α]
{a b : α}
(h : a ≠ b)


@[fun_prop]
theorem Differentiable.neg (h : Differentiable 𝕜 f) : Differentiable 𝕜 fun y => -f y

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


theorem coe_zeta_smul_apply {M} [Semiring R] [AddCommMonoid M] [Module R M]
    {f : ArithmeticFunction M} {x : ℕ} :
    ((↑ζ : ArithmeticFunction R) • f) x = ∑ i ∈ divisors x, f i

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{f : ArithmeticFunction M}
{x : ℕ}

(↑ArithmeticFunction.zeta • f) x = ∑ i ∈ x.divisors, f i


@[to_additive]
theorem eq_mul_inv_iff_mul_eq : a = b * c⁻¹ ↔ a * c = b


theorem eq_nil_of_length_eq_zero (_ : length l = 0) : l = []

∀ {α : Type u_1} {l : List α}, l.length = 0 → l = []


/-- Assumes right covariance.
The lemma assuming left covariance is `Left.mul_lt_one'`. -/
@[to_additive "Assumes right covariance.
The lemma assuming left covariance is `Left.add_neg'`."]
theorem Right.mul_lt_one' [CovariantClass α α (swap (· * ·)) (· ≤ ·)] {a b : α} (ha : a < 1)
    (hb : b < 1) :
    a * b < 1

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


theorem isIntegral (x : 𝓞 K) : IsIntegral ℤ x

{K : Type u_1}
[Field K]
(x : NumberField.RingOfIntegers K)


/-- Group equivalence between `G ≃+c[a, a] G` and the units of `G →+c[a, a] G`. -/
@[simps!]
def equivUnits : (G ≃+c[a, a] G) ≃* (G →+c[a, a] G)ˣ

{G : Type u_1}
[Add G]
{a : G}
(u : (G →+c[a, a] G)ˣ)

⇑(AddConstEquiv.equivUnits.symm u).symm = ⇑↑u⁻¹


theorem _root_.IsBot.Ici_eq (h : IsBot a) : Ici a = univ

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


/-- The (limit) cone for `F : J ⥤ PresheafOfModules.{v} R` that is constructed for the limit
of `F ⋙ evaluation R X` for all `X`. -/
@[simps]
noncomputable def limitCone : Cone F

[∀ (X : Cᵒᵖ),
    Small.{v, max u₂ v}
      ↑((F ⋙ PresheafOfModules.evaluation R X) ⋙ CategoryTheory.forget (ModuleCat ↑(R.obj X))).sections]

(PresheafOfModules.limitCone F).pt = (PresheafOfModules.limitBundledCore F).toPresheafOfModules


/-- The identity map is a monoid homomorphism. -/
@[to_additive "The identity map is an additive monoid homomorphism."]
theorem id : IsMonoidHom (@id α)


theorem rank_range_of_injective (f : M →ₗ[R] M₁) (h : Injective f) :
    Module.rank R (LinearMap.range f) = Module.rank R M

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

Module.rank R ↥(LinearMap.range f) = Module.rank R M


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

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

Monoid.Coprod.mk (FreeMonoid.of (Sum.inl x)) = Monoid.Coprod.inl x


/-- A oplax monoidal functor takes comonoid objects to comonoid objects.

That is, a oplax monoidal functor `F : C ⥤ D` induces a functor `Comon_ C ⥤ Comon_ D`.
-/
@[simps]
def mapComon (F : OplaxMonoidalFunctor C D) : Comon_ C ⥤ Comon_ D

(F : CategoryTheory.OplaxMonoidalFunctor C D)

(F.mapComon.obj A).counit = F.map A.counit ≫ F.η


@[continuity]
theorem Continuous.matrix_updateRow [DecidableEq m] (i : m) {A : X → Matrix m n R} {B : X → n → R}
    (hA : Continuous A) (hB : Continuous B) : Continuous fun x => (A x).updateRow i (B x)

{X : Type u_1}
{m : Type u_4}
{n : Type u_5}
{R : Type u_8}
[TopologicalSpace X]
[TopologicalSpace R]
[DecidableEq m]
(i : m)
{A : X → Matrix m n R}
{B : X → n → R}
(hA : Continuous A)
(hB : Continuous B)


theorem normSq_def : normSq a = (a * star a).re


theorem isTop_iff_isMax [IsDirected α (· ≤ ·)] : IsTop a ↔ IsMax a

{α : Type u}
[Preorder α]
{a : α}
[IsDirected α fun x x_1 => x ≤ x_1]


@[simp]
theorem iUnion_Icc_left (b : α) : ⋃ a, Icc a b = Iic b


theorem isCongruenceSubgroup_trans (H K : Subgroup SL(2, ℤ)) (h : H ≤ K)
    (h2 : IsCongruenceSubgroup H) : IsCongruenceSubgroup K

(h2 : CongruenceSubgroup.IsCongruenceSubgroup H)


/-- A concave function on a segment is lower-bounded by the min of its endpoints. -/
theorem ConcaveOn.ge_on_segment' (hf : ConcaveOn 𝕜 s f) {x y : E} (hx : x ∈ s) (hy : y ∈ s)
    {a b : 𝕜} (ha : 0 ≤ a) (hb : 0 ≤ b) (hab : a + b = 1) : min (f x) (f y) ≤ f (a • x + b • y)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[LinearOrderedAddCommMonoid β]
[SMul 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : ConcaveOn 𝕜 s f)
{x y : E}
(hx : x ∈ s)
(hy : y ∈ s)
{a b : 𝕜}
(ha : 0 ≤ a)
(hb : 0 ≤ b)
(hab : a + b = 1)


@[fun_prop]
protected theorem ContinuousOn.abs (h : ContinuousOn f s) : ContinuousOn (fun x => |f x|) s

{α : Type u_1}
{G : Type u_2}
[TopologicalSpace G]
[LinearOrderedAddCommGroup G]
[OrderTopology G]
{f : α → G}
[TopologicalSpace α]
{s : Set α}
(h : ContinuousOn f s)


theorem Continuous.quotient_lift {f : X → Y} (h : Continuous f) (hs : ∀ a b, a ≈ b → f a = f b) :
    Continuous (Quotient.lift f hs : Quotient s → Y)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{s : Setoid X}
{f : X → Y}
(h : Continuous f)
(hs : ∀ (a b : X), a ≈ b → f a = f b)


theorem mk'_eq_one_iff_eq {x : A} {y : nonZeroDivisors A} : mk' K x y = 1 ↔ x = y

{A : Type u_4}
[CommRing A]
[IsDomain A]
{K : Type u_5}
[Field K]
[Algebra A K]
[IsFractionRing A K]
{x : A}
{y : ↥(nonZeroDivisors A)}


theorem Ioi_add_bij : BijOn (· + d) (Ioi a) (Ioi (a + d))

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

Set.BijOn (fun x => x + d) (Set.Ioi a) (Set.Ioi (a + d))


theorem isClosed_of_spaced_out [T0Space α] {V₀ : Set (α × α)} (V₀_in : V₀ ∈ 𝓤 α) {s : Set α}
    (hs : s.Pairwise fun x y => (x, y) ∉ V₀) : IsClosed s


@[simp]
theorem toLex_natCast [NatCast α] (n : ℕ) : toLex (n : α) = n


/-- The identity is a group homomorphism. -/
@[to_additive "The identity is an additive group homomorphism."]
theorem id : IsGroupHom (@id α)


@[simp]
theorem count_map_of_injective {β} [DecidableEq α] [DecidableEq β] (l : List α) (f : α → β)
    (hf : Function.Injective f) (x : α) : count (f x) (map f l) = count x l

{α : Type u_1}
{β : Type u_2}
[DecidableEq α]
[DecidableEq β]
(l : List α)
(f : α → β)
(hf : Function.Injective f)
(x : α)

List.count (f x) (List.map f l) = List.count x l


@[to_additive]
theorem le_map_div_mul_map_div [Group α] [CommSemigroup β] [LE β] [SubmultiplicativeHomClass F α β]
    (f : F) (a b c : α) : f (a / c) ≤ f (a / b) * f (b / c)

{F : Type u_2}
{α : Type u_3}
{β : Type u_4}
[FunLike F α β]
[AddGroup α]
[AddCommSemigroup β]
[LE β]
[SubadditiveHomClass F α β]
(f : F)
(a b c : α)


@[simp]
theorem trunc_zero (n) : trunc n (0 : R⟦X⟧) = 0


@[norm_cast] -- Porting note: removed `@[simp]` because this is now structure eta
theorem coe_mk (x : M) (hx : x ∈ p) : ((⟨x, hx⟩ : p) : M) = x

{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
{module_M : Module R M}
{p : Submodule R M}
(x : M)
(hx : x ∈ p)


theorem ConcaveOn.average_mem_hypograph [IsFiniteMeasure μ] [NeZero μ] (hg : ConcaveOn ℝ s g)
    (hgc : ContinuousOn g s) (hsc : IsClosed s) (hfs : ∀ᵐ x ∂μ, f x ∈ s)
    (hfi : Integrable f μ) (hgi : Integrable (g ∘ f) μ) :
    (⨍ x, f x ∂μ, ⨍ x, g (f x) ∂μ) ∈ {p : E × ℝ | p.1 ∈ s ∧ p.2 ≤ g p.1}

(hgi : MeasureTheory.Integrable (g ∘ f) μ)

(⨍ (x : α), f x ∂μ, ⨍ (x : α), g (f x) ∂μ) ∈ {p | p.1 ∈ s ∧ p.2 ≤ g p.1}


lemma lie_eq_killingForm_smul_of_mem_rootSpace_of_mem_rootSpace_neg_aux
    {α : Weight K H L} {e f : L} (heα : e ∈ rootSpace H α) (hfα : f ∈ rootSpace H (-α))
    (aux : ∀ (h : H), ⁅h, e⁆ = α h • e) :
    ⁅e, f⁆ = killingForm K L e f • (cartanEquivDual H).symm α

(hfα : f ∈ LieAlgebra.rootSpace H (-⇑α))

⁅e, f⁆ =
  ((killingForm K L) e) f • ↑((LieAlgebra.IsKilling.cartanEquivDual H).symm (LieModule.Weight.toLinear K (↥H) L α))


theorem reverse_surjective : Surjective (@reverse α)


theorem eventually_left_inverse {x} (hx : x ∈ e.source) :
    ∀ᶠ y in 𝓝 x, e.symm (e y) = y

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


lemma hfunext {α α' : Sort u} {β : α → Sort v} {β' : α' → Sort v} {f : ∀a, β a} {f' : ∀a, β' a}
    (hα : α = α') (h : ∀a a', HEq a a' → HEq (f a) (f' a')) : HEq f f'

(h : ∀ (a : α) (a' : α'), HEq a a' → HEq (f a) (f' a'))


theorem eq_iInf_principal (B : FilterBasis α) : B.filter = ⨅ s : B.sets, 𝓟 s


theorem isClique_map_finset_iff :
    (G.map f).IsClique t ↔ t.card ≤ 1 ∨ ∃ (s : Finset α), G.IsClique s ∧ s.map f = t

{α : Type u_1}
{β : Type u_2}
{G : SimpleGraph α}
{f : α ↪ β}
{t : Finset β}

(SimpleGraph.map f G).IsClique ↑t ↔ t.card ≤ 1 ∨ ∃ s, G.IsClique ↑s ∧ Finset.map f s = t


theorem NoetherianSpace.wellFounded_closeds [NoetherianSpace α] :
    WellFounded fun s t : Closeds α => s < t

{α : Type u_1}
[TopologicalSpace α]
[TopologicalSpace.NoetherianSpace α]


@[to_additive (attr := simp)]
lemma UniformFun.ofFun_mul [Mul β] (f g : α → β) : ofFun (f * g) = ofFun f * ofFun g

{α : Type u_1}
{β : Type u_2}
[Mul β]
(f g : α → β)

UniformFun.ofFun (f * g) = UniformFun.ofFun f * UniformFun.ofFun g


theorem inclusion_right {S T : NonUnitalSubalgebra R A} (h : S ≤ T) (x : T) (m : (x : A) ∈ S) :
    inclusion h ⟨x, m⟩ = x

{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}
(h : S ≤ T)
(x : ↥T)
(m : ↑x ∈ S)

(NonUnitalSubalgebra.inclusion h) ⟨↑x, m⟩ = x


@[to_additive]
theorem image_mulSingle_Ioc (i : ι) (a b : α i) :
    Pi.mulSingle i '' Ioc a b = Ioc (Pi.mulSingle i a) (Pi.mulSingle i b)

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

Pi.mulSingle i '' Set.Ioc a b = Set.Ioc (Pi.mulSingle i a) (Pi.mulSingle i b)


@[simp]
theorem inv_id : inv (𝟙 X) = 𝟙 X

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

CategoryTheory.inv (CategoryTheory.CategoryStruct.id X) = CategoryTheory.CategoryStruct.id X


/-- Given two commutative rings `R S : CommRingCat` and a surjective morphism
`f : R ⟶ S`, the induced scheme morphism `specObj S ⟶ specObj R` is a
closed immersion. -/
theorem spec_of_surjective {R S : CommRingCat} (f : R ⟶ S) (h : Function.Surjective f) :
    IsClosedImmersion (Spec.map f)

{R S : CommRingCat}
(f : R ⟶ S)
(h : Function.Surjective ⇑f)


@[simp]
theorem lastFun_splitFun {α α' : TypeVec (n + 1)} (f : drop α ⟹ drop α') (g : last α → last α') :
    lastFun (splitFun f g) = g

{n : ℕ}
{α : TypeVec.{u_1} (n + 1)}
{α' : TypeVec.{u_2} (n + 1)}
(f : α.drop.Arrow α'.drop)
(g : α.last → α'.last)

TypeVec.lastFun (TypeVec.splitFun f g) = g


theorem isRight_congr (h : LiftRel r s x y) : x.isRight ↔ y.isRight

{α : Type u}
{β : Type v}
{γ : Type u_1}
{δ : Type u_2}
{r : α → γ → Prop}
{s : β → δ → Prop}
{x : α ⊕ β}
{y : γ ⊕ δ}
(h : Sum.LiftRel r s x y)


@[simp, mfld_simps]
theorem refl_partialEquiv : (PartialHomeomorph.refl X).toPartialEquiv = PartialEquiv.refl X


lemma exp_llr_of_ac (μ ν : Measure α) [SigmaFinite μ] [Measure.HaveLebesgueDecomposition μ ν]
    (hμν : μ ≪ ν) :
    (fun x ↦ exp (llr μ ν x)) =ᵐ[μ] fun x ↦ (μ.rnDeriv ν x).toReal

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

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


theorem linearization_ε_inv_hom_apply (r : k) :
    (inv (linearization k G).ε).hom (Finsupp.single PUnit.unit r) = r

{k G : Type u}
[CommRing k]
[Monoid G]
(r : k)

(CategoryTheory.inv (Rep.linearization k G).ε).hom (Finsupp.single PUnit.unit r) = r


@[simp]
theorem algebraMap_apply (a : A) : algebraMap A K a = a

{K : Type u}
[Field K]
(A : ValuationSubring K)
(a : ↥A)


theorem ball_subset (h : edist x y + ε₁ ≤ ε₂) (h' : edist x y ≠ ∞) : ball x ε₁ ⊆ ball y ε₂

{α : Type u}
[PseudoEMetricSpace α]
{x y : α}
{ε₁ ε₂ : ℝ≥0∞}
(h : edist x y + ε₁ ≤ ε₂)
(h' : edist x y ≠ ⊤)


protected theorem smul_add (z : R[S⁻¹]) (x y : X[S⁻¹]) :
    z • (x + y) = z • x + z • y

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


@[to_additive] lemma leOnePart_def (f : ∀ i, α i) : f⁻ = fun i ↦ (f i)⁻

{ι : Type u_3}
{α : ι → Type u_4}
[(i : ι) → Lattice (α i)]
[(i : ι) → AddCommGroup (α i)]
(f : (i : ι) → α i)


theorem map_subset_iff_subset_preimage {f : α ↪ β} {s : Finset α} {t : Finset β} :
    s.map f ⊆ t ↔ s ⊆ t.preimage f f.injective.injOn

{α : Type u}
{β : Type v}
{f : α ↪ β}
{s : Finset α}
{t : Finset β}

Finset.map f s ⊆ t ↔ s ⊆ t.preimage ⇑f ⋯


protected theorem le_add_tsub (hb : AddLECancellable b) : a ≤ a + b - b

{α : Type u_1}
[Preorder α]
[AddCommSemigroup α]
[Sub α]
[OrderedSub α]
{a b : α}
(hb : AddLECancellable b)


lemma coeff_ΨSq_ne_zero [NoZeroDivisors R] {n : ℤ} (h : (n : R) ≠ 0) :
    (W.ΨSq n).coeff (n.natAbs ^ 2 - 1) ≠ 0

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


@[to_additive (attr := simp)]
theorem coe_mul {G : Type*} [Mul G] [TopologicalSpace G] [ChartedSpace H' G] [SmoothMul I' G]
    (f g : C^∞⟮I, N; I', G⟯) : ⇑(f * g) = f * g

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_4}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{H' : Type u_5}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{N : Type u_6}
[TopologicalSpace N]
[ChartedSpace H N]
{G : Type u_10}
[Add G]
[TopologicalSpace G]
[ChartedSpace H' G]
[SmoothAdd I' G]
(f g : C^⊤⟮I, N; I', G⟯)


/-- A 2-square stays Guitart exact if we replace the left and right functors
by isomorphic functors. See also `whiskerVertical_iff`. -/
lemma whiskerVertical [w.GuitartExact] (α : L ≅ L') (β : R ≅ R') :
    (w.whiskerVertical α.hom β.inv).GuitartExact


theorem val_injective : Function.Injective (@Fin.val n)


theorem opNorm_le_of_shell' {f : E →SL[σ₁₂] F} {ε C : ℝ} (ε_pos : 0 < ε) (hC : 0 ≤ C) {c : 𝕜}
    (hc : ‖c‖ < 1) (hf : ∀ x, ε * ‖c‖ ≤ ‖x‖ → ‖x‖ < ε → ‖f x‖ ≤ C * ‖x‖) : ‖f‖ ≤ C

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

(hf : ∀ (x : E), ε * ‖c‖ ≤ ‖x‖ → ‖x‖ < ε → ‖f x‖ ≤ C * ‖x‖)


theorem subset_span_trans {U V W : Set M} (hUV : U ⊆ Submodule.span R V)
    (hVW : V ⊆ Submodule.span R W) : U ⊆ Submodule.span R W

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{U V W : Set M}
(hUV : U ⊆ ↑(Submodule.span R V))
(hVW : V ⊆ ↑(Submodule.span R W))


theorem Filter.EventuallyEq.fderivWithin' (hs : f₁ =ᶠ[𝓝[s] x] f) (ht : t ⊆ s) :
    fderivWithin 𝕜 f₁ t =ᶠ[𝓝[s] x] fderivWithin 𝕜 f t

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


theorem comap_singleton_isClosed_of_isIntegral (f : R →+* S) (hf : f.IsIntegral)
    (x : PrimeSpectrum S) (hx : IsClosed ({x} : Set (PrimeSpectrum S))) :
    IsClosed ({comap f x} : Set (PrimeSpectrum R))

{R : Type u}
(S : Type v)
[CommRing R]
[CommRing S]
(f : R →+* S)
(hf : f.IsIntegral)
(x : PrimeSpectrum S)
(hx : IsClosed {x})


theorem nhdsWithin_Iic_neBot {a b : α} (H : a ≤ b) : NeBot (𝓝[Iic b] a)

{α : Type u_1}
[TopologicalSpace α]
[Preorder α]
{a b : α}
(H : a ≤ b)


@[simp]
theorem Ioc_eq_empty_of_le (h : b ≤ a) : Ioc a b = ∅

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


@[simp]
theorem Icc_union_Ico_eq_Ico (h₁ : a ≤ b) (h₂ : b < c) : Icc a b ∪ Ico b c = Ico a c

{α : Type u_1}
[LinearOrder α]
{a b c : α}
(h₁ : a ≤ b)
(h₂ : b < c)


private lemma ite_nonneg_of_nonneg_of_pos [Preorder α] (ha : 0 ≤ a) (hb : 0 < b) : 0 ≤ ite p a b

{α : Type u_1}
[Zero α]
(p : Prop)
[Decidable p]
{a b : α}
[Preorder α]
(ha : 0 ≤ a)
(hb : 0 < b)


@[simp]
theorem compAlongComposition_apply {n : ℕ} (q : FormalMultilinearSeries 𝕜 F G)
    (p : FormalMultilinearSeries 𝕜 E F) (c : Composition n) (v : Fin n → E) :
    (q.compAlongComposition p c) v = q c.length (p.applyComposition c v)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
{G : Type u_4}
[CommRing 𝕜]
[AddCommGroup E]
[AddCommGroup F]
[AddCommGroup G]
[Module 𝕜 E]
[Module 𝕜 F]
[Module 𝕜 G]
[TopologicalSpace E]
[TopologicalSpace F]
[TopologicalSpace G]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
[TopologicalAddGroup F]
[ContinuousConstSMul 𝕜 F]
[TopologicalAddGroup G]
[ContinuousConstSMul 𝕜 G]
{n : ℕ}
(q : FormalMultilinearSeries 𝕜 F G)
(p : FormalMultilinearSeries 𝕜 E F)
(c : Composition n)
(v : Fin n → E)

(q.compAlongComposition p c) v = (q c.length) (p.applyComposition c v)


theorem eq_top_of_forall_nnreal_le {x : ℝ≥0∞} (h : ∀ r : ℝ≥0, ↑r ≤ x) : x = ∞


theorem mem_inv_pointwise_smul_iff₀ {a : α} (ha : a ≠ 0) (S : AddSubmonoid A) (x : A) :
    x ∈ a⁻¹ • S ↔ a • x ∈ S

{α : Type u_1}
{A : Type u_5}
[AddMonoid A]
[GroupWithZero α]
[DistribMulAction α A]
{a : α}
(ha : a ≠ 0)
(S : AddSubmonoid A)
(x : A)

x ∈ a⁻¹ • S ↔ a • x ∈ S


/-- If all elements of a nonempty set `s` are less than or equal to all elements
of a nonempty set `t`, then there exists an element between these sets. -/
theorem exists_between_of_forall_le (sne : s.Nonempty) (tne : t.Nonempty)
    (hst : ∀ x ∈ s, ∀ y ∈ t, x ≤ y) : (upperBounds s ∩ lowerBounds t).Nonempty

{α : Type u_1}
[ConditionallyCompleteLattice α]
{s t : Set α}
(sne : s.Nonempty)
(tne : t.Nonempty)
(hst : ∀ x ∈ s, ∀ y ∈ t, x ≤ y)


@[simp]
theorem norm_mkPiRing (z : G) : ‖ContinuousMultilinearMap.mkPiRing 𝕜 ι z‖ = ‖z‖

{𝕜 : Type u}
{ι : Type v}
{G : Type wG}
[Fintype ι]
[NontriviallyNormedField 𝕜]
[SeminormedAddCommGroup G]
[NormedSpace 𝕜 G]
(z : G)


protected theorem lt_sub_right_of_add_lt {a b c : Int} (h : a + b < c) : a < c - b


lemma exact_iff_of_iso (e : S₁ ≅ S₂) : S₁.Exact ↔ S₂.Exact


@[simp]
theorem sInf_toSubsemiring (S : Set (Subalgebra R A)) :
    (sInf S).toSubsemiring = sInf (Subalgebra.toSubsemiring '' S)

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


lemma convolution_vonMangoldt_const_one : ↗Λ ⍟ 1 = ↗Complex.log

(fun n => ↑(ArithmeticFunction.vonMangoldt n)) ⍟ 1 = fun n => Complex.log ↑n


@[simp] lemma mapSetEquiv.ground (M : Matroid α) {E : Set β} (e : M.E ≃ E) :
    (M.mapSetEquiv e).E = E

{α : Type u_1}
{β : Type u_2}
(M : Matroid α)
{E : Set β}
(e : ↑M.E ≃ ↑E)


@[simp, norm_cast]
theorem coe_ofNat (n : ℕ) [n.AtLeastTwo] :
    ((no_index (OfNat.ofNat n : ℝ)) : ℝ*) = OfNat.ofNat n


@[to_additive]
theorem alternatingProd_eq_finset_prod {G : Type*} [CommGroup G] :
    ∀ (L : List G), alternatingProd L = ∏ i : Fin L.length, L.get i ^ (-1 : ℤ) ^ (i : ℕ)

{G : Type u_3}
[AddCommGroup G]
(L : List G)

L.alternatingSum = ∑ i : Fin L.length, (-1) ^ ↑i • L.get i


theorem inversion_involutive (c : P) {R : ℝ} (hR : R ≠ 0) : Involutive (inversion c R)

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(c : P)
{R : ℝ}
(hR : R ≠ 0)

Function.Involutive (EuclideanGeometry.inversion c R)


@[simp]
theorem restrict_smul {v : VectorMeasure α M} {i : Set α} (c : R) :
    (c • v).restrict i = c • v.restrict i

{α : Type u_1}
{m : MeasurableSpace α}
{M : Type u_3}
[AddCommMonoid M]
[TopologicalSpace M]
{R : Type u_4}
[Semiring R]
[DistribMulAction R M]
[ContinuousConstSMul R M]
{v : MeasureTheory.VectorMeasure α M}
{i : Set α}
(c : R)


@[to_additive]
theorem eq_symm_apply (e : M ≃* N) {x y} : y = e.symm x ↔ e y = x

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


theorem toSubring_injective {R : Type u} {A : Type v} [CommRing R] [Ring A] [Algebra R A] :
    Function.Injective (toSubring : Subalgebra R A → Subring A)


@[to_additive]
theorem characteristic_iff_comap_le : H.Characteristic ↔ ∀ ϕ : G ≃* G, H.comap ϕ.toMonoidHom ≤ H

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

H.Characteristic ↔ ∀ (ϕ : G ≃* G), Subgroup.comap ϕ.toMonoidHom H ≤ H


@[simp] protected theorem sub_lt_sub_right_iff (a b c : Int) :
    a - c < b - c ↔ a < b


theorem mk_succ_pos (i : Nat) (h : i < n) :
    (0 : Fin (n + 1)) < ⟨i.succ, Nat.add_lt_add_right h 1⟩


@[to_additive (attr := simp)]
theorem pure_smul : (pure a : Filter α) • g = g.map (a • ·)

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

pure a +ᵥ g = Filter.map (fun x => a +ᵥ x) g


theorem comap_neBot_iff_compl_range {f : Filter β} {m : α → β} :
    NeBot (comap m f) ↔ (range m)ᶜ ∉ f

{α : Type u}
{β : Type v}
{f : Filter β}
{m : α → β}

(Filter.comap m f).NeBot ↔ (Set.range m)ᶜ ∉ f


theorem ae_eq_symm {f g : α → β} (h : f =ᵐ[μ] g) : g =ᵐ[μ] f

{α : Type u_1}
{β : Type u_2}
{F : Type u_3}
[FunLike F (Set α) ℝ≥0∞]
[MeasureTheory.OuterMeasureClass F α]
{μ : F}
{f g : α → β}
(h : f =ᵐ[μ] g)


@[simp]
theorem constr_basis (f : ι → M') (i : ι) : (constr (M' := M') b S f : M → M') (b i) = f i

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
{M' : Type u_7}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid M']
[Module R M']
(b : Basis ι R M)
(S : Type u_10)
[Semiring S]
[Module S M']
[SMulCommClass R S M']
(f : ι → M')
(i : ι)


/-- Constructor for `Cover.Relation` which takes as an input
`r : I₁.Relation I₂` with `I₁ I₂ : S.Arrow`. -/
@[simps]
def Relation.mk' {S : J.Cover X} {fst snd : S.Arrow} (r : fst.Relation snd) :
    S.Relation

{J : CategoryTheory.GrothendieckTopology C}

(CategoryTheory.GrothendieckTopology.Cover.Relation.mk' r).r = r


theorem mem_keys {a : α} {s : AList β} : a ∈ s ↔ a ∈ s.keys

{α : Type u}
{β : α → Type v}
{a : α}
{s : AList β}


theorem uniformContinuous_comap {f : α → β} [u : UniformSpace β] :
    @UniformContinuous α β (UniformSpace.comap f u) u f

{α : Type ua}
{β : Type ub}
{f : α → β}
[u : UniformSpace β]


@[to_additive pi_norm_const_le]
lemma pi_norm_const_le' (a : E) : ‖fun _ : ι => a‖ ≤ ‖a‖

{ι : Type u_1}
{E : Type u_2}
[Fintype ι]
[SeminormedGroup E]
(a : E)


@[simp]
theorem map_apply {M : DMatrix m n α} {β : m → n → Type w} {f : ∀ ⦃i j⦄, α i j → β i j} {i : m}
    {j : n} : M.map f i j = f (M i j)

{m : Type u_2}
{n : Type u_3}
{α : m → n → Type v}
{M : DMatrix m n α}
{β : m → n → Type w}
{f : ⦃i : m⦄ → ⦃j : n⦄ → α i j → β i j}
{i : m}
{j : n}


theorem of_eq_false (h : p = False) : ¬ p


@[simp]
theorem self_mem_span_image [Nontrivial R] {i : ι} {s : Set ι} :
    b i ∈ span R (b '' s) ↔ i ∈ s

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(b : Basis ι R M)
[Nontrivial R]
{i : ι}
{s : Set ι}

b i ∈ Submodule.span R (⇑b '' s) ↔ i ∈ s


theorem top_caratheodory : (⊤ : OuterMeasure α).caratheodory = ⊤


lemma descSet_inter_of_ne (x y : lc.pt) (hn : x ≠ y) : descSet hc {x} ∩ descSet hc {y} = ∅

(hc : CategoryTheory.Limits.IsColimit c)

(lc : CategoryTheory.Limits.Cocone (K.comp CategoryTheory.uliftFunctor.{v, u}))

CategoryTheory.Limits.Types.descSet hc {x} ∩ CategoryTheory.Limits.Types.descSet hc {y} = ∅


@[to_additive (attr := simp, norm_cast)]
theorem coe_set_mk {s : Set M} (h_mul) : (mk s h_mul : Set M) = s

(h_mul : ∀ {a b : M}, a ∈ s → b ∈ s → a + b ∈ s)

↑{ carrier := s, add_mem' := h_mul } = s


theorem measure_diff_right (h : AEDisjoint μ s t) : μ (t \ s) = μ t

{α : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t : Set α}
(h : MeasureTheory.AEDisjoint μ s t)


/-- A version of `inv_sub_inv'` for `invOf`. -/
theorem invOf_sub_invOf [Ring α] (a b : α) [Invertible a] [Invertible b] :
    ⅟a - ⅟b = ⅟a * (b - a) * ⅟b

{α : Type u}
[Ring α]
(a b : α)
[Invertible a]
[Invertible b]


/-- The spectrum, as a contravariant functor from commutative rings to topological spaces.
-/
@[simps! obj map]
def Spec.toTop : CommRingCat.{u}ᵒᵖ ⥤ TopCat

AlgebraicGeometry.Spec.toTop.map f = AlgebraicGeometry.Spec.topMap f.unop


/-- Key lemma towards the Erdős-Kaplansky theorem from https://mathoverflow.net/a/168624 -/
theorem max_aleph0_card_le_rank_fun_nat : max ℵ₀ #K ≤ Module.rank K (ℕ → K)


theorem integral_Icc_eq_integral_Ioo : ∫ t in Icc x y, f t ∂μ = ∫ t in Ioo x y, f t ∂μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : X → E}
{μ : MeasureTheory.Measure X}
[PartialOrder X]
{x y : X}
[MeasureTheory.NoAtoms μ]

∫ (t : X) in Set.Icc x y, f t ∂μ = ∫ (t : X) in Set.Ioo x y, f t ∂μ


theorem closure_eq_cluster_pts : closure s = { a | ClusterPt a (𝓟 s) }

{X : Type u}
{s : Set X}
[TopologicalSpace X]


/-- A `StrictOrderedSemiring` is a nontrivial semiring with a partial order such that addition is
strictly monotone and multiplication by a positive number is strictly monotone. -/
class StrictOrderedSemiring (α : Type u) extends Semiring α, OrderedCancelAddCommMonoid α,
    Nontrivial α where
  /-- In a strict ordered semiring, `0 ≤ 1`. -/
  protected zero_le_one : (0 : α) ≤ 1
  /-- Left multiplication by a positive element is strictly monotone. -/
  protected mul_lt_mul_of_pos_left : ∀ a b c : α, a < b → 0 < c → c * a < c * b
  /-- Right multiplication by a positive element is strictly monotone. -/
  protected mul_lt_mul_of_pos_right : ∀ a b c : α, a < b → 0 < c → a * c < b * c

{α : Type u}
[self : StrictOrderedSemiring α]


/-- The closed thickening is a closed set. -/
theorem isClosed_cthickening {δ : ℝ} {E : Set α} : IsClosed (cthickening δ E)

{α : Type u}
[PseudoEMetricSpace α]
{δ : ℝ}
{E : Set α}


theorem laverage_congr {f g : α → ℝ≥0∞} (h : f =ᵐ[μ] g) : ⨍⁻ x, f x ∂μ = ⨍⁻ x, g x ∂μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : α → ℝ≥0∞}
(h : f =ᵐ[μ] g)


lemma one_sub_prime_cpow_ne_zero {p : ℕ} (hp : p.Prime) {s : ℂ} (hs : 1 < s.re) :
    1 - (p : ℂ) ^ (-s) ≠ 0

{p : ℕ}
(hp : Nat.Prime p)
{s : ℂ}
(hs : 1 < s.re)


@[to_additive sum_mono_set_of_nonneg]
theorem prod_mono_set_of_one_le' (hf : ∀ x, 1 ≤ f x) : Monotone fun s ↦ ∏ x ∈ s, f x

{ι : Type u_1}
{N : Type u_5}
[OrderedCommMonoid N]
{f : ι → N}
(hf : ∀ (x : ι), 1 ≤ f x)


theorem t2Space_iff_disjoint_nhds : T2Space X ↔ Pairwise fun x y : X => Disjoint (𝓝 x) (𝓝 y)

T2Space X ↔ Pairwise fun x y => Disjoint (𝓝 x) (𝓝 y)


@[simp]
theorem chainComplex_d_succ_succ_zero (C : ChainComplex V ℕ) (i : ℕ) : C.d (i + 2) 0 = 0


theorem smul_tprodCoeff' (r : R₁) (z : R) (f : Π i, s i) :
    r • tprodCoeff R z f = tprodCoeff R (r • z) f

{ι : Type u_1}
{R : Type u_4}
[CommSemiring R]
{R₁ : Type u_5}
{s : ι → Type u_7}
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]
[Monoid R₁]
[DistribMulAction R₁ R]
[SMulCommClass R₁ R R]
(r : R₁)
(z : R)
(f : (i : ι) → s i)

r • PiTensorProduct.tprodCoeff R z f = PiTensorProduct.tprodCoeff R (r • z) f


theorem natDegree_add_le_iff_right {n : ℕ} (p q : R[X]) (pn : p.natDegree ≤ n) :
    (p + q).natDegree ≤ n ↔ q.natDegree ≤ n

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


lemma rpow_one_sub' (hx : 0 ≤ x) (h : 1 - y ≠ 0) : x ^ (1 - y) = x / x ^ y


theorem openSegment_eq_Ioo' (hxy : x ≠ y) : openSegment 𝕜 x y = Ioo (min x y) (max x y)

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
{x y : 𝕜}
(hxy : x ≠ y)

openSegment 𝕜 x y = Set.Ioo (min x y) (max x y)


/-- The exponential map in a commutative Banach algebra `𝔸` over `𝕂 = ℝ` or `𝕂 = ℂ` has
Fréchet derivative `exp 𝕂 x • 1 : 𝔸 →L[𝕂] 𝔸` at any point `x`. -/
theorem hasFDerivAt_exp {x : 𝔸} : HasFDerivAt (exp 𝕂) (exp 𝕂 x • (1 : 𝔸 →L[𝕂] 𝔸)) x

{𝕂 : Type u_1}
{𝔸 : Type u_2}
[RCLike 𝕂]
[NormedCommRing 𝔸]
[NormedAlgebra 𝕂 𝔸]
[CompleteSpace 𝔸]
{x : 𝔸}

HasFDerivAt (NormedSpace.exp 𝕂) (NormedSpace.exp 𝕂 x • 1) x


/-- The identity map is a semiring homomorphism. -/
theorem id : IsSemiringHom (@id α)


theorem prod_iUnion₂ {s : Set α} {t : ∀ i, κ i → Set β} :
    (s ×ˢ ⋃ (i) (j), t i j) = ⋃ (i) (j), s ×ˢ t i j

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
{κ : ι → Sort u_7}
{s : Set α}
{t : (i : ι) → κ i → Set β}

s ×ˢ ⋃ i, ⋃ j, t i j = ⋃ i, ⋃ j, s ×ˢ t i j


theorem dist_add_add_right (n k m : ℕ) : dist (n + k) (m + k) = dist n m


@[simp]
theorem comp_apply {X Y Z : FintypeCat} (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) : (f ≫ g) x = g (f x)

{X Y Z : FintypeCat}
(f : X ⟶ Y)
(g : Y ⟶ Z)
(x : ↑X)


@[simp]
theorem monotoneOn_toDual_comp_iff : MonotoneOn (toDual ∘ f : α → βᵒᵈ) s ↔ AntitoneOn f s

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

MonotoneOn (⇑OrderDual.toDual ∘ f) s ↔ AntitoneOn f s


@[to_additive]
theorem Group.fg_iff' :
    Group.FG G ↔ ∃ (n : _) (S : Finset G), S.card = n ∧ Subgroup.closure (S : Set G) = ⊤

AddGroup.FG G ↔ ∃ n S, S.card = n ∧ AddSubgroup.closure ↑S = ⊤


/-- The self-adjoint part of an element of a star module, as a continuous linear map. -/
@[simps!]
def selfAdjointPartL [ContinuousAdd A] [ContinuousStar A] [ContinuousConstSMul R A] :
    A →L[R] selfAdjoint A

(R : Type u_1)
(A : Type u_2)
[Semiring R]
[StarMul R]
[TrivialStar R]
[AddCommGroup A]
[Module R A]
[StarAddMonoid A]
[StarModule R A]
[Invertible 2]
[TopologicalSpace A]
[ContinuousAdd A]
[ContinuousStar A]
[ContinuousConstSMul R A]
(x : A)

↑((selfAdjointPartL R A) x) = ⅟2 • x + ⅟2 • star x


/-- Given a *compatible* collection of topological bases for the factors in a cofiltered limit
which contain `Set.univ` and are closed under intersections, the induced *naive* collection
of sets in the limit is, in fact, a topological basis.
-/
theorem isTopologicalBasis_cofiltered_limit (T : ∀ j, Set (Set (F.obj j)))
    (hT : ∀ j, IsTopologicalBasis (T j)) (univ : ∀ i : J, Set.univ ∈ T i)
    (inter : ∀ (i) (U1 U2 : Set (F.obj i)), U1 ∈ T i → U2 ∈ T i → U1 ∩ U2 ∈ T i)
    (compat : ∀ (i j : J) (f : i ⟶ j) (V : Set (F.obj j)) (_hV : V ∈ T j), F.map f ⁻¹' V ∈ T i) :
    IsTopologicalBasis
      {U : Set C.pt | ∃ (j : _) (V : Set (F.obj j)), V ∈ T j ∧ U = C.π.app j ⁻¹' V}

(hT : ∀ (j : J), TopologicalSpace.IsTopologicalBasis (T j))

(inter : ∀ (i : J) (U1 U2 : Set ↑(F.obj i)), U1 ∈ T i → U2 ∈ T i → U1 ∩ U2 ∈ T i)

(compat : ∀ (i j : J) (f : i ⟶ j), ∀ V ∈ T j, ⇑(F.map f) ⁻¹' V ∈ T i)

TopologicalSpace.IsTopologicalBasis {U | ∃ j, ∃ V ∈ T j, U = ⇑(C.π.app j) ⁻¹' V}


@[simp]
theorem image2_insert_right : image2 f s (insert b t) = (fun a => f a b) '' s ∪ image2 f s t

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{f : α → β → γ}
{s : Set α}
{t : Set β}
{b : β}

Set.image2 f s (insert b t) = (fun a => f a b) '' s ∪ Set.image2 f s t


theorem MDifferentiableWithinAt.differentiableWithinAt_writtenInExtChartAt
    {f : M → M'} {s : Set M} {x : M} (hf : MDifferentiableWithinAt I I' f s x) :
    DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I' x f)
      ((extChartAt I x).symm ⁻¹' s ∩ range I) ((extChartAt I x) x)

DifferentiableWithinAt 𝕜 (writtenInExtChartAt I I' x f) (↑(extChartAt I x).symm ⁻¹' s ∩ Set.range ↑I)
  (↑(extChartAt I x) x)


/-- On a metric space `X` with a measure `μ`, consider for each `x : X` a family of measurable sets
with nonempty interiors, called `setsAt x`. This family is a Vitali family if it satisfies the
following property: consider a (possibly non-measurable) set `s`, and for any `x` in `s` a
subfamily `f x` of `setsAt x` containing sets of arbitrarily small diameter. Then one can extract
a disjoint subfamily covering almost all `s`.

Vitali families are provided by covering theorems such as the Besicovitch covering theorem or the
Vitali covering theorem. They make it possible to formulate general versions of theorems on
differentiations of measure that apply in both contexts.
-/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure VitaliFamily {m : MeasurableSpace α} (μ : Measure α) where
  /-- Sets of the family "centered" at a given point. -/
  setsAt :  α → Set (Set α)
  /-- All sets of the family are measurable. -/
  measurableSet : ∀ x : α, ∀ s ∈ setsAt x, MeasurableSet s
  /-- All sets of the family have nonempty interior. -/
  nonempty_interior : ∀ x : α, ∀ s ∈ setsAt x, (interior s).Nonempty
  /-- For any closed ball around `x`, there exists a set of the family contained in this ball. -/
  nontrivial : ∀ (x : α), ∀ ε > (0 : ℝ), ∃ s ∈ setsAt x, s ⊆ closedBall x ε
  /-- Consider a (possibly non-measurable) set `s`,
  and for any `x` in `s` a subfamily `f x` of `setsAt x`
  containing sets of arbitrarily small diameter.
  Then one can extract a disjoint subfamily covering almost all `s`. -/
  covering : ∀ (s : Set α) (f : α → Set (Set α)),
    (∀ x ∈ s, f x ⊆ setsAt x) → (∀ x ∈ s, ∀ ε > (0 : ℝ), ∃ a ∈ f x, a ⊆ closedBall x ε) →
    ∃ t : Set (α × Set α), (∀ p ∈ t, p.1 ∈ s) ∧ (t.PairwiseDisjoint fun p ↦ p.2) ∧
      (∀ p ∈ t, p.2 ∈ f p.1) ∧ μ (s \ ⋃ p ∈ t, p.2) = 0

{α : Type u_1}
[MetricSpace α]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(self : VitaliFamily μ)
(x : α)
(ε : ℝ)

ε > 0 → ∃ s ∈ self.setsAt x, s ⊆ Metric.closedBall x ε


theorem zero_apply (i : ℕ) : (0 : PolynomialModule R M) i = 0

(R : Type u_1)
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(i : ℕ)


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

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


/-- The closure of the interval `(-∞, a)` is the closed interval `(-∞, a]`, unless `a` is a bottom
element. -/
theorem closure_Iio' (h : (Iio a).Nonempty) : closure (Iio a) = Iic a

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
{a : α}
(h : (Set.Iio a).Nonempty)


@[to_additive]
theorem independent_of_coprime_order
    (hcomm : Pairwise fun i j : ι => ∀ x y : G, x ∈ H i → y ∈ H j → Commute x y)
    [Finite ι] [∀ i, Fintype (H i)]
    (hcoprime : Pairwise fun i j => Nat.Coprime (Fintype.card (H i)) (Fintype.card (H j))) :
    CompleteLattice.Independent H

(hcomm : Pairwise fun i j => ∀ (x y : G), x ∈ H i → y ∈ H j → AddCommute x y)

(hcoprime : Pairwise fun i j => (Fintype.card ↥(H i)).Coprime (Fintype.card ↥(H j)))


protected theorem lt_of_le_of_lt : ∀ {x y z : Bool}, x ≤ y → y < z → x < z


@[simp, norm_cast]
theorem coe_toRingEquiv (f : α ≃+*o β) : ⇑(f : α ≃+* β) = f

{α : Type u_2}
{β : Type u_3}
[Mul α]
[Add α]
[LE α]
[Mul β]
[Add β]
[LE β]
(f : α ≃+*o β)


theorem mapsTo_iInter₂_iInter₂ {s : ∀ i, κ i → Set α} {t : ∀ i, κ i → Set β} {f : α → β}
    (H : ∀ i j, MapsTo f (s i j) (t i j)) : MapsTo f (⋂ (i) (j), s i j) (⋂ (i) (j), t i j)

(H : ∀ (i : ι) (j : κ i), Set.MapsTo f (s i j) (t i j))

Set.MapsTo f (⋂ i, ⋂ j, s i j) (⋂ i, ⋂ j, t i j)


theorem norm_eq_iSup_norm : ‖f‖ = ⨆ x : α, ‖f x‖

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


theorem openEmbedding : OpenEmbedding f.1.base

[H : AlgebraicGeometry.IsOpenImmersion f]


@[to_additive (attr := simp)]
theorem div_empty : s / ∅ = ∅


theorem pmap_next_eq_rotate_one (h : Nodup l) : (l.pmap l.next fun _ h => h) = l.rotate 1

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


theorem exists_prime_and_dvd {n : ℕ} (hn : n ≠ 1) : ∃ p, Prime p ∧ p ∣ n


theorem norm_exp_mul_sq_le {τ : ℂ} (hτ : 0 < τ.im) (n : ℤ) :
    ‖cexp (π * I * (n : ℂ) ^ 2 * τ)‖ ≤ rexp (-π * τ.im) ^ n.natAbs

‖cexp (↑π * Complex.I * ↑n ^ 2 * τ)‖ ≤ rexp (-π * τ.im) ^ n.natAbs


/-- The anti-equivalence between cosimplicial objects and simplicial objects. -/
@[simps!]
def cosimplicialSimplicialEquiv : (CosimplicialObject C)ᵒᵖ ≌ SimplicialObject Cᵒᵖ

(C : Type u)
[CategoryTheory.Category.{v, u} C]
(X : SimplexCategoryᵒᵖ ⥤ Cᵒᵖ)

∀ (X_1 : SimplexCategoryᵒᵖ),
  ((CategoryTheory.cosimplicialSimplicialEquiv C).counitIso.inv.app X).app X_1 = 𝟙 (X.obj X_1)


@[simp]
theorem toIdeal_sup (I J : HomogeneousIdeal 𝒜) : (I ⊔ J).toIdeal = I.toIdeal ⊔ J.toIdeal

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


theorem get_mem {q : Semiquot α} (p) : get q p ∈ q

{α : Type u_1}
{q : Semiquot α}
(p : q.IsPure)


private theorem esymm_mul_psum_to_weight (k : ℕ) :
    ∑ a ∈ (antidiagonal k).filter (fun a ↦ a.fst < k),
    (-1) ^ a.fst * esymm σ R a.fst * psum σ R a.snd =
    ∑ t ∈ filter (fun t ↦ card t.fst < k) (pairs σ k), weight σ R k t

(σ : Type u_1)
[Fintype σ]
[DecidableEq σ]
(R : Type u_2)
[CommRing R]
(k : ℕ)

∑ a ∈ Finset.filter (fun a => a.1 < k) (Finset.antidiagonal k),
    (-1) ^ a.1 * MvPolynomial.esymm σ R a.1 * MvPolynomial.psum σ R a.2 =
  ∑ t ∈ Finset.filter (fun t => t.1.card < k) (MvPolynomial.NewtonIdentities.pairs σ k),
    MvPolynomial.NewtonIdentities.weight σ R k t


@[csimp] theorem any_eq_anyTR : @any = @anyTR

(Nat.any f n || Nat.anyTR.loop f (m + n) m) = Nat.any f (m + n)


@[to_additive (attr := simp)]
lemma coe_nonempty (s : Subgroup G) : (s : Set G).Nonempty

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


@[simp, elementwise]
theorem range_mkQ_cokernelIsoRangeQuotient_inv :
    ↿f.range.mkQ ≫ (cokernelIsoRangeQuotient f).inv = cokernel.π f

{R : Type u}
[Ring R]
{G H : ModuleCat R}
(f : G ⟶ H)

ModuleCat.asHomLeft (LinearMap.range f).mkQ ≫ (ModuleCat.cokernelIsoRangeQuotient f).inv =
  CategoryTheory.Limits.cokernel.π f


@[simp] lemma id_τ₃ : Hom.τ₃ (𝟙 S) = 𝟙 _

(CategoryTheory.CategoryStruct.id S).τ₃ = CategoryTheory.CategoryStruct.id S.X₃


lemma StrictMonoOn.image_Ioi_subset (h : StrictMonoOn f (Ici a)) : f '' Ioi a ⊆ Ioi (f a)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[Preorder α]
[Preorder β]
{a : α}
(h : StrictMonoOn f (Set.Ici a))


theorem IsOpen.nhdsWithin_eq {a : α} {s : Set α} (h : IsOpen s) (ha : a ∈ s) : 𝓝[s] a = 𝓝 a

{α : Type u_1}
[TopologicalSpace α]
{a : α}
{s : Set α}
(h : IsOpen s)
(ha : a ∈ s)


@[to_additive (attr := simp)]
protected theorem map_one {f : α ↪ β} : map f 1 = {f 1}

{α : Type u_2}
{β : Type u_3}
[Zero α]
{f : α ↪ β}


lemma le_one_iff_eq_zero_or_eq_one : ∀ {n : ℕ}, n ≤ 1 ↔ n = 0 ∨ n = 1


/-- When `f` is an isomorphism, the kernel of `f ≫ g` is isomorphic to the kernel of `g`.
-/
@[simps]
def kernelIsIsoComp {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) [IsIso f] [HasKernel g] :
    kernel (f ≫ g) ≅ kernel g

(CategoryTheory.Limits.kernelIsIsoComp f g).hom =
  CategoryTheory.Limits.kernel.lift g (CategoryTheory.Limits.kernel.ι (f ≫ g) ≫ f) ⋯


/-- The fourth simplicial identity -/
@[reassoc]
theorem δ_comp_σ_of_gt {n} {i : Fin (n + 2)} {j : Fin (n + 1)} (H : Fin.castSucc j < i) :
    X.σ (Fin.castSucc j) ≫ X.δ i.succ = X.δ i ≫ X.σ j

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(X : CategoryTheory.SimplicialObject C)
{n : ℕ}
{i : Fin (n + 2)}
{j : Fin (n + 1)}
(H : j.castSucc < i)

X.σ j.castSucc ≫ X.δ i.succ = X.δ i ≫ X.σ j


/-- Under the canonical linear map from a submodule `p` to the ambient space `M`, the image of the
maximal submodule of `p` is just `p`. -/
-- @[simp] -- Porting note (#10618): simp can prove this
theorem map_subtype_top : map p.subtype (⊤ : Submodule R p) = p

{R : Type u_1}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(p : Submodule R M)


@[continuity, fun_prop]
protected theorem continuous {β : Type*} [TopologicalSpace β] {t : β → τ} (ht : Continuous t)
    {f : β → α} (hf : Continuous f) : Continuous fun x => ϕ (t x) (f x)

{τ : Type u_1}
[AddMonoid τ]
[TopologicalSpace τ]
[ContinuousAdd τ]
{α : Type u_2}
[TopologicalSpace α]
(ϕ : Flow τ α)
{β : Type u_3}
[TopologicalSpace β]
{t : β → τ}
(ht : Continuous t)
{f : β → α}
(hf : Continuous f)


theorem volume_measurePreserving_sumPiEquivProdPi (π : ι ⊕ ι' → Type*)
    [∀ i, MeasureSpace (π i)] [∀ i, SigmaFinite (volume : Measure (π i))] :
    MeasurePreserving (MeasurableEquiv.sumPiEquivProdPi π) volume volume

[(i : ι ⊕ ι') → MeasureTheory.MeasureSpace (π i)]

[∀ (i : ι ⊕ ι'), MeasureTheory.SigmaFinite MeasureTheory.volume]

MeasureTheory.MeasurePreserving (⇑(MeasurableEquiv.sumPiEquivProdPi π)) MeasureTheory.volume MeasureTheory.volume


/-- If `E / F` is a finite extension, then its separable degree is equal to its degree if and
only if it is a separable extension. -/
theorem finSepDegree_eq_finrank_iff [FiniteDimensional F E] :
    finSepDegree F E = finrank F E ↔ Algebra.IsSeparable F E

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

Field.finSepDegree F E = FiniteDimensional.finrank F E ↔ Algebra.IsSeparable F E


@[simp]
theorem lift'_id {f : Filter α} : f.lift' id = f


theorem coe_eq_of_mem_split_of_lt_mem {y : ι → ℝ} (h₁ : J ∈ split I i x) (h₂ : y ∈ J)
    (h₃ : x < y i) : (J : Set (ι → ℝ)) = ↑I ∩ { y | x < y i }

(h₁ : J ∈ BoxIntegral.Prepartition.split I i x)


@[simp]
theorem inf_le_right : a ⊓ b ≤ b

{α : Type u}
[SemilatticeInf α]
{a b : α}


@[simp]
theorem integralPowerBasis_gen [hcycl : IsCyclotomicExtension {p ^ k} ℚ K]
    (hζ : IsPrimitiveRoot ζ ↑(p ^ k)) :
    hζ.integralPowerBasis.gen = hζ.toInteger


theorem eq_num_div_den (f : HomogeneousLocalization 𝒜 x) :
    f.val = Localization.mk f.num ⟨f.den, f.den_mem⟩

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

f.val = Localization.mk f.num ⟨f.den, ⋯⟩


lemma OrthogonalIdempotents.prod_one_sub (he : OrthogonalIdempotents e) :
    ∏ i, (1 - e i) = 1 - ∑ i, e i

{R : Type u_1}
[CommRing R]
{I : Type u_3}
[Fintype I]
{e : I → R}
(he : OrthogonalIdempotents e)


@[simp]
theorem op_id_unop {X : Cᵒᵖ} : (𝟙 (unop X)).op = 𝟙 X

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X : Cᵒᵖ}

(CategoryTheory.CategoryStruct.id (Opposite.unop X)).op = CategoryTheory.CategoryStruct.id X


@[simp]
theorem hom_id (X : WidePullbackShape J) : Hom.id X = 𝟙 X

(X : CategoryTheory.Limits.WidePullbackShape J)

CategoryTheory.Limits.WidePullbackShape.Hom.id X = 𝟙 X


theorem const_add_termg {α} [AddCommGroup α] (k n x a a') (h : k + a = a') :
    k + @termg α _ n x a = termg n x a'

{α : Type u_1}
[AddCommGroup α]
(k : α)
(n : ℤ)
(x a a' : α)
(h : k + a = a')

k + Mathlib.Tactic.Abel.termg n x a = Mathlib.Tactic.Abel.termg n x a'


theorem comp_fderiv {f : G → E} {x : G} :
    fderiv 𝕜 (iso ∘ f) x = (iso : E →L[𝕜] F).comp (fderiv 𝕜 f x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
(iso : E ≃L[𝕜] F)
{f : G → E}
{x : G}

fderiv 𝕜 (⇑iso ∘ f) x = (↑iso).comp (fderiv 𝕜 f x)


{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedCommMonoidWithZero Γ₀]
(v : Valuation R Γ₀)


theorem nat_lt_aleph0 (n : ℕ) : (n : Cardinal.{u}) < ℵ₀


theorem homogeneousComponent_apply :
    homogeneousComponent n φ =
      ∑ d ∈ φ.support.filter fun d => d.degree = n, monomial d (coeff d φ)

{σ : Type u_1}
{R : Type u_3}
[CommSemiring R]
(n : ℕ)
(φ : MvPolynomial σ R)

(MvPolynomial.homogeneousComponent n) φ =
  ∑ d ∈ Finset.filter (fun d => d.degree = n) φ.support, (MvPolynomial.monomial d) (MvPolynomial.coeff d φ)


/-- Constructor for morphisms in `ComposableArrows C 1`. -/
@[simps!]
def homMk₁ {F G : ComposableArrows C 1}
    (left : F.obj' 0 ⟶ G.obj' 0) (right : F.obj' 1 ⟶ G.obj' 1)
    (w : F.map' 0 1 ≫ right = left ≫ G.map' 0 1 := by aesop_cat) :
    F ⟶ G

{F G : CategoryTheory.ComposableArrows C 1}

(w :
  CategoryTheory.CategoryStruct.comp (F.map' 0 1 ⋯ ⋯) right =
    CategoryTheory.CategoryStruct.comp left (G.map' 0 1 ⋯ ⋯) := by
  aesop_cat)

(CategoryTheory.ComposableArrows.homMk₁ left right w).app i =
  match i with
  | ⟨0, isLt⟩ => left
  | ⟨1, isLt⟩ => right


@[to_additive]
theorem image_smul : (fun x ↦ a • x) '' t = a • t

{α : Type u_2}
{β : Type u_3}
[VAdd α β]
{t : Set β}
{a : α}


/-- Composing with a family of surjective linear maps is injective. -/
theorem compLinearMap_injective (f : ∀ i, M₁ i →ₗ[R] M₁' i) (hf : ∀ i, Surjective (f i)) :
    Injective fun g : MultilinearMap R M₁' M₂ => g.compLinearMap f

(hf : ∀ (i : ι), Function.Surjective ⇑(f i))

Function.Injective fun g => g.compLinearMap f


@[simp]
theorem mul_apply (f g : Poly α) (x : α → ℕ) : (f * g) x = f x * g x

{α : Type u_1}
(f g : Poly α)
(x : α → ℕ)


@[to_additive (attr := simp)]
theorem coe_normGroupSeminorm : ⇑(normGroupSeminorm E) = norm


@[to_additive]
theorem continuousMul_iInf {ts : ι' → TopologicalSpace M}
    (h' : ∀ i, @ContinuousMul M (ts i) _) : @ContinuousMul M (⨅ i, ts i) _

{M : Type u_3}
{ι' : Sort u_6}
[Add M]
{ts : ι' → TopologicalSpace M}
(h' : ∀ (i : ι'), ContinuousAdd M)


theorem Lp.finStronglyMeasurable (f : Lp G p μ) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) :
    FinStronglyMeasurable f μ

{α : Type u_1}
{G : Type u_2}
{p : ℝ≥0∞}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup G]
(f : ↥(MeasureTheory.Lp G p μ))
(hp_ne_zero : p ≠ 0)
(hp_ne_top : p ≠ ⊤)


/-- The identity on the whole space as a partial homeomorphism. -/
@[simps! (config := mfld_cfg) apply, simps! (config := .lemmasOnly) source target]
protected def refl (X : Type*) [TopologicalSpace X] : PartialHomeomorph X X


/-- The gauge is always nonnegative. -/
theorem gauge_nonneg (x : E) : 0 ≤ gauge s x

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
(x : E)


@[to_additive]
theorem comp_assoc (g : F →* E) (f : G →* F) : p.comp (g.comp f) = (p.comp g).comp f

{E : Type u_4}
{F : Type u_5}
{G : Type u_6}
[Group E]
[Group F]
[Group G]
(p : GroupSeminorm E)
(g : F →* E)
(f : G →* F)


/-- `LinearMap.polyCharpolyAux` is independent of the choice of basis of the target module.

Proof strategy:
1. Rewrite `polyCharpolyAux` as the (honest, ordinary) characteristic polynomial
   of the basechange of `φ` to the multivariate polynomial ring `MvPolynomial ι R`.
2. Use that the characteristic polynomial of a linear map is independent of the choice of basis.
   This independence result is used transitively via
   `LinearMap.polyCharpolyAux_map_aeval` and `LinearMap.polyCharpolyAux_map_eq_charpoly`. -/
lemma polyCharpolyAux_basisIndep {ιM' : Type*} [Fintype ιM'] [DecidableEq ιM']
    (bₘ' : Basis ιM' R M) :
    polyCharpolyAux φ b bₘ = polyCharpolyAux φ b bₘ'

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

φ.polyCharpolyAux b bₘ = φ.polyCharpolyAux b bₘ'


@[simp]
lemma map_baseChange {S : Type s} [CommRing S] [Algebra R S] {A : Type v} [CommRing A] [Algebra R A]
    [Algebra S A] [IsScalarTower R S A] {B : Type w} [CommRing B] [Algebra R B] [Algebra S B]
    [IsScalarTower R S B] (ψ : A →ₐ[S] B) : (C.baseChange A).map ψ = C.baseChange B

{R : Type u}
[CommRing R]
(C : WeierstrassCurve.VariableChange R)
{S : Type s}
[CommRing S]
[Algebra R S]
{A : Type v}
[CommRing A]
[Algebra R A]
[Algebra S A]
[IsScalarTower R S A]
{B : Type w}
[CommRing B]
[Algebra R B]
[Algebra S B]
[IsScalarTower R S B]
(ψ : A →ₐ[S] B)

WeierstrassCurve.VariableChange.map (↑ψ) (WeierstrassCurve.VariableChange.baseChange A C) =
  WeierstrassCurve.VariableChange.baseChange B C


lemma isUnit_Y_of_Z_eq_zero {P : Fin 3 → F} (hP : W.Nonsingular P) (hPz : P z = 0) : IsUnit (P y)

{F : Type v}
[Field F]
{W : WeierstrassCurve.Jacobian F}
{P : Fin 3 → F}
(hP : W.Nonsingular P)
(hPz : P z = 0)


@[simp]
theorem tail_empty : tail (empty α) = empty α

(Computation.empty α).tail = Computation.empty α


theorem principal_mul_one : Principal (· * ·) 1

Ordinal.Principal (fun x x_1 => x * x_1) 1


/-- The sum of `1/(c^i)^2` above a threshold `j` is comparable to `1/j^2`, up to a multiplicative
constant. -/
theorem sum_div_pow_sq_le_div_sq (N : ℕ) {j : ℝ} (hj : 0 < j) {c : ℝ} (hc : 1 < c) :
    (∑ i ∈ (range N).filter (j < c ^ ·), (1 : ℝ) / (c ^ i) ^ 2) ≤ c ^ 3 * (c - 1)⁻¹ / j ^ 2

∑ i ∈ Finset.filter (fun x => j < c ^ x) (Finset.range N), 1 / (c ^ i) ^ 2 ≤ c ^ 3 * (c - 1)⁻¹ / j ^ 2


theorem LieSubmodule.lie_abelian_iff_lie_self_eq_bot : IsLieAbelian I ↔ ⁅I, I⁆ = ⊥

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


/-- Sum of a list of elements in a `Subsemiring` is in the `Subsemiring`. -/
protected theorem list_sum_mem {l : List R} : (∀ x ∈ l, x ∈ s) → l.sum ∈ s

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


theorem map_one_div (I : FractionalIdeal R₁⁰ K) (h : K ≃ₐ[R₁] K') :
    (1 / I).map (h : K →ₐ[R₁] K') = 1 / I.map h

{R₁ : Type u_3}
[CommRing R₁]
{K : Type u_4}
[Field K]
[Algebra R₁ K]
[frac : IsFractionRing R₁ K]
[IsDomain R₁]
{K' : Type u_5}
[Field K']
[Algebra R₁ K']
[IsFractionRing R₁ K']
(I : FractionalIdeal R₁⁰ K)
(h : K ≃ₐ[R₁] K')

FractionalIdeal.map (↑h) (1 / I) = 1 / FractionalIdeal.map (↑h) I


@[simp]
theorem num_pow (c : NumDenSameDeg 𝒜 x) (n : ℕ) : ((c ^ n).num : A) = (c.num : A) ^ n

(c : HomogeneousLocalization.NumDenSameDeg 𝒜 x)


/-- A cone for a functor `F : J ⥤ HomologicalComplex C c` which is given in degree `n` by
the limit `F ⋙ eval C c n`. -/
@[simps]
noncomputable def coneOfHasLimitEval : Cone F

[∀ (n : ι), CategoryTheory.Limits.HasLimit (F ⋙ HomologicalComplex.eval C c n)]

(HomologicalComplex.coneOfHasLimitEval F).pt.d n m =
  CategoryTheory.Limits.limMap { app := fun j => (F.obj j).d n m, naturality := ⋯ }


theorem mem_inf_of_left {f g : Filter α} {s : Set α} (h : s ∈ f) : s ∈ f ⊓ g

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


theorem ultrafilter_pure_injective : Function.Injective (pure : α → Ultrafilter α)


@[to_additive]
theorem discreteTopology_iff_isOpen_singleton_one : DiscreteTopology G ↔ IsOpen ({1} : Set G)

{G : Type w}
[TopologicalSpace G]
[Group G]
[ContinuousMul G]


theorem Nonempty.of_infs_right : (s ⊼ t).Nonempty → t.Nonempty

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


private theorem add_le_add_right' : ∀ {x y z : PGame}, x ≤ y → x + z ≤ y + z


@[simp] theorem beq_nil₂ [BEq α] [BEq β] : ((.nil : AssocList α β) == .nil) = true

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

(Batteries.AssocList.nil == Batteries.AssocList.nil) = true


/-- The datum of an extra degeneracy is a technical condition on
augmented simplicial objects. The morphisms `s'` and `s n` of the
structure formally behave like extra degeneracies `σ (-1)`. -/
@[ext]
structure ExtraDegeneracy (X : SimplicialObject.Augmented C) where
  s' : point.obj X ⟶ drop.obj X _[0]
  s : ∀ n : ℕ, drop.obj X _[n] ⟶ drop.obj X _[n + 1]
  s'_comp_ε : s' ≫ X.hom.app (op [0]) = 𝟙 _
  s₀_comp_δ₁ : s 0 ≫ X.left.δ 1 = X.hom.app (op [0]) ≫ s'
  s_comp_δ₀ : ∀ n : ℕ, s n ≫ X.left.δ 0 = 𝟙 _
  s_comp_δ :
    ∀ (n : ℕ) (i : Fin (n + 2)), s (n + 1) ≫ X.left.δ i.succ = X.left.δ i ≫ s n
  s_comp_σ :
    ∀ (n : ℕ) (i : Fin (n + 1)), s n ≫ X.left.σ i.succ = X.left.σ i ≫ s (n + 1)

{X : CategoryTheory.SimplicialObject.Augmented C}

(self : SimplicialObject.Augmented.ExtraDegeneracy X)

self.s (n + 1) ≫ X.left.δ i.succ = X.left.δ i ≫ self.s n


/-- In a Lie group, inversion is a smooth map. -/
@[to_additive "In an additive Lie group, inversion is a smooth map."]
theorem smooth_inv : Smooth I I fun x : G => x⁻¹

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
(I : ModelWithCorners 𝕜 E H)
{G : Type u_5}
[TopologicalSpace G]
[ChartedSpace H G]
[Group G]
[LieGroup I G]


theorem isRat_sub {α} [Ring α] {f : α → α → α} {a b : α} {na nb nc : ℤ} {da db dc k : ℕ}
    (hf : f = HSub.hSub) (ra : IsRat a na da) (rb : IsRat b nb db)
    (h₁ : Int.sub (Int.mul na db) (Int.mul nb da) = Int.mul k nc)
    (h₂ : Nat.mul da db = Nat.mul k dc) :
    IsRat (f a b) nc dc

{f : α → α → α}

(ra : Mathlib.Meta.NormNum.IsRat a na da)

(rb : Mathlib.Meta.NormNum.IsRat b nb db)

(h₁ : (na.mul ↑db).sub (nb.mul ↑da) = (↑k).mul nc)

Mathlib.Meta.NormNum.IsRat (f a b) nc dc


theorem generateFrom_union (a₁ a₂ : Set (Set α)) :
    generateFrom (a₁ ∪ a₂) = generateFrom a₁ ⊓ generateFrom a₂

TopologicalSpace.generateFrom (a₁ ∪ a₂) = TopologicalSpace.generateFrom a₁ ⊓ TopologicalSpace.generateFrom a₂


/-- **Rolle's Theorem** `deriv` version -/
theorem exists_deriv_eq_zero (hab : a < b) (hfc : ContinuousOn f (Icc a b)) (hfI : f a = f b) :
    ∃ c ∈ Ioo a b, deriv f c = 0

{f : ℝ → ℝ}
{a b : ℝ}
(hab : a < b)
(hfc : ContinuousOn f (Set.Icc a b))
(hfI : f a = f b)


protected theorem IsNormal.isFundamentalSequence {f : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f)
    {a o} (ha : IsLimit a) {g} (hg : IsFundamentalSequence a o g) :
    IsFundamentalSequence (f a) o fun b hb => f (g b hb)

{g : (b : Ordinal.{u}) → b < o → Ordinal.{u}}

(f a).IsFundamentalSequence o fun b hb => f (g b hb)


lemma measurable_densityProcess_left (κ : Kernel α (γ × β)) (ν : Kernel α γ) (n : ℕ)
    (x : γ) {s : Set β} (hs : MeasurableSet s) :
    Measurable (fun a ↦ densityProcess κ ν n a x s)

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

Measurable fun a => κ.densityProcess ν n a x s


/-- Whiskering by an equivalence gives an equivalence between categories of cones.
-/
@[simps]
def whiskeringEquivalence (e : K ≌ J) : Cone F ≌ Cone (e.functor ⋙ F)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{K : Type u₂}
[CategoryTheory.Category.{v₂, u₂} K]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
(e : K ≌ J)

(CategoryTheory.Limits.Cones.whiskeringEquivalence e).unitIso =
  CategoryTheory.NatIso.ofComponents
    (fun s => CategoryTheory.Limits.Cones.ext (CategoryTheory.Iso.refl ((𝟭 (CategoryTheory.Limits.Cone F)).obj s).pt) ⋯)
    ⋯


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

Group.FG G ↔ ∃ S, Subgroup.closure S = ⊤ ∧ S.Finite


@[simp]
theorem funCongrLeft_comp (e₁ : m ≃ n) (e₂ : n ≃ p) :
    funCongrLeft R M (Equiv.trans e₁ e₂) =
      LinearEquiv.trans (funCongrLeft R M e₂) (funCongrLeft R M e₁)

(R : Type u_1)
(M : Type u_8)
[Semiring R]
[AddCommMonoid M]
[Module R M]
{m : Type u_17}
{n : Type u_18}
{p : Type u_19}
(e₁ : m ≃ n)
(e₂ : n ≃ p)

LinearEquiv.funCongrLeft R M (e₁.trans e₂) = LinearEquiv.funCongrLeft R M e₂ ≪≫ₗ LinearEquiv.funCongrLeft R M e₁


/-- The map to the restriction of a presheafed space along the canonical inclusion from the top
subspace.
-/
@[simps]
def toRestrictTop (X : PresheafedSpace C) : X ⟶ X.restrict (Opens.openEmbedding ⊤)

(X : AlgebraicGeometry.PresheafedSpace C)

X.toRestrictTop.c = CategoryTheory.eqToHom ⋯


theorem isLocalRingHom_expand {p : ℕ} (hp : 0 < p) :
    IsLocalRingHom (↑(expand R p) : R[X] →+* R[X])

(R : Type u)
[CommRing R]
[IsDomain R]
{p : ℕ}
(hp : 0 < p)


@[to_additive]
theorem mem_iSup_of_mem {ι : Sort*} {S : ι → Subgroup G} (i : ι) :
    ∀ {x : G}, x ∈ S i → x ∈ iSup S

{G : Type u_1}
[AddGroup G]
{ι : Sort u_5}
{S : ι → AddSubgroup G}
(i : ι)
{x : G}


lemma sqrt_le_iff_le_sq : sqrt x ≤ y ↔ x ≤ y ^ 2


theorem tsum_coe_ne_top_iff_summable_coe {f : α → ℝ≥0} :
    (∑' a, (f a : ℝ≥0∞)) ≠ ∞ ↔ Summable fun a => (f a : ℝ)

∑' (a : α), ↑(f a) ≠ ⊤ ↔ Summable fun a => ↑(f a)


/-- If `I` is an ideal of a commutative ring `R`, if `q : R → R/I` is the quotient map, and if
`s ⊆ R` is a subset, then `q⁻¹(q(s)) = ⋃ᵢ(i + s)`, the union running over all `i ∈ I`. -/
theorem quotient_ring_saturate (I : Ideal R) (s : Set R) :
    mk I ⁻¹' (mk I '' s) = ⋃ x : I, (fun y => x.1 + y) '' s

{R : Type u}
[CommRing R]
(I : Ideal R)
(s : Set R)

⇑(Ideal.Quotient.mk I) ⁻¹' (⇑(Ideal.Quotient.mk I) '' s) = ⋃ x, (fun y => ↑x + y) '' s


theorem _root_.Set.Infinite.Nat.sSup_eq_zero {s : Set ℕ} (h : s.Infinite) : sSup s = 0


/-- An equivalence between `MonoOver A` and `MonoOver B` gives an equivalence
between `Subobject A` and `Subobject B`. -/
@[simps]
def lowerEquivalence {A : C} {B : D} (e : MonoOver A ≌ MonoOver B) : Subobject A ≌ Subobject B

(e : CategoryTheory.MonoOver A ≌ CategoryTheory.MonoOver B)

(CategoryTheory.Subobject.lowerEquivalence e).inverse = CategoryTheory.Subobject.lower e.inverse


/-- The isometry sending `(Q.prod <| -Q)` to `(QuadraticForm.dualProd R M)`.

This is `σ` from Proposition 4.8, page 84 of
[*Hermitian K-Theory and Geometric Applications*][hyman1973]; though we swap the order of the pairs.
-/
@[simps!]
def toDualProd (Q : QuadraticForm R M) [Invertible (2 : R)] :
    (Q.prod <| -Q) →qᵢ QuadraticForm.dualProd R M

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

Q.toDualProd i = ((QuadraticMap.associated Q) i.1 + (QuadraticMap.associated Q) i.2, i.1 - i.2)


@[simp]
theorem toFun_eq (f : ArithmeticFunction R) : f.toFun = f

{R : Type u_1}
[Zero R]
(f : ArithmeticFunction R)


theorem triangle (X Y : C) :
    (BinaryFan.associatorOfLimitCone ℬ X 𝒯.cone.pt Y).hom ≫
        tensorHom ℬ (𝟙 X) (BinaryFan.leftUnitor 𝒯.isLimit (ℬ 𝒯.cone.pt Y).isLimit).hom =
      tensorHom ℬ (BinaryFan.rightUnitor 𝒯.isLimit (ℬ X 𝒯.cone.pt).isLimit).hom (𝟙 Y)

(𝒯 : CategoryTheory.Limits.LimitCone (CategoryTheory.Functor.empty C))

(ℬ : (X Y : C) → CategoryTheory.Limits.LimitCone (CategoryTheory.Limits.pair X Y))

CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.BinaryFan.associatorOfLimitCone ℬ X 𝒯.cone.pt Y).hom
    (CategoryTheory.MonoidalOfChosenFiniteProducts.tensorHom ℬ (CategoryTheory.CategoryStruct.id X)
      (CategoryTheory.Limits.BinaryFan.leftUnitor 𝒯.isLimit (ℬ 𝒯.cone.pt Y).isLimit).hom) =
  CategoryTheory.MonoidalOfChosenFiniteProducts.tensorHom ℬ
    (CategoryTheory.Limits.BinaryFan.rightUnitor 𝒯.isLimit (ℬ X 𝒯.cone.pt).isLimit).hom
    (CategoryTheory.CategoryStruct.id Y)


@[simp]
theorem withDensityᵥ_sub (hf : Integrable f μ) (hg : Integrable g μ) :
    μ.withDensityᵥ (f - g) = μ.withDensityᵥ f - μ.withDensityᵥ g

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f g : α → E}
(hf : MeasureTheory.Integrable f μ)
(hg : MeasureTheory.Integrable g μ)


@[simp]
theorem tmul_comp_tensorComm (Q₁ : QuadraticForm R M₁) (Q₂ : QuadraticForm R M₂) :
    (Q₂.tmul Q₁).comp (TensorProduct.comm R M₁ M₂) = Q₁.tmul Q₂

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

QuadraticMap.comp (Q₂.tmul Q₁) ↑(TensorProduct.comm R M₁ M₂) = Q₁.tmul Q₂


/-- Let `M'` be a manifold whose chart structure is given by an open embedding `e'` into its model
space `H'`. Then the smoothness of `e' ∘ f : M → H'` implies the smoothness of `f`.

This is useful, for example, when `e' ∘ f = g ∘ e` for smooth maps `e : M → X` and `g : X → H'`. -/
lemma ContMDiff.of_comp_openEmbedding {f : M → M'} (hf : ContMDiff I I' n (e' ∘ f)) :
    haveI := h'.singletonChartedSpace; ContMDiff I I' n f

{𝕜 : 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']
[Nonempty M']
{e' : M' → H'}
(h' : OpenEmbedding e')
{n : WithTop ℕ}
{f : M → M'}
(hf : ContMDiff I I' n (e' ∘ f))


/-- Suppose `A` is an `R`-algebra, `M` is an `A`-module such that `a • m ≠ 0` for all non-zero `a`
and `m`. If `x : A` fixes a nontrivial f.g. `R`-submodule `N` of `M`, then `x` is `R`-integral. -/
theorem isIntegral_of_smul_mem_submodule {M : Type*} [AddCommGroup M] [Module R M] [Module A M]
    [IsScalarTower R A M] [NoZeroSMulDivisors A M] (N : Submodule R M) (hN : N ≠ ⊥) (hN' : N.FG)
    (x : A) (hx : ∀ n ∈ N, x • n ∈ N) : IsIntegral R x

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[CommRing A]
[Algebra R A]
{M : Type u_5}
[AddCommGroup M]
[Module R M]
[Module A M]
[IsScalarTower R A M]
[NoZeroSMulDivisors A M]
(N : Submodule R M)
(hN : N ≠ ⊥)
(hN' : N.FG)
(x : A)
(hx : ∀ n ∈ N, x • n ∈ N)


@[to_additive]
lemma mem_ofUnits_iff (S : Subgroup Mˣ) (x : M) : x ∈ S.ofUnits ↔ ∃ y ∈ S, y = x

{M : Type u_1}
[Monoid M]
(S : Subgroup Mˣ)
(x : M)


@[to_additive] lemma pow_mul_comm (a : M) (m n : ℕ) : a ^ m * a ^ n = a ^ n * a ^ m

{M : Type u_2}
[Monoid M]
(a : M)
(m n : ℕ)


lemma induceHom_injective (hi : Set.InjOn φ s) :
    Function.Injective (induceHom φ φst)

{V : Type u_1}
{W : Type u_2}
{G : SimpleGraph V}
{G' : SimpleGraph W}
{s : Set V}
{t : Set W}
(φ : G →g G')
(φst : Set.MapsTo (⇑φ) s t)
(hi : Set.InjOn (⇑φ) s)

Function.Injective ⇑(SimpleGraph.induceHom φ φst)


theorem ext_getElem {l₁ l₂ : List α} (hl : length l₁ = length l₂)
    (h : ∀ (n : Nat) (h₁ : n < l₁.length) (h₂ : n < l₂.length), l₁[n]'h₁ = l₂[n]'h₂) : l₁ = l₂

(h : ∀ (n : Nat) (h₁ : n < l₁.length) (h₂ : n < l₂.length), l₁[n] = l₂[n])


theorem closure_sup_closure_le (x y : α) : c x ⊔ c y ≤ c (x ⊔ y)

{α : Type u_1}
[SemilatticeSup α]
(c : ClosureOperator α)
(x y : α)


@[simp] theorem lmarginal_univ [Fintype δ] {f : (∀ i, π i) → ℝ≥0∞} :
    ∫⋯∫⁻_univ, f ∂μ = fun _ => ∫⁻ x, f x ∂Measure.pi μ

{μ : (i : δ) → MeasureTheory.Measure (π i)}

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

∫⋯∫⁻_Finset.univ, f ∂μ = fun x => ∫⁻ (x : (i : δ) → π i), f x ∂MeasureTheory.Measure.pi μ


theorem piiUnionInter_mono_right {π : ι → Set (Set α)} {S T : Set ι} (hST : S ⊆ T) :
    piiUnionInter π S ⊆ piiUnionInter π T

{α : Type u_1}
{ι : Type u_2}
{π : ι → Set (Set α)}
{S T : Set ι}
(hST : S ⊆ T)


/-- The `dist : X → X → ℝ` respects the ultrametric inequality
of `dist(x, z) ≤ max (dist(x,y)) (dist(y,z))`. -/
class IsUltrametricDist (X : Type*) [Dist X] : Prop where
  dist_triangle_max : ∀ x y z : X, dist x z ≤ max (dist x y) (dist y z)

{X : Type u_2}
[Dist X]
[self : IsUltrametricDist X]
(x y z : X)


theorem mem_spanningSetsIndex (μ : Measure α) [SigmaFinite μ] (x : α) :
    x ∈ spanningSets μ (spanningSetsIndex μ x)

{α : Type u_1}
{m0 : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
[MeasureTheory.SigmaFinite μ]
(x : α)

x ∈ MeasureTheory.spanningSets μ (MeasureTheory.spanningSetsIndex μ x)


lemma counit_obj_eq_map_counit [Coreflective j] (X : D) :
    (coreflectorAdjunction j).counit.app (j.obj ((coreflector j).obj X)) =
      j.map ((coreflector j).map ((coreflectorAdjunction j).counit.app X))

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

(CategoryTheory.coreflectorAdjunction j).counit.app (j.obj ((CategoryTheory.coreflector j).obj X)) =
  j.map ((CategoryTheory.coreflector j).map ((CategoryTheory.coreflectorAdjunction j).counit.app X))


theorem add_modByMonic (p₁ p₂ : R[X]) : (p₁ + p₂) %ₘ q = p₁ %ₘ q + p₂ %ₘ q

{R : Type u}
[CommRing R]
{q : R[X]}
(p₁ p₂ : R[X])


/-- Auxiliary definition for `functorCategoryEquivalence`. -/
@[simps]
def functor : Action V G ⥤ SingleObj G ⥤ V

{V : Type (u + 1)}
[CategoryTheory.LargeCategory V]
{G : MonCat}
(M : Action V G)

∀ {X Y : CategoryTheory.SingleObj ↑G} (g : X ⟶ Y), (Action.FunctorCategoryEquivalence.functor.obj M).map g = M.ρ g


@[simp]
theorem isBigO_exp_comp_exp_comp {f g : α → ℝ} :
    ((fun x => exp (f x)) =O[l] fun x => exp (g x)) ↔ IsBoundedUnder (· ≤ ·) l (f - g)

{α : Type u_1}
{l : Filter α}
{f g : α → ℝ}

((fun x => Real.exp (f x)) =O[l] fun x => Real.exp (g x)) ↔ Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l (f - g)


/-- A generalized Boolean algebra is a distributive lattice with `⊥` and a relative complement
operation `\` (called `sdiff`, after "set difference") satisfying `(a ⊓ b) ⊔ (a \ b) = a` and
`(a ⊓ b) ⊓ (a \ b) = ⊥`, i.e. `a \ b` is the complement of `b` in `a`.

This is a generalization of Boolean algebras which applies to `Finset α` for arbitrary
(not-necessarily-`Fintype`) `α`. -/
class GeneralizedBooleanAlgebra (α : Type u) extends DistribLattice α, SDiff α, Bot α where
  /-- For any `a`, `b`, `(a ⊓ b) ⊔ (a / b) = a` -/
  sup_inf_sdiff : ∀ a b : α, a ⊓ b ⊔ a \ b = a
  /-- For any `a`, `b`, `(a ⊓ b) ⊓ (a / b) = ⊥` -/
  inf_inf_sdiff : ∀ a b : α, a ⊓ b ⊓ a \ b = ⊥

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