/-- If a function is integrable on a set `s` and vanishes almost everywhere on its complement,
then it is integrable. -/
theorem IntegrableOn.integrable_of_ae_not_mem_eq_zero (hf : IntegrableOn f s μ)
    (h't : ∀ᵐ x ∂μ, x ∉ s → f x = 0) : Integrable f μ

{α : Type u_1}
{E : Type u_3}
[MeasurableSpace α]
[NormedAddCommGroup E]
{f : α → E}
{s : Set α}
{μ : MeasureTheory.Measure α}
(hf : MeasureTheory.IntegrableOn f s μ)
(h't : ∀ᵐ (x : α) ∂μ, x ∉ s → f x = 0)


theorem UInt32.le_antisymm {x y : UInt32} (h1 : x ≤ y) (h2 : y ≤ x) : x = y


theorem mk_eq_zero {m : M} : mk' N m = 0 ↔ m ∈ N

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

(LieSubmodule.Quotient.mk' N) m = 0 ↔ m ∈ N


theorem eq_iff_fst_eq_snd_eq : ∀ {p q : α × β}, p = q ↔ p.1 = q.1 ∧ p.2 = q.2

{α : Type u_1}
{β : Type u_2}
{p q : α × β}


@[to_additive]
lemma orderOf_eq_two_iff (hG : Monoid.exponent G = 2) {x : G} :
    orderOf x = 2 ↔ x ≠ 1

{G : Type u}
[Monoid G]
(hG : Monoid.exponent G = 2)
{x : G}


@[simp]
lemma bitwise_zero_right (n : Nat) : bitwise f n 0 = if f true false then n else 0

Nat.bitwise f n 0 = if f true false = true then n else 0


@[simp] theorem arrowCongr_refl {α β : Sort*} :
    arrowCongr (Equiv.refl α) (Equiv.refl β) = Equiv.refl (α → β)

(Equiv.refl α).arrowCongr (Equiv.refl β) = Equiv.refl (α → β)


@[simp]
theorem map_id : s.map (NonUnitalRingHom.id R) = s

{R : Type u}
[NonUnitalNonAssocRing R]
(s : NonUnitalSubring R)

NonUnitalSubring.map (NonUnitalRingHom.id R) s = s


theorem leadingCoeff_C_mul_X (a : R) : leadingCoeff (C a * X) = a

(Polynomial.C a * Polynomial.X).leadingCoeff = a


@[to_additive]
theorem index_ker (f : G →* G') : f.ker.index = Nat.card (Set.range f)

{G : Type u_1}
{G' : Type u_2}
[Group G]
[Group G']
(f : G →* G')


private theorem abs_add (z w : ℂ) : (abs z + w) ≤ (abs z) + abs w

√(Complex.normSq (z + w)) ≤ √(Complex.normSq z) + √(Complex.normSq w)


theorem symm_image_target_inter_eq' (s : Set β) : e.symm '' (e.target ∩ s) = e.source ∩ e ⁻¹' s

{α : Type u_1}
{β : Type u_2}
(e : PartialEquiv α β)
(s : Set β)

↑e.symm '' (e.target ∩ s) = e.source ∩ ↑e ⁻¹' s


/-- The initial object in `Factorisation f`, with the domain of `f` as its midpoint. -/
@[simps]
protected def initial : Factorisation f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
{f : X ⟶ Y}


@[to_additive]
theorem coe_iSup_of_directed {ι} [Nonempty ι] {S : ι → Subgroup G} (hS : Directed (· ≤ ·) S) :
    ((⨆ i, S i : Subgroup G) : Set G) = ⋃ i, S i

(hS : Directed (fun x x_1 => x ≤ x_1) S)


theorem convexJoin_right_comm (s t u : Set E) :
    convexJoin 𝕜 (convexJoin 𝕜 s t) u = convexJoin 𝕜 (convexJoin 𝕜 s u) t

{𝕜 : Type u_2}
{E : Type u_3}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(s t u : Set E)


@[to_additive]
theorem map_mul_right_nhds_one (x : G) : map (· * x) (𝓝 1) = 𝓝 x

{G : Type w}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
(x : G)

Filter.map (fun x_1 => x_1 + x) (𝓝 0) = 𝓝 x


/-- `s` is an additive submonoid: a set containing 0 and closed under addition.
Note that this structure is deprecated, and the bundled variant `AddSubmonoid A` should be
preferred. -/
structure IsAddSubmonoid (s : Set A) : Prop where
  /-- The proposition that s contains 0. -/
  zero_mem : (0 : A) ∈ s
  /-- The proposition that s is closed under addition. -/
  add_mem {a b} : a ∈ s → b ∈ s → a + b ∈ s

{A : Type u_2}
[AddMonoid A]
{s : Set A}
(self : IsAddSubmonoid s)
{a b : A}


@[fun_prop]
theorem differentiableWithinAt_id : DifferentiableWithinAt 𝕜 id s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{s : Set E}


theorem support_onFinset [DecidableEq M] {s : Finset α} {f : α → M}
    (hf : ∀ a : α, f a ≠ 0 → a ∈ s) :
    (Finsupp.onFinset s f hf).support = s.filter fun a => f a ≠ 0

{α : Type u_1}
{M : Type u_5}
[Zero M]
[DecidableEq M]
{s : Finset α}
{f : α → M}
(hf : ∀ (a : α), f a ≠ 0 → a ∈ s)

(Finsupp.onFinset s f hf).support = Finset.filter (fun a => f a ≠ 0) s


nonrec lemma is3Clique_iff [NoAccidental t] {s : Finset (α ⊕ β ⊕ γ)} :
    (graph t).IsNClique 3 s ↔ ∃ x, x ∈ t ∧ toTriangle x = s

(SimpleGraph.TripartiteFromTriangles.graph t).IsNClique 3 s ↔
  ∃ x ∈ t, SimpleGraph.TripartiteFromTriangles.toTriangle x = s


/-- A constant sequence of functions is uniformly integrable in the probability sense. -/
theorem uniformIntegrable_const {g : α → β} (hp : 1 ≤ p) (hp_ne_top : p ≠ ∞) (hg : Memℒp g p μ) :
    UniformIntegrable (fun _ : ι => g) p μ

{α : Type u_1}
{β : Type u_2}
{ι : Type u_3}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
{p : ℝ≥0∞}
{g : α → β}
(hp : 1 ≤ p)
(hp_ne_top : p ≠ ⊤)
(hg : MeasureTheory.Memℒp g p μ)

MeasureTheory.UniformIntegrable (fun x => g) p μ


lemma Hom.toBialgHom_injective (V W : HopfAlgebraCat.{v} R) :
    Function.Injective (Hom.toBialgHom : Hom V W → _)

{R : Type u}
[CommRing R]
(V W : HopfAlgebraCat R)


protected theorem sub_eq_add_neg {a b : Int} : a - b = a + -b


theorem Fix.ind (p : Fix F → Prop) (h : ∀ x : F (Fix F), Liftp p x → p (Fix.mk x)) : ∀ x, p x

(h : ∀ (x : F (QPF.Fix F)), Functor.Liftp p x → p (QPF.Fix.mk x))


/--
If and only if, or logical bi-implication. `a ↔ b` means that `a` implies `b` and vice versa.
By `propext`, this implies that `a` and `b` are equal and hence any expression involving `a`
is equivalent to the corresponding expression with `b` instead.
-/
structure Iff (a b : Prop) : Prop where
  /-- If `a → b` and `b → a` then `a` and `b` are equivalent. -/
  intro ::
  /-- Modus ponens for if and only if. If `a ↔ b` and `a`, then `b`. -/
  mp : a → b
  /-- Modus ponens for if and only if, reversed. If `a ↔ b` and `b`, then `a`. -/
  mpr : b → a


theorem Rel.is_equivalence : Equivalence (Rel α)


/-- A small family of pre-games is bounded below. -/
lemma bddBelow_range_of_small {ι : Type*} [Small.{u} ι] (f : ι → PGame.{u}) :
    BddBelow (Set.range f)

{ι : Type u_1}
[Small.{u, u_1} ι]
(f : ι → SetTheory.PGame)


@[to_additive]
theorem div_apply [Div Y] (f g : LocallyConstant X Y) (x : X) : (f / g) x = f x / g x

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


/--
If `α` has a unique term, the type of finitely supported functions `α →₀ β` is equivalent to `β`.
-/
@[simps!]
noncomputable def _root_.Equiv.finsuppUnique {ι : Type*} [Unique ι] : (ι →₀ M) ≃ M

{M : Type u_5}
[Zero M]
{ι : Type u_13}
[Unique ι]

∀ (a : M), (Equiv.finsuppUnique.symm a).support.val = Multiset.map Subtype.val Finset.univ.val


/-- For two `R`-algebra morphisms out of `A[ε]` to agree, it suffices for them to agree on the
elements of `A` and the `A`-multiples of `ε`. -/
@[ext 1100]
nonrec theorem algHom_ext' ⦃f g : A[ε] →ₐ[R] B⦄
    (hinl : f.comp (inlAlgHom _ _ _) = g.comp (inlAlgHom _ _ _))
    (hinr : f.toLinearMap ∘ₗ (LinearMap.toSpanSingleton A A[ε] ε).restrictScalars R =
        g.toLinearMap ∘ₗ (LinearMap.toSpanSingleton A A[ε] ε).restrictScalars R) :
      f = g

(hinl : f.comp (TrivSqZeroExt.inlAlgHom R A A) = g.comp (TrivSqZeroExt.inlAlgHom R A A))

(hinr :
  f.toLinearMap ∘ₗ ↑R (LinearMap.toSpanSingleton A A[ε] ε) = g.toLinearMap ∘ₗ ↑R (LinearMap.toSpanSingleton A A[ε] ε))


@[simp]
theorem symm_mk (f f') (h₁ h₂ h₃ h₄ h₅) :
    (⟨⟨⟨f, f', h₁, h₂⟩, h₃, h₄⟩, h₅⟩ : A ≃⋆+* B).symm =
      { symm_mk.aux f f' h₁ h₂ h₃ h₄ h₅ with
        toFun := f'
        invFun := f }

(h₃ :
  ∀ (x y : A),
    { toFun := f, invFun := f', left_inv := h₁, right_inv := h₂ }.toFun (x * y) =
      { toFun := f, invFun := f', left_inv := h₁, right_inv := h₂ }.toFun x *
        { toFun := f, invFun := f', left_inv := h₁, right_inv := h₂ }.toFun y)

(h₄ :
  ∀ (x y : A),
    { toFun := f, invFun := f', left_inv := h₁, right_inv := h₂ }.toFun (x + y) =
      { toFun := f, invFun := f', left_inv := h₁, right_inv := h₂ }.toFun x +
        { toFun := f, invFun := f', left_inv := h₁, right_inv := h₂ }.toFun y)

(h₅ :
  ∀ (a : A),
    { toFun := f, invFun := f', left_inv := h₁, right_inv := h₂, map_mul' := h₃, map_add' := h₄ }.toFun (star a) =
      star ({ toFun := f, invFun := f', left_inv := h₁, right_inv := h₂, map_mul' := h₃, map_add' := h₄ }.toFun a))

{ toFun := f, invFun := f', left_inv := h₁, right_inv := h₂, map_mul' := h₃, map_add' := h₄, map_star' := h₅ }.symm =
  let __src := StarRingEquiv.symm_mk.aux f f' h₁ h₂ h₃ h₄ h₅;
  { toFun := f', invFun := f, left_inv := ⋯, right_inv := ⋯, map_mul' := ⋯, map_add' := ⋯, map_star' := ⋯ }


@[simp]
protected theorem deriv : deriv (fun x => p.eval x) x = p.derivative.eval x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
(p : 𝕜[X])

deriv (fun x => Polynomial.eval x p) x = Polynomial.eval x (Polynomial.derivative p)


@[simp]
theorem fan_mk_proj {f : β → C} (P : C) (p : ∀ b, P ⟶ f b) (j : β) : (Fan.mk P p).proj j = p j

{β : Type w}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{f : β → C}
(P : C)
(p : (b : β) → P ⟶ f b)
(j : β)

(CategoryTheory.Limits.Fan.mk P p).proj j = p j


theorem isOpen_Iio {a : Γ₀} : IsOpen (Iio a)

{Γ₀ : Type u_2}
[LinearOrderedCommGroupWithZero Γ₀]
{a : Γ₀}


@[to_additive prod_top]
theorem prod_top (s : Submonoid M) : s.prod (⊤ : Submonoid N) = s.comap (MonoidHom.fst M N)

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
(s : Submonoid M)

s.prod ⊤ = Submonoid.comap (MonoidHom.fst M N) s


lemma exists_lt_mem_inter_of_not_pairwiseDisjoint [LinearOrder ι]
    {f : ι → Set α} (h : ¬ s.PairwiseDisjoint f) :
    ∃ i ∈ s, ∃ j ∈ s, i < j ∧ ∃ x, x ∈ f i ∩ f j

{α : Type u_1}
{ι : Type u_4}
{s : Set ι}
[LinearOrder ι]
{f : ι → Set α}
(h : ¬s.PairwiseDisjoint f)


theorem map_eval_injective : (Submodule.map (eval K V)).Injective

(K : Type uK)
(V : Type uV)
[CommRing K]
[AddCommGroup V]
[Module K V]
[Module.Free K V]

Function.Injective (Submodule.map (Module.Dual.eval K V))


@[simp, nolint simpNF] lemma LieModuleEquiv.ofTop_apply (x : (⊤ : LieSubmodule R L M)) :
    LieModuleEquiv.ofTop R L M x = x

(R : Type u)
(L : Type v)
[CommRing R]
[LieRing L]
(M : Type u_1)
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
(x : ↥⊤)


theorem integrable_smul_iff [NormedDivisionRing 𝕜] [Module 𝕜 β] [BoundedSMul 𝕜 β] {c : 𝕜}
    (hc : c ≠ 0) (f : α → β) : Integrable (c • f) μ ↔ Integrable f μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
{𝕜 : Type u_5}
[NormedDivisionRing 𝕜]
[Module 𝕜 β]
[BoundedSMul 𝕜 β]
{c : 𝕜}
(hc : c ≠ 0)
(f : α → β)

MeasureTheory.Integrable (c • f) μ ↔ MeasureTheory.Integrable f μ


@[simp]
theorem volume_closedBall (a r : ℝ) : volume (Metric.closedBall a r) = ofReal (2 * r)

MeasureTheory.volume (Metric.closedBall a r) = ENNReal.ofReal (2 * r)


theorem iff :
    FinitePresentation R A ↔
      ∃ (n : _) (I : Ideal (MvPolynomial (Fin n) R)) (_ : (_ ⧸ I) ≃ₐ[R] A), I.FG

{R : Type w₁}
{A : Type w₂}
[CommRing R]
[CommRing A]
[Algebra R A]

Algebra.FinitePresentation R A ↔ ∃ n I x, I.FG


theorem norm_le_of_nonempty [Nonempty α] {f : α →ᵇ β} {M : ℝ} : ‖f‖ ≤ M ↔ ∀ x, ‖f x‖ ≤ M

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[SeminormedAddCommGroup β]
[Nonempty α]
{f : BoundedContinuousFunction α β}
{M : ℝ}


@[simp]
theorem snd_apply (x : M × M₂) : snd R M M₂ x = x.2

{R : Type u}
{M : Type v}
{M₂ : Type w}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]
(x : M × M₂)


/-- If a function is convex on `s`, it remains convex when precomposed by an affine map. -/
theorem ConvexOn.comp_affineMap {f : F → β} (g : E →ᵃ[𝕜] F) {s : Set F} (hf : ConvexOn 𝕜 s f) :
    ConvexOn 𝕜 (g ⁻¹' s) (f ∘ g)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
{β : Type u_5}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[AddCommGroup F]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[Module 𝕜 F]
[SMul 𝕜 β]
{f : F → β}
(g : E →ᵃ[𝕜] F)
{s : Set F}
(hf : ConvexOn 𝕜 s f)


lemma map_const (μ : Measure α) (c : β) : μ.map (fun _ ↦ c) = (μ Set.univ) • dirac c

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
(μ : MeasureTheory.Measure α)
(c : β)

MeasureTheory.Measure.map (fun x => c) μ = μ Set.univ • MeasureTheory.Measure.dirac c


/-- Given two composable morphisms `f : X₁ ⟶ X₂` and `g : X₂ ⟶ X₃` in the category
of cochain complexes, this is the canonical triangle
`mappingCone f ⟶ mappingCone (f ≫ g) ⟶ mappingCone g ⟶ (mappingCone f)⟦1⟧`. -/
@[simps! mor₁ mor₂ mor₃ obj₁ obj₂ obj₃]
noncomputable def mappingConeCompTriangle : Triangle (CochainComplex C ℤ)

(CochainComplex.mappingConeCompTriangle f g).obj₃ = CochainComplex.mappingCone g


/-- **Fundamental theorem of calculus-1**, local version for any measure.
Let filters `l` and `l'` be related by `TendstoIxxClass Ioc`.
If `f` has a finite limit `c` at `l' ⊓ ae μ`, where `μ` is a measure
finite at `l'`, then `∫ x in u..v, f x ∂μ = ∫ x in u..v, c ∂μ + o(∫ x in u..v, 1 ∂μ)` as both
`u` and `v` tend to `l`.

See also `measure_integral_sub_linear_isLittleO_of_tendsto_ae` for a version assuming
`[intervalIntegral.FTCFilter a l l']` and `[MeasureTheory.IsLocallyFiniteMeasure μ]`. If `l` is one
of `𝓝[≥] a`, `𝓝[≤] a`, `𝓝 a`, then it's easier to apply the non-primed version.  The primed version
also works, e.g., for `l = l' = atTop`.

We use integrals of constants instead of measures because this way it is easier to formulate
a statement that works in both cases `u ≤ v` and `v ≤ u`. -/
theorem measure_integral_sub_linear_isLittleO_of_tendsto_ae' [IsMeasurablyGenerated l']
    [TendstoIxxClass Ioc l l'] (hfm : StronglyMeasurableAtFilter f l' μ)
    (hf : Tendsto f (l' ⊓ ae μ) (𝓝 c)) (hl : μ.FiniteAtFilter l') (hu : Tendsto u lt l)
    (hv : Tendsto v lt l) :
    (fun t => (∫ x in u t..v t, f x ∂μ) - ∫ _ in u t..v t, c ∂μ) =o[lt] fun t =>
      ∫ _ in u t..v t, (1 : ℝ) ∂μ

(hf : Filter.Tendsto f (l' ⊓ MeasureTheory.ae μ) (𝓝 c))

(fun t => ∫ (x : ℝ) in u t..v t, f x ∂μ - ∫ (x : ℝ) in u t..v t, c ∂μ) =o[lt] fun t => ∫ (x : ℝ) in u t..v t, 1 ∂μ


/-- Class `ContinuousConstSMul Γ T` says that the scalar multiplication `(•) : Γ → T → T`
is continuous in the second argument. We use the same class for all kinds of multiplicative
actions, including (semi)modules and algebras.

Note that both `ContinuousConstSMul α α` and `ContinuousConstSMul αᵐᵒᵖ α` are
weaker versions of `ContinuousMul α`. -/
class ContinuousConstSMul (Γ : Type*) (T : Type*) [TopologicalSpace T] [SMul Γ T] : Prop where
  /-- The scalar multiplication `(•) : Γ → T → T` is continuous in the second argument. -/
  continuous_const_smul : ∀ γ : Γ, Continuous fun x : T => γ • x

{Γ : Type u_1}
{T : Type u_2}
[TopologicalSpace T]
[SMul Γ T]
[self : ContinuousConstSMul Γ T]
(γ : Γ)


@[to_additive]
lemma le_stabilizer_smul_left [SMul α β] [IsScalarTower G α β] (a : α) (b : β) :
    stabilizer G a ≤ stabilizer G (a • b)

{G : Type u_1}
{α : Type u_2}
{β : Type u_3}
[Group G]
[MulAction G α]
[MulAction G β]
[SMul α β]
[IsScalarTower G α β]
(a : α)
(b : β)

MulAction.stabilizer G a ≤ MulAction.stabilizer G (a • b)


theorem MeasureTheory.Integrable.apply_continuousLinearMap {φ : α → H →L[𝕜] E}
    (φ_int : Integrable φ μ) (v : H) : Integrable (fun a => φ a v) μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{E : Type u_5}
[NormedAddCommGroup E]
{𝕜 : Type u_6}
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
{H : Type u_7}
[NormedAddCommGroup H]
[NormedSpace 𝕜 H]
{φ : α → H →L[𝕜] E}
(φ_int : MeasureTheory.Integrable φ μ)
(v : H)

MeasureTheory.Integrable (fun a => (φ a) v) μ


theorem add_one_le_iff : ∀ {a b : ℕ+}, a + 1 ≤ b ↔ a < b


theorem IsConformalMap.smul (hf : IsConformalMap f) {c : R} (hc : c ≠ 0) :
    IsConformalMap (c • f)

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[NormedField R]
[SeminormedAddCommGroup M]
[SeminormedAddCommGroup N]
[NormedSpace R M]
[NormedSpace R N]
{f : M →L[R] N}
(hf : IsConformalMap f)
{c : R}
(hc : c ≠ 0)


@[simp]
theorem submatrix_id_id (A : Matrix m n α) : A.submatrix id id = A

{m : Type u_2}
{n : Type u_3}
{α : Type v}
(A : Matrix m n α)


theorem mem_of_mem_filter {a : α} {l} (h : a ∈ filter p l) : a ∈ l

{α : Type u_1}
{p : α → Bool}
{a : α}
{l : Array α}
(h : a ∈ Array.filter p l 0)


lemma pow_eq_pow_iff_of_coprime (hmn : m.Coprime n) : a ^ m = b ^ n ↔ ∃ c, a = c ^ n ∧ b = c ^ m

{α : Type u_1}
[CommGroupWithZero α]
{a b : α}
{m n : ℕ}
(hmn : m.Coprime n)


/-- A variant of `lift` with `Z` an initial object. -/
@[simps!]
def liftToInitial {D : Type*} [Category D] {Z : D} (F : C ⥤ D) (hZ : Limits.IsInitial Z) :
    WithInitial C ⥤ D

(hZ : CategoryTheory.Limits.IsInitial Z)

(CategoryTheory.WithInitial.liftToInitial F hZ).obj X =
  match X with
  | CategoryTheory.WithInitial.of x => F.obj x
  | CategoryTheory.WithInitial.star => Z


theorem closure_sup_closure_left (x y : α) : u (l (u (l x) ⊔ y)) = u (l (x ⊔ y))

{α : Type u_1}
{β : Type u_4}
[SemilatticeSup α]
[Preorder β]
{u : β → α}
(l : LowerAdjoint u)
(x y : α)

u (l.toFun (u (l.toFun x) ⊔ y)) = u (l.toFun (x ⊔ y))


/-- If `f` and `g` are two torus integrable functions, then so is `f + g`. -/
protected nonrec theorem add (hf : TorusIntegrable f c R) (hg : TorusIntegrable g c R) :
    TorusIntegrable (f + g) c R

{n : ℕ}
{E : Type u_1}
[NormedAddCommGroup E]
{f g : (Fin n → ℂ) → E}
{c : Fin n → ℂ}
{R : Fin n → ℝ}
(hf : TorusIntegrable f c R)
(hg : TorusIntegrable g c R)


@[simp, norm_cast]
theorem coe_eq_one_iff {m : ℕ+} : (m : ℕ) = 1 ↔ m = 1


theorem cast_eq_iff_heq {α β} (h : α = β) {a : α} {b : β} : Equiv.cast h a = b ↔ HEq a b


theorem abs_sub_round_div_natCast_eq {m n : ℕ} :
    |(m : α) / n - round ((m : α) / n)| = ↑(min (m % n) (n - m % n)) / n

{α : Type u_2}
[LinearOrderedField α]
[FloorRing α]
{m n : ℕ}

|↑m / ↑n - ↑(round (↑m / ↑n))| = ↑(min (m % n) (n - m % n)) / ↑n


protected theorem R1Space.induced (f : Y → X) : @R1Space Y (.induced f ‹_›)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[R1Space X]
(f : Y → X)


theorem min_le_right (a b : α) : min a b ≤ b


theorem catalan_succ (n : ℕ) : catalan (n + 1) = ∑ i : Fin n.succ, catalan i * catalan (n - i)

catalan (n + 1) = ∑ i : Fin n.succ, catalan ↑i * catalan (n - ↑i)


@[simp]
theorem Basis.ofEquivFun_repr_apply [Finite ι] (e : M ≃ₗ[R] ι → R) (x : M) (i : ι) :
    (Basis.ofEquivFun e).repr x i = e x i

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Finite ι]
(e : M ≃ₗ[R] ι → R)
(x : M)
(i : ι)


/-- `C` has all limits of size `v₁ u₁` (`HasLimitsOfSize.{v₁ u₁} C`)
if it has limits of every shape `J : Type u₁` with `[Category.{v₁} J]`.
-/
@[pp_with_univ]
class HasLimitsOfSize (C : Type u) [Category.{v} C] : Prop where
  /-- All functors `F : J ⥤ C` from all small `J` have limits -/
  has_limits_of_shape : ∀ (J : Type u₁) [Category.{v₁} J], HasLimitsOfShape J C := by
    infer_instance

[self : CategoryTheory.Limits.HasLimitsOfSize.{v₁, u₁, v, u} C]


@[to_additive (attr := simp) neg_mem_addCentralizer]
lemma inv_mem_centralizer (ha : a ∈ centralizer S) : a⁻¹ ∈ centralizer S

{M : Type u_1}
{S : Set M}
[Group M]
{a : M}
(ha : a ∈ S.centralizer)


theorem ringExpChar.eq_iff [Ring R] [IsDomain R] {q : ℕ} : ringExpChar R = q ↔ ExpChar R q

{R : Type u}
[Ring R]
[IsDomain R]
{q : ℕ}


theorem eqOn_of_comp_eqOn (h₁ : ContinuousOn g₁ s) (h₂ : ContinuousOn g₂ s)
    (he : s.EqOn (f ∘ g₁) (f ∘ g₂)) {a : A} (has : a ∈ s) (ha : g₁ a = g₂ a) : s.EqOn g₁ g₂

{E : Type u_1}
{X : Type u_2}
[TopologicalSpace E]
[TopologicalSpace X]
{f : E → X}
(hf : IsCoveringMap f)
{A : Type u_3}
[TopologicalSpace A]
{s : Set A}
(hs : IsPreconnected s)
{g₁ g₂ : A → E}
(h₁ : ContinuousOn g₁ s)
(h₂ : ContinuousOn g₂ s)
(he : Set.EqOn (f ∘ g₁) (f ∘ g₂) s)
{a : A}
(has : a ∈ s)
(ha : g₁ a = g₂ a)


/-- If `f` is a partition of unity on `s : Set X` and `g : X → E` is continuous at every point of
the topological support of some `f i`, then `fun x ↦ f i x • g x` is continuous on the whole space.
-/
theorem continuous_smul {g : X → E} {i : ι} (hg : ∀ x ∈ tsupport (f i), ContinuousAt g x) :
    Continuous fun x => f i x • g x

(hg : ∀ x ∈ tsupport ⇑(f i), ContinuousAt g x)


/-- An angle in a right-angled triangle expressed using `arccos`, version subtracting vectors. -/
theorem oangle_sub_left_eq_arccos_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = ↑(π / 2)) :
    o.oangle (x - y) x = Real.arccos (‖x‖ / ‖x - y‖)

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

o.oangle (x - y) x = ↑(Real.arccos (‖x‖ / ‖x - y‖))


@[simp]
theorem neg_coeff' {x : HahnSeries Γ R} : (-x).coeff = -x.coeff

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[AddGroup R]
{x : HahnSeries Γ R}


theorem Ioo_mem_nhdsWithin_Ioi' {a b : α} (H : a < b) : Ioo a b ∈ 𝓝[>] a

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIciTopology α]
{a b : α}
(H : a < b)


theorem preimage (hs : IsAntichain r s) {f : β → α} (hf : Injective f)
    (h : ∀ ⦃a b⦄, r' a b → r (f a) (f b)) : IsAntichain r' (f ⁻¹' s)

(h : ∀ ⦃a b : β⦄, r' a b → r (f a) (f b))


/-- The generators of the exterior algebra are disjoint from its scalars. -/
theorem ι_range_disjoint_one :
    Disjoint (LinearMap.range (ι R : M →ₗ[R] ExteriorAlgebra R M))
      (1 : Submodule R (ExteriorAlgebra R M))

{R : Type u1}
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]

Disjoint (LinearMap.range (ExteriorAlgebra.ι R)) 1


@[simp]
theorem toSubtype_apply (p : β → Prop) (f : α → β) (a : α) :
    toSubtype p f a = ⟨p (f a), Subtype.mk _⟩

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

PFun.toSubtype p f a = { Dom := p (f a), get := Subtype.mk (f a) }


@[to_additive (attr := simp)]
lemma sup_inv [SemilatticeSup β] [OrderBot β] (s : Finset α) (f : α → β) :
    sup s⁻¹ f = sup s (f ·⁻¹)

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[Inv α]
[SemilatticeSup β]
[OrderBot β]
(s : Finset α)
(f : α → β)


theorem binomial_eq_binomial {k l m n : ℕ} {u v : R} (hu : u ≠ 0) (hv : v ≠ 0) :
    C u * X ^ k + C v * X ^ l = C u * X ^ m + C v * X ^ n ↔
      k = m ∧ l = n ∨ u = v ∧ k = n ∧ l = m ∨ u + v = 0 ∧ k = l ∧ m = n

{R : Type u}
[Semiring R]
{k l m n : ℕ}
{u v : R}
(hu : u ≠ 0)
(hv : v ≠ 0)

Polynomial.C u * Polynomial.X ^ k + Polynomial.C v * Polynomial.X ^ l =
    Polynomial.C u * Polynomial.X ^ m + Polynomial.C v * Polynomial.X ^ n ↔
  k = m ∧ l = n ∨ u = v ∧ k = n ∧ l = m ∨ u + v = 0 ∧ k = l ∧ m = n


protected theorem DifferentiableAt.inversion (hc : DifferentiableAt ℝ c a)
    (hR : DifferentiableAt ℝ R a) (hx : DifferentiableAt ℝ x a) (hne : x a ≠ c a) :
    DifferentiableAt ℝ (fun a ↦ inversion (c a) (R a) (x a)) a

{E : Type u_1}
{F : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
{c x : E → F}
{R : E → ℝ}
{a : E}
(hc : DifferentiableAt ℝ c a)
(hR : DifferentiableAt ℝ R a)
(hx : DifferentiableAt ℝ x a)
(hne : x a ≠ c a)

DifferentiableAt ℝ (fun a => EuclideanGeometry.inversion (c a) (R a) (x a)) a


@[simp]
theorem vecHead_vecAlt1 (hm : m + 2 = n + 1 + (n + 1)) (v : Fin (m + 2) → α) :
    vecHead (vecAlt1 hm v) = v 1

Matrix.vecHead (Matrix.vecAlt1 hm v) = v 1


theorem one_apply (x) : (1 : Perm α) x = x


/-- The length of an element of a free magma is positive. -/
@[to_additive "The length of an element of a free additive magma is positive."]
lemma FreeMagma.length_pos {α : Type u} (x : FreeMagma α) : 0 < x.length


theorem min_le_of_right_le : b ≤ c → min a b ≤ c

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


/-- A `MorphComponents` can be precomposed with a morphism of simplicial objects. -/
@[simps]
def preComp : MorphComponents X' n Z

{X X' : CategoryTheory.SimplicialObject C}

(f : AlgebraicTopology.DoldKan.MorphComponents X n Z)

(f.preComp g).a = g.app (Opposite.op [n + 1]) ≫ f.a


theorem map_round (f : F) (hf : StrictMono f) (a : α) : round (f a) = round a

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedField α]
[LinearOrderedField β]
[FloorRing α]
[FloorRing β]
[FunLike F α β]
[RingHomClass F α β]
(f : F)
(hf : StrictMono ⇑f)
(a : α)


/-- **Jordan's inequality** for negative values. -/
lemma sin_le_two_div_pi_mul (hx : -(π / 2) ≤ x) (hx₀ : x ≤ 0) : sin x ≤ 2 / π * x

{x : ℝ}
(hx : -(Real.pi / 2) ≤ x)
(hx₀ : x ≤ 0)


@[elab_as_elim]
theorem iSup_induction' {ι} (N : ι → LieSubmodule R L M) {C : (x : M) → (x ∈ ⨆ i, N i) → Prop}
    (hN : ∀ (i) (x) (hx : x ∈ N i), C x (mem_iSup_of_mem i hx)) (h0 : C 0 (zero_mem _))
    (hadd : ∀ x y hx hy, C x hx → C y hy → C (x + y) (add_mem ‹_› ‹_›)) {x : M}
    (hx : x ∈ ⨆ i, N i) : C x hx

(hN : ∀ (i : ι) (x : M) (hx : x ∈ N i), C x ⋯)

(hadd : ∀ (x y : M) (hx : x ∈ ⨆ i, N i) (hy : y ∈ ⨆ i, N i), C x hx → C y hy → C (x + y) ⋯)


theorem sumElim_apply {α β γ : Type*} [Zero γ] (f : α →₀ γ) (g : β →₀ γ) (x : α ⊕ β) :
    sumElim f g x = Sum.elim f g x

{α : Type u_13}
{β : Type u_14}
{γ : Type u_15}
[Zero γ]
(f : α →₀ γ)
(g : β →₀ γ)
(x : α ⊕ β)


@[to_additive (attr := simp) unzero_coe]
theorem unone_coe {x : α} (hx : (x : WithOne α) ≠ 1) : unone hx = x


@[refl, simp]
theorem equiv_rfl {x : PGame} : x ≈ x


@[to_additive (attr := simp)]
theorem prod_to_list (s : Finset α) (f : α → β) : (s.toList.map f).prod = s.prod f

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


theorem Matrix.toLinearMap₂'_apply (M : Matrix n m N₂) (x : n → S₁) (y : m → S₂) :
    -- porting note: we don't seem to have `∑ i j` as valid notation yet
    Matrix.toLinearMap₂' R M x y = ∑ i, ∑ j, x i • y j • M i j

{R : Type u_1}
{S₁ : Type u_3}
{S₂ : Type u_5}
{N₂ : Type u_11}
{n : Type u_12}
{m : Type u_13}
[CommSemiring R]
[AddCommMonoid N₂]
[Module R N₂]
[Semiring S₁]
[Semiring S₂]
[Module S₁ N₂]
[Module S₂ N₂]
[SMulCommClass S₁ R N₂]
[SMulCommClass S₂ R N₂]
[SMulCommClass S₂ S₁ N₂]
[Fintype n]
[Fintype m]
[DecidableEq n]
[DecidableEq m]
(M : Matrix n m N₂)
(x : n → S₁)
(y : m → S₂)

(((Matrix.toLinearMap₂' R) M) x) y = ∑ i : n, ∑ j : m, x i •> y j •> M i j


theorem Iio_inter_Ioi : Iio a ∩ Ioi b = Ioo b a


@[to_additive]
theorem mem_centralizer_iff {z : M} : z ∈ centralizer S ↔ ∀ g ∈ S, g * z = z * g

{M : Type u_1}
{S : Set M}
[Monoid M]
{z : M}

z ∈ Submonoid.centralizer S ↔ ∀ g ∈ S, g * z = z * g


theorem roth_lower_bound : (N : ℝ) * exp (-4 * √(log N)) ≤ rothNumberNat N

↑N * rexp (-4 * √(Real.log ↑N)) ≤ ↑(rothNumberNat N)


private theorem tsum_nnnorm_sub_ae_lt_top {f : ℕ → α → E} (hf : ∀ n, AEStronglyMeasurable (f n) μ)
    {p : ℝ} (hp1 : 1 ≤ p) {B : ℕ → ℝ≥0∞} (hB : ∑' i, B i ≠ ∞)
    (h : (∫⁻ a, (∑' i, ‖f (i + 1) a - f i a‖₊ : ℝ≥0∞) ^ p ∂μ) ^ (1 / p) ≤ ∑' i, B i) :
    ∀ᵐ x ∂μ, (∑' i, ‖f (i + 1) x - f i x‖₊ : ℝ≥0∞) < ∞

(hf : ∀ (n : ℕ), MeasureTheory.AEStronglyMeasurable (f n) μ)

{B : ℕ → ℝ≥0∞}

∀ᵐ (x : α) ∂μ, ∑' (i : ℕ), ↑‖f (i + 1) x - f i x‖₊ < ⊤


nonrec theorem IsLocalExtrOn.comp_antitone (hf : IsLocalExtrOn f s a) {g : β → γ}
    (hg : Antitone g) : IsLocalExtrOn (g ∘ f) s a

{α : Type u}
{β : Type v}
{γ : Type w}
[TopologicalSpace α]
[Preorder β]
[Preorder γ]
{f : α → β}
{s : Set α}
{a : α}
(hf : IsLocalExtrOn f s a)
{g : β → γ}
(hg : Antitone g)


/-- The derivative of a `circleTransform` is locally bounded. -/
theorem circleTransformDeriv_bound {R : ℝ} (hR : 0 < R) {z x : ℂ} {f : ℂ → ℂ} (hx : x ∈ ball z R)
    (hf : ContinuousOn f (sphere z R)) : ∃ B ε : ℝ, 0 < ε ∧
      ball x ε ⊆ ball z R ∧ ∀ (t : ℝ), ∀ y ∈ ball x ε, ‖circleTransformDeriv R z y f t‖ ≤ B

(hf : ContinuousOn f (Metric.sphere z R))

∃ B ε,
  0 < ε ∧
    Metric.ball x ε ⊆ Metric.ball z R ∧ ∀ (t : ℝ), ∀ y ∈ Metric.ball x ε, ‖Complex.circleTransformDeriv R z y f t‖ ≤ B


theorem map_congr_perm [DecidableEq ι] [Fintype ι] (σ : Equiv.Perm ι) :
    g v = Equiv.Perm.sign σ • g (v ∘ σ)

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N' : Type u_6}
[AddCommGroup N']
[Module R N']
{ι : Type u_7}
(g : M [⋀^ι]→ₗ[R] N')
(v : ι → M)
[DecidableEq ι]
[Fintype ι]
(σ : Equiv.Perm ι)


/-- `f : α →+* β` has a trivial codomain iff its range is `{0}`. -/
theorem codomain_trivial_iff_range_eq_singleton_zero : (0 : β) = 1 ↔ Set.range f = {0}

∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β), 0 = 1 ↔ Set.range ⇑f = {0}


@[simp] theorem endofunctorMonoidalCategory_tensorObj_obj (F G : C ⥤ C) (X : C) :
    (F ⊗ G).obj X = G.obj (F.obj X)

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

(CategoryTheory.MonoidalCategory.tensorObj F G).obj X = G.obj (F.obj X)


theorem pullbackConeOfLeftLift_snd :
    pullbackConeOfLeftLift f g s ≫ (pullbackConeOfLeft f g).snd = s.snd

{X Y Z : AlgebraicGeometry.PresheafedSpace C}

[hf : AlgebraicGeometry.PresheafedSpace.IsOpenImmersion f]

(s : CategoryTheory.Limits.PullbackCone f g)

AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.pullbackConeOfLeftLift f g s ≫
    (AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.pullbackConeOfLeft f g).snd =
  s.snd


@[simp] lemma equicontinuousWithinAt_univ (F : ι → X → α) (x₀ : X) :
    EquicontinuousWithinAt F univ x₀ ↔ EquicontinuousAt F x₀

{ι : Type u_1}
{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
(F : ι → X → α)
(x₀ : X)

EquicontinuousWithinAt F Set.univ x₀ ↔ EquicontinuousAt F x₀


/-- Reinterpret `Additive G ≃+ H` as `G ≃* Multiplicative H`. -/
@[simps]
def AddEquiv.toMultiplicative' [MulOneClass G] [AddZeroClass H] :
    Additive G ≃+ H ≃ (G ≃* Multiplicative H)

{G : Type u_1}
{H : Type u_2}
[MulOneClass G]
[AddZeroClass H]
(f : G ≃* Multiplicative H)
(a : Additive G)

(AddEquiv.toMultiplicative'.symm f) a = (AddMonoidHom.toMultiplicative'.symm f.toMonoidHom) a


theorem _root_.Monotone.isBoundedUnder_ge_comp [Preorder α] [Preorder β] {l : Filter γ} {u : γ → α}
    {v : α → β} (hv : Monotone v) (hl : l.IsBoundedUnder (· ≥ ·) u) :
    l.IsBoundedUnder (· ≥ ·) (v ∘ u)

(hl : Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) l u)

Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) l (v ∘ u)


theorem le_def [LE α] [LE β] {a b : α ⊕ β} : a ≤ b ↔ LiftRel (· ≤ ·) (· ≤ ·) a b

{α : Type u_1}
{β : Type u_2}
[LE α]
[LE β]
{a b : α ⊕ β}

a ≤ b ↔ Sum.LiftRel (fun x x_1 => x ≤ x_1) (fun x x_1 => x ≤ x_1) a b


@[simp]
theorem getElem?_enumFrom :
    ∀ n (l : List α) m, (enumFrom n l)[m]? = l[m]?.map fun a => (n + m, a)

{α : Type u_1}
(n : ℕ)
(l : List α)
(m : ℕ)

(List.enumFrom n l)[m]? = Option.map (fun a => (n + m, a)) l[m]?


/-- This actually does not need the localization instance, and is stated here again for
consistency. See `Algebra.FormallyUnramified.of_comp` instead.

 The intended use is for copying proofs between `Formally{Unramified, Smooth, Etale}`
 without the need to change anything (including removing redundant arguments). -/
-- @[nolint unusedArguments] -- Porting note: removed
theorem localization_base [FormallyUnramified R Sₘ] : FormallyUnramified Rₘ Sₘ

{R Rₘ Sₘ : Type u}
[CommRing R]
[CommRing Rₘ]
[CommRing Sₘ]
(M : Submonoid R)
[Algebra R Sₘ]
[Algebra R Rₘ]
[Algebra Rₘ Sₘ]
[IsScalarTower R Rₘ Sₘ]
[Algebra.FormallyUnramified R Sₘ]


lemma Spec_presheaf (R : CommRingCat.{u}) : (Spec R).presheaf = (Spec.structureSheaf R).1

(AlgebraicGeometry.Spec R).presheaf = (AlgebraicGeometry.Spec.structureSheaf ↑R).val


theorem gfpApprox_le {a : Ordinal} : gfpApprox f x a ≤ x

{α : Type u}
[CompleteLattice α]
(f : α →o α)
(x : α)
{a : Ordinal.{u}}


@[simp]
theorem C_eq_zero : C a = 0 ↔ a = 0


theorem card_filter_atomise_le_two_pow (ht : t ∈ F) :
    ((atomise s F).parts.filter fun u ↦ u ⊆ t ∧ u.Nonempty).card ≤ 2 ^ (F.card - 1)

{α : Type u_1}
[DecidableEq α]
{s t : Finset α}
[Fintype α]
{F : Finset (Finset α)}
(ht : t ∈ F)

(Finset.filter (fun u => u ⊆ t ∧ u.Nonempty) (Finpartition.atomise s F).parts).card ≤ 2 ^ (F.card - 1)


/-- `zeta n A B` is a primitive `n`-th root of unity. -/
@[simp]
theorem zeta_spec : IsPrimitiveRoot (zeta n A B) n

(n : ℕ+)
(A : Type w)
(B : Type z)
[CommRing A]
[CommRing B]
[Algebra A B]
[IsCyclotomicExtension {n} A B]

IsPrimitiveRoot (IsCyclotomicExtension.zeta n A B) ↑n


/-- A non-trivial `concat` walk is representable as a `cons` walk. -/
theorem exists_concat_eq_cons {u v w : V} :
    ∀ (p : G.Walk u v) (h : G.Adj v w),
      ∃ (x : V) (h' : G.Adj u x) (q : G.Walk x w), p.concat h = cons h' q

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

∃ x, ∃ (h' : G.Adj u x), ∃ q, p.concat h = SimpleGraph.Walk.cons h' q


@[simp]
theorem mk_top [OrderTop α] [OrderTop (Subtype p)] (htop : p ⊤) : mk ⊤ htop = ⊤

{α : Type u}
{p : α → Prop}
[PartialOrder α]
[OrderTop α]
[OrderTop (Subtype p)]
(htop : p ⊤)


theorem sub_pf {R} [Ring R] {a b c d : R}
    (_ : -b = c) (_ : a + c = d) : a - b = d


@[to_additive]
theorem ContinuousWithinAt.inv (hf : ContinuousWithinAt f s x) :
    ContinuousWithinAt (fun x => (f x)⁻¹) s x

{G : Type w}
{α : Type u}
[TopologicalSpace G]
[Neg G]
[ContinuousNeg G]
[TopologicalSpace α]
{f : α → G}
{s : Set α}
{x : α}
(hf : ContinuousWithinAt f s x)


theorem prod_X_sub_C_nextCoeff {s : Finset ι} (f : ι → R) :
    nextCoeff (∏ i ∈ s, (X - C (f i))) = -∑ i ∈ s, f i

{R : Type u}
{ι : Type w}
[CommRing R]
{s : Finset ι}
(f : ι → R)

(∏ i ∈ s, (Polynomial.X - Polynomial.C (f i))).nextCoeff = -∑ i ∈ s, f i


theorem image_biUnion_filter_eq [DecidableEq α] (s : Finset β) (g : β → α) :
    ((s.image g).biUnion fun a => s.filter fun c => g c = a) = s

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
[DecidableEq α]
(s : Finset β)
(g : β → α)

((Finset.image g s).biUnion fun a => Finset.filter (fun c => g c = a) s) = s


theorem arctan_add_eq_sub_pi {x y : ℝ} (h : 1 < x * y) (hx : x < 0) :
    arctan x + arctan y = arctan ((x + y) / (1 - x * y)) - π

Real.arctan x + Real.arctan y = Real.arctan ((x + y) / (1 - x * y)) - Real.pi


theorem isLeast_univ [OrderBot α] : IsLeast (univ : Set α) ⊥


@[to_additive (attr := simp)]
theorem unop_op (S : Submonoid M) : S.op.unop = S

{M : Type u_2}
[MulOneClass M]
(S : Submonoid M)


lemma sub {f g : 𝕜 → E} {x : 𝕜} (hf : MeromorphicAt f x) (hg : MeromorphicAt g x) :
    MeromorphicAt (f - g) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f g : 𝕜 → E}
{x : 𝕜}
(hf : MeromorphicAt f x)
(hg : MeromorphicAt g x)


protected theorem uniformContinuousOn (hf : LipschitzOnWith K f s) : UniformContinuousOn f s

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


/-- The natural equivalence between linear maps from `M` to `N`
and `1`-multilinear alternating maps from `M` to `N`. -/
@[simps!]
def ofSubsingleton [Subsingleton ι] (i : ι) : (M →ₗ[R] N) ≃ (M [⋀^ι]→ₗ[R] N)

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

((AlternatingMap.ofSubsingleton R M N i).symm f) x = f fun x_1 => x


/-- The free functor `Type u ⥤ ModuleCat R` sending a type `X` to the
free `R`-module with generators `x : X`, implemented as the type `X →₀ R`.
-/
@[simps]
def free : Type u ⥤ ModuleCat R

(R : Type u)
[Ring R]
{X Y : Type u}
(f : X ⟶ Y)

(ModuleCat.free R).map f = Finsupp.lmapDomain R R f


theorem coe_injective : @Function.Injective (E ≃ₛₗᵢ[σ₁₂] E₂) (E → E₂) (↑)

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]


lemma coe_sub_one (a : Fin (n + 1)) : ↑(a - 1) = if a = 0 then n else a - 1


/-- The special case of Graham's conjecture where all numbers are squarefree. -/
lemma grahamConjecture_of_squarefree {n : ℕ} (f : ℕ → ℕ) (hf' : ∀ k < n, Squarefree (f k)) :
    GrahamConjecture n f


theorem getLeft_eq_getLeft? (h₁ : x.isLeft) (h₂ : x.getLeft?.isSome) :
    x.getLeft h₁ = x.getLeft?.get h₂

{α : Type u}
{β : Type v}
{x : α ⊕ β}
(h₁ : x.isLeft = true)
(h₂ : x.getLeft?.isSome = true)


theorem Restriction.finite {M : Matroid α} [M.Finite] (h : N ≤r M) : N.Finite

{α : Type u_1}
{N M : Matroid α}
[M.Finite]
(h : N.Restriction M)


theorem lift_iInf [Nonempty ι] {f : ι → Filter α} {g : Set α → Filter β}
    (hg : ∀ s t, g (s ∩ t) = g s ⊓ g t) : (iInf f).lift g = ⨅ i, (f i).lift g

(hg : ∀ (s t : Set α), g (s ∩ t) = g s ⊓ g t)


@[to_additive (attr := simp)]
theorem mul_self_le_one_iff : a * a ≤ 1 ↔ a ≤ 1

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


@[simp]
theorem kextract_eq_dlookup_kerase (a : α) :
    ∀ l : List (Sigma β), kextract a l = (dlookup a l, kerase a l)

{α : Type u}
{β : α → Type v}
[DecidableEq α]
(a : α)
(l : List (Sigma β))

List.kextract a l = (List.dlookup a l, List.kerase a l)


theorem toComplex_def (x : ℤ[i]) : (x : ℂ) = x.re + x.im * I

GaussianInt.toComplex x = ↑x.re + ↑x.im * Complex.I


theorem div_def [Div α] (a b : Part α) : a / b = bind a fun y => map (y / ·) b

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


@[to_additive EventuallyLE.add_le_add]
theorem EventuallyLE.mul_le_mul' [Mul β] [Preorder β] [CovariantClass β β (· * ·) (· ≤ ·)]
    [CovariantClass β β (swap (· * ·)) (· ≤ ·)] {l : Filter α} {f₁ f₂ g₁ g₂ : α → β}
    (hf : f₁ ≤ᶠ[l] f₂) (hg : g₁ ≤ᶠ[l] g₂) : f₁ * g₁ ≤ᶠ[l] f₂ * g₂

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

{f₁ f₂ g₁ g₂ : α → β}


@[to_additive]
theorem index_map (f : G →* G') :
    (H.map f).index = (H ⊔ f.ker).index * f.range.index

{G : Type u_1}
{G' : Type u_2}
[AddGroup G]
[AddGroup G']
(H : AddSubgroup G)
(f : G →+ G')

(AddSubgroup.map f H).index = (H ⊔ f.ker).index * f.range.index


@[simp]
theorem foldl_map (g : β → γ) (f : α → γ → α) (a : α) (l : t β) :
    foldl f a (g <$> l) = foldl (fun x y => f x (g y)) a l

{α β γ : Type u}
{t : Type u → Type u}
[Traversable t]
[LawfulTraversable t]
(g : β → γ)
(f : α → γ → α)
(a : α)
(l : t β)

Traversable.foldl f a (g <$> l) = Traversable.foldl (fun x y => f x (g y)) a l


theorem tendsto_cofinite_zero_of_tsum_ne_top {α} {f : α → ℝ≥0∞} (hf : ∑' x, f x ≠ ∞) :
    Tendsto f cofinite (𝓝 0)

{α : Type u_4}
{f : α → ℝ≥0∞}
(hf : ∑' (x : α), f x ≠ ⊤)


theorem epi_of_cokernel_iso_zero {X Y : C} {f : X ⟶ Y} [HasColimit (parallelPair f 0)]
    (w : cokernel f ≅ 0) : Epi f

[CategoryTheory.Limits.HasColimit (CategoryTheory.Limits.parallelPair f 0)]

(w : CategoryTheory.Limits.cokernel f ≅ 0)


theorem map_iso_eq {F₁ F₂ : D ⥤ C} (h : F₁ ≅ F₂) : map F₁ = map F₂

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
[Quiver.IsThin C]
{F₁ F₂ : CategoryTheory.Functor D C}
(h : F₁ ≅ F₂)

CategoryTheory.ThinSkeleton.map F₁ = CategoryTheory.ThinSkeleton.map F₂


theorem commute_iff_commute {f g : CircleDeg1Lift} : Commute f g ↔ Function.Commute f g


/-- The L-series of `δ` is the constant function `1`. -/
lemma LSeries_delta : LSeries δ = 1


@[ext]
theorem ext {S T : ProperCone 𝕜 E} (h : ∀ x, x ∈ S ↔ x ∈ T) : S = T

{𝕜 : Type u_1}
[OrderedSemiring 𝕜]
{E : Type u_2}
[AddCommMonoid E]
[TopologicalSpace E]
[Module 𝕜 E]
{S T : ProperCone 𝕜 E}
(h : ∀ (x : E), x ∈ S ↔ x ∈ T)


@[measurability, fun_prop]
theorem AEMeasurable.edist {f g : β → α} {μ : Measure β} (hf : AEMeasurable f μ)
    (hg : AEMeasurable g μ) : AEMeasurable (fun a => edist (f a) (g a)) μ

{α : Type u_1}
{β : Type u_2}
[PseudoEMetricSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[MeasurableSpace β]
[SecondCountableTopology α]
{f g : β → α}
{μ : MeasureTheory.Measure β}
(hf : AEMeasurable f μ)
(hg : AEMeasurable g μ)


lemma isLocallyInjective_forget_iff :
    IsLocallyInjective J (whiskerRight φ (forget D)) ↔ IsLocallyInjective J φ

(J : CategoryTheory.GrothendieckTopology C)

CategoryTheory.Presheaf.IsLocallyInjective J (CategoryTheory.whiskerRight φ (CategoryTheory.forget D)) ↔
  CategoryTheory.Presheaf.IsLocallyInjective J φ


theorem val_le_of_ge {n : Nat} {a b : Fin n} (h : a ≥ b) : (b : Nat) ≤ (a : Nat)


lemma mem_engel_iff (x y : L) :
    y ∈ engel R x ↔ ∃ n : ℕ, ((ad R L x) ^ n) y = 0

(R : Type u_1)
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(x y : L)

y ∈ LieSubalgebra.engel R x ↔ ∃ n, ((LieAlgebra.ad R L) x ^ n) y = 0


theorem Convex.inter {t : Set E} (hs : Convex 𝕜 s) (ht : Convex 𝕜 t) : Convex 𝕜 (s ∩ t)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
{s t : Set E}
(hs : Convex 𝕜 s)
(ht : Convex 𝕜 t)


theorem half_sub (a : R) : a / 2 - a = -(a / 2)

{R : Type u_1}
[DivisionRing R]
[CharZero R]
(a : R)


/-- The `CstarRing.spectralOrder` on a unital C⋆-algebra is a `StarOrderedRing`. -/
lemma CstarRing.spectralOrderedRing : @StarOrderedRing A _ (CstarRing.spectralOrder A) _

(A : Type u_1)
[NormedRing A]
[CompleteSpace A]
[StarRing A]
[CstarRing A]
[NormedAlgebra ℂ A]
[StarModule ℂ A]


/-- A prefunctor preserving reversal of arrows -/
class _root_.Prefunctor.MapReverse (φ : U ⥤q V) : Prop where
  /-- The image of a reverse is the reverse of the image. -/
  map_reverse' : ∀ {u v : U} (e : u ⟶ v), φ.map (reverse e) = reverse (φ.map e)

{U : Type u_1}
{V : Type u_2}
[Quiver U]
[Quiver V]
[Quiver.HasReverse U]
[Quiver.HasReverse V]
{φ : U ⥤q V}
[self : φ.MapReverse]
{u v : U}
(e : u ⟶ v)

φ.map (Quiver.reverse e) = Quiver.reverse (φ.map e)


@[to_additive (attr := simp)] theorem range_inl_sup_range_inr :
    MonoidHom.range (inl : G →* G ∗ H) ⊔ MonoidHom.range inr = ⊤

{G : Type u_1}
{H : Type u_2}
[AddGroup G]
[AddGroup H]

AddMonoid.Coprod.inl.range ⊔ AddMonoid.Coprod.inr.range = ⊤


/-- `R` is integrally closed iff it is the integral closure of itself in its field of fractions. -/
theorem isIntegrallyClosed_iff_isIntegrallyClosedIn :
    IsIntegrallyClosed R ↔ IsIntegrallyClosedIn R K

{R : Type u_1}
[CommRing R]
(K : Type u_4)
[CommRing K]
[Algebra R K]
[IsFractionRing R K]


@[simp]
theorem normalClosure_eq_self (H : Subgroup G) [H.Normal] : normalClosure ↑H = H

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


theorem Differentiable.inner (hf : Differentiable ℝ f) (hg : Differentiable ℝ g) :
    Differentiable ℝ fun x => ⟪f x, g x⟫

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedSpace ℝ E]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{f g : G → E}
(hf : Differentiable ℝ f)
(hg : Differentiable ℝ g)


/-- If an antitone sequence of functions has a lower bound and the sequence of integrals of these
functions tends to the integral of the lower bound, then the sequence of functions converges
almost everywhere to the lower bound. -/
lemma tendsto_of_lintegral_tendsto_of_antitone {α : Type*} {mα : MeasurableSpace α}
    {f : ℕ → α → ℝ≥0∞} {F : α → ℝ≥0∞} {μ : Measure α}
    (hf_meas : ∀ n, AEMeasurable (f n) μ)
    (hf_tendsto : Tendsto (fun i ↦ ∫⁻ a, f i a ∂μ) atTop (𝓝 (∫⁻ a, F a ∂μ)))
    (hf_mono : ∀ᵐ a ∂μ, Antitone (fun i ↦ f i a))
    (h_bound : ∀ᵐ a ∂μ, ∀ i, F a ≤ f i a) (h0 : ∫⁻ a, f 0 a ∂μ ≠ ∞) :
    ∀ᵐ a ∂μ, Tendsto (fun i ↦ f i a) atTop (𝓝 (F a))

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

{F : α → ℝ≥0∞}

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

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

(hf_mono : ∀ᵐ (a : α) ∂μ, Antitone fun i => f i a)

(h_bound : ∀ᵐ (a : α) ∂μ, ∀ (i : ℕ), F a ≤ f i a)

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


theorem rank_lt_rank_dual {K V : Type u} [Field K] [AddCommGroup V] [Module K V]
    (h : ℵ₀ ≤ Module.rank K V) : Module.rank K V < Module.rank K (V →ₗ[K] K)


@[simp] theorem not_irrational_one : ¬Irrational 1


theorem natDegree_pos_of_aeval_root [Algebra R S] {p : R[X]} (hp : p ≠ 0) {z : S}
    (hz : aeval z p = 0) (inj : ∀ x : R, algebraMap R S x = 0 → x = 0) : 0 < p.natDegree

(inj : ∀ (x : R), (algebraMap R S) x = 0 → x = 0)


@[simp]
theorem star_smul [Monoid S] [DistribMulAction S R] (s : S) (a : ℍ[R,c₁,c₂]) :
    star (s • a) = s • star a

{S : Type u_1}
{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
[Monoid S]
[DistribMulAction S R]
(s : S)
(a : ℍ[R,c₁,c₂])


theorem map_le_add {x y : R} {g : Γ₀} (hx : g ≤ v x) (hy : g ≤ v y) : g ≤ v (x + y)

{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedAddCommMonoidWithTop Γ₀]
(v : AddValuation R Γ₀)
{x y : R}
{g : Γ₀}
(hx : g ≤ v x)
(hy : g ≤ v y)


/-- A pseudometric space is second countable if, for every `ε > 0`, there is a countable set which
is `ε`-dense. -/
theorem secondCountable_of_almost_dense_set
    (H : ∀ ε > (0 : ℝ), ∃ s : Set α, s.Countable ∧ ∀ x, ∃ y ∈ s, dist x y ≤ ε) :
    SecondCountableTopology α

(H : ∀ ε > 0, ∃ s, s.Countable ∧ ∀ (x : α), ∃ y ∈ s, dist x y ≤ ε)


theorem embDomain_smul (f : Γ ↪o Γ') (r : R) (x : HahnSeries Γ R) :
    embDomain f (r • x) = r • embDomain f x

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Semiring R]
{Γ' : Type u_4}
[PartialOrder Γ']
(f : Γ ↪o Γ')
(r : R)
(x : HahnSeries Γ R)

HahnSeries.embDomain f (r • x) = r • HahnSeries.embDomain f x


theorem tendstoLocallyUniformlyOn_univ :
    TendstoLocallyUniformlyOn F f p univ ↔ TendstoLocallyUniformly F f p

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

TendstoLocallyUniformlyOn F f p Set.univ ↔ TendstoLocallyUniformly F f p


@[simp] theorem sub_eq (x y : BitVec w)                   : BitVec.sub x y = x - y


theorem map_permutations (f : α → β) (ts : List α) :
    map (map f) (permutations ts) = permutations (map f ts)

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

List.map (List.map f) ts.permutations = (List.map f ts).permutations


@[simp]
theorem coe_homothetyUnitsMulHom_apply_symm (p : P) (t : Rˣ) :
    ((homothetyUnitsMulHom p t).symm : P → P) = AffineMap.homothety p (↑t⁻¹ : R)

{R : Type u_10}
{V : Type u_11}
{P : Type u_12}
[CommRing R]
[AddCommGroup V]
[Module R V]
[AffineSpace V P]
(p : P)
(t : Rˣ)

⇑((AffineEquiv.homothetyUnitsMulHom p) t).symm = ⇑(AffineMap.homothety p ↑t⁻¹)


@[simp]
theorem optionEquivSumPUnit_symm_inr (a) : (optionEquivSumPUnit α).symm (Sum.inr a) = none

(Equiv.optionEquivSumPUnit α).symm (Sum.inr a) = none


@[simp]
theorem ofElement_top {α : Type*} (r : α → α → Prop) (a : α) : (ofElement r a).top = a

{α : Type u_4}
(r : α → α → Prop)
(a : α)


theorem dvd_of_squarefree_of_mul_dvd_mul_right (hx : Squarefree x) (h : d * d ∣ x * y) : d ∣ y

{R : Type u_1}
[CancelCommMonoidWithZero R]
{x y d : R}
[DecompositionMonoid R]
(hx : Squarefree x)
(h : d * d ∣ x * y)


/-- `disjointed f` is the unique sequence that is pairwise disjoint and has the same partial sups
as `f`. -/
theorem disjointed_unique {f d : ℕ → α} (hdisj : Pairwise (Disjoint on d))
    (hsups : partialSups d = partialSups f) : d = disjointed f

{α : Type u_1}
[GeneralizedBooleanAlgebra α]
{f d : ℕ → α}
(hdisj : Pairwise (Disjoint on d))
(hsups : partialSups d = partialSups f)


lemma setIntegral_densityProcess (hκν : fst κ ≤ ν) [IsFiniteKernel ν]
    (n : ℕ) (a : α) {s : Set β} (hs : MeasurableSet s) {A : Set γ}
    (hA : MeasurableSet[countableFiltration γ n] A) :
    ∫ x in A, densityProcess κ ν n a x s ∂(ν a) = (κ a (A ×ˢ s)).toReal

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

∫ (x : γ) in A, κ.densityProcess ν n a x s ∂ν a = ((κ a) (A ×ˢ s)).toReal


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

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


theorem cocycle_fst_snd (i j k : 𝒰.J) :
    t' 𝒰 f g i j k ≫ t' 𝒰 f g j k i ≫ t' 𝒰 f g k i j ≫ pullback.fst _ _ ≫ pullback.snd _ _ =
      pullback.fst _ _ ≫ pullback.snd _ _

[∀ (i : 𝒰.J), CategoryTheory.Limits.HasPullback (𝒰.map i ≫ f) g]

AlgebraicGeometry.Scheme.Pullback.t' 𝒰 f g i j k ≫
    AlgebraicGeometry.Scheme.Pullback.t' 𝒰 f g j k i ≫
      AlgebraicGeometry.Scheme.Pullback.t' 𝒰 f g k i j ≫
        CategoryTheory.Limits.pullback.fst (AlgebraicGeometry.Scheme.Pullback.fV 𝒰 f g i j)
            (AlgebraicGeometry.Scheme.Pullback.fV 𝒰 f g i k) ≫
          CategoryTheory.Limits.pullback.snd (CategoryTheory.Limits.pullback.fst (𝒰.map i ≫ f) g ≫ 𝒰.map i) (𝒰.map j) =
  CategoryTheory.Limits.pullback.fst (AlgebraicGeometry.Scheme.Pullback.fV 𝒰 f g i j)
      (AlgebraicGeometry.Scheme.Pullback.fV 𝒰 f g i k) ≫
    CategoryTheory.Limits.pullback.snd (CategoryTheory.Limits.pullback.fst (𝒰.map i ≫ f) g ≫ 𝒰.map i) (𝒰.map j)


lemma cast_commute (q : ℚ≥0) (a : α) : Commute (↑q) a

{α : Type u_3}
[DivisionSemiring α]
(q : ℚ≥0)
(a : α)


@[simp]
theorem bliminf_true (f : Filter β) (u : β → α) : (bliminf u f fun _ => True) = liminf u f

{α : Type u_1}
{β : Type u_2}
[ConditionallyCompleteLattice α]
(f : Filter β)
(u : β → α)

(Filter.bliminf u f fun x => True) = Filter.liminf u f


lemma cast_natAbs : (n.natAbs : R) = |n|

{R : Type u_1}
[LinearOrderedRing R]
{n : ℤ}


@[simp]
theorem coe_toAddSubmonoid (p : Submodule R M) : (p.toAddSubmonoid : Set M) = p

{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(p : Submodule R M)


theorem _root_.BoundedVariationOn.dist_le {E : Type*} [PseudoMetricSpace E] {f : α → E}
    {s : Set α} (h : BoundedVariationOn f s) {x y : α} (hx : x ∈ s) (hy : y ∈ s) :
    dist (f x) (f y) ≤ (eVariationOn f s).toReal

{α : Type u_1}
[LinearOrder α]
{E : Type u_3}
[PseudoMetricSpace E]
{f : α → E}
{s : Set α}
(h : BoundedVariationOn f s)
{x y : α}
(hx : x ∈ s)
(hy : y ∈ s)


theorem sInter_pair (s t : Set α) : ⋂₀ {s, t} = s ∩ t


@[to_additive (attr := simp)]
lemma mabs_apply (f : C(α, β)) (x : α) : |f|ₘ x = |f x|ₘ

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[TopologicalSpace β]
[Group β]
[TopologicalGroup β]
[Lattice β]
[TopologicalLattice β]
(f : C(α, β))
(x : α)


theorem uniformContinuous_const [UniformSpace β] {b : β} : UniformContinuous fun _ : α => b

{α : Type ua}
{β : Type ub}
[UniformSpace α]
[UniformSpace β]
{b : β}


/-- When passed an `Equiv.sumCongr`, `MultilinearMap.domDomCongr` distributes over
`MultilinearMap.domCoprod`. -/
theorem domCoprod_domDomCongr_sumCongr (a : MultilinearMap R (fun _ : ι₁ => N) N₁)
    (b : MultilinearMap R (fun _ : ι₂ => N) N₂) (σa : ι₁ ≃ ι₃) (σb : ι₂ ≃ ι₄) :
    (a.domCoprod b).domDomCongr (σa.sumCongr σb) =
      (a.domDomCongr σa).domCoprod (b.domDomCongr σb)

{R : Type u_1}
{ι₁ : Type u_2}
{ι₂ : Type u_3}
{ι₃ : Type u_4}
{ι₄ : Type u_5}
[CommSemiring R]
{N₁ : Type u_6}
[AddCommMonoid N₁]
[Module R N₁]
{N₂ : Type u_7}
[AddCommMonoid N₂]
[Module R N₂]
{N : Type u_8}
[AddCommMonoid N]
[Module R N]
(a : MultilinearMap R (fun x => N) N₁)
(b : MultilinearMap R (fun x => N) N₂)
(σa : ι₁ ≃ ι₃)
(σb : ι₂ ≃ ι₄)

MultilinearMap.domDomCongr (σa.sumCongr σb) (a.domCoprod b) =
  (MultilinearMap.domDomCongr σa a).domCoprod (MultilinearMap.domDomCongr σb b)


/-- If `f` is almost everywhere positive, then `μ ≪ μ.withDensity f`. See also
`withDensity_absolutelyContinuous` for the reverse direction, which always holds. -/
lemma withDensity_absolutelyContinuous' {μ : Measure α} {f : α → ℝ≥0∞}
    (hf : AEMeasurable f μ) (hf_ne_zero : ∀ᵐ x ∂μ, f x ≠ 0) :
    μ ≪ μ.withDensity f

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
(hf : AEMeasurable f μ)
(hf_ne_zero : ∀ᵐ (x : α) ∂μ, f x ≠ 0)


protected theorem Monotone.Iic (hf : Monotone f) : Monotone fun x => Iic (f x)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{f : α → β}
(hf : Monotone f)


@[to_additive]
theorem card_orderOf_eq_totient_aux₂ {d : ℕ} (hd : d ∣ Fintype.card α) :
    (univ.filter fun a : α => orderOf a = d).card = φ d

(hn : ∀ (n : ℕ), 0 < n → (Finset.filter (fun a => n • a = 0) Finset.univ).card ≤ n)

(Finset.filter (fun a => addOrderOf a = d) Finset.univ).card = d.totient


@[simp, norm_cast]
theorem coe_zero : ⇑(0 : NonarchAddGroupSeminorm E) = 0


theorem tendsto_nhdsWithin_of_tendsto_nhds_of_eventually_within {a : α} {l : Filter β} {s : Set α}
    (f : β → α) (h1 : Tendsto f l (𝓝 a)) (h2 : ∀ᶠ x in l, f x ∈ s) : Tendsto f l (𝓝[s] a)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
{a : α}
{l : Filter β}
{s : Set α}
(f : β → α)
(h1 : Filter.Tendsto f l (𝓝 a))
(h2 : ∀ᶠ (x : β) in l, f x ∈ s)


/-- First version, with pointwise equicontinuity and range in a compact space. -/
theorem arzela_ascoli₁ [CompactSpace β] (A : Set (α →ᵇ β)) (closed : IsClosed A)
    (H : Equicontinuous ((↑) : A → α → β)) : IsCompact A

(A : Set (BoundedContinuousFunction α β))


lemma Exact.map (h : S.Exact) (F : C ⥤ D)
    [F.PreservesZeroMorphisms] [F.PreservesLeftHomologyOf S]
    [F.PreservesRightHomologyOf S] : (S.map F).Exact


@[simp]
theorem decompose_symm_zero : (decompose ℳ).symm 0 = (0 : M)

{ι : Type u_1}
{M : Type u_3}
{σ : Type u_4}
[DecidableEq ι]
[AddCommMonoid M]
[SetLike σ M]
[AddSubmonoidClass σ M]
(ℳ : ι → σ)
[DirectSum.Decomposition ℳ]


theorem definable_finset_biInter {ι : Type*} {f : ι → Set (α → M)}
    (hf : ∀ i, A.Definable L (f i)) (s : Finset ι) : A.Definable L (⋂ i ∈ s, f i)

{M : Type w}
{A : Set M}
{L : FirstOrder.Language}
[L.Structure M]
{α : Type u₁}
{ι : Type u_2}
{f : ι → Set (α → M)}
(hf : ∀ (i : ι), A.Definable L (f i))
(s : Finset ι)


theorem val_injective : Injective (@val _ p)


@[to_additive]
theorem op_smul_finset_smul_eq_smul_smul_finset (a : α) (s : Finset β) (t : Finset γ)
    (h : ∀ (a : α) (b : β) (c : γ), (op a • b) • c = b • a • c) : (op a • s) • t = s • a • t

(h : ∀ (a : α) (b : β) (c : γ), AddOpposite.op a +ᵥ b +ᵥ c = b +ᵥ (a +ᵥ c))

AddOpposite.op a +ᵥ s +ᵥ t = s +ᵥ (a +ᵥ t)


@[simp]
lemma image_subtype_val_Ioc_Ioi {a b : α} (c : Ioc a b) : Subtype.val '' Ioi c = Ioc c.1 b

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

Subtype.val '' Set.Ioi c = Set.Ioc (↑c) b


@[simp]
theorem const_apply (p : P2) (q : P1) : (const k P1 p) q = p

(k : Type u_1)
{V1 : Type u_2}
(P1 : Type u_3)
{V2 : Type u_4}
{P2 : Type u_5}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
[AddCommGroup V2]
[Module k V2]
[AffineSpace V2 P2]
(p : P2)
(q : P1)


theorem Basis.addHaar_self (b : Basis ι ℝ E) : b.addHaar (_root_.parallelepiped b) = 1

{ι : Type u_1}
{E : Type u_3}
[Fintype ι]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
(b : Basis ι ℝ E)


theorem Icc_mem_nhdsWithin_Iic' (H : a < b) : Icc a b ∈ 𝓝[≤] b

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIicTopology α]
{a b : α}
(H : a < b)


/-- The constant functor followed by the evaluation functor is just the identity. -/
@[simps!]
def Functor.constCompEvaluationObj (X : C) : Functor.const C ⋙ (evaluation C D).obj X ≅ 𝟭 D

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

∀ (X_1 : D), (CategoryTheory.Functor.constCompEvaluationObj D X).hom.app X_1 = CategoryTheory.CategoryStruct.id X_1


theorem IsLimit.pos {o : Ordinal} (h : IsLimit o) : 0 < o


@[simp]
theorem numDerangements_one : numDerangements 1 = 0


/-- Define the conjugation (`star`) of a multiplicative character by conjugating pointwise. -/
@[simps!]
def starComp [StarRing R'] (χ : MulChar R R') : MulChar R R'

{R : Type u_1}
{R' : Type u_2}
[CommRing R]
[CommRing R']
[StarRing R']
(χ : MulChar R R')
(a : R)


/-- For `m ≤ n`, `(n, m)` is in the reflexive-transitive closure of `~` if `succ i ~ i`
  for all `i` between `n` and `m`. -/
theorem reflTransGen_of_succ_of_ge (r : α → α → Prop) {n m : α} (h : ∀ i ∈ Ico m n, r (succ i) i)
    (hmn : m ≤ n) : ReflTransGen r n m

(h : ∀ i ∈ Set.Ico m n, r (Order.succ i) i)


theorem eLpNormEssSup_lt_top_of_ae_bound {f : α → F} {C : ℝ} (hfC : ∀ᵐ x ∂μ, ‖f x‖ ≤ C) :
    eLpNormEssSup f μ < ∞

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
{f : α → F}
{C : ℝ}
(hfC : ∀ᵐ (x : α) ∂μ, ‖f x‖ ≤ C)


/-- A subsingleton is totally bounded. -/
lemma Set.Subsingleton.totallyBounded {s : Set α} (hs : s.Subsingleton) :
    TotallyBounded s

{α : Type u}
[uniformSpace : UniformSpace α]
{s : Set α}
(hs : s.Subsingleton)


@[simp]
theorem zero_lt_top [Zero α] [LT α] : (0 : WithTop α) < ⊤


theorem map_intCast_smul [AddCommGroup M] [AddCommGroup M₂] {F : Type*} [FunLike F M M₂]
    [AddMonoidHomClass F M M₂] (f : F) (R S : Type*) [Ring R] [Ring S] [Module R M] [Module S M₂]
    (x : ℤ) (a : M) :
    f ((x : R) • a) = (x : S) • f a

{M : Type u_5}
{M₂ : Type u_6}
[AddCommGroup M]
[AddCommGroup M₂]
{F : Type u_9}
[FunLike F M M₂]
[AddMonoidHomClass F M M₂]
(f : F)
(R : Type u_10)
(S : Type u_11)
[Ring R]
[Ring S]
[Module R M]
[Module S M₂]
(x : ℤ)
(a : M)


theorem le_of_eq_of_le {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (hb : b ≤ 0) : a + b ≤ 0

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


@[simp]
protected theorem mem_mk {t : Set (Set α)} {h₁ h₂ h₃} : s ∈ mk t h₁ h₂ h₃ ↔ s ∈ t

{h₂ : ∀ {x y : Set α}, x ∈ t → x ⊆ y → y ∈ t}

{h₃ : ∀ {x y : Set α}, x ∈ t → y ∈ t → x ∩ y ∈ t}

s ∈ { sets := t, univ_sets := h₁, sets_of_superset := h₂, inter_sets := h₃ } ↔ s ∈ t


@[simp]
theorem toFun_eq_coe (p : RingSeminorm R) : (p.toAddGroupSeminorm : R → ℝ) = p

{R : Type u_2}
[NonUnitalRing R]
(p : RingSeminorm R)


theorem compactSpace_of_finite_subfamily_closed
    (h : ∀ {ι : Type u} (t : ι → Set X), (∀ i, IsClosed (t i)) → ⋂ i, t i = ∅ →
      ∃ u : Finset ι, ⋂ i ∈ u, t i = ∅) :
    CompactSpace X

(h : ∀ {ι : Type u} (t : ι → Set X), (∀ (i : ι), IsClosed (t i)) → ⋂ i, t i = ∅ → ∃ u, ⋂ i ∈ u, t i = ∅)


@[deprecated map_multiset_prod (since := "2024-06-26")]
protected theorem map_multiset_prod (s : Multiset A) : φ s.prod = (s.map φ).prod

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


@[simp]
theorem coe_zero : ↑(0 : { p : M₀ // IsIdempotentElem p }) = (0 : M₀)


theorem inducedOuterMeasure_preimage (f : α ≃ α) (Pm : ∀ s : Set α, P (f ⁻¹' s) ↔ P s)
    (mm : ∀ (s : Set α) (hs : P s), m (f ⁻¹' s) ((Pm _).mpr hs) = m s hs) {A : Set α} :
    inducedOuterMeasure m P0 m0 (f ⁻¹' A) = inducedOuterMeasure m P0 m0 A

(PU : ∀ ⦃f : ℕ → Set α⦄, (∀ (i : ℕ), P (f i)) → P (⋃ i, f i))

(msU : ∀ ⦃f : ℕ → Set α⦄ (hm : ∀ (i : ℕ), P (f i)), m (⋃ i, f i) ⋯ ≤ ∑' (i : ℕ), m (f i) ⋯)

(m_mono : ∀ ⦃s₁ s₂ : Set α⦄ (hs₁ : P s₁) (hs₂ : P s₂), s₁ ⊆ s₂ → m s₁ hs₁ ≤ m s₂ hs₂)

(Pm : ∀ (s : Set α), P (⇑f ⁻¹' s) ↔ P s)

(mm : ∀ (s : Set α) (hs : P s), m (⇑f ⁻¹' s) ⋯ = m s hs)

(MeasureTheory.inducedOuterMeasure m P0 m0) (⇑f ⁻¹' A) = (MeasureTheory.inducedOuterMeasure m P0 m0) A


/-- If `x` and `y` are two distinct vectors of norm at most `r`, then a convex combination of `x`
and `y` with positive coefficients has norm strictly less than `r`. -/
theorem norm_combo_lt_of_ne (hx : ‖x‖ ≤ r) (hy : ‖y‖ ≤ r) (hne : x ≠ y) (ha : 0 < a) (hb : 0 < b)
    (hab : a + b = 1) : ‖a • x + b • y‖ < r

{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[StrictConvexSpace ℝ E]
{x y : E}
{a b r : ℝ}
(hx : ‖x‖ ≤ r)
(hy : ‖y‖ ≤ r)
(hne : x ≠ y)
(ha : 0 < a)
(hb : 0 < b)
(hab : a + b = 1)


/-- A function is a conformal map if and only if its differential is a conformal linear map-/
theorem conformalAt_iff_isConformalMap_fderiv {f : X → Y} {x : X} :
    ConformalAt f x ↔ IsConformalMap (fderiv ℝ f x)

{X : Type u_1}
{Y : Type u_2}
[NormedAddCommGroup X]
[NormedAddCommGroup Y]
[NormedSpace ℝ X]
[NormedSpace ℝ Y]
{f : X → Y}
{x : X}


@[simp]
theorem toReal_eq_pi_iff {θ : Angle} : θ.toReal = π ↔ θ = π


/-- If a (unital or non-unital) star ring morphism has an inverse, it is an isomorphism of
star rings. -/
@[simps]
def ofStarRingHom (f : F) (g : G) (h₁ : ∀ x, g (f x) = x) (h₂ : ∀ x, f (g x) = x) : A ≃⋆+* B

{F : Type u_1}
{G : Type u_2}
{A : Type u_3}
{B : Type u_4}
[NonUnitalNonAssocSemiring A]
[Star A]
[NonUnitalNonAssocSemiring B]
[Star B]
[FunLike F A B]
[NonUnitalRingHomClass F A B]
[NonUnitalStarRingHomClass F A B]
[FunLike G B A]
(f : F)
(g : G)
(h₁ : ∀ (x : A), g (f x) = x)
(h₂ : ∀ (x : B), f (g x) = x)
(a : A)

(StarRingEquiv.ofStarRingHom f g h₁ h₂) a = f a


@[simp]
theorem toSubalgebra_eq_top {S : StarSubalgebra R A} : S.toSubalgebra = ⊤ ↔ S = ⊤

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
{S : StarSubalgebra R A}


/-- The quotient map from an `S`-algebra to its quotient, as a homomorphism of `S`-algebras.
-/
irreducible_def mkAlgHom (s : A → A → Prop) : A →ₐ[S] RingQuot s

(S : Type u_1)
[CommSemiring S]
{A : Type u_2}
[Semiring A]
[Algebra S A]
(s : A → A → Prop)

RingQuot.mkAlgHom S s =
  let __src := RingQuot.mkRingHom s;
  { toRingHom := __src, commutes' := ⋯ }


/-- In this situation, `C` is also filtered, see
    `IsFilteredOrEmpty.of_exists_of_isFiltered_of_fullyFaithful`. -/
theorem Functor.final_of_exists_of_isFiltered_of_fullyFaithful [IsFilteredOrEmpty D] [F.Full]
    [F.Faithful] (h : ∀ d, ∃ c, Nonempty (d ⟶ F.obj c)) : Final F

(h : ∀ (d : D), ∃ c, Nonempty (d ⟶ F.obj c))


@[to_additive]
theorem mul_lt_of_lt_one_of_lt [CovariantClass α α (swap (· * ·)) (· < ·)] {a b c : α} (ha : a < 1)
    (hb : b < c) :
    a * b < c

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


lemma starOrderedRing_of_sqrt {R : Type*} [PartialOrder R] [NonUnitalRing R] [StarRing R]
    [StarOrderedRing R] [TopologicalSpace R] [ContinuousStar R] [TopologicalRing R]
    (sqrt : R → R) (h_continuousOn : ContinuousOn sqrt {x : R | 0 ≤ x})
    (h_sqrt : ∀ x, 0 ≤ x → star (sqrt x) * sqrt x = x) : StarOrderedRing C(α, R)

(h_continuousOn : ContinuousOn sqrt {x | 0 ≤ x})

(h_sqrt : ∀ (x : R), 0 ≤ x → star (sqrt x) * sqrt x = x)


@[simp, norm_cast]
theorem coe_sSup (S : Set (LowerSet α)) : (↑(sSup S) : Set α) = ⋃ s ∈ S, ↑s

{α : Type u_1}
[LE α]
(S : Set (LowerSet α))


@[ext]
theorem ext ⦃f g : LocallyConstant X Y⦄ (h : ∀ x, f x = g x) : f = g

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


theorem _root_.StrictMonoOn.mono (h : StrictMonoOn f s) (h' : s₂ ⊆ s) : StrictMonoOn f s₂

{α : Type u_1}
{β : Type u_2}
{s s₂ : Set α}
{f : α → β}
[Preorder α]
[Preorder β]
(h : StrictMonoOn f s)
(h' : s₂ ⊆ s)


theorem pred'_to_nat : ∀ n, (pred' n : ℕ) = Nat.pred n


/-- If `c • x ∈ s` and `c ≠ 0`, then `egauge 𝕜 s x` is at most `((‖c‖₊⁻¹ : ℝ≥0) : ℝ≥0∞).

See also `egauge_le_of_smul_mem`. -/
lemma egauge_le_of_smul_mem_of_ne (h : c • x ∈ s) (hc : c ≠ 0) :
    egauge 𝕜 s x ≤ ↑(‖c‖₊⁻¹ : ℝ≥0)

{𝕜 : Type u_1}
[NormedDivisionRing 𝕜]
{E : Type u_3}
[AddCommGroup E]
[Module 𝕜 E]
{c : 𝕜}
{s : Set E}
{x : E}
(h : c • x ∈ s)
(hc : c ≠ 0)


@[to_additive]
theorem map_inv₂ {_ : Group M} {_ : MulOneClass N} {_ : CommGroup P} (f : M →* N →* P) (m : M)
    (n : N) : f m⁻¹ n = (f m n)⁻¹

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

∀ {x : AddGroup M} {x_1 : AddZeroClass N} {x_2 : AddCommGroup P} (f : M →+ N →+ P) (m : M) (n : N),
  (f (-m)) n = -(f m) n


@[simp, norm_cast]
theorem coe_inter (s₁ s₂ : Finset α) : ↑(s₁ ∩ s₂) = (s₁ ∩ s₂ : Set α)

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

↑(s₁ ∩ s₂) = ↑s₁ ∩ ↑s₂


/-- A smooth manifold with `0` and `Inv` such that `fun x ↦ x⁻¹` is smooth at all nonzero points.
Any complete normed (semi)field has this property. -/
class SmoothInv₀ {𝕜 : Type*} [NontriviallyNormedField 𝕜] {H : Type*} [TopologicalSpace H]
    {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] (I : ModelWithCorners 𝕜 E H) (G : Type*)
    [Inv G] [Zero G] [TopologicalSpace G] [ChartedSpace H G] : Prop where
  /-- Inversion is smooth away from `0`. -/
  smoothAt_inv₀ : ∀ ⦃x : G⦄, x ≠ 0 → SmoothAt I I (fun y ↦ y⁻¹) x

{𝕜 : 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}
[Inv G]
[Zero G]
[TopologicalSpace G]
[ChartedSpace H G]
[self : SmoothInv₀ I G]
⦃x : G⦄


theorem eq_of_inner_right (hK : Dense (K : Set E)) (h : ∀ v : K, ⟪(v : E), x⟫ = ⟪(v : E), y⟫) :
    x = y

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{K : Submodule 𝕜 E}
{x y : E}
(hK : Dense ↑K)
(h : ∀ (v : ↥K), ⟪↑v, x⟫_𝕜 = ⟪↑v, y⟫_𝕜)


theorem induction_on' {p : Multiset α → Prop} (S : Multiset α) (h₁ : p 0)
    (h₂ : ∀ {a s}, a ∈ S → s ⊆ S → p s → p (insert a s)) : p S

(h₂ : ∀ {a : α} {s : Multiset α}, a ∈ S → s ⊆ S → p s → p (insert a s))


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

∀ {X₁ Y₁ X₂ Y₂ : CategoryTheory.Dial C} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂),
  (CategoryTheory.MonoidalCategory.tensorHom f g).F =
    CategoryTheory.Limits.prod.lift
      (CategoryTheory.CategoryStruct.comp
        (CategoryTheory.Limits.prod.map CategoryTheory.Limits.prod.fst CategoryTheory.Limits.prod.fst) f.F)
      (CategoryTheory.CategoryStruct.comp
        (CategoryTheory.Limits.prod.map CategoryTheory.Limits.prod.snd CategoryTheory.Limits.prod.snd) g.F)


@[mono]
protected lemma Connected.mono {H H' : G.Subgraph} (hle : H ≤ H') (hv : H.verts = H'.verts)
    (h : H.Connected) : H'.Connected

{V : Type u}
{G : SimpleGraph V}
{H H' : G.Subgraph}
(hle : H ≤ H')
(hv : H.verts = H'.verts)
(h : H.Connected)


/--
This is a proof that the number produced using `psp_from_prime` is greater than the prime `p` used
to create it. The primary purpose of this lemma is to help prove `exists_infinite_pseudoprimes`.
-/
private theorem psp_from_prime_gt_p {b : ℕ} (b_ge_two : 2 ≤ b) {p : ℕ} (p_prime : p.Prime)
    (p_gt_two : 2 < p) : p < psp_from_prime b p

{b : ℕ}
(b_ge_two : 2 ≤ b)
{p : ℕ}
(p_prime : Nat.Prime p)
(p_gt_two : 2 < p)


/-- Euler's product formula for the totient function. -/
theorem totient_mul_prod_primeFactors (n : ℕ) :
    (φ n * ∏ p ∈ n.primeFactors, p) = n * ∏ p ∈ n.primeFactors, (p - 1)

n.totient * ∏ p ∈ n.primeFactors, p = n * ∏ p ∈ n.primeFactors, (p - 1)


theorem _root_.LinearMap.compQuadraticMap_polar [CommSemiring S] [Algebra S R] [Module S N]
    [Module S N'] [IsScalarTower S R N] [Module S M] [IsScalarTower S R M] (f : N →ₗ[S] N')
    (Q : QuadraticMap R M N) (x y : M) : polar (f.compQuadraticMap' Q) x y = f (polar Q x y)

{S : Type u_1}
{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
{N' : Type u_8}
[AddCommGroup N']
[CommSemiring S]
[Algebra S R]
[Module S N]
[Module S N']
[IsScalarTower S R N]
[Module S M]
[IsScalarTower S R M]
(f : N →ₗ[S] N')
(Q : QuadraticMap R M N)
(x y : M)

QuadraticMap.polar (⇑(f.compQuadraticMap' Q)) x y = f (QuadraticMap.polar (⇑Q) x y)


@[to_additive]
theorem prod_finprod_comm (s : Finset α) (f : α → β → M) (h : ∀ a ∈ s, (mulSupport (f a)).Finite) :
    (∏ a ∈ s, ∏ᶠ b : β, f a b) = ∏ᶠ b : β, ∏ a ∈ s, f a b

(h : ∀ a ∈ s, (Function.mulSupport (f a)).Finite)

∏ a ∈ s, ∏ᶠ (b : β), f a b = ∏ᶠ (b : β), ∏ a ∈ s, f a b


/-- Since the inclusion `(P^(i + 1) / P^e) ⊂ (P^i / P^e)` has a kernel isomorphic to `P / S`,
`[P^i / P^e : R / p] = [P^(i+1) / P^e : R / p] + [P / S : R / p]` -/
theorem rank_pow_quot_aux [IsDedekindDomain S] [p.IsMaximal] [P.IsPrime] (hP0 : P ≠ ⊥)
    {i : ℕ} (hi : i < e) :
    Module.rank (R ⧸ p) (Ideal.map (Ideal.Quotient.mk (P ^ e)) (P ^ i)) =
      Module.rank (R ⧸ p) (S ⧸ P) +
        Module.rank (R ⧸ p) (Ideal.map (Ideal.Quotient.mk (P ^ e)) (P ^ (i + 1)))

[hfp : NeZero (Ideal.ramificationIdx f p P)]

Module.rank (R ⧸ p) ↥(Ideal.map (Ideal.Quotient.mk (P ^ Ideal.ramificationIdx f p P)) (P ^ i)) =
  Module.rank (R ⧸ p) (S ⧸ P) +
    Module.rank (R ⧸ p) ↥(Ideal.map (Ideal.Quotient.mk (P ^ Ideal.ramificationIdx f p P)) (P ^ (i + 1)))


/-- Every point is covered by chosen balls, before `p.lastStep`. -/
theorem mem_iUnionUpTo_lastStep (x : β) : p.c x ∈ p.iUnionUpTo p.lastStep

{α : Type u_1}
[MetricSpace α]
{β : Type u}
[Nonempty β]
(p : Besicovitch.TauPackage β α)
(x : β)


/-- The set of differentiability points of a function taking values in a complete space is
Borel-measurable. -/
theorem measurableSet_of_differentiableAt : MeasurableSet { x | DifferentiableAt 𝕜 f x }

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(f : E → F)
[MeasurableSpace E]
[OpensMeasurableSpace E]
[CompleteSpace F]

MeasurableSet {x | DifferentiableAt 𝕜 f x}


theorem nodupKeys_singleton (s : Sigma β) : NodupKeys [s]

{α : Type u}
{β : α → Type v}
(s : Sigma β)


theorem Basis.card_le_card_of_le {N O : Submodule R M} (hNO : N ≤ O) [Fintype ι] (b : Basis ι R O)
    [Fintype ι'] (b' : Basis ι' R N) : Fintype.card ι' ≤ Fintype.card ι

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
{ι : Type w}
{ι' : Type w'}
[StrongRankCondition R]
{N O : Submodule R M}
(hNO : N ≤ O)
[Fintype ι]
(b : Basis ι R ↥O)
[Fintype ι']
(b' : Basis ι' R ↥N)


theorem sublistsLen_of_length_lt {n} {l : List α} (h : l.length < n) : sublistsLen n l = []

{α : Type u}
{n : ℕ}
{l : List α}
(h : l.length < n)


theorem not_secondCountableTopology_opc : ¬SecondCountableTopology ℚ∞


/-- A natural isomorphism `R₁ ≅ R₂` induces an equivalence of categories
    `Comma L R₁ ≌ Comma L R₂`. -/
@[simps!]
def mapRightIso (i : R₁ ≅ R₂) : Comma L R₁ ≌ Comma L R₂

{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₁ R₂ : CategoryTheory.Functor B T}
(i : R₁ ≅ R₂)
(X : CategoryTheory.Comma L R₂)

((CategoryTheory.Comma.mapRightIso L i).counitIso.inv.app X).right = CategoryTheory.CategoryStruct.id X.right


/-- The counit for the equivalence `Mon_ (C ⥤ D) ≌ C ⥤ Mon_ D`.
-/
@[simps!]
def counitIso : inverse ⋙ functor ≅ 𝟭 (C ⥤ Comon_ D)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
[CategoryTheory.MonoidalCategory D]
(X : C ⥤ Comon_ D)

∀ (X_1 : C),
  ((CategoryTheory.Monoidal.ComonFunctorCategoryEquivalence.counitIso.inv.app X).app X_1).hom = 𝟙 (X.obj X_1).X


theorem add_succ (o₁ o₂ : Ordinal) : o₁ + succ o₂ = succ (o₁ + o₂)

o₁ + Order.succ o₂ = Order.succ (o₁ + o₂)


@[simp]
theorem sizeUpTo_length : c.sizeUpTo c.length = n


theorem le_iff {f g : Filter α} (F : f.Realizer) (G : g.Realizer) :
    f ≤ g ↔ ∀ b : G.σ, ∃ a : F.σ, F.F a ≤ G.F b

{α : Type u_1}
{f g : Filter α}
(F : f.Realizer)
(G : g.Realizer)

f ≤ g ↔ ∀ (b : G.σ), ∃ a, F.F.f a ≤ G.F.f b


theorem exists_mem_of_not_isUnit_aeval_prod [IsDomain R] {p : R[X]} {a : A}
    (h : ¬IsUnit (aeval a (Multiset.map (fun x : R => X - C x) p.roots).prod)) :
    ∃ k : R, k ∈ σ a ∧ eval k p = 0

(h : ¬IsUnit ((Polynomial.aeval a) (Multiset.map (fun x => Polynomial.X - Polynomial.C x) p.roots).prod))

∃ k ∈ spectrum R a, Polynomial.eval k p = 0


/-- `GroupNormClass F α` states that `F` is a type of `β`-valued norms on the group `α`.

You should extend this class when you extend `GroupNorm`. -/
@[to_additive]
class GroupNormClass (F α β : Type*) [Group α] [OrderedAddCommMonoid β] [FunLike F α β]
  extends GroupSeminormClass F α β : Prop where
  /-- The argument is one if its image under the map is zero. -/
  eq_one_of_map_eq_zero (f : F) {a : α} : f a = 0 → a = 1

{F : Type u_7}
{α : Type u_8}
{β : Type u_9}
[Group α]
[OrderedAddCommMonoid β]
[FunLike F α β]
[self : GroupNormClass F α β]
(f : F)
{a : α}


theorem directed : DirectedOn (· ≥ ·) (F : Set P)

{P : Type u_1}
[Preorder P]
(F : Order.PFilter P)


@[to_additive]
lemma mulSupport_inf [SemilatticeInf M] (f g : α → M) :
    mulSupport (fun x ↦ f x ⊓ g x) ⊆ mulSupport f ∪ mulSupport g

{α : Type u_2}
{M : Type u_4}
[Zero M]
[SemilatticeInf M]
(f g : α → M)

(Function.support fun x => f x ⊓ g x) ⊆ Function.support f ∪ Function.support g


@[to_additive]
theorem card_comap_dvd_of_injective (K : Subgroup H) (f : α →* H)
    (hf : Function.Injective f) : Nat.card (K.comap f) ∣ Nat.card K

{α : Type u_1}
[Group α]
{H : Type u_2}
[Group H]
(K : Subgroup H)
(f : α →* H)
(hf : Function.Injective ⇑f)

Nat.card ↥(Subgroup.comap f K) ∣ Nat.card ↥K


/-- The `ratio` is equal to the distance ratio for any two points
with nonzero finite distance; `nndist` version -/
theorem ratio_unique_of_nndist_ne_zero {α β F : Type*} [PseudoMetricSpace α] [PseudoMetricSpace β]
    [FunLike F α β] [DilationClass F α β] {f : F} {x y : α} {r : ℝ≥0} (hxy : nndist x y ≠ 0)
    (hr : nndist (f x) (f y) = r * nndist x y) : r = ratio f


theorem measurable_prod_mk_left {x : α} : Measurable (@Prod.mk _ β x)

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{mβ : MeasurableSpace β}
{x : α}


@[to_additive]
protected theorem HasProd.map [CommMonoid γ] [TopologicalSpace γ] (hf : HasProd f a) {G}
    [FunLike G α γ] [MonoidHomClass G α γ] (g : G) (hg : Continuous g) :
    HasProd (g ∘ f) (g a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β → α}
{a : α}
[AddCommMonoid γ]
[TopologicalSpace γ]
(hf : HasSum f a)
{G : Type u_5}
[FunLike G α γ]
[AddMonoidHomClass G α γ]
(g : G)
(hg : Continuous ⇑g)


@[simp] theorem recDiagAux_zero_left {motive : Nat → Nat → Sort _}
    (zero_left : ∀ n, motive 0 n) (zero_right : ∀ m, motive m 0)
    (succ_succ : ∀ m n, motive m n → motive (m+1) (n+1)) (n) :
    Nat.recDiagAux zero_left zero_right succ_succ 0 n = zero_left n

(succ_succ : (m n : Nat) → motive m n → motive (m + 1) (n + 1))


lemma map_apply₀ {f : α → β} (hf : AEMeasurable f μ) {s : Set β}
    (hs : NullMeasurableSet s (map f μ)) : μ.map f s = μ (f ⁻¹' s)

(hs : MeasureTheory.NullMeasurableSet s (MeasureTheory.Measure.map f μ))

(MeasureTheory.Measure.map f μ) s = μ (f ⁻¹' s)


@[to_additive (attr := fun_prop) ContinuousAt.norm]
theorem ContinuousAt.norm' {a : α} (h : ContinuousAt f a) : ContinuousAt (fun x => ‖f x‖) a

{α : Type u_3}
{E : Type u_6}
[SeminormedGroup E]
[TopologicalSpace α]
{f : α → E}
{a : α}
(h : ContinuousAt f a)


@[to_additive]
theorem nhds_translation_mul_inv (x : G) : comap (· * x⁻¹) (𝓝 1) = 𝓝 x

{G : Type w}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
(x : G)

Filter.comap (fun x_1 => x_1 * x⁻¹) (𝓝 1) = 𝓝 x


theorem map_extChartAt_nhds' {x y : M} (hy : y ∈ (extChartAt I x).source) :
    map (extChartAt I x) (𝓝 y) = 𝓝[range I] extChartAt I x y

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(I : ModelWithCorners 𝕜 E H)
[ChartedSpace H M]
{x y : M}
(hy : y ∈ (extChartAt I x).source)

Filter.map (↑(extChartAt I x)) (𝓝 y) = 𝓝[Set.range ↑I] ↑(extChartAt I x) y


theorem UpperSemicontinuousOn.upperSemicontinuousWithinAt (h : UpperSemicontinuousOn f s)
    (hx : x ∈ s) : UpperSemicontinuousWithinAt f s x

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[Preorder β]
{f : α → β}
{x : α}
{s : Set α}
(h : UpperSemicontinuousOn f s)
(hx : x ∈ s)


theorem isCoprime_group_smul : IsCoprime (x • y) (x • z) ↔ IsCoprime y z

{R : Type u_1}
{G : Type u_2}
[CommSemiring R]
[Group G]
[MulAction G R]
[SMulCommClass G R R]
[IsScalarTower G R R]
(x : G)
(y z : R)


theorem mem_left_iff_eq_zero_of_disjoint {p p' : Submodule R M} (h : Disjoint p p') {x : p'} :
    (x : M) ∈ p ↔ x = 0

{R : Type u_1}
{M : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{p p' : Submodule R M}
(h : Disjoint p p')
{x : ↥p'}


theorem iInf_mul_right' {ι} {f : ι → ℝ≥0∞} {a : ℝ≥0∞} (h : a = ∞ → ⨅ i, f i = 0 → ∃ i, f i = 0)
    (h0 : a = 0 → Nonempty ι) : ⨅ i, f i * a = (⨅ i, f i) * a

{f : ι → ℝ≥0∞}

(h : a = ⊤ → ⨅ i, f i = 0 → ∃ i, f i = 0)


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

(↑(AddSubgroup.zmultiples a)).Infinite ↔ ¬IsOfFinAddOrder a


/-- Inverses of elements of finite order have finite order. -/
@[to_additive (attr := simp) "Inverses of elements of finite additive order
have finite additive order."]
theorem isOfFinOrder_inv_iff {x : G} : IsOfFinOrder x⁻¹ ↔ IsOfFinOrder x

IsOfFinAddOrder (-x) ↔ IsOfFinAddOrder x


@[simp]
theorem divp_self (u : αˣ) : (u : α) /ₚ u = 1


theorem union_inter_distrib_right (s t u : Finset α) : (s ∪ t) ∩ u = s ∩ u ∪ t ∩ u

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


/--
An object `P` is called *projective* if every morphism out of `P` factors through every epimorphism.
-/
class Projective (P : C) : Prop where
  factors : ∀ {E X : C} (f : P ⟶ X) (e : E ⟶ X) [Epi e], ∃ f', f' ≫ e = f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{P : C}
[self : CategoryTheory.Projective P]
{E X : C}
(f : P ⟶ X)
(e : E ⟶ X)
[CategoryTheory.Epi e]


@[simp]
theorem testAgainstNN_zero (μ : FiniteMeasure Ω) : μ.testAgainstNN 0 = 0

{Ω : Type u_1}
[MeasurableSpace Ω]
[TopologicalSpace Ω]
(μ : MeasureTheory.FiniteMeasure Ω)


protected theorem «exists» {p : G.ConnectedComponent → Prop} :
    (∃ c : G.ConnectedComponent, p c) ↔ ∃ v, p (G.connectedComponentMk v)

{V : Type u}
{G : SimpleGraph V}
{p : G.ConnectedComponent → Prop}

(∃ c, p c) ↔ ∃ v, p (G.connectedComponentMk v)


/-- Equivalence between `Fin (n + 1) → β` and `β × (Fin n → β)`. -/
@[simps! (config := .asFn)]
def Equiv.piFinSucc (n : ℕ) (β : Type u) : (Fin (n + 1) → β) ≃ β × (Fin n → β)

⇑(Equiv.piFinSucc n β) = fun f => (f 0, Fin.tail f)


@[simp] lemma to_WithLower_symm_eq : (@toLower α).symm = ofLower


/-- The image of a subsingleton is a subsingleton. -/
theorem Subsingleton.image (hs : s.Subsingleton) (f : α → β) : (f '' s).Subsingleton

{α : Type u_1}
{β : Type u_2}
{s : Set α}
(hs : s.Subsingleton)
(f : α → β)


@[simp] lemma infs_singleton : s ⊼ {b} = s.image (· ⊓ b)

{α : Type u_2}
[DecidableEq α]
[SemilatticeInf α]
{s : Finset α}
{b : α}

s ⊼ {b} = Finset.image (fun x => x ⊓ b) s


theorem divisor_le {m : ℕ} : n ∈ divisors m → n ≤ m


@[simp]
theorem hasseDualIso_symm_apply (a : α) : hasseDualIso.symm a = toDual a

SimpleGraph.hasseDualIso.symm a = OrderDual.toDual a


theorem count_self [Nontrivial α] [DecidableEq (Associates α)] {p : Associates α}
    (hp : Irreducible p) : p.count p.factors = 1

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


lemma SupClosed.directedOn (hs : SupClosed s) : DirectedOn (· ≤ ·) s

{α : Type u_2}
[SemilatticeSup α]
{s : Set α}
(hs : SupClosed s)


theorem prod_ofNat_val (n : ℕ) :
    ofNat (α × β) n = (ofNat α (unpair n).1, ofNat β (unpair n).2)

{α : Type u_1}
{β : Type u_2}
[Denumerable α]
[Denumerable β]
(n : ℕ)

Denumerable.ofNat (α × β) n = (Denumerable.ofNat α (Nat.unpair n).1, Denumerable.ofNat β (Nat.unpair n).2)


theorem condCount_inter' (hs : s.Finite) :
    condCount s (t ∩ u) = condCount (s ∩ u) t * condCount s u

{Ω : Type u_1}
[MeasurableSpace Ω]
[MeasurableSingletonClass Ω]
{s t u : Set Ω}
(hs : s.Finite)

(ProbabilityTheory.condCount s) (t ∩ u) = (ProbabilityTheory.condCount (s ∩ u)) t * (ProbabilityTheory.condCount s) u


@[simp]
theorem antidiagonalTuple_zero_zero : antidiagonalTuple 0 0 = [![]]


lemma isRightDerivabilityStructure_iff [Φ.HasRightResolutions] (e : Φ.functor ⋙ L₂ ≅ L₁ ⋙ F) :
    Φ.IsRightDerivabilityStructure ↔ TwoSquare.GuitartExact e.hom

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

(Φ : CategoryTheory.LocalizerMorphism W₁ W₂)

Φ.IsRightDerivabilityStructure ↔ CategoryTheory.TwoSquare.GuitartExact e.hom


lemma findGreatest_mono [DecidablePred Q] (hPQ : ∀ n, P n → Q n) (hmn : m ≤ n) :
    Nat.findGreatest P m ≤ Nat.findGreatest Q n

{m : ℕ}
{P Q : ℕ → Prop}
[DecidablePred P]
{n : ℕ}
[DecidablePred Q]
(hPQ : ∀ (n : ℕ), P n → Q n)
(hmn : m ≤ n)


theorem mul_le_iff_le_inv {a b r : ℝ≥0∞} (hr₀ : r ≠ 0) (hr₁ : r ≠ ∞) : r * a ≤ b ↔ a ≤ r⁻¹ * b

{a b r : ENNReal}
(hr₀ : r ≠ 0)
(hr₁ : r ≠ ⊤)


theorem preimage_emetric_closedBall (h : Isometry f) (x : α) (r : ℝ≥0∞) :
    f ⁻¹' EMetric.closedBall (f x) r = EMetric.closedBall x r

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{f : α → β}
(h : Isometry f)
(x : α)
(r : ℝ≥0∞)


theorem antilipschitzWith_lineMap {p₁ p₂ : Q} (h : p₁ ≠ p₂) :
    AntilipschitzWith (nndist p₁ p₂)⁻¹ (lineMap p₁ p₂ : 𝕜 → Q)

{W : Type u_4}
{Q : Type u_5}
[NormedAddCommGroup W]
[MetricSpace Q]
[NormedAddTorsor W Q]
{𝕜 : Type u_6}
[NormedField 𝕜]
[NormedSpace 𝕜 W]
{p₁ p₂ : Q}
(h : p₁ ≠ p₂)

AntilipschitzWith (nndist p₁ p₂)⁻¹ ⇑(AffineMap.lineMap p₁ p₂)


theorem eq_pow_of_mul_eq_pow_odd {a b c : ℤ} (hab : IsCoprime a b) {k : ℕ} (hk : Odd k)
    (h : a * b = c ^ k) : (∃ d, a = d ^ k) ∧ ∃ e, b = e ^ k


theorem sin_eq_neg_one_iff {x : ℂ} : sin x = -1 ↔ ∃ k : ℤ, -(π / 2) + k * (2 * π) = x

Complex.sin x = -1 ↔ ∃ k, -(↑Real.pi / 2) + ↑k * (2 * ↑Real.pi) = x


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

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


/-- The isomorphism obtained from an isomorphism in the opposite category. -/
@[simps]
def unop {X Y : Cᵒᵖ} (f : X ≅ Y) : Y.unop ≅ X.unop

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


@[simp, fun_prop]
theorem Differentiable.prod (hf₁ : Differentiable 𝕜 f₁) (hf₂ : Differentiable 𝕜 f₂) :
    Differentiable 𝕜 fun x : E => (f₁ x, 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]
{f₁ : E → F}
{f₂ : E → G}
(hf₁ : Differentiable 𝕜 f₁)
(hf₂ : Differentiable 𝕜 f₂)


lemma comap_smul {f : F →+* K} : (σ • w).comap f = w.comap (RingHom.comp σ.symm f)

{k : Type u_1}
[Field k]
{K : Type u_2}
[Field K]
{F : Type u_3}
[Field F]
[Algebra k K]
(σ : K ≃ₐ[k] K)
(w : NumberField.InfinitePlace K)
{f : F →+* K}

(σ • w).comap f = w.comap ((↑σ.symm).comp f)


@[simp]
theorem coe_const (p : P2) : ⇑(const k P1 p) = Function.const P1 p

(k : Type u_1)
{V1 : Type u_2}
(P1 : Type u_3)
{V2 : Type u_4}
{P2 : Type u_5}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
[AddCommGroup V2]
[Module k V2]
[AffineSpace V2 P2]
(p : P2)

⇑(AffineMap.const k P1 p) = Function.const P1 p


/-- In a bicategory, we can compose the 1-morphisms `f : a ⟶ b` and `g : b ⟶ c` to obtain
a 1-morphism `f ≫ g : a ⟶ c`. This composition does not need to be strictly associative,
but there is a specified associator, `α_ f g h : (f ≫ g) ≫ h ≅ f ≫ (g ≫ h)`.
There is an identity 1-morphism `𝟙 a : a ⟶ a`, with specified left and right unitor
isomorphisms `λ_ f : 𝟙 a ≫ f ≅ f` and `ρ_ f : f ≫ 𝟙 a ≅ f`.
These associators and unitors satisfy the pentagon and triangle equations.

See https://ncatlab.org/nlab/show/bicategory.
-/
@[nolint checkUnivs]
class Bicategory (B : Type u) extends CategoryStruct.{v} B where
  -- category structure on the collection of 1-morphisms:
  homCategory : ∀ a b : B, Category.{w} (a ⟶ b) := by infer_instance
  -- left whiskering:
  whiskerLeft {a b c : B} (f : a ⟶ b) {g h : b ⟶ c} (η : g ⟶ h) : f ≫ g ⟶ f ≫ h
  -- right whiskering:
  whiskerRight {a b c : B} {f g : a ⟶ b} (η : f ⟶ g) (h : b ⟶ c) : f ≫ h ⟶ g ≫ h
  -- associator:
  associator {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d) : (f ≫ g) ≫ h ≅ f ≫ g ≫ h
  -- left unitor:
  leftUnitor {a b : B} (f : a ⟶ b) : 𝟙 a ≫ f ≅ f
  -- right unitor:
  rightUnitor {a b : B} (f : a ⟶ b) : f ≫ 𝟙 b ≅ f
  -- axioms for left whiskering:
  whiskerLeft_id : ∀ {a b c} (f : a ⟶ b) (g : b ⟶ c), whiskerLeft f (𝟙 g) = 𝟙 (f ≫ g) := by
    aesop_cat
  whiskerLeft_comp :
    ∀ {a b c} (f : a ⟶ b) {g h i : b ⟶ c} (η : g ⟶ h) (θ : h ⟶ i),
      whiskerLeft f (η ≫ θ) = whiskerLeft f η ≫ whiskerLeft f θ := by
    aesop_cat
  id_whiskerLeft :
    ∀ {a b} {f g : a ⟶ b} (η : f ⟶ g),
      whiskerLeft (𝟙 a) η = (leftUnitor f).hom ≫ η ≫ (leftUnitor g).inv := by
    aesop_cat
  comp_whiskerLeft :
    ∀ {a b c d} (f : a ⟶ b) (g : b ⟶ c) {h h' : c ⟶ d} (η : h ⟶ h'),
      whiskerLeft (f ≫ g) η =
        (associator f g h).hom ≫ whiskerLeft f (whiskerLeft g η) ≫ (associator f g h').inv := by
    aesop_cat
  -- axioms for right whiskering:
  id_whiskerRight : ∀ {a b c} (f : a ⟶ b) (g : b ⟶ c), whiskerRight (𝟙 f) g = 𝟙 (f ≫ g) := by
    aesop_cat
  comp_whiskerRight :
    ∀ {a b c} {f g h : a ⟶ b} (η : f ⟶ g) (θ : g ⟶ h) (i : b ⟶ c),
      whiskerRight (η ≫ θ) i = whiskerRight η i ≫ whiskerRight θ i := by
    aesop_cat
  whiskerRight_id :
    ∀ {a b} {f g : a ⟶ b} (η : f ⟶ g),
      whiskerRight η (𝟙 b) = (rightUnitor f).hom ≫ η ≫ (rightUnitor g).inv := by
    aesop_cat
  whiskerRight_comp :
    ∀ {a b c d} {f f' : a ⟶ b} (η : f ⟶ f') (g : b ⟶ c) (h : c ⟶ d),
      whiskerRight η (g ≫ h) =
        (associator f g h).inv ≫ whiskerRight (whiskerRight η g) h ≫ (associator f' g h).hom := by
    aesop_cat
  -- associativity of whiskerings:
  whisker_assoc :
    ∀ {a b c d} (f : a ⟶ b) {g g' : b ⟶ c} (η : g ⟶ g') (h : c ⟶ d),
      whiskerRight (whiskerLeft f η) h =
        (associator f g h).hom ≫ whiskerLeft f (whiskerRight η h) ≫ (associator f g' h).inv := by
    aesop_cat
  -- exchange law of left and right whiskerings:
  whisker_exchange :
    ∀ {a b c} {f g : a ⟶ b} {h i : b ⟶ c} (η : f ⟶ g) (θ : h ⟶ i),
      whiskerLeft f θ ≫ whiskerRight η i = whiskerRight η h ≫ whiskerLeft g θ := by
    aesop_cat
  -- pentagon identity:
  pentagon :
    ∀ {a b c d e} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d) (i : d ⟶ e),
      whiskerRight (associator f g h).hom i ≫
          (associator f (g ≫ h) i).hom ≫ whiskerLeft f (associator g h i).hom =
        (associator (f ≫ g) h i).hom ≫ (associator f g (h ≫ i)).hom := by
    aesop_cat
  -- triangle identity:
  triangle :
    ∀ {a b c} (f : a ⟶ b) (g : b ⟶ c),
      (associator f (𝟙 b) g).hom ≫ whiskerLeft f (leftUnitor g).hom
      = whiskerRight (rightUnitor f).hom g := by
    aesop_cat

{B : Type u}
[self : CategoryTheory.Bicategory B]
{a b c : B}
{f g : a ⟶ b}
{h i : b ⟶ c}
(η : f ⟶ g)
(θ : h ⟶ i)

CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerLeft f θ)
    (CategoryTheory.Bicategory.whiskerRight η i) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight η h)
    (CategoryTheory.Bicategory.whiskerLeft g θ)


theorem natDegree_X_pow_add_C {n : ℕ} {r : R} : (X ^ n + C r).natDegree = n

{R : Type u}
[Nontrivial R]
[Semiring R]
{n : ℕ}
{r : R}

(Polynomial.X ^ n + Polynomial.C r).natDegree = n


@[simp]
theorem prodZeroIso_iso_inv_snd (X : C) : (prodZeroIso X).inv ≫ prod.fst = 𝟙 X

(CategoryTheory.Limits.prodZeroIso X).inv ≫ CategoryTheory.Limits.prod.fst = 𝟙 X


/-- Let `μ` be a σ-finite left invariant measure on `G`. Then `μ` is equal to the Haar measure
defined by `K₀` iff `μ K₀ = 1`. -/
@[to_additive]
theorem haarMeasure_eq_iff (K₀ : PositiveCompacts G) (μ : Measure G) [SigmaFinite μ]
    [IsMulLeftInvariant μ] :
    haarMeasure K₀ = μ ↔ μ K₀ = 1

(K₀ : TopologicalSpace.PositiveCompacts G)

MeasureTheory.Measure.addHaarMeasure K₀ = μ ↔ μ ↑K₀ = 1


theorem openEmbedding_of_continuous_injective_open
    (h₁ : Continuous f) (h₂ : Injective f) (h₃ : IsOpenMap f) : OpenEmbedding f

{X : Type u_1}
{Y : Type u_2}
{f : X → Y}
[TopologicalSpace X]
[TopologicalSpace Y]
(h₁ : Continuous f)
(h₂ : Function.Injective f)
(h₃ : IsOpenMap f)


theorem IsIntegral.mem_span_pow [Nontrivial R] {x y : S} (hx : IsIntegral R x)
    (hy : ∃ f : R[X], y = aeval x f) :
    y ∈ Submodule.span R (Set.range fun i : Fin (minpoly R x).natDegree => x ^ (i : ℕ))

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[Ring S]
[Algebra R S]
[Nontrivial R]
{x y : S}
(hx : IsIntegral R x)
(hy : ∃ f, y = (Polynomial.aeval x) f)

y ∈ Submodule.span R (Set.range fun i => x ^ ↑i)


@[simp, nolint simpNF] -- Porting note: linter claims that LHS doesn't simplify. It does.
theorem tendsto_comp_val_Iic_atBot [SemilatticeInf α] {a : α} {f : α → β} {l : Filter β} :
    Tendsto (fun x : Iic a => f x) atBot l ↔ Tendsto f atBot l

{α : Type u_3}
{β : Type u_4}
[SemilatticeInf α]
{a : α}
{f : α → β}
{l : Filter β}

Filter.Tendsto (fun x => f ↑x) Filter.atBot l ↔ Filter.Tendsto f Filter.atBot l


theorem pi_apply {ι' : Type*} {M' : ι' → Type*} [∀ i, AddCommMonoid (M' i)]
    [∀ i, TopologicalSpace (M' i)] [∀ i, Module R (M' i)]
    (f : ∀ i, ContinuousMultilinearMap R M₁ (M' i)) (m : ∀ i, M₁ i) (j : ι') : pi f m j = f j m

(f : (i : ι') → ContinuousMultilinearMap R M₁ (M' i))

(ContinuousMultilinearMap.pi f) m j = (f j) m


lemma measurable_set_iff : Measurable g ↔ ∀ a, Measurable fun x ↦ a ∈ g x

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace β]
{g : β → Set α}

Measurable g ↔ ∀ (a : α), Measurable fun x => a ∈ g x


@[deprecated getElem?_map (since := "2024-06-12")]
theorem get?_map (f : α → β) : ∀ l n, (map f l).get? n = (l.get? n).map f

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

(List.map f l).get? n = Option.map f (l.get? n)


@[simp]
theorem compLinearMap_zero [Nonempty ι] (f : M [⋀^ι]→ₗ[R] N) :
    f.compLinearMap (0 : M₂ →ₗ[R] M) = 0

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_7}
{M₂ : Type u_10}
[AddCommMonoid M₂]
[Module R M₂]
[Nonempty ι]
(f : M [⋀^ι]→ₗ[R] N)


theorem iterateFrobenius_zero_apply : iterateFrobenius R p 0 x = x

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


/-- This is an auxiliary data structure useful for constructing adjunctions.
See `Adjunction.mkOfHomEquiv`.
This structure won't typically be used anywhere else.
-/
-- Porting note(#5171): `has_nonempty_instance` linter not ported yet
-- @[nolint has_nonempty_instance]
structure CoreHomEquiv (F : C ⥤ D) (G : D ⥤ C) where
  /-- The equivalence between `Hom (F X) Y` and `Hom X (G Y)` -/
  homEquiv : ∀ X Y, (F.obj X ⟶ Y) ≃ (X ⟶ G.obj Y)
  /-- The property that describes how `homEquiv.symm` transforms compositions `X' ⟶ X ⟶ G Y` -/
  homEquiv_naturality_left_symm :
    ∀ {X' X Y} (f : X' ⟶ X) (g : X ⟶ G.obj Y),
      (homEquiv X' Y).symm (f ≫ g) = F.map f ≫ (homEquiv X Y).symm g := by
    aesop_cat
  /-- The property that describes how `homEquiv` transforms compositions `F X ⟶ Y ⟶ Y'` -/
  homEquiv_naturality_right :
    ∀ {X Y Y'} (f : F.obj X ⟶ Y) (g : Y ⟶ Y'),
      (homEquiv X Y') (f ≫ g) = (homEquiv X Y) f ≫ G.map g := by
    aesop_cat

(self : CategoryTheory.Adjunction.CoreHomEquiv F G)

(self.homEquiv X Y') (CategoryTheory.CategoryStruct.comp f g) =
  CategoryTheory.CategoryStruct.comp ((self.homEquiv X Y) f) (G.map g)


theorem image_mul_left_Icc {a b c : α} (ha : 0 ≤ a) (hbc : b ≤ c) :
    (a * ·) '' Icc b c = Icc (a * b) (a * c)

{α : Type u_1}
[LinearOrderedField α]
{a b c : α}
(ha : 0 ≤ a)
(hbc : b ≤ c)

(fun x => a * x) '' Set.Icc b c = Set.Icc (a * b) (a * c)


/-- Continuity of the measure of translates of a compact set: Given a compact set `k` in a
topological group, for `g` close enough to the origin, `μ (g • k \ k)` is arbitrarily small. -/
@[to_additive]
lemma eventually_nhds_one_measure_smul_diff_lt [LocallyCompactSpace G]
    [IsFiniteMeasureOnCompacts μ] [InnerRegularCompactLTTop μ] {k : Set G}
    (hk : IsCompact k) (h'k : IsClosed k) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
    ∀ᶠ g in 𝓝 (1 : G), μ (g • k \ k) < ε


theorem objSupIsoProdEqLocus_inv_eq_iff {X : TopCat.{u}} (F : X.Sheaf CommRingCat.{u})
    {U V W UW VW : Opens X} (e : W ≤ U ⊔ V) (x) (y : F.1.obj (op W))
    (h₁ : UW = U ⊓ W) (h₂ : VW = V ⊓ W) :
    F.1.map (homOfLE e).op ((F.objSupIsoProdEqLocus U V).inv x) = y ↔
    F.1.map (homOfLE (h₁ ▸ inf_le_left : UW ≤ U)).op x.1.1 =
      F.1.map (homOfLE <| h₁ ▸ inf_le_right).op y ∧
    F.1.map (homOfLE (h₂ ▸ inf_le_left : VW ≤ V)).op x.1.2 =
      F.1.map (homOfLE <| h₂ ▸ inf_le_right).op y

{U V W UW VW : TopologicalSpace.Opens ↑X}

(x :
  ↥((RingHom.comp (F.val.map (CategoryTheory.homOfLE ⋯).op)
          (RingHom.fst ↑(F.val.obj (Opposite.op U)) ↑(F.val.obj (Opposite.op V)))).eqLocus
      (RingHom.comp (F.val.map (CategoryTheory.homOfLE ⋯).op)
        (RingHom.snd ↑(F.val.obj (Opposite.op U)) ↑(F.val.obj (Opposite.op V))))))

(F.val.map (CategoryTheory.homOfLE e).op) ((F.objSupIsoProdEqLocus U V).inv x) = y ↔
  (F.val.map (CategoryTheory.homOfLE ⋯).op) (↑x).1 = (F.val.map (CategoryTheory.homOfLE ⋯).op) y ∧
    (F.val.map (CategoryTheory.homOfLE ⋯).op) (↑x).2 = (F.val.map (CategoryTheory.homOfLE ⋯).op) y


@[simp]
theorem edgeSet_singletonSubgraph (v : V) : (G.singletonSubgraph v).edgeSet = ∅

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


theorem nmul_le_iff : a ⨳ b ≤ c ↔ ∀ a' < a, ∀ b' < b, a' ⨳ b ♯ a ⨳ b' < c ♯ a' ⨳ b'


/-- A ring `R` is isomorphic to `S × R` when `S` is the zero ring -/
@[simps]
def zeroRingProd : R ≃+* S × R

(R : Type u_3)
(S : Type u_5)
[NonAssocSemiring R]
[NonAssocSemiring S]
[Subsingleton S]
(self : S × R)

(RingEquiv.zeroRingProd R S).symm self = self.2


/-- Division as a multiplicative homomorphism with zero. -/
@[simps]
def divMonoidWithZeroHom [CommGroupWithZero M₀] : M₀ × M₀ →*₀ M₀

∀ (a : M₀ × M₀), divMonoidWithZeroHom a = (↑divMonoidHom).toFun a


theorem nonzero_mul_eq_swap_mul (a b : A) : σ (a * b) \ {0} = σ (b * a) \ {0}

{𝕜 : Type u}
{A : Type v}
[Field 𝕜]
[Ring A]
[Algebra 𝕜 A]
(a b : A)

spectrum 𝕜 (a * b) \ {0} = spectrum 𝕜 (b * a) \ {0}


/-- Let `t i` be a countable covering of a set `T` by measurable sets. Let `f i : t i → β` be a
family of functions that agree on the intersections `t i ∩ t j`. Then the function
`Set.iUnionLift t f _ _ : T → β`, defined as `f i ⟨x, hx⟩` for `hx : x ∈ t i`, is measurable. -/
theorem measurable_iUnionLift [Countable ι] {t : ι → Set α} {f : ∀ i, t i → β}
    (htf : ∀ (i j) (x : α) (hxi : x ∈ t i) (hxj : x ∈ t j), f i ⟨x, hxi⟩ = f j ⟨x, hxj⟩)
    {T : Set α} (hT : T ⊆ ⋃ i, t i) (htm : ∀ i, MeasurableSet (t i)) (hfm : ∀ i, Measurable (f i)) :
    Measurable (iUnionLift t f htf T hT)

(htf : ∀ (i j : ι) (x : α) (hxi : x ∈ t i) (hxj : x ∈ t j), f i ⟨x, hxi⟩ = f j ⟨x, hxj⟩)

Measurable (Set.iUnionLift t f htf T hT)


@[simp]
theorem WithTop.sInf_empty [InfSet α] : sInf (∅ : Set (WithTop α)) = ⊤


theorem indepFun_iff_map_prod_eq_prod_map_map {mβ : MeasurableSpace β} {mβ' : MeasurableSpace β'}
    [IsFiniteMeasure μ] (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
    IndepFun f g μ ↔ μ.map (fun ω ↦ (f ω, g ω)) = (μ.map f).prod (μ.map g)

{Ω : Type u_1}
{β : Type u_6}
{β' : Type u_7}
{_mΩ : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
{f : Ω → β}
{g : Ω → β'}
{mβ : MeasurableSpace β}
{mβ' : MeasurableSpace β'}
[MeasureTheory.IsFiniteMeasure μ]
(hf : AEMeasurable f μ)
(hg : AEMeasurable g μ)

ProbabilityTheory.IndepFun f g μ ↔
  MeasureTheory.Measure.map (fun ω => (f ω, g ω)) μ =
    (MeasureTheory.Measure.map f μ).prod (MeasureTheory.Measure.map g μ)


lemma map_negY (x y : R) : (W.map f).toAffine.negY (f x) (f y) = f (W.negY x y)

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Affine R)
{S : Type v}
[CommRing S]
(f : R →+* S)
(x y : R)

(WeierstrassCurve.map W f).toAffine.negY (f x) (f y) = f (W.negY x y)


theorem LeftInverse.rightInverse {f : α → β} {g : β → α} (h : LeftInverse g f) : RightInverse f g

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


theorem disconnect_normal (Sn : S.IsNormal) : S.disconnect.IsNormal

{C : Type u}
[CategoryTheory.Groupoid C]
(S : CategoryTheory.Subgroupoid C)
(Sn : S.IsNormal)


@[simp] theorem forall_eq {p : α → Prop} {a' : α} : (∀ a, a = a' → p a) ↔ p a'


theorem symm_image_target_eq_source : e.symm '' e.target = e.source

{α : Type u_1}
{β : Type u_2}
(e : PartialEquiv α β)


@[simp]
theorem sumCongr_inv {α β : Type*} (e : Perm α) (f : Perm β) :
    (sumCongr e f)⁻¹ = sumCongr e⁻¹ f⁻¹

{α : Type u_1}
{β : Type u_2}
(e : Equiv.Perm α)
(f : Equiv.Perm β)


@[simp]
theorem sym_symm : (@sym α).symm = unsym


theorem preimage_ennreal_ofReal (h : u.OrdConnected) : (ENNReal.ofReal ⁻¹' u).OrdConnected


theorem le_map_of_right_inverse {mab : α → β} {mba : β → α} {f : Filter α} {g : Filter β}
    (h₁ : mab ∘ mba =ᶠ[g] id) (h₂ : Tendsto mba g f) : g ≤ map mab f

{α : Type u}
{β : Type v}
{mab : α → β}
{mba : β → α}
{f : Filter α}
{g : Filter β}
(h₁ : mab ∘ mba =ᶠ[g] id)
(h₂ : Filter.Tendsto mba g f)


theorem ssubset_of_ne_of_subset [IsAntisymm α (· ⊆ ·)] (h₁ : a ≠ b) (h₂ : a ⊆ b) : a ⊂ b

[IsNonstrictStrictOrder α (fun x x_1 => x ⊆ x_1) fun x x_1 => x ⊂ x_1]


/-- Functor composition induces a functor on truncated cosimplicial objects. -/
@[simps!]
def whiskering {n} (D : Type*) [Category D] : (C ⥤ D) ⥤ Truncated C n ⥤ Truncated D n

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

∀ {X Y : SimplexCategory.Truncated n ⥤ C} (α : X ⟶ Y) (X_1 : SimplexCategory.Truncated n),
  (((CategoryTheory.CosimplicialObject.Truncated.whiskering C D).obj H).map α).app X_1 = H.map (α.app X_1)


@[simp]
theorem filterMap_val : (filterMap f s' f_inj).1 = s'.1.filterMap f

{f_inj : ∀ (a a' : α), ∀ b ∈ f a, b ∈ f a' → a = a'}

(Finset.filterMap f s' f_inj).val = Multiset.filterMap f s'.val


theorem card_le_card_sdiff_add_card : s.card ≤ (s \ t).card + t.card

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


lemma subset_rfl [IsRefl α (· ⊆ ·)] : a ⊆ a

{α : Type u}
[HasSubset α]
{a : α}
[IsRefl α fun x x_1 => x ⊆ x_1]


lemma image_infs (f : F) (s t : Finset α) : image f (s ⊼ t) = image f s ⊼ image f t

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[DecidableEq β]
[SemilatticeInf α]
[SemilatticeInf β]
[FunLike F α β]
[InfHomClass F α β]
(f : F)
(s t : Finset α)

Finset.image (⇑f) (s ⊼ t) = Finset.image (⇑f) s ⊼ Finset.image (⇑f) t


lemma cfcₙHom_closedEmbedding :
    ClosedEmbedding <| (cfcₙHom ha : C(σₙ R a, R)₀ →⋆ₙₐ[R] A)


@[to_additive (attr := simp)]
theorem Homeomorph.shearMulRight_coe :
    ⇑(Homeomorph.shearMulRight G) = fun z : G × G => (z.1, z.1 * z.2)

(G : Type w)
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]

⇑(Homeomorph.shearMulRight G) = fun z => (z.1, z.1 * z.2)


@[simp]
theorem upperBounds_empty : upperBounds (∅ : Set α) = univ


theorem indep_iSup_directed_limsup (h_le : ∀ n, s n ≤ m0) (h_indep : iIndep s μ)
    (hf : ∀ t, p t → tᶜ ∈ f) (hns : Directed (· ≤ ·) ns) (hnsp : ∀ a, p (ns a)) :
    Indep (⨆ a, ⨆ n ∈ ns a, s n) (limsup s f) μ

(h_indep : ProbabilityTheory.iIndep s μ)

(hns : Directed (fun x x_1 => x ≤ x_1) ns)

ProbabilityTheory.Indep (⨆ a, ⨆ n ∈ ns a, s n) (Filter.limsup s f) μ


/-- Tautological action on maps of the functor `Karoubi (J ⥤ C) ⥤ (J ⥤ Karoubi C)`. -/
@[simps]
def map {P Q : Karoubi (J ⥤ C)} (f : P ⟶ Q) : obj P ⟶ obj Q

{P Q : CategoryTheory.Idempotents.Karoubi (J ⥤ C)}

((CategoryTheory.Idempotents.KaroubiFunctorCategoryEmbedding.map f).app j).f = f.f.app j


lemma one_div_nonpos : 1 / a ≤ 0 ↔ a ≤ 0

{α : Type u_1}
[Semifield α]
[LinearOrder α]
[PosMulReflectLT α]
[ZeroLEOneClass α]
{a : α}


theorem div_mul_le_div_mul_of_div_le_div (h : a / b ≤ c / d) (he : 0 ≤ e) :
    a / (b * e) ≤ c / (d * e)

{α : Type u_2}
[LinearOrderedSemifield α]
{a b c d e : α}
(h : a / b ≤ c / d)
(he : 0 ≤ e)


theorem setIntegral_setAverage (μ : Measure α) [IsFiniteMeasure μ] (f : α → E) (s : Set α) :
    ∫ _ in s, ⨍ a in s, f a ∂μ ∂μ = ∫ x in s, f x ∂μ

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[CompleteSpace E]
(μ : MeasureTheory.Measure α)
[MeasureTheory.IsFiniteMeasure μ]
(f : α → E)
(s : Set α)

∫ (x : α) in s, ⨍ (a : α) in s, f a ∂μ ∂μ = ∫ (x : α) in s, f x ∂μ


/-- Baire theorem: a countable intersection of dense Gδ sets is dense. Formulated here with
an index set which is a countable set in any type. -/
theorem dense_biInter_of_Gδ {S : Set α} {f : ∀ x ∈ S, Set X} (ho : ∀ s (H : s ∈ S), IsGδ (f s H))
    (hS : S.Countable) (hd : ∀ s (H : s ∈ S), Dense (f s H)) : Dense (⋂ s ∈ S, f s ‹_›)

(ho : ∀ (s : α) (H : s ∈ S), IsGδ (f s H))

(hd : ∀ (s : α) (H : s ∈ S), Dense (f s H))


theorem nhdsWithin_iUnion {ι} [Finite ι] (s : ι → Set α) (a : α) :
    𝓝[⋃ i, s i] a = ⨆ i, 𝓝[s i] a

{α : Type u_1}
[TopologicalSpace α]
{ι : Sort u_5}
[Finite ι]
(s : ι → Set α)
(a : α)


theorem card_Iic : (Iic f).card = ∏ i ∈ f.support, (Iic (f i)).card

[(i : ι) → CanonicallyOrderedAddCommMonoid (α i)]

(Finset.Iic f).card = ∏ i ∈ f.support, (Finset.Iic (f i)).card