/-- **Chebyshev's Sum Inequality**: When `f` and `g` monovary together (eg they are both
monotone/antitone), the product of their sum is less than the size of the set times their scalar
product. -/
theorem MonovaryOn.sum_mul_sum_le_card_mul_sum (hfg : MonovaryOn f g s) :
    ((∑ i ∈ s, f i) * ∑ i ∈ s, g i) ≤ s.card * ∑ i ∈ s, f i * g i

{ι : Type u_1}
{α : Type u_2}
[LinearOrderedRing α]
{s : Finset ι}
{f g : ι → α}
(hfg : MonovaryOn f g ↑s)

(∑ i ∈ s, f i) * ∑ i ∈ s, g i ≤ ↑s.card * ∑ i ∈ s, f i * g i


theorem le_of_opNorm_le {C : ℝ} (h : ‖f‖ ≤ C) : ‖f m‖ ≤ C * ∏ i, ‖m i‖

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


@[simp]
theorem image_inf_prod (s t : Set α) : Set.image2 (fun x x_1 => x ⊓ x_1) s t = s ⊼ t

{α : Type u_2}
[SemilatticeInf α]
(s t : Set α)


{R : Type u_1}
[CommSemiring R]
{a a' b b' c : R}

a = a' → b = b' → a' * b' = c → a * b = c


lemma isLocallyInjective_iff_equalizerSieve_mem_imp :
    IsLocallyInjective J φ ↔ ∀ ⦃X : Cᵒᵖ⦄ (x y : F₁.obj X),
      equalizerSieve (φ.app _ x) (φ.app _ y) ∈ J X.unop → equalizerSieve x y ∈ J X.unop

(J : CategoryTheory.GrothendieckTopology C)

CategoryTheory.Presheaf.IsLocallyInjective J φ ↔
  ∀ ⦃X : Cᵒᵖ⦄ (x y : (CategoryTheory.forget D).obj (F₁.obj X)),
    CategoryTheory.Presheaf.equalizerSieve ((φ.app X) x) ((φ.app X) y) ∈ J.sieves (Opposite.unop X) →
      CategoryTheory.Presheaf.equalizerSieve x y ∈ J.sieves (Opposite.unop X)


theorem range_comp_le_range [RingHomSurjective τ₂₃] [RingHomSurjective τ₁₃] (f : M →ₛₗ[τ₁₂] M₂)
    (g : M₂ →ₛₗ[τ₂₃] M₃) : range (g.comp f : M →ₛₗ[τ₁₃] M₃) ≤ range g

{R : Type u_1}
{R₂ : Type u_2}
{R₃ : Type u_3}
{M : Type u_6}
{M₂ : Type u_7}
{M₃ : Type u_8}
[Semiring R]
[Semiring R₂]
[Semiring R₃]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R M]
[Module R₂ M₂]
[Module R₃ M₃]
{τ₁₂ : R →+* R₂}
{τ₂₃ : R₂ →+* R₃}
{τ₁₃ : R →+* R₃}
[RingHomCompTriple τ₁₂ τ₂₃ τ₁₃]
[RingHomSurjective τ₂₃]
[RingHomSurjective τ₁₃]
(f : M →ₛₗ[τ₁₂] M₂)
(g : M₂ →ₛₗ[τ₂₃] M₃)

LinearMap.range (g.comp f) ≤ LinearMap.range g


lemma inrCompHomotopy_hom_eq_zero (i j : ι) (hij : ¬ c.Rel j i) :
    (inrCompHomotopy φ hc).hom i j = 0

(HomologicalComplex.homotopyCofiber.inrCompHomotopy φ hc).hom i j = 0


theorem mem_compactConvergence_entourage_iff (X : Set (C(α, β) × C(α, β))) :
    X ∈ 𝓤 C(α, β) ↔
      ∃ (K : Set α) (V : Set (β × β)), IsCompact K ∧ V ∈ 𝓤 β ∧
        { fg : C(α, β) × C(α, β) | ∀ x ∈ K, (fg.1 x, fg.2 x) ∈ V } ⊆ X

{α : Type u₁}
{β : Type u₂}
[TopologicalSpace α]
[UniformSpace β]
(X : Set (C(α, β) × C(α, β)))

X ∈ 𝓤 C(α, β) ↔ ∃ K V, IsCompact K ∧ V ∈ 𝓤 β ∧ {fg | ∀ x ∈ K, (fg.1 x, fg.2 x) ∈ V} ⊆ X


theorem toMatrix_trans [Fintype m] [DecidableEq m] [DecidableEq n] [Semiring α] (f : l ≃. m)
    (g : m ≃. n) : ((f.trans g).toMatrix : Matrix l n α) = f.toMatrix * g.toMatrix

{l : Type u_2}
{m : Type u_3}
{n : Type u_4}
{α : Type v}
[Fintype m]
[DecidableEq m]
[DecidableEq n]
[Semiring α]
(f : l ≃. m)
(g : m ≃. n)

(f.trans g).toMatrix = f.toMatrix * g.toMatrix


/-- See `isUnit_iff_exists_and_exists` for a similar lemma with two existentials. -/
@[to_additive "See `isAddUnit_iff_exists_and_exists` for a similar lemma with two existentials."]
lemma isUnit_iff_exists [Monoid M] {x : M} : IsUnit x ↔ ∃ b, x * b = 1 ∧ b * x = 1

IsAddUnit x ↔ ∃ b, x + b = 0 ∧ b + x = 0


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

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Lattice α]
[Lattice β]
[Lattice γ]
(g : LatticeHom βᵒᵈ γᵒᵈ)
(f : LatticeHom αᵒᵈ βᵒᵈ)


theorem Complex.hasStrictDerivAt_cpow_const (h : x ∈ slitPlane) :
    HasStrictDerivAt (fun z : ℂ => z ^ c) (c * x ^ (c - 1)) x

HasStrictDerivAt (fun z => z ^ c) (c * x ^ (c - 1)) x


@[simp]
theorem antisymmRel_iff_eq [IsRefl α r] [IsAntisymm α r] {a b : α} : AntisymmRel r a b ↔ a = b

{α : Type u_1}
{r : α → α → Prop}
[IsRefl α r]
[IsAntisymm α r]
{a b : α}


/-- A filter which is eventually bounded is in particular frequently bounded (in the opposite
direction). At least if the filter is not trivial. -/
theorem IsBounded.isCobounded_flip [IsTrans α r] [NeBot f] : f.IsBounded r → f.IsCobounded (flip r)

{α : Type u_1}
{r : α → α → Prop}
{f : Filter α}
[IsTrans α r]
[f.NeBot]

Filter.IsBounded r f → Filter.IsCobounded (flip r) f


/-- The anti-equivalence between cosimplicial objects and simplicial objects. -/
@[simps!]
def cosimplicialSimplicialEquiv : (CosimplicialObject C)ᵒᵖ ≌ SimplicialObject Cᵒᵖ

(C : Type u)
[CategoryTheory.Category.{v, u} C]
(F : (SimplexCategory ⥤ C)ᵒᵖ)

∀ {X Y : SimplexCategoryᵒᵖ} (f : X ⟶ Y),
  ((CategoryTheory.cosimplicialSimplicialEquiv C).functor.obj F).map f = ((Opposite.unop F).map f.unop).op


@[simp]
theorem update_zero_eq_erase (p : R[X]) (n : ℕ) : p.update n 0 = p.erase n

{R : Type u}
[Semiring R]
(p : R[X])
(n : ℕ)


@[to_additive]
theorem toList_of_mul (x : α) (xs : FreeMonoid α) : toList (of x * xs) = x :: toList xs

{α : Type u_1}
(x : α)
(xs : FreeMonoid α)

FreeMonoid.toList (FreeMonoid.of x * xs) = x :: FreeMonoid.toList xs


theorem preimage_boolIndicator_true : s.boolIndicator ⁻¹' {true} = s


@[simp]
theorem symm_trans (e₁ : L₁ ≃ₗ⁅R⁆ L₂) (e₂ : L₂ ≃ₗ⁅R⁆ L₃) :
    (e₁.trans e₂).symm = e₂.symm.trans e₁.symm

{R : Type u}
{L₁ : Type v}
{L₂ : Type w}
{L₃ : Type w₁}
[CommRing R]
[LieRing L₁]
[LieRing L₂]
[LieRing L₃]
[LieAlgebra R L₁]
[LieAlgebra R L₂]
[LieAlgebra R L₃]
(e₁ : L₁ ≃ₗ⁅R⁆ L₂)
(e₂ : L₂ ≃ₗ⁅R⁆ L₃)


@[simp]
theorem union_empty {s₁ : Finmap β} : s₁ ∪ ∅ = s₁

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{s₁ : Finmap β}


theorem norm_def (f : α →₁[μ] β) : ‖f‖ = (∫⁻ a, ‖f a‖₊ ∂μ).toReal

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
(f : ↥(MeasureTheory.Lp β 1 μ))


theorem quotDualCoannihilatorToDual_bijective (W : Subspace K (Dual K V)) [FiniteDimensional K W] :
    Function.Bijective W.quotDualCoannihilatorToDual

{K : Type u_1}
{V : Type u_2}
[Field K]
[AddCommGroup V]
[Module K V]
(W : Subspace K (Module.Dual K V))
[FiniteDimensional K ↥W]


theorem upperSemicontinuousWithinAt_biInf {p : ι → Prop} {f : ∀ i, p i → α → δ}
    (h : ∀ i hi, UpperSemicontinuousWithinAt (f i hi) s x) :
    UpperSemicontinuousWithinAt (fun x' => ⨅ (i) (hi), f i hi x') s x

(h : ∀ (i : ι) (hi : p i), UpperSemicontinuousWithinAt (f i hi) s x)

UpperSemicontinuousWithinAt (fun x' => ⨅ i, ⨅ (hi : p i), f i hi x') s x


/-- `Matrix.transpose` as an `AlgEquiv` to the opposite ring -/
@[simps]
def transposeAlgEquiv [CommSemiring R] [CommSemiring α] [Fintype m] [DecidableEq m] [Algebra R α] :
    Matrix m m α ≃ₐ[R] (Matrix m m α)ᵐᵒᵖ

(m : Type u_2)
(R : Type u_7)
(α : Type v)
[CommSemiring R]
[CommSemiring α]
[Fintype m]
[DecidableEq m]
[Algebra R α]

∀ (a : (Matrix m m α)ᵐᵒᵖ),
  (Matrix.transposeAlgEquiv m R α).symm a = ((Matrix.transposeAddEquiv m m α).trans MulOpposite.opAddEquiv).invFun a


theorem iUnionNotConvergentSeq_subset (hε : 0 < ε) (hf : ∀ n, StronglyMeasurable (f n))
    (hg : StronglyMeasurable g) (hsm : MeasurableSet s) (hs : μ s ≠ ∞)
    (hfg : ∀ᵐ x ∂μ, x ∈ s → Tendsto (fun n => f n x) atTop (𝓝 (g x))) :
    iUnionNotConvergentSeq hε hf hg hsm hs hfg ⊆ s

{f : ι → α → β}

(hf : ∀ (n : ι), MeasureTheory.StronglyMeasurable (f n))

(hg : MeasureTheory.StronglyMeasurable g)

(hfg : ∀ᵐ (x : α) ∂μ, x ∈ s → Filter.Tendsto (fun n => f n x) Filter.atTop (𝓝 (g x)))

MeasureTheory.Egorov.iUnionNotConvergentSeq hε hf hg hsm hs hfg ⊆ s


@[trans]
theorem IsLittleO.trans {f : α → E} {g : α → F} {k : α → G} (hfg : f =o[l] g) (hgk : g =o[l] k) :
    f =o[l] k

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
{G : Type u_5}
[Norm E]
[Norm F]
[Norm G]
{l : Filter α}
{f : α → E}
{g : α → F}
{k : α → G}
(hfg : f =o[l] g)
(hgk : g =o[l] k)


theorem min_div_div_right {c : α} (hc : 0 ≤ c) (a b : α) : min (a / c) (b / c) = min a b / c

{α : Type u_2}
[LinearOrderedSemifield α]
{c : α}
(hc : 0 ≤ c)
(a b : α)


/-- The Fréchet derivative of the Fourier transform of `f` is the Fourier transform of
    `fun v ↦ -2 * π * I ⟪v, ⬝⟫ f v`. -/
theorem fderiv_fourierIntegral
    (hf_int : Integrable f) (hvf_int : Integrable (fun v ↦ ‖v‖ * ‖f v‖)) :
    fderiv ℝ (𝓕 f) = 𝓕 (fourierSMulRight (innerSL ℝ) f)

(hf_int : MeasureTheory.Integrable f MeasureTheory.volume)

(hvf_int : MeasureTheory.Integrable (fun v => ‖v‖ * ‖f v‖) MeasureTheory.volume)

fderiv ℝ (𝓕 f) = 𝓕 (VectorFourier.fourierSMulRight (innerSL ℝ) f)


@[simp]
lemma piecewise_univ [∀ i, Decidable (i ∈ (univ : Finset ι))] (f g : ∀ i, π i) :
    univ.piecewise f g = f

{ι : Type u_1}
{π : ι → Sort u_2}
[Fintype ι]
[(i : ι) → Decidable (i ∈ Finset.univ)]
(f g : (i : ι) → π i)


@[simp]
theorem coe_neg_one : ↑(-1 : Fin (n + 1)) = n


/-- The identity map from a monoid to itself. -/
@[to_additive (attr := simps) "The identity map from an additive monoid to itself."]
def MonoidHom.id (M : Type*) [MulOneClass M] : M →* M


protected theorem fundamentalInterior : IsFundamentalDomain G (fundamentalInterior G s) μ

(hs : MeasureTheory.IsFundamentalDomain G s μ)

[MeasureTheory.SMulInvariantMeasure G α μ]

MeasureTheory.IsFundamentalDomain G (MeasureTheory.fundamentalInterior G s) μ


/-- Let `M` be a smooth manifold with corners with model `I` on `(E, H)`.
Then `VectorBundleCore I M` is the vector bundle core for the tangent bundle over `M`.
It is indexed by the atlas of `M`, with fiber `E` and its change of coordinates from the chart `i`
to the chart `j` at point `x : M` is the derivative of the composite
```
  I.symm   i.symm    j     I
E -----> H -----> M --> H --> E
```
within the set `range I ⊆ E` at `I (i x) : E`. -/
@[simps indexAt coordChange]
def tangentBundleCore : VectorBundleCore 𝕜 M E (atlas H M)

{𝕜 : 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)

(tangentBundleCore I M).indexAt x = achart H x


theorem IsBoundedBilinearMap.isBoundedLinearMap_right (h : IsBoundedBilinearMap 𝕜 f) (x : E) :
    IsBoundedLinearMap 𝕜 fun y => f (x, y)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{f : E × F → G}
(h : IsBoundedBilinearMap 𝕜 f)
(x : E)


theorem edist_le_of_diam_le {d} (hx : x ∈ s) (hy : y ∈ s) (hd : diam s ≤ d) : edist x y ≤ d

{α : Type u}
[PseudoEMetricSpace α]
{x y : α}
{s : Set α}
{d : ℝ≥0∞}
(hx : x ∈ s)
(hy : y ∈ s)
(hd : EMetric.diam s ≤ d)


theorem mem_box : x ∈ box n d ↔ ∀ i, x i < d

x ∈ Behrend.box n d ↔ ∀ (i : Fin n), x i < d


theorem permutations'Aux_eq_permutationsAux2 (t : α) (ts : List α) :
    permutations'Aux t ts = (permutationsAux2 t [] [ts ++ [t]] ts id).2

List.permutations'Aux t ts = (List.permutationsAux2 t [] [ts ++ [t]] ts id).2


/-- A surjective map has dense range. -/
theorem Function.Surjective.denseRange (hf : Function.Surjective f) : DenseRange f

{X : Type u_1}
[TopologicalSpace X]
{α : Type u_4}
{f : α → X}
(hf : Function.Surjective f)


theorem symm_conj_apply (e : M ≃ₗ[R] M₂) (f : Module.End R M₂) :
    e.symm.conj f = ((↑e.symm : M₂ →ₗ[R] M).comp f).comp (e : M →ₗ[R] M₂)

{R : Type u_1}
{M : Type u_8}
{M₂ : Type u_10}
[CommSemiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]
(e : M ≃ₗ[R] M₂)
(f : Module.End R M₂)


/-- Part c of the **L¹ martingale convergence theorem**: Given an integrable function `g` which
is measurable with respect to `⨆ n, ℱ n` where `ℱ` is a filtration, the martingale defined by
`𝔼[g | ℱ n]` converges almost everywhere to `g`.

This martingale also converges to `g` in L¹ and this result is provided by
`MeasureTheory.Integrable.tendsto_eLpNorm_condexp` -/
theorem Integrable.tendsto_ae_condexp (hg : Integrable g μ)
    (hgmeas : StronglyMeasurable[⨆ n, ℱ n] g) :
    ∀ᵐ x ∂μ, Tendsto (fun n => (μ[g|ℱ n]) x) atTop (𝓝 (g x))

(hgmeas : MeasureTheory.StronglyMeasurable g)

∀ᵐ (x : Ω) ∂μ, Filter.Tendsto (fun n => (μ[g|↑ℱ n]) x) Filter.atTop (𝓝 (g x))


theorem cast_type (is : List ℕ) (eq : ds₁ = ds₂) (h : Forall₂ (· < ·) is ds₁) :
    (cast (congr_arg HolorIndex eq) ⟨is, h⟩).val = is

(h : List.Forall₂ (fun x x_1 => x < x_1) is ds₁)


theorem Tendsto.smallSets_mono {s t : α → Set β} (ht : Tendsto t la lb.smallSets)
    (hst : ∀ᶠ x in la, s x ⊆ t x) : Tendsto s la lb.smallSets

{α : Type u_1}
{β : Type u_2}
{la : Filter α}
{lb : Filter β}
{s t : α → Set β}
(ht : Filter.Tendsto t la lb.smallSets)
(hst : ∀ᶠ (x : α) in la, s x ⊆ t x)


theorem comp_fderiv' {f : G → E} :
    fderiv 𝕜 (iso ∘ f) = fun x ↦ (iso : E →L[𝕜] F).comp (fderiv 𝕜 f x)

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

fderiv 𝕜 (⇑iso ∘ f) = fun x =>
  (↑{ toLinearEquiv := iso.toLinearEquiv, continuous_toFun := ⋯, continuous_invFun := ⋯ }).comp (fderiv 𝕜 f x)


theorem TotallyBounded.isVonNBounded {s : Set E} (hs : TotallyBounded s) :
    Bornology.IsVonNBounded 𝕜 s

(𝕜 : Type u_1)
{E : Type u_3}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[UniformSpace E]
[UniformAddGroup E]
[ContinuousSMul 𝕜 E]
{s : Set E}
(hs : TotallyBounded s)


@[simp]
theorem cardDistinctFactors_apply_prime {p : ℕ} (hp : p.Prime) : ω p = 1

ArithmeticFunction.cardDistinctFactors p = 1


theorem _root_.Polynomial.toLaurent_ne_zero {f : R[X]} : f ≠ 0 ↔ toLaurent f ≠ 0


protected theorem congr_arg (f : α →+* β) {x y : α} (h : x = y) : f x = f y

∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β) {x_2 y : α}, x_2 = y → f x_2 = f y


/--
The equivalence between `LocallyConstant X Y` and `LocallyConstant X Z` given an
equivalence `Y ≃ Z`
-/
@[simps]
def congrRight (e : Y ≃ Z) : LocallyConstant X Y ≃ LocallyConstant X Z

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[TopologicalSpace X]
(e : Y ≃ Z)
(g : LocallyConstant X Y)

(LocallyConstant.congrRight e) g = LocallyConstant.map (⇑e) g


theorem postcomp_map_heq' (H : D ⥤ E) (hobj : ∀ X : C, F.obj X = G.obj X)
    (hmap : ∀ {X Y} (f : X ⟶ Y), HEq (F.map f) (G.map f)) :
    HEq ((F ⋙ H).map f) ((G ⋙ H).map f)

(hmap : ∀ {X Y : C} (f : X ⟶ Y), HEq (F.map f) (G.map f))

HEq ((F.comp H).map f) ((G.comp H).map f)


@[to_additive (attr := simp)]
theorem _root_.Subgroup.inclusion_range {H K : Subgroup G} (h_le : H ≤ K) :
    (inclusion h_le).range = H.subgroupOf K

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

(Subgroup.inclusion h_le).range = H.subgroupOf K


@[simp] theorem forM_nil  [Monad m] (f : α → m PUnit) : forM [] f = pure ⟨⟩

{m : Type u_1 → Type u_2}
{α : Type u_3}
[Monad m]
(f : α → m PUnit)


@[simp]
theorem fst_mk (r : R) (m : M) : fst (r, m) = r

{R : Type u}
{M : Type v}
(r : R)
(m : M)


/-- Given two Localization maps `f : M →* N, k : M →* P` for a Submonoid `S ⊆ M`, the hom
from `P` to `N` induced by `f` is left inverse to the hom from `N` to `P` induced by `k`. -/
@[to_additive (attr := simp)
    "Given two Localization maps `f : M →+ N, k : M →+ P` for a Submonoid `S ⊆ M`, the hom
from `P` to `N` induced by `f` is left inverse to the hom from `N` to `P` induced by `k`."]
theorem lift_left_inverse {k : LocalizationMap S P} (z : N) :
    k.lift f.map_units (f.lift k.map_units z) = z

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
{P : Type u_3}
[AddCommMonoid P]
(f : S.LocalizationMap N)
{k : S.LocalizationMap P}
(z : N)


@[simp, norm_cast]
theorem coe_map (S : ConvexCone 𝕜 E) (f : E →ₗ[𝕜] F) : (S.map f : Set F) = f '' S

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[AddCommMonoid F]
[Module 𝕜 E]
[Module 𝕜 F]
(S : ConvexCone 𝕜 E)
(f : E →ₗ[𝕜] F)


theorem isDetector_iff_reflectsIsomorphisms_coyoneda_obj (G : C) :
    IsDetector G ↔ (coyoneda.obj (op G)).ReflectsIsomorphisms

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

CategoryTheory.IsDetector G ↔ (CategoryTheory.coyoneda.obj (Opposite.op G)).ReflectsIsomorphisms


lemma max_le_of_forall_le {α : Type*} [LinearOrder α] [OrderBot α] (l : Multiset α)
    (n : α) (h : ∀ x ∈ l, x ≤ n) : l.fold max ⊥ ≤ n

{α : Type u_4}
[LinearOrder α]
[OrderBot α]
(l : Multiset α)
(n : α)
(h : ∀ x ∈ l, x ≤ n)


/-- **Fermat's Theorem**: the derivative of a function at a local extremum equals zero. -/
theorem IsLocalExtr.deriv_eq_zero (h : IsLocalExtr f a) : deriv f a = 0

{f : ℝ → ℝ}
{a : ℝ}
(h : IsLocalExtr f a)


theorem one_pow (b : ℕ) : ((nat_lit 1).rawCast : R) ^ b = (nat_lit 1).rawCast


lemma sInf_ringCon (S : Set (TwoSidedIdeal R)) :
    (sInf S).ringCon = sInf (TwoSidedIdeal.ringCon '' S)

(R : Type u_1)
[NonUnitalNonAssocRing R]
(S : Set (TwoSidedIdeal R))


/-- The top affine subspace is linearly equivalent to the affine space.

This is the affine version of `Submodule.topEquiv`. -/
@[simps! linear apply symm_apply_coe]
def topEquiv : (⊤ : AffineSubspace k P) ≃ᵃ[k] P

(k : Type u_1)
(V : Type u_2)
(P : Type u_3)
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]

(AffineSubspace.topEquiv k V P).linear = (LinearEquiv.ofEq ⊤.direction ⊤ ⋯).trans Submodule.topEquiv


/-- See also the more useful form `LieModule.zero_weightSpace_eq_top_of_nilpotent`. -/
@[simp]
theorem zero_weightSpace_eq_top_of_nilpotent' [IsNilpotent R L M] :
    weightSpace M (0 : L → R) = ⊤

{R : Type u_2}
{L : Type u_3}
(M : Type u_4)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsNilpotent R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[LieModule.IsNilpotent R L M]


lemma isDiag_map (hf : Injective f) : (e.map f).IsDiag ↔ e.IsDiag

{α : Type u_1}
{β : Type u_2}
{e : Sym2 α}
{f : α → β}
(hf : Function.Injective f)


@[to_additive] lemma AntivaryOn.div_right (h₁ : AntivaryOn f g₁ s) (h₂ : MonovaryOn f g₂ s) :
    AntivaryOn f (g₁ / g₂) s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedAddCommGroup α]
[LinearOrderedAddCommGroup β]
{s : Set ι}
{f : ι → α}
{g₁ g₂ : ι → β}
(h₁ : AntivaryOn f g₁ s)
(h₂ : MonovaryOn f g₂ s)


@[to_additive]
theorem op_injective : Injective (op : α → αᵐᵒᵖ)


/-- A split epi category is a category in which every epimorphism is split. -/
class SplitEpiCategory : Prop where
  /-- All epis are split -/
  isSplitEpi_of_epi : ∀ {X Y : C} (f : X ⟶ Y) [Epi f], IsSplitEpi f

[self : CategoryTheory.SplitEpiCategory C]


lemma IsWeaklyRegular.isWeaklyRegular_lTensor [Module.Flat R M₂]
    {rs : List R} (h : IsWeaklyRegular M rs) :
    IsWeaklyRegular (M₂ ⊗[R] M) rs

(h : RingTheory.Sequence.IsWeaklyRegular M rs)

RingTheory.Sequence.IsWeaklyRegular (TensorProduct R M₂ M) rs


protected lemma eq_or_lt_of_le : a ≤ b → a = b ∨ a < b


lemma IsScott.scottHausdorff_le [IsScott α] : scottHausdorff α ≤ ‹TopologicalSpace α›

{α : Type u_1}
[Preorder α]
[TopologicalSpace α]
[Topology.IsScott α]


lemma iIndepFun.isProbabilityMeasure (h : iIndepFun m f μ) : IsProbabilityMeasure μ

{Ω : Type u_1}
{ι : Type u_2}
{_mΩ : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
{β : ι → Type u_10}
{m : (i : ι) → MeasurableSpace (β i)}
{f : (i : ι) → Ω → β i}
(h : ProbabilityTheory.iIndepFun m f μ)


theorem aecover_Iic : AECover μ l fun i => Iic <| b i

{α : Type u_1}
{ι : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{l : Filter ι}
[Preorder α]
[TopologicalSpace α]
[OrderClosedTopology α]
[OpensMeasurableSpace α]
{b : ι → α}
(hb : Filter.Tendsto b l Filter.atTop)

MeasureTheory.AECover μ l fun i => Set.Iic (b i)


theorem not_firstCountableTopology_opc : ¬FirstCountableTopology ℚ∞


lemma EffectiveEpi.uniq {X Y W : C} (f : Y ⟶ X) [EffectiveEpi f]
    (e : Y ⟶ W) (h : ∀ {Z : C} (g₁ g₂ : Z ⟶ Y), g₁ ≫ f = g₂ ≫ f → g₁ ≫ e = g₂ ≫ e)
    (m : X ⟶ W) (hm : f ≫ m = e) :
    m = EffectiveEpi.desc f e h

(h :
  ∀ {Z : C} (g₁ g₂ : Z ⟶ Y),
    CategoryTheory.CategoryStruct.comp g₁ f = CategoryTheory.CategoryStruct.comp g₂ f →
      CategoryTheory.CategoryStruct.comp g₁ e = CategoryTheory.CategoryStruct.comp g₂ e)

(hm : CategoryTheory.CategoryStruct.comp f m = e)

m = CategoryTheory.EffectiveEpi.desc f e ⋯


/-- A base change of a flat algebra is flat. -/
theorem isBaseChange [Algebra R S] (R' : Type w) (S' : Type t) [CommRing R'] [CommRing S']
    [Algebra R R'] [Algebra S S'] [Algebra R' S'] [Algebra R S'] [IsScalarTower R R' S']
    [IsScalarTower R S S'] [h : IsPushout R S R' S'] [Algebra.Flat R R'] : Algebra.Flat S S'

(R : Type u)
(S : Type v)
[CommRing R]
[CommRing S]
[Algebra R S]
(R' : Type w)
(S' : Type t)
[CommRing R']
[CommRing S']
[Algebra R R']
[Algebra S S']
[Algebra R' S']
[Algebra R S']
[IsScalarTower R R' S']
[IsScalarTower R S S']
[h : Algebra.IsPushout R S R' S']
[Algebra.Flat R R']


lemma image_subset_sups_right : a ∈ s → t.image (a ⊔ ·) ⊆ s ⊻ t

{α : Type u_2}
[DecidableEq α]
[SemilatticeSup α]
{s t : Finset α}
{a : α}

a ∈ s → Finset.image (fun x => a ⊔ x) t ⊆ s ⊻ t


theorem filter_add_filter (q) [DecidablePred q] (s : Multiset α) :
    filter p s + filter q s = filter (fun a => p a ∨ q a) s + filter (fun a => p a ∧ q a) s

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

Multiset.filter p s + Multiset.filter q s =
  Multiset.filter (fun a => p a ∨ q a) s + Multiset.filter (fun a => p a ∧ q a) s


theorem smoothOn_symm_coordChangeL :
    SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun b : B => ((e.coordChangeL 𝕜 e' b).symm : F →L[𝕜] F))
      (e.baseSet ∩ e'.baseSet)

[TopologicalSpace (Bundle.TotalSpace F E)]

(e e' : Trivialization F Bundle.TotalSpace.proj)

SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun b => ↑(Trivialization.coordChangeL 𝕜 e e' b).symm) (e.baseSet ∩ e'.baseSet)


@[simp]
theorem realize_toFormula (φ : L.BoundedFormula α n) (v : α ⊕ (Fin n) → M) :
    φ.toFormula.Realize v ↔ φ.Realize (v ∘ Sum.inl) (v ∘ Sum.inr)

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{n : ℕ}
(φ : L.BoundedFormula α n)
(v : α ⊕ Fin n → M)


@[simp] theorem mem_cons : a ∈ (b :: l) ↔ a = b ∨ a ∈ l

∀ {α : Type u_1} {a b : α} {l : List α}, a ∈ b :: l ↔ a = b ∨ a ∈ l


@[to_additive (attr := simp)]
lemma _root_.Function.const_div [Div β] (a b : β) : const α a / const α b = const α (a / b)

{α : Type u_1}
{β : Type u_2}
[Sub β]
(a b : β)

Function.const α a - Function.const α b = Function.const α (a - b)


@[to_additive]
theorem subtype_comp_rangeRestrict (f : G →* N) : f.range.subtype.comp f.rangeRestrict = f

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


@[simp]
theorem preimage_const_mul_Ioi (a : α) {c : α} (h : 0 < c) : (c * ·) ⁻¹' Ioi a = Ioi (a / c)

{α : Type u_1}
[LinearOrderedField α]
(a : α)
{c : α}
(h : 0 < c)

(fun x => c * x) ⁻¹' Set.Ioi a = Set.Ioi (a / c)


@[simp] lemma truncatedSup_empty (a : α) : truncatedSup ∅ a = ⊤

{α : Type u_1}
[SemilatticeSup α]
[OrderTop α]
[DecidableRel fun x x_1 => x ≤ x_1]
(a : α)


theorem map_liftQ [RingHomSurjective τ₁₂] (f : M →ₛₗ[τ₁₂] M₂) (h) (q : Submodule R (M ⧸ p)) :
    q.map (p.liftQ f h) = (q.comap p.mkQ).map f

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
(p : Submodule R M)
{R₂ : Type u_3}
{M₂ : Type u_4}
[Ring R₂]
[AddCommGroup M₂]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
[RingHomSurjective τ₁₂]
(f : M →ₛₗ[τ₁₂] M₂)
(h : p ≤ LinearMap.ker f)
(q : Submodule R (M ⧸ p))

Submodule.map (p.liftQ f h) q = Submodule.map f (Submodule.comap p.mkQ q)


@[simp]
theorem basisOf_reindex (i : ι') :
    (b.reindex e).basisOf i =
      (b.basisOf <| e.symm i).reindex (e.subtypeEquiv fun _ => e.eq_symm_apply.not)

{ι : Type u_1}
{ι' : Type u_2}
{k : Type u_3}
{V : Type u_4}
{P : Type u_5}
[AddCommGroup V]
[AffineSpace V P]
[Ring k]
[Module k V]
(b : AffineBasis ι k P)
(e : ι ≃ ι')
(i : ι')

(b.reindex e).basisOf i = (b.basisOf (e.symm i)).reindex (e.subtypeEquiv ⋯)


theorem nonsing_inv_cancel_or_zero : A⁻¹ * A = 1 ∧ A * A⁻¹ = 1 ∨ A⁻¹ = 0

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


theorem rel_foldl : ((P ⇒ R ⇒ P) ⇒ P ⇒ Forall₂ R ⇒ P) foldl foldl

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{R : α → β → Prop}
{P : γ → δ → Prop}

((P ⇒ R ⇒ P) ⇒ P ⇒ List.Forall₂ R ⇒ P) List.foldl List.foldl


@[simp] theorem toFun_eq_coe (f : S₁ →◃ S₂) : f.toFun = f

{S₁ : Type u_1}
{S₂ : Type u_2}
[Shelf S₁]
[Shelf S₂]
(f : S₁ →◃ S₂)


theorem exists_smul_eq_mk_rep (v : V) (hv : v ≠ 0) : ∃ a : Kˣ, a • v = (mk K v hv).rep

(K : Type u_1)
{V : Type u_2}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
(v : V)
(hv : v ≠ 0)

∃ a, a • v = (Projectivization.mk K v hv).rep


@[simp]
theorem sub_apply [Sub α] (A B : Matrix m n α) (i : m) (j : n) :
    (A - B) i j = (A i j) - (B i j)

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[Sub α]
(A B : Matrix m n α)
(i : m)
(j : n)


@[to_additive]
theorem tprod_even_mul_odd {f : ℕ → M} (he : Multipliable fun k ↦ f (2 * k))
    (ho : Multipliable fun k ↦ f (2 * k + 1)) :
    (∏' k, f (2 * k)) * ∏' k, f (2 * k + 1) = ∏' k, f k

(ho : Multipliable fun k => f (2 * k + 1))


protected theorem mul_comm (x y : EReal) : x * y = y * x


/-- Given right homology data `h₁` and `h₂` for two short complexes `S₁` and `S₂`,
a `RightHomologyMapData` for a morphism `φ : S₁ ⟶ S₂`
consists of a description of the induced morphisms on the `Q` (opcycles)
and `H` (right homology) fields of `h₁` and `h₂`. -/
structure RightHomologyMapData where
  /-- the induced map on opcycles -/
  φQ : h₁.Q ⟶ h₂.Q
  /-- the induced map on right homology -/
  φH : h₁.H ⟶ h₂.H
  /-- commutation with `p` -/
  commp : h₁.p ≫ φQ = φ.τ₂ ≫ h₂.p := by aesop_cat
  /-- commutation with `g'` -/
  commg' : φQ ≫ h₂.g' = h₁.g' ≫ φ.τ₃ := by aesop_cat
  /-- commutation with `ι` -/
  commι : φH ≫ h₂.ι = h₁.ι ≫ φQ := by aesop_cat

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

CategoryTheory.CategoryStruct.comp h₁.p self.φQ = CategoryTheory.CategoryStruct.comp φ.τ₂ h₂.p


/-- A `Filtration` on a measurable space `Ω` with σ-algebra `m` is a monotone
sequence of sub-σ-algebras of `m`. -/
structure Filtration {Ω : Type*} (ι : Type*) [Preorder ι] (m : MeasurableSpace Ω) where
  seq : ι → MeasurableSpace Ω
  mono' : Monotone seq
  le' : ∀ i : ι, seq i ≤ m

{Ω : Type u_1}
{ι : Type u_2}
[Preorder ι]
{m : MeasurableSpace Ω}
(self : MeasureTheory.Filtration ι m)


private theorem coeffs : (∀ n > 3, P.toPoly.coeff n = 0) ∧ P.toPoly.coeff 3 = P.a ∧
    P.toPoly.coeff 2 = P.b ∧ P.toPoly.coeff 1 = P.c ∧ P.toPoly.coeff 0 = P.d

{R : Type u_1}
{P : Cubic R}
[Semiring R]


theorem surjective_of_linearIndependent_of_span [Nontrivial R] (hv : LinearIndependent R v)
    (f : ι' ↪ ι) (hss : range v ⊆ span R (range (v ∘ f))) : Surjective f

(hss : Set.range v ⊆ ↑(Submodule.span R (Set.range (v ∘ ⇑f))))


/-- The eigenvalues of a self-adjoint operator are real. -/
theorem conj_eigenvalue_eq_self {μ : 𝕜} (hμ : HasEigenvalue T μ) : conj μ = μ

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


@[simp] theorem UInt32.toUSize_toNat (x : UInt32) : x.toUSize.toNat = x.toNat


theorem coe_eq_coe' {x y : α} : (x : ConnectedComponents α) = y ↔ x ∈ connectedComponent y

{α : Type u}
[TopologicalSpace α]
{x y : α}

ConnectedComponents.mk x = ConnectedComponents.mk y ↔ x ∈ connectedComponent y


theorem borel_eq_generateFrom_Iic_rat : borel ℝ = .generateFrom (⋃ a : ℚ, {Iic (a : ℝ)})

borel ℝ = MeasurableSpace.generateFrom (⋃ a, {Set.Iic ↑a})


theorem supported_mono {s t : Set α} (st : s ⊆ t) : supported M R s ≤ supported M R t

{α : Type u_1}
{M : Type u_2}
{R : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{s t : Set α}
(st : s ⊆ t)

Finsupp.supported M R s ≤ Finsupp.supported M R t


@[simp]
theorem coe_subtype (h : ↑P ≤ N) : ↑(P.subtype h) = subgroupOf (↑P) N

{p : ℕ}
{G : Type u_1}
[Group G]
(P : Sylow p G)
{N : Subgroup G}
(h : ↑P ≤ N)


theorem coeFn_nonneg (f : Lp E p μ) : 0 ≤ᵐ[μ] f ↔ 0 ≤ f

{α : Type u_1}
{E : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{p : ℝ≥0∞}
[NormedLatticeAddCommGroup E]
(f : ↥(MeasureTheory.Lp E p μ))

0 ≤ᵐ[μ] ↑↑f ↔ 0 ≤ f


/-- The additive character on `ZMod n` associated to a primitive `n`th root of unity
is primitive -/
theorem zmodChar_primitive_of_primitive_root (n : ℕ) [NeZero n] {ζ : C} (h : IsPrimitiveRoot ζ n) :
    IsPrimitive (zmodChar n ((IsPrimitiveRoot.iff_def ζ n).mp h).left)

{C : Type v}
[CommMonoid C]
(n : ℕ)
[NeZero n]
{ζ : C}
(h : IsPrimitiveRoot ζ n)


@[simp, norm_cast] lemma coe_top : (⊤ : Sublattice α) = (univ : Set α)


/-- Given an action of a group `α` on `β`, each `g : α` defines a permutation of `β`. -/
@[to_additive (attr := simps)]
def MulAction.toPerm (a : α) : Equiv.Perm β

{α : Type u_1}
{β : Type u_2}
[AddGroup α]
[AddAction α β]
(a : α)
(x : β)

(Equiv.symm (AddAction.toPerm a)) x = -a +ᵥ x


theorem supIndep_singleton (i : ι) (f : ι → α) : ({i} : Finset ι).SupIndep f

{α : Type u_1}
{ι : Type u_3}
[Lattice α]
[OrderBot α]
(i : ι)
(f : ι → α)


/-- The image of a commutative square by a functor. -/
@[simps]
def map (sq : Square C) (F : C ⥤ D) : Square D

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


/-- The abscissa of absolute convergence of the point-wise product of `log` and `f`
is the same as that of `f`. -/
@[simp]
lemma LSeries.abscissaOfAbsConv_logMul {f : ℕ → ℂ} :
    abscissaOfAbsConv (logMul f) = abscissaOfAbsConv f

LSeries.abscissaOfAbsConv (LSeries.logMul f) = LSeries.abscissaOfAbsConv f


@[gcongr]
theorem rpow_lt_rpow (hx : 0 ≤ x) (hxy : x < y) (hz : 0 < z) : x ^ z < y ^ z

{x y z : ℝ}
(hx : 0 ≤ x)
(hxy : x < y)
(hz : 0 < z)


theorem IsClopen.diff (hs : IsClopen s) (ht : IsClopen t) : IsClopen (s \ t)

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


@[simp]
lemma map_baseChange {S : Type s} [CommRing S] [Algebra R S] {A : Type v} [CommRing A] [Algebra R A]
    [Algebra S A] [IsScalarTower R S A] {B : Type w} [CommRing B] [Algebra R B] [Algebra S B]
    [IsScalarTower R S B] (ψ : A →ₐ[S] B) : (W.baseChange A).map ψ = W.baseChange B

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
{S : Type s}
[CommRing S]
[Algebra R S]
{A : Type v}
[CommRing A]
[Algebra R A]
[Algebra S A]
[IsScalarTower R S A]
{B : Type w}
[CommRing B]
[Algebra R B]
[Algebra S B]
[IsScalarTower R S B]
(ψ : A →ₐ[S] B)

(W.baseChange A).map ↑ψ = W.baseChange B


lemma ltTrichotomy_eq_iff : ltTrichotomy x y p q r = s ↔
    (x < y ∧ p = s) ∨ (x = y ∧ q = s) ∨ (y < x ∧ r = s)

{α : Type u_2}
[LinearOrder α]
{P : Sort u_5}
{x y : α}
{p q r s : P}

ltTrichotomy x y p q r = s ↔ x < y ∧ p = s ∨ x = y ∧ q = s ∨ y < x ∧ r = s


@[fun_prop]
theorem hasStrictFDerivAt_const (c : F) (x : E) :
    HasStrictFDerivAt (fun _ => c) (0 : E →L[𝕜] F) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(c : F)
(x : E)


theorem inner_add_left (x y z : E) : ⟪x + y, z⟫ = ⟪x, z⟫ + ⟪y, z⟫

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(x y z : E)


@[to_additive]
theorem Subgroup.eq_bot_or_eq_top_of_prime_card {G : Type*} [Group G] {_ : Fintype G}
    (H : Subgroup G) [hp : Fact (Fintype.card G).Prime] : H = ⊥ ∨ H = ⊤

∀ {x : Fintype G} (H : Subgroup G) [hp : Fact (Nat.Prime (Fintype.card G))], H = ⊥ ∨ H = ⊤


@[simp]
theorem bernoulli'_one : bernoulli' 1 = 1 / 2


@[simp]
theorem fderivInnerCLM_apply (p x : E × E) : fderivInnerCLM 𝕜 p x = ⟪p.1, x.2⟫ + ⟪x.1, p.2⟫

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedSpace ℝ E]
(p x : E × E)

(fderivInnerCLM 𝕜 p) x = ⟪p.1, x.2⟫_𝕜 + ⟪x.1, p.2⟫_𝕜


/-- Two points coincide if their distance is `< ε` for all positive ε -/
theorem eq_of_forall_edist_le {x y : γ} (h : ∀ ε > 0, edist x y ≤ ε) : x = y

{γ : Type w}
[EMetricSpace γ]
{x y : γ}
(h : ∀ ε > 0, edist x y ≤ ε)


theorem tendsto_iInf' {f : α → β} {x : ι → Filter α} {y : Filter β} (i : ι)
    (hi : Tendsto f (x i) y) : Tendsto f (⨅ i, x i) y

{α : Type u}
{β : Type v}
{ι : Sort x}
{f : α → β}
{x : ι → Filter α}
{y : Filter β}
(i : ι)
(hi : Filter.Tendsto f (x i) y)


theorem convexJoin_singletons (x : E) : convexJoin 𝕜 {x} {y} = segment 𝕜 x y

{𝕜 : Type u_2}
{E : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{y : E}
(x : E)


/-- In a finite-dimensional vector space, the dimensions of a submodule and of the corresponding
quotient add up to the dimension of the space. -/
theorem finrank_quotient_add_finrank [FiniteDimensional K V] (s : Submodule K V) :
    finrank K (V ⧸ s) + finrank K s = finrank K V

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
[FiniteDimensional K V]
(s : Submodule K V)

FiniteDimensional.finrank K (V ⧸ s) + FiniteDimensional.finrank K ↥s = FiniteDimensional.finrank K V


/-- `(n + 1).ascFactorial k = (n + k) ! / n !` but without ℕ-division. See
`Nat.ascFactorial_eq_div` for the version with ℕ-division. -/
theorem factorial_mul_ascFactorial (n : ℕ) : ∀ k, n ! * (n + 1).ascFactorial k = (n + k)!

n.factorial * (n + 1).ascFactorial k = (n + k).factorial


theorem nhds_basis_Ioo [OrderTopology α] [NoMaxOrder α] [NoMinOrder α] (a : α) :
    (𝓝 a).HasBasis (fun b : α × α => b.1 < a ∧ a < b.2) fun b => Ioo b.1 b.2

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[NoMaxOrder α]
[NoMinOrder α]
(a : α)

(𝓝 a).HasBasis (fun b => b.1 < a ∧ a < b.2) fun b => Set.Ioo b.1 b.2


theorem SemilinearMapClass.bound_of_shell_semi_normed [SemilinearMapClass 𝓕 σ₁₂ E F] (f : 𝓕)
    {ε C : ℝ} (ε_pos : 0 < ε) {c : 𝕜} (hc : 1 < ‖c‖)
    (hf : ∀ x, ε / ‖c‖ ≤ ‖x‖ → ‖x‖ < ε → ‖f x‖ ≤ C * ‖x‖) {x : E} (hx : ‖x‖ ≠ 0) :
    ‖f x‖ ≤ C * ‖x‖

{σ₁₂ : 𝕜 →+* 𝕜₂}

(hf : ∀ (x : E), ε / ‖c‖ ≤ ‖x‖ → ‖x‖ < ε → ‖f x‖ ≤ C * ‖x‖)

‖f x‖ ≤ C * ‖x‖


/-- Orbits of an element form a partition -/
theorem IsPartition.of_orbits :
    Setoid.IsPartition (Set.range fun a : X => orbit G a)

{G : Type u_1}
[Group G]
{X : Type u_2}
[MulAction G X]

Setoid.IsPartition (Set.range fun a => MulAction.orbit G a)


@[simp]
theorem symmDiff_sdiff_inf : a ∆ b \ (a ⊓ b) = a ∆ b

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


theorem coeff_mem_coeffs (p : R[X]) (n : ℕ) (h : p.coeff n ≠ 0) : p.coeff n ∈ p.coeffs

{R : Type u}
[Semiring R]
(p : R[X])
(n : ℕ)
(h : p.coeff n ≠ 0)


@[simp]
theorem decode_list_zero : decode (α := List α) 0 = some []


lemma shiftFunctorAdd'_eq (a b c : ℤ) (h : a + b = c) :
    CategoryTheory.shiftFunctorAdd' (CochainComplex C ℤ) a b c h =
      shiftFunctorAdd' C a b c h

(C : Type u)
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
(a b c : ℤ)
(h : a + b = c)

CategoryTheory.shiftFunctorAdd' (CochainComplex C ℤ) a b c h = CochainComplex.shiftFunctorAdd' C a b c h


/-- The map `in_coordinates` for the tangent bundle is trivial on the model spaces -/
theorem inCoordinates_tangent_bundle_core_model_space (x₀ x : H) (y₀ y : H') (ϕ : E →L[𝕜] E') :
    inCoordinates E (TangentSpace I) E' (TangentSpace I') x₀ x y₀ y ϕ = ϕ

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_4}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{H' : Type u_5}
[TopologicalSpace H']
(I' : ModelWithCorners 𝕜 E' H')
(x₀ x : H)
(y₀ y : H')
(ϕ : E →L[𝕜] E')

ContinuousLinearMap.inCoordinates E (TangentSpace I) E' (TangentSpace I') x₀ x y₀ y ϕ = ϕ


theorem image_univ : r.image Set.univ = r.codom

{α : Type u_1}
{β : Type u_2}
(r : Rel α β)


theorem span_singleton_eq_top {m : M} (hm : m ≠ 0) : Submodule.span R {m} = ⊤

(R : Type u_2)
[Ring R]
{M : Type u_4}
[AddCommGroup M]
[Module R M]
[IsSimpleModule R M]
{m : M}
(hm : m ≠ 0)


@[to_additive]
theorem Nonempty.smul_set : s.Nonempty → (a • s).Nonempty

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


/-- A specialization of `mem_iUnion₂`. -/
theorem mem_biUnion {s : Set α} {t : α → Set β} {x : α} {y : β} (xs : x ∈ s) (ytx : y ∈ t x) :
    y ∈ ⋃ x ∈ s, t x

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : α → Set β}
{x : α}
{y : β}
(xs : x ∈ s)
(ytx : y ∈ t x)


theorem isCompact_accumulate {K : ℕ → Set X} (hK : ∀ n, IsCompact (K n)) (n : ℕ) :
    IsCompact (Accumulate K n)

{X : Type u}
[TopologicalSpace X]
{K : ℕ → Set X}
(hK : ∀ (n : ℕ), IsCompact (K n))
(n : ℕ)


@[simp]
theorem pow_nonneg {a : α} (H : 0 ≤ a) : ∀ n : ℕ, 0 ≤ a ^ n

{α : Type u_1}
[MonoidWithZero α]
[Preorder α]
[ZeroLEOneClass α]
[PosMulMono α]
{a : α}
(H : 0 ≤ a)
(n : ℕ)


@[simp]
theorem neg_lt_zero_iff {x : PGame} : -x < 0 ↔ 0 < x


theorem integrable_approxOn [BorelSpace E] {f : β → E} {μ : Measure β} (fmeas : Measurable f)
    (hf : Integrable f μ) {s : Set E} {y₀ : E} (h₀ : y₀ ∈ s) [SeparableSpace s]
    (hi₀ : Integrable (fun _ => y₀) μ) (n : ℕ) : Integrable (approxOn f fmeas s y₀ h₀ n) μ

(hi₀ : MeasureTheory.Integrable (fun x => y₀) μ)

MeasureTheory.Integrable (↑(MeasureTheory.SimpleFunc.approxOn f fmeas s y₀ h₀ n)) μ


theorem baseChange_eq_ltensor : (f.baseChange A : A ⊗ M → A ⊗ N) = f.lTensor A

{R : Type u_1}
{A : Type u_2}
{M : Type u_4}
{N : Type u_5}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
(f : M →ₗ[R] N)

⇑(LinearMap.baseChange A f) = ⇑(LinearMap.lTensor A f)


theorem conts_recurrenceAux {gp ppred pred : Pair K} (nth_s_eq : g.s.get? n = some gp)
    (nth_contsAux_eq : g.contsAux n = ppred)
    (succ_nth_contsAux_eq : g.contsAux (n + 1) = pred) :
    g.conts (n + 1) = ⟨gp.b * pred.a + gp.a * ppred.a, gp.b * pred.b + gp.a * ppred.b⟩

g.conts (n + 1) = { a := gp.b * pred.a + gp.a * ppred.a, b := gp.b * pred.b + gp.a * ppred.b }


/-- The structure presheaf, valued in `CommRing`, constructed by dressing up the `Type` valued
structure presheaf. -/
@[simps]
def structurePresheafInCommRing : Presheaf CommRingCat (ProjectiveSpectrum.top 𝒜)

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[CommRing A]
[Algebra R A]
(𝒜 : ℕ → Submodule R A)
[GradedAlgebra 𝒜]

∀ {X Y : (TopologicalSpace.Opens ↑(ProjectiveSpectrum.top 𝒜))ᵒᵖ} (i : X ⟶ Y)
  (a : (AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.structureSheafInType 𝒜).val.obj X),
  ((AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.structurePresheafInCommRing 𝒜).map i) a =
    (AlgebraicGeometry.ProjectiveSpectrum.StructureSheaf.structureSheafInType 𝒜).val.map i a


@[simp]
theorem mul_star_self (U : unitary R) : U * star U = 1

{R : Type u_1}
[Monoid R]
[StarMul R]
(U : ↥(unitary R))


@[simp] lemma predAbove_last_of_ne_last {i : Fin (n + 2)} (hi : i ≠ last (n + 1)) :
    predAbove (last n) i = castPred i hi

{n : ℕ}
{i : Fin (n + 2)}
(hi : i ≠ Fin.last (n + 1))

(Fin.last n).predAbove i = i.castPred hi


/-- The two-variable Jacobi theta function is periodic in `τ` with period 2. -/
lemma jacobiTheta₂_add_right (z τ : ℂ) : jacobiTheta₂ z (τ + 2) = jacobiTheta₂ z τ


protected theorem le_trans {a b c : Char} : a ≤ b → b ≤ c → a ≤ c


@[to_additive]
theorem mul_leftInvEquiv (x : S.leftInv) : (x : M) * S.leftInvEquiv hS x = 1

{M : Type u_1}
[CommMonoid M]
(S : Submonoid M)
(hS : S ≤ IsUnit.submonoid M)
(x : ↥S.leftInv)


@[simp]
theorem arcsin_le_neg_pi_div_two {x} : arcsin x ≤ -(π / 2) ↔ x ≤ -1


theorem ContDiff.cosh {n} (h : ContDiff ℝ n f) : ContDiff ℝ n fun x => Real.cosh (f x)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{n : ℕ∞}
(h : ContDiff ℝ n f)


@[simp]
theorem Icc_self (a : α) : Icc a a = {a}

{α : Type u_2}
[PartialOrder α]
[LocallyFiniteOrder α]
(a : α)


theorem deriv_zpow (m : ℤ) (x : 𝕜) : deriv (fun x => x ^ m) x = m * x ^ (m - 1)

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(m : ℤ)
(x : 𝕜)

deriv (fun x => x ^ m) x = ↑m * x ^ (m - 1)


/-- An isometry induces an isometric isomorphism between the source space and the
range of the isometry. -/
@[simps! (config := { simpRhs := true }) toEquiv apply]
def Isometry.isometryEquivOnRange [EMetricSpace α] [PseudoEMetricSpace β] {f : α → β}
    (h : Isometry f) : α ≃ᵢ range f

{α : Type u}
{β : Type v}
[EMetricSpace α]
[PseudoEMetricSpace β]
{f : α → β}
(h : Isometry f)

h.isometryEquivOnRange.toEquiv = Equiv.ofInjective f ⋯


/-- A product of a function over a `Finset` in a subtype equals a
product in the main type of a function that agrees with the first
function on that `Finset`. -/
@[to_additive "A sum of a function over a `Finset` in a subtype equals a
sum in the main type of a function that agrees with the first
function on that `Finset`."]
theorem prod_subtype_map_embedding {p : α → Prop} {s : Finset { x // p x }} {f : { x // p x } → β}
    {g : α → β} (h : ∀ x : { x // p x }, x ∈ s → g x = f x) :
    (∏ x ∈ s.map (Function.Embedding.subtype _), g x) = ∏ x ∈ s, f x

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
{p : α → Prop}
{s : Finset { x // p x }}
{f : { x // p x } → β}
{g : α → β}
(h : ∀ x ∈ s, g ↑x = f x)

∏ x ∈ Finset.map (Function.Embedding.subtype fun x => p x) s, g x = ∏ x ∈ s, f x


@[nolint unusedHavesSuffices] -- Porting note: false positive
theorem strongDownwardInduction_eq {p : Finset α → Sort*}
    (H : ∀ t₁, (∀ {t₂ : Finset α}, t₂.card ≤ n → t₁ ⊂ t₂ → p t₂) → t₁.card ≤ n → p t₁)
    (s : Finset α) :
    strongDownwardInduction H s = H s fun {t} ht _ => strongDownwardInduction H t ht

(H : (t₁ : Finset α) → ({t₂ : Finset α} → t₂.card ≤ n → t₁ ⊂ t₂ → p t₂) → t₁.card ≤ n → p t₁)

Finset.strongDownwardInduction H s = H s fun {t} ht x => Finset.strongDownwardInduction H t ht


/-- The determinant of the change-of-basis matrix between two orthonormal bases `a`, `b` is ±1. -/
theorem OrthonormalBasis.det_to_matrix_orthonormalBasis_real :
    a.toBasis.det b = 1 ∨ a.toBasis.det b = -1

{ι : Type u_1}
{F : Type u_6}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
[Fintype ι]
[DecidableEq ι]
(a b : OrthonormalBasis ι ℝ F)

a.toBasis.det ⇑b = 1 ∨ a.toBasis.det ⇑b = -1


@[simp]
theorem aeval_U (x : A) (n : ℤ) : aeval x (U R n) = (U A n).eval x

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[CommRing A]
[Algebra R A]
(x : A)
(n : ℤ)

(Polynomial.aeval x) (Polynomial.Chebyshev.U R n) = Polynomial.eval x (Polynomial.Chebyshev.U A n)


@[continuity]
theorem continuous_arccos : Continuous arccos


theorem unitization_range :
    (unitization s).range = subalgebraOfSubring (Subring.closure s)

{R : Type u_1}
{S : Type u_2}
[Ring R]
[SetLike S R]
[hSR : NonUnitalSubringClass S R]
(s : S)

(NonUnitalSubring.unitization s).range = subalgebraOfSubring (Subring.closure ↑s)


@[nolint unusedArguments]
theorem mul_eq {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (_ : 0 < b) : b * a = 0

{α : Type u_1}
[OrderedSemiring α]
{a b : α}
(ha : a = 0)


/-- A version of `Finset.inf'_mono` acceptable for `@[gcongr]`.
Instead of deducing `s₂.Nonempty` from `s₁.Nonempty` and `s₁ ⊆ s₂`,
this version takes it as an argument. -/
@[gcongr]
lemma _root_.GCongr.finset_inf'_mono {s₁ s₂ : Finset β} (h : s₁ ⊆ s₂)
    {h₁ : s₁.Nonempty} {h₂ : s₂.Nonempty} : s₂.inf' h₂ f ≤ s₁.inf' h₁ f

{α : Type u_2}
{β : Type u_3}
[SemilatticeInf α]
(f : β → α)
{s₁ s₂ : Finset β}
(h : s₁ ⊆ s₂)
{h₁ : s₁.Nonempty}
{h₂ : s₂.Nonempty}


@[gcongr]
theorem toNat_le_toNat (hcd : c ≤ d) (hd : d < ℵ₀) : toNat c ≤ toNat d

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


@[simp, norm_cast]
lemma coe_erase (s : UpperSet α) (a : α) : s.erase a = (s : Set α) \ LowerSet.Iic a

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


/-- The set in `enumOrd_def'` is nonempty. -/
theorem enumOrd_def'_nonempty (hS : Unbounded (· < ·) S) (a) : (S ∩ Set.Ici a).Nonempty

(hS : Set.Unbounded (fun x x_1 => x < x_1) S)


@[simp]
theorem disjointed_zero (f : ℕ → α) : disjointed f 0 = f 0

{α : Type u_1}
[GeneralizedBooleanAlgebra α]
(f : ℕ → α)


theorem det_adjustToOrientation :
    (e.adjustToOrientation x).toBasis.det = e.toBasis.det ∨
      (e.adjustToOrientation x).toBasis.det = -e.toBasis.det

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
{ι : Type u_2}
[Fintype ι]
[DecidableEq ι]
[ne : Nonempty ι]
(e : OrthonormalBasis ι ℝ E)
(x : Orientation ℝ E ι)


/-- `⊤`, coerced to a set, is the whole set of points. -/
@[simp]
theorem top_coe : ((⊤ : AffineSubspace k P) : Set P) = Set.univ

(k : Type u_1)
(V : Type u_2)
(P : Type u_3)
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]


theorem UniformInducing.basis_uniformity {f : α → β} (hf : UniformInducing f) {ι : Sort*}
    {p : ι → Prop} {s : ι → Set (β × β)} (H : (𝓤 β).HasBasis p s) :
    (𝓤 α).HasBasis p fun i => Prod.map f f ⁻¹' s i

{α : Type u}
{β : Type v}
[UniformSpace α]
[UniformSpace β]
{f : α → β}
(hf : UniformInducing f)
{ι : Sort u_1}
{p : ι → Prop}
{s : ι → Set (β × β)}
(H : (𝓤 β).HasBasis p s)


theorem const_inv {x : β} (hx : x ≠ 0) :
    const abv x⁻¹ = inv (const abv x) (by rwa [const_limZero])

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[DivisionRing β]
{abv : β → α}
[IsAbsoluteValue abv]
{x : β}
(hx : x ≠ 0)

CauSeq.const abv x⁻¹ = (CauSeq.const abv x).inv ⋯


@[to_additive]
theorem measure_ne_zero_iff_nonempty_of_isMulLeftInvariant [Regular μ] (hμ : μ ≠ 0) {s : Set G}
    (hs : IsOpen s) : μ s ≠ 0 ↔ s.Nonempty

{G : Type u_2}
[MeasurableSpace G]
[TopologicalSpace G]
[BorelSpace G]
{μ : MeasureTheory.Measure G}
[AddGroup G]
[TopologicalAddGroup G]
[μ.IsAddLeftInvariant]
[μ.Regular]
(hμ : μ ≠ 0)
{s : Set G}
(hs : IsOpen s)


@[to_additive]
theorem uniformGroup_inf {u₁ u₂ : UniformSpace β} (h₁ : @UniformGroup β u₁ _)
    (h₂ : @UniformGroup β u₂ _) : @UniformGroup β (u₁ ⊓ u₂) _

{β : Type u_2}
[Group β]
{u₁ u₂ : UniformSpace β}
(h₁ : UniformGroup β)
(h₂ : UniformGroup β)


/-- `Additive (Multiplicative G)` is just `G`. -/
@[simps!]
def AddEquiv.additiveMultiplicative [AddZeroClass G] : Additive (Multiplicative G) ≃+ G

(AddEquiv.additiveMultiplicative G).symm a = Additive.ofMul (Multiplicative.ofAdd a)


/-- An induction principle for elements of `⨆ i, S i`.
If `C` holds all elements of `S i` for all `i`, and is preserved under multiplication,
then it holds for all elements of the supremum of `S`. -/
@[to_additive (attr := elab_as_elim)
"An induction principle for elements of `⨆ i, S i`. If `C` holds all
elements of `S i` for all `i`, and is preserved under addition, then it holds for all elements of
the supremum of `S`."]
theorem iSup_induction (S : ι → Subsemigroup M) {C : M → Prop} {x₁ : M} (hx₁ : x₁ ∈ ⨆ i, S i)
    (mem : ∀ i, ∀ x₂ ∈ S i, C x₂) (mul : ∀ x y, C x → C y → C (x * y)) : C x₁

(mul : ∀ (x y : M), C x → C y → C (x + y))


@[reassoc]
lemma ι_totalShift₁Iso_inv_f (a b n : ℤ) (h : a + b = n) (a' n' : ℤ)
    (ha' : a' + b = n') (hn' : n' = n + x) :
    K.ιTotal (up ℤ) a' b n' ha' ≫
      (CochainComplex.shiftFunctorObjXIso (K.total (up ℤ)) x n n' hn').inv ≫
        (K.totalShift₁Iso x).inv.f n =
      (K.shiftFunctor₁XXIso a x a' (by omega) b).inv ≫
        ((shiftFunctor₁ C x).obj K).ιTotal (up ℤ) a b n h

(K : HomologicalComplex₂ C (ComplexShape.up ℤ) (ComplexShape.up ℤ))

K.ιTotal (ComplexShape.up ℤ) a' b n' ha' ≫
    (CochainComplex.shiftFunctorObjXIso (K.total (ComplexShape.up ℤ)) x n n' hn').inv ≫ (K.totalShift₁Iso x).inv.f n =
  (K.shiftFunctor₁XXIso a x a' ⋯ b).inv ≫
    ((HomologicalComplex₂.shiftFunctor₁ C x).obj K).ιTotal (ComplexShape.up ℤ) a b n h


theorem insertNth_val {i : Fin (n + 1)} {v : Vector α n} :
    (v.insertNth a i).val = v.val.insertNth i.1 a

{n : ℕ}
{α : Type u_1}
{a : α}
{i : Fin (n + 1)}
{v : Mathlib.Vector α n}

↑(Mathlib.Vector.insertNth a i v) = List.insertNth (↑i) a ↑v


lemma opEpi_comp (σ : M.GeneratingSections) (p : M ⟶ N) (q : N ⟶ P) [Epi p] [Epi q] :
    σ.ofEpi (p ≫ q) = (σ.ofEpi p).ofEpi q

{J : CategoryTheory.GrothendieckTopology C}

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


/-- For any three points in an orthocentric system generated by
triangle `t`, there is a point in the subspace spanned by the triangle
from which the distance of all those three points equals the circumradius. -/
theorem exists_dist_eq_circumradius_of_subset_insert_orthocenter {t : Triangle ℝ P}
    (ho : t.orthocenter ∉ Set.range t.points) {p : Fin 3 → P}
    (hps : Set.range p ⊆ insert t.orthocenter (Set.range t.points)) (hpi : Function.Injective p) :
    ∃ c ∈ affineSpan ℝ (Set.range t.points), ∀ p₁ ∈ Set.range p, dist p₁ c = t.circumradius

∃ c ∈ affineSpan ℝ (Set.range t.points), ∀ p₁ ∈ Set.range p, dist p₁ c = Affine.Simplex.circumradius t


protected theorem congr_fun {f g : F} (h₁ : f = g) (x : α) : f x = g x

{F : Sort u_1}
{α : Sort u_2}
{β : α → Sort u_3}
[i : DFunLike F α β]
{f g : F}
(h₁ : f = g)
(x : α)


@[to_additive (attr := elab_as_elim)]
theorem induction_of_closure_eq_top_left {s : Set M} {p : M → Prop} (hs : closure s = ⊤) (x : M)
    (one : p 1) (mul : ∀ x ∈ s, ∀ (y), p y → p (x * y)) : p x

(mul : ∀ x ∈ s, ∀ (y : M), p y → p (x * y))


@[reassoc (attr := simp)]
lemma inl_v_descCochain_v (p₁ p₂ p₃ : ℤ) (h₁₂ : p₁ + (-1) = p₂) (h₂₃ : p₂ + n = p₃) :
    (inl φ).v p₁ p₂ h₁₂ ≫ (descCochain φ α β h).v p₂ p₃ h₂₃ =
        α.v p₁ p₃ (by rw [← h₂₃, ← h₁₂, ← h, add_comm m, add_assoc, neg_add_cancel_left])

(α : CochainComplex.HomComplex.Cochain F K m)

(β : CochainComplex.HomComplex.Cochain G K n)

(CochainComplex.mappingCone.inl φ).v p₁ p₂ h₁₂ ≫ (CochainComplex.mappingCone.descCochain φ α β h).v p₂ p₃ h₂₃ =
  α.v p₁ p₃ ⋯


@[instance]
theorem coprod_neBot_right [NeBot g] [Nonempty α] : (f.coprod g).NeBot

{α : Type u_1}
{β : Type u_2}
{f : Filter α}
{g : Filter β}
[g.NeBot]
[Nonempty α]


theorem Chain'.tail : ∀ {l}, Chain' R l → Chain' R l.tail

{α : Type u}
{R : α → α → Prop}
{l : List α}


theorem factorThru_add {X Y : C} {P : Subobject Y} (f g : X ⟶ Y) (w : P.Factors (f + g))
    (wf : P.Factors f) (wg : P.Factors g) :
    P.factorThru (f + g) w = P.factorThru f wf + P.factorThru g 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))
(wf : P.Factors f)
(wg : P.Factors g)


@[simp]
theorem Finset.card_univ [Fintype α] : (Finset.univ : Finset α).card = Fintype.card α


theorem card_comm_eq_card_conjClasses_mul_card (G : Type*) [Group G] :
    Nat.card { p : G × G // Commute p.1 p.2 } = Nat.card (ConjClasses G) * Nat.card G

Nat.card { p // Commute p.1 p.2 } = Nat.card (ConjClasses G) * Nat.card G


/-- A strong monomorphism `f` is a monomorphism which has the right lifting property
with respect to epimorphisms. -/
class StrongMono (f : P ⟶ Q) : Prop where
  /-- The monomorphism condition on `f` -/
  mono : Mono f
  /-- The right lifting property with respect to all epimorphisms -/
  rlp : ∀ ⦃X Y : C⦄ (z : X ⟶ Y) [Epi z], HasLiftingProperty z f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{P Q : C}
{f : P ⟶ Q}
[self : CategoryTheory.StrongMono f]


lemma oppositeShiftFunctorZero_hom_app (X : OppositeShift C A) :
    (shiftFunctorZero (OppositeShift C A) A).hom.app X =
      ((shiftFunctorZero C A).inv.app X.unop).op

(C : Type u_1)
[CategoryTheory.Category.{u_3, u_1} C]
(A : Type u_2)
[AddMonoid A]
[CategoryTheory.HasShift C A]
(X : CategoryTheory.OppositeShift C A)

(CategoryTheory.shiftFunctorZero (CategoryTheory.OppositeShift C A) A).hom.app X =
  ((CategoryTheory.shiftFunctorZero C A).inv.app (Opposite.unop X)).op


/-- The isomorphism between a cone on `F` and an element of the functor `F.cones`. -/
@[simps!]
def equiv (F : J ⥤ C) : Cone F ≅ ΣX, F.cones.obj X

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
(F : J ⥤ C)
(c : (X : Cᵒᵖ) × F.cones.obj X)

((CategoryTheory.Limits.Cone.equiv F).inv c).pt = Opposite.unop c.fst


theorem nat_lt_limit {o} (h : IsLimit o) : ∀ n : ℕ, ↑n < o

{o : Ordinal.{u_1}}
(h : o.IsLimit)
(n : ℕ)


theorem snd_of_isColimit {X Y : C} {t : BinaryBicone X Y} (ht : IsColimit t.toCocone) :
    t.snd = ht.desc (BinaryCofan.mk 0 (𝟙 Y))

{t : CategoryTheory.Limits.BinaryBicone X Y}

(ht : CategoryTheory.Limits.IsColimit t.toCocone)

t.snd = ht.desc (CategoryTheory.Limits.BinaryCofan.mk 0 (𝟙 Y))


@[simp]
theorem not_squarefree_zero [MonoidWithZero R] [Nontrivial R] : ¬Squarefree (0 : R)

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


@[simp, norm_cast]
theorem coe_one : ((1 : ℝ) : EReal) = 1


@[simp]
theorem tendsto_lift_nhdsWithin_mk {f : X → α} {hf : ∀ x y, (x ~ᵢ y) → f x = f y}
    {s : Set (SeparationQuotient X)} {l : Filter α} :
    Tendsto (lift f hf) (𝓝[s] mk x) l ↔ Tendsto f (𝓝[mk ⁻¹' s] x) l

{hf : ∀ (x y : X), (x ~ᵢ y) → f x = f y}

Filter.Tendsto (SeparationQuotient.lift f hf) (𝓝[s] SeparationQuotient.mk x) l ↔
  Filter.Tendsto f (𝓝[SeparationQuotient.mk ⁻¹' s] x) l


/-- If a function is monotone and is bounded on a set `s`, then it admits a monotone extension to
the whole space. -/
theorem MonotoneOn.exists_monotone_extension (h : MonotoneOn f s) (hl : BddBelow (f '' s))
    (hu : BddAbove (f '' s)) : ∃ g : α → β, Monotone g ∧ EqOn f g s

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[ConditionallyCompleteLinearOrder β]
{f : α → β}
{s : Set α}
(h : MonotoneOn f s)
(hl : BddBelow (f '' s))
(hu : BddAbove (f '' s))


@[to_additive]
theorem SMulCommClass.of_mclosure_eq_top {N α} [Monoid M] [SMul N α] [MulAction M α] {s : Set M}
    (htop : Submonoid.closure s = ⊤) (hs : ∀ x ∈ s, ∀ (y : N) (z : α), x • y • z = y • x • z) :
    SMulCommClass M N α


lemma _root_.MeasureTheory.AEMeasurable.identDistrib_mk
    (hf : AEMeasurable f μ) : IdentDistrib f (hf.mk f) μ μ

{α : Type u_1}
{γ : Type u_3}
[MeasurableSpace α]
[MeasurableSpace γ]
{μ : MeasureTheory.Measure α}
{f : α → γ}
(hf : AEMeasurable f μ)

ProbabilityTheory.IdentDistrib f (AEMeasurable.mk f hf) μ μ


/-- This can be used for rewriting if the LHS is inside a binder and whether `f = e` is unknown.-/
lemma Indep.insert_diff_indep_iff (hI : M.Indep (I \ {e})) (heI : e ∈ I) :
    M.Indep (insert f I \ {e}) ↔ f ∈ M.E \ M.closure (I \ {e}) ∨ f ∈ I

{α : Type u_2}
{M : Matroid α}
{e : α}
{I : Set α}
{f : α}
(hI : M.Indep (I \ {e}))
(heI : e ∈ I)


theorem curry_inj {c₁ c₂ n₁ n₂} (h : curry c₁ n₁ = curry c₂ n₂) : c₁ = c₂ ∧ n₁ = n₂

{c₁ c₂ : Nat.Partrec.Code}
{n₁ n₂ : ℕ}
(h : c₁.curry n₁ = c₂.curry n₂)


@[simp]
lemma mk'_app : (mk' app naturality).app = app

(app : (X : Cᵒᵖ) → ↑(P.obj X) →ₗ[↑(R.obj X)] ↑(Q.obj X))

(naturality : ∀ ⦃X Y : Cᵒᵖ⦄ (f : X ⟶ Y) (x : ↑(P.obj X)), (app Y) ((P.map f) x) = (Q.map f) ((app X) x))

PresheafOfModules.Hom.app (PresheafOfModules.Hom.mk' app naturality) = app


@[simp]
theorem finsuppTensorFinsupp'_single_tmul_single (a : ι) (b : κ) (r₁ r₂ : R) :
    finsuppTensorFinsupp' R ι κ (Finsupp.single a r₁ ⊗ₜ[R] Finsupp.single b r₂) =
      Finsupp.single (a, b) (r₁ * r₂)

(R : Type u_1)
(ι : Type u_5)
(κ : Type u_6)
[CommSemiring R]
(a : ι)
(b : κ)
(r₁ r₂ : R)

(finsuppTensorFinsupp' R ι κ) (Finsupp.single a r₁ ⊗ₜ[R] Finsupp.single b r₂) = Finsupp.single (a, b) (r₁ * r₂)


/-- Build an isomorphism in the category `Semigroup` from a `MulEquiv` between `Semigroup`s. -/
@[to_additive (attr := simps)
  "Build an isomorphism in the category
  `AddSemigroup` from an `AddEquiv` between `AddSemigroup`s."]
def MulEquiv.toSemigrpIso (e : X ≃* Y) : Semigrp.of X ≅ Semigrp.of Y

{X Y : Type u}
[AddSemigroup X]
[AddSemigroup Y]
(e : X ≃+ Y)

∀ (a : X), e.toAddSemigrpIso.hom a = e.toFun a


private lemma toAffine_add_of_Z_ne_zero {P Q : Fin 3 → F} (hP : W.Nonsingular P)
    (hQ : W.Nonsingular Q) (hPz : P z ≠ 0) (hQz : Q z ≠ 0)
    (hxy : P x * Q z ^ 2 = Q x * P z ^ 2 → P y * Q z ^ 3 ≠ W.negY Q * P z ^ 3) :
    toAffine W
      ![W.toAffine.addX (P x / P z ^ 2) (Q x / Q z ^ 2)
          (W.toAffine.slope (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3) (Q y / Q z ^ 3)),
        W.toAffine.addY (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3)
          (W.toAffine.slope (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3) (Q y / Q z ^ 3)),
        1] = toAffine W P + toAffine W Q

WeierstrassCurve.Jacobian.Point.toAffine W
    ![W.toAffine.addX (P x / P z ^ 2) (Q x / Q z ^ 2)
        (W.toAffine.slope (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3) (Q y / Q z ^ 3)),
      W.toAffine.addY (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3)
        (W.toAffine.slope (P x / P z ^ 2) (Q x / Q z ^ 2) (P y / P z ^ 3) (Q y / Q z ^ 3)),
      1] =
  WeierstrassCurve.Jacobian.Point.toAffine W P + WeierstrassCurve.Jacobian.Point.toAffine W Q


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

(j : MeasureTheory.JordanDecomposition α)


theorem edist_lt_mul_of_lt (h : LipschitzWith K f) (hK : K ≠ 0) (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)
(hK : K ≠ 0)
(hr : edist x y < r)


/-- `HasFiniteWidePullbacks` represents a choice of wide pullback
for every finite collection of morphisms
-/
class HasFiniteWidePullbacks : Prop where
  /-- `C` has all wide pullbacks any Fintype `J`-/
  out (J : Type) [Finite J] : HasLimitsOfShape (WidePullbackShape J) C

[self : CategoryTheory.Limits.HasFiniteWidePullbacks C]

CategoryTheory.Limits.HasLimitsOfShape (CategoryTheory.Limits.WidePullbackShape J) C


theorem Quotient.alg_map_eq (I : Ideal A) :
    algebraMap R₁ (A ⧸ I) = (algebraMap A (A ⧸ I)).comp (algebraMap R₁ A)

(R₁ : Type u_1)
{A : Type u_3}
[CommSemiring R₁]
[CommRing A]
[Algebra R₁ A]
(I : Ideal A)


@[simp]
theorem abs_exp_ofReal_mul_I (x : ℝ) : abs (exp (x * I)) = 1

Complex.abs (Complex.exp (↑x * Complex.I)) = 1


/-- A map from the vertex of a cocone induces a cocone by composition. -/
@[simps]
def extend (c : Cocone F) {Y : C} (f : c.pt ⟶ Y) : Cocone F

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


theorem eq_nil_of_sublist_nil {l : List α} (s : l <+ []) : l = []

{α : Type u}
{l : List α}
(s : l.Sublist [])


/-- A nonempty set is scaled by zero to the singleton set containing 0. -/
@[simp] theorem zero_smul_set {s : Set β} (h : s.Nonempty) : (0 : α) • s = (0 : Set β)

{α : Type u_2}
{β : Type u_3}
[Zero α]
[Zero β]
[SMulWithZero α β]
{s : Set β}
(h : s.Nonempty)


lemma mul_right_injective_of_inv (A : Matrix m n α) (B : Matrix n m α) (h : A * B = 1) :
    Function.Injective (fun x : Matrix m l α => B * x)

{l : Type u_1}
{m : Type u}
{n : Type u'}
{α : Type v}
[Fintype n]
[Fintype m]
[DecidableEq m]
[CommRing α]
(A : Matrix m n α)
(B : Matrix n m α)
(h : A * B = 1)


theorem IsIntegral.neg {x : B} (hx : IsIntegral R x) : IsIntegral R (-x)

{R : Type u_1}
{B : Type u_3}
[CommRing R]
[Ring B]
[Algebra R B]
{x : B}
(hx : IsIntegral R x)


theorem le_symmDiff_sup_right (a b : α) : a ≤ (a ∆ b) ⊔ b

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


theorem fg_of_isUnit {R A : Type*} [CommSemiring R] [Semiring A] [Algebra R A] {I : Submodule R A}
    (hI : IsUnit I) : I.FG

{R : Type u_3}
{A : Type u_4}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{I : Submodule R A}
(hI : IsUnit I)


lemma IsLimit.isIso_π_app_of_isInitial {F : J ⥤ C} {c : Cone F} (hc : IsLimit c)
    (X : J) (hX : IsInitial X) :
    IsIso (c.π.app X)

(hX : CategoryTheory.Limits.IsInitial X)


/-- A homology map data for a morphism of short complexes induces
a homology map data in the opposite category. -/
@[simps]
def op {φ : S₁ ⟶ S₂} {h₁ : S₁.HomologyData} {h₂ : S₂.HomologyData}
    (ψ : HomologyMapData φ h₁ h₂) :
    HomologyMapData (opMap φ) h₂.op h₁.op

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


@[simp]
theorem map₂_curry (f : α × β → γ) (a : Option α) (b : Option β) :
    map₂ (curry f) a b = Option.map f (map₂ Prod.mk a b)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α × β → γ)
(a : Option α)
(b : Option β)

Option.map₂ (Function.curry f) a b = Option.map f (Option.map₂ Prod.mk a b)


theorem cmp_swap (m n) : (cmp m n).swap = cmp n m


theorem birthday_add_zero : (a + 0).birthday = a.birthday


@[to_additive nsmul_pos_iff]
theorem one_lt_pow_iff {x : M} {n : ℕ} (hn : n ≠ 0) : 1 < x ^ n ↔ 1 < x

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


/-- A unit in a monoid is regular. -/
@[to_additive "An additive unit in an additive monoid is add-regular."]
theorem IsUnit.isRegular (ua : IsUnit a) : IsRegular a

{R : Type u_1}
[Monoid R]
{a : R}
(ua : IsUnit a)


theorem iIndepSets_singleton_iff {s : ι → Set Ω} {_mΩ : MeasurableSpace Ω}
    {κ : Kernel α Ω} {μ : Measure α} :
    iIndepSets (fun i ↦ {s i}) κ μ ↔
      ∀ S : Finset ι, ∀ᵐ a ∂μ, κ a (⋂ i ∈ S, s i) = ∏ i ∈ S, κ a (s i)

{α : Type u_1}
{Ω : Type u_2}
{ι : Type u_3}
{_mα : MeasurableSpace α}
{s : ι → Set Ω}
{_mΩ : MeasurableSpace Ω}
{κ : ProbabilityTheory.Kernel α Ω}
{μ : MeasureTheory.Measure α}

ProbabilityTheory.Kernel.iIndepSets (fun i => {s i}) κ μ ↔
  ∀ (S : Finset ι), ∀ᵐ (a : α) ∂μ, (κ a) (⋂ i ∈ S, s i) = ∏ i ∈ S, (κ a) (s i)


/-- Two multilinear maps indexed by a `Fintype` are equal if they are equal when all arguments
are basis vectors. Unlike `Basis.ext_multilinear_fin`, this only uses a single basis; a
dependently-typed version would still be true, but the proof would need a dependently-typed
version of `dom_dom_congr`. -/
theorem Basis.ext_multilinear [Finite ι] {f g : MultilinearMap R (fun _ : ι => M₂) M₃} {ι₁ : Type*}
    (e : Basis ι₁ R M₂) (h : ∀ v : ι → ι₁, (f fun i => e (v i)) = g fun i => e (v i)) : f = g

{f g : MultilinearMap R (fun x => M₂) M₃}

(h : ∀ (v : ι → ι₁), (f fun i => e (v i)) = g fun i => e (v i))


@[simp]
theorem get_zip (n : ℕ) (s₁ : Stream' α) (s₂ : Stream' β) :
    get (zip f s₁ s₂) n = f (get s₁ n) (get s₂ n)

{α : Type u}
{β : Type v}
{δ : Type w}
(f : α → β → δ)
(n : ℕ)
(s₁ : Stream' α)
(s₂ : Stream' β)

(Stream'.zip f s₁ s₂).get n = f (s₁.get n) (s₂.get n)


@[to_additive (attr := simp)]
theorem mem_sInf {S : Set (Subgroup G)} {x : G} : x ∈ sInf S ↔ ∀ p ∈ S, x ∈ p

{G : Type u_1}
[AddGroup G]
{S : Set (AddSubgroup G)}
{x : G}


theorem Sum.isPreconnected_iff [TopologicalSpace β] {s : Set (α ⊕ β)} :
    IsPreconnected s ↔
      (∃ t, IsPreconnected t ∧ s = Sum.inl '' t) ∨ ∃ t, IsPreconnected t ∧ s = Sum.inr '' t

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
{s : Set (α ⊕ β)}


theorem IsBigOWith.right_le_add_of_lt_one {f₁ f₂ : α → E'} (h : IsBigOWith c l f₁ f₂) (hc : c < 1) :
    IsBigOWith (1 / (1 - c)) l f₂ fun x => f₁ x + f₂ x

{α : Type u_1}
{E' : Type u_6}
[SeminormedAddCommGroup E']
{c : ℝ}
{l : Filter α}
{f₁ f₂ : α → E'}
(h : Asymptotics.IsBigOWith c l f₁ f₂)
(hc : c < 1)

Asymptotics.IsBigOWith (1 / (1 - c)) l f₂ fun x => f₁ x + f₂ x


protected theorem congr_arg (f : M [⋀^ι]→ₗ[R] N) {x y : ι → M} (h : x = y) : f x = f y

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_7}
(f : M [⋀^ι]→ₗ[R] N)
{x y : ι → M}
(h : x = y)


@[simp] theorem true_eq_false : (true = false) = False


/-- Construct a bundled monoid homomorphism `M₁ →* M₂` from a function `f` and a proof that it
belongs to the closure of the range of the coercion from `M₁ →* M₂` (or another type of bundled
homomorphisms that has a `MonoidHomClass` instance) to `M₁ → M₂`. -/
@[to_additive (attr := simps (config := .asFn))
  "Construct a bundled additive monoid homomorphism `M₁ →+ M₂` from a function `f`
and a proof that it belongs to the closure of the range of the coercion from `M₁ →+ M₂` (or another
type of bundled homomorphisms that has an `AddMonoidHomClass` instance) to `M₁ → M₂`."]
def monoidHomOfMemClosureRangeCoe (f : M₁ → M₂)
    (hf : f ∈ closure (range fun (f : F) (x : M₁) => f x)) : M₁ →* M₂

(hf : f ∈ closure (Set.range fun f x => f x))

⇑(monoidHomOfMemClosureRangeCoe f hf) = f


theorem mul_left_injective₀ (hb : b ≠ 0) : Function.Injective fun a => a * b

{M₀ : Type u_1}
[Mul M₀]
[Zero M₀]
[IsRightCancelMulZero M₀]
{b : M₀}
(hb : b ≠ 0)


/-- A function `f : ℂ → ℂ` which is analytic at a point `z₀` is either constant in a neighborhood
of `z₀`, or behaves locally like an open function (in the sense that the image of every neighborhood
of `z₀` is a neighborhood of `f z₀`, as in `isOpenMap_iff_nhds_le`). For a function `f : E → ℂ`
the same result holds, see `AnalyticAt.eventually_constant_or_nhds_le_map_nhds`. -/
theorem AnalyticAt.eventually_constant_or_nhds_le_map_nhds_aux (hf : AnalyticAt ℂ f z₀) :
    (∀ᶠ z in 𝓝 z₀, f z = f z₀) ∨ 𝓝 (f z₀) ≤ map f (𝓝 z₀)

{f : ℂ → ℂ}
{z₀ : ℂ}
(hf : AnalyticAt ℂ f z₀)

(∀ᶠ (z : ℂ) in 𝓝 z₀, f z = f z₀) ∨ 𝓝 (f z₀) ≤ Filter.map f (𝓝 z₀)


/--
Tensor product of `M` over a singleton set is equivalent to `M`
-/
@[simps symm_apply]
def subsingletonEquiv [Subsingleton ι] (i₀ : ι) : (⨂[R] _ : ι, M) ≃ₗ[R] M

{ι : Type u_1}
{R : Type u_4}
[CommSemiring R]
{M : Type u_8}
[AddCommMonoid M]
[Module R M]
[Subsingleton ι]
(i₀ : ι)
(m : M)

(PiTensorProduct.subsingletonEquiv i₀).symm m = (PiTensorProduct.tprod R) fun x => m


@[to_additive]
theorem isZero_of_subsingleton (G : CommGrp) [Subsingleton G] : IsZero G


/-- The ring equiv between the top element of `NonUnitalSubsemiring R` and `R`. -/
@[simps!]
def topEquiv : (⊤ : NonUnitalSubsemiring R) ≃+* R

{R : Type u}
[NonUnitalNonAssocSemiring R]
(x : ↥⊤)


lemma Polynomial.isCoprime_iff_aeval_ne_zero_of_isAlgClosed (K : Type v) [Field K] [IsAlgClosed K]
    [Algebra k K] (p q : k[X]) : IsCoprime p q ↔ ∀ a : K, aeval a p ≠ 0 ∨ aeval a q ≠ 0

(k : Type u)
[Field k]
(K : Type v)
[Field K]
[IsAlgClosed K]
[Algebra k K]
(p q : k[X])

IsCoprime p q ↔ ∀ (a : K), (Polynomial.aeval a) p ≠ 0 ∨ (Polynomial.aeval a) q ≠ 0


lemma MonoidHom.apply_mnat (f : Multiplicative ℕ →* α) (n : Multiplicative ℕ) :
    f n = f (Multiplicative.ofAdd 1) ^ (Multiplicative.toAdd n)

{α : Type u_1}
[Monoid α]
(f : Multiplicative ℕ →* α)
(n : Multiplicative ℕ)

f n = f (Multiplicative.ofAdd 1) ^ Multiplicative.toAdd n


@[simp]
theorem isCobounded_biInter_finset (s : Finset ι) {f : ι → Set α} :
    IsCobounded (⋂ i ∈ s, f i) ↔ ∀ i ∈ s, IsCobounded (f i)

{ι : Type u_1}
{α : Type u_2}
[Bornology α]
(s : Finset ι)
{f : ι → Set α}

Bornology.IsCobounded (⋂ i ∈ s, f i) ↔ ∀ i ∈ s, Bornology.IsCobounded (f i)


@[simp]
theorem elim0_append {α : Type*} (v : Fin n → α) :
    append Fin.elim0 v = v ∘ Fin.cast (Nat.zero_add _)


/-- Given two compact sets in a noncompact topological group, there is a translate of the second
one that is disjoint from the first one. -/
@[to_additive
  "Given two compact sets in a noncompact additive topological group, there is a
  translate of the second one that is disjoint from the first one."]
theorem exists_disjoint_smul_of_isCompact [NoncompactSpace G] {K L : Set G} (hK : IsCompact K)
    (hL : IsCompact L) : ∃ g : G, Disjoint K (g • L)

{G : Type w}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
[NoncompactSpace G]
{K L : Set G}
(hK : IsCompact K)
(hL : IsCompact L)


theorem charFn_eq_zero [Nontrivial Y] (x : X) (hU : IsClopen U) : charFn Y hU x = (0 : Y) ↔ x ∉ U

{X : Type u_1}
(Y : Type u_2)
[TopologicalSpace X]
[MulZeroOneClass Y]
{U : Set X}
[Nontrivial Y]
(x : X)
(hU : IsClopen U)

(LocallyConstant.charFn Y hU) x = 0 ↔ x ∉ U


@[norm_cast]
lemma cast_divInt_of_ne_zero (a : ℤ) {b : ℤ} (b0 : (b : α) ≠ 0) : (a /. b : α) = a / b

{α : Type u_3}
[DivisionRing α]
(a : ℤ)
{b : ℤ}
(b0 : ↑b ≠ 0)


/-- The product of cycle factors is equal to the original `f : perm α`. -/
theorem cycleFactorsFinset_noncommProd
    (comm : (cycleFactorsFinset f : Set (Perm α)).Pairwise Commute :=
      cycleFactorsFinset_mem_commute f) :
    f.cycleFactorsFinset.noncommProd id comm = f

(comm : (↑f.cycleFactorsFinset).Pairwise Commute := ⋯)


theorem rotation_injective : Function.Injective rotation


@[simp]
theorem ceil_one : ⌈(1 : α)⌉ = 1

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]


lemma Odd.sub_even (ha : Odd a) (hb : Even b) : Odd (a - b)

{α : Type u_2}
[Ring α]
{a b : α}
(ha : Odd a)
(hb : Even b)


theorem set_pi_mem_nhds_iff {I : Set ι} (hI : I.Finite) {s : ∀ i, Set (π i)} (a : ∀ i, π i) :
    I.pi s ∈ 𝓝 a ↔ ∀ i : ι, i ∈ I → s i ∈ 𝓝 (a i)

{ι : Type u_5}
{π : ι → Type u_6}
[T : (i : ι) → TopologicalSpace (π i)]
{I : Set ι}
(hI : I.Finite)
{s : (i : ι) → Set (π i)}
(a : (i : ι) → π i)


theorem small_of_surjective {α : Type v} {β : Type w} [Small.{u} α] {f : α → β}
    (hf : Function.Surjective f) : Small.{u} β

{α : Type v}
{β : Type w}
[Small.{u, v} α]
{f : α → β}
(hf : Function.Surjective f)


@[simp]
theorem sub_linear (f g : P1 →ᵃ[k] V2) : (f - g).linear = f.linear - g.linear

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
{V2 : Type u_4}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
[AddCommGroup V2]
[Module k V2]
(f g : P1 →ᵃ[k] V2)


@[simp]
theorem idealFactorsFunOfQuotHom_id :
    idealFactorsFunOfQuotHom (RingHom.id (A ⧸ J)).surjective = OrderHom.id

{A : Type u_2}
[CommRing A]
[IsDedekindDomain A]
{J : Ideal A}

idealFactorsFunOfQuotHom ⋯ = OrderHom.id


theorem coe_lpBCFₗᵢ (f : lp (fun _ : α ↦ E) ∞) : (lpBCFₗᵢ E 𝕜 f : α → E) = f

{α : Type u_1}
{E : Type u_2}
{𝕜 : Type u_5}
[TopologicalSpace α]
[DiscreteTopology α]
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
(f : ↥(lp (fun x => E) ⊤))


@[to_additive]
theorem comp_noncommCoprod {Q : Type*} [Monoid Q] (h : P →* Q) :
    h.comp (f.noncommCoprod g comm) =
      (h.comp f).noncommCoprod (h.comp g) (fun m n ↦ (comm m n).map h)

(comm : ∀ (m : M) (n : N), Commute (f m) (g n))

h.comp (f.noncommCoprod g comm) = (h.comp f).noncommCoprod (h.comp g) ⋯


theorem mem_enum_iff_get? {x : ℕ × α} {l : List α} : x ∈ enum l ↔ l.get? x.1 = x.2


theorem comap_apply {β} [MeasurableSpace α] {_mβ : MeasurableSpace β} (f : α → β)
    (hfi : Injective f) (hf : ∀ s, MeasurableSet s → MeasurableSet (f '' s)) (μ : Measure β)
    (hs : MeasurableSet s) : comap f μ s = μ (f '' s)

(hf : ∀ (s : Set α), MeasurableSet s → MeasurableSet (f '' s))

(MeasureTheory.Measure.comap f μ) s = μ (f '' s)


theorem mono_of_cancel_zero {Q R : C} (f : Q ⟶ R) (h : ∀ {P : C} (g : P ⟶ Q), g ≫ f = 0 → g = 0) :
    Mono f


theorem frobenius_pthRoot : (frobenius _ p).comp (pthRoot R p) = RingHom.id _

{R : Type u₁}
[CommSemiring R]
{p : ℕ}
[hp : Fact (Nat.Prime p)]
[CharP R p]

(frobenius (Ring.Perfection R p) p).comp (Perfection.pthRoot R p) = RingHom.id (Ring.Perfection R p)


lemma measurableSet_countablePartition (n : ℕ) {s : Set α} (hs : s ∈ countablePartition α n) :
    MeasurableSet s

[h : MeasurableSpace.CountablyGenerated α]

(hs : s ∈ MeasurableSpace.countablePartition α n)


@[to_additive (attr := measurability)]
protected theorem const_smul {𝕜} [SMul 𝕜 β] [ContinuousConstSMul 𝕜 β] (hf : StronglyMeasurable f)
    (c : 𝕜) : StronglyMeasurable (c • f)

(hf : MeasureTheory.StronglyMeasurable f)

MeasureTheory.StronglyMeasurable (c • f)


@[to_additive]
theorem mulSupport_update_one [DecidableEq α] (f : α → M) (x : α) :
    mulSupport (update f x 1) = mulSupport f \ {x}

{α : Type u_1}
{M : Type u_5}
[Zero M]
[DecidableEq α]
(f : α → M)
(x : α)

Function.support (Function.update f x 0) = Function.support f \ {x}


@[simp]
theorem alternatingFaceMapComplex_obj_d (X : SimplicialObject C) (n : ℕ) :
    ((alternatingFaceMapComplex C).obj X).d (n + 1) n = AlternatingFaceMapComplex.objD X n

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

((AlgebraicTopology.alternatingFaceMapComplex C).obj X).d (n + 1) n =
  AlgebraicTopology.AlternatingFaceMapComplex.objD X n


theorem toIcoDiv_eq_sub (a b : α) : toIcoDiv hp a b = toIcoDiv hp 0 (b - a)

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


lemma toSpec_preimage_basicOpen {f} (z : HomogeneousLocalization.NumDenSameDeg 𝒜 (.powers f)) :
    toSpec 𝒜 f ⁻¹' (sbo (HomogeneousLocalization.mk z) : Set (PrimeSpectrum (A⁰_ f))) =
      Subtype.val ⁻¹' (pbo z.num.1 : Set (ProjectiveSpectrum 𝒜))

(z : HomogeneousLocalization.NumDenSameDeg 𝒜 (Submonoid.powers f))

⇑(AlgebraicGeometry.ProjIsoSpecTopComponent.toSpec 𝒜 f) ⁻¹' ↑(PrimeSpectrum.basicOpen (HomogeneousLocalization.mk z)) =
  Subtype.val ⁻¹' ↑(ProjectiveSpectrum.basicOpen 𝒜 ↑z.num)


theorem HasMFDerivWithinAt.mfderivWithin (h : HasMFDerivWithinAt I I' f s x f')
    (hxs : UniqueMDiffWithinAt I s x) : mfderivWithin I I' f s x = f'

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


protected theorem pathStar_bijective (hφ : φ.IsCovering) (u : U) : Bijective (φ.pathStar u)

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


theorem algHom_bijective₂ [Field R] [Algebra K R]
    [Algebra.IsAlgebraic K L] (f : L →ₐ[K] R) (g : R →ₐ[K] L) :
    Function.Bijective f ∧ Function.Bijective g

{K : Type u_1}
{L : Type u_2}
{R : Type u_3}
[CommRing K]
[Field L]
[Algebra K L]
[NoZeroSMulDivisors K L]
[Field R]
[Algebra K R]
[Algebra.IsAlgebraic K L]
(f : L →ₐ[K] R)
(g : R →ₐ[K] L)

Function.Bijective ⇑f ∧ Function.Bijective ⇑g


theorem exists_pos_measure_of_not_restrict_le_zero (hi : ¬v ≤[i] 0) :
    ∃ j : Set α, MeasurableSet j ∧ j ⊆ i ∧ 0 < v j

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


theorem unop_snd {X Y Z : Cᵒᵖ} {f : X ⟶ Y} {g : X ⟶ Z} (c : PushoutCocone f g) :
    c.unop.snd = c.inr.unop

(c : CategoryTheory.Limits.PushoutCocone f g)


@[simp]
theorem coe_mk (e h₁ h₂) : ⇑(⟨e, h₁, h₂⟩ : A ≃⋆ₐ[R] B) = e

(h₁ : ∀ (a : A), e.toFun (star a) = star (e.toFun a))

(h₂ : ∀ (r : R) (a : A), e.toFun (r • a) = r • e.toFun a)

⇑{ toRingEquiv := e, map_star' := h₁, map_smul' := h₂ } = ⇑e


theorem mk'_eq_of_eq {a₁ b₁ : R} {a₂ b₂ : M} (H : ↑a₂ * b₁ = ↑b₂ * a₁) :
    mk' S a₁ a₂ = mk' S b₁ b₂

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
{a₁ b₁ : R}
{a₂ b₂ : ↥M}
(H : ↑a₂ * b₁ = ↑b₂ * a₁)

IsLocalization.mk' S a₁ a₂ = IsLocalization.mk' S b₁ b₂


/-- The condition that the image of the map `e.f` of an embedding of
complex shapes `e : Embedding c c'` is stable by `c'.prev`. -/
class IsTruncLE extends e.IsRelIff : Prop where
  mem_prev {i' : ι'} {j : ι} (h : c'.Rel i' (e.f j)) :
    ∃ i, e.f i = i'

{ι : Type u_1}
{ι' : Type u_2}
{c : ComplexShape ι}
{c' : ComplexShape ι'}
{e : c.Embedding c'}
[self : e.IsTruncLE]
{i' : ι'}
{j : ι}
(h : c'.Rel i' (e.f j))


theorem hasDerivWithinAt_taylor_coeff_within {f : ℝ → E} {x y : ℝ} {k : ℕ} {s t : Set ℝ}
    (ht : UniqueDiffWithinAt ℝ t y) (hs : s ∈ 𝓝[t] y)
    (hf : DifferentiableWithinAt ℝ (iteratedDerivWithin (k + 1) f s) s y) :
    HasDerivWithinAt
      (fun z => (((k + 1 : ℝ) * k !)⁻¹ * (x - z) ^ (k + 1)) • iteratedDerivWithin (k + 1) f s z)
      ((((k + 1 : ℝ) * k !)⁻¹ * (x - y) ^ (k + 1)) • iteratedDerivWithin (k + 2) f s y -
        ((k ! : ℝ)⁻¹ * (x - y) ^ k) • iteratedDerivWithin (k + 1) f s y) t y

HasDerivWithinAt (fun z => (((↑k + 1) * ↑k !)⁻¹ * (x - z) ^ (k + 1)) • iteratedDerivWithin (k + 1) f s z)
  ((((↑k + 1) * ↑k !)⁻¹ * (x - y) ^ (k + 1)) • iteratedDerivWithin (k + 2) f s y -
    ((↑k !)⁻¹ * (x - y) ^ k) • iteratedDerivWithin (k + 1) f s y)
  t y


@[simp]
theorem optionSubtype_symm_apply_apply_none
    [DecidableEq β]
    (x : β)
    (e : α ≃ { y : β // y ≠ x }) : ((optionSubtype x).symm e : Option α ≃ β) none = x

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
(x : β)
(e : α ≃ { y // y ≠ x })

↑((Equiv.optionSubtype x).symm e) none = x


theorem div_rpow_of_nonneg (x y : ℝ≥0∞) {z : ℝ} (hz : 0 ≤ z) : (x / y) ^ z = x ^ z / y ^ z


/-- The minimal distance is always nonnegative -/
theorem infDist_nonneg : 0 ≤ infDist x s

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


theorem mapRange_neLocus_eq [DecidableEq N] [DecidableEq M] [Zero M] [Zero N] (f g : α →₀ N)
    {F : N → M} (F0 : F 0 = 0) (hF : Function.Injective F) :
    (f.mapRange F F0).neLocus (g.mapRange F F0) = f.neLocus g

{α : Type u_1}
{M : Type u_2}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[DecidableEq M]
[Zero M]
[Zero N]
(f g : α →₀ N)
{F : N → M}
(F0 : F 0 = 0)
(hF : Function.Injective F)

(Finsupp.mapRange F F0 f).neLocus (Finsupp.mapRange F F0 g) = f.neLocus g


@[simp]
theorem conjTranspose_inv_intCast_smul [DivisionRing R] [AddCommGroup α] [StarAddMonoid α]
    [Module R α] (c : ℤ) (M : Matrix m n α) : ((c : R)⁻¹ • M)ᴴ = (c : R)⁻¹ • Mᴴ

{m : Type u_2}
{n : Type u_3}
{R : Type u_7}
{α : Type v}
[DivisionRing R]
[AddCommGroup α]
[StarAddMonoid α]
[Module R α]
(c : ℤ)
(M : Matrix m n α)


@[simp]
theorem interior_setOf_re_le (a : ℝ) : interior { z : ℂ | z.re ≤ a } = { z | z.re < a }

interior {z | z.re ≤ a} = {z | z.re < a}


/-- Given a splitting of a short complex `S`, this shows that `S.g` is a split epimorphism. -/
@[simps] def splitEpi_g (s : S.Splitting) : SplitEpi S.g

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


@[to_additive]
lemma orbit_submonoid_subset (S : Submonoid M) (a : α) : orbit S a ⊆ orbit M a

{M : Type u}
[Monoid M]
{α : Type v}
[MulAction M α]
(S : Submonoid M)
(a : α)

MulAction.orbit (↥S) a ⊆ MulAction.orbit M a


theorem isBounded_range_of_tendsto_cofinite_uniformity {f : β → α}
    (hf : Tendsto (Prod.map f f) (.cofinite ×ˢ .cofinite) (𝓤 α)) : IsBounded (range f)

(hf : Filter.Tendsto (Prod.map f f) (Filter.cofinite ×ˢ Filter.cofinite) (𝓤 α))


/-- The two paths coercion can take to a `RingHom` are equivalent -/
theorem coe_ringHom_commutes : ((e : A₁ →ₐ[R] A₂) : A₁ →+* A₂) = ((e : A₁ ≃+* A₂) : A₁ →+* A₂)

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


@[simp]
theorem nextOr_singleton (x y d : α) : nextOr [y] x d = d

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


@[to_additive]
lemma orbitRel.Quotient.mem_subgroup_orbit_iff' {H : Subgroup G} {x : orbitRel.Quotient G α}
    {a b : x.orbit} {c : α} (h : (⟦a⟧ : orbitRel.Quotient H x.orbit) = ⟦b⟧) :
    (a : α) ∈ MulAction.orbit H c ↔ (b : α) ∈ MulAction.orbit H c

{G : Type u_1}
{α : Type u_2}
[AddGroup G]
[AddAction G α]
{H : AddSubgroup G}
{x : AddAction.orbitRel.Quotient G α}
{a b : ↑x.orbit}
{c : α}
(h : ⟦a⟧ = ⟦b⟧)

↑a ∈ AddAction.orbit (↥H) c ↔ ↑b ∈ AddAction.orbit (↥H) c


@[simp] theorem permCongr_apply (p : Equiv.Perm α') (x) : e.permCongr p x = e (p (e.symm x))

{α' : Type u_1}
{β' : Type u_2}
(e : α' ≃ β')
(p : Equiv.Perm α')
(x : β')


@[simp]
theorem apply_inv_self (e : r ≃r r) (x) : e (e⁻¹ x) = x

{α : Type u_1}
{r : α → α → Prop}
(e : r ≃r r)
(x : α)


theorem toNat_of_nonpos : ∀ {z : ℤ}, z ≤ 0 → z.toNat = 0


theorem skolem₁_reduct_isElementary (S : (L.sum L.skolem₁).Substructure M) :
    (LHom.sumInl.substructureReduct S).IsElementary

{L : FirstOrder.Language}
{M : Type w}
[Nonempty M]
[L.Structure M]
(S : (L.sum L.skolem₁).Substructure M)


theorem foldl_eq (f : α → Char → α) (s a) : foldl f a s = s.1.foldl f a

{α : Type u_1}
(f : α → Char → α)
(s : String)
(a : α)

String.foldl f a s = List.foldl f a s.data


theorem contMDiffWithinAt_pi_space :
    ContMDiffWithinAt I 𝓘(𝕜, ∀ i, Fi i) n φ s x ↔
      ∀ i, ContMDiffWithinAt I 𝓘(𝕜, Fi i) n (fun x => φ x i) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{s : Set M}
{x : M}
{n : ℕ∞}
{ι : Type u_21}
[Fintype ι]
{Fi : ι → Type u_22}
[(i : ι) → NormedAddCommGroup (Fi i)]
[(i : ι) → NormedSpace 𝕜 (Fi i)]
{φ : M → (i : ι) → Fi i}

ContMDiffWithinAt I 𝓘(𝕜, (i : ι) → Fi i) n φ s x ↔ ∀ (i : ι), ContMDiffWithinAt I 𝓘(𝕜, Fi i) n (fun x => φ x i) s x


private lemma ofTensorProduct_comp_ofTensorProductInvOfPiFintype :
    ofTensorProduct I (ι → R) ∘ₗ ofTensorProductInvOfPiFintype I ι = LinearMap.id

{R : Type u_1}
[CommRing R]
(I : Ideal R)
(ι : Type u_4)
[Fintype ι]
[DecidableEq ι]

AdicCompletion.ofTensorProduct I (ι → R) ∘ₗ ↑(AdicCompletion.ofTensorProductInvOfPiFintype I ι) = LinearMap.id


theorem nonempty_iff (h : M ≅[L] N) : Nonempty M ↔ Nonempty N

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


@[to_additive exists_le_of_sum_le]
lemma exists_le_of_prod_le' [LinearOrder M] [CovariantClass M M (· * ·) (· < ·)]
    [CovariantClass M M (· * ·) (· ≤ ·)] [CovariantClass M M (Function.swap (· * ·)) (· < ·)]
    [CovariantClass M M (Function.swap (· * ·)) (· ≤ ·)] {l : List ι} (hl : l ≠ []) (f g : ι → M)
    (h : (l.map f).prod ≤ (l.map g).prod) : ∃ x ∈ l, f x ≤ g x

[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]

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

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

(h : (List.map f l).sum ≤ (List.map g l).sum)


@[to_additive]
lemma mul_prod_Ioi_eq_prod_Ici (a : α) : f a * ∏ x ∈ Ioi a, f x = ∏ x ∈ Ici a, f x

{α : Type u_1}
{M : Type u_2}
[PartialOrder α]
[CommMonoid M]
{f : α → M}
[LocallyFiniteOrderTop α]
(a : α)

f a * ∏ x ∈ Finset.Ioi a, f x = ∏ x ∈ Finset.Ici a, f x


private theorem mod_two_pow_add_mod_two_pow_add_bool_lt_two_pow_succ
     (x y i : Nat) (c : Bool) : x % 2^i + (y % 2^i + c.toNat) < 2^(i+1)


theorem zero_rpow_nonneg (x : ℝ) : 0 ≤ (0 : ℝ) ^ x


theorem surjOn_iInter_iInter [Nonempty ι] {s : ι → Set α} {t : ι → Set β} {f : α → β}
    (H : ∀ i, SurjOn f (s i) (t i)) (Hinj : InjOn f (⋃ i, s i)) : SurjOn f (⋂ i, s i) (⋂ i, t i)

(H : ∀ (i : ι), Set.SurjOn f (s i) (t i))


/-- The Monge point lies in the Monge planes. -/
theorem mongePoint_mem_mongePlane {n : ℕ} (s : Simplex ℝ P (n + 2)) {i₁ i₂ : Fin (n + 3)} :
    s.mongePoint ∈ s.mongePlane i₁ i₂

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{n : ℕ}
(s : Affine.Simplex ℝ P (n + 2))
{i₁ i₂ : Fin (n + 3)}


/-- A characterization lemma for the multiplication on the Ore localization, allowing for a choice
of Ore numerator and Ore denominator. -/
@[to_additive "A characterization lemma for the addition on the Ore localization,
allowing for a choice of Ore minuend and Ore subtrahend."]
theorem oreDiv_mul_char (r₁ r₂ : R) (s₁ s₂ : S) (r' : R) (s' : S) (huv : s' * r₁ = r' * s₂) :
    r₁ /ₒ s₁ * (r₂ /ₒ s₂) = r' * r₂ /ₒ (s' * s₁)

{R : Type u_1}
[AddMonoid R]
{S : AddSubmonoid R}
[AddOreLocalization.AddOreSet S]
(r₁ r₂ : R)
(s₁ s₂ : ↥S)
(r' : R)
(s' : ↥S)
(huv : ↑s' + r₁ = r' + ↑s₂)

r₁ -ₒ s₁ + (r₂ -ₒ s₂) = r' + r₂ -ₒ (s' + s₁)


@[simp] lemma ker_top : ker (⊤ : Filter α) = univ


theorem eq_top_mono (h : a ≤ b) (h₂ : a = ⊤) : b = ⊤

{α : Type u}
[PartialOrder α]
[OrderTop α]
{a b : α}
(h : a ≤ b)
(h₂ : a = ⊤)


theorem exists_associated_prime_pow_of_unique_normalized_factor {p r : α}
    (h : ∀ {m}, m ∈ normalizedFactors r → m = p) (hr : r ≠ 0) : ∃ i : ℕ, Associated (p ^ i) r

(h : ∀ {m : α}, m ∈ UniqueFactorizationMonoid.normalizedFactors r → m = p)


/-- The identity transformation induces the identity endofunctor on the category of coalgebras. -/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransId : functorOfNatTrans (𝟙 F) ≅ 𝟭 _

(X : CategoryTheory.Endofunctor.Coalgebra F)

(CategoryTheory.Endofunctor.Coalgebra.functorOfNatTransId.inv.app X).f = CategoryTheory.CategoryStruct.id X.V


@[to_additive]
theorem mulAntidiagonal_mono_left (h : u ⊆ s) : mulAntidiagonal hu ht a ⊆ mulAntidiagonal hs ht a

{α : Type u_1}
[OrderedCancelAddCommMonoid α]
{s t : Set α}
{hs : s.IsPWO}
{ht : t.IsPWO}
{a : α}
{u : Set α}
{hu : u.IsPWO}
(h : u ⊆ s)

Finset.addAntidiagonal hu ht a ⊆ Finset.addAntidiagonal hs ht a


theorem le_mk_of_forall_le {f : CauSeq ℚ abs} : (∃ i, ∀ j ≥ i, x ≤ f j) → x ≤ mk f

(∃ i, ∀ j ≥ i, x ≤ ↑(↑f j)) → x ≤ Real.mk f


/-- The unit of a adjunction can be upgraded to a monoidal natural transformation. -/
@[simps]
def monoidalCounit :
    (monoidalAdjoint F h) ⊗⋙ F.toLaxMonoidalFunctor ⟶ LaxMonoidalFunctor.id D

(F : CategoryTheory.MonoidalFunctor C D)

(CategoryTheory.monoidalCounit F h).toNatTrans = h.counit


theorem hnot_hnot_sdiff_distrib (a b : α) : ￢￢(a \ b) = ￢￢a \ ￢￢b

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


@[simp]
theorem trim_top : (⊤ : OuterMeasure α).trim = ⊤


@[to_additive]
theorem _root_.measurableEmbedding_mulLeft (g : G) : MeasurableEmbedding (g * ·)

{G : Type u_1}
[MeasurableSpace G]
[Group G]
[MeasurableMul G]
(g : G)


@[simp] theorem reverse_eq_nil_iff {xs : List α} : xs.reverse = [] ↔ xs = []


@[simp]
theorem deriv_sin (hc : DifferentiableAt ℝ f x) :
    deriv (fun x => Real.sin (f x)) x = Real.cos (f x) * deriv f x

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


@[elab_as_elim]
theorem induction_on [Nonempty ι] [IsDirected ι (· ≤ ·)] {C : DirectLimit G f → Prop}
    (z : DirectLimit G f) (ih : ∀ i x, C (of G f i x)) : C z

(ih : ∀ (i : ι) (x : G i), C ((Ring.DirectLimit.of G f i) x))


theorem toList_map (f : α → β) (xs : t α) : toList (f <$> xs) = f <$> toList xs

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

Traversable.toList (f <$> xs) = f <$> Traversable.toList xs


theorem forget₂_obj_moduleCat_of (X : Type v) [AddCommGroup X] [Module R X] :
    (forget₂ (ModuleCat R) AddCommGrp).obj (of R X) = AddCommGrp.of X

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

(CategoryTheory.forget₂ (ModuleCat R) AddCommGrp).obj (ModuleCat.of R X) = AddCommGrp.of X


@[to_additive]
theorem disjoint_def {p₁ p₂ : Submonoid M} :
    Disjoint p₁ p₂ ↔ ∀ {x : M}, x ∈ p₁ → x ∈ p₂ → x = 1

{M : Type u_1}
[MulOneClass M]
{p₁ p₂ : Submonoid M}


@[to_additive (attr := simp)]
theorem topEquiv_toMonoidHom : ((topEquiv : _ ≃* M) : _ →* M) = (⊤ : Submonoid M).subtype


theorem disj_sum_strictMono_right (s : Finset α) :
    StrictMono (s.disjSum : Finset β → Finset (α ⊕ β))

{α : Type u_1}
{β : Type u_2}
(s : Finset α)


/-- Weighted generalized mean inequality, version sums over finite sets, with `ℝ≥0`-valued
functions and natural exponent. -/
theorem pow_arith_mean_le_arith_mean_pow (w z : ι → ℝ≥0) (hw' : ∑ i ∈ s, w i = 1) (n : ℕ) :
    (∑ i ∈ s, w i * z i) ^ n ≤ ∑ i ∈ s, w i * z i ^ n

{ι : Type u}
(s : Finset ι)
(w z : ι → ℝ≥0)
(hw' : ∑ i ∈ s, w i = 1)
(n : ℕ)


@[simp] lemma toFinset_Ioo (a b : α) [Fintype (Ioo a b)] : (Ioo a b).toFinset = Finset.Ioo a b

{α : Type u_3}
[Preorder α]
[LocallyFiniteOrder α]
(a b : α)
[Fintype ↑(Set.Ioo a b)]


/-- If the sign of the angle between three points is positive, the last two points are not
equal. -/
theorem right_ne_of_oangle_sign_eq_one {p₁ p₂ p₃ : P} (h : (∡ p₁ p₂ p₃).sign = 1) : p₃ ≠ p₂

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


theorem IsMinOn.sup (hf : IsMinOn f s a) (hg : IsMinOn g s a) : IsMinOn (fun x => f x ⊔ g x) s a

{α : Type u}
{β : Type v}
[SemilatticeSup β]
{f g : α → β}
{a : α}
{s : Set α}
(hf : IsMinOn f s a)
(hg : IsMinOn g s a)


theorem coprime_multiset_prod_left_iff {m : Multiset ℕ} {k : ℕ} :
    Coprime m.prod k ↔ ∀ n ∈ m, Coprime n k


/-- The closed thickening `Metric.cthickening δ₁ E` is contained in the open thickening
`Metric.thickening δ₂ E` if the radius of the latter is positive and larger. -/
theorem cthickening_subset_thickening' {δ₁ δ₂ : ℝ} (δ₂_pos : 0 < δ₂) (hlt : δ₁ < δ₂) (E : Set α) :
    cthickening δ₁ E ⊆ thickening δ₂ E

{α : Type u}
[PseudoEMetricSpace α]
{δ₁ δ₂ : ℝ}
(δ₂_pos : 0 < δ₂)
(hlt : δ₁ < δ₂)
(E : Set α)

Metric.cthickening δ₁ E ⊆ Metric.thickening δ₂ E


private theorem slash_one (k : ℤ) (f : ℍ → ℂ) : f ∣[k]1 = f


theorem UniqueDiffWithinAt.mono (h : UniqueDiffWithinAt 𝕜 s x) (st : s ⊆ t) :
    UniqueDiffWithinAt 𝕜 t x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{s t : Set E}
(h : UniqueDiffWithinAt 𝕜 s x)
(st : s ⊆ t)


theorem tendsto_neg_const_mul_pow_atTop {c : α} {n : ℕ} (hn : n ≠ 0) (hc : c < 0) :
    Tendsto (fun x => c * x ^ n) atTop atBot

{α : Type u_3}
[LinearOrderedField α]
{c : α}
{n : ℕ}
(hn : n ≠ 0)
(hc : c < 0)

Filter.Tendsto (fun x => c * x ^ n) Filter.atTop Filter.atBot


theorem pow_dvd_pow_iff {a b n : ℕ} (n0 : n ≠ 0) : a ^ n ∣ b ^ n ↔ a ∣ b


lemma guitartExact_iff_final :
    w.GuitartExact ↔ ∀ (X₃ : C₃), (w.costructuredArrowRightwards X₃).Final

{C₁ : Type u₁}
{C₂ : Type u₂}
{C₃ : Type u₃}
{C₄ : Type u₄}
[CategoryTheory.Category.{v₁, u₁} C₁]
[CategoryTheory.Category.{v₂, u₂} C₂]
[CategoryTheory.Category.{v₃, u₃} C₃]
[CategoryTheory.Category.{v₄, u₄} C₄]
{T : CategoryTheory.Functor C₁ C₂}
{L : CategoryTheory.Functor C₁ C₃}
{R : CategoryTheory.Functor C₂ C₄}
{B : CategoryTheory.Functor C₃ C₄}
(w : CategoryTheory.TwoSquare T L R B)


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

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{x : E}
{s : Set E}
(hf : DifferentiableWithinAt ℝ f s x)
(hx : f x ≠ 0)

DifferentiableWithinAt ℝ (fun x => Real.log (f x)) s x


theorem exists_isClopen_lower_of_not_le (h : ¬x ≤ y) :
    ∃ U : Set α, IsClopen U ∧ IsLowerSet U ∧ x ∉ U ∧ y ∈ U

{α : Type u_1}
[TopologicalSpace α]
[Preorder α]
[PriestleySpace α]
{x y : α}
(h : ¬x ≤ y)

∃ U, IsClopen U ∧ IsLowerSet U ∧ x ∉ U ∧ y ∈ U


/-- The natural isomorphism between taking preimages under `f ≫ g`, and the composite
of taking preimages under `g`, then preimages under `f`.
-/
@[simps]
def mapComp (f : X ⟶ Y) (g : Y ⟶ Z) : map (f ≫ g) ≅ map g ⋙ map f

{X Y Z : TopCat}
(f : X ⟶ Y)
(g : Y ⟶ Z)
(U : TopologicalSpace.Opens ↑Z)

(TopologicalSpace.Opens.mapComp f g).hom.app U = CategoryTheory.eqToHom ⋯


/-- Rotating the second vector by `θ` adds `θ` to the angle between two vectors. -/
@[simp]
theorem oangle_rotation_right {x y : V} (hx : x ≠ 0) (hy : y ≠ 0) (θ : Real.Angle) :
    o.oangle x (o.rotation θ y) = o.oangle x y + θ

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

o.oangle x ((o.rotation θ) y) = o.oangle x y + θ


/-- Two lists of sublists are equal iff their joins coincide, as well as the lengths of the
sublists. -/
theorem eq_iff_join_eq (L L' : List (List α)) :
    L = L' ↔ L.join = L'.join ∧ map length L = map length L'

L = L' ↔ L.join = L'.join ∧ List.map List.length L = List.map List.length L'


@[simp]
theorem supDegree_neg {f : R'[A]} :
    (-f).supDegree D = f.supDegree D

{R' : Type u_2}
{A : Type u_3}
{B : Type u_5}
[Ring R']
[AddZeroClass A]
[SemilatticeSup B]
[OrderBot B]
{D : A → B}
{f : AddMonoidAlgebra R' A}

AddMonoidAlgebra.supDegree D (-f) = AddMonoidAlgebra.supDegree D f


theorem uniformIntegrable_zero_meas [MeasurableSpace α] : UniformIntegrable f p (0 : Measure α)

{α : Type u_1}
{β : Type u_2}
{ι : Type u_3}
[NormedAddCommGroup β]
{p : ℝ≥0∞}
{f : ι → α → β}
[MeasurableSpace α]


@[simp]
theorem neg_comp (f : M →ₛₗ[σ₁₂] M₂) (g : M₂ →ₛₗ[σ₂₃] N₃) : (-g).comp f = -g.comp f

{R₁ : Type u_2}
{R₂ : Type u_3}
{R₃ : Type u_4}
{M : Type u_9}
{M₂ : Type u_11}
{N₃ : Type u_15}
[Semiring R₁]
[Semiring R₂]
[Semiring R₃]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommGroup N₃]
[Module R₁ M]
[Module R₂ M₂]
[Module R₃ N₃]
{σ₁₂ : R₁ →+* R₂}
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R₁ →+* R₃}
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
(f : M →ₛₗ[σ₁₂] M₂)
(g : M₂ →ₛₗ[σ₂₃] N₃)


/-- The sorted versions of a tuple `f` and of any permutation of `f` agree. -/
theorem comp_perm_comp_sort_eq_comp_sort : (f ∘ σ) ∘ sort (f ∘ σ) = f ∘ sort f

{n : ℕ}
{α : Type u_1}
[LinearOrder α]
{f : Fin n → α}
{σ : Equiv.Perm (Fin n)}

(f ∘ ⇑σ) ∘ ⇑(Tuple.sort (f ∘ ⇑σ)) = f ∘ ⇑(Tuple.sort f)


@[norm_cast]
theorem tendsto_coe_ennreal {α : Type*} {f : Filter α} {m : α → ℝ≥0∞} {a : ℝ≥0∞} :
    Tendsto (fun a => (m a : EReal)) f (𝓝 ↑a) ↔ Tendsto m f (𝓝 a)

{α : Type u_2}
{f : Filter α}
{m : α → ℝ≥0∞}
{a : ℝ≥0∞}

Filter.Tendsto (fun a => ↑(m a)) f (𝓝 ↑a) ↔ Filter.Tendsto m f (𝓝 a)


@[simp]
theorem pushoutIsoUnopPullback_inv_fst {X Y Z : C} (f : X ⟶ Z) (g : X ⟶ Y) [HasPushout f g]
    [HasPullback f.op g.op] :
    (pushoutIsoUnopPullback f g).inv.op ≫ pullback.fst f.op g.op = (pushout.inl f g).op

(CategoryTheory.Limits.pushoutIsoUnopPullback f g).inv.op ≫ CategoryTheory.Limits.pullback.fst f.op g.op =
  (CategoryTheory.Limits.pushout.inl f g).op


theorem limsInf_le_limsSup {f : Filter α} [NeBot f]
    (h₁ : f.IsBounded (· ≤ ·) := by isBoundedDefault)
    (h₂ : f.IsBounded (· ≥ ·) := by isBoundedDefault) :
    limsInf f ≤ limsSup f

(h₁ : Filter.IsBounded (fun x x_1 => x ≤ x_1) f := by isBoundedDefault)

(h₂ : Filter.IsBounded (fun x x_1 => x ≥ x_1) f := by isBoundedDefault)


@[to_additive (attr := simp)]
theorem mrange_fst : mrange (fst M N) = ⊤

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]

AddMonoidHom.mrange (AddMonoidHom.fst M N) = ⊤


@[simp]
theorem trans_refl (α : X ≅ Y) : α ≪≫ Iso.refl Y = α

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


@[simp] lemma affineIsometryOfStrictConvexSpace_apply (hi : Isometry f) (p : PF) :
    hi.affineIsometryOfStrictConvexSpace p = f p

{E : Type u_3}
{F : Type u_4}
{PE : Type u_5}
{PF : Type u_6}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[NormedSpace ℝ E]
[NormedSpace ℝ F]
[StrictConvexSpace ℝ E]
[MetricSpace PE]
[MetricSpace PF]
[NormedAddTorsor E PE]
[NormedAddTorsor F PF]
{f : PF → PE}
(hi : Isometry f)
(p : PF)


protected theorem cycle_g_cons (a : α) (a₁ : α) (l₁ : List α) (a₀ : α) (l₀ : List α) :
    Stream'.cycleG (a, a₁::l₁, a₀, l₀) = (a₁, l₁, a₀, l₀)

{α : Type u}
(a a₁ : α)
(l₁ : List α)
(a₀ : α)
(l₀ : List α)

Stream'.cycleG (a, a₁ :: l₁, a₀, l₀) = (a₁, l₁, a₀, l₀)


theorem map_decode_iff {f : α → β → σ} :
    (Primrec₂ fun a n => (@decode β _ n).map (f a)) ↔ Primrec₂ f

{α : Type u_1}
{β : Type u_2}
{σ : Type u_5}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
{f : α → β → σ}

(Primrec₂ fun a n => Option.map (f a) (Encodable.decode n)) ↔ Primrec₂ f


theorem mul_assoc0 [Semigroup α] (x : Holor α ds₁) (y : Holor α ds₂) (z : Holor α ds₃) :
    x ⊗ y ⊗ z = (x ⊗ (y ⊗ z)).assocLeft

{α : Type}
{ds₁ ds₂ ds₃ : List ℕ}
[Semigroup α]
(x : Holor α ds₁)
(y : Holor α ds₂)
(z : Holor α ds₃)

(x.mul y).mul z = (x.mul (y.mul z)).assocLeft


@[simp]
theorem average_zero : ⨍ _, (0 : E) ∂μ = 0

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(μ : MeasureTheory.Measure α)


/-- A specialization of `subset_iUnion₂`. -/
theorem subset_biUnion_of_mem {s : Set α} {u : α → Set β} {x : α} (xs : x ∈ s) :
    u x ⊆ ⋃ x ∈ s, u x

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{u : α → Set β}
{x : α}
(xs : x ∈ s)


theorem set_fintype_card_eq_univ_iff [Fintype α] (s : Set α) [Fintype s] :
    Fintype.card s = Fintype.card α ↔ s = Set.univ

{α : Type u_1}
[Fintype α]
(s : Set α)
[Fintype ↑s]

Fintype.card ↑s = Fintype.card α ↔ s = Set.univ


/-- If `Subsingleton R`, then `M ≃ₗ[R] ι →₀ R` for any type `ι`. -/
@[simps]
def Module.subsingletonEquiv (R M ι : Type*) [Semiring R] [Subsingleton R] [AddCommMonoid M]
    [Module R M] : M ≃ₗ[R] ι →₀ R

(R : Type u_4)
(M : Type u_5)
(ι : Type u_6)
[Semiring R]
[Subsingleton R]
[AddCommMonoid M]
[Module R M]

∀ (x : M), (Module.subsingletonEquiv R M ι) x = 0


/-- Given a natural transformation `τ : F ⟶ G` between functors `C ⥤ D` which preserve
the homology of a short complex `S`, and a homology data for `S`,
this is the homology map data for the morphism `S.mapNatTrans τ`
obtained by evaluating `τ`. -/
@[simps]
def HomologyMapData.natTransApp (h : HomologyData S) (τ : F ⟶ G) :
    HomologyMapData (S.mapNatTrans τ) (h.map F) (h.map G)

(CategoryTheory.ShortComplex.HomologyMapData.natTransApp h τ).left =
  CategoryTheory.ShortComplex.LeftHomologyMapData.natTransApp h.left τ


@[simp]
theorem lowerClosure_image (f : α ≃o β) :
    lowerClosure (f '' s) = LowerSet.map f (lowerClosure s)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{s : Set α}
(f : α ≃o β)

lowerClosure (⇑f '' s) = (LowerSet.map f) (lowerClosure s)


/--
Note that `mk 1` is the constant function `1` so the power series `1 + X + X^2 + ...`. This theorem
states that for any `d : ℕ`, `(1 + X + X^2 + ... : S⟦X⟧) ^ (d + 1)` is equal to the power series
`mk fun n => Nat.choose (d + n) d : S⟦X⟧`.
-/
theorem mk_one_pow_eq_mk_choose_add :
    (mk 1 : S⟦X⟧) ^ (d + 1) = (mk fun n => Nat.choose (d + n) d : S⟦X⟧)

PowerSeries.mk 1 ^ (d + 1) = PowerSeries.mk fun n => ↑((d + n).choose d)


theorem Set.EqOn.eventuallyEq {α β} {s : Set α} {f g : α → β} (h : EqOn f g s) : f =ᶠ[𝓟 s] g

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{f g : α → β}
(h : Set.EqOn f g s)


theorem commutator_comm : ⁅H₁, H₂⁆ = ⁅H₂, H₁⁆

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

⁅H₁, H₂⁆ = ⁅H₂, H₁⁆


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

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


nonrec theorem _root_.Function.RightInverse.filter_comap {f : α → β} {g : β → α}
    (hfg : RightInverse g f) : LeftInverse (comap g) (comap f)

{α : Type u}
{β : Type v}
{f : α → β}
{g : β → α}
(hfg : Function.RightInverse g f)

Function.LeftInverse (Filter.comap g) (Filter.comap f)


theorem Periodic.mul_const [DivisionSemiring α] (h : Periodic f c) (a : α) :
    Periodic (fun x => f (x * a)) (c * a⁻¹)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c : α}
[DivisionSemiring α]
(h : Function.Periodic f c)
(a : α)

Function.Periodic (fun x => f (x * a)) (c * a⁻¹)


@[gcongr] theorem rpow_lt_rpow_of_exponent_lt {x : ℝ≥0} {y z : ℝ} (hx : 1 < x) (hyz : y < z) :
    x ^ y < x ^ z


theorem commonNeighbors_subset_neighborSet_left (v w : V) :
    G.commonNeighbors v w ⊆ G.neighborSet v

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


/-- Given `c = lineMap a b r`, `c < b`, the point `(c, f c)` is non-strictly above the
segment `[(a, f a), (b, f b)]` if and only if `slope f c b ≤ slope f a b`. -/
theorem lineMap_le_map_iff_slope_le_slope_right (h : 0 < (1 - r) * (b - a)) :
    lineMap (f a) (f b) r ≤ f c ↔ slope f c b ≤ slope f a b

{k : Type u_1}
{E : Type u_2}
[LinearOrderedField k]
[OrderedAddCommGroup E]
[Module k E]
[OrderedSMul k E]
{f : k → E}
{a b r : k}
(h : 0 < (1 - r) * (b - a))

(AffineMap.lineMap (f a) (f b)) r ≤ f ((AffineMap.lineMap a b) r) ↔ slope f ((AffineMap.lineMap a b) r) b ≤ slope f a b


/-- A subset of a coplanar set is coplanar. -/
theorem Coplanar.subset {s₁ s₂ : Set P} (hs : s₁ ⊆ s₂) (h : Coplanar k s₂) : Coplanar k s₁

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s₁ s₂ : Set P}
(hs : s₁ ⊆ s₂)
(h : Coplanar k s₂)


@[ext]
lemma hom_ext {X Y : Arrow T} (f g : X ⟶ Y) (h₁ : f.left = g.left) (h₂ : f.right = g.right) :
    f = g

{T : Type u}
[CategoryTheory.Category.{v, u} T]
{X Y : CategoryTheory.Arrow T}
(f g : X ⟶ Y)
(h₁ : f.left = g.left)
(h₂ : f.right = g.right)


theorem derivative_X_sq : derivative (X ^ 2 : R[X]) = C 2 * X

Polynomial.derivative (Polynomial.X ^ 2) = Polynomial.C 2 * Polynomial.X


@[simp]
theorem prodSumDistrib_symm_apply_right (a : α × γ) :
    (prodSumDistrib α β γ).symm (inr a) = (a.1, inr a.2)

{α : Type u_1}
{γ : Type u_2}
{β : Type u_3}
(a : α × γ)

(Equiv.prodSumDistrib α β γ).symm (Sum.inr a) = (a.1, Sum.inr a.2)


@[simp] theorem cons_add_cons (x) (xs : IntList) (y) (ys : IntList) :
    (x :: xs) + (y :: ys) = (x + y) :: (xs + ys)

(x : Int)
(xs : Lean.Omega.IntList)
(y : Int)
(ys : Lean.Omega.IntList)


theorem iterate_pos_eq_iff {x : ℝ} {m : ℤ} {n : ℕ} (hn : 0 < n) :
    f^[n] x = x + n * m ↔ f x = x + m

(f : CircleDeg1Lift)
{x : ℝ}
{m : ℤ}
{n : ℕ}
(hn : 0 < n)