lemma of_op (W : MorphismProperty C) [W.op.ContainsIdentities] :
    W.ContainsIdentities

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(W : CategoryTheory.MorphismProperty C)
[W.op.ContainsIdentities]


@[to_additive]
theorem not_mem_of_not_mem_closure {P : G} (hP : P ∉ closure k) : P ∉ k

{G : Type u_1}
[Group G]
{k : Set G}
{P : G}
(hP : P ∉ Subgroup.closure k)


@[to_additive addCHaar_empty]
theorem chaar_empty (K₀ : PositiveCompacts G) : chaar K₀ ⊥ = 0

(K₀ : TopologicalSpace.PositiveCompacts G)

MeasureTheory.Measure.haar.chaar K₀ ⊥ = 0


@[simp, norm_cast] lemma coe_pow (ψ : AddChar A M) (n : ℕ) : ⇑(ψ ^ n) = ψ ^ n

{A : Type u_1}
{M : Type u_2}
[AddMonoid A]
[CommMonoid M]
(ψ : AddChar A M)
(n : ℕ)


theorem RingEquiv.isSemisimpleRing (e : R ≃+* S) [IsSemisimpleRing R] : IsSemisimpleRing S

(R : Type u_2)
(S : Type u_3)
[Ring R]
[Ring S]
(e : R ≃+* S)
[IsSemisimpleRing R]


/-- The natural isomorphism expressing that functors `Karoubi C ⥤ Karoubi D` obtained
using `functorExtension₂` actually extends the original functors `C ⥤ D`. -/
@[simps!]
def functorExtension₂CompWhiskeringLeftToKaroubiIso :
    functorExtension₂ C D ⋙ (whiskeringLeft C (Karoubi C) (Karoubi D)).obj (toKaroubi C) ≅
      (whiskeringRight C D (Karoubi D)).obj (toKaroubi D)

(C : Type u_1)
(D : Type u_2)
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
(X : CategoryTheory.Functor C D)

∀ (X_1 : C),
  (((CategoryTheory.Idempotents.functorExtension₂CompWhiskeringLeftToKaroubiIso C D).hom.app X).app X_1).f =
    CategoryTheory.CategoryStruct.id (X.obj X_1)


/-- A predicate saying that a function is differentiable on a set and is continuous on its
closure. This is a common assumption in complex analysis. -/
structure DiffContOnCl (f : E → F) (s : Set E) : Prop where
  protected differentiableOn : DifferentiableOn 𝕜 f s
  protected continuousOn : ContinuousOn f (closure s)

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


lemma nnqsmul_eq_C_mul (q : ℚ≥0) (f : R[X]) : q • f = Polynomial.C (q : R) * f

{R : Type u}
[DivisionSemiring R]
(q : ℚ≥0)
(f : R[X])


theorem mem_inv_pointwise_smul_iff₀ {a : M} (ha : a ≠ 0) (S : Subsemiring R) (x : R) :
    x ∈ a⁻¹ • S ↔ a • x ∈ S

{M : Type u_1}
{R : Type u_2}
[GroupWithZero M]
[Semiring R]
[MulSemiringAction M R]
{a : M}
(ha : a ≠ 0)
(S : Subsemiring R)
(x : R)

x ∈ a⁻¹ • S ↔ a • x ∈ S


/-- Linear map version of the map `toAlternatingMap`
associating to a continuous alternating map the corresponding alternating map. -/
@[simps (config := .asFn) apply]
def toAlternatingMapLinear : (M [⋀^ι]→L[A] N) →ₗ[R] (M [⋀^ι]→ₗ[A] N)

{R : Type u_1}
{A : Type u_2}
{M : Type u_3}
{N : Type u_4}
{ι : Type u_5}
[Semiring R]
[Semiring A]
[AddCommMonoid M]
[AddCommMonoid N]
[TopologicalSpace M]
[TopologicalSpace N]
[ContinuousAdd N]
[Module A M]
[Module A N]
[Module R N]
[ContinuousConstSMul R N]
[SMulCommClass A R N]


private theorem q {hs : MeasurableSet s} {hμs : μ s ≠ ∞} {x : G} :
    Memℒp (condexpIndSMul hm hs hμs x) 1 μ

{α : Type u_1}
{G : Type u_5}
[NormedAddCommGroup G]
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
[NormedSpace ℝ G]
{hm : m ≤ m0}
[MeasureTheory.SigmaFinite (μ.trim hm)]
{hs : MeasurableSet s}
{hμs : μ s ≠ ⊤}
{x : G}

MeasureTheory.Memℒp (↑↑(MeasureTheory.condexpIndSMul hm hs hμs x)) 1 μ


@[simp]
lemma unitsFstOne_val_inv_val_fst (x : (unitsFstOne R A)) : x.val⁻¹.val.fst = 1

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[NonUnitalSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
(x : ↥(Unitization.unitsFstOne R A))


theorem le_iInf_mul {a : ℝ≥0} {g : ι → ℝ≥0} {h : ℝ≥0} (H : ∀ i, a ≤ g i * h) : a ≤ iInf g * h

{ι : Sort u_1}
[Nonempty ι]
{a : ℝ≥0}
{g : ι → ℝ≥0}
{h : ℝ≥0}
(H : ∀ (i : ι), a ≤ g i * h)


@[to_additive]
theorem csSup_mul (hs₀ : s.Nonempty) (hs₁ : BddAbove s) (ht₀ : t.Nonempty) (ht₁ : BddAbove t) :
    sSup (s * t) = sSup s * sSup t

[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 coe_symm_of_not_mem (e : Pretrivialization F (π F E)) {b : B} (hb : b ∉ e.baseSet) :
    (e.symm b : F → E b) = 0

(e : Pretrivialization F Bundle.TotalSpace.proj)


@[simp] theorem getLast?_map (f : α → β) (l : List α) : getLast? (map f l) = (getLast? l).map f

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

(List.map f l).getLast? = Option.map f l.getLast?


/-- A one-dimensional formal multilinear series representing the zero function is zero. -/
theorem HasFPowerSeriesAt.eq_zero {p : FormalMultilinearSeries 𝕜 𝕜 E} {x : 𝕜}
    (h : HasFPowerSeriesAt 0 p x) : p = 0

{𝕜 : Type u_1}
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{p : FormalMultilinearSeries 𝕜 𝕜 E}
{x : 𝕜}
(h : HasFPowerSeriesAt 0 p x)


/-- See Note [continuity lemma statement]. -/
protected theorem Continuous.IccExtend {f : γ → Icc a b → β} {g : γ → α} (hf : Continuous ↿f)
    (hg : Continuous g) : Continuous fun a => IccExtend h (f a) (g a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[LinearOrder α]
[TopologicalSpace γ]
{a b : α}
{h : a ≤ b}
[TopologicalSpace α]
[OrderTopology α]
[TopologicalSpace β]
{f : γ → ↑(Set.Icc a b) → β}
{g : γ → α}
(hf : Continuous ↿f)
(hg : Continuous g)

Continuous fun a_1 => Set.IccExtend h (f a_1) (g a_1)


/-- A monoid homomorphism `f : M →* N` such that `f x` commutes with `f y` for all `x, y` defines
a monoid homomorphism from `Mᵐᵒᵖ`. -/
@[to_additive (attr := simps (config := .asFn))
      "An additive monoid homomorphism `f : M →+ N` such that `f x` additively commutes
      with `f y` for all `x`, `y` defines an additive monoid homomorphism from `Mᵃᵒᵖ`."]
def MonoidHom.fromOpposite {M N : Type*} [MulOneClass M] [MulOneClass N] (f : M →* N)
    (hf : ∀ x y, Commute (f x) (f y)) : Mᵐᵒᵖ →* N

(hf : ∀ (x y : M), AddCommute (f x) (f y))

⇑(f.fromOpposite hf) = ⇑f ∘ AddOpposite.unop


@[simp]
theorem Gamma_ofNat_eq_factorial (n : ℕ) [(n + 1).AtLeastTwo] :
    Gamma (no_index (OfNat.ofNat (n + 1) : ℝ)) = n !


theorem ContinuousLinearMap.mkOfIsCompactOperator_mem_compactOperator {f : M₁ →ₛₗ[σ₁₂] M₂}
    (hf : IsCompactOperator f) :
    ContinuousLinearMap.mkOfIsCompactOperator hf ∈ compactOperator σ₁₂ M₁ M₂

{𝕜₁ : Type u_1}
{𝕜₂ : Type u_2}
[NontriviallyNormedField 𝕜₁]
[NontriviallyNormedField 𝕜₂]
{σ₁₂ : 𝕜₁ →+* 𝕜₂}
[RingHomIsometric σ₁₂]
{M₁ : Type u_3}
{M₂ : Type u_4}
[TopologicalSpace M₁]
[AddCommGroup M₁]
[TopologicalSpace M₂]
[AddCommGroup M₂]
[Module 𝕜₁ M₁]
[Module 𝕜₂ M₂]
[TopologicalAddGroup M₁]
[ContinuousConstSMul 𝕜₁ M₁]
[TopologicalAddGroup M₂]
[ContinuousSMul 𝕜₂ M₂]
{f : M₁ →ₛₗ[σ₁₂] M₂}
(hf : IsCompactOperator ⇑f)


@[simp]
theorem inf_lt_iff : b ⊓ c < a ↔ b < a ∨ c < a

{α : Type u}
[LinearOrder α]
{a b c : α}


@[simp]
theorem Subsequent.moveRight {x : PGame} (j : x.RightMoves) : Subsequent (x.moveRight j) x

{x : SetTheory.PGame}
(j : x.RightMoves)


protected theorem IsBot.isMin (h : IsBot a) : IsMin a

{α : Type u_1}
[LE α]
{a : α}
(h : IsBot a)


@[simp]
theorem mapRange_single {f : ∀ i, β₁ i → β₂ i} {hf : ∀ i, f i 0 = 0} {i : ι} {b : β₁ i} :
    mapRange f hf (single i b) = single i (f i b)

{ι : Type u}
{β₁ : ι → Type v₁}
{β₂ : ι → Type v₂}
[DecidableEq ι]
[(i : ι) → Zero (β₁ i)]
[(i : ι) → Zero (β₂ i)]
{f : (i : ι) → β₁ i → β₂ i}
{hf : ∀ (i : ι), f i 0 = 0}
{i : ι}
{b : β₁ i}

DFinsupp.mapRange f hf (DFinsupp.single i b) = DFinsupp.single i (f i b)


/-- The image of a proper space under an expanding onto map is proper. -/
protected theorem properSpace {α : Type*} [MetricSpace α] {K : ℝ≥0} {f : α → β} [ProperSpace α]
    (hK : AntilipschitzWith K f) (f_cont : Continuous f) (hf : Function.Surjective f) :
    ProperSpace β

{β : Type u_2}
[PseudoMetricSpace β]
{α : Type u_4}
[MetricSpace α]
{K : ℝ≥0}
{f : α → β}
[ProperSpace α]
(hK : AntilipschitzWith K f)
(f_cont : Continuous f)
(hf : Function.Surjective f)


@[to_additive (attr := simp)] theorem hasProd_extend_one {g : β → γ} (hg : Injective g) :
    HasProd (extend g f 1) a ↔ HasProd f a

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β → α}
{a : α}
{g : β → γ}
(hg : Function.Injective g)

HasSum (Function.extend g f 0) a ↔ HasSum f a


theorem lt_map_of_int_lt_translationNumber {n : ℤ} (h : ↑n < τ f) (x : ℝ) : x + n < f x

(f : CircleDeg1Lift)
{n : ℤ}
(h : ↑n < f.translationNumber)
(x : ℝ)


theorem borelSpace_codomain [SecondCountableTopology Y] {f : X → Y} (hf : Measurable f)
    (hsurj : Surjective f) : BorelSpace Y

{X : Type u_3}
{Y : Type u_4}
[MeasurableSpace X]
[StandardBorelSpace X]
[TopologicalSpace Y]
[T0Space Y]
[MeasurableSpace Y]
[OpensMeasurableSpace Y]
[SecondCountableTopology Y]
{f : X → Y}
(hf : Measurable f)
(hsurj : Function.Surjective f)


theorem not_divides_sq (x y) : (x + 1) * (x + 1) ≠ d * (y + 1) * (y + 1)

{d : ℕ}
[dnsq : Zsqrtd.Nonsquare d]
(x y : ℕ)


/--
(Implementation). The maps given in `appIso` is inverse to each other and gives a `ℱ(X) ≅ ℱ'(X)`.
-/
@[simps]
noncomputable def appIso {ℱ ℱ' : SheafOfTypes.{v} K} (i : G.op ⋙ ℱ.val ≅ G.op ⋙ ℱ'.val)
    (X : D) : ℱ.val.obj (op X) ≅ ℱ'.val.obj (op X)

{K : CategoryTheory.GrothendieckTopology D}

(i : G.op.comp ℱ.val ≅ G.op.comp ℱ'.val)

∀ (a : ℱ.val.obj (Opposite.op X)),
  (CategoryTheory.Functor.IsCoverDense.Types.appIso i X).hom a =
    CategoryTheory.Functor.IsCoverDense.Types.appHom i.hom X a


/-- The sum over all values of the trivial multiplicative character on a finite ring is
the cardinality of its unit group. -/
theorem sum_one_eq_card_units [DecidableEq R] :
    (∑ a, (1 : MulChar R R') a) = Fintype.card Rˣ

{R : Type u_1}
[CommMonoid R]
[Fintype R]
{R' : Type u_2}
[CommRing R']
[DecidableEq R]


theorem charmatrix_reindex (e : n ≃ m) :
    charmatrix (reindex e e M) = reindex e e (charmatrix M)

{R : Type u_1}
[CommRing R]
{m : Type u_3}
{n : Type u_4}
[DecidableEq m]
[DecidableEq n]
[Fintype m]
[Fintype n]
(M : Matrix n n R)
(e : n ≃ m)

((Matrix.reindex e e) M).charmatrix = (Matrix.reindex e e) M.charmatrix


@[to_additive]
theorem HasProd.sigma_of_hasProd {γ : β → Type*} {f : (Σb : β, γ b) → α} {g : β → α}
    {a : α} (ha : HasProd g a) (hf : ∀ b, HasProd (fun c ↦ f ⟨b, c⟩) (g b)) (hf' : Multipliable f) :
    HasProd f a

(hf : ∀ (b : β), HasSum (fun c => f ⟨b, c⟩) (g b))


lemma of_iSup_eq_top {ι} (U : ι → Y.Opens) (hU : iSup U = ⊤)
    (H : ∀ i, P (f ∣_ U i)) : P f

{P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme}

[hP : AlgebraicGeometry.IsLocalAtTarget P]


@[simp] theorem minimals_Ici (a : α) : minimals (· ≤ ·) (Ici a) = {a}

minimals (fun x x_1 => x ≤ x_1) (Set.Ici a) = {a}


@[to_additive (attr := simp)]
theorem div_comp [Div γ] [ContinuousDiv γ] (f g : C(β, γ)) (h : C(α, β)) :
    (f / g).comp h = f.comp h / g.comp h

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
[Sub γ]
[ContinuousSub γ]
(f g : C(β, γ))
(h : C(α, β))


@[elab_as_elim, induction_eliminator]
protected theorem induction_on {C : FreeCommRing α → Prop} (z : FreeCommRing α) (hn1 : C (-1))
    (hb : ∀ b, C (of b)) (ha : ∀ x y, C x → C y → C (x + y)) (hm : ∀ x y, C x → C y → C (x * y)) :
    C z

(ha : ∀ (x y : FreeCommRing α), C x → C y → C (x + y))

(hm : ∀ (x y : FreeCommRing α), C x → C y → C (x * y))


/-- The **extreme value theorem**: a continuous function realizes its minimum on a compact set. -/
@[deprecated IsCompact.exists_isMinOn (since := "2023-02-06")]
theorem IsCompact.exists_forall_le [ClosedIicTopology α] {s : Set β} (hs : IsCompact s)
    (ne_s : s.Nonempty) {f : β → α} (hf : ContinuousOn f s) : ∃ x ∈ s, ∀ y ∈ s, f x ≤ f y

{α : Type u_2}
{β : Type u_3}
[LinearOrder α]
[TopologicalSpace α]
[TopologicalSpace β]
[ClosedIicTopology α]
{s : Set β}
(hs : IsCompact s)
(ne_s : s.Nonempty)
{f : β → α}
(hf : ContinuousOn f s)


/-- `DomMulAct.mk` as a homeomorphism. -/
@[to_additive (attr := simps toEquiv) "`DomAddAct.mk` as a homeomorphism"]
def mkHomeomorph : M ≃ₜ Mᵈᵐᵃ


theorem Frequently.and_eventually {p q : α → Prop} {f : Filter α} (hp : ∃ᶠ x in f, p x)
    (hq : ∀ᶠ x in f, q x) : ∃ᶠ x in f, p x ∧ q x

{α : Type u}
{p q : α → Prop}
{f : Filter α}
(hp : ∃ᶠ (x : α) in f, p x)
(hq : ∀ᶠ (x : α) in f, q x)


theorem closure_eq_interior_union_frontier (s : Set X) : closure s = interior s ∪ frontier s

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


theorem ConcaveOn.left_lt_of_lt_right (hf : ConcaveOn 𝕜 s f) {x y z : E} (hx : x ∈ s) (hy : y ∈ s)
    (hz : z ∈ openSegment 𝕜 x y) (hyz : f z < f y) : f x < f z

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[LinearOrderedCancelAddCommMonoid β]
[Module 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : ConcaveOn 𝕜 s f)
{x y z : E}
(hx : x ∈ s)
(hy : y ∈ s)
(hz : z ∈ openSegment 𝕜 x y)
(hyz : f z < f y)


@[simp, nolint simpNF]
theorem homEquiv_symm_apply_eq (f : Y ⟶ A ⟶[C] X) :
    ((ihom.adjunction A).homEquiv _ _).symm f = uncurry f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.MonoidalCategory C]
{A X Y : C}
[CategoryTheory.Closed A]
(f : Y ⟶ (CategoryTheory.ihom A).obj X)

((CategoryTheory.ihom.adjunction A).homEquiv Y X).symm f = CategoryTheory.MonoidalClosed.uncurry f


/-- The Cesaro average of a converging sequence converges to the same limit. -/
theorem Filter.Tendsto.cesaro {u : ℕ → ℝ} {l : ℝ} (h : Tendsto u atTop (𝓝 l)) :
    Tendsto (fun n : ℕ => (n⁻¹ : ℝ) * ∑ i ∈ range n, u i) atTop (𝓝 l)

(h : Filter.Tendsto u Filter.atTop (𝓝 l))

Filter.Tendsto (fun n => (↑n)⁻¹ * ∑ i ∈ Finset.range n, u i) Filter.atTop (𝓝 l)


@[simp] lemma unmop_hom_leftUnitor (X : Cᴹᵒᵖ) : (λ_ X).hom.unmop = (ρ_ (unmop X)).hom

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

(CategoryTheory.MonoidalCategory.leftUnitor X).hom.unmop = (CategoryTheory.MonoidalCategory.rightUnitor X.unmop).hom


@[to_additive]
theorem prod_eq_foldl (s : Multiset α) :
    prod s = foldl (· * ·) (fun x y z => by simp [mul_right_comm]) 1 s

{α : Type u_3}
[AddCommMonoid α]
(s : Multiset α)

s.sum = Multiset.foldl (fun x x_1 => x + x_1) ⋯ 0 s


theorem factorizationEquiv_inv_apply {f : ℕ →₀ ℕ} (hf : ∀ p ∈ f.support, Prime p) :
    (factorizationEquiv.symm ⟨f, hf⟩).1 = f.prod (· ^ ·)

{f : ℕ →₀ ℕ}
(hf : ∀ p ∈ f.support, Nat.Prime p)

↑(Nat.factorizationEquiv.symm ⟨f, hf⟩) = f.prod fun x x_1 => x ^ x_1


@[to_additive]
theorem measure_isOpen_pos_of_smulInvariant_of_ne_zero (hμ : μ ≠ 0) (hU : IsOpen U)
    (hne : U.Nonempty) : 0 < μ U

[MeasureTheory.SMulInvariantMeasure G α μ]


lemma atTop_basis_Ioi' [SemilatticeSup α] [NoMaxOrder α] (a : α) : atTop.HasBasis (a < ·) Ioi

{α : Type u_3}
[SemilatticeSup α]
[NoMaxOrder α]
(a : α)

Filter.atTop.HasBasis (fun x => a < x) Set.Ioi


@[simp]
theorem preimage_ite (f : α → β) (s t₁ t₂ : Set β) :
    f ⁻¹' s.ite t₁ t₂ = (f ⁻¹' s).ite (f ⁻¹' t₁) (f ⁻¹' t₂)

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(s t₁ t₂ : Set β)


theorem mod_add_div : ∀ a b : Int, mod a b + b * (a.div b) = a


@[simp]
theorem mapAlgHom_id [Algebra R S₁] :
    mapAlgHom (AlgHom.id R S₁) = AlgHom.id R (MvPolynomial σ S₁)

{R : Type u}
{S₁ : Type v}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₁]
[Algebra R S₁]

MvPolynomial.mapAlgHom (AlgHom.id R S₁) = AlgHom.id R (MvPolynomial σ S₁)


theorem ContMDiffWithinAt.mdifferentiableWithinAt (hf : ContMDiffWithinAt I I' n f s x)
    (hn : 1 ≤ n) : MDifferentiableWithinAt I I' f s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{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 : M → M'}
{x : M}
{s : Set M}
{n : ℕ∞}
(hf : ContMDiffWithinAt I I' n f s x)
(hn : 1 ≤ n)


theorem pred_lt_iff_eq_or_lt : pred a < b ↔ a = b ∨ a < b

{α : Type u_1}
[PartialOrder α]
[PredOrder α]
{a b : α}
[NoMinOrder α]


theorem smul_def {R : Type*} [SMul R β] (r : R) (x : α) :
    letI := e.smul R
    r • x = e.symm (r • e x)

{α : Type u}
{β : Type v}
(e : α ≃ β)
{R : Type u_1}
[SMul R β]
(r : R)
(x : α)


theorem left_inv_of_invOfMemRange (b : Set.range f) : f (hf.invOfMemRange b) = b

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[DecidableEq β]
{f : α → β}
(hf : Function.Injective f)
(b : ↑(Set.range f))


lemma closure_subset_closure_iff_subset_closure (hX : X ⊆ M.E := by aesop_mat) :
    M.closure X ⊆ M.closure Y ↔ X ⊆ M.closure Y

{α : Type u_2}
{M : Matroid α}
{X Y : Set α}
(hX : X ⊆ M.E := by aesop_mat)


theorem ae_not_liouville : ∀ᵐ x, ¬Liouville x


@[to_additive]
lemma IsScalarTower.of_smul_one_mul {M N} [Monoid N] [SMul M N]
    (h : ∀ (x : M) (y : N), x • (1 : N) * y = x • y) : IsScalarTower M N N


/-- **Darboux's theorem**: the image of a convex set under `f'` is a convex set,
`derivWithin` version. -/
theorem Convex.image_derivWithin {s : Set ℝ} (hs : Convex ℝ s) (hf : DifferentiableOn ℝ f s) :
    Convex ℝ (derivWithin f s '' s)

{f : ℝ → ℝ}
{s : Set ℝ}
(hs : Convex ℝ s)
(hf : DifferentiableOn ℝ f s)


{K : Type u}
[Field K]
(A : ValuationSubring K)


@[to_additive]
theorem prod_mem_multiset [DecidableEq α] (m : Multiset α) (f : { x // x ∈ m } → β) (g : α → β)
    (hfg : ∀ x, f x = g x) : ∏ x : { x // x ∈ m }, f x = ∏ x ∈ m.toFinset, g x

(hfg : ∀ (x : { x // x ∈ m }), f x = g ↑x)


lemma dens_eq_card_div_card (s : Finset α) : dens s = s.card / Fintype.card α

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


@[to_additive]
theorem measure_zero_of_invariant (h : IsFundamentalDomain G s μ) (t : Set α)
    (ht : ∀ g : G, g • t = t) (hts : μ (t ∩ s) = 0) : μ t = 0

(h : MeasureTheory.IsFundamentalDomain G s μ)


@[to_additive]
theorem lintegral_eq_tsum' (h : IsFundamentalDomain G s μ) (f : α → ℝ≥0∞) :
    ∫⁻ x, f x ∂μ = ∑' g : G, ∫⁻ x in s, f (g⁻¹ • x) ∂μ

[MeasureTheory.VAddInvariantMeasure G α μ]

(h : MeasureTheory.IsAddFundamentalDomain G s μ)

(f : α → ℝ≥0∞)

∫⁻ (x : α), f x ∂μ = ∑' (g : G), ∫⁻ (x : α) in s, f (-g +ᵥ x) ∂μ


/-- The right inverse does not depend on the zeroth coefficient of a formal multilinear
series. -/
theorem rightInv_removeZero (p : FormalMultilinearSeries 𝕜 E F) (i : E ≃L[𝕜] F) :
    p.removeZero.rightInv i = p.rightInv i

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


/-- The functor `Sigma.map C g` restricted to the subcategory `C j` acts as the inclusion of `g j`.
-/
@[simps!]
def inclCompMap (j : J) : incl j ⋙ map C g ≅ incl (g j)

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

(CategoryTheory.Sigma.inclCompMap C g j).inv.app X = CategoryTheory.CategoryStruct.id ⟨g j, X⟩


/-- The degree of a product of polynomials is equal to
the sum of the degrees, where the degree of the zero polynomial is ⊥.
-/
theorem degree_prod [Nontrivial R] : (∏ i ∈ s, f i).degree = ∑ i ∈ s, (f i).degree

{R : Type u}
{ι : Type w}
(s : Finset ι)
[CommSemiring R]
[NoZeroDivisors R]
(f : ι → R[X])
[Nontrivial R]


@[simp]
theorem intCoe_apply [AddGroupWithOne R] {f : ArithmeticFunction ℤ} {x : ℕ} :
    (f : ArithmeticFunction R) x = f x

{R : Type u_1}
[AddGroupWithOne R]
{f : ArithmeticFunction ℤ}
{x : ℕ}


theorem mapCoeffs_apply (i : ι) : b.mapCoeffs f h i = b i

(h : ∀ (c : R) (x : M), f c • x = c • x)


theorem volume_Icc_pi {a b : ι → ℝ} : volume (Icc a b) = ∏ i, ENNReal.ofReal (b i - a i)

{ι : Type u_1}
[Fintype ι]
{a b : ι → ℝ}

MeasureTheory.volume (Set.Icc a b) = ∏ i : ι, ENNReal.ofReal (b i - a i)


/-- Bifunctor. This typeclass asserts that a lawless bitraversable bifunctor is lawful. -/
class LawfulBitraversable (t : Type u → Type u → Type u) [Bitraversable t] extends
  LawfulBifunctor t : Prop where
  -- Porting note: need to specify `m := Id` because `id` no longer has a `Monad` instance
  id_bitraverse : ∀ {α β} (x : t α β), bitraverse (m := Id) pure pure x = pure x
  comp_bitraverse :
    ∀ {F G} [Applicative F] [Applicative G] [LawfulApplicative F] [LawfulApplicative G]
      {α α' β β' γ γ'} (f : β → F γ) (f' : β' → F γ') (g : α → G β) (g' : α' → G β') (x : t α α'),
      bitraverse (Comp.mk ∘ map f ∘ g) (Comp.mk ∘ map f' ∘ g') x =
        Comp.mk (bitraverse f f' <$> bitraverse g g' x)
  bitraverse_eq_bimap_id :
    ∀ {α α' β β'} (f : α → β) (f' : α' → β') (x : t α α'),
      bitraverse (m := Id) (pure ∘ f) (pure ∘ f') x = pure (bimap f f' x)
  binaturality :
    ∀ {F G} [Applicative F] [Applicative G] [LawfulApplicative F] [LawfulApplicative G]
      (η : ApplicativeTransformation F G) {α α' β β'} (f : α → F β) (f' : α' → F β') (x : t α α'),
      η (bitraverse f f' x) = bitraverse (@η _ ∘ f) (@η _ ∘ f') x

{t : Type u → Type u → Type u}
[Bitraversable t]
[self : LawfulBitraversable t]
{F G : Type u → Type u}
[Applicative F]
[Applicative G]
[LawfulApplicative F]
[LawfulApplicative G]
{α α' β β' γ γ' : Type u}
(f : β → F γ)
(f' : β' → F γ')
(g : α → G β)
(g' : α' → G β')
(x : t α α')

bitraverse (Functor.Comp.mk ∘ Functor.map f ∘ g) (Functor.Comp.mk ∘ Functor.map f' ∘ g') x =
  Functor.Comp.mk (bitraverse f f' <$> bitraverse g g' x)


/-- For `n ≠ 1`, `(n-1)!` is congruent to `-1` modulo `n` only if n is prime. -/
theorem prime_of_fac_equiv_neg_one (h : ((n - 1)! : ZMod n) = -1) (h1 : n ≠ 1) : Prime n


@[simp]
theorem nnnorm_inv (a : α) : ‖a⁻¹‖₊ = ‖a‖₊⁻¹

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

‖a⁻¹‖₊ = ‖a‖₊⁻¹


@[simp]
theorem star_leftMoves : star.LeftMoves = PUnit

SetTheory.PGame.star.LeftMoves = PUnit.{u_1 + 1}


@[to_additive]
theorem lt_div_comm : a < b / c ↔ c < b / a

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


@[to_additive]
theorem mulIndicator_image {s : Set α} {f : β → M} {g : α → β} (hg : Injective g) {x : α} :
    mulIndicator (g '' s) f (g x) = mulIndicator s (f ∘ g) x

{α : Type u_1}
{β : Type u_2}
{M : Type u_4}
[Zero M]
{s : Set α}
{f : β → M}
{g : α → β}
(hg : Function.Injective g)
{x : α}

(g '' s).indicator f (g x) = s.indicator (f ∘ g) x


theorem not_lt_maximum_of_mem : a ∈ l → (maximum l : WithBot α) = m → ¬m < a

{α : Type u_1}
[Preorder α]
[DecidableRel fun x x_1 => x < x_1]
{l : List α}
{a m : α}


protected theorem hasSum_orthogonalProjection {U : Submodule 𝕜 E} [CompleteSpace U]
    (b : HilbertBasis ι 𝕜 U) (x : E) :
    HasSum (fun i => ⟪(b i : E), x⟫ • b i) (orthogonalProjection U x)

{ι : Type u_1}
{𝕜 : Type u_2}
[RCLike 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{U : Submodule 𝕜 E}
[CompleteSpace ↥U]
(b : HilbertBasis ι 𝕜 ↥U)
(x : E)

HasSum (fun i => ⟪↑((fun i => b.repr.symm (lp.single 2 i 1)) i), x⟫_𝕜 • (fun i => b.repr.symm (lp.single 2 i 1)) i)
  ((orthogonalProjection U) x)


@[simp]
theorem zeroLocus_singleton_one : zeroLocus 𝒜 ({1} : Set A) = ∅

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


/-- The surjective image of a principal ideal ring is again a principal ideal ring. -/
theorem IsPrincipalIdealRing.of_surjective [IsPrincipalIdealRing R] (f : R →+* S)
    (hf : Function.Surjective f) : IsPrincipalIdealRing S

{R : Type u}
{S : Type u_1}
[Ring R]
[Ring S]
[IsPrincipalIdealRing R]
(f : R →+* S)
(hf : Function.Surjective ⇑f)


theorem or_eq_of_eq_false_right {a b : Prop} (h : b = False) : (a ∨ b) = a


theorem map₂_mono_left (h : g₁ ≤ g₂) : map₂ m f g₁ ≤ map₂ m f g₂

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{m : α → β → γ}
{f : Filter α}
{g₁ g₂ : Filter β}
(h : g₁ ≤ g₂)


lemma natCast_card_filter (p) [DecidablePred p] (s : Finset ι) :
    ((filter p s).card : α) = ∑ a ∈ s, if p a then (1 : α) else 0

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

↑(Finset.filter p s).card = ∑ a ∈ s, if p a then 1 else 0


/-- In a preconnected space, if a symmetric transitive relation `P x y` is true for `y` close
enough to `x`, then it holds for all `x, y`. This is a version of the fact that, if an equivalence
relation has open classes, then it has a single equivalence class. -/
lemma PreconnectedSpace.induction₂ [PreconnectedSpace α] (P : α → α → Prop)
    (h : ∀ x, ∀ᶠ y in 𝓝 x, P x y) (h' : Transitive P) (h'' : Symmetric P) (x y : α) :
    P x y

(h : ∀ (x : α), ∀ᶠ (y : α) in 𝓝 x, P x y)


lemma _root_.Pi.ker_ringHom {ι : Type*} {R : ι → Type*} [∀ i, Semiring (R i)]
    (φ : ∀ i, S →+* R i) : ker (Pi.ringHom φ) = ⨅ i, ker (φ i)

{S : Type v}
[Semiring S]
{ι : Type u_3}
{R : ι → Type u_4}
[(i : ι) → Semiring (R i)]
(φ : (i : ι) → S →+* R i)

RingHom.ker (Pi.ringHom φ) = ⨅ i, RingHom.ker (φ i)


@[simp]
theorem ret_bind (a : α) (f : α → WSeq β) : bind (ret a) f ~ʷ f a

{α : Type u}
{β : Type v}
(a : α)
(f : α → Stream'.WSeq β)


@[to_additive]
theorem unop_sup (S₁ S₂ : Submonoid Mᵐᵒᵖ) : (S₁ ⊔ S₂).unop = S₁.unop ⊔ S₂.unop

{M : Type u_2}
[AddZeroClass M]
(S₁ S₂ : AddSubmonoid Mᵃᵒᵖ)


@[simp] theorem filterMap_cons_none {f : α → Option β} (a : α) (l : List α) (h : f a = none) :
    filterMap f (a :: l) = filterMap f l

{α : Type u_1}
{β : Type u_2}
{f : α → Option β}
(a : α)
(l : List α)
(h : f a = none)

List.filterMap f (a :: l) = List.filterMap f l


theorem IsBigO.exists_nonneg (h : f =O[l] g') : ∃ c ≥ 0, IsBigOWith c l f g'

{α : Type u_1}
{E : Type u_3}
{F' : Type u_7}
[Norm E]
[SeminormedAddCommGroup F']
{f : α → E}
{g' : α → F'}
{l : Filter α}
(h : f =O[l] g')

∃ c ≥ 0, Asymptotics.IsBigOWith c l f g'


@[simp]
theorem ofSubmodule'_apply [Module R M] [Module R₂ M₂] (f : M ≃ₛₗ[σ₁₂] M₂) (U : Submodule R₂ M₂)
    (x : U.comap (f : M →ₛₗ[σ₁₂] M₂)) : (f.ofSubmodule' U x : M₂) = f (x : M)

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
{re₁₂ : RingHomInvPair σ₁₂ σ₂₁}
{re₂₁ : RingHomInvPair σ₂₁ σ₁₂}
[Module R M]
[Module R₂ M₂]
(f : M ≃ₛₗ[σ₁₂] M₂)
(U : Submodule R₂ M₂)
(x : ↥(Submodule.comap (↑f) U))


theorem foldMap_hom_free [Monoid β] (f : FreeMonoid α →* β) (x : t α) :
    f (foldMap FreeMonoid.of x) = foldMap (f ∘ FreeMonoid.of) x

{α β : Type u}
{t : Type u → Type u}
[Traversable t]
[LawfulTraversable t]
[Monoid β]
(f : FreeMonoid α →* β)
(x : t α)

f (Traversable.foldMap FreeMonoid.of x) = Traversable.foldMap (⇑f ∘ FreeMonoid.of) x


@[simp]
theorem sin_sub_pi (x : ℝ) : sin (x - π) = -sin x


lemma not_nil_iff {p : G.Walk v w} :
    ¬ p.Nil ↔ ∃ (u : V) (h : G.Adj v u) (q : G.Walk u w), p = cons h q

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

¬p.Nil ↔ ∃ u, ∃ (h : G.Adj v u), ∃ q, p = SimpleGraph.Walk.cons h q


@[simp]
theorem prod_smul (m) : ∀ w : Word M, prod (m • w) = m * prod w

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
[(i : ι) → DecidableEq (M i)]
[DecidableEq ι]
(m : Monoid.CoprodI M)
(w : Monoid.CoprodI.Word M)


theorem preimage_eq_preimage' {s t : Set α} {f : β → α} (hs : s ⊆ range f) (ht : t ⊆ range f) :
    f ⁻¹' s = f ⁻¹' t ↔ s = t

{α : Type u_1}
{β : Type u_2}
{s t : Set α}
{f : β → α}
(hs : s ⊆ Set.range f)
(ht : t ⊆ Set.range f)


theorem coe_ofSeqClosedGraph
    (hg : ∀ (u : ℕ → E) (x y), Tendsto u atTop (𝓝 x) → Tendsto (g ∘ u) atTop (𝓝 y) → y = g x) :
    ↑(ContinuousLinearMap.ofSeqClosedGraph hg) = g

(hg :
  ∀ (u : ℕ → E) (x : E) (y : F),
    Filter.Tendsto u Filter.atTop (𝓝 x) → Filter.Tendsto (⇑g ∘ u) Filter.atTop (𝓝 y) → y = g x)


theorem coe_injective : Injective ((↑) : α → WithBot α)


theorem IntegrableOn.add_measure (hμ : IntegrableOn f s μ) (hν : IntegrableOn f s ν) :
    IntegrableOn f s (μ + ν)

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


@[to_additive]
theorem mem_rightTransversals_iff_bijective :
    S ∈ rightTransversals (H : Set G) ↔
      Function.Bijective (S.restrict (Quotient.mk'' : G → Quotient (QuotientGroup.rightRel H)))

{G : Type u_1}
[AddGroup G]
{H : AddSubgroup G}
{S : Set G}

S ∈ AddSubgroup.rightTransversals ↑H ↔ Function.Bijective (S.restrict Quotient.mk'')


theorem extendScalars_le_iff (E' : IntermediateField F L) :
    extendScalars h ≤ E' ↔ E ≤ E'.restrictScalars K

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
{F E : IntermediateField K L}
(h : F ≤ E)
(E' : IntermediateField (↥F) L)

IntermediateField.extendScalars h ≤ E' ↔ E ≤ IntermediateField.restrictScalars K E'


theorem preimage_sphere (hf : Isometry f) (x : α) (r : ℝ) :
    f ⁻¹' Metric.sphere (f x) r = Metric.sphere x r

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
{f : α → β}
(hf : Isometry f)
(x : α)
(r : ℝ)


theorem le_compl_iff_disjoint_left : a ≤ bᶜ ↔ Disjoint b a

{α : Type u_2}
[HeytingAlgebra α]
{a b : α}


lemma eq_of_not_mem_uIoc_of_not_mem_uIoc (ha : a ≤ c) (hb : b ≤ c) :
    a ∉ Ι b c → b ∉ Ι a c → a = b

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


theorem foldrM_eq_reverse_foldlM_data [Monad m] (f : α → β → m β) (init : β) (arr : Array α) :
    arr.foldrM f init = arr.data.reverse.foldlM (fun x y => f y x) init

{m : Type u_1 → Type u_2}
{α : Type u_3}
{β : Type u_1}
[Monad m]
(f : α → β → m β)
(init : β)
(arr : Array α)

Array.foldrM f init arr arr.size = List.foldlM (fun x y => f y x) init arr.data.reverse


@[simp]
theorem image_ball (x : E) (r : ℝ) : e '' Metric.ball x r = Metric.ball (e x) r

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

⇑e '' Metric.ball x r = Metric.ball (e x) r


theorem l_le_l_iff [Preorder α] [Preorder β] (gi : GaloisCoinsertion l u) {a b} :
    l a ≤ l b ↔ a ≤ b

{α : Type u}
{β : Type v}
{l : α → β}
{u : β → α}
[Preorder α]
[Preorder β]
(gi : GaloisCoinsertion l u)
{a b : α}


/-- The entrywise sup norm of a unitary matrix is at most 1. -/
theorem entrywise_sup_norm_bound_of_unitary {U : Matrix n n 𝕜} (hU : U ∈ Matrix.unitaryGroup n 𝕜) :
    ‖U‖ ≤ 1

{𝕜 : Type u_1}
{n : Type u_3}
[RCLike 𝕜]
[Fintype n]
[DecidableEq n]
{U : Matrix n n 𝕜}
(hU : U ∈ Matrix.unitaryGroup n 𝕜)


@[simp]
theorem counitNat_X (a : A) : counitNat A (X a) = a

(MvPolynomial.counitNat A) (MvPolynomial.X a) = a


@[to_additive]
theorem noncommProd_cons' (s : Finset α) (a : α) (f : α → β)
    (ha : a ∉ s) (comm) :
    noncommProd (cons a s ha) f comm =
      noncommProd s f (comm.mono fun _ => Finset.mem_cons.2 ∘ .inr) * f a

(comm : (↑(Finset.cons a s ha)).Pairwise fun a b => AddCommute (f a) (f b))

(Finset.cons a s ha).noncommSum f comm = s.noncommSum f ⋯ + f a


theorem pairwise_reverse {l : List α} :
    l.reverse.Pairwise R ↔ l.Pairwise (fun a b => R b a)

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

List.Pairwise R l.reverse ↔ List.Pairwise (fun a b => R b a) l


@[simp]
theorem topologicalClosure_coe (s : StarSubalgebra R A) :
    (s.topologicalClosure : Set A) = closure (s : Set A)

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[StarRing R]
[TopologicalSpace A]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
[TopologicalSemiring A]
[ContinuousStar A]
(s : StarSubalgebra R A)


theorem condexp_nonpos {E} [NormedLatticeAddCommGroup E] [CompleteSpace E] [NormedSpace ℝ E]
    [OrderedSMul ℝ E] {f : α → E} (hf : f ≤ᵐ[μ] 0) : μ[f|m] ≤ᵐ[μ] 0

{α : Type u_1}
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{E : Type u_5}
[NormedLatticeAddCommGroup E]
[CompleteSpace E]
[NormedSpace ℝ E]
[OrderedSMul ℝ E]
{f : α → E}
(hf : f ≤ᵐ[μ] 0)


theorem coe_succ_lt_iff_lt {n : ℕ} {j k : Fin n} : (j : Fin <| n + 1) < k ↔ j < k


@[to_additive]
theorem subgroupOf_bot_eq_top : H.subgroupOf ⊥ = ⊤

{G : Type u_1}
[AddGroup G]
(H : AddSubgroup G)


/-- For `1 ≤ p`, the `p`-th power of the sum of `f i` is bounded above by a constant times the
sum of the `p`-th powers of `f i`. Version for sums over finite sets, with `ℝ≥0∞`-valued functions.
-/
theorem rpow_sum_le_const_mul_sum_rpow (hp : 1 ≤ p) :
    (∑ i ∈ s, f i) ^ p ≤ (card s : ℝ≥0∞) ^ (p - 1) * ∑ i ∈ s, f i ^ p

{ι : Type u}
(s : Finset ι)
(f : ι → ℝ≥0∞)
{p : ℝ}
(hp : 1 ≤ p)

(∑ i ∈ s, f i) ^ p ≤ ↑s.card ^ (p - 1) * ∑ i ∈ s, f i ^ p


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

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

∀ {X Y : CategoryTheory.Square C} (φ : X ⟶ Y), (CategoryTheory.Square.toArrowArrowFunctor'.map φ).left.left = φ.τ₁


@[simp (high)]
theorem commRingIsoToRingEquiv_toRingHom {X Y : CommRingCat} (i : X ≅ Y) :
    i.commRingCatIsoToRingEquiv.toRingHom = i.hom


/--
If `(M', f : M ⟶ M')` satisfies universal property of localized module, then `M'` is isomorphic to
`LocalizedModule S M` as an `R`-module.
-/
@[simps!]
noncomputable def iso : LocalizedModule S M ≃ₗ[R] M'

{R : Type u_1}
[CommSemiring R]
(S : Submonoid R)
{M : Type u_2}
{M' : Type u_3}
[AddCommMonoid M]
[AddCommMonoid M']
[Module R M]
[Module R M']
(f : M →ₗ[R] M')
[IsLocalizedModule S f]

∀ (a : LocalizedModule S M), (IsLocalizedModule.iso S f) a = IsLocalizedModule.fromLocalizedModule' S f a


@[simp] lemma preCantorSet_zero : preCantorSet 0 = Set.Icc 0 1


theorem Injective.nonempty_apply_iff {f : Set α → Set β} (hf : Injective f) (h2 : f ∅ = ∅)
    {s : Set α} : (f s).Nonempty ↔ s.Nonempty

{α : Type u_2}
{β : Type u_3}
{f : Set α → Set β}
(hf : Function.Injective f)
(h2 : f ∅ = ∅)
{s : Set α}


@[simp]
theorem toBlocks_fromBlocks₁₁ (A : Matrix n l α) (B : Matrix n m α) (C : Matrix o l α)
    (D : Matrix o m α) : (fromBlocks A B C D).toBlocks₁₁ = A

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type u_12}
(A : Matrix n l α)
(B : Matrix n m α)
(C : Matrix o l α)
(D : Matrix o m α)

(Matrix.fromBlocks A B C D).toBlocks₁₁ = A


/-- The **Stone-Weierstrass Approximation Theorem**,
that a subalgebra `A` of `C(X, ℝ)`, where `X` is a compact topological space,
is dense if it separates points.
-/
theorem subalgebra_topologicalClosure_eq_top_of_separatesPoints (A : Subalgebra ℝ C(X, ℝ))
    (w : A.SeparatesPoints) : A.topologicalClosure = ⊤

{X : Type u_1}
[TopologicalSpace X]
[CompactSpace X]
(A : Subalgebra ℝ C(X, ℝ))
(w : A.SeparatesPoints)


protected theorem IsFiberBundle.isCoveringMap {F : Type*} [TopologicalSpace F] [DiscreteTopology F]
    (hf : ∀ x : X, ∃ e : Trivialization F f, x ∈ e.baseSet) : IsCoveringMap f

{E : Type u_1}
{X : Type u_2}
[TopologicalSpace E]
[TopologicalSpace X]
{f : E → X}
{F : Type u_3}
[TopologicalSpace F]
[DiscreteTopology F]
(hf : ∀ (x : X), ∃ e, x ∈ e.baseSet)


theorem log_ofReal_mul {r : ℝ} (hr : 0 < r) {x : ℂ} (hx : x ≠ 0) :
    log (r * x) = Real.log r + log x

Complex.log (↑r * x) = ↑(Real.log r) + Complex.log x


theorem gauge_le_eq (hs₁ : Convex ℝ s) (hs₀ : (0 : E) ∈ s) (hs₂ : Absorbent ℝ s) (ha : 0 ≤ a) :
    { x | gauge s x ≤ a } = ⋂ (r : ℝ) (_ : a < r), r • s

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
{a : ℝ}
(hs₁ : Convex ℝ s)
(hs₀ : 0 ∈ s)
(hs₂ : Absorbent ℝ s)
(ha : 0 ≤ a)

{x | gauge s x ≤ a} = ⋂ r, ⋂ (_ : a < r), r • s


theorem factors_left_of_factors_add {X Y : C} {P : Subobject Y} (f g : X ⟶ Y)
    (w : P.Factors (f + g)) (wg : P.Factors g) : P.Factors f

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


/-- The imaginary unit. -/
@[simp, rclike_simps]
theorem I_re : re (I : K) = 0


theorem Decidable.iff_iff_not_or_and_or_not [Decidable a] [Decidable b] :
    (a ↔ b) ↔ (¬a ∨ b) ∧ (a ∨ ¬b)

{a b : Prop}
[Decidable a]
[Decidable b]


/-- In the space `ℝ`, the Hausdorff measure coincides exactly with the Lebesgue measure. -/
@[simp]
theorem hausdorffMeasure_real : (μH[1] : Measure ℝ) = volume


theorem lipschitzWith_iff_dist_le_mul [PseudoMetricSpace α] [PseudoMetricSpace β] {K : ℝ≥0}
    {f : α → β} : LipschitzWith K f ↔ ∀ x y, dist (f x) (f y) ≤ K * dist x y

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
{K : ℝ≥0}
{f : α → β}

LipschitzWith K f ↔ ∀ (x y : α), dist (f x) (f y) ≤ ↑K * dist x y


/--
The functor taking `(E : ℰ) (c : Cᵒᵖ)` to the homset `(A.obj C ⟶ E)`. It is shown in `L_adjunction`
that this functor has a left adjoint (provided `E` has colimits) given by taking colimits over
categories of elements.
In the case where `ℰ = Cᵒᵖ ⥤ Type u` and `A = yoneda`, this functor is isomorphic to the identity.

Defined as in [MM92], Chapter I, Section 5, Theorem 2.
-/
@[simps!]
def restrictedYoneda : ℰ ⥤ Cᵒᵖ ⥤ Type v₁

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

∀ (X_1 : Cᵒᵖ), ((CategoryTheory.Presheaf.restrictedYoneda A).obj X).obj X_1 = (A.obj (Opposite.unop X_1) ⟶ X)


@[simp, nolint simpNF]
theorem equiv_mul_right (g : G) (k : K) :
    hSK.equiv (g * k) = ((hSK.equiv g).fst, (hSK.equiv g).snd * k)

{G : Type u_1}
[Group G]
{K : Subgroup G}
{S : Set G}
(hSK : Subgroup.IsComplement S ↑K)
(g : G)
(k : ↥K)

hSK.equiv (g * ↑k) = ((hSK.equiv g).1, (hSK.equiv g).2 * k)


/-- The trivial comonoid object. We later show this is terminal in `Comon_ C`.
-/
@[simps]
def trivial : Comon_ C

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

(Comon_.trivial C).comul = (λ_ (𝟙_ C)).inv


theorem mem_irreducibleComponent {x : X} : x ∈ irreducibleComponent x

{X : Type u_1}
[TopologicalSpace X]
{x : X}


/-- Converting an augmented cosimplicial object to an augmented simplicial
object and back is isomorphic to the given object. -/
@[simps!]
def CosimplicialObject.Augmented.leftOpRightOpIso (X : CosimplicialObject.Augmented Cᵒᵖ) :
    X.leftOp.rightOp ≅ X

(X : CategoryTheory.CosimplicialObject.Augmented Cᵒᵖ)

∀ (X_1 : SimplexCategory), X.leftOpRightOpIso.inv.right.app X_1 = 𝟙 (X.right.obj X_1)


@[simp, norm_cast]
theorem coe_vadd {K : Type*} [VAdd K H] [VAddAssocClass K H H] (c : K) (f : G →+c[a, b] H) :
    ⇑(c +ᵥ f) = c +ᵥ ⇑f

{G : Type u_1}
{H : Type u_2}
[Add G]
[Add H]
{a : G}
{b : H}
{K : Type u_3}
[VAdd K H]
[VAddAssocClass K H H]
(c : K)
(f : AddConstMap G H a b)


@[to_additive]
theorem orderOf_snd_dvd_orderOf : orderOf x.2 ∣ orderOf x

{α : Type u_4}
{β : Type u_5}
[AddMonoid α]
[AddMonoid β]
{x : α × β}


protected theorem IsTotal.isTrichotomous (r) [IsTotal α r] : IsTrichotomous α r

{α : Type u}
(r : α → α → Prop)
[IsTotal α r]


theorem iterateFrobeniusEquiv_zero_apply (x : R) : iterateFrobeniusEquiv R p 0 x = x

(R : Type u_1)
(p : ℕ)
[CommSemiring R]
[ExpChar R p]
[PerfectRing R p]
(x : R)


theorem mapsTo_iUnion_iUnion {s : ι → Set α} {t : ι → Set β} {f : α → β}
    (H : ∀ i, MapsTo f (s i) (t i)) : MapsTo f (⋃ i, s i) (⋃ i, t i)

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


/-- A characterization of weak convergence in terms of integrals of bounded continuous
nonnegative functions. -/
theorem tendsto_iff_forall_lintegral_tendsto {γ : Type*} {F : Filter γ} {μs : γ → FiniteMeasure Ω}
    {μ : FiniteMeasure Ω} :
    Tendsto μs F (𝓝 μ) ↔
      ∀ f : Ω →ᵇ ℝ≥0,
        Tendsto (fun i => ∫⁻ x, f x ∂(μs i : Measure Ω)) F (𝓝 (∫⁻ x, f x ∂(μ : Measure Ω)))

{μs : γ → MeasureTheory.FiniteMeasure Ω}

Filter.Tendsto μs F (𝓝 μ) ↔
  ∀ (f : Ω →ᵇ ℝ≥0), Filter.Tendsto (fun i => ∫⁻ (x : Ω), ↑(f x) ∂↑(μs i)) F (𝓝 (∫⁻ (x : Ω), ↑(f x) ∂↑μ))


/-- Special case of the **Plünnecke-Ruzsa inequality**. Division version. -/
@[to_additive "Special case of the **Plünnecke-Ruzsa inequality**. Subtraction version."]
theorem pluennecke_ruzsa_inequality_pow_div (hA : A.Nonempty) (B : Finset α) (n : ℕ) :
    (B ^ n).card ≤ ((A / B).card / A.card : ℚ≥0) ^ n * A.card

{α : Type u_1}
[CommGroup α]
[DecidableEq α]
{A : Finset α}
(hA : A.Nonempty)
(B : Finset α)
(n : ℕ)

↑(B ^ n).card ≤ (↑(A / B).card / ↑A.card) ^ n * ↑A.card


private theorem add_rpow_le_one_of_add_le_one {p : ℝ} (a b : ℝ≥0) (hab : a + b ≤ 1) (hp1 : 1 ≤ p) :
    a ^ p + b ^ p ≤ 1


@[simp, norm_cast]
theorem coe_pow (x : ℤ_[p]) (n : ℕ) : (↑(x ^ n) : ℚ_[p]) = (↑x : ℚ_[p]) ^ n

{p : ℕ}
[Fact (Nat.Prime p)]
(x : ℤ_[p])
(n : ℕ)


@[simp]
theorem y_mul (a b : Solution₁ d) : (a * b).y = a.x * b.y + a.y * b.x


/-- Postcompose a partial equivalence with an equivalence.
We modify the source and target to have better definitional behavior. -/
@[simps!]
def transEquiv (e : PartialEquiv α β) (f' : β ≃ γ) : PartialEquiv α γ

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(e : PartialEquiv α β)
(f' : β ≃ γ)

(e.transEquiv f').target = ⇑f'.symm ⁻¹' e.target


@[to_additive]
lemma Monovary.div_left (h₁ : Monovary f₁ g) (h₂ : Antivary f₂ g) : Monovary (f₁ / f₂) g

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


@[to_additive]
theorem prod_finset_product (r : Finset (γ × α)) (s : Finset γ) (t : γ → Finset α)
    (h : ∀ p : γ × α, p ∈ r ↔ p.1 ∈ s ∧ p.2 ∈ t p.1) {f : γ × α → β} :
    ∏ p ∈ r, f p = ∏ c ∈ s, ∏ a ∈ t c, f (c, a)

(h : ∀ (p : γ × α), p ∈ r ↔ p.1 ∈ s ∧ p.2 ∈ t p.1)

{f : γ × α → β}


@[simp]
theorem liftHom_eq_algHom (f : R[X]) (ϕ : AdjoinRoot f →ₐ[R] S) :
    liftHom f (ϕ (root f)) (aeval_algHom_eq_zero f ϕ) = ϕ

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
(f : R[X])
(ϕ : AdjoinRoot f →ₐ[R] S)

AdjoinRoot.liftHom f (ϕ (AdjoinRoot.root f)) ⋯ = ϕ


/-- Known as Fatou's lemma, version with `AEMeasurable` functions -/
theorem lintegral_liminf_le' {f : ℕ → α → ℝ≥0∞} (h_meas : ∀ n, AEMeasurable (f n) μ) :
    ∫⁻ a, liminf (fun n => f n a) atTop ∂μ ≤ liminf (fun n => ∫⁻ a, f n a ∂μ) atTop

{f : ℕ → α → ℝ≥0∞}

(h_meas : ∀ (n : ℕ), AEMeasurable (f n) μ)

∫⁻ (a : α), Filter.liminf (fun n => f n a) Filter.atTop ∂μ ≤ Filter.liminf (fun n => ∫⁻ (a : α), f n a ∂μ) Filter.atTop


theorem some_append_some [Append α] (a b : α) : some a ++ some b = some (a ++ b)

Part.some a ++ Part.some b = Part.some (a ++ b)


theorem mem_span_singleton_trans {x y z : M} (hxy : x ∈ R ∙ y) (hyz : y ∈ R ∙ z) : x ∈ R ∙ z

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{x y z : M}
(hxy : x ∈ Submodule.span R {y})
(hyz : y ∈ Submodule.span R {z})


@[to_additive]
theorem dfinsupp_prod_apply [Monoid R] [CommMonoid S] (f : Π₀ i, β i) (g : ∀ i, β i → R →* S)
    (r : R) : (f.prod g) r = f.prod fun a b => (g a b) r

[(i : ι) → (x : β i) → Decidable (x ≠ 0)]


protected theorem ClosedComplemented.isClosed [TopologicalAddGroup M] [T1Space M]
    {p : Submodule R M} (h : ClosedComplemented p) : IsClosed (p : Set M)

{R : Type u_1}
[Ring R]
{M : Type u_2}
[TopologicalSpace M]
[AddCommGroup M]
[Module R M]
[TopologicalAddGroup M]
[T1Space M]
{p : Submodule R M}
(h : p.ClosedComplemented)


@[simp]
lemma toRows₂_apply (A : Matrix (m₁ ⊕ m₂) n R) (i : m₂) (j : n) :
    (toRows₂ A) i j = A (Sum.inr i) j

{R : Type u_1}
{m₁ : Type u_3}
{m₂ : Type u_4}
{n : Type u_5}
(A : Matrix (m₁ ⊕ m₂) n R)
(i : m₂)
(j : n)


theorem isRoot_of_mem_roots (h : a ∈ p.roots) : IsRoot p a

{R : Type u}
{a : R}
[CommRing R]
[IsDomain R]
{p : Polynomial R}
(h : a ∈ p.roots)


/-- The `vectorSpan` is the span of the pairwise subtractions with a given point on the left. -/
theorem vectorSpan_eq_span_vsub_set_left {s : Set P} {p : P} (hp : p ∈ s) :
    vectorSpan k s = Submodule.span k ((p -ᵥ ·) '' s)

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s : Set P}
{p : P}
(hp : p ∈ s)

vectorSpan k s = Submodule.span k ((fun x => p -ᵥ x) '' s)


theorem tail_append_singleton_of_ne_nil {a : α} {l : List α} (h : l ≠ nil) :
    tail (l ++ [a]) = tail l ++ [a]

{α : Type u}
{a : α}
{l : List α}
(h : l ≠ [])


@[simp] protected lemma inv_mul_le_one (a : ℝ≥0∞) : a⁻¹ * a ≤ 1


theorem eventually_forall_ge_atTop [Preorder α] {p : α → Prop} :
    (∀ᶠ x in atTop, ∀ y, x ≤ y → p y) ↔ ∀ᶠ x in atTop, p x

{α : Type u_3}
[Preorder α]
{p : α → Prop}

(∀ᶠ (x : α) in Filter.atTop, ∀ (y : α), x ≤ y → p y) ↔ ∀ᶠ (x : α) in Filter.atTop, p x


theorem _root_.Module.mem_annihilator {r} : r ∈ Module.annihilator R M ↔ ∀ m : M, r • m = 0

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{r : R}

r ∈ Module.annihilator R M ↔ ∀ (m : M), r • m = 0


/-- "Functoriality" of `MakesOverArrow η s` in `η`. -/
lemma map₁ {F G : Cᵒᵖ ⥤ Type v} {η : F ⟶ A} {μ : G ⟶ A} {ε : F ⟶ G}
    (hε : ε ≫ μ = η) {X : C} {s : yoneda.obj X ⟶ A} {u : F.obj (op X)}
    (h : MakesOverArrow η s u) : MakesOverArrow μ s (ε.app _ u)

{A F G : CategoryTheory.Functor Cᵒᵖ (Type v)}

(hε : CategoryTheory.CategoryStruct.comp ε μ = η)

(h : CategoryTheory.OverPresheafAux.MakesOverArrow η s u)

CategoryTheory.OverPresheafAux.MakesOverArrow μ s (ε.app (Opposite.op X) u)


@[simp, norm_cast]
theorem coe_im : (x : ℍ[R,c₁,c₂]).im = 0

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


/-- See `lt_tsub_iff_left_of_le` for a weaker statement in a partial order. -/
theorem lt_tsub_iff_left : a < b - c ↔ c + a < b

{α : Type u_1}
{a b c : α}
[LinearOrder α]
[AddCommSemigroup α]
[Sub α]
[OrderedSub α]


theorem pred_one' [NeZero n] (h := (zero_ne_one' (n := n)).symm) :
    Fin.pred (1 : Fin (n + 1)) h = 0


theorem ContinuousOn.const_cpow {b : ℂ} (hf : ContinuousOn f s) (h : b ≠ 0 ∨ ∀ a ∈ s, f a ≠ 0) :
    ContinuousOn (fun x => b ^ f x) s

{α : Type u_1}
[TopologicalSpace α]
{f : α → ℂ}
{s : Set α}
{b : ℂ}
(hf : ContinuousOn f s)
(h : b ≠ 0 ∨ ∀ a ∈ s, f a ≠ 0)


theorem mulPosReflectLT_iff_contravariant_pos :
    MulPosReflectLT α ↔ ContravariantClass α>0 α (fun x y => y * x) (· < ·)

{α : Type u_1}
[MulZeroClass α]
[PartialOrder α]

MulPosReflectLT α ↔ ContravariantClass { x // 0 < x } α (fun x y => y * ↑x) fun x x_1 => x < x_1


theorem integral_subtype_comap {α} [MeasurableSpace α] {μ : Measure α} {s : Set α}
    (hs : MeasurableSet s) (f : α → G) :
    ∫ x : s, f (x : α) ∂(Measure.comap Subtype.val μ) = ∫ x in s, f x ∂μ

{G : Type u_5}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{α : Type u_7}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{s : Set α}
(hs : MeasurableSet s)
(f : α → G)

∫ (x : ↑s), f ↑x ∂MeasureTheory.Measure.comap Subtype.val μ = ∫ (x : α) in s, f x ∂μ


@[simp]
theorem Ioc_disjoint_Ioc : Disjoint (Ioc a₁ a₂) (Ioc b₁ b₂) ↔ min a₂ b₂ ≤ max a₁ b₁

{α : Type v}
[LinearOrder α]
{a₁ a₂ b₁ b₂ : α}

Disjoint (Set.Ioc a₁ a₂) (Set.Ioc b₁ b₂) ↔ min a₂ b₂ ≤ max a₁ b₁


theorem image_symm_image (e : P₁ ≃ᵃL[k] P₂) (s : Set P₂) : e '' (e.symm '' s) = s

{k : Type u_1}
{P₁ : Type u_2}
{P₂ : Type u_3}
{V₁ : Type u_6}
{V₂ : Type u_7}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AddTorsor V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AddTorsor V₂ P₂]
[TopologicalSpace P₁]
[TopologicalSpace P₂]
(e : P₁ ≃ᵃL[k] P₂)
(s : Set P₂)


theorem le_minFac {m n : ℕ} : n = 1 ∨ m ≤ minFac n ↔ ∀ p, Prime p → p ∣ n → m ≤ p

n = 1 ∨ m ≤ n.minFac ↔ ∀ (p : ℕ), Nat.Prime p → p ∣ n → m ≤ p


/-- The intersection of a dense set with an open dense set is a dense set. -/
theorem Dense.inter_of_isOpen_right (hs : Dense s) (ht : Dense t) (hto : IsOpen t) :
    Dense (s ∩ t)

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


theorem add_mul_limit_aux {a b c : Ordinal} (ba : b + a = a) (l : IsLimit c)
    (IH : ∀ c' < c, (a + b) * succ c' = a * succ c' + b) : (a + b) * c = a * c

(IH : ∀ c' < c, (a + b) * Order.succ c' = a * Order.succ c' + b)


theorem periodicOrbit_apply_iterate_eq (hx : x ∈ periodicPts f) (n : ℕ) :
    periodicOrbit f (f^[n] x) = periodicOrbit f x

{α : Type u_1}
{f : α → α}
{x : α}
(hx : x ∈ Function.periodicPts f)
(n : ℕ)

Function.periodicOrbit f (f^[n] x) = Function.periodicOrbit f x


@[simp]
theorem neg_div_neg_eq (a b : K) : -a / -b = a / b

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


@[simp]
theorem lift_ι_apply (f : M →ₗ[R] A) (cond : ∀ m, f m * f m = 0) (x) :
    lift R ⟨f, cond⟩ (ι R x) = f x

(R : Type u1)
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]
{A : Type u_1}
[Semiring A]
[Algebra R A]
(f : M →ₗ[R] A)
(cond : ∀ (m : M), f m * f m = 0)
(x : M)

((ExteriorAlgebra.lift R) ⟨f, cond⟩) ((ExteriorAlgebra.ι R) x) = f x


theorem coe_deleteEdges_le : (G'.deleteEdges s).coe ≤ (G'.coe : SimpleGraph G'.verts)

{V : Type u}
{G : SimpleGraph V}
{G' : G.Subgraph}
(s : Set (Sym2 V))


theorem tendsto_ceil_right' (n : ℤ) :
    Tendsto (fun x => ceil x : α → α) (𝓝[>] n) (𝓝 (n + 1))

{α : Type u_1}
[LinearOrderedRing α]
[FloorRing α]
[TopologicalSpace α]
[OrderClosedTopology α]
(n : ℤ)

Filter.Tendsto (fun x => ↑⌈x⌉) (𝓝[>] ↑n) (𝓝 (↑n + 1))


theorem mem_perpBisector_iff_inner_eq_inner :
    c ∈ perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫ = ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{c p₁ p₂ : P}

c ∈ AffineSubspace.perpBisector p₁ p₂ ↔ ⟪c -ᵥ p₁, p₂ -ᵥ p₁⟫_ℝ = ⟪c -ᵥ p₂, p₁ -ᵥ p₂⟫_ℝ


@[to_additive]
theorem tprod_eq_zero_mul [T2Space G] {f : ℕ → G} (hf : Multipliable f) :
    ∏' b, f b = f 0 * ∏' b, f (b + 1)

{G : Type u_2}
[AddCommGroup G]
[TopologicalSpace G]
[TopologicalAddGroup G]
[T2Space G]
{f : ℕ → G}
(hf : Summable f)


@[simp] theorem continuous_prod_mk {f : X → Y} {g : X → Z} :
    (Continuous fun x => (f x, g x)) ↔ Continuous f ∧ Continuous g

{X : Type u}
{Y : Type v}
{Z : Type u_1}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{f : X → Y}
{g : X → Z}


@[simp]
lemma app_apply (d : M.Derivation' φ') {X : Dᵒᵖ} (b : R.obj X) :
    (d.app X).d b = d.d b

{M : PresheafOfModules (R ⋙ CategoryTheory.forget₂ CommRingCat RingCat)}


/-- An angle in a right-angled triangle is at most `π / 2`, version subtracting vectors. -/
theorem angle_sub_le_pi_div_two_of_inner_eq_zero {x y : V} (h : ⟪x, y⟫ = 0) :
    angle x (x - y) ≤ π / 2

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
{x y : V}
(h : ⟪x, y⟫_ℝ = 0)

InnerProductGeometry.angle x (x - y) ≤ π / 2


/-- Typeclass for monotonicity of scalar multiplication by nonnegative elements on the left,
namely `b₁ ≤ b₂ → a • b₁ ≤ a • b₂` if `0 ≤ a`.

You should usually not use this very granular typeclass directly, but rather a typeclass like
`OrderedSMul`. -/
class PosSMulMono : Prop where
  /-- Do not use this. Use `smul_le_smul_of_nonneg_left` instead. -/
  protected elim ⦃a : α⦄ (ha : 0 ≤ a) ⦃b₁ b₂ : β⦄ (hb : b₁ ≤ b₂) : a • b₁ ≤ a • b₂

{α : Type u_1}
{β : Type u_2}
[SMul α β]
[Preorder α]
[Preorder β]
[Zero α]
[self : PosSMulMono α β]
⦃a : α⦄
(ha : 0 ≤ a)
⦃b₁ b₂ : β⦄
(hb : b₁ ≤ b₂)

a • b₁ ≤ a • b₂


@[to_additive (attr := simp)]
theorem sym_eq_one_iff [One α] (a : α) : sym a = 1 ↔ a = 1


theorem monotone_id [Preorder α] : Monotone (id : α → α)


lemma map_exact {f : M →ₗ[R] M'} {g : M' →ₗ[R] M''}
    (hfg : Exact f g) (hg : Surjective g) : Exact (map r f) (map r g)

{R : Type u_2}
[CommRing R]
(r : R)
{M : Type u_1}
{M' : Type u_3}
{M'' : Type u_4}
[AddCommGroup M]
[Module R M]
[AddCommGroup M']
[Module R M']
[AddCommGroup M'']
[Module R M'']
{f : M →ₗ[R] M'}
{g : M' →ₗ[R] M''}
(hfg : Function.Exact ⇑f ⇑g)
(hg : Function.Surjective ⇑g)

Function.Exact ⇑((QuotSMulTop.map r) f) ⇑((QuotSMulTop.map r) g)


@[to_additive]
theorem of_mulOpposite (h : TwoUniqueProds Gᵐᵒᵖ) : TwoUniqueProds G

{G : Type u}
[Mul G]
(h : TwoUniqueProds Gᵐᵒᵖ)


theorem iff_false_iff : (a ↔ False) ↔ ¬a


theorem biUnion_diff_biUnion_subset (s₁ s₂ : Set α) :
    ((⋃ x ∈ s₁, t x) \ ⋃ x ∈ s₂, t x) ⊆ ⋃ x ∈ s₁ \ s₂, t x

{α : Type u_1}
{β : Type u_2}
(t : α → Set β)
(s₁ s₂ : Set α)

(⋃ x ∈ s₁, t x) \ ⋃ x ∈ s₂, t x ⊆ ⋃ x ∈ s₁ \ s₂, t x


theorem base_iff_maximal_indep : M.Base B ↔ M.Indep B ∧ ∀ I, M.Indep I → B ⊆ I → B = I

{α : Type u_1}
{M : Matroid α}
{B : Set α}

M.Base B ↔ M.Indep B ∧ ∀ (I : Set α), M.Indep I → B ⊆ I → B = I


@[measurability]
theorem Measurable.ceil [OpensMeasurableSpace R] {f : α → R} (hf : Measurable f) :
    Measurable fun x => ⌈f x⌉

{α : Type u_1}
{R : Type u_2}
[MeasurableSpace α]
[LinearOrderedRing R]
[FloorRing R]
[TopologicalSpace R]
[OrderTopology R]
[MeasurableSpace R]
[OpensMeasurableSpace R]
{f : α → R}
(hf : Measurable f)


lemma shiftFunctorAdd_zero_add_inv_app (a : A) (X : C) : (shiftFunctorAdd C 0 a).inv.app X =
    ((shiftFunctorZero C A).hom.app X)⟦a⟧' ≫ eqToHom (by dsimp; rw [zero_add])

{C : Type u}
{A : Type u_1}
[CategoryTheory.Category.{v, u} C]
[AddMonoid A]
[CategoryTheory.HasShift C A]
(a : A)
(X : C)

(CategoryTheory.shiftFunctorAdd C 0 a).inv.app X =
  CategoryTheory.CategoryStruct.comp
    ((CategoryTheory.shiftFunctor C a).map ((CategoryTheory.shiftFunctorZero C A).hom.app X)) (CategoryTheory.eqToHom ⋯)


theorem card_le_iff {o : Ordinal} {c : Cardinal} : o.card ≤ c ↔ o < (succ c).ord

{o : Ordinal.{u_3}}
{c : Cardinal.{u_3}}


lemma eq_or_eq_neg_of_sq_eq_sq (a b : R) : a ^ 2 = b ^ 2 → a = b ∨ a = -b

{R : Type x}
[CommRing R]
[NoZeroDivisors R]
(a b : R)


theorem bijective_eq_sup :
    MorphismProperty.bijective C = MorphismProperty.injective C ⊓ MorphismProperty.surjective C

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

CategoryTheory.MorphismProperty.bijective C =
  CategoryTheory.MorphismProperty.injective C ⊓ CategoryTheory.MorphismProperty.surjective C


/-- This is a special case of `WithTop.top_sub_coe` in the `ENNReal` namespace -/
@[simp] theorem top_sub_coe : ∞ - ↑r = ∞


@[simp]
theorem comp_apply (f : CompleteLatticeHom β γ) (g : CompleteLatticeHom α β) (a : α) :
    (f.comp g) a = f (g a)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[CompleteLattice α]
[CompleteLattice β]
[CompleteLattice γ]
(f : CompleteLatticeHom β γ)
(g : CompleteLatticeHom α β)
(a : α)


theorem mk_finsupp_of_fintype (α β : Type u) [Fintype α] [Zero β] :
    #(α →₀ β) = #β ^ Fintype.card α

Cardinal.mk (α →₀ β) = Cardinal.mk β ^ Fintype.card α


theorem convexHull_add (s t : Set E) : convexHull R (s + t) = convexHull R s + convexHull R t

{R : Type u_1}
{E : Type u_3}
[LinearOrderedField R]
[AddCommGroup E]
[Module R E]
(s t : Set E)

(convexHull R) (s + t) = (convexHull R) s + (convexHull R) t


@[to_additive]
theorem unit_mem_leftInv (x : Mˣ) (hx : (x : M) ∈ S) : ((x⁻¹ : _) : M) ∈ S.leftInv

{M : Type u_1}
[AddMonoid M]
(S : AddSubmonoid M)
(x : AddUnits M)
(hx : ↑x ∈ S)


/-- A function from a locally finite preorder is antitone if and only if it is antitone when
restricted to pairs satisfying `a ⩿ b`. -/
lemma antitone_iff_forall_wcovBy [Preorder α] [LocallyFiniteOrder α] [Preorder β]
    (f : α → β) : Antitone f ↔ ∀ a b : α, a ⩿ b → f b ≤ f a

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[LocallyFiniteOrder α]
[Preorder β]
(f : α → β)

Antitone f ↔ ∀ (a b : α), a ⩿ b → f b ≤ f a


lemma associator_naturality (f₁ : X₁ ⟶ Y₁) (f₂ : X₂ ⟶ Y₂) (f₃ : X₃ ⟶ Y₃)
    [HasGoodTensor₁₂Tensor X₁ X₂ X₃] [HasGoodTensorTensor₂₃ X₁ X₂ X₃]
    [HasGoodTensor₁₂Tensor Y₁ Y₂ Y₃] [HasGoodTensorTensor₂₃ Y₁ Y₂ Y₃] :
    tensorHom (tensorHom f₁ f₂) f₃ ≫ (associator Y₁ Y₂ Y₃).hom =
      (associator X₁ X₂ X₃).hom ≫ tensorHom f₁ (tensorHom f₂ f₃)

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

[(CategoryTheory.GradedObject.Monoidal.tensorObj X₁ X₂).HasTensor X₃]

[X₁.HasTensor (CategoryTheory.GradedObject.Monoidal.tensorObj X₂ X₃)]

{Y₁ Y₂ Y₃ : CategoryTheory.GradedObject I C}

[(CategoryTheory.GradedObject.Monoidal.tensorObj Y₁ Y₂).HasTensor Y₃]

[Y₁.HasTensor (CategoryTheory.GradedObject.Monoidal.tensorObj Y₂ Y₃)]

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.GradedObject.Monoidal.tensorHom (CategoryTheory.GradedObject.Monoidal.tensorHom f₁ f₂) f₃)
    (CategoryTheory.GradedObject.Monoidal.associator Y₁ Y₂ Y₃).hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.GradedObject.Monoidal.associator X₁ X₂ X₃).hom
    (CategoryTheory.GradedObject.Monoidal.tensorHom f₁ (CategoryTheory.GradedObject.Monoidal.tensorHom f₂ f₃))


protected theorem mono (f : F) : Monotone f

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
[FunLike F α β]
[OrderHomClass F α β]
(f : F)


theorem mk_image_eq_lift {α : Type u} {β : Type v} (f : α → β) (s : Set α) (h : Injective f) :
    lift.{u} #(f '' s) = lift.{v} #s

{α : Type u}
{β : Type v}
(f : α → β)
(s : Set α)
(h : Function.Injective f)

Cardinal.lift.{u, v} (Cardinal.mk ↑(f '' s)) = Cardinal.lift.{v, u} (Cardinal.mk ↑s)


theorem normalizeScaleRoots_monic (h : p ≠ 0) : (normalizeScaleRoots p).Monic

{R : Type u_1}
[CommRing R]
(p : R[X])
(h : p ≠ 0)


theorem le_mul_inv_iff₀ (hc : c ≠ 0) : a ≤ b * c⁻¹ ↔ a * c ≤ b

{α : Type u_1}
[LinearOrderedCommGroupWithZero α]
{a b c : α}
(hc : c ≠ 0)


@[simp]
theorem mk_eq_zero {a : α} : Associates.mk a = 0 ↔ a = 0

{α : Type u_1}
[MonoidWithZero α]
{a : α}


theorem divMonomial_zero (x : MvPolynomial σ R) : x /ᵐᵒⁿᵒᵐⁱᵃˡ 0 = x

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
(x : MvPolynomial σ R)


theorem comap_normalClosure (s : Set N) (f : G ≃* N) :
    normalClosure (f ⁻¹' s) = (normalClosure s).comap f

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
(s : Set N)
(f : G ≃* N)

Subgroup.normalClosure (⇑f ⁻¹' s) = Subgroup.comap (↑f) (Subgroup.normalClosure s)


theorem iteratedFDerivWithin_succ_apply_right {n : ℕ} (hs : UniqueDiffOn 𝕜 s) (hx : x ∈ s)
    (m : Fin (n + 1) → E) :
    (iteratedFDerivWithin 𝕜 (n + 1) f s x : (Fin (n + 1) → E) → F) m =
      iteratedFDerivWithin 𝕜 n (fun y => fderivWithin 𝕜 f s y) s x (init m) (m (last n))

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{x : E}
{n : ℕ}
(hs : UniqueDiffOn 𝕜 s)
(hx : x ∈ s)
(m : Fin (n + 1) → E)

(iteratedFDerivWithin 𝕜 (n + 1) f s x) m =
  ((iteratedFDerivWithin 𝕜 n (fun y => fderivWithin 𝕜 f s y) s x) (Fin.init m)) (m (Fin.last n))


@[to_additive (attr := simp)]
theorem orderOf_one : orderOf (1 : G) = 1


@[csimp] theorem dropSlice_eq_dropSliceTR : @dropSlice = @dropSliceTR


theorem sq_pos_of_pos (ha : 0 < a) : 0 < a ^ 2

{R : Type u_3}
[StrictOrderedSemiring R]
{a : R}
(ha : 0 < a)


@[simp]
theorem not_unbounded_iff {r : α → α → Prop} (s : Set α) : ¬Unbounded r s ↔ Bounded r s

{α : Type u}
{r : α → α → Prop}
(s : Set α)


@[to_additive le_of_nsmul_le_nsmul_right]
theorem le_of_pow_le_pow_left' {a b : M} {n : ℕ} (hn : n ≠ 0) : a ^ n ≤ b ^ n → a ≤ b

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

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


theorem norm_nonneg (hd : d ≤ 0) (n : ℤ√d) : 0 ≤ n.norm


theorem union_ae_eq_univ_of_ae_eq_univ_left (h : s =ᵐ[μ] univ) : (s ∪ t : Set α) =ᵐ[μ] univ

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


@[to_additive sum_add_card_nsmul]
theorem prod_mul_pow_card {b : β} : (∏ a ∈ s, f a) * b ^ s.card = ∏ a ∈ s, f a * b

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
{f : α → β}
[CommMonoid β]
{b : β}


@[simp]
lemma uniformEquicontinuous_empty [h : IsEmpty ι] (F : ι → β → α) :
    UniformEquicontinuous F

{ι : Type u_1}
{α : Type u_7}
{β : Type u_9}
[uα : UniformSpace α]
[uβ : UniformSpace β]
[h : IsEmpty ι]
(F : ι → β → α)


@[to_additive]
theorem le_iff_forall_lt_one_mul_le : a ≤ b ↔ ∀ ε < 1, a * ε ≤ b

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


/-- Any free group is isomorphic to "the" free group. -/
@[simps!]
def toFreeGroup : G ≃* FreeGroup (Generators G)

(G : Type u_1)
[Group G]
[IsFreeGroup G]

∀ (a : G), (IsFreeGroup.toFreeGroup G) a = (IsFreeGroup.mulEquiv G).symm a


theorem zero_le_padicValRat_of_nat (n : ℕ) : 0 ≤ padicValRat p n


@[simp]
theorem ofLex_apply (x : Lex (∀ i, β i)) (i : ι) : ofLex x i = x i

{ι : Type u_1}
{β : ι → Type u_2}
(x : Lex ((i : ι) → β i))
(i : ι)


theorem norm_le_of_forall_le' [Nonempty α] {f : lp E ∞} (C : ℝ) (hCf : ∀ i, ‖f i‖ ≤ C) :
    ‖f‖ ≤ C

{α : Type u_1}
{E : α → Type u_2}
[(i : α) → NormedAddCommGroup (E i)]
[Nonempty α]
{f : ↥(lp E ⊤)}
(C : ℝ)
(hCf : ∀ (i : α), ‖↑f i‖ ≤ C)


lemma map_filter' (p : α → Prop) [DecidablePred p] (f : α ↪ β) (s : Finset α)
    [DecidablePred (∃ a, p a ∧ f a = ·)] :
    (s.filter p).map f = (s.map f).filter fun b => ∃ a, p a ∧ f a = b

[DecidablePred fun x => ∃ a, p a ∧ f a = x]

Finset.map f (Finset.filter p s) = Finset.filter (fun b => ∃ a, p a ∧ f a = b) (Finset.map f s)


theorem union_sdiff_distrib (s₁ s₂ t : Finset α) : (s₁ ∪ s₂) \ t = s₁ \ t ∪ s₂ \ t

{α : Type u_1}
[DecidableEq α]
(s₁ s₂ t : Finset α)


theorem exists_add_pow_prime_pow_eq (hp : p.Prime) (x y : R) (n : ℕ) :
    ∃ r, (x + y) ^ p ^ n = x ^ p ^ n + y ^ p ^ n + p * r

{R : Type u_1}
[CommSemiring R]
{p : ℕ}
(hp : Nat.Prime p)
(x y : R)
(n : ℕ)

∃ r, (x + y) ^ p ^ n = x ^ p ^ n + y ^ p ^ n + ↑p * r


@[simp] theorem sum_cons : Nat.sum (a :: l) = a + Nat.sum l


@[to_additive]
theorem contMDiffAt_finset_prod' (h : ∀ i ∈ t, ContMDiffAt I' I n (f i) x) :
    ContMDiffAt I' I n (∏ i ∈ t, f i) x


@[simp]
theorem coe_map' {f : M → N} (hf : IsMonoidHom f) (x : Mˣ) : ↑((map' hf : Mˣ → Nˣ) x) = f x

{M : Type u_1}
{N : Type u_2}
[Monoid M]
[Monoid N]
{f : M → N}
(hf : IsMonoidHom f)
(x : Mˣ)


theorem eq_zero_iff_coeFn_eq_zero {f : lp E p} : f = 0 ↔ ⇑f = 0

{α : Type u_1}
{E : α → Type u_2}
{p : ℝ≥0∞}
[(i : α) → NormedAddCommGroup (E i)]
{f : ↥(lp E p)}


@[simp]
theorem conjTranspose_ofNat [DecidableEq n] [Semiring α] [StarRing α] (d : ℕ) [d.AtLeastTwo] :
    (no_index (OfNat.ofNat d) : Matrix n n α)ᴴ = OfNat.ofNat d

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[Semiring α]
[StarRing α]
(d : ℕ)
[d.AtLeastTwo]


theorem eq_C_content_mul_primPart (p : R[X]) : p = C p.content * p.primPart

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


theorem HasFPowerSeriesAt.coeff_zero (hf : HasFPowerSeriesAt f pf x) (v : Fin 0 → E) :
    pf 0 v = f x

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


/-- Lift an unbundled representation to `FDRep`. -/
@[simps ρ]
def of {V : Type u} [AddCommGroup V] [Module k V] [FiniteDimensional k V]
    (ρ : Representation k G V) : FDRep k G

{k G : Type u}
[Field k]
[Monoid G]
{V : Type u}
[AddCommGroup V]
[Module k V]
[FiniteDimensional k V]
(ρ : Representation k G V)


/-- A version of `Equiv.mulRight a⁻¹ b` that is defeq to `b / a`. -/
@[to_additive (attr := simps) " A version of `Equiv.addRight (-a) b` that is defeq to `b - a`. "]
protected def divRight (a : G) : G ≃ G


@[simp]
lemma associatesNonZeroDivisorsEquiv_symm_mk_mk (a : M₀) (ha) :
    associatesNonZeroDivisorsEquiv.symm ⟦⟨a, ha⟩⟧ = ⟨⟦a⟧, mk_mem_nonZeroDivisors_associates.2 ha⟩

{M₀ : Type u_2}
[CommMonoidWithZero M₀]
(a : M₀)
(ha : a ∈ M₀⁰)

associatesNonZeroDivisorsEquiv.symm ⟦⟨a, ha⟩⟧ = ⟨⟦a⟧, ⋯⟩


/-- Families of `AddMonoidHom`s preserving `DirectSum.One.one` and `DirectSum.Mul.mul`
are isomorphic to `RingHom`s on `⨁ i, A i`. This is a stronger version of `DFinsupp.liftAddHom`.
-/
@[simps]
def liftRingHom :
    { f : ∀ {i}, A i →+ R //
        f GradedMonoid.GOne.one = 1 ∧
          ∀ {i j} (ai : A i) (aj : A j), f (GradedMonoid.GMul.mul ai aj) = f ai * f aj } ≃
      ((⨁ i, A i) →+* R)

{ι : Type u_1}
[DecidableEq ι]
{A : ι → Type u_2}
{R : Type u_3}
[(i : ι) → AddCommMonoid (A i)]
[AddMonoid ι]
[DirectSum.GSemiring A]
[Semiring R]
(F : (DirectSum ι fun i => A i) →+* R)
{i : ι}

↑(DirectSum.liftRingHom.symm F) = (↑F).comp (DirectSum.of A i)


@[simp]
theorem Equiv.Perm.decomposeFin_symm_of_refl {n : ℕ} (p : Fin (n + 1)) :
    Equiv.Perm.decomposeFin.symm (p, Equiv.refl _) = swap 0 p

Equiv.Perm.decomposeFin.symm (p, Equiv.refl (Fin n)) = Equiv.swap 0 p


lemma ne_zero_of_mem_divisorsAntidiagonal {p : ℕ × ℕ} (hp : p ∈ n.divisorsAntidiagonal) :
    p.1 ≠ 0 ∧ p.2 ≠ 0

{n : ℕ}
{p : ℕ × ℕ}
(hp : p ∈ n.divisorsAntidiagonal)


theorem Memℒp.eLpNorm_lt_top {f : α → E} (hfp : Memℒp f p μ) : eLpNorm f p μ < ∞

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{f : α → E}
(hfp : MeasureTheory.Memℒp f p μ)


@[simp]
theorem mk'_zero (s : S) : mk' f 0 s = 0

{R : Type u_1}
[CommSemiring R]
{S : Submonoid R}
{M : Type u_2}
{M' : Type u_3}
[AddCommMonoid M]
[AddCommMonoid M']
[Module R M]
[Module R M']
(f : M →ₗ[R] M')
[IsLocalizedModule S f]
(s : ↥S)


/-- Simplify subtraction for a torsor for an `AddGroup G` over
itself. -/
@[simp]
theorem vsub_eq_sub {G : Type*} [AddGroup G] (g₁ g₂ : G) : g₁ -ᵥ g₂ = g₁ - g₂


@[simp]
theorem add_star_self (x : R) : IsSelfAdjoint (x + star x)

{R : Type u_1}
[AddCommMonoid R]
[StarAddMonoid R]
(x : R)


theorem cons_injective_left (s : Stream' α) : Function.Injective fun x => cons x s

Function.Injective fun x => Stream'.cons x s


theorem Base.basis_of_subset (hX : X ⊆ M.E := by aesop_mat) (hB : M.Base B) (hBX : B ⊆ X) :
    M.Basis B X

{α : Type u_1}
{M : Matroid α}
{B X : Set α}
(hX : X ⊆ M.E := by aesop_mat)
(hB : M.Base B)
(hBX : B ⊆ X)


theorem interUnionPullbackConeLift_right :
    interUnionPullbackConeLift F U V s ≫ F.1.map (homOfLE le_sup_right).op = s.snd

(s :
  CategoryTheory.Limits.PullbackCone (F.val.map (CategoryTheory.homOfLE ⋯).op)
    (F.val.map (CategoryTheory.homOfLE ⋯).op))

F.interUnionPullbackConeLift U V s ≫ F.val.map (CategoryTheory.homOfLE ⋯).op = s.snd


lemma iCondIndep_iff (m : ι → MeasurableSpace Ω) (hm : ∀ i, m i ≤ mΩ)
    (μ : @Measure Ω mΩ) [IsFiniteMeasure μ] :
    iCondIndep m' hm' m μ
      ↔ ∀ (s : Finset ι) {f : ι → Set Ω} (_H : ∀ i, i ∈ s → MeasurableSet[m i] (f i)),
      μ⟦⋂ i ∈ s, f i | m'⟧ =ᵐ[μ] ∏ i ∈ s, (μ⟦f i | m'⟧)

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

ProbabilityTheory.iCondIndep m' hm' m μ ↔
  ∀ (s : Finset ι) {f : ι → Set Ω},
    (∀ i ∈ s, MeasurableSet (f i)) →
      μ[(⋂ i ∈ s, f i).indicator fun ω => 1|m'] =ᵐ[μ] ∏ i ∈ s, μ[(f i).indicator fun ω => 1|m']


theorem zero_mem_ℒp' : Memℒp (fun _ : α => (0 : E)) p μ

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


theorem pow_apply_mem_of_forall_mem {p : Submodule R M} (n : ℕ) (h : ∀ x ∈ p, f' x ∈ p) (x : M)
    (hx : x ∈ p) : (f' ^ n) x ∈ p

{R : Type u_1}
{M : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{f' : M →ₗ[R] M}
{p : Submodule R M}
(n : ℕ)
(h : ∀ x ∈ p, f' x ∈ p)
(x : M)
(hx : x ∈ p)


@[simp]
theorem multinomial_zero [DecidableEq α] : multinomial (0 : Multiset α) = 1


theorem Finset.support_sum_eq [AddCommMonoid M] (s : Finset (ι →₀ M))
    (hs : (s : Set (ι →₀ M)).PairwiseDisjoint Finsupp.support) :
    (s.sum id).support = Finset.sup s Finsupp.support

(hs : (↑s).PairwiseDisjoint Finsupp.support)

(s.sum id).support = s.sup Finsupp.support


theorem mem_rec_on {C : Seq α → Prop} {a s} (M : a ∈ s)
    (h1 : ∀ b s', a = b ∨ C s' → C (cons b s')) : C s

(h1 : ∀ (b : α) (s' : Stream'.Seq α), a = b ∨ C s' → C (Stream'.Seq.cons b s'))


/-- Composing on the right by a function preserves uniform convergence -/
theorem TendstoUniformly.comp (h : TendstoUniformly F f p) (g : γ → α) :
    TendstoUniformly (fun n => F n ∘ g) (f ∘ g) p

{α : Type u}
{β : Type v}
{γ : Type w}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{f : α → β}
{p : Filter ι}
(h : TendstoUniformly F f p)
(g : γ → α)


@[simp]
theorem ofDual_symmDiff (a b : αᵒᵈ) : ofDual (a ∆ b) = ofDual a ⇔ ofDual b

{α : Type u_2}
[GeneralizedHeytingAlgebra α]
(a b : αᵒᵈ)

OrderDual.ofDual (a ∆ b) = OrderDual.ofDual a ⇔ OrderDual.ofDual b


@[simp (high)]
theorem coe_comp {M N K : SemiNormedGrp} (f : M ⟶ N) (g : N ⟶ K) :
    (f ≫ g : M → K) = g ∘ f


theorem not_isUnit_of_degree_pos (p : R[X])
    (hpl : 0 < p.degree) : ¬ IsUnit p

{R : Type u}
[Semiring R]
[NoZeroDivisors R]
(p : R[X])
(hpl : 0 < p.degree)


theorem iIndepSet.indep_generateFrom_le [LinearOrder ι] [IsMarkovKernel κ] {s : ι → Set Ω}
    (hsm : ∀ n, MeasurableSet (s n)) (hs : iIndepSet s κ μ) (i : ι) {k : ι} (hk : i < k) :
    Indep (generateFrom {s k}) (generateFrom { t | ∃ j ≤ i, s j = t }) κ μ

(hs : ProbabilityTheory.Kernel.iIndepSet s κ μ)

ProbabilityTheory.Kernel.Indep (MeasurableSpace.generateFrom {s k})
  (MeasurableSpace.generateFrom {t | ∃ j ≤ i, s j = t}) κ μ


/--
The defining property of a balanced path: If `path` is a `c₀,n₀` tree with a `c,n` hole,
then filling the hole with a `c,n` tree yields a `c₀,n₀` tree.
-/
protected theorem Balanced.fill {path : Path α} {t} :
    path.Balanced c₀ n₀ c n → t.Balanced c n → (path.fill t).Balanced c₀ n₀

{α : Type u_1}
{c₀ : Batteries.RBColor}
{n₀ : Nat}
{c : Batteries.RBColor}
{n : Nat}
{path : Batteries.RBNode.Path α}
{t : Batteries.RBNode α}

Batteries.RBNode.Path.Balanced c₀ n₀ path c n → t.Balanced c n → (path.fill t).Balanced c₀ n₀


theorem toEquiv_injective : Function.Injective (toEquiv : α ≃ᵤ β → α ≃ β)

{α : Type u}
{β : Type u_1}
[UniformSpace α]
[UniformSpace β]


theorem fixingSubmonoid_antitone : Antitone fun s : Set α => fixingSubmonoid M s

(M : Type u_1)
(α : Type u_2)
[Monoid M]
[MulAction M α]


/-- `star` as a `RingEquiv` from `R` to `Rᵐᵒᵖ` -/
@[simps apply]
def starRingEquiv [NonUnitalNonAssocSemiring R] [StarRing R] : R ≃+* Rᵐᵒᵖ

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

starRingEquiv x = MulOpposite.op (star x)


theorem blsub_le_iff {o : Ordinal.{u}} {f : ∀ a < o, Ordinal.{max u v}} {a} :
    blsub.{_, v} o f ≤ a ↔ ∀ i h, f i h < a

{f : (a : Ordinal.{u}) → a < o → Ordinal.{max u v}}

o.blsub f ≤ a ↔ ∀ (i : Ordinal.{u}) (h : i < o), f i h < a


lemma _root_.MeasureTheory.AEStronglyMeasurable.identDistrib_mk
    [TopologicalSpace γ] [PseudoMetrizableSpace γ] [BorelSpace γ]
    (hf : AEStronglyMeasurable f μ) : IdentDistrib f (hf.mk f) μ μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

ProbabilityTheory.IdentDistrib f (MeasureTheory.AEStronglyMeasurable.mk f hf) μ μ


theorem split_apply (i : ι) (x : αs i) : split l i x = l ⟨i, x⟩

{ι : Type u_4}
{M : Type u_5}
{αs : ι → Type u_13}
[Zero M]
(l : (i : ι) × αs i →₀ M)
(i : ι)
(x : αs i)


/-- A bicategory structure on the oplax functors between bicategories. -/
-- Porting note: verified that projections are correct and changed @[simps] to @[simps!]
@[simps!]
instance OplaxFunctor.bicategory : Bicategory (OplaxFunctor B C)

(B : Type u₁)
[CategoryTheory.Bicategory B]
(C : Type u₂)
[CategoryTheory.Bicategory C]
(F G : CategoryTheory.OplaxFunctor B C)

(F ⟶ G) = CategoryTheory.OplaxNatTrans F G


theorem ext_iff {f g : A →ₛₙₐ[φ] B} : f = g ↔ ∀ x, f x = g x

{R : Type u}
{S : Type u₁}
[Monoid R]
[Monoid S]
{φ : R →* S}
{A : Type v}
{B : Type w}
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction S B]
{f g : A →ₛₙₐ[φ] B}


/-- A congruence relation on a type with a multiplication is an equivalence relation which
    preserves multiplication. -/
@[to_additive AddCon]
structure Con [Mul M] extends Setoid M where
  /-- Congruence relations are closed under multiplication -/
  mul' : ∀ {w x y z}, r w x → r y z → r (w * y) (x * z)

{M : Type u_1}
[Mul M]
(self : Con M)
{w x y z : M}

Setoid.r w x → Setoid.r y z → Setoid.r (w * y) (x * z)


theorem _root_.Finset.eventually_cofinite_nmem (s : Finset α) : ∀ᶠ x in cofinite, x ∉ s


/-- `Complex.arg ∘ (↑)` and `expMapCircle` define a partial equivalence between `circle` and `ℝ`
with `source = Set.univ` and `target = Set.Ioc (-π) π`. -/
@[simps (config := .asFn)]
noncomputable def argPartialEquiv : PartialEquiv circle ℝ

↑circle.argPartialEquiv = Complex.arg ∘ Subtype.val


lemma Ψ₃_ne_zero (h : (3 : R) ≠ 0) : W.Ψ₃ ≠ 0

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
(h : 3 ≠ 0)


theorem circleTransformDeriv_eq (f : ℂ → E) : circleTransformDeriv R z w f =
    fun θ => (circleMap z R θ - w)⁻¹ • circleTransform R z w f θ

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(R : ℝ)
(z w : ℂ)
(f : ℂ → E)

Complex.circleTransformDeriv R z w f = fun θ => (circleMap z R θ - w)⁻¹ • Complex.circleTransform R z w f θ


/-- A function `f : α × β → StieltjesFunction` is called a conditional kernel CDF of `κ` with
respect to `ν` if it is measurable, tends to to 0 at -∞ and to 1 at +∞ for all `p : α × β`,
`fun b ↦ f (a, b) x` is `(ν a)`-integrable for all `a : α` and `x : ℝ` and for all
measurable sets `s : Set β`, `∫ b in s, f (a, b) x ∂(ν a) = (κ a (s ×ˢ Iic x)).toReal`. -/
structure IsCondKernelCDF (f : α × β → StieltjesFunction) (κ : Kernel α (β × ℝ)) (ν : Kernel α β) :
    Prop :=
  measurable (x : ℝ) : Measurable fun p ↦ f p x
  integrable (a : α) (x : ℝ) : Integrable (fun b ↦ f (a, b) x) (ν a)
  tendsto_atTop_one (p : α × β) : Tendsto (f p) atTop (𝓝 1)
  tendsto_atBot_zero (p : α × β) : Tendsto (f p) atBot (𝓝 0)
  setIntegral (a : α) {s : Set β} (_hs : MeasurableSet s) (x : ℝ) :
    ∫ b in s, f (a, b) x ∂(ν a) = (κ a (s ×ˢ Iic x)).toReal

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

(self : ProbabilityTheory.IsCondKernelCDF f κ ν)


@[simp]
theorem orthogonalProjectionFn_eq {s : AffineSubspace ℝ P} [Nonempty s]
    [HasOrthogonalProjection s.direction] (p : P) :
    orthogonalProjectionFn s p = orthogonalProjection s p

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{s : AffineSubspace ℝ P}
[Nonempty ↥s]
[HasOrthogonalProjection s.direction]
(p : P)

EuclideanGeometry.orthogonalProjectionFn s p = ↑((EuclideanGeometry.orthogonalProjection s) p)


/-- An equivalence of categories `e` between `C` and `D` induces an equivalence between
    `MonoOver X` and `MonoOver (e.functor.obj X)` whenever `X` is an object of `C`. -/
@[simps]
def congr (e : C ≌ D) : MonoOver X ≌ MonoOver (e.functor.obj X)

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

(CategoryTheory.MonoOver.congr X e).functor = CategoryTheory.MonoOver.lift (CategoryTheory.Over.post e.functor) ⋯


@[norm_cast] lemma coe_ceilDiv_def (f : ι →₀ β) (a : α) : f ⌈/⌉ a = fun i ↦ f i ⌈/⌉ a

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedAddCommMonoid α]
[OrderedAddCommMonoid β]
[SMulZeroClass α β]
[CeilDiv α β]
(f : ι →₀ β)
(a : α)


@[to_additive]
theorem isOpen_of_openSubgroup [ContinuousMul G] (H: Subgroup G) {U : OpenSubgroup G} (h : ↑U ≤ H) :
    IsOpen (H : Set G)

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]
[ContinuousAdd G]
(H : AddSubgroup G)
{U : OpenAddSubgroup G}
(h : ↑U ≤ H)


@[simp]
theorem natCoe_nat (f : ArithmeticFunction ℕ) : natToArithmeticFunction f = f


@[simp, norm_cast]
lemma AddMonoidHom.coe_toMultiplicative' [MulOneClass α] [AddZeroClass β] (f : Additive α →+ β) :
    ⇑(toMultiplicative' f) = ofAdd ∘ f ∘ ofMul

{α : Type u}
{β : Type v}
[MulOneClass α]
[AddZeroClass β]
(f : Additive α →+ β)

⇑(AddMonoidHom.toMultiplicative' f) = ⇑Multiplicative.ofAdd ∘ ⇑f ∘ ⇑Additive.ofMul


@[simp]
theorem upper_mem_Icc (I : Box ι) : I.upper ∈ Box.Icc I


lemma map_inverseImage_le (P : MorphismProperty D) (F : C ⥤ D) :
    (P.inverseImage F).map F ≤ P.isoClosure

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


lemma not_equiv_of_Z_eq_zero_left {P Q : Fin 3 → R} (hPz : P z = 0) (hQz : Q z ≠ 0) : ¬P ≈ Q

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


theorem coe_image_subset (s : Set α) (t : Set s) : ((↑) : s → α) '' t ⊆ s


@[to_additive]
theorem smul_inter_subset : s • (t₁ ∩ t₂) ⊆ s • t₁ ∩ s • t₂

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


/-- The composition of braided monoidal functors. -/
@[simps!]
def comp (F : BraidedFunctor C D) (G : BraidedFunctor D E) : BraidedFunctor C E

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.BraidedCategory C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
[CategoryTheory.MonoidalCategory D]
[CategoryTheory.BraidedCategory D]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
[CategoryTheory.MonoidalCategory E]
[CategoryTheory.BraidedCategory E]
(F : CategoryTheory.BraidedFunctor C D)
(G : CategoryTheory.BraidedFunctor D E)

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


@[simp]
lemma comp_add [∀ (a : M), (shiftFunctor C a).Additive]
    {a b c : M} (α : ShiftedHom X Y a) (β₁ β₂ : ShiftedHom Y Z b) (h : b + a = c) :
    α.comp (β₁ + β₂) h = α.comp β₁ h + α.comp β₂ h

[∀ (a : M), (CategoryTheory.shiftFunctor C a).Additive]

(β₁ β₂ : CategoryTheory.ShiftedHom Y Z b)


/-- All `m`, `0 < m < n` are `n`-smooth numbers -/
lemma mem_smoothNumbers_of_lt {m n : ℕ} (hm : 0 < m) (hmn : m < n) : m ∈ n.smoothNumbers


theorem forall' {p : α → β → Prop} : (∀ x : α × β, p x.1 x.2) ↔ ∀ a b, p a b

{α : Type u_1}
{β : Type u_2}
{p : α → β → Prop}

(∀ (x : α × β), p x.1 x.2) ↔ ∀ (a : α) (b : β), p a b


theorem exists_mem_nhds_ball_subset_of_mem_nhds {a : α} {U : Set α} (h : U ∈ 𝓝 a) :
    ∃ V ∈ 𝓝 a, ∃ t ∈ 𝓤 α, ∀ a' ∈ V, UniformSpace.ball a' t ⊆ U

{α : Type ua}
[UniformSpace α]
{a : α}
{U : Set α}
(h : U ∈ 𝓝 a)


theorem withTopEquiv_symm_le {x y : ℕ∞} : withTopEquiv.symm x ≤ withTopEquiv.symm y ↔ x ≤ y

PartENat.withTopEquiv.symm x ≤ PartENat.withTopEquiv.symm y ↔ x ≤ y


@[simp]
theorem coe_copy (f : A →⋆ₙₐ[R] B) (f' : A → B) (h : f' = f) : ⇑(f.copy f' h) = f'

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[Monoid R]
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[Star A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction R B]
[Star B]
(f : A →⋆ₙₐ[R] B)
(f' : A → B)
(h : f' = ⇑f)


/-- Closure of a subsemigroup `S` equals `S`. -/
@[to_additive (attr := simp) "Additive closure of an additive subsemigroup `S` equals `S`"]
theorem closure_eq : closure (S : Set M) = S

{M : Type u_1}
[Mul M]
(S : Subsemigroup M)


theorem pos_iff_one_le {a : ℤ} : 0 < a ↔ 1 ≤ a


theorem CauchySeq.tendsto_uniformity [Preorder β] {u : β → α} (h : CauchySeq u) :
    Tendsto (Prod.map u u) atTop (𝓤 α)

{α : Type u}
{β : Type v}
[uniformSpace : UniformSpace α]
[Preorder β]
{u : β → α}
(h : CauchySeq u)

Filter.Tendsto (Prod.map u u) Filter.atTop (𝓤 α)


/-- Auxiliary definition for the proof of the shrinking lemma. A partial refinement of a covering
`⋃ i, u i` of a set `s` is a map `v : ι → Set X` and a set `carrier : Set ι` such that

* `s ⊆ ⋃ i, v i`;
* all `v i` are open;
* if `i ∈ carrier v`, then `closure (v i) ⊆ u i`;
* if `i ∉ carrier`, then `v i = u i`.

This type is equipped with the following partial order: `v ≤ v'` if `v.carrier ⊆ v'.carrier`
and `v i = v' i` for `i ∈ v.carrier`. We will use Zorn's lemma to prove that this type has
a maximal element, then show that the maximal element must have `carrier = univ`. -/
-- Porting note(#5171): this linter isn't ported yet. @[nolint has_nonempty_instance]
@[ext] structure PartialRefinement (u : ι → Set X) (s : Set X) where
  /-- A family of sets that form a partial refinement of `u`. -/
  toFun : ι → Set X
  /-- The set of indexes `i` such that `i`-th set is already shrunk. -/
  carrier : Set ι
  /-- Each set from the partially refined family is open. -/
  protected isOpen : ∀ i, IsOpen (toFun i)
  /-- The partially refined family still covers the set. -/
  subset_iUnion : s ⊆ ⋃ i, toFun i
  /-- For each `i ∈ carrier`, the original set includes the closure of the refined set. -/
  closure_subset : ∀ {i}, i ∈ carrier → closure (toFun i) ⊆ u i
  /-- Sets that correspond to `i ∉ carrier` are not modified. -/
  apply_eq : ∀ {i}, i ∉ carrier → toFun i = u i

(self : ShrinkingLemma.PartialRefinement u s)


@[simp]
theorem fderiv_eq_smul_deriv (y : 𝕜) : (fderiv 𝕜 f x : 𝕜 → F) y = y • deriv f x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{x : 𝕜}
(y : 𝕜)


/-- We can define `esymm σ R n` by summing over a subtype instead of over `powerset_len`. -/
theorem esymm_eq_sum_subtype (n : ℕ) :
    esymm σ R n = ∑ t : { s : Finset σ // s.card = n }, ∏ i ∈ (t : Finset σ), X i

(σ : Type u_1)
(R : Type u_2)
[CommSemiring R]
[Fintype σ]
(n : ℕ)

MvPolynomial.esymm σ R n = ∑ t : { s // s.card = n }, ∏ i ∈ ↑t, MvPolynomial.X i


theorem sub_apply (f g : E →ₗ.[R] F) (x : (f.domain ⊓ g.domain : Submodule R E)) :
    (f - g) x = f ⟨x, x.prop.1⟩ - g ⟨x, x.prop.2⟩

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
(f g : E →ₗ.[R] F)
(x : ↥(f.domain ⊓ g.domain))


/-- **Henstock-Sacks inequality**. Let `r : ℝⁿ → (0, ∞)` be a function such that for any tagged
*partition* of `I` subordinate to `r`, the integral sum of `f` over this partition differs from the
integral of `f` by at most `ε`. Then for any tagged *prepartition* `π` subordinate to `r`, the
integral sum of `f` over this prepartition differs from the integral of `f` over the part of `I`
covered by `π` by at most `ε`.

The actual statement

- uses `BoxIntegral.Integrable.convergenceR` instead of a predicate assumption on `r`;
- uses `BoxIntegral.IntegrationParams.MemBaseSet` instead of “subordinate to `r`” to
  account for additional requirements like being a Henstock partition or having a bounded
  distortion;
-/
theorem dist_integralSum_sum_integral_le_of_memBaseSet (h : Integrable I l f vol) (h0 : 0 < ε)
    (hπ : l.MemBaseSet I c (h.convergenceR ε c) π) :
    dist (integralSum f vol π) (∑ J ∈ π.boxes, integral J l f vol) ≤ ε

dist (BoxIntegral.integralSum f vol π) (∑ J ∈ π.boxes, BoxIntegral.integral J l f vol) ≤ ε


@[simp]
theorem prod_bot_sup_bot_prod (s : Subring R) (t : Subring S) : s.prod ⊥ ⊔ prod ⊥ t = s.prod t

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
(s : Subring R)
(t : Subring S)


theorem re_tsum {f : α → ℂ} (h : Summable f) : (∑' a, f a).re = ∑' a, (f a).re

{α : Type u_1}
{f : α → ℂ}
(h : Summable f)


@[simp] theorem add_get (xs ys : IntList) (i : Nat) : (xs + ys).get i = xs.get i + ys.get i


@[simp]
theorem coe_mk (f : R →*₀ Γ₀) (h) : ⇑(Valuation.mk f h) = f

(h : ∀ (x y : R), (↑f).toFun (x + y) ≤ max ((↑f).toFun x) ((↑f).toFun y))

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


theorem adjoin_roots_cyclotomic_eq_adjoin_root_cyclotomic {n : ℕ+} [IsDomain B] {ζ : B}
    (hζ : IsPrimitiveRoot ζ n) : adjoin A ((cyclotomic n A).rootSet B) = adjoin A {ζ}

{A : Type u}
{B : Type v}
[CommRing A]
[CommRing B]
[Algebra A B]
{n : ℕ+}
[IsDomain B]
{ζ : B}
(hζ : IsPrimitiveRoot ζ ↑n)

Algebra.adjoin A ((Polynomial.cyclotomic (↑n) A).rootSet B) = Algebra.adjoin A {ζ}


/-- If the angle between two vectors is `π / 2`, the second vector is nonzero. -/
theorem right_ne_zero_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = (π / 2 : ℝ)) : y ≠ 0

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


/-- The effective epimorphisms in `TopCat` are precisely the quotient maps. -/
theorem effectiveEpi_iff_quotientMap {B X : TopCat.{u}} (π : X ⟶ B) :
    EffectiveEpi π ↔ QuotientMap π

CategoryTheory.EffectiveEpi π ↔ QuotientMap ⇑π


@[simp]
theorem const_apply {m' : MeasurableSpace Ω} {hm' : m' ≤ m} (i : ι) : const ι m' hm' i = m'

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[Preorder ι]
{m' : MeasurableSpace Ω}
{hm' : m' ≤ m}
(i : ι)

↑(MeasureTheory.Filtration.const ι m' hm') i = m'


theorem sameRay_comm : SameRay R x y ↔ SameRay R y x

{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{x y : M}


theorem theory_model [MT : M ⊨ T] (h : M ≅[L] N) : N ⊨ T

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


@[simp]
theorem CompositionAsSet.toComposition_blocks (c : CompositionAsSet n) :
    c.toComposition.blocks = c.blocks


/-- For any `w`, the Fourier integral is convergent iff `f` is integrable. -/
theorem fourierIntegral_convergent_iff (he : Continuous e)
    (hL : Continuous fun p : V × W ↦ L p.1 p.2) {f : V → E} (w : W) :
    Integrable (fun v : V ↦ e (-L v w) • f v) μ ↔ Integrable f μ

{𝕜 : Type u_1}
[CommRing 𝕜]
{V : Type u_2}
[AddCommGroup V]
[Module 𝕜 V]
[MeasurableSpace V]
{W : Type u_3}
[AddCommGroup W]
[Module 𝕜 W]
{E : Type u_4}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
[TopologicalSpace 𝕜]
[TopologicalRing 𝕜]
[TopologicalSpace V]
[BorelSpace V]
[TopologicalSpace W]
{e : AddChar 𝕜 ↥𝕊}
{μ : MeasureTheory.Measure V}
{L : V →ₗ[𝕜] W →ₗ[𝕜] 𝕜}
(he : Continuous ⇑e)
(hL : Continuous fun p => (L p.1) p.2)
{f : V → E}
(w : W)

MeasureTheory.Integrable (fun v => e (-(L v) w) • f v) μ ↔ MeasureTheory.Integrable f μ


private theorem enle.isLinearOrder : IsLinearOrder α enle


theorem row_eq_zero_of_commute_stdBasisMatrix {i j k : n} {M : Matrix n n α}
    (hM : Commute (stdBasisMatrix i j 1) M) (hkj : k ≠ j) : M j k = 0

(hM : Commute (Matrix.stdBasisMatrix i j 1) M)


@[simp]
theorem top_apply [∀ i, Top (α' i)] (i : ι) : (⊤ : ∀ i, α' i) i = ⊤

{ι : Type u_3}
{α' : ι → Type u_4}
[(i : ι) → Top (α' i)]
(i : ι)


/-- A function from a locally finite partial order is antitone if and only if it is antitone when
restricted to pairs satisfying `a ⋖ b`. -/
lemma antitone_iff_forall_covBy [PartialOrder α] [LocallyFiniteOrder α] [Preorder β]
    (f : α → β) : Antitone f ↔ ∀ a b : α, a ⋖ b → f b ≤ f a

{α : Type u_2}
{β : Type u_3}
[PartialOrder α]
[LocallyFiniteOrder α]
[Preorder β]
(f : α → β)

Antitone f ↔ ∀ (a b : α), a ⋖ b → f b ≤ f a


@[simp]
theorem coe_measureUnivNNReal (μ : Measure α) [IsFiniteMeasure μ] :
    ↑(measureUnivNNReal μ) = μ univ

{α : Type u_1}
{m0 : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
[MeasureTheory.IsFiniteMeasure μ]

↑(MeasureTheory.measureUnivNNReal μ) = μ Set.univ


@[simp]
theorem compMeasurePreserving_mk (hg : AEStronglyMeasurable g ν) (hf : MeasurePreserving f μ ν) :
    (mk g hg).compMeasurePreserving f hf =
      mk (g ∘ f) (hg.comp_quasiMeasurePreserving hf.quasiMeasurePreserving)

(hg : MeasureTheory.AEStronglyMeasurable g ν)

(hf : MeasureTheory.MeasurePreserving f μ ν)

(MeasureTheory.AEEqFun.mk g hg).compMeasurePreserving f hf = MeasureTheory.AEEqFun.mk (g ∘ f) ⋯


@[to_additive]
theorem hasProd_le_inj {g : κ → α} (e : ι → κ) (he : Injective e)
    (hs : ∀ c, c ∉ Set.range e → 1 ≤ g c) (h : ∀ i, f i ≤ g (e i)) (hf : HasProd f a₁)
    (hg : HasProd g a₂) : a₁ ≤ a₂

{ι : Type u_1}
{κ : Type u_2}
{α : Type u_3}
[OrderedAddCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{f : ι → α}
{a₁ a₂ : α}
{g : κ → α}
(e : ι → κ)
(he : Function.Injective e)
(hs : ∀ c ∉ Set.range e, 0 ≤ g c)
(h : ∀ (i : ι), f i ≤ g (e i))
(hf : HasSum f a₁)
(hg : HasSum g a₂)


theorem _root_.MeasureTheory.AEStronglyMeasurable.integral_condexpKernel [NormedSpace ℝ F]
    (hf : AEStronglyMeasurable f μ) :
    AEStronglyMeasurable (fun ω => ∫ y, f y ∂condexpKernel μ m ω) μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.AEStronglyMeasurable (fun ω => ∫ (y : Ω), f y ∂(ProbabilityTheory.condexpKernel μ m) ω) μ


theorem inv_lt_inv_of_neg (ha : a < 0) (hb : b < 0) : a⁻¹ < b⁻¹ ↔ b < a

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


@[to_additive]
theorem subsingleton (h : UniqueMul A B a0 b0) :
    Subsingleton { ab : G × G // ab.1 ∈ A ∧ ab.2 ∈ B ∧ ab.1 * ab.2 = a0 * b0 }

{G : Type u_1}
[Mul G]
{A B : Finset G}
{a0 b0 : G}
(h : UniqueMul A B a0 b0)

Subsingleton { ab // ab.1 ∈ A ∧ ab.2 ∈ B ∧ ab.1 * ab.2 = a0 * b0 }


theorem hasSum_iff (f : α → ℂ) (c : ℂ) :
    HasSum f c ↔ HasSum (fun x => (f x).re) c.re ∧ HasSum (fun x => (f x).im) c.im


@[simp, reassoc, elementwise]
theorem stalkSpecializes_stalk_to_fiber {R : Type*} [CommRing R] {x y : PrimeSpectrum R}
    (h : x ⤳ y) :
    (structureSheaf R).presheaf.stalkSpecializes h ≫ StructureSheaf.stalkToFiberRingHom R x =
      StructureSheaf.stalkToFiberRingHom R y ≫
      -- Porting note: `PrimeSpectrum.localizationMapOfSpecializes h` by itself is interpreted as a
      -- ring homomorphism, so it is changed in a way to force it being interpreted as categorical
      -- arrow.
      (show CommRingCat.of (Localization.AtPrime y.asIdeal) ⟶
        CommRingCat.of (Localization.AtPrime x.asIdeal)
        from PrimeSpectrum.localizationMapOfSpecializes h)

{R : Type u_1}
[CommRing R]
{x y : PrimeSpectrum R}
(h : x ⤳ y)

(AlgebraicGeometry.Spec.structureSheaf R).presheaf.stalkSpecializes h ≫
    AlgebraicGeometry.StructureSheaf.stalkToFiberRingHom R x =
  AlgebraicGeometry.StructureSheaf.stalkToFiberRingHom R y ≫
    let_fun this := PrimeSpectrum.localizationMapOfSpecializes h;
    this


theorem uniqueDiffOn_Icc {a b : ℝ} (hab : a < b) : UniqueDiffOn ℝ (Icc a b)


theorem mapIdx_eq_ofFn (l : List α) (f : ℕ → α → β) :
    l.mapIdx f = ofFn fun i : Fin l.length ↦ f (i : ℕ) (l.get i)

{α : Type u}
{β : Type v}
(l : List α)
(f : ℕ → α → β)

List.mapIdx f l = List.ofFn fun i => f (↑i) (l.get i)


@[arith_mult]
theorem intCast {f : ArithmeticFunction ℤ} [Ring R] (h : f.IsMultiplicative) :
    IsMultiplicative (f : ArithmeticFunction R)

{R : Type u_1}
{f : ArithmeticFunction ℤ}
[Ring R]
(h : f.IsMultiplicative)


theorem isEquiv_valuation_valuationSubring : v.IsEquiv v.valuationSubring.valuation

{K : Type u}
[Field K]
{Γ : Type u_1}
[LinearOrderedCommGroupWithZero Γ]
(v : Valuation K Γ)


@[simp] theorem get_cons_zero : get (a::l) (0 : Fin (l.length + 1)) = a

∀ {α : Type u_1} {a : α} {l : List α}, (a :: l).get 0 = a


theorem mul_inv_rev (A B : Matrix n n α) : (A * B)⁻¹ = B⁻¹ * A⁻¹

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


/-- If Y/X/M forms a scalar tower, any map X → Y preserving X-action also preserves M-action. -/
theorem _root_.IsScalarTower.smulHomClass [MulOneClass X] [SMul X Y] [IsScalarTower M' X Y]
    [MulActionHomClass F X X Y] : MulActionHomClass F M' X Y

(M' : Type u_1)
(X : Type u_5)
[SMul M' X]
(Y : Type u_6)
[SMul M' Y]
(F : Type u_8)
[FunLike F X Y]
[MulOneClass X]
[SMul X Y]
[IsScalarTower M' X Y]
[MulActionHomClass F X X Y]


/-- Reversed version of **Fubini's Theorem**. -/
theorem integral_integral {f : α → β → E} (hf : Integrable (uncurry f) (μ.prod ν)) :
    ∫ x, ∫ y, f x y ∂ν ∂μ = ∫ z, f z.1 z.2 ∂μ.prod ν

(hf : MeasureTheory.Integrable (Function.uncurry f) (μ.prod ν))

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


@[simp, norm_cast]
theorem LinearMap.mkContinuous_coe (C : ℝ) (h : ∀ x, ‖f x‖ ≤ C * ‖x‖) :
    (f.mkContinuous C h : E →ₛₗ[σ] F) = f

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_3}
{F : Type u_4}
[Ring 𝕜]
[Ring 𝕜₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[Module 𝕜 E]
[Module 𝕜₂ F]
{σ : 𝕜 →+* 𝕜₂}
(f : E →ₛₗ[σ] F)
(C : ℝ)
(h : ∀ (x : E), ‖f x‖ ≤ C * ‖x‖)


/-- The identity functor on `C`, viewed as a functor from the
monoidal opposite of `C` to `C`, upgraded to a braided functor. -/
@[simps!] def unmopBraidedFunctor : BraidedFunctor Cᴹᵒᵖ C

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.BraidedCategory C]
(X Y : Cᴹᵒᵖ)

(CategoryTheory.MonoidalOpposite.unmopBraidedFunctor C).μ X Y = (β_ X.unmop Y.unmop).hom


@[to_additive (attr := simp)]
theorem finprod_one : (∏ᶠ _ : α, (1 : M)) = 1

{M : Type u_2}
{α : Sort u_4}
[AddCommMonoid M]


@[simp]
theorem fst_prod_snd [Module R₁ M₂] : (fst R₁ M₁ M₂).prod (snd R₁ M₁ M₂) = id R₁ (M₁ × M₂)

{R₁ : Type u_1}
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₁ M₂]

(ContinuousLinearMap.fst R₁ M₁ M₂).prod (ContinuousLinearMap.snd R₁ M₁ M₂) = ContinuousLinearMap.id R₁ (M₁ × M₂)


/-- Given an ideal `𝓟` of a commutative semiring `R`, we say that a polynomial `f : R[X]`
is *Eisenstein at `𝓟`* if `f.leadingCoeff ∉ 𝓟`, `∀ n, n < f.natDegree → f.coeff n ∈ 𝓟` and
`f.coeff 0 ∉ 𝓟 ^ 2`. -/
@[mk_iff]
structure IsEisensteinAt [CommSemiring R] (f : R[X]) (𝓟 : Ideal R) : Prop where
  leading : f.leadingCoeff ∉ 𝓟
  mem : ∀ {n}, n < f.natDegree → f.coeff n ∈ 𝓟
  not_mem : f.coeff 0 ∉ 𝓟 ^ 2

{R : Type u}
[CommSemiring R]
{f : R[X]}
{𝓟 : Ideal R}
(self : f.IsEisensteinAt 𝓟)
{n : ℕ}


lemma dual_inv_le :
    (dual A K I)⁻¹ ≤ I

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


lemma zero_eq_bot : (0 : WithZero α) = ⊥


@[simp]
theorem coe_mul {k₁ k₂ : ℤ} {Γ : Subgroup SL(2, ℤ)} (f : SlashInvariantForm Γ k₁)
    (g : SlashInvariantForm Γ k₂) : ⇑(f.mul g) = ⇑f * ⇑g


@[simp]
theorem mapRange.linearMap_id :
    mapRange.linearMap LinearMap.id = (LinearMap.id : (α →₀ M) →ₗ[R] _)

{α : Type u_1}
{M : Type u_2}
{R : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]

Finsupp.mapRange.linearMap LinearMap.id = LinearMap.id


/-- `gal p` embeds as a subgroup of permutations of the roots of `p` in `E`. -/
theorem galActionHom_injective [Fact (p.Splits (algebraMap F E))] :
    Function.Injective (galActionHom p E)

[Fact (Polynomial.Splits (algebraMap F E) p)]

Function.Injective ⇑(Polynomial.Gal.galActionHom p E)


theorem add_factorial_succ_lt_factorial_add_succ {i : ℕ} (n : ℕ) (hi : 2 ≤ i) :
    i + (n + 1)! < (i + n + 1)!

i + (n + 1).factorial < (i + n + 1).factorial


theorem fderivWithin_sum (hxs : UniqueDiffWithinAt 𝕜 s x)
    (h : ∀ i ∈ u, DifferentiableWithinAt 𝕜 (A i) s x) :
    fderivWithin 𝕜 (fun y => ∑ i ∈ u, A i y) s x = ∑ i ∈ u, fderivWithin 𝕜 (A i) s x


@[reassoc (attr := simp)]
theorem IsSheaf.amalgamate_map {A : Type u₂} [Category.{v₂} A] {E : A} {X : C} {P : Cᵒᵖ ⥤ A}
    (hP : Presheaf.IsSheaf J P) (S : J.Cover X) (x : ∀ I : S.Arrow, E ⟶ P.obj (op I.Y))
    (hx : ∀ ⦃I₁ I₂ : S.Arrow⦄ (r : I₁.Relation I₂),
       x I₁ ≫ P.map r.g₁.op = x I₂ ≫ P.map r.g₂.op)
    (I : S.Arrow) :
    hP.amalgamate S x hx ≫ P.map I.f.op = x _

{J : CategoryTheory.GrothendieckTopology C}

(hP : CategoryTheory.Presheaf.IsSheaf J P)

(x : (I : S.Arrow) → E ⟶ P.obj (Opposite.op I.Y))

(hx :
  ∀ ⦃I₁ I₂ : S.Arrow⦄ (r : I₁.Relation I₂),
    CategoryTheory.CategoryStruct.comp (x I₁) (P.map r.g₁.op) =
      CategoryTheory.CategoryStruct.comp (x I₂) (P.map r.g₂.op))

CategoryTheory.CategoryStruct.comp (hP.amalgamate S x hx) (P.map I.f.op) = x I


theorem app_surjective_of_stalkFunctor_map_bijective {F G : Sheaf C X} (f : F ⟶ G) (U : Opens X)
    (h : ∀ x : U, Function.Bijective ((stalkFunctor C x.val).map f.1)) :
    Function.Surjective (f.1.app (op U))

(h : ∀ (x : ↥U), Function.Bijective ⇑((TopCat.Presheaf.stalkFunctor C ↑x).map f.val))

Function.Surjective ⇑(f.val.app (Opposite.op U))


theorem ne_iff {x y : ℚ≥0} : (x : ℚ) ≠ (y : ℚ) ↔ x ≠ y

↑x ≠ ↑y ↔ x ≠ y


lemma hasProductsOfShape (J : Type) [Finite J] [HasProductsOfShape J C]
    (hW : W.IsStableUnderProductsOfShape J) :
    HasProductsOfShape J D


/-- Ring homomorphisms map zero to zero. -/
protected theorem map_zero (f : α →+* β) : f 0 = 0

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


theorem mul_iSup (t : Submodule R A) (s : ι → Submodule R A) : (t * ⨆ i, s i) = ⨆ i, t * s i

{ι : Sort uι}
{R : Type u}
[CommSemiring R]
{A : Type v}
[Semiring A]
[Algebra R A]
(t : Submodule R A)
(s : ι → Submodule R A)


/-- A set is contained in its affine span. -/
theorem subset_affineSpan (s : Set P) : s ⊆ affineSpan k s

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


/-- A useful alternative characterisation of Lie ideal operations on Lie submodules.

Given a Lie ideal `I ⊆ L` and a Lie submodule `N ⊆ M`, by tensoring the inclusion maps and then
applying the action of `L` on `M`, we obtain morphism of Lie modules `f : I ⊗ N → L ⊗ M → M`.

This lemma states that `⁅I, N⁆ = range f`. -/
theorem lieIdeal_oper_eq_tensor_map_range :
    ⁅I, N⁆ = ((toModuleHom R L M).comp (mapIncl I N : (↥I) ⊗[R] (↥N) →ₗ⁅R,L⁆ L ⊗[R] M)).range

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

⁅I, N⁆ = ((LieModule.toModuleHom R L M).comp (TensorProduct.LieModule.mapIncl I N)).range


theorem inf_lt_of_right_lt (h : b < c) : a ⊓ b < c

{α : Type u}
[SemilatticeInf α]
{a b c : α}
(h : b < c)


/-- A set of algebraically independent elements in an algebra `A` over a ring `K` is also
algebraically independent over a subring `R` of `K`. -/
theorem AlgebraicIndependent.restrictScalars {K : Type*} [CommRing K] [Algebra R K] [Algebra K A]
    [IsScalarTower R K A] (hinj : Function.Injective (algebraMap R K))
    (ai : AlgebraicIndependent K x) : AlgebraicIndependent R x

(hinj : Function.Injective ⇑(algebraMap R K))


@[simp]
theorem bernoulli_apply : bernoulli p h b = cond b p (1 - p)

(PMF.bernoulli p h) b = bif b then p else 1 - p


theorem toReal_nsmul (a : ℝ≥0∞) (n : ℕ) : (n • a).toReal = n • a.toReal


/-- If `𝓕` is a filter on `β × β`, then the set of all `UniformFun.gen α β V` for
`V ∈ 𝓕` is a filter basis on `(α →ᵤ β) × (α →ᵤ β)`. This will only be applied to `𝓕 = 𝓤 β` when
`β` is equipped with a `UniformSpace` structure, but it is useful to define it for any filter in
order to be able to state that it has a lower adjoint (see `UniformFun.gc`). -/
protected theorem isBasis_gen (𝓑 : Filter <| β × β) :
    IsBasis (fun V : Set (β × β) => V ∈ 𝓑) (UniformFun.gen α β)

(α : Type u_1)
(β : Type u_2)
(𝓑 : Filter (β × β))

Filter.IsBasis (fun V => V ∈ 𝓑) (UniformFun.gen α β)


/-- This lemma is only supposed to be used in the generic context, when working with instances
of classes extending `EquivLike`.
For concrete isomorphism types such as `Equiv`, you should use `Equiv.apply_symm_apply`
or its equivalent.

TODO: define a generic form of `Equiv.symm`. -/
@[simp]
theorem apply_inv_apply (e : E) (b : β) : e (EquivLike.inv e b) = b

{E : Sort u_1}
{α : Sort u_3}
{β : Sort u_4}
[iE : EquivLike E α β]
(e : E)
(b : β)


theorem lift_surjective_of_surjective (I : Ideal R) {f : R →+* S} (H : ∀ a : R, a ∈ I → f a = 0)
    (hf : Function.Surjective f) : Function.Surjective (Ideal.Quotient.lift I f H)

{R : Type u}
[CommRing R]
{S : Type v}
[Semiring S]
(I : Ideal R)
{f : R →+* S}
(H : ∀ a ∈ I, f a = 0)
(hf : Function.Surjective ⇑f)

Function.Surjective ⇑(Ideal.Quotient.lift I f H)


@[simp]
theorem edgeDensity_empty_right (s : Finset α) : G.edgeDensity s ∅ = 0

{α : Type u_4}
(G : SimpleGraph α)
[DecidableRel G.Adj]
(s : Finset α)


theorem exists_nat_measure_lt_two_inv (hfg : TendstoInMeasure μ f atTop g) (n : ℕ) :
    ∃ N, ∀ m ≥ N, μ { x | (2 : ℝ)⁻¹ ^ n ≤ dist (f m x) (g x) } ≤ (2⁻¹ : ℝ≥0∞) ^ n

(hfg : MeasureTheory.TendstoInMeasure μ f Filter.atTop g)

∃ N, ∀ m_1 ≥ N, μ {x | 2⁻¹ ^ n ≤ dist (f m_1 x) (g x)} ≤ 2⁻¹ ^ n


lemma piecewise_le_of_le_of_le (hf : f ≤ h) (hg : g ≤ h) : s.piecewise f g ≤ h

{ι : Type u_1}
(s : Finset ι)
[(j : ι) → Decidable (j ∈ s)]
{π : ι → Type u_3}
{f g h : (i : ι) → π i}
[(i : ι) → Preorder (π i)]
(hf : f ≤ h)
(hg : g ≤ h)