@[simp]
theorem smulAddMonoidHom_apply_of_of [DecidableEq ιA] [DecidableEq ιB] [GMonoid A] [Gmodule A M]
    {i j} (x : A i) (y : M j) :
    smulAddMonoidHom A M (DirectSum.of A i x) (of M j y) = of M (i +ᵥ j) (GSMul.smul x y)

{ιA : Type u_1}
{ιB : Type u_2}
(A : ιA → Type u_3)
(M : ιB → Type u_4)
[AddMonoid ιA]
[VAdd ιA ιB]
[(i : ιA) → AddCommMonoid (A i)]
[(i : ιB) → AddCommMonoid (M i)]
[DecidableEq ιA]
[DecidableEq ιB]
[GradedMonoid.GMonoid A]
[DirectSum.Gmodule A M]
{i : ιA}
{j : ιB}
(x : A i)
(y : M j)

((DirectSum.Gmodule.smulAddMonoidHom A M) ((DirectSum.of A i) x)) ((DirectSum.of M j) y) =
  (DirectSum.of M (i +ᵥ j)) (GradedMonoid.GSMul.smul x y)


theorem tsum_eq_add_tsum_ite {f : α → ℝ≥0} (hf : Summable f) (i : α) :
    ∑' x, f x = f i + ∑' x, ite (x = i) 0 (f x)

{α : Type u_1}
{f : α → ℝ≥0}
(hf : Summable f)
(i : α)

∑' (x : α), f x = f i + ∑' (x : α), if x = i then 0 else f x


/-- `OrderDual` as a functor. -/
@[simps]
def dual : Preord ⥤ Preord


@[simp]
theorem coe_subtypeₗᵢ : ⇑p.subtypeₗᵢ = p.subtype

{E : Type u_5}
[SeminormedAddCommGroup E]
{R' : Type u_11}
[Ring R']
[Module R' E]
(p : Submodule R' E)


theorem prod_dvd_prod_of_dvd {S : Finset α} (g1 g2 : α → β) (h : ∀ a ∈ S, g1 a ∣ g2 a) :
    S.prod g1 ∣ S.prod g2

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
{S : Finset α}
(g1 g2 : α → β)
(h : ∀ a ∈ S, g1 a ∣ g2 a)


@[simp] theorem fmod_zero : ∀ a : Int, fmod a 0 = a


theorem pow_mul_meas_ge_le_norm (f : Lp E p μ) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) (ε : ℝ≥0∞) :
    (ε * μ { x | ε ≤ (‖f x‖₊ : ℝ≥0∞) ^ p.toReal }) ^ (1 / p.toReal) ≤ ENNReal.ofReal ‖f‖

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
(f : ↥(MeasureTheory.Lp E p μ))
(hp_ne_zero : p ≠ 0)
(hp_ne_top : p ≠ ⊤)
(ε : ℝ≥0∞)

(ε * μ {x | ε ≤ ↑‖↑↑f x‖₊ ^ p.toReal}) ^ (1 / p.toReal) ≤ ENNReal.ofReal ‖f‖


theorem mk (F : X → Type*) [∀ x, TopologicalSpace (F x)] [∀ x, DiscreteTopology (F x)]
    (e : ∀ x, Trivialization (F x) f) (h : ∀ x, x ∈ (e x).baseSet) : IsCoveringMap f

{E : Type u_1}
{X : Type u_2}
[TopologicalSpace E]
[TopologicalSpace X]
(f : E → X)
(F : X → Type u_3)
[(x : X) → TopologicalSpace (F x)]
[∀ (x : X), DiscreteTopology (F x)]
(e : (x : X) → Trivialization (F x) f)
(h : ∀ (x : X), x ∈ (e x).baseSet)


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

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[SupSet α]
[SupSet β]
[SupSet γ]
{g : sSupHom β γ}
{f₁ f₂ : sSupHom α β}
(hg : Function.Injective ⇑g)


theorem comap_apply (μ : Measure β) (s : Set α) : comap f μ s = μ (f '' s)

{α : Type u_2}
{β : Type u_3}
{m0 : MeasurableSpace α}
{m1 : MeasurableSpace β}
{f : α → β}
(hf : MeasurableEmbedding f)
(μ : MeasureTheory.Measure β)
(s : Set α)

(MeasureTheory.Measure.comap f μ) s = μ (f '' s)


theorem _root_.Set.exists_isOpen_le_add (A : Set α) (μ : Measure α) [OuterRegular μ] {ε : ℝ≥0∞}
    (hε : ε ≠ 0) : ∃ U, U ⊇ A ∧ IsOpen U ∧ μ U ≤ μ A + ε

{α : Type u_1}
[MeasurableSpace α]
[TopologicalSpace α]
(A : Set α)
(μ : MeasureTheory.Measure α)
[μ.OuterRegular]
{ε : ℝ≥0∞}
(hε : ε ≠ 0)


@[to_additive]
theorem mulIndicator_of_not_mem (hU : IsClopen U) (h : a ∉ U) : f.mulIndicator hU a = 1

{X : Type u_1}
[TopologicalSpace X]
{R : Type u_5}
[One R]
{U : Set X}
(f : LocallyConstant X R)
{a : X}
(hU : IsClopen U)
(h : a ∉ U)


/-- For `f : ℕ → G`, the product `∏' k, f (k + i)` tends to one. This does not require a
multipliability assumption on `f`, as otherwise all such products are one. -/
@[to_additive "For `f : ℕ → G`, the sum `∑' k, f (k + i)` tends to zero. This does not require a
summability assumption on `f`, as otherwise all such sums are zero."]
theorem tendsto_prod_nat_add [T2Space G] (f : ℕ → G) :
    Tendsto (fun i ↦ ∏' k, f (k + i)) atTop (𝓝 1)

{G : Type u_2}
[AddCommGroup G]
[TopologicalSpace G]
[TopologicalAddGroup G]
[T2Space G]
(f : ℕ → G)

Filter.Tendsto (fun i => ∑' (k : ℕ), f (k + i)) Filter.atTop (𝓝 0)


theorem image.map_ι : image.map sq ≫ image.ι g.hom = image.ι f.hom ≫ sq.right

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{f g : CategoryTheory.Arrow C}
[CategoryTheory.Limits.HasImage f.hom]
[CategoryTheory.Limits.HasImage g.hom]
(sq : f ⟶ g)
[CategoryTheory.Limits.HasImageMap sq]

CategoryTheory.Limits.image.map sq ≫ CategoryTheory.Limits.image.ι g.hom =
  CategoryTheory.Limits.image.ι f.hom ≫ sq.right


@[to_additive (attr := simp)]
theorem prod_ite_eq [DecidableEq α] (s : Finset α) (a : α) (b : α → β) :
    (∏ x ∈ s, ite (a = x) (b x) 1) = ite (a ∈ s) (b a) 1

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

(∑ x ∈ s, if a = x then b x else 0) = if a ∈ s then b a else 0


@[simp]
theorem lowerCentralSeries_zero : lowerCentralSeries R L M 0 = ⊤

(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.lowerCentralSeries R L M 0 = ⊤


theorem eq_of_subset_of_card_le (hsub : s ⊆ t) (hcard : Nat.card t ≤ Nat.card s) : s = t

{α : Type u_1}
{s t : Set α}
(ht : t.Finite)
(hsub : s ⊆ t)
(hcard : Nat.card ↑t ≤ Nat.card ↑s)


theorem destruct_terminates_of_get?_terminates {s : WSeq α} {n} (T : Terminates (get? s n)) :
    Terminates (destruct s)

{α : Type u}
{s : Stream'.WSeq α}
{n : ℕ}
(T : (s.get? n).Terminates)


lemma Integrable.piecewise [DecidablePred (· ∈ s)]
    (hs : MeasurableSet s) (hf : IntegrableOn f s μ) (hg : IntegrableOn g sᶜ μ) :
    Integrable (s.piecewise f g) μ

(hg : MeasureTheory.IntegrableOn g sᶜ μ)

MeasureTheory.Integrable (s.piecewise f g) μ


theorem affine_isReduced_iff (R : CommRingCat) :
    IsReduced (Spec R) ↔ _root_.IsReduced R

AlgebraicGeometry.IsReduced (AlgebraicGeometry.Spec R) ↔ IsReduced ↑R


theorem restrict_apply {α} {β : α → Type*} (f : ∀ x, β x) (p : α → Prop) (x : Subtype p) :
    restrict p f x = f x.1

{α : Sort u_5}
{β : α → Type u_4}
(f : (x : α) → β x)
(p : α → Prop)
(x : Subtype p)


theorem inclusion_injective : Function.Injective (inclusion h)

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


theorem _root_.HasCompactSupport.hasFDerivAt_convolution_left [IsNegInvariant μ]
    (hcf : HasCompactSupport f) (hf : ContDiff 𝕜 1 f) (hg : LocallyIntegrable g μ) (x₀ : G) :
    HasFDerivAt (f ⋆[L, μ] g) ((fderiv 𝕜 f ⋆[L.precompL G, μ] g) x₀) x₀

(hg : MeasureTheory.LocallyIntegrable g μ)

HasFDerivAt (MeasureTheory.convolution f g L μ)
  (MeasureTheory.convolution (fderiv 𝕜 f) g (ContinuousLinearMap.precompL G L) μ x₀) x₀


theorem subset_iff_eq_of_card_le (h : t.card ≤ s.card) : s ⊆ t ↔ s = t

{α : Type u_1}
{s t : Finset α}
(h : t.card ≤ s.card)


/-- The composable arrows associated to a short complex. -/
@[simps!]
def ShortComplex.toComposableArrows (S : ShortComplex C) : ComposableArrows C 2

∀ {X Y : Fin (1 + 1 + 1)} (g : X ⟶ Y),
  S.toComposableArrows.map g =
    CategoryTheory.ComposableArrows.Precomp.map (CategoryTheory.ComposableArrows.mk₁ S.g) S.f X Y ⋯


@[elab_without_expected_type]
theorem refl_of [IsRefl α r] (a : α) : a ≺ a

{α : Sort u}
(r : α → α → Prop)
[IsRefl α r]
(a : α)


@[simp]
theorem edges_map : (p.map f).edges = p.edges.map (Sym2.map f)

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

(SimpleGraph.Walk.map f p).edges = List.map (Sym2.map ⇑f) p.edges


@[to_additive]
theorem norm_prod_le_of_le (s : Finset ι) {f : ι → E} {n : ι → ℝ} (h : ∀ b ∈ s, ‖f b‖ ≤ n b) :
    ‖∏ b ∈ s, f b‖ ≤ ∑ b ∈ s, n b

{ι : Type u_4}
{E : Type u_6}
[SeminormedCommGroup E]
(s : Finset ι)
{f : ι → E}
{n : ι → ℝ}
(h : ∀ b ∈ s, ‖f b‖ ≤ n b)


/-- A version of `Finsupp.comapDomain_add` that's easier to use. -/
theorem comapDomain_add_of_injective (hf : Function.Injective f) (v₁ v₂ : β →₀ M) :
    comapDomain f (v₁ + v₂) hf.injOn =
      comapDomain f v₁ hf.injOn + comapDomain f v₂ hf.injOn

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[AddZeroClass M]
{f : α → β}
(hf : Function.Injective f)
(v₁ v₂ : β →₀ M)

Finsupp.comapDomain f (v₁ + v₂) ⋯ = Finsupp.comapDomain f v₁ ⋯ + Finsupp.comapDomain f v₂ ⋯


@[to_additive (attr := simp)]
theorem empty_div (s : Finset α) : ∅ / s = ∅

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


theorem algebraMap_image : algebraMap R S '' quasispectrum R a = quasispectrum S a

{R : Type u_3}
{S : Type u_4}
{A : Type u_5}
[Semifield R]
[Field S]
[NonUnitalRing A]
[Module R A]
[Module S A]
[IsScalarTower S A A]
[SMulCommClass S A A]
[Algebra R S]
{a : A}
{f : S → R}
[IsScalarTower R S A]
(h : QuasispectrumRestricts a f)

⇑(algebraMap R S) '' quasispectrum R a = quasispectrum S a


/-- A Lie ring is an additive group with compatible product, known as the bracket, satisfying the
Jacobi identity. -/
class LieRing (L : Type v) extends AddCommGroup L, Bracket L L where
  /-- A Lie ring bracket is additive in its first component. -/
  protected add_lie : ∀ x y z : L, ⁅x + y, z⁆ = ⁅x, z⁆ + ⁅y, z⁆
  /-- A Lie ring bracket is additive in its second component. -/
  protected lie_add : ∀ x y z : L, ⁅x, y + z⁆ = ⁅x, y⁆ + ⁅x, z⁆
  /-- A Lie ring bracket vanishes on the diagonal in L × L. -/
  protected lie_self : ∀ x : L, ⁅x, x⁆ = 0
  /-- A Lie ring bracket satisfies a Leibniz / Jacobi identity. -/
  protected leibniz_lie : ∀ x y z : L, ⁅x, ⁅y, z⁆⁆ = ⁅⁅x, y⁆, z⁆ + ⁅y, ⁅x, z⁆⁆


theorem le_of_not_gt {a b : α} : ¬a > b → a ≤ b


@[simp]
theorem type_sum_lex {α β : Type u} (r : α → α → Prop) (s : β → β → Prop) [IsWellOrder α r]
    [IsWellOrder β s] : type (Sum.Lex r s) = type r + type s

Ordinal.type (Sum.Lex r s) = Ordinal.type r + Ordinal.type s


theorem one_minus_nonneg (x : I) : 0 ≤ 1 - (x : ℝ)


@[simp] lemma disjointSigma_ground_eq {h} : (Matroid.disjointSigma M h).E = ⋃ i : ι, (M i).E

{h : Pairwise (Disjoint on fun i => (M i).E)}

(Matroid.disjointSigma M h).E = ⋃ i, (M i).E


/-- Suppose `X Y : SheafedSpace C`, where `C` is a concrete category,
whose forgetful functor reflects isomorphisms, preserves limits and filtered colimits.
Then a morphism `X ⟶ Y` that is a topological open embedding
is an open immersion iff every stalk map is an iso.
-/
theorem of_stalk_iso {X Y : SheafedSpace C} (f : X ⟶ Y) (hf : OpenEmbedding f.base)
    [H : ∀ x : X.1, IsIso (f.stalkMap x)] : SheafedSpace.IsOpenImmersion f

{X Y : AlgebraicGeometry.SheafedSpace C}

[H : ∀ (x : ↑↑X.toPresheafedSpace), CategoryTheory.IsIso (AlgebraicGeometry.PresheafedSpace.Hom.stalkMap f x)]


/-- Alternative version of `List.prod_set` when the list is over a group -/
@[to_additive "Alternative version of `List.sum_set` when the list is over a group"]
theorem prod_set' (L : List G) (n : ℕ) (a : G) :
    (L.set n a).prod = L.prod * if hn : n < L.length then (L.get ⟨n, hn⟩)⁻¹ * a else 1

{G : Type u_7}
[AddCommGroup G]
(L : List G)
(n : ℕ)
(a : G)

(L.set n a).sum = L.sum + if hn : n < L.length then -L.get ⟨n, hn⟩ + a else 0


/-- So-named because the coercion is `Nat.cast` into `ZMod`. For `Nat.cast` into an arbitrary ring,
see `ZMod.natCast_val`. -/
theorem natCast_zmod_val {n : ℕ} [NeZero n] (a : ZMod n) : (a.val : ZMod n) = a


/-- The functor that exhibits `SimplexCategory` as skeleton
of `NonemptyFinLinOrd` -/
@[simps obj map]
def skeletalFunctor : SimplexCategory ⥤ NonemptyFinLinOrd

∀ {X Y : SimplexCategory} (f : X ⟶ Y), SimplexCategory.skeletalFunctor.map f = SimplexCategory.Hom.toOrderHom f


@[simp]
theorem range_orderEmbOfFin (s : Finset α) {k : ℕ} (h : s.card = k) :
    Set.range (s.orderEmbOfFin h) = s

{α : Type u_1}
[LinearOrder α]
(s : Finset α)
{k : ℕ}
(h : s.card = k)


protected theorem Colorable.cliqueFree {n m : ℕ} (hc : G.Colorable n) (hm : n < m) :
    G.CliqueFree m

{V : Type u}
{G : SimpleGraph V}
{n m : ℕ}
(hc : G.Colorable n)
(hm : n < m)


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

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


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

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

Filter.Tendsto (fun δ => (Metric.thickening δ E).mulIndicator f) (𝓝[>] 0) (𝓝 ((closure E).mulIndicator f))


@[simp]
theorem one_apply (x : A) : (1 : A →ₐc[R] A) x = x

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[CoalgebraStruct R A]
(x : A)


@[mono]
theorem Intersecting.mono (h : t ⊆ s) (hs : s.Intersecting) : t.Intersecting

{α : Type u_1}
[SemilatticeInf α]
[OrderBot α]
{s t : Set α}
(h : t ⊆ s)
(hs : s.Intersecting)


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

(CategoryTheory.MonoidalCategory.tensorObj X Y).rel =
  (CategoryTheory.Subobject.pullback
          (CategoryTheory.Limits.prod.map CategoryTheory.Limits.prod.fst CategoryTheory.Limits.prod.fst)).obj
      X.rel ⊓
    (CategoryTheory.Subobject.pullback
          (CategoryTheory.Limits.prod.map CategoryTheory.Limits.prod.snd CategoryTheory.Limits.prod.snd)).obj
      Y.rel


@[simp]
theorem castHom_apply {h : m ∣ n} (i : ZMod n) : castHom h R i = cast i

{n : ℕ}
{R : Type u_1}
[Ring R]
{m : ℕ}
[CharP R m]
{h : m ∣ n}
(i : ZMod n)


/-- Given an injective `CommMonoid` homomorphism `g : M →* P`, and a submonoid `S ⊆ M`,
the induced monoid homomorphism from the localization of `M` at `S` to the
localization of `P` at `g S`, is injective.
-/
@[to_additive "Given an injective `AddCommMonoid` homomorphism `g : M →+ P`, and a
submonoid `S ⊆ M`, the induced monoid homomorphism from the localization of `M` at `S`
to the localization of `P` at `g S`, is injective. "]
theorem map_injective_of_injective (hg : Injective g) (k : LocalizationMap (S.map g) Q) :
    Injective (map f (apply_coe_mem_map g S) k)

(k : (Submonoid.map g S).LocalizationMap Q)


theorem toNonUnitalSubalgebra_inj {S U : NonUnitalStarSubalgebra R A} :
    S.toNonUnitalSubalgebra = U.toNonUnitalSubalgebra ↔ S = U

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[Star A]
{S U : NonUnitalStarSubalgebra R A}


@[simp, norm_cast]
lemma coe_I : I = Complex.I


@[simp]
theorem lTensorOne_tmul (y : R) (n : N) : N.lTensorOne (algebraMap R _ y ⊗ₜ[R] n) = y • n

{R : Type u}
{S : Type v}
[CommSemiring R]
[Semiring S]
[Algebra R S]
{N : Submodule R S}
(y : R)
(n : ↥N)

N.lTensorOne ((algebraMap R ↥⊥) y ⊗ₜ[R] n) = y • n


theorem clear_ok {p k q s L₁ o L₂} {S : K' → List Γ'} (e : splitAtPred p (S k) = (L₁, o, L₂)) :
    Reaches₁ (TM2.step tr) ⟨some (Λ'.clear p k q), s, S⟩ ⟨some q, o, update S k L₂⟩

{S : Turing.PartrecToTM2.K' → List Turing.PartrecToTM2.Γ'}

(e : Turing.PartrecToTM2.splitAtPred p (S k) = (L₁, o, L₂))

Turing.Reaches₁ (Turing.TM2.step Turing.PartrecToTM2.tr)
  { l := some (Turing.PartrecToTM2.Λ'.clear p k q), var := s, stk := S }
  { l := some q, var := o, stk := Function.update S k L₂ }


/-- A groupoid is closed under restriction if it contains all restrictions of its element local
homeomorphisms to open subsets of the source. -/
class ClosedUnderRestriction (G : StructureGroupoid H) : Prop where
  closedUnderRestriction :
    ∀ {e : PartialHomeomorph H H}, e ∈ G → ∀ s : Set H, IsOpen s → e.restr s ∈ G

{H : Type u}
[TopologicalSpace H]
{G : StructureGroupoid H}
[self : ClosedUnderRestriction G]
{e : PartialHomeomorph H H}

e ∈ G → ∀ (s : Set H), IsOpen s → e.restr s ∈ G


/-- **Integration by parts**. Special case of
`intervalIntegrable.integral_mul_deriv_eq_deriv_mul_of_hasDeriv_right`
where the functions have a derivative also at the endpoints.
For improper integrals, see
`MeasureTheory.integral_mul_deriv_eq_deriv_mul`,
`MeasureTheory.integral_Ioi_mul_deriv_eq_deriv_mul`,
and `MeasureTheory.integral_Iic_mul_deriv_eq_deriv_mul`. -/
theorem integral_mul_deriv_eq_deriv_mul {u v u' v' : ℝ → A}
    (hu : ∀ x ∈ [[a, b]], HasDerivAt u (u' x) x)
    (hv : ∀ x ∈ [[a, b]], HasDerivAt v (v' x) x)
    (hu' : IntervalIntegrable u' volume a b)
    (hv' : IntervalIntegrable v' volume a b) :
    ∫ x in a..b, u x * v' x = u b * v b - u a * v a - ∫ x in a..b, u' x * v x

(hu' : IntervalIntegrable u' MeasureTheory.volume a b)

(hv' : IntervalIntegrable v' MeasureTheory.volume a b)

∫ (x : ℝ) in a..b, u x * v' x = u b * v b - u a * v a - ∫ (x : ℝ) in a..b, u' x * v x


theorem _root_.BoundedContinuousFunction.mkOfCompact_star [CompactSpace α] (f : C(α, β)) :
    mkOfCompact (star f) = star (mkOfCompact f)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[NormedAddCommGroup β]
[StarAddMonoid β]
[NormedStarGroup β]
[CompactSpace α]
(f : C(α, β))

BoundedContinuousFunction.mkOfCompact (star f) = star (BoundedContinuousFunction.mkOfCompact f)


theorem contMDiffWithinAt_insert_self :
    ContMDiffWithinAt I I' n f (insert x s) x ↔ ContMDiffWithinAt I I' n f 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']
{f : M → M'}
{s : Set M}
{x : M}
{n : ℕ∞}


@[simp]
theorem Iic_top : Iic (⊤ : α) = univ

{α : Type u_1}
[Preorder α]
[OrderTop α]


theorem tendsto_integral_norm_approxOn_sub [MeasurableSpace E] [BorelSpace E] {f : α → E}
    (fmeas : Measurable f) (hf : Integrable f μ) [SeparableSpace (range f ∪ {0} : Set E)] :
    Tendsto (fun n ↦ ∫ x, ‖SimpleFunc.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)


/-- `nnnorm` as a `MonoidWithZeroHom`. -/
@[simps]
def nnnormHom : α →*₀ ℝ≥0


theorem dslope_eventuallyEq_slope_punctured_nhds (f : 𝕜 → E) : dslope f a =ᶠ[𝓝[≠] a] slope f a

{𝕜 : Type u_1}
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{a : 𝕜}
(f : 𝕜 → E)


@[to_additive sub_nonneg_ae]
lemma one_le_div_ae {β : Type*} [Group β] [LE β]
    [CovariantClass β β (Function.swap (· * ·)) (· ≤ ·)] (f g : α → β) :
    1 ≤ᵐ[μ] g / f ↔ f ≤ᵐ[μ] g

[CovariantClass β β (Function.swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1]


@[to_additive] lemma mabs_of_lt_one (h : a < 1) : |a|ₘ = a⁻¹

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


@[simp]
lemma diff_v (p q : ℤ) (hpq : p + 1 = q) : (diff K).v p q hpq = K.d p q

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
(K : CochainComplex C ℤ)
(p q : ℤ)
(hpq : p + 1 = q)

(CochainComplex.HomComplex.Cochain.diff K).v p q hpq = K.d p q


nonrec theorem eq_bot_iff : N = ⊥ ↔ ∀ m : M, m ∈ N → m = 0

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


@[trans]
theorem lt_of_equiv_of_lt {x y z : PGame} (h₁ : x ≈ y) : y < z → x < z


@[ext]
theorem ext {f g : E →ₗ.[R] F} (h : f.domain = g.domain)
    (h' : ∀ ⦃x : f.domain⦄ ⦃y : g.domain⦄ (_h : (x : E) = y), f x = g y) : f = g

(h' : ∀ ⦃x : ↥f.domain⦄ ⦃y : ↥g.domain⦄, ↑x = ↑y → ↑f x = ↑g y)


@[to_additive]
theorem div_eq_div_iff_div_eq_div : a / b = c / d ↔ a / c = b / d

{G : Type u_3}
[AddCommGroup G]
{a b c d : G}


/-- Canonical homomorphism of monoids from `αˣ` into `α × αᵐᵒᵖ`.
Used mainly to define the natural topology of `αˣ`. -/
@[to_additive (attr := simps)
      "Canonical homomorphism of additive monoids from `AddUnits α` into `α × αᵃᵒᵖ`.
      Used mainly to define the natural topology of `AddUnits α`."]
def embedProduct (α : Type*) [Monoid α] : αˣ →* α × αᵐᵒᵖ

(Units.embedProduct α) x = (↑x, MulOpposite.op ↑x⁻¹)


@[simp] theorem freeOn_indep_iff : (freeOn E).Indep I ↔ I ⊆ E


theorem hnot_def [∀ i, HNot (π i)] (a : ∀ i, π i) : ￢a = fun i => ￢a i

{ι : Type u_1}
{π : ι → Type u_4}
[(i : ι) → HNot (π i)]
(a : (i : ι) → π i)


@[simp, norm_cast]
theorem coe_comp (f : Q →ᴬ[R] Q₂) (g : P →ᴬ[R] Q) :
    (f.comp g : P → Q₂) = (f : Q → Q₂) ∘ (g : P → Q)

{R : Type u_1}
{V : Type u_2}
{W : Type u_3}
{P : Type u_4}
{Q : Type u_5}
[Ring R]
[AddCommGroup V]
[Module R V]
[TopologicalSpace P]
[AddTorsor V P]
[AddCommGroup W]
[Module R W]
[TopologicalSpace Q]
[AddTorsor W Q]
{W₂ : Type u_6}
{Q₂ : Type u_7}
[AddCommGroup W₂]
[Module R W₂]
[TopologicalSpace Q₂]
[AddTorsor W₂ Q₂]
(f : Q →ᴬ[R] Q₂)
(g : P →ᴬ[R] Q)


@[to_additive (attr := simp)]
protected theorem div_eq_one' {r : R} (hr : r ∈ S) : r /ₒ ⟨r, hr⟩ = 1

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


lemma eq_one_of_mul_eq_one_left (H : m * n = 1) : n = 1


@[simp]
theorem val_inj {s t : Finset α} : s.1 = t.1 ↔ s = t


theorem pullback_id (x : Subobject X) : (pullback (𝟙 X)).obj x = x

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X : C}
[CategoryTheory.Limits.HasPullbacks C]
(x : CategoryTheory.Subobject X)

(CategoryTheory.Subobject.pullback (CategoryTheory.CategoryStruct.id X)).obj x = x


theorem Antiperiodic.const_sub [AddCommGroup α] [InvolutiveNeg β] (h : Antiperiodic f c) (a : α) :
    Antiperiodic (fun x => f (a - x)) c

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c : α}
[AddCommGroup α]
[InvolutiveNeg β]
(h : Function.Antiperiodic f c)
(a : α)

Function.Antiperiodic (fun x => f (a - x)) c


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

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

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


@[simp]
theorem cons_eq_cons {x₀ y₀ : α 0} {x y : ∀ i : Fin n, α i.succ} :
    cons x₀ x = cons y₀ y ↔ x₀ = y₀ ∧ x = y

{n : ℕ}
{α : Fin (n + 1) → Type u}
{x₀ y₀ : α 0}
{x y : (i : Fin n) → α i.succ}

Fin.cons x₀ x = Fin.cons y₀ y ↔ x₀ = y₀ ∧ x = y


@[simp]
theorem preimage_Ioi : ((↑) : ℤ → α) ⁻¹' Set.Ioi a = Set.Ioi ⌊a⌋

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


theorem cond_decide {α} (p : Prop) [Decidable p] (t e : α) :
    cond (decide p) t e = if p then t else e

{α : Type u_1}
(p : Prop)
[Decidable p]
(t e : α)

(bif decide p then t else e) = if p then t else e


theorem Ioc_subset_Ici_self : Ioc a b ⊆ Ici a

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


theorem hasDerivWithinAt_pi :
    HasDerivWithinAt φ φ' s x ↔ ∀ i, HasDerivWithinAt (fun x => φ x i) (φ' i) s x

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

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


@[reassoc (attr := simp)]
lemma isoOfQuasiIsoAt_hom_inv_id (f : K ⟶ L) (i : ι) [K.HasHomology i] [L.HasHomology i]
    [QuasiIsoAt f i] :
    homologyMap f i ≫ (isoOfQuasiIsoAt f i).inv = 𝟙 _

HomologicalComplex.homologyMap f i ≫ (isoOfQuasiIsoAt f i).inv = 𝟙 (K.homology i)


theorem mem_iff_getElem {a} {l : List α} : a ∈ l ↔ ∃ (n : Nat) (h : n < l.length), l[n]'h = a


theorem coe_span_eq_span_of_surjective (h : Function.Surjective (algebraMap R A)) (s : Set M) :
    (Submodule.span A s : Set M) = Submodule.span R s

(h : Function.Surjective ⇑(algebraMap R A))

↑(Submodule.span A s) = ↑(Submodule.span R s)


@[simp] lemma Scheme.restrictFunctor_map_left {U V : X.Opens} (i : U ⟶ V) :
  (X.restrictFunctor.map i).left = IsOpenImmersion.lift (V.ι) U.ι (by simpa using i.le)

{X : AlgebraicGeometry.Scheme}
{U V : X.Opens}
(i : U ⟶ V)

(X.restrictFunctor.map i).left = AlgebraicGeometry.IsOpenImmersion.lift V.ι U.ι ⋯


theorem of_nat_div (m : ℕ) (h : Irrational (m / x)) : Irrational x

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


@[to_additive]
lemma IsOfFinOrder.natCard_powers_le_orderOf (ha : IsOfFinOrder a) :
    Nat.card (powers a : Set G) ≤ orderOf a

{G : Type u_1}
[AddMonoid G]
{a : G}
(ha : IsOfFinAddOrder a)

Nat.card ↑↑(AddSubmonoid.multiples a) ≤ addOrderOf a


theorem ofArrows_bind {ι : Type*} (Z : ι → C) (g : ∀ i : ι, Z i ⟶ X)
    (j : ∀ ⦃Y⦄ (f : Y ⟶ X), ofArrows Z g f → Type*) (W : ∀ ⦃Y⦄ (f : Y ⟶ X) (H), j f H → C)
    (k : ∀ ⦃Y⦄ (f : Y ⟶ X) (H i), W f H i ⟶ Y) :
    ((ofArrows Z g).bind fun Y f H => ofArrows (W f H) (k f H)) =
      ofArrows (fun i : Σi, j _ (ofArrows.mk i) => W (g i.1) _ i.2) fun ij =>
        k (g ij.1) _ ij.2 ≫ g ij.1

(j : ⦃Y : C⦄ → (f : Y ⟶ X) → CategoryTheory.Presieve.ofArrows Z g f → Type u_2)

(W : ⦃Y : C⦄ → (f : Y ⟶ X) → (H : CategoryTheory.Presieve.ofArrows Z g f) → j f H → C)

(k : ⦃Y : C⦄ → (f : Y ⟶ X) → (H : CategoryTheory.Presieve.ofArrows Z g f) → (i : j f H) → W f H i ⟶ Y)

((CategoryTheory.Presieve.ofArrows Z g).bind fun Y f H => CategoryTheory.Presieve.ofArrows (W f H) (k f H)) =
  CategoryTheory.Presieve.ofArrows (fun i => W (g i.fst) ⋯ i.snd) fun ij =>
    CategoryTheory.CategoryStruct.comp (k (g ij.fst) ⋯ ij.snd) (g ij.fst)


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

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


@[simp, mfld_simps]
theorem coe_coe_fst (hb : b ∈ e'.baseSet) : (e' y).1 = b

[TopologicalSpace (Bundle.TotalSpace F E)]

(e' : Trivialization F Bundle.TotalSpace.proj)


/-- Natural identification to a `FiberBundleCore`. -/
@[simps (config := mfld_cfg)]
def toFiberBundleCore : FiberBundleCore ι B F

{R : Type u_1}
{B : Type u_2}
{F : Type u_3}
[NontriviallyNormedField R]
[NormedAddCommGroup F]
[NormedSpace R F]
[TopologicalSpace B]
{ι : Type u_5}
(Z : VectorBundleCore R B F ι)


@[simp]
theorem run_monadMap {n} [MonadFunctorT n m] (f : ∀ {α}, n α → n α) :
    (monadMap (@f) x : ExceptT ε m α).run = monadMap (@f) x.run

{α ε : Type u}
{m : Type u → Type v}
(x : ExceptT ε m α)
{n : Type u → Type u_1}
[MonadFunctorT n m]
(f : {α : Type u} → n α → n α)


theorem colimit.pre_map [HasColimitsOfShape K C] (E : K ⥤ J) :
    colimit.pre F E ≫ colim.map α = colim.map (whiskerLeft E α) ≫ colimit.pre G E

CategoryTheory.Limits.colimit.pre F E ≫ CategoryTheory.Limits.colim.map α =
  CategoryTheory.Limits.colim.map (CategoryTheory.whiskerLeft E α) ≫ CategoryTheory.Limits.colimit.pre G E


theorem add_apply {_m : MeasurableSpace α} (μ₁ μ₂ : Measure α) (s : Set α) :
    (μ₁ + μ₂) s = μ₁ s + μ₂ s

{α : Type u_1}
{_m : MeasurableSpace α}
(μ₁ μ₂ : MeasureTheory.Measure α)
(s : Set α)

(μ₁ + μ₂) s = μ₁ s + μ₂ s


@[simp]
theorem floor_add_one (a : α) : ⌊a + 1⌋ = ⌊a⌋ + 1

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


@[simp]
lemma coe_units_smul (z : Cocycle F G n) (x : Rˣ) :
    (↑(x • z) : Cochain F G n) = x • (z : Cochain F G n)

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


@[simp]
lemma d_comp_ofHom_v (φ : F ⟶ G) (p' p q : ℤ) (hpq : p + 0 = q) :
    F.d p' p ≫ (ofHom φ).v p q hpq = F.d p' q ≫ φ.f q

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{F G : CochainComplex C ℤ}
(φ : F ⟶ G)
(p' p q : ℤ)
(hpq : p + 0 = q)

F.d p' p ≫ (CochainComplex.HomComplex.Cochain.ofHom φ).v p q hpq = F.d p' q ≫ φ.f q


@[reassoc (attr := simp)]
theorem PInfty_comp_PInftyToNormalizedMooreComplex (X : SimplicialObject A) :
    PInfty ≫ PInftyToNormalizedMooreComplex X = PInftyToNormalizedMooreComplex X

{A : Type u_1}
[CategoryTheory.Category.{u_2, u_1} A]
[CategoryTheory.Abelian A]
(X : CategoryTheory.SimplicialObject A)

AlgebraicTopology.DoldKan.PInfty ≫ AlgebraicTopology.DoldKan.PInftyToNormalizedMooreComplex X =
  AlgebraicTopology.DoldKan.PInftyToNormalizedMooreComplex X


/-- Given two classes of morphisms `W₁` and `W₂` on a category `C`, this is
the data of the factorization of a morphism `f : X ⟶ Y` as `i ≫ p` with
`W₁ i` and `W₂ p`. -/
structure MapFactorizationData {X Y : C} (f : X ⟶ Y) where
  /-- the intermediate object in the factorization -/
  Z : C
  /-- the first morphism in the factorization -/
  i : X ⟶ Z
  /-- the second morphism in the factorization -/
  p : Z ⟶ Y
  fac : i ≫ p = f := by aesop_cat
  hi : W₁ i
  hp : W₂ p

{W₁ W₂ : CategoryTheory.MorphismProperty C}

CategoryTheory.CategoryStruct.comp self.i self.p = f


/-- The closed thickening `Metric.cthickening δ E` of a fixed subset `E` is an increasing function
of the thickening radius `δ`. -/
theorem cthickening_mono {δ₁ δ₂ : ℝ} (hle : δ₁ ≤ δ₂) (E : Set α) :
    cthickening δ₁ E ⊆ cthickening δ₂ E

{α : Type u}
[PseudoEMetricSpace α]
{δ₁ δ₂ : ℝ}
(hle : δ₁ ≤ δ₂)
(E : Set α)

Metric.cthickening δ₁ E ⊆ Metric.cthickening δ₂ E


protected theorem mul_right_cancel_iff' {a b c m : ℕ} (hc : c ≠ 0) :
    a * c ≡ b * c [MOD m * c] ↔ a ≡ b [MOD m]


@[simp]
theorem comp_coeff (g : Γ' ×ₗ Γ) :
    (comp A B).coeff g = A.coeff (ofLex g).2 ∘ₗ B.coeff (ofLex g).1

{Γ : Type u_5}
{Γ' : Type u_6}
[OrderedCancelAddCommMonoid Γ]
[OrderedCancelAddCommMonoid Γ']
{R : Type u_7}
[CommRing R]
{U : Type u_8}
{V : Type u_9}
{W : Type u_10}
[AddCommGroup U]
[Module R U]
[AddCommGroup V]
[Module R V]
[AddCommGroup W]
[Module R W]
(A : HVertexOperator Γ R V W)
(B : HVertexOperator Γ' R U V)
(g : Lex (Γ' × Γ))

(A.comp B).coeff g = A.coeff (ofLex g).2 ∘ₗ B.coeff (ofLex g).1


/-- Universe lift functor for groups. -/
@[to_additive (attr := simps)
  "Universe lift functor for additive groups."]
def uliftFunctor : Grp.{u} ⥤ Grp.{max u v}

Grp.uliftFunctor.obj X = Grp.of (ULift.{v, u} ↑X)


/-- To show that a Lindelöf set intersects the intersection of a family of closed sets,
  it is sufficient to show that it intersects every countable subfamily. -/
theorem IsLindelof.inter_iInter_nonempty {ι : Type v} (hs : IsLindelof s) (t : ι → Set X)
    (htc : ∀ i, IsClosed (t i)) (hst : ∀ u : Set ι, u.Countable ∧ (s ∩ ⋂ i ∈ u, t i).Nonempty) :
    (s ∩ ⋂ i, t i).Nonempty

(hst : ∀ (u : Set ι), u.Countable ∧ (s ∩ ⋂ i ∈ u, t i).Nonempty)


theorem incidenceSet_inter_incidenceSet_of_adj (h : G.Adj a b) :
    G.incidenceSet a ∩ G.incidenceSet b = {s(a, b)}

{V : Type u}
(G : SimpleGraph V)
{a b : V}
(h : G.Adj a b)


theorem isUnit (h : IsPrimitiveRoot ζ k) (h0 : 0 < k) : IsUnit ζ

{M : Type u_1}
[CommMonoid M]
{k : ℕ}
{ζ : M}
(h : IsPrimitiveRoot ζ k)
(h0 : 0 < k)


/-- Whisker a cone by precomposition of a functor. -/
@[simps]
def whisker (E : K ⥤ J) (c : Cone F) : Cone (E ⋙ F)

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

(CategoryTheory.Limits.Cone.whisker E c).pt = c.pt


@[simp]
theorem kroneckerMap_zero_right [Zero β] [Zero γ] (f : α → β → γ) (hf : ∀ a, f a 0 = 0)
    (A : Matrix l m α) : kroneckerMap f A (0 : Matrix n p β) = 0

{α : Type u_2}
{β : Type u_4}
{γ : Type u_6}
{l : Type u_8}
{m : Type u_9}
{n : Type u_10}
{p : Type u_11}
[Zero β]
[Zero γ]
(f : α → β → γ)
(hf : ∀ (a : α), f a 0 = 0)
(A : Matrix l m α)


lemma integral_eq_iff_of_ae_le {f g : α → ℝ}
    (hf : Integrable f μ) (hg : Integrable g μ) (hfg : f ≤ᵐ[μ] g) :
    ∫ a, f a ∂μ = ∫ a, g a ∂μ ↔ f =ᵐ[μ] g

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : α → ℝ}
(hf : MeasureTheory.Integrable f μ)
(hg : MeasureTheory.Integrable g μ)
(hfg : f ≤ᵐ[μ] g)

∫ (a : α), f a ∂μ = ∫ (a : α), g a ∂μ ↔ f =ᵐ[μ] g


@[to_additive]
theorem multipliable_iff_of_multipliable_div (hfg : Multipliable fun b ↦ f b / g b) :
    Multipliable f ↔ Multipliable g

{α : Type u_1}
{β : Type u_2}
[CommGroup α]
[TopologicalSpace α]
[TopologicalGroup α]
{f g : β → α}
(hfg : Multipliable fun b => f b / g b)


/-- If the identity arrow is in a sieve, the sieve is maximal. -/
theorem id_mem_iff_eq_top : S (𝟙 X) ↔ S = ⊤

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X : C}
{S : CategoryTheory.Sieve X}

S.arrows (CategoryTheory.CategoryStruct.id X) ↔ S = ⊤


theorem hasFPowerSeriesAt_iff' :
    HasFPowerSeriesAt f p z₀ ↔ ∀ᶠ z in 𝓝 z₀, HasSum (fun n => (z - z₀) ^ n • p.coeff n) (f z)

{𝕜 : Type u_1}
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{p : FormalMultilinearSeries 𝕜 𝕜 E}
{f : 𝕜 → E}
{z₀ : 𝕜}

HasFPowerSeriesAt f p z₀ ↔ ∀ᶠ (z : 𝕜) in 𝓝 z₀, HasSum (fun n => (z - z₀) ^ n • p.coeff n) (f z)


@[to_additive (attr := simp 1100, norm_cast)]
theorem val_multiset_prod {G} [CommGroup G] (H : Subgroup G) (m : Multiset H) :
    (m.prod : G) = (m.map Subtype.val).prod

{G : Type u_3}
[CommGroup G]
(H : Subgroup G)
(m : Multiset ↥H)

↑m.prod = (Multiset.map Subtype.val m).prod


theorem aemeasurable_of_aemeasurable_trim {α} {m m0 : MeasurableSpace α} {μ : Measure α}
    (hm : m ≤ m0) {f : α → β} (hf : AEMeasurable f (μ.trim hm)) : AEMeasurable f μ

{β : Type u_3}
[MeasurableSpace β]
{α : Type u_7}
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(hm : m ≤ m0)
{f : α → β}
(hf : AEMeasurable f (μ.trim hm))


@[simp]
theorem mk'_X_0 : (mk' X₀ X₁ d₀ succ').X 0 = X₀

(succ' : {X₀ X₁ : V} → (f : X₁ ⟶ X₀) → (X₂ : V) ×' (d : X₂ ⟶ X₁) ×' d ≫ f = 0)

(ChainComplex.mk' X₀ X₁ d₀ fun {X₀ X₁} => succ').X 0 = X₀


@[simp]
theorem quotDualCoannihilatorToDual_apply (W : Submodule R (Dual R M)) (m : M) (w : W) :
    W.quotDualCoannihilatorToDual (Quotient.mk m) w = w.1 m

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(W : Submodule R (Module.Dual R M))
(m : M)
(w : ↥W)

(W.quotDualCoannihilatorToDual (Submodule.Quotient.mk m)) w = ↑w m


theorem nhds_translation_mul_inv₀ (ha : a ≠ 0) : comap (· * a⁻¹) (𝓝 1) = 𝓝 a

{G₀ : Type u_3}
[TopologicalSpace G₀]
[GroupWithZero G₀]
[ContinuousMul G₀]
{a : G₀}
(ha : a ≠ 0)

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


@[to_additive]
theorem upperClosure_mul : ↑(upperClosure s) * t = upperClosure (s * t)

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

↑(upperClosure s) + t = ↑(upperClosure (s + t))


@[simp]
theorem card_range (n : ℕ) : card (range n) = n


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

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


theorem rid_eq_rid : AlgebraTensorModule.rid R R M = TensorProduct.rid R M

(R : Type uR)
(M : Type uM)
[CommSemiring R]
[AddCommMonoid M]
[Module R M]

TensorProduct.AlgebraTensorModule.rid R R M = TensorProduct.rid R M


theorem fold_max_add [Add β] [CovariantClass β β (Function.swap (· + ·)) (· ≤ ·)] (n : WithBot β)
    (s : Finset α) : (s.fold max ⊥ fun x : α => ↑(f x) + n) = s.fold max ⊥ ((↑) ∘ f) + n

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

Finset.fold max ⊥ (fun x => ↑(f x) + n) s = Finset.fold max ⊥ (WithBot.some ∘ f) s + n


/-- `OrderDual` as a functor. -/
@[simps]
def dual : BddLat ⥤ BddLat

BddLat.dual.obj X = BddLat.of (↑X.toLat)ᵒᵈ


@[simp] lemma left_mem_uIcc : a ∈ [[a, b]]


@[to_additive]
theorem sum_restrict (h : IsFundamentalDomain G s μ) : (sum fun g : G => μ.restrict (g • s)) = μ

[MeasureTheory.VAddInvariantMeasure G α μ]

(h : MeasureTheory.IsAddFundamentalDomain G s μ)

(MeasureTheory.Measure.sum fun g => μ.restrict (g +ᵥ s)) = μ


@[simp]
theorem coe_positive : ↑(positive 𝕜 E) = ConvexCone.positive 𝕜 E

(𝕜 : Type u_2)
(E : Type u_1)
[OrderedSemiring 𝕜]
[OrderedAddCommGroup E]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
[TopologicalSpace E]
[OrderClosedTopology E]

↑↑(ProperCone.positive 𝕜 E) = ConvexCone.positive 𝕜 E


theorem le_inf' {a : α} (hs : ∀ b ∈ s, a ≤ f b) : a ≤ s.inf' H f

{α : Type u_2}
{β : Type u_3}
[SemilatticeInf α]
{s : Finset β}
(H : s.Nonempty)
(f : β → α)
{a : α}
(hs : ∀ b ∈ s, a ≤ f b)


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

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

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

∀ (a : ι₂ × ι₁ →₀ R),
  (b₁.linearMap b₂).repr.symm a =
    (Matrix.toLin b₁ b₂) ((Finsupp.total (ι₂ × ι₁) (Matrix ι₂ ι₁ R) R ⇑(Matrix.stdBasis R ι₂ ι₁)) a)


theorem card_range {α β F : Type*} [FunLike F α β] [EmbeddingLike F α β] (f : F) [Fintype α]
    [Fintype (Set.range f)] : Fintype.card (Set.range f) = Fintype.card α

{α : Type u_4}
{β : Type u_5}
{F : Type u_6}
[FunLike F α β]
[EmbeddingLike F α β]
(f : F)
[Fintype α]
[Fintype ↑(Set.range ⇑f)]

Fintype.card ↑(Set.range ⇑f) = Fintype.card α


theorem map_le_iff (f : α → β) (mono_iff : ∀ {a b}, f a ≤ f b ↔ a ≤ b) :
    ∀ a b : WithBot α, a.map f ≤ b.map f ↔ a ≤ b

(mono_iff : ∀ {a b : α}, f a ≤ f b ↔ a ≤ b)

WithBot.map f a ≤ WithBot.map f b ↔ a ≤ b


theorem moebius_sq {n : ℕ} :
    μ n ^ 2 = if Squarefree n then 1 else 0

ArithmeticFunction.moebius n ^ 2 = if Squarefree n then 1 else 0


lemma mem_primeFactors_iff_mem_primeFactorsList : p ∈ n.primeFactors ↔ p ∈ n.primeFactorsList


theorem Ne.ne_or_ne {x y : α} (z : α) (h : x ≠ y) : x ≠ z ∨ y ≠ z

{α : Sort u_1}
{x y : α}
(z : α)
(h : x ≠ y)


theorem mk_bijective : Function.Bijective (@ConjClasses.mk α _)


@[simp]
theorem unop_bot : (⊥ : Subsemiring Rᵐᵒᵖ).unop = ⊥


/-- Composition by a bijective function on the left is itself bijective. -/
theorem Bijective.comp_left {g : β → γ} (hg : Bijective g) :
    Bijective (g ∘ · : (α → β) → α → γ)

{α : Sort u}
{β : Sort v}
{γ : Sort w}
{g : β → γ}
(hg : Function.Bijective g)


theorem modEq_zero_iff_dvd : a ≡ 0 [MOD n] ↔ n ∣ a


@[to_additive Ioi_add_Ici_subset]
theorem Ioi_mul_Ici_subset' (a b : α) : Ioi a * Ici b ⊆ Ioi (a * b)

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

[CovariantClass α α (Function.swap HMul.hMul) LT.lt]


theorem frequently_sup {p : α → Prop} {f g : Filter α} :
    (∃ᶠ x in f ⊔ g, p x) ↔ (∃ᶠ x in f, p x) ∨ ∃ᶠ x in g, p x

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

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


theorem mul_lt_of_lt_div {a b r : ℝ≥0} (h : a < b / r) : a * r < b


@[simp] theorem nil_subset (l : List α) : [] ⊆ l


theorem Continuous.connectedComponentsLift_unique (h : Continuous f) (g : ConnectedComponents α → β)
    (hg : g ∘ (↑) = f) : g = h.connectedComponentsLift

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
[TotallyDisconnectedSpace β]
{f : α → β}
(h : Continuous f)
(g : ConnectedComponents α → β)
(hg : g ∘ ConnectedComponents.mk = f)


theorem biInter_le_succ (u : ℕ → Set α) (n : ℕ) : ⋂ k ≤ n + 1, u k = (⋂ k ≤ n, u k) ∩ u (n + 1)


theorem map_encode_iff {f : α →. σ} : (Partrec fun a => (f a).map encode) ↔ Partrec f

{α : Type u_1}
{σ : Type u_4}
[Primcodable α]
[Primcodable σ]
{f : α →. σ}

(Partrec fun a => Part.map Encodable.encode (f a)) ↔ Partrec f


/-- For elements `a` and `b` of a linear order, either `min a b = a` and `a ≤ b`,
    or `min a b = b` and `b < a`.
    Use cases on this lemma to automate linarith in inequalities -/
theorem min_cases (a b : α) : min a b = a ∧ a ≤ b ∨ min a b = b ∧ b < a


/-- There is a character of order `n` on `F` if `#F ≡ 1 mod n` and the target contains
a primitive `n`th root of unity. -/
lemma exists_mulChar_orderOf {n : ℕ} (h : n ∣ Fintype.card F - 1) {ζ : R}
    (hζ : IsPrimitiveRoot ζ n) :
    ∃ χ : MulChar F R, orderOf χ = n

(F : Type u_1)
[Field F]
[Fintype F]
{R : Type u_2}
[CommRing R]
{n : ℕ}
(h : n ∣ Fintype.card F - 1)
{ζ : R}
(hζ : IsPrimitiveRoot ζ n)


@[simp]
theorem map_algebraMap : D (algebraMap R A r) = 0

{R : Type u_1}
{A : Type u_2}
{M : Type u_4}
[CommSemiring R]
[CommSemiring A]
[AddCommMonoid M]
[Algebra R A]
[Module A M]
[Module R M]
(D : Derivation R A M)
(r : R)


@[simp]
theorem norm_restrictScalars (f : E →L[𝕜] Fₗ) : ‖f.restrictScalars 𝕜'‖ = ‖f‖

{𝕜 : Type u_1}
{E : Type u_4}
{Fₗ : Type u_7}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup Fₗ]
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 Fₗ]
{𝕜' : Type u_11}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜' 𝕜]
[NormedSpace 𝕜' E]
[IsScalarTower 𝕜' 𝕜 E]
[NormedSpace 𝕜' Fₗ]
[IsScalarTower 𝕜' 𝕜 Fₗ]
(f : E →L[𝕜] Fₗ)

‖ContinuousLinearMap.restrictScalars 𝕜' f‖ = ‖f‖


theorem map_set_pairwise {f : α → β} {r : β → β → Prop} {m : Multiset α}
    (h : { a | a ∈ m }.Pairwise fun a₁ a₂ => r (f a₁) (f a₂)) : { b | b ∈ m.map f }.Pairwise r

(h : {a | a ∈ m}.Pairwise fun a₁ a₂ => r (f a₁) (f a₂))


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

(a * b).imJ = a.re * b.imJ + c₁ * a.imI * b.imK + a.imJ * b.re - c₁ * a.imK * b.imI


@[reassoc]
theorem associator_naturality_left {f f' : a ⟶ b} (η : f ⟶ f') (g : b ⟶ c) (h : c ⟶ d) :
    η ▷ g ▷ h ≫ (α_ f' g h).hom = (α_ f g h).hom ≫ η ▷ (g ≫ h)

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

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerRight (CategoryTheory.Bicategory.whiskerRight η g) h)
    (CategoryTheory.Bicategory.associator f' g h).hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.associator f g h).hom
    (CategoryTheory.Bicategory.whiskerRight η (CategoryTheory.CategoryStruct.comp g h))


@[to_additive (attr := simp)]
theorem comap_id (K : Subgroup N) : K.comap (MonoidHom.id _) = K

{N : Type u_5}
[Group N]
(K : Subgroup N)


theorem vadd_eq_self_of_mem_zmultiples {α G : Type*} [AddGroup G] [AddAction G α] {x y : G}
    (hx : x ∈ AddSubgroup.zmultiples y) {a : α} (hs : y +ᵥ a = a) : x +ᵥ a = a

{α : Type u_6}
{G : Type u_7}
[AddGroup G]
[AddAction G α]
{x y : G}
(hx : x ∈ AddSubgroup.zmultiples y)
{a : α}
(hs : y +ᵥ a = a)


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

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


theorem aemeasurable_restrict_of_monotoneOn [LinearOrder β] [OrderClosedTopology β] {μ : Measure β}
    {s : Set β} (hs : MeasurableSet s) {f : β → α} (hf : MonotoneOn f s) :
    AEMeasurable f (μ.restrict s)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[MeasurableSpace α]
[BorelSpace α]
[TopologicalSpace β]
[MeasurableSpace β]
[BorelSpace β]
[LinearOrder α]
[OrderTopology α]
[SecondCountableTopology α]
[LinearOrder β]
[OrderClosedTopology β]
{μ : MeasureTheory.Measure β}
{s : Set β}
(hs : MeasurableSet s)
{f : β → α}
(hf : MonotoneOn f s)


/-- This is [grinberg_clifford_2016][] Theorem 8 -/
theorem contractLeft_comm (x : CliffordAlgebra Q) : d⌋(d'⌋x) = -(d'⌋(d⌋x))

{R : Type u1}
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}
(d d' : Module.Dual R M)
(x : CliffordAlgebra Q)

(CliffordAlgebra.contractLeft d) ((CliffordAlgebra.contractLeft d') x) =
  -(CliffordAlgebra.contractLeft d') ((CliffordAlgebra.contractLeft d) x)


@[to_additive]
lemma le_minOrder_iff_forall_subgroup {n : ℕ∞} :
    n ≤ minOrder α ↔ ∀ ⦃s : Subgroup α⦄, s ≠ ⊥ → (s : Set α).Finite → n ≤ Nat.card s

n ≤ AddMonoid.minOrder α ↔ ∀ ⦃s : AddSubgroup α⦄, s ≠ ⊥ → (↑s).Finite → n ≤ ↑(Nat.card ↥s)


/-- To show a category is an `InitialMonoClass` it suffices to show the unique morphism from the
initial object to a terminal object is a monomorphism. -/
theorem InitialMonoClass.of_terminal [HasInitial C] [HasTerminal C] (h : Mono (initial.to (⊤_ C))) :
    InitialMonoClass C

(h : CategoryTheory.Mono (CategoryTheory.Limits.initial.to (⊤_ C)))


/-- A Lie subalgebra is an ideal of its normalizer. -/
theorem ideal_in_normalizer {x y : L} (hx : x ∈ H.normalizer) (hy : y ∈ H) : ⁅x, y⁆ ∈ H

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{H : LieSubalgebra R L}
{x y : L}
(hx : x ∈ H.normalizer)
(hy : y ∈ H)


theorem cons_injective2 : Function.Injective2 (cons : α → Seq α → Seq α)


theorem deriv_mul_eq_opow_omega_mul {a : Ordinal.{u}} (ha : 0 < a) (b) :
    deriv (a * ·) b = (a^omega) * b

{a : Ordinal.{u}}
(ha : 0 < a)
(b : Ordinal.{u})

Ordinal.deriv (fun x => a * x) b = a ^ Ordinal.omega * b


/-- If `s` is a convex set, then `a • interior s + b • closure s ⊆ interior s` for all `0 < a`,
`0 ≤ b`, `a + b = 1`. See also `Convex.combo_interior_self_subset_interior` for a weaker version. -/
theorem Convex.combo_interior_closure_subset_interior {s : Set E} (hs : Convex 𝕜 s) {a b : 𝕜}
    (ha : 0 < a) (hb : 0 ≤ b) (hab : a + b = 1) : a • interior s + b • closure s ⊆ interior s

{𝕜 : Type u_2}
{E : Type u_3}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
{s : Set E}
(hs : Convex 𝕜 s)
{a b : 𝕜}
(ha : 0 < a)
(hb : 0 ≤ b)
(hab : a + b = 1)


theorem support_append {u v w : V} (p : G.Walk u v) (p' : G.Walk v w) :
    (p.append p').support = p.support ++ p'.support.tail

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


theorem NFBelow.snd {e n a b} (h : NFBelow (ONote.oadd e n a) b) : NFBelow a (repr e)

{e : ONote}
{n : ℕ+}
{a : ONote}
{b : Ordinal.{0}}
(h : (e.oadd n a).NFBelow b)


theorem eq_tsub_iff_add_eq_of_le (h : c ≤ b) : a = b - c ↔ a + 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 trunc_trunc_of_le {n m} (f : R⟦X⟧) (hnm : n ≤ m := by rfl) :
    trunc n ↑(trunc m f) = trunc n f

{R : Type u_2}
[CommSemiring R]
{n m : ℕ}
(f : PowerSeries R)
(hnm : n ≤ m := by rfl)

PowerSeries.trunc n ↑(PowerSeries.trunc m f) = PowerSeries.trunc n f


@[simp]
theorem congr_symm (e : G ≃* H) (he : G'.map ↑e = H') :
    (congr G' H' e he).symm = congr H' G' e.symm ((Subgroup.map_symm_eq_iff_map_eq _).mpr he)

{G : Type u}
[Group G]
{H : Type v}
[Group H]
(G' : Subgroup G)
(H' : Subgroup H)
[G'.Normal]
[H'.Normal]
(e : G ≃* H)
(he : Subgroup.map (↑e) G' = H')

(QuotientGroup.congr G' H' e he).symm = QuotientGroup.congr H' G' e.symm ⋯


lemma Reachable.exists_path_of_dist (hr : G.Reachable u v) :
    ∃ (p : G.Walk u v), p.IsPath ∧ p.length = G.dist u v

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


/-- A lower adjoint of `u` on the preorder `α` is a function `l` such that `l` and `u` form a Galois
connection. It allows us to define closure operators whose output does not match the input. In
practice, `u` is often `(↑) : β → α`. -/
structure LowerAdjoint [Preorder α] [Preorder β] (u : β → α) where
  /-- The underlying function -/
  toFun : α → β
  /-- The underlying function is a lower adjoint. -/
  gc' : GaloisConnection toFun u

{α : Type u_1}
{β : Type u_4}
[Preorder α]
[Preorder β]
{u : β → α}
(self : LowerAdjoint u)


theorem continuous_of_continuous_comp {q : SeminormFamily 𝕝₂ F ι'} [TopologicalSpace E]
    [TopologicalAddGroup E] [TopologicalSpace F] (hq : WithSeminorms q)
    (f : E →ₛₗ[τ₁₂] F) (hf : ∀ i, Continuous ((q i).comp f)) : Continuous f

{τ₁₂ : 𝕝 →+* 𝕝₂}

(hf : ∀ (i : ι'), Continuous ⇑((q i).comp f))


theorem tendsto_coe_infty : Tendsto (↑) (coclosedCompact X) (𝓝 (∞ : OnePoint X))

Filter.Tendsto OnePoint.some (Filter.coclosedCompact X) (𝓝 OnePoint.infty)


@[simp]
theorem Matrix.toLin_toMatrix (f : M₁ →ₗ[R] M₂) :
    Matrix.toLin v₁ v₂ (LinearMap.toMatrix v₁ v₂ f) = f

{R : Type u_1}
[CommSemiring R]
{m : Type u_3}
{n : Type u_4}
[Fintype n]
[Finite m]
[DecidableEq n]
{M₁ : Type u_5}
{M₂ : Type u_6}
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[Module R M₁]
[Module R M₂]
(v₁ : Basis n R M₁)
(v₂ : Basis m R M₂)
(f : M₁ →ₗ[R] M₂)

(Matrix.toLin v₁ v₂) ((LinearMap.toMatrix v₁ v₂) f) = f


lemma mul_scaleRoots_of_noZeroDivisors (p q : R[X]) (r : R) [NoZeroDivisors R] :
    (p * q).scaleRoots r = p.scaleRoots r * q.scaleRoots r

{R : Type u_1}
[CommSemiring R]
(p q : Polynomial R)
(r : R)
[NoZeroDivisors R]


/-- Given a cone over `F ⋙ G`, we can construct a `Cone G` with the same cocone point.
-/
@[simps]
def extendCone : Cone (F ⋙ G) ⥤ Cone G

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

∀ {X Y : CategoryTheory.Limits.Cone (F.comp G)} (f : X ⟶ Y),
  (CategoryTheory.Functor.Initial.extendCone.map f).hom = f.hom


/-- Composing on the right by a function preserves uniform Cauchy sequences -/
theorem UniformCauchySeqOnFilter.comp {γ : Type*} (hf : UniformCauchySeqOnFilter F p p')
    (g : γ → α) : UniformCauchySeqOnFilter (fun n => F n ∘ g) p (p'.comap g)

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{p : Filter ι}
{p' : Filter α}
{γ : Type u_1}
(hf : UniformCauchySeqOnFilter F p p')
(g : γ → α)

UniformCauchySeqOnFilter (fun n => F n ∘ g) p (Filter.comap g p')


@[simp]
theorem mk_fst {W : C} (fst : W ⟶ X) (snd : W ⟶ Y) (eq : fst ≫ f = snd ≫ g) :
    (mk fst snd eq).fst = fst

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X Y Z : C}
{f : X ⟶ Z}
{g : Y ⟶ Z}
{W : C}
(fst : W ⟶ X)
(snd : W ⟶ Y)
(eq : fst ≫ f = snd ≫ g)

(CategoryTheory.Limits.PullbackCone.mk fst snd eq).fst = fst


@[simp]
theorem coe_trans (e : α ≃o β) (e' : β ≃o γ) : ⇑(e.trans e') = e' ∘ e

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[LE α]
[LE β]
[LE γ]
(e : α ≃o β)
(e' : β ≃o γ)


theorem mul (hφ : IsSymmetric φ) (hψ : IsSymmetric ψ) : IsSymmetric (φ * ψ)

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
{φ ψ : MvPolynomial σ R}
(hφ : φ.IsSymmetric)
(hψ : ψ.IsSymmetric)


@[simp]
theorem blockDiag_sub [AddGroup α] (M N : Matrix (m × o) (n × o) α) :
    blockDiag (M - N) = blockDiag M - blockDiag N

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type u_12}
[AddGroup α]
(M N : Matrix (m × o) (n × o) α)

(M - N).blockDiag = M.blockDiag - N.blockDiag


theorem det_isEmpty [IsEmpty n] {A : Matrix n n R} : det A = 1

{n : Type u_2}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
[IsEmpty n]
{A : Matrix n n R}


lemma subst_into_negg {α} [AddCommGroup α] (a ta t : α)
    (pra : a = ta) (prt : -ta = t) : -a = t

{α : Type u_1}
[AddCommGroup α]
(a ta t : α)
(pra : a = ta)
(prt : -ta = t)


@[gcongr]
protected theorem add_right (c : ℕ) (h : a ≡ b [MOD n]) : a + c ≡ b + c [MOD n]


/-- The range of sequentially continuous function on a sequentially compact space is sequentially
compact. -/
theorem IsSeqCompact.range [SeqCompactSpace X] (f_cont : SeqContinuous f) :
    IsSeqCompact (Set.range f)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
[SeqCompactSpace X]
(f_cont : SeqContinuous f)


theorem ne_implies_bit_diff {x y : Nat} (p : x ≠ y) : ∃ i, testBit x i ≠ testBit y i


theorem hσ'_eq {q n a m : ℕ} (ha : n = a + q) (hnm : c.Rel m n) :
    (hσ' q n m hnm : X _[n] ⟶ X _[m]) =
      ((-1 : ℤ) ^ a • X.σ ⟨a, Nat.lt_succ_iff.mpr (Nat.le.intro (Eq.symm ha))⟩) ≫
        eqToHom (by congr)

(hnm : AlgebraicTopology.DoldKan.c.Rel m n)

AlgebraicTopology.DoldKan.hσ' q n m hnm = ((-1) ^ a • X.σ ⟨a, ⋯⟩) ≫ CategoryTheory.eqToHom ⋯


/-- A seminormed group is an additive group endowed with a norm for which `dist x y = ‖x - y‖`
defines a pseudometric space structure. -/
class SeminormedAddGroup (E : Type*) extends Norm E, AddGroup E, PseudoMetricSpace E where
  dist := fun x y => ‖x - y‖
  /-- The distance function is induced by the norm. -/
  dist_eq : ∀ x y, dist x y = ‖x - y‖ := by aesop

{E : Type u_9}
[self : SeminormedAddGroup E]
(x y : E)


theorem ext' {Y : Type*} [TopologicalSpace Y] [T2Space Y] {f g : Completion α → Y}
    (hf : Continuous f) (hg : Continuous g) (h : ∀ a : α, f a = g a) (a : Completion α) :
    f a = g a

{α : Type u_1}
[UniformSpace α]
{Y : Type u_4}
[TopologicalSpace Y]
[T2Space Y]
{f g : UniformSpace.Completion α → Y}
(hf : Continuous f)
(hg : Continuous g)
(h : ∀ (a : α), f (↑α a) = g (↑α a))
(a : UniformSpace.Completion α)


@[to_additive]
lemma unit_mem_of_mem_ofUnits (S : Subgroup Mˣ) {x : M} {h₁ : IsUnit x}
    (h₂ : x ∈ S.ofUnits) : h₁.unit ∈ S

{M : Type u_1}
[AddMonoid M]
(S : AddSubgroup (AddUnits M))
{x : M}
{h₁ : IsAddUnit x}
(h₂ : x ∈ S.ofAddUnits)


@[simp] theorem zip_nil_left : zip ([] : List α) (l : List β)  = []


theorem uniqueProd_apply [Unique β] (x : β × α) : uniqueProd α β x = x.2

{β : Type u_1}
{α : Type u_2}
[Unique β]
(x : β × α)


@[simp 1100]
theorem mem_map_equiv {f : α ≃ β} {b : β} : b ∈ s.map f.toEmbedding ↔ f.symm b ∈ s

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{f : α ≃ β}
{b : β}

b ∈ Finset.map f.toEmbedding s ↔ f.symm b ∈ s


lemma nndist_le_pi_nndist (f g : ∀ b, π b) (b : β) : nndist (f b) (g b) ≤ nndist f g

{β : Type u_2}
{π : β → Type u_3}
[Fintype β]
[(b : β) → PseudoMetricSpace (π b)]
(f g : (b : β) → π b)
(b : β)


@[norm_cast] -- Porting note (#10618): simp can prove this (removed `@[simp]`)
theorem coe_intCast : ∀ n : ℤ, ((n : s) : R) = n

{R : Type u}
[Ring R]
(s : Subring R)
(n : ℤ)


protected nonrec theorem ContDiff.inversion (hc : ContDiff ℝ n c) (hR : ContDiff ℝ n R)
    (hx : ContDiff ℝ n x) (hne : ∀ a, x a ≠ c a) :
    ContDiff ℝ n (fun a ↦ inversion (c a) (R a) (x a))

{E : Type u_1}
{F : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
{c x : E → F}
{R : E → ℝ}
{n : ℕ∞}
(hc : ContDiff ℝ n c)
(hR : ContDiff ℝ n R)
(hx : ContDiff ℝ n x)
(hne : ∀ (a : E), x a ≠ c a)

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


theorem exists_basis' (M : Matroid α) (X : Set α) : ∃ I, M.Basis' I X

{α : Type u_1}
(M : Matroid α)
(X : Set α)


/-- The equivalence between a product of two dependent functions types and a single dependent
function type. Basically a symmetric version of `Equiv.sumPiEquivProdPi`. -/
@[simps!]
def prodPiEquivSumPi (π : ι → Type u) (π' : ι' → Type u) :
    ((∀ i, π i) × ∀ i', π' i') ≃ ∀ i, Sum.elim π π' i

{ι : Type u_1}
{ι' : Type u_2}
(π : ι → Type u)
(π' : ι' → Type u)

∀ (a : (i : ι ⊕ ι') → Sum.elim π π' i),
  (Equiv.prodPiEquivSumPi π π').symm a = (Equiv.sumPiEquivProdPi (Sum.elim π π')) a


/--
Another variant of the opposite of functor, turning a functor `C ⥤ Dᵒᵖ` into a functor `Cᵒᵖ ⥤ D`.
In informal mathematics no distinction is made.
-/
@[simps]
protected def leftOp (F : C ⥤ Dᵒᵖ) : Cᵒᵖ ⥤ D

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

∀ {X Y : Cᵒᵖ} (f : X ⟶ Y), F.leftOp.map f = (F.map f.unop).unop


/-- The radius of the Cartesian product of two formal series is the minimum of their radii. -/
lemma FormalMultilinearSeries.radius_prod_eq_min
    (p : FormalMultilinearSeries 𝕜 E F) (q : FormalMultilinearSeries 𝕜 E G) :
    (p.prod q).radius = min p.radius q.radius

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
{F : Type u_4}
{G : Type u_5}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
(p : FormalMultilinearSeries 𝕜 E F)
(q : FormalMultilinearSeries 𝕜 E G)


lemma div_right_distrib_of_nonneg {a b c : EReal} (h : 0 ≤ a) (h' : 0 ≤ b) :
    (a + b) / c = (a / c) + (b / c)


@[simp]
theorem isTheta_exp_comp_exp_comp {f g : α → ℝ} :
    ((fun x => exp (f x)) =Θ[l] fun x => exp (g x)) ↔
      IsBoundedUnder (· ≤ ·) l fun x => |f x - g x|

{α : Type u_1}
{l : Filter α}
{f g : α → ℝ}

((fun x => Real.exp (f x)) =Θ[l] fun x => Real.exp (g x)) ↔
  Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l fun x => |f x - g x|


@[simp]
theorem image_add_const_Ioi : (fun x => x + a) '' Ioi b = Ioi (b + a)

{M : Type u_1}
[OrderedCancelAddCommMonoid M]
[ExistsAddOfLE M]
(a b : M)

(fun x => x + a) '' Set.Ioi b = Set.Ioi (b + a)


@[to_additive]
theorem index_ne_zero_of_finite [hH : Finite (G ⧸ H)] : H.index ≠ 0

{G : Type u_1}
[Group G]
{H : Subgroup G}
[hH : Finite (G ⧸ H)]


@[to_additive]
theorem fixedBy_mul (m₁ m₂ : M) : fixedBy α m₁ ∩ fixedBy α m₂ ⊆ fixedBy α (m₁ * m₂)

(α : Type u_1)
{M : Type u_3}
[AddMonoid M]
[AddAction M α]
(m₁ m₂ : M)

AddAction.fixedBy α m₁ ∩ AddAction.fixedBy α m₂ ⊆ AddAction.fixedBy α (m₁ + m₂)


theorem pairwise_disjoint_Ioo_intCast : Pairwise (Disjoint on fun n : ℤ => Ioo (n : α) (n + 1))

Pairwise (Disjoint on fun n => Set.Ioo (↑n) (↑n + 1))


theorem le_sup_of_le_left (h : c ≤ a) : c ≤ a ⊔ b

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


@[simp]
lemma cons_val_four (x : α) (u : Fin m.succ.succ.succ.succ → α) :
    vecCons x u 4 = vecHead (vecTail (vecTail (vecTail u)))

{α : Type u}
{m : ℕ}
(x : α)
(u : Fin m.succ.succ.succ.succ → α)

Matrix.vecCons x u 4 = Matrix.vecHead (Matrix.vecTail (Matrix.vecTail (Matrix.vecTail u)))


/-- A finite sequence of Lp functions is uniformly integrable. -/
theorem unifIntegrable_finite [Finite ι] (hp_one : 1 ≤ p) (hp_top : p ≠ ∞) {f : ι → α → β}
    (hf : ∀ i, Memℒp (f i) p μ) : UnifIntegrable f p μ

{f : ι → α → β}

(hf : ∀ (i : ι), MeasureTheory.Memℒp (f i) p μ)


{α : Type u_1}
{F : Type u_3}
[FunLike F (Set α) ℝ≥0∞]
[MeasureTheory.OuterMeasureClass F α]
{μ : F}


theorem getLast_reverse {l : List α} (hl : l.reverse ≠ [])
    (hl' : 0 < l.length := (by
      contrapose! hl
      simpa [length_eq_zero] using hl)) :
    l.reverse.getLast hl = l.get ⟨0, hl'⟩

{α : Type u}
{l : List α}
(hl : l.reverse ≠ [])
(hl' : 0 < l.length := ⋯)


theorem isChain_univ_iff : IsChain r (univ : Set α) ↔ IsTrichotomous α r


theorem hammingNorm_smul [Zero α] [∀ i, SMulWithZero α (β i)] {k : α}
    (hk : ∀ i, IsSMulRegular (β i) k) (x : ∀ i, β i) : hammingNorm (k • x) = hammingNorm x

{α : Type u_1}
{ι : Type u_2}
{β : ι → Type u_3}
[Fintype ι]
[(i : ι) → DecidableEq (β i)]
[(i : ι) → Zero (β i)]
[Zero α]
[(i : ι) → SMulWithZero α (β i)]
{k : α}
(hk : ∀ (i : ι), IsSMulRegular (β i) k)
(x : (i : ι) → β i)


@[to_additive mem_prod]
theorem mem_prod {s : Submonoid M} {t : Submonoid N} {p : M × N} :
    p ∈ s.prod t ↔ p.1 ∈ s ∧ p.2 ∈ t

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{s : Submonoid M}
{t : Submonoid N}
{p : M × N}


lemma eventually_bi_mul_le_r : ∀ᶠ (n : ℕ) in atTop, ∀ i, (b (min_bi b) / 2) * n ≤ r i n

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

∀ᶠ (n : ℕ) in Filter.atTop, ∀ (i : α), b (AkraBazziRecurrence.min_bi b) / 2 * ↑n ≤ ↑(r i n)


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


@[simp]
theorem comp_toLinearMap (φ₁ : B →ₗc[R] C) (φ₂ : A →ₗc[R] B) :
    φ₁.comp φ₂ = (φ₁ : B →ₗ[R] C) ∘ₗ (φ₂ : A →ₗ[R] B)

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

↑(φ₁.comp φ₂) = ↑φ₁ ∘ₗ ↑φ₂


protected theorem congr_arg {x x'} : x = x' → e x = e x'

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
{e : A ≃ₐc[R] B}
{x x' : A}


@[simp]
theorem natCast_re (n : ℕ) : (n : ℤ√d).re = n


theorem biUnion_image : ⋃ x ∈ f '' s, g x = ⋃ y ∈ s, g (f y)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{s : Set γ}
{f : γ → α}
{g : α → Set β}


@[higher_order tfst_comp_tsnd]
theorem tfst_tsnd {α₀ α₁ β₀ β₁} (f : α₀ → F α₁) (f' : β₀ → G β₁) (x : t α₀ β₀) :
    Comp.mk (tfst f <$> tsnd f' x)
      = bitraverse (Comp.mk ∘ pure ∘ f) (Comp.mk ∘ map pure ∘ f') x

{t : Type u → Type u → Type u}
[Bitraversable t]
{F G : Type u → Type u}
[Applicative F]
[Applicative G]
[LawfulBitraversable t]
[LawfulApplicative F]
[LawfulApplicative G]
{α₀ α₁ β₀ β₁ : Type u}
(f : α₀ → F α₁)
(f' : β₀ → G β₁)

Functor.Comp.mk ∘ Functor.map (Bitraversable.tfst f) ∘ Bitraversable.tsnd f' =
  bitraverse (Functor.Comp.mk ∘ pure ∘ f) (Functor.Comp.mk ∘ Functor.map pure ∘ f')


@[simp]
theorem symmDiff_symmDiff_inf : a ∆ b ∆ (a ⊓ b) = a ⊔ b

{α : Type u_2}
[GeneralizedCoheytingAlgebra α]
(a b : α)


theorem WCovBy.of_image (f : α ↪o β) (h : f a ⩿ f b) : a ⩿ b

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{a b : α}
(f : α ↪o β)
(h : f a ⩿ f b)


@[simp]
theorem codeSupp_case (f g k) :
    codeSupp (Code.case f g) k =
      trStmts₁ (trNormal (Code.case f g) k) ∪ (codeSupp f k ∪ codeSupp g k)

(f g : Turing.ToPartrec.Code)
(k : Turing.PartrecToTM2.Cont')

Turing.PartrecToTM2.codeSupp (f.case g) k =
  Turing.PartrecToTM2.trStmts₁ (Turing.PartrecToTM2.trNormal (f.case g) k) ∪
    (Turing.PartrecToTM2.codeSupp f k ∪ Turing.PartrecToTM2.codeSupp g k)


/-- The `spanPoints` of a set is nonempty if and only if that set is. -/
@[simp]
theorem spanPoints_nonempty (s : Set P) : (spanPoints k s).Nonempty ↔ s.Nonempty

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
(s : Set P)


@[simps one]
instance One.gOne [Zero ι] [One R] : GradedMonoid.GOne fun _ : ι => R

(ι : Type u_1)
{R : Type u_2}
[Zero ι]
[One R]


lemma finsuppLeft_smul' (s : S) (t : (ι →₀ M) ⊗[R] N) :
    finsuppLeft R M N ι (s • t) = s • finsuppLeft R M N ι t

{R : Type u_1}
[CommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_4}
[DecidableEq ι]
{S : Type u_5}
[CommSemiring S]
[Algebra R S]
[Module S M]
[IsScalarTower R S M]
(s : S)
(t : (ι →₀ M) ⊗[R] N)

(TensorProduct.finsuppLeft R M N ι) (s • t) = s • (TensorProduct.finsuppLeft R M N ι) t


theorem disjoint_nhds_nhds_iff_not_inseparable : Disjoint (𝓝 x) (𝓝 y) ↔ ¬Inseparable x y

{X : Type u_1}
[TopologicalSpace X]
[R1Space X]
{x y : X}


@[simp]
theorem refl_apply (x : α) : refl α x = x


/-- The **Halting problem** is not computable -/
theorem halting_problem (n) : ¬ComputablePred fun c => (eval c n).Dom


theorem le_multiplicity_iff_replicate_le_normalizedFactors {a b : R} {n : ℕ} (ha : Irreducible a)
    (hb : b ≠ 0) :
    ↑n ≤ multiplicity a b ↔ replicate n (normalize a) ≤ normalizedFactors b

{R : Type u_2}
[CancelCommMonoidWithZero R]
[UniqueFactorizationMonoid R]
[NormalizationMonoid R]
[DecidableRel Dvd.dvd]
{a b : R}
{n : ℕ}
(ha : Irreducible a)
(hb : b ≠ 0)

↑n ≤ multiplicity a b ↔ Multiset.replicate n (normalize a) ≤ UniqueFactorizationMonoid.normalizedFactors b


theorem hasCoequalizer_of_common_section [HasReflexiveCoequalizers C] {A B : C} {f g : A ⟶ B}
    (r : B ⟶ A) (rf : r ≫ f = 𝟙 _) (rg : r ≫ g = 𝟙 _) : HasCoequalizer f g

(rf : CategoryTheory.CategoryStruct.comp r f = CategoryTheory.CategoryStruct.id B)

(rg : CategoryTheory.CategoryStruct.comp r g = CategoryTheory.CategoryStruct.id B)


theorem not_disjoint_iff_nonempty_inter : ¬Disjoint s t ↔ (s ∩ t).Nonempty

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


lemma IsPointwiseRightKanExtensionAt.isIso_hom_app
    {X : C} (h : E.IsPointwiseRightKanExtensionAt (L.obj X)) [L.Full] [L.Faithful] :
    IsIso (E.hom.app X)


theorem one_lt_inv (h₁ : 0 < a) (h₂ : a < 1) : 1 < a⁻¹

{α : Type u_2}
[LinearOrderedSemifield α]
{a : α}
(h₁ : 0 < a)
(h₂ : a < 1)


@[simp]
theorem toFinset_nsmul (s : Multiset α) : ∀ n ≠ 0, (n • s).toFinset = s.toFinset

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


lemma nonsingular_iff_variableChange (x y : R) :
    W.Nonsingular x y ↔ (W.variableChange ⟨1, x, 0, y⟩).toAffine.Nonsingular 0 0

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

W.Nonsingular x y ↔ (WeierstrassCurve.variableChange W { u := 1, r := x, s := 0, t := y }).toAffine.Nonsingular 0 0


/-- For nonzero regular left invariant measures, the integral of a continuous nonnegative function
  `f` is 0 iff `f` is 0. -/
@[to_additive
      "For nonzero regular left invariant measures, the integral of a continuous nonnegative
      function `f` is 0 iff `f` is 0."]
theorem lintegral_eq_zero_of_isMulLeftInvariant [Regular μ] [NeZero μ] {f : G → ℝ≥0∞}
    (hf : Continuous f) : ∫⁻ x, f x ∂μ = 0 ↔ f = 0

{G : Type u_1}
[MeasurableSpace G]
{μ : MeasureTheory.Measure G}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
[BorelSpace G]
[μ.IsMulLeftInvariant]
[μ.Regular]
[NeZero μ]
{f : G → ENNReal}
(hf : Continuous f)


lemma epi_homologyMap_of_epi_cyclesMap'
    [S₁.HasHomology] [S₂.HasHomology] (h : Epi (cyclesMap φ)) :
    Epi (homologyMap φ)

(h : CategoryTheory.Epi (CategoryTheory.ShortComplex.cyclesMap φ))


@[simp]
theorem symm_toHomeomorph (h : M ≃ₘ^n⟮I, J⟯ N) : h.symm.toHomeomorph = h.toHomeomorph.symm

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_5}
[TopologicalSpace H]
{G : Type u_7}
[TopologicalSpace G]
{I : ModelWithCorners 𝕜 E H}
{J : ModelWithCorners 𝕜 F G}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{N : Type u_11}
[TopologicalSpace N]
[ChartedSpace G N]
{n : ℕ∞}
(h : M ≃ₘ^n⟮I, J⟯ N)


/-- The Riemann zeta function is differentiable away from `s = 1`. -/
theorem differentiableAt_riemannZeta {s : ℂ} (hs' : s ≠ 1) : DifferentiableAt ℂ riemannZeta s


@[reassoc (attr := simp)]
lemma cokernel_π_comp_cokernelToAbelianCoimage :
    cokernel.π S.f ≫ S.cokernelToAbelianCoimage = Abelian.coimage.π S.g

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.cokernel.π S.f) S.cokernelToAbelianCoimage =
  CategoryTheory.Abelian.coimage.π S.g


theorem mk_plift_false : #(PLift False) = 0


@[simp]
theorem card_product : card (s ×ˢ t) = card s * card t

{α : Type u_1}
{β : Type v}
(s : Multiset α)
(t : Multiset β)

Multiset.card (s ×ˢ t) = Multiset.card s * Multiset.card t


/-- The **Hellinger--Toeplitz theorem**: if a symmetric operator is defined on a complete space,
  then it is automatically continuous. -/
theorem IsSymmetric.continuous [CompleteSpace E] {T : E →ₗ[𝕜] E} (hT : IsSymmetric T) :
    Continuous T

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[CompleteSpace E]
{T : E →ₗ[𝕜] E}
(hT : T.IsSymmetric)


@[simp]
theorem ofQuaternion_mk (a₁ a₂ a₃ a₄ : R) :
    ofQuaternion (⟨a₁, a₂, a₃, a₄⟩ : ℍ[R,c₁,c₂]) =
      algebraMap R _ a₁ + a₂ • ι (Q c₁ c₂) (1, 0) + a₃ • ι (Q c₁ c₂) (0, 1) +
        a₄ • (ι (Q c₁ c₂) (1, 0) * ι (Q c₁ c₂) (0, 1))

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

CliffordAlgebraQuaternion.ofQuaternion { re := a₁, imI := a₂, imJ := a₃, imK := a₄ } =
  (algebraMap R (CliffordAlgebra (CliffordAlgebraQuaternion.Q c₁ c₂))) a₁ +
        a₂ • (CliffordAlgebra.ι (CliffordAlgebraQuaternion.Q c₁ c₂)) (1, 0) +
      a₃ • (CliffordAlgebra.ι (CliffordAlgebraQuaternion.Q c₁ c₂)) (0, 1) +
    a₄ •
      ((CliffordAlgebra.ι (CliffordAlgebraQuaternion.Q c₁ c₂)) (1, 0) *
        (CliffordAlgebra.ι (CliffordAlgebraQuaternion.Q c₁ c₂)) (0, 1))


theorem ord_term {o : Ordinal} (ho : o < Ordinal.type ((·<·) : I → I → Prop)) (i : I) :
    ord I i = o ↔ term I ho = i

(ho : o < Ordinal.type fun x x_1 => x < x_1)

Profinite.NobelingProof.ord I i = o ↔ Profinite.NobelingProof.term I ho = i


@[reassoc (attr := simp)]
lemma map_hom_ofInv_id (s : Y ⟶ X) (hs : W s) (L : C ⥤ D) (hL : W.IsInvertedBy L) :
    L.map s ≫ (ofInv s hs).map L hL = 𝟙 _

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
(W : CategoryTheory.MorphismProperty C)
{X Y : C}
(s : Y ⟶ X)
(hs : W s)
(L : CategoryTheory.Functor C D)
(hL : W.IsInvertedBy L)

CategoryTheory.CategoryStruct.comp (L.map s) ((CategoryTheory.MorphismProperty.LeftFraction.ofInv s hs).map L hL) =
  CategoryTheory.CategoryStruct.id (L.obj Y)


@[simp]
lemma Tor'_obj_map (n : ℕ) {X Y : C} (Z : C) (f : X ⟶ Y) :
    ((Tor' C n).obj Z).map f = (NatTrans.leftDerived ((tensoringRight C).map f) n).app Z

((CategoryTheory.Tor' C n).obj Z).map f =
  (CategoryTheory.NatTrans.leftDerived ((CategoryTheory.MonoidalCategory.tensoringRight C).map f) n).app Z


lemma stableUnderSpecialization_sUnion (S : Set (Set X))
    (H : ∀ s ∈ S, StableUnderSpecialization s) : StableUnderSpecialization (⋃₀ S)


/-- Auxiliary definition for `mapTrifunctor`. -/
@[simps]
def mapTrifunctorObj {I₁ : Type*} (X₁ : GradedObject I₁ C₁) (I₂ I₃ : Type*) :
    GradedObject I₂ C₂ ⥤ GradedObject I₃ C₃ ⥤ GradedObject (I₁ × I₂ × I₃) C₄

(F : CategoryTheory.Functor C₁ (CategoryTheory.Functor C₂ (CategoryTheory.Functor C₃ C₄)))

(X₁ : CategoryTheory.GradedObject I₁ C₁)

(X₂ : CategoryTheory.GradedObject I₂ C₂)

{X₃ Y₃ : CategoryTheory.GradedObject I₃ C₃}

((CategoryTheory.GradedObject.mapTrifunctorObj F X₁ I₂ I₃).obj X₂).map φ x =
  ((F.obj (X₁ x.1)).obj (X₂ x.2.1)).map (φ x.2.2)


theorem modular_S_smul (z : ℍ) : ModularGroup.S • z = mk (-z : ℂ)⁻¹ z.im_inv_neg_coe_pos

ModularGroup.S • z = UpperHalfPlane.mk (-↑z)⁻¹ ⋯


@[deprecated getElem_singleton (since := "2024-06-12")]
theorem get_singleton (a : α) (n : Fin 1) : get [a] n = a


@[simp] theorem mod_val (a b : Fin n) : (a % b).val = a.val % b.val


theorem mem_kernMap_iff_compl {s : Set β} : s ∈ kernMap m f ↔ ∃ t, tᶜ ∈ f ∧ m '' t = sᶜ

{α : Type u}
{β : Type v}
{m : α → β}
{f : Filter α}
{s : Set β}

s ∈ Filter.kernMap m f ↔ ∃ t, tᶜ ∈ f ∧ m '' t = sᶜ


theorem inf_inf_distrib_right (a b c : α) : a ⊓ b ⊓ c = a ⊓ c ⊓ (b ⊓ c)

{α : Type u}
[SemilatticeInf α]
(a b c : α)


@[simp]
theorem toIcoDiv_sub (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 infty_coeFn_one : ⇑(1 : lp B ∞) = 1

{I : Type u_3}
{B : I → Type u_4}
[(i : I) → NormedRing (B i)]
[∀ (i : I), NormOneClass (B i)]


theorem commutator_eq_closure : commutator G = Subgroup.closure (commutatorSet G)


theorem head_eq_head' : ∀ (x : M F) (n : ℕ), head x = head' (x.approx <| n + 1)

x.head = PFunctor.Approx.head' (x.approx (n + 1))


/-- If `f` has formal power series `∑ n, pₙ` on a ball of radius `r`, then for `y, z` in any smaller
ball, the norm of the difference `f y - f z - p 1 (fun _ ↦ y - z)` is bounded above by
`C * (max ‖y - x‖ ‖z - x‖) * ‖y - z‖`. -/
theorem HasFPowerSeriesOnBall.image_sub_sub_deriv_le (hf : HasFPowerSeriesOnBall f p x r)
    (hr : r' < r) :
    ∃ C, ∀ᵉ (y ∈ EMetric.ball x r') (z ∈ EMetric.ball x r'),
      ‖f y - f z - p 1 fun _ => y - z‖ ≤ C * max ‖y - x‖ ‖z - x‖ * ‖y - z‖

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{x : E}
{r r' : ℝ≥0∞}
(hf : HasFPowerSeriesOnBall f p x r)
(hr : r' < r)

∃ C,
  ∀ y ∈ EMetric.ball x r',
    ∀ z ∈ EMetric.ball x r', ‖f y - f z - (p 1) fun x => y - z‖ ≤ C * max ‖y - x‖ ‖z - x‖ * ‖y - z‖


theorem measurable_kernel_prod_mk_right [IsSFiniteKernel κ] {s : Set (β × α)}
    (hs : MeasurableSet s) : Measurable fun y => κ y ((fun x => (x, y)) ⁻¹' s)

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{κ : ProbabilityTheory.Kernel α β}
[ProbabilityTheory.IsSFiniteKernel κ]
{s : Set (β × α)}
(hs : MeasurableSet s)

Measurable fun y => (κ y) ((fun x => (x, y)) ⁻¹' s)


@[simp]
lemma reflection_image_eq :
    P.reflection i '' (range P.root) = range P.root

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
{N : Type u_4}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(P : RootPairing ι R M N)
(i : ι)

⇑(P.reflection i) '' Set.range ⇑P.root = Set.range ⇑P.root


theorem coe_associatedHom :
    ⇑(associatedHom S : QuadraticMap R M N →ₗ[S] BilinMap R M N) = associated

(S : Type u_1)
{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommSemiring S]
[CommRing R]
[AddCommGroup M]
[Algebra S R]
[Module R M]
[AddCommGroup N]
[Module R N]
[Module S N]
[IsScalarTower S R N]
[Invertible 2]

⇑(QuadraticMap.associatedHom S) = ⇑QuadraticMap.associated


/-- Pushforward of nonempty intervals. -/
@[simps!]
def map (f : α →o β) (a : NonemptyInterval α) : NonemptyInterval β

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(f : α →o β)
(a : NonemptyInterval α)

(NonemptyInterval.map f a).toProd.1 = f a.1.1


theorem last_ofFn {n : ℕ} (f : Fin n → α) (h : ofFn f ≠ [])
    (hn : n - 1 < n := Nat.pred_lt <| ofFn_eq_nil_iff.not.mp h) :
    getLast (ofFn f) h = f ⟨n - 1, hn⟩

{α : Type u}
{n : ℕ}
(f : Fin n → α)
(h : List.ofFn f ≠ [])
(hn : n - 1 < n := ⋯)


/-- Differentiation under integral of `x ↦ ∫ F x a` at a given point `x₀`, assuming
`F x₀` is integrable, `x ↦ F x a` is differentiable on a ball around `x₀` for ae `a` with
derivative norm uniformly bounded by an integrable function (the ball radius is independent of `a`),
and `F x` is ae-measurable for `x` in a possibly smaller neighborhood of `x₀`. -/
theorem hasFDerivAt_integral_of_dominated_of_fderiv_le {F' : H → α → H →L[𝕜] E} (ε_pos : 0 < ε)
    (hF_meas : ∀ᶠ x in 𝓝 x₀, AEStronglyMeasurable (F x) μ) (hF_int : Integrable (F x₀) μ)
    (hF'_meas : AEStronglyMeasurable (F' x₀) μ)
    (h_bound : ∀ᵐ a ∂μ, ∀ x ∈ ball x₀ ε, ‖F' x a‖ ≤ bound a)
    (bound_integrable : Integrable (bound : α → ℝ) μ)
    (h_diff : ∀ᵐ a ∂μ, ∀ x ∈ ball x₀ ε, HasFDerivAt (F · a) (F' x a) x) :
    HasFDerivAt (fun x ↦ ∫ a, F x a ∂μ) (∫ a, F' x₀ a ∂μ) x₀

(hF_meas : ∀ᶠ (x : H) in 𝓝 x₀, MeasureTheory.AEStronglyMeasurable (F x) μ)

(hF_int : MeasureTheory.Integrable (F x₀) μ)

(hF'_meas : MeasureTheory.AEStronglyMeasurable (F' x₀) μ)

(h_bound : ∀ᵐ (a : α) ∂μ, ∀ x ∈ Metric.ball x₀ ε, ‖F' x a‖ ≤ bound a)

(bound_integrable : MeasureTheory.Integrable bound μ)

(h_diff : ∀ᵐ (a : α) ∂μ, ∀ x ∈ Metric.ball x₀ ε, HasFDerivAt (fun x => F x a) (F' x a) x)

HasFDerivAt (fun x => ∫ (a : α), F x a ∂μ) (∫ (a : α), F' x₀ a ∂μ) x₀


/-- Möbius inversion for functions to a `CommGroupWithZero`. -/
theorem prod_eq_iff_prod_pow_moebius_eq_of_nonzero [CommGroupWithZero R] {f g : ℕ → R}
    (hf : ∀ n : ℕ, 0 < n → f n ≠ 0) (hg : ∀ n : ℕ, 0 < n → g n ≠ 0) :
    (∀ n > 0, ∏ i ∈ n.divisors, f i = g n) ↔
      ∀ n > 0, ∏ x ∈ n.divisorsAntidiagonal, g x.snd ^ μ x.fst = f n

{R : Type u_1}
[CommGroupWithZero R]
{f g : ℕ → R}
(hf : ∀ (n : ℕ), 0 < n → f n ≠ 0)
(hg : ∀ (n : ℕ), 0 < n → g n ≠ 0)

(∀ n > 0, ∏ i ∈ n.divisors, f i = g n) ↔
  ∀ n > 0, ∏ x ∈ n.divisorsAntidiagonal, g x.2 ^ ArithmeticFunction.moebius x.1 = f n


@[simp]
theorem gcd_empty : (∅ : Finset β).gcd f = 0

{α : Type u_2}
{β : Type u_3}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{f : β → α}


@[to_additive]
theorem Right.pow_lt_one_iff [CovariantClass M M (swap (· * ·)) (· < ·)] {n : ℕ} {x : M}
    (hn : 0 < n) : x ^ n < 1 ↔ x < 1

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


theorem mul_noncommProd_erase [DecidableEq α] (s : Multiset α) {a : α} (h : a ∈ s) (comm)
    (comm' := fun x hx y hy hxy ↦ comm (s.mem_of_mem_erase hx) (s.mem_of_mem_erase hy) hxy) :
    a * (s.erase a).noncommProd comm' = s.noncommProd comm

(comm' : ∀ x ∈ {x | x ∈ s.erase a}, ∀ y ∈ {x | x ∈ s.erase a}, x ≠ y → Commute x y := ⋯)


lemma kernImage_preimage_union {s : Set α} {t : Set β} :
    kernImage f (f ⁻¹' t ∪ s) = t ∪ kernImage f s

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{s : Set α}
{t : Set β}

Set.kernImage f (f ⁻¹' t ∪ s) = t ∪ Set.kernImage f s


theorem IsGLB.nonempty [NoMaxOrder α] (hs : IsGLB s a) : s.Nonempty

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


lemma subgraphOfAdj_le_of_adj {v w : V} (H : G.Subgraph) (h : H.Adj v w) :
    G.subgraphOfAdj (H.adj_sub h) ≤ H

{V : Type u}
{G : SimpleGraph V}
{v w : V}
(H : G.Subgraph)
(h : H.Adj v w)


theorem zero_mem' (U : (Opens (ProjectiveSpectrum.top 𝒜))ᵒᵖ) :
    (isLocallyFraction 𝒜).pred (0 : ∀ x : U.unop, at x.1)

(U : (TopologicalSpace.Opens ↑(ProjectiveSpectrum.top 𝒜))ᵒᵖ)


theorem addOrderOf_eq_pos_iff {u : AddCircle p} {n : ℕ} (h : 0 < n) :
    addOrderOf u = n ↔ ∃ m < n, m.gcd n = 1 ∧ ↑(↑m / ↑n * p) = u

{𝕜 : Type u_1}
[LinearOrderedField 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
{p : 𝕜}
[hp : Fact (0 < p)]
{u : AddCircle p}
{n : ℕ}
(h : 0 < n)


theorem mul_le : I * J ≤ K ↔ ∀ r ∈ I, ∀ s ∈ J, r * s ∈ K

{R : Type u}
[CommSemiring R]
{I J K : Ideal R}


theorem exp_arsinh (x : ℝ) : exp (arsinh x) = x + √(1 + x ^ 2)


theorem lipschitz_equivRealProd : LipschitzWith 1 equivRealProd


theorem isOpen_source (e : Pretrivialization F (π F E)) :
    IsOpen[a.totalSpaceTopology] e.source

(e : Pretrivialization F Bundle.TotalSpace.proj)


protected theorem map_mul (f : A →ₛₙₐ[φ] B) (x y : A) : f (x * y) = f x * f y

{R : Type u}
{S : Type u₁}
[Monoid R]
[Monoid S]
{φ : R →* S}
{A : Type v}
{B : Type w}
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction S B]
(f : A →ₛₙₐ[φ] B)
(x y : A)


theorem PosMulReflectLE.toPosMulStrictMono [PosMulReflectLE α] : PosMulStrictMono α

{α : Type u_1}
[Mul α]
[Zero α]
[LinearOrder α]
[PosMulReflectLE α]


theorem cos_arccos {x : ℝ} (hx₁ : -1 ≤ x) (hx₂ : x ≤ 1) : cos (arccos x) = x


/-- A non-zero `a : F` is a square if and only if `a ^ (#F / 2) = 1`. -/
theorem isSquare_iff (hF : ringChar F ≠ 2) {a : F} (ha : a ≠ 0) :
    IsSquare a ↔ a ^ (Fintype.card F / 2) = 1

{F : Type u_3}
[Field F]
[Fintype F]
(hF : ringChar F ≠ 2)
{a : F}
(ha : a ≠ 0)


theorem isDedekindDomainInv_iff [Algebra A K] [IsFractionRing A K] :
    IsDedekindDomainInv A ↔ ∀ I ≠ (⊥ : FractionalIdeal A⁰ K), I * I⁻¹ = 1

{A : Type u_2}
{K : Type u_3}
[CommRing A]
[Field K]
[IsDomain A]
[Algebra A K]
[IsFractionRing A K]

IsDedekindDomainInv A ↔ ∀ (I : FractionalIdeal A⁰ K), I ≠ ⊥ → I * I⁻¹ = 1


@[simp]
theorem dist_conj_conj (z w : ℂ) : dist (conj z) (conj w) = dist z w

dist ((starRingEnd ℂ) z) ((starRingEnd ℂ) w) = dist z w


theorem span_eq_bot : span R (s : Set M) = ⊥ ↔ ∀ x ∈ s, (x : M) = 0

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{s : Set M}


@[simp]
theorem expMapCircle_two_pi : expMapCircle (2 * π) = 1


@[to_additive] lemma mabs_of_le_one (h : a ≤ 1) : |a|ₘ = a⁻¹

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


@[simp]
theorem sup_mul_inf (I J : Ideal A) : (I ⊔ J) * (I ⊓ J) = I * J

{A : Type u_2}
[CommRing A]
[IsDedekindDomain A]
(I J : Ideal A)


@[simp]
theorem Submodule.topologicalClosure_coe (s : Submodule R M) :
    (s.topologicalClosure : Set M) = closure (s : Set M)

{R : Type u}
{M : Type v}
[Semiring R]
[TopologicalSpace M]
[AddCommMonoid M]
[Module R M]
[ContinuousConstSMul R M]
[ContinuousAdd M]
(s : Submodule R M)


/-- An algebra iso `A ≃ₐ[R] B` can equivalently be viewed as an algebra iso `Aᵐᵒᵖ ≃ₐ[R] Bᵐᵒᵖ`.
This is the action of the (fully faithful) `ᵐᵒᵖ`-functor on morphisms. -/
@[simps!]
def op : (A ≃ₐ[R] B) ≃ Aᵐᵒᵖ ≃ₐ[R] Bᵐᵒᵖ

{R : Type u_1}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(f : Aᵐᵒᵖ ≃ₐ[R] Bᵐᵒᵖ)

∀ (a : A), (AlgEquiv.op.symm f) a = MulOpposite.unop (f (MulOpposite.op a))


lemma ofJ_1728_of_two_ne_zero [h2 : NeZero (2 : F)] :
    ofJ 1728 = @ofJ1728 _ _ (invertibleOfNonzero h2.out)

{F : Type u}
[Field F]
[DecidableEq F]
[h2 : NeZero 2]

EllipticCurve.ofJ 1728 = EllipticCurve.ofJ1728 F


/-- `∨` distributes over `∧` (on the left). -/
theorem or_and_left : a ∨ (b ∧ c) ↔ (a ∨ b) ∧ (a ∨ c)


theorem mul_algebraMap₀ {n} (r : R) (a : ⨂[R]^n M) :
    cast R M (add_zero _) (a ₜ* algebraMap₀ r) = r • a

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{n : ℕ}
(r : R)
(a : ⨂[R]^n M)

(TensorPower.cast R M ⋯) (GradedMonoid.GMul.mul a (TensorPower.algebraMap₀ r)) = r • a


theorem iUnion_dite (f : ∀ i, p i → Set α) (g : ∀ i, ¬p i → Set α) :
    ⋃ i, (if h : p i then f i h else g i h) = (⋃ (i) (h : p i), f i h) ∪ ⋃ (i) (h : ¬p i), g i h

{α : Type u_1}
{ι : Sort u_4}
(p : ι → Prop)
[DecidablePred p]
(f : (i : ι) → p i → Set α)
(g : (i : ι) → ¬p i → Set α)

(⋃ i, if h : p i then f i h else g i h) = (⋃ i, ⋃ (h : p i), f i h) ∪ ⋃ i, ⋃ (h : ¬p i), g i h


lemma isHomLift_iff : IsHomLift 𝒴.p f (F.map φ) ↔ IsHomLift 𝒳.p f φ

{𝒮 : Type u₁}
[CategoryTheory.Category.{v₁, u₁} 𝒮]
{𝒳 : CategoryTheory.BasedCategory 𝒮}
{𝒴 : CategoryTheory.BasedCategory 𝒮}
(F : CategoryTheory.BasedFunctor 𝒳 𝒴)
{R S : 𝒮}
{a b : 𝒳.obj}
(f : R ⟶ S)
(φ : a ⟶ b)

𝒴.p.IsHomLift f (F.map φ) ↔ 𝒳.p.IsHomLift f φ


@[to_additive]
theorem pairwise_disjoint_Ioc_mul_zpow :
    Pairwise (Disjoint on fun n : ℤ => Ioc (a * b ^ n) (a * b ^ (n + 1)))

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

Pairwise (Disjoint on fun n => Set.Ioc (a + n • b) (a + (n + 1) • b))


@[to_additive]
theorem isComplement'_top_bot : IsComplement' (⊤ : Subgroup G) ⊥


theorem setIndependent_singleton (a : α) : SetIndependent ({a} : Set α)

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


lemma quasiIso_iff_comp_left (φ : S₁ ⟶ S₂) (φ' : S₂ ⟶ S₃) [hφ : QuasiIso φ] :
    QuasiIso (φ ≫ φ') ↔ QuasiIso φ'

{S₁ S₂ S₃ : CategoryTheory.ShortComplex C}

[hφ : CategoryTheory.ShortComplex.QuasiIso φ]

CategoryTheory.ShortComplex.QuasiIso (CategoryTheory.CategoryStruct.comp φ φ') ↔ CategoryTheory.ShortComplex.QuasiIso φ'


@[to_additive]
theorem prod_subset (h : s₁ ⊆ s₂) (hf : ∀ x ∈ s₂, x ∉ s₁ → f x = 1) :
    ∏ x ∈ s₁, f x = ∏ x ∈ s₂, f x

{α : Type u_3}
{β : Type u_4}
{s₁ s₂ : Finset α}
{f : α → β}
[AddCommMonoid β]
(h : s₁ ⊆ s₂)
(hf : ∀ x ∈ s₂, x ∉ s₁ → f x = 0)


theorem hasStrictInitial_of_isUniversal [HasInitial C]
    (H : IsUniversalColimit (BinaryCofan.mk (𝟙 (⊥_ C)) (𝟙 (⊥_ C)))) : HasStrictInitialObjects C

(H :
  CategoryTheory.IsUniversalColimit
    (CategoryTheory.Limits.BinaryCofan.mk (CategoryTheory.CategoryStruct.id (⊥_ C))
      (CategoryTheory.CategoryStruct.id (⊥_ C))))


lemma neg_gcd' [GCDMonoid α] {a b : α} : Associated (gcd (-a) b) (gcd a b)

{α : Type u_1}
[CancelCommMonoidWithZero α]
[HasDistribNeg α]
[GCDMonoid α]
{a b : α}


@[to_additive (attr := simp, norm_cast)]
theorem const_pow [Pow G M] (a : G) (n : M) : (↑(a ^ n) : Germ l G) = (↑a : Germ l G) ^ n

{α : Type u_1}
{l : Filter α}
{M : Type u_5}
{G : Type u_6}
[Pow G M]
(a : G)
(n : M)


theorem isOneCoboundary_of_oneCoboundaries (f : oneCoboundaries (Rep.ofDistribMulAction k G A)) :
    IsOneCoboundary (A := A) f.1.1

(f : ↥(groupCohomology.oneCoboundaries (Rep.ofDistribMulAction k G A)))


@[to_additive]
theorem eventuallyEq_prod {X M : Type*} [CommMonoid M] {s : Finset ι} {l : Filter X}
    {f g : ι → X → M} (hs : ∀ i ∈ s, f i =ᶠ[l] g i) : ∏ i ∈ s, f i =ᶠ[l] ∏ i ∈ s, g i

{ι : Type u_1}
{X : Type u_6}
{M : Type u_7}
[AddCommMonoid M]
{s : Finset ι}
{l : Filter X}
{f g : ι → X → M}
(hs : ∀ i ∈ s, f i =ᶠ[l] g i)


theorem comp (f : ι' → ι) (hf : Function.Injective f) : AlgebraicIndependent R (x ∘ f)

{ι : Type u_1}
{ι' : Type u_2}
{R : Type u_3}
{A : Type u_5}
{x : ι → A}
[CommRing R]
[CommRing A]
[Algebra R A]
(hx : AlgebraicIndependent R x)
(f : ι' → ι)
(hf : Function.Injective f)


@[simp]
theorem sum_card : Cardinal.sum (fun i => #(Sequence₂ a₀ a₁ a₂ i)) = #a₀ + #a₁ + #a₂

(Cardinal.sum fun i => #(FirstOrder.Sequence₂ a₀ a₁ a₂ i)) = #a₀ + #a₁ + #a₂


theorem comp_right_hasFDerivAt_iff' {f : F → G} {x : E} {f' : E →L[𝕜] G} :
    HasFDerivAt (f ∘ iso) f' x ↔ HasFDerivAt f (f'.comp (iso.symm : F →L[𝕜] E)) (iso x)

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

HasFDerivAt (f ∘ ⇑iso) f' x ↔ HasFDerivAt f (f'.comp ↑iso.symm) (iso x)


/-- Construct an adjunction between functors `F` and `G` given a unit and counit for the adjunction
satisfying the triangle identities. -/

@[simps!]
def mkOfUnitCounit (adj : CoreUnitCounit F G) : F ⊣ G

(adj : CategoryTheory.Adjunction.CoreUnitCounit F G)

(CategoryTheory.Adjunction.mkOfUnitCounit adj).counit = adj.counit


@[simp]
theorem Iio_union_Ioi : Iio a ∪ Ioi a = {a}ᶜ


/-- Construct a morphism between whiskered lifts. -/
@[simps! right]
def whiskerHom (i : s ⟶ t) {x : B} (h : x ⟶ c) :
    s.whisker h ⟶ t.whisker h

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

(CategoryTheory.Bicategory.LeftLift.whiskerHom i h).right = CategoryTheory.Bicategory.whiskerLeft h i.right


theorem inner_map_polarization' (T : V →ₗ[ℂ] V) (x y : V) :
    ⟪T x, y⟫_ℂ =
      (⟪T (x + y), x + y⟫_ℂ - ⟪T (x - y), x - y⟫_ℂ -
            Complex.I * ⟪T (x + Complex.I • y), x + Complex.I • y⟫_ℂ +
          Complex.I * ⟪T (x - Complex.I • y), x - Complex.I • y⟫_ℂ) /
        4

{V : Type u_4}
[NormedAddCommGroup V]
[InnerProductSpace ℂ V]
(T : V →ₗ[ℂ] V)
(x y : V)


@[simp]
theorem Iso.inv_inv (f : X ≅ Y) : inv f.inv = f.hom

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


@[simp]
theorem coe_algebraMap [CommSemiring R] [Semiring k] [Algebra R k] [AddMonoid G] :
    (algebraMap R k[G] : R → k[G]) = single 0 ∘ algebraMap R k

{k : Type u₁}
{G : Type u₂}
{R : Type u_2}
[CommSemiring R]
[Semiring k]
[Algebra R k]
[AddMonoid G]

⇑(algebraMap R (AddMonoidAlgebra k G)) = AddMonoidAlgebra.single 0 ∘ ⇑(algebraMap R k)


/-- A Jordan decomposition of a measurable space is a pair of mutually singular,
finite measures. -/
@[ext]
structure JordanDecomposition (α : Type*) [MeasurableSpace α] where
  (posPart negPart : Measure α)
  [posPart_finite : IsFiniteMeasure posPart]
  [negPart_finite : IsFiniteMeasure negPart]
  mutuallySingular : posPart ⟂ₘ negPart

(self : MeasureTheory.JordanDecomposition α)


@[simp] theorem toNat_of_nonneg {a : Int} (h : 0 ≤ a) : (toNat a : Int) = a


@[simp]
theorem edgeSet_subgraphOfAdj {v w : V} (hvw : G.Adj v w) :
    (G.subgraphOfAdj hvw).edgeSet = {s(v, w)}

{V : Type u}
{G : SimpleGraph V}
{v w : V}
(hvw : G.Adj v w)


theorem iSup_sets_eq {f : ι → Filter α} : (iSup f).sets = ⋂ i, (f i).sets

{α : Type u}
{ι : Sort x}
{f : ι → Filter α}


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

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


lemma IsSMulRegular.lTensor : IsSMulRegular (M ⊗[R] M') r

{R : Type u_1}
(M : Type u_3)
{M' : Type u_4}
[CommRing R]
[AddCommGroup M]
[AddCommGroup M']
[Module R M]
[Module R M']
[Module.Flat R M]
{r : R}
(h : IsSMulRegular M' r)


theorem trace_mul_cycle [NonUnitalCommSemiring R] (A : Matrix m n R) (B : Matrix n p R)
    (C : Matrix p m R) : trace (A * B * C) = trace (C * A * B)

{m : Type u_2}
{n : Type u_3}
{p : Type u_4}
{R : Type u_6}
[Fintype m]
[Fintype n]
[Fintype p]
[NonUnitalCommSemiring R]
(A : Matrix m n R)
(B : Matrix n p R)
(C : Matrix p m R)


theorem cmp_mul_neg_right [ExistsAddOfLE α] [MulPosStrictMono α]
    [ContravariantClass α α (swap (· + ·)) (· < ·)] [CovariantClass α α (swap (· + ·)) (· < ·)]
    {a : α} (ha : a < 0) (b c : α) : cmp (b * a) (c * a) = cmp c b

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

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


/-- Let `s` be a closed set in a separable normal space. If the induced topology on `s` is discrete,
then `s` has cardinality less than continuum.

The proof follows
https://en.wikipedia.org/wiki/Moore_plane#Proof_that_the_Moore_plane_is_not_normal -/
theorem IsClosed.mk_lt_continuum [NormalSpace X] {s : Set X} (hs : IsClosed s)
    [DiscreteTopology s] : #s < 𝔠

{X : Type u}
[TopologicalSpace X]
[TopologicalSpace.SeparableSpace X]
[NormalSpace X]
{s : Set X}
(hs : IsClosed s)
[DiscreteTopology ↑s]


theorem comp {g : B →+* C} {f : A →+* B} (hg : g.FiniteType) (hf : f.FiniteType) :
    (g.comp f).FiniteType

{A : Type u_1}
{B : Type u_2}
{C : Type u_3}
[CommRing A]
[CommRing B]
[CommRing C]
{g : B →+* C}
{f : A →+* B}
(hg : g.FiniteType)
(hf : f.FiniteType)


lemma ringChar_zero_iff_CharZero : ringChar R = 0 ↔ CharZero R


lemma predAbove_pred_of_le (p i : Fin (n + 1)) (h : p ≤ i) (hp : p ≠ 0)
    (hi := Fin.ne_of_gt $ Fin.lt_of_lt_of_le (Fin.pos_iff_ne_zero.2 hp) h) :
  (pred p hp).predAbove i = pred i hi


@[simp]
theorem extend_top {α : Type*} {P : α → Prop} : extend (fun _ _ => ∞ : ∀ s : α, P s → ℝ≥0∞) = ⊤


lemma nonsingular_iff_affine_of_Z_ne_zero {P : Fin 3 → F} (hPz : P z ≠ 0) :
    W.Nonsingular P ↔ W.toAffine.Nonsingular (P x / P z) (P y / P z)

{F : Type u}
[Field F]
{W : WeierstrassCurve.Projective F}
{P : Fin 3 → F}
(hPz : P 2 ≠ 0)

W.Nonsingular P ↔ W.toAffine.Nonsingular (P 0 / P 2) (P 1 / P 2)


theorem drop_sublist (n) (l : List α) : drop n l <+ l


/-- The matrix [a, -b; b, a] (inspired by multiplication by a complex number); it is an element of
$GL_2(R)$ if `a ^ 2 + b ^ 2` is nonzero. -/
@[simps! (config := .asFn) val]
def planeConformalMatrix {R} [Field R] (a b : R) (hab : a ^ 2 + b ^ 2 ≠ 0) :
    Matrix.GeneralLinearGroup (Fin 2) R

{R : Type u_1}
[Field R]
(a b : R)
(hab : a ^ 2 + b ^ 2 ≠ 0)

↑(Matrix.planeConformalMatrix a b hab) = !![a, -b; b, a]


theorem filter_card_eq {p : α → Prop} [DecidablePred p] (h : (s.filter p).card = s.card) (x : α)
    (hx : x ∈ s) : p x

{α : Type u_1}
{s : Finset α}
{p : α → Prop}
[DecidablePred p]
(h : (Finset.filter p s).card = s.card)
(x : α)
(hx : x ∈ s)


lemma truncateToReal_nonneg {t x : ℝ≥0∞} : 0 ≤ truncateToReal t x


@[to_additive (attr := simp)]
theorem noncommCoprod_comp_inl : (f.noncommCoprod g comm).comp (inl M N) = f

(comm : ∀ (m : M) (n : N), AddCommute (f m) (g n))

(f.noncommCoprod g comm).comp (AddMonoidHom.inl M N) = f


@[simp]
theorem lift_of (f : G →* H) (x : H) (hx : ∀ a : A, x * f ↑a = f (φ a : G) * x) (g : G) :
    lift f x hx (of g) = f g

(hx : ∀ (a : ↥A), x * f ↑a = f ↑(φ a) * x)

(HNNExtension.lift f x hx) (HNNExtension.of g) = f g


@[simp, norm_cast] lemma coe_nonempty : (s : Set α).Nonempty ↔ s ≠ ⊥


protected theorem swap : Nat.Primrec (unpaired (swap Nat.pair))

Nat.Primrec (Nat.unpaired (Function.swap Nat.pair))


theorem Dense.borel_eq_generateFrom_Ioc_mem {α : Type*} [TopologicalSpace α] [LinearOrder α]
    [OrderTopology α] [SecondCountableTopology α] [DenselyOrdered α] [NoMaxOrder α] {s : Set α}
    (hd : Dense s) :
    borel α = .generateFrom { S : Set α | ∃ l ∈ s, ∃ u ∈ s, l < u ∧ Ioc l u = S }

{α : Type u_5}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[SecondCountableTopology α]
[DenselyOrdered α]
[NoMaxOrder α]
{s : Set α}
(hd : Dense s)

borel α = MeasurableSpace.generateFrom {S | ∃ l ∈ s, ∃ u ∈ s, l < u ∧ Set.Ioc l u = S}


@[simp]
theorem quotQuotEquivComm_symmₐ : (quotQuotEquivCommₐ R I J).symm = quotQuotEquivCommₐ R J I

(R : Type u)
{A : Type u_1}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(I J : Ideal A)

(DoubleQuot.quotQuotEquivCommₐ R I J).symm = DoubleQuot.quotQuotEquivCommₐ R J I


theorem zpow_eq_zpow_emod {x : G} (m : ℤ) {n : ℤ} (h : x ^ n = 1) :
    x ^ m = x ^ (m % n)


theorem disjoint_sSup_right {a : Set α} {b : α} (d : Disjoint b (sSup a)) {i} (hi : i ∈ a) :
    Disjoint b i

{α : Type u_1}
[CompleteLattice α]
{a : Set α}
{b : α}
(d : Disjoint b (sSup a))
{i : α}
(hi : i ∈ a)


@[simp]
theorem map_apply : (map f p) b = ∑' a, if b = f a then p a else 0

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(p : PMF α)
(b : β)

(PMF.map f p) b = ∑' (a : α), if b = f a then p a else 0


theorem rCond_of_bRiemann_eq_false {ι} (l : IntegrationParams) (hl : l.bRiemann = false)
    {r : (ι → ℝ) → Ioi (0 : ℝ)} : l.RCond r

{ι : Type u_2}
(l : BoxIntegral.IntegrationParams)
(hl : l.bRiemann = false)
{r : (ι → ℝ) → ↑(Set.Ioi 0)}


theorem cos_nat_mul_pi_sub (x : ℝ) (n : ℕ) : cos (n * π - x) = (-1) ^ n * cos x

Real.cos (↑n * Real.pi - x) = (-1) ^ n * Real.cos x


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


@[simp] lemma coe_castAddHom : ⇑(castAddHom α) = fun x : ℤ => (x : α)


theorem of_div_rat (h : Irrational (x / q)) : Irrational x

(q : ℚ)
{x : ℝ}
(h : Irrational (x / ↑q))


/-- The shift by zero is naturally isomorphic to the identity. -/
@[simps!]
def shiftZero : shiftFunctor C (0 : S) ≅ 𝟭 (DifferentialObject S C)

(X : CategoryTheory.DifferentialObject S C)

((CategoryTheory.DifferentialObject.shiftZero C).inv.app X).f = (CategoryTheory.shiftFunctorZero C S).inv.app X.obj


theorem lintegral_lt_top_of_nnreal (f : X →ᵇ ℝ≥0) : ∫⁻ x, f x ∂μ < ∞

{X : Type u_1}
[MeasurableSpace X]
[TopologicalSpace X]
(μ : MeasureTheory.Measure X)
[MeasureTheory.IsFiniteMeasure μ]
(f : X →ᵇ ℝ≥0)


theorem Sbtw.not_rotate [NoZeroSMulDivisors R V] {x y z : P} (h : Sbtw R x y z) : ¬Wbtw R z x y

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[OrderedRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
[NoZeroSMulDivisors R V]
{x y z : P}
(h : Sbtw R x y z)


theorem map_functor_eq' {X U : TopCat} (f : U ⟶ X) (hf : OpenEmbedding f) (V) :
    ((Opens.map f).obj <| hf.isOpenMap.functor.obj V) = V

{X U : TopCat}
(f : U ⟶ X)
(hf : OpenEmbedding ⇑f)
(V : TopologicalSpace.Opens ↑U)

(TopologicalSpace.Opens.map f).obj (⋯.functor.obj V) = V


theorem mem_def {a : α} {s : Finmap β} : a ∈ s ↔ a ∈ s.entries.keys

{α : Type u}
{β : α → Type v}
{a : α}
{s : Finmap β}


theorem smoothOn_snd {s : Set (M × N)} : SmoothOn (I.prod J) J Prod.snd 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]
{F : Type u_11}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_12}
[TopologicalSpace G]
{J : ModelWithCorners 𝕜 F G}
{N : Type u_13}
[TopologicalSpace N]
[ChartedSpace G N]
{s : Set (M × N)}


theorem limit.map_post {D : Type u'} [Category.{v'} D] [HasLimitsOfShape J D] (H : C ⥤ D) :
    /- H (limit F) ⟶ H (limit G) ⟶ limit (G ⋙ H) vs
     H (limit F) ⟶ limit (F ⋙ H) ⟶ limit (G ⋙ H) -/
    H.map (limMap α) ≫ limit.post G H = limit.post F H ≫ limMap (whiskerRight α H)

H.map (CategoryTheory.Limits.limMap α) ≫ CategoryTheory.Limits.limit.post G H =
  CategoryTheory.Limits.limit.post F H ≫ CategoryTheory.Limits.limMap (CategoryTheory.whiskerRight α H)


lemma homologySequence_epi_shift_map_mor₁_iff :
    Epi ((F.shift n₀).map T.mor₁) ↔ (F.shift n₀).map T.mor₂ = 0

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

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

CategoryTheory.Epi ((F.shift n₀).map T.mor₁) ↔ (F.shift n₀).map T.mor₂ = 0


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

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

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


lemma card_sdiff_comm (h : s.card = t.card) : (s \ t).card = (t \ s).card

{α : Type u_1}
{s t : Finset α}
[DecidableEq α]
(h : s.card = t.card)


/-- Restriction of a monoid hom to a submonoid of the codomain. -/
@[to_additive (attr := simps apply)
  "Restriction of an `AddMonoid` hom to an `AddSubmonoid` of the codomain."]
def codRestrict {S} [SetLike S N] [SubmonoidClass S N] (f : M →* N) (s : S) (h : ∀ x, f x ∈ s) :
    M →* s

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{S : Type u_6}
[SetLike S N]
[SubmonoidClass S N]
(f : M →* N)
(s : S)
(h : ∀ (x : M), f x ∈ s)
(n : M)


@[simp]
theorem map_coe (op : β → γ) (f : α → β) : map op (f : Germ l β) = op ∘ f

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{l : Filter α}
(op : β → γ)
(f : α → β)