@[simp, norm_cast]
theorem Int.cast_npow (R : Type*) [NonAssocRing R] [Pow R ℕ] [NatPowAssoc R]
    (n : ℤ) : ∀(m : ℕ), @Int.cast R NonAssocRing.toIntCast (n ^ m) = (n : R) ^ m

(R : Type u_2)
[NonAssocRing R]
[Pow R ℕ]
[NatPowAssoc R]
(n : ℤ)
(m : ℕ)


@[simp] theorem not_irrational_zero : ¬Irrational 0


theorem gcd_eq_left_iff_dvd : m ∣ n ↔ gcd m n = m


theorem Valid'.balance'_lemma {α l l' r r'} (H1 : BalancedSz l' r')
    (H2 : Nat.dist (@size α l) l' ≤ 1 ∧ size r = r' ∨ Nat.dist (size r) r' ≤ 1 ∧ size l = l') :
    2 * @size α r ≤ 9 * size l + 5 ∨ size r ≤ 3

(H2 : l.size.dist l' ≤ 1 ∧ r.size = r' ∨ r.size.dist r' ≤ 1 ∧ l.size = l')

2 * r.size ≤ 9 * l.size + 5 ∨ r.size ≤ 3


@[simp]
theorem comap_coe (f : F) (p : Submodule R₂ M₂) : (comap f p : Set M) = f ⁻¹' p

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


theorem u_support : support (u : E → ℝ) = ball 0 1

(E : Type u_1)
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]

Function.support ExistsContDiffBumpBase.u = Metric.ball 0 1


theorem mk_eq {m m' : M} {s s' : S} : mk m s = mk m' s' ↔ ∃ u : S, u • s' • m = u • s • m'

{R : Type u}
[CommSemiring R]
{S : Submonoid R}
{M : Type v}
[AddCommMonoid M]
[Module R M]
{m m' : M}
{s s' : ↥S}

LocalizedModule.mk m s = LocalizedModule.mk m' s' ↔ ∃ u, u • s' • m = u • s • m'


theorem inv_zpow (A : M) : ∀ n : ℤ, A⁻¹ ^ n = (A ^ n)⁻¹

{n' : Type u_1}
[DecidableEq n']
[Fintype n']
{R : Type u_2}
[CommRing R]
(A : Matrix n' n' R)
(n : ℤ)


lemma succ_injective (n : ℕ) : Injective (@Fin.succ n)


/-- The identity lax monoidal functor. -/
@[simps]
def id : LaxMonoidalFunctor.{v₁, v₁} C C

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

(CategoryTheory.LaxMonoidalFunctor.id C).μ X Y =
  𝟙 (CategoryTheory.MonoidalCategory.tensorObj ((𝟭 C).obj X) ((𝟭 C).obj Y))


/-- The stalks are isomorphic on inseparable points -/
@[simps]
def stalkCongr {X : TopCat} {C : Type*} [Category C] [HasColimits C] (F : X.Presheaf C) {x y : X}
    (e : Inseparable x y) : F.stalk x ≅ F.stalk y

{X : TopCat}
{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Limits.HasColimits C]
(F : TopCat.Presheaf C X)
{x y : ↑X}
(e : Inseparable x y)

(F.stalkCongr e).inv = F.stalkSpecializes ⋯


theorem ringHom_ext (map_unit : ∀ x : S, IsUnit ((algebraMap R (Module.End R M'')) x))
    ⦃j k : M' →ₗ[R] M''⦄ (h : j.comp f = k.comp f) : j = k

(map_unit : ∀ (x : ↥S), IsUnit ((algebraMap R (Module.End R M'')) ↑x))


@[simp]
lemma fromRows_toRows (A : Matrix (m₁ ⊕ m₂) n R) : fromRows A.toRows₁ A.toRows₂ = A

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


/-- Let `X` be a topological space, `𝔖` a family of compact subsets of `X`, `α` a uniform space,
and `F : ι → (X → α)` a family which is equicontinuous on each `K ∈ 𝔖`. Then, the uniform
structures of uniform convergence on `𝔖` and pointwise convergence on `⋃₀ 𝔖` induce the same
uniform structure on `ι`.

In particular, pointwise convergence and compact convergence coincide on an equicontinuous
subset of `X → α`.

This is a version of `EquicontinuousOn.comap_uniformOnFun_eq` stated in terms of `UniformInducing`
for convenuence. -/
lemma EquicontinuousOn.uniformInducing_uniformOnFun_iff_pi' [UniformSpace ι]
    {𝔖 : Set (Set X)} (𝔖_compact : ∀ K ∈ 𝔖, IsCompact K)
    (F_eqcont : ∀ K ∈ 𝔖, EquicontinuousOn F K) :
    UniformInducing (UniformOnFun.ofFun 𝔖 ∘ F) ↔
    UniformInducing ((⋃₀ 𝔖).restrict ∘ F)

UniformInducing (⇑(UniformOnFun.ofFun 𝔖) ∘ F) ↔ UniformInducing ((⋃₀ 𝔖).restrict ∘ F)


theorem toIcoMod_mem_Ico' (b : α) : toIcoMod hp 0 b ∈ Set.Ico 0 p

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


/-- The counit isomorphism induced by `N₁Γ₀` -/
@[simps!]
def η : Γ ⋙ N ≅ 𝟭 (ChainComplex C ℕ)

(CategoryTheory.Idempotents.DoldKan.η.inv.app X).f i =
  ((CategoryTheory.Idempotents.toKaroubiEquivalence (ChainComplex C ℕ)).unitIso.hom.app X).f i ≫
    ((CategoryTheory.Idempotents.toKaroubiEquivalence (ChainComplex C ℕ)).inverse.map
          (AlgebraicTopology.DoldKan.N₁Γ₀.inv.app X)).f
      i


@[to_additive]
theorem one_div_one_div : 1 / (1 / a) = a

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


theorem isCoatom_of_image [OrderTop α] [OrderTop β] {l : α → β} {u : β → α}
    (gi : GaloisInsertion l u) {b : β} (hb : IsCoatom (u b)) : IsCoatom b

{α : Type u_2}
{β : Type u_3}
[PartialOrder α]
[PartialOrder β]
[OrderTop α]
[OrderTop β]
{l : α → β}
{u : β → α}
(gi : GaloisInsertion l u)
{b : β}
(hb : IsCoatom (u b))


theorem differentiable_sinh : Differentiable ℂ sinh


@[simp]
theorem trop_inf (x y : R) : trop (x ⊓ y) = trop x + trop y

Tropical.trop (x ⊓ y) = Tropical.trop x + Tropical.trop y


@[simp]
lemma unitHomEquiv_apply_coe (M : SheafOfModules R) (f : unit R ⟶ M) (X : Cᵒᵖ) :
    (M.unitHomEquiv f).val X = f.val.app X (1 : R.val.obj X)

{J : CategoryTheory.GrothendieckTopology C}

[J.HasSheafCompose (CategoryTheory.forget₂ RingCat AddCommGrp)]

↑(M.unitHomEquiv f) X = (PresheafOfModules.Hom.app f.val X) 1


theorem aecover_Ioc_of_Ico (ha : Tendsto a l (𝓝 A)) (hb : Tendsto b l (𝓝 B)) :
    AECover (μ.restrict <| Ioc A B) l fun i => Ico (a i) (b i)

{α : Type u_1}
{ι : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{l : Filter ι}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
[OpensMeasurableSpace α]
{a b : ι → α}
{A B : α}
[MeasureTheory.NoAtoms μ]
(ha : Filter.Tendsto a l (𝓝 A))
(hb : Filter.Tendsto b l (𝓝 B))

MeasureTheory.AECover (μ.restrict (Set.Ioc A B)) l fun i => Set.Ico (a i) (b i)


@[simp] lemma addSubmonoid_closure_range_pow {n : ℕ} (hn₀ : n ≠ 0) (hn : Even n) :
    closure (range fun x : ℚ ↦ x ^ n) = nonneg _

AddSubmonoid.closure (Set.range fun x => x ^ n) = AddSubmonoid.nonneg ℚ


@[parity_simps] lemma odd_pow {n : ℕ} : Odd (m ^ n) ↔ Odd m ∨ n = 0


@[simp, norm_cast]
theorem cast_sub [CharZero α] (m n) : ((m - n : ℚ) : α) = m - n

{α : Type u_3}
[DivisionRing α]
[CharZero α]
(m n : ℚ)


theorem eq_of_norm_add_lt_left {z1 z2 : ℚ_[p]} (h : ‖z1 + z2‖ < ‖z1‖) : ‖z1‖ = ‖z2‖

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{z1 z2 : ℚ_[p]}
(h : ‖z1 + z2‖ < ‖z1‖)


@[to_additive tsum_prod']
theorem tprod_prod' {f : β × γ → α} (h : Multipliable f)
    (h₁ : ∀ b, Multipliable fun c ↦ f (b, c)) :
    ∏' p, f p = ∏' (b) (c), f (b, c)

{f : β × γ → α}

(h₁ : ∀ (b : β), Summable fun c => f (b, c))


@[simp]
theorem sub_bind (f : α → FreeAbelianGroup β) (x y : FreeAbelianGroup α) :
    x - y >>= f = (x >>= f) - (y >>= f)

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


theorem IsMultiplicative.prodPrimeFactors_one_add_of_squarefree [CommSemiring R]
    {f : ArithmeticFunction R} (h_mult : f.IsMultiplicative) {n : ℕ} (hn : Squarefree n) :
    ∏ p ∈ n.primeFactors, (1 + f p) = ∑ d ∈ n.divisors, f d

{R : Type u_1}
[CommSemiring R]
{f : ArithmeticFunction R}
(h_mult : f.IsMultiplicative)
{n : ℕ}
(hn : Squarefree n)


theorem measure_inter_union (h : s₁ ∩ s₂ ⊆ ∅) (h₁ : IsCaratheodory m s₁) {t : Set α} :
    m (t ∩ (s₁ ∪ s₂)) = m (t ∩ s₁) + m (t ∩ s₂)

{α : Type u}
(m : MeasureTheory.OuterMeasure α)
{s₁ s₂ : Set α}
(h : s₁ ∩ s₂ ⊆ ∅)
(h₁ : m.IsCaratheodory s₁)
{t : Set α}


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

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


protected theorem HasFiniteFPowerSeriesAt.eventually (hf : HasFiniteFPowerSeriesAt f p x n) :
    ∀ᶠ r : ℝ≥0∞ in 𝓝[>] 0, HasFiniteFPowerSeriesOnBall f p x n r

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{x : E}
{n : ℕ}
(hf : HasFiniteFPowerSeriesAt f p x n)

∀ᶠ (r : ℝ≥0∞) in 𝓝[>] 0, HasFiniteFPowerSeriesOnBall f p x n r


/-- Unlike categories, for graphs vertex equality is an important notion, so needing to be able to
work with equality of graph homomorphisms is a necessary evil. -/
theorem map_eq_of_eq {f : G →g G'} (f' : G →g G') (h : f = f') :
    p.map f = (p.map f').copy (h ▸ rfl) (h ▸ rfl)

{V : Type u}
{V' : Type v}
{G : SimpleGraph V}
{G' : SimpleGraph V'}
{u v : V}
(p : G.Walk u v)
{f : G →g G'}
(f' : G →g G')
(h : f = f')

SimpleGraph.Walk.map f p = (SimpleGraph.Walk.map f' p).copy ⋯ ⋯


theorem eventually_cofinite_indicator (hf : UnifTight f p μ) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
    ∀ᶠ s in μ.cofinite.smallSets, ∀ i, eLpNorm (s.indicator (f i)) p μ ≤ ε

{α : Type u_1}
{β : Type u_2}
{ι : Type u_3}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
{f : ι → α → β}
{p : ENNReal}
(hf : MeasureTheory.UnifTight f p μ)
{ε : ENNReal}
(hε : ε ≠ 0)

∀ᶠ (s : Set α) in μ.cofinite.smallSets, ∀ (i : ι), MeasureTheory.eLpNorm (s.indicator (f i)) p μ ≤ ε


lemma HomologyData.exact_iff (h : S.HomologyData) :
    S.Exact ↔ IsZero h.left.H

S.Exact ↔ CategoryTheory.Limits.IsZero h.left.H


lemma Odd.of_mul_left (h : Odd (m * n)) : Odd m


@[simp]
theorem singleton_bind : bind {a} f = f a

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


/-- A version of Chebyshev-Markov's inequality using Lp-norms. -/
theorem mul_meas_ge_le_pow_eLpNorm' (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞)
    (hf : AEStronglyMeasurable f μ) (ε : ℝ≥0∞) :
    ε ^ p.toReal * μ { x | ε ≤ ‖f x‖₊ } ≤ eLpNorm f p μ ^ p.toReal

(hf : MeasureTheory.AEStronglyMeasurable f μ)

ε ^ p.toReal * μ {x | ε ≤ ↑‖f x‖₊} ≤ MeasureTheory.eLpNorm f p μ ^ p.toReal


/-- A `LinearMap` preserves multiplication if pre- and post- composition with `LinearMap.mul` are
equivalent. By converting the statement into an equality of `LinearMap`s, this lemma allows various
specialized `ext` lemmas about `→ₗ[R]` to then be applied.

This is the `LinearMap` version of `AddMonoidHom.map_mul_iff`. -/
theorem map_mul_iff (f : A →ₗ[R] B) :
    (∀ x y, f (x * y) = f x * f y) ↔
      (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f

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

(∀ (x y : A), f (x * y) = f x * f y) ↔ (LinearMap.mul R A).compr₂ f = (LinearMap.mul R B ∘ₗ f).compl₂ f


@[to_additive]
theorem mul_singleton_mem_nhds_of_nhds_one (a : α) (h : s ∈ 𝓝 (1 : α)) : s * {a} ∈ 𝓝 a

{α : Type u}
[TopologicalSpace α]
[AddGroup α]
[ContinuousConstVAdd αᵃᵒᵖ α]
{s : Set α}
(a : α)
(h : s ∈ 𝓝 0)


theorem valAux_add (f g : PreTilt K v O hv p) :
    valAux K v O hv p (f + g) ≤ max (valAux K v O hv p f) (valAux K v O hv p g)

{K : Type u₁}
[Field K]
{v : Valuation K ℝ≥0}
{O : Type u₂}
[CommRing O]
[Algebra O K]
{hv : v.Integers O}
{p : ℕ}
[hp : Fact (Nat.Prime p)]
[hvp : Fact (v ↑p ≠ 1)]
(f g : PreTilt K v O hv p)

PreTilt.valAux K v O hv p (f + g) ≤ max (PreTilt.valAux K v O hv p f) (PreTilt.valAux K v O hv p g)


@[simp]
theorem sqrt_sq (h : 0 ≤ x) : √(x ^ 2) = x


theorem PairwiseDisjoint.mono_on (hs : s.PairwiseDisjoint f) (h : ∀ ⦃i⦄, i ∈ s → g i ≤ f i) :
    s.PairwiseDisjoint g

{α : Type u_1}
{ι : Type u_4}
[PartialOrder α]
[OrderBot α]
{s : Set ι}
{f g : ι → α}
(hs : s.PairwiseDisjoint f)
(h : ∀ ⦃i : ι⦄, i ∈ s → g i ≤ f i)


theorem nodup_range (n : ℕ) : Nodup (range n)


theorem eLpNorm_smul_le_eLpNorm_mul_eLpNorm_top (p : ℝ≥0∞) (f : α → E) {φ : α → 𝕜}
    (hφ : AEStronglyMeasurable φ μ) : eLpNorm (φ • f) p μ ≤ eLpNorm φ p μ * eLpNorm f ∞ μ

(hφ : MeasureTheory.AEStronglyMeasurable φ μ)

MeasureTheory.eLpNorm (φ • f) p μ ≤ MeasureTheory.eLpNorm φ p μ * MeasureTheory.eLpNorm f ⊤ μ


/-- The `weightedVSub` for an empty set is 0. -/
@[simp]
theorem weightedVSub_empty (w : ι → k) (p : ι → P) : (∅ : Finset ι).weightedVSub p w = (0 : V)

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
(w : ι → k)
(p : ι → P)


theorem mem_map_of_mem (f : α ↪ β) {a} {s : Finset α} : a ∈ s → f a ∈ s.map f

{α : Type u_1}
{β : Type u_2}
(f : α ↪ β)
{a : α}
{s : Finset α}


theorem lt_iff_val_lt_val {a b : Fin n} : a < b ↔ a.val < b.val


/-- In the special case `n = 1`, `Quaternion 1` is a cyclic group (of order `4`). -/
theorem quaternionGroup_one_isCyclic : IsCyclic (QuaternionGroup 1)


@[to_additive]
lemma mem_stabilizer_set' {s : Set α} (hs : s.Finite) :
    a ∈ stabilizer G s ↔ ∀ ⦃b⦄, b ∈ s → a • b ∈ s

{G : Type u_1}
{α : Type u_3}
[AddGroup G]
[AddAction G α]
{a : G}
{s : Set α}
(hs : s.Finite)

a ∈ AddAction.stabilizer G s ↔ ∀ ⦃b : α⦄, b ∈ s → a +ᵥ b ∈ s


@[simp]
theorem codisjoint_prod :
    Codisjoint (s₁ ×ˢ t₁) (s₂ ×ˢ t₂) ↔ Codisjoint s₁ s₂ ∨ Codisjoint t₁ t₂

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{s₁ s₂ : UpperSet α}
{t₁ t₂ : UpperSet β}


theorem _root_.IsSMulRegular.matrix [SMul R S] {k : R} (hk : IsSMulRegular S k) :
    IsSMulRegular (Matrix m n S) k

{m : Type u_2}
{n : Type u_3}
{R : Type u_7}
{S : Type u_8}
[SMul R S]
{k : R}
(hk : IsSMulRegular S k)


/-- Reinterpret a complete lattice homomorphism as a complete lattice homomorphism between the dual
lattices. -/
@[simps!]
protected def dual : CompleteLatticeHom α β ≃ CompleteLatticeHom αᵒᵈ βᵒᵈ

{α : Type u_2}
{β : Type u_3}
[CompleteLattice α]
[CompleteLattice β]
(f : CompleteLatticeHom α β)

∀ (a : αᵒᵈ), (CompleteLatticeHom.dual f).toFun a = OrderDual.toDual (f (OrderDual.ofDual a))


theorem exists_mem_or : (∃ x h, P x h ∨ Q x h) ↔ (∃ x h, P x h) ∨ ∃ x h, Q x h

{α : Sort u_1}
{p : α → Prop}
{P Q : (x : α) → p x → Prop}


/--
In a monoidal category, we can take the tensor product of objects, `X ⊗ Y` and of morphisms `f ⊗ g`.
Tensor product does not need to be strictly associative on objects, but there is a
specified associator, `α_ X Y Z : (X ⊗ Y) ⊗ Z ≅ X ⊗ (Y ⊗ Z)`. There is a tensor unit `𝟙_ C`,
with specified left and right unitor isomorphisms `λ_ X : 𝟙_ C ⊗ X ≅ X` and `ρ_ X : X ⊗ 𝟙_ C ≅ X`.
These associators and unitors satisfy the pentagon and triangle equations.

See <https://stacks.math.columbia.edu/tag/0FFK>.
-/
-- Porting note: The Mathport did not translate the temporary notation
class MonoidalCategory (C : Type u) [𝒞 : Category.{v} C] extends MonoidalCategoryStruct C where
  tensorHom_def {X₁ Y₁ X₂ Y₂ : C} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂) :
    f ⊗ g = (f ▷ X₂) ≫ (Y₁ ◁ g) := by
      aesop_cat
  /-- Tensor product of identity maps is the identity: `(𝟙 X₁ ⊗ 𝟙 X₂) = 𝟙 (X₁ ⊗ X₂)` -/
  tensor_id : ∀ X₁ X₂ : C, 𝟙 X₁ ⊗ 𝟙 X₂ = 𝟙 (X₁ ⊗ X₂) := by aesop_cat
  /--
  Composition of tensor products is tensor product of compositions:
  `(f₁ ⊗ g₁) ∘ (f₂ ⊗ g₂) = (f₁ ∘ f₂) ⊗ (g₁ ⊗ g₂)`
  -/
  tensor_comp :
    ∀ {X₁ Y₁ Z₁ X₂ Y₂ Z₂ : C} (f₁ : X₁ ⟶ Y₁) (f₂ : X₂ ⟶ Y₂) (g₁ : Y₁ ⟶ Z₁) (g₂ : Y₂ ⟶ Z₂),
      (f₁ ≫ g₁) ⊗ (f₂ ≫ g₂) = (f₁ ⊗ f₂) ≫ (g₁ ⊗ g₂) := by
    aesop_cat
  whiskerLeft_id : ∀ (X Y : C), X ◁ 𝟙 Y = 𝟙 (X ⊗ Y) := by
    aesop_cat
  id_whiskerRight : ∀ (X Y : C), 𝟙 X ▷ Y = 𝟙 (X ⊗ Y) := by
    aesop_cat
  /-- Naturality of the associator isomorphism: `(f₁ ⊗ f₂) ⊗ f₃ ≃ f₁ ⊗ (f₂ ⊗ f₃)` -/
  associator_naturality :
    ∀ {X₁ X₂ X₃ Y₁ Y₂ Y₃ : C} (f₁ : X₁ ⟶ Y₁) (f₂ : X₂ ⟶ Y₂) (f₃ : X₃ ⟶ Y₃),
      ((f₁ ⊗ f₂) ⊗ f₃) ≫ (α_ Y₁ Y₂ Y₃).hom = (α_ X₁ X₂ X₃).hom ≫ (f₁ ⊗ (f₂ ⊗ f₃)) := by
    aesop_cat
  /--
  Naturality of the left unitor, commutativity of `𝟙_ C ⊗ X ⟶ 𝟙_ C ⊗ Y ⟶ Y` and `𝟙_ C ⊗ X ⟶ X ⟶ Y`
  -/
  leftUnitor_naturality :
    ∀ {X Y : C} (f : X ⟶ Y), 𝟙_ _ ◁ f ≫ (λ_ Y).hom = (λ_ X).hom ≫ f := by
    aesop_cat
  /--
  Naturality of the right unitor: commutativity of `X ⊗ 𝟙_ C ⟶ Y ⊗ 𝟙_ C ⟶ Y` and `X ⊗ 𝟙_ C ⟶ X ⟶ Y`
  -/
  rightUnitor_naturality :
    ∀ {X Y : C} (f : X ⟶ Y), f ▷ 𝟙_ _ ≫ (ρ_ Y).hom = (ρ_ X).hom ≫ f := by
    aesop_cat
  /--
  The pentagon identity relating the isomorphism between `X ⊗ (Y ⊗ (Z ⊗ W))` and `((X ⊗ Y) ⊗ Z) ⊗ W`
  -/
  pentagon :
    ∀ W X Y Z : C,
      (α_ W X Y).hom ▷ Z ≫ (α_ W (X ⊗ Y) Z).hom ≫ W ◁ (α_ X Y Z).hom =
        (α_ (W ⊗ X) Y Z).hom ≫ (α_ W X (Y ⊗ Z)).hom := by
    aesop_cat
  /--
  The identity relating the isomorphisms between `X ⊗ (𝟙_ C ⊗ Y)`, `(X ⊗ 𝟙_ C) ⊗ Y` and `X ⊗ Y`
  -/
  triangle :
    ∀ X Y : C, (α_ X (𝟙_ _) Y).hom ≫ X ◁ (λ_ Y).hom = (ρ_ X).hom ▷ Y := by
    aesop_cat

[self : CategoryTheory.MonoidalCategory C]

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


/-- If the sequence with `n`-th term the sup norm of `fun x ↦ f (x + n)` on the interval `Icc 0 1`,
for `n ∈ ℤ`, is summable, then `f` is integrable on `ℝ`. -/
theorem Real.integrable_of_summable_norm_Icc {E : Type*} [NormedAddCommGroup E] {f : C(ℝ, E)}
    (hf : Summable fun n : ℤ => ‖(f.comp <| ContinuousMap.addRight n).restrict (Icc 0 1)‖) :
    Integrable f

(hf : Summable fun n => ‖ContinuousMap.restrict (Set.Icc 0 1) (f.comp (ContinuousMap.addRight ↑n))‖)


/-- The **Cauchy-Davenport Theorem**. If `s`, `t` are nonempty sets in $$ℤ/pℤ$$, then the size of
`s + t` is lower-bounded by `|s| + |t| - 1`, unless this quantity is greater than `p`. -/
lemma ZMod.min_le_card_add {p : ℕ} (hp : p.Prime) {s t : Finset (ZMod p)} (hs : s.Nonempty)
    (ht : t.Nonempty) : min p (s.card + t.card - 1) ≤ (s + t).card

{p : ℕ}
(hp : Nat.Prime p)
{s t : Finset (ZMod p)}
(hs : s.Nonempty)
(ht : t.Nonempty)


@[simp]
theorem comul_apply (r : A × B) :
    comul r =
      TensorProduct.map (.inl R A B) (.inl R A B) (comul r.1) +
      TensorProduct.map (.inr R A B) (.inr R A B) (comul r.2)

(R : Type u)
(A : Type v)
(B : Type w)
[CommSemiring R]
[AddCommMonoid A]
[AddCommMonoid B]
[Module R A]
[Module R B]
[Coalgebra R A]
[Coalgebra R B]
(r : A × B)

Coalgebra.comul r =
  (TensorProduct.map (LinearMap.inl R A B) (LinearMap.inl R A B)) (Coalgebra.comul r.1) +
    (TensorProduct.map (LinearMap.inr R A B) (LinearMap.inr R A B)) (Coalgebra.comul r.2)


theorem comp_measurable {γ : Type*} {_ : MeasurableSpace γ} {_ : MeasurableSpace α} {f : γ → α}
    {μ : Measure γ} (hg : AEStronglyMeasurable g (Measure.map f μ)) (hf : Measurable f) :
    AEStronglyMeasurable (g ∘ f) μ

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace β]
{g : α → β}
{γ : Type u_5}

∀ {x : MeasurableSpace γ} {x_1 : MeasurableSpace α} {f : γ → α} {μ : MeasureTheory.Measure γ},
  MeasureTheory.AEStronglyMeasurable g (MeasureTheory.Measure.map f μ) →
    Measurable f → MeasureTheory.AEStronglyMeasurable (g ∘ f) μ


/-- The composition of morphisms in `SingleFunctors C D A`. -/
@[simps]
def comp (α : Hom F G) (β : Hom G H) : Hom F H

{F G H : CategoryTheory.SingleFunctors C D A}


theorem infinite_of_forall_exists_lt (h : ∀ a, ∃ b ∈ s, b < a) : s.Infinite

{α : Type u}
[Preorder α]
[Nonempty α]
{s : Set α}
(h : ∀ (a : α), ∃ b ∈ s, b < a)


@[to_additive]
theorem prehaar_mem_haarProduct (K₀ : PositiveCompacts G) {U : Set G} (hU : (interior U).Nonempty) :
    prehaar (K₀ : Set G) U ∈ haarProduct (K₀ : Set G)

(K₀ : TopologicalSpace.PositiveCompacts G)

MeasureTheory.Measure.haar.addPrehaar (↑K₀) U ∈ MeasureTheory.Measure.haar.addHaarProduct ↑K₀


nonrec theorem HasDerivAtFilter.prod (hf₁ : HasDerivAtFilter f₁ f₁' x L)
    (hf₂ : HasDerivAtFilter f₂ f₂' x L) : HasDerivAtFilter (fun x => (f₁ x, f₂ x)) (f₁', f₂') x L

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f₁ : 𝕜 → F}
{f₁' : F}
{x : 𝕜}
{L : Filter 𝕜}
{G : Type w}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{f₂ : 𝕜 → G}
{f₂' : G}
(hf₁ : HasDerivAtFilter f₁ f₁' x L)
(hf₂ : HasDerivAtFilter f₂ f₂' x L)


/-- Let `S` be an extension of `R` and `Rₘ Sₘ` be localizations at `M` of `R S` respectively.
Then the norm of `a : Sₘ` over `Rₘ` is the norm of `a : S` over `R` if `S` is free as `R`-module.
-/
theorem Algebra.norm_localization [Module.Free R S] [Module.Finite R S] (a : S) :
    Algebra.norm Rₘ (algebraMap S Sₘ a) = algebraMap R Rₘ (Algebra.norm R a)

[IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ]

(Algebra.norm Rₘ) ((algebraMap S Sₘ) a) = (algebraMap R Rₘ) ((Algebra.norm R) a)


/-- The function that sends `x` to the `y`-derivative of `f(x,y)` at `g(x)` is `C^m` at `x₀`,
where the derivative is taken as a continuous linear map.
We have to assume that `f` is `C^n` at `(x₀, g(x₀))` for `n ≥ m + 1` and `g` is `C^m` at `x₀`.
We have to insert a coordinate change from `x₀` to `x` to make the derivative sensible.
This result is used to show that maps into the 1-jet bundle and cotangent bundle are smooth.
`ContMDiffAt.mfderiv_const` is a special case of this.

This result should be generalized to a `ContMDiffWithinAt` for `mfderivWithin`.
If we do that, we can deduce `ContMDiffOn.contMDiffOn_tangentMapWithin` from this.
-/
protected theorem ContMDiffAt.mfderiv {x₀ : N} (f : N → M → M') (g : N → M)
    (hf : ContMDiffAt (J.prod I) I' n (Function.uncurry f) (x₀, g x₀)) (hg : ContMDiffAt J I m g x₀)
    (hmn : m + 1 ≤ n) :
    ContMDiffAt J 𝓘(𝕜, E →L[𝕜] E') m
      (inTangentCoordinates I I' g (fun x => f x (g x)) (fun x => mfderiv I I' (f x) (g x)) x₀)
      x₀


theorem succ_sub_one (n) : succ n - 1 = n


theorem biUnion_insert (a : α) (s : Set α) (t : α → Set β) :
    ⋃ x ∈ insert a s, t x = t a ∪ ⋃ x ∈ s, t x

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


@[simp]
theorem mul_mul_left [Fintype n] (M : Matrix m n α) (N : Matrix n o α) (a : α) :
    (of fun i j => a * M i j) * N = a • (M * N)

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
[Semiring α]
[Fintype n]
(M : Matrix m n α)
(N : Matrix n o α)
(a : α)

(Matrix.of fun i j => a * M i j) * N = a • (M * N)


theorem C_eq_intCast (n : ℤ) : C (n : R) = n


theorem ext (ℱ : SheafOfTypes K) (X : D) {s t : ℱ.val.obj (op X)}
    (h : ∀ ⦃Y : C⦄ (f : G.obj Y ⟶ X), ℱ.val.map f.op s = ℱ.val.map f.op t) : s = t

{K : CategoryTheory.GrothendieckTopology D}


class IsRightCancel (α : Sort u) (op : α → α → α) : Prop where
  right_cancel : ∀ a b c, op a b = op c b → a = c

{α : Sort u}
{op : α → α → α}
[self : IsRightCancel α op]
(a b c : α)


theorem degree_prod_le : (∏ i ∈ s, f i).degree ≤ ∑ i ∈ s, (f i).degree

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


/-- A continuous function with compact support has a global minimum. -/
@[to_additive "A continuous function with compact support has a global minimum."]
theorem Continuous.exists_forall_le_of_hasCompactMulSupport [ClosedIicTopology α] [Nonempty β]
    [One α] {f : β → α} (hf : Continuous f) (h : HasCompactMulSupport f) :
    ∃ x : β, ∀ y : β, f x ≤ f y

{α : Type u_2}
{β : Type u_3}
[LinearOrder α]
[TopologicalSpace α]
[TopologicalSpace β]
[ClosedIicTopology α]
[Nonempty β]
[One α]
{f : β → α}
(hf : Continuous f)
(h : HasCompactMulSupport f)


/-- Suppose `f` and `g` are two morphisms with a common codomain and suppose we have written `g` as
    an epimorphism followed by a monomorphism. If `f` factors through the mono part of this
    factorization, then any pullback of `g` along `f` is an epimorphism. -/
theorem epi_fst_of_factor_thru_epi_mono_factorization (g₁ : Y ⟶ W) [Epi g₁] (g₂ : W ⟶ Z) [Mono g₂]
    (hg : g₁ ≫ g₂ = g) (f' : X ⟶ W) (hf : f' ≫ g₂ = f) (t : PullbackCone f g) (ht : IsLimit t) :
    Epi t.fst

(t : CategoryTheory.Limits.PullbackCone f g)


@[to_additive]
theorem map_mul₂ {_ : MulOneClass M} {_ : MulOneClass N} {_ : CommMonoid P} (f : M →* N →* P)
    (m₁ m₂ : M) (n : N) : f (m₁ * m₂) n = f m₁ n * f m₂ n

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

∀ {x : MulOneClass M} {x_1 : MulOneClass N} {x_2 : CommMonoid P} (f : M →* N →* P) (m₁ m₂ : M) (n : N),
  (f (m₁ * m₂)) n = (f m₁) n * (f m₂) n


/-- Given a nonempty affine subspace, whose direction is
finite-dimensional, that contains a set of points, those points are
cospherical if and only if they are equidistant from some point in
that subspace. -/
theorem cospherical_iff_exists_mem_of_finiteDimensional {s : AffineSubspace ℝ P} {ps : Set P}
    (h : ps ⊆ s) [Nonempty s] [FiniteDimensional ℝ s.direction] :
    Cospherical ps ↔ ∃ center ∈ s, ∃ radius : ℝ, ∀ p ∈ ps, dist p center = radius

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{s : AffineSubspace ℝ P}
{ps : Set P}
(h : ps ⊆ ↑s)
[Nonempty ↥s]
[FiniteDimensional ℝ ↥s.direction]

EuclideanGeometry.Cospherical ps ↔ ∃ center ∈ s, ∃ radius, ∀ p ∈ ps, dist p center = radius


theorem coe_coalgHom_injective : Function.Injective ((↑) : (A →ₐc[R] B) → A →ₗc[R] B)

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]


@[simp]
lemma apply_apply [ContinuousConstSMul 𝕜 F] {m : Π i, E i} {c : ContinuousMultilinearMap 𝕜 E F} :
    apply 𝕜 E F m c = c m

{𝕜 : Type u_1}
{ι : Type u_2}
{E : ι → Type u_3}
{F : Type u_4}
[NormedField 𝕜]
[(i : ι) → TopologicalSpace (E i)]
[(i : ι) → AddCommGroup (E i)]
[(i : ι) → Module 𝕜 (E i)]
[AddCommGroup F]
[Module 𝕜 F]
[TopologicalSpace F]
[TopologicalAddGroup F]
[∀ (i : ι), ContinuousSMul 𝕜 (E i)]
[ContinuousConstSMul 𝕜 F]
{m : (i : ι) → E i}
{c : ContinuousMultilinearMap 𝕜 E F}

(ContinuousMultilinearMap.apply 𝕜 E F m) c = c m


theorem grundyValue_add (G H : PGame) [G.Impartial] [H.Impartial] {n m : ℕ} (hG : grundyValue G = n)
    (hH : grundyValue H = m) : grundyValue (G + H) = n ^^^ m

(G H : SetTheory.PGame)
[G.Impartial]
[H.Impartial]
{n m : ℕ}
(hG : G.grundyValue = ↑n)
(hH : H.grundyValue = ↑m)


lemma reflects_exact_of_faithful [F.Faithful] (S : ShortComplex C) (hS : (S.map F).Exact) :
    S.Exact

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Abelian C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
[CategoryTheory.Abelian D]
(F : C ⥤ D)
[F.PreservesZeroMorphisms]
[F.Faithful]
(S : CategoryTheory.ShortComplex C)
(hS : (S.map F).Exact)


theorem support_toPartitionOfUnity_subset (i : ι) :
    support (f.toPartitionOfUnity i) ⊆ support (f i)

{ι : Type u}
{X : Type v}
[TopologicalSpace X]
{s : Set X}
(f : BumpCovering ι X s)
(i : ι)

Function.support ⇑(f.toPartitionOfUnity i) ⊆ Function.support ⇑(f i)


theorem mem_powerset_self (s : Finset α) : s ∈ powerset s


theorem fib_le_fib_succ {n : ℕ} : fib n ≤ fib (n + 1)


theorem mem_iff (S : Subgroupoid C) (F : Σ c d, c ⟶ d) : F ∈ S ↔ F.2.2 ∈ S.arrows F.1 F.2.1

{C : Type u}
[CategoryTheory.Groupoid C]
(S : CategoryTheory.Subgroupoid C)
(F : (c : C) × (d : C) × (c ⟶ d))

F ∈ S ↔ F.snd.snd ∈ S.arrows F.fst F.snd.fst


theorem degree_add_le_of_le {a b : WithBot ℕ} (hp : degree p ≤ a) (hq : degree q ≤ b) :
    degree (p + q) ≤ max a b

{R : Type u}
[Semiring R]
{p q : R[X]}
{a b : WithBot ℕ}
(hp : p.degree ≤ a)
(hq : q.degree ≤ b)


@[continuity]
theorem prod_continuous_equiv_symm : Continuous (WithLp.equiv p (α × β)).symm

(p : ℝ≥0∞)
(α : Type u_2)
(β : Type u_3)
[TopologicalSpace α]
[TopologicalSpace β]

Continuous ⇑(WithLp.equiv p (α × β)).symm


lemma sub_one_add_self (n : ℕ) : (n - 1) + n = 2 * n - 1


theorem derivWithin_of_mem (st : t ∈ 𝓝[s] x) (ht : UniqueDiffWithinAt 𝕜 s x)
    (h : DifferentiableWithinAt 𝕜 f t x) : derivWithin f s x = derivWithin f t x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{x : 𝕜}
{s t : Set 𝕜}
(st : t ∈ 𝓝[s] x)
(ht : UniqueDiffWithinAt 𝕜 s x)
(h : DifferentiableWithinAt 𝕜 f t x)


@[elementwise (attr := simp)]
theorem equalizerIso_inv_comp_ι : (equalizerIso g h).inv ≫ equalizer.ι g h = Subtype.val

(CategoryTheory.Limits.Types.equalizerIso g h).inv ≫ CategoryTheory.Limits.equalizer.ι g h = Subtype.val


theorem len_lt_of_mono {Δ' Δ : SimplexCategory} (i : Δ' ⟶ Δ) [hi : Mono i] (hi' : Δ ≠ Δ') :
    Δ'.len < Δ.len

{Δ' Δ : SimplexCategory}
(i : Δ' ⟶ Δ)
[hi : CategoryTheory.Mono i]
(hi' : Δ ≠ Δ')


/-- Variant of `homMk'` where both objects are applications of `mk`. -/
@[simps]
def mkPrecomp (f : S.obj Y ⟶ T) (g : Y' ⟶ Y) : mk (S.map g ≫ f) ⟶ mk f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{T : D}
{Y Y' : C}
{S : CategoryTheory.Functor C D}
(f : S.obj Y ⟶ T)
(g : Y' ⟶ Y)

(CategoryTheory.CostructuredArrow.mkPrecomp f g).left = g


@[simp] lemma deleteEdges_adj : (G.deleteEdges s).Adj v w ↔ G.Adj v w ∧ ¬s(v, w) ∈ s

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

(G.deleteEdges s).Adj v w ↔ G.Adj v w ∧ s(v, w) ∉ s


/-- `x^n`, `n : ℕ` is convex on `[0, +∞)` for all `n`. -/
lemma convexOn_pow : ∀ n, ConvexOn 𝕜 (Ici 0) fun x : 𝕜 ↦ x ^ n

{𝕜 : Type u_1}
[LinearOrderedCommRing 𝕜]
(n : ℕ)


/-- The category of coalgebras over an additive comonad on a preadditive category is preadditive. -/
@[simps]
instance Comonad.coalgebraPreadditive : Preadditive (Comonad.Coalgebra U)

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Preadditive C]
(U : CategoryTheory.Comonad C)
[U.Additive]
(F G : U.Coalgebra)
(r : ℤ)
(α : F ⟶ G)


@[to_additive]
private theorem card_pow_eq_one_eq_orderOf_aux (a : α) :
    (Finset.univ.filter fun b : α => b ^ orderOf a = 1).card = orderOf a

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

(Finset.filter (fun b => addOrderOf a • b = 0) Finset.univ).card = addOrderOf a


/-- A strictly convex function on an open segment is strictly upper-bounded by the max of its
endpoints. -/
theorem StrictConvexOn.lt_on_openSegment (hf : StrictConvexOn 𝕜 s f) {x y z : E} (hx : x ∈ s)
    (hy : y ∈ s) (hxy : x ≠ y) (hz : z ∈ openSegment 𝕜 x y) : f z < max (f x) (f y)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[LinearOrderedAddCommMonoid β]
[SMul 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : StrictConvexOn 𝕜 s f)
{x y z : E}
(hx : x ∈ s)
(hy : y ∈ s)
(hxy : x ≠ y)
(hz : z ∈ openSegment 𝕜 x y)


@[simp]
theorem reverse_append {u v w : V} (p : G.Walk u v) (q : G.Walk v w) :
    (p.append q).reverse = q.reverse.append p.reverse

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


lemma norm_def (x : ULift E) : ‖x‖ = ‖x.down‖

{E : Type u_2}
[Norm E]
(x : ULift.{u_5, u_2} E)


lemma toAffine_of_equiv {P Q : Fin 3 → F} (h : P ≈ Q) : toAffine W P = toAffine W Q

{F : Type v}
[Field F]
{W : WeierstrassCurve.Jacobian F}
{P Q : Fin 3 → F}
(h : P ≈ Q)

WeierstrassCurve.Jacobian.Point.toAffine W P = WeierstrassCurve.Jacobian.Point.toAffine W Q


theorem balanced_zero : Balanced 𝕜 (0 : Set E)

{𝕜 : Type u_1}
{E : Type u_3}
[SeminormedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]


@[simp]
theorem mem_sdiff : x ∈ s \ t ↔ x ∈ s ∧ ¬x ∈ t

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{A : Set M}
{α : Type u₁}
{s t : L.DefinableSet A α}
{x : α → M}


/-- The norm of a bounded continuous function is the supremum of `‖f x‖`.
We use `sInf` to ensure that the definition works if `α` has no elements. -/
theorem norm_eq (f : α →ᵇ β) : ‖f‖ = sInf { C : ℝ | 0 ≤ C ∧ ∀ x : α, ‖f x‖ ≤ C }

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[SeminormedAddCommGroup β]
(f : BoundedContinuousFunction α β)

‖f‖ = sInf {C | 0 ≤ C ∧ ∀ (x : α), ‖f x‖ ≤ C}


@[reassoc (attr := simp)]
theorem prod.map_map {A₁ A₂ A₃ B₁ B₂ B₃ : C} [HasBinaryProduct A₁ B₁] [HasBinaryProduct A₂ B₂]
    [HasBinaryProduct A₃ B₃] (f : A₁ ⟶ A₂) (g : B₁ ⟶ B₂) (h : A₂ ⟶ A₃) (k : B₂ ⟶ B₃) :
    prod.map f g ≫ prod.map h k = prod.map (f ≫ h) (g ≫ k)

CategoryTheory.Limits.prod.map f g ≫ CategoryTheory.Limits.prod.map h k = CategoryTheory.Limits.prod.map (f ≫ h) (g ≫ k)


@[norm_cast]
theorem coe_mul (a b : α) : ((a * b : α) : Completion α) = a * b

{α : Type u_1}
[Ring α]
[UniformSpace α]
[TopologicalRing α]
(a b : α)


@[simp]
theorem ofDual_lt_ofDual_iff {a b : WithTop αᵒᵈ} : WithTop.ofDual a < WithTop.ofDual b ↔ b < a

{α : Type u_1}
[LT α]
{a b : WithTop αᵒᵈ}


@[simp]
theorem chainHeight_eq_zero_iff : s.chainHeight = 0 ↔ s = ∅


/-- There is a field structure on type if and only if its cardinality is a prime power. -/
theorem Field.nonempty_iff {α : Type u} : Nonempty (Field α) ↔ IsPrimePow #α


@[simp]
theorem min_self (a : α) : min a a = a


/-- Variation of `TensorProduct.exists_finite_submodule_left_of_finite` where `M` and `N` are
already submodules. -/
theorem exists_finite_submodule_left_of_finite' (s : Set (M₁ ⊗[R] N₁)) (hs : s.Finite) :
    ∃ (M' : Submodule R M) (hM : M' ≤ M₁), Module.Finite R M' ∧
      s ⊆ LinearMap.range ((inclusion hM).rTensor N₁)

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[CommSemiring R]
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
{M₁ : Submodule R M}
{N₁ : Submodule R N}
(s : Set (↥M₁ ⊗[R] ↥N₁))
(hs : s.Finite)

∃ M', ∃ (hM : M' ≤ M₁), Module.Finite R ↥M' ∧ s ⊆ ↑(LinearMap.range (LinearMap.rTensor (↥N₁) (Submodule.inclusion hM)))


theorem lt_pow_of_log_lt {b x y : ℕ} (hb : 1 < b) : log b y < x → y < b ^ x


theorem exists_root_of_degree_eq_one (h : degree p = 1) : ∃ x, IsRoot p x

{R : Type u}
[Field R]
{p : R[X]}
(h : p.degree = 1)


theorem frequently_iff_forall_eventually_exists_and {p : α → Prop} {f : Filter α} :
    (∃ᶠ x in f, p x) ↔ ∀ {q : α → Prop}, (∀ᶠ x in f, q x) → ∃ x, p x ∧ q x

{α : Type u}
{p : α → Prop}
{f : Filter α}

(∃ᶠ (x : α) in f, p x) ↔ ∀ {q : α → Prop}, (∀ᶠ (x : α) in f, q x) → ∃ x, p x ∧ q x


@[simp]
protected theorem smul_neg : s • -t = -(s • t)

{α : Type u_2}
{β : Type u_3}
[Monoid α]
[AddGroup β]
[DistribMulAction α β]
[DecidableEq β]
(s : Finset α)
(t : Finset β)


@[to_additive]
theorem Equiv.multipliable_iff (e : γ ≃ β) : Multipliable (f ∘ e) ↔ Multipliable f

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β → α}
(e : γ ≃ β)


theorem MeasurePreserving.integrable_comp_emb {f : α → δ} {ν} (h₁ : MeasurePreserving f μ ν)
    (h₂ : MeasurableEmbedding f) {g : δ → β} : Integrable (g ∘ f) μ ↔ Integrable g ν

(h₁ : MeasureTheory.MeasurePreserving f μ ν)

MeasureTheory.Integrable (g ∘ f) μ ↔ MeasureTheory.Integrable g ν


lemma zeroLocus_isClosed {U : Opens X} (s : Set (X.presheaf.obj (op U))) :
    IsClosed (X.zeroLocus s)

{U : TopologicalSpace.Opens ↑↑X.toPresheafedSpace}

(s : Set ↑(X.presheaf.obj (Opposite.op U)))


/-- Suppose an indexed family of points is given, along with a subset
of the index type.  A vector can be expressed as
`weightedVSubOfPoint` using a `Finset` lying within that subset and
with a given sum of weights if and only if it can be expressed as
`weightedVSubOfPoint` with that sum of weights for the
corresponding indexed family whose index type is the subtype
corresponding to that subset. -/
theorem eq_weightedVSubOfPoint_subset_iff_eq_weightedVSubOfPoint_subtype {v : V} {x : k} {s : Set ι}
    {p : ι → P} {b : P} :
    (∃ fs : Finset ι, ↑fs ⊆ s ∧ ∃ w : ι → k, ∑ i ∈ fs, w i = x ∧
        v = fs.weightedVSubOfPoint p b w) ↔
      ∃ (fs : Finset s) (w : s → k), ∑ i ∈ fs, w i = x ∧
        v = fs.weightedVSubOfPoint (fun i : s => p i) b w

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
{v : V}
{x : k}
{s : Set ι}
{p : ι → P}
{b : P}

(∃ fs, ↑fs ⊆ s ∧ ∃ w, ∑ i ∈ fs, w i = x ∧ v = (fs.weightedVSubOfPoint p b) w) ↔
  ∃ fs w, ∑ i ∈ fs, w i = x ∧ v = (fs.weightedVSubOfPoint (fun i => p ↑i) b) w


theorem orderTop_add_eq_left {Γ} [LinearOrder Γ] {x y : HahnSeries Γ R}
    (hxy : x.orderTop < y.orderTop) : (x + y).orderTop = x.orderTop

{R : Type u_2}
[AddMonoid R]
{Γ : Type u_3}
[LinearOrder Γ]
{x y : HahnSeries Γ R}
(hxy : x.orderTop < y.orderTop)


protected theorem MDifferentiableAt.mfderiv (h : MDifferentiableAt I I' f x) :
    mfderiv I I' f x =
      fderivWithin 𝕜 (writtenInExtChartAt I I' x f : _) (range I) ((extChartAt I x) x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f : M → M'}
{x : M}
[Is : SmoothManifoldWithCorners I M]
[I's : SmoothManifoldWithCorners I' M']
(h : MDifferentiableAt I I' f x)

mfderiv I I' f x = fderivWithin 𝕜 (writtenInExtChartAt I I' x f) (Set.range ↑I) (↑(extChartAt I x) x)


/-- A diagonal matrix is hermitian if the entries are self-adjoint (as a vector) -/
theorem isHermitian_diagonal_of_self_adjoint [DecidableEq n] (v : n → α) (h : IsSelfAdjoint v) :
    (diagonal v).IsHermitian

{α : Type u_1}
{n : Type u_4}
[AddMonoid α]
[StarAddMonoid α]
[DecidableEq n]
(v : n → α)
(h : IsSelfAdjoint v)


theorem StrictMonoOn.exists_deriv_lt_slope_aux {x y : ℝ} {f : ℝ → ℝ} (hf : ContinuousOn f (Icc x y))
    (hxy : x < y) (hf'_mono : StrictMonoOn (deriv f) (Ioo x y)) (h : ∀ w ∈ Ioo x y, deriv f w ≠ 0) :
    ∃ a ∈ Ioo x y, deriv f a < (f y - f x) / (y - x)

(hf'_mono : StrictMonoOn (deriv f) (Set.Ioo x y))

∃ a ∈ Set.Ioo x y, deriv f a < (f y - f x) / (y - x)


@[to_additive]
theorem noncommPiCoprod_mrange :
    MonoidHom.mrange (noncommPiCoprod ϕ hcomm) = ⨆ i : ι, MonoidHom.mrange (ϕ i)

{hcomm : Pairwise fun i j => ∀ (x : N i) (y : N j), Commute ((ϕ i) x) ((ϕ j) y)}

MonoidHom.mrange (MonoidHom.noncommPiCoprod ϕ hcomm) = ⨆ i, MonoidHom.mrange (ϕ i)


/-- The kernel of `f.op` is the opposite of `cokernel f`. -/
@[simps]
def kernelOpUnop : (kernel f.op).unop ≅ cokernel f

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Abelian C]
{X Y : C}
(f : X ⟶ Y)

(CategoryTheory.kernelOpUnop f).hom =
  (CategoryTheory.Limits.kernel.lift f.op (CategoryTheory.Limits.cokernel.π f).op ⋯).unop


@[simp] theorem Int.comap_cast_atTop [StrictOrderedRing R] [Archimedean R] :
    comap ((↑) : ℤ → R) atTop = atTop

{R : Type u_2}
[StrictOrderedRing R]
[Archimedean R]

Filter.comap Int.cast Filter.atTop = Filter.atTop


@[simp]
theorem Ico_inter_Iio : Ico a b ∩ Iio c = Ico a (min b c)

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

Set.Ico a b ∩ Set.Iio c = Set.Ico a (min b c)


/-- Given a natural transformation `τ : F ⟶ G` between functors `C ⥤ D` which preserve
the left homology of a short complex `S`, and a left homology data for `S`,
this is the left homology map data for the morphism `S.mapNatTrans τ`
obtained by evaluating `τ`. -/
@[simps]
def LeftHomologyMapData.natTransApp (h : LeftHomologyData S) (τ : F ⟶ G) :
    LeftHomologyMapData (S.mapNatTrans τ) (h.map F) (h.map G)

(CategoryTheory.ShortComplex.LeftHomologyMapData.natTransApp h τ).φH = τ.app h.H


@[simp]
theorem mk'_toSubmonoid {s : Set R} {sm : Submonoid R} (hm : ↑sm = s) {sa : AddSubgroup R}
    (ha : ↑sa = s) : (Subring.mk' s sm sa hm ha).toSubmonoid = sm

{R : Type u}
[Ring R]
{s : Set R}
{sm : Submonoid R}
(hm : ↑sm = s)
{sa : AddSubgroup R}
(ha : ↑sa = s)


@[simp, norm_cast]
theorem toEnd_natCast (n : ℕ) : (n : CentroidHom α).toEnd = ↑n

{α : Type u_5}
[NonUnitalNonAssocSemiring α]
(n : ℕ)


@[simp] theorem bmod_emod : bmod x m % m = x % m


/-- A sequentially compact set in a uniform space is totally bounded. -/
protected theorem IsSeqCompact.totallyBounded (h : IsSeqCompact s) : TotallyBounded s

{X : Type u_1}
[UniformSpace X]
{s : Set X}
(h : IsSeqCompact s)


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

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


@[to_additive]
theorem disjoint_iff_mul_eq_one {H₁ H₂ : Subgroup G} :
    Disjoint H₁ H₂ ↔ ∀ {x y : G}, x ∈ H₁ → y ∈ H₂ → x * y = 1 → x = 1 ∧ y = 1

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


@[to_additive pi_nnnorm_le_iff]
lemma pi_nnnorm_le_iff' {r : ℝ≥0} : ‖x‖₊ ≤ r ↔ ∀ i, ‖x i‖₊ ≤ r

{ι : Type u_1}
{π : ι → Type u_4}
[Fintype ι]
[(i : ι) → SeminormedAddGroup (π i)]
{x : (i : ι) → π i}
{r : ℝ≥0}

‖x‖₊ ≤ r ↔ ∀ (i : ι), ‖x i‖₊ ≤ r


/-- A version of `Submodule.span_eq` for when the span is by a smaller ring. -/
@[simp]
theorem span_coe_eq_restrictScalars [Semiring S] [SMul S R] [Module S M] [IsScalarTower S R M] :
    span S (p : Set M) = p.restrictScalars S

{R : Type u_1}
{M : Type u_4}
{S : Type u_7}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(p : Submodule R M)
[Semiring S]
[SMul S R]
[Module S M]
[IsScalarTower S R M]

Submodule.span S ↑p = Submodule.restrictScalars S p


/-- The sequential closure of a set is contained in the closure of that set.
The converse is not true. -/
theorem seqClosure_subset_closure {s : Set X} : seqClosure s ⊆ closure s

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


/-- Given a category of complexes with objects in `Vᵒᵖ`, there is a natural equivalence between its
opposite category and a category of complexes with objects in `V`. -/
@[simps]
def unopEquivalence : (HomologicalComplex Vᵒᵖ c)ᵒᵖ ≌ HomologicalComplex V c.symm

(HomologicalComplex.unopEquivalence V c).inverse = HomologicalComplex.unopInverse V c


/-- An equivalence between opposite categories gives an equivalence between the original categories.
-/
@[simps]
def unop (e : Cᵒᵖ ≌ Dᵒᵖ) : C ≌ D

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

e.unop.counitIso = (CategoryTheory.NatIso.unop e.counitIso).symm


theorem beq_eq_decide {α : Type*} [BEq α] [LawfulBEq α] {a b : α} : (a == b) = decide (a = b)

{α : Type u_1}
[BEq α]
[LawfulBEq α]
{a b : α}


@[simp]
theorem toEnd_pow (x : CentroidHom α) (n : ℕ) : (x ^ n).toEnd = x.toEnd ^ n

{α : Type u_5}
[NonUnitalNonAssocSemiring α]
(x : CentroidHom α)
(n : ℕ)


theorem iIndepSet_iff_meas_biInter {_mΩ : MeasurableSpace Ω} {κ : Kernel α Ω}
    [IsMarkovKernel κ] {μ : Measure α} {f : ι → Set Ω} (hf : ∀ i, MeasurableSet (f i)) :
    iIndepSet f κ μ ↔ ∀ s, ∀ᵐ a ∂μ, κ a (⋂ i ∈ s, f i) = ∏ i ∈ s, κ a (f i)

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

ProbabilityTheory.Kernel.iIndepSet f κ μ ↔ ∀ (s : Finset ι), ∀ᵐ (a : α) ∂μ, (κ a) (⋂ i ∈ s, f i) = ∏ i ∈ s, (κ a) (f i)


theorem pow_natDegree_le_of_root_of_monic_mem {x : R} (hroot : IsRoot f x) (hmo : f.Monic) :
    ∀ i, f.natDegree ≤ i → x ^ i ∈ 𝓟

{R : Type u}
[CommRing R]
{𝓟 : Ideal R}
{f : R[X]}
(hf : f.IsWeaklyEisensteinAt 𝓟)
{x : R}
(hroot : f.IsRoot x)
(hmo : f.Monic)
(i : ℕ)


@[simp]
theorem coe_map (g : β → γ) (f : α →ₛ β) : (f.map g : α → γ) = g ∘ f

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

↑(MeasureTheory.SimpleFunc.map g f) = g ∘ ↑f


/-- A submonoid contains the monoid's 1. -/
@[to_additive "An `AddSubmonoid` contains the monoid's 0."]
protected theorem one_mem : (1 : M) ∈ S

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


@[simp]
theorem inf_coe : (↑(N ⊓ N') : Set M) = ↑N ∩ ↑N'

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


theorem rpow_eq_zero_iff_of_nonneg (hx : 0 ≤ x) : x ^ y = 0 ↔ x = 0 ∧ y ≠ 0


@[simp]
theorem LHom.onTheory_model [L'.Structure M] (φ : L →ᴸ L') [φ.IsExpansionOn M] (T : L.Theory) :
    M ⊨ φ.onTheory T ↔ M ⊨ T

{L : FirstOrder.Language}
{L' : FirstOrder.Language}
{M : Type w}
[L.Structure M]
[L'.Structure M]
(φ : L →ᴸ L')
[φ.IsExpansionOn M]
(T : L.Theory)


@[simp]
theorem Multiset.card_toEnumFinset (m : Multiset α) : m.toEnumFinset.card = Multiset.card m

{α : Type u_1}
[DecidableEq α]
(m : Multiset α)


theorem xn_modEq_x4n_sub {n j} (h : j ≤ 2 * n) : xn a1 (4 * n - j) ≡ xn a1 j [MOD xn a1 n]

Pell.xn a1 (4 * n - j) ≡ Pell.xn a1 j [MOD Pell.xn a1 n]


theorem ExistsUnique.intro {p : α → Prop} (w : α)
    (h₁ : p w) (h₂ : ∀ y, p y → y = w) : ∃! x, p x

{α : Sort u}
{p : α → Prop}
(w : α)
(h₁ : p w)
(h₂ : ∀ (y : α), p y → y = w)


theorem MapsTo.image_subset (h : MapsTo f s t) : f '' s ⊆ t

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{f : α → β}
(h : Set.MapsTo f s t)


@[simp]
theorem mem_properDivisors {m : ℕ} : n ∈ properDivisors m ↔ n ∣ m ∧ n < m


theorem tendsto_Iic_atBot [SemilatticeInf α] {a : α} {f : β → Iic a} {l : Filter β} :
    Tendsto f l atBot ↔ Tendsto (fun x => (f x : α)) l atBot

{α : Type u_3}
{β : Type u_4}
[SemilatticeInf α]
{a : α}
{f : β → ↑(Set.Iic a)}
{l : Filter β}

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


theorem measure_fundamentalDomain_ne_zero [Finite ι] [MeasurableSpace E] [BorelSpace E]
    {μ : Measure E} [Measure.IsAddHaarMeasure μ] :
    μ (fundamentalDomain b) ≠ 0

{E : Type u_1}
{ι : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(b : Basis ι ℝ E)
[Finite ι]
[MeasurableSpace E]
[BorelSpace E]
{μ : MeasureTheory.Measure E}
[μ.IsAddHaarMeasure]


lemma Embedding.isTotallyDisconnected_range [TopologicalSpace β] {f : α → β} (hf : Embedding f) :
    IsTotallyDisconnected (range f) ↔ TotallyDisconnectedSpace α

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
(hf : Embedding f)

IsTotallyDisconnected (Set.range f) ↔ TotallyDisconnectedSpace α


/-- The multiplicity of `p + q` is at least the minimum of the multiplicities. -/
theorem rootMultiplicity_add {p q : R[X]} (a : R) (hzero : p + q ≠ 0) :
    min (rootMultiplicity a p) (rootMultiplicity a q) ≤ rootMultiplicity a (p + q)

{R : Type u}
[CommRing R]
{p q : R[X]}
(a : R)
(hzero : p + q ≠ 0)

min (Polynomial.rootMultiplicity a p) (Polynomial.rootMultiplicity a q) ≤ Polynomial.rootMultiplicity a (p + q)


@[simp] lemma top_mul_top : (⊤ * ⊤ : WithTop α) = ⊤

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


theorem iInf_subtype' {p : ι → Prop} {f : ∀ i, p i → α} :
    ⨅ (i) (h : p i), f i h = ⨅ x : Subtype p, f x x.property

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
{p : ι → Prop}
{f : (i : ι) → p i → α}


theorem range_le_ker_iff {f : M →ₛₗ[τ₁₂] M₂} {g : M₂ →ₛₗ[τ₂₃] M₃} :
    range f ≤ ker g ↔ (g.comp f : M →ₛₗ[τ₁₃] M₃) = 0

{R : Type u_1}
{R₂ : Type u_2}
{R₃ : Type u_3}
{M : Type u_6}
{M₂ : Type u_7}
{M₃ : Type u_8}
[Semiring R]
[Semiring R₂]
[Semiring R₃]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R M]
[Module R₂ M₂]
[Module R₃ M₃]
{τ₁₂ : R →+* R₂}
{τ₂₃ : R₂ →+* R₃}
{τ₁₃ : R →+* R₃}
[RingHomCompTriple τ₁₂ τ₂₃ τ₁₃]
[RingHomSurjective τ₁₂]
{f : M →ₛₗ[τ₁₂] M₂}
{g : M₂ →ₛₗ[τ₂₃] M₃}

LinearMap.range f ≤ LinearMap.ker g ↔ g.comp f = 0


@[simp]
theorem bot_lt_coe (a : α) : ⊥ < (a : WithBot α)


@[simp]
theorem mem_torsionBySet_iff (x : M) : x ∈ torsionBySet R M s ↔ ∀ a : s, (a : R) • x = 0

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(s : Set R)
(x : M)

x ∈ Submodule.torsionBySet R M s ↔ ∀ (a : ↑s), ↑a • x = 0


theorem sInter_eq_empty_iff {c : Set (Set α)} : ⋂₀ c = ∅ ↔ ∀ a, ∃ b ∈ c, a ∉ b


/-- The canonical map from `𝓞 K` to `K` is injective.

This is a convenient abbreviation for `map_eq_zero_iff` applied to
`NoZeroSMulDivisors.algebraMap_injective`.
-/
@[simp] lemma coe_eq_zero_iff {x : 𝓞 K} : algebraMap _ K x = 0 ↔ x = 0

{K : Type u_1}
[Field K]
{x : NumberField.RingOfIntegers K}

(algebraMap (NumberField.RingOfIntegers K) K) x = 0 ↔ x = 0


/-- A sum of numbers is infinite iff one of them is infinite -/
theorem sum_eq_top_iff {s : Finset α} {f : α → ℝ≥0∞} : ∑ x ∈ s, f x = ∞ ↔ ∃ a ∈ s, f a = ∞

{α : Type u_1}
{s : Finset α}
{f : α → ℝ≥0∞}


/-- The category of differential graded objects in `V` is equivalent
to the category of homological complexes in `V`.
-/
@[simps]
def dgoEquivHomologicalComplex :
    DifferentialObject ℤ (GradedObjectWithShift b V) ≌
      HomologicalComplex V (ComplexShape.up' b)

(HomologicalComplex.dgoEquivHomologicalComplex b V).inverse = HomologicalComplex.homologicalComplexToDGO b V


theorem conj_eq_iff_im {z : ℂ} : conj z = z ↔ z.im = 0


@[simp]
theorem coe_toSubsemiring (S : Subalgebra R A) : (↑S.toSubsemiring : Set A) = S

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R A)


@[simp]
theorem mem_map {f : α ≃o β} {b : β} : b ∈ map f s ↔ f.symm b ∈ s

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{s : LowerSet α}
{f : α ≃o β}
{b : β}


/-- A semilinear isometric equivalence between two normed vector spaces. -/
structure LinearIsometryEquiv (σ₁₂ : R →+* R₂) {σ₂₁ : R₂ →+* R} [RingHomInvPair σ₁₂ σ₂₁]
  [RingHomInvPair σ₂₁ σ₁₂] (E E₂ : Type*) [SeminormedAddCommGroup E] [SeminormedAddCommGroup E₂]
  [Module R E] [Module R₂ E₂] extends E ≃ₛₗ[σ₁₂] E₂ where
  norm_map' : ∀ x, ‖toLinearEquiv x‖ = ‖x‖

{R : Type u_1}
{R₂ : Type u_2}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
{E : Type u_11}
{E₂ : Type u_12}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
(self : E ≃ₛₗᵢ[σ₁₂] E₂)
(x : E)


/-- The **extreme value theorem**: if a function `f` is continuous on a closed set `s` and it is
smaller than a value in its image away from compact sets, then it has a maximum on this set. -/
@[deprecated ContinuousOn.exists_isMaxOn' (since := "2023-02-06")]
theorem ContinuousOn.exists_forall_ge' [ClosedIciTopology α] {s : Set β} {f : β → α}
    (hf : ContinuousOn f s) (hsc : IsClosed s) {x₀ : β} (h₀ : x₀ ∈ s)
    (hc : ∀ᶠ x in cocompact β ⊓ 𝓟 s, f x ≤ f x₀) : ∃ x ∈ s, ∀ y ∈ s, f y ≤ f x

(hc : ∀ᶠ (x : β) in Filter.cocompact β ⊓ 𝓟 s, f x ≤ f x₀)


@[simp]
theorem factorization_zero : factorization (0 : α) = 0

{α : Type u_1}
[CancelCommMonoidWithZero α]
[UniqueFactorizationMonoid α]
[NormalizationMonoid α]
[DecidableEq α]


@[simp]
theorem self_trans_symm (e : P₁ ≃ᵃ[k] P₂) : e.trans e.symm = refl k P₁

{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₂)


/-- This can be use to prove
```lean
example (a : Fin 2 → α) : a = ![a 0, a 1] :=
  (etaExpand_eq _).symm
```
-/
@[simp]
theorem etaExpand_eq {m} (v : Fin m → α) : etaExpand v = v


theorem derivWithin.scomp (hg : DifferentiableWithinAt 𝕜' g₁ t' (h x))
    (hh : DifferentiableWithinAt 𝕜 h s x) (hs : MapsTo h s t') (hxs : UniqueDiffWithinAt 𝕜 s x) :
    derivWithin (g₁ ∘ h) s x = derivWithin h s x • derivWithin g₁ t' (h x)


theorem comp_equiv {π : P →+* R} (m : PerfectionMap p π) (x : P) :
    Perfection.coeff R p 0 (m.equiv x) = π x

{p : ℕ}
[Fact (Nat.Prime p)]
{R : Type u₁}
[CommSemiring R]
[CharP R p]
{P : Type u₃}
[CommSemiring P]
[CharP P p]
[PerfectRing P p]
{π : P →+* R}
(m : PerfectionMap p π)
(x : P)

(Perfection.coeff R p 0) (m.equiv x) = π x


private theorem eq_of_le_of_finrank_le'' [FiniteDimensional K L] (h_le : F ≤ E)
    (h_finrank : finrank F L ≤ finrank E L) : F = E

(h_finrank : FiniteDimensional.finrank (↥F) L ≤ FiniteDimensional.finrank (↥E) L)


/-- The topology of uniform convergence indeed gives the same notion of convergence as
`TendstoUniformly`. -/
protected theorem tendsto_iff_tendstoUniformly {F : ι → α →ᵤ β} {f : α →ᵤ β} :
    Tendsto F p (𝓝 f) ↔ TendstoUniformly (toFun ∘ F) (toFun f) p

{α : Type u_1}
{β : Type u_2}
{ι : Type u_4}
{p : Filter ι}
[UniformSpace β]
{F : ι → α →ᵤ β}
{f : α →ᵤ β}

Filter.Tendsto F p (𝓝 f) ↔ TendstoUniformly (⇑UniformFun.toFun ∘ F) (UniformFun.toFun f) p


@[simp]
lemma val_mk {F : Cᵒᵖ ⥤ Type v} (η : F ⟶ A) {X : C} (s : yoneda.obj X ⟶ A) (u : F.obj (op X))
    (h : MakesOverArrow η s u) : val ⟨u, h⟩ = u

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

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

CategoryTheory.OverPresheafAux.OverArrows.val ⟨u, h⟩ = u


theorem one_lt_div_of_neg (hb : b < 0) : 1 < a / b ↔ a < b

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


@[simp] lemma disjoint_univ : Disjoint s univ ↔ s = ∅


@[simp]
theorem length_thinkN (s : Computation α) [_h : Terminates s] (n) :
    length (thinkN s n) = length s + n

{α : Type u}
(s : Computation α)
[_h : s.Terminates]
(n : ℕ)


/-- If one joins a list of lists and then splits the join along the right composition, one gets
back the original list of lists. -/
@[simp]
theorem splitWrtComposition_join (L : List (List α)) (c : Composition L.join.length)
    (h : map length L = c.blocks) : splitWrtComposition (join L) c = L

{α : Type u_1}
(L : List (List α))
(c : Composition L.join.length)
(h : List.map List.length L = c.blocks)


@[simp]
theorem LinearEquiv.dualMap_refl :
    (LinearEquiv.refl R M₁).dualMap = LinearEquiv.refl R (Dual R M₁)

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

(LinearEquiv.refl R M₁).dualMap = LinearEquiv.refl R (Module.Dual R M₁)


/-- Given `K : HomologicalComplex C c'` and `e : c.Embedding c'` (satisfying `[e.IsRelIff]`),
this is the homological complex in `HomologicalComplex C c` obtained by restriction. -/
@[simps]
def restriction : HomologicalComplex C c

∀ (x x_1 : ι), (K.restriction e).d x x_1 = K.d (e.f x) (e.f x_1)


/-- Whisker a bicone with an equivalence between the indexing types. -/
@[simps]
def whisker {f : J → C} (c : Bicone f) (g : K ≃ J) : Bicone (f ∘ g)


theorem mem_range (v : V₂) : v ∈ f.range ↔ ∃ w, f w = v

{V₁ : Type u_3}
{V₂ : Type u_4}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
(f : NormedAddGroupHom V₁ V₂)
(v : V₂)


@[simp]
theorem univ_pi_eq_empty_iff : pi univ t = ∅ ↔ ∃ i, t i = ∅

{ι : Type u_1}
{α : ι → Type u_2}
{t : (i : ι) → Set (α i)}


theorem Perm.union_right {l₁ l₂ : List α} (t₁ : List α) (h : l₁ ~ l₂) : l₁ ∪ t₁ ~ l₂ ∪ t₁

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

l₁ ∪ t₁ ~ l₂ ∪ t₁


protected theorem uniformInducing : UniformInducing ((↑) : Lp.simpleFunc E p μ → Lp E p μ)

{α : Type u_1}
{E : Type u_4}
[MeasurableSpace α]
[NormedAddCommGroup E]
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[Fact (1 ≤ p)]


@[to_additive]
theorem mul_iff_left [CommGroup β] [TopologicalGroup β] (hf : StronglyMeasurable f) :
    StronglyMeasurable (g * f) ↔ StronglyMeasurable g

(hf : MeasureTheory.StronglyMeasurable f)

MeasureTheory.StronglyMeasurable (g * f) ↔ MeasureTheory.StronglyMeasurable g


/-- Euler's infinite product formula for the real sine function. -/
theorem _root_.Real.tendsto_euler_sin_prod (x : ℝ) :
    Tendsto (fun n : ℕ => π * x * ∏ j ∈ Finset.range n, ((1 : ℝ) - x ^ 2 / ((j : ℝ) + 1) ^ 2))
      atTop (𝓝 <| sin (π * x))

Filter.Tendsto (fun n => π * x * ∏ j ∈ Finset.range n, (1 - x ^ 2 / (↑j + 1) ^ 2)) Filter.atTop (𝓝 (Real.sin (π * x)))


/-- The Čech conerve construction, as a functor from `Arrow C`. -/
@[simps]
def cechConerve : Arrow C ⥤ CosimplicialObject C

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

CategoryTheory.CosimplicialObject.cechConerve.obj f = f.cechConerve


@[simp]
theorem cmp_swap [Preorder α] [@DecidableRel α (· < ·)] (a b : α) : (cmp a b).swap = cmp b a

{α : Type u_1}
[Preorder α]
[DecidableRel fun x x_1 => x < x_1]
(a b : α)


theorem bddBelow_Ico : BddBelow (Ico a b)


private theorem someExistsOneDivLT_subset' : someExistsOneDivLT s (i \ j) ⊆ i

{α : Type u_1}
[MeasurableSpace α]
{s : MeasureTheory.SignedMeasure α}
{i j : Set α}

MeasureTheory.SignedMeasure.someExistsOneDivLT s (i \ j) ⊆ i


theorem Basis.repr_sum_self [Fintype ι] (b : Basis ι R M) (c : ι → R) :
    b.repr (∑ i, c i • b i) = c

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Fintype ι]
(b : Basis ι R M)
(c : ι → R)


/-- The functor `Comma L R ⥤ Comma L' R'` induced by three functors `F₁`, `F₂`, `F`
and two natural transformations `F₁ ⋙ L' ⟶ L ⋙ F` and `R ⋙ F ⟶ F₂ ⋙ R'`. -/
@[simps]
def map : Comma L R ⥤ Comma L' R'

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
{A' : Type u_1}
{B' : Type u_2}
{T' : Type u_3}
[CategoryTheory.Category.{u_4, u_1} A']
[CategoryTheory.Category.{u_5, u_2} B']
[CategoryTheory.Category.{u_6, u_3} T']
{L : CategoryTheory.Functor A T}
{R : CategoryTheory.Functor B T}
{L' : CategoryTheory.Functor A' T'}
{R' : CategoryTheory.Functor B' T'}
{F₁ : CategoryTheory.Functor A A'}
{F₂ : CategoryTheory.Functor B B'}
{F : CategoryTheory.Functor T T'}
(α : F₁.comp L' ⟶ L.comp F)
(β : R.comp F ⟶ F₂.comp R')
{X Y : CategoryTheory.Comma L R}
(φ : X ⟶ Y)

((CategoryTheory.Comma.map α β).map φ).left = F₁.map φ.left


/-- Postcomposition of a 1-morphism as a functor from the category of 1-morphisms `b ⟶ c` into the
category of functors `(a ⟶ b) ⥤ (a ⟶ c)`. -/
@[simps]
def postcomposing (a b c : B) : (b ⟶ c) ⥤ (a ⟶ b) ⥤ (a ⟶ c)

{B : Type u}
[CategoryTheory.Bicategory B]
(a b c : B)

∀ {X Y : b ⟶ c} (η : X ⟶ Y) (x : a ⟶ b),
  ((CategoryTheory.Bicategory.postcomposing a b c).map η).app x = CategoryTheory.Bicategory.whiskerLeft x η


@[to_additive (attr := simp)]
theorem MonoidHom.coe_mk [MulOneClass M] [MulOneClass N] (f hmul) :
    (MonoidHom.mk f hmul : M → N) = f

(hmul : ∀ (x y : M), f.toFun (x * y) = f.toFun x * f.toFun y)

⇑{ toOneHom := f, map_mul' := hmul } = ⇑f


@[to_additive (attr := simp)]
theorem coe_coeMulHom [Monoid M] : (coeMulHom l : (α → M) → Germ l M) = ofFun

{α : Type u_1}
{l : Filter α}
{M : Type u_5}
[AddMonoid M]

⇑(Filter.Germ.coeAddHom l) = Filter.Germ.ofFun


@[to_additive]
theorem mulRight_bijective (a : Mˣ) : Function.Bijective ((· * a) : M → M)

{M : Type u_6}
[AddMonoid M]
(a : AddUnits M)


@[simp] theorem ne_compl_self [Nontrivial α] : a ≠ aᶜ

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


@[simp]
theorem smul_apply (f : CuspForm Γ k) (n : α) {z : ℍ} : (n • f) z = n • f z

{Γ : Subgroup SL(2, ℤ)}
{k : ℤ}
{α : Type u_2}
[SMul α ℂ]
[IsScalarTower α ℂ ℂ]
(f : CuspForm Γ k)
(n : α)
{z : ℍ}


theorem le_boundedBy {μ : OuterMeasure α} : μ ≤ boundedBy m ↔ ∀ s, μ s ≤ m s

{α : Type u_1}
{m : Set α → ℝ≥0∞}
{μ : MeasureTheory.OuterMeasure α}

μ ≤ MeasureTheory.OuterMeasure.boundedBy m ↔ ∀ (s : Set α), μ s ≤ m s


theorem integral_sum_measure {ι} {_ : MeasurableSpace α} {f : α → G} {μ : ι → Measure α}
    (hf : Integrable f (Measure.sum μ)) : ∫ a, f a ∂Measure.sum μ = ∑' i, ∫ a, f a ∂μ i

{α : Type u_1}
{G : Type u_5}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{ι : Type u_7}

∀ {x : MeasurableSpace α} {f : α → G} {μ : ι → MeasureTheory.Measure α},
  MeasureTheory.Integrable f (MeasureTheory.Measure.sum μ) →
    ∫ (a : α), f a ∂MeasureTheory.Measure.sum μ = ∑' (i : ι), ∫ (a : α), f a ∂μ i


theorem nadd_lt_nadd_right (h : b < c) (a) : b ♯ a < c ♯ a

{b c : Ordinal.{u}}
(h : b < c)
(a : Ordinal.{u})


@[to_additive]
theorem tprod_dite_left (P : Prop) [Decidable P] (x : β → P → α) :
    ∏' b : β, (if h : P then x b h else 1) = if h : P then ∏' b : β, x b h else 1

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
(P : Prop)
[Decidable P]
(x : β → P → α)

(∑' (b : β), if h : P then x b h else 0) = if h : P then ∑' (b : β), x b h else 0


theorem sup_limZero {f g : CauSeq α abs} (hf : LimZero f) (hg : LimZero g) : LimZero (f ⊔ g)

{α : Type u_1}
[LinearOrderedField α]
{f g : CauSeq α abs}
(hf : f.LimZero)
(hg : g.LimZero)


theorem universally_isLocalAtTarget (P : MorphismProperty Scheme)
    (hP₂ : ∀ {X Y : Scheme.{u}} (f : X ⟶ Y) {ι : Type u} (U : ι → Y.Opens)
      (_ : iSup U = ⊤), (∀ i, P (f ∣_ U i)) → P f) : IsLocalAtTarget P.universally

(P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme)

(hP₂ :
  ∀ {X Y : AlgebraicGeometry.Scheme} (f : X ⟶ Y) {ι : Type u} (U : ι → Y.Opens),
    iSup U = ⊤ → (∀ (i : ι), P (f ∣_ U i)) → P f)


theorem card_fintype_Icc : Fintype.card (Set.Icc a b) = (b + 1 - a).toNat

Fintype.card ↑(Set.Icc a b) = (b + 1 - a).toNat


/-- Right-multiplication by a right-invertible element of a topological monoid is proper, i.e.,
inverse images of compact sets are compact. -/
theorem Filter.tendsto_cocompact_mul_right {a b : M} (ha : a * b = 1) :
    Filter.Tendsto (fun x : M => x * a) (Filter.cocompact M) (Filter.cocompact M)

{M : Type u_3}
[TopologicalSpace M]
[Monoid M]
[ContinuousMul M]
{a b : M}
(ha : a * b = 1)

Filter.Tendsto (fun x => x * a) (Filter.cocompact M) (Filter.cocompact M)


/-- Maximal intersecting families are upper sets. -/
protected theorem Intersecting.isUpperSet (hs : s.Intersecting)
    (h : ∀ t : Set α, t.Intersecting → s ⊆ t → s = t) : IsUpperSet s

(h : ∀ (t : Set α), t.Intersecting → s ⊆ t → s = t)


@[to_additive (attr := simp)]
theorem preimage_mul_right_singleton : (· * a) ⁻¹' {b} = {b * a⁻¹}


protected lemma hasCompactSupport (f : C_c(α, β)) : HasCompactSupport f

{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[Zero β]
(f : α →C_c β)


/-- Given a continuous `R`-multilinear map `f` taking values in `R`, `f.smulRight z` is the
continuous multilinear map sending `m` to `f m • z`. -/
@[simps! toMultilinearMap apply]
def smulRight : ContinuousMultilinearMap R M₁ M₂

{R : Type u}
{ι : Type v}
{M₁ : ι → Type w₁}
{M₂ : Type w₂}
[CommSemiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
[TopologicalSpace R]
[(i : ι) → TopologicalSpace (M₁ i)]
[TopologicalSpace M₂]
[ContinuousSMul R M₂]
(f : ContinuousMultilinearMap R M₁ R)
(z : M₂)

(f.smulRight z).toMultilinearMap = f.smulRight z


/-- The map `(x, y) ↦ (y, xy)` sends the measure `μ × ν` to `ν × μ`. -/
@[to_additive measurePreserving_prod_add_swap_right
" The map `(x, y) ↦ (y, x + y)` sends the measure `μ × ν` to `ν × μ`. "]
theorem measurePreserving_prod_mul_swap_right [IsMulRightInvariant μ] :
    MeasurePreserving (fun z : G × G => (z.2, z.1 * z.2)) (μ.prod ν) (ν.prod μ)

{G : Type u_1}
[MeasurableSpace G]
[Group G]
[MeasurableMul₂ G]
(μ ν : MeasureTheory.Measure G)
[MeasureTheory.SFinite ν]
[MeasureTheory.SFinite μ]
[μ.IsMulRightInvariant]

MeasureTheory.MeasurePreserving (fun z => (z.2, z.1 * z.2)) (μ.prod ν) (ν.prod μ)


theorem isArtinian_of_injective (f : M →ₗ[R] P) (h : Function.Injective f) [IsArtinian R P] :
    IsArtinian R M

{R : Type u_1}
{M : Type u_2}
{P : Type u_3}
[Ring R]
[AddCommGroup M]
[AddCommGroup P]
[Module R M]
[Module R P]
(f : M →ₗ[R] P)
(h : Function.Injective ⇑f)
[IsArtinian R P]


/-- If the multiplicative action of `M` on `α` is faithful,
then `fixedBy α m = Set.univ` implies that `m = 1`. -/
@[to_additive "If the additive action of `M` on `α` is faithful,
then `fixedBy α m = Set.univ` implies that `m = 1`."]
theorem fixedBy_eq_univ_iff_eq_one {m : M} : fixedBy α m = Set.univ ↔ m = 1

{α : Type u_1}
{M : Type u_3}
[Monoid M]
[MulAction M α]
[FaithfulSMul M α]
{m : M}

MulAction.fixedBy α m = Set.univ ↔ m = 1


theorem fg_top (N : Submodule R M) : (⊤ : Submodule R N).FG ↔ N.FG

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(N : Submodule R M)


lemma mappingCone_triangleh_distinguished {X Y : CochainComplex C ℤ} (f : X ⟶ Y) :
    CochainComplex.mappingCone.triangleh f ∈ distTriang (HomotopyCategory _ _)

CochainComplex.mappingCone.triangleh f ∈ CategoryTheory.Pretriangulated.distinguishedTriangles


/-- The composition of a continuous function of two variables and two ae strongly measurable
functions is ae strongly measurable. -/
theorem _root_.Continuous.comp_aestronglyMeasurable₂
    {β' : Type*} [TopologicalSpace β']
    {g : β → β' → γ} {f : α → β} {f' : α → β'} (hg : Continuous g.uncurry)
    (hf : AEStronglyMeasurable f μ) (h'f : AEStronglyMeasurable f' μ) :
    AEStronglyMeasurable (fun x => g (f x) (f' x)) μ

{g : β → β' → γ}

(hf : MeasureTheory.AEStronglyMeasurable f μ)

(h'f : MeasureTheory.AEStronglyMeasurable f' μ)

MeasureTheory.AEStronglyMeasurable (fun x => g (f x) (f' x)) μ


theorem inits_reverse (l : List α) : inits (reverse l) = reverse (map reverse l.tails)

l.reverse.inits = (List.map List.reverse l.tails).reverse


protected theorem uniformInducing (hf : AntilipschitzWith K f) (hfc : UniformContinuous f) :
    UniformInducing f

{α : Type u_1}
{β : Type u_2}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{K : ℝ≥0}
{f : α → β}
(hf : AntilipschitzWith K f)
(hfc : UniformContinuous f)


@[to_additive]
theorem integral_inv_eq_self (f : G → E) (μ : Measure G) [IsInvInvariant μ] :
    ∫ x, f x⁻¹ ∂μ = ∫ x, f x ∂μ

{G : Type u_4}
{E : Type u_5}
[MeasurableSpace G]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[AddGroup G]
[MeasurableNeg G]
(f : G → E)
(μ : MeasureTheory.Measure G)
[μ.IsNegInvariant]

∫ (x : G), f (-x) ∂μ = ∫ (x : G), f x ∂μ


@[to_additive]
theorem rank_closure_finset_le_card (s : Finset G) : Group.rank (closure (s : Set G)) ≤ s.card

Group.rank ↥(Subgroup.closure ↑s) ≤ s.card


@[rclike_simps, norm_cast]
theorem ofReal_neg (r : ℝ) : ((-r : ℝ) : K) = -r


@[simp]
theorem mem_eraseNone {s : Finset (Option α)} {x : α} : x ∈ eraseNone s ↔ some x ∈ s

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


theorem coordChange_coordChange (e₁ e₂ e₃ : Trivialization F proj) {b : B} (h₁ : b ∈ e₁.baseSet)
    (h₂ : b ∈ e₂.baseSet) (x : F) :
    e₂.coordChange e₃ b (e₁.coordChange e₂ b x) = e₁.coordChange e₃ b x

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
{proj : Z → B}
[TopologicalSpace Z]
(e₁ e₂ e₃ : Trivialization F proj)
{b : B}
(h₁ : b ∈ e₁.baseSet)
(h₂ : b ∈ e₂.baseSet)
(x : F)


theorem prodXSubSMul.monic (x : R) : (prodXSubSMul G R x).Monic

(G : Type u_2)
[Group G]
[Fintype G]
(R : Type u_3)
[CommRing R]
[MulSemiringAction G R]
(x : R)


theorem lowerBounds_mono_set ⦃s t : Set α⦄ (hst : s ⊆ t) : lowerBounds t ⊆ lowerBounds s

{α : Type u}
[Preorder α]
⦃s t : Set α⦄
(hst : s ⊆ t)


protected theorem IsMin.eq_of_ge (ha : IsMin a) (h : b ≤ a) : a = b

{α : Type u_1}
[PartialOrder α]
{a b : α}
(ha : IsMin a)
(h : b ≤ a)


/-- To construct a morphism of costructured arrows,
we need a morphism of the objects underlying the source,
and to check that the triangle commutes.
-/
@[simps!]
def homMk {f f' : CostructuredArrow S T} (g : f.left ⟶ f'.left)
    (w : S.map g ≫ f'.hom = f.hom := by aesop_cat) : f ⟶ f'

{f f' : CategoryTheory.CostructuredArrow S T}

(w : CategoryTheory.CategoryStruct.comp (S.map g) f'.hom = f.hom := by aesop_cat)


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

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


/-- If `s` is a finite subset of `I`, then the good products span. -/
theorem GoodProducts.spanFin : ⊤ ≤ Submodule.span ℤ (Set.range (eval (π C (· ∈ s))))

{I : Type u}
[LinearOrder I]
[IsWellOrder I fun x x_1 => x < x_1]
(C : Set (I → Bool))
(s : Finset I)

⊤ ≤
  Submodule.span ℤ (Set.range (Profinite.NobelingProof.GoodProducts.eval (Profinite.NobelingProof.π C fun x => x ∈ s)))


/-- Constructor for sections of a presheaf of modules. -/
@[simps]
def sectionsMk {M : PresheafOfModules.{v} R} (s : ∀ X, M.obj X)
    (hs : ∀ ⦃X Y : Cᵒᵖ⦄ (f : X ⟶ Y), M.map f (s X) = s Y) : M.sections

(hs : ∀ ⦃X Y : Cᵒᵖ⦄ (f : X ⟶ Y), (M.map f) (s X) = s Y)

↑(PresheafOfModules.sectionsMk s hs) X = s X


/-- Angle at center of a circle equals twice angle at circumference, oriented vector angle
form with radius specified. -/
theorem oangle_eq_two_zsmul_oangle_sub_of_norm_eq_real {x y z : V} (hxyne : x ≠ y) (hxzne : x ≠ z)
    {r : ℝ} (hx : ‖x‖ = r) (hy : ‖y‖ = r) (hz : ‖z‖ = r) :
    o.oangle y z = (2 : ℤ) • o.oangle (y - x) (z - x)

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

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


@[simp]
theorem diagonal_apply {α ι} [Nonempty ι] (x : α) : Line.diagonal α ι x = fun _ => x

{α : Type u_5}
{ι : Type u_6}
[Nonempty ι]
(x : α)

(fun x i => ((Combinatorics.Line.diagonal α ι).idxFun i).getD x) x = fun x_1 => x


theorem LinearIndependent.to_subtype_range' {ι} {f : ι → M} (hf : LinearIndependent R f) {t}
    (ht : range f = t) : LinearIndependent R ((↑) : t → M)

{R : Type u_2}
{M : Type u_4}
[Ring R]
[AddCommGroup M]
[Module R M]
{ι : Type u_8}
{f : ι → M}
(hf : LinearIndependent R f)
{t : Set M}
(ht : Set.range f = t)

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


/-- The exponent of finite product of monoids is the `Finset.lcm` of the exponents of the
constituent monoids. -/
@[to_additive "The exponent of finite product of additive monoids is the `Finset.lcm` of the
exponents of the constituent additive monoids."]
theorem Monoid.exponent_pi {ι : Type*} [Fintype ι] {M : ι → Type*} [∀ i, Monoid (M i)] :
    exponent ((i : ι) → M i) = lcm univ (exponent <| M ·)

{ι : Type u_1}
[Fintype ι]
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]

Monoid.exponent ((i : ι) → M i) = Finset.univ.lcm fun x => Monoid.exponent (M x)


/-- Given `Finite α`, `linearEquivFunOnFinite R` is the natural `R`-linear equivalence between
`α →₀ β` and `α → β`. -/
@[simps apply]
noncomputable def linearEquivFunOnFinite : (α →₀ M) ≃ₗ[R] α → M

(R : Type u_1)
(M : Type u_3)
(α : Type u_4)
[Finite α]
[AddCommMonoid M]
[Semiring R]
[Module R M]

∀ (a : α →₀ M) (a_1 : α), (Finsupp.linearEquivFunOnFinite R M α) a a_1 = a a_1


lemma Preadditive.epi_iff_surjective {X Y : C} (f : X ⟶ Y) :
    Epi f ↔ Function.Surjective ((forget₂ C Ab).map f)

CategoryTheory.Epi f ↔ Function.Surjective ⇑((CategoryTheory.forget₂ C Ab).map f)


theorem add_mul_right_right_iff : IsRelPrime x (y + z * x) ↔ IsRelPrime x y


theorem descPochhammer_succ_right (n : ℕ) :
    descPochhammer R (n + 1) = descPochhammer R n * (X - (n : R[X]))

descPochhammer R (n + 1) = descPochhammer R n * (Polynomial.X - ↑n)


lemma toNat_injective : Injective (castNum : Num → ℕ)


theorem sameRay_iff_norm_smul_eq : SameRay ℝ x y ↔ ‖x‖ • y = ‖y‖ • x

{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{x y : F}


@[simp]
theorem coe_copy (S : StarSubalgebra R A) (s : Set A) (hs : s = ↑S) : (S.copy s hs : Set A) = s

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[StarRing A]
[Algebra R A]
[StarModule R A]
(S : StarSubalgebra R A)
(s : Set A)
(hs : s = ↑S)


private lemma natDegree_coeff_ΨSq_ofNat (n : ℕ) :
    (W.ΨSq n).natDegree ≤ n ^ 2 - 1 ∧ (W.ΨSq n).coeff (n ^ 2 - 1) = (n ^ 2 : ℤ)

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
(n : ℕ)

(W.ΨSq ↑n).natDegree ≤ n ^ 2 - 1 ∧ (W.ΨSq ↑n).coeff (n ^ 2 - 1) = ↑(↑n ^ 2)


theorem get_cons_addChar (c : Char) (cs : List Char) (i : Pos) :
    get ⟨c :: cs⟩ (i + c) = get ⟨cs⟩ i

(c : Char)
(cs : List Char)
(i : String.Pos)

{ data := c :: cs }.get (i + c) = { data := cs }.get i


@[to_additive smul_right_surj_of_divisibleBy]
theorem pow_left_surj_of_rootableBy [RootableBy A α] {n : α} (hn : n ≠ 0) :
    Function.Surjective (fun a => a ^ n : A → A)

(A : Type u_1)
(α : Type u_2)
[Monoid A]
[Pow A α]
[Zero α]
[RootableBy A α]
{n : α}
(hn : n ≠ 0)


theorem Filter.tendsto_nhds_max_right {l : Filter β} {a : α} (h : Tendsto f l (𝓝[>] a)) :
    Tendsto (fun i => max a (f i)) l (𝓝[>] a)

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[LinearOrder α]
[OrderClosedTopology α]
{f : β → α}
{l : Filter β}
{a : α}
(h : Filter.Tendsto f l (𝓝[>] a))

Filter.Tendsto (fun i => max a (f i)) l (𝓝[>] a)


@[simp]
theorem span_univ : lieSpan R L (Set.univ : Set L) = ⊤

(R : Type u)
(L : Type v)
[CommRing R]
[LieRing L]
[LieAlgebra R L]


theorem Basis.basis_subset (hI : M.Basis I X) (hIY : I ⊆ Y) (hYX : Y ⊆ X) : M.Basis I Y

{α : Type u_1}
{M : Matroid α}
{I X Y : Set α}
(hI : M.Basis I X)
(hIY : I ⊆ Y)
(hYX : Y ⊆ X)


theorem choose_succ_right_eq (n k : ℕ) : choose n (k + 1) * (k + 1) = choose n k * (n - k)

n.choose (k + 1) * (k + 1) = n.choose k * (n - k)


@[simp]
theorem colimitPresheafObjIsoComponentwiseLimit_hom_π (F : J ⥤ PresheafedSpace.{_, _, v} C)
    (U : Opens (Limits.colimit F).carrier) (j : J) :
    (colimitPresheafObjIsoComponentwiseLimit F U).hom ≫ limit.π _ (op j) =
      (colimit.ι F j).c.app (op U)

[∀ (X : TopCat), CategoryTheory.Limits.HasLimitsOfShape Jᵒᵖ (TopCat.Presheaf C X)]

(F : J ⥤ AlgebraicGeometry.PresheafedSpace C)

(U : TopologicalSpace.Opens ↑↑(CategoryTheory.Limits.colimit F))

(AlgebraicGeometry.PresheafedSpace.colimitPresheafObjIsoComponentwiseLimit F U).hom ≫
    CategoryTheory.Limits.limit.π (AlgebraicGeometry.PresheafedSpace.componentwiseDiagram F U) (Opposite.op j) =
  (CategoryTheory.Limits.colimit.ι F j).c.app (Opposite.op U)


theorem dvd_choose_pow (hp : Prime p) (hk : k ≠ 0) (hkp : k ≠ p ^ n) : p ∣ (p ^ n).choose k

{p n k : ℕ}
(hp : Nat.Prime p)
(hk : k ≠ 0)
(hkp : k ≠ p ^ n)


lemma Pi.map_comp_map' {f g : α → C} {h : β → C} [HasProduct f] [HasProduct g] [HasProduct h]
    (p : β → α) (q : ∀ (a : α), f a ⟶ g a) (q' : ∀ (b : β), g (p b) ⟶ h b) :
    Pi.map q ≫ Pi.map' p q' = Pi.map' p (fun b => q (p b) ≫ q' b)

{β : Type w}
{α : Type w₂}
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{f g : α → C}
{h : β → C}
[CategoryTheory.Limits.HasProduct f]
[CategoryTheory.Limits.HasProduct g]
[CategoryTheory.Limits.HasProduct h]
(p : β → α)
(q : (a : α) → f a ⟶ g a)
(q' : (b : β) → g (p b) ⟶ h b)

CategoryTheory.Limits.Pi.map q ≫ CategoryTheory.Limits.Pi.map' p q' =
  CategoryTheory.Limits.Pi.map' p fun b => q (p b) ≫ q' b


theorem map_op_pow (n : ℕ) :
    map (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ) : A →ₗ[R] Aᵐᵒᵖ) (M ^ n) =
      map (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ) : A →ₗ[R] Aᵐᵒᵖ) M ^ n

{R : Type u}
[CommSemiring R]
{A : Type v}
[Semiring A]
[Algebra R A]
(M : Submodule R A)
(n : ℕ)

Submodule.map (↑(MulOpposite.opLinearEquiv R)) (M ^ n) = Submodule.map (↑(MulOpposite.opLinearEquiv R)) M ^ n


theorem cos_add_cos : cos x + cos y = 2 * cos ((x + y) / 2) * cos ((x - y) / 2)

Complex.cos x + Complex.cos y = 2 * Complex.cos ((x + y) / 2) * Complex.cos ((x - y) / 2)


/-- In a `GroupWithZero` `α`, the unit group `αˣ` is equivalent to the subtype of nonzero
elements. -/
@[simps] def unitsEquivNeZero [GroupWithZero α] : αˣ ≃ {a : α // a ≠ 0}

{α : Type u_1}
[GroupWithZero α]
(a : { a // a ≠ 0 })

unitsEquivNeZero.symm a = Units.mk0 ↑a ⋯


theorem ceil_le_floor_add_one (a : α) : ⌈a⌉ ≤ ⌊a⌋ + 1

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(a : α)

⌈a⌉ ≤ ⌊a⌋ + 1


@[to_additive IsAddUnit.exists_neg']
lemma IsUnit.exists_left_inv {a : M} (h : IsUnit a) : ∃ b, b * a = 1

{M : Type u_1}
[AddMonoid M]
{a : M}
(h : IsAddUnit a)


@[to_additive]
theorem mulSupport_disjoint_iff {f : α → M} {s : Set α} :
    Disjoint (mulSupport f) s ↔ EqOn f 1 s

{α : Type u_1}
{M : Type u_5}
[One M]
{f : α → M}
{s : Set α}

Disjoint (Function.mulSupport f) s ↔ Set.EqOn f 1 s


/-- **Fundamental theorem of calculus-1**, local version for any measure.

Let filters `l` and `l'` be related by `[intervalIntegral.FTCFilter a l l']`; let `μ` be a locally
finite measure.  If `f` has a finite limit `c` at `l' ⊓ ae μ`, then
`∫ x in u..v, f x ∂μ = -μ (Set.Ioc v u) • c + o(μ(Set.Ioc v u))` as both `u` and `v` tend to `l`.

See also `measure_integral_sub_linear_isLittleO_of_tendsto_ae_of_ge'` for a version that also works,
e.g., for `l = l' = Filter.atTop`. -/
theorem measure_integral_sub_linear_isLittleO_of_tendsto_ae_of_ge
    (hfm : StronglyMeasurableAtFilter f l' μ) (hf : Tendsto f (l' ⊓ ae μ) (𝓝 c))
    (hu : Tendsto u lt l) (hv : Tendsto v lt l) (huv : v ≤ᶠ[lt] u) :
    (fun t => (∫ x in u t..v t, f x ∂μ) + (μ (Ioc (v t) (u t))).toReal • c) =o[lt] fun t =>
      (μ <| Ioc (v t) (u t)).toReal

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

(fun t => ∫ (x : ℝ) in u t..v t, f x ∂μ + (μ (Set.Ioc (v t) (u t))).toReal • c) =o[lt] fun t =>
  (μ (Set.Ioc (v t) (u t))).toReal


/-- Shows that the `n`th denominator is greater than or equal to the `n + 1`th fibonacci number,
that is `Nat.fib (n + 1) ≤ Bₙ`. -/
theorem succ_nth_fib_le_of_nth_den (hyp : n = 0 ∨ ¬(of v).TerminatedAt (n - 1)) :
    (fib (n + 1) : K) ≤ (of v).dens n

(hyp : n = 0 ∨ ¬(GenContFract.of v).TerminatedAt (n - 1))

↑(Nat.fib (n + 1)) ≤ (GenContFract.of v).dens n


theorem iterate_add (f : α → α) (a : α) (m n : ℕ) :
    iterate f a (m + n) = iterate f a m ++ iterate f (f^[m] a) n

{α : Type u_1}
(f : α → α)
(a : α)
(m n : ℕ)

List.iterate f a (m + n) = List.iterate f a m ++ List.iterate f (f^[m] a) n


theorem mex_not_mem_range {ι : Type u} (f : ι → Ordinal.{max u v}) : mex.{_, v} f ∉ Set.range f


theorem effectiveEpiFamily_tfae
    {α : Type} [Finite α] {B : Profinite.{u}}
    (X : α → Profinite.{u}) (π : (a : α) → (X a ⟶ B)) :
    TFAE
    [ EffectiveEpiFamily X π
    , Epi (Sigma.desc π)
    , ∀ b : B, ∃ (a : α) (x : X a), π a x = b
    ]

{α : Type}
[Finite α]
{B : Profinite}
(X : α → Profinite)
(π : (a : α) → X a ⟶ B)

[CategoryTheory.EffectiveEpiFamily X π, CategoryTheory.Epi (CategoryTheory.Limits.Sigma.desc π),
    ∀ (b : ↑B.toTop), ∃ a x, (π a) x = b].TFAE


theorem HD_below_aux2 {f : Cb X Y} (C : ℝ) {y : Y} :
    BddBelow (range fun x : X => f (inl x, inr y) + C)

{X : Type u}
{Y : Type v}
[MetricSpace X]
[MetricSpace Y]
{f : GromovHausdorff.Cb X Y}
(C : ℝ)
{y : Y}

BddBelow (Set.range fun x => f (Sum.inl x, Sum.inr y) + C)


@[simp]
lemma ofHom_homOf_eq_self (z : Cocycle F G 0) : ofHom (homOf z) = z

(z : CochainComplex.HomComplex.Cocycle F G 0)

CochainComplex.HomComplex.Cocycle.ofHom z.homOf = z


theorem range_nth_subset : Set.range (nth p) ⊆ insert 0 (setOf p)

Set.range (Nat.nth p) ⊆ insert 0 (setOf p)


theorem le_suffixLevenshtein_cons_minimum (xs : List α) (y ys) :
    (suffixLevenshtein C xs ys).1.minimum ≤ (suffixLevenshtein C xs (y :: ys)).1.minimum

(↑(suffixLevenshtein C xs ys)).minimum ≤ (↑(suffixLevenshtein C xs (y :: ys))).minimum


/-- The double opposite category is equivalent to the original. -/
@[simps]
def opOpEquivalence : Cᵒᵖᵒᵖ ≌ C

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

(CategoryTheory.opOpEquivalence C).functor = CategoryTheory.unopUnop C


/-- Over the ring `ZMod (p^(n+1))`, we produce the `n+1`st Witt polynomial
by expanding the `n`th Witt polynomial by `p`. -/
@[simp]
theorem wittPolynomial_zmod_self (n : ℕ) :
    W_ (ZMod (p ^ (n + 1))) (n + 1) = expand p (W_ (ZMod (p ^ (n + 1))) n)

W_ (ZMod (p ^ (n + 1))) (n + 1) = (MvPolynomial.expand p) (W_ (ZMod (p ^ (n + 1))) n)


@[simp]
theorem cycleRange_self {n : ℕ} (i : Fin n.succ) : cycleRange i i = 0


@[simp] theorem toList_replace [BEq α] (a : α) (b : β) (l : AssocList α β) :
    (replace a b l).toList =
    l.toList.replaceF (bif ·.1 == a then some (a, b) else none)

{α : Type u_1}
{β : Type u_2}
[BEq α]
(a : α)
(b : β)
(l : Batteries.AssocList α β)

(Batteries.AssocList.replace a b l).toList = List.replaceF (fun x => bif x.fst == a then some (a, b) else none) l.toList


theorem map_le_lfp {a : α} (ha : a ≤ lfp f) : f a ≤ lfp f

{α : Type u}
[CompleteLattice α]
(f : α →o α)
{a : α}
(ha : a ≤ OrderHom.lfp f)


/-- The following statements are equivalent:

0. `s` is a neighborhood of `b` within `(-∞, b)`
1. `s` is a neighborhood of `b` within `[a, b)`
2. `s` is a neighborhood of `b` within `(a, b)`
3. `s` includes `(l, b)` for some `l ∈ [a, b)`
4. `s` includes `(l, b)` for some `l < b` -/
theorem TFAE_mem_nhdsWithin_Iio {a b : α} (h : a < b) (s : Set α) :
    TFAE [s ∈ 𝓝[<] b,-- 0 : `s` is a neighborhood of `b` within `(-∞, b)`
        s ∈ 𝓝[Ico a b] b,-- 1 : `s` is a neighborhood of `b` within `[a, b)`
        s ∈ 𝓝[Ioo a b] b,-- 2 : `s` is a neighborhood of `b` within `(a, b)`
        ∃ l ∈ Ico a b, Ioo l b ⊆ s,-- 3 : `s` includes `(l, b)` for some `l ∈ [a, b)`
        ∃ l ∈ Iio b, Ioo l b ⊆ s]

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{a b : α}
(h : a < b)
(s : Set α)

[s ∈ 𝓝[<] b, s ∈ 𝓝[Set.Ico a b] b, s ∈ 𝓝[Set.Ioo a b] b, ∃ l ∈ Set.Ico a b, Set.Ioo l b ⊆ s,
    ∃ l ∈ Set.Iio b, Set.Ioo l b ⊆ s].TFAE


@[simp]
lemma decompose_algebraMap (r : R) :
    decompose 𝒜 (algebraMap R A r) = algebraMap R (⨁ i, 𝒜 i) r

{ι : Type u_1}
{R : Type u_2}
{A : Type u_3}
[DecidableEq ι]
[AddMonoid ι]
[CommSemiring R]
[Semiring A]
[Algebra R A]
(𝒜 : ι → Submodule R A)
[GradedAlgebra 𝒜]
(r : R)

(DirectSum.decompose 𝒜) ((algebraMap R A) r) = (algebraMap R (⨁ (i : ι), ↥(𝒜 i))) r


theorem ofScientific_nonneg (m : ℕ) (s : Bool) (e : ℕ) :
    0 ≤ Rat.ofScientific m s e


@[simp]
theorem neg_mul (a b : α) : -a * b = -(a * b)

{α : Type u}
[Mul α]
[HasDistribNeg α]
(a b : α)


@[simp]
theorem vanishingIdeal_singleton (x : ProjectiveSpectrum 𝒜) :
    vanishingIdeal ({x} : Set (ProjectiveSpectrum 𝒜)) = x.asHomogeneousIdeal

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

ProjectiveSpectrum.vanishingIdeal {x} = x.asHomogeneousIdeal


@[to_additive (attr := simp)]
theorem compl₂_apply [MulOneClass M] [MulOneClass N] [CommMonoid P] [MulOneClass Q]
    (f : M →* N →* P) (g : Q →* N) (m : M) (q : Q) : (compl₂ f g) m q = f m (g q)

{M : Type uM}
{N : Type uN}
{P : Type uP}
{Q : Type uQ}
[MulOneClass M]
[MulOneClass N]
[CommMonoid P]
[MulOneClass Q]
(f : M →* N →* P)
(g : Q →* N)
(m : M)
(q : Q)


theorem Ioc_pred_right_of_not_isMin (ha : ¬IsMin b) : Ioc a (pred b) = Ioo a b

{α : Type u_1}
[Preorder α]
[PredOrder α]
{a b : α}
(ha : ¬IsMin b)


theorem prod_nnnorm_eq_of_L2 (x : WithLp 2 (α × β)) :
    ‖x‖₊ = NNReal.sqrt (‖x.fst‖₊ ^ 2 + ‖x.snd‖₊ ^ 2)

{α : Type u_2}
{β : Type u_3}
[SeminormedAddCommGroup α]
[SeminormedAddCommGroup β]
(x : WithLp 2 (α × β))

‖x‖₊ = NNReal.sqrt (‖x.1‖₊ ^ 2 + ‖x.2‖₊ ^ 2)


@[to_additive]
theorem mul_subset_iff : s * t ⊆ u ↔ ∀ x ∈ s, ∀ y ∈ t, x * y ∈ u

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


theorem finrank_le_card [Fintype G] : finrank (subfield G F) F ≤ Fintype.card G

(G : Type u)
[Group G]
(F : Type v)
[Field F]
[MulSemiringAction G F]
[Fintype G]

FiniteDimensional.finrank (↥(FixedPoints.subfield G F)) F ≤ Fintype.card G


@[simp, reassoc]
theorem limitIsoLimitCurryCompLim_inv_π {j} {k} :
    (limitIsoLimitCurryCompLim G).inv ≫ limit.π _ (j, k) =
      (limit.π _ j ≫ limit.π _ k : limit (_ ⋙ lim) ⟶ _)

[CategoryTheory.Limits.HasLimit (CategoryTheory.curry.obj G ⋙ CategoryTheory.Limits.lim)]

(CategoryTheory.Limits.limitIsoLimitCurryCompLim G).inv ≫ CategoryTheory.Limits.limit.π G (j, k) =
  CategoryTheory.Limits.limit.π (CategoryTheory.curry.obj G ⋙ CategoryTheory.Limits.lim) j ≫
    CategoryTheory.Limits.limit.π ((CategoryTheory.curry.obj G).obj j) k


theorem nthRoots_nodup {ζ : R} {n : ℕ} (h : IsPrimitiveRoot ζ n) {a : R} (ha : a ≠ 0) :
    (nthRoots n a).Nodup

{R : Type u_4}
[CommRing R]
[IsDomain R]
{ζ : R}
{n : ℕ}
(h : IsPrimitiveRoot ζ n)
{a : R}
(ha : a ≠ 0)


/-- The functor sending `X : C` to the constant functor `J ⥤ C` sending everything to `X`.
-/
@[simps]
def const : C ⥤ J ⥤ C

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

∀ (x : J), ((CategoryTheory.Functor.const J).obj X).obj x = X


@[simp] lemma isAtom_compl : IsAtom aᶜ ↔ IsCoatom a

{α : Type u_2}
[BooleanAlgebra α]
{a : α}


theorem _root_.Real.hasPDF_iff : HasPDF X ℙ ↔ AEMeasurable X ℙ ∧ map X ℙ ≪ volume

{Ω : Type u_1}
{m : MeasurableSpace Ω}
{ℙ : MeasureTheory.Measure Ω}
[MeasureTheory.IsFiniteMeasure ℙ]
{X : Ω → ℝ}

MeasureTheory.HasPDF X ℙ MeasureTheory.volume ↔ AEMeasurable X ℙ ∧ MeasureTheory.Measure.map X ℙ ≪ MeasureTheory.volume


/-- The isomorphism of short complexes `S.map F ≅ S.map G` induced by
a natural isomorphism `F ≅ G`. -/
@[simps]
def mapNatIso {F G : C ⥤ D} [F.PreservesZeroMorphisms] [G.PreservesZeroMorphisms] (τ : F ≅ G) :
    S.map F ≅ S.map G

(S.mapNatIso τ).inv = S.mapNatTrans τ.inv


theorem id_apply (x : A) : ContinuousAlgHom.id R A x = x

(R : Type u_1)
[CommSemiring R]
(A : Type u_2)
[Semiring A]
[TopologicalSpace A]
[Algebra R A]
(x : A)


/-- `c.toUnder` is a lift of `c` under the forgetful functor. -/
@[simps!]
def Cone.mapConeToUnder {F : J ⥤ C} (c : Cone F) : (Under.forget c.pt).mapCone c.toUnder ≅ c

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

c.mapConeToUnder.inv.hom = CategoryTheory.CategoryStruct.id c.pt


theorem Ideal.homogeneousCore_eq_sSup :
    I.homogeneousCore 𝒜 = sSup { J : HomogeneousIdeal 𝒜 | J.toIdeal ≤ I }

{ι : Type u_1}
{σ : Type u_2}
{A : Type u_4}
[Semiring A]
[DecidableEq ι]
[AddMonoid ι]
[SetLike σ A]
[AddSubmonoidClass σ A]
(𝒜 : ι → σ)
[GradedRing 𝒜]
(I : Ideal A)

Ideal.homogeneousCore 𝒜 I = sSup {J | J.toIdeal ≤ I}


lemma IsInvertedBy.iff_map_le_isomorphisms (W : MorphismProperty C) (F : C ⥤ D) :
    W.IsInvertedBy F ↔ W.map F ≤ isomorphisms D

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{D : Type u'}
[CategoryTheory.Category.{v', u'} D]
(W : CategoryTheory.MorphismProperty C)
(F : CategoryTheory.Functor C D)

W.IsInvertedBy F ↔ W.map F ≤ CategoryTheory.MorphismProperty.isomorphisms D


@[simp]
theorem isoWhiskerRight_inv {G H : C ⥤ D} (α : G ≅ H) (F : D ⥤ E) :
    (isoWhiskerRight α F).inv = whiskerRight α.inv F

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

(CategoryTheory.isoWhiskerRight α F).inv = CategoryTheory.whiskerRight α.inv F


theorem List.untrop_prod [AddMonoid R] (l : List (Tropical R)) :
    untrop l.prod = List.sum (l.map untrop)

{R : Type u_1}
[AddMonoid R]
(l : List (Tropical R))

Tropical.untrop l.prod = (List.map Tropical.untrop l).sum


theorem dist.triangle_inequality (n m k : ℕ) : dist n k ≤ dist n m + dist m k


@[to_additive]
theorem le_div_comm : a ≤ b / c ↔ c ≤ b / a

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


theorem mk_preimage_of_injective_lift {α : Type u} {β : Type v} (f : α → β) (s : Set β)
    (h : Injective f) : lift.{v} #(f ⁻¹' s) ≤ lift.{u} #s

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

Cardinal.lift.{v, u} (Cardinal.mk ↑(f ⁻¹' s)) ≤ Cardinal.lift.{u, v} (Cardinal.mk ↑s)


@[simp]
theorem eraseLead_C (r : R) : eraseLead (C r) = 0


/-- The associator for tensor, `(X ⊗ Y) ⊗ Z ≅ X ⊗ (Y ⊗ Z)` in `Dial C`. -/
@[simps!]
def associator (X Y Z : Dial C) : tensorObj (tensorObj X Y) Z ≅ tensorObj X (tensorObj Y Z)

(X.associator Y Z).hom.F =
  CategoryTheory.Limits.prod.lift
    (CategoryTheory.Limits.prod.lift
      (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd CategoryTheory.Limits.prod.fst)
      (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd
        (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd CategoryTheory.Limits.prod.fst)))
    (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd
      (CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd CategoryTheory.Limits.prod.snd))


@[simp]
theorem attach_eq_empty_iff {s : Finset α} : s.attach = ∅ ↔ s = ∅


@[simp]
theorem cross_self (v : Fin 3 → R) : v ×₃ v = 0

{R : Type u_1}
[CommRing R]
(v : Fin 3 → R)


theorem coe_zsmul {n : ℤ} {x : 𝕜} : (↑(n • x) : AddCircle p) = n • (x : AddCircle p)

{𝕜 : Type u_1}
[LinearOrderedAddCommGroup 𝕜]
(p : 𝕜)
{n : ℤ}
{x : 𝕜}


/-- See also the strictly more general `initial_of_initial_comp` below. -/
theorem initial_of_equivalence_comp [IsEquivalence F] [Initial (F ⋙ G)] : Initial G

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


/-- Vector is determined by the underlying list. -/
protected theorem eq {n : ℕ} : ∀ a1 a2 : Vector α n, toList a1 = toList a2 → a1 = a2

{α : Type u}
{n : ℕ}
(a1 a2 : Mathlib.Vector α n)


@[measurability]
theorem measurable_ofReal : Measurable ENNReal.ofReal


/-- Expressing `HasFDerivWithinAt f f' s x` in terms of `HasDerivWithinAt` -/
theorem hasFDerivWithinAt_iff_hasDerivWithinAt {f' : 𝕜 →L[𝕜] F} :
    HasFDerivWithinAt f f' s x ↔ HasDerivWithinAt f (f' 1) s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{x : 𝕜}
{s : Set 𝕜}
{f' : 𝕜 →L[𝕜] F}


@[to_additive]
theorem closedBall_one_mul_singleton : closedBall 1 δ * {x} = closedBall x δ

{E : Type u_1}
[SeminormedCommGroup E]
(δ : ℝ)
(x : E)

Metric.closedBall 1 δ * {x} = Metric.closedBall x δ


theorem length_take_le (n) (l : List α) : length (take n l) ≤ n


@[simp]
theorem emptySum_apply_inr [IsEmpty α] (b : β) : emptySum α β (Sum.inr b) = b

{α : Type u_1}
{β : Type u_2}
[IsEmpty α]
(b : β)


@[simp]
theorem disjoint_ndinsert_left {a : α} {s t : Multiset α} :
    Disjoint (ndinsert a s) t ↔ a ∉ t ∧ Disjoint s t

{α : Type u_1}
[DecidableEq α]
{a : α}
{s t : Multiset α}

(Multiset.ndinsert a s).Disjoint t ↔ a ∉ t ∧ s.Disjoint t


@[reassoc]
lemma p_comm_f {P Q : Karoubi (Karoubi C)} (f : P ⟶ Q) : P.p.f ≫ f.f.f = f.f.f ≫ Q.p.f

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

CategoryTheory.CategoryStruct.comp P.p.f f.f.f = CategoryTheory.CategoryStruct.comp f.f.f Q.p.f


private theorem sSup_aux (c : Set (E →ₗ.[R] F)) (hc : DirectedOn (· ≤ ·) c) :
    ∃ f : ↥(sSup (domain '' c)) →ₗ[R] F, (⟨_, f⟩ : E →ₗ.[R] F) ∈ upperBounds c

(hc : DirectedOn (fun x x_1 => x ≤ x_1) c)

∃ f, { domain := sSup (LinearPMap.domain '' c), toFun := f } ∈ upperBounds c


theorem next_cons_concat (y : α) (hy : x ≠ y) (hx : x ∉ l)
    (h : x ∈ y :: l ++ [x] := mem_append_right _ (mem_singleton_self x)) :
    next (y :: l ++ [x]) x h = y

{α : Type u_1}
[DecidableEq α]
(l : List α)
(x y : α)
(hy : x ≠ y)
(hx : x ∉ l)
(h : x ∈ y :: l ++ [x] := ⋯)


@[simp] lemma mem_primeFactors : p ∈ n.primeFactors ↔ p.Prime ∧ p ∣ n ∧ n ≠ 0

p ∈ n.primeFactors ↔ Nat.Prime p ∧ p ∣ n ∧ n ≠ 0


protected theorem injective : Function.Injective (algebraMap R K)

(R : Type u_1)
[CommRing R]
(K : Type u_5)
[CommRing K]
[Algebra R K]
[IsFractionRing R K]


lemma mem_mk' (carrier : Set R)
    (zero_mem : 0 ∈ carrier)
    (add_mem : ∀ {x y}, x ∈ carrier → y ∈ carrier → x + y ∈ carrier)
    (neg_mem : ∀ {x}, x ∈ carrier → -x ∈ carrier)
    (mul_mem_left : ∀ {x y}, y ∈ carrier → x * y ∈ carrier)
    (mul_mem_right : ∀ {x y}, x ∈ carrier → x * y ∈ carrier)
    (x : R) :
    x ∈ mk' carrier zero_mem add_mem neg_mem mul_mem_left mul_mem_right ↔ x ∈ carrier

(add_mem : ∀ {x y : R}, x ∈ carrier → y ∈ carrier → x + y ∈ carrier)

(neg_mem : ∀ {x : R}, x ∈ carrier → -x ∈ carrier)

(mul_mem_left : ∀ {x y : R}, y ∈ carrier → x * y ∈ carrier)

(mul_mem_right : ∀ {x y : R}, x ∈ carrier → x * y ∈ carrier)

x ∈ TwoSidedIdeal.mk' carrier zero_mem ⋯ ⋯ ⋯ ⋯ ↔ x ∈ carrier


/-- If a family of open sets `s` is such that every open neighbourhood contains some
member of `s`, then `s` is a topological basis. -/
theorem isTopologicalBasis_of_isOpen_of_nhds {s : Set (Set α)} (h_open : ∀ u ∈ s, IsOpen u)
    (h_nhds : ∀ (a : α) (u : Set α), a ∈ u → IsOpen u → ∃ v ∈ s, a ∈ v ∧ v ⊆ u) :
    IsTopologicalBasis s


theorem mem_bind_of_mem {b : β} {l : List α} {f : α → List β} {a} (al : a ∈ l) (h : b ∈ f a) :
    b ∈ List.bind l f

{β : Type u_1}
{α : Type u_2}
{b : β}
{l : List α}
{f : α → List β}
{a : α}
(al : a ∈ l)
(h : b ∈ f a)


@[simp]
theorem add_snd : (x + y).snd = x.snd + y.snd

{p : ℝ≥0∞}
{α : Type u_2}
{β : Type u_3}
[AddCommGroup α]
[AddCommGroup β]
(x y : WithLp p (α × β))


/-- Conditions for an element to be multiplicatively central -/
@[to_additive]
structure IsMulCentral [Mul M] (z : M) : Prop where
  /-- multiplication commutes -/
  comm (a : M) : z * a = a * z
  /-- associative property for left multiplication -/
  left_assoc (b c : M) : z * (b * c) = (z * b) * c
  /-- middle associative multiplication property -/
  mid_assoc (a c : M) : (a * z) * c = a * (z * c)
  /-- associative property for right multiplication -/
  right_assoc (a b : M) : (a * b) * z = a * (b * z)

{M : Type u_1}
[Mul M]
{z : M}
(self : IsMulCentral z)
(a c : M)


theorem contMDiff_fst : ContMDiff (I.prod J) I n (@Prod.fst M N)

{𝕜 : 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]
{F : Type u_11}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_12}
[TopologicalSpace G]
{J : ModelWithCorners 𝕜 F G}
{N : Type u_13}
[TopologicalSpace N]
[ChartedSpace G N]
{n : ℕ∞}


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

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


theorem apply_invFun_apply {α β : Type*} {f : α → β} {a : α} :
    f (@invFun _ _ ⟨a⟩ f (f a)) = f a

{α : Type u_3}
{β : Type u_4}
{f : α → β}
{a : α}


protected theorem lt_of_sub_eq_succ (h : m - n = succ l) : n < m


@[simp]
theorem prodMonoidal_leftUnitor_inv_snd (X : C₁ × C₂) :
    ((λ_ X).inv : X ⟶ 𝟙_ _ ⊗ X).2 = (λ_ X.2).inv

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

(CategoryTheory.MonoidalCategory.leftUnitor X).inv.2 = (CategoryTheory.MonoidalCategory.leftUnitor X.2).inv


/-- `OrderIsoClass F α β` states that `F` is a type of order isomorphisms.

You should extend this class when you extend `OrderIso`. -/
class OrderIsoClass (F α β : Type*) [LE α] [LE β] [EquivLike F α β] : Prop where
  /-- An order isomorphism respects `≤`. -/
  map_le_map_iff (f : F) {a b : α} : f a ≤ f b ↔ a ≤ b

{F : Type u_6}
{α : Type u_7}
{β : Type u_8}
[LE α]
[LE β]
[EquivLike F α β]
[self : OrderIsoClass F α β]
(f : F)
{a b : α}


theorem asBasis_filter (f : Filter α) : f.asBasis.filter = f


theorem shiftRight_succ (m n) : m >>> (n + 1) = (m >>> n) / 2


protected theorem le_of_sub_le_sub_right : ∀ {n m k : Nat}, k ≤ m → n - k ≤ m - k → n ≤ m


theorem nonuniformWitnesses_spec (h : ¬G.IsUniform ε s t) :
    ε ≤
      |G.edgeDensity (G.nonuniformWitnesses ε s t).1 (G.nonuniformWitnesses ε s t).2 -
          G.edgeDensity s t|

{α : Type u_1}
{𝕜 : Type u_2}
[LinearOrderedField 𝕜]
(G : SimpleGraph α)
[DecidableRel G.Adj]
{ε : 𝕜}
{s t : Finset α}
(h : ¬G.IsUniform ε s t)

ε ≤ ↑|G.edgeDensity (G.nonuniformWitnesses ε s t).1 (G.nonuniformWitnesses ε s t).2 - G.edgeDensity s t|


@[simp]
theorem inv_whiskerLeft (X : C) {Y Z : C} (f : Y ⟶ Z) [IsIso f] :
    inv (X ◁ f) = X ◁ inv f

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

CategoryTheory.inv (CategoryTheory.MonoidalCategory.whiskerLeft X f) =
  CategoryTheory.MonoidalCategory.whiskerLeft X (CategoryTheory.inv f)


@[to_additive prod_mono]
theorem prod_mono {s₁ s₂ : Subsemigroup M} {t₁ t₂ : Subsemigroup N} (hs : s₁ ≤ s₂) (ht : t₁ ≤ t₂) :
    s₁.prod t₁ ≤ s₂.prod t₂

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
{s₁ s₂ : Subsemigroup M}
{t₁ t₂ : Subsemigroup N}
(hs : s₁ ≤ s₂)
(ht : t₁ ≤ t₂)


theorem monotone_filter_left : Monotone (filter p)

{α : Type u_1}
(p : α → Prop)
[DecidablePred p]


theorem Disjoint.mul_left (H1 : Disjoint f h) (H2 : Disjoint g h) : Disjoint (f * g) h

{α : Type u_1}
{f g h : Equiv.Perm α}
(H1 : f.Disjoint h)
(H2 : g.Disjoint h)


@[to_additive] lemma mabs_of_one_lt (h : 1 < a) : |a|ₘ = a

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


@[simp] lemma image2_mk_eq_prod : image2 Prod.mk s t = s ×ˢ t

{α : Type u_1}
{β : Type u_3}
{s : Set α}
{t : Set β}


theorem Balanced.smul_eq (hA : Balanced 𝕜 A) (ha : ‖a‖ = 1) : a • A = A

{𝕜 : Type u_1}
{E : Type u_3}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{A : Set E}
{a : 𝕜}
(hA : Balanced 𝕜 A)
(ha : ‖a‖ = 1)


protected theorem LocallyIntegrable.add (hf : LocallyIntegrable f μ) (hg : LocallyIntegrable g μ) :
    LocallyIntegrable (f + g) μ

(hf : MeasureTheory.LocallyIntegrable f μ)

(hg : MeasureTheory.LocallyIntegrable g μ)

MeasureTheory.LocallyIntegrable (f + g) μ


@[simp, norm_cast]
theorem coe_sep (p : Class.{u}) (x : ZFSet.{u}) :
    (ZFSet.sep p x : Class) = { y ∈ x | p y }


theorem map_iSup {ι : Sort*} (f : M →[L] N) (s : ι → L.Substructure M) :
    (iSup s).map f = ⨆ i, (s i).map f

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{ι : Sort u_3}
(f : L.Hom M N)
(s : ι → L.Substructure M)

FirstOrder.Language.Substructure.map f (iSup s) = ⨆ i, FirstOrder.Language.Substructure.map f (s i)


lemma coverPreserving [G.IsDenseSubsite J K] : CoverPreserving J K G

(J : CategoryTheory.GrothendieckTopology C)

(K : CategoryTheory.GrothendieckTopology D)

[CategoryTheory.Functor.IsDenseSubsite J K G]


theorem scale_eq_mul (x) [NF x] : ∀ (o) [NF o], scale x o = oadd x 1 0 * o


theorem unique' {a b : α} {k : ℕ} (hk : a ^ k ∣ b) (hsucc : ¬a ^ (k + 1) ∣ b) :
    k = get (multiplicity a b) ⟨k, hsucc⟩

{α : Type u_1}
[Monoid α]
[DecidableRel fun x x_1 => x ∣ x_1]
{a b : α}
{k : ℕ}
(hk : a ^ k ∣ b)
(hsucc : ¬a ^ (k + 1) ∣ b)


theorem iInf_split :
    ∀ (f : β → α) (p : β → Prop), ⨅ i, f i = (⨅ (i) (_ : p i), f i) ⊓ ⨅ (i) (_ : ¬p i), f i

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
(f : β → α)
(p : β → Prop)

⨅ i, f i = (⨅ i, ⨅ (_ : p i), f i) ⊓ ⨅ i, ⨅ (_ : ¬p i), f i


theorem support_X_empty (H : (1 : R) = 0) : (X : R[X]).support = ∅


theorem single_smul {α} [Monoid α] [∀ i, AddMonoid <| f i] [∀ i, DistribMulAction α <| f i]
    [DecidableEq I] (i : I) (r : α) (x : f i) : single i (r • x) = r • single i x

{I : Type u}
{f : I → Type v}
{α : Type u_1}
[Monoid α]
[(i : I) → AddMonoid (f i)]
[(i : I) → DistribMulAction α (f i)]
[DecidableEq I]
(i : I)
(r : α)
(x : f i)


theorem le_tsub_of_add_le_left (h : a + b ≤ c) : b ≤ c - a

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


theorem inter_comm (a b : Set α) : a ∩ b = b ∩ a


theorem rtake_eq_reverse_take_reverse : l.rtake n = reverse (l.reverse.take n)

l.rtake n = (List.take n l.reverse).reverse


@[simp]
theorem product_disjUnion (ht : Disjoint t t') :
    s ×ˢ t.disjUnion t' ht = (s ×ˢ t).disjUnion (s ×ˢ t') (disjoint_product.mpr <| Or.inr ht)

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{t t' : Finset β}
(ht : Disjoint t t')

s ×ˢ t.disjUnion t' ht = (s ×ˢ t).disjUnion (s ×ˢ t') ⋯


theorem lift_of (F : Multiplicative G →* A) (x : Multiplicative G) :
    lift k G A F (of k G x) = F x

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

((AddMonoidAlgebra.lift k G A) F) ((AddMonoidAlgebra.of k G) x) = F x


@[simp]
theorem mul_single_apply (f : MonoidAlgebra k G) (r : k) (x y : G) :
    (f * single x r) y = f (y * x⁻¹) * r

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[Group G]
(f : MonoidAlgebra k G)
(r : k)
(x y : G)

(f * MonoidAlgebra.single x r) y = f (y * x⁻¹) * r


lemma nsmul_mem {x} (n : ℕ) (hx : x ∈ I) : n • x ∈ I

{R : Type u_1}
[NonUnitalNonAssocRing R]
(I : TwoSidedIdeal R)
{x : R}
(n : ℕ)
(hx : x ∈ I)


lemma deriv2_negMulLog {x : ℝ} (hx : x ≠ 0) : deriv^[2] negMulLog x = - x⁻¹


@[simp]
theorem coe_powers : ⇑(powers x hx) = HPow.hPow x

{Γ : Type u_1}
{R : Type u_2}
[LinearOrderedCancelAddCommMonoid Γ]
[CommRing R]
[IsDomain R]
{x : HahnSeries Γ R}
(hx : 0 < x.orderTop)

⇑(HahnSeries.SummableFamily.powers x hx) = HPow.hPow x


@[simp]
theorem right_eq_id {X Y : CostructuredArrow S T} (f : X ⟶ Y) : f.right = 𝟙 _

{X Y : CategoryTheory.CostructuredArrow S T}

f.right = CategoryTheory.CategoryStruct.id X.right


theorem map_add (x y : ((i : ι) → Ms i) ⧸ pi Set.univ p) :
    toFun p (x + y) = toFun p x + toFun p y

(x y : ((i : ι) → Ms i) ⧸ Submodule.pi Set.univ p)

Submodule.quotientPi_aux.toFun p (x + y) = Submodule.quotientPi_aux.toFun p x + Submodule.quotientPi_aux.toFun p y


@[simp]
theorem norm_natCast (n : ℕ) : norm (n : ℤ√d) = n * n