/-- Ratio of the composition `g.comp f` of two dilations is the product of their ratios. We assume
that the domain `α` of `f` is a nontrivial metric space, otherwise
`Dilation.ratio f = Dilation.ratio (g.comp f) = 1` but `Dilation.ratio g` may have any value.

See also `Dilation.ratio_comp'` for a version that works for more general spaces. -/
@[simp]
theorem ratio_comp [MetricSpace α] [Nontrivial α] [PseudoEMetricSpace β]
    [PseudoEMetricSpace γ] {g : β →ᵈ γ} {f : α →ᵈ β} : ratio (g.comp f) = ratio g * ratio f

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[MetricSpace α]
[Nontrivial α]
[PseudoEMetricSpace β]
[PseudoEMetricSpace γ]
{g : β →ᵈ γ}
{f : α →ᵈ β}

Dilation.ratio (g.comp f) = Dilation.ratio g * Dilation.ratio f


/-- Conjugating preserves self-adjointness. -/
theorem conj_adjoint {T : E →L[𝕜] E} (hT : IsSelfAdjoint T) (S : E →L[𝕜] F) :
    IsSelfAdjoint (S ∘L T ∘L ContinuousLinearMap.adjoint S)

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

IsSelfAdjoint (S.comp (T.comp (ContinuousLinearMap.adjoint S)))


theorem eq_comp_δ_of_not_surjective' {n : ℕ} {Δ : SimplexCategory} (θ : Δ ⟶ mk (n + 1))
    (i : Fin (n + 2)) (hi : ∀ x, θ.toOrderHom x ≠ i) : ∃ θ' : Δ ⟶ mk n, θ = θ' ≫ δ i

(hi : ∀ (x : Fin (Δ.len + 1)), (SimplexCategory.Hom.toOrderHom θ) x ≠ i)


theorem _root_.Nat.mem_range_succ (i : ℕ) : i ∈ range Nat.succ ↔ 0 < i


theorem choose_eq_zero_iff {n k : ℕ} : n.choose k = 0 ↔ n < k


protected theorem Nonempty.sup_eq_top_iff {α : Type*} [LinearOrder α] [BoundedOrder α]
    {s : Finset ι} {f : ι → α} (hs : s.Nonempty) : s.sup f = ⊤ ↔ ∃ b ∈ s, f b = ⊤

{ι : Type u_5}
{α : Type u_7}
[LinearOrder α]
[BoundedOrder α]
{s : Finset ι}
{f : ι → α}
(hs : s.Nonempty)


@[simp]
theorem map_exp_comap_re_atTop : map exp (comap re atTop) = cobounded ℂ

Filter.map Complex.exp (Filter.comap Complex.re Filter.atTop) = Bornology.cobounded ℂ


/-- The `x`-coordinate of a fundamental solution is a lower bound for the `x`-coordinate
of any positive solution. -/
theorem x_le_x {a₁ : Solution₁ d} (h : IsFundamental a₁) {a : Solution₁ d} (hax : 1 < a.x) :
    a₁.x ≤ a.x

{d : ℤ}
{a₁ : Pell.Solution₁ d}
(h : Pell.IsFundamental a₁)
{a : Pell.Solution₁ d}
(hax : 1 < a.x)


lemma finiteCoproduct.ι_desc_apply {B : LightProfinite} {π : (a : α) → X a ⟶ B} (a : α) :
    ∀ x, finiteCoproduct.desc X π (finiteCoproduct.ι X a x) = π a x

(x : (CategoryTheory.forget LightProfinite).obj (X a))

(LightProfinite.finiteCoproduct.desc X π) ((LightProfinite.finiteCoproduct.ι X a) x) = (π a) x


/-- Casting a `HomotopyWith f₀ f₁ P` to a `HomotopyWith g₀ g₁ P` where `f₀ = g₀` and `f₁ = g₁`.
-/
@[simps!]
def cast {f₀ f₁ g₀ g₁ : C(X, Y)} (F : HomotopyWith f₀ f₁ P) (h₀ : f₀ = g₀) (h₁ : f₁ = g₁) :
    HomotopyWith g₀ g₁ P

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{P : C(X, Y) → Prop}
{f₀ f₁ g₀ g₁ : C(X, Y)}
(F : f₀.HomotopyWith f₁ P)
(h₀ : f₀ = g₀)
(h₁ : f₁ = g₁)
(a : ↑I × X)


theorem destutter_cons' : (a :: l).destutter R = destutter' R a l

{α : Type u_1}
(l : List α)
(R : α → α → Prop)
[DecidableRel R]
{a : α}

List.destutter R (a :: l) = List.destutter' R a l


theorem exists_coeff_ne_zero_mem_comap_of_root_mem [IsDomain S] {r : S} (r_ne_zero : r ≠ 0)
    (hr : r ∈ I) {p : R[X]} :
    p ≠ 0 → p.eval₂ f r = 0 → ∃ i, p.coeff i ≠ 0 ∧ p.coeff i ∈ I.comap f

{R : Type u_1}
[CommRing R]
{S : Type u_2}
[CommRing S]
{f : R →+* S}
{I : Ideal S}
[IsDomain S]
{r : S}
(r_ne_zero : r ≠ 0)
(hr : r ∈ I)
{p : Polynomial R}

p ≠ 0 → Polynomial.eval₂ f r p = 0 → ∃ i, p.coeff i ≠ 0 ∧ p.coeff i ∈ Ideal.comap f I


@[simp, measurability]
theorem measurableSet_Ico : MeasurableSet (Ico a b)

{α : Type u_1}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[LinearOrder α]
[OrderClosedTopology α]
{a b : α}


/-- Weak version of the main theorem on differentiation of measures: given a Vitali family `v`
for a locally finite measure `μ`, and another locally finite measure `ρ`, then for `μ`-almost
every `x` the ratio `ρ a / μ a` converges, when `a` shrinks to `x` along the Vitali family,
towards the Radon-Nikodym derivative of `ρ` with respect to `μ`.

This version assumes that `ρ` is absolutely continuous with respect to `μ`. The general version
without this superfluous assumption is `VitaliFamily.ae_tendsto_rnDeriv`.
-/
theorem ae_tendsto_rnDeriv_of_absolutelyContinuous :
    ∀ᵐ x ∂μ, Tendsto (fun a => ρ a / μ a) (v.filterAt x) (𝓝 (ρ.rnDeriv μ x))

(hρ : ρ ≪ μ)

∀ᵐ (x : α) ∂μ, Filter.Tendsto (fun a => ρ a / μ a) (v.filterAt x) (𝓝 (ρ.rnDeriv μ x))


theorem of_eq :
    of V = (Quiver.Symmetrify.of ⋙q Paths.of).comp
      (Quotient.functor <| @redStep V _).toPrefunctor

CategoryTheory.Groupoid.Free.of V =
  Quiver.Symmetrify.of ⋙q CategoryTheory.Paths.of ⋙q
    (CategoryTheory.Quotient.functor CategoryTheory.Groupoid.Free.redStep).toPrefunctor


@[simp]
theorem comap_top (f : α → β) : comap f ⊤ = ⊤

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

(MeasureTheory.OuterMeasure.comap f) ⊤ = ⊤


@[to_additive (attr := simp)]
theorem coe_fst : ⇑(fst M N) = Prod.fst

{M : Type u_5}
{N : Type u_6}
[MulOneClass M]
[MulOneClass N]


protected lemma div_le_of_le_mul' (h : m ≤ k * n) : m / k ≤ n


lemma tendsto_riemannZeta_sub_one_div_Gammaℝ :
    Tendsto (fun s ↦ riemannZeta s - 1 / Gammaℝ s / (s - 1)) (𝓝[≠] 1)
    (𝓝 ((γ - Complex.log (4 * ↑π)) / 2))

Filter.Tendsto (fun s => riemannZeta s - 1 / s.Gammaℝ / (s - 1)) (𝓝[≠] 1) (𝓝 ((↑γ - Complex.log (4 * ↑π)) / 2))


theorem opow_one_add (a b : Ordinal) : a ^ (1 + b) = a * a ^ b


@[simp]
theorem coeSubmodule_top : coeSubmodule S (⊤ : Ideal R) = 1

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


theorem isCycle_cycleOf (f : Perm α) [DecidableRel f.SameCycle] (hx : f x ≠ x) :
    IsCycle (cycleOf f x)

{α : Type u_2}
{x : α}
(f : Equiv.Perm α)
[DecidableRel f.SameCycle]
(hx : f x ≠ x)


@[simp]
theorem extendScalars_toSubfield : (extendScalars h).toSubfield = E

{L : Type u_2}
[Field L]
{F E : Subfield L}
(h : F ≤ E)

(Subfield.extendScalars h).toSubfield = E


/-- A functor `F : C ⥤ D` sends binary bicones for `P` and `Q`
to binary bicones for `G.obj P` and `G.obj Q` functorially. -/
@[simps]
def functoriality : BinaryBicone P Q ⥤ BinaryBicone (F.obj P) (F.obj Q)

(A : CategoryTheory.Limits.BinaryBicone P Q)

((CategoryTheory.Limits.BinaryBicones.functoriality P Q F).obj A).inr = F.map A.inr


/-- A dependent version of `NonUnitalAlgebra.adjoin_induction`. -/
theorem adjoin_induction' {s : Set A} {p : ∀ x, x ∈ adjoin R s → Prop}
    (mem : ∀ (x) (h : x ∈ s), p x (subset_adjoin R h))
    (add : ∀ x hx y hy, p x hx → p y hy → p (x + y) (add_mem ‹_› ‹_›))
    (zero : p 0 (zero_mem _))
    (mul : ∀ x hx y hy, p x hx → p y hy → p (x * y) (mul_mem ‹_› ‹_›))
    (smul : ∀ (r : R) (x hx), p x hx → p (r • x) (SMulMemClass.smul_mem _ ‹_›))
    {a} (ha : a ∈ adjoin R s) : p a ha

{p : (x : A) → x ∈ NonUnitalAlgebra.adjoin R s → Prop}

(add :
  ∀ (x : A) (hx : x ∈ NonUnitalAlgebra.adjoin R s) (y : A) (hy : y ∈ NonUnitalAlgebra.adjoin R s),
    p x hx → p y hy → p (x + y) ⋯)

(mul :
  ∀ (x : A) (hx : x ∈ NonUnitalAlgebra.adjoin R s) (y : A) (hy : y ∈ NonUnitalAlgebra.adjoin R s),
    p x hx → p y hy → p (x * y) ⋯)

(smul : ∀ (r : R) (x : A) (hx : x ∈ NonUnitalAlgebra.adjoin R s), p x hx → p (r • x) ⋯)


@[simp]
theorem coe_zero_linearMap : ↑(0 : Derivation R A M) = (0 : A →ₗ[R] M)

{R : Type u_1}
{A : Type u_2}
{M : Type u_4}
[CommSemiring R]
[CommSemiring A]
[AddCommMonoid M]
[Algebra R A]
[Module A M]
[Module R M]


/-- The equivalence of categories expressing right unity of products of categories.  -/
@[simps]
def rightUnitorEquivalence : C × Discrete (PUnit : Type w) ≌ C

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

(CategoryTheory.prod.rightUnitorEquivalence C).inverse = CategoryTheory.prod.rightInverseUnitor C


@[simp]
theorem find_lt_iff (n : ℕ+) : PNat.find h < n ↔ ∃ m < n, p m

{p : ℕ+ → Prop}
[DecidablePred p]
(h : ∃ n, p n)
(n : ℕ+)


private theorem zero_slash (k : ℤ) (A : GL(2, ℝ)⁺) : (0 : ℍ → ℂ) ∣[k]A = 0


@[to_additive (attr := simp)]
theorem div_eq {x y : PUnit} : x / y = unit


@[simp]
lemma associated_sq : associated (R := R) sq = mul R R

{R : Type u_3}
[CommRing R]
[Invertible 2]

QuadraticMap.associated QuadraticMap.sq = LinearMap.mul R R


@[simp] theorem ofInt_num : (ofInt n : Rat).num = n


@[to_additive]
theorem tprod_eq_tprod_of_ne_one_bij {g : γ → α} (i : mulSupport g → β) (hi : Injective i)
    (hf : mulSupport f ⊆ Set.range i) (hfg : ∀ x, f (i x) = g x) : ∏' x, f x = ∏' y, g y

(hf : Function.mulSupport f ⊆ Set.range i)

(hfg : ∀ (x : ↑(Function.mulSupport g)), f (i x) = g ↑x)


/-- A graph embedding induces an embedding of neighbor sets. -/
@[simps]
def mapNeighborSet (v : V) : G.neighborSet v ↪ G'.neighborSet (f v)

{V : Type u_1}
{W : Type u_2}
{G : SimpleGraph V}
{G' : SimpleGraph W}
(f : G ↪g G')
(v : V)
(w : ↑(G.neighborSet v))


theorem iteratedFDerivWithin_zero_eq_comp :
    iteratedFDerivWithin 𝕜 0 f s = (continuousMultilinearCurryFin0 𝕜 E F).symm ∘ f

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}

iteratedFDerivWithin 𝕜 0 f s = ⇑(continuousMultilinearCurryFin0 𝕜 E F).symm ∘ f


/-- The set of cluster points of a filter is closed. In particular, the set of limit points
of a sequence is closed. -/
theorem isClosed_setOf_clusterPt {f : Filter X} : IsClosed { x | ClusterPt x f }

{X : Type u}
[TopologicalSpace X]
{f : Filter X}


@[simp]
theorem ae_eq_empty : s =ᵐ[μ] (∅ : Set α) ↔ μ s = 0

{α : Type u_1}
{F : Type u_3}
[FunLike F (Set α) ℝ≥0∞]
[MeasureTheory.OuterMeasureClass F α]
{μ : F}
{s : Set α}


@[simp, norm_cast]
theorem cast_pred : ∀ {n}, 0 < n → ((n - 1 : ℕ) : R) = n - 1

{R : Type u}
[AddGroupWithOne R]
{n : ℕ}


/-- `Language.reverse` as a ring isomorphism to the opposite ring. -/
@[simps]
def reverseIso : Language α ≃+* (Language α)ᵐᵒᵖ

(Language.reverseIso α).symm l' = (MulOpposite.unop l').reverse


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


@[to_additive]
theorem mulSupport_pow [Monoid M] (f : α → M) (n : ℕ) :
    (mulSupport fun x => f x ^ n) ⊆ mulSupport f

{α : Type u_1}
{M : Type u_5}
[Monoid M]
(f : α → M)
(n : ℕ)

(Function.mulSupport fun x => f x ^ n) ⊆ Function.mulSupport f


protected theorem map_one {A'} [Semiring A'] [Algebra R A'] (f : A →ₐ[R] A') :
    map f.toLinearMap (1 : Submodule R A) = 1

{R : Type u}
[CommSemiring R]
{A : Type v}
[Semiring A]
[Algebra R A]
{A' : Type u_1}
[Semiring A']
[Algebra R A']
(f : A →ₐ[R] A')


theorem prev_next (l : List α) (h : Nodup l) (x : α) (hx : x ∈ l) :
    prev l (next l x hx) (next_mem _ _ _) = x

{α : Type u_1}
[DecidableEq α]
(l : List α)
(h : l.Nodup)
(x : α)
(hx : x ∈ l)


theorem invOneSubPow_inv_eq_one_sub_pow :
    (invOneSubPow d).inv = (1 - X : S⟦X⟧) ^ (d + 1)

(PowerSeries.invOneSubPow d).inv = (1 - PowerSeries.X) ^ (d + 1)


@[to_additive (attr := simp)]
theorem map_mul' (f : α → β) (x y : FreeMagma α) : f <$> (x * y) = f <$> x * f <$> y

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


/-- Typeclass for multiplicative actions by monoids. This generalizes group actions. -/
@[to_additive (attr := ext)]
class MulAction (α : Type*) (β : Type*) [Monoid α] extends SMul α β where
  /-- One is the neutral element for `•` -/
  protected one_smul : ∀ b : β, (1 : α) • b = b
  /-- Associativity of `•` and `*` -/
  mul_smul : ∀ (x y : α) (b : β), (x * y) • b = x • y • b

{α : Type u_11}
{β : Type u_12}
[Monoid α]
[self : MulAction α β]
(b : β)


@[simp]
theorem tensorUnit_mul : (𝟙_ (Mon_ C)).mul = (λ_ (𝟙_ C)).hom

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


theorem isBridge_iff_adj_and_forall_cycle_not_mem {v w : V} : G.IsBridge s(v, w) ↔
    G.Adj v w ∧ ∀ ⦃u : V⦄ (p : G.Walk u u), p.IsCycle → s(v, w) ∉ p.edges

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


/-- Predicate on the triangle indices for the explicit triangles to be edge-disjoint. -/
class ExplicitDisjoint (t : Finset (α × β × γ)) : Prop where
  inj₀ : ∀ ⦃a b c a'⦄, (a, b, c) ∈ t → (a', b, c) ∈ t → a = a'
  inj₁ : ∀ ⦃a b c b'⦄, (a, b, c) ∈ t → (a, b', c) ∈ t → b = b'
  inj₂ : ∀ ⦃a b c c'⦄, (a, b, c) ∈ t → (a, b, c') ∈ t → c = c'

[self : SimpleGraph.TripartiteFromTriangles.ExplicitDisjoint t]


/-- The usual sheaf condition can be obtained from the sheaf condition
in terms of unique gluings.
-/
theorem isSheaf_of_isSheafUniqueGluing_types (Fsh : F.IsSheafUniqueGluing) : F.IsSheaf

{X : TopCat}
(F : TopCat.Presheaf (Type u) X)
(Fsh : F.IsSheafUniqueGluing)


/-- If `f (g y) = y` for `y` in some neighborhood of `a`, `g` is continuous at `a`, and `f` has an
invertible derivative `f'` at `g a`, then `g` has the derivative `f'⁻¹` at `a`.

This is one of the easy parts of the inverse function theorem: it assumes that we already have
an inverse function. -/
theorem HasFDerivAt.of_local_left_inverse {f : E → F} {f' : E ≃L[𝕜] F} {g : F → E} {a : F}
    (hg : ContinuousAt g a) (hf : HasFDerivAt f (f' : E →L[𝕜] F) (g a))
    (hfg : ∀ᶠ y in 𝓝 a, f (g y) = y) : HasFDerivAt g (f'.symm : F →L[𝕜] E) a

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{f' : E ≃L[𝕜] F}
{g : F → E}
{a : F}
(hg : ContinuousAt g a)
(hf : HasFDerivAt f (↑f') (g a))
(hfg : ∀ᶠ (y : F) in 𝓝 a, f (g y) = y)


@[simp]
theorem finAddFlip_apply_mk_left {k : ℕ} (h : k < m) (hk : k < m + n := Nat.lt_add_right n h)
    (hnk : n + k < n + m := Nat.add_lt_add_left h n) :
    finAddFlip (⟨k, hk⟩ : Fin (m + n)) = ⟨n + k, hnk⟩


@[simp]
theorem isBigOWith_pure {x} : IsBigOWith c (pure x) f g ↔ ‖f x‖ ≤ c * ‖g x‖

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{c : ℝ}
{f : α → E}
{g : α → F}
{x : α}

Asymptotics.IsBigOWith c (pure x) f g ↔ ‖f x‖ ≤ c * ‖g x‖


@[simp]
theorem trace_zero : trace (0 : Matrix n n R) = 0

(n : Type u_3)
(R : Type u_6)
[Fintype n]
[AddCommMonoid R]


@[norm_cast, simp]
theorem coe_div (x y : R) : ((x / y : R) : ℍ[R]) = x / y

{R : Type u_1}
[LinearOrderedField R]
(x y : R)


theorem fib_succ_eq_sum_choose :
    ∀ n : ℕ, fib (n + 1) = ∑ p ∈ Finset.antidiagonal n, choose p.1 p.2

Nat.fib (n + 1) = ∑ p ∈ Finset.antidiagonal n, p.1.choose p.2


@[reassoc (attr := simp)]
lemma colimitHomIsoLimitYoneda_inv_comp_π [HasLimitsOfShape Iᵒᵖ (Type u₂)] (A : C) (i : I) :
    (colimitHomIsoLimitYoneda F A).inv ≫ (coyoneda.map (colimit.ι F i).op).app A
      = limit.π (F.op ⋙ yoneda.obj A) ⟨i⟩

[CategoryTheory.Limits.HasLimitsOfShape Iᵒᵖ (Type u₂)]

CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.colimitHomIsoLimitYoneda F A).inv
    ((CategoryTheory.coyoneda.map (CategoryTheory.Limits.colimit.ι F i).op).app A) =
  CategoryTheory.Limits.limit.π (F.op.comp (CategoryTheory.yoneda.obj A)) (Opposite.op i)


theorem Sum.elim_natCast_natCast {α β γ : Type*} [NatCast γ] (n : ℕ) :
    Sum.elim (n : α → γ) (n : β → γ) = n

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[NatCast γ]
(n : ℕ)


lemma Exact.epi_f' (hS : S.Exact) (h : LeftHomologyData S) : Epi h.f'

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{S : CategoryTheory.ShortComplex C}
(hS : S.Exact)
(h : S.LeftHomologyData)


/-- `Equiv.piCongrRight` as a homeomorphism: this is the natural homeomorphism
`Π i, Y₁ i ≃ₜ Π j, Y₂ i` obtained from homeomorphisms `Y₁ i ≃ₜ Y₂ i` for each `i`. -/
@[simps! apply toEquiv]
def piCongrRight {ι : Type*} {Y₁ Y₂ : ι → Type*} [∀ i, TopologicalSpace (Y₁ i)]
    [∀ i, TopologicalSpace (Y₂ i)] (F : ∀ i, Y₁ i ≃ₜ Y₂ i) : (∀ i, Y₁ i) ≃ₜ ∀ i, Y₂ i

{ι : Type u_6}
{Y₁ : ι → Type u_7}
{Y₂ : ι → Type u_8}
[(i : ι) → TopologicalSpace (Y₁ i)]
[(i : ι) → TopologicalSpace (Y₂ i)]
(F : (i : ι) → Y₁ i ≃ₜ Y₂ i)

(Homeomorph.piCongrRight F).toEquiv = Equiv.piCongrRight fun i => (F i).toEquiv


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

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{f' : E →L[ℝ] ℝ}
{a : E}
(h : IsLocalExtr f a)


theorem congr_reverse_comp {X Y : Paths <| Quiver.Symmetrify V} (p : X ⟶ Y) :
    Quot.mk (@Quotient.CompClosure _ _ redStep _ _) (p.reverse ≫ p) =
      Quot.mk (@Quotient.CompClosure _ _ redStep _ _) (𝟙 Y)

{X Y : CategoryTheory.Paths (Quiver.Symmetrify V)}

Quot.mk (CategoryTheory.Quotient.CompClosure CategoryTheory.Groupoid.Free.redStep)
    (CategoryTheory.CategoryStruct.comp (Quiver.Path.reverse p) p) =
  Quot.mk (CategoryTheory.Quotient.CompClosure CategoryTheory.Groupoid.Free.redStep)
    (CategoryTheory.CategoryStruct.id Y)


theorem essSup_mono_measure {f : α → β} (hμν : ν ≪ μ) : essSup f ν ≤ essSup f μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
[CompleteLattice β]
{f : α → β}
(hμν : ν ≪ μ)


@[to_additive]
theorem continuous_val : Continuous ((↑) : Mˣ → M)

{M : Type u_1}
[TopologicalSpace M]
[AddMonoid M]


@[simp] lemma toLex_intCast [IntCast R] (n : ℤ) : toLex (n : R) = n


@[to_additive (attr := simp)]
theorem mul_empty (s : Finset α) : s * ∅ = ∅

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


/-- Any cocone morphism between colimit cocones is an isomorphism. -/
theorem hom_isIso {s t : Cocone F} (P : IsColimit s) (Q : IsColimit t) (f : s ⟶ t) : IsIso f

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


@[simp]
lemma leRec_succ {n} {motive : (m : ℕ) → n ≤ m → Sort*}
    (refl : motive n le_rfl)
    (le_succ_of_le : ∀ ⦃k⦄ (h : n ≤ k), motive k h → motive (k + 1) (le_succ_of_le h))
    (h1 : n ≤ m) {h2 : n ≤ m + 1} :
    (leRec (motive := motive) refl le_succ_of_le h2) =
      le_succ_of_le h1 (leRec (motive := motive) refl le_succ_of_le h1)

(le_succ_of_le : ⦃k : ℕ⦄ → (h : n ≤ k) → motive k h → motive (k + 1) ⋯)

Nat.leRec refl le_succ_of_le h2 = le_succ_of_le h1 (Nat.leRec refl le_succ_of_le h1)


@[simp]
theorem isoToPlus_hom (hP : Presheaf.IsSheaf J P) : (J.isoToPlus P hP).hom = J.toPlus P

(J : CategoryTheory.GrothendieckTopology C)

[CategoryTheory.Category.{max v u, w} D]

[∀ (P : CategoryTheory.Functor Cᵒᵖ D) (X : C) (S : J.Cover X), CategoryTheory.Limits.HasMultiequalizer (S.index P)]

[∀ (X : C), CategoryTheory.Limits.HasColimitsOfShape (J.Cover X)ᵒᵖ D]

(hP : CategoryTheory.Presheaf.IsSheaf J P)


@[simp]
theorem inf_apply [SemilatticeInf α] {i : ι} {f g : ι →₀ α} : (f ⊓ g) i = f i ⊓ g i

{ι : Type u_1}
{α : Type u_2}
[Zero α]
[SemilatticeInf α]
{i : ι}
{f g : ι →₀ α}


@[to_additive]
theorem QuotientGroup.continuous_smul₁ (x : G ⧸ Γ) : Continuous fun g : G => g • x

{G : Type w}
[Group G]
[TopologicalSpace G]
[ContinuousMul G]
{Γ : Subgroup G}
(x : G ⧸ Γ)


@[to_additive]
theorem MulEquiv.isGroupHom {G H : Type*} {_ : Group G} {_ : Group H} (h : G ≃* H) :
    IsGroupHom h

∀ {x : Group G} {x_1 : Group H} (h : G ≃* H), IsGroupHom ⇑h


theorem measurable_of_measurable_on_compl_finite [MeasurableSingletonClass α] {f : α → β}
    (s : Set α) (hs : s.Finite) (hf : Measurable (sᶜ.restrict f)) : Measurable f

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{mβ : MeasurableSpace β}
[MeasurableSingletonClass α]
{f : α → β}
(s : Set α)
(hs : s.Finite)
(hf : Measurable (sᶜ.restrict f))


@[ext]
protected theorem ext {K L : ConvexBody V} (h : (K : Set V) = L) : K = L

{V : Type u_1}
[TopologicalSpace V]
[AddCommGroup V]
[Module ℝ V]
{K L : ConvexBody V}
(h : ↑K = ↑L)


@[simp]
theorem conjTransposeAddEquiv_symm [AddMonoid α] [StarAddMonoid α] :
    (conjTransposeAddEquiv m n α).symm = conjTransposeAddEquiv n m α

(m : Type u_2)
(n : Type u_3)
(α : Type v)
[AddMonoid α]
[StarAddMonoid α]

(Matrix.conjTransposeAddEquiv m n α).symm = Matrix.conjTransposeAddEquiv n m α


/-- If `p` is a prime and `IsCyclotomicExtension {p ^ (k + 1)} K L`, then the discriminant of
`hζ.powerBasis K` is `(-1) ^ ((p ^ (k + 1).totient) / 2) * p ^ (p ^ k * ((p - 1) * (k + 1) - 1))`
if `Irreducible (cyclotomic (p ^ (k + 1)) K))`, and `p ^ (k + 1) ≠ 2`. -/
theorem discr_prime_pow_ne_two [IsCyclotomicExtension {p ^ (k + 1)} K L] [hp : Fact (p : ℕ).Prime]
    (hζ : IsPrimitiveRoot ζ ↑(p ^ (k + 1))) (hirr : Irreducible (cyclotomic (↑(p ^ (k + 1)) : ℕ) K))
    (hk : p ^ (k + 1) ≠ 2) : discr K (hζ.powerBasis K).basis =
      (-1) ^ ((p ^ (k + 1) : ℕ).totient / 2) * p ^ ((p : ℕ) ^ k * ((p - 1) * (k + 1) - 1))

(hirr : Irreducible (Polynomial.cyclotomic (↑(p ^ (k + 1))) K))

Algebra.discr K ⇑(IsPrimitiveRoot.powerBasis K hζ).basis =
  (-1) ^ (φ (↑p ^ (k + 1)) / 2) * ↑↑p ^ (↑p ^ k * ((↑p - 1) * (k + 1) - 1))


/-- The function `cosKernel a - 1` has exponential decay at `+∞`, for any `a`. -/
lemma isBigO_atTop_cosKernel_sub (a : UnitAddCircle) :
    ∃ p, 0 < p ∧ IsBigO atTop (cosKernel a · - 1) (fun x ↦ Real.exp (-p * x))

∃ p, 0 < p ∧ (fun x => HurwitzZeta.cosKernel a x - 1) =O[Filter.atTop] fun x => rexp (-p * x)


theorem map_le_map_iff_of_injective (p q : Submodule R M) : p.map f ≤ q.map f ↔ p ≤ q

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
{F : Type u_9}
[FunLike F M M₂]
[SemilinearMapClass F σ₁₂ M M₂]
[RingHomSurjective σ₁₂]
{f : F}
(hf : Function.Injective ⇑f)
(p q : Submodule R M)

Submodule.map f p ≤ Submodule.map f q ↔ p ≤ q


theorem discreteTopology_iff_orderTopology_of_pred_succ' [PartialOrder α] [PredOrder α]
    [SuccOrder α] [NoMinOrder α] [NoMaxOrder α] : DiscreteTopology α ↔ OrderTopology α

{α : Type u_1}
[TopologicalSpace α]
[PartialOrder α]
[PredOrder α]
[SuccOrder α]
[NoMinOrder α]
[NoMaxOrder α]


theorem pullback_map_diagonal_isPullback :
    IsPullback (pullback.fst _ _ ≫ f)
      (pullback.map f g (f ≫ i) (g ≫ i) _ _ i (Category.id_comp _).symm (Category.id_comp _).symm)
      (diagonal i)
      (pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 _) (Category.comp_id _) (Category.comp_id _))

[CategoryTheory.Limits.HasPullback (f ≫ i) (g ≫ i)]

[CategoryTheory.Limits.HasPullback (CategoryTheory.Limits.pullback.diagonal i)
    (CategoryTheory.Limits.pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 S) ⋯ ⋯)]

CategoryTheory.IsPullback (CategoryTheory.Limits.pullback.fst f g ≫ f)
  (CategoryTheory.Limits.pullback.map f g (f ≫ i) (g ≫ i) (𝟙 X) (𝟙 Y) i ⋯ ⋯) (CategoryTheory.Limits.pullback.diagonal i)
  (CategoryTheory.Limits.pullback.map (f ≫ i) (g ≫ i) i i f g (𝟙 S) ⋯ ⋯)


@[simp]
theorem lift_single (F : Multiplicative G →* A) (a b) :
    lift k G A F (single a b) = b • F (Multiplicative.ofAdd a)

{k : Type u₁}
{G : Type u₂}
[CommSemiring k]
[AddMonoid G]
{A : Type u₃}
[Semiring A]
[Algebra k A]
(F : Multiplicative G →* A)
(a : G)
(b : k)

((AddMonoidAlgebra.lift k G A) F) (AddMonoidAlgebra.single a b) = b • F (Multiplicative.ofAdd a)


@[simp]
theorem add_bind : (s + t).bind f = s.bind f + t.bind f

{α : Type u_1}
{β : Type v}
(s t : Multiset α)
(f : α → Multiset β)


/-- An open left half-plane (with boundary real part given by an `EReal`) is an open set
in the complex plane. -/
lemma isOpen_re_lt_EReal (x : EReal) : IsOpen {z : ℂ | z.re < x}


theorem abs_tendsto_atTop_iff : Tendsto (fun x => abs <| eval x P) atTop atTop ↔ 0 < P.degree

{𝕜 : Type u_1}
[NormedLinearOrderedField 𝕜]
(P : 𝕜[X])
[OrderTopology 𝕜]

Filter.Tendsto (fun x => |Polynomial.eval x P|) Filter.atTop Filter.atTop ↔ 0 < P.degree


theorem le_of_lt_succFn (j i : ι) (hij : j < succFn i) : j ≤ i

(hij : j < LinearLocallyFiniteOrder.succFn i)


/-- Equality case in the **Schwarz Lemma**: in the setup of `norm_dslope_le_div_of_mapsTo_ball`, if
`‖dslope f c z₀‖ = R₂ / R₁` holds at a point in the ball then the map `f` is affine. -/
theorem affine_of_mapsTo_ball_of_exists_norm_dslope_eq_div [CompleteSpace E] [StrictConvexSpace ℝ E]
    (hd : DifferentiableOn ℂ f (ball c R₁)) (h_maps : Set.MapsTo f (ball c R₁) (ball (f c) R₂))
    (h_z₀ : z₀ ∈ ball c R₁) (h_eq : ‖dslope f c z₀‖ = R₂ / R₁) :
    Set.EqOn f (fun z => f c + (z - c) • dslope f c z₀) (ball c R₁)

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

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

Set.EqOn f (fun z => f c + (z - c) • dslope f c z₀) (Metric.ball c R₁)


/-- The function `x ^ (-y)` tends to `0` at `+∞` for any positive real `y`. -/
theorem tendsto_rpow_neg_atTop {y : ℝ} (hy : 0 < y) : Tendsto (fun x : ℝ => x ^ (-y)) atTop (𝓝 0)

Filter.Tendsto (fun x => x ^ (-y)) Filter.atTop (𝓝 0)


/-- Order without minimal elements. Sometimes called coinitial or dense. -/
class NoMinOrder (α : Type*) [LT α] : Prop where
  /-- For each term `a`, there is some strictly smaller `b`. -/
  exists_lt (a : α) : ∃ b, b < a

{α : Type u_3}
[LT α]
[self : NoMinOrder α]
(a : α)


lemma changeLevel_trans {m d : ℕ} (hm : n ∣ m) (hd : m ∣ d) :
    changeLevel (dvd_trans hm hd) χ = changeLevel hd (changeLevel hm χ)

{R : Type u_1}
[CommMonoidWithZero R]
{n : ℕ}
(χ : DirichletCharacter R n)
{m d : ℕ}
(hm : n ∣ m)
(hd : m ∣ d)

(DirichletCharacter.changeLevel ⋯) χ = (DirichletCharacter.changeLevel hd) ((DirichletCharacter.changeLevel hm) χ)


/-- A morphism constructed with `nullHomotopic` is homotopic to zero. -/
@[simps]
def ofNullHomotopic (h₀ : S₁.X₁ ⟶ S₂.X₁) (h₀_f : h₀ ≫ S₂.f = 0)
    (h₁ : S₁.X₂ ⟶ S₂.X₁) (h₂ : S₁.X₃ ⟶ S₂.X₂) (h₃ : S₁.X₃ ⟶ S₂.X₃) (g_h₃ : S₁.g ≫ h₃ = 0) :
  Homotopy (nullHomotopic _ _ h₀ h₀_f h₁ h₂ h₃ g_h₃) 0

(h₀_f : CategoryTheory.CategoryStruct.comp h₀ S₂.f = 0)

(g_h₃ : CategoryTheory.CategoryStruct.comp S₁.g h₃ = 0)

(CategoryTheory.ShortComplex.Homotopy.ofNullHomotopic S₁ S₂ h₀ h₀_f h₁ h₂ h₃ g_h₃).h₀ = h₀


/-- `QuotientMap.lift` as an equivalence. -/
@[simps]
noncomputable def liftEquiv : { g : C(X, Z) // Function.FactorsThrough g f} ≃ C(Y, Z)

(g : { g // Function.FactorsThrough ⇑g ⇑f })


theorem suffixLevenshtein_cons₁_aux {x y : {r : List δ // 0 < r.length}}
    (w₀ : x.1[0]'x.2 = y.1[0]'y.2) (w : x.1.tail = y.1.tail) : x = y

{δ : Type u_3}
{x y : { r // 0 < r.length }}
(w₀ : x.val[0] = y.val[0])
(w : x.val.tail = y.val.tail)


@[simp] theorem snd_comp_inr : snd R M M₂ ∘ₗ inr R M M₂ = id

(R : Type u)
(M : Type v)
(M₂ : Type w)
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]

LinearMap.snd R M M₂ ∘ₗ LinearMap.inr R M M₂ = LinearMap.id


theorem arccos_of_one_le {x : ℝ} (hx : 1 ≤ x) : arccos x = 0


@[simp]
theorem range_coe : range (mk : α → ConnectedComponents α) = univ

Set.range ConnectedComponents.mk = Set.univ


@[simp]
theorem iterate_derivative_intCast_mul {n : ℤ} {k : ℕ} {f : R[X]} :
    derivative^[k] ((n : R[X]) * f) = n * derivative^[k] f

{R : Type u}
[Ring R]
{n : ℤ}
{k : ℕ}
{f : R[X]}

(⇑Polynomial.derivative)^[k] (↑n * f) = ↑n * (⇑Polynomial.derivative)^[k] f


/-- In a normed field, `CauSeq` coincides with the usual notion of Cauchy sequences. -/
theorem isCauSeq_iff_cauchySeq {α : Type u} [NormedField α] {u : ℕ → α} :
    IsCauSeq norm u ↔ CauchySeq u


protected theorem Surjective.forall₃ (hf : Surjective f) {p : β → β → β → Prop} :
    (∀ y₁ y₂ y₃, p y₁ y₂ y₃) ↔ ∀ x₁ x₂ x₃, p (f x₁) (f x₂) (f x₃)

{α : Sort u_1}
{β : Sort u_2}
{f : α → β}
(hf : Function.Surjective f)
{p : β → β → β → Prop}

(∀ (y₁ y₂ y₃ : β), p y₁ y₂ y₃) ↔ ∀ (x₁ x₂ x₃ : α), p (f x₁) (f x₂) (f x₃)


/-- A non-unital subsemiring `S` includes `closure s` if and only if it includes `s`. -/
@[simp]
theorem closure_le {s : Set R} {t : NonUnitalSubsemiring R} : closure s ≤ t ↔ s ⊆ t

{R : Type u}
[NonUnitalNonAssocSemiring R]
{s : Set R}
{t : NonUnitalSubsemiring R}

NonUnitalSubsemiring.closure s ≤ t ↔ s ⊆ ↑t


@[simp]
theorem not_nontrivial_empty : ¬ (∅ : Finset α).Nontrivial


theorem smoothOn_coordChangeL :
    SmoothOn IB 𝓘(𝕜, F →L[𝕜] F) (fun b : B => (e.coordChangeL 𝕜 e' b : 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)) (e.baseSet ∩ e'.baseSet)


/-- Multiplicative inverse of a rational function. -/
protected irreducible_def inv : RatFunc K → RatFunc K

{K : Type u_1}
[CommRing K]
[IsDomain K]

∀ (x : RatFunc K),
  x.inv =
    match x with
    | { toFractionRing := p } => { toFractionRing := p⁻¹ }


@[simp, norm_cast]
lemma ofReal_nonpos {x : ℝ} : (x : K) ≤ 0 ↔ x ≤ 0

↑x ≤ 0 ↔ x ≤ 0


@[to_additive]
theorem Multipliable.vanishing (hf : Multipliable f) ⦃e : Set G⦄ (he : e ∈ 𝓝 (1 : G)) :
    ∃ s : Finset α, ∀ t, Disjoint t s → (∏ k ∈ t, f k) ∈ e

{α : Type u_1}
{G : Type u_5}
[TopologicalSpace G]
[AddCommGroup G]
[TopologicalAddGroup G]
{f : α → G}
(hf : Summable f)
⦃e : Set G⦄
(he : e ∈ 𝓝 0)

∃ s, ∀ (t : Finset α), Disjoint t s → ∑ k ∈ t, f k ∈ e


@[simp]
theorem totalDegree_neg (a : MvPolynomial σ R) : (-a).totalDegree = a.totalDegree

{R : Type u}
{σ : Type u_1}
[CommRing R]
(a : MvPolynomial σ R)


theorem rotate_eq_self_iff_eq_replicate [hα : Nonempty α] :
    ∀ {l : List α}, (∀ n, l.rotate n = l) ↔ ∃ a, l = replicate l.length a

{α : Type u}
[hα : Nonempty α]
{l : List α}

(∀ (n : ℕ), l.rotate n = l) ↔ ∃ a, l = List.replicate l.length a


theorem iterate_pos_lt_of_map_lt' (h : Commute f g) (hf : StrictMono f) (hg : Monotone g) {x}
    (hx : f x < g x) {n} (hn : 0 < n) : f^[n] x < g^[n] x

{α : Type u_1}
[Preorder α]
{f g : α → α}
(h : Function.Commute f g)
(hf : StrictMono f)
(hg : Monotone g)
{x : α}
(hx : f x < g x)
{n : ℕ}
(hn : 0 < n)


theorem le_closure_iff : x ≤ c y ↔ c x ≤ c y

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


theorem summable_of_isBigO_nat' {E F : Type*} [NormedAddCommGroup E] [CompleteSpace E]
    [NormedAddCommGroup F] [NormedSpace ℝ F] [FiniteDimensional ℝ F] {f : ℕ → E} {g : ℕ → F}
    (hg : Summable g) (h : f =O[atTop] g) : Summable f

{E : Type u_1}
{F : Type u_2}
[NormedAddCommGroup E]
[CompleteSpace E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
[FiniteDimensional ℝ F]
{f : ℕ → E}
{g : ℕ → F}
(hg : Summable g)
(h : f =O[Filter.atTop] g)


lemma nonempty_linearIndependent_set : Nonempty {s : Set M // LinearIndependent R ((↑) : s → M)}

(R : Type u)
(M : Type v)
[Semiring R]
[AddCommMonoid M]
[Module R M]

Nonempty { s // LinearIndependent (ι := { x // x ∈ s }) R Subtype.val }


@[to_additive (attr := ext)]
theorem Group.ext {G : Type*} ⦃g₁ g₂ : Group G⦄ (h_mul : g₁.mul = g₂.mul) : g₁ = g₂

{G : Type u_1}
⦃g₁ g₂ : AddGroup G⦄
(h_mul : Add.add = Add.add)


theorem le_of_forall_nnreal_lt {x y : ℝ≥0∞} (h : ∀ r : ℝ≥0, ↑r < x → ↑r ≤ y) : x ≤ y

{x y : ENNReal}
(h : ∀ (r : ℝ≥0), ↑r < x → ↑r ≤ y)


theorem norm_equiv {f g : PadicSeq p} (hfg : f ≈ g) : f.norm = g.norm

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{f g : PadicSeq p}
(hfg : f ≈ g)


@[simp] theorem coprime_self (n : Nat) : Coprime n n ↔ n = 1


theorem commutator_eq_bot_iff_le_centralizer : ⁅H₁, H₂⁆ = ⊥ ↔ H₁ ≤ centralizer H₂

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

⁅H₁, H₂⁆ = ⊥ ↔ H₁ ≤ Subgroup.centralizer ↑H₂


@[simp]
theorem map_self (h : IsAdjoinRoot S f) : h.map f = 0

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
(h : IsAdjoinRoot S f)


theorem seminormAux_add_le (k n : ℕ) (f g : 𝓢(E, F)) :
    (f + g).seminormAux k n ≤ f.seminormAux k n + g.seminormAux k n

{E : Type u_4}
{F : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
(k n : ℕ)
(f g : SchwartzMap E F)

SchwartzMap.seminormAux k n (f + g) ≤ SchwartzMap.seminormAux k n f + SchwartzMap.seminormAux k n g


/-- A cocone extended by an isomorphism is isomorphic to the original cone. -/
@[simps]
def extendIso (s : Cocone F) {X : C} (f : s.pt ≅ X) : s ≅ s.extend f.hom

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

(CategoryTheory.Limits.Cocones.extendIso s f).hom.hom = f.hom


@[simp]
theorem mapAccumr₂_mapAccumr₂_left_left (f₁ : γ → α → σ₁ → σ₁ × φ) (f₂ : α → β → σ₂ → σ₂ × γ) :
    (mapAccumr₂ f₁ (mapAccumr₂ f₂ xs ys s₂).snd xs s₁)
    = let m := mapAccumr₂ (fun x y (s₁, s₂) =>
                let r₂ := f₂ x y s₂
                let r₁ := f₁ r₂.snd x s₁
                ((r₁.fst, r₂.fst), r₁.snd)
              )
            xs ys (s₁, s₂)
    (m.fst.fst, m.snd)

{α : Type}
{n : ℕ}
{β : Type}
(xs : Mathlib.Vector α n)
(ys : Mathlib.Vector β n)
{γ σ₁ φ σ₂ : Type}
{s₂ : σ₂}
{s₁ : σ₁}
(f₁ : γ → α → σ₁ → σ₁ × φ)
(f₂ : α → β → σ₂ → σ₂ × γ)

Mathlib.Vector.mapAccumr₂ f₁ (Mathlib.Vector.mapAccumr₂ f₂ xs ys s₂).2 xs s₁ =
  let m :=
    Mathlib.Vector.mapAccumr₂
      (fun x y x_1 =>
        match x_1 with
        | (s₁, s₂) =>
          let r₂ := f₂ x y s₂;
          let r₁ := f₁ r₂.2 x s₁;
          ((r₁.1, r₂.1), r₁.2))
      xs ys (s₁, s₂);
  (m.1.1, m.2)


theorem IsLittleO.mono (h : f =o[l'] g) (hl : l ≤ l') : f =o[l] g

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{f : α → E}
{g : α → F}
{l l' : Filter α}
(h : f =o[l'] g)
(hl : l ≤ l')


@[simp] theorem join_data {l : Array (Array α)} : l.join.data = (l.data.map data).join

l.join.data = (List.map Array.data l.data).join


lemma isGδ_iff_eq_iInter_nat {s : Set X} :
    IsGδ s ↔ ∃ (f : ℕ → Set X), (∀ n, IsOpen (f n)) ∧ s = ⋂ n, f n

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

IsGδ s ↔ ∃ f, (∀ (n : ℕ), IsOpen (f n)) ∧ s = ⋂ n, f n


lemma toFiniteAux_zero : Measure.toFiniteAux (0 : Measure α) = 0


@[simp] theorem replace_of_not_mem {l : List α} (h : !l.elem a) : l.replace a b = l

{α : Type u_1}
[BEq α]
{a b : α}
{l : List α}
(h : (!List.elem a l) = true)


lemma eventually_one_sub_smoothingFn_gt_const_real (c : ℝ) (hc : c < 1) :
    ∀ᶠ (x : ℝ) in atTop, c < 1 - ε x

∀ᶠ (x : ℝ) in Filter.atTop, c < 1 - AkraBazziRecurrence.smoothingFn x


theorem rev_involutive {n} : Function.Involutive (@rev n)


theorem mul_mem_left : b ∈ I → a * b ∈ I

{α : Type u}
[Semiring α]
(I : Ideal α)
(a : α)
{b : α}


theorem coeff_C_mul_X_pow (x : R) (k n : ℕ) :
    coeff R n (C R x * X ^ k : R⟦X⟧) = if n = k then x else 0

{R : Type u_1}
[Semiring R]
(x : R)
(k n : ℕ)

(PowerSeries.coeff R n) ((PowerSeries.C R) x * PowerSeries.X ^ k) = if n = k then x else 0


@[simp]
theorem power_zero {a : Cardinal} : a ^ (0 : Cardinal) = 1


theorem le_maxIdeal : spanEval k ≤ maxIdeal k

AlgebraicClosure.spanEval k ≤ AlgebraicClosure.maxIdeal k


@[to_additive]
lemma mulIndicator_le_self' (hf : ∀ x ∉ s, 1 ≤ f x) : mulIndicator s f ≤ f

{α : Type u_2}
{M : Type u_4}
[Preorder M]
[One M]
{s : Set α}
{f : α → M}
(hf : ∀ x ∉ s, 1 ≤ f x)


@[to_additive]
theorem CommMonoid.toMonoid_injective {M : Type u} :
    Function.Injective (@CommMonoid.toMonoid M)


theorem powerBasisAux'_repr_symm_apply (hg : g.Monic) (c : Fin g.natDegree →₀ R) :
    (powerBasisAux' hg).repr.symm c = mk g (∑ i : Fin _, monomial i (c i))

{R : Type u}
[CommRing R]
{g : R[X]}
(hg : g.Monic)
(c : Fin g.natDegree →₀ R)

(AdjoinRoot.powerBasisAux' hg).repr.symm c = (AdjoinRoot.mk g) (∑ i : Fin g.natDegree, (Polynomial.monomial ↑i) (c i))


@[simp]
theorem Trivialization.baseSet_continuousLinearMap :
    (e₁.continuousLinearMap σ e₂).baseSet = e₁.baseSet ∩ e₂.baseSet

(σ : 𝕜₁ →+* 𝕜₂)

[TopologicalSpace (Bundle.TotalSpace F₁ E₁)]

[TopologicalSpace (Bundle.TotalSpace F₂ E₂)]

{e₁ : Trivialization F₁ Bundle.TotalSpace.proj}

{e₂ : Trivialization F₂ Bundle.TotalSpace.proj}

(Trivialization.continuousLinearMap σ e₁ e₂).baseSet = e₁.baseSet ∩ e₂.baseSet


theorem measure_diff (h : s₂ ⊆ s₁) (h₂ : MeasurableSet s₂) (h_fin : μ s₂ ≠ ∞) :
    μ (s₁ \ s₂) = μ s₁ - μ s₂

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s₁ s₂ : Set α}
(h : s₂ ⊆ s₁)
(h₂ : MeasurableSet s₂)
(h_fin : μ s₂ ≠ ⊤)


theorem Algebra.ringChar_eq : ringChar K = ringChar L

(K : Type u_1)
(L : Type u_2)
[Field K]
[CommSemiring L]
[Nontrivial L]
[Algebra K L]


@[to_additive]
theorem Nonempty.of_smul_left : (s • t).Nonempty → s.Nonempty

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


protected theorem CPolynomialOn.continuousOn {s : Set E} (hf : CPolynomialOn 𝕜 f s) :
    ContinuousOn f s

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{s : Set E}
(hf : CPolynomialOn 𝕜 f s)


@[simp]
theorem filter_add [DecidablePred p] {v v' : α →₀ M} :
    (v + v').filter p = v.filter p + v'.filter p

{α : Type u_1}
{M : Type u_5}
[AddZeroClass M]
{p : α → Prop}
[DecidablePred p]
{v v' : α →₀ M}

Finsupp.filter p (v + v') = Finsupp.filter p v + Finsupp.filter p v'


theorem Perm.dedup {l₁ l₂ : List α} (p : l₁ ~ l₂) : dedup l₁ ~ dedup l₂

{α : Type u_1}
[DecidableEq α]
{l₁ l₂ : List α}
(p : l₁.Perm l₂)


/-- An open neighborhood of the identity in the cartesian product of two nonarchimedean groups
contains the cartesian product of an open neighborhood in each group. -/
@[to_additive NonarchimedeanAddGroup.prod_subset "An open neighborhood of the identity in
the cartesian product of two nonarchimedean groups contains the cartesian product of
an open neighborhood in each group."]
theorem prod_subset {U} (hU : U ∈ 𝓝 (1 : G × K)) :
    ∃ (V : OpenSubgroup G) (W : OpenSubgroup K), (V : Set G) ×ˢ (W : Set K) ⊆ U

{G : Type u_1}
[Group G]
[TopologicalSpace G]
[NonarchimedeanGroup G]
{K : Type u_3}
[Group K]
[TopologicalSpace K]
[NonarchimedeanGroup K]
{U : Set (G × K)}
(hU : U ∈ 𝓝 1)

∃ V W, ↑V ×ˢ ↑W ⊆ U


/-- The complex cosine function is everywhere strictly differentiable, with the derivative
`-sin x`. -/
theorem hasStrictDerivAt_cos (x : ℂ) : HasStrictDerivAt cos (-sin x) x

HasStrictDerivAt Complex.cos (-Complex.sin x) x


theorem ediam_range (hf : Isometry f) : EMetric.diam (range f) = EMetric.diam (univ : Set α)

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

EMetric.diam (Set.range f) = EMetric.diam Set.univ


/-- Auxiliary lemma for `eq_condKernel_of_measure_eq_compProd`.
Uniqueness of the disintegration kernel on ℝ. -/
lemma eq_condKernel_of_measure_eq_compProd_real {ρ : Measure (α × ℝ)} [IsFiniteMeasure ρ]
    (κ : Kernel α ℝ) [IsFiniteKernel κ] (hκ : ρ = ρ.fst ⊗ₘ κ) :
    ∀ᵐ x ∂ρ.fst, κ x = ρ.condKernel x

{α : Type u_1}
{mα : MeasurableSpace α}
{ρ : MeasureTheory.Measure (α × ℝ)}
[MeasureTheory.IsFiniteMeasure ρ]
(κ : ProbabilityTheory.Kernel α ℝ)
[ProbabilityTheory.IsFiniteKernel κ]
(hκ : ρ = ρ.fst ⊗ₘ κ)


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


/-- The increment partition has energy greater than the original one by a known fixed amount. -/
theorem energy_increment (hP : P.IsEquipartition) (hP₇ : 7 ≤ P.parts.card)
    (hPε : 100 ≤ 4 ^ P.parts.card * ε ^ 5) (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α)
    (hPG : ¬P.IsUniform G ε) (hε₀ : 0 ≤ ε) (hε₁ : ε ≤ 1) :
    ↑(P.energy G) + ε ^ 5 / 4 ≤ (increment hP G ε).energy G

(hPα : P.parts.card * 16 ^ P.parts.card ≤ Fintype.card α)

↑(P.energy G) + ε ^ 5 / 4 ≤ ↑((SzemerediRegularity.increment hP G ε).energy G)


@[simp]
theorem isInternal_ne_bot_iff {A : ι → Submodule R M} :
    IsInternal (fun i : {i // A i ≠ ⊥} ↦ A i) ↔ IsInternal A

{R : Type u}
[Ring R]
{ι : Type v}
[dec_ι : DecidableEq ι]
{M : Type u_1}
[AddCommGroup M]
[Module R M]
{A : ι → Submodule R M}

(DirectSum.IsInternal fun i => A ↑i) ↔ DirectSum.IsInternal A


theorem eq_of_indep_iff_indep_forall {M₁ M₂ : Matroid α} (hE : M₁.E = M₂.E)
    (h : ∀ I, I ⊆ M₁.E → (M₁.Indep I ↔ M₂.Indep I)) : M₁ = M₂

(h : ∀ I ⊆ M₁.E, M₁.Indep I ↔ M₂.Indep I)


/-- The morphisms in the category `SingleFunctors C D A` -/
@[ext]
structure Hom where
  /-- a family of natural transformations `F.functor a ⟶ G.functor a` -/
  hom (a : A) : F.functor a ⟶ G.functor a
  comm (n a a' : A) (ha' : n + a = a') : (F.shiftIso n a a' ha').hom ≫ hom a =
    whiskerRight (hom a') (shiftFunctor D n) ≫ (G.shiftIso n a a' ha').hom := by aesop_cat

{F G : CategoryTheory.SingleFunctors C D A}

(F.shiftIso n a a' ha').hom ≫ self.hom a =
  CategoryTheory.whiskerRight (self.hom a') (CategoryTheory.shiftFunctor D n) ≫ (G.shiftIso n a a' ha').hom


theorem gc_ceil_coe : GaloisConnection ceil ((↑) : ℤ → α)

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


theorem sub_ne_zero_of_lt : {a b : Nat} → a < b → b - a ≠ 0


theorem inf_mono {s₁ s₂ : Multiset α} (h : s₁ ⊆ s₂) : s₂.inf ≤ s₁.inf

{α : Type u_1}
[SemilatticeInf α]
[OrderTop α]
{s₁ s₂ : Multiset α}
(h : s₁ ⊆ s₂)


lemma measurable_density_right (κ : Kernel α (γ × β)) (ν : Kernel α γ)
    {s : Set β} (hs : MeasurableSet s) (a : α) :
    Measurable (fun x ↦ density κ ν a x s)

(κ : ProbabilityTheory.Kernel α (γ × β))


theorem uncountable_iff_forall_not_surjective [Nonempty α] :
    Uncountable α ↔ ∀ f : ℕ → α, ¬Surjective f

Uncountable α ↔ ∀ (f : ℕ → α), ¬Function.Surjective f


lemma Coprime.primeFactors_mul {a b : ℕ} (hab : Coprime a b) :
    (a * b).primeFactors = a.primeFactors ∪ b.primeFactors


@[to_additive]
protected lemma div_eq_div_iff (hb : IsUnit b) (hd : IsUnit d) :
    a / b = c / d ↔ a * d = c * b

{α : Type u}
[SubtractionCommMonoid α]
{a b c d : α}
(hb : IsAddUnit b)
(hd : IsAddUnit d)


theorem Perm.erase (a : α) {l₁ l₂ : List α} (p : l₁ ~ l₂) : l₁.erase a ~ l₂.erase a

{α : Type u_1}
[DecidableEq α]
(a : α)
{l₁ l₂ : List α}
(p : l₁ ~ l₂)


theorem card_le_of_injective (f : α → β) (hf : Function.Injective f) : card α ≤ card β

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
(f : α → β)
(hf : Function.Injective f)


theorem mem_inf_iff {f g : Filter α} {s : Set α} : s ∈ f ⊓ g ↔ ∃ t₁ ∈ f, ∃ t₂ ∈ g, s = t₁ ∩ t₂

{α : Type u}
{f g : Filter α}
{s : Set α}


@[simp]
theorem lie_sub : ⁅x, m - n⁆ = ⁅x, m⁆ - ⁅x, n⁆

{L : Type v}
{M : Type w}
[LieRing L]
[AddCommGroup M]
[LieRingModule L M]
(x : L)
(m n : M)


theorem map_strictMono_of_injective : StrictMono (map f)

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
{F : Type u_9}
[FunLike F M M₂]
[SemilinearMapClass F σ₁₂ M M₂]
[RingHomSurjective σ₁₂]
{f : F}
(hf : Function.Injective ⇑f)


protected lemma neg_mul (x y : EReal) : -x * y = -(x * y)


theorem Icc_ofDual (a b : αᵒᵈ) : Icc (ofDual a) (ofDual b) = (Icc b a).map ofDual.toEmbedding

{α : Type u_1}
[Preorder α]
[LocallyFiniteOrder α]
(a b : αᵒᵈ)

Finset.Icc (OrderDual.ofDual a) (OrderDual.ofDual b) = Finset.map OrderDual.ofDual.toEmbedding (Finset.Icc b a)


lemma isOpen_sInter : (∀ s ∈ S, IsOpen s) → IsOpen (⋂₀ S)

{α : Type u_3}
[TopologicalSpace α]
[AlexandrovDiscrete α]
{S : Set (Set α)}


theorem mirror_X : X.mirror = (X : R[X])


theorem mk_eq_divInt (num den nz c) : ⟨num, den, nz, c⟩ = num /. (den : Nat)

(num : Int)
(den : Nat)
(nz : den ≠ 0)
(c : num.natAbs.Coprime den)

{ num := num, den := den, den_nz := nz, reduced := c } = num /. ↑den


theorem eq_of_zero_eq_one (h : (0 : M₀) = 1) (a b : M₀) : a = b

{M₀ : Type u_2}
[MulZeroOneClass M₀]
(h : 0 = 1)
(a b : M₀)


theorem gronwallBound_x0 (δ K ε : ℝ) : gronwallBound δ K ε 0 = δ


nonrec theorem ContinuousWithinAt.inv₀ (hf : ContinuousWithinAt f s a) (ha : f a ≠ 0) :
    ContinuousWithinAt (fun x => (f x)⁻¹) s a

{α : Type u_1}
{G₀ : Type u_3}
[Zero G₀]
[Inv G₀]
[TopologicalSpace G₀]
[HasContinuousInv₀ G₀]
{f : α → G₀}
{s : Set α}
{a : α}
[TopologicalSpace α]
(hf : ContinuousWithinAt f s a)
(ha : f a ≠ 0)


private theorem candidates_dist_inr (fA : f ∈ candidates X Y) (x y : Y) :
    f (inr x, inr y) = dist x y

(fA : f ∈ GromovHausdorff.candidates X Y)


/-- The product of the composition of functions `f` and `g`, is the product over `b ∈ s.image g` of
`f b` to the power of the cardinality of the fibre of `b`. See also `Finset.prod_image`. -/
@[to_additive "The sum of the composition of functions `f` and `g`, is the sum over `b ∈ s.image g`
of `f b` times of the cardinality of the fibre of `b`. See also `Finset.sum_image`."]
theorem prod_comp [DecidableEq γ] (f : γ → β) (g : α → γ) :
    ∏ a ∈ s, f (g a) = ∏ b ∈ s.image g, f b ^ (s.filter fun a => g a = b).card

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
{s : Finset α}
[AddCommMonoid β]
[DecidableEq γ]
(f : γ → β)
(g : α → γ)

∑ a ∈ s, f (g a) = ∑ b ∈ Finset.image g s, (Finset.filter (fun a => g a = b) s).card • f b


@[simp] lemma _root_.finCongr_apply_mk (h : m = n) (k : ℕ) (hk : k < m) :
    finCongr h ⟨k, hk⟩ = ⟨k, h ▸ hk⟩


theorem subperm_append_right {l₁ l₂ : List α} (l) : l₁ ++ l <+~ l₂ ++ l ↔ l₁ <+~ l₂

{α : Type u_1}
{l₁ l₂ : List α}
(l : List α)


/-- The product of a strictly antitone function and an antitone function is strictly antitone. -/
@[to_additive add_antitone "The sum of a strictly antitone function and an antitone function is
strictly antitone."]
theorem StrictAnti.mul_antitone' (hf : StrictAnti f) (hg : Antitone g) :
    StrictAnti fun x => f x * g x

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

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


/-- The isomorphism `mapBifunctorMapObj F p X₁ Y₁ ≅ mapBifunctorMapObj F p X₂ Y₂`
induced by isomorphisms `X₁ ≅ X₂` and `Y₁ ≅ Y₂`. -/
@[simps]
noncomputable def mapBifunctorMapMapIso (e : X₁ ≅ X₂) (e' : Y₁ ≅ Y₂) :
    mapBifunctorMapObj F p X₁ Y₁ ≅ mapBifunctorMapObj F p X₂ Y₂

(F : CategoryTheory.Functor C₁ (CategoryTheory.Functor C₂ C₃))

{X₁ X₂ : CategoryTheory.GradedObject I C₁}

{Y₁ Y₂ : CategoryTheory.GradedObject J C₂}

[(((CategoryTheory.GradedObject.mapBifunctor F I J).obj X₁).obj Y₁).HasMap p]

[(((CategoryTheory.GradedObject.mapBifunctor F I J).obj X₂).obj Y₂).HasMap p]

(CategoryTheory.GradedObject.mapBifunctorMapMapIso F p e e').hom i =
  CategoryTheory.GradedObject.mapBifunctorMapMap F p e.hom e'.hom i


theorem comap_bracket_eq (hf₁ : f.ker = ⊥) (hf₂ : N₂ ≤ f.range) :
    comap f ⁅I, N₂⁆ = ⁅I, comap f N₂⁆

{R : Type u}
{L : Type v}
{M : Type w}
{M₂ : Type w₁}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[AddCommGroup M₂]
[Module R M₂]
[LieRingModule L M₂]
[LieModule R L M₂]
(I : LieIdeal R L)
(N₂ : LieSubmodule R L M₂)
(f : M →ₗ⁅R,L⁆ M₂)
(hf₁ : f.ker = ⊥)
(hf₂ : N₂ ≤ f.range)

LieSubmodule.comap f ⁅I, N₂⁆ = ⁅I, LieSubmodule.comap f N₂⁆


@[to_additive]
theorem toMonoidHom_injective : Injective (toMonoidHom : M ≃* N → M →* N)

{M : Type u_6}
{N : Type u_7}
[AddZeroClass M]
[AddZeroClass N]


@[simp] theorem inr_getRight : ∀ (x : α ⊕ β) (h : x.isRight), inr (x.getRight h) = x

{α : Type u_1}
{β : Type u_2}
(x : α ⊕ β)
(h : x.isRight = true)


@[simp] theorem finRotate_succ_apply (i : Fin (n + 1)) : finRotate (n + 1) i = i + 1


theorem map_comp (h1 : LEComap g B C) (h2 : LEComap f A B) :
    map (g.comp f) (h1.comp h2) = map g h1 ∘ map f h2

{X : Type u_2}
{Y : Type u_3}
{Z : Type u_4}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{f : C(X, Y)}
{A : DiscreteQuotient X}
{B : DiscreteQuotient Y}
{g : C(Y, Z)}
{C : DiscreteQuotient Z}
(h1 : DiscreteQuotient.LEComap g B C)
(h2 : DiscreteQuotient.LEComap f A B)

DiscreteQuotient.map (g.comp f) ⋯ = DiscreteQuotient.map g h1 ∘ DiscreteQuotient.map f h2


@[to_additive (attr := simp)]
theorem div_eq {x y : PUnit} : x / y = unit


protected theorem congr_fun {f g : LocallyConstant X Y} (h : f = g) (x : X) : f x = g x

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


theorem nonempty_of_ssubset (ht : s ⊂ t) : (t \ s).Nonempty


theorem ae_eq_trim_of_stronglyMeasurable [TopologicalSpace γ] [MetrizableSpace γ] (hm : m ≤ m0)
    {f g : β → γ} (hf : StronglyMeasurable[m] f) (hg : StronglyMeasurable[m] g)
    (hfg : f =ᵐ[μ] g) : f =ᵐ[μ.trim hm] g

(hf : MeasureTheory.StronglyMeasurable f)

(hg : MeasureTheory.StronglyMeasurable g)


theorem antitone_iterate_of_le_id (h : f ≤ id) : Antitone fun m => f^[m]

{α : Type u_1}
[Preorder α]
{f : α → α}
(h : f ≤ id)


theorem comap_coe_nhdsWithin_Iio_of_Ioo_subset (hb : s ⊆ Iio b)
    (hs : s.Nonempty → ∃ a < b, Ioo a b ⊆ s) : comap ((↑) : s → α) (𝓝[<] b) = atTop

(hs : s.Nonempty → ∃ a < b, Set.Ioo a b ⊆ s)

Filter.comap Subtype.val (𝓝[<] b) = Filter.atTop


@[simp]
theorem insertNth_apply_succAbove (i : Fin (n + 1)) (x : α i) (p : ∀ j, α (i.succAbove j))
    (j : Fin n) : insertNth i x p (i.succAbove j) = p j

{n : ℕ}
{α : Fin (n + 1) → Type u}
(i : Fin (n + 1))
(x : α i)
(p : (j : Fin n) → α (i.succAbove j))
(j : Fin n)


/-- `p → q → r ↔ p ∧ q → r` -/
@[simp]
theorem le_himp_iff : a ≤ b ⇨ c ↔ a ⊓ b ≤ c

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


theorem X_pow_add_C_ne_zero {n : ℕ} (hn : 0 < n) (a : R) : (X : R[X]) ^ n + C a ≠ 0

{R : Type u}
[Nontrivial R]
[Semiring R]
{n : ℕ}
(hn : 0 < n)
(a : R)


@[simp]
theorem lift_principal2 {f : Filter α} : f.lift 𝓟 = f


@[nontriviality]
theorem isConformalMap_of_subsingleton [Subsingleton M] (f' : M →L[R] N) : IsConformalMap f'

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[NormedField R]
[SeminormedAddCommGroup M]
[SeminormedAddCommGroup N]
[NormedSpace R M]
[NormedSpace R N]
[Subsingleton M]
(f' : M →L[R] N)


theorem join_join {x : Option (Option (Option α))} : x.join.join = (x.map join).join

{α : Type u_1}
{x : Option (Option (Option α))}

x.join.join = (Option.map Option.join x).join


theorem sq_ne_two_fin_zmod_four (z : ZMod 4) : z * z ≠ 2


theorem le_toNNReal_iff_coe_le' {r : ℝ≥0} {p : ℝ} (hr : 0 < r) : r ≤ Real.toNNReal p ↔ ↑r ≤ p


theorem adjointAux_inner (y : T.adjointDomain) (x : T.domain) :
    ⟪adjointAux hT y, x⟫ = ⟪(y : F), T x⟫

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
{T : E →ₗ.[𝕜] F}
(hT : Dense ↑T.domain)
[CompleteSpace E]
(y : ↥T.adjointDomain)
(x : ↥T.domain)

⟪(LinearPMap.adjointAux hT) y, ↑x⟫_𝕜 = ⟪↑y, ↑T x⟫_𝕜


/-- Given a right homology map data for morphism `φ`, this is the induced right homology
map data for `-φ`. -/
@[simps]
def neg : RightHomologyMapData (-φ) h₁ h₂

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


lemma IsCycle.three_le_length {v : V} {p : G.Walk v v} (hp : p.IsCycle) : 3 ≤ p.length

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


theorem term_eq {α : Type*} [AddCommMonoid α] (n : ℕ) (x a : α) : term n x a = n • x + a

{α : Type u_1}
[AddCommMonoid α]
(n : ℕ)
(x a : α)

Mathlib.Tactic.Abel.term n x a = n • x + a


@[simp]
theorem liftHom_id (a : FreeBicategory B) : liftHom F (𝟙 a) = 𝟙 (F.obj a)

CategoryTheory.FreeBicategory.liftHom F (CategoryTheory.CategoryStruct.id a) =
  CategoryTheory.CategoryStruct.id (F.obj a)


@[to_additive]
theorem tprod_eq_finprod (hf : (mulSupport f).Finite) :
    ∏' b, f b = ∏ᶠ b, f b

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
{f : β → α}
(hf : (Function.mulSupport f).Finite)


@[simp]
lemma coe_zero : (↑(0 : Cocycle F G n) : Cochain F G n) = 0

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
(F G : CochainComplex C ℤ)
(n : ℤ)


/-- If all elements of a `Finset` satisfy the predicate `p`, `s.filter p` is `s`. -/
theorem filter_true_of_mem (h : ∀ x ∈ s, p x) : s.filter p = s

{α : Type u_1}
{p : α → Prop}
[DecidablePred p]
{s : Finset α}
(h : ∀ x ∈ s, p x)


private theorem maxVar_bound : dist x y ≤ maxVar X Y

{X : Type u}
{Y : Type v}
[MetricSpace X]
[CompactSpace X]
[Nonempty X]
[MetricSpace Y]
[CompactSpace Y]
[Nonempty Y]
{x y : X ⊕ Y}

dist x y ≤ ↑(GromovHausdorff.maxVar X Y)


@[to_additive (attr := norm_cast)] -- Porting note (#10618): removed `simp`, `simp` can prove it
theorem coe_list_prod (l : List s) : (l.prod : M) = (l.map (↑)).prod

{M : Type u_1}
[Monoid M]
(s : Submonoid M)
(l : List ↥s)


@[simp]
theorem toIsometryEquiv_symm : e.toIsometryEquiv.symm = e.symm.toIsometryEquiv

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
{P : Type u_10}
{P₂ : Type u_11}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]
(e : P ≃ᵃⁱ[𝕜] P₂)


@[simp]
theorem union_right_iff {t'} :
    IsMetricSeparated s (t ∪ t') ↔ IsMetricSeparated s t ∧ IsMetricSeparated s t'

{X : Type u_1}
[EMetricSpace X]
{s t t' : Set X}


theorem lineMap_lt_left_iff_lt (h : 0 < r) : lineMap a b r < a ↔ b < a

{k : Type u_1}
{E : Type u_2}
[OrderedRing k]
[OrderedAddCommGroup E]
[Module k E]
[OrderedSMul k E]
{a b : E}
{r : k}
(h : 0 < r)


/-- In this version of the lemma, the inclusion homs `iUV` can be specified directly by the user,
which can be more convenient in practice.
-/
theorem eq_of_locally_eq' (V : Opens X) (iUV : ∀ i : ι, U i ⟶ V) (hcover : V ≤ iSup U)
    (s t : F.1.obj (op V)) (h : ∀ i, F.1.map (iUV i).op s = F.1.map (iUV i).op t) : s = t

(s t : (CategoryTheory.forget C).obj (F.val.obj (Opposite.op V)))

(h : ∀ (i : ι), (F.val.map (iUV i).op) s = (F.val.map (iUV i).op) t)


theorem isSepClosure_iff [Algebra k K] :
    IsSepClosure k K ↔ IsSepClosed K ∧ Algebra.IsSeparable k K

{k : Type u}
[Field k]
{K : Type v}
[Field K]
[Algebra k K]


/-- A morphism property satisfies `IsStableUnderComposition` if the composition of
two such morphisms still falls in the class. -/
class IsStableUnderComposition (P : MorphismProperty C) : Prop :=
  comp_mem {X Y Z} (f : X ⟶ Y) (g : Y ⟶ Z) : P f → P g → P (f ≫ g)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{P : CategoryTheory.MorphismProperty C}
[self : P.IsStableUnderComposition]
{X Y Z : C}
(f : X ⟶ Y)
(g : Y ⟶ Z)

P f → P g → P (CategoryTheory.CategoryStruct.comp f g)


@[simp] lemma land_eq_and (p q : PosNum) : p.land q = p &&& q


/-- The everywhere positive subset of a set is obtained by removing an open set. -/
lemma exists_isOpen_everywherePosSubset_eq_diff (μ : Measure α) (s : Set α) :
    ∃ u, IsOpen u ∧ μ.everywherePosSubset s = s \ u

{α : Type u_1}
[TopologicalSpace α]
[MeasurableSpace α]
(μ : MeasureTheory.Measure α)
(s : Set α)


/-- If `Irreducible (cyclotomic p K)` (in particular for `K = ℚ`) and `p` is an odd prime,
then the norm of `zeta p K L - 1` is `p`. -/
theorem norm_zeta_sub_one_of_prime_ne_two [Fact (p : ℕ).Prime]
    [IsCyclotomicExtension {p} K L] (hirr : Irreducible (cyclotomic p K)) (h : p ≠ 2) :
    norm K (zeta p K L - 1) = p

(hirr : Irreducible (Polynomial.cyclotomic (↑p) K))

(Algebra.norm K) (IsCyclotomicExtension.zeta p K L - 1) = ↑↑p


@[to_additive (attr := simp)]
lemma nndist_op (x y : α) : nndist (op x) (op y) = nndist x y

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

nndist (MulOpposite.op x) (MulOpposite.op y) = nndist x y


/-- If `a` does not belong to the finset `s`, then the `n`th symmetric power of `{a} ∪ s` is
  in 1-1 correspondence with the disjoint union of the `n - i`th symmetric powers of `s`,
  for `0 ≤ i ≤ n`. -/
@[simps]
def symInsertEquiv (h : a ∉ s) : (insert a s).sym n ≃ Σi : Fin (n + 1), s.sym (n - i)

↑((Finset.symInsertEquiv h).symm m) = Sym.fill a m.fst ↑m.snd


/-- For any two extended real numbers `a` and `b`, if both `a` and `b` are greater than `0`,
then their sum is also greater than `0`. -/
theorem add_pos {a b : EReal} (ha : 0 < a) (hb : 0 < b) : 0 < a + b


theorem norm_le_norm_of_ae_le {f : Lp E p μ} {g : Lp F p μ} (h : ∀ᵐ x ∂μ, ‖f x‖ ≤ ‖g x‖) :
    ‖f‖ ≤ ‖g‖

{α : Type u_1}
{E : Type u_2}
{F : Type u_3}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
{f : ↥(MeasureTheory.Lp E p μ)}
{g : ↥(MeasureTheory.Lp F p μ)}
(h : ∀ᵐ (x : α) ∂μ, ‖↑↑f x‖ ≤ ‖↑↑g x‖)


@[aesop safe apply (rule_sets := [SetLike])]
theorem smul_mem {c : 𝕜} {x : E} (hc : 0 < c) (hx : x ∈ S) : c • x ∈ S

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
(S : ConvexCone 𝕜 E)
{c : 𝕜}
{x : E}
(hc : 0 < c)
(hx : x ∈ S)


@[to_additive]
theorem card_pow_eq_card_pow_card_univ [∀ k : ℕ, DecidablePred (· ∈ S ^ k)] :
    ∀ k, Fintype.card G ≤ k → Fintype.card (↥(S ^ k)) = Fintype.card (↥(S ^ Fintype.card G))

[(k : ℕ) → DecidablePred fun x => x ∈ S ^ k]

Fintype.card G ≤ k → Fintype.card ↑(S ^ k) = Fintype.card ↑(S ^ Fintype.card G)


@[to_additive (attr := simp)]
theorem Step.cons_not {x b} : Red.Step ((x, b) :: (x, !b) :: L) L

{α : Type u}
{L : List (α × Bool)}
{x : α}
{b : Bool}

FreeAddGroup.Red.Step ((x, b) :: (x, !b) :: L) L


theorem inv_smul_integral_comp_div_sub (c d) :
    (c⁻¹ • ∫ x in a..b, f (x / c - d)) = ∫ x in a / c - d..b / c - d, f x

{E : Type u_3}
[NormedAddCommGroup E]
[CompleteSpace E]
[NormedSpace ℝ E]
{a b : ℝ}
(f : ℝ → E)
(c d : ℝ)

c⁻¹ • ∫ (x : ℝ) in a..b, f (x / c - d) = ∫ (x : ℝ) in a / c - d..b / c - d, f x


@[to_additive one_add_zsmul]
lemma zpow_one_add (a : G) (n : ℤ) : a ^ (1 + n) = a * a ^ n

{G : Type u_3}
[AddGroup G]
(a : G)
(n : ℤ)


lemma Embedding.isLocallyClosed_iff {s : Set X}
    {f : X → Y} (hf : Embedding f) :
    IsLocallyClosed s ↔ ∃ s' : Set Y, IsLocallyClosed s' ∧ s' ∩ range f = f '' s

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

IsLocallyClosed s ↔ ∃ s', IsLocallyClosed s' ∧ s' ∩ Set.range f = f '' s


theorem coe_injective : @Function.Injective (M ↪[L] N) (M → N) (↑)

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]


/-- Constructor for short complexes in `ModuleCat.{v} R` taking as inputs
linear maps `f` and `g` and the vanishing of their composition. -/
@[simps]
def moduleCatMk {X₁ X₂ X₃ : Type v} [AddCommGroup X₁] [AddCommGroup X₂] [AddCommGroup X₃]
    [Module R X₁] [Module R X₂] [Module R X₃] (f : X₁ →ₗ[R] X₂) (g : X₂ →ₗ[R] X₃)
    (hfg : g.comp f = 0) : ShortComplex (ModuleCat.{v} R)

{R : Type u}
[Ring R]
{X₁ X₂ X₃ : Type v}
[AddCommGroup X₁]
[AddCommGroup X₂]
[AddCommGroup X₃]
[Module R X₁]
[Module R X₂]
[Module R X₃]
(f : X₁ →ₗ[R] X₂)
(g : X₂ →ₗ[R] X₃)
(hfg : g ∘ₗ f = 0)

(CategoryTheory.ShortComplex.moduleCatMk f g hfg).f = ModuleCat.ofHom f


/-- If `f` is an integrable periodic function with period `T`, then its integral over `[t, s + T]`
is the sum of its integrals over the intervals `[t, s]` and `[t, t + T]`. -/
theorem intervalIntegral_add_eq_add (hf : Periodic f T) (t s : ℝ)
    (h_int : ∀ t₁ t₂, IntervalIntegrable f MeasureSpace.volume t₁ t₂) :
    ∫ x in t..s + T, f x = (∫ x in t..s, f x) + ∫ x in t..t + T, f x

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

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


theorem evenToNeg_comp_evenToNeg (Q' : QuadraticForm R M) (h : Q' = -Q) (h' : Q = -Q') :
    (evenToNeg Q' Q h').comp (evenToNeg Q Q' h) = AlgHom.id R _

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(Q Q' : QuadraticForm R M)
(h : Q' = -Q)
(h' : Q = -Q')

(CliffordAlgebra.evenToNeg Q' Q h').comp (CliffordAlgebra.evenToNeg Q Q' h) = AlgHom.id R ↥(CliffordAlgebra.even Q)


@[simp]
theorem finInsepDegree_bot' :
    finInsepDegree F (⊥ : IntermediateField E K) = finInsepDegree F E

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

Field.finInsepDegree F ↥⊥ = Field.finInsepDegree F E


@[simp, norm_cast]
theorem ofReal_cot (x : ℝ) : (Real.cot x : ℂ) = cot x


@[simp]
theorem coe_copy (f : TopHom α β) (f' : α → β) (h : f' = f) : ⇑(f.copy f' h) = f'

{α : Type u_2}
{β : Type u_3}
[Top α]
[Top β]
(f : TopHom α β)
(f' : α → β)
(h : f' = ⇑f)


theorem ContinuousLinearMap.contMDiff (L : E →L[𝕜] F) : ContMDiff 𝓘(𝕜, E) 𝓘(𝕜, F) n L

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_8}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}
(L : E →L[𝕜] F)


@[to_additive (attr := simp)]
lemma stabilizer_finset_empty : stabilizer G (∅ : Finset α) = ⊤

{G : Type u_1}
{α : Type u_3}
[Group G]
[MulAction G α]
[DecidableEq α]


/-- `Fintype.prod_equiv` is a specialization of `Finset.prod_bij` that
automatically fills in most arguments.

See `Equiv.prod_comp` for a version without `h`.
-/
@[to_additive "`Fintype.sum_equiv` is a specialization of `Finset.sum_bij` that
automatically fills in most arguments.

See `Equiv.sum_comp` for a version without `h`."]
lemma prod_equiv (e : ι ≃ κ) (f : ι → α) (g : κ → α) (h : ∀ x, f x = g (e x)) :
    ∏ x, f x = ∏ x, g x

{ι : Type u_6}
{κ : Type u_7}
{α : Type u_8}
[Fintype ι]
[Fintype κ]
[CommMonoid α]
(e : ι ≃ κ)
(f : ι → α)
(g : κ → α)
(h : ∀ (x : ι), f x = g (e x))


theorem fg_adjoin_of_finite {s : Set A} (hfs : s.Finite) (his : ∀ x ∈ s, IsIntegral R x) :
    (Algebra.adjoin R s).toSubmodule.FG

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[CommRing A]
[Algebra R A]
{s : Set A}
(hfs : s.Finite)
(his : ∀ x ∈ s, IsIntegral R x)

(Subalgebra.toSubmodule (Algebra.adjoin R s)).FG


@[simp]
theorem ideal_oper_maxTrivSubmodule_eq_bot (I : LieIdeal R L) :
    ⁅I, maxTrivSubmodule R L M⁆ = ⊥

(R : Type u)
(L : Type v)
(M : Type w)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(I : LieIdeal R L)

⁅I, LieModule.maxTrivSubmodule R L M⁆ = ⊥


@[mono]
theorem generateFrom_mono {s t : Set (Set α)} (h : s ⊆ t) : generateFrom s ≤ generateFrom t

{α : Type u_1}
{s t : Set (Set α)}
(h : s ⊆ t)

MeasurableSpace.generateFrom s ≤ MeasurableSpace.generateFrom t


/-- Composition with a ring homomorphism preserves the property of being a quadratic character. -/
theorem IsQuadratic.comp {χ : MulChar R R'} (hχ : χ.IsQuadratic) (f : R' →+* R'') :
    (χ.ringHomComp f).IsQuadratic

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


@[to_additive le_neg]
theorem le_inv' : a ≤ b⁻¹ ↔ b ≤ a⁻¹

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

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


theorem eq_or_ne {α : Sort*} (x y : α) : x = y ∨ x ≠ y


theorem continuous_extend : Continuous (pkg.extend f)

{α : Type u_1}
[UniformSpace α]
(pkg : AbstractCompletion α)
{β : Type u_2}
[UniformSpace β]
{f : α → β}
[CompleteSpace β]


lemma eventually_one_sub_smoothingFn_r_pos : ∀ᶠ (n : ℕ) in atTop, ∀ i, 0 < 1 - ε (r i n)

{α : Type u_1}
[Fintype α]
[Nonempty α]
{T : ℕ → ℝ}
{g : ℝ → ℝ}
{a b : α → ℝ}
{r : α → ℕ → ℕ}
(R : AkraBazziRecurrence T g a b r)

∀ᶠ (n : ℕ) in Filter.atTop, ∀ (i : α), 0 < 1 - AkraBazziRecurrence.smoothingFn ↑(r i n)


/-- A `Finpartition` constructor from a bigger existing finpartition. -/
@[simps]
def ofSubset {a b : α} (P : Finpartition a) {parts : Finset α} (subset : parts ⊆ P.parts)
    (sup_parts : parts.sup id = b) : Finpartition b

{α : Type u_1}
[Lattice α]
[OrderBot α]
{a b : α}
(P : Finpartition a)
{parts : Finset α}
(subset : parts ⊆ P.parts)
(sup_parts : parts.sup id = b)

(P.ofSubset subset sup_parts).parts = parts


/-- Shiftleft on successor with multiple moved to outside. -/
theorem shiftLeft_succ : ∀(m n), m <<< (n + 1) = 2 * (m <<< n)


lemma ContinuousWithinAt.finset_inf_apply
    (hs : ∀ i ∈ s, ContinuousWithinAt (f i) t x) :
    ContinuousWithinAt (fun a ↦ s.inf (f · a)) t x

ContinuousWithinAt (fun a => s.inf fun x => f x a) t x


lemma intCast_mul_self : Commute ((n : α) * a) a


theorem preimage_coe_eq_preimage_coe_iff {s t u : Set α} :
    ((↑) : s → α) ⁻¹' t = ((↑) : s → α) ⁻¹' u ↔ s ∩ t = s ∩ u

Subtype.val ⁻¹' t = Subtype.val ⁻¹' u ↔ s ∩ t = s ∩ u


lemma eval_polynomialY (P : Fin 3 → R) :
    eval P W.polynomialY = 2 * P y * P z + W.a₁ * P x * P z + W.a₃ * P z ^ 2

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Projective R)
(P : Fin 3 → R)

(MvPolynomial.eval P) W.polynomialY = 2 * P 1 * P 2 + W.a₁ * P 0 * P 2 + W.a₃ * P 2 ^ 2


@[simp]
theorem id_apply (a : α) : ContinuousOrderHom.id α a = a

{α : Type u_2}
[TopologicalSpace α]
[Preorder α]
(a : α)


@[simp]
theorem kroneckerMap_zero_left [Zero α] [Zero γ] (f : α → β → γ) (hf : ∀ b, f 0 b = 0)
    (B : Matrix n p β) : kroneckerMap f (0 : Matrix l m α) B = 0

{α : Type u_2}
{β : Type u_4}
{γ : Type u_6}
{l : Type u_8}
{m : Type u_9}
{n : Type u_10}
{p : Type u_11}
[Zero α]
[Zero γ]
(f : α → β → γ)
(hf : ∀ (b : β), f 0 b = 0)
(B : Matrix n p β)


theorem finish_isSpecial (hs : u.IsSpecial) : u.finish.IsSpecial


theorem le_iff_forall_rat_lt_imp_le : x ≤ y ↔ ∀ q : ℚ, (q : α) < x → (q : α) ≤ y

{α : Type u_1}
[LinearOrderedField α]
[Archimedean α]
{x y : α}


lemma UniformConvexOn.strictConvexOn (hf : UniformConvexOn s φ f) (hφ : ∀ r, r ≠ 0 → 0 < φ r) :
    StrictConvexOn ℝ s f

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{φ : ℝ → ℝ}
{s : Set E}
{f : E → ℝ}
(hf : UniformConvexOn s φ f)
(hφ : ∀ (r : ℝ), r ≠ 0 → 0 < φ r)


@[to_additive (attr := simp) cmp_add_left]
theorem cmp_mul_left' {α : Type*} [Mul α] [LinearOrder α] [CovariantClass α α (· * ·) (· < ·)]
    (a b c : α) :
    cmp (a * b) (a * c) = cmp b c

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


@[to_additive (attr := simp)]
theorem comap_id (S : Subsemigroup P) : S.comap (MulHom.id _) = S

{P : Type u_3}
[Add P]
(S : AddSubsemigroup P)

AddSubsemigroup.comap (AddHom.id P) S = S


theorem mem_compl_of_ge {x y : P} : x ≤ y → x ∈ (I : Set P)ᶜ → y ∈ (I : Set P)ᶜ

{P : Type u_1}
[LE P]
{I : Order.Ideal P}
{x y : P}


/-- Construct a left adjoint functor to `G`, given the functor's value on objects `F_obj` and
a bijection `e` between `F_obj X ⟶ Y` and `X ⟶ G.obj Y` satisfying a naturality law
`he : ∀ X Y Y' g h, e X Y' (h ≫ g) = e X Y h ≫ G.map g`.
Dual to `rightAdjointOfEquiv`. -/
@[simps!]
def leftAdjointOfEquiv (he : ∀ X Y Y' g h, e X Y' (h ≫ g) = e X Y h ≫ G.map g) : C ⥤ D

(e : (X : C) → (Y : D) → (F_obj X ⟶ Y) ≃ (X ⟶ G.obj Y))

(he :
  ∀ (X : C) (Y Y' : D) (g : Y ⟶ Y') (h : F_obj X ⟶ Y),
    (e X Y') (CategoryTheory.CategoryStruct.comp h g) = CategoryTheory.CategoryStruct.comp ((e X Y) h) (G.map g))

∀ (a : C), (CategoryTheory.Adjunction.leftAdjointOfEquiv e he).obj a = F_obj a


theorem trace_fin_two (A : Matrix (Fin 2) (Fin 2) R) : trace A = A 0 0 + A 1 1

{R : Type u_6}
[AddCommMonoid R]
(A : Matrix (Fin 2) (Fin 2) R)


@[simp]
theorem rescale_one : rescale 1 = RingHom.id R⟦X⟧

PowerSeries.rescale 1 = RingHom.id (PowerSeries R)


@[to_additive]
theorem Subgroup.pow_exponent_eq_one {H : Subgroup G} {g : G} (g_in_H : g ∈ H) :
    g ^ Monoid.exponent H = 1

{G : Type u}
[Group G]
{H : Subgroup G}
{g : G}
(g_in_H : g ∈ H)


@[simp]
theorem cof_univ : cof univ.{u, v} = Cardinal.univ.{u, v}

Ordinal.univ.{u, v}.cof = Cardinal.univ.{u, v}


/-- A mono factorisation of `f ≫ g`, where `g` is an isomorphism,
gives a mono factorisation of `f`. -/
@[simps]
def ofCompIso {Y' : C} {g : Y ⟶ Y'} [IsIso g] (F : MonoFactorisation (f ≫ g)) :
    MonoFactorisation f

(F : CategoryTheory.Limits.MonoFactorisation (f ≫ g))


lemma support_smul [Zero R] [Zero M] [SMulWithZero R M] [NoZeroSMulDivisors R M] (f : α → R)
    (g : α → M) : support (f • g) = support f ∩ support g

{α : Type u_1}
{R : Type u_2}
{M : Type u_3}
[Zero R]
[Zero M]
[SMulWithZero R M]
[NoZeroSMulDivisors R M]
(f : α → R)
(g : α → M)

Function.support (f • g) = Function.support f ∩ Function.support g


@[to_additive relindex_mul_index]
theorem relindex_mul_index (h : H ≤ K) : H.relindex K * K.index = H.index

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


lemma polyCharpoly_coeff_isHomogeneous (i j : ℕ) (hij : i + j = finrank R M) [Nontrivial R] :
    ((polyCharpoly φ b).coeff i).IsHomogeneous j

(hij : i + j = FiniteDimensional.finrank R M)

((φ.polyCharpoly b).coeff i).IsHomogeneous j


theorem LinearIndependent.sum_elim_of_quotient
    {M' : Submodule R M} {ι₁ ι₂} {f : ι₁ → M'} (hf : LinearIndependent R f) (g : ι₂ → M)
    (hg : LinearIndependent R (Submodule.Quotient.mk (p := M') ∘ g)) :
      LinearIndependent R (Sum.elim (f · : ι₁ → M) g)

(hg : LinearIndependent R (Submodule.Quotient.mk ∘ g))

LinearIndependent R (Sum.elim (fun x => ↑(f x)) g)


theorem exists_eq_pow_of_mul_eq_pow [GCDMonoid α] [Unique αˣ] {a b c : α} (hab : IsUnit (gcd a b))
    {k : ℕ} (h : a * b = c ^ k) : ∃ d : α, a = d ^ k

{α : Type u_1}
[CancelCommMonoidWithZero α]
[GCDMonoid α]
[Unique αˣ]
{a b c : α}
(hab : IsUnit (gcd a b))
{k : ℕ}
(h : a * b = c ^ k)


@[simp]
theorem prodEquivOfIsCompl_symm_apply_fst_eq_zero (h : IsCompl p q) {x : E} :
    ((prodEquivOfIsCompl p q h).symm x).1 = 0 ↔ x ∈ q

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
(p q : Submodule R E)
(h : IsCompl p q)
{x : E}

((p.prodEquivOfIsCompl q h).symm x).1 = 0 ↔ x ∈ q


@[to_additive (attr := simp, norm_cast)]
theorem inv_coe_set [InvolutiveInv G] [SetLike S G] [InvMemClass S G] {H : S} : (H : Set G)⁻¹ = H

{G : Type u_2}
{S : Type u_4}
[InvolutiveNeg G]
[SetLike S G]
[NegMemClass S G]
{H : S}


theorem Subsingleton.anti (ht : t.Subsingleton) (hst : s ⊆ t) : s.Subsingleton

{α : Type u}
{s t : Set α}
(ht : t.Subsingleton)
(hst : s ⊆ t)


lemma le_schnirelmannDensity_iff {x : ℝ} :
    x ≤ schnirelmannDensity A ↔ ∀ n : ℕ, 0 < n → x ≤ ((Ioc 0 n).filter (· ∈ A)).card / n

{A : Set ℕ}
[DecidablePred fun x => x ∈ A]
{x : ℝ}

x ≤ schnirelmannDensity A ↔ ∀ (n : ℕ), 0 < n → x ≤ ↑(Finset.filter (fun x => x ∈ A) (Finset.Ioc 0 n)).card / ↑n


/-- A series of non-negative real numbers converges to `r` in the sense of `HasSum` if and only if
the sequence of partial sum converges to `r`. -/
theorem hasSum_iff_tendsto_nat_of_nonneg {f : ℕ → ℝ} (hf : ∀ i, 0 ≤ f i) (r : ℝ) :
    HasSum f r ↔ Tendsto (fun n : ℕ => ∑ i ∈ Finset.range n, f i) atTop (𝓝 r)

{f : ℕ → ℝ}
(hf : ∀ (i : ℕ), 0 ≤ f i)
(r : ℝ)

HasSum f r ↔ Filter.Tendsto (fun n => ∑ i ∈ Finset.range n, f i) Filter.atTop (𝓝 r)


theorem getElem!_of_getElem? [Inhabited α] : ∀ {l : List α} {n : Nat}, l[n]? = some a → l[n]! = a

{α : Type u_1}
{a : α}
[Inhabited α]
{l : List α}
{n : Nat}


theorem isGLB_l {a : α} : IsGLB { b | a ≤ u b } (l a)

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)
{a : α}


@[simp]
theorem liftAux_eq (f : X → A) : liftAux R f = lift R f

(R : Type u_1)
[CommSemiring R]
{X : Type u_2}
{A : Type u_3}
[Semiring A]
[Algebra R A]
(f : X → A)

FreeAlgebra.liftAux R f = (FreeAlgebra.lift R) f


/-- Whisker a cocone by precomposition of a functor. See `whiskering` for a functorial
version.
-/
@[simps]
def whisker (E : K ⥤ J) (c : Cocone F) : Cocone (E ⋙ F)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{K : Type u₂}
[CategoryTheory.Category.{v₂, u₂} K]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
(E : K ⥤ J)
(c : CategoryTheory.Limits.Cocone F)

(CategoryTheory.Limits.Cocone.whisker E c).ι = CategoryTheory.whiskerLeft E c.ι


@[to_additive (attr := simp)]
theorem coe_pureMulHom : (pureMulHom : α → Filter α) = pure


@[simp]
theorem coe_comp_continuousMap' (f : SpectralMap β γ) (g : SpectralMap α β) :
    (f.comp g : ContinuousMap α γ) = (f : ContinuousMap β γ).comp g

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
(f : SpectralMap β γ)
(g : SpectralMap α β)


theorem isRelPrime_mul_unit_right : IsRelPrime (y * x) (z * x) ↔ IsRelPrime y z

{α : Type u_1}
[CommMonoid α]
{x y z : α}
(hu : IsUnit x)


@[to_additive]
lemma ofUnits_right_inverse :
    Function.RightInverse (ofUnits (M := M)) (Submonoid.units (M := M))


@[simp]
theorem one_dotProduct_one : (1 : n → α) ⬝ᵥ 1 = Fintype.card n

{n : Type u_3}
{α : Type v}
[Fintype n]
[NonAssocSemiring α]


/-- A version of `Finsupp.sum_smul_index'` for bundled additive maps. -/
theorem sum_smul_index_addMonoidHom [AddMonoid M] [AddCommMonoid N] [DistribSMul R M] {g : α →₀ M}
    {b : R} {h : α → M →+ N} : ((b • g).sum fun a => h a) = g.sum fun i c => h i (b • c)

{α : Type u_1}
{M : Type u_5}
{N : Type u_7}
{R : Type u_11}
[AddMonoid M]
[AddCommMonoid N]
[DistribSMul R M]
{g : α →₀ M}
{b : R}
{h : α → M →+ N}

((b • g).sum fun a => ⇑(h a)) = g.sum fun i c => (h i) (b • c)


/-- Being Lipschitz on a set is monotone w.r.t. that set. -/
theorem LipschitzOnWith.mono (hf : LipschitzOnWith K f t) (h : s ⊆ t) : LipschitzOnWith K f s

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{K : ℝ≥0}
{s t : Set α}
{f : α → β}
(hf : LipschitzOnWith K f t)
(h : s ⊆ t)


theorem repr_support_subset_of_mem_span (s : Set ι) {m : M}
    (hm : m ∈ span R (b '' s)) : ↑(b.repr m).support ⊆ s

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(b : Basis ι R M)
(s : Set ι)
{m : M}
(hm : m ∈ Submodule.span R (⇑b '' s))


/--
Given `n+1` objects of `C`, a fan for the last `n` with point `c₁.pt` and
a binary fan on `c₁.pt` and `f 0`, we can build a fan for all `n+1`.

In `extendFanIsLimit` we show that if the two given fans are limits, then this fan is also a
limit.
-/
@[simps!] -- Porting note: removed semi-reducible config
def extendFan {n : ℕ} {f : Fin (n + 1) → C} (c₁ : Fan fun i : Fin n => f i.succ)
    (c₂ : BinaryFan (f 0) c₁.pt) : Fan f

(c₁ : CategoryTheory.Limits.Fan fun i => f i.succ)

(c₂ : CategoryTheory.Limits.BinaryFan (f 0) c₁.pt)

(X : CategoryTheory.Discrete (Fin (n + 1)))

(CategoryTheory.extendFan c₁ c₂).π.app X = Fin.cases c₂.fst (fun i => c₂.snd ≫ c₁.π.app { as := i }) X.as


theorem univ_map_equiv_to_embedding {α β : Type*} [Fintype α] [Fintype β] (e : α ≃ β) :
    univ.map e.toEmbedding = univ

{α : Type u_4}
{β : Type u_5}
[Fintype α]
[Fintype β]
(e : α ≃ β)

Finset.map e.toEmbedding Finset.univ = Finset.univ


@[to_additive]
theorem div_le_div_flip {α : Type*} [CommGroup α] [LinearOrder α]
    [CovariantClass α α (· * ·) (· ≤ ·)] {a b : α} : a / b ≤ b / a ↔ a ≤ b

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


theorem embedding_pullback_to_prod {X Y Z : TopCat.{u}} (f : X ⟶ Z) (g : Y ⟶ Z) :
    Embedding <| ⇑(prod.lift (pullback.fst f g) (pullback.snd f g))

{X Y Z : TopCat}
(f : X ⟶ Z)
(g : Y ⟶ Z)

Embedding
  ⇑(CategoryTheory.Limits.prod.lift (CategoryTheory.Limits.pullback.fst f g) (CategoryTheory.Limits.pullback.snd f g))


@[to_additive]
theorem le_or_lt_of_mul_le_mul [CovariantClass α α (· * ·) (· ≤ ·)]
    [CovariantClass α α (Function.swap (· * ·)) (· < ·)] {a₁ a₂ b₁ b₂ : α} :
    a₁ * b₁ ≤ a₂ * b₂ → a₁ ≤ a₂ ∨ b₁ < b₂

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

a₁ + b₁ ≤ a₂ + b₂ → a₁ ≤ a₂ ∨ b₁ < b₂


theorem join_map_join (μ : Measure (Measure (Measure α))) : join (map join μ) = join (join μ)

(μ : MeasureTheory.Measure (MeasureTheory.Measure (MeasureTheory.Measure α)))

(MeasureTheory.Measure.map MeasureTheory.Measure.join μ).join = μ.join.join


@[simp]
theorem iInter_iInter_eq_right {b : β} {s : ∀ x : β, b = x → Set α} :
    ⋂ (x) (h : b = x), s x h = s b rfl

{α : Type u_1}
{β : Type u_2}
{b : β}
{s : (x : β) → b = x → Set α}


@[simp]
theorem span_singleton_eq_top {x} : span ({x} : Set α) = ⊤ ↔ IsUnit x


protected theorem add_mem (h₁ : x ∈ p) (h₂ : y ∈ p) : x + y ∈ p

{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
{module_M : Module R M}
(p : Submodule R M)
{x y : M}
(h₁ : x ∈ p)
(h₂ : y ∈ p)


/-- An `AddRightCancelSemigroup` is an additive semigroup such that
`a + b = c + b` implies `a = c`. -/
@[ext]
class AddRightCancelSemigroup (G : Type u) extends AddSemigroup G where
  protected add_right_cancel : ∀ a b c : G, a + b = c + b → a = c

{G : Type u}
[self : AddRightCancelSemigroup G]
(a b c : G)


theorem isLUB_lt_iff (ha : IsLUB s a) : a < b ↔ ∃ c ∈ upperBounds s, c < b

{α : Type u}
[Preorder α]
{s : Set α}
{a b : α}
(ha : IsLUB s a)


@[fun_prop, aesop safe 50 (rule_sets := [Measurable])]
protected theorem Measurable.comp' {_ : MeasurableSpace α} {_ : MeasurableSpace β}
    {_ : MeasurableSpace γ} {g : β → γ} {f : α → β} (hg : Measurable g) (hf : Measurable f) :
    Measurable (fun x => g (f x))

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}

∀ {x : MeasurableSpace α} {x_1 : MeasurableSpace β} {x_2 : MeasurableSpace γ} {g : β → γ} {f : α → β},
  Measurable g → Measurable f → Measurable fun x => g (f x)


theorem exists_frobenius_solution_fractionRing_aux (m n : ℕ) (r' q' : 𝕎 k) (hr' : r'.coeff 0 ≠ 0)
    (hq' : q'.coeff 0 ≠ 0) (hq : (p : 𝕎 k) ^ n * q' ∈ nonZeroDivisors (𝕎 k)) :
    let b : 𝕎 k := frobeniusRotation p hr' hq'
    IsFractionRing.fieldEquivOfRingEquiv (frobeniusEquiv p k)
          (algebraMap (𝕎 k) (FractionRing (𝕎 k)) b) *
        Localization.mk ((p : 𝕎 k) ^ m * r') ⟨(p : 𝕎 k) ^ n * q', hq⟩ =
      (p : Localization (nonZeroDivisors (𝕎 k))) ^ (m - n : ℤ) *
        algebraMap (𝕎 k) (FractionRing (𝕎 k)) b

(hq : ↑p ^ n * q' ∈ nonZeroDivisors (WittVector p k))

let b := WittVector.frobeniusRotation p hr' hq';
(IsFractionRing.fieldEquivOfRingEquiv (WittVector.frobeniusEquiv p k))
      ((algebraMap (WittVector p k) (FractionRing (WittVector p k))) b) *
    Localization.mk (↑p ^ m * r') ⟨↑p ^ n * q', hq⟩ =
  ↑p ^ (↑m - ↑n) * (algebraMap (WittVector p k) (FractionRing (WittVector p k))) b


theorem surjective_tail : Surjective (@tail α)


theorem fderivWithin_smul (hxs : UniqueDiffWithinAt 𝕜 s x) (hc : DifferentiableWithinAt 𝕜 c s x)
    (hf : DifferentiableWithinAt 𝕜 f s x) :
    fderivWithin 𝕜 (fun y => c y • f y) s x =
      c x • fderivWithin 𝕜 f s x + (fderivWithin 𝕜 c s x).smulRight (f x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{s : Set E}
{𝕜' : Type u_6}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{c : E → 𝕜'}
(hxs : UniqueDiffWithinAt 𝕜 s x)
(hc : DifferentiableWithinAt 𝕜 c s x)
(hf : DifferentiableWithinAt 𝕜 f s x)


lemma Pi.uniformSpace_eq :
    Pi.uniformSpace α = ⨅ i, UniformSpace.comap (eval i) (U i)

{ι : Type u_1}
(α : ι → Type u)
[U : (i : ι) → UniformSpace (α i)]

Pi.uniformSpace α = ⨅ i, UniformSpace.comap (Function.eval i) (U i)


theorem Nonempty.eq_zero [Subsingleton α] [Zero α] {s : Set α} (h : s.Nonempty) :
    s = {0}

{α : Type u}
[Subsingleton α]
[Zero α]
{s : Set α}
(h : s.Nonempty)


theorem _root_.Dense.exists_dist_lt {s : Set α} (hs : Dense s) (x : α) {ε : ℝ} (hε : 0 < ε) :
    ∃ y ∈ s, dist x y < ε

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
(hs : Dense s)
(x : α)
{ε : ℝ}
(hε : 0 < ε)


/-- The divisors of a product of natural numbers are the pointwise product of the divisors of the
factors. -/
lemma Nat.divisors_mul (m n : ℕ) : divisors (m * n) = divisors m * divisors n

(m * n).divisors = m.divisors * n.divisors


theorem IsUnit.smul_sub_iff_sub_inv_smul [AddGroup β] [DistribMulAction α β] [IsScalarTower α β β]
    [SMulCommClass α β β] (r : α) (a : β) : IsUnit (r • (1 : β) - a) ↔ IsUnit (1 - r⁻¹ • a)

{α : Type u}
{β : Type v}
[Group α]
[Monoid β]
[AddGroup β]
[DistribMulAction α β]
[IsScalarTower α β β]
[SMulCommClass α β β]
(r : α)
(a : β)

IsUnit (r • 1 - a) ↔ IsUnit (1 - r⁻¹ • a)


@[simp]
theorem Tape.mk'_head {Γ} [Inhabited Γ] (L R : ListBlank Γ) : (Tape.mk' L R).head = R.head

{Γ : Type u_1}
[Inhabited Γ]
(L R : Turing.ListBlank Γ)


lemma IsHamiltonian.mono {H : SimpleGraph α} (hGH : G ≤ H) (hG : G.IsHamiltonian) :
    H.IsHamiltonian

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{G H : SimpleGraph α}
(hGH : G ≤ H)
(hG : G.IsHamiltonian)


protected theorem pos_iff_ne_zero : 0 < n ↔ n ≠ 0


/-- Members of the `α`-chain through `β` are the only roots of the form `β - kα`. -/
lemma rootSpace_zsmul_add_ne_bot_iff (n : ℤ) :
    rootSpace H (n • α + β) ≠ ⊥ ↔ n ≤ chainTopCoeff α β ∧ -n ≤ chainBotCoeff α β

{K : Type u_1}
{L : Type u_2}
[Field K]
[CharZero K]
[LieRing L]
[LieAlgebra K L]
[LieAlgebra.IsKilling K L]
[FiniteDimensional K L]
{H : LieSubalgebra K L}
[H.IsCartanSubalgebra]
[LieModule.IsTriangularizable K (↥H) L]
(α β : LieModule.Weight K (↥H) L)
(hα : α.IsNonZero)
(n : ℤ)

LieAlgebra.rootSpace H (n • ⇑α + ⇑β) ≠ ⊥ ↔
  n ≤ ↑(LieModule.chainTopCoeff (⇑α) β) ∧ -n ≤ ↑(LieModule.chainBotCoeff (⇑α) β)


theorem smul_integral_comp_add_mul (c d) :
    (c • ∫ x in a..b, f (d + c * x)) = ∫ x in d + c * a..d + c * b, f x

{E : Type u_3}
[NormedAddCommGroup E]
[CompleteSpace E]
[NormedSpace ℝ E]
{a b : ℝ}
(f : ℝ → E)
(c d : ℝ)

c • ∫ (x : ℝ) in a..b, f (d + c * x) = ∫ (x : ℝ) in d + c * a..d + c * b, f x


/-- To put word in the HNN Extension into a normal form, we must choose an element of each right
coset of both `A` and `B`, such that the chosen element of the subgroup itself is `1`. -/
structure TransversalPair : Type _ :=
  /-- The transversal of each subgroup -/
  set : ℤˣ → Set G
  /-- We have exactly one element of each coset of the subgroup -/
  compl : ∀ u, IsComplement (toSubgroup A B u : Subgroup G) (set u)

(self : HNNExtension.NormalWord.TransversalPair G A B)

Subgroup.IsComplement (↑(HNNExtension.toSubgroup A B u)) (self.set u)


@[simp]
theorem irrational_add_nat_iff : Irrational (x + n) ↔ Irrational x


theorem embDomain_injective (f : α ↪ β) : Function.Injective (embDomain f : (α →₀ M) → β →₀ M)

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[Zero M]
(f : α ↪ β)


theorem ContinuousAt.restrict {f : X → Y} {s : Set X} {t : Set Y} (h1 : MapsTo f s t) {x : s}
    (h2 : ContinuousAt f x) : ContinuousAt (h1.restrict f s t) x

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
{s : Set X}
{t : Set Y}
(h1 : Set.MapsTo f s t)
{x : ↑s}
(h2 : ContinuousAt f ↑x)

ContinuousAt (Set.MapsTo.restrict f s t h1) x


theorem not_mem_Ioc_of_le (ha : c ≤ a) : c ∉ Ioc a b

{α : Type u_1}
[Preorder α]
{a b c : α}
(ha : c ≤ a)


@[simp]
theorem coe_mk (f : α →*₀ β) (h) : (OrderMonoidWithZeroHom.mk f h : α → β) = f

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
[MulZeroOneClass α]
[MulZeroOneClass β]
(f : α →*₀ β)
(h : Monotone (↑f).toFun)

⇑{ toMonoidWithZeroHom := f, monotone' := h } = ⇑f


@[simp]
theorem withTopWithBot_comp (f : LatticeHom β γ) (g : LatticeHom α β) :
    (f.comp g).withTopWithBot = f.withTopWithBot.comp g.withTopWithBot

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


@[simp] theorem reverse_data (a : Array α) : a.reverse.data = a.data.reverse


/-- In a linear ordered field, for positive `a` and `b` we have `a⁻¹ < b ↔ b⁻¹ < a`.
See also `inv_lt_of_inv_lt` for a one-sided implication with one fewer assumption. -/
theorem inv_lt (ha : 0 < a) (hb : 0 < b) : a⁻¹ < b ↔ b⁻¹ < a

{α : Type u_2}
[LinearOrderedSemifield α]
{a b : α}
(ha : 0 < a)
(hb : 0 < b)


private theorem asiegel_remark : ‖asiegel K a‖ ≤ c₂ K * A

(a : Matrix α β (NumberField.RingOfIntegers K))

(habs : ∀ (k : α) (l : β), NumberField.house ((algebraMap (NumberField.RingOfIntegers K) K) (a k l)) ≤ A)

‖NumberField.house.asiegel K a‖ ≤ NumberField.house.c₂ K * A


/-- **Chernoff bound** on the lower tail of a real random variable. -/
theorem measure_le_le_exp_mul_mgf [IsFiniteMeasure μ] (ε : ℝ) (ht : t ≤ 0)
    (h_int : Integrable (fun ω => exp (t * X ω)) μ) :
    (μ {ω | X ω ≤ ε}).toReal ≤ exp (-t * ε) * mgf X μ t

(h_int : MeasureTheory.Integrable (fun ω => rexp (t * X ω)) μ)

(μ {ω | X ω ≤ ε}).toReal ≤ rexp (-t * ε) * ProbabilityTheory.mgf X μ t


theorem le_lim {f : CauSeq α abs} {x : α} (h : CauSeq.const abs x ≤ f) : x ≤ lim f

{α : Type u_1}
[LinearOrderedField α]
[CauSeq.IsComplete α abs]
{f : CauSeq α abs}
{x : α}
(h : CauSeq.const abs x ≤ f)


/-- The strictly positive cone of an ordered module is always blunt. -/
theorem blunt_strictlyPositive : Blunt (strictlyPositive 𝕜 E)

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


theorem MDifferentiableWithinAt.mfderivWithin_congr_mono (h : MDifferentiableWithinAt I I' f s x)
    (hs : ∀ x ∈ t, f₁ x = f x) (hx : f₁ x = f x) (hxt : UniqueMDiffWithinAt I t x) (h₁ : t ⊆ s) :
    mfderivWithin I I' f₁ t x = (mfderivWithin I I' f s x : _)

mfderivWithin I I' f₁ t x = mfderivWithin I I' f s x


@[to_additive]
theorem ext_iff₂ {_ : MulOneClass M} {_ : MulOneClass N} {_ : CommMonoid P} {f g : M →* N →* P} :
    f = g ↔ ∀ x y, f x y = g x y

{M : Type uM}
{N : Type uN}
{P : Type uP}

∀ {x : MulOneClass M} {x_1 : MulOneClass N} {x_2 : CommMonoid P} {f g : M →* N →* P},
  f = g ↔ ∀ (x_3 : M) (y : N), (f x_3) y = (g x_3) y


@[simp]
theorem SlashAction.smul_slash_of_tower {R β G α : Type*} (γ : Type*) [Group G] [AddGroup α]
    [Monoid γ] [MulAction γ α] [SMul R γ] [SMul R α] [IsScalarTower R γ α] [SlashAction β G α γ]
    (k : β) (g : G) (a : α) (r : R) : (r • a) ∣[k;γ] g = r • a ∣[k;γ] g

{R : Type u_1}
{β : Type u_2}
{G : Type u_3}
{α : Type u_4}
(γ : Type u_5)
[Group G]
[AddGroup α]
[Monoid γ]
[MulAction γ α]
[SMul R γ]
[SMul R α]
[IsScalarTower R γ α]
[SlashAction β G α γ]
(k : β)
(g : G)
(a : α)
(r : R)


theorem LeftInverse.eq_rightInverse {f : α → β} {g₁ g₂ : β → α} (h₁ : LeftInverse g₁ f)
    (h₂ : RightInverse g₂ f) : g₁ = g₂

{α : Sort u_1}
{β : Sort u_2}
{f : α → β}
{g₁ g₂ : β → α}
(h₁ : Function.LeftInverse g₁ f)
(h₂ : Function.RightInverse g₂ f)


@[to_additive]
theorem iUnion_smul_ae_eq (h : IsFundamentalDomain G s μ) : ⋃ g : G, g • s =ᵐ[μ] univ

(h : MeasureTheory.IsFundamentalDomain G s μ)


/-- When both `S.f` and `S.g` are zero, the middle object `S.X₂`
gives a right homology data on S -/
@[simps]
def ofZeros (hf : S.f = 0) (hg : S.g = 0) : S.RightHomologyData

(CategoryTheory.ShortComplex.RightHomologyData.ofZeros S hf hg).ι = CategoryTheory.CategoryStruct.id S.X₂


@[simp]
theorem eq_zero_iff {n : ℕ} : padicValNat p n = 0 ↔ p = 1 ∨ n = 0 ∨ ¬p ∣ n


theorem RCLike.uniqueContinuousFunctionalCalculus_of_compactSpace_spectrum [TopologicalSpace A]
    [T2Space A] [Ring A] [StarRing A] [Algebra 𝕜 A] [h : ∀ a : A, CompactSpace (spectrum 𝕜 a)] :
    UniqueContinuousFunctionalCalculus 𝕜 A

[h : ∀ (a : A), CompactSpace ↑(spectrum 𝕜 a)]


@[to_additive le_of_add_le_add_left]
theorem le_of_mul_le_mul_left' [ContravariantClass α α (· * ·) (· ≤ ·)] {a b c : α}
    (bc : a * b ≤ a * c) :
    b ≤ c

[ContravariantClass α α (fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1]


theorem mod_mul_left_div_self (m n k : Nat) : m % (k * n) / n = m / n % k


@[simp] theorem coe_comp_of {X Y Z : Type u} [Ring X] [Ring Y] [Ring Z]
    (f : X →+* Y) (g : Y →+* Z) :
    @DFunLike.coe no_index (RingCat.of X ⟶ RingCat.of Z) X
      (fun _ ↦ Z) _
      (CategoryStruct.comp (X := RingCat.of X) (Y := RingCat.of Y) (Z := RingCat.of Z)
        f g) =
    @DFunLike.coe (X →+* Z) X (fun _ ↦ Z) _ (RingHom.comp g f)


/-- A ring of sets `C` is a family of sets containing `∅`, stable by union and set difference.
It is then also stable by intersection (see `IsSetRing.inter_mem`). -/
structure IsSetRing (C : Set (Set α)) : Prop where
  empty_mem : ∅ ∈ C
  union_mem ⦃s t⦄ : s ∈ C → t ∈ C → s ∪ t ∈ C
  diff_mem ⦃s t⦄ : s ∈ C → t ∈ C → s \ t ∈ C

{α : Type u_1}
{C : Set (Set α)}
(self : MeasureTheory.IsSetRing C)


@[fun_prop]
protected theorem differentiable : Differentiable 𝕜 iso

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


theorem subtypeEquivSubtypePerm_apply_of_not_mem (f : Perm (Subtype p)) (h : ¬p a) :
    -- Porting note: was `Perm.subtypeEquivSubtypePerm p f a`
    ((Perm.subtypeEquivSubtypePerm p).toFun f).1 a = a

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

↑((Equiv.Perm.subtypeEquivSubtypePerm p).toFun f) a = a


@[to_additive]
theorem exponent_min (m : ℕ) (hpos : 0 < m) (hm : m < exponent G) : ∃ g : G, g ^ m ≠ 1

{G : Type u}
[Monoid G]
(m : ℕ)
(hpos : 0 < m)
(hm : m < Monoid.exponent G)


protected theorem AntitoneOn.Ioc (hf : AntitoneOn f s) (hg : MonotoneOn g s) :
    MonotoneOn (fun x => Ioc (f x) (g x)) s

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{f g : α → β}
{s : Set α}
(hf : AntitoneOn f s)
(hg : MonotoneOn g s)

MonotoneOn (fun x => Set.Ioc (f x) (g x)) s


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

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


/-- Pythagorean triples are interchangeable, i.e `x * x + y * y = y * y + x * x = z * z`.
This comes from additive commutativity. -/
theorem pythagoreanTriple_comm {x y z : ℤ} : PythagoreanTriple x y z ↔ PythagoreanTriple y x z


@[simp]
theorem toSignedMeasure_zero : (0 : Measure α).toSignedMeasure = 0

MeasureTheory.Measure.toSignedMeasure 0 = 0


theorem IsMinOn.comp_mapsTo {t : Set δ} {g : δ → α} {b : δ} (hf : IsMinOn f s a) (hg : MapsTo g t s)
    (ha : g b = a) : IsMinOn (f ∘ g) t b

{α : Type u}
{β : Type v}
{δ : Type x}
[Preorder β]
{f : α → β}
{s : Set α}
{a : α}
{t : Set δ}
{g : δ → α}
{b : δ}
(hf : IsMinOn f s a)
(hg : Set.MapsTo g t s)
(ha : g b = a)


theorem IsConnected.iUnion_of_reflTransGen {ι : Type*} [Nonempty ι] {s : ι → Set α}
    (H : ∀ i, IsConnected (s i))
    (K : ∀ i j, ReflTransGen (fun i j : ι => (s i ∩ s j).Nonempty) i j) : IsConnected (⋃ n, s n)

(K : ∀ (i j : ι), Relation.ReflTransGen (fun i j => (s i ∩ s j).Nonempty) i j)


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

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


theorem zero [Nontrivial M₀] : IsPrimitiveRoot (0 : M₀) 0

{M₀ : Type u_7}
[CommMonoidWithZero M₀]
[Nontrivial M₀]


theorem eq_top_iff_one : I = ⊤ ↔ (1 : α) ∈ I


/-- Validity for a substring. -/
structure Valid (s : Substring) : Prop where
  /-- The start position of a valid substring is valid. -/
  startValid : s.startPos.Valid s.str
  /-- The stop position of a valid substring is valid. -/
  stopValid : s.stopPos.Valid s.str
  /-- The stop position of a substring is at least the start. -/
  le : s.startPos ≤ s.stopPos


lemma univ_coeff_isHomogeneous (i j : ℕ) (h : i + j = Fintype.card n) :
    ((univ R n).coeff i).IsHomogeneous j

(R : Type u_1)
(n : Type u_3)
[CommRing R]
[Fintype n]
[DecidableEq n]
(i j : ℕ)
(h : i + j = Fintype.card n)

((Matrix.charpoly.univ R n).coeff i).IsHomogeneous j


@[reassoc (attr := simp)]
theorem PreservesPullback.iso_inv_snd :
    (PreservesPullback.iso G f g).inv ≫ G.map (pullback.snd f g) = pullback.snd _ _

[CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan f g) G]

[CategoryTheory.Limits.HasPullback (G.map f) (G.map g)]

(CategoryTheory.Limits.PreservesPullback.iso G f g).inv ≫ G.map (CategoryTheory.Limits.pullback.snd f g) =
  CategoryTheory.Limits.pullback.snd (G.map f) (G.map g)


/-- The map `fun t => exp (t * I)` from `ℝ` to the unit circle in `ℂ`,
considered as a homomorphism of groups. -/
@[simps]
def expMapCircleHom : ℝ →+ Additive circle

∀ (a : ℝ), expMapCircleHom a = (⇑Additive.ofMul ∘ ⇑expMapCircle) a


/-- `Part` extensionality -/
@[ext]
theorem ext {o p : Part α} (H : ∀ a, a ∈ o ↔ a ∈ p) : o = p

{α : Type u_1}
{o p : Part α}
(H : ∀ (a : α), a ∈ o ↔ a ∈ p)


/-- The natural isomorphism `(K⟦n⟧).sc i ≅ K.sc i'` when `n + i = i'`. -/
@[simps!]
noncomputable def shiftShortComplexFunctorIso (n i i' : ℤ) (hi : n + i = i') :
    shiftFunctor C n ⋙ shortComplexFunctor C _ i ≅ shortComplexFunctor C _ i'

(C : Type u_1)
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
(n i i' : ℤ)
(hi : n + i = i')
(X : CochainComplex C ℤ)

((CochainComplex.shiftShortComplexFunctorIso C n i i' hi).inv.app X).τ₁ =
  n.negOnePow • (HomologicalComplex.XIsoOfEq X ⋯).inv


theorem append_def [Append α] (a b : Part α) : a ++ b = bind a fun y => map (y ++ ·) b

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

a ++ b = do
  let y ← a
  Part.map (fun x => y ++ x) b


theorem setIntegral_deterministic' {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E]
    [CompleteSpace E] {f : β → E} {g : α → β} {a : α} (hg : Measurable g)
    (hf : StronglyMeasurable f) {s : Set β} (hs : MeasurableSet s) [Decidable (g a ∈ s)] :
    ∫ x in s, f x ∂deterministic g hg a = if g a ∈ s then f (g a) else 0

(hf : MeasureTheory.StronglyMeasurable f)

∫ (x : β) in s, f x ∂(ProbabilityTheory.Kernel.deterministic g hg) a = if g a ∈ s then f (g a) else 0


theorem mem_fixingSubgroup_iff {s : Set α} {m : M} : m ∈ fixingSubgroup M s ↔ ∀ y ∈ s, m • y = y

(M : Type u_1)
{α : Type u_2}
[Group M]
[MulAction M α]
{s : Set α}
{m : M}


/-- **Lévy's upward theorem**, L¹ version: given a function `g` and a filtration `ℱ`, the
sequence defined by `𝔼[g | ℱ n]` converges in L¹ to `𝔼[g | ⨆ n, ℱ n]`. -/
theorem tendsto_eLpNorm_condexp (g : Ω → ℝ) :
    Tendsto (fun n => eLpNorm (μ[g|ℱ n] - μ[g|⨆ n, ℱ n]) 1 μ) atTop (𝓝 0)

{Ω : Type u_1}
{m0 : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
{ℱ : MeasureTheory.Filtration ℕ m0}
[MeasureTheory.IsFiniteMeasure μ]
(g : Ω → ℝ)

Filter.Tendsto (fun n => MeasureTheory.eLpNorm (μ[g|↑ℱ n] - μ[g|⨆ n, ↑ℱ n]) 1 μ) Filter.atTop (𝓝 0)


theorem eval_sub (f : σ → R) : eval f (p - q) = eval f p - eval f q

{R : Type u}
{σ : Type u_1}
[CommRing R]
(p : MvPolynomial σ R)
{q : MvPolynomial σ R}
(f : σ → R)

(MvPolynomial.eval f) (p - q) = (MvPolynomial.eval f) p - (MvPolynomial.eval f) q


@[reassoc]
lemma map_appLE' (e : V ≤ f ⁻¹ᵁ U) (i : U' = U) :
    Y.presheaf.map (eqToHom i).op ≫ f.appLE U' V (i ▸ e) = f.appLE U V e

(e : V ≤ (TopologicalSpace.Opens.map f.val.base).obj U)

Y.presheaf.map (CategoryTheory.eqToHom i).op ≫ f.appLE U' V ⋯ = f.appLE U V e


@[simp]
theorem ord_term_aux {o : Ordinal} (ho : o < Ordinal.type ((·<·) : I → I → Prop)) :
    ord I (term I ho) = o

(ho : o < Ordinal.type fun x x_1 => x < x_1)

Profinite.NobelingProof.ord I (Profinite.NobelingProof.term I ho) = o


lemma over_forget_compatiblePreserving (X : C) :
    CompatiblePreserving J (Over.forget X)

(J : CategoryTheory.GrothendieckTopology C)

CategoryTheory.CompatiblePreserving J (CategoryTheory.Over.forget X)


@[simp]
theorem mem_map (f : α → β) (q : Semiquot α) (b : β) : b ∈ map f q ↔ ∃ a, a ∈ q ∧ f a = b

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(q : Semiquot α)
(b : β)


@[simp]
theorem conj_ofReal (r : ℝ) : conj (r : ℂ) = r


theorem splits [IsGalois F E] (x : E) : (minpoly F x).Splits (algebraMap F E)

(F : Type u_1)
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
[IsGalois F E]
(x : E)

Polynomial.Splits (algebraMap F E) (minpoly F x)


@[to_additive]
theorem mul_eq_one_iff_inv_eq {a : α} : ↑u * a = 1 ↔ ↑u⁻¹ = a

{α : Type u}
[Monoid α]
{u : αˣ}
{a : α}


@[simp]
protected theorem inf_le_iff (ha : a < ⊤) : s.inf f ≤ a ↔ ∃ b ∈ s, f b ≤ a

{α : Type u_2}
{ι : Type u_5}
[LinearOrder α]
[OrderTop α]
{s : Finset ι}
{f : ι → α}
{a : α}
(ha : a < ⊤)


protected theorem ContDiffAt.eventually {n : ℕ} (h : ContDiffAt 𝕜 n f x) :
    ∀ᶠ y in 𝓝 x, ContDiffAt 𝕜 n f y

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{n : ℕ}
(h : ContDiffAt 𝕜 (↑n) f x)

∀ᶠ (y : E) in 𝓝 x, ContDiffAt 𝕜 (↑n) f y


lemma krullDim_eq_zero_of_unique [Unique α] : krullDim α = 0


@[simp]
theorem isBigOWith_neg_left : IsBigOWith c l (fun x => -f' x) g ↔ IsBigOWith c l f' g

{α : Type u_1}
{F : Type u_4}
{E' : Type u_6}
[Norm F]
[SeminormedAddCommGroup E']
{c : ℝ}
{g : α → F}
{f' : α → E'}
{l : Filter α}

Asymptotics.IsBigOWith c l (fun x => -f' x) g ↔ Asymptotics.IsBigOWith c l f' g


theorem exists_mem_factors_of_dvd {a p : α} (ha0 : a ≠ 0) (hp : Irreducible p) :
    p ∣ a → ∃ q ∈ factors a, p ~ᵤ q

{α : Type u_1}
[CancelCommMonoidWithZero α]
[UniqueFactorizationMonoid α]
{a p : α}
(ha0 : a ≠ 0)
(hp : Irreducible p)

p ∣ a → ∃ q ∈ UniqueFactorizationMonoid.factors a, p ~ᵤ q


theorem integral_singleton' {μ : Measure α} {f : α → E} (hf : StronglyMeasurable f) (a : α) :
    ∫ a in {a}, f a ∂μ = (μ {a}).toReal • f a

∫ (a : α) in {a}, f a ∂μ = (μ {a}).toReal • f a


protected theorem mul_lt_mul_of_le_of_lt' (hac : a ≤ c) (hbd : b < d) (ha : 0 < a) :
    a * b < c * d

{a c b d : Nat}
(hac : a ≤ c)
(hbd : b < d)
(ha : 0 < a)


@[elab_as_elim]
protected theorem induction_on {C : FreeAbelianGroup α → Prop} (z : FreeAbelianGroup α) (C0 : C 0)
    (C1 : ∀ x, C <| of x) (Cn : ∀ x, C (of x) → C (-of x)) (Cp : ∀ x y, C x → C y → C (x + y)) :
    C z

(C1 : ∀ (x : α), C (FreeAbelianGroup.of x))

(Cn : ∀ (x : α), C (FreeAbelianGroup.of x) → C (-FreeAbelianGroup.of x))

(Cp : ∀ (x y : FreeAbelianGroup α), C x → C y → C (x + y))


@[simp] theorem succ_ofNat_pos (n : Nat) : 0 < (n : Int) + 1


theorem IsAntichain.volume_eq_zero [Nonempty ι] (hs : IsAntichain (· ≤ ·) s) : volume s = 0

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


/-- If `xs : ι → ℝ≥0∞` is bounded, then we have `liminf (toReal ∘ xs) = toReal (liminf xs)`. -/
lemma liminf_toReal_eq {ι : Type*} {F : Filter ι} [NeBot F] {b : ℝ≥0∞} (b_ne_top : b ≠ ∞)
    {xs : ι → ℝ≥0∞} (le_b : ∀ᶠ i in F, xs i ≤ b) :
    F.liminf (fun i ↦ (xs i).toReal) = (F.liminf xs).toReal

{ι : Type u_5}
{F : Filter ι}
[F.NeBot]
{b : ℝ≥0∞}
(b_ne_top : b ≠ ⊤)
{xs : ι → ℝ≥0∞}
(le_b : ∀ᶠ (i : ι) in F, xs i ≤ b)

Filter.liminf (fun i => (xs i).toReal) F = (Filter.liminf xs F).toReal


/-- **Monotone convergence theorem** -- sometimes called **Beppo-Levi convergence**.
See `lintegral_iSup_directed` for a more general form. -/
theorem lintegral_iSup {f : ℕ → α → ℝ≥0∞} (hf : ∀ n, Measurable (f n)) (h_mono : Monotone f) :
    ∫⁻ a, ⨆ n, f n a ∂μ = ⨆ n, ∫⁻ a, f n a ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : ℕ → α → ℝ≥0∞}
(hf : ∀ (n : ℕ), Measurable (f n))
(h_mono : Monotone f)

∫⁻ (a : α), ⨆ n, f n a ∂μ = ⨆ n, ∫⁻ (a : α), f n a ∂μ


theorem Submodule.rank_add_le_rank_add_rank (s t : Submodule R M) :
    Module.rank R (s ⊔ t : Submodule R M) ≤ Module.rank R s + Module.rank R t

{R : Type u_1}
{M : Type u}
[Ring R]
[AddCommGroup M]
[Module R M]
[HasRankNullity.{u, u_1} R]
(s t : Submodule R M)

Module.rank R ↥(s ⊔ t) ≤ Module.rank R ↥s + Module.rank R ↥t


theorem mem_range_self (φ : F) (x : A) :
    φ x ∈ (NonUnitalStarAlgHom.range φ : NonUnitalStarSubalgebra R B)

{F : Type v'}
{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[Star A]
[NonUnitalNonAssocSemiring B]
[Module R B]
[Star B]
[FunLike F A B]
[NonUnitalAlgHomClass F R A B]
[NonUnitalStarAlgHomClass F R A B]
(φ : F)
(x : A)


theorem SymmetricRel.mk_mem_comm {V : Set (α × α)} (hV : SymmetricRel V) {x y : α} :
    (x, y) ∈ V ↔ (y, x) ∈ V

{α : Type ua}
{V : Set (α × α)}
(hV : SymmetricRel V)
{x y : α}


theorem lt_rpow_iff_log_lt (hx : 0 < x) (hy : 0 < y) : x < y ^ z ↔ Real.log x < z * Real.log y


/-- Given an open cover `{ Uᵢ }` of `X`, and for each `Uᵢ` an open cover, we may combine these
open covers to form an open cover of `X`.  -/
@[simps! J obj map]
def OpenCover.bind (f : ∀ x : 𝒰.J, OpenCover (𝒰.obj x)) : OpenCover X

{X : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)
(f : (x : 𝒰.J) → (𝒰.obj x).OpenCover)