theorem get_unfolds_head_tail : ∀ (n : ℕ) (s : Stream' α),
    get (unfolds head tail s) n = get s n

(Stream'.unfolds Stream'.head Stream'.tail s).get n = s.get n


theorem ContDiffWithinAt.inner (hf : ContDiffWithinAt ℝ n f s x) (hg : ContDiffWithinAt ℝ n g s x) :
    ContDiffWithinAt ℝ n (fun x => ⟪f x, g x⟫) s x

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

ContDiffWithinAt ℝ n (fun x => ⟪f x, g x⟫_𝕜) s x


@[to_additive (attr := simp)]
theorem mk_mul_mk [Mul M] [Mul N] (a₁ a₂ : M) (b₁ b₂ : N) :
    (a₁, b₁) * (a₂, b₂) = (a₁ * a₂, b₁ * b₂)

{M : Type u_5}
{N : Type u_6}
[Mul M]
[Mul N]
(a₁ a₂ : M)
(b₁ b₂ : N)


lemma deriv_negMulLog {x : ℝ} (hx : x ≠ 0) : deriv negMulLog x = - log x - 1

deriv Real.negMulLog x = -Real.log x - 1


/-- **Cauchy integral formula**: if `f : ℂ → ℂ` is continuous on a closed disc of radius `R` and is
complex differentiable at all but countably many points of its interior, then for any `w` in this
interior we have $\oint_{|z-c|=R}\frac{f(z)}{z-w}dz=2\pi i\,f(w)$.
-/
theorem circleIntegral_div_sub_of_differentiable_on_off_countable {R : ℝ} {c w : ℂ} {s : Set ℂ}
    (hs : s.Countable) (hw : w ∈ ball c R) {f : ℂ → ℂ} (hc : ContinuousOn f (closedBall c R))
    (hd : ∀ z ∈ ball c R \ s, DifferentiableAt ℂ f z) :
    (∮ z in C(c, R), f z / (z - w)) = 2 * π * I * f w

(hc : ContinuousOn f (Metric.closedBall c R))

(hd : ∀ z ∈ Metric.ball c R \ s, DifferentiableAt ℂ f z)

(∮ (z : ℂ) in C(c, R), f z / (z - w)) = 2 * ↑π * Complex.I * f w


theorem le.intro {n m k : Nat} (h : n + k = m) : n ≤ m


lemma le_dual_iff :
    I ≤ dual A K J ↔ I * J ≤ dual A K 1

(A : Type u_1)
(K : Type u_2)
{L : Type u}
{B : Type u_3}
[CommRing A]
[Field K]
[CommRing B]
[Field L]
[Algebra A K]
[Algebra B L]
[Algebra A B]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[IsScalarTower A B L]
[IsDomain A]
[IsFractionRing A K]
[IsIntegralClosure B A L]
[IsFractionRing B L]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]
[IsIntegrallyClosed A]
[IsDedekindDomain B]
{I J : FractionalIdeal B⁰ L}
(hJ : J ≠ 0)

I ≤ FractionalIdeal.dual A K J ↔ I * J ≤ FractionalIdeal.dual A K 1


theorem trans_refl_restr' (s : Set β) :
    e.trans ((PartialEquiv.refl β).restr s) = e.restr (e.source ∩ e ⁻¹' s)

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

e.trans ((PartialEquiv.refl β).restr s) = e.restr (e.source ∩ ↑e ⁻¹' s)


@[simp]
theorem orderedInsert_nil (a : α) : [].orderedInsert r a = [a]

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


theorem ofInt_add {n} (x y : Int) : BitVec.ofInt n (x + y) =
    BitVec.ofInt n x + BitVec.ofInt n y


theorem neg_one_ne_one {n : ℕ} [Fact (2 < n)] : (-1 : ZMod n) ≠ 1


theorem fderiv_clm_apply (hc : DifferentiableAt 𝕜 c x) (hu : DifferentiableAt 𝕜 u x) :
    fderiv 𝕜 (fun y => (c y) (u y)) x = (c x).comp (fderiv 𝕜 u x) + (fderiv 𝕜 c x).flip (u x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{x : E}
{H : Type u_6}
[NormedAddCommGroup H]
[NormedSpace 𝕜 H]
{c : E → G →L[𝕜] H}
{u : E → G}
(hc : DifferentiableAt 𝕜 c x)
(hu : DifferentiableAt 𝕜 u x)


theorem mem_specialOrthogonalGroup_iff :
    A ∈ specialOrthogonalGroup n β ↔ A ∈ orthogonalGroup n β ∧ A.det = 1

{n : Type u}
[DecidableEq n]
[Fintype n]
{β : Type v}
[CommRing β]
{A : Matrix n n β}

A ∈ Matrix.specialOrthogonalGroup n β ↔ A ∈ Matrix.orthogonalGroup n β ∧ A.det = 1


theorem finallySmall_of_final_of_essentiallySmall [EssentiallySmall.{w} K] : FinallySmall.{w} J

[CategoryTheory.EssentiallySmall.{w, v₁, u₁} K]


/-- The functor `Square C ⥤ Square D` induced by a functor `C ⥤ D`. -/
@[simps]
def mapSquare (F : C ⥤ D) : Square C ⥤ Square D

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

∀ {X Y : CategoryTheory.Square C} (φ : X ⟶ Y), ((CategoryTheory.Functor.mapSquare C F).map φ).τ₄ = F.map φ.τ₄


theorem tendsto_atTop_atBot_of_antitone [Preorder α] [Preorder β] {f : α → β} (hf : Antitone f)
    (h : ∀ b, ∃ a, f a ≤ b) : Tendsto f atTop atBot

{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
{f : α → β}
(hf : Antitone f)
(h : ∀ (b : β), ∃ a, f a ≤ b)

Filter.Tendsto f Filter.atTop Filter.atBot


theorem rel_id (i : I) : rel R A (ι R <| lof R I A i 1) 1

{I : Type u}
[DecidableEq I]
(R : Type v)
[CommSemiring R]
(A : I → Type w)
[(i : I) → Semiring (A i)]
[(i : I) → Algebra R (A i)]
(i : I)

LinearAlgebra.FreeProduct.rel R A ((TensorAlgebra.ι R) ((DirectSum.lof R I A i) 1)) 1


lemma closedBall_zero' (x : α) : closedBall x 0 = closure {x}

{α : Type u_2}
[PseudoMetricSpace α]
(x : α)


theorem arctan_mem_Ioo (x : ℝ) : arctan x ∈ Ioo (-(π / 2)) (π / 2)

Real.arctan x ∈ Set.Ioo (-(Real.pi / 2)) (Real.pi / 2)


@[fun_prop]
protected theorem continuousAt {a : R} : ContinuousAt (fun x => p.eval x) a

{R : Type u_1}
[Semiring R]
[TopologicalSpace R]
[TopologicalSemiring R]
(p : Polynomial R)
{a : R}

ContinuousAt (fun x => Polynomial.eval x p) a


@[to_additive]
theorem Subgroup.of_normal [Group G] (s : Set G) (h : IsSubgroup s) (n : IsNormalSubgroup s) :
    Subgroup.Normal (Subgroup.of h)

{G : Type u_1}
[AddGroup G]
(s : Set G)
(h : IsAddSubgroup s)
(n : IsNormalAddSubgroup s)


/-- A prefunctor canonically defines a prefunctor of the symmetrifications. -/
@[simps]
def _root_.Prefunctor.symmetrify (φ : U ⥤q V) : Symmetrify U ⥤q Symmetrify V

{U : Type u_1}
{V : Type u_2}
[Quiver U]
[Quiver V]
(φ : U ⥤q V)


@[simp, norm_cast] lemma coe_top : (⊤ : G.Finsubgraph) = (⊤ : G.Subgraph)

{V : Type u}
{G : SimpleGraph V}
[Finite V]


theorem HasFDerivWithinAt.cexp (hf : HasFDerivWithinAt f f' s x) :
    HasFDerivWithinAt (fun x => Complex.exp (f x)) (Complex.exp (f x) • f') s x

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


/-- Two maps into a wide equalizer are equal if they are equal when composed with the wide
    equalizer map. -/
@[ext]
theorem wideEqualizer.hom_ext [Nonempty J] {W : C} {k l : W ⟶ wideEqualizer f}
    (h : k ≫ wideEqualizer.ι f = l ≫ wideEqualizer.ι f) : k = l

{k l : W ⟶ CategoryTheory.Limits.wideEqualizer f}

(h :
  CategoryTheory.CategoryStruct.comp k (CategoryTheory.Limits.wideEqualizer.ι f) =
    CategoryTheory.CategoryStruct.comp l (CategoryTheory.Limits.wideEqualizer.ι f))


@[simp]
theorem zero_seq (x : FreeAbelianGroup α) : (0 : FreeAbelianGroup (α → β)) <*> x = 0


@[simp] lemma unop_inv_leftUnitor (X : Cᵒᵖ) : (λ_ X).inv.unop = (λ_ (unop X)).hom

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

(CategoryTheory.MonoidalCategory.leftUnitor X).inv.unop =
  (CategoryTheory.MonoidalCategory.leftUnitor (Opposite.unop X)).hom


/-- Representation of a difference of two squares in a commutative ring as a product. -/
theorem mul_self_sub_mul_self [CommRing R] (a b : R) : a * a - b * b = (a + b) * (a - b)


@[reassoc]
theorem PreservesPullback.iso_hom_snd :
    (PreservesPullback.iso G f g).hom ≫ pullback.snd _ _ = G.map (pullback.snd f g)

[CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan f g) G]

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

(CategoryTheory.Limits.PreservesPullback.iso G f g).hom ≫ CategoryTheory.Limits.pullback.snd (G.map f) (G.map g) =
  G.map (CategoryTheory.Limits.pullback.snd f g)


/-- If `X` has a basis consisting of compact opens, then an open set in `X` is compact open iff
it is a finite union of some elements in the basis -/
theorem isLindelof_open_iff_eq_countable_iUnion_of_isTopologicalBasis (b : ι → Set X)
    (hb : IsTopologicalBasis (Set.range b)) (hb' : ∀ i, IsLindelof (b i)) (U : Set X) :
    IsLindelof U ∧ IsOpen U ↔ ∃ s : Set ι, s.Countable ∧ U = ⋃ i ∈ s, b i

(hb : TopologicalSpace.IsTopologicalBasis (Set.range b))

IsLindelof U ∧ IsOpen U ↔ ∃ s, s.Countable ∧ U = ⋃ i ∈ s, b i


@[to_additive]
lemma fn_min_mul_fn_max  (f : α → β) (a b : α) : f (min a b) * f (max a b) = f a * f b

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[CommSemigroup β]
(f : α → β)
(a b : α)


theorem ContinuousAt.comp_lowerSemicontinuousAt {g : γ → δ} {f : α → γ} (hg : ContinuousAt g (f x))
    (hf : LowerSemicontinuousAt f x) (gmon : Monotone g) : LowerSemicontinuousAt (g ∘ f) x

{α : Type u_1}
[TopologicalSpace α]
{x : α}
{γ : Type u_3}
[LinearOrder γ]
[TopologicalSpace γ]
[OrderTopology γ]
{δ : Type u_4}
[LinearOrder δ]
[TopologicalSpace δ]
[OrderTopology δ]
{g : γ → δ}
{f : α → γ}
(hg : ContinuousAt g (f x))
(hf : LowerSemicontinuousAt f x)
(gmon : Monotone g)


lemma EssFiniteType.of_comp [h : EssFiniteType R T] : EssFiniteType S T

(R : Type u_1)
(S : Type u_2)
(T : Type u_3)
[CommRing R]
[CommRing S]
[CommRing T]
[Algebra R S]
[Algebra R T]
[Algebra S T]
[IsScalarTower R S T]
[h : Algebra.EssFiniteType R T]


/-- A function is `C^(n + 1)` on a domain iff locally, it has a derivative which is `C^n`. -/
theorem contDiffOn_succ_iff_hasFDerivWithinAt {n : ℕ} :
    ContDiffOn 𝕜 (n + 1 : ℕ) f s ↔
      ∀ x ∈ s, ∃ u ∈ 𝓝[insert x s] x, ∃ f' : E → E →L[𝕜] F,
        (∀ x ∈ u, HasFDerivWithinAt f (f' x) u x) ∧ ContDiffOn 𝕜 n f' u

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{n : ℕ}

ContDiffOn 𝕜 (↑(n + 1)) f s ↔
  ∀ x ∈ s, ∃ u ∈ 𝓝[insert x s] x, ∃ f', (∀ x ∈ u, HasFDerivWithinAt f (f' x) u x) ∧ ContDiffOn 𝕜 (↑n) f' u


theorem diam_image_le_iff {d : ℝ≥0∞} {f : β → α} {s : Set β} :
    diam (f '' s) ≤ d ↔ ∀ x ∈ s, ∀ y ∈ s, edist (f x) (f y) ≤ d

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
{d : ℝ≥0∞}
{f : β → α}
{s : Set β}

EMetric.diam (f '' s) ≤ d ↔ ∀ x ∈ s, ∀ y ∈ s, edist (f x) (f y) ≤ d


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


theorem distortion_le_of_mem (h : J ∈ π) : J.distortion ≤ π.distortion

{ι : Type u_1}
{I J : BoxIntegral.Box ι}
(π : BoxIntegral.TaggedPrepartition I)
[Fintype ι]
(h : J ∈ π)


theorem smoothWithinAt_iff_target :
    SmoothWithinAt I I' f s x ↔
      ContinuousWithinAt f s x ∧ SmoothWithinAt I 𝓘(𝕜, E') (extChartAt I' (f x) ∘ 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 : M → M'}
{s : Set M}
{x : M}

SmoothWithinAt I I' f s x ↔ ContinuousWithinAt f s x ∧ SmoothWithinAt I 𝓘(𝕜, E') (↑(extChartAt I' (f x)) ∘ f) s x


@[simp]
theorem coe_splitUpper : (splitUpper I i x : Set (ι → ℝ)) = ↑I ∩ { y | x < y i }

{ι : Type u_1}
{I : BoxIntegral.Box ι}
{i : ι}
{x : ℝ}

↑(I.splitUpper i x) = ↑I ∩ {y | x < y i}


@[reassoc (attr := simp)]
theorem kernel.lift_ι {W : C} (k : W ⟶ X) (h : k ≫ f = 0) : kernel.lift f k h ≫ kernel.ι f = k

CategoryTheory.Limits.kernel.lift f k h ≫ CategoryTheory.Limits.kernel.ι f = k


/-- Given a map `p : I → J`, this is the functor `GradedObject I C ⥤ GradedObject J C` which
sends an `I`-object `X` to the graded object `X.mapObj p` which in degree `j : J` is given
by the coproduct of those `X i` such that `p i = j`. -/
@[simps]
noncomputable def map [∀ (j : J), HasColimitsOfShape (Discrete (p ⁻¹' {j})) C] :
    GradedObject I C ⥤ GradedObject J C

[∀ (j : J), CategoryTheory.Limits.HasColimitsOfShape (CategoryTheory.Discrete ↑(p ⁻¹' {j})) C]

∀ {X Y : CategoryTheory.GradedObject I C} (φ : X ⟶ Y) (i : J),
  (CategoryTheory.GradedObject.map C p).map φ i = CategoryTheory.GradedObject.mapMap φ p i


/-- Given an orthogonal basis with respect to a bilinear map, the bilinear map is right-separating
if the basis has no elements which are self-orthogonal. -/
theorem IsOrthoᵢ.separatingRight_iff_not_isOrtho_basis_self [NoZeroSMulDivisors R M₁]
    {B : M →ₗ[R] M →ₗ[R] M₁} (v : Basis n R M) (hO : B.IsOrthoᵢ v)
    (h : ∀ i, ¬B.IsOrtho (v i) (v i)) : B.SeparatingRight

{R : Type u_1}
{M : Type u_5}
{M₁ : Type u_6}
{n : Type u_19}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup M₁]
[Module R M₁]
[NoZeroSMulDivisors R M₁]
{B : M →ₗ[R] M →ₗ[R] M₁}
(v : Basis n R M)
(hO : B.IsOrthoᵢ ⇑v)
(h : ∀ (i : n), ¬B.IsOrtho (v i) (v i))


@[simp]
lemma id_toLoc (a : C) : (𝟙 a).toLoc = 𝟙 (LocallyDiscrete.mk a)

(CategoryTheory.CategoryStruct.id a).toLoc = CategoryTheory.CategoryStruct.id { as := a }


/-- Given a monoid homomorphism `f : M →* N` and an element `x : M`, if `x` has a left inverse,
then `f x` has a left inverse too. For elements invertible on both sides see `IsUnit.map`. -/
@[to_additive
  "Given an AddMonoid homomorphism `f : M →+ N` and an element `x : M`, if `x` has
  a left inverse, then `f x` has a left inverse too. For elements invertible on both sides see
  `IsAddUnit.map`."]
theorem map_exists_left_inv (f : F) {x : M} (hx : ∃ y, y * x = 1) : ∃ y, y * f x = 1

{M : Type u_4}
{N : Type u_5}
{F : Type u_9}
[AddZeroClass M]
[AddZeroClass N]
[FunLike F M N]
[AddMonoidHomClass F M N]
(f : F)
{x : M}
(hx : ∃ y, y + x = 0)


@[to_additive]
lemma inv_mem_units (S : Submonoid M) {x : Mˣ} (h : x ∈ S.units) : x⁻¹ ∈ S.units

{M : Type u_1}
[Monoid M]
(S : Submonoid M)
{x : Mˣ}
(h : x ∈ S.units)


@[simp, mfld_simps]
theorem trans_transPartialEquiv (e : α ≃ β) (e' : β ≃ γ) (f'' : PartialEquiv γ δ) :
    (e.trans e').transPartialEquiv f'' = e.transPartialEquiv (e'.transPartialEquiv f'')

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
(e : α ≃ β)
(e' : β ≃ γ)
(f'' : PartialEquiv γ δ)


theorem range_list_map_coe (s : Set α) : range (map ((↑) : s → α)) = { l | ∀ x ∈ l, x ∈ s }

Set.range (List.map Subtype.val) = {l | ∀ x ∈ l, x ∈ s}


@[simp] theorem append_left_eq_self {x y : List α} : x ++ y = y ↔ x = []


@[simp] theorem eraseIdx_cons_succ : (a::as).eraseIdx (i+1) = a :: as.eraseIdx i

∀ {α : Type u_1} {a : α} {as : List α} {i : Nat}, (a :: as).eraseIdx (i + 1) = a :: as.eraseIdx i


private noncomputable irreducible_def inv' : ℝ → ℝ

∀ (x : ℝ),
  Real.inv' x =
    match x with
    | { cauchy := a } => { cauchy := a⁻¹ }


theorem arccos_inj {x y : ℝ} (hx₁ : -1 ≤ x) (hx₂ : x ≤ 1) (hy₁ : -1 ≤ y) (hy₂ : y ≤ 1) :
    arccos x = arccos y ↔ x = y


/-- A functor between based categories is a functor between the underlying categories that commutes
with the projections. -/
structure BasedFunctor (𝒳 : BasedCategory.{v₂, u₂} 𝒮) (𝒴 : BasedCategory.{v₃, u₃} 𝒮) extends
    𝒳.obj ⥤ 𝒴.obj where
  w : toFunctor ⋙ 𝒴.p = 𝒳.p := by aesop_cat

(self : CategoryTheory.BasedFunctor 𝒳 𝒴)


@[to_additive (attr := simps tensorObj_as leftUnitor rightUnitor associator) Discrete.addMonoidal]
instance Discrete.monoidal : MonoidalCategory (Discrete M)

(M : Type u)
[Monoid M]
(X : CategoryTheory.Discrete M)

λ_ X = CategoryTheory.Discrete.eqToIso ⋯


@[simp, norm_cast]
theorem coe_sub : ((x - y : R) : ℍ[R]) = x - y


theorem arg_mul_cos_add_sin_mul_I_coe_angle {r : ℝ} (hr : 0 < r) (θ : Real.Angle) :
    (arg (r * (Real.Angle.cos θ + Real.Angle.sin θ * I)) : Real.Angle) = θ

↑(↑r * (↑θ.cos + ↑θ.sin * Complex.I)).arg = θ


/-- Möbius inversion for functions to a `Ring`, where the equalities only hold on a well-behaved
set. -/
theorem sum_eq_iff_sum_mul_moebius_eq_on [Ring R] {f g : ℕ → R}
    (s : Set ℕ) (hs : ∀ m n, m ∣ n → n ∈ s → m ∈ s) :
    (∀ n > 0, n ∈ s → (∑ i ∈ n.divisors, f i) = g n) ↔
      ∀ n > 0, n ∈ s →
        (∑ x ∈ n.divisorsAntidiagonal, (μ x.fst : R) * g x.snd) = f n

(hs : ∀ (m n : ℕ), m ∣ n → n ∈ s → m ∈ s)

(∀ n > 0, n ∈ s → ∑ i ∈ n.divisors, f i = g n) ↔
  ∀ n > 0, n ∈ s → ∑ x ∈ n.divisorsAntidiagonal, ↑(ArithmeticFunction.moebius x.1) * g x.2 = f n


@[simp] theorem neg_const {l : LinearCombo} : (-l).const = -l.const


theorem sUnion_eq_univ_iff {c : Set (Set α)} : ⋃₀c = univ ↔ ∀ a, ∃ b ∈ c, a ∈ b

⋃₀ c = Set.univ ↔ ∀ (a : α), ∃ b ∈ c, a ∈ b


@[local simp] protected theorem add_left_neg : ∀ a : Int, -a + a = 0


lemma eq_sqrt' : a = sqrt n ↔ a ^ 2 ≤ n ∧ n < (a + 1) ^ 2

a = n.sqrt ↔ a ^ 2 ≤ n ∧ n < (a + 1) ^ 2


theorem Surjective.of_comp_left {g : γ → α} (S : Surjective (f ∘ g)) (hf : Injective f) :
    Surjective g

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
{f : α → β}
{g : γ → α}
(S : Function.Surjective (f ∘ g))
(hf : Function.Injective f)


@[to_additive]
protected theorem congr_arg {f : MulEquiv M N} {x x' : M} : x = x' → f x = f x'

{M : Type u_6}
{N : Type u_7}
[Add M]
[Add N]
{f : M ≃+ N}
{x x' : M}


/-- Graph homomorphisms induce a covariant function on subgraphs. -/
@[simps]
protected def map {G' : SimpleGraph W} (f : G →g G') (H : G.Subgraph) : G'.Subgraph

{V : Type u}
{W : Type v}
{G : SimpleGraph V}
{G' : SimpleGraph W}
(f : G →g G')
(H : G.Subgraph)

∀ (a a_1 : W), (SimpleGraph.Subgraph.map f H).Adj a a_1 = Relation.Map H.Adj (⇑f) (⇑f) a a_1


theorem Perm.eqv (α) : Equivalence (@Perm α)


/-- A short complex `S` has homology when there exists a `S.HomologyData` -/
class HasHomology : Prop where
  /-- the condition that there exists a homology data -/
  condition : Nonempty S.HomologyData


/-- The ring version of `AddMonoidAlgebra.addMonoidAlgebraEquivDirectSum`.  -/
@[simps (config := .asFn)]
def addMonoidAlgebraRingEquivDirectSum [DecidableEq ι] [AddMonoid ι] [Semiring M]
    [∀ m : M, Decidable (m ≠ 0)] : AddMonoidAlgebra M ι ≃+* ⨁ _ : ι, M

{ι : Type u_1}
{M : Type u_3}
[DecidableEq ι]
[AddMonoid ι]
[Semiring M]
[(m : M) → Decidable (m ≠ 0)]


@[simp, norm_cast]
theorem coe_finset_prod {s : Finset α} {f : α → ℝ≥0} : ↑(∏ a ∈ s, f a) = ∏ a ∈ s, (f a : ℝ≥0∞)

{α : Type u_1}
{s : Finset α}
{f : α → ℝ≥0}


lemma finSuccAboveOrderIso_symm_apply_ne_last {p : Fin (n + 1)} (h : p ≠ Fin.last n)
    (x : { x : Fin (n + 1) // x ≠ p }) :
    (finSuccAboveEquiv p).symm x = (p.castLT (Fin.val_lt_last h)).predAbove x

{n : ℕ}
{p : Fin (n + 1)}
(h : p ≠ Fin.last n)
(x : { x // x ≠ p })

(finSuccAboveEquiv p).symm x = (p.castLT ⋯).predAbove ↑x


/-- Given an arbitrary set `s`, then `μ (s ∩ closedBall x r) / μ (closedBall x r)` converges
to `1` when `r` tends to `0`, for almost every `x` in `s`.
This shows that almost every point of `s` is a Lebesgue density point for `s`.
A stronger version holds for measurable sets, see `ae_tendsto_measure_inter_div_of_measurableSet`.

See also `IsUnifLocDoublingMeasure.ae_tendsto_measure_inter_div`. -/
theorem ae_tendsto_measure_inter_div (μ : Measure β) [IsLocallyFiniteMeasure μ] (s : Set β) :
    ∀ᵐ x ∂μ.restrict s,
      Tendsto (fun r => μ (s ∩ closedBall x r) / μ (closedBall x r)) (𝓝[>] 0) (𝓝 1)

∀ᵐ (x : β) ∂μ.restrict s,
  Filter.Tendsto (fun r => μ (s ∩ Metric.closedBall x r) / μ (Metric.closedBall x r)) (𝓝[>] 0) (𝓝 1)


theorem toFun_eq_coe {f : BiheytingHom α β} : f.toFun = (f : α → β)

{α : Type u_2}
{β : Type u_3}
[BiheytingAlgebra α]
[BiheytingAlgebra β]
{f : BiheytingHom α β}


@[simp]
theorem continuousAt_update_same [DecidableEq α] {f : α → β} {x : α} {y : β} :
    ContinuousAt (Function.update f x y) x ↔ Tendsto f (𝓝[≠] x) (𝓝 y)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[DecidableEq α]
{f : α → β}
{x : α}
{y : β}

ContinuousAt (Function.update f x y) x ↔ Filter.Tendsto f (𝓝[≠] x) (𝓝 y)


@[simp]
lemma unitization_algebraMap (r : 𝕜) :
    WithLp.equiv 1 _ (algebraMap 𝕜 (WithLp 1 (Unitization 𝕜 A)) r) =
      algebraMap 𝕜 (Unitization 𝕜 A) r

{𝕜 : Type u_1}
{A : Type u_2}
[NormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[IsScalarTower 𝕜 A A]
[SMulCommClass 𝕜 A A]
(r : 𝕜)

(WithLp.equiv 1 (Unitization 𝕜 A)) ((algebraMap 𝕜 (WithLp 1 (Unitization 𝕜 A))) r) = (algebraMap 𝕜 (Unitization 𝕜 A)) r


theorem _root_.HasCompactSupport.hasDerivAt_convolution_right (hf : LocallyIntegrable f₀ μ)
    (hcg : HasCompactSupport g₀) (hg : ContDiff 𝕜 1 g₀) (x₀ : 𝕜) :
    HasDerivAt (f₀ ⋆[L, μ] g₀) ((f₀ ⋆[L, μ] deriv g₀) x₀) x₀

(hf : MeasureTheory.LocallyIntegrable f₀ μ)

HasDerivAt (MeasureTheory.convolution f₀ g₀ L μ) (MeasureTheory.convolution f₀ (deriv g₀) L μ x₀) x₀


nonrec theorem map {p q : Path x₀ x₁} (h : p.Homotopic q) (f : C(X, Y)) :
    Homotopic (p.map f.continuous) (q.map f.continuous)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{x₀ x₁ : X}
{p q : Path x₀ x₁}
(h : p.Homotopic q)
(f : C(X, Y))


@[simp, norm_cast]
theorem disjoint_coe : Disjoint (a : α) b ↔ Disjoint a b

{α : Type u_1}
[DistribLattice α]
[BoundedOrder α]
{a b : Complementeds α}


theorem maximals_mono [IsAntisymm α r₂] (h : ∀ a b, r₁ a b → r₂ a b) :
    maximals r₂ s ⊆ maximals r₁ s

{α : Type u_1}
{r₁ r₂ : α → α → Prop}
{s : Set α}
[IsAntisymm α r₂]
(h : ∀ (a b : α), r₁ a b → r₂ a b)


theorem lift'_iInf [Nonempty ι] {f : ι → Filter α} {g : Set α → Set β}
    (hg : ∀ s t, g (s ∩ t) = g s ∩ g t) : (iInf f).lift' g = ⨅ i, (f i).lift' g

(hg : ∀ (s t : Set α), g (s ∩ t) = g s ∩ g t)


lemma StrictMono.image_Ico_subset (h : StrictMono f) : f '' Ico a b ⊆ Ico (f a) (f b)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[PartialOrder α]
[Preorder β]
{a b : α}
(h : StrictMono f)


theorem tsum_le_of_sum_range_le {f : ℕ → ℝ≥0} {c : ℝ≥0}
    (h : ∀ n, ∑ i ∈ Finset.range n, f i ≤ c) : ∑' n, f n ≤ c

(h : ∀ (n : ℕ), ∑ i ∈ Finset.range n, f i ≤ c)


theorem lookmap_congr {f g : α → Option α} :
    ∀ {l : List α}, (∀ a ∈ l, f a = g a) → l.lookmap f = l.lookmap g

{α : Type u}
{f g : α → Option α}
{l : List α}

(∀ (a : α), a ∈ l → f a = g a) → List.lookmap f l = List.lookmap g l


theorem strongMono_of_mono [StrongMonoCategory C] (f : P ⟶ Q) [Mono f] : StrongMono f

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


theorem subset_insert_iff_of_not_mem (h : a ∉ s) : s ⊆ insert a t ↔ s ⊆ t

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


@[csimp] theorem product_eq_productTR : @product = @productTR


protected theorem analyticAt_bilinear (f : E →L[𝕜] F →L[𝕜] G) (x : E × F) :
    AnalyticAt 𝕜 (fun x : E × F => f x.1 x.2) 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 →L[𝕜] F →L[𝕜] G)
(x : E × F)


/-- Restatement of `jacobiTheta₂'_add_left'`: the function `jacobiTheta₂''` is 1-periodic in `z`. -/
lemma jacobiTheta₂''_add_left (z τ : ℂ) : jacobiTheta₂'' (z + 1) τ = jacobiTheta₂'' z τ

HurwitzZeta.jacobiTheta₂'' (z + 1) τ = HurwitzZeta.jacobiTheta₂'' z τ


/-- The dart with reversed orientation from a given dart. -/
@[simps]
def Dart.symm (d : G.Dart) : G.Dart

{V : Type u_1}
{G : SimpleGraph V}
(d : G.Dart)


@[simp]
theorem prod_sup : s ×ˢ (t₁ ⊔ t₂) = s ×ˢ t₁ ⊔ s ×ˢ t₂

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(s : LowerSet α)
(t₁ t₂ : LowerSet β)

s ×ˢ (t₁ ⊔ t₂) = s ×ˢ t₁ ⊔ s ×ˢ t₂


@[to_additive (attr := continuity, fun_prop)]
theorem continuous_mul : Continuous fun p : M × M => p.1 * p.2

{M : Type u_3}
[TopologicalSpace M]
[Add M]
[ContinuousAdd M]


lemma congr_d {d d' : M.Derivation φ} (h : d = d') {X : Dᵒᵖ} (b : R.obj X) :
    d.d b = d'.d b

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


@[simp] theorem chineseRemainderOfList_nil :
    (chineseRemainderOfList a s [] List.Pairwise.nil : ℕ) = 0

↑(Nat.chineseRemainderOfList a s [] ⋯) = 0


theorem exists_left_inverse_iff_isUnit : (∃ B, B * A = 1) ↔ IsUnit A

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


theorem not_dvd_card_ker_transferSylow : ¬p ∣ Nat.card (transferSylow P hP).ker

(hP : (↑P).normalizer ≤ Subgroup.centralizer ↑P)

¬p ∣ Nat.card ↥(MonoidHom.transferSylow P hP).ker


theorem isUnit_den_iff (x : K) : IsUnit (den A x : A) ↔ IsLocalization.IsInteger A x

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

IsUnit ↑(IsFractionRing.den A x) ↔ IsLocalization.IsInteger A x


@[simp]
theorem smul_bot (a : M) : a • (⊥ : Subsemiring R) = ⊥

{M : Type u_1}
{R : Type u_2}
[Monoid M]
[Semiring R]
[MulSemiringAction M R]
(a : M)


theorem neg_eq_self
    (R) (M) [Semiring R] [CharZero R] [AddCommGroup M] [Module R M] [NoZeroSMulDivisors R M]
    {v : M} : -v = v ↔ v = 0

(R : Type u_9)
(M : Type u_10)
[Semiring R]
[CharZero R]
[AddCommGroup M]
[Module R M]
[NoZeroSMulDivisors R M]
{v : M}


protected theorem subsingleton (e : α ≃ β) [Subsingleton β] : Subsingleton α

{α : Sort u}
{β : Sort v}
(e : α ≃ β)
[Subsingleton β]


@[to_additive (attr := simp)]
theorem quotientMapSubgroupOfOfLe_mk {A' A B' B : Subgroup G} [_hAN : (A'.subgroupOf A).Normal]
    [_hBN : (B'.subgroupOf B).Normal] (h' : A' ≤ B') (h : A ≤ B) (x : A) :
    quotientMapSubgroupOfOfLe h' h x = ↑(Subgroup.inclusion h x : B)

{G : Type u}
[Group G]
{A' A B' B : Subgroup G}
[_hAN : (A'.subgroupOf A).Normal]
[_hBN : (B'.subgroupOf B).Normal]
(h' : A' ≤ B')
(h : A ≤ B)
(x : ↥A)

(QuotientGroup.quotientMapSubgroupOfOfLe h' h) ↑x = ↑((Subgroup.inclusion h) x)


@[simp, norm_cast]
theorem coe_div :
    ((f / g : RatFunc F) : LaurentSeries F) = (f : LaurentSeries F) / (g : LaurentSeries F)

{F : Type u}
[Field F]
(f g : RatFunc F)


@[to_additive (attr := simp)]
theorem coe_singletonOneHom : (singletonOneHom : α → Finset α) = singleton


@[simp]
theorem IndepSets.union_iff {s₁ s₂ s' : Set (Set Ω)} {_mΩ : MeasurableSpace Ω}
    {κ : Kernel α Ω} {μ : Measure α} :
    IndepSets (s₁ ∪ s₂) s' κ μ ↔ IndepSets s₁ s' κ μ ∧ IndepSets s₂ s' κ μ

{α : Type u_1}
{Ω : Type u_2}
{_mα : MeasurableSpace α}
{s₁ s₂ s' : Set (Set Ω)}
{_mΩ : MeasurableSpace Ω}
{κ : ProbabilityTheory.Kernel α Ω}
{μ : MeasureTheory.Measure α}

ProbabilityTheory.Kernel.IndepSets (s₁ ∪ s₂) s' κ μ ↔
  ProbabilityTheory.Kernel.IndepSets s₁ s' κ μ ∧ ProbabilityTheory.Kernel.IndepSets s₂ s' κ μ


theorem isNoetherian_submodule {N : Submodule R M} :
    IsNoetherian R N ↔ ∀ s : Submodule R M, s ≤ N → s.FG

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{N : Submodule R M}


/-- Pigeonhole principle for measure spaces: if `s` is a `Finset` and
`∑ i ∈ s, μ (t i) > μ univ`, then one of the intersections `t i ∩ t j` is not empty. -/
theorem exists_nonempty_inter_of_measure_univ_lt_sum_measure {m : MeasurableSpace α} (μ : Measure α)
    {s : Finset ι} {t : ι → Set α} (h : ∀ i ∈ s, NullMeasurableSet (t i) μ)
    (H : μ (univ : Set α) < ∑ i ∈ s, μ (t i)) :
    ∃ i ∈ s, ∃ j ∈ s, ∃ _h : i ≠ j, (t i ∩ t j).Nonempty

(h : ∀ i ∈ s, MeasureTheory.NullMeasurableSet (t i) μ)

∃ i ∈ s, ∃ j ∈ s, ∃ (_ : i ≠ j), (t i ∩ t j).Nonempty


@[continuity]
theorem continuous_map : Continuous (Completion.map f)

{α : Type u_1}
[UniformSpace α]
{β : Type u_2}
[UniformSpace β]
{f : α → β}


theorem mod_eq_of_lt {a b : Int} (H1 : 0 ≤ a) (H2 : a < b) : mod a b = a


theorem map_injective {f : α → β} (hf : Function.Injective f) :
    Function.Injective fun M : Matrix m n α => M.map f

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


theorem geom_series_mul_one_add (x : R) (h : ‖x‖ < 1) :
    (1 + x) * ∑' i : ℕ, x ^ i = 2 * ∑' i : ℕ, x ^ i - 1

{R : Type u_4}
[NormedRing R]
[CompleteSpace R]
(x : R)
(h : ‖x‖ < 1)


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

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


@[simp] theorem self_trans_symm (e : X ≃ᵈ Y) : e.trans e.symm = refl X

{X : Type u_1}
{Y : Type u_2}
[PseudoEMetricSpace X]
[PseudoEMetricSpace Y]
(e : X ≃ᵈ Y)


@[to_additive (attr := simp)]
theorem mul_right_eq_self : a * b = a ↔ b = 1

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


/-- A canonically ordered additive monoid is an ordered commutative additive monoid
  in which the ordering coincides with the subtractibility relation,
  which is to say, `a ≤ b` iff there exists `c` with `b = a + c`.
  This is satisfied by the natural numbers, for example, but not
  the integers or other nontrivial `OrderedAddCommGroup`s. -/
class CanonicallyOrderedAddCommMonoid (α : Type*) extends OrderedAddCommMonoid α, OrderBot α where
  /-- For `a ≤ b`, there is a `c` so `b = a + c`. -/
  protected exists_add_of_le : ∀ {a b : α}, a ≤ b → ∃ c, b = a + c
  /-- For any `a` and `b`, `a ≤ a + b` -/
  protected le_self_add : ∀ a b : α, a ≤ a + b

[self : CanonicallyOrderedAddCommMonoid α]


theorem ContDiffWithinAt.mono_of_mem (h : ContDiffWithinAt 𝕜 n f s x) {t : Set E}
    (hst : s ∈ 𝓝[t] x) : ContDiffWithinAt 𝕜 n f t x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{x : E}
{n : ℕ∞}
(h : ContDiffWithinAt 𝕜 n f s x)
{t : Set E}
(hst : s ∈ 𝓝[t] x)


theorem leftMulMatrix_injective : Function.Injective (leftMulMatrix b)

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[Ring S]
[Algebra R S]
{m : Type u_3}
[Fintype m]
[DecidableEq m]
(b : Basis m R S)


protected nonrec theorem HasDerivWithinAt.star (h : HasDerivWithinAt f f' s x) :
    HasDerivWithinAt (fun x => star (f x)) (star f') s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
[StarRing 𝕜]
[TrivialStar 𝕜]
[StarAddMonoid F]
[ContinuousStar F]
[StarModule 𝕜 F]
{f' : F}
{s : Set 𝕜}
{x : 𝕜}
(h : HasDerivWithinAt f f' s x)


/-- A natural isomorphism `R₁ ≅ R₂` induces an equivalence of categories
    `Comma L R₁ ≌ Comma L R₂`. -/
@[simps!]
def mapRightIso (i : R₁ ≅ R₂) : Comma L R₁ ≌ Comma L R₂

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

((CategoryTheory.Comma.mapRightIso L i).functor.obj X).right = X.right


/-- The glue data associated with an open cover.
The canonical isomorphism `𝒰.gluedCover.glued ⟶ X` is provided by `𝒰.fromGlued`. -/
@[simps]
def gluedCover : Scheme.GlueData.{u}

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

𝒰.gluedCover.t x y = (CategoryTheory.Limits.pullbackSymmetry (𝒰.map x) (𝒰.map y)).hom


/-- The list `List.ofFn f` is strictly sorted with respect to `(· ≤ ·)` if and only if `f` is
strictly monotone. -/
@[simp] theorem sorted_lt_ofFn_iff : (ofFn f).Sorted (· < ·) ↔ StrictMono f

{n : ℕ}
{α : Type u}
{f : Fin n → α}
[Preorder α]

List.Sorted (fun x x_1 => x < x_1) (List.ofFn f) ↔ StrictMono f


theorem mem_oneCocycles_def (f : G → A) :
    f ∈ oneCocycles A ↔ ∀ g h : G, A.ρ g (f h) - f (g * h) + f g = 0

{k G : Type u}
[CommRing k]
[Group G]
{A : Rep k G}
(f : G → CoeSort.coe A)

f ∈ groupCohomology.oneCocycles A ↔ ∀ (g h : G), (A.ρ g) (f h) - f (g * h) + f g = 0


theorem algebraMap_eq_of_mem {a : A} {z : ℂ} (h : z ∈ σ a) : algebraMap ℂ A z = a

{A : Type u_2}
[NormedRing A]
[NormedAlgebra ℂ A]
(hA : ∀ {a : A}, IsUnit a ↔ a ≠ 0)
{a : A}
{z : ℂ}
(h : z ∈ spectrum ℂ a)


@[simp]
theorem quotQuotEquivQuotOfLEₐ_toRingEquiv (h : I ≤ J) :
    (quotQuotEquivQuotOfLEₐ R h : _ ⧸ J.map (Quotient.mkₐ R I) ≃+* _) = quotQuotEquivQuotOfLE h

(R : Type u)
{A : Type u_1}
[CommSemiring R]
[CommRing A]
[Algebra R A]
{I J : Ideal A}
(h : I ≤ J)

↑(DoubleQuot.quotQuotEquivQuotOfLEₐ R h) = DoubleQuot.quotQuotEquivQuotOfLE h


/-- Mapping by the composite morphism `f ≫ g` is the same as mapping by `f` then by `g`. -/
theorem mapComp_eq {X Y Z : T} (f : X ⟶ Y) (g : Y ⟶ Z) :
    map (f ≫ g) = (map g) ⋙ (map f)

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

CategoryTheory.Under.map (CategoryTheory.CategoryStruct.comp f g) =
  (CategoryTheory.Under.map g).comp (CategoryTheory.Under.map f)


theorem MDifferentiableAt.neg (hf : MDifferentiableAt I 𝓘(𝕜, E') f z) :
    MDifferentiableAt I 𝓘(𝕜, E') (-f) z

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{z : M}
{f : M → E'}
(hf : MDifferentiableAt I 𝓘(𝕜, E') f z)


@[to_additive]
theorem orderOf_dvd_natCard {G : Type*} [Group G] (x : G) : orderOf x ∣ Nat.card G


theorem superpolynomialDecay_const_mul_iff [ContinuousMul β] {c : β} (hc0 : c ≠ 0) :
    (SuperpolynomialDecay l k fun n => c * f n) ↔ SuperpolynomialDecay l k f

{α : Type u_1}
{β : Type u_2}
(l : Filter α)
(k f : α → β)
[TopologicalSpace β]
[Field β]
[ContinuousMul β]
{c : β}
(hc0 : c ≠ 0)

(Asymptotics.SuperpolynomialDecay l k fun n => c * f n) ↔ Asymptotics.SuperpolynomialDecay l k f


theorem eq_of_degrees_lt_of_eval_index_eq (hvs : Set.InjOn v s) (degree_f_lt : f.degree < s.card)
    (degree_g_lt : g.degree < s.card) (eval_fg : ∀ i ∈ s, f.eval (v i) = g.eval (v i)) : f = g

(eval_fg : ∀ i ∈ s, Polynomial.eval (v i) f = Polynomial.eval (v i) g)


theorem CompactSpace.elim_nhds_subcover [CompactSpace X] (U : X → Set X) (hU : ∀ x, U x ∈ 𝓝 x) :
    ∃ t : Finset X, ⋃ x ∈ t, U x = ⊤

{X : Type u}
[TopologicalSpace X]
[CompactSpace X]
(U : X → Set X)
(hU : ∀ (x : X), U x ∈ 𝓝 x)


theorem hnot_inf_distrib (a b : α) : ￢(a ⊓ b) = ￢a ⊔ ￢b

{α : Type u_2}
[CoheytingAlgebra α]
(a b : α)


theorem not_bddAbove_Ioi : ¬BddAbove (Ioi a)

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


@[simp, norm_cast] theorem coe_eq_one : (↑r : ℝ≥0∞) = 1 ↔ r = 1


theorem Nodup.erase_get [DecidableEq α] {l : List α} (hl : l.Nodup) (i : Fin l.length) :
    l.erase (l.get i) = l.eraseIdx ↑i

{α : Type u}
[DecidableEq α]
{l : List α}
(hl : l.Nodup)
(i : Fin l.length)


@[mono]
theorem flag_strictMono [Nontrivial R] (b : Basis (Fin n) R M) : StrictMono b.flag

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{n : ℕ}
[Nontrivial R]
(b : Basis (Fin n) R M)


/-- In an abelian category, the subobjects and quotient objects of an object `X` are
    order-isomorphic via taking kernels and cokernels.
    Implemented here using subobjects in the opposite category,
    since mathlib does not have a notion of quotient objects at the time of writing. -/
@[simps!]
def subobjectIsoSubobjectOp [Abelian C] (X : C) : Subobject X ≃o (Subobject (op X))ᵒᵈ

(a : (CategoryTheory.Subobject (Opposite.op X))ᵒᵈ)

(RelIso.symm (CategoryTheory.Abelian.subobjectIsoSubobjectOp X)) a =
  CategoryTheory.Subobject.lift (fun A f x => CategoryTheory.Subobject.mk (CategoryTheory.Limits.kernel.ι f.unop)) ⋯ a


@[simp]
theorem eval_single (r : R) (i : ℕ) (m : M) : eval r (single R i m) = r ^ i • m

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

(PolynomialModule.eval r) ((PolynomialModule.single R i) m) = r ^ i • m


@[simp] theorem cast_trans {k : Nat} (h : n = m) (h' : m = k) {i : Fin n} :
    cast h' (cast h i) = cast (Eq.trans h h') i

{n m k : Nat}
(h : n = m)
(h' : m = k)
{i : Fin n}

Fin.cast h' (Fin.cast h i) = Fin.cast ⋯ i


theorem ae_restrict_of_ae_restrict_of_subset {s t : Set α} {p : α → Prop} (hst : s ⊆ t)
    (h : ∀ᵐ x ∂μ.restrict t, p x) : ∀ᵐ x ∂μ.restrict s, p x

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t : Set α}
{p : α → Prop}
(hst : s ⊆ t)
(h : ∀ᵐ (x : α) ∂μ.restrict t, p x)


@[simp]
theorem singleton_sups : {a} ⊻ t = t.image fun b => a ⊔ b

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


theorem copy_eq (f : A →⋆ₙ+* B) (f' : A → B) (h : f' = f) : f.copy f' h = f

{A : Type u_1}
{B : Type u_2}
[NonUnitalNonAssocSemiring A]
[Star A]
[NonUnitalNonAssocSemiring B]
[Star B]
(f : A →⋆ₙ+* B)
(f' : A → B)
(h : f' = ⇑f)


theorem exists_reduced_factors' (a b : R) (hb : b ≠ 0) :
    ∃ a' b' c', IsRelPrime a' b' ∧ c' * a' = a ∧ c' * b' = b

{R : Type u_2}
[CancelCommMonoidWithZero R]
[UniqueFactorizationMonoid R]
(a b : R)
(hb : b ≠ 0)


theorem sigmaToiUnion_surjective : Surjective (sigmaToiUnion t)

{α : Type u_1}
{β : Type u_2}
(t : α → Set β)


theorem Prime.abs [LinearOrder α] {p : α} (hp : Prime p) : Prime (abs p)

{α : Type u_1}
[CommRing α]
[LinearOrder α]
{p : α}
(hp : Prime p)


lemma addContent_union (hC : IsSetRing C) (hs : s ∈ C) (ht : t ∈ C)
    (h_dis : Disjoint s t) :
    m (s ∪ t) = m s + m t

{α : Type u_1}
{C : Set (Set α)}
{s t : Set α}
{m : MeasureTheory.AddContent C}
(hC : MeasureTheory.IsSetRing C)
(hs : s ∈ C)
(ht : t ∈ C)
(h_dis : Disjoint s t)


lemma shiftFunctorAdd'_eq_shiftFunctorAdd (i j : A) :
    shiftFunctorAdd' C i j (i+j) rfl = shiftFunctorAdd C i j

(C : Type u)
{A : Type u_1}
[CategoryTheory.Category.{v, u} C]
[AddMonoid A]
[CategoryTheory.HasShift C A]
(i j : A)

CategoryTheory.shiftFunctorAdd' C i j (i + j) ⋯ = CategoryTheory.shiftFunctorAdd C i j


@[to_additive]
theorem continuousAt_const_smul_iff (c : G) :
    ContinuousAt (fun x => c • f x) b ↔ ContinuousAt f b

{α : Type u_2}
{β : Type u_3}
{G : Type u_4}
[TopologicalSpace α]
[Group G]
[MulAction G α]
[ContinuousConstSMul G α]
[TopologicalSpace β]
{f : β → α}
{b : β}
(c : G)


/-- If `f` has a formal Taylor series `p` up to order `1` on `{x} ∪ s`, where `s` is a convex set,
and `‖p x 1‖₊ < K`, then `f` is `K`-Lipschitz in a neighborhood of `x` within `s`. -/
theorem HasFTaylorSeriesUpToOn.exists_lipschitzOnWith_of_nnnorm_lt {E F : Type*}
    [NormedAddCommGroup E] [NormedSpace ℝ E] [NormedAddCommGroup F] [NormedSpace ℝ F] {f : E → F}
    {p : E → FormalMultilinearSeries ℝ E F} {s : Set E} {x : E}
    (hf : HasFTaylorSeriesUpToOn 1 f p (insert x s)) (hs : Convex ℝ s) (K : ℝ≥0)
    (hK : ‖p x 1‖₊ < K) : ∃ t ∈ 𝓝[s] x, LipschitzOnWith K f t


/-- An algebra is transcendental if some element is transcendental. -/
protected class Algebra.Transcendental : Prop :=
  transcendental : ∃ x : A, Transcendental R x

{R : Type u}
{A : Type v}
[CommRing R]
[Ring A]
[Algebra R A]
[self : Algebra.Transcendental R A]


@[to_additive]
theorem prod_map_one {l : List ι} :
    (l.map fun _ => (1 : M)).prod = 1

{ι : Type u_1}
{M : Type u_4}
[MulOneClass M]
{l : List ι}


theorem HasGroupoid.comp
    (H : ∀ e ∈ G₂, LiftPropOn (IsLocalStructomorphWithinAt G₁) (e : H₂ → H₂) e.source) :
    @HasGroupoid H₁ _ H₃ _ (ChartedSpace.comp H₁ H₂ H₃) G₁

(H : ∀ e ∈ G₂, ChartedSpace.LiftPropOn G₁.IsLocalStructomorphWithinAt (↑e) e.source)


theorem lcm_comm' [GCDMonoid α] (a b : α) : Associated (lcm a b) (lcm b a)

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


@[trans]
theorem Parallel.trans {s₁ s₂ s₃ : AffineSubspace k P} (h₁₂ : s₁ ∥ s₂) (h₂₃ : s₂ ∥ s₃) :
    s₁ ∥ s₃

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s₁ s₂ s₃ : AffineSubspace k P}
(h₁₂ : s₁ ∥ s₂)
(h₂₃ : s₂ ∥ s₃)


@[to_additive]
theorem Subgroup.Normal.eq_bot_or_eq_top [IsSimpleGroup G] {H : Subgroup G} (Hn : H.Normal) :
    H = ⊥ ∨ H = ⊤

{G : Type u_1}
[AddGroup G]
[IsSimpleAddGroup G]
{H : AddSubgroup G}
(Hn : H.Normal)


/-- The basis constructed by `unitsSMul` has vectors given by a diagonal matrix. -/
@[simp]
theorem toMatrix_unitsSMul [DecidableEq ι] (e : Basis ι R₂ M₂) (w : ι → R₂ˣ) :
    e.toMatrix (e.unitsSMul w) = diagonal ((↑) ∘ w)

{ι : Type u_1}
{R₂ : Type u_7}
{M₂ : Type u_8}
[CommRing R₂]
[AddCommGroup M₂]
[Module R₂ M₂]
[DecidableEq ι]
(e : Basis ι R₂ M₂)
(w : ι → R₂ˣ)

e.toMatrix ⇑(e.unitsSMul w) = Matrix.diagonal (Units.val ∘ w)


/-- Typeclass for algebraically closed fields.

To show `Polynomial.Splits p f` for an arbitrary ring homomorphism `f`,
see `IsAlgClosed.splits_codomain` and `IsAlgClosed.splits_domain`.
-/
class IsAlgClosed : Prop where
  splits : ∀ p : k[X], p.Splits <| RingHom.id k

{k : Type u}
[Field k]
[self : IsAlgClosed k]
(p : k[X])


@[simp]
theorem _root_.Polynomial.toLaurent_inj (f g : R[X]) : toLaurent f = toLaurent g ↔ f = g

{R : Type u_1}
[Semiring R]
(f g : R[X])

Polynomial.toLaurent f = Polynomial.toLaurent g ↔ f = g


lemma rTensor_apply_tmul_apply (p : MvPolynomial σ S) (n : N) (d : σ →₀ ℕ) :
    rTensor (p ⊗ₜ[R] n) d = (coeff d p) ⊗ₜ[R] n

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

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


protected theorem map_smul [MulSemiringAction M S] (f : R →+*[M] S) (m : M) (x : R) :
    f (m • x) = m • f x

{M : Type u_1}
[Monoid M]
{R : Type u_10}
[Semiring R]
[MulSemiringAction M R]
{S : Type u_12}
[Semiring S]
[MulSemiringAction M S]
(f : R →+*[M] S)
(m : M)
(x : R)


@[measurability]
theorem AEMeasurable.sup (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
    AEMeasurable (fun a => f a ⊔ g a) μ

{M : Type u_1}
[MeasurableSpace M]
{α : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : α → M}
[Sup M]
[MeasurableSup₂ M]
(hf : AEMeasurable f μ)
(hg : AEMeasurable g μ)


/-- The transitivity of homotopy between morphisms of short complexes. -/
@[simps]
def trans (h₁₂ : Homotopy φ₁ φ₂) (h₂₃ : Homotopy φ₂ φ₃) : Homotopy φ₁ φ₃

{φ₁ φ₂ φ₃ : S₁ ⟶ S₂}

(h₁₂ : CategoryTheory.ShortComplex.Homotopy φ₁ φ₂)

(h₂₃ : CategoryTheory.ShortComplex.Homotopy φ₂ φ₃)


@[field_simps]
theorem neg_divp (a : α) (u : αˣ) : -(a /ₚ u) = -a /ₚ u

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


theorem Nat.not_le_of_not_ble_eq_true (h : Not (Eq (Nat.ble n m) true)) : Not (LE.le n m)

{n m : Nat}
(h : Not (Eq (n.ble m) true))


theorem map_fst_add_enumFrom_eq_enumFrom (l : List α) (n k : ℕ) :
    map (Prod.map (· + n) id) (enumFrom k l) = enumFrom (n + k) l

List.map (Prod.map (fun x => x + n) id) (List.enumFrom k l) = List.enumFrom (n + k) l


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

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


lemma tendsto_rpow_atBot_of_base_lt_one (b : ℝ) (hb₀ : 0 < b) (hb₁ : b < 1) :
    Tendsto (b ^ · : ℝ → ℝ) atBot atTop

Filter.Tendsto (fun x => b ^ x) Filter.atBot Filter.atTop


@[simp]
theorem Injective.extend_apply (hf : Injective f) (g : α → γ) (e' : β → γ) (a : α) :
    extend f g e' (f a) = g a

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
{f : α → β}
(hf : Function.Injective f)
(g : α → γ)
(e' : β → γ)
(a : α)


@[to_additive (attr := simp)]
theorem mem_smulAntidiagonal :
    x ∈ SMulAntidiagonal hs ht a ↔ x.1 ∈ s ∧ x.2 ∈ t ∧ x.1 • x.2 = a

{G : Type u_1}
{P : Type u_2}
[PartialOrder G]
[PartialOrder P]
[SMul G P]
[IsOrderedCancelSMul G P]
{s : Set G}
{t : Set P}
(hs : s.IsPWO)
(ht : t.IsPWO)
(a : P)
{x : G × P}

x ∈ Finset.SMulAntidiagonal hs ht a ↔ x.1 ∈ s ∧ x.2 ∈ t ∧ x.1 • x.2 = a


theorem preimage_eq (f : α → β) (s : Set β) : f ⁻¹' s = (Function.graph f).preimage s

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


protected theorem id : IsClosedMap (@id X)


theorem mem_support_ind (x : M) (hx : x ∈ s) : x ∈ support (fs <| fs.ind x hx)

{ι : Type uι}
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{s : Set M}
(fs : SmoothBumpCovering ι I M s)
(x : M)
(hx : x ∈ s)

x ∈ Function.support ↑(fs.toFun (fs.ind x hx))


theorem monomial_zero_one : monomial R (0 : σ →₀ ℕ) 1 = 1

{σ : Type u_1}
{R : Type u_2}
[Semiring R]


lemma castLE_injective (hmn : m ≤ n) : Injective (castLE hmn)


theorem nonempty_of_encard_ne_zero (h : s.encard ≠ 0) : s.Nonempty

{α : Type u_1}
{s : Set α}
(h : s.encard ≠ 0)


@[simp]
theorem toAddMonoidHom_refl : (RingEquiv.refl R).toAddMonoidHom = AddMonoidHom.id R


@[simp]
theorem cof_cof (a : Ordinal.{u}) : cof (cof a).ord = cof a


/-- A set belongs to `coclosedCompact` if and only if the closure of its complement is compact. -/
theorem mem_coclosedCompact_iff :
    s ∈ coclosedCompact X ↔ IsCompact (closure sᶜ)

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

s ∈ Filter.coclosedCompact X ↔ IsCompact (closure sᶜ)


/-- A function which can be locally uniformly approximated by continuous functions is continuous. -/
theorem continuous_of_locally_uniform_approx_of_continuousAt
    (L : ∀ x : α, ∀ u ∈ 𝓤 β, ∃ t ∈ 𝓝 x, ∃ F, ContinuousAt F x ∧ ∀ y ∈ t, (f y, F y) ∈ u) :
    Continuous f

(L : ∀ (x : α), ∀ u ∈ 𝓤 β, ∃ t ∈ 𝓝 x, ∃ F, ContinuousAt F x ∧ ∀ y ∈ t, (f y, F y) ∈ u)


theorem smul_le_of_le (K : ConvexBody V) (h_zero : 0 ∈ K) {a b : ℝ≥0} (h : a ≤ b) :
    a • K ≤ b • K

{V : Type u_1}
[TopologicalSpace V]
[AddCommGroup V]
[Module ℝ V]
[ContinuousSMul ℝ V]
[ContinuousAdd V]
(K : ConvexBody V)
(h_zero : 0 ∈ K)
{a b : ℝ≥0}
(h : a ≤ b)


@[simp]
theorem mem_toNonUnitalSubsemiring {s : NonUnitalSubring R} {x : R} :
    x ∈ s.toNonUnitalSubsemiring ↔ x ∈ s

{R : Type u}
[NonUnitalNonAssocRing R]
{s : NonUnitalSubring R}
{x : R}


theorem iInf_inf [Nonempty ι] {f : ι → α} {a : α} : (⨅ x, f x) ⊓ a = ⨅ x, f x ⊓ a

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
[Nonempty ι]
{f : ι → α}
{a : α}


@[simp]
theorem inhomogeneousCochains.d_def (n : ℕ) :
    (inhomogeneousCochains A).d n (n + 1) = inhomogeneousCochains.d n A

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

(groupCohomology.inhomogeneousCochains A).d n (n + 1) = inhomogeneousCochains.d n A


/-- The order of the formal power series `1` is `0`. -/
@[simp]
theorem order_one : order (1 : R⟦X⟧) = 0

{R : Type u_1}
[Semiring R]
[Nontrivial R]


/-- If `G` acts properly on `X`, then the quotient space is Hausdorff (T2). -/
@[to_additive "If `G` acts properly on `X`, then the quotient space is Hausdorff (T2)."]
theorem t2Space_quotient_mulAction_of_properSMul [ProperSMul G X] :
    T2Space (Quotient (MulAction.orbitRel G X))

{G : Type u_1}
{X : Type u_2}
[AddGroup G]
[AddAction G X]
[TopologicalSpace G]
[TopologicalSpace X]
[ProperVAdd G X]

T2Space (Quotient (AddAction.orbitRel G X))


@[simp]
theorem coe_ringHom_id : (OrderRingHom.id α : α →+* α) = RingHom.id α

{α : Type u_2}
[NonAssocSemiring α]
[Preorder α]


/-- A homeomorphism induces a partial homeomorphism on the whole space -/
@[simps! (config := mfld_cfg)]
def _root_.Homeomorph.toPartialHomeomorph (e : X ≃ₜ Y) : PartialHomeomorph X Y

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : X ≃ₜ Y)


theorem foldr_toList (f : α → β → β) (xs : t α) (x : β) :
    foldr f x xs = List.foldr f x (toList xs)

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

Traversable.foldr f x xs = List.foldr f x (Traversable.toList xs)


/-- A function is `C^(n + 1)` at a point iff locally, it has a derivative which is `C^n`. -/
theorem contDiffAt_succ_iff_hasFDerivAt {n : ℕ} :
    ContDiffAt 𝕜 (n + 1 : ℕ) f x ↔
      ∃ f' : E → E →L[𝕜] F, (∃ u ∈ 𝓝 x, ∀ x ∈ u, HasFDerivAt f (f' x) x) ∧ ContDiffAt 𝕜 n f' x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{n : ℕ}

ContDiffAt 𝕜 (↑(n + 1)) f x ↔ ∃ f', (∃ u ∈ 𝓝 x, ∀ x ∈ u, HasFDerivAt f (f' x) x) ∧ ContDiffAt 𝕜 (↑n) f' x


theorem toQuadraticForm' [DecidableEq n] {M : Matrix n n ℝ} (hM : M.PosDef) :
    M.toQuadraticMap'.PosDef

{n : Type u_2}
[Fintype n]
[DecidableEq n]
{M : Matrix n n ℝ}
(hM : M.PosDef)


@[simp, norm_cast] lemma coe_pow (a : α) (n : ℕ) : (↑(a ^ n) : WithZero α) = a ^ n

{α : Type u_1}
[One α]
[Pow α ℕ]
(a : α)
(n : ℕ)


theorem applyComposition_single (p : FormalMultilinearSeries 𝕜 E F) {n : ℕ} (hn : 0 < n)
    (v : Fin n → E) : p.applyComposition (Composition.single n hn) v = fun _j => p n v

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[CommRing 𝕜]
[AddCommGroup E]
[AddCommGroup F]
[Module 𝕜 E]
[Module 𝕜 F]
[TopologicalSpace E]
[TopologicalSpace F]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
[TopologicalAddGroup F]
[ContinuousConstSMul 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)
{n : ℕ}
(hn : 0 < n)
(v : Fin n → E)

p.applyComposition (Composition.single n hn) v = fun _j => (p n) v


theorem le_of_mem_A {r ε : ℝ} {L : F} {x : ℝ} (hx : x ∈ A f L r ε) {y z : ℝ}
    (hy : y ∈ Icc x (x + r / 2)) (hz : z ∈ Icc x (x + r / 2)) :
  ‖f z - f y - (z - y) • L‖ ≤ ε * r

(hx : x ∈ RightDerivMeasurableAux.A f L r ε)


@[simp]
theorem fromEdgeSet_empty : fromEdgeSet (∅ : Set (Sym2 V)) = ⊥


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

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


/-- Relation between `Algebra.discr A ι b` and
`Algebra.discr A ((P.map (algebraMap A B)) *ᵥ b)`. -/
theorem discr_of_matrix_mulVec (b : ι → B) (P : Matrix ι ι A) :
    discr A (P.map (algebraMap A B) *ᵥ b) = P.det ^ 2 * discr A b

{A : Type u}
{B : Type v}
{ι : Type w}
[DecidableEq ι]
[CommRing A]
[CommRing B]
[Algebra A B]
[Fintype ι]
(b : ι → B)
(P : Matrix ι ι A)

Algebra.discr A (P.map ⇑(algebraMap A B) *ᵥ b) = P.det ^ 2 * Algebra.discr A b


theorem hasBasis_nhdsSet_cthickening {K : Set α} (hK : IsCompact K) :
    (𝓝ˢ K).HasBasis (fun δ : ℝ => 0 < δ) fun δ => cthickening δ K

{α : Type u}
[PseudoEMetricSpace α]
{K : Set α}
(hK : IsCompact K)

(𝓝ˢ K).HasBasis (fun δ => 0 < δ) fun δ => Metric.cthickening δ K


@[to_additive]
theorem prod_eq_mul_of_mem {s : Finset α} {f : α → β} (a b : α) (ha : a ∈ s) (hb : b ∈ s)
    (hn : a ≠ b) (h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 1) : ∏ x ∈ s, f x = f a * f b

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
{s : Finset α}
{f : α → β}
(a b : α)
(ha : a ∈ s)
(hb : b ∈ s)
(hn : a ≠ b)
(h₀ : ∀ c ∈ s, c ≠ a ∧ c ≠ b → f c = 1)


@[simp] protected theorem zero_div : 0 / a = 0


theorem closure_union (s t : Set M) : closure L (s ∪ t) = closure L s ⊔ closure L t

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

(FirstOrder.Language.Substructure.closure L).toFun (s ∪ t) =
  (FirstOrder.Language.Substructure.closure L).toFun s ⊔ (FirstOrder.Language.Substructure.closure L).toFun t


@[to_additive zsmul_mono_left]
lemma zpow_mono_right (ha : 1 ≤ a) : Monotone fun n : ℤ ↦ a ^ n

{α : Type u_1}
[OrderedAddCommGroup α]
{a : α}
(ha : 0 ≤ a)


/-- The sequence is strictly decreasing at infinite places distinct from `w₁`. -/
theorem seq_decreasing {n m : ℕ} (h : n < m) (w : InfinitePlace K) (hw : w ≠ w₁) :
    w (algebraMap (𝓞 K) K (seq K w₁ hB m)) < w (algebraMap (𝓞 K) K (seq K w₁ hB n))

(hB : NumberField.mixedEmbedding.minkowskiBound K 1 < ↑(NumberField.mixedEmbedding.convexBodyLTFactor K) * ↑B)

w ((algebraMap (𝓞 K) K) ↑(NumberField.Units.dirichletUnitTheorem.seq K w₁ hB m)) <
  w ((algebraMap (𝓞 K) K) ↑(NumberField.Units.dirichletUnitTheorem.seq K w₁ hB n))


theorem ker_closedComplemented_of_finiteDimensional_range (f : E →L[𝕜] F)
    [FiniteDimensional 𝕜 (range f)] : (ker f).ClosedComplemented

[FiniteDimensional 𝕜 ↥(LinearMap.range f)]


theorem IsGreatest.mono (ha : IsGreatest s a) (hb : IsGreatest t b) (hst : s ⊆ t) : a ≤ b

{α : Type u}
[Preorder α]
{s t : Set α}
{a b : α}
(ha : IsGreatest s a)
(hb : IsGreatest t b)
(hst : s ⊆ t)


@[simp] theorem domCongr_refl : domCongr k A (MulEquiv.refl G) = AlgEquiv.refl

(k : Type u₁)
{G : Type u₂}
[CommSemiring k]
[Monoid G]
(A : Type u₃)
[Semiring A]
[Algebra k A]

MonoidAlgebra.domCongr k A (MulEquiv.refl G) = AlgEquiv.refl


theorem prime_of_degree_eq_one (hp1 : degree p = 1) : Prime p

{R : Type u}
[Field R]
{p : R[X]}
(hp1 : p.degree = 1)


/-- The number of dependent maps `f : Π j, s j` for which the `i` component is `a` is the product
over all `j ≠ i` of `(s j).card`.

Note that this is just a composition of easier lemmas, but there's some glue missing to make that
smooth enough not to need this lemma. -/
lemma card_filter_piFinset_eq_of_mem (s : ∀ i, Finset (α i)) (i : ι) {a : α i} (ha : a ∈ s i) :
    ((piFinset s).filter fun f ↦ f i = a).card = ∏ j ∈ univ.erase i, (s j).card

{ι : Type u_4}
{α : ι → Type u_6}
[DecidableEq ι]
[Fintype ι]
[(i : ι) → DecidableEq (α i)]
(s : (i : ι) → Finset (α i))
(i : ι)
{a : α i}
(ha : a ∈ s i)

(Finset.filter (fun f => f i = a) (Fintype.piFinset s)).card = ∏ j ∈ Finset.univ.erase i, (s j).card


@[simp] theorem zero_snd : (0 : X q).2 = 0


@[simp]
theorem mem_idealOfSet_compl_singleton (x : X) (f : C(X, R)) :
    f ∈ idealOfSet R ({x}ᶜ : Set X) ↔ f x = 0

{X : Type u_1}
{R : Type u_2}
[TopologicalSpace X]
[Semiring R]
[TopologicalSpace R]
[TopologicalSemiring R]
(x : X)
(f : C(X, R))

f ∈ ContinuousMap.idealOfSet R {x}ᶜ ↔ f x = 0


theorem gcd_fib_add_mul_self (m n : ℕ) : ∀ k, gcd (fib m) (fib (n + k * m)) = gcd (fib m) (fib n)

(Nat.fib m).gcd (Nat.fib (n + k * m)) = (Nat.fib m).gcd (Nat.fib n)


theorem natCast_eq_iff (p : ℕ) (n : ℕ) (z : ZMod p) [NeZero p] :
    ↑n = z ↔ ∃ k, n = z.val + p * k


/-- A variant of `ciSup_of_empty` but with `0` on the RHS for convenience -/
protected theorem iSup_of_empty {ι} (f : ι → Cardinal) [IsEmpty ι] : iSup f = 0

{ι : Sort u_1}
(f : ι → Cardinal.{u_2})
[IsEmpty ι]


/-- Key technical lemma: the twisted inclusion `selfProdPermIncl h b` maps `a` to `F.map u b`. -/
private lemma selfProdTermIncl_fib_eq (b : F.obj A) :
    F.map u b = F.map (selfProdPermIncl h b) a

{F : CategoryTheory.Functor C FintypeCat}

{u : A ⟶ CategoryTheory.PreGaloisCategory.selfProd F X}

(h : F.map u a = CategoryTheory.PreGaloisCategory.mkSelfProdFib F X)

F.map u b = F.map (CategoryTheory.PreGaloisCategory.selfProdPermIncl h b) a


/-- An angle in a right-angled triangle is at most `π / 2`. -/
theorem angle_le_pi_div_two_of_angle_eq_pi_div_two {p₁ p₂ p₃ : P} (h : ∠ p₁ p₂ p₃ = π / 2) :
    ∠ p₂ p₃ p₁ ≤ π / 2

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p₁ p₂ p₃ : P}
(h : ∠ p₁ p₂ p₃ = π / 2)

∠ p₂ p₃ p₁ ≤ π / 2


lemma map_isZero (F : C ⥤ D) [PreservesZeroMorphisms F] {X : C} (hX : IsZero X) :
    IsZero (F.obj X)


/-- `Finsupp.toDFinsupp` and `DFinsupp.toFinsupp` together form an equiv. -/
@[simps (config := .asFn)]
def finsuppEquivDFinsupp [DecidableEq ι] [Zero M] [∀ m : M, Decidable (m ≠ 0)] :
    (ι →₀ M) ≃ Π₀ _ : ι, M

{ι : Type u_1}
{M : Type u_3}
[DecidableEq ι]
[Zero M]
[(m : M) → Decidable (m ≠ 0)]


theorem unbounded_gt_iff_unbounded_ge [Preorder α] [NoMinOrder α] :
    Unbounded (· > ·) s ↔ Unbounded (· ≥ ·) s

{α : Type u_1}
{s : Set α}
[Preorder α]
[NoMinOrder α]

Set.Unbounded (fun x x_1 => x > x_1) s ↔ Set.Unbounded (fun x x_1 => x ≥ x_1) s


theorem zip_append :
    ∀ {l₁ r₁ : List α} {l₂ r₂ : List β} (_h : length l₁ = length l₂),
      zip (l₁ ++ r₁) (l₂ ++ r₂) = zip l₁ l₂ ++ zip r₁ r₂

{α : Type u_1}
{β : Type u_2}
{l₁ r₁ : List α}
{l₂ r₂ : List β}
(_h : l₁.length = l₂.length)

(l₁ ++ r₁).zip (l₂ ++ r₂) = l₁.zip l₂ ++ r₁.zip r₂


@[simp]  -- Porting note: norm_cast
theorem comp_coe [Module R M] [Module R M₂] [Module R M₃] (f : M ≃ₗ[R] M₂) (f' : M₂ ≃ₗ[R] M₃) :
    (f' : M₂ →ₗ[R] M₃).comp (f : M →ₗ[R] M₂) = (f.trans f' : M ≃ₗ[R] M₃)

{R : Type u_1}
{M : Type u_8}
{M₂ : Type u_10}
{M₃ : Type u_11}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R M]
[Module R M₂]
[Module R M₃]
(f : M ≃ₗ[R] M₂)
(f' : M₂ ≃ₗ[R] M₃)


@[simp]
theorem rank_bot : Module.rank R (⊥ : Submodule R M) = 0

(R : Type u)
(M : Type v)
[Ring R]
[AddCommGroup M]
[Module R M]
[Nontrivial R]


theorem completeSpace_coe_iff_isComplete {s : Set α} : CompleteSpace s ↔ IsComplete s

{α : Type u}
[UniformSpace α]
{s : Set α}


lemma ιTotalOrZero_eq (i₁ : I₁) (i₂ : I₂) (i₁₂ : I₁₂)
    (h : ComplexShape.π c₁ c₂ c₁₂ (i₁, i₂) = i₁₂) :
    K.ιTotalOrZero c₁₂ i₁ i₂ i₁₂ = K.ιTotal c₁₂ i₁ i₂ i₁₂ h

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


@[simp]
theorem length_listTransvecCol : (listTransvecCol M).length = r

(M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜)

(Matrix.Pivot.listTransvecCol M).length = r


@[simp] theorem toEquiv_inj {e₁ e₂ : α ≃ᵢ β} : e₁.toEquiv = e₂.toEquiv ↔ e₁ = e₂

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{e₁ e₂ : α ≃ᵢ β}


@[to_additive (attr := simp)]
theorem edist_mul_left [Mul M] [PseudoEMetricSpace M] [IsometricSMul M M] (a b c : M) :
    edist (a * b) (a * c) = edist b c

{M : Type u}
[Mul M]
[PseudoEMetricSpace M]
[IsometricSMul M M]
(a b c : M)


theorem norm_dvd_iff {x : S} (hx : Prime (Algebra.norm ℤ x)) {y : ℤ} :
    Algebra.norm ℤ x ∣ y ↔ x ∣ y

{S : Type u_1}
[CommRing S]
[IsDomain S]
[Nontrivial S]
[IsDedekindDomain S]
[Module.Free ℤ S]
[Module.Finite ℤ S]
{x : S}
(hx : Prime ((Algebra.norm ℤ) x))
{y : ℤ}


/-- Given a sheaf `S`, construct an isomorphism `S ≅ [-, S(*)]`. -/
@[simps]
noncomputable def equivYoneda' (S : SheafOfTypes typesGrothendieckTopology) :
    S ≅ yoneda'.obj (S.1.obj (op PUnit))

(S : CategoryTheory.SheafOfTypes CategoryTheory.typesGrothendieckTopology)

(CategoryTheory.equivYoneda' S).inv.val = (CategoryTheory.equivYoneda S.val ⋯).inv


theorem mem_list_toFinmap (a : α) (xs : List (Sigma β)) :
    a ∈ xs.toFinmap ↔ ∃ b : β a, Sigma.mk a b ∈ xs

{α : Type u}
{β : α → Type v}
[DecidableEq α]
(a : α)
(xs : List (Sigma β))


/-- To construct an isomorphism between tridents,
it suffices to give an isomorphism between the cone points
and check that it commutes with the `ι` morphisms.
-/
@[simps]
def Trident.ext [Nonempty J] {s t : Trident f} (i : s.pt ≅ t.pt)
    (w : i.hom ≫ t.ι = s.ι := by aesop_cat) : s ≅ t

(w : CategoryTheory.CategoryStruct.comp i.hom t.ι = s.ι := by aesop_cat)

(CategoryTheory.Limits.Trident.ext i w).inv = CategoryTheory.Limits.Trident.mkHom i.inv ⋯


class LawfulGetElem (cont : Type u) (idx : Type v) (elem : outParam (Type w))
   (dom : outParam (cont → idx → Prop)) [ge : GetElem? cont idx elem dom] : Prop where

  getElem?_def (c : cont) (i : idx) [Decidable (dom c i)] :
      c[i]? = if h : dom c i then some (c[i]'h) else none := by
    intros
    try simp only [getElem?] <;> congr
  getElem!_def [Inhabited elem] (c : cont) (i : idx) :
      c[i]! = match c[i]? with | some e => e | none => default := by
    intros
    simp only [getElem!, getElem?, outOfBounds_eq_default]

[self : LawfulGetElem cont idx elem dom]

getElem! c i =
  match getElem? c i with
  | some e => e
  | none => default


@[to_additive (attr := gcongr) addCentralizer_subset]
lemma centralizer_subset (h : S ⊆ T) : centralizer T ⊆ centralizer S

{M : Type u_1}
{S T : Set M}
[Add M]
(h : S ⊆ T)


@[simp]
theorem equiv_sub : WithLp.equiv p V (x - y) = WithLp.equiv p V x - WithLp.equiv p V y

(p : ℝ≥0∞)
{V : Type uV}
[AddCommGroup V]
(x y : WithLp p V)

(WithLp.equiv p V) (x - y) = (WithLp.equiv p V) x - (WithLp.equiv p V) y


theorem pow_eq_on_of_mem_support (h : ∀ x ∈ f.support ∩ g.support, f x = g x) (k : ℕ) :
    ∀ x ∈ f.support ∩ g.support, (f ^ k) x = (g ^ k) x

x ∈ f.support ∩ g.support → (f ^ k) x = (g ^ k) x


theorem tendsto_dist_left_cobounded_atTop (c : α) : Tendsto (dist c) (cobounded α) atTop

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

Filter.Tendsto (dist c) (Bornology.cobounded α) Filter.atTop


theorem IsBigOWith.sup (h : IsBigOWith c l f g) (h' : IsBigOWith c l' f g) :
    IsBigOWith c (l ⊔ l') f g

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{c : ℝ}
{f : α → E}
{g : α → F}
{l l' : Filter α}
(h : Asymptotics.IsBigOWith c l f g)
(h' : Asymptotics.IsBigOWith c l' f g)


/-- An auxiliary lemma for manipulating sequence indices. -/
theorem lift_index_left_left {f : PadicSeq p} (hf : ¬f ≈ 0) (v2 v3 : ℕ) :
    padicNorm p (f (stationaryPoint hf)) =
    padicNorm p (f (max (stationaryPoint hf) (max v2 v3)))

{p : ℕ}
[Fact (Nat.Prime p)]
{f : PadicSeq p}
(hf : ¬f ≈ 0)
(v2 v3 : ℕ)

padicNorm p (↑f (PadicSeq.stationaryPoint hf)) = padicNorm p (↑f (max (PadicSeq.stationaryPoint hf) (max v2 v3)))


theorem infinite_iff {α : Type u} : Infinite α ↔ ℵ₀ ≤ #α

Infinite α ↔ Cardinal.aleph0 ≤ Cardinal.mk α


@[simp]
lemma fromColumns_apply_inl (A₁ : Matrix m n₁ R) (A₂ : Matrix m n₂ R) (i : m) (j : n₁) :
    (fromColumns A₁ A₂) i (Sum.inl j) = A₁ i j

{R : Type u_1}
{m : Type u_2}
{n₁ : Type u_6}
{n₂ : Type u_7}
(A₁ : Matrix m n₁ R)
(A₂ : Matrix m n₂ R)
(i : m)
(j : n₁)

A₁.fromColumns A₂ i (Sum.inl j) = A₁ i j


@[deprecated getElem?_take_eq_if (since := "2024-06-12")]
theorem get?_take_eq_if {l : List α} {n m : Nat} :
    (l.take n).get? m = if m < n then l.get? m else none

(List.take n l).get? m = if m < n then l.get? m else none


theorem mem_closedBall_self (hr : 0 ≤ r) : x ∈ closedBall p x r

{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddCommGroup E]
[SMul 𝕜 E]
(p : Seminorm 𝕜 E)
{x : E}
{r : ℝ}
(hr : 0 ≤ r)


/-- A continuous function with compact support is bounded below. -/
@[to_additive " A continuous function with compact support is bounded below. "]
theorem Continuous.bddBelow_range_of_hasCompactMulSupport [ClosedIicTopology α] [One α]
    {f : β → α} (hf : Continuous f) (h : HasCompactMulSupport f) : BddBelow (range f)

{α : Type u_2}
{β : Type u_3}
[LinearOrder α]
[TopologicalSpace α]
[TopologicalSpace β]
[ClosedIicTopology α]
[Zero α]
{f : β → α}
(hf : Continuous f)
(h : HasCompactSupport f)


@[simp]
theorem coe_lt_top (x : ℝ) : (x : EReal) < ⊤


theorem to_map_eq_zero_iff {x : R} (hM : M ≤ nonZeroDivisors R) : algebraMap R S x = 0 ↔ x = 0

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


theorem lieSpan_eq : lieSpan R L (K : Set L) = K

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(K : LieSubalgebra R L)


@[to_additive (attr := simp)]
theorem dist_mul_right [Mul M] [PseudoMetricSpace M] [IsometricSMul Mᵐᵒᵖ M] (a b c : M) :
    dist (a * c) (b * c) = dist a b

{M : Type u}
[Mul M]
[PseudoMetricSpace M]
[IsometricSMul Mᵐᵒᵖ M]
(a b c : M)


nonrec theorem add (hf : CircleIntegrable f c R) (hg : CircleIntegrable g c R) :
    CircleIntegrable (f + g) c R

{E : Type u_1}
[NormedAddCommGroup E]
{f g : ℂ → E}
{c : ℂ}
{R : ℝ}
(hf : CircleIntegrable f c R)
(hg : CircleIntegrable g c R)


theorem vector_mOfFn :
    ∀ {n} {f : Fin n → α →. σ},
      (∀ i, Partrec (f i)) → Partrec fun a : α => Vector.mOfFn fun i => f i a

{α : Type u_1}
{σ : Type u_4}
[Primcodable α]
[Primcodable σ]
{n : ℕ}
{f : Fin n → α →. σ}

(∀ (i : Fin n), Partrec (f i)) → Partrec fun a => Mathlib.Vector.mOfFn fun i => f i a


/-- Together `Matrix.detInvertibleOfInvertible` and `Matrix.invertibleOfDetInvertible` form an
equivalence, although both sides of the equiv are subsingleton anyway. -/
@[simps]
def invertibleEquivDetInvertible : Invertible A ≃ Invertible A.det

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

A.invertibleEquivDetInvertible.symm inst✝ = A.invertibleOfDetInvertible


@[to_additive]
theorem smul_def (f : α → β → β) (l : FreeMonoid α) (b : β) :
    haveI := mkMulAction f
    l • b = l.toList.foldr f b

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

l +ᵥ b = List.foldr f b (FreeAddMonoid.toList l)


protected theorem eq_div_of_mul_eq_right {a b c : Int}
    (H1 : a ≠ 0) (H2 : a * b = c) : b = c.div a


/-- The equivalence between `X` and the underlying type of its fundamental groupoid.
  This is useful for transferring constructions (instances, etc.)
  from `X` to `πₓ X`. -/
@[simps]
def equiv (X : Type*) : FundamentalGroupoid X ≃ X

((FundamentalGroupoid.equiv X).symm x).as = x


theorem eq_neg_one_iff_not_one {a : ℤ} (ha : (a : ZMod p) ≠ 0) :
    legendreSym p a = -1 ↔ ¬legendreSym p a = 1

(p : ℕ)
[Fact (Nat.Prime p)]
{a : ℤ}
(ha : ↑a ≠ 0)


@[to_additive]
theorem continuous_of_mulTSupport [TopologicalSpace β] {f : α → β}
    (hf : ∀ x ∈ mulTSupport f, ContinuousAt f x) : Continuous f


@[to_additive (attr := simp)]
theorem inv_comp [Inv γ] [ContinuousInv γ] (f : C(β, γ)) (g : C(α, β)) :
    f⁻¹.comp g = (f.comp g)⁻¹

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
[Neg γ]
[ContinuousNeg γ]
(f : C(β, γ))
(g : C(α, β))


/-- Lifts an equivalence on states to an equivalence on DFAs. -/
@[simps apply_step apply_start apply_accept]
def reindex (g : σ ≃ σ') : DFA α σ ≃ DFA α σ'

{α : Type u}
{σ : Type v}
{σ' : Type u_2}
(g : σ ≃ σ')
(M : DFA α σ)

((DFA.reindex g) M).accept = ⇑g.symm ⁻¹' M.accept


@[to_additive]
theorem noncommProd_cons' (s : Multiset α) (a : α) (comm) :
    noncommProd (a ::ₘ s) comm = noncommProd s (comm.mono fun _ => mem_cons_of_mem) * a

(comm : {x | x ∈ a ::ₘ s}.Pairwise Commute)

(a ::ₘ s).noncommProd comm = s.noncommProd ⋯ * a


@[to_additive]
theorem map_noncommProd [MonoidHomClass F β γ] (s : Finset α) (f : α → β) (comm) (g : F) :
    g (s.noncommProd f comm) =
      s.noncommProd (fun i => g (f i)) fun x hx y hy _ => (comm.of_refl hx hy).map g

(comm : (↑s).Pairwise fun a b => AddCommute (f a) (f b))

g (s.noncommSum f comm) = s.noncommSum (fun i => g (f i)) ⋯


theorem image_inversion_perpBisector (hR : R ≠ 0) (hy : y ≠ c) :
    inversion c R '' perpBisector c y = sphere (inversion c R y) (R ^ 2 / dist y c) \ {c}

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

EuclideanGeometry.inversion c R '' ↑(AffineSubspace.perpBisector c y) =
  Metric.sphere (EuclideanGeometry.inversion c R y) (R ^ 2 / dist y c) \ {c}


@[simp default+1] -- Porting note: this used to be just @[simp]
lemma length_injective [Subsingleton α] : Injective (length : List α → ℕ)


theorem MonotoneOn.locallyBoundedVariationOn {f : α → ℝ} {s : Set α} (hf : MonotoneOn f s) :
    LocallyBoundedVariationOn f s

{α : Type u_1}
[LinearOrder α]
{f : α → ℝ}
{s : Set α}
(hf : MonotoneOn f s)


theorem Monotone.ge_of_tendsto [TopologicalSpace α] [Preorder α] [OrderClosedTopology α]
    [SemilatticeSup β] {f : β → α} {a : α} (hf : Monotone f) (ha : Tendsto f atTop (𝓝 a)) (b : β) :
    f b ≤ a

(ha : Filter.Tendsto f Filter.atTop (𝓝 a))


@[simp]
theorem tensorRightHomEquiv_whiskerLeft_comp_evaluation {X Y : C} [HasRightDual X] [HasRightDual Y]
    (f : X ⟶ Y) : (tensorRightHomEquiv _ _ _ _) ((Yᘁ) ◁ f ≫ ε_ _ _) = fᘁ ≫ (λ_ _).inv

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

(CategoryTheory.tensorRightHomEquiv Yᘁ X Xᘁ (𝟙_ C)) (Yᘁ ◁ f ≫ ε_ Y Yᘁ) = fᘁ ≫ (λ_ Xᘁ).inv


/-- A linearly ordered commutative group with an additively absorbing `⊤` element.
  Instances should include number systems with an infinite element adjoined. -/
class LinearOrderedAddCommGroupWithTop (α : Type*) extends LinearOrderedAddCommMonoidWithTop α,
  SubNegMonoid α, Nontrivial α where
  protected neg_top : -(⊤ : α) = ⊤
  protected add_neg_cancel : ∀ a : α, a ≠ ⊤ → a + -a = 0

[self : LinearOrderedAddCommGroupWithTop α]


/-- An equivalence of categories induces an equivalences between the respective categories
of homological complex.
-/
@[simps]
def Equivalence.mapHomologicalComplex (e : W₁ ≌ W₂) [e.functor.PreservesZeroMorphisms]
    (c : ComplexShape ι) :
    HomologicalComplex W₁ c ≌ HomologicalComplex W₂ c

(e.mapHomologicalComplex c).counitIso =
  CategoryTheory.NatIso.mapHomologicalComplex e.counitIso c ≪≫ CategoryTheory.Functor.mapHomologicalComplexIdIso W₂ c


theorem bddBelow_u_image {s : Set β} : BddBelow (u '' s) ↔ BddBelow s

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)
{s : Set β}


/-- A lattice is atomic iff every element other than `⊥` has an atom below it. -/
@[mk_iff]
class IsAtomic [OrderBot α] : Prop where
  /-- Every element other than `⊥` has an atom below it. -/
  eq_bot_or_exists_atom_le : ∀ b : α, b = ⊥ ∨ ∃ a : α, IsAtom a ∧ a ≤ b

{α : Type u_2}
[PartialOrder α]
[OrderBot α]
[self : IsAtomic α]
(b : α)


@[to_additive (attr := simp)]
theorem measure_preimage_smul (c : G) (s : Set α) : μ ((c • ·) ⁻¹' s) = μ s

[MeasureTheory.SMulInvariantMeasure G α μ]


@[simp]
theorem neg_one_geom_sum [Ring α] {n : ℕ} :
    ∑ i ∈ range n, (-1 : α) ^ i = if Even n then 0 else 1

∑ i ∈ Finset.range n, (-1) ^ i = if Even n then 0 else 1


theorem exists_max_root [LinearOrder R] (p : R[X]) (hp : p ≠ 0) : ∃ x₀, ∀ x, p.IsRoot x → x ≤ x₀

{R : Type u}
[CommRing R]
[IsDomain R]
[LinearOrder R]
(p : Polynomial R)
(hp : p ≠ 0)


/-- Variant of the mean value inequality on a convex set. Version with `fderiv`. -/
theorem norm_image_sub_le_of_norm_fderiv_le' (hf : ∀ x ∈ s, DifferentiableAt 𝕜 f x)
    (bound : ∀ x ∈ s, ‖fderiv 𝕜 f x - φ‖ ≤ C) (hs : Convex ℝ s) (xs : x ∈ s) (ys : y ∈ s) :
    ‖f y - f x - φ (y - x)‖ ≤ C * ‖y - x‖


@[simp] theorem inv_eq_top : a⁻¹ = ∞ ↔ a = 0


@[simp]
theorem nnnorm_pow (a : α) (n : ℕ) : ‖a ^ n‖₊ = ‖a‖₊ ^ n

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


theorem Filter.Tendsto.snd_nhds {l : Filter X} {f : X → Y × Z} {p : Y × Z}
    (h : Tendsto f l (𝓝 p)) : Tendsto (fun a ↦ (f a).2) l (𝓝 <| p.2)

{X : Type u}
{Y : Type v}
{Z : Type u_1}
[TopologicalSpace Y]
[TopologicalSpace Z]
{l : Filter X}
{f : X → Y × Z}
{p : Y × Z}
(h : Filter.Tendsto f l (𝓝 p))

Filter.Tendsto (fun a => (f a).2) l (𝓝 p.2)


theorem finite_classes_ker {α β : Type*} [Finite β] (f : α → β) : (Setoid.ker f).classes.Finite

{α : Type u_2}
{β : Type u_3}
[Finite β]
(f : α → β)


@[simp]
theorem coeff_opRingEquiv (p : R[X]ᵐᵒᵖ) (n : ℕ) :
    (opRingEquiv R p).coeff n = op ((unop p).coeff n)

{R : Type u_1}
[Semiring R]
(p : R[X]ᵐᵒᵖ)
(n : ℕ)

((Polynomial.opRingEquiv R) p).coeff n = MulOpposite.op ((MulOpposite.unop p).coeff n)


theorem restrict_preimage_emb {f : α → β} (hf : MeasurePreserving f μa μb)
    (h₂ : MeasurableEmbedding f) (s : Set β) :
    MeasurePreserving f (μa.restrict (f ⁻¹' s)) (μb.restrict s)

(hf : MeasureTheory.MeasurePreserving f μa μb)

MeasureTheory.MeasurePreserving f (μa.restrict (f ⁻¹' s)) (μb.restrict s)


theorem Nat.two_pow_sub_pow {x y : ℕ} (hxy : 2 ∣ x - y) (hx : ¬2 ∣ x) {n : ℕ} (hn : Even n) :
    multiplicity 2 (x ^ n - y ^ n) + 1 =
      multiplicity 2 (x + y) + multiplicity 2 (x - y) + multiplicity 2 n


theorem cos_ne_zero_iff {θ : ℂ} : cos θ ≠ 0 ↔ ∀ k : ℤ, θ ≠ (2 * k + 1) * π / 2

Complex.cos θ ≠ 0 ↔ ∀ (k : ℤ), θ ≠ (2 * ↑k + 1) * ↑Real.pi / 2


@[simp]
theorem run_monadMap {n} [MonadFunctorT n m] (f : ∀ {α}, n α → n α) :
    (monadMap (@f) x : OptionT m α).run = monadMap (@f) x.run

{α : Type u}
{m : Type u → Type v}
(x : OptionT m α)
{n : Type u → Type u_1}
[MonadFunctorT n m]
(f : {α : Type u} → n α → n α)


@[to_additive]
protected theorem semiconjBy {a b : S} (h : Commute a b) : SemiconjBy a b b

{S : Type u_3}
[Add S]
{a b : S}
(h : AddCommute a b)


@[simp]
theorem fromRel_proj_prop {sym : Symmetric r} {z : α × α} : Sym2.mk z ∈ fromRel sym ↔ r z.1 z.2

{α : Type u_1}
{r : α → α → Prop}
{sym : Symmetric r}
{z : α × α}

Sym2.mk z ∈ Sym2.fromRel sym ↔ r z.1 z.2


theorem upperCrossingTime_stabilize (hnm : n ≤ m) (hn : upperCrossingTime a b f N n ω = N) :
    upperCrossingTime a b f N m ω = N

{f : ℕ → Ω → ℝ}

(hn : MeasureTheory.upperCrossingTime a b f N n ω = N)

MeasureTheory.upperCrossingTime a b f N m ω = N


/-- If you add multiples of previous rows to the next row, the determinant doesn't change. -/
theorem det_eq_of_forall_row_eq_smul_add_pred {n : ℕ} {A B : Matrix (Fin (n + 1)) (Fin (n + 1)) R}
    (c : Fin n → R) (A_zero : ∀ j, A 0 j = B 0 j)
    (A_succ : ∀ (i : Fin n) (j), A i.succ j = B i.succ j + c i * A (Fin.castSucc i) j) :
    det A = det B

(A_zero : ∀ (j : Fin (n + 1)), A 0 j = B 0 j)

(A_succ : ∀ (i : Fin n) (j : Fin (n + 1)), A i.succ j = B i.succ j + c i * A i.castSucc j)


/-- The functor sending each quiver to its path category. -/
@[simps]
def free : Quiv.{v, u} ⥤ Cat.{max u v, u}

CategoryTheory.Cat.free.obj V = CategoryTheory.Cat.of (CategoryTheory.Paths ↑V)


/-- The legs of the cocone `coconeOfRepresentable` are natural in the choice of presheaf. -/
theorem coconeOfRepresentable_naturality {P₁ P₂ : Cᵒᵖ ⥤ Type v₁} (α : P₁ ⟶ P₂) (j : P₁.Elementsᵒᵖ) :
    (coconeOfRepresentable P₁).ι.app j ≫ α =
      (coconeOfRepresentable P₂).ι.app ((CategoryOfElements.map α).op.obj j)

{P₁ P₂ : CategoryTheory.Functor Cᵒᵖ (Type v₁)}

CategoryTheory.CategoryStruct.comp ((CategoryTheory.Presheaf.coconeOfRepresentable P₁).ι.app j) α =
  (CategoryTheory.Presheaf.coconeOfRepresentable P₂).ι.app ((CategoryTheory.CategoryOfElements.map α).op.obj j)


theorem mem_of_mem_inter_left : a ∈ l₁ ∩ l₂ → a ∈ l₁

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

a ∈ l₁ ∩ l₂ → a ∈ l₁


theorem trans [IsTrans α r] {a b c : α} : a ≺ b → b ≺ c → a ≺ c

{α : Sort u}
{r : α → α → Prop}
[IsTrans α r]
{a b c : α}


theorem IsOrtho.mono_right {U V₁ V₂ : Submodule 𝕜 E} (hV : V₂ ≤ V₁) (h : U ⟂ V₁) : U ⟂ V₂

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{U V₁ V₂ : Submodule 𝕜 E}
(hV : V₂ ≤ V₁)
(h : U ⟂ V₁)


theorem HasFDerivWithinAt.cpow (hf : HasFDerivWithinAt f f' s x) (hg : HasFDerivWithinAt g g' s x)
    (h0 : f x ∈ slitPlane) : HasFDerivWithinAt (fun x => f x ^ g x)
      ((g x * f x ^ (g x - 1)) • f' + (f x ^ g x * Complex.log (f x)) • g') s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f g : E → ℂ}
{f' g' : E →L[ℂ] ℂ}
{x : E}
{s : Set E}
(hf : HasFDerivWithinAt f f' s x)
(hg : HasFDerivWithinAt g g' s x)
(h0 : f x ∈ Complex.slitPlane)


theorem toReal_coe_eq_self_sub_two_mul_int_mul_pi_iff {θ : ℝ} {k : ℤ} :
    (θ : Angle).toReal = θ - 2 * k * π ↔ θ ∈ Set.Ioc ((2 * k - 1 : ℝ) * π) ((2 * k + 1) * π)

(↑θ).toReal = θ - 2 * ↑k * π ↔ θ ∈ Set.Ioc ((2 * ↑k - 1) * π) ((2 * ↑k + 1) * π)


protected theorem gcd_eq_zero_iff {a b : R} : gcd a b = 0 ↔ a = 0 ∧ b = 0

{R : Type u}
[EuclideanDomain R]
[DecidableEq R]
{a b : R}

EuclideanDomain.gcd a b = 0 ↔ a = 0 ∧ b = 0


theorem unbounded_ge_inter_not_ge [SemilatticeInf α] (a : α) :
    Unbounded (· ≥ ·) (s ∩ { b | ¬a ≤ b }) ↔ Unbounded (· ≥ ·) s

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

Set.Unbounded (fun x x_1 => x ≥ x_1) (s ∩ {b | ¬a ≤ b}) ↔ Set.Unbounded (fun x x_1 => x ≥ x_1) s


@[to_additive (attr := simp)] lemma mulEnergy_empty_left : Eₘ[∅, t] = 0

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


@[elementwise (attr := simp)]
theorem binaryCoproductIso_inl_comp_hom (X Y : Type u) :
    Limits.coprod.inl ≫ (binaryCoproductIso X Y).hom = Sum.inl

CategoryTheory.Limits.coprod.inl ≫ (CategoryTheory.Limits.Types.binaryCoproductIso X Y).hom = Sum.inl


protected theorem ne_zero_of_mul_ne_zero_right (h : n * m ≠ 0) : m ≠ 0


@[simp]
theorem map_inr (g : G) : map f₁ f₂ h (inr g) = inr (f₂ g)

(h : ∀ (g : G), f₁.comp (MulEquiv.toMonoidHom (φ g)) = (MulEquiv.toMonoidHom (φ₁ (f₂ g))).comp f₁)

(SemidirectProduct.map f₁ f₂ h) (SemidirectProduct.inr g) = SemidirectProduct.inr (f₂ g)


protected theorem IsCompact.isSeqCompact {s : Set X} (hs : IsCompact s) : IsSeqCompact s

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


/-- The increasing sequence of submodules consisting of the kernels of the iterates of a linear map.
-/
@[simps]
def iterateKer (f : M →ₗ[R] M) : ℕ →o Submodule R M

{R : Type u_1}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(f : M →ₗ[R] M)
(n : ℕ)


@[simp]
theorem card_nat (n : ℕ) : card.{u} n = n


theorem Set.Subsingleton.isWeakAntichain (hs : s.Subsingleton) : IsWeakAntichain s

{ι : Type u_1}
{α : ι → Type u_2}
[(i : ι) → Preorder (α i)]
{s : Set ((i : ι) → α i)}
(hs : s.Subsingleton)


@[simp] theorem swap_swap (x : α ⊕ β) : swap (swap x) = x

{α : Type u_1}
{β : Type u_2}
(x : α ⊕ β)


theorem descPochhammer_eq_ascPochhammer (n : ℕ) :
    descPochhammer ℤ n = (ascPochhammer ℤ n).comp ((X : ℤ[X]) - n + 1)

descPochhammer ℤ n = (ascPochhammer ℤ n).comp (Polynomial.X - ↑n + 1)


theorem sup_vanishingIdeal_le (t t' : Set (PrimeSpectrum R)) :
    vanishingIdeal t ⊔ vanishingIdeal t' ≤ vanishingIdeal (t ∩ t')

{R : Type u}
[CommSemiring R]
(t t' : Set (PrimeSpectrum R))

PrimeSpectrum.vanishingIdeal t ⊔ PrimeSpectrum.vanishingIdeal t' ≤ PrimeSpectrum.vanishingIdeal (t ∩ t')


@[to_additive]
theorem toTopologicalSpace_injective :
    Function.Injective (toTopologicalSpace : GroupTopology α → TopologicalSpace α)


theorem Submartingale.sum_mul_upcrossingStrat_le [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ) :
    μ[∑ k ∈ Finset.range n, upcrossingStrat a b f N k * (f (k + 1) - f k)] ≤ μ[f n] - μ[f 0]

{f : ℕ → Ω → ℝ}

(hf : MeasureTheory.Submartingale f ℱ μ)

∫ (x : Ω), (∑ k ∈ Finset.range n, MeasureTheory.upcrossingStrat a b f N k * (f (k + 1) - f k)) x ∂μ ≤
  ∫ (x : Ω), f n x ∂μ - ∫ (x : Ω), f 0 x ∂μ


/-- As an intermediate step to show that `μ.withDensity (v.limRatioMeas hρ) = ρ`, we show here
that `ρ ≤ t μ.withDensity (v.limRatioMeas hρ)` for any `t > 1`. -/
theorem le_mul_withDensity {s : Set α} (hs : MeasurableSet s) {t : ℝ≥0} (ht : 1 < t) :
    ρ s ≤ t * μ.withDensity (v.limRatioMeas hρ) s

(hρ : ρ ≪ μ)

ρ s ≤ ↑t * (μ.withDensity (v.limRatioMeas hρ)) s


theorem le_sup_shrink_equiv {s : Set Ordinal.{u}} (hs : Small.{u} s) (a) (ha : a ∈ s) :
    a ≤ sup.{u, u} fun x => ((@equivShrink s hs).symm x).val

{s : Set Ordinal.{u}}
(hs : Small.{u, u + 1} ↑s)
(a : Ordinal.{u})
(ha : a ∈ s)

a ≤ Ordinal.sup fun x => ↑((equivShrink ↑s).symm x)


theorem image_add_const_Iio : (fun x => x + a) '' Iio b = Iio (b + a)

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

(fun x => x + a) '' Set.Iio b = Set.Iio (b + a)


@[simp]
theorem range_snd : range (snd R M M₂) = ⊤

{R : Type u}
{M : Type v}
{M₂ : Type w}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]

LinearMap.range (LinearMap.snd R M M₂) = ⊤


@[to_additive]
theorem mul_rotate' (a b c : G) : a * (b * c) = b * (c * a)

{G : Type u_3}
[AddCommSemigroup G]
(a b c : G)


@[to_additive]
theorem mul_left_comm : ∀ a b c : G, a * (b * c) = b * (a * c)


@[to_additive]
theorem leftInverse_inv_mul_mul_right (c : G) :
    Function.LeftInverse (fun x ↦ c⁻¹ * x) fun x ↦ c * x

Function.LeftInverse (fun x => -c + x) fun x => c + x


@[to_additive (attr := simp)]
theorem mul_right_inj (a : G) {b c : G} : a * b = a * c ↔ b = c

{G : Type u_3}
[Mul G]
[IsLeftCancelMul G]
(a : G)
{b c : G}


@[simp]
theorem get_some {a : α} (ha : (some a).Dom) : get (some a) ha = a

{α : Type u_1}
{a : α}
(ha : (Part.some a).Dom)


theorem rootSet_maps_to' {p : T[X]} {S S'} [CommRing S] [IsDomain S] [Algebra T S] [CommRing S']
    [IsDomain S'] [Algebra T S'] (hp : p.map (algebraMap T S') = 0 → p.map (algebraMap T S) = 0)
    (f : S →ₐ[T] S') : (p.rootSet S).MapsTo f (p.rootSet S')

(hp : Polynomial.map (algebraMap T S') p = 0 → Polynomial.map (algebraMap T S) p = 0)

Set.MapsTo (⇑f) (p.rootSet S) (p.rootSet S')


/-- The functor in the equivalence of sheaf categories. -/
@[simps!]
def sheafCongr.functor : Sheaf J A ⥤ Sheaf K A

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

[CategoryTheory.Equivalence.TransportsGrothendieckTopology J K e]

∀ {X Y : CategoryTheory.Sheaf J A} (f : X ⟶ Y) (X_1 : Dᵒᵖ),
  ((CategoryTheory.Equivalence.sheafCongr.functor J K e A).map f).val.app X_1 =
    f.val.app (Opposite.op (e.inverse.obj (Opposite.unop X_1)))


/-- The **alternating series test** for monotone sequences. -/
theorem Monotone.tendsto_alternating_series_of_tendsto_zero (hfa : Monotone f)
    (hf0 : Tendsto f atTop (𝓝 0)) :
    ∃ l, Tendsto (fun n ↦ ∑ i ∈ range n, (-1) ^ i * f i) atTop (𝓝 l)

(hf0 : Filter.Tendsto f Filter.atTop (𝓝 0))

∃ l, Filter.Tendsto (fun n => ∑ i ∈ Finset.range n, (-1) ^ i * f i) Filter.atTop (𝓝 l)


/-- The first coefficient of `id 𝕜 E` is the identity. -/
@[simp]
theorem id_apply_one (v : Fin 1 → E) : (FormalMultilinearSeries.id 𝕜 E) 1 v = v 0

(𝕜 : Type u_1)
(E : Type u_2)
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
(v : Fin 1 → E)

(FormalMultilinearSeries.id 𝕜 E 1) v = v 0


theorem lipschitzWith_equiv_aux : LipschitzWith 1 (WithLp.equiv p (∀ i, β i))

(p : ℝ≥0∞)
{ι : Type u_2}
(β : ι → Type u_4)
[Fact (1 ≤ p)]
[(i : ι) → PseudoEMetricSpace (β i)]
[Fintype ι]

LipschitzWith 1 ⇑(WithLp.equiv p ((i : ι) → β i))


@[simp]
theorem mkContinuousMultilinear_apply (f : MultilinearMap 𝕜 E (MultilinearMap 𝕜 E' G)) {C : ℝ}
    (H : ∀ m₁ m₂, ‖f m₁ m₂‖ ≤ (C * ∏ i, ‖m₁ i‖) * ∏ i, ‖m₂ i‖) (m : ∀ i, E i) :
    ⇑(mkContinuousMultilinear f C H m) = f m

[(i : ι) → SeminormedAddCommGroup (E i)]

[(i : ι') → SeminormedAddCommGroup (E' i)]

(H : ∀ (m₁ : (i : ι) → E i) (m₂ : (i : ι') → E' i), ‖(f m₁) m₂‖ ≤ (C * ∏ i : ι, ‖m₁ i‖) * ∏ i : ι', ‖m₂ i‖)

⇑((f.mkContinuousMultilinear C H) m) = ⇑(f m)


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

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

TendstoUniformlyOn (f - f') (g - g') l s


/-- The star operation bundled as a continuous map. -/
@[simps]
def starContinuousMap : C(R, R)

{R : Type u_2}
[TopologicalSpace R]
[Star R]
[ContinuousStar R]


theorem num_denom_mul (x y : RatFunc K) :
    (x * y).num * (x.denom * y.denom) = x.num * y.num * (x * y).denom

{K : Type u}
[Field K]
(x y : RatFunc K)


lemma effectiveEpiFamily_of_effectiveEpi_epi_comp {α : Type*} {B : C} {X Y : α → C}
    (f : (a : α) → X a ⟶ B) (g : (a : α) → Y a ⟶ X a) [∀ a, Epi (g a)]
    [EffectiveEpiFamily _ (fun a ↦ g a ≫ f a)] : EffectiveEpiFamily _ f

[CategoryTheory.EffectiveEpiFamily Y fun a => CategoryTheory.CategoryStruct.comp (g a) (f a)]


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

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


@[simp]
theorem nnnorm_snd (a : 𝓜(𝕜, A)) : ‖a.snd‖₊ = ‖a‖₊

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[SMulCommClass 𝕜 A A]
[IsScalarTower 𝕜 A A]
[StarRing A]
[CstarRing A]
(a : 𝓜(𝕜, A))


theorem tendsto_fract_left' [OrderClosedTopology α] [TopologicalAddGroup α] (n : ℤ) :
    Tendsto (fract : α → α) (𝓝[<] n) (𝓝 1)

{α : Type u_1}
[LinearOrderedRing α]
[FloorRing α]
[TopologicalSpace α]
[OrderClosedTopology α]
[TopologicalAddGroup α]
(n : ℤ)

Filter.Tendsto Int.fract (𝓝[<] ↑n) (𝓝 1)


@[simp]
theorem assoc_tmul (m : M) (p : P) (q : Q) :
    assoc R A B M P Q ((m ⊗ₜ p) ⊗ₜ q) = m ⊗ₜ (p ⊗ₜ q)

(R : Type uR)
(A : Type uA)
(B : Type uB)
{M : Type uM}
{P : Type uP}
{Q : Type uQ}
[CommSemiring R]
[CommSemiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
[AddCommMonoid M]
[Module R M]
[Module A M]
[Module B M]
[IsScalarTower R A M]
[IsScalarTower R B M]
[SMulCommClass A B M]
[AddCommMonoid P]
[Module R P]
[Module A P]
[IsScalarTower R A P]
[AddCommMonoid Q]
[Module R Q]
[Algebra A B]
[IsScalarTower A B M]
(m : M)
(p : P)
(q : Q)

(TensorProduct.AlgebraTensorModule.assoc R A B M P Q) ((m ⊗ₜ[A] p) ⊗ₜ[R] q) = m ⊗ₜ[A] p ⊗ₜ[R] q


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

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


theorem col_vecMul [Fintype m] [NonUnitalNonAssocSemiring α] (M : Matrix m n α) (v : m → α) :
    Matrix.col ι (v ᵥ* M) = (Matrix.row ι v * M)ᵀ

{m : Type u_2}
{n : Type u_3}
{α : Type v}
{ι : Type u_6}
[Fintype m]
[NonUnitalNonAssocSemiring α]
(M : Matrix m n α)
(v : m → α)

Matrix.col ι (Matrix.vecMul v M) = (Matrix.row ι v * M).transpose


@[to_additive]
theorem mul_top_of_one_le (hf : 1 ≤ f) : f * ⊤ = ⊤

{α : Type u_2}
[Monoid α]
{f : Filter α}
(hf : 1 ≤ f)


theorem AntivaryOn.comp_monotone_on_left (h : AntivaryOn f g s) (hf : Monotone f') :
    AntivaryOn (f' ∘ f) g s

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Preorder α]
[Preorder β]
[Preorder γ]
{f : ι → α}
{f' : α → γ}
{g : ι → β}
{s : Set ι}
(h : AntivaryOn f g s)
(hf : Monotone f')


/-- Shows that the integer parts of the stream are at least one. -/
theorem one_le_succ_nth_stream_b {ifp_succ_n : IntFractPair K}
    (succ_nth_stream_eq : IntFractPair.stream v (n + 1) = some ifp_succ_n) : 1 ≤ ifp_succ_n.b

{ifp_succ_n : GenContFract.IntFractPair K}

(succ_nth_stream_eq : GenContFract.IntFractPair.stream v (n + 1) = some ifp_succ_n)


@[simp]
theorem Ico_inl_inr : Ico (inl a₁) (inr b₂) = ∅

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
[LocallyFiniteOrder α]
[LocallyFiniteOrder β]
(a₁ : α)
(b₂ : β)

Finset.Ico (Sum.inl a₁) (Sum.inr b₂) = ∅


/-- The functor `SimplicialObject.Split C ⥤ C` which sends a simplicial object equipped
with a splitting to its nondegenerate `n`-simplices. -/
@[simps]
def evalN (n : ℕ) : Split C ⥤ C

(C : Type u_1)
[CategoryTheory.Category.{u_2, u_1} C]
(n : ℕ)
(S : SimplicialObject.Split C)

(SimplicialObject.Split.evalN C n).obj S = S.s.N n


/-- Consider a real set `s`. If a property is true almost everywhere in `s ∩ (a, b)` for
all `a, b ∈ s`, then it is true almost everywhere in `s`. Formulated with bare membership.
See also `ae_restrict_of_ae_restrict_inter_Ioo`. -/
theorem ae_of_mem_of_ae_of_mem_inter_Ioo {μ : Measure ℝ} [NoAtoms μ] {s : Set ℝ} {p : ℝ → Prop}
    (h : ∀ a b, a ∈ s → b ∈ s → a < b → ∀ᵐ x ∂μ, x ∈ s ∩ Ioo a b → p x) :
    ∀ᵐ x ∂μ, x ∈ s → p x

(h : ∀ (a b : ℝ), a ∈ s → b ∈ s → a < b → ∀ᵐ (x : ℝ) ∂μ, x ∈ s ∩ Set.Ioo a b → p x)


/-- The determinants of a `LinearEquiv` and its inverse multiply to 1. -/
@[simp]
theorem LinearEquiv.det_symm_mul_det {A : Type*} [CommRing A] [Module A M] (f : M ≃ₗ[A] M) :
    LinearMap.det (f.symm : M →ₗ[A] M) * LinearMap.det (f : M →ₗ[A] M) = 1

{M : Type u_2}
[AddCommGroup M]
{A : Type u_5}
[CommRing A]
[Module A M]
(f : M ≃ₗ[A] M)

LinearMap.det ↑f.symm * LinearMap.det ↑f = 1


/-- `x * y * z` is equivalent to `x * (y * z).`-/
theorem mul_assoc_equiv (x y z : PGame) : x * y * z ≈ x * (y * z)


@[simp]
theorem extendWith_single_zero [DecidableEq ι] [∀ i, Zero (α i)] (i : ι) (x : α (some i)) :
    (single i x).extendWith 0 = single (some i) x

{ι : Type u}
{α : Option ι → Type v}
[DecidableEq ι]
[(i : Option ι) → Zero (α i)]
(i : ι)
(x : α (some i))

DFinsupp.extendWith 0 (DFinsupp.single i x) = DFinsupp.single (some i) x


@[simp]
protected theorem wellFoundedOn [IsStrictOrder α r] (s : Finset α) :
    Set.WellFoundedOn (↑s : Set α) r

{α : Type u_2}
{r : α → α → Prop}
[IsStrictOrder α r]
(s : Finset α)


private theorem existsNatOneDivLTMeasure_of_not_negative (hi : ¬s ≤[i] 0) :
    ∃ n : ℕ, ExistsOneDivLT s i n

(hi : ¬MeasureTheory.VectorMeasure.restrict s i ≤ MeasureTheory.VectorMeasure.restrict 0 i)

∃ n, MeasureTheory.SignedMeasure.ExistsOneDivLT s i n


theorem isOpen_ne_fun [T2Space X] {f g : Y → X} (hf : Continuous f) (hg : Continuous g) :
    IsOpen { y : Y | f y ≠ g y }

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[T2Space X]
{f g : Y → X}
(hf : Continuous f)
(hg : Continuous g)


@[simp] theorem preimage_Icc : e ⁻¹' Icc (e x) (e y) = Icc x y

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(e : α ↪o β)
(x y : α)

⇑e ⁻¹' Set.Icc (e x) (e y) = Set.Icc x y


/--
The pair `f,g` is a cosplit pair if there is an `h : W ⟶ X` so that `f, g, h` forms a split
equalizer in `C`.
-/
class HasSplitEqualizer : Prop where
  /-- There is some split equalizer -/
  splittable : ∃ (W : C) (h : W ⟶ X), Nonempty (IsSplitEqualizer f g h)

[self : CategoryTheory.HasSplitEqualizer f g]

∃ W h, Nonempty (CategoryTheory.IsSplitEqualizer f g h)


/-- Two left invariant measures give the same mass to level sets of continuous compactly supported
functions, up to the scalar `haarScalarFactor μ' μ`.

Auxiliary lemma in the proof of the more general
`measure_isMulInvariant_eq_smul_of_isCompact_closure`, which works for any set with
compact closure. -/
@[to_additive measure_preimage_isAddLeftInvariant_eq_smul_of_hasCompactSupport
"Two left invariant measures give the same mass to level sets of continuous compactly supported
functions, up to the scalar `addHaarScalarFactor μ' μ`.

Auxiliary lemma in the proof of the more general
`measure_isAddInvariant_eq_smul_of_isCompact_closure`, which works for any set with
compact closure."]
lemma measure_preimage_isMulLeftInvariant_eq_smul_of_hasCompactSupport
    (μ' μ : Measure G) [IsHaarMeasure μ] [IsFiniteMeasureOnCompacts μ'] [IsMulLeftInvariant μ']
    {f : G → ℝ} (hf : Continuous f) (h'f : HasCompactSupport f) :
    μ' (f ⁻¹' {1}) = haarScalarFactor μ' μ • μ (f ⁻¹' {1})

μ' (f ⁻¹' {1}) = μ'.haarScalarFactor μ • μ (f ⁻¹' {1})


/-- Every x greater than or equal to 1 is between two successive
natural-number powers of every y greater than one. -/
theorem exists_nat_pow_near (hx : 1 ≤ x) (hy : 1 < y) : ∃ n : ℕ, y ^ n ≤ x ∧ x < y ^ (n + 1)

{α : Type u_1}
[LinearOrderedSemiring α]
[Archimedean α]
[ExistsAddOfLE α]
{x y : α}
(hx : 1 ≤ x)
(hy : 1 < y)


theorem adjugate_mul (A : Matrix n n α) : adjugate A * A = A.det • (1 : Matrix n n α)

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


/-- The canonical isomorphism relating `(Span f g).op` and `Cospan f.op g.op` -/
@[simps!]
def opSpan {X Y Z : C} (f : X ⟶ Y) (g : X ⟶ Z) :
    (span f g).op ≅ walkingSpanOpEquiv.functor ⋙ cospan f.op g.op

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

∀ (X_1 : CategoryTheory.Limits.WalkingSpanᵒᵖ),
  (CategoryTheory.Limits.opSpan f g).inv.app X_1 =
    (Option.rec (CategoryTheory.Iso.refl (Opposite.op X))
        (fun val =>
          CategoryTheory.Limits.WalkingPair.rec (CategoryTheory.Iso.refl (Opposite.op Y))
            (CategoryTheory.Iso.refl (Opposite.op Z)) val)
        (Opposite.unop X_1)).hom


@[measurability]
protected theorem Measurable.piecewise {_ : DecidablePred (· ∈ s)} (hs : MeasurableSet s)
    (hf : Measurable f) (hg : Measurable g) : Measurable (piecewise s f g)

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{f g : α → β}
{m : MeasurableSpace α}
{mβ : MeasurableSpace β}

∀ {x : DecidablePred fun x => x ∈ s}, MeasurableSet s → Measurable f → Measurable g → Measurable (s.piecewise f g)


@[ext]
theorem prod_ext {f g : M × N₂ →L[R] N₃} (hl : f.comp (inl _ _ _) = g.comp (inl _ _ _))
    (hr : f.comp (inr _ _ _) = g.comp (inr _ _ _)) : f = g

(hl : f.comp (ContinuousLinearMap.inl R M N₂) = g.comp (ContinuousLinearMap.inl R M N₂))

(hr : f.comp (ContinuousLinearMap.inr R M N₂) = g.comp (ContinuousLinearMap.inr R M N₂))


@[to_additive]
theorem contMDiffAt_finset_prod (h : ∀ i ∈ t, ContMDiffAt I' I n (f i) x) :
    ContMDiffAt I' I n (fun x => ∏ i ∈ t, f i x) x


theorem glueDist_swap (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) :
    ∀ x y, glueDist Ψ Φ ε x.swap y.swap = glueDist Φ Ψ ε x y

{X : Type u}
{Y : Type v}
{Z : Type w}
[MetricSpace X]
[MetricSpace Y]
(Φ : Z → X)
(Ψ : Z → Y)
(ε : ℝ)
(x y : X ⊕ Y)

Metric.glueDist Ψ Φ ε x.swap y.swap = Metric.glueDist Φ Ψ ε x y


theorem countP_apply (l : FreeAddMonoid α) : countP p l = List.countP p l

{α : Type u_1}
(p : α → Prop)
[DecidablePred p]
(l : FreeAddMonoid α)

(FreeAddMonoid.countP p) l = List.countP (fun b => decide (p b)) l


@[fun_prop]
theorem ContinuousOn.comp'' {g : β → γ} {f : α → β} {s : Set α} {t : Set β} (hg : ContinuousOn g t)
    (hf : ContinuousOn f s) (h : Set.MapsTo f s t) : ContinuousOn (fun x => g (f x)) s

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
{g : β → γ}
{f : α → β}
{s : Set α}
{t : Set β}
(hg : ContinuousOn g t)
(hf : ContinuousOn f s)
(h : Set.MapsTo f s t)


/-- An upper estimate on the remainder. This estimate works with `m ∈ ℝ` satisfying `2 ≤ m` and is
weaker than the estimate `LiouvilleNumber.remainder_lt'` above. However, this estimate is
more useful for the proof. -/
theorem remainder_lt (n : ℕ) {m : ℝ} (m2 : 2 ≤ m) : remainder m n < 1 / (m ^ n !) ^ n

LiouvilleNumber.remainder m n < 1 / (m ^ n !) ^ n


@[simp]
theorem map_objs_eq (hφ : Function.Injective φ.obj) : (map φ hφ S).objs = φ.obj '' S.objs

{C : Type u}
[CategoryTheory.Groupoid C]
(S : CategoryTheory.Subgroupoid C)
{D : Type u_1}
[CategoryTheory.Groupoid D]
(φ : CategoryTheory.Functor C D)
(hφ : Function.Injective φ.obj)

(CategoryTheory.Subgroupoid.map φ hφ S).objs = φ.obj '' S.objs


@[to_additive addMeasure_map_restrict_apply]
lemma measure_map_restrict_apply (s : Set α) {U : Set (Quotient α_mod_G)}
    (meas_U : MeasurableSet U) :
    (μ.restrict s).map π U = μ ((π ⁻¹' U) ∩ s)

{U : Set (Quotient (AddAction.orbitRel G α))}

(MeasureTheory.Measure.map (Quotient.mk (AddAction.orbitRel G α)) (μ.restrict s)) U =
  μ (Quotient.mk (AddAction.orbitRel G α) ⁻¹' U ∩ s)


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

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


@[simp]
theorem xgcd_zero_left {s t r' s' t' : R} : xgcdAux 0 s t r' s' t' = (r', s', t')

{R : Type u}
[EuclideanDomain R]
[DecidableEq R]
{s t r' s' t' : R}

EuclideanDomain.xgcdAux 0 s t r' s' t' = (r', s', t')


theorem le_of_succ_le {n m : Nat} (h : succ n ≤ m) : n ≤ m


@[simp]
theorem BinaryBiproduct.bicone_fst : (BinaryBiproduct.bicone X Y).fst = biprod.fst

(CategoryTheory.Limits.BinaryBiproduct.bicone X Y).fst = CategoryTheory.Limits.biprod.fst


@[simp] lemma hasLineDerivWithinAt_univ :
    HasLineDerivWithinAt 𝕜 f f' univ x v ↔ HasLineDerivAt 𝕜 f f' x v

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[AddCommGroup E]
[Module 𝕜 E]
{f : E → F}
{f' : F}
{x v : E}

HasLineDerivWithinAt 𝕜 f f' Set.univ x v ↔ HasLineDerivAt 𝕜 f f' x v


theorem commute_mulLeft_right (a b : A) : Commute (mulLeft R a) (mulRight R b)

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[NonUnitalSemiring A]
[Module R A]
[SMulCommClass R A A]
[IsScalarTower R A A]
(a b : A)

Commute (LinearMap.mulLeft R a) (LinearMap.mulRight R b)


protected theorem single_apply_ne (p) (i : α) (a : E i) {j : α} (hij : j ≠ i) :
    lp.single p i a j = 0

{α : Type u_1}
{E : α → Type u_2}
[(i : α) → NormedAddCommGroup (E i)]
[DecidableEq α]
(p : ℝ≥0∞)
(i : α)
(a : E i)
{j : α}
(hij : j ≠ i)


theorem IsIntegral.of_mem_closure'' {S : Type*} [CommRing S] {f : R →+* S} (G : Set S)
    (hG : ∀ x ∈ G, f.IsIntegralElem x) : ∀ x ∈ Subring.closure G, f.IsIntegralElem x

{R : Type u_1}
[CommRing R]
{S : Type u_5}
[CommRing S]
{f : R →+* S}
(G : Set S)
(hG : ∀ x ∈ G, f.IsIntegralElem x)
(x : S)

x ∈ Subring.closure G → f.IsIntegralElem x


@[elab_without_expected_type]
theorem incomp_trans_of [IsIncompTrans α r] {a b c : α} :
    ¬a ≺ b ∧ ¬b ≺ a → ¬b ≺ c ∧ ¬c ≺ b → ¬a ≺ c ∧ ¬c ≺ a

{α : Sort u}
(r : α → α → Prop)
[IsIncompTrans α r]
{a b c : α}

¬r a b ∧ ¬r b a → ¬r b c ∧ ¬r c b → ¬r a c ∧ ¬r c a


theorem Fact.elim {p : Prop} (h : Fact p) : p


/-- Let the group `G` be the union of finitely many left cosets `g i • H i`.
Then at least one subgroup `H i` has finite index in `G`. -/
@[to_additive]
theorem exists_finiteIndex_of_leftCoset_cover : ∃ k ∈ s, (H k).FiniteIndex

(hcovers : ⋃ i ∈ s, g i • ↑(H i) = Set.univ)


theorem Integrable.comp_aemeasurable {f : α → δ} {g : δ → β} (hg : Integrable g (Measure.map f μ))
    (hf : AEMeasurable f μ) : Integrable (g ∘ f) μ

(hg : MeasureTheory.Integrable g (MeasureTheory.Measure.map f μ))


/-- Given a linear map `L : E → F`, a property holds almost everywhere in `F` if and only if,
almost everywhere in `F`, it holds almost everywhere along the subspace spanned by the
image of `L`. This is an instance of a disintegration argument for additive Haar measures. -/
lemma ae_ae_add_linearMap_mem_iff [LocallyCompactSpace F] {s : Set F} (hs : MeasurableSet s) :
    (∀ᵐ y ∂ν, ∀ᵐ x ∂μ, y + L x ∈ s) ↔ ∀ᵐ y ∂ν, y ∈ s

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[CompleteSpace 𝕜]
[NormedAddCommGroup E]
[MeasurableSpace E]
[BorelSpace E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[MeasurableSpace F]
[BorelSpace F]
[NormedSpace 𝕜 F]
(L : E →ₗ[𝕜] F)
(μ : MeasureTheory.Measure E)
(ν : MeasureTheory.Measure F)
[μ.IsAddHaarMeasure]
[ν.IsAddHaarMeasure]
[LocallyCompactSpace E]
[LocallyCompactSpace F]
{s : Set F}
(hs : MeasurableSet s)

(∀ᵐ (y : F) ∂ν, ∀ᵐ (x : E) ∂μ, y + L x ∈ s) ↔ ∀ᵐ (y : F) ∂ν, y ∈ s


theorem dslope_sub_smul_of_ne (f : 𝕜 → E) (h : b ≠ a) :
    dslope (fun x => (x - a) • f x) a b = f b

{𝕜 : Type u_1}
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{a b : 𝕜}
(f : 𝕜 → E)
(h : b ≠ a)


theorem generate_iUnion {s : ι → Set (Set α)} :
    Filter.generate (⋃ i, s i) = ⨅ i, Filter.generate (s i)

{α : Type u}
{ι : Sort x}
{s : ι → Set (Set α)}


/-- The cosine of an angle in a right-angled triangle as a ratio of sides. -/
theorem cos_oangle_add_right_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = ↑(π / 2)) :
    Real.Angle.cos (o.oangle x (x + y)) = ‖x‖ / ‖x + y‖

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

(o.oangle x (x + y)).cos = ‖x‖ / ‖x + y‖


lemma exists_eventually_const_mul_le_r :
    ∃ c ∈ Set.Ioo (0 : ℝ) 1, ∀ᶠ (n : ℕ) in atTop, ∀ i, c * n ≤ r i n

{α : Type u_1}
[Fintype α]
[Nonempty α]
{T : ℕ → ℝ}
{g : ℝ → ℝ}
{a b : α → ℝ}
{r : α → ℕ → ℕ}
(R : AkraBazziRecurrence T g a b r)

∃ c ∈ Set.Ioo 0 1, ∀ᶠ (n : ℕ) in Filter.atTop, ∀ (i : α), c * ↑n ≤ ↑(r i n)


theorem rank_fun_infinite {ι : Type v} [hι : Infinite ι] : Module.rank K (ι → K) = #(ι → K)

{K : Type u}
[DivisionRing K]
{ι : Type v}
[hι : Infinite ι]


lemma map_eq_top_iff_of_ker_le
    (f : R →+* S) {I : Ideal R} (hf₁ : RingHom.ker f ≤ I) (hf₂ : f.IsIntegral) :
    I.map f = ⊤ ↔ I = ⊤

{R : Type u_1}
[CommRing R]
{S : Type u_2}
[CommRing S]
(f : R →+* S)
{I : Ideal R}
(hf₁ : RingHom.ker f ≤ I)
(hf₂ : f.IsIntegral)


/-- If `P` is a sheaf for `R`, it is separated for `R`. -/
theorem IsSheafFor.isSeparatedFor : IsSheafFor P R → IsSeparatedFor P R

{P : CategoryTheory.Functor Cᵒᵖ (Type w)}

CategoryTheory.Presieve.IsSheafFor P R → CategoryTheory.Presieve.IsSeparatedFor P R


@[to_additive]
lemma Multipliable.of_finite [Finite β] {f : β → α} : Multipliable f

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


/-- The identity map as an `AddConstEquiv`. -/
@[simps! toEquiv apply]
def refl (a : G) : G ≃+c[a, a] G

∀ (a_1 : G), (AddConstEquiv.refl a) a_1 = a_1


@[simp]
lemma XIsoOfEq_rfl (K : HomologicalComplex V c) (p : ι) :
    K.XIsoOfEq (rfl : p = p) = Iso.refl _

K.XIsoOfEq ⋯ = CategoryTheory.Iso.refl (K.X p)