lemma isSheaf_coherent_of_projective_comp [Preregular C] [FinitaryExtensive C]
    [∀ (X : C), Projective X] [PreservesFiniteProducts s]
    (hF : IsSheaf (coherentTopology C) F) : IsSheaf (coherentTopology C) (F ⋙ s)

[∀ (X : C), CategoryTheory.Projective X]

(hF : CategoryTheory.Presheaf.IsSheaf (CategoryTheory.coherentTopology C) F)

CategoryTheory.Presheaf.IsSheaf (CategoryTheory.coherentTopology C) (F.comp s)


@[simp]
theorem mul_star_self [Mul R] [StarMul R] (x : R) : IsSelfAdjoint (x * star x)

{R : Type u_1}
[Mul R]
[StarMul R]
(x : R)


theorem natTrailingDegree_reverse (f : R[X]) : f.reverse.natTrailingDegree = 0

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


lemma conj_div (x y : K) : conj (x / y) = conj x / conj y

(starRingEnd K) (x / y) = (starRingEnd K) x / (starRingEnd K) y


protected theorem Eq.congr (h₁ : x₁ = y₁) (h₂ : x₂ = y₂) : x₁ = x₂ ↔ y₁ = y₂

∀ {α : Sort u_1} {x₁ y₁ x₂ y₂ : α}, x₁ = y₁ → x₂ = y₂ → (x₁ = x₂ ↔ y₁ = y₂)


protected theorem map_multiset_sum [NonAssocSemiring R] [NonAssocSemiring S] (f : R ≃+* S)
    (s : Multiset R) : f s.sum = (s.map f).sum

{R : Type u_2}
{S : Type u_3}
[NonAssocSemiring R]
[NonAssocSemiring S]
(f : R ≃+* S)
(s : Multiset R)


@[simp] lemma rootSystem_toLin_apply (f x) : (rootSystem H).toLin f x = f x

{K : Type u_1}
{L : Type u_2}
[Field K]
[CharZero K]
[LieRing L]
[LieAlgebra K L]
[LieAlgebra.IsKilling K L]
[FiniteDimensional K L]
(H : LieSubalgebra K L)
[H.IsCartanSubalgebra]
[LieModule.IsTriangularizable K (↥H) L]
(f : Module.Dual K ↥H)
(x : ↥H)

((LieAlgebra.IsKilling.rootSystem H).toLin f) x = f x


@[simp]
theorem natDegree_C (a : R) : natDegree (C a) = 0


theorem _root_.exists_positiveCompacts_subset [LocallyCompactSpace α] {U : Set α} (ho : IsOpen U)
    (hn : U.Nonempty) : ∃ K : PositiveCompacts α, ↑K ⊆ U

{α : Type u_1}
[TopologicalSpace α]
[LocallyCompactSpace α]
{U : Set α}
(ho : IsOpen U)
(hn : U.Nonempty)


/-- A Lie ring is an additive group with compatible product, known as the bracket, satisfying the
Jacobi identity. -/
class LieRing (L : Type v) extends AddCommGroup L, Bracket L L where
  /-- A Lie ring bracket is additive in its first component. -/
  protected add_lie : ∀ x y z : L, ⁅x + y, z⁆ = ⁅x, z⁆ + ⁅y, z⁆
  /-- A Lie ring bracket is additive in its second component. -/
  protected lie_add : ∀ x y z : L, ⁅x, y + z⁆ = ⁅x, y⁆ + ⁅x, z⁆
  /-- A Lie ring bracket vanishes on the diagonal in L × L. -/
  protected lie_self : ∀ x : L, ⁅x, x⁆ = 0
  /-- A Lie ring bracket satisfies a Leibniz / Jacobi identity. -/
  protected leibniz_lie : ∀ x y z : L, ⁅x, ⁅y, z⁆⁆ = ⁅⁅x, y⁆, z⁆ + ⁅y, ⁅x, z⁆⁆

{L : Type v}
[self : LieRing L]
(x y z : L)


theorem eq_top_iff {S : StarSubalgebra R A} : S = ⊤ ↔ ∀ x : A, x ∈ S

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
{S : StarSubalgebra R A}


theorem cylinder_eq_pi (x : ∀ n, E n) (n : ℕ) :
    cylinder x n = Set.pi (Finset.range n : Set ℕ) fun i : ℕ => {x i}

{E : ℕ → Type u_1}
(x : (n : ℕ) → E n)
(n : ℕ)

PiNat.cylinder x n = (↑(Finset.range n)).pi fun i => {x i}


@[simp]
theorem formPerm_cons_concat_apply_last (x y : α) (xs : List α) :
    formPerm (x :: (xs ++ [y])) y = x

{α : Type u_1}
[DecidableEq α]
(x y : α)
(xs : List α)


/-- For `𝕜 = ℝ` or `𝕜 = ℂ`, `exp 𝕜` maps the spectrum of `a` into the spectrum of `exp 𝕜 a`. -/
theorem exp_mem_exp [RCLike 𝕜] [NormedRing A] [NormedAlgebra 𝕜 A] [CompleteSpace A] (a : A)
    {z : 𝕜} (hz : z ∈ spectrum 𝕜 a) : exp 𝕜 z ∈ spectrum 𝕜 (exp 𝕜 a)

{𝕜 : Type u_1}
{A : Type u_2}
[RCLike 𝕜]
[NormedRing A]
[NormedAlgebra 𝕜 A]
[CompleteSpace A]
(a : A)
{z : 𝕜}
(hz : z ∈ spectrum 𝕜 a)

NormedSpace.exp 𝕜 z ∈ spectrum 𝕜 (NormedSpace.exp 𝕜 a)


theorem cocompact_eq_cofinite (X : Type*) [TopologicalSpace X] [DiscreteTopology X] :
    cocompact X = cofinite

(X : Type u_2)
[TopologicalSpace X]
[DiscreteTopology X]


@[simp]
lemma equicontinuous_empty [IsEmpty ι] (F : ι → X → α) :
    Equicontinuous F

{ι : Type u_1}
{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
[IsEmpty ι]
(F : ι → X → α)


/-- Translation in the domain does not change the derivative. -/
lemma deriv_comp_add_const {𝕜 : Type*} [NontriviallyNormedField 𝕜] (a x : 𝕜) {𝕜' : Type*}
    [NormedAddCommGroup 𝕜'] [NormedSpace 𝕜 𝕜'] {h : 𝕜 → 𝕜'}
    (hh : DifferentiableAt 𝕜 h (x + a)) :
    deriv (fun x ↦ h (x + a)) x = deriv h (x + a)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
(a x : 𝕜)
{𝕜' : Type u_2}
[NormedAddCommGroup 𝕜']
[NormedSpace 𝕜 𝕜']
{h : 𝕜 → 𝕜'}
(hh : DifferentiableAt 𝕜 h (x + a))

deriv (fun x => h (x + a)) x = deriv h (x + a)


/-- The extension of `Γ₀ : ChainComplex C ℕ ⥤ SimplicialObject C`
on the idempotent completions. It shall be an equivalence of categories
for any additive category `C`. -/
@[simps!]
def Γ₂ : Karoubi (ChainComplex C ℕ) ⥤ Karoubi (SimplicialObject C)

(P : CategoryTheory.Idempotents.Karoubi (ChainComplex C ℕ))

(AlgebraicTopology.DoldKan.Γ₂.obj P).X.obj Δ = AlgebraicTopology.DoldKan.Γ₀.Obj.obj₂ P.X Δ


theorem _root_.Measurable.setLIntegral_kernel_prod_right {f : α → β → ℝ≥0∞}
    (hf : Measurable (uncurry f)) {s : Set β} (hs : MeasurableSet s) :
    Measurable fun a => ∫⁻ b in s, f a b ∂κ a

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{κ : ProbabilityTheory.Kernel α β}
[ProbabilityTheory.IsSFiniteKernel κ]
{f : α → β → ℝ≥0∞}
(hf : Measurable (Function.uncurry f))
{s : Set β}
(hs : MeasurableSet s)

Measurable fun a => ∫⁻ (b : β) in s, f a b ∂κ a


/-- An element of a `CancelMonoidWithZero` fixed by left multiplication by an element other
than one must be zero. -/
theorem eq_zero_of_mul_eq_self_left (h₁ : b ≠ 1) (h₂ : b * a = a) : a = 0

{M₀ : Type u_2}
[CancelMonoidWithZero M₀]
{a b : M₀}
(h₁ : b ≠ 1)
(h₂ : b * a = a)


@[simp]
theorem uncurry_curry {n} (f : (Fin n → α) → β) :
    uncurry (curry f) = f

{α β : Type u}
{n : ℕ}
(f : (Fin n → α) → β)


/-- Every element of the direct limit corresponds to some element in
some component of the directed system. -/
theorem exists_of [Nonempty ι] [IsDirected ι (· ≤ ·)] (z : DirectLimit G f) :
    ∃ i x, of R ι G f i x = z

{R : Type u}
[Ring R]
{ι : Type v}
[Preorder ι]
{G : ι → Type w}
[(i : ι) → AddCommGroup (G i)]
[(i : ι) → Module R (G i)]
{f : (i j : ι) → i ≤ j → G i →ₗ[R] G j}
[DecidableEq ι]
[Nonempty ι]
[IsDirected ι fun x x_1 => x ≤ x_1]
(z : Module.DirectLimit G f)

∃ i x, (Module.DirectLimit.of R ι G f i) x = z


theorem liftPropOn_of_locally_liftPropOn
    (h : ∀ x ∈ s, ∃ u, IsOpen u ∧ x ∈ u ∧ LiftPropOn P g (s ∩ u)) : LiftPropOn P g s

(h : ∀ x ∈ s, ∃ u, IsOpen u ∧ x ∈ u ∧ ChartedSpace.LiftPropOn P g (s ∩ u))


@[simp]
theorem orderIsoOfSurjective_symm_apply_self (a : α) :
    (orderIsoOfSurjective f h_mono h_surj).symm (f a) = a

{α : Type u_2}
{β : Type u_3}
[LinearOrder α]
[Preorder β]
(f : α → β)
(h_mono : StrictMono f)
(h_surj : Function.Surjective f)
(a : α)

(StrictMono.orderIsoOfSurjective f h_mono h_surj).symm (f a) = a


theorem _root_.MeasureTheory.Integrable.norm_integral_condDistrib (hX : AEMeasurable X μ)
    (hY : AEMeasurable Y μ) (hf_int : Integrable f (μ.map fun a => (X a, Y a))) :
    Integrable (fun a => ‖∫ y, f (X a, y) ∂condDistrib Y X μ (X a)‖) μ

(hf_int : MeasureTheory.Integrable f (MeasureTheory.Measure.map (fun a => (X a, Y a)) μ))

MeasureTheory.Integrable (fun a => ‖∫ (y : Ω), f (X a, y) ∂(ProbabilityTheory.condDistrib Y X μ) (X a)‖) μ


theorem erase_eq_sub_single [AddGroup G] (f : α →₀ G) (a : α) : f.erase a = f - single a (f a)

{α : Type u_1}
{G : Type u_9}
[AddGroup G]
(f : α →₀ G)
(a : α)

Finsupp.erase a f = f - Finsupp.single a (f a)


@[simp]
theorem round_ofNat (n : ℕ) [n.AtLeastTwo] : round (no_index (OfNat.ofNat n : α)) = n

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(n : ℕ)
[n.AtLeastTwo]


theorem isometry_real_vadd (a : ℝ) : Isometry (a +ᵥ · : ℍ → ℍ)


@[simp]
theorem id_eq_id (A : Algebra T) : Algebra.Hom.id A = 𝟙 A

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

CategoryTheory.Monad.Algebra.Hom.id A = CategoryTheory.CategoryStruct.id A


@[simp, norm_cast]
theorem cast_add [AddGroupWithOne α] : ∀ m n, ((m + n : ZNum) : α) = m + n

{α : Type u_1}
[AddGroupWithOne α]
(m n : ZNum)


theorem copy_eq (f : M →ₛₗ[σ] M₃) (f' : M → M₃) (h : f' = ⇑f) : f.copy f' h = f

{R : Type u_1}
{S : Type u_6}
{M : Type u_9}
{M₃ : Type u_12}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₃]
[Module R M]
[Module S M₃]
{σ : R →+* S}
(f : M →ₛₗ[σ] M₃)
(f' : M → M₃)
(h : f' = ⇑f)


/-- A separable extension has separable degree equal to degree. -/
theorem Algebra.IsSeparable.sepDegree_eq [Algebra.IsSeparable F E] :
    sepDegree F E = Module.rank F E

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


@[simp]
theorem norm_zero : ‖(0 : Lp E p μ)‖ = 0

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


@[simp]
theorem lanLiftLeftLift_lift (f : b ⟶ a) (g : c ⟶ a) [HasLeftKanLift f g] :
    (lanLiftLeftLift f g).lift = f₊ g

(CategoryTheory.Bicategory.lanLiftLeftLift f g).lift = CategoryTheory.Bicategory.lanLift f g


theorem star_eq_two_re_sub : star a = ↑(2 * a.re) - a

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


@[simp] lemma ofLowerSet_le_ofLowerSet {a b : WithLowerSet α} :
    ofLowerSet a ≤ ofLowerSet b ↔ a ⤳ b

{α : Type u_1}
[Preorder α]
{a b : Topology.WithLowerSet α}

Topology.WithLowerSet.ofLowerSet a ≤ Topology.WithLowerSet.ofLowerSet b ↔ a ⤳ b


theorem Complex.integral_exp_neg_mul_rpow {p b : ℝ} (hp : 1 ≤ p) (hb : 0 < b) :
    ∫ x : ℂ, rexp (- b * ‖x‖ ^ p) = π * b ^ (-2 / p) * Real.Gamma (2 / p + 1)

∫ (x : ℂ), rexp (-b * ‖x‖ ^ p) = π * b ^ (-2 / p) * Real.Gamma (2 / p + 1)


theorem mem_fintsupport_iff (i : ι) : i ∈ ρ.fintsupport x₀ ↔ x₀ ∈ tsupport (ρ i)

{ι : Type uι}
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{s : Set M}
(ρ : SmoothPartitionOfUnity ι I M s)
(x₀ : M)
(i : ι)

i ∈ ρ.fintsupport x₀ ↔ x₀ ∈ tsupport ⇑(ρ i)


@[simp] theorem rev_lt_rev {i j : Fin n} : rev i < rev j ↔ j < i


/-- Given a measurable function `f` with values in `ℝ≥0` in a sigma-finite space, there exists a
lower semicontinuous function `g > f` with integral arbitrarily close to that of `f`.
Formulation in terms of `lintegral`.
Auxiliary lemma for Vitali-Carathéodory theorem `exists_lt_lower_semicontinuous_integral_lt`. -/
theorem exists_lt_lowerSemicontinuous_lintegral_ge [SigmaFinite μ] (f : α → ℝ≥0)
    (fmeas : Measurable f) {ε : ℝ≥0∞} (ε0 : ε ≠ 0) :
    ∃ g : α → ℝ≥0∞,
      (∀ x, (f x : ℝ≥0∞) < g x) ∧ LowerSemicontinuous g ∧ (∫⁻ x, g x ∂μ) ≤ (∫⁻ x, f x ∂μ) + ε

{α : Type u_1}
[TopologicalSpace α]
[MeasurableSpace α]
[BorelSpace α]
(μ : MeasureTheory.Measure α)
[μ.WeaklyRegular]
[MeasureTheory.SigmaFinite μ]
(f : α → ℝ≥0)
(fmeas : Measurable f)
{ε : ℝ≥0∞}
(ε0 : ε ≠ 0)

∃ g, (∀ (x : α), ↑(f x) < g x) ∧ LowerSemicontinuous g ∧ ∫⁻ (x : α), g x ∂μ ≤ ∫⁻ (x : α), ↑(f x) ∂μ + ε


theorem isInteger_smul {a : R} {b : S} (hb : IsInteger R b) : IsInteger R (a • b)

{R : Type u_1}
[CommSemiring R]
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
{a : R}
{b : S}
(hb : IsLocalization.IsInteger R b)


@[fun_prop]
theorem HasFDerivAt.mul (hc : HasFDerivAt c c' x) (hd : HasFDerivAt d d' x) :
    HasFDerivAt (fun y => c y * d y) (c x • d' + d x • c') x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{𝔸' : Type u_7}
[NormedCommRing 𝔸']
[NormedAlgebra 𝕜 𝔸']
{c d : E → 𝔸'}
{c' d' : E →L[𝕜] 𝔸'}
(hc : HasFDerivAt c c' x)
(hd : HasFDerivAt d d' x)


@[simp]
theorem inftyValuation.C {k : Fq} (hk : k ≠ 0) :
    inftyValuationDef Fq (RatFunc.C k) = Multiplicative.ofAdd (0 : ℤ)

(Fq : Type)
[Field Fq]
[DecidableEq (RatFunc Fq)]
{k : Fq}
(hk : k ≠ 0)

FunctionField.inftyValuationDef Fq (RatFunc.C k) = ↑(Multiplicative.ofAdd 0)


/-- The homset equivalence which helps show that `R` is a right adjoint. -/
@[simps!] -- Porting note: Originally `@[simps (config := { rhsMd := semireducible })]`
noncomputable def constructLeftAdjointEquiv [∀ X : B, RegularEpi (adj₁.counit.app X)] (Y : A)
    (X : B) : (constructLeftAdjointObj _ _ adj₁ adj₂ X ⟶ Y) ≃ (X ⟶ R.obj Y)

[(X : B) → CategoryTheory.RegularEpi (adj₁.counit.app X)]

∀ (a : CategoryTheory.LiftAdjoint.constructLeftAdjointObj R F' adj₁ adj₂ X ⟶ Y),
  (CategoryTheory.LiftAdjoint.constructLeftAdjointEquiv R F' adj₁ adj₂ Y X) a =
    (CategoryTheory.Limits.Cofork.IsColimit.homIso (CategoryTheory.LiftAdjoint.counitCoequalises adj₁ X) (R.obj Y)).symm
      ⟨CategoryTheory.CategoryStruct.comp
          (F.map
            ((adj₂.homEquiv (U.obj X) Y)
              ↑((CategoryTheory.Limits.Cofork.IsColimit.homIso
                    (CategoryTheory.Limits.colimit.isColimit
                      (CategoryTheory.Limits.parallelPair (F'.map (U.map (adj₁.counit.app X)))
                        (CategoryTheory.LiftAdjoint.otherMap R F' adj₁ adj₂ X)))
                    Y)
                  a)))
          (adj₁.counit.app (R.obj Y)),
        ⋯⟩


theorem get?_set_of_lt (a : α) {m n} (l : List α) (h : n < length l) :
    (set l m a).get? n = if m = n then some a else l.get? n

{α : Type u_1}
(a : α)
{m n : Nat}
(l : List α)
(h : n < l.length)

(l.set m a).get? n = if m = n then some a else l.get? n


theorem pi_Ioo_ae_eq_pi_Icc {s : Set ι} {f g : ∀ i, α i} :
    (pi s fun i => Ioo (f i) (g i)) =ᵐ[Measure.pi μ] pi s fun i => Icc (f i) (g i)

{μ : (i : ι) → MeasureTheory.Measure (α i)}

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

[∀ (i : ι), MeasureTheory.NoAtoms (μ i)]

(s.pi fun i => Set.Ioo (f i) (g i)) =ᵐ[MeasureTheory.Measure.pi μ] s.pi fun i => Set.Icc (f i) (g i)


theorem coe_decompose_mul_add_of_left_mem [AddLeftCancelMonoid ι] [GradedRing 𝒜] {a b : A}
    (a_mem : a ∈ 𝒜 i) : (decompose 𝒜 (a * b) (i + j) : A) = a * decompose 𝒜 b j

{ι : Type u_1}
{A : Type u_3}
{σ : Type u_4}
[DecidableEq ι]
[Semiring A]
[SetLike σ A]
[AddSubmonoidClass σ A]
(𝒜 : ι → σ)
{i j : ι}
[AddLeftCancelMonoid ι]
[GradedRing 𝒜]
{a b : A}
(a_mem : a ∈ 𝒜 i)

↑(((DirectSum.decompose 𝒜) (a * b)) (i + j)) = a * ↑(((DirectSum.decompose 𝒜) b) j)


protected theorem surjective (e : α ≃ β) : Surjective e


@[to_additive existing (attr := simp) nsmul_univ]
theorem univ_pow : ∀ {n : ℕ}, n ≠ 0 → (univ : Set α) ^ n = univ


/-- Corresponds to `dist_eq_norm`. -/
theorem hammingDist_eq_hammingNorm [∀ i, AddGroup (β i)] (x y : ∀ i, β i) :
    hammingDist x y = hammingNorm (x - y)

{ι : Type u_2}
{β : ι → Type u_3}
[Fintype ι]
[(i : ι) → DecidableEq (β i)]
[(i : ι) → AddGroup (β i)]
(x y : (i : ι) → β i)


theorem cauSeq_converges (f : CauSeq ℝ abs) : ∃ x, f ≈ const abs x


theorem iInter_and {p q : Prop} (s : p ∧ q → Set α) : ⋂ h, s h = ⋂ (hp) (hq), s ⟨hp, hq⟩

{α : Type u_1}
{p q : Prop}
(s : p ∧ q → Set α)

⋂ (h : p ∧ q), s h = ⋂ (hp : p), ⋂ (hq : q), s ⋯


/-- Auxiliary definition: the cone over the limit category. -/
@[simps]
def limitCone (F : J ⥤ Cat.{v, v}) : Cone F

(F : CategoryTheory.Functor J CategoryTheory.Cat)

(CategoryTheory.Cat.HasLimits.limitCone F).pt = CategoryTheory.Cat.HasLimits.limitConeX F


@[simp] lemma tensorComm_apply (Q₁ : QuadraticForm R M₁) (Q₂ : QuadraticForm R M₂)
    (x : M₁ ⊗[R] M₂) :
    tensorComm Q₁ Q₂ x = TensorProduct.comm R M₁ M₂ x

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

(Q₁.tensorComm Q₂) x = (TensorProduct.comm R M₁ M₂) x


/-- Indexed version of the above lemma `exists_lt_of_lt_csSup`.
When `b < iSup f`, there is an element `i` such that `b < f i`.
-/
theorem exists_lt_of_lt_ciSup [Nonempty ι] {f : ι → α} (h : b < iSup f) : ∃ i, b < f i

{α : Type u_1}
{ι : Sort u_4}
[ConditionallyCompleteLinearOrder α]
{b : α}
[Nonempty ι]
{f : ι → α}
(h : b < iSup f)


@[simp] theorem ofMulDistribMulAction_apply_apply (g : M) (a : Additive G) :
    ofMulDistribMulAction M G g a = Additive.ofMul (g • Additive.toMul a)

(M : Type u_1)
(G : Type u_2)
[Monoid M]
[CommGroup G]
[MulDistribMulAction M G]
(g : M)
(a : Additive G)

((Representation.ofMulDistribMulAction M G) g) a = Additive.ofMul (g • Additive.toMul a)


theorem isPiSystem_Iio_rat : IsPiSystem (⋃ a : ℚ, {Iio (a : ℝ)})


@[simp]
lemma sHomWhiskerRight_id (K L : C) : sHomWhiskerRight (𝟙 K) L = 𝟙 _

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.SimplicialCategory C]
(K L : C)

CategoryTheory.SimplicialCategory.sHomWhiskerRight (𝟙 K) L = 𝟙 (CategoryTheory.SimplicialCategory.sHom K L)


theorem map_prod_map_mk_nhds (x : X) (y : Y) :
    map (Prod.map mk mk) (𝓝 (x, y)) = 𝓝 (mk x, mk y)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(x : X)
(y : Y)

Filter.map (Prod.map SeparationQuotient.mk SeparationQuotient.mk) (𝓝 (x, y)) =
  𝓝 (SeparationQuotient.mk x, SeparationQuotient.mk y)


@[to_additive]
theorem mulIndicator_mul (s : Set α) (f g : α → M) :
    (mulIndicator s fun a => f a * g a) = fun a => mulIndicator s f a * mulIndicator s g a

{α : Type u_1}
{M : Type u_4}
[AddZeroClass M]
(s : Set α)
(f g : α → M)

(s.indicator fun a => f a + g a) = fun a => s.indicator f a + s.indicator g a


@[to_additive (attr := simp)]
lemma stabilizer_smul_eq_right [Group α] [MulAction α β] [SMulCommClass G α β] (a : α) (b : β) :
    stabilizer G (a • b) = stabilizer G b

{G : Type u_1}
{α : Type u_2}
{β : Type u_3}
[AddGroup G]
[AddAction G β]
[AddGroup α]
[AddAction α β]
[VAddCommClass G α β]
(a : α)
(b : β)

AddAction.stabilizer G (a +ᵥ b) = AddAction.stabilizer G b


@[simp]
theorem linearization_map_hom : ((linearization k G).map f).hom = Finsupp.lmapDomain k k f.hom

{k G : Type u}
[CommRing k]
[Monoid G]
{X Y : Action (Type u) (MonCat.of G)}
(f : X ⟶ Y)

((Rep.linearization k G).map f).hom = Finsupp.lmapDomain k k f.hom


theorem intPow_ofNat (h1 : Nat.pow a b = c) :
    Int.pow (Int.ofNat a) b = Int.ofNat c


/-- The `n`th power map on a commutative monoid for a natural `n`, considered as a morphism of
monoids. -/
@[to_additive (attr := simps) "Multiplication by a natural `n` on a commutative additive monoid,
considered as a morphism of additive monoids."]
def powMonoidHom (n : ℕ) : α →* α


theorem isRat_rpow_neg {a b : ℝ} {nb : ℕ}
    {num : ℤ} {den : ℕ}
    (pb : IsInt b (Int.negOfNat nb)) (pe' : IsRat (a ^ (Int.negOfNat nb)) num den) :
    IsRat (a ^ b) num den

(pb : Mathlib.Meta.NormNum.IsInt b (Int.negOfNat nb))

(pe' : Mathlib.Meta.NormNum.IsRat (a ^ Int.negOfNat nb) num den)

Mathlib.Meta.NormNum.IsRat (a ^ b) num den


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

{q : ℚ}
{K : Type u_5}
[LinearOrderedField K]

↑q ≤ 0 ↔ q ≤ 0


/-- In an ordered commutative monoid, if each factor `f i` of one finite product is less than or
equal to the corresponding factor `g i` of another finite product, then
`∏ i ∈ s, f i ≤ ∏ i ∈ s, g i`. -/
@[to_additive sum_le_sum]
theorem prod_le_prod' (h : ∀ i ∈ s, f i ≤ g i) : ∏ i ∈ s, f i ≤ ∏ i ∈ s, g i

{ι : Type u_1}
{N : Type u_5}
[OrderedAddCommMonoid N]
{f g : ι → N}
{s : Finset ι}
(h : ∀ i ∈ s, f i ≤ g i)


@[trans]
theorem trans ⦃f g h : C(X, Y)⦄ (h₀ : HomotopicWith f g P) (h₁ : HomotopicWith g h P) :
    HomotopicWith f h P

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{P : C(X, Y) → Prop}
⦃f g h : C(X, Y)⦄
(h₀ : f.HomotopicWith g P)
(h₁ : g.HomotopicWith h P)


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

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


/-- Continuity is a "prelocal" predicate on functions to a fixed topological space `T`.
-/
@[simps!]
def continuousPrelocal (T : TopCat.{v}) : PrelocalPredicate fun _ : X => T

∀ {x : TopologicalSpace.Opens ↑X} (f : ↥x → ↑T), (X.continuousPrelocal T).pred f = Continuous f


@[to_additive]
theorem prod_subtype {p : α → Prop} {F : Fintype (Subtype p)} (s : Finset α) (h : ∀ x, x ∈ s ↔ p x)
    (f : α → β) : ∏ a ∈ s, f a = ∏ a : Subtype p, f a

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
{p : α → Prop}
{F : Fintype (Subtype p)}
(s : Finset α)
(h : ∀ (x : α), x ∈ s ↔ p x)
(f : α → β)


/-- The **binomial theorem** -/
theorem add_pow [CommSemiring R] (x y : R) (n : ℕ) :
    (x + y) ^ n = ∑ m ∈ range (n + 1), x ^ m * y ^ (n - m) * choose n m

{R : Type u_1}
[CommSemiring R]
(x y : R)
(n : ℕ)

(x + y) ^ n = ∑ m ∈ Finset.range (n + 1), x ^ m * y ^ (n - m) * ↑(n.choose m)


/-- We can upgrade `e.functor` to a monoidal functor from `C` to `D` with the transported structure.
-/
@[simps!]
def toTransported (e : C ≌ D) : MonoidalFunctor C (Transported e)

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

(CategoryTheory.Monoidal.toTransported e).ε =
  e.symm.unit.app (e.functor.obj (𝟙_ C)) ≫ CategoryTheory.inv (e.functor.map (e.unitIso.hom.app (𝟙_ C)))


/-- Radon-Nikodym derivative with respect to the scalar multiple of a measure.
See also `rnDeriv_smul_right`, which has no hypothesis on `μ` but requires finite `ν`. -/
theorem rnDeriv_smul_right' (ν μ : Measure α) [SigmaFinite ν] [SigmaFinite μ]
    {r : ℝ≥0} (hr : r ≠ 0) :
    ν.rnDeriv (r • μ) =ᵐ[μ] r⁻¹ • ν.rnDeriv μ

{α : Type u_1}
{m : MeasurableSpace α}
(ν μ : MeasureTheory.Measure α)
[MeasureTheory.SigmaFinite ν]
[MeasureTheory.SigmaFinite μ]
{r : ℝ≥0}
(hr : r ≠ 0)


@[simp]
theorem mk_coe (f h₁ h₂) : (LinearEquiv.mk e f h₁ h₂ : M ≃ₛₗ[σ] M₂) = e

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

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

{ toLinearMap := ↑e, invFun := f, left_inv := h₁, right_inv := h₂ } = e


@[simp] theorem piCurry_apply {β : α → Type*} (γ : ∀ a, β a → Type*)
    (f : ∀ x : Σ i, β i, γ x.1 x.2) :
    piCurry γ f = Sigma.curry f

(f : (x : (i : α) × β i) → γ x.fst x.snd)


theorem range_extend_subset (f : α → β) (g : α → γ) (g' : β → γ) :
    range (extend f g g') ⊆ range g ∪ g' '' (range f)ᶜ

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α → β)
(g : α → γ)
(g' : β → γ)

Set.range (Function.extend f g g') ⊆ Set.range g ∪ g' '' (Set.range f)ᶜ


/-- The natural equivalence between continuous linear maps from `M₂` to `M₃`
and continuous 1-multilinear maps from `M₂` to `M₃`. -/
@[simps! apply_toMultilinearMap apply_apply symm_apply_apply]
def ofSubsingleton [Subsingleton ι] (i : ι) :
    (M₂ →L[R] M₃) ≃ ContinuousMultilinearMap R (fun _ : ι => M₂) M₃

(f : ContinuousMultilinearMap R (fun x => M₂) M₃)

((ContinuousMultilinearMap.ofSubsingleton R M₂ M₃ i).symm f) x = f fun x_1 => x


theorem MDifferentiableWithinAt.prod_mk_space {f : M → E'} {g : M → E''}
    (hf : MDifferentiableWithinAt I 𝓘(𝕜, E') f s x)
    (hg : MDifferentiableWithinAt I 𝓘(𝕜, E'') g s x) :
    MDifferentiableWithinAt I 𝓘(𝕜, E' × E'') (fun x => (f x, g x)) s x


theorem copy_eq (p : SubMulAction R M) (s : Set M) (hs : s = ↑p) : p.copy s hs = p

{R : Type u}
{M : Type v}
[SMul R M]
(p : SubMulAction R M)
(s : Set M)
(hs : s = ↑p)


theorem wellFoundedOn_iff :
    s.WellFoundedOn r ↔ WellFounded fun a b : α => r a b ∧ a ∈ s ∧ b ∈ s

{α : Type u_2}
{r : α → α → Prop}
{s : Set α}

s.WellFoundedOn r ↔ WellFounded fun a b => r a b ∧ a ∈ s ∧ b ∈ s


/-- See also `orderOf_eq_card_powers`. -/
@[to_additive "See also `addOrder_eq_card_multiples`."]
lemma Nat.card_submonoidPowers : Nat.card (powers a) = orderOf a

{G : Type u_1}
[LeftCancelMonoid G]
{a : G}

Nat.card ↥(Submonoid.powers a) = orderOf a


/-- The value of the Infimum of a nonempty set of outer measures on a set is not simply
the minimum value of a measure on that set: it is the infimum sum of measures of countable set of
sets that covers that set, where a different measure can be used for each set in the cover. -/
theorem sInf_apply {m : Set (OuterMeasure α)} {s : Set α} (h : m.Nonempty) :
    sInf m s =
      ⨅ (t : ℕ → Set α) (_ : s ⊆ iUnion t), ∑' n, ⨅ (μ : OuterMeasure α) (_ : μ ∈ m), μ (t n)

{m : Set (MeasureTheory.OuterMeasure α)}

(sInf m) s = ⨅ t, ⨅ (_ : s ⊆ Set.iUnion t), ∑' (n : ℕ), ⨅ μ ∈ m, μ (t n)


theorem integral_gaussian_complex_Ioi {b : ℂ} (hb : 0 < re b) :
    ∫ x : ℝ in Ioi 0, cexp (-b * (x : ℂ) ^ 2) = (π / b) ^ (1 / 2 : ℂ) / 2


theorem inclusionInDoubleDual_norm_le : ‖inclusionInDoubleDual 𝕜 E‖ ≤ 1

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
(E : Type u_2)
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]

‖NormedSpace.inclusionInDoubleDual 𝕜 E‖ ≤ 1


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

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

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


@[to_additive]
theorem nhds_eq (B : GroupFilterBasis G) {x₀ : G} : @nhds G B.topology x₀ = B.N x₀

{G : Type u}
[AddGroup G]
(B : AddGroupFilterBasis G)
{x₀ : G}


lemma isRightAdjoint_inverse : e.inverse.IsRightAdjoint

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


theorem IsPrenex.castLE (hφ : IsPrenex φ) : ∀ {n} {h : l ≤ n}, (φ.castLE h).IsPrenex

{L : FirstOrder.Language}
{α : Type u'}
{l : ℕ}
{φ : L.BoundedFormula α l}
(hφ : φ.IsPrenex)
{n : ℕ}
{h : l ≤ n}


@[simp]
theorem toBasicOpen_mk' (s f : R) (g : Submonoid.powers s) :
    toBasicOpen R s (IsLocalization.mk' (Localization.Away s) f g) =
      const R f g (PrimeSpectrum.basicOpen s) fun x hx => Submonoid.powers_le.2 hx g.2

(R : Type u)
[CommRing R]
(s f : R)
(g : ↥(Submonoid.powers s))

(AlgebraicGeometry.StructureSheaf.toBasicOpen R s) (IsLocalization.mk' (Localization.Away s) f g) =
  AlgebraicGeometry.StructureSheaf.const R f (↑g) (PrimeSpectrum.basicOpen s) ⋯


theorem minimalPeriod_eq_prime {p : ℕ} [hp : Fact p.Prime] (hper : IsPeriodicPt f p x)
    (hfix : ¬IsFixedPt f x) : minimalPeriod f x = p

{α : Type u_1}
{f : α → α}
{x : α}
{p : ℕ}
[hp : Fact (Nat.Prime p)]
(hper : Function.IsPeriodicPt f p x)
(hfix : ¬Function.IsFixedPt f x)


@[simp]
theorem of_symm_apply (f : Matrix m n α) (i j) : of.symm f i j = f i j

{m : Type u_2}
{n : Type u_3}
{α : Type v}
(f : Matrix m n α)
(i : m)
(j : n)


@[simp, nolint simpNF] lemma toEquiv_inj {a b : α} : toEquiv a = toEquiv b ↔ a = b

Specialization.toEquiv a = Specialization.toEquiv b ↔ a = b


theorem div_neg_eq_neg_div (a b : K) : b / -a = -(b / a)

{K : Type u_3}
[DivisionMonoid K]
[HasDistribNeg K]
(a b : K)


@[to_additive]
theorem prod_apply_ite_of_true {p : α → Prop} {hp : DecidablePred p} (f g : α → γ) (k : γ → β)
    (h : ∀ x ∈ s, p x) : (∏ x ∈ s, k (if p x then f x else g x)) = ∏ x ∈ s, k (f x)

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
{s : Finset α}
[AddCommMonoid β]
{p : α → Prop}
{hp : DecidablePred p}
(f g : α → γ)
(k : γ → β)
(h : ∀ x ∈ s, p x)

∑ x ∈ s, k (if p x then f x else g x) = ∑ x ∈ s, k (f x)


@[simp]
theorem rpow_eq_zero_iff {x : ℝ≥0} {y : ℝ} : x ^ y = 0 ↔ x = 0 ∧ y ≠ 0


@[simp]
theorem aroots_neg [CommRing S] [IsDomain S] [Algebra T S] (p : T[X]) :
    (-p).aroots S = p.aroots S

{S : Type v}
{T : Type w}
[CommRing T]
[CommRing S]
[IsDomain S]
[Algebra T S]
(p : Polynomial T)


/-- Every property local at the target can be associated with an affine target property.
This is not an instance as the associated property can often take on simpler forms. -/
lemma of_isLocalAtTarget (P) [IsLocalAtTarget P] :
    HasAffineProperty P (AffineTargetMorphismProperty.of P)

(P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme)

AlgebraicGeometry.HasAffineProperty P (AlgebraicGeometry.AffineTargetMorphismProperty.of P)


/-- This structure permits to define a vector bundle when trivializations are given as local
equivalences but there is not yet a topology on the total space or the fibers.
The total space is hence given a topology in such a way that there is a fiber bundle structure for
which the partial equivalences are also partial homeomorphisms and hence vector bundle
trivializations. The topology on the fibers is induced from the one on the total space.

The field `exists_coordChange` is stated as an existential statement (instead of 3 separate
fields), since it depends on propositional information (namely `e e' ∈ pretrivializationAtlas`).
This makes it inconvenient to explicitly define a `coordChange` function when constructing a
`VectorPrebundle`. -/
-- Porting note(#5171): was @[nolint has_nonempty_instance]
structure VectorPrebundle where
  pretrivializationAtlas : Set (Pretrivialization F (π F E))
  pretrivialization_linear' : ∀ e, e ∈ pretrivializationAtlas → e.IsLinear R
  pretrivializationAt : B → Pretrivialization F (π F E)
  mem_base_pretrivializationAt : ∀ x : B, x ∈ (pretrivializationAt x).baseSet
  pretrivialization_mem_atlas : ∀ x : B, pretrivializationAt x ∈ pretrivializationAtlas
  exists_coordChange : ∀ᵉ (e ∈ pretrivializationAtlas) (e' ∈ pretrivializationAtlas),
    ∃ f : B → F →L[R] F, ContinuousOn f (e.baseSet ∩ e'.baseSet) ∧
      ∀ᵉ (b ∈ e.baseSet ∩ e'.baseSet) (v : F), f b v = (e' ⟨b, e.symm b v⟩).2
  totalSpaceMk_inducing : ∀ b : B, Inducing (pretrivializationAt b ∘ .mk b)

{R : Type u_1}
{B : Type u_2}
{F : Type u_3}
{E : B → Type u_4}
[NontriviallyNormedField R]
[(x : B) → AddCommMonoid (E x)]
[(x : B) → Module R (E x)]
[NormedAddCommGroup F]
[NormedSpace R F]
[TopologicalSpace B]
[(x : B) → TopologicalSpace (E x)]
(self : VectorPrebundle R F E)
(x : B)

self.pretrivializationAt x ∈ self.pretrivializationAtlas


@[to_additive]
theorem ContMDiff.div {f g : M → G} (hf : ContMDiff I' I n f) (hg : ContMDiff I' I n g) :
    ContMDiff I' I n fun x => f x / g x

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


/-- Negating the second vector passed to `oangle` does not change twice the angle. -/
@[simp]
theorem two_zsmul_oangle_neg_right (x y : V) :
    (2 : ℤ) • o.oangle x (-y) = (2 : ℤ) • o.oangle x y

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


theorem smul_mem_of_set_mem_fixedBy {s : Set α} {g : G} (s_in_fixedBy : s ∈ fixedBy (Set α) g)
    {x : α} : g • x ∈ s ↔ x ∈ s

(s_in_fixedBy : s ∈ MulAction.fixedBy (Set α) g)


theorem domCongr_toAlgHom (e : G ≃+ H) : (domCongr k A e).toAlgHom = mapDomainAlgHom k A e

(k : Type u₁)
{G : Type u₂}
{H : Type u_1}
(A : Type u_3)
[CommSemiring k]
[AddMonoid G]
[AddMonoid H]
[Semiring A]
[Algebra k A]
(e : G ≃+ H)

↑(AddMonoidAlgebra.domCongr k A e) = AddMonoidAlgebra.mapDomainAlgHom k A e


@[simp]
theorem comp_map {α β γ : TypeVec n} (f : α ⟹ β) (g : β ⟹ γ) (x : F α) :
    (g ⊚ f) <$$> x = g <$$> f <$$> x

{n : ℕ}
{F : TypeVec.{u} n → Type u_1}
[q : MvQPF F]
{α β γ : TypeVec.{u} n}
(f : α ⟹ β)
(g : β ⟹ γ)
(x : F α)


@[simp]
theorem card_disjiUnion (s : Finset α) (t : α → Finset β) (h) :
    (s.disjiUnion t h).card = s.sum fun i => (t i).card

{α : Type u_3}
{β : Type u_4}
(s : Finset α)
(t : α → Finset β)
(h : (↑s).PairwiseDisjoint t)

(s.disjiUnion t h).card = ∑ i ∈ s, (t i).card


theorem impl_cons (w' : 0 < List.length ds) :
    impl C (x :: xs) y ⟨d :: ds, w⟩ =
      let ⟨r, w⟩ := impl C xs y ⟨ds, w'⟩
      ⟨min (C.delete x + r[0]) (min (C.insert y + d) (C.substitute x y + ds[0])) :: r, by simp⟩

{α : Type u_1}
{β : Type u_2}
{δ : Type u_3}
[AddZeroClass δ]
[Min δ]
{C : Levenshtein.Cost α β δ}
(x : α)
(xs : List α)
(y : β)
(d : δ)
(ds : List δ)
(w : 0 < (d :: ds).length)
(w' : 0 < ds.length)

Levenshtein.impl C (x :: xs) y ⟨d :: ds, w⟩ =
  match Levenshtein.impl C xs y ⟨ds, w'⟩ with
  | ⟨r, w⟩ => ⟨min (C.delete x + r[0]) (min (C.insert y + d) (C.substitute x y + ds[0])) :: r, ⋯⟩


@[simp] theorem domCongr_symm (e : G ≃+ H) : (domCongr k A e).symm = domCongr k A e.symm

(AddMonoidAlgebra.domCongr k A e).symm = AddMonoidAlgebra.domCongr k A e.symm


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

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

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


@[simp, norm_cast]
protected theorem coe_add [AddZeroClass α] [Preorder α] [CovariantClass α α (· + ·) (· ≤ ·)]
    (a b : { x : α // 0 ≤ x }) : ((a + b : { x : α // 0 ≤ x }) : α) = a + b

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


@[simp]
theorem recOn_0 : @Multiset.recOn α C (0 : Multiset α) C_0 C_cons C_cons_heq = C_0

{C_cons : (a : α) → (m : Multiset α) → C m → C (a ::ₘ m)}

{C_cons_heq :
  ∀ (a a' : α) (m : Multiset α) (b : C m),
    HEq (C_cons a (a' ::ₘ m) (C_cons a' m b)) (C_cons a' (a ::ₘ m) (C_cons a m b))}

Multiset.recOn 0 C_0 C_cons C_cons_heq = C_0


/-- **Nakayama's Lemma** - Statement (4) in
[Stacks 00DV](https://stacks.math.columbia.edu/tag/00DV).
See also `sup_smul_eq_sup_smul_of_le_smul_of_le_jacobson` for a generalisation
to the `jacobson` of any ideal -/
theorem smul_le_of_le_smul_of_le_jacobson_bot {I : Ideal R} {N N' : Submodule R M} (hN' : N'.FG)
    (hIJ : I ≤ jacobson ⊥) (hNN : N' ≤ N ⊔ I • N') : I • N' ≤ N

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{I : Ideal R}
{N N' : Submodule R M}
(hN' : N'.FG)
(hIJ : I ≤ ⊥.jacobson)
(hNN : N' ≤ N ⊔ I • N')


@[simp]
theorem isSymm_zero : (0 : M →ₛₗ[I] M →ₗ[R] R).IsSymm

{R : Type u_1}
{M : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{I : R →+* R}


/-- Transport dependent functions through an equivalence of the base space.

This is `Equiv.piCongrLeft'` as a `LinearEquiv`. -/
@[simps (config := { simpRhs := true })]
def piCongrLeft' (e : ι ≃ ι') : ((i' : ι) → φ i') ≃ₗ[R] (i : ι') → φ <| e.symm i

(R : Type u)
{ι : Type x}
{ι' : Type x'}
[Semiring R]
(φ : ι → Type u_1)
[(i : ι) → AddCommMonoid (φ i)]
[(i : ι) → Module R (φ i)]
(e : ι ≃ ι')

∀ (a : (b : ι') → φ (e.symm b)) (a_1 : ι), (LinearEquiv.piCongrLeft' R φ e).symm a a_1 = ⋯ ▸ a (e a_1)


/-- The exponential characteristic is one if the characteristic is zero. -/
theorem char_zero_of_expChar_one (p : ℕ) [hp : CharP R p] [hq : ExpChar R 1] : p = 0

(R : Type u)
[Semiring R]
[Nontrivial R]
(p : ℕ)
[hp : CharP R p]
[hq : ExpChar R 1]


theorem max_top_right [OrderTop α] (a : α) : max a ⊤ = ⊤

{α : Type u}
[LinearOrder α]
[OrderTop α]
(a : α)


@[simp]
theorem seq_up (f : α → β) (x : α) : (ULift.up f).seq (fun _ => ULift.up x) = ULift.up (f x)

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

({ down := f }.seq fun x_1 => { down := x }) = { down := f x }


/-- **Shrinking lemma**. A point-finite open cover of a closed subset of a normal space can be
"shrunk" to a new open cover so that the closure of each new open set is contained in the
corresponding original open set. -/
theorem exists_subset_iUnion_closure_subset (hs : IsClosed s) (uo : ∀ i, IsOpen (u i))
    (uf : ∀ x ∈ s, { i | x ∈ u i }.Finite) (us : s ⊆ ⋃ i, u i) :
    ∃ v : ι → Set X, s ⊆ iUnion v ∧ (∀ i, IsOpen (v i)) ∧ ∀ i, closure (v i) ⊆ u i

{ι : Type u_1}
{X : Type u_2}
[TopologicalSpace X]
[NormalSpace X]
{u : ι → Set X}
{s : Set X}
(hs : IsClosed s)
(uo : ∀ (i : ι), IsOpen (u i))
(uf : ∀ x ∈ s, {i | x ∈ u i}.Finite)
(us : s ⊆ ⋃ i, u i)

∃ v, s ⊆ Set.iUnion v ∧ (∀ (i : ι), IsOpen (v i)) ∧ ∀ (i : ι), closure (v i) ⊆ u i


/-- The Gromov-Hausdorff distance can also be realized by a coupling in `ℓ^∞(ℝ)`, by embedding
the optimal coupling through its Kuratowski embedding. -/
theorem ghDist_eq_hausdorffDist (X : Type u) [MetricSpace X] [CompactSpace X] [Nonempty X]
    (Y : Type v) [MetricSpace Y] [CompactSpace Y] [Nonempty Y] :
    ∃ Φ : X → ℓ_infty_ℝ,
      ∃ Ψ : Y → ℓ_infty_ℝ,
        Isometry Φ ∧ Isometry Ψ ∧ ghDist X Y = hausdorffDist (range Φ) (range Ψ)

∃ Φ Ψ, Isometry Φ ∧ Isometry Ψ ∧ GromovHausdorff.ghDist X Y = Metric.hausdorffDist (Set.range Φ) (Set.range Ψ)


@[simp]
theorem Ico_eq_zero_of_le (h : b ≤ a) : Ico a b = 0

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


@[simp, norm_cast]
theorem coe_finset_sum {α} [∀ i, AddCommMonoid (β i)] (s : Finset α) (g : α → Π₀ i, β i) :
    ⇑(∑ a ∈ s, g a) = ∑ a ∈ s, ⇑(g a)

{ι : Type u}
{β : ι → Type v}
{α : Type u_1}
[(i : ι) → AddCommMonoid (β i)]
(s : Finset α)
(g : α → Π₀ (i : ι), β i)


@[to_additive (attr := simp)]
theorem mulEquivOfLocalizations_apply {k : LocalizationMap S P} {x} :
    f.mulEquivOfLocalizations k x = f.lift k.map_units x

{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)
{k : S.LocalizationMap P}
{x : N}

(f.mulEquivOfLocalizations k) x = (f.lift ⋯) x


lemma end_mem_verts_toSubgraph (p : G.Walk u v) : v ∈ p.toSubgraph.verts

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


theorem Prime.five_le_of_ne_two_of_ne_three {p : ℕ} (hp : p.Prime) (h_two : p ≠ 2)
    (h_three : p ≠ 3) : 5 ≤ p

{p : ℕ}
(hp : Nat.Prime p)
(h_two : p ≠ 2)
(h_three : p ≠ 3)


lemma Spec.locallyRingedSpaceObj_sheaf (R : CommRingCat.{u}) :
    (Spec.locallyRingedSpaceObj R).sheaf = structureSheaf R

(AlgebraicGeometry.Spec.locallyRingedSpaceObj R).sheaf = AlgebraicGeometry.Spec.structureSheaf ↑R


@[simp]
theorem algHom_C {A : Type*} [Semiring A] [Algebra R A] (f : MvPolynomial σ R →ₐ[R] A) (r : R) :
    f (C r) = algebraMap R A r

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
{A : Type u_2}
[Semiring A]
[Algebra R A]
(f : MvPolynomial σ R →ₐ[R] A)
(r : R)

f (MvPolynomial.C r) = (algebraMap R A) r


@[simp]
theorem centralBinom_zero : centralBinom 0 = 1


/-- (An auxiliary definition for `functorCategoryMonoidal`.) -/
@[simps]
def whiskerRight (F') : tensorObj F F' ⟶ tensorObj G F'

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
[CategoryTheory.MonoidalCategory D]
{F G : C ⥤ D}
(α : F ⟶ G)
(F' : C ⥤ D)
(X : C)

(CategoryTheory.Monoidal.FunctorCategory.whiskerRight α F').app X = α.app X ▷ F'.obj X


/--
For two preorders `α, β`, if `f : α → β` is strictly monotonic, then a strict chain of `α`
can be pushed out to a strict chain of `β` by
`a₀ < a₁ < ... < aₙ ↦ f a₀ < f a₁ < ... < f aₙ`
-/
@[simps!]
def map (p : LTSeries α) (f : α → β) (hf : StrictMono f) : LTSeries β

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(p : LTSeries α)
(f : α → β)
(hf : StrictMono f)


theorem minCardFinsetOfMemConvexHull_card_le_card {t : Finset E} (ht₁ : ↑t ⊆ s)
    (ht₂ : x ∈ convexHull 𝕜 (t : Set E)) : (minCardFinsetOfMemConvexHull hx).card ≤ t.card

{𝕜 : Type u_1}
{E : Type u}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
{x : E}
(hx : x ∈ (convexHull 𝕜) s)
{t : Finset E}
(ht₁ : ↑t ⊆ s)
(ht₂ : x ∈ (convexHull 𝕜) ↑t)

(Caratheodory.minCardFinsetOfMemConvexHull hx).card ≤ t.card


theorem isThreeCycle_sq {g : Perm α} (ht : IsThreeCycle g) : IsThreeCycle (g * g)

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{g : Equiv.Perm α}
(ht : g.IsThreeCycle)


@[to_additive] lemma smul_def (g : S) (m : α) : g • m = (g : G) • m

{G : Type u_1}
{α : Type u_2}
[AddGroup G]
[AddAction G α]
{S : AddSubgroup G}
(g : ↥S)
(m : α)


theorem lhopital_zero_right_on_Ico (hff' : ∀ x ∈ Ioo a b, HasDerivAt f (f' x) x)
    (hgg' : ∀ x ∈ Ioo a b, HasDerivAt g (g' x) x) (hcf : ContinuousOn f (Ico a b))
    (hcg : ContinuousOn g (Ico a b)) (hg' : ∀ x ∈ Ioo a b, g' x ≠ 0) (hfa : f a = 0) (hga : g a = 0)
    (hdiv : Tendsto (fun x => f' x / g' x) (𝓝[>] a) l) :
    Tendsto (fun x => f x / g x) (𝓝[>] a) l

(hff' : ∀ x ∈ Set.Ioo a b, HasDerivAt f (f' x) x)

(hgg' : ∀ x ∈ Set.Ioo a b, HasDerivAt g (g' x) x)

(hdiv : Filter.Tendsto (fun x => f' x / g' x) (𝓝[>] a) l)

Filter.Tendsto (fun x => f x / g x) (𝓝[>] a) l


@[simp]
theorem singleton_eq_rotate_iff {l : List α} {n : ℕ} {x : α} : [x] = l.rotate n ↔ [x] = l

{α : Type u}
{l : List α}
{n : ℕ}
{x : α}


/-- The cones for `StructuredArrow.proj Y L ⋙ F`, as a functor from `RightExtension L F`. -/
@[simps]
def coneAtFunctor (Y : D) :
    RightExtension L F ⥤ Cone (StructuredArrow.proj Y L ⋙ F)

{C : Type u_1}
{D : Type u_2}
{H : Type u_3}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
[CategoryTheory.Category.{u_6, u_3} H]
(L : CategoryTheory.Functor C D)
(F : CategoryTheory.Functor C H)
(Y : D)
(E : L.RightExtension F)

(CategoryTheory.Functor.RightExtension.coneAtFunctor L F Y).obj E = E.coneAt Y


@[to_additive]
theorem prehaar_self {K₀ : PositiveCompacts G} {U : Set G} (hU : (interior U).Nonempty) :
    prehaar (K₀ : Set G) U K₀.toCompacts = 1

{K₀ : TopologicalSpace.PositiveCompacts G}

MeasureTheory.Measure.haar.prehaar (↑K₀) U K₀.toCompacts = 1


/-- The definition of the centroid. -/
theorem centroid_def (p : ι → P) : s.centroid k p = s.affineCombination k p (s.centroidWeights k)

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{ι : Type u_4}
(s : Finset ι)
(p : ι → P)

Finset.centroid k s p = (Finset.affineCombination k s p) (Finset.centroidWeights k s)


@[to_additive]
theorem Pi.mulHom_injective {γ : Type w} [Nonempty I] [∀ i, Mul (f i)] [Mul γ] (g : ∀ i, γ →ₙ* f i)
    (hg : ∀ i, Function.Injective (g i)) : Function.Injective (Pi.mulHom g)

(hg : ∀ (i : I), Function.Injective ⇑(g i))


@[simp]
theorem inf_singleton {b : β} : ({b} : Finset β).inf f = f b

{α : Type u_2}
{β : Type u_3}
[SemilatticeInf α]
[OrderTop α]
{f : β → α}
{b : β}


/-- Change a cone on `F.unop : J ⥤ C` into a cocone on `F : Jᵒᵖ ⥤ Cᵒᵖ`. -/
@[simps]
def coconeOfConeUnop (c : Cone F.unop) : Cocone F

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : Jᵒᵖ ⥤ Cᵒᵖ}
(c : CategoryTheory.Limits.Cone F.unop)

(CategoryTheory.Limits.coconeOfConeUnop c).ι = CategoryTheory.NatTrans.removeUnop c.π


/-- Pointwise maximum of two monotone functions is a monotone function. -/
protected theorem max [Preorder α] [LinearOrder β] {f g : α → β} (hf : Monotone f)
    (hg : Monotone g) :
    Monotone fun x => max (f x) (g x)

{α : Type u}
{β : Type v}
[Preorder α]
[LinearOrder β]
{f g : α → β}
(hf : Monotone f)
(hg : Monotone g)


theorem exists₂_imp : (∃ x h, P x h) → b ↔ ∀ x h, P x h → b

{α : Sort u_1}
{p : α → Prop}
{P : (x : α) → p x → Prop}
{b : Prop}

(∃ x h, P x h) → b ↔ ∀ (x : α) (h : p x), P x h → b


/-- The tagged partition made of boxes of `π` that satisfy predicate `p`. -/
@[simps! (config := .asFn)]
def filter (p : Box ι → Prop) : TaggedPrepartition I

{ι : Type u_1}
{I : BoxIntegral.Box ι}
(π : BoxIntegral.TaggedPrepartition I)
(p : BoxIntegral.Box ι → Prop)

(π.filter p).boxes.val = Multiset.filter p π.boxes.val


theorem MkCore.t_inv (h : MkCore) (i j : h.J) (x : h.V j i) : h.t i j ((h.t j i) x) = x

(h : TopCat.GlueData.MkCore)
(i j : h.J)
(x : ↥(h.V j i))


theorem tendsto_atTop_mono [Preorder β] {l : Filter α} {f g : α → β} (h : ∀ n, f n ≤ g n) :
    Tendsto f l atTop → Tendsto g l atTop

{α : Type u_3}
{β : Type u_4}
[Preorder β]
{l : Filter α}
{f g : α → β}
(h : ∀ (n : α), f n ≤ g n)

Filter.Tendsto f l Filter.atTop → Filter.Tendsto g l Filter.atTop


@[to_additive (attr := simp)]
protected theorem map_inv : f.map Inv.inv = f⁻¹


/-- This right homology map data expresses compatibilities of the right homology data
constructed by `RightHomologyData.ofEpiOfIsIsoOfMono'` -/
@[simps]
noncomputable def ofEpiOfIsIsoOfMono' (φ : S₁ ⟶ S₂) (h : RightHomologyData S₂)
    [Epi φ.τ₁] [IsIso φ.τ₂] [Mono φ.τ₃] :
    RightHomologyMapData φ (RightHomologyData.ofEpiOfIsIsoOfMono' φ h) h

(CategoryTheory.ShortComplex.RightHomologyMapData.ofEpiOfIsIsoOfMono' φ h).φH =
  CategoryTheory.CategoryStruct.id (CategoryTheory.ShortComplex.RightHomologyData.ofEpiOfIsIsoOfMono' φ h).H


/-- The counit isomorphism of the equivalence `(C ⥤ Karoubi D) ≌ (Karoubi C ⥤ Karoubi D)`. -/
@[simps!]
def KaroubiUniversal₁.counitIso :
    (whiskeringLeft C (Karoubi C) (Karoubi D)).obj (toKaroubi C) ⋙ functorExtension₁ C D ≅ 𝟭 _

(X : CategoryTheory.Functor (CategoryTheory.Idempotents.Karoubi C) (CategoryTheory.Idempotents.Karoubi D))

(P : CategoryTheory.Idempotents.Karoubi C)

(((CategoryTheory.Idempotents.KaroubiUniversal₁.counitIso C D).inv.app X).app P).f = (X.map P.decompId_i).f


lemma levyProkhorovDist_triangle [OpensMeasurableSpace Ω] (μ ν κ : Measure Ω)
    [IsFiniteMeasure μ] [IsFiniteMeasure ν] [IsFiniteMeasure κ] :
    levyProkhorovDist μ κ ≤ levyProkhorovDist μ ν + levyProkhorovDist ν κ

{Ω : Type u_2}
[MeasurableSpace Ω]
[PseudoEMetricSpace Ω]
[OpensMeasurableSpace Ω]
(μ ν κ : MeasureTheory.Measure Ω)
[MeasureTheory.IsFiniteMeasure μ]
[MeasureTheory.IsFiniteMeasure ν]
[MeasureTheory.IsFiniteMeasure κ]

MeasureTheory.levyProkhorovDist μ κ ≤ MeasureTheory.levyProkhorovDist μ ν + MeasureTheory.levyProkhorovDist ν κ


@[to_additive]
theorem mk'_eq_of_eq {a₁ b₁ : M} {a₂ b₂ : S} (H : ↑a₂ * b₁ = ↑b₂ * a₁) :
    f.mk' a₁ a₂ = f.mk' b₁ b₂

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
(f : S.LocalizationMap N)
{a₁ b₁ : M}
{a₂ b₂ : ↥S}
(H : ↑a₂ + b₁ = ↑b₂ + a₁)


@[simp] theorem zipWithAll_cons_cons :
    zipWithAll f (a :: as) (b :: bs) = f (some a) (some b) :: zipWithAll f as bs

∀ {α : Type u_1} {α_1 : Type u_2} {α_2 : Type u_3} {f : Option α → Option α_1 → α_2} {a : α} {as : List α} {b : α_1}
  {bs : List α_1}, List.zipWithAll f (a :: as) (b :: bs) = f (some a) (some b) :: List.zipWithAll f as bs


/-- Tagged prepartition with single box and prescribed tag. -/
@[simps! (config := .asFn)]
def single (I J : Box ι) (hJ : J ≤ I) (x : ι → ℝ) (h : x ∈ Box.Icc I) : TaggedPrepartition I

{ι : Type u_1}
(I J : BoxIntegral.Box ι)
(hJ : J ≤ I)
(x : ι → ℝ)
(h : x ∈ BoxIntegral.Box.Icc I)

(BoxIntegral.TaggedPrepartition.single I J hJ x h).tag = fun x_1 => x


@[to_additive] lemma Antivary.pow_right (hfg : Antivary f g) (n : ℕ) : Antivary f (g ^ n)

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedAddCommGroup α]
[LinearOrderedAddCommGroup β]
{f : ι → α}
{g : ι → β}
(hfg : Antivary f g)
(n : ℕ)


theorem cauchy₂ (f : CauSeq β abv) {ε} :
    0 < ε → ∃ i, ∀ j ≥ i, ∀ k ≥ i, abv (f j - f k) < ε

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
(f : CauSeq β abv)
{ε : α}

0 < ε → ∃ i, ∀ j ≥ i, ∀ k ≥ i, abv (↑f j - ↑f k) < ε


theorem revAt_zero (N : ℕ) : revAt N 0 = N


theorem mem_splitCenterBox {s : Set ι} {y : ι → ℝ} :
    y ∈ I.splitCenterBox s ↔ y ∈ I ∧ ∀ i, (I.lower i + I.upper i) / 2 < y i ↔ i ∈ s

{ι : Type u_1}
{I : BoxIntegral.Box ι}
{s : Set ι}
{y : ι → ℝ}

y ∈ I.splitCenterBox s ↔ y ∈ I ∧ ∀ (i : ι), (I.lower i + I.upper i) / 2 < y i ↔ i ∈ s


@[simp]
theorem coe_toEquiv (h : X ≃ₜ Y) : ⇑h.toEquiv = h

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(h : X ≃ₜ Y)


/-- The object in the category of `R`-bialgebras associated to an `R`-bialgebra. -/
@[simps]
def of (X : Type v) [Ring X] [Bialgebra R X] :
    BialgebraCat R

(R : Type u)
[CommRing R]
(X : Type v)
[Ring X]
[Bialgebra R X]

(BialgebraCat.of R X).str = inferInstance


theorem fract_add_le (a b : α) : fract (a + b) ≤ fract a + fract b

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

Int.fract (a + b) ≤ Int.fract a + Int.fract b


theorem prod_mono_right (s : Subsemiring R) : Monotone fun t : Subsemiring S => s.prod t

{R : Type u}
{S : Type v}
[NonAssocSemiring R]
[NonAssocSemiring S]
(s : Subsemiring R)


theorem Option.naturality [LawfulApplicative F] {α β} (f : α → F β) (x : Option α) :
    η (Option.traverse f x) = Option.traverse (@η _ ∘ f) x

{F G : Type u → Type u}
[Applicative F]
[Applicative G]
[LawfulApplicative G]
(η : ApplicativeTransformation F G)
[LawfulApplicative F]
{α : Type u_1}
{β : Type u}
(f : α → F β)
(x : Option α)

(fun {α} => η.app α) (Option.traverse f x) = Option.traverse ((fun {α} => η.app α) ∘ f) x


@[simp]
theorem isMax_iff_eq_top : IsMax a ↔ a = ⊤

{α : Type u}
[PartialOrder α]
[OrderTop α]
{a : α}


/-- If `μ` is a non-zero finite measure on `α`, `s` is a convex closed set in `E`, and `f` is an
integrable function sending `μ`-a.e. points to `s`, then the average value of `f` belongs to `s`:
`⨍ x, f x ∂μ ∈ s`. See also `Convex.centerMass_mem` for a finite sum version of this lemma. -/
theorem Convex.average_mem [IsFiniteMeasure μ] [NeZero μ] (hs : Convex ℝ s) (hsc : IsClosed s)
    (hfs : ∀ᵐ x ∂μ, f x ∈ s) (hfi : Integrable f μ) : (⨍ x, f x ∂μ) ∈ s

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[CompleteSpace E]
{μ : MeasureTheory.Measure α}
{s : Set E}
{f : α → E}
[MeasureTheory.IsFiniteMeasure μ]
[NeZero μ]
(hs : Convex ℝ s)
(hsc : IsClosed s)
(hfs : ∀ᵐ (x : α) ∂μ, f x ∈ s)
(hfi : MeasureTheory.Integrable f μ)


theorem head_le_of_lt [Preorder α] {a a' : α} {l l' : List α} (h : (a' :: l') < (a :: l)) :
    a' ≤ a

{α : Type u}
[Preorder α]
{a a' : α}
{l l' : List α}
(h : a' :: l' < a :: l)


{α : Type u_3}
[TopologicalSpace α]
{s : Set α}


/-- A split epi `f` coequalizes `(f ≫ section_ f)` and `(𝟙 X)`.
Here we build the cocone, and show in `isSplitEpiCoequalizes` that it is a colimit cocone.
-/
-- @[simps (config := { rhsMd := semireducible })] Porting note: no semireducible
@[simps!]
noncomputable def coconeOfIsSplitEpi : Cofork (𝟙 X) (f ≫ section_ f)

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

(CategoryTheory.Limits.coconeOfIsSplitEpi f).pt = Y


theorem geom_sum_pos_and_lt_one [StrictOrderedRing α] (hx : x < 0) (hx' : 0 < x + 1) (hn : 1 < n) :
    (0 < ∑ i ∈ range n, x ^ i) ∧ ∑ i ∈ range n, x ^ i < 1

{α : Type u}
{n : ℕ}
{x : α}
[StrictOrderedRing α]
(hx : x < 0)
(hx' : 0 < x + 1)
(hn : 1 < n)

0 < ∑ i ∈ Finset.range n, x ^ i ∧ ∑ i ∈ Finset.range n, x ^ i < 1


theorem ext_iff {f g : M [⋀^ι]→L[R] N} : f = g ↔ ∀ x, f x = g x

{R : Type u_1}
{M : Type u_2}
{N : Type u_4}
{ι : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace M]
[AddCommMonoid N]
[Module R N]
[TopologicalSpace N]
{f g : M [⋀^ι]→L[R] N}


theorem isTopologicalBasis_singletons (α : Type*) [TopologicalSpace α] [DiscreteTopology α] :
    IsTopologicalBasis { s | ∃ x : α, (s : Set α) = {x} }

(α : Type u_1)
[TopologicalSpace α]
[DiscreteTopology α]

TopologicalSpace.IsTopologicalBasis {s | ∃ x, s = {x}}


@[simp]
theorem gcd_mul_right_add_right (m n k : ℕ) : gcd m (k * m + n) = gcd m n


theorem coeff_truncFun (m : σ →₀ ℕ) (φ : MvPowerSeries σ R) :
    (truncFun n φ).coeff m = if m < n then coeff R m φ else 0

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
(n m : σ →₀ ℕ)
(φ : MvPowerSeries σ R)

MvPolynomial.coeff m (MvPowerSeries.truncFun n φ) = if m < n then (MvPowerSeries.coeff R m) φ else 0


theorem exists_smul_eq (hH : Nat.Coprime (Nat.card H) H.index) (α β : H.QuotientDiff) :
    ∃ h : H, h • α = β

∃ h, h • α = β


@[reassoc (attr := simp)]
theorem μ_inv_naturalityₗ {m n m' : M} (f : m ⟶ m') (X : C) :
    (F.μIso m n).inv.app X ≫ (F.obj n).map ((F.map f).app X) =
      (F.map (f ▷ n)).app X ≫ (F.μIso m' n).inv.app X

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

CategoryTheory.CategoryStruct.comp ((F.μIso m n).inv.app X) ((F.obj n).map ((F.map f).app X)) =
  CategoryTheory.CategoryStruct.comp ((F.map (CategoryTheory.MonoidalCategory.whiskerRight f n)).app X)
    ((F.μIso m' n).inv.app X)


@[to_additive (attr := simp)]
theorem comap_inclusion_subgroupOf {K₁ K₂ : Subgroup G} (h : K₁ ≤ K₂) (H : Subgroup G) :
    (H.subgroupOf K₂).comap (inclusion h) = H.subgroupOf K₁

{G : Type u_1}
[Group G]
{K₁ K₂ : Subgroup G}
(h : K₁ ≤ K₂)
(H : Subgroup G)

Subgroup.comap (Subgroup.inclusion h) (H.subgroupOf K₂) = H.subgroupOf K₁


@[simp]
theorem nearestPtInd_zero (e : ℕ → α) : nearestPtInd e 0 = const α 0

{α : Type u_1}
[MeasurableSpace α]
[PseudoEMetricSpace α]
[OpensMeasurableSpace α]
(e : ℕ → α)

MeasureTheory.SimpleFunc.nearestPtInd e 0 = MeasureTheory.SimpleFunc.const α 0


@[fun_prop]
nonrec theorem HasFDerivAt.prod (hf₁ : HasFDerivAt f₁ f₁' x) (hf₂ : HasFDerivAt f₂ f₂' x) :
    HasFDerivAt (fun x => (f₁ x, f₂ x)) (f₁'.prod f₂') x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{f₁ : E → F}
{f₁' : E →L[𝕜] F}
{x : E}
{f₂ : E → G}
{f₂' : E →L[𝕜] G}
(hf₁ : HasFDerivAt f₁ f₁' x)
(hf₂ : HasFDerivAt f₂ f₂' x)


@[simp, norm_cast]
lemma natCast_arg {n : ℕ} : arg n = 0


theorem sum_update_add [AddCommMonoid α] [AddCommMonoid β] (f : ι →₀ α) (i : ι) (a : α)
    (g : ι → α → β) (hg : ∀ i, g i 0 = 0)
    (hgg : ∀ (j : ι) (a₁ a₂ : α), g j (a₁ + a₂) = g j a₁ + g j a₂) :
    (f.update i a).sum g + g i (f i) = f.sum g + g i a

(f : ι →₀ α)

(g : ι → α → β)


@[simp] theorem toArrayAux_eq (as : List α) (acc : Array α) : (as.toArrayAux acc).data = acc.data ++ as

{α : Type u_1}
(as : List α)
(acc : Array α)


@[simp]
theorem sin_add_nat_mul_two_pi (x : ℝ) (n : ℕ) : sin (x + n * (2 * π)) = sin x

Real.sin (x + ↑n * (2 * Real.pi)) = Real.sin x


@[reassoc, elementwise nosimp]
theorem germ_stalkSpecializes' (F : X.Presheaf C) {U : Opens X} {x y : X} (h : x ⤳ y)
    (hy : y ∈ U) : F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, h.mem_open U.isOpen hy⟩

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Limits.HasColimits C]
{X : TopCat}
(F : TopCat.Presheaf C X)
{U : TopologicalSpace.Opens ↑X}
{x y : ↑X}
(h : x ⤳ y)
(hy : y ∈ U)

F.germ ⟨y, hy⟩ ≫ F.stalkSpecializes h = F.germ ⟨x, ⋯⟩


theorem mem_wf : @WellFounded ZFSet (· ∈ ·)


theorem ncard_insert_of_mem {a : α} (h : a ∈ s) : ncard (insert a s) = s.ncard

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


/-- Evaluation of functions into an indexed collection of monoids at a point is a monoid
homomorphism.
This is `Function.eval i` as a `MonoidHom`. -/
@[to_additive (attr := simps) "Evaluation of functions into an indexed collection of additive
monoids at a point is an additive monoid homomorphism. This is `Function.eval i` as an
`AddMonoidHom`."]
def Pi.evalMonoidHom (i : I) : (∀ i, f i) →* f i

{I : Type u}
(f : I → Type v)
[(i : I) → MulOneClass (f i)]
(i : I)
(g : (i : I) → f i)


@[reassoc (attr := simp)]
theorem comp_liftNatTrans (F₁ F₂ F₃ : C ⥤ E) (F₁' F₂' F₃' : D ⥤ E) [h₁ : Lifting L W F₁ F₁']
    [h₂ : Lifting L W F₂ F₂'] [h₃ : Lifting L W F₃ F₃'] (τ : F₁ ⟶ F₂) (τ' : F₂ ⟶ F₃) :
    liftNatTrans L W F₁ F₂ F₁' F₂' τ ≫ liftNatTrans L W F₂ F₃ F₂' F₃' τ' =
      liftNatTrans L W F₁ F₃ F₁' F₃' (τ ≫ τ')

(F₁' F₂' F₃' : CategoryTheory.Functor D E)

[h₁ : CategoryTheory.Localization.Lifting L W F₁ F₁']

[h₂ : CategoryTheory.Localization.Lifting L W F₂ F₂']

[h₃ : CategoryTheory.Localization.Lifting L W F₃ F₃']

CategoryTheory.CategoryStruct.comp (CategoryTheory.Localization.liftNatTrans L W F₁ F₂ F₁' F₂' τ)
    (CategoryTheory.Localization.liftNatTrans L W F₂ F₃ F₂' F₃' τ') =
  CategoryTheory.Localization.liftNatTrans L W F₁ F₃ F₁' F₃' (CategoryTheory.CategoryStruct.comp τ τ')


theorem sq_dvd_add_pow_sub_sub (p x : R) (n : ℕ) :
    p ^ 2 ∣ (x + p) ^ n - x ^ (n - 1) * p * n - x ^ n

{R : Type u_1}
[CommRing R]
(p x : R)
(n : ℕ)


@[to_additive]
theorem injective_noncommPiCoprod_of_independent
    {hcomm : Pairwise fun i j : ι => ∀ x y : G, x ∈ H i → y ∈ H j → Commute x y}
    (hind : CompleteLattice.Independent H) :
    Function.Injective (noncommPiCoprod hcomm)

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


theorem isNClique_map_iff (hn : 1 < n) {t : Finset β} {f : α ↪ β} :
    (G.map f).IsNClique n t ↔ ∃ s : Finset α, G.IsNClique n s ∧ s.map f = t

{α : Type u_1}
{β : Type u_2}
{G : SimpleGraph α}
{n : ℕ}
(hn : 1 < n)
{t : Finset β}
{f : α ↪ β}

(SimpleGraph.map f G).IsNClique n t ↔ ∃ s, G.IsNClique n s ∧ Finset.map f s = t


/-- Cancellation of a telescoping product. -/
@[to_additive "Cancellation of a telescoping sum."]
theorem prod_range_div (n : ℕ) (f : ℕ → G) :
    ((range n).map fun k ↦ f (k + 1) / f k).prod = f n / f 0

{G : Type u_7}
[AddCommGroup G]
(n : ℕ)
(f : ℕ → G)

(List.map (fun k => f (k + 1) - f k) (List.range n)).sum = f n - f 0


/-- `trace` distributes over `Matrix.kroneckerMapBilinear`.

This is primarily used with `R = ℕ` to prove `Matrix.trace_kronecker`. -/
theorem trace_kroneckerMapBilinear [CommSemiring R] [Fintype m] [Fintype n] [AddCommMonoid α]
    [AddCommMonoid β] [AddCommMonoid γ] [Module R α] [Module R β] [Module R γ]
    (f : α →ₗ[R] β →ₗ[R] γ) (A : Matrix m m α) (B : Matrix n n β) :
    trace (kroneckerMapBilinear f A B) = f (trace A) (trace B)

{R : Type u_1}
{α : Type u_2}
{β : Type u_4}
{γ : Type u_6}
{m : Type u_9}
{n : Type u_10}
[CommSemiring R]
[Fintype m]
[Fintype n]
[AddCommMonoid α]
[AddCommMonoid β]
[AddCommMonoid γ]
[Module R α]
[Module R β]
[Module R γ]
(f : α →ₗ[R] β →ₗ[R] γ)
(A : Matrix m m α)
(B : Matrix n n β)

(((Matrix.kroneckerMapBilinear f) A) B).trace = (f A.trace) B.trace


/-- **Roth's theorem** for `ℕ`.

The maximum density of a 3AP-free set in `{1, ..., n}` goes to zero as `n` tends to infinity. -/
theorem roth_3ap_theorem_nat (ε : ℝ) (hε : 0 < ε) (hG : cornersTheoremBound (ε / 3) ≤ n)
    (A : Finset ℕ) (hAn : A ⊆ range n) (hAε : ε * n ≤ A.card) : ¬ ThreeAPFree (A : Set ℕ)

{n : ℕ}
(ε : ℝ)
(hε : 0 < ε)
(hG : cornersTheoremBound (ε / 3) ≤ n)
(A : Finset ℕ)
(hAn : A ⊆ Finset.range n)
(hAε : ε * ↑n ≤ ↑A.card)


theorem Memℒp.of_nnnorm_le_mul {f : α → E} {g : α → F} {c : ℝ≥0} (hg : Memℒp g p μ)
    (hf : AEStronglyMeasurable f μ) (hfg : ∀ᵐ x ∂μ, ‖f x‖₊ ≤ c * ‖g x‖₊) : Memℒp f p μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

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


theorem lintegral_finset_sum (s : Finset β) {f : β → α → ℝ≥0∞} (hf : ∀ b ∈ s, Measurable (f b)) :
    ∫⁻ a, ∑ b ∈ s, f b a ∂μ = ∑ b ∈ s, ∫⁻ a, f b a ∂μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(s : Finset β)
{f : β → α → ℝ≥0∞}
(hf : ∀ b ∈ s, Measurable (f b))

∫⁻ (a : α), ∑ b ∈ s, f b a ∂μ = ∑ b ∈ s, ∫⁻ (a : α), f b a ∂μ


lemma copy_eq {S} (hmem : ∀ s, s ∈ S ↔ s ∈ f) : f.copy S hmem = f

{α : Type u}
{f : Filter α}
{S : Set (Set α)}
(hmem : ∀ (s : Set α), s ∈ S ↔ s ∈ f)


theorem _root_.biInf_finsetSigma [CompleteLattice β] (s : Finset ι) (t : ∀ i, Finset (α i))
    (f : Sigma α → β) : ⨅ ij ∈ s.sigma t, f ij = ⨅ (i ∈ s) (j ∈ t i), f ⟨i, j⟩

{ι : Type u_1}
{α : ι → Type u_2}
{β : Type u_3}
[CompleteLattice β]
(s : Finset ι)
(t : (i : ι) → Finset (α i))
(f : Sigma α → β)

⨅ ij ∈ s.sigma t, f ij = ⨅ i ∈ s, ⨅ j ∈ t i, f ⟨i, j⟩


theorem integralClosure.mem_lifts_of_monic_of_dvd_map {f : R[X]} (hf : f.Monic) {g : K[X]}
    (hg : g.Monic) (hd : g ∣ f.map (algebraMap R K)) :
    g ∈ lifts (algebraMap (integralClosure R K) K)

(hd : g ∣ Polynomial.map (algebraMap R K) f)

g ∈ Polynomial.lifts (algebraMap (↥(integralClosure R K)) K)


@[simp] theorem run_monadLift {α σ : Type u} [Monad m] [MonadLiftT n m] (x : n α) (s : σ) : (monadLift x : StateT σ m α).run s = (monadLift x : m α) >>= fun a => pure (a, s)

{m : Type u → Type u_1}
{n : Type u → Type u_2}
{α σ : Type u}
[Monad m]
[MonadLiftT n m]
(x : n α)
(s : σ)

(monadLift x).run s = do
  let a ← monadLift x
  pure (a, s)


theorem LipschitzOnWith.comp_boundedVariationOn {f : E → F} {C : ℝ≥0} {t : Set E}
    (hf : LipschitzOnWith C f t) {g : α → E} {s : Set α} (hg : MapsTo g s t)
    (h : BoundedVariationOn g s) : BoundedVariationOn (f ∘ g) s

{α : Type u_1}
[LinearOrder α]
{E : Type u_2}
[PseudoEMetricSpace E]
{F : Type u_3}
[PseudoEMetricSpace F]
{f : E → F}
{C : ℝ≥0}
{t : Set E}
(hf : LipschitzOnWith C f t)
{g : α → E}
{s : Set α}
(hg : Set.MapsTo g s t)
(h : BoundedVariationOn g s)


theorem abs_circleTransformBoundingFunction_le {R r : ℝ} (hr : r < R) (hr' : 0 ≤ r) (z : ℂ) :
    ∃ x : closedBall z r ×ˢ [[0, 2 * π]], ∀ y : closedBall z r ×ˢ [[0, 2 * π]],
    abs (circleTransformBoundingFunction R z y) ≤ abs (circleTransformBoundingFunction R z x)

∃ x,
  ∀ (y : ↑(Metric.closedBall z r ×ˢ [[0, 2 * π]])),
    Complex.abs (Complex.circleTransformBoundingFunction R z ↑y) ≤
      Complex.abs (Complex.circleTransformBoundingFunction R z ↑x)


theorem Ico_union_Ici (h : c ≤ max a b) : Ico a b ∪ Ici c = Ici (min a c)

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

Set.Ico a b ∪ Set.Ici c = Set.Ici (min a c)


theorem any_def {p : α → Bool} (as : Array α) : as.any p = as.data.any p

{α : Type u_1}
{p : α → Bool}
(as : Array α)


theorem BlockTriangular.sub (hM : BlockTriangular M b) (hN : BlockTriangular N b) :
    BlockTriangular (M - N) b

{α : Type u_1}
{m : Type u_3}
{R : Type v}
[CommRing R]
{M N : Matrix m m R}
{b : m → α}
[LT α]
(hM : M.BlockTriangular b)
(hN : N.BlockTriangular b)


/-- `LinearMap.restrictScalars` as a `LinearMap`. -/
@[simps apply]
def restrictScalarsₗ : (M →ₗ[S] N) →ₗ[R₁] M →ₗ[R] N

{R : Type u_17}
{S : Type u_18}
{M : Type u_19}
(N : Type u_20)
[Semiring R]
[Semiring S]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
[Module S M]
[Module S N]
[LinearMap.CompatibleSMul M N R S]
{R₁ : Type u_21}
[Semiring R₁]
[Module R₁ N]
[SMulCommClass S R₁ N]
[SMulCommClass R R₁ N]
(fₗ : M →ₗ[S] N)

(LinearMap.restrictScalarsₗ N) fₗ = ↑R fₗ


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


theorem set_eq_take_append_cons_drop {l : List α} {n : Nat} {a : α} :
    l.set n a = if n < l.length then l.take n ++ a :: l.drop (n + 1) else l

{α : Type u_1}
{l : List α}
{n : Nat}
{a : α}

l.set n a = if n < l.length then List.take n l ++ a :: List.drop (n + 1) l else l


/-- If `f` is a strictly antitone map and `f x < x` at some point `x`, then the iterates `f^[n] x`
form a strictly antitone sequence. -/
theorem strictAnti_iterate_of_map_lt (hf : StrictMono f) (hx : f x < x) :
    StrictAnti fun n => f^[n] x

{α : Type u_1}
[Preorder α]
{f : α → α}
{x : α}
(hf : StrictMono f)
(hx : f x < x)


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

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


theorem WithSeminorms.withSeminorms_eq {p : SeminormFamily 𝕜 E ι} [t : TopologicalSpace E]
    (hp : WithSeminorms p) : t = p.moduleFilterBasis.topology

{𝕜 : Type u_1}
{E : Type u_5}
{ι : Type u_8}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[Nonempty ι]
{p : SeminormFamily 𝕜 E ι}
[t : TopologicalSpace E]
(hp : WithSeminorms p)


/-- If the outer subtype has more restrictive predicate than the inner one,
then we can drop the latter. -/
@[simps!]
def subtypeSubtypeEquivSubtype {p q : α → Prop} (h : ∀ {x}, q x → p x) :
    { x : Subtype p // q x.1 } ≃ Subtype q

{α : Type u_1}
{p q : α → Prop}
(h : ∀ {x : α}, q x → p x)

∀ (a : { x // q ↑x }), ↑((Equiv.subtypeSubtypeEquivSubtype h) a) = ↑↑a


theorem comp_differentiableAt_iff {f : G → E} {x : G} :
    DifferentiableAt 𝕜 (iso ∘ f) x ↔ DifferentiableAt 𝕜 f x

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

DifferentiableAt 𝕜 (⇑iso ∘ f) x ↔ DifferentiableAt 𝕜 f x


@[simp]
theorem eval₂Hom_C (f : R →+* S₁) (g : σ → S₁) (r : R) : eval₂Hom f g (C r) = f r

{R : Type u}
{S₁ : Type v}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₁]
(f : R →+* S₁)
(g : σ → S₁)
(r : R)

(MvPolynomial.eval₂Hom f g) (MvPolynomial.C r) = f r


lemma CompleteLattice.independent_iff_supIndep_of_injOn {ι : Type*} {f : ι → α}
    (hf : InjOn f {i | f i ≠ ⊥}) :
    CompleteLattice.Independent f ↔ ∀ (s : Finset ι), s.SupIndep f

{α : Type u_2}
[CompleteLattice α]
[IsCompactlyGenerated α]
{ι : Type u_3}
{f : ι → α}
(hf : Set.InjOn f {i | f i ≠ ⊥})


/-- A lax functor `F` between bicategories `B` and `C` consists of a function between objects
`F.obj`, a function between 1-morphisms `F.map`, and a function between 2-morphisms `F.map₂`.

Unlike functors between categories, `F.map` do not need to strictly commute with the composition,
and do not need to strictly preserve the identity. Instead, there are specified 2-morphisms
`𝟙 (F.obj a) ⟶ F.map (𝟙 a)` and `F.map f ≫ F.map g ⟶ F.map (f ≫ g)`.

`F.map₂` strictly commute with compositions and preserve the identity. They also preserve the
associator, the left unitor, and the right unitor modulo some adjustments of domains and codomains
of 2-morphisms.
-/
structure LaxFunctor (B: Type u₁) [Bicategory.{w₁, v₁} B] (C : Type u₂) [Bicategory.{w₂, v₂} C]
    extends PrelaxFunctor B C where
  /-- The 2-morphism underlying the lax unity constraint. -/
  mapId (a : B) : 𝟙 (obj a) ⟶ map (𝟙 a)
  /-- The 2-morphism underlying the lax functoriality constraint. -/
  mapComp {a b c : B} (f : a ⟶ b) (g : b ⟶ c) : map f ≫ map g ⟶ map (f ≫ g)
  /-- Naturality of the lax functoriality constraight, on the left. -/
  mapComp_naturality_left :
    ∀ {a b c : B} {f f' : a ⟶ b} (η : f ⟶ f') (g : b ⟶ c),
      mapComp f g ≫ map₂ (η ▷ g) = map₂ η ▷ map g ≫ mapComp f' g:= by aesop_cat
  /-- Naturality of the lax functoriality constraight, on the right. -/
  mapComp_naturality_right :
    ∀ {a b c : B} (f : a ⟶ b) {g g' : b ⟶ c} (η : g ⟶ g'),
     mapComp f g ≫ map₂ (f ◁ η) = map f ◁ map₂ η ≫ mapComp f g' := by aesop_cat
  /-- Lax associativity -/
  map₂_associator :
    ∀ {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d),
      mapComp f g ▷ map h ≫ mapComp (f ≫ g) h ≫ map₂ (α_ f g h).hom =
      (α_ (map f) (map g) (map h)).hom ≫ map f ◁ mapComp g h ≫ mapComp f (g ≫ h) := by aesop_cat
  /-- Lax left unity -/
  map₂_leftUnitor :
    ∀ {a b : B} (f : a ⟶ b),
      map₂ (λ_ f).inv = (λ_ (map f)).inv ≫ mapId a ▷ map f ≫ mapComp (𝟙 a) f := by aesop_cat
  /-- Lax right unity -/
  map₂_rightUnitor :
    ∀ {a b : B} (f : a ⟶ b),
      map₂ (ρ_ f).inv = (ρ_ (map f)).inv ≫ map f ◁ mapId b ≫ mapComp f (𝟙 b) := by aesop_cat

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(self : CategoryTheory.LaxFunctor B C)
{a b : B}
(f : a ⟶ b)

self.map₂ (CategoryTheory.Bicategory.leftUnitor f).inv =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.leftUnitor (self.map f)).inv
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight (self.mapId a) (self.map f))
      (self.mapComp (CategoryTheory.CategoryStruct.id a) f))


@[simp]
theorem bot_ne_top : (⊥ : α) ≠ ⊤

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


/-- A function which is continuous on a set `s` is almost everywhere measurable with respect to
`μ.restrict s`. -/
theorem ContinuousOn.aemeasurable [TopologicalSpace α] [OpensMeasurableSpace α] [MeasurableSpace β]
    [TopologicalSpace β] [BorelSpace β] {f : α → β} {s : Set α} {μ : Measure α}
    (hf : ContinuousOn f s) (hs : MeasurableSet s) : AEMeasurable f (μ.restrict s)

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[TopologicalSpace α]
[OpensMeasurableSpace α]
[MeasurableSpace β]
[TopologicalSpace β]
[BorelSpace β]
{f : α → β}
{s : Set α}
{μ : MeasureTheory.Measure α}
(hf : ContinuousOn f s)
(hs : MeasurableSet s)


theorem Asymptotics.IsBigO.continuousMultilinearMap_apply_eq_zero {n : ℕ} {p : E[×n]→L[𝕜] F}
    (h : (fun y => p fun _ => y) =O[𝓝 0] fun y => ‖y‖ ^ (n + 1)) (y : E) : (p fun _ => y) = 0

{p : ContinuousMultilinearMap 𝕜 (fun i => E) F}

(h : (fun y => p fun x => y) =O[𝓝 0] fun y => ‖y‖ ^ (n + 1))


theorem iInf_eq_of_tendsto {α} [TopologicalSpace α] [CompleteLinearOrder α] [OrderTopology α]
    [Nonempty β] [SemilatticeSup β] {f : β → α} {a : α} (hf : Antitone f) :
    Tendsto f atTop (𝓝 a) → iInf f = a

{β : Type u_2}
{α : Type u_3}
[TopologicalSpace α]
[CompleteLinearOrder α]
[OrderTopology α]
[Nonempty β]
[SemilatticeSup β]
{f : β → α}
{a : α}
(hf : Antitone f)

Filter.Tendsto f Filter.atTop (𝓝 a) → iInf f = a


@[simp] theorem size_set (a : Array α) (i : Fin a.size) (v : α) : (set a i v).size = a.size

{α : Type u}
(a : Array α)
(i : Fin a.size)
(v : α)


@[simp]
theorem canonicalEquiv_symm : (canonicalEquiv S P P').symm = canonicalEquiv S P' P

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

(FractionalIdeal.canonicalEquiv S P P').symm = FractionalIdeal.canonicalEquiv S P' P


theorem archimedean_iff_int_lt : Archimedean α ↔ ∀ x : α, ∃ n : ℤ, x < n


@[to_additive (attr := simp)]
theorem coe_one : ((1 : α →ᵇ β) : α → β) = 1

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
[Zero β]


lemma divNat_mul_right {a : ℕ} (ha : a ≠ 0) (n d : ℕ) : divNat (n * a) (d * a) = divNat n d

NNRat.divNat (n * a) (d * a) = NNRat.divNat n d


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

{α : Type u_1}
{a : α}
{s : Finset α}
{h : a ∉ s}


protected theorem ext_iff : f = g ↔ ∀ x, f x = g x

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


@[to_additive]
theorem smooth_mul : Smooth (I.prod I) I fun p : G × G => p.1 * p.2

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


/-- The trace of an endomorphism is invariant under conjugation -/
@[simp]
theorem trace_conj (g : M →ₗ[R] M) (f : (M →ₗ[R] M)ˣ) :
    trace R M (↑f * g * ↑f⁻¹) = trace R M g

(R : Type u)
[CommSemiring R]
{M : Type v}
[AddCommMonoid M]
[Module R M]
(g : M →ₗ[R] M)
(f : (M →ₗ[R] M)ˣ)

(LinearMap.trace R M) (↑f * g * ↑f⁻¹) = (LinearMap.trace R M) g


theorem continuousAt_of_dominated {F : X → α → G} {x₀ : X} {bound : α → ℝ}
    (hF_meas : ∀ᶠ x in 𝓝 x₀, AEStronglyMeasurable (F x) μ)
    (h_bound : ∀ᶠ x in 𝓝 x₀, ∀ᵐ a ∂μ, ‖F x a‖ ≤ bound a) (bound_integrable : Integrable bound μ)
    (h_cont : ∀ᵐ a ∂μ, ContinuousAt (fun x => F x a) x₀) :
    ContinuousAt (fun x => ∫ a, F x a ∂μ) x₀

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

(h_bound : ∀ᶠ (x : X) in 𝓝 x₀, ∀ᵐ (a : α) ∂μ, ‖F x a‖ ≤ bound a)

(bound_integrable : MeasureTheory.Integrable bound μ)

(h_cont : ∀ᵐ (a : α) ∂μ, ContinuousAt (fun x => F x a) x₀)

ContinuousAt (fun x => ∫ (a : α), F x a ∂μ) x₀


theorem insert.valid [IsTotal α (· ≤ ·)] [@DecidableRel α (· ≤ ·)] (x : α) {t} (h : Valid t) :
    Valid (Ordnode.insert x t)

{α : Type u_1}
[Preorder α]
[IsTotal α fun x x_1 => x ≤ x_1]
[DecidableRel fun x x_1 => x ≤ x_1]
(x : α)
{t : Ordnode α}
(h : t.Valid)


theorem HEq.symm (h : HEq a b) : HEq b a

{α β : Sort u}
{a : α}
{b : β}
(h : HEq a b)


@[to_additive]
theorem hasProd_nat_add_iff' {f : ℕ → G} (k : ℕ) :
    HasProd (fun n ↦ f (n + k)) (g / ∏ i ∈ range k, f i) ↔ HasProd f g

{G : Type u_2}
[CommGroup G]
{g : G}
[TopologicalSpace G]
[TopologicalGroup G]
{f : ℕ → G}
(k : ℕ)

HasProd (fun n => f (n + k)) (g / ∏ i ∈ Finset.range k, f i) ↔ HasProd f g


/-- Typeclass for expressing that a type `M` with addition and a zero satisfies
`0 + a = a` and `a + 0 = a` for all `a : M`. -/
class AddZeroClass (M : Type u) extends Zero M, Add M where
  /-- Zero is a left neutral element for addition -/
  protected zero_add : ∀ a : M, 0 + a = a
  /-- Zero is a right neutral element for addition -/
  protected add_zero : ∀ a : M, a + 0 = a

{M : Type u}
[self : AddZeroClass M]
(a : M)


lemma mul_mem_left (x y) (hy : y ∈ I) : x * y ∈ I

{R : Type u_1}
[NonUnitalNonAssocRing R]
(I : TwoSidedIdeal R)
(x y : R)
(hy : y ∈ I)


theorem prev_eq' (c : ComplexShape ι) {i j : ι} (h : c.Rel i j) : c.prev j = i

{ι : Type u_1}
(c : ComplexShape ι)
{i j : ι}
(h : c.Rel i j)


{R : Type u}
{S : Type v}
{F : Type u_1}
[Semiring R]
[Semiring S]
[FunLike F R S]
[rc : RingHomClass F R S]
(f : F)


@[simp]
theorem lid_symm_apply (m : M) : (TensorProduct.lid R M).symm m = 1 ⊗ₜ m

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
[AddCommMonoid M]
[Module R M]
(m : M)

(TensorProduct.lid R M).symm m = 1 ⊗ₜ[R] m


lemma isUnit_aeval_of_isUnit_aeval_of_isNilpotent_sub
    (hb : IsUnit (aeval b P)) (hab : IsNilpotent (a - b)) :
    IsUnit (aeval a P)

{R : Type u_2}
{S : Type u_3}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Polynomial R}
{a b : S}
(hb : IsUnit ((Polynomial.aeval b) P))
(hab : IsNilpotent (a - b))


@[to_additive]
protected theorem congr_fun {f g : MulEquiv M N} (h : f = g) (x : M) : f x = g x

{M : Type u_6}
{N : Type u_7}
[Mul M]
[Mul N]
{f g : M ≃* N}
(h : f = g)
(x : M)


@[simp]
theorem coe_toLieSubmodule : (K.toLieSubmodule : Submodule R L) = K

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


/-- The "most used" implication of `mul_and_mul_iff`, with split hypotheses, instead of `∧`. -/
@[to_additive "The \"most used\" implication of `add_and_add_iff`, with split
hypotheses, instead of `∧`."]
theorem IsRegular.and_of_mul_of_mul (ab : IsRegular (a * b)) (ba : IsRegular (b * a)) :
    IsRegular a ∧ IsRegular b

{R : Type u_1}
[AddSemigroup R]
{a b : R}
(ab : IsAddRegular (a + b))
(ba : IsAddRegular (b + a))


theorem forall_le_iff {P : α → Prop} {x₀ : α} (hP : Antitone P) :
    (∀ x ≤ x₀, P x) ↔ P x₀

{α : Type u}
[Preorder α]
{P : α → Prop}
{x₀ : α}
(hP : Antitone P)


@[deprecated toNat_le_toNat (since := "2024-02-15")]
theorem toNat_le_of_le_of_lt_aleph0 (hd : d < ℵ₀) (hcd : c ≤ d) :
    toNat c ≤ toNat d

{c d : Cardinal.{u}}
(hd : d < Cardinal.aleph0)
(hcd : c ≤ d)


/-- The composition of Lipschitz functions is Lipschitz. -/
protected theorem comp {Kf Kg : ℝ≥0} {f : β → γ} {g : α → β} (hf : LipschitzWith Kf f)
    (hg : LipschitzWith Kg g) : LipschitzWith (Kf * Kg) (f ∘ g)

{α : Type u}
{β : Type v}
{γ : Type w}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
[PseudoEMetricSpace γ]
{Kf Kg : ℝ≥0}
{f : β → γ}
{g : α → β}
(hf : LipschitzWith Kf f)
(hg : LipschitzWith Kg g)


/-- If `e : C ≌ D` is an equivalence of categories, then `functoriality F e.functor` induces an
equivalence between cones over `F` and cones over `F ⋙ e.functor`.
-/
@[simps]
def functorialityEquivalence (e : C ≌ D) : Cone F ≌ Cone (F ⋙ e.functor)

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

(CategoryTheory.Limits.Cones.functorialityEquivalence F e).functor =
  CategoryTheory.Limits.Cones.functoriality F e.functor


theorem mem_nonZeroDivisors_iff_ne_zero [NoZeroDivisors M] [Nontrivial M] {x : M} :
    x ∈ M⁰ ↔ x ≠ 0

{M : Type u_2}
[MonoidWithZero M]
[NoZeroDivisors M]
[Nontrivial M]
{x : M}

x ∈ M⁰ ↔ x ≠ 0


@[reassoc (attr := simp)]
lemma asIsoHomologyπ_inv_comp_homologyπ (hf : S.f = 0) [S.HasHomology] :
    (S.asIsoHomologyπ hf).inv ≫ S.homologyπ = 𝟙 _

CategoryTheory.CategoryStruct.comp (S.asIsoHomologyπ hf).inv S.homologyπ = CategoryTheory.CategoryStruct.id S.homology


@[simp]
theorem Sigma.curry_uncurry {γ : ∀ a, β a → Type*} (f : ∀ (x) (y : β x), γ x y) :
    Sigma.curry (Sigma.uncurry f) = f

{α : Type u_1}
{β : α → Type u_4}
{γ : (a : α) → β a → Type u_7}
(f : (x : α) → (y : β x) → γ x y)


/-- If `s` is Borel-measurable in a Polish space and `f` is continuous injective on `s`, then
the restriction of `f` to `s` is a measurable embedding. -/
theorem _root_.ContinuousOn.measurableEmbedding [BorelSpace β]
    [TopologicalSpace γ] [PolishSpace γ] [MeasurableSpace γ] [BorelSpace γ]
    (hs : MeasurableSet s) (f_cont : ContinuousOn f s)
    (f_inj : InjOn f s) : MeasurableEmbedding (s.restrict f)

{γ : Type u_3}
{β : Type u_5}
[tβ : TopologicalSpace β]
[T2Space β]
[MeasurableSpace β]
{s : Set γ}
{f : γ → β}
[BorelSpace β]
[TopologicalSpace γ]
[PolishSpace γ]
[MeasurableSpace γ]
[BorelSpace γ]
(hs : MeasurableSet s)
(f_cont : ContinuousOn f s)
(f_inj : Set.InjOn f s)


theorem symm_comp_deriv {x : M} (hx : x ∈ e.source) :
    (mfderiv I' I e.symm (e x)).comp (mfderiv I I' e x) =
      ContinuousLinearMap.id 𝕜 (TangentSpace I x)

(he : PartialHomeomorph.MDifferentiable I I' e)

(mfderiv I' I (↑e.symm) (↑e x)).comp (mfderiv I I' (↑e) x) = ContinuousLinearMap.id 𝕜 (TangentSpace I x)


theorem self_eq_mass_smul_normalize : μ = μ.mass • μ.normalize.toFiniteMeasure

{Ω : Type u_1}
[Nonempty Ω]
{m0 : MeasurableSpace Ω}
(μ : MeasureTheory.FiniteMeasure Ω)


theorem fromOpenSubsetsGlue_isOpenMap : IsOpenMap (fromOpenSubsetsGlue U)

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


@[to_additive]
nonrec theorem SmoothOn.mul (hf : SmoothOn I' I f s) (hg : SmoothOn I' I g s) :
    SmoothOn I' I (f * g) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[Add G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothAdd I G]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_7}
[TopologicalSpace M]
[ChartedSpace H' M]
{f g : M → G}
{s : Set M}
(hf : SmoothOn I' I f s)
(hg : SmoothOn I' I g s)


theorem toLin'_injective :
    Function.Injective ↑(toLin' : SpecialLinearGroup n R →* (n → R) ≃ₗ[R] n → R)

{n : Type u}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]


/-- The value of the quadratic character at `2` -/
theorem quadraticChar_two [DecidableEq F] (hF : ringChar F ≠ 2) :
    quadraticChar F 2 = χ₈ (Fintype.card F)

{F : Type u_1}
[Field F]
[Fintype F]
[DecidableEq F]
(hF : ringChar F ≠ 2)

(quadraticChar F) 2 = ZMod.χ₈ ↑(Fintype.card F)


/-- If `f` is an integrable periodic function with period `T`, and `n` is an integer, then its
integral over `[t, t + n • T]` is `n` times its integral over `[t, t + T]`. -/
theorem intervalIntegral_add_zsmul_eq (hf : Periodic f T) (n : ℤ) (t : ℝ)
    (h_int : ∀ t₁ t₂, IntervalIntegrable f MeasureSpace.volume t₁ t₂) :
    ∫ x in t..t + n • T, f x = n • ∫ x in t..t + T, f x

(h_int : ∀ (t₁ t₂ : ℝ), IntervalIntegrable f MeasureTheory.volume t₁ t₂)

∫ (x : ℝ) in t..t + n • T, f x = n • ∫ (x : ℝ) in t..t + T, f x


theorem mk_mem_sym2_iff : s(a, b) ∈ s.sym2 ↔ a ∈ s ∧ b ∈ s


@[simp]
theorem isoOfComponents_app (f : ∀ i, C₁.X i ≅ C₂.X i)
    (hf : ∀ i j, c.Rel i j → (f i).hom ≫ C₂.d i j = C₁.d i j ≫ (f j).hom) (i : ι) :
    isoApp (isoOfComponents f hf) i = f i

(hf : ∀ (i j : ι), c.Rel i j → (f i).hom ≫ C₂.d i j = C₁.d i j ≫ (f j).hom)

HomologicalComplex.Hom.isoApp (HomologicalComplex.Hom.isoOfComponents f hf) i = f i


/-- The `G`-set `Gⁿ`, acting on itself by left multiplication. -/
@[simps!]
def diagonal (G : Type u) [Monoid G] (n : ℕ) : Action (Type u) (MonCat.of G)


theorem gaugeSeminorm_ball_one (hs : IsOpen s) : (gaugeSeminorm hs₀ hs₁ hs₂).ball 0 1 = s

{𝕜 : Type u_1}
{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
[RCLike 𝕜]
[Module 𝕜 E]
[IsScalarTower ℝ 𝕜 E]
{hs₀ : Balanced 𝕜 s}
{hs₁ : Convex ℝ s}
{hs₂ : Absorbent ℝ s}
[TopologicalSpace E]
[ContinuousSMul ℝ E]
(hs : IsOpen s)


theorem of_equiv_symm_iff {β} (e : β ≃ α) {f : σ → α} :
    haveI := Primcodable.ofEquiv α e
    (Primrec fun a => e.symm (f a)) ↔ Primrec f

{α : Type u_1}
{σ : Type u_3}
[Primcodable α]
[Primcodable σ]
{β : Type u_4}
(e : β ≃ α)
{f : σ → α}


theorem map₂_coe_coe (a : α) (b : β) (f : α → β → γ) (hf : UniformContinuous₂ f) :
    Completion.map₂ f (a : Completion α) (b : Completion β) = f a b

{α : Type u_1}
[UniformSpace α]
{β : Type u_2}
[UniformSpace β]
{γ : Type u_3}
[UniformSpace γ]
(a : α)
(b : β)
(f : α → β → γ)
(hf : UniformContinuous₂ f)

UniformSpace.Completion.map₂ f (↑α a) (↑β b) = ↑γ (f a b)


theorem indexOfHom_spec (f : ΣV, { f : V ⟶ iSup U // presieveOfCovering U f }) :
    f.1 = U (indexOfHom U f)

(f : (V : TopologicalSpace.Opens ↑X) × { f // TopCat.Presheaf.presieveOfCovering U f })

f.fst = U (TopCat.Presheaf.presieveOfCovering.indexOfHom U f)


@[gcongr]
theorem inter_subset_inter_left {s t : Set α} (u : Set α) (H : s ⊆ t) : s ∩ u ⊆ t ∩ u

{α : Type u}
{s t : Set α}
(u : Set α)
(H : s ⊆ t)


@[simp]
theorem lift_lt_continuum {c : Cardinal.{u}} : lift.{v} c < 𝔠 ↔ c < 𝔠

Cardinal.lift.{v, u} c < Cardinal.continuum ↔ c < Cardinal.continuum


theorem toPartENat_strictMonoOn : StrictMonoOn toPartENat (Set.Iic ℵ₀)

StrictMonoOn (⇑Cardinal.toPartENat) (Set.Iic Cardinal.aleph0)


lemma levyProkhorovEDist_comm (μ ν : Measure Ω) :
    levyProkhorovEDist μ ν = levyProkhorovEDist ν μ

{Ω : Type u_2}
[MeasurableSpace Ω]
[PseudoEMetricSpace Ω]
(μ ν : MeasureTheory.Measure Ω)

MeasureTheory.levyProkhorovEDist μ ν = MeasureTheory.levyProkhorovEDist ν μ


theorem uniformContinuous_map (f : α → β) : UniformContinuous (map f)

{α : Type u}
{β : Type v}
[UniformSpace α]
[UniformSpace β]
(f : α → β)


lemma mulOption_lt_mul_iff_P3 {i j} :
    ⟦mulOption x y i j⟧ < (⟦x * y⟧ : Game) ↔ P3 (x.moveLeft i) x (y.moveLeft j) y

{x y : SetTheory.PGame}
{i : x.LeftMoves}
{j : y.LeftMoves}

⟦x.mulOption y i j⟧ < ⟦x * y⟧ ↔ Surreal.Multiplication.P3 (x.moveLeft i) x (y.moveLeft j) y


theorem IsNormal.limit_lt {f} (H : IsNormal f) {o} (h : IsLimit o) {a} :
    a < f o ↔ ∃ b < o, a < f b

{f : Ordinal.{u_4} → Ordinal.{u_5}}
(H : Ordinal.IsNormal f)
{o : Ordinal.{u_4}}
(h : o.IsLimit)
{a : Ordinal.{u_5}}


theorem terminates_of_mem {s : Computation α} {a : α} (h : a ∈ s) : Terminates s

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


lemma closure_ball_subset_closedBall : closure (ball x ε) ⊆ closedBall x ε

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

closure (Metric.ball x ε) ⊆ Metric.closedBall x ε


protected theorem add_left_cancel' (c : α) : c + a ≡ c + b [PMOD p] → a ≡ b [PMOD p]

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


protected lemma isAtom_iff : IsAtom s ↔ ∃ a, s = {a}


theorem mem_supported_support (p : α →₀ M) : p ∈ Finsupp.supported M R (p.support : Set α)

{α : Type u_1}
{M : Type u_2}
(R : Type u_5)
[Semiring R]
[AddCommMonoid M]
[Module R M]
(p : α →₀ M)


/-- An angle in a right-angled triangle expressed using `arccos`. -/
theorem oangle_add_left_eq_arccos_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = ↑(π / 2)) :
    o.oangle (x + y) y = Real.arccos (‖y‖ / ‖x + y‖)

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

o.oangle (x + y) y = ↑(Real.arccos (‖y‖ / ‖x + y‖))


theorem tr_respects_aux₂ {k : K} {q : Stmt₂₁} {v : σ} {S : ∀ k, List (Γ k)}
    {L : ListBlank (∀ k, Option (Γ k))}
    (hL : ∀ k, L.map (proj k) = ListBlank.mk ((S k).map some).reverse) (o : StAct₂ k) :
    let v' := stVar v (S k) o
    let Sk' := stWrite v (S k) o
    let S' := update S k Sk'
    ∃ L' : ListBlank (∀ k, Option (Γ k)),
      (∀ k, L'.map (proj k) = ListBlank.mk ((S' k).map some).reverse) ∧
        TM1.stepAux (trStAct q o) v
            ((Tape.move Dir.right)^[(S k).length] (Tape.mk' ∅ (addBottom L))) =
          TM1.stepAux q v' ((Tape.move Dir.right)^[(S' k).length] (Tape.mk' ∅ (addBottom L')))

{q : Turing.TM1.Stmt Turing.TM2to1.Γ' Turing.TM2to1.Λ' σ}

{L : Turing.ListBlank ((k : K) → Option (Γ k))}

(hL : ∀ (k : K), Turing.ListBlank.map (Turing.proj k) L = Turing.ListBlank.mk (List.map some (S k)).reverse)

let v' := Turing.TM2to1.stVar v (S k) o;
let Sk' := Turing.TM2to1.stWrite v (S k) o;
let S' := Function.update S k Sk';
∃ L',
  (∀ (k : K), Turing.ListBlank.map (Turing.proj k) L' = Turing.ListBlank.mk (List.map some (S' k)).reverse) ∧
    Turing.TM1.stepAux (Turing.TM2to1.trStAct q o) v
        ((Turing.Tape.move Turing.Dir.right)^[(S k).length] (Turing.Tape.mk' ∅ (Turing.TM2to1.addBottom L))) =
      Turing.TM1.stepAux q v'
        ((Turing.Tape.move Turing.Dir.right)^[(S' k).length] (Turing.Tape.mk' ∅ (Turing.TM2to1.addBottom L')))


@[simp]
theorem map_coe_Iio_atTop (a : α) : map ((↑) : Iio a → α) atTop = 𝓝[<] a

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
(a : α)

Filter.map Subtype.val Filter.atTop = 𝓝[<] a


/-- The equivalence `Square C ≌ Arrow (Arrow C)` which sends a
commutative square `sq` to the obvious arrow from the top morphism of `sq`
to the bottom morphism of `sq`. -/
@[simps]
def arrowArrowEquivalence' : Square C ≌ Arrow (Arrow C)

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


@[simp] lemma succAbove_ne_last_last {a : Fin (n + 2)} (h : a ≠ last (n + 1)) :
    a.succAbove (last n) = last (n + 1)

{n : ℕ}
{a : Fin (n + 2)}
(h : a ≠ Fin.last (n + 1))

a.succAbove (Fin.last n) = Fin.last (n + 1)


@[continuity, fun_prop]
theorem continuous_sinh : Continuous sinh


theorem derivWithin_sub_const (hxs : UniqueDiffWithinAt 𝕜 s x) (c : F) :
    derivWithin (fun y => f y - c) s x = derivWithin f s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{x : 𝕜}
{s : Set 𝕜}
(hxs : UniqueDiffWithinAt 𝕜 s x)
(c : F)


/-- The image of a nontrivial set under an injective map is nontrivial. -/
theorem Nontrivial.image (hs : s.Nontrivial) {f : α → β} (hf : Function.Injective f) :
    (f '' s).Nontrivial

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


/-- For a prime number `p`, taking `(p - 1)` times the multiplicity of `p` in `n!` equals `n` minus
the sum of base `p` digits of `n`. -/
 theorem sub_one_mul_multiplicity_factorial {n p : ℕ} (hp : p.Prime) :
     (p - 1) * (multiplicity p n !).get (finite_nat_iff.mpr ⟨hp.ne_one, factorial_pos n⟩) =
     n - (p.digits n).sum

(p - 1) * (multiplicity p n !).get ⋯ = n - (p.digits n).sum


theorem tfae_of_cycle {a b} {l : List Prop} (h_chain : List.Chain (· → ·) a (b :: l))
    (h_last : getLastD l b → a) : TFAE (a :: b :: l)

(h_chain : List.Chain (fun x x_1 => x → x_1) a (b :: l))


theorem inter_eq_inter_iff_right : s ∩ u = t ∩ u ↔ t ∩ u ⊆ s ∧ s ∩ u ⊆ t


@[symm]
theorem symm {H K : Subgroup G} : Commensurable H K → Commensurable K H

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


theorem irreducible_aux2 {k m m' n : ℕ} (hkm : k < m) (hmn : m < n) (hkm' : k < m') (hmn' : m' < n)
    (u v w : Units ℤ) (hp : p = trinomial k m n (u : ℤ) v w) (hq : q = trinomial k m' n (u : ℤ) v w)
    (h : p * p.mirror = q * q.mirror) : q = p ∨ q = p.mirror

(hp : p = Polynomial.trinomial k m n ↑u ↑v ↑w)

(hq : q = Polynomial.trinomial k m' n ↑u ↑v ↑w)


lemma add_of_eq {P Q : Fin 3 → R} (h : P = Q) : W'.add P Q = W'.dblXYZ P

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
{P Q : Fin 3 → R}
(h : P = Q)


@[to_additive (attr := simp) smul_dite]
lemma dite_pow (p : Prop) [Decidable p] (a : p → α) (b : ¬ p → α) (c : β) :
    (if h : p then a h else b h) ^ c = if h : p then a h ^ c else b h ^ c

{α : Type u_1}
{β : Type u_2}
[SMul β α]
(p : Prop)
[Decidable p]
(a : p → α)
(b : ¬p → α)
(c : β)

(c • if h : p then a h else b h) = if h : p then c • a h else c • b h


theorem surjective_iff_surjective_of_iUnion_eq_univ :
    Surjective f ↔ ∀ i, Surjective ((U i).restrictPreimage f)

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
{f : α → β}
{U : ι → Set β}
(hU : Set.iUnion U = Set.univ)

Function.Surjective f ↔ ∀ (i : ι), Function.Surjective ((U i).restrictPreimage f)


@[simp] theorem replicate_perm {n : Nat} {a : α} {l : List α} :
    replicate n a ~ l ↔ replicate n a = l

{α : Type u_1}
{n : Nat}
{a : α}
{l : List α}

List.replicate n a ~ l ↔ List.replicate n a = l


theorem Q_succ (q : ℕ) : (Q (q + 1) : K[X] ⟶ _) = Q q - P q ≫ Hσ q

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{X : CategoryTheory.SimplicialObject C}
(q : ℕ)

AlgebraicTopology.DoldKan.Q (q + 1) =
  AlgebraicTopology.DoldKan.Q q - AlgebraicTopology.DoldKan.P q ≫ AlgebraicTopology.DoldKan.Hσ q


@[simp]
theorem snd_swap {p : α × β} : (swap p).2 = p.1

{α : Type u_1}
{β : Type u_2}
{p : α × β}


@[simp, norm_cast]
protected theorem coe_one : ((1 : { x : α // 0 ≤ x }) : α) = 1

{α : Type u_1}
[Zero α]
[One α]
[LE α]
[ZeroLEOneClass α]


@[simp]
theorem WalkingPair.swap_symm_apply_ff : WalkingPair.swap.symm right = left

CategoryTheory.Limits.WalkingPair.swap.symm CategoryTheory.Limits.WalkingPair.right =
  CategoryTheory.Limits.WalkingPair.left


/-- The main result, *Legendre's Theorem* on rational approximation:
if `ξ` is a real number and `q` is a rational number such that `|ξ - q| < 1/(2*q.den^2)`,
then `q` is a convergent of the continued fraction expansion of `ξ`.
This is the version using `GenContFract.convs`. -/
theorem exists_convs_eq_rat {q : ℚ}
    (h : |ξ - q| < 1 / (2 * (q.den : ℝ) ^ 2)) : ∃ n, (GenContFract.of ξ).convs n = q


@[to_additive]
theorem prod_hom_rel [CommMonoid β] (s : Multiset ι) {r : α → β → Prop} {f : ι → α} {g : ι → β}
    (h₁ : r 1 1) (h₂ : ∀ ⦃a b c⦄, r b c → r (f a * b) (g a * c)) :
    r (s.map f).prod (s.map g).prod

(h₂ : ∀ ⦃a : ι⦄ ⦃b : α⦄ ⦃c : β⦄, r b c → r (f a + b) (g a + c))

r (Multiset.map f s).sum (Multiset.map g s).sum


/-- Scalar multiplication on the left as an additive monoid homomorphism. -/
@[simps! (config := .asFn)]
protected def smulLeft [Monoid M] [AddMonoid A] [DistribMulAction M A] (c : M) : A →+ A

{M : Type u_3}
{A : Type u_4}
[Monoid M]
[AddMonoid A]
[DistribMulAction M A]
(c : M)

⇑(AddMonoidHom.smulLeft c) = fun x => c • x


theorem dvd_geom_sum₂_iff_of_dvd_sub' {x y p : R} (h : p ∣ x - y) :
    (p ∣ ∑ i ∈ range n, x ^ i * y ^ (n - 1 - i)) ↔ p ∣ n * x ^ (n - 1)

{R : Type u_1}
{n : ℕ}
[CommRing R]
{x y p : R}
(h : p ∣ x - y)

p ∣ ∑ i ∈ Finset.range n, x ^ i * y ^ (n - 1 - i) ↔ p ∣ ↑n * x ^ (n - 1)


@[simp]
theorem neg_le_neg (S T : Submodule R M) : -S ≤ -T ↔ S ≤ T

{R : Type u_2}
{M : Type u_3}
[Semiring R]
[AddCommGroup M]
[Module R M]
(S T : Submodule R M)


@[simps]
instance compRight {E' : Type*} [Category E'] (F : C ⥤ E) (F' : D ⥤ E) [Lifting L W F F']
    (G : E ⥤ E') : Lifting L W (F ⋙ G) (F' ⋙ G)

[CategoryTheory.Localization.Lifting L W F F']

CategoryTheory.Localization.Lifting.iso' W =
  CategoryTheory.isoWhiskerRight (CategoryTheory.Localization.Lifting.iso L W F F') G


theorem _root_.Submodule.adjoint_subtypeL (U : Submodule 𝕜 E) [CompleteSpace U] :
    U.subtypeL† = orthogonalProjection U

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[CompleteSpace E]
(U : Submodule 𝕜 E)
[CompleteSpace ↥U]

ContinuousLinearMap.adjoint U.subtypeL = orthogonalProjection U


@[simp]
theorem blockDiagonal_transpose (M : o → Matrix m n α) :
    (blockDiagonal M)ᵀ = blockDiagonal fun k => (M k)ᵀ

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type u_12}
[DecidableEq o]
[Zero α]
(M : o → Matrix m n α)

(Matrix.blockDiagonal M)ᵀ = Matrix.blockDiagonal fun k => (M k)ᵀ


lemma Indep.base_iff_ground_subset_closure (hI : M.Indep I) : M.Base I ↔ M.E ⊆ M.closure I

{α : Type u_2}
{M : Matroid α}
{I : Set α}
(hI : M.Indep I)


private theorem mapL_add_smul_aux [DecidableEq ι] (i : ι) (u : E i →L[𝕜] E' i) :
    (fun j ↦ (update f i u j).toLinearMap) =
    update (fun j ↦ (f j).toLinearMap) i u.toLinearMap

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

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

(fun j => ↑(Function.update f i u j)) = Function.update (fun j => ↑(f j)) i ↑u


/-- The type of centroid homomorphisms from `α` to `α`. -/
structure CentroidHom (α : Type*) [NonUnitalNonAssocSemiring α] extends α →+ α where
  /-- Commutativity of centroid homomorphims with left multiplication. -/
  map_mul_left' (a b : α) : toFun (a * b) = a * toFun b
  /-- Commutativity of centroid homomorphims with right multiplication. -/
  map_mul_right' (a b : α) : toFun (a * b) = toFun a * b

{α : Type u_6}
[NonUnitalNonAssocSemiring α]
(self : CentroidHom α)
(a b : α)

(↑self.toAddMonoidHom).toFun (a * b) = a * (↑self.toAddMonoidHom).toFun b


/-- Postcomposition of a 1-morphism as a functor from the category of 1-morphisms `b ⟶ c` into the
category of functors `(a ⟶ b) ⥤ (a ⟶ c)`. -/
@[simps]
def postcomposing (a b c : B) : (b ⟶ c) ⥤ (a ⟶ b) ⥤ (a ⟶ c)

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

(CategoryTheory.Bicategory.postcomposing a b c).obj f = CategoryTheory.Bicategory.postcomp a f


@[simp]
theorem apply_apply_toDualRight_symm (x : M) (f : Dual R M) :
    (p x) (p.toDualRight.symm f) = f x

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(p : PerfectPairing R M N)
(x : M)
(f : Module.Dual R M)


theorem derivWithin.log (hf : DifferentiableWithinAt ℝ f s x) (hx : f x ≠ 0)
    (hxs : UniqueDiffWithinAt ℝ s x) :
    derivWithin (fun x => log (f x)) s x = derivWithin f s x / f x

{f : ℝ → ℝ}
{x : ℝ}
{s : Set ℝ}
(hf : DifferentiableWithinAt ℝ f s x)
(hx : f x ≠ 0)
(hxs : UniqueDiffWithinAt ℝ s x)

derivWithin (fun x => Real.log (f x)) s x = derivWithin f s x / f x


@[simp]
theorem ofHamming_sub [∀ i, Sub (β i)] {x y : Hamming β} :
    ofHamming (x - y) = ofHamming x - ofHamming y

{ι : Type u_2}
{β : ι → Type u_3}
[(i : ι) → Sub (β i)]
{x y : Hamming β}

Hamming.ofHamming (x - y) = Hamming.ofHamming x - Hamming.ofHamming y


theorem ext_fun_iff {η : Kernel α β} :
    κ = η ↔ ∀ a f, Measurable f → ∫⁻ b, f b ∂κ a = ∫⁻ b, f b ∂η a

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{κ η : ProbabilityTheory.Kernel α β}

κ = η ↔ ∀ (a : α) (f : β → ℝ≥0∞), Measurable f → ∫⁻ (b : β), f b ∂κ a = ∫⁻ (b : β), f b ∂η a


theorem leftInverse_nat : Function.LeftInverse ofNat toNat


theorem toPrefunctor_id : toPrefunctor id = 𝟭q (SingleObj α)

Quiver.SingleObj.toPrefunctor id = 𝟭q (Quiver.SingleObj α)


protected lemma refl (hr : ∀ a : α, r₁₁ a a) : RightTotal r₁₁

{α : Type u_5}
{r₁₁ : α → α → Prop}
(hr : ∀ (a : α), r₁₁ a a)


theorem tan_eq_zero_iff {θ : ℝ} : tan θ = 0 ↔ ∃ k : ℤ, k * π / 2 = θ

Real.tan θ = 0 ↔ ∃ k, ↑k * Real.pi / 2 = θ


theorem tendsto_of_antitone {ι α : Type*} [Preorder ι] [TopologicalSpace α]
    [ConditionallyCompleteLinearOrder α] [OrderTopology α] {f : ι → α} (h_mono : Antitone f) :
    Tendsto f atTop atBot ∨ ∃ l, Tendsto f atTop (𝓝 l)

{ι : Type u_3}
{α : Type u_4}
[Preorder ι]
[TopologicalSpace α]
[ConditionallyCompleteLinearOrder α]
[OrderTopology α]
{f : ι → α}
(h_mono : Antitone f)

Filter.Tendsto f Filter.atTop Filter.atBot ∨ ∃ l, Filter.Tendsto f Filter.atTop (𝓝 l)


theorem exists_next_left {x : α} {s : Finset α} (h : ∃ y ∈ s, y < x) :
    ∃ y ∈ s, y < x ∧ ∀ z ∈ s, z < x → z ≤ y

{α : Type u_2}
[LinearOrder α]
{x : α}
{s : Finset α}
(h : ∃ y ∈ s, y < x)


@[mono]
theorem iUnion_mono (h : π₁ ≤ π₂) : π₁.iUnion ⊆ π₂.iUnion

{ι : Type u_1}
{I : BoxIntegral.Box ι}
{π₁ π₂ : BoxIntegral.Prepartition I}
(h : π₁ ≤ π₂)


theorem smul_addMonoidHom_apply (c : Mᵈᵐᵃ) (f : A →+ B) (a : A) : (c • f) a = f (mk.symm c • a)

{A : Type u_5}
{B : Type u_6}
{M : Type u_7}
[AddMonoid A]
[DistribSMul M A]
[AddZeroClass B]
(c : Mᵈᵐᵃ)
(f : A →+ B)
(a : A)


theorem injective_surjInv (h : Surjective f) : Injective (surjInv h)

{α : Sort u}
{β : Sort v}
{f : α → β}
(h : Function.Surjective f)


@[simp, mfld_simps]
theorem ofSet_symm : (ofSet s hs).symm = ofSet s hs

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

(PartialHomeomorph.ofSet s hs).symm = PartialHomeomorph.ofSet s hs


@[reassoc (attr := simp)]
theorem comul_counit_hom {Z : C} (f : M.X ⟶ Z) : M.comul ≫ (f ⊗ M.counit) = f ≫ (ρ_ Z).inv

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


@[simp] theorem get_nil : get ([] : IntList) i = 0


@[simp]
theorem quotientMap_mk {J : Ideal R} {I : Ideal S} {f : R →+* S} {H : J ≤ I.comap f} {x : R} :
    quotientMap I f H (Quotient.mk J x) = Quotient.mk I (f x)

{R : Type u}
[CommRing R]
{S : Type v}
[CommRing S]
{J : Ideal R}
{I : Ideal S}
{f : R →+* S}
{H : J ≤ Ideal.comap f I}
{x : R}

(Ideal.quotientMap I f H) ((Ideal.Quotient.mk J) x) = (Ideal.Quotient.mk I) (f x)


theorem algebraMap_ofSubring_apply {R : Type*} [CommRing R] (S : Subring R) (x : S) :
    algebraMap S R x = x

{R : Type u_2}
[CommRing R]
(S : Subring R)
(x : ↥S)


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

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

nndist (AddOpposite.unop x) (AddOpposite.unop y) = nndist x y


/-- When `r < w`, we give a formula for `(x.rotateRight r).getLsb i`. -/
theorem getLsb_rotateRight_of_le {x : BitVec w} {r i : Nat} (hr: r < w) :
    (x.rotateRight r).getLsb i =
      cond (i < w - r)
      (x.getLsb (r + i))
      (decide (i < w) && x.getLsb (i - (w - r)))

{w : Nat}
{x : BitVec w}
{r i : Nat}
(hr : r < w)

(x.rotateRight r).getLsb i = bif decide (i < w - r) then x.getLsb (r + i) else decide (i < w) && x.getLsb (i - (w - r))


theorem NatTrans.Equifibered.whiskerLeft {K : Type*} [Category K]  {F G : J ⥤ C} {α : F ⟶ G}
    (hα : Equifibered α) (H : K ⥤ J) : Equifibered (whiskerLeft H α)

(hα : CategoryTheory.NatTrans.Equifibered α)

CategoryTheory.NatTrans.Equifibered (CategoryTheory.whiskerLeft H α)


@[simp]
lemma pow_left_inj (ha : 0 ≤ a) (hb : 0 ≤ b) (hn : n ≠ 0) : a ^ n = b ^ n ↔ a = b

{R : Type u_3}
[LinearOrderedSemiring R]
{a b : R}
{n : ℕ}
(ha : 0 ≤ a)
(hb : 0 ≤ b)
(hn : n ≠ 0)


@[simp]
lemma rightHomologyMap'_neg :
    rightHomologyMap' (-φ) h₁ h₂ = -rightHomologyMap' φ h₁ h₂

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{S₁ S₂ : CategoryTheory.ShortComplex C}
{φ : S₁ ⟶ S₂}
(h₁ : S₁.RightHomologyData)
(h₂ : S₂.RightHomologyData)

CategoryTheory.ShortComplex.rightHomologyMap' (-φ) h₁ h₂ = -CategoryTheory.ShortComplex.rightHomologyMap' φ h₁ h₂


@[simp]
theorem ordConnectedComponent_eq_empty : ordConnectedComponent s x = ∅ ↔ x ∉ s

{α : Type u_1}
[LinearOrder α]
{s : Set α}
{x : α}


lemma biUnion_subset {s' : Finset β} : s.biUnion t ⊆ s' ↔ ∀ x ∈ s, t x ⊆ s'

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{t : α → Finset β}
[DecidableEq β]
{s' : Finset β}


@[simp] theorem add_byteIdx (p₁ p₂ : Pos) : (p₁ + p₂).byteIdx = p₁.byteIdx + p₂.byteIdx


/-- **Legendre's Theorem**

Taking (`p - 1`) times the `p`-adic valuation of `n!` equals `n` minus the sum of base `p` digits
of `n`. -/
theorem sub_one_mul_padicValNat_factorial [hp : Fact p.Prime] (n : ℕ) :
    (p - 1) * padicValNat p (n !) = n - (p.digits n).sum

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

(p - 1) * padicValNat p n ! = n - (p.digits n).sum


/-- The type sequential topological spaces. -/
structure Sequential where
  /-- The underlying topological space of an object of `Sequential`. -/
  toTop : TopCat.{u}
  /-- The underlying topological space is sequential. -/
  [is_sequential : SequentialSpace toTop]


theorem Finset.Nonempty.csSup_mem {s : Finset α} (h : s.Nonempty) : sSup (s : Set α) ∈ s

{α : Type u_2}
[ConditionallyCompleteLinearOrder α]
{s : Finset α}
(h : s.Nonempty)


@[simp]
theorem mem_eqLocus {x : M} {f g : F} : x ∈ eqLocus f g ↔ f x = g x

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_3}
{M₂ : Type u_4}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
{F : Type u_5}
[FunLike F M M₂]
[SemilinearMapClass F τ₁₂ M M₂]
{x : M}
{f g : F}


@[simp]
theorem snd_linear : (snd : P1 × P2 →ᵃ[k] P2).linear = LinearMap.snd k V1 V2

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
{V2 : Type u_4}
{P2 : Type u_5}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
[AddCommGroup V2]
[Module k V2]
[AffineSpace V2 P2]

AffineMap.snd.linear = LinearMap.snd k V1 V2