theorem ContDiff.clm_comp {g : X → F →L[𝕜] G} {f : X → E →L[𝕜] F} (hg : ContDiff 𝕜 n g)
    (hf : ContDiff 𝕜 n f) : ContDiff 𝕜 n fun x => (g x).comp (f x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{X : Type u_2}
[NormedAddCommGroup X]
[NormedSpace 𝕜 X]
{n : ℕ∞}
{g : X → F →L[𝕜] G}
{f : X → E →L[𝕜] F}
(hg : ContDiff 𝕜 n g)
(hf : ContDiff 𝕜 n f)


@[simp] theorem exists_eq' : ∃ a, a' = a


/-- If there is a zigzag from `j₁` to `j₂`, then there is a zigzag from `F j₁` to
`F j₂` as long as `F` is a functor.
-/
theorem zigzag_obj_of_zigzag (F : J ⥤ K) {j₁ j₂ : J} (h : Zigzag j₁ j₂) :
    Zigzag (F.obj j₁) (F.obj j₂)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{K : Type u₂}
[CategoryTheory.Category.{v₂, u₂} K]
(F : CategoryTheory.Functor J K)
{j₁ j₂ : J}
(h : CategoryTheory.Zigzag j₁ j₂)

CategoryTheory.Zigzag (F.obj j₁) (F.obj j₂)


theorem eq {w : VectorMeasure α M} (h : v = w) : v ≪ᵥ w

{α : Type u_1}
{m : MeasurableSpace α}
{M : Type u_4}
[AddCommMonoid M]
[TopologicalSpace M]
{v w : MeasureTheory.VectorMeasure α M}
(h : v = w)


theorem denom_apply (g : SL(2, ℤ)) (z : ℍ) :
    denom g z = (↑g : Matrix (Fin 2) (Fin 2) ℤ) 1 0 * z + (↑g : Matrix (Fin 2) (Fin 2) ℤ) 1 1

UpperHalfPlane.denom (↑g) z = ↑(↑g 1 0) * ↑z + ↑(↑g 1 1)


@[simp]
theorem incl_range : I.incl.range = I

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


@[simp] theorem star_imK : (star a).imK = -a.imK


theorem commutative_ring_iff_abelian_lie_ring {A : Type v} [Ring A] :
    Std.Commutative (α := A) (· * ·) ↔ IsLieAbelian A

(Std.Commutative fun x x_1 => x * x_1) ↔ IsLieAbelian A


/-- Any homeomorphism from a `TietzeExtension` space is one itself. -/
theorem TietzeExtension.of_homeo {Y : Type v} {Z : Type w} [TopologicalSpace Y]
    [TopologicalSpace Z] [TietzeExtension.{u, w} Z] (e : Y ≃ₜ Z) :
    TietzeExtension.{u, v} Y

{Y : Type v}
{Z : Type w}
[TopologicalSpace Y]
[TopologicalSpace Z]
[TietzeExtension Z]
(e : Y ≃ₜ Z)


theorem tendsto_compactOpen_restrict {ι : Type*} {l : Filter ι} {F : ι → C(X, Y)} {f : C(X, Y)}
    (hFf : Filter.Tendsto F l (𝓝 f)) (s : Set X) :
    Tendsto (fun i => (F i).restrict s) l (𝓝 (f.restrict s))

{X : Type u_2}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{ι : Type u_6}
{l : Filter ι}
{F : ι → C(X, Y)}
{f : C(X, Y)}
(hFf : Filter.Tendsto F l (𝓝 f))
(s : Set X)

Filter.Tendsto (fun i => ContinuousMap.restrict s (F i)) l (𝓝 (ContinuousMap.restrict s f))


theorem ContDiffAt.rpow (hf : ContDiffAt ℝ n f x) (hg : ContDiffAt ℝ n g x) (h : f x ≠ 0) :
    ContDiffAt ℝ n (fun x => f x ^ g x) x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f g : E → ℝ}
{x : E}
{n : ℕ∞}
(hf : ContDiffAt ℝ n f x)
(hg : ContDiffAt ℝ n g x)
(h : f x ≠ 0)


theorem isBigO_const_one (c : E) (l : Filter α) : (fun _x : α => c) =O[l] fun _x => (1 : F)

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


theorem mem_sup_left {S T : NonUnitalStarSubalgebra R A} : ∀ {x : A}, x ∈ S → x ∈ S ⊔ T

{R : Type u}
{A : Type v}
[CommSemiring R]
[StarRing R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[StarModule R A]
{S T : NonUnitalStarSubalgebra R A}
{x : A}


theorem const_smul_mfderiv (hf : MDifferentiableAt I 𝓘(𝕜, E') f z) (s : 𝕜) :
    (mfderiv I 𝓘(𝕜, E') (s • f) z : TangentSpace I z →L[𝕜] E') =
      (s • mfderiv I 𝓘(𝕜, E') f z : TangentSpace I z →L[𝕜] E')

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

mfderiv I 𝓘(𝕜, E') (s • f) z = s • mfderiv I 𝓘(𝕜, E') f z


protected theorem diff {s' t'} (h : e.IsImage s t) (h' : e.IsImage s' t') :
    e.IsImage (s \ s') (t \ t')

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{e : PartialHomeomorph X Y}
{s : Set X}
{t : Set Y}
{s' : Set X}
{t' : Set Y}
(h : e.IsImage s t)
(h' : e.IsImage s' t')


theorem lintegral_sub_le' (f g : α → ℝ≥0∞) (hf : AEMeasurable f μ) :
    ∫⁻ x, g x ∂μ - ∫⁻ x, f x ∂μ ≤ ∫⁻ x, g x - f x ∂μ

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

∫⁻ (x : α), g x ∂μ - ∫⁻ (x : α), f x ∂μ ≤ ∫⁻ (x : α), g x - f x ∂μ


/-- Implementation of `Mon_.equivLaxMonoidalFunctorPUnit`. -/
@[simps!]
def counitIso : monToLaxMonoidal C ⋙ laxMonoidalToMon C ≅ 𝟭 (Mon_ C)

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

((Mon_.EquivLaxMonoidalFunctorPUnit.counitIso C).inv.app X).hom = 𝟙 X.X


/-- The sum of two upper semicontinuous functions is upper semicontinuous. Formulated with
`[ContinuousAdd]`. The primed version of the lemma uses an explicit continuity assumption on
addition, for application to `EReal`. -/
theorem UpperSemicontinuousOn.add {f g : α → γ} (hf : UpperSemicontinuousOn f s)
    (hg : UpperSemicontinuousOn g s) : UpperSemicontinuousOn (fun z => f z + g z) s

{α : Type u_1}
[TopologicalSpace α]
{s : Set α}
{γ : Type u_4}
[LinearOrderedAddCommMonoid γ]
[TopologicalSpace γ]
[OrderTopology γ]
[ContinuousAdd γ]
{f g : α → γ}
(hf : UpperSemicontinuousOn f s)
(hg : UpperSemicontinuousOn g s)


theorem Stable.inter_right [IsNoetherianRing R] [Module.Finite R M] (hF : F.Stable) :
    (F ⊓ F').Stable

{R M : Type u}
[CommRing R]
[AddCommGroup M]
[Module R M]
{I : Ideal R}
{F : I.Filtration M}
(F' : I.Filtration M)
[IsNoetherianRing R]
[Module.Finite R M]
(hF : F.Stable)


@[simp]
theorem coe_mk (f : M →ₗ⁅R,L⁆ N) (invFun h₁ h₂) :
    ((⟨f, invFun, h₁, h₂⟩ : M ≃ₗ⁅R,L⁆ N) : M → N) = f

(h₁ : Function.LeftInverse invFun (↑f).toFun)

(h₂ : Function.RightInverse invFun (↑f).toFun)

⇑{ toLieModuleHom := f, invFun := invFun, left_inv := h₁, right_inv := h₂ } = ⇑f


theorem MapsTo.iterate {f : α → α} {s : Set α} (h : MapsTo f s s) : ∀ n, MapsTo f^[n] s s

{α : Type u_1}
{f : α → α}
{s : Set α}
(h : Set.MapsTo f s s)
(n : ℕ)


@[simp]
protected theorem coeSubtype : (SMulMemClass.subtype S' : S' → M) = Subtype.val

{R : Type u}
{M : Type v}
[Monoid R]
[MulAction R M]
{A : Type u_1}
[SetLike A M]
[hA : SMulMemClass A R M]
(S' : A)

⇑(SubMulAction.SMulMemClass.subtype S') = Subtype.val


/-- If `MonoidAlgebra R M` is of finite type then `M` is finitely generated. -/
theorem fg_of_finiteType [CommRing R] [Nontrivial R] [h : FiniteType R (MonoidAlgebra R M)] :
    Monoid.FG M

[h : Algebra.FiniteType R (MonoidAlgebra R M)]


theorem posMulMono_iff_posMulReflectLT : PosMulMono α ↔ PosMulReflectLT α

{α : Type u_1}
[Mul α]
[Zero α]
[LinearOrder α]


theorem IsOpen.inter_frontier_eq (hs : IsOpen s) : s ∩ frontier s = ∅

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


theorem not_modEq_iff_ne_add_zsmul : ¬a ≡ b [PMOD p] ↔ ∀ z : ℤ, b ≠ a + z • p

{α : Type u_1}
[AddCommGroup α]
{p a b : α}

¬a ≡ b [PMOD p] ↔ ∀ (z : ℤ), b ≠ a + z • p


lemma Prod.norm_def (x : E × F) : ‖x‖ = max ‖x.1‖ ‖x.2‖

{E : Type u_2}
{F : Type u_3}
[Norm E]
[Norm F]
(x : E × F)


theorem comp_smul [Module R M₂] [Module R M₃] [SMulCommClass R S M₂] [DistribMulAction S M₃]
    [SMulCommClass R S M₃] [CompatibleSMul M₃ M₂ S R] (g : M₃ →ₗ[R] M₂) (a : S) (f : M →ₗ[R] M₃) :
    g.comp (a • f) = a • g.comp f

{R : Type u_1}
{S : Type u_6}
{M : Type u_9}
{M₂ : Type u_11}
{M₃ : Type u_12}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R M]
[Monoid S]
[DistribMulAction S M₂]
[Module R M₂]
[Module R M₃]
[SMulCommClass R S M₂]
[DistribMulAction S M₃]
[SMulCommClass R S M₃]
[LinearMap.CompatibleSMul M₃ M₂ S R]
(g : M₃ →ₗ[R] M₂)
(a : S)
(f : M →ₗ[R] M₃)


@[to_additive (attr := simp)]
theorem le_one_iff_eq_one : a ≤ 1 ↔ a = 1

{α : Type u}
[CanonicallyOrderedCommMonoid α]
{a : α}


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

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

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


theorem AffineMap.restrict.coe_apply (φ : P₁ →ᵃ[k] P₂) {E : AffineSubspace k P₁}
    {F : AffineSubspace k P₂} [Nonempty E] [Nonempty F] (hEF : E.map φ ≤ F) (x : E) :
    ↑(φ.restrict hEF x) = φ x

{k : Type u_1}
{V₁ : Type u_2}
{P₁ : Type u_3}
{V₂ : Type u_4}
{P₂ : Type u_5}
[Ring k]
[AddCommGroup V₁]
[AddCommGroup V₂]
[Module k V₁]
[Module k V₂]
[AddTorsor V₁ P₁]
[AddTorsor V₂ P₂]
(φ : P₁ →ᵃ[k] P₂)
{E : AffineSubspace k P₁}
{F : AffineSubspace k P₂}
[Nonempty ↥E]
[Nonempty ↥F]
(hEF : AffineSubspace.map φ E ≤ F)
(x : ↥E)


@[simp]
theorem arccos_one : arccos 1 = 0


/-- Symmetric statement to `Option.map₂_map_left_anticomm`. -/
theorem map_map₂_antidistrib_left {g : γ → δ} {f' : β' → α → δ} {g' : β → β'}
    (h_antidistrib : ∀ a b, g (f a b) = f' (g' b) a) :
    (map₂ f a b).map g = map₂ f' (b.map g') a

{f : α → β → γ}

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

Option.map g (Option.map₂ f a b) = Option.map₂ f' (Option.map g' b) a


@[to_additive]
lemma piFinset_smul [∀ i, SMul (α i) (β i)] (s : ∀ i, Finset (α i)) (t : ∀ i, Finset (β i)) :
    piFinset (fun i ↦ s i • t i) = piFinset s • piFinset t

{ι : Type u_5}
{α : ι → Type u_6}
{β : ι → Type u_7}
[Fintype ι]
[DecidableEq ι]
[(i : ι) → DecidableEq (β i)]
[(i : ι) → VAdd (α i) (β i)]
(s : (i : ι) → Finset (α i))
(t : (i : ι) → Finset (β i))

(Fintype.piFinset fun i => s i +ᵥ t i) = Fintype.piFinset s +ᵥ Fintype.piFinset t


@[continuity, fun_prop]
theorem Continuous.clm_comp {X} [TopologicalSpace X] {g : X → F →L[𝕜] G} {f : X → E →L[𝕜] F}
    (hg : Continuous g) (hf : Continuous f) : Continuous fun x => (g x).comp (f x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{X : Type u_5}
[TopologicalSpace X]
{g : X → F →L[𝕜] G}
{f : X → E →L[𝕜] F}
(hg : Continuous g)
(hf : Continuous f)


@[simp]
theorem cons_succ : cons y s i.succ = s i

{n : ℕ}
(i : Fin n)
{M : Type u_1}
[Zero M]
(y : M)
(s : Fin n →₀ M)


@[simp]
theorem mk_zero : mk 0 = (0 : M ⧸ p)

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


@[simp]
theorem AlgEquiv.coe_mapIntegralClosure [Algebra R S] (f : A ≃ₐ[R] S)
    (x : integralClosure R A) : (f.mapIntegralClosure x : S) = f (x : A)

{R : Type u_1}
{A : Type u_2}
{S : Type u_4}
[CommRing R]
[CommRing A]
[CommRing S]
[Algebra R A]
[Algebra R S]
(f : A ≃ₐ[R] S)
(x : ↥(integralClosure R A))


theorem ContinuousWithinAt.union {f : α → β} {s t : Set α} {x : α} (hs : ContinuousWithinAt f s x)
    (ht : ContinuousWithinAt f t x) : ContinuousWithinAt f (s ∪ t) x

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
{s t : Set α}
{x : α}
(hs : ContinuousWithinAt f s x)
(ht : ContinuousWithinAt f t x)


theorem map_div_left_divisors :
    n.divisors.map ⟨fun d => (n / d, d), fun p₁ p₂ => congr_arg Prod.snd⟩ =
      n.divisorsAntidiagonal

Finset.map { toFun := fun d => (n / d, d), inj' := ⋯ } n.divisors = n.divisorsAntidiagonal


/-- The **multinomial theorem**. -/
lemma sum_pow_eq_sum_piAntidiag_of_commute (s : Finset α) (f : α → R)
    (hc : (s : Set α).Pairwise fun i j ↦ Commute (f i) (f j)) (n : ℕ) :
    (∑ i in s, f i) ^ n = ∑ k in piAntidiag s n, multinomial s k *
      s.noncommProd (fun i ↦ f i ^ k i) (hc.mono' fun i j h ↦ h.pow_pow ..)

(hc : (↑s).Pairwise fun i j => Commute (f i) (f j))

(∑ i ∈ s, f i) ^ n = ∑ k ∈ s.piAntidiag n, ↑(Nat.multinomial s k) * s.noncommProd (fun i => f i ^ k i) ⋯


theorem Sized.empty_mem_iff (hA : A.Sized r) : ∅ ∈ A ↔ A = {∅}

{α : Type u_1}
{A : Set (Finset α)}
{r : ℕ}
(hA : Set.Sized r A)


@[to_additive (attr := simp)]
theorem comap_mk_nhds (x : Mᵈᵐᵃ) : comap (mk : M → Mᵈᵐᵃ) (𝓝 x) = 𝓝 (mk.symm x)

{M : Type u_1}
[TopologicalSpace M]
(x : Mᵈᵃᵃ)

Filter.comap (⇑DomAddAct.mk) (𝓝 x) = 𝓝 (DomAddAct.mk.symm x)


/-- Bijection between a submonoid `H` and its opposite. -/
@[to_additive (attr := simps!) "Bijection between an additive submonoid `H` and its opposite."]
def equivOp (H : Submonoid M) : H ≃ H.op

{M : Type u_2}
[MulOneClass M]
(H : Submonoid M)
(a : { a // (fun x => x ∈ H) a })


theorem mk_set_eq_nat_iff_finset {α} {s : Set α} {n : ℕ} :
    #s = n ↔ ∃ t : Finset α, (t : Set α) = s ∧ t.card = n

Cardinal.mk ↑s = ↑n ↔ ∃ t, ↑t = s ∧ t.card = n


@[simp]
theorem product_nil : ∀ l : List α, l ×ˢ (@nil β) = []

{α : Type u_1}
{β : Type u_2}
(l : List α)


theorem ClassGroup.mk0_eq_one_iff [IsDedekindDomain R] {I : Ideal R} (hI : I ∈ (Ideal R)⁰) :
    ClassGroup.mk0 ⟨I, hI⟩ = 1 ↔ I.IsPrincipal

{R : Type u_1}
[CommRing R]
[IsDomain R]
[IsDedekindDomain R]
{I : Ideal R}
(hI : I ∈ (Ideal R)⁰)

ClassGroup.mk0 ⟨I, hI⟩ = 1 ↔ Submodule.IsPrincipal I


@[simp]
theorem succ_top : succ (⊤ : α) = ⊤

{α : Type u_1}
[PartialOrder α]
[SuccOrder α]
[OrderTop α]


/-- The set of points which are isolated on the right is countable when the space is
second-countable. -/
theorem countable_setOf_isolated_right [SecondCountableTopology α] :
    { x : α | 𝓝[>] x = ⊥ }.Countable

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


theorem filterMap_filter (p : α → Bool) (f : α → Option β) (l : List α) :
    filterMap f (filter p l) = filterMap (fun x => if p x then f x else none) l

{α : Type u_1}
{β : Type u_2}
(p : α → Bool)
(f : α → Option β)
(l : List α)

List.filterMap f (List.filter p l) = List.filterMap (fun x => if p x = true then f x else none) l


lemma lt_of_smul_lt_smul_right [SMulPosReflectLT α β] (h : a₁ • b < a₂ • b) (hb : 0 ≤ b) :
    a₁ < a₂

{α : Type u_1}
{β : Type u_2}
{a₁ a₂ : α}
{b : β}
[SMul α β]
[Preorder α]
[Preorder β]
[Zero β]
[SMulPosReflectLT α β]
(h : a₁ • b < a₂ • b)
(hb : 0 ≤ b)


theorem RingHom.star_apply {S : Type*} [NonAssocSemiring S] (f : S →+* R) (s : S) :
    star f s = star (f s)

{R : Type u}
[CommSemiring R]
[StarRing R]
{S : Type u_1}
[NonAssocSemiring S]
(f : S →+* R)
(s : S)


/-- Functional equation for the exponential zeta function. -/
lemma expZeta_one_sub (a : UnitAddCircle) {s : ℂ} (hs : ∀ (n : ℕ), s ≠ 1 - n) :
    expZeta a (1 - s) = (2 * π) ^ (-s) * Gamma s *
    (exp (π * I * s / 2) * hurwitzZeta a s + exp (-π * I * s / 2) * hurwitzZeta (-a) s)

(a : UnitAddCircle)
{s : ℂ}
(hs : ∀ (n : ℕ), s ≠ 1 - ↑n)

HurwitzZeta.expZeta a (1 - s) =
  (2 * ↑π) ^ (-s) * Complex.Gamma s *
    (cexp (↑π * Complex.I * s / 2) * HurwitzZeta.hurwitzZeta a s +
      cexp (-↑π * Complex.I * s / 2) * HurwitzZeta.hurwitzZeta (-a) s)


theorem sup_le_of_le_directed {α : Type*} [SemilatticeSup α] [OrderBot α] (s : Set α)
    (hs : s.Nonempty) (hdir : DirectedOn (· ≤ ·) s) (t : Finset α) :
    (∀ x ∈ t, ∃ y ∈ s, x ≤ y) → ∃ x ∈ s, t.sup id ≤ x

(hdir : DirectedOn (fun x x_1 => x ≤ x_1) s)


theorem Filter.Tendsto.congr_uniformity {α β} [UniformSpace β] {f g : α → β} {l : Filter α} {b : β}
    (hf : Tendsto f l (𝓝 b)) (hg : Tendsto (fun x => (f x, g x)) l (𝓤 β)) : Tendsto g l (𝓝 b)

(hg : Filter.Tendsto (fun x => (f x, g x)) l (𝓤 β))


/-- The intersection of a closed set and a compact set is a compact set. -/
theorem IsCompact.inter_left (ht : IsCompact t) (hs : IsClosed s) : IsCompact (s ∩ t)

{X : Type u}
[TopologicalSpace X]
{s t : Set X}
(ht : IsCompact t)
(hs : IsClosed s)


@[simp]
theorem _root_.Submodule.coe_subtypeL' (p : Submodule R₁ M₁) : ⇑p.subtypeL = p.subtype

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


@[simp] lemma upperBounds_smul_of_neg (ha : a < 0) : upperBounds (a • s) = a • lowerBounds s

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[OrderedAddCommGroup β]
[Module α β]
[PosSMulMono α β]
{s : Set β}
{a : α}
(ha : a < 0)


lemma _root_.MeasurableEmbedding.sigmaFinite_map {f : α → β} (hf : MeasurableEmbedding f)
    [SigmaFinite μ] :
    SigmaFinite (μ.map f)

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

MeasureTheory.SigmaFinite (MeasureTheory.Measure.map f μ)


theorem antitone_lam {f : α → β → γ} (hf : ∀ b, Antitone fun a ↦ f a b) : Antitone f

{f : α → β → γ}

(hf : ∀ (b : β), Antitone fun a => f a b)


lemma weightSpaceChain_def' :
    weightSpaceChain M χ₁ χ₂ p q = ⨆ k ∈ Finset.Ioo p q, weightSpace M (k • χ₁ + χ₂)

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(M : Type u_3)
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[LieAlgebra.IsNilpotent R L]
(χ₁ χ₂ : L → R)
(p q : ℤ)

LieModule.weightSpaceChain M χ₁ χ₂ p q = ⨆ k ∈ Finset.Ioo p q, LieModule.weightSpace M (k • χ₁ + χ₂)


theorem Multiplicative.isNormalSubgroup [AddGroup A] {s : Set A} (hs : IsNormalAddSubgroup s) :
    @IsNormalSubgroup (Multiplicative A) _ s

{A : Type u_3}
[AddGroup A]
{s : Set A}
(hs : IsNormalAddSubgroup s)


protected lemma bijOn (h : ∀ a, e a ∈ t ↔ a ∈ s) : BijOn e s t

{α : Type u_1}
{β : Type u_2}
(e : α ≃ β)
{s : Set α}
{t : Set β}
(h : ∀ (a : α), e a ∈ t ↔ a ∈ s)


@[simp]
theorem quot_one : Quot.mk Setoid.r one = (1 : ColimitType F)

{J : Type v}
[CategoryTheory.SmallCategory J]
(F : J ⥤ MonCat)

Quot.mk Setoid.r MonCat.Colimits.Prequotient.one = 1


@[reassoc (attr := simp)]
theorem leftAdjointUniq_trans_app {F F' F'' : C ⥤ D} {G : D ⥤ C} (adj1 : F ⊣ G) (adj2 : F' ⊣ G)
    (adj3 : F'' ⊣ G) (x : C) :
    (leftAdjointUniq adj1 adj2).hom.app x ≫ (leftAdjointUniq adj2 adj3).hom.app x =
      (leftAdjointUniq adj1 adj3).hom.app x

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
{F F' F'' : C ⥤ D}
{G : D ⥤ C}
(adj1 : F ⊣ G)
(adj2 : F' ⊣ G)
(adj3 : F'' ⊣ G)
(x : C)

(adj1.leftAdjointUniq adj2).hom.app x ≫ (adj2.leftAdjointUniq adj3).hom.app x = (adj1.leftAdjointUniq adj3).hom.app x


@[simp]
theorem coe_add (f g : NormedAddGroupHom V₁ V₂) : ⇑(f + g) = f + g

{V₁ : Type u_2}
{V₂ : Type u_3}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
(f g : NormedAddGroupHom V₁ V₂)


/-- The set of natural number powers of an element of a `Submonoid` is a subset of the
`Submonoid`. -/
@[to_additive
      "The set of natural number multiples of an element of an `AddSubmonoid` is a subset of
      the `AddSubmonoid`."]
theorem IsSubmonoid.powers_subset {a : M} (hs : IsSubmonoid s) (h : a ∈ s) : powers a ⊆ s

{M : Type u_1}
[AddMonoid M]
{s : Set M}
{a : M}
(hs : IsAddSubmonoid s)
(h : a ∈ s)


theorem eq_of_bisim [Nonempty (M F)] (bisim : IsBisimulation R) : ∀ s₁ s₂, R s₁ s₂ → s₁ = s₂

{F : PFunctor.{u}}
(R : F.M → F.M → Prop)
[Nonempty F.M]
(bisim : PFunctor.M.IsBisimulation R)
(s₁ s₂ : F.M)


theorem nat_sub_dvd_pow_sub_pow (x y n : ℕ) : x - y ∣ x ^ n - y ^ n


/-- Every topological group in which there exists a compact set with nonempty interior
is locally compact. -/
@[to_additive
  "Every topological additive group
  in which there exists a compact set with nonempty interior is locally compact."]
theorem TopologicalSpace.PositiveCompacts.locallyCompactSpace_of_group
    (K : PositiveCompacts G) : LocallyCompactSpace G

(K : TopologicalSpace.PositiveCompacts G)


theorem Ici_mem_nhdsSet_Ici (h : a < b) : Ici a ∈ 𝓝ˢ (Ici b)

{α : Type u_1}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
{a b : α}
(h : a < b)


lemma CharP.intCast_eq_mod (R : Type _) [Ring R] (p : ℕ) [CharP R p] (k : ℤ) :
    (k : R) = (k % p : ℤ)

(R : Type u_1)
[Ring R]
(p : ℕ)
[CharP R p]
(k : ℤ)


@[simp]
theorem ofInjectiveEndo_left_inv (f : V →ₗ[K] V) (h_inj : Injective f) :
    ((ofInjectiveEndo f h_inj).symm : V →ₗ[K] V) * f = 1

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
[FiniteDimensional K V]
(f : V →ₗ[K] V)
(h_inj : Function.Injective ⇑f)

↑(LinearEquiv.ofInjectiveEndo f h_inj).symm * f = 1


@[simp]
theorem preimage_injective : Injective (preimage f) ↔ Surjective f

Function.Injective (Set.preimage f) ↔ Function.Surjective f


@[simp] lemma Fintype.card_shrink [Fintype (Shrink.{v} α)] : card (Shrink.{v} α) = card α

{α : Type u}
[Fintype α]
[Fintype (Shrink.{v, u} α)]

Fintype.card (Shrink.{v, u} α) = Fintype.card α


theorem inf_const (h : s.Nonempty) (c : α) : (s.inf fun _ => c) = c

{α : Type u_2}
{β : Type u_3}
[SemilatticeInf α]
[OrderTop α]
{s : Finset β}
(h : s.Nonempty)
(c : α)


theorem Group.fg_def : Group.FG G ↔ (⊤ : Subgroup G).FG


lemma forall_lt_iff_eq_bot [Preorder α] {x : WithBot α} :
    (∀ y : α, x < y) ↔ x = ⊥

{α : Type u_1}
[Preorder α]
{x : WithBot α}


@[to_additive (attr := simp)]
theorem map_eq_one_iff {M N} [MulOneClass M] [MulOneClass N] [EquivLike F M N] [MulEquivClass F M N]
    (h : F) {x : M} :
    h x = 1 ↔ x = 1

{F : Type u_1}
{M : Type u_12}
{N : Type u_13}
[AddZeroClass M]
[AddZeroClass N]
[EquivLike F M N]
[AddEquivClass F M N]
(h : F)
{x : M}


/-- This structure holds arguments of the Picard-Lipschitz (Cauchy-Lipschitz) theorem. It is part of
the internal API for convenience, so as not to constantly invoke choice. Unless you want to use one
of the auxiliary lemmas, use `IsPicardLindelof.exists_forall_hasDerivWithinAt_Icc_eq` instead
of using this structure.

The similarly named `IsPicardLindelof` is a bundled `Prop` holding the long hypotheses of the
Picard-Lindelöf theorem as named arguments. It is used as part of the public API.
-/
structure PicardLindelof (E : Type*) [NormedAddCommGroup E] [NormedSpace ℝ E] where
  toFun : ℝ → E → E
  (tMin tMax : ℝ)
  t₀ : Icc tMin tMax
  x₀ : E
  (C R L : ℝ≥0)
  isPicardLindelof : IsPicardLindelof toFun tMin t₀ tMax x₀ L R C

{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(self : PicardLindelof E)

IsPicardLindelof self.toFun self.tMin (↑self.t₀) self.tMax self.x₀ self.L ↑self.R ↑self.C


@[simp]
theorem pair_fst_snd : prod (fst R M M₂) (snd R M M₂) = LinearMap.id

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

(LinearMap.fst R M M₂).prod (LinearMap.snd R M M₂) = LinearMap.id


theorem laurentAux_div :
    laurentAux r (algebraMap _ _ p / algebraMap _ _ q) =
      algebraMap _ _ (taylor r p) / algebraMap _ _ (taylor r q)

{R : Type u}
[CommRing R]
[hdomain : IsDomain R]
(r : R)
(p q : Polynomial R)

(RatFunc.laurentAux r) ((algebraMap (Polynomial R) (RatFunc R)) p / (algebraMap (Polynomial R) (RatFunc R)) q) =
  (algebraMap (Polynomial R) (RatFunc R)) ((Polynomial.taylor r) p) /
    (algebraMap (Polynomial R) (RatFunc R)) ((Polynomial.taylor r) q)


/-- There is a morphism from an extended cone to the original cone. -/
@[simps]
def extend (s : Cone F) {X : C} (f : X ⟶ s.pt) : s.extend f ⟶ s

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
(s : CategoryTheory.Limits.Cone F)
{X : C}
(f : X ⟶ s.pt)

(CategoryTheory.Limits.Cones.extend s f).hom = f


theorem lt_one (x : Ioo (0 : α) 1) : (x : α) < 1

{α : Type u_1}
[StrictOrderedSemiring α]
(x : ↑(Set.Ioo 0 1))


theorem iCondIndepSet.condIndep_generateFrom_le_nat {s : ℕ → Set Ω}
    (hsm : ∀ n, MeasurableSet (s n)) (hs : iCondIndepSet m' hm' s μ) (n : ℕ) :
    CondIndep m' (generateFrom {s (n + 1)}) (generateFrom { t | ∃ k ≤ n, s k = t }) hm' μ

(hs : ProbabilityTheory.iCondIndepSet m' hm' s μ)

ProbabilityTheory.CondIndep m' (MeasurableSpace.generateFrom {s (n + 1)})
  (MeasurableSpace.generateFrom {t | ∃ k ≤ n, s k = t}) hm' μ


/-- The evaluation map is injective for connected objects. -/
lemma evaluation_injective_of_isConnected (A X : C) [IsConnected A] (a : F.obj A) :
    Function.Injective (fun (f : A ⟶ X) ↦ F.map f a)

(F : CategoryTheory.Functor C FintypeCat)


@[ext]
lemma MonadHom.ext' {T₁ T₂ : Monad C} (f g : T₁ ⟶ T₂) (h : f.app = g.app) : f = g

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{T₁ T₂ : CategoryTheory.Monad C}
(f g : T₁ ⟶ T₂)
(h : f.app = g.app)


theorem newtonMap_apply :
    P.newtonMap x = x - (Ring.inverse <| aeval x (derivative P)) * (aeval x P)

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

P.newtonMap x = x - Ring.inverse ((Polynomial.aeval x) (Polynomial.derivative P)) * (Polynomial.aeval x) P


theorem onFun_apply (f : β → β → γ) (g : α → β) (a b : α) : onFun f g a b = f (g a) (g b)

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
(f : β → β → γ)
(g : α → β)
(a b : α)


@[simp]
theorem pointwise_smul_toAddSubmonoid (a : M) (S : Ideal R)
    (ha : Function.Surjective fun r : R => a • r) :
    (a • S).toAddSubmonoid = a • S.toAddSubmonoid

(ha : Function.Surjective fun r => a • r)


theorem balancedCore_zero_mem (hs : (0 : E) ∈ s) : (0 : E) ∈ balancedCore 𝕜 s

{𝕜 : Type u_1}
{E : Type u_2}
[SeminormedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
(hs : 0 ∈ s)


theorem toMonoidWithZeroHom_eq_coe (f : α →+* β) : (f.toMonoidWithZeroHom : α → β) = f

∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β), ⇑f.toMonoidWithZeroHom = ⇑f


theorem closure_minimal (h₁ : s ⊆ t) (h₂ : IsClosed t) : closure s ⊆ t

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


@[simp] lemma covBy_cons (ha : a ∉ s) : s ⋖ s.cons a ha

{α : Type u_1}
{s : Finset α}
{a : α}
(ha : a ∉ s)


theorem Ideal.IsHomogeneous.iff_exists :
    I.IsHomogeneous 𝒜 ↔ ∃ S : Set (homogeneousSubmonoid 𝒜), I = Ideal.span ((↑) '' S)

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

Ideal.IsHomogeneous 𝒜 I ↔ ∃ S, I = Ideal.span (Subtype.val '' S)


theorem UniqueDiffWithinAt.inter (hs : UniqueDiffWithinAt 𝕜 s x) (ht : t ∈ 𝓝 x) :
    UniqueDiffWithinAt 𝕜 (s ∩ t) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{s t : Set E}
(hs : UniqueDiffWithinAt 𝕜 s x)
(ht : t ∈ 𝓝 x)


@[simp]
theorem mem_offDiag {x : α × α} {s : Set α} : x ∈ s.offDiag ↔ x.1 ∈ s ∧ x.2 ∈ s ∧ x.1 ≠ x.2

x ∈ s.offDiag ↔ x.fst ∈ s ∧ x.snd ∈ s ∧ x.fst ≠ x.snd


(S : CategoryTheory.ShortComplex.SnakeInput C)


theorem sbtw_irrefl (a : α) : ¬sbtw a a a

{α : Type u_1}
[CircularPreorder α]
(a : α)


theorem comap_mono (h : m₁ ≤ m₂) : m₁.comap g ≤ m₂.comap g

{α : Type u_1}
{β : Type u_2}
{m₁ m₂ : MeasurableSpace α}
{g : β → α}
(h : m₁ ≤ m₂)

MeasurableSpace.comap g m₁ ≤ MeasurableSpace.comap g m₂


/-- We can turn any colimit cocone over a discrete collection of objects into a bicone. -/
@[simps]
def ofColimitCocone {f : J → C} {t : Cocone (Discrete.functor f)} (ht : IsColimit t) :
    Bicone f

{t : CategoryTheory.Limits.Cocone (CategoryTheory.Discrete.functor f)}

(ht : CategoryTheory.Limits.IsColimit t)

(CategoryTheory.Limits.Bicone.ofColimitCocone ht).pt = t.pt


theorem OpenEmbedding.isOpenMap (hf : OpenEmbedding f) : IsOpenMap f

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


theorem IsLittleO.sum (h : ∀ i ∈ s, A i =o[l] g') : (fun x => ∑ i ∈ s, A i x) =o[l] g'

{α : Type u_1}
{E' : Type u_6}
{F' : Type u_7}
[SeminormedAddCommGroup E']
[SeminormedAddCommGroup F']
{g' : α → F'}
{l : Filter α}
{ι : Type u_17}
{A : ι → α → E'}
{s : Finset ι}
(h : ∀ i ∈ s, A i =o[l] g')


theorem NormedAddGroupHom.extension_coe_to_fun (f : NormedAddGroupHom G H) :
    (f.extension : Completion G → H) = Completion.extension f

{G : Type u_1}
[SeminormedAddCommGroup G]
{H : Type u_2}
[SeminormedAddCommGroup H]
[T0Space H]
[CompleteSpace H]
(f : NormedAddGroupHom G H)

⇑f.extension = UniformSpace.Completion.extension ⇑f


@[simp] theorem data_take (s : String) (n : Nat) : (s.take n).1 = s.1.take n


@[reassoc (attr := simp)]
theorem obj_zero_map_μ_app {m : M} {X Y : C} (f : X ⟶ (F.obj m).obj Y) :
    (F.obj (𝟙_ M)).map f ≫ (F.μ m (𝟙_ M)).app _ =
    F.εIso.inv.app _ ≫ f ≫ (F.map (ρ_ m).inv).app _

(F : CategoryTheory.MonoidalFunctor M (CategoryTheory.Functor C C))

CategoryTheory.CategoryStruct.comp ((F.obj (𝟙_ M)).map f) ((F.μ m (𝟙_ M)).app Y) =
  CategoryTheory.CategoryStruct.comp (F.εIso.inv.app X)
    (CategoryTheory.CategoryStruct.comp f ((F.map (CategoryTheory.MonoidalCategory.rightUnitor m).inv).app Y))


lemma ae_compProd_of_ae_ae [SFinite μ] [IsSFiniteKernel κ] {p : α × β → Prop}
    (hp : MeasurableSet {x | p x}) (h : ∀ᵐ a ∂μ, ∀ᵐ b ∂(κ a), p (a, b)) :
    ∀ᵐ x ∂(μ ⊗ₘ κ), p x

(h : ∀ᵐ (a : α) ∂μ, ∀ᵐ (b : β) ∂κ a, p (a, b))

∀ᵐ (x : α × β) ∂μ ⊗ₘ κ, p x


/-- Given a Localization map `f : M →* N` for a Submonoid `S ⊆ M` and a map of `CommMonoid`s
`g : M →* P` such that `g(S) ⊆ Units P`, `f x = f y → g x = g y` for all `x y : M`. -/
@[to_additive
    "Given a Localization map `f : M →+ N` for a Submonoid `S ⊆ M` and a map of
`AddCommMonoid`s `g : M →+ P` such that `g(S) ⊆ AddUnits P`, `f x = f y → g x = g y`
for all `x y : M`."]
theorem eq_of_eq (hg : ∀ y : S, IsUnit (g y)) {x y} (h : f.toMap x = f.toMap y) : g x = g y

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
{P : Type u_3}
[CommMonoid P]
(f : S.LocalizationMap N)
{g : M →* P}
(hg : ∀ (y : ↥S), IsUnit (g ↑y))
{x y : M}
(h : f.toMap x = f.toMap y)


theorem _root_.Function.Surjective.isBezout {S : Type v} [CommRing S] (f : R →+* S)
    (hf : Function.Surjective f) [IsBezout R] : IsBezout S

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


/-- The **Gagliardo-Nirenberg-Sobolev inequality**.  Let `u` be a continuously differentiable
function `u` supported in a bounded set `s` in a normed space `E` of finite dimension
`n`, equipped with Haar measure, and let `1 < p < n`.
Then the `Lᵖ` norm of `u` is bounded above by a constant times the `Lᵖ` norm of
the Fréchet derivative of `u`.

Note: The codomain of `u` needs to be a finite dimensional normed space.
-/
theorem eLpNorm_le_eLpNorm_fderiv [FiniteDimensional ℝ F]
    {u : E → F} {s : Set E} (hu : ContDiff ℝ 1 u) (h2u : u.support ⊆ s)
    {p : ℝ≥0} (hp : 1 ≤ p) (h2p : p < finrank ℝ E) (hs : Bornology.IsBounded s) :
    eLpNorm u p μ ≤ eLpNormLESNormFDerivOfLeConst F μ s p p * eLpNorm (fderiv ℝ u) p μ

(h2p : p < ↑(FiniteDimensional.finrank ℝ E))

MeasureTheory.eLpNorm u (↑p) μ ≤
  ↑(MeasureTheory.eLpNormLESNormFDerivOfLeConst F μ s p p) * MeasureTheory.eLpNorm (fderiv ℝ u) (↑p) μ


@[simp] lemma coe_star (x : s) : star x = star (x : R)

{R : Type u}
{S : Type w}
[Star R]
[SetLike S R]
[hS : StarMemClass S R]
(s : S)
(x : ↥s)


/-- If `p < ⊤` is a subspace of a vector space `V`, then there exists a nonzero linear map
`f : V →ₗ[K] K` such that `p ≤ ker f`. -/
theorem Submodule.exists_le_ker_of_lt_top (p : Submodule K V) (hp : p < ⊤) :
    ∃ (f : V →ₗ[K] K), f ≠ 0 ∧ p ≤ ker f

{K : Type u_3}
{V : Type u_4}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
(p : Submodule K V)
(hp : p < ⊤)


theorem strictAntiOn_logb_of_base_lt_one : StrictAntiOn (logb b) (Set.Ioi 0)


/-- A single-point face equals the 0-simplex constructed with
`mkOfPoint`. -/
@[simp]
theorem face_eq_mkOfPoint {n : ℕ} (s : Simplex k P n) (i : Fin (n + 1)) :
    s.face (Finset.card_singleton i) = mkOfPoint k (s.points i)

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{n : ℕ}
(s : Affine.Simplex k P n)
(i : Fin (n + 1))

s.face ⋯ = Affine.Simplex.mkOfPoint k (s.points i)


/-- The counit isomorphism for `dgoEquivHomologicalComplex`.
-/
@[simps!]
def dgoEquivHomologicalComplexCounitIso :
    homologicalComplexToDGO b V ⋙ dgoToHomologicalComplex b V ≅
      𝟭 (HomologicalComplex V (ComplexShape.up' b))

(X : HomologicalComplex V (ComplexShape.up' b))

((HomologicalComplex.dgoEquivHomologicalComplexCounitIso b V).hom.app X).f i = 𝟙 (X.X i)


theorem le_of_isClosed_of_mem {S : StarSubalgebra R A} (hS : IsClosed (S : Set A)) {x : A}
    (hx : x ∈ S) : elementalStarAlgebra R x ≤ S

(R : Type u_1)
{A : Type u_2}
[CommSemiring R]
[StarRing R]
[TopologicalSpace A]
[Semiring A]
[StarRing A]
[TopologicalSemiring A]
[ContinuousStar A]
[Algebra R A]
[StarModule R A]
{S : StarSubalgebra R A}
(hS : IsClosed ↑S)
{x : A}
(hx : x ∈ S)


theorem mulRight_apply [NonUnitalNonAssocSemiring R] (a r : R) :
    mulRight r a = a * r

{R : Type u_1}
[NonUnitalNonAssocSemiring R]
(a r : R)


/-- Every element in the fiber of `X` lies in some connected component of `X`. -/
lemma fiber_in_connected_component (X : C) (x : F.obj X) : ∃ (Y : C) (i : Y ⟶ X) (y : F.obj Y),
    F.map i y = x ∧ IsConnected Y ∧ Mono i

(F : CategoryTheory.Functor C FintypeCat)

∃ Y i y, F.map i y = x ∧ CategoryTheory.PreGaloisCategory.IsConnected Y ∧ CategoryTheory.Mono i


@[simp] lemma infClosure_empty : infClosure (∅ : Set α) = ∅


protected theorem lipschitz : LipschitzWith 1 e

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
(e : E ≃ₛₗᵢ[σ₁₂] E₂)


lemma smul_upperBounds_subset_upperBounds_smul_of_nonneg (ha : 0 ≤ a) :
    a • upperBounds s ⊆ upperBounds (a • s)

{α : Type u_1}
{β : Type u_2}
[SMul α β]
[Preorder α]
[Preorder β]
[Zero α]
[PosSMulMono α β]
{a : α}
{s : Set β}
(ha : 0 ≤ a)


@[simp]
theorem adjointAux_norm (A : E →L[𝕜] F) : ‖adjointAux A‖ = ‖A‖

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 E]
[InnerProductSpace 𝕜 F]
[CompleteSpace E]
[CompleteSpace F]
(A : E →L[𝕜] F)

‖ContinuousLinearMap.adjointAux A‖ = ‖A‖


theorem reflectsMonomorphisms_of_preserves_of_reflects (F : C ⥤ D) (G : D ⥤ E)
    [PreservesMonomorphisms G] [ReflectsMonomorphisms (F ⋙ G)] : ReflectsMonomorphisms F

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
(F : C ⥤ D)
(G : D ⥤ E)
[G.PreservesMonomorphisms]
[(F ⋙ G).ReflectsMonomorphisms]


theorem subset_dedup (l : List α) : l ⊆ dedup l

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


/-- If the product of two independent real-valued random variables is integrable and the
first one is not almost everywhere zero, then the second one is integrable. -/
theorem IndepFun.integrable_right_of_integrable_mul {β : Type*} [MeasurableSpace β] {X Y : Ω → β}
    [NormedDivisionRing β] [BorelSpace β] (hXY : IndepFun X Y μ) (h'XY : Integrable (X * Y) μ)
    (hX : AEStronglyMeasurable X μ) (hY : AEStronglyMeasurable Y μ) (h'X : ¬X =ᵐ[μ] 0) :
    Integrable Y μ

(hXY : ProbabilityTheory.IndepFun X Y μ)

(h'XY : MeasureTheory.Integrable (X * Y) μ)

(hX : MeasureTheory.AEStronglyMeasurable X μ)

(hY : MeasureTheory.AEStronglyMeasurable Y μ)


theorem if_ctx_congr_prop {b c x y u v : Prop} [dec_b : Decidable b] [dec_c : Decidable c]
    (h_c : b ↔ c) (h_t : c → (x ↔ u)) (h_e : ¬c → (y ↔ v)) : ite b x y ↔ ite c u v

(if b then x else y) ↔ if c then u else v


@[to_additive]
theorem prehaar_mono {K₀ : PositiveCompacts G} {U : Set G} (hU : (interior U).Nonempty)
    {K₁ K₂ : Compacts G} (h : (K₁ : Set G) ⊆ K₂.1) :
    prehaar (K₀ : Set G) U K₁ ≤ prehaar (K₀ : Set G) U K₂

{K₀ : TopologicalSpace.PositiveCompacts G}

MeasureTheory.Measure.haar.addPrehaar (↑K₀) U K₁ ≤ MeasureTheory.Measure.haar.addPrehaar (↑K₀) U K₂


theorem small_fullSubcategory_filteredClosure :
    Small.{max v w} (FullSubcategory (FilteredClosure f))

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.IsFilteredOrEmpty C]
{α : Type w}
(f : α → C)

Small.{max v w, u} (CategoryTheory.FullSubcategory (CategoryTheory.IsFiltered.FilteredClosure f))


/-- Assemble an `I`-indexed family of natural isomorphisms into a single natural isomorphism.
-/
@[simps]
def pi' {E : Type*} [Category E] {F G : E ⥤ ∀ i, C i}
    (e : ∀ i, F ⋙ Pi.eval C i ≅ G ⋙ Pi.eval C i) : F ≅ G

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

{F G : CategoryTheory.Functor E ((i : I) → C i)}

(e : (i : I) → F.comp (CategoryTheory.Pi.eval C i) ≅ G.comp (CategoryTheory.Pi.eval C i))

(CategoryTheory.NatIso.pi' e).hom = CategoryTheory.NatTrans.pi' fun i => (e i).hom


theorem changeForm_ι_mul_ι (m₁ m₂ : M) :
    changeForm h (ι Q m₁ * ι Q m₂) = ι Q' m₁ * ι Q' m₂ - algebraMap _ _ (B m₁ m₂)

(h : LinearMap.BilinMap.toQuadraticMap B = Q' - Q)

(CliffordAlgebra.changeForm h) ((CliffordAlgebra.ι Q) m₁ * (CliffordAlgebra.ι Q) m₂) =
  (CliffordAlgebra.ι Q') m₁ * (CliffordAlgebra.ι Q') m₂ - (algebraMap R (CliffordAlgebra Q')) ((B m₁) m₂)


theorem rename_C (f : σ → τ) (r : R) : rename f (C r) = C r

{σ : Type u_1}
{τ : Type u_2}
{R : Type u_4}
[CommSemiring R]
(f : σ → τ)
(r : R)

(MvPolynomial.rename f) (MvPolynomial.C r) = MvPolynomial.C r


@[to_additive (attr := to_additive) (reorder := 5 6) smul_def]
theorem pow_def [∀ i, Pow (f i) β] (x : ∀ i, f i) (b : β) : x ^ b = fun i => x i ^ b

{I : Type u}
{β : Type u_2}
{f : I → Type v₁}
[(i : I) → VAdd β (f i)]
(b : β)
(x : (i : I) → f i)


/-- If `p : W → Prop` holds for the identity and it is preserved under multiplying on the right
by a simple reflection, then it holds for all elements of `W`. -/
theorem simple_induction_right {p : W → Prop} (w : W) (one : p 1)
    (mul_simple_right : ∀ (w : W) (i : B), p w → p (w * s i)) : p w

(mul_simple_right : ∀ (w : W) (i : B), p w → p (w * cs.simple i))


@[simp, norm_cast]
theorem coe_convexAddSubmonoid : ↑(convexAddSubmonoid 𝕜 E) = {s : Set E | Convex 𝕜 s}

(𝕜 : Type u_1)
(E : Type u_2)
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]

↑(convexAddSubmonoid 𝕜 E) = {s | Convex 𝕜 s}


protected theorem RingHom.IsIntegral.trans
    (hf : f.IsIntegral) (hg : g.IsIntegral) : (g.comp f).IsIntegral

{R : Type u_1}
{S : Type u_4}
{T : Type u_5}
[CommRing R]
[CommRing S]
[CommRing T]
(f : R →+* S)
(g : S →+* T)
(hf : f.IsIntegral)
(hg : g.IsIntegral)


theorem Filter.EventuallyEq.eq_of_nhds {f g : X → α} (h : f =ᶠ[𝓝 x] g) : f x = g x

{X : Type u}
{α : Type u_1}
{x : X}
[TopologicalSpace X]
{f g : X → α}
(h : f =ᶠ[𝓝 x] g)


theorem mod_def (a m : Fin n) : a % m = Fin.mk (a % m) (Nat.lt_of_le_of_lt (Nat.mod_le _ _) a.2)


@[simp, norm_cast]
theorem coe_algHom : DFunLike.coe (e.toAlgHom) = DFunLike.coe e

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Algebra R A₁]
[Algebra R A₂]
(e : A₁ ≃ₐ[R] A₂)


theorem of_isIso_fac_left {X Y Z : C} {f : X ⟶ Y} {g : Y ⟶ Z} {h : X ⟶ Z} [IsIso f]
    [hh : IsIso h] (w : f ≫ g = h) : IsIso g

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


@[to_additive (attr := simp)]
theorem comap_mk.symm_nhds (x : M) : comap (mk.symm : Mᵈᵐᵃ → M) (𝓝 x) = 𝓝 (mk x)

{M : Type u_1}
[TopologicalSpace M]
(x : M)

Filter.comap (⇑DomMulAct.mk.symm) (𝓝 x) = 𝓝 (DomMulAct.mk x)


theorem Monic.sub_of_right {p q : R[X]} (hq : q.leadingCoeff = -1) (hpq : degree p < degree q) :
    Monic (p - q)

{R : Type u}
[Ring R]
{p q : R[X]}
(hq : q.leadingCoeff = -1)
(hpq : p.degree < q.degree)


@[to_additive (attr := simp)]
lemma mulEquivOfOrderOfEq_apply_gen : mulEquivOfOrderOfEq hg hg' h g = g'

(hg : ∀ (x : G), x ∈ Subgroup.zpowers g)

(hg' : ∀ (x : G'), x ∈ Subgroup.zpowers g')


theorem map_injective_iff (P : C) : Injective (F.functor.obj P) ↔ Injective P

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u_1}
[CategoryTheory.Category.{u_2, u_1} D]
(F : C ≌ D)
(P : C)

CategoryTheory.Injective (F.functor.obj P) ↔ CategoryTheory.Injective P


theorem length_permutationsAux2 (t : α) (ts : List α) (ys : List α) (f : List α → β) :
    length (permutationsAux2 t ts [] ys f).2 = length ys

{α : Type u_1}
{β : Type u_2}
(t : α)
(ts ys : List α)
(f : List α → β)

(List.permutationsAux2 t ts [] ys f).2.length = ys.length


theorem ediam_image_inter_le_of_le (hf : HolderOnWith C r f s) {d : ℝ≥0∞}
    (hd : EMetric.diam t ≤ d) : EMetric.diam (f '' (t ∩ s)) ≤ (C : ℝ≥0∞) * d ^ (r : ℝ)

{X : Type u_1}
{Y : Type u_2}
[PseudoEMetricSpace X]
[PseudoEMetricSpace Y]
{C r : ℝ≥0}
{f : X → Y}
{s t : Set X}
(hf : HolderOnWith C r f s)
{d : ℝ≥0∞}
(hd : EMetric.diam t ≤ d)

EMetric.diam (f '' (t ∩ s)) ≤ ↑C * d ^ ↑r


/-- If `χ` is primitive, but `e` is not, then `gaussSum χ e = 0`. -/
lemma gaussSum_eq_zero_of_isPrimitive_of_not_isPrimitive [IsDomain R]
    {χ : DirichletCharacter R N} (hχ : IsPrimitive χ) (he : ¬IsPrimitive e) :
    gaussSum χ e = 0

{N : ℕ}
[NeZero N]
{R : Type u_1}
[CommRing R]
(e : AddChar (ZMod N) R)
[IsDomain R]
{χ : DirichletCharacter R N}
(hχ : χ.IsPrimitive)
(he : ¬e.IsPrimitive)


/-- A Hilbert space admits a Hilbert basis extending a given orthonormal subset. -/
theorem _root_.Orthonormal.exists_hilbertBasis_extension {s : Set E}
    (hs : Orthonormal 𝕜 ((↑) : s → E)) :
    ∃ (w : Set E) (b : HilbertBasis w 𝕜 E), s ⊆ w ∧ ⇑b = ((↑) : w → E)

{𝕜 : Type u_2}
[RCLike 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[cplt : CompleteSpace E]
{s : Set E}
(hs : Orthonormal 𝕜 Subtype.val)

∃ w b, s ⊆ w ∧ (fun i => b.repr.symm (lp.single 2 i 1)) = Subtype.val


@[simp]
theorem edist_toDual (a b : X) : edist (toDual a) (toDual b) = edist a b

edist (OrderDual.toDual a) (OrderDual.toDual b) = edist a b


lemma angle_one_left (hy : y ≠ 0) : angle 1 y = |y.arg|

InnerProductGeometry.angle 1 y = |y.arg|


/-- If `R →+* A` is injective, and `A` is of exponential characteristic `p`, then `R` is also of
exponential characteristic `p`. Similar to `RingHom.charZero`. -/
theorem RingHom.expChar {R A : Type*} [Semiring R] [Semiring A] (f : R →+* A)
    (H : Function.Injective f) (p : ℕ) [ExpChar A p] : ExpChar R p

{R : Type u_1}
{A : Type u_2}
[Semiring R]
[Semiring A]
(f : R →+* A)
(H : Function.Injective ⇑f)
(p : ℕ)
[ExpChar A p]


@[reassoc]
theorem comp_coconePointsIsoOfNatIso_hom {F G : J ⥤ C} {s : Cocone F} {t : Cocone G}
    (P : IsColimit s) (Q : IsColimit t) (w : F ≅ G) (j : J) :
    s.ι.app j ≫ (coconePointsIsoOfNatIso P Q w).hom = w.hom.app j ≫ t.ι.app j

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F G : J ⥤ C}
{s : CategoryTheory.Limits.Cocone F}
{t : CategoryTheory.Limits.Cocone G}
(P : CategoryTheory.Limits.IsColimit s)
(Q : CategoryTheory.Limits.IsColimit t)
(w : F ≅ G)
(j : J)

s.ι.app j ≫ (P.coconePointsIsoOfNatIso Q w).hom = w.hom.app j ≫ t.ι.app j


theorem Seminorm.continuous_iSup
    {ι : Sort*} {𝕜 E : Type*} [NormedField 𝕜]  [AddCommGroup E] [Module 𝕜 E]
    [TopologicalSpace E] [BarrelledSpace 𝕜 E] (p : ι → Seminorm 𝕜 E)
    (hp : ∀ i, Continuous (p i)) (bdd : BddAbove (range p)) :
    Continuous (⨆ i, p i)

{ι : Sort u_1}
{𝕜 : Type u_2}
{E : Type u_3}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[BarrelledSpace 𝕜 E]
(p : ι → Seminorm 𝕜 E)
(hp : ∀ (i : ι), Continuous ⇑(p i))
(bdd : BddAbove (Set.range p))


theorem nonneg_of_mul_nonneg_right [PosMulStrictMono α]
    (h : 0 ≤ a * b) (ha : 0 < a) : 0 ≤ b

{α : Type u}
[Semiring α]
[LinearOrder α]
{a b : α}
[PosMulStrictMono α]
(h : 0 ≤ a * b)
(ha : 0 < a)


protected theorem pow_mem {x : A} (hx : x ∈ S) (n : ℕ) : x ^ n ∈ S

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R A)
{x : A}
(hx : x ∈ S)
(n : ℕ)


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

{α : Type u}
[DivisionMonoid α]
{a b : α}
(h : IsUnit a)


@[simp]
theorem update_inr_comp_inr [DecidableEq β] [DecidableEq (α ⊕ β)] {f : α ⊕ β → γ} {i : β}
    {x : γ} : update f (inr i) x ∘ inr = update (f ∘ inr) i x

{α : Type u}
{β : Type v}
{γ : Type u_1}
[DecidableEq β]
[DecidableEq (α ⊕ β)]
{f : α ⊕ β → γ}
{i : β}
{x : γ}

Function.update f (Sum.inr i) x ∘ Sum.inr = Function.update (f ∘ Sum.inr) i x


theorem subsingleton_of_univ_subsingleton (h : (univ : Set α).Subsingleton) : Subsingleton α

{α : Type u}
(h : Set.univ.Subsingleton)


theorem val_one_eq_one_mod (n : ℕ) : (1 : ZMod n).val = 1 % n


theorem iSup_le (h : ∀ i, f i ≤ a) : iSup f ≤ a

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
{f : ι → α}
{a : α}
(h : ∀ (i : ι), f i ≤ a)


lemma isIntegralCurve_comp_add {dt : ℝ} :
    IsIntegralCurve γ v ↔ IsIntegralCurve (γ ∘ (· + dt)) v

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type u_2}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type u_3}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{γ : ℝ → M}
{v : (x : M) → TangentSpace I x}
{dt : ℝ}

IsIntegralCurve γ v ↔ IsIntegralCurve (γ ∘ fun x => x + dt) v


/-- The bijection `StructuredArrow (L.obj X) L ≃ StructuredArrow (L'.obj X) L'`
when `L` and `L'` are two localization functors for the same class of morphisms. -/
@[simps]
noncomputable def structuredArrowEquiv :
    StructuredArrow (L.obj X) L ≃ StructuredArrow (L'.obj X) L'

(f : CategoryTheory.StructuredArrow (L.obj X) L)

(CategoryTheory.Localization.structuredArrowEquiv W L L') f =
  CategoryTheory.StructuredArrow.mk ((CategoryTheory.Localization.homEquiv W L L') f.hom)


theorem pred_ncard_le_ncard_diff_singleton (s : Set α) (a : α) : s.ncard - 1 ≤ (s \ {a}).ncard


@[simp]
theorem lintegral_mk (f : α → ℝ≥0∞) (hf) : (mk f hf : α →ₘ[μ] ℝ≥0∞).lintegral = ∫⁻ a, f a ∂μ

(f : α → ℝ≥0∞)

(hf : MeasureTheory.AEStronglyMeasurable f μ)

(MeasureTheory.AEEqFun.mk f hf).lintegral = ∫⁻ (a : α), f a ∂μ


theorem Differentiable.zpow (hf : Differentiable 𝕜 f) (h : (∀ x, f x ≠ 0) ∨ 0 ≤ m) :
    Differentiable 𝕜 fun x => f x ^ m

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type v}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{m : ℤ}
{f : E → 𝕜}
(hf : Differentiable 𝕜 f)
(h : (∀ (x : E), f x ≠ 0) ∨ 0 ≤ m)


lemma essImageDistTriang_mem_of_iso {T₁ T₂ : Triangle D} (e : T₂ ≅ T₁)
    (h : T₁ ∈ L.essImageDistTriang) : T₂ ∈ L.essImageDistTriang

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

{T₁ T₂ : CategoryTheory.Pretriangulated.Triangle D}


lemma measurableSet_mutuallySingularSet (κ η : Kernel α γ) :
    MeasurableSet (mutuallySingularSet κ η)

[hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ]


theorem sum_comp_sumInv : sum I M ∘ₗ sumInv I M = LinearMap.id

{R : Type u_1}
[CommRing R]
(I : Ideal R)
{ι : Type u_6}
[DecidableEq ι]
(M : ι → Type u_7)
[(i : ι) → AddCommGroup (M i)]
[(i : ι) → Module R (M i)]
[Fintype ι]

AdicCompletion.sum I M ∘ₗ AdicCompletion.sumInv I M = LinearMap.id


theorem right_dom_of_union_dom [Union α] {a b : Part α} (hab : Dom (a ∪ b)) : b.Dom

{α : Type u_1}
[Union α]
{a b : Part α}
(hab : (a ∪ b).Dom)


@[simp]
theorem zeroth_conv'Aux_eq_zero {s : Stream'.Seq <| Pair K} :
    convs'Aux s 0 = (0 : K)

{K : Type u_1}
[DivisionRing K]
{s : Stream'.Seq (GenContFract.Pair K)}


/-- Uses `left` co(ntra)variant. -/
@[to_additive (attr := simp) "Uses `left` co(ntra)variant."]
theorem Left.one_le_inv_iff : 1 ≤ a⁻¹ ↔ a ≤ 1

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


theorem hyperplane_separation_of_nmem (K : ProperCone ℝ E) {f : E →L[ℝ] F} {b : F}
    (disj : b ∉ K.map f) : ∃ y : F, adjoint f y ∈ K.dual ∧ ⟪y, b⟫_ℝ < 0

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
[CompleteSpace E]
{F : Type u_2}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
[CompleteSpace F]
(K : ProperCone ℝ E)
{f : E →L[ℝ] F}
{b : F}
(disj : b ∉ ProperCone.map f K)

∃ y, (ContinuousLinearMap.adjoint f) y ∈ K.dual ∧ ⟪y, b⟫_ℝ < 0


/-- The empty normalized word, representing the identity element of the group. -/
@[simps!]
def empty : NormalWord d

{d : Monoid.PushoutI.NormalWord.Transversal φ}


theorem lt_of_le_of_lf {x y : PGame} (h₁ : x ≤ y) (h₂ : x ⧏ y) : x < y

{x y : SetTheory.PGame}
(h₁ : x ≤ y)
(h₂ : x.LF y)


@[simp]
theorem coe_mk (s : Set α) (h : IsIrreducible s) (h' : IsClosed s) : (mk s h h' : Set α) = s

{α : Type u_2}
[TopologicalSpace α]
(s : Set α)
(h : IsIrreducible s)
(h' : IsClosed s)

↑{ carrier := s, is_irreducible' := h, is_closed' := h' } = s


/-- The square with `0 : 0 ⟶ 0` on the bottom and `𝟙 X` on the top is a pullback square. -/
@[simp]
theorem zero_bot (X : C) : IsPullback (𝟙 X) (0 : X ⟶ 0) (0 : X ⟶ 0) (0 : (0 : C) ⟶ 0)


/-- An alias for `h.symm.map_mul`. Introduced to fix the issue in
https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/!4.234183.20.60simps.60.20maximum.20recursion.20depth
-/
@[to_additive]
lemma symm_map_mul {M N : Type*} [Mul M] [Mul N] (h : M ≃* N) (x y : N) :
    h.symm (x * y) = h.symm x * h.symm y

{M : Type u_12}
{N : Type u_13}
[Add M]
[Add N]
(h : M ≃+ N)
(x y : N)


theorem mapDomain_smul {_ : Monoid R} [AddCommMonoid M] [DistribMulAction R M] {f : α → β} (b : R)
    (v : α →₀ M) : mapDomain f (b • v) = b • mapDomain f v

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
{R : Type u_11}

∀ {x : Monoid R} [inst : AddCommMonoid M] [inst_1 : DistribMulAction R M] {f : α → β} (b : R) (v : α →₀ M),
  Finsupp.mapDomain f (b • v) = b • Finsupp.mapDomain f v


theorem h_apply_infinity (x : B) (hx : x ∈ f.range) : (h x) ∞ = ∞

{A B : Grp}
(f : A ⟶ B)
(x : ↑B)
(hx : x ∈ MonoidHom.range f)

((Grp.SurjectiveOfEpiAuxs.h f) x) Grp.SurjectiveOfEpiAuxs.XWithInfinity.infinity =
  Grp.SurjectiveOfEpiAuxs.XWithInfinity.infinity


/-- If finsets `s` and `t` are interleaved, then `Finset.card s ≤ Finset.card t + 1`. -/
theorem card_le_of_interleaved {s t : Finset α}
    (h : ∀ᵉ (x ∈ s) (y ∈ s),
        x < y → (∀ z ∈ s, z ∉ Set.Ioo x y) → ∃ z ∈ t, x < z ∧ z < y) :
    s.card ≤ t.card + 1

(h : ∀ x ∈ s, ∀ y ∈ s, x < y → (∀ z ∈ s, z ∉ Set.Ioo x y) → ∃ z ∈ t, x < z ∧ z < y)


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

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


protected theorem comap_comap (g : C(β, γ)) (f : C(α, β)) (U : Opens γ) :
    comap f (comap g U) = comap (g.comp f) U

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
(g : C(β, γ))
(f : C(α, β))
(U : TopologicalSpace.Opens γ)

(TopologicalSpace.Opens.comap f) ((TopologicalSpace.Opens.comap g) U) = (TopologicalSpace.Opens.comap (g.comp f)) U


theorem measurable_uniqueElim [Unique δ] [∀ i, MeasurableSpace (π i)] :
    Measurable (uniqueElim : π (default : δ) → ∀ i, π i)

{δ : Type u_4}
{π : δ → Type u_6}
[Unique δ]
[(i : δ) → MeasurableSpace (π i)]


@[simp]
theorem coe_comap (f : P₁ →ᵃ[k] P₂) (s : AffineSubspace k P₂) : (s.comap f : Set P₁) = f ⁻¹' ↑s

{k : Type u_1}
{V₁ : Type u_2}
{P₁ : Type u_3}
{V₂ : Type u_4}
{P₂ : Type u_5}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]
(f : P₁ →ᵃ[k] P₂)
(s : AffineSubspace k P₂)


theorem traceMatrix_eq_embeddingsMatrix_mul_trans : (traceMatrix K b).map (algebraMap K E) =
    embeddingsMatrix K E b * (embeddingsMatrix K E b)ᵀ

(K : Type u_4)
{L : Type u_5}
[Field K]
[Field L]
[Algebra K L]
{κ : Type w}
(E : Type z)
[Field E]
[Algebra K E]
[Module.Finite K L]
[Algebra.IsSeparable K L]
[IsAlgClosed E]
(b : κ → L)

(Algebra.traceMatrix K b).map ⇑(algebraMap K E) = Algebra.embeddingsMatrix K E b * (Algebra.embeddingsMatrix K E b)ᵀ


@[simp]
theorem sepDegree_bot : sepDegree F (⊥ : IntermediateField F E) = 1

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


theorem toComplex_neg (x : ℤ[i]) : ((-x : ℤ[i]) : ℂ) = -x

GaussianInt.toComplex (-x) = -GaussianInt.toComplex x


@[simp]
theorem untrop_trop (x : R) : untrop (trop x) = x


@[simp]
theorem tropOrderIso_symm_coe_fn [Preorder R] : (tropOrderIso.symm : Tropical R → R) = untrop


theorem mk_mem_prod (ha : a ∈ s) (hb : b ∈ t) : (a, b) ∈ s ×ˢ t

{α : Type u}
{β : Type v}
{a : α}
{b : β}
{s : Set α}
{t : Set β}
(ha : a ∈ s)
(hb : b ∈ t)


theorem abs_min_sub_min_le_max (a b c d : α) : |min a b - min c d| ≤ max |a - c| |b - d|

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


lemma uCompactlyGeneratedSpace_of_continuous_maps {X : Type w} [t : TopologicalSpace X]
    (h : ∀ {Y : Type w} [tY : TopologicalSpace Y] (f : X → Y),
      (∀ (S : CompHaus.{u}) (g : C(S, X)), Continuous (f ∘ g)) → Continuous f) :
        UCompactlyGeneratedSpace.{u} X

(h :
  ∀ {Y : Type w} [tY : TopologicalSpace Y] (f : X → Y),
    (∀ (S : CompHaus) (g : C(↑S.toTop, X)), Continuous (f ∘ ⇑g)) → Continuous f)


/-- If `F : Cᵒᵖ ⥤ D` is a presheaf with values in a concrete category, if `x` and `y` are
elements in `F.obj X`, this is the sieve of `X.unop` consisting of morphisms `f`
such that `F.map f.op x = F.map f.op y`. -/
@[simps]
def equalizerSieve {F : Cᵒᵖ ⥤ D} {X : Cᵒᵖ} (x y : F.obj X) : Sieve X.unop

(x y : (CategoryTheory.forget D).obj (F.obj X))

∀ (x_1 : C) (f : x_1 ⟶ Opposite.unop X),
  (CategoryTheory.Presheaf.equalizerSieve x y).arrows f = ((F.map f.op) x = (F.map f.op) y)


/-- The left adjoint of evaluation. -/
@[simps]
def evaluationLeftAdjoint (c : C) : D ⥤ C ⥤ D

[∀ (a b : C), CategoryTheory.Limits.HasCoproductsOfShape (a ⟶ b) D]

((CategoryTheory.evaluationLeftAdjoint D c).obj d).obj t = ∐ fun x => d


@[simp]
theorem map_some_eraseNone [DecidableEq (Option α)] (s : Finset (Option α)) :
    (eraseNone s).map Embedding.some = s.erase none

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

Finset.map Function.Embedding.some (Finset.eraseNone s) = s.erase none


nonrec theorem HasDerivAtFilter.neg (h : HasDerivAtFilter f f' x L) :
    HasDerivAtFilter (fun x => -f x) (-f') x L

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
{L : Filter 𝕜}
(h : HasDerivAtFilter f f' x L)


theorem Equiv.not_fuzzy' {x y : PGame} (h : x ≈ y) : ¬y ‖ x


@[simp]
theorem leadingCoeff_zero : leadingCoeff (0 : R[X]) = 0


theorem hasDerivWithinAt_next (t : Icc v.tMin v.tMax) :
    HasDerivWithinAt (f.next ∘ v.proj) (v t (f t)) (Icc v.tMin v.tMax) t

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{v : PicardLindelof E}
(f : v.FunSpace)
[CompleteSpace E]
(t : ↑(Set.Icc v.tMin v.tMax))

HasDerivWithinAt (f.next.toFun ∘ v.proj) (v.toFun (↑t) (f.toFun t)) (Set.Icc v.tMin v.tMax) ↑t


@[simp]
theorem zero_ne_top : (0 : PartENat) ≠ ⊤


@[reassoc (attr := simp)]
lemma opShiftFunctorEquivalence_counitIso_hom_naturality (n : ℤ) {X Y : Cᵒᵖ} (f : X ⟶ Y) :
    f.unop⟦n⟧'.op⟦n⟧' ≫ (opShiftFunctorEquivalence C n).counitIso.hom.app Y =
      (opShiftFunctorEquivalence C n).counitIso.hom.app X ≫ f

(C : Type u_1)
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.HasShift C ℤ]
(n : ℤ)
{X Y : Cᵒᵖ}
(f : X ⟶ Y)

CategoryTheory.CategoryStruct.comp
    ((CategoryTheory.shiftFunctor Cᵒᵖ n).map ((CategoryTheory.shiftFunctor C n).map f.unop).op)
    ((CategoryTheory.Pretriangulated.opShiftFunctorEquivalence C n).counitIso.hom.app Y) =
  CategoryTheory.CategoryStruct.comp
    ((CategoryTheory.Pretriangulated.opShiftFunctorEquivalence C n).counitIso.hom.app X) f


/-- The torsion submonoid of a torsion monoid is `⊤`. -/
@[to_additive (attr := simp) "The additive torsion submonoid of an additive torsion monoid is `⊤`."]
theorem torsion_eq_top (tG : IsTorsion G) : torsion G = ⊤

{G : Type u_1}
[AddCommMonoid G]
(tG : AddMonoid.IsTorsion G)


theorem setToL1SCLM_nonneg {T : Set α → G' →L[ℝ] G''} {C : ℝ} (hT : DominatedFinMeasAdditive μ T C)
    (hT_nonneg : ∀ s, MeasurableSet s → μ s < ∞ → ∀ x, 0 ≤ x → 0 ≤ T s x) {f : α →₁ₛ[μ] G'}
    (hf : 0 ≤ f) : 0 ≤ setToL1SCLM α G' μ hT f

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(hT_nonneg : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∀ (x : G'), 0 ≤ x → 0 ≤ (T s) x)

{f : ↥(MeasureTheory.Lp.simpleFunc G' 1 μ)}

0 ≤ (MeasureTheory.L1.SimpleFunc.setToL1SCLM α G' μ hT) f


theorem IsEquivalent.mul (htu : t ~[l] u) (hvw : v ~[l] w) : t * v ~[l] u * w

{α : Type u_1}
{β : Type u_2}
[NormedField β]
{t u v w : α → β}
{l : Filter α}
(htu : t ~[l] u)
(hvw : v ~[l] w)


@[simp]
theorem reverse_concat {u v w : V} (p : G.Walk u v) (h : G.Adj v w) :
    (p.concat h).reverse = cons (G.symm h) p.reverse

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

(p.concat h).reverse = SimpleGraph.Walk.cons ⋯ p.reverse


@[simp]
theorem imageToKernel_comp_hom_inv_comp [HasEqualizers V] [HasImages V] {Z : V} {i : B ≅ Z} (w) :
    imageToKernel (f ≫ i.hom) (i.inv ≫ g) w =
      (imageSubobjectCompIso _ _).hom ≫
        imageToKernel f g (by simpa using w) ≫ (kernelSubobjectIsoComp i.inv g).inv

imageToKernel (f ≫ i.hom) (i.inv ≫ g) w =
  (CategoryTheory.Limits.imageSubobjectCompIso f i.hom).hom ≫
    imageToKernel f g ⋯ ≫ (CategoryTheory.Limits.kernelSubobjectIsoComp i.inv g).inv


lemma negDblY_of_Y_eq [NoZeroDivisors R] {P Q : Fin 3 → R} (hQz : Q z ≠ 0)
    (hx : P x * Q z ^ 2 = Q x * P z ^ 2) (hy : P y * Q z ^ 3 = Q y * P z ^ 3)
    (hy' : P y * Q z ^ 3 = W'.negY Q * P z ^ 3) : W'.negDblY P = (-W'.dblU P) ^ 3


private theorem of_boolalg_symmDiff_aux (a b : α) : (a + b + a * b) * (1 + a * b) = a + b

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


private theorem distinctPairs_increment :
    P.parts.offDiag.attach.biUnion (distinctPairs hP G ε) ⊆ (increment hP G ε).parts.offDiag

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{P : Finpartition Finset.univ}
{hP : P.IsEquipartition}
{G : SimpleGraph α}
[DecidableRel G.Adj]
{ε : ℝ}

P.parts.offDiag.attach.biUnion (SzemerediRegularity.distinctPairs hP G ε) ⊆
  (SzemerediRegularity.increment hP G ε).parts.offDiag


theorem ProgMeasurable.stronglyMeasurable_stoppedProcess [MetrizableSpace ι]
    (hu : ProgMeasurable f u) (hτ : IsStoppingTime f τ) (i : ι) :
    StronglyMeasurable (MeasureTheory.stoppedProcess u τ i)

{Ω : Type u_1}
{β : Type u_2}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[LinearOrder ι]
[MeasurableSpace ι]
[TopologicalSpace ι]
[OrderTopology ι]
[SecondCountableTopology ι]
[BorelSpace ι]
[TopologicalSpace β]
{u : ι → Ω → β}
{τ : Ω → ι}
{f : MeasureTheory.Filtration ι m}
[TopologicalSpace.MetrizableSpace ι]
(hu : MeasureTheory.ProgMeasurable f u)
(hτ : MeasureTheory.IsStoppingTime f τ)
(i : ι)

MeasureTheory.StronglyMeasurable (MeasureTheory.stoppedProcess u τ i)


theorem trace_eq_sum_embeddings_gen (pb : PowerBasis K L)
    (hE : (minpoly K pb.gen).Splits (algebraMap K E)) (hfx : IsSeparable K pb.gen) :
    algebraMap K E (Algebra.trace K L pb.gen) =
      (@Finset.univ _ (PowerBasis.AlgHom.fintype pb)).sum fun σ => σ pb.gen

(hE : Polynomial.Splits (algebraMap K E) (minpoly K pb.gen))

(algebraMap K E) ((Algebra.trace K L) pb.gen) = ∑ σ : L →ₐ[K] E, σ pb.gen


/-- If `E / F` is an algebraic extension, then the separable closure of `F` in `E` is
equal to `F` if and only if `E / F` is purely inseparable. -/
theorem separableClosure.eq_bot_iff [Algebra.IsAlgebraic F E] :
    separableClosure F E = ⊥ ↔ IsPurelyInseparable F E

{F : Type u}
{E : Type v}
[Field F]
[Field E]
[Algebra F E]
[Algebra.IsAlgebraic F E]


theorem Sized.dual : ∀ {t : Ordnode α}, Sized t → Sized (dual t)


@[to_additive (attr := simp)]
lemma fiberEquiv_apply (f : α →* H) (a b : α) (g : f ⁻¹' {f a}) :
    f.fiberEquiv a b g = b * (a⁻¹ * g)

{α : Type u_1}
[AddGroup α]
{H : Type u_2}
[AddGroup H]
(f : α →+ H)
(a b : α)
(g : ↑(⇑f ⁻¹' {f a}))


/-- The symmetric version of Tonelli's Theorem: For `ℝ≥0∞`-valued measurable
functions on `α × β`, the integral of `f` is equal to the iterated integral, in reverse order. -/
theorem lintegral_prod_symm' [SFinite μ] (f : α × β → ℝ≥0∞) (hf : Measurable f) :
    ∫⁻ z, f z ∂μ.prod ν = ∫⁻ y, ∫⁻ x, f (x, y) ∂μ ∂ν

{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{ν : MeasureTheory.Measure β}
[MeasureTheory.SFinite ν]
[MeasureTheory.SFinite μ]
(f : α × β → ℝ≥0∞)
(hf : Measurable f)

∫⁻ (z : α × β), f z ∂μ.prod ν = ∫⁻ (y : β), ∫⁻ (x : α), f (x, y) ∂μ ∂ν


theorem gc_map_comap (m : α → β) : GaloisConnection (map m) (comap m)

GaloisConnection (Filter.map m) (Filter.comap m)


/-- Some ordinal approximation of the least fixed point is the least fixed point. -/
theorem lfp_mem_range_lfpApprox : lfp f ∈ Set.range (lfpApprox f ⊥)

{α : Type u}
[CompleteLattice α]
(f : α →o α)

OrderHom.lfp f ∈ Set.range (OrdinalApprox.lfpApprox f ⊥)


/-- See also `pow_left_strictMonoOn`. -/
protected lemma pow_left_strictMono (hn : n ≠ 0) : StrictMono (· ^ n : ℕ → ℕ)


/-- Roots of a quadratic equation. -/
theorem quadratic_eq_zero_iff (ha : a ≠ 0) {s : K} (h : discrim a b c = s * s) (x : K) :
    a * x * x + b * x + c = 0 ↔ x = (-b + s) / (2 * a) ∨ x = (-b - s) / (2 * a)

{K : Type u_1}
[Field K]
[NeZero 2]
{a b c : K}
(ha : a ≠ 0)
{s : K}
(h : discrim a b c = s * s)
(x : K)


theorem mersenne_int_ne_zero (p : ℕ) (hp : p ≠ 0) : (2 ^ p - 1 : ℤ) ≠ 0


theorem HasBasis.set_index_mem (h : l.HasBasis p s) (ht : t ∈ l) : s (h.index t ht) ∈ l

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


/-- A choice of isomorphism `T₁ ≅ T₂` between two distinguished triangles
when we are given two isomorphisms `e₁ : T₁.obj₁ ≅ T₂.obj₁` and `e₂ : T₁.obj₂ ≅ T₂.obj₂`. -/
@[simps! hom_hom₁ hom_hom₂ inv_hom₁ inv_hom₂]
def isoTriangleOfIso₁₂ (T₁ T₂ : Triangle C) (hT₁ : T₁ ∈ distTriang C)
    (hT₂ : T₂ ∈ distTriang C) (e₁ : T₁.obj₁ ≅ T₂.obj₁) (e₂ : T₁.obj₂ ≅ T₂.obj₂)
    (comm : T₁.mor₁ ≫ e₂.hom = e₁.hom ≫ T₂.mor₁) : T₁ ≅ T₂

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

(T₁ T₂ : CategoryTheory.Pretriangulated.Triangle C)

(hT₁ : T₁ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

(hT₂ : T₂ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

(CategoryTheory.Pretriangulated.isoTriangleOfIso₁₂ T₁ T₂ hT₁ hT₂ e₁ e₂ comm).inv.hom₂ = e₂.inv


theorem permutationsAux2_fst (t : α) (ts : List α) (r : List β) :
    ∀ (ys : List α) (f : List α → β), (permutationsAux2 t ts r ys f).1 = ys ++ ts

{α : Type u_1}
{β : Type u_2}
(t : α)
(ts : List α)
(r : List β)
(ys : List α)
(f : List α → β)

(List.permutationsAux2 t ts r ys f).1 = ys ++ ts


lemma _root_.MeasureTheory.NullMeasurableSet.prod {s : Set α} {t : Set β}
    (s_mble : NullMeasurableSet s μ) (t_mble : NullMeasurableSet t ν) :
    NullMeasurableSet (s ×ˢ t) (μ.prod ν)

(s_mble : MeasureTheory.NullMeasurableSet s μ)

(t_mble : MeasureTheory.NullMeasurableSet t ν)

MeasureTheory.NullMeasurableSet (s ×ˢ t) (μ.prod ν)


theorem eq_zero_of_inner_left (hK : Dense (K : Set E)) (h : ∀ v : K, ⟪x, v⟫ = 0) : x = 0

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{K : Submodule 𝕜 E}
{x : E}
(hK : Dense ↑K)
(h : ∀ (v : ↥K), ⟪x, ↑v⟫_𝕜 = 0)


@[simp]
theorem div_zero (a : Ordinal) : a / 0 = 0


/-- If a left-invariant measure gives finite mass to a nonempty open set, then it gives finite mass
to any compact set. -/
@[to_additive
"If a left-invariant measure gives finite mass to a nonempty open set, then it gives finite mass to
any compact set."]
theorem measure_lt_top_of_isCompact_of_isMulLeftInvariant (U : Set G) (hU : IsOpen U)
    (h'U : U.Nonempty) (h : μ U ≠ ∞) {K : Set G} (hK : IsCompact K) : μ K < ∞

{G : Type u_2}
[MeasurableSpace G]
[TopologicalSpace G]
[BorelSpace G]
{μ : MeasureTheory.Measure G}
[Group G]
[TopologicalGroup G]
[μ.IsMulLeftInvariant]
(U : Set G)
(hU : IsOpen U)
(h'U : U.Nonempty)
(h : μ U ≠ ⊤)
{K : Set G}
(hK : IsCompact K)


theorem digits_one_succ (n : ℕ) : digits 1 (n + 1) = 1 :: digits 1 n

Nat.digits 1 (n + 1) = 1 :: Nat.digits 1 n


theorem completeLat_dual_comp_forget_to_bddLat :
    CompleteLat.dual ⋙ forget₂ CompleteLat BddLat =
    forget₂ CompleteLat BddLat ⋙ BddLat.dual

CompleteLat.dual ⋙ CategoryTheory.forget₂ CompleteLat BddLat = CategoryTheory.forget₂ CompleteLat BddLat ⋙ BddLat.dual


/-- Converse of "angles in same segment are equal" and "opposite angles of a cyclic quadrilateral
add to π", for oriented angles mod π, with a "concyclic or collinear" conclusion. -/
theorem concyclic_or_collinear_of_two_zsmul_oangle_eq {p₁ p₂ p₃ p₄ : P}
    (h : (2 : ℤ) • ∡ p₁ p₂ p₄ = (2 : ℤ) • ∡ p₁ p₃ p₄) :
    Concyclic ({p₁, p₂, p₃, p₄} : Set P) ∨ Collinear ℝ ({p₁, p₂, p₃, p₄} : Set P)

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

EuclideanGeometry.Concyclic {p₁, p₂, p₃, p₄} ∨ Collinear ℝ {p₁, p₂, p₃, p₄}


@[measurability]
protected theorem MeasurableSet.compl : MeasurableSet s → MeasurableSet sᶜ

{α : Type u_1}
{s : Set α}
{m : MeasurableSpace α}


theorem of_measurable_inverse (hf₁ : Measurable f) (hf₂ : MeasurableSet (range f))
    (hg : Measurable g) (H : LeftInverse g f) : MeasurableEmbedding f

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
{f : α → β}
{g : β → α}
(hf₁ : Measurable f)
(hf₂ : MeasurableSet (Set.range f))
(hg : Measurable g)
(H : Function.LeftInverse g f)


theorem integral_norm_eq_lintegral_nnnorm {P : Type*} [NormedAddCommGroup P] {f : α → P}
    (hf : AEStronglyMeasurable f μ) : ∫ x, ‖f x‖ ∂μ = ENNReal.toReal (∫⁻ x, ‖f x‖₊ ∂μ)

(hf : MeasureTheory.AEStronglyMeasurable f μ)

∫ (x : α), ‖f x‖ ∂μ = (∫⁻ (x : α), ↑‖f x‖₊ ∂μ).toReal


theorem closure_eq_compl_interior_compl : closure s = (interior sᶜ)ᶜ

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


/-- The functor which flips commutative squares. -/
@[simps]
def flipFunctor : Square C ⥤ Square C

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

∀ {X Y : CategoryTheory.Square C} (φ : X ⟶ Y), (CategoryTheory.Square.flipFunctor.map φ).τ₃ = φ.τ₂


@[simp, mfld_simps]
theorem refl_trans : (PartialEquiv.refl α).trans e = e

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


@[simp]
theorem coe_of (X : Type u) [Fintype X] [TopologicalSpace X] :
    (of X : Type u) = X


/-- The elliptic curve over `R` induced by an admissible linear change of variables
$(X, Y) \mapsto (u^2X + r, u^3Y + u^2sX + t)$ for some $u \in R^\times$ and some $r, s, t \in R$.
When `R` is a field, any two Weierstrass equations isomorphic to `E` are related by this. -/
@[simps (config := { rhsMd := .default }) a₁ a₂ a₃ a₄ a₆ Δ' toWeierstrassCurve]
def variableChange : EllipticCurve R

{R : Type u}
[CommRing R]
(E : EllipticCurve R)
(C : WeierstrassCurve.VariableChange R)

(E.variableChange C).a₆ =
  ↑C.u⁻¹ ^ 6 * (E.a₆ + C.r * E.a₄ + C.r ^ 2 * E.a₂ + C.r ^ 3 - C.t * E.a₃ - C.t ^ 2 - C.r * C.t * E.a₁)


theorem surjective_π_app :
    Function.Surjective (π_app C J)

{ι : Type u}
{X : ι → Type}
[(i : ι) → TopologicalSpace (X i)]
(C : Set ((i : ι) → X i))
{J : ι → Prop}

Function.Surjective ⇑(Profinite.IndexFunctor.π_app C J)


/-- Analyticity on `s` implies analyticity within `s` -/
lemma AnalyticOn.analyticWithinOn {f : E → F} {s : Set E} (h : AnalyticOn 𝕜 f s) :
    AnalyticWithinOn 𝕜 f s

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
{F : Type u_4}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{s : Set E}
(h : AnalyticOn 𝕜 f s)


theorem coe_eq_algebraMap : (DoubleCentralizer.coe 𝕜 : 𝕜 → 𝓜(𝕜, 𝕜)) = algebraMap 𝕜 𝓜(𝕜, 𝕜)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]


theorem eq_one_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (hB : B < 0) (h1 : p.Monic)
    (h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) : p = 1

(h3 : ∀ z ∈ (Polynomial.map f p).roots, ‖z‖ ≤ B)


/-- A function has finite integral for the counting measure iff its norm is summable. -/
lemma hasFiniteIntegral_count_iff :
    HasFiniteIntegral f Measure.count ↔ Summable (‖f ·‖)

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
[NormedAddCommGroup β]
[MeasurableSingletonClass α]
{f : α → β}

MeasureTheory.HasFiniteIntegral f MeasureTheory.Measure.count ↔ Summable fun x => ‖f x‖


/-- A *non-unital ⋆-ring homomorphism* is a non-unital ring homomorphism between non-unital
non-associative semirings `A` and `B` equipped with a `star` operation, and this homomorphism is
also `star`-preserving. -/
structure NonUnitalStarRingHom (A B : Type*) [NonUnitalNonAssocSemiring A]
    [Star A] [NonUnitalNonAssocSemiring B] [Star B] extends A →ₙ+* B where
  /-- By definition, a non-unital ⋆-ring homomorphism preserves the `star` operation. -/
  map_star' : ∀ a : A, toFun (star a) = star (toFun a)

{A : Type u_1}
{B : Type u_2}
[NonUnitalNonAssocSemiring A]
[Star A]
[NonUnitalNonAssocSemiring B]
[Star B]
(self : A →⋆ₙ+* B)
(a : A)

self.toFun (star a) = star (self.toFun a)


@[simp]
theorem rfind_dom {p : ℕ →. Bool} :
    (rfind p).Dom ↔ ∃ n, true ∈ p n ∧ ∀ {m : ℕ}, m < n → (p m).Dom

(Nat.rfind p).Dom ↔ ∃ n, true ∈ p n ∧ ∀ {m : ℕ}, m < n → (p m).Dom


/-- If `f` tends to negative infinity along a nontrivial filter `l`,
then `fun x ↦ f x / r` tends to infinity if and only if `r < 0. `-/
lemma tendsto_div_const_atTop_iff_neg [NeBot l] (h : Tendsto f l atBot) :
    Tendsto (fun x ↦ f x / r) l atTop ↔ r < 0

{α : Type u_3}
{β : Type u_4}
[LinearOrderedField α]
{l : Filter β}
{f : β → α}
{r : α}
[l.NeBot]
(h : Filter.Tendsto f l Filter.atBot)

Filter.Tendsto (fun x => f x / r) l Filter.atTop ↔ r < 0


@[mono]
theorem trim_mono : Monotone (trim : OuterMeasure α → OuterMeasure α)


theorem Eventually.prod_inl {la : Filter α} {p : α → Prop} (h : ∀ᶠ x in la, p x) (lb : Filter β) :
    ∀ᶠ x in la ×ˢ lb, p (x : α × β).1

{α : Type u_1}
{β : Type u_2}
{la : Filter α}
{p : α → Prop}
(h : ∀ᶠ (x : α) in la, p x)
(lb : Filter β)


lemma shift_distinguished (n : ℤ) :
    (CategoryTheory.shiftFunctor (Triangle C) n).obj T ∈ distTriang C

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

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

(CategoryTheory.shiftFunctor (CategoryTheory.Pretriangulated.Triangle C) n).obj T ∈
  CategoryTheory.Pretriangulated.distinguishedTriangles


theorem bernoulliFun_eval_zero (k : ℕ) : bernoulliFun k 0 = bernoulli k


/-- An angle in a right-angled triangle expressed using `arctan`, where one side is a multiple
of a rotation of another by `π / 2`, version subtracting vectors. -/
theorem oangle_sub_right_smul_rotation_pi_div_two {x : V} (h : x ≠ 0) (r : ℝ) :
    o.oangle (r • o.rotation (π / 2 : ℝ) x) (r • o.rotation (π / 2 : ℝ) x - x)
      = Real.arctan r⁻¹

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

o.oangle (r • (o.rotation ↑(π / 2)) x) (r • (o.rotation ↑(π / 2)) x - x) = ↑(Real.arctan r⁻¹)


theorem bounds_nonempty [RingHomIsometric σ₁₂] {f : E →SL[σ₁₂] F} :
    ∃ c, c ∈ { c | 0 ≤ c ∧ ∀ x, ‖f x‖ ≤ c * ‖x‖ }

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

∃ c, c ∈ {c | 0 ≤ c ∧ ∀ (x : E), ‖f x‖ ≤ c * ‖x‖}


@[simp]
theorem smeval_add : (p + q).smeval x = p.smeval x + q.smeval x

(R : Type u_1)
[Semiring R]
(p q : Polynomial R)
{S : Type u_2}
[AddCommMonoid S]
[Pow S ℕ]
[Module R S]
(x : S)


theorem pow_eq {κ μ : Cardinal.{u}} (H1 : ℵ₀ ≤ κ) (H2 : 1 ≤ μ) (H3 : μ < ℵ₀) : κ ^ μ = κ


theorem gcd_mul_dvd_mul_gcd (k m n : Nat) : gcd k (m * n) ∣ gcd k m * gcd k n


/-- A common factor that's coprime with the modulus can be cancelled from a `ModEq` -/
lemma cancel_right_of_coprime (hmc : gcd m c = 1) (h : a * c ≡ b * c [MOD m]) : a ≡ b [MOD m]

{m a b c : ℕ}
(hmc : m.gcd c = 1)
(h : a * c ≡ b * c [MOD m])


theorem continuousWithinAt_dslope_of_ne (h : b ≠ a) :
    ContinuousWithinAt (dslope f a) s b ↔ ContinuousWithinAt f s b

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


@[simp]
lemma bodd_succ (n : ℕ) : bodd (succ n) = not (bodd n)


lemma isOpen_iff_isLowerSet : IsOpen s ↔ IsLowerSet s

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


@[congr]
theorem fold_congr {g : α → β} (H : ∀ x ∈ s, f x = g x) : s.fold op b f = s.fold op b g

{α : Type u_1}
{β : Type u_2}
{op : β → β → β}
[hc : Std.Commutative op]
[ha : Std.Associative op]
{f : α → β}
{b : β}
{s : Finset α}
{g : α → β}
(H : ∀ x ∈ s, f x = g x)

Finset.fold op b f s = Finset.fold op b g s


@[simp]
theorem mem_toConvexCone {x : E} {S : Submodule 𝕜 E} : x ∈ S.toConvexCone ↔ x ∈ S

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{x : E}
{S : Submodule 𝕜 E}


theorem out_snd_mem (e : Sym2 α) : e.out.2 ∈ e


/-- In a weakly locally compact space,
every compact set is contained in the interior of a compact set. -/
theorem exists_compact_superset [WeaklyLocallyCompactSpace X] {K : Set X} (hK : IsCompact K) :
    ∃ K', IsCompact K' ∧ K ⊆ interior K'

{X : Type u_1}
[TopologicalSpace X]
[WeaklyLocallyCompactSpace X]
{K : Set X}
(hK : IsCompact K)


theorem cokernel.π_op :
    (cokernel.π f.op).unop =
      (cokernelOpUnop f).hom ≫ kernel.ι f ≫ eqToHom (Opposite.unop_op _).symm

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Abelian C]
{X Y : C}
(f : X ⟶ Y)

(CategoryTheory.Limits.cokernel.π f.op).unop =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.cokernelOpUnop f).hom
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.kernel.ι f) (CategoryTheory.eqToHom ⋯))


/-- A nontrivial monoid has prime exponent `p` if and only if every non-identity element has
order `p`. -/
@[to_additive]
lemma exponent_eq_prime_iff {G : Type*} [Monoid G] [Nontrivial G] {p : ℕ} (hp : p.Prime) :
    Monoid.exponent G = p ↔ ∀ g : G, g ≠ 1 → orderOf g = p

{G : Type u_1}
[AddMonoid G]
[Nontrivial G]
{p : ℕ}
(hp : Nat.Prime p)

AddMonoid.exponent G = p ↔ ∀ (g : G), g ≠ 0 → addOrderOf g = p


theorem torusIntegral_smul {𝕜 : Type*} [RCLike 𝕜] [NormedSpace 𝕜 E] [SMulCommClass 𝕜 ℂ E] (a : 𝕜)
    (f : ℂⁿ → E) (c : ℂⁿ) (R : ℝⁿ) : (∯ x in T(c, R), a • f x) = a • ∯ x in T(c, R), f x

{n : ℕ}
{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{𝕜 : Type u_2}
[RCLike 𝕜]
[NormedSpace 𝕜 E]
[SMulCommClass 𝕜 ℂ E]
(a : 𝕜)
(f : (Fin n → ℂ) → E)
(c : Fin n → ℂ)
(R : Fin n → ℝ)

(∯ (x : Fin n → ℂ) in T(c, R), a • f x) = a • ∯ (x : Fin n → ℂ) in T(c, R), f x


theorem le_def : s ≤ t ↔ t.fst ≤ s.fst ∧ s.snd ≤ t.snd

{α : Type u_1}
[LE α]
{s t : NonemptyInterval α}

s ≤ t ↔ t.toProd.1 ≤ s.toProd.1 ∧ s.toProd.2 ≤ t.toProd.2


@[simp]
theorem coe_infNndist : (infNndist x s : ℝ) = infDist x s

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
{x : α}

↑(Metric.infNndist x s) = Metric.infDist x s


/-- If `E / L / F` and `E / L' / F` are two ring extension towers, `L ≃ₐ[F] L'` is an isomorphism
compatible with `E / L` and `E / L'`, then for any subset `S` of `E`, `L[S]` and `L'[S]` are
equal as subalgebras of `E / F`. -/
theorem Algebra.restrictScalars_adjoin_of_algEquiv
    {F E L L' : Type*} [CommSemiring F] [CommSemiring L] [CommSemiring L'] [Semiring E]
    [Algebra F L] [Algebra L E] [Algebra F L'] [Algebra L' E] [Algebra F E]
    [IsScalarTower F L E] [IsScalarTower F L' E] (i : L ≃ₐ[F] L')
    (hi : algebraMap L E = (algebraMap L' E) ∘ i) (S : Set E) :
    (Algebra.adjoin L S).restrictScalars F = (Algebra.adjoin L' S).restrictScalars F

(hi : ⇑(algebraMap L E) = ⇑(algebraMap L' E) ∘ ⇑i)

Subalgebra.restrictScalars F (Algebra.adjoin L S) = Subalgebra.restrictScalars F (Algebra.adjoin L' S)


@[reassoc, elementwise (attr := simp)]
theorem t_inv (i j : D.J) : D.t i j ≫ D.t j i = 𝟙 _

{C : Type u₁}
[CategoryTheory.Category.{v, u₁} C]
(D : CategoryTheory.GlueData C)
(i j : D.J)

CategoryTheory.CategoryStruct.comp (D.t i j) (D.t j i) = CategoryTheory.CategoryStruct.id (D.V (i, j))


theorem has_union {s₁ s₂ : Set α} (h₁ : d.Has s₁) (h₂ : d.Has s₂) (h : Disjoint s₁ s₂) :
    d.Has (s₁ ∪ s₂)

{α : Type u_1}
(d : MeasurableSpace.DynkinSystem α)
{s₁ s₂ : Set α}
(h₁ : d.Has s₁)
(h₂ : d.Has s₂)
(h : Disjoint s₁ s₂)


theorem ContDiffOn.cexp {n} (hf : ContDiffOn 𝕜 n f s) :
    ContDiffOn 𝕜 n (fun x => Complex.exp (f x)) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[NormedAlgebra 𝕜 ℂ]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : E → ℂ}
{s : Set E}
{n : ℕ∞}
(hf : ContDiffOn 𝕜 n f s)


lemma cfc_const_mul (r : R) (f : R → R) (a : A)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) :
    cfc (fun x ↦ r * f x) a = r • cfc f a


@[simp]
theorem mk_le_aleph0 [Countable α] : #α ≤ ℵ₀


theorem tendsto_const_mul_zpow_atTop_nhds_iff {n : ℤ} {c d : 𝕜} (hc : c ≠ 0) :
    Tendsto (fun x : 𝕜 => c * x ^ n) atTop (𝓝 d) ↔ n = 0 ∧ c = d ∨ n < 0 ∧ d = 0

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
{n : ℤ}
{c d : 𝕜}
(hc : c ≠ 0)

Filter.Tendsto (fun x => c * x ^ n) Filter.atTop (𝓝 d) ↔ n = 0 ∧ c = d ∨ n < 0 ∧ d = 0


@[simp]
theorem length_zero : (0 : Interval α).length = 0


@[to_additive]
lemma smul_left_cancel {a : α} (ha : IsUnit a) {x y : β} : a • x = a • y ↔ x = y

{α : Type u_1}
{β : Type u_2}
[AddMonoid α]
[AddAction α β]
{a : α}
(ha : IsAddUnit a)
{x y : β}


theorem fin_one_eq_zero (a : Fin 1) : a = 0


@[simp]
theorem bot_eq : (⊥ : PUnit) = unit


@[simp]
theorem insert_eq_of_mem {a : α} {s : Set α} (h : a ∈ s) : insert a s = s

{α : Type u}
{a : α}
{s : Set α}
(h : a ∈ s)


@[simp]
lemma toMul_eq_one {α : Type*} [One α] {x : Additive α} :
    Additive.toMul x = 1 ↔ x = 0


theorem degree_eq_one_iff : (minpoly A x).degree = 1 ↔ x ∈ (algebraMap A B).range

{A : Type u_1}
{B : Type u_2}
[CommRing A]
[Ring B]
[Algebra A B]
{x : B}
[Nontrivial B]


protected theorem IsAntichain.isWeakAntichain (hs : IsAntichain (· ≤ ·) s) : IsWeakAntichain s

(hs : IsAntichain (fun x x_1 => x ≤ x_1) s)


@[to_additive]
theorem image_mulSingle_Icc_right (i : ι) (b : α i) :
    Pi.mulSingle i '' Icc 1 b = Icc 1 (Pi.mulSingle i b)

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

Pi.single i '' Set.Icc 0 b = Set.Icc 0 (Pi.single i b)


theorem limit.existsUnique {F : J ⥤ C} [HasLimit F] (t : Cone F) :
    ∃! l : t.pt ⟶ limit F, ∀ j, l ≫ limit.π F j = t.π.app j

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{F : J ⥤ C}
[CategoryTheory.Limits.HasLimit F]
(t : CategoryTheory.Limits.Cone F)

∃! l, ∀ (j : J), l ≫ CategoryTheory.Limits.limit.π F j = t.π.app j


protected theorem Tendsto.if' {α β : Type*} {l₁ : Filter α} {l₂ : Filter β} {f g : α → β}
    {p : α → Prop} [DecidablePred p] (hf : Tendsto f l₁ l₂) (hg : Tendsto g l₁ l₂) :
    Tendsto (fun a => if p a then f a else g a) l₁ l₂

{α : Type u_2}
{β : Type u_3}
{l₁ : Filter α}
{l₂ : Filter β}
{f g : α → β}
{p : α → Prop}
[DecidablePred p]
(hf : Filter.Tendsto f l₁ l₂)
(hg : Filter.Tendsto g l₁ l₂)

Filter.Tendsto (fun a => if p a then f a else g a) l₁ l₂


lemma equiv_iff_eq_of_Z_eq [NoZeroDivisors R] {P Q : Fin 3 → R} (hz : P z = Q z) (hQz : Q z ≠ 0) :
    P ≈ Q ↔ P = Q

{R : Type u}
[CommRing R]
[NoZeroDivisors R]
{P Q : Fin 3 → R}
(hz : P z = Q z)
(hQz : Q z ≠ 0)


@[simp]
theorem wittOne_zero_eq_one : wittOne p 0 = 1


theorem isCauSeq_conj (f : CauSeq ℂ Complex.abs) :
    IsCauSeq Complex.abs fun n => conj (f n)

IsCauSeq ⇑Complex.abs fun n => (starRingEnd ℂ) (↑f n)


@[reassoc]
lemma FunctorObjIndex.comm (x : FunctorObjIndex f πX) :
    f x.i ≫ Sigma.ι (functorObjTgtFamily f πX) x ≫ ρFunctorObj f πX = x.t ≫ ιFunctorObj f πX

[CategoryTheory.Limits.HasColimitsOfShape (CategoryTheory.Discrete (CategoryTheory.SmallObject.FunctorObjIndex f πX)) C]

[CategoryTheory.Limits.HasPushout (CategoryTheory.SmallObject.functorObjTop f πX)
    (CategoryTheory.SmallObject.functorObjLeft f πX)]

(x : CategoryTheory.SmallObject.FunctorObjIndex f πX)

CategoryTheory.CategoryStruct.comp (f x.i)
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.Limits.Sigma.ι (CategoryTheory.SmallObject.functorObjTgtFamily f πX) x)
      (CategoryTheory.SmallObject.ρFunctorObj f πX)) =
  CategoryTheory.CategoryStruct.comp x.t (CategoryTheory.SmallObject.ιFunctorObj f πX)


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

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


nonrec theorem ContMDiffAt.clm_apply {g : M → F₁ →L[𝕜] F₂} {f : M → F₁} {x : M}
    (hg : ContMDiffAt I 𝓘(𝕜, F₁ →L[𝕜] F₂) n g x) (hf : ContMDiffAt I 𝓘(𝕜, F₁) n f x) :
    ContMDiffAt I 𝓘(𝕜, F₂) n (fun x => g x (f x)) x

ContMDiffAt I 𝓘(𝕜, F₂) n (fun x => (g x) (f x)) x


theorem Function.Injective.sigma_map {f₁ : α₁ → α₂} {f₂ : ∀ a, β₁ a → β₂ (f₁ a)}
    (h₁ : Injective f₁) (h₂ : ∀ a, Injective (f₂ a)) : Injective (Sigma.map f₁ f₂)

{f₁ : α₁ → α₂}

(h₂ : ∀ (a : α₁), Function.Injective (f₂ a))


/-- The **Schwarz Lemma**: if `f : ℂ → E` sends an open disk with center `c` and a positive radius
`R₁` to an open ball with center `f c` and radius `R₂`, then the absolute value of the derivative of
`f` at `c` is at most the ratio `R₂ / R₁`. -/
theorem norm_deriv_le_div_of_mapsTo_ball (hd : DifferentiableOn ℂ f (ball c R₁))
    (h_maps : MapsTo f (ball c R₁) (ball (f c) R₂)) (h₀ : 0 < R₁) : ‖deriv f c‖ ≤ R₂ / R₁

(hd : DifferentiableOn ℂ f (Metric.ball c R₁))

(h_maps : Set.MapsTo f (Metric.ball c R₁) (Metric.ball (f c) R₂))


lemma quotientEquivQuotientMvPolynomial_leftInverse (I : Ideal R) :
    Function.LeftInverse
      (eval₂ (Ideal.Quotient.lift I
        ((Ideal.Quotient.mk (Ideal.map C I : Ideal (MvPolynomial σ R))).comp C)
          fun i hi => quotient_map_C_eq_zero hi)
          fun i => Ideal.Quotient.mk (Ideal.map C I : Ideal (MvPolynomial σ R)) (X i))
      (Ideal.Quotient.lift (Ideal.map C I : Ideal (MvPolynomial σ R))
        (eval₂Hom (C.comp (Ideal.Quotient.mk I)) X) fun a ha => eval₂_C_mk_eq_zero ha)

{R : Type u_1}
{σ : Type u_2}
[CommRing R]
(I : Ideal R)

Function.LeftInverse
  (MvPolynomial.eval₂ (Ideal.Quotient.lift I ((Ideal.Quotient.mk (Ideal.map MvPolynomial.C I)).comp MvPolynomial.C) ⋯)
    fun i => (Ideal.Quotient.mk (Ideal.map MvPolynomial.C I)) (MvPolynomial.X i))
  ⇑(Ideal.Quotient.lift (Ideal.map MvPolynomial.C I)
      (MvPolynomial.eval₂Hom (MvPolynomial.C.comp (Ideal.Quotient.mk I)) MvPolynomial.X) ⋯)


@[simp]
theorem circleIntegrable_zero_radius {f : ℂ → E} {c : ℂ} : CircleIntegrable f c 0

{E : Type u_1}
[NormedAddCommGroup E]
{f : ℂ → E}
{c : ℂ}


/-- The functor `Sigma.map` applied to a composition is a composition of functors. -/
@[simps!]
def mapComp (f : K → J) (g : J → I) : map (fun x ↦ C (g x)) f ⋙ (map C g : _) ≅ map C (g ∘ f)

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

(CategoryTheory.Sigma.mapComp C f g).inv.app X = CategoryTheory.CategoryStruct.id ⟨g (f X.fst), X.snd⟩


@[to_additive IsAddUnit.exists_neg]
lemma IsUnit.exists_right_inv (h : IsUnit a) : ∃ b, a * b = 1

{M : Type u_1}
[AddMonoid M]
{a : M}
(h : IsAddUnit a)


theorem cmpLT_iff [TransCmp cmp] : cmpLT cmp x y ↔ cmp x y = .lt

∀ {α : Sort u_1} {cmp : α → α → Ordering} {x y : α} [inst : Batteries.TransCmp cmp],
  Batteries.RBNode.cmpLT cmp x y ↔ cmp x y = Ordering.lt


theorem erase_eq (s : Finset α) (a : α) : s.erase a = s \ {a}

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


theorem Sized.node4L {l x m y r} (hl : @Sized α l) (hm : Sized m) (hr : Sized r) :
    Sized (node4L l x m y r)

{α : Type u_1}
{l : Ordnode α}
{x : α}
{m : Ordnode α}
{y : α}
{r : Ordnode α}
(hl : l.Sized)
(hm : m.Sized)
(hr : r.Sized)


lemma small_of_hasSmallLocalizedHom [HasSmallLocalizedHom.{w} W X Y] :
    Small.{w} (L.obj X ⟶ L.obj Y)

[CategoryTheory.Localization.HasSmallLocalizedHom W X Y]


@[simp]
theorem algebra_equiv_of_iso_monads_comp_forget {T₁ T₂ : Monad C} (h : T₁ ⟶ T₂) :
    algebraFunctorOfMonadHom h ⋙ forget _ = forget _

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

(CategoryTheory.Monad.algebraFunctorOfMonadHom h).comp T₁.forget = T₂.forget


theorem leftInverse_l_u [Preorder α] [PartialOrder β] (gi : GaloisInsertion l u) :
    LeftInverse l u

{α : Type u}
{β : Type v}
{l : α → β}
{u : β → α}
[Preorder α]
[PartialOrder β]
(gi : GaloisInsertion l u)


@[simp]
theorem repeat_zero {α : Type*} (a : Fin n → α) :
    Fin.repeat 0 a = Fin.elim0 ∘ cast (Nat.zero_mul _)


@[simp]
theorem idempotent (x : α) : c (c x) = c x

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


@[simp]
theorem mem_ptsOfPeriod : x ∈ ptsOfPeriod f n ↔ IsPeriodicPt f n x

{α : Type u_1}
{f : α → α}
{x : α}
{n : ℕ}

x ∈ Function.ptsOfPeriod f n ↔ Function.IsPeriodicPt f n x


@[to_additive]
lemma norm_div_le_norm_div_add_norm_div (a b c : E) : ‖a / c‖ ≤ ‖a / b‖ + ‖b / c‖

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


@[simp] lemma le_greatestFib : m ≤ greatestFib n ↔ fib m ≤ n


/-- A seminorm is continuous if `p.ball 0 r ∈ 𝓝 0` for *all* `r > 0`.
Over a `NontriviallyNormedField` it is actually enough to check that this is true
for *some* `r`, see `Seminorm.continuous`. -/
protected theorem continuous_of_forall [TopologicalSpace E] [TopologicalAddGroup E]
    {p : Seminorm 𝕝 E} (hp : ∀ r > 0, p.ball 0 r ∈ (𝓝 0 : Filter E)) :
    Continuous p

{𝕝 : Type u_6}
{E : Type u_7}
[SeminormedRing 𝕝]
[AddCommGroup E]
[Module 𝕝 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
{p : Seminorm 𝕝 E}
(hp : ∀ r > 0, p.ball 0 r ∈ 𝓝 0)


@[simp]
theorem card_Ioc : (Ioc a b).card = b - a


lemma iIndepSets_iff (π : ι → Set (Set Ω)) (μ : Measure Ω) :
    iIndepSets π μ ↔ ∀ (s : Finset ι) {f : ι → Set Ω} (_H : ∀ i, i ∈ s → f i ∈ π i),
      μ (⋂ i ∈ s, f i) = ∏ i ∈ s, μ (f i)

∀ {x : MeasurableSpace Ω} (π : ι → Set (Set Ω)) (μ : MeasureTheory.Measure Ω),
  ProbabilityTheory.iIndepSets π μ ↔
    ∀ (s : Finset ι) {f : ι → Set Ω}, (∀ i ∈ s, f i ∈ π i) → μ (⋂ i ∈ s, f i) = ∏ i ∈ s, μ (f i)


theorem ContDiffOn.sqrt (hf : ContDiffOn ℝ n f s) (hs : ∀ x ∈ s, f x ≠ 0) :
    ContDiffOn ℝ n (fun y => √(f y)) s

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{n : ℕ∞}
{s : Set E}
(hf : ContDiffOn ℝ n f s)
(hs : ∀ x ∈ s, f x ≠ 0)


/-- Implementation of `ShrinkHoms.equivalence`. -/
@[simps]
noncomputable def functor : C ⥤ ShrinkHoms C

[CategoryTheory.LocallySmall.{w, v, u} C]

(CategoryTheory.ShrinkHoms.functor C).map f = (equivShrink (X ⟶ Y)) f


@[reassoc (attr := simp)]
lemma map_hom_inv_id_eval (e : X ≅ Y) (F : C ⥤ D) (j : J) :
    F.map (e.hom j) ≫ F.map (e.inv j) = 𝟙 _

{C : Type u_1}
{D : Type u_2}
{J : Type u_4}
[CategoryTheory.Category.{u_5, u_1} C]
[CategoryTheory.Category.{u_6, u_2} D]
{X Y : CategoryTheory.GradedObject J C}
(e : X ≅ Y)
(F : CategoryTheory.Functor C D)
(j : J)

CategoryTheory.CategoryStruct.comp (F.map (e.hom j)) (F.map (e.inv j)) = CategoryTheory.CategoryStruct.id (F.obj (X j))


@[simp]
theorem rightDual_leftDual {X : C} [HasLeftDual X] : (ᘁX)ᘁ = X

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


@[simp]
theorem toSubtype'_of_subtype' {α : TypeVec n} (r : α ⊗ α ⟹ «repeat» n Prop) :
    toSubtype' r ⊚ ofSubtype' r = id

(r : (α.prod α).Arrow (TypeVec.repeat n Prop))

TypeVec.comp (TypeVec.toSubtype' r) (TypeVec.ofSubtype' r) = TypeVec.id


lemma iInf_ringCon {ι : Type*} (I : ι → TwoSidedIdeal R) :
    (⨅ i, I i).ringCon = ⨅ i, (I i).ringCon

(R : Type u_1)
[NonUnitalNonAssocRing R]
{ι : Type u_2}
(I : ι → TwoSidedIdeal R)


@[simp]
theorem sqFrom_comp (f : C₁ ⟶ C₂) (g : C₂ ⟶ C₃) (i : ι) :
    sqFrom (f ≫ g) i = sqFrom f i ≫ sqFrom g i

HomologicalComplex.Hom.sqFrom (f ≫ g) i = HomologicalComplex.Hom.sqFrom f i ≫ HomologicalComplex.Hom.sqFrom g i


lemma rightHomologyMap_eq [S₁.HasRightHomology] [S₂.HasRightHomology] :
    rightHomologyMap φ = h₁.rightHomologyIso.hom ≫ γ.φH ≫ h₂.rightHomologyIso.inv

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

CategoryTheory.ShortComplex.rightHomologyMap φ =
  CategoryTheory.CategoryStruct.comp h₁.rightHomologyIso.hom
    (CategoryTheory.CategoryStruct.comp γ.φH h₂.rightHomologyIso.inv)


theorem HasDerivAtFilter.comp_hasFDerivAtFilter_of_eq
    {f : E → 𝕜'} {f' : E →L[𝕜] 𝕜'} (x) {L'' : Filter E}
    (hh₂ : HasDerivAtFilter h₂ h₂' y L') (hf : HasFDerivAtFilter f f' x L'')
    (hL : Tendsto f L'' L') (hy : y = f x) : HasFDerivAtFilter (h₂ ∘ f) (h₂' • f') x L''

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type w}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{𝕜' : Type u_1}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{h₂ : 𝕜' → 𝕜'}
{h₂' : 𝕜'}
{L' : Filter 𝕜'}
{y : 𝕜'}
{f : E → 𝕜'}
{f' : E →L[𝕜] 𝕜'}
(x : E)
{L'' : Filter E}
(hh₂ : HasDerivAtFilter h₂ h₂' y L')
(hf : HasFDerivAtFilter f f' x L'')
(hL : Filter.Tendsto f L'' L')
(hy : y = f x)


theorem map₂_map_right (m : α → γ → δ) (n : β → γ) :
    map₂ m f (g.map n) = map₂ (fun a b => m a (n b)) f g

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{δ : Type u_7}
{f : Filter α}
{g : Filter β}
(m : α → γ → δ)
(n : β → γ)

Filter.map₂ m f (Filter.map n g) = Filter.map₂ (fun a b => m a (n b)) f g


@[simps]
instance whiskerLeft (f : a ⟶ b) (g h : b ⟶ c)
    [BicategoricalCoherence g h] : BicategoricalCoherence (f ≫ g) (f ≫ h)


theorem indepSets_piiUnionInter_of_disjoint [IsMarkovKernel κ] {s : ι → Set (Set Ω)}
    {S T : Set ι} (h_indep : iIndepSets s κ μ) (hST : Disjoint S T) :
    IndepSets (piiUnionInter s S) (piiUnionInter s T) κ μ

(h_indep : ProbabilityTheory.Kernel.iIndepSets s κ μ)

ProbabilityTheory.Kernel.IndepSets (piiUnionInter s S) (piiUnionInter s T) κ μ


@[simp]
theorem next_nat_zero : (ComplexShape.down ℕ).next 0 = 0


theorem StrongEpi.of_arrow_iso {A B A' B' : C} {f : A ⟶ B} {g : A' ⟶ B'}
    (e : Arrow.mk f ≅ Arrow.mk g) [h : StrongEpi f] : StrongEpi g

(e : CategoryTheory.Arrow.mk f ≅ CategoryTheory.Arrow.mk g)


/-- For any extended real number `x` which is not `⊥`, the sum of `x` and `⊤` is equal to `⊤`. -/
@[simp]
theorem add_top_of_ne_bot {x : EReal} (h : x ≠ ⊥) : x + ⊤ = ⊤


lemma mkPrecomp_comp (f : S.obj Y ⟶ T) (g : Y' ⟶ Y) (g' : Y'' ⟶ Y') :
    mkPrecomp f (g' ≫ g) = eqToHom (by simp) ≫ mkPrecomp (S.map g ≫ f) g' ≫ mkPrecomp f g

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{T : D}
{Y Y' Y'' : C}
{S : CategoryTheory.Functor C D}
(f : S.obj Y ⟶ T)
(g : Y' ⟶ Y)
(g' : Y'' ⟶ Y')

CategoryTheory.CostructuredArrow.mkPrecomp f (CategoryTheory.CategoryStruct.comp g' g) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom ⋯)
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.CostructuredArrow.mkPrecomp (CategoryTheory.CategoryStruct.comp (S.map g) f) g')
      (CategoryTheory.CostructuredArrow.mkPrecomp f g))


@[simp]
theorem count_eq_zero_iff [MeasurableSingletonClass α] : count s = 0 ↔ s = ∅

{α : Type u_1}
[MeasurableSpace α]
{s : Set α}
[MeasurableSingletonClass α]

MeasureTheory.Measure.count s = 0 ↔ s = ∅


theorem Exists.snd {b : Prop} {p : b → Prop} : ∀ h : Exists p, p h.fst

{b : Prop}
{p : b → Prop}
(h : Exists p)


/-- Given two perfectly-paired `R`-modules `M` and `N`, a root pairing with indexing set `ι`
is the data of an `ι`-indexed subset of `M` ("the roots"), an `ι`-indexed subset of `N`
("the coroots"), and an `ι`-indexed set of permutations of `ι`, such that each root-coroot pair
evaluates to `2`, and the permutation attached to each element of `ι` is compatible with the
reflections on the corresponding roots and coroots.

It exists to allow for a convenient unification of the theories of root systems and root data. -/
structure RootPairing extends PerfectPairing R M N :=
  /-- A parametrized family of vectors, called roots. -/
  root : ι ↪ M
  /-- A parametrized family of dual vectors, called coroots. -/
  coroot : ι ↪ N
  root_coroot_two : ∀ i, toLin (root i) (coroot i) = 2
  /-- A parametrized family of permutations, induced by reflection. -/
  reflection_perm : ι → (ι ≃ ι)
  reflection_perm_root : ∀ i j,
    root j - toLin (root j) (coroot i) • root i = root (reflection_perm i j)
  reflection_perm_coroot : ∀ i j,
    coroot j - toLin (root i) (coroot j) • coroot i = coroot (reflection_perm i j)

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

self.root j - (self.toLin (self.root j)) (self.coroot i) • self.root i = self.root ((self.reflection_perm i) j)


@[simp]
lemma mem_functorPushforward_functor {Y : D} {S : Sieve X} {e : C ≌ D} {f : Y ⟶ e.functor.obj X} :
    S.functorPushforward e.functor f ↔ S (e.inverse.map f ≫ e.unitInv.app X)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{X : C}
{Y : D}
{S : CategoryTheory.Sieve X}
{e : C ≌ D}
{f : Y ⟶ e.functor.obj X}

(CategoryTheory.Sieve.functorPushforward e.functor S).arrows f ↔
  S.arrows (CategoryTheory.CategoryStruct.comp (e.inverse.map f) (e.unitInv.app X))


theorem iCondIndepSet_iff_iCondIndepSets_singleton (s : ι → Set Ω) (hs : ∀ i, MeasurableSet (s i))
    (μ : Measure Ω) [IsFiniteMeasure μ] :
    iCondIndepSet m' hm' s μ ↔ iCondIndepSets m' hm' (fun i ↦ {s i}) μ

{Ω : Type u_1}
{ι : Type u_2}
(m' : MeasurableSpace Ω)
{mΩ : MeasurableSpace Ω}
[StandardBorelSpace Ω]
[Nonempty Ω]
(hm' : m' ≤ mΩ)
(s : ι → Set Ω)
(hs : ∀ (i : ι), MeasurableSet (s i))
(μ : MeasureTheory.Measure Ω)
[MeasureTheory.IsFiniteMeasure μ]

ProbabilityTheory.iCondIndepSet m' hm' s μ ↔ ProbabilityTheory.iCondIndepSets m' hm' (fun i => {s i}) μ


theorem StrictAnti.prod_map (hf : StrictAnti f) (hg : StrictAnti g) : StrictAnti (Prod.map f g)

{α : Type u}
{β : Type v}
{γ : Type w}
{δ : Type u_2}
[PartialOrder α]
[PartialOrder β]
[Preorder γ]
[Preorder δ]
{f : α → γ}
{g : β → δ}
(hf : StrictAnti f)
(hg : StrictAnti g)


@[to_additive]
lemma orbitRel.quotient_eq_of_quotient_subgroup_eq {H : Subgroup G} {a b : α}
    (h : (⟦a⟧ : orbitRel.Quotient H α) = ⟦b⟧) : (⟦a⟧ : orbitRel.Quotient G α) = ⟦b⟧

{G : Type u_1}
{α : Type u_2}
[Group G]
[MulAction G α]
{H : Subgroup G}
{a b : α}
(h : ⟦a⟧ = ⟦b⟧)


@[to_additive (attr := simp)] lemma unop_one [One α] : unop (1 : αᵐᵒᵖ) = 1


/-- The covering map from `ℝ` to the "unit additive circle" `ℝ ⧸ ℤ` is measure-preserving,
considered with respect to the standard measure (defined to be the Haar measure of total mass 1)
on the additive circle, and with respect to the restriction of Lebsegue measure on `ℝ` to an
interval (t, t + 1]. -/
protected theorem measurePreserving_mk (t : ℝ) :
    MeasurePreserving (β := UnitAddCircle) ((↑) : ℝ → UnitAddCircle)
      (volume.restrict (Ioc t (t + 1)))

MeasureTheory.MeasurePreserving QuotientAddGroup.mk (MeasureTheory.volume.restrict (Set.Ioc t (t + 1)))
  MeasureTheory.volume


theorem ncard_pos (hs : s.Finite := by toFinite_tac) : 0 < s.ncard ↔ s.Nonempty

{α : Type u_1}
{s : Set α}
(hs : s.Finite := by toFinite_tac)


/-- An induction principle for closure membership, for predicates with two arguments. -/
@[elab_as_elim]
theorem closure_induction₂ {s : Set R} {p : R → R → Prop} {a b : R} (ha : a ∈ closure s)
    (hb : b ∈ closure s) (Hs : ∀ x ∈ s, ∀ y ∈ s, p x y) (H0_left : ∀ x, p 0 x)
    (H0_right : ∀ x, p x 0) (Hneg_left : ∀ x y, p x y → p (-x) y)
    (Hneg_right : ∀ x y, p x y → p x (-y)) (Hadd_left : ∀ x₁ x₂ y, p x₁ y → p x₂ y → p (x₁ + x₂) y)
    (Hadd_right : ∀ x y₁ y₂, p x y₁ → p x y₂ → p x (y₁ + y₂))
    (Hmul_left : ∀ x₁ x₂ y, p x₁ y → p x₂ y → p (x₁ * x₂) y)
    (Hmul_right : ∀ x y₁ y₂, p x y₁ → p x y₂ → p x (y₁ * y₂)) : p a b

(Hneg_left : ∀ (x y : R), p x y → p (-x) y)

(Hneg_right : ∀ (x y : R), p x y → p x (-y))

(Hadd_left : ∀ (x₁ x₂ y : R), p x₁ y → p x₂ y → p (x₁ + x₂) y)

(Hadd_right : ∀ (x y₁ y₂ : R), p x y₁ → p x y₂ → p x (y₁ + y₂))

(Hmul_left : ∀ (x₁ x₂ y : R), p x₁ y → p x₂ y → p (x₁ * x₂) y)

(Hmul_right : ∀ (x y₁ y₂ : R), p x y₁ → p x y₂ → p x (y₁ * y₂))


lemma InvOn.prodMap (h₁ : InvOn g₁ f₁ s₁ t₁) (h₂ : InvOn g₂ f₂ s₂ t₂) :
    InvOn (fun x ↦ (g₁ x.1, g₂ x.2)) (fun x ↦ (f₁ x.1, f₂ x.2)) (s₁ ×ˢ s₂) (t₁ ×ˢ t₂)

{α₁ : Type u_6}
{α₂ : Type u_7}
{β₁ : Type u_8}
{β₂ : Type u_9}
{s₁ : Set α₁}
{s₂ : Set α₂}
{t₁ : Set β₁}
{t₂ : Set β₂}
{f₁ : α₁ → β₁}
{f₂ : α₂ → β₂}
{g₁ : β₁ → α₁}
{g₂ : β₂ → α₂}
(h₁ : Set.InvOn g₁ f₁ s₁ t₁)
(h₂ : Set.InvOn g₂ f₂ s₂ t₂)

Set.InvOn (fun x => (g₁ x.1, g₂ x.2)) (fun x => (f₁ x.1, f₂ x.2)) (s₁ ×ˢ s₂) (t₁ ×ˢ t₂)


lemma coe_apply (l : Subspace η α ι) (x : η → α) (i : ι) : l x i = (l.idxFun i).elim id x

{η : Type u_5}
{α : Type u_6}
{ι : Type u_7}
(l : Combinatorics.Subspace η α ι)
(x : η → α)
(i : ι)


@[simp] lemma div_intCast_re (z : ℂ) (n : ℤ) : (z / n).re = z.re / n


/-- Given a tower of algebras `R → A → B`, and a square-zero `I : Ideal B`, each `R`-derivation
from `A` to `I` corresponds to a lift `A →ₐ[R] B` of the canonical map `A →ₐ[R] B ⧸ I`. -/
@[simps (config := .lemmasOnly)]
def liftOfDerivationToSquareZero (f : Derivation R A I) : A →ₐ[R] B

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[CommSemiring A]
[CommRing B]
[Algebra R A]
[Algebra R B]
(I : Ideal B)
(hI : I ^ 2 = ⊥)
[Algebra A B]
[IsScalarTower R A B]
(f : Derivation R A ↥I)
(x : A)

(liftOfDerivationToSquareZero I hI f) x = ↑(f x) + (algebraMap A B) x


theorem mod_def (a b : Ordinal) : a % b = a - b * (a / b)


theorem mul_apply (χ χ' : MulChar R R') (a : R) : (χ * χ') a = χ a * χ' a

{R : Type u_1}
[CommMonoid R]
{R' : Type u_2}
[CommMonoidWithZero R']
(χ χ' : MulChar R R')
(a : R)


theorem verschiebung_frobenius [CharP R p] (x : 𝕎 R) : verschiebung (frobenius x) = x * p

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

WittVector.verschiebung (WittVector.frobenius x) = x * ↑p


/-- The rank of `(ι →₀ R)` is `(#ι).lift`. -/
-- Porting note, this should not be `@[simp]`, as simp can prove it.
-- @[simp]
theorem rank_finsupp_self (ι : Type w) : Module.rank R (ι →₀ R) = Cardinal.lift.{u} #ι

(R : Type u)
[Ring R]
[StrongRankCondition R]
(ι : Type w)

Module.rank R (ι →₀ R) = Cardinal.lift.{u, w} #ι


@[to_additive (attr := simp)]
theorem toSubmonoid_eq {p q : Subgroup G} : p.toSubmonoid = q.toSubmonoid ↔ p = q

{G : Type u_1}
[Group G]
{p q : Subgroup G}


lemma Irreducible.dvd_or_isRelPrime [Monoid α] {p n : α} (hp : Irreducible p) :
    p ∣ n ∨ IsRelPrime p n

{α : Type u_1}
[Monoid α]
{p n : α}
(hp : Irreducible p)


/-- If a function is locally integrable in a second countable topological space,
then there exists a sequence of open sets covering the space on which it is integrable. -/
theorem LocallyIntegrable.exists_nat_integrableOn [SecondCountableTopology X]
    (hf : LocallyIntegrable f μ) : ∃ u : ℕ → Set X,
    (∀ n, IsOpen (u n)) ∧ ((⋃ n, u n) = univ) ∧ (∀ n, IntegrableOn f (u n) μ)

(hf : MeasureTheory.LocallyIntegrable f μ)

∃ u, (∀ (n : ℕ), IsOpen (u n)) ∧ ⋃ n, u n = Set.univ ∧ ∀ (n : ℕ), MeasureTheory.IntegrableOn f (u n) μ


theorem DifferentiableAt.hasGradientAt (h : DifferentiableAt 𝕜 f x) :
    HasGradientAt f (∇ f x) x

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


theorem differentiable_euclidean : Differentiable 𝕜 f ↔ ∀ i, Differentiable 𝕜 fun x => f x i

{𝕜 : Type u_1}
{ι : Type u_2}
{H : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup H]
[NormedSpace 𝕜 H]
[Fintype ι]
{f : H → EuclideanSpace 𝕜 ι}

Differentiable 𝕜 f ↔ ∀ (i : ι), Differentiable 𝕜 fun x => f x i


theorem totalDegree_add_eq_right_of_totalDegree_lt {p q : MvPolynomial σ R}
    (h : q.totalDegree < p.totalDegree) : (q + p).totalDegree = p.totalDegree

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
{p q : MvPolynomial σ R}
(h : q.totalDegree < p.totalDegree)


/-- An equality of subobjects gives an isomorphism of the corresponding objects. -/
@[simps]
def isoOfEqMk {B A : C} (X : Subobject B) (f : A ⟶ B) [Mono f] (h : X = mk f) : (X : C) ≅ A

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{B A : C}
(X : CategoryTheory.Subobject B)
(f : A ⟶ B)
[CategoryTheory.Mono f]
(h : X = CategoryTheory.Subobject.mk f)


/-- The equivalence between cubic polynomials and polynomials of degree at most three. -/
@[simps]
def equiv : Cubic R ≃ { p : R[X] // p.degree ≤ 3 }

{R : Type u_1}
[Semiring R]
(f : { p // p.degree ≤ 3 })


theorem real_smul_nonneg (r : ℝ) (hr : 0 ≤ r) : r • j = r.toNNReal • j

(j : MeasureTheory.JordanDecomposition α)