/-- Composition on the left by a (continuous) homomorphism of topological semirings, as a
`RingHom`.  Similar to `RingHom.compLeft`. -/
@[simps!]
protected def _root_.RingHom.compLeftContinuous (α : Type*) {β : Type*} {γ : Type*}
    [TopologicalSpace α]
    [TopologicalSpace β] [Semiring β] [TopologicalSemiring β] [TopologicalSpace γ] [Semiring γ]
    [TopologicalSemiring γ] (g : β →+* γ) (hg : Continuous g) : C(α, β) →+* C(α, γ)

(α : Type u_1)
{β : Type u_2}
{γ : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[Semiring β]
[TopologicalSemiring β]
[TopologicalSpace γ]
[Semiring γ]
[TopologicalSemiring γ]
(g : β →+* γ)
(hg : Continuous ⇑g)
(f : C(α, β))

∀ (a : α), ((RingHom.compLeftContinuous α g hg) f) a = g (f a)


/-- The sum over the reciprocals of the primes diverges. -/
theorem not_summable_one_div_on_primes :
    ¬ Summable (indicator {p | p.Prime} (fun n : ℕ ↦ (1 : ℝ) / n))

¬Summable ({p | Nat.Prime p}.indicator fun n => 1 / ↑n)


lemma Γgerm_res_apply (F : X.Presheaf C) {U : Opens X} {i : U ⟶ ⊤} (x : U) [ConcreteCategory C]
    (s) : germ F x (F.map i.op s) = Γgerm F x.val s

(s : (CategoryTheory.forget C).obj (F.obj (Opposite.op ⊤)))

(F.germ x) ((F.map i.op) s) = (F.Γgerm ↑x) s


theorem nnnorm_smul_le (r : α) (x : β) : ‖r • x‖₊ ≤ ‖r‖₊ * ‖x‖₊

{α : Type u_1}
{β : Type u_2}
[SeminormedAddGroup α]
[SeminormedAddGroup β]
[SMulZeroClass α β]
[BoundedSMul α β]
(r : α)
(x : β)

‖r • x‖₊ ≤ ‖r‖₊ * ‖x‖₊


/-- The simple (aka pure) elements span the tensor product. -/
theorem span_tmul_eq_top : Submodule.span R { t : M ⊗[R] N | ∃ m n, m ⊗ₜ n = t } = ⊤

(R : Type u_1)
[CommSemiring R]
(M : Type u_4)
(N : Type u_5)
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]

Submodule.span R {t | ∃ m n, m ⊗ₜ[R] n = t} = ⊤


theorem nhdsWithin_Ici_neBot {a b : α} (H₂ : a ≤ b) : NeBot (𝓝[Ici a] b)

{α : Type u_1}
[TopologicalSpace α]
[Preorder α]
{a b : α}
(H₂ : a ≤ b)


theorem dvd_prime_two_le {p m : ℕ} (pp : Prime p) (H : 2 ≤ m) : m ∣ p ↔ m = p

{p m : ℕ}
(pp : Nat.Prime p)
(H : 2 ≤ m)


/-- The **Akra-Bazzi theorem**: `T ∈ O(n^p (1 + ∑_u^n g(u) / u^{p+1}))` -/
theorem isBigO_asympBound : T =O[atTop] asympBound g a b

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

T =O[Filter.atTop] AkraBazziRecurrence.asympBound g a b


theorem DifferentiableWithinAt.ccosh (hf : DifferentiableWithinAt ℂ f s x) :
    DifferentiableWithinAt ℂ (fun x => Complex.cosh (f x)) s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{x : E}
{s : Set E}
(hf : DifferentiableWithinAt ℂ f s x)


@[simp]
theorem invOf_invOf [Monoid α] (a : α) [Invertible a] [Invertible (⅟ a)] : ⅟ (⅟ a) = a

{α : Type u}
[Monoid α]
(a : α)
[Invertible a]
[Invertible ⅟a]


@[measurability]
theorem Measurable.max {f g : δ → α} (hf : Measurable f) (hg : Measurable g) :
    Measurable fun a => max (f a) (g a)

{α : Type u_1}
{δ : Type u_4}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[MeasurableSpace δ]
[LinearOrder α]
[OrderClosedTopology α]
[SecondCountableTopology α]
{f g : δ → α}
(hf : Measurable f)
(hg : Measurable g)


@[simp]
theorem cancel_left {g : β →*₀o γ} {f₁ f₂ : α →*₀o β} (hg : Function.Injective g) :
    g.comp f₁ = g.comp f₂ ↔ f₁ = f₂

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[Preorder α]
[Preorder β]
[Preorder γ]
[MulZeroOneClass α]
[MulZeroOneClass β]
[MulZeroOneClass γ]
{g : β →*₀o γ}
{f₁ f₂ : α →*₀o β}
(hg : Function.Injective ⇑g)


/-- If `f : ℕ → ℝ` is decreasing and has a negative term, then `f` restricted to a residue
class is not summable. -/
lemma not_summable_indicator_mod_of_antitone_of_neg {m : ℕ} [hm : NeZero m] {f : ℕ → ℝ}
    (hf : Antitone f) {n : ℕ} (hn : f n < 0) (k : ZMod m) :
    ¬ Summable ({n : ℕ | (n : ZMod m) = k}.indicator f)


@[simp]
theorem toReal_one : toReal 1 = 1


theorem finset_sup_smul (p : ι → Seminorm 𝕜 E) (s : Finset ι) (C : ℝ≥0) :
    s.sup (C • p) = C • s.sup p

{𝕜 : Type u_3}
{E : Type u_7}
{ι : Type u_12}
[SeminormedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(p : ι → Seminorm 𝕜 E)
(s : Finset ι)
(C : ℝ≥0)


@[simp] theorem zero_shiftRight : ∀ n, 0 >>> n = 0


theorem two_nsmul_toReal_eq_two_mul_sub_two_pi {θ : Angle} :
    ((2 : ℕ) • θ).toReal = 2 * θ.toReal - 2 * π ↔ π / 2 < θ.toReal

(2 • θ).toReal = 2 * θ.toReal - 2 * π ↔ π / 2 < θ.toReal


theorem openSegment_eq_image (x y : E) :
    openSegment 𝕜 x y = (fun θ : 𝕜 => (1 - θ) • x + θ • y) '' Ioo (0 : 𝕜) 1

(𝕜 : Type u_1)
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(x y : E)

openSegment 𝕜 x y = (fun θ => (1 - θ) • x + θ • y) '' Set.Ioo 0 1


/-- The ring isomorphism between multivariable polynomials in a single variable and
polynomials over the ground ring.
-/
@[simps]
def pUnitAlgEquiv : MvPolynomial PUnit R ≃ₐ[R] R[X]

(R : Type u)
[CommSemiring R]
(p : MvPolynomial PUnit.{u_2 + 1} R)

(MvPolynomial.pUnitAlgEquiv R) p = MvPolynomial.eval₂ Polynomial.C (fun x => Polynomial.X) p


theorem Separable.of_mul_left {f g : R[X]} (h : (f * g).Separable) : f.Separable

{R : Type u}
[CommSemiring R]
{f g : R[X]}
(h : (f * g).Separable)


theorem tendsto_add_atTop_iff_nat {f : ℕ → α} {l : Filter α} (k : ℕ) :
    Tendsto (fun n => f (n + k)) atTop l ↔ Tendsto f atTop l

{α : Type u_3}
{f : ℕ → α}
{l : Filter α}
(k : ℕ)

Filter.Tendsto (fun n => f (n + k)) Filter.atTop l ↔ Filter.Tendsto f Filter.atTop l


theorem isGLB_Ioc_of_isGLB_Ioi {i j k : ι} (hij_lt : i < j) (h : IsGLB (Set.Ioi i) k) :
    IsGLB (Set.Ioc i j) k

{ι : Type u_1}
[LinearOrder ι]
{i j k : ι}
(hij_lt : i < j)
(h : IsGLB (Set.Ioi i) k)


@[simp] lemma flip_apply (m : M) (n : N) : e.flip m n = e n m

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
[Module.IsReflexive R M]
(e : N ≃ₗ[R] Module.Dual R M)
(m : M)
(n : N)


@[to_additive]
theorem toContinuousMap_injective : Injective (toContinuousMap : _ → C(A, B))

{A : Type u_2}
{B : Type u_3}
[Monoid A]
[Monoid B]
[TopologicalSpace A]
[TopologicalSpace B]


/-- As a matrix, `dualTensorHom` evaluated on a basis element of `M* ⊗ N` is a matrix with a
single one and zeros elsewhere -/
theorem toMatrix_dualTensorHom {m : Type*} {n : Type*} [Fintype m] [Finite n] [DecidableEq m]
    [DecidableEq n] (bM : Basis m R M) (bN : Basis n R N) (j : m) (i : n) :
    toMatrix bM bN (dualTensorHom R M N (bM.coord j ⊗ₜ bN i)) = stdBasisMatrix i j 1

{R : Type u}
{M : Type v₁}
{N : Type v₂}
[CommSemiring R]
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
{m : Type u_1}
{n : Type u_2}
[Fintype m]
[Finite n]
[DecidableEq m]
[DecidableEq n]
(bM : Basis m R M)
(bN : Basis n R N)
(j : m)
(i : n)

(LinearMap.toMatrix bM bN) ((dualTensorHom R M N) (bM.coord j ⊗ₜ[R] bN i)) = Matrix.stdBasisMatrix i j 1


/-- **Suslin's Theorem**: in a Hausdorff topological space, an analytic set with an analytic
complement is measurable. -/
theorem AnalyticSet.measurableSet_of_compl [T2Space α] [MeasurableSpace α] [OpensMeasurableSpace α]
    {s : Set α} (hs : AnalyticSet s) (hsc : AnalyticSet sᶜ) : MeasurableSet s

{α : Type u_1}
[TopologicalSpace α]
[T2Space α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
{s : Set α}
(hs : MeasureTheory.AnalyticSet s)
(hsc : MeasureTheory.AnalyticSet sᶜ)


theorem degree_quadratic_le : degree (C a * X ^ 2 + C b * X + C c) ≤ 2

(Polynomial.C a * Polynomial.X ^ 2 + Polynomial.C b * Polynomial.X + Polynomial.C c).degree ≤ 2


theorem LinearEquiv.lift_rank_map_eq (f : M ≃ₗ[R] M') (p : Submodule R M) :
    lift.{v} (Module.rank R (p.map (f : M →ₗ[R] M'))) = lift.{v'} (Module.rank R p)

{R : Type u}
{M : Type v}
{M' : Type v'}
[Ring R]
[AddCommGroup M]
[AddCommGroup M']
[Module R M]
[Module R M']
(f : M ≃ₗ[R] M')
(p : Submodule R M)

Cardinal.lift.{v, v'} (Module.rank R ↥(Submodule.map (↑f) p)) = Cardinal.lift.{v', v} (Module.rank R ↥p)


@[simp]
theorem isBigO_one_iff : f =O[l] (fun _x => 1 : α → F) ↔
    IsBoundedUnder (· ≤ ·) l fun x => ‖f x‖

{α : Type u_1}
{E : Type u_3}
(F : Type u_4)
[Norm E]
[Norm F]
{f : α → E}
{l : Filter α}
[One F]
[NormOneClass F]

(f =O[l] fun _x => 1) ↔ Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l fun x => ‖f x‖


theorem SurjOn.forall {p : β → Prop} (hf : s.SurjOn f t) (hf' : s.MapsTo f t) :
    (∀ y ∈ t, p y) ↔ (∀ x ∈ s, p (f x))

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{f : α → β}
{p : β → Prop}
(hf : Set.SurjOn f s t)
(hf' : Set.MapsTo f s t)


theorem isBigO_principal {s : Set α} : f =O[𝓟 s] g ↔ ∃ c, ∀ x ∈ s, ‖f x‖ ≤ c * ‖g x‖

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{f : α → E}
{g : α → F}
{s : Set α}


@[simp]
theorem ones_blocksFun (n : ℕ) (i : Fin (ones n).length) : (ones n).blocksFun i = 1

(n : ℕ)
(i : Fin (Composition.ones n).length)


protected theorem Directed.disjoint_iSup_left (h : Directed (· ≤ ·) f) :
    Disjoint (⨆ i, f i) a ↔ ∀ i, Disjoint (f i) a

{ι : Sort u_1}
{α : Type u_2}
{f : ι → α}
[CompleteLattice α]
[IsCompactlyGenerated α]
{a : α}
(h : Directed (fun x x_1 => x ≤ x_1) f)

Disjoint (⨆ i, f i) a ↔ ∀ (i : ι), Disjoint (f i) a


/-- The Legendre symbol depends only on `a` mod `p`. -/
protected theorem mod (a : ℤ) : legendreSym p a = legendreSym p (a % p)

legendreSym p a = legendreSym p (a % ↑p)


/-- The Ore condition of a fraction, expressed in terms of `oreNum` and `oreDenom`. -/
@[to_additive AddOreLocalization.add_ore_eq
  "The Ore condition of a difference, expressed in terms of `oreMin` and `oreSubtra`."]
theorem ore_eq (r : R) (s : S) : oreDenom r s * r = oreNum r s * s

{R : Type u_1}
[AddMonoid R]
{S : AddSubmonoid R}
[AddOreLocalization.AddOreSet S]
(r : R)
(s : ↥S)

↑(AddOreLocalization.oreSubtra r s) + r = AddOreLocalization.oreMin r s + ↑s


theorem CocompactMapClass.norm_le [FunLike 𝓕 E F] [CocompactMapClass 𝓕 E F] (ε : ℝ) :
    ∃ r : ℝ, ∀ x : E, r < ‖x‖ → ε < ‖f x‖

{E : Type u_2}
{F : Type u_3}
{𝓕 : Type u_4}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[ProperSpace F]
{f : 𝓕}
[FunLike 𝓕 E F]
[CocompactMapClass 𝓕 E F]
(ε : ℝ)


@[to_additive]
theorem NormedCommGroup.tendsto_nhds_one {f : α → E} {l : Filter α} :
    Tendsto f l (𝓝 1) ↔ ∀ ε > 0, ∀ᶠ x in l, ‖f x‖ < ε

{α : Type u_3}
{E : Type u_6}
[SeminormedGroup E]
{f : α → E}
{l : Filter α}

Filter.Tendsto f l (𝓝 1) ↔ ∀ ε > 0, ∀ᶠ (x : α) in l, ‖f x‖ < ε


@[simp]
theorem mem_basicOpen (f : R) (x : PrimeSpectrum R) : x ∈ basicOpen f ↔ f ∉ x.asIdeal

{R : Type u}
[CommSemiring R]
(f : R)
(x : PrimeSpectrum R)

x ∈ PrimeSpectrum.basicOpen f ↔ f ∉ x.asIdeal


theorem mul_inv_cancel_of_le_one [h : IsDedekindDomain A] {I : Ideal A} (hI0 : I ≠ ⊥)
    (hI : (I * (I : FractionalIdeal A⁰ K)⁻¹)⁻¹ ≤ 1) : I * (I : FractionalIdeal A⁰ K)⁻¹ = 1

{A : Type u_2}
{K : Type u_3}
[CommRing A]
[Field K]
[Algebra A K]
[IsFractionRing A K]
[h : IsDedekindDomain A]
{I : Ideal A}
(hI0 : I ≠ ⊥)
(hI : (↑I * (↑I)⁻¹)⁻¹ ≤ 1)


protected theorem mul_one' [NeZero n] (k : Fin n) : k * 1 = k


/-- The adjoint of the composition of two operators is the composition of the two adjoints
in reverse order. -/
@[simp]
theorem adjoint_comp (A : F →L[𝕜] G) (B : E →L[𝕜] F) : (A ∘L B)† = B† ∘L A†

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
{G : Type u_4}
[RCLike 𝕜]
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[NormedAddCommGroup G]
[InnerProductSpace 𝕜 E]
[InnerProductSpace 𝕜 F]
[InnerProductSpace 𝕜 G]
[CompleteSpace E]
[CompleteSpace G]
[CompleteSpace F]
(A : F →L[𝕜] G)
(B : E →L[𝕜] F)

ContinuousLinearMap.adjoint (A.comp B) = (ContinuousLinearMap.adjoint B).comp (ContinuousLinearMap.adjoint A)


theorem cyclotomic.roots_to_finset_eq_primitiveRoots [NeZero (n : R)] :
    (⟨(cyclotomic n R).roots, roots_cyclotomic_nodup⟩ : Finset _) = primitiveRoots n R

{R : Type u_1}
[CommRing R]
{n : ℕ}
[IsDomain R]
[NeZero ↑n]

{ val := (Polynomial.cyclotomic n R).roots, nodup := ⋯ } = primitiveRoots n R


@[simp] theorem beq_self_right : ∀(a b : Bool), ((a == b) == b) = a


/-- If a functor `L : C ⥤ D` is a left adjoint, it is initial. -/
theorem initial_of_adjunction {L : C ⥤ D} {R : D ⥤ C} (adj : L ⊣ R) : Initial L

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


theorem lsub_lt_ord {ι} {f : ι → Ordinal} {c : Ordinal} (hι : #ι < c.cof) :
    (∀ i, f i < c) → lsub.{u, u} f < c

{ι : Type u}
{f : ι → Ordinal.{u}}
{c : Ordinal.{u}}
(hι : #ι < c.cof)

(∀ (i : ι), f i < c) → Ordinal.lsub f < c


@[simp, norm_cast]
theorem coe_mk (f : α → M) (s : Finset α) (h : ∀ a, a ∈ s ↔ f a ≠ 0) : ⇑(⟨s, f, h⟩ : α →₀ M) = f

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

⇑{ support := s, toFun := f, mem_support_toFun := h } = f


theorem one_isPowerOfTwo : isPowerOfTwo 1


private lemma pairMap_of_snd_mem_fst {t : Finset σ × σ} (h : t.snd ∈ t.fst) :
    pairMap σ t = (t.fst.erase t.snd, t.snd)

(σ : Type u_1)
[DecidableEq σ]
{t : Finset σ × σ}
(h : t.2 ∈ t.1)

MvPolynomial.NewtonIdentities.pairMap σ t = (t.1.erase t.2, t.2)


/-- Naturally isomorphic endofunctors give equivalent categories of algebras.
Furthermore, they are equivalent as categories over `C`, that is,
we have `equiv_of_nat_iso h ⋙ forget = forget`.
-/
@[simps]
def equivOfNatIso {F G : C ⥤ C} (α : F ≅ G) : Algebra F ≌ Algebra G

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

(CategoryTheory.Endofunctor.Algebra.equivOfNatIso α).functor =
  CategoryTheory.Endofunctor.Algebra.functorOfNatTrans α.inv


lemma compProd_fst_condKernelReal (κ : Kernel α (γ × ℝ)) [IsFiniteKernel κ] :
    fst κ ⊗ₖ condKernelReal κ = κ

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


lemma isRegular_iff_finrank_engel_eq_rank (x : L) :
    IsRegular K x ↔ finrank K (engel K x) = rank K L

(K : Type u_7)
{L : Type u_8}
[Field K]
[LieRing L]
[LieAlgebra K L]
[Module.Finite K L]
(x : L)

LieAlgebra.IsRegular K x ↔ FiniteDimensional.finrank K ↥(LieSubalgebra.engel K x) = LieAlgebra.rank K L


@[simp]
theorem snd_prod (f : A →⋆ₙₐ[R] B) (g : A →⋆ₙₐ[R] C) : (snd R B C).comp (prod f g) = g

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
[Monoid R]
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[Star A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction R B]
[Star B]
[NonUnitalNonAssocSemiring C]
[DistribMulAction R C]
[Star C]
(f : A →⋆ₙₐ[R] B)
(g : A →⋆ₙₐ[R] C)

(NonUnitalStarAlgHom.snd R B C).comp (f.prod g) = g


/-- Right `Mul` by a `k : α` over `[Ring α]` is injective, if `k` is not a zero divisor.
The typeclass that restricts all terms of `α` to have this property is `NoZeroDivisors`. -/
theorem isRightRegular_of_non_zero_divisor [NonUnitalNonAssocRing α] (k : α)
    (h : ∀ x : α, x * k = 0 → x = 0) : IsRightRegular k

{α : Type u_1}
[NonUnitalNonAssocRing α]
(k : α)
(h : ∀ (x : α), x * k = 0 → x = 0)


@[to_additive]
lemma div_subset_range {s t : Set β} (hs : s ⊆ range m) (ht : t ⊆ range m) : s / t ⊆ range m

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[Group α]
[DivisionMonoid β]
[FunLike F α β]
[MonoidHomClass F α β]
(m : F)
{s t : Set β}
(hs : s ⊆ Set.range ⇑m)
(ht : t ⊆ Set.range ⇑m)


theorem nhds_inl [Zero M] (x : R) : 𝓝 (inl x : tsze R M) = (𝓝 x).prod (𝓝 0)

{R : Type u_3}
{M : Type u_4}
[TopologicalSpace R]
[TopologicalSpace M]
[Zero M]
(x : R)

𝓝 (TrivSqZeroExt.inl x) = (𝓝 x).prod (𝓝 0)


/-- If `E` and `K` are isomorphic as `F`-algebras, then they have the same
inseparable degree over `F`. -/
theorem lift_insepDegree_eq_of_equiv (i : E ≃ₐ[F] K) :
    Cardinal.lift.{w} (insepDegree F E) = Cardinal.lift.{v} (insepDegree F K)

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
(K : Type w)
[Field K]
[Algebra F K]
(i : E ≃ₐ[F] K)

Cardinal.lift.{w, v} (Field.insepDegree F E) = Cardinal.lift.{v, w} (Field.insepDegree F K)


@[to_additive]
theorem noncommProd_eq_prod {α : Type*} [CommMonoid α] (s : Multiset α) :
    (noncommProd s fun _ _ _ _ _ => Commute.all _ _) = prod s

{α : Type u_6}
[CommMonoid α]
(s : Multiset α)


/-- The equivalence between arrows of the form `A ⟶ B` and `B.unop ⟶ A.unop`. Useful for building
adjunctions.
Note that this (definitionally) gives variants
```
def opEquiv' (A : C) (B : Cᵒᵖ) : (Opposite.op A ⟶ B) ≃ (B.unop ⟶ A) :=
  opEquiv _ _

def opEquiv'' (A : Cᵒᵖ) (B : C) : (A ⟶ Opposite.op B) ≃ (B ⟶ A.unop) :=
  opEquiv _ _

def opEquiv''' (A B : C) : (Opposite.op A ⟶ Opposite.op B) ≃ (B ⟶ A) :=
  opEquiv _ _
```
-/
@[simps]
def opEquiv (A B : Cᵒᵖ) : (A ⟶ B) ≃ (B.unop ⟶ A.unop)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
(A B : Cᵒᵖ)
(g : Opposite.unop B ⟶ Opposite.unop A)

(CategoryTheory.opEquiv A B).symm g = g.op


theorem card_bot (s : Finset α) : (⊥ : Finpartition s).parts.card = s.card

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


@[simp]
theorem Subalgebra.finrank_bot : finrank F (⊥ : Subalgebra F E) = 1

{F : Type u_2}
{E : Type u_3}
[CommRing F]
[Ring E]
[Algebra F E]
[StrongRankCondition F]
[NoZeroSMulDivisors F E]
[Nontrivial E]


theorem cardinal_le_rank' {s : Set M}
    (hs : LinearIndependent R (fun x => x : s → M)) : #s ≤ Module.rank R M

(hs : LinearIndependent R fun (x : ↑s) => ↑x)


@[simp] lemma deleteEdges_edgeSet (G G' : SimpleGraph V) : G.deleteEdges G'.edgeSet = G \ G'


theorem measurable_from_prod_countable' [Countable β]
    {_ : MeasurableSpace γ} {f : α × β → γ} (hf : ∀ y, Measurable fun x => f (x, y))
    (h'f : ∀ y y' x, y' ∈ measurableAtom y → f (x, y') = f (x, y)) :
    Measurable f

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{m : MeasurableSpace α}
{mβ : MeasurableSpace β}
[Countable β]

∀ {x : MeasurableSpace γ} {f : α × β → γ},
  (∀ (y : β), Measurable fun x => f (x, y)) →
    (∀ (y y' : β) (x : α), y' ∈ measurableAtom y → f (x, y') = f (x, y)) → Measurable f


@[simp]
theorem count_eq_one_of_mem [DecidableEq α] {a : α} {l : List α} (d : Nodup l) (h : a ∈ l) :
    count a l = 1

{α : Type u}
[DecidableEq α]
{a : α}
{l : List α}
(d : l.Nodup)
(h : a ∈ l)


@[simp]
theorem preimage_mul_const_Ico_of_neg (a b : α) {c : α} (h : c < 0) :
    (fun x => x * c) ⁻¹' Ico a b = Ioc (b / c) (a / c)

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

(fun x => x * c) ⁻¹' Set.Ico a b = Set.Ioc (b / c) (a / c)


@[to_additive (attr := simp)]
theorem coe_id : ⇑(OrderMonoidHom.id α) = id

(α : Type u_2)
[Preorder α]
[MulOneClass α]


@[simp]
theorem sup_inf_sdiff (x y : α) : x ⊓ y ⊔ x \ y = x

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


theorem Pi.le_def [∀ i, LE (π i)] {x y : ∀ i, π i} :
    x ≤ y ↔ ∀ i, x i ≤ y i

{ι : Type u_1}
{π : ι → Type u_4}
[(i : ι) → LE (π i)]
{x y : (i : ι) → π i}


/-- If a prime `p` divides `n` such that `-1` is a square modulo `n`, then `p % 4 ≠ 3`. -/
theorem Nat.Prime.mod_four_ne_three_of_dvd_isSquare_neg_one {p n : ℕ} (hpp : p.Prime) (hp : p ∣ n)
    (hs : IsSquare (-1 : ZMod n)) : p % 4 ≠ 3

{p n : ℕ}
(hpp : Nat.Prime p)
(hp : p ∣ n)
(hs : IsSquare (-1))


theorem hasCompactSupport_norm_iff : (HasCompactSupport fun x => ‖f x‖) ↔ HasCompactSupport f

{α : Type u_3}
{E : Type u_6}
[NormedAddGroup E]
[TopologicalSpace α]
{f : α → E}


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

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

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


@[simp]
theorem deriv_exp : deriv exp = exp


@[fun_prop]
protected theorem hasFDerivWithinAt : HasFDerivWithinAt iso (iso : E →L[𝕜] F) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{x : E}
{s : Set E}
(iso : E ≃ₗᵢ[𝕜] F)

HasFDerivWithinAt (⇑iso) (↑{ toLinearEquiv := iso.toLinearEquiv, continuous_toFun := ⋯, continuous_invFun := ⋯ }) s x


@[to_additive (attr := simp)]
theorem nndist_mul_left [PseudoMetricSpace M] [Mul M] [IsometricSMul M M] (a b c : M) :
    nndist (a * b) (a * c) = nndist b c

{M : Type u}
[PseudoMetricSpace M]
[Mul M]
[IsometricSMul M M]
(a b c : M)


theorem coe_injective (h : degree f ≠ 0) : Function.Injective ((↑) : K → AdjoinRoot f)

{K : Type w}
[Field K]
{f : K[X]}
(h : f.degree ≠ 0)


/-- Assumes right covariance. -/
theorem Right.mul_pos [MulPosStrictMono α] (ha : 0 < a) (hb : 0 < b) : 0 < a * b

{α : Type u_1}
{a b : α}
[MulZeroClass α]
[Preorder α]
[MulPosStrictMono α]
(ha : 0 < a)
(hb : 0 < b)


@[to_additive]
theorem prod_range_div' {M : Type*} [CommGroup M] (f : ℕ → M) (n : ℕ) :
    (∏ i ∈ range n, f i / f (i + 1)) = f 0 / f n

{M : Type u_6}
[AddCommGroup M]
(f : ℕ → M)
(n : ℕ)

∑ i ∈ Finset.range n, (f i - f (i + 1)) = f 0 - f n


theorem withTopEquiv_top : withTopEquiv ⊤ = ⊤


@[to_additive (attr := simp)]
theorem self_comp_symm (e : M ≃* N) : e ∘ e.symm = id

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


theorem ContinuousAt.IccExtend {x : γ} (f : γ → Icc a b → β) {g : γ → α}
    (hf : ContinuousAt (↿f) (x, projIcc a b h (g x))) (hg : ContinuousAt g x) :
    ContinuousAt (fun a => IccExtend h (f a) (g a)) x

(hf : ContinuousAt (↿f) (x, Set.projIcc a b h (g x)))

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


@[simp] -- Porting note: add norm_cast; we leave it out for now to reproduce mathlib3 behavior.
theorem coe_smul (c : ℝ) (K : ConvexBody V) : (↑(c • K) : Set V) = c • (K : Set V)

{V : Type u_1}
[TopologicalSpace V]
[AddCommGroup V]
[Module ℝ V]
[ContinuousSMul ℝ V]
(c : ℝ)
(K : ConvexBody V)


theorem isPreirreducible_iff_closure : IsPreirreducible (closure s) ↔ IsPreirreducible s

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


theorem condCount_isProbabilityMeasure {s : Set Ω} (hs : s.Finite) (hs' : s.Nonempty) :
    IsProbabilityMeasure (condCount s)

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


lemma Function.End.one_def : (1 : Function.End α) = id


@[to_additive]
theorem inter_mul_union_subset : s ∩ t * (s ∪ t) ⊆ s * t

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


@[to_additive (attr := simp)]
theorem fixedBy_one_eq_univ : fixedBy α (1 : M) = Set.univ

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


@[simp]
protected theorem add_iff_left :
    a₁ ≡ b₁ [PMOD p] → (a₁ + a₂ ≡ b₁ + b₂ [PMOD p] ↔ a₂ ≡ b₂ [PMOD p])

{α : Type u_1}
[AddCommGroup α]
{p a₁ a₂ b₁ b₂ : α}


/-- The action via `LinearEquiv.apply_distribMulAction` corresponds to `Module.Ray.map`. -/
@[simp]
theorem Module.Ray.linearEquiv_smul_eq_map (e : M ≃ₗ[R] M) (v : Module.Ray R M) :
    e • v = Module.Ray.map e v

{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
(e : M ≃ₗ[R] M)
(v : Module.Ray R M)


lemma addY_of_X_eq {P Q : Fin 3 → F} (hP : W.Equation P) (hQ : W.Equation Q) (hPz : P z ≠ 0)
    (hQz : Q z ≠ 0) (hx : P x * Q z ^ 2 = Q x * P z ^ 2) : W.addY P Q = addU P Q ^ 3

{F : Type v}
[Field F]
{W : WeierstrassCurve.Jacobian F}
{P Q : Fin 3 → F}
(hP : W.Equation P)
(hQ : W.Equation Q)
(hPz : P z ≠ 0)
(hQz : Q z ≠ 0)
(hx : P x * Q z ^ 2 = Q x * P z ^ 2)

W.addY P Q = WeierstrassCurve.Jacobian.addU P Q ^ 3


/-- Expand `⟪x + y, x + y⟫` -/
theorem inner_add_add_self (x y : E) : ⟪x + y, x + y⟫ = ⟪x, x⟫ + ⟪x, y⟫ + ⟪y, x⟫ + ⟪y, y⟫

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

⟪x + y, x + y⟫_𝕜 = ⟪x, x⟫_𝕜 + ⟪x, y⟫_𝕜 + ⟪y, x⟫_𝕜 + ⟪y, y⟫_𝕜


/-- A specialization of the spectral mapping theorem for polynomials in a Banach algebra over `ℂ`
to monic monomials. -/
protected theorem map_pow (n : ℕ) :
    spectrum ℂ (a ^ n) = (· ^ n) '' spectrum ℂ a

{A : Type u_2}
[NormedRing A]
[NormedAlgebra ℂ A]
[CompleteSpace A]
[Nontrivial A]
(a : A)
(n : ℕ)

spectrum ℂ (a ^ n) = (fun x => x ^ n) '' spectrum ℂ a


theorem addOrderOf_div_of_gcd_eq_one' {m : ℤ} {n : ℕ} (hn : 0 < n) (h : m.natAbs.gcd n = 1) :
    addOrderOf (↑(↑m / ↑n * p) : AddCircle p) = n

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
{p : 𝕜}
[hp : Fact (0 < p)]
{m : ℤ}
{n : ℕ}
(hn : 0 < n)
(h : m.natAbs.gcd n = 1)


lemma isAlgebraic_of_isFractionRing {R S} (K L) [CommRing R] [CommRing S] [Field K] [CommRing L]
    [Algebra R S] [Algebra R K] [Algebra R L] [Algebra S L] [Algebra K L] [IsScalarTower R S L]
    [IsScalarTower R K L] [IsFractionRing S L]
    [Algebra.IsIntegral R S] : Algebra.IsAlgebraic K L

{R : Type u_6}
{S : Type u_7}
(K : Type u_8)
(L : Type u_9)
[CommRing R]
[CommRing S]
[Field K]
[CommRing L]
[Algebra R S]
[Algebra R K]
[Algebra R L]
[Algebra S L]
[Algebra K L]
[IsScalarTower R S L]
[IsScalarTower R K L]
[IsFractionRing S L]
[Algebra.IsIntegral R S]


@[simp]
lemma Cocone.toCostructuredArrow_comp_proj {F : J ⥤ C} (c : Cocone F) :
    c.toCostructuredArrow ⋙ CostructuredArrow.proj _ _ = 𝟭 J

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

c.toCostructuredArrow.comp (CategoryTheory.CostructuredArrow.proj F c.pt) = CategoryTheory.Functor.id J


theorem optParam_eq (α : Sort u) (default : α) : optParam α default = α


theorem exists_eq_pow_rootMultiplicity_mul_and_not_dvd (p : R[X]) (hp : p ≠ 0) (a : R) :
    ∃ q : R[X], p = (X - C a) ^ p.rootMultiplicity a * q ∧ ¬ (X - C a) ∣ q

{R : Type u}
[Ring R]
(p : R[X])
(hp : p ≠ 0)
(a : R)

∃ q, p = (Polynomial.X - Polynomial.C a) ^ Polynomial.rootMultiplicity a p * q ∧ ¬Polynomial.X - Polynomial.C a ∣ q


@[simp]
theorem star_im (z : ℤ√d) : (star z).im = -z.im


protected theorem invOn : InvOn e.symm e e.source e.target

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

Set.InvOn (↑e.symm) (↑e) e.source e.target


theorem HasDerivWithinAt.sinh (hf : HasDerivWithinAt f f' s x) :
    HasDerivWithinAt (fun x => Real.sinh (f x)) (Real.cosh (f x) * f') s x

{f : ℝ → ℝ}
{f' x : ℝ}
{s : Set ℝ}
(hf : HasDerivWithinAt f f' s x)


theorem monotone_sym2 : Monotone (Finset.sym2 : Finset α → _)


@[simp] lemma min_eq_zero_iff : min m n = 0 ↔ m = 0 ∨ n = 0


theorem isMaximal_of_eq_inf (x b : X) {a y : X} (ha : x ⊓ y = a) (hxy : x ≠ y) (hxb : IsMaximal x b)
    (hyb : IsMaximal y b) : IsMaximal a y

(hxb : JordanHolderLattice.IsMaximal x b)

(hyb : JordanHolderLattice.IsMaximal y b)


theorem isClosed_zeroLocus (s : Set A) : IsClosed (zeroLocus 𝒜 s)

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

IsClosed (ProjectiveSpectrum.zeroLocus 𝒜 s)


theorem coeff_update_apply (p : R[X]) (n : ℕ) (a : R) (i : ℕ) :
    (p.update n a).coeff i = if i = n then a else p.coeff i

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


/-- `x` is the only fixed point of `pointReflection x`. This lemma requires
`x + x = y + y ↔ x = y`. There is no typeclass to use here, so we add it as an explicit argument. -/
theorem pointReflection_fixed_iff_of_injective_bit0 {x y : P₁} (h : Injective (2 • · : V₁ → V₁)) :
    pointReflection k x y = y ↔ y = x

(k : Type u_1)
{P₁ : Type u_2}
{V₁ : Type u_6}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
{x y : P₁}
(h : Function.Injective fun x => 2 • x)

(AffineEquiv.pointReflection k x) y = y ↔ y = x


@[simp]
theorem card_eq_ofNat {o} {n : ℕ} [n.AtLeastTwo] :
    card o = (no_index (OfNat.ofNat n)) ↔ o = OfNat.ofNat n

{o : Ordinal.{u_3}}
{n : ℕ}
[n.AtLeastTwo]

o.card = OfNat.ofNat n ↔ o = OfNat.ofNat n


/-- Constructor for natural transformations `F ⟶ G` in `ℕ ⥤ C` which takes as inputs
the morphisms `F.obj n ⟶ G.obj n` for all `n : ℕ` and the naturality condition only
for morphisms of the form `n ⟶ n + 1`. -/
@[simps app]
def ofSequence : F ⟶ G

(naturality :
  ∀ (n : ℕ),
    CategoryTheory.CategoryStruct.comp (F.map (CategoryTheory.homOfLE ⋯)) (app (n + 1)) =
      CategoryTheory.CategoryStruct.comp (app n) (G.map (CategoryTheory.homOfLE ⋯)))

(CategoryTheory.NatTrans.ofSequence app naturality).app n = app n


/-- The computation of the homology of single complexes, as a natural isomorphism
`single C c j ⋙ homologyFunctor C c j ≅ 𝟭 C`. -/
@[simps!]
noncomputable def homologyFunctorSingleIso [CategoryWithHomology C] :
    single C c j ⋙ homologyFunctor C c j ≅ 𝟭 _

(HomologicalComplex.homologyFunctorSingleIso C c j).inv.app X = (HomologicalComplex.singleObjHomologySelfIso c j X).inv


/-- The product of `f i` over `i ∈ {a, b}`, `a ≠ b`, is equal to `f a * f b`. -/
@[to_additive "The sum of `f i` over `i ∈ {a, b}`, `a ≠ b`, is equal to `f a + f b`."]
theorem finprod_mem_pair (h : a ≠ b) : (∏ᶠ i ∈ ({a, b} : Set α), f i) = f a * f b

{α : Type u_1}
{M : Type u_5}
[CommMonoid M]
{f : α → M}
{a b : α}
(h : a ≠ b)

∏ᶠ (i : α) (_ : i ∈ {a, b}), f i = f a * f b


@[simp] theorem rTensor_trans_lTensor (f : M ≃ₗ[R] P) (g : N ≃ₗ[R] Q) :
    f.rTensor N ≪≫ₗ g.lTensor P = TensorProduct.congr f g

{R : Type u_1}
[CommSemiring R]
(M : Type u_4)
{N : Type u_5}
{P : Type u_6}
{Q : Type u_7}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[AddCommMonoid Q]
[Module R M]
[Module R N]
[Module R P]
[Module R Q]
(f : M ≃ₗ[R] P)
(g : N ≃ₗ[R] Q)

LinearEquiv.rTensor N f ≪≫ₗ LinearEquiv.lTensor P g = TensorProduct.congr f g


/-- If `f a = 1`, then the product of `f i` over `i ∈ insert a s` equals the product of `f i` over
`i ∈ s`. -/
@[to_additive
      "If `f a = 0`, then the sum of `f i` over `i ∈ insert a s` equals the sum of `f i`
      over `i ∈ s`."]
theorem finprod_mem_insert_one (h : f a = 1) : ∏ᶠ i ∈ insert a s, f i = ∏ᶠ i ∈ s, f i

{α : Type u_1}
{M : Type u_5}
[CommMonoid M]
{f : α → M}
{a : α}
{s : Set α}
(h : f a = 1)

∏ᶠ (i : α) (_ : i ∈ insert a s), f i = ∏ᶠ (i : α) (_ : i ∈ s), f i


theorem uniqueBaseOn_restrict' (I E R : Set α) :
    (uniqueBaseOn I E) ↾ R = uniqueBaseOn (I ∩ R ∩ E) R

(Matroid.uniqueBaseOn I E).restrict R = Matroid.uniqueBaseOn (I ∩ R ∩ E) R


lemma shift_v' (a : ℤ) (p q : ℤ) (hpq : p + n = q) :
    (γ.shift a).v p q hpq = γ.v (p + a) (q + a) (by omega)

(γ : CochainComplex.HomComplex.Cochain K L n)

(γ.shift a).v p q hpq = γ.v (p + a) (q + a) ⋯


@[simp]
theorem bddAbove_range_partialSups {f : ℕ → α} :
    BddAbove (Set.range (partialSups f)) ↔ BddAbove (Set.range f)

{α : Type u_1}
[SemilatticeSup α]
{f : ℕ → α}

BddAbove (Set.range ⇑(partialSups f)) ↔ BddAbove (Set.range f)


@[to_additive]
theorem mem_iInf {ι : Sort*} {S : ι → Submonoid M} {x : M} : (x ∈ ⨅ i, S i) ↔ ∀ i, x ∈ S i

{M : Type u_1}
[AddZeroClass M]
{ι : Sort u_4}
{S : ι → AddSubmonoid M}
{x : M}


@[to_additive]
theorem mulIndicator_const_preimage (U : Set α) (s : Set M) (a : M) :
    (U.mulIndicator fun _ => a) ⁻¹' s ∈ ({Set.univ, U, Uᶜ, ∅} : Set (Set α))

{α : Type u_1}
{M : Type u_4}
[One M]
(U : Set α)
(s : Set M)
(a : M)

(U.mulIndicator fun x => a) ⁻¹' s ∈ {Set.univ, U, Uᶜ, ∅}


@[simp]
theorem gcd_self_add_left (m n : ℕ) : gcd (m + n) m = gcd n m


@[ext]
lemma hom_ext {L L' : Φ.LeftResolution X₂} {φ₁ φ₂ : L ⟶ L'} (h : φ₁.f = φ₂.f) :
    φ₁ = φ₂

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

{Φ : CategoryTheory.LocalizerMorphism W₁ W₂}


theorem const_one (U) : (const R 1 1 U fun _ _ => Submonoid.one_mem _) = 1

(U : TopologicalSpace.Opens ↑(AlgebraicGeometry.PrimeSpectrum.Top R))

AlgebraicGeometry.StructureSheaf.const R 1 1 U ⋯ = 1


/-- If `f : ℂ → E` is complex differentiable on an open disc of positive radius and is continuous
on its closure, then it is analytic on the open disc with coefficients of the power series given by
Cauchy integral formulas. -/
theorem _root_.DiffContOnCl.hasFPowerSeriesOnBall {R : ℝ≥0} {c : ℂ} {f : ℂ → E}
    (hf : DiffContOnCl ℂ f (ball c R)) (hR : 0 < R) :
    HasFPowerSeriesOnBall f (cauchyPowerSeries f c R) c R

(hf : DiffContOnCl ℂ f (Metric.ball c ↑R))

HasFPowerSeriesOnBall f (cauchyPowerSeries f c ↑R) c ↑R


theorem iUnion_union [Nonempty ι] (s : Set β) (t : ι → Set β) : (⋃ i, t i) ∪ s = ⋃ i, t i ∪ s

{β : Type u_2}
{ι : Sort u_4}
[Nonempty ι]
(s : Set β)
(t : ι → Set β)


@[to_additive]
theorem map_ne_one_iff {R S F : Type*} [One R] [One S] [FunLike F R S] [OneHomClass F R S] (f : F)
    (hf : Function.Injective f) {x : R} : f x ≠ 1 ↔ x ≠ 1

{R : Type u_10}
{S : Type u_11}
{F : Type u_12}
[Zero R]
[Zero S]
[FunLike F R S]
[ZeroHomClass F R S]
(f : F)
(hf : Function.Injective ⇑f)
{x : R}


/-- The Law of Quadratic Reciprocity for the Jacobi symbol: if `a` and `b` are natural numbers
with `a % 4 = 1` and `b` odd, then `J(a | b) = J(b | a)`. -/
theorem quadratic_reciprocity_one_mod_four {a b : ℕ} (ha : a % 4 = 1) (hb : Odd b) :
    J(a | b) = J(b | a)


theorem eq_zero_of_epi_kernel [Epi (kernel.ι f)] : f = 0


/-- In an abelian category, a short complex `S` is exact
iff `imageSubobject S.f = kernelSubobject S.g`.
-/
theorem exact_iff_image_eq_kernel : S.Exact ↔ imageSubobject S.f = kernelSubobject S.g

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

S.Exact ↔ CategoryTheory.Limits.imageSubobject S.f = CategoryTheory.Limits.kernelSubobject S.g


@[simp]
theorem symm_apply_apply (h : α ≃ᵢ β) (x : α) : h.symm (h x) = x

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
(h : α ≃ᵢ β)
(x : α)


@[to_additive]
theorem of_mulOpposite
    (h : UniqueMul (B.map ⟨_, op_injective⟩) (A.map ⟨_, op_injective⟩) (op b0) (op a0)) :
    UniqueMul A B a0 b0

(h :
  UniqueMul (Finset.map { toFun := MulOpposite.op, inj' := ⋯ } B) (Finset.map { toFun := MulOpposite.op, inj' := ⋯ } A)
    (MulOpposite.op b0) (MulOpposite.op a0))


theorem _root_.Measurable.congr_ae {α β} [MeasurableSpace α] [MeasurableSpace β] {μ : Measure α}
    [_hμ : μ.IsComplete] {f g : α → β} (hf : Measurable f) (hfg : f =ᵐ[μ] g) : Measurable g

{α : Type u_5}
{β : Type u_6}
[MeasurableSpace α]
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
[_hμ : μ.IsComplete]
{f g : α → β}
(hf : Measurable f)
(hfg : f =ᵐ[μ] g)


@[simp]
theorem symm_trans_self (h : X ≃ₜ Y) : h.symm.trans h = Homeomorph.refl Y

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(h : X ≃ₜ Y)


theorem eq_of_add_add_eq_zero [IsCancelAdd R] {a b c : M} (H : B.IsAlt) (hAdd : a + b + c = 0) :
    B a b = B b c

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{B : LinearMap.BilinForm R M}
[IsCancelAdd R]
{a b c : M}
(H : B.IsAlt)
(hAdd : a + b + c = 0)


lemma succ_le_succ_sqrt' (n : ℕ) : n + 1 ≤ (sqrt n + 1) ^ 2


theorem aeval_apply_of_hasEigenvector {f : End K V} {p : K[X]} {μ : K} {x : V}
    (h : f.HasEigenvector μ x) : aeval f p x = p.eval μ • x

{K : Type v}
{V : Type w}
[Field K]
[AddCommGroup V]
[Module K V]
{f : Module.End K V}
{p : Polynomial K}
{μ : K}
{x : V}
(h : f.HasEigenvector μ x)

((Polynomial.aeval f) p) x = Polynomial.eval μ p • x


theorem matrixDecomposition_comp (o : HomOrthogonal s) {α β γ : Type} [Finite α] [Fintype β]
    [Finite γ] {f : α → ι} {g : β → ι} {h : γ → ι} (z : (⨁ fun a => s (f a)) ⟶ ⨁ fun b => s (g b))
    (w : (⨁ fun b => s (g b)) ⟶ ⨁ fun c => s (h c)) (i : ι) :
    o.matrixDecomposition (z ≫ w) i = o.matrixDecomposition w i * o.matrixDecomposition z i

o.matrixDecomposition (CategoryTheory.CategoryStruct.comp z w) i = o.matrixDecomposition w i * o.matrixDecomposition z i


theorem liftPropAt_chart_symm [HasGroupoid M G] (hG : G.LocalInvariantProp G Q)
    (hQ : ∀ y, Q id univ y) : LiftPropAt Q (chartAt (H := H) x).symm ((chartAt H x) x)

{H : Type u_1}
{M : Type u_2}
[TopologicalSpace H]
[TopologicalSpace M]
[ChartedSpace H M]
{G : StructureGroupoid H}
{x : M}
{Q : (H → H) → Set H → H → Prop}
[HasGroupoid M G]
(hG : G.LocalInvariantProp G Q)
(hQ : ∀ (y : H), Q id Set.univ y)

ChartedSpace.LiftPropAt Q (↑(chartAt H x).symm) (↑(chartAt H x) x)


@[to_additive (attr := simp)]
theorem map_map {I : Type*} [Group I] (M : Subgroup H) (O : Subgroup I) [M.Normal] [O.Normal]
    (f : G →* H) (g : H →* I) (hf : N ≤ Subgroup.comap f M) (hg : M ≤ Subgroup.comap g O)
    (hgf : N ≤ Subgroup.comap (g.comp f) O :=
      hf.trans ((Subgroup.comap_mono hg).trans_eq (Subgroup.comap_comap _ _ _)))
    (x : G ⧸ N) : map M O g hg (map N M f hf x) = map N O (g.comp f) hgf x

(hgf : N ≤ AddSubgroup.comap (g.comp f) O := ⋯)

(QuotientAddGroup.map M O g hg) ((QuotientAddGroup.map N M f hf) x) = (QuotientAddGroup.map N O (g.comp f) hgf) x


@[simp]
theorem volume_emetric_ball (a : ℝ) (r : ℝ≥0∞) : volume (EMetric.ball a r) = 2 * r

MeasureTheory.volume (EMetric.ball a r) = 2 * r


@[simp]
lemma evalEval_polynomialY_zero : W.polynomialY.evalEval 0 0 = W.a₃

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Affine R)

Polynomial.evalEval 0 0 W.polynomialY = W.a₃


theorem polar_subMulAction {S : Type*} [SetLike S E] [SMulMemClass S 𝕜 E] (m : S) :
    B.polar m = { y | ∀ x ∈ m, B x y = 0 }

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[AddCommMonoid E]
[AddCommMonoid F]
[Module 𝕜 E]
[Module 𝕜 F]
(B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜)
{S : Type u_4}
[SetLike S E]
[SMulMemClass S 𝕜 E]
(m : S)


theorem free_shortExact_rank_add [Module.Free R S.X₁] [Module.Free R S.X₃]
    [StrongRankCondition R] :
    Module.rank R S.X₂ = Module.rank R S.X₁ + Module.rank R S.X₃

{S : CategoryTheory.ShortComplex (ModuleCat R)}

Module.rank R ↑S.X₂ = Module.rank R ↑S.X₁ + Module.rank R ↑S.X₃


theorem add_mem_Ioc_iff_left : a + b ∈ Set.Ioc c d ↔ a ∈ Set.Ioc (c - b) (d - b)

{α : Type u_1}
[OrderedAddCommGroup α]
{a b c d : α}


/-- Galois connection between `ceilRoot n : ℕ → ℕ` and `a ↦ a ^ n : ℕ → ℕ` where `ℕ` is ordered
by divisibility.

Note that this cannot possibly hold for `n = 0`, regardless of the value of `ceilRoot 0 a`, because
the statement reduces to `a = 1 ↔ ceilRoot 0 a ∣ b`, which is false for eg `a = 0`,
`b = ceilRoot 0 a`. -/
lemma dvd_pow_iff_ceilRoot_dvd (hn : n ≠ 0) : a ∣ b ^ n ↔ ceilRoot n a ∣ b


protected theorem lt_iff_le_and_ne {a b : Int} : a < b ↔ a ≤ b ∧ a ≠ b


protected theorem hasFPowerSeriesAt (f : E →L[𝕜] F) (x : E) :
    HasFPowerSeriesAt f (f.fpowerSeries x) x

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

HasFPowerSeriesAt (⇑f) (f.fpowerSeries x) x


@[simp]
theorem finsuppTensorFinsuppLid_symm_single_smul (i : ι × κ) (r : R) (n : N) :
    (finsuppTensorFinsuppLid R N ι κ).symm (Finsupp.single i (r • n)) =
      Finsupp.single i.1 r ⊗ₜ Finsupp.single i.2 n

(R : Type u_1)
(N : Type u_4)
(ι : Type u_5)
(κ : Type u_6)
[CommSemiring R]
[AddCommMonoid N]
[Module R N]
(i : ι × κ)
(r : R)
(n : N)

(finsuppTensorFinsuppLid R N ι κ).symm (Finsupp.single i (r • n)) = Finsupp.single i.1 r ⊗ₜ[R] Finsupp.single i.2 n


@[simp] theorem emod_neg (a b : Int) : a % -b = a % b


theorem nhds_eq (h : x ~ᵢ y) : 𝓝 x = 𝓝 y

{X : Type u_1}
[TopologicalSpace X]
{x y : X}
(h : x ~ᵢ y)


theorem iInter_eq_compl_iUnion_compl (s : ι → Set β) : ⋂ i, s i = (⋃ i, (s i)ᶜ)ᶜ

{β : Type u_2}
{ι : Sort u_4}
(s : ι → Set β)


lemma mul_div_cancel {a b : EReal} (h₁ : b ≠ ⊥) (h₂ : b ≠ ⊤) (h₃ : b ≠ 0) : b * (a / b) = a


@[simp high]
theorem lsum_single {ι R : Type*} [Fintype ι] [DecidableEq ι] [CommRing R] {M : ι → Type*}
    [(i : ι) → AddCommGroup (M i)] [(i : ι) → Module R (M i)] :
    LinearMap.lsum R M R LinearMap.single = LinearMap.id

{ι : Type u_1}
{R : Type u_2}
[Fintype ι]
[DecidableEq ι]
[CommRing R]
{M : ι → Type u_3}
[(i : ι) → AddCommGroup (M i)]
[(i : ι) → Module R (M i)]

(LinearMap.lsum R M R) LinearMap.single = LinearMap.id


lemma count_injective : Injective fun (s : Multiset α) a ↦ s.count a

Function.Injective fun s a => Multiset.count a s


theorem Basis.prod_parallelepiped (v : Basis ι ℝ E) (w : Basis ι' ℝ F) :
    (v.prod w).parallelepiped = v.parallelepiped.prod w.parallelepiped

{ι : Type u_1}
{ι' : Type u_2}
{E : Type u_3}
{F : Type u_4}
[Fintype ι]
[Fintype ι']
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[NormedSpace ℝ E]
[NormedSpace ℝ F]
(v : Basis ι ℝ E)
(w : Basis ι' ℝ F)


theorem Antiperiodic.const_inv_smul₀ [AddCommMonoid α] [Neg β] [DivisionSemiring γ] [Module γ α]
    (h : Antiperiodic f c) {a : γ} (ha : a ≠ 0) : Antiperiodic (fun x => f (a⁻¹ • x)) (a • c)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : α → β}
{c : α}
[AddCommMonoid α]
[Neg β]
[DivisionSemiring γ]
[Module γ α]
(h : Function.Antiperiodic f c)
{a : γ}
(ha : a ≠ 0)

Function.Antiperiodic (fun x => f (a⁻¹ • x)) (a • c)


@[simp]
lemma localization_unit_app (X₁ : C₁) :
    (adj.localization L₁ W₁ L₂ W₂ G' F').unit.app (L₁.obj X₁) =
    L₁.map (adj.unit.app X₁) ≫ (CatCommSq.iso F L₂ L₁ F').hom.app (G.obj X₁) ≫
      F'.map ((CatCommSq.iso G L₁ L₂ G').hom.app X₁)

(W₁ : CategoryTheory.MorphismProperty C₁)

(W₂ : CategoryTheory.MorphismProperty C₂)

(adj.localization L₁ W₁ L₂ W₂ G' F').unit.app (L₁.obj X₁) =
  CategoryTheory.CategoryStruct.comp (L₁.map (adj.unit.app X₁))
    (CategoryTheory.CategoryStruct.comp ((CategoryTheory.CatCommSq.iso F L₂ L₁ F').hom.app (G.obj X₁))
      (F'.map ((CategoryTheory.CatCommSq.iso G L₁ L₂ G').hom.app X₁)))


@[simp]
theorem mul_integral_comp_mul_sub :
    (c * ∫ x in a..b, f (c * x - d)) = ∫ x in c * a - d..c * b - d, f x

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


/-- Bind operation for `Set.PairwiseDisjoint`. In a complete lattice, you can use
`Set.PairwiseDisjoint.biUnion`. -/
theorem PairwiseDisjoint.biUnion_finset {s : Set ι'} {g : ι' → Finset ι} {f : ι → α}
    (hs : s.PairwiseDisjoint fun i' : ι' => (g i').sup f)
    (hg : ∀ i ∈ s, (g i : Set ι).PairwiseDisjoint f) : (⋃ i ∈ s, ↑(g i)).PairwiseDisjoint f

(hs : s.PairwiseDisjoint fun i' => (g i').sup f)

(hg : ∀ i ∈ s, (↑(g i)).PairwiseDisjoint f)


/-- The minimal polynomial of an element `x` is uniquely characterized by its defining property:
if there is another monic polynomial of minimal degree that has `x` as a root, then this polynomial
is equal to the minimal polynomial of `x`. See also `minpoly.IsIntegrallyClosed.Minpoly.unique`
which relaxes the assumptions on `A` in exchange for stronger assumptions on `B`. -/
theorem unique {p : A[X]} (pmonic : p.Monic) (hp : Polynomial.aeval x p = 0)
    (pmin : ∀ q : A[X], q.Monic → Polynomial.aeval x q = 0 → degree p ≤ degree q) :
    p = minpoly A x

(pmin : ∀ (q : A[X]), q.Monic → (Polynomial.aeval x) q = 0 → p.degree ≤ q.degree)


@[simp]
theorem nnnorm_coeFn_eq (f : α →ᵇ ℝ) : ⇑f.nnnorm = NNNorm.nnnorm ∘ ⇑f

{α : Type u}
[TopologicalSpace α]
(f : BoundedContinuousFunction α ℝ)


theorem det_eq_of_eq_mul_det_one {A B : Matrix n n R} (C : Matrix n n R) (hC : det C = 1)
    (hA : A = B * C) : det A = det B

{n : Type u_2}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
{A B : Matrix n n R}
(C : Matrix n n R)
(hC : C.det = 1)
(hA : A = B * C)


@[to_additive (attr := simp)]
theorem div_mul_mul_cancel (a b c : G) : a / c * (b * c) = a * b

{G : Type u_3}
[CommGroup G]
(a b c : G)


@[to_additive (attr := simp)]
theorem smul_univ {s : Set α} (hs : s.Nonempty) : s • (univ : Set β) = univ

{α : Type u_2}
{β : Type u_3}
[AddGroup α]
[AddAction α β]
{s : Set α}
(hs : s.Nonempty)


@[simp, nolint simpNF] lemma natCast_pos {n : ℕ} : (0 : ℤ) < n ↔ 0 < n


theorem image₂_singleton : image₂ f {a} {b} = {f a b}

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
[DecidableEq γ]
{f : α → β → γ}
{a : α}
{b : β}


lemma measurable_densityProcess_aux (κ : Kernel α (γ × β)) (ν : Kernel α γ) (n : ℕ)
    {s : Set β} (hs : MeasurableSet s) :
    Measurable (fun (p : α × γ) ↦
      κ p.1 (countablePartitionSet n p.2 ×ˢ s) / ν p.1 (countablePartitionSet n p.2))

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

Measurable fun p =>
  (κ p.1) (MeasurableSpace.countablePartitionSet n p.2 ×ˢ s) / (ν p.1) (MeasurableSpace.countablePartitionSet n p.2)


@[to_additive (attr := simp)]
theorem isBoundedUnder_le_inv [OrderedCommGroup α] {l : Filter β} {u : β → α} :
    (IsBoundedUnder (· ≤ ·) l fun x => (u x)⁻¹) ↔ IsBoundedUnder (· ≥ ·) l u

{α : Type u_1}
{β : Type u_2}
[OrderedCommGroup α]
{l : Filter β}
{u : β → α}

(Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l fun x => (u x)⁻¹) ↔ Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) l u


theorem continuous_iff_coinduced_le {t₁ : TopologicalSpace α} {t₂ : TopologicalSpace β} :
    Continuous[t₁, t₂] f ↔ coinduced f t₁ ≤ t₂

{α : Type u}
{β : Type v}
{f : α → β}
{t₁ : TopologicalSpace α}
{t₂ : TopologicalSpace β}

Continuous f ↔ TopologicalSpace.coinduced f t₁ ≤ t₂


theorem isVonNBounded_add :
    IsVonNBounded 𝕜 (s + t) ↔ s = ∅ ∨ t = ∅ ∨ IsVonNBounded 𝕜 s ∧ IsVonNBounded 𝕜 t

{𝕜 : Type u_1}
{E : Type u_3}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[ContinuousSMul 𝕜 E]
[ContinuousAdd E]
{s t : Set E}

Bornology.IsVonNBounded 𝕜 (s + t) ↔ s = ∅ ∨ t = ∅ ∨ Bornology.IsVonNBounded 𝕜 s ∧ Bornology.IsVonNBounded 𝕜 t


@[simp]
theorem cons_fs (a : α) (v : Vector3 α n) (i) : (a :: v) (fs i) = v i

{α : Type u_1}
{n : ℕ}
(a : α)
(v : Vector3 α n)
(i : Fin2 n)


theorem has_fderiv_at_filter_real_equiv {L : Filter E} :
    Tendsto (fun x' : E => ‖x' - x‖⁻¹ * ‖f x' - f x - f' (x' - x)‖) L (𝓝 0) ↔
      Tendsto (fun x' : E => ‖x' - x‖⁻¹ • (f x' - f x - f' (x' - x))) L (𝓝 0)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{f : E → F}
{f' : E →L[ℝ] F}
{x : E}
{L : Filter E}

Filter.Tendsto (fun x' => ‖x' - x‖⁻¹ * ‖f x' - f x - f' (x' - x)‖) L (𝓝 0) ↔
  Filter.Tendsto (fun x' => ‖x' - x‖⁻¹ • (f x' - f x - f' (x' - x))) L (𝓝 0)


@[to_additive]
theorem toWord_inv {x : FreeGroup α} : x⁻¹.toWord = invRev x.toWord

{α : Type u}
[DecidableEq α]
{x : FreeGroup α}


theorem count_eq_length {l : List α} : count a l = l.length ↔ ∀ b ∈ l, a = b

{α : Type u_1}
[DecidableEq α]
{a : α}
{l : List α}

List.count a l = l.length ↔ ∀ (b : α), b ∈ l → a = b


theorem lmarginal_singleton (f : (∀ i, π i) → ℝ≥0∞) (i : δ) :
    ∫⋯∫⁻_{i}, f ∂μ = fun x => ∫⁻ xᵢ, f (Function.update x i xᵢ) ∂μ i

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

∫⋯∫⁻_{i}, f ∂μ = fun x => ∫⁻ (xᵢ : π i), f (Function.update x i xᵢ) ∂μ i


/-- The upper closure of a finite set is closed in the lower topology. -/
theorem isClosed_upperClosure (h : s.Finite) : IsClosed (upperClosure s : Set α)

{α : Type u_1}
[Preorder α]
[TopologicalSpace α]
[Topology.IsLower α]
{s : Set α}
(h : s.Finite)


@[to_additive]
theorem mk_eq_mk_iff {a c : M} {b d : S} : mk a b = mk c d ↔ r S ⟨a, b⟩ ⟨c, d⟩

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{a c : M}
{b d : ↥S}

Localization.mk a b = Localization.mk c d ↔ (Localization.r S) (a, b) (c, d)


theorem epi_left_of_epi [HasPushouts C] {f g : Over X} (h : f ⟶ g) [Epi h] : Epi h.left

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X : C}
[CategoryTheory.Limits.HasPushouts C]
{f g : CategoryTheory.Over X}
(h : f ⟶ g)
[CategoryTheory.Epi h]


/-- See also `not_nonempty_iff_eq_empty'`. -/
theorem nonempty_iff_ne_empty' : Nonempty s ↔ s ≠ ∅


protected theorem uniformity_eq : 𝓤 (α →ᵤ[𝔖] β) = ⨅ s ∈ 𝔖, ⨅ V ∈ 𝓤 β, 𝓟 (UniformOnFun.gen 𝔖 s V)

{α : Type u_1}
(β : Type u_2)
[UniformSpace β]
(𝔖 : Set (Set α))


theorem let_value_heq {α : Sort v} {β : α → Sort u} {a₁ a₂ : α} (b : ∀ x : α, β x)
    (h : a₁ = a₂) : HEq (let x : α := a₁; b x) (let x : α := a₂; b x)

{α : Sort v}
{β : α → Sort u}
{a₁ a₂ : α}
(b : (x : α) → β x)
(h : a₁ = a₂)

HEq
  (let x := a₁;
  b x)
  (let x := a₂;
  b x)


/-- The limit bicone for the biproduct over an index type with exactly one term. -/
@[simps]
def limitBiconeOfUnique : LimitBicone f

(CategoryTheory.Limits.limitBiconeOfUnique f).isBilimit.isLimit = (CategoryTheory.Limits.limitConeOfUnique f).isLimit


theorem firstDiff_lt_shortestPrefixDiff {s : Set (∀ n, E n)} (hs : IsClosed s) {x y : ∀ n, E n}
    (hx : x ∉ s) (hy : y ∈ s) : firstDiff x y < shortestPrefixDiff x s

{E : ℕ → Type u_1}
[(n : ℕ) → TopologicalSpace (E n)]
[∀ (n : ℕ), DiscreteTopology (E n)]
{s : Set ((n : ℕ) → E n)}
(hs : IsClosed s)
{x y : (n : ℕ) → E n}
(hx : x ∉ s)
(hy : y ∈ s)

PiNat.firstDiff x y < PiNat.shortestPrefixDiff x s


theorem measurableSet_of_filtration [Preorder ι] {f : Filtration ι m} {s : Set Ω} {i : ι}
    (hs : MeasurableSet[f i] s) : MeasurableSet[m] s

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[Preorder ι]
{f : MeasureTheory.Filtration ι m}
{s : Set Ω}
{i : ι}
(hs : MeasurableSet s)


@[simp]
theorem singleton_subset_iff {a : α} {s : Set α} : {a} ⊆ s ↔ a ∈ s


theorem mem_normalizer_fintype {S : Set G} [Finite S] {x : G} (h : ∀ n, n ∈ S → x * n * x⁻¹ ∈ S) :
    x ∈ Subgroup.setNormalizer S

{G : Type u_1}
[Group G]
{S : Set G}
[Finite ↑S]
{x : G}
(h : ∀ n ∈ S, x * n * x⁻¹ ∈ S)


/-- If `x : R` is multiplicative for `f`, then `seminormFromConst' hf1 hc hpm x = f x`. -/
theorem seminormFromConst_apply_of_isMul {x : R} (hx : ∀ y : R, f (x * y) = f x * f y) :
    seminormFromConst' hf1 hc hpm x = f x

{R : Type u_1}
[CommRing R]
{c : R}
{f : RingSeminorm R}
(hf1 : f 1 ≤ 1)
(hc : f c ≠ 0)
(hpm : IsPowMul ⇑f)
{x : R}
(hx : ∀ (y : R), f (x * y) = f x * f y)


protected theorem add {B₁ B₂ : BilinForm R M} (hB₁ : B₁.IsAlt) (hB₂ : B₂.IsAlt) : (B₁ + B₂).IsAlt

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{B₁ B₂ : LinearMap.BilinForm R M}
(hB₁ : B₁.IsAlt)
(hB₂ : B₂.IsAlt)


theorem IsLimit.one_lt {o : Ordinal} (h : IsLimit o) : 1 < o


lemma of_unop (W : MorphismProperty Cᵒᵖ) [IsMultiplicative W.unop] : IsMultiplicative W

(W : CategoryTheory.MorphismProperty Cᵒᵖ)


theorem cardinal_mk_eq_sum' : #(WType β) = sum (fun a : α => #(WType β) ^ lift.{u} #(β a))

Cardinal.mk (WType β) = Cardinal.sum fun a => Cardinal.mk (WType β) ^ Cardinal.lift.{u, v} (Cardinal.mk (β a))


@[to_additive]
lemma inv [Inv γ] [MeasurableInv γ] (h : IdentDistrib f g μ ν) :
    IdentDistrib f⁻¹ g⁻¹ μ ν

(h : ProbabilityTheory.IdentDistrib f g μ ν)

ProbabilityTheory.IdentDistrib (-f) (-g) μ ν


protected lemma subsingleton_or_nontrivial (s : Set α) : s.Subsingleton ∨ s.Nontrivial


theorem exists_associated_pow_of_associated_pow_mul {a b c : R} (hab : IsCoprime a b) {k : ℕ}
    (h : Associated (c ^ k) (a * b)) : ∃ d : R, Associated (d ^ k) a

{R : Type u}
[CommRing R]
[IsDomain R]
[IsBezout R]
{a b c : R}
(hab : IsCoprime a b)
{k : ℕ}
(h : Associated (c ^ k) (a * b))


theorem degree_interpolate_lt (hvs : Set.InjOn v s) : (interpolate s v r).degree < s.card

{F : Type u_1}
[Field F]
{ι : Type u_2}
[DecidableEq ι]
{s : Finset ι}
{v : ι → F}
(r : ι → F)
(hvs : Set.InjOn v ↑s)

((Lagrange.interpolate s v) r).degree < ↑s.card


protected theorem find_spec : p (Nat.find H)

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


theorem length_mul_ge_max (w₁ w₂ : W) :
    max (ℓ w₁ - ℓ w₂) (ℓ w₂ - ℓ w₁) ≤ ℓ (w₁ * w₂)

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
(w₁ w₂ : W)

max (cs.length w₁ - cs.length w₂) (cs.length w₂ - cs.length w₁) ≤ cs.length (w₁ * w₂)


@[simp]
theorem filter_const (p : Prop) [Decidable p] (s : Finset α) :
    (s.filter fun _a => p) = if p then s else ∅

{α : Type u_1}
(p : Prop)
[Decidable p]
(s : Finset α)

Finset.filter (fun _a => p) s = if p then s else ∅


/-- Precomposing `f` with `Prod.fst` is `C^n` at `(x, y)` -/
theorem ContDiffAt.fst' {f : E → G} {x : E} {y : F} (hf : ContDiffAt 𝕜 n f x) :
    ContDiffAt 𝕜 n (fun x : E × F => f x.1) (x, y)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{n : ℕ∞}
{f : E → G}
{x : E}
{y : F}
(hf : ContDiffAt 𝕜 n f x)


lemma IsSelfAdjoint.coe_mem_spectrum_complex {A : Type*} [TopologicalSpace A] [Ring A]
    [StarRing A] [Algebra ℂ A] [ContinuousFunctionalCalculus ℂ (IsStarNormal : A → Prop)]
    {a : A} {x : ℝ} (ha : IsSelfAdjoint a := by cfc_tac) :
    (x : ℂ) ∈ spectrum ℂ a ↔ x ∈ spectrum ℝ a


@[simp]
theorem natPred_le_natPred {m n : ℕ+} : m.natPred ≤ n.natPred ↔ m ≤ n


lemma inf_mem_infClosure (ha : a ∈ s) (hb : b ∈ s) : a ⊓ b ∈ infClosure s

{α : Type u_2}
[SemilatticeInf α]
{s : Set α}
{a b : α}
(ha : a ∈ s)
(hb : b ∈ s)


/-- The region between two measurable functions on a measurable set is measurable;
a version for the region together with the graph of the upper function. -/
theorem measurableSet_region_between_oc (hf : Measurable f) (hg : Measurable g)
    (hs : MeasurableSet s) :
    MeasurableSet { p : α × ℝ | p.fst ∈ s ∧ p.snd ∈ Ioc (f p.fst) (g p.fst) }

{α : Type u_1}
[MeasurableSpace α]
{f g : α → ℝ}
{s : Set α}
(hf : Measurable f)
(hg : Measurable g)
(hs : MeasurableSet s)

MeasurableSet {p | p.1 ∈ s ∧ p.2 ∈ Set.Ioc (f p.1) (g p.1)}


@[simp] theorem getRight?_map (f : α → β) (g : γ → δ) (x : α ⊕ γ) :
    (x.map f g).getRight? = x.getRight?.map g

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
(f : α → β)
(g : γ → δ)
(x : α ⊕ γ)

(Sum.map f g x).getRight? = Option.map g x.getRight?


theorem NormedAddCommGroup.norm_toCompl (x : G) : ‖toCompl x‖ = ‖x‖

{G : Type u_1}
[SeminormedAddCommGroup G]
(x : G)


theorem mem_coeSubmodule (I : Ideal R) {x : S} :
    x ∈ coeSubmodule S I ↔ ∃ y : R, y ∈ I ∧ algebraMap R S y = x

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

x ∈ IsLocalization.coeSubmodule S I ↔ ∃ y ∈ I, (algebraMap R S) y = x


/-- The canonical `S`-algebra projection `TrivSqZeroExt R M → R`. -/
@[simps]
def fstHom : tsze R M →ₐ[S] R

(S : Type u_1)
(R : Type u)
(M : Type v)
[CommSemiring S]
[Semiring R]
[AddCommMonoid M]
[Algebra S R]
[Module S M]
[Module R M]
[Module Rᵐᵒᵖ M]
[SMulCommClass R Rᵐᵒᵖ M]
[IsScalarTower S R M]
[IsScalarTower S Rᵐᵒᵖ M]
(x : tsze R M)


protected theorem Subperm.sym2 {xs ys : List α} (h : xs <+~ ys) : xs.sym2 <+~ ys.sym2

{α : Type u_1}
{xs ys : List α}
(h : xs.Subperm ys)


@[simp]
theorem decompose_symm_sum {ι'} (s : Finset ι') (f : ι' → ⨁ i, ℳ i) :
    (decompose ℳ).symm (∑ i ∈ s, f i) = ∑ i ∈ s, (decompose ℳ).symm (f i)

{ι : Type u_1}
{M : Type u_3}
{σ : Type u_4}
[DecidableEq ι]
[AddCommMonoid M]
[SetLike σ M]
[AddSubmonoidClass σ M]
(ℳ : ι → σ)
[DirectSum.Decomposition ℳ]
{ι' : Type u_5}
(s : Finset ι')
(f : ι' → ⨁ (i : ι), ↥(ℳ i))

(DirectSum.decompose ℳ).symm (∑ i ∈ s, f i) = ∑ i ∈ s, (DirectSum.decompose ℳ).symm (f i)


theorem inv_sqrt_one_add_tan_sq {x : ℝ} (hx : 0 < cos x) : (√(1 + tan x ^ 2))⁻¹ = cos x


theorem thickenedIndicatorAux_one_of_mem_closure (δ : ℝ) (E : Set α) {x : α}
    (x_mem : x ∈ closure E) : thickenedIndicatorAux δ E x = 1

{α : Type u_1}
[PseudoEMetricSpace α]
(δ : ℝ)
(E : Set α)
{x : α}
(x_mem : x ∈ closure E)


@[measurability]
theorem measurable_cosh : Measurable cosh


/-- In a topological vector space over a nontrivially normed field, any neighborhood of zero has
the same cardinality as the whole space.

See also `cardinal_eq_of_mem_nhds`. -/
lemma cardinal_eq_of_mem_nhds_zero
    {E : Type*} (𝕜 : Type*) [NontriviallyNormedField 𝕜] [AddCommGroup E] [Module 𝕜 E]
    [TopologicalSpace E] [ContinuousSMul 𝕜 E] {s : Set E} (hs : s ∈ 𝓝 (0 : E)) : #s = #E

{E : Type u_1}
(𝕜 : Type u_2)
[NontriviallyNormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[ContinuousSMul 𝕜 E]
{s : Set E}
(hs : s ∈ 𝓝 0)


@[simp]
theorem empty_lookupFinsupp : lookupFinsupp (∅ : AList fun _x : α => M) = 0


theorem inv_le_iff_le_mul (h₁ : b = ∞ → a ≠ 0) (h₂ : a = ∞ → b ≠ 0) : a⁻¹ ≤ b ↔ 1 ≤ a * b

{a b : ENNReal}
(h₁ : b = ⊤ → a ≠ 0)
(h₂ : a = ⊤ → b ≠ 0)


/-- If `X` is an affine scheme, every closed set of `X` is the zero locus
of a set of global sections. -/
lemma Scheme.eq_zeroLocus_of_isClosed_of_isAffine (X : Scheme.{u}) [IsAffine X] (s : Set X) :
    IsClosed s ↔ ∃ I : Ideal (Γ(X, ⊤)), s = X.zeroLocus (I : Set Γ(X, ⊤))

(X : AlgebraicGeometry.Scheme)
[AlgebraicGeometry.IsAffine X]
(s : Set ↑↑X.toPresheafedSpace)


theorem equiv_snd_eq_iff_rightCosetEquivalence {g₁ g₂ : G} :
    (hHT.equiv g₁).snd = (hHT.equiv g₂).snd ↔ RightCosetEquivalence H g₁ g₂

{G : Type u_1}
[Group G]
{H : Subgroup G}
{T : Set G}
(hHT : Subgroup.IsComplement (↑H) T)
{g₁ g₂ : G}

(hHT.equiv g₁).2 = (hHT.equiv g₂).2 ↔ RightCosetEquivalence (↑H) g₁ g₂


theorem dvd_of_mem_factors {p a : α} (h : p ∈ factors a) : p ∣ a

(h : p ∈ UniqueFactorizationMonoid.factors a)


@[simp]
theorem psub_succ {m n : ℕ} : psub m (succ n) = psub m n >>= ppred


/-- `UniformOnFun.gen` is antitone in the first argument and monotone in the second. -/
protected theorem gen_mono {𝔖} {S S' : Set α} {V V' : Set (β × β)} (hS : S' ⊆ S) (hV : V ⊆ V') :
    UniformOnFun.gen 𝔖 S V ⊆ UniformOnFun.gen 𝔖 S' V'

{α : Type u_1}
{β : Type u_2}
{𝔖 : Set (Set α)}
{S S' : Set α}
{V V' : Set (β × β)}
(hS : S' ⊆ S)
(hV : V ⊆ V')


theorem lintegral_eq_of_lmarginal_eq [Fintype δ] (s : Finset δ) {f g : (∀ i, π i) → ℝ≥0∞}
    (hf : Measurable f) (hg : Measurable g) (hfg : ∫⋯∫⁻_s, f ∂μ = ∫⋯∫⁻_s, g ∂μ) :
    ∫⁻ x, f x ∂Measure.pi μ = ∫⁻ x, g x ∂Measure.pi μ

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

[∀ (i : δ), MeasureTheory.SigmaFinite (μ i)]

∫⁻ (x : (i : δ) → π i), f x ∂MeasureTheory.Measure.pi μ = ∫⁻ (x : (i : δ) → π i), g x ∂MeasureTheory.Measure.pi μ


theorem duplicate_cons_iff_of_ne {y : α} (hne : x ≠ y) : x ∈+ y :: l ↔ x ∈+ l

{α : Type u_1}
{l : List α}
{x y : α}
(hne : x ≠ y)

List.Duplicate x (y :: l) ↔ List.Duplicate x l


@[simp]
theorem val_mul (n : ℕ) (x y : AdicCompletion I R) : (x * y).val n = x.val n * y.val n

{R : Type u_1}
[CommRing R]
(I : Ideal R)
(n : ℕ)
(x y : AdicCompletion I R)


theorem continuousOn_iff_lower_upperSemicontinuousOn {f : α → γ} :
    ContinuousOn f s ↔ LowerSemicontinuousOn f s ∧ UpperSemicontinuousOn f s

{α : Type u_1}
[TopologicalSpace α]
{s : Set α}
{γ : Type u_3}
[LinearOrder γ]
[TopologicalSpace γ]
[OrderTopology γ]
{f : α → γ}


theorem mapDomain_algebraMap (A : Type*) {H F : Type*} [CommSemiring k] [Semiring A] [Algebra k A]
    [AddMonoid G] [AddMonoid H] [FunLike F G H] [AddMonoidHomClass F G H]
    (f : F) (r : k) :
    mapDomain f (algebraMap k A[G] r) = algebraMap k A[H] r

{k : Type u₁}
{G : Type u₂}
(A : Type u_3)
{H : Type u_4}
{F : Type u_5}
[CommSemiring k]
[Semiring A]
[Algebra k A]
[AddMonoid G]
[AddMonoid H]
[FunLike F G H]
[AddMonoidHomClass F G H]
(f : F)
(r : k)

AddMonoidAlgebra.mapDomain (⇑f) ((algebraMap k (AddMonoidAlgebra A G)) r) = (algebraMap k (AddMonoidAlgebra A H)) r


@[simp] theorem dropLast_append_of_ne_nil {α : Type u} {l : List α} :
    ∀ (l' : List α) (_ : l ≠ []), (l' ++ l).dropLast = l' ++ l.dropLast

l ≠ [] → (l' ++ l).dropLast = l' ++ l.dropLast


theorem hasDerivAt_sqrt_mul_log {x : ℝ} (hx : x ≠ 0) :
    HasDerivAt (fun x => √x * log x) ((2 + log x) / (2 * √x)) x

HasDerivAt (fun x => √x * Real.log x) ((2 + Real.log x) / (2 * √x)) x


theorem pullback_base (i j k : D.J) (S : Set (D.V (i, j)).carrier) :
    (π₂ i, j, k) '' ((π₁ i, j, k) ⁻¹' S) = D.f i k ⁻¹' (D.f i j '' S)

(D : AlgebraicGeometry.PresheafedSpace.GlueData C)

⇑(CategoryTheory.Limits.pullback.snd (D.f i j) (D.f i k)).base ''
    (⇑(CategoryTheory.Limits.pullback.fst (D.f i j) (D.f i k)).base ⁻¹' S) =
  ⇑(D.f i k).base ⁻¹' (⇑(D.f i j).base '' S)


@[to_additive (attr := simp)]
theorem toOrderHom_eq_coe (f : α →*o β) : f.toOrderHom = f

{α : Type u_2}
{β : Type u_3}
{hα : OrderedAddCommMonoid α}
{hβ : OrderedAddCommMonoid β}
(f : α →+o β)


theorem Pairwise.set_pairwise (hl : Pairwise R l) (hr : Symmetric R) : { x | x ∈ l }.Pairwise R

{α : Type u_1}
{R : α → α → Prop}
{l : List α}
(hl : List.Pairwise R l)
(hr : Symmetric R)


theorem MDifferentiableAt.add (hf : MDifferentiableAt I 𝓘(𝕜, E') f z)
    (hg : MDifferentiableAt I 𝓘(𝕜, E') g z) : MDifferentiableAt I 𝓘(𝕜, E') (f + g) z

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{z : M}
{f g : M → E'}
(hf : MDifferentiableAt I 𝓘(𝕜, E') f z)
(hg : MDifferentiableAt I 𝓘(𝕜, E') g z)


/-- Typeclass for expressing that a type `M` with multiplication and a one satisfies
`1 * a = a` and `a * 1 = a` for all `a : M`. -/
class MulOneClass (M : Type u) extends One M, Mul M where
  /-- One is a left neutral element for multiplication -/
  protected one_mul : ∀ a : M, 1 * a = a
  /-- One is a right neutral element for multiplication -/
  protected mul_one : ∀ a : M, a * 1 = a

{M : Type u}
[self : MulOneClass M]
(a : M)


/-- A version of `dist_le_range_sum_dist` with each intermediate distance replaced
with an upper estimate. -/
theorem dist_le_range_sum_of_dist_le {f : ℕ → α} (n : ℕ) {d : ℕ → ℝ}
    (hd : ∀ {k}, k < n → dist (f k) (f (k + 1)) ≤ d k) :
    dist (f 0) (f n) ≤ ∑ i ∈ Finset.range n, d i

(hd : ∀ {k : ℕ}, k < n → dist (f k) (f (k + 1)) ≤ d k)


@[simp] theorem ofDistribMulAction_apply_apply (g : G) (a : A) :
    ofDistribMulAction k G A g a = g • a

{k : Type u_1}
{G : Type u_2}
{A : Type u_3}
[CommSemiring k]
[Monoid G]
[AddCommMonoid A]
[Module k A]
[DistribMulAction G A]
[SMulCommClass G k A]
(g : G)
(a : A)

((Representation.ofDistribMulAction k G A) g) a = g • a


theorem continuousAt_zero [TopologicalSpace E] [ContinuousConstSMul 𝕜 E] {p : Seminorm 𝕜 E} {r : ℝ}
    (hp : p.ball 0 r ∈ (𝓝 0 : Filter E)) : ContinuousAt p 0

{𝕜 : Type u_3}
{E : Type u_7}
[NontriviallyNormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[ContinuousConstSMul 𝕜 E]
{p : Seminorm 𝕜 E}
{r : ℝ}
(hp : p.ball 0 r ∈ 𝓝 0)


@[to_additive]
theorem ne_one_of_mem_sphere (hr : r ≠ 0) (x : sphere (1 : E) r) : (x : E) ≠ 1

{E : Type u_6}
[SeminormedAddGroup E]
{r : ℝ}
(hr : r ≠ 0)
(x : ↑(Metric.sphere 0 r))


/-- The functor `Arrow (Arrow C) ⥤ Square C` which sends
a morphism `Arrow.mk f ⟶ Arrow.mk g` to the commutative square
with `f` on the left side and `g` on the right side. -/
@[simps!]
def fromArrowArrowFunctor : Arrow (Arrow C) ⥤ Square C

(f : CategoryTheory.Arrow (CategoryTheory.Arrow C))

(CategoryTheory.Square.fromArrowArrowFunctor.obj f).f₃₄ = f.hom.right


@[simp]
theorem replicate_inter (n : ℕ) (x : α) (s : Multiset α) :
    replicate n x ∩ s = replicate (min n (s.count x)) x

{α : Type u_1}
[DecidableEq α]
(n : ℕ)
(x : α)
(s : Multiset α)

Multiset.replicate n x ∩ s = Multiset.replicate (min n (Multiset.count x s)) x


@[simp]
theorem bind_zero_right (m : Measure α) : bind m (0 : α → Measure β) = 0

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


theorem IsSeparable.secondCountableTopology [PseudoMetrizableSpace X] {s : Set X}
    (hs : IsSeparable s) : SecondCountableTopology s


theorem FG.stabilizes_of_iSup_eq {M' : Submodule R M} (hM' : M'.FG) (N : ℕ →o Submodule R M)
    (H : iSup N = M') : ∃ n, M' = N n

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{M' : Submodule R M}
(hM' : M'.FG)
(N : ℕ →o Submodule R M)
(H : iSup ⇑N = M')


@[simp]
theorem op_top : (⊤ : Subring R).op = ⊤


theorem toFinset_eq_iff_perm_dedup : l.toFinset = l'.toFinset ↔ l.dedup ~ l'.dedup

{α : Type u_1}
[DecidableEq α]
{l l' : List α}

l.toFinset = l'.toFinset ↔ l.dedup.Perm l'.dedup


theorem HasStrictDerivAt.cexp (hf : HasStrictDerivAt f f' x) :
    HasStrictDerivAt (fun x => Complex.exp (f x)) (Complex.exp (f x) * f') x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[NormedAlgebra 𝕜 ℂ]
{f : 𝕜 → ℂ}
{f' : ℂ}
{x : 𝕜}
(hf : HasStrictDerivAt f f' x)


/-- A topology `Inducing` map from a T₀ space is injective. -/
protected theorem Inducing.injective [TopologicalSpace Y] [T0Space X] {f : X → Y}
    (hf : Inducing f) : Injective f

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[T0Space X]
{f : X → Y}
(hf : Inducing f)


theorem upperBounds_Icc (h : a ≤ b) : upperBounds (Icc a b) = Ici b

{α : Type u}
[Preorder α]
{a b : α}
(h : a ≤ b)


theorem reflectsMonomorphisms.iso_iff {F G : C ⥤ D} (α : F ≅ G) :
    ReflectsMonomorphisms F ↔ ReflectsMonomorphisms G

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F G : C ⥤ D}
(α : F ≅ G)


@[to_additive (attr := simp)]
theorem coe_id' {G : Type _} [Group G] :
    @DFunLike.coe (G →* G) G (fun _ ↦ G) MonoidHom.instFunLike
      (CategoryStruct.id (X := Grp.of G)) = id


/-- A Heyting algebra is a bounded lattice with an additional binary operation `⇨` called Heyting
implication such that `a ⇨` is right adjoint to `a ⊓`. -/
class HeytingAlgebra (α : Type*) extends GeneralizedHeytingAlgebra α, OrderBot α, HasCompl α where
  /-- `a ⇨` is right adjoint to `a ⊓` -/
  himp_bot (a : α) : a ⇨ ⊥ = aᶜ

{α : Type u_4}
[self : HeytingAlgebra α]
(a : α)


@[to_additive]
theorem mulETransformLeft.card :
    (mulETransformLeft e x).1.card + (mulETransformRight e x).1.card = 2 * x.1.card

{α : Type u_1}
[DecidableEq α]
[AddGroup α]
(e : α)
(x : Finset α × Finset α)

(Finset.addETransformLeft e x).1.card + (Finset.addETransformRight e x).1.card = 2 * x.1.card


lemma surj_on_of_inj_on_of_card_le (f : ∀ a ∈ s, β) (hf : ∀ a ha, f a ha ∈ t)
    (hinj : ∀ a₁ a₂ ha₁ ha₂, f a₁ ha₁ = f a₂ ha₂ → a₁ = a₂) (hst : t.card ≤ s.card) :
    ∀ b ∈ t, ∃ a ha, b = f a ha

(hf : ∀ (a : α) (ha : a ∈ s), f a ha ∈ t)

(hinj : ∀ (a₁ a₂ : α) (ha₁ : a₁ ∈ s) (ha₂ : a₂ ∈ s), f a₁ ha₁ = f a₂ ha₂ → a₁ = a₂)


@[simp]
theorem join_ret (s : WSeq α) : join (ret s) ~ʷ s


/-- The image sheaf of a morphism between sheaves, defined to be the sheafification of
`image_presheaf`. -/
@[simps]
def imageSheaf {F F' : Sheaf J (Type w)} (f : F ⟶ F') : Sheaf J (Type w)

{J : CategoryTheory.GrothendieckTopology C}

{F F' : CategoryTheory.Sheaf J (Type w)}

(CategoryTheory.GrothendieckTopology.imageSheaf f).val =
  (CategoryTheory.GrothendieckTopology.Subpresheaf.sheafify J
      (CategoryTheory.GrothendieckTopology.imagePresheaf f.val)).toPresheaf


theorem not_btw_of_sbtw {a b c : α} (h : sbtw a b c) : ¬btw c b a

{α : Type u_1}
[CircularPreorder α]
{a b c : α}
(h : sbtw a b c)


/-- Substitution `y = x ^ p` in integrals over `Ioi 0` -/
theorem integral_comp_rpow_Ioi (g : ℝ → E) {p : ℝ} (hp : p ≠ 0) :
    (∫ x in Ioi 0, (|p| * x ^ (p - 1)) • g (x ^ p)) = ∫ y in Ioi 0, g y

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(g : ℝ → E)
{p : ℝ}
(hp : p ≠ 0)

∫ (x : ℝ) in Set.Ioi 0, (|p| * x ^ (p - 1)) • g (x ^ p) = ∫ (y : ℝ) in Set.Ioi 0, g y


/-- Any `S`-algebra homomorphism `f : A →ₐ[S] B` which respects a relation `s : A → A → Prop`
factors uniquely through a morphism `RingQuot s →ₐ[S] B`.
-/
irreducible_def liftAlgHom {s : A → A → Prop} :
  { f : A →ₐ[S] B // ∀ ⦃x y⦄, s x y → f x = f y } ≃ (RingQuot s →ₐ[S] B)

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

RingQuot.liftAlgHom S =
  { toFun := fun f' => RingQuot.preLiftAlgHom S ⋯, invFun := fun F => ⟨F.comp (RingQuot.mkAlgHom S s), ⋯⟩,
    left_inv := ⋯, right_inv := ⋯ }


@[simp]
theorem inl_lt_inl_iff [LT α] [LT β] {a b : α} : (inl a : α ⊕ β) < inl b ↔ a < b

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


theorem list_length : Computable (@List.length α)


theorem liftAux.smul {φ : MultilinearMap R s E} (r : R) (x : ⨂[R] i, s i) :
    liftAux φ (r • x) = r • liftAux φ x

{ι : Type u_1}
{R : Type u_4}
[CommSemiring R]
{s : ι → Type u_7}
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]
{E : Type u_9}
[AddCommMonoid E]
[Module R E]
{φ : MultilinearMap R s E}
(r : R)
(x : PiTensorProduct R fun i => s i)

(PiTensorProduct.liftAux φ) (r • x) = r • (PiTensorProduct.liftAux φ) x


@[simp] lemma card_pi [DecidableEq ι] [∀ i, Fintype (α i)] : card (∀ i, α i) = ∏ i, card (α i)

{ι : Type u_4}
{α : ι → Type u_6}
[Fintype ι]
[DecidableEq ι]
[(i : ι) → Fintype (α i)]

Fintype.card ((i : ι) → α i) = ∏ i : ι, Fintype.card (α i)


/-- A morphism that is surjective on pseudoelements is an epimorphism. -/
theorem epi_of_pseudo_surjective {P Q : C} (f : P ⟶ Q) : Function.Surjective f → Epi f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
{P Q : C}
(f : P ⟶ Q)

Function.Surjective (CategoryTheory.Abelian.Pseudoelement.pseudoApply f) → CategoryTheory.Epi f


@[simp]
theorem tensorRightTensor_inv_app (X Y Z : C) :
    (tensorRightTensor X Y).inv.app Z = (associator Z X Y).hom

{C : Type u}
[𝒞 : CategoryTheory.Category.{v, u} C]
[CategoryTheory.MonoidalCategory C]
(X Y Z : C)

(CategoryTheory.MonoidalCategory.tensorRightTensor X Y).inv.app Z =
  (CategoryTheory.MonoidalCategory.associator Z X Y).hom


lemma spectrum_nonneg_of_nonneg {𝕜 A : Type*} [OrderedCommSemiring 𝕜] [Ring A] [PartialOrder A]
    [Algebra 𝕜 A] [NonnegSpectrumClass 𝕜 A] ⦃a : A⦄ (ha : 0 ≤ a) ⦃x : 𝕜⦄ (hx : x ∈ spectrum 𝕜 a) :
    0 ≤ x

{𝕜 : Type u_3}
{A : Type u_4}
[OrderedCommSemiring 𝕜]
[Ring A]
[PartialOrder A]
[Algebra 𝕜 A]
[NonnegSpectrumClass 𝕜 A]
⦃a : A⦄
(ha : 0 ≤ a)
⦃x : 𝕜⦄
(hx : x ∈ spectrum 𝕜 a)


protected theorem Reachable.exists_walk_length_eq_edist (hr : G.Reachable u v) :
    ∃ p : G.Walk u v, p.length = G.edist u v

{V : Type u_1}
{G : SimpleGraph V}
{u v : V}
(hr : G.Reachable u v)


theorem nullMeasurableSet_univ : NullMeasurableSet univ μ

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}


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

{α : Type u}
{β : Type v}
[SemilatticeSup β]
{f g : α → β}
{a : α}
{l : Filter α}
(hf : IsMaxFilter f l a)
(hg : IsMaxFilter g l a)


@[simp]
theorem restrict_apply (f : C(α, β)) (s : Set α) (x : s) : f.restrict s x = f x

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
(f : C(α, β))
(s : Set α)
(x : ↑s)


@[simp]
theorem involute_ι (m : M) : involute (ι Q m) = -ι Q m

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}
(m : M)

CliffordAlgebra.involute ((CliffordAlgebra.ι Q) m) = -(CliffordAlgebra.ι Q) m


theorem floor_of_nonpos (ha : a ≤ 0) : ⌊a⌋₊ = 0

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
{a : α}
(ha : a ≤ 0)


@[simp]
theorem add_toZNum (m n : Num) : Num.toZNum (m + n) = m.toZNum + n.toZNum


theorem mem_top {c d : C} (f : c ⟶ d) : f ∈ (⊤ : Subgroupoid C).arrows c d

{C : Type u}
[CategoryTheory.Groupoid C]
{c d : C}
(f : c ⟶ d)


@[to_additive (attr := simp) neg_zsmul]
lemma zpow_neg (a : α) : ∀ n : ℤ, a ^ (-n) = (a ^ n)⁻¹

{α : Type u_1}
[DivisionMonoid α]
(a : α)
(n : ℤ)


/-- Assumes left covariance.
The lemma assuming right covariance is `Right.one_lt_mul'`. -/
@[to_additive Left.add_pos' "Assumes left covariance.
The lemma assuming right covariance is `Right.add_pos'`."]
theorem Left.one_lt_mul' [CovariantClass α α (· * ·) (· ≤ ·)] {a b : α} (ha : 1 < a) (hb : 1 < b) :
    1 < a * b

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


theorem mem_pure_self (a : α) : a ∈ (pure a : Semiquot α)


/-- Product of modules is commutative up to linear isomorphism. -/
@[simps apply]
def prodComm (R M N : Type*) [Semiring R] [AddCommMonoid M] [AddCommMonoid N] [Module R M]
    [Module R N] : (M × N) ≃ₗ[R] N × M

(R : Type u_3)
(M : Type u_4)
(N : Type u_5)
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]

∀ (a : M × N), (LinearEquiv.prodComm R M N) a = a.swap


/-- A non-unital ring hom `α →ₙ+* β` can equivalently be viewed as a non-unital ring hom
`αᵐᵒᵖ →+* βᵐᵒᵖ`. This is the action of the (fully faithful) `ᵐᵒᵖ`-functor on morphisms. -/
@[simps]
def NonUnitalRingHom.op {α β} [NonUnitalNonAssocSemiring α] [NonUnitalNonAssocSemiring β] :
    (α →ₙ+* β) ≃ (αᵐᵒᵖ →ₙ+* βᵐᵒᵖ)

{α : Type u_2}
{β : Type u_3}
[NonUnitalNonAssocSemiring α]
[NonUnitalNonAssocSemiring β]
(f : αᵐᵒᵖ →ₙ+* βᵐᵒᵖ)

∀ (a : α), (NonUnitalRingHom.op.symm f) a = (↑(AddMonoidHom.mulUnop f.toAddMonoidHom)).toFun a


@[simp]
theorem div_self {a : Ordinal} (h : a ≠ 0) : a / a = 1


/--
Given a natural isomorphism `G ⋙ ℱ ≅ G ⋙ ℱ'` between presheaves of arbitrary category,
where `G` is locally-full and cover-dense, and `ℱ', ℱ` are sheaves,
we may obtain a natural isomorphism between presheaves.
-/
@[simps!]
noncomputable def presheafIso {ℱ ℱ' : Sheaf K A} (i : G.op ⋙ ℱ.val ≅ G.op ⋙ ℱ'.val) :
    ℱ.val ≅ ℱ'.val

{K : CategoryTheory.GrothendieckTopology D}

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

(CategoryTheory.Functor.IsCoverDense.presheafIso i).hom.app X =
  CategoryTheory.yoneda.preimage ((CategoryTheory.Functor.IsCoverDense.sheafYonedaHom i.hom).app X)


/-- The Riemann Zeta Function does not vanish on the half-plane `re s > 1`. -/
lemma riemannZeta_ne_zero_of_one_lt_re {s : ℂ} (hs : 1 < s.re) : riemannZeta s ≠ 0


@[simp]
theorem isOrtho_self {U : Submodule 𝕜 E} : U ⟂ U ↔ U = ⊥

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{U : Submodule 𝕜 E}


@[norm_cast, simp]
theorem coe_smul (t : R) (f : M →ₗ⁅R,L⁆ N) : ⇑(t • f) = t • (⇑f)

{R : Type u}
{L : Type v}
{M : Type w}
{N : Type w₁}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
[LieRingModule L M]
[LieRingModule L N]
[LieModule R L N]
(t : R)
(f : M →ₗ⁅R,L⁆ N)


theorem is_coprod_iff_isPushout {X E Y YE : C} (c : BinaryCofan X E) (hc : IsColimit c) {f : X ⟶ Y}
    {iY : Y ⟶ YE} {fE : c.pt ⟶ YE} (H : CommSq f c.inl iY fE) :
    Nonempty (IsColimit (BinaryCofan.mk (c.inr ≫ fE) iY)) ↔ IsPushout f c.inl iY fE

(c : CategoryTheory.Limits.BinaryCofan X E)

(hc : CategoryTheory.Limits.IsColimit c)

(H : CategoryTheory.CommSq f c.inl iY fE)

Nonempty
    (CategoryTheory.Limits.IsColimit
      (CategoryTheory.Limits.BinaryCofan.mk (CategoryTheory.CategoryStruct.comp c.inr fE) iY)) ↔
  CategoryTheory.IsPushout f c.inl iY fE


theorem isGLB_ciInf_set {f : β → α} {s : Set β} (H : BddBelow (f '' s)) (Hne : s.Nonempty) :
    IsGLB (f '' s) (⨅ i : s, f i)

{α : Type u_1}
{β : Type u_2}
[ConditionallyCompleteLattice α]
{f : β → α}
{s : Set β}
(H : BddBelow (f '' s))
(Hne : s.Nonempty)


@[simp] lemma coe_finsetOrderIsoSet_symm :
    ⇑(finsetOrderIsoSet : Finset α ≃o Set α).symm = ⇑finsetEquivSet.symm


lemma image_sups (f : F) (s t : Set α) : f '' (s ⊻ t) = f '' s ⊻ f '' t

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[SemilatticeSup α]
[SemilatticeSup β]
[FunLike F α β]
[SupHomClass F α β]
(f : F)
(s t : Set α)


/-- If a function `f` is continuous on a convex set `D ⊆ ℝ`, is twice differentiable on its
interior, and `f''` is nonpositive on the interior, then `f` is concave on `D`. -/
lemma concaveOn_of_hasDerivWithinAt2_nonpos {D : Set ℝ} (hD : Convex ℝ D) {f f' f'' : ℝ → ℝ}
    (hf : ContinuousOn f D) (hf' : ∀ x ∈ interior D, HasDerivWithinAt f (f' x) (interior D) x)
    (hf'' : ∀ x ∈ interior D, HasDerivWithinAt f' (f'' x) (interior D) x)
    (hf''₀ : ∀ x ∈ interior D, f'' x ≤ 0) : ConcaveOn ℝ D f


theorem single_of_embDomain_single (l : α →₀ M) (f : α ↪ β) (a : β) (b : M) (hb : b ≠ 0)
    (h : l.embDomain f = single a b) : ∃ x, l = single x b ∧ f x = a

(h : Finsupp.embDomain f l = Finsupp.single a b)


@[simp]
theorem symm_linear (e : P₁ ≃ᵃ[k] P₂) : e.linear.symm = e.symm.linear

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


lemma incl_injective (I : LieIdeal R L) : Function.Injective I.incl

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(I : LieIdeal R L)


/-- Given any pullback diagram of the form

```
Z  ⟶ X₁
↓    ↓
X₂ ⟶ X
```

where `X₁ ⟶ X ← X₂` is a coproduct diagram, then `Z` is initial, and both `X₁ ⟶ X` and `X₂ ⟶ X`
are mono.
-/
class CoproductDisjoint (X₁ X₂ : C) where
  isInitialOfIsPullbackOfIsCoproduct :
    ∀ {X Z} {pX₁ : X₁ ⟶ X} {pX₂ : X₂ ⟶ X} {f : Z ⟶ X₁} {g : Z ⟶ X₂}
      (_cX : IsColimit (BinaryCofan.mk pX₁ pX₂)) {comm : f ≫ pX₁ = g ≫ pX₂},
      IsLimit (PullbackCone.mk _ _ comm) → IsInitial Z
  mono_inl : ∀ (X) (X₁ : X₁ ⟶ X) (X₂ : X₂ ⟶ X) (_cX : IsColimit (BinaryCofan.mk X₁ X₂)), Mono X₁
  mono_inr : ∀ (X) (X₁ : X₁ ⟶ X) (X₂ : X₂ ⟶ X) (_cX : IsColimit (BinaryCofan.mk X₁ X₂)), Mono X₂

[self : CategoryTheory.Limits.CoproductDisjoint X₁ X₂]

∀ (X₁_1 : X₁ ⟶ X) (X₂_1 : X₂ ⟶ X),
  CategoryTheory.Limits.IsColimit (CategoryTheory.Limits.BinaryCofan.mk X₁_1 X₂_1) → CategoryTheory.Mono X₁_1


@[simp]
theorem domCongr_refl [AddCommMonoid M] :
    Finsupp.domCongr (Equiv.refl α) = AddEquiv.refl (α →₀ M)

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


theorem Decidable.and_forall_ne [DecidableEq α] (a : α) {p : α → Prop} :
    (p a ∧ ∀ b, b ≠ a → p b) ↔ ∀ b, p b

{α : Sort u_1}
[DecidableEq α]
(a : α)
{p : α → Prop}

(p a ∧ ∀ (b : α), b ≠ a → p b) ↔ ∀ (b : α), p b


theorem integrable_iff_integrableAtFilter_atBot_atTop [LinearOrder X] [CompactIccSpace X] :
    Integrable f μ ↔
    (IntegrableAtFilter f atBot μ ∧ IntegrableAtFilter f atTop μ) ∧ LocallyIntegrable f μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[TopologicalSpace X]
[NormedAddCommGroup E]
{f : X → E}
{μ : MeasureTheory.Measure X}
[LinearOrder X]
[CompactIccSpace X]

MeasureTheory.Integrable f μ ↔
  (MeasureTheory.IntegrableAtFilter f Filter.atBot μ ∧ MeasureTheory.IntegrableAtFilter f Filter.atTop μ) ∧
    MeasureTheory.LocallyIntegrable f μ


@[to_additive]
theorem prod_antidiagonal_subst {n : ℕ} {f : ℕ × ℕ → ℕ → M} :
    ∏ p ∈ antidiagonal n, f p n = ∏ p ∈ antidiagonal n, f p (p.1 + p.2)

{M : Type u_1}
[CommMonoid M]
{n : ℕ}
{f : ℕ × ℕ → ℕ → M}

∏ p ∈ Finset.antidiagonal n, f p n = ∏ p ∈ Finset.antidiagonal n, f p (p.1 + p.2)


@[simp]
theorem coe_star (S : NonUnitalSubalgebra R A) : star S = star (S : Set A)

{R : Type u}
{A : Type v}
[CommSemiring R]
[StarRing R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[StarModule R A]
(S : NonUnitalSubalgebra R A)


theorem mul_star_self_ne_zero_iff (x : E) : x * x⋆ ≠ 0 ↔ x ≠ 0

{E : Type u_2}
[NonUnitalNormedRing E]
[StarRing E]
[CstarRing E]
(x : E)


@[simp]
theorem lt_inf'_iff : a < s.inf' H f ↔ ∀ i ∈ s, a < f i

{α : Type u_2}
{ι : Type u_5}
[LinearOrder α]
{s : Finset ι}
(H : s.Nonempty)
{f : ι → α}
{a : α}


theorem dual_rank_eq [CommRing K] [AddCommGroup V] [Module K V] [Finite ι] (b : Basis ι K V) :
    Cardinal.lift.{uK,uV} (Module.rank K V) = Module.rank K (Dual K V)

{K : Type uK}
{V : Type uV}
{ι : Type uι}
[CommRing K]
[AddCommGroup V]
[Module K V]
[Finite ι]
(b : Basis ι K V)

Cardinal.lift.{uK, uV} (Module.rank K V) = Module.rank K (Module.Dual K V)


theorem sup_eq_range (p q : Submodule R M) : p ⊔ q = range (p.subtype.coprod q.subtype)

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

p ⊔ q = LinearMap.range (p.subtype.coprod q.subtype)


theorem has_projective_separator [HasColimits C] [EnoughProjectives C] (G : C)
    (hG : IsCoseparator G) : ∃ G : C, Projective G ∧ IsSeparator G

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
[CategoryTheory.Limits.HasColimits C]
[CategoryTheory.EnoughProjectives C]
(G : C)
(hG : CategoryTheory.IsCoseparator G)

∃ G, CategoryTheory.Projective G ∧ CategoryTheory.IsSeparator G


theorem Filter.Eventually.exists_gt {a : α} [NeBot (𝓝[>] a)] {p : α → Prop}
    (h : ∀ᶠ x in 𝓝 a, p x) : ∃ b > a, p b

{α : Type u_1}
[TopologicalSpace α]
[Preorder α]
{a : α}
[(𝓝[>] a).NeBot]
{p : α → Prop}
(h : ∀ᶠ (x : α) in 𝓝 a, p x)


/-- Given a localization map `f : M →* N`, and `z w : N`, there exist `z' w' : M` and `d : S`
such that `f z' / f d = z` and `f w' / f d = w`. -/
@[to_additive
    "Given a localization map `f : M →+ N`, and `z w : N`, there exist `z' w' : M` and `d : S`
such that `f z' - f d = z` and `f w' - f d = w`."]
theorem surj₂ (f : LocalizationMap S N) (z w : N) : ∃ z' w' : M, ∃ d : S,
    (z * f.toMap d = f.toMap z') ∧  (w * f.toMap d = f.toMap w')

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

∃ z' w' d, z + f.toMap ↑d = f.toMap z' ∧ w + f.toMap ↑d = f.toMap w'


protected theorem BddBelow.insert [IsDirected α (· ≥ ·)] {s : Set α} (a : α) :
    BddBelow s → BddBelow (insert a s)

{α : Type u}
[Preorder α]
[IsDirected α fun x x_1 => x ≥ x_1]
{s : Set α}
(a : α)


/-- Affine homeomorphism `(r • · +ᵥ c)` between a normed space and an add torsor over this space,
interpreted as a `PartialHomeomorph` between `Metric.ball 0 1` and `Metric.ball c r`. -/
@[simps!]
def unitBallBall (c : P) (r : ℝ) (hr : 0 < r) : PartialHomeomorph E P

{E : Type u_1}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{P : Type u_2}
[PseudoMetricSpace P]
[NormedAddTorsor E P]
(c : P)
(r : ℝ)
(hr : 0 < r)

(PartialHomeomorph.unitBallBall c r hr).target = Metric.ball c r


@[simp]
theorem isLowerSet_setOf : IsLowerSet { a | p a } ↔ Antitone p

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


lemma growsPolynomially_const {c : ℝ} : GrowsPolynomially (fun _ => c)

AkraBazziRecurrence.GrowsPolynomially fun x => c


lemma biproduct.whiskerEquiv_inv_eq_lift {f : J → C} {g : K → C} (e : J ≃ K)
    (w : ∀ j, g (e j) ≅ f j) [HasBiproduct f] [HasBiproduct g] :
    (biproduct.whiskerEquiv e w).inv =
      biproduct.lift fun j => biproduct.π g (e j) ≫ (w j).hom

(CategoryTheory.Limits.biproduct.whiskerEquiv e w).inv =
  CategoryTheory.Limits.biproduct.lift fun j => CategoryTheory.Limits.biproduct.π g (e j) ≫ (w j).hom


lemma odd_mul : Odd (m * n) ↔ Odd m ∧ Odd n


private theorem comp_tendsto_lim {p : ℕ} [Fact p.Prime] {F : Polynomial ℤ_[p]}
    (ncs : CauSeq ℤ_[p] norm) : Tendsto (fun i => F.eval (ncs i)) atTop (𝓝 (F.eval ncs.lim))

{p : ℕ}
[Fact (Nat.Prime p)]
{F : Polynomial ℤ_[p]}
(ncs : CauSeq ℤ_[p] norm)

Filter.Tendsto (fun i => Polynomial.eval (↑ncs i) F) Filter.atTop (𝓝 (Polynomial.eval ncs.lim F))


@[simp]
theorem polar_sub_right (x y y' : M) : polar Q x (y - y') = polar Q x y - polar Q x y'

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

QuadraticMap.polar (⇑Q) x (y - y') = QuadraticMap.polar (⇑Q) x y - QuadraticMap.polar (⇑Q) x y'


@[simp]
theorem card_attachFin {n : ℕ} (s : Finset ℕ) (h : ∀ m ∈ s, m < n) :
    (s.attachFin h).card = s.card


theorem Poly.isNum?_eq_some (ctx : Context) {p : Poly} {k : Nat} : p.isNum? = some k → p.denote ctx = k

(ctx : Nat.Linear.Context)
{p : Nat.Linear.Poly}
{k : Nat}

p.isNum? = some k → Nat.Linear.Poly.denote ctx p = k


/-- The separable degree divides the degree. -/
theorem HasSeparableContraction.dvd_degree : hf.degree ∣ f.natDegree

(hf : Polynomial.HasSeparableContraction q f)


lemma toProd_comp_ofProd : (toProd Q₁ Q₂).comp (ofProd Q₁ Q₂) = AlgHom.id _ _

{R : Type u_1}
{M₁ : Type u_2}
{M₂ : Type u_3}
[CommRing R]
[AddCommGroup M₁]
[AddCommGroup M₂]
[Module R M₁]
[Module R M₂]
(Q₁ : QuadraticForm R M₁)
(Q₂ : QuadraticForm R M₂)

(CliffordAlgebra.toProd Q₁ Q₂).comp (CliffordAlgebra.ofProd Q₁ Q₂) =
  AlgHom.id R (CliffordAlgebra (QuadraticMap.prod Q₁ Q₂))


theorem subset_zeroLocus_iff_le_vanishingIdeal (t : Set (PrimeSpectrum R)) (I : Ideal R) :
    t ⊆ zeroLocus I ↔ I ≤ vanishingIdeal t

{R : Type u}
[CommSemiring R]
(t : Set (PrimeSpectrum R))
(I : Ideal R)

t ⊆ PrimeSpectrum.zeroLocus ↑I ↔ I ≤ PrimeSpectrum.vanishingIdeal t


/-- The standard basis of the space linear maps between two modules
induced by a basis of the domain and codomain.

If `M₁` and `M₂` are modules with basis `b₁` and `b₂` respectively indexed
by finite types `ι₁` and `ι₂`,
then `Basis.linearMap b₁ b₂` is the basis of `M₁ →ₗ[R] M₂` indexed by `ι₂ × ι₁`
where `(i, j)` indexes the linear map that sends `b j` to `b i`
and sends all other basis vectors to `0`.  -/
@[simps! (config := .lemmasOnly) repr_apply repr_symm_apply]
noncomputable
def linearMap (b₁ : Basis ι₁ R M₁) (b₂ : Basis ι₂ R M₂) :
    Basis (ι₂ × ι₁) R (M₁ →ₗ[R] M₂)

{R : Type u_1}
{M₁ : Type u_3}
{M₂ : Type u_4}
{ι₁ : Type u_6}
{ι₂ : Type u_7}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[Module R M₁]
[Module R M₂]
[Fintype ι₁]
[Fintype ι₂]
[DecidableEq ι₁]
(b₁ : Basis ι₁ R M₁)
(b₂ : Basis ι₂ R M₂)

∀ (a : M₁ →ₗ[R] M₂), (b₁.linearMap b₂).repr a = (Matrix.stdBasis R ι₂ ι₁).repr ((LinearMap.toMatrix b₁ b₂) a)


/-- As `x → ∞`, `f x` decays faster than any power of `x`. -/
lemma hf_top' (r : ℝ) : P.f =O[atTop] (· ^ r)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(P : StrongFEPair E)
(r : ℝ)


theorem map_comp_eq (α : F ⟶ G) (β : G ⟶ H) :
    map (α ≫ β) = map α ⋙ map β

{F G H : CategoryTheory.Functor C CategoryTheory.Cat}

CategoryTheory.Grothendieck.map (CategoryTheory.CategoryStruct.comp α β) =
  (CategoryTheory.Grothendieck.map α).comp (CategoryTheory.Grothendieck.map β)


theorem Poly.denote_eq_cancelAux (ctx : Context) (fuel : Nat) (m₁ m₂ r₁ r₂ : Poly)
    (h : denote_eq ctx (r₁.reverse ++ m₁, r₂.reverse ++ m₂)) : denote_eq ctx (cancelAux fuel m₁ m₂ r₁ r₂)

(h : Nat.Linear.Poly.denote_eq ctx (List.reverse r₁ ++ m₁, List.reverse r₂ ++ m₂))

Nat.Linear.Poly.denote_eq ctx (Nat.Linear.Poly.cancelAux fuel m₁ m₂ r₁ r₂)


theorem antidiagonal_succ_succ' {n : ℕ} :
    antidiagonal (n + 2) =
      (0, n + 2) ::ₘ (n + 2, 0) ::ₘ (antidiagonal n).map (Prod.map Nat.succ Nat.succ)

Multiset.Nat.antidiagonal (n + 2) =
  (0, n + 2) ::ₘ (n + 2, 0) ::ₘ Multiset.map (Prod.map Nat.succ Nat.succ) (Multiset.Nat.antidiagonal n)


@[to_additive]
protected theorem le_mul_iff_one_le_right [MulOneClass α] [CovariantClass α α (· * ·) (· ≤ ·)]
    {a b : α} (ha : MulLECancellable a) :
    a ≤ a * b ↔ 1 ≤ b

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


/-- The identity enriched functor. -/
@[simps]
def EnrichedFunctor.id (C : Type u₁) [EnrichedCategory V C] : EnrichedFunctor V C C

(V : Type v)
[CategoryTheory.Category.{w, v} V]
[CategoryTheory.MonoidalCategory V]
(C : Type u₁)
[CategoryTheory.EnrichedCategory V C]
(X Y : C)

(CategoryTheory.EnrichedFunctor.id V C).map X Y =
  CategoryTheory.CategoryStruct.id (CategoryTheory.EnrichedCategory.Hom X Y)


@[mono]
theorem toSubmonoid_mono : Monotone (toSubmonoid : Subsemiring R → Submonoid R)


theorem forall_or_left {q} {p : α → Prop} : (∀ x, q ∨ p x) ↔ q ∨ ∀ x, p x

{α : Sort u_1}
{q : Prop}
{p : α → Prop}

(∀ (x : α), q ∨ p x) ↔ q ∨ ∀ (x : α), p x


theorem inseparable_iff {f g : CauchyFilter α} : Inseparable f g ↔ f.1 ×ˢ g.1 ≤ 𝓤 α

{α : Type u}
[UniformSpace α]
{f g : CauchyFilter α}


/-- Composition of a partial equivlance and its inverse is equivalent to
the restriction of the identity to the source. -/
theorem self_trans_symm : e.trans e.symm ≈ ofSet e.source

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

e.trans e.symm ≈ PartialEquiv.ofSet e.source


/-- Convert an unbundled `IsAbsoluteValue` to a bundled `AbsoluteValue`. -/
@[simps]
def toAbsoluteValue : AbsoluteValue R S

{S : Type u_5}
[OrderedSemiring S]
{R : Type u_6}
[Semiring R]
(abv : R → S)
[IsAbsoluteValue abv]

∀ (a : R), (IsAbsoluteValue.toAbsoluteValue abv) a = abv a


theorem map_comap_eq_self_of_surjective
    {f : K →+* L} (hf : Function.Surjective f) (s : Subfield L) : (s.comap f).map f = s

{K : Type u}
{L : Type v}
[DivisionRing K]
[DivisionRing L]
{f : K →+* L}
(hf : Function.Surjective ⇑f)
(s : Subfield L)


theorem log_lt_sub_one_of_pos (hx1 : 0 < x) (hx2 : x ≠ 1) : log x < x - 1


theorem thinkN_mem {s : Computation α} {a} : ∀ n, a ∈ thinkN s n ↔ a ∈ s

{α : Type u}
{s : Computation α}
{a : α}
(n : ℕ)


protected theorem hasMFDerivAt : HasMFDerivAt 𝓘(𝕜, E) 𝓘(𝕜, E') f x (f : E →L[𝕜] E')

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
(f : E ≃L[𝕜] E')
{x : E}


theorem ne_zero (h : v₁.IsEquiv v₂) {r : R} : v₁ r ≠ 0 ↔ v₂ r ≠ 0

{R : Type u_3}
{Γ₀ : Type u_4}
{Γ'₀ : Type u_5}
[Ring R]
[LinearOrderedCommMonoidWithZero Γ₀]
[LinearOrderedCommMonoidWithZero Γ'₀]
{v₁ : Valuation R Γ₀}
{v₂ : Valuation R Γ'₀}
(h : v₁.IsEquiv v₂)
{r : R}


@[simp]
theorem hasStrictDerivAt_pi :
    HasStrictDerivAt φ φ' x ↔ ∀ i, HasStrictDerivAt (fun x => φ x i) (φ' i) x

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

HasStrictDerivAt φ φ' x ↔ ∀ (i : ι), HasStrictDerivAt (fun x => φ x i) (φ' i) x


@[ext]
theorem ext (h : ∀ f, X f = Y f) : X = Y

(h : ∀ (f : C^⊤⟮I, G; 𝓘(𝕜, 𝕜), 𝕜⟯), X f = Y f)


@[simp]
theorem carrier_eq_coe (s : LowerSet α) : s.carrier = s


/-- If `‖f x‖ ≤ g x` on `[l, u]` and `g` is integrable, then the norm of the integral of `f` is less
than or equal to the integral of `g`. -/
theorem norm_integral_le_of_norm_le {g : ℝⁿ → ℝ} (hle : ∀ x ∈ Box.Icc I, ‖f x‖ ≤ g x)
    (μ : Measure ℝⁿ) [IsLocallyFiniteMeasure μ] (hg : Integrable I l g μ.toBoxAdditive.toSMul) :
    ‖(integral I l f μ.toBoxAdditive.toSMul : E)‖ ≤ integral I l g μ.toBoxAdditive.toSMul

(hle : ∀ x ∈ BoxIntegral.Box.Icc I, ‖f x‖ ≤ g x)

(hg : BoxIntegral.Integrable I l g μ.toBoxAdditive.toSMul)

‖BoxIntegral.integral I l f μ.toBoxAdditive.toSMul‖ ≤ BoxIntegral.integral I l g μ.toBoxAdditive.toSMul


@[grind_norm] theorem Nat.lt_eq (a b : Nat) : (a < b) = (a + 1 ≤ b)


/-- The difference of `v` from its orthogonal projection onto `K` is in `Kᗮ`.  -/
@[simp]
theorem sub_orthogonalProjection_mem_orthogonal (v : E) : v - orthogonalProjection K v ∈ Kᗮ

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{K : Submodule 𝕜 E}
[HasOrthogonalProjection K]
(v : E)


theorem isGreatest_pair [LinearOrder γ] {a b : γ} : IsGreatest {a, b} (max a b)


@[simp]
theorem bind_apply (f : α →ₛ β) (g : β → α →ₛ γ) (a) : f.bind g a = g (f a) a

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[MeasurableSpace α]
(f : MeasureTheory.SimpleFunc α β)
(g : β → MeasureTheory.SimpleFunc α γ)
(a : α)


@[simp]
theorem Quiver.starEquivCostar_apply {u v : U} (e : u ⟶ v) :
    Quiver.starEquivCostar u (Quiver.Star.mk e) = Quiver.Costar.mk (reverse e)

{U : Type u_1}
[Quiver U]
[Quiver.HasInvolutiveReverse U]
{u v : U}
(e : u ⟶ v)

(Quiver.starEquivCostar u) (Quiver.Star.mk e) = Quiver.Costar.mk (Quiver.reverse e)


theorem equicontinuousOn_iInf_dom {t : κ → TopologicalSpace X'} {F : ι → X' → α}
    {S : Set X'} {k : κ} (hk : EquicontinuousOn (tX := t k) F S) :
    EquicontinuousOn (tX := ⨅ k, t k) F S

{ι : Type u_1}
{κ : Type u_2}
{X' : Type u_4}
{α : Type u_7}
[uα : UniformSpace α]
{t : κ → TopologicalSpace X'}
{F : ι → X' → α}
{S : Set X'}
{k : κ}
(hk : EquicontinuousOn F S)


theorem tail_def {n : ℕ} {α : Fin (n + 1) → Type*} {q : ∀ i, α i} :
    (tail fun k : Fin (n + 1) ↦ q k) = fun k : Fin n ↦ q k.succ

{n : ℕ}
{α : Fin (n + 1) → Type u_1}
{q : (i : Fin (n + 1)) → α i}

(Fin.tail fun k => q k) = fun k => q k.succ


theorem csInf_le (h₁ : BddBelow s) (h₂ : a ∈ s) : sInf s ≤ a

{α : Type u_1}
[ConditionallyCompleteLattice α]
{s : Set α}
{a : α}
(h₁ : BddBelow s)
(h₂ : a ∈ s)


theorem le_mul_inv_of_mul_le (h : c ≠ 0) (hab : a * c ≤ b) : a ≤ b * c⁻¹

{α : Type u_1}
[LinearOrderedCommGroupWithZero α]
{a b c : α}
(h : c ≠ 0)
(hab : a * c ≤ b)


lemma charP_iff_prime_eq_zero [Nontrivial R] {p : ℕ} (hp : p.Prime) :
    CharP R p ↔ (p : R) = 0

{R : Type u_1}
[NonAssocSemiring R]
[Nontrivial R]
{p : ℕ}
(hp : Nat.Prime p)


@[to_additive]
theorem mk'_one (x) : f.mk' x (1 : S) = f.toMap x

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


@[gcongr]
theorem zpow_le_of_le {x : ℝ≥0∞} (hx : 1 ≤ x) {a b : ℤ} (h : a ≤ b) : x ^ a ≤ x ^ b

{x : ENNReal}
(hx : 1 ≤ x)
{a b : ℤ}
(h : a ≤ b)


lemma measurable_countablePartitionSet (α : Type*) [MeasurableSpace α] [CountablyGenerated α]
    (n : ℕ) :
    Measurable (countablePartitionSet (α := α) n)

(α : Type u_2)
[MeasurableSpace α]
[MeasurableSpace.CountablyGenerated α]
(n : ℕ)


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

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

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


nonrec theorem integral_smul_measure (c : ℝ≥0∞) :
    ∫ x in a..b, f x ∂c • μ = c.toReal • ∫ x in a..b, f x ∂μ

{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{a b : ℝ}
{f : ℝ → E}
{μ : MeasureTheory.Measure ℝ}
(c : ℝ≥0∞)

∫ (x : ℝ) in a..b, f x ∂c • μ = c.toReal • ∫ (x : ℝ) in a..b, f x ∂μ


/-- A measure on a countable type is a sum of Dirac measures. -/
@[simp]
theorem sum_smul_dirac [Countable α] [MeasurableSingletonClass α] (μ : Measure α) :
    (sum fun a => μ {a} • dirac a) = μ

{α : Type u_1}
[MeasurableSpace α]
[Countable α]
[MeasurableSingletonClass α]
(μ : MeasureTheory.Measure α)

(MeasureTheory.Measure.sum fun a => μ {a} • MeasureTheory.Measure.dirac a) = μ


theorem comap_eq_id_of_eq_id (f : MvPolynomial σ R →ₐ[R] MvPolynomial σ R) (hf : ∀ φ, f φ = φ)
    (x : σ → R) : comap f x = x

(hf : ∀ (φ : MvPolynomial σ R), f φ = φ)


theorem get?_ofSeq (s : Seq α) (n) : get? (ofSeq s) n = Computation.pure (Seq.get? s n)

{α : Type u}
(s : Stream'.Seq α)
(n : ℕ)

(↑s).get? n = Computation.pure (s.get? n)


/-- **Jensen's inequality**: if a function `g : E → ℝ` is convex and continuous on a convex closed
set `s`, `μ` is a probability measure on `α`, and `f : α → E` is a function sending `μ`-a.e.  points
to `s`, then the value of `g` at the expected value of `f` is less than or equal to the expected
value of `g ∘ f` provided that both `f` and `g ∘ f` are integrable. See also
`ConvexOn.map_centerMass_le` for a finite sum version of this lemma. -/
theorem ConvexOn.map_integral_le [IsProbabilityMeasure μ] (hg : ConvexOn ℝ s g)
    (hgc : ContinuousOn g s) (hsc : IsClosed s) (hfs : ∀ᵐ x ∂μ, f x ∈ s) (hfi : Integrable f μ)
    (hgi : Integrable (g ∘ f) μ) : g (∫ x, f x ∂μ) ≤ ∫ x, g (f x) ∂μ

(hgi : MeasureTheory.Integrable (g ∘ f) μ)

g (∫ (x : α), f x ∂μ) ≤ ∫ (x : α), g (f x) ∂μ


theorem not_dvd_ord_compl {n p : ℕ} (hp : Prime p) (hn : n ≠ 0) : ¬p ∣ ord_compl[p] n

{n p : ℕ}
(hp : Nat.Prime p)
(hn : n ≠ 0)


theorem natDegree_smul_of_smul_regular {S : Type*} [Monoid S] [DistribMulAction S R] {k : S}
    (p : R[X]) (h : IsSMulRegular R k) : (k • p).natDegree = p.natDegree

{R : Type u}
[Semiring R]
{S : Type u_1}
[Monoid S]
[DistribMulAction S R]
{k : S}
(p : R[X])
(h : IsSMulRegular R k)


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

{α : Type u_1}
{β : Type v}
{f : α → Option β}
(a : α)
(s : Multiset α)
(h : f a = none)

Multiset.filterMap f (a ::ₘ s) = Multiset.filterMap f s


@[simp]
theorem one_sub_invOf_two [Ring α] [Invertible (2 : α)] : 1 - (⅟ 2 : α) = ⅟ 2


@[ext]
lemma ext {I J : TwoSidedIdeal R} (h : ∀ x, x ∈ I ↔ x ∈ J) : I = J

{R : Type u_1}
[NonUnitalNonAssocRing R]
{I J : TwoSidedIdeal R}
(h : ∀ (x : R), x ∈ I ↔ x ∈ J)


theorem sameRay_iff : SameRay ℝ x y ↔ x = 0 ∨ y = 0 ∨ x.arg = y.arg


@[ext]
theorem ext {α β} {f g : Embedding α β} (h : ∀ x, f x = g x) : f = g

{α : Sort u_1}
{β : Sort u_2}
{f g : α ↪ β}
(h : ∀ (x : α), f x = g x)


theorem tendsto_nhds_top {m : α → ℝ≥0∞} {f : Filter α} (h : ∀ n : ℕ, ∀ᶠ a in f, ↑n < m a) :
    Tendsto m f (𝓝 ∞)

{m : α → ℝ≥0∞}

(h : ∀ (n : ℕ), ∀ᶠ (a : α) in f, ↑n < m a)


theorem small_lift (α : Type u) [hα : Small.{v} α] : Small.{max v w} α


@[to_additive]
theorem prod_Ioi_succ {M : Type*} [CommMonoid M] {n : ℕ} (i : Fin n) (v : Fin n.succ → M) :
    ∏ j ∈ Ioi i.succ, v j = ∏ j ∈ Ioi i, v j.succ

{M : Type u_3}
[AddCommMonoid M]
{n : ℕ}
(i : Fin n)
(v : Fin n.succ → M)

∑ j ∈ Finset.Ioi i.succ, v j = ∑ j ∈ Finset.Ioi i, v j.succ


theorem sublist_append_of_sublist_left (s : l <+ l₁) : l <+ l₁ ++ l₂

∀ {α : Type u_1} {l l₁ l₂ : List α}, l <+ l₁ → l <+ l₁ ++ l₂


theorem cast_eq_cast {i j} (h : i = j) :
    ⇑(cast R M h) = _root_.cast (congrArg (fun i => ⨂[R]^i M) h)

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{i j : ℕ}
(h : i = j)


/-- One implication of the portmanteau theorem:
For a sequence of Borel probability measures, if the liminf of the measures of any open set is at
least the measure of the open set under a candidate limit measure, then for any set whose
boundary carries no probability mass under the candidate limit measure, then its measures under the
sequence converge to its measure under the candidate limit measure.
-/
theorem tendsto_measure_of_null_frontier {ι : Type*} {L : Filter ι} {μ : Measure Ω}
    {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)]
    (h_opens : ∀ G, IsOpen G → μ G ≤ L.liminf fun i => μs i G) {E : Set Ω}
    (E_nullbdry : μ (frontier E) = 0) : L.Tendsto (fun i => μs i E) (𝓝 (μ E))

[∀ (i : ι), MeasureTheory.IsProbabilityMeasure (μs i)]

(h_opens : ∀ (G : Set Ω), IsOpen G → μ G ≤ Filter.liminf (fun i => (μs i) G) L)

Filter.Tendsto (fun i => (μs i) E) L (𝓝 (μ E))


/-- If `P₁ x ↔ ... ↔ Pₙ x` for all `x`, then `(∀ x, P₁ x) ↔ ... ↔ (∀ x, Pₙ x)`.
Note: in concrete cases, Lean has trouble finding the list `[P₁, ..., Pₙ]` from the list
`[(∀ x, P₁ x), ..., (∀ x, Pₙ x)]`, but simply providing a list of underscores with the right
length makes it happier.

Example:
```lean
example (P₁ P₂ P₃ : ℕ → Prop) (H : ∀ n, [P₁ n, P₂ n, P₃ n].TFAE) :
    [∀ n, P₁ n, ∀ n, P₂ n, ∀ n, P₃ n].TFAE :=
  forall_tfae [_, _, _] H
```
-/
theorem forall_tfae {α : Type*} (l : List (α → Prop)) (H : ∀ a : α, (l.map (fun p ↦ p a)).TFAE) :
    (l.map (fun p ↦ ∀ a, p a)).TFAE

(H : ∀ (a : α), (List.map (fun p => p a) l).TFAE)

(List.map (fun p => ∀ (a : α), p a) l).TFAE


@[to_additive one_lt_index_of_ne_top]
theorem one_lt_index_of_ne_top [Finite (G ⧸ H)] (hH : H ≠ ⊤) : 1 < H.index

{G : Type u_1}
[AddGroup G]
{H : AddSubgroup G}
[Finite (G ⧸ H)]
(hH : H ≠ ⊤)


@[simp]
lemma piLp_equiv_toEuclideanCLM (A : Matrix n n 𝕜) (x : EuclideanSpace 𝕜 n) :
    WithLp.equiv _ _ (toEuclideanCLM (n := n) (𝕜 := 𝕜) A x) =
      toLin' A (WithLp.equiv _ _ x)

{𝕜 : Type u_1}
{n : Type u_3}
[RCLike 𝕜]
[Fintype n]
[DecidableEq n]
(A : Matrix n n 𝕜)
(x : EuclideanSpace 𝕜 n)

(WithLp.equiv 2 ((i : n) → (fun x => 𝕜) i)) ((Matrix.toEuclideanCLM A) x) =
  (Matrix.toLin' A) ((WithLp.equiv 2 (n → 𝕜)) x)


theorem differentiable_arsinh : Differentiable ℝ arsinh


/-- Homeomorphism between the type `C(X, Σ i, Y i)` of continuous maps from a connected topological
space to the disjoint union of a family of topological spaces and the disjoint union of the types of
continuous maps `C(X, Y i)`.

The inverse map sends `⟨i, g⟩` to `ContinuousMap.comp (ContinuousMap.sigmaMk i) g`. -/
@[simps! symm_apply]
def sigmaCodHomeomorph : C(X, Σ i, Y i) ≃ₜ Σ i, C(X, Y i)

(X : Type u_1)
{ι : Type u_2}
(Y : ι → Type u_3)
[TopologicalSpace X]
[(i : ι) → TopologicalSpace (Y i)]
[ConnectedSpace X]

∀ (a : (i : ι) × C(X, Y i)), (ContinuousMap.sigmaCodHomeomorph X Y).symm a = (ContinuousMap.sigmaMk a.fst).comp a.snd


/-- The composition of left adjoint mates is the adjoint mate of the composition. -/
@[reassoc]
theorem comp_leftAdjointMate {X Y Z : C} [HasLeftDual X] [HasLeftDual Y] [HasLeftDual Z] {f : X ⟶ Y}
    {g : Y ⟶ Z} : (ᘁf ≫ g) = (ᘁg) ≫ ᘁf

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{X Y Z : C}
[CategoryTheory.HasLeftDual X]
[CategoryTheory.HasLeftDual Y]
[CategoryTheory.HasLeftDual Z]
{f : X ⟶ Y}
{g : Y ⟶ Z}


@[to_additive]
theorem mulTSupport_mul [TopologicalSpace X] [Monoid α] {f g : X → α} :
    (mulTSupport fun x ↦ f x * g x) ⊆ mulTSupport f ∪ mulTSupport g

{X : Type u_1}
{α : Type u_2}
[TopologicalSpace X]
[Monoid α]
{f g : X → α}

(mulTSupport fun x => f x * g x) ⊆ mulTSupport f ∪ mulTSupport g