/-- A typeclass mixin for `MeasurableSpace`s such that each singleton is measurable. -/
class MeasurableSingletonClass (α : Type*) [MeasurableSpace α] : Prop where
  /-- A singleton is a measurable set. -/
  measurableSet_singleton : ∀ x, MeasurableSet ({x} : Set α)

{α : Type u_7}
[MeasurableSpace α]
[self : MeasurableSingletonClass α]
(x : α)


/-- The image of a set `s` under a linear map `f` has measure
equal to `μ s` times the absolute value of the determinant of `f`. -/
@[simp]
theorem addHaar_image_linearMap (f : E →ₗ[ℝ] E) (s : Set E) :
    μ (f '' s) = ENNReal.ofReal |LinearMap.det f| * μ s

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
[FiniteDimensional ℝ E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]
(f : E →ₗ[ℝ] E)
(s : Set E)

μ (⇑f '' s) = ENNReal.ofReal |LinearMap.det f| * μ s


@[simps id comp]
instance : CategoryStruct (OplaxFunctor B C)

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

∀ {X Y Z : CategoryTheory.OplaxFunctor B C} (η : CategoryTheory.OplaxNatTrans X Y)
  (θ : CategoryTheory.OplaxNatTrans Y Z), CategoryTheory.CategoryStruct.comp η θ = η.vcomp θ


/-- The limit of a diagram `F : J ⥤ K ⥤ C` is isomorphic to the functor given by
the individual limits on objects. -/
@[simps!]
def limitIsoFlipCompLim [HasLimitsOfShape J C] (F : J ⥤ K ⥤ C) : limit F ≅ F.flip ⋙ lim

(CategoryTheory.Limits.limitIsoFlipCompLim F).hom.app X = (CategoryTheory.Limits.limitObjIsoLimitCompEvaluation F X).hom


/-- Angle at center of a circle equals twice angle at circumference, oriented vector angle
form. -/
theorem oangle_eq_two_zsmul_oangle_sub_of_norm_eq {x y z : V} (hxyne : x ≠ y) (hxzne : x ≠ z)
    (hxy : ‖x‖ = ‖y‖) (hxz : ‖x‖ = ‖z‖) : o.oangle y z = (2 : ℤ) • o.oangle (y - x) (z - x)

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

o.oangle y z = 2 • o.oangle (y - x) (z - x)


/-- A `DivisionRing` is a `Ring` with multiplicative inverses for nonzero elements.

An instance of `DivisionRing K` includes maps `ratCast : ℚ → K` and `qsmul : ℚ → K → K`.
Those two fields are needed to implement the `DivisionRing K → Algebra ℚ K` instance since we need
to control the specific definitions for some special cases of `K` (in particular `K = ℚ` itself).
See also note [forgetful inheritance]. Similarly, there are maps `nnratCast ℚ≥0 → K` and
`nnqsmul : ℚ≥0 → K → K` to implement the `DivisionSemiring K → Algebra ℚ≥0 K` instance.

If the division ring has positive characteristic `p`, our division by zero convention forces
`ratCast (1 / p) = 1 / 0 = 0`. -/
class DivisionRing (α : Type*)
  extends Ring α, DivInvMonoid α, Nontrivial α, NNRatCast α, RatCast α where
  /-- For a nonzero `a`, `a⁻¹` is a right multiplicative inverse. -/
  protected mul_inv_cancel : ∀ (a : α), a ≠ 0 → a * a⁻¹ = 1
  /-- The inverse of `0` is `0` by convention. -/
  protected inv_zero : (0 : α)⁻¹ = 0
  protected nnratCast := NNRat.castRec
  /-- However `NNRat.cast` is defined, it must be equal to `a / b`.

  Do not use this lemma directly. Use `NNRat.cast_def` instead. -/
  protected nnratCast_def (q : ℚ≥0) : (NNRat.cast q : α) = q.num / q.den := by intros; rfl
  /-- Scalar multiplication by a nonnegative rational number.

  Unless there is a risk of a `Module ℚ≥0 _` instance diamond, write `nnqsmul := _`. This will set
  `nnqsmul` to `(NNRat.cast · * ·)` thanks to unification in the default proof of `nnqsmul_def`.

  Do not use directly. Instead use the `•` notation. -/
  protected nnqsmul : ℚ≥0 → α → α
  /-- However `qsmul` is defined, it must be propositionally equal to multiplication by `Rat.cast`.

  Do not use this lemma directly. Use `NNRat.smul_def` instead. -/
  protected nnqsmul_def (q : ℚ≥0) (a : α) : nnqsmul q a = NNRat.cast q * a := by intros; rfl
  protected ratCast := Rat.castRec
  /-- However `Rat.cast q` is defined, it must be propositionally equal to `q.num / q.den`.

  Do not use this lemma directly. Use `Rat.cast_def` instead. -/
  protected ratCast_def (q : ℚ) : (Rat.cast q : α) = q.num / q.den := by intros; rfl
  /-- Scalar multiplication by a rational number.

  Unless there is a risk of a `Module ℚ _` instance diamond, write `qsmul := _`. This will set
  `qsmul` to `(Rat.cast · * ·)` thanks to unification in the default proof of `qsmul_def`.

  Do not use directly. Instead use the `•` notation. -/
  protected qsmul : ℚ → α → α
  /-- However `qsmul` is defined, it must be propositionally equal to multiplication by `Rat.cast`.

  Do not use this lemma directly. Use `Rat.cast_def` instead. -/
  protected qsmul_def (a : ℚ) (x : α) : qsmul a x = Rat.cast a * x := by intros; rfl

{α : Type u_4}
[self : DivisionRing α]
(q : ℚ≥0)
(a : α)


theorem StrictMono.strictMonoOn_IccExtend (hf : StrictMono f) :
    StrictMonoOn (IccExtend h f) (Icc a b)

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[Preorder β]
{a b : α}
(h : a ≤ b)
{f : ↑(Set.Icc a b) → β}
(hf : StrictMono f)

StrictMonoOn (Set.IccExtend h f) (Set.Icc a b)


/-- Restrict a `PartialHomeomorph` to a pair of corresponding open sets. -/
@[simps toPartialEquiv]
def restr (h : e.IsImage s t) (hs : IsOpen (e.source ∩ s)) : PartialHomeomorph X Y

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{e : PartialHomeomorph X Y}
{s : Set X}
{t : Set Y}
(h : e.IsImage s t)
(hs : IsOpen (e.source ∩ s))


@[simp]
theorem coeToPowerSeries.ringHom_apply : coeToPowerSeries.ringHom φ = φ

{R : Type u_2}
[CommSemiring R]
(φ : Polynomial R)

Polynomial.coeToPowerSeries.ringHom φ = ↑φ


@[elab_as_elim]
theorem Finite.dinduction_on {C : ∀ s : Set α, s.Finite → Prop} (s : Set α) (h : s.Finite)
    (H0 : C ∅ finite_empty)
    (H1 : ∀ {a s}, a ∉ s → ∀ h : Set.Finite s, C s h → C (insert a s) (h.insert a)) : C s h

(H1 : ∀ {a : α} {s : Set α}, a ∉ s → ∀ (h : s.Finite), C s h → C (insert a s) ⋯)


/-- The identity of a commutative square. -/
@[simps]
def id (sq : Square C) : Hom sq sq

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

(CategoryTheory.Square.Hom.id sq).τ₂ = CategoryTheory.CategoryStruct.id sq.X₂


theorem Compares.eq_lt [Preorder α] : ∀ {o} {a b : α}, Compares o a b → (o = lt ↔ a < b)

{α : Type u_1}
[Preorder α]
{o : Ordering}
{a b : α}

o.Compares a b → (o = Ordering.lt ↔ a < b)


/-- Isomorphic monads give equivalent categories of algebras. Furthermore, they are equivalent as
categories over `C`, that is, we have `algebraEquivOfIsoMonads h ⋙ forget = forget`.
-/
@[simps]
def algebraEquivOfIsoMonads {T₁ T₂ : Monad C} (h : T₁ ≅ T₂) : Algebra T₁ ≌ Algebra T₂

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{T₁ T₂ : CategoryTheory.Monad C}
(h : T₁ ≅ T₂)

(CategoryTheory.Monad.algebraEquivOfIsoMonads h).functor = CategoryTheory.Monad.algebraFunctorOfMonadHom h.inv


/-- Reinterpreting an `F`-structured arrow `X ⟶ F.obj d` as an arrow under `X` induces a functor
    `StructuredArrow X F ⥤ Under X`. -/
@[simps!]
def toUnder (X : T) (F : D ⥤ T) : StructuredArrow X F ⥤ Under X

{T : Type u₁}
[CategoryTheory.Category.{v₁, u₁} T]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(X : T)
(F : CategoryTheory.Functor D T)

∀ {X_1 Y : CategoryTheory.Comma (CategoryTheory.Functor.fromPUnit X) (F.comp (CategoryTheory.Functor.id T))}
  (f : X_1 ⟶ Y), ((CategoryTheory.StructuredArrow.toUnder X F).map f).right = F.map f.right


@[to_additive]
theorem div_right_injective : Function.Injective fun a ↦ b / a


@[to_additive (attr := simp)]
theorem mk_mul_mk (x y : α) (L1 L2 : List α) : mk x L1 * mk y L2 = mk x (L1 ++ y :: L2)

{ head := x, tail := L1 } + { head := y, tail := L2 } = { head := x, tail := L1 ++ y :: L2 }


@[to_additive addCHaar_mem_addHaarProduct]
theorem chaar_mem_haarProduct (K₀ : PositiveCompacts G) : chaar K₀ ∈ haarProduct (K₀ : Set G)

(K₀ : TopologicalSpace.PositiveCompacts G)

MeasureTheory.Measure.haar.chaar K₀ ∈ MeasureTheory.Measure.haar.haarProduct ↑K₀


@[to_additive (attr := simp)]
theorem mk_one : ((1 : G) : Q) = 1

{G : Type u}
[Group G]
(N : Subgroup G)
[nN : N.Normal]


@[to_additive (attr := continuity) continuous_sub_left]
lemma continuous_div_left' (a : G) : Continuous (a / ·)

{G : Type w}
[TopologicalSpace G]
[Div G]
[ContinuousDiv G]
(a : G)


theorem log_of_left_le_one {b : ℕ} (hb : b ≤ 1) (r : R) : log b r = 0

{R : Type u_1}
[LinearOrderedSemifield R]
[FloorSemiring R]
{b : ℕ}
(hb : b ≤ 1)
(r : R)


@[to_additive (attr := simp, norm_cast)]
lemma one_eq_coe : 1 = (a : WithTop α) ↔ a = 1


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

{α : Type u_3}
{β : Type u_4}
[Inf α]
[Inf β]
(f : InfHom α β)
(f' : α → β)
(h : f' = ⇑f)


theorem count_eq_of_nodup [DecidableEq α] {a : α} {s : Multiset α} (d : Nodup s) :
    count a s = if a ∈ s then 1 else 0

{α : Type u_1}
[DecidableEq α]
{a : α}
{s : Multiset α}
(d : s.Nodup)

Multiset.count a s = if a ∈ s then 1 else 0


@[simp]
theorem support_normalize : (normalize f hf0 hf).support = Function.support f

{α : Type u_1}
{f : α → ENNReal}
(hf0 : tsum f ≠ 0)
(hf : tsum f ≠ ⊤)

(PMF.normalize f hf0 hf).support = Function.support f


theorem _root_.biInf_sigma' (s : Set ι) (t : ∀ i, Set (α i)) (f : ∀ i, α i → β) :
    ⨅ (i ∈ s) (j ∈ t i), f i j = ⨅ ij ∈ s.sigma t, f ij.fst ij.snd

{ι : Type u_1}
{α : ι → Type u_3}
{β : Type u_5}
[CompleteLattice β]
(s : Set ι)
(t : (i : ι) → Set (α i))
(f : (i : ι) → α i → β)

⨅ i ∈ s, ⨅ j ∈ t i, f i j = ⨅ ij ∈ s.sigma t, f ij.fst ij.snd


@[to_additive (attr := simp)]
theorem inv_insert (a : α) (s : Finset α) : (insert a s)⁻¹ = insert a⁻¹ s⁻¹

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


@[to_additive (attr := simp)]
protected theorem one_div_smul {r : X} {s t : S} : ((1 : R) /ₒ t) • (r /ₒ s) = r /ₒ (s * t)

{R : Type u_1}
[Monoid R]
{S : Submonoid R}
[OreLocalization.OreSet S]
{X : Type u_2}
[MulAction R X]
{r : X}
{s t : ↥S}


@[to_additive (attr := simp)]
theorem cancel_right {g₁ g₂ : β →*o γ} {f : α →*o β} (hf : Function.Surjective f) :
    g₁.comp f = g₂.comp f ↔ g₁ = g₂

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[Preorder α]
[Preorder β]
[Preorder γ]
[AddZeroClass α]
[AddZeroClass β]
[AddZeroClass γ]
{g₁ g₂ : β →+o γ}
{f : α →+o β}
(hf : Function.Surjective ⇑f)


@[simp]
theorem floor_sub_ofNat (a : α) (n : ℕ) [n.AtLeastTwo] :
    ⌊a - (no_index (OfNat.ofNat n))⌋ = ⌊a⌋ - OfNat.ofNat n

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

⌊a - OfNat.ofNat n⌋ = ⌊a⌋ - OfNat.ofNat n


@[to_additive]
theorem card_mul_le : (s * t).card ≤ s.card * t.card

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


@[to_additive (attr := simp)]
theorem coe_toEquiv_symm (f : M ≃* N) : ((f : M ≃ N).symm : N → M) = f.symm

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


@[continuity]
theorem continuous_log' : Continuous fun x : { x : ℝ // 0 < x } => log x


theorem Ioc_inr_inr : Ioc (inr b₁ : α ⊕ β) (inr b₂) = (Ioc b₁ b₂).map Embedding.inr

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
[LocallyFiniteOrder α]
[LocallyFiniteOrder β]
(b₁ b₂ : β)

Finset.Ioc (Sum.inr b₁) (Sum.inr b₂) = Finset.map Function.Embedding.inr (Finset.Ioc b₁ b₂)


/-- When the second map `S.g` is zero, this is the left homology data on `S` given by
the chosen `cokernel S.f` -/
@[simps!]
noncomputable def ofHasCokernel [HasCokernel S.f] (hg : S.g = 0) : S.LeftHomologyData

(CategoryTheory.ShortComplex.LeftHomologyData.ofHasCokernel S hg).K = S.X₂


/-- `ε` commutes with every element of the algebra. -/
theorem commute_eps_right [Semiring R] (x : DualNumber R) : Commute x ε


@[to_additive (attr := simp)]
theorem snd_swap (x : M ∗ N) : snd (swap M N x) = fst x

{M : Type u_1}
{N : Type u_2}
[AddMonoid M]
[AddMonoid N]
(x : AddMonoid.Coprod M N)

AddMonoid.Coprod.snd ((AddMonoid.Coprod.swap M N) x) = AddMonoid.Coprod.fst x


theorem iIndepSet_iff_iIndepSets_singleton {_mΩ : MeasurableSpace Ω} {κ : Kernel α Ω}
    [IsMarkovKernel κ] {μ : Measure α} {f : ι → Set Ω}
    (hf : ∀ i, MeasurableSet (f i)) :
    iIndepSet f κ μ ↔ iIndepSets (fun i ↦ {f i}) κ μ

{α : Type u_1}
{Ω : Type u_2}
{ι : Type u_3}
{_mα : MeasurableSpace α}
{_mΩ : MeasurableSpace Ω}
{κ : ProbabilityTheory.Kernel α Ω}
[ProbabilityTheory.IsMarkovKernel κ]
{μ : MeasureTheory.Measure α}
{f : ι → Set Ω}
(hf : ∀ (i : ι), MeasurableSet (f i))

ProbabilityTheory.Kernel.iIndepSet f κ μ ↔ ProbabilityTheory.Kernel.iIndepSets (fun i => {f i}) κ μ


/-- A family of additive subgroups on a ring `A` is a subgroups basis if it satisfies some
axioms ensuring there is a topology on `A` which is compatible with the ring structure and
admits this family as a basis of neighborhoods of zero. -/
structure RingSubgroupsBasis {A ι : Type*} [Ring A] (B : ι → AddSubgroup A) : Prop where
  /-- Condition for `B` to be a filter basis on `A`. -/
  inter : ∀ i j, ∃ k, B k ≤ B i ⊓ B j
  /-- For each set `B` in the submodule basis on `A`, there is another basis element `B'` such
   that the set-theoretic product `B' * B'` is in `B`. -/
  mul : ∀ i, ∃ j, (B j : Set A) * B j ⊆ B i
  /-- For any element `x : A` and any set `B` in the submodule basis on `A`,
    there is another basis element `B'` such that `B' * x` is in `B`. -/
  leftMul : ∀ x : A, ∀ i, ∃ j, (B j : Set A) ⊆ (x * ·) ⁻¹' B i
  /-- For any element `x : A` and any set `B` in the submodule basis on `A`,
    there is another basis element `B'` such that `x * B'` is in `B`. -/
  rightMul : ∀ x : A, ∀ i, ∃ j, (B j : Set A) ⊆ (· * x) ⁻¹' B i

{A : Type u_1}
{ι : Type u_2}
[Ring A]
{B : ι → AddSubgroup A}
(self : RingSubgroupsBasis B)
(i j : ι)


/-- This is a cocone with point `P` for the functor `functorToRepresentables P`. It is shown in
`colimitOfRepresentable P` that this cocone is a colimit: that is, we have exhibited an arbitrary
presheaf `P` as a colimit of representables.

The construction of [MM92], Chapter I, Section 5, Corollary 3.
-/
@[simps]
noncomputable def coconeOfRepresentable (P : Cᵒᵖ ⥤ Type v₁) :
    Cocone (functorToRepresentables P)

(P : CategoryTheory.Functor Cᵒᵖ (Type v₁))

(CategoryTheory.Presheaf.coconeOfRepresentable P).pt = P


/-- `Prod.fst ⁻¹' s` is null measurable w.r.t. `μ.prod ν` iff `s` is null measurable w.r.t. `μ`
provided that `ν ≠ 0`. -/
lemma nullMeasurableSet_preimage_fst [NeZero ν] {s : Set α} :
    NullMeasurableSet (Prod.fst ⁻¹' s) (μ.prod ν) ↔ NullMeasurableSet s μ

{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{ν : MeasureTheory.Measure β}
[MeasureTheory.SFinite ν]
[MeasureTheory.SFinite μ]
[NeZero ν]
{s : Set α}

MeasureTheory.NullMeasurableSet (Prod.fst ⁻¹' s) (μ.prod ν) ↔ MeasureTheory.NullMeasurableSet s μ


@[simp] theorem _root_.QuadraticMap.toQuadraticMap_polarBilin (Q : QuadraticMap R M N) :
    toQuadraticMap (polarBilin Q) = 2 • Q

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
(Q : QuadraticMap R M N)


theorem inv_ne_zero (h : a ≠ 0) : a⁻¹ ≠ 0

{G₀ : Type u_3}
[GroupWithZero G₀]
{a : G₀}
(h : a ≠ 0)


theorem toPreimages_nonempty_of_surjective [hFn : ∀ j : J, Nonempty (F.obj j)]
    (Fsur : ∀ ⦃i j : J⦄ (f : i ⟶ j), (F.map f).Surjective) (hs : s.Nonempty) (j) :
    Nonempty ((F.toPreimages s).obj j)

(Fsur : ∀ ⦃i j : J⦄ (f : i ⟶ j), Function.Surjective (F.map f))


@[simp]
theorem subtype_comp_codRestrict (f : A →⋆ₐ[R] B) (S : StarSubalgebra R B)
    (hf : ∀ x : A, f x ∈ S) : S.subtype.comp (f.codRestrict S hf) = f

{R : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[Semiring B]
[Algebra R B]
[StarRing B]
[StarModule R B]
(f : A →⋆ₐ[R] B)
(S : StarSubalgebra R B)
(hf : ∀ (x : A), f x ∈ S)


/-- The basis of open subgroups for the topology on a ring determined by a valuation. -/
theorem subgroups_basis : RingSubgroupsBasis fun γ : Γ₀ˣ => (v.ltAddSubgroup γ : AddSubgroup R)

{R : Type u}
[Ring R]
{Γ₀ : Type v}
[LinearOrderedCommGroupWithZero Γ₀]
(v : Valuation R Γ₀)

RingSubgroupsBasis fun γ => v.ltAddSubgroup γ


@[simp]
theorem toList_ofFn : ∀ {n} (f : Fin n → α), toList (ofFn f) = List.ofFn f

(Mathlib.Vector.ofFn f).toList = List.ofFn f


{α : Type u_2}
{β : Type u_3}
[Lattice α]
[Lattice β]
{f : LatticeHom α β}


@[simp]
theorem forall₂_nil_right_iff {l} : Forall₂ R l nil ↔ l = nil

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


@[to_additive (attr := simp)]
theorem mk_eq_monoidOf_mk' : mk = (monoidOf S).mk'

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}

AddLocalization.mk = (AddLocalization.addMonoidOf S).mk'


@[to_additive (attr := simp)]
theorem map_equiv_top (f : M ≃* N) : (⊤ : Subsemigroup M).map (f : M →ₙ* N) = ⊤

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
(f : M ≃* N)


theorem tail_eq_tail? (l) : @tail α l = (tail? l).getD []


/-- A filter basis `B` on a type `α` is a nonempty collection of sets of `α`
such that the intersection of two elements of this collection contains some element
of the collection. -/
structure FilterBasis (α : Type*) where
  /-- Sets of a filter basis. -/
  sets : Set (Set α)
  /-- The set of filter basis sets is nonempty. -/
  nonempty : sets.Nonempty
  /-- The set of filter basis sets is directed downwards. -/
  inter_sets {x y} : x ∈ sets → y ∈ sets → ∃ z ∈ sets, z ⊆ x ∩ y

{α : Type u_6}
(self : FilterBasis α)
{x y : Set α}

x ∈ self.sets → y ∈ self.sets → ∃ z ∈ self.sets, z ⊆ x ∩ y


/-- If `f` is a monotone map and `x ≤ f x` at some point `x`, then the iterates `f^[n] x` form
a monotone sequence. -/
theorem monotone_iterate_of_le_map (hf : Monotone f) (hx : x ≤ f x) : Monotone fun n => f^[n] x

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


theorem Finsupp.sum_mul (b : S) (s : α →₀ R) {f : α → R → S} :
    s.sum f * b = s.sum fun a c => f a c * b

{α : Type u_1}
{R : Type u_14}
{S : Type u_15}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
(b : S)
(s : α →₀ R)
{f : α → R → S}


theorem ContDiffWithinAt.ccosh {n} (hf : ContDiffWithinAt ℂ n f s x) :
    ContDiffWithinAt ℂ n (fun x => Complex.cosh (f x)) s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{x : E}
{s : Set E}
{n : ℕ∞}
(hf : ContDiffWithinAt ℂ n f s x)


theorem pairwise_disjoint_fiber (f : ι → α) : Pairwise (Disjoint on fun a : α => f ⁻¹' {a})

{α : Type u_1}
{ι : Type u_4}
(f : ι → α)

Pairwise (Disjoint on fun a => f ⁻¹' {a})


@[to_additive]
lemma mulIndicator_iInter_apply (h1 : (⊥ : M) = 1) (s : ι → Set α) (f : α → M) (x : α) :
    mulIndicator (⋂ i, s i) f x = ⨅ i, mulIndicator (s i) f x

{ι : Sort u_1}
{α : Type u_2}
{M : Type u_4}
[CompleteLattice M]
[Zero M]
[Nonempty ι]
(h1 : ⊥ = 0)
(s : ι → Set α)
(f : α → M)
(x : α)

(⋂ i, s i).indicator f x = ⨅ i, (s i).indicator f x


@[simp]
theorem fromEdgeSet_adj : (fromEdgeSet s).Adj v w ↔ s(v, w) ∈ s ∧ v ≠ w

{V : Type u}
{v w : V}
(s : Set (Sym2 V))

(SimpleGraph.fromEdgeSet s).Adj v w ↔ s(v, w) ∈ s ∧ v ≠ w


@[simp]
lemma shift_zero (a : ℤ) :
    (0 : Cochain K L n).shift a = 0

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
(K L : CochainComplex C ℤ)
(n a : ℤ)

CochainComplex.HomComplex.Cochain.shift 0 a = 0


theorem mul_lt_of_mul_lt_of_nonneg_left [PosMulMono α] (h : a * b < c) (hle : d ≤ b) (a0 : 0 ≤ a) :
    a * d < c

{α : Type u_1}
{a b c d : α}
[Mul α]
[Zero α]
[Preorder α]
[PosMulMono α]
(h : a * b < c)
(hle : d ≤ b)
(a0 : 0 ≤ a)


@[simp]
theorem mapRange.addEquiv_refl : mapRange.addEquiv (AddEquiv.refl M) = AddEquiv.refl (α →₀ M)

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]

Finsupp.mapRange.addEquiv (AddEquiv.refl M) = AddEquiv.refl (α →₀ M)


/-- The map from the empty scheme. -/
@[simps]
def Scheme.emptyTo (X : Scheme.{u}) : ∅ ⟶ X

(U : (TopologicalSpace.Opens ↑↑X.toPresheafedSpace)ᵒᵖ)

X.emptyTo.val.c.app U = CommRingCat.punitIsTerminal.from (X.presheaf.obj U)


@[to_additive]
theorem exists_one_lt_mul_of_lt (h : a < b) : ∃ (c : _) (_ : 1 < c), a * c = b

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


@[to_additive]
theorem smul_set_inter_subset : a • (t₁ ∩ t₂) ⊆ a • t₁ ∩ a • t₂

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{t₁ t₂ : Set β}
{a : α}

a • (t₁ ∩ t₂) ⊆ a • t₁ ∩ a • t₂


/-- If a function `f` has a power series `p` around `x`, then the function `z ↦ f (z - y)` has the
same power series around `x + y`. -/
theorem HasFPowerSeriesOnBall.comp_sub (hf : HasFPowerSeriesOnBall f p x r) (y : E) :
    HasFPowerSeriesOnBall (fun z => f (z - y)) p (x + y) r

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{x : E}
{r : ℝ≥0∞}
(hf : HasFPowerSeriesOnBall f p x r)
(y : E)


/-- A continuous partition of unity on a set `s : Set X` is a collection of continuous functions
`f i` such that

* the supports of `f i` form a locally finite family of sets, i.e., for every point `x : X` there
  exists a neighborhood `U ∋ x` such that all but finitely many functions `f i` are zero on `U`;
* the functions `f i` are nonnegative;
* the sum `∑ᶠ i, f i x` is equal to one for every `x ∈ s` and is less than or equal to one
  otherwise.

If `X` is a normal paracompact space, then `PartitionOfUnity.exists_isSubordinate` guarantees
that for every open covering `U : Set (Set X)` of `s` there exists a partition of unity that is
subordinate to `U`.
-/
structure PartitionOfUnity (ι X : Type*) [TopologicalSpace X] (s : Set X := univ) where
  /-- The collection of continuous functions underlying this partition of unity -/
  toFun : ι → C(X, ℝ)
  /-- the supports of the underlying functions are a locally finite family of sets -/
  locallyFinite' : LocallyFinite fun i => support (toFun i)
  /-- the functions are non-negative -/
  nonneg' : 0 ≤ toFun
  /-- the functions sum up to one on `s` -/
  sum_eq_one' : ∀ x ∈ s, ∑ᶠ i, toFun i x = 1
  /-- the functions sum up to at most one, globally -/
  sum_le_one' : ∀ x, ∑ᶠ i, toFun i x ≤ 1

{ι : Type u_1}
{X : Type u_2}
[TopologicalSpace X]
{s : optParam (Set X) Set.univ}
(self : PartitionOfUnity ι X s)
(x : X)

x ∈ s → ∑ᶠ (i : ι), (self.toFun i) x = 1


/-- A cocone on `F` with cocone point `X` is the same as an element of `lim Hom(F·, X)`,
    naturally in `F` and `X`. -/
@[simps!]
noncomputable def opHomCompWhiskeringLimYonedaIsoCocones : opHom _ _ ⋙ whiskeringLeft _ _ _ ⋙
      (whiskeringRight _ _ _).obj lim ⋙ (whiskeringLeft _ _ _).obj yoneda ≅ cocones J C

(J : Type v)
[CategoryTheory.SmallCategory J]
(C : Type u)
[CategoryTheory.Category.{v, u} C]
(X : (J ⥤ C)ᵒᵖ)

∀ (X_1 : C) (a : (Opposite.unop X).cocones.obj X_1),
  ((CategoryTheory.Limits.opHomCompWhiskeringLimYonedaIsoCocones J C).inv.app X).app X_1 a =
    (CategoryTheory.Limits.Types.limitEquivSections ((Opposite.unop X).op ⋙ CategoryTheory.yoneda.obj X_1)).symm
      ((CategoryTheory.Limits.opCompYonedaSectionsEquiv (Opposite.unop X) X_1).symm a)


theorem preimage_of_isIso {U : Y.Opens} (hU : IsAffineOpen U) (f : X ⟶ Y) [IsIso f] :
    IsAffineOpen (f ⁻¹ᵁ U)

{X Y : AlgebraicGeometry.Scheme}
{U : Y.Opens}
(hU : AlgebraicGeometry.IsAffineOpen U)
(f : X ⟶ Y)
[CategoryTheory.IsIso f]

AlgebraicGeometry.IsAffineOpen ((TopologicalSpace.Opens.map f.val.base).obj U)


@[to_additive]
theorem center_le_centralizer (s) : center M ≤ centralizer s

{M : Type u_1}
[AddMonoid M]
(s : Set M)

AddSubmonoid.center M ≤ AddSubmonoid.centralizer s


theorem Normal.tower_top_of_normal [h : Normal F E] : Normal K E

(F : Type u_1)
(K : Type u_2)
[Field F]
[Field K]
[Algebra F K]
(E : Type u_3)
[Field E]
[Algebra F E]
[Algebra K E]
[IsScalarTower F K E]
[h : Normal F E]


/-- Whiskering by an equivalence gives an equivalence between categories of cones.
-/
@[simps]
def whiskeringEquivalence (e : K ≌ J) : Cone F ≌ Cone (e.functor ⋙ F)

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

(CategoryTheory.Limits.Cones.whiskeringEquivalence e).functor = CategoryTheory.Limits.Cones.whiskering e.functor


lemma pow_dvd_add_pow_of_pow_eq_zero_right (hp : n + m ≤ p + 1) (h_comm : Commute x y)
    (hy : y ^ n = 0) : x ^ m ∣ (x + y) ^ p

{R : Type u_1}
{x y : R}
{n m p : ℕ}
[Semiring R]
(hp : n + m ≤ p + 1)
(h_comm : Commute x y)
(hy : y ^ n = 0)


/-- Dominated convergence theorem for nonnegative functions -/
theorem tendsto_lintegral_of_dominated_convergence {F : ℕ → α → ℝ≥0∞} {f : α → ℝ≥0∞}
    (bound : α → ℝ≥0∞) (hF_meas : ∀ n, Measurable (F n)) (h_bound : ∀ n, F n ≤ᵐ[μ] bound)
    (h_fin : ∫⁻ a, bound a ∂μ ≠ ∞) (h_lim : ∀ᵐ a ∂μ, Tendsto (fun n => F n a) atTop (𝓝 (f a))) :
    Tendsto (fun n => ∫⁻ a, F n a ∂μ) atTop (𝓝 (∫⁻ a, f a ∂μ))

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

{f : α → ℝ≥0∞}

(h_lim : ∀ᵐ (a : α) ∂μ, Filter.Tendsto (fun n => F n a) Filter.atTop (𝓝 (f a)))

Filter.Tendsto (fun n => ∫⁻ (a : α), F n a ∂μ) Filter.atTop (𝓝 (∫⁻ (a : α), f a ∂μ))


theorem double_dual_bound (x : E) : ‖(inclusionInDoubleDual 𝕜 E) x‖ ≤ ‖x‖

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

‖(NormedSpace.inclusionInDoubleDual 𝕜 E) x‖ ≤ ‖x‖


theorem append_inj' (h : s₁ ++ t₁ = s₂ ++ t₂) (hl : length t₁ = length t₂) : s₁ = s₂ ∧ t₁ = t₂

∀ {α : Type u_1} {s₁ t₁ s₂ t₂ : List α}, s₁ ++ t₁ = s₂ ++ t₂ → t₁.length = t₂.length → s₁ = s₂ ∧ t₁ = t₂


lemma map_symm (G : SimpleGraph W) (e : V ≃ W) :
    G.map e.symm.toEmbedding = G.comap e.toEmbedding

{V : Type u_1}
{W : Type u_2}
(G : SimpleGraph W)
(e : V ≃ W)

SimpleGraph.map e.symm.toEmbedding G = SimpleGraph.comap (⇑e.toEmbedding) G


@[simp]
theorem symm_neg : (neg R : M ≃ₗ[R] M).symm = neg R

{R : Type u_1}
{M : Type u_8}
[Semiring R]
[AddCommGroup M]
[Module R M]

(LinearEquiv.neg R).symm = LinearEquiv.neg R


theorem integral_Icc_eq_integral_Ico' (hy : μ {y} = 0) :
    ∫ t in Icc x y, f t ∂μ = ∫ t in Ico x y, f t ∂μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : X → E}
{μ : MeasureTheory.Measure X}
[PartialOrder X]
{x y : X}
(hy : μ {y} = 0)

∫ (t : X) in Set.Icc x y, f t ∂μ = ∫ (t : X) in Set.Ico x y, f t ∂μ


@[to_additive nsmul_neg]
theorem pow_lt_one' {a : M} (ha : a < 1) {k : ℕ} (hk : k ≠ 0) : a ^ k < 1

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


lemma of_postcomp {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) (hg : W g) (hfg : W (f ≫ g)) :
    W f

(hfg : W (CategoryTheory.CategoryStruct.comp f g))


/-- A linear isomorphism induces an order isomorphism of submodules. -/
@[simps! symm_apply apply]
def orderIsoMapComap [EquivLike F M M₂] [SemilinearMapClass F σ₁₂ M M₂] (f : F) :
    Submodule R M ≃o Submodule R₂ 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₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
[RingHomSurjective σ₁₂]
{F : Type u_9}
[EquivLike F M M₂]
[SemilinearMapClass F σ₁₂ M M₂]
(f : F)
(p : Submodule R₂ M₂)

(RelIso.symm (Submodule.orderIsoMapComap f)) p = Submodule.comap f p


@[to_additive]
protected lemma eq_mul_inv_iff_mul_eq (h : IsUnit c) : a = b * c⁻¹ ↔ a * c = b

{α : Type u}
[SubtractionMonoid α]
{a b c : α}
(h : IsAddUnit c)


lemma Shatters.of_compression (hs : (𝓓 a 𝒜).Shatters s) : 𝒜.Shatters s

{α : Type u_1}
[DecidableEq α]
{𝒜 : Finset (Finset α)}
{s : Finset α}
{a : α}
(hs : (𝓓 a 𝒜).Shatters s)


/-- An auxiliary typeclass for the Fundamental theorem of calculus, part 1. It is used to formulate
theorems that work simultaneously for left and right one-sided derivatives of `∫ x in u..v, f x`. -/
class FTCFilter (a : outParam ℝ) (outer : Filter ℝ) (inner : outParam <| Filter ℝ) extends
    TendstoIxxClass Ioc outer inner : Prop where
  pure_le : pure a ≤ outer
  le_nhds : inner ≤ 𝓝 a
  [meas_gen : IsMeasurablyGenerated inner]

[self : intervalIntegral.FTCFilter a outer inner]


theorem ne_true_of_eq_false : {b : Bool} → Eq b false → Not (Eq b true)


/-- The red and the blue arrows in ![this diagram](https://i.imgur.com/0GiBUh6.png) commute. -/
@[simp, reassoc]
theorem f_invApp_f_app (i j k : D.J) (U : Opens (D.V (i, j)).carrier) :
    (D.f_open i j).invApp U ≫ (D.f i k).c.app _ =
      (π₁ i, j, k).c.app (op U) ≫
        (π₂⁻¹ i, j, k) (unop _) ≫
          (D.V _).presheaf.map
            (eqToHom
              (by
                delta IsOpenImmersion.opensFunctor
                dsimp only [Functor.op, IsOpenMap.functor, Opens.map, unop_op]
                congr
                apply pullback_base))

(D : AlgebraicGeometry.PresheafedSpace.GlueData C)

(U : TopologicalSpace.Opens ↑↑(D.V (i, j)))

AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.invApp (D.f i j) U ≫
    (D.f i k).c.app (Opposite.op ((AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.opensFunctor (D.f i j)).obj U)) =
  (CategoryTheory.Limits.pullback.fst (D.f i j) (D.f i k)).c.app (Opposite.op U) ≫
    AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.invApp (CategoryTheory.Limits.pullback.snd (D.f i j) (D.f i k))
        (Opposite.unop
          (Opposite.op
            ((TopologicalSpace.Opens.map (CategoryTheory.Limits.pullback.fst (D.f i j) (D.f i k)).base).toPrefunctor.1
              (Opposite.unop (Opposite.op U))))) ≫
      (D.V (i, k)).presheaf.map (CategoryTheory.eqToHom ⋯)


/-- If `l` lists all the elements of `α` without duplicates, then `List.get` defines
an equivalence between `Fin l.length` and `α`.

See `List.Nodup.getBijectionOfForallMemList` for a version without
decidable equality. -/
@[simps]
def getEquivOfForallMemList (l : List α) (nd : l.Nodup) (h : ∀ x : α, x ∈ l) :
    Fin l.length ≃ α

{α : Type u_1}
[DecidableEq α]
(l : List α)
(nd : l.Nodup)
(h : ∀ (x : α), x ∈ l)
(a : α)

↑((List.Nodup.getEquivOfForallMemList l nd h).symm a) = List.indexOf a l


theorem suffix_union_right (l₁ l₂ : List α) : l₂ <:+ l₁ ∪ l₂

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


/-- A convenience wrapper for `MeasureTheory.Measure.isHaarMeasure_map`. -/
@[to_additive "A convenience wrapper for `MeasureTheory.Measure.isAddHaarMeasure_map`."]
nonrec theorem _root_.MulEquiv.isHaarMeasure_map [BorelSpace G] [TopologicalGroup G] {H : Type*}
    [Group H] [TopologicalSpace H] [MeasurableSpace H] [BorelSpace H]
    [TopologicalGroup H] (e : G ≃* H) (he : Continuous e) (hesymm : Continuous e.symm) :
    IsHaarMeasure (Measure.map e μ)

{G : Type u_2}
[MeasurableSpace G]
[AddGroup G]
[TopologicalSpace G]
(μ : MeasureTheory.Measure G)
[μ.IsAddHaarMeasure]
[BorelSpace G]
[TopologicalAddGroup G]
{H : Type u_4}
[AddGroup H]
[TopologicalSpace H]
[MeasurableSpace H]
[BorelSpace H]
[TopologicalAddGroup H]
(e : G ≃+ H)
(he : Continuous ⇑e)
(hesymm : Continuous ⇑e.symm)


@[simp]
theorem hsum_ofFinsupp {f : α →₀ HahnSeries Γ R} : (ofFinsupp f).hsum = f.sum fun _ => id

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[AddCommMonoid R]
{α : Type u_3}
{f : α →₀ HahnSeries Γ R}

(HahnSeries.SummableFamily.ofFinsupp f).hsum = f.sum fun x => id


theorem toArrayLit_eq (as : Array α) (n : Nat) (hsz : as.size = n) : as = toArrayLit as n hsz

{α : Type u_1}
(as : Array α)
(n : Nat)
(hsz : as.size = n)


theorem congr_fun_congr_arg {α β γ : Sort*} (f : α → β → γ) {a a' : α} (p : a = a') (b : β) :
    congr_fun (congr_arg f p) b = congr_arg (fun a ↦ f a b) p

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
(f : α → β → γ)
{a a' : α}
(p : a = a')
(b : β)


theorem iInf_le_coatom [Order.Coframe α] {a : α} (ha : IsCoatom a) {f : ι → α} :
    iInf f ≤ a ↔ ∃ i, f i ≤ a

{ι : Sort u_1}
{α : Type u_2}
[Order.Coframe α]
{a : α}
(ha : IsCoatom a)
{f : ι → α}


theorem Filter.EventuallyEq.congr_continuousWithinAt {f g : α → β} {s : Set α} {x : α}
    (h : f =ᶠ[𝓝[s] x] g) (hx : f x = g x) :
    ContinuousWithinAt f s x ↔ ContinuousWithinAt g s x

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f g : α → β}
{s : Set α}
{x : α}
(h : f =ᶠ[𝓝[s] x] g)
(hx : f x = g x)


@[simp]
lemma _root_.absorbs_biUnion_finset {ι : Type*} {t : ι → Set α} {I : Finset ι} :
    Absorbs M s (⋃ i ∈ I, t i) ↔ ∀ i ∈ I, Absorbs M s (t i)

{M : Type u_1}
{α : Type u_2}
[Bornology M]
[SMul M α]
{s : Set α}
{ι : Type u_3}
{t : ι → Set α}
{I : Finset ι}


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

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

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


@[simp]
theorem arcsin_nonpos {x : ℝ} : arcsin x ≤ 0 ↔ x ≤ 0


protected theorem mul_ediv_assoc' (b : Int) {a c : Int}
    (h : c ∣ a) : (a * b) / c = a / c * b


@[simp]
theorem ofIsCompl_smul {R : Type*} [CommRing R] {E : Type*} [AddCommGroup E] [Module R E]
    {F : Type*} [AddCommGroup F] [Module R F] {p q : Submodule R E} (h : IsCompl p q)
    {φ : p →ₗ[R] F} {ψ : q →ₗ[R] F} (c : R) : ofIsCompl h (c • φ) (c • ψ) = c • ofIsCompl h φ ψ

{R : Type u_7}
[CommRing R]
{E : Type u_8}
[AddCommGroup E]
[Module R E]
{F : Type u_9}
[AddCommGroup F]
[Module R F]
{p q : Submodule R E}
(h : IsCompl p q)
{φ : ↥p →ₗ[R] F}
{ψ : ↥q →ₗ[R] F}
(c : R)

LinearMap.ofIsCompl h (c • φ) (c • ψ) = c • LinearMap.ofIsCompl h φ ψ


lemma frequently_cocardinal_mem {s : Set α} :
    (∃ᶠ x in cocardinal α hreg, x ∈ s) ↔ c ≤ #s

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

(∃ᶠ (x : α) in Filter.cocardinal α hreg, x ∈ s) ↔ c ≤ #↑s


theorem tendsto_uniformity_iff_dist_tendsto_zero {f : ι → α × α} {p : Filter ι} :
    Tendsto f p (𝓤 α) ↔ Tendsto (fun x => dist (f x).1 (f x).2) p (𝓝 0)

{α : Type u}
{ι : Type u_2}
[PseudoMetricSpace α]
{f : ι → α × α}
{p : Filter ι}

Filter.Tendsto f p (𝓤 α) ↔ Filter.Tendsto (fun x => dist (f x).1 (f x).2) p (𝓝 0)


theorem SeminormFamily.withSeminorms_iff_nhds_eq_iInf [TopologicalAddGroup E]
    (p : SeminormFamily 𝕜 E ι) : WithSeminorms p ↔ (𝓝 (0 : E)) = ⨅ i, (𝓝 0).comap (p i)

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

WithSeminorms p ↔ 𝓝 0 = ⨅ i, Filter.comap (⇑(p i)) (𝓝 0)


/-- The functor sending an object `X` in the comma category to `X.left`. -/
@[simps]
def fst : Comma L R ⥤ A

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
(L : CategoryTheory.Functor A T)
(R : CategoryTheory.Functor B T)
(X : CategoryTheory.Comma L R)

(CategoryTheory.Comma.fst L R).obj X = X.left


theorem countP_mono_left (h : ∀ x ∈ l, p x → q x) : countP p l ≤ countP q l

(h : ∀ (x : α), x ∈ l → p x = true → q x = true)


@[simp]
theorem card_support_le_one {f : Perm α} : f.support.card ≤ 1 ↔ f = 1

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


theorem abs_areaForm_le (x y : E) : |ω x y| ≤ ‖x‖ * ‖y‖

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


theorem smeval_C_mul : (C r * p).smeval x = r • p.smeval x

(R : Type u_1)
[Semiring R]
(r : R)
(p : Polynomial R)
{S : Type u_2}
[NonAssocSemiring S]
[Module R S]
[Pow S ℕ]
(x : S)

(Polynomial.C r * p).smeval x = r • p.smeval x


/-- In a manifold with smooth inverse away from `0`, the inverse is continuous away from `0`.
This is not an instance for technical reasons, see
note [Design choices about smooth algebraic structures]. -/
theorem hasContinuousInv₀_of_hasSmoothInv₀ : HasContinuousInv₀ G

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
(I : ModelWithCorners 𝕜 E H)
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[Inv G]
[Zero G]
[SmoothInv₀ I G]


theorem uniformEmbedding_coe_real : UniformEmbedding ((↑) : ℕ → ℝ)


/-- (Implementation). An auxiliary cone which is useful in order to construct limits
in the comma category. -/
@[simps!]
def limitAuxiliaryCone (c₁ : Cone (F ⋙ fst L R)) : Cone ((F ⋙ snd L R) ⋙ R)

(F : CategoryTheory.Functor J (CategoryTheory.Comma L R))

(c₁ : CategoryTheory.Limits.Cone (F.comp (CategoryTheory.Comma.fst L R)))

(CategoryTheory.Comma.limitAuxiliaryCone F c₁).π.app X =
  CategoryTheory.CategoryStruct.comp (L.map (c₁.π.app X)) (F.obj X).hom


/-- A `forget₂ C D` forgetful functor between concrete categories `C` and `D`
where `forget C` reflects isomorphisms, itself reflects isomorphisms.
-/
theorem reflectsIsomorphisms_forget₂ [HasForget₂ C D] [(forget C).ReflectsIsomorphisms] :
    (forget₂ C D).ReflectsIsomorphisms

[CategoryTheory.Category.{u_1, u + 1} C]

[CategoryTheory.Category.{u_2, u + 1} D]


theorem ppred : Partrec fun n => ppred n


theorem not_limZero_const_of_nonzero {q : ℚ} (hq : q ≠ 0) : ¬LimZero (const (padicNorm p) q)

{p : ℕ}
[Fact (Nat.Prime p)]
{q : ℚ}
(hq : q ≠ 0)


@[simp] lemma ENNReal.exp_log (x : ℝ≥0∞) : exp (log x) = x


@[to_additive (attr := simp) card_mul_index]
theorem card_mul_index : Nat.card H * H.index = Nat.card G

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


theorem partialSups_le (f : ℕ → α) (n : ℕ) (a : α) (w : ∀ m, m ≤ n → f m ≤ a) :
    partialSups f n ≤ a

{α : Type u_1}
[SemilatticeSup α]
(f : ℕ → α)
(n : ℕ)
(a : α)
(w : ∀ m ≤ n, f m ≤ a)


/-- If a property of maps of topological spaces is stable under composition, the induced
morphism property of schemes is stable under composition. -/
lemma topologically_isStableUnderComposition
    (hP : ∀ {α β γ : Type u} [TopologicalSpace α] [TopologicalSpace β] [TopologicalSpace γ]
      (f : α → β) (g : β → γ) (_ : P f) (_ : P g), P (g ∘ f)) :
    (topologically P).IsStableUnderComposition

(P : {α β : Type u} → [inst : TopologicalSpace α] → [inst : TopologicalSpace β] → (α → β) → Prop)

(hP :
  ∀ {α β γ : Type u} [inst : TopologicalSpace α] [inst_1 : TopologicalSpace β] [inst_2 : TopologicalSpace γ] (f : α → β)
    (g : β → γ), P f → P g → P (g ∘ f))

(AlgebraicGeometry.topologically fun {α β} [TopologicalSpace α] [TopologicalSpace β] => P).IsStableUnderComposition


theorem isDetector_unop_iff (G : Cᵒᵖ) : IsDetector (unop G) ↔ IsCodetector G

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

CategoryTheory.IsDetector (Opposite.unop G) ↔ CategoryTheory.IsCodetector G


lemma arg_eq_zero_iff_zero_le {z : ℂ} : arg z = 0 ↔ 0 ≤ z


theorem forall_mem_nil (p : α → Prop) : ∀ (x) (_ : x ∈ @nil α), p x


/-- If a locally integrable function `f` on a finite-dimensional real manifold has zero integral
when multiplied by any smooth compactly supported function, then `f` vanishes almost everywhere. -/
theorem ae_eq_zero_of_integral_smooth_smul_eq_zero (hf : LocallyIntegrable f μ)
    (h : ∀ g : M → ℝ, Smooth I 𝓘(ℝ) g → HasCompactSupport g → ∫ x, g x • f x ∂μ = 0) :
    ∀ᵐ x ∂μ, f x = 0

(hf : MeasureTheory.LocallyIntegrable f μ)

(h : ∀ (g : M → ℝ), Smooth I 𝓘(ℝ, ℝ) g → HasCompactSupport g → ∫ (x : M), g x • f x ∂μ = 0)


theorem CondIndepSets.bUnion {s : ι → Set (Set Ω)} {s' : Set (Set Ω)}
    {u : Set ι} (hyp : ∀ n ∈ u, CondIndepSets m' hm' (s n) s' μ) :
    CondIndepSets m' hm' (⋃ n ∈ u, s n) s' μ

(hyp : ∀ n ∈ u, ProbabilityTheory.CondIndepSets m' hm' (s n) s' μ)

ProbabilityTheory.CondIndepSets m' hm' (⋃ n ∈ u, s n) s' μ


theorem Function.IsFixedPt.birkhoffAverage_eq [CharZero R] {f : α → α} {x : α} (h : IsFixedPt f x)
    (g : α → M) {n : ℕ} (hn : n ≠ 0) : birkhoffAverage R f g n x = g x

(R : Type u_1)
{α : Type u_2}
{M : Type u_3}
[DivisionSemiring R]
[AddCommMonoid M]
[Module R M]
[CharZero R]
{f : α → α}
{x : α}
(h : Function.IsFixedPt f x)
(g : α → M)
{n : ℕ}
(hn : n ≠ 0)


theorem rightUnitor_naturality {X Y : Dial C} (f : X ⟶ Y) :
    (f ⊗ 𝟙 (𝟙_ (Dial C))) ≫ (ρ_ Y).hom = (ρ_ X).hom ≫ f

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.tensorHom f (CategoryTheory.CategoryStruct.id (𝟙_ (CategoryTheory.Dial C))))
    (CategoryTheory.MonoidalCategory.rightUnitor Y).hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.rightUnitor X).hom f


@[to_additive]
theorem comap_surjective_of_injective : Function.Surjective (comap f)

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
{f : M →ₙ* N}
(hf : Function.Injective ⇑f)


@[to_additive (attr := simp 1100, norm_cast)]
theorem val_multiset_prod {G} [CommGroup G] (H : Subgroup G) (m : Multiset H) :
    (m.prod : G) = (m.map Subtype.val).prod

{G : Type u_3}
[AddCommGroup G]
(H : AddSubgroup G)
(m : Multiset ↥H)

↑m.sum = (Multiset.map Subtype.val m).sum


@[to_additive]
theorem eq_iff (f : G →* M) {x y : G} : f x = f y ↔ y⁻¹ * x ∈ f.ker

{G : Type u_1}
[AddGroup G]
{M : Type u_7}
[AddZeroClass M]
(f : G →+ M)
{x y : G}


@[to_additive (attr := simp)]
theorem symm_smul (c : G) : (smul c : α ≃ᵐ α).symm = smul c⁻¹

{G : Type u_1}
{α : Type u_3}
[MeasurableSpace G]
[MeasurableSpace α]
[AddGroup G]
[AddAction G α]
[MeasurableVAdd G α]
(c : G)

(MeasurableEquiv.vadd c).symm = MeasurableEquiv.vadd (-c)


@[simp]
theorem coe_mkUnit {a : Units k} {A : 𝕎 k} (hA : A.coeff 0 = a) : (mkUnit hA : 𝕎 k) = A

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{k : Type u_1}
[CommRing k]
[CharP k p]
{a : kˣ}
{A : WittVector p k}
(hA : A.coeff 0 = ↑a)


@[simp]
theorem preimage_empty : r.preimage ∅ = ∅

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


theorem IsIntegral.fg_adjoin_singleton {x : B} (hx : IsIntegral R x) :
    (Algebra.adjoin R {x}).toSubmodule.FG

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

(Subalgebra.toSubmodule (Algebra.adjoin R {x})).FG


theorem Indep.indepSet_of_measurableSet {m₁ m₂ m0 : MeasurableSpace Ω} {κ : Kernel α Ω}
    {μ : Measure α}
    (h_indep : Indep m₁ m₂ κ μ) {s t : Set Ω} (hs : MeasurableSet[m₁] s)
    (ht : MeasurableSet[m₂] t) :
    IndepSet s t κ μ

(h_indep : ProbabilityTheory.Kernel.Indep m₁ m₂ κ μ)

ProbabilityTheory.Kernel.IndepSet s t κ μ


/-- A subset of a preorder `P` is an ideal if it is
  - nonempty
  - upward directed (any pair of elements in the ideal has an upper bound in the ideal)
  - downward closed (any element less than an element of the ideal is in the ideal). -/
@[mk_iff]
structure IsIdeal {P} [LE P] (I : Set P) : Prop where
  /-- The ideal is downward closed. -/
  IsLowerSet : IsLowerSet I
  /-- The ideal is nonempty. -/
  Nonempty : I.Nonempty
  /-- The ideal is upward directed. -/
  Directed : DirectedOn (· ≤ ·) I

{P : Type u_2}
[LE P]
{I : Set P}
(self : Order.IsIdeal I)


theorem mem_Icc_iff_abs_le {R : Type*} [LinearOrderedAddCommGroup R] {x y z : R} :
    |x - y| ≤ z ↔ y ∈ Icc (x - z) (x + z)

{R : Type u_2}
[LinearOrderedAddCommGroup R]
{x y z : R}

|x - y| ≤ z ↔ y ∈ Set.Icc (x - z) (x + z)


theorem modEq_comm : a ≡ b [ZMOD n] ↔ b ≡ a [ZMOD n]


@[simp]
theorem nonempty_neLocus_iff {f g : α →₀ N} : (f.neLocus g).Nonempty ↔ f ≠ g

{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[Zero N]
{f g : α →₀ N}


@[simps!]
instance : MonoidalCategoryStruct (Dial C)

(CategoryTheory.MonoidalCategory.tensorObj X Y).src = (X.src ⨯ Y.src)


@[simp]
theorem factorization_zero : factorization 0 = 0


theorem inf_id_eq_sInf [CompleteLattice α] (s : Finset α) : s.inf id = sInf s

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


/-- A set `s` is in the neighbourhood of `a` iff there is some basis set `t`, which
contains `a` and is itself contained in `s`. -/
theorem IsTopologicalBasis.mem_nhds_iff {a : α} {s : Set α} {b : Set (Set α)}
    (hb : IsTopologicalBasis b) : s ∈ 𝓝 a ↔ ∃ t ∈ b, a ∈ t ∧ t ⊆ s

(hb : TopologicalSpace.IsTopologicalBasis b)


theorem Ioc_eq_finset_subtype : Ioc a b = (Ioc (a : ℕ) b).fin n

Finset.Ioc a b = Finset.fin n (Finset.Ioc ↑a ↑b)


/-- Product of a list of elements in a submonoid is in the submonoid. -/
@[to_additive "Sum of a list of elements in an `AddSubmonoid` is in the `AddSubmonoid`."]
theorem list_prod_mem {l : List M} (hl : ∀ x ∈ l, x ∈ S) : l.prod ∈ S

{M : Type u_1}
{B : Type u_3}
[AddMonoid M]
[SetLike B M]
[AddSubmonoidClass B M]
{S : B}
{l : List M}
(hl : ∀ x ∈ l, x ∈ S)


@[to_additive]
theorem eq_liftOfRightInverse (hf : Function.RightInverse f_inv f) (g : G₁ →* G₃)
    (hg : f.ker ≤ g.ker) (h : G₂ →* G₃) (hh : h.comp f = g) :
    h = f.liftOfRightInverse f_inv hf ⟨g, hg⟩

{G₁ : Type u_5}
{G₂ : Type u_6}
{G₃ : Type u_7}
[Group G₁]
[Group G₂]
[Group G₃]
(f : G₁ →* G₂)
(f_inv : G₂ → G₁)
(hf : Function.RightInverse f_inv ⇑f)
(g : G₁ →* G₃)
(hg : f.ker ≤ g.ker)
(h : G₂ →* G₃)
(hh : h.comp f = g)

h = (f.liftOfRightInverse f_inv hf) ⟨g, hg⟩


@[simp]
lemma coe_maximum_of_length_pos (h : 0 < l.length) :
    (l.maximum_of_length_pos h : α) = l.maximum

{α : Type u_1}
[LinearOrder α]
{l : List α}
(h : 0 < l.length)

↑(List.maximum_of_length_pos h) = l.maximum


@[simp]
theorem filter_False {h} (s : Finset α) : @filter _ (fun _ => False) h s = ∅

{α : Type u_1}
{h : DecidablePred fun x => False}
(s : Finset α)


theorem mem_enumFrom {x : α} {i j : ℕ} (xs : List α) (h : (i, x) ∈ xs.enumFrom j) :
    j ≤ i ∧ i < j + xs.length ∧ x ∈ xs

{α : Type u_1}
{x : α}
{i j : ℕ}
(xs : List α)
(h : (i, x) ∈ List.enumFrom j xs)


/-- A homomorphism between first-order structures is a function that commutes with the
  interpretations of functions and maps tuples in one structure where a given relation is true to
  tuples in the second structure where that relation is still true. -/
structure Hom where
  /-- The underlying function of a homomorphism of structures -/
  toFun : M → N
  /-- The homomorphism commutes with the interpretations of the function symbols -/
  -- Porting note:
  -- The autoparam here used to be `obviously`. We would like to replace it with `aesop`
  -- but that isn't currently sufficient.
  -- See https://leanprover.zulipchat.com/#narrow/stream/287929-mathlib4/topic/Aesop.20and.20cases
  -- If that can be improved, we should change this to `by aesop` and remove the proofs below.
  map_fun' : ∀ {n} (f : L.Functions n) (x), toFun (funMap f x) = funMap f (toFun ∘ x) := by
    intros; trivial
  /-- The homomorphism sends related elements to related elements -/
  map_rel' : ∀ {n} (r : L.Relations n) (x), RelMap r x → RelMap r (toFun ∘ x) := by
    -- Porting note: see porting note on `Hom.map_fun'`
    intros; trivial

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
(self : L.Hom M N)
{n : ℕ}
(f : L.Functions n)
(x : Fin n → M)

self.toFun (FirstOrder.Language.Structure.funMap f x) = FirstOrder.Language.Structure.funMap f (self.toFun ∘ x)


@[simp]
theorem coe_toWeakDualBCNN (μ : ProbabilityMeasure Ω) :
    ⇑μ.toWeakDualBCNN = μ.toFiniteMeasure.testAgainstNN

(μ : MeasureTheory.ProbabilityMeasure Ω)


lemma hasBasis_seminorms : (𝓝 (0 : E →WOT[𝕜] F)).HasBasis (seminormFamily 𝕜 E F).basisSets id

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[AddCommGroup E]
[TopologicalSpace E]
[Module 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]

(𝓝 0).HasBasis (ContinuousLinearMapWOT.seminormFamily 𝕜 E F).basisSets id


theorem mul_smul' (x y : GL(2, ℝ)⁺) (z : ℍ) : smulAux (x * y) z = smulAux x (smulAux y z)

UpperHalfPlane.smulAux (x * y) z = UpperHalfPlane.smulAux x (UpperHalfPlane.smulAux y z)


theorem lmarginal_update_of_mem {i : δ} (hi : i ∈ s)
    (f : (∀ i, π i) → ℝ≥0∞) (x : ∀ i, π i) (y : π i) :
    (∫⋯∫⁻_s, f ∂μ) (Function.update x i y) = (∫⋯∫⁻_s, f ∂μ) x

(μ : (i : δ) → MeasureTheory.Measure (π i))


theorem Lp.ae_eq_zero_of_forall_setIntegral_eq_zero' (hm : m ≤ m0) (f : Lp E' p μ)
    (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞)
    (hf_int_finite : ∀ s, MeasurableSet[m] s → μ s < ∞ → IntegrableOn f s μ)
    (hf_zero : ∀ s : Set α, MeasurableSet[m] s → μ s < ∞ → ∫ x in s, f x ∂μ = 0)
    (hf_meas : AEStronglyMeasurable' m f μ) : f =ᵐ[μ] 0

(hf_int_finite : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → MeasureTheory.IntegrableOn (↑↑f) s μ)

(hf_zero : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∫ (x : α) in s, ↑↑f x ∂μ = 0)

(hf_meas : MeasureTheory.AEStronglyMeasurable' m (↑↑f) μ)


theorem opNorm_lsmul_apply_le (x : 𝕜') : ‖(lsmul 𝕜 𝕜' x : E →L[𝕜] E)‖ ≤ ‖x‖

{𝕜 : Type u_1}
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]
{𝕜' : Type u_3}
[NormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormedSpace 𝕜' E]
[IsScalarTower 𝕜 𝕜' E]
(x : 𝕜')

‖(ContinuousLinearMap.lsmul 𝕜 𝕜') x‖ ≤ ‖x‖


theorem mult_pos {w : InfinitePlace K} : 0 < mult w

{K : Type u_2}
[Field K]
{w : NumberField.InfinitePlace K}


theorem lift_unique {C} [Category C] (φ : V ⥤q C) (Φ : Paths V ⥤ C)
    (hΦ : of ⋙q Φ.toPrefunctor = φ) : Φ = lift φ

(Φ : CategoryTheory.Functor (CategoryTheory.Paths V) C)

(hΦ : CategoryTheory.Paths.of ⋙q Φ.toPrefunctor = φ)


/-- A family of morphisms `T' ⟶ T j` lifts to a morphism `T' ⟶ productTriangle T`. -/
@[simps]
def productTriangle.lift {T' : Triangle C} (φ : ∀ j, T' ⟶ T j) :
    T' ⟶ productTriangle T

(T : J → CategoryTheory.Pretriangulated.Triangle C)

[CategoryTheory.Limits.HasProduct fun j => (T j).obj₁]

[CategoryTheory.Limits.HasProduct fun j => (T j).obj₂]

[CategoryTheory.Limits.HasProduct fun j => (T j).obj₃]

[CategoryTheory.Limits.HasProduct fun j => (CategoryTheory.shiftFunctor C 1).obj (T j).obj₁]

{T' : CategoryTheory.Pretriangulated.Triangle C}

(CategoryTheory.Pretriangulated.productTriangle.lift T φ).hom₃ = CategoryTheory.Limits.Pi.lift fun j => (φ j).hom₃


@[to_additive]
lemma compHom_smul_def
    {E F G : Type*} [Monoid E] [Monoid F] [MulAction F G] (f : E →* F) (a : E) (x : G) :
    letI : MulAction E G := MulAction.compHom _ f
    a • x = (f a) • x

{E : Type u_11}
{F : Type u_12}
{G : Type u_13}
[AddMonoid E]
[AddMonoid F]
[AddAction F G]
(f : E →+ F)
(a : E)
(x : G)


@[simp] theorem snd_one [Zero ι] [GOne A] : (1 : GradedMonoid A).snd = GOne.one

{ι : Type u_1}
(A : ι → Type u_2)
[Zero ι]
[GradedMonoid.GOne A]


theorem gcd_mono {s₁ s₂ : Multiset α} (h : s₁ ⊆ s₂) : s₂.gcd ∣ s₁.gcd

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


theorem comp_hasFDerivAt_iff' {f : G → E} {x : G} {f' : G →L[𝕜] F} :
    HasFDerivAt (iso ∘ f) f' x ↔ HasFDerivAt f ((iso.symm : F →L[𝕜] E).comp f') x

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

HasFDerivAt (⇑iso ∘ f) f' x ↔
  HasFDerivAt f ((↑{ toLinearEquiv := iso.symm.toLinearEquiv, continuous_toFun := ⋯, continuous_invFun := ⋯ }).comp f')
    x


@[to_additive]
theorem codisjoint_mrange_inl_mrange_inr :
    Codisjoint (MonoidHom.mrange (inl : M →* M ∗ N)) (MonoidHom.mrange inr)

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

Codisjoint (AddMonoidHom.mrange AddMonoid.Coprod.inl) (AddMonoidHom.mrange AddMonoid.Coprod.inr)


theorem ConvexOn.add (hf : ConvexOn 𝕜 s f) (hg : ConvexOn 𝕜 s g) : ConvexOn 𝕜 s (f + g)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedAddCommMonoid β]
[SMul 𝕜 E]
[DistribMulAction 𝕜 β]
{s : Set E}
{f g : E → β}
(hf : ConvexOn 𝕜 s f)
(hg : ConvexOn 𝕜 s g)


theorem Set.Countable.isLindelof_sUnion {S : Set (Set X)} (hf : S.Countable)
    (hc : ∀ s ∈ S, IsLindelof s) : IsLindelof (⋃₀ S)

{X : Type u}
[TopologicalSpace X]
{S : Set (Set X)}
(hf : S.Countable)
(hc : ∀ s ∈ S, IsLindelof s)


/-- If three points are not collinear, the sine of the angle between them is nonzero. -/
theorem sin_ne_zero_of_not_collinear {p₁ p₂ p₃ : P} (h : ¬Collinear ℝ ({p₁, p₂, p₃} : Set P)) :
    Real.sin (∠ p₁ p₂ p₃) ≠ 0

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p₁ p₂ p₃ : P}
(h : ¬Collinear ℝ {p₁, p₂, p₃})

Real.sin (EuclideanGeometry.angle p₁ p₂ p₃) ≠ 0


lemma isContinuous_of_preservesOneHypercovers
    [PreservesOneHypercovers.{w} F J K] [GrothendieckTopology.IsGeneratedByOneHypercovers.{w} J] :
    IsContinuous.{t} F J K

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)


theorem BddAbove.bddBelow_image2_of_bddAbove :
    BddAbove s → BddBelow t → BddBelow (Set.image2 f s t)

{f : α → β → γ}

(h₀ : ∀ (b : β), Antitone (Function.swap f b))


@[to_additive]
lemma op_smul_eq_op_smul_op [SMul M α] [SMul Mᵐᵒᵖ α] [IsCentralScalar M α] (r : M) (a : α) :
    op (r • a) = op r • op a

{M : Type u_2}
{α : Type u_4}
[SMul M α]
[SMul Mᵐᵒᵖ α]
[IsCentralScalar M α]
(r : M)
(a : α)

MulOpposite.op (r • a) = MulOpposite.op r • MulOpposite.op a


@[simp]
theorem erase_mk [DecidableEq α] (m : Multiset α)
    (hc : Multiset.card m = n + 1) (a : α) (h : a ∈ m) :
    (mk m hc).erase a h =mk (m.erase a)
        (by rw [Multiset.card_erase_of_mem h, hc, Nat.add_one, Nat.pred_succ])

{α : Type u_1}
{n : ℕ}
[DecidableEq α]
(m : Multiset α)
(hc : Multiset.card m = n + 1)
(a : α)
(h : a ∈ m)

(Sym.mk m hc).erase a h = Sym.mk (m.erase a) ⋯


/-- If `𝓕 : ι → β → α` tends to `f : β → α` *pointwise* along some nontrivial filter, and if the
family `𝓕` is uniformly equicontinuous, then the limit is uniformly continuous. -/
theorem Filter.Tendsto.uniformContinuous_of_uniformEquicontinuous {l : Filter ι} [l.NeBot]
    {F : ι → β → α} {f : β → α} (h₁ : Tendsto F l (𝓝 f)) (h₂ : UniformEquicontinuous F) :
    UniformContinuous f

{ι : Type u_1}
{α : Type u_7}
{β : Type u_9}
[uα : UniformSpace α]
[uβ : UniformSpace β]
{l : Filter ι}
[l.NeBot]
{F : ι → β → α}
{f : β → α}
(h₁ : Filter.Tendsto F l (nhds f))
(h₂ : UniformEquicontinuous F)


theorem nontrivial_of_univ_nontrivial (h : (univ : Set α).Nontrivial) : Nontrivial α


@[simp]
theorem bind₂_id : bind₂ (RingHom.id (MvPolynomial σ R)) = join₂

{σ : Type u_1}
{R : Type u_3}
[CommSemiring R]

MvPolynomial.bind₂ (RingHom.id (MvPolynomial σ R)) = MvPolynomial.join₂


/-- The star subalgebra generated by polynomials functions is dense in `C(s, 𝕜)` when `s` is
compact and `𝕜` is either `ℝ` or `ℂ`. -/
theorem polynomialFunctions.starClosure_topologicalClosure {𝕜 : Type*} [RCLike 𝕜] (s : Set 𝕜)
    [CompactSpace s] : (polynomialFunctions s).starClosure.topologicalClosure = ⊤

{𝕜 : Type u_1}
[RCLike 𝕜]
(s : Set 𝕜)
[CompactSpace ↑s]


theorem setIntegral_indicatorConstLp [CompleteSpace E]
    {p : ℝ≥0∞} (hs : MeasurableSet s) (ht : MeasurableSet t) (hμt : μ t ≠ ∞) (e : E) :
    ∫ x in s, indicatorConstLp p ht hμt e x ∂μ = (μ (t ∩ s)).toReal • e

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{s t : Set X}
{μ : MeasureTheory.Measure X}
[CompleteSpace E]
{p : ℝ≥0∞}
(hs : MeasurableSet s)
(ht : MeasurableSet t)
(hμt : μ t ≠ ⊤)
(e : E)

∫ (x : X) in s, ↑↑(MeasureTheory.indicatorConstLp p ht hμt e) x ∂μ = (μ (t ∩ s)).toReal • e


/-- For a family of functions to a (pseudo) metric spaces, a convenient way to prove
equicontinuity at a point is to show that all of the functions share a common *local* continuity
modulus. -/
theorem equicontinuousAt_of_continuity_modulus {ι : Type*} [TopologicalSpace β] {x₀ : β}
    (b : β → ℝ) (b_lim : Tendsto b (𝓝 x₀) (𝓝 0)) (F : ι → β → α)
    (H : ∀ᶠ x in 𝓝 x₀, ∀ i, dist (F i x₀) (F i x) ≤ b x) : EquicontinuousAt F x₀

(F : ι → β → α)

(H : ∀ᶠ (x : β) in 𝓝 x₀, ∀ (i : ι), dist (F i x₀) (F i x) ≤ b x)


@[simp, norm_cast]
theorem coe_ennreal_pow (x : ℝ≥0∞) (n : ℕ) : (↑(x ^ n) : EReal) = (x : EReal) ^ n


theorem not_iff_false_intro (h : a) : ¬a ↔ False


theorem multiplicity_factorial_le_div_pred {p : ℕ} (hp : p.Prime) (n : ℕ) :
    multiplicity p n ! ≤ (n / (p - 1) : ℕ)


theorem nndist_comm (x y : α) : nndist x y = nndist y x

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


/-- The restriction of a sheafed space `X` to the top subspace is isomorphic to `X` itself.
-/
@[simps! hom inv]
def restrictTopIso (X : SheafedSpace C) : X.restrict (Opens.openEmbedding ⊤) ≅ X

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


theorem tan_int_mul_pi_sub (x : ℝ) (n : ℤ) : tan (n * π - x) = -tan x

Real.tan (↑n * Real.pi - x) = -Real.tan x


theorem ForInStep.bindList_cons' [Monad m] [LawfulMonad m]
    (f : α → β → m (ForInStep β)) (s : ForInStep β) (a l) :
    s.bindList f (a::l) = s.bind (f a) >>= (·.bindList f l)

{m : Type u_1 → Type u_2}
{α : Type u_3}
{β : Type u_1}
[Monad m]
[LawfulMonad m]
(f : α → β → m (ForInStep β))
(s : ForInStep β)
(a : α)
(l : List α)

ForInStep.bindList f (a :: l) s = do
  let x ← s.bind (f a)
  ForInStep.bindList f l x


@[simp]
theorem nat_mul_aleph0 {n : ℕ} (hn : n ≠ 0) : ↑n * ℵ₀ = ℵ₀


/-- Colimit cocones on `F` are unique up to isomorphism. -/
@[simps]
def uniqueUpToIso {s t : Cocone F} (P : IsColimit s) (Q : IsColimit t) : s ≅ t

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

(P.uniqueUpToIso Q).inv = Q.descCoconeMorphism s


@[simp]
theorem support_zero : support (0 : FreeAbelianGroup X) = ∅


theorem isLimit_of_mem_frontier (ha : a ∈ frontier s) : IsLimit a

{s : Set Ordinal.{u}}
{a : Ordinal.{u}}
(ha : a ∈ frontier s)


/-- A module object for a monoid object, all internal to some monoidal category. -/
structure Mod_ (A : Mon_ C) where
  X : C
  act : A.X ⊗ X ⟶ X
  one_act : (A.one ▷ X) ≫ act = (λ_ X).hom := by aesop_cat
  assoc : (A.mul ▷ X) ≫ act = (α_ A.X A.X X).hom ≫ (A.X ◁ act) ≫ act := by aesop_cat

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

A.one ▷ self.X ≫ self.act = (λ_ self.X).hom


@[reassoc (attr := simp)]
theorem whiskerLeft_naturality_naturality (f : a' ⟶ G.obj a) {g h : a ⟶ b} (β : g ⟶ h) :
    f ◁ G.map₂ β ▷ θ.app b ≫ f ◁ (θ.naturality h).hom =
      f ◁ (θ.naturality g).hom ≫ f ◁ θ.app a ◁ H.map₂ β

(θ : CategoryTheory.StrongOplaxNatTrans G H)

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.whiskerRight (G.map₂ β) (θ.app b)))
    (CategoryTheory.Bicategory.whiskerLeft f (θ.naturality h).hom) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerLeft f (θ.naturality g).hom)
    (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.whiskerLeft (θ.app a) (H.map₂ β)))


theorem toSubgraph_cons_nil_eq_subgraphOfAdj (h : G.Adj u v) :
    (cons h nil).toSubgraph = G.subgraphOfAdj h

{V : Type u}
{G : SimpleGraph V}
{u v : V}
(h : G.Adj u v)

(SimpleGraph.Walk.cons h SimpleGraph.Walk.nil).toSubgraph = G.subgraphOfAdj h


/-- `UniqueMDiffWithinAt` achieves its goal: it implies the uniqueness of the derivative. -/
nonrec theorem UniqueMDiffWithinAt.eq (U : UniqueMDiffWithinAt I s x)
    (h : HasMFDerivWithinAt I I' f s x f') (h₁ : HasMFDerivWithinAt I I' f s x f₁') : f' = f₁'

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


/-- If `f` has a formal power series on a ball bounded by `0`, then `f` is equal to `0` on
the ball. -/
theorem HasFiniteFPowerSeriesOnBall.eq_zero_of_bound_zero
    (hf : HasFiniteFPowerSeriesOnBall f pf x 0 r) : ∀ y ∈ EMetric.ball x r, f y = 0


theorem house_sum_le_sum_house {ι : Type*} (s : Finset ι) (α : ι → K) :
    house (∑ i ∈ s, α i) ≤ ∑ i ∈ s, house (α i)

{K : Type u_1}
[Field K]
[NumberField K]
{ι : Type u_2}
(s : Finset ι)
(α : ι → K)

NumberField.house (∑ i ∈ s, α i) ≤ ∑ i ∈ s, NumberField.house (α i)


theorem IntegrableOn.right_of_union (h : IntegrableOn f (s ∪ t) μ) : IntegrableOn f t μ

(h : MeasureTheory.IntegrableOn f (s ∪ t) μ)


@[simp]
theorem mem_map {f : F} {s : NonUnitalSubsemiring R} {y : S} : y ∈ s.map f ↔ ∃ x ∈ s, f x = y

{R : Type u}
{S : Type v}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
{F : Type u_1}
[FunLike F R S]
[NonUnitalRingHomClass F R S]
{f : F}
{s : NonUnitalSubsemiring R}
{y : S}

y ∈ NonUnitalSubsemiring.map f s ↔ ∃ x ∈ s, f x = y


theorem toIcoDiv_apply_right (a : α) : toIcoDiv hp a (a + p) = 1

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


@[simp, norm_cast]
theorem codisjoint_coe : Codisjoint (a : α) b ↔ Codisjoint a b

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


theorem IsPrimitiveRoot.nnnorm_eq_one {ζ : ℂ} {n : ℕ} (h : IsPrimitiveRoot ζ n) (hn : n ≠ 0) :
    ‖ζ‖₊ = 1


@[trans]
theorem trans ⦃p₀ p₁ p₂ : Path x₀ x₁⦄ (h₀ : p₀.Homotopic p₁) (h₁ : p₁.Homotopic p₂) :
    p₀.Homotopic p₂

{X : Type u}
[TopologicalSpace X]
{x₀ x₁ : X}
⦃p₀ p₁ p₂ : Path x₀ x₁⦄
(h₀ : p₀.Homotopic p₁)
(h₁ : p₁.Homotopic p₂)


theorem nhds_left_eq_nhds (a : Ordinal) : 𝓝[≤] a = 𝓝 a


@[simp]
theorem isPath_copy {u v u' v'} (p : G.Walk u v) (hu : u = u') (hv : v = v') :
    (p.copy hu hv).IsPath ↔ p.IsPath

{V : Type u}
{G : SimpleGraph V}
{u v u' v' : V}
(p : G.Walk u v)
(hu : u = u')
(hv : v = v')


/-- A reflexive module has a perfect pairing with its dual. -/
@[simps]
def IsReflexive.toPerfectPairingDual : PerfectPairing R (Dual R M) M

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
[Module.IsReflexive R M]


@[simp]
theorem fromBlocks_submatrix_sum_swap_left (A : Matrix n l α) (B : Matrix n m α) (C : Matrix o l α)
    (D : Matrix o m α) (f : p → l ⊕ m) :
    (fromBlocks A B C D).submatrix Sum.swap f = (fromBlocks C D A B).submatrix id f

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

(Matrix.fromBlocks A B C D).submatrix Sum.swap f = (Matrix.fromBlocks C D A B).submatrix id f


theorem Ico_subset_Iic_self : Ico a b ⊆ Iic b

{α : Type u_2}
[Preorder α]
[LocallyFiniteOrder α]
{a b : α}
[LocallyFiniteOrderBot α]


lemma support_monotone : Monotone (support (α := ι) (M := α))

{ι : Type u_1}
{α : Type u_2}
[CanonicallyOrderedAddCommMonoid α]


theorem supports_union {K₁ K₂ S} : Supports (K₁ ∪ K₂) S ↔ Supports K₁ S ∧ Supports K₂ S

{K₁ K₂ S : Finset Turing.PartrecToTM2.Λ'}

Turing.PartrecToTM2.Supports (K₁ ∪ K₂) S ↔ Turing.PartrecToTM2.Supports K₁ S ∧ Turing.PartrecToTM2.Supports K₂ S


/-- If `f` is locally integrable on `(∞, a]`, and `f =O[atBot] g`, for some
`g` integrable at `atBot`, then `f` is integrable on `(∞, a]`. -/
theorem LocallyIntegrableOn.integrableOn_of_isBigO_atBot [IsMeasurablyGenerated (atBot (α := α))]
    (hf : LocallyIntegrableOn f (Iic a) μ) (ho : f =O[atBot] g)
    (hg : IntegrableAtFilter g atBot μ) : IntegrableOn f (Iic a) μ

(hf : MeasureTheory.LocallyIntegrableOn f (Set.Iic a) μ)

(hg : MeasureTheory.IntegrableAtFilter g Filter.atBot μ)

MeasureTheory.IntegrableOn f (Set.Iic a) μ


@[simp, norm_cast]
theorem coe_snd (a : A) : (a : 𝓜(𝕜, A)).snd = (ContinuousLinearMap.mul 𝕜 A).flip a

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[SMulCommClass 𝕜 A A]
[IsScalarTower 𝕜 A A]
(a : A)

(↑𝕜 a).toProd.2 = (ContinuousLinearMap.mul 𝕜 A).flip a


@[fun_prop]
theorem continuousOn_id' (s : Set α) : ContinuousOn (fun x : α => x) s

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


theorem zigzag_of_eqvGen_quot_rel {F : C ⥤ D} {d : D} {f₁ f₂ : ΣX, d ⟶ F.obj X}
    (t : EqvGen (Types.Quot.Rel.{v, v} (F ⋙ coyoneda.obj (op d))) f₁ f₂) :
    Zigzag (StructuredArrow.mk f₁.2) (StructuredArrow.mk f₂.2)

(t : EqvGen (CategoryTheory.Limits.Types.Quot.Rel (F.comp (CategoryTheory.coyoneda.obj (Opposite.op d)))) f₁ f₂)

CategoryTheory.Zigzag (CategoryTheory.StructuredArrow.mk f₁.snd) (CategoryTheory.StructuredArrow.mk f₂.snd)


/-- See `inv_sub_inv` for the more convenient version when `K` is commutative. -/
theorem inv_sub_inv' {a b : K} (ha : a ≠ 0) (hb : b ≠ 0) : a⁻¹ - b⁻¹ = a⁻¹ * (b - a) * b⁻¹

{K : Type u_3}
[DivisionRing K]
{a b : K}
(ha : a ≠ 0)
(hb : b ≠ 0)


@[to_additive]
theorem map_mul_right_inv_eq_self (μ : Measure G) [IsInvInvariant μ] [IsMulLeftInvariant μ]
    (g : G) : map (fun t => (g * t)⁻¹) μ = μ

{G : Type u_2}
[MeasurableSpace G]
[DivisionMonoid G]
[MeasurableMul G]
[MeasurableInv G]
(μ : MeasureTheory.Measure G)
[μ.IsInvInvariant]
[μ.IsMulLeftInvariant]
(g : G)

MeasureTheory.Measure.map (fun t => (g * t)⁻¹) μ = μ


@[simp] lemma tail_zero : vecTail (0 : Fin n.succ → α) = 0


/-- Given two points `x ≠ y`, we can find neighbourhoods `x ∈ V₁ ⊆ U₁` and `y ∈ V₂ ⊆ U₂`,
with the `Vₖ` closed and the `Uₖ` open, such that the `Uₖ` are disjoint. -/
theorem disjoint_nested_nhds [T3Space X] {x y : X} (h : x ≠ y) :
    ∃ U₁ ∈ 𝓝 x, ∃ V₁ ∈ 𝓝 x, ∃ U₂ ∈ 𝓝 y, ∃ V₂ ∈ 𝓝 y,
      IsClosed V₁ ∧ IsClosed V₂ ∧ IsOpen U₁ ∧ IsOpen U₂ ∧ V₁ ⊆ U₁ ∧ V₂ ⊆ U₂ ∧ Disjoint U₁ U₂

{X : Type u_1}
[TopologicalSpace X]
[T3Space X]
{x y : X}
(h : x ≠ y)


@[simp]
theorem iUnion_Iic : ⋃ a : α, Iic a = univ


private theorem cl_cl {X : Compactum} (A : Set X) : cl (cl A) ⊆ cl A

Compactum.cl (Compactum.cl A) ⊆ Compactum.cl A


@[simps (config := .lemmasOnly)]
instance instMonoidalCategoryStruct : MonoidalCategoryStruct (ModuleCat.{u} R)

{R : Type u}
[CommRing R]
(M N K : ModuleCat R)

CategoryTheory.MonoidalCategory.associator M N K = ModuleCat.MonoidalCategory.associator M N K


@[simp]
theorem mul_invOf_self_assoc' [Monoid α] (a b : α) {_ : Invertible a} : a * (⅟ a * b) = b


theorem nth_mem_of_infinite (hf : (setOf p).Infinite) (n : ℕ) : p (nth p n)

{p : ℕ → Prop}
(hf : (setOf p).Infinite)
(n : ℕ)


@[simp]
theorem desc_self {t : Cocone F} (h : IsColimit t) : h.desc t = 𝟙 t.pt

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


@[to_additive]
lemma IsCentralScalar.unop_smul_eq_smul {M α : Type*} [SMul M α] [SMul Mᵐᵒᵖ α]
    [IsCentralScalar M α] (m : Mᵐᵒᵖ) (a : α) : MulOpposite.unop m • a = m • a

{M : Type u_11}
{α : Type u_12}
[SMul M α]
[SMul Mᵐᵒᵖ α]
[IsCentralScalar M α]
(m : Mᵐᵒᵖ)
(a : α)


/-- The limit cone obtained from a right adjoint of the constant functor. -/
@[simps]
noncomputable def coneOfAdj (F : J ⥤ C) : Cone F

(adj : CategoryTheory.Functor.const J ⊣ L)

(CategoryTheory.Limits.coneOfAdj adj F).pt = L.obj F


/-- A partial order is a reflexive, transitive, antisymmetric relation `≤`. -/
class PartialOrder (α : Type u) extends Preorder α where
  le_antisymm : ∀ a b : α, a ≤ b → b ≤ a → a = b

{α : Type u}
[self : PartialOrder α]
(a b : α)


theorem tendsto_congr {f₁ f₂ : α → β} {l₁ : Filter α} {l₂ : Filter β} (h : ∀ x, f₁ x = f₂ x) :
    Tendsto f₁ l₁ l₂ ↔ Tendsto f₂ l₁ l₂

{α : Type u}
{β : Type v}
{f₁ f₂ : α → β}
{l₁ : Filter α}
{l₂ : Filter β}
(h : ∀ (x : α), f₁ x = f₂ x)

Filter.Tendsto f₁ l₁ l₂ ↔ Filter.Tendsto f₂ l₁ l₂


@[simp, mfld_simps]
theorem transPartialEquiv_trans (e : α ≃ β) (f' : PartialEquiv β γ) (f'' : PartialEquiv γ δ) :
    (e.transPartialEquiv f').trans f'' = e.transPartialEquiv (f'.trans f'')

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


theorem adjoin_gen_eq_top (B : PowerBasis R S) : adjoin R ({B.gen} : Set S) = ⊤

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


@[to_additive]
theorem map_strictMono_of_injective : StrictMono (map f)

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
{f : M →ₙ* N}
(hf : Function.Injective ⇑f)


theorem conj_eq_iff_re {z : ℂ} : conj z = z ↔ (z.re : ℂ) = z


theorem Integrable.mono_measure {f : α → β} (h : Integrable f ν) (hμ : μ ≤ ν) : Integrable f μ

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


theorem isComplete_iff_clusterPt {s : Set α} :
    IsComplete s ↔ ∀ l, Cauchy l → l ≤ 𝓟 s → ∃ x ∈ s, ClusterPt x l

{α : Type u}
[uniformSpace : UniformSpace α]
{s : Set α}

IsComplete s ↔ ∀ (l : Filter α), Cauchy l → l ≤ 𝓟 s → ∃ x ∈ s, ClusterPt x l


@[fun_prop, aesop safe 100 apply (rule_sets := [Measurable])]
theorem measurable_pi_lambda (f : α → ∀ a, π a) (hf : ∀ a, Measurable fun c => f c a) :
    Measurable f

(hf : ∀ (a : δ), Measurable fun c => f c a)


/-- If a sequence of peak functions `φᵢ` converges uniformly to zero away from a point `x₀` and its
integral on some finite-measure neighborhood of `x₀` converges to `1`, and `g` is integrable and
has a limit `a` at `x₀`, then `∫ φᵢ • g` converges to `a`. Version localized to a subset. -/
theorem tendsto_setIntegral_peak_smul_of_integrableOn_of_tendsto
    (hs : MeasurableSet s) {t : Set α} (ht : MeasurableSet t) (hts : t ⊆ s) (h'ts : t ∈ 𝓝[s] x₀)
    (h't : μ t ≠ ∞) (hnφ : ∀ᶠ i in l, ∀ x ∈ s, 0 ≤ φ i x)
    (hlφ : ∀ u : Set α, IsOpen u → x₀ ∈ u → TendstoUniformlyOn φ 0 l (s \ u))
    (hiφ : Tendsto (fun i ↦ ∫ x in t, φ i x ∂μ) l (𝓝 1))
    (h'iφ : ∀ᶠ i in l, AEStronglyMeasurable (φ i) (μ.restrict s))
    (hmg : IntegrableOn g s μ) (hcg : Tendsto g (𝓝[s] x₀) (𝓝 a)) :
    Tendsto (fun i : ι ↦ ∫ x in s, φ i x • g x ∂μ) l (𝓝 a)

{φ : ι → α → ℝ}

(hnφ : ∀ᶠ (i : ι) in l, ∀ x ∈ s, 0 ≤ φ i x)

(hlφ : ∀ (u : Set α), IsOpen u → x₀ ∈ u → TendstoUniformlyOn φ 0 l (s \ u))

(hiφ : Filter.Tendsto (fun i => ∫ (x : α) in t, φ i x ∂μ) l (𝓝 1))

(h'iφ : ∀ᶠ (i : ι) in l, MeasureTheory.AEStronglyMeasurable (φ i) (μ.restrict s))

(hmg : MeasureTheory.IntegrableOn g s μ)

(hcg : Filter.Tendsto g (𝓝[s] x₀) (𝓝 a))

Filter.Tendsto (fun i => ∫ (x : α) in s, φ i x • g x ∂μ) l (𝓝 a)


@[simp]
theorem ite_empty_left (t s : Set α) : t.ite ∅ s = s \ t


@[simp]
theorem nndist_center_homothety (p₁ p₂ : P) (c : 𝕜) :
    nndist p₁ (homothety p₁ c p₂) = ‖c‖₊ * nndist p₁ p₂

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
{𝕜 : Type u_6}
[NormedField 𝕜]
[NormedSpace 𝕜 V]
(p₁ p₂ : P)
(c : 𝕜)

nndist p₁ ((AffineMap.homothety p₁ c) p₂) = ‖c‖₊ * nndist p₁ p₂


theorem size_pow {n : ℕ} : size (2 ^ n) = n + 1


@[to_additive (attr := measurability)]
theorem _root_.Multiset.stronglyMeasurable_prod' (l : Multiset (α → M))
    (hl : ∀ f ∈ l, StronglyMeasurable f) : StronglyMeasurable l.prod

(hl : ∀ f ∈ l, MeasureTheory.StronglyMeasurable f)


theorem coeSubmodule_span_singleton (x : R) :
    coeSubmodule S (Ideal.span {x}) = Submodule.span R {(algebraMap R S) x}

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

IsLocalization.coeSubmodule S (Ideal.span {x}) = Submodule.span R {(algebraMap R S) x}


/-- If `F` is cofinal,
the category of cocones on `F ⋙ G` is equivalent to the category of cocones on `G`,
for any `G : D ⥤ E`.
-/
@[simps]
def coconesEquiv : Cocone (F ⋙ G) ≌ Cocone G

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

(CategoryTheory.Functor.Final.coconesEquiv F G).unitIso =
  CategoryTheory.NatIso.ofComponents
    (fun c =>
      CategoryTheory.Limits.Cocones.ext
        (CategoryTheory.Iso.refl ((CategoryTheory.Functor.id (CategoryTheory.Limits.Cocone (F.comp G))).obj c).pt) ⋯)
    ⋯


theorem Disjoint.isConj_mul [Finite α] {σ τ π ρ : Perm α} (hc1 : IsConj σ π)
    (hc2 : IsConj τ ρ) (hd1 : Disjoint σ τ) (hd2 : Disjoint π ρ) : IsConj (σ * τ) (π * ρ)

{α : Type u}
[Finite α]
{σ τ π ρ : Equiv.Perm α}
(hc1 : IsConj σ π)
(hc2 : IsConj τ ρ)
(hd1 : σ.Disjoint τ)
(hd2 : π.Disjoint ρ)


/-- `MeasureTheory.SignedMeasure.toJordanDecomposition` and
`MeasureTheory.JordanDecomposition.toSignedMeasure` form an `Equiv`. -/
@[simps apply symm_apply]
def toJordanDecompositionEquiv (α : Type*) [MeasurableSpace α] :
    SignedMeasure α ≃ JordanDecomposition α

(j : MeasureTheory.JordanDecomposition α)

(MeasureTheory.SignedMeasure.toJordanDecompositionEquiv α).symm j = j.toSignedMeasure


@[simp]
theorem nat_add_continuum (n : ℕ) : ↑n + 𝔠 = 𝔠

↑n + Cardinal.continuum = Cardinal.continuum


theorem tendstoUniformly_iff_tendstoUniformlyOnFilter :
    TendstoUniformly F f p ↔ TendstoUniformlyOnFilter F f p ⊤

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{f : α → β}
{p : Filter ι}


theorem IndepSets.bInter {s : ι → Set (Set Ω)} {s' : Set (Set Ω)} {_mΩ : MeasurableSpace Ω}
    {κ : Kernel α Ω} {μ : Measure α} {u : Set ι} (h : ∃ n ∈ u, IndepSets (s n) s' κ μ) :
    IndepSets (⋂ n ∈ u, s n) s' κ μ

(h : ∃ n ∈ u, ProbabilityTheory.Kernel.IndepSets (s n) s' κ μ)

ProbabilityTheory.Kernel.IndepSets (⋂ n ∈ u, s n) s' κ μ


@[simp]
theorem memℒp_zero_iff_aestronglyMeasurable {f : α → E} :
    Memℒp f 0 μ ↔ AEStronglyMeasurable f μ

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{f : α → E}

MeasureTheory.Memℒp f 0 μ ↔ MeasureTheory.AEStronglyMeasurable f μ


theorem preimage_def (s : Set β) : preimage r s = { x | ∃ y ∈ s, r x y }

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


theorem arctan_eq_of_tan_eq {x y : ℝ} (h : tan x = y) (hx : x ∈ Ioo (-(π / 2)) (π / 2)) :
    arctan y = x

(hx : x ∈ Set.Ioo (-(Real.pi / 2)) (Real.pi / 2))


theorem ne_bot_of_prod_finsetApprox_mem (J : Ideal S)
    (h : algebraMap _ _ (∏ m ∈ finsetApprox bS adm, m) ∈ J) : J ≠ ⊥

(h : (algebraMap R S) (∏ m ∈ ClassGroup.finsetApprox bS adm, m) ∈ J)


@[to_additive]
theorem rightInverse_inv : RightInverse (fun a : G ↦ a⁻¹) fun a ↦ a⁻¹

Function.RightInverse (fun a => -a) fun a => -a


@[simp]
theorem swap_prod_mk {a : α} {b : β} : swap (a, b) = (b, a)

{α : Type u_1}
{β : Type u_2}
{a : α}
{b : β}


theorem principal_add_of_principal_mul_opow {o b : Ordinal} (hb : 1 < b)
    (ho : Principal (· * ·) (b^o)) : Principal (· + ·) o

(ho : Ordinal.Principal (fun x x_1 => x * x_1) (b ^ o))

Ordinal.Principal (fun x x_1 => x + x_1) o


theorem Sorted.orderedInsert (a : α) : ∀ l, Sorted r l → Sorted r (orderedInsert r a l)

{α : Type u}
{r : α → α → Prop}
[DecidableRel r]
[IsTotal α r]
[IsTrans α r]
(a : α)
(l : List α)

List.Sorted r l → List.Sorted r (List.orderedInsert r a l)


theorem IsBlock.smul_eq_or_disjoint {B : Set X} (hB : IsBlock G B) (g : G) :
    g • B = B ∨ Disjoint (g • B) B

{G : Type u_1}
[Group G]
{X : Type u_2}
[MulAction G X]
{B : Set X}
(hB : MulAction.IsBlock G B)
(g : G)


@[trans]
theorem gt_of_ge_of_gt {a b c : α} (h₁ : a ≥ b) (h₂ : b > c) : a > c

{α : Type u}
[Preorder α]
{a b c : α}
(h₁ : a ≥ b)
(h₂ : b > c)


/-- **Fermat's theorem on the sum of two squares**. Every prime not congruent to 3 mod 4 is the sum
of two squares. Also known as **Fermat's Christmas theorem**. -/
theorem Nat.Prime.sq_add_sq {p : ℕ} [Fact p.Prime] (hp : p % 4 ≠ 3) :
    ∃ a b : ℕ, a ^ 2 + b ^ 2 = p

{p : ℕ}
[Fact (Nat.Prime p)]
(hp : p % 4 ≠ 3)


@[to_additive]
theorem quot_mk_assoc_left (x y z w : α) :
    Quot.mk (AssocRel α) (x * (y * z * w)) = Quot.mk _ (x * (y * (z * w)))

Quot.mk (Magma.AssocRel α) (x * (y * z * w)) = Quot.mk (Magma.AssocRel α) (x * (y * (z * w)))


@[simp]
theorem dropFun_RelLast' {α : TypeVec n} {β} (R : β → β → Prop) :
    dropFun (RelLast' α R) = repeatEq α

{n : ℕ}
{α : TypeVec.{u_1} n}
{β : Type u_1}
(R : β → β → Prop)

TypeVec.dropFun (α.RelLast' R) = α.repeatEq


theorem tendsto_filterAt_iff {ι : Type*} {l : Filter ι} {f : ι → Set α} {x : α} :
    Tendsto f l (v.filterAt x) ↔
      (∀ᶠ i in l, f i ∈ v.setsAt x) ∧ ∀ ε > (0 : ℝ), ∀ᶠ i in l, f i ⊆ closedBall x ε

{α : Type u_1}
[MetricSpace α]
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(v : VitaliFamily μ)
{ι : Type u_2}
{l : Filter ι}
{f : ι → Set α}
{x : α}

Filter.Tendsto f l (v.filterAt x) ↔
  (∀ᶠ (i : ι) in l, f i ∈ v.setsAt x) ∧ ∀ ε > 0, ∀ᶠ (i : ι) in l, f i ⊆ Metric.closedBall x ε


/-- Given a measurable set `s`, then `μ (s ∩ closedBall x r) / μ (closedBall x r)` converges when
`r` tends to `0`, for almost every `x`. The limit is `1` for `x ∈ s` and `0` for `x ∉ s`.
This shows that almost every point of `s` is a Lebesgue density point for `s`.
A version for non-measurable sets holds, but it only gives the first conclusion,
see `ae_tendsto_measure_inter_div`. -/
theorem ae_tendsto_measure_inter_div_of_measurableSet (μ : Measure β) [IsLocallyFiniteMeasure μ]
    {s : Set β} (hs : MeasurableSet s) :
    ∀ᵐ x ∂μ,
      Tendsto (fun r => μ (s ∩ closedBall x r) / μ (closedBall x r)) (𝓝[>] 0)
        (𝓝 (s.indicator 1 x))

∀ᵐ (x : β) ∂μ,
  Filter.Tendsto (fun r => μ (s ∩ Metric.closedBall x r) / μ (Metric.closedBall x r)) (𝓝[>] 0) (𝓝 (s.indicator 1 x))


theorem anyM_stop_le_start [Monad m] (p : α → m Bool) (as : Array α) (start stop)
    (h : min stop as.size ≤ start) : anyM p as start stop = pure false

{m : Type → Type u_1}
{α : Type u_2}
[Monad m]
(p : α → m Bool)
(as : Array α)
(start stop : Nat)
(h : min stop as.size ≤ start)


theorem circulant_injective [AddGroup n] : Injective (circulant : (n → α) → Matrix n n α)

{α : Type u_1}
{n : Type u_4}
[AddGroup n]


@[to_additive]
lemma orderOf_generator_eq_natCard (h : ∀ x, x ∈ Subgroup.zpowers a) : orderOf a = Nat.card α

(h : ∀ (x : α), x ∈ AddSubgroup.zmultiples a)


@[to_additive]
theorem ContMDiff.prod (h : ∀ i ∈ t, ContMDiff I' I n (f i)) :
    ContMDiff I' I n fun x ↦ ∏ i ∈ t, f i x

{ι : Type u_1}
{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{H : Type u_3}
[TopologicalSpace H]
{E : Type u_4}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_5}
[CommMonoid G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothMul I G]
{E' : Type u_6}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_7}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_8}
[TopologicalSpace M]
[ChartedSpace H' M]
{t : Finset ι}
{f : ι → M → G}
{n : ℕ∞}
(h : ∀ i ∈ t, ContMDiff I' I n (f i))

ContMDiff I' I n fun x => ∏ i ∈ t, f i x


theorem sum_rpow_le_of_tendsto (hp : p ≠ ∞) {C : ℝ} {F : ι → lp E p} (hCF : ∀ᶠ k in l, ‖F k‖ ≤ C)
    {f : ∀ a, E a} (hf : Tendsto (id fun i => F i : ι → ∀ a, E a) l (𝓝 f)) (s : Finset α) :
    ∑ i ∈ s, ‖f i‖ ^ p.toReal ≤ C ^ p.toReal

(hf : Filter.Tendsto (id fun i => ↑(F i)) l (nhds f))


/-- The canonical `R`-linear projection `TrivSqZeroExt R M → M`. -/
@[simps apply]
def sndHom [Semiring R] [AddCommMonoid M] [Module R M] : tsze R M →ₗ[R] M

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


lemma ofUpperSet_inj {a b : WithUpperSet α} : ofUpperSet a = ofUpperSet b ↔ a = b

{α : Type u_1}
{a b : Topology.WithUpperSet α}

Topology.WithUpperSet.ofUpperSet a = Topology.WithUpperSet.ofUpperSet b ↔ a = b


theorem IsLocalization.Away.finitePresentation (r : R) {S} [CommRing S] [Algebra R S]
    [IsLocalization.Away r S] : Algebra.FinitePresentation R S

{R : Type u_1}
[CommRing R]
(r : R)
{S : Type u_2}
[CommRing S]
[Algebra R S]
[IsLocalization.Away r S]


@[simp]
theorem ofNat'_one : Num.ofNat' 1 = 1


theorem congr_obj {F G : C ⥤ D} (h : F = G) (X) : F.obj X = G.obj X

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F G : CategoryTheory.Functor C D}
(h : F = G)
(X : C)


@[to_additive]
protected
theorem MulEquiv.map_isUnit_iff {M N} [Monoid M] [Monoid N] [EquivLike F M N] [MonoidHomClass F M N]
    (f : F) {m : M} : IsUnit (f m) ↔ IsUnit m

{F : Type u_1}
{M : Type u_12}
{N : Type u_13}
[AddMonoid M]
[AddMonoid N]
[EquivLike F M N]
[AddMonoidHomClass F M N]
(f : F)
{m : M}


theorem hasFDerivAt_pi :
    HasFDerivAt (fun x i => φ i x) (ContinuousLinearMap.pi φ') x ↔
      ∀ i, HasFDerivAt (φ i) (φ' i) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{ι : Type u_6}
[Fintype ι]
{F' : ι → Type u_7}
[(i : ι) → NormedAddCommGroup (F' i)]
[(i : ι) → NormedSpace 𝕜 (F' i)]
{φ : (i : ι) → E → F' i}
{φ' : (i : ι) → E →L[𝕜] F' i}

HasFDerivAt (fun x i => φ i x) (ContinuousLinearMap.pi φ') x ↔ ∀ (i : ι), HasFDerivAt (φ i) (φ' i) x


/-- If `F : J ⥤ C` then `F.cocones` is the functor assigning to an object `(X : C)`
the type of natural transformations from `F` to the constant functor with value `X`.
An object corepresenting this functor is a colimit of `F`.
-/
@[simps!]
def cocones : C ⥤ Type max u₁ v₃

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

F.cocones.obj X = (F ⟶ (CategoryTheory.Functor.const J).obj X)


@[simp, norm_cast]
theorem star_coe : star (x : ℍ[R,c₁,c₂]) = x

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


@[to_additive (attr := simp)]
theorem card_eq_iff_eq_top [Finite H] : Nat.card H = Nat.card G ↔ H = ⊤

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


lemma toColex_lt_toColex :
    toColex s < toColex t ↔ s ≠ t ∧ ∀ ⦃a⦄, a ∈ s → a ∉ t → ∃ b, b ∈ t ∧ b ∉ s ∧ a ≤ b

{α : Type u_1}
[PartialOrder α]
{s t : Finset α}

{ ofColex := s } < { ofColex := t } ↔ s ≠ t ∧ ∀ ⦃a : α⦄, a ∈ s → a ∉ t → ∃ b ∈ t, b ∉ s ∧ a ≤ b


lemma IsLittleO.add_isTheta {f₁ f₂ : α → E'} {g : α → F}
    (ho : f₁ =o[l] g) (hΘ : f₂ =Θ[l] g) : (f₁ + f₂) =Θ[l] g

{α : Type u_1}
{F : Type u_4}
{E' : Type u_6}
[Norm F]
[SeminormedAddCommGroup E']
{l : Filter α}
{f₁ f₂ : α → E'}
{g : α → F}
(ho : f₁ =o[l] g)
(hΘ : f₂ =Θ[l] g)


lemma iso_map_bijective : Function.Bijective (iso_map C J)

{I : Type u}
(C : Set (I → Bool))
(J : I → Prop)
[(i : I) → Decidable (J i)]

Function.Bijective ⇑(Profinite.NobelingProof.iso_map C J)


theorem sub_floor_div_mul_lt (a : k) (hb : 0 < b) : a - ⌊a / b⌋ * b < b

{k : Type u_4}
[LinearOrderedField k]
[FloorRing k]
{b : k}
(a : k)
(hb : 0 < b)


@[to_additive]
theorem mulEquivOfQuotient_symm_mk (x y) : (mulEquivOfQuotient f).symm (f.mk' x y) = mk x y

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
{f : S.LocalizationMap N}
(x : M)
(y : ↥S)

(Localization.mulEquivOfQuotient f).symm (f.mk' x y) = Localization.mk x y


@[simp, norm_cast] lemma ofRat_ratCast (q : ℚ) : ofRat (q : β) = (q : Cauchy abv)

{α : Type u_1}
[LinearOrderedField α]
{β : Type u_2}
[DivisionRing β]
{abv : β → α}
[IsAbsoluteValue abv]
(q : ℚ)


@[simp]
theorem isColimitCoforkOfCokernelCofork_desc {c : CokernelCofork (f - g)} (i : IsColimit c)
    (s : Cofork f g) :
    (isColimitCoforkOfCokernelCofork i).desc s = i.desc (cokernelCoforkOfCofork s)

{c : CategoryTheory.Limits.CokernelCofork (f - g)}

(CategoryTheory.Preadditive.isColimitCoforkOfCokernelCofork i).desc s =
  i.desc (CategoryTheory.Preadditive.cokernelCoforkOfCofork s)


lemma comparison_full [R.Full] {L : C ⥤ D} (adj : L ⊣ R) :
    (Monad.comparison adj).Full

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{R : CategoryTheory.Functor D C}
[R.Full]
{L : CategoryTheory.Functor C D}
(adj : L ⊣ R)


@[simp, norm_cast] lemma coe_eq_top [Top α] {a : α} : (a : WithBot α) = ⊤ ↔ a = ⊤

↑a = ⊤ ↔ a = ⊤


@[simp]
theorem fst_inl [Zero M] (r : R) : (inl r : tsze R M).fst = r

{R : Type u}
(M : Type v)
[Zero M]
(r : R)


@[simp]
theorem IsDedekindDomain.quotientEquivPiFactors_mk {I : Ideal R} (hI : I ≠ ⊥) (x : R) :
    IsDedekindDomain.quotientEquivPiFactors hI (Ideal.Quotient.mk I x) = fun _P =>
      Ideal.Quotient.mk _ x

{R : Type u_1}
[CommRing R]
[IsDedekindDomain R]
{I : Ideal R}
(hI : I ≠ ⊥)
(x : R)

(IsDedekindDomain.quotientEquivPiFactors hI) ((Ideal.Quotient.mk I) x) = fun _P =>
  (Ideal.Quotient.mk (↑_P ^ Multiset.count (↑_P) (UniqueFactorizationMonoid.factors I))) x


/-- Given a right homology map data `ψ : RightHomologyMapData φ h₁ h₂` such that
both right homology data `h₁` and `h₂` are preserved by a functor `F`, this is
the induced right homology map data for the morphism `F.mapShortComplex.map φ`. -/
@[simps]
def RightHomologyMapData.map {φ : S₁ ⟶ S₂} {h₁ : S₁.RightHomologyData}
    {h₂ : S₂.RightHomologyData} (ψ : RightHomologyMapData φ h₁ h₂) (F : C ⥤ D)
    [F.PreservesZeroMorphisms] [h₁.IsPreservedBy F] [h₂.IsPreservedBy F] :
    RightHomologyMapData (F.mapShortComplex.map φ) (h₁.map F) (h₂.map F)

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


@[simp]
theorem mkMetric_toOuterMeasure (m : ℝ≥0∞ → ℝ≥0∞) :
    (mkMetric m : Measure X).toOuterMeasure = OuterMeasure.mkMetric m

{X : Type u_2}
[EMetricSpace X]
[MeasurableSpace X]
[BorelSpace X]
(m : ℝ≥0∞ → ℝ≥0∞)

(MeasureTheory.Measure.mkMetric m).toOuterMeasure = MeasureTheory.OuterMeasure.mkMetric m


/-- The free R-module functor is lax monoidal. -/
@[simps]
instance : LaxMonoidal.{u} (free R).obj

CategoryTheory.LaxMonoidal.ε = ModuleCat.Free.ε R


theorem naturality (f : X ⟶ Y) (x : F.obj X) : σ.app Y ((F.map f) x) = (G.map f) (σ.app X x)

(F G : CategoryTheory.Functor C (Type w))

σ.app Y (F.map f x) = G.map f (σ.app X x)


theorem forall_mem_union : (∀ x ∈ l₁ ∪ l₂, p x) ↔ (∀ x ∈ l₁, p x) ∧ ∀ x ∈ l₂, p x

{α : Type u_1}
{l₁ l₂ : List α}
{p : α → Prop}
[DecidableEq α]

(∀ (x : α), x ∈ l₁ ∪ l₂ → p x) ↔ (∀ (x : α), x ∈ l₁ → p x) ∧ ∀ (x : α), x ∈ l₂ → p x


private theorem abs_density_star_sub_density_le_eps (hPε : ↑100 ≤ ↑4 ^ P.parts.card * ε ^ 5)
    (hε₁ : ε ≤ 1) {hU : U ∈ P.parts} {hV : V ∈ P.parts} (hUV' : U ≠ V) (hUV : ¬G.IsUniform ε U V) :
    |(G.edgeDensity ((star hP G ε hU V).biUnion id) ((star hP G ε hV U).biUnion id) : ℝ) -
      G.edgeDensity (G.nonuniformWitness ε U V) (G.nonuniformWitness ε V U)| ≤ ε / 5

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{P : Finpartition Finset.univ}
{hP : P.IsEquipartition}
{G : SimpleGraph α}
[DecidableRel G.Adj]
{ε : ℝ}
{U V : Finset α}
(hPε : 100 ≤ 4 ^ P.parts.card * ε ^ 5)
(hε₁ : ε ≤ 1)
{hU : U ∈ P.parts}
{hV : V ∈ P.parts}
(hUV' : U ≠ V)
(hUV : ¬G.IsUniform ε U V)

|↑(G.edgeDensity ((SzemerediRegularity.star hP G ε hU V).biUnion id)
          ((SzemerediRegularity.star hP G ε hV U).biUnion id)) -
      ↑(G.edgeDensity (G.nonuniformWitness ε U V) (G.nonuniformWitness ε V U))| ≤
  ε / 5


lemma max_mul_mul_le_max_mul_max [PosMulMono α] [MulPosMono α] (b c : α) (ha : 0 ≤ a) (hd : 0 ≤ d) :
    max (a * b) (d * c) ≤ max a c * max d b

{α : Type u}
[CommSemiring α]
[LinearOrder α]
{a d : α}
[PosMulMono α]
[MulPosMono α]
(b c : α)
(ha : 0 ≤ a)
(hd : 0 ≤ d)


/-- If `s` is a `Finset`, then the measure of its preimage can be found as the sum of measures
of the fibers `f ⁻¹' {y}`. -/
theorem sum_measure_preimage_singleton (s : Finset β) {f : α → β}
    (hf : ∀ y ∈ s, MeasurableSet (f ⁻¹' {y})) : (∑ b ∈ s, μ (f ⁻¹' {b})) = μ (f ⁻¹' ↑s)


/-- A cocone on `F` with cocone point `X` is the same as an element of `lim Hom(F·, X)`. -/
@[simps!]
noncomputable def limitCompYonedaIsoCocone (F : J ⥤ C) (X : C) :
    limit (F.op ⋙ yoneda.obj X) ≅ (F ⟶ (const J).obj X)

{J : Type v}
[CategoryTheory.SmallCategory J]
{C : Type u}
[CategoryTheory.Category.{v, u} C]
(F : J ⥤ C)
(X : C)

∀ (a : CategoryTheory.Limits.limit (F.op ⋙ CategoryTheory.yoneda.obj X)) (j : J),
  ((CategoryTheory.Limits.limitCompYonedaIsoCocone F X).hom a).app j =
    CategoryTheory.Limits.limit.π (F.op ⋙ CategoryTheory.yoneda.obj X) (Opposite.op j) a


theorem re_exp (q : ℍ[ℝ]) : (exp ℝ q).re = exp ℝ q.re * Real.cos ‖q - q.re‖

(NormedSpace.exp ℝ q).re = NormedSpace.exp ℝ q.re * Real.cos ‖q - ↑q.re‖


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

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

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

(h : (List.map f l).prod < (List.map g l).prod)


theorem ncard_eq_three : s.ncard = 3 ↔ ∃ x y z, x ≠ y ∧ x ≠ z ∧ y ≠ z ∧ s = {x, y, z}


@[to_additive addCHaar_sup_eq]
theorem chaar_sup_eq {K₀ : PositiveCompacts G}
    {K₁ K₂ : Compacts G} (h : Disjoint K₁.1 K₂.1) (h₂ : IsClosed K₂.1) :
    chaar K₀ (K₁ ⊔ K₂) = chaar K₀ K₁ + chaar K₀ K₂

{K₀ : TopologicalSpace.PositiveCompacts G}

MeasureTheory.Measure.haar.addCHaar K₀ (K₁ ⊔ K₂) =
  MeasureTheory.Measure.haar.addCHaar K₀ K₁ + MeasureTheory.Measure.haar.addCHaar K₀ K₂


@[to_additive (attr := simp)]
theorem smul_mem_smul_finset_iff (a : α) : a • b ∈ a • s ↔ b ∈ s

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[Group α]
[MulAction α β]
{s : Finset β}
{b : β}
(a : α)


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

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

∑ x ∈ Finset.Ioi a, f x + f a = ∑ x ∈ Finset.Ici a, f x


/-- `F : ComposableArrows C n` is a complex if all compositions of
two consecutive arrows are zero. -/
structure IsComplex : Prop where
  /-- the composition of two consecutive arrows is zero -/
  zero (i : ℕ) (hi : i + 2 ≤ n := by omega) :
    S.map' i (i + 1) ≫ S.map' (i + 1) (i + 2) = 0

{S : CategoryTheory.ComposableArrows C n}

CategoryTheory.CategoryStruct.comp (S.map' i (i + 1) ⋯ ⋯) (S.map' (i + 1) (i + 2) ⋯ hi) = 0


lemma sq_le_sq' (h1 : -b ≤ a) (h2 : a ≤ b) : a ^ 2 ≤ b ^ 2

{α : Type u_1}
[LinearOrderedRing α]
{a b : α}
(h1 : -b ≤ a)
(h2 : a ≤ b)


@[simp]
theorem sdiff_inter_self_left (s t : Finset α) : s \ (s ∩ t) = s \ t

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


@[simp]
theorem Ico_succ_left (a b : α) : Ico (succ a) b = Ioo a b

{α : Type u_1}
[Preorder α]
[SuccOrder α]
[NoMaxOrder α]
(a b : α)


lemma restrictionApp_apply {X Y : Cᵒᵖ} (f : X ⟶ Y) (M : PresheafOfModules R) (x : M.obj X) :
    restrictionApp f M x = M.map f x

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{R : Cᵒᵖ ⥤ RingCat}
{X Y : Cᵒᵖ}
(f : X ⟶ Y)
(M : PresheafOfModules R)
(x : ↑(M.obj X))

(PresheafOfModules.restrictionApp f M) x = (M.map f) x


theorem mem_insert_self (a : α) (s : Finset α) : a ∈ insert a s

{α : Type u_1}
[DecidableEq α]
(a : α)
(s : Finset α)


theorem KaehlerDifferential.span_range_eq_ideal :
    Ideal.span (Set.range fun s : S => (1 : S) ⊗ₜ[R] s - s ⊗ₜ[R] (1 : S)) =
      KaehlerDifferential.ideal R S

(R : Type u)
(S : Type v)
[CommRing R]
[CommRing S]
[Algebra R S]

Ideal.span (Set.range fun s => 1 ⊗ₜ[R] s - s ⊗ₜ[R] 1) = KaehlerDifferential.ideal R S


@[simp]
theorem homEquiv_def (A B C : Rep k G) : (ihom.adjunction A).homEquiv B C = Rep.homEquiv A B C

{k G : Type u}
[CommRing k]
[Group G]
(A B C : Rep k G)

(CategoryTheory.ihom.adjunction A).homEquiv B C = A.homEquiv B C


theorem Eventually.congr {f : Filter α} {p q : α → Prop} (h' : ∀ᶠ x in f, p x)
    (h : ∀ᶠ x in f, p x ↔ q x) : ∀ᶠ x in f, q x

{α : Type u}
{f : Filter α}
{p q : α → Prop}
(h' : ∀ᶠ (x : α) in f, p x)
(h : ∀ᶠ (x : α) in f, p x ↔ q x)


theorem restrict_Ioo_eq_restrict_Icc : μ.restrict (Ioo a b) = μ.restrict (Icc a b)

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasureTheory.NoAtoms μ]
[PartialOrder α]
{a b : α}

μ.restrict (Set.Ioo a b) = μ.restrict (Set.Icc a b)


/-- Expand the square -/
theorem norm_sub_sq (x y : E) : ‖x - y‖ ^ 2 = ‖x‖ ^ 2 - 2 * re ⟪x, y⟫ + ‖y‖ ^ 2

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

‖x - y‖ ^ 2 = ‖x‖ ^ 2 - 2 * RCLike.re ⟪x, y⟫_𝕜 + ‖y‖ ^ 2


@[simp]
theorem neg_toProd (a : 𝓜(𝕜, A)) : (-a).toProd = -a.toProd

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


theorem le_aleph0_iff_set_countable {s : Set α} : #s ≤ ℵ₀ ↔ s.Countable

Cardinal.mk ↑s ≤ Cardinal.aleph0 ↔ s.Countable


theorem image_iff {f : E →ₗ.[R] F} {x : E} {y : F} (hx : x ∈ f.domain) :
    y = f ⟨x, hx⟩ ↔ (x, y) ∈ f.graph

{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 : E →ₗ.[R] F}
{x : E}
{y : F}
(hx : x ∈ f.domain)


/-- Preimages of compact closed sets are compact under a cocompact continuous map. -/
theorem isCompact_preimage_of_isClosed (f : CocompactMap α β)
    ⦃s : Set β⦄ (hs : IsCompact s) (h's : IsClosed s) :
    IsCompact (f ⁻¹' s)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
(f : CocompactMap α β)
⦃s : Set β⦄
(hs : IsCompact s)
(h's : IsClosed s)


lemma mapₐ_injective_of_injective (f : A →ₐ[R] B) (hf : Function.Injective f) :
    Function.Injective (mapₐ M Rₚ Aₚ Bₚ f)

[IsLocalization (Algebra.algebraMapSubmonoid A M) Aₚ]

[IsLocalization (Algebra.algebraMapSubmonoid B M) Bₚ]

Function.Injective ⇑(IsLocalization.mapₐ M Rₚ Aₚ Bₚ f)


theorem commute_invOf {M : Type*} [One M] [Mul M] (m : M) [Invertible m] : Commute m (⅟ m)

{M : Type u_1}
[One M]
[Mul M]
(m : M)
[Invertible m]


/-- If `0 : ℕ` is not in the support of `f : ℕ →₀ ℕ` then `0 < ∏ x ∈ f.support, x ^ (f x)`. -/
theorem prod_pow_pos_of_zero_not_mem_support {f : ℕ →₀ ℕ} (nhf : 0 ∉ f.support) :
    0 < f.prod (· ^ ·)


/-- A homotopy equivalence between topological spaces `X` and `Y` are a pair of functions
`toFun : C(X, Y)` and `invFun : C(Y, X)` such that `toFun.comp invFun` and `invFun.comp toFun`
are both homotopic to corresponding identity maps.
-/
@[ext]
structure HomotopyEquiv (X : Type u) (Y : Type v) [TopologicalSpace X] [TopologicalSpace Y] where
  toFun : C(X, Y)
  invFun : C(Y, X)
  left_inv : (invFun.comp toFun).Homotopic (ContinuousMap.id X)
  right_inv : (toFun.comp invFun).Homotopic (ContinuousMap.id Y)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
(self : X ≃ₕ Y)

(self.toFun.comp self.invFun).Homotopic (ContinuousMap.id Y)


lemma hurwitzZetaEven_neg (a : UnitAddCircle) (s : ℂ) :
    hurwitzZetaEven (-a) s = hurwitzZetaEven a s

HurwitzZeta.hurwitzZetaEven (-a) s = HurwitzZeta.hurwitzZetaEven a s


@[simp]
theorem mem_support_iff : n ∈ p.support ↔ p.coeff n ≠ 0

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


theorem iso_symm {X Y : Submodule R M × Submodule R M} : Iso X Y → Iso Y X

{R : Type u_2}
[Ring R]
{M : Type u_4}
[AddCommGroup M]
[Module R M]
{X Y : Submodule R M × Submodule R M}

JordanHolderModule.Iso X Y → JordanHolderModule.Iso Y X


theorem CokernelCofork.π_eq_zero (s : CokernelCofork f) : s.ι.app zero = 0

(s : CategoryTheory.Limits.CokernelCofork f)

s.ι.app CategoryTheory.Limits.WalkingParallelPair.zero = 0


@[to_additive]
theorem image_mulSingle_Ioc_right (i : ι) (b : α i) :
    Pi.mulSingle i '' Ioc 1 b = Ioc 1 (Pi.mulSingle i b)

{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ι]
[(i : ι) → PartialOrder (α i)]
[(i : ι) → One (α i)]
(i : ι)
(b : α i)

Pi.mulSingle i '' Set.Ioc 1 b = Set.Ioc 1 (Pi.mulSingle i b)


/--
The category of subterminal objects is equivalent to the category of monomorphisms to the terminal
object (which is in turn equivalent to the subobjects of the terminal object).
-/
@[simps]
def subterminalsEquivMonoOverTerminal [HasTerminal C] : Subterminals C ≌ MonoOver (⊤_ C)

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

∀ {X Y : CategoryTheory.MonoOver (⊤_ C)} (f : X ⟶ Y),
  (CategoryTheory.subterminalsEquivMonoOverTerminal C).inverse.map f = f.left


lemma triangleRemovalBound_pos (hε : 0 < ε) (hε₁ : ε ≤ 1) : 0 < triangleRemovalBound ε


lemma congr_apply_of [IsDirected ι (· ≤ ·)]
    (e : (i : ι) → G i ≃ₗ[R] G' i) (he : ∀ i j h, e j ∘ₗ f i j h = f' i j h ∘ₗ e i)
    {i : ι} (g : G i) :
    congr e he (of _ _ G f i g) = of _ _ G' f' i (e i g)

{f' : (i j : ι) → i ≤ j → G' i →ₗ[R] G' j}

(he : ∀ (i j : ι) (h : i ≤ j), ↑(e j) ∘ₗ f i j h = f' i j h ∘ₗ ↑(e i))

(Module.DirectLimit.congr e he) ((Module.DirectLimit.of R ι G f i) g) = (Module.DirectLimit.of R ι G' f' i) ((e i) g)


/-- If a function `f` is continuous on `ℝ`, and `f''` is strictly positive on `ℝ`,
then `f` is strictly convex on `ℝ`.
Note that we don't require twice differentiability explicitly as it is already implied by the second
derivative being strictly positive, except at at most one point. -/
theorem strictConvexOn_univ_of_deriv2_pos {f : ℝ → ℝ} (hf : Continuous f)
    (hf'' : ∀ x, 0 < (deriv^[2] f) x) : StrictConvexOn ℝ univ f

{f : ℝ → ℝ}
(hf : Continuous f)
(hf'' : ∀ (x : ℝ), 0 < deriv^[2] f x)


@[to_additive (attr := simp)]
theorem const_one [One β] : const α (1 : β) = 1

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[Zero β]


theorem kernel_sum_seq (κ : Kernel α β) [h : IsSFiniteKernel κ] : Kernel.sum (seq κ) = κ

[h : ProbabilityTheory.IsSFiniteKernel κ]


/-- Product of two infinites sums indexed by arbitrary types.
    See also `tsum_mul_tsum_of_summable_norm` if `f` and `g` are absolutely summable. -/
theorem tsum_mul_tsum (hf : Summable f) (hg : Summable g)
    (hfg : Summable fun x : ι × κ ↦ f x.1 * g x.2) :
    ((∑' x, f x) * ∑' y, g y) = ∑' z : ι × κ, f z.1 * g z.2

{ι : Type u_1}
{κ : Type u_2}
{α : Type u_4}
[TopologicalSpace α]
[T3Space α]
[NonUnitalNonAssocSemiring α]
[TopologicalSemiring α]
{f : ι → α}
{g : κ → α}
(hf : Summable f)
(hg : Summable g)
(hfg : Summable fun x => f x.1 * g x.2)


theorem gcd_def (x y : ℕ) : gcd x y = if x = 0 then y else gcd (y % x) x

x.gcd y = if x = 0 then y else (y % x).gcd x


@[to_additive (attr := simp) posPart_pos_iff] lemma one_lt_oneLePart_iff : 1 < a⁺ᵐ ↔ 1 < a

{α : Type u_1}
[LinearOrder α]
[Group α]
{a : α}


@[norm_cast, simp 1001]
-- Porting note: increase priority to prevent the left-hand side from simplifying
theorem norm_cast_real (r : ℚ) : ‖(r : ℝ)‖ = ‖r‖


@[to_additive]
theorem sInf_mul : sInf (s * t) = sInf s * sInf 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]


@[simp]
theorem int_add_iff : LiouvilleWith p (m + x) ↔ LiouvilleWith p x

LiouvilleWith p (↑m + x) ↔ LiouvilleWith p x


@[reassoc (attr := simp)]
lemma pullback.lift_fst {Z : LightProfinite.{u}} (a : Z ⟶ X) (b : Z ⟶ Y) (w : a ≫ f = b ≫ g) :
    pullback.lift f g a b w ≫ pullback.fst f g = a

(w : CategoryTheory.CategoryStruct.comp a f = CategoryTheory.CategoryStruct.comp b g)

CategoryTheory.CategoryStruct.comp (LightProfinite.pullback.lift f g a b w) (LightProfinite.pullback.fst f g) = a


/-- The morphism between Čech conerves associated to a morphism of arrows. -/
@[simps]
def mapCechConerve {f g : Arrow C}
    [∀ n : ℕ, HasWidePushout f.left (fun _ : Fin (n + 1) => f.right) fun _ => f.hom]
    [∀ n : ℕ, HasWidePushout g.left (fun _ : Fin (n + 1) => g.right) fun _ => g.hom] (F : f ⟶ g) :
    f.cechConerve ⟶ g.cechConerve

[∀ (n : ℕ), CategoryTheory.Limits.HasWidePushout f.left (fun x => f.right) fun x => f.hom]

[∀ (n : ℕ), CategoryTheory.Limits.HasWidePushout g.left (fun x => g.right) fun x => g.hom]

(CategoryTheory.Arrow.mapCechConerve F).app n =
  CategoryTheory.Limits.WidePushout.desc (F.left ≫ CategoryTheory.Limits.WidePushout.head fun x => g.hom)
    (fun i => F.right ≫ CategoryTheory.Limits.WidePushout.ι (fun x => g.hom) i) ⋯


theorem IsBigOWith.prod_left_fst (h : IsBigOWith c l (fun x => (f' x, g' x)) k') :
    IsBigOWith c l f' k'

(h : Asymptotics.IsBigOWith c l (fun x => (f' x, g' x)) k')


theorem eq_top_iff_forall_le (x : PartENat) : x = ⊤ ↔ ∀ n : ℕ, (n : PartENat) ≤ x


@[simp] lemma finsuppAntidiag_zero (s : Finset ι) : finsuppAntidiag s (0 : μ) = {0}

{ι : Type u_1}
{μ : Type u_2}
[DecidableEq ι]
[DecidableEq μ]
[CanonicallyOrderedAddCommMonoid μ]
[Finset.HasAntidiagonal μ]
(s : Finset ι)


/-- `p` does not hold for elements with indices less than `xs.findIdx p`. -/
theorem not_of_lt_findIdx {p : α → Bool} {xs : List α} {i : ℕ} (h : i < xs.findIdx p) :
    ¬p (xs.get ⟨i, h.trans_le (findIdx_le_length p)⟩)

{α : Type u}
{p : α → Bool}
{xs : List α}
{i : ℕ}
(h : i < List.findIdx p xs)