/-- If `k` is separably closed, `K / k` is a field extension, `L / k` is an intermediate field
which is separable, then `L` is equal to `k`. A corollary of `IsSepClosed.algebraMap_surjective`. -/
theorem IntermediateField.eq_bot_of_isSepClosed_of_isSeparable [IsSepClosed k] [Algebra k K]
    (L : IntermediateField k K) [Algebra.IsSeparable k L] : L = ⊥

{k : Type u}
[Field k]
{K : Type v}
[Field K]
[IsSepClosed k]
[Algebra k K]
(L : IntermediateField k K)
[Algebra.IsSeparable k ↥L]


@[to_additive (attr := simp)]
theorem alternatingProd_cons (a : α) (l : List α) :
    alternatingProd (a :: l) = a / alternatingProd l

{α : Type u_2}
[CommGroup α]
(a : α)
(l : List α)

(a :: l).alternatingProd = a / l.alternatingProd


theorem eq_of_ne_mem {x y : α} {z z' : Sym2 α} (h : x ≠ y) (h1 : x ∈ z) (h2 : y ∈ z) (h3 : x ∈ z')
    (h4 : y ∈ z') : z = z'

{α : Type u_1}
{x y : α}
{z z' : Sym2 α}
(h : x ≠ y)
(h1 : x ∈ z)
(h2 : y ∈ z)
(h3 : x ∈ z')
(h4 : y ∈ z')


protected theorem tsub_lt_tsub_iff_left_of_le_of_le [ContravariantClass α α (· + ·) (· < ·)]
    (hb : AddLECancellable b) (hab : AddLECancellable (a - b)) (h₁ : b ≤ a) (h₂ : c ≤ a) :
    a - b < a - c ↔ c < b

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

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


theorem isCycle_iff_sameCycle (hx : f x ≠ x) : IsCycle f ↔ ∀ {y}, SameCycle f x y ↔ f y ≠ y

{α : Type u_2}
{f : Equiv.Perm α}
{x : α}
(hx : f x ≠ x)

f.IsCycle ↔ ∀ {y : α}, f.SameCycle x y ↔ f y ≠ y


theorem rat_sub (h : Irrational x) : Irrational (q - x)


/-- A weighted sum may be split into a subtraction of such sums over two subsets. -/
theorem weightedVSub_sdiff_sub [DecidableEq ι] {s₂ : Finset ι} (h : s₂ ⊆ s) (w : ι → k)
    (p : ι → P) : (s \ s₂).weightedVSub p w - s₂.weightedVSub p (-w) = s.weightedVSub p w

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

((s \ s₂).weightedVSub p) w - (s₂.weightedVSub p) (-w) = (s.weightedVSub p) w


/-- A Galois coinsertion is a Galois connection where `u ∘ l = id`. It also contains a constructive
choice function, to give better definitional equalities when lifting order structures. Dual to
`GaloisInsertion` -/
structure GaloisCoinsertion [Preorder α] [Preorder β] (l : α → β) (u : β → α) where
  /-- A contructive choice function for images of `u`. -/
  choice : ∀ x : β, x ≤ l (u x) → α
  /-- The Galois connection associated to a Galois coinsertion. -/
  gc : GaloisConnection l u
  /-- Main property of a Galois coinsertion. -/
  u_l_le : ∀ x, u (l x) ≤ x
  /-- Property of the choice function. -/
  choice_eq : ∀ a h, choice a h = u a

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{l : α → β}
{u : β → α}
(self : GaloisCoinsertion l u)
(x : α)


/-- `limsup` over `ℕ` is measurable. See `measurable_limsup'` for a version with a general filter.
-/
@[measurability]
theorem measurable_limsup {f : ℕ → δ → α} (hf : ∀ i, Measurable (f i)) :
    Measurable fun x => limsup (fun i => f i x) atTop

{α : Type u_1}
{δ : Type u_4}
[TopologicalSpace α]
[MeasurableSpace α]
[BorelSpace α]
[MeasurableSpace δ]
[ConditionallyCompleteLinearOrder α]
[OrderTopology α]
[SecondCountableTopology α]
{f : ℕ → δ → α}
(hf : ∀ (i : ℕ), Measurable (f i))

Measurable fun x => Filter.limsup (fun i => f i x) Filter.atTop


lemma generateFrom_countableGeneratingSet [m : MeasurableSpace α] [h : CountablyGenerated α] :
    generateFrom (countableGeneratingSet α) = m

[h : MeasurableSpace.CountablyGenerated α]

MeasurableSpace.generateFrom (MeasurableSpace.countableGeneratingSet α) = m


theorem uniformEmbedding_comp (g : C(β, δ)) (hg : UniformEmbedding g) :
    UniformEmbedding (ContinuousMap.comp g : C(α, β) → C(α, δ))

{α : Type u₁}
{β : Type u₂}
[TopologicalSpace α]
[UniformSpace β]
{δ : Type u_2}
[UniformSpace δ]
(g : C(β, δ))
(hg : UniformEmbedding ⇑g)


@[to_additive (attr := simp)]
protected theorem map_one {β} (f : α → β) : (1 : WithBot α).map f = (f 1 : WithBot β)

{α : Type u}
[One α]
{β : Type u_1}
(f : α → β)


theorem repr_reindex_apply (i' : ι') : (b.reindex e).repr x i' = b.repr x (e.symm i')

{ι : Type u_1}
{ι' : Type u_2}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(b : Basis ι R M)
(x : M)
(e : ι ≃ ι')
(i' : ι')

((b.reindex e).repr x) i' = (b.repr x) (e.symm i')


/-- Functoriality of `restrictedYonedaObj η` in `η`. -/
@[simps]
def restrictedYonedaObjMap₁ {F G : Cᵒᵖ ⥤ Type v} {η : F ⟶ A} {μ : G ⟶ A} (ε : F ⟶ G)
    (hε : ε ≫ μ = η) : restrictedYonedaObj η ⟶ restrictedYonedaObj μ

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

(hε : CategoryTheory.CategoryStruct.comp ε μ = η)

(s : (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ)

(u : (CategoryTheory.OverPresheafAux.restrictedYonedaObj η).obj s)

(CategoryTheory.OverPresheafAux.restrictedYonedaObjMap₁ ε hε).app s u =
  CategoryTheory.OverPresheafAux.OverArrows.map₁ u ε hε


/-- If `C` holds for the `algebraMap` of `r : R` into `TensorAlgebra R M`, the `ι` of `x : M`,
and is preserved under addition and muliplication, then it holds for all of `TensorAlgebra R M`.
-/
@[elab_as_elim]
theorem induction {C : TensorAlgebra R M → Prop}
    (algebraMap : ∀ r, C (algebraMap R (TensorAlgebra R M) r)) (ι : ∀ x, C (ι R x))
    (mul : ∀ a b, C a → C b → C (a * b)) (add : ∀ a b, C a → C b → C (a + b))
    (a : TensorAlgebra R M) : C a

(algebraMap : ∀ (r : R), C ((algebraMap R (TensorAlgebra R M)) r))

(ι : ∀ (x : M), C ((TensorAlgebra.ι R) x))

(mul : ∀ (a b : TensorAlgebra R M), C a → C b → C (a * b))

(add : ∀ (a b : TensorAlgebra R M), C a → C b → C (a + b))


/-- Assumes right covariance. -/
theorem Right.mul_nonneg [MulPosMono α] (ha : 0 ≤ a) (hb : 0 ≤ b) : 0 ≤ a * b

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


@[simp]
theorem sort_nodup (s : Finset α) : (sort r s).Nodup

{α : Type u_1}
(r : α → α → Prop)
[DecidableRel r]
[IsTrans α r]
[IsAntisymm α r]
[IsTotal α r]
(s : Finset α)


@[simp]
theorem limitRecOn_zero {C} (H₁ H₂ H₃) : @limitRecOn C 0 H₁ H₂ H₃ = H₁

(H₂ : (o : Ordinal.{u_4}) → C o → C (Order.succ o))

(H₃ : (o : Ordinal.{u_4}) → o.IsLimit → ((o' : Ordinal.{u_4}) → o' < o → C o') → C o)


theorem inter_union_distrib_left (s t u : Set α) : s ∩ (t ∪ u) = s ∩ t ∪ s ∩ u


/-- If `m₁ s = op (m₂ s)` for all `s`, then the same is true for `m₁.trim` and `m₂.trim`. -/
theorem trim_op {m₁ m₂ : OuterMeasure α} {op : ℝ≥0∞ → ℝ≥0∞} (h : ∀ s, m₁ s = op (m₂ s))
    (s : Set α) : m₁.trim s = op (m₂.trim s)

{α : Type u_1}
[MeasurableSpace α]
{m₁ m₂ : MeasureTheory.OuterMeasure α}
{op : ℝ≥0∞ → ℝ≥0∞}
(h : ∀ (s : Set α), m₁ s = op (m₂ s))
(s : Set α)


@[to_additive]
theorem multipliable_of_ne_finset_one (hf : ∀ b ∉ s, f b = 1) : Multipliable f

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
{f : β → α}
{s : Finset β}
(hf : ∀ b ∉ s, f b = 1)


theorem arg_eq_nhds_of_im_neg (hz : im z < 0) : arg =ᶠ[𝓝 z] fun x => -Real.arccos (x.re / abs x)

Complex.arg =ᶠ[𝓝 z] fun x => -Real.arccos (x.re / Complex.abs x)


theorem union_le_union_left (h : s ≤ t) (u) : u ∪ s ≤ u ∪ t

{α : Type u_1}
[DecidableEq α]
{s t : Multiset α}
(h : s ≤ t)
(u : Multiset α)


theorem modEq_sub (a b : α) : a ≡ b [PMOD b - a]

{α : Type u_1}
[AddCommGroup α]
(a b : α)


theorem flat_of_preservesFiniteLimits [HasFiniteLimits C] (F : C ⥤ D) [PreservesFiniteLimits F] :
    RepresentablyFlat F


theorem comap_injective_of_surjective : Function.Injective (comap f)

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
{F : Type u_9}
[FunLike F M M₂]
[SemilinearMapClass F σ₁₂ M M₂]
[RingHomSurjective σ₁₂]
{f : F}
(hf : Function.Surjective ⇑f)


@[to_additive (attr := to_additive) (reorder := 5 6) smul_def]
theorem pow_def [∀ i, Pow (f i) β] (x : ∀ i, f i) (b : β) : x ^ b = fun i => x i ^ b

{I : Type u}
{β : Type u_2}
{f : I → Type v₁}
[(i : I) → Pow (f i) β]
(x : (i : I) → f i)
(b : β)


theorem MulEquiv.uniqueFactorizationMonoid_iff (e : α ≃* β) :
    UniqueFactorizationMonoid α ↔ UniqueFactorizationMonoid β

{α : Type u_1}
{β : Type u_2}
[CancelCommMonoidWithZero α]
[CancelCommMonoidWithZero β]
(e : α ≃* β)


protected theorem congr' (h_left : ∀ᶠ i in l, f i =ᵐ[μ] f' i) (h_right : g =ᵐ[μ] g')
    (h_tendsto : TendstoInMeasure μ f l g) : TendstoInMeasure μ f' l g'

(h_left : ∀ᶠ (i : ι) in l, f i =ᵐ[μ] f' i)

(h_tendsto : MeasureTheory.TendstoInMeasure μ f l g)

MeasureTheory.TendstoInMeasure μ f' l g'


lemma Function.Injective.IsLocallyInjective {f : X → Y} (inj : f.Injective) :
    IsLocallyInjective f

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
{f : X → Y}
(inj : Function.Injective f)


theorem exists_finset_toPartitionOfUnity_eventuallyEq (i : ι) (x : X) : ∃ t : Finset ι,
    f.toPartitionOfUnity i =ᶠ[𝓝 x] f i * ∏ j ∈ t.filter fun j => WellOrderingRel j i, (1 - f j)

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

∃ t, ⇑(f.toPartitionOfUnity i) =ᶠ[𝓝 x] ⇑(f i) * ⇑(∏ j ∈ Finset.filter (fun j => WellOrderingRel j i) t, (1 - f j))


theorem sum_eq_of_subset {S : Type*} [AddCommMonoid S] {p : R[X]} (f : ℕ → R → S)
    (hf : ∀ i, f i 0 = 0) {s : Finset ℕ} (hs : p.support ⊆ s) :
    p.sum f = ∑ n ∈ s, f n (p.coeff n)

{R : Type u}
[Semiring R]
{S : Type u_1}
[AddCommMonoid S]
{p : R[X]}
(f : ℕ → R → S)
(hf : ∀ (i : ℕ), f i 0 = 0)
{s : Finset ℕ}
(hs : p.support ⊆ s)


theorem pow_sub_pow_of_prime {p : R} (hp : Prime p) {x y : R} (hxy : p ∣ x - y) (hx : ¬p ∣ x)
    {n : ℕ} (hn : ¬p ∣ n) : multiplicity p (x ^ n - y ^ n) = multiplicity p (x - y)

{R : Type u_1}
[CommRing R]
[IsDomain R]
[DecidableRel fun x x_1 => x ∣ x_1]
{p : R}
(hp : Prime p)
{x y : R}
(hxy : p ∣ x - y)
(hx : ¬p ∣ x)
{n : ℕ}
(hn : ¬p ∣ ↑n)


/-- If `K` admits an orthogonal projection, then the orthogonal complement of its orthogonal
complement is itself. -/
@[simp]
theorem Submodule.orthogonal_orthogonal [HasOrthogonalProjection K] : Kᗮᗮ = K

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


@[simp]
theorem prod_self_le_prod_self : s₁ ×ˢ s₁ ≤ s₂ ×ˢ s₂ ↔ s₁ ≤ s₂

{α : Type u_1}
[Preorder α]
{s₁ s₂ : LowerSet α}

s₁ ×ˢ s₁ ≤ s₂ ×ˢ s₂ ↔ s₁ ≤ s₂


/-- `p` is equidistant from two points in `s` if and only if its
`orthogonalProjection` is. -/
theorem dist_eq_iff_dist_orthogonalProjection_eq {s : AffineSubspace ℝ P} [Nonempty s]
    [HasOrthogonalProjection s.direction] {p1 p2 : P} (p3 : P) (hp1 : p1 ∈ s) (hp2 : p2 ∈ s) :
    dist p1 p3 = dist p2 p3 ↔
      dist p1 (orthogonalProjection s p3) = dist p2 (orthogonalProjection s p3)

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{s : AffineSubspace ℝ P}
[Nonempty ↥s]
[HasOrthogonalProjection s.direction]
{p1 p2 : P}
(p3 : P)
(hp1 : p1 ∈ s)
(hp2 : p2 ∈ s)

dist p1 p3 = dist p2 p3 ↔
  dist p1 ↑((EuclideanGeometry.orthogonalProjection s) p3) = dist p2 ↑((EuclideanGeometry.orthogonalProjection s) p3)


/-- For a function on a convex set in a linearly ordered space (where the order and the algebraic
structures aren't necessarily compatible), in order to prove that it is strictly convex, it suffices
to verify the inequality `f (a • x + b • y) < a • f x + b • f y` for `x < y` and positive `a`, `b`.
The main use case is `E = 𝕜` however one can apply it, e.g., to `𝕜^n` with lexicographic order. -/
theorem LinearOrder.strictConvexOn_of_lt (hs : Convex 𝕜 s)
    (hf : ∀ ⦃x⦄, x ∈ s → ∀ ⦃y⦄, y ∈ s → x < y → ∀ ⦃a b : 𝕜⦄, 0 < a → 0 < b → a + b = 1 →
      f (a • x + b • y) < a • f x + b • f y) :
    StrictConvexOn 𝕜 s f

(hf :
  ∀ ⦃x : E⦄,
    x ∈ s → ∀ ⦃y : E⦄, y ∈ s → x < y → ∀ ⦃a b : 𝕜⦄, 0 < a → 0 < b → a + b = 1 → f (a • x + b • y) < a • f x + b • f y)


theorem card_Ico :
    (Finset.Ico s t).card = ∏ i ∈ s.toFinset ∪ t.toFinset, (t.count i + 1 - s.count i) - 1

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

(Finset.Ico s t).card = ∏ i ∈ s.toFinset ∪ t.toFinset, (Multiset.count i t + 1 - Multiset.count i s) - 1


private lemma toSet_equiv_aux {s : Set ZFSet.{u}} (hs : Small.{u} s) :
  (mk <| PSet.mk (Shrink s) fun x ↦ ((equivShrink s).symm x).1.out).toSet = s

{s : Set ZFSet}
(hs : Small.{u, u + 1} ↑s)

(ZFSet.mk (PSet.mk (Shrink.{u, u + 1} ↑s) fun x => Quotient.out ↑((equivShrink ↑s).symm x))).toSet = s


lemma card_ne_zero : Nat.card α ≠ 0 ↔ Nonempty α ∧ Finite α


@[to_additive]
theorem card_top : Nat.card (⊤ : Subgroup G) = Nat.card G


protected theorem ext_iff {f g : A₁ ≃ₐ[R] A₂} : f = g ↔ ∀ x, f x = g x

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Algebra R A₁]
[Algebra R A₂]
{f g : A₁ ≃ₐ[R] A₂}


@[to_additive (attr := simp) AddEquiv.add_submonoid_map_symm_apply]
theorem submonoidMap_symm_apply (e : M ≃* N) (S : Submonoid M) (g : S.map (e : M →* N)) :
    (e.submonoidMap S).symm g = ⟨e.symm g, SetLike.mem_coe.1 <| Set.mem_image_equiv.1 g.2⟩

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
(e : M ≃* N)
(S : Submonoid M)
(g : ↥(Submonoid.map (↑e) S))

(e.submonoidMap S).symm g = ⟨e.symm ↑g, ⋯⟩


@[simp]
theorem mk_X_2 : (mk X₀ X₁ X₂ d₀ d₁ s succ).X 2 = X₂

(succ : (S : CategoryTheory.ShortComplex V) → (X₄ : V) ×' (d₂ : S.X₃ ⟶ X₄) ×' S.g ≫ d₂ = 0)

(CochainComplex.mk X₀ X₁ X₂ d₀ d₁ s succ).X 2 = X₂


theorem DifferentiableWithinAt.zpow (hf : DifferentiableWithinAt 𝕜 f t a) (h : f a ≠ 0 ∨ 0 ≤ m) :
    DifferentiableWithinAt 𝕜 (fun x => f x ^ m) t a

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type v}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{m : ℤ}
{f : E → 𝕜}
{t : Set E}
{a : E}
(hf : DifferentiableWithinAt 𝕜 f t a)
(h : f a ≠ 0 ∨ 0 ≤ m)


theorem isSheaf_yoneda' {α : Type u} : IsSheaf typesGrothendieckTopology (yoneda.obj α)

CategoryTheory.Presieve.IsSheaf CategoryTheory.typesGrothendieckTopology (CategoryTheory.yoneda.obj α)


lemma WCovBy.of_le_of_le' (hac : a ⩿ c) (hab : a ≤ b) (hbc : b ≤ c) : a ⩿ b

{α : Type u_1}
[Preorder α]
{a b c : α}
(hac : a ⩿ c)
(hab : a ≤ b)
(hbc : b ≤ c)


@[reassoc (attr := simp)]
theorem unit_rightAdjointUniq_hom_app {F : C ⥤ D} {G G' : D ⥤ C} (adj1 : F ⊣ G) (adj2 : F ⊣ G')
    (x : C) : adj1.unit.app x ≫ (rightAdjointUniq adj1 adj2).hom.app (F.obj x) =
      adj2.unit.app x

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
{F : C ⥤ D}
{G G' : D ⥤ C}
(adj1 : F ⊣ G)
(adj2 : F ⊣ G')
(x : C)

adj1.unit.app x ≫ (adj1.rightAdjointUniq adj2).hom.app (F.obj x) = adj2.unit.app x


theorem exists_pow_nat_eq [IsSepClosed k] (x : k) (n : ℕ) [hn : NeZero (n : k)] :
    ∃ z, z ^ n = x

{k : Type u}
[Field k]
[IsSepClosed k]
(x : k)
(n : ℕ)
[hn : NeZero ↑n]


theorem Pi.uniformContinuous_postcomp {α : Type*} [UniformSpace α] {g : α → β}
    (hg : UniformContinuous g) : UniformContinuous (g ∘ · : (ι → α) → (ι → β))

{ι : Type u_1}
{β : Type u_3}
[UniformSpace β]
{α : Type u_4}
[UniformSpace α]
{g : α → β}
(hg : UniformContinuous g)


@[to_additive (attr := simp)]
lemma dist_op (x y : α) : dist (op x) (op y) = dist x y

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

dist (MulOpposite.op x) (MulOpposite.op y) = dist x y


/-- Coalgebra equivalences are transitive. -/
@[trans, simps!]
def trans (e₁₂ : A ≃ₗc[R] B) (e₂₃ : B ≃ₗc[R] C) : A ≃ₗc[R] C

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
[CommSemiring R]
[AddCommMonoid A]
[AddCommMonoid B]
[AddCommMonoid C]
[Module R A]
[Module R B]
[Module R C]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
[CoalgebraStruct R C]
(e₁₂ : A ≃ₗc[R] B)
(e₂₃ : B ≃ₗc[R] C)

∀ (a : C), (e₁₂.trans e₂₃).invFun a = (↑e₁₂).symm ((↑e₂₃).symm a)


theorem single_mul_apply [AddGroup G] (r : k) (x : G) (f : k[G]) (y : G) :
    (single x r * f) y = r * f (-x + y)

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

(AddMonoidAlgebra.single x r * f) y = r * f (-x + y)


/-- There is a natural equivalence when swapping the coefficients of a quaternion algebra. -/
@[simps]
def swapEquiv : ℍ[R,c₁,c₂] ≃ₐ[R] ℍ[R, c₂, c₁]

{R : Type u_3}
[CommRing R]
(c₁ c₂ : R)
(t : ℍ[R,c₁,c₂])

((QuaternionAlgebra.swapEquiv c₁ c₂) t).imJ = t.imI


theorem interior_closedBall (x : E) {r : ℝ} (hr : r ≠ 0) :
    interior (closedBall x r) = ball x r

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

interior (Metric.closedBall x r) = Metric.ball x r


private theorem HD_lipschitz_aux1 (f g : Cb X Y) :
    (⨆ x, ⨅ y, f (inl x, inr y)) ≤ (⨆ x, ⨅ y, g (inl x, inr y)) + dist f g

{X : Type u}
{Y : Type v}
[MetricSpace X]
[Nonempty X]
[MetricSpace Y]
[Nonempty Y]
(f g : GromovHausdorff.Cb X Y)

⨆ x, ⨅ y, f (Sum.inl x, Sum.inr y) ≤ (⨆ x, ⨅ y, g (Sum.inl x, Sum.inr y)) + dist f g


/-- The characterization of the orthogonal projection.  -/
@[simp]
theorem orthogonalProjection_inner_eq_zero (v : E) :
    ∀ w ∈ K, ⟪v - orthogonalProjection K v, w⟫ = 0

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

w ∈ K → ⟪v - ↑((orthogonalProjection K) v), w⟫_𝕜 = 0


theorem natDegree_eq_card_roots' {p : K[X]} {i : K →+* L} (hsplit : Splits i p) :
    (p.map i).natDegree = Multiset.card (p.map i).roots

{K : Type v}
{L : Type w}
[CommRing K]
[Field L]
{p : K[X]}
{i : K →+* L}
(hsplit : Polynomial.Splits i p)

(Polynomial.map i p).natDegree = Multiset.card (Polynomial.map i p).roots


/-- The cosine of an angle in a right-angled triangle as a ratio of sides, version subtracting
vectors. -/
theorem cos_angle_sub_of_inner_eq_zero {x y : V} (h : ⟪x, y⟫ = 0) :
    Real.cos (angle x (x - y)) = ‖x‖ / ‖x - y‖

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
{x y : V}
(h : ⟪x, y⟫_ℝ = 0)

Real.cos (InnerProductGeometry.angle x (x - y)) = ‖x‖ / ‖x - y‖


theorem linear_eq_zero_iff_exists_const (f : P1 →ᵃ[k] P2) :
    f.linear = 0 ↔ ∃ q, f = const k P1 q

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

f.linear = 0 ↔ ∃ q, f = AffineMap.const k P1 q


theorem withTopEquiv_symm_lt {x y : ℕ∞} : withTopEquiv.symm x < withTopEquiv.symm y ↔ x < y

PartENat.withTopEquiv.symm x < PartENat.withTopEquiv.symm y ↔ x < y


@[simp]
theorem sign_subtypeCongr {p : α → Prop} [DecidablePred p] (ep : Perm { a // p a })
    (en : Perm { a // ¬p a }) : sign (ep.subtypeCongr en) = sign ep * sign en

{α : Type u}
[DecidableEq α]
[Fintype α]
{p : α → Prop}
[DecidablePred p]
(ep : Equiv.Perm { a // p a })
(en : Equiv.Perm { a // ¬p a })

Equiv.Perm.sign (ep.subtypeCongr en) = Equiv.Perm.sign ep * Equiv.Perm.sign en


theorem abv_sub (a b : R) : abv (a - b) = abv (b - a)

{R : Type u_3}
{S : Type u_4}
[OrderedCommRing S]
[NoZeroDivisors S]
[Ring R]
(abv : R → S)
[IsAbsoluteValue abv]
(a b : R)


lemma isIso_descOpcycles_iff (K : ChainComplex C ℕ) {X : C} (φ : K.X 0 ⟶ X)
    [K.HasHomology 0] (hφ : K.d 1 0 ≫ φ = 0) :
    IsIso (K.descOpcycles φ 1 (by simp) hφ) ↔
      (ShortComplex.mk _ _ hφ).Exact ∧ Epi φ

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Abelian C]
(K : ChainComplex C ℕ)
{X : C}
(φ : K.X 0 ⟶ X)
[HomologicalComplex.HasHomology K 0]
(hφ : K.d 1 0 ≫ φ = 0)

CategoryTheory.IsIso (HomologicalComplex.descOpcycles K φ 1 ⋯ hφ) ↔
  (CategoryTheory.ShortComplex.mk (K.d 1 0) φ hφ).Exact ∧ CategoryTheory.Epi φ


theorem divInt_eq_div (n d : ℤ) : n /. d = (n : ℚ) / d


theorem Set.Subsingleton.holderOnWith {s : Set X} (hs : s.Subsingleton) (C r : ℝ≥0) (f : X → Y) :
    HolderOnWith C r f s

{X : Type u_1}
{Y : Type u_2}
[PseudoEMetricSpace X]
[PseudoEMetricSpace Y]
{s : Set X}
(hs : s.Subsingleton)
(C r : ℝ≥0)
(f : X → Y)


theorem Filter.Tendsto.inner {f g : α → E} {l : Filter α} {x y : E} (hf : Tendsto f l (𝓝 x))
    (hg : Tendsto g l (𝓝 y)) : Tendsto (fun t => ⟪f t, g t⟫) l (𝓝 ⟪x, y⟫)

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{α : Type u_4}
{f g : α → E}
{l : Filter α}
{x y : E}
(hf : Filter.Tendsto f l (𝓝 x))
(hg : Filter.Tendsto g l (𝓝 y))

Filter.Tendsto (fun t => ⟪f t, g t⟫_𝕜) l (𝓝 ⟪x, y⟫_𝕜)


theorem uniformContinuous_inl [Zero M] : UniformContinuous (inl : R → tsze R M)

{R : Type u_3}
{M : Type u_4}
[UniformSpace R]
[UniformSpace M]
[Zero M]


@[simp]
lemma mapBifunctorHomologicalComplex_obj_obj_toGradedObject
    (K₁ : HomologicalComplex C₁ c₁) (K₂ : HomologicalComplex C₂ c₂) :
    (((mapBifunctorHomologicalComplex F c₁ c₂).obj K₁).obj K₂).toGradedObject =
      ((GradedObject.mapBifunctor F I₁ I₂).obj K₁.X).obj K₂.X

[∀ (X₁ : C₁), (F.obj X₁).PreservesZeroMorphisms]

(((F.mapBifunctorHomologicalComplex c₁ c₂).obj K₁).obj K₂).toGradedObject =
  ((CategoryTheory.GradedObject.mapBifunctor F I₁ I₂).obj K₁.X).obj K₂.X


theorem coe_iSup_of_directed [Nonempty ι] {S : ι → NonUnitalSubalgebra R A}
    (dir : Directed (· ≤ ·) S) : ↑(iSup S) = ⋃ i, (S i : Set A)

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


protected theorem t4Space [T4Space X] (h : X ≃ₜ Y) : T4Space Y

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


theorem multiplicity.finite_of_not_isUnit [CancelCommMonoidWithZero α] [WfDvdMonoid α]
    {a b : α} (ha : ¬IsUnit a) (hb : b ≠ 0) : multiplicity.Finite a b

{α : Type u_1}
[CancelCommMonoidWithZero α]
[WfDvdMonoid α]
{a b : α}
(ha : ¬IsUnit a)
(hb : b ≠ 0)


/-- The identity morphism in the category `Φ.Iteration ε j`. -/
@[simps]
def id : Hom iter₁ iter₁

(iter₁ : CategoryTheory.Functor.Iteration ε j)

(CategoryTheory.Functor.Iteration.Hom.id iter₁).natTrans = CategoryTheory.CategoryStruct.id iter₁.F


/-- In a preadditive category, if all binary coproducts exist, then all binary biproducts exist. -/
theorem HasBinaryBiproducts.of_hasBinaryCoproducts [HasBinaryCoproducts C] :
    HasBinaryBiproducts C


@[simp]
theorem map_add_nat (x : ℝ) (n : ℕ) : f (x + n) = f x + n


lemma card_eq_finsetCard (s : Finset α) : Nat.card s = s.card


/-- A choice-free shortcut instance. -/
@[to_additive "A choice-free shortcut instance."]
theorem OrderedCommGroup.to_contravariantClass_right_le (α : Type u) [OrderedCommGroup α] :
    ContravariantClass α α (swap (· * ·)) (· ≤ ·)

ContravariantClass α α (Function.swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1


/--
A category (with morphisms in `Type v`) is well-powered if `Subobject X` is `v`-small for every `X`.

We show in `wellPowered_of_essentiallySmall_monoOver` and `essentiallySmall_monoOver`
that this is the case if and only if `MonoOver X` is `v`-essentially small for every `X`.
-/
class WellPowered : Prop where
  subobject_small : ∀ X : C, Small.{v} (Subobject X) := by infer_instance

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

Small.{v, max u₁ v} (CategoryTheory.Subobject X)


theorem uniqueDiffOn_univ : UniqueDiffOn 𝕜 (univ : Set E)

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


theorem PrelocalPredicate.sheafifyOf {T : X → Type v} {P : PrelocalPredicate T} {U : Opens X}
    {f : ∀ x : U, T x} (h : P.pred f) : P.sheafify.pred f

{X : TopCat}
{T : ↑X → Type v}
{P : TopCat.PrelocalPredicate T}
{U : TopologicalSpace.Opens ↑X}
{f : (x : ↥U) → T ↑x}
(h : P.pred f)


@[simp, norm_cast]
lemma coe_sInf (s : Set G.Finsubgraph) : sInf s = (⨅ G ∈ s, G : G.Subgraph)

{V : Type u}
{G : SimpleGraph V}
[Finite V]
(s : Set G.Finsubgraph)


@[to_additive]
nonrec theorem SmoothOn.div_const (hf : SmoothOn I' I f s) :
    SmoothOn I' I (fun x ↦ f x / c) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[DivInvMonoid G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothMul I G]
{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 → G}
{s : Set M}
(c : G)
(hf : SmoothOn I' I f s)


/-- The Dold-Kan equivalence `Karoubi (SimplicialObject C) ≌ Karoubi (ChainComplex C ℕ)`
for additive categories. -/
@[simps]
def equivalence : Karoubi (SimplicialObject C) ≌ Karoubi (ChainComplex C ℕ)


/-- A version of the **Hahn-Banach theorem**: given disjoint convex sets `s`, `t` where `s` is
compact and `t` is closed, there is a continuous linear functional which strongly separates them. -/
theorem geometric_hahn_banach_compact_closed (hs₁ : Convex ℝ s) (hs₂ : IsCompact s)
    (ht₁ : Convex ℝ t) (ht₂ : IsClosed t) (disj : Disjoint s t) :
    ∃ (f : E →L[ℝ] ℝ) (u v : ℝ), (∀ a ∈ s, f a < u) ∧ u < v ∧ ∀ b ∈ t, v < f b

{E : Type u_2}
[TopologicalSpace E]
[AddCommGroup E]
[TopologicalAddGroup E]
[Module ℝ E]
[ContinuousSMul ℝ E]
{s t : Set E}
[LocallyConvexSpace ℝ E]
(hs₁ : Convex ℝ s)
(hs₂ : IsCompact s)
(ht₁ : Convex ℝ t)
(ht₂ : IsClosed t)
(disj : Disjoint s t)

∃ f u v, (∀ a ∈ s, f a < u) ∧ u < v ∧ ∀ b ∈ t, v < f b


theorem map_eq_zero {f : PreTilt K v O hv p} : val K v O hv p f = 0 ↔ f = 0

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


/-- This can be used to turn `IsChain (≥)` into `IsChain (≤)` and vice-versa. -/
theorem IsChain.symm (h : IsChain r s) : IsChain (flip r) s

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
(h : IsChain r s)


/-- A bounded connected subset of a conditionally complete linear order includes the open interval
`(Inf s, Sup s)`. -/
theorem IsConnected.Ioo_csInf_csSup_subset {s : Set α} (hs : IsConnected s) (hb : BddBelow s)
    (ha : BddAbove s) : Ioo (sInf s) (sSup s) ⊆ s

{α : Type u}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
{s : Set α}
(hs : IsConnected s)
(hb : BddBelow s)
(ha : BddAbove s)


/-- `MvPolynomial.rename e` is an equivalence when `e` is. -/
@[simps apply]
def renameEquiv (f : σ ≃ τ) : MvPolynomial σ R ≃ₐ[R] MvPolynomial τ R

{σ : Type u_1}
{τ : Type u_2}
(R : Type u_4)
[CommSemiring R]
(f : σ ≃ τ)
(a : MvPolynomial σ R)

(MvPolynomial.renameEquiv R f) a = (MvPolynomial.rename ⇑f) a


/-- The angle between two vectors is nonnegative. -/
theorem angle_nonneg (x y : V) : 0 ≤ angle x y

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
(x y : V)


@[reassoc]
theorem map_leftUnitor (X : C) :
    F.map (λ_ X).hom = inv (F.μ (𝟙_ C) X) ≫ inv F.ε ▷ F.obj X ≫ (λ_ (F.obj X)).hom

(F : CategoryTheory.MonoidalFunctor C D)

F.map (CategoryTheory.MonoidalCategory.leftUnitor X).hom =
  CategoryTheory.inv (F.μ (𝟙_ C) X) ≫
    CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.inv F.ε) (F.obj X) ≫
      (CategoryTheory.MonoidalCategory.leftUnitor (F.obj X)).hom


theorem supDegree_sub_le {f g : R'[A]} :
    (f - g).supDegree D ≤ f.supDegree D ⊔ g.supDegree D

{R' : Type u_2}
{A : Type u_3}
{B : Type u_5}
[Ring R']
[AddZeroClass A]
[SemilatticeSup B]
[OrderBot B]
{D : A → B}
{f g : AddMonoidAlgebra R' A}

AddMonoidAlgebra.supDegree D (f - g) ≤ AddMonoidAlgebra.supDegree D f ⊔ AddMonoidAlgebra.supDegree D g


lemma forall_lt_succ : (∀ m < n + 1, p m) ↔ (∀ m < n, p m) ∧ p n

(∀ (m : ℕ), m < n + 1 → p m) ↔ (∀ (m : ℕ), m < n → p m) ∧ p n


@[to_additive]
theorem BddAbove.mul [OrderedCommMonoid α] {A B : Set α} (hA : BddAbove A) (hB : BddAbove B) :
    BddAbove (A * B)

{α : Type u_1}
[OrderedAddCommMonoid α]
{A B : Set α}
(hA : BddAbove A)
(hB : BddAbove B)


theorem upperSemicontinuous_iff_isClosed_preimage {f : α → γ} :
    UpperSemicontinuous f ↔ ∀ y, IsClosed (f ⁻¹' Ici y)

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

UpperSemicontinuous f ↔ ∀ (y : γ), IsClosed (f ⁻¹' Set.Ici y)


theorem support_add [∀ i, AddZeroClass (β i)] [∀ (i) (x : β i), Decidable (x ≠ 0)]
    {g₁ g₂ : Π₀ i, β i} : (g₁ + g₂).support ⊆ g₁.support ∪ g₂.support

[(i : ι) → (x : β i) → Decidable (x ≠ 0)]


@[simp]
theorem mem_cons {a y l} : a ∈ @cons α y l ↔ a ~ y ∨ a ∈ l

{α : Type u_1}
{a y : Lists α}
{l : Lists' α true}


theorem eapprox_lt_top (f : α → ℝ≥0∞) (n : ℕ) (a : α) : eapprox f n a < ∞

{α : Type u_1}
[MeasurableSpace α]
(f : α → ℝ≥0∞)
(n : ℕ)
(a : α)

↑(MeasureTheory.SimpleFunc.eapprox f n) a < ⊤


@[to_additive (attr := simp)]
lemma stabilizer_finset_univ [Fintype α] : stabilizer G (Finset.univ : Finset α) = ⊤

{G : Type u_1}
{α : Type u_3}
[AddGroup G]
[AddAction G α]
[DecidableEq α]
[Fintype α]


/-- We can partition a finite family into `partition_card ε` sets, such that the remainders
in each set are close together. -/
theorem exists_partition_int (n : ℕ) {ε : ℝ} (hε : 0 < ε) {b : ℤ} (hb : b ≠ 0) (A : Fin n → ℤ) :
    ∃ t : Fin n → Fin ⌈1 / ε⌉₊,
    ∀ i₀ i₁, t i₀ = t i₁ → ↑(abs (A i₁ % b - A i₀ % b)) < abs b • ε

∃ t, ∀ (i₀ i₁ : Fin n), t i₀ = t i₁ → ↑|A i₁ % b - A i₀ % b| < |b| • ε


theorem card_cycleType_eq_one {σ : Perm α} : Multiset.card σ.cycleType = 1 ↔ σ.IsCycle

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


theorem ae_sum_iff' {μ : ι → Measure α} {p : α → Prop} (h : MeasurableSet { x | p x }) :
    (∀ᵐ x ∂sum μ, p x) ↔ ∀ i, ∀ᵐ x ∂μ i, p x

{α : Type u_1}
{ι : Type u_5}
{m0 : MeasurableSpace α}
{μ : ι → MeasureTheory.Measure α}
{p : α → Prop}
(h : MeasurableSet {x | p x})

(∀ᵐ (x : α) ∂MeasureTheory.Measure.sum μ, p x) ↔ ∀ (i : ι), ∀ᵐ (x : α) ∂μ i, p x


theorem ordConnectedComponent_subset : ordConnectedComponent s x ⊆ s

{α : Type u_1}
[LinearOrder α]
{s : Set α}
{x : α}


theorem mk_surjective_eq_zero_iff_lift :
    #{f : α → β' | Surjective f} = 0 ↔ lift.{v} #α < lift.{u} #β' ∨ (#α ≠ 0 ∧ #β' = 0)

#↑{f | Function.Surjective f} = 0 ↔ Cardinal.lift.{v, u} #α < Cardinal.lift.{u, v} #β' ∨ #α ≠ 0 ∧ #β' = 0


protected lemma exists_congr_right : (∃ a, q (e a)) ↔ ∃ b, q b

{α : Sort u}
{β : Sort v}
{q : β → Prop}
(e : α ≃ β)


@[simp] lemma univ_product_univ : univ ×ˢ univ = (univ : Finset (α × β))

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

Finset.univ ×ˢ Finset.univ = Finset.univ


theorem lift_word_prod_nontrivial_of_head_eq_last {i} (w : NeWord H i i) : lift f w.prod ≠ 1

(hXnonempty : ∀ (i : ι), (X i).Nonempty)

(hXdisj : Pairwise fun i j => Disjoint (X i) (X j))

(hpp : Pairwise fun i j => ∀ (h : H i), h ≠ 1 → (f i) h • X j ⊆ X i)


theorem tr_ret_halt : tr (Λ'.ret Cont'.halt) = (load fun _ => none) halt

Turing.PartrecToTM2.tr (Turing.PartrecToTM2.Λ'.ret Turing.PartrecToTM2.Cont'.halt) =
  Turing.TM2.Stmt.load (fun x => none) Turing.TM2.Stmt.halt


lemma Q_map {X Y : C} (f : X ⟶ Y) : (Q W).map f = homMk (ofHom W f)

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
(W : CategoryTheory.MorphismProperty C)
[W.HasLeftCalculusOfFractions]
{X Y : C}
(f : X ⟶ Y)

(CategoryTheory.MorphismProperty.LeftFraction.Localization.Q W).map f =
  CategoryTheory.MorphismProperty.LeftFraction.Localization.homMk
    (CategoryTheory.MorphismProperty.LeftFraction.ofHom W f)


theorem apply_dualBasis_left (B : BilinForm K V) (hB : B.Nondegenerate) (b : Basis ι K V) (i j) :
    B (B.dualBasis hB b i) (b j) = if j = i then 1 else 0

{V : Type u_5}
{K : Type u_6}
[Field K]
[AddCommGroup V]
[Module K V]
{ι : Type u_10}
[DecidableEq ι]
[Finite ι]
(B : LinearMap.BilinForm K V)
(hB : B.Nondegenerate)
(b : Basis ι K V)
(i j : ι)

(B ((B.dualBasis hB b) i)) (b j) = if j = i then 1 else 0


/-- Two morphisms are equal if there is a cofork whose projection is mono. -/
theorem eq_of_mono_cofork_π (t : Cofork f g) [Mono (Cofork.π t)] : f = g

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
{f g : X ⟶ Y}
(t : CategoryTheory.Limits.Cofork f g)
[CategoryTheory.Mono t.π]


@[simp]
theorem IsTorsionBySet.mk_smul (hM : IsTorsionBySet R M I) (b : R) (x : M) :
    haveI := hM.hasSMul
    Ideal.Quotient.mk I b • x = b • x

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{I : Ideal R}
(hM : Module.IsTorsionBySet R M ↑I)
(b : R)
(x : M)


theorem invFunOn_apply_eq (h : a ∈ s) : f (invFunOn f s (f a)) = f a

{α : Type u_1}
{β : Type u_2}
[Nonempty α]
{s : Set α}
{f : α → β}
{a : α}
(h : a ∈ s)


@[to_additive eq_zero_of_neg_eq]
theorem eq_one_of_inv_eq' (h : a⁻¹ = a) : a = 1

{α : Type u}
[LinearOrderedCommGroup α]
{a : α}
(h : a⁻¹ = a)


theorem generate_eq_biInf (S : Set (Set α)) : generate S = ⨅ s ∈ S, 𝓟 s


@[to_additive mem_ball_iff_norm]
theorem mem_ball_iff_norm'' : b ∈ ball a r ↔ ‖b / a‖ < r

{E : Type u_6}
[SeminormedGroup E]
{a b : E}
{r : ℝ}


/-- Implementation of `SheafConditionPairwiseIntersections.coneEquiv`. -/
@[simps]
def coneEquivUnitIsoApp (c : Cone ((diagram U).op ⋙ F)) :
    (𝟭 (Cone ((diagram U).op ⋙ F))).obj c ≅
      (coneEquivFunctor F U ⋙ coneEquivInverse F U).obj c

(c : CategoryTheory.Limits.Cone ((CategoryTheory.Pairwise.diagram U).op ⋙ F))

(TopCat.Presheaf.SheafConditionPairwiseIntersections.coneEquivUnitIsoApp F U c).hom.hom =
  𝟙 ((𝟭 (CategoryTheory.Limits.Cone ((CategoryTheory.Pairwise.diagram U).op ⋙ F))).obj c).pt


@[to_additive]
theorem IsLowerSet.div_right (hs : IsLowerSet s) : IsLowerSet (s / t)

{α : Type u_1}
[OrderedAddCommGroup α]
{s t : Set α}
(hs : IsLowerSet s)


theorem le_glb_Ioi (a : α) (hb : IsGLB (Ioi a) b) : a ≤ b

{α : Type u}
[Preorder α]
{b : α}
(a : α)
(hb : IsGLB (Set.Ioi a) b)


theorem volume_preserving_piFinsetUnion (α : ι → Type*) [DecidableEq ι] {s t : Finset ι}
    (h : Disjoint s t) [∀ i, MeasureSpace (α i)] [∀ i, SigmaFinite (volume : Measure (α i))] :
    MeasurePreserving (MeasurableEquiv.piFinsetUnion α h) volume volume

[(i : ι) → MeasureTheory.MeasureSpace (α i)]

[∀ (i : ι), MeasureTheory.SigmaFinite MeasureTheory.volume]

MeasureTheory.MeasurePreserving (⇑(MeasurableEquiv.piFinsetUnion α h)) MeasureTheory.volume MeasureTheory.volume


@[simp, norm_cast]
theorem coe_iInf {ι : Sort*} [CompleteLattice β] (f : ι → α →o β) :
    ((⨅ i, f i : α →o β) : α → β) = ⨅ i, (f i : α → β)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
{ι : Sort u_3}
[CompleteLattice β]
(f : ι → α →o β)


@[simp]
theorem mem_ndinter {s t : Multiset α} {a : α} : a ∈ ndinter s t ↔ a ∈ s ∧ a ∈ t

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


@[simp]
theorem LinearMap.toMatrix₂_mul_basis_toMatrix (c₁ : Basis n' R M₁) (c₂ : Basis m' R M₂)
    (B : M₁ →ₗ[R] M₂ →ₗ[R] R) :
    (b₁.toMatrix c₁)ᵀ * LinearMap.toMatrix₂ b₁ b₂ B * b₂.toMatrix c₂ =
      LinearMap.toMatrix₂ c₁ c₂ B

{R : Type u_1}
{M₁ : Type u_7}
{M₂ : Type u_8}
{n : Type u_12}
{m : Type u_13}
{n' : Type u_14}
{m' : Type u_15}
[CommSemiring R]
[AddCommMonoid M₁]
[Module R M₁]
[AddCommMonoid M₂]
[Module R M₂]
[DecidableEq n]
[Fintype n]
[DecidableEq m]
[Fintype m]
(b₁ : Basis n R M₁)
(b₂ : Basis m R M₂)
[Fintype n']
[Fintype m']
[DecidableEq n']
[DecidableEq m']
(c₁ : Basis n' R M₁)
(c₂ : Basis m' R M₂)
(B : M₁ →ₗ[R] M₂ →ₗ[R] R)

(b₁.toMatrix ⇑c₁)ᵀ * (LinearMap.toMatrix₂ b₁ b₂) B * b₂.toMatrix ⇑c₂ = (LinearMap.toMatrix₂ c₁ c₂) B


@[simp] lemma ofFreeGroup_apply {X : Type*} (x : X) :
    FreeGroupBasis.ofFreeGroup X x = FreeGroup.of x

(FreeGroupBasis.ofFreeGroup X) x = FreeGroup.of x


theorem idRestrGroupoid_mem {s : Set H} (hs : IsOpen s) : ofSet s hs ∈ @idRestrGroupoid H _

{H : Type u}
[TopologicalSpace H]
{s : Set H}
(hs : IsOpen s)

PartialHomeomorph.ofSet s hs ∈ idRestrGroupoid


/-- Partial function extensionality -/
theorem ext' {f g : α →. β} (H1 : ∀ a, a ∈ Dom f ↔ a ∈ Dom g) (H2 : ∀ a p q, f.fn a p = g.fn a q) :
    f = g

(H2 : ∀ (a : α) (p : f.Dom a) (q : g.Dom a), f.fn a p = g.fn a q)


@[simp]
theorem tail_nil : tail (nil : WSeq α) = nil


@[to_additive]
theorem tprod_subtype_mul_tprod_subtype_compl [T2Space α] {f : β → α} (hf : Multipliable f)
    (s : Set β) : (∏' x : s, f x) * ∏' x : ↑sᶜ, f x = ∏' x, f x

{α : Type u_1}
{β : Type u_2}
[AddCommGroup α]
[UniformSpace α]
[UniformAddGroup α]
[CompleteSpace α]
[T2Space α]
{f : β → α}
(hf : Summable f)
(s : Set β)

∑' (x : ↑s), f ↑x + ∑' (x : ↑sᶜ), f ↑x = ∑' (x : β), f x


theorem multiplicity_add_of_gt {p a b : α} (h : multiplicity p b < multiplicity p a) :
    multiplicity p (a + b) = multiplicity p b


@[to_additive]
theorem IsGLB.inv (h : IsGLB s a) : IsLUB s⁻¹ a⁻¹

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

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


theorem powersetCardAux_eq_map_coe {n} {l : List α} :
    powersetCardAux n l = (sublistsLen n l).map (↑)

Multiset.powersetCardAux n l = List.map Multiset.ofList (List.sublistsLen n l)


lemma exact_iff_δ₀ (S : ComposableArrows C (n + 2)) :
    S.Exact ↔ (mk₂ (S.map' 0 1) (S.map' 1 2)).Exact ∧ S.δ₀.Exact

(S : CategoryTheory.ComposableArrows C (n + 2))

S.Exact ↔ (CategoryTheory.ComposableArrows.mk₂ (S.map' 0 1 ⋯ ⋯) (S.map' 1 2 ⋯ ⋯)).Exact ∧ S.δ₀.Exact


@[mono]
theorem mul_le_mul (hmp : M ≤ P) (hnq : N ≤ Q) : M * N ≤ P * Q

{R : Type u}
[CommSemiring R]
{A : Type v}
[Semiring A]
[Algebra R A]
{M N P Q : Submodule R A}
(hmp : M ≤ P)
(hnq : N ≤ Q)


/-- The fully faithful embedding `LightDiagram ⥤ Profinite` -/
@[simps!]
def lightDiagramToProfinite : LightDiagram ⥤ Profinite

lightDiagramToProfinite.obj S = S.toProfinite


/-- Constructs a `HasShift C A` instance from `ShiftMkCore`. -/
@[simps]
def hasShiftMk (h : ShiftMkCore C A) : HasShift C A

(C : Type u)
(A : Type u_1)
[CategoryTheory.Category.{v, u} C]
[AddMonoid A]
(h : CategoryTheory.ShiftMkCore C A)


@[to_additive]
theorem finprod_mem_univ (f : α → M) : ∏ᶠ i ∈ @Set.univ α, f i = ∏ᶠ i : α, f i

{α : Type u_1}
{M : Type u_5}
[CommMonoid M]
(f : α → M)

∏ᶠ (i : α) (_ : i ∈ Set.univ), f i = ∏ᶠ (i : α), f i


theorem div_logb {a b c : ℝ} (h₁ : c ≠ 0) (h₂ : c ≠ 1) (h₃ : c ≠ -1) :
    logb a c / logb b c = logb a b

Real.logb a c / Real.logb b c = Real.logb a b


@[simp]
theorem blsub_one (f : ∀ a < (1 : Ordinal), Ordinal) : blsub 1 f = succ (f 0 zero_lt_one)

(f : (a : Ordinal.{u_4}) → a < 1 → Ordinal.{max u_4 u_5})


theorem jacobiSymNat.one_right (a : ℕ) : jacobiSymNat a 1 = 1

Mathlib.Meta.NormNum.jacobiSymNat a 1 = 1


@[to_additive eq_addCosets_of_normal]
theorem eq_cosets_of_normal (N : s.Normal) (g : α) : g • (s : Set α) = op g • s

{α : Type u_1}
[AddGroup α]
(s : AddSubgroup α)
(N : s.Normal)
(g : α)


lemma card_preimage_of_injective {f : α → β} {s : Set β} (hf : Injective f) (hsf : s ⊆ range f) :
    Nat.card (f ⁻¹' s) = Nat.card s

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{s : Set β}
(hf : Function.Injective f)
(hsf : s ⊆ Set.range f)


theorem le_chainHeight_add_nat_iff {n m : ℕ} :
    ↑n ≤ s.chainHeight + m ↔ ∃ l ∈ s.subchain, n ≤ length l + m

{α : Type u_1}
[LT α]
{s : Set α}
{n m : ℕ}

↑n ≤ s.chainHeight + ↑m ↔ ∃ l ∈ s.subchain, n ≤ l.length + m


theorem of_iso (hY : IsZero Y) (e : X ≅ Y) : IsZero X

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y : C}
(hY : CategoryTheory.Limits.IsZero Y)
(e : X ≅ Y)


@[simp, norm_cast]
lemma algebraMap_eq_coe : (algebraMap ℝ≥0 ℝ : ℝ≥0 → ℝ) = (↑)


/-- To check that a subset is a complete sublattice, one does not need to check that it is closed
under binary `Sup` since this follows from the stronger `sSup` condition. Likewise for infima. -/
@[simps] def mk' (carrier : Set α)
    (sSupClosed' : ∀ ⦃s : Set α⦄, s ⊆ carrier → sSup s ∈ carrier)
    (sInfClosed' : ∀ ⦃s : Set α⦄, s ⊆ carrier → sInf s ∈ carrier) :
  CompleteSublattice α

(CompleteSublattice.mk' carrier sSupClosed' sInfClosed').carrier = carrier


theorem add_eq_adc (w : Nat) (x y : BitVec w) : x + y = (adc x y false).snd


theorem lineDeriv_zero : lineDeriv 𝕜 f x 0 = 0

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[AddCommGroup E]
[Module 𝕜 E]
{f : E → F}
{x : E}


@[simp]
theorem filter_val (s : Finset α) : (filter p s).1 = s.1.filter p

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

(Finset.filter p s).val = Multiset.filter p s.val


theorem evalFrom_of_append (start : σ) (x y : List α) :
    M.evalFrom start (x ++ y) = M.evalFrom (M.evalFrom start x) y

{α : Type u}
{σ : Type v}
(M : DFA α σ)
(start : σ)
(x y : List α)


/-- Associator for the vertical composition of oplax natural transformations. -/
-- Porting note: verified that projections are correct and changed @[simps] to @[simps!]
@[simps!]
def associator (η : F ⟶ G) (θ : G ⟶ H) (ι : H ⟶ I) : (η ≫ θ) ≫ ι ≅ η ≫ θ ≫ ι

{F G H I : CategoryTheory.OplaxFunctor B C}

(CategoryTheory.OplaxNatTrans.associator η θ ι).inv.app a =
  (CategoryTheory.Bicategory.associator (η.app a) (θ.app a) (ι.app a)).inv


theorem _root_.Bornology.IsBounded.subset_closedBall_lt (h : IsBounded s) (a : ℝ) (c : α) :
    ∃ r, a < r ∧ s ⊆ closedBall c r

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
(h : Bornology.IsBounded s)
(a : ℝ)
(c : α)


private theorem list_cons' : (haveI := prim H; Primrec₂ (@List.cons β))

(H : Nat.Primrec fun n => Encodable.encode (Encodable.decode n))


protected lemma one_ne_zero : (1 : ℤ) ≠ 0


@[simp]
theorem empty_prod : (∅ : Set α) ×ˢ t = ∅

{α : Type u_1}
{β : Type u_2}
{t : Set β}


@[simp] theorem sphere_zero : sphere x 0 = {x}


theorem inf_union [DecidableEq β] : (s₁ ∪ s₂).inf f = s₁.inf f ⊓ s₂.inf f

{α : Type u_2}
{β : Type u_3}
[SemilatticeInf α]
[OrderTop α]
{s₁ s₂ : Finset β}
{f : β → α}
[DecidableEq β]


@[to_additive sub_eq_of_eq_add]
theorem div_eq_of_eq_mul'' (h : a = c * b) : a / b = c

{G : Type u_3}
[AddGroup G]
{a b c : G}
(h : a = c + b)


theorem lt_of_st_lt {x y : ℝ*} (hix : ¬Infinite x) (hiy : ¬Infinite y) : st x < st y → x < y

{x y : ℝ*}
(hix : ¬x.Infinite)
(hiy : ¬y.Infinite)


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


theorem congr_app {X Y : Scheme} {f g : X ⟶ Y} (e : f = g) (U) :
    f.app U = g.app U ≫ X.presheaf.map (eqToHom (by subst e; rfl)).op

{X Y : AlgebraicGeometry.Scheme}
{f g : X ⟶ Y}
(e : f = g)
(U : Y.Opens)

AlgebraicGeometry.Scheme.Hom.app f U =
  AlgebraicGeometry.Scheme.Hom.app g U ≫ X.presheaf.map (CategoryTheory.eqToHom ⋯).op


@[simp, norm_cast]
theorem natCast_sub (m n : ℕ) : ((m - n : ℕ) : Ordinal) = m - n


protected lemma inv_pos_of_pos (hz : 0 < z) : 0 < z⁻¹

{K : Type u_1}
[RCLike K]
{z : K}
(hz : 0 < z)


@[to_additive (attr := gcongr)]
lemma zpow_le_zpow' (hn : 0 ≤ n) (h : a ≤ b) : a ^ n ≤ b ^ n

{α : Type u_1}
[OrderedAddCommGroup α]
{n : ℤ}
{a b : α}
(hn : 0 ≤ n)
(h : a ≤ b)


@[simp]
theorem map_ret (f : α → β) (a) : map f (ret a) = ret (f a)

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

Stream'.WSeq.map f (Stream'.WSeq.ret a) = Stream'.WSeq.ret (f a)


theorem isLUB_of_tendsto_atTop [TopologicalSpace α] [Preorder α] [OrderClosedTopology α]
    [Nonempty β] [SemilatticeSup β] {f : β → α} {a : α} (hf : Monotone f)
    (ha : Tendsto f atTop (𝓝 a)) : IsLUB (Set.range f) a

(ha : Filter.Tendsto f Filter.atTop (𝓝 a))


lemma Function.pullback_comm_sq (f : X → Y) (g : Z → Y) :
    f ∘ @fst X Y Z f g = g ∘ @snd X Y Z f g

{X : Type u_2}
{Y : Sort u_3}
{Z : Type u_1}
(f : X → Y)
(g : Z → Y)

f ∘ Function.Pullback.fst = g ∘ Function.Pullback.snd


@[simp] lemma length_withLength [r.InfiniteDimensional] (n : ℕ) :
    (RelSeries.withLength r n).length = n

{α : Type u_1}
(r : Rel α α)
[r.InfiniteDimensional]
(n : ℕ)


@[to_additive]
theorem fixedBy_subset_fixedBy_zpow (g : G) (j : ℤ) :
    fixedBy α g ⊆ fixedBy α (g ^ j)

(α : Type u_1)
{G : Type u_2}
[AddGroup G]
[AddAction G α]
(g : G)
(j : ℤ)

AddAction.fixedBy α g ⊆ AddAction.fixedBy α (j • g)


private theorem ghostFun_add : ghostFun (x + y) = ghostFun x + ghostFun y

{p : ℕ}
{R : Type u_1}
[hp : Fact (Nat.Prime p)]
[CommRing R]
(x y : 𝕎 R)

WittVector.ghostFun (x + y) = WittVector.ghostFun x + WittVector.ghostFun y


theorem HasStrictDerivAt.arctan (hf : HasStrictDerivAt f f' x) :
    HasStrictDerivAt (fun x => arctan (f x)) (1 / (1 + f x ^ 2) * f') x

{f : ℝ → ℝ}
{f' x : ℝ}
(hf : HasStrictDerivAt f f' x)

HasStrictDerivAt (fun x => Real.arctan (f x)) (1 / (1 + f x ^ 2) * f') x


lemma mem_essImage_of_counit_isSplitEpi [Coreflective j] {A : D}
    [IsSplitEpi ((coreflectorAdjunction j).counit.app A)] : A ∈ j.essImage

[CategoryTheory.IsSplitEpi ((CategoryTheory.coreflectorAdjunction j).counit.app A)]


@[to_additive]
theorem EventuallyEq.inv [Inv β] {f g : α → β} {l : Filter α} (h : f =ᶠ[l] g) :
    (fun x => (f x)⁻¹) =ᶠ[l] fun x => (g x)⁻¹

{α : Type u}
{β : Type v}
[Neg β]
{f g : α → β}
{l : Filter α}
(h : f =ᶠ[l] g)


@[fun_prop]
theorem differentiableOn_empty : DifferentiableOn 𝕜 f ∅

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


@[simp]
theorem coe_id : ⇑(NonUnitalStarRingHom.id A) = id

(A : Type u_1)
[NonUnitalNonAssocSemiring A]
[Star A]


@[to_additive (attr := simp)]
protected lemma div_mul_cancel (h : IsUnit b) (a : α) : a / b * b = a

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


theorem mem_minimals_iff_forall_lt_not_mem [Preorder α] {x : α} {s : Set α} :
    x ∈ minimals (· ≤ ·) s ↔ x ∈ s ∧ ∀ ⦃y⦄, y < x → y ∉ s

{α : Type u_1}
[Preorder α]
{x : α}
{s : Set α}

x ∈ minimals (fun x x_1 => x ≤ x_1) s ↔ x ∈ s ∧ ∀ ⦃y : α⦄, y < x → y ∉ s


/-- The top submonoid is isomorphic to the monoid. -/
@[to_additive (attr := simps) "The top additive submonoid is isomorphic to the additive monoid."]
def topEquiv : (⊤ : Submonoid M) ≃* M


@[to_additive (attr := simp)]
theorem prod_equivMapDomain [CommMonoid N] (f : α ≃ β) (l : α →₀ M) (g : β → M → N) :
    prod (equivMapDomain f l) g = prod l (fun a m => g (f a) m)

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
{N : Type u_7}
[Zero M]
[AddCommMonoid N]
(f : α ≃ β)
(l : α →₀ M)
(g : β → M → N)

(Finsupp.equivMapDomain f l).sum g = l.sum fun a m => g (f a) m


/-- **Harris-Kleitman inequality**: Any two upper sets of finsets correlate. -/
theorem IsUpperSet.le_card_inter_finset (h𝒜 : IsUpperSet (𝒜 : Set (Finset α)))
    (hℬ : IsUpperSet (ℬ : Set (Finset α))) :
    𝒜.card * ℬ.card ≤ 2 ^ Fintype.card α * (𝒜 ∩ ℬ).card

{α : Type u_1}
[DecidableEq α]
{𝒜 ℬ : Finset (Finset α)}
[Fintype α]
(h𝒜 : IsUpperSet ↑𝒜)
(hℬ : IsUpperSet ↑ℬ)


@[simp]
lemma equiv_mk₀ [HasSmallLocalizedShiftedHom.{w} W M X Y]
    (m₀ : M) (hm₀ : m₀ = 0) (f : X ⟶ Y) :
    equiv W L (SmallShiftedHom.mk₀ W m₀ hm₀ f) =
      ShiftedHom.mk₀ m₀ hm₀ (L.map f)

[CategoryTheory.Localization.HasSmallLocalizedShiftedHom W M X Y]

(CategoryTheory.Localization.SmallShiftedHom.equiv W L) (CategoryTheory.Localization.SmallShiftedHom.mk₀ W m₀ hm₀ f) =
  CategoryTheory.ShiftedHom.mk₀ m₀ hm₀ (L.map f)


lemma sum_le_foldr_max [AddMonoid M] [AddMonoid N] [LinearOrder N] (f : M → N) (h0 : f 0 ≤ 0)
    (hadd : ∀ x y, f (x + y) ≤ max (f x) (f y)) (l : List M) : f l.sum ≤ (l.map f).foldr max 0

(hadd : ∀ (x y : M), f (x + y) ≤ max (f x) (f y))

f l.sum ≤ List.foldr max 0 (List.map f l)


/-- An angle in a right-angled triangle expressed using `arctan`, where one side is a multiple
of a rotation of another by `π / 2`. -/
theorem oangle_add_left_smul_rotation_pi_div_two {x : V} (h : x ≠ 0) (r : ℝ) :
    o.oangle (x + r • o.rotation (π / 2 : ℝ) x) (r • o.rotation (π / 2 : ℝ) x)
      = Real.arctan r⁻¹

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

o.oangle (x + r • (o.rotation ↑(π / 2)) x) (r • (o.rotation ↑(π / 2)) x) = ↑(Real.arctan r⁻¹)


theorem taylor_eval_sub {R} [CommRing R] (r : R) (f : R[X]) (s : R) :
    (taylor r f).eval (s - r) = f.eval s

{R : Type u_2}
[CommRing R]
(r : R)
(f : Polynomial R)
(s : R)

Polynomial.eval (s - r) ((Polynomial.taylor r) f) = Polynomial.eval s f


@[simp]
theorem abs_coe (q : ℚ≥0) : |(q : ℚ)| = q


theorem Complex.integral_rpow_mul_exp_neg_rpow {p q : ℝ} (hp : 1 ≤ p) (hq : - 2 < q) :
    ∫ x : ℂ, ‖x‖ ^ q * rexp (- ‖x‖ ^ p) = (2 * π / p) * Real.Gamma ((q + 2) / p)

∫ (x : ℂ), ‖x‖ ^ q * rexp (-‖x‖ ^ p) = 2 * π / p * Real.Gamma ((q + 2) / p)


theorem continuousOn_primitive_interval (h_int : IntegrableOn f (uIcc a b) μ) :
    ContinuousOn (fun x => ∫ t in a..x, f t ∂μ) (uIcc a b)

(h_int : MeasureTheory.IntegrableOn f (Set.uIcc a b) μ)

ContinuousOn (fun x => ∫ (t : ℝ) in a..x, f t ∂μ) (Set.uIcc a b)


theorem prod_nndist_eq_of_L2 (x y : WithLp 2 (α × β)) :
    nndist x y = NNReal.sqrt (nndist x.fst y.fst ^ 2 + nndist x.snd y.snd ^ 2)

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

nndist x y = NNReal.sqrt (nndist x.1 y.1 ^ 2 + nndist x.2 y.2 ^ 2)


/-- The coercion `Cardinal.ofENat` and the projection `Cardinal.toENat` form a Galois connection.
See also `Cardinal.gciENat`. -/
lemma enat_gc : GaloisConnection (↑) toENat


/-- If `L / K` is an algebraic extension, `K` is a perfect field, then so is `L`. -/
theorem Algebra.IsAlgebraic.perfectField {K L : Type*} [Field K] [Field L] [Algebra K L]
    [Algebra.IsAlgebraic K L] [PerfectField K] : PerfectField L

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
[Algebra.IsAlgebraic K L]
[PerfectField K]


@[simp]
theorem Algebra.pushoutDesc_left [H : Algebra.IsPushout R S R' S'] {A : Type*} [Semiring A]
    [Algebra R A] (f : S →ₐ[R] A) (g : R' →ₐ[R] A) (H) (x : S) :
    Algebra.pushoutDesc S' f g H (algebraMap S S' x) = f x

{R : Type u_1}
{S : Type v₃}
[CommSemiring R]
[CommSemiring S]
[Algebra R S]
{R' : Type u_6}
(S' : Type u_7)
[CommSemiring R']
[CommSemiring S']
[Algebra R R']
[Algebra S S']
[Algebra R' S']
[Algebra R S']
[IsScalarTower R R' S']
[IsScalarTower R S S']
[H : Algebra.IsPushout R S R' S']
{A : Type u_8}
[Semiring A]
[Algebra R A]
(f : S →ₐ[R] A)
(g : R' →ₐ[R] A)

∀ (H_1 : ∀ (x : S) (y : R'), f x * g y = g y * f x) (x : S),
  (Algebra.pushoutDesc S' f g H_1) ((algebraMap S S') x) = f x


theorem generatePiSystem_measurableSet {α} [M : MeasurableSpace α] {S : Set (Set α)}
    (h_meas_S : ∀ s ∈ S, MeasurableSet s) (t : Set α) (h_in_pi : t ∈ generatePiSystem S) :
    MeasurableSet t

{α : Type u_1}
[M : MeasurableSpace α]
{S : Set (Set α)}
(h_meas_S : ∀ s ∈ S, MeasurableSet s)
(t : Set α)
(h_in_pi : t ∈ generatePiSystem S)


theorem equiv_fst_eq_self_iff_mem {g : G} (h1 : 1 ∈ T) :
    ((hST.equiv g).fst : G) = g ↔ g ∈ S

{G : Type u_1}
[Group G]
{S T : Set G}
(hST : Subgroup.IsComplement S T)
{g : G}
(h1 : 1 ∈ T)


theorem nhdsSet_Icc (h : a ≤ b) : 𝓝ˢ (Icc a b) = 𝓝 a ⊔ 𝓝 b ⊔ 𝓟 (Ioo a b)

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

𝓝ˢ (Set.Icc a b) = 𝓝 a ⊔ 𝓝 b ⊔ 𝓟 (Set.Ioo a b)


lemma congr_mapMap (φ₁ φ₂ : X ⟶ Y) (h : φ₁ = φ₂) : mapMap φ₁ p = mapMap φ₂ p

{I : Type u_1}
{J : Type u_2}
{C : Type u_4}
[CategoryTheory.Category.{u_5, u_4} C]
{X Y : CategoryTheory.GradedObject I C}
(p : I → J)
[X.HasMap p]
[Y.HasMap p]
(φ₁ φ₂ : X ⟶ Y)
(h : φ₁ = φ₂)

CategoryTheory.GradedObject.mapMap φ₁ p = CategoryTheory.GradedObject.mapMap φ₂ p


theorem SubmonoidClass.swap_mem_trans {a b c : α} {C} [SetLike C (Perm α)]
    [SubmonoidClass C (Perm α)] (M : C) (hab : swap a b ∈ M) (hbc : swap b c ∈ M) :
    swap a c ∈ M

{α : Type u_2}
[DecidableEq α]
{a b c : α}
{C : Type u_3}
[SetLike C (Equiv.Perm α)]
[SubmonoidClass C (Equiv.Perm α)]
(M : C)
(hab : Equiv.swap a b ∈ M)
(hbc : Equiv.swap b c ∈ M)


theorem comp {g : B →ₐ[R] C} {f : A →ₐ[R] B} (hg : g.FiniteType) (hf : f.FiniteType) :
    (g.comp f).FiniteType

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
[CommRing R]
[CommRing A]
[CommRing B]
[CommRing C]
[Algebra R A]
[Algebra R B]
[Algebra R C]
{g : B →ₐ[R] C}
{f : A →ₐ[R] B}
(hg : g.FiniteType)
(hf : f.FiniteType)


theorem mem_def : x ∈ I ↔ ∀ i, x i ∈ Ioc (I.lower i) (I.upper i)

{ι : Type u_1}
(I : BoxIntegral.Box ι)
{x : ι → ℝ}

x ∈ I ↔ ∀ (i : ι), x i ∈ Set.Ioc (I.lower i) (I.upper i)


theorem exists_mem_multiset_le_of_prime {s : Multiset (Associates α)} {p : Associates α}
    (hp : Prime p) : p ≤ s.prod → ∃ a ∈ s, p ≤ a

{α : Type u_1}
[CancelCommMonoidWithZero α]
{s : Multiset (Associates α)}
{p : Associates α}
(hp : Prime p)


@[to_additive] lemma mabs_pow (n : ℕ) (a : α) : |a ^ n|ₘ = |a|ₘ ^ n

{α : Type u_1}
[LinearOrderedAddCommGroup α]
(n : ℕ)
(a : α)


@[simp] theorem strictMonoOn_univ : StrictMonoOn f Set.univ ↔ StrictMono f

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}


lemma toEnd_comp_mk' (x : L) :
    LieModule.toEnd R L (M ⧸ N) x ∘ₗ mk' N = mk' N ∘ₗ LieModule.toEnd R L M x

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

(LieModule.toEnd R L (M ⧸ N)) x ∘ₗ ↑(LieSubmodule.Quotient.mk' N) =
  ↑(LieSubmodule.Quotient.mk' N) ∘ₗ (LieModule.toEnd R L M) x


/-- See also `CompleteLattice.Independent.linearIndependent` which provides the same conclusion
but requires the stronger hypothesis `NoZeroSMulDivisors R M`. -/
theorem CompleteLattice.Independent.linear_independent' {ι R M : Type*} {v : ι → M} [Ring R]
    [AddCommGroup M] [Module R M] (hv : CompleteLattice.Independent fun i => R ∙ v i)
    (h_ne_zero : ∀ i, Ideal.torsionOf R M (v i) = ⊥) : LinearIndependent R v

(hv : CompleteLattice.Independent fun i => Submodule.span R {v i})

(h_ne_zero : ∀ (i : ι), Ideal.torsionOf R M (v i) = ⊥)


theorem mk_eq_mkRat (num den nz c) : ⟨num, den, nz, c⟩ = mkRat num den

(num : Int)
(den : Nat)
(nz : den ≠ 0)
(c : num.natAbs.Coprime den)

{ num := num, den := den, den_nz := nz, reduced := c } = mkRat num den


theorem card_eq_of_bijective (f : α → β) (hf : Function.Bijective f) : Nat.card α = Nat.card β

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(hf : Function.Bijective f)


/-- The characteristic is zero if the exponential characteristic is one. -/
theorem charZero_of_expChar_one' [hq : ExpChar R 1] : CharZero R

(R : Type u)
[Semiring R]
[Nontrivial R]
[hq : ExpChar R 1]


@[simp]
lemma neg_comp (α : Ext X Y n) {m : ℕ} (β : Ext Y Z m) {p : ℕ} (h : n + m = p) :
    (-α).comp β h = -α.comp β h

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
[CategoryTheory.HasExt C]
{X Y Z : C}
{n : ℕ}
(α : CategoryTheory.Abelian.Ext X Y n)
{m : ℕ}
(β : CategoryTheory.Abelian.Ext Y Z m)
{p : ℕ}
(h : n + m = p)


@[to_additive]
theorem Prod.semiconjBy_iff {x y z : M × N} :
    SemiconjBy x y z ↔ SemiconjBy x.1 y.1 z.1 ∧ SemiconjBy x.2 y.2 z.2

{M : Type u_5}
{N : Type u_6}
[Mul M]
[Mul N]
{x y z : M × N}


lemma IsLocalizedModule.linearIndependent_lift {ι} {v : ι → N} (hf : LinearIndependent S v) :
    ∃ w : ι → M, LinearIndependent R w

{R : Type u}
{S : Type u'}
{M : Type v}
{N : Type v'}
[CommRing R]
[CommRing S]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
[Algebra R S]
[Module S N]
[IsScalarTower R S N]
(p : Submonoid R)
[IsLocalization p S]
(f : M →ₗ[R] N)
[IsLocalizedModule p f]
(hp : p ≤ R⁰)
{ι : Type u_1}
{v : ι → N}
(hf : LinearIndependent S v)


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

You should extend this class when you extend `AddGroupNorm`. -/
class AddGroupNormClass (F α β : Type*) [AddGroup α] [OrderedAddCommMonoid β] [FunLike F α β]
  extends AddGroupSeminormClass F α β : Prop where
  /-- The argument is zero if its image under the map is zero. -/
  eq_zero_of_map_eq_zero (f : F) {a : α} : f a = 0 → a = 0

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


@[to_additive]
theorem con_mul_left_inv (x : FreeMonoid (G ⊕ H)) :
    coprodCon G H (ofList (x.toList.map (Sum.map Inv.inv Inv.inv)).reverse * x) 1

{G : Type u_1}
{H : Type u_2}
[Group G]
[Group H]
(x : FreeMonoid (G ⊕ H))

(Monoid.coprodCon G H) (FreeMonoid.ofList (List.map (Sum.map Inv.inv Inv.inv) (FreeMonoid.toList x)).reverse * x) 1


theorem Filter.isBoundedUnder_le_mul_tendsto_zero {f g : ι → α} {l : Filter ι}
    (hf : IsBoundedUnder (· ≤ ·) l (norm ∘ f)) (hg : Tendsto g l (𝓝 0)) :
    Tendsto (fun x => f x * g x) l (𝓝 0)

(hf : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l (norm ∘ f))

Filter.Tendsto (fun x => f x * g x) l (𝓝 0)


theorem rank_strictMono [Preorder α] [WellFoundedLT α] :
    StrictMono (rank <| @wellFounded_lt α _ _)

{α : Type u}
[Preorder α]
[WellFoundedLT α]


theorem DifferentiableOn.hasFDerivAt (h : DifferentiableOn 𝕜 f s) (hs : s ∈ 𝓝 x) :
    HasFDerivAt f (fderiv 𝕜 f x) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{s : Set E}
(h : DifferentiableOn 𝕜 f s)
(hs : s ∈ 𝓝 x)


lemma eq_of_isHomLift {a b : 𝒳} (f : p.obj a ⟶ p.obj b) (φ : a ⟶ b) [p.IsHomLift f φ] :
    f = p.map φ

{𝒮 : Type u₁}
{𝒳 : Type u₂}
[CategoryTheory.Category.{v₁, u₂} 𝒳]
[CategoryTheory.Category.{v₂, u₁} 𝒮]
(p : 𝒳 ⥤ 𝒮)
{a b : 𝒳}
(f : p.obj a ⟶ p.obj b)
(φ : a ⟶ b)
[p.IsHomLift f φ]


@[simp]
theorem lcm_singleton {a : α} : ({a} : Multiset α).lcm = normalize a

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{a : α}


/-- A nonarchimedean seminorm on an additive group `G` is a function `f : G → ℝ` that preserves
zero, is nonarchimedean and such that `f (-x) = f x` for all `x`. -/
structure NonarchAddGroupSeminorm (G : Type*) [AddGroup G] extends ZeroHom G ℝ where
  /-- The seminorm applied to a sum is dominated by the maximum of the function applied to the
  addends. -/
  protected add_le_max' : ∀ r s, toFun (r + s) ≤ max (toFun r) (toFun s)
  /-- The seminorm is invariant under negation. -/
  protected neg' : ∀ r, toFun (-r) = toFun r

{G : Type u_7}
[AddGroup G]
(self : NonarchAddGroupSeminorm G)
(r : G)


@[simp]
theorem MultilinearMap.uncurry_curryLeft (f : MultilinearMap R M M₂) :
    f.curryLeft.uncurryLeft = f

[(i : Fin n.succ) → AddCommMonoid (M i)]


theorem cmp_to_nat : ∀ m n, (Ordering.casesOn (cmp m n) ((m : ℕ) < n) (m = n) ((n : ℕ) < m) : Prop)

Ordering.casesOn (m.cmp n) (↑m < ↑n) (m = n) (↑n < ↑m)


theorem comparisonAdjunction_unit_f
    [∀ A : adj.toMonad.Algebra, HasCoequalizer (F.map A.a)
      (adj.counit.app (F.obj A.A))]
    (A : adj.toMonad.Algebra) :
    ((comparisonAdjunction adj).unit.app A).f = (beckCoequalizer A).desc (unitCofork A)

[∀ (A : adj.toMonad.Algebra), CategoryTheory.Limits.HasCoequalizer (F.map A.a) (adj.counit.app (F.obj A.A))]

((CategoryTheory.Monad.MonadicityInternal.comparisonAdjunction adj).unit.app A).f =
  (CategoryTheory.Monad.beckCoequalizer A).desc (CategoryTheory.Monad.MonadicityInternal.unitCofork A)


theorem inter_ae_eq_empty_of_ae_eq_empty_left (h : s =ᵐ[μ] (∅ : Set α)) :
    (s ∩ t : Set α) =ᵐ[μ] (∅ : Set α)

{α : Type u_1}
{F : Type u_3}
[FunLike F (Set α) ℝ≥0∞]
[MeasureTheory.OuterMeasureClass F α]
{μ : F}
{s t : Set α}
(h : s =ᵐ[μ] ∅)


@[deprecated map_reverse (since := "2024-06-20")]
theorem reverse_map (f : α → β) (l : List α) : (l.map f).reverse = l.reverse.map f

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

(List.map f l).reverse = List.map f l.reverse


protected theorem IsPredLimit.isMax_of_noMin [NoMinOrder α] (h : IsPredLimit a) : IsMax a

{α : Type u_1}
[Preorder α]
{a : α}
[PredOrder α]
[IsPredArchimedean α]
[NoMinOrder α]
(h : Order.IsPredLimit a)


/-- If a sum of continuous functions `g n` is convergent, and the same sum converges in `Lᵖ` to `h`,
then in fact `g n` converges uniformly to `h`.  -/
theorem hasSum_of_hasSum_Lp {β : Type*} [μ.IsOpenPosMeasure] [NormedField 𝕜] [NormedSpace 𝕜 E]
    {g : β → C(α, E)} {f : C(α, E)} (hg : Summable g)
    (hg2 : HasSum (toLp (E := E) p μ 𝕜 ∘ g) (toLp (E := E) p μ 𝕜 f)) : HasSum g f

(hg2 : HasSum (⇑(ContinuousMap.toLp p μ 𝕜) ∘ g) ((ContinuousMap.toLp p μ 𝕜) f))


/-- A function is continuous on a set if and only if its composition with a partial homeomorphism
on the right is continuous on the corresponding set. -/
theorem continuousOn_iff_continuousOn_comp_right {f : Y → Z} {s : Set Y} (h : s ⊆ e.target) :
    ContinuousOn f s ↔ ContinuousOn (f ∘ e) (e.source ∩ e ⁻¹' s)

{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}
{s : Set Y}
(h : s ⊆ e.target)

ContinuousOn f s ↔ ContinuousOn (f ∘ ↑e) (e.source ∩ ↑e ⁻¹' s)


@[simp]
theorem union_empty (a : Set α) : a ∪ ∅ = a


theorem le_opNorm₂ [RingHomIsometric σ₁₃] (f : E →SL[σ₁₃] F →SL[σ₂₃] G) (x : E) (y : F) :
    ‖f x y‖ ≤ ‖f‖ * ‖x‖ * ‖y‖

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{𝕜₃ : Type u_3}
{E : Type u_4}
{F : Type u_6}
{G : Type u_8}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[SeminormedAddCommGroup G]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NontriviallyNormedField 𝕜₃]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
[NormedSpace 𝕜₃ G]
{σ₂₃ : 𝕜₂ →+* 𝕜₃}
{σ₁₃ : 𝕜 →+* 𝕜₃}
[RingHomIsometric σ₂₃]
[RingHomIsometric σ₁₃]
(f : E →SL[σ₁₃] F →SL[σ₂₃] G)
(x : E)
(y : F)


theorem tendsto_approxOn_range_L1_nnnorm [OpensMeasurableSpace E] {f : β → E} {μ : Measure β}
    [SeparableSpace (range f ∪ {0} : Set E)] (fmeas : Measurable f) (hf : Integrable f μ) :
    Tendsto (fun n => ∫⁻ x, ‖approxOn f fmeas (range f ∪ {0}) 0 (by simp) n x - f x‖₊ ∂μ) atTop
      (𝓝 0)

[TopologicalSpace.SeparableSpace ↑(Set.range f ∪ {0})]

Filter.Tendsto
  (fun n => ∫⁻ (x : β), ↑‖↑(MeasureTheory.SimpleFunc.approxOn f fmeas (Set.range f ∪ {0}) 0 ⋯ n) x - f x‖₊ ∂μ)
  Filter.atTop (𝓝 0)


theorem dvd_of_mem_normalizedFactors {a p : α} (H : p ∈ normalizedFactors a) : p ∣ a

(H : p ∈ UniqueFactorizationMonoid.normalizedFactors a)


@[simp, norm_cast] lemma coe_bot : (⊥ : Sublattice α) = (∅ : Set α)


@[to_additive]
protected theorem MonoidHom.map_pow [Monoid M] [Monoid N] (f : M →* N) (a : M) (n : ℕ) :
    f (a ^ n) = f a ^ n

{M : Type u_4}
{N : Type u_5}
[AddMonoid M]
[AddMonoid N]
(f : M →+ N)
(a : M)
(n : ℕ)


@[to_additive VAddAntidiagonal.eq_of_fst_le_fst_of_snd_le_snd]
theorem eq_of_fst_le_fst_of_snd_le_snd (h₁ : (x : G × P).1 ≤ (y : G × P).1)
    (h₂ : (x : G × P).2 ≤ (y : G × P).2) : x = y

{G : Type u_1}
{P : Type u_2}
{s : Set G}
{t : Set P}
{a : P}
[PartialOrder G]
[PartialOrder P]
[SMul G P]
[IsOrderedCancelSMul G P]
{x y : ↑(s.smulAntidiagonal t a)}
(h₁ : (↑x).1 ≤ (↑y).1)
(h₂ : (↑x).2 ≤ (↑y).2)


theorem linearMapAt_def_of_mem (e : Trivialization F (π F E)) [e.IsLinear R] {b : B}
    (hb : b ∈ e.baseSet) : e.linearMapAt R b = e.linearEquivAt R b hb

[TopologicalSpace (Bundle.TotalSpace F E)]

(e : Trivialization F Bundle.TotalSpace.proj)

Trivialization.linearMapAt R e b = ↑(Trivialization.linearEquivAt R e b hb)


/-- The function `AddOpposite.op` is a multiplicative equivalence. -/
@[simps! (config := { fullyApplied := false, simpRhs := true })]
def opMulEquiv [Mul α] : α ≃* αᵃᵒᵖ


/-- A morphism in the Drinfeld center of `C`. -/
-- Porting note(#5171): linter not ported yet
@[ext] -- @[nolint has_nonempty_instance]
structure Hom (X Y : Center C) where
  f : X.1 ⟶ Y.1
  comm : ∀ U, (f ▷ U) ≫ (Y.2.β U).hom = (X.2.β U).hom ≫ (U ◁ f) := by aesop_cat

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

self.f ▷ U ≫ (Y.snd.β U).hom = (X.snd.β U).hom ≫ U ◁ self.f


/-- Typeclass for expressing that a type `M₀` with multiplication and a zero satisfies
`0 * a = 0` and `a * 0 = 0` for all `a : M₀`. -/
class MulZeroClass (M₀ : Type u) extends Mul M₀, Zero M₀ where
  /-- Zero is a left absorbing element for multiplication -/
  zero_mul : ∀ a : M₀, 0 * a = 0
  /-- Zero is a right absorbing element for multiplication -/
  mul_zero : ∀ a : M₀, a * 0 = 0

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


{α : Type u_2}
[Lattice α]
[LocallyFiniteOrder α]
{a : α}


theorem Antitone.ball {P : β → α → Prop} {s : Set β} (hP : ∀ x ∈ s, Antitone (P x)) :
    Antitone fun y => ∀ x ∈ s, P x y

(hP : ∀ (x : β), x ∈ s → Antitone (P x))

Antitone fun y => ∀ (x : β), x ∈ s → P x y


@[simp]
theorem mem_some_iff {a b} : b ∈ (some a : Part α) ↔ b = a


@[simp]
theorem lift_unique {A : Type*} [Semiring A] [Algebra R A] (f : M →ₗ[R] A)
    (g : TensorAlgebra R M →ₐ[R] A) : g.toLinearMap.comp (ι R) = f ↔ g = lift R f

{R : Type u_1}
[CommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{A : Type u_3}
[Semiring A]
[Algebra R A]
(f : M →ₗ[R] A)
(g : TensorAlgebra R M →ₐ[R] A)

g.toLinearMap ∘ₗ TensorAlgebra.ι R = f ↔ g = (TensorAlgebra.lift R) f


/-- If the product `X ⨯ Y` and the equalizer of `π₁ ≫ f` and `π₂ ≫ g` exist, then the
    pullback of `f` and `g` exists: It is given by composing the equalizer with the projections. -/
theorem hasLimit_cospan_of_hasLimit_pair_of_hasLimit_parallelPair {C : Type u} [𝒞 : Category.{v} C]
    {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) [HasLimit (pair X Y)]
    [HasLimit (parallelPair (prod.fst ≫ f) (prod.snd ≫ g))] : HasLimit (cospan f g)

[CategoryTheory.Limits.HasLimit (CategoryTheory.Limits.pair X Y)]

[CategoryTheory.Limits.HasLimit
    (CategoryTheory.Limits.parallelPair (CategoryTheory.Limits.prod.fst ≫ f) (CategoryTheory.Limits.prod.snd ≫ g))]

CategoryTheory.Limits.HasLimit (CategoryTheory.Limits.cospan f g)


@[simp]
theorem sameCycle_pow_left {n : ℕ} : SameCycle f ((f ^ n) x) y ↔ SameCycle f x y

{α : Type u_2}
{f : Equiv.Perm α}
{x y : α}
{n : ℕ}

f.SameCycle ((f ^ n) x) y ↔ f.SameCycle x y


@[simp]
theorem tan_pi_div_three : tan (π / 3) = sqrt 3


protected theorem add_div_of_dvd_left {a b c : ℕ} (hca : c ∣ b) : (a + b) / c = a / c + b / c


/-- Given a sheaf `S`, construct an isomorphism `S ≅ [-, S(*)]`. -/
@[simps]
noncomputable def equivYoneda' (S : SheafOfTypes typesGrothendieckTopology) :
    S ≅ yoneda'.obj (S.1.obj (op PUnit))

(S : CategoryTheory.SheafOfTypes CategoryTheory.typesGrothendieckTopology)

(CategoryTheory.equivYoneda' S).hom.val = (CategoryTheory.equivYoneda S.val ⋯).hom


/-- `slope f a c` is a linear combination of `slope f a b` and `slope f b c`. This version
explicitly provides coefficients. If `a ≠ c`, then the sum of the coefficients is `1`, so it is
actually an affine combination, see `lineMap_slope_slope_sub_div_sub`. -/
theorem sub_div_sub_smul_slope_add_sub_div_sub_smul_slope (f : k → PE) (a b c : k) :
    ((b - a) / (c - a)) • slope f a b + ((c - b) / (c - a)) • slope f b c = slope f a c

{k : Type u_1}
{E : Type u_2}
{PE : Type u_3}
[Field k]
[AddCommGroup E]
[Module k E]
[AddTorsor E PE]
(f : k → PE)
(a b c : k)


theorem IsGLB.dual (h : IsGLB s a) : IsLUB (ofDual ⁻¹' s) (toDual a)

{α : Type u}
[Preorder α]
{s : Set α}
{a : α}
(h : IsGLB s a)

IsLUB (⇑OrderDual.ofDual ⁻¹' s) (OrderDual.toDual a)


theorem IsQF.relabel {m : ℕ} {φ : L.BoundedFormula α m} (h : φ.IsQF) (f : α → β ⊕ (Fin n)) :
    (φ.relabel f).IsQF

{L : FirstOrder.Language}
{α : Type u'}
{β : Type v'}
{n m : ℕ}
{φ : L.BoundedFormula α m}
(h : φ.IsQF)
(f : α → β ⊕ Fin n)


theorem Ioc_mem_nhdsWithin_Ioi {a b c : α} (H : b ∈ Ico a c) : Ioc a c ∈ 𝓝[>] b

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIciTopology α]
{a b c : α}
(H : b ∈ Set.Ico a c)


protected theorem acc (f : r ↪r s) (a : α) : Acc s (f a) → Acc r a

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
(f : r ↪r s)
(a : α)


theorem le_mul_prod_of_le_opNorm_of_le {C : ℝ} {b : ι → ℝ} (hC : ‖f‖ ≤ C) (hm : ∀ i, ‖m i‖ ≤ b i) :
    ‖f m‖ ≤ C * ∏ i, b i

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


@[simp] lemma induceHomOfLE_apply (v : s) : (G.induceHomOfLE h) v = Set.inclusion h v

{V : Type u_1}
(G : SimpleGraph V)
{s s' : Set V}
(h : s ≤ s')
(v : ↑s)


@[simp]
theorem coe_toCompacts (s : NonemptyCompacts α) : (s.toCompacts : Set α) = s

(s : TopologicalSpace.NonemptyCompacts α)


theorem insert_size [BEq α] [Hashable α] {m : Imp α β} {k v}
    (h : m.size = m.buckets.size) :
    (insert m k v).size = (insert m k v).buckets.size

{α : Type u_1}
{β : Type u_2}
[BEq α]
[Hashable α]
{m : Batteries.HashMap.Imp α β}
{k : α}
{v : β}
(h : m.size = m.buckets.size)

(m.insert k v).size = (m.insert k v).buckets.size


/-- Second version, with pointwise equicontinuity and range in a compact subset. -/
theorem arzela_ascoli₂ (s : Set β) (hs : IsCompact s) (A : Set (α →ᵇ β)) (closed : IsClosed A)
    (in_s : ∀ (f : α →ᵇ β) (x : α), f ∈ A → f x ∈ s) (H : Equicontinuous ((↑) : A → α → β)) :
    IsCompact A

(A : Set (BoundedContinuousFunction α β))

(in_s : ∀ (f : BoundedContinuousFunction α β) (x : α), f ∈ A → f x ∈ s)


/-- The zero rational function. -/
protected irreducible_def zero : RatFunc K


@[to_additive addOrderOf_add_dvd_mul_addOrderOf]
theorem orderOf_mul_dvd_mul_orderOf (h : Commute x y):
    orderOf (x * y) ∣ orderOf x * orderOf y

{G : Type u_1}
[AddMonoid G]
{x y : G}
(h : AddCommute x y)

addOrderOf (x + y) ∣ addOrderOf x * addOrderOf y


theorem abs_sub_le_iff : |a - b| ≤ c ↔ a - b ≤ c ∧ b - a ≤ c

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


@[symm]
nonrec theorem IsTheta.symm (h : f =Θ[l] g) : g =Θ[l] f

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{f : α → E}
{g : α → F}
{l : Filter α}
(h : f =Θ[l] g)


theorem ClosedComplemented.exists_isClosed_isCompl {p : Submodule R M} [T1Space p]
    (h : ClosedComplemented p) :
    ∃ q : Submodule R M, IsClosed (q : Set M) ∧ IsCompl p q

{R : Type u_1}
[Ring R]
{M : Type u_2}
[TopologicalSpace M]
[AddCommGroup M]
[Module R M]
{p : Submodule R M}
[T1Space ↥p]
(h : p.ClosedComplemented)


@[simp] lemma support_pow' (f : ι → M₀) (hn : n ≠ 0) : support (f ^ n) = support f

{ι : Type u_1}
{M₀ : Type u_4}
[MonoidWithZero M₀]
[NoZeroDivisors M₀]
{n : ℕ}
(f : ι → M₀)
(hn : n ≠ 0)

Function.support (f ^ n) = Function.support f


lemma P3_of_le_left {y₁ y₂} (i) (h : IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂) (hl : x₁ ≤ x₂.moveLeft i) :
    P3 x₁ x₂ y₁ y₂

(h : Surreal.Multiplication.IH3 x₁ (x₂.moveLeft i) x₂ y₁ y₂)


theorem natCast_nat (n) : ((Nat.rawCast n : ℕ) : R) = Nat.rawCast n


@[to_additive]
theorem smoothOn_one [One M'] : SmoothOn I I' (1 : M → M') s

{𝕜 : 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}
[One M']


theorem mem_diagonal (x : α) : (x, x) ∈ diagonal α


theorem comp_tensorLId_eq (Q₂ : QuadraticForm R M₂) :
    Q₂.comp (TensorProduct.lid R M₂) = QuadraticForm.tmul (sq (R := R)) Q₂

{R : Type uR}
{M₂ : Type uM₂}
[CommRing R]
[AddCommGroup M₂]
[Module R M₂]
[Invertible 2]
(Q₂ : QuadraticForm R M₂)

QuadraticMap.comp Q₂ ↑(TensorProduct.lid R M₂) = QuadraticForm.tmul QuadraticMap.sq Q₂


theorem smul_unitBall {c : 𝕜} (hc : c ≠ 0) : c • ball (0 : E) (1 : ℝ) = ball (0 : E) ‖c‖

{𝕜 : Type u_1}
{E : Type u_2}
[NormedField 𝕜]
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]
{c : 𝕜}
(hc : c ≠ 0)


lemma reflTransGen_eq_transGen (hr : Reflexive r) :
    ReflTransGen r = TransGen r

{α : Type u_1}
{r : α → α → Prop}
(hr : Reflexive r)

Relation.ReflTransGen r = Relation.TransGen r


theorem tendsto_nhds_iff {c : 𝕜} :
    Tendsto (fun x => eval x P) atTop (𝓝 c) ↔ P.leadingCoeff = c ∧ P.degree ≤ 0

{𝕜 : Type u_1}
[NormedLinearOrderedField 𝕜]
(P : 𝕜[X])
[OrderTopology 𝕜]
{c : 𝕜}

Filter.Tendsto (fun x => Polynomial.eval x P) Filter.atTop (𝓝 c) ↔ P.leadingCoeff = c ∧ P.degree ≤ 0


@[simp, mfld_simps]
theorem prod_target (e : PartialEquiv α β) (e' : PartialEquiv γ δ) :
    (e.prod e').target = e.target ×ˢ e'.target

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


theorem algebraicIndependent_subtype_range {ι} {f : ι → A} (hf : Injective f) :
    AlgebraicIndependent R ((↑) : range f → A) ↔ AlgebraicIndependent R f

{R : Type u_3}
{A : Type u_5}
[CommRing R]
[CommRing A]
[Algebra R A]
{ι : Type u_9}
{f : ι → A}
(hf : Function.Injective f)

AlgebraicIndependent R Subtype.val ↔ AlgebraicIndependent R f


@[simp]
lemma Φ_neg (n : ℤ) : W.Φ (-n) = W.Φ n

{R : Type r}
[CommRing R]
(W : WeierstrassCurve R)
(n : ℤ)


/-- If `Γ₀ˣ` is nontrivial and `f : Γ₀ →*₀ ℝ≥0` is strictly monotone, then for any positive
  `r : ℝ≥0`, there exists `d : Γ₀ˣ` with `f d < r`. -/
theorem NNReal.exists_lt_of_strictMono [h : Nontrivial Γ₀ˣ] {f : Γ₀ →*₀ ℝ≥0} (hf : StrictMono f)
    {r : ℝ≥0} (hr : 0 < r) : ∃ d : Γ₀ˣ, f d < r

{Γ₀ : Type u_1}
[LinearOrderedCommGroupWithZero Γ₀]
[h : Nontrivial Γ₀ˣ]
{f : Γ₀ →*₀ ℝ≥0}
(hf : StrictMono ⇑f)
{r : ℝ≥0}
(hr : 0 < r)


theorem Associated.pow_pow [CommMonoid α] {a b : α} {n : ℕ} (h : a ~ᵤ b) : a ^ n ~ᵤ b ^ n

{α : Type u_1}
[CommMonoid α]
{a b : α}
{n : ℕ}
(h : a ~ᵤ b)


theorem comp_smul (p p' : R[X]) (q : PolynomialModule R M) :
    comp p (p' • q) = p'.comp p • comp p q

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(p p' : R[X])
(q : PolynomialModule R M)

(PolynomialModule.comp p) (p' • q) = p'.comp p • (PolynomialModule.comp p) q


@[simp]
theorem Spec.topMap_id (R : CommRingCat.{u}) : Spec.topMap (𝟙 R) = 𝟙 (Spec.topObj R)

AlgebraicGeometry.Spec.topMap (CategoryTheory.CategoryStruct.id R) =
  CategoryTheory.CategoryStruct.id (AlgebraicGeometry.Spec.topObj R)


theorem getElem_permutations'Aux (s : List α) (x : α) (n : ℕ)
    (hn : n < length (permutations'Aux x s)) :
    (permutations'Aux x s)[n] = s.insertNth n x

(hn : n < (List.permutations'Aux x s).length)

(List.permutations'Aux x s)[n] = List.insertNth n x s


@[simp]
theorem parts_inf (P Q : Finpartition a) :
    (P ⊓ Q).parts = ((P.parts ×ˢ Q.parts).image fun bc : α × α ↦ bc.1 ⊓ bc.2).erase ⊥

{α : Type u_1}
[DistribLattice α]
[OrderBot α]
[DecidableEq α]
{a : α}
(P Q : Finpartition a)

(P ⊓ Q).parts = (Finset.image (fun bc => bc.1 ⊓ bc.2) (P.parts ×ˢ Q.parts)).erase ⊥


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

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

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


theorem isBounded_prod : IsBounded (s ×ˢ t) ↔ s = ∅ ∨ t = ∅ ∨ IsBounded s ∧ IsBounded t

{α : Type u_1}
{β : Type u_2}
[Bornology α]
[Bornology β]
{s : Set α}
{t : Set β}

Bornology.IsBounded (s ×ˢ t) ↔ s = ∅ ∨ t = ∅ ∨ Bornology.IsBounded s ∧ Bornology.IsBounded t


theorem adj_iff_exists_edge_coe : G.Adj a b ↔ ∃ e : G.edgeSet, e.val = s(a, b)

{V : Type u}
{G : SimpleGraph V}
{a b : V}


theorem matPolyEquiv_eval_eq_map (M : Matrix n n R[X]) (r : R) :
    (matPolyEquiv M).eval (scalar n r) = M.map (eval r)

{R : Type u}
[CommRing R]
{n : Type v}
[DecidableEq n]
[Fintype n]
(M : Matrix n n R[X])
(r : R)

Polynomial.eval ((Matrix.scalar n) r) (matPolyEquiv M) = M.map (Polynomial.eval r)


@[to_additive (attr := simp)]
theorem injective_zpow_iff_not_isOfFinOrder : (Injective fun n : ℤ => x ^ n) ↔ ¬IsOfFinOrder x

(Function.Injective fun n => x ^ n) ↔ ¬IsOfFinOrder x


theorem Coprime.gcd_mul_right_cancel_right (n : Nat)
    (H : Coprime k m) : gcd m (n * k) = gcd m n


theorem abelian_radical_of_hasTrivialRadical [HasTrivialRadical R L] :
    IsLieAbelian (radical R L)

(R : Type u_1)
(L : Type u_2)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.HasTrivialRadical R L]


/-- If `s ∈ 𝓤 α`, then for any natural `n`, for a subset `t` of a sufficiently small set in `𝓤 α`,
we have `t ○ t ○ ... ○ t ⊆ s` (`n` compositions). -/
theorem eventually_uniformity_iterate_comp_subset {s : Set (α × α)} (hs : s ∈ 𝓤 α) (n : ℕ) :
    ∀ᶠ t in (𝓤 α).smallSets, (t ○ ·)^[n] t ⊆ s

{α : Type ua}
[UniformSpace α]
{s : Set (α × α)}
(hs : s ∈ 𝓤 α)
(n : ℕ)

∀ᶠ (t : Set (α × α)) in (𝓤 α).smallSets, (fun x => t ○ x)^[n] t ⊆ s


/-- For `n < m`, `(n, m)` is in the transitive closure of a relation `~` if `i ~ succ i`
  for all `i` between `n` and `m`. -/
theorem transGen_of_succ_of_lt (r : α → α → Prop) {n m : α} (h : ∀ i ∈ Ico n m, r i (succ i))
    (hnm : n < m) : TransGen r n m

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


theorem right_mem_Ioc : b ∈ Ioc a b ↔ a < b

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


protected theorem MonotoneOn.antivaryOn (hf : MonotoneOn f s) (hg : AntitoneOn g s) :
    AntivaryOn f g s

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
{f : ι → α}
{g : ι → β}
{s : Set ι}
[LinearOrder ι]
(hf : MonotoneOn f s)
(hg : AntitoneOn g s)


/-- `IsAdjoinRoot S f` states that the ring `S` can be constructed by adjoining a specified root
of the polynomial `f : R[X]` to `R`.

Compare `PowerBasis R S`, which does not explicitly specify which polynomial we adjoin a root of
(in particular `f` does not need to be the minimal polynomial of the root we adjoin),
and `AdjoinRoot` which constructs a new type.

This is not a typeclass because the choice of root given `S` and `f` is not unique.
-/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure IsAdjoinRoot {R : Type u} (S : Type v) [CommSemiring R] [Semiring S] [Algebra R S]
    (f : R[X]) : Type max u v where
  map : R[X] →+* S
  map_surjective : Function.Surjective map
  ker_map : RingHom.ker map = Ideal.span {f}
  algebraMap_eq : algebraMap R S = map.comp Polynomial.C

{R : Type u}
{S : Type v}
[CommSemiring R]
[Semiring S]
[Algebra R S]
{f : R[X]}
(self : IsAdjoinRoot S f)

algebraMap R S = self.map.comp Polynomial.C


@[to_additive]
theorem dist_inv (x y : E) : dist x⁻¹ y = dist x y⁻¹

{E : Type u_6}
[SeminormedCommGroup E]
(x y : E)


@[simp] lemma tensorLId_apply (Q₂ : QuadraticForm R M₂) (x : R ⊗[R] M₂) :
    tensorLId Q₂ x = TensorProduct.lid R M₂ x

{R : Type uR}
{M₂ : Type uM₂}
[CommRing R]
[AddCommGroup M₂]
[Module R M₂]
[Invertible 2]
(Q₂ : QuadraticForm R M₂)
(x : R ⊗[R] M₂)

Q₂.tensorLId x = (TensorProduct.lid R M₂) x


theorem mul_iSup (f : ι → ℝ≥0) (a : ℝ≥0) : (a * ⨆ i, f i) = ⨆ i, a * f i


@[simp]
theorem mem_cIcc {a b x : α} : x ∈ cIcc a b ↔ btw a x b

{α : Type u_1}
[CircularPreorder α]
{a b x : α}


@[to_additive (attr := simp) zsmul_sub]
lemma div_zpow (a b : α) (n : ℤ) : (a / b) ^ n = a ^ n / b ^ n

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


theorem Sieve.effectiveEpimorphic_singleton {X Y : C} (f : Y ⟶ X) :
    (Presieve.singleton f).EffectiveEpimorphic ↔ (EffectiveEpi f)

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

(CategoryTheory.Presieve.singleton f).EffectiveEpimorphic ↔ CategoryTheory.EffectiveEpi f


/-- We cannot replace `<` by `≤` in the hypotheses.
Otherwise for `b < a = d < c` the l.h.s. is `∅` and the r.h.s. is `{a}`.
-/
theorem Icc_union_Icc (h₁ : min a b < max c d) (h₂ : min c d < max a b) :
    Icc a b ∪ Icc c d = Icc (min a c) (max b d)

{α : Type u_1}
[LinearOrder α]
{a b c d : α}
(h₁ : min a b < max c d)
(h₂ : min c d < max a b)

Set.Icc a b ∪ Set.Icc c d = Set.Icc (min a c) (max b d)


lemma toContinuousMapHom_toNNReal (f : C(X, ℝ)₀) :
    (toContinuousMapHom (X := X) (R := ℝ) f).toNNReal =
      toContinuousMapHom (X := X) (R := ℝ≥0) f.toNNReal

{X : Type u_1}
[TopologicalSpace X]
[Zero X]
(f : ContinuousMapZero X ℝ)

(ContinuousMapZero.toContinuousMapHom f).toNNReal = ContinuousMapZero.toContinuousMapHom f.toNNReal


/-- The range of `p.succAbove` is everything except `p`. -/
@[simp] lemma range_succAbove (p : Fin (n + 1)) : Set.range p.succAbove = {p}ᶜ


theorem sum_tensor {P Q R S : C} {J : Type*} (s : Finset J) (f : P ⟶ Q) (g : J → (R ⟶ S)) :
    (∑ j ∈ s, g j) ⊗ f = ∑ j ∈ s, g j ⊗ f

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.MonoidalPreadditive C]
{P Q R S : C}
{J : Type u_2}
(s : Finset J)
(f : P ⟶ Q)
(g : J → (R ⟶ S))

CategoryTheory.MonoidalCategory.tensorHom (∑ j ∈ s, g j) f = ∑ j ∈ s, CategoryTheory.MonoidalCategory.tensorHom (g j) f


theorem sup_inf_le : a ⊔ b ⊓ c ≤ (a ⊔ b) ⊓ (a ⊔ c)


lemma start_mem_verts_toSubgraph (p : G.Walk u v) : u ∈ p.toSubgraph.verts

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


lemma forall_some_ne_iff_eq_none {o : Option α} : (∀ (x : α), some x ≠ o) ↔ o = none


@[to_additive (attr := simp)]
theorem mulIndicator_const_iff :
    EventuallyConst (s.mulIndicator fun _ ↦ c) l ↔ c = 1 ∨ EventuallyConst s l

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
[Zero β]
{s : Set α}
{c : β}

Filter.EventuallyConst (s.indicator fun x => c) l ↔ c = 0 ∨ Filter.EventuallyConst s l


@[simp] theorem size_ofFn_go {n} (f : Fin n → α) (i acc) :
    (ofFn.go f i acc).size = acc.size + (n - i)

{α : Type u_1}
{n : Nat}
(f : Fin n → α)
(i : Nat)
(acc : Array α)

(Array.ofFn.go f i acc).size = acc.size + (n - i)


@[simp]
theorem mk_smul_monoidHom_apply (c : M) (f : A →* B) (a : A) : (mk c • f) a = f (c • a)

{M : Type u_5}
{A : Type u_7}
{B : Type u_8}
[Monoid M]
[Monoid A]
[MulDistribMulAction M A]
[MulOneClass B]
(c : M)
(f : A →* B)
(a : A)


@[simp]
theorem cycleOf_apply_self (f : Perm α) [DecidableRel f.SameCycle] (x : α) : cycleOf f x x = f x

{α : Type u_2}
(f : Equiv.Perm α)
[DecidableRel f.SameCycle]
(x : α)


theorem measure_Ioo_lt_top : μ (Ioo a b) < ∞


theorem kroneckerMap_smul_left [SMul R α] [SMul R γ] (f : α → β → γ) (r : R)
    (hf : ∀ a b, f (r • a) b = r • f a b) (A : Matrix l m α) (B : Matrix n p β) :
    kroneckerMap f (r • A) B = r • kroneckerMap f A B

(f : α → β → γ)

(hf : ∀ (a : α) (b : β), f (r • a) b = r • f a b)

Matrix.kroneckerMap f (r • A) B = r • Matrix.kroneckerMap f A B


theorem contMDiffOn_pi_space :
    ContMDiffOn I 𝓘(𝕜, ∀ i, Fi i) n φ s ↔ ∀ i, ContMDiffOn I 𝓘(𝕜, Fi i) n (fun x => φ x i) s

{𝕜 : 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]
{s : Set M}
{n : ℕ∞}
{ι : Type u_21}
[Fintype ι]
{Fi : ι → Type u_22}
[(i : ι) → NormedAddCommGroup (Fi i)]
[(i : ι) → NormedSpace 𝕜 (Fi i)]
{φ : M → (i : ι) → Fi i}

ContMDiffOn I 𝓘(𝕜, (i : ι) → Fi i) n φ s ↔ ∀ (i : ι), ContMDiffOn I 𝓘(𝕜, Fi i) n (fun x => φ x i) s


@[to_additive]
theorem iIndepFun.indepFun_prod_range_succ {f : ℕ → Ω → β}
    (hf_Indep : iIndepFun (fun _ => m) f κ μ) (hf_meas : ∀ i, Measurable (f i)) (n : ℕ) :
    IndepFun (∏ j ∈ Finset.range n, f j) (f n) κ μ

{f : ℕ → Ω → β}

(hf_Indep : ProbabilityTheory.Kernel.iIndepFun (fun x => m) f κ μ)

ProbabilityTheory.Kernel.IndepFun (∏ j ∈ Finset.range n, f j) (f n) κ μ


theorem g_eq_of_c_eq_one (hc : (↑ₘg) 1 0 = 1) : g = T ^ (↑ₘg) 0 0 * S * T ^ (↑ₘg) 1 1

g = ModularGroup.T ^ ↑g 0 0 * ModularGroup.S * ModularGroup.T ^ ↑g 1 1


theorem preVal_mk {x : O} (hx : (Ideal.Quotient.mk _ x : ModP K v O hv p) ≠ 0) :
    preVal K v O hv p (Ideal.Quotient.mk _ x) = v (algebraMap O K x)

(hx : (Ideal.Quotient.mk (Ideal.span {↑p})) x ≠ 0)

ModP.preVal K v O hv p ((Ideal.Quotient.mk (Ideal.span {↑p})) x) = v ((algebraMap O K) x)


/-- The non-zero values of a multiplicative character `χ` such that `χ^n = 1`
are `n`th roots of unity. -/
lemma apply_mem_rootsOfUnity_of_pow_eq_one {χ : MulChar F R} {n : ℕ} (hn : n ≠ 0) (hχ : χ ^ n = 1)
    {a : F} (ha : a ≠ 0) :
    ∃ ζ ∈ rootsOfUnity ⟨n, Nat.pos_of_ne_zero hn⟩ R, ζ = χ a

{F : Type u_1}
[Field F]
[Finite F]
{R : Type u_2}
[CommRing R]
{χ : MulChar F R}
{n : ℕ}
(hn : n ≠ 0)
(hχ : χ ^ n = 1)
{a : F}
(ha : a ≠ 0)


/-- A base angle of an isosceles triangle is acute, oriented vector angle form. -/
theorem abs_oangle_sub_left_toReal_lt_pi_div_two {x y : V} (h : ‖x‖ = ‖y‖) :
    |(o.oangle (y - x) y).toReal| < π / 2

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


theorem IsPreconnected.prod [TopologicalSpace β] {s : Set α} {t : Set β} (hs : IsPreconnected s)
    (ht : IsPreconnected t) : IsPreconnected (s ×ˢ t)

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
{s : Set α}
{t : Set β}
(hs : IsPreconnected s)
(ht : IsPreconnected t)


theorem empty_or_exists_mem (s : Multiset α) : s = 0 ∨ ∃ a, a ∈ s


/-- Two positive naturals are equal if their prime padic valuations are equal -/
theorem eq_iff_prime_padicValNat_eq (a b : ℕ) (ha : a ≠ 0) (hb : b ≠ 0) :
    a = b ↔ ∀ p : ℕ, p.Prime → padicValNat p a = padicValNat p b

a = b ↔ ∀ (p : ℕ), Nat.Prime p → padicValNat p a = padicValNat p b


@[simp]
theorem uniqueUpToIso_inv_right (P : IsKan s) (Q : IsKan t) :
    (uniqueUpToIso P Q).inv.right = Q.desc s

{s t : CategoryTheory.Bicategory.LeftLift f g}

(P.uniqueUpToIso Q).inv.right = Q.desc s


@[simp]
theorem powerset_coe' (l : List α) : @powerset α l = ((sublists' l).map (↑) : List (Multiset α))

(↑l).powerset = ↑(List.map Multiset.ofList l.sublists')


@[simp]
theorem zeroLocus_singleton_pow (f : R) (n : ℕ) (hn : 0 < n) :
    zeroLocus ({f ^ n} : Set R) = zeroLocus {f}

{R : Type u}
[CommSemiring R]
(f : R)
(n : ℕ)
(hn : 0 < n)

PrimeSpectrum.zeroLocus {f ^ n} = PrimeSpectrum.zeroLocus {f}


theorem convexBodyLT'_mem {x : K} :
    mixedEmbedding K x ∈ convexBodyLT' K f w₀ ↔
      (∀ w : InfinitePlace K, w ≠ w₀ → w x < f w) ∧
      |(w₀.val.embedding x).re| < 1 ∧ |(w₀.val.embedding x).im| < (f w₀ : ℝ) ^ 2

(f : NumberField.InfinitePlace K → NNReal)

(NumberField.mixedEmbedding K) x ∈ NumberField.mixedEmbedding.convexBodyLT' K f w₀ ↔
  (∀ (w : NumberField.InfinitePlace K), w ≠ ↑w₀ → w x < ↑(f w)) ∧
    |((↑w₀).embedding x).re| < 1 ∧ |((↑w₀).embedding x).im| < ↑(f ↑w₀) ^ 2


/-- Postcompose a partial homeomorphism with a homeomorphism.
We modify the source and target to have better definitional behavior. -/
@[simps! (config := .asFn)]
def transHomeomorph (e : PartialHomeomorph X Y) (f' : Y ≃ₜ Z) : PartialHomeomorph X Z

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

(e.transHomeomorph f').source = e.source


private theorem gauss_lemma_aux₁ (p : ℕ) [Fact p.Prime] {a : ℤ}
    (hap : (a : ZMod p) ≠ 0) : (a ^ (p / 2) * (p / 2)! : ZMod p) =
    (-1 : ZMod p) ^ ((Ico 1 (p / 2).succ).filter fun x : ℕ =>
      ¬(a * x : ZMod p).val ≤ p / 2).card * (p / 2)!

(p : ℕ)
[Fact (Nat.Prime p)]
{a : ℤ}
(hap : ↑a ≠ 0)

↑a ^ (p / 2) * ↑(p / 2)! =
  (-1) ^ (Finset.filter (fun x => ¬(↑a * ↑x).val ≤ p / 2) (Finset.Ico 1 (p / 2).succ)).card * ↑(p / 2)!


/-- The zeroth convergent of `ξ` is `⌊ξ⌋`. -/
@[simp]
theorem convergent_zero (ξ : ℝ) : ξ.convergent 0 = ⌊ξ⌋


theorem quasiMeasurePreserving_snd : QuasiMeasurePreserving Prod.snd (μ.prod ν) ν

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

MeasureTheory.Measure.QuasiMeasurePreserving Prod.snd (μ.prod ν) ν


protected theorem mdifferentiableAt (f : C^∞⟮I, M; I', M'⟯) {x} : MDifferentiableAt 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 : C^⊤⟮I, M; I', M'⟯)
{x : M}


theorem smul_apply (M : ModuleCat R) (g : (coextendScalars f).obj M) (s s' : S) :
    (s • g) s' = g (s' * s)

(g : ↑((ModuleCat.coextendScalars f).obj M))


theorem Finite.relatively_discrete (hs : s.Finite) :
    ∃ C > 0, ∀ x ∈ s, ∀ y ∈ s, x ≠ y → C ≤ edist x y

{α : Type u_1}
[EMetricSpace α]
{s : Set α}
(hs : s.Finite)


/--  `Fin.succAbove p` as an `OrderEmbedding`. -/
@[simps! apply toEmbedding]
def succAboveOrderEmb (p : Fin (n + 1)) : Fin n ↪o Fin (n + 1)

p.succAboveOrderEmb.toEmbedding = { toFun := p.succAbove, inj' := ⋯ }


@[to_additive] lemma inv_le_leOnePart (a : α) : a⁻¹ ≤ a⁻ᵐ

{α : Type u_1}
[Lattice α]
[Group α]
(a : α)


@[simp]
theorem continuousMultilinearCurryRightEquiv_apply' (f : G[×n]→L[𝕜] G →L[𝕜] G')
    (v : Fin (n + 1) → G) :
    continuousMultilinearCurryRightEquiv' 𝕜 n G G' f v = f (init v) (v (last n))

(f : ContinuousMultilinearMap 𝕜 (fun i => G) (G →L[𝕜] G'))

((continuousMultilinearCurryRightEquiv' 𝕜 n G G') f) v = (f (Fin.init v)) (v (Fin.last n))


theorem tsub_inj_left (h₁ : a ≤ b) (h₂ : a ≤ c) : b - a = c - a → b = c

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


@[to_additive leftAddCoset_rightAddCoset]
theorem leftCoset_rightCoset (s : Set α) (a b : α) : op b • a • s = a • (op b • s)

{α : Type u_1}
[AddSemigroup α]
(s : Set α)
(a b : α)

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


@[aesop safe apply]
lemma T_nonneg (n : ℕ) : 0 ≤ T n

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


theorem Submodule.basisOfPid_bot {ι : Type*} [Finite ι] (b : Basis ι R M) :
    Submodule.basisOfPid b ⊥ = ⟨0, Basis.empty _⟩

{R : Type u_2}
[CommRing R]
[IsDomain R]
[IsPrincipalIdealRing R]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
{ι : Type u_4}
[Finite ι]
(b : Basis ι R M)

Submodule.basisOfPid b ⊥ = ⟨0, Basis.empty ↥⊥⟩


theorem _root_.Polynomial.toLaurent_injective :
    Function.Injective (Polynomial.toLaurent : R[X] → R[T;T⁻¹])


@[to_additive]
theorem prod_filter_index [CommMonoid N] (g : α → M → N) :
    (f.filter p).prod g = ∏ x ∈ (f.filter p).support, g x (f x)

{α : Type u_1}
{M : Type u_5}
{N : Type u_7}
[Zero M]
(p : α → Prop)
[DecidablePred p]
(f : α →₀ M)
[AddCommMonoid N]
(g : α → M → N)

(Finsupp.filter p f).sum g = ∑ x ∈ (Finsupp.filter p f).support, g x (f x)


/-- If a set has the unique differential property, then its image under a local
diffeomorphism also has the unique differential property. -/
theorem UniqueMDiffOn.uniqueMDiffOn_preimage (hs : UniqueMDiffOn I s) {e : PartialHomeomorph M M'}
    (he : e.MDifferentiable I I') : UniqueMDiffOn I' (e.target ∩ e.symm ⁻¹' s)

(he : PartialHomeomorph.MDifferentiable I I' e)

UniqueMDiffOn I' (e.target ∩ ↑e.symm ⁻¹' s)


/-- If `F.cones` is represented by `X`, any cone is the extension of the limit cone by the
corresponding morphism. -/
theorem cone_fac (s : Cone F) : (limitCone h).extend (homOfCone h s) = s

(h : CategoryTheory.yoneda.obj X ⋙ CategoryTheory.uliftFunctor.{u₁, v₃} ≅ F.cones)

(CategoryTheory.Limits.IsLimit.OfNatIso.limitCone h).extend (CategoryTheory.Limits.IsLimit.OfNatIso.homOfCone h s) = s


@[simp] lemma lowerBounds_smul_of_pos (ha : 0 < a) : lowerBounds (a • s) = a • lowerBounds s

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
[GroupWithZero α]
[Zero β]
[MulActionWithZero α β]
[PosSMulMono α β]
[PosSMulReflectLE α β]
{s : Set β}
{a : α}
(ha : 0 < a)


@[simp]
theorem mem_coeIdeal {x : P} {I : Ideal R} :
    x ∈ (I : FractionalIdeal S P) ↔ ∃ x', x' ∈ I ∧ algebraMap R P x' = x

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

x ∈ ↑I ↔ ∃ x' ∈ I, (algebraMap R P) x' = x


@[reassoc]
lemma comp_homologySequenceδ :
    (F.shift n₀).map T.mor₂ ≫ F.homologySequenceδ T n₀ n₁ h = 0

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

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

CategoryTheory.CategoryStruct.comp ((F.shift n₀).map T.mor₂) (F.homologySequenceδ T n₀ n₁ h) = 0


theorem neg_mulVec [Fintype n] (v : n → α) (A : Matrix m n α) : (-A) *ᵥ v = - (A *ᵥ v)

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[NonUnitalNonAssocRing α]
[Fintype n]
(v : n → α)
(A : Matrix m n α)


theorem EuclideanSpace.inner_eq_star_dotProduct (x y : EuclideanSpace 𝕜 ι) :
    ⟪x, y⟫ = Matrix.dotProduct (star <| WithLp.equiv _ _ x) (WithLp.equiv _ _ y)

{ι : Type u_1}
{𝕜 : Type u_3}
[RCLike 𝕜]
[Fintype ι]
(x y : EuclideanSpace 𝕜 ι)

⟪x, y⟫_𝕜 = Matrix.dotProduct (star ((WithLp.equiv 2 (ι → 𝕜)) x)) ((WithLp.equiv 2 (ι → 𝕜)) y)


/-- Sets of subtype are σ-compact iff the image under a coercion is. -/
lemma Subtype.isSigmaCompact_iff {p : X → Prop} {s : Set { a // p a }} :
    IsSigmaCompact s ↔ IsSigmaCompact ((↑) '' s : Set X)

{X : Type u_1}
[TopologicalSpace X]
{p : X → Prop}
{s : Set { a // p a }}

IsSigmaCompact s ↔ IsSigmaCompact (Subtype.val '' s)


theorem intCast_def (z : ℤ) : (z : A ⊗[R] B) = (z : A) ⊗ₜ (1 : B)

{R : Type uR}
{A : Type uA}
{B : Type uB}
[CommSemiring R]
[AddCommGroupWithOne A]
[Module R A]
[AddCommGroupWithOne B]
[Module R B]
(z : ℤ)


theorem nhdsSet_Ioc (h : a < b) : 𝓝ˢ (Ioc a b) = 𝓝 b ⊔ 𝓟 (Ioo a b)

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

𝓝ˢ (Set.Ioc a b) = 𝓝 b ⊔ 𝓟 (Set.Ioo a b)


lemma mk_eq_mk {x y : PGame.{u}} {hx hy} : mk x hx = mk y hy ↔ x ≈ y

{x y : SetTheory.PGame}
{hx : x.Numeric}
{hy : y.Numeric}

Surreal.mk x hx = Surreal.mk y hy ↔ x ≈ y


@[reassoc (attr := simp)]
lemma π_leftRightHomologyComparison_ι [S.HasLeftHomology] [S.HasRightHomology] :
    S.leftHomologyπ ≫ S.leftRightHomologyComparison ≫ S.rightHomologyι =
      S.iCycles ≫ S.pOpcycles

CategoryTheory.CategoryStruct.comp S.leftHomologyπ
    (CategoryTheory.CategoryStruct.comp S.leftRightHomologyComparison S.rightHomologyι) =
  CategoryTheory.CategoryStruct.comp S.iCycles S.pOpcycles


theorem noncommFold_eq_fold (s : Multiset α) [Std.Commutative op] (a : α) :
    noncommFold op s (fun x _ y _ _ => Std.Commutative.comm x y) a = fold op a s

{α : Type u_3}
(op : α → α → α)
[assoc : Std.Associative op]
(s : Multiset α)
[Std.Commutative op]
(a : α)

Multiset.noncommFold op s ⋯ a = Multiset.fold op a s


theorem card_le_multiplicity {s : Finset E} (hs : ∀ c ∈ s, ‖c‖ ≤ 2)
    (h's : ∀ c ∈ s, ∀ d ∈ s, c ≠ d → 1 ≤ ‖c - d‖) : s.card ≤ multiplicity E


/-- If a set of functions is uniformly equicontinuous on a set `S`, its closure for the product
topology is also uniformly equicontinuous. This would also be true for the coarser topology of
pointwise convergence on `S`, see `UniformEquicontinuousOn.closure'`. -/
protected theorem Set.UniformEquicontinuousOn.closure {A : Set <| β → α} {S : Set β}
    (hA : A.UniformEquicontinuousOn S) : (closure A).UniformEquicontinuousOn S

{α : Type u_7}
{β : Type u_9}
[uα : UniformSpace α]
[uβ : UniformSpace β]
{A : Set (β → α)}
{S : Set β}
(hA : A.UniformEquicontinuousOn S)


@[to_additive]
theorem inter_mul_singleton : s ∩ t * {a} = s * {a} ∩ (t * {a})

{α : Type u_2}
[Mul α]
[IsRightCancelMul α]
[DecidableEq α]
(s t : Finset α)
(a : α)


@[to_additive addCenter_subset_addCentralizer]
lemma center_subset_centralizer (S : Set M) : Set.center M ⊆ S.centralizer


/-- Given f : Y ⟶ X, we have an equivalence between (T/X)/f and T/Y -/
@[simps]
def iteratedSliceEquiv : Over f ≌ Over f.left

{T : Type u₁}
[CategoryTheory.Category.{v₁, u₁} T]
{X : T}
(f : CategoryTheory.Over X)


@[simp]
theorem intersecting_singleton : ({a} : Set α).Intersecting ↔ a ≠ ⊥

{α : Type u_1}
[SemilatticeInf α]
[OrderBot α]
{a : α}


protected theorem injective {α β} (f : α ↪ β) : Injective f

{α : Sort u_1}
{β : Sort u_2}
(f : α ↪ β)


/-- The difference `log (1+z) - z` is bounded by `‖z‖^2/(2*(1-‖z‖))` when `‖z‖ < 1`. -/
lemma norm_log_one_add_sub_self_le {z : ℂ} (hz : ‖z‖ < 1) :
    ‖log (1 + z) - z‖ ≤ ‖z‖ ^ 2 * (1 - ‖z‖)⁻¹ / 2

‖Complex.log (1 + z) - z‖ ≤ ‖z‖ ^ 2 * (1 - ‖z‖)⁻¹ / 2


theorem IsLUB.biUnion_Iic_eq_Iio (a_lub : IsLUB s a) (a_not_mem : a ∉ s) :
    ⋃ x ∈ s, Iic x = Iio a

{α : Type v}
[LinearOrder α]
{s : Set α}
{a : α}
(a_lub : IsLUB s a)
(a_not_mem : a ∉ s)


/-- The first dart of a walk. -/
@[simps]
def firstDart (p : G.Walk v w) (hp : ¬ p.Nil) : G.Dart

{V : Type u}
{G : SimpleGraph V}
{v w : V}
(p : G.Walk v w)
(hp : ¬p.Nil)

(p.firstDart hp).toProd = (v, p.sndOfNotNil hp)


lemma exists_eval_ne_zero_of_natDegree_lt_card (f : R[X]) (hf : f ≠ 0) (hfR : f.natDegree < #R) :
    ∃ r, f.eval r ≠ 0

{R : Type u}
[CommRing R]
[IsDomain R]
(f : Polynomial R)
(hf : f ≠ 0)
(hfR : ↑f.natDegree < Cardinal.mk R)


@[simp]
theorem multicofork_π (b) : (Multicoequalizer.multicofork I).π b = Multicoequalizer.π I b

(I : CategoryTheory.Limits.MultispanIndex C)

(CategoryTheory.Limits.Multicoequalizer.multicofork I).π b = CategoryTheory.Limits.Multicoequalizer.π I b


protected theorem Tendsto.disjoint {f : α → β} {la₁ la₂ : Filter α} {lb₁ lb₂ : Filter β}
    (h₁ : Tendsto f la₁ lb₁) (hd : Disjoint lb₁ lb₂) (h₂ : Tendsto f la₂ lb₂) : Disjoint la₁ la₂

{α : Type u}
{β : Type v}
{f : α → β}
{la₁ la₂ : Filter α}
{lb₁ lb₂ : Filter β}
(h₁ : Filter.Tendsto f la₁ lb₁)
(hd : Disjoint lb₁ lb₂)
(h₂ : Filter.Tendsto f la₂ lb₂)


@[simp]
theorem toIcoDiv_add_right (a b : α) : toIcoDiv hp a (b + p) = toIcoDiv hp a b + 1

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


@[simp]
theorem mk'_cancel_left (m : M) (s₁ s₂ : S) : mk' f (s₁ • m) (s₁ * s₂) = mk' f m s₂

{R : Type u_1}
[CommSemiring R]
{S : Submonoid R}
{M : Type u_2}
{M' : Type u_3}
[AddCommMonoid M]
[AddCommMonoid M']
[Module R M]
[Module R M']
(f : M →ₗ[R] M')
[IsLocalizedModule S f]
(m : M)
(s₁ s₂ : ↥S)

IsLocalizedModule.mk' f (s₁ • m) (s₁ * s₂) = IsLocalizedModule.mk' f m s₂


lemma _root_.MeasurableEmbedding.withDensity_ofReal_comap_apply_eq_integral_abs_det_fderiv_mul
    (hs : MeasurableSet s) (hf : MeasurableEmbedding f)
    {g : E → ℝ} (hg : ∀ᵐ x ∂μ, x ∈ f '' s → 0 ≤ g x) (hg_int : IntegrableOn g (f '' s) μ)
    (hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) :
    (μ.withDensity (fun x ↦ ENNReal.ofReal (g x))).comap f s
      = ENNReal.ofReal (∫ x in s, |(f' x).det| * g (f x) ∂μ)

(hg : ∀ᵐ (x : E) ∂μ, x ∈ f '' s → 0 ≤ g x)

(hg_int : MeasureTheory.IntegrableOn g (f '' s) μ)

(MeasureTheory.Measure.comap f (μ.withDensity fun x => ENNReal.ofReal (g x))) s =
  ENNReal.ofReal (∫ (x : E) in s, |(f' x).det| * g (f x) ∂μ)


theorem apply_ind (x : M) (hx : x ∈ s) : fs (fs.ind x hx) x = 1

{ι : Type uι}
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{s : Set M}
(fs : SmoothBumpCovering ι I M s)
(x : M)
(hx : x ∈ s)


theorem xInTermsOfW_vars_aux (n : ℕ) :
    n ∈ (xInTermsOfW p ℚ n).vars ∧ (xInTermsOfW p ℚ n).vars ⊆ range (n + 1)

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

n ∈ (xInTermsOfW p ℚ n).vars ∧ (xInTermsOfW p ℚ n).vars ⊆ Finset.range (n + 1)


theorem smoothWithinAt_const : SmoothWithinAt I I' (fun _ : M => c) s 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']
{s : Set M}
{x : M}
{c : M'}


protected theorem id_map : ∀ x : Comp F G α, Comp.map id x = x

{F : Type u → Type w}
{G : Type v → Type u}
[Functor F]
[Functor G]
[LawfulFunctor F]
[LawfulFunctor G]
{α : Type v}
(x : Functor.Comp F G α)


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

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Sup α]
[Bot α]
[Sup β]
[Bot β]
[Sup γ]
[Bot γ]
(f : SupBotHom β γ)
(g : SupBotHom α β)
(a : α)


protected theorem Inducing.secondCountableTopology [SecondCountableTopology β] (hf : Inducing f) :
    SecondCountableTopology α

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
[SecondCountableTopology β]
(hf : Inducing f)


@[simp]
theorem right_le_midpoint : b ≤ midpoint k a b ↔ b ≤ a

{k : Type u_1}
{E : Type u_2}
[LinearOrderedField k]
[OrderedAddCommGroup E]
[Module k E]
[OrderedSMul k E]
{a b : E}


@[simp]
theorem eval₂Hom_zero (f : R →+* S₂) : eval₂Hom f (0 : σ → S₂) = f.comp constantCoeff

{R : Type u}
{S₂ : Type w}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₂]
(f : R →+* S₂)

MvPolynomial.eval₂Hom f 0 = f.comp MvPolynomial.constantCoeff