theorem isJacobson_iff_sInf_maximal' : IsJacobson R ↔ ∀ {I : Ideal R}, I.IsPrime →
    ∃ M : Set (Ideal R), (∀ J ∈ M, ∀ (K : Ideal R), J < K → K = ⊤) ∧ I = sInf M

Ideal.IsJacobson R ↔ ∀ {I : Ideal R}, I.IsPrime → ∃ M, (∀ J ∈ M, ∀ (K : Ideal R), J < K → K = ⊤) ∧ I = sInf M


@[simp]
theorem add_eq_sup (p q : Submodule R M) : p + q = p ⊔ q

{R : Type u_2}
{M : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(p q : Submodule R M)


@[to_additive (attr := simp, nolint simpNF)]
theorem Finset.tprod_subtype (s : Finset β) (f : β → α) :
    ∏' x : { x // x ∈ s }, f x = ∏ x ∈ s, f x

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

∑' (x : { x // x ∈ s }), f ↑x = ∑ x ∈ s, f x


@[simp]
theorem preserves_lift_mapCone (c₁ c₂ : Cone F) (t : IsLimit c₁) :
    (PreservesLimit.preserves t).lift (G.mapCone c₂) = G.map (t.lift c₂)

(CategoryTheory.Limits.PreservesLimit.preserves t).lift (G.mapCone c₂) = G.map (t.lift c₂)


/-- If two `σ`-linear maps from `R` are equal on `1`, then they are equal. -/
@[ext high]
theorem ext_ring {f g : R →ₛₗ[σ] M₃} (h : f 1 = g 1) : f = g

{R : Type u_1}
{S : Type u_6}
{M₃ : Type u_12}
[Semiring R]
[Semiring S]
[AddCommMonoid M₃]
[Module S M₃]
{σ : R →+* S}
{f g : R →ₛₗ[σ] M₃}
(h : f 1 = g 1)


theorem mkPiAlgebraFin_apply_const (a : A) :
    (MultilinearMap.mkPiAlgebraFin R n A fun _ => a) = a ^ n

{R : Type uR}
{n : ℕ}
[CommSemiring R]
{A : Type u_1}
[Semiring A]
[Algebra R A]
(a : A)

((MultilinearMap.mkPiAlgebraFin R n A) fun x => a) = a ^ n


theorem Lex.mono_left {r₁ r₂ : ι → ι → Prop} {s : ∀ i, α i → α i → Prop}
    (hr : ∀ a b, r₁ a b → r₂ a b) {a b : Σ' i, α i} (h : Lex r₁ s a b) : Lex r₂ s a b

{ι : Sort u_1}
{α : ι → Sort u_2}
{r₁ r₂ : ι → ι → Prop}
{s : (i : ι) → α i → α i → Prop}
(hr : ∀ (a b : ι), r₁ a b → r₂ a b)
{a b : (i : ι) ×' α i}
(h : PSigma.Lex r₁ s a b)


/-- The obvious functor `(ShortComplex C)ᵒᵖ ⥤ ShortComplex Cᵒᵖ`. -/
@[simps]
def opFunctor : (ShortComplex C)ᵒᵖ ⥤ ShortComplex Cᵒᵖ

∀ {X Y : (CategoryTheory.ShortComplex C)ᵒᵖ} (φ : X ⟶ Y),
  (CategoryTheory.ShortComplex.opFunctor C).map φ = CategoryTheory.ShortComplex.opMap φ.unop


lemma level_one (χ : DirichletCharacter R 1) : χ = 1

{R : Type u_1}
[CommMonoidWithZero R]
(χ : DirichletCharacter R 1)


@[simp, norm_cast]
theorem coe_mul : ((f * g : RatFunc F) : LaurentSeries F) = f * g

{F : Type u}
[Field F]
(f g : RatFunc F)


@[to_additive] lemma bot_ne_one : (⊥ : Interval α) ≠ 1


theorem nhds_order_unbounded [OrderTopology α] {a : α} (hu : ∃ u, a < u) (hl : ∃ l, l < a) :
    𝓝 a = ⨅ (l) (_ : l < a) (u) (_ : a < u), 𝓟 (Ioo l u)

{α : Type u}
[TopologicalSpace α]
[Preorder α]
[OrderTopology α]
{a : α}
(hu : ∃ u, a < u)
(hl : ∃ l, l < a)

𝓝 a = ⨅ l, ⨅ (_ : l < a), ⨅ u, ⨅ (_ : a < u), 𝓟 (Set.Ioo l u)


@[simp]
theorem monovaryOn_toDual_left : MonovaryOn (toDual ∘ f) g s ↔ AntivaryOn f g s

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
{f : ι → α}
{g : ι → β}
{s : Set ι}

MonovaryOn (⇑OrderDual.toDual ∘ f) g s ↔ AntivaryOn f g s


/-- Induct using scaled versions of `PiTensorProduct.tprod`. -/
@[elab_as_elim]
protected theorem induction_on {motive : (⨂[R] i, s i) → Prop} (z : ⨂[R] i, s i)
    (smul_tprod : ∀ (r : R) (f : Π i, s i), motive (r • tprod R f))
    (add : ∀ x y, motive x → motive y → motive (x + y)) :
    motive z

{motive : (PiTensorProduct R fun i => s i) → Prop}

(smul_tprod : ∀ (r : R) (f : (i : ι) → s i), motive (r • (PiTensorProduct.tprod R) f))

(add : ∀ (x y : PiTensorProduct R fun i => s i), motive x → motive y → motive (x + y))


protected
theorem neZero [h : IsCyclotomicExtension {n} A B] [IsDomain B] : NeZero ((n : ℕ) : B)

(n : ℕ+)
(A : Type u)
(B : Type v)
[CommRing A]
[CommRing B]
[Algebra A B]
[h : IsCyclotomicExtension {n} A B]
[IsDomain B]


/-- Suppose we have a commutative square of functors

      Q
    A → B
  U ↓   ↓ V
    C → D
      R

where `U` has a left adjoint, `A` has reflexive coequalizers and `V` is monadic.
Then `Q` has a left adjoint if `R` has a left adjoint.

See https://ncatlab.org/nlab/show/adjoint+lifting+theorem
-/
lemma monadicAdjointSquareLift (Q : A ⥤ B) (V : B ⥤ D) (U : A ⥤ C) (R : C ⥤ D)
    (comm : U ⋙ R ≅ Q ⋙ V) [U.IsRightAdjoint] [MonadicRightAdjoint V] [R.IsRightAdjoint]
    [HasReflexiveCoequalizers A] : Q.IsRightAdjoint


theorem Btw.btw.cyclic_left {a b c : α} (h : btw a b c) : btw b c a

{α : Type u_1}
[CircularPreorder α]
{a b c : α}
(h : btw a b c)


theorem rdropWhile_last_not (hl : l.rdropWhile p ≠ []) : ¬p ((rdropWhile p l).getLast hl)

{α : Type u_1}
(p : α → Bool)
(l : List α)
(hl : List.rdropWhile p l ≠ [])

¬p ((List.rdropWhile p l).getLast hl) = true


theorem expComparison_ev (A B : C) :
    Limits.prod.map (𝟙 (F.obj A)) ((expComparison F A).app B) ≫ (exp.ev (F.obj A)).app (F.obj B) =
      inv (prodComparison F _ _) ≫ F.map ((exp.ev _).app _)

[CategoryTheory.Limits.PreservesLimitsOfShape (CategoryTheory.Discrete CategoryTheory.Limits.WalkingPair) F]

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Limits.prod.map (CategoryTheory.CategoryStruct.id (F.obj A))
      ((CategoryTheory.expComparison F A).app B))
    ((CategoryTheory.exp.ev (F.obj A)).app (F.obj B)) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.inv (CategoryTheory.Limits.prodComparison F A (A ⟹ B)))
    (F.map ((CategoryTheory.exp.ev A).app B))


/-- The identity functor induces the identity functor on matrix categories.
-/
@[simps!]
def mapMatId : (𝟭 C).mapMat_ ≅ 𝟭 (Mat_ C)

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

CategoryTheory.Functor.mapMatId.hom.app X = 𝟙 ((𝟭 C).mapMat_.obj X)


theorem eq_C_of_derivative_eq_zero [NoZeroSMulDivisors ℕ R] {f : R[X]} (h : derivative f = 0) :
    f = C (f.coeff 0)

{R : Type u}
[Semiring R]
[NoZeroSMulDivisors ℕ R]
{f : R[X]}
(h : Polynomial.derivative f = 0)


theorem map_id : ∀ p : MvPolynomial σ R, map (RingHom.id R) p = p

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(p : MvPolynomial σ R)


lemma antilipschitzWith_mul_right {a : α} (ha : a ≠ 0) : AntilipschitzWith (‖a‖₊⁻¹) (· * a)

{α : Type u_1}
[NormedDivisionRing α]
{a : α}
(ha : a ≠ 0)


/-- Given a cone `c` over `F`, we can interpret the legs of `c` as structured arrows
    `c.pt ⟶ F.obj -`. -/
@[simps]
def Cone.toStructuredArrow {F : J ⥤ C} (c : Cone F) : J ⥤ StructuredArrow c.pt F

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

c.toStructuredArrow.obj j = CategoryTheory.StructuredArrow.mk (c.π.app j)


/-- A `StrictOrderedRing` is a ring with a partial order such that addition is strictly monotone
and multiplication by a positive number is strictly monotone. -/
class StrictOrderedRing (α : Type u) extends Ring α, OrderedAddCommGroup α, Nontrivial α where
  /-- In a strict ordered ring, `0 ≤ 1`. -/
  protected zero_le_one : 0 ≤ (1 : α)
  /-- The product of two positive elements is positive. -/
  protected mul_pos : ∀ a b : α, 0 < a → 0 < b → 0 < a * b

{α : Type u}
[self : StrictOrderedRing α]
(a b : α)


theorem val_inj {a b : Fin n} : a.1 = b.1 ↔ a = b


theorem insert_of_neg {a} {b : β a} {s : AList β} (h : a ∉ s) :
    insert a b s = ⟨⟨a, b⟩ :: s.entries, nodupKeys_cons.2 ⟨h, s.2⟩⟩

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{b : β a}
{s : AList β}
(h : a ∉ s)

AList.insert a b s = { entries := ⟨a, b⟩ :: s.entries, nodupKeys := ⋯ }


/-- When there is a global minimum, every set is bounded below. -/
@[simp]
protected theorem OrderBot.bddBelow [OrderBot α] (s : Set α) : BddBelow s

{α : Type u}
[Preorder α]
[OrderBot α]
(s : Set α)


theorem prod_apply_symm {s : Set (α × β)} (hs : MeasurableSet s) :
    μ.prod ν s = ∫⁻ y, μ ((fun x => (x, y)) ⁻¹' s) ∂ν

{α : Type u_1}
{β : Type u_3}
[MeasurableSpace α]
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{ν : MeasureTheory.Measure β}
[MeasureTheory.SFinite ν]
[MeasureTheory.SFinite μ]
{s : Set (α × β)}
(hs : MeasurableSet s)

(μ.prod ν) s = ∫⁻ (y : β), μ ((fun x => (x, y)) ⁻¹' s) ∂ν


@[to_additive (attr := simp)]
theorem smul_Lp_const [IsFiniteMeasure μ] (c : Mᵈᵐᵃ) (a : E) :
    c • Lp.const p μ a = Lp.const p μ a

[MeasureTheory.VAddInvariantMeasure M α μ]

c +ᵥ (MeasureTheory.Lp.const p μ) a = (MeasureTheory.Lp.const p μ) a


@[to_additive]
theorem prod_mul_tprod_subtype_compl [T2Space α] {f : β → α} (hf : Multipliable f) (s : Finset β) :
    (∏ x ∈ s, f x) * ∏' x : { x // x ∉ s }, f x = ∏' x, f x

{α : Type u_1}
{β : Type u_2}
[CommGroup α]
[UniformSpace α]
[UniformGroup α]
[CompleteSpace α]
[T2Space α]
{f : β → α}
(hf : Multipliable f)
(s : Finset β)

(∏ x ∈ s, f x) * ∏' (x : { x // x ∉ s }), f ↑x = ∏' (x : β), f x


theorem coeSubmodule_mono {I J : Ideal R} (h : I ≤ J) : coeSubmodule S I ≤ coeSubmodule S J

{R : Type u_1}
[CommRing R]
(S : Type u_2)
[CommRing S]
[Algebra R S]
{I J : Ideal R}
(h : I ≤ J)

IsLocalization.coeSubmodule S I ≤ IsLocalization.coeSubmodule S J


protected lemma mul_one (x : ⨂[R] i, A i) : mul x (tprod R 1) = x

[∀ (i : ι), SMulCommClass R (A i) (A i)]

[∀ (i : ι), IsScalarTower R (A i) (A i)]

(PiTensorProduct.mul x) ((PiTensorProduct.tprod R) 1) = x


@[to_additive]
theorem eq_one_of_mul_le_one_left (ha : 1 ≤ a) (hb : 1 ≤ b) (hab : a * b ≤ 1) : a = 1

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


theorem ofDigits_modEq' (b b' : ℕ) (k : ℕ) (h : b ≡ b' [MOD k]) (L : List ℕ) :
    ofDigits b L ≡ ofDigits b' L [MOD k]

(b b' k : ℕ)
(h : b ≡ b' [MOD k])
(L : List ℕ)

Nat.ofDigits b L ≡ Nat.ofDigits b' L [MOD k]


@[mono]
theorem cliqueFinset_mono (h : G ≤ H) : G.cliqueFinset n ⊆ H.cliqueFinset n

{α : Type u_1}
{G : SimpleGraph α}
(H : SimpleGraph α)
[Fintype α]
[DecidableEq α]
[DecidableRel G.Adj]
{n : ℕ}
[DecidableRel H.Adj]
(h : G ≤ H)


@[simp]
theorem type_def (r) [wo : IsWellOrder α r] : (⟦⟨α, r, wo⟩⟧ : Ordinal) = type r

{α : Type u}
(r : α → α → Prop)
[wo : IsWellOrder α r]

⟦{ α := α, r := r, wo := wo }⟧ = Ordinal.type r


lemma rpow_mul_intCast (x : ℝ≥0∞) (y : ℝ) (n : ℤ) : x ^ (y * n) = (x ^ y) ^ n


lemma eulerMascheroniConstant_lt_eulerMascheroniSeq' (n : ℕ) :
    eulerMascheroniConstant < eulerMascheroniSeq' n

Real.eulerMascheroniConstant < Real.eulerMascheroniSeq' n


@[simp]
theorem getOrElse_none (d : α) [Decidable (none : Part α).Dom] : getOrElse none d = d

{α : Type u_1}
(d : α)
[Decidable Part.none.Dom]


@[simp]
theorem reverse_snoc : reverse (xs.snoc x) = x ::ᵥ (reverse xs)

{α : Type u_1}
{n : ℕ}
(xs : Mathlib.Vector α n)
{x : α}


@[reassoc (attr := simp)]
theorem kernelComparison_comp_ι [HasKernel f] [HasKernel (G.map f)] :
    kernelComparison f G ≫ kernel.ι (G.map f) = G.map (kernel.ι f)

CategoryTheory.Limits.kernelComparison f G ≫ CategoryTheory.Limits.kernel.ι (G.map f) =
  G.map (CategoryTheory.Limits.kernel.ι f)


@[to_additive]
theorem div_eq_one : a / b = 1 ↔ a = b


lemma norm_fourierSMulRight (L : V →L[ℝ] W →L[ℝ] ℝ) (f : V → E) (v : V) :
    ‖fourierSMulRight L f v‖ = (2 * π) * ‖L v‖ * ‖f v‖

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{V : Type u_2}
{W : Type u_3}
[NormedAddCommGroup V]
[NormedSpace ℝ V]
[NormedAddCommGroup W]
[NormedSpace ℝ W]
(L : V →L[ℝ] W →L[ℝ] ℝ)
(f : V → E)
(v : V)

‖VectorFourier.fourierSMulRight L f v‖ = 2 * π * ‖L v‖ * ‖f v‖


lemma IsInitSeg.exists_initSeg (h𝒜 : IsInitSeg 𝒜 r) (h𝒜₀ : 𝒜.Nonempty) :
    ∃ s : Finset α, s.card = r ∧ 𝒜 = initSeg s

{α : Type u_1}
[LinearOrder α]
{𝒜 : Finset (Finset α)}
{r : ℕ}
[Fintype α]
(h𝒜 : Finset.Colex.IsInitSeg 𝒜 r)
(h𝒜₀ : 𝒜.Nonempty)

∃ s, s.card = r ∧ 𝒜 = Finset.Colex.initSeg s


lemma rnDeriv_add_of_mutuallySingular (ν₁ ν₂ μ : Measure α)
    [SigmaFinite ν₁] [SigmaFinite ν₂] [SigmaFinite μ] (h : ν₂ ⟂ₘ μ) :
    (ν₁ + ν₂).rnDeriv μ =ᵐ[μ] ν₁.rnDeriv μ

{α : Type u_1}
{m : MeasurableSpace α}
(ν₁ ν₂ μ : MeasureTheory.Measure α)
[MeasureTheory.SigmaFinite ν₁]
[MeasureTheory.SigmaFinite ν₂]
[MeasureTheory.SigmaFinite μ]
(h : ν₂ ⟂ₘ μ)


theorem closedComplemented_iff_isClosed_exists_isClosed_isCompl :
    p.ClosedComplemented ↔
      IsClosed (p : Set E) ∧ ∃ q : Submodule 𝕜 E, IsClosed (q : Set E) ∧ IsCompl p q

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

Submodule.ClosedComplemented p ↔ IsClosed ↑p ∧ ∃ q, IsClosed ↑q ∧ IsCompl p q


lemma zpow_neg_mul_zpow_self (n : ℤ) (ha : a ≠ 0) : a ^ (-n) * a ^ n = 1

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


/-- Given a point in an affine subspace, a vector is in its direction if and only if it results from
subtracting that point on the left. -/
theorem mem_direction_iff_eq_vsub_left {s : AffineSubspace k P} {p : P} (hp : p ∈ s) (v : V) :
    v ∈ s.direction ↔ ∃ p2 ∈ s, v = p -ᵥ p2

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s : AffineSubspace k P}
{p : P}
(hp : p ∈ s)
(v : V)


@[simp]
theorem fst_prod (f : A →⋆ₙₐ[R] B) (g : A →⋆ₙₐ[R] C) : (fst R B C).comp (prod f g) = f

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
[Monoid R]
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[Star A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction R B]
[Star B]
[NonUnitalNonAssocSemiring C]
[DistribMulAction R C]
[Star C]
(f : A →⋆ₙₐ[R] B)
(g : A →⋆ₙₐ[R] C)

(NonUnitalStarAlgHom.fst R B C).comp (f.prod g) = f


theorem isBounded_principal (s : Set α) : IsBounded r (𝓟 s) ↔ ∃ t, ∀ x ∈ s, r x t

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

Filter.IsBounded r (𝓟 s) ↔ ∃ t, ∀ x ∈ s, r x t


/-- An auxiliary lemma for Liouville's theorem `Differentiable.apply_eq_apply_of_bounded`. -/
theorem liouville_theorem_aux {f : ℂ → F} (hf : Differentiable ℂ f) (hb : IsBounded (range f))
    (z w : ℂ) : f z = f w

(hb : Bornology.IsBounded (Set.range f))


theorem eq_σ_of_epi {n : ℕ} (θ : mk (n + 1) ⟶ mk n) [Epi θ] : ∃ i : Fin (n + 1), θ = σ i

(θ : SimplexCategory.mk (n + 1) ⟶ SimplexCategory.mk n)


/-- A Hölder continuous function is uniformly continuous -/
protected theorem uniformContinuous (hf : HolderWith C r f) (h0 : 0 < r) : UniformContinuous f

{X : Type u_1}
{Y : Type u_2}
[PseudoEMetricSpace X]
[PseudoEMetricSpace Y]
{C r : ℝ≥0}
{f : X → Y}
(hf : HolderWith C r f)
(h0 : 0 < r)


lemma cancel_left_div_gcd' (hm : 0 < m) (hcd : c ≡ d [MOD m]) (h : c * a ≡ d * b [MOD m]) :
    a ≡ b [MOD m / gcd m c]

{m a b c d : ℕ}
(hm : 0 < m)
(hcd : c ≡ d [MOD m])
(h : c * a ≡ d * b [MOD m])


theorem card_uIcc :
    (uIcc f g).card = ∏ i ∈ f.support ∪ g.support, (uIcc (f i) (g i)).card

{ι : Type u_1}
{α : Type u_2}
[Lattice α]
[Zero α]
[LocallyFiniteOrder α]
(f g : ι →₀ α)

(Finset.uIcc f g).card = ∏ i ∈ f.support ∪ g.support, (Finset.uIcc (f i) (g i)).card


@[simp]
theorem restriction_zero : restriction (0 : R[X]) = 0


@[to_additive (attr := norm_cast, simp)]
lemma orbitRel.Quotient.mem_subgroup_orbit_iff {H : Subgroup G} {x : orbitRel.Quotient G α}
    {a b : x.orbit} : (a : α) ∈ MulAction.orbit H (b : α) ↔ a ∈ MulAction.orbit H b

{G : Type u_1}
{α : Type u_2}
[AddGroup G]
[AddAction G α]
{H : AddSubgroup G}
{x : AddAction.orbitRel.Quotient G α}
{a b : ↑x.orbit}

↑a ∈ AddAction.orbit ↥H ↑b ↔ a ∈ AddAction.orbit (↥H) b


/-- A Sylow `p`-subgroup is a maximal `p`-subgroup. -/
structure Sylow extends Subgroup G where
  isPGroup' : IsPGroup p toSubgroup
  is_maximal' : ∀ {Q : Subgroup G}, IsPGroup p Q → toSubgroup ≤ Q → Q = toSubgroup

{p : ℕ}
{G : Type u_1}
[Group G]
(self : Sylow p G)
{Q : Subgroup G}


@[simp]
theorem mapL_one : mapL (fun (i : ι) ↦ (1 : E i →L[𝕜] E i)) = 1

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


lemma MorphismProperty.RightFraction.map_eq_iff
    {X Y : C} (φ ψ : W.RightFraction X Y) :
    φ.map L (Localization.inverts _ _) = ψ.map L (Localization.inverts _ _) ↔
      RightFractionRel φ ψ

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
(L : CategoryTheory.Functor C D)
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
[W.HasRightCalculusOfFractions]
{X Y : C}
(φ ψ : W.RightFraction X Y)

φ.map L ⋯ = ψ.map L ⋯ ↔ CategoryTheory.MorphismProperty.RightFractionRel φ ψ


theorem Finset.prod_primes_dvd [CancelCommMonoidWithZero α] [Unique αˣ] {s : Finset α} (n : α)
    (h : ∀ a ∈ s, Prime a) (div : ∀ a ∈ s, a ∣ n) : (∏ p ∈ s, p) ∣ n

{α : Type u_1}
[CancelCommMonoidWithZero α]
[Unique αˣ]
{s : Finset α}
(n : α)
(h : ∀ a ∈ s, Prime a)
(div : ∀ a ∈ s, a ∣ n)


theorem CharP.neg_one_pow_char_pow [Ring R] (p n : ℕ) [CharP R p] [Fact p.Prime] :
    (-1 : R) ^ p ^ n = -1

(R : Type u_1)
[Ring R]
(p n : ℕ)
[CharP R p]
[Fact (Nat.Prime p)]


@[simp] theorem length_leftInvSeq (ω : List B) : (lis ω).length = ω.length

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
(ω : List B)


@[simp]
theorem evariance_zero : evariance 0 μ = 0

{Ω : Type u_1}
{m : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}


@[measurability]
theorem add_measure [PseudoMetrizableSpace β] {ν : Measure α} {f : α → β}
    (hμ : AEStronglyMeasurable f μ) (hν : AEStronglyMeasurable f ν) :
    AEStronglyMeasurable f (μ + ν)

(hμ : MeasureTheory.AEStronglyMeasurable f μ)

(hν : MeasureTheory.AEStronglyMeasurable f ν)

MeasureTheory.AEStronglyMeasurable f (μ + ν)


theorem orderEmbOfFin_apply (s : Finset α) {k : ℕ} (h : s.card = k) (i : Fin k) :
    s.orderEmbOfFin h i =
      (s.sort (· ≤ ·)).get ⟨i, by rw [length_sort, h]; exact i.2⟩

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

(s.orderEmbOfFin h) i = (Finset.sort (fun x x_1 => x ≤ x_1) s).get ⟨↑i, ⋯⟩


@[simp] theorem cons_merge_cons_neg (s : α → α → Bool) (l r) (h : ¬ s a b) :
    merge s (a::l) (b::r) = b :: merge s (a::l) r

{α : Type u_1}
{a b : α}
(s : α → α → Bool)
(l r : List α)
(h : ¬s a b = true)

List.merge s (a :: l) (b :: r) = b :: List.merge s (a :: l) r


@[to_additive (attr := simp)]
theorem comap_rel {f : M → N} (H : ∀ x y, f (x * y) = f x * f y) {c : Con N} {x y : M} :
    comap f H c x y ↔ c (f x) (f y)

(H : ∀ (x y : M), f (x * y) = f x * f y)


/-- Lower bound on the edge densities between parts of `SzemerediRegularity.increment`. This is the
blanket lower bound used the uniform parts. -/
theorem edgeDensity_chunk_uniform [Nonempty α] (hPα : P.parts.card * 16 ^ P.parts.card ≤ card α)
    (hPε : ↑100 ≤ ↑4 ^ P.parts.card * ε ^ 5) (hU : U ∈ P.parts) (hV : V ∈ P.parts) :
    (G.edgeDensity U V : ℝ) ^ 2 - ε ^ 5 / ↑25 ≤
    (∑ ab ∈ (chunk hP G ε hU).parts.product (chunk hP G ε hV).parts,
      (G.edgeDensity ab.1 ab.2 : ℝ) ^ 2) / ↑16 ^ P.parts.card

(hPα : P.parts.card * 16 ^ P.parts.card ≤ Fintype.card α)

↑(G.edgeDensity U V) ^ 2 - ε ^ 5 / 25 ≤
  (∑ ab ∈ (SzemerediRegularity.chunk hP G ε hU).parts.product (SzemerediRegularity.chunk hP G ε hV).parts,
      ↑(G.edgeDensity ab.1 ab.2) ^ 2) /
    16 ^ P.parts.card


@[simp]
lemma ofHom_v (φ : F ⟶ G) (p : ℤ) : (ofHom φ).v p p (add_zero p) = φ.f p

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

(CochainComplex.HomComplex.Cochain.ofHom φ).v p p ⋯ = φ.f p


theorem eq_prod_roots_of_splits {p : K[X]} {i : K →+* L} (hsplit : Splits i p) :
    p.map i = C (i p.leadingCoeff) * ((p.map i).roots.map fun a => X - C a).prod

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

Polynomial.map i p =
  Polynomial.C (i p.leadingCoeff) *
    (Multiset.map (fun a => Polynomial.X - Polynomial.C a) (Polynomial.map i p).roots).prod


lemma mk' (h : S.RightHomologyData) : HasRightHomology S


@[simp]
theorem eraseLead_add_monomial_natDegree_leadingCoeff (f : R[X]) :
    f.eraseLead + monomial f.natDegree f.leadingCoeff = f

f.eraseLead + (Polynomial.monomial f.natDegree) f.leadingCoeff = f


theorem ContinuousOn.vsub {f g : α → P} {s : Set α} (hf : ContinuousOn f s)
    (hg : ContinuousOn g s) : ContinuousOn (f -ᵥ g) s

{α : Type u_1}
{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[TopologicalSpace α]
{f g : α → P}
{s : Set α}
(hf : ContinuousOn f s)
(hg : ContinuousOn g s)


/-- Mapping by `f` and then forgetting is the same as forgetting. -/
theorem mapForget_eq {X Y : T} (f : X ⟶ Y) :
    (map f) ⋙ (forget Y) = (forget X)

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

(CategoryTheory.Over.map f).comp (CategoryTheory.Over.forget Y) = CategoryTheory.Over.forget X


/-- A version of `linearDependent_comp_subtype'` with `Finsupp.total` unfolded. -/
theorem linearDependent_comp_subtype {s : Set ι} :
    ¬LinearIndependent R (v ∘ (↑) : s → M) ↔
      ∃ f : ι →₀ R, f ∈ Finsupp.supported R R s ∧ ∑ i ∈ f.support, f i • v i = 0 ∧ f ≠ 0

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

¬LinearIndependent (ι := ↑s) R (v ∘ Subtype.val) ↔ ∃ f ∈ Finsupp.supported R R s, ∑ i ∈ f.support, f i • v i = 0 ∧ f ≠ 0


theorem FinitaryExtensive.mono_inr_of_isColimit [FinitaryExtensive C] {c : BinaryCofan X Y}
    (hc : IsColimit c) : Mono c.inr

{c : CategoryTheory.Limits.BinaryCofan X Y}

(hc : CategoryTheory.Limits.IsColimit c)


@[to_additive (attr := simp)]
theorem ofList_toList (xs : FreeMonoid α) : ofList (toList xs) = xs

FreeMonoid.ofList (FreeMonoid.toList xs) = xs


theorem Filter.EventuallyEq.hasLineDerivAt_iff (h : f₀ =ᶠ[𝓝 x] f₁) :
    HasLineDerivAt 𝕜 f₀ f' x v ↔ HasLineDerivAt 𝕜 f₁ f' x v

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f₀ f₁ : E → F}
{f' : F}
{x v : E}
(h : f₀ =ᶠ[𝓝 x] f₁)


/-- Identity map is a relation embedding. -/
@[refl, simps!]
protected def refl (r : α → α → Prop) : r ↪r r

{α : Type u_1}
(r : α → α → Prop)
(a : α)


theorem differentiable_norm_rpow {p : ℝ} (hp : 1 < p) :
    Differentiable ℝ (fun x : E ↦ ‖x‖ ^ p)

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
{p : ℝ}
(hp : 1 < p)


/-- The **Gelfand transform** is an algebra homomorphism (over `𝕜`) from a topological `𝕜`-algebra
`A` into the `𝕜`-algebra of continuous `𝕜`-valued functions on the `characterSpace 𝕜 A`.
The character space itself consists of all algebra homomorphisms from `A` to `𝕜`.  -/
@[simps]
def gelfandTransform : A →ₐ[𝕜] C(characterSpace 𝕜 A, 𝕜)

(𝕜 : Type u_1)
(A : Type u_2)
[CommRing 𝕜]
[NoZeroDivisors 𝕜]
[TopologicalSpace 𝕜]
[TopologicalRing 𝕜]
[TopologicalSpace A]
[Semiring A]
[Algebra 𝕜 A]
(a : A)
(φ : ↑(WeakDual.characterSpace 𝕜 A))

((WeakDual.gelfandTransform 𝕜 A) a) φ = φ a


@[simp]
theorem MulEquiv.restrictRootsOfUnity_symm (σ : R ≃* S) :
    (σ.restrictRootsOfUnity k).symm = σ.symm.restrictRootsOfUnity k

{R : Type u_4}
{S : Type u_5}
{k : ℕ+}
[CommMonoid R]
[CommMonoid S]
(σ : R ≃* S)


@[simp]
theorem compl_iSup₂ (f : ∀ i, κ i → LowerSet α) :
    (⨆ (i) (j), f i j).compl = ⨆ (i) (j), (f i j).compl

{α : Type u_1}
{ι : Sort u_4}
{κ : ι → Sort u_5}
[LE α]
(f : (i : ι) → κ i → LowerSet α)

(⨆ i, ⨆ j, f i j).compl = ⨆ i, ⨆ j, (f i j).compl


theorem coeff_derivative (p : R[X]) (n : ℕ) :
    coeff (derivative p) n = coeff p (n + 1) * (n + 1)

{R : Type u}
[Semiring R]
(p : R[X])
(n : ℕ)

(Polynomial.derivative p).coeff n = p.coeff (n + 1) * (↑n + 1)


/--
This typeclass captures properties shared by ℝ and ℂ, with an API that closely matches that of ℂ.
-/
class RCLike (K : semiOutParam Type*) extends DenselyNormedField K, StarRing K,
    NormedAlgebra ℝ K, CompleteSpace K where
  re : K →+ ℝ
  im : K →+ ℝ
  /-- Imaginary unit in `K`. Meant to be set to `0` for `K = ℝ`. -/
  I : K
  I_re_ax : re I = 0
  I_mul_I_ax : I = 0 ∨ I * I = -1
  re_add_im_ax : ∀ z : K, 𝓚 (re z) + 𝓚 (im z) * I = z
  ofReal_re_ax : ∀ r : ℝ, re (𝓚 r) = r
  ofReal_im_ax : ∀ r : ℝ, im (𝓚 r) = 0
  mul_re_ax : ∀ z w : K, re (z * w) = re z * re w - im z * im w
  mul_im_ax : ∀ z w : K, im (z * w) = re z * im w + im z * re w
  conj_re_ax : ∀ z : K, re (conj z) = re z
  conj_im_ax : ∀ z : K, im (conj z) = -im z
  conj_I_ax : conj I = -I
  norm_sq_eq_def_ax : ∀ z : K, ‖z‖ ^ 2 = re z * re z + im z * im z
  mul_im_I_ax : ∀ z : K, im z * im I = im z
  /-- only an instance in the `ComplexOrder` locale -/
  [toPartialOrder : PartialOrder K]
  le_iff_re_im {z w : K} : z ≤ w ↔ re z ≤ re w ∧ im z = im w
  -- note we cannot put this in the `extends` clause
  [toDecidableEq : DecidableEq K]

{K : semiOutParam (Type u_1)}
[self : RCLike K]
(z w : K)

RCLike.re (z * w) = RCLike.re z * RCLike.re w - RCLike.im z * RCLike.im w


@[simp, norm_cast]
theorem ascPochhammer_eval_cast (n k : ℕ) :
    (((ascPochhammer ℕ n).eval k : ℕ) : S) = ((ascPochhammer S n).eval k : S)

↑(Polynomial.eval k (ascPochhammer ℕ n)) = Polynomial.eval (↑k) (ascPochhammer S n)


theorem Set.Subsingleton.measurableSet {s : Set α} (hs : s.Subsingleton) : MeasurableSet s

{α : Type u_1}
[MeasurableSpace α]
[MeasurableSingletonClass α]
{s : Set α}
(hs : s.Subsingleton)


theorem closure_thickening_subset_cthickening (δ : ℝ) (E : Set α) :
    closure (thickening δ E) ⊆ cthickening δ E

{α : Type u}
[PseudoEMetricSpace α]
(δ : ℝ)
(E : Set α)

closure (Metric.thickening δ E) ⊆ Metric.cthickening δ E


theorem exists_s_b_of_partDen {b : α}
    (nth_partDen_eq : g.partDens.get? n = some b) :
    ∃ gp, g.s.get? n = some gp ∧ gp.b = b


@[simp]
lemma ψ_four : W.ψ 4 = C W.preΨ₄ * W.ψ₂

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


theorem support_inf_union_support_sup : (f ⊓ g).support ∪ (f ⊔ g).support = f.support ∪ g.support

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


@[simp, arith_mult]
theorem map_one {f : ArithmeticFunction R} (h : f.IsMultiplicative) : f 1 = 1

{R : Type u_1}
[MonoidWithZero R]
{f : ArithmeticFunction R}
(h : f.IsMultiplicative)


theorem disjSups_disjSups_disjSups_comm : s ○ t ○ (u ○ v) = s ○ u ○ (t ○ v)

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

(s.disjSups t).disjSups (u.disjSups v) = (s.disjSups u).disjSups (t.disjSups v)


theorem inner_.norm_sq (x : E) : ‖x‖ ^ 2 = re (inner_ 𝕜 x x)

{𝕜 : Type u_1}
[RCLike 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
(x : E)


/-- A dilation from a metric space is a uniform inducing map -/
protected theorem uniformInducing : UniformInducing (f : α → β)

{α : Type u_1}
{β : Type u_2}
{F : Type u_4}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
[FunLike F α β]
[DilationClass F α β]
(f : F)


theorem intValuation.le_max_iff_min_le {a b c : ℕ} :
    Multiplicative.ofAdd (-c : ℤ) ≤
      max (Multiplicative.ofAdd (-a : ℤ)) (Multiplicative.ofAdd (-b : ℤ)) ↔
      min a b ≤ c

Multiplicative.ofAdd (-↑c) ≤ max (Multiplicative.ofAdd (-↑a)) (Multiplicative.ofAdd (-↑b)) ↔ min a b ≤ c


theorem mk_eq_mk' (f : Polynomial K) {g : Polynomial K} (hg : g ≠ 0) :
    RatFunc.mk f g = IsLocalization.mk' (RatFunc K) f ⟨g, mem_nonZeroDivisors_iff_ne_zero.2 hg⟩

{K : Type u}
[CommRing K]
[IsDomain K]
(f : K[X])
{g : K[X]}
(hg : g ≠ 0)

RatFunc.mk f g = IsLocalization.mk' (RatFunc K) f ⟨g, ⋯⟩


theorem id_whiskerRight_bimod {X Y Z : Mon_ C} {M : Bimod X Y} {N : Bimod Y Z} :
    whiskerRight (𝟙 M) N = 𝟙 (M.tensorBimod N)

[(X : C) →
    CategoryTheory.Limits.PreservesColimitsOfSize.{0, 0, v₁, v₁, u₁, u₁} (CategoryTheory.MonoidalCategory.tensorLeft X)]

[(X : C) →
    CategoryTheory.Limits.PreservesColimitsOfSize.{0, 0, v₁, v₁, u₁, u₁}
      (CategoryTheory.MonoidalCategory.tensorRight X)]

Bimod.whiskerRight (𝟙 M) N = 𝟙 (M.tensorBimod N)


theorem count_ne_zero_iff_dvd {a p : α} (ha0 : a ≠ 0) (hp : Irreducible p) :
    (Associates.mk p).count (Associates.mk a).factors ≠ 0 ↔ p ∣ a

[(p : Associates α) → Decidable (Irreducible p)]


/-- Equivalent characterizations for equicontinuity of a family of continuous linear maps
between normed spaces. See also `WithSeminorms.equicontinuous_TFAE` for similar characterizations
between spaces satisfying `WithSeminorms`. -/
protected theorem NormedSpace.equicontinuous_TFAE : List.TFAE
    [ EquicontinuousAt ((↑) ∘ f) 0,
      Equicontinuous ((↑) ∘ f),
      UniformEquicontinuous ((↑) ∘ f),
      ∃ C, ∀ i x, ‖f i x‖ ≤ C * ‖x‖,
      ∃ C ≥ 0, ∀ i x, ‖f i x‖ ≤ C * ‖x‖,
      ∃ C, ∀ i, ‖f i‖ ≤ C,
      ∃ C ≥ 0, ∀ i, ‖f i‖ ≤ C,
      BddAbove (Set.range (‖f ·‖)),
      (⨆ i, (‖f i‖₊ : ENNReal)) < ⊤ ]

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
{ι : Type u_11}
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[RingHomIsometric σ₁₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
(f : ι → E →SL[σ₁₂] F)

[EquicontinuousAt (DFunLike.coe ∘ f) 0, Equicontinuous (DFunLike.coe ∘ f), UniformEquicontinuous (DFunLike.coe ∘ f),
    ∃ C, ∀ (i : ι) (x : E), ‖(f i) x‖ ≤ C * ‖x‖, ∃ C ≥ 0, ∀ (i : ι) (x : E), ‖(f i) x‖ ≤ C * ‖x‖,
    ∃ C, ∀ (i : ι), ‖f i‖ ≤ C, ∃ C ≥ 0, ∀ (i : ι), ‖f i‖ ≤ C, BddAbove (Set.range fun x => ‖f x‖),
    ⨆ i, ↑‖f i‖₊ < ⊤].TFAE


lemma Spec.locallyRingedSpaceObj_presheaf_map' (R : Type u) [CommRing R] {U V} (i : U ⟶ V) :
    (Spec.locallyRingedSpaceObj <| CommRingCat.of R).presheaf.map i =
    (structureSheaf R).1.map i

{U V : (TopologicalSpace.Opens ↑↑(AlgebraicGeometry.Spec.locallyRingedSpaceObj (CommRingCat.of R)).toPresheafedSpace)ᵒᵖ}

(AlgebraicGeometry.Spec.locallyRingedSpaceObj (CommRingCat.of R)).presheaf.map i =
  (AlgebraicGeometry.Spec.structureSheaf R).val.map i


theorem normalize_add_normalize (n₁ n₂) {d₁ d₂} (z₁ z₂) :
    normalize n₁ d₁ z₁ + normalize n₂ d₂ z₂ =
    normalize (n₁ * d₂ + n₂ * d₁) (d₁ * d₂) (Nat.mul_ne_zero z₁ z₂)

(n₁ n₂ : Int)
{d₁ d₂ : Nat}
(z₁ : d₁ ≠ 0)
(z₂ : d₂ ≠ 0)

Rat.normalize n₁ d₁ z₁ + Rat.normalize n₂ d₂ z₂ = Rat.normalize (n₁ * ↑d₂ + n₂ * ↑d₁) (d₁ * d₂) ⋯


/-- The `n+1`-th iterated derivative within a set with unique derivatives can be obtained by
differentiating the `n`-th iterated derivative. -/
theorem iteratedDerivWithin_succ {x : 𝕜} (hxs : UniqueDiffWithinAt 𝕜 s x) :
    iteratedDerivWithin (n + 1) f s x = derivWithin (iteratedDerivWithin n f s) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ}
{f : 𝕜 → F}
{s : Set 𝕜}
{x : 𝕜}
(hxs : UniqueDiffWithinAt 𝕜 s x)


@[to_additive (attr := simp)]
theorem nndist_div_left [Group G] [PseudoMetricSpace G] [IsometricSMul G G]
    [IsometricSMul Gᵐᵒᵖ G] (a b c : G) : nndist (a / b) (a / c) = nndist b c

{G : Type v}
[AddGroup G]
[PseudoMetricSpace G]
[IsometricVAdd G G]
[IsometricVAdd Gᵃᵒᵖ G]
(a b c : G)


/-- If the second of three points is strictly between the other two, the oriented angle at the
third point is zero. -/
theorem _root_.Sbtw.oangle₂₃₁_eq_zero {p₁ p₂ p₃ : P} (h : Sbtw ℝ p₁ p₂ p₃) : ∡ p₂ p₃ p₁ = 0

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


@[simp]
theorem ofEq_rfl {Q : QuadraticMap R M₁ N} : ofEq (rfl : Q = Q) = .id Q

{R : Type u_2}
{M₁ : Type u_4}
{N : Type u_8}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid N]
[Module R M₁]
[Module R N]
{Q : QuadraticMap R M₁ N}

QuadraticMap.Isometry.ofEq ⋯ = QuadraticMap.Isometry.id Q


theorem eqvGen_quot_rel_of_rel (x y : Σ j, F.obj j) :
    FilteredColimit.Rel.{v, u} F x y → EqvGen (Quot.Rel F) x y

{J : Type v}
[CategoryTheory.Category.{w, v} J]
(F : J ⥤ Type u)
(x y : (j : J) × F.obj j)

CategoryTheory.Limits.Types.FilteredColimit.Rel F x y → EqvGen (CategoryTheory.Limits.Types.Quot.Rel F) x y


theorem fix_def' {x : α} (h' : ¬∃ i, (Fix.approx f i x).Dom) : Part.fix f x = none

(f : ((a : α) → Part (β a)) → (a : α) → Part (β a))

(h' : ¬∃ i, (Part.Fix.approx f i x).Dom)


theorem pred_eq_iff_covBy : pred b = a ↔ a ⋖ b

{α : Type u_1}
[PartialOrder α]
[PredOrder α]
{a b : α}
[NoMinOrder α]


theorem two_nsmul_eq_iff {ψ θ : Angle} : (2 : ℕ) • ψ = (2 : ℕ) • θ ↔ ψ = θ ∨ ψ = θ + ↑π

2 • ψ = 2 • θ ↔ ψ = θ ∨ ψ = θ + ↑π


theorem mul_apply (f g : A →A[R] A) (x : A) : (f * g) x = f (g x)

{R : Type u_1}
[CommSemiring R]
{A : Type u_2}
[Semiring A]
[TopologicalSpace A]
[Algebra R A]
(f g : A →A[R] A)
(x : A)


/-- The multiplicity of prime `p` in `p` is `1` -/
@[simp]
theorem Prime.factorization_self {p : ℕ} (hp : Prime p) : p.factorization p = 1


@[ext] theorem ext_getElem? {l₁ l₂ : List α} (h : ∀ n : Nat, l₁[n]? = l₂[n]?) : l₁ = l₂

{α : Type u_1}
{l₁ l₂ : List α}
(h : ∀ (n : Nat), l₁[n]? = l₂[n]?)


theorem exists_top (p : E →ₗ.[ℝ] ℝ) (hp_nonneg : ∀ x : p.domain, (x : E) ∈ s → 0 ≤ p x)
    (hp_dense : ∀ y, ∃ x : p.domain, (x : E) + y ∈ s) :
    ∃ q ≥ p, q.domain = ⊤ ∧ ∀ x : q.domain, (x : E) ∈ s → 0 ≤ q x

(hp_nonneg : ∀ (x : ↥p.domain), ↑x ∈ s → 0 ≤ ↑p x)

∃ q ≥ p, q.domain = ⊤ ∧ ∀ (x : ↥q.domain), ↑x ∈ s → 0 ≤ ↑q x


@[to_additive (attr := simp)]
theorem coeHom_apply (x : Mˣ) : coeHom M x = ↑x


/-- If elements of a list commute with each other, then their product does not
depend on the order of elements. -/
@[to_additive "If elements of a list additively commute with each other, then their sum does not
depend on the order of elements."]
lemma Perm.prod_eq' (h : l₁ ~ l₂) (hc : l₁.Pairwise Commute) : l₁.prod = l₂.prod

{M : Type u_4}
[AddMonoid M]
{l₁ l₂ : List M}
(h : l₁ ~ l₂)
(hc : List.Pairwise AddCommute l₁)


/-- Given a colimit cocone for the family `f : J → (X ⟶ Y)`, for any `Z`, morphisms from the cocone
point to `Z` are in bijection with morphisms `h : Z ⟶ X` such that
`∀ j₁ j₂, f j₁ ≫ h = f j₂ ≫ h`.  Further, this bijection is natural in `Z`: see
`Cotrident.IsColimit.homIso_natural`.
-/
@[simps]
def Cotrident.IsColimit.homIso [Nonempty J] {t : Cotrident f} (ht : IsColimit t) (Z : C) :
    (t.pt ⟶ Z) ≃ { h : Y ⟶ Z // ∀ j₁ j₂, f j₁ ≫ h = f j₂ ≫ h }

(ht : CategoryTheory.Limits.IsColimit t)

(h : { h // ∀ (j₁ j₂ : J), CategoryTheory.CategoryStruct.comp (f j₁) h = CategoryTheory.CategoryStruct.comp (f j₂) h })

(CategoryTheory.Limits.Cotrident.IsColimit.homIso ht Z).symm h =
  ↑(CategoryTheory.Limits.Cotrident.IsColimit.desc' ht ↑h ⋯)


theorem lt_trans {f g h : CauSeq α abs} (fg : f < g) (gh : g < h) : f < h

{α : Type u_1}
[LinearOrderedField α]
{f g h : CauSeq α abs}
(fg : f < g)
(gh : g < h)


theorem pow_lt_ascFactorial' (n k : ℕ) : (n + 1) ^ (k + 2) < (n + 1).ascFactorial (k + 2)


theorem inf_continuous (f g : α →o β) (hf : Continuous f) (hg : Continuous g) :
    Continuous (f ⊓ g)

(hf : OmegaCompletePartialOrder.Continuous f)

(hg : OmegaCompletePartialOrder.Continuous g)

OmegaCompletePartialOrder.Continuous (f ⊓ g)


theorem pi'_eq_pi [Encodable ι] : pi' μ = Measure.pi μ

(μ : (i : ι) → MeasureTheory.Measure (α i))

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

MeasureTheory.Measure.pi' μ = MeasureTheory.Measure.pi μ


/-- An n-ary version of `Set.mul_subset_mul`. -/
@[to_additive " An n-ary version of `Set.add_subset_add`. "]
theorem multiset_prod_subset_multiset_prod (t : Multiset ι) (f₁ f₂ : ι → Set α)
    (hf : ∀ i ∈ t, f₁ i ⊆ f₂ i) : (t.map f₁).prod ⊆ (t.map f₂).prod

{ι : Type u_1}
{α : Type u_2}
[AddCommMonoid α]
(t : Multiset ι)
(f₁ f₂ : ι → Set α)
(hf : ∀ i ∈ t, f₁ i ⊆ f₂ i)

(Multiset.map f₁ t).sum ⊆ (Multiset.map f₂ t).sum


theorem ae_tendsto_limRatio :
    ∀ᵐ x ∂μ, Tendsto (fun a => ρ a / μ a) (v.filterAt x) (𝓝 (v.limRatio ρ x))

(hρ : ρ ≪ μ)

∀ᵐ (x : α) ∂μ, Filter.Tendsto (fun a => ρ a / μ a) (v.filterAt x) (𝓝 (v.limRatio ρ x))


theorem LinearMap.toMatrix_comp [Finite l] [DecidableEq m] (f : M₂ →ₗ[R] M₃) (g : M₁ →ₗ[R] M₂) :
    LinearMap.toMatrix v₁ v₃ (f.comp g) =
    LinearMap.toMatrix v₂ v₃ f * LinearMap.toMatrix v₁ v₂ g

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

(LinearMap.toMatrix v₁ v₃) (f ∘ₗ g) = (LinearMap.toMatrix v₂ v₃) f * (LinearMap.toMatrix v₁ v₂) g


theorem exp_eq_exp_re_mul_sin_add_cos : exp x = exp x.re * (cos x.im + sin x.im * I)

Complex.exp x = Complex.exp ↑x.re * (Complex.cos ↑x.im + Complex.sin ↑x.im * Complex.I)


theorem BijOn.invOn_invFunOn [Nonempty α] (h : BijOn f s t) : InvOn (invFunOn f s) f s t

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{f : α → β}
[Nonempty α]
(h : Set.BijOn f s t)


@[simp]
theorem finsetCongr_trans (e : α ≃ β) (e' : β ≃ γ) :
    e.finsetCongr.trans e'.finsetCongr = (e.trans e').finsetCongr

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(e : α ≃ β)
(e' : β ≃ γ)


theorem bit_not_add_self (x : BitVec w) :
  ((iunfoldr (fun (i : Fin w) c => (c, !(x.getLsb i)))) ()).snd + x  = -1

(BitVec.iunfoldr (fun i c => (c, !x.getLsb ↑i)) ()).snd + x = -1


theorem or_eq_false_eq_eq_false_and_eq_false (a b : Bool) :
    ((a || b) = false) = (a = false ∧ b = false)


/-- A conditionally complete lattice is a lattice in which
every nonempty subset which is bounded above has a supremum, and
every nonempty subset which is bounded below has an infimum.
Typical examples are real numbers or natural numbers.

To differentiate the statements from the corresponding statements in (unconditional)
complete lattices, we prefix sInf and subₛ by a c everywhere. The same statements should
hold in both worlds, sometimes with additional assumptions of nonemptiness or
boundedness. -/
class ConditionallyCompleteLattice (α : Type*) extends Lattice α, SupSet α, InfSet α where
  /-- `a ≤ sSup s` for all `a ∈ s`. -/
  le_csSup : ∀ s a, BddAbove s → a ∈ s → a ≤ sSup s
  /-- `sSup s ≤ a` for all `a ∈ upperBounds s`. -/
  csSup_le : ∀ s a, Set.Nonempty s → a ∈ upperBounds s → sSup s ≤ a
  /-- `sInf s ≤ a` for all `a ∈ s`. -/
  csInf_le : ∀ s a, BddBelow s → a ∈ s → sInf s ≤ a
  /-- `a ≤ sInf s` for all `a ∈ lowerBounds s`. -/
  le_csInf : ∀ s a, Set.Nonempty s → a ∈ lowerBounds s → a ≤ sInf s

{α : Type u_5}
[self : ConditionallyCompleteLattice α]
(s : Set α)
(a : α)

s.Nonempty → a ∈ lowerBounds s → a ≤ sInf s


/-- A map `f : α → β` is called a *measurable embedding* if it is injective, measurable, and sends
measurable sets to measurable sets. The latter assumption can be replaced with “`f` has measurable
inverse `g : Set.range f → α`”, see `MeasurableEmbedding.measurable_rangeSplitting`,
`MeasurableEmbedding.of_measurable_inverse_range`, and
`MeasurableEmbedding.of_measurable_inverse`.

One more interpretation: `f` is a measurable embedding if it defines a measurable equivalence to its
range and the range is a measurable set. One implication is formalized as
`MeasurableEmbedding.equivRange`; the other one follows from
`MeasurableEquiv.measurableEmbedding`, `MeasurableEmbedding.subtype_coe`, and
`MeasurableEmbedding.comp`. -/
structure MeasurableEmbedding [MeasurableSpace α] [MeasurableSpace β] (f : α → β) : Prop where
  /-- A measurable embedding is injective. -/
  protected injective : Injective f
  /-- A measurable embedding is a measurable function. -/
  protected measurable : Measurable f
  /-- The image of a measurable set under a measurable embedding is a measurable set. -/
  protected measurableSet_image' : ∀ ⦃s⦄, MeasurableSet s → MeasurableSet (f '' s)

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
{f : α → β}
(self : MeasurableEmbedding f)


protected theorem pred_min_pred : ∀ (x y), min (pred x) (pred y) = pred (min x y)


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

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
{f : C(β, γ)}
{g₁ g₂ : C(α, β)}
(hf : Function.Injective ⇑f)


/-- A right-regular element of a `Nontrivial` `MulZeroClass` is non-zero. -/
theorem IsRightRegular.ne_zero [Nontrivial R] (ra : IsRightRegular a) : a ≠ 0

{R : Type u_1}
[MulZeroClass R]
{a : R}
[Nontrivial R]
(ra : IsRightRegular a)


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

(a : BoundedLatticeHom ↑X.toBddDistLat.toBddLat.toLat ↑Y.toBddDistLat.toBddLat.toLat)

BoolAlg.dual.map a = BoundedLatticeHom.dual a


lemma LeftFraction.op_map
    {X Y : C} (φ : W.LeftFraction X Y) (L : C ⥤ D) (hL : W.IsInvertedBy L) :
    (φ.map L hL).op = φ.op.map L.op hL.op

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


theorem preimage_congr {f g : α → β} {s : Set β} (h : ∀ x : α, f x = g x) : f ⁻¹' s = g ⁻¹' s

{α : Type u_1}
{β : Type u_2}
{f g : α → β}
{s : Set β}
(h : ∀ (x : α), f x = g x)


/-- A variant of `Finset.mul_prod_erase` with the multiplication swapped. -/
@[to_additive "A variant of `Finset.add_sum_erase` with the addition swapped."]
theorem prod_erase_mul [DecidableEq α] (s : Finset α) (f : α → β) {a : α} (h : a ∈ s) :
    (∏ x ∈ s.erase a, f x) * f a = ∏ x ∈ s, f x

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


theorem rpow_le_one {x : ℝ≥0} {z : ℝ} (hx2 : x ≤ 1) (hz : 0 ≤ z) : x ^ z ≤ 1


theorem mulMap_one_right_eq : mulMap M 1 = M.subtype ∘ₗ M.rTensorOne.toLinearMap

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


theorem sups_subset_left : t₁ ⊆ t₂ → s ⊻ t₁ ⊆ s ⊻ t₂

{α : Type u_2}
[SemilatticeSup α]
{s t₁ t₂ : Set α}

t₁ ⊆ t₂ → s ⊻ t₁ ⊆ s ⊻ t₂


theorem top_continuous : Continuous (⊤ : α →o β)

{α : Type u}
{β : Type v}
[OmegaCompletePartialOrder α]
[CompleteLattice β]


@[simp]
theorem isHermitian_submatrix_equiv {A : Matrix n n α} (e : m ≃ n) :
    (A.submatrix e e).IsHermitian ↔ A.IsHermitian

{α : Type u_1}
{m : Type u_3}
{n : Type u_4}
[Star α]
{A : Matrix n n α}
(e : m ≃ n)

(A.submatrix ⇑e ⇑e).IsHermitian ↔ A.IsHermitian


protected theorem Nonempty.infs : s.Nonempty → t.Nonempty → (s ⊼ t).Nonempty

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


/-- A function that is complex differentiable on the open ball of radius `r ≤ ∞` around `c`
is given by evaluating its Taylor series at `c` on this open ball. -/
lemma taylorSeries_eq_on_emetric_ball :
    ∑' n : ℕ, (n ! : ℂ)⁻¹ • (z - c) ^ n • iteratedDeriv n f c = f z

(hf : DifferentiableOn ℂ f (EMetric.ball c r))

∑' (n : ℕ), (↑n.factorial)⁻¹ • (z - c) ^ n • iteratedDeriv n f c = f z


theorem foldl_succ_last (f : α → Fin (n+1) → α) (x) :
    foldl (n+1) f x = f (foldl n (f · ·.castSucc) x) (last n)

{α : Sort u_1}
{n : Nat}
(f : α → Fin (n + 1) → α)
(x : α)

Fin.foldl (n + 1) f x = f (Fin.foldl n (fun x x_1 => f x x_1.castSucc) x) (Fin.last n)


@[simp]
theorem mem_permutations {s t : List α} : s ∈ permutations t ↔ s ~ t


lemma _root_.Basis.baseChange_end (b : Basis ι R M) (ij : ι × ι) :
    baseChange A (b.end ij) = (basis A b).end ij

{R : Type uR}
{M : Type uM}
{ι : Type uι}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[Fintype ι]
(A : Type u_3)
[CommSemiring A]
[Algebra R A]
[DecidableEq ι]
(b : Basis ι R M)
(ij : ι × ι)

LinearMap.baseChange A (b.end ij) = (Algebra.TensorProduct.basis A b).end ij


theorem ConvexOn.convex_lt (hf : ConvexOn 𝕜 s f) (r : β) : Convex 𝕜 ({ x ∈ s | f x < r })

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedCancelAddCommMonoid β]
[Module 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : ConvexOn 𝕜 s f)
(r : β)


theorem continuous_parametric_intervalIntegral_of_continuous'
    (hf : Continuous f.uncurry) (a₀ b₀ : ℝ) :
    Continuous fun x ↦ ∫ t in a₀..b₀, f x t ∂μ

Continuous fun x => ∫ (t : ℝ) in a₀..b₀, f x t ∂μ


theorem lcm_mono_fun {g : β → α} (h : ∀ b ∈ s, f b ∣ g b) : s.lcm f ∣ s.lcm g

{α : Type u_2}
{β : Type u_3}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{s : Finset β}
{f g : β → α}
(h : ∀ b ∈ s, f b ∣ g b)


theorem uniformEmbedding_coe_real : UniformEmbedding ((↑) : ℚ → ℝ)


theorem sMod_lt (p : ℕ) (hp : p ≠ 0) (i : ℕ) : sMod p i < 2 ^ p - 1


theorem ae_eq_comp' {ν : Measure β} {f : α → β} {g g' : β → δ} (hf : AEMeasurable f μ)
    (h : g =ᵐ[ν] g') (h2 : μ.map f ≪ ν) : g ∘ f =ᵐ[μ] g' ∘ f

(h2 : MeasureTheory.Measure.map f μ ≪ ν)


theorem union_comm (a b : Set α) : a ∪ b = b ∪ a


theorem image_coe_Ioo : (some : α → WithBot α) '' Ioo a b = Ioo (a : WithBot α) b

WithBot.some '' Set.Ioo a b = Set.Ioo ↑a ↑b


@[simp]
theorem natCast_mul_comp {n : ℕ} : ((n : R[X]) * p).comp r = n * p.comp r

{R : Type u}
[Semiring R]
{p r : R[X]}
{n : ℕ}


@[simp]
theorem trim_zero : (0 : OuterMeasure α).trim = 0


theorem neg_subst {α} [Ring α] {n e t : α} (h1 : n * e = t) : n * -e = -t

{α : Type u_1}
[Ring α]
{n e t : α}
(h1 : n * e = t)


theorem finrank_eq_four [StrongRankCondition R] : FiniteDimensional.finrank R ℍ[R,c₁,c₂] = 4

{R : Type u_3}
[CommRing R]
(c₁ c₂ : R)
[StrongRankCondition R]


theorem sub_def {X Y : C} (a b : X ⟶ Y) : a - b = prod.lift a b ≫ σ

a - b = CategoryTheory.Limits.prod.lift a b ≫ CategoryTheory.NonPreadditiveAbelian.σ


@[simp]
theorem lift_iInf {ι} (f : ι → Cardinal) : lift.{u, v} (iInf f) = ⨅ i, lift.{u, v} (f i)

Cardinal.lift.{u, v} (iInf f) = ⨅ i, Cardinal.lift.{u, v} (f i)


theorem isCoprime_iff_gcd {I J : Ideal A} : IsCoprime I J ↔ gcd I J = 1

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


@[to_additive]
theorem smul_set_compl : a • sᶜ = (a • s)ᶜ

{α : Type u_2}
{β : Type u_3}
[AddGroup α]
[AddAction α β]
{s : Set β}
{a : α}


@[simp]
theorem map_le_map {f : α → β} {s t : Multiset α} (h : s ≤ t) : map f s ≤ map f t

{α : Type u_1}
{β : Type v}
{f : α → β}
{s t : Multiset α}
(h : s ≤ t)


@[simp] theorem dot_set_left (xs ys : IntList) (i : Nat) (z : Int) :
    dot (xs.set i z) ys = dot xs ys + (z - xs.get i) * ys.get i

(xs ys : Lean.Omega.IntList)
(i : Nat)
(z : Int)

(xs.set i z).dot ys = xs.dot ys + (z - xs.get i) * ys.get i


@[elab_as_elim]
protected theorem inductionOn {α : Sort u} {r : α → α → Prop} {motive : Quot r → Prop}
    (q : Quot r)
    (h : (a : α) → motive (Quot.mk r a))
    : motive q

{α : Sort u}
{r : α → α → Prop}
{motive : Quot r → Prop}
(q : Quot r)
(h : ∀ (a : α), motive (Quot.mk r a))


theorem measure_interior_of_null_frontier {μ : Measure α'} {s : Set α'} (h : μ (frontier s) = 0) :
    μ (interior s) = μ s

{α' : Type u_6}
[TopologicalSpace α']
[MeasurableSpace α']
{μ : MeasureTheory.Measure α'}
{s : Set α'}
(h : μ (frontier s) = 0)


lemma integral_add_const (f : X →ᵇ ℝ) (c : ℝ) :
    ∫ x, (f + const X c) x ∂μ = ∫ x, f x ∂μ + ENNReal.toReal (μ (Set.univ)) • c

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

∫ (x : X), (f + BoundedContinuousFunction.const X c) x ∂μ = ∫ (x : X), f x ∂μ + (μ Set.univ).toReal • c


theorem StableUnderBaseChange.unop {P : MorphismProperty Cᵒᵖ} (hP : StableUnderBaseChange P) :
    StableUnderCobaseChange P.unop

{P : CategoryTheory.MorphismProperty Cᵒᵖ}


theorem foldlIdx_eq_foldlIdxSpec (f : ℕ → α → β → α) (a bs start) :
    foldlIdx f a bs start = foldlIdxSpec f a bs start

{α : Type u}
{β : Type v}
(f : ℕ → α → β → α)
(a : α)
(bs : List β)
(start : ℕ)

List.foldlIdx f a bs start = List.foldlIdxSpec f a bs start


theorem exists_affineBasis : ∃ (s : Set P) (b : AffineBasis (↥s) k P), ⇑b = ((↑) : s → P)

(k : Type u_3)
(V : Type u_4)
(P : Type u_5)
[AddCommGroup V]
[AffineSpace V P]
[DivisionRing k]
[Module k V]


theorem setToL1_simpleFunc_indicatorConst (hT : DominatedFinMeasAdditive μ T C) {s : Set α}
    (hs : MeasurableSet s) (hμs : μ s < ∞) (x : E) :
    setToL1 hT (simpleFunc.indicatorConst 1 hs hμs.ne x) = T s x

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(MeasureTheory.L1.setToL1 hT) ↑(MeasureTheory.Lp.simpleFunc.indicatorConst 1 hs ⋯ x) = (T s) x


private lemma sup_aux : a ∈ lowerClosure s → (s.filter fun b ↦ a ≤ b).Nonempty

{α : Type u_1}
[SemilatticeSup α]
[DecidableRel fun x x_1 => x ≤ x_1]
{s : Finset α}
{a : α}

a ∈ lowerClosure ↑s → (Finset.filter (fun b => a ≤ b) s).Nonempty


@[to_additive] theorem embedding_mk_symm : Embedding (@mk M).symm


@[to_additive]
theorem eq_of_eqOn_dense {s : Set M} (hs : closure s = ⊤) {f g : M →ₙ* N} (h : s.EqOn f g) :
    f = g

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
{s : Set M}
(hs : Subsemigroup.closure s = ⊤)
{f g : M →ₙ* N}
(h : Set.EqOn (⇑f) (⇑g) s)


/-- The basic open set of a section `f` on an affine open as an `X.affineOpens`. -/
@[simps]
def _root_.AlgebraicGeometry.Scheme.affineBasicOpen
    (X : Scheme) {U : X.affineOpens} (f : Γ(X, U)) : X.affineOpens

(f : ↑(X.presheaf.obj (Opposite.op ↑U)))


private theorem sum_filter_pairs_eq_sum_powersetCard_sum (k : ℕ)
    (f : Finset σ × σ → MvPolynomial σ R) :
    (∑ t ∈ filter (fun t ↦ card t.fst = k) (pairs σ k), f t) =
    ∑ A ∈ powersetCard k univ, (∑ j ∈ A, f (A, j))

(σ : Type u_1)
[Fintype σ]
[DecidableEq σ]
(R : Type u_2)
[CommRing R]
(k : ℕ)
(f : Finset σ × σ → MvPolynomial σ R)

∑ t ∈ Finset.filter (fun t => t.1.card = k) (MvPolynomial.NewtonIdentities.pairs σ k), f t =
  ∑ A ∈ Finset.powersetCard k Finset.univ, ∑ j ∈ A, f (A, j)


lemma measure_null_iff_singleton (hs : s.Countable) : μ s = 0 ↔ ∀ x ∈ s, μ {x} = 0

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


theorem IntegrableOn.inter_of_restrict (h : IntegrableOn f s (μ.restrict t)) :
    IntegrableOn f (s ∩ t) μ

(h : MeasureTheory.IntegrableOn f s (μ.restrict t))


theorem continuous_totalSpaceMk (x : B) : Continuous (@TotalSpace.mk B F E x)

[TopologicalSpace (Bundle.TotalSpace F E)]


theorem closure_inf_le [SemilatticeInf α] [Preorder β] {u : β → α} (l : LowerAdjoint u) (x y : α) :
    u (l (x ⊓ y)) ≤ u (l x) ⊓ u (l y)

{α : Type u_1}
{β : Type u_4}
[SemilatticeInf α]
[Preorder β]
{u : β → α}
(l : LowerAdjoint u)
(x y : α)

u (l.toFun (x ⊓ y)) ≤ u (l.toFun x) ⊓ u (l.toFun y)


theorem coeFn_toLp {f : α → E} (hf : Memℒp f p μ) : hf.toLp f =ᵐ[μ] f

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{f : α → E}
(hf : MeasureTheory.Memℒp f p μ)

↑↑(MeasureTheory.Memℒp.toLp f hf) =ᵐ[μ] f


@[simp] theorem apply_symm_apply (e : α ≃ β) (x : β) : e (e.symm x) = x

{α : Sort u}
{β : Sort v}
(e : α ≃ β)
(x : β)


/-- The colimit of `J : SingleObj G ⥤ Type u` is equivalent to the quotient of
`J.obj (SingleObj.star G)` by the induced action. -/
@[simps!]
noncomputable def Types.colimitEquivQuotient :
    colimit J ≃ MulAction.orbitRel.Quotient G (J.obj (SingleObj.star G))

(J : CategoryTheory.Functor (CategoryTheory.SingleObj G) (Type u))

∀ (a : MulAction.orbitRel.Quotient G (J.obj (CategoryTheory.SingleObj.star G))),
  (CategoryTheory.Limits.SingleObj.Types.colimitEquivQuotient J).symm a =
    (CategoryTheory.Limits.Types.colimitEquivQuot J).symm
      (Quot.lift (fun x => Quot.mk (CategoryTheory.Limits.Types.Quot.Rel J) ⟨CategoryTheory.SingleObj.star G, x⟩) ⋯ a)


@[to_additive]
theorem hasProd_subtype_iff_of_mulSupport_subset {s : Set β} (hf : mulSupport f ⊆ s) :
    HasProd (f ∘ (↑) : s → α) a ↔ HasProd f a

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β → α}
{a : α}
{s : Set β}
(hf : Function.support f ⊆ s)


lemma epi₃ (h : T.mor₁ = 0) : Epi T.mor₃

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

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)


@[simp]
lemma cyclesMap_add : cyclesMap (φ + φ') = cyclesMap φ + cyclesMap φ'

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{S₁ S₂ : CategoryTheory.ShortComplex C}
(φ φ' : S₁ ⟶ S₂)
[S₁.HasLeftHomology]
[S₂.HasLeftHomology]

CategoryTheory.ShortComplex.cyclesMap (φ + φ') =
  CategoryTheory.ShortComplex.cyclesMap φ + CategoryTheory.ShortComplex.cyclesMap φ'


/-- Differentiability of `Θ z τ` in `z`, for fixed `τ`. -/
lemma differentiableAt_jacobiTheta₂_fst (z : ℂ) {τ : ℂ} (hτ : 0 < im τ) :
    DifferentiableAt ℂ (jacobiTheta₂ · τ) z

DifferentiableAt ℂ (fun x => jacobiTheta₂ x τ) z


lemma mem_orbit_iff [IsGalois k K] {w w' : InfinitePlace K} :
    w' ∈ MulAction.orbit (K ≃ₐ[k] K) w ↔ w.comap (algebraMap k K) = w'.comap (algebraMap k K)

{k : Type u_1}
[Field k]
{K : Type u_2}
[Field K]
[Algebra k K]
[IsGalois k K]
{w w' : NumberField.InfinitePlace K}


/-- Post-composition by a uniform embedding is a uniform embedding for the
uniform structures of `𝔖`-convergence.

More precisely, if `f : γ → β` is a uniform embedding, then
`(fun g ↦ f ∘ g) : (α →ᵤ[𝔖] γ) → (α →ᵤ[𝔖] β)` is a uniform embedding. -/
protected theorem postcomp_uniformEmbedding [UniformSpace γ] {f : γ → β} (hf : UniformEmbedding f) :
    UniformEmbedding (ofFun 𝔖 ∘ (f ∘ ·) ∘ toFun 𝔖)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[UniformSpace β]
{𝔖 : Set (Set α)}
[UniformSpace γ]
{f : γ → β}
(hf : UniformEmbedding f)

UniformEmbedding (⇑(UniformOnFun.ofFun 𝔖) ∘ (fun x => f ∘ x) ∘ ⇑(UniformOnFun.toFun 𝔖))


@[to_additive]
lemma minOrder_le_natCard (hs : s ≠ ⊥) (hs' : (s : Set α).Finite) : minOrder α ≤ Nat.card s

{α : Type u_1}
[Group α]
{s : Subgroup α}
(hs : s ≠ ⊥)
(hs' : (↑s).Finite)


@[to_additive]
theorem smul_apply [SMul M α] (c : Mᵈᵐᵃ) (f : α → β) (a : α) : (c • f) a = f (mk.symm c • a)

{M : Type u_1}
{β : Type u_2}
{α : Type u_3}
[VAdd M α]
(c : Mᵈᵃᵃ)
(f : α → β)
(a : α)

(c +ᵥ f) a = f (DomAddAct.mk.symm c +ᵥ a)


@[simp]
theorem den_add (c1 c2 : NumDenSameDeg 𝒜 x) : ((c1 + c2).den : A) = c1.den * c2.den

(c1 c2 : HomogeneousLocalization.NumDenSameDeg 𝒜 x)


lemma negOnePow_eq_neg_one_iff (n : ℤ) : n.negOnePow = -1 ↔ Odd n


theorem sum_measure_le_measure_univ {s : Finset ι} {t : ι → Set α}
    (h : ∀ i ∈ s, NullMeasurableSet (t i) μ) (H : Set.Pairwise s (AEDisjoint μ on t)) :
    (∑ i ∈ s, μ (t i)) ≤ μ (univ : Set α)

(h : ∀ i ∈ s, MeasureTheory.NullMeasurableSet (t i) μ)

(H : (↑s).Pairwise (MeasureTheory.AEDisjoint μ on t))


theorem comp_inv_eq (α : X ≅ Y) {f : Z ⟶ Y} {g : Z ⟶ X} : f ≫ α.inv = g ↔ f = g ≫ α.hom

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

CategoryTheory.CategoryStruct.comp f α.inv = g ↔ f = CategoryTheory.CategoryStruct.comp g α.hom


theorem mem_of_lookup_eq_some {a : α} {b : β a} {s : Finmap β} (h : s.lookup a = some b) : a ∈ s

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{b : β a}
{s : Finmap β}
(h : Finmap.lookup a s = some b)


theorem bddOrd_dual_comp_forget_to_partOrd :
    BddOrd.dual ⋙ forget₂ BddOrd PartOrd =
    forget₂ BddOrd PartOrd ⋙ PartOrd.dual

BddOrd.dual ⋙ CategoryTheory.forget₂ BddOrd PartOrd = CategoryTheory.forget₂ BddOrd PartOrd ⋙ PartOrd.dual


@[to_additive]
theorem continuousAt_zpow (x : G) (z : ℤ) : ContinuousAt (fun x => x ^ z) x

{G : Type w}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
(x : G)
(z : ℤ)


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


@[simp]
theorem Ideal.squarefree_span_singleton {a : R} :
    Squarefree (span {a}) ↔ Squarefree a

{R : Type u_1}
[CommRing R]
[IsDomain R]
[IsPrincipalIdealRing R]
{a : R}

Squarefree (Ideal.span {a}) ↔ Squarefree a


protected theorem restrict (hfm : AEStronglyMeasurable f μ) {s} :
    AEStronglyMeasurable f (μ.restrict s)

(hfm : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.AEStronglyMeasurable f (μ.restrict s)


theorem finSuccAboveEquiv_symm_apply_last (x : { x : Fin (n + 1) // x ≠ Fin.last n }) :
    (finSuccAboveEquiv (Fin.last n)).symm x = Fin.castLT x.1 (Fin.val_lt_last x.2)

(finSuccAboveEquiv (Fin.last n)).symm x = (↑x).castLT ⋯


@[simp]
theorem reflect_add (f g : R[X]) (N : ℕ) : reflect N (f + g) = reflect N f + reflect N g

{R : Type u_1}
[Semiring R]
(f g : Polynomial R)
(N : ℕ)

Polynomial.reflect N (f + g) = Polynomial.reflect N f + Polynomial.reflect N g


theorem norm_Integral_le_one : ‖integralCLM (α := α) (E := E) (μ := μ)‖ ≤ 1

{α : Type u_1}
{E : Type u_2}
[NormedAddCommGroup E]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedSpace ℝ E]
[CompleteSpace E]


theorem convexHull_subset_space (hs : s ∈ K.faces) : convexHull 𝕜 ↑s ⊆ K.space

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{K : Geometry.SimplicialComplex 𝕜 E}
{s : Finset E}
(hs : s ∈ K.faces)


@[to_additive]
theorem uniformContinuous_mul : UniformContinuous fun p : α × α => p.1 * p.2

{α : Type u_1}
[UniformSpace α]
[AddGroup α]
[UniformAddGroup α]


theorem lowerBounds_Ioi {a : γ} : lowerBounds (Ioi a) = Iic a

{γ : Type w}
[LinearOrder γ]
[DenselyOrdered γ]
{a : γ}


/-- The (normalized) Moore complex of a simplicial object `X` in an abelian category `C`.

The `n`-th object is intersection of
the kernels of `X.δ i : X.obj n ⟶ X.obj (n-1)`, for `i = 1, ..., n`.

The differentials are induced from `X.δ 0`,
which maps each of these intersections of kernels to the next.
-/
@[simps]
def normalizedMooreComplex : SimplicialObject C ⥤ ChainComplex C ℕ

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

∀ {X Y : CategoryTheory.SimplicialObject C} (f : X ⟶ Y),
  (AlgebraicTopology.normalizedMooreComplex C).map f = AlgebraicTopology.NormalizedMooreComplex.map f


theorem isGLB_Ico (h : a < b) : IsGLB (Ico a b) a

{α : Type u}
[Preorder α]
{a b : α}
(h : a < b)


/-- The image of a 1-pre-hypercover by a functor. -/
@[simps]
def map : PreOneHypercover (F.obj X)

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


theorem intentClosure_anti : Antitone (intentClosure r)

{α : Type u_2}
{β : Type u_3}
(r : α → β → Prop)


/-- The *Euler Product* for completely multiplicative functions.

If `f : ℕ →*₀ F`, where `F` is a complete normed field and `‖f ·‖` is summable, then
`∏' p : Nat.Primes, (1 - f p)⁻¹ = ∑' n, f n`.
This version is stated in terms of `HasProd`. -/
theorem eulerProduct_completely_multiplicative_hasProd {f : ℕ →*₀ F} (hsum : Summable (‖f ·‖)) :
    HasProd (fun p : Primes ↦ (1 - f p)⁻¹) (∑' n, f n)

{F : Type u_1}
[NormedField F]
[CompleteSpace F]
{f : ℕ →*₀ F}
(hsum : Summable fun x => ‖f x‖)

HasProd (fun p => (1 - f ↑p)⁻¹) (∑' (n : ℕ), f n)


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

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

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


/-- The colimit cocone over `coyoneda.obj X`, with cocone point `PUnit`.
-/
@[simps]
def colimitCocone (X : Cᵒᵖ) : Cocone (coyoneda.obj X)

(a : (CategoryTheory.coyoneda.obj X).obj X_1)

(CategoryTheory.Coyoneda.colimitCocone X).ι.app X_1 a = id PUnit.unit


theorem list_concat : Primrec₂ fun l (a : α) => l ++ [a]


/-- The map `(x, y) ↦ (x / y, y)` preserves the measure `μ × ν`. -/
@[to_additive measurePreserving_sub_prod
" The map `(x, y) ↦ (x - y, y)` preserves the measure `μ × ν`. "]
theorem measurePreserving_div_prod [IsMulRightInvariant μ] :
    MeasurePreserving (fun z : G × G => (z.1 / z.2, z.2)) (μ.prod ν) (μ.prod ν)

{G : Type u_1}
[MeasurableSpace G]
[AddGroup G]
[MeasurableAdd₂ G]
(μ ν : MeasureTheory.Measure G)
[MeasureTheory.SFinite ν]
[MeasureTheory.SFinite μ]
[MeasurableNeg G]
[μ.IsAddRightInvariant]

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


/--
A finite product in the category of a `SemilatticeInf` with `OrderTop` is the same as the infimum.
-/
theorem finite_product_eq_finset_inf [SemilatticeInf α] [OrderTop α] {ι : Type u} [Fintype ι]
    (f : ι → α) : ∏ᶜ f = Fintype.elems.inf f

{α : Type u}
[SemilatticeInf α]
[OrderTop α]
{ι : Type u}
[Fintype ι]
(f : ι → α)


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

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


lemma quasiIsoAt_shift_iff {K L : CochainComplex C ℤ} (φ : K ⟶ L) (n i j : ℤ) (h : n + i = j) :
    QuasiIsoAt (φ⟦n⟧') i ↔ QuasiIsoAt φ j

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.CategoryWithHomology C]
{K L : CochainComplex C ℤ}
(φ : K ⟶ L)
(n i j : ℤ)
(h : n + i = j)

QuasiIsoAt ((CategoryTheory.shiftFunctor (HomologicalComplex C (ComplexShape.up ℤ)) n).map φ) i ↔ QuasiIsoAt φ j


theorem idempotent (x : α) : u (l (u (l x))) = u (l x)

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

u (l.toFun (u (l.toFun x))) = u (l.toFun x)


@[measurability]
theorem Measurable.ccos : Measurable fun x => Complex.cos (f x)

{α : Type u_1}
{m : MeasurableSpace α}
{f : α → ℂ}
(hf : Measurable f)


theorem subset_sphere {ps : Set P} {s : Sphere P} : ps ⊆ s ↔ ∀ p ∈ ps, p ∈ s

{P : Type u_2}
[MetricSpace P]
{ps : Set P}
{s : EuclideanGeometry.Sphere P}

ps ⊆ Metric.sphere s.center s.radius ↔ ∀ p ∈ ps, p ∈ s


theorem exists_isSubordinate_chartAt_source_of_isClosed {s : Set M} (hs : IsClosed s) :
    ∃ f : SmoothPartitionOfUnity s I M s,
      f.IsSubordinate (fun x ↦ (chartAt H (x : M)).source)

{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
(I : ModelWithCorners ℝ E H)
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
[T2Space M]
[SigmaCompactSpace M]
{s : Set M}
(hs : IsClosed s)

∃ f, f.IsSubordinate fun x => (chartAt H ↑x).source


@[simp]
theorem μIso_hom (X Y : C) : (F.μIso X Y).hom = F.μ X Y

(F : CategoryTheory.MonoidalFunctor C D)


@[to_additive sub_one_zsmul]
lemma zpow_sub_one (a : G) (n : ℤ) : a ^ (n - 1) = a ^ n * a⁻¹

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


theorem eventually_right_inverse (hf : HasStrictFDerivAt f (f' : E →L[𝕜] F) a) :
    ∀ᶠ y in 𝓝 (f a), f (hf.localInverse f f' a y) = y

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace E]
{f : E → F}
{f' : E ≃L[𝕜] F}
{a : E}
(hf : HasStrictFDerivAt f (↑f') a)

∀ᶠ (y : F) in 𝓝 (f a), f (HasStrictFDerivAt.localInverse f f' a hf y) = y


/-- A function is `C^n` within a set at a point, for `n : ℕ`, if and only if it is `C^n` on
a neighborhood of this point. -/
theorem contMDiffWithinAt_iff_contMDiffOn_nhds {n : ℕ} :
    ContMDiffWithinAt I I' n f s x ↔ ∃ u ∈ 𝓝[insert x s] x, ContMDiffOn I I' n f u

{𝕜 : 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']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
[SmoothManifoldWithCorners I' M']
{f : M → M'}
{s : Set M}
{x : M}
{n : ℕ}

ContMDiffWithinAt I I' (↑n) f s x ↔ ∃ u ∈ 𝓝[insert x s] x, ContMDiffOn I I' (↑n) f u


theorem mem_prod_iff_right {s : Set (α × β)} :
    s ∈ f ×ˢ g ↔ ∃ t ∈ g, ∀ᶠ x in f, ∀ y ∈ t, (x, y) ∈ s

{α : Type u_1}
{β : Type u_2}
{f : Filter α}
{g : Filter β}
{s : Set (α × β)}

s ∈ f ×ˢ g ↔ ∃ t ∈ g, ∀ᶠ (x : α) in f, ∀ y ∈ t, (x, y) ∈ s


@[simp]
nonrec theorem volume_pi_ball (a : ι → ℝ) {r : ℝ} (hr : 0 < r) :
    volume (Metric.ball a r) = ENNReal.ofReal ((2 * r) ^ Fintype.card ι)

{ι : Type u_1}
[Fintype ι]
(a : ι → ℝ)
{r : ℝ}
(hr : 0 < r)

MeasureTheory.volume (Metric.ball a r) = ENNReal.ofReal ((2 * r) ^ Fintype.card ι)


@[simp]
theorem sdiff_sdiff_right_self : x \ (x \ y) = x ⊓ y

{α : Type u}
{x y : α}
[GeneralizedBooleanAlgebra α]


theorem PrimrecRel.comp {R : β → γ → Prop} [∀ a b, Decidable (R a b)] {f : α → β} {g : α → γ} :
    PrimrecRel R → Primrec f → Primrec g → PrimrecPred fun a => R (f a) (g a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Primcodable α]
[Primcodable β]
[Primcodable γ]
{R : β → γ → Prop}
[(a : β) → (b : γ) → Decidable (R a b)]
{f : α → β}
{g : α → γ}


@[simp]
lemma tilted_const' (μ : Measure α) (c : ℝ) :
    μ.tilted (fun _ ↦ c) = (μ Set.univ)⁻¹ • μ

{α : Type u_1}
{mα : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
(c : ℝ)

(μ.tilted fun x => c) = (μ Set.univ)⁻¹ • μ


/-- Construct a multifork using a collection `ι` of morphisms. -/
@[simps]
def ofι (I : MulticospanIndex.{w} C) (P : C) (ι : ∀ a, P ⟶ I.left a)
    (w : ∀ b, ι (I.fstTo b) ≫ I.fst b = ι (I.sndTo b) ≫ I.snd b) : Multifork I

(I : CategoryTheory.Limits.MulticospanIndex C)

(w :
  ∀ (b : I.R),
    CategoryTheory.CategoryStruct.comp (ι (I.fstTo b)) (I.fst b) =
      CategoryTheory.CategoryStruct.comp (ι (I.sndTo b)) (I.snd b))

(x : CategoryTheory.Limits.WalkingMulticospan I.fstTo I.sndTo)

(CategoryTheory.Limits.Multifork.ofι I P ι w).π.app x =
  match x with
  | CategoryTheory.Limits.WalkingMulticospan.left a => ι a
  | CategoryTheory.Limits.WalkingMulticospan.right b => CategoryTheory.CategoryStruct.comp (ι (I.fstTo b)) (I.fst b)


/-- From a natural transformation `α : F → G` we get a functor from
coalgebras of `F` to coalgebras of `G`.
-/
@[simps]
def functorOfNatTrans {F G : C ⥤ C} (α : F ⟶ G) : Coalgebra F ⥤ Coalgebra G

(V : CategoryTheory.Endofunctor.Coalgebra F)

((CategoryTheory.Endofunctor.Coalgebra.functorOfNatTrans α).obj V).V = V.V


theorem smul_div' (r : M) (x y : A) : r • (x / y) = r • x / r • y

{M : Type u_1}
{A : Type u_4}
[Monoid M]
[Group A]
[MulDistribMulAction M A]
(r : M)
(x y : A)


theorem mem_one' {x : A} : x ∈ (1 : SubMulAction R A) ↔ ∃ y, algebraMap R A y = x

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{x : A}


theorem TietzeExtension.of_tvs (𝕜 : Type v) [NontriviallyNormedField 𝕜] {E : Type w}
    [AddCommGroup E] [Module 𝕜 E] [TopologicalSpace E] [TopologicalAddGroup E] [ContinuousSMul 𝕜 E]
    [T2Space E] [FiniteDimensional 𝕜 E] [CompleteSpace 𝕜] [TietzeExtension.{u, v} 𝕜] :
    TietzeExtension.{u, w} E

(𝕜 : Type v)
[NontriviallyNormedField 𝕜]
{E : Type w}
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousSMul 𝕜 E]
[T2Space E]
[FiniteDimensional 𝕜 E]
[CompleteSpace 𝕜]
[TietzeExtension 𝕜]


theorem mem_prod {s : Subring R} {t : Subring S} {p : R × S} : p ∈ s.prod t ↔ p.1 ∈ s ∧ p.2 ∈ t

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
{s : Subring R}
{t : Subring S}
{p : R × S}


theorem sup_eq_iSup [CompleteLattice β] (s : Finset α) (f : α → β) : s.sup f = ⨆ a ∈ s, f a

{α : Type u_2}
{β : Type u_3}
[CompleteLattice β]
(s : Finset α)
(f : α → β)


theorem repeat_succ {α : Type*} (a : Fin n → α) (m : ℕ) :
    Fin.repeat m.succ a =
      append a (Fin.repeat m a) ∘ cast ((Nat.succ_mul _ _).trans (Nat.add_comm ..))

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

Fin.repeat m.succ a = Fin.append a (Fin.repeat m a) ∘ Fin.cast ⋯


/-- If `CommMonoid` homs `g : M →* P, l : P →* A` induce maps of localizations, the composition
of the induced maps equals the map of localizations induced by `l ∘ g`. -/
@[to_additive
    "If `AddCommMonoid` homs `g : M →+ P, l : P →+ A` induce maps of localizations, the composition
of the induced maps equals the map of localizations induced by `l ∘ g`."]
theorem map_map {A : Type*} [CommMonoid A] {U : Submonoid A} {R} [CommMonoid R]
    (j : LocalizationMap U R) {l : P →* A} (hl : ∀ w : T, l w ∈ U) (x) :
    k.map hl j (f.map hy k x) = f.map (fun x ↦ show l.comp g x ∈ U from hl ⟨g x, hy x⟩) j 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)
{g : M →+ P}
{T : AddSubmonoid P}
(hy : ∀ (y : ↥S), g ↑y ∈ T)
{Q : Type u_4}
[AddCommMonoid Q]
{k : T.LocalizationMap Q}
{A : Type u_5}
[AddCommMonoid A]
{U : AddSubmonoid A}
{R : Type u_6}
[AddCommMonoid R]
(j : U.LocalizationMap R)
{l : P →+ A}
(hl : ∀ (w : ↥T), l ↑w ∈ U)
(x : N)

(k.map hl j) ((f.map hy k) x) = (f.map ⋯ j) x


theorem IsCoprime.ne_zero_or_ne_zero [Nontrivial R] (h : IsCoprime x y) : x ≠ 0 ∨ y ≠ 0

{R : Type u}
[CommSemiring R]
{x y : R}
[Nontrivial R]
(h : IsCoprime x y)


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

{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(S : Submodule R M)
(s : Set M)
(hs : s = ↑S)


/-- A nonzero object has nontrivial subobject lattice. -/
theorem nontrivial_of_not_isZero {X : C} (h : ¬IsZero X) : Nontrivial (Subobject X)


/-- This ext lemma changes equalities on `αᵐᵒᵖ →+ β` to equalities on `α →+ β`.
This is useful because there are often ext lemmas for specific `α`s that will apply
to an equality of `α →+ β` such as `Finsupp.addHom_ext'`. -/
@[ext]
theorem AddMonoidHom.mul_op_ext {α β} [AddZeroClass α] [AddZeroClass β] (f g : αᵐᵒᵖ →+ β)
    (h :
      f.comp (opAddEquiv : α ≃+ αᵐᵒᵖ).toAddMonoidHom =
        g.comp (opAddEquiv : α ≃+ αᵐᵒᵖ).toAddMonoidHom) :
    f = g

(f g : αᵐᵒᵖ →+ β)

(h : f.comp MulOpposite.opAddEquiv.toAddMonoidHom = g.comp MulOpposite.opAddEquiv.toAddMonoidHom)


@[deprecated disintegrate (since := "2024-07-24")]
lemma compProd_fst_condKernelCountable (κ : Kernel α (β × Ω)) [IsFiniteKernel κ] :
    fst κ ⊗ₖ condKernelCountable (fun a ↦ (κ a).condKernel)
      (fun x y h ↦ by simp [apply_congr_of_mem_measurableAtom _ h]) = κ

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

κ.fst ⊗ₖ ProbabilityTheory.Kernel.condKernelCountable (fun a => (κ a).condKernel) ⋯ = κ


theorem ofDigits_eq_sum_mapIdx (b : ℕ) (L : List ℕ) :
    ofDigits b L = (L.mapIdx fun i a => a * b ^ i).sum

Nat.ofDigits b L = (List.mapIdx (fun i a => a * b ^ i) L).sum


theorem hom_infinite (C : G.ComponentCompl L) (h : K ⊆ L) (Cinf : (C : Set V).Infinite) :
    (C.hom h : Set V).Infinite

{V : Type u}
{G : SimpleGraph V}
{K L : Set V}
(C : G.ComponentCompl L)
(h : K ⊆ L)
(Cinf : (↑C).Infinite)


@[to_additive]
theorem continuousSMul_iInf {ts' : ι → TopologicalSpace X}
    (h : ∀ i, @ContinuousSMul M X _ _ (ts' i)) : @ContinuousSMul M X _ _ (⨅ i, ts' i)

{ι : Sort u_1}
{M : Type u_2}
{X : Type u_3}
[TopologicalSpace M]
[VAdd M X]
{ts' : ι → TopologicalSpace X}
(h : ∀ (i : ι), ContinuousVAdd M X)


theorem IsOpen.mem_nhds (hs : IsOpen s) (hx : x ∈ s) : s ∈ 𝓝 x

{X : Type u}
{x : X}
{s : Set X}
[TopologicalSpace X]
(hs : IsOpen s)
(hx : x ∈ s)


theorem integral_pos_of_integrable_nonneg_nonzero [TopologicalSpace α] [Measure.IsOpenPosMeasure μ]
    {f : α → ℝ} {x : α} (f_cont : Continuous f) (f_int : Integrable f μ) (f_nonneg : 0 ≤ f)
    (f_x : f x ≠ 0) : 0 < ∫ x, f x ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[TopologicalSpace α]
[μ.IsOpenPosMeasure]
{f : α → ℝ}
{x : α}
(f_cont : Continuous f)
(f_int : MeasureTheory.Integrable f μ)
(f_nonneg : 0 ≤ f)
(f_x : f x ≠ 0)


theorem descPochhammer_eval_eq_descFactorial (n k : ℕ) :
    (descPochhammer R k).eval (n : R) = n.descFactorial k

Polynomial.eval (↑n) (descPochhammer R k) = ↑(n.descFactorial k)


/-- The product of a family of triangles. -/
@[simps!]
def productTriangle : Triangle C

(T : J → CategoryTheory.Pretriangulated.Triangle C)

[CategoryTheory.Limits.HasProduct fun j => (T j).obj₁]

[CategoryTheory.Limits.HasProduct fun j => (T j).obj₂]

[CategoryTheory.Limits.HasProduct fun j => (T j).obj₃]

[CategoryTheory.Limits.HasProduct fun j => (CategoryTheory.shiftFunctor C 1).obj (T j).obj₁]

(CategoryTheory.Pretriangulated.productTriangle T).mor₂ = CategoryTheory.Limits.Pi.map fun j => (T j).mor₂


@[to_additive (attr := simp)]
theorem MonoidHom.finsupp_prod_apply [Zero β] [Monoid N] [CommMonoid P] (f : α →₀ β)
    (g : α → β → N →* P) (x : N) : f.prod g x = f.prod fun i fi => g i fi x

{α : Type u_1}
{β : Type u_7}
{N : Type u_10}
{P : Type u_11}
[Zero β]
[Monoid N]
[CommMonoid P]
(f : α →₀ β)
(g : α → β → N →* P)
(x : N)

(f.prod g) x = f.prod fun i fi => (g i fi) x


@[to_additive]
theorem one_iff_ker_inv {f : G → H} (hf : IsGroupHom f) (a b : G) : f a = f b ↔ f (a * b⁻¹) = 1

{G : Type u_1}
{H : Type u_2}
[Group G]
[Group H]
{f : G → H}
(hf : IsGroupHom f)
(a b : G)


lemma add_eq_three_iff :
    m + n = 3 ↔ m = 0 ∧ n = 3 ∨ m = 1 ∧ n = 2 ∨ m = 2 ∧ n = 1 ∨ m = 3 ∧ n = 0


theorem chainHeight_eq_iSup_Iic : s.chainHeight = ⨆ i ∈ s, (s ∩ Set.Iic i).chainHeight


@[simp]
theorem comap_id (S : StarSubalgebra R A) : S.comap (StarAlgHom.id R A) = S

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

StarSubalgebra.comap (StarAlgHom.id R A) S = S


/-- An uncurried version of `Finset.prod_product_right`. -/
@[to_additive "An uncurried version of `Finset.sum_product_right`"]
theorem prod_product_right' {s : Finset γ} {t : Finset α} {f : γ → α → β} :
    ∏ x ∈ s ×ˢ t, f x.1 x.2 = ∏ y ∈ t, ∏ x ∈ s, f x y

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[CommMonoid β]
{s : Finset γ}
{t : Finset α}
{f : γ → α → β}


theorem inter_compl_nonempty_iff {s t : Set α} : (s ∩ tᶜ).Nonempty ↔ ¬s ⊆ t


theorem encard_le_encard_diff_add_encard (s t : Set α) : s.encard ≤ (s \ t).encard + t.encard


theorem quasiCompact_iff_forall_affine :
    QuasiCompact f ↔
      ∀ U : Y.Opens, IsAffineOpen U → IsCompact (f ⁻¹ᵁ U : Set X)

{X Y : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)

AlgebraicGeometry.QuasiCompact f ↔ ∀ (U : Y.Opens), AlgebraicGeometry.IsAffineOpen U → IsCompact ↑(f ⁻¹ᵁ U)


theorem Tendsto.sup {f : α → β} {x₁ x₂ : Filter α} {y : Filter β} :
    Tendsto f x₁ y → Tendsto f x₂ y → Tendsto f (x₁ ⊔ x₂) y

{α : Type u}
{β : Type v}
{f : α → β}
{x₁ x₂ : Filter α}
{y : Filter β}

Filter.Tendsto f x₁ y → Filter.Tendsto f x₂ y → Filter.Tendsto f (x₁ ⊔ x₂) y


theorem IsClique.card_le_chromaticNumber {s : Finset V} (h : G.IsClique s) :
    s.card ≤ G.chromaticNumber

{V : Type u}
{G : SimpleGraph V}
{s : Finset V}
(h : G.IsClique ↑s)


@[simp]
lemma Cotangent.val_mk (x : P.ker) : (mk x).val = Ideal.toCotangent _ x

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Generators R S}
(x : ↥P.ker)

(Algebra.Generators.Cotangent.mk x).val = P.ker.toCotangent x


/-- Being smooth is transported via algebra isomorphisms. -/
theorem of_equiv [Smooth R A] (e : A ≃ₐ[R] B) : Smooth R B

{R : Type u}
[CommRing R]
{A B : Type u}
[CommRing A]
[Algebra R A]
[CommRing B]
[Algebra R B]
[Algebra.Smooth R A]
(e : A ≃ₐ[R] B)


@[simp]
theorem gcd_mul_left_add_right (m n k : ℕ) : gcd m (m * k + n) = gcd m n


/-- See also `pow_right_strictMono'`. -/
lemma pow_right_strictMono (h : 1 < a) : StrictMono (a ^ ·)

{R : Type u_3}
[StrictOrderedSemiring R]
{a : R}
(h : 1 < a)


lemma StrictMono.image_Ioi_subset (h : StrictMono f) : f '' Ioi a ⊆ Ioi (f a)

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


@[simp]
theorem destruct_ofSeq (s : Seq α) :
    destruct (ofSeq s) = Computation.pure (s.head.map fun a => (a, ofSeq s.tail))

(↑s).destruct = Computation.pure (Option.map (fun a => (a, ↑s.tail)) s.head)


protected theorem lipschitz : LipschitzWith 1 e

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
{P : Type u_10}
{P₂ : Type u_11}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]
(e : P ≃ᵃⁱ[𝕜] P₂)


/-- Reformulation of `ConvexOn.le_slope_of_hasDerivAt` using `deriv` -/
lemma deriv_le_slope (hfc : ConvexOn ℝ S f) (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y)
    (hfd : DifferentiableAt ℝ f x) :
    deriv f x ≤ slope f x y

{S : Set ℝ}
{f : ℝ → ℝ}
{x y : ℝ}
(hfc : ConvexOn ℝ S f)
(hx : x ∈ S)
(hy : y ∈ S)
(hxy : x < y)
(hfd : DifferentiableAt ℝ f x)


theorem p_pow_smul_lift {x y : M} {k : ℕ} (hM' : Module.IsTorsionBy R M (p ^ pOrder hM y))
    (h : p ^ k • x ∈ R ∙ y) : ∃ a : R, p ^ k • x = p ^ k • a • y

(hM : Module.IsTorsion' M ↥(Submonoid.powers p))

(hM' : Module.IsTorsionBy R M (p ^ Submodule.pOrder hM y))


@[to_additive]
theorem image_smul_distrib [MulOneClass α] [MulOneClass β] [FunLike F α β] [MonoidHomClass F α β]
    (f : F) (a : α) (s : Set α) :
    f '' (a • s) = f a • f '' s

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[AddZeroClass α]
[AddZeroClass β]
[FunLike F α β]
[AddMonoidHomClass F α β]
(f : F)
(a : α)
(s : Set α)


@[to_additive mem_addCenter_iff]
theorem mem_center_iff {z : M} : z ∈ center M ↔ IsMulCentral z


theorem AdditiveFunctor.forget_obj_of (F : C ⥤ D) [F.Additive] :
    (AdditiveFunctor.forget C D).obj (AdditiveFunctor.of F) = F

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
[CategoryTheory.Preadditive C]
[CategoryTheory.Preadditive D]
(F : CategoryTheory.Functor C D)
[F.Additive]

(CategoryTheory.AdditiveFunctor.forget C D).obj (CategoryTheory.AdditiveFunctor.of F) = F


theorem WOppSide.trans_sSameSide {s : AffineSubspace R P} {x y z : P} (hxy : s.WOppSide x y)
    (hyz : s.SSameSide y z) : s.WOppSide x z

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


@[simp] lemma ofENat_mul_aleph0 {m : ℕ∞} (hm : m ≠ 0) : ↑m * ℵ₀ = ℵ₀


/-- The backward direction of the equivalence from coalgebras for the product comonad to the over
category.
-/
@[simps]
def overToCoalgebra : Over X ⥤ Coalgebra (prodComonad X)

((CategoryTheory.overToCoalgebra X).obj f).A = f.left


/-- The unit isomorphism of the equivalence
`ShortComplex.functorEquivalence : ShortComplex (J ⥤ C) ≌ J ⥤ ShortComplex C`. -/
@[simps!]
def unitIso : 𝟭 _ ≅ functor J C ⋙ inverse J C

(X : CategoryTheory.ShortComplex (CategoryTheory.Functor J C))

∀ (X_1 : J),
  ((CategoryTheory.ShortComplex.FunctorEquivalence.unitIso J C).inv.app X).τ₂.app X_1 =
    CategoryTheory.CategoryStruct.id (X.X₂.obj X_1)


theorem balanceL_eq_balance {l x r} (sl : Sized l) (sr : Sized r) (H1 : size l = 0 → size r ≤ 1)
    (H2 : 1 ≤ size l → 1 ≤ size r → size r ≤ delta * size l) :
    @balanceL α l x r = balance l x r

(H2 : 1 ≤ l.size → 1 ≤ r.size → r.size ≤ Ordnode.delta * l.size)


/-- Given an action of a group `α` on `β`, each `g : α` defines a permutation of `β`. -/
@[to_additive (attr := simps)]
def MulAction.toPerm (a : α) : Equiv.Perm β

{α : Type u_1}
{β : Type u_2}
[Group α]
[MulAction α β]
(a : α)
(x : β)

(Equiv.symm (MulAction.toPerm a)) x = a⁻¹ • x


@[simp]
lemma rightUnshift_units_smul {n' a : ℤ} (γ : Cochain K (L⟦a⟧) n') (n : ℤ)
    (hn : n' + a = n) (x : Rˣ) :
    (x • γ).rightUnshift n hn = x • γ.rightUnshift n hn

(γ : CochainComplex.HomComplex.Cochain K ((CategoryTheory.shiftFunctor (CochainComplex C ℤ) a).obj L) n')


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

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


@[to_additive]
theorem partialProd_right_inv {G : Type*} [Group G] (f : Fin n → G) (i : Fin n) :
    (partialProd f (Fin.castSucc i))⁻¹ * partialProd f i.succ = f i

{n : ℕ}
{G : Type u_3}
[Group G]
(f : Fin n → G)
(i : Fin n)

(Fin.partialProd f i.castSucc)⁻¹ * Fin.partialProd f i.succ = f i


theorem range_add_one : range (n + 1) = insert n (range n)

Finset.range (n + 1) = insert n (Finset.range n)


/-- A σ-compact space is a space that is the union of a countable collection of compact subspaces.
  Note that a locally compact separable T₂ space need not be σ-compact.
  The sequence can be extracted using `compactCovering`. -/
class SigmaCompactSpace (X : Type*) [TopologicalSpace X] : Prop where
  /-- In a σ-compact space, `Set.univ` is a σ-compact set. -/
  isSigmaCompact_univ : IsSigmaCompact (univ : Set X)

{X : Type u_4}
[TopologicalSpace X]
[self : SigmaCompactSpace X]


@[simp] lemma inl_inf (a₁ a₂ : α) : (inlₗ (a₁ ⊓ a₂) : α ⊕ β) = inlₗ a₁ ⊓ inlₗ a₂

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

Sum.inlₗ (a₁ ⊓ a₂) = Sum.inlₗ a₁ ⊓ Sum.inlₗ a₂


@[simp]
theorem walkingParallelPairOpEquiv_unitIso_zero :
    walkingParallelPairOpEquiv.unitIso.app zero = Iso.refl zero

CategoryTheory.Limits.walkingParallelPairOpEquiv.unitIso.app CategoryTheory.Limits.WalkingParallelPair.zero =
  CategoryTheory.Iso.refl CategoryTheory.Limits.WalkingParallelPair.zero


/-- Constructs an isomorphism of complete lattices from an order isomorphism between them. -/
@[simps]
def Iso.mk {α β : CompleteLat.{u}} (e : α ≃o β) : α ≅ β

{α β : CompleteLat}
(e : ↑α ≃o ↑β)
(a : ↑β)

(CompleteLat.Iso.mk e).inv.toFun a = e.symm a


theorem ne_of_lt {i₁ i₂ : Pos} (h : i₁ < i₂) : i₁ ≠ i₂


@[simp]
theorem preimage_Ico {a b : α} : (Nat.cast : ℕ → α) ⁻¹' Set.Ico a b = Set.Ico ⌈a⌉₊ ⌈b⌉₊

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
{a b : α}

Nat.cast ⁻¹' Set.Ico a b = Set.Ico ⌈a⌉₊ ⌈b⌉₊


/-- Evaluation as a linear map -/
@[simps!] def evalₗ (R : Type*) [Semiring R] [AddCommMonoid Y]
    [Module R Y] (x : X) : LocallyConstant X Y →ₗ[R] Y

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
(R : Type u_6)
[Semiring R]
[AddCommMonoid Y]
[Module R Y]
(x : X)

∀ (a : LocallyConstant X Y), (LocallyConstant.evalₗ R x) a = a x


theorem lt_next' (s : String) (p : Pos) : p < next s p


@[simp] lemma eq_update_self_iff : f = update f a b ↔ f a = b

{α : Sort u}
{β : α → Sort v}
[DecidableEq α]
{f : (a : α) → β a}
{a : α}
{b : β a}


lemma liftLinear_apply₀ {f : OuterMeasure α →ₗ[ℝ≥0∞] OuterMeasure β} (hf) {s : Set β}
    (hs : NullMeasurableSet s (liftLinear f hf μ)) : liftLinear f hf μ s = f μ.toOuterMeasure s

{f : MeasureTheory.OuterMeasure α →ₗ[ENNReal] MeasureTheory.OuterMeasure β}

(hf : ∀ (μ : MeasureTheory.Measure α), inst✝ ≤ (f μ.toOuterMeasure).caratheodory)

(hs : MeasureTheory.NullMeasurableSet s ((MeasureTheory.Measure.liftLinear f hf) μ))

((MeasureTheory.Measure.liftLinear f hf) μ) s = (f μ.toOuterMeasure) s


theorem Periodic.int_mul_sub_eq [Ring α] (h : Periodic f c) (n : ℤ) : f (n * c - x) = f (-x)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c x : α}
[Ring α]
(h : Function.Periodic f c)
(n : ℤ)


theorem tendsto_nat_ceil_div_atTop : Tendsto (fun x ↦ (⌈x⌉₊ : R) / x) atTop (𝓝 1)

{R : Type u_4}
[TopologicalSpace R]
[LinearOrderedField R]
[OrderTopology R]
[FloorRing R]

Filter.Tendsto (fun x => ↑⌈x⌉₊ / x) Filter.atTop (𝓝 1)


theorem DifferentiableAt.differentiableWithinAt (h : DifferentiableAt 𝕜 f x) :
    DifferentiableWithinAt 𝕜 f s x

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


theorem add_lf_add_of_le_of_lf {w x y z : PGame} (hwx : w ≤ x) (hyz : y ⧏ z) : w + y ⧏ x + z

{w x y z : SetTheory.PGame}
(hwx : w ≤ x)
(hyz : y.LF z)


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

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

self.toFun (r + s) ≤ max (self.toFun r) (self.toFun s)


theorem MDifferentiableOn.prod_mk_space {f : M → E'} {g : M → E''}
    (hf : MDifferentiableOn I 𝓘(𝕜, E') f s) (hg : MDifferentiableOn I 𝓘(𝕜, E'') g s) :
    MDifferentiableOn I 𝓘(𝕜, E' × E'') (fun x => (f x, g x)) s


/-- To give an isomorphism between cocones, it suffices to give an
  isomorphism between their vertices which commutes with the cocone
  maps. -/
-- Porting note: `@[ext]` used to accept lemmas like this. Now we add an aesop rule
@[aesop apply safe (rule_sets := [CategoryTheory]), simps]
def ext {P Q : C} {c c' : BinaryBicone P Q} (φ : c.pt ≅ c'.pt)
    (winl : c.inl ≫ φ.hom = c'.inl := by aesop_cat)
    (winr : c.inr ≫ φ.hom = c'.inr := by aesop_cat)
    (wfst : φ.hom ≫ c'.fst = c.fst := by aesop_cat)
    (wsnd : φ.hom ≫ c'.snd = c.snd := by aesop_cat) : c ≅ c'

{c c' : CategoryTheory.Limits.BinaryBicone P Q}

(CategoryTheory.Limits.BinaryBicones.ext φ winl winr wfst wsnd).inv.hom = φ.inv


theorem _root_.NumberField.mixedEmbedding.volume_fundamentalDomain_latticeBasis :
    volume (fundamentalDomain (latticeBasis K)) =
      (2 : ℝ≥0∞)⁻¹ ^ NrComplexPlaces K * sqrt ‖discr K‖₊

(K : Type u_1)
[Field K]
[NumberField K]

MeasureTheory.volume (Zspan.fundamentalDomain (NumberField.mixedEmbedding.latticeBasis K)) =
  2⁻¹ ^ NumberField.InfinitePlace.NrComplexPlaces K * ↑(NNReal.sqrt ‖NumberField.discr K‖₊)


@[simp] theorem ofNat'_add (x : Nat) (lt : 0 < n) (y : Fin n) :
    Fin.ofNat' x lt + y = Fin.ofNat' (x + y.val) lt

{n : Nat}
(x : Nat)
(lt : 0 < n)
(y : Fin n)

Fin.ofNat' x lt + y = Fin.ofNat' (x + ↑y) lt


@[simp]
theorem norm_zero : norm (0 : ℤ√d) = 0


theorem proj_eq_of_subset (h : ∀ i, J i → K i) : π (π C K) J = π C J

{I : Type u}
(C : Set (I → Bool))
(J K : I → Prop)
[(i : I) → Decidable (J i)]
[(i : I) → Decidable (K i)]
(h : ∀ (i : I), J i → K i)

Profinite.NobelingProof.π (Profinite.NobelingProof.π C K) J = Profinite.NobelingProof.π C J


/-- An induction principle for closure membership. If `p` holds for all elements of `s`, and
is preserved under function symbols, then `p` holds for all elements of the closure of `s`. -/
@[elab_as_elim]
theorem closure_induction {p : M → Prop} {x} (h : x ∈ closure L s) (Hs : ∀ x ∈ s, p x)
    (Hfun : ∀ {n : ℕ} (f : L.Functions n), ClosedUnder f (setOf p)) : p x

(h : x ∈ (FirstOrder.Language.Substructure.closure L).toFun s)

(Hfun : ∀ {n : ℕ} (f : L.Functions n), FirstOrder.Language.ClosedUnder f (setOf p))


/-- The equivalence between `LinOrd` and itself induced by `OrderDual` both ways. -/
@[simps functor inverse]
def dualEquiv : LinOrd ≌ LinOrd


/--
Given a natural isomorphism `G ⋙ ℱ ≅ G ⋙ ℱ'` between presheaves of arbitrary category,
where `G` is locally-full and cover-dense, and `ℱ', ℱ` are sheaves,
we may obtain a natural isomorphism between presheaves.
-/
@[simps!]
noncomputable def presheafIso {ℱ ℱ' : Sheaf K A} (i : G.op ⋙ ℱ.val ≅ G.op ⋙ ℱ'.val) :
    ℱ.val ≅ ℱ'.val

{K : CategoryTheory.GrothendieckTopology D}

(i : G.op.comp ℱ.val ≅ G.op.comp ℱ'.val)

(CategoryTheory.Functor.IsCoverDense.presheafIso i).inv =
  CategoryTheory.inv (CategoryTheory.Functor.IsCoverDense.sheafHom i.hom)


theorem pow_prime_pow_sub_pow_prime_pow (a : ℕ) :
    multiplicity (↑p) (x ^ p ^ a - y ^ p ^ a) = multiplicity (↑p) (x - y) + a

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

multiplicity (↑p) (x ^ p ^ a - y ^ p ^ a) = multiplicity (↑p) (x - y) + ↑a


@[to_additive]
protected lemma _root_.MonoidHom.map_multiset_prod (f : α →* β) (s : Multiset α) :
    f s.prod = (s.map f).prod

{α : Type u_3}
{β : Type u_4}
[CommMonoid α]
[CommMonoid β]
(f : α →* β)
(s : Multiset α)


@[to_additive]
theorem prod_range_succ_comm (f : ℕ → β) (n : ℕ) :
    (∏ x ∈ range (n + 1), f x) = f n * ∏ x ∈ range n, f x

{β : Type u_4}
[AddCommMonoid β]
(f : ℕ → β)
(n : ℕ)

∑ x ∈ Finset.range (n + 1), f x = f n + ∑ x ∈ Finset.range n, f x


@[simp]
theorem evalFrom_append_singleton (S : Set σ) (x : List α) (a : α) :
    M.evalFrom S (x ++ [a]) = M.stepSet (M.evalFrom S x) a

{α : Type u}
{σ : Type v}
(M : εNFA α σ)
(S : Set σ)
(x : List α)
(a : α)


lemma sqrt.iter_sq_le (n guess : ℕ) : sqrt.iter n guess * sqrt.iter n guess ≤ n

Nat.sqrt.iter n guess * Nat.sqrt.iter n guess ≤ n


theorem integral_nonneg_of_ae (hab : a ≤ b) (hf : 0 ≤ᵐ[μ] f) : 0 ≤ ∫ u in a..b, f u ∂μ

{f : ℝ → ℝ}
{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}
(hab : a ≤ b)
(hf : 0 ≤ᵐ[μ] f)


@[reassoc (attr := simp)]
theorem fac (H : IsKan t) (s : LeftLift f g) :
    t.unit ≫ H.desc s ▷ f = s.unit

{t : CategoryTheory.Bicategory.LeftLift f g}

(s : CategoryTheory.Bicategory.LeftLift f g)

CategoryTheory.CategoryStruct.comp t.unit (CategoryTheory.Bicategory.whiskerRight (H.desc s) f) = s.unit


@[simp]
theorem center_eq_top (R) [CommSemiring R] : center R = ⊤


/-- Two equivalent partial homeomorphisms are equal when the source and target are `univ`. -/
theorem Set.EqOn.restr_eqOn_source {e e' : PartialHomeomorph X Y}
    (h : EqOn e e' (e.source ∩ e'.source)) : e.restr e'.source ≈ e'.restr e.source

(h : Set.EqOn (↑e) (↑e') (e.source ∩ e'.source))


@[simp, mfld_simps]
theorem Pullback.lift_mk (f : B' → B) (x : B') (y : E (f x)) :
    Pullback.lift f (.mk' F x y) = ⟨f x, y⟩

{B : Type u_1}
{F : Type u_2}
{E : B → Type u_3}
{B' : Type u_4}
(f : B' → B)
(x : B')
(y : E (f x))

Bundle.Pullback.lift f (Bundle.TotalSpace.mk' F x y) = { proj := f x, snd := y }


theorem toSubalgebra_le_iff {S₁ S₂ : StarSubalgebra R A} :
    S₁.toSubalgebra ≤ S₂.toSubalgebra ↔ S₁ ≤ S₂

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[StarRing A]
[Algebra R A]
[StarModule R A]
{S₁ S₂ : StarSubalgebra R A}


theorem coe_injective : Function.Injective (fun (a : ℕ+) => (a : ℕ))


/-- If M is the midpoint of the segment AB and C is the same distance from A as it is from B
then ∠CMA = π / 2. -/
theorem angle_left_midpoint_eq_pi_div_two_of_dist_eq {p1 p2 p3 : P} (h : dist p3 p1 = dist p3 p2) :
    ∠ p3 (midpoint ℝ p1 p2) p1 = π / 2

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p1 p2 p3 : P}
(h : dist p3 p1 = dist p3 p2)

EuclideanGeometry.angle p3 (midpoint ℝ p1 p2) p1 = π / 2


/-- Bound for `|log x * x ^ t|` in the interval `(0, 1]`, for positive real `t`. -/
theorem abs_log_mul_self_rpow_lt (x t : ℝ) (h1 : 0 < x) (h2 : x ≤ 1) (ht : 0 < t) :
    |log x * x ^ t| < 1 / t


theorem mul_lt_top' [LT α] {a b : WithTop α} (ha : a < ⊤) (hb : b < ⊤) : a * b < ⊤

{α : Type u_1}
[DecidableEq α]
[MulZeroClass α]
[LT α]
{a b : WithTop α}
(ha : a < ⊤)
(hb : b < ⊤)


@[to_additive]
theorem prod_hom (l : List M) {F : Type*} [FunLike F M N] [MonoidHomClass F M N] (f : F) :
    (l.map f).prod = f l.prod

{M : Type u_4}
{N : Type u_5}
[AddMonoid M]
[AddMonoid N]
(l : List M)
{F : Type u_8}
[FunLike F M N]
[AddMonoidHomClass F M N]
(f : F)


@[fun_prop]
theorem HasFDerivAt.clm_comp (hc : HasFDerivAt c c' x) (hd : HasFDerivAt d d' x) :
    HasFDerivAt (fun y => (c y).comp (d y))
      ((compL 𝕜 F G H (c x)).comp d' + ((compL 𝕜 F G H).flip (d x)).comp c') 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}
{H : Type u_6}
[NormedAddCommGroup H]
[NormedSpace 𝕜 H]
{c : E → G →L[𝕜] H}
{c' : E →L[𝕜] G →L[𝕜] H}
{d : E → F →L[𝕜] G}
{d' : E →L[𝕜] F →L[𝕜] G}
(hc : HasFDerivAt c c' x)
(hd : HasFDerivAt d d' x)

HasFDerivAt (fun y => (c y).comp (d y))
  (((ContinuousLinearMap.compL 𝕜 F G H) (c x)).comp d' + ((ContinuousLinearMap.compL 𝕜 F G H).flip (d x)).comp c') x


theorem nhds_top' : 𝓝 ∞ = ⨅ r : ℝ≥0, 𝓟 (Ioi ↑r)


@[to_additive]
theorem mul_comp (g₁ g₂ : β →*o γ) (f : α →*o β) : (g₁ * g₂).comp f = g₁.comp f * g₂.comp f

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[OrderedAddCommMonoid α]
[OrderedAddCommMonoid β]
[OrderedAddCommMonoid γ]
(g₁ g₂ : β →+o γ)
(f : α →+o β)

(g₁ + g₂).comp f = g₁.comp f + g₂.comp f


@[deprecated map_prod (since := "2024-06-20")]
protected theorem map_prod {ι : Type*} (f : ι → A₁) (s : Finset ι) :
    e (∏ x ∈ s, f x) = ∏ x ∈ s, e (f x)

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[CommSemiring A₁]
[CommSemiring A₂]
[Algebra R A₁]
[Algebra R A₂]
(e : A₁ ≃ₐ[R] A₂)
{ι : Type u_1}
(f : ι → A₁)
(s : Finset ι)


theorem pow_lt_ascFactorial (n : ℕ) : ∀ {k : ℕ}, 2 ≤ k → (n + 1) ^ k < (n + 1).ascFactorial k


theorem integral_sub (hf : Integrable I l f vol) (hg : Integrable I l g vol) :
    integral I l (f - g) vol = integral I l f vol - integral I l g vol

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

BoxIntegral.integral I l (f - g) vol = BoxIntegral.integral I l f vol - BoxIntegral.integral I l g vol


/-- A universal property of the complex numbers, providing a unique `ℂ →ₐ[ℝ] A` for every element
of `A` which squares to `-1`.

This can be used to embed the complex numbers in the `Quaternion`s.

This isomorphism is named to match the very similar `Zsqrtd.lift`. -/
@[simps (config := { simpRhs := true })]
def lift : { I' : A // I' * I' = -1 } ≃ (ℂ →ₐ[ℝ] A)

{A : Type u_1}
[Ring A]
[Algebra ℝ A]
(F : ℂ →ₐ[ℝ] A)


theorem Monic.degree_mul (hq : Monic q) : degree (p * q) = degree p + degree q

{R : Type u}
[Semiring R]
{p q : R[X]}
(hq : q.Monic)


theorem corec_id_f_eq_iterate (f : α → α) (a : α) : corec id f a = iterate f a

Stream'.corec id f a = Stream'.iterate f a


theorem cycleFactorsFinset_eq_finset {σ : Perm α} {s : Finset (Perm α)} :
    σ.cycleFactorsFinset = s ↔
      (∀ f : Perm α, f ∈ s → f.IsCycle) ∧
        ∃ h : (s : Set (Perm α)).Pairwise Disjoint,
          s.noncommProd id (h.mono' fun _ _ => Disjoint.commute) = σ

{α : Type u_2}
[DecidableEq α]
[Fintype α]
{σ : Equiv.Perm α}
{s : Finset (Equiv.Perm α)}

σ.cycleFactorsFinset = s ↔ (∀ f ∈ s, f.IsCycle) ∧ ∃ (h : (↑s).Pairwise Equiv.Perm.Disjoint), s.noncommProd id ⋯ = σ


/-- A special case of `ContDiffWithinAt.fderivWithin''` where we require that `s ⊆ g⁻¹(t)`. -/
theorem ContDiffWithinAt.fderivWithin' {f : E → F → G} {g : E → F} {t : Set F} {n : ℕ∞}
    (hf : ContDiffWithinAt 𝕜 n (Function.uncurry f) (insert x₀ s ×ˢ t) (x₀, g x₀))
    (hg : ContDiffWithinAt 𝕜 m g s x₀)
    (ht : ∀ᶠ x in 𝓝[insert x₀ s] x₀, UniqueDiffWithinAt 𝕜 t (g x)) (hmn : m + 1 ≤ n)
    (hst : s ⊆ g ⁻¹' t) : ContDiffWithinAt 𝕜 m (fun x => fderivWithin 𝕜 (f x) t (g x)) s x₀

(ht : ∀ᶠ (x : E) in 𝓝[insert x₀ s] x₀, UniqueDiffWithinAt 𝕜 t (g x))


theorem IsCoprime.pow_iff (hm : 0 < m) (hn : 0 < n) : IsCoprime (x ^ m) (y ^ n) ↔ IsCoprime x y

{R : Type u}
[CommSemiring R]
{x y : R}
{m n : ℕ}
(hm : 0 < m)
(hn : 0 < n)


/-- The predicate asserting that the result of `alterP` is safe to construct. -/
class AlterWF (t : RBSet α cmp) (cut : α → Ordering) (f : Option α → Option α) : Prop where
  /-- The resulting tree is well formed. -/
  wf : (t.1.alter cut f).WF cmp

{α : Type u_1}
{cmp : α → α → Ordering}
{t : Batteries.RBSet α cmp}
{cut : α → Ordering}
{f : Option α → Option α}
[self : t.AlterWF cut f]

Batteries.RBNode.WF cmp (Batteries.RBNode.alter cut f t.val)


theorem memℒp_of_finite_measure_preimage (p : ℝ≥0∞) {f : α →ₛ E}
    (hf : ∀ y, y ≠ 0 → μ (f ⁻¹' {y}) < ∞) : Memℒp f p μ

(hf : ∀ (y : E), y ≠ 0 → μ (↑f ⁻¹' {y}) < ⊤)


/-- Restrict a partial homeomorphism to the subsets of the source and target
that consist of points `x ∈ f.source`, `y = f x ∈ f.target`
such that `f` is `C^n` at `x` and `f.symm` is `C^n` at `y`.

Note that `n` is a natural number, not `∞`,
because the set of points of `C^∞`-smoothness of `f` is not guaranteed to be open. -/
@[simps! apply symm_apply source target]
def restrContDiff (f : PartialHomeomorph E F) (n : ℕ) : PartialHomeomorph E F

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(f : PartialHomeomorph E F)
(n : ℕ)

∀ (a : E), ↑(PartialHomeomorph.restrContDiff 𝕜 f n) a = ↑f a


protected lemma eq_or_eq_neg_of_sq_eq_sq (a b : Rˣ) (h : a ^ 2 = b ^ 2) : a = b ∨ a = -b

{R : Type x}
[CommRing R]
[NoZeroDivisors R]
(a b : Rˣ)
(h : a ^ 2 = b ^ 2)


theorem eq_of_right_mem_center {g h : M} (H : IsConj g h) (Hh : h ∈ Set.center M) : g = h

{M : Type u_2}
[Monoid M]
{g h : M}
(H : IsConj g h)
(Hh : h ∈ Set.center M)


/-- Bifunctor. This typeclass asserts that a lawless `Bifunctor` is lawful. -/
class LawfulBifunctor (F : Type u₀ → Type u₁ → Type u₂) [Bifunctor F] : Prop where
  id_bimap : ∀ {α β} (x : F α β), bimap id id x = x
  bimap_bimap :
    ∀ {α₀ α₁ α₂ β₀ β₁ β₂} (f : α₀ → α₁) (f' : α₁ → α₂) (g : β₀ → β₁) (g' : β₁ → β₂) (x : F α₀ β₀),
      bimap f' g' (bimap f g x) = bimap (f' ∘ f) (g' ∘ g) x

{F : Type u₀ → Type u₁ → Type u₂}
[Bifunctor F]
[self : LawfulBifunctor F]
{α₀ α₁ α₂ : Type u₀}
{β₀ β₁ β₂ : Type u₁}
(f : α₀ → α₁)
(f' : α₁ → α₂)
(g : β₀ → β₁)
(g' : β₁ → β₂)
(x : F α₀ β₀)


@[simp]
theorem toComplex_inj {x y : ℤ[i]} : (x : ℂ) = y ↔ x = y

GaussianInt.toComplex x = GaussianInt.toComplex y ↔ x = y


@[to_additive]
theorem le_tprod (hf : Multipliable f) (i : ι) (hb : ∀ j, j ≠ i → 1 ≤ f j) : f i ≤ ∏' i, f i

{ι : Type u_1}
{α : Type u_3}
[OrderedAddCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{f : ι → α}
(hf : Summable f)
(i : ι)
(hb : ∀ (j : ι), j ≠ i → 0 ≤ f j)


protected theorem UniformSpace.le_def {u₁ u₂ : UniformSpace α} : u₁ ≤ u₂ ↔ 𝓤[u₁] ≤ 𝓤[u₂]

u₁ ≤ u₂ ↔ 𝓤 α ≤ 𝓤 α


@[simp]
theorem LinearMap.dualMap_id : (LinearMap.id : M₁ →ₗ[R] M₁).dualMap = LinearMap.id

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


theorem isInteger_add {x y : M'} (hx : IsInteger f x) (hy : IsInteger f y) : IsInteger f (x + y)

{R : Type u_1}
[CommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{M' : Type u_3}
[AddCommMonoid M']
[Module R M']
(f : M →ₗ[R] M')
{x y : M'}
(hx : IsLocalizedModule.IsInteger f x)
(hy : IsLocalizedModule.IsInteger f y)


/-- The restriction of scalars functor `SheafOfModules R' ⥤ SheafOfModules R`
induced by a morphism of sheaves of rings `R ⟶ R'`. -/
@[simps]
noncomputable def restrictScalars :
    SheafOfModules.{v} R' ⥤ SheafOfModules.{v} R

{J : CategoryTheory.GrothendieckTopology C}

((SheafOfModules.restrictScalars α).obj M').val = (PresheafOfModules.restrictScalars α.val).obj M'.val


theorem StrictMonoOn.comp [Preorder α] [Preorder β] [Preorder γ] {g : β → γ} {f : α → β} {s : Set α}
    {t : Set β} (hg : StrictMonoOn g t) (hf : StrictMonoOn f s) (hs : Set.MapsTo f s t) :
    StrictMonoOn (g ∘ f) s

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Preorder α]
[Preorder β]
[Preorder γ]
{g : β → γ}
{f : α → β}
{s : Set α}
{t : Set β}
(hg : StrictMonoOn g t)
(hf : StrictMonoOn f s)
(hs : Set.MapsTo f s t)


theorem piFinset_subset (t₁ t₂ : ∀ a, Finset (δ a)) (h : ∀ a, t₁ a ⊆ t₂ a) :
    piFinset t₁ ⊆ piFinset t₂

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{δ : α → Type u_3}
(t₁ t₂ : (a : α) → Finset (δ a))
(h : ∀ (a : α), t₁ a ⊆ t₂ a)

Fintype.piFinset t₁ ⊆ Fintype.piFinset t₂


/-- The composition of the single functor `single j : C ⥤ GradedObject J C` and the
evaluation functor `eval j` identifies to the identity functor. -/
@[simps!]
noncomputable def singleCompEval (j : J) : single j ⋙ eval j ≅ 𝟭 C

{J : Type u_1}
(C : Type u_2)
[CategoryTheory.Category.{u_3, u_2} C]
[CategoryTheory.Limits.HasInitial C]
[DecidableEq J]
(j : J)
(X : C)

(CategoryTheory.GradedObject.singleCompEval C j).hom.app X = (CategoryTheory.GradedObject.singleObjApplyIso j X).hom