@[simp]
theorem ofAdd_nsmul [AddMonoid α] (n : ℕ) (a : α) : ofAdd (n • a) = ofAdd a ^ n

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

Multiplicative.ofAdd (n • a) = Multiplicative.ofAdd a ^ n


/-- If an element of `F` is invariant under all coordinate changes, then one can define a
corresponding section of the fiber bundle, which is continuous. This applies in particular to the
zero section of a vector bundle. Another example (not yet defined) would be the identity
section of the endomorphism bundle of a vector bundle. -/
theorem continuous_const_section (v : F)
    (h : ∀ i j, ∀ x ∈ Z.baseSet i ∩ Z.baseSet j, Z.coordChange i j x v = v) :
    Continuous (show B → Z.TotalSpace from fun x => ⟨x, v⟩)

(h : ∀ (i j : ι), ∀ x ∈ Z.baseSet i ∩ Z.baseSet j, Z.coordChange i j x v = v)

Continuous
  (let_fun this := fun x => { proj := x, snd := v };
  this)


theorem map_lie₂ (f : M →ₗ⁅R,L⁆ N →ₗ[R] P) (x : L) (m : M) (n : N) :
    ⁅x, f m n⁆ = f ⁅x, m⁆ n + f m ⁅x, n⁆

{R : Type u}
{L : Type v}
{M : Type w}
{N : Type w₁}
{P : Type w₂}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[AddCommGroup N]
[AddCommGroup P]
[Module R M]
[Module R N]
[Module R P]
[LieRingModule L M]
[LieRingModule L N]
[LieRingModule L P]
[LieModule R L N]
[LieModule R L P]
(f : M →ₗ⁅R,L⁆ N →ₗ[R] P)
(x : L)
(m : M)
(n : N)

⁅x, (f m) n⁆ = (f ⁅x, m⁆) n + (f m) ⁅x, n⁆


theorem closedEmbedding_subtype_val (h : IsClosed { a | p a }) :
    ClosedEmbedding ((↑) : Subtype p → X)

{X : Type u}
[TopologicalSpace X]
{p : X → Prop}
(h : IsClosed {a | p a})


/-- Conditions for an element to be multiplicatively central -/
@[to_additive]
structure IsMulCentral [Mul M] (z : M) : Prop where
  /-- multiplication commutes -/
  comm (a : M) : z * a = a * z
  /-- associative property for left multiplication -/
  left_assoc (b c : M) : z * (b * c) = (z * b) * c
  /-- middle associative multiplication property -/
  mid_assoc (a c : M) : (a * z) * c = a * (z * c)
  /-- associative property for right multiplication -/
  right_assoc (a b : M) : (a * b) * z = a * (b * z)

{M : Type u_1}
[Mul M]
{z : M}
(self : IsMulCentral z)
(a b : M)


@[to_additive]
lemma UniformInducing.uniformGroup {γ : Type*} [Group γ] [UniformSpace γ] [UniformGroup γ]
    [UniformSpace β] {F : Type*} [FunLike F β γ] [MonoidHomClass F β γ]
    (f : F) (hf : UniformInducing f) :
    UniformGroup β

{β : Type u_2}
[AddGroup β]
{γ : Type u_3}
[AddGroup γ]
[UniformSpace γ]
[UniformAddGroup γ]
[UniformSpace β]
{F : Type u_4}
[FunLike F β γ]
[AddMonoidHomClass F β γ]
(f : F)
(hf : UniformInducing ⇑f)


@[simp]
theorem domain_supSpanSingleton (f : E →ₗ.[K] F) (x : E) (y : F) (hx : x ∉ f.domain) :
    (f.supSpanSingleton x y hx).domain = f.domain ⊔ K ∙ x

{E : Type u_2}
[AddCommGroup E]
{F : Type u_3}
[AddCommGroup F]
{K : Type u_5}
[DivisionRing K]
[Module K E]
[Module K F]
(f : E →ₗ.[K] F)
(x : E)
(y : F)
(hx : x ∉ f.domain)

(f.supSpanSingleton x y hx).domain = f.domain ⊔ Submodule.span K {x}


theorem Cofix.bisim_rel (r : Cofix F → Cofix F → Prop)
    (h : ∀ x y, r x y → Quot.mk r <$> Cofix.dest x = Quot.mk r <$> Cofix.dest y) :
    ∀ x y, r x y → x = y

(h : ∀ (x y : QPF.Cofix F), r x y → Quot.mk r <$> x.dest = Quot.mk r <$> y.dest)


lemma mk_lt_mk {x y : PGame.{u}} {hx hy} : mk x hx < mk y hy ↔ x < y

{x y : SetTheory.PGame}
{hx : x.Numeric}
{hy : y.Numeric}

Surreal.mk x hx < Surreal.mk y hy ↔ x < y


/-- `liminf (xᵢ + c) = (liminf xᵢ) + c`. -/
lemma liminf_add_const (F : Filter ι) [NeBot F] [Add R] [ContinuousAdd R]
    [CovariantClass R R (Function.swap fun x y ↦ x + y) fun x y ↦ x ≤ y] (f : ι → R) (c : R)
    (cobdd : F.IsCoboundedUnder (· ≥ ·) f) (bdd_below : F.IsBoundedUnder (· ≥ ·) f) :
    Filter.liminf (fun i ↦ f i + c) F = Filter.liminf f F + c

[CovariantClass R R (Function.swap fun x y => x + y) fun x y => x ≤ y]

(cobdd : Filter.IsCoboundedUnder (fun x x_1 => x ≥ x_1) F f)

(bdd_below : Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) F f)

Filter.liminf (fun i => f i + c) F = Filter.liminf f F + c


@[simp]
theorem IicExtend_self (f : Iic b → β) : IicExtend f b = f ⟨b, le_rfl⟩

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
{b : α}
(f : ↑(Set.Iic b) → β)


/-- The inner product of a linear combination of a set of orthonormal vectors with one of those
vectors picks out the coefficient of that vector. -/
theorem Orthonormal.inner_right_finsupp {v : ι → E} (hv : Orthonormal 𝕜 v) (l : ι →₀ 𝕜) (i : ι) :
    ⟪v i, Finsupp.total ι E 𝕜 v l⟫ = l i

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_4}
{v : ι → E}
(hv : Orthonormal 𝕜 v)
(l : ι →₀ 𝕜)
(i : ι)

⟪v i, (Finsupp.total ι E 𝕜 v) l⟫_𝕜 = l i


theorem IsCoprime.of_mul_left_right (H : IsCoprime (x * y) z) : IsCoprime y z

{R : Type u}
[CommSemiring R]
{x y z : R}
(H : IsCoprime (x * y) z)


theorem sign_intCast (z : ℤ) : sign (z : ℝ) = ↑(Int.sign z)


/--
If `k.left` is a monomorphism, then `k` is a monomorphism. In other words, `Over.forget X` reflects
monomorphisms.
The converse of `CategoryTheory.Over.mono_left_of_mono`.

This lemma is not an instance, to avoid loops in type class inference.
-/
theorem mono_of_mono_left {f g : Over X} (k : f ⟶ g) [hk : Mono k.left] : Mono k

{T : Type u₁}
[CategoryTheory.Category.{v₁, u₁} T]
{X : T}
{f g : CategoryTheory.Over X}
(k : f ⟶ g)
[hk : CategoryTheory.Mono k.left]


theorem iff {j : ℕ} {i : Fin (j + 2)} : Isδ₀ (SimplexCategory.δ i) ↔ i = 0

AlgebraicTopology.DoldKan.Isδ₀ (SimplexCategory.δ i) ↔ i = 0


@[to_additive (attr := simp)]
theorem upperClosure_one : upperClosure (1 : Set α) = 1


@[simp]
theorem sup_lt_iff : b ⊔ c < a ↔ b < a ∧ c < a

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


@[reassoc (attr := simp)]
lemma rotateHomotopyEquiv_comm₂ :
    (HomotopyCategory.quotient _ _ ).map (triangle φ).mor₃ ≫
      (HomotopyCategory.quotient _ _ ).map (rotateHomotopyEquiv φ).hom =
      (HomotopyCategory.quotient _ _ ).map (inr (inr φ))

(HomotopyCategory.quotient C (ComplexShape.up ℤ)).map (CochainComplex.mappingCone.triangle φ).mor₃ ≫
    (HomotopyCategory.quotient C (ComplexShape.up ℤ)).map (CochainComplex.mappingCone.rotateHomotopyEquiv φ).hom =
  (HomotopyCategory.quotient C (ComplexShape.up ℤ)).map
    (CochainComplex.mappingCone.inr (CochainComplex.mappingCone.inr φ))


@[nontriviality]
theorem Subsingleton.atTop_eq (α) [Subsingleton α] [Preorder α] : (atTop : Filter α) = ⊤

(α : Type u_6)
[Subsingleton α]
[Preorder α]


theorem toMeasure_apply_eq_of_inter_support_eq {s t : Set α} (hs : MeasurableSet s)
    (ht : MeasurableSet t) (h : s ∩ p.support = t ∩ p.support) : p.toMeasure s = p.toMeasure t

{α : Type u_1}
[MeasurableSpace α]
(p : PMF α)
{s t : Set α}
(hs : MeasurableSet s)
(ht : MeasurableSet t)
(h : s ∩ p.support = t ∩ p.support)


theorem norm_sup_sub_sup_le_add_norm (a b c d : α) : ‖a ⊔ b - c ⊔ d‖ ≤ ‖a - c‖ + ‖b - d‖

{α : Type u_1}
[NormedLatticeAddCommGroup α]
(a b c d : α)


@[simp]
theorem prod_apply {α ι ι'} (l : Line α ι) (l' : Line α ι') (x : α) :
    l.prod l' x = Sum.elim (l x) (l' x)

{α : Type u_5}
{ι : Type u_6}
{ι' : Type u_7}
(l : Combinatorics.Line α ι)
(l' : Combinatorics.Line α ι')
(x : α)

(fun x i => ((l.prod l').idxFun i).getD x) x =
  Sum.elim ((fun x i => (l.idxFun i).getD x) x) ((fun x i => (l'.idxFun i).getD x) x)


theorem zipLeft_eq_zipLeft' (as : List α) (bs : List β) : zipLeft as bs = (zipLeft' as bs).fst

{α : Type u}
{β : Type v}
(as : List α)
(bs : List β)


@[simp]
theorem symm_toLinearEquiv (e : M₁ ≃SL[σ₁₂] M₂) : e.symm.toLinearEquiv = e.toLinearEquiv.symm

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{σ₂₁ : R₂ →+* R₁}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₂ M₂]
(e : M₁ ≃SL[σ₁₂] M₂)


@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
lemma pi_nonempty : (s.pi t).Nonempty ↔ ∀ a ∈ s, (t a).Nonempty

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


/-- A nonempty open subset of a preirreducible subspace is dense in the subspace. -/
theorem subset_closure_inter_of_isPreirreducible_of_isOpen {S U : Set X} (hS : IsPreirreducible S)
    (hU : IsOpen U) (h : (S ∩ U).Nonempty) : S ⊆ closure (S ∩ U)

{X : Type u_1}
[TopologicalSpace X]
{S U : Set X}
(hS : IsPreirreducible S)
(hU : IsOpen U)
(h : (S ∩ U).Nonempty)


/-- `sinh` is injective, `∀ a b, sinh a = sinh b → a = b`. -/
theorem sinh_injective : Function.Injective sinh


@[to_additive (attr := simp)]
theorem lowerClosure_one : lowerClosure (1 : Set α) = 1


theorem HasDerivWithinAt.hasFDerivWithinAt {f' : F} :
    HasDerivWithinAt f f' s x → HasFDerivWithinAt f (smulRight (1 : 𝕜 →L[𝕜] 𝕜) f') s x

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

HasDerivWithinAt f f' s x → HasFDerivWithinAt f (ContinuousLinearMap.smulRight 1 f') s x


/-- The function `ContinuousLinearMap.mulLeftRight : 𝕜' × 𝕜' → (𝕜' →L[𝕜] 𝕜')` is a bounded
bilinear map. -/
theorem ContinuousLinearMap.mulLeftRight_isBoundedBilinear (𝕜' : Type*) [NormedRing 𝕜']
    [NormedAlgebra 𝕜 𝕜'] :
    IsBoundedBilinearMap 𝕜 fun p : 𝕜' × 𝕜' => ContinuousLinearMap.mulLeftRight 𝕜 𝕜' p.1 p.2

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
(𝕜' : Type u_5)
[NormedRing 𝕜']
[NormedAlgebra 𝕜 𝕜']

IsBoundedBilinearMap 𝕜 fun p => ((ContinuousLinearMap.mulLeftRight 𝕜 𝕜') p.1) p.2


/-- The shift functor `Triangle C ⥤ Triangle C` by `n : ℤ` sends a triangle
to the triangle obtained by shifting the objects by `n` in `C` and by
multiplying the three morphisms by `(-1)^n`. -/
@[simps]
noncomputable def Triangle.shiftFunctor (n : ℤ) : Triangle C ⥤ Triangle C

(T : CategoryTheory.Pretriangulated.Triangle C)

(CategoryTheory.Pretriangulated.Triangle.shiftFunctor C n).obj T =
  CategoryTheory.Pretriangulated.Triangle.mk (n.negOnePow • (CategoryTheory.shiftFunctor C n).map T.mor₁)
    (n.negOnePow • (CategoryTheory.shiftFunctor C n).map T.mor₂)
    (n.negOnePow •
      CategoryTheory.CategoryStruct.comp ((CategoryTheory.shiftFunctor C n).map T.mor₃)
        ((CategoryTheory.shiftFunctorComm C 1 n).hom.app T.obj₁))


@[simp]
theorem DList_lazy {α : Type*} {l : List α} : DList.lazy_ofList l = Batteries.DList.ofList l

Batteries.DList.lazy_ofList { fn := fun x => l } = Batteries.DList.ofList l


@[to_additive]
lemma mem_powers_iff_mem_zpowers : y ∈ powers x ↔ y ∈ zpowers x

{G : Type u_1}
[AddGroup G]
[Finite G]
{x y : G}

y ∈ AddSubmonoid.multiples x ↔ y ∈ AddSubgroup.zmultiples x


theorem essSup_const_mul {a : ℝ≥0∞} : essSup (fun x : α => a * f x) μ = a * essSup f μ

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

essSup (fun x => a * f x) μ = a * essSup f μ


@[simp]
theorem mem_pairSep {p} {x y z : ZFSet.{u}} :
    z ∈ pairSep p x y ↔ ∃ a ∈ x, ∃ b ∈ y, z = pair a b ∧ p a b

{p : ZFSet → ZFSet → Prop}
{x y z : ZFSet}

z ∈ ZFSet.pairSep p x y ↔ ∃ a ∈ x, ∃ b ∈ y, z = a.pair b ∧ p a b


@[to_additive]
nonrec theorem Smooth.div {f g : M → G} (hf : Smooth I' I f) (hg : Smooth I' I g) :
    Smooth I' I (f / g)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_5}
[TopologicalSpace G]
[ChartedSpace H G]
[Group G]
[LieGroup I G]
{E' : Type u_6}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_7}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_8}
[TopologicalSpace M]
[ChartedSpace H' M]
{f g : M → G}
(hf : Smooth I' I f)
(hg : Smooth I' I g)


/-- Definition of `IsLittleO` in terms of `IsBigOWith`. -/
theorem isLittleO_iff_forall_isBigOWith : f =o[l] g ↔ ∀ ⦃c : ℝ⦄, 0 < c → IsBigOWith c l f g

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{f : α → E}
{g : α → F}
{l : Filter α}

f =o[l] g ↔ ∀ ⦃c : ℝ⦄, 0 < c → Asymptotics.IsBigOWith c l f g


theorem isBigO_snd_prod' {f' : α → E' × F'} : (fun x => (f' x).2) =O[l] f'

{α : Type u_1}
{E' : Type u_6}
{F' : Type u_7}
[SeminormedAddCommGroup E']
[SeminormedAddCommGroup F']
{l : Filter α}
{f' : α → E' × F'}


/-- A locally compact Hausdorff space is totally disconnected
  if and only if it is totally separated. -/
theorem loc_compact_t2_tot_disc_iff_tot_sep :
    TotallyDisconnectedSpace H ↔ TotallySeparatedSpace H

{H : Type u_3}
[TopologicalSpace H]
[LocallyCompactSpace H]
[T2Space H]


/-- These are actually equal, of course, but not definitionally equal
  (the equality requires F.map (𝟙 _) = 𝟙 _). A natural isomorphism is
  more convenient than an equality between functors (compare id_to_iso). -/
@[simps]
def constComp (X : C) (F : C ⥤ D) : (const J).obj X ⋙ F ≅ (const J).obj (F.obj X)

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

∀ (x : J), (CategoryTheory.Functor.constComp J X F).hom.app x = 𝟙 (((CategoryTheory.Functor.const J).obj X ⋙ F).obj x)


theorem AddGroup.fg_iff_mul_fg : AddGroup.FG H ↔ Group.FG (Multiplicative H)


@[to_additive (attr := elab_as_elim)]
theorem induction_on {p : Localization S → Prop} (x) (H : ∀ y : M × S, p (mk y.1 y.2)) : p x

(H : ∀ (y : M × ↥S), p (AddLocalization.mk y.1 y.2))


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


lemma map_normEDS (n : ℤ) : f (normEDS b c d n) = normEDS (f b) (f c) (f d) n

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
(f : R →+* S)
(b c d : R)
(n : ℤ)


@[fun_prop]
theorem differentiableWithinAt_inv' {x : R} (hx : x ≠ 0) (s : Set R) :
    DifferentiableWithinAt 𝕜 (fun x => x⁻¹) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{R : Type u_6}
[NormedDivisionRing R]
[NormedAlgebra 𝕜 R]
[CompleteSpace R]
{x : R}
(hx : x ≠ 0)
(s : Set R)


theorem directedOn_univ [IsDirected α r] : DirectedOn r Set.univ

{α : Type u}
{r : α → α → Prop}
[IsDirected α r]


@[to_additive (attr := simp) card_eq_one]
theorem card_eq_one : Nat.card H = 1 ↔ H = ⊥

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


@[simp]
theorem deriv_arctan (hc : DifferentiableAt ℝ f x) :
    deriv (fun x => arctan (f x)) x = 1 / (1 + f x ^ 2) * deriv f x

{f : ℝ → ℝ}
{x : ℝ}
(hc : DifferentiableAt ℝ f x)

deriv (fun x => Real.arctan (f x)) x = 1 / (1 + f x ^ 2) * deriv f x


lemma liftBaseChange_one_tmul (l : M →ₗ[R] N) (y) : l.liftBaseChange A (1 ⊗ₜ y) = l y

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
(A : Type u_4)
[CommSemiring R]
[CommSemiring A]
[Algebra R A]
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
[Module A N]
[IsScalarTower R A N]
(l : M →ₗ[R] N)
(y : M)

(LinearMap.liftBaseChange A l) (1 ⊗ₜ[R] y) = l y


/-- Given an element `a` of the submonoid of a monoid `M` generated by a set `s`, there exists
a list of elements of `s` whose product is `a`. -/
@[to_additive
      "Given an element `a` of the `AddSubmonoid` of an `AddMonoid M` generated by
      a set `s`, there exists a list of elements of `s` whose sum is `a`."]
theorem exists_list_of_mem_closure {s : Set M} {a : M} (h : a ∈ Closure s) :
    ∃ l : List M, (∀ x ∈ l, x ∈ s) ∧ l.prod = a

{M : Type u_1}
[Monoid M]
{s : Set M}
{a : M}
(h : a ∈ Monoid.Closure s)


@[simp]
theorem toIntLinearEquiv_symm : e.toIntLinearEquiv.symm = e.symm.toIntLinearEquiv

{M : Type u_8}
{M₂ : Type u_10}
[AddCommGroup M]
[AddCommGroup M₂]
(e : M ≃+ M₂)


theorem dropWhile_idempotent : dropWhile p (dropWhile p l) = dropWhile p l

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

List.dropWhile p (List.dropWhile p l) = List.dropWhile p l


lemma eq_of_preimage_val_eq_of_subset (hB : B ⊆ A) (hC : C ⊆ A) (h : A ↓∩ B = A ↓∩ C) : B = C

(h : Subtype.val ⁻¹' B = Subtype.val ⁻¹' C)


@[simp]
theorem comp_id (F : L →ᴸ L') : F ∘ᴸ LHom.id L = F

{L : FirstOrder.Language}
{L' : FirstOrder.Language}
(F : L →ᴸ L')

F.comp (FirstOrder.Language.LHom.id L) = F


theorem mem_coclosed_Lindelof' : s ∈ coclosedLindelof X ↔
    ∃ t, IsClosed t ∧ IsLindelof t ∧ sᶜ ⊆ t

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

s ∈ Filter.coclosedLindelof X ↔ ∃ t, IsClosed t ∧ IsLindelof t ∧ sᶜ ⊆ t


@[to_additive (attr := simp)]
theorem lift_comp_of : (lift f).comp of = f

{α : Type u}
[Add α]
{β : Type v}
[AddSemigroup β]
(f : AddHom α β)

(AddMagma.FreeAddSemigroup.lift f).comp AddMagma.FreeAddSemigroup.of = f


@[simp]
theorem nhdsSet_empty : 𝓝ˢ (∅ : Set X) = ⊥


theorem iff_assoc {a b c : Prop} : ((a ↔ b) ↔ c) ↔ (a ↔ (b ↔ c))


theorem IsLittleO.right_isTheta_add' {f₁ f₂ : α → E'} (h : f₁ =o[l] f₂) :
    f₂ =Θ[l] (f₂ + f₁)

{α : Type u_1}
{E' : Type u_6}
[SeminormedAddCommGroup E']
{l : Filter α}
{f₁ f₂ : α → E'}
(h : f₁ =o[l] f₂)


theorem tendsto_div_exp_atTop (p : ℝ[X]) : Tendsto (fun x ↦ p.eval x / exp x) atTop (𝓝 0)

Filter.Tendsto (fun x => Polynomial.eval x p / rexp x) Filter.atTop (𝓝 0)


/-- A σ-compact Hausdorff topological manifold over a finite dimensional real vector space is
metrizable. -/
theorem ManifoldWithCorners.metrizableSpace {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    [FiniteDimensional ℝ E] {H : Type*} [TopologicalSpace H] (I : ModelWithCorners ℝ E H)
    (M : Type*) [TopologicalSpace M] [ChartedSpace H M] [SigmaCompactSpace M] [T2Space M] :
    MetrizableSpace M

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type u_2}
[TopologicalSpace H]
(I : ModelWithCorners ℝ E H)
(M : Type u_3)
[TopologicalSpace M]
[ChartedSpace H M]
[SigmaCompactSpace M]
[T2Space M]


theorem Finite.infsep [Decidable s.Nontrivial] (hsf : s.Finite) :
    s.infsep =
      if hs : s.Nontrivial then hsf.offDiag.toFinset.inf' (by simpa) (uncurry dist) else 0

{α : Type u_1}
[PseudoMetricSpace α]
{s : Set α}
[Decidable s.Nontrivial]
(hsf : s.Finite)

s.infsep = if hs : s.Nontrivial then ⋯.toFinset.inf' ⋯ (Function.uncurry dist) else 0


/-- Composition of paths as functor from the path category of a category to the category. -/
@[simps]
def pathComposition : Paths C ⥤ C

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

∀ {X Y : CategoryTheory.Paths C} (f : X ⟶ Y), (CategoryTheory.pathComposition C).map f = CategoryTheory.composePath f


/-- The inclusion of `Aut X` to `End X` as a monoid homomorphism. -/
@[simps!]
def toEnd (X : C) : Aut X →* End X

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

∀ (a : CategoryTheory.Aut X), (CategoryTheory.Aut.toEnd X) a = ↑((CategoryTheory.Aut.unitsEndEquivAut X).symm a)


@[simps]
instance : MonoidalCategoryStruct (FullSubcategory P)

{X₁ X₂ : CategoryTheory.FullSubcategory P}

CategoryTheory.MonoidalCategory.whiskerRight f Y = CategoryTheory.MonoidalCategory.whiskerRight f Y.obj


@[to_additive (attr := simp)]
theorem map₂_mul : map₂ (· * ·) f g = f * g

Filter.map₂ (fun x x_1 => x * x_1) f g = f * g


@[simp, norm_cast]
theorem dist_lt_coe {x y : α} {c : ℝ≥0} : dist x y < c ↔ nndist x y < c

{α : Type u}
[PseudoMetricSpace α]
{x y : α}
{c : ℝ≥0}


/-- Given a box `I` in `ℝⁿ`, a function `r : ℝⁿ → (0, ∞)`, and a prepartition `π` of `I`, there
exists a tagged prepartition `π'` of `I` such that

* each box of `π'` is included in some box of `π`;
* `π'` is a Henstock partition;
* `π'` is subordinate to `r`;
* `π'` covers exactly the same part of `I` as `π`;
* the distortion of `π'` is equal to the distortion of `π`.
-/
theorem exists_tagged_le_isHenstock_isSubordinate_iUnion_eq {I : Box ι} (r : (ι → ℝ) → Ioi (0 : ℝ))
    (π : Prepartition I) :
    ∃ π' : TaggedPrepartition I, π'.toPrepartition ≤ π ∧ π'.IsHenstock ∧ π'.IsSubordinate r ∧
      π'.distortion = π.distortion ∧ π'.iUnion = π.iUnion

{ι : Type u_1}
[Fintype ι]
{I : BoxIntegral.Box ι}
(r : (ι → ℝ) → ↑(Set.Ioi 0))
(π : BoxIntegral.Prepartition I)

∃ π', π'.toPrepartition ≤ π ∧ π'.IsHenstock ∧ π'.IsSubordinate r ∧ π'.distortion = π.distortion ∧ π'.iUnion = π.iUnion


theorem zeroLocus_inf (I J : Ideal R) :
    zeroLocus ((I ⊓ J : Ideal R) : Set R) = zeroLocus I ∪ zeroLocus J

{R : Type u}
[CommSemiring R]
(I J : Ideal R)

PrimeSpectrum.zeroLocus ↑(I ⊓ J) = PrimeSpectrum.zeroLocus ↑I ∪ PrimeSpectrum.zeroLocus ↑J


@[simp]
theorem digitsAux_zero (b : ℕ) (h : 2 ≤ b) : digitsAux b h 0 = []


theorem toSubring_inj {R : Type u} {A : Type v} [CommRing R] [Ring A] [Algebra R A]
    {S U : Subalgebra R A} : S.toSubring = U.toSubring ↔ S = U


theorem torsionBy_le_torsionBy_of_dvd (a b : R) (dvd : a ∣ b) :
    torsionBy R M a ≤ torsionBy R M b

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(a b : R)
(dvd : a ∣ b)

Submodule.torsionBy R M a ≤ Submodule.torsionBy R M b


/-- For a nonempty set, the affine span is `⊤` iff its vector span is `⊤`. -/
theorem affineSpan_eq_top_iff_vectorSpan_eq_top_of_nonempty {s : Set P} (hs : s.Nonempty) :
    affineSpan k s = ⊤ ↔ vectorSpan k s = ⊤

(k : Type u_1)
(V : Type u_2)
(P : Type u_3)
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{s : Set P}
(hs : s.Nonempty)


theorem hasFiniteIntegral_iff_ofNNReal {f : α → ℝ≥0} :
    HasFiniteIntegral (fun x => (f x : ℝ)) μ ↔ (∫⁻ a, f a ∂μ) < ∞

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

MeasureTheory.HasFiniteIntegral (fun x => ↑(f x)) μ ↔ ∫⁻ (a : α), ↑(f a) ∂μ < ⊤


theorem iff_op : HasLift sq ↔ HasLift sq.op

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{A B X Y : C}
{f : A ⟶ X}
{i : A ⟶ B}
{p : X ⟶ Y}
{g : B ⟶ Y}
(sq : CategoryTheory.CommSq f i p g)


/-- The composition of locally Lipschitz functions is locally Lipschitz. --/
protected lemma comp  {f : β → γ} {g : α → β}
    (hf : LocallyLipschitz f) (hg : LocallyLipschitz g) : LocallyLipschitz (f ∘ g)

{α : Type u}
{β : Type v}
{γ : Type w}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
[PseudoEMetricSpace γ]
{f : β → γ}
{g : α → β}
(hf : LocallyLipschitz f)
(hg : LocallyLipschitz g)


@[simp, nolint simpNF, norm_cast] lemma intCast_eq_one {n : ℤ} : (n : ℚ) = 1 ↔ n = 1


theorem InitialSeg.ltOrEq_apply_left [IsWellOrder β s] (f : r ≼i s) (g : r ≺i s) (a : α) :
    g a = f a

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
[IsWellOrder β s]
(f : r ≼i s)
(g : r ≺i s)
(a : α)


theorem upperBounds_mono_set ⦃s t : Set α⦄ (hst : s ⊆ t) : upperBounds t ⊆ upperBounds s

{α : Type u}
[Preorder α]
⦃s t : Set α⦄
(hst : s ⊆ t)


@[to_additive (attr := simp)]
theorem mulIndicator_of_mem (h : a ∈ s) (f : α → M) : mulIndicator s f a = f a

{α : Type u_1}
{M : Type u_4}
[Zero M]
{s : Set α}
{a : α}
(h : a ∈ s)
(f : α → M)


/-- rotateLeft is invariant under `mod` by the bitwidth. -/
@[simp]
theorem rotateLeft_mod_eq_rotateLeft {x : BitVec w} {r : Nat} :
    x.rotateLeft (r % w) = x.rotateLeft r


/-- If a functor `F : C ⥤ D` is equipped with "commutation isomorphisms" with the
shifts by `a` and `b`, then there is a commutation isomorphism with the shift by `c` when
`a + b = c`. -/
@[simps!]
noncomputable def isoAdd' {a b c : A} (h : a + b = c)
    (e₁ : shiftFunctor C a ⋙ F ≅ F ⋙ shiftFunctor D a)
    (e₂ : shiftFunctor C b ⋙ F ≅ F ⋙ shiftFunctor D b) :
    shiftFunctor C c ⋙ F ≅ F ⋙ shiftFunctor D c

(e₁ : (CategoryTheory.shiftFunctor C a).comp F ≅ F.comp (CategoryTheory.shiftFunctor D a))

(e₂ : (CategoryTheory.shiftFunctor C b).comp F ≅ F.comp (CategoryTheory.shiftFunctor D b))

(CategoryTheory.Functor.CommShift.isoAdd' h e₁ e₂).hom.app X =
  CategoryTheory.CategoryStruct.comp (F.map ((CategoryTheory.shiftFunctorAdd' C a b c h).hom.app X))
    (CategoryTheory.CategoryStruct.comp (e₂.hom.app ((CategoryTheory.shiftFunctor C a).obj X))
      (CategoryTheory.CategoryStruct.comp ((CategoryTheory.shiftFunctor D b).map (e₁.hom.app X))
        ((CategoryTheory.shiftFunctorAdd' D a b c h).inv.app (F.obj X))))


@[simp]
theorem String.length_data (s : String) : s.data.length = s.length


/--
If the unit and counit of a given adjunction are (pointwise) isomorphisms, then we can upgrade the
adjunction to an equivalence.
-/
@[simps!]
noncomputable def toEquivalence (adj : F ⊣ G) [∀ X, IsIso (adj.unit.app X)]
    [∀ Y, IsIso (adj.counit.app Y)] : C ≌ D

[∀ (X : C), CategoryTheory.IsIso (adj.unit.app X)]

[∀ (Y : D), CategoryTheory.IsIso (adj.counit.app Y)]

adj.toEquivalence.unitIso.inv.app X = CategoryTheory.inv (adj.unit.app X)


/-- The morphism `triangle φ₁ ⟶ triangle φ₂` that is induced by a commutative square. -/
@[simps]
noncomputable def triangleMap :
    triangle φ₁ ⟶ triangle φ₂

(φ₁ : K₁ ⟶ L₁)

(φ₂ : K₂ ⟶ L₂)

(CochainComplex.mappingCone.triangleMap φ₁ φ₂ a b comm).hom₂ = b


theorem Matrix.represents_iff {A : Matrix ι ι R} {f : Module.End R M} :
    A.Represents b f ↔ ∀ x, Fintype.total R R b (A *ᵥ x) = f (Fintype.total R R b x)

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

Matrix.Represents b A f ↔ ∀ (x : ι → R), ((Fintype.total R R) b) (A *ᵥ x) = f (((Fintype.total R R) b) x)


@[to_additive]
theorem invRev_bijective : Function.Bijective (@invRev α)


theorem integral_convolution [MeasurableAdd₂ G] [MeasurableNeg G] [NormedSpace ℝ E]
    [NormedSpace ℝ E'] [CompleteSpace E] [CompleteSpace E'] (hf : Integrable f ν)
    (hg : Integrable g μ) : ∫ x, (f ⋆[L, ν] g) x ∂μ = L (∫ x, f x ∂ν) (∫ x, g x ∂μ)

{𝕜 : Type u𝕜}
{G : Type uG}
{E : Type uE}
{E' : Type uE'}
{F : Type uF}
[NormedAddCommGroup E]
[NormedAddCommGroup E']
[NormedAddCommGroup F]
{f : G → E}
{g : G → E'}
[RCLike 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 E']
[NormedSpace ℝ F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
[MeasurableSpace G]
{μ ν : MeasureTheory.Measure G}
(L : E →L[𝕜] E' →L[𝕜] F)
[AddGroup G]
[MeasureTheory.SFinite μ]
[MeasureTheory.SFinite ν]
[μ.IsAddRightInvariant]
[MeasurableAdd₂ G]
[MeasurableNeg G]
[NormedSpace ℝ E]
[NormedSpace ℝ E']
[CompleteSpace E]
[CompleteSpace E']
(hf : MeasureTheory.Integrable f ν)
(hg : MeasureTheory.Integrable g μ)

∫ (x : G), MeasureTheory.convolution f g L ν x ∂μ = (L (∫ (x : G), f x ∂ν)) (∫ (x : G), g x ∂μ)


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

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

∀ (a : LocallyConstant Y Z) (a_1 : X), ((LocallyConstant.congrLeftₗ R e).symm a) a_1 = a (e a_1)


theorem sumDiffSubset_symm_apply_of_mem {α} {s t : Set α} (h : s ⊆ t) [DecidablePred (· ∈ s)]
    {x : t} (hx : x.1 ∈ s) : (Equiv.Set.sumDiffSubset h).symm x = Sum.inl ⟨x, hx⟩

{α : Type u_1}
{s t : Set α}
(h : s ⊆ t)
[DecidablePred fun x => x ∈ s]
{x : ↑t}
(hx : ↑x ∈ s)

(Equiv.Set.sumDiffSubset h).symm x = Sum.inl ⟨↑x, hx⟩


theorem add_eq_add_le (a c : Nat) {b d : Nat} (h : b ≤ d) : (a + b = c + d) = (a = c + (d - b))


@[simp] theorem endofunctorMonoidalCategory_rightUnitor_hom_app (F : C ⥤ C) (X : C) :
  (ρ_ F).hom.app X = 𝟙 _

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

(CategoryTheory.MonoidalCategory.rightUnitor F).hom.app X =
  CategoryTheory.CategoryStruct.id
    ((CategoryTheory.MonoidalCategory.tensorObj F (𝟙_ (CategoryTheory.Functor C C))).obj X)


lemma coe_mul_eq_bind {a : α} (ha : a ≠ 0) : ∀ b, (a * b : WithBot α) = b.bind fun b ↦ ↑(a * b)

{α : Type u_1}
[DecidableEq α]
[MulZeroClass α]
{a : α}
(ha : a ≠ 0)
(b : WithBot α)

↑a * b = Option.bind b fun b => some (a * b)


theorem map_iSup {ι : Sort*} (f : F) (s : ι → NonUnitalSubsemiring R) :
    (map f (iSup s) : NonUnitalSubsemiring S) = ⨆ i, map f (s i)

{R : Type u}
{S : Type v}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
{F : Type u_1}
[FunLike F R S]
[NonUnitalRingHomClass F R S]
{ι : Sort u_2}
(f : F)
(s : ι → NonUnitalSubsemiring R)

NonUnitalSubsemiring.map f (iSup s) = ⨆ i, NonUnitalSubsemiring.map f (s i)


theorem coe_quotientInfToSupQuotient (p p' : Submodule R M) :
    ⇑(quotientInfToSupQuotient p p') = quotientInfEquivSupQuotient p p'

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

⇑(LinearMap.quotientInfToSupQuotient p p') = ⇑(LinearMap.quotientInfEquivSupQuotient p p')


@[simp]
theorem coeff_C_zero : coeff (C a) 0 = a


@[simp]
theorem single_zero (i) : (single i 0 : Π₀ i, β i) = 0

{ι : Type u}
{β : ι → Type v}
[DecidableEq ι]
[(i : ι) → Zero (β i)]
(i : ι)


/-- If a `ContMDiff` function `f : M → E`, where `M` is some manifold, takes values in the
sphere, then it restricts to a `ContMDiff` function from `M` to the sphere. -/
theorem ContMDiff.codRestrict_sphere {n : ℕ} [Fact (finrank ℝ E = n + 1)] {m : ℕ∞} {f : M → E}
    (hf : ContMDiff I 𝓘(ℝ, E) m f) (hf' : ∀ x, f x ∈ sphere (0 : E) 1) :
    ContMDiff I (𝓡 n) m (Set.codRestrict _ _ hf' : M → sphere (0 : E) 1)

[Fact (FiniteDimensional.finrank ℝ E = n + 1)]

(hf' : ∀ (x : M), f x ∈ Metric.sphere 0 1)

ContMDiff I 𝓘(ℝ, EuclideanSpace ℝ (Fin n)) m (Set.codRestrict f (Metric.sphere 0 1) hf')


@[deprecated (since := "2023-12-24")]
protected theorem IsTopologicalBasis.continuous {β : Type*} [TopologicalSpace β] {B : Set (Set β)}
    (hB : IsTopologicalBasis B) (f : α → β) (hf : ∀ s ∈ B, IsOpen (f ⁻¹' s)) : Continuous f

(hB : TopologicalSpace.IsTopologicalBasis B)


theorem IsUpperSet.ordConnected (h : IsUpperSet s) : s.OrdConnected

{α : Type u_1}
[Preorder α]
{s : Set α}
(h : IsUpperSet s)


@[mono]
theorem integral_mono {f g : α → ℝ} (hf : Integrable f μ) (hg : Integrable g μ) (h : f ≤ g) :
    ∫ a, f a ∂μ ≤ ∫ a, g a ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : α → ℝ}
(hf : MeasureTheory.Integrable f μ)
(hg : MeasureTheory.Integrable g μ)
(h : f ≤ g)


/-- A function `f` is an absolute value if it is nonnegative, zero only at 0, additive, and
multiplicative.

See also the type `AbsoluteValue` which represents a bundled version of absolute values.
-/
class IsAbsoluteValue {S} [OrderedSemiring S] {R} [Semiring R] (f : R → S) : Prop where
  /-- The absolute value is nonnegative -/
  abv_nonneg' : ∀ x, 0 ≤ f x
  /-- The absolute value is positive definitive -/
  abv_eq_zero' : ∀ {x}, f x = 0 ↔ x = 0
  /-- The absolute value satisfies the triangle inequality -/
  abv_add' : ∀ x y, f (x + y) ≤ f x + f y
  /-- The absolute value is multiplicative -/
  abv_mul' : ∀ x y, f (x * y) = f x * f y

{S : Type u_5}
[OrderedSemiring S]
{R : Type u_6}
[Semiring R]
{f : R → S}
[self : IsAbsoluteValue f]
(x : R)


@[simp]
lemma map_b₆ : (W.map φ).b₆ = φ W.b₆

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
{A : Type v}
[CommRing A]
(φ : R →+* A)


theorem interpolate_empty : interpolate ∅ v r = 0

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


theorem continuousAt_iff'_left [TopologicalSpace β] {f : β → α} {b : β} :
    ContinuousAt f b ↔ Tendsto (fun x => (f x, f b)) (𝓝 b) (𝓤 α)

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

ContinuousAt f b ↔ Filter.Tendsto (fun x => (f x, f b)) (𝓝 b) (𝓤 α)


theorem CauSeq.tendsto_limit [NormedRing β] [hn : IsAbsoluteValue (norm : β → ℝ)]
    (f : CauSeq β norm) [CauSeq.IsComplete β norm] : Tendsto f atTop (𝓝 f.lim)

{β : Type v}
[NormedRing β]
[hn : IsAbsoluteValue norm]
(f : CauSeq β norm)
[CauSeq.IsComplete β norm]

Filter.Tendsto (↑f) Filter.atTop (𝓝 f.lim)


@[simp]
theorem map_tail (f : α → β) (l) : map f (tail l) = tail (map f l)

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


/-- A version of `Equiv.optionCongr` for `WithTop`. -/
@[simps! apply]
def withTopCongr (e : α ≃o β) : WithTop α ≃o WithTop β

{α : Type u_2}
{β : Type u_3}
[PartialOrder α]
[PartialOrder β]
(e : α ≃o β)

∀ (a : Option α), e.withTopCongr a = Option.map (⇑e) a


/-- `OrderDual` as a functor. -/
@[simps]
def dual : CompleteLat ⥤ CompleteLat

{X Y : CompleteLat}
(a : CompleteLatticeHom ↑X ↑Y)

CompleteLat.dual.map a = CompleteLatticeHom.dual a


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

{M : Type u_1}
[AddMonoid M]
(S : AddSubmonoid M)
{x : AddUnits M}
(h : x ∈ S.addUnits)


/-- Given homology map data for morphisms `φ` and `φ'`, this is the induced homology
map data for `φ + φ'`. -/
@[simps]
def add : HomologyMapData (φ + φ') h₁ h₂

(γ : CategoryTheory.ShortComplex.HomologyMapData φ h₁ h₂)

(γ' : CategoryTheory.ShortComplex.HomologyMapData φ' h₁ h₂)


@[simp]
theorem card_embedding_eq {α β : Type*} [Fintype α] [Fintype β] [emb : Fintype (α ↪ β)] :
    ‖α ↪ β‖ = ‖β‖.descFactorial ‖α‖

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
[emb : Fintype (α ↪ β)]


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


/-- One sided martingale bound: If `f` is a submartingale which has uniformly bounded differences,
then for almost every `ω`, `f n ω` is bounded above (in `n`) if and only if it converges. -/
theorem Submartingale.bddAbove_iff_exists_tendsto [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ)
    (hbdd : ∀ᵐ ω ∂μ, ∀ i, |f (i + 1) ω - f i ω| ≤ R) :
    ∀ᵐ ω ∂μ, BddAbove (Set.range fun n => f n ω) ↔ ∃ c, Tendsto (fun n => f n ω) atTop (𝓝 c)

{f : ℕ → Ω → ℝ}

(hf : MeasureTheory.Submartingale f ℱ μ)

(hbdd : ∀ᵐ (ω : Ω) ∂μ, ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R)

∀ᵐ (ω : Ω) ∂μ, BddAbove (Set.range fun n => f n ω) ↔ ∃ c, Filter.Tendsto (fun n => f n ω) Filter.atTop (𝓝 c)


theorem stronglyMeasurable_deriv_with_param [LocallyCompactSpace 𝕜] [MeasurableSpace 𝕜]
    [OpensMeasurableSpace 𝕜] [h : SecondCountableTopologyEither α F]
    {f : α → 𝕜 → F} (hf : Continuous f.uncurry) :
    StronglyMeasurable (fun (p : α × 𝕜) ↦ deriv (f p.1) p.2)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{α : Type u_4}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[CompleteSpace F]
[LocallyCompactSpace 𝕜]
[MeasurableSpace 𝕜]
[OpensMeasurableSpace 𝕜]
[h : SecondCountableTopologyEither α F]
{f : α → 𝕜 → F}
(hf : Continuous (Function.uncurry f))

MeasureTheory.StronglyMeasurable fun p => deriv (f p.1) p.2


theorem map_nhds_eq (hf : IsLocalHomeomorphOn f s) {x : X} (hx : x ∈ s) : (𝓝 x).map f = 𝓝 (f x)

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


theorem mul_mod_mul_left (z x y : Nat) : (z * x) % (z * y) = z * (x % y)


theorem toDualProd_injective : Injective (toDualProd : NonemptyInterval α → αᵒᵈ × α)


theorem antitone_lower : Antitone fun I : Box ι ↦ I.lower


theorem map_eq_self (x : R) : algebraMap R R x = x


/-- The `vectorSpan` of a finite set is finite-dimensional. -/
theorem finiteDimensional_vectorSpan_of_finite {s : Set P} (h : Set.Finite s) :
    FiniteDimensional k (vectorSpan k s)

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s : Set P}
(h : s.Finite)


/-- See also `AddMonoid.End.natCast_def`. -/
@[simp]
lemma natCast_apply [AddCommMonoid M] (n : ℕ) (m : M) : (↑n : AddMonoid.End M) m = n • m

{M : Type uM}
[AddCommMonoid M]
(n : ℕ)
(m : M)


/-- A preadditive category `C` with an additive shift, and a class of "distinguished triangles"
relative to that shift is called pretriangulated if the following hold:
* Any triangle that is isomorphic to a distinguished triangle is also distinguished.
* Any triangle of the form `(X,X,0,id,0,0)` is distinguished.
* For any morphism `f : X ⟶ Y` there exists a distinguished triangle of the form `(X,Y,Z,f,g,h)`.
* The triangle `(X,Y,Z,f,g,h)` is distinguished if and only if `(Y,Z,X⟦1⟧,g,h,-f⟦1⟧)` is.
* Given a diagram:
  ```
        f       g       h
    X  ───> Y  ───> Z  ───> X⟦1⟧
    │       │                │
    │a      │b               │a⟦1⟧'
    V       V                V
    X' ───> Y' ───> Z' ───> X'⟦1⟧
        f'      g'      h'
  ```
  where the left square commutes, and whose rows are distinguished triangles,
  there exists a morphism `c : Z ⟶ Z'` such that `(a,b,c)` is a triangle morphism.

See <https://stacks.math.columbia.edu/tag/0145>
-/
class Pretriangulated [∀ n : ℤ, Functor.Additive (shiftFunctor C n)] where
  /-- a class of triangle which are called `distinguished` -/
  distinguishedTriangles : Set (Triangle C)
  /-- a triangle that is isomorphic to a distinguished triangle is distinguished -/
  isomorphic_distinguished :
    ∀ T₁ ∈ distinguishedTriangles, ∀ (T₂) (_ : T₂ ≅ T₁), T₂ ∈ distinguishedTriangles
  /-- obvious triangles `X ⟶ X ⟶ 0 ⟶ X⟦1⟧` are distinguished -/
  contractible_distinguished : ∀ X : C, contractibleTriangle X ∈ distinguishedTriangles
  /-- any morphism `X ⟶ Y` is part of a distinguished triangle `X ⟶ Y ⟶ Z ⟶ X⟦1⟧` -/
  distinguished_cocone_triangle :
    ∀ {X Y : C} (f : X ⟶ Y),
      ∃ (Z : C) (g : Y ⟶ Z) (h : Z ⟶ X⟦(1 : ℤ)⟧), Triangle.mk f g h ∈ distinguishedTriangles
  /-- a triangle is distinguished iff it is so after rotating it -/
  rotate_distinguished_triangle :
    ∀ T : Triangle C, T ∈ distinguishedTriangles ↔ T.rotate ∈ distinguishedTriangles
  /-- given two distinguished triangle, a commutative square
        can be extended as morphism of triangles -/
  complete_distinguished_triangle_morphism :
    ∀ (T₁ T₂ : Triangle C) (_ : T₁ ∈ distinguishedTriangles) (_ : T₂ ∈ distinguishedTriangles)
      (a : T₁.obj₁ ⟶ T₂.obj₁) (b : T₁.obj₂ ⟶ T₂.obj₂) (_ : T₁.mor₁ ≫ b = a ≫ T₂.mor₁),
      ∃ c : T₁.obj₃ ⟶ T₂.obj₃, T₁.mor₂ ≫ c = b ≫ T₂.mor₂ ∧ T₁.mor₃ ≫ a⟦1⟧' = c ≫ T₂.mor₃

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

[self : CategoryTheory.Pretriangulated C]

∃ Z g h, CategoryTheory.Pretriangulated.Triangle.mk f g h ∈ CategoryTheory.Pretriangulated.distinguishedTriangles


theorem Smooth.contMDiff (h : Smooth I I' f) : ContMDiff I I' n f

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


theorem hasFiniteFPowerSeriesOnBall_changeOrigin (p : FormalMultilinearSeries 𝕜 E F) {n : ℕ}
    (k : ℕ) (hn : ∀ (m : ℕ), n + k ≤ m → p m = 0) :
    HasFiniteFPowerSeriesOnBall (p.changeOrigin · k) (p.changeOriginSeries k) 0 n ⊤

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)
{n : ℕ}
(k : ℕ)
(hn : ∀ (m : ℕ), n + k ≤ m → p m = 0)

HasFiniteFPowerSeriesOnBall (fun x => p.changeOrigin x k) (p.changeOriginSeries k) 0 n ⊤


theorem bipartiteAbove_swap : s.bipartiteAbove (swap r) b = s.bipartiteBelow r b

{α : Type u_1}
{β : Type u_2}
(r : α → β → Prop)
(s : Finset α)
(b : β)
[(a : α) → Decidable (r a b)]

Finset.bipartiteAbove (Function.swap r) s b = Finset.bipartiteBelow r s b


protected theorem HasBasis.nonempty (h : l.HasBasis p s) : Nonempty ι

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


theorem comp_right_injective (h : M ≃[L] N) :
    Function.Injective (fun f ↦ f.comp h : (N ≃[L] P) → (M ≃[L] P))

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
{P : Type u_1}
[L.Structure P]
(h : L.Equiv M N)


@[simp, norm_cast]
lemma _root_.ConvexCone.coe_toPointedCone {S : ConvexCone 𝕜 E} (hS : S.Pointed) :
    S.toPointedCone hS = S

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{S : ConvexCone 𝕜 E}
(hS : S.Pointed)


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

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

∀ {X Y : CategoryTheory.Arrow C} (F : X ⟶ Y), (CategoryTheory.SimplicialObject.augmentedCechNerve.map F).right = F.right


@[to_additive]
theorem HasProd.multipliable (h : HasProd f a) : Multipliable f

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β → α}
{a : α}
(h : HasSum f a)


@[simp]
theorem monic_X : Monic (X : R[X])


lemma mul_right_inj_of_invertible [Invertible A] {x y : Matrix n m α} : A * x = A * y ↔ x = y

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


@[to_additive (attr := simp)]
theorem le_div_self_iff (a : α) {b : α} : a ≤ a / b ↔ b ≤ 1

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


@[simp] lemma Lp.const_val : (Lp.const p μ c).1 = AEEqFun.const α c

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
(p : ℝ≥0∞)
(μ : MeasureTheory.Measure α)
[NormedAddCommGroup E]
[MeasureTheory.IsFiniteMeasure μ]
(c : E)

↑((MeasureTheory.Lp.const p μ) c) = MeasureTheory.AEEqFun.const α c


theorem subset_iff_eq_of_ncard_le (h : t.ncard ≤ s.ncard) (ht : t.Finite := by toFinite_tac) :
    s ⊆ t ↔ s = t

{α : Type u_1}
{s t : Set α}
(h : t.ncard ≤ s.ncard)
(ht : t.Finite := by toFinite_tac)


@[simp]
theorem val_one (n : ℕ) : (1 : AdicCompletion I R).val n = 1

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


theorem image_inter (hf : LeftInvOn f' f s) :
    f '' (s₁ ∩ s) = f' ⁻¹' (s₁ ∩ s) ∩ f '' s

{α : Type u_1}
{β : Type u_2}
{s s₁ : Set α}
{f : α → β}
{f' : β → α}
(hf : Set.LeftInvOn f' f s)


theorem mem_ℒ1_toReal_of_lintegral_ne_top {f : α → ℝ≥0∞} (hfm : AEMeasurable f μ)
    (hfi : (∫⁻ x, f x ∂μ) ≠ ∞) : Memℒp (fun x => (f x).toReal) 1 μ

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

MeasureTheory.Memℒp (fun x => (f x).toReal) 1 μ


@[simp]
theorem convex_vadd (a : E) : Convex 𝕜 (a +ᵥ s) ↔ Convex 𝕜 s

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
(a : E)


theorem indep_biSup_compl (h_le : ∀ n, s n ≤ m0) (h_indep : iIndep s μ) (t : Set ι) :
    Indep (⨆ n ∈ t, s n) (⨆ n ∈ tᶜ, s n) μ

(h_indep : ProbabilityTheory.iIndep s μ)

ProbabilityTheory.Indep (⨆ n ∈ t, s n) (⨆ n ∈ tᶜ, s n) μ


@[simp]
theorem symm_eq_iff {X Y : C} {α β : X ≅ Y} : α.symm = β.symm ↔ α = β

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
{α β : X ≅ Y}


/-- The stopped process of a submartingale with respect to a stopping time is a submartingale. -/
protected theorem Submartingale.stoppedProcess [IsFiniteMeasure μ] (h : Submartingale f 𝒢 μ)
    (hτ : IsStoppingTime 𝒢 τ) : Submartingale (stoppedProcess f τ) 𝒢 μ

{Ω : Type u_1}
{m0 : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
{𝒢 : MeasureTheory.Filtration ℕ m0}
{f : ℕ → Ω → ℝ}
{τ : Ω → ℕ}
[MeasureTheory.IsFiniteMeasure μ]
(h : MeasureTheory.Submartingale f 𝒢 μ)
(hτ : MeasureTheory.IsStoppingTime 𝒢 τ)

MeasureTheory.Submartingale (MeasureTheory.stoppedProcess f τ) 𝒢 μ


theorem BEx.intro (a : α) (h₁ : p a) (h₂ : P a h₁) : ∃ (x : _) (h : p x), P x h

{α : Sort u_1}
{p : α → Prop}
{P : (x : α) → p x → Prop}
(a : α)
(h₁ : p a)
(h₂ : P a h₁)


@[to_additive (attr := simp)]
lemma inv_right_iff : Commute a b⁻¹ ↔ Commute a b


theorem isConnected_setOf_wSameSide {s : AffineSubspace ℝ P} (x : P) (h : (s : Set P).Nonempty) :
    IsConnected { y | s.WSameSide x y }

{V : Type u_2}
{P : Type u_4}
[SeminormedAddCommGroup V]
[NormedSpace ℝ V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
{s : AffineSubspace ℝ P}
(x : P)
(h : (↑s).Nonempty)


protected theorem IsComplete.union {s t : Set α} (hs : IsComplete s) (ht : IsComplete t) :
    IsComplete (s ∪ t)

{α : Type u}
[uniformSpace : UniformSpace α]
{s t : Set α}
(hs : IsComplete s)
(ht : IsComplete t)


@[simp]
theorem swap_map_inr {X Y : D} {f : inr X ⟶ inr Y} : (swap C D).map f = f

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


theorem RestrictScalars.smul_def (c : R) (x : RestrictScalars R S M) :
    c • x = (RestrictScalars.addEquiv R S M).symm
      (algebraMap R S c • RestrictScalars.addEquiv R S M x)

(R : Type u_1)
(S : Type u_2)
(M : Type u_3)
[AddCommMonoid M]
[CommSemiring R]
[Semiring S]
[Algebra R S]
[Module S M]
(c : R)
(x : RestrictScalars R S M)

c • x = (RestrictScalars.addEquiv R S M).symm ((algebraMap R S) c • (RestrictScalars.addEquiv R S M) x)


theorem Ico_eq_finset_subtype : Ico a b = (Ico (a : ℕ) b).fin n

Finset.Ico a b = Finset.fin n (Finset.Ico ↑a ↑b)


/-- Allows us to apply lemmas about the underlying `ρ`, which would take an element `g : G` rather
than `g : MonCat.of G` as an argument. -/
theorem of_ρ_apply {V : Type u} [AddCommGroup V] [Module k V] (ρ : Representation k G V)
    (g : MonCat.of G) : (Rep.of ρ).ρ g = ρ (g : G)

{k G : Type u}
[CommRing k]
[Monoid G]
{V : Type u}
[AddCommGroup V]
[Module k V]
(ρ : Representation k G V)
(g : ↑(MonCat.of G))


/-- The equivalence `(ComposableArrows C n)ᵒᵖ ≌ ComposableArrows Cᵒᵖ n` obtained
by reversing the arrows. -/
@[simps!]
def opEquivalence : (ComposableArrows C n)ᵒᵖ ≌ ComposableArrows Cᵒᵖ n

(X : CategoryTheory.ComposableArrows Cᵒᵖ n)

(CategoryTheory.ComposableArrows.opEquivalence C n).inverse.obj X =
  Opposite.op
    ((⋯.functor.comp (CategoryTheory.orderDualEquivalence (Fin (n + 1))).functor).comp
      (CategoryTheory.Functor.leftOp X))


theorem convexOn_log_Gamma : ConvexOn ℝ (Ioi 0) (log ∘ Gamma)

ConvexOn ℝ (Set.Ioi 0) (Real.log ∘ Real.Gamma)


theorem isPath_def {u v : V} (p : G.Walk u v) : p.IsPath ↔ p.support.Nodup

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


@[simp] lemma toENat_eq_top {a : Cardinal} : toENat a = ⊤ ↔ ℵ₀ ≤ a

Cardinal.toENat a = ⊤ ↔ Cardinal.aleph0 ≤ a


/-- Transport a monoidal structure along an equivalence of (plain) categories.
-/
@[simps]
def transportStruct (e : C ≌ D) : MonoidalCategoryStruct.{v₂} D

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

∀ {X₁ X₂ : D} (f : X₁ ⟶ X₂) (X : D), f ▷ X = e.functor.map (e.inverse.map f ▷ e.inverse.obj X)


/-- The identity modification. -/
@[simps]
def id : Modification η η

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
{F G : CategoryTheory.OplaxFunctor B C}
(η : F ⟶ G)
(a : B)

(CategoryTheory.OplaxNatTrans.Modification.id η).app a = CategoryTheory.CategoryStruct.id (η.app a)


theorem IsPGroup.inf_normalizer_sylow {P : Subgroup G} (hP : IsPGroup p P) (Q : Sylow p G) :
    P ⊓ (Q : Subgroup G).normalizer = P ⊓ Q

{p : ℕ}
{G : Type u_1}
[Group G]
{P : Subgroup G}
(hP : IsPGroup p ↥P)
(Q : Sylow p G)


@[to_additive]
theorem dvd_index_map {f : G →* G'} (hf : f.ker ≤ H) :
    H.index ∣ (H.map f).index

{G : Type u_1}
{G' : Type u_2}
[Group G]
[Group G']
(H : Subgroup G)
{f : G →* G'}
(hf : f.ker ≤ H)


@[simp]
theorem eventually_sup {p : α → Prop} {f g : Filter α} :
    (∀ᶠ x in f ⊔ g, p x) ↔ (∀ᶠ x in f, p x) ∧ ∀ᶠ x in g, p x

{α : Type u}
{p : α → Prop}
{f g : Filter α}

(∀ᶠ (x : α) in f ⊔ g, p x) ↔ (∀ᶠ (x : α) in f, p x) ∧ ∀ᶠ (x : α) in g, p x


theorem hasDerivAt_iff_tendsto :
    HasDerivAt f f' x ↔ Tendsto (fun x' => ‖x' - x‖⁻¹ * ‖f x' - f x - (x' - x) • f'‖) (𝓝 x) (𝓝 0)

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

HasDerivAt f f' x ↔ Filter.Tendsto (fun x' => ‖x' - x‖⁻¹ * ‖f x' - f x - (x' - x) • f'‖) (𝓝 x) (𝓝 0)


theorem eventually_filterAt_iff {x : α} {P : Set α → Prop} :
    (∀ᶠ a in v.filterAt x, P a) ↔ ∃ ε > (0 : ℝ), ∀ a ∈ v.setsAt x, a ⊆ closedBall x ε → P a

{α : Type u_1}
[MetricSpace α]
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(v : VitaliFamily μ)
{x : α}
{P : Set α → Prop}

(∀ᶠ (a : Set α) in v.filterAt x, P a) ↔ ∃ ε > 0, ∀ a ∈ v.setsAt x, a ⊆ Metric.closedBall x ε → P a


theorem MeasurePreserving.setLIntegral_comp_preimage_emb {mb : MeasurableSpace β} {ν : Measure β}
    {g : α → β} (hg : MeasurePreserving g μ ν) (hge : MeasurableEmbedding g) (f : β → ℝ≥0∞)
    (s : Set β) : ∫⁻ a in g ⁻¹' s, f (g a) ∂μ = ∫⁻ b in s, f b ∂ν

(hg : MeasureTheory.MeasurePreserving g μ ν)

(f : β → ℝ≥0∞)

∫⁻ (a : α) in g ⁻¹' s, f (g a) ∂μ = ∫⁻ (b : β) in s, f b ∂ν


/-- When a homology data `h` of a short complex `S` is such that both `h.left` and
`h.right` are preserved by a functor `F`, this is the induced homology data
`h.map F` for the short complex `S.map F`. -/
@[simps]
noncomputable def HomologyData.map (h : S.HomologyData) (F : C ⥤ D) [F.PreservesZeroMorphisms]
    [h.left.IsPreservedBy F] [h.right.IsPreservedBy F] :
    (S.map F).HomologyData


theorem zmodEquivTrunc_compat (k₁ k₂ : ℕ) (hk : k₁ ≤ k₂) :
    (TruncatedWittVector.truncate hk).comp
        ((zmodEquivTrunc p k₂).toRingHom.comp (PadicInt.toZModPow k₂)) =
      (zmodEquivTrunc p k₁).toRingHom.comp (PadicInt.toZModPow k₁)

(p : ℕ)
[hp : Fact (Nat.Prime p)]
(k₁ k₂ : ℕ)
(hk : k₁ ≤ k₂)

(TruncatedWittVector.truncate hk).comp
    ((TruncatedWittVector.zmodEquivTrunc p k₂).toRingHom.comp (PadicInt.toZModPow k₂)) =
  (TruncatedWittVector.zmodEquivTrunc p k₁).toRingHom.comp (PadicInt.toZModPow k₁)


@[mono]
theorem Dense.mono (h : s₁ ⊆ s₂) (hd : Dense s₁) : Dense s₂

{X : Type u}
{s₁ s₂ : Set X}
[TopologicalSpace X]
(h : s₁ ⊆ s₂)
(hd : Dense s₁)


lemma variableChange_id : W.variableChange VariableChange.id = W

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

W.variableChange WeierstrassCurve.VariableChange.id = W


/-- If `U` is qcqs, then `Γ(X, D(f)) ≃ Γ(X, U)_f` for every `f : Γ(X, U)`.
This is known as the **Qcqs lemma** in [R. Vakil, *The rising sea*][RisingSea]. -/
theorem isIso_ΓSpec_adjunction_unit_app_basicOpen {X : Scheme} [CompactSpace X]
    [QuasiSeparatedSpace X] (f : X.presheaf.obj (op ⊤)) :
    IsIso ((ΓSpec.adjunction.unit.app X).val.c.app (op (PrimeSpectrum.basicOpen f)))

CategoryTheory.IsIso
  ((AlgebraicGeometry.ΓSpec.adjunction.unit.app X).val.c.app (Opposite.op (PrimeSpectrum.basicOpen f)))


@[simp]
theorem symm_symm (γ : Path x y) : γ.symm.symm = γ

{X : Type u_1}
[TopologicalSpace X]
{x y : X}
(γ : Path x y)


@[simp]
theorem differentiableAt_id' : DifferentiableAt 𝕜 (fun x => x) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}


theorem smooth_proj : Smooth (IB.prod 𝓘(𝕜, F)) IB (π F E)

[TopologicalSpace (Bundle.TotalSpace F E)]

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


@[ext]
theorem explicitCokernel_hom_ext {X Y Z : SemiNormedGrp.{u}} {f : X ⟶ Y}
    (e₁ e₂ : explicitCokernel f ⟶ Z) (h : explicitCokernelπ f ≫ e₁ = explicitCokernelπ f ≫ e₂) :
    e₁ = e₂

(e₁ e₂ : SemiNormedGrp.explicitCokernel f ⟶ Z)

(h : SemiNormedGrp.explicitCokernelπ f ≫ e₁ = SemiNormedGrp.explicitCokernelπ f ≫ e₂)


theorem degree_smul_of_smul_regular {S : Type*} [Monoid S] [DistribMulAction S R] {k : S}
    (p : R[X]) (h : IsSMulRegular R k) : (k • p).degree = p.degree

{R : Type u}
[Semiring R]
{S : Type u_1}
[Monoid S]
[DistribMulAction S R]
{k : S}
(p : R[X])
(h : IsSMulRegular R k)


protected theorem ContinuousLinearMap.hasDerivWithinAt : HasDerivWithinAt e (e 1) s x

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


theorem card_biUnion_le [DecidableEq β] {s : Finset α} {t : α → Finset β} :
    (s.biUnion t).card ≤ ∑ a ∈ s, (t a).card

{α : Type u_3}
{β : Type u_4}
[DecidableEq β]
{s : Finset α}
{t : α → Finset β}


theorem frontier_eq_closure_inter_closure : frontier s = closure s ∩ closure sᶜ

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


lemma mapBifunctorLeftUnitor_hasMap :
    HasMap (((mapBifunctor F I J).obj ((single₀ I).obj X)).obj Y) p

(F : CategoryTheory.Functor C (CategoryTheory.Functor D D))

(e : F.obj X ≅ CategoryTheory.Functor.id D)

[(Y : D) → CategoryTheory.Limits.PreservesColimit (CategoryTheory.Functor.empty C) (F.flip.obj Y)]

(((CategoryTheory.GradedObject.mapBifunctor F I J).obj ((CategoryTheory.GradedObject.single₀ I).obj X)).obj Y).HasMap p


theorem mem_mul {p q : SubMulAction R M} {x : M} : x ∈ p * q ↔ ∃ y ∈ p, ∃ z ∈ q, y * z = x

{R : Type u_1}
{M : Type u_2}
[Monoid R]
[MulAction R M]
[Mul M]
[IsScalarTower R M M]
{p q : SubMulAction R M}
{x : M}


theorem U_eq (n : ℤ) : U R n = 2 * X * U R (n - 1) - U R (n - 2)

Polynomial.Chebyshev.U R n = 2 * Polynomial.X * Polynomial.Chebyshev.U R (n - 1) - Polynomial.Chebyshev.U R (n - 2)


protected theorem add_tsub_assoc_of_le (hc : AddLECancellable c) (h : c ≤ b) (a : α) :
    a + b - c = a + (b - c)

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


/-- A strongly measurable function is almost everywhere measurable. -/
@[aesop 5% apply (rule_sets := [Measurable])]
protected theorem aemeasurable {_ : MeasurableSpace α} [TopologicalSpace β]
    [PseudoMetrizableSpace β] [MeasurableSpace β] [BorelSpace β] {μ : Measure α}
    (hf : StronglyMeasurable f) : AEMeasurable f μ

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

∀ {x : MeasurableSpace α} [inst : TopologicalSpace β] [inst_1 : TopologicalSpace.PseudoMetrizableSpace β]
  [inst_2 : MeasurableSpace β] [inst_3 : BorelSpace β] {μ : MeasureTheory.Measure α},
  MeasureTheory.StronglyMeasurable f → AEMeasurable f μ


theorem isOpenMap_inl : IsOpenMap (@inl X Y)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]


/-- Pointwise, the multiplicative indicators of δ-thickenings of a set eventually coincide
with the multiplicative indicator of the set as δ>0 tends to zero. -/
@[to_additive "Pointwise, the indicators of δ-thickenings of a set eventually coincide
with the indicator of the set as δ>0 tends to zero."]
lemma mulIndicator_thickening_eventually_eq_mulIndicator_closure (f : α → β) (E : Set α) (x : α) :
    ∀ᶠ δ in 𝓝[>] (0 : ℝ),
      (Metric.thickening δ E).mulIndicator f x = (closure E).mulIndicator f x

{α : Type u_1}
[PseudoEMetricSpace α]
{β : Type u_2}
[One β]
(f : α → β)
(E : Set α)
(x : α)

∀ᶠ (δ : ℝ) in 𝓝[>] 0, (Metric.thickening δ E).mulIndicator f x = (closure E).mulIndicator f x


theorem degreeOf_sub_lt {x : σ} {f g : MvPolynomial σ R} {k : ℕ} (h : 0 < k)
    (hf : ∀ m : σ →₀ ℕ, m ∈ f.support → k ≤ m x → coeff m f = coeff m g)
    (hg : ∀ m : σ →₀ ℕ, m ∈ g.support → k ≤ m x → coeff m f = coeff m g) :
    degreeOf x (f - g) < k

(hf : ∀ m ∈ f.support, k ≤ m x → MvPolynomial.coeff m f = MvPolynomial.coeff m g)

(hg : ∀ m ∈ g.support, k ≤ m x → MvPolynomial.coeff m f = MvPolynomial.coeff m g)


@[simp, norm_cast] lemma Closeds.isAtom_coe [T1Space α] {s : Closeds α} :
    IsAtom (s : Set α) ↔ IsAtom s

{α : Type u_2}
[TopologicalSpace α]
[T1Space α]
{s : TopologicalSpace.Closeds α}


/-- When a left homology data `h` of a short complex `S` is preserved by a functor `F`,
this is the induced left homology data `h.map F` for the short complex `S.map F`. -/
@[simps]
noncomputable def map : (S.map F).LeftHomologyData


theorem inter_mem_inter [Inter α] (a b : Part α) (ma mb : α) (ha : ma ∈ a) (hb : mb ∈ b) :
    ma ∩ mb ∈ a ∩ b

{α : Type u_1}
[Inter α]
(a b : Part α)
(ma mb : α)
(ha : ma ∈ a)
(hb : mb ∈ b)


theorem toAffineMap_injective : Injective (toAffineMap : (P₁ ≃ᵃ[k] P₂) → P₁ →ᵃ[k] P₂)

{k : Type u_1}
{P₁ : Type u_2}
{P₂ : Type u_3}
{V₁ : Type u_6}
{V₂ : Type u_7}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]


theorem prod_nnnorm_eq_sup (f : WithLp ∞ (α × β)) : ‖f‖₊ = ‖f.fst‖₊ ⊔  ‖f.snd‖₊

{α : Type u_2}
{β : Type u_3}
[SeminormedAddCommGroup α]
[SeminormedAddCommGroup β]
(f : WithLp ⊤ (α × β))

‖f‖₊ = ‖f.1‖₊ ⊔ ‖f.2‖₊


theorem eval₂Hom_congr {f₁ f₂ : R →+* S₁} {g₁ g₂ : σ → S₁} {p₁ p₂ : MvPolynomial σ R} :
    f₁ = f₂ → g₁ = g₂ → p₁ = p₂ → eval₂Hom f₁ g₁ p₁ = eval₂Hom f₂ g₂ p₂

{R : Type u}
{S₁ : Type v}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₁]
{f₁ f₂ : R →+* S₁}
{g₁ g₂ : σ → S₁}
{p₁ p₂ : MvPolynomial σ R}

f₁ = f₂ → g₁ = g₂ → p₁ = p₂ → (MvPolynomial.eval₂Hom f₁ g₁) p₁ = (MvPolynomial.eval₂Hom f₂ g₂) p₂


theorem tanh_conj : tanh (conj x) = conj (tanh x)

Complex.tanh ((starRingEnd ℂ) x) = (starRingEnd ℂ) (Complex.tanh x)


lemma rightShift_leftShift (a n' : ℤ) (hn' : n + a = n') :
    (γ.leftShift a n' hn').rightShift a n hn' =
      (a * n' + (a * (a - 1)) / 2).negOnePow • γ.shift a

(γ : CochainComplex.HomComplex.Cochain K L n)

(γ.leftShift a n' hn').rightShift a n hn' = (a * n' + a * (a - 1) / 2).negOnePow • γ.shift a


lemma iIndepFun.meas_iInter [Fintype ι] (hf : iIndepFun mβ f κ μ)
    (hs : ∀ i, MeasurableSet[(mβ i).comap (f i)] (s i)) :
    ∀ᵐ a ∂μ, κ a (⋂ i, s i) = ∏ i, κ a (s i)

(hf : ProbabilityTheory.Kernel.iIndepFun mβ f κ μ)

∀ᵐ (a : α) ∂μ, (κ a) (⋂ i, s i) = ∏ i : ι, (κ a) (s i)


theorem Valid'.merge_lemma {a b c : ℕ} (h₁ : 3 * a < b + c + 1) (h₂ : b ≤ 3 * c) :
    2 * (a + b) ≤ 9 * c + 5


@[simp]
theorem coe_equivProdOfSurjectiveOfIsCompl {f : E →ₗ[R] F} {g : E →ₗ[R] G} (hf : range f = ⊤)
    (hg : range g = ⊤) (hfg : IsCompl (ker f) (ker g)) :
    (equivProdOfSurjectiveOfIsCompl f g hf hg hfg : E →ₗ[R] F × G) = f.prod g

(hfg : IsCompl (LinearMap.ker f) (LinearMap.ker g))

↑(f.equivProdOfSurjectiveOfIsCompl g hf hg hfg) = f.prod g


@[simp] theorem range'_one {s step : ℕ} : range' s 1 step = [s]


theorem lineDerivWithin_congr_set (h : s =ᶠ[𝓝 x] t) :
    lineDerivWithin 𝕜 f s x v = lineDerivWithin 𝕜 f t x v

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


@[simp] lemma prod_eq_zero_iff : s.prod = 0 ↔ (0 : α) ∈ s

{α : Type u_2}
[CommMonoidWithZero α]
[NoZeroDivisors α]
[Nontrivial α]
{s : Multiset α}


{α : Type u_1}
[CoheytingAlgebra α]
{a : α}


theorem aedisjoint_compl_left : AEDisjoint μ sᶜ s

{α : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}


theorem map₂_comm {g : β → α → γ} (h_comm : ∀ a b, f a b = g b a) : map₂ f a b = map₂ g b a

{f : α → β → γ}

{g : β → α → γ}

(h_comm : ∀ (a : α) (b : β), f a b = g b a)


@[to_additive]
theorem Subgroup.exponent_toSubmonoid (H : Subgroup G) :
    Monoid.exponent H.toSubmonoid = Monoid.exponent H

{G : Type u}
[AddGroup G]
(H : AddSubgroup G)

AddMonoid.exponent ↥H.toAddSubmonoid = AddMonoid.exponent ↥H


@[simp]
theorem continuousLinearMapToWeakSpace_eq_toWeakSpace (x : E) :
    continuousLinearMapToWeakSpace 𝕜 E x = toWeakSpace 𝕜 E x

(𝕜 : Type u_2)
(E : Type u_5)
[CommSemiring 𝕜]
[TopologicalSpace 𝕜]
[ContinuousAdd 𝕜]
[ContinuousConstSMul 𝕜 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
[TopologicalSpace E]
(x : E)

(continuousLinearMapToWeakSpace 𝕜 E) x = (toWeakSpace 𝕜 E) x


lemma toClass_some {x y : F} (h : W.Nonsingular x y) :
    toClass (some h) = ClassGroup.mk (CoordinateRing.XYIdeal' h)

{F : Type u}
[Field F]
{W : WeierstrassCurve.Affine F}
{x y : F}
(h : W.Nonsingular x y)

WeierstrassCurve.Affine.Point.toClass (WeierstrassCurve.Affine.Point.some h) =
  ClassGroup.mk (WeierstrassCurve.Affine.CoordinateRing.XYIdeal' h)


theorem Convex.interior_nonempty_iff_affineSpan_eq_top [FiniteDimensional ℝ V] {s : Set V}
    (hs : Convex ℝ s) : (interior s).Nonempty ↔ affineSpan ℝ s = ⊤

{V : Type u_1}
[NormedAddCommGroup V]
[NormedSpace ℝ V]
[FiniteDimensional ℝ V]
{s : Set V}
(hs : Convex ℝ s)


lemma IsGLB.mem_of_not_isPredLimit (hs : IsGLB s x) (hx : ¬ IsPredLimit x) :
    x ∈ s

{α : Type u_2}
[CompleteLinearOrder α]
{s : Set α}
{x : α}
(hs : IsGLB s x)
(hx : ¬Order.IsPredLimit x)


/-- If two commuting elements `x` and `y` of a monoid have order `n` and `m`, then there is an
element of order `lcm n m` that lies in the subgroup generated by `x` and `y`. -/
@[to_additive "If two commuting elements `x` and `y` of an additive monoid have order `n` and `m`,
then there is an element of order `lcm n m` that lies in the additive subgroup generated by `x`
and `y`."]
theorem _root_.Commute.exists_orderOf_eq_lcm {x y : G} (h : Commute x y) :
    ∃ z ∈ closure {x, y}, orderOf z = Nat.lcm (orderOf x) (orderOf y)

(G : Type u)
[Monoid G]
{x y : G}
(h : Commute x y)

∃ z ∈ Submonoid.closure {x, y}, orderOf z = (orderOf x).lcm (orderOf y)


theorem Tendsto.atBot_zsmul_neg_const {f : α → ℤ} (hr : r < 0) (hf : Tendsto f l atBot) :
    Tendsto (fun x => f x • r) l atTop

{α : Type u_1}
{R : Type u_2}
{l : Filter α}
{r : R}
[LinearOrderedAddCommGroup R]
[Archimedean R]
{f : α → ℤ}
(hr : r < 0)
(hf : Filter.Tendsto f l Filter.atBot)

Filter.Tendsto (fun x => f x • r) l Filter.atTop


/-- `AnalyticOn.comp` for functions on product spaces -/
theorem AnalyticOn.comp₂ {h : F × G → H} {f : E → F} {g : E → G} {s : Set (F × G)} {t : Set E}
    (ha : AnalyticOn 𝕜 h s) (fa : AnalyticOn 𝕜 f t) (ga : AnalyticOn 𝕜 g t)
    (m : ∀ x, x ∈ t → (f x, g x) ∈ s) : AnalyticOn 𝕜 (fun x ↦ h (f x, g x)) t

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
{F : Type u_4}
{G : Type u_5}
{H : Type u_6}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
[NormedAddCommGroup H]
[NormedSpace 𝕜 H]
{h : F × G → H}
{f : E → F}
{g : E → G}
{s : Set (F × G)}
{t : Set E}
(ha : AnalyticOn 𝕜 h s)
(fa : AnalyticOn 𝕜 f t)
(ga : AnalyticOn 𝕜 g t)
(m : ∀ x ∈ t, (f x, g x) ∈ s)


theorem finite_stableUnderComposition : StableUnderComposition @Finite


lemma ne_zero [CharZero R] : (P.root i : M) ≠ 0

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
{N : Type u_4}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(P : RootPairing ι R M N)
(i : ι)
[CharZero R]


theorem mem_map_algebraMap_iff {I : Ideal R} {z} : z ∈ Ideal.map (algebraMap R S) I ↔
    ∃ x : I × M, z * algebraMap R S x.2 = algebraMap R S x.1

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

z ∈ Ideal.map (algebraMap R S) I ↔ ∃ x, z * (algebraMap R S) ↑x.2 = (algebraMap R S) ↑x.1


/-- Homotopy between morphisms of short complexes is compatible with the scalar multiplication. -/
@[simps]
def Homotopy.smul {φ₁ φ₂ : S₁ ⟶ S₂} (h : Homotopy φ₁ φ₂) (a : R) :
    Homotopy (a • φ₁) (a • φ₂)

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

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


/-- A binary bicone morphism between two binary bicones for the same diagram is a morphism of the
binary bicone points which commutes with the cone and cocone legs. -/
structure BinaryBiconeMorphism {P Q : C} (A B : BinaryBicone P Q) where
  /-- A morphism between the two vertex objects of the bicones -/
  hom : A.pt ⟶ B.pt
  /-- The triangle consisting of the two natural transformations and `hom` commutes -/
  wfst : hom ≫ B.fst = A.fst := by aesop_cat
  /-- The triangle consisting of the two natural transformations and `hom` commutes -/
  wsnd : hom ≫ B.snd = A.snd := by aesop_cat
  /-- The triangle consisting of the two natural transformations and `hom` commutes -/
  winl : A.inl ≫ hom = B.inl := by aesop_cat
  /-- The triangle consisting of the two natural transformations and `hom` commutes -/
  winr : A.inr ≫ hom = B.inr := by aesop_cat

{A B : CategoryTheory.Limits.BinaryBicone P Q}

(self : CategoryTheory.Limits.BinaryBiconeMorphism A B)


/-- The isomorphism between `F.op.unop` and `F`. -/
@[simps!]
def opUnopIso (F : C ⥤ D) : F.op.unop ≅ F

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

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


@[simp]
theorem tmul_pow (a : A) (b : B) (k : ℕ) : a ⊗ₜ[R] b ^ k = (a ^ k) ⊗ₜ[R] (b ^ k)

{R : Type uR}
{A : Type uA}
{B : Type uB}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
(a : A)
(b : B)
(k : ℕ)


lemma equalizer_mem [G.IsDenseSubsite J K] {U V} (f₁ f₂ : U ⟶ V) (e : G.map f₁ = G.map f₂) :
    Sieve.equalizer f₁ f₂ ∈ J _

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

[CategoryTheory.Functor.IsDenseSubsite J K G]

CategoryTheory.Sieve.equalizer f₁ f₂ ∈ J.sieves U


theorem log_inv (x : ℂ) (hx : x.arg ≠ π) : log x⁻¹ = -log x


@[to_additive (attr := simp)]
theorem coe_inf (p p' : Submonoid M) : ((p ⊓ p' : Submonoid M) : Set M) = (p : Set M) ∩ p'

{M : Type u_1}
[AddZeroClass M]
(p p' : AddSubmonoid M)


theorem sort_sorted_gt (s : Finset α) : List.Sorted (· > ·) (sort (· ≥ ·) s)

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

List.Sorted (fun x x_1 => x > x_1) (Finset.sort (fun x x_1 => x ≥ x_1) s)


theorem valuation_eq_iff (x y : K) : A.valuation x = A.valuation y ↔ ∃ a : Aˣ, (a : K) * y = x

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

A.valuation x = A.valuation y ↔ ∃ a, ↑↑a * y = x


@[simp]
theorem prodCongr_symm (h₁ : α ≃ᵤ β) (h₂ : γ ≃ᵤ δ) :
    (h₁.prodCongr h₂).symm = h₁.symm.prodCongr h₂.symm

{α : Type u}
{β : Type u_1}
{γ : Type u_2}
{δ : Type u_3}
[UniformSpace α]
[UniformSpace β]
[UniformSpace γ]
[UniformSpace δ]
(h₁ : α ≃ᵤ β)
(h₂ : γ ≃ᵤ δ)


@[reassoc]
lemma totalFlipIso_hom_f_D₁ (j j' : J) :
    (K.totalFlipIso c).hom.f j ≫ K.D₁ c j j' =
      K.flip.D₂ c j j' ≫ (K.totalFlipIso c).hom.f j'

{C : Type u_1}
{I₁ : Type u_2}
{I₂ : Type u_3}
{J : Type u_4}
[CategoryTheory.Category.{u_5, u_1} C]
[CategoryTheory.Preadditive C]
{c₁ : ComplexShape I₁}
{c₂ : ComplexShape I₂}
(K : HomologicalComplex₂ C c₁ c₂)
(c : ComplexShape J)
[TotalComplexShape c₁ c₂ c]
[TotalComplexShape c₂ c₁ c]
[TotalComplexShapeSymmetry c₁ c₂ c]
[K.HasTotal c]
[K.flip.HasTotal c]
[DecidableEq J]
(j j' : J)


@[simp] theorem pred_inj :
    ∀ {a b : Fin (n + 1)} {ha : a ≠ 0} {hb : b ≠ 0}, a.pred ha = b.pred hb ↔ a = b

{n : Nat}
{a b : Fin (n + 1)}
{ha : a ≠ 0}
{hb : b ≠ 0}


lemma ringHomComp_mul (χ φ : MulChar R R') (f : R' →+* R'') :
    (χ * φ).ringHomComp f = χ.ringHomComp f * φ.ringHomComp f

{R : Type u_1}
[CommMonoid R]
{R' : Type u_2}
[CommRing R']
{R'' : Type u_3}
[CommRing R'']
(χ φ : MulChar R R')
(f : R' →+* R'')


theorem pow_dvd_of_le_multiplicity {a b : α} {k : ℕ} :
    (k : PartENat) ≤ multiplicity a b → a ^ k ∣ b

{α : Type u_1}
[Monoid α]
[DecidableRel fun x x_1 => x ∣ x_1]
{a b : α}
{k : ℕ}


theorem map_continuous' {β γ : Type v} (f : β → γ) (g : α → Part β) (hg : Continuous' g) :
    Continuous' fun x => f <$> g x

(hg : OmegaCompletePartialOrder.Continuous' g)

OmegaCompletePartialOrder.Continuous' fun x => f <$> g x


theorem covolume_eq_measure_fundamentalDomain {F : Set E} (h : IsAddFundamentalDomain L F μ) :
    covolume L μ = (μ F).toReal

(μ : MeasureTheory.Measure E := by volume_tac)

(h : MeasureTheory.IsAddFundamentalDomain (↥L) F μ)


@[to_additive (attr := simp, norm_cast)]
theorem coe_one : ((1 : S') : M₁) = 1

{A : Type u_4}
{M₁ : Type u_5}
[SetLike A M₁]
[Zero M₁]
[hA : ZeroMemClass A M₁]
(S' : A)


lemma toNNReal_lt_natCast {r : ℝ} {n : ℕ} (hn : n ≠ 0) : r.toNNReal < n ↔ r < n


@[fun_prop]
lemma continuous_realContinuousMapOfNNReal (φ : C(X, ℝ≥0) →⋆ₐ[ℝ≥0] A)
    (hφ : Continuous φ) : Continuous φ.realContinuousMapOfNNReal

{X : Type u_1}
[TopologicalSpace X]
{A : Type u_2}
[TopologicalSpace A]
[Ring A]
[StarRing A]
[Algebra ℝ A]
[TopologicalRing A]
(φ : C(X, NNReal) →⋆ₐ[NNReal] A)
(hφ : Continuous ⇑φ)


@[simp]
theorem Metric.diam_closure {α : Type*} [PseudoMetricSpace α] (s : Set α) :
    Metric.diam (closure s) = diam s

{α : Type u_4}
[PseudoMetricSpace α]
(s : Set α)


/-- Homeomorphism between `X² = Fin 2 → X` and `X × X`. -/
@[simps! (config := .asFn)]
def finTwoArrow : (Fin 2 → X) ≃ₜ X × X

⇑Homeomorph.finTwoArrow = fun f => (f 0, f 1)


@[simp]
theorem neg_apply (f : E →ₗ.[R] F) (x) : (-f) x = -f x

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
(f : E →ₗ.[R] F)
(x : ↥(-f).domain)


/-- The right fraction from `X` to `Y` given by a morphism `f : X ⟶ Y`. -/
@[simps]
def ofHom (f : X ⟶ Y) [W.ContainsIdentities] :
    W.RightFraction X Y

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
(W : CategoryTheory.MorphismProperty C)
{X Y : C}
(f : X ⟶ Y)
[W.ContainsIdentities]

(CategoryTheory.MorphismProperty.RightFraction.ofHom W f).X' = X


@[simp]
theorem gcd_same [NormalizedGCDMonoid α] (a : α) : gcd a a = normalize a

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


theorem zero_of_le_dist (hx : f.rOut ≤ dist x c) : f x = 0

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[HasContDiffBump E]
{c : E}
(f : ContDiffBump c)
{x : E}
(hx : f.rOut ≤ dist x c)


@[to_additive add.instNeBot]
protected lemma mul.instNeBot [NeBot f] [NeBot g] : NeBot (f * g)


lemma isClosed_iff_isUpper : IsClosed s ↔ IsUpperSet s

{α : Type u_1}
[Preorder α]
[TopologicalSpace α]
[Topology.IsLowerSet α]
{s : Set α}


theorem vandermonde_mul_vandermonde_transpose {n : ℕ} (v w : Fin n → R) (i j) :
    (vandermonde v * (vandermonde w)ᵀ) i j = ∑ k : Fin n, (v i * w j) ^ (k : ℕ)

{R : Type u_1}
[CommRing R]
{n : ℕ}
(v w : Fin n → R)
(i j : Fin n)

(Matrix.vandermonde v * (Matrix.vandermonde w)ᵀ) i j = ∑ k : Fin n, (v i * w j) ^ ↑k


theorem length_permutations (l : List α) : length (permutations l) = (length l)!


theorem erase_update_of_ne (f : α →₀ M) {a a' : α} (ha : a ≠ a') (b : M) :
    erase a (update f a' b) = update (erase a f) a' b

{α : Type u_1}
{M : Type u_5}
[Zero M]
(f : α →₀ M)
{a a' : α}
(ha : a ≠ a')
(b : M)

Finsupp.erase a (f.update a' b) = (Finsupp.erase a f).update a' b


@[reassoc] -- Porting note: simp can solve both versions
theorem biprod.inr_snd {X Y : C} [HasBinaryBiproduct X Y] :
    (biprod.inr : Y ⟶ X ⊞ Y) ≫ (biprod.snd : X ⊞ Y ⟶ Y) = 𝟙 Y

CategoryTheory.Limits.biprod.inr ≫ CategoryTheory.Limits.biprod.snd = 𝟙 Y


lemma commute_of_mem_adjoin_of_forall_mem_commute {a b : A} {s : Set A}
    (hb : b ∈ adjoin R s) (h : ∀ b ∈ s, Commute a b) :
    Commute a b

{R : Type uR}
{A : Type uA}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{a b : A}
{s : Set A}
(hb : b ∈ Algebra.adjoin R s)
(h : ∀ b ∈ s, Commute a b)


theorem not_rkPos_iff : ¬RkPos M ↔ M = loopyOn M.E


theorem embDomain_succ_smul_powers :
    (x • powers x hx).embDomain ⟨Nat.succ, Nat.succ_injective⟩ =
      powers x hx - ofFinsupp (Finsupp.single 0 1)

{Γ : Type u_1}
{R : Type u_2}
[LinearOrderedCancelAddCommMonoid Γ]
[CommRing R]
[IsDomain R]
{x : HahnSeries Γ R}
(hx : 0 < x.orderTop)

(x • HahnSeries.SummableFamily.powers x hx).embDomain { toFun := Nat.succ, inj' := Nat.succ_injective } =
  HahnSeries.SummableFamily.powers x hx - HahnSeries.SummableFamily.ofFinsupp (Finsupp.single 0 1)


lemma iteratedFDeriv_aux {α : Type*} [DecidableEq α]
    (s : Set ι) [DecidableEq { x // x ∈ s }] (e : α ≃ s)
    (m : α → ((i : ι) → M₁ i)) (a : α) (z : (i : ι) → M₁ i) :
    (fun i ↦ update m a z (e.symm i) i) =
      (fun i ↦ update (fun j ↦ m (e.symm j) j) (e a) (z (e a)) i)

{ι : Type uι}
{M₁ : ι → Type v₁}
{α : Type u_2}
[DecidableEq α]
(s : Set ι)
[DecidableEq { x // x ∈ s }]
(e : α ≃ ↑s)
(m : α → (i : ι) → M₁ i)
(a : α)
(z : (i : ι) → M₁ i)

(fun i => Function.update m a z (e.symm i) ↑i) = fun i => Function.update (fun j => m (e.symm j) ↑j) (e a) (z ↑(e a)) i


lemma opEpi_id (σ : M.GeneratingSections) :
    σ.ofEpi (𝟙 M) = σ

{J : CategoryTheory.GrothendieckTopology C}

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


@[simp]
theorem coe_fn_mkRingHomOfMulSelfOfTwoNeZero (h h_two h_one) :
    (f.mkRingHomOfMulSelfOfTwoNeZero h h_two h_one : β → α) = f

{α : Type u_2}
{β : Type u_3}
[CommRing α]
[IsDomain α]
[CommRing β]
(f : β →+ α)
(h : ∀ (x : β), f (x * x) = f x * f x)
(h_two : 2 ≠ 0)
(h_one : f 1 = 1)

⇑(f.mkRingHomOfMulSelfOfTwoNeZero h h_two h_one) = ⇑f


theorem proof_irrel_heq {p q : Prop} (hp : p) (hq : q) : HEq hp hq


/-- The angle between the negation of a nonzero vector and that
vector. -/
@[simp]
theorem angle_neg_self_of_nonzero {x : V} (hx : x ≠ 0) : angle (-x) x = π

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


@[to_additive (attr := simp)]
theorem le_one_iff : f ≤ 1 ↔ (1 : Set α) ∈ f


lemma negMap_eq {P : Fin 3 → R} : W'.negMap ⟦P⟧ = ⟦W'.neg P⟧

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
{P : Fin 3 → R}


@[simp]
theorem hom_inv_id (f : X ⟶ Y) [I : IsIso f] : f ≫ inv f = 𝟙 X

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

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


theorem _root_.ContinuousLinearMap.intervalIntegral_apply {a b : ℝ} {φ : ℝ → F →L[𝕜] E}
    (hφ : IntervalIntegrable φ μ a b) (v : F) :
    (∫ x in a..b, φ x ∂μ) v = ∫ x in a..b, φ x v ∂μ

{𝕜 : Type u_2}
{E : Type u_3}
{F : Type u_4}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{μ : MeasureTheory.Measure ℝ}
[RCLike 𝕜]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{a b : ℝ}
{φ : ℝ → F →L[𝕜] E}
(hφ : IntervalIntegrable φ μ a b)
(v : F)

(∫ (x : ℝ) in a..b, φ x ∂μ) v = ∫ (x : ℝ) in a..b, (φ x) v ∂μ


theorem div_eq_ediv_of_dvd {a b : Int} (h : b ∣ a) : a.div b = a / b


theorem leftInverse_splittingOfFinsuppSurjective (f : M →ₗ[R] α →₀ R) (s : Surjective f) :
    LeftInverse f (splittingOfFinsuppSurjective f s)

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{α : Type u_4}
(f : M →ₗ[R] α →₀ R)
(s : Function.Surjective ⇑f)

Function.LeftInverse ⇑f ⇑(f.splittingOfFinsuppSurjective s)


/--
  If an accumulation function `f`, given an initial state `s`, produces `s` as its output state
  for all possible input bits, then the state is redundant and can be optimized out
-/
@[simp]
theorem mapAccumr₂_eq_map₂_of_constant_state (f : α → β → σ → σ × γ) (s : σ)
    (h : ∀ a b, (f a b s).fst = s) :
    mapAccumr₂ f xs ys s = (s, (map₂ (fun x y => (f x y s).snd) xs ys))

(f : α → β → σ → σ × γ)

Mathlib.Vector.mapAccumr₂ f xs ys s = (s, Mathlib.Vector.map₂ (fun x y => (f x y s).2) xs ys)


theorem ediv_pos_of_pos_of_dvd {a b : Int} (H1 : 0 < a) (H2 : 0 ≤ b) (H3 : b ∣ a) : 0 < a / b


/-- Taking the image of a morphism gives a functor `Over X ⥤ MonoOver X`.
-/
@[simps]
def image : Over X ⥤ MonoOver X

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X : C}
[CategoryTheory.Limits.HasImages C]
{f g : CategoryTheory.Over X}
(k : f ⟶ g)

CategoryTheory.MonoOver.image.map k =
  (CategoryTheory.MonoOver.forget X).preimage
    (CategoryTheory.Over.homMk
      (CategoryTheory.Limits.image.lift
        (CategoryTheory.Limits.MonoFactorisation.mk (CategoryTheory.Limits.image g.hom)
          (CategoryTheory.Limits.image.ι g.hom)
          (CategoryTheory.CategoryStruct.comp k.left (CategoryTheory.Limits.factorThruImage g.hom)) ⋯))
      ⋯)


theorem unifTight_iff_real {_ : MeasurableSpace α} (f : ι → α → β) (p : ℝ≥0∞) (μ : Measure α) :
    UnifTight f p μ ↔ ∀ ⦃ε : ℝ⦄, 0 < ε → ∃ s : Set α,
      μ s ≠ ∞ ∧ ∀ i, eLpNorm (sᶜ.indicator (f i)) p μ ≤ .ofReal ε

{α : Type u_1}
{β : Type u_2}
{ι : Type u_3}
[NormedAddCommGroup β]

∀ {x : MeasurableSpace α} (f : ι → α → β) (p : ENNReal) (μ : MeasureTheory.Measure α),
  MeasureTheory.UnifTight f p μ ↔
    ∀ ⦃ε : ℝ⦄, 0 < ε → ∃ s, μ s ≠ ⊤ ∧ ∀ (i : ι), MeasureTheory.eLpNorm (sᶜ.indicator (f i)) p μ ≤ ENNReal.ofReal ε


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

{α : Type u}
[SubtractionMonoid α]
{a b : α}
(h : IsAddUnit b)


theorem id_continuous' : Continuous' (@id α)

{α : Type u}
[OmegaCompletePartialOrder α]


@[to_additive]
theorem smulAntidiagonal_mono_left (h : s₁ ⊆ s₂) :
    smulAntidiagonal s₁ t a ⊆ smulAntidiagonal s₂ t a

{G : Type u_1}
{P : Type u_2}
[SMul G P]
{s₁ s₂ : Set G}
{t : Set P}
{a : P}
(h : s₁ ⊆ s₂)

s₁.smulAntidiagonal t a ⊆ s₂.smulAntidiagonal t a


theorem Fintype.card_fun [DecidableEq α] [Fintype α] [Fintype β] :
    Fintype.card (α → β) = Fintype.card β ^ Fintype.card α

{α : Type u_1}
{β : Type u_2}
[DecidableEq α]
[Fintype α]
[Fintype β]


lemma mul_top_of_pos : ∀ {x : EReal}, 0 < x → x * ⊤ = ⊤


theorem natAbs_lt_natAbs_of_nonneg_of_lt {a b : Int}
    (w₁ : 0 ≤ a) (w₂ : a < b) : a.natAbs < b.natAbs


/-- Sum of a multiset of elements in a `Subsemiring` of a `Semiring` is
in the `add_subsemiring`. -/
protected theorem multiset_sum_mem (m : Multiset R) : (∀ a ∈ m, a ∈ s) → m.sum ∈ s

{R : Type u}
[NonAssocSemiring R]
(s : Subsemiring R)
(m : Multiset R)


theorem toSphere_apply' {s : Set (sphere (0 : E) 1)} (hs : MeasurableSet s) :
    μ.toSphere s = dim E * μ (Ioo (0 : ℝ) 1 • ((↑) '' s))

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
(μ : MeasureTheory.Measure E)
{s : Set ↑(Metric.sphere 0 1)}
(hs : MeasurableSet s)

μ.toSphere s = ↑(dim E) * μ (Set.Ioo 0 1 • Subtype.val '' s)


/-- The algebra of sets generated by a family of sets is an algebra of sets. -/
theorem isSetAlgebra_generateSetAlgebra :
    IsSetAlgebra (generateSetAlgebra 𝒜)


theorem liftHom₂_congr {a b : FreeBicategory B} {f g : a ⟶ b} {η θ : Hom₂ f g} (H : Rel η θ) :
    liftHom₂ F η = liftHom₂ F θ

{η θ : CategoryTheory.FreeBicategory.Hom₂ f g}

(H : CategoryTheory.FreeBicategory.Rel η θ)

CategoryTheory.FreeBicategory.liftHom₂ F η = CategoryTheory.FreeBicategory.liftHom₂ F θ


/-- The order of a formal power series is exactly `n` if the `n`th coefficient is nonzero,
and the `i`th coefficient is `0` for all `i < n`. -/
theorem order_eq {φ : R⟦X⟧} {n : PartENat} :
    order φ = n ↔ (∀ i : ℕ, ↑i = n → coeff R i φ ≠ 0) ∧ ∀ i : ℕ, ↑i < n → coeff R i φ = 0

{R : Type u_1}
[Semiring R]
{φ : PowerSeries R}
{n : PartENat}

φ.order = n ↔ (∀ (i : ℕ), ↑i = n → (PowerSeries.coeff R i) φ ≠ 0) ∧ ∀ (i : ℕ), ↑i < n → (PowerSeries.coeff R i) φ = 0


@[simp]
theorem symm_dual_comp (g : SupBotHom βᵒᵈ γᵒᵈ) (f : SupBotHom αᵒᵈ βᵒᵈ) :
    InfTopHom.dual.symm (g.comp f) =
      (InfTopHom.dual.symm g).comp (InfTopHom.dual.symm f)

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Inf α]
[Top α]
[Inf β]
[Top β]
[Inf γ]
[Top γ]
(g : SupBotHom βᵒᵈ γᵒᵈ)
(f : SupBotHom αᵒᵈ βᵒᵈ)


@[simp] lemma mop_hom_leftUnitor (X : C) : (λ_ X).hom.mop = (ρ_ (mop X)).hom

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

(CategoryTheory.MonoidalCategory.leftUnitor X).hom.mop =
  (CategoryTheory.MonoidalCategory.rightUnitor { unmop := X }).hom


theorem IsInt.neg_to_eq {α} [Ring α] {n} :
    {a a' : α} → IsInt a (.negOfNat n) → n = a' → a = -a'

{α : Type u_1}
[Ring α]
{n : ℕ}
{a a' : α}

Mathlib.Meta.NormNum.IsInt a (Int.negOfNat n) → ↑n = a' → a = -a'


@[simp]
theorem coe_smul (c : R) (m : OuterMeasure α) : ⇑(c • m) = c • ⇑m

{α : Type u_1}
{R : Type u_3}
[SMul R ℝ≥0∞]
[IsScalarTower R ℝ≥0∞ ℝ≥0∞]
(c : R)
(m : MeasureTheory.OuterMeasure α)


/-- If there are zero morphisms, any initial object is a zero object. -/
theorem hasZeroObject_of_hasInitial_object [HasZeroMorphisms C] [HasInitial C] :
    HasZeroObject C


theorem Iic_toDual (a : α) : Iic (toDual a) = (Ici a).map toDual.toEmbedding

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

Finset.Iic (OrderDual.toDual a) = Finset.map OrderDual.toDual.toEmbedding (Finset.Ici a)


/-- Each element of the group defines an algebra equivalence.

This is a stronger version of `MulSemiringAction.toRingEquiv` and
`DistribMulAction.toLinearEquiv`. -/
@[simps! apply symm_apply toEquiv] -- Porting note: don't want redundant simps lemma `toEquiv_symm`
def toAlgEquiv (g : G) : A ≃ₐ[R] A

{G : Type u_2}
(R : Type u_3)
(A : Type u_4)
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Group G]
[MulSemiringAction G A]
[SMulCommClass G R A]
(g : G)

↑(MulSemiringAction.toAlgEquiv R A g) = ↑(MulSemiringAction.toRingEquiv G A g)


/-- The coercion to function is a monoid homomorphism. -/
@[simps]
def coeFnAddMonoidHom : LeftInvariantDerivation I G →+ C^∞⟮I, G; 𝕜⟯ → C^∞⟮I, G; 𝕜⟯

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
(G : Type u_4)
[TopologicalSpace G]
[ChartedSpace H G]
[Monoid G]
[SmoothMul I G]

∀ (a : LeftInvariantDerivation I G) (a_1 : C^⊤⟮I, G; 𝓘(𝕜, 𝕜), 𝕜⟯),
  (LeftInvariantDerivation.coeFnAddMonoidHom I G) a a_1 = a a_1


theorem IsIrreducible.image (H : IsIrreducible s) (f : X → Y) (hf : ContinuousOn f s) :
    IsIrreducible (f '' s)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{s : Set X}
(H : IsIrreducible s)
(f : X → Y)
(hf : ContinuousOn f s)


lemma inverse_eq_inverse' (f : X →[M] Y₁) (g : Y₁ → X)
    (h₁ : Function.LeftInverse g f) (h₂ : Function.RightInverse g f) :
  inverse f g h₁ h₂ =  inverse' f g (congrFun rfl) h₁ h₂

{M : Type u_2}
{X : Type u_5}
[SMul M X]
{Y₁ : Type u_8}
[SMul M Y₁]
(f : X →ₑ[id] Y₁)
(g : Y₁ → X)
(h₁ : Function.LeftInverse g ⇑f)
(h₂ : Function.RightInverse g ⇑f)

f.inverse g h₁ h₂ = f.inverse' g ⋯ h₁ h₂


@[simp] lemma _root_.EquivLike.coe_symm_apply_apply {F} [EquivLike F α β] (e : F) (x : α) :
    (e : α ≃ β).symm (e x) = x

{α : Sort u}
{β : Sort v}
{F : Sort u_1}
[EquivLike F α β]
(e : F)
(x : α)


theorem noBotOrder_iff_noMinOrder (α : Type*) [LinearOrder α] : NoBotOrder α ↔ NoMinOrder α


theorem nfpFamily_le_iff {a b} : nfpFamily.{u, v} f a ≤ b ↔ ∀ l, List.foldr f a l ≤ b

{f : ι → Ordinal.{max u v} → Ordinal.{max u v}}

Ordinal.nfpFamily f a ≤ b ↔ ∀ (l : List ι), List.foldr f a l ≤ b


@[simp]
theorem gcd_sub_self_left {m n : ℕ} (h : m ≤ n) : gcd (n - m) m = gcd n m


/-- Middle component of the associator as a natural isomorphism. -/
@[simps!]
def associatorNatIsoMiddle (f : a ⟶ b) (h : c ⟶ d) :
    (precomposing ..).obj f ⋙ (postcomposing ..).obj h ≅
      (postcomposing ..).obj h ⋙ (precomposing ..).obj f

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

(CategoryTheory.Bicategory.associatorNatIsoMiddle f h).hom.app X = (CategoryTheory.Bicategory.associator f X h).hom


theorem tendsto_atBot_isGLB (h_mono : Monotone f) (ha : IsGLB (Set.range f) a) :
    Tendsto f atBot (𝓝 a)

{α : Type u_1}
{ι : Type u_3}
[Preorder ι]
[TopologicalSpace α]
[Preorder α]
[InfConvergenceClass α]
{f : ι → α}
{a : α}
(h_mono : Monotone f)
(ha : IsGLB (Set.range f) a)


/-- Any prefunctor into a category lifts to a functor from the path category. -/
@[simps]
def lift {V : Type u} [Quiver.{v + 1} V] {C : Type*} [Category C] (F : Prefunctor V C) :
    Paths V ⥤ C

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

(CategoryTheory.Quiv.lift F).obj X = F.obj X


@[simp] theorem nnnorm_equiv (f : PiLp ∞ β) : ‖WithLp.equiv ⊤ _ f‖₊ = ‖f‖₊

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

‖(WithLp.equiv ⊤ ((i : ι) → β i)) f‖₊ = ‖f‖₊


theorem centralizer_le (s t : Set A) (h : s ⊆ t) : centralizer R t ≤ centralizer R s

(R : Type u)
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(s t : Set A)
(h : s ⊆ t)

Subalgebra.centralizer R t ≤ Subalgebra.centralizer R s


@[reassoc, simp]
theorem whiskerRight_id {X Y : C} (f : X ⟶ Y) :
    f ▷ 𝟙_ C = (ρ_ X).hom ≫ f ≫ (ρ_ Y).inv

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

CategoryTheory.MonoidalCategory.whiskerRight f (𝟙_ C) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.rightUnitor X).hom
    (CategoryTheory.CategoryStruct.comp f (CategoryTheory.MonoidalCategory.rightUnitor Y).inv)


/-- A short complex `S` is short exact if it is exact, `S.f` is a mono and `S.g` is an epi. -/
structure ShortExact : Prop where
  exact : S.Exact
  [mono_f : Mono S.f]
  [epi_g : Epi S.g]


theorem Subsingleton.nodup {s : Cycle α} (h : Subsingleton s) : Nodup s

{α : Type u_1}
{s : Cycle α}
(h : s.Subsingleton)


theorem Icc_infinite : (Icc a b).Infinite

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


theorem InjOn.image_biInter_eq {p : ι → Prop} {s : ∀ i, p i → Set α} (hp : ∃ i, p i)
    {f : α → β} (h : InjOn f (⋃ (i) (hi), s i hi)) :
    (f '' ⋂ (i) (hi), s i hi) = ⋂ (i) (hi), f '' s i hi

(h : Set.InjOn f (⋃ i, ⋃ (hi : p i), s i hi))

f '' ⋂ i, ⋂ (hi : p i), s i hi = ⋂ i, ⋂ (hi : p i), f '' s i hi


theorem getD_leftInvSeq_mul_self (ω : List B) (j : ℕ) :
    ((lis ω).getD j 1) * ((lis ω).getD j 1) = 1

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

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


/-- The identity functor is fully faithful. -/
@[simps]
def id : (𝟭 C).FullyFaithful

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

∀ {X Y : C} (f : (CategoryTheory.Functor.id C).obj X ⟶ (CategoryTheory.Functor.id C).obj Y),
  (CategoryTheory.Functor.FullyFaithful.id C).preimage f = f


{R : Type u_3}
{Γ₀ : Type u_4}
[LinearOrderedAddCommMonoidWithTop Γ₀]
[Ring R]
{v : AddValuation R Γ₀}


theorem isArtinian_of_linearEquiv (f : M ≃ₗ[R] P) [IsArtinian R M] : IsArtinian R P

{R : Type u_1}
{M : Type u_2}
{P : Type u_3}
[Ring R]
[AddCommGroup M]
[AddCommGroup P]
[Module R M]
[Module R P]
(f : M ≃ₗ[R] P)
[IsArtinian R M]


/-- The sum type `X ⊕ Y` forms a cocone for the binary coproduct of `X` and `Y`. -/
@[simps!]
def binaryCoproductCocone (X Y : Type u) : Cocone (pair X Y)

∀ (x : CategoryTheory.Discrete CategoryTheory.Limits.WalkingPair) (a : (CategoryTheory.Limits.pair X Y).obj x),
  (CategoryTheory.Limits.Types.binaryCoproductCocone X Y).ι.app x a =
    (match x.as with
      | CategoryTheory.Limits.WalkingPair.left => Sum.inl
      | CategoryTheory.Limits.WalkingPair.right => Sum.inr)
      a


lemma inv_nonpos_of_nonpos {a : EReal} (h : a ≤ 0) : a⁻¹ ≤ 0


/-- The map `(x, y) ↦ (x, x⁻¹y)` is measure-preserving.
This is the function `S⁻¹` in [Halmos, §59],
where `S` is the map `(x, y) ↦ (x, xy)`. -/
@[to_additive measurePreserving_prod_neg_add
"The map `(x, y) ↦ (x, - x + y)` is measure-preserving."]
theorem measurePreserving_prod_inv_mul [IsMulLeftInvariant ν] :
    MeasurePreserving (fun z : G × G => (z.1, z.1⁻¹ * z.2)) (μ.prod ν) (μ.prod ν)

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

MeasureTheory.MeasurePreserving (fun z => (z.1, -z.1 + z.2)) (μ.prod ν) (μ.prod ν)


@[simp]
theorem realize_subst {φ : L.BoundedFormula α n} {tf : α → L.Term β} {v : β → M} {xs : Fin n → M} :
    (φ.subst tf).Realize v xs ↔ φ.Realize (fun a => (tf a).realize v) xs

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{β : Type v'}
{n : ℕ}
{φ : L.BoundedFormula α n}
{tf : α → L.Term β}
{v : β → M}
{xs : Fin n → M}

(φ.subst tf).Realize v xs ↔ φ.Realize (fun a => FirstOrder.Language.Term.realize v (tf a)) xs


theorem inseparable_iff_specializes_and : (x ~ᵢ y) ↔ x ⤳ y ∧ y ⤳ x

{X : Type u_1}
[TopologicalSpace X]
{x y : X}


theorem comapRight_apply (κ : Kernel α β) (hf : MeasurableEmbedding f) (a : α) :
    comapRight κ hf a = Measure.comap f (κ a)

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{γ : Type u_4}
{mγ : MeasurableSpace γ}
{f : γ → β}
(κ : ProbabilityTheory.Kernel α β)
(hf : MeasurableEmbedding f)
(a : α)

(κ.comapRight hf) a = MeasureTheory.Measure.comap f (κ a)


/-- Two affine subspaces are equal if they have the same points. -/
theorem coe_injective : Function.Injective ((↑) : AffineSubspace k P → Set P)

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]


/-- The functor `CommGroup ⥤ AddCommGroup` by sending `X ↦ additive X` and `f ↦ f`.
-/
@[simps]
def toAddCommGrp : CommGrp ⥤ AddCommGrp

CommGrp.toAddCommGrp.map a = MonoidHom.toAdditive a


@[simp]
lemma toMvPolynomial_id : (id : M₁ →ₗ[R] M₁).toMvPolynomial b₁ b₁ = X

{R : Type u_1}
{M₁ : Type u_2}
{ι₁ : Type u_4}
[CommRing R]
[AddCommGroup M₁]
[Module R M₁]
[Fintype ι₁]
[DecidableEq ι₁]
(b₁ : Basis ι₁ R M₁)

LinearMap.toMvPolynomial b₁ b₁ LinearMap.id = MvPolynomial.X


@[simp]
lemma mem_subgroup (a : α) : a ∈ α^*M ↔ ∀ m : M, m • a = a

(M : Type u)
(α : Type v)
[Monoid M]
[Group α]
[MulDistribMulAction M α]
(a : α)

a ∈ FixedPoints.subgroup M α ↔ ∀ (m : M), m • a = a


theorem mk_multiset_of_isEmpty (α : Type u) [IsEmpty α] : #(Multiset α) = 1


/-- A mono between objects with equally sized fibers is an iso. -/
lemma isIso_of_mono_of_eq_card_fiber {X Y : C} (f : X ⟶ Y) [Mono f]
    (h : Nat.card (F.obj X) = Nat.card (F.obj Y)) : IsIso f

(F : CategoryTheory.Functor C FintypeCat)

(h : Nat.card ↑(F.obj X) = Nat.card ↑(F.obj Y))


@[simp, nolint simpNF]
theorem tendsto_comp_coe_Ioi_atBot :
    Tendsto (fun x : Ioi a => f x) atBot l ↔ Tendsto f (𝓝[>] a) l

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
{a : α}
{l : Filter β}
{f : α → β}

Filter.Tendsto (fun x => f ↑x) Filter.atBot l ↔ Filter.Tendsto f (𝓝[>] a) l


@[simp]
theorem toWithTop_le {x y : PartENat} [hx : Decidable x.Dom] [hy : Decidable y.Dom] :
    toWithTop x ≤ toWithTop y ↔ x ≤ y


@[simp] theorem succ_zero_eq_one : Fin.succ (0 : Fin (n + 1)) = 1


@[simp]
theorem get!_some [Inhabited α] (a : α) : (some a).get! = a


theorem approx_mono ⦃i j : ℕ⦄ (hij : i ≤ j) : approx f i ≤ approx f j

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

Part.Fix.approx (⇑f) i ≤ Part.Fix.approx (⇑f) j


theorem snoc_snoc_swap {s : CompositionSeries X} {x₁ x₂ y₁ y₂ : X} {hsat₁ : IsMaximal s.last x₁}
    {hsat₂ : IsMaximal s.last x₂} {hsaty₁ : IsMaximal (snoc s x₁ hsat₁).last y₁}
    {hsaty₂ : IsMaximal (snoc s x₂ hsat₂).last y₂} (hr₁ : Iso (s.last, x₁) (x₂, y₂))
    (hr₂ : Iso (x₁, y₁) (s.last, x₂)) :
    Equivalent (snoc (snoc s x₁ hsat₁) y₁ hsaty₁) (snoc (snoc s x₂ hsat₂) y₂ hsaty₂)

{hsat₁ : JordanHolderLattice.IsMaximal (RelSeries.last s) x₁}

{hsat₂ : JordanHolderLattice.IsMaximal (RelSeries.last s) x₂}

{hsaty₁ : JordanHolderLattice.IsMaximal (RelSeries.snoc s x₁ hsat₁).last y₁}

{hsaty₂ : JordanHolderLattice.IsMaximal (RelSeries.snoc s x₂ hsat₂).last y₂}

(hr₁ : JordanHolderLattice.Iso (RelSeries.last s, x₁) (x₂, y₂))

(hr₂ : JordanHolderLattice.Iso (x₁, y₁) (RelSeries.last s, x₂))

CompositionSeries.Equivalent ((RelSeries.snoc s x₁ hsat₁).snoc y₁ hsaty₁) ((RelSeries.snoc s x₂ hsat₂).snoc y₂ hsaty₂)


theorem Filter.Tendsto.if_nhdsWithin {f g : α → β} {p : α → Prop} [DecidablePred p] {a : α}
    {s : Set α} {l : Filter β} (h₀ : Tendsto f (𝓝[s ∩ { x | p x }] a) l)
    (h₁ : Tendsto g (𝓝[s ∩ { x | ¬p x }] a) l) :
    Tendsto (fun x => if p x then f x else g x) (𝓝[s] a) l

(h₀ : Filter.Tendsto f (𝓝[s ∩ {x | p x}] a) l)

(h₁ : Filter.Tendsto g (𝓝[s ∩ {x | ¬p x}] a) l)

Filter.Tendsto (fun x => if p x then f x else g x) (𝓝[s] a) l


theorem mem_iff {x : R} : x ∈ skewAdjoint R ↔ star x = -x

{R : Type u_1}
[AddCommGroup R]
[StarAddMonoid R]
{x : R}


@[simp]
theorem mem_split_iff : J ∈ split I i x ↔ ↑J = I.splitLower i x ∨ ↑J = I.splitUpper i x

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

J ∈ BoxIntegral.Prepartition.split I i x ↔ ↑J = I.splitLower i x ∨ ↑J = I.splitUpper i x


@[simp]
theorem coe_toLinearEquiv (f : Q₁.IsometryEquiv Q₂) : ⇑(f : M₁ ≃ₗ[R] M₂) = f

{R : Type u_2}
{M₁ : Type u_5}
{M₂ : Type u_6}
{N : Type u_9}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid N]
[Module R M₁]
[Module R M₂]
[Module R N]
{Q₁ : QuadraticMap R M₁ N}
{Q₂ : QuadraticMap R M₂ N}
(f : Q₁.IsometryEquiv Q₂)


/--
`P` is local at the target if
1. `P` respects isomorphisms.
2. If `P` holds for `f : X ⟶ Y`, then `P` holds for `f ∣_ U` for any `U`.
3. If `P` holds for `f ∣_ U` for an open cover `U` of `Y`, then `P` holds for `f`.
-/
protected lemma mk' {P : MorphismProperty Scheme} [P.RespectsIso]
    (restrict : ∀ {X Y : Scheme} (f : X ⟶ Y) (U : X.Opens), P f → P (U.ι ≫ f))
    (of_sSup_eq_top :
      ∀ {X Y : Scheme.{u}} (f : X ⟶ Y) {ι : Type u} (U : ι → X.Opens), iSup U = ⊤ →
        (∀ i, P ((U i).ι ≫ f)) → P f) :
    IsLocalAtSource P

{P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme}

(restrict : ∀ {X Y : AlgebraicGeometry.Scheme} (f : X ⟶ Y) (U : X.Opens), P f → P (U.ι ≫ f))

(of_sSup_eq_top :
  ∀ {X Y : AlgebraicGeometry.Scheme} (f : X ⟶ Y) {ι : Type u} (U : ι → X.Opens),
    iSup U = ⊤ → (∀ (i : ι), P ((U i).ι ≫ f)) → P f)


protected theorem star_mul [Mul α] [StarMul α] (s t : Set α) : (s * t)⋆ = t⋆ * s⋆

{α : Type u_1}
[Mul α]
[StarMul α]
(s t : Set α)


protected theorem IsSemisimple.pow (n : ℕ) : (f ^ n).IsSemisimple

{M : Type u_2}
[AddCommGroup M]
{K : Type u_3}
[Field K]
[Module K M]
{f : Module.End K M}
[FiniteDimensional K M]
(hf : f.IsSemisimple)
(n : ℕ)


@[to_additive]
theorem fst_mul_snd [MulOneClass M] [MulOneClass N] (p : M × N) : (p.fst, 1) * (1, p.snd) = p

{M : Type u_5}
{N : Type u_6}
[AddZeroClass M]
[AddZeroClass N]
(p : M × N)


theorem norm_expSeries_div_summable (x : 𝔸) : Summable fun n => ‖(x ^ n / n ! : 𝔸)‖

(𝕂 : Type u_1)
{𝔸 : Type u_2}
[RCLike 𝕂]
[NormedDivisionRing 𝔸]
[NormedAlgebra 𝕂 𝔸]
(x : 𝔸)

Summable fun n => ‖x ^ n / ↑n.factorial‖


theorem exists_isClopen_upper_or_lower_of_ne (h : x ≠ y) :
    ∃ U : Set α, IsClopen U ∧ (IsUpperSet U ∨ IsLowerSet U) ∧ x ∈ U ∧ y ∉ U

{α : Type u_1}
[TopologicalSpace α]
[PartialOrder α]
[PriestleySpace α]
{x y : α}
(h : x ≠ y)

∃ U, IsClopen U ∧ (IsUpperSet U ∨ IsLowerSet U) ∧ x ∈ U ∧ y ∉ U


@[simp, norm_cast]
theorem div_to_int : ∀ n d, ((n / d : ZNum) : ℤ) = n / d


@[arith_mult]
theorem isMultiplicative_id : IsMultiplicative ArithmeticFunction.id


@[simp] theorem getLsb_and {x y : BitVec v} : (x &&& y).getLsb i = (x.getLsb i && y.getLsb i)


lemma LieSubmodule.coe_toEnd (N : LieSubmodule R L M) (x : L) (y : N) :
    (toEnd R L N x y : M) = toEnd R L M x y

(R : Type u)
(L : Type v)
(M : Type w)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(N : LieSubmodule R L M)
(x : L)
(y : ↥N)

↑(((LieModule.toEnd R L ↥↑N) x) y) = ((LieModule.toEnd R L M) x) ↑y


@[simp]
theorem log_mul_moebius_eq_vonMangoldt : log * μ = Λ

ArithmeticFunction.log * ↑ArithmeticFunction.moebius = ArithmeticFunction.vonMangoldt


/-- **Schur-Zassenhaus** for normal subgroups:
  If `H : Subgroup G` is normal, and has order coprime to its index, then there exists a
  subgroup `K` which is a (left) complement of `H`. -/
theorem exists_left_complement'_of_coprime {N : Subgroup G} [N.Normal]
    (hN : Nat.Coprime (Nat.card N) N.index) : ∃ H : Subgroup G, IsComplement' H N

{G : Type u}
[Group G]
{N : Subgroup G}
[N.Normal]
(hN : (Nat.card ↥N).Coprime N.index)


theorem unbounded_lt_of_forall_exists_le [Preorder α] (h : ∀ a, ∃ b ∈ s, a ≤ b) :
    Unbounded (· < ·) s

{α : Type u_1}
{s : Set α}
[Preorder α]
(h : ∀ (a : α), ∃ b ∈ s, a ≤ b)


/-- If `f : ℕ → F` is multiplicative on coprime arguments, `p` is a prime and `m` is `p`-smooth,
then `f (p^e * m) = f (p^e) * f m`. -/
lemma map_prime_pow_mul {F : Type*} [CommSemiring F] {f : ℕ → F}
    (hmul : ∀ {m n}, Nat.Coprime m n → f (m * n) = f m * f n) {p : ℕ} (hp : p.Prime) (e : ℕ)
    {m : p.smoothNumbers} :
    f (p ^ e * m) = f (p ^ e) * f m

(hmul : ∀ {m n : ℕ}, m.Coprime n → f (m * n) = f m * f n)


theorem adj_and_reachable_delete_edges_iff_exists_cycle {v w : V} :
    G.Adj v w ∧ (G \ fromEdgeSet {s(v, w)}).Reachable v w ↔
      ∃ (u : V) (p : G.Walk u u), p.IsCycle ∧ s(v, w) ∈ p.edges

{V : Type u}
{G : SimpleGraph V}
{v w : V}

G.Adj v w ∧ (G \ SimpleGraph.fromEdgeSet {s(v, w)}).Reachable v w ↔ ∃ u p, p.IsCycle ∧ s(v, w) ∈ p.edges


@[simp] theorem run_bind_lift {α σ : Type u} [Monad m] [LawfulMonad m] (x : m α) (f : α → StateT σ m β) (s : σ) : (StateT.lift x >>= f).run s = x >>= fun a => (f a).run s

{m : Type u → Type u_1}
{β α σ : Type u}
[Monad m]
[LawfulMonad m]
(x : m α)
(f : α → StateT σ m β)
(s : σ)

(StateT.lift x >>= f).run s = do
  let a ← x
  (f a).run s


theorem dite_dite_comm {B : Q → α} {C : ¬P → ¬Q → α} (h : P → ¬Q) :
    (if p : P then A p else if q : Q then B q else C p q) =
     if q : Q then B q else if p : P then A p else C p q

{α : Sort u_1}
(P Q : Prop)
[Decidable P]
[Decidable Q]
{A : P → α}
{B : Q → α}
{C : ¬P → ¬Q → α}
(h : P → ¬Q)


theorem product_sdiff_diag : s ×ˢ s \ s.diag = s.offDiag

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


protected theorem sub_div (h : 0 < b → b < a → c ≠ 0) : (a - b) / c = a / c - b / c

{a b c : ENNReal}
(h : 0 < b → b < a → c ≠ 0)


lemma isSMulRegular_of_ker_lsmul_eq_bot
    (h : LinearMap.ker (LinearMap.lsmul R M r) = ⊥) :
    IsSMulRegular M r

(h : LinearMap.ker ((LinearMap.lsmul R M) r) = ⊥)


theorem map_apply (g : β → γ) (f : α →ₛ β) (a) : f.map g a = g (f a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[MeasurableSpace α]
(g : β → γ)
(f : MeasureTheory.SimpleFunc α β)
(a : α)

↑(MeasureTheory.SimpleFunc.map g f) a = g (↑f a)


@[to_additive (attr := simp)]
theorem mulSingle_inj (i : I) {x y : f i} : mulSingle i x = mulSingle i y ↔ x = y

{I : Type u}
(f : I → Type v₁)
[DecidableEq I]
[(i : I) → Zero (f i)]
(i : I)
{x y : f i}


theorem measurableSet_inter_le [TopologicalSpace ι] [SecondCountableTopology ι] [OrderTopology ι]
    [MeasurableSpace ι] [BorelSpace ι] (hτ : IsStoppingTime f τ) (hπ : IsStoppingTime f π)
    (s : Set Ω) (hs : MeasurableSet[hτ.measurableSpace] s) :
    MeasurableSet[(hτ.min hπ).measurableSpace] (s ∩ {ω | τ ω ≤ π ω})

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[LinearOrder ι]
{f : MeasureTheory.Filtration ι m}
{τ π : Ω → ι}
[TopologicalSpace ι]
[SecondCountableTopology ι]
[OrderTopology ι]
[MeasurableSpace ι]
[BorelSpace ι]
(hτ : MeasureTheory.IsStoppingTime f τ)
(hπ : MeasureTheory.IsStoppingTime f π)
(s : Set Ω)
(hs : MeasurableSet s)


protected theorem div_lt_of_lt_mul {m n k : Nat} (h : m < n * k) : m / n < k


theorem natDegree_eq_zero_of_derivative_eq_zero [NoZeroSMulDivisors ℕ R] {f : R[X]}
    (h : derivative f = 0) : f.natDegree = 0

{R : Type u}
[Semiring R]
[NoZeroSMulDivisors ℕ R]
{f : R[X]}
(h : Polynomial.derivative f = 0)


@[to_additive (attr := simp)]
theorem finite_smul_set : (a • s).Finite ↔ s.Finite

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


theorem WF.filterMap {α β γ} {f : α → β → Option γ} [BEq α] [Hashable α]
    {m : Imp α β} (H : WF m) : WF (filterMap f m)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : α → β → Option γ}
[BEq α]
[Hashable α]
{m : Batteries.HashMap.Imp α β}
(H : m.WF)


protected theorem eventually (h : μ.FiniteAtFilter f) : ∀ᶠ s in f.smallSets, μ s < ∞

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : Filter α}
(h : μ.FiniteAtFilter f)


@[to_additive (attr := simp)] theorem MonoidHom.id_commMonCat_comp
    {G : Type u} [CommMonoid G] {H : CommMonCat.{u}} (f : G →* H) : MonoidHom.comp (𝟙 H) f = f

{G : Type u}
[CommMonoid G]
{H : CommMonCat}
(f : G →* ↑H)


theorem Walk.three_le_chromaticNumber_of_odd_loop {α} {G : SimpleGraph α} {u : α} (p : G.Walk u u)
    (hOdd : Odd p.length) : 3 ≤ G.chromaticNumber

{α : Type u_1}
{G : SimpleGraph α}
{u : α}
(p : G.Walk u u)
(hOdd : Odd p.length)


theorem Finsupp.sum_apply' : g.sum k x = g.sum fun i b => k i b x

{ι : Type u_2}
{γ : Type u_3}
{A : Type u_4}
{B : Type u_5}
[AddCommMonoid A]
[AddCommMonoid B]
(g : ι →₀ A)
(k : ι → A → γ → B)
(x : γ)


theorem Comonad.left_comparison (h : L ⊣ R) : R ⋙ Comonad.comparison h = h.toComonad.cofree

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{L : CategoryTheory.Functor C D}
{R : CategoryTheory.Functor D C}
(h : L ⊣ R)

R.comp (CategoryTheory.Comonad.comparison h) = h.toComonad.cofree