/-- The pure tensors (i.e. the elements of the image of `PiTensorProduct.tprod`) span
the tensor product. -/
theorem span_tprod_eq_top :
    Submodule.span R (Set.range (tprod R)) = (⊤ : Submodule R (⨂[R] i, s i))

{ι : Type u_1}
{R : Type u_4}
[CommSemiring R]
{s : ι → Type u_7}
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]

Submodule.span R (Set.range ⇑(PiTensorProduct.tprod R)) = ⊤


@[simp]
theorem map_int_add (m : ℤ) (x : ℝ) : f (m + x) = m + f x


/-- The canonical isomorphism relating `(Cospan f g).op` and `Span f.op g.op` -/
@[simps!]
def opCospan {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) :
    (cospan f g).op ≅ walkingCospanOpEquiv.functor ⋙ span f.op g.op

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

∀ (X_1 : CategoryTheory.Limits.WalkingCospanᵒᵖ),
  (CategoryTheory.Limits.opCospan f g).hom.app X_1 =
    (Option.rec (CategoryTheory.Iso.refl (Opposite.op Z))
        (fun val =>
          CategoryTheory.Limits.WalkingPair.rec (CategoryTheory.Iso.refl (Opposite.op X))
            (CategoryTheory.Iso.refl (Opposite.op Y)) val)
        (Opposite.unop X_1)).inv


theorem Matrix.toLinearMap₂'_comp (M : Matrix n m R) (P : Matrix n n' R) (Q : Matrix m m' R) :
    LinearMap.compl₁₂ (Matrix.toLinearMap₂' R M) (toLin' P) (toLin' Q) =
      toLinearMap₂' R (Pᵀ * M * Q)

{n : Type u_12}
{m : Type u_13}
{n' : Type u_14}
{m' : Type u_15}
{R : Type u_17}
[CommSemiring R]
[Fintype n]
[Fintype m]
[DecidableEq n]
[DecidableEq m]
[Fintype n']
[Fintype m']
[DecidableEq n']
[DecidableEq m']
(M : Matrix n m R)
(P : Matrix n n' R)
(Q : Matrix m m' R)

((Matrix.toLinearMap₂' R) M).compl₁₂ (Matrix.toLin' P) (Matrix.toLin' Q) = (Matrix.toLinearMap₂' R) (Pᵀ * M * Q)


@[simp]
theorem disjSum_eq_empty : s.disjSum t = ∅ ↔ s = ∅ ∧ t = ∅

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{t : Finset β}


@[simp]
theorem toHamming_symm_eq : (@toHamming _ β).symm = ofHamming


@[simp]
theorem mapRange_single {f : M → N} {hf : f 0 = 0} {a : α} {b : M} :
    mapRange f hf (single a b) = single a (f b)

{α : Type u_1}
{M : Type u_5}
{N : Type u_7}
[Zero M]
[Zero N]
{f : M → N}
{hf : f 0 = 0}
{a : α}
{b : M}

Finsupp.mapRange f hf (Finsupp.single a b) = Finsupp.single a (f b)


@[to_additive (attr := simp) norm_nonneg]
theorem norm_nonneg' (a : E) : 0 ≤ ‖a‖

{E : Type u_6}
[SeminormedGroup E]
(a : E)


@[simp]
theorem _root_.Real.toNNReal_coe {r : ℝ≥0} : Real.toNNReal r = r


/-- Radon-Nikodym derivative with respect to the scalar multiple of a measure.
See also `rnDeriv_smul_right'`, which requires sigma-finite `ν` and `μ`. -/
theorem rnDeriv_smul_right (ν μ : Measure α) [IsFiniteMeasure ν]
    [ν.HaveLebesgueDecomposition μ] {r : ℝ≥0} (hr : r ≠ 0) :
    ν.rnDeriv (r • μ) =ᵐ[μ] r⁻¹ • ν.rnDeriv μ

{α : Type u_1}
{m : MeasurableSpace α}
(ν μ : MeasureTheory.Measure α)
[MeasureTheory.IsFiniteMeasure ν]
[ν.HaveLebesgueDecomposition μ]
{r : ℝ≥0}
(hr : r ≠ 0)


@[to_additive]
theorem MulEquivClass.toMulEquiv_injective [Mul α] [Mul β] [MulEquivClass F α β] :
    Function.Injective ((↑) : F → α ≃* β)

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[EquivLike F α β]
[Add α]
[Add β]
[AddEquivClass F α β]


@[fun_prop]
theorem HasFDerivWithinAt.of_restrictScalars {g' : E →L[𝕜] F} (h : HasFDerivWithinAt f g' s x)
    (H : f'.restrictScalars 𝕜 = g') : HasFDerivWithinAt f f' s x

(H : ContinuousLinearMap.restrictScalars 𝕜 f' = g')


private theorem right_inverse_aux : ∀ n, toFunAux (ofNat s n) = n

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

Nat.Subtype.toFunAux (Nat.Subtype.ofNat s n) = n


theorem mfderiv_sub (hf : MDifferentiableAt I 𝓘(𝕜, E') f z)
    (hg : MDifferentiableAt I 𝓘(𝕜, E') g z) :
    (by exact mfderiv I 𝓘(𝕜, E') (f - g) z : TangentSpace I z →L[𝕜] E') =
      (by exact mfderiv I 𝓘(𝕜, E') f z) - (by exact mfderiv I 𝓘(𝕜, E') g z)

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

mfderiv I 𝓘(𝕜, E') (f - g) z = mfderiv I 𝓘(𝕜, E') f z - mfderiv I 𝓘(𝕜, E') g z


theorem singleton_infs_singleton : ({a} ⊼ {b} : Set α) = {a ⊓ b}

{α : Type u_2}
[SemilatticeInf α]
{a b : α}


@[simp]
lemma opNNNorm_mul_apply (x : 𝕜') : ‖mul 𝕜 𝕜' x‖₊ = ‖x‖₊

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
(𝕜' : Type u_3)
[NonUnitalSeminormedRing 𝕜']
[NormedSpace 𝕜 𝕜']
[IsScalarTower 𝕜 𝕜' 𝕜']
[SMulCommClass 𝕜 𝕜' 𝕜']
[RegularNormedAlgebra 𝕜 𝕜']
(x : 𝕜')

‖(ContinuousLinearMap.mul 𝕜 𝕜') x‖₊ = ‖x‖₊


/-- Specific case of Jensen's inequality for sums of powers -/
theorem pow_sum_div_card_le_sum_pow {f : ι → ℝ} (n : ℕ) (hf : ∀ a ∈ s, 0 ≤ f a) :
    (∑ x ∈ s, f x) ^ (n + 1) / (s.card : ℝ) ^ n ≤ ∑ x ∈ s, f x ^ (n + 1)

{ι : Type u}
(s : Finset ι)
{f : ι → ℝ}
(n : ℕ)
(hf : ∀ a ∈ s, 0 ≤ f a)

(∑ x ∈ s, f x) ^ (n + 1) / ↑s.card ^ n ≤ ∑ x ∈ s, f x ^ (n + 1)


private theorem abs_re_le_abs (z : ℂ) : |z.re| ≤ abs z


@[to_additive (attr := simp, to_additive) (reorder := 1 2, 4 5) ofLex_smul']
theorem pow_ofLex [Pow α β] (a : α) (b : Lex β) : a ^ ofLex b = a ^ b

{β : Type u_2}
{α : Type u_1}
[SMul β α]
(b : Lex β)
(a : α)


/-- Taking the reverse of the product a list of $n$ vectors lifted via `ι` is equivalent to
taking the product of the reverse of that list. -/
theorem reverse_prod_map_ι :
    ∀ l : List M, reverse (l.map <| ι Q).prod = (l.map <| ι Q).reverse.prod

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

CliffordAlgebra.reverse (List.map (⇑(CliffordAlgebra.ι Q)) l).prod = (List.map (⇑(CliffordAlgebra.ι Q)) l).reverse.prod


theorem hasDerivAt_log (hx : x ≠ 0) : HasDerivAt log x⁻¹ x


@[simp]
theorem Differentiable.cosh (hc : Differentiable ℝ f) : Differentiable ℝ fun x => Real.cosh (f x)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
(hc : Differentiable ℝ f)


/-- Version of `hasProd_ite_div_hasProd` for `CommMonoid` rather than `CommGroup`.
Rather than showing that the `ite` expression has a specific product in terms of `HasProd`, it gives
a relationship between the products of `f` and `ite (n = b) 0 (f n)` given that both exist. -/
@[to_additive "Version of `hasSum_ite_sub_hasSum` for `AddCommMonoid` rather than `AddCommGroup`.
Rather than showing that the `ite` expression has a specific sum in terms of `HasSum`,
it gives a relationship between the sums of `f` and `ite (n = b) 0 (f n)` given that both exist."]
theorem eq_mul_of_hasProd_ite {α β : Type*} [TopologicalSpace α] [CommMonoid α] [T2Space α]
    [ContinuousMul α] [DecidableEq β] {f : β → α} {a : α} (hf : HasProd f a) (b : β) (a' : α)
    (hf' : HasProd (fun n ↦ ite (n = b) 1 (f n)) a') : a = a' * f b

(hf' : HasSum (fun n => if n = b then 0 else f n) a')


@[to_additive (attr := simp)]
theorem smul_mem_ae (c : G) {s : Set α} : c • s ∈ ae μ ↔ s ∈ ae μ

[MeasureTheory.SMulInvariantMeasure G α μ]

c • s ∈ MeasureTheory.ae μ ↔ s ∈ MeasureTheory.ae μ


@[simp]
theorem continuousOn_singleton (f : α → β) (a : α) : ContinuousOn f {a}

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
(f : α → β)
(a : α)


@[reassoc (attr := simp)]
lemma hom_inv_id_hom_app (e : F ≅ G) (n : A) (X : C) :
    (e.hom.hom n).app X ≫ (e.inv.hom n).app X = 𝟙 _

{F G : CategoryTheory.SingleFunctors C D A}

(e.hom.hom n).app X ≫ (e.inv.hom n).app X = 𝟙 ((F.functor n).obj X)


theorem dimH_univ (e : X ≃ᵢ Y) : dimH (univ : Set X) = dimH (univ : Set Y)

{X : Type u_2}
{Y : Type u_3}
[EMetricSpace X]
[EMetricSpace Y]
(e : X ≃ᵢ Y)


theorem tendsto_translationNumber_of_dist_bounded_aux (x : ℕ → ℝ) (C : ℝ)
    (H : ∀ n : ℕ, dist ((f ^ n) 0) (x n) ≤ C) :
    Tendsto (fun n : ℕ => x (2 ^ n) / 2 ^ n) atTop (𝓝 <| τ f)

Filter.Tendsto (fun n => x (2 ^ n) / 2 ^ n) Filter.atTop (𝓝 f.translationNumber)


/-- Construct a right unitor from specified limit cones.
-/
@[simps]
def BinaryFan.rightUnitor {X : C} {s : Cone (Functor.empty.{0} C)} (P : IsLimit s)
    {t : BinaryFan X s.pt} (Q : IsLimit t) : t.pt ≅ X

{s : CategoryTheory.Limits.Cone (CategoryTheory.Functor.empty C)}

{t : CategoryTheory.Limits.BinaryFan X s.pt}

(CategoryTheory.Limits.BinaryFan.rightUnitor P Q).hom = t.fst


theorem mem_map_range {R S : Type*} [Ring R] [Ring S] (f : R →+* S) {p : S[X]} :
    p ∈ (mapRingHom f).range ↔ ∀ n, p.coeff n ∈ f.range

{R : Type u_1}
{S : Type u_2}
[Ring R]
[Ring S]
(f : R →+* S)
{p : S[X]}

p ∈ (Polynomial.mapRingHom f).range ↔ ∀ (n : ℕ), p.coeff n ∈ f.range


theorem last_sub (i : Fin (n + 1)) : last n - i = Fin.rev i


/-- Given submodules `M ⊆ R` and `N ⊆ S = M⁻¹R`, with `f : R →+* S` the localization map, if
`N` contains all the units of `S`, then `N ⁻¹ S = T = (f⁻¹ N) ⁻¹ R`. I.e., the localization of a
localization is a localization.
-/
theorem localization_localization_isLocalization_of_has_all_units [IsLocalization N T]
    (H : ∀ x : S, IsUnit x → x ∈ N) : IsLocalization (N.comap (algebraMap R S)) T

{R : Type u_1}
[CommSemiring R]
(M : Submonoid R)
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
(N : Submonoid S)
(T : Type u_4)
[CommSemiring T]
[Algebra R T]
[Algebra S T]
[IsScalarTower R S T]
[IsLocalization M S]
[IsLocalization N T]
(H : ∀ (x : S), IsUnit x → x ∈ N)

IsLocalization (Submonoid.comap (algebraMap R S) N) T


@[to_additive ite_pos]
lemma one_lt_ite [LT α] (ha : 1 < a) (hb : 1 < b) : 1 < ite p a b

{α : Type u_2}
[Zero α]
{p : Prop}
[Decidable p]
{a b : α}
[LT α]
(ha : 0 < a)
(hb : 0 < b)


theorem LinearMap.clmOfExistsBoundedImage_coe {f : E →ₗ[𝕜] F}
    {h : ∃ V ∈ 𝓝 (0 : E), Bornology.IsVonNBounded 𝕜 (f '' V)} :
    (f.clmOfExistsBoundedImage h : E →ₗ[𝕜] F) = f

{h : ∃ V ∈ 𝓝 0, Bornology.IsVonNBounded 𝕜 (⇑f '' V)}


lemma lt_fib_greatestFib_add_one (n : ℕ) : n < fib (greatestFib n + 1)


theorem toL1_smul' (f : α → β) (hf : Integrable f μ) (k : 𝕜) :
    toL1 (k • f) (hf.smul k) = k • toL1 f hf

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
{𝕜 : Type u_5}
[NormedRing 𝕜]
[Module 𝕜 β]
[BoundedSMul 𝕜 β]
(f : α → β)
(hf : MeasureTheory.Integrable f μ)
(k : 𝕜)

MeasureTheory.Integrable.toL1 (k • f) ⋯ = k • MeasureTheory.Integrable.toL1 f hf


theorem isintCast {R} [Ring R] (n m : ℤ) :
    IsInt n m → IsInt (n : R) m

Mathlib.Meta.NormNum.IsInt n m → Mathlib.Meta.NormNum.IsInt (↑n) m


theorem maximum_ne_bot_of_ne_nil (h : l ≠ []) : l.maximum ≠ ⊥

{α : Type u_1}
[LinearOrder α]
{l : List α}
(h : l ≠ [])


/-- `±α` are the only `K`-multiples of a root `α` that are also (non-zero) roots. -/
lemma eq_neg_or_eq_of_eq_smul (hβ : β.IsNonZero) (k : K) (h : (β : H → K) = k • α) :
    β = -α ∨ β = α

{K : Type u_1}
{L : Type u_2}
[Field K]
[CharZero K]
[LieRing L]
[LieAlgebra K L]
[LieAlgebra.IsKilling K L]
[FiniteDimensional K L]
{H : LieSubalgebra K L}
[H.IsCartanSubalgebra]
[LieModule.IsTriangularizable K (↥H) L]
(α β : LieModule.Weight K (↥H) L)
(hβ : β.IsNonZero)
(k : K)
(h : ⇑β = k • ⇑α)

β = -α ∨ β = α


theorem add_one_le_ceil_iff : n + 1 ≤ ⌈a⌉₊ ↔ (n : α) < a

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
{a : α}
{n : ℕ}


theorem trace_prodMap :
    trace R (M × N) ∘ₗ prodMapLinear R M N M N R =
      (coprod id id : R × R →ₗ[R] R) ∘ₗ prodMap (trace R M) (trace R N)

(R : Type u_1)
[CommRing R]
(M : Type u_2)
[AddCommGroup M]
[Module R M]
(N : Type u_3)
[AddCommGroup N]
[Module R N]
[Module.Free R M]
[Module.Finite R M]
[Module.Free R N]
[Module.Finite R N]

LinearMap.trace R (M × N) ∘ₗ LinearMap.prodMapLinear R M N M N R =
  LinearMap.id.coprod LinearMap.id ∘ₗ (LinearMap.trace R M).prodMap (LinearMap.trace R N)


theorem Codisjoint.map (h : Codisjoint a b) : Codisjoint (f a) (f b)

{F : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Lattice α]
[BoundedOrder α]
[Lattice β]
[BoundedOrder β]
[FunLike F α β]
[BoundedLatticeHomClass F α β]
(f : F)
{a b : α}
(h : Codisjoint a b)


/-- When taking the supremum of `f : ι → α`, the elements of `ι` on which `f` gives `⊥` can be
dropped, without changing the result. -/
@[simp]
theorem iSup_ne_bot_subtype (f : ι → α) : ⨆ i : { i // f i ≠ ⊥ }, f i = ⨆ i, f i

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


@[simp] theorem endofunctorMonoidalCategory_leftUnitor_hom_app (F : C ⥤ C) (X : C) :
  (λ_ F).hom.app X = 𝟙 _

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

(CategoryTheory.MonoidalCategory.leftUnitor F).hom.app X =
  CategoryTheory.CategoryStruct.id
    ((CategoryTheory.MonoidalCategory.tensorObj (𝟙_ (CategoryTheory.Functor C C)) F).obj X)


@[simp]
theorem comp_id (f : BiheytingHom α β) : f.comp (BiheytingHom.id α) = f

{α : Type u_2}
{β : Type u_3}
[BiheytingAlgebra α]
[BiheytingAlgebra β]
(f : BiheytingHom α β)


protected theorem Pairwise.insert (hs : s.Pairwise r) (h : ∀ b ∈ s, a ≠ b → r a b ∧ r b a) :
    (insert a s).Pairwise r

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
{a : α}
(hs : s.Pairwise r)
(h : ∀ b ∈ s, a ≠ b → r a b ∧ r b a)


@[to_additive (attr := simp)]
theorem inv_mul_cancel_left (a b : G) : a⁻¹ * (a * b) = b


@[simp] lemma C_smul (t : R) (m : AEval R M a) : C t • m = t • m

{R : Type u_1}
{A : Type u_3}
{M : Type u_2}
[CommSemiring R]
[Semiring A]
(a : A)
[Algebra R A]
[AddCommMonoid M]
[Module A M]
[Module R M]
[IsScalarTower R A M]
(t : R)
(m : Module.AEval R M a)


@[simp]
theorem sup_principal {s t : Set α} : 𝓟 s ⊔ 𝓟 t = 𝓟 (s ∪ t)


/-- The composition of two strong monomorphisms is a strong monomorphism. -/
theorem strongMono_comp [StrongMono f] [StrongMono g] : StrongMono (f ≫ g)

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

CategoryTheory.StrongMono (CategoryTheory.CategoryStruct.comp f g)


lemma forall_lt_iff_eq_top {x : WithTop α} : (∀ y : α, y < x) ↔ x = ⊤

{α : Type u_1}
[Preorder α]
{x : WithTop α}


theorem comap_neBot_iff {f : Filter β} {m : α → β} : NeBot (comap m f) ↔ ∀ t ∈ f, ∃ a, m a ∈ t

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

(Filter.comap m f).NeBot ↔ ∀ t ∈ f, ∃ a, m a ∈ t


@[to_additive (attr := simp) addCentralizer_addCentralizer_addCentralizer]
lemma centralizer_centralizer_centralizer (S : Set M) :
    S.centralizer.centralizer.centralizer = S.centralizer


@[simp]
theorem symm_mk (f h₁ h₂ h₃ h₄) :
    (⟨⟨⟨e, h₁⟩, h₂⟩, f, h₃, h₄⟩ : M ≃ₛₗ[σ] M₂).symm =
      { symm_mk.aux e f h₁ h₂ h₃ h₄ with
        toFun := f
        invFun := e }

(h₁ : ∀ (x y : M), e (x + y) = e x + e y)

(h₂ : ∀ (m : R) (x : M), { toFun := ⇑e, map_add' := h₁ }.toFun (m • x) = σ m • { toFun := ⇑e, map_add' := h₁ }.toFun x)

(h₃ : Function.LeftInverse f { toFun := ⇑e, map_add' := h₁, map_smul' := h₂ }.toFun)

(h₄ : Function.RightInverse f { toFun := ⇑e, map_add' := h₁, map_smul' := h₂ }.toFun)

{ toFun := ⇑e, map_add' := h₁, map_smul' := h₂, invFun := f, left_inv := h₃, right_inv := h₄ }.symm =
  let __src := LinearEquiv.symm_mk.aux e f h₁ h₂ h₃ h₄;
  { toFun := f, map_add' := ⋯, map_smul' := ⋯, invFun := ⇑e, left_inv := ⋯, right_inv := ⋯ }


@[simp]
theorem filter_subset (s : Finset α) : s.filter p ⊆ s

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


theorem deriv_inv : deriv (fun x => x⁻¹) x = -(x ^ 2)⁻¹

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}


theorem all_iff {t : RBNode α} : t.all p ↔ t.All (p ·)

{α : Type u_1}
{p : α → Bool}
{t : Batteries.RBNode α}

Batteries.RBNode.all p t = true ↔ Batteries.RBNode.All (fun x => p x = true) t


theorem image_eq_image {f : α → β} (hf : Injective f) : f '' s = f '' t ↔ s = t

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


theorem add_lt_add_of_lt_of_le' {x y z t : EReal} (h : x < y) (h' : z ≤ t) (hbot : t ≠ ⊥)
    (htop : t = ⊤ → z = ⊤ → x = ⊥) : x + z < y + t


theorem toGHSpace_lipschitz :
    LipschitzWith 1 (NonemptyCompacts.toGHSpace : NonemptyCompacts X → GHSpace)


theorem singularPart_add_withDensity_rnDeriv_eq [c.HaveLebesgueDecomposition μ] :
    c.singularPart μ + μ.withDensityᵥ (c.rnDeriv μ) = c

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{c : MeasureTheory.ComplexMeasure α}
[c.HaveLebesgueDecomposition μ]


theorem eqOn_dslope_sub_smul (f : 𝕜 → E) (a : 𝕜) :
    EqOn (dslope (fun x => (x - a) • f x) a) f {a}ᶜ

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

Set.EqOn (dslope (fun x => (x - a) • f x) a) f {a}ᶜ


theorem removeNone_some {x : α} (h : ∃ x', e (some x) = some x') :
    some (removeNone e x) = e (some x)

{α : Type u_1}
{β : Type u_2}
(e : Option α ≃ Option β)
{x : α}
(h : ∃ x', e (some x) = some x')


@[measurability]
theorem Measurable.fract [BorelSpace R] {f : α → R} (hf : Measurable f) :
    Measurable fun x => Int.fract (f x)

{α : Type u_1}
{R : Type u_2}
[MeasurableSpace α]
[LinearOrderedRing R]
[FloorRing R]
[TopologicalSpace R]
[OrderTopology R]
[MeasurableSpace R]
[BorelSpace R]
{f : α → R}
(hf : Measurable f)


/-- A dependent version of `Submonoid.closure_induction`.  -/
@[to_additive (attr := elab_as_elim) "A dependent version of `AddSubmonoid.closure_induction`. "]
theorem closure_induction' (s : Set M) {p : ∀ x, x ∈ closure s → Prop}
    (mem : ∀ (x) (h : x ∈ s), p x (subset_closure h)) (one : p 1 (one_mem _))
    (mul : ∀ x hx y hy, p x hx → p y hy → p (x * y) (mul_mem hx hy)) {x} (hx : x ∈ closure s) :
    p x hx

{p : (x : M) → x ∈ AddSubmonoid.closure s → Prop}

(mul :
  ∀ (x : M) (hx : x ∈ AddSubmonoid.closure s) (y : M) (hy : y ∈ AddSubmonoid.closure s), p x hx → p y hy → p (x + y) ⋯)


@[simp]
theorem ofLeftInverse_symm_apply {g : S → R} {f : R →+* S} (h : Function.LeftInverse g f)
    (x : f.range) : (ofLeftInverse h).symm x = g x

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
{g : S → R}
{f : R →+* S}
(h : Function.LeftInverse g ⇑f)
(x : ↥f.range)

(RingEquiv.ofLeftInverse h).symm x = g ↑x


lemma SurjOn.iterate {f : α → α} {s : Set α} (h : SurjOn f s s) : ∀ n, SurjOn f^[n] s s

{α : Type u_1}
{f : α → α}
{s : Set α}
(h : Set.SurjOn f s s)
(n : ℕ)


theorem zero_smul_filter_nonpos : (0 : α) • g ≤ 0

{α : Type u_2}
{β : Type u_3}
[Zero α]
[Zero β]
[SMulWithZero α β]
{g : Filter β}


@[to_additive]
theorem Function.Injective.hasProd_iff {g : γ → β} (hg : Injective g)
    (hf : ∀ x, x ∉ Set.range g → f x = 1) : HasProd (f ∘ g) a ↔ HasProd f a

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[CommMonoid α]
[TopologicalSpace α]
{f : β → α}
{a : α}
{g : γ → β}
(hg : Function.Injective g)
(hf : ∀ x ∉ Set.range g, f x = 1)


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


theorem splitUpper_le : I.splitUpper i x ≤ I

{ι : Type u_1}
{I : BoxIntegral.Box ι}
{i : ι}
{x : ℝ}


/-- The complex cosine function is everywhere differentiable, with the derivative `-sin x`. -/
theorem hasDerivAt_cos (x : ℂ) : HasDerivAt cos (-sin x) x

HasDerivAt Complex.cos (-Complex.sin x) x


/-- Vertical composition of modifications. -/
@[simps]
def vcomp (Γ : Modification η θ) (Δ : Modification θ ι) : Modification η ι

(Γ : CategoryTheory.OplaxNatTrans.Modification η θ)

(Δ : CategoryTheory.OplaxNatTrans.Modification θ ι)

(Γ.vcomp Δ).app a = CategoryTheory.CategoryStruct.comp (Γ.app a) (Δ.app a)


theorem lt_of_pow_lt_pow_left (n : ℕ) (hb : 0 ≤ b) (h : a ^ n < b ^ n) : a < b

{R : Type u_3}
[LinearOrderedSemiring R]
{a b : R}
(n : ℕ)
(hb : 0 ≤ b)
(h : a ^ n < b ^ n)


/-- To prove associativity of a commutative binary operation `○`, we only to check
`(a ○ b) ○ c ≤ a ○ (b ○ c)` for all `a`, `b`, `c`. -/
theorem associative_of_commutative_of_le {f : α → α → α} (comm : Commutative f)
    (assoc : ∀ a b c, f (f a b) c ≤ f a (f b c)) : Associative f

{f : α → α → α}

(assoc : ∀ (a b c : α), f (f a b) c ≤ f a (f b c))


protected theorem neg_eq_neg_one_mul : ∀ a : Int, -a = -1 * a


theorem eventually_filterAt_measurableSet (x : α) : ∀ᶠ a in v.filterAt x, MeasurableSet a

{α : Type u_1}
[MetricSpace α]
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(v : VitaliFamily μ)
(x : α)

∀ᶠ (a : Set α) in v.filterAt x, MeasurableSet a


/-- The pigeonhole principle for finitely many pigeons counted by heads: given a function between
finite sets `s` and `t` and a number `b` such that `card t • b ≤ card s`, there exists `y ∈ t` such
that its preimage in `s` has at least `b` elements.
See also `Finset.exists_lt_card_fiber_of_nsmul_lt_card_of_maps_to` for a stronger statement. -/
theorem exists_le_card_fiber_of_nsmul_le_card_of_maps_to (hf : ∀ a ∈ s, f a ∈ t) (ht : t.Nonempty)
    (hb : t.card • b ≤ s.card) : ∃ y ∈ t, b ≤ (s.filter fun x => f x = y).card

{α : Type u}
{β : Type v}
{M : Type w}
[DecidableEq β]
{s : Finset α}
{t : Finset β}
{f : α → β}
{b : M}
[LinearOrderedCommSemiring M]
(hf : ∀ a ∈ s, f a ∈ t)
(ht : t.Nonempty)
(hb : t.card • b ≤ ↑s.card)

∃ y ∈ t, b ≤ ↑(Finset.filter (fun x => f x = y) s).card


protected theorem bijective : Bijective f

{α : Sort u}
{f : α → α}
(h : Function.Involutive f)


theorem IsNormal.eq_iff_zero_and_succ {f g : Ordinal.{u} → Ordinal.{u}} (hf : IsNormal f)
    (hg : IsNormal g) : f = g ↔ f 0 = g 0 ∧ ∀ a, f a = g a → f (succ a) = g (succ a)

{f g : Ordinal.{u} → Ordinal.{u}}
(hf : Ordinal.IsNormal f)
(hg : Ordinal.IsNormal g)

f = g ↔ f 0 = g 0 ∧ ∀ (a : Ordinal.{u}), f a = g a → f (Order.succ a) = g (Order.succ a)


@[simp]
theorem centralizer_centralizer (S : VonNeumannAlgebra H) :
    Set.centralizer (Set.centralizer (S : Set (H →L[ℂ] H))) = S

{H : Type u}
[NormedAddCommGroup H]
[InnerProductSpace ℂ H]
[CompleteSpace H]
(S : VonNeumannAlgebra H)


theorem not_limZero_of_not_congr_zero {f : CauSeq _ abv} (hf : ¬f ≈ 0) : ¬LimZero f

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
{f : CauSeq β abv}
(hf : ¬f ≈ 0)


theorem interval_average_symm (f : ℝ → E) (a b : ℝ) : (⨍ x in a..b, f x) = ⨍ x in b..a, f x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(f : ℝ → E)
(a b : ℝ)

⨍ (x : ℝ) in a..b, f x = ⨍ (x : ℝ) in b..a, f x


@[reassoc (attr := simp)]
lemma whiskerLeft_app_fst (F₁ : J ⥤ C) {F₂ F₂' : J ⥤ C} (g : F₂ ⟶ F₂') (j : J) :
    (F₁ ◁ g).app j ≫ fst _ _ = fst _ _

{J : Type u_1}
{C : Type u_2}
[CategoryTheory.Category.{u_3, u_1} J]
[CategoryTheory.Category.{u_4, u_2} C]
[CategoryTheory.ChosenFiniteProducts C]
(F₁ : CategoryTheory.Functor J C)
{F₂ F₂' : CategoryTheory.Functor J C}
(g : F₂ ⟶ F₂')
(j : J)

CategoryTheory.CategoryStruct.comp ((CategoryTheory.MonoidalCategory.whiskerLeft F₁ g).app j)
    (CategoryTheory.ChosenFiniteProducts.fst (F₁.obj j) (F₂'.obj j)) =
  CategoryTheory.ChosenFiniteProducts.fst (F₁.obj j) (F₂.obj j)


@[gcongr]
theorem drop_sublist_drop_left (l : List α) {m n : ℕ} (h : m ≤ n) : drop n l <+ drop m l

{α : Type u_1}
(l : List α)
{m n : ℕ}
(h : m ≤ n)


@[simp]
theorem midpoint_eq_left_iff {x y : P} : midpoint R x y = x ↔ x = y

(R : Type u_1)
{V : Type u_2}
{P : Type u_4}
[Ring R]
[Invertible 2]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{x y : P}


@[measurability]
theorem measurableSet_le' : MeasurableSet { p : α × α | p.1 ≤ p.2 }

{α : Type u_1}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[PartialOrder α]
[OrderClosedTopology α]
[SecondCountableTopology α]


/-- An ordinal lifted to the zero universe equals itself. -/
@[simp]
theorem lift_uzero (a : Ordinal.{u}) : lift.{0} a = a


@[simp 1100]
theorem map_id_obj' (U) (p) : (map (𝟙 X)).obj ⟨U, p⟩ = ⟨U, p⟩

{X : TopCat}
(U : Set ↑X)
(p : IsOpen U)

(TopologicalSpace.Opens.map (𝟙 X)).obj { carrier := U, is_open' := p } = { carrier := U, is_open' := p }


theorem taylor_injective {R} [CommRing R] (r : R) : Function.Injective (taylor r)


@[simp] theorem smul_imI : (s • a).imI = s • a.imI

{S : Type u_1}
{R : Type u_3}
{c₁ c₂ : R}
(a : ℍ[R,c₁,c₂])
[SMul S R]
(s : S)


/-- If `X` is isomorphic to `X₁` and `Y` is isomorphic to `Y₁`, then
there is a natural bijection between `X ⟶ Y` and `X₁ ⟶ Y₁`. See also `Equiv.arrowCongr`. -/
@[simps]
def homCongr {X Y X₁ Y₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) : (X ⟶ Y) ≃ (X₁ ⟶ Y₁)

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

(α.homCongr β) f = CategoryTheory.CategoryStruct.comp α.inv (CategoryTheory.CategoryStruct.comp f β.hom)


@[to_additive (attr := simp) natAbs_nsmul_eq_zero]
lemma pow_natAbs_eq_one : a ^ n.natAbs = 1 ↔ a ^ n = 1

{G : Type u_3}
[AddGroup G]
{a : G}
{n : ℤ}


/-- If a measure `μ` on a quotient satisfies `QuotientMeasureEqMeasurePreimage` with respect to a
sigma-finite measure `ν`, then it is itself `SigmaFinite`. -/
@[to_additive]
lemma QuotientMeasureEqMeasurePreimage.sigmaFiniteQuotient
    [i : SigmaFinite ν] [i' : HasFundamentalDomain G α ν]
    (μ : Measure (Quotient α_mod_G)) [QuotientMeasureEqMeasurePreimage ν μ] :
    SigmaFinite μ

[MeasureTheory.SMulInvariantMeasure G α ν]

[i' : MeasureTheory.HasFundamentalDomain G α ν]

(μ : MeasureTheory.Measure (Quotient (MulAction.orbitRel G α)))


@[fun_prop, aesop unsafe 30% apply (rule_sets := [Measurable])]
theorem Measurable.aemeasurable (h : Measurable f) : AEMeasurable f μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
[MeasurableSpace β]
{f : α → β}
{μ : MeasureTheory.Measure α}
(h : Measurable f)


(K : Type u_3)
[Field K]
{R₁ : Type u_4}
[CommRing R₁]
[IsDomain R₁]
[Algebra R₁ K]
[IsFractionRing R₁ K]
{I : FractionalIdeal R₁⁰ K}


@[simp]
theorem map_constants (φ : M →[L] N) (c : L.Constants) : φ c = c

{L : FirstOrder.Language}
{M : Type w}
{N : Type w'}
[L.Structure M]
[L.Structure N]
(φ : L.Hom M N)
(c : L.Constants)


protected theorem nontrivial {I : Ideal R} (hI : I ≠ ⊤) : Nontrivial (R ⧸ I)

{R : Type u}
[CommRing R]
{I : Ideal R}
(hI : I ≠ ⊤)


@[simp] theorem toList_mapKey (f : α → δ) (l : AssocList α β) :
    (mapKey f l).toList = l.toList.map (fun (a, b) => (f a, b))

{α : Type u_1}
{δ : Type u_2}
{β : Type u_3}
(f : α → δ)
(l : Batteries.AssocList α β)

(Batteries.AssocList.mapKey f l).toList =
  List.map
    (fun x =>
      match x with
      | (a, b) => (f a, b))
    l.toList


theorem map_lift_eq2 {g : Set β → Filter γ} {m : α → β} (hg : Monotone g) :
    (map m f).lift g = f.lift (g ∘ image m)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : Filter α}
{g : Set β → Filter γ}
{m : α → β}
(hg : Monotone g)

(Filter.map m f).lift g = f.lift (g ∘ Set.image m)


theorem cardFactors_apply {n : ℕ} : Ω n = n.primeFactorsList.length

ArithmeticFunction.cardFactors n = n.primeFactorsList.length


theorem curryFinFinset_apply_const {k l n : ℕ} {s : Finset (Fin n)} (hk : s.card = k)
    (hl : sᶜ.card = l) (f : MultilinearMap R (fun _ : Fin n => M') M₂) (x y : M') :
    (curryFinFinset R M₂ M' hk hl f (fun _ => x) fun _ => y) =
      f (s.piecewise (fun _ => x) fun _ => y)

{R : Type uR}
{M₂ : Type v₂}
{M' : Type v'}
[CommSemiring R]
[AddCommMonoid M']
[AddCommMonoid M₂]
[Module R M']
[Module R M₂]
{k l n : ℕ}
{s : Finset (Fin n)}
(hk : s.card = k)
(hl : sᶜ.card = l)
(f : MultilinearMap R (fun x => M') M₂)
(x y : M')

((((MultilinearMap.curryFinFinset R M₂ M' hk hl) f) fun x_1 => x) fun x => y) =
  f (s.piecewise (fun x_1 => x) fun x => y)


theorem inv_antitoneOn_Iio :
    AntitoneOn (fun x : α ↦ x⁻¹) (Set.Iio 0)


theorem Directed.mono_comp (r : α → α → Prop) {ι} {rb : β → β → Prop} {g : α → β} {f : ι → α}
    (hg : ∀ ⦃x y⦄, r x y → rb (g x) (g y)) (hf : Directed r f) : Directed rb (g ∘ f)

(hg : ∀ ⦃x y : α⦄, r x y → rb (g x) (g y))


lemma sumOfConjugates_apply (v : W) : π.sumOfConjugates G v = ∑ g : G, π.conjugate g v

{k : Type u}
[CommRing k]
(G : Type u)
[Group G]
{V : Type v}
[AddCommGroup V]
[Module k V]
[Module (MonoidAlgebra k G) V]
[IsScalarTower k (MonoidAlgebra k G) V]
{W : Type w}
[AddCommGroup W]
[Module k W]
[Module (MonoidAlgebra k G) W]
[IsScalarTower k (MonoidAlgebra k G) W]
(π : W →ₗ[k] V)
[Fintype G]
(v : W)

(LinearMap.sumOfConjugates G π) v = ∑ g : G, (π.conjugate g) v


theorem nnnorm_star_mul_self {x : E} : ‖x⋆ * x‖₊ = ‖x‖₊ * ‖x‖₊

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

‖x⋆ * x‖₊ = ‖x‖₊ * ‖x‖₊


lemma center_units_subset : center G₀ˣ ⊆ ((↑) : G₀ˣ → G₀) ⁻¹' center G₀

Set.center G₀ˣ ⊆ Units.val ⁻¹' Set.center G₀


theorem min_lt_min_right_iff : min a b < min a c ↔ b < c ∧ b < a

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


theorem isLeast_csInf (hs : s.Nonempty) : IsLeast s (sInf s)

{α : Type u_1}
[ConditionallyCompleteLinearOrder α]
{s : Set α}
[IsWellOrder α fun x x_1 => x < x_1]
(hs : s.Nonempty)


theorem comp (hg : RightOrdContinuous g) (hf : RightOrdContinuous f) : RightOrdContinuous (g ∘ f)

{α : Type u}
{β : Type v}
{γ : Type w}
[Preorder α]
[Preorder β]
[Preorder γ]
{g : β → γ}
{f : α → β}
(hg : RightOrdContinuous g)
(hf : RightOrdContinuous f)


theorem mem_nhdsSet_empty : s ∈ 𝓝ˢ (∅ : Set X)

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


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

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p₁ p₂ p₃ : P}
(h : ∠ p₁ p₂ p₃ = π / 2)


theorem setLIntegral_empty (f : α → ℝ≥0∞) : ∫⁻ x in ∅, f x ∂μ = 0

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


lemma EssFiniteType.aux (σ : Subalgebra R S)
    (hσ : ∀ s : S, ∃ t ∈ σ, IsUnit t ∧ s * t ∈ σ)
    (τ : Set T) (t : T) (ht : t ∈ Algebra.adjoin S τ) :
    ∃ s ∈ σ, IsUnit s ∧ s • t ∈ σ.map (IsScalarTower.toAlgHom R S T) ⊔ Algebra.adjoin R τ

(hσ : ∀ (s : S), ∃ t ∈ σ, IsUnit t ∧ s * t ∈ σ)

∃ s ∈ σ, IsUnit s ∧ s • t ∈ Subalgebra.map (IsScalarTower.toAlgHom R S T) σ ⊔ Algebra.adjoin R τ


/-- The forward direction of `isLocalizedModule_iff_isBaseChange`. It is also used to prove the
other direction. -/
theorem IsLocalizedModule.isBaseChange [IsLocalizedModule S f] : IsBaseChange A f

{R : Type u_1}
[CommSemiring R]
(S : Submonoid R)
(A : Type u_2)
[CommRing A]
[Algebra R A]
[IsLocalization S A]
{M : Type u_3}
[AddCommMonoid M]
[Module R M]
{M' : Type u_4}
[AddCommMonoid M']
[Module R M']
[Module A M']
[IsScalarTower R A M']
(f : M →ₗ[R] M')
[IsLocalizedModule S f]


theorem toBaseChange_comp_involute (Q : QuadraticForm R V) :
    (toBaseChange A Q).comp (involute : CliffordAlgebra (Q.baseChange A) →ₐ[A] _) =
      (Algebra.TensorProduct.map (AlgHom.id _ _) involute).comp (toBaseChange A Q)

{R : Type u_1}
(A : Type u_2)
{V : Type u_3}
[CommRing R]
[CommRing A]
[AddCommGroup V]
[Algebra R A]
[Module R V]
[Invertible 2]
(Q : QuadraticForm R V)

(CliffordAlgebra.toBaseChange A Q).comp CliffordAlgebra.involute =
  (Algebra.TensorProduct.map (AlgHom.id A A) CliffordAlgebra.involute).comp (CliffordAlgebra.toBaseChange A Q)


/-- Closure of a subfield `S` equals `S`. -/
theorem closure_eq (s : Subfield K) : closure (s : Set K) = s

{K : Type u}
[DivisionRing K]
(s : Subfield K)


protected theorem StrictAnti.comp (hg : StrictAnti g) (hf : StrictAnti f) : StrictMono (g ∘ f)

{α : Type u}
{β : Type v}
{γ : Type w}
[Preorder α]
[Preorder β]
[Preorder γ]
{g : β → γ}
{f : α → β}
(hg : StrictAnti g)
(hf : StrictAnti f)


theorem nhdsWithin_le_nhds {a : α} {s : Set α} : 𝓝[s] a ≤ 𝓝 a

{α : Type u_1}
[TopologicalSpace α]
{a : α}
{s : Set α}


/-- The canonical map from the restriction to the subspace. -/
@[simps! val_base, simps! (config := .lemmasOnly) val_c_app]
def Scheme.ofRestrict : X.restrict h ⟶ X

{f : U ⟶ TopCat.of ↑↑X.toPresheafedSpace}


theorem im_tsum {f : α → ℂ} (h : Summable f) : (∑' a, f a).im = ∑' a, (f a).im

{α : Type u_1}
{f : α → ℂ}
(h : Summable f)


theorem get?_enumFrom (n) (l : List α) (m) :
    get? (enumFrom n l) m = (get? l m).map fun a => (n + m, a)

{α : Type u_1}
(n : ℕ)
(l : List α)
(m : ℕ)

(List.enumFrom n l).get? m = Option.map (fun a => (n + m, a)) (l.get? m)


@[simp] lemma mk'_pow (num : ℤ) (den : ℕ) (hd hdn) (n : ℕ) :
    mk' num den hd hdn ^ n = mk' (num ^ n) (den ^ n)
      (by simp [Nat.pow_eq_zero, hd]) (by rw [Int.natAbs_pow]; exact hdn.pow _ _)

(num : ℤ)
(den : ℕ)
(hd : den ≠ 0)
(hdn : num.natAbs.Coprime den)
(n : ℕ)

{ num := num, den := den, den_nz := hd, reduced := hdn } ^ n =
  { num := num ^ n, den := den ^ n, den_nz := ⋯, reduced := ⋯ }


theorem le_def [LT ι] [∀ i, LE (α i)] {a b : Σₗ i, α i} :
    a ≤ b ↔ a.1 < b.1 ∨ ∃ h : a.1 = b.1, h.rec a.2 ≤ b.2

{ι : Type u_1}
{α : ι → Type u_2}
[LT ι]
[(i : ι) → LE (α i)]
{a b : Σₗ (i : ι), α i}

a ≤ b ↔ a.fst < b.fst ∨ ∃ h, h ▸ a.snd ≤ b.snd


theorem closedBall_eq_preimage (x : E) (r : ℝ) :
    closedBall x r = toEuclidean ⁻¹' Metric.closedBall (toEuclidean x) r

{E : Type u_1}
[AddCommGroup E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[T2Space E]
[Module ℝ E]
[ContinuousSMul ℝ E]
[FiniteDimensional ℝ E]
(x : E)
(r : ℝ)

Euclidean.closedBall x r = ⇑toEuclidean ⁻¹' Metric.closedBall (toEuclidean x) r


theorem iInf_dite (f : ∀ i, p i → α) (g : ∀ i, ¬p i → α) :
    ⨅ 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_5}
[CompleteLattice α]
(p : ι → Prop)
[DecidablePred p]
(f : (i : ι) → p i → α)
(g : (i : ι) → ¬p i → α)

(⨅ 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


theorem takeI_eq_take : ∀ {n} {l : List α}, n ≤ length l → takeI n l = take n l

{α : Type u}
[Inhabited α]
{n : ℕ}
{l : List α}

n ≤ l.length → List.takeI n l = List.take n l


theorem toNonUnitalSubsemiring_inj {S U : NonUnitalSubalgebra R A} :
    S.toNonUnitalSubsemiring = U.toNonUnitalSubsemiring ↔ S = U

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


@[to_additive]
theorem mul_bddBelow_range_add {p q : GroupSeminorm E} {x : E} :
    BddBelow (range fun y => p y + q (x / y))

{E : Type u_4}
[CommGroup E]
{p q : GroupSeminorm E}
{x : E}

BddBelow (Set.range fun y => p y + q (x / y))


theorem take_drop : ∀ (m n : Nat) (l : List α), take n (drop m l) = drop m (take (m + n) l)

List.take n (List.drop m l) = List.drop m (List.take (m + n) l)


/-- Proper group action in the sense of Bourbaki:
the map `G × X → X × X` is a proper map (see `IsProperMap`). -/
@[to_additive existing (attr := mk_iff)]
class ProperSMul (G X : Type*) [TopologicalSpace G] [TopologicalSpace X] [Group G]
    [MulAction G X] : Prop where
  /-- Proper group action in the sense of Bourbaki:
  the map `G × X → X × X` is a proper map (see `IsProperMap`). -/
  isProperMap_smul_pair : IsProperMap (fun gx ↦ (gx.1 • gx.2, gx.2) : G × X → X × X)

(G : Type u_1)
(X : Type u_2)
[TopologicalSpace G]
[TopologicalSpace X]
[AddGroup G]
[AddAction G X]

ProperVAdd G X ↔ IsProperMap fun gx => (gx.1 +ᵥ gx.2, gx.2)


theorem has_diff {s₁ s₂ : Set α} (h₁ : d.Has s₁) (h₂ : d.Has s₂) (h : s₂ ⊆ s₁) :
    d.Has (s₁ \ s₂)

{α : Type u_1}
(d : MeasurableSpace.DynkinSystem α)
{s₁ s₂ : Set α}
(h₁ : d.Has s₁)
(h₂ : d.Has s₂)
(h : s₂ ⊆ s₁)


/-- A valued ring is a ring that comes equipped with a distinguished valuation. The class `Valued`
is designed for the situation that there is a canonical valuation on the ring.

TODO: show that there always exists an equivalent valuation taking values in a type belonging to
the same universe as the ring.

See Note [forgetful inheritance] for why we extend `UniformSpace`, `UniformAddGroup`. -/
class Valued (R : Type u) [Ring R] (Γ₀ : outParam (Type v))
  [LinearOrderedCommGroupWithZero Γ₀] extends UniformSpace R, UniformAddGroup R where
  v : Valuation R Γ₀
  is_topological_valuation : ∀ s, s ∈ 𝓝 (0 : R) ↔ ∃ γ : Γ₀ˣ, { x : R | v x < γ } ⊆ s

{R : Type u}
[Ring R]
{Γ₀ : outParam (Type v)}
[LinearOrderedCommGroupWithZero Γ₀]
[self : Valued R Γ₀]
(s : Set R)

s ∈ 𝓝 0 ↔ ∃ γ, {x | Valued.v x < ↑γ} ⊆ s


lemma op_iff {c : RingCon R} {x y : Rᵐᵒᵖ} : c.op x y ↔ c y.unop x.unop

{R : Type u_1}
[Add R]
[Mul R]
{c : RingCon R}
{x y : Rᵐᵒᵖ}

c.op x y ↔ c (MulOpposite.unop y) (MulOpposite.unop x)


@[simp, mfld_simps]
theorem mk_symm (e : PartialEquiv H E) (a b c d) :
    (ModelWithCorners.mk e a b c d : ModelWithCorners 𝕜 E H).symm = e.symm

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(e : PartialEquiv H E)
(a : e.source = Set.univ)
(b : UniqueDiffOn 𝕜 e.target)
(c : Continuous ↑e)
(d : Continuous e.invFun)

{ toPartialEquiv := e, source_eq := a, unique_diff' := b, continuous_toFun := c, continuous_invFun := d }.symm = e.symm


@[simp, norm_cast]
protected theorem coe_add (x y : FreeRing α) : ↑(x + y) = (x : FreeCommRing α) + y


/-- A simplified version of `TrivSqZeroExt.liftEquiv` for the commutative case. -/
@[simps! apply symm_apply_coe]
def liftEquivOfComm :
    { f : M →ₗ[R'] A // ∀ x y, f x * f y = 0 } ≃ (tsze R' M →ₐ[R'] A)

{R' : Type u}
{M : Type v}
[CommSemiring R']
[AddCommMonoid M]
[Module R' M]
[Module R'ᵐᵒᵖ M]
[IsCentralScalar R' M]
{A : Type u_2}
[Semiring A]
[Algebra R' A]

∀ (a : { f // ∀ (x y : M), f x * f y = 0 }),
  TrivSqZeroExt.liftEquivOfComm a = TrivSqZeroExt.lift (Algebra.ofId R' A) ↑a ⋯ ⋯ ⋯


@[simp 1100]
theorem op_map_id_obj (U : (Opens X)ᵒᵖ) : (map (𝟙 X)).op.obj U = U

{X : TopCat}
(U : (TopologicalSpace.Opens ↑X)ᵒᵖ)

(TopologicalSpace.Opens.map (𝟙 X)).op.obj U = U


@[simp]
theorem add_tsub_cancel_right (a b : α) : a + b - b = a

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


/-- The cokernel of `biprod.inl : X ⟶ X ⊞ Y` is `Y`. -/
@[simps!]
def cokernelBiprodInlIso : cokernel (biprod.inl : X ⟶ X ⊞ Y) ≅ Y

CategoryTheory.Limits.cokernelBiprodInlIso.hom =
  CategoryTheory.Limits.colimit.desc (CategoryTheory.Limits.parallelPair CategoryTheory.Limits.biprod.inl 0)
    (CategoryTheory.Limits.biprod.inlCokernelCofork X Y)


theorem normAtPlace_smul (w : InfinitePlace K) (x : E K) (c : ℝ) :
    normAtPlace w (c • x) = |c| * normAtPlace w x

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

(NumberField.mixedEmbedding.normAtPlace w) (c • x) = |c| * (NumberField.mixedEmbedding.normAtPlace w) x


theorem aemeasurable_toNNReal_abs_det_fderivWithin (hs : MeasurableSet s)
    (hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) :
    AEMeasurable (fun x => |(f' x).det|.toNNReal) (μ.restrict s)


theorem idealOf_compl_singleton_isMaximal (x : X) : (idealOfSet 𝕜 ({x}ᶜ : Set X)).IsMaximal

{X : Type u_1}
(𝕜 : Type u_2)
[RCLike 𝕜]
[TopologicalSpace X]
[CompactSpace X]
[T2Space X]
(x : X)


@[reassoc (attr := simp)]
lemma fac (i : S.Arrow) : lift hF hR s ≫ R.map i.f.op = s.ι i

{J : CategoryTheory.GrothendieckTopology C}

{K : CategoryTheory.GrothendieckTopology D}

(hF : CategoryTheory.Presheaf.IsSheaf J F)

(hR : (CategoryTheory.Functor.RightExtension.mk R α).IsPointwiseRightKanExtension)

(s : CategoryTheory.Limits.Multifork (S.index R))

CategoryTheory.RanIsSheafOfIsCocontinuous.lift hF hR s ≫ R.map i.f.op = s.ι i


/--
If `J` is subcanonical, we obtain a "Yoneda" functor from the defining site
into the sheaf category.
-/
@[simps]
def yoneda (hJ : Subcanonical J) : C ⥤ Sheaf J (Type v)

(hJ : CategoryTheory.Sheaf.Subcanonical J)

∀ {X Y : C} (f : X ⟶ Y), (hJ.yoneda.map f).val = CategoryTheory.yoneda.map f


@[simp]
theorem unop_sum (X Y : Cᵒᵖ) {ι : Type*} (s : Finset ι) (f : ι → (X ⟶ Y)) :
    (s.sum f).unop = s.sum fun i => (f i).unop

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
(X Y : Cᵒᵖ)
{ι : Type u_2}
(s : Finset ι)
(f : ι → (X ⟶ Y))


/-- A group is nilpotent if and only if its lower central series eventually reaches
  the trivial subgroup. -/
theorem nilpotent_iff_lowerCentralSeries : IsNilpotent G ↔ ∃ n, lowerCentralSeries G n = ⊥

Group.IsNilpotent G ↔ ∃ n, lowerCentralSeries G n = ⊥


/-- In a disjoint union space `Σ i, E i`, one can form a topological basis by taking the union of
topological bases on each of the parts of the space. -/
theorem IsTopologicalBasis.sigma {s : ∀ i : ι, Set (Set (E i))}
    (hs : ∀ i, IsTopologicalBasis (s i)) :
    IsTopologicalBasis (⋃ i : ι, (fun u => (Sigma.mk i '' u : Set (Σi, E i))) '' s i)

(hs : ∀ (i : ι), TopologicalSpace.IsTopologicalBasis (s i))

TopologicalSpace.IsTopologicalBasis (⋃ i, (fun u => Sigma.mk i '' u) '' s i)


@[simp]
theorem mem_inf {p p' : Subfield K} {x : K} : x ∈ p ⊓ p' ↔ x ∈ p ∧ x ∈ p'

{K : Type u}
[DivisionRing K]
{p p' : Subfield K}
{x : K}


@[simp]
theorem toBoolAlg_ofBoolAlg (a : AsBoolAlg α) : toBoolAlg (ofBoolAlg a) = a


theorem arccos_injOn : InjOn arccos (Icc (-1) 1)


@[simp, norm_cast]
protected theorem coe_add (r₁ r₂ : ℝ≥0) : ((r₁ + r₂ : ℝ≥0) : ℝ) = r₁ + r₂


@[simp]
theorem coe_bot : (↑(⊥ : ClopenUpperSet α) : Set α) = ∅

{α : Type u_1}
[TopologicalSpace α]
[LE α]


@[simp]
theorem testBit_lor (m n k) : testBit (lor m n) k = (testBit m k || testBit n k)

(m.lor n).testBit k = (m.testBit k || n.testBit k)


theorem ContMDiffOn.cle_arrowCongr {f : M → F₁ ≃L[𝕜] F₂} {g : M → F₃ ≃L[𝕜] F₄} {s : Set M}
    (hf : ContMDiffOn I 𝓘(𝕜, F₂ →L[𝕜] F₁) n (fun x ↦ ((f x).symm : F₂ →L[𝕜] F₁)) s)
    (hg : ContMDiffOn I 𝓘(𝕜, F₃ →L[𝕜] F₄) n (fun x ↦ (g x : F₃ →L[𝕜] F₄)) s) :
    ContMDiffOn I 𝓘(𝕜, (F₁ →L[𝕜] F₃) →L[𝕜] (F₂ →L[𝕜] F₄)) n
      (fun y ↦ (f y).arrowCongr (g y) : M → (F₁ →L[𝕜] F₃) →L[𝕜] (F₂ →L[𝕜] F₄)) s

(hf : ContMDiffOn I 𝓘(𝕜, F₂ →L[𝕜] F₁) n (fun x => ↑(f x).symm) s)

(hg : ContMDiffOn I 𝓘(𝕜, F₃ →L[𝕜] F₄) n (fun x => ↑(g x)) s)

ContMDiffOn I 𝓘(𝕜, (F₁ →L[𝕜] F₃) →L[𝕜] F₂ →L[𝕜] F₄) n (fun y => ↑((f y).arrowCongr (g y))) s


protected theorem zero_le : ∀ a : Cardinal, 0 ≤ a


lemma apply_eq_zero_of_isNilpotent [NoZeroSMulDivisors R M] [IsReduced R]
    (x : L) (h : _root_.IsNilpotent (toEnd R L M x)) (χ : Weight R L M) :
    χ x = 0

(h : IsNilpotent ((LieModule.toEnd R L M) x))


protected theorem not_lt_of_le : ∀{a b : Nat}, a ≤ b → ¬(b < a)


@[simp]
theorem coe_equivMapOfInjective_apply (x : S) : ↑(equivMapOfInjective S f hf x) = f x

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
(S : Subalgebra R A)
(f : A →ₐ[R] B)
(hf : Function.Injective ⇑f)
(x : ↥S)

↑((S.equivMapOfInjective f hf) x) = f ↑x


theorem card_fintypeIco : Fintype.card (Set.Ico a b) = b - a


theorem compl_def (s : Set α) : sᶜ = { x | x ∉ s }


lemma _root_.AntilipschitzWith.completeSpace_range_clm {f : E →SL[σ] F} {c : ℝ≥0}
    (hf : AntilipschitzWith c f) : CompleteSpace (LinearMap.range f)

{𝕜 : Type u_1}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜']
{σ : 𝕜 →+* 𝕜'}
{σ' : 𝕜' →+* 𝕜}
[RingHomInvPair σ σ']
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜' F]
[CompleteSpace F]
[CompleteSpace E]
{f : E →SL[σ] F}
{c : ℝ≥0}
(hf : AntilipschitzWith c ⇑f)


/-- The "restriction" functor along a monoid homomorphism `f : G ⟶ H`,
taking actions of `H` to actions of `G`.

(This makes sense for any homomorphism, but the name is natural when `f` is a monomorphism.)
-/
@[simps]
def res {G H : MonCat} (f : G ⟶ H) : Action V H ⥤ Action V G

(V : Type (u + 1))
[CategoryTheory.LargeCategory V]
{G H : MonCat}
(f : G ⟶ H)
(M : Action V H)


/-- A space with `MeasurableSpace` and `TopologicalSpace` structures such that
all open sets are measurable. -/
class OpensMeasurableSpace (α : Type*) [TopologicalSpace α] [h : MeasurableSpace α] : Prop where
  /-- Borel-measurable sets are measurable. -/
  borel_le : borel α ≤ h

{α : Type u_6}
[TopologicalSpace α]
[h : MeasurableSpace α]
[self : OpensMeasurableSpace α]


theorem aemeasurable_uIoc_iff [LinearOrder α] {f : α → β} {a b : α} :
    (AEMeasurable f <| μ.restrict <| Ι a b) ↔
      (AEMeasurable f <| μ.restrict <| Ioc a b) ∧ (AEMeasurable f <| μ.restrict <| Ioc b a)

{α : Type u_2}
{β : Type u_3}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
[LinearOrder α]
{f : α → β}
{a b : α}

AEMeasurable f (μ.restrict (Ι a b)) ↔
  AEMeasurable f (μ.restrict (Set.Ioc a b)) ∧ AEMeasurable f (μ.restrict (Set.Ioc b a))


lemma tendsto_integral_density_of_antitone (hκν : fst κ ≤ ν) [IsFiniteKernel ν] (a : α)
    (seq : ℕ → Set β) (hseq : Antitone seq) (hseq_iInter : ⋂ i, seq i = ∅)
    (hseq_meas : ∀ m, MeasurableSet (seq m)) :
    Tendsto (fun m ↦ ∫ x, density κ ν a x (seq m) ∂(ν a)) atTop (𝓝 0)

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

(hseq_meas : ∀ (m : ℕ), MeasurableSet (seq m))

Filter.Tendsto (fun m => ∫ (x : γ), κ.density ν a x (seq m) ∂ν a) Filter.atTop (𝓝 0)


@[simp, norm_cast]
theorem cast_natCast (h : m ∣ n) (k : ℕ) : (cast (k : ZMod n) : R) = k

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


@[to_additive]
theorem contMDiffWithinAt_finset_prod (h : ∀ i ∈ t, ContMDiffWithinAt I' I n (f i) s x) :
    ContMDiffWithinAt I' I n (fun x => ∏ i ∈ t, f i x) s x


theorem tendsto_add_atTop_nat (k : ℕ) : Tendsto (fun a => a + k) atTop atTop

Filter.Tendsto (fun a => a + k) Filter.atTop Filter.atTop


theorem toLinearEquiv_toContinuousLinearEquiv_symm (e : E ≃ₗ[𝕜] F) :
    e.toContinuousLinearEquiv.symm.toLinearEquiv = e.symm

{𝕜 : Type u}
[hnorm : NontriviallyNormedField 𝕜]
{E : Type v}
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousSMul 𝕜 E]
{F : Type w}
[AddCommGroup F]
[Module 𝕜 F]
[TopologicalSpace F]
[TopologicalAddGroup F]
[ContinuousSMul 𝕜 F]
[CompleteSpace 𝕜]
[T2Space E]
[T2Space F]
[FiniteDimensional 𝕜 E]
(e : E ≃ₗ[𝕜] F)


@[continuity]
theorem continuous_equivIco_symm : Continuous (equivIco p a).symm

{𝕜 : Type u_1}
[LinearOrderedAddCommGroup 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
(p : 𝕜)
[hp : Fact (0 < p)]
(a : 𝕜)
[Archimedean 𝕜]

Continuous ⇑(AddCircle.equivIco p a).symm


@[simp]
theorem bihimp_le_iff_left : a ⇔ b ≤ a ↔ Codisjoint a b

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


theorem finrank_sup_eq_finrank_left_mul_finrank_of_free :
    finrank R ↥(A ⊔ B) = finrank R A * finrank A (Algebra.adjoin A (B : Set S))

[Module.Free ↥A ↥(Algebra.adjoin ↥A ↑B)]

FiniteDimensional.finrank R ↥(A ⊔ B) =
  FiniteDimensional.finrank R ↥A * FiniteDimensional.finrank ↥A ↥(Algebra.adjoin ↥A ↑B)


@[simp] -- Should be replaced with `Submodule.span_image` when `lean4#3701` is fixed.
theorem span_image' [RingHomSurjective σ₁₂] (f : M →ₛₗ[σ₁₂] M₂) :
    span R₂ (f '' s) = map f (span R s)

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_4}
{M₂ : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
[AddCommMonoid M₂]
[Module R₂ M₂]
{s : Set M}
[RingHomSurjective σ₁₂]
(f : M →ₛₗ[σ₁₂] M₂)

Submodule.span R₂ (⇑f '' s) = Submodule.map f (Submodule.span R s)


theorem comp_coimage_π_eq_zero {R : C} {g : Q ⟶ R} (h : f ≫ g = 0) : f ≫ Abelian.coimage.π g = 0

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
{P Q : C}
{f : P ⟶ Q}
{R : C}
{g : Q ⟶ R}
(h : f ≫ g = 0)

f ≫ CategoryTheory.Abelian.coimage.π g = 0


theorem Forall₂.get :
    ∀ {x : List α} {y : List β}, Forall₂ R x y →
      ∀ ⦃i : ℕ⦄ (hx : i < x.length) (hy : i < y.length), R (x.get ⟨i, hx⟩) (y.get ⟨i, hy⟩)

{α : Type u_1}
{β : Type u_2}
{R : α → β → Prop}
{x : List α}
{y : List β}

List.Forall₂ R x y → ∀ ⦃i : ℕ⦄ (hx : i < x.length) (hy : i < y.length), R (x.get ⟨i, hx⟩) (y.get ⟨i, hy⟩)


/-- Subtracting two points from the same point produces equal results
if and only if those points are equal. -/
@[simp]
theorem vsub_right_cancel_iff {p₁ p₂ p : P} : p -ᵥ p₁ = p -ᵥ p₂ ↔ p₁ = p₂

{G : Type u_1}
{P : Type u_2}
[AddGroup G]
[T : AddTorsor G P]
{p₁ p₂ p : P}


@[simp]
theorem mem_restrictScalars {E : IntermediateField L' L} {x : L} :
    x ∈ restrictScalars K E ↔ x ∈ E

(K : Type u_1)
{L : Type u_2}
{L' : Type u_3}
[Field K]
[Field L]
[Field L']
[Algebra K L]
[Algebra K L']
[Algebra L' L]
[IsScalarTower K L' L]
{E : IntermediateField L' L}
{x : L}

x ∈ IntermediateField.restrictScalars K E ↔ x ∈ E


@[to_additive]
theorem tprod_fintype [Fintype β] (f : β → α) : ∏' b, f b = ∏ b, f b

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
[Fintype β]
(f : β → α)


theorem l_eq_bot {l : α → β} {u : β → α} (gc : GaloisConnection l u) {x} : l x = ⊥ ↔ x ≤ u ⊥

{α : Type u}
{β : Type v}
[Preorder α]
[PartialOrder β]
[OrderBot β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)
{x : α}


protected nonrec theorem ContinuousWithinAt.nhds (h : ContinuousWithinAt f s x) :
    ContinuousWithinAt (𝓝 ∘ f) s x

{X : Type u_4}
{Y : Type u_5}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
{x : X}
{s : Set X}
(h : ContinuousWithinAt f s x)


theorem gc_generateFrom (α) :
    GaloisConnection (fun t : TopologicalSpace α => OrderDual.toDual { s | IsOpen[t] s })
      (generateFrom ∘ OrderDual.ofDual)

GaloisConnection (fun t => OrderDual.toDual {s | IsOpen s}) (TopologicalSpace.generateFrom ∘ ⇑OrderDual.ofDual)


/-- This is the Fitting decomposition of the module `M` with respect to the endomorphism `f`.

See also `LinearMap.eventually_isCompl_ker_pow_range_pow` for an alternative spelling. -/
theorem isCompl_iSup_ker_pow_iInf_range_pow [IsNoetherian R M] (f : M →ₗ[R] M) :
    IsCompl (⨆ n, LinearMap.ker (f ^ n)) (⨅ n, LinearMap.range (f ^ n))

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
[IsArtinian R M]
[IsNoetherian R M]
(f : M →ₗ[R] M)


theorem multiset_prod_X_sub_C_nextCoeff (t : Multiset R) :
    nextCoeff (t.map fun x => X - C x).prod = -t.sum

{R : Type u}
[CommRing R]
(t : Multiset R)

(Multiset.map (fun x => Polynomial.X - Polynomial.C x) t).prod.nextCoeff = -t.sum


theorem sInfGen_def (m : Set (OuterMeasure α)) (t : Set α) :
    sInfGen m t = ⨅ (μ : OuterMeasure α) (_ : μ ∈ m), μ t

(m : Set (MeasureTheory.OuterMeasure α))

MeasureTheory.OuterMeasure.sInfGen m t = ⨅ μ ∈ m, μ t


theorem prod_eq_one_iff {p : Multiset (Associates α)} :
    p.prod = 1 ↔ ∀ a ∈ p, (a : Associates α) = 1

{α : Type u_1}
[CommMonoid α]
{p : Multiset (Associates α)}


@[simp]
lemma equivHomotopy_apply_of_eq {φ₁ φ₂ : F ⟶ G} (h : φ₁ = φ₂) :
    (equivHomotopy _ _ (Homotopy.ofEq h)).1 = 0

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{F G : CochainComplex C ℤ}
{φ₁ φ₂ : F ⟶ G}
(h : φ₁ = φ₂)

↑((CochainComplex.HomComplex.Cochain.equivHomotopy φ₁ φ₂) (Homotopy.ofEq h)) = 0


theorem length_le_length_insertNth (l : List α) (x : α) (n : ℕ) :
    l.length ≤ (insertNth n x l).length

{α : Type u}
(l : List α)
(x : α)
(n : ℕ)

l.length ≤ (List.insertNth n x l).length


protected theorem Antitone.Icc (hf : Antitone f) (hg : Monotone g) :
    Monotone fun x => Icc (f x) (g x)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{f g : α → β}
(hf : Antitone f)
(hg : Monotone g)


@[to_additive (attr := simp)]
theorem ofMulEquivOfLocalizations_apply {k : N ≃* P} (x) :
    (f.ofMulEquivOfLocalizations k).toMap x = k (f.toMap x)

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
{P : Type u_3}
[AddCommMonoid P]
(f : S.LocalizationMap N)
{k : N ≃+ P}
(x : M)

(f.ofAddEquivOfLocalizations k).toMap x = k (f.toMap x)


@[to_additive mem_add_wellApproximable_iff]
theorem mem_wellApproximable_iff {A : Type*} [SeminormedGroup A] {δ : ℕ → ℝ} {a : A} :
    a ∈ wellApproximable A δ ↔
      a ∈ blimsup (fun n => approxOrderOf A n (δ n)) atTop fun n => 0 < n

{A : Type u_1}
[SeminormedGroup A]
{δ : ℕ → ℝ}
{a : A}

a ∈ wellApproximable A δ ↔ a ∈ Filter.blimsup (fun n => approxOrderOf A n (δ n)) Filter.atTop fun n => 0 < n


/-- All composite numbers are Fermat pseudoprimes to base 1.
-/
theorem fermatPsp_base_one {n : ℕ} (h₁ : 1 < n) (h₂ : ¬n.Prime) : FermatPsp n 1

{n : ℕ}
(h₁ : 1 < n)
(h₂ : ¬Nat.Prime n)


@[simp, fun_prop]
protected theorem DifferentiableAt.snd (h : DifferentiableAt 𝕜 f₂ x) :
    DifferentiableAt 𝕜 (fun x => (f₂ x).2) 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]
{x : E}
{f₂ : E → F × G}
(h : DifferentiableAt 𝕜 f₂ x)


@[to_additive]
theorem mul_rotate (a b c : G) : a * b * c = b * c * a

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


@[simp]
theorem comp_neg [RingHomCompTriple σ₁₂ σ₂₃ σ₁₃] [TopologicalAddGroup M₂] [TopologicalAddGroup M₃]
    (g : M₂ →SL[σ₂₃] M₃) (f : M →SL[σ₁₂] M₂) : g.comp (-f) = -g.comp f

{R : Type u_1}
[Ring R]
{R₂ : Type u_2}
[Ring R₂]
{R₃ : Type u_3}
[Ring R₃]
{M : Type u_4}
[TopologicalSpace M]
[AddCommGroup M]
{M₂ : Type u_5}
[TopologicalSpace M₂]
[AddCommGroup M₂]
{M₃ : Type u_6}
[TopologicalSpace M₃]
[AddCommGroup M₃]
[Module R M]
[Module R₂ M₂]
[Module R₃ M₃]
{σ₁₂ : R →+* R₂}
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R →+* R₃}
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
[TopologicalAddGroup M₂]
[TopologicalAddGroup M₃]
(g : M₂ →SL[σ₂₃] M₃)
(f : M →SL[σ₁₂] M₂)


@[simp]
theorem coe_of (α : Type*) [PartialOrder α] [Fintype α] : ↥(of α) = α

(α : Type u_1)
[PartialOrder α]
[Fintype α]


lemma compAddMonoidHom_injective_right (ψ : AddChar B M) (hψ : Injective ψ) :
    Injective fun f : A →+ B ↦ ψ.compAddMonoidHom f

{A : Type u_1}
{B : Type u_2}
{M : Type u_3}
[AddMonoid A]
[AddMonoid B]
[Monoid M]
(ψ : AddChar B M)
(hψ : Function.Injective ⇑ψ)

Function.Injective fun f => ψ.compAddMonoidHom f


@[to_additive (attr := simp)]
theorem pure_seq {α β : Type u} {f : α → β} {x : FreeMagma α} : pure f <*> x = f <$> x

{α β : Type u}
{f : α → β}
{x : FreeAddMagma α}

(Seq.seq (pure f) fun x_1 => x) = f <$> x


@[simp]
theorem aleph0_mul_aleph (o : Ordinal) : ℵ₀ * aleph o = aleph o

ℵ₀ * Cardinal.aleph o = Cardinal.aleph o


theorem expand_size [Hashable α] {buckets : Buckets α β} :
    (expand sz buckets).buckets.size = buckets.size

{buckets : Batteries.HashMap.Imp.Buckets α β}

(Batteries.HashMap.Imp.expand sz buckets).buckets.size = buckets.size


/-- The identity transformation induces the identity endofunctor on the category of algebras. -/
-- Porting note: removed @[simps (config := { rhsMd := semireducible })] and replaced with
@[simps!]
def functorOfNatTransId : functorOfNatTrans (𝟙 F) ≅ 𝟭 _

(X : CategoryTheory.Endofunctor.Algebra F)

(CategoryTheory.Endofunctor.Algebra.functorOfNatTransId.inv.app X).f = CategoryTheory.CategoryStruct.id X.a


theorem to_le {H K : Subgroup G} (hK : IsPGroup p K) (hHK : H ≤ K) : IsPGroup p H

{p : ℕ}
{G : Type u_1}
[Group G]
{H K : Subgroup G}
(hK : IsPGroup p ↥K)
(hHK : H ≤ K)


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

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Limits.HasProducts C]
{X : TopCat}
(F : TopCat.Presheaf C X)
{ι : Type v'}
(U : ι → TopologicalSpace.Opens ↑X)

∀ (X_1 : CategoryTheory.Limits.Cone ((CategoryTheory.Pairwise.diagram U).op ⋙ F)),
  ((TopCat.Presheaf.SheafConditionPairwiseIntersections.coneEquivUnitIso F U).inv.app X_1).hom = 𝟙 X_1.pt


/-- The equivalence of categories from the order dual of a preordered type `X`
to the opposite category of the preorder `X`. -/
@[simps]
def orderDualEquivalence : Xᵒᵈ ≌ Xᵒᵖ

(CategoryTheory.orderDualEquivalence X).unitIso = CategoryTheory.Iso.refl (CategoryTheory.Functor.id Xᵒᵈ)


theorem lift_mk'_spec (x v) (y : M) : lift hg (mk' S x y) = v ↔ g x = g y * v

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
{P : Type u_3}
[CommSemiring P]
[IsLocalization M S]
{g : R →+* P}
(hg : ∀ (y : ↥M), IsUnit (g ↑y))
(x : R)
(v : P)
(y : ↥M)

(IsLocalization.lift hg) (IsLocalization.mk' S x y) = v ↔ g x = g ↑y * v


theorem disconnect_objs : S.disconnect.objs = S.objs

{C : Type u}
[CategoryTheory.Groupoid C]
(S : CategoryTheory.Subgroupoid C)


theorem contDiffOn_top : ContDiffOn 𝕜 ∞ f s ↔ ∀ n : ℕ, ContDiffOn 𝕜 n f s

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}

ContDiffOn 𝕜 ⊤ f s ↔ ∀ (n : ℕ), ContDiffOn 𝕜 (↑n) f s


theorem image₂_singleton_left' : image₂ f {a} t = t.image (f a)

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

Finset.image₂ f {a} t = Finset.image (f a) t


/-- The function `fun x => x⁻¹` is integrable on `a..b` if and only if
`a = b` or `0 ∉ [a, b]`. -/
@[simp]
theorem intervalIntegrable_inv_iff {a b : ℝ} :
    IntervalIntegrable (fun x => x⁻¹) volume a b ↔ a = b ∨ (0 : ℝ) ∉ [[a, b]]

IntervalIntegrable (fun x => x⁻¹) MeasureTheory.volume a b ↔ a = b ∨ 0 ∉ [[a, b]]


@[simp]
theorem not_subsingleton_iff : ¬s.Subsingleton ↔ s.Nontrivial


theorem cycleType_eq' {σ : Perm α} (s : Finset (Perm α)) (h1 : ∀ f : Perm α, f ∈ s → f.IsCycle)
    (h2 : (s : Set (Perm α)).Pairwise Disjoint)
    (h0 : s.noncommProd id (h2.imp fun _ _ => Disjoint.commute) = σ) :
    σ.cycleType = s.1.map (Finset.card ∘ support)

(h2 : (↑s).Pairwise Equiv.Perm.Disjoint)

σ.cycleType = Multiset.map (Finset.card ∘ Equiv.Perm.support) s.val


theorem le_maximum_of_mem : a ∈ l → (maximum l : WithBot α) = m → a ≤ m

{α : Type u_1}
[LinearOrder α]
{l : List α}
{a m : α}


@[simp]
theorem powHalf_zero : powHalf 0 = 1


theorem image_embedding_iff [LE α] [LE β] {φ : α ↪o β} :
    IsAntichain (· ≤ ·) (φ '' s) ↔ IsAntichain (· ≤ ·) s

{α : Type u_1}
{β : Type u_2}
{s : Set α}
[LE α]
[LE β]
{φ : α ↪o β}

IsAntichain (fun x x_1 => x ≤ x_1) (⇑φ '' s) ↔ IsAntichain (fun x x_1 => x ≤ x_1) s


theorem exists_norm_eq_of_isOfFinAddOrder {u : AddCircle p} (hu : IsOfFinAddOrder u) :
    ∃ k : ℕ, ‖u‖ = p * (k / addOrderOf u)

{p : ℝ}
[hp : Fact (0 < p)]
{u : AddCircle p}
(hu : IsOfFinAddOrder u)


@[to_additive]
theorem LeftCancelMonoid.toMonoid_injective {M : Type u} :
    Function.Injective (@LeftCancelMonoid.toMonoid M)


@[to_additive]
theorem Infinite.orderOf_eq_zero_of_forall_mem_zpowers [Infinite α] {g : α}
    (h : ∀ x, x ∈ zpowers g) : orderOf g = 0

(h : ∀ (x : α), x ∈ AddSubgroup.zmultiples g)


lemma tendsto_indicator_const_apply_iff_eventually' (b : β)
    (nhd_b : {0}ᶜ ∈ 𝓝 b) (nhd_o : {b}ᶜ ∈ 𝓝 0) (x : α) :
    Tendsto (fun i ↦ (As i).indicator (fun (_ : α) ↦ b) x) L (𝓝 (A.indicator (fun (_ : α) ↦ b) x))
      ↔ ∀ᶠ i in L, (x ∈ As i ↔ x ∈ A)

{α : Type u_1}
{A : Set α}
{β : Type u_2}
[Zero β]
[TopologicalSpace β]
{ι : Type u_3}
(L : Filter ι)
{As : ι → Set α}
(b : β)
(nhd_b : {0}ᶜ ∈ 𝓝 b)
(nhd_o : {b}ᶜ ∈ 𝓝 0)
(x : α)

Filter.Tendsto (fun i => (As i).indicator (fun x => b) x) L (𝓝 (A.indicator (fun x => b) x)) ↔
  ∀ᶠ (i : ι) in L, x ∈ As i ↔ x ∈ A


theorem Int.associated_natAbs (k : ℤ) : Associated k k.natAbs


theorem HasMFDerivWithinAt.mono (h : HasMFDerivWithinAt I I' f t x f') (hst : s ⊆ t) :
    HasMFDerivWithinAt I I' f s x f'

{f' : TangentSpace I x →L[𝕜] TangentSpace I' (f x)}


@[simp]
theorem mem_prod {S : NonUnitalStarSubalgebra R A} {S₁ : NonUnitalStarSubalgebra R B} {x : A × B} :
    x ∈ prod S S₁ ↔ x.1 ∈ S ∧ x.2 ∈ S₁

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[NonUnitalSemiring B]
[StarRing B]
[Module R B]
{S : NonUnitalStarSubalgebra R A}
{S₁ : NonUnitalStarSubalgebra R B}
{x : A × B}


protected theorem coe_eq : ((↑) : α → Completion α) = SeparationQuotient.mk ∘ pureCauchy

↑α = SeparationQuotient.mk ∘ CauchyFilter.pureCauchy


@[simp, norm_cast]
lemma coe_inf (G₁ G₂ : G.Finsubgraph) : ↑(G₁ ⊓ G₂) = (G₁ ⊓ G₂ : G.Subgraph)

{V : Type u}
{G : SimpleGraph V}
(G₁ G₂ : G.Finsubgraph)

↑(G₁ ⊓ G₂) = ↑G₁ ⊓ ↑G₂


/-- The final auxiliary construction for `CliffordAlgebra.even.lift`. This map is the forwards
direction of that equivalence, but not in the fully-bundled form. -/
@[simps! (config := .lemmasOnly) apply]
def aux (f : EvenHom Q A) : CliffordAlgebra.even Q →ₗ[R] A

{R : Type uR}
{M : Type uM}
[CommRing R]
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}
{A : Type uA}
[Ring A]
[Algebra R A]
(f : CliffordAlgebra.EvenHom Q A)

∀ (a : ↥(CliffordAlgebra.even Q)),
  (CliffordAlgebra.even.lift.aux f) a = (((CliffordAlgebra.foldr Q (CliffordAlgebra.even.lift.fFold f) ⋯) (1, 0)) ↑a).1


@[simp]
theorem coe_comp (f : sInfHom β γ) (g : sInfHom α β) : ⇑(f.comp g) = f ∘ g

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[InfSet α]
[InfSet β]
[InfSet γ]
(f : sInfHom β γ)
(g : sInfHom α β)


@[simp] lemma ofSym_one (s : Sym σ 1) : ofSym s = indiscrete 1

{σ : Type u_1}
[DecidableEq σ]
(s : Sym σ 1)

Nat.Partition.ofSym s = Nat.Partition.indiscrete 1


theorem continuous_quotient_mk' : Continuous (@Quotient.mk' X s)

{X : Type u}
[TopologicalSpace X]
{s : Setoid X}


theorem norm_cauchyPowerSeries_le (f : ℂ → E) (c : ℂ) (R : ℝ) (n : ℕ) :
    ‖cauchyPowerSeries f c R n‖ ≤
      ((2 * π)⁻¹ * ∫ θ : ℝ in (0)..2 * π, ‖f (circleMap c R θ)‖) * |R|⁻¹ ^ n

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(f : ℂ → E)
(c : ℂ)
(R : ℝ)
(n : ℕ)

‖cauchyPowerSeries f c R n‖ ≤ ((2 * π)⁻¹ * ∫ (θ : ℝ) in 0 ..2 * π, ‖f (circleMap c R θ)‖) * |R|⁻¹ ^ n


theorem integral_zero : integral I l (fun _ => (0 : E)) vol = 0

{ι : Type u}
{E : Type v}
{F : Type w}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{I : BoxIntegral.Box ι}
[Fintype ι]
{l : BoxIntegral.IntegrationParams}
{vol : ι →ᵇᵃ[⊤] E →L[ℝ] F}

BoxIntegral.integral I l (fun x => 0) vol = 0


lemma egauge_le_of_mem_smul (h : x ∈ c • s) : egauge 𝕜 s x ≤ ‖c‖₊

{𝕜 : Type u_1}
[NNNorm 𝕜]
{E : Type u_2}
[SMul 𝕜 E]
{c : 𝕜}
{s : Set E}
{x : E}
(h : x ∈ c • s)


lemma toContinuousMap_injective [Zero R] : Injective ((↑) : C(X, R)₀ → C(X, R))

{X : Type u_1}
{R : Type u_3}
[Zero X]
[TopologicalSpace X]
[TopologicalSpace R]
[Zero R]


theorem image_ι_comp_eq_zero {R : C} {g : Q ⟶ R} (h : f ≫ g = 0) : Abelian.image.ι f ≫ g = 0

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
{P Q : C}
{f : P ⟶ Q}
{R : C}
{g : Q ⟶ R}
(h : f ≫ g = 0)

CategoryTheory.Abelian.image.ι f ≫ g = 0


/-- The stalk map of `Spec M⁻¹R ⟶ Spec R` is an iso for each `p : Spec M⁻¹R`. -/
theorem Spec_map_localization_isIso (R : CommRingCat.{u}) (M : Submonoid R)
    (x : PrimeSpectrum (Localization M)) :
    IsIso
      ((Spec.toPresheafedSpace.map
        (CommRingCat.ofHom (algebraMap R (Localization M))).op).stalkMap x)

(R : CommRingCat)
(M : Submonoid ↑R)
(x : PrimeSpectrum (Localization M))

CategoryTheory.IsIso
  (AlgebraicGeometry.PresheafedSpace.Hom.stalkMap
    (AlgebraicGeometry.Spec.toPresheafedSpace.map (CommRingCat.ofHom (algebraMap (↑R) (Localization M))).op) x)


/-- The identity of a object in `Φ.LeftResolution X₂`. -/
@[simps]
def Hom.id [W₁.ContainsIdentities] (L : Φ.LeftResolution X₂) : Hom L L

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

{Φ : CategoryTheory.LocalizerMorphism W₁ W₂}

(CategoryTheory.LocalizerMorphism.LeftResolution.Hom.id L).f = CategoryTheory.CategoryStruct.id L.X₁


theorem mk_mem_col_iff {μ : YoungDiagram} {i j : ℕ} : (i, j) ∈ μ.col j ↔ (i, j) ∈ μ


@[simp]
lemma inr_comp_binaryCoproductIso_hom_apply (a : C) (x : G.obj a) :
    (binaryCoproductIso F G).hom.app a ((Limits.coprod.inr (X := F)).app a x) = .inr x

(F G : CategoryTheory.Functor C (Type w))

(CategoryTheory.FunctorToTypes.binaryCoproductIso F G).hom.app a (CategoryTheory.Limits.coprod.inr.app a x) = Sum.inr x


/-- **Uniqueness of left-invariant measures**: In a second-countable locally compact group, any
  σ-finite left-invariant measure is a scalar multiple of the Haar measure.
  This is slightly weaker than assuming that `μ` is a Haar measure (in particular we don't require
  `μ ≠ 0`).
  See also `isMulLeftInvariant_eq_smul_of_regular`
  for a statement not assuming second-countability. -/
@[to_additive
"**Uniqueness of left-invariant measures**: In a second-countable locally compact additive group,
  any σ-finite left-invariant measure is a scalar multiple of the additive Haar measure.
  This is slightly weaker than assuming that `μ` is a additive Haar measure (in particular we don't
  require `μ ≠ 0`).
  See also `isAddLeftInvariant_eq_smul_of_regular`
  for a statement not assuming second-countability."]
theorem haarMeasure_unique (μ : Measure G) [SigmaFinite μ] [IsMulLeftInvariant μ]
    (K₀ : PositiveCompacts G) : μ = μ K₀ • haarMeasure K₀

(K₀ : TopologicalSpace.PositiveCompacts G)

μ = μ ↑K₀ • MeasureTheory.Measure.haarMeasure K₀


theorem det_kroneckerTMul [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n]
    (A : Matrix m m α) (B : Matrix n n β) :
    det (A ⊗ₖₜ[R] B) = (det A ^ Fintype.card n) ⊗ₜ[R] (det B ^ Fintype.card m)

(R : Type u_1)
{α : Type u_2}
{β : Type u_4}
{m : Type u_9}
{n : Type u_10}
[CommRing R]
[CommRing α]
[CommRing β]
[Algebra R α]
[Algebra R β]
[Fintype m]
[Fintype n]
[DecidableEq m]
[DecidableEq n]
(A : Matrix m m α)
(B : Matrix n n β)

(Matrix.kroneckerMap (TensorProduct.tmul R) A B).det = (A.det ^ Fintype.card n) ⊗ₜ[R] (B.det ^ Fintype.card m)


@[simp]
theorem limitEquivSections_apply (x : limit F) (j : J) :
    ((limitEquivSections F) x : ∀ j, F.obj j) j = limit.π F j x

{J : Type v}
[CategoryTheory.Category.{w, v} J]
(F : J ⥤ Type u)
[CategoryTheory.Limits.HasLimit F]
(x : CategoryTheory.Limits.limit F)
(j : J)

↑((CategoryTheory.Limits.Types.limitEquivSections F) x) j = CategoryTheory.Limits.limit.π F j x


theorem RingHom.ker_isRadical_iff_reduced_of_surjective {S F} [CommSemiring R] [CommRing S]
    [FunLike F R S] [RingHomClass F R S] {f : F} (hf : Function.Surjective f) :
    (RingHom.ker f).IsRadical ↔ IsReduced S

{R : Type u_1}
{S : Type u_3}
{F : Type u_4}
[CommSemiring R]
[CommRing S]
[FunLike F R S]
[RingHomClass F R S]
{f : F}
(hf : Function.Surjective ⇑f)


@[simp] lemma support_tail (p : G.Walk v v) (hp) :
    (p.tail hp).support = p.support.tail

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


@[reassoc (attr := simp)]
theorem PInfty_f_comp_QInfty_f (n : ℕ) : (PInfty.f n : X _[n] ⟶ _) ≫ QInfty.f n = 0

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{X : CategoryTheory.SimplicialObject C}
(n : ℕ)

AlgebraicTopology.DoldKan.PInfty.f n ≫ AlgebraicTopology.DoldKan.QInfty.f n = 0


/-- Let R be an integral domain and f, g₁, g₂ ∈ R[X]. Let g₁ and g₂ be monic and coprime.
Then, ∃ q, r₁, r₂ ∈ R[X] such that f / g₁g₂ = q + r₁/g₁ + r₂/g₂ and deg(r₁) < deg(g₁) and
deg(r₂) < deg(g₂).
-/
theorem div_eq_quo_add_rem_div_add_rem_div (f : R[X]) {g₁ g₂ : R[X]} (hg₁ : g₁.Monic)
    (hg₂ : g₂.Monic) (hcoprime : IsCoprime g₁ g₂) :
    ∃ q r₁ r₂ : R[X],
      r₁.degree < g₁.degree ∧
        r₂.degree < g₂.degree ∧ (f : K) / (↑g₁ * ↑g₂) = ↑q + ↑r₁ / ↑g₁ + ↑r₂ / ↑g₂

(R : Type)
[CommRing R]
[IsDomain R]
(K : Type)
[Field K]
[Algebra R[X] K]
[IsFractionRing R[X] K]
(f : R[X])
{g₁ g₂ : R[X]}
(hg₁ : g₁.Monic)
(hg₂ : g₂.Monic)
(hcoprime : IsCoprime g₁ g₂)

∃ q r₁ r₂, r₁.degree < g₁.degree ∧ r₂.degree < g₂.degree ∧ ↑f / (↑g₁ * ↑g₂) = ↑q + ↑r₁ / ↑g₁ + ↑r₂ / ↑g₂


/-- `castSucc i` is positive when `i` is positive -/
theorem castSucc_pos {i : Fin (n + 1)} (h : 0 < i) : 0 < castSucc i


@[simp, norm_cast] lemma coe_pow (a : α) (n : ℕ) : (↑(a ^ n) : WithTop α) = a ^ n

{α : Type u_1}
[DecidableEq α]
[MonoidWithZero α]
[NoZeroDivisors α]
[Nontrivial α]
(a : α)
(n : ℕ)


/--
An alternative constructor for boolean algebras.

A set of *boolean generators* in a compactly generated complete lattice is a subset `S` such that

* the elements of `S` are all atoms, and
* the set `S` satisfies an atomicity condition:
  any compact element below the supremum of a finite subset `s` of generators
  is equal to the supremum of a subset of `s`.

If the supremum of `S` is the whole lattice,
then the lattice is a boolean algebra
(see `IsCompactlyGenerated.BooleanGenerators.booleanAlgebra_of_sSup_eq_top`).
-/
structure BooleanGenerators (S : Set α) : Prop where
  /-- The elements in a collection of boolean generators are all atoms. -/
  isAtom : ∀ I ∈ S, IsAtom I
  /-- The elements in a collection of boolean generators satisfy an atomicity condition:
  any compact element below the supremum of a finite subset `s` of generators
  is equal to the supremum of a subset of `s`. -/
  finitelyAtomistic : ∀ (s : Finset α) (a : α),
      ↑s ⊆ S → IsCompactElement a → a ≤ s.sup id → ∃ t ⊆ s, a = t.sup id

(self : IsCompactlyGenerated.BooleanGenerators S)

↑s ⊆ S → CompleteLattice.IsCompactElement a → a ≤ s.sup id → ∃ t ⊆ s, a = t.sup id


/-- The length-0 path at a vertex. -/
@[refl, simps]
protected def nil {u : V} : G.Path u u

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


theorem eq_zero_of_infinite_isRoot (p : R[X]) (h : Set.Infinite { x | IsRoot p x }) : p = 0

{R : Type u}
[CommRing R]
[IsDomain R]
(p : Polynomial R)
(h : {x | p.IsRoot x}.Infinite)


/-- A version of `TensorProduct.ext` for `AlgHom`.

Using this as the `@[ext]` lemma instead of `Algebra.TensorProduct.ext'` allows `ext` to apply
lemmas specific to `A →ₐ[S] _` and `B →ₐ[R] _`; notably this allows recursion into nested tensor
products of algebras.

See note [partially-applied ext lemmas]. -/
@[ext high]
theorem ext ⦃f g : (A ⊗[R] B) →ₐ[S] C⦄
    (ha : f.comp includeLeft = g.comp includeLeft)
    (hb : (f.restrictScalars R).comp includeRight = (g.restrictScalars R).comp includeRight) :
    f = g

(ha : f.comp Algebra.TensorProduct.includeLeft = g.comp Algebra.TensorProduct.includeLeft)

(hb :
  (AlgHom.restrictScalars R f).comp Algebra.TensorProduct.includeRight =
    (AlgHom.restrictScalars R g).comp Algebra.TensorProduct.includeRight)


@[norm_cast] lemma uzpow_intCast (u : ℤˣ) (z : ℤ) : u ^ (z : R) = u ^ z

{R : Type u_1}
[CommRing R]
[Module R (Additive ℤˣ)]
(u : ℤˣ)
(z : ℤ)


theorem isLinearMap_smul {R M : Type*} [CommSemiring R] [AddCommMonoid M] [Module R M] (c : R) :
    IsLinearMap R fun z : M ↦ c • z

{R : Type u_17}
{M : Type u_18}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(c : R)


@[to_additive (attr := mono)]
theorem tprod_strict_mono (hf : Multipliable f) (hg : Multipliable g) (h : f < g) :
    ∏' n, f n < ∏' n, g n

{ι : Type u_1}
{α : Type u_3}
[OrderedCommGroup α]
[TopologicalSpace α]
[TopologicalGroup α]
[OrderClosedTopology α]
{f g : ι → α}
(hf : Multipliable f)
(hg : Multipliable g)
(h : f < g)


/-- **Chebyshev's inequality** for `ℝ≥0∞`-valued variance. -/
theorem meas_ge_le_evariance_div_sq {X : Ω → ℝ} (hX : AEStronglyMeasurable X ℙ) {c : ℝ≥0}
    (hc : c ≠ 0) : ℙ {ω | ↑c ≤ |X ω - 𝔼[X]|} ≤ eVar[X] / c ^ 2

(hX : MeasureTheory.AEStronglyMeasurable X ℙ)

ℙ {ω | ↑c ≤ |X ω - ∫ (a : Ω), X a|} ≤ ProbabilityTheory.evariance X ℙ / ↑c ^ 2


@[simp]
theorem compl_range_inr : (range (Sum.inr : β → α ⊕ β))ᶜ = range (Sum.inl : α → α ⊕ β)

(Set.range Sum.inr)ᶜ = Set.range Sum.inl


@[to_additive]
theorem smul (h : IsFundamentalDomain G s μ) (g : G) : IsFundamentalDomain G (g • s) μ

[MeasureTheory.SMulInvariantMeasure G α μ]

(h : MeasureTheory.IsFundamentalDomain G s μ)

MeasureTheory.IsFundamentalDomain G (g • s) μ


/-- The shadow of the empty set is empty. -/
@[simp]
theorem shadow_empty : ∂ (∅ : Finset (Finset α)) = ∅


theorem lineMap_vadd_lineMap (v₁ v₂ : V1) (p₁ p₂ : P1) (c : k) :
    lineMap v₁ v₂ c +ᵥ lineMap p₁ p₂ c = lineMap (v₁ +ᵥ p₁) (v₂ +ᵥ p₂) c

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
(v₁ v₂ : V1)
(p₁ p₂ : P1)
(c : k)

(AffineMap.lineMap v₁ v₂) c +ᵥ (AffineMap.lineMap p₁ p₂) c = (AffineMap.lineMap (v₁ +ᵥ p₁) (v₂ +ᵥ p₂)) c


/-- A restatement of `Types.Limit.lift_π_apply` that uses `Pi.π` and `Pi.lift`,
with specialized universes. -/
theorem pi_lift_π_apply' {β : Type v} (f : β → Type v) {P : Type v}
    (s : ∀ b, P ⟶ f b) (b : β) (x : P) :
    (Pi.π f b : (piObj f) → f b) (@Pi.lift β _ _ f _ P s x) = s b x

{β : Type v}
(f : β → Type v)
{P : Type v}
(s : (b : β) → P ⟶ f b)
(b : β)
(x : P)

CategoryTheory.Limits.Pi.π f b (CategoryTheory.Limits.Pi.lift s x) = s b x


theorem symm_symm_apply (e : M₁ ≃SL[σ₁₂] M₂) (x : M₁) : e.symm.symm x = e x

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{σ₂₁ : R₂ →+* R₁}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₂ M₂]
(e : M₁ ≃SL[σ₁₂] M₂)
(x : M₁)


@[simp] theorem one_imI : (1 : ℍ[R,c₁,c₂]).imI = 0


theorem embedding_coe : Embedding ((↑) : ℝ → EReal)


theorem irreducible_iff_nat_prime (a : ℕ) : Irreducible a ↔ Nat.Prime a


theorem map_map₂_distrib {g : γ → δ} {f' : α' → β' → δ} {g₁ : α → α'} {g₂ : β → β'}
    (h_distrib : ∀ a b, g (f a b) = f' (g₁ a) (g₂ b)) :
    (map₂ f a b).map g = map₂ f' (a.map g₁) (b.map g₂)

{f : α → β → γ}

(h_distrib : ∀ (a : α) (b : β), g (f a b) = f' (g₁ a) (g₂ b))

Option.map g (Option.map₂ f a b) = Option.map₂ f' (Option.map g₁ a) (Option.map g₂ b)


/-- If all sets in a collection are either `∅` or `Set.univ`, then so is their union. -/
theorem sUnion_mem_empty_univ {S : Set (Set α)} (h : S ⊆ {∅, univ}) :
    ⋃₀ S ∈ ({∅, univ} : Set (Set α))

{α : Type u_1}
{S : Set (Set α)}
(h : S ⊆ {∅, Set.univ})


lemma four_ne_zero' [OfNat α 4] [NeZero (4 : α)] : (4 : α) ≠ 0

(α : Type u_2)
[Zero α]
[OfNat α 4]
[NeZero 4]


/-- If `f : ℝ → ℝ` is convex on `S` and differentiable within `S` at `x`, then the slope of any
secant line with left endpoint at `x` is bounded below by the derivative of `f` within `S` at `x`.

This is fractionally weaker than `ConvexOn.le_slope_of_hasDerivWithinAt_Ioi` but simpler to apply
under a `DifferentiableOn S` hypothesis. -/
lemma le_slope_of_hasDerivWithinAt (hfc : ConvexOn ℝ S f) (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y)
    (hf' : HasDerivWithinAt f f' S x) :
    f' ≤ slope f x y

{S : Set ℝ}
{f : ℝ → ℝ}
{x y f' : ℝ}
(hfc : ConvexOn ℝ S f)
(hx : x ∈ S)
(hy : y ∈ S)
(hxy : x < y)
(hf' : HasDerivWithinAt f f' S x)


/-- To prove membership to stabilizer of a *finite set*, it is enough to prove one inclusion. -/
theorem mem_stabilizer_of_finite_iff_smul_le (s : Set α) (hs : s.Finite) (g : G) :
    g ∈ stabilizer G s ↔ g • s ⊆ s

{G : Type u_1}
[Group G]
{α : Type u_2}
[MulAction G α]
(s : Set α)
(hs : s.Finite)
(g : G)

g ∈ MulAction.stabilizer G s ↔ g • s ⊆ s


/-- The circumcenter of a simplex, in terms of `pointsWithCircumcenter`. -/
theorem circumcenter_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ} (s : Simplex ℝ P n) :
    s.circumcenter =
      (univ : Finset (PointsWithCircumcenterIndex n)).affineCombination ℝ s.pointsWithCircumcenter
        (circumcenterWeightsWithCircumcenter n)

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{n : ℕ}
(s : Affine.Simplex ℝ P n)

s.circumcenter =
  (Finset.affineCombination ℝ Finset.univ s.pointsWithCircumcenter)
    (Affine.Simplex.circumcenterWeightsWithCircumcenter n)


/-- The commutative square in the opposite category associated to a commutative square. -/
theorem op (p : CommSq f g h i) : CommSq i.op h.op g.op f.op

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{W X Y Z : C}
{f : W ⟶ X}
{g : W ⟶ Y}
{h : X ⟶ Z}
{i : Y ⟶ Z}
(p : CategoryTheory.CommSq f g h i)

CategoryTheory.CommSq i.op h.op g.op f.op


lemma monotone_to_upperTopology_continuous [TopologicalSpace α] [TopologicalSpace β]
    [Topology.IsUpperSet α] [IsUpper β] {f : α → β} (hf : Monotone f) : Continuous f

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
[TopologicalSpace α]
[TopologicalSpace β]
[Topology.IsUpperSet α]
[Topology.IsUpper β]
{f : α → β}
(hf : Monotone f)


@[simp 1100]
theorem mem_map_swap (x : α) (y : β) (xs : List (α × β)) :
    (y, x) ∈ map Prod.swap xs ↔ (x, y) ∈ xs

{α : Type u}
{β : Type v}
(x : α)
(y : β)
(xs : List (α × β))

(y, x) ∈ List.map Prod.swap xs ↔ (x, y) ∈ xs


theorem eq_zero_iff {P Q : C} (f : P ⟶ Q) : f = 0 ↔ ∀ a, f a = 0

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

f = 0 ↔ ∀ (a : CategoryTheory.Abelian.Pseudoelement P), CategoryTheory.Abelian.Pseudoelement.pseudoApply f a = 0


/-- `(d/dx) lim_{n → ∞} f n x = lim_{n → ∞} f' n x` when the `f' n` converge
_uniformly_ to their limit at `x`.

In words the assumptions mean the following:
  * `hf'`: The `f'` converge "uniformly at" `x` to `g'`. This does not mean that the `f' n` even
    converge away from `x`!
  * `hf`: For all `(y, n)` with `y` sufficiently close to `x` and `n` sufficiently large, `f' n` is
    the derivative of `f n`
  * `hfg`: The `f n` converge pointwise to `g` on a neighborhood of `x` -/
theorem hasFDerivAt_of_tendstoUniformlyOnFilter [NeBot l]
    (hf' : TendstoUniformlyOnFilter f' g' l (𝓝 x))
    (hf : ∀ᶠ n : ι × E in l ×ˢ 𝓝 x, HasFDerivAt (f n.1) (f' n.1 n.2) n.2)
    (hfg : ∀ᶠ y in 𝓝 x, Tendsto (fun n => f n y) l (𝓝 (g y))) : HasFDerivAt g (g' x) x

(hf : ∀ᶠ (n : ι × E) in l ×ˢ 𝓝 x, HasFDerivAt (f n.1) (f' n.1 n.2) n.2)

(hfg : ∀ᶠ (y : E) in 𝓝 x, Filter.Tendsto (fun n => f n y) l (𝓝 (g y)))


@[simp]
theorem interior_univ : interior (univ : Set X) = univ


theorem coe_mul_of_apply_add [AddRightCancelMonoid ι] [SetLike.GradedMonoid A] (r : ⨁ i, A i)
    {i : ι} (r' : A i) (j : ι) : ((r * of (fun i => A i) i r') (j + i) : R) = r j * r'

{ι : Type u_1}
{σ : Type u_2}
{R : Type u_4}
[DecidableEq ι]
[Semiring R]
[SetLike σ R]
[AddSubmonoidClass σ R]
(A : ι → σ)
[AddRightCancelMonoid ι]
[SetLike.GradedMonoid A]
(r : ⨁ (i : ι), ↥(A i))
{i : ι}
(r' : ↥(A i))
(j : ι)

↑((r * (DirectSum.of (fun i => ↥(A i)) i) r') (j + i)) = ↑(r j) * ↑r'


@[simp]
theorem filter_dvd_eq_divisors (h : n ≠ 0) : (Finset.range n.succ).filter (· ∣ n) = n.divisors

Finset.filter (fun x => x ∣ n) (Finset.range n.succ) = n.divisors


/-- Given two subgroups `H' ⊆ H`, there exists a left transversal to `H'` inside `H`. -/
@[to_additive "Given two subgroups `H' ⊆ H`, there exists a transversal to `H'` inside `H`"]
lemma exists_left_transversal_of_le {H' H : Subgroup G} (h : H' ≤ H) :
    ∃ S : Set G, S * H' = H ∧ Nat.card S * Nat.card H' = Nat.card H

{G : Type u_1}
[Group G]
{H' H : Subgroup G}
(h : H' ≤ H)

∃ S, S * ↑H' = ↑H ∧ Nat.card ↑S * Nat.card ↥H' = Nat.card ↥H


lemma IsIntegralCurveOn.comp_mul (hγ : IsIntegralCurveOn γ v s) (a : ℝ) :
    IsIntegralCurveOn (γ ∘ (· * a)) (a • v) { t | t * a ∈ s }

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type u_2}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type u_3}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{γ : ℝ → M}
{v : (x : M) → TangentSpace I x}
{s : Set ℝ}
(hγ : IsIntegralCurveOn γ v s)
(a : ℝ)

IsIntegralCurveOn (γ ∘ fun x => x * a) (a • v) {t | t * a ∈ s}


@[simp]
theorem map_lie (f : L₁ →ₗ⁅R⁆ L₂) (x y : L₁) : f ⁅x, y⁆ = ⁅f x, f y⁆

{R : Type u}
{L₁ : Type v}
{L₂ : Type w}
[CommRing R]
[LieRing L₁]
[LieAlgebra R L₁]
[LieRing L₂]
[LieAlgebra R L₂]
(f : L₁ →ₗ⁅R⁆ L₂)
(x y : L₁)


@[simp]
theorem coe_neg (D : LieDerivation R L M) : ⇑(-D) = -D

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(D : LieDerivation R L M)


@[to_additive]
theorem card_le_card_group [Finite G] : Nat.card H ≤ Nat.card G

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


@[to_additive (attr := simp)]
theorem quot_lift_mk (β : Type v) (f : List (α × Bool) → β)
    (H : ∀ L₁ L₂, Red.Step L₁ L₂ → f L₁ = f L₂) : Quot.lift f H (mk L) = f L

(H : ∀ (L₁ L₂ : List (α × Bool)), FreeAddGroup.Red.Step L₁ L₂ → f L₁ = f L₂)


@[simp, norm_cast] theorem Nat.cast_ofNat {n : ℕ} [NatCast R] [Nat.AtLeastTwo n] :
  (Nat.cast (no_index (OfNat.ofNat n)) : R) = OfNat.ofNat n

{R : Type u_1}
{n : ℕ}
[NatCast R]
[n.AtLeastTwo]


lemma essSurj_of_iso {F G : C ⥤ D} [EssSurj F] (α : F ≅ G) : EssSurj G

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


theorem eventually_atBot_prod_self [SemilatticeInf α] [Nonempty α] {p : α × α → Prop} :
    (∀ᶠ x in atBot, p x) ↔ ∃ a, ∀ k l, k ≤ a → l ≤ a → p (k, l)

{α : Type u_3}
[SemilatticeInf α]
[Nonempty α]
{p : α × α → Prop}

(∀ᶠ (x : α × α) in Filter.atBot, p x) ↔ ∃ a, ∀ (k l : α), k ≤ a → l ≤ a → p (k, l)


theorem tendsto_exp_atBot : Tendsto exp atBot (𝓝 0)

Filter.Tendsto Real.exp Filter.atBot (𝓝 0)


lemma log_rnDeriv_tilted_left_self [SigmaFinite μ] (hf : Integrable (fun x ↦ exp (f x)) μ) :
    (fun x ↦ log ((μ.tilted f).rnDeriv μ x).toReal)
      =ᵐ[μ] fun x ↦ f x - log (∫ x, exp (f x) ∂μ)

(hf : MeasureTheory.Integrable (fun x => rexp (f x)) μ)

(fun x => Real.log ((μ.tilted f).rnDeriv μ x).toReal) =ᵐ[μ] fun x => f x - Real.log (∫ (x : α), rexp (f x) ∂μ)


theorem Fintype.not_linearIndependent_iff [Fintype ι] :
    ¬LinearIndependent R v ↔ ∃ g : ι → R, ∑ i, g i • v i = 0 ∧ ∃ i, g i ≠ 0

{ι : Type u'}
{R : Type u_2}
{M : Type u_4}
{v : ι → M}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Fintype ι]

¬LinearIndependent R v ↔ ∃ g, ∑ i : ι, g i • v i = 0 ∧ ∃ i, g i ≠ 0


@[simp] theorem sdiv_nil : sdiv [] g = []


theorem add_lt_of_lt_sub {a b c : Nat} (h : a < c - b) : a + b < c


theorem right : Primrec₂ fun (_ : α) (b : β) => b

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


@[simp]
theorem Icc_prod_Icc (a₁ a₂ : α) (b₁ b₂ : β) : Icc a₁ a₂ ×ˢ Icc b₁ b₂ = Icc (a₁, b₁) (a₂, b₂)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(a₁ a₂ : α)
(b₁ b₂ : β)

Set.Icc a₁ a₂ ×ˢ Set.Icc b₁ b₂ = Set.Icc (a₁, b₁) (a₂, b₂)


theorem map_dickson (f : R →+* S) : ∀ n : ℕ, map f (dickson k a n) = dickson k (f a) n

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[CommRing S]
{k : ℕ}
{a : R}
(f : R →+* S)
(n : ℕ)

Polynomial.map f (Polynomial.dickson k a n) = Polynomial.dickson k (f a) n


/-- If `f` is a collection of linear maps, then the construction `MultilinearMap.compLinearMap`
sending a multilinear map `g` to `g (f₁ ⬝ , ..., fₙ ⬝ )` is linear in `g`. -/
@[simps] def compLinearMapₗ (f : Π (i : ι), M₁ i →ₗ[R] M₁' i) :
    (MultilinearMap R M₁' M₂) →ₗ[R] MultilinearMap R M₁ M₂

{R : Type uR}
{ι : Type uι}
{M₁ : ι → Type v₁}
{M₂ : Type v₂}
[CommSemiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
{M₁' : ι → Type u_1}
[(i : ι) → AddCommMonoid (M₁' i)]
[(i : ι) → Module R (M₁' i)]
(f : (i : ι) → M₁ i →ₗ[R] M₁' i)
(g : MultilinearMap R M₁' M₂)

(MultilinearMap.compLinearMapₗ f) g = g.compLinearMap f


@[symm]
theorem Disjoint.symm ⦃a b : α⦄ : Disjoint a b → Disjoint b a

{α : Type u_1}
[PartialOrder α]
[OrderBot α]
⦃a b : α⦄


{α : Type u_3}
[AddGroupWithOne α]
[CharZero α]
{n : ℤ}

↑n ≠ 1 ↔ n ≠ 1


theorem of_iff_true    (h : a ↔ True) : a


theorem inl.inj_iff : (inl a : α ⊕ β) = inl b ↔ a = b


/-- The cdf tends to 1 at +∞. -/
lemma tendsto_cdf_atTop : Tendsto (cdf μ) atTop (𝓝 1)

Filter.Tendsto (↑(ProbabilityTheory.cdf μ)) Filter.atTop (𝓝 1)


lemma isCompatible_map_smul : ((r₀.smul m₀).map (whiskerRight φ (forget _))).Compatible

{J : CategoryTheory.GrothendieckTopology C}

(hA : CategoryTheory.Presheaf.IsSeparated J A)

(r₀ : CategoryTheory.Presieve.FamilyOfElements (R₀ ⋙ CategoryTheory.forget RingCat) P)

(m₀ : CategoryTheory.Presieve.FamilyOfElements (M₀.presheaf ⋙ CategoryTheory.forget AddCommGrp) P)

(hr₀ : (r₀.map (CategoryTheory.whiskerRight α (CategoryTheory.forget RingCat))).IsAmalgamation r)

(hm₀ : (m₀.map (CategoryTheory.whiskerRight φ (CategoryTheory.forget AddCommGrp))).IsAmalgamation m)

((r₀.smul m₀).map (CategoryTheory.whiskerRight φ (CategoryTheory.forget AddCommGrp))).Compatible


/-- The bijection `orderEmbOfFin s h` sends `k-1` to the maximum of `s`. -/
theorem orderEmbOfFin_last {s : Finset α} {k : ℕ} (h : s.card = k) (hz : 0 < k) :
    orderEmbOfFin s h ⟨k - 1, Nat.sub_lt hz (Nat.succ_pos 0)⟩ =
      s.max' (card_pos.mp (h.symm ▸ hz))

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

(s.orderEmbOfFin h) ⟨k - 1, ⋯⟩ = s.max' ⋯


theorem ramificationIdx_eq_find (h : ∃ n, ∀ k, map f p ≤ P ^ k → k ≤ n) :
    ramificationIdx f p P = Nat.find h

(h : ∃ n, ∀ (k : ℕ), Ideal.map f p ≤ P ^ k → k ≤ n)

Ideal.ramificationIdx f p P = Nat.find h


theorem dist_set_exists : ∃ C, 0 ≤ C ∧ ∀ x : α, dist (f x) (g x) ≤ C

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
{f g : BoundedContinuousFunction α β}

∃ C, 0 ≤ C ∧ ∀ (x : α), dist (f x) (g x) ≤ C


@[simp, norm_cast] lemma coe_tsub (f g : ι →₀ α) : ⇑(f - g) = f - g

{ι : Type u_1}
{α : Type u_2}
[CanonicallyOrderedAddCommMonoid α]
[Sub α]
[OrderedSub α]
(f g : ι →₀ α)


@[to_additive]
theorem map_equiv_eq_comap_symm (f : M ≃* N) (K : Subsemigroup M) :
    K.map (f : M →ₙ* N) = K.comap (f.symm : N →ₙ* M)

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
(f : M ≃+ N)
(K : AddSubsemigroup M)

AddSubsemigroup.map (↑f) K = AddSubsemigroup.comap (↑f.symm) K


theorem map_apply (κ : Kernel α β) (hf : Measurable f) (a : α) : map κ f hf a = (κ a).map f

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{γ : Type u_4}
{mγ : MeasurableSpace γ}
{f : β → γ}
(κ : ProbabilityTheory.Kernel α β)
(hf : Measurable f)
(a : α)

(κ.map f hf) a = MeasureTheory.Measure.map f (κ a)


/-- The map from the restriction of a presheafed space.
-/
@[simps!]
def ofRestrict {U : TopCat} (X : SheafedSpace C) {f : U ⟶ (X : TopCat)}
    (h : OpenEmbedding f) : X.restrict h ⟶ X

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{U : TopCat}
(X : AlgebraicGeometry.SheafedSpace C)
{f : U ⟶ ↑X.toPresheafedSpace}
(h : OpenEmbedding ⇑f)


theorem IsTheta.isBoundedUnder_le_iff (h : f' =Θ[l] g') :
    IsBoundedUnder (· ≤ ·) l (norm ∘ f') ↔ IsBoundedUnder (· ≤ ·) l (norm ∘ g')

{α : Type u_1}
{E' : Type u_6}
{F' : Type u_7}
[SeminormedAddCommGroup E']
[SeminormedAddCommGroup F']
{f' : α → E'}
{g' : α → F'}
{l : Filter α}
(h : f' =Θ[l] g')

Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l (norm ∘ f') ↔ Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l (norm ∘ g')


/-- When the second map `S.g` is zero, this is the homology data on `S` given by
the chosen `cokernel S.f` -/
@[simps]
noncomputable def ofHasCokernel (hg : S.g = 0) [HasCokernel S.f] :
    S.HomologyData

(CategoryTheory.ShortComplex.HomologyData.ofHasCokernel S hg).left =
  CategoryTheory.ShortComplex.LeftHomologyData.ofHasCokernel S hg


theorem AntitoneOn.quasilinearOn (hf : AntitoneOn f s) (hs : Convex 𝕜 s) : QuasilinearOn 𝕜 s f

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[OrderedSemiring 𝕜]
[LinearOrderedAddCommMonoid E]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{s : Set E}
{f : E → β}
(hf : AntitoneOn f s)
(hs : Convex 𝕜 s)


@[scoped simp]
theorem map_add_zsmul [AddGroup G] [AddGroup H] [AddConstMapClass F G H a b]
    (f : F) (x : G) : ∀ n : ℤ, f (x + n • a) = f x + n • b

{F : Type u_1}
{G : Type u_2}
{H : Type u_3}
[FunLike F G H]
{a : G}
{b : H}
[AddGroup G]
[AddGroup H]
[AddConstMapClass F G H a b]
(f : F)
(x : G)
(n : ℤ)


@[simp]
theorem length_take (n : ℕ) (s : Stream' α) : (take n s).length = n


lemma closure_singleton_eq_Iic (x : X) : closure {x} = Iic x

{X : Type u_1}
[TopologicalSpace X]
(x : X)


/-- If `K / E / F` is a ring extension tower, `L` is a submonoid of `K / F` which is generated by
`S` as an `F`-module, then `E[L]` is generated by `S` as an `E`-module. -/
theorem Submonoid.adjoin_eq_span_of_eq_span [Semiring F] [Module F K] [IsScalarTower F E K]
    (L : Submonoid K) {S : Set K} (h : (L : Set K) = span F S) :
    toSubmodule (adjoin E (L : Set K)) = span E S

(F : Type u_1)
(E : Type u_2)
{K : Type u_3}
[CommSemiring E]
[Semiring K]
[SMul F E]
[Algebra E K]
[Semiring F]
[Module F K]
[IsScalarTower F E K]
(L : Submonoid K)
{S : Set K}
(h : ↑L = ↑(Submodule.span F S))

Subalgebra.toSubmodule (Algebra.adjoin E ↑L) = Submodule.span E S


theorem sup_lt_sup_of_lt_of_inf_le_inf (hxy : x < y) (hinf : y ⊓ z ≤ x ⊓ z) : x ⊔ z < y ⊔ z

{α : Type u_1}
[Lattice α]
[IsModularLattice α]
{x y z : α}
(hxy : x < y)
(hinf : y ⊓ z ≤ x ⊓ z)


@[simp] lemma coe_mk (f : SupHom α β) (hf) : ⇑(mk f hf) = f

{α : Type u_3}
{β : Type u_4}
[Sup α]
[Bot α]
[Sup β]
[Bot β]
(f : SupHom α β)
(hf : f.toFun ⊥ = ⊥)


theorem factorial_smul (n : ℕ) :
    n ! • p n (fun _ ↦ y) = iteratedFDeriv 𝕜 n f x (fun _ ↦ y)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{p : FormalMultilinearSeries 𝕜 E F}
{f : E → F}
{x : E}
{r : ℝ≥0∞}
(h : HasFPowerSeriesOnBall f p x r)
(y : E)
[CompleteSpace F]
(n : ℕ)

(n.factorial • (p n) fun x => y) = (iteratedFDeriv 𝕜 n f x) fun x => y


theorem localization_localization_surj [IsLocalization N T] (x : T) :
    ∃ y : R × localizationLocalizationSubmodule M N,
        x * algebraMap R T y.2 = algebraMap R T y.1

{R : Type u_1}
[CommSemiring R]
(M : Submonoid R)
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
(N : Submonoid S)
(T : Type u_4)
[CommSemiring T]
[Algebra R T]
[Algebra S T]
[IsScalarTower R S T]
[IsLocalization M S]
[IsLocalization N T]
(x : T)

∃ y, x * (algebraMap R T) ↑y.2 = (algebraMap R T) y.1


theorem map_le_range {f : M →[L] N} {p : L.Substructure M} : map f p ≤ range f

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
{f : L.Hom M N}
{p : L.Substructure M}

FirstOrder.Language.Substructure.map f p ≤ f.range


theorem ae_eq_of_forall_setIntegral_eq_of_sigmaFinite [SigmaFinite μ] {f g : α → E}
    (hf_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn f s μ)
    (hg_int_finite : ∀ s, MeasurableSet s → μ s < ∞ → IntegrableOn g s μ)
    (hfg_eq : ∀ s : Set α, MeasurableSet s → μ s < ∞ → ∫ x in s, f x ∂μ = ∫ x in s, g x ∂μ) :
    f =ᵐ[μ] g

(hf_int_finite : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → MeasureTheory.IntegrableOn f s μ)

(hg_int_finite : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → MeasureTheory.IntegrableOn g s μ)

(hfg_eq : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∫ (x : α) in s, f x ∂μ = ∫ (x : α) in s, g x ∂μ)


/-- (Impl) A preliminary definition to avoid timeouts. -/
@[simps]
def conesEquivInverseObj (B : C) {J : Type w} (F : Discrete J ⥤ Over B) (c : Cone F) :
    Cone (widePullbackDiagramOfDiagramOver B F)

(F : CategoryTheory.Discrete J ⥤ CategoryTheory.Over B)

(X : CategoryTheory.Limits.WidePullbackShape J)

(CategoryTheory.Over.ConstructProducts.conesEquivInverseObj B F c).π.app X =
  Option.casesOn X c.pt.hom fun j => (c.π.app { as := j }).left


/-- A product over `powerset s` is equal to the double product over sets of subsets of `s` with
`card s = k`, for `k = 1, ..., card s`. -/
@[to_additive "A sum over `powerset s` is equal to the double sum over sets of subsets of `s` with
  `card s = k`, for `k = 1, ..., card s`"]
lemma prod_powerset (s : Finset α) (f : Finset α → β) :
    ∏ t ∈ powerset s, f t = ∏ j ∈ range (card s + 1), ∏ t ∈ powersetCard j s, f t

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

∑ t ∈ s.powerset, f t = ∑ j ∈ Finset.range (s.card + 1), ∑ t ∈ Finset.powersetCard j s, f t


theorem isCoseparator_def (G : C) :
    IsCoseparator G ↔ ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), (∀ h : Y ⟶ G, f ≫ h = g ≫ h) → f = g

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

CategoryTheory.IsCoseparator G ↔
  ∀ ⦃X Y : C⦄ (f g : X ⟶ Y),
    (∀ (h : Y ⟶ G), CategoryTheory.CategoryStruct.comp f h = CategoryTheory.CategoryStruct.comp g h) → f = g


@[simp] theorem dot_mod_gcd_left (xs ys : IntList) : dot xs ys % xs.gcd = 0


@[reassoc]
theorem uncurry_natural_left (f : X ⟶ X') (g : X' ⟶ A ⟹ Y) :
    uncurry (f ≫ g) = Limits.prod.map (𝟙 _) f ≫ uncurry g

CategoryTheory.CartesianClosed.uncurry (CategoryTheory.CategoryStruct.comp f g) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.prod.map (CategoryTheory.CategoryStruct.id A) f)
    (CategoryTheory.CartesianClosed.uncurry g)


theorem rootSet_X_pow [CommRing S] [IsDomain S] [Algebra R S] {n : ℕ} (hn : n ≠ 0) :
    (X ^ n : R[X]).rootSet S = {0}

{R : Type u}
{S : Type v}
[Field R]
[CommRing S]
[IsDomain S]
[Algebra R S]
{n : ℕ}
(hn : n ≠ 0)


theorem mul_left_cancel₀ (ha : a ≠ 0) (h : a * b = a * c) : b = c

{M₀ : Type u_1}
[Mul M₀]
[Zero M₀]
[IsLeftCancelMulZero M₀]
{a b c : M₀}
(ha : a ≠ 0)
(h : a * b = a * c)


theorem nontrivial_of_lt [Preorder α] {x y} (hx : x ∈ s) (hy : y ∈ s) (hxy : x < y) :
    s.Nontrivial

{α : Type u}
{s : Set α}
[Preorder α]
{x y : α}
(hx : x ∈ s)
(hy : y ∈ s)
(hxy : x < y)


theorem isSheaf_of_isTerminal_of_indiscrete {X : TopCat.{w}} (hind : X.str = ⊤) (F : Presheaf C X)
    (it : IsTerminal <| F.obj <| op ⊥) : F.IsSheaf

(it : CategoryTheory.Limits.IsTerminal (F.obj (Opposite.op ⊥)))


/-- If `M` is boundaryless, `∂(M×N) = M × ∂N`. -/
lemma boundary_of_boundaryless_left [I.Boundaryless] :
    (I.prod J).boundary (M × N) = Set.prod (univ : Set M) (J.boundary N)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{N : Type u_7}
[TopologicalSpace N]
[ChartedSpace H' N]
(J : ModelWithCorners 𝕜 E' H')
[I.Boundaryless]

(I.prod J).boundary (M × N) = Set.univ.prod (J.boundary N)


lemma IsEllSequence.smul (h : IsEllSequence W) (x : R) : IsEllSequence (x • W)

{R : Type u}
[CommRing R]
{W : ℤ → R}
(h : IsEllSequence W)
(x : R)


/-- As a binary function, `Fin.cons` is injective. -/
theorem cons_injective2 : Function.Injective2 (@cons n α)


private theorem aux₂ : 0 < u - ⌊ξ⌋ * v ∧ u - ⌊ξ⌋ * v < v

{ξ : ℝ}
{u v : ℤ}
(hv : 2 ≤ v)
(h : Real.ContfracLegendre.Ass ξ u v)


lemma multiplesHom_symm_apply (f : ℕ →+ β) : (multiplesHom β).symm f = f 1

(β : Type u_2)
[AddMonoid β]
(f : ℕ →+ β)


theorem dotProduct_one (v : n → α) : v ⬝ᵥ 1 = ∑ i, v i

{n : Type u_3}
{α : Type v}
[Fintype n]
[MulOneClass α]
[AddCommMonoid α]
(v : n → α)


/-- Reflection is its own inverse. -/
@[simp]
theorem reflection_inv : (reflection K)⁻¹ = reflection K

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


theorem integralBasis_repr_apply [NumberField K] (x : K) (i : Free.ChooseBasisIndex ℤ (𝓞 K)) :
    (latticeBasis K).repr (canonicalEmbedding K x) i = (integralBasis K).repr x i

(i : Module.Free.ChooseBasisIndex ℤ (NumberField.RingOfIntegers K))

((NumberField.canonicalEmbedding.latticeBasis K).repr ((NumberField.canonicalEmbedding K) x)) i =
  ↑(((NumberField.integralBasis K).repr x) i)


theorem IndepSets.bInter {s : ι → Set (Set Ω)} {s' : Set (Set Ω)}
    {u : Set ι} (h : ∃ n ∈ u, IndepSets (s n) s' μ) :
    IndepSets (⋂ n ∈ u, s n) s' μ

(h : ∃ n ∈ u, ProbabilityTheory.IndepSets (s n) s' μ)

ProbabilityTheory.IndepSets (⋂ n ∈ u, s n) s' μ


/-- The range of a surjective non-unital ring homomorphism is the whole of the codomain. -/
@[simp]
theorem srange_top_of_surjective (f : F) (hf : Function.Surjective (f : R → S)) :
    srange f = (⊤ : NonUnitalSubsemiring S)

{R : Type u}
{S : Type v}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
{F : Type u_1}
[FunLike F R S]
[NonUnitalRingHomClass F R S]
(f : F)
(hf : Function.Surjective ⇑f)


/-- For each field, and for each nonzero element of said field, there is a unique inverse.
Since `IsField` doesn't remember the data of an `inv` function and as such,
a lemma that there is a unique inverse could be useful.
-/
theorem uniq_inv_of_isField (R : Type u) [Ring R] (hf : IsField R) :
    ∀ x : R, x ≠ 0 → ∃! y : R, x * y = 1

(R : Type u)
[Ring R]
(hf : IsField R)
(x : R)


/-- An angle in a right-angled triangle expressed using `arcsin`. -/
theorem oangle_add_left_eq_arcsin_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = ↑(π / 2)) :
    o.oangle (x + y) y = Real.arcsin (‖x‖ / ‖x + y‖)

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

o.oangle (x + y) y = ↑(Real.arcsin (‖x‖ / ‖x + y‖))


/-- Composing on the right by a function preserves uniform convergence on a filter -/
theorem TendstoUniformlyOnFilter.comp (h : TendstoUniformlyOnFilter F f p p') (g : γ → α) :
    TendstoUniformlyOnFilter (fun n => F n ∘ g) (f ∘ g) p (p'.comap g)

{α : Type u}
{β : Type v}
{γ : Type w}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{f : α → β}
{p : Filter ι}
{p' : Filter α}
(h : TendstoUniformlyOnFilter F f p p')
(g : γ → α)

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


theorem HasStrictDerivAt.csinh (hf : HasStrictDerivAt f f' x) :
    HasStrictDerivAt (fun x => Complex.sinh (f x)) (Complex.cosh (f x) * f') x

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


@[to_additive]
theorem map_comap_eq_self {f : F} {S : Submonoid N} (h : S ≤ MonoidHom.mrange f) :
    (S.comap f).map f = S

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
{F : Type u_5}
[FunLike F M N]
[mc : AddMonoidHomClass F M N]
{f : F}
{S : AddSubmonoid N}
(h : S ≤ AddMonoidHom.mrange f)

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


@[simp]
theorem map_id : map (.id S A) (.id R C) = .id S _

{R : Type uR}
{S : Type uS}
{A : Type uA}
{C : Type uC}
[CommSemiring R]
[CommSemiring S]
[Algebra R S]
[Semiring A]
[Algebra R A]
[Algebra S A]
[IsScalarTower R S A]
[Semiring C]
[Algebra R C]

Algebra.TensorProduct.map (AlgHom.id S A) (AlgHom.id R C) = AlgHom.id S (A ⊗[R] C)


protected theorem Nodup.insert [DecidableEq α] (h : l.Nodup) : (l.insert a).Nodup

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


theorem iUnion₂_prod_const {s : ∀ i, κ i → Set α} {t : Set β} :
    (⋃ (i) (j), s i j) ×ˢ t = ⋃ (i) (j), s i j ×ˢ t

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

(⋃ i, ⋃ j, s i j) ×ˢ t = ⋃ i, ⋃ j, s i j ×ˢ t


@[to_additive (attr := simp)]
lemma unitsLift_symm_apply_apply_inv' (f : C(X, M)ˣ) (x : X) :
    (ContinuousMap.unitsLift.symm f x)⁻¹ = (↑f⁻¹ : C(X, M)) x

{X : Type u_1}
{M : Type u_2}
[TopologicalSpace X]
[AddMonoid M]
[TopologicalSpace M]
[ContinuousAdd M]
(f : AddUnits C(X, M))
(x : X)

↑(-(ContinuousMap.addUnitsLift.symm f) x) = ↑(-f) x


@[simp]
theorem lift_sum {ι : Type u} (f : ι → Cardinal.{v}) :
    Cardinal.lift.{w} (Cardinal.sum f) = Cardinal.sum fun i => Cardinal.lift.{w} (f i)

Cardinal.lift.{w, max v u} (Cardinal.sum f) = Cardinal.sum fun i => Cardinal.lift.{w, v} (f i)


theorem translate_sat : {c : Constraint} → {v : Int} → sat c v → sat (c.translate t) (v + t)

{t : Int}
{c : Lean.Omega.Constraint}
{v : Int}

c.sat v = true → (c.translate t).sat (v + t) = true


/-- Changing coordinates between two elements of the maximal atlas gives rise to an element
of the structure groupoid. -/
theorem StructureGroupoid.compatible_of_mem_maximalAtlas {e e' : PartialHomeomorph M H}
    (he : e ∈ G.maximalAtlas M) (he' : e' ∈ G.maximalAtlas M) : e.symm ≫ₕ e' ∈ G

(he : e ∈ StructureGroupoid.maximalAtlas M G)

(he' : e' ∈ StructureGroupoid.maximalAtlas M G)


@[simp]
theorem sym_empty (n : ℕ) : (∅ : Finset α).sym (n + 1) = ∅


theorem trNormal_respects (c k v s) :
    ∃ b₂,
      TrCfg (stepNormal c k v) b₂ ∧
        Reaches₁ (TM2.step tr)
          ⟨some (trNormal c (trCont k)), s, K'.elim (trList v) [] [] (trContStack k)⟩ b₂

(c : Turing.ToPartrec.Code)
(k : Turing.ToPartrec.Cont)
(v : List ℕ)
(s : Option Turing.PartrecToTM2.Γ')

∃ b₂,
  Turing.PartrecToTM2.TrCfg (Turing.ToPartrec.stepNormal c k v) b₂ ∧
    Turing.Reaches₁ (Turing.TM2.step Turing.PartrecToTM2.tr)
      { l := some (Turing.PartrecToTM2.trNormal c (Turing.PartrecToTM2.trCont k)), var := s,
        stk := Turing.PartrecToTM2.K'.elim (Turing.PartrecToTM2.trList v) [] [] (Turing.PartrecToTM2.trContStack k) }
      b₂


theorem sup_apply [∀ i, SemilatticeSup (α i)] (f g : Π₀ i, α i) (i : ι) : (f ⊔ g) i = f i ⊔ g i

{ι : Type u_1}
{α : ι → Type u_2}
[(i : ι) → Zero (α i)]
[(i : ι) → SemilatticeSup (α i)]
(f g : Π₀ (i : ι), α i)
(i : ι)


theorem Prime.eq_two_or_odd {p : ℕ} (hp : Prime p) : p = 2 ∨ p % 2 = 1