/-- The adjoint is unique: a map `A` is the adjoint of `B` iff it satisfies `⟪A x, y⟫ = ⟪x, B y⟫`
for all basis vectors `x` and `y`. -/
theorem eq_adjoint_iff_basis {ι₁ : Type*} {ι₂ : Type*} (b₁ : Basis ι₁ 𝕜 E) (b₂ : Basis ι₂ 𝕜 F)
    (A : E →ₗ[𝕜] F) (B : F →ₗ[𝕜] E) :
    A = LinearMap.adjoint B ↔ ∀ (i₁ : ι₁) (i₂ : ι₂), ⟪A (b₁ i₁), b₂ i₂⟫ = ⟪b₁ i₁, B (b₂ i₂)⟫

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 E]
[InnerProductSpace 𝕜 F]
[FiniteDimensional 𝕜 E]
[FiniteDimensional 𝕜 F]
{ι₁ : Type u_5}
{ι₂ : Type u_6}
(b₁ : Basis ι₁ 𝕜 E)
(b₂ : Basis ι₂ 𝕜 F)
(A : E →ₗ[𝕜] F)
(B : F →ₗ[𝕜] E)

A = LinearMap.adjoint B ↔ ∀ (i₁ : ι₁) (i₂ : ι₂), ⟪A (b₁ i₁), b₂ i₂⟫_𝕜 = ⟪b₁ i₁, B (b₂ i₂)⟫_𝕜


/-- If `f` is convex on `S` and differentiable at all points of `S`, then its derivative is monotone
on `S`. -/
lemma strictMonoOn_deriv (hfc : StrictConvexOn ℝ S f) (hfd : ∀ x ∈ S, DifferentiableAt ℝ f x) :
    StrictMonoOn (deriv f) S

{S : Set ℝ}
{f : ℝ → ℝ}
(hfc : StrictConvexOn ℝ S f)
(hfd : ∀ x ∈ S, DifferentiableAt ℝ f x)


theorem isSubperm_iff {l₁ l₂ : List α} : l₁.isSubperm l₂ ↔ l₁ <+~ l₂

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


lemma Y_sub_Y_add_Y_sub_negY (P Q : Fin 3 → R) (hx : P x * Q z ^ 2 = Q x * P z ^ 2) :
    (P y * Q z ^ 3 - Q y * P z ^ 3) + (P y * Q z ^ 3 - W'.negY Q * P z ^ 3) =
      (P y - W'.negY P) * Q z ^ 3

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
(P Q : Fin 3 → R)
(hx : P x * Q z ^ 2 = Q x * P z ^ 2)

P y * Q z ^ 3 - Q y * P z ^ 3 + (P y * Q z ^ 3 - W'.negY Q * P z ^ 3) = (P y - W'.negY P) * Q z ^ 3


/-- The equivalence of functor categories given by currying/uncurrying.
-/
@[simps!]
def currying : C ⥤ D ⥤ E ≌ C × D ⥤ E

{C : Type u₂}
[CategoryTheory.Category.{v₂, u₂} C]
{D : Type u₃}
[CategoryTheory.Category.{v₃, u₃} D]
{E : Type u₄}
[CategoryTheory.Category.{v₄, u₄} E]
(X : CategoryTheory.Functor (C × D) E)

∀ (X_1 : C × D),
  (CategoryTheory.currying.counitIso.hom.app X).app X_1 = CategoryTheory.CategoryStruct.id (X.obj (X_1.1, X_1.2))


@[higher_order]
theorem tfst_eq_fst_id {α α' β} (f : α → α') (x : t α β) :
    tfst (F := Id) (pure ∘ f) x = pure (fst f x)

{t : Type u → Type u → Type u}
[Bitraversable t]
[LawfulBitraversable t]
{α α' β : Type u}
(f : α → α')

Bitraversable.tfst (pure ∘ f) = pure ∘ Bifunctor.fst f


lemma LSeriesSummable.of_re_le_re {f : ℕ → ℂ} {s s' : ℂ} (h : s.re ≤ s'.re)
    (hf : LSeriesSummable f s) : LSeriesSummable f s'


/-- An [exhaustion by compact sets](https://en.wikipedia.org/wiki/Exhaustion_by_compact_sets) of a
topological space is a sequence of compact sets `K n` such that `K n ⊆ interior (K (n + 1))` and
`⋃ n, K n = univ`.

If `X` is a locally compact sigma compact space, then `CompactExhaustion.choice X` provides
a choice of an exhaustion by compact sets. This choice is also available as
`(default : CompactExhaustion X)`. -/
structure CompactExhaustion (X : Type*) [TopologicalSpace X] where
  /-- The sequence of compact sets that form a compact exhaustion. -/
  toFun : ℕ → Set X
  /-- The sets in the compact exhaustion are in fact compact. -/
  isCompact' : ∀ n, IsCompact (toFun n)
  /-- The sets in the compact exhaustion form a sequence:
    each set is contained in the interior of the next. -/
  subset_interior_succ' : ∀ n, toFun n ⊆ interior (toFun (n + 1))
  /-- The union of all sets in a compact exhaustion equals the entire space. -/
  iUnion_eq' : ⋃ n, toFun n = univ

{X : Type u_4}
[TopologicalSpace X]
(self : CompactExhaustion X)
(n : ℕ)


/-- The multiplicative indicators of closed δ-thickenings of a set tend pointwise to the
multiplicative indicator of the set, as δ tends to zero. -/
@[to_additive "The indicators of closed δ-thickenings of a set tend pointwise to the indicator
of the set, as δ tends to zero."]
lemma tendsto_mulIndicator_cthickening_mulIndicator_closure (f : α → β) (E : Set α) :
    Tendsto (fun δ ↦ (Metric.cthickening δ E).mulIndicator f) (𝓝 0)
      (𝓝 ((closure E).mulIndicator f))

{α : Type u_1}
[PseudoEMetricSpace α]
{β : Type u_2}
[Zero β]
[TopologicalSpace β]
(f : α → β)
(E : Set α)

Filter.Tendsto (fun δ => (Metric.cthickening δ E).indicator f) (𝓝 0) (𝓝 ((closure E).indicator f))


theorem adjMatrix_pow_apply_eq_card_walk [DecidableEq V] [Semiring α] (n : ℕ) (u v : V) :
    (G.adjMatrix α ^ n) u v = Fintype.card { p : G.Walk u v | p.length = n }

{V : Type u_1}
{α : Type u_2}
{G : SimpleGraph V}
[DecidableRel G.Adj]
[Fintype V]
[DecidableEq V]
[Semiring α]
(n : ℕ)
(u v : V)

(SimpleGraph.adjMatrix α G ^ n) u v = ↑(Fintype.card ↑{p | p.length = n})


@[simp]
theorem toFinset_append : toFinset (l ++ l') = l.toFinset ∪ l'.toFinset

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

(l ++ l').toFinset = l.toFinset ∪ l'.toFinset


theorem toIocMod_eq_sub_fract_mul (a b : α) :
    toIocMod hp a b = a + p - Int.fract ((a + p - b) / p) * p

{α : Type u_1}
[LinearOrderedField α]
[FloorRing α]
{p : α}
(hp : 0 < p)
(a b : α)


theorem _root_.IsOpen.exists_positiveCompacts_closure_subset [R1Space α] [LocallyCompactSpace α]
    {U : Set α} (ho : IsOpen U) (hn : U.Nonempty) : ∃ K : PositiveCompacts α, closure ↑K ⊆ U

{α : Type u_1}
[TopologicalSpace α]
[R1Space α]
[LocallyCompactSpace α]
{U : Set α}
(ho : IsOpen U)
(hn : U.Nonempty)


/-- Two bases are equal if their basis vectors are the same. -/
@[ext]
theorem eq_of_apply_eq {b₁ b₂ : Basis ι R M} : (∀ i, b₁ i = b₂ i) → b₁ = b₂

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{b₁ b₂ : Basis ι R M}


@[to_additive]
theorem norm_div_le (a b : E) : ‖a / b‖ ≤ ‖a‖ + ‖b‖

{E : Type u_6}
[SeminormedAddGroup E]
(a b : E)

‖a - b‖ ≤ ‖a‖ + ‖b‖


protected theorem mul_lt_mul_of_lt_of_le (hac : a < c) (hbd : b ≤ d) (hd : 0 < d) :
    a * b < c * d

{a c b d : Nat}
(hac : a < c)
(hbd : b ≤ d)
(hd : 0 < d)


@[to_additive mem_leftAddCoset_leftAddCoset]
theorem mem_leftCoset_leftCoset {a : α} (ha : a • (s : Set α) = s) : a ∈ s

{α : Type u_1}
[Monoid α]
(s : Submonoid α)
{a : α}
(ha : a • ↑s = ↑s)


@[to_additive]
theorem image_pow_subset_of_coprime (hm : 0 < m) (hmn : n.Coprime m) :
    (fun (y : A) => y ^ m) '' approxOrderOf A n δ ⊆ approxOrderOf A n (m * δ)

{A : Type u_1}
[SeminormedCommGroup A]
{m n : ℕ}
(δ : ℝ)
(hm : 0 < m)
(hmn : n.Coprime m)

(fun y => y ^ m) '' approxOrderOf A n δ ⊆ approxOrderOf A n (↑m * δ)


theorem eq_homEquiv_apply {A : C} {B : D} (f : F.obj A ⟶ B) (g : A ⟶ G.obj B) :
    g = adj.homEquiv A B f ↔ (adj.homEquiv A B).symm g = f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F : CategoryTheory.Functor C D}
{G : CategoryTheory.Functor D C}
(adj : F ⊣ G)
{A : C}
{B : D}
(f : F.obj A ⟶ B)
(g : A ⟶ G.obj B)

g = (adj.homEquiv A B) f ↔ (adj.homEquiv A B).symm g = f


theorem add_def (a b : Fin n) : a + b = Fin.mk ((a + b) % n) (Nat.mod_lt _ a.size_pos)


/-- Given a map `r : I₁ × I₂ × I₃ → J`, a `BifunctorComp₁₂IndexData r` consists of the data
of a type `I₁₂`, maps `p : I₁ × I₂ → I₁₂` and `q : I₁₂ × I₃ → J`, such that `r` is obtained
by composition of `p` and `q`. -/
structure BifunctorComp₁₂IndexData :=
  /-- an auxiliary type -/
  I₁₂ : Type*
  /-- a map `I₁ × I₂ → I₁₂` -/
  p : I₁ × I₂ → I₁₂
  /-- a map `I₁₂ × I₃ → J` -/
  q : I₁₂ × I₃ → J
  hpq (i : I₁ × I₂ × I₃) : q ⟨p ⟨i.1, i.2.1⟩, i.2.2⟩ = r i

(self : CategoryTheory.GradedObject.BifunctorComp₁₂IndexData r)


@[to_additive]
lemma prod_Ico_mul_eq_prod_Icc (h : a ≤ b) : (∏ x ∈ Ico a b, f x) * f b = ∏ x ∈ Icc a b, f x

{α : Type u_1}
{M : Type u_2}
[PartialOrder α]
[AddCommMonoid M]
{f : α → M}
{a b : α}
[LocallyFiniteOrder α]
(h : a ≤ b)

∑ x ∈ Finset.Ico a b, f x + f b = ∑ x ∈ Finset.Icc a b, f x


lemma num_divInt_den (q : ℚ) : q.num /. q.den = q


/-- The integral of `f (R • x)` with respect to an additive Haar measure is a multiple of the
integral of `f`. The formula we give works even when `f` is not integrable or `R = 0`
thanks to the convention that a non-integrable function has integral zero. -/
theorem integral_comp_smul_of_nonneg (f : E → F) (R : ℝ) {hR : 0 ≤ R} :
    ∫ x, f (R • x) ∂μ = (R ^ finrank ℝ E)⁻¹ • ∫ x, f x ∂μ

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
[FiniteDimensional ℝ E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
(f : E → F)
(R : ℝ)
{hR : 0 ≤ R}

∫ (x : E), f (R • x) ∂μ = (R ^ FiniteDimensional.finrank ℝ E)⁻¹ • ∫ (x : E), f x ∂μ


@[to_additive]
lemma prod_le_prod_of_rel_le (h : s.Rel (· ≤ ·) t) : s.prod ≤ t.prod

(h : Multiset.Rel (fun x x_1 => x ≤ x_1) s t)


@[to_additive (attr := simp) abs_norm]
theorem abs_norm' (z : E) : |‖z‖| = ‖z‖

{E : Type u_6}
[SeminormedAddGroup E]
(z : E)


{α : Type u_2}
[DecidableEq α]
[SemilatticeSup α]
[OrderBot α]
[DecidableRel Disjoint]
(s t : Finset α)


@[to_additive]
lemma aestabilizer_congr (h : s =ᵐ[μ] t) : aestabilizer G μ s = aestabilizer G μ t

{G : Type u_1}
{α : Type u_2}
[Group G]
[MulAction G α]

∀ {x : MeasurableSpace α} {μ : MeasureTheory.Measure α} [inst : MeasureTheory.SMulInvariantMeasure G α μ] {s t : Set α},
  s =ᵐ[μ] t → MulAction.aestabilizer G μ s = MulAction.aestabilizer G μ t


theorem frontier_closedBall (x : E) {r : ℝ} (hr : r ≠ 0) :
    frontier (closedBall x r) = sphere x r

{E : Type u_1}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
(x : E)
{r : ℝ}
(hr : r ≠ 0)

frontier (Metric.closedBall x r) = Metric.sphere x r


@[to_additive]
theorem ThreeGPFree.image' [FunLike F α β] [MulHomClass F α β] (f : F) (hf : (s * s).InjOn f)
    (h : ThreeGPFree s) : ThreeGPFree (f '' s)

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[CommMonoid α]
[CommMonoid β]
{s : Set α}
[FunLike F α β]
[MulHomClass F α β]
(f : F)
(hf : Set.InjOn (⇑f) (s * s))
(h : ThreeGPFree s)


@[simp, norm_cast]
theorem coe_comp : (f.comp g : M₁ → M₃) = f ∘ g

{R₁ : Type u_2}
{R₂ : Type u_3}
{R₃ : Type u_4}
{M₁ : Type u_10}
{M₂ : Type u_11}
{M₃ : Type u_12}
[Semiring R₁]
[Semiring R₂]
[Semiring R₃]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
{module_M₁ : Module R₁ M₁}
{module_M₂ : Module R₂ M₂}
{module_M₃ : Module R₃ M₃}
{σ₁₂ : R₁ →+* R₂}
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R₁ →+* R₃}
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
(f : M₂ →ₛₗ[σ₂₃] M₃)
(g : M₁ →ₛₗ[σ₁₂] M₂)


theorem not_isPrimePow_zero [NoZeroDivisors R] : ¬IsPrimePow (0 : R)

{R : Type u_1}
[CommMonoidWithZero R]
[NoZeroDivisors R]


@[simp] theorem decide_mem_replicate [BEq α] [LawfulBEq α] {a b : α} :
    ∀ {n}, decide (b ∈ replicate n a) = ((¬ n == 0) && b == a)

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

decide (b ∈ List.replicate n a) = (decide ¬(n == 0) = true && b == a)


/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
private theorem step3 (K : Subgroup N) [(K.map N.subtype).Normal] : K = ⊥ ∨ K = ⊤

(h2 :
  ∀ (G' : Type u) [inst : Group G'] [inst_1 : Finite G'],
    Nat.card G' < Nat.card G →
      ∀ {N' : Subgroup G'} [inst_2 : N'.Normal], (Nat.card ↥N').Coprime N'.index → ∃ H', N'.IsComplement' H')

(h3 : ∀ (H : Subgroup G), ¬N.IsComplement' H)


theorem LocallyIntegrableOn.integrableOn_compact_subset (hf : LocallyIntegrableOn f s μ) {t : Set X}
    (hst : t ⊆ s) (ht : IsCompact t) : IntegrableOn f t μ

(hf : MeasureTheory.LocallyIntegrableOn f s μ)


theorem UniqueMDiffOn.prod {s : Set M} {t : Set M'} (hs : UniqueMDiffOn I s)
    (ht : UniqueMDiffOn I' t) : UniqueMDiffOn (I.prod I') (s ×ˢ t)

{𝕜 : 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']
{s : Set M}
{t : Set M'}
(hs : UniqueMDiffOn I s)
(ht : UniqueMDiffOn I' t)


@[to_additive]
theorem leftRel_eq : @Setoid.r _ (leftRel s) = fun x y => x⁻¹ * y ∈ s

{α : Type u_1}
[Group α]
(s : Subgroup α)


/-- The mates equivalence commutes with vertical composition. -/
theorem mateEquiv_vcomp
    (α : G₁ ⋙ L₂ ⟶ L₁ ⋙ H₁) (β : G₂ ⋙ L₃ ⟶ L₂ ⋙ H₂) :
    (mateEquiv (G := G₁ ⋙ G₂) (H := H₁ ⋙ H₂) adj₁ adj₃) (leftAdjointSquare.vcomp α β) =
      rightAdjointSquare.vcomp (mateEquiv adj₁ adj₂ α) (mateEquiv adj₂ adj₃ β)

{A : Type u₁}
{B : Type u₂}
{C : Type u₃}
{D : Type u₄}
{E : Type u₅}
{F : Type u₆}
[CategoryTheory.Category.{v₁, u₁} A]
[CategoryTheory.Category.{v₂, u₂} B]
[CategoryTheory.Category.{v₃, u₃} C]
[CategoryTheory.Category.{v₄, u₄} D]
[CategoryTheory.Category.{v₅, u₅} E]
[CategoryTheory.Category.{v₆, u₆} F]
{G₁ : CategoryTheory.Functor A C}
{G₂ : CategoryTheory.Functor C E}
{H₁ : CategoryTheory.Functor B D}
{H₂ : CategoryTheory.Functor D F}
{L₁ : CategoryTheory.Functor A B}
{R₁ : CategoryTheory.Functor B A}
{L₂ : CategoryTheory.Functor C D}
{R₂ : CategoryTheory.Functor D C}
{L₃ : CategoryTheory.Functor E F}
{R₃ : CategoryTheory.Functor F E}
(adj₁ : L₁ ⊣ R₁)
(adj₂ : L₂ ⊣ R₂)
(adj₃ : L₃ ⊣ R₃)
(α : G₁.comp L₂ ⟶ L₁.comp H₁)
(β : G₂.comp L₃ ⟶ L₂.comp H₂)

(CategoryTheory.mateEquiv adj₁ adj₃) (CategoryTheory.leftAdjointSquare.vcomp α β) =
  CategoryTheory.rightAdjointSquare.vcomp ((CategoryTheory.mateEquiv adj₁ adj₂) α)
    ((CategoryTheory.mateEquiv adj₂ adj₃) β)


lemma PrimeSpectrum.continuous_tensorProductTo : Continuous (tensorProductTo R S T)

(R : Type u_1)
(S : Type u_2)
(T : Type u_3)
[CommRing R]
[CommRing S]
[Algebra R S]
[CommRing T]
[Algebra R T]

Continuous (PrimeSpectrum.tensorProductTo R S T)


theorem Finite.of_preimage (h : (f ⁻¹' s).Finite) (hf : Surjective f) : s.Finite

{α : Type u}
{β : Type v}
{f : α → β}
{s : Set β}
(h : (f ⁻¹' s).Finite)
(hf : Function.Surjective f)


@[simp] lemma map₂_eq_bot_iff {f : α → β → γ} {a : WithBot α} {b : WithBot β} :
    map₂ f a b = ⊥ ↔ a = ⊥ ∨ b = ⊥

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : α → β → γ}
{a : WithBot α}
{b : WithBot β}


@[simp]
lemma castHom_comp {m d : ℕ} (hm : n ∣ m) (hd : m ∣ d) :
    (castHom hm (ZMod n)).comp (castHom hd (ZMod m)) = castHom (dvd_trans hm hd) (ZMod n)

(ZMod.castHom hm (ZMod n)).comp (ZMod.castHom hd (ZMod m)) = ZMod.castHom ⋯ (ZMod n)


@[reassoc (attr := simp)]
lemma rightDerivedZeroIsoSelf_hom_inv_id :
    F.rightDerivedZeroIsoSelf.hom ≫ F.toRightDerivedZero = 𝟙 _

CategoryTheory.CategoryStruct.comp F.rightDerivedZeroIsoSelf.hom F.toRightDerivedZero =
  CategoryTheory.CategoryStruct.id (F.rightDerived 0)


/-- If `U` is a family of open sets that covers `X`, then `X.restrict U` forms an `X.open_cover`. -/
@[simps! J obj map]
def Scheme.openCoverOfISupEqTop {s : Type*} (X : Scheme.{u}) (U : s → X.Opens)
    (hU : ⨆ i, U i = ⊤) : X.OpenCover

{s : Type u_1}
(X : AlgebraicGeometry.Scheme)
(U : s → X.Opens)
(hU : ⨆ i, U i = ⊤)
(i : s)

(X.openCoverOfISupEqTop U hU).obj i = ↑(U i)


@[simp, mfld_simps]
theorem range_prod_map {m₁ : α → γ} {m₂ : β → δ} : range (Prod.map m₁ m₂) = range m₁ ×ˢ range m₂

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{m₁ : α → γ}
{m₂ : β → δ}

Set.range (Prod.map m₁ m₂) = Set.range m₁ ×ˢ Set.range m₂


/-- A natural transformation `R₁ ⟶ R₂` induces a functor `Comma L R₁ ⥤ Comma L R₂`. -/
@[simps]
def mapRight (r : R₁ ⟶ R₂) : Comma L R₁ ⥤ Comma L R₂

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

∀ {X Y : CategoryTheory.Comma L R₁} (f : X ⟶ Y), ((CategoryTheory.Comma.mapRight L r).map f).left = f.left


@[gcongr] protected theorem inv_lt_inv' (h : a < b) : b⁻¹ < a⁻¹


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

{ι : Type u_1}
{α : ι → Type u_3}
{β : Type u_6}
(s : Set ι)
(t : (i : ι) → Set (α i))
(f : (i : ι) → α i → Set β)


@[to_additive]
theorem SMul.smul_eq_hSMul {α β} [SMul α β] : (SMul.smul : α → β → β) = HSMul.hSMul

{α : Type u_1}
{β : Type u_2}
[SMul α β]


/-- When the domain has a zero, then the inverse of a multiplicative character `χ`,
applied to `a`, is `χ` applied to the inverse of `a`. -/
theorem inv_apply' {R : Type*} [Field R] (χ : MulChar R R') (a : R) : χ⁻¹ a = χ a⁻¹

{R' : Type u_2}
[CommMonoidWithZero R']
{R : Type u_3}
[Field R]
(χ : MulChar R R')
(a : R)

χ⁻¹ a = χ a⁻¹


@[to_additive]
theorem eq_mk'_iff_mul_eq {x} {y : S} {z} : z = f.mk' x y ↔ z * f.toMap y = f.toMap x

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

z = f.mk' x y ↔ z + f.toMap ↑y = f.toMap x


theorem pow_image_of_prime_by_factor_orderIso_dvd
    {m p : Associates M} {n : Associates N} (hn : n ≠ 0) (hp : p ∈ normalizedFactors m)
    (d : Set.Iic m ≃o Set.Iic n) {s : ℕ} (hs' : p ^ s ≤ m) :
    (d ⟨p, dvd_of_mem_normalizedFactors hp⟩ : Associates N) ^ s ≤ n

(hp : p ∈ UniqueFactorizationMonoid.normalizedFactors m)


theorem neg_mk_mul_moveLeft_inl {xl xr yl yr} {xL xR yL yR} {i j} :
    (-(mk xl xr xL xR * mk yl yr yL yR)).moveLeft (Sum.inl (i, j)) =
      -(xL i * mk yl yr yL yR + mk xl xr xL xR * yR j - xL i * yR j)

{xl xr yl yr : Type u_1}
{xL : xl → SetTheory.PGame}
{xR : xr → SetTheory.PGame}
{yL : yl → SetTheory.PGame}
{yR : yr → SetTheory.PGame}
{i : xl}
{j : yr}

(-(SetTheory.PGame.mk xl xr xL xR * SetTheory.PGame.mk yl yr yL yR)).moveLeft (Sum.inl (i, j)) =
  -(xL i * SetTheory.PGame.mk yl yr yL yR + SetTheory.PGame.mk xl xr xL xR * yR j - xL i * yR j)


theorem le_last_of_mem {s : CompositionSeries X} {x : X} (hx : x ∈ s) : x ≤ s.last

{X : Type u}
[Lattice X]
[JordanHolderLattice X]
{s : CompositionSeries X}
{x : X}
(hx : x ∈ s)


theorem neg_one_left (a : R) : Commute (-1) a

{R : Type x}
[MulOneClass R]
[HasDistribNeg R]
(a : R)


lemma div_ofNat (z : ℂ) (n : ℕ) [n.AtLeastTwo] :
    z / OfNat.ofNat n = ⟨z.re / OfNat.ofNat n, z.im / OfNat.ofNat n⟩

z / OfNat.ofNat n = { re := z.re / OfNat.ofNat n, im := z.im / OfNat.ofNat n }


/-- A oplax monoidal functor takes comonoid objects to comonoid objects.

That is, a oplax monoidal functor `F : C ⥤ D` induces a functor `Comon_ C ⥤ Comon_ D`.
-/
@[simps]
def mapComon (F : OplaxMonoidalFunctor C D) : Comon_ C ⥤ Comon_ D

(F : CategoryTheory.OplaxMonoidalFunctor C D)


@[simp]
theorem ringQuotToIdealQuotient_apply (r : B → B → Prop) (x : B) :
    ringQuotToIdealQuotient r (mkRingHom r x) = Ideal.Quotient.mk (Ideal.ofRel r) x

{B : Type uR}
[CommRing B]
(r : B → B → Prop)
(x : B)

(RingQuot.ringQuotToIdealQuotient r) ((RingQuot.mkRingHom r) x) = (Ideal.Quotient.mk (Ideal.ofRel r)) x


lemma uIcc_injective_right (a : α) : Injective fun b => uIcc b a

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

Function.Injective fun b => Set.uIcc b a


theorem empty_ne_univ [Nonempty α] : (∅ : Set α) ≠ univ


/-- To check a polynomial `p` over a field is irreducible, it suffices to check there are no
divisors of degree `0 < d ≤ degree p / 2`.

See also: `Polynomial.Monic.irreducible_iff_natDegree'`.
-/
theorem irreducible_iff_lt_natDegree_lt {p : R[X]} (hp0 : p ≠ 0) (hpu : ¬ IsUnit p) :
    Irreducible p ↔ ∀ q, Monic q → natDegree q ∈ Finset.Ioc 0 (natDegree p / 2) → ¬ q ∣ p

{R : Type u}
[Field R]
{p : R[X]}
(hp0 : p ≠ 0)
(hpu : ¬IsUnit p)

Irreducible p ↔ ∀ (q : R[X]), q.Monic → q.natDegree ∈ Finset.Ioc 0 (p.natDegree / 2) → ¬q ∣ p


@[to_additive (attr := simp)]
theorem lift_comp_of : (lift f).comp of = f

{α : Type u}
[Mul α]
{β : Type v}
[Semigroup β]
(f : α →ₙ* β)

(Magma.AssocQuotient.lift f).comp Magma.AssocQuotient.of = f


@[to_additive]
lemma max_inv_one (a : α) : max a⁻¹ 1 = a⁻¹ * max a 1

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


@[simp]
theorem div_zero (a : G₀) : a / 0 = 0

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


theorem isUnit_det_zpow_iff {A : M} {z : ℤ} : IsUnit (A ^ z).det ↔ IsUnit A.det ∨ z = 0

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


/-- Given measures `μ` and `ν`, if `s` is a measure mutually singular to `ν` and `f` is a
measurable function such that `μ = s + fν`, then `s = μ.singularPart μ`.

This theorem provides the uniqueness of the `singularPart` in the Lebesgue decomposition theorem,
while `MeasureTheory.Measure.eq_rnDeriv` provides the uniqueness of the
`rnDeriv`. -/
theorem eq_singularPart {s : Measure α} {f : α → ℝ≥0∞} (hf : Measurable f) (hs : s ⟂ₘ ν)
    (hadd : μ = s + ν.withDensity f) : s = μ.singularPart ν

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν s : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
(hf : Measurable f)
(hs : s ⟂ₘ ν)
(hadd : μ = s + ν.withDensity f)


theorem Prefunctor.IsCovering.of_comp_right (hψ : ψ.IsCovering) (hφψ : (φ ⋙q ψ).IsCovering) :
    φ.IsCovering

{U : Type u_3}
[Quiver U]
{V : Type u_1}
[Quiver V]
(φ : U ⥤q V)
{W : Type u_2}
[Quiver W]
(ψ : V ⥤q W)
(hψ : ψ.IsCovering)
(hφψ : (φ ⋙q ψ).IsCovering)


@[to_additive (attr := simp)]
lemma isSquare_one [MulOneClass α] : IsSquare (1 : α)


lemma isTheta_deriv_rpow_const_atTop {p : ℝ} (hp : p ≠ 0) :
    deriv (fun (x : ℝ) => x ^ p) =Θ[atTop] fun x => x ^ (p-1)

(deriv fun x => x ^ p) =Θ[Filter.atTop] fun x => x ^ (p - 1)


@[to_additive]
lemma iCondIndepFun.indepFun_mul_left (hf_indep : iCondIndepFun m' hm' (fun _ ↦ m) f μ)
    (hf_meas : ∀ i, Measurable (f i)) (i j k : ι) (hik : i ≠ k) (hjk : j ≠ k) :
    CondIndepFun m' hm' (f i * f j) (f k) μ

{f : ι → Ω → β}

(hf_indep : ProbabilityTheory.iCondIndepFun m' hm' (fun x => m) f μ)

ProbabilityTheory.CondIndepFun m' hm' (f i * f j) (f k) μ


@[to_additive (attr := simp)]
theorem op_unop (S : Submonoid Mᵐᵒᵖ) : S.unop.op = S

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


@[simp]
theorem map_bot (f : E →ₐ[F] K) :
    IntermediateField.map f ⊥ = ⊥

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
{K : Type u_3}
[Field K]
[Algebra F K]
(f : E →ₐ[F] K)


theorem degree_add_le (p q : R[X]) : degree (p + q) ≤ max (degree p) (degree q)


/-- like `unitInterval.nonneg`, but with the inequality in `I`. -/
theorem nonneg' {t : I} : 0 ≤ t


@[to_additive]
theorem mulTSupport_mul [TopologicalSpace X] [Monoid α] {f g : X → α} :
    (mulTSupport fun x ↦ f x * g x) ⊆ mulTSupport f ∪ mulTSupport g

{X : Type u_1}
{α : Type u_2}
[TopologicalSpace X]
[AddMonoid α]
{f g : X → α}

(tsupport fun x => f x + g x) ⊆ tsupport f ∪ tsupport g


theorem fract_mem_fundamentalDomain (x : E) : fract b x ∈ fundamentalDomain b

{E : Type u_1}
{ι : Type u_2}
{K : Type u_3}
[NormedLinearOrderedField K]
[NormedAddCommGroup E]
[NormedSpace K E]
(b : Basis ι K E)
[FloorRing K]
[Fintype ι]
(x : E)

Zspan.fract b x ∈ Zspan.fundamentalDomain b


theorem rel_perm (hr : BiUnique r) : (Forall₂ r ⇒ Forall₂ r ⇒ (· ↔ ·)) Perm Perm

{α : Type u_1}
{β : Type u_2}
{r : α → β → Prop}
(hr : Relator.BiUnique r)

(List.Forall₂ r ⇒ List.Forall₂ r ⇒ fun x x_1 => x ↔ x_1) List.Perm List.Perm


theorem pi_Ioi_mem_nhds' (ha : ∀ i, a' i < x' i) : Ioi a' ∈ 𝓝 x'

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{ι : Type u_1}
[Finite ι]
{a' x' : ι → α}
[Nonempty ι]
(ha : ∀ (i : ι), a' i < x' i)


@[symm]
theorem symm (h : InvOn f' f s t) : InvOn f f' t s

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


class IncidenceGeometry where
  Point : Type u₁
  Line : Type u₂
  Circle : Type u₃

  between : Point → Point → Point → Prop -- implies colinearity
  onLine : Point → Line → Prop
  onCircle : Point → Circle → Prop
  inCircle : Point → Circle → Prop
  centerCircle : Point → Circle → Prop
  circlesInter : Circle → Circle → Prop

  ne_23_of_between : ∀ {a b c : Point}, between a b c → b ≠ c
  line_unique_of_pts : ∀ {a b : Point}, ∀ {L M : Line},
    a ≠ b → onLine a L → onLine b L → onLine a M → onLine b M → L = M
  onLine_2_of_between : ∀ {a b c : Point}, ∀ {L : Line},
    between a b c → onLine a L → onLine c L → onLine b L
  line_of_pts : ∀ a b, ∃ L, onLine a L ∧ onLine b L
  circle_of_ne : ∀ a b, a ≠ b → ∃ C, centerCircle a C ∧ onCircle b C
  circlesInter_of_onCircle_inCircle :
    ∀ {a b α β}, onCircle b α → onCircle a β → inCircle a α →
    inCircle b β → circlesInter α β
  pts_of_circlesInter : ∀ {α β}, circlesInter α β →
    ∃ a b, a ≠ b ∧ onCircle a α ∧ onCircle a β ∧ onCircle b α ∧ onCircle b β
  inCircle_of_centerCircle : ∀ {a α}, centerCircle a α → inCircle a α

[self : IncidenceGeometry]
{a b : IncidenceGeometry.Point}
{L M : IncidenceGeometry.Line}

a ≠ b →
  IncidenceGeometry.onLine a L →
    IncidenceGeometry.onLine b L → IncidenceGeometry.onLine a M → IncidenceGeometry.onLine b M → L = M


theorem iInf_range' (g : β → α) (f : ι → β) : ⨅ b : range f, g b = ⨅ i, g (f i)

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_5}
[InfSet α]
(g : β → α)
(f : ι → β)


theorem reverseAux_eq (as bs : List α) : reverseAux as bs = reverse as ++ bs


@[simp]
theorem splits_C (a : K) : Splits i (C a)

{K : Type v}
{L : Type w}
[CommRing K]
[Field L]
(i : K →+* L)
(a : K)


/-- The order embedding sending `b` to `a * b`, for some fixed `a`.
See also `OrderIso.mulLeft` when working in an ordered group. -/
@[to_additive (attr := simps!)
      "The order embedding sending `b` to `a + b`, for some fixed `a`.
       See also `OrderIso.addLeft` when working in an additive ordered group."]
def OrderEmbedding.mulLeft {α : Type*} [Mul α] [LinearOrder α]
    [CovariantClass α α (· * ·) (· < ·)] (m : α) : α ↪o α

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


@[to_additive (attr := simp) cmp_sub_zero]
theorem cmp_div_one' [CovariantClass α α (swap (· * ·)) (· ≤ ·)] (a b : α) :
    cmp (a / b) 1 = cmp a b

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


lemma fst_prodMkLeft (δ : Type*) [MeasurableSpace δ] (κ : Kernel α (β × γ)) :
    fst (prodMkLeft δ κ) = prodMkLeft δ (fst κ)

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

(ProbabilityTheory.Kernel.prodMkLeft δ κ).fst = ProbabilityTheory.Kernel.prodMkLeft δ κ.fst


/-- A subset of a topological space is homeomorphic to its image under a homeomorphism.
-/
@[simps!]
def image (e : X ≃ₜ Y) (s : Set X) : s ≃ₜ e '' s

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : X ≃ₜ Y)
(s : Set X)
(y : ↑(⇑e.toEquiv '' s))


protected theorem neg (hf : UnifIntegrable f p μ) : UnifIntegrable (-f) p μ

{f : ι → α → β}

(hf : MeasureTheory.UnifIntegrable f p μ)


theorem eq_divided_by_X_pow_order_Iff_Unit {f : k⟦X⟧} (hf : f ≠ 0) :
    f = divided_by_X_pow_order hf ↔ IsUnit f

{k : Type u_2}
[Field k]
{f : PowerSeries k}
(hf : f ≠ 0)

f = PowerSeries.divided_by_X_pow_order hf ↔ IsUnit f


theorem intrinsicFrontier_subset (hs : IsClosed s) : intrinsicFrontier 𝕜 s ⊆ s

{𝕜 : Type u_1}
{V : Type u_2}
{P : Type u_5}
[Ring 𝕜]
[AddCommGroup V]
[Module 𝕜 V]
[TopologicalSpace P]
[AddTorsor V P]
{s : Set P}
(hs : IsClosed s)


@[simp]
theorem sInf_apply {Ss : Set (Sieve X)} {Y} (f : Y ⟶ X) :
    sInf Ss f ↔ ∀ (S : Sieve X) (_ : S ∈ Ss), S f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X : C}
{Ss : Set (CategoryTheory.Sieve X)}
{Y : C}
(f : Y ⟶ X)

(sInf Ss).arrows f ↔ ∀ S ∈ Ss, S.arrows f


theorem lcm_eq_left_iff [NormalizedGCDMonoid α] (a b : α) (h : normalize a = a) :
    lcm a b = a ↔ b ∣ a

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
(a b : α)
(h : normalize a = a)


@[to_additive]
theorem relindex_eq_zero_of_le_left (hHK : H ≤ K) (hKL : K.relindex L = 0) : H.relindex L = 0

{G : Type u_1}
[Group G]
{H K L : Subgroup G}
(hHK : H ≤ K)
(hKL : K.relindex L = 0)


protected theorem cauchy_iff {f : Filter α} :
    Cauchy f ↔ NeBot f ∧ ∀ ε > 0, ∃ t ∈ f, ∀ x ∈ t, ∀ y ∈ t, dist x y < ε

{α : Type u}
[PseudoMetricSpace α]
{f : Filter α}

Cauchy f ↔ f.NeBot ∧ ∀ ε > 0, ∃ t ∈ f, ∀ x ∈ t, ∀ y ∈ t, dist x y < ε


theorem isNoetherianRing_of_fg {S : Subalgebra R A} (HS : S.FG) [IsNoetherianRing R] :
    IsNoetherianRing S

{R : Type u}
{A : Type v}
[CommRing R]
[CommRing A]
[Algebra R A]
{S : Subalgebra R A}
(HS : S.FG)
[IsNoetherianRing R]


theorem SOppSide.trans_wSameSide {s : AffineSubspace R P} {x y z : P} (hxy : s.SOppSide x y)
    (hyz : s.WSameSide y z) : s.WOppSide x z

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y z : P}
(hxy : s.SOppSide x y)
(hyz : s.WSameSide y z)


@[reassoc (attr := simp), elementwise (attr := simp)]
theorem kernelSubobject_arrow' :
    (kernelSubobjectIso f).inv ≫ (kernelSubobject f).arrow = kernel.ι f

(CategoryTheory.Limits.kernelSubobjectIso f).inv ≫ (CategoryTheory.Limits.kernelSubobject f).arrow =
  CategoryTheory.Limits.kernel.ι f


lemma hasSmallLocalizedHom_iff :
    HasSmallLocalizedHom.{w} W X Y ↔ Small.{w} (L.obj X ⟶ L.obj Y)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
(W : CategoryTheory.MorphismProperty C)
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(L : CategoryTheory.Functor C D)
[L.IsLocalization W]
{X Y : C}

CategoryTheory.Localization.HasSmallLocalizedHom W X Y ↔ Small.{w, v₂} (L.obj X ⟶ L.obj Y)


/-- If `E / F` is an infinite algebraic extension, then there exists an intermediate field
`L / F` with arbitrarily large finite extension degree. -/
theorem exists_lt_finrank_of_infinite_dimensional
    [Algebra.IsAlgebraic F E] (hnfd : ¬ FiniteDimensional F E) (n : ℕ) :
    ∃ L : IntermediateField F E, FiniteDimensional F L ∧ n < finrank F L

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
[Algebra.IsAlgebraic F E]
(hnfd : ¬FiniteDimensional F E)
(n : ℕ)

∃ L, FiniteDimensional F ↥L ∧ n < FiniteDimensional.finrank F ↥L


@[ext]
theorem eq_of_forall_toMeasure_apply_eq (μ ν : FiniteMeasure Ω)
    (h : ∀ s : Set Ω, MeasurableSet s → (μ : Measure Ω) s = (ν : Measure Ω) s) : μ = ν

(h : ∀ (s : Set Ω), MeasurableSet s → ↑μ s = ↑ν s)


theorem subsingleton_iff_eq_bot : Subsingleton p ↔ p = ⊥

{R : Type u_1}
{M : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{p : Submodule R M}


@[simp]
lemma eval₂_ofNat {S : Type*} [Semiring S] (n : ℕ) [n.AtLeastTwo] (f : R →+* S) (a : S) :
    (no_index (OfNat.ofNat n : R[X])).eval₂ f a = OfNat.ofNat n

{R : Type u}
[Semiring R]
{S : Type u_1}
[Semiring S]
(n : ℕ)
[n.AtLeastTwo]
(f : R →+* S)
(a : S)

Polynomial.eval₂ f a (OfNat.ofNat n) = OfNat.ofNat n


@[to_additive (attr := simp)]
theorem traverse_pure' : traverse F ∘ pure = fun x ↦ (pure <$> F x : m (FreeMagma β))

{α β : Type u}
{m : Type u → Type u}
[Applicative m]
(F : α → m β)

traverse F ∘ pure = fun x => pure <$> F x


@[to_additive (attr := simp)]
theorem comap_map_comap {S : Subsemigroup N} {f : M →ₙ* N} :
    ((S.comap f).map f).comap f = S.comap f

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
{S : Subsemigroup N}
{f : M →ₙ* N}

Subsemigroup.comap f (Subsemigroup.map f (Subsemigroup.comap f S)) = Subsemigroup.comap f S


theorem preimage_iUnion₂ {f : α → β} {s : ∀ i, κ i → Set β} :
    (f ⁻¹' ⋃ (i) (j), s i j) = ⋃ (i) (j), f ⁻¹' s i j

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
{κ : ι → Sort u_7}
{f : α → β}
{s : (i : ι) → κ i → Set β}

f ⁻¹' ⋃ i, ⋃ j, s i j = ⋃ i, ⋃ j, f ⁻¹' s i j


lemma ofCauchy_natCast (n : ℕ) : (⟨n⟩ : ℝ) = n


theorem ContDiffOn.sin {n} (hf : ContDiffOn ℝ n f s) : ContDiffOn ℝ n (fun x => Real.sin (f x)) s

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


theorem Filter.HasBasis.biInter_biUnion_ball {p : ι → Prop} {U : ι → Set (α × α)}
    (h : HasBasis (𝓤 α) p U) (s : Set α) :
    (⋂ (i) (_ : p i), ⋃ x ∈ s, ball x (U i)) = closure s

{α : Type ua}
{ι : Sort u_1}
[UniformSpace α]
{p : ι → Prop}
{U : ι → Set (α × α)}
(h : (𝓤 α).HasBasis p U)
(s : Set α)

⋂ i, ⋂ (_ : p i), ⋃ x ∈ s, UniformSpace.ball x (U i) = closure s


@[to_additive]
theorem map_mul_eq_one [MonoidHomClass F M N] (f : F) {a b : M} (h : a * b = 1) :
    f a * f b = 1

{M : Type u_4}
{N : Type u_5}
{F : Type u_9}
[MulOneClass M]
[MulOneClass N]
[FunLike F M N]
[MonoidHomClass F M N]
(f : F)
{a b : M}
(h : a * b = 1)


/-- The distance to a set is controlled by the Hausdorff distance. -/
theorem infDist_le_hausdorffDist_of_mem (hx : x ∈ s) (fin : hausdorffEdist s t ≠ ⊤) :
    infDist x t ≤ hausdorffDist s t

{α : Type u}
[PseudoMetricSpace α]
{s t : Set α}
{x : α}
(hx : x ∈ s)
(fin : EMetric.hausdorffEdist s t ≠ ⊤)

Metric.infDist x t ≤ Metric.hausdorffDist s t


lemma dvd_ceilRoot_pow (hn : n ≠ 0) : a ∣ ceilRoot n a ^ n


lemma tendsto_inv₀_cobounded' : Tendsto Inv.inv (cobounded α) (𝓝[≠] 0)

Filter.Tendsto Inv.inv (Bornology.cobounded α) (𝓝[≠] 0)


/-- If `A` is an `R`-algebra and `S` is an `A`-algebra, both finitely presented, then `S` is
  finitely presented as `R`-algebra. -/
theorem trans [Algebra A B] [IsScalarTower R A B] [FinitePresentation R A]
    [FinitePresentation A B] : FinitePresentation R B

(R : Type w₁)
(A : Type w₂)
(B : Type w₃)
[CommRing R]
[CommRing A]
[Algebra R A]
[CommRing B]
[Algebra R B]
[Algebra A B]
[IsScalarTower R A B]
[Algebra.FinitePresentation R A]
[Algebra.FinitePresentation A B]


@[to_additive]
lemma piecewise_smul [∀ i, SMul M (α i)] (s : Set ι) [∀ i, Decidable (i ∈ s)]
    (c : M) (f₁ g₁ : ∀ i, α i) : s.piecewise (c • f₁) (c • g₁) = c • s.piecewise f₁ g₁

{ι : Type u_1}
{M : Type u_2}
{α : ι → Type u_4}
[(i : ι) → VAdd M (α i)]
(s : Set ι)
[(i : ι) → Decidable (i ∈ s)]
(c : M)
(f₁ g₁ : (i : ι) → α i)

s.piecewise (c +ᵥ f₁) (c +ᵥ g₁) = c +ᵥ s.piecewise f₁ g₁


protected theorem UniformInducing.uniformInducing_comp_iff {f : α → β} {g : β → γ}
    (hg : UniformInducing g) : UniformInducing (g ∘ f) ↔ UniformInducing f

{α : Type u}
{β : Type v}
{γ : Type w}
[UniformSpace α]
[UniformSpace β]
[UniformSpace γ]
{f : α → β}
{g : β → γ}
(hg : UniformInducing g)


@[simp]
theorem mem_sUnion {x : α} {S : Set (Set α)} : x ∈ ⋃₀ S ↔ ∃ t ∈ S, x ∈ t

x ∈ ⋃₀ S ↔ ∃ t, t ∈ S ∧ x ∈ t


theorem cos_int_mul_two_pi_add_pi (n : ℤ) : cos (n * (2 * π) + π) = -1

Real.cos (↑n * (2 * Real.pi) + Real.pi) = -1


lemma full_whiskeringLeft (L : C ⥤ D) (W) [L.IsLocalization W] (E : Type*) [Category E] :
    ((whiskeringLeft C D E).obj L).Full

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_5, u_1} C]
[CategoryTheory.Category.{u_6, u_2} D]
(L : CategoryTheory.Functor C D)
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
(E : Type u_4)
[CategoryTheory.Category.{u_7, u_4} E]

((CategoryTheory.whiskeringLeft C D E).obj L).Full


theorem option_orElse : Primrec₂ ((· <|> ·) : Option α → Option α → Option α)

Primrec₂ fun x x_1 => HOrElse.hOrElse x fun x => x_1


@[to_additive]
theorem exponent_pos_of_exists (n : ℕ) (hpos : 0 < n) (hG : ∀ g : G, g ^ n = 1) :
    0 < exponent G

{G : Type u}
[AddMonoid G]
(n : ℕ)
(hpos : 0 < n)
(hG : ∀ (g : G), n • g = 0)


/-- The canonical isomorphism `G/⊥ ≃* G`. -/
@[to_additive (attr := simps!) "The canonical isomorphism `G/⊥ ≃+ G`."]
def quotientBot : G ⧸ (⊥ : Subgroup G) ≃* G

{G : Type u}
[AddGroup G]
(a : G ⧸ (AddMonoidHom.id G).ker)

QuotientAddGroup.quotientBot a = (QuotientAddGroup.kerLift (AddMonoidHom.id G)) a


@[measurability]
protected theorem iUnion [PseudoMetrizableSpace β] {s : ι → Set α}
    (h : ∀ i, AEStronglyMeasurable f (μ.restrict (s i))) :
    AEStronglyMeasurable f (μ.restrict (⋃ i, s i))

(h : ∀ (i : ι), MeasureTheory.AEStronglyMeasurable f (μ.restrict (s i)))

MeasureTheory.AEStronglyMeasurable f (μ.restrict (⋃ i, s i))


theorem IsSubordinate.diam_le [Fintype ι] {π : TaggedPrepartition I} (h : π.IsSubordinate r)
    (hJ : J ∈ π.boxes) : diam (Box.Icc J) ≤ 2 * r (π.tag J)

{ι : Type u_1}
{I J : BoxIntegral.Box ι}
{r : (ι → ℝ) → ↑(Set.Ioi 0)}
[Fintype ι]
{π : BoxIntegral.TaggedPrepartition I}
(h : π.IsSubordinate r)
(hJ : J ∈ π.boxes)

Metric.diam (BoxIntegral.Box.Icc J) ≤ 2 * ↑(r (π.tag J))


theorem ContinuousOn.rpow_const (hf : ContinuousOn f s) (h : ∀ x ∈ s, f x ≠ 0 ∨ 0 ≤ p) :
    ContinuousOn (fun x => f x ^ p) s

{α : Type u_1}
[TopologicalSpace α]
{f : α → ℝ}
{s : Set α}
{p : ℝ}
(hf : ContinuousOn f s)
(h : ∀ x ∈ s, f x ≠ 0 ∨ 0 ≤ p)


@[to_additive]
private lemma card_mul_pow_le (hAB : ∀ A' ⊆ A, (A * B).card * A'.card ≤ (A' * B).card * A.card)
    (n : ℕ) : (A * B ^ n).card ≤ ((A * B).card / A.card : ℚ≥0) ^ n * A.card

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


@[to_additive (attr := simp)] lemma smul_swap : (a • x).swap = a • x.swap

{M : Type u_1}
{α : Type u_5}
{β : Type u_6}
[VAdd M α]
[VAdd M β]
(a : M)
(x : α × β)


theorem submatrix_updateRow_equiv [DecidableEq l] [DecidableEq m] (A : Matrix m n α) (i : m)
    (r : n → α) (e : l ≃ m) (f : o ≃ n) :
    (A.updateRow i r).submatrix e f = updateRow (A.submatrix e f) (e.symm i) fun i => r (f i)

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
[DecidableEq l]
[DecidableEq m]
(A : Matrix m n α)
(i : m)
(r : n → α)
(e : l ≃ m)
(f : o ≃ n)

(A.updateRow i r).submatrix ⇑e ⇑f = (A.submatrix ⇑e ⇑f).updateRow (e.symm i) fun i => r (f i)


@[simp]
theorem innerSL_apply_coe (v : E) : ⇑(innerSL 𝕜 v) = fun w => ⟪v, w⟫

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


/-- If `R` is a presieve in the grothendieck topology on `Opens X`, the covering family associated
to `R` really is _covering_, i.e. the union of all open sets equals `U`.
-/
theorem iSup_eq_of_mem_grothendieck (hR : Sieve.generate R ∈ Opens.grothendieckTopology X U) :
    iSup (coveringOfPresieve U R) = U

(hR : CategoryTheory.Sieve.generate R ∈ (Opens.grothendieckTopology ↑X).sieves U)

iSup (TopCat.Presheaf.coveringOfPresieve U R) = U


/-- The `lintegral` transforms appropriately under a measurable equivalence `g : α ≃ᵐ β`.
(Compare `lintegral_map`, which applies to a wider class of functions `g : α → β`, but requires
measurability of the function being integrated.) -/
theorem lintegral_map_equiv [MeasurableSpace β] (f : β → ℝ≥0∞) (g : α ≃ᵐ β) :
    ∫⁻ a, f a ∂map g μ = ∫⁻ a, f (g a) ∂μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasurableSpace β]
(f : β → ℝ≥0∞)
(g : α ≃ᵐ β)

∫⁻ (a : β), f a ∂MeasureTheory.Measure.map (⇑g) μ = ∫⁻ (a : α), f (g a) ∂μ


theorem le_rpow_inv_iff {x y : ℝ≥0∞} {z : ℝ} (hz : 0 < z) : x ≤ y ^ z⁻¹ ↔ x ^ z ≤ y


theorem jacobiTheta_two_add (τ : ℂ) : jacobiTheta (2 + τ) = jacobiTheta τ


theorem normBound_pos : 0 < normBound abv bS

{R : Type u_1}
{S : Type u_2}
[EuclideanDomain R]
[CommRing S]
[IsDomain S]
[Algebra R S]
(abv : AbsoluteValue R ℤ)
{ι : Type u_5}
[DecidableEq ι]
[Fintype ι]
(bS : Basis ι R S)


theorem IsTopologicalBasis.isOpen_iff {s : Set α} {b : Set (Set α)} (hb : IsTopologicalBasis b) :
    IsOpen s ↔ ∀ a ∈ s, ∃ t ∈ b, a ∈ t ∧ t ⊆ s

(hb : TopologicalSpace.IsTopologicalBasis b)


theorem adjoin_eq_algebra_adjoin (inv_mem : ∀ x ∈ Algebra.adjoin F S, x⁻¹ ∈ Algebra.adjoin F S) :
    (adjoin F S).toSubalgebra = Algebra.adjoin F S

(IntermediateField.adjoin F S).toSubalgebra = Algebra.adjoin F S


/-- Any presheaf is a sheaf for the bottom (trivial) grothendieck topology. -/
theorem isSheaf_bot : IsSheaf (⊥ : GrothendieckTopology C) P

{P : CategoryTheory.Functor Cᵒᵖ (Type w)}


/-- The map `Square Cᵒᵖ → Square C` which switches `X₁` and `X₃`, but
does not move `X₂` and `X₃`. -/
@[simps]
protected def unop (sq : Square Cᵒᵖ) : Square C

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


theorem minNatAbs_eq_nonzero_iff (xs : List Int) (w : z ≠ 0) :
    xs.minNatAbs = z ↔ (∃ y ∈ xs, y.natAbs = z) ∧ (∀ y ∈ xs, z ≤ y.natAbs ∨ y = 0)

xs.minNatAbs = z ↔ (∃ y, y ∈ xs ∧ y.natAbs = z) ∧ ∀ (y : Int), y ∈ xs → z ≤ y.natAbs ∨ y = 0


theorem NormedAddGroupHom.completion_neg (f : NormedAddGroupHom G H) :
    (-f).completion = -f.completion

{G : Type u_1}
[SeminormedAddCommGroup G]
{H : Type u_2}
[SeminormedAddCommGroup H]
(f : NormedAddGroupHom G H)


@[simp, norm_cast, nolint simpNF]
theorem coe_pos : (0 : ℚ) < q ↔ 0 < q


theorem noetherianSpace_set_iff (s : Set α) :
    NoetherianSpace s ↔ ∀ t, t ⊆ s → IsCompact t

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

TopologicalSpace.NoetherianSpace ↑s ↔ ∀ t ⊆ s, IsCompact t


/-- If `IsCyclotomicExtension ∅ A B`, then the image of `A` in `B` equals `B`. -/
theorem empty [h : IsCyclotomicExtension ∅ A B] : (⊥ : Subalgebra A B) = ⊤

(A : Type u)
(B : Type v)
[CommRing A]
[CommRing B]
[Algebra A B]
[h : IsCyclotomicExtension ∅ A B]


theorem one_le_nnnorm_one (β) [NormedRing β] [Nontrivial β] : 1 ≤ ‖(1 : β)‖₊

(β : Type u_5)
[NormedRing β]
[Nontrivial β]


theorem le_div_self (ha : 0 ≤ a) (hb₀ : 0 < b) (hb₁ : b ≤ 1) : a ≤ a / b

{α : Type u_2}
[LinearOrderedSemifield α]
{a b : α}
(ha : 0 ≤ a)
(hb₀ : 0 < b)
(hb₁ : b ≤ 1)


lemma rank_le_card : rank R L ≤ Fintype.card ι

(R : Type u_1)
(L : Type u_3)
{ι : Type u_5}
[CommRing R]
[Nontrivial R]
[LieRing L]
[LieAlgebra R L]
[Module.Finite R L]
[Module.Free R L]
[Fintype ι]
(b : Basis ι R L)


lemma bddAbove_range_prod {F : ι → α × β} :
    BddAbove (range F) ↔ BddAbove (range <| Prod.fst ∘ F) ∧ BddAbove (range <| Prod.snd ∘ F)

{ι : Sort x}
{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{F : ι → α × β}

BddAbove (Set.range F) ↔ BddAbove (Set.range (Prod.fst ∘ F)) ∧ BddAbove (Set.range (Prod.snd ∘ F))


theorem map_smul (r : R) (x : ((i : ι) → Ms i) ⧸ pi Set.univ p) :
    toFun p (r • x) = (RingHom.id R r) • toFun p x

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

Submodule.quotientPi_aux.toFun p (r • x) = (RingHom.id R) r • Submodule.quotientPi_aux.toFun p x


lemma strictMono_castAdd (m) : StrictMono (castAdd m : Fin n → Fin (n + m))


@[simp] theorem map_inj_left {f g : α → β} : map f l = map g l ↔ ∀ a ∈ l, f a = g a

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

List.map f l = List.map g l ↔ ∀ (a : α), a ∈ l → f a = g a


/-- Continuity at a point can be read under right composition with a partial homeomorphism, if the
point is in its target -/
theorem continuousAt_iff_continuousAt_comp_right {f : Y → Z} {x : Y} (h : x ∈ e.target) :
    ContinuousAt f x ↔ ContinuousAt (f ∘ e) (e.symm x)

{X : Type u_1}
{Y : Type u_3}
{Z : Type u_5}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(e : PartialHomeomorph X Y)
{f : Y → Z}
{x : Y}
(h : x ∈ e.target)

ContinuousAt f x ↔ ContinuousAt (f ∘ ↑e) (↑e.symm x)


@[simp]
theorem integral_cos_pow_three :
    ∫ x in a..b, cos x ^ 3 = sin b - sin a - (sin b ^ 3 - sin a ^ 3) / 3

∫ (x : ℝ) in a..b, Real.cos x ^ 3 = Real.sin b - Real.sin a - (Real.sin b ^ 3 - Real.sin a ^ 3) / 3


/-- The category of cocones on `F` is just the comma category `(F ↓ Δ)`, where `Δ` is the constant
    functor. -/
@[simps! (config := { notRecursive := [`PLift, `ULift] })]
def Cocone.equivStructuredArrow (F : J ⥤ C) : Cocone F ≌ StructuredArrow F (const J)

(X : CategoryTheory.StructuredArrow F (CategoryTheory.Functor.const J))

((CategoryTheory.Limits.Cocone.equivStructuredArrow F).counitIso.hom.app X).right =
  CategoryTheory.CategoryStruct.id X.right


@[simp]
theorem T_mul (n : ℤ) (f : R[T;T⁻¹]) : T n * f = f * T n

{R : Type u_1}
[Semiring R]
(n : ℤ)
(f : R[T;T⁻¹])

LaurentPolynomial.T n * f = f * LaurentPolynomial.T n


@[simp]
theorem cast_le_ofNat : (m : α) ≤ (no_index (OfNat.ofNat n)) ↔ m ≤ OfNat.ofNat n

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


@[simp]
theorem log_zero_right (b : ℕ) : log b (0 : R) = 0

{R : Type u_1}
[LinearOrderedSemifield R]
[FloorSemiring R]
(b : ℕ)


theorem surjective_head? : Surjective (@head? α)


@[simp]
theorem map_neg (x : V) : e (-x) = e x

{𝕜 : Type u_1}
{V : Type u_2}
[NormedField 𝕜]
[AddCommGroup V]
[Module 𝕜 V]
(e : ENorm 𝕜 V)
(x : V)


theorem multiplicity_finite_of_degree_pos_of_monic (hp : (0 : WithBot ℕ) < degree p) (hmp : Monic p)
    (hq : q ≠ 0) : multiplicity.Finite p q

{R : Type u}
[Semiring R]
{p q : R[X]}
(hp : 0 < p.degree)
(hmp : p.Monic)
(hq : q ≠ 0)


/--
Linear maps into a character module are exactly characters of the tensor product.
-/
@[simps!] noncomputable def homEquiv :
    (A →ₗ[R] CharacterModule B) ≃ₗ[R] CharacterModule (A ⊗[R] B)

(a : CharacterModule (TensorProduct R A B))

∀ (x : A) (a_1 : B), ((CharacterModule.homEquiv.symm a) x) a_1 = a (x ⊗ₜ[R] a_1)


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


theorem add_le_mul_of_left_le_right [ZeroLEOneClass α] [NeZero (R := α) 1]
    [MulPosStrictMono α] [CovariantClass α α (· + ·) (· ≤ ·)]
    (a2 : 2 ≤ a) (ab : a ≤ b) : a + b ≤ a * b


theorem ite_inter (t s₁ s₂ s : Set α) : t.ite (s₁ ∩ s) (s₂ ∩ s) = t.ite s₁ s₂ ∩ s


theorem mem_roots_iff [IsDomain R] (h0 : P.toPoly ≠ 0) (x : R) :
    x ∈ P.roots ↔ P.a * x ^ 3 + P.b * x ^ 2 + P.c * x + P.d = 0

{R : Type u_1}
{P : Cubic R}
[CommRing R]
[IsDomain R]
(h0 : P.toPoly ≠ 0)
(x : R)


theorem countP_eq_zero : countP p l = 0 ↔ ∀ a ∈ l, ¬p a

{α : Type u_1}
(p : α → Bool)
{l : List α}

List.countP p l = 0 ↔ ∀ (a : α), a ∈ l → ¬p a = true


lemma guitartExact_iff_isConnected_rightwards :
    w.GuitartExact ↔ ∀ {X₂ : C₂} {X₃ : C₃} (g : R.obj X₂ ⟶ B.obj X₃),
      IsConnected (w.StructuredArrowRightwards g)

{C₁ : Type u₁}
{C₂ : Type u₂}
{C₃ : Type u₃}
{C₄ : Type u₄}
[CategoryTheory.Category.{v₁, u₁} C₁]
[CategoryTheory.Category.{v₂, u₂} C₂]
[CategoryTheory.Category.{v₃, u₃} C₃]
[CategoryTheory.Category.{v₄, u₄} C₄]
{T : CategoryTheory.Functor C₁ C₂}
{L : CategoryTheory.Functor C₁ C₃}
{R : CategoryTheory.Functor C₂ C₄}
{B : CategoryTheory.Functor C₃ C₄}
(w : CategoryTheory.TwoSquare T L R B)

w.GuitartExact ↔
  ∀ {X₂ : C₂} {X₃ : C₃} (g : R.obj X₂ ⟶ B.obj X₃), CategoryTheory.IsConnected (w.StructuredArrowRightwards g)


theorem mul_mod (a b n : Nat) : a * b % n = (a % n) * (b % n) % n


ZetaAsymptotics.term_sum s N =
  1 / (s - 1) * (1 - 1 / (↑N + 1) ^ (s - 1)) - 1 / s * (∑ n ∈ Finset.range N, 1 / (↑n + 1) ^ s - ↑N / (↑N + 1) ^ s)


theorem norm_integral_le_lintegral_norm (f : α → G) :
    ‖∫ a, f a ∂μ‖ ≤ ENNReal.toReal (∫⁻ a, ENNReal.ofReal ‖f a‖ ∂μ)

{α : Type u_1}
{G : Type u_5}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(f : α → G)

‖∫ (a : α), f a ∂μ‖ ≤ (∫⁻ (a : α), ENNReal.ofReal ‖f a‖ ∂μ).toReal


theorem nnnorm_fderiv_norm_rpow_le {f : F → E} (hf : Differentiable ℝ f)
    {x : F} {p : ℝ≥0} (hp : 1 < p) :
    ‖fderiv ℝ (fun x ↦ ‖f x‖ ^ (p : ℝ)) x‖₊ ≤ p * ‖f x‖₊ ^ ((p : ℝ) - 1) * ‖fderiv ℝ f x‖₊

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{f : F → E}
(hf : Differentiable ℝ f)
{x : F}
{p : NNReal}
(hp : 1 < p)

‖fderiv ℝ (fun x => ‖f x‖ ^ ↑p) x‖₊ ≤ p * ‖f x‖₊ ^ (↑p - 1) * ‖fderiv ℝ f x‖₊


theorem ne_dioph : Dioph {v | f v ≠ g v}

{α : Type}
{f g : (α → ℕ) → ℕ}
(df : Dioph.DiophFn f)
(dg : Dioph.DiophFn g)


lemma setLIntegral_withDensity_eq_lintegral_mul₀' {μ : Measure α} {f : α → ℝ≥0∞}
    (hf : AEMeasurable f μ) {g : α → ℝ≥0∞} (hg : AEMeasurable g (μ.withDensity f))
    {s : Set α} (hs : MeasurableSet s) :
    ∫⁻ a in s, g a ∂μ.withDensity f = ∫⁻ a in s, (f * g) a ∂μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
(hf : AEMeasurable f μ)
{g : α → ℝ≥0∞}
(hg : AEMeasurable g (μ.withDensity f))
{s : Set α}
(hs : MeasurableSet s)

∫⁻ (a : α) in s, g a ∂μ.withDensity f = ∫⁻ (a : α) in s, (f * g) a ∂μ


theorem snd_iso_of_left_embedding_range_subset {X Y S : TopCat} {f : X ⟶ S} (hf : Embedding f)
    (g : Y ⟶ S) (H : Set.range g ⊆ Set.range f) : IsIso (pullback.snd f g)

{X Y S : TopCat}
{f : X ⟶ S}
(hf : Embedding ⇑f)
(g : Y ⟶ S)
(H : Set.range ⇑g ⊆ Set.range ⇑f)

CategoryTheory.IsIso (CategoryTheory.Limits.pullback.snd f g)


theorem lim_mem_Icc (c : CU P) (x : X) : c.lim x ∈ Icc (0 : ℝ) 1

{X : Type u_1}
[TopologicalSpace X]
{P : Set X → Prop}
(c : Urysohns.CU P)
(x : X)


theorem cutExpand_singleton_singleton {x' x} (h : r x' x) : CutExpand r {x'} {x}

{α : Type u_1}
{r : α → α → Prop}
{x' x : α}
(h : r x' x)


lemma ContextFreeGrammar.mem_reverse_language_iff_reverse_mem_language (g : ContextFreeGrammar T)
    (w : List T) :
    w ∈ g.reverse.language ↔ w.reverse ∈ g.language

{T : Type uT}
(g : ContextFreeGrammar T)
(w : List T)


@[simp]
lemma Hom.sub_tmul (f g : Hom P P') (r x) :
    f.sub g (r ⊗ₜ .D _ _ x) = r • Cotangent.mk (f.subToKer g x)

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Generators R S}
{R' : Type u'}
{S' : Type v'}
[CommRing R']
[CommRing S']
[Algebra R' S']
{P' : Algebra.Generators R' S'}
[Algebra R R']
[Algebra S S']
[Algebra R S']
[IsScalarTower R R' S']
[IsScalarTower R S S']
(f g : P.Hom P')
(r : S)
(x : P.Ring)

(f.sub g) (r ⊗ₜ[P.Ring] (KaehlerDifferential.D R P.Ring) x) = r • Algebra.Generators.Cotangent.mk ((f.subToKer g) x)


/-- `f : ℂ → E` is entire iff it's differentiable -/
theorem analyticOn_univ_iff_differentiable {f : ℂ → E} :
    AnalyticOn ℂ f univ ↔ Differentiable ℂ f

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
[CompleteSpace E]
{f : ℂ → E}

AnalyticOn ℂ f Set.univ ↔ Differentiable ℂ f


@[continuity, fun_prop]
protected theorem continuous_aeval : Continuous fun x : A => aeval x p

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[TopologicalSpace A]
[TopologicalSemiring A]
(p : Polynomial R)

Continuous fun x => (Polynomial.aeval x) p


@[simp]
theorem LeftExactFunctor.forget_map {F G : C ⥤ₗ D} (α : F ⟶ G) :
    (LeftExactFunctor.forget C D).map α = α

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

(CategoryTheory.LeftExactFunctor.forget C D).map α = α


@[to_additive (attr := simp)]
theorem lift_comp_swap (f : M →* P) (g : N →* P) : (lift f g).comp (swap N M) = lift g f

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[MulOneClass M]
[MulOneClass N]
[Monoid P]
(f : M →* P)
(g : N →* P)

(Monoid.Coprod.lift f g).comp (Monoid.Coprod.swap N M) = Monoid.Coprod.lift g f


@[to_additive min_lt_of_add_lt_two_nsmul]
theorem min_lt_of_mul_lt_sq {a b c : M} (h : a * b < c ^ 2) : min a b < c

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

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


theorem biSup_mono {p q : ι → Prop} (hpq : ∀ i, p i → q i) :
    ⨆ (i) (_ : p i), f i ≤ ⨆ (i) (_ : q i), f i

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

⨆ i, ⨆ (_ : p i), f i ≤ ⨆ i, ⨆ (_ : q i), f i


private theorem colimitModule.one_smul (x : (M F)) : (1 : R) • x = x

{R : Type u}
[Ring R]
{J : Type v}
[CategoryTheory.SmallCategory J]
[CategoryTheory.IsFiltered J]
(F : J ⥤ ModuleCatMax R)
(x : ↑(ModuleCat.FilteredColimits.M F))


theorem head_mem {l : List α} : ∀ (h : l ≠ nil), l.head h ∈ l


@[to_additive (attr := simp, aesop safe apply (rule_sets := [finsetNonempty]))]
theorem smul_nonempty_iff : (s • t).Nonempty ↔ s.Nonempty ∧ t.Nonempty

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


@[simp]
theorem not_ofNat_lt_one : ¬(no_index (OfNat.ofNat n : α)) < 1

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


@[simp, norm_cast]
theorem coe_le_coe {f g : Ultrafilter α} : (f : Filter α) ≤ g ↔ f = g


theorem of_int_div (m : ℤ) (h : Irrational (m / x)) : Irrational x

{x : ℝ}
(m : ℤ)
(h : Irrational (↑m / x))


theorem le_congr {x₁ y₁ x₂ y₂ : PGame} (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) : x₁ ≤ y₁ ↔ x₂ ≤ y₂

{x₁ y₁ x₂ y₂ : SetTheory.PGame}
(hx : x₁ ≈ x₂)
(hy : y₁ ≈ y₂)

x₁ ≤ y₁ ↔ x₂ ≤ y₂


theorem neighborSet_union_compl_neighborSet_eq (G : SimpleGraph V) (v : V) :
    G.neighborSet v ∪ Gᶜ.neighborSet v = {v}ᶜ

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


@[to_additive top_prod]
theorem top_prod (H : Subgroup N) : (⊤ : Subgroup G).prod H = H.comap (MonoidHom.snd G N)

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

⊤.prod H = AddSubgroup.comap (AddMonoidHom.snd G N) H


lemma card_le_card_of_injOn (f : α → β) (hf : ∀ a ∈ s, f a ∈ t) (f_inj : (s : Set α).InjOn f) :
    s.card ≤ t.card

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{t : Finset β}
(f : α → β)
(hf : ∀ a ∈ s, f a ∈ t)
(f_inj : Set.InjOn f ↑s)


/-- Bijection between a subalgebra `S` and `MulOpposite` of its opposite. -/
@[simps!]
def algEquivOpMop (S : Subalgebra R A) : S ≃ₐ[R] (S.op)ᵐᵒᵖ

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R A)

∀ (a : (↥S.op)ᵐᵒᵖ), ↑(S.algEquivOpMop.symm a) = MulOpposite.unop ↑(MulOpposite.unop a)


@[to_additive (attr := simp)]
theorem map_comp_inl (f : M →* M') (g : N →* N') : (map f g).comp inl = inl.comp f

{M : Type u_1}
{N : Type u_2}
{M' : Type u_3}
{N' : Type u_4}
[MulOneClass M]
[MulOneClass N]
[MulOneClass M']
[MulOneClass N']
(f : M →* M')
(g : N →* N')

(Monoid.Coprod.map f g).comp Monoid.Coprod.inl = Monoid.Coprod.inl.comp f


@[to_additive (attr := ext)]
theorem ext (h : ∀ a, f a = g a) : f = g

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
[MulOneClass α]
[MulOneClass β]
{f g : α →*o β}
(h : ∀ (a : α), f a = g a)


[(i : ι) → SeminormedAddCommGroup (E i)]


@[to_additive]
theorem Commute.pi {x y : ∀ i, f i} (h : ∀ i, Commute (x i) (y i)) : Commute x y

{I : Type u}
{f : I → Type v}
[(i : I) → Mul (f i)]
{x y : (i : I) → f i}
(h : ∀ (i : I), Commute (x i) (y i))


/-- The object `X ⊗ Y` in the `Dial C` category just tuples the left and right components. -/
@[simps] def tensorObj (X Y : Dial C) : Dial C


@[gcongr]
protected theorem add (h₁ : a ≡ b [MOD n]) (h₂ : c ≡ d [MOD n]) : a + c ≡ b + d [MOD n]

{n a b c d : ℕ}
(h₁ : a ≡ b [MOD n])
(h₂ : c ≡ d [MOD n])


/-- The multicospan associated to a cover `S : J.Cover X` and a presheaf of the form `P ⋙ F`
is isomorphic to the composition of the multicospan associated to `S` and `P`,
composed with `F`. -/
@[simps!]
def multicospanComp : (S.index (P ⋙ F)).multicospan ≅ (S.index P).multicospan ⋙ F

{J : CategoryTheory.GrothendieckTopology C}

∀ (X_1 : CategoryTheory.Limits.WalkingMulticospan (S.index (P.comp F)).fstTo (S.index (P.comp F)).sndTo),
  (CategoryTheory.GrothendieckTopology.Cover.multicospanComp F P S).hom.app X_1 =
    (match X_1 with
      | CategoryTheory.Limits.WalkingMulticospan.left a => CategoryTheory.Iso.refl (F.obj (P.obj (Opposite.op a.Y)))
      | CategoryTheory.Limits.WalkingMulticospan.right b =>
        CategoryTheory.Iso.refl (F.obj (P.obj (Opposite.op b.r.Z)))).hom


@[simp]
theorem length_rotate (l : List α) (n : ℕ) : (l.rotate n).length = l.length


/-- An AddSubgroup is normal if whenever `n ∈ H`, then `g + n - g ∈ H` for every `g : G` -/
structure Normal (H : AddSubgroup A) : Prop where
  /-- `N` is closed under additive conjugation -/
  conj_mem : ∀ n, n ∈ H → ∀ g : A, g + n + -g ∈ H

{A : Type u_4}
[AddGroup A]
{H : AddSubgroup A}
(self : H.Normal)
(n : A)


theorem Set.hasSeparatingCover_empty_left (s : Set X) : HasSeparatingCover ∅ s

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


/--
Given `n+1` objects of `C`, a fan for the last `n` with point `c₁.pt` and
a binary fan on `c₁.pt` and `f 0`, we can build a fan for all `n+1`.

In `extendFanIsLimit` we show that if the two given fans are limits, then this fan is also a
limit.
-/
@[simps!] -- Porting note: removed semi-reducible config
def extendFan {n : ℕ} {f : Fin (n + 1) → C} (c₁ : Fan fun i : Fin n => f i.succ)
    (c₂ : BinaryFan (f 0) c₁.pt) : Fan f

(c₁ : CategoryTheory.Limits.Fan fun i => f i.succ)

(c₂ : CategoryTheory.Limits.BinaryFan (f 0) c₁.pt)

(CategoryTheory.extendFan c₁ c₂).pt = c₂.pt


theorem wellFounded_submodule_gt (R M) [Semiring R] [AddCommMonoid M] [Module R M] :
    ∀ [IsNoetherian R M], WellFounded ((· > ·) : Submodule R M → Submodule R M → Prop)

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


/-- If `n % 4 = 3`, then `χ₄ n = -1`. -/
theorem χ₄_int_three_mod_four {n : ℤ} (hn : n % 4 = 3) : χ₄ n = -1


@[simp]
theorem image.ι_zero {X Y : C} [HasImage (0 : X ⟶ Y)] : image.ι (0 : X ⟶ Y) = 0


@[to_additive (attr := simp)]
theorem lift_symm_apply (f : FreeMonoid α →* M) : lift.symm f = f ∘ of

{α : Type u_1}
{M : Type u_4}
[Monoid M]
(f : FreeMonoid α →* M)

FreeMonoid.lift.symm f = ⇑f ∘ FreeMonoid.of


@[to_additive (attr := simp)]
theorem flip_apply {_ : MulOneClass M} {_ : MulOneClass N} {_ : CommMonoid P} (f : M →* N →* P)
    (x : M) (y : N) : f.flip y x = f x y

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

∀ {x : MulOneClass M} {x_1 : MulOneClass N} {x_2 : CommMonoid P} (f : M →* N →* P) (x_3 : M) (y : N),
  (f.flip y) x_3 = (f x_3) y


theorem continuous_congr_of_inseparable (h : ∀ x, f x ~ᵢ g x) :
    Continuous f ↔ Continuous g

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f g : X → Y}
(h : ∀ (x : X), f x ~ᵢ g x)


@[simp]
theorem support_inf [DecidableEq ι] (f g : ι →₀ α) : (f ⊓ g).support = f.support ∩ g.support


@[simp]
theorem Ideal.prime_span_singleton_iff {a : A} : Prime (Ideal.span {a}) ↔ Prime a

{A : Type u_2}
[CommRing A]
[IsDedekindDomain A]
{a : A}


/-- If a function is differentiable and injective on a measurable set,
then the image is measurable. -/
theorem measurable_image_of_fderivWithin (hs : MeasurableSet s)
    (hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (hf : InjOn f s) : MeasurableSet (f '' s)


theorem star_apply (f : C_c(α, β)) (x : α) : (star f) x = star (f x)

{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[AddMonoid β]
[StarAddMonoid β]
[ContinuousStar β]
(f : α →C_c β)
(x : α)


private theorem toFunAux_eq {s : Set ℕ} [DecidablePred (· ∈ s)] (x : s) :
    toFunAux x = ((Finset.range x).filter (· ∈ s)).card

{s : Set ℕ}
[DecidablePred fun x => x ∈ s]
(x : ↑s)

Nat.Subtype.toFunAux x = (Finset.filter (fun x => x ∈ s) (Finset.range ↑x)).card


theorem coeff_mul_eq_coeff_trunc_mul_trunc {d n} (f g) (h : d < n) :
    coeff R d (f * g) = coeff R d (trunc n f * trunc n g)

{R : Type u_2}
[CommSemiring R]
{d n : ℕ}
(f g : PowerSeries R)
(h : d < n)

(PowerSeries.coeff R d) (f * g) = (PowerSeries.coeff R d) (↑(PowerSeries.trunc n f) * ↑(PowerSeries.trunc n g))


@[simp]
lemma cyclesMap_smul : cyclesMap (a • φ) = a • cyclesMap φ

{R : Type u_1}
{C : Type u_2}
[Semiring R]
[CategoryTheory.Category.{u_3, u_2} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.Linear R C]
{S₁ S₂ : CategoryTheory.ShortComplex C}
(φ : S₁ ⟶ S₂)
(a : R)
[S₁.HasLeftHomology]
[S₂.HasLeftHomology]

CategoryTheory.ShortComplex.cyclesMap (a • φ) = a • CategoryTheory.ShortComplex.cyclesMap φ


@[simp]
theorem toEquiv_refl : (refl k P₁).toEquiv = Equiv.refl P₁

(k : Type u_1)
(P₁ : Type u_2)
{V₁ : Type u_6}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]

(AffineEquiv.refl k P₁).toEquiv = Equiv.refl P₁


@[simp]
theorem map_apply (i) : b.map f i = f (b i)

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
{M' : Type u_7}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid M']
[Module R M']
(b : Basis ι R M)
(f : M ≃ₗ[R] M')
(i : ι)


theorem frobeniusPolyAux_eq (n : ℕ) :
    frobeniusPolyAux p n =
      X (n + 1) - ∑ i ∈ range n,
          ∑ j ∈ range (p ^ (n - i)),
            (X i ^ p) ^ (p ^ (n - i) - (j + 1)) * frobeniusPolyAux p i ^ (j + 1) *
              C ↑((p ^ (n - i)).choose (j + 1) / p ^ (n - i - v p ⟨j + 1, Nat.succ_pos j⟩) *
                ↑p ^ (j - v p ⟨j + 1, Nat.succ_pos j⟩) : ℕ)

(p : ℕ)
[hp : Fact (Nat.Prime p)]
(n : ℕ)

WittVector.frobeniusPolyAux p n =
  MvPolynomial.X (n + 1) -
    ∑ i ∈ Finset.range n,
      ∑ j ∈ Finset.range (p ^ (n - i)),
        (MvPolynomial.X i ^ p) ^ (p ^ (n - i) - (j + 1)) * WittVector.frobeniusPolyAux p i ^ (j + 1) *
          MvPolynomial.C
            ↑((p ^ (n - i)).choose (j + 1) / p ^ (n - i - WittVector.pnat_multiplicity p ⟨j + 1, ⋯⟩) *
                p ^ (j - WittVector.pnat_multiplicity p ⟨j + 1, ⋯⟩))


/-- The equivalence from coalgebras for the product comonad to the over category. -/
@[simps]
def coalgebraEquivOver : Coalgebra (prodComonad X) ≌ Over X

(CategoryTheory.coalgebraEquivOver X).functor = CategoryTheory.coalgebraToOver X


protected lemma Pi.exists_compact_superset_iff {s : Set (Π i, X i)} :
    (∃ K, IsCompact K ∧ s ⊆ K) ↔ ∀ i, ∃ Ki, IsCompact Ki ∧ s ⊆ eval i ⁻¹' Ki

{ι : Type u_1}
{X : ι → Type u_2}
[(i : ι) → TopologicalSpace (X i)]
{s : Set ((i : ι) → X i)}

(∃ K, IsCompact K ∧ s ⊆ K) ↔ ∀ (i : ι), ∃ Ki, IsCompact Ki ∧ s ⊆ Function.eval i ⁻¹' Ki


/-- Every element of `⨂[R] i, s i` has a lift in `FreeAddMonoid (R × Π i, s i)`.
-/
lemma nonempty_lifts (x : ⨂[R] i, s i) : Set.Nonempty (lifts x)

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


@[simp, push_cast] theorem coe_mk (f : G → H) (hf) : ⇑(mk f hf : G →+c[a, b] H) = f

{G : Type u_1}
{H : Type u_2}
[Add G]
[Add H]
{a : G}
{b : H}
(f : G → H)
(hf : ∀ (x : G), f (x + a) = f x + b)

⇑{ toFun := f, map_add_const' := hf } = f


theorem toNonUnitalSubring_inj {R : Type u} {A : Type v} [CommRing R] [NonUnitalRing A] [Module R A]
    [Star A] {S U : NonUnitalStarSubalgebra R A} :
    S.toNonUnitalSubring = U.toNonUnitalSubring ↔ S = U


@[simp]
theorem cardQuot_eq_one_iff {P : Submodule R M} : cardQuot P = 1 ↔ P = ⊤

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
{P : Submodule R M}


theorem Filter.Tendsto.inv_tendsto_atTop (h : Tendsto f l atTop) : Tendsto f⁻¹ l (𝓝 0)

{𝕜 : Type u_1}
{α : Type u_2}
[LinearOrderedField 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
{l : Filter α}
{f : α → 𝕜}
(h : Filter.Tendsto f l Filter.atTop)


@[simp]
protected theorem sup_eq_union (s t : {s : Set α // MeasurableSet s}) : s ⊔ t = s ∪ t

{α : Type u_1}
[MeasurableSpace α]
(s t : { s // MeasurableSet s })


theorem sqLe_of_le {c d x y z w : ℕ} (xz : z ≤ x) (yw : y ≤ w) (xy : SqLe x c y d) : SqLe z c w d

{c d x y z w : ℕ}
(xz : z ≤ x)
(yw : y ≤ w)
(xy : Zsqrtd.SqLe x c y d)


theorem Bijective.of_comp_iff (f : α → β) {g : γ → α} (hg : Bijective g) :
    Bijective (f ∘ g) ↔ Bijective f

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
(f : α → β)
{g : γ → α}
(hg : Function.Bijective g)

Function.Bijective (f ∘ g) ↔ Function.Bijective f


@[simp] theorem congr_pow (f : M ≃ₗ[R] M) (g : N ≃ₗ[R] N) (n : ℕ) :
    congr f g ^ n = congr (f ^ n) (g ^ n)

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
(f : M ≃ₗ[R] M)
(g : N ≃ₗ[R] N)
(n : ℕ)

TensorProduct.congr f g ^ n = TensorProduct.congr (f ^ n) (g ^ n)


theorem IsConnected.preimage_of_isClosedMap [TopologicalSpace β] {s : Set β} (hs : IsConnected s)
    {f : α → β} (hinj : Function.Injective f) (hf : IsClosedMap f) (hsf : s ⊆ range f) :
    IsConnected (f ⁻¹' s)

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
{s : Set β}
(hs : IsConnected s)
{f : α → β}
(hinj : Function.Injective f)
(hf : IsClosedMap f)
(hsf : s ⊆ Set.range f)


@[simp]
theorem conj_symm_apply [Group G] (g h : G) : (conj g).symm h = g⁻¹ * h * g

(MulEquiv.symm (MulAut.conj g)) h = g⁻¹ * h * g


/-- Characteristic `≠ 2` in a domain implies that `-a = a` iff `a = 0`. -/
lemma Ring.eq_self_iff_eq_zero_of_char_ne_two {R : Type*} [NonAssocRing R] [Nontrivial R]
    [NoZeroDivisors R] (hR : ringChar R ≠ 2) {a : R} : -a = a ↔ a = 0

{R : Type u_2}
[NonAssocRing R]
[Nontrivial R]
[NoZeroDivisors R]
(hR : ringChar R ≠ 2)
{a : R}


/-- A set is a neighborhood of `a` within `[a, +∞)` if and only if it contains an interval `[a, u)`
with `a < u < u'`, provided `a` is not a top element. -/
theorem mem_nhdsWithin_Ici_iff_exists_Ico_subset' {a u' : α} {s : Set α} (hu' : a < u') :
    s ∈ 𝓝[≥] a ↔ ∃ u ∈ Ioi a, Ico a u ⊆ s

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{a u' : α}
{s : Set α}
(hu' : a < u')

s ∈ 𝓝[≥] a ↔ ∃ u ∈ Set.Ioi a, Set.Ico a u ⊆ s


theorem OpenEmbedding.compatiblePreserving (hf : OpenEmbedding f) :
    CompatiblePreserving (Opens.grothendieckTopology Y) hf.isOpenMap.functor

{X Y : TopCat}
{f : X ⟶ Y}
(hf : OpenEmbedding ⇑f)

CategoryTheory.CompatiblePreserving (Opens.grothendieckTopology ↑Y) ⋯.functor


@[simp]
theorem length_inits (l : List α) : length (inits l) = length l + 1


lemma subset_diffs {s t : Set α} :
    ↑u ⊆ Set.image2 (· \ ·) s t → ∃ s' t' : Finset α, ↑s' ⊆ s ∧ ↑t' ⊆ t ∧ u ⊆ s' \\ t'

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

↑u ⊆ Set.image2 (fun x x_1 => x \ x_1) s t → ∃ s' t', ↑s' ⊆ s ∧ ↑t' ⊆ t ∧ u ⊆ s'.diffs t'


/-- If `α` is a topological space and a preorder, `ClosedIicTopology α` means that `Iic a` is
closed for all `a : α`. -/
class ClosedIicTopology (α : Type*) [TopologicalSpace α] [Preorder α] : Prop where
  /-- For any `a`, the set `(-∞, a]` is closed. -/
  isClosed_Iic (a : α) : IsClosed (Iic a)

{α : Type u_1}
[TopologicalSpace α]
[Preorder α]
[self : ClosedIicTopology α]
(a : α)


/-- The `k`-th derivative of the Fourier integral of `f`, multiplied by `(L v w) ^ n`, is the
Fourier integral of the `n`-th derivative of `(L v w) ^ k * f`. -/
theorem fourierPowSMulRight_iteratedFDeriv_fourierIntegral [FiniteDimensional ℝ V]
    {μ : Measure V} [Measure.IsAddHaarMeasure μ] {K N : ℕ∞} (hf : ContDiff ℝ N f)
    (h'f : ∀ (k n : ℕ), k ≤ K → n ≤ N → Integrable (fun v ↦ ‖v‖^k * ‖iteratedFDeriv ℝ n f v‖) μ)
    {k n : ℕ} (hk : k ≤ K) (hn : n ≤ N) {w : W} :
    fourierPowSMulRight (-L.flip)
      (iteratedFDeriv ℝ k (fourierIntegral 𝐞 μ L.toLinearMap₂ f)) w n =
    fourierIntegral 𝐞 μ L.toLinearMap₂
      (iteratedFDeriv ℝ n (fun v ↦ fourierPowSMulRight L f v k)) w

(h'f : ∀ (k n : ℕ), ↑k ≤ K → ↑n ≤ N → MeasureTheory.Integrable (fun v => ‖v‖ ^ k * ‖iteratedFDeriv ℝ n f v‖) μ)

VectorFourier.fourierPowSMulRight (-L.flip) (iteratedFDeriv ℝ k (VectorFourier.fourierIntegral 𝐞 μ L.toLinearMap₂ f)) w
    n =
  VectorFourier.fourierIntegral 𝐞 μ L.toLinearMap₂
    (iteratedFDeriv ℝ n fun v => VectorFourier.fourierPowSMulRight L f v k) w


@[simp]
theorem orderIsoSumLexPUnit_toLex (a : α) : orderIsoSumLexPUnit ↑a = toLex (inl a)

WithTop.orderIsoSumLexPUnit ↑a = toLex (Sum.inl a)


lemma mfderivWithin_of_isOpen (hs : IsOpen s) (hx : x ∈ s) :
    mfderivWithin I I' f s x = mfderiv I I' f x

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


theorem frequently_or_distrib_left {f : Filter α} [NeBot f] {p : Prop} {q : α → Prop} :
    (∃ᶠ x in f, p ∨ q x) ↔ p ∨ ∃ᶠ x in f, q x

{α : Type u}
{f : Filter α}
[f.NeBot]
{p : Prop}
{q : α → Prop}

(∃ᶠ (x : α) in f, p ∨ q x) ↔ p ∨ ∃ᶠ (x : α) in f, q x


theorem annihilator_iSup (ι : Sort w) (f : ι → Submodule R M) :
    annihilator (⨆ i, f i) = ⨅ i, annihilator (f i)

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(ι : Sort w)
(f : ι → Submodule R M)

(⨆ i, f i).annihilator = ⨅ i, (f i).annihilator


/-- Given a 2-morphism between `f` and `g` in the free bicategory, we have the equality
`normalizeAux p f = normalizeAux p g`.
-/
theorem normalizeAux_congr {a b c : B} (p : Path a b) {f g : Hom b c} (η : f ⟶ g) :
    normalizeAux p f = normalizeAux p g

{f g : CategoryTheory.FreeBicategory.Hom b c}

CategoryTheory.FreeBicategory.normalizeAux p f = CategoryTheory.FreeBicategory.normalizeAux p g


theorem mem_span_fractionalIdealLatticeBasis (x : (E K)) :
    x ∈ Submodule.span ℤ (Set.range (fractionalIdealLatticeBasis K I)) ↔
      x ∈ mixedEmbedding K '' I

(I : (FractionalIdeal (nonZeroDivisors (NumberField.RingOfIntegers K)) K)ˣ)

(x : ({ w // w.IsReal } → ℝ) × ({ w // w.IsComplex } → ℂ))

x ∈ Submodule.span ℤ (Set.range ⇑(NumberField.mixedEmbedding.fractionalIdealLatticeBasis K I)) ↔
  x ∈ ⇑(NumberField.mixedEmbedding K) '' ↑↑I


theorem openEmbedding_sigmaMk {i : ι} : OpenEmbedding (@Sigma.mk ι σ i)

{ι : Type u_5}
{σ : ι → Type u_7}
[(i : ι) → TopologicalSpace (σ i)]
{i : ι}


theorem toOuterMeasure_uniformOfFintype_apply :
    (uniformOfFintype α).toOuterMeasure s = Fintype.card s / Fintype.card α

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

(PMF.uniformOfFintype α).toOuterMeasure s = ↑(Fintype.card ↑s) / ↑(Fintype.card α)


lemma top_mul_coe_of_pos {x : ℝ} (h : 0 < x) : (⊤ : EReal) * x = ⊤


theorem deriv_smul_const (hc : DifferentiableAt 𝕜 c x) (f : F) :
    deriv (fun y => c y • f) x = deriv c x • f

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{x : 𝕜}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{c : 𝕜 → 𝕜'}
(hc : DifferentiableAt 𝕜 c x)
(f : F)


/-- The ring of submodules of the opposite algebra is isomorphic to the opposite ring of
submodules. -/
@[simps apply symm_apply]
def equivOpposite : Submodule R Aᵐᵒᵖ ≃+* (Submodule R A)ᵐᵒᵖ

{R : Type u}
[CommSemiring R]
{A : Type v}
[Semiring A]
[Algebra R A]
(p : Submodule R Aᵐᵒᵖ)

Submodule.equivOpposite p = MulOpposite.op (Submodule.comap (↑(MulOpposite.opLinearEquiv R)) p)


/-- The `Bicone` used in order to obtain the existence of
the biproduct of a functor `J ⥤ Karoubi C` when the category `C` is additive. -/
@[simps]
def bicone [HasFiniteBiproducts C] {J : Type} [Finite J] (F : J → Karoubi C) : Bicone F

(F : J → CategoryTheory.Idempotents.Karoubi C)

((CategoryTheory.Idempotents.Karoubi.Biproducts.bicone F).π j).f =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.biproduct.map fun j => (F j).p)
    ((CategoryTheory.Limits.biproduct.bicone fun j => (F j).X).π j)


theorem erase_cons_tail_of_mem (h : a ∈ s) :
    (b ::ₘ s).erase a = b ::ₘ s.erase a

{α : Type u_1}
[DecidableEq α]
{s : Multiset α}
{a b : α}
(h : a ∈ s)


@[simp]
theorem prod_top : (prod ⊤ ⊤ : NonUnitalSubalgebra R (A × B)) = ⊤

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[NonUnitalNonAssocSemiring B]
[Module R B]
[IsScalarTower R B B]
[SMulCommClass R B B]


@[to_additive]
theorem toSubgroup_injective : Injective ((↑) : OpenSubgroup G → Subgroup G)

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]


@[simp]
theorem sumLexDualAntidistrib_symm_inr :
    (sumLexDualAntidistrib α β).symm (inr (toDual a)) = toDual (inl a)

{α : Type u_1}
{β : Type u_2}
[LE α]
[LE β]
(a : α)

(OrderIso.sumLexDualAntidistrib α β).symm (Sum.inr (OrderDual.toDual a)) = OrderDual.toDual (Sum.inl a)


protected theorem IsLeast.image2 (ha : IsLeast s a) (hb : IsLeast t b) :
    IsLeast (image2 f s t) (f a b)

{f : α → β → γ}

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


protected theorem bddAbove_iff {s : Set <| Seminorm 𝕜 E} :
    BddAbove s ↔ BddAbove ((↑) '' s : Set (E → ℝ))

{𝕜 : Type u_3}
{E : Type u_7}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set (Seminorm 𝕜 E)}

BddAbove s ↔ BddAbove (DFunLike.coe '' s)


theorem card_commutatorSet_closureCommutatorRepresentatives :
    Nat.card (commutatorSet (closureCommutatorRepresentatives G)) = Nat.card (commutatorSet G)

Nat.card ↑(commutatorSet ↥(closureCommutatorRepresentatives G)) = Nat.card ↑(commutatorSet G)


/-- Predicate for the parallelogram identity to hold in a normed group. This is a scalar-less
version of `InnerProductSpace`. If you have an `InnerProductSpaceable` assumption, you can
locally upgrade that to `InnerProductSpace 𝕜 E` using `casesI nonempty_innerProductSpace 𝕜 E`.
-/
class InnerProductSpaceable : Prop where
  parallelogram_identity :
    ∀ x y : E, ‖x + y‖ * ‖x + y‖ + ‖x - y‖ * ‖x - y‖ = 2 * (‖x‖ * ‖x‖ + ‖y‖ * ‖y‖)

{E : Type u_2}
[NormedAddCommGroup E]
[self : InnerProductSpaceable E]
(x y : E)


@[to_additive (attr := simp)]
lemma forget_map {X Y : CommGrp} (f : X ⟶ Y) :
    (forget CommGrp).map f = (f : X → Y)

(CategoryTheory.forget CommGrp).map f = ⇑f


@[reassoc (attr := simp)]
lemma ι_sigmaIsoGlued_inv (i) : (disjointGlueData f).ι i ≫ (sigmaIsoGlued f).inv = Sigma.ι f i

(i : (AlgebraicGeometry.disjointGlueData f).J)

(AlgebraicGeometry.disjointGlueData f).ι i ≫ (AlgebraicGeometry.sigmaIsoGlued f).inv = CategoryTheory.Limits.Sigma.ι f i


theorem IsUpperSet.image (hs : IsUpperSet s) (f : α ≃o β) : IsUpperSet (f '' s : Set β)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{s : Set α}
(hs : IsUpperSet s)
(f : α ≃o β)


lemma ext₁ [ClosedUnderIsomorphisms S.P] (h₂ : S.P T.obj₂) (h₃ : S.P T.obj₃) :
    S.P T.obj₁

[∀ (n : ℤ), (CategoryTheory.shiftFunctor C n).Additive]

(S : CategoryTheory.Triangulated.Subcategory C)

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)


@[simp]
lemma natDegree_ΨSq [NoZeroDivisors R] {n : ℤ} (h : (n : R) ≠ 0) :
    (W.ΨSq n).natDegree = n.natAbs ^ 2 - 1

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
[NoZeroDivisors R]
{n : ℤ}
(h : ↑n ≠ 0)


@[simp, elementwise]
theorem biproductIsoPi_inv_comp_π [Finite J] (f : J → ModuleCat.{v} R) (j : J) :
    (biproductIsoPi f).inv ≫ biproduct.π f j = (LinearMap.proj j : (∀ j, f j) →ₗ[R] f j)

{R : Type u}
[Ring R]
{J : Type}
[Finite J]
(f : J → ModuleCat R)
(j : J)

(ModuleCat.biproductIsoPi f).inv ≫ CategoryTheory.Limits.biproduct.π f j = LinearMap.proj j


/-- Multiplying the products of a function over `s` and over `sᶜ` gives the whole product.
For a version expressed with subtypes, see `Fintype.prod_subtype_mul_prod_subtype`. -/
@[to_additive "Adding the sums of a function over `s` and over `sᶜ` gives the whole sum.
For a version expressed with subtypes, see `Fintype.sum_subtype_add_sum_subtype`. "]
theorem prod_mul_prod_compl [Fintype α] [DecidableEq α] (s : Finset α) (f : α → β) :
    (∏ i ∈ s, f i) * ∏ i ∈ sᶜ, f i = ∏ i, f i

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

(∏ i ∈ s, f i) * ∏ i ∈ sᶜ, f i = ∏ i : α, f i


@[elementwise]
theorem fromSpec_app_self :
    hU.fromSpec.app U = (Scheme.ΓSpecIso Γ(X, U)).inv ≫
      (Spec Γ(X, U)).presheaf.map (eqToHom hU.fromSpec_preimage_self).op

{X : AlgebraicGeometry.Scheme}
{U : X.Opens}
(hU : AlgebraicGeometry.IsAffineOpen U)

AlgebraicGeometry.Scheme.Hom.app hU.fromSpec U =
  (AlgebraicGeometry.Scheme.ΓSpecIso (X.presheaf.obj (Opposite.op U))).inv ≫
    (AlgebraicGeometry.Spec (X.presheaf.obj (Opposite.op U))).presheaf.map (CategoryTheory.eqToHom ⋯).op


@[simp]
protected theorem traverse_def (f : α → F β) (x : α) :
    ∀ xs : Vector α n, (x ::ᵥ xs).traverse f = cons <$> f x <*> xs.traverse f

{n : ℕ}
{F : Type u → Type u}
[Applicative F]
{α β : Type u}
(f : α → F β)
(x : α)
(xs : Mathlib.Vector α n)

Mathlib.Vector.traverse f (x ::ᵥ xs) = Seq.seq (Mathlib.Vector.cons <$> f x) fun x => Mathlib.Vector.traverse f xs


theorem Ici_mem_nhdsSet_Ico (h : a < b) : Ici a ∈ 𝓝ˢ (Ico b c)

{α : Type u_1}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
{a b c : α}
(h : a < b)


theorem condIndepFun_iff_condIndepSet_preimage {mβ : MeasurableSpace β} {mβ' : MeasurableSpace β'}
    (hf : Measurable f) (hg : Measurable g) :
    CondIndepFun m' hm' f g μ ↔
      ∀ s t, MeasurableSet s → MeasurableSet t → CondIndepSet m' hm' (f ⁻¹' s) (g ⁻¹' t) μ

{Ω : Type u_1}
{β : Type u_3}
{β' : Type u_4}
{m' mΩ : MeasurableSpace Ω}
[StandardBorelSpace Ω]
[Nonempty Ω]
{hm' : m' ≤ mΩ}
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsFiniteMeasure μ]
{f : Ω → β}
{g : Ω → β'}
{mβ : MeasurableSpace β}
{mβ' : MeasurableSpace β'}
(hf : Measurable f)
(hg : Measurable g)

ProbabilityTheory.CondIndepFun m' hm' f g μ ↔
  ∀ (s : Set β) (t : Set β'),
    MeasurableSet s → MeasurableSet t → ProbabilityTheory.CondIndepSet m' hm' (f ⁻¹' s) (g ⁻¹' t) μ


/-- A small set of games is bounded below. -/
lemma bddBelow_of_small (s : Set Game.{u}) [Small.{u} s] : BddBelow s

(s : Set SetTheory.Game)
[Small.{u, u + 1} ↑s]


lemma factorizationLCMRight_dvd_right : factorizationLCMRight a b ∣ b


/-- A morphism of locally ringed spaces is a morphism of ringed spaces
 such that the morphisms induced on stalks are local ring homomorphisms. -/
@[ext]
structure Hom (X Y : LocallyRingedSpace.{u}) : Type _ where
  /-- the underlying morphism between ringed spaces -/
  val : X.toSheafedSpace ⟶ Y.toSheafedSpace
  /-- the underlying morphism induces a local ring homomorphism on stalks -/
  prop : ∀ x, IsLocalRingHom (val.stalkMap x)

{X Y : AlgebraicGeometry.LocallyRingedSpace}

IsLocalRingHom (AlgebraicGeometry.PresheafedSpace.Hom.stalkMap self.val x)


/-- If `a ∈ P^i \ P^(i+1)` and `c ∈ P^i`, then `a * d + e = c` for `e ∈ P^(i+1)`.
`Ideal.mul_add_mem_pow_succ_unique` shows the choice of `d` is unique, up to `P`.
Inspired by [Neukirch], proposition 6.1 -/
theorem Ideal.exists_mul_add_mem_pow_succ [IsDedekindDomain S] {i : ℕ} (a c : S) (a_mem : a ∈ P ^ i)
    (a_not_mem : a ∉ P ^ (i + 1)) (c_mem : c ∈ P ^ i) :
    ∃ d : S, ∃ e ∈ P ^ (i + 1), a * d + e = c

{S : Type u_1}
[CommRing S]
{P : Ideal S}
[P_prime : P.IsPrime]
(hP : P ≠ ⊥)
[IsDedekindDomain S]
{i : ℕ}
(a c : S)
(a_mem : a ∈ P ^ i)
(a_not_mem : a ∉ P ^ (i + 1))
(c_mem : c ∈ P ^ i)


protected theorem surjective (e : R ≃+* S) : Function.Surjective e

{R : Type u_4}
{S : Type u_5}
[Mul R]
[Mul S]
[Add R]
[Add S]
(e : R ≃+* S)


@[simp] theorem elem_cons_self [BEq α] [LawfulBEq α] {a : α} : (a::as).elem a = true

{α : Type u_1}
{as : List α}
[BEq α]
[LawfulBEq α]
{a : α}


/-- `trim` sends the supremum of a countable family of outer measures to the supremum
of the trimmed measures. -/
theorem trim_iSup {ι} [Countable ι] (μ : ι → OuterMeasure α) :
    trim (⨆ i, μ i) = ⨆ i, trim (μ i)

{α : Type u_1}
[MeasurableSpace α]
{ι : Sort u_2}
[Countable ι]
(μ : ι → MeasureTheory.OuterMeasure α)


theorem coe_gramSchmidtBasis (b : Basis ι 𝕜 E) : (gramSchmidtBasis b : ι → E) = gramSchmidt 𝕜 b

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_3}
[LinearOrder ι]
[LocallyFiniteOrderBot ι]
[IsWellOrder ι fun x x_1 => x < x_1]
(b : Basis ι 𝕜 E)

⇑(gramSchmidtBasis b) = gramSchmidt 𝕜 ⇑b


/-- If `‖x‖ = 0` and `f` is continuous then `‖f x‖ = 0`. -/
theorem norm_image_of_norm_zero [SemilinearMapClass 𝓕 σ₁₂ E F] (f : 𝓕) (hf : Continuous f) {x : E}
    (hx : ‖x‖ = 0) : ‖f x‖ = 0

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
{𝓕 : Type u_10}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[FunLike 𝓕 E F]
[SemilinearMapClass 𝓕 σ₁₂ E F]
(f : 𝓕)
(hf : Continuous ⇑f)
{x : E}
(hx : ‖x‖ = 0)


/-- `t` is in the upper shadow of `𝒜` iff we can remove an element from it so that the resulting
finset is in `𝒜`. -/
lemma mem_upShadow_iff_erase_mem : t ∈ ∂⁺ 𝒜 ↔ ∃ a, a ∈ t ∧ erase t a ∈ 𝒜

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


theorem smoothWithinAt_fst {s : Set (M × N)} {p : M × N} :
    SmoothWithinAt (I.prod J) I Prod.fst s p

{𝕜 : 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]
{s : Set (M × N)}
{p : M × N}


/-- An injective function from a nontrivial type has an argument at
which it does not take a given value. -/
protected theorem Function.Injective.exists_ne [Nontrivial α] {f : α → β}
    (hf : Function.Injective f) (y : β) : ∃ x, f x ≠ y

{α : Type u_1}
{β : Type u_2}
[Nontrivial α]
{f : α → β}
(hf : Function.Injective f)
(y : β)


@[to_additive]
theorem image_op_inv : op '' s⁻¹ = (op '' s)⁻¹

{α : Type u_2}
[InvolutiveNeg α]
{s : Set α}

AddOpposite.op '' (-s) = -AddOpposite.op '' s


/-- A polynomial has non-zero separable degree if and only if it is non-constant. -/
theorem natSepDegree_ne_zero_iff : f.natSepDegree ≠ 0 ↔ f.natDegree ≠ 0


theorem singleton_subset_singleton : ({a} : Finset α) ⊆ {b} ↔ a = b


@[simp]
theorem keys_empty : (∅ : Finmap β).keys = ∅


@[simp]
theorem isoApp_refl (X : DifferentialObject S C) : isoApp (Iso.refl X) = Iso.refl X.obj

(X : CategoryTheory.DifferentialObject S C)

CategoryTheory.DifferentialObject.isoApp (CategoryTheory.Iso.refl X) = CategoryTheory.Iso.refl X.obj


/-- If `a` is even and `b` is odd, then we can remove a factor `2` from `a`,
but we may have to change the sign, depending on `b % 8`.
We give one version for each of the four odd residue classes mod `8`. -/
theorem jacobiSymNat.even_odd₁ (a b c : ℕ) (r : ℤ) (ha : a % 2 = 0) (hb : b % 8 = 1)
    (hc : a / 2 = c) (hr : jacobiSymNat c b = r) : jacobiSymNat a b = r

(hr : Mathlib.Meta.NormNum.jacobiSymNat c b = r)

Mathlib.Meta.NormNum.jacobiSymNat a b = r


/-- In a compact space, all sets are bounded -/
theorem isBounded_of_compactSpace [CompactSpace α] : IsBounded s

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
[CompactSpace α]


@[simp]
theorem append1_drop_last (α : TypeVec (n + 1)) : append1 (drop α) (last α) = α


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


@[simp] protected theorem zero_mul (a : Int) : 0 * a = 0


@[norm_cast]
theorem coe_toAddMonoidHom (f : A →ₗc[R] B) : ⇑(f : A →+ B) = f

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[AddCommMonoid B]
[Module R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
(f : A →ₗc[R] B)


theorem annihilator_top : (⊤ : Submodule R M).annihilator = Module.annihilator R M

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


theorem cons_map (b : δ a) (f : ∀ a' ∈ m, δ a')
    {δ' : α → Sort*} (φ : ∀ ⦃a'⦄, δ a' → δ' a') :
    Pi.cons _ _ (φ b) (fun a' ha' ↦ φ (f a' ha')) = (fun a' ha' ↦ φ ((cons _ _ b f) a' ha'))

{α : Type u_1}
[DecidableEq α]
{δ : α → Sort u_2}
{m : Multiset α}
{a : α}
(b : δ a)
(f : (a' : α) → a' ∈ m → δ a')
{δ' : α → Sort u_3}
(φ : ⦃a' : α⦄ → δ a' → δ' a')

(Multiset.Pi.cons m a (φ b) fun a' ha' => φ (f a' ha')) = fun a' ha' => φ (Multiset.Pi.cons m a b f a' ha')


theorem tmul_coe_mul_algebraMap_tmul {j₁ : ι} (a₁ : A) (b₁ : ℬ j₁) (r : R) (b₂ : B) :
    (a₁ ᵍ⊗ₜ[R] (b₁ : B) * algebraMap R A r ᵍ⊗ₜ[R] b₂ : 𝒜 ᵍ⊗[R] ℬ)
      = (a₁ * algebraMap R A r : A) ᵍ⊗ₜ (b₁ * b₂ : B)

{R : Type u_1}
{ι : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring ι]
[Module ι (Additive ℤˣ)]
[DecidableEq ι]
[CommRing R]
[Ring A]
[Ring B]
[Algebra R A]
[Algebra R B]
(𝒜 : ι → Submodule R A)
(ℬ : ι → Submodule R B)
[GradedAlgebra 𝒜]
[GradedAlgebra ℬ]
{j₁ : ι}
(a₁ : A)
(b₁ : ↥(ℬ j₁))
(r : R)
(b₂ : B)

a₁ ᵍ⊗ₜ[R] ↑b₁ * (algebraMap R A) r ᵍ⊗ₜ[R] b₂ = (a₁ * (algebraMap R A) r) ᵍ⊗ₜ[R] (↑b₁ * b₂)


@[simp]
theorem coe_smul (r : 𝕜) (s : Cₛ^n⟮I; F, V⟯) : ⇑(r • s : Cₛ^n⟮I; F, V⟯) = r • ⇑s

[TopologicalSpace (Bundle.TotalSpace F V)]


/-- A set in a linear ordered field is strictly convex if and only if it is convex. -/
@[simp]
theorem strictConvex_iff_convex : StrictConvex 𝕜 s ↔ Convex 𝕜 s

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
{s : Set 𝕜}


/-- A constructor for isomorphisms in the category `ShortComplex C`-/
@[simps]
def isoMk (e₁ : S₁.X₁ ≅ S₂.X₁) (e₂ : S₁.X₂ ≅ S₂.X₂) (e₃ : S₁.X₃ ≅ S₂.X₃)
    (comm₁₂ : e₁.hom ≫ S₂.f = S₁.f ≫ e₂.hom := by aesop_cat)
    (comm₂₃ : e₂.hom ≫ S₂.g = S₁.g ≫ e₃.hom := by aesop_cat) :
    S₁ ≅ S₂

(comm₁₂ : CategoryTheory.CategoryStruct.comp e₁.hom S₂.f = CategoryTheory.CategoryStruct.comp S₁.f e₂.hom := by
  aesop_cat)

(comm₂₃ : CategoryTheory.CategoryStruct.comp e₂.hom S₂.g = CategoryTheory.CategoryStruct.comp S₁.g e₃.hom := by
  aesop_cat)

(CategoryTheory.ShortComplex.isoMk e₁ e₂ e₃ comm₁₂ comm₂₃).hom.τ₂ = e₂.hom


@[to_additive (attr := simp)]
theorem mul_univ (hs : s.Nonempty) : s * (univ : Set α) = univ

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


lemma HasFPowerSeriesWithinAt.continuousWithinAt {f : E → F} {p : FormalMultilinearSeries 𝕜 E F}
    {s : Set E} {x : E} (h : HasFPowerSeriesWithinAt f p s x) : ContinuousWithinAt f s x

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
{F : Type u_4}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{s : Set E}
{x : E}
(h : HasFPowerSeriesWithinAt f p s x)


/-- The **Gagliardo-Nirenberg-Sobolev inequality**.  Let `u` be a continuously differentiable
compactly-supported function `u` on a normed space `E` of finite dimension `n`, equipped
with Haar measure, let `1 ≤ p < n` and let `p'⁻¹ := p⁻¹ - n⁻¹`.
Then the `Lᵖ'` norm of `u` is bounded above by a constant times the `Lᵖ` norm of
the Fréchet derivative of `u`.

Note: The codomain of `u` needs to be a Hilbert space.
-/
theorem eLpNorm_le_eLpNorm_fderiv_of_eq_inner  {u : E → F'}
    (hu : ContDiff ℝ 1 u) (h2u : HasCompactSupport u)
    {p p' : ℝ≥0} (hp : 1 ≤ p) (hn : 0 < finrank ℝ E)
    (hp' : (p' : ℝ)⁻¹ = p⁻¹ - (finrank ℝ E : ℝ)⁻¹) :
    eLpNorm u p' μ ≤ eLpNormLESNormFDerivOfEqInnerConst μ p * eLpNorm (fderiv ℝ u) p μ

(hn : 0 < FiniteDimensional.finrank ℝ E)

(hp' : (↑p')⁻¹ = ↑p⁻¹ - (↑(FiniteDimensional.finrank ℝ E))⁻¹)

MeasureTheory.eLpNorm u (↑p') μ ≤
  ↑(MeasureTheory.eLpNormLESNormFDerivOfEqInnerConst μ ↑p) * MeasureTheory.eLpNorm (fderiv ℝ u) (↑p) μ


/-- If `F` is full, and naturally isomorphic to some `F'`, then `F'` is also full. -/
lemma Full.of_iso [Full F] (α : F ≅ F') : Full F'

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


theorem NeBot.map (hf : NeBot f) (m : α → β) : NeBot (map m f)

{α : Type u}
{β : Type v}
{f : Filter α}
(hf : f.NeBot)
(m : α → β)


@[simp]
theorem prod_top : (prod ⊤ ⊤ : NonUnitalStarSubalgebra R (A × B)) = ⊤

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[StarRing R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[StarModule R A]
[NonUnitalSemiring B]
[StarRing B]
[Module R B]
[IsScalarTower R B B]
[SMulCommClass R B B]
[StarModule R B]


/-- We can prove two cocone points `(s : Cocone F).pt` and `(t : Cocone G).pt` are isomorphic if
* both cocones are colimit cocones
* their indexing categories are equivalent via some `e : J ≌ K`,
* the triangle of functors commutes up to a natural isomorphism: `e.functor ⋙ G ≅ F`.

This is the most general form of uniqueness of cocone points,
allowing relabelling of both the indexing category (up to equivalence)
and the functor (up to natural isomorphism).
-/
@[simps]
def coconePointsIsoOfEquivalence {F : J ⥤ C} {s : Cocone F} {G : K ⥤ C} {t : Cocone G}
    (P : IsColimit s) (Q : IsColimit t) (e : J ≌ K) (w : e.functor ⋙ G ≅ F) : s.pt ≅ t.pt

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{K : Type u₂}
[CategoryTheory.Category.{v₂, u₂} K]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
{s : CategoryTheory.Limits.Cocone F}
{G : K ⥤ C}
{t : CategoryTheory.Limits.Cocone G}
(P : CategoryTheory.Limits.IsColimit s)
(Q : CategoryTheory.Limits.IsColimit t)
(e : J ≌ K)
(w : e.functor ⋙ G ≅ F)

(P.coconePointsIsoOfEquivalence Q e w).inv =
  Q.desc
    ((CategoryTheory.Limits.Cocones.equivalenceOfReindexing e.symm
            ((CategoryTheory.isoWhiskerLeft e.inverse w).symm ≪≫ e.invFunIdAssoc G)).functor.obj
      s)


lemma algebraMapSubmonoid_map_eq (f : A →ₐ[R] B) :
    (algebraMapSubmonoid A M).map f = algebraMapSubmonoid B M

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(M : Submonoid R)
{B : Type w}
[CommRing B]
[Algebra R B]
(f : A →ₐ[R] B)

Submonoid.map f (Algebra.algebraMapSubmonoid A M) = Algebra.algebraMapSubmonoid B M


@[simp]
theorem get_set_same (v : Vector α n) (i : Fin n) (a : α) : (v.set i a).get i = a

{n : ℕ}
{α : Type u_1}
(v : Mathlib.Vector α n)
(i : Fin n)
(a : α)


@[simp]
theorem abs_one_sub_fract : |1 - fract a| = 1 - fract a

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


run_cmd
  for typeName' in [`UInt8, `UInt16, `UInt32, `UInt64, `USize] do
  let typeName := Lean.mkIdent typeName'
  Lean.Elab.Command.elabCommand (← `(
    namespace $typeName
      instance neZero : NeZero size := ⟨by decide⟩

      instance : Neg $typeName where
        neg a := mk (-a.val)

      instance : Pow $typeName ℕ where
        pow a n := mk (a.val ^ n)

      instance : SMul ℕ $typeName where
        smul n a := mk (n • a.val)

      instance : SMul ℤ $typeName where
        smul z a := mk (z • a.val)

      lemma neg_def (a : $typeName) : -a = ⟨-a.val⟩ := rfl

      lemma pow_def (a : $typeName) (n : ℕ) : a ^ n = ⟨a.val ^ n⟩ := rfl

      lemma nsmul_def (n : ℕ) (a : $typeName) : n • a = ⟨n • a.val⟩ := rfl

      lemma zsmul_def (z : ℤ) (a : $typeName) : z • a = ⟨z • a.val⟩ := rfl

      open $typeName (eq_of_val_eq) in
      lemma val_injective : Function.Injective val := @eq_of_val_eq

      instance instCommMonoid : CommMonoid $typeName :=
        Function.Injective.commMonoid val val_injective
          rfl (fun _ _ => rfl) (fun _ _ => rfl)

      instance instNonUnitalCommRing : NonUnitalCommRing $typeName :=
        Function.Injective.nonUnitalCommRing val val_injective
          rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
          (fun _ _ => rfl) (fun _ _ => rfl)

      local instance instNatCast : NatCast $typeName where
        natCast n := mk n

      local instance instIntCast : IntCast $typeName where
        intCast z := mk z

      lemma natCast_def (n : ℕ) : (n : $typeName) = ⟨n⟩ := rfl

      lemma intCast_def (z : ℤ) : (z : $typeName) = ⟨z⟩ := rfl

      local instance instCommRing : CommRing $typeName :=
        Function.Injective.commRing val val_injective
          rfl rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
          (fun _ _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ => rfl)

      namespace CommRing
      attribute [scoped instance] instCommRing instNatCast instIntCast
      end CommRing

    end $typeName
  ))
  -- interpolating docstrings above is more trouble than it's worth
  let docString :=
    s!"To use this instance, use `open scoped {typeName'}.CommRing`.\n\n" ++
    "See the module docstring for an explanation"
  Lean.addDocString (typeName'.mkStr "instCommRing") docString
  Lean.addDocString (typeName'.mkStr "instNatCast") docString
  Lean.addDocString (typeName'.mkStr "instIntCast") docString


theorem measure_iUnion_congr_of_subset [Countable β] {s : β → Set α} {t : β → Set α}
    (hsub : ∀ b, s b ⊆ t b) (h_le : ∀ b, μ (t b) ≤ μ (s b)) : μ (⋃ b, s b) = μ (⋃ b, t b)

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[Countable β]
{s t : β → Set α}
(hsub : ∀ (b : β), s b ⊆ t b)
(h_le : ∀ (b : β), μ (t b) ≤ μ (s b))


/-- The Jordan decomposition of a signed measure is unique. -/
theorem toSignedMeasure_injective : Injective <| @JordanDecomposition.toSignedMeasure α _


/-- The binary coproduct functor. -/
@[simps]
def coprod.functor : C ⥤ C ⥤ C

∀ {X Y : C} (f : X ⟶ Y) (T : C),
  (CategoryTheory.Limits.coprod.functor.map f).app T = CategoryTheory.Limits.coprod.map f (𝟙 T)


@[simp]
theorem lift_comp_of {N} [Monoid N] (fi : ∀ i, M i →* N) i : (lift fi).comp of = fi i

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
{N : Type u_4}
[Monoid N]
(fi : (i : ι) → M i →* N)
(i : ι)

(Monoid.CoprodI.lift fi).comp Monoid.CoprodI.of = fi i


protected theorem dvd_add : ∀ {a b c : Int}, a ∣ b → a ∣ c → a ∣ b + c


/-- See `add_tsub_add_eq_tsub_right` for the equality. -/
theorem add_tsub_add_le_tsub_right : a + c - (b + c) ≤ a - b

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


theorem associated_isUnit_mul_right_iff {β : Type*} [CommMonoid β] {a u b : β} (hu : IsUnit u) :
    Associated a (u * b) ↔ Associated a b

{β : Type u_5}
[CommMonoid β]
{a u b : β}
(hu : IsUnit u)


@[simp]
theorem conjTranspose_sub [AddGroup α] [StarAddMonoid α] (M N : Matrix m n α) :
    (M - N)ᴴ = Mᴴ - Nᴴ

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[AddGroup α]
[StarAddMonoid α]
(M N : Matrix m n α)


/-- In a T0 topological space equipped with a sigma algebra which contains all open sets,
the assignment `x ↦ diracProba x` is injective. -/
lemma injective_diracProba_of_T0 [T0Space X] :
    Function.Injective (fun (x : X) ↦ diracProba x)

{X : Type u_1}
[MeasurableSpace X]
[TopologicalSpace X]
[OpensMeasurableSpace X]
[T0Space X]

Function.Injective fun x => MeasureTheory.diracProba x


theorem interUnionPullbackConeLift_left :
    interUnionPullbackConeLift F U V s ≫ F.1.map (homOfLE le_sup_left).op = s.fst

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

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


theorem derivWithin_sin (hf : DifferentiableWithinAt ℝ f s x) (hxs : UniqueDiffWithinAt ℝ s x) :
    derivWithin (fun x => Real.sin (f x)) s x = Real.cos (f x) * derivWithin f s x

{f : ℝ → ℝ}
{x : ℝ}
{s : Set ℝ}
(hf : DifferentiableWithinAt ℝ f s x)
(hxs : UniqueDiffWithinAt ℝ s x)


theorem lt_lsub {ι} (f : ι → Ordinal) (i) : f i < lsub f

{ι : Type u_4}
(f : ι → Ordinal.{max u_5 u_4})
(i : ι)


/-- The tangent of an angle in a right-angled triangle as a ratio of sides. -/
theorem tan_oangle_left_of_oangle_eq_pi_div_two {p₁ p₂ p₃ : P} (h : ∡ p₁ p₂ p₃ = ↑(π / 2)) :
    Real.Angle.tan (∡ p₃ p₁ p₂) = dist p₃ p₂ / dist p₁ p₂

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

(∡ p₃ p₁ p₂).tan = dist p₃ p₂ / dist p₁ p₂


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

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Inf α]
[Inf β]
[Inf γ]
(f : InfHom β γ)
(g : InfHom α β)
(a : α)


theorem Algebra.trace_ne_zero [FiniteDimensional K L] [Algebra.IsSeparable K L] :
    Algebra.trace K L ≠ 0

(K : Type u_4)
(L : Type u_5)
[Field K]
[Field L]
[Algebra K L]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]


/-- If `t` is a measurable set, then the measure of `t` with respect to the restriction of
  the measure to `s` equals the outer measure of `t ∩ s`. An alternate version requiring that `s`
  be measurable instead of `t` exists as `Measure.restrict_apply'`. -/
@[simp]
theorem restrict_apply (ht : MeasurableSet t) : μ.restrict s t = μ (t ∩ s)

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t : Set α}
(ht : MeasurableSet t)


@[simp] theorem subset_append_right (l₁ l₂ : List α) : l₂ ⊆ l₁ ++ l₂


@[simp]
theorem sum_weightedVSubVSubWeights [DecidableEq ι] {i j : ι} (hi : i ∈ s) (hj : j ∈ s) :
    ∑ t ∈ s, weightedVSubVSubWeights k i j t = 0

(k : Type u_1)
[Ring k]
{ι : Type u_4}
(s : Finset ι)
[DecidableEq ι]
{i j : ι}
(hi : i ∈ s)
(hj : j ∈ s)

∑ t ∈ s, Finset.weightedVSubVSubWeights k i j t = 0


theorem div_neg_of_pos_of_neg (ha : 0 < a) (hb : b < 0) : a / b < 0

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


/-- `z • r` is a multiple of `p` iff `r` is `pk/z` above a multiple of `p`, where `0 ≤ k < |z|`. -/
theorem zsmul_mem_zmultiples_iff_exists_sub_div {r : R} {z : ℤ} (hz : z ≠ 0) :
    z • r ∈ AddSubgroup.zmultiples p ↔
      ∃ k : Fin z.natAbs, r - (k : ℕ) • (p / z : R) ∈ AddSubgroup.zmultiples p

{R : Type u_1}
[DivisionRing R]
[CharZero R]
{p r : R}
{z : ℤ}
(hz : z ≠ 0)

z • r ∈ AddSubgroup.zmultiples p ↔ ∃ k, r - ↑k • (p / ↑z) ∈ AddSubgroup.zmultiples p


@[simp]
theorem run_mk (x : m (Except ε α)) : ExceptT.run (ExceptT.mk x) = x

{α ε : Type u}
{m : Type u → Type v}
(x : m (Except ε α))


theorem continuous_coe_iff {f : α → ℝ} : (Continuous fun a => (f a : EReal)) ↔ Continuous f

{α : Type u_1}
[TopologicalSpace α]
{f : α → ℝ}

(Continuous fun a => ↑(f a)) ↔ Continuous f


@[simp]
theorem sep_eq_empty_iff_mem_false : { x ∈ s | p x } = ∅ ↔ ∀ x ∈ s, ¬p x


@[gcongr] protected theorem div_le_div_right (h : a ≤ b) (c : ℝ≥0∞) : a / c ≤ b / c

{a b : ENNReal}
(h : a ≤ b)
(c : ENNReal)


theorem locallySmall_max {C : Type u} [Category.{v} C] : LocallySmall.{max v w} C

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

CategoryTheory.LocallySmall.{max v w, v, u} C


@[simp]
theorem blockDiagonal'_zero : blockDiagonal' (0 : ∀ i, Matrix (m' i) (n' i) α) = 0

{o : Type u_4}
{m' : o → Type u_7}
{n' : o → Type u_8}
{α : Type u_12}
[DecidableEq o]
[Zero α]


/-- The identity equivalence from a first-order language to itself. -/
@[simps]
protected def refl : L ≃ᴸ L

(FirstOrder.Language.LEquiv.refl L).toLHom = FirstOrder.Language.LHom.id L


theorem shift_shiftFunctorCompIsoId_add_neg_self_inv_app (n : A) (X : C) :
    ((shiftFunctorCompIsoId C n (-n) (add_neg_self n)).inv.app X)⟦n⟧' =
    (shiftFunctorCompIsoId C (-n) n (neg_add_self n)).inv.app (X⟦n⟧)

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

(CategoryTheory.shiftFunctor C n).map ((CategoryTheory.shiftFunctorCompIsoId C n (-n) ⋯).inv.app X) =
  (CategoryTheory.shiftFunctorCompIsoId C (-n) n ⋯).inv.app ((CategoryTheory.shiftFunctor C n).obj X)


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

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


theorem mono_iff_ker_eq_bot : Mono f ↔ LinearMap.ker f = ⊥

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

CategoryTheory.Mono f ↔ LinearMap.ker f = ⊥


theorem ndunion_le {s t u : Multiset α} : ndunion s t ≤ u ↔ s ⊆ u ∧ t ≤ u

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


@[fun_prop]
theorem differentiableOn_pi'' (hφ : ∀ i, DifferentiableOn 𝕜 (fun x => Φ x i) s) :
    DifferentiableOn 𝕜 Φ s

(hφ : ∀ (i : ι), DifferentiableOn 𝕜 (fun x => Φ x i) s)


theorem union_eq_union_iff_left : s ∪ t = s ∪ u ↔ t ⊆ s ∪ u ∧ u ⊆ s ∪ t

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


theorem mem_sep (xs : x ∈ s) (px : p x) : x ∈ { x ∈ s | p x }

{α : Type u}
{s : Set α}
{p : α → Prop}
{x : α}
(xs : x ∈ s)
(px : p x)


@[simp]
theorem mk_sub_mk (a₁ a₂ a₃ a₄ b₁ b₂ b₃ b₄ : R) :
    (mk a₁ a₂ a₃ a₄ : ℍ[R,c₁,c₂]) - mk b₁ b₂ b₃ b₄ = mk (a₁ - b₁) (a₂ - b₂) (a₃ - b₃) (a₄ - b₄)

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(a₁ a₂ a₃ a₄ b₁ b₂ b₃ b₄ : R)

{ re := a₁, imI := a₂, imJ := a₃, imK := a₄ } - { re := b₁, imI := b₂, imJ := b₃, imK := b₄ } =
  { re := a₁ - b₁, imI := a₂ - b₂, imJ := a₃ - b₃, imK := a₄ - b₄ }


theorem not_mem_cons_of_ne_of_not_mem {a y : α} {l : List α} : a ≠ y → a ∉ l → a ∉ y::l


lemma Order.radical_le_coatom {a : α} (h : IsCoatom a) : radical α ≤ a

{α : Type u_1}
[CompleteLattice α]
{a : α}
(h : IsCoatom a)


/-- `yoneda'` induces an equivalence of category between `Type u` and
`SheafOfTypes typesGrothendieckTopology`. -/
@[simps!]
noncomputable def typeEquiv : Type u ≌ SheafOfTypes typesGrothendieckTopology

∀ (a : (CategoryTheory.Functor.id (Type u)).obj X),
  CategoryTheory.typeEquiv.unitIso.hom.app X a =
    CategoryTheory.CategoryStruct.comp
      ((CategoryTheory.evalEquiv (CategoryTheory.yoneda.obj X) ⋯ PUnit.{u + 1}) fun x => a) fun f => f PUnit.unit


/-- Two `v w : Vector α n` are equal iff they are equal at every single index. -/
@[ext]
theorem ext : ∀ {v w : Vector α n} (_ : ∀ m : Fin n, Vector.get v m = Vector.get w m), v = w

{n : ℕ}
{α : Type u_1}
{v w : Mathlib.Vector α n}

(∀ (m : Fin n), v.get m = w.get m) → v = w


lemma integral_exp_tilted (f g : α → ℝ) :
    ∫ x, exp (g x) ∂(μ.tilted f) = (∫ x, exp ((f + g) x) ∂μ) / ∫ x, exp (f x) ∂μ

{α : Type u_1}
{mα : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(f g : α → ℝ)

∫ (x : α), rexp (g x) ∂μ.tilted f = (∫ (x : α), rexp ((f + g) x) ∂μ) / ∫ (x : α), rexp (f x) ∂μ