@[simp]
theorem comp_toNatTrans {T₁ T₂ T₃ : Comonad C} (f : T₁ ⟶ T₂) (g : T₂ ⟶ T₃) :
    (f ≫ g).toNatTrans = ((f.toNatTrans : _ ⟶ (T₂ : C ⥤ C)) ≫ g.toNatTrans : (T₁ : C ⥤ C) ⟶ T₃)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{T₁ T₂ T₃ : CategoryTheory.Comonad C}
(f : T₁ ⟶ T₂)
(g : T₂ ⟶ T₃)

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


theorem injective_iff_bijective {f : α → α} : Injective f ↔ Bijective f

Function.Injective f ↔ Function.Bijective f


theorem const_lintegral (c : ℝ≥0∞) : (const α c).lintegral μ = c * μ univ

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

(MeasureTheory.SimpleFunc.const α c).lintegral μ = c * μ Set.univ


/-- Split coequalizers are absolute: they are preserved by any functor. -/
@[simps]
def IsSplitCoequalizer.map {Z : C} {π : Y ⟶ Z} (q : IsSplitCoequalizer f g π) (F : C ⥤ D) :
    IsSplitCoequalizer (F.map f) (F.map g) (F.map π)

(q : CategoryTheory.IsSplitCoequalizer f g π)

(q.map F).rightSection = F.map q.rightSection


@[simp]
theorem default_eq : (default : Perm α) = 1


@[to_additive (attr := simp)]
theorem lt_inv_mul_iff_mul_lt : b < a⁻¹ * c ↔ a * b < c

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


/-- The minimal distance is monotone with respect to inclusion. -/
theorem infDist_le_infDist_of_subset (h : s ⊆ t) (hs : s.Nonempty) : infDist x t ≤ infDist x s

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


@[simp]
theorem zero_apply (n : ℕ) : (0 : AdicCauchySequence I M) n = 0

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


theorem inv_eq_of_equiv_zero {x : PGame} (h : x ≈ 0) : x⁻¹ = 0


@[to_additive (attr := simp) fst_comp_prod]
theorem fst_comp_prod (f : M →* N) (g : M →* P) : (fst N P).comp (f.prod g) = f

{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[AddZeroClass M]
[AddZeroClass N]
[AddZeroClass P]
(f : M →+ N)
(g : M →+ P)

(AddMonoidHom.fst N P).comp (f.prod g) = f


@[to_additive (attr := simp)]
theorem iInter_inv (s : ι → Set α) : (⋂ i, s i)⁻¹ = ⋂ i, (s i)⁻¹

{α : Type u_2}
{ι : Sort u_5}
[Inv α]
(s : ι → Set α)


/-- `a ↦ {a}` as an equivalence between `α` and `Sym α 1`. -/
@[simps apply]
def oneEquiv : α ≃ Sym α 1


@[simp] theorem top_ne_natCast (n : ℕ) : ∞ ≠ n


/-- If `f` is a Lipschitz continuous map, then the Hausdorff dimension of its range is at most the
Hausdorff dimension of its domain. -/
theorem dimH_range_le (h : LipschitzWith K f) : dimH (range f) ≤ dimH (univ : Set X)

{X : Type u_2}
{Y : Type u_3}
[EMetricSpace X]
[EMetricSpace Y]
{K : ℝ≥0}
{f : X → Y}
(h : LipschitzWith K f)


lemma map_mk (x : R[X][Y]) : map W f (mk W x) = mk (W.map f) (x.map <| mapRingHom f)

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
(W : WeierstrassCurve.Affine R)
(f : R →+* S)
(x : R[X][Y])

(WeierstrassCurve.Affine.CoordinateRing.map W f) ((WeierstrassCurve.Affine.CoordinateRing.mk W) x) =
  (WeierstrassCurve.Affine.CoordinateRing.mk (WeierstrassCurve.map W f)) (Polynomial.map (Polynomial.mapRingHom f) x)


theorem cardinal_sInter_mem {S : Set (Set α)} [CardinalInterFilter l c] (hSc : #S < c) :
    ⋂₀ S ∈ l ↔ ∀ s ∈ S, s ∈ l

{α : Type u}
{c : Cardinal.{u}}
{l : Filter α}
{S : Set (Set α)}
[CardinalInterFilter l c]
(hSc : #↑S < c)

⋂₀ S ∈ l ↔ ∀ s ∈ S, s ∈ l


@[to_additive (attr := simp)]
theorem elim_one_one [One γ] : Sum.elim (1 : α → γ) (1 : β → γ) = 1

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Zero γ]


theorem filter_or (s : Finset α) : (s.filter fun a => p a ∨ q a) = s.filter p ∪ s.filter q

{α : Type u_1}
(p q : α → Prop)
[DecidablePred p]
[DecidablePred q]
[DecidableEq α]
(s : Finset α)

Finset.filter (fun a => p a ∨ q a) s = Finset.filter p s ∪ Finset.filter q s


theorem coe_toNNReal_le_self : ∀ {a : ℝ≥0∞}, ↑a.toNNReal ≤ a


theorem mul_I_re (z : ℂ) : (z * I).re = -z.im


lemma toRatCDF_unit_prod (a : α) :
    toRatCDF (fun (p : Unit × α) ↦ f p.2) ((), a) = toRatCDF f a

ProbabilityTheory.toRatCDF (fun p => f p.2) ((), a) = ProbabilityTheory.toRatCDF f a


theorem closedBall_eq_univ_of_half_period_le (hp : p ≠ 0) (x : AddCircle p) {ε : ℝ}
    (hε : |p| / 2 ≤ ε) : closedBall x ε = univ

(p : ℝ)
(hp : p ≠ 0)
(x : AddCircle p)
{ε : ℝ}
(hε : |p| / 2 ≤ ε)


/-- Boundaryless manifolds have empty boundary. -/
lemma Boundaryless.boundary_eq_empty : I.boundary M = ∅

{𝕜 : 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]
[BoundarylessManifold I M]


/-- The equivalence of categories from the order dual of a preordered type `X`
to the opposite category of the preorder `X`. -/
@[simps]
def orderDualEquivalence : Xᵒᵈ ≌ Xᵒᵖ

(CategoryTheory.orderDualEquivalence X).functor.obj x = Opposite.op (OrderDual.ofDual x)


lemma sheafificationHomEquiv_hom
    {P : PresheafOfModules.{v} R₀} {F : SheafOfModules.{v} R}
    (f : (sheafification α).obj P ⟶ F) :
    (sheafificationHomEquiv α f).hom =
      (sheafificationAdjunction J AddCommGrp).homEquiv P.presheaf
        ((SheafOfModules.toSheaf _).obj F) ((SheafOfModules.toSheaf _).map f)

{J : CategoryTheory.GrothendieckTopology C}

(f : (PresheafOfModules.sheafification α).obj P ⟶ F)

((PresheafOfModules.sheafificationHomEquiv α) f).hom =
  ((CategoryTheory.sheafificationAdjunction J AddCommGrp).homEquiv P.presheaf ((SheafOfModules.toSheaf R).obj F))
    ((SheafOfModules.toSheaf R).map f)


theorem hasDerivAt_gronwallBound (δ K ε x : ℝ) :
    HasDerivAt (gronwallBound δ K ε) (K * gronwallBound δ K ε x + ε) x


theorem IsSeqCompact.subseq_of_frequently_in {s : Set X} (hs : IsSeqCompact s) {x : ℕ → X}
    (hx : ∃ᶠ n in atTop, x n ∈ s) :
    ∃ a ∈ s, ∃ φ : ℕ → ℕ, StrictMono φ ∧ Tendsto (x ∘ φ) atTop (𝓝 a)

(hx : ∃ᶠ (n : ℕ) in Filter.atTop, x n ∈ s)

∃ a ∈ s, ∃ φ, StrictMono φ ∧ Filter.Tendsto (x ∘ φ) Filter.atTop (𝓝 a)


theorem isBounded_iff_exists_ge {s : Set α} (c : ℝ) :
    IsBounded s ↔ ∃ C, c ≤ C ∧ ∀ ⦃x⦄, x ∈ s → ∀ ⦃y⦄, y ∈ s → dist x y ≤ C

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
(c : ℝ)

Bornology.IsBounded s ↔ ∃ C, c ≤ C ∧ ∀ ⦃x : α⦄, x ∈ s → ∀ ⦃y : α⦄, y ∈ s → dist x y ≤ C


protected theorem div_mul_cancel {n m : Nat} (H : n ∣ m) : m / n * n = m


@[simp]
lemma map_succ_succ (i j : ℕ) (hi : i + 1 < n + 1 + 1) (hj : j + 1 < n + 1 + 1)
    (hij : i + 1 ≤ j + 1) :
    map F f ⟨i + 1, hi⟩ ⟨j + 1, hj⟩ hij = F.map' i j

(F : CategoryTheory.ComposableArrows C n)

CategoryTheory.ComposableArrows.Precomp.map F f ⟨i + 1, hi⟩ ⟨j + 1, hj⟩ hij = F.map' i j ⋯ ⋯


@[to_additive]
theorem eq_mul_of_mul_inv_eq (h : a * c⁻¹ = b) : a = b * c

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


private theorem factorial_smul' {n : ℕ} : ∀ {F : Type max u v} [NormedAddCommGroup F]
    [NormedSpace 𝕜 F] [CompleteSpace F] {p : FormalMultilinearSeries 𝕜 E F}
    {f : E → F}, HasFPowerSeriesOnBall f p x r →
    n ! • p n (fun _ ↦ y) = iteratedFDeriv 𝕜 n f x (fun _ ↦ y)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{r : ℝ≥0∞}
(y : E)
{n : ℕ}
{F : Type (max u v)}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{p : FormalMultilinearSeries 𝕜 E F}
{f : E → F}

HasFPowerSeriesOnBall f p x r → (n.factorial • (p n) fun x => y) = (iteratedFDeriv 𝕜 n f x) fun x => y


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


theorem zero_isRadical_iff [MonoidWithZero R] : IsRadical (0 : R) ↔ IsReduced R


@[to_additive (attr := simp, nolint simpNF)]
theorem mem_map_iff_mem {f : M →ₙ* N} (hf : Function.Injective f) {S : Subsemigroup M} {x : M} :
    f x ∈ S.map f ↔ x ∈ S

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
{f : M →ₙ* N}
(hf : Function.Injective ⇑f)
{S : Subsemigroup M}
{x : M}


theorem isOpen_iff {s : Set (Filter α)} : IsOpen s ↔ ∃ T : Set (Set α), s = ⋃ t ∈ T, Iic (𝓟 t)

IsOpen s ↔ ∃ T, s = ⋃ t ∈ T, Set.Iic (𝓟 t)


theorem supDegree_eq_natDegree (p : R[X]) : p.toFinsupp.supDegree id = p.natDegree

AddMonoidAlgebra.supDegree id p.toFinsupp = p.natDegree


@[to_additive]
theorem tprod_comm {f : β → γ → α} (h : Multipliable (Function.uncurry f)) :
    ∏' (c) (b), f b c = ∏' (b) (c), f b c

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[AddCommGroup α]
[UniformSpace α]
[UniformAddGroup α]
[CompleteSpace α]
[T0Space α]
{f : β → γ → α}
(h : Summable (Function.uncurry f))


@[simp] theorem partition_eq_filter_filter (p : α → Bool) (l : List α) :
    partition p l = (filter p l, filter (not ∘ p) l)

{α : Type u_1}
(p : α → Bool)
(l : List α)
{as bs : List α}

List.partition.loop p l (as, bs) = (as.reverse ++ List.filter p l, bs.reverse ++ List.filter (not ∘ p) l)


/-- The kernel of `g.unop` is the opposite of `cokernel g`. -/
@[simps!]
def kernelUnopUnop : kernel g.unop ≅ (cokernel g).unop

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Abelian C]
{A B : Cᵒᵖ}
(g : A ⟶ B)

(CategoryTheory.kernelUnopUnop g).inv =
  CategoryTheory.Limits.kernel.lift g.unop (CategoryTheory.Limits.cokernel.π g).unop ⋯


/-- `x ↦ x⁻¹` as an order-reversing equivalence. -/
@[to_additive (attr := simps!) "`x ↦ -x` as an order-reversing equivalence."]
def OrderIso.inv : α ≃o αᵒᵈ

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

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

∀ (a : αᵒᵈ), (RelIso.symm (OrderIso.inv α)) a = (OrderDual.ofDual a)⁻¹


lemma apply_coroot_eq_cast' :
    β (coroot α) = ↑(chainLength α β - 2 * chainTopCoeff α β : ℤ)

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

β (LieAlgebra.IsKilling.coroot α) = ↑(↑(LieAlgebra.IsKilling.chainLength α β) - 2 * ↑(LieModule.chainTopCoeff (⇑α) β))


protected theorem surjective (e : L₁ ≃ₗ⁅R⁆ L₂) :
    Function.Surjective ((e : L₁ →ₗ⁅R⁆ L₂) : L₁ → L₂)

{R : Type u}
{L₁ : Type v}
{L₂ : Type w}
[CommRing R]
[LieRing L₁]
[LieRing L₂]
[LieAlgebra R L₁]
[LieAlgebra R L₂]
(e : L₁ ≃ₗ⁅R⁆ L₂)


@[simp]
theorem fst_mul [Mul R] [Add M] [SMul R M] [SMul Rᵐᵒᵖ M] (x₁ x₂ : tsze R M) :
    (x₁ * x₂).fst = x₁.fst * x₂.fst

{R : Type u}
{M : Type v}
[Mul R]
[Add M]
[SMul R M]
[SMul Rᵐᵒᵖ M]
(x₁ x₂ : tsze R M)


@[to_additive (attr := simp)]
lemma dist_unop (x y : αᵐᵒᵖ) : dist (unop x) (unop y) = dist x y

{α : Type u_1}
[PseudoMetricSpace α]
(x y : αᵐᵒᵖ)

dist (MulOpposite.unop x) (MulOpposite.unop y) = dist x y


@[simp, norm_cast]
theorem coe_sup : ↑(a ⊔ b) = (a ⊔ b : ℕ)


protected theorem mul_nonpos_of_nonpos_of_nonneg {a b : Int}
  (ha : a ≤ 0) (hb : 0 ≤ b) : a * b ≤ 0


/-- **Maximum modulus principle** on a connected set. Let `U` be a (pre)connected open set in a
complex normed space.  Let `f : E → F` be a function that is complex differentiable on `U`. Suppose
that `‖f x‖` takes its maximum value on `U` at `c ∈ U`. Then `f x = f c` for all `x ∈ U`.

TODO: change assumption from `IsMaxOn` to `IsLocalMax`. -/
theorem eqOn_of_isPreconnected_of_isMaxOn_norm [StrictConvexSpace ℝ F] {f : M → F} {U : Set M}
    {c : M} (hd : MDifferentiableOn I 𝓘(ℂ, F) f U) (hc : IsPreconnected U) (ho : IsOpen U)
    (hcU : c ∈ U) (hm : IsMaxOn (norm ∘ f) U c) : EqOn f (const M (f c)) U

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace ℂ F]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners ℂ E H}
[I.Boundaryless]
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
[StrictConvexSpace ℝ F]
{f : M → F}
{U : Set M}
{c : M}
(hd : MDifferentiableOn I 𝓘(ℂ, F) f U)
(hc : IsPreconnected U)
(ho : IsOpen U)
(hcU : c ∈ U)
(hm : IsMaxOn (norm ∘ f) U c)


@[simp]
theorem map_map (g : β → δ) (f : α → β) (s : Stream' α) : map g (map f s) = map (g ∘ f) s

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

Stream'.map g (Stream'.map f s) = Stream'.map (g ∘ f) s


@[simp]
theorem Complex.orthonormalBasisOneI_repr_symm_apply (x : EuclideanSpace ℝ (Fin 2)) :
    Complex.orthonormalBasisOneI.repr.symm x = x 0 + x 1 * I

Complex.orthonormalBasisOneI.repr.symm x = ↑(x 0) + ↑(x 1) * Complex.I


@[to_additive norm_le_of_mem_closedBall]
theorem norm_le_of_mem_closedBall' (h : b ∈ closedBall a r) : ‖b‖ ≤ ‖a‖ + r

{E : Type u_6}
[SeminormedAddGroup E]
{a b : E}
{r : ℝ}
(h : b ∈ Metric.closedBall a r)

‖b‖ ≤ ‖a‖ + r


lemma ext₁ {F G : ComposableArrows C 1}
    (left : F.left = G.left) (right : F.right = G.right)
    (w : F.hom = eqToHom left ≫ G.hom ≫ eqToHom right.symm) : F = G

{F G : CategoryTheory.ComposableArrows C 1}

(w :
  F.hom =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom left)
      (CategoryTheory.CategoryStruct.comp G.hom (CategoryTheory.eqToHom ⋯)))


@[to_additive (attr := simp)]
theorem zero_apply (x : E) : (0 : GroupSeminorm E) x = 0


/-- The functor `ShortComplex C ⥤ ShortComplex D` induced by a functor `C ⥤ D` which
preserves zero morphisms. -/
@[simps]
def _root_.CategoryTheory.Functor.mapShortComplex (F : C ⥤ D) [F.PreservesZeroMorphisms] :
    ShortComplex C ⥤ ShortComplex D


theorem eq_iff_eq (x : K) (r : ℝ) : (∀ w : InfinitePlace K, w x = r) ↔ ∀ φ : K →+* ℂ, ‖φ x‖ = r

{K : Type u_2}
[Field K]
(x : K)
(r : ℝ)

(∀ (w : NumberField.InfinitePlace K), w x = r) ↔ ∀ (φ : K →+* ℂ), ‖φ x‖ = r


theorem isOpen_iff_ultrafilter :
    IsOpen s ↔ ∀ x ∈ s, ∀ (l : Ultrafilter X), ↑l ≤ 𝓝 x → s ∈ l

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


@[simp]
theorem refl_toBialgHom : refl R A = BialgHom.id R A

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

↑(BialgEquiv.refl R A) = BialgHom.id R A


/-- `TrivSqZeroExt.inr` as a continuous linear map. -/
@[simps]
def inrCLM [CommSemiring R] [AddCommMonoid M] [Module R M] : M →L[R] tsze R M

(R : Type u_3)
(M : Type u_4)
[TopologicalSpace R]
[TopologicalSpace M]
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(m : M)

(TrivSqZeroExt.inrCLM R M) m = TrivSqZeroExt.inr m


theorem isTopologicalBasis_pi {ι : Type*} {X : ι → Type*} [∀ i, TopologicalSpace (X i)]
    {T : ∀ i, Set (Set (X i))} (cond : ∀ i, IsTopologicalBasis (T i)) :
    IsTopologicalBasis { S | ∃ (U : ∀ i, Set (X i)) (F : Finset ι),
      (∀ i, i ∈ F → U i ∈ T i) ∧ S = (F : Set ι).pi U }

(cond : ∀ (i : ι), TopologicalSpace.IsTopologicalBasis (T i))

TopologicalSpace.IsTopologicalBasis {S | ∃ U F, (∀ i ∈ F, U i ∈ T i) ∧ S = (↑F).pi U}


@[to_additive (attr := simp)]
theorem mul_nonempty : (s * t).Nonempty ↔ s.Nonempty ∧ t.Nonempty

(s + t).Nonempty ↔ s.Nonempty ∧ t.Nonempty


@[simp]
theorem arsinh_nonpos_iff : arsinh x ≤ 0 ↔ x ≤ 0


@[simp]
theorem IsInternal.collectedBasis_coe (h : IsInternal A) {α : ι → Type*}
    (v : ∀ i, Basis (α i) R (A i)) : ⇑(h.collectedBasis v) = fun a : Σi, α i ↦ ↑(v a.1 a.2)

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

⇑(h.collectedBasis v) = fun a => ↑((v a.fst) a.snd)


@[to_additive]
theorem Red.Step.invRev {L₁ L₂ : List (α × Bool)} (h : Red.Step L₁ L₂) :
    Red.Step (FreeGroup.invRev L₁) (FreeGroup.invRev L₂)

{α : Type u}
{L₁ L₂ : List (α × Bool)}
(h : FreeGroup.Red.Step L₁ L₂)

FreeGroup.Red.Step (FreeGroup.invRev L₁) (FreeGroup.invRev L₂)


@[simp]
theorem symm_mulLeft₀ {g : G₀} (hg : g ≠ 0) :
    (mulLeft₀ g hg).symm = mulLeft₀ g⁻¹ (inv_ne_zero hg)

{G₀ : Type u_2}
[MeasurableSpace G₀]
[GroupWithZero G₀]
[MeasurableMul G₀]
{g : G₀}
(hg : g ≠ 0)

(MeasurableEquiv.mulLeft₀ g hg).symm = MeasurableEquiv.mulLeft₀ g⁻¹ ⋯


/-- Convergence in the compact-open topology is the same as uniform convergence for sequences of
continuous functions on a compact space. -/
theorem tendsto_iff_tendstoUniformly :
    Tendsto F p (𝓝 f) ↔ TendstoUniformly (fun i a => F i a) f p

{α : Type u₁}
{β : Type u₂}
[TopologicalSpace α]
[UniformSpace β]
{f : C(α, β)}
{ι : Type u₃}
{p : Filter ι}
{F : ι → C(α, β)}
[CompactSpace α]

Filter.Tendsto F p (𝓝 f) ↔ TendstoUniformly (fun i a => (F i) a) (⇑f) p


@[to_additive existing (attr := simp) (reorder := 6 7) smul_fst]
lemma pow_fst (p : α × β) (c : E) : (p ^ c).fst = p.fst ^ c

{E : Type u_4}
{α : Type u_5}
{β : Type u_6}
[Pow α E]
[Pow β E]
(p : α × β)
(c : E)


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

{G : Type u_1}
[Group G]
[TopologicalSpace G]
{U V : OpenSubgroup G}


@[to_additive]
lemma units_surjective : Function.Surjective (units (M := M))


/--
The contravariant functor turning comonoid objects into monoid objects in the opposite category.
-/
@[simps] def Comon_ToMon_OpOp : Comon_ C ⥤ (Mon_ (Cᵒᵖ))ᵒᵖ

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

∀ {X Y : Comon_ C} (f : X ⟶ Y),
  (Comon_.Comon_ToMon_OpOp C).map f = Opposite.op { hom := f.hom.op, one_hom := ⋯, mul_hom := ⋯ }


theorem HasRightInverse.surjective {f : α → β} : HasRightInverse f → Surjective f

Function.HasRightInverse f → Function.Surjective f


@[to_additive]
protected theorem Inducing.hasProd_iff [CommMonoid γ] [TopologicalSpace γ] {G}
    [FunLike G α γ] [MonoidHomClass G α γ] {g : G} (hg : Inducing g) (f : β → α) (a : α) :
    HasProd (g ∘ f) (g a) ↔ HasProd f a

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[AddCommMonoid α]
[TopologicalSpace α]
[AddCommMonoid γ]
[TopologicalSpace γ]
{G : Type u_5}
[FunLike G α γ]
[AddMonoidHomClass G α γ]
{g : G}
(hg : Inducing ⇑g)
(f : β → α)
(a : α)


/-- Part c of the **L¹ martingale convergence theorem**: Given an integrable function `g` which
is measurable with respect to `⨆ n, ℱ n` where `ℱ` is a filtration, the martingale defined by
`𝔼[g | ℱ n]` converges in L¹ to `g`.

This martingale also converges to `g` almost everywhere and this result is provided by
`MeasureTheory.Integrable.tendsto_ae_condexp` -/
theorem Integrable.tendsto_eLpNorm_condexp (hg : Integrable g μ)
    (hgmeas : StronglyMeasurable[⨆ n, ℱ n] g) :
    Tendsto (fun n => eLpNorm (μ[g|ℱ n] - g) 1 μ) atTop (𝓝 0)

(hgmeas : MeasureTheory.StronglyMeasurable g)

Filter.Tendsto (fun n => MeasureTheory.eLpNorm (μ[g|↑ℱ n] - g) 1 μ) Filter.atTop (𝓝 0)


@[to_additive]
theorem finprod_eq_single (f : α → M) (a : α) (ha : ∀ x, x ≠ a → f x = 1) :
    ∏ᶠ x, f x = f a

{M : Type u_2}
{α : Sort u_4}
[AddCommMonoid M]
(f : α → M)
(a : α)
(ha : ∀ (x : α), x ≠ a → f x = 0)


theorem map_inf {f g : Filter α} {m : α → β} (h : Injective m) :
    map m (f ⊓ g) = map m f ⊓ map m g

{α : Type u}
{β : Type v}
{f g : Filter α}
{m : α → β}
(h : Function.Injective m)

Filter.map m (f ⊓ g) = Filter.map m f ⊓ Filter.map m g


theorem algebraBase_injective : Function.Injective <| algebraMap A (CyclotomicRing n A K)

(n : ℕ+)
(A : Type u)
(K : Type w)
[CommRing A]
[Field K]
[Algebra A K]
[IsFractionRing A K]

Function.Injective ⇑(algebraMap A (CyclotomicRing n A K))


theorem pred_lt_pred_iff : pred a < pred b ↔ a < b

{α : Type u_1}
[Preorder α]
[PredOrder α]
{a b : α}
[NoMinOrder α]


/-- Intermediate stage of assembling the unit. -/
@[simps!]
def unitAuxAux {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) :
    yonedaCollectionPresheaf A (restrictedYonedaObj η) ≅ F

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

∀ (a : F.obj X),
  ↑((CategoryTheory.OverPresheafAux.unitAuxAux η).inv.app X a).snd =
    CategoryTheory.OverPresheafAux.OverArrows.val ⟨a, ⋯⟩


lemma Scheme.restrict_toPresheafedSpace :
    (X.restrict h).toPresheafedSpace = X.toPresheafedSpace.restrict h

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

(X.restrict h).toPresheafedSpace = X.restrict h


theorem C_eq_smul_one : (C a : MvPolynomial σ R) = a • (1 : MvPolynomial σ R)

{R : Type u}
{σ : Type u_1}
{a : R}
[CommSemiring R]


/-- Given a language with a nonempty type of constants, any structure will be nonempty. This cannot
  be a global instance, because `L` becomes a metavariable. -/
theorem nonempty_of_nonempty_constants [h : Nonempty L.Constants] : Nonempty M

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
[h : Nonempty L.Constants]


/-- A well order `r` is order isomorphic to the set of ordinals smaller than `type r`. -/
@[simps]
def enumIso (r : α → α → Prop) [IsWellOrder α r] : Subrel (· < ·) (· < type r) ≃r r

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

↑((Ordinal.enumIso r).symm x) = Ordinal.typein r x


/-- `LinearEquiv.prodComm` is isometric. -/
@[simps!]
def IsometryEquiv.prodComm (Q₁ : QuadraticMap R M₁ P) (Q₂ : QuadraticMap R M₂ P) :
    (Q₁.prod Q₂).IsometryEquiv (Q₂.prod Q₁)

{R : Type u_2}
{M₁ : Type u_3}
{M₂ : Type u_4}
{P : Type u_7}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid P]
[Module R M₁]
[Module R M₂]
[Module R P]
(Q₁ : QuadraticMap R M₁ P)
(Q₂ : QuadraticMap R M₂ P)

∀ (a : M₁ × M₂), (QuadraticMap.IsometryEquiv.prodComm Q₁ Q₂) a = a.swap


theorem integral_of_le (h : a ≤ b) : ∫ x in a..b, f x ∂μ = ∫ x in Ioc a b, f x ∂μ

{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{a b : ℝ}
{f : ℝ → E}
{μ : MeasureTheory.Measure ℝ}
(h : a ≤ b)

∫ (x : ℝ) in a..b, f x ∂μ = ∫ (x : ℝ) in Set.Ioc a b, f x ∂μ


lemma continuous_iff_convergent {Y : Type*} [TopologicalSpace Y] (f : ℕ∪{∞} → Y) :
    Continuous f ↔ Tendsto (fun x : ℕ ↦ f x) atTop (𝓝 (f ∞))

(f : ↑LightProfinite.NatUnionInfty.toTop → Y)

Continuous f ↔ Filter.Tendsto (fun x => f (some x)) Filter.atTop (nhds (f ∞))


/-- If `e : C ≌ D` is an equivalence of categories, and `iso : e.functor ≅ G` is
an isomorphism, then there is an equivalence of categories whose functor is `G`. -/
@[simps!]
def changeFunctor (e : C ≌ D) {G : C ⥤ D} (iso : e.functor ≅ G) : C ≌ D

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

(e.changeFunctor iso).unitIso.inv.app X =
  CategoryTheory.CategoryStruct.comp (e.inverse.map (iso.inv.app X)) (e.unitIso.inv.app X)


@[to_additive (attr := simp)]
theorem norm_inv_eq {x : FreeGroup α} : norm x⁻¹ = norm x

{α : Type u}
[DecidableEq α]
{x : FreeAddGroup α}


/-- The sum of a converging power series is continuous in its disk of convergence. -/
protected theorem FormalMultilinearSeries.continuousOn [CompleteSpace F] :
    ContinuousOn p.sum (EMetric.ball 0 p.radius)

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


theorem IntegrableOn.mono (h : IntegrableOn f t ν) (hs : s ⊆ t) (hμ : μ ≤ ν) : IntegrableOn f s μ

{α : Type u_1}
{E : Type u_3}
[MeasurableSpace α]
[NormedAddCommGroup E]
{f : α → E}
{s t : Set α}
{μ ν : MeasureTheory.Measure α}
(h : MeasureTheory.IntegrableOn f t ν)
(hs : s ⊆ t)
(hμ : μ ≤ ν)


/-- If `f` is `C^n` then its `m`-times iterated derivative is continuous for `m ≤ n`. -/
theorem ContDiff.continuous_iteratedFDeriv {m : ℕ} (hm : (m : ℕ∞) ≤ n) (hf : ContDiff 𝕜 n f) :
    Continuous fun x => iteratedFDeriv 𝕜 m f x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{n : ℕ∞}
{m : ℕ}
(hm : ↑m ≤ n)
(hf : ContDiff 𝕜 n f)


protected theorem localRing {A B : Type*} [CommSemiring A] [LocalRing A] [CommSemiring B]
    (e : A ≃+* B) : LocalRing B

{A : Type u_4}
{B : Type u_5}
[CommSemiring A]
[LocalRing A]
[CommSemiring B]
(e : A ≃+* B)


/-- A multiplicative morphism between monoids gives a monoidal functor between the corresponding
discrete monoidal categories.
-/
@[to_additive (attr := simps) Discrete.addMonoidalFunctor]
def Discrete.monoidalFunctor (F : M →* N) : MonoidalFunctor (Discrete M) (Discrete N)

{M : Type u}
[AddMonoid M]
{N : Type u'}
[AddMonoid N]
(F : M →+ N)

∀ {X Y : CategoryTheory.Discrete M} (f : X ⟶ Y),
  (CategoryTheory.Discrete.addMonoidalFunctor F).map f = CategoryTheory.Discrete.eqToHom ⋯


theorem gauge_lt_one_eq_self_of_isOpen (hs₁ : Convex ℝ s) (hs₀ : (0 : E) ∈ s) (hs₂ : IsOpen s) :
    { x | gauge s x < 1 } = s

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
[TopologicalSpace E]
[ContinuousSMul ℝ E]
(hs₁ : Convex ℝ s)
(hs₀ : 0 ∈ s)
(hs₂ : IsOpen s)


@[to_additive]
theorem range_mem_leftTransversals {f : G ⧸ H → G} (hf : ∀ q, ↑(f q) = q) :
    Set.range f ∈ leftTransversals (H : Set G)

{G : Type u_1}
[AddGroup G]
{H : AddSubgroup G}
{f : G ⧸ H → G}
(hf : ∀ (q : G ⧸ H), ↑(f q) = q)

Set.range f ∈ AddSubgroup.leftTransversals ↑H


theorem ContMDiff.clm_precomp {f : M → F₁ →L[𝕜] F₂} (hf : ContMDiff I 𝓘(𝕜, F₁ →L[𝕜] F₂) n f) :
    ContMDiff I 𝓘(𝕜, (F₂ →L[𝕜] F₃) →L[𝕜] (F₁ →L[𝕜] F₃)) n
      (fun y ↦ (f y).precomp F₃ : M → (F₂ →L[𝕜] F₃) →L[𝕜] (F₁ →L[𝕜] F₃))

ContMDiff I 𝓘(𝕜, (F₂ →L[𝕜] F₃) →L[𝕜] F₁ →L[𝕜] F₃) n fun y => ContinuousLinearMap.precomp F₃ (f y)


theorem hasDerivAt_iff_tendsto_slope : HasDerivAt f f' x ↔ Tendsto (slope f x) (𝓝[≠] x) (𝓝 f')

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

HasDerivAt f f' x ↔ Filter.Tendsto (slope f x) (𝓝[≠] x) (𝓝 f')


@[simp]
theorem coe_mul : ↑ₘ(A * B) = ↑ₘA * ↑ₘB

{n : Type u}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
(A B : Matrix.SpecialLinearGroup n R)


theorem HasSum.div_const (h : HasSum f a) (b : α) : HasSum (fun i ↦ f i / b) (a / b)

{ι : Type u_1}
{α : Type u_4}
[DivisionSemiring α]
[TopologicalSpace α]
[TopologicalSemiring α]
{f : ι → α}
{a : α}
(h : HasSum f a)
(b : α)


@[simp]
theorem supported_empty : supported M R (∅ : Set α) = ⊥

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


theorem ofReal_injective : Function.Injective ((↑) : ℝ → ℂ)


@[simp, nontriviality]
theorem opNorm_subsingleton [Subsingleton E] : ‖f‖ = 0

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[RingHomIsometric σ₁₂]
(f : E →SL[σ₁₂] F)
[Subsingleton E]


/-- The normalized Moore complex functor, on morphisms.
-/
@[simps!]
def map (f : X ⟶ Y) : obj X ⟶ obj Y

{X Y : CategoryTheory.SimplicialObject C}

(AlgebraicTopology.NormalizedMooreComplex.map f).f n =
  (AlgebraicTopology.NormalizedMooreComplex.objX Y n).factorThru
    ((AlgebraicTopology.NormalizedMooreComplex.objX X n).arrow ≫ f.app (Opposite.op (SimplexCategory.mk n))) ⋯


theorem isBigO_cofinite_iff (h : ∀ x, g'' x = 0 → f'' x = 0) :
    f'' =O[cofinite] g'' ↔ ∃ C, ∀ x, ‖f'' x‖ ≤ C * ‖g'' x‖

{α : Type u_1}
{E'' : Type u_9}
{F'' : Type u_10}
[NormedAddCommGroup E'']
[NormedAddCommGroup F'']
{f'' : α → E''}
{g'' : α → F''}
(h : ∀ (x : α), g'' x = 0 → f'' x = 0)

f'' =O[Filter.cofinite] g'' ↔ ∃ C, ∀ (x : α), ‖f'' x‖ ≤ C * ‖g'' x‖


{α : Type u_1}
[Ring α]
[LinearOrder α]
(a : α)


theorem HasLines.lineCount_eq_pointCount [HasLines P L] [Fintype P] [Fintype L]
    (hPL : Fintype.card P = Fintype.card L) {p : P} {l : L} (hpl : p ∉ l) :
    lineCount L p = pointCount P l

{P : Type u_1}
{L : Type u_2}
[Membership P L]
[Configuration.HasLines P L]
[Fintype P]
[Fintype L]
(hPL : Fintype.card P = Fintype.card L)
{p : P}
{l : L}
(hpl : p ∉ l)

Configuration.lineCount L p = Configuration.pointCount P l


@[simp]
theorem sSup_eq_bot : sSup s = ⊥ ↔ ∀ a ∈ s, a = ⊥

{α : Type u_1}
[CompleteLattice α]
{s : Set α}


/-- If `f` is an injective linear map, then the family `f ∘ v` is linearly independent
if and only if the family `v` is linearly independent. -/
protected theorem LinearMap.linearIndependent_iff (f : M →ₗ[R] M') (hf_inj : LinearMap.ker f = ⊥) :
    LinearIndependent R (f ∘ v) ↔ LinearIndependent R v

{ι : Type u'}
{R : Type u_2}
{M : Type u_4}
{M' : Type u_5}
{v : ι → M}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M']
[Module R M]
[Module R M']
(f : M →ₗ[R] M')
(hf_inj : LinearMap.ker f = ⊥)

LinearIndependent R (⇑f ∘ v) ↔ LinearIndependent R v


/-- The piecewise multiplication from the `Mul` instance, as a bundled homomorphism. -/
@[simps]
def gsmulHom [GMonoid A] [Gmodule A M] {i j} : A i →+ M j →+ M (i +ᵥ j)

{ιA : Type u_1}
{ιB : Type u_2}
(A : ιA → Type u_3)
(M : ιB → Type u_4)
[AddMonoid ιA]
[VAdd ιA ιB]
[(i : ιA) → AddCommMonoid (A i)]
[(i : ιB) → AddCommMonoid (M i)]
[GradedMonoid.GMonoid A]
[DirectSum.Gmodule A M]
{i : ιA}
{j : ιB}
(a : A i)
(b : M j)

((DirectSum.gsmulHom A M) a) b = GradedMonoid.GSMul.smul a b


theorem derivative_X_sub_C (c : R) : derivative (X - C c) = 1

Polynomial.derivative (Polynomial.X - Polynomial.C c) = 1


theorem eventually_of_mem {f : Filter α} {P : α → Prop} {U : Set α} (hU : U ∈ f)
    (h : ∀ x ∈ U, P x) : ∀ᶠ x in f, P x

{α : Type u}
{f : Filter α}
{P : α → Prop}
{U : Set α}
(hU : U ∈ f)
(h : ∀ x ∈ U, P x)


@[simp] lemma map_eq_zero_iff (hf : AEMeasurable f μ) : μ.map f = 0 ↔ μ = 0

{α : Type u_1}
{β : Type u_2}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{f : α → β}
(hf : AEMeasurable f μ)

MeasureTheory.Measure.map f μ = 0 ↔ μ = 0


theorem rpow_le_rpow_iff {x y : ℝ≥0∞} {z : ℝ} (hz : 0 < z) : x ^ z ≤ y ^ z ↔ x ≤ y


theorem EqOn.congr_monotoneOn (h : s.EqOn f₁ f₂) : MonotoneOn f₁ s ↔ MonotoneOn f₂ s

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{f₁ f₂ : α → β}
[Preorder α]
[Preorder β]
(h : Set.EqOn f₁ f₂ s)


theorem Perm.pairwise {R : α → α → Prop} {l l' : List α} (hl : l ~ l') (hR : l.Pairwise R)
    (hsymm : ∀ {x y}, R x y → R y x) : l'.Pairwise R

{α : Type u_1}
{R : α → α → Prop}
{l l' : List α}
(hl : l ~ l')
(hR : List.Pairwise R l)
(hsymm : ∀ {x y : α}, R x y → R y x)


theorem neg_right : Commute a b → Commute a (-b)

{R : Type x}
[Mul R]
[HasDistribNeg R]
{a b : R}


/--
The `Fin.val_zero` in `Lean` only applies in `Fin (n+1)`.
This one instead uses a `NeZero n` typeclass hypothesis.
-/
@[simp]
theorem val_zero' (n : ℕ) [NeZero n] : ((0 : Fin n) : ℕ) = 0


/-- An oriented angle is unchanged by replacing the third point by one strictly further away on
the same ray. -/
theorem _root_.Sbtw.oangle_eq_right {p₁ p₂ p₃ p₃' : P} (h : Sbtw ℝ p₂ p₃ p₃') :
    ∡ p₁ p₂ p₃ = ∡ p₁ p₂ p₃'

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

∡ p₁ p₂ p₃ = ∡ p₁ p₂ p₃'


@[simp]
theorem liftAux_self_apply [PerfectRing L p] (x : L) : liftAux i i p x = x

{K : Type u_1}
{L : Type u_2}
[CommSemiring K]
[CommSemiring L]
(i : K →+* L)
(p : ℕ)
[ExpChar L p]
[IsPRadical i p]
[PerfectRing L p]
(x : L)


@[simp]
theorem coe_sup (I J : HomogeneousIdeal 𝒜) : ↑(I ⊔ J) = (I + J : Set A)

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


/-- A structure designed to hold the hypotheses for the Mellin-functional-equation argument
(version without constant terms) -/
structure StrongFEPair extends WeakFEPair E where (hf₀ : f₀ = 0) (hg₀ : g₀ = 0)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(self : StrongFEPair E)


theorem continuous_of_linear_of_boundₛₗ {f : E → F} (h_add : ∀ x y, f (x + y) = f x + f y)
    (h_smul : ∀ (c : 𝕜) (x), f (c • x) = σ c • f x) {C : ℝ} (h_bound : ∀ x, ‖f x‖ ≤ C * ‖x‖) :
    Continuous f

{σ : 𝕜 →+* 𝕜₂}

(h_add : ∀ (x y : E), f (x + y) = f x + f y)

(h_smul : ∀ (c : 𝕜) (x : E), f (c • x) = σ c • f x)


@[simp]
theorem dist_mk (x₁ y₁ x₂ y₂ : ℝ) :
    dist (mk x₁ y₁) (mk x₂ y₂) = √((x₁ - x₂) ^ 2 + (y₁ - y₂) ^ 2)

dist { re := x₁, im := y₁ } { re := x₂, im := y₂ } = √((x₁ - x₂) ^ 2 + (y₁ - y₂) ^ 2)


@[ext]
theorem ext {S T : StarSubalgebra R A} (h : ∀ x : A, x ∈ S ↔ x ∈ T) : S = T

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[StarRing A]
[Algebra R A]
[StarModule R A]
{S T : StarSubalgebra R A}
(h : ∀ (x : A), x ∈ S ↔ x ∈ T)


@[simp]
theorem span_one : span (1 : Set α) = ⊤


@[reassoc (attr := simp)]
theorem lift_comp_kernelIsoOfEq_hom {Z} {f g : X ⟶ Y} [HasKernel f] [HasKernel g] (h : f = g)
    (e : Z ⟶ X) (he) :
    kernel.lift _ e he ≫ (kernelIsoOfEq h).hom = kernel.lift _ e (by simp [← h, he])

CategoryTheory.Limits.kernel.lift f e he ≫ (CategoryTheory.Limits.kernelIsoOfEq h).hom =
  CategoryTheory.Limits.kernel.lift g e ⋯


theorem toMultiset_add (m n : α →₀ ℕ) : toMultiset (m + n) = toMultiset m + toMultiset n

Finsupp.toMultiset (m + n) = Finsupp.toMultiset m + Finsupp.toMultiset n


theorem map_rootsOfUnity_eq_pow_self [FunLike F R R] [RingHomClass F R R] (σ : F)
    (ζ : rootsOfUnity k R) :
    ∃ m : ℕ, σ (ζ : Rˣ) = ((ζ : Rˣ) : R) ^ m

{R : Type u_4}
{F : Type u_6}
{k : ℕ+}
[CommRing R]
[IsDomain R]
[FunLike F R R]
[RingHomClass F R R]
(σ : F)
(ζ : ↥(rootsOfUnity k R))

∃ m, σ ↑↑ζ = ↑↑ζ ^ m


theorem IntegrableAtFilter.sup_iff {l l' : Filter α} :
    IntegrableAtFilter f (l ⊔ l') μ ↔ IntegrableAtFilter f l μ ∧ IntegrableAtFilter f l' μ

{α : Type u_1}
{E : Type u_3}
[MeasurableSpace α]
[NormedAddCommGroup E]
{f : α → E}
{μ : MeasureTheory.Measure α}
{l l' : Filter α}

MeasureTheory.IntegrableAtFilter f (l ⊔ l') μ ↔
  MeasureTheory.IntegrableAtFilter f l μ ∧ MeasureTheory.IntegrableAtFilter f l' μ


/-- The edge of `Λ[n, i]` with endpoints `a` and `b`.

This edge only exists if `{i, a, b}` has cardinality less than `n`. -/
@[simps]
def edge (n : ℕ) (i a b : Fin (n+1)) (hab : a ≤ b) (H : Finset.card {i, a, b} ≤ n) :
    Λ[n, i] _[1]

(n : ℕ)
(i a b : Fin (n + 1))
(hab : a ≤ b)
(H : {i, a, b}.card ≤ n)

↑(SSet.horn.edge n i a b hab H) = SSet.standardSimplex.edge n a b hab


@[simp]
protected theorem id_val (x : ActionCategory M X) : Subtype.val (𝟙 x) = 1

{M : Type u_1}
[Monoid M]
{X : Type u}
[MulAction M X]
(x : CategoryTheory.ActionCategory M X)

↑(CategoryTheory.CategoryStruct.id x) = 1


@[simp]
theorem comp_zero [HasZeroMorphisms C] {X Y : C} {f : X ⟶ Y} {Z : C} :
    f ≫ (0 : Y ⟶ Z) = (0 : X ⟶ Z)


theorem ne_comm {α} {a b : α} : a ≠ b ↔ b ≠ a


theorem second_iso_of_eq {x y a b : X} (hm : IsMaximal x a) (ha : x ⊔ y = a) (hb : x ⊓ y = b) :
    Iso (x, a) (b, y)

(hm : JordanHolderLattice.IsMaximal x a)


theorem evalWhiskerLeft_id {f g : C} {η : f ⟶ g}
    {η' : f ⟶ 𝟙_ C ⊗ g} {η'' : 𝟙_ C ⊗ f ⟶ 𝟙_ C ⊗ g}
    (pf_η' : η ≫ (λ_ _).inv = η') (pf_η'' : (λ_ _).hom ≫ η' = η'') :
    𝟙_ C ◁ η = η''

{η' : f ⟶ CategoryTheory.MonoidalCategory.tensorObj (𝟙_ C) g}

{η'' : CategoryTheory.MonoidalCategory.tensorObj (𝟙_ C) f ⟶ CategoryTheory.MonoidalCategory.tensorObj (𝟙_ C) g}

(pf_η' : CategoryTheory.CategoryStruct.comp η (CategoryTheory.MonoidalCategory.leftUnitor g).inv = η')

(pf_η'' : CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.leftUnitor f).hom η' = η'')

CategoryTheory.MonoidalCategory.whiskerLeft (𝟙_ C) η = η''


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

{α : Type u_3}
{β : Type u_4}
[Sup α]
[Sup β]
(f : SupHom α β)
(f' : α → β)
(h : f' = ⇑f)


/-- Take the "unopposite" of a functor is functorial.
-/
@[simps]
def opInv : (Cᵒᵖ ⥤ Dᵒᵖ) ⥤ (C ⥤ D)ᵒᵖ

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

(CategoryTheory.Functor.opInv C D).obj F = Opposite.op F.unop


/-- Replacing a set by its closure does not change the Hausdorff edistance. -/
@[simp]
theorem hausdorffEdist_closure₂ : hausdorffEdist s (closure t) = hausdorffEdist s t

{α : Type u}
[PseudoEMetricSpace α]
{s t : Set α}

EMetric.hausdorffEdist s (closure t) = EMetric.hausdorffEdist s t


@[simp]
theorem preimage_const_sub_Iio : (fun x => a - x) ⁻¹' Iio b = Ioi (a - b)

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

(fun x => a - x) ⁻¹' Set.Iio b = Set.Ioi (a - b)


@[simp] theorem map_cons (f : α → β) a l : map f (a :: l) = f a :: map f l

{α : Type u}
{β : Type v}
(f : α → β)
(a : α)
(l : List α)

List.map f (a :: l) = f a :: List.map f l


@[to_additive (attr := measurability)]
theorem Measurable.mul_const [MeasurableMul M] (hf : Measurable f) (c : M) :
    Measurable fun x => f x * c

{M : Type u_2}
{α : Type u_3}
[MeasurableSpace M]
[Mul M]
{m : MeasurableSpace α}
{f : α → M}
[MeasurableMul M]
(hf : Measurable f)
(c : M)


theorem support_C_mul_T (a : R) (n : ℤ) : Finsupp.support (C a * T n) ⊆ {n}

{R : Type u_1}
[Semiring R]
(a : R)
(n : ℤ)

(LaurentPolynomial.C a * LaurentPolynomial.T n).support ⊆ {n}


/-- The pullback functor `Sheaf J A ⥤ Sheaf K A` associated to a functor `G : C ⥤ D` in the
same direction as `G`. -/
@[simps!]
def Functor.sheafPullback : Sheaf J A ⥤ Sheaf K A

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

(G.sheafPullback A J K).obj X = (CategoryTheory.presheafToSheaf K A).obj (G.op.lan.obj X.val)


/-- Let `l'` be a measurably generated filter; let `l` be a of filter such that each `s ∈ l'`
eventually includes `Ioc u v` as both `u` and `v` tend to `l`. Let `μ` be a measure finite at `l'`.

Suppose that `f : ℝ → E` has a finite limit at `l`. Then `f` is interval integrable on `u..v`
provided that both `u` and `v` tend to `l`.

Typeclass instances allow Lean to find `l'` based on `l` but not vice versa, so
`apply Tendsto.eventually_intervalIntegrable` will generate goals `Filter ℝ` and
`TendstoIxxClass Ioc ?m_1 l'`. -/
theorem Filter.Tendsto.eventually_intervalIntegrable {f : ℝ → E} {μ : Measure ℝ} {l l' : Filter ℝ}
    (hfm : StronglyMeasurableAtFilter f l' μ) [TendstoIxxClass Ioc l l'] [IsMeasurablyGenerated l']
    (hμ : μ.FiniteAtFilter l') {c : E} (hf : Tendsto f l' (𝓝 c)) {u v : ι → ℝ} {lt : Filter ι}
    (hu : Tendsto u lt l) (hv : Tendsto v lt l) : ∀ᶠ t in lt, IntervalIntegrable f μ (u t) (v t)

∀ᶠ (t : ι) in lt, IntervalIntegrable f μ (u t) (v t)


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

{α : Type u_2}
{β : Type u_3}
[SupSet α]
[SupSet β]
{f g : sSupHom α β}
(h : ∀ (a : α), f a = g a)


@[reassoc (attr := simp)]
theorem biproduct.ι_toSubtype [DecidablePred p] (j : J) :
    biproduct.ι f j ≫ biproduct.toSubtype f p =
      if h : p j then biproduct.ι (Subtype.restrict p f) ⟨j, h⟩ else 0

[CategoryTheory.Limits.HasBiproduct (Subtype.restrict p f)]

CategoryTheory.Limits.biproduct.ι f j ≫ CategoryTheory.Limits.biproduct.toSubtype f p =
  if h : p j then CategoryTheory.Limits.biproduct.ι (Subtype.restrict p f) ⟨j, h⟩ else 0


theorem eq_zero_of_coe_mem_of_disjoint (hpq : Disjoint p q) {a : p} (ha : (a : M) ∈ q) : a = 0

{R : Type u_1}
{M : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{p q : Submodule R M}
(hpq : Disjoint p q)
{a : ↥p}
(ha : ↑a ∈ q)


nonrec theorem algEquiv_mk' (x : R) (y : M) : algEquiv M S (mk' (Localization M) x y) = mk' S x y

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
(S : Type u_2)
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
(x : R)
(y : ↥M)

(Localization.algEquiv M S) (IsLocalization.mk' (Localization M) x y) = IsLocalization.mk' S x y


@[reassoc (attr := simp)]
theorem eqToHom_map_comp (F : C ⥤ D) {X Y Z : C} (p : X = Y) (q : Y = Z) :
    F.map (eqToHom p) ≫ F.map (eqToHom q) = F.map (eqToHom <| p.trans q)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : CategoryTheory.Functor C D)
{X Y Z : C}
(p : X = Y)
(q : Y = Z)

CategoryTheory.CategoryStruct.comp (F.map (CategoryTheory.eqToHom p)) (F.map (CategoryTheory.eqToHom q)) =
  F.map (CategoryTheory.eqToHom ⋯)


/-- If `F` has odd characteristic, then for nonzero `a : F`, we have that `a ^ (#F / 2) = ±1`. -/
theorem pow_dichotomy (hF : ringChar F ≠ 2) {a : F} (ha : a ≠ 0) :
    a ^ (Fintype.card F / 2) = 1 ∨ a ^ (Fintype.card F / 2) = -1

{F : Type u_3}
[Field F]
[Fintype F]
(hF : ringChar F ≠ 2)
{a : F}
(ha : a ≠ 0)


/-- Being cofiltered is preserved by equivalence of categories. -/
theorem of_equivalence (h : C ≌ D) : IsCofiltered D

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.IsCofiltered C]
{D : Type u₁}
[CategoryTheory.Category.{v₁, u₁} D]
(h : C ≌ D)


@[simp] theorem zipWith_nil_left {f : α → β → γ} : zipWith f [] l = []

{α : Type u}
{β : Type v}
{γ : Type w}
{l : List β}
{f : α → β → γ}


@[reassoc (attr := simp)]
lemma add'_comp (f₁ f₂ : L.obj X ⟶ L.obj Y) (g : L.obj Y ⟶ L.obj Z) :
    add' W f₁ f₂ ≫ g = add' W (f₁ ≫ g) (f₂ ≫ g)

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_3, u_2} D]
[CategoryTheory.Preadditive C]
{L : CategoryTheory.Functor C D}
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
[W.HasLeftCalculusOfFractions]
{X Y Z : C}
(f₁ f₂ : L.obj X ⟶ L.obj Y)
(g : L.obj Y ⟶ L.obj Z)

CategoryTheory.CategoryStruct.comp (CategoryTheory.Localization.Preadditive.add' W f₁ f₂) g =
  CategoryTheory.Localization.Preadditive.add' W (CategoryTheory.CategoryStruct.comp f₁ g)
    (CategoryTheory.CategoryStruct.comp f₂ g)


@[to_additive]
theorem NormedCommGroup.nhds_one_basis_norm_lt :
    (𝓝 (1 : E)).HasBasis (fun ε : ℝ => 0 < ε) fun ε => { y | ‖y‖ < ε }

(𝓝 0).HasBasis (fun ε => 0 < ε) fun ε => {y | ‖y‖ < ε}


/-- `LocallyConstant.congrRight` as a linear equivalence. -/
@[simps!]
def congrRightₗ (R : Type*) [Semiring R] [AddCommMonoid Y] [Module R Y]
    [AddCommMonoid Z] [Module R Z] (e : Y ≃ₗ[R] Z) :
    LocallyConstant X Y ≃ₗ[R] LocallyConstant X Z

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
{Z : Type u_6}
(R : Type u_7)
[Semiring R]
[AddCommMonoid Y]
[Module R Y]
[AddCommMonoid Z]
[Module R Z]
(e : Y ≃ₗ[R] Z)
(g : LocallyConstant X Y)

∀ (a : X), ((LocallyConstant.congrRightₗ R e) g) a = e (g a)


theorem cardQuot_apply (S : Submodule R M) : cardQuot S = Nat.card (M ⧸ S)

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
(S : Submodule R M)


@[simp]
theorem mk_X_1 : (mk X₀ X₁ X₂ d₀ d₁ s succ).X 1 = X₁

(succ : (S : CategoryTheory.ShortComplex V) → (X₄ : V) ×' (d₂ : S.X₃ ⟶ X₄) ×' S.g ≫ d₂ = 0)

(CochainComplex.mk X₀ X₁ X₂ d₀ d₁ s succ).X 1 = X₁


theorem sbtw_iff_right_ne_and_left_mem_image_Ioi {x y z : P} :
    Sbtw R x y z ↔ z ≠ y ∧ x ∈ lineMap z y '' Set.Ioi (1 : R)

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{x y z : P}

Sbtw R x y z ↔ z ≠ y ∧ x ∈ ⇑(AffineMap.lineMap z y) '' Set.Ioi 1


/-- A ring iso `α ≃+* β` can equivalently be viewed as a ring iso `αᵐᵒᵖ ≃+* βᵐᵒᵖ`. -/
@[simps! symm_apply_apply symm_apply_symm_apply apply_apply apply_symm_apply]
protected def op {α β} [Add α] [Mul α] [Add β] [Mul β] :
    α ≃+* β ≃ (αᵐᵒᵖ ≃+* βᵐᵒᵖ)

{α : Type u_7}
{β : Type u_8}
[Add α]
[Mul α]
[Add β]
[Mul β]
(f : α ≃+* β)

∀ (a : αᵐᵒᵖ), (RingEquiv.op f) a = MulOpposite.op (f (MulOpposite.unop a))


theorem isBigOWith_const_one (c : E) (l : Filter α) :
    IsBigOWith ‖c‖ l (fun _x : α => c) fun _x => (1 : F)

{α : Type u_1}
{E : Type u_3}
(F : Type u_4)
[Norm E]
[Norm F]
[One F]
[NormOneClass F]
(c : E)
(l : Filter α)

Asymptotics.IsBigOWith ‖c‖ l (fun _x => c) fun _x => 1


theorem _root_.sInfHom.le_apply_bliminf [CompleteLattice γ] (g : sInfHom α γ) :
    bliminf (g ∘ u) f p ≤ g (bliminf u f p)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[CompleteLattice α]
{f : Filter β}
{p : β → Prop}
{u : β → α}
[CompleteLattice γ]
(g : sInfHom α γ)

Filter.bliminf (⇑g ∘ u) f p ≤ g (Filter.bliminf u f p)


theorem measurePreserving_swap : MeasurePreserving Prod.swap (μ.prod ν) (ν.prod μ)

{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{ν : MeasureTheory.Measure β}
[MeasureTheory.SFinite ν]
[MeasureTheory.SFinite μ]

MeasureTheory.MeasurePreserving Prod.swap (μ.prod ν) (ν.prod μ)


@[simp]
theorem one_coeff [Zero R] [One R] {a : Γ} :
    (1 : HahnSeries Γ R).coeff a = if a = 0 then 1 else 0

{Γ : Type u_1}
{R : Type u_3}
[Zero Γ]
[PartialOrder Γ]
[Zero R]
[One R]
{a : Γ}

HahnSeries.coeff 1 a = if a = 0 then 1 else 0


@[to_additive (attr := norm_cast)]
theorem eq_iff {a b : αˣ} : (a : α) = b ↔ a = b

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


@[simp]
theorem empty_card : Language.empty.card = 0


theorem monic_multiset_prod_of_monic (t : Multiset ι) (f : ι → R[X]) (ht : ∀ i ∈ t, Monic (f i)) :
    Monic (t.map f).prod

{R : Type u}
{ι : Type y}
[CommSemiring R]
(t : Multiset ι)
(f : ι → R[X])
(ht : ∀ i ∈ t, (f i).Monic)


@[to_additive]
theorem image_mul_left' : (a⁻¹ * ·) '' t = (a * ·) ⁻¹' t

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

(fun x => a⁻¹ * x) '' t = (fun x => a * x) ⁻¹' t


theorem preimage_rangeSplitting {f : α → β} (hf : Injective f) :
    preimage (rangeSplitting f) = image (rangeFactorization f)

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

Set.preimage (Set.rangeSplitting f) = Set.image (Set.rangeFactorization f)


theorem rpow_lt_rpow_iff {x y : ℝ≥0∞} {z : ℝ} (hz : 0 < z) : x ^ z < y ^ z ↔ x < y


@[simp]
theorem cancel_right (hf : Surjective f) : g₁.comp f = g₂.comp f ↔ g₁ = g₂

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[HeytingAlgebra α]
[HeytingAlgebra β]
[HeytingAlgebra γ]
{f : HeytingHom α β}
{g₁ g₂ : HeytingHom β γ}
(hf : Function.Surjective ⇑f)


protected lemma Antitone.iSup (hf : ∀ i, Antitone (f i)) : Antitone (⨆ i, f i)

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_9}
[Preorder α]
[CompleteLattice β]
{f : ι → α → β}
(hf : ∀ (i : ι), Antitone (f i))


/-- Derivative under integral of `x ↦ ∫ F x a` at a given point `x₀ : 𝕜`, `𝕜 = ℝ` or `𝕜 = ℂ`,
assuming `F x₀` is integrable, `x ↦ F x a` is locally Lipschitz on a ball around `x₀` for ae `a`
(with ball radius independent of `a`) with integrable Lipschitz bound, and `F x` is
ae-measurable for `x` in a possibly smaller neighborhood of `x₀`. -/
theorem hasDerivAt_integral_of_dominated_loc_of_lip {F' : α → E} (ε_pos : 0 < ε)
    (hF_meas : ∀ᶠ x in 𝓝 x₀, AEStronglyMeasurable (F x) μ) (hF_int : Integrable (F x₀) μ)
    (hF'_meas : AEStronglyMeasurable F' μ)
    (h_lipsch : ∀ᵐ a ∂μ, LipschitzOnWith (Real.nnabs <| bound a) (F · a) (ball x₀ ε))
    (bound_integrable : Integrable (bound : α → ℝ) μ)
    (h_diff : ∀ᵐ a ∂μ, HasDerivAt (F · a) (F' a) x₀) :
    Integrable F' μ ∧ HasDerivAt (fun x ↦ ∫ a, F x a ∂μ) (∫ a, F' a ∂μ) x₀

(hF_meas : ∀ᶠ (x : 𝕜) in 𝓝 x₀, MeasureTheory.AEStronglyMeasurable (F x) μ)

(hF_int : MeasureTheory.Integrable (F x₀) μ)

(hF'_meas : MeasureTheory.AEStronglyMeasurable F' μ)

(h_lipsch : ∀ᵐ (a : α) ∂μ, LipschitzOnWith (Real.nnabs (bound a)) (fun x => F x a) (Metric.ball x₀ ε))

(bound_integrable : MeasureTheory.Integrable bound μ)

(h_diff : ∀ᵐ (a : α) ∂μ, HasDerivAt (fun x => F x a) (F' a) x₀)

MeasureTheory.Integrable F' μ ∧ HasDerivAt (fun x => ∫ (a : α), F x a ∂μ) (∫ (a : α), F' a ∂μ) x₀


lemma tendsto_indicator_const_iff_tendsto_pi_pure'
    (b : β) (nhd_b : {0}ᶜ ∈ 𝓝 b) (nhd_o : {b}ᶜ ∈ 𝓝 0) :
    Tendsto (fun i ↦ (As i).indicator (fun (_ : α) ↦ b)) L (𝓝 (A.indicator (fun (_ : α) ↦ b)))
      ↔ (Tendsto As L <| Filter.pi (pure <| · ∈ A))

{α : Type u_1}
{A : Set α}
{β : Type u_2}
[Zero β]
[TopologicalSpace β]
{ι : Type u_3}
(L : Filter ι)
{As : ι → Set α}
(b : β)
(nhd_b : {0}ᶜ ∈ 𝓝 b)
(nhd_o : {b}ᶜ ∈ 𝓝 0)

Filter.Tendsto (fun i => (As i).indicator fun x => b) L (𝓝 (A.indicator fun x => b)) ↔
  Filter.Tendsto As L (Filter.pi fun x => pure (x ∈ A))


theorem frontier_ball (x : E) {r : ℝ} (hr : r ≠ 0) :
    frontier (ball x r) = sphere x r

{E : Type u_1}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
(x : E)
{r : ℝ}
(hr : r ≠ 0)

frontier (Metric.ball x r) = Metric.sphere x r


theorem conjugate_commutatorElement : g₃ * ⁅g₁, g₂⁆ * g₃⁻¹ = ⁅g₃ * g₁ * g₃⁻¹, g₃ * g₂ * g₃⁻¹⁆


@[to_additive (attr := simp)]
theorem one_mem_div_iff : (1 : α) ∈ s / t ↔ ¬Disjoint s t

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


@[simp]
lemma comp_neg [∀ (a : M), (shiftFunctor C a).Additive]
    {a b c : M} (α : ShiftedHom X Y a) (β : ShiftedHom Y Z b) (h : b + a = c) :
    α.comp (-β) h = -α.comp β h

[∀ (a : M), (CategoryTheory.shiftFunctor C a).Additive]


@[simp]
theorem card_ofFinset {p : Set α} (s : Finset α) (H : ∀ x, x ∈ s ↔ x ∈ p) :
    @Fintype.card p (ofFinset s H) = s.card

{α : Type u_1}
{p : Set α}
(s : Finset α)
(H : ∀ (x : α), x ∈ s ↔ x ∈ p)


theorem rpow_le_self_of_le_one {x : ℝ≥0} {z : ℝ} (hx : x ≤ 1) (h_one_le : 1 ≤ z) : x ^ z ≤ x


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

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

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


lemma dist_triangle_max : dist x z ≤ max (dist x y) (dist y z)

{X : Type u_1}
[PseudoMetricSpace X]
[IsUltrametricDist X]
(x y z : X)


/-- Auxiliary definition for `opEquivalence`. -/
@[simps]
def opFunctor : (HomologicalComplex V c)ᵒᵖ ⥤ HomologicalComplex Vᵒᵖ c.symm

∀ {X Y : (HomologicalComplex V c)ᵒᵖ} (f : X ⟶ Y) (i : ι),
  ((HomologicalComplex.opFunctor V c).map f).f i = (f.unop.f i).op


theorem to_isEvenlyCovered_preimage {x : X} {I : Type*} [TopologicalSpace I]
    (h : IsEvenlyCovered f x I) : IsEvenlyCovered f x (f ⁻¹' {x})

{E : Type u_1}
{X : Type u_2}
[TopologicalSpace E]
[TopologicalSpace X]
{f : E → X}
{x : X}
{I : Type u_3}
[TopologicalSpace I]
(h : IsEvenlyCovered f x I)


theorem card_le_card_of_forall_subsingleton (hs : ∀ a ∈ s, ∃ b, b ∈ t ∧ r a b)
    (ht : ∀ b ∈ t, ({ a ∈ s | r a b } : Set α).Subsingleton) : s.card ≤ t.card

(ht : ∀ b ∈ t, {a | a ∈ s ∧ r a b}.Subsingleton)


theorem mem_spanSingleton_self (x : P) : x ∈ spanSingleton S x

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


@[simp] theorem top_toReal : ∞.toReal = 0


/-- The equivalence of categories `X ≌ Y` induced by `e : X ≃o Y`. -/
@[simps]
def OrderIso.equivalence (e : X ≃o Y) : X ≌ Y

{X : Type u}
{Y : Type v}
[Preorder X]
[Preorder Y]
(e : X ≃o Y)


theorem _root_.Set.infinite_iff_exists_gt [Nonempty α] : s.Infinite ↔ ∀ a, ∃ b ∈ s, a < b

{α : Type u_2}
[LinearOrder α]
[LocallyFiniteOrderBot α]
{s : Set α}
[Nonempty α]


@[simp]
theorem whiskerLeft_eqToHom (X : C) {Y Z : C} (f : Y = Z) :
    X ◁ eqToHom f = eqToHom (congr_arg₂ tensorObj rfl f)

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

CategoryTheory.MonoidalCategory.whiskerLeft X (CategoryTheory.eqToHom f) = CategoryTheory.eqToHom ⋯


theorem map_comp
    {M'' : Type*} [AddCommGroup M''] [Module R M''] [LieRingModule L M''] {g : M' →ₗ⁅R,L⁆ M''} :
    N.map (g.comp f) = (N.map f).map g

{R : Type u}
{L : Type v}
{M : Type w}
{M' : Type w₁}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[AddCommGroup M']
[Module R M']
[LieRingModule L M']
{f : M →ₗ⁅R,L⁆ M'}
{N : LieSubmodule R L M}
{M'' : Type u_1}
[AddCommGroup M'']
[Module R M'']
[LieRingModule L M'']
{g : M' →ₗ⁅R,L⁆ M''}

LieSubmodule.map (g.comp f) N = LieSubmodule.map g (LieSubmodule.map f N)


@[to_additive (attr := simp)]
theorem unop_bot : (⊥ : Submonoid Mᵐᵒᵖ).unop = ⊥


theorem _root_.IsOpen.exists_iUnion_isClosed {U : Set α} (hU : IsOpen U) :
    ∃ F : ℕ → Set α, (∀ n, IsClosed (F n)) ∧ (∀ n, F n ⊆ U) ∧ ⋃ n, F n = U ∧ Monotone F

{α : Type u}
[PseudoEMetricSpace α]
{U : Set α}
(hU : IsOpen U)

∃ F, (∀ (n : ℕ), IsClosed (F n)) ∧ (∀ (n : ℕ), F n ⊆ U) ∧ ⋃ n, F n = U ∧ Monotone F


@[to_additive zsmul_add] lemma mul_zpow : ∀ n : ℤ, (a * b) ^ n = a ^ n * b ^ n

{α : Type u_1}
[DivisionCommMonoid α]
(a b : α)
(n : ℤ)


theorem nfpBFamily_lt_ord {o : Ordinal} {f : ∀ a < o, Ordinal → Ordinal} {c} (hc : ℵ₀ < cof c)
    (hc' : o.card < cof c) (hf : ∀ (i hi), ∀ b < c, f i hi b < c) {a} :
    a < c → nfpBFamily.{u, u} o f a < c

{f : (a : Ordinal.{u}) → a < o → Ordinal.{u} → Ordinal.{u}}

(hf : ∀ (i : Ordinal.{u}) (hi : i < o), ∀ b < c, f i hi b < c)


/-- An element `φ` of the orthogonal group of `F` can be factored as a product of reflections, and
specifically at most as many reflections as the dimension of the complement of the fixed subspace
of `φ`. -/
theorem LinearIsometryEquiv.reflections_generate_dim_aux [FiniteDimensional ℝ F] {n : ℕ}
    (φ : F ≃ₗᵢ[ℝ] F) (hn : finrank ℝ (ker (ContinuousLinearMap.id ℝ F - φ))ᗮ ≤ n) :
    ∃ l : List F, l.length ≤ n ∧ φ = (l.map fun v => reflection (ℝ ∙ v)ᗮ).prod

(hn :
  FiniteDimensional.finrank ℝ
      ↥(LinearMap.ker
            (ContinuousLinearMap.id ℝ F -
              ↑{ toLinearEquiv := φ.toLinearEquiv, continuous_toFun := ⋯, continuous_invFun := ⋯ }))ᗮ ≤
    n)

∃ l, l.length ≤ n ∧ φ = (List.map (fun v => reflection (Submodule.span ℝ {v})ᗮ) l).prod


/--
The `Monad` typeclass only contains the operations of a monad.
`LawfulMonad` further asserts that these operations satisfy the laws of a monad,
including associativity and identity laws for `bind`:
```
pure x >>= f = f x
x >>= pure = x
x >>= f >>= g = x >>= (fun x => f x >>= g)
```

`LawfulMonad.mk'` is an alternative constructor containing useful defaults for many fields.
-/
class LawfulMonad (m : Type u → Type v) [Monad m] extends LawfulApplicative m : Prop where
  bind_pure_comp (f : α → β) (x : m α) : x >>= (fun a => pure (f a)) = f <$> x
  bind_map       {α β : Type u} (f : m (α → β)) (x : m α) : f >>= (. <$> x) = f <*> x
  pure_bind      (x : α) (f : α → m β) : pure x >>= f = f x
  bind_assoc     (x : m α) (f : α → m β) (g : β → m γ) : x >>= f >>= g = x >>= fun x => f x >>= g
  map_pure g x    := (by rw [← bind_pure_comp, pure_bind])
  seq_pure g x    := (by rw [← bind_map]; simp [map_pure, bind_pure_comp])
  seq_assoc x g h := (by simp [← bind_pure_comp, ← bind_map, bind_assoc, pure_bind])

{m : Type u → Type v}
[Monad m]
[self : LawfulMonad m]
{α β γ : Type u}
(x : m α)
(f : α → m β)
(g : β → m γ)


@[simp] theorem Phase.le_refl (p : Phase) : p ≤ p


lemma iterate_add_eq_iterate (hf : Injective f) : f^[m + n] a = f^[n] a ↔ f^[m] a = a

{α : Type u}
{f : α → α}
{m n : ℕ}
{a : α}
(hf : Function.Injective f)


@[simp]
theorem basis_empty : Lagrange.basis ∅ v i = 1

{F : Type u_1}
[Field F]
{ι : Type u_2}
[DecidableEq ι]
{v : ι → F}
{i : ι}


protected lemma Directed.iSup_le (hf : Directed (· ≤ ·) f) (ha : ∀ i, f i ≤ a) :  ⨆ i, f i ≤ a

(hf : Directed (fun x x_1 => x ≤ x_1) f)


/-- We define a connected category as a _nonempty_ category for which every
functor to a discrete category is constant.

NB. Some authors include the empty category as connected, we do not.
We instead are interested in categories with exactly one 'connected
component'.

This allows us to show that the functor X ⨯ - preserves connected limits.

See <https://stacks.math.columbia.edu/tag/002S>
-/
class IsConnected (J : Type u₁) [Category.{v₁} J] extends IsPreconnected J : Prop where
  [is_nonempty : Nonempty J]

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
[self : CategoryTheory.IsConnected J]


theorem const_sub (hf : DiffContOnCl 𝕜 f s) (c : F) : DiffContOnCl 𝕜 (fun x => c - f x) s

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 F]
{f : E → F}
{s : Set E}
(hf : DiffContOnCl 𝕜 f s)
(c : F)


@[simp]
theorem coequalizer.isoTargetOfSelf_inv : (coequalizer.isoTargetOfSelf f).inv = coequalizer.π f f

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

(CategoryTheory.Limits.coequalizer.isoTargetOfSelf f).inv = CategoryTheory.Limits.coequalizer.π f f


theorem insertWith.valid_aux [IsTotal α (· ≤ ·)] [@DecidableRel α (· ≤ ·)] (f : α → α) (x : α)
    (hf : ∀ y, x ≤ y ∧ y ≤ x → x ≤ f y ∧ f y ≤ x) :
    ∀ {t o₁ o₂},
      Valid' o₁ t o₂ →
        Bounded nil o₁ x →
          Bounded nil x o₂ →
            Valid' o₁ (insertWith f x t) o₂ ∧ Raised (size t) (size (insertWith f x t))

(hf : ∀ (y : α), x ≤ y ∧ y ≤ x → x ≤ f y ∧ f y ≤ x)

Ordnode.Valid' o₁ t o₂ →
  Ordnode.nil.Bounded o₁ ↑x →
    Ordnode.nil.Bounded (↑x) o₂ →
      Ordnode.Valid' o₁ (Ordnode.insertWith f x t) o₂ ∧ Ordnode.Raised t.size (Ordnode.insertWith f x t).size


theorem mem_range_self (f : M →[L] N) (x : M) : f x ∈ f.range

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
(f : L.Hom M N)
(x : M)


/-- The natural isomorphism between pulling back then evaluating, and just evaluating. -/
@[simps!]
def comapEvalIsoEval (h : J → I) (j : J) : comap C h ⋙ eval (C ∘ h) j ≅ eval C (h j)

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

(CategoryTheory.Pi.comapEvalIsoEval C h j).hom.app X = CategoryTheory.CategoryStruct.id (X (h j))


theorem uniformEmbedding_equivBoundedOfCompact : UniformEmbedding (equivBoundedOfCompact α β)

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

UniformEmbedding ⇑(ContinuousMap.equivBoundedOfCompact α β)


@[to_additive]
theorem op_closure (s : Set M) : (closure s).op = closure (MulOpposite.unop ⁻¹' s)

{M : Type u_2}
[AddZeroClass M]
(s : Set M)

(AddSubmonoid.closure s).op = AddSubmonoid.closure (AddOpposite.unop ⁻¹' s)


theorem chain_split {a b : α} {l₁ l₂ : List α} :
    Chain R a (l₁ ++ b :: l₂) ↔ Chain R a (l₁ ++ [b]) ∧ Chain R b l₂

{α : Type u}
{R : α → α → Prop}
{a b : α}
{l₁ l₂ : List α}

List.Chain R a (l₁ ++ b :: l₂) ↔ List.Chain R a (l₁ ++ [b]) ∧ List.Chain R b l₂


/-- The quotient of a finitely presented algebra by a finitely generated ideal is finitely
presented. -/
protected theorem quotient {I : Ideal A} (h : I.FG) [FinitePresentation R A] :
    FinitePresentation R (A ⧸ I)

{R : Type w₁}
{A : Type w₂}
[CommRing R]
[CommRing A]
[Algebra R A]
{I : Ideal A}
(h : I.FG)
[Algebra.FinitePresentation R A]


theorem subsingleton_iff_bot_eq_top : (⊥ : α) = (⊤ : α) ↔ Subsingleton α

{α : Type u}
[PartialOrder α]
[BoundedOrder α]


@[to_additive]
protected theorem inv [Group β] [TopologicalGroup β] (hu : Adapted f u) :
    Adapted f u⁻¹

{Ω : Type u_1}
{β : Type u_2}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[TopologicalSpace β]
[Preorder ι]
{u : ι → Ω → β}
{f : MeasureTheory.Filtration ι m}
[AddGroup β]
[TopologicalAddGroup β]
(hu : MeasureTheory.Adapted f u)


@[to_additive (attr := simp)]
theorem measure_inv_null : μ s⁻¹ = 0 ↔ μ s = 0

{G : Type u_1}
[MeasurableSpace G]
[AddGroup G]
[MeasurableAdd₂ G]
(μ : MeasureTheory.Measure G)
[MeasureTheory.SFinite μ]
{s : Set G}
[MeasurableNeg G]
[μ.IsAddLeftInvariant]


theorem nilpotencyClass_le_of_ker_le_center {H : Type*} [Group H] (f : G →* H)
    (hf1 : f.ker ≤ center G) (hH : IsNilpotent H) :
    Group.nilpotencyClass (hG := isNilpotent_of_ker_le_center f hf1 hH) ≤
      Group.nilpotencyClass H + 1

{G : Type u_1}
[Group G]
{H : Type u_2}
[Group H]
(f : G →* H)
(hf1 : f.ker ≤ Subgroup.center G)
(hH : Group.IsNilpotent H)

Group.nilpotencyClass G ≤ Group.nilpotencyClass H + 1


/-- If M is the midpoint of the segment AB and C is the same distance from A as it is from B
then ∠CMB = π / 2. -/
theorem angle_right_midpoint_eq_pi_div_two_of_dist_eq {p1 p2 p3 : P} (h : dist p3 p1 = dist p3 p2) :
    ∠ p3 (midpoint ℝ p1 p2) p2 = π / 2

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p1 p2 p3 : P}
(h : dist p3 p1 = dist p3 p2)

EuclideanGeometry.angle p3 (midpoint ℝ p1 p2) p2 = π / 2


@[simp]
theorem add_apply (f g : CentroidHom α) (a : α) : (f + g) a = f a + g a

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


/-- If the angle between two vectors is `-π / 2`, the vectors are not equal. -/
theorem ne_of_oangle_eq_neg_pi_div_two {x y : V} (h : o.oangle x y = (-π / 2 : ℝ)) : x ≠ y

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


@[to_additive]
lemma isSquare_prod {s : Finset ι} [CommMonoid α] (f : ι → α)
    (h : ∀ c ∈ s, IsSquare (f c)) : IsSquare (∏ i ∈ s, f i)

{ι : Type u_1}
{α : Type u_3}
{s : Finset ι}
[CommMonoid α]
(f : ι → α)
(h : ∀ c ∈ s, IsSquare (f c))


theorem reverse_revzip (l : List α) : reverse l.revzip = revzip l.reverse


theorem IsIdealMorphism.eq (hf : f.IsIdealMorphism) : f.idealRange = f.range

{R : Type u}
{L : Type v}
{L' : Type w₂}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieRing L']
[LieAlgebra R L']
{f : L →ₗ⁅R⁆ L'}
(hf : f.IsIdealMorphism)

lieIdealSubalgebra R L' f.idealRange = f.range


theorem ContDiffAt.dist (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (hne : f x ≠ g x) :
    ContDiffAt ℝ n (fun y => dist (f y) (g y)) x

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedSpace ℝ E]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{f g : G → E}
{x : G}
{n : ℕ∞}
(hf : ContDiffAt ℝ n f x)
(hg : ContDiffAt ℝ n g x)
(hne : f x ≠ g x)


theorem jacobson_eq_self_of_isMaximal [H : IsMaximal I] : I.jacobson = I

{R : Type u}
[Ring R]
{I : Ideal R}
[H : I.IsMaximal]


/-- Construct an adjunction between functors `F` and `G` given a unit and counit for the adjunction
satisfying the triangle identities. -/

@[simps!]
def mkOfUnitCounit (adj : CoreUnitCounit F G) : F ⊣ G

(adj : CategoryTheory.Adjunction.CoreUnitCounit F G)

(CategoryTheory.Adjunction.mkOfUnitCounit adj).unit = adj.unit


lemma nnreal_of_nonneg {A : Type*} [Ring A] [PartialOrder A] [Algebra ℝ A]
    [NonnegSpectrumClass ℝ A] {a : A} (ha : 0 ≤ a) :
    SpectrumRestricts a ContinuousMap.realToNNReal

{A : Type u_4}
[Ring A]
[PartialOrder A]
[Algebra ℝ A]
[NonnegSpectrumClass ℝ A]
{a : A}
(ha : 0 ≤ a)


theorem ContMDiffWithinAt.congr_of_eventuallyEq (h : ContMDiffWithinAt I I' n f s x)
    (h₁ : f₁ =ᶠ[𝓝[s] x] f) (hx : f₁ x = f x) : ContMDiffWithinAt I I' n f₁ s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f f₁ : M → M'}
{s : Set M}
{x : M}
{n : ℕ∞}
(h : ContMDiffWithinAt I I' n f s x)
(h₁ : f₁ =ᶠ[𝓝[s] x] f)
(hx : f₁ x = f x)


@[simp]
theorem iUnion_subset_iff {s : ι → Set α} {t : Set α} : ⋃ i, s i ⊆ t ↔ ∀ i, s i ⊆ t

{α : Type u_1}
{ι : Sort u_4}
{s : ι → Set α}
{t : Set α}


/-- **Minkowski's inequality for functions** `α → ℝ≥0∞`: the `ℒp` seminorm of the sum of two
functions is bounded by the sum of their `ℒp` seminorms. -/
theorem lintegral_Lp_add_le {p : ℝ} {f g : α → ℝ≥0∞} (hf : AEMeasurable f μ) (hg : AEMeasurable g μ)
    (hp1 : 1 ≤ p) :
    (∫⁻ a, (f + g) a ^ p ∂μ) ^ (1 / p) ≤
      (∫⁻ a, f a ^ p ∂μ) ^ (1 / p) + (∫⁻ a, g a ^ p ∂μ) ^ (1 / p)

{α : Type u_1}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{p : ℝ}
{f g : α → ENNReal}
(hf : AEMeasurable f μ)
(hg : AEMeasurable g μ)
(hp1 : 1 ≤ p)


/-- Factoring through the image is a strong epi-mono factorisation. -/
@[simps]
def imageStrongEpiMonoFactorisation : StrongEpiMonoFactorisation f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
{P Q : C}
(f : P ⟶ Q)

(CategoryTheory.Abelian.imageStrongEpiMonoFactorisation f).m = CategoryTheory.Abelian.image.ι f


theorem toEquiv_injective : Injective (toEquiv : (α ≃ᵢ β) → (α ≃ β))

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]


theorem extract.go₂_add_right_cancel (s : List Char) (i e n : Nat) :
    go₂ s ⟨i + n⟩ ⟨e + n⟩ = go₂ s ⟨i⟩ ⟨e⟩

String.extract.go₂ s { byteIdx := i + n } { byteIdx := e + n } = String.extract.go₂ s { byteIdx := i } { byteIdx := e }


theorem complementedLattice_of_complementedLattice_Iic
    [IsModularLattice α] [IsCompactlyGenerated α]
    {s : Set ι} {f : ι → α}
    (h : ∀ i ∈ s, ComplementedLattice <| Iic (f i))
    (h' : ⨆ i ∈ s, f i = ⊤) :
    ComplementedLattice α

(h : ∀ i ∈ s, ComplementedLattice ↑(Set.Iic (f i)))


theorem IsQF.induction_on_sup_not {P : L.BoundedFormula α n → Prop} {φ : L.BoundedFormula α n}
    (h : IsQF φ) (hf : P (⊥ : L.BoundedFormula α n))
    (ha : ∀ ψ : L.BoundedFormula α n, IsAtomic ψ → P ψ)
    (hsup : ∀ {φ₁ φ₂}, P φ₁ → P φ₂ → P (φ₁ ⊔ φ₂)) (hnot : ∀ {φ}, P φ → P φ.not)
    (hse :
      ∀ {φ₁ φ₂ : L.BoundedFormula α n}, Theory.SemanticallyEquivalent ∅ φ₁ φ₂ → (P φ₁ ↔ P φ₂)) :
    P φ

(ha : ∀ (ψ : L.BoundedFormula α n), ψ.IsAtomic → P ψ)

(hsup : ∀ {φ₁ φ₂ : L.BoundedFormula α n}, P φ₁ → P φ₂ → P (φ₁ ⊔ φ₂))

(hnot : ∀ {φ : L.BoundedFormula α n}, P φ → P φ.not)

(hse : ∀ {φ₁ φ₂ : L.BoundedFormula α n}, ∅.SemanticallyEquivalent φ₁ φ₂ → (P φ₁ ↔ P φ₂))


@[simp]
theorem card_finsupp (s : Finset ι) (t : ι → Finset α) :
    (s.finsupp t).card = ∏ i ∈ s, (t i).card

{ι : Type u_1}
{α : Type u_2}
[Zero α]
(s : Finset ι)
(t : ι → Finset α)


theorem MellinConvergent.const_smul {f : ℝ → E} {s : ℂ} (hf : MellinConvergent f s) {𝕜 : Type*}
    [NontriviallyNormedField 𝕜] [NormedSpace 𝕜 E] [SMulCommClass ℂ 𝕜 E] (c : 𝕜) :
    MellinConvergent (fun t => c • f t) s

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : ℝ → E}
{s : ℂ}
(hf : MellinConvergent f s)
{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[SMulCommClass ℂ 𝕜 E]
(c : 𝕜)


@[simp, norm_cast] theorem coe_pos : 0 < (r : ℝ≥0∞) ↔ 0 < r


/-- Auxiliary definition for the proof of the shrinking lemma. A partial refinement of a covering
`⋃ i, u i` of a set `s` is a map `v : ι → Set X` and a set `carrier : Set ι` such that

* `s ⊆ ⋃ i, v i`;
* all `v i` are open;
* if `i ∈ carrier v`, then `closure (v i) ⊆ u i`;
* if `i ∉ carrier`, then `v i = u i`.

This type is equipped with the following partial order: `v ≤ v'` if `v.carrier ⊆ v'.carrier`
and `v i = v' i` for `i ∈ v.carrier`. We will use Zorn's lemma to prove that this type has
a maximal element, then show that the maximal element must have `carrier = univ`. -/
-- Porting note(#5171): this linter isn't ported yet. @[nolint has_nonempty_instance]
@[ext] structure PartialRefinement (u : ι → Set X) (s : Set X) where
  /-- A family of sets that form a partial refinement of `u`. -/
  toFun : ι → Set X
  /-- The set of indexes `i` such that `i`-th set is already shrunk. -/
  carrier : Set ι
  /-- Each set from the partially refined family is open. -/
  protected isOpen : ∀ i, IsOpen (toFun i)
  /-- The partially refined family still covers the set. -/
  subset_iUnion : s ⊆ ⋃ i, toFun i
  /-- For each `i ∈ carrier`, the original set includes the closure of the refined set. -/
  closure_subset : ∀ {i}, i ∈ carrier → closure (toFun i) ⊆ u i
  /-- Sets that correspond to `i ∉ carrier` are not modified. -/
  apply_eq : ∀ {i}, i ∉ carrier → toFun i = u i

(self : ShrinkingLemma.PartialRefinement u s)

i ∈ self.carrier → closure (self.toFun i) ⊆ u i


theorem C_neg : (C (-a) : MvPolynomial σ R) = -C a

{R : Type u}
(σ : Type u_1)
(a : R)
[CommRing R]


theorem ae_le_essSup (f : α → ℝ≥0∞) : ∀ᵐ y ∂μ, f y ≤ essSup f μ

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


theorem scale_opowAux (e a0 a : ONote) [NF e] [NF a0] [NF a] :
    ∀ k m, repr (opowAux e a0 a k m) = ω ^ repr e * repr (opowAux 0 a0 a k m)

(e.opowAux a0 a k m).repr = ω ^ e.repr * (ONote.opowAux 0 a0 a k m).repr


theorem lsub_not_mem_range {ι : Type u} (f : ι → Ordinal.{max u v}) :
    lsub.{_, v} f ∉ Set.range f


theorem _root_.Decidable.List.eq_or_ne_mem_of_mem [DecidableEq α]
    {a b : α} {l : List α} (h : a ∈ b :: l) : a = b ∨ a ≠ b ∧ a ∈ l

{α : Type u}
[DecidableEq α]
{a b : α}
{l : List α}
(h : a ∈ b :: l)


/-- An extensionality lemma that is useful for filters with good lemmas about `sᶜ ∈ f` (e.g.,
`Filter.comap`, `Filter.coprod`, `Filter.Coprod`, `Filter.cofinite`). -/
protected theorem coext (h : ∀ s, sᶜ ∈ f ↔ sᶜ ∈ g) : f = g

{α : Type u}
{f g : Filter α}
(h : ∀ (s : Set α), sᶜ ∈ f ↔ sᶜ ∈ g)


lemma oppositeShiftFunctorAdd'_hom_app :
    (shiftFunctorAdd' (OppositeShift C A) a b c h).hom.app X =
      ((shiftFunctorAdd' C a b c h).inv.app X.unop).op

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{A : Type u_2}
[AddMonoid A]
[CategoryTheory.HasShift C A]
(X : CategoryTheory.OppositeShift C A)
(a b c : A)
(h : a + b = c)

(CategoryTheory.shiftFunctorAdd' (CategoryTheory.OppositeShift C A) a b c h).hom.app X =
  ((CategoryTheory.shiftFunctorAdd' C a b c h).inv.app (Opposite.unop X)).op


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

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

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


/-- The angle between a vector and the zero vector. -/
@[simp]
theorem angle_zero_right (x : V) : angle x 0 = π / 2

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
(x : V)


@[to_additive]
theorem coe_mul_self_eq (s : Submonoid M) : (s : Set M) * s = s

{M : Type u_3}
[AddMonoid M]
(s : AddSubmonoid M)


lemma pred_le_iff_le_succ : pred a ≤ b ↔ a ≤ succ b

{α : Type u_1}
[Preorder α]
[SuccOrder α]
[PredOrder α]
{a b : α}


/-- Gauge is subadditive. -/
theorem gauge_add_le (hs : Convex ℝ s) (absorbs : Absorbent ℝ s) (x y : E) :
    gauge s (x + y) ≤ gauge s x + gauge s y

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
(hs : Convex ℝ s)
(absorbs : Absorbent ℝ s)
(x y : E)


theorem ofCauchy_inf (a b) : (⟨⟦a ⊓ b⟧⟩ : ℝ) = ⟨⟦a⟧⟩ ⊓ ⟨⟦b⟧⟩

{ cauchy := ⟦a ⊓ b⟧ } = { cauchy := ⟦a⟧ } ⊓ { cauchy := ⟦b⟧ }


lemma IsLocalizedModule.rank_eq {N : Type v} [AddCommGroup N]
    [Module R N] [Module S N] [IsScalarTower R S N] (f : M →ₗ[R] N) [IsLocalizedModule p f] :
    Module.rank S N = Module.rank R M

{R : Type u}
(S : Type u')
{M : Type v}
[CommRing R]
[CommRing S]
[AddCommGroup M]
[Module R M]
[Algebra R S]
(p : Submonoid R)
[IsLocalization p S]
(hp : p ≤ R⁰)
{N : Type v}
[AddCommGroup N]
[Module R N]
[Module S N]
[IsScalarTower R S N]
(f : M →ₗ[R] N)
[IsLocalizedModule p f]


private theorem newton_seq_dist_tendsto :
    Tendsto (fun n => ‖newton_cau_seq hnorm n - a‖)
    atTop (𝓝 (‖F.eval a‖ / ‖F.derivative.eval a‖))

(hnorm : ‖Polynomial.eval a F‖ < ‖Polynomial.eval a (Polynomial.derivative F)‖ ^ 2)

Filter.Tendsto (fun n => ‖↑(newton_cau_seq hnorm) n - a‖) Filter.atTop
  (𝓝 (‖Polynomial.eval a F‖ / ‖Polynomial.eval a (Polynomial.derivative F)‖))


/-- `C` has all colimits of size `v₁ u₁` (`HasColimitsOfSize.{v₁ u₁} C`)
if it has colimits of every shape `J : Type u₁` with `[Category.{v₁} J]`.
-/
@[pp_with_univ]
class HasColimitsOfSize (C : Type u) [Category.{v} C] : Prop where
  /-- All `F : J ⥤ C` have colimits for all small `J` -/
  has_colimits_of_shape : ∀ (J : Type u₁) [Category.{v₁} J], HasColimitsOfShape J C := by
    infer_instance

[self : CategoryTheory.Limits.HasColimitsOfSize.{v₁, u₁, v, u} C]


/-- `p ∧ (p → q) → q` -/
theorem inf_himp_le : a ⊓ (a ⇨ b) ≤ b

{α : Type u_2}
[GeneralizedHeytingAlgebra α]
{a b : α}


theorem tendsto_approxOn_Lp_eLpNorm [OpensMeasurableSpace E] {f : β → E} (hf : Measurable f)
    {s : Set E} {y₀ : E} (h₀ : y₀ ∈ s) [SeparableSpace s] (hp_ne_top : p ≠ ∞) {μ : Measure β}
    (hμ : ∀ᵐ x ∂μ, f x ∈ closure s) (hi : eLpNorm (fun x => f x - y₀) p μ < ∞) :
    Tendsto (fun n => eLpNorm (⇑(approxOn f hf s y₀ h₀ n) - f) p μ) atTop (𝓝 0)

(hi : MeasureTheory.eLpNorm (fun x => f x - y₀) p μ < ⊤)

Filter.Tendsto (fun n => MeasureTheory.eLpNorm (↑(MeasureTheory.SimpleFunc.approxOn f hf s y₀ h₀ n) - f) p μ)
  Filter.atTop (𝓝 0)


theorem ContinuousLinearMap.aestronglyMeasurable_comp₂ (L : E →L[𝕜] F →L[𝕜] G) {f : α → E}
    {g : α → F} (hf : AEStronglyMeasurable f μ) (hg : AEStronglyMeasurable g μ) :
    AEStronglyMeasurable (fun x => L (f x) (g x)) μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

(hg : MeasureTheory.AEStronglyMeasurable g μ)

MeasureTheory.AEStronglyMeasurable (fun x => (L (f x)) (g x)) μ


/-- If a set `t` is eventually covered by a countable family of sets, all with cardinality at
most `a`, then the cardinality of `t` is also bounded by `a`.
Supersed by `mk_le_of_countable_eventually_mem` which does not assume
that the indexing set lives in the same universe. -/
lemma mk_subtype_le_of_countable_eventually_mem_aux {α ι : Type u} {a : Cardinal}
    [Countable ι] {f : ι → Set α} {l : Filter ι} [NeBot l]
    {t : Set α} (ht : ∀ x ∈ t, ∀ᶠ i in l, x ∈ f i)
    (h'f : ∀ i, #(f i) ≤ a) : #t ≤ a

(ht : ∀ x ∈ t, ∀ᶠ (i : ι) in l, x ∈ f i)


/-- **Turán's theorem**, forward direction.

Any `r + 1`-cliquefree Turán-maximal graph on `n` vertices is isomorphic to `turanGraph n r`. -/
theorem nonempty_iso_turanGraph (h : G.IsTuranMaximal r) :
    Nonempty (G ≃g turanGraph (Fintype.card V) r)

{V : Type u_1}
[Fintype V]
[DecidableEq V]
{G : SimpleGraph V}
[DecidableRel G.Adj]
{r : ℕ}
(h : G.IsTuranMaximal r)

Nonempty (G ≃g SimpleGraph.turanGraph (Fintype.card V) r)


/-- A monotone function continuous at the indexed infimum over a nonempty `Sort` sends this indexed
infimum to the indexed infimum of the composition. -/
theorem Monotone.map_iInf_of_continuousAt' {ι : Sort*} [Nonempty ι] {f : α → β} {g : ι → α}
    (Cf : ContinuousAt f (iInf g)) (Mf : Monotone f)
    (bdd : BddBelow (range g) := by bddDefault) : f (⨅ i, g i) = ⨅ i, f (g i)

(bdd : BddBelow (Set.range g) := by bddDefault)


@[simp]
theorem coe_comp_continuousOrderHom (g : EsakiaHom β γ) (f : EsakiaHom α β) :
    (g.comp f : α →Co γ) = (g : β →Co γ).comp f

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[TopologicalSpace α]
[Preorder α]
[TopologicalSpace β]
[Preorder β]
[TopologicalSpace γ]
[Preorder γ]
(g : EsakiaHom β γ)
(f : EsakiaHom α β)


theorem of_eq {f g : ℕ → ℕ} (hf : Nat.Primrec f) (H : ∀ n, f n = g n) : Nat.Primrec g

{f g : ℕ → ℕ}
(hf : Nat.Primrec f)
(H : ∀ (n : ℕ), f n = g n)


/-- Given a sheaf `S`, construct an equivalence `S(α) ≃ (α → S(*))`. -/
@[simps]
noncomputable def evalEquiv (S : Type uᵒᵖ ⥤ Type u) (hs : IsSheaf typesGrothendieckTopology S)
    (α : Type u) : S.obj (op α) ≃ (α → S.obj (op PUnit))

(S : CategoryTheory.Functor Type uᵒᵖ (Type u))

(hs : CategoryTheory.Presieve.IsSheaf CategoryTheory.typesGrothendieckTopology S)

(f : α → S.obj (Opposite.op PUnit.{u + 1}))

(CategoryTheory.evalEquiv S hs α).symm f = CategoryTheory.typesGlue S hs α f


theorem eval₂_eq_sum_range :
    p.eval₂ f x = ∑ i ∈ Finset.range (p.natDegree + 1), f (p.coeff i) * x ^ i

{R : Type u}
{S : Type v}
[Semiring R]
{p : R[X]}
[Semiring S]
(f : R →+* S)
(x : S)

Polynomial.eval₂ f x p = ∑ i ∈ Finset.range (p.natDegree + 1), f (p.coeff i) * x ^ i


@[simp]
theorem copy_nil {u u'} (hu : u = u') : (Walk.nil : G.Walk u u).copy hu hu = Walk.nil

{V : Type u}
{G : SimpleGraph V}
{u u' : V}
(hu : u = u')

SimpleGraph.Walk.nil.copy hu hu = SimpleGraph.Walk.nil


theorem IsPrimePow.ne_zero [NoZeroDivisors R] {n : R} (h : IsPrimePow n) : n ≠ 0

{R : Type u_1}
[CommMonoidWithZero R]
[NoZeroDivisors R]
{n : R}
(h : IsPrimePow n)


theorem mul_eq_dfinsupp_sum [∀ (i : ι) (x : A i), Decidable (x ≠ 0)] (a a' : ⨁ i, A i) :
    a * a'
      = a.sum fun i ai => a'.sum fun j aj => DirectSum.of _ _ <| GradedMonoid.GMul.mul ai aj

[(i : ι) → (x : A i) → Decidable (x ≠ 0)]

a * a' = DFinsupp.sum a fun i ai => DFinsupp.sum a' fun j aj => (DirectSum.of A (i + j)) (GradedMonoid.GMul.mul ai aj)


@[simp] lemma wcovBy_insert (s : Finset α) (a : α) : s ⩿ insert a s

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


theorem not_add_one_le_zero (n : Nat) : ¬ n + 1 ≤ 0


/-- In a second countable topology, the first function in an identically distributed pair is a.e.
strongly measurable. So is the second function, but use `h.symm.aestronglyMeasurable_fst` as
`h.aestronglyMeasurable_snd` has a different meaning. -/
theorem aestronglyMeasurable_fst [TopologicalSpace γ] [MetrizableSpace γ] [OpensMeasurableSpace γ]
    [SecondCountableTopology γ] (h : IdentDistrib f g μ ν) : AEStronglyMeasurable f μ

(h : ProbabilityTheory.IdentDistrib f g μ ν)


theorem getElem?_pmap {p : α → Prop} (f : ∀ a, p a → β) {l : List α} (h : ∀ a ∈ l, p a) (n : ℕ) :
    (pmap f l h)[n]? = Option.pmap f l[n]? fun x H => h x (getElem?_mem H)

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

(List.pmap f l h)[n]? = Option.pmap f l[n]? ⋯


/-- Let `I J : Ideal R`. If the localization of `I` at each maximal ideal `P` is equal to
the localization of `J` at `P`, then `I = J`. -/
theorem Ideal.eq_of_localization_maximal {I J : Ideal R}
    (h : ∀ (P : Ideal R) (_ : P.IsMaximal),
      Ideal.map (algebraMap R (Localization.AtPrime P)) I =
        Ideal.map (algebraMap R (Localization.AtPrime P)) J) :
    I = J

(h :
  ∀ (P : Ideal R) (x : P.IsMaximal),
    Ideal.map (algebraMap R (Localization.AtPrime P)) I = Ideal.map (algebraMap R (Localization.AtPrime P)) J)


theorem prod_symm_apply (x : B) (w₁ : F₁) (w₂ : F₂) :
    (prod e₁ e₂).toPartialEquiv.symm (x, w₁, w₂) = ⟨x, e₁.symm x w₁, e₂.symm x w₂⟩

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

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

(e₁ : Trivialization F₁ Bundle.TotalSpace.proj)

(e₂ : Trivialization F₂ Bundle.TotalSpace.proj)

↑(e₁.prod e₂).symm (x, w₁, w₂) = { proj := x, snd := (e₁.symm x w₁, e₂.symm x w₂) }


/-- The adjunction given by an equivalence of categories. (To obtain the opposite adjunction,
simply use `e.symm.toAdjunction`. -/
@[simps! unit counit]
def toAdjunction : e.functor ⊣ e.inverse

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


theorem cast_choose_two (a : ℕ) : (a.choose 2 : K) = a * (a - 1) / 2

(K : Type u_1)
[DivisionRing K]
[CharZero K]
(a : ℕ)


@[to_additive (attr := simp)]
theorem finprod_true (f : True → M) : ∏ᶠ i, f i = f trivial

{M : Type u_2}
[AddCommMonoid M]
(f : True → M)


theorem moebius_eq_or (n : ℕ) : μ n = 0 ∨ μ n = 1 ∨ μ n = -1

ArithmeticFunction.moebius n = 0 ∨ ArithmeticFunction.moebius n = 1 ∨ ArithmeticFunction.moebius n = -1


@[simp]
theorem realize_ex : θ.ex.Realize v xs ↔ ∃ a : M, θ.Realize v (Fin.snoc xs a)

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{l : ℕ}
{θ : L.BoundedFormula α l.succ}
{v : α → M}
{xs : Fin l → M}

θ.ex.Realize v xs ↔ ∃ a, θ.Realize v (Fin.snoc xs a)


theorem star_mul_eq_coe : star a * a = (star a * a).re

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


theorem sqrtTwoAddSeries_step_up (c d : ℕ) {a b n : ℕ} {z : ℝ} (hz : sqrtTwoAddSeries (c / d) n ≤ z)
    (hb : 0 < b) (hd : 0 < d) (h : (2 * b + a) * d ^ 2 ≤ c ^ 2 * b) :
    sqrtTwoAddSeries (a / b) (n + 1) ≤ z

(c d : ℕ)
{a b n : ℕ}
{z : ℝ}
(hz : (↑c / ↑d).sqrtTwoAddSeries n ≤ z)
(hb : 0 < b)
(hd : 0 < d)
(h : (2 * b + a) * d ^ 2 ≤ c ^ 2 * b)


theorem HasBasis.inf_basis_neBot_iff (hl : l.HasBasis p s) (hl' : l'.HasBasis p' s') :
    NeBot (l ⊓ l') ↔ ∀ ⦃i⦄, p i → ∀ ⦃i'⦄, p' i' → (s i ∩ s' i').Nonempty

{α : Type u_1}
{ι : Sort u_4}
{ι' : Sort u_5}
{l l' : Filter α}
{p : ι → Prop}
{s : ι → Set α}
{p' : ι' → Prop}
{s' : ι' → Set α}
(hl : l.HasBasis p s)
(hl' : l'.HasBasis p' s')

(l ⊓ l').NeBot ↔ ∀ ⦃i : ι⦄, p i → ∀ ⦃i' : ι'⦄, p' i' → (s i ∩ s' i').Nonempty


@[simp]
theorem coe_bot : ((⊥ : Subalgebra R A) : Set A) = Set.range (algebraMap R A)

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


theorem fderivWithin_id' (hxs : UniqueDiffWithinAt 𝕜 s x) :
    fderivWithin 𝕜 (fun x : E => x) s x = ContinuousLinearMap.id 𝕜 E

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{s : Set E}
(hxs : UniqueDiffWithinAt 𝕜 s x)

fderivWithin 𝕜 (fun x => x) s x = ContinuousLinearMap.id 𝕜 E


theorem toSignedMeasure_toMeasureOfZeroLE :
    μ.toSignedMeasure.toMeasureOfZeroLE Set.univ MeasurableSet.univ
      ((le_restrict_univ_iff_le _ _).2 (zero_le_toSignedMeasure μ)) = μ

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

μ.toSignedMeasure.toMeasureOfZeroLE Set.univ ⋯ ⋯ = μ


/-- `IsIrrefl X r` means the binary relation `r` on `X` is irreflexive (that is, `r x x` never
holds). -/
class IsIrrefl (α : Sort u) (r : α → α → Prop) : Prop where
  irrefl : ∀ a, ¬r a a

{α : Sort u}
{r : α → α → Prop}
[self : IsIrrefl α r]
(a : α)


theorem commutator_def : commutator G = ⁅(⊤ : Subgroup G), ⊤⁆


theorem lt_bsup_of_limit {o : Ordinal} {f : ∀ a < o, Ordinal}
    (hf : ∀ {a a'} (ha : a < o) (ha' : a' < o), a < a' → f a ha < f a' ha')
    (ho : ∀ a < o, succ a < o) (i h) : f i h < bsup o f

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

(hf : ∀ {a a' : Ordinal.{u_4}} (ha : a < o) (ha' : a' < o), a < a' → f a ha < f a' ha')


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

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

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


/-- Uniform equicontinuity implies equicontinuity. -/
theorem UniformEquicontinuous.equicontinuous {F : ι → β → α} (h : UniformEquicontinuous F) :
    Equicontinuous F

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


@[simp]
theorem id_comp : (id : P₂ →ᵃⁱ[𝕜] P₂).comp f = f

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
{P : Type u_10}
{P₂ : Type u_11}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]
(f : P →ᵃⁱ[𝕜] P₂)


theorem IsSeparatedMap.comp_right {f : X → Y} (sep : IsSeparatedMap f) {g : A → X}
    (cont : Continuous g) (inj : g.Injective) : IsSeparatedMap (f ∘ g)

{X : Type u_1}
{Y : Sort u_2}
{A : Type u_3}
[TopologicalSpace X]
[TopologicalSpace A]
{f : X → Y}
(sep : IsSeparatedMap f)
{g : A → X}
(cont : Continuous g)
(inj : Function.Injective g)


/-- The identity map from a type with multiplication to itself. -/
@[to_additive (attr := simps) "The identity map from a type with addition to itself."]
def MulHom.id (M : Type*) [Mul M] : M →ₙ* M


theorem single_eq_single_iff (a₁ a₂ : α) (b₁ b₂ : M) :
    single a₁ b₁ = single a₂ b₂ ↔ a₁ = a₂ ∧ b₁ = b₂ ∨ b₁ = 0 ∧ b₂ = 0

{α : Type u_1}
{M : Type u_5}
[Zero M]
(a₁ a₂ : α)
(b₁ b₂ : M)

Finsupp.single a₁ b₁ = Finsupp.single a₂ b₂ ↔ a₁ = a₂ ∧ b₁ = b₂ ∨ b₁ = 0 ∧ b₂ = 0


@[to_additive]
theorem self_ne_mul_right : a ≠ a * b ↔ b ≠ 1

{M : Type u}
[LeftCancelMonoid M]
{a b : M}


lemma Nonempty.zero_smul (ht : t.Nonempty) : (0 : Finset α) • t = 0

{α : Type u_2}
{β : Type u_3}
[Zero α]
[Zero β]
[SMulWithZero α β]
[DecidableEq β]
{t : Finset β}
(ht : t.Nonempty)


theorem pred_castSucc_lt {a : Fin (n + 1)} (ha : castSucc a ≠ 0) :
    (castSucc a).pred ha < a

{n : ℕ}
{a : Fin (n + 1)}
(ha : a.castSucc ≠ 0)


lemma add'_eq (f₁ f₂ : L.obj X ⟶ L.obj Y) (φ : W.LeftFraction₂ X Y)
    (hφ₁ : f₁ = φ.fst.map L (inverts L W))
    (hφ₂ : f₂ = φ.snd.map L (inverts L W)) :
    add' W f₁ f₂ = φ.add.map L (inverts L W)

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_3, u_2} D]
[CategoryTheory.Preadditive C]
{L : CategoryTheory.Functor C D}
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
[W.HasLeftCalculusOfFractions]
{X Y : C}
(f₁ f₂ : L.obj X ⟶ L.obj Y)
(φ : W.LeftFraction₂ X Y)
(hφ₁ : f₁ = φ.fst.map L ⋯)
(hφ₂ : f₂ = φ.snd.map L ⋯)

CategoryTheory.Localization.Preadditive.add' W f₁ f₂ = φ.add.map L ⋯


nonrec theorem hasSum_lt {f g : α → ℝ≥0} {sf sg : ℝ≥0} {i : α} (h : ∀ a : α, f a ≤ g a)
    (hi : f i < g i) (hf : HasSum f sf) (hg : HasSum g sg) : sf < sg

{α : Type u_1}
{f g : α → ℝ≥0}
{sf sg : ℝ≥0}
{i : α}
(h : ∀ (a : α), f a ≤ g a)
(hi : f i < g i)
(hf : HasSum f sf)
(hg : HasSum g sg)


@[to_additive (attr := measurability)]
theorem mul_const [Mul β] [ContinuousMul β] (hf : StronglyMeasurable f) (c : β) :
    StronglyMeasurable fun x => f x * c

(hf : MeasureTheory.StronglyMeasurable f)

MeasureTheory.StronglyMeasurable fun x => f x * c


theorem nnnorm_def (f : E →SL[σ₁₂] F) : ‖f‖₊ = sInf { c | ∀ x, ‖f x‖₊ ≤ c * ‖x‖₊ }

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[RingHomIsometric σ₁₂]
(f : E →SL[σ₁₂] F)

‖f‖₊ = sInf {c | ∀ (x : E), ‖f x‖₊ ≤ c * ‖x‖₊}


/-- `LinearMap.fst` as an isometry, when the second space has the zero quadratic form. -/
@[simps!]
def Isometry.fst (Q₁ : QuadraticMap R M₁ P) : (Q₁.prod (0 : QuadraticMap R M₂ P)) →qᵢ Q₁

{R : Type u_2}
{M₁ : Type u_3}
(M₂ : Type u_4)
{P : Type u_7}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid P]
[Module R M₁]
[Module R M₂]
[Module R P]
(Q₁ : QuadraticMap R M₁ P)
(self : M₁ × M₂)

(QuadraticMap.Isometry.fst M₂ Q₁) self = self.1


theorem finite_intermediateField_of_exists_primitive_element [Algebra.IsAlgebraic F E]
    (h : ∃ α : E, F⟮α⟯ = ⊤) : Finite (IntermediateField F E)

(F : Type u_1)
(E : Type u_2)
[Field F]
[Field E]
[Algebra F E]
[Algebra.IsAlgebraic F E]
(h : ∃ α, F⟮α⟯ = ⊤)


@[to_additive (attr := simp) nsmul_sub]
lemma div_pow (a b : α) (n : ℕ) : (a / b) ^ n = a ^ n / b ^ n

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


@[to_additive]
theorem comap_strictMono_of_surjective : StrictMono (comap f)

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
{f : M →ₙ* N}
(hf : Function.Surjective ⇑f)


@[reassoc (attr := simp)]
theorem coequalizerComparison_map_desc [HasCoequalizer f g] [HasCoequalizer (G.map f) (G.map g)]
    {Z : C} {h : Y ⟶ Z} (w : f ≫ h = g ≫ h) :
    coequalizerComparison f g G ≫ G.map (coequalizer.desc h w) =
      coequalizer.desc (G.map h) (by simp only [← G.map_comp, w])

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

(w : CategoryTheory.CategoryStruct.comp f h = CategoryTheory.CategoryStruct.comp g h)

CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.coequalizerComparison f g G)
    (G.map (CategoryTheory.Limits.coequalizer.desc h w)) =
  CategoryTheory.Limits.coequalizer.desc (G.map h) ⋯


private irreducible_def mul : RingQuot r → RingQuot r → RingQuot r

{R : Type u_1}
[Semiring R]
(r : R → R → Prop)

∀ (x x_1 : RingQuot r),
  RingQuot.mul r x x_1 =
    match x, x_1 with
    | { toQuot := a }, { toQuot := b } => { toQuot := Quot.map₂ (fun x x_2 => x * x_2) ⋯ ⋯ a b }


@[to_additive (attr := simp, nolint simpNF)]
theorem mul_map_seq (x y : FreeSemigroup α) :
    ((· * ·) <$> x <*> y : Id (FreeSemigroup α)) = (x * y : FreeSemigroup α)

(Seq.seq ((fun x x_1 => x + x_1) <$> x) fun x => y) = x + y


@[simp] theorem dite_false {α : Sort u} {t : False → α} {e : ¬ False → α} : (dite False t e) = e not_false

{α : Sort u}
{t : False → α}
{e : ¬False → α}


theorem Ideal.IsPrime.homogeneousCore {I : Ideal A} (h : I.IsPrime) :
    (I.homogeneousCore 𝒜).toIdeal.IsPrime

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


@[norm_cast]
theorem coe_list_sum (l : List ℝ≥0) : ((l.sum : ℝ≥0) : ℝ) = (l.map (↑)).sum


theorem mem_graph_snd_inj' (f : E →ₗ.[R] F) {x y : E × F} (hx : x ∈ f.graph) (hy : y ∈ f.graph)
    (hxy : x.1 = y.1) : x.2 = y.2

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
(f : E →ₗ.[R] F)
{x y : E × F}
(hx : x ∈ f.graph)
(hy : y ∈ f.graph)
(hxy : x.1 = y.1)


/-- The chain rule for derivatives in the sense of strict differentiability. -/
@[fun_prop]
protected theorem HasStrictFDerivAt.comp {g : F → G} {g' : F →L[𝕜] G}
    (hg : HasStrictFDerivAt g g' (f x)) (hf : HasStrictFDerivAt f f' x) :
    HasStrictFDerivAt (fun x => g (f x)) (g'.comp 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]
{f : E → F}
{f' : E →L[𝕜] F}
(x : E)
{g : F → G}
{g' : F →L[𝕜] G}
(hg : HasStrictFDerivAt g g' (f x))
(hf : HasStrictFDerivAt f f' x)


theorem mem_comap' : s ∈ comap f l ↔ { y | ∀ ⦃x⦄, f x = y → x ∈ s } ∈ l

{α : Type u}
{β : Type v}
{f : α → β}
{l : Filter β}
{s : Set α}

s ∈ Filter.comap f l ↔ {y | ∀ ⦃x : α⦄, f x = y → x ∈ s} ∈ l


@[simp]
theorem sup_Prop_eq : (· ⊔ ·) = (· ∨ ·)

(fun x x_1 => x ⊔ x_1) = fun x x_1 => x ∨ x_1


theorem minpoly_coeff_zero_of_injective (hf : Function.Injective f) :
    (minpoly R f).coeff 0 ≠ 0

{R : Type u}
{M : Type v}
[CommRing R]
[Nontrivial R]
[AddCommGroup M]
[Module R M]
[Module.Free R M]
[Module.Finite R M]
{f : M →ₗ[R] M}
(hf : Function.Injective ⇑f)


@[simp]
lemma mk_snd (s : yoneda.obj X ⟶ A) (x : F.obj (op (CostructuredArrow.mk s))) :
    (mk s x).snd = F.map (eqToHom <| by rw [YonedaCollection.mk_fst]) x

{A : CategoryTheory.Functor Cᵒᵖ (Type v)}

{F : CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v)}

(x : F.obj (Opposite.op (CategoryTheory.CostructuredArrow.mk s)))

(CategoryTheory.OverPresheafAux.YonedaCollection.mk s x).snd = F.map (CategoryTheory.eqToHom ⋯) x


theorem setIntegral_mono_ae_restrict (h : f ≤ᵐ[μ.restrict s] g) :
    ∫ x in s, f x ∂μ ≤ ∫ x in s, g x ∂μ

{X : Type u_1}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
{f g : X → ℝ}
{s : Set X}
(hf : MeasureTheory.IntegrableOn f s μ)
(hg : MeasureTheory.IntegrableOn g s μ)
(h : f ≤ᵐ[μ.restrict s] g)

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


@[simp] theorem ofFin_add (x : Fin (2^n)) (y : BitVec n) :
  .ofFin x + y = .ofFin (x + y.toFin)

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

{ toFin := x } + y = { toFin := x + y.toFin }


theorem norm_le_mul_norm_of_ae_le_mul {c : ℝ} {f : Lp E p μ} {g : Lp F p μ}
    (h : ∀ᵐ x ∂μ, ‖f x‖ ≤ c * ‖g x‖) : ‖f‖ ≤ c * ‖g‖

(h : ∀ᵐ (x : α) ∂μ, ‖↑↑f x‖ ≤ c * ‖↑↑g x‖)

‖f‖ ≤ c * ‖g‖


theorem inner_add_right (x y z : E) : ⟪x, y + z⟫ = ⟪x, y⟫ + ⟪x, z⟫

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(x y z : E)


theorem op_snd {X Y Z : C} {f : X ⟶ Y} {g : X ⟶ Z} (c : PushoutCocone f g) :
    c.op.snd = c.inr.op

(c : CategoryTheory.Limits.PushoutCocone f g)


theorem prod_pow_prime_padicValNat (n : Nat) (hn : n ≠ 0) (m : Nat) (pr : n < m) :
    (∏ p ∈ Finset.filter Nat.Prime (Finset.range m), p ^ padicValNat p n) = n

∏ p ∈ Finset.filter Nat.Prime (Finset.range m), p ^ padicValNat p n = n


/-- If `|r| < 1`, then `n * r ^ n` tends to zero. -/
theorem tendsto_self_mul_const_pow_of_abs_lt_one {r : ℝ} (hr : |r| < 1) :
    Tendsto (fun n ↦ n * r ^ n : ℕ → ℝ) atTop (𝓝 0)

Filter.Tendsto (fun n => ↑n * r ^ n) Filter.atTop (𝓝 0)


/-- The category of cones on a given diagram. -/
@[simps]
instance Cone.category : Category (Cone F)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}

∀ {X Y Z : CategoryTheory.Limits.Cone F} (f : X ⟶ Y) (g : Y ⟶ Z), (f ≫ g).hom = f.hom ≫ g.hom


theorem clog_monotone (b : ℕ) : Monotone (clog b)


/-- The infimum of a set of congruence relations is the same as the infimum of the set's image
    under the map to the underlying binary relation. -/
@[simp, norm_cast]
theorem coe_sInf (S : Set (RingCon R)) : ⇑(sInf S) = sInf ((⇑) '' S)

{R : Type u_2}
[Add R]
[Mul R]
(S : Set (RingCon R))


@[reassoc]
theorem equalizer.condition : equalizer.ι f g ≫ f = equalizer.ι f g ≫ g

CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.equalizer.ι f g) f =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.equalizer.ι f g) g


@[ext]
lemma tensorObj₄_ext {j : I} {A : C} (f g : tensorObj X₁ (tensorObj X₂ (tensorObj X₃ X₄)) j ⟶ A)
    [HasGoodTensorTensor₂₃ X₂ X₃ X₄]
    [H : HasTensor₄ObjExt X₁ X₂ X₃ X₄]
    (h : ∀ (i₁ i₂ i₃ i₄ : I) (h : i₁ + i₂ + i₃ + i₄ = j),
      ιTensorObj₄ X₁ X₂ X₃ X₄ i₁ i₂ i₃ i₄ j h ≫ f =
        ιTensorObj₄ X₁ X₂ X₃ X₄ i₁ i₂ i₃ i₄ j h ≫ g) : f = g

{X₁ X₂ X₃ X₄ : CategoryTheory.GradedObject I C}

[X₂.HasTensor (CategoryTheory.GradedObject.Monoidal.tensorObj X₃ X₄)]

[X₁.HasTensor
    (CategoryTheory.GradedObject.Monoidal.tensorObj X₂ (CategoryTheory.GradedObject.Monoidal.tensorObj X₃ X₄))]

(f g :
  CategoryTheory.GradedObject.Monoidal.tensorObj X₁
      (CategoryTheory.GradedObject.Monoidal.tensorObj X₂ (CategoryTheory.GradedObject.Monoidal.tensorObj X₃ X₄)) j ⟶
    A)

(h :
  ∀ (i₁ i₂ i₃ i₄ : I) (h : i₁ + i₂ + i₃ + i₄ = j),
    CategoryTheory.CategoryStruct.comp (CategoryTheory.GradedObject.Monoidal.ιTensorObj₄ X₁ X₂ X₃ X₄ i₁ i₂ i₃ i₄ j h)
        f =
      CategoryTheory.CategoryStruct.comp (CategoryTheory.GradedObject.Monoidal.ιTensorObj₄ X₁ X₂ X₃ X₄ i₁ i₂ i₃ i₄ j h)
        g)


@[to_additive (attr := simp, norm_cast) coe_lt_zero]
theorem coe_lt_one [LT α] {a : α} : (a : WithTop α) < 1 ↔ a < 1


@[simp] lemma strictAnti_vecEmpty : StrictAnti (vecCons a vecEmpty)


/-- A ring is isomorphic to the opposite of its opposite. -/
@[simps!]
def opOp (R : Type*) [Add R] [Mul R] : R ≃+* Rᵐᵒᵖᵐᵒᵖ

∀ (a : R), (RingEquiv.opOp R) a = MulOpposite.op (MulOpposite.op a)


theorem mul_succ (a b : Ordinal) : a * succ b = a * b + a


@[simp]
theorem preimage_coe_bot : (some : α → WithBot α) ⁻¹' {⊥} = (∅ : Set α)


theorem InfPrime.inf_le (ha : InfPrime a) : b ⊓ c ≤ a ↔ b ≤ a ∨ c ≤ a

{α : Type u_2}
[SemilatticeInf α]
{a b c : α}
(ha : InfPrime a)


@[simp]
theorem snd_comp_inr [Zero R] : snd ∘ (inr : M → tsze R M) = id

TrivSqZeroExt.snd ∘ TrivSqZeroExt.inr = id


theorem getElem_eq_getElem? (l : List α) (i : Nat) (h : i < l.length) :
    l[i] = l[i]?.get (by simp [getElem?_eq_getElem, h])

{α : Type u}
(l : List α)
(i : ℕ)
(h : i < l.length)


theorem IsCospearator.isCodetector [Balanced C] {G : C} : IsCoseparator G → IsCodetector G

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

CategoryTheory.IsCoseparator G → CategoryTheory.IsCodetector G


@[simp] lemma cast_nonpos : (q : K) ≤ 0 ↔ q ≤ 0

{K : Type u_5}
[LinearOrderedSemifield K]
{q : ℚ≥0}

↑q ≤ 0 ↔ q ≤ 0


@[simp]
lemma quotTensorEquivQuotSMul_symm_mk (I : Ideal R) (x : M) :
    (quotTensorEquivQuotSMul M I).symm (Submodule.Quotient.mk x) = 1 ⊗ₜ[R] x

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(I : Ideal R)
(x : M)


theorem imp_iff_not (hb : ¬b) : a → b ↔ ¬a


theorem tendsto_const_pure {a : Filter α} {b : β} : Tendsto (fun _ => b) a (pure b)

{α : Type u}
{β : Type v}
{a : Filter α}
{b : β}


@[to_additive (attr := measurability)]
protected theorem const_smul' {𝕜} [SMul 𝕜 β] [ContinuousConstSMul 𝕜 β]
    (hf : AEStronglyMeasurable f μ) (c : 𝕜) : AEStronglyMeasurable (fun x => c • f x) μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.AEStronglyMeasurable (fun x => c • f x) μ


@[simp] lemma comul_algebraMap (r : R) :
    comul (R := R) (algebraMap R A r) = algebraMap R (A ⊗[R] A) r

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Bialgebra R A]
(r : R)

Coalgebra.comul ((algebraMap R A) r) = (algebraMap R (A ⊗[R] A)) r


lemma truncatedSup_of_not_mem (h : a ∉ lowerClosure s) : truncatedSup s a = ⊤

{α : Type u_1}
[SemilatticeSup α]
[OrderTop α]
[DecidableRel fun x x_1 => x ≤ x_1]
{s : Finset α}
{a : α}
(h : a ∉ lowerClosure ↑s)


/-- Given a family of pairwise disjoint finite sets `t i` indexed by a finite type, the product of
`f a` over the union `⋃ i, t i` is equal to the product over all indexes `i` of the products of
`f a` over `a ∈ t i`. -/
@[to_additive
      "Given a family of pairwise disjoint finite sets `t i` indexed by a finite type, the
      sum of `f a` over the union `⋃ i, t i` is equal to the sum over all indexes `i` of the
      sums of `f a` over `a ∈ t i`."]
theorem finprod_mem_iUnion [Finite ι] {t : ι → Set α} (h : Pairwise (Disjoint on t))
    (ht : ∀ i, (t i).Finite) : ∏ᶠ a ∈ ⋃ i : ι, t i, f a = ∏ᶠ i, ∏ᶠ a ∈ t i, f a

{α : Type u_1}
{ι : Type u_3}
{M : Type u_5}
[AddCommMonoid M]
{f : α → M}
[Finite ι]
{t : ι → Set α}
(h : Pairwise (Disjoint on t))
(ht : ∀ (i : ι), (t i).Finite)

∑ᶠ (a : α) (_ : a ∈ ⋃ i, t i), f a = ∑ᶠ (i : ι) (a : α) (_ : a ∈ t i), f a


/-- The empty set is coplanar. -/
theorem coplanar_empty : Coplanar k (∅ : Set P)

(k : Type u_1)
{V : Type u_2}
(P : Type u_3)
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]


@[simp]
theorem mapMatrix_trans (f : α ≃+ β) (g : β ≃+ γ) :
    f.mapMatrix.trans g.mapMatrix = ((f.trans g).mapMatrix : Matrix m n α ≃+ _)

{m : Type u_2}
{n : Type u_3}
{α : Type v}
{β : Type w}
{γ : Type u_9}
[Add α]
[Add β]
[Add γ]
(f : α ≃+ β)
(g : β ≃+ γ)

f.mapMatrix.trans g.mapMatrix = (f.trans g).mapMatrix


theorem exists_setIndependent_of_sSup_atoms_eq_top (h : sSup { a : α | IsAtom a } = ⊤) :
    ∃ s : Set α, CompleteLattice.SetIndependent s ∧ sSup s = ⊤ ∧ ∀ ⦃a⦄, a ∈ s → IsAtom a

{α : Type u_2}
[CompleteLattice α]
[IsModularLattice α]
[IsCompactlyGenerated α]
(h : sSup {a | IsAtom a} = ⊤)

∃ s, CompleteLattice.SetIndependent s ∧ sSup s = ⊤ ∧ ∀ ⦃a : α⦄, a ∈ s → IsAtom a


@[simp]
theorem cmpUsing_eq_eq (a b : α) : cmpUsing lt a b = Ordering.eq ↔ ¬lt a b ∧ ¬lt b a

{α : Type u}
{lt : α → α → Prop}
[DecidableRel lt]
(a b : α)


@[to_additive] lemma mabs_by_cases (P : α → Prop) (h1 : P a) (h2 : P a⁻¹) : P |a|ₘ

{α : Type u_1}
[AddGroup α]
[LinearOrder α]
{a : α}
(P : α → Prop)
(h1 : P a)
(h2 : P (-a))


theorem dvd_iff_exists_eq_mul_left : a ∣ b ↔ ∃ c, b = c * a

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


/-- If `β` is a group, then any function from `α` to `β` extends uniquely to a group homomorphism
from the free group over `α` to `β` -/
@[to_additive (attr := simps symm_apply)
  "If `β` is an additive group, then any function from `α` to `β` extends uniquely to an
  additive group homomorphism from the free additive group over `α` to `β`"]
def lift : (α → β) ≃ (FreeGroup α →* β)

{α : Type u}
{β : Type v}
[AddGroup β]
(g : FreeAddGroup α →+ β)

∀ (a : α), FreeAddGroup.lift.symm g a = (⇑g ∘ FreeAddGroup.of) a


/-- Write the iterated Fréchet derivative as the composition of a continuous linear equiv and the
iterated derivative. -/
theorem iteratedFDeriv_eq_equiv_comp : iteratedFDeriv 𝕜 n f =
    ContinuousMultilinearMap.piFieldEquiv 𝕜 (Fin n) F ∘ iteratedDeriv n f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ}
{f : 𝕜 → F}

iteratedFDeriv 𝕜 n f = ⇑(ContinuousMultilinearMap.piFieldEquiv 𝕜 (Fin n) F) ∘ iteratedDeriv n f


@[simp]
theorem casesOn_mk' {r : M F → Sort*} {a} (x : F.B a → M F)
    (f : ∀ (a) (f : F.B a → M F), r (M.mk ⟨a, f⟩)) :
    PFunctor.M.casesOn' (M.mk ⟨a, x⟩) f = f a x

(f : (a : F.A) → (f : F.B a → F.M) → r (PFunctor.M.mk ⟨a, f⟩))

(PFunctor.M.mk ⟨a, x⟩).casesOn' f = f a x


@[simp high, mfld_simps]
theorem symmL_model_space (b b' : F) :
    (trivializationAt F (TangentSpace 𝓘(𝕜, F)) b).symmL 𝕜 b' = (1 : F →L[𝕜] F)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_8}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(b b' : F)

Trivialization.symmL 𝕜 (trivializationAt F (TangentSpace 𝓘(𝕜, F)) b) b' = 1


/-- See `LinearIndependent.fin_cons'` for an uglier version that works if you
only have a module over a semiring. -/
theorem LinearIndependent.fin_cons {n} {v : Fin n → V} (hv : LinearIndependent K v)
    (hx : x ∉ Submodule.span K (range v)) : LinearIndependent K (Fin.cons x v : Fin (n + 1) → V)

(hx : x ∉ Submodule.span K (Set.range v))


@[to_additive]
theorem tendsto_norm_one : Tendsto (fun a : E => ‖a‖) (𝓝 1) (𝓝 0)

Filter.Tendsto (fun a => ‖a‖) (𝓝 1) (𝓝 0)


@[simp] theorem getElem_cons_zero (a : α) (as : List α) (h : 0 < (a :: as).length) : getElem (a :: as) 0 h = a

{α : Type u_1}
(a : α)
(as : List α)
(h : 0 < (a :: as).length)


/-- A version of `ContDiffBump.nonneg` with `x` explicit -/
theorem nonneg' (x : E) : 0 ≤ f x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[HasContDiffBump E]
{c : E}
(f : ContDiffBump c)
(x : E)


theorem one_le_norm_one (β) [NormedRing β] [Nontrivial β] : 1 ≤ ‖(1 : β)‖

(β : Type u_5)
[NormedRing β]
[Nontrivial β]


theorem mem_closure_iff_frequently : x ∈ closure s ↔ ∃ᶠ x in 𝓝 x, x ∈ s

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

x ∈ closure s ↔ ∃ᶠ (x : X) in 𝓝 x, x ∈ s