/-- `condDistrib` is a.e. uniquely defined as the kernel satisfying the defining property of
`condKernel`. -/
theorem condDistrib_ae_eq_of_measure_eq_compProd (hX : Measurable X) (hY : Measurable Y)
    (κ : Kernel β Ω) [IsFiniteKernel κ] (hκ : μ.map (fun x => (X x, Y x)) = μ.map X ⊗ₘ κ) :
    ∀ᵐ x ∂μ.map X, κ x = condDistrib Y X μ x

(hκ : MeasureTheory.Measure.map (fun x => (X x, Y x)) μ = MeasureTheory.Measure.map X μ ⊗ₘ κ)

∀ᵐ (x : β) ∂MeasureTheory.Measure.map X μ, κ x = (ProbabilityTheory.condDistrib Y X μ) x


theorem IsComplemented.sup : IsComplemented a → IsComplemented b → IsComplemented (a ⊔ b)

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


/-- The supremum of congruence relations `c, d` equals the smallest congruence relation containing
    the binary relation '`x` is related to `y` by `c` or `d`'. -/
@[to_additive sup_eq_addConGen "The supremum of additive congruence relations `c, d` equals the
smallest additive congruence relation containing the binary relation '`x` is related to `y`
by `c` or `d`'."]
theorem sup_eq_conGen (c d : Con M) : c ⊔ d = conGen fun x y => c x y ∨ d x y

c ⊔ d = addConGen fun x y => c x y ∨ d x y


@[simp]
theorem comp_F {S₁ S₂ S₃ : Split C} (Φ₁₂ : S₁ ⟶ S₂) (Φ₂₃ : S₂ ⟶ S₃) :
    (Φ₁₂ ≫ Φ₂₃).F = Φ₁₂.F ≫ Φ₂₃.F

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{S₁ S₂ S₃ : SimplicialObject.Split C}
(Φ₁₂ : S₁ ⟶ S₂)
(Φ₂₃ : S₂ ⟶ S₃)

(Φ₁₂ ≫ Φ₂₃).F = Φ₁₂.F ≫ Φ₂₃.F


theorem count_coe {J : Ideal R} (hJ : J ≠ 0) :
    count K v J = (Associates.mk v.asIdeal).count (Associates.mk J).factors

(v : IsDedekindDomain.HeightOneSpectrum R)

FractionalIdeal.count K v ↑J = ↑((Associates.mk v.asIdeal).count (Associates.mk J).factors)


theorem pairwise_iff_get : Pairwise R l ↔ ∀ (i j) (_hij : i < j), R (get l i) (get l j)

∀ {α : Type u_1} {R : α → α → Prop} {l : List α},
  List.Pairwise R l ↔ ∀ (i j : Fin l.length), i < j → R (l.get i) (l.get j)


/-- The linear equivalence between `(α ⊕ β) →₀ M` and `(α →₀ M) × (β →₀ M)`.

This is the `LinearEquiv` version of `Finsupp.sumFinsuppEquivProdFinsupp`. -/
@[simps apply symm_apply]
def sumFinsuppLEquivProdFinsupp {α β : Type*} : (α ⊕ β →₀ M) ≃ₗ[R] (α →₀ M) × (β →₀ M)

{M : Type u_2}
(R : Type u_5)
[Semiring R]
[AddCommMonoid M]
[Module R M]
{α : Type u_7}
{β : Type u_8}

∀ (a : α ⊕ β →₀ M), (Finsupp.sumFinsuppLEquivProdFinsupp R) a = Finsupp.sumFinsuppAddEquivProdFinsupp.toFun a


theorem uncurry_pre (f : B ⟶ A) [Exponentiable B] (X : C) :
    CartesianClosed.uncurry ((pre f).app X) = Limits.prod.map f (𝟙 _) ≫ (exp.ev A).app X

CategoryTheory.CartesianClosed.uncurry ((CategoryTheory.pre f).app X) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.prod.map f (CategoryTheory.CategoryStruct.id (A ⟹ X)))
    ((CategoryTheory.exp.ev A).app X)


/-- The image of a binary bicone under a functor. -/
@[simps!]
def mapBinaryBicone {X Y : C} (b : BinaryBicone X Y) : BinaryBicone (F.obj X) (F.obj Y)

(b : CategoryTheory.Limits.BinaryBicone X Y)


theorem USize.size_le : USize.size ≤ 2 ^ 64


theorem directed_of (r : α → α → Prop) [IsDirected α r] (a b : α) : ∃ c, r a c ∧ r b c

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


/-- A vector space has dimension `1` if and only if there is a
single non-zero vector of which all vectors are multiples. -/
theorem rank_eq_one_iff [Module.Free K V] :
    Module.rank K V = 1 ↔ ∃ v₀ : V, v₀ ≠ 0 ∧ ∀ v, ∃ r : K, r • v₀ = v

{K : Type u}
{V : Type v}
[Ring K]
[StrongRankCondition K]
[AddCommGroup V]
[Module K V]
[Module.Free K V]

Module.rank K V = 1 ↔ ∃ v₀, v₀ ≠ 0 ∧ ∀ (v : V), ∃ r, r • v₀ = v


/-- Expressing the product of two polynomials as a double sum. -/
theorem mul_eq_sum_sum :
    p * q = ∑ i ∈ p.support, q.sum fun j a => (monomial (i + j)) (p.coeff i * a)

p * q = ∑ i ∈ p.support, q.sum fun j a => (Polynomial.monomial (i + j)) (p.coeff i * a)


@[to_additive]
theorem le_inv_iff_mul_le_one_right : a ≤ b⁻¹ ↔ a * b ≤ 1

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


protected theorem PairwiseDisjoint.insert (hs : s.PairwiseDisjoint f) {i : ι}
    (h : ∀ j ∈ s, i ≠ j → Disjoint (f i) (f j)) : (insert i s).PairwiseDisjoint f


theorem lcm_pos {m n : ℕ} : 0 < m → 0 < n → 0 < m.lcm n


theorem image2_mem_map₂ (hs : s ∈ f) (ht : t ∈ g) : image2 m s t ∈ map₂ m f g

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{m : α → β → γ}
{f : Filter α}
{g : Filter β}
{s : Set α}
{t : Set β}
(hs : s ∈ f)
(ht : t ∈ g)


/-- The pointwise maximum of strictly convex functions is strictly convex. -/
theorem StrictConvexOn.sup (hf : StrictConvexOn 𝕜 s f) (hg : StrictConvexOn 𝕜 s g) :
    StrictConvexOn 𝕜 s (f ⊔ g)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[LinearOrderedAddCommMonoid β]
[SMul 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f g : E → β}
(hf : StrictConvexOn 𝕜 s f)
(hg : StrictConvexOn 𝕜 s g)


theorem ne_zero (hp : p.IsUnitTrinomial) : p ≠ 0

{p : Polynomial ℤ}
(hp : p.IsUnitTrinomial)


theorem eq_zero_of_forall_index_sum_pow_mul_eq_zero {R : Type*} [CommRing R] [IsDomain R] {n : ℕ}
    {f v : Fin n → R} (hf : Function.Injective f)
    (hfv : ∀ j, (∑ i : Fin n, f j ^ (i : ℕ) * v i) = 0) : v = 0

(hfv : ∀ (j : Fin n), ∑ i : Fin n, f j ^ ↑i * v i = 0)


lemma cfcₙ_sub : cfcₙ (fun x ↦ f x - g x) a = cfcₙ f a - cfcₙ g a

(hf : ContinuousOn f (σₙ R a) := by cfc_cont_tac)

(hg : ContinuousOn g (σₙ R a) := by cfc_cont_tac)

cfcₙ (fun x => f x - g x) a = cfcₙ f a - cfcₙ g a


lemma copy_eq {_ : MulZeroOneClass α} {_ : MulZeroOneClass β} (f : α →*₀ β) (f' : α → β) (h) :
    f.copy f' h = f

∀ {x : MulZeroOneClass α} {x_1 : MulZeroOneClass β} (f : α →*₀ β) (f' : α → β) (h : f' = ⇑f), f.copy f' h = ↑f


/-- Implementation of `CommMon_.equivLaxBraidedFunctorPunit`. -/
@[simps]
def commMonToLaxBraided : CommMon_ C ⥤ LaxBraidedFunctor (Discrete PUnit.{u + 1}) C

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

∀ (x : CategoryTheory.Discrete PUnit.{u + 1}),
  ((CommMon_.EquivLaxBraidedFunctorPUnit.commMonToLaxBraided C).obj A).obj x = A.X


@[to_additive]
theorem Pi.mulSingle_sup [∀ i, SemilatticeSup (f i)] [∀ i, One (f i)] (i : I) (x y : f i) :
    Pi.mulSingle i (x ⊔ y) = Pi.mulSingle i x ⊔ Pi.mulSingle i y

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

Pi.single i (x ⊔ y) = Pi.single i x ⊔ Pi.single i y


@[continuity]
theorem continuous_reflTransSymmAux : Continuous reflTransSymmAux


/-- C2.1.3 in [Elephant] -/
theorem isSheafFor_iff_generate (R : Presieve X) :
    IsSheafFor P R ↔ IsSheafFor P (generate R : Presieve X)

{P : CategoryTheory.Functor Cᵒᵖ (Type w)}

CategoryTheory.Presieve.IsSheafFor P R ↔ CategoryTheory.Presieve.IsSheafFor P (CategoryTheory.Sieve.generate R).arrows


lemma predAbove_succ_of_lt (p i : Fin n) (h : i < p) (hi := succ_ne_last_of_lt h) :
    p.predAbove (succ i) = (i.succ).castPred hi

{n : ℕ}
(p i : Fin n)
(h : i < p)
(hi : i.succ ≠ Fin.last n := ⋯)


@[to_additive (attr := simp)]
theorem symm_trans_self (e : M ≃* N) : e.symm.trans e = refl N

{M : Type u_6}
{N : Type u_7}
[Add M]
[Add N]
(e : M ≃+ N)


/-- If `K / E / F` is a field extension tower, then `E` adjoin `separableClosure F K` is contained
in `separableClosure E K`. -/
theorem separableClosure.adjoin_le [Algebra E K] [IsScalarTower F E K] :
    adjoin E (separableClosure F K) ≤ separableClosure E K

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

IntermediateField.adjoin E ↑(separableClosure F K) ≤ separableClosure E K


@[to_additive (attr := simp)]
theorem compl₂_apply [MulOneClass M] [MulOneClass N] [CommMonoid P] [MulOneClass Q]
    (f : M →* N →* P) (g : Q →* N) (m : M) (q : Q) : (compl₂ f g) m q = f m (g q)

{M : Type uM}
{N : Type uN}
{P : Type uP}
{Q : Type uQ}
[AddZeroClass M]
[AddZeroClass N]
[AddCommMonoid P]
[AddZeroClass Q]
(f : M →+ N →+ P)
(g : Q →+ N)
(m : M)
(q : Q)


lemma distinguished_iff_iso_trianglehOfDegreewiseSplit
    (T : Triangle (HomotopyCategory C (ComplexShape.up ℤ))) :
    (T ∈ distTriang _) ↔ ∃ (S : ShortComplex (CochainComplex C ℤ))
      (σ : ∀ n, (S.map (HomologicalComplex.eval C _ n)).Splitting),
      Nonempty (T ≅ CochainComplex.trianglehOfDegreewiseSplit S σ)

(T : CategoryTheory.Pretriangulated.Triangle (HomotopyCategory C (ComplexShape.up ℤ)))

T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles ↔
  ∃ S σ, Nonempty (T ≅ CochainComplex.trianglehOfDegreewiseSplit S σ)


@[to_additive (attr := simp)]
theorem bot_mul : ⊥ * g = ⊥


nonrec theorem IsIntegral.mul {x y : A} (hx : IsIntegral R x) (hy : IsIntegral R y) :
    IsIntegral R (x * y)

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[CommRing A]
[Algebra R A]
{x y : A}
(hx : IsIntegral R x)
(hy : IsIntegral R y)


theorem eval_nodal {x : R} : (nodal s v).eval x = ∏ i ∈ s, (x - v i)

{R : Type u_1}
[CommRing R]
{ι : Type u_2}
{s : Finset ι}
{v : ι → R}
{x : R}

Polynomial.eval x (Lagrange.nodal s v) = ∏ i ∈ s, (x - v i)


theorem disjoint_iff_eq_or_eq : Disjoint f g ↔ ∀ x : α, f x = x ∨ g x = x

f.Disjoint g ↔ ∀ (x : α), f x = x ∨ g x = x


@[simp]
theorem apply_symm_apply (h : X ≃ₜ Y) (y : Y) : h (h.symm y) = y

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


@[to_additive (attr := simp)]
theorem eventuallyConst_smul_set_ae (c : G) {s : Set α} :
    EventuallyConst (c • s : Set α) (ae μ) ↔ EventuallyConst s (ae μ)

[MeasureTheory.VAddInvariantMeasure G α μ]

Filter.EventuallyConst (c +ᵥ s) (MeasureTheory.ae μ) ↔ Filter.EventuallyConst s (MeasureTheory.ae μ)


theorem one_le : (1 : Submodule R A) ≤ P ↔ (1 : A) ∈ P

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


/-- An **e-transform**. Turns `(s, t)` into `(s ∩ s • e, t ∪ e⁻¹ • t)`. This reduces the
product of the two sets. -/
@[to_additive (attr := simps) "An **e-transform**.
Turns `(s, t)` into `(s ∩ s +ᵥ e, t ∪ -e +ᵥ t)`. This reduces the sum of the two sets."]
def mulETransformLeft : Finset α × Finset α

{α : Type u_1}
[DecidableEq α]
[Group α]
(e : α)
(x : Finset α × Finset α)

(Finset.mulETransformLeft e x).1 = x.1 ∩ MulOpposite.op e • x.1


theorem Iic_union_Icc' (h₁ : c ≤ b) : Iic b ∪ Icc c d = Iic (max b d)

{α : Type u_1}
[LinearOrder α]
{b c d : α}
(h₁ : c ≤ b)

Set.Iic b ∪ Set.Icc c d = Set.Iic (max b d)


theorem pointwise_vadd_eq_map (v : V) (s : AffineSubspace k P) :
    v +ᵥ s = s.map (AffineEquiv.constVAdd k P v)

{k : Type u_1}
[Ring k]
{V : Type u_2}
{P : Type u_3}
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
(v : V)
(s : AffineSubspace k P)

v +ᵥ s = AffineSubspace.map (↑(AffineEquiv.constVAdd k P v)) s


theorem cauchySeq_finset_of_norm_bounded {f : ι → E} (g : ι → ℝ) (hg : Summable g)
    (h : ∀ i, ‖f i‖ ≤ g i) : CauchySeq fun s : Finset ι => ∑ i ∈ s, f i

{ι : Type u_1}
{E : Type u_3}
[SeminormedAddCommGroup E]
{f : ι → E}
(g : ι → ℝ)
(hg : Summable g)
(h : ∀ (i : ι), ‖f i‖ ≤ g i)


@[simp]
theorem eventually_eventuallyLE_nhds [LE α] {f g : X → α} :
    (∀ᶠ y in 𝓝 x, f ≤ᶠ[𝓝 y] g) ↔ f ≤ᶠ[𝓝 x] g

{X : Type u}
{α : Type u_1}
{x : X}
[TopologicalSpace X]
[LE α]
{f g : X → α}

(∀ᶠ (y : X) in 𝓝 x, f ≤ᶠ[𝓝 y] g) ↔ f ≤ᶠ[𝓝 x] g


@[simp]
theorem equivFunOnFintype_single [Fintype ι] (i : ι) (m : β i) :
    (@DFinsupp.equivFunOnFintype ι β _ _) (DFinsupp.single i m) = Pi.single i m

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

DFinsupp.equivFunOnFintype (DFinsupp.single i m) = Pi.single i m


theorem Sigma.nhds_mk (i : ι) (x : σ i) : 𝓝 (⟨i, x⟩ : Sigma σ) = Filter.map (Sigma.mk i) (𝓝 x)

{ι : Type u_5}
{σ : ι → Type u_7}
[(i : ι) → TopologicalSpace (σ i)]
(i : ι)
(x : σ i)

𝓝 ⟨i, x⟩ = Filter.map (Sigma.mk i) (𝓝 x)


@[to_additive]
theorem smul_card_le : (s • t).card ≤ s.card • t.card

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[SMul α β]
{s : Finset α}
{t : Finset β}


theorem up_injective : Injective (@up α)


lemma abs_sin_half (x : ℝ) : |sin (x / 2)| = sqrt ((1 - cos x) / 2)

|Real.sin (x / 2)| = √((1 - Real.cos x) / 2)


@[simp]
theorem factorThru_add_sub_factorThru_right {X Y : C} {P : Subobject Y} (f g : X ⟶ Y)
    (w : P.Factors (f + g)) (wg : P.Factors g) :
    P.factorThru (f + g) w - P.factorThru g wg =
      P.factorThru f (factors_left_of_factors_add f g w wg)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Preadditive C]
{X Y : C}
{P : CategoryTheory.Subobject Y}
(f g : X ⟶ Y)
(w : P.Factors (f + g))
(wg : P.Factors g)

P.factorThru (f + g) w - P.factorThru g wg = P.factorThru f ⋯


theorem le_max_left (a b : α) : a ≤ max a b


theorem coeFn_toLp [NormedField 𝕜] [NormedSpace 𝕜 E] (f : α →ᵇ E) :
    toLp (E := E) p μ 𝕜 f =ᵐ[μ] f

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
(p : ℝ≥0∞)
(μ : MeasureTheory.Measure α)
[NormedAddCommGroup E]
[TopologicalSpace α]
[BorelSpace α]
[SecondCountableTopologyEither α E]
[MeasureTheory.IsFiniteMeasure μ]
(𝕜 : Type u_5)
[Fact (1 ≤ p)]
[NormedField 𝕜]
[NormedSpace 𝕜 E]
(f : α →ᵇ E)

↑↑((BoundedContinuousFunction.toLp p μ 𝕜) f) =ᵐ[μ] ⇑f


theorem Indep.inter_left (hI : M.Indep I) (X : Set α) : M.Indep (X ∩ I)

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


@[simp]
theorem mem_alternatingGroup {f : Perm α} : f ∈ alternatingGroup α ↔ sign f = 1

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{f : Equiv.Perm α}

f ∈ alternatingGroup α ↔ Equiv.Perm.sign f = 1


theorem rank_eq_four [StrongRankCondition R] : Module.rank R ℍ[R,c₁,c₂] = 4

{R : Type u_3}
[CommRing R]
(c₁ c₂ : R)
[StrongRankCondition R]


theorem le_def {α} {a b : MeasurableSpace α} : a ≤ b ↔ a.MeasurableSet' ≤ b.MeasurableSet'

{α : Type u_7}
{a b : MeasurableSpace α}


@[simp] theorem add_div_right (x : Nat) {z : Nat} (H : 0 < z) : (x + z) / z = (x / z) + 1


theorem eLpNorm_one_le_of_le {r : ℝ≥0} (hfint : Integrable f μ) (hfint' : 0 ≤ ∫ x, f x ∂μ)
    (hf : ∀ᵐ ω ∂μ, f ω ≤ r) : eLpNorm f 1 μ ≤ 2 * μ Set.univ * r

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ}
{r : ℝ≥0}
(hfint : MeasureTheory.Integrable f μ)
(hfint' : 0 ≤ ∫ (x : α), f x ∂μ)
(hf : ∀ᵐ (ω : α) ∂μ, f ω ≤ ↑r)

MeasureTheory.eLpNorm f 1 μ ≤ 2 * μ Set.univ * ↑r


theorem abs_cpow_eq_rpow_re_of_pos {x : ℝ} (hx : 0 < x) (y : ℂ) : abs (x ^ y) = x ^ y.re


@[simp] lemma le_Ici : s ≤ Ici a ↔ a ∈ s

{α : Type u_1}
[Preorder α]
{s : UpperSet α}
{a : α}


@[simp] theorem drop_zero {s : Stream' α} : s.drop 0 = s


theorem not_isRoot_C (r a : R) (hr : r ≠ 0) : ¬IsRoot (C r) a

{R : Type u}
[Semiring R]
(r a : R)
(hr : r ≠ 0)


/-- The `n`th prime is greater or equal to `n + 2`. -/
lemma add_two_le_nth_prime (n : ℕ) : n + 2 ≤ nth Prime n


@[to_additive]
theorem toFun_mul_inv_mem (hS : S ∈ Subgroup.rightTransversals (H : Set G)) (g : G) :
    (toFun hS g : G) * g⁻¹ ∈ H

(hS : S ∈ AddSubgroup.rightTransversals ↑H)

↑(AddSubgroup.MemRightTransversals.toFun hS g) + -g ∈ H


@[to_additive (attr := simp)]
lemma coe_comp {X Y Z : CommGrp} {f : X ⟶ Y} {g : Y ⟶ Z} : (f ≫ g : X → Z) = g ∘ f

{X Y Z : AddCommGrp}
{f : X ⟶ Y}
{g : Y ⟶ Z}


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


theorem fg_span_singleton (x : M) : FG (R ∙ x)

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(x : M)


/-- Given `F : J ⥤ PresheafOfModules.{v} R`, this is the `BundledCorePresheafOfModules R` which
corresponds to the presheaf of modules which sends `X` to the limit of `F ⋙ evaluation R X`. -/
@[simps]
noncomputable def limitBundledCore : BundledCorePresheafOfModules R

[∀ (X : Cᵒᵖ),
    Small.{v, max u₂ v}
      ↑((F ⋙ PresheafOfModules.evaluation R X) ⋙ CategoryTheory.forget (ModuleCat ↑(R.obj X))).sections]

(PresheafOfModules.limitBundledCore F).obj X = CategoryTheory.Limits.limit (F ⋙ PresheafOfModules.evaluation R X)


@[simp]
theorem star_fst (a : 𝓜(𝕜, A)) (b : A) : (star a).fst b = star (a.snd (star b))

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

(star a).toProd.1 b = star (a.toProd.2 (star b))


@[simp, mfld_simps]
theorem zeroSection_proj [∀ x, Zero (E x)] (x : B) : (zeroSection F E x).proj = x

{B : Type u_2}
(F : Type u_3)
(E : B → Type u_4)
[(x : B) → Zero (E x)]
(x : B)


@[to_additive nsmul_left_strictMono]
theorem pow_right_strictMono' [CovariantClass M M (· * ·) (· < ·)] {a : M} (ha : 1 < a) :
    StrictMono ((a ^ ·) : ℕ → M)

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

[CovariantClass M M (fun x x_1 => x * x_1) fun x x_1 => x < x_1]


theorem basisSets_nonempty [Nonempty ι] : p.basisSets.Nonempty

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


theorem rpow_left_bijective {x : ℝ} (hx : x ≠ 0) : Function.Bijective fun y : ℝ≥0∞ => y ^ x


@[simp, norm_cast] lemma one_lt_coe [One α] : 1 < (a : WithZero α) ↔ 1 < a

{α : Type u_1}
[Preorder α]
{a : α}
[One α]


@[simp]
theorem snd_mk (i : ι) (l : List ι) (f : ∀ i, α i) :
    (TProd.mk.{u,v} (i :: l) f).2 = TProd.mk.{u,v} l f

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

(List.TProd.mk (i :: l) f).2 = List.TProd.mk l f


@[simp]
theorem insert_apply_left {α} {s : Set.{u} α} [DecidablePred (· ∈ s)] {a : α} (H : a ∉ s) :
    Equiv.Set.insert H ⟨a, Or.inl rfl⟩ = Sum.inr PUnit.unit

{α : Type u}
{s : Set α}
[DecidablePred fun x => x ∈ s]
{a : α}
(H : a ∉ s)

(Equiv.Set.insert H) ⟨a, ⋯⟩ = Sum.inr PUnit.unit


lemma coe_triangle_down_toOrderHom {n : ℕ} (a b c : Fin (n+1)) (hab : a ≤ b) (hbc : b ≤ c) :
    ↑(triangle a b c hab hbc).down.toOrderHom = ![a, b, c]

{n : ℕ}
(a b c : Fin (n + 1))
(hab : a ≤ b)
(hbc : b ≤ c)

⇑(SimplexCategory.Hom.toOrderHom (SSet.standardSimplex.triangle a b c hab hbc).down) = ![a, b, c]


@[to_additive rightAddCosetEquivalence_rel]
theorem rightCosetEquivalence_rel (s : Set α) : Equivalence (RightCosetEquivalence s)


@[to_additive (attr := simp 1100)]
theorem singleton_mul_closedBall : {x} * closedBall y δ = closedBall (x * y) δ

{E : Type u_1}
[SeminormedCommGroup E]
(δ : ℝ)
(x y : E)

{x} * Metric.closedBall y δ = Metric.closedBall (x * y) δ


theorem hasBasis_iInf_of_directed' {ι : Type*} {ι' : ι → Sort _} [Nonempty ι] {l : ι → Filter α}
    (s : ∀ i, ι' i → Set α) (p : ∀ i, ι' i → Prop) (hl : ∀ i, (l i).HasBasis (p i) (s i))
    (h : Directed (· ≥ ·) l) :
    (⨅ i, l i).HasBasis (fun ii' : Σi, ι' i => p ii'.1 ii'.2) fun ii' => s ii'.1 ii'.2

(hl : ∀ (i : ι), (l i).HasBasis (p i) (s i))

(⨅ i, l i).HasBasis (fun ii' => p ii'.fst ii'.snd) fun ii' => s ii'.fst ii'.snd


lemma mul_uzpow (s₁ s₂ : ℤˣ) (x : R) : (s₁ * s₂) ^ x = s₁ ^ x * s₂ ^ x

{R : Type u_1}
[CommSemiring R]
[Module R (Additive ℤˣ)]
(s₁ s₂ : ℤˣ)
(x : R)


protected theorem withDensity_apply' (κ : Kernel α β) [IsSFiniteKernel κ]
    (hf : Measurable (Function.uncurry f)) (a : α) (s : Set β) :
    withDensity κ f a s = ∫⁻ b in s, f a b ∂κ a

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

((κ.withDensity f) a) s = ∫⁻ (b : β) in s, f a b ∂κ a


/-- The zero module is linearly disjoint with any other submodules. -/
theorem bot_left : (⊥ : Submodule R S).LinearDisjoint N

{R : Type u}
{S : Type v}
[CommSemiring R]
[Semiring S]
[Algebra R S]
(N : Submodule R S)


@[simp]
theorem toIcoDiv_apply_left (a : α) : toIcoDiv hp a a = 0

{α : Type u_1}
[LinearOrderedAddCommGroup α]
[hα : Archimedean α]
{p : α}
(hp : 0 < p)
(a : α)


lemma filter_attach (p : α → Prop) [DecidablePred p] (s : Finset α) :
    s.attach.filter (fun a : s ↦ p a) =
      (s.filter p).attach.map ((Embedding.refl _).subtypeMap mem_of_mem_filter)

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

Finset.filter (fun a => p ↑a) s.attach =
  Finset.map ((Function.Embedding.refl α).subtypeMap ⋯) (Finset.filter p s).attach


/-- A structure is finitely generated if it is the closure of a finite subset. -/
class FG : Prop where
  out : (⊤ : L.Substructure M).FG

[self : FirstOrder.Language.Structure.FG L M]


@[norm_cast]
theorem nsmul_coe (q : ℚ≥0) (n : ℕ) : ↑(n • q) = n • (q : ℚ)


@[simp] theorem enum_length : (enum l).length = l.length

∀ {α : Type u_1} {l : List α}, l.enum.length = l.length


@[to_additive]
theorem pow_inj_iff_of_orderOf_eq_zero (h : orderOf x = 0) {n m : ℕ} : x ^ n = x ^ m ↔ n = m

{G : Type u_1}
[AddLeftCancelMonoid G]
{x : G}
(h : addOrderOf x = 0)
{n m : ℕ}


theorem eq_id_of_isIso {x : SimplexCategory} (f : x ⟶ x) [IsIso f] : f = 𝟙 _

{x : SimplexCategory}
(f : x ⟶ x)
[CategoryTheory.IsIso f]


theorem IsLocalExtrOn.comp_continuousOn [TopologicalSpace δ] {t : Set α} {s : Set δ} (g : δ → α)
    {b : δ} (hf : IsLocalExtrOn f t (g b)) (hst : s ⊆ g ⁻¹' t) (hg : ContinuousOn g s)
    (hb : b ∈ s) : IsLocalExtrOn (f ∘ g) s b

{α : Type u}
{β : Type v}
{δ : Type x}
[TopologicalSpace α]
[Preorder β]
{f : α → β}
[TopologicalSpace δ]
{t : Set α}
{s : Set δ}
(g : δ → α)
{b : δ}
(hf : IsLocalExtrOn f t (g b))
(hst : s ⊆ g ⁻¹' t)
(hg : ContinuousOn g s)
(hb : b ∈ s)


/-- The identity equivalence from a first-order language to itself. -/
@[simps]
protected def refl : L ≃ᴸ L

(FirstOrder.Language.LEquiv.refl L).invLHom = FirstOrder.Language.LHom.id L


theorem succ_le_of_lt {x y : s} (h : y < x) : succ y ≤ x

{s : Set ℕ}
[Infinite ↑s]
[DecidablePred fun x => x ∈ s]
{x y : ↑s}
(h : y < x)


theorem wp_ind {α : TypeVec n} {C : ∀ x : P.last.W, P.WPath x ⟹ α → Prop}
    (ih : ∀ (a : P.A) (f : P.last.B a → P.last.W) (f' : P.WPath ⟨a, f⟩ ⟹ α),
        (∀ i : P.last.B a, C (f i) (P.wPathDestRight f' i)) → C ⟨a, f⟩ f') :
    ∀ (x : P.last.W) (f' : P.WPath x ⟹ α), C x f'

{C : (x : P.last.W) → TypeVec.Arrow (P.WPath x) α → Prop}

(ih :
  ∀ (a : P.A) (f : P.last.B a → P.last.W) (f' : TypeVec.Arrow (P.WPath (WType.mk a f)) α),
    (∀ (i : P.last.B a), C (f i) (P.wPathDestRight f' i)) → C (WType.mk a f) f')


/-- A functor induces a functor of matrix categories.
-/
@[simps]
def mapMat_ (F : C ⥤ D) [Functor.Additive F] : Mat_ C ⥤ Mat_ D

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Preadditive C]
{D : Type u_1}
[CategoryTheory.Category.{v₁, u_1} D]
[CategoryTheory.Preadditive D]
(F : C ⥤ D)
[F.Additive]
(M : CategoryTheory.Mat_ C)


theorem card_eq_sum_ones {α} [Fintype α] : Fintype.card α = ∑ _a : α, 1


/-- A functor `F : J ⥤ CommGrp.{u}` has a limit iff `(F ⋙ forget CommGrp).sections` is
`u`-small.  -/
@[to_additive "A functor `F : J ⥤ AddCommGrp.{u}` has a limit iff
`(F ⋙ forget AddCommGrp).sections` is `u`-small."]
lemma hasLimit_iff_small_sections :
    HasLimit F ↔ Small.{u} (F ⋙ forget CommGrp).sections

{J : Type v}
[CategoryTheory.Category.{w, v} J]
(F : J ⥤ AddCommGrp)

CategoryTheory.Limits.HasLimit F ↔ Small.{u, max u v} ↑(F ⋙ CategoryTheory.forget AddCommGrp).sections


theorem toIcoMod_neg' (a b : α) : toIcoMod hp (-a) b = p - toIocMod hp a (-b)

{α : Type u_1}
[LinearOrderedAddCommGroup α]
[hα : Archimedean α]
{p : α}
(hp : 0 < p)
(a b : α)


theorem IntegrableOn.congr_fun (h : IntegrableOn f s μ) (hst : EqOn f g s) (hs : MeasurableSet s) :
    IntegrableOn g s μ

{α : Type u_1}
{E : Type u_3}
[MeasurableSpace α]
[NormedAddCommGroup E]
{f g : α → E}
{s : Set α}
{μ : MeasureTheory.Measure α}
(h : MeasureTheory.IntegrableOn f s μ)
(hst : Set.EqOn f g s)
(hs : MeasurableSet s)


theorem mem_lpMeasSubgroup_iff_aeStronglyMeasurable' {m m0 : MeasurableSpace α} {μ : Measure α}
    {f : Lp F p μ} : f ∈ lpMeasSubgroup F m p μ ↔ AEStronglyMeasurable' m f μ

{α : Type u_1}
{F : Type u_3}
{p : ℝ≥0∞}
[NormedAddCommGroup F]
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : ↥(MeasureTheory.Lp F p μ)}

f ∈ MeasureTheory.lpMeasSubgroup F m p μ ↔ MeasureTheory.AEStronglyMeasurable' m (↑↑f) μ


/-- `Prop` structure holding the hypotheses of the Picard-Lindelöf theorem.

The similarly named `PicardLindelof` structure is part of the internal API for convenience, so as
not to constantly invoke choice, but is not intended for public use. -/
structure IsPicardLindelof {E : Type*} [NormedAddCommGroup E] (v : ℝ → E → E) (tMin t₀ tMax : ℝ)
    (x₀ : E) (L : ℝ≥0) (R C : ℝ) : Prop where
  ht₀ : t₀ ∈ Icc tMin tMax
  hR : 0 ≤ R
  lipschitz : ∀ t ∈ Icc tMin tMax, LipschitzOnWith L (v t) (closedBall x₀ R)
  cont : ∀ x ∈ closedBall x₀ R, ContinuousOn (fun t : ℝ => v t x) (Icc tMin tMax)
  norm_le : ∀ t ∈ Icc tMin tMax, ∀ x ∈ closedBall x₀ R, ‖v t x‖ ≤ C
  C_mul_le_R : (C : ℝ) * max (tMax - t₀) (t₀ - tMin) ≤ R

(self : IsPicardLindelof v tMin t₀ tMax x₀ L R C)

t ∈ Set.Icc tMin tMax → ∀ x ∈ Metric.closedBall x₀ R, ‖v t x‖ ≤ C


/-- `QuaternionAlgebra.re` as a `LinearMap`-/
@[simps]
def reₗ : ℍ[R,c₁,c₂] →ₗ[R] R

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

(QuaternionAlgebra.reₗ c₁ c₂) self = self.re


@[simp]
theorem coe_strictlyPositive : ↑(strictlyPositive 𝕜 E) = Set.Ioi (0 : E)

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

↑(ConvexCone.strictlyPositive 𝕜 E) = Set.Ioi 0


lemma Subtype.dist_eq {p : α → Prop} (x y : Subtype p) : dist x y = dist (x : α) y

{α : Type u_1}
[PseudoMetricSpace α]
{p : α → Prop}
(x y : Subtype p)


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

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

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

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


theorem X_pow_sub_X_sub_one_irreducible (hn1 : n ≠ 1) : Irreducible (X ^ n - X - 1 : ℤ[X])

Irreducible (Polynomial.X ^ n - Polynomial.X - 1)


theorem nnnorm_algebraMap (x : 𝕜) : ‖algebraMap 𝕜 𝕜' x‖₊ = ‖x‖₊ * ‖(1 : 𝕜')‖₊

{𝕜 : Type u_1}
(𝕜' : Type u_2)
[NormedField 𝕜]
[SeminormedRing 𝕜']
[NormedAlgebra 𝕜 𝕜']
(x : 𝕜)


theorem disjoint_def {p p' : Submodule R M} : Disjoint p p' ↔ ∀ x ∈ p, x ∈ p' → x = (0 : M)

{R : Type u_1}
{M : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{p p' : Submodule R M}


@[reassoc]
lemma restrictScalarsId'App_hom_naturality {M N : ModuleCat R} (φ : M ⟶ N) :
    (restrictScalars f).map φ ≫ (restrictScalarsId'App f hf N).hom =
      (restrictScalarsId'App f hf M).hom ≫ φ

{R : Type u₁}
[Ring R]
(f : R →+* R)
(hf : f = RingHom.id R)
{M N : ModuleCat R}
(φ : M ⟶ N)

(ModuleCat.restrictScalars f).map φ ≫ (ModuleCat.restrictScalarsId'App f hf N).hom =
  (ModuleCat.restrictScalarsId'App f hf M).hom ≫ φ


theorem IsSwap.of_subtype_isSwap {p : α → Prop} [DecidablePred p] {f : Perm (Subtype p)}
    (h : f.IsSwap) : (ofSubtype f).IsSwap

{α : Type u_1}
[DecidableEq α]
{p : α → Prop}
[DecidablePred p]
{f : Equiv.Perm (Subtype p)}
(h : f.IsSwap)


lemma coe_corootSpace_eq_span_singleton' (α : Weight K H L) :
    (corootSpace α).toSubmodule = K ∙ (cartanEquivDual H).symm α

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

↑(LieAlgebra.corootSpace ⇑α) =
  Submodule.span K {(LieAlgebra.IsKilling.cartanEquivDual H).symm (LieModule.Weight.toLinear K (↥H) L α)}


theorem balancedCore_mem_nhds_zero (hU : U ∈ 𝓝 (0 : E)) : balancedCore 𝕜 U ∈ 𝓝 (0 : E)

{𝕜 : Type u_1}
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[ContinuousSMul 𝕜 E]
{U : Set E}
(hU : U ∈ 𝓝 0)


theorem limsup_measure_compl_le_of_le_liminf_measure {ι : Type*} {L : Filter ι} {μ : Measure Ω}
    {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
    (E_mble : MeasurableSet E) (h : μ E ≤ L.liminf fun i => μs i E) :
    (L.limsup fun i => μs i Eᶜ) ≤ μ Eᶜ

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

(h : μ E ≤ Filter.liminf (fun i => (μs i) E) L)

Filter.limsup (fun i => (μs i) Eᶜ) L ≤ μ Eᶜ


theorem existsUnique_isIdempotentElem_eq_of_ker_isNilpotent (h : ∀ x ∈ RingHom.ker f, IsNilpotent x)
    (e : S) (he : e ∈ f.range) (he' : IsIdempotentElem e) :
    ∃! e' : R, IsIdempotentElem e' ∧ f e' = e


/-- An ideal is trivial if its localization at every maximal ideal is trivial. -/
theorem ideal_eq_bot_of_localization (I : Ideal R)
    (h : ∀ (J : Ideal R) (hJ : J.IsMaximal),
      IsLocalization.coeSubmodule (Localization.AtPrime J) I = ⊥) :
    I = ⊥


/-- Suppose that `f` sends the complement to `s` to a single point `x`, and `l` is some filter.
Then `f` tends to `x` along `l` restricted to `s` if and only if it tends to `x` along `l`. -/
theorem tendsto_inf_principal_nhds_iff_of_forall_eq {f : α → X} {l : Filter α} {s : Set α}
    (h : ∀ a ∉ s, f a = x) : Tendsto f (l ⊓ 𝓟 s) (𝓝 x) ↔ Tendsto f l (𝓝 x)

{X : Type u}
{α : Type u_1}
{x : X}
[TopologicalSpace X]
{f : α → X}
{l : Filter α}
{s : Set α}
(h : ∀ a ∉ s, f a = x)

Filter.Tendsto f (l ⊓ 𝓟 s) (𝓝 x) ↔ Filter.Tendsto f l (𝓝 x)


@[simp]
theorem floor_natCast (n : ℕ) : ⌊(n : α)⌋₊ = n

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
(n : ℕ)


theorem IsCoprime.mul_right (H1 : IsCoprime x y) (H2 : IsCoprime x z) : IsCoprime x (y * z)

{R : Type u}
[CommSemiring R]
{x y z : R}
(H1 : IsCoprime x y)
(H2 : IsCoprime x z)


/-- `t` is in the upper shadow of `𝒜` iff `t` is exactly `k` elements less than something from `𝒜`.

See also `Finset.mem_upShadow_iff_exists_mem_card_add`. -/
lemma mem_upShadow_iterate_iff_exists_sdiff :
    t ∈ ∂⁺^[k] 𝒜 ↔ ∃ s ∈ 𝒜, s ⊆ t ∧ (t \ s).card = k

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{𝒜 : Finset (Finset α)}
{t : Finset α}
{k : ℕ}

t ∈ Finset.upShadow^[k] 𝒜 ↔ ∃ s ∈ 𝒜, s ⊆ t ∧ (t \ s).card = k


lemma isLocallyInjective_presheafToSheaf_map_iff :
    Sheaf.IsLocallyInjective ((presheafToSheaf J A).map φ) ↔ IsLocallyInjective J φ

(J : CategoryTheory.GrothendieckTopology C)

CategoryTheory.Sheaf.IsLocallyInjective ((CategoryTheory.presheafToSheaf J A).map φ) ↔
  CategoryTheory.Presheaf.IsLocallyInjective J φ


lemma biUnion_image_sdiff_right : t.biUnion (fun b ↦ s.image (· \ b)) = s \\ t

{α : Type u_2}
[DecidableEq α]
[GeneralizedBooleanAlgebra α]
(s t : Finset α)

(t.biUnion fun b => Finset.image (fun x => x \ b) s) = s.diffs t


@[simp]
theorem neg_fst : (-x).fst = -x.fst

{p : ℝ≥0∞}
{α : Type u_2}
{β : Type u_3}
[AddCommGroup α]
[AddCommGroup β]
(x : WithLp p (α × β))


lemma piCongrLeft_apply_apply {ι ι' : Type*} (e : ι ≃ ι') {β : ι' → Type*}
    [∀ i', MeasurableSpace (β i')] (x : (i : ι) → β (e i)) (i : ι) :
    piCongrLeft (fun i' ↦ β i') e x (e i) = x i

{ι : Type u_8}
{ι' : Type u_9}
(e : ι ≃ ι')
{β : ι' → Type u_10}
[(i' : ι') → MeasurableSpace (β i')]
(x : (i : ι) → β (e i))
(i : ι)

(MeasurableEquiv.piCongrLeft (fun i' => β i') e) x (e i) = x i


@[to_additive]
theorem Group.fg_iff' :
    Group.FG G ↔ ∃ (n : _) (S : Finset G), S.card = n ∧ Subgroup.closure (S : Set G) = ⊤

Group.FG G ↔ ∃ n S, S.card = n ∧ Subgroup.closure ↑S = ⊤


@[simp]
theorem quotientMulEquivQuotientProd_snd (I J : Ideal R) (coprime : IsCoprime I J) (x : R ⧸ I * J) :
    (quotientMulEquivQuotientProd I J coprime x).snd =
      Ideal.Quotient.factor (I * J) J mul_le_left x

{R : Type u}
[CommRing R]
(I J : Ideal R)
(coprime : IsCoprime I J)
(x : R ⧸ I * J)

((I.quotientMulEquivQuotientProd J coprime) x).2 = (Ideal.Quotient.factor (I * J) J ⋯) x


theorem norm_image_zero_le : ‖f 0‖ ≤ ‖f‖

{𝕜 : Type u_1}
{V : Type u_3}
{W : Type u_4}
[NormedAddCommGroup V]
[NormedAddCommGroup W]
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 V]
[NormedSpace 𝕜 W]
(f : V →ᴬ[𝕜] W)


/-- Variant of `mul_lt_of_lt_one_right` for `a` negative instead of positive. -/
theorem lt_mul_of_lt_one_right [ExistsAddOfLE α] [PosMulStrictMono α]
    [CovariantClass α α (swap (· + ·)) (· < ·)] [ContravariantClass α α (swap (· + ·)) (· < ·)]
    (ha : a < 0) (h : b < 1) : a < a * b

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

[ContravariantClass α α (Function.swap fun x x_1 => x + x_1) fun x x_1 => x < x_1]


@[simp, mfld_simps]
theorem trivializationAt_fst (x : M) (z : TM) : (trivializationAt E (TangentSpace I) x z).1 = z.1

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_4}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
(M : Type u_6)
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
(x : M)
(z : TangentBundle I M)

(↑(trivializationAt E (TangentSpace I) x) z).1 = z.proj


theorem sum_smul (n : ℕ) :
    (∑ ν ∈ Finset.range (n + 1), ν • bernsteinPolynomial R n ν) = n • X

∑ ν ∈ Finset.range (n + 1), ν • bernsteinPolynomial R n ν = n • Polynomial.X


theorem revzip_swap (l : List α) : (revzip l).map Prod.swap = revzip l.reverse

List.map Prod.swap l.revzip = l.reverse.revzip


@[simp]
theorem coe_id : ⇑(NonUnitalAlgHom.id R A) = id

{R : Type u}
[Monoid R]
{A : Type v}
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]


/-- Determinant of a 2×2 block matrix, expanded around an invertible top left element in terms of
the Schur complement. -/
theorem det_fromBlocks₁₁ (A : Matrix m m α) (B : Matrix m n α) (C : Matrix n m α)
    (D : Matrix n n α) [Invertible A] :
    (Matrix.fromBlocks A B C D).det = det A * det (D - C * ⅟ A * B)

{m : Type u_2}
{n : Type u_3}
{α : Type u_4}
[Fintype m]
[Fintype n]
[DecidableEq m]
[DecidableEq n]
[CommRing α]
(A : Matrix m m α)
(B : Matrix m n α)
(C : Matrix n m α)
(D : Matrix n n α)
[Invertible A]

(Matrix.fromBlocks A B C D).det = A.det * (D - C * ⅟A * B).det


protected theorem StrictMono.ite' (hf : StrictMono f) (hg : StrictMono g) {p : α → Prop}
    [DecidablePred p]
    (hp : ∀ ⦃x y⦄, x < y → p y → p x) (hfg : ∀ ⦃x y⦄, p x → ¬p y → x < y → f x < g y) :
    StrictMono fun x ↦ if p x then f x else g x

(hfg : ∀ ⦃x y : α⦄, p x → ¬p y → x < y → f x < g y)

StrictMono fun x => if p x then f x else g x


theorem mem_closure_of_tendsto {f : α → X} {b : Filter α} [NeBot b]
    (hf : Tendsto f b (𝓝 x)) (h : ∀ᶠ x in b, f x ∈ s) : x ∈ closure s

{X : Type u}
{α : Type u_1}
{x : X}
{s : Set X}
[TopologicalSpace X]
{f : α → X}
{b : Filter α}
[b.NeBot]
(hf : Filter.Tendsto f b (𝓝 x))
(h : ∀ᶠ (x : α) in b, f x ∈ s)


@[to_additive]
theorem eq_top_iff' : H = ⊤ ↔ ∀ x : G, x ∈ H

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


theorem coe_add_period (x : 𝕜) : ((x + p : 𝕜) : AddCircle p) = x

{𝕜 : Type u_1}
[LinearOrderedAddCommGroup 𝕜]
(p x : 𝕜)


theorem map_sup (s t : IntermediateField F E) (f : E →ₐ[F] K) : (s ⊔ t).map f = s.map f ⊔ t.map f

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
{K : Type u_3}
[Field K]
[Algebra F K]
(s t : IntermediateField F E)
(f : E →ₐ[F] K)

IntermediateField.map f (s ⊔ t) = IntermediateField.map f s ⊔ IntermediateField.map f t


@[simp]
theorem comp_id (f : LatticeHom α β) : f.comp (LatticeHom.id α) = f

{α : Type u_3}
{β : Type u_4}
[Lattice α]
[Lattice β]
(f : LatticeHom α β)


theorem le_restrict_univ_iff_le : v ≤[Set.univ] w ↔ v ≤ w

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

v.restrict Set.univ ≤ w.restrict Set.univ ↔ v ≤ w


lemma differentialIdeal_le_iff {I : Ideal B} (hI : I ≠ ⊥) [NoZeroSMulDivisors A B] :
    differentIdeal A B ≤ I ↔ (((I⁻¹ : FractionalIdeal B⁰ L) : Submodule B L).restrictScalars A).map
      ((Algebra.trace K L).restrictScalars A) ≤ 1

{A : Type u_1}
{K : Type u_2}
{L : Type u}
{B : Type u_3}
[CommRing A]
[Field K]
[CommRing B]
[Field L]
[Algebra A K]
[Algebra B L]
[Algebra A B]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[IsScalarTower A B L]
[IsDomain A]
[IsFractionRing A K]
[IsIntegralClosure B A L]
[IsFractionRing B L]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]
[IsIntegrallyClosed A]
[IsDedekindDomain B]
{I : Ideal B}
(hI : I ≠ ⊥)
[NoZeroSMulDivisors A B]

differentIdeal A B ≤ I ↔ Submodule.map (↑A (Algebra.trace K L)) (Submodule.restrictScalars A ↑(↑I)⁻¹) ≤ 1


/-- If `c` is a limiting pullback cone, then we have an `IsPullback c.fst c.snd f g`. -/
theorem of_isLimit {c : PullbackCone f g} (h : Limits.IsLimit c) : IsPullback c.fst c.snd f g

{c : CategoryTheory.Limits.PullbackCone f g}

CategoryTheory.IsPullback c.fst c.snd f g


/-- In a semiring of sets `C`, for all set `s ∈ C` and finite set of sets `I ⊆ C`, there is a
finite set of sets in `C` whose union is `s \ ⋃₀ I`.
See `IsSetSemiring.diffFinset₀` for a definition that gives such a set. -/
lemma exists_disjoint_finset_diff_eq (hC : IsSetSemiring C) (hs : s ∈ C) (hI : ↑I ⊆ C) :
    ∃ J : Finset (Set α), ↑J ⊆ C ∧ PairwiseDisjoint (J : Set (Set α)) id ∧
      s \ ⋃₀ I = ⋃₀ J

{α : Type u_1}
{C : Set (Set α)}
{s : Set α}
{I : Finset (Set α)}
(hC : MeasureTheory.IsSetSemiring C)
(hs : s ∈ C)
(hI : ↑I ⊆ C)

∃ J, ↑J ⊆ C ∧ (↑J).PairwiseDisjoint id ∧ s \ ⋃₀ ↑I = ⋃₀ ↑J


protected theorem forall₃_congr'
    {α₁ α₂ β₁ β₂ γ₁ γ₂ : Sort*} {p : α₁ → β₁ → γ₁ → Prop} {q : α₂ → β₂ → γ₂ → Prop}
    (eα : α₁ ≃ α₂) (eβ : β₁ ≃ β₂) (eγ : γ₁ ≃ γ₂)
    (h : ∀ {x y z}, p (eα.symm x) (eβ.symm y) (eγ.symm z) ↔ q x y z) :
    (∀ x y z, p x y z) ↔ ∀ x y z, q x y z

{p : α₁ → β₁ → γ₁ → Prop}

{q : α₂ → β₂ → γ₂ → Prop}

(eα : α₁ ≃ α₂)

(eβ : β₁ ≃ β₂)

(eγ : γ₁ ≃ γ₂)

(h : ∀ {x : α₂} {y : β₂} {z : γ₂}, p (eα.symm x) (eβ.symm y) (eγ.symm z) ↔ q x y z)

(∀ (x : α₁) (y : β₁) (z : γ₁), p x y z) ↔ ∀ (x : α₂) (y : β₂) (z : γ₂), q x y z


theorem HasFPowerSeriesAt.eventually_hasSum (hf : HasFPowerSeriesAt f p x) :
    ∀ᶠ y in 𝓝 0, HasSum (fun n : ℕ => p n fun _ : Fin n => y) (f (x + y))

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{x : E}
(hf : HasFPowerSeriesAt f p x)

∀ᶠ (y : E) in 𝓝 0, HasSum (fun n => (p n) fun x => y) (f (x + y))


lemma cfc_le_one (f : R → R) (a : A) (h : ∀ x ∈ spectrum R a, f x ≤ 1) : cfc f a ≤ 1

[∀ (α : Type u_1) [inst : TopologicalSpace α], StarOrderedRing C(α, R)]


/--
To give a continuous map out of a disjoint union, it suffices to give a continuous map out of
each term. This is `Sigma.uncurry` for continuous maps.
-/
@[simps]
def sigma (f : ∀ i, C(X i, A)) : C((Σ i, X i), A)

{I : Type u_5}
{A : Type u_6}
{X : I → Type u_7}
[TopologicalSpace A]
[(i : I) → TopologicalSpace (X i)]
(f : (i : I) → C(X i, A))
(ig : (i : I) × X i)

(ContinuousMap.sigma f) ig = (f ig.fst) ig.snd


/-- If `v ≠ w` are two maximal ideals of `R`, then `val_v(w) = 0`. -/
theorem count_maximal_coprime {w : HeightOneSpectrum R} (hw : w ≠ v) :
    count K v (w.asIdeal : FractionalIdeal R⁰ K) = 0

(v : IsDedekindDomain.HeightOneSpectrum R)

{w : IsDedekindDomain.HeightOneSpectrum R}

FractionalIdeal.count K v ↑w.asIdeal = 0


theorem OrdConnected.uIoc_subset (hs : OrdConnected s) ⦃x⦄ (hx : x ∈ s) ⦃y⦄ (hy : y ∈ s) :
    Ι x y ⊆ s

{α : Type u_1}
[LinearOrder α]
{s : Set α}
(hs : s.OrdConnected)
⦃x : α⦄
(hx : x ∈ s)
⦃y : α⦄
(hy : y ∈ s)


@[simp, nolint simpNF]
theorem zero_eq_bot : (0 : Ideal R) = ⊥


@[to_additive]
theorem relindex_iInf_le {ι : Type*} [Fintype ι] (f : ι → Subgroup G) :
    (⨅ i, f i).relindex L ≤ ∏ i, (f i).relindex L

{G : Type u_1}
[AddGroup G]
{L : AddSubgroup G}
{ι : Type u_3}
[Fintype ι]
(f : ι → AddSubgroup G)

(⨅ i, f i).relindex L ≤ ∏ i : ι, (f i).relindex L


/-- If we fix a background affine basis `b`, then for any other basis `b₂`, we can characterise
the barycentric coordinates provided by `b₂` in terms of determinants relative to `b`. -/
theorem det_smul_coords_eq_cramer_coords (x : P) :
    (b.toMatrix b₂).det • b₂.coords x = (b.toMatrix b₂)ᵀ.cramer (b.coords x)

{ι : Type u₁}
{k : Type u₂}
{V : Type u₃}
{P : Type u₄}
[AddCommGroup V]
[AffineSpace V P]
[CommRing k]
[Module k V]
[DecidableEq ι]
[Fintype ι]
(b b₂ : AffineBasis ι k P)
(x : P)

(b.toMatrix ⇑b₂).det • b₂.coords x = (b.toMatrix ⇑b₂)ᵀ.cramer (b.coords x)


/-- The Schnirelmann density of `A` containing `0` is `1` if and only if `A` is the naturals. -/
lemma schnirelmannDensity_eq_one_iff_of_zero_mem (hA : 0 ∈ A) :
    schnirelmannDensity A = 1 ↔ A = Set.univ

{A : Set ℕ}
[DecidablePred fun x => x ∈ A]
(hA : 0 ∈ A)


/-- A half-braiding on `X : C` is a family of isomorphisms `X ⊗ U ≅ U ⊗ X`,
monoidally natural in `U : C`.

Thinking of `C` as a 2-category with a single `0`-morphism, these are the same as natural
transformations (in the pseudo- sense) of the identity 2-functor on `C`, which send the unique
`0`-morphism to `X`.
-/
-- @[nolint has_nonempty_instance] -- Porting note(#5171): This linter does not exist yet.
structure HalfBraiding (X : C) where
  β : ∀ U, X ⊗ U ≅ U ⊗ X
  monoidal : ∀ U U', (β (U ⊗ U')).hom =
      (α_ _ _ _).inv ≫
        ((β U).hom ▷ U') ≫ (α_ _ _ _).hom ≫ (U ◁ (β U').hom) ≫ (α_ _ _ _).inv := by
    aesop_cat
  naturality : ∀ {U U'} (f : U ⟶ U'), (X ◁ f) ≫ (β U').hom = (β U).hom ≫ (f ▷ X) := by
    aesop_cat

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{X : C}
(self : CategoryTheory.HalfBraiding X)
{U U' : C}
(f : U ⟶ U')

X ◁ f ≫ (self.β U').hom = (self.β U).hom ≫ f ▷ X


theorem measurableSet_integrable [SFinite ν] ⦃f : α → β → E⦄
    (hf : StronglyMeasurable (uncurry f)) : MeasurableSet {x | Integrable (f x) ν}

⦃f : α → β → E⦄

(hf : MeasureTheory.StronglyMeasurable (Function.uncurry f))

MeasurableSet {x | MeasureTheory.Integrable (f x) ν}


@[to_additive (attr := simp)]
theorem map_id : map (MulHom.id α) = MonoidHom.id (WithOne α)

WithOne.map (MulHom.id α) = MonoidHom.id (WithOne α)


@[to_additive AddCommute.prod]
theorem Commute.prod {x y : M × N} (hm : Commute x.1 y.1) (hn : Commute x.2 y.2) : Commute x y

{M : Type u_5}
{N : Type u_6}
[Add M]
[Add N]
{x y : M × N}
(hm : AddCommute x.1 y.1)
(hn : AddCommute x.2 y.2)


theorem enumFrom_eq_zip_range' (l : List α) {n : ℕ} : l.enumFrom n = (range' n l.length).zip l

List.enumFrom n l = (List.range' n l.length).zip l


@[ext]
lemma opcycles_ext {A : C} (f₁ f₂ : S.opcycles ⟶ A)
    (h : S.pOpcycles ≫ f₁ = S.pOpcycles ≫ f₂) : f₁ = f₂

(h : CategoryTheory.CategoryStruct.comp S.pOpcycles f₁ = CategoryTheory.CategoryStruct.comp S.pOpcycles f₂)


@[simp]
theorem offDiag_empty : (∅ : Set α).offDiag = ∅


@[reassoc (attr := simp)]
theorem inv_hom_whiskerRight' {X Y : C} (f : X ⟶ Y) [IsIso f] (Z : C) :
    inv f ▷ Z ≫ f ▷ Z = 𝟙 (Y ⊗ Z)

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.inv f) Z)
    (CategoryTheory.MonoidalCategory.whiskerRight f Z) =
  CategoryTheory.CategoryStruct.id (CategoryTheory.MonoidalCategory.tensorObj Y Z)


theorem setLIntegral_strict_mono {f g : α → ℝ≥0∞} {s : Set α} (hsm : MeasurableSet s)
    (hs : μ s ≠ 0) (hg : Measurable g) (hfi : ∫⁻ x in s, f x ∂μ ≠ ∞)
    (h : ∀ᵐ x ∂μ, x ∈ s → f x < g x) : ∫⁻ x in s, f x ∂μ < ∫⁻ x in s, g x ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : α → ℝ≥0∞}
{s : Set α}
(hsm : MeasurableSet s)
(hs : μ s ≠ 0)
(hg : Measurable g)
(hfi : ∫⁻ (x : α) in s, f x ∂μ ≠ ⊤)
(h : ∀ᵐ (x : α) ∂μ, x ∈ s → f x < g x)

∫⁻ (x : α) in s, f x ∂μ < ∫⁻ (x : α) in s, g x ∂μ


theorem Hom.eq_cast_iff_heq {u v u' v' : U} (hu : u = u') (hv : v = v') (e : u ⟶ v) (e' : u' ⟶ v') :
    e' = e.cast hu hv ↔ HEq e' e

{U : Type u_1}
[Quiver U]
{u v u' v' : U}
(hu : u = u')
(hv : v = v')
(e : u ⟶ v)
(e' : u' ⟶ v')


/-- For any element `x` of `M ⊗[R] N`, there exists a finite subset `{ (m_i, n_i) }`
of `M × N` such that each `n_i` is distinct (we represent it as an element of `N →₀ M`),
such that `x` is equal to the sum of `m_i ⊗ₜ[R] n_i`. -/
theorem exists_finsupp_right (x : M ⊗[R] N) :
    ∃ S : N →₀ M, x = S.sum fun n m ↦ m ⊗ₜ[R] n

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[CommSemiring R]
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
(x : M ⊗[R] N)


protected theorem bind_pure_comp [Monad m] (f : α → β) (x : ExceptT ε m α) : x >>= pure ∘ f = f <$> x

{m : Type u_1 → Type u_2}
{α β ε : Type u_1}
[Monad m]
(f : α → β)
(x : ExceptT ε m α)


theorem IsLUB.exists_seq_strictMono_tendsto_of_not_mem {t : Set α} {x : α}
    [IsCountablyGenerated (𝓝 x)] (htx : IsLUB t x) (not_mem : x ∉ t) (ht : t.Nonempty) :
    ∃ u : ℕ → α, StrictMono u ∧ (∀ n, u n < x) ∧ Tendsto u atTop (𝓝 x) ∧ ∀ n, u n ∈ t

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{t : Set α}
{x : α}
[(𝓝 x).IsCountablyGenerated]
(htx : IsLUB t x)
(not_mem : x ∉ t)
(ht : t.Nonempty)

∃ u, StrictMono u ∧ (∀ (n : ℕ), u n < x) ∧ Filter.Tendsto u Filter.atTop (𝓝 x) ∧ ∀ (n : ℕ), u n ∈ t


theorem res_injective : Injective (@res α)


@[simp]
theorem Fintype.card_finset [Fintype α] : Fintype.card (Finset α) = 2 ^ Fintype.card α


@[simp] theorem preimage_Ioi : e ⁻¹' Ioi (e x) = Ioi x

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


@[simp]
theorem aemeasurable_smul_measure_iff {c : ℝ≥0∞} (hc : c ≠ 0) :
    AEMeasurable f (c • μ) ↔ AEMeasurable f μ

{α : Type u_2}
{β : Type u_3}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{f : α → β}
{μ : MeasureTheory.Measure α}
{c : ℝ≥0∞}
(hc : c ≠ 0)


@[to_additive (attr := simp, norm_cast) existing AddGroupSeminorm.coe_smul]
theorem coe_smul (r : R) (p : GroupSeminorm E) : ⇑(r • p) = r • ⇑p

{R : Type u_2}
{E : Type u_4}
[Group E]
[SMul R ℝ]
[SMul R ℝ≥0]
[IsScalarTower R ℝ≥0 ℝ]
(r : R)
(p : GroupSeminorm E)


/-- The disjoint union of antidiagonals `Σ (n : A), antidiagonal n` is equivalent to the product
    `A × A`. This is such an equivalence, obtained by mapping `(n, (k, l))` to `(k, l)`. -/
@[simps]
def sigmaAntidiagonalEquivProd [AddMonoid A] [HasAntidiagonal A] :
    (Σ n : A, antidiagonal n) ≃ A × A

{A : Type u_1}
[AddMonoid A]
[Finset.HasAntidiagonal A]
(x : A × A)

↑(Finset.sigmaAntidiagonalEquivProd.symm x).snd = x


/-- For any `a : α`, the fiber over `some a` is the set of permutations
    where `a` is the only possible fixed point. -/
theorem RemoveNone.fiber_some (a : α) :
    RemoveNone.fiber (some a) = { f : Perm α | fixedPoints f ⊆ {a} }

derangements.Equiv.RemoveNone.fiber (some a) = {f | Function.fixedPoints ⇑f ⊆ {a}}


lemma ext_r (s s' : S.Splitting) (h : s.r = s'.r) : s = s'

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{S : CategoryTheory.ShortComplex C}
(s s' : S.Splitting)
(h : s.r = s'.r)


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

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


/-- Given a short exact complex `S` in `C` that is short exact (`hS`), this is the
canonical isomorphism between the triangle `hS.singleTriangle` in the derived category
and the triangle attached to the corresponding short exact sequence of cochain complexes
after the application of the single functor. -/
@[simps!]
noncomputable def singleTriangleIso :
    hS.singleTriangle ≅
      triangleOfSES (hS.map_of_exact (HomologicalComplex.single C (ComplexShape.up ℤ) 0))

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
[HasDerivedCategory C]
{S : CategoryTheory.ShortComplex C}
(hS : S.ShortExact)

hS.singleTriangleIso.inv.hom₂ = ((DerivedCategory.singleFunctorsPostcompQIso C).inv.hom 0).app S.X₂


@[simp, norm_cast]
theorem coeff_coe (n : σ →₀ ℕ) : MvPowerSeries.coeff R n ↑φ = coeff n φ

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

(MvPowerSeries.coeff R n) ↑φ = MvPolynomial.coeff n φ


@[simp]
theorem cof_succ (o) : cof (succ o) = 1


theorem IsMatching.toEdge_eq_of_adj (h : M.IsMatching) (hv : v ∈ M.verts) (hvw : M.Adj v w) :
    h.toEdge ⟨v, hv⟩ = ⟨s(v, w), hvw⟩

{V : Type u_1}
{G : SimpleGraph V}
{M : G.Subgraph}
{v w : V}
(h : M.IsMatching)
(hv : v ∈ M.verts)
(hvw : M.Adj v w)


@[to_additive (attr := simp)]
theorem ndrec_mk {p : Localization S → Sort u} (f : ∀ (a : M) (b : S), p (mk a b)) (H) (a : M)
    (b : S) : (rec f H (mk a b) : p (mk a b)) = f a b

(f : (a : M) → (b : ↥S) → p (Localization.mk a b))

(H : ∀ {a c : M} {b d : ↥S} (h : (Localization.r S) (a, b) (c, d)), ⋯ ▸ f a b = f c d)

Localization.rec f H (Localization.mk a b) = f a b


theorem superpolynomialDecay_param_pow_mul_iff (hk : Tendsto k l atTop) (n : ℕ) :
    SuperpolynomialDecay l k (k ^ n * f) ↔ SuperpolynomialDecay l k f

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
{k : α → β}
(f : α → β)
[TopologicalSpace β]
[LinearOrderedField β]
[OrderTopology β]
(hk : Filter.Tendsto k l Filter.atTop)
(n : ℕ)

Asymptotics.SuperpolynomialDecay l k (k ^ n * f) ↔ Asymptotics.SuperpolynomialDecay l k f


theorem Γ_obj_op (X : LocallyRingedSpace.{u}) : Γ.obj (op X) = X.presheaf.obj (op ⊤)

AlgebraicGeometry.LocallyRingedSpace.Γ.obj (Opposite.op X) = X.presheaf.obj (Opposite.op ⊤)


@[simp]
theorem gradient_const' : (∇ fun _ : 𝕜 => c) = fun _ => 0


@[simp]
lemma neg_iso_inv (e : X ≅ Y) : (-e).inv = -e.inv

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{X Y : C}
(e : X ≅ Y)


@[simp] theorem cast_refl {α} (h : α = α := rfl) : Equiv.cast h = Equiv.refl α


@[to_additive]
theorem singleton_div_ball : {x} / ball y δ = ball (x / y) δ

{E : Type u_1}
[SeminormedAddCommGroup E]
(δ : ℝ)
(x y : E)

{x} - Metric.ball y δ = Metric.ball (x - y) δ


@[to_additive]
theorem haarContent_outerMeasure_closure_pos (K₀ : PositiveCompacts G) :
    0 < (haarContent K₀).outerMeasure (closure K₀)

(K₀ : TopologicalSpace.PositiveCompacts G)

0 < (MeasureTheory.Measure.haar.addHaarContent K₀).outerMeasure (closure ↑K₀)


theorem IsRadical.of_dvd [CancelCommMonoidWithZero R] {x y : R} (hy : IsRadical y) (h0 : y ≠ 0)
    (hxy : x ∣ y) : IsRadical x

{R : Type u_1}
[CancelCommMonoidWithZero R]
{x y : R}
(hy : IsRadical y)
(h0 : y ≠ 0)
(hxy : x ∣ y)


@[simp]
theorem constOfIsEmpty_toAlternatingMap [IsEmpty ι] (m : N) :
    (constOfIsEmpty R M ι m).toAlternatingMap = AlternatingMap.constOfIsEmpty R M ι m

(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]
[IsEmpty ι]
(m : N)

(ContinuousAlternatingMap.constOfIsEmpty R M ι m).toAlternatingMap = AlternatingMap.constOfIsEmpty R M ι m


/-- The Fourier series of an `L2` function `f` sums to `f`, in the `L²` space of `AddCircle T`. -/
theorem hasSum_fourier_series_L2 (f : Lp ℂ 2 <| @haarAddCircle T hT) :
    HasSum (fun i => fourierCoeff f i • fourierLp 2 i) f

(f : ↥(MeasureTheory.Lp ℂ 2 AddCircle.haarAddCircle))

HasSum (fun i => fourierCoeff (↑↑f) i • fourierLp 2 i) f


theorem mem_iff_ofSubtype_apply_mem (f : Perm (Subtype p)) (x : α) :
    p x ↔ p ((ofSubtype f : α → α) x)

{α : Type u}
{p : α → Prop}
[DecidablePred p]
(f : Equiv.Perm (Subtype p))
(x : α)


@[simp]
theorem mul_X_pow_comp {k : ℕ} : (p * X ^ k).comp r = p.comp r * r ^ k

{R : Type u}
[Semiring R]
{p r : R[X]}
{k : ℕ}

(p * Polynomial.X ^ k).comp r = p.comp r * r ^ k


/-- The algebra isomorphism `AdjoinRoot (minpoly R x) ≃ₐ[R] adjoin R x` -/
@[simps!]
def equivAdjoin (hx : IsIntegral R x) : AdjoinRoot (minpoly R x) ≃ₐ[R] adjoin R ({x} : Set S)

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[CommRing S]
[IsDomain R]
[Algebra R S]
[IsDomain S]
[NoZeroSMulDivisors R S]
[IsIntegrallyClosed R]
{x : S}
(hx : IsIntegral R x)
(b : ↥(Algebra.adjoin R {x}))

(minpoly.equivAdjoin hx).symm b = Function.surjInv ⋯ b


theorem suffix_iff_eq_append : l₁ <:+ l₂ ↔ take (length l₂ - length l₁) l₂ ++ l₁ = l₂

l₁ <:+ l₂ ↔ List.take (l₂.length - l₁.length) l₂ ++ l₁ = l₂


/-- Shows that `Aₙ = bₙ * Aₙ₋₁ + aₙ * Aₙ₋₂`. -/
theorem nums_recurrence {gp : Pair K} {ppredA predA : K}
    (succ_nth_s_eq : g.s.get? (n + 1) = some gp) (nth_num_eq : g.nums n = ppredA)
    (succ_nth_num_eq : g.nums (n + 1) = predA) :
    g.nums (n + 2) = gp.b * predA + gp.a * ppredA


/-- If `f` maps `s` bijectively to `t` and a set `t'` is contained in the image of some `s₁ ⊇ s`,
then `s₁` has a subset containing `s` that `f` maps bijectively to `t'`.-/
theorem BijOn.exists_extend_of_subset {t' : Set β} (h : BijOn f s t) (hss₁ : s ⊆ s₁) (htt' : t ⊆ t')
    (ht' : SurjOn f s₁ t') : ∃ s', s ⊆ s' ∧ s' ⊆ s₁ ∧ Set.BijOn f s' t'

{α : Type u_1}
{β : Type u_2}
{s s₁ : Set α}
{t : Set β}
{f : α → β}
{t' : Set β}
(h : Set.BijOn f s t)
(hss₁ : s ⊆ s₁)
(htt' : t ⊆ t')
(ht' : Set.SurjOn f s₁ t')


/-- Reorder a finset.

The difference with `Finset.card_bij'` is that the bijection is specified as a surjective injection,
rather than by an inverse function.

The difference with `Finset.card_nbij` is that the bijection is allowed to use membership of the
domain, rather than being a non-dependent function. -/
lemma card_bij (i : ∀ a ∈ s, β) (hi : ∀ a ha, i a ha ∈ t)
    (i_inj : ∀ a₁ ha₁ a₂ ha₂, i a₁ ha₁ = i a₂ ha₂ → a₁ = a₂)
    (i_surj : ∀ b ∈ t, ∃ a ha, i a ha = b) : s.card = t.card

(hi : ∀ (a : α) (ha : a ∈ s), i a ha ∈ t)

(i_inj : ∀ (a₁ : α) (ha₁ : a₁ ∈ s) (a₂ : α) (ha₂ : a₂ ∈ s), i a₁ ha₁ = i a₂ ha₂ → a₁ = a₂)

(i_surj : ∀ b ∈ t, ∃ a, ∃ (ha : a ∈ s), i a ha = b)


@[simp]
theorem coe_toOrderEmbedding (hf : LeftOrdContinuous f) (h : Injective f) :
    ⇑(hf.toOrderEmbedding f h) = f

{α : Type u}
{β : Type v}
[SemilatticeSup α]
[SemilatticeSup β]
{f : α → β}
(hf : LeftOrdContinuous f)
(h : Function.Injective f)

⇑(LeftOrdContinuous.toOrderEmbedding f hf h) = f


/-- A set is in the `cardinalInterFilter` generated by `g` if and only if
it contains an intersection of `c` elements of `g`. -/
theorem mem_cardinaleGenerate_iff {s : Set α} {hreg : c.IsRegular} :
    s ∈ cardinalGenerate g (IsRegular.nat_lt hreg 2) ↔
    ∃ S : Set (Set α), S ⊆ g ∧ (#S < c) ∧ ⋂₀ S ⊆ s

{α : Type u}
{c : Cardinal.{u}}
{g : Set (Set α)}
{s : Set α}
{hreg : c.IsRegular}

s ∈ Filter.cardinalGenerate g ⋯ ↔ ∃ S ⊆ g, #↑S < c ∧ ⋂₀ S ⊆ s


theorem _root_.Subalgebra.fg_bot_toSubmodule {R A : Type*} [CommSemiring R] [Semiring A]
    [Algebra R A] : (⊥ : Subalgebra R A).toSubmodule.FG

{R : Type u_3}
{A : Type u_4}
[CommSemiring R]
[Semiring A]
[Algebra R A]


protected theorem div_eq_div_iff (ha : a ≠ 0) (ha' : a ≠ ∞) (hb : b ≠ 0) (hb' : b ≠ ∞) :
    c / b = d / a ↔ a * c = b * d

{a b c d : ENNReal}
(ha : a ≠ 0)
(ha' : a ≠ ⊤)
(hb : b ≠ 0)
(hb' : b ≠ ⊤)


theorem subtype_val_mono {α : Type u} (s : Set α) : Mono (↾(Subtype.val : s → α))


/-- The `f` argument to `permutationsAux2` when `r = []` can be eliminated. -/
theorem map_permutationsAux2 (t : α) (ts : List α) (ys : List α) (f : List α → β) :
    (permutationsAux2 t ts [] ys id).2.map f = (permutationsAux2 t ts [] ys f).2

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

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


@[simp]
theorem comap_zero : comap (0 : M →ₛₗ[σ₁₂] M₂) q = ⊤

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
(q : Submodule R₂ M₂)


theorem edist_le_mul_of_le (h : LipschitzWith K f) (hr : edist x y ≤ r) :
    edist (f x) (f y) ≤ K * r

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{K : ℝ≥0}
{f : α → β}
{x y : α}
{r : ℝ≥0∞}
(h : LipschitzWith K f)
(hr : edist x y ≤ r)


@[simp]
theorem mem_top_basicOpen (f : X.presheaf.obj (op ⊤)) (x : X) :
    x ∈ X.basicOpen f ↔ IsUnit (X.presheaf.germ ⟨x, show x ∈ (⊤ : Opens X) by trivial⟩ f)

(X : AlgebraicGeometry.RingedSpace)
(f : ↑(X.presheaf.obj (Opposite.op ⊤)))
(x : ↑↑X.toPresheafedSpace)

x ∈ X.basicOpen f ↔ IsUnit ((X.presheaf.germ ⟨x, ⋯⟩) f)


protected theorem freeAlgebra (ι : Type*) [Finite ι] : FiniteType R (FreeAlgebra R ι)

(R : Type uR)
[CommSemiring R]
(ι : Type u_1)
[Finite ι]


theorem iSup_lt_succ' (u : ℕ → α) (n : ℕ) : ⨆ k < n + 1, u k = u 0 ⊔ ⨆ k < n, u (k + 1)

{α : Type u_1}
[CompleteLattice α]
(u : ℕ → α)
(n : ℕ)


theorem _root_.List.foldr_sup_eq_sup_toFinset [DecidableEq α] (l : List α) :
    l.foldr (· ⊔ ·) ⊥ = l.toFinset.sup id

{α : Type u_2}
[SemilatticeSup α]
[OrderBot α]
[DecidableEq α]
(l : List α)

List.foldr (fun x x_1 => x ⊔ x_1) ⊥ l = l.toFinset.sup id


/-- A version of `EulerProduct.summable_and_hasSum_smoothNumbers_prod_primesBelow_geometric`
in terms of the value of the series. -/
lemma prod_primesBelow_geometric_eq_tsum_smoothNumbers {f : ℕ →* F} (hsum : Summable f) (N : ℕ) :
    ∏ p ∈ N.primesBelow, (1 - f p)⁻¹ = ∑' m : N.smoothNumbers, f m

{F : Type u_1}
[NormedField F]
[CompleteSpace F]
{f : ℕ →* F}
(hsum : Summable ⇑f)
(N : ℕ)

∏ p ∈ N.primesBelow, (1 - f p)⁻¹ = ∑' (m : ↑N.smoothNumbers), f ↑m


theorem isOpen_inter_preimage {s : Set Y} (hs : IsOpen s) : IsOpen (e.source ∩ e ⁻¹' s)

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)
{s : Set Y}
(hs : IsOpen s)


@[to_additive]
theorem div_eq_iff_eq_mul' : a / b = c ↔ a = b * c

{G : Type u_3}
[AddCommGroup G]
{a b c : G}


lemma IsAlgebraic.invOf_iff {x : S} [Invertible x] :
    IsAlgebraic R (⅟ x) ↔ IsAlgebraic R x

{R : Type u}
{S : Type u_1}
[CommRing R]
[CommRing S]
[Algebra R S]
{x : S}
[Invertible x]


@[simp] lemma supIrred_iff_of_finite : SupIrred s ↔ ∃ a, Iic a = s

{α : Type u_1}
[PartialOrder α]
{s : LowerSet α}
[Finite α]


lemma locallyOfFiniteType_stableUnderBaseChange :
    MorphismProperty.StableUnderBaseChange @LocallyOfFiniteType


theorem Rel.add_right {r : R → R → Prop} ⦃a b c : R⦄ (h : Rel r b c) : Rel r (a + b) (a + c)

{R : Type uR}
[Semiring R]
{r : R → R → Prop}
⦃a b c : R⦄
(h : RingQuot.Rel r b c)


@[simp]
theorem symmDiff_right_inj : a ∆ b = a ∆ c ↔ b = c

{α : Type u_2}
[GeneralizedBooleanAlgebra α]
{a b c : α}


@[simp]
theorem map_equiv_removeNone {α : Type*} [DecidableEq α] (σ : Perm (Option α)) :
    (removeNone σ).optionCongr = swap none (σ none) * σ

{α : Type u_1}
[DecidableEq α]
(σ : Equiv.Perm (Option α))

(Equiv.removeNone σ).optionCongr = Equiv.swap none (σ none) * σ


theorem right' {a₁ : Nat} {b₁ : β} (h₁ : a₁ ≤ a₂) (h₂ : rb b₁ b₂) : Prod.Lex Nat.lt rb (a₁, b₁) (a₂, b₂)

{β : Type v}
(rb : β → β → Prop)
{a₂ : Nat}
{b₂ : β}
{a₁ : Nat}
{b₁ : β}
(h₁ : a₁ ≤ a₂)
(h₂ : rb b₁ b₂)

Prod.Lex Nat.lt rb { fst := a₁, snd := b₁ } { fst := a₂, snd := b₂ }


lemma Gammaℝ_add_two {s : ℂ} (hs : s ≠ 0) : Gammaℝ (s + 2) = Gammaℝ s * s / 2 / π


theorem count_mul [DecidableEq (Associates α)] {a : Associates α} (ha : a ≠ 0) {b : Associates α}
    (hb : b ≠ 0) {p : Associates α} (hp : Irreducible p) :
    count p (factors (a * b)) = count p a.factors + count p b.factors

[(p : Associates α) → Decidable (Irreducible p)]

p.count (a * b).factors = p.count a.factors + p.count b.factors


/-- A `HomRel` is a congruence when it's an equivalence on every hom-set, and it can be composed
from left and right. -/
class Congruence : Prop where
  /-- `r` is an equivalence on every hom-set. -/
  equivalence : ∀ {X Y}, _root_.Equivalence (@r X Y)
  /-- Precomposition with an arrow respects `r`. -/
  compLeft : ∀ {X Y Z} (f : X ⟶ Y) {g g' : Y ⟶ Z}, r g g' → r (f ≫ g) (f ≫ g')
  /-- Postcomposition with an arrow respects `r`. -/
  compRight : ∀ {X Y Z} {f f' : X ⟶ Y} (g : Y ⟶ Z), r f f' → r (f ≫ g) (f' ≫ g)

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{r : HomRel C}
[self : CategoryTheory.Congruence r]
{X Y Z : C}
{f f' : X ⟶ Y}
(g : Y ⟶ Z)

r f f' → r (CategoryTheory.CategoryStruct.comp f g) (CategoryTheory.CategoryStruct.comp f' g)


theorem mem_pairSelfAdjointMatricesSubmodule' :
    A ∈ pairSelfAdjointMatricesSubmodule J J₃ ↔ Matrix.IsAdjointPair J J₃ A A

{R₃ : Type u_7}
[CommRing R₃]
{n : Type u_11}
[Fintype n]
(J J₃ A : Matrix n n R₃)
[DecidableEq n]

A ∈ pairSelfAdjointMatricesSubmodule J J₃ ↔ J.IsAdjointPair J₃ A A


protected theorem AbsolutelyContinuous.isOpenPosMeasure (h : μ ≪ ν) : IsOpenPosMeasure ν

{X : Type u_1}
[TopologicalSpace X]
{m : MeasurableSpace X}
{μ ν : MeasureTheory.Measure X}
[μ.IsOpenPosMeasure]
(h : μ ≪ ν)


theorem existsUnique_congr {p q : α → Prop} (h : ∀ a, p a ↔ q a) : (∃! a, p a) ↔ ∃! a, q a

{α : Sort u}
{p q : α → Prop}
(h : ∀ (a : α), p a ↔ q a)


/-- If a function and its derivative are integrable on `(a, +∞)`, then the function tends to zero
at `+∞`. -/
theorem tendsto_zero_of_hasDerivAt_of_integrableOn_Ioi
    (hderiv : ∀ x ∈ Ioi a, HasDerivAt f (f' x) x)
    (f'int : IntegrableOn f' (Ioi a)) (fint : IntegrableOn f (Ioi a)) :
    Tendsto f atTop (𝓝 0)

(hderiv : ∀ x ∈ Set.Ioi a, HasDerivAt f (f' x) x)

(f'int : MeasureTheory.IntegrableOn f' (Set.Ioi a) MeasureTheory.volume)

(fint : MeasureTheory.IntegrableOn f (Set.Ioi a) MeasureTheory.volume)


theorem Nodup.of_cons (h : Nodup (a ::ₘ s)) : Nodup s

{α : Type u_1}
{s : Multiset α}
{a : α}
(h : (a ::ₘ s).Nodup)


/-- Construct a simplicial complex by removing the empty face for you. -/
@[simps]
def ofErase (faces : Set (Finset E)) (indep : ∀ s ∈ faces, AffineIndependent 𝕜 ((↑) : s → E))
    (down_closed : ∀ s ∈ faces, ∀ t ⊆ s, t ∈ faces)
    (inter_subset_convexHull : ∀ᵉ (s ∈ faces) (t ∈ faces),
      convexHull 𝕜 ↑s ∩ convexHull 𝕜 ↑t ⊆ convexHull 𝕜 (s ∩ t : Set E)) :
    SimplicialComplex 𝕜 E

(indep : ∀ s ∈ faces, AffineIndependent 𝕜 Subtype.val)

(inter_subset_convexHull : ∀ s ∈ faces, ∀ t ∈ faces, (convexHull 𝕜) ↑s ∩ (convexHull 𝕜) ↑t ⊆ (convexHull 𝕜) (↑s ∩ ↑t))

(Geometry.SimplicialComplex.ofErase faces indep down_closed inter_subset_convexHull).faces = faces \ {∅}


theorem Involutive.prodMap {f : α → α} {g : β → β} :
    Involutive f → Involutive g → Involutive (map f g)

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

Function.Involutive f → Function.Involutive g → Function.Involutive (Prod.map f g)


@[simp]
theorem arcsin_neg (x : ℝ) : arcsin (-x) = -arcsin x


@[to_additive]
theorem alternatingProd_cons' :
    ∀ (a : α) (l : List α), alternatingProd (a :: l) = a * (alternatingProd l)⁻¹

{α : Type u_2}
[AddCommGroup α]
(a : α)
(l : List α)

(a :: l).alternatingSum = a + -l.alternatingSum


/-- Two subsemigroups are equal if they have the same elements. -/
@[to_additive (attr := ext) "Two `AddSubsemigroup`s are equal if they have the same elements."]
theorem ext {S T : Subsemigroup M} (h : ∀ x, x ∈ S ↔ x ∈ T) : S = T

{M : Type u_1}
[Add M]
{S T : AddSubsemigroup M}
(h : ∀ (x : M), x ∈ S ↔ x ∈ T)


@[simp]
theorem map_ite_zero_one {F : Type*} [FunLike F α β] [RingHomClass F α β] (f : F)
    (p : Prop) [Decidable p] :
    f (ite p 0 1) = ite p 0 1

∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} {F : Type u_5} [inst : FunLike F α β]
  [inst_1 : RingHomClass F α β] (f : F) (p : Prop) [inst_2 : Decidable p], f (if p then 0 else 1) = if p then 0 else 1


theorem add_mul_left_right {x y : R} (h : IsCoprime x y) (z : R) : IsCoprime x (y + x * z)

{R : Type u}
[CommRing R]
{x y : R}
(h : IsCoprime x y)
(z : R)


theorem BinaryCofan.isVanKampen_mk {X Y : C} (c : BinaryCofan X Y)
    (cofans : ∀ X Y : C, BinaryCofan X Y) (colimits : ∀ X Y, IsColimit (cofans X Y))
    (cones : ∀ {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z), PullbackCone f g)
    (limits : ∀ {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z), IsLimit (cones f g))
    (h₁ : ∀ {X' Y' : C} (αX : X' ⟶ X) (αY : Y' ⟶ Y) (f : (cofans X' Y').pt ⟶ c.pt)
      (_ : αX ≫ c.inl = (cofans X' Y').inl ≫ f) (_ : αY ≫ c.inr = (cofans X' Y').inr ≫ f),
      IsPullback (cofans X' Y').inl αX f c.inl ∧ IsPullback (cofans X' Y').inr αY f c.inr)
    (h₂ : ∀ {Z : C} (f : Z ⟶ c.pt),
      IsColimit (BinaryCofan.mk (cones f c.inl).fst (cones f c.inr).fst)) :
    IsVanKampenColimit c

(c : CategoryTheory.Limits.BinaryCofan X Y)

(cofans : (X Y : C) → CategoryTheory.Limits.BinaryCofan X Y)

(colimits : (X Y : C) → CategoryTheory.Limits.IsColimit (cofans X Y))

(cones : {X Y Z : C} → (f : X ⟶ Z) → (g : Y ⟶ Z) → CategoryTheory.Limits.PullbackCone f g)

(limits : {X Y Z : C} → (f : X ⟶ Z) → (g : Y ⟶ Z) → CategoryTheory.Limits.IsLimit (cones f g))

(h₁ :
  ∀ {X' Y' : C} (αX : X' ⟶ X) (αY : Y' ⟶ Y) (f : (cofans X' Y').pt ⟶ c.pt),
    CategoryTheory.CategoryStruct.comp αX c.inl = CategoryTheory.CategoryStruct.comp (cofans X' Y').inl f →
      CategoryTheory.CategoryStruct.comp αY c.inr = CategoryTheory.CategoryStruct.comp (cofans X' Y').inr f →
        CategoryTheory.IsPullback (cofans X' Y').inl αX f c.inl ∧
          CategoryTheory.IsPullback (cofans X' Y').inr αY f c.inr)

(h₂ :
  {Z : C} →
    (f : Z ⟶ c.pt) →
      CategoryTheory.Limits.IsColimit (CategoryTheory.Limits.BinaryCofan.mk (cones f c.inl).fst (cones f c.inr).fst))


/-- A subspace `K : Submodule 𝕜 E` has an orthogonal projection if evey vector `v : E` admits an
orthogonal projection to `K`. -/
class HasOrthogonalProjection (K : Submodule 𝕜 E) : Prop where
  exists_orthogonal (v : E) : ∃ w ∈ K, v - w ∈ Kᗮ

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{K : Submodule 𝕜 E}
[self : HasOrthogonalProjection K]
(v : E)


theorem HasDerivAt.cosh (hf : HasDerivAt f f' x) :
    HasDerivAt (fun x => Real.cosh (f x)) (Real.sinh (f x) * f') x

{f : ℝ → ℝ}
{f' x : ℝ}
(hf : HasDerivAt f f' x)


theorem PUnit.eq_punit (a : PUnit) : a = ⟨⟩


theorem mul_right_not_lt {a : R} (b) (h : a ≠ 0) : ¬a * b ≺ b

{R : Type u}
[EuclideanDomain R]
{a : R}
(b : R)
(h : a ≠ 0)


/-- A Grothendieck topology induces a natural family of closure operators on sieves. -/
@[simps! isClosed]
def closureOperator (X : C) : ClosureOperator (Sieve X)

(J₁ : CategoryTheory.GrothendieckTopology C)

(J₁.closureOperator X).IsClosed S = J₁.IsClosed S


@[to_additive] lemma commute_coe_inv : Commute (a : α) ↑a⁻¹


/-- Reformulate `Completion.mem_uniformity_dist` in terms that are suitable for the definition
of the metric space structure. -/
protected theorem uniformity_dist' :
    𝓤 (Completion α) = ⨅ ε : { ε : ℝ // 0 < ε }, 𝓟 { p | dist p.1 p.2 < ε.val }

𝓤 (UniformSpace.Completion α) = ⨅ ε, 𝓟 {p | dist p.1 p.2 < ↑ε}


protected theorem IsTopologicalBasis.induced [s : TopologicalSpace β] (f : α → β)
    {T : Set (Set β)} (h : IsTopologicalBasis T) :
    IsTopologicalBasis (t := induced f s) ((preimage f) '' T)

(h : TopologicalSpace.IsTopologicalBasis T)

TopologicalSpace.IsTopologicalBasis (Set.preimage f '' T)


theorem forall₂_and : (∀ x h, P x h ∧ Q x h) ↔ (∀ x h, P x h) ∧ ∀ x h, Q x h

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

(∀ (x : α) (h : p x), P x h ∧ Q x h) ↔ (∀ (x : α) (h : p x), P x h) ∧ ∀ (x : α) (h : p x), Q x h


theorem IsAtomic.relabel {m : ℕ} {φ : L.BoundedFormula α m} (h : φ.IsAtomic)
    (f : α → β ⊕ (Fin n)) : (φ.relabel f).IsAtomic

{L : FirstOrder.Language}
{α : Type u'}
{β : Type v'}
{n m : ℕ}
{φ : L.BoundedFormula α m}
(h : φ.IsAtomic)
(f : α → β ⊕ Fin n)


@[to_additive]
theorem length (h : Red L₁ L₂) : ∃ n, L₁.length = L₂.length + 2 * n

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


@[simp]
theorem encode_nat (n : ℕ) : encode n = n


@[simp]
theorem coeff_zero_eq_constantCoeff : ⇑(coeff R (0 : σ →₀ ℕ)) = constantCoeff σ R

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

⇑(MvPowerSeries.coeff R 0) = ⇑(MvPowerSeries.constantCoeff σ R)


theorem IsPushout.IsVanKampen.mono_of_mono_right [Mono g] {H : IsPushout f g h i}
    (H' : H.IsVanKampen) : Mono h

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{W X Y Z : C}
{f : W ⟶ X}
{g : W ⟶ Y}
{h : X ⟶ Z}
{i : Y ⟶ Z}
[CategoryTheory.Mono g]
{H : CategoryTheory.IsPushout f g h i}
(H' : H.IsVanKampen)


@[simp] theorem im_imK : a.im.imK = a.imK


@[simp] theorem add_coeffs {l₁ l₂ : LinearCombo} : (l₁ + l₂).coeffs = l₁.coeffs + l₂.coeffs


/-- `m` is `s`-factored if and only if all prime divisors of `m` are in `s`. -/
lemma mem_factoredNumbers' {s : Finset ℕ} {m : ℕ} :
    m ∈ factoredNumbers s ↔ ∀ p, p.Prime → p ∣ m → p ∈ s

m ∈ Nat.factoredNumbers s ↔ ∀ (p : ℕ), Nat.Prime p → p ∣ m → p ∈ s


@[simps]
instance : MonoidalCategoryStruct (FullSubcategory P)

(CategoryTheory.MonoidalCategory.leftUnitor X).inv = (CategoryTheory.MonoidalCategory.leftUnitor X.obj).inv


lemma lawson_le_lower : lawson α ≤ lower α


theorem zeroExtend'_eq {x : BitVec w} (h : w ≤ v) : x.zeroExtend' h = x.zeroExtend v

BitVec.zeroExtend' h x = BitVec.zeroExtend v x


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

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


theorem hasMFDerivWithinAt_inter (h : t ∈ 𝓝 x) :
    HasMFDerivWithinAt I I' f (s ∩ t) x f' ↔ HasMFDerivWithinAt I I' f s x f'

{f' : TangentSpace I x →L[𝕜] TangentSpace I' (f x)}


@[simp]
theorem isLowerSet_preimage_toDual_iff {s : Set αᵒᵈ} : IsLowerSet (toDual ⁻¹' s) ↔ IsUpperSet s

IsLowerSet (⇑OrderDual.toDual ⁻¹' s) ↔ IsUpperSet s


@[to_additive (attr := simp)]
theorem ofList_cons (x : α) (xs : List α) : ofList (x :: xs) = of x * ofList xs

FreeAddMonoid.ofList (x :: xs) = FreeAddMonoid.of x + FreeAddMonoid.ofList xs


theorem foldlM_eq_foldl (f : β → α → m β) (b l) :
    List.foldlM f b l = foldl (fun mb a => mb >>= fun b => f b a) (pure b) l

{α : Type u}
{β : Type v}
{m : Type v → Type w}
[Monad m]
[LawfulMonad m]
(f : β → α → m β)
(b : β)
(l : List α)

List.foldlM f b l =
  List.foldl
    (fun mb a => do
      let b ← mb
      f b a)
    (pure b) l


@[to_additive (attr := simp)]
lemma infinite_zpowers : (zpowers a : Set α).Infinite ↔ ¬IsOfFinOrder a

(↑(Subgroup.zpowers a)).Infinite ↔ ¬IsOfFinOrder a


lemma W_iff_isIso_map {X Y : D} (f : X ⟶ Y) :
    W (· ∈ Set.range F.obj) f ↔ IsIso (G.map f)

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_3, u_2} D]
{F : CategoryTheory.Functor C D}
{G : CategoryTheory.Functor D C}
(adj : G ⊣ F)
[F.Full]
[F.Faithful]
{X Y : D}
(f : X ⟶ Y)

CategoryTheory.Localization.LeftBousfield.W (fun x => x ∈ Set.range F.obj) f ↔ CategoryTheory.IsIso (G.map f)


theorem laverage_eq_lintegral [IsProbabilityMeasure μ] (f : α → ℝ≥0∞) :
    ⨍⁻ x, f x ∂μ = ∫⁻ x, f x ∂μ

{α : Type u_1}
{m0 : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
[MeasureTheory.IsProbabilityMeasure μ]
(f : α → ℝ≥0∞)


theorem is_bot_adic_iff {A : Type*} [CommRing A] [TopologicalSpace A] [TopologicalRing A] :
    IsAdic (⊥ : Ideal A) ↔ DiscreteTopology A

{A : Type u_2}
[CommRing A]
[TopologicalSpace A]
[TopologicalRing A]


theorem forall_mem_comm {α β} [Membership α β] {s : β} {p : α → α → Prop} :
    (∀ a (_ : a ∈ s) b (_ : b ∈ s), p a b) ↔ ∀ a b, a ∈ s → b ∈ s → p a b

{α : Type u_1}
{β : Type u_2}
[Membership α β]
{s : β}
{p : α → α → Prop}

(∀ (a : α), a ∈ s → ∀ (b : α), b ∈ s → p a b) ↔ ∀ (a b : α), a ∈ s → b ∈ s → p a b


/-- An object admits a projective resolution.
-/
class HasProjectiveResolution (Z : C) : Prop where
  out : Nonempty (ProjectiveResolution Z)

[self : CategoryTheory.HasProjectiveResolution Z]


theorem pos_iff_neg_of_mul_neg [ExistsAddOfLE α] [PosMulMono α] [MulPosMono α]
    [CovariantClass α α (swap (· + ·)) (· ≤ ·)] [ContravariantClass α α (swap (· + ·)) (· ≤ ·)]
    (hab : a * b < 0) : 0 < a ↔ b < 0

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

[ContravariantClass α α (Function.swap fun x x_1 => x + x_1) fun x x_1 => x ≤ x_1]


theorem _root_.Finset.coe_infsep_of_offDiag_empty
    [DecidableEq α] {s : Finset α} (hs : s.offDiag = ∅) : (s : Set α).infsep = 0

{α : Type u_1}
[PseudoMetricSpace α]
[DecidableEq α]
{s : Finset α}
(hs : s.offDiag = ∅)


/-- The product `F.prod' G` followed by projection on the first component is isomorphic to `F` -/
@[simps!]
def prod'CompFst (F : A ⥤ B) (G : A ⥤ C) : F.prod' G ⋙ CategoryTheory.Prod.fst B C ≅ F

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

(F.prod'CompFst G).hom.app X = CategoryTheory.CategoryStruct.id (F.obj X)


/-- The `i`th row of the multiplication is the same as the `vecMul` with the `i`th row of `A`. -/
theorem mul_apply_eq_vecMul [Fintype n] (A : Matrix m n α) (B : Matrix n o α) (i : m) :
    (A * B) i = A i ᵥ* B

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
[NonUnitalNonAssocSemiring α]
[Fintype n]
(A : Matrix m n α)
(B : Matrix n o α)
(i : m)


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


theorem mem_range_self (φ : A →ₐ[R] B) (x : A) : φ x ∈ φ.range

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
(φ : A →ₐ[R] B)
(x : A)


@[to_additive Pi.norm_def]
lemma Pi.norm_def' : ‖f‖ = ↑(Finset.univ.sup fun b => ‖f b‖₊)

{ι : Type u_1}
{π : ι → Type u_4}
[Fintype ι]
[(i : ι) → SeminormedAddGroup (π i)]
(f : (i : ι) → π i)


@[simp] lemma LieModule.isNilpotent_of_top_iff' :
    IsNilpotent R L {x // x ∈ (⊤ : LieSubmodule R L M)} ↔ IsNilpotent R L M

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]

LieModule.IsNilpotent R L ↥⊤ ↔ LieModule.IsNilpotent R L M


@[simp]
theorem id_apply {x : ℕ} : id x = x


/-- If an analytic function vanishes around a point, then it is uniformly zero along
a connected set. Superseded by `eqOn_zero_of_preconnected_of_locally_zero` which does not assume
completeness of the target space. -/
theorem eqOn_zero_of_preconnected_of_eventuallyEq_zero_aux [CompleteSpace F] {f : E → F} {U : Set E}
    (hf : AnalyticOn 𝕜 f U) (hU : IsPreconnected U) {z₀ : E} (h₀ : z₀ ∈ U) (hfz₀ : f =ᶠ[𝓝 z₀] 0) :
    EqOn f 0 U

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{f : E → F}
{U : Set E}
(hf : AnalyticOn 𝕜 f U)
(hU : IsPreconnected U)
{z₀ : E}
(h₀ : z₀ ∈ U)
(hfz₀ : f =ᶠ[𝓝 z₀] 0)


/-- `Unique_Mul` is preserved under multiplicative maps that are injective.

See `UniqueMul.mulHom_map_iff` for a version with swapped bundling. -/
@[to_additive
      "`UniqueAdd` is preserved under additive maps that are injective.

See `UniqueAdd.addHom_map_iff` for a version with swapped bundling."]
theorem mulHom_image_iff [DecidableEq H] (f : G →ₙ* H) (hf : Function.Injective f) :
    UniqueMul (A.image f) (B.image f) (f a0) (f b0) ↔ UniqueMul A B a0 b0

{G : Type u_1}
{H : Type u_2}
[Mul G]
[Mul H]
{A B : Finset G}
{a0 b0 : G}
[DecidableEq H]
(f : G →ₙ* H)
(hf : Function.Injective ⇑f)

UniqueMul (Finset.image (⇑f) A) (Finset.image (⇑f) B) (f a0) (f b0) ↔ UniqueMul A B a0 b0


nonrec theorem SmoothOn.prod_map (hf : SmoothOn I I' f s) (hg : SmoothOn J J' g r) :
    SmoothOn (I.prod J) (I'.prod J') (Prod.map f g) (s ×ˢ r)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{F : Type u_11}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_12}
[TopologicalSpace G]
{J : ModelWithCorners 𝕜 F G}
{N : Type u_13}
[TopologicalSpace N]
[ChartedSpace G N]
{F' : Type u_14}
[NormedAddCommGroup F']
[NormedSpace 𝕜 F']
{G' : Type u_15}
[TopologicalSpace G']
{J' : ModelWithCorners 𝕜 F' G'}
{N' : Type u_16}
[TopologicalSpace N']
[ChartedSpace G' N']
{f : M → M'}
{s : Set M}
{g : N → N'}
{r : Set N}
(hf : SmoothOn I I' f s)
(hg : SmoothOn J J' g r)


@[to_additive]
lemma Monovary.mul_left (h₁ : Monovary f₁ g) (h₂ : Monovary f₂ g) : Monovary (f₁ * f₂) g

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedCommGroup α]
[OrderedCommGroup β]
{f₁ f₂ : ι → α}
{g : ι → β}
(h₁ : Monovary f₁ g)
(h₂ : Monovary f₂ g)


/-- This is the `List.prod` version of `mul_inv_rev` -/
@[to_additive "This is the `List.sum` version of `add_neg_rev`"]
theorem prod_inv_reverse : ∀ L : List G, L.prod⁻¹ = (L.map fun x => x⁻¹).reverse.prod

L.prod⁻¹ = (List.map (fun x => x⁻¹) L).reverse.prod


@[simp, norm_cast]
theorem coe_inf : ↑(a ⊓ b) = (a ⊓ b : ℕ)


/-- `fib (n + 2)` is strictly monotone. -/
theorem fib_add_two_strictMono : StrictMono fun n => fib (n + 2)


@[reassoc]
theorem naturality_app {F G : C ⥤ D ⥤ E} (T : F ⟶ G) (Z : D) {X Y : C} (f : X ⟶ Y) :
    (F.map f).app Z ≫ (T.app Y).app Z = (T.app X).app Z ≫ (G.map f).app Z

{F G : CategoryTheory.Functor C (CategoryTheory.Functor D E)}

CategoryTheory.CategoryStruct.comp ((F.map f).app Z) ((T.app Y).app Z) =
  CategoryTheory.CategoryStruct.comp ((T.app X).app Z) ((G.map f).app Z)


theorem mk_near_of_forall_near {f : CauSeq ℚ abs} {x : ℝ} {ε : ℝ}
    (H : ∃ i, ∀ j ≥ i, |(f j : ℝ) - x| ≤ ε) : |mk f - x| ≤ ε

{f : CauSeq ℚ abs}
{x ε : ℝ}
(H : ∃ i, ∀ j ≥ i, |↑(↑f j) - x| ≤ ε)


@[to_additive (attr := simp)]
theorem mul_down [Mul α] : (x * y).down = x.down * y.down

{α : Type u}
{x y : ULift.{v, u} α}
[Mul α]


lemma IsRatCondKernelCDFAux.le_one (hf : IsRatCondKernelCDFAux f κ ν) (a : α) :
    ∀ᵐ c ∂(ν a), ∀ q, f (a, c) q ≤ 1

{κ : ProbabilityTheory.Kernel α (β × ℝ)}

{f : α × β → ℚ → ℝ}

(hf : ProbabilityTheory.IsRatCondKernelCDFAux f κ ν)

∀ᵐ (c : β) ∂ν a, ∀ (q : ℚ), f (a, c) q ≤ 1


theorem dickson_of_two_le {n : ℕ} (h : 2 ≤ n) :
    dickson k a n = X * dickson k a (n - 1) - C a * dickson k a (n - 2)

{R : Type u_1}
[CommRing R]
(k : ℕ)
(a : R)
{n : ℕ}
(h : 2 ≤ n)

Polynomial.dickson k a n =
  Polynomial.X * Polynomial.dickson k a (n - 1) - Polynomial.C a * Polynomial.dickson k a (n - 2)


theorem HasBasis.inf_principal_neBot_iff (hl : l.HasBasis p s) {t : Set α} :
    NeBot (l ⊓ 𝓟 t) ↔ ∀ ⦃i⦄, p i → (s i ∩ t).Nonempty

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

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


/-- Commutativity of a square is preserved when taking quotients by an ideal. -/
theorem comp_quotientMap_eq_of_comp_eq {R' S' : Type*} [CommRing R'] [CommRing S'] {f : R →+* S}
    {f' : R' →+* S'} {g : R →+* R'} {g' : S →+* S'} (hfg : f'.comp g = g'.comp f) (I : Ideal S') :
    -- Porting note: was losing track of I
    let leq := le_of_eq (_root_.trans (comap_comap (I := I) f g') (hfg ▸ comap_comap (I := I) g f'))
    (quotientMap I g' le_rfl).comp (quotientMap (I.comap g') f le_rfl) =
    (quotientMap I f' le_rfl).comp (quotientMap (I.comap f') g leq)

{R : Type u}
[CommRing R]
{S : Type v}
[CommRing S]
{R' : Type u_5}
{S' : Type u_6}
[CommRing R']
[CommRing S']
{f : R →+* S}
{f' : R' →+* S'}
{g : R →+* R'}
{g' : S →+* S'}
(hfg : f'.comp g = g'.comp f)
(I : Ideal S')

let leq := ⋯;
(Ideal.quotientMap I g' ⋯).comp (Ideal.quotientMap (Ideal.comap g' I) f ⋯) =
  (Ideal.quotientMap I f' ⋯).comp (Ideal.quotientMap (Ideal.comap f' I) g leq)


/-- Note we use `↑i = 0` instead of `i = 0` as `Fin 0` has no `0`.
This means that we cannot state this with `Pi.single` as we did with `Matrix.circulant_single`. -/
theorem Fin.circulant_ite (α) [Zero α] [One α] :
    ∀ n, circulant (fun i => ite (i.1 = 0) 1 0 : Fin n → α) = 1

(Matrix.circulant fun i => if ↑i = 0 then 1 else 0) = 1


theorem geom_sum_eq [DivisionRing α] {x : α} (h : x ≠ 1) (n : ℕ) :
    ∑ i ∈ range n, x ^ i = (x ^ n - 1) / (x - 1)

{α : Type u}
[DivisionRing α]
{x : α}
(h : x ≠ 1)
(n : ℕ)

∑ i ∈ Finset.range n, x ^ i = (x ^ n - 1) / (x - 1)


@[simp]
theorem degree_quadratic (ha : a ≠ 0) : degree (C a * X ^ 2 + C b * X + C c) = 2

{R : Type u}
{a b c : R}
[Semiring R]
(ha : a ≠ 0)

(Polynomial.C a * Polynomial.X ^ 2 + Polynomial.C b * Polynomial.X + Polynomial.C c).degree = 2


theorem RelIso.cof_eq {α β : Type u} {r s} [IsRefl α r] [IsRefl β s] (f : r ≃r s) :
    Order.cof r = Order.cof s

{α β : Type u}
{r : α → α → Prop}
{s : β → β → Prop}
[IsRefl α r]
[IsRefl β s]
(f : r ≃r s)


/-- `WithLp.equiv` as a linear equivalence. -/
@[simps (config := .asFn)]
protected def linearEquiv : WithLp p V ≃ₗ[K] V

(p : ℝ≥0∞)
(K : Type uK)
(V : Type uV)
[Semiring K]
[AddCommGroup V]
[Module K V]

⇑(WithLp.linearEquiv p K V) = ⇑(WithLp.equiv p V)


theorem eq_const [PreconnectedSpace X] (f : LocallyConstant X Y) (x : X) : f = const X (f x)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[PreconnectedSpace X]
(f : LocallyConstant X Y)
(x : X)


theorem vecMul_conjTranspose [Fintype n] [StarRing α] (A : Matrix m n α) (x : n → α) :
    x ᵥ* Aᴴ = star (A *ᵥ star x)

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[NonUnitalSemiring α]
[Fintype n]
[StarRing α]
(A : Matrix m n α)
(x : n → α)


@[to_additive (attr := simp)]
theorem coe_bot : ((⊥ : Subsemigroup M) : Set M) = ∅


@[simp, norm_cast]
theorem coe_ennreal_zero : ((0 : ℝ≥0∞) : EReal) = 0


@[simp 1001] -- Porting note: increased priority to appease `simpNF`
theorem mem_inf {I J : Ideal R} {x : R} : x ∈ I ⊓ J ↔ x ∈ I ∧ x ∈ J

{R : Type u}
[Semiring R]
{I J : Ideal R}
{x : R}


@[to_additive (attr := simp)]
theorem MulHom.id_comp [Mul M] [Mul N] (f : M →ₙ* N) : (MulHom.id N).comp f = f

{M : Type u_4}
{N : Type u_5}
[Mul M]
[Mul N]
(f : M →ₙ* N)


lemma pow_cpow_ofNat_inv {x : ℂ} {n : ℕ} [n.AtLeastTwo] (hlt : -(π / OfNat.ofNat n) < x.arg)
    (hle : x.arg ≤ π / OfNat.ofNat n) :
    (x ^ (OfNat.ofNat n : ℕ)) ^ ((OfNat.ofNat n : ℂ)⁻¹) = x

(x ^ OfNat.ofNat n) ^ (OfNat.ofNat n)⁻¹ = x


@[simp]
theorem edgeFinset_inf [DecidableEq V] : (G₁ ⊓ G₂).edgeFinset = G₁.edgeFinset ∩ G₂.edgeFinset

{V : Type u_1}
{G₁ G₂ : SimpleGraph V}
[Fintype ↑G₁.edgeSet]
[Fintype ↑G₂.edgeSet]
[DecidableEq V]


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

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


@[simp]
theorem thickening_thickening (hε : 0 < ε) (hδ : 0 < δ) (s : Set E) :
    thickening ε (thickening δ s) = thickening (ε + δ) s

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{δ ε : ℝ}
(hε : 0 < ε)
(hδ : 0 < δ)
(s : Set E)

Metric.thickening ε (Metric.thickening δ s) = Metric.thickening (ε + δ) s


@[simp] lemma zero_ne_ofNat (n : ℕ) [n.AtLeastTwo] : 0 ≠ (no_index (ofNat n) : R)

{R : Type u_1}
[AddMonoidWithOne R]
[CharZero R]
(n : ℕ)
[n.AtLeastTwo]


theorem support_sum [DecidableEq β] [Zero M] [AddCommMonoid N] {f : α →₀ M} {g : α → M → β →₀ N} :
    (f.sum g).support ⊆ f.support.biUnion fun a => (g a (f a)).support

{α : Type u_1}
{β : Type u_7}
{M : Type u_8}
{N : Type u_10}
[DecidableEq β]
[Zero M]
[AddCommMonoid N]
{f : α →₀ M}
{g : α → M → β →₀ N}


@[simp]
lemma image_subtype_val_Icc_Iio {a b : α} (c : Icc a b) : Subtype.val '' Iio c = Ico a c

{α : Type u_1}
[Preorder α]
{a b : α}
(c : ↑(Set.Icc a b))


@[simp]
theorem frontier_univ : frontier (univ : Set X) = ∅


lemma CotangentSpace.map_sub_map (f g : Hom P P') :
    CotangentSpace.map f - CotangentSpace.map g =
      P'.cotangentComplex.restrictScalars S ∘ₗ (f.sub g)

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Generators R S}
{R' : Type u'}
{S' : Type v'}
[CommRing R']
[CommRing S']
[Algebra R' S']
{P' : Algebra.Generators R' S'}
[Algebra R R']
[Algebra S S']
[Algebra R S']
[IsScalarTower R R' S']
[IsScalarTower R S S']
(f g : P.Hom P')

Algebra.Generators.CotangentSpace.map f - Algebra.Generators.CotangentSpace.map g = ↑S P'.cotangentComplex ∘ₗ f.sub g


@[reassoc (attr := simp)]
theorem inr_pushoutAssoc_hom [HasPushout (g₃ ≫ (pushout.inr _ _ : X₂ ⟶ Y₁)) g₄]
    [HasPushout g₁ (g₂ ≫ (pushout.inl _ _ : X₂ ⟶ Y₂))] :
    pushout.inr _ _ ≫ (pushoutAssoc g₁ g₂ g₃ g₄).hom = pushout.inr _ _ ≫ pushout.inr _ _

[CategoryTheory.Limits.HasPushout (g₃ ≫ CategoryTheory.Limits.pushout.inr g₁ g₂) g₄]

[CategoryTheory.Limits.HasPushout g₁ (g₂ ≫ CategoryTheory.Limits.pushout.inl g₃ g₄)]

CategoryTheory.Limits.pushout.inr (g₃ ≫ CategoryTheory.Limits.pushout.inr g₁ g₂) g₄ ≫
    (CategoryTheory.Limits.pushoutAssoc g₁ g₂ g₃ g₄).hom =
  CategoryTheory.Limits.pushout.inr g₃ g₄ ≫
    CategoryTheory.Limits.pushout.inr g₁ (g₂ ≫ CategoryTheory.Limits.pushout.inl g₃ g₄)


theorem ball_add_ball (hε : 0 < ε) (hδ : 0 < δ) (a b : E) :
    ball a ε + ball b δ = ball (a + b) (ε + δ)

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{δ ε : ℝ}
(hε : 0 < ε)
(hδ : 0 < δ)
(a b : E)

Metric.ball a ε + Metric.ball b δ = Metric.ball (a + b) (ε + δ)


/-- The forward direction of the equivalence from coalgebras for the product comonad to the over
category.
-/
@[simps]
def coalgebraToOver : Coalgebra (prodComonad X) ⥤ Over X

(A : (CategoryTheory.prodComonad X).Coalgebra)

(CategoryTheory.coalgebraToOver X).obj A =
  CategoryTheory.Over.mk (CategoryTheory.CategoryStruct.comp A.a CategoryTheory.Limits.prod.fst)


/-- Functor composition induces a functor on simplicial objects. -/
@[simps!]
def whiskering (D : Type*) [Category D] : (C ⥤ D) ⥤ SimplicialObject C ⥤ SimplicialObject D

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

∀ {X Y : C ⥤ D} (τ : X ⟶ Y) (F : SimplexCategoryᵒᵖ ⥤ C) (c : SimplexCategoryᵒᵖ),
  (((CategoryTheory.SimplicialObject.whiskering C D).map τ).app F).app c = τ.app (F.obj c)


theorem isPartition_classes (r : Setoid α) : IsPartition r.classes


theorem filter_mem_univ_eq_toFinset [Fintype α] (s : Set α) [Fintype s] [DecidablePred (· ∈ s)] :
    Finset.univ.filter (· ∈ s) = s.toFinset

{α : Type u_1}
[Fintype α]
(s : Set α)
[Fintype ↑s]
[DecidablePred fun x => x ∈ s]

Finset.filter (fun x => x ∈ s) Finset.univ = s.toFinset


/-- **Riesz's theorem**: if a closed ball with center zero of positive radius is compact in a vector
space, then the space is finite-dimensional. -/
theorem FiniteDimensional.of_isCompact_closedBall₀ {r : ℝ} (rpos : 0 < r)
    (h : IsCompact (Metric.closedBall (0 : E) r)) : FiniteDimensional 𝕜 E

(𝕜 : Type u)
[NontriviallyNormedField 𝕜]
{E : Type v}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace 𝕜]
{r : ℝ}
(rpos : 0 < r)
(h : IsCompact (Metric.closedBall 0 r))


lemma lie_e_pow_succ_toEnd_f (n : ℕ) :
    ⁅e, ψ (n + 1)⁆ = ((n + 1) * (μ - n)) • ψ n

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
{h e f : L}
{m : M}
{μ : R}
{t : IsSl2Triple h e f}
(P : t.HasPrimitiveVectorWith m μ)
(n : ℕ)

⁅e, ((LieModule.toEnd R L M) f ^ (n + 1)) m⁆ = ((↑n + 1) * (μ - ↑n)) • ((LieModule.toEnd R L M) f ^ n) m


/-- Sending `Fin n` into `Fin (n + 1)` with a gap at `p`
then back to `Fin n` by subtracting one from anything above `p` is the identity. -/
@[simp]
lemma predAbove_succAbove (p : Fin n) (i : Fin n) : p.predAbove ((castSucc p).succAbove i) = i

p.predAbove (p.castSucc.succAbove i) = i


@[simp]
theorem inf_coe : (↑(K ⊓ K') : Set L) = (K : Set L) ∩ (K' : Set L)

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


protected theorem le_sub (a b : R) : abv a - abv b ≤ abv (a - b)

{R : Type u_5}
{S : Type u_6}
[Ring R]
[OrderedRing S]
(abv : AbsoluteValue R S)
(a b : R)


@[simp]
theorem toZeroHom_eq_coe : ⇑p.toZeroHom = p

{E : Type u_4}
[AddGroup E]
{p : NonarchAddGroupSeminorm E}


theorem IsSymmetric.restrictScalars {T : E →ₗ[𝕜] E} (hT : T.IsSymmetric) :
    @LinearMap.IsSymmetric ℝ E _ _ (InnerProductSpace.rclikeToReal 𝕜 E)
      (@LinearMap.restrictScalars ℝ 𝕜 _ _ _ _ _ _ (InnerProductSpace.rclikeToReal 𝕜 E).toModule
        (InnerProductSpace.rclikeToReal 𝕜 E).toModule _ _ _ T)

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{T : E →ₗ[𝕜] E}
(hT : T.IsSymmetric)


/--
This typeclass captures properties shared by ℝ and ℂ, with an API that closely matches that of ℂ.
-/
class RCLike (K : semiOutParam Type*) extends DenselyNormedField K, StarRing K,
    NormedAlgebra ℝ K, CompleteSpace K where
  re : K →+ ℝ
  im : K →+ ℝ
  /-- Imaginary unit in `K`. Meant to be set to `0` for `K = ℝ`. -/
  I : K
  I_re_ax : re I = 0
  I_mul_I_ax : I = 0 ∨ I * I = -1
  re_add_im_ax : ∀ z : K, 𝓚 (re z) + 𝓚 (im z) * I = z
  ofReal_re_ax : ∀ r : ℝ, re (𝓚 r) = r
  ofReal_im_ax : ∀ r : ℝ, im (𝓚 r) = 0
  mul_re_ax : ∀ z w : K, re (z * w) = re z * re w - im z * im w
  mul_im_ax : ∀ z w : K, im (z * w) = re z * im w + im z * re w
  conj_re_ax : ∀ z : K, re (conj z) = re z
  conj_im_ax : ∀ z : K, im (conj z) = -im z
  conj_I_ax : conj I = -I
  norm_sq_eq_def_ax : ∀ z : K, ‖z‖ ^ 2 = re z * re z + im z * im z
  mul_im_I_ax : ∀ z : K, im z * im I = im z
  /-- only an instance in the `ComplexOrder` locale -/
  [toPartialOrder : PartialOrder K]
  le_iff_re_im {z w : K} : z ≤ w ↔ re z ≤ re w ∧ im z = im w
  -- note we cannot put this in the `extends` clause
  [toDecidableEq : DecidableEq K]

{K : semiOutParam (Type u_1)}
[self : RCLike K]


theorem smul_coeff_right [SMulZeroClass R V] {x : HahnSeries Γ R} {y : HahnModule Γ' R V} {a : Γ'}
    {s : Set Γ'} (hs : s.IsPWO) (hys : ((of R).symm y).support ⊆ s) :
    ((of R).symm <| x • y).coeff a =
      ∑ ij ∈ VAddAntidiagonal x.isPWO_support hs a,
        x.coeff ij.fst • ((of R).symm y).coeff ij.snd

(hys : ((HahnModule.of R).symm y).support ⊆ s)

((HahnModule.of R).symm (x • y)).coeff a =
  ∑ ij ∈ Finset.VAddAntidiagonal ⋯ hs a, x.coeff ij.1 • ((HahnModule.of R).symm y).coeff ij.2


@[to_additive]
lemma unit_of_mem_ofUnits_spec_mem (S : Subgroup Mˣ) {x : M} {h : x ∈ S.ofUnits} :
    S.unit_of_mem_ofUnits h ∈ S

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


theorem zeroLocus_iUnion {γ : Sort*} (s : γ → Set A) :
    zeroLocus 𝒜 (⋃ i, s i) = ⋂ i, zeroLocus 𝒜 (s i)

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(𝒜 : ℕ → Submodule R A)
[GradedAlgebra 𝒜]
{γ : Sort u_3}
(s : γ → Set A)

ProjectiveSpectrum.zeroLocus 𝒜 (⋃ i, s i) = ⋂ i, ProjectiveSpectrum.zeroLocus 𝒜 (s i)


@[simp]
theorem snd_intCast (n : ℤ) : (n : α × β).snd = n

{α : Type u_1}
{β : Type u_2}
[AddGroupWithOne α]
[AddGroupWithOne β]
(n : ℤ)


@[nontriviality, measurability]
theorem measurable_of_subsingleton_codomain [Subsingleton β] (f : α → β) : Measurable f

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
[Subsingleton β]
(f : α → β)


theorem restrict (hf : P f) (U : Y.affineOpens) :
    Q (f ∣_ U)

{P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme}


theorem sublistsAux_eq_bind :
    sublistsAux = fun (a : α) (r : List (List α)) => r.bind fun l => [l, a :: l]

List.sublistsAux = fun a r => r.bind fun l => [l, a :: l]


@[simp 1500]
theorem mapRange.linearEquiv_toAddEquiv (f : M ≃ₗ[R] N) :
    (mapRange.linearEquiv f).toAddEquiv = (mapRange.addEquiv f.toAddEquiv : (α →₀ M) ≃+ _)

{α : Type u_1}
{M : Type u_2}
{N : Type u_3}
{R : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
(f : M ≃ₗ[R] N)

(Finsupp.mapRange.linearEquiv f).toAddEquiv = Finsupp.mapRange.addEquiv f.toAddEquiv


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

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

↑(H.equivOp.symm b) = MulOpposite.unop ↑b


@[simp]
theorem principal_σ (s : Set α) : (Realizer.principal s).σ = Unit


theorem differentiableAt_dslope_of_ne (h : b ≠ a) :
    DifferentiableAt 𝕜 (dslope f a) b ↔ DifferentiableAt 𝕜 f b

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


theorem hasMFDerivAt_fst (x : M × M') :
    HasMFDerivAt (I.prod I') I Prod.fst x
      (ContinuousLinearMap.fst 𝕜 (TangentSpace I x.1) (TangentSpace I' x.2))

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
(I' : ModelWithCorners 𝕜 E' H')
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
[SmoothManifoldWithCorners I' M']
(x : M × M')


@[to_additive]
theorem inv_mem_iff : a⁻¹ ∈ s ↔ a ∈ s

{G : Type u_1}
{a : G}
[Group G]
{s : Set G}
(hs : IsSubgroup s)

a⁻¹ ∈ s ↔ a ∈ s


/-- A version of `WithTop.map` for `AddHom`s. -/
@[simps (config := .asFn)]
protected def _root_.AddHom.withTopMap {M N : Type*} [Add M] [Add N] (f : AddHom M N) :
    AddHom (WithTop M) (WithTop N)

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
(f : AddHom M N)


theorem add_apply : (f + g) x = f x + g x

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
[AddMonoid β]
[BoundedAdd β]
[ContinuousAdd β]
(f g : BoundedContinuousFunction α β)
{x : α}


theorem IsPreconnected.ordConnected {s : Set α} (h : IsPreconnected s) : OrdConnected s

{α : Type v}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
{s : Set α}
(h : IsPreconnected s)


lemma isRightKanExtension_iff_isIso {F' : D ⥤ H} {F'' : D ⥤ H} (φ : F'' ⟶ F')
    {L : C ⥤ D} {F : C ⥤ H} (α : L ⋙ F' ⟶ F) (α' : L ⋙ F'' ⟶ F)
    (comm : whiskerLeft L φ ≫ α = α') [F'.IsRightKanExtension α] :
    F''.IsRightKanExtension α' ↔ IsIso φ

(comm : CategoryTheory.CategoryStruct.comp (CategoryTheory.whiskerLeft L φ) α = α')

F''.IsRightKanExtension α' ↔ CategoryTheory.IsIso φ


theorem tsub_self_add (a b : α) : a - (a + b) = 0

{α : Type u_1}
[CanonicallyOrderedAddCommMonoid α]
[Sub α]
[OrderedSub α]
(a b : α)


@[simp]
theorem Multiset.map_univ {β : Type*} (m : Multiset α) (f : α → β) :
    ((Finset.univ : Finset m).val.map fun (x : m) ↦ f (x : α)) = m.map f

{α : Type u_1}
[DecidableEq α]
{β : Type u_2}
(m : Multiset α)
(f : α → β)

Multiset.map (fun x => f x.fst) Finset.univ.val = Multiset.map f m


@[simp]
theorem mul_nonneg_iff_of_pos_left [PosMulStrictMono α]
    (h : 0 < c) : 0 ≤ c * b ↔ 0 ≤ b

{α : Type u}
[Semiring α]
[LinearOrder α]
{b c : α}
[PosMulStrictMono α]
(h : 0 < c)


/-- Let `X` be a compact topological space, `α` a uniform space, and `F : ι → (X → α)` an
equicontinuous family. Then, the topologies of uniform convergence and pointwise convergence induce
the same topology on `ι`.

In other words, pointwise convergence and uniform convergence coincide on an equicontinuous
subset of `X → α`.

This is a consequence of `Equicontinuous.comap_uniformFun_eq`, stated in terms of `Inducing`
for convenuence. -/
lemma Equicontinuous.inducing_uniformFun_iff_pi [TopologicalSpace ι] [CompactSpace X]
    (F_eqcont : Equicontinuous F) :
    Inducing (UniformFun.ofFun ∘ F) ↔ Inducing F

{ι : Type u_1}
{X : Type u_2}
{α : Type u_4}
[TopologicalSpace X]
[UniformSpace α]
{F : ι → X → α}
[TopologicalSpace ι]
[CompactSpace X]
(F_eqcont : Equicontinuous F)

Inducing (⇑UniformFun.ofFun ∘ F) ↔ Inducing F


theorem zero_mem_smul_set (h : (0 : β) ∈ t) : (0 : β) ∈ a • t

{α : Type u_2}
{β : Type u_3}
[Zero β]
[SMulZeroClass α β]
{t : Set β}
{a : α}
(h : 0 ∈ t)


@[simp]
theorem normUnit_content {p : R[X]} : normUnit (content p) = 1

{R : Type u_1}
[CommRing R]
[IsDomain R]
[NormalizedGCDMonoid R]
{p : Polynomial R}


@[simp]
theorem eqToHom_right {X : T} {U V : Under X} (e : U = V) :
    (eqToHom e).right = eqToHom (e ▸ rfl : U.right = V.right)

{T : Type u₁}
[CategoryTheory.Category.{v₁, u₁} T]
{X : T}
{U V : CategoryTheory.Under X}
(e : U = V)

(CategoryTheory.eqToHom e).right = CategoryTheory.eqToHom ⋯


theorem Memℒp.const_mul {R} [NormedRing R] {f : α → R} (hf : Memℒp f p μ) (c : R) :
    Memℒp (fun x => c * f x) p μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
{R : Type u_6}
[NormedRing R]
{f : α → R}
(hf : MeasureTheory.Memℒp f p μ)
(c : R)

MeasureTheory.Memℒp (fun x => c * f x) p μ


lemma HasRightDerivedFunctor.mk' [RF.IsRightDerivedFunctor α W] :
    HasRightDerivedFunctor F W

{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]
(RF : CategoryTheory.Functor D H)
{F : CategoryTheory.Functor C H}
{L : CategoryTheory.Functor C D}
(α : F ⟶ L.comp RF)
{W : CategoryTheory.MorphismProperty C}
[L.IsLocalization W]
[RF.IsRightDerivedFunctor α W]


theorem eventuallyEq_set {s t : Set α} {l : Filter α} : s =ᶠ[l] t ↔ ∀ᶠ x in l, x ∈ s ↔ x ∈ t

{α : Type u}
{s t : Set α}
{l : Filter α}

s =ᶠ[l] t ↔ ∀ᶠ (x : α) in l, x ∈ s ↔ x ∈ t


@[to_additive (attr := simp)]
theorem comap_bot (f : G →* N) : (⊥ : Subgroup N).comap f = f.ker

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
(f : G →* N)


@[to_additive (attr := simp) sum_eq_zero_iff]
theorem prod_eq_one_iff' : ∏ x ∈ s, f x = 1 ↔ ∀ x ∈ s, f x = 1

{ι : Type u_1}
{M : Type u_4}
[CanonicallyOrderedCommMonoid M]
{f : ι → M}
{s : Finset ι}


/-- If `f : α → β` has a left-inverse when `α` is nonempty, then `α` is computably equivalent to the
range of `f`.

While awkward, the `Nonempty α` hypothesis on `f_inv` and `hf` allows this to be used when `α` is
empty too. This hypothesis is absent on analogous definitions on stronger `Equiv`s like
`LinearEquiv.ofLeftInverse` and `RingEquiv.ofLeftInverse` as their typeclass assumptions
are already sufficient to ensure non-emptiness. -/
@[simps]
def ofLeftInverse {α β : Sort _} (f : α → β) (f_inv : Nonempty α → β → α)
    (hf : ∀ h : Nonempty α, LeftInverse (f_inv h) f) :
    α ≃ range f

(hf : ∀ (h : Nonempty α), Function.LeftInverse (f_inv h) f)

(Equiv.ofLeftInverse f f_inv hf).symm b = f_inv ⋯ ↑b


theorem sub_def (a b : Fin n) : a - b = Fin.mk (((n - b) + a) % n) (Nat.mod_lt _ a.size_pos)


lemma head_mem (x : RelSeries r) : x.head ∈ x

{α : Type u_1}
{r : Rel α α}
(x : RelSeries r)


@[simp]
theorem toPartialHomeomorph_coe (hf : ApproximatesLinearOn f (f' : E →L[𝕜] F) s c)
    (hc : Subsingleton E ∨ c < N⁻¹) (hs : IsOpen s) :
    (hf.toPartialHomeomorph f s hc hs : E → F) = f

(hc : Subsingleton E ∨ c < ‖↑f'.symm‖₊⁻¹)

↑(ApproximatesLinearOn.toPartialHomeomorph f s hf hc hs) = f