theorem lsum_apply (f : α → M →ₗ[R] N) (l : α →₀ M) : Finsupp.lsum S f l = l.sum fun b => f b

{α : Type u_1}
{M : Type u_2}
{N : Type u_3}
{R : Type u_5}
(S : Type u_6)
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
[Module S N]
[SMulCommClass R S N]
(f : α → M →ₗ[R] N)
(l : α →₀ M)

((Finsupp.lsum S) f) l = l.sum fun b => ⇑(f b)


/-- The output of the volume form of an oriented real inner product space `E` when evaluated on an
orthonormal basis is ±1. -/
theorem abs_volumeForm_apply_of_orthonormal (v : OrthonormalBasis (Fin n) ℝ E) :
    |o.volumeForm v| = 1

[_i : Fact (FiniteDimensional.finrank ℝ E = n)]


/-- The real exponential function tends to `1` at `0`. -/
theorem tendsto_exp_nhds_zero_nhds_one : Tendsto exp (𝓝 0) (𝓝 1)


theorem Prime.dvd_natAbs_of_coe_dvd_sq {p : ℕ} (hp : p.Prime) (k : ℤ) (h : (p : ℤ) ∣ k ^ 2) :
    p ∣ k.natAbs

{p : ℕ}
(hp : Nat.Prime p)
(k : ℤ)
(h : ↑p ∣ k ^ 2)


theorem eq_true_of_not_eq_false {a : Prop} (h : Not a = False) : a = True


theorem tendsto_nhds_infty' {α : Type*} {f : OnePoint X → α} {l : Filter α} :
    Tendsto f (𝓝 ∞) l ↔ Tendsto f (pure ∞) l ∧ Tendsto (f ∘ (↑)) (coclosedCompact X) l

{X : Type u_1}
[TopologicalSpace X]
{α : Type u_2}
{f : OnePoint X → α}
{l : Filter α}

Filter.Tendsto f (𝓝 OnePoint.infty) l ↔
  Filter.Tendsto f (pure OnePoint.infty) l ∧ Filter.Tendsto (f ∘ OnePoint.some) (Filter.coclosedCompact X) l


protected theorem Monotone.iterate {f : α → α} (hf : Monotone f) (n : ℕ) : Monotone f^[n]

{α : Type u}
[Preorder α]
{f : α → α}
(hf : Monotone f)
(n : ℕ)


/-- If two linear maps are equal on a set `s`, then they are equal on `Submodule.span s`.

This version uses `Set.EqOn`, and the hidden argument will expand to `h : x ∈ (span R s : Set M)`.
See `LinearMap.eqOn_span` for a version that takes `h : x ∈ span R s` as an argument. -/
theorem eqOn_span' {s : Set M} {f g : F} (H : Set.EqOn f g s) :
    Set.EqOn f g (span R s : Set M)

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_4}
{M₂ : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Semiring R₂]
[AddCommMonoid M₂]
[Module R₂ M₂]
{F : Type u_8}
{σ₁₂ : R →+* R₂}
[FunLike F M M₂]
[SemilinearMapClass F σ₁₂ M M₂]
{s : Set M}
{f g : F}
(H : Set.EqOn (⇑f) (⇑g) s)


theorem openEmbedding_iff_isIso_comp {X Y Z : TopCat} (f : X ⟶ Y) (g : Y ⟶ Z) [IsIso f] :
    OpenEmbedding (f ≫ g) ↔ OpenEmbedding g

{X Y Z : TopCat}
(f : X ⟶ Y)
(g : Y ⟶ Z)
[CategoryTheory.IsIso f]

OpenEmbedding ⇑(f ≫ g) ↔ OpenEmbedding ⇑g


theorem degreeOf_rename_of_injective {p : MvPolynomial σ R} {f : σ → τ} (h : Function.Injective f)
    (i : σ) : degreeOf (f i) (rename f p) = degreeOf i p

{R : Type u}
{σ : Type u_1}
{τ : Type u_2}
[CommSemiring R]
{p : MvPolynomial σ R}
{f : σ → τ}
(h : Function.Injective f)
(i : σ)

MvPolynomial.degreeOf (f i) ((MvPolynomial.rename f) p) = MvPolynomial.degreeOf i p


theorem comp_traverse {G H : Type _ → Type _} [Applicative G] [Applicative H] [CommApplicative G]
    [CommApplicative H] {α β γ : Type _} (g : α → G β) (h : β → H γ) (x : Multiset α) :
    traverse (Comp.mk ∘ Functor.map h ∘ g) x =
    Comp.mk (Functor.map (traverse h) (traverse g x))

{G H : Type u_1 → Type u_1}
[Applicative G]
[Applicative H]
[CommApplicative G]
[CommApplicative H]
{α β γ : Type u_1}
(g : α → G β)
(h : β → H γ)
(x : Multiset α)

Multiset.traverse (Functor.Comp.mk ∘ Functor.map h ∘ g) x =
  Functor.Comp.mk (Multiset.traverse h <$> Multiset.traverse g x)


@[simp] theorem infinite_neg {x : ℝ*} : Infinite (-x) ↔ Infinite x


/-- A topological space is *pseudo metrizable* if there exists a pseudo metric space structure
compatible with the topology. To endow such a space with a compatible distance, use
`letI : PseudoMetricSpace X := TopologicalSpace.pseudoMetrizableSpacePseudoMetric X`. -/
class PseudoMetrizableSpace (X : Type*) [t : TopologicalSpace X] : Prop where
  exists_pseudo_metric : ∃ m : PseudoMetricSpace X, m.toUniformSpace.toTopologicalSpace = t

[self : TopologicalSpace.PseudoMetrizableSpace X]

∃ m, UniformSpace.toTopologicalSpace = t


theorem monomial_le_degreeOf (i : σ) {f : MvPolynomial σ R} {m : σ →₀ ℕ} (h_m : m ∈ f.support) :
    m i ≤ degreeOf i f

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(i : σ)
{f : MvPolynomial σ R}
{m : σ →₀ ℕ}
(h_m : m ∈ f.support)


/-- The image of a measurable set in a standard Borel space under a measurable map
is an analytic set. -/
theorem _root_.MeasurableSet.analyticSet_image {X Y : Type*} [MeasurableSpace X]
    [StandardBorelSpace X] [TopologicalSpace Y] [MeasurableSpace Y]
    [OpensMeasurableSpace Y] {f : X → Y} [SecondCountableTopology (range f)] {s : Set X}
    (hs : MeasurableSet s) (hf : Measurable f) : AnalyticSet (f '' s)


theorem unop_fst {X Y Z : Cᵒᵖ} {f : X ⟶ Y} {g : X ⟶ Z} (c : PushoutCocone f g) :
    c.unop.fst = c.inl.unop

(c : CategoryTheory.Limits.PushoutCocone f g)


@[simp] theorem mem_union_iff [LawfulBEq α] {x : α} {l₁ l₂ : List α} :
    x ∈ l₁ ∪ l₂ ↔ x ∈ l₁ ∨ x ∈ l₂

{α : Type u_1}
[BEq α]
[LawfulBEq α]
{x : α}
{l₁ l₂ : List α}

x ∈ l₁ ∪ l₂ ↔ x ∈ l₁ ∨ x ∈ l₂


theorem kerase_nil {a} : @kerase _ β _ a [] = []

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}


/-- If two words have a common maximal reduction, then they correspond to the same element in the
  free group. -/
@[to_additive "If two words have a common maximal reduction, then they correspond to the same
  element in the additive free group."]
theorem reduce.exact (H : reduce L₁ = reduce L₂) : mk L₁ = mk L₂

(H : FreeGroup.reduce L₁ = FreeGroup.reduce L₂)


theorem isIntegral_iff {x : A} : IsIntegral R x ↔ ∃ y : R, algebraMap R A y = x

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[CommRing A]
[Algebra R A]
[iic : IsIntegrallyClosedIn R A]
{x : A}

IsIntegral R x ↔ ∃ y, (algebraMap R A) y = x


theorem eq_of_le {f g : Ultrafilter α} (h : (f : Filter α) ≤ g) : f = g

{α : Type u}
{f g : Ultrafilter α}
(h : ↑f ≤ ↑g)


lemma decomp_to {i : ℤ} {A : C} (f : A ⟶ (mappingCone φ).X i) (j : ℤ) (hij : i + 1 = j) :
    ∃ (a : A ⟶ F.X j) (b : A ⟶ G.X i), f = a ≫ (inl φ).v j i (by omega) + b ≫ (inr φ).f i

(f : A ⟶ (CochainComplex.mappingCone φ).X i)

∃ a b, f = a ≫ (CochainComplex.mappingCone.inl φ).v j i ⋯ + b ≫ (CochainComplex.mappingCone.inr φ).f i


nonrec theorem HasIntegral.neg (hf : HasIntegral I l f vol y) : HasIntegral I l (-f) vol (-y)

(hf : BoxIntegral.HasIntegral I l f vol y)

BoxIntegral.HasIntegral I l (-f) vol (-y)


theorem image2_union_left : image2 f (s ∪ s') t = image2 f s t ∪ image2 f s' t

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{f : α → β → γ}
{s s' : Set α}
{t : Set β}

Set.image2 f (s ∪ s') t = Set.image2 f s t ∪ Set.image2 f s' t


/-- The continuous image of an analytic set is analytic -/
theorem AnalyticSet.image_of_continuousOn {β : Type*} [TopologicalSpace β] {s : Set α}
    (hs : AnalyticSet s) {f : α → β} (hf : ContinuousOn f s) : AnalyticSet (f '' s)

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_3}
[TopologicalSpace β]
{s : Set α}
(hs : MeasureTheory.AnalyticSet s)
{f : α → β}
(hf : ContinuousOn f s)


theorem wOppSide_vadd_right_iff {s : AffineSubspace R P} {x y : P} {v : V} (hv : v ∈ s.direction) :
    s.WOppSide x (v +ᵥ y) ↔ s.WOppSide x y

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[StrictOrderedCommRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y : P}
{v : V}
(hv : v ∈ s.direction)


@[norm_cast]
lemma cast_div_of_ne_zero (hq : (q.den : α) ≠ 0) (hr : (r.num : α) ≠ 0) :
    ↑(q / r) = (q / r : α)

{α : Type u_3}
[DivisionSemiring α]
{q r : ℚ≥0}
(hq : ↑q.den ≠ 0)
(hr : ↑r.num ≠ 0)


@[to_additive]
theorem coe_mker (f : F) : (mker f : Set M) = (f : M → N) ⁻¹' {1}

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{F : Type u_5}
[FunLike F M N]
[mc : MonoidHomClass F M N]
(f : F)


@[gcongr]
lemma image_mono (h : s ⊆ t) : f '' s ⊆ f '' t

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


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

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


/-- For any two sets `B₁`, `B₂` in a family with the exchange property, the differences `B₁ \ B₂`
and `B₂ \ B₁` have the same `ℕ∞`-cardinality. -/
theorem encard_diff_eq (hB₁ : Base B₁) (hB₂ : Base B₂) : (B₁ \ B₂).encard = (B₂ \ B₁).encard

{α : Type u_1}
{Base : Set α → Prop}
(exch : Matroid.ExchangeProperty Base)
{B₁ B₂ : Set α}
(hB₁ : Base B₁)
(hB₂ : Base B₂)


/-- Compose a quadratic map with a linear function on the left. -/
@[simps (config := { simpRhs := true })]
def _root_.LinearMap.compQuadraticMap (f : N →ₗ[R] P) (Q : QuadraticMap R M N) :
    QuadraticMap R M P

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
[AddCommMonoid P]
[Module R P]
(f : N →ₗ[R] P)
(Q : QuadraticMap R M N)
(x : M)


@[simp]
theorem yonedaPairing_map (P Q : Cᵒᵖ × (Cᵒᵖ ⥤ Type v₁)) (α : P ⟶ Q) (β : (yonedaPairing C).obj P) :
    (yonedaPairing C).map α β = yoneda.map α.1.unop ≫ β ≫ α.2

(P Q : Cᵒᵖ × CategoryTheory.Functor Cᵒᵖ (Type v₁))

(β : (CategoryTheory.yonedaPairing C).obj P)

(CategoryTheory.yonedaPairing C).map α β =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.yoneda.map α.1.unop) (CategoryTheory.CategoryStruct.comp β α.2)


theorem Basis.Finite (hI : M.Basis I X) [FiniteRk M] : I.Finite

{α : Type u_1}
{M : Matroid α}
{I X : Set α}
(hI : M.Basis I X)
[M.FiniteRk]


theorem comp_right {a b c : C} (g : b ⟶ c) :
    ∀ (f₁ f₂ : a ⟶ b) (_ : CompClosure r f₁ f₂), CompClosure r (f₁ ≫ g) (f₂ ≫ g)

{C : Type u_2}
[CategoryTheory.Category.{u_1, u_2} C]
(r : HomRel C)
{a b c : C}
(g : b ⟶ c)
(f₁ f₂ : a ⟶ b)

CategoryTheory.Quotient.CompClosure r f₁ f₂ →
  CategoryTheory.Quotient.CompClosure r (CategoryTheory.CategoryStruct.comp f₁ g)
    (CategoryTheory.CategoryStruct.comp f₂ g)


theorem gcd_dvd_gcd_of_dvd_right {m k : Nat} (n : Nat) (H : m ∣ k) : gcd n m ∣ gcd n k


lemma relativeDifferentials'_map_d {X Y : Dᵒᵖ} (f : X ⟶ Y)
    (x : R.obj X) :
    (relativeDifferentials' φ').map f (CommRingCat.KaehlerDifferential.d x) =
      CommRingCat.KaehlerDifferential.d (R.map f x)

{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{S' R : Dᵒᵖ ⥤ CommRingCat}
(φ' : S' ⟶ R)
{X Y : Dᵒᵖ}
(f : X ⟶ Y)
(x : ↑(R.obj X))

((PresheafOfModules.DifferentialsConstruction.relativeDifferentials' φ').map f) (CommRingCat.KaehlerDifferential.d x) =
  CommRingCat.KaehlerDifferential.d ((R.map f) x)


@[instance]
theorem ordConnected_range {E : Type*} [EquivLike E α β] [OrderIsoClass E α β] (e : E) :
    OrdConnected (range e)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{E : Type u_3}
[EquivLike E α β]
[OrderIsoClass E α β]
(e : E)


/-- An angle in a right-angled triangle expressed using `arccos`, version subtracting vectors. -/
theorem oangle_sub_right_eq_arccos_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = ↑(π / 2)) :
    o.oangle y (y - x) = Real.arccos (‖y‖ / ‖y - x‖)

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

o.oangle y (y - x) = ↑(Real.arccos (‖y‖ / ‖y - x‖))


theorem preimage_iterate_eq {f : α → α} {n : ℕ} : Set.preimage f^[n] = (Set.preimage f)^[n]


/-- Negating a matrix partitioned by columns is equivalent to negating each of the columns. -/
@[simp]
lemma fromColumns_neg (A₁ : Matrix n m₁ R) (A₂ : Matrix n m₂ R) :
    -fromColumns A₁ A₂ = fromColumns (-A₁) (-A₂)

{R : Type u_1}
{m₁ : Type u_3}
{m₂ : Type u_4}
{n : Type u_5}
[Neg R]
(A₁ : Matrix n m₁ R)
(A₂ : Matrix n m₂ R)

-A₁.fromColumns A₂ = (-A₁).fromColumns (-A₂)


@[simp] lemma val_natCast (a n : ℕ) [NeZero n] : (a : Fin n).val = a % n


/-- The affine span is the `sInf` of subspaces containing the given points. -/
theorem affineSpan_eq_sInf (s : Set P) :
    affineSpan k s = sInf { s' : AffineSubspace k P | s ⊆ s' }

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


@[simp] theorem take_nil : ([] : List α).take i = []


@[to_additive (attr := simp, norm_cast)]
theorem coe_one : ((1 : H) : G) = 1

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


lemma support_mul_subset_right (f g : ι → M₀) : support (fun x ↦ f x * g x) ⊆ support g

{ι : Type u_1}
{M₀ : Type u_4}
[MulZeroClass M₀]
(f g : ι → M₀)

(Function.support fun x => f x * g x) ⊆ Function.support g


/-- If a function is antitone and is bounded on a set `s`, then it admits an antitone extension to
the whole space. -/
theorem AntitoneOn.exists_antitone_extension (h : AntitoneOn f s) (hl : BddBelow (f '' s))
    (hu : BddAbove (f '' s)) : ∃ g : α → β, Antitone g ∧ EqOn f g s

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[ConditionallyCompleteLinearOrder β]
{f : α → β}
{s : Set α}
(h : AntitoneOn f s)
(hl : BddBelow (f '' s))
(hu : BddAbove (f '' s))


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

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


/-- If a function `f` is continuous on a convex set `D ⊆ ℝ` and `f''` is strictly positive on `D`,
then `f` is strictly convex on `D`.
Note that we don't require twice differentiability explicitly as it is already implied by the second
derivative being strictly positive, except at at most one point. -/
theorem strictConvexOn_of_deriv2_pos' {D : Set ℝ} (hD : Convex ℝ D) {f : ℝ → ℝ}
    (hf : ContinuousOn f D) (hf'' : ∀ x ∈ D, 0 < (deriv^[2] f) x) : StrictConvexOn ℝ D f

{D : Set ℝ}
(hD : Convex ℝ D)
{f : ℝ → ℝ}
(hf : ContinuousOn f D)
(hf'' : ∀ x ∈ D, 0 < deriv^[2] f x)


theorem gameAdd_mk'_iff {a₁ a₂ b₁ b₂ : α} :
    GameAdd rα s(a₁, b₁) s(a₂, b₂) ↔
      Prod.GameAdd rα rα (a₁, b₁) (a₂, b₂) ∨ Prod.GameAdd rα rα (b₁, a₁) (a₂, b₂)

{α : Type u_1}
{rα : α → α → Prop}
{a₁ a₂ b₁ b₂ : α}

Sym2.GameAdd rα s(a₁, b₁) s(a₂, b₂) ↔ Prod.GameAdd rα rα (a₁, b₁) (a₂, b₂) ∨ Prod.GameAdd rα rα (b₁, a₁) (a₂, b₂)


@[simp] theorem shiftLeft_shiftRight (x n : Nat) : x <<< n >>> n = x


@[measurability, fun_prop]
theorem AEMeasurable.ennreal_tsum {ι} [Countable ι] {f : ι → α → ℝ≥0∞} {μ : Measure α}
    (h : ∀ i, AEMeasurable (f i) μ) : AEMeasurable (fun x => ∑' i, f i x) μ

{α : Type u_1}
[MeasurableSpace α]
{ι : Type u_5}
[Countable ι]
{f : ι → α → ℝ≥0∞}
{μ : MeasureTheory.Measure α}
(h : ∀ (i : ι), AEMeasurable (f i) μ)

AEMeasurable (fun x => ∑' (i : ι), f i x) μ


theorem logb_mul_base {a b : ℝ} (h₁ : a ≠ 0) (h₂ : b ≠ 0) (c : ℝ) :
    logb (a * b) c = ((logb a c)⁻¹ + (logb b c)⁻¹)⁻¹

Real.logb (a * b) c = ((Real.logb a c)⁻¹ + (Real.logb b c)⁻¹)⁻¹


@[scoped simp]
theorem map_sub_const [AddGroup G] [AddGroup H] [AddConstMapClass F G H a b]
    (f : F) (x : G) : f (x - a) = f x - b

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


@[to_additive]
theorem card_mul_iff :
    (s * t).card = s.card * t.card ↔ (s ×ˢ t : Set (α × α)).InjOn fun p => p.1 * p.2

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

(s + t).card = s.card * t.card ↔ Set.InjOn (fun p => p.1 + p.2) (↑s ×ˢ ↑t)


@[gcongr]
theorem sdiff_le_sdiff_left (h : a ≤ b) : c \ b ≤ c \ a

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


theorem PInfty_f_add_QInfty_f (n : ℕ) : (PInfty.f n : X _[n] ⟶ _) + QInfty.f n = 𝟙 _

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

AlgebraicTopology.DoldKan.PInfty.f n + AlgebraicTopology.DoldKan.QInfty.f n = 𝟙 (K[X].X n)


theorem Valid.size_eq {s l x r} (H : Valid (@node α s l x r)) :
    size (@node α s l x r) = size l + size r + 1

{α : Type u_1}
[Preorder α]
{s : ℕ}
{l : Ordnode α}
{x : α}
{r : Ordnode α}
(H : (Ordnode.node s l x r).Valid)

(Ordnode.node s l x r).size = l.size + r.size + 1


@[simp]
theorem tmul_tensorAssoc_apply
    (Q₁ : QuadraticForm R M₁) (Q₂ : QuadraticForm R M₂) (Q₃ : QuadraticForm R M₃)
    (x : (M₁ ⊗[R] M₂) ⊗[R] M₃) :
    Q₁.tmul (Q₂.tmul Q₃) (TensorProduct.assoc R M₁ M₂ M₃ x) = (Q₁.tmul Q₂).tmul Q₃ x

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

(Q₁.tmul (Q₂.tmul Q₃)) ((TensorProduct.assoc R M₁ M₂ M₃) x) = ((Q₁.tmul Q₂).tmul Q₃) x


@[reassoc (attr := simp)]
theorem biproduct_ι_comp_rightDistributor_hom {J : Type} [Fintype J] (f : J → C) (X : C) (j : J) :
    (biproduct.ι _ j ▷ X) ≫ (rightDistributor f X).hom = biproduct.ι (fun j => f j ⊗ X) j

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.Limits.biproduct.ι f j) X)
    (CategoryTheory.rightDistributor f X).hom =
  CategoryTheory.Limits.biproduct.ι (fun j => CategoryTheory.MonoidalCategory.tensorObj (f j) X) j


theorem Equiv.not_fuzzy {x y : PGame} (h : x ≈ y) : ¬x ‖ y


theorem interedges_biUnion_left (s : Finset ι) (t : Finset β) (f : ι → Finset α) :
    interedges r (s.biUnion f) t = s.biUnion fun a ↦ interedges r (f a) t

{ι : Type u_2}
{α : Type u_4}
{β : Type u_5}
(r : α → β → Prop)
[(a : α) → DecidablePred (r a)]
[DecidableEq α]
[DecidableEq β]
(s : Finset ι)
(t : Finset β)
(f : ι → Finset α)

Rel.interedges r (s.biUnion f) t = s.biUnion fun a => Rel.interedges r (f a) t


@[to_additive (attr := simp)]
theorem smul_eq_empty : s • t = ∅ ↔ s = ∅ ∨ t = ∅

{α : Type u_2}
{β : Type u_3}
[VAdd α β]
{s : Set α}
{t : Set β}


lemma slope_lt_derivWithin (hfc : StrictConcaveOn ℝ S f) (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y)
    (hfd : DifferentiableWithinAt ℝ f S x) :
    slope f x y < derivWithin f S x

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


@[simp]
theorem mk_ρ_hom {X : F C} : ⟦Hom.ρ_hom X⟧ = (ρ_ X).hom

{X : CategoryTheory.FreeMonoidalCategory C}

⟦CategoryTheory.FreeMonoidalCategory.Hom.ρ_hom X⟧ = (CategoryTheory.MonoidalCategory.rightUnitor X).hom


lemma piFinset_image₂ (f : ∀ i, α i → β i → γ i) (s : ∀ i, Finset (α i)) (t : ∀ i, Finset (β i)) :
    piFinset (fun i ↦ image₂ (f i) (s i) (t i)) =
      image₂ (fun a b i ↦ f _ (a i) (b i)) (piFinset s) (piFinset t)

{ι : Type u_14}
{α : ι → Type u_15}
{β : ι → Type u_16}
{γ : ι → Type u_17}
[DecidableEq ι]
[Fintype ι]
[(i : ι) → DecidableEq (γ i)]
(f : (i : ι) → α i → β i → γ i)
(s : (i : ι) → Finset (α i))
(t : (i : ι) → Finset (β i))

(Fintype.piFinset fun i => Finset.image₂ (f i) (s i) (t i)) =
  Finset.image₂ (fun a b i => f i (a i) (b i)) (Fintype.piFinset s) (Fintype.piFinset t)


theorem mul_mem_right (h : a ∈ I) : a * b ∈ I

{α : Type u}
{a : α}
(b : α)
[CommSemiring α]
(I : Ideal α)
(h : a ∈ I)


@[simp]
theorem _root_.map_finset_sup' [SemilatticeSup β] [FunLike F α β] [SupHomClass F α β]
    (f : F) {s : Finset ι} (hs) (g : ι → α) :
    f (s.sup' hs g) = s.sup' hs (f ∘ g)

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
{ι : Type u_5}
[SemilatticeSup α]
[SemilatticeSup β]
[FunLike F α β]
[SupHomClass F α β]
(f : F)
{s : Finset ι}
(hs : s.Nonempty)
(g : ι → α)


@[simp, norm_cast]
theorem coe_eq_id {f : A →A[R] A} :
    (f : A →ₐ[R] A) = AlgHom.id R A ↔ f = ContinuousAlgHom.id R A

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

↑f = AlgHom.id R A ↔ f = ContinuousAlgHom.id R A


@[simp]
theorem not_infinite_iff_finite : ¬Infinite α ↔ Finite α


theorem Chain'.iff_mem : ∀ {l : List α}, Chain' R l ↔ Chain' (fun x y => x ∈ l ∧ y ∈ l ∧ R x y) l

{α : Type u}
{R : α → α → Prop}
{l : List α}

List.Chain' R l ↔ List.Chain' (fun x y => x ∈ l ∧ y ∈ l ∧ R x y) l


theorem GradedAlgebra.liftι_eq (i : ℕ) (x : ⋀[R]^i M) :
    GradedAlgebra.liftι R M x = DirectSum.of (fun i => ⋀[R]^i M) i x

(R : Type u_1)
(M : Type u_2)
[CommRing R]
[AddCommGroup M]
[Module R M]
(i : ℕ)
(x : ↥(⋀[R]^i M))

(ExteriorAlgebra.GradedAlgebra.liftι R M) ↑x = (DirectSum.of (fun i => ↥(⋀[R]^i M)) i) x


@[to_additive]
theorem iUnion_smul (s : ι → Set α) (t : Set β) : (⋃ i, s i) • t = ⋃ i, s i • t

{α : Type u_2}
{β : Type u_3}
{ι : Sort u_5}
[SMul α β]
(s : ι → Set α)
(t : Set β)


@[to_additive (attr := simp)]
theorem inv_univ : (univ : Set α)⁻¹ = univ


lemma reflection_apply_root :
    P.reflection i (P.root j) = P.root j - (P.pairing j i) • P.root i

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

(P.reflection i) (P.root j) = P.root j - P.pairing j i • P.root i


theorem coe_cycleRange_of_lt {n : ℕ} {i j : Fin n.succ} (h : j < i) :
    (cycleRange i j : ℕ) = j + 1


theorem lt_of_not_ge {a b : α} (h : ¬a ≥ b) : a < b

{α : Type u}
[LinearOrder α]
{a b : α}
(h : ¬a ≥ b)


theorem eq_mpr_bijective {α β : Sort _} (h : α = β) : Function.Bijective (Eq.mpr h)


/-- If a product is anisotropic then its components must be. The converse is not true. -/
theorem anisotropic_of_prod
    {Q₁ : QuadraticMap R M₁ P} {Q₂ : QuadraticMap R M₂ P} (h : (Q₁.prod Q₂).Anisotropic) :
    Q₁.Anisotropic ∧ Q₂.Anisotropic

{R : Type u_2}
{M₁ : Type u_3}
{M₂ : Type u_4}
{P : Type u_7}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid P]
[Module R M₁]
[Module R M₂]
[Module R P]
{Q₁ : QuadraticMap R M₁ P}
{Q₂ : QuadraticMap R M₂ P}
(h : (Q₁.prod Q₂).Anisotropic)


@[simp]
theorem Matrix.toLinearMap₂'_toMatrix' (B : (n → S₁) →ₗ[S₁] (m → S₂) →ₗ[S₂] N₂) :
    Matrix.toLinearMap₂' R (LinearMap.toMatrix₂' R B) = B

(Matrix.toLinearMap₂' R) ((LinearMap.toMatrix₂' R) B) = B


lemma isZero₃_of_isIso₁ (h : IsIso T.mor₁) : IsZero T.obj₃

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

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)


theorem of_constant_on_connected_clopens [LocallyConnectedSpace X] {f : X → Y}
    (h : ∀ U : Set X, IsConnected U → IsClopen U → ∀ x ∈ U, ∀ y ∈ U, f y = f x) :
    IsLocallyConstant f

(h : ∀ (U : Set X), IsConnected U → IsClopen U → ∀ x ∈ U, ∀ y ∈ U, f y = f x)


theorem toDerivation_injective :
    Function.Injective (toDerivation : LeftInvariantDerivation I G → _)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[Monoid G]
[SmoothMul I G]


theorem finsuppLeft_apply (t : (ι →₀ M) ⊗[R] N) (i : ι) :
    finsuppLeft R M N ι t i = rTensor N (Finsupp.lapply i) t

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

((TensorProduct.finsuppLeft R M N ι) t) i = (LinearMap.rTensor N (Finsupp.lapply i)) t


@[simp]
theorem map_bot (f : F) : map f ⊥ = ⊥

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


@[simp]
theorem _root_.RingHom.smulOneHom_eq_algebraMap : RingHom.smulOneHom = algebraMap R A

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


/-- If two `MonoidWithZeroHom`s agree on `-1` and the naturals then they are equal. -/
@[ext]
theorem ext_int {f g : ℤ →*₀ M} (h_neg_one : f (-1) = g (-1))
    (h_nat : f.comp Int.ofNatHom.toMonoidWithZeroHom = g.comp Int.ofNatHom.toMonoidWithZeroHom) :
    f = g


theorem decompId_i_toKaroubi (X : C) : decompId_i ((toKaroubi C).obj X) = 𝟙 _

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

((CategoryTheory.Idempotents.toKaroubi C).obj X).decompId_i =
  CategoryTheory.CategoryStruct.id ((CategoryTheory.Idempotents.toKaroubi C).obj X)


@[simp]
theorem compl_symmDiff_self : aᶜ ∆ a = ⊤

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


@[fun_prop]
theorem HasStrictFDerivAt.list_prod' {l : List ι} {x : E}
    (h : ∀ i ∈ l, HasStrictFDerivAt (f i ·) (f' i) x) :
    HasStrictFDerivAt (fun x ↦ (l.map (f · x)).prod)
      (∑ i : Fin l.length, ((l.take i).map (f · x)).prod •
        smulRight (f' (l.get i)) ((l.drop (.succ i)).map (f · x)).prod) x

(h : ∀ i ∈ l, HasStrictFDerivAt (fun x => f i x) (f' i) x)

HasStrictFDerivAt (fun x => (List.map (fun x_1 => f x_1 x) l).prod)
  (∑ i : Fin l.length,
    (List.map (fun x_1 => f x_1 x) (List.take (↑i) l)).prod •
      (f' (l.get i)).smulRight (List.map (fun x_1 => f x_1 x) (List.drop (↑i).succ l)).prod)
  x


theorem adapted_martingalePart (hf : Adapted ℱ f) : Adapted ℱ (martingalePart f ℱ μ)

{Ω : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[CompleteSpace E]
{f : ℕ → Ω → E}
{ℱ : MeasureTheory.Filtration ℕ m0}
(hf : MeasureTheory.Adapted ℱ f)

MeasureTheory.Adapted ℱ (MeasureTheory.martingalePart f ℱ μ)


@[simp]
theorem tensorRightTensor_hom_app (X Y Z : C) :
    (tensorRightTensor X Y).hom.app Z = (associator Z X Y).inv

{C : Type u}
[𝒞 : CategoryTheory.Category.{v, u} C]
[CategoryTheory.MonoidalCategory C]
(X Y Z : C)

(CategoryTheory.MonoidalCategory.tensorRightTensor X Y).hom.app Z =
  (CategoryTheory.MonoidalCategory.associator Z X Y).inv


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

{S : Type u_1}
{R : Type u_3}
[CommRing R]
(a : ℍ[R])
[SMul S R]
(s : S)


/-- An element of a ring multiplied by the additive inverse of one is the element's additive
  inverse. -/
theorem mul_neg_one (a : α) : a * -1 = -a

{α : Type u}
[MulOneClass α]
[HasDistribNeg α]
(a : α)


@[to_additive (attr := simp)]
theorem prod_one [∀ i, AddCommMonoid (β i)] [∀ (i) (x : β i), Decidable (x ≠ 0)] [CommMonoid γ]
    {f : Π₀ i, β i} : (f.prod fun _ _ => (1 : γ)) = 1

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


@[to_additive]
theorem map_comp_map {M'' N''} [MulOneClass M''] [MulOneClass N''] (f' : M' →* M'') (g' : N' →* N'')
    (f : M →* M') (g : N →* N') : (map f' g').comp (map f g) = map (f'.comp f) (g'.comp g)

{M : Type u_1}
{N : Type u_2}
{M' : Type u_3}
{N' : Type u_4}
[AddZeroClass M]
[AddZeroClass N]
[AddZeroClass M']
[AddZeroClass N']
{M'' : Type u_6}
{N'' : Type u_7}
[AddZeroClass M'']
[AddZeroClass N'']
(f' : M' →+ M'')
(g' : N' →+ N'')
(f : M →+ M')
(g : N →+ N')

(AddMonoid.Coprod.map f' g').comp (AddMonoid.Coprod.map f g) = AddMonoid.Coprod.map (f'.comp f) (g'.comp g)


lemma toENat_strictMonoOn : StrictMonoOn toENat (Iic ℵ₀)

StrictMonoOn (⇑Cardinal.toENat) (Set.Iic Cardinal.aleph0)


theorem iff_isInteger_or_isInteger :
    ValuationRing R ↔ ∀ x : K, IsLocalization.IsInteger R x ∨ IsLocalization.IsInteger R x⁻¹

(R : Type u_1)
[CommRing R]
[IsDomain R]
(K : Type u_2)
[Field K]
[Algebra R K]
[IsFractionRing R K]

ValuationRing R ↔ ∀ (x : K), IsLocalization.IsInteger R x ∨ IsLocalization.IsInteger R x⁻¹


/-- The cosine zeta function is differentiable everywhere, except at `s = 1` if `a = 0`. -/
lemma differentiableAt_cosZeta (a : UnitAddCircle) {s : ℂ} (hs' : s ≠ 1 ∨ a ≠ 0) :
    DifferentiableAt ℂ (cosZeta a) s

DifferentiableAt ℂ (HurwitzZeta.cosZeta a) s


protected theorem map_smul_inv {σ' : S →+* R} [RingHomInvPair σ σ'] (c : S) (x : M) :
    c • f x = f (σ' c • x)

{R : Type u_1}
{S : Type u_6}
{M : Type u_9}
{M₃ : Type u_12}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₃]
[Module R M]
[Module S M₃]
{σ : R →+* S}
(f : M →ₛₗ[σ] M₃)
{σ' : S →+* R}
[RingHomInvPair σ σ']
(c : S)
(x : M)


@[simp]
theorem commute_lmul_rmul_sq (a : A) : Commute (L a) (R (a * a))

{A : Type u_1}
[NonUnitalNonAssocRing A]
[IsJordan A]
(a : A)


@[to_additive (attr := simp)]
theorem op_le_op_iff {S₁ S₂ : Subgroup G} : S₁.op ≤ S₂.op ↔ S₁ ≤ S₂

{G : Type u_2}
[AddGroup G]
{S₁ S₂ : AddSubgroup G}


lemma cfc_predicate (f : R → R) (a : A) : p (cfc f a)

{R : Type u_1}
{A : Type u_2}
{p : A → Prop}
[CommSemiring R]
[StarRing R]
[MetricSpace R]
[TopologicalSemiring R]
[ContinuousStar R]
[TopologicalSpace A]
[Ring A]
[StarRing A]
[Algebra R A]
[ContinuousFunctionalCalculus R p]
(f : R → R)
(a : A)


@[simp]
theorem coe_const (y : Y) : (const X y : X → Y) = Function.const X y

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
(y : Y)

⇑(LocallyConstant.const X y) = Function.const X y


/-- Let `S` be an `R`-algebra, `M` a submonoid of `R`, and `S' = M⁻¹S`.
If the image of some `x : S` falls in the span of some finite `s ⊆ S'` over `R`,
then there exists some `m : M` such that `m • x` falls in the
span of `IsLocalization.finsetIntegerMultiple _ s` over `R`.
-/
theorem IsLocalization.smul_mem_finsetIntegerMultiple_span [Algebra R S] [Algebra R S']
    [IsScalarTower R S S'] [IsLocalization (M.map (algebraMap R S)) S'] (x : S) (s : Finset S')
    (hx : algebraMap S S' x ∈ Submodule.span R (s : Set S')) :
    ∃ m : M, m • x ∈
      Submodule.span R
        (IsLocalization.finsetIntegerMultiple (M.map (algebraMap R S)) s : Set S)

[IsLocalization (Submonoid.map (algebraMap R S) M) S']

(hx : (algebraMap S S') x ∈ Submodule.span R ↑s)

∃ m, m • x ∈ Submodule.span R ↑(IsLocalization.finsetIntegerMultiple (Submonoid.map (algebraMap R S) M) s)


lemma posSMulMono_iff_posSMulReflectLT : PosSMulMono α β ↔ PosSMulReflectLT α β

{α : Type u_1}
{β : Type u_2}
[SMul α β]
[Preorder α]
[LinearOrder β]
[Zero α]


lemma inductionOn'_self : b.inductionOn' b H0 Hs Hp = H0

{Hs : (k : ℤ) → b ≤ k → C k → C (k + 1)}

{Hp : (k : ℤ) → k ≤ b → C k → C (k - 1)}


theorem liftRel_mem_cases {R : α → β → Prop} {ca cb} (Ha : ∀ a ∈ ca, LiftRel R ca cb)
    (Hb : ∀ b ∈ cb, LiftRel R ca cb) : LiftRel R ca cb

(Ha : ∀ (a : α), a ∈ ca → Computation.LiftRel R ca cb)

(Hb : ∀ (b : β), b ∈ cb → Computation.LiftRel R ca cb)


@[simp]
theorem mem_const_vsub_affineSegment {x y z : P} (p : P) :
    p -ᵥ z ∈ affineSegment R (p -ᵥ x) (p -ᵥ y) ↔ z ∈ affineSegment R x y

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


/-- The functor `HomologicalComplex C c ⥤ ShortComplex C` which sends a homological
complex `K` to the short complex `K.X (c.prev i) ⟶ K.X i ⟶ K.X (c.next i)`. -/
@[simps!]
noncomputable def shortComplexFunctor (i : ι)

((HomologicalComplex.shortComplexFunctor C c i).obj K).X₃ = K.X (c.next i)


theorem image_closure (e : M₁ ≃SL[σ₁₂] M₂) (s : Set M₁) : e '' closure s = closure (e '' s)

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


/-- Scalar multiplication as a multiplicative homomorphism. -/
@[simps]
def smulMulHom [Monoid α] [Mul β] [MulAction α β] [IsScalarTower α β β] [SMulCommClass α β β] :
    α × β →ₙ* β

{α : Type u_5}
{β : Type u_6}
[Monoid α]
[Mul β]
[MulAction α β]
[IsScalarTower α β β]
[SMulCommClass α β β]
(a : α × β)


theorem exists_min_bad_of_exists_bad (r : α → α → Prop) (rk : α → ℕ) (s : Set α) :
    (∃ f, IsBadSeq r s f) → ∃ f, IsBadSeq r s f ∧ ∀ n, IsMinBadSeq r rk s n f

{α : Type u_2}
(r : α → α → Prop)
(rk : α → ℕ)
(s : Set α)

(∃ f, Set.PartiallyWellOrderedOn.IsBadSeq r s f) →
  ∃ f, Set.PartiallyWellOrderedOn.IsBadSeq r s f ∧ ∀ (n : ℕ), Set.PartiallyWellOrderedOn.IsMinBadSeq r rk s n f


@[simp]
theorem infEdist_cthickening (δ : ℝ) (s : Set E) (x : E) :
    infEdist x (cthickening δ s) = infEdist x s - ENNReal.ofReal δ

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
(δ : ℝ)
(s : Set E)
(x : E)

EMetric.infEdist x (Metric.cthickening δ s) = EMetric.infEdist x s - ENNReal.ofReal δ


theorem add_overlap_pf_zero (x : R) (e) :
    IsNat (a + b) (nat_lit 0) → IsNat (x ^ e * a + x ^ e * b) (nat_lit 0)

{R : Type u_1}
[CommSemiring R]
{a b : R}
(x : R)
(e : ℕ)

Mathlib.Meta.NormNum.IsNat (a + b) 0 → Mathlib.Meta.NormNum.IsNat (x ^ e * a + x ^ e * b) 0


protected theorem le_iff_sub_nonneg (a b : ℚ) : a ≤ b ↔ 0 ≤ b - a


theorem of_separable_splitting_field [sp : p.IsSplittingField F E] (hp : p.Separable) :
    IsGalois F E

[sp : Polynomial.IsSplittingField F E p]


@[to_additive (attr := simp)]
theorem coprodAssoc_symm_apply_inr_inr (x : P) :
    (coprodAssoc M N P).symm (inr (inr x)) = inr x

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[Monoid M]
[Monoid N]
[Monoid P]
(x : P)

(Monoid.MulEquiv.coprodAssoc M N P).symm (Monoid.Coprod.inr (Monoid.Coprod.inr x)) = Monoid.Coprod.inr x


@[reassoc (attr := simp)]
lemma p_fromOpcycles :
    K.pOpcycles i ≫ K.fromOpcycles i j = K.d i j


/-- `cyclotomic n R` is different from `0`. -/
theorem cyclotomic_ne_zero (n : ℕ) (R : Type*) [Ring R] [Nontrivial R] : cyclotomic n R ≠ 0

(n : ℕ)
(R : Type u_1)
[Ring R]
[Nontrivial R]


nonrec theorem HasDerivAt.const_sub (c : F) (hf : HasDerivAt f f' x) :
    HasDerivAt (fun x => c - f x) (-f') x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
(c : F)
(hf : HasDerivAt f f' x)


/-- If `s` is an order-connected set in an ordered module over an ordered semiring
and all elements of `s` are comparable with `x ∈ s`, then `s` is `StarConvex` at `x`. -/
theorem Set.OrdConnected.starConvex [OrderedSemiring 𝕜] [OrderedAddCommMonoid E] [Module 𝕜 E]
    [OrderedSMul 𝕜 E] {x : E} {s : Set E} (hs : s.OrdConnected) (hx : x ∈ s)
    (h : ∀ y ∈ s, x ≤ y ∨ y ≤ x) : StarConvex 𝕜 x s

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[OrderedAddCommMonoid E]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{x : E}
{s : Set E}
(hs : s.OrdConnected)
(hx : x ∈ s)
(h : ∀ y ∈ s, x ≤ y ∨ y ≤ x)


theorem toNNRat_lt_toNNRat_iff (h : 0 < p) : toNNRat q < toNNRat p ↔ q < p


theorem pi_mem_pi {I : Set ι} (hI : I.Finite) (h : ∀ i ∈ I, s i ∈ f i) : I.pi s ∈ pi f

{ι : Type u_1}
{α : ι → Type u_2}
{f : (i : ι) → Filter (α i)}
{s : (i : ι) → Set (α i)}
{I : Set ι}
(hI : I.Finite)
(h : ∀ i ∈ I, s i ∈ f i)


@[simp, norm_cast] lemma coe_diffs : (↑(s \\ t) : Set α) = Set.image2 (· \ ·) s t

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

↑(s.diffs t) = Set.image2 (fun x x_1 => x \ x_1) ↑s ↑t


@[simp]
theorem image.as_ι : (Image.monoFactorisation f).m = image.ι f

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

(CategoryTheory.Limits.Image.monoFactorisation f).m = CategoryTheory.Limits.image.ι f


@[to_additive]
theorem list_prod_apply {α : Type*} {β : α → Type*} [∀ a, Monoid (β a)] (a : α)
    (l : List (∀ a, β a)) : l.prod a = (l.map fun f : ∀ a, β a ↦ f a).prod

{α : Type u_1}
{β : α → Type u_2}
[(a : α) → Monoid (β a)]
(a : α)
(l : List ((a : α) → β a))

l.prod a = (List.map (fun f => f a) l).prod


{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderClosedTopology α]
{a b : α}


theorem MeasureTheory.Measure.map_mono_of_aemeasurable {f : α → δ} (h : μ ≤ ν)
    (hf : AEMeasurable f ν) : μ.map f ≤ ν.map f

{α : Type u_2}
{δ : Type u_5}
{m0 : MeasurableSpace α}
[MeasurableSpace δ]
{μ ν : MeasureTheory.Measure α}
{f : α → δ}
(h : μ ≤ ν)
(hf : AEMeasurable f ν)

MeasureTheory.Measure.map f μ ≤ MeasureTheory.Measure.map f ν


@[to_additive]
theorem symm_apply_eq (e : M ≃* N) {x y} : e.symm x = y ↔ x = e y

{M : Type u_6}
{N : Type u_7}
[Add M]
[Add N]
(e : M ≃+ N)
{x : N}
{y : M}


@[to_additive]
theorem Pi.commute_iff {x y : ∀ i, f i} : Commute x y ↔ ∀ i, Commute (x i) (y i)

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

Commute x y ↔ ∀ (i : I), Commute (x i) (y i)


@[simp]
protected theorem intCast (z : ℤ) : IsSelfAdjoint (z : R)

{R : Type u_1}
[Ring R]
[StarRing R]
(z : ℤ)


@[ext]
theorem ext {f g : InfHom α β} (h : ∀ a, f a = g a) : f = g

{α : Type u_3}
{β : Type u_4}
[Inf α]
[Inf β]
{f g : InfHom α β}
(h : ∀ (a : α), f a = g a)


theorem mem_prod_principal {s : Set (α × β)} :
    s ∈ f ×ˢ 𝓟 t ↔ { a | ∀ b ∈ t, (a, b) ∈ s } ∈ f

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

s ∈ f ×ˢ 𝓟 t ↔ {a | ∀ b ∈ t, (a, b) ∈ s} ∈ f


/-- The equivalence of categories `X ≌ Y` induced by `e : X ≃o Y`. -/
@[simps]
def OrderIso.equivalence (e : X ≃o Y) : X ≌ Y

{X : Type u}
{Y : Type v}
[Preorder X]
[Preorder Y]
(e : X ≃o Y)


theorem X_pow_dvd_iff {n : ℕ} {φ : R⟦X⟧} :
    (X : R⟦X⟧) ^ n ∣ φ ↔ ∀ m, m < n → coeff R m φ = 0

{R : Type u_1}
[Semiring R]
{n : ℕ}
{φ : PowerSeries R}

PowerSeries.X ^ n ∣ φ ↔ ∀ m < n, (PowerSeries.coeff R m) φ = 0


/-- A type with `0` and `Inv` such that `fun x ↦ x⁻¹` is continuous at all nonzero points. Any
normed (semi)field has this property. -/
class HasContinuousInv₀ (G₀ : Type*) [Zero G₀] [Inv G₀] [TopologicalSpace G₀] : Prop where
  /-- The map `fun x ↦ x⁻¹` is continuous at all nonzero points. -/
  continuousAt_inv₀ : ∀ ⦃x : G₀⦄, x ≠ 0 → ContinuousAt Inv.inv x

{G₀ : Type u_4}
[Zero G₀]
[Inv G₀]
[TopologicalSpace G₀]
[self : HasContinuousInv₀ G₀]
⦃x : G₀⦄


theorem iInter₂_vsub_subset (s : ∀ i, κ i → Set β) (t : Set β) :
    (⋂ (i) (j), s i j) -ᵥ t ⊆ ⋂ (i) (j), s i j -ᵥ t

{α : Type u_2}
{β : Type u_3}
{ι : Sort u_5}
{κ : ι → Sort u_6}
[VSub α β]
(s : (i : ι) → κ i → Set β)
(t : Set β)

(⋂ i, ⋂ j, s i j) -ᵥ t ⊆ ⋂ i, ⋂ j, s i j -ᵥ t


@[to_additive]
theorem measure_eq_tsum (h : IsFundamentalDomain G s μ) (t : Set α) :
    μ t = ∑' g : G, μ (g • t ∩ s)

[MeasureTheory.SMulInvariantMeasure G α μ]

(h : MeasureTheory.IsFundamentalDomain G s μ)


theorem tan_add' {x y : ℂ}
    (h : (∀ k : ℤ, x ≠ (2 * k + 1) * π / 2) ∧ ∀ l : ℤ, y ≠ (2 * l + 1) * π / 2) :
    tan (x + y) = (tan x + tan y) / (1 - tan x * tan y)

Complex.tan (x + y) = (Complex.tan x + Complex.tan y) / (1 - Complex.tan x * Complex.tan y)


theorem poly_eq_of_wittPolynomial_bind_eq' [Fact p.Prime] (f g : ℕ → MvPolynomial (idx × ℕ) ℤ)
    (h : ∀ n, bind₁ f (wittPolynomial p _ n) = bind₁ g (wittPolynomial p _ n)) : f = g

(h : ∀ (n : ℕ), (MvPolynomial.bind₁ f) (wittPolynomial p ℤ n) = (MvPolynomial.bind₁ g) (wittPolynomial p ℤ n))


theorem eq_of_comp_right_eq' (f g : Y ⟶ Z)
    (w : (fun {X} (h : X ⟶ Y) => h ≫ f) = fun {X} (h : X ⟶ Y) => h ≫ g) : f = g

(w : (fun {X} h => CategoryTheory.CategoryStruct.comp h f) = fun {X} h => CategoryTheory.CategoryStruct.comp h g)


/-- Suppose the sequence `stirlingSeq` (defined above) has the limit `a ≠ 0`.
Then the Wallis sequence `W n` has limit `a^2 / 2`.
-/
theorem second_wallis_limit (a : ℝ) (hane : a ≠ 0) (ha : Tendsto stirlingSeq atTop (𝓝 a)) :
    Tendsto Wallis.W atTop (𝓝 (a ^ 2 / 2))

(ha : Filter.Tendsto Stirling.stirlingSeq Filter.atTop (𝓝 a))

Filter.Tendsto Real.Wallis.W Filter.atTop (𝓝 (a ^ 2 / 2))


theorem sup_eq_iSup (x y : α) : x ⊔ y = ⨆ b : Bool, cond b x y

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


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

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


/-- Compatibility of `nullHomotopicMap` with the postcomposition by a morphism
of complexes. -/
theorem nullHomotopicMap_comp (hom : ∀ i j, C.X i ⟶ D.X j) (g : D ⟶ E) :
    nullHomotopicMap hom ≫ g = nullHomotopicMap fun i j => hom i j ≫ g.f j

{ι : Type u_1}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{c : ComplexShape ι}
{C D E : HomologicalComplex V c}
(hom : (i j : ι) → C.X i ⟶ D.X j)
(g : D ⟶ E)

Homotopy.nullHomotopicMap hom ≫ g = Homotopy.nullHomotopicMap fun i j => hom i j ≫ g.f j


@[simp]
theorem fderiv_cosh (hc : DifferentiableAt ℝ f x) :
    fderiv ℝ (fun x => Real.cosh (f x)) x = Real.sinh (f x) • fderiv ℝ f x

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


/-- A Cartan subalgebra is a nilpotent, self-normalizing subalgebra.

A _splitting_ Cartan subalgebra can be defined by mixing in `LieModule.IsTriangularizable R H L`. -/
class IsCartanSubalgebra : Prop where
  nilpotent : LieAlgebra.IsNilpotent R H
  self_normalizing : H.normalizer = H

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{H : LieSubalgebra R L}
[self : H.IsCartanSubalgebra]


lemma monotone_div_right_of_nonneg (ha : 0 ≤ a) : Monotone (· / a)

{α : Type u_2}
[LinearOrderedSemifield α]
{a : α}
(ha : 0 ≤ a)


@[deprecated (since := "2024-04-14")]
theorem coeFn_congr : ∀ {x x' y y' : M}, x = x' → y = y' → B x y = B x' y'

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{B : LinearMap.BilinForm R M}
{x x' y y' : M}


theorem mem_unique {s : Computation α} {a b : α} : a ∈ s → b ∈ s → a = b

{α : Type u}
{s : Computation α}
{a b : α}


@[simp]
theorem eval_comp_of (n : ℕ) : (eval I M n).comp (of I M) = mkQ _

{R : Type u_1}
[CommRing R]
(I : Ideal R)
(M : Type u_2)
[AddCommGroup M]
[Module R M]
(n : ℕ)

AdicCompletion.eval I M n ∘ₗ AdicCompletion.of I M = (I ^ n • ⊤).mkQ


theorem lift'_map_le {g : Set β → Set γ} {m : α → β} : (map m f).lift' g ≤ f.lift' (g ∘ image m)

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

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


@[simp]
theorem compl [Zero α] [One α] (h : IsAdjMatrix A) : IsAdjMatrix A.compl

{V : Type u_1}
{α : Type u_2}
[DecidableEq α]
[DecidableEq V]
{A : Matrix V V α}
[Zero α]
[One α]
(h : A.IsAdjMatrix)


@[simp]
theorem Iic_inter_Iic {a b : α} : Iic a ∩ Iic b = Iic (a ⊓ b)

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


/-- Vieta's formula for a quadratic equation, relating the coefficients of the polynomial with
  its roots. This particular version states that if we have a root `x` of a monic quadratic
  polynomial, then there is another root `y` such that `x + y` is negative the `a_1` coefficient
  and `x * y` is the `a_0` coefficient. -/
theorem vieta_formula_quadratic {b c x : α} (h : x * x - b * x + c = 0) :
    ∃ y : α, y * y - b * y + c = 0 ∧ x + y = b ∧ x * y = c

{α : Type u_2}
[NonUnitalCommRing α]
{b c x : α}
(h : x * x - b * x + c = 0)

∃ y, y * y - b * y + c = 0 ∧ x + y = b ∧ x * y = c


@[to_additive]
theorem le_self_mul : a ≤ a * c

{α : Type u}
[CanonicallyOrderedAddCommMonoid α]
{a c : α}


/-- Two strictly monotone functions from `Fin n` are equal provided that their ranges
are equal. -/
lemma strictMono_unique {f g : Fin n → α} (hf : StrictMono f) (hg : StrictMono g)
    (h : range f = range g) : f = g

{n : ℕ}
{α : Type u_1}
[Preorder α]
{f g : Fin n → α}
(hf : StrictMono f)
(hg : StrictMono g)
(h : Set.range f = Set.range g)


@[simp]
theorem toGL_one : toGL (1 : unitaryGroup n α) = 1

{n : Type u}
[DecidableEq n]
[Fintype n]
{α : Type v}
[CommRing α]
[StarRing α]


@[simp]
theorem continuousWithinAt_Icc_iff_Iic (h : a < b) :
    ContinuousWithinAt f (Icc a b) b ↔ ContinuousWithinAt f (Iic b) b

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIicTopology α]
[TopologicalSpace β]
{a b : α}
{f : α → β}
(h : a < b)

ContinuousWithinAt f (Set.Icc a b) b ↔ ContinuousWithinAt f (Set.Iic b) b


theorem pairwise_lt_range' : ∀ s n (step := 1) (_ : 0 < step := by simp),
  Pairwise (· < ·) (range' s n step)

autoParam (0 < step) _auto✝ → List.Pairwise (fun x x_1 => x < x_1) (List.range' s n step)


/-- Given a predicate on functions `∀ i, Finset (α i)` defined on a finite type, it is true on all
maps provided that it is true on `fun _ ↦ ∅` and for any function `g : ∀ i, Finset (α i)`, an index
`i : ι`, and an element`x : α i` that is strictly less than all elements of `g i`, `p g` implies
`p (update g i (insert x (g i)))`.

This lemma requires `LinearOrder` instances on all `α i`. See also `Finset.induction_on_pi` for a
version that `x ∉ g i` instead of ` does not need `∀ i, LinearOrder (α i)`. -/
theorem induction_on_pi_min [∀ i, LinearOrder (α i)] {p : (∀ i, Finset (α i)) → Prop}
    (f : ∀ i, Finset (α i)) (h0 : p fun _ ↦ ∅)
    (step :
      ∀ (g : ∀ i, Finset (α i)) (i : ι) (x : α i),
        (∀ y ∈ g i, x < y) → p g → p (update g i (insert x (g i)))) :
    p f

(step :
  ∀ (g : (i : ι) → Finset (α i)) (i : ι) (x : α i), (∀ y ∈ g i, x < y) → p g → p (Function.update g i (insert x (g i))))


@[to_additive]
theorem smul_set_symmDiff : a • s ∆ t = (a • s) ∆ (a • t)

{α : Type u_2}
{β : Type u_3}
[Group α]
[MulAction α β]
{s t : Set β}
{a : α}

a • symmDiff s t = symmDiff (a • s) (a • t)


/-- Interpreting as a base `p` number and dividing by `p^i` is the same as dropping `i`.
-/
lemma ofDigits_div_pow_eq_ofDigits_drop
    {p : ℕ} (i : ℕ) (hpos : 0 < p) (digits : List ℕ) (w₁ : ∀ l ∈ digits, l < p) :
    ofDigits p digits / p ^ i = ofDigits p (digits.drop i)

Nat.ofDigits p digits / p ^ i = Nat.ofDigits p (List.drop i digits)


/-- A multiplicative equivalence of groups preserves inversion. -/
@[to_additive "An additive equivalence of additive groups preserves negation."]
protected theorem map_inv [Group G] [DivisionMonoid H] (h : G ≃* H) (x : G) :
    h x⁻¹ = (h x)⁻¹

{G : Type u_10}
{H : Type u_11}
[Group G]
[DivisionMonoid H]
(h : G ≃* H)
(x : G)


theorem infs_union_right : s ⊼ (t₁ ∪ t₂) = s ⊼ t₁ ∪ s ⊼ t₂

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


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

{R : Type u_1}
[MulZeroClass R]
{a : R}
[Nontrivial R]
(la : IsLeftRegular a)


theorem cancel_left_of_respectsIso (P : MorphismProperty C) [hP : RespectsIso P] {X Y Z : C}
    (f : X ⟶ Y) (g : Y ⟶ Z) [IsIso f] : P (f ≫ g) ↔ P g

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(P : CategoryTheory.MorphismProperty C)
[hP : P.RespectsIso]
{X Y Z : C}
(f : X ⟶ Y)
(g : Y ⟶ Z)
[CategoryTheory.IsIso f]


theorem posDef_pi_iff {P} [Fintype ι] [OrderedAddCommMonoid P] [Module R P]
    {Q : ∀ i, QuadraticMap R (Mᵢ i) P} : (pi Q).PosDef ↔ ∀ i, (Q i).PosDef

{ι : Type u_1}
{R : Type u_2}
{Mᵢ : ι → Type u_8}
[CommSemiring R]
[(i : ι) → AddCommMonoid (Mᵢ i)]
[(i : ι) → Module R (Mᵢ i)]
{P : Type u_10}
[Fintype ι]
[OrderedAddCommMonoid P]
[Module R P]
{Q : (i : ι) → QuadraticMap R (Mᵢ i) P}

(QuadraticMap.pi Q).PosDef ↔ ∀ (i : ι), (Q i).PosDef


theorem smul_zero_subset (s : Finset α) : s • (0 : Finset β) ⊆ 0

{α : Type u_2}
{β : Type u_3}
[Zero β]
[SMulZeroClass α β]
[DecidableEq β]
(s : Finset α)


/-- Monoidal functors commute with right tensoring up to isomorphism -/
@[simps!]
noncomputable def commTensorRight (X : C) :
    F.toFunctor ⋙ tensorRight (F.toFunctor.obj X) ≅ tensorRight X ⋙ F.toFunctor

(F : CategoryTheory.MonoidalFunctor C D)

∀ (X_1 : C), (F.commTensorRight X).inv.app X_1 = (F.μIso X_1 X).inv


theorem linearIndependent_iff_card_le_finrank_span {ι : Type*} [Fintype ι] {b : ι → V} :
    LinearIndependent K b ↔ Fintype.card ι ≤ (Set.range b).finrank K

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
{ι : Type u_2}
[Fintype ι]
{b : ι → V}

LinearIndependent K b ↔ Fintype.card ι ≤ Set.finrank K (Set.range b)


@[simp]
theorem disjoint_prod : Disjoint (s₁ ×ˢ t₁) (s₂ ×ˢ t₂) ↔ Disjoint s₁ s₂ ∨ Disjoint t₁ t₂

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


/-- If a set of functions is equicontinuous at some `x₀`, the same is true for its closure in *any*
topology for which evaluation at any point is continuous. Since this will be applied to
`DFunLike` types, we state it for any topological space whith a map to `X → α` satisfying the right
continuity conditions. See also `Set.EquicontinuousAt.closure` for a more familiar statement. -/
theorem EquicontinuousAt.closure' {A : Set Y} {u : Y → X → α} {x₀ : X}
    (hA : EquicontinuousAt (u ∘ (↑) : A → X → α) x₀) (hu : Continuous u) :
    EquicontinuousAt (u ∘ (↑) : closure A → X → α) x₀

(hA : EquicontinuousAt (u ∘ Subtype.val) x₀)


lemma forall_update_iff (f : ∀a, β a) {a : α} {b : β a} (p : ∀a, β a → Prop) :
    (∀ x, p x (update f a b x)) ↔ p a b ∧ ∀ x, x ≠ a → p x (f x)

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

(∀ (x : α), p x (Function.update f a b x)) ↔ p a b ∧ ∀ (x : α), x ≠ a → p x (f x)


theorem HasBasis.forall_iff (hl : l.HasBasis p s) {P : Set α → Prop}
    (mono : ∀ ⦃s t⦄, s ⊆ t → P s → P t) : (∀ s ∈ l, P s) ↔ ∀ i, p i → P (s i)

(mono : ∀ ⦃s t : Set α⦄, s ⊆ t → P s → P t)

(∀ s ∈ l, P s) ↔ ∀ (i : ι), p i → P (s i)


theorem reindex_refl_refl (A : Matrix m n α) : reindex (Equiv.refl _) (Equiv.refl _) A = A

{m : Type u_2}
{n : Type u_3}
{α : Type v}
(A : Matrix m n α)

(Matrix.reindex (Equiv.refl m) (Equiv.refl n)) A = A


theorem range'_sublist_right {s m n : Nat} : range' s m step <+ range' s n step ↔ m ≤ n

List.range' s m step <+ List.range' s n step ↔ m ≤ n


theorem comp {Cg rg : ℝ≥0} {g : Y → Z} (hg : HolderWith Cg rg g) {Cf rf : ℝ≥0} {f : X → Y}
    (hf : HolderWith Cf rf f) : HolderWith (Cg * Cf ^ (rg : ℝ)) (rg * rf) (g ∘ f)

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[PseudoEMetricSpace X]
[PseudoEMetricSpace Y]
[PseudoEMetricSpace Z]
{Cg rg : ℝ≥0}
{g : Y → Z}
(hg : HolderWith Cg rg g)
{Cf rf : ℝ≥0}
{f : X → Y}
(hf : HolderWith Cf rf f)

HolderWith (Cg * Cf ^ ↑rg) (rg * rf) (g ∘ f)


theorem reverse_cons' (a : α) (l : List α) : reverse (a :: l) = concat (reverse l) a


@[simp]
theorem _root_.Submodule.range_valA (p : Subalgebra R A) :
    @AlgHom.range R p A _ _ _ _ _ p.valA = p

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


@[to_additive]
theorem NormedCommGroup.nhds_one_basis_norm_lt :
    (𝓝 (1 : E)).HasBasis (fun ε : ℝ => 0 < ε) fun ε => { y | ‖y‖ < ε }

(𝓝 1).HasBasis (fun ε => 0 < ε) fun ε => {y | ‖y‖ < ε}


lemma evalEval_C (x y : R) (p : R[X]) : (C p).evalEval x y = p.eval x

{R : Type u_1}
[Semiring R]
(x y : R)
(p : R[X])

Polynomial.evalEval x y (Polynomial.C p) = Polynomial.eval x p


@[to_additive leftAddCoset_eq_iff]
theorem leftCoset_eq_iff {x y : α} : x • (s : Set α) = y • s ↔ x⁻¹ * y ∈ s

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


theorem natAbs_pos : 0 < natAbs a ↔ a ≠ 0


theorem nnnorm_toL1 {f : α → β} (hf : Integrable f μ) :
    (‖hf.toL1 f‖₊ : ℝ≥0∞) = ∫⁻ a, ‖f a‖₊ ∂μ

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

↑‖MeasureTheory.Integrable.toL1 f hf‖₊ = ∫⁻ (a : α), ↑‖f a‖₊ ∂μ


theorem braiding_rightUnitor_aux₁ (X : C) :
    (α_ X (𝟙_ C) (𝟙_ C)).inv ≫
        ((β_ (𝟙_ C) X).inv ▷ 𝟙_ C) ≫ (α_ _ X _).hom ≫ (_ ◁ (ρ_ X).hom) =
      (X ◁ (ρ_ _).hom) ≫ (β_ (𝟙_ C) X).inv

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

(α_ X (𝟙_ C) (𝟙_ C)).inv ≫ (β_ (𝟙_ C) X).inv ▷ 𝟙_ C ≫ (α_ (𝟙_ C) X (𝟙_ C)).hom ≫ 𝟙_ C ◁ (ρ_ X).hom =
  X ◁ (ρ_ (𝟙_ C)).hom ≫ (β_ (𝟙_ C) X).inv


@[simp]
theorem inter_apply {R S : Sieve X} {Y} (f : Y ⟶ X) : (R ⊓ S) f ↔ R f ∧ S f

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

(R ⊓ S).arrows f ↔ R.arrows f ∧ S.arrows f


@[simp]
protected theorem coe_coe {F : Type*} [FunLike F A B] [BialgHomClass F R A B] (f : F) :
    ⇑(f : A →ₐc[R] B) = f

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
{F : Type u_6}
[FunLike F A B]
[BialgHomClass F R A B]
(f : F)


@[norm_cast]
theorem coe_inv (r : R) : ↑r⁻¹ = ((↑r)⁻¹ : A)

{R : Type u_1}
(A : Type u_2)
[Semifield R]
[DivisionSemiring A]
[Algebra R A]
(r : R)

↑r⁻¹ = (↑r)⁻¹


theorem map_sup : (I ⊔ J).map f = I.map f ⊔ J.map f

{R : Type u}
{S : Type v}
{F : Type u_1}
[Semiring R]
[Semiring S]
[FunLike F R S]
[rc : RingHomClass F R S]
(f : F)
(I J : Ideal R)

Ideal.map f (I ⊔ J) = Ideal.map f I ⊔ Ideal.map f J


/-- A hamiltonian cycle is a cycle that visits every vertex once. -/
structure IsHamiltonianCycle (p : G.Walk a a) extends p.IsCycle : Prop :=
  isHamiltonian_tail : (p.tail toIsCycle.not_nil).IsHamiltonian

{α : Type u_1}
[DecidableEq α]
{G : SimpleGraph α}
{a : α}
{p : G.Walk a a}
(self : p.IsHamiltonianCycle)


theorem div_le_div_right (hc : 0 < c) : a / c ≤ b / c ↔ a ≤ b

{α : Type u_2}
[LinearOrderedSemifield α]
{a b c : α}
(hc : 0 < c)


theorem eval_at_0 (n ν : ℕ) : (bernsteinPolynomial R n ν).eval 0 = if ν = 0 then 1 else 0

Polynomial.eval 0 (bernsteinPolynomial R n ν) = if ν = 0 then 1 else 0


/-- Uses `left` co(ntra)variant. -/
@[to_additive (attr := simp) "Uses `left` co(ntra)variant."]
theorem Left.inv_le_one_iff : a⁻¹ ≤ 1 ↔ 1 ≤ a

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


theorem span_singleton_ne_top {α : Type*} [CommSemiring α] {x : α} (hx : ¬IsUnit x) :
    Ideal.span ({x} : Set α) ≠ ⊤

{α : Type u_1}
[CommSemiring α]
{x : α}
(hx : ¬IsUnit x)


private lemma pairwise_coprime_coprimes (a : Fin m → ℕ) : Pairwise (Coprime on coprimes a)

Pairwise (Nat.Coprime on Nat.coprimes a)


theorem vanishingIdeal_strict_anti_mono_iff {s t : Set (PrimeSpectrum R)} (hs : IsClosed s)
    (ht : IsClosed t) : s ⊂ t ↔ vanishingIdeal t < vanishingIdeal s

{R : Type u}
[CommSemiring R]
{s t : Set (PrimeSpectrum R)}
(hs : IsClosed s)
(ht : IsClosed t)

s ⊂ t ↔ PrimeSpectrum.vanishingIdeal t < PrimeSpectrum.vanishingIdeal s


@[continuity]
theorem continuous_coe : Continuous (mk : α → ConnectedComponents α)


@[ext]
protected theorem ext {f g : Filtration ι m} (h : (f : ι → MeasurableSpace Ω) = g) : f = g

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[Preorder ι]
{f g : MeasureTheory.Filtration ι m}
(h : ↑f = ↑g)


theorem unitCompPartialBijective_symm_natural [Reflective i] (A : C) {B B' : C} (h : B ⟶ B')
    (hB : B ∈ i.essImage) (hB' : B' ∈ i.essImage) (f : i.obj ((reflector i).obj A) ⟶ B) :
    (unitCompPartialBijective A hB').symm (f ≫ h) = (unitCompPartialBijective A hB).symm f ≫ h

(f : i.obj ((CategoryTheory.reflector i).obj A) ⟶ B)

(CategoryTheory.unitCompPartialBijective A hB').symm (CategoryTheory.CategoryStruct.comp f h) =
  CategoryTheory.CategoryStruct.comp ((CategoryTheory.unitCompPartialBijective A hB).symm f) h


theorem comp_left {a b c : C} (f : a ⟶ b) :
    ∀ (g₁ g₂ : b ⟶ c) (_ : CompClosure r g₁ g₂), CompClosure r (f ≫ g₁) (f ≫ g₂)

{C : Type u_2}
[CategoryTheory.Category.{u_1, u_2} C]
(r : HomRel C)
{a b c : C}
(f : a ⟶ b)
(g₁ g₂ : b ⟶ c)

CategoryTheory.Quotient.CompClosure r g₁ g₂ →
  CategoryTheory.Quotient.CompClosure r (CategoryTheory.CategoryStruct.comp f g₁)
    (CategoryTheory.CategoryStruct.comp f g₂)


theorem range_eq_map (f : M →[L] N) : f.range = map f ⊤

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

f.range = FirstOrder.Language.Substructure.map f ⊤


@[to_additive (attr := simp, to_additive) (reorder := 1 2, 4 5) toDual_smul']
theorem pow_toDual [Pow α β] (a : α) (b : β) : a ^ toDual b = a ^ b

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


theorem OrderEmbedding.image_Iio (e : α ↪o β) (he : IsLowerSet (range e)) (a : α) :
    e '' Iio a = Iio (e a)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(e : α ↪o β)
(he : IsLowerSet (Set.range ⇑e))
(a : α)


@[to_additive]
theorem eq_bot_of_subsingleton [Subsingleton H] : H = ⊥

{G : Type u_1}
[AddGroup G]
(H : AddSubgroup G)
[Subsingleton ↥H]


@[simp]
theorem map_functor_eq {X : TopCat} {U : Opens X} (V : Opens U) :
    ((Opens.map U.inclusion).obj <| U.openEmbedding.isOpenMap.functor.obj V) = V

{X : TopCat}
{U : TopologicalSpace.Opens ↑X}
(V : TopologicalSpace.Opens ↥U)

(TopologicalSpace.Opens.map U.inclusion).obj (⋯.functor.obj V) = V


@[simp]
theorem trace_sum (s : Finset ι) (f : ι → Matrix n n R) :
    trace (∑ i ∈ s, f i) = ∑ i ∈ s, trace (f i)

{ι : Type u_1}
{n : Type u_3}
{R : Type u_6}
[Fintype n]
[AddCommMonoid R]
(s : Finset ι)
(f : ι → Matrix n n R)

(∑ i ∈ s, f i).trace = ∑ i ∈ s, (f i).trace


@[simp]
theorem image_univ {f : α → β} : f '' univ = range f

{α : Type u_1}
{β : Type u_2}
{f : α → β}


/-- The finite product of a family of sets of unique differentiability is a set of unique
differentiability. -/
theorem UniqueDiffOn.pi (ι : Type*) [Finite ι] (E : ι → Type*) [∀ i, NormedAddCommGroup (E i)]
    [∀ i, NormedSpace 𝕜 (E i)] (s : ∀ i, Set (E i)) (I : Set ι)
    (h : ∀ i ∈ I, UniqueDiffOn 𝕜 (s i)) : UniqueDiffOn 𝕜 (Set.pi I s)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
(ι : Type u_5)
[Finite ι]
(E : ι → Type u_6)
[(i : ι) → NormedAddCommGroup (E i)]
[(i : ι) → NormedSpace 𝕜 (E i)]
(s : (i : ι) → Set (E i))
(I : Set ι)
(h : ∀ i ∈ I, UniqueDiffOn 𝕜 (s i))


theorem Function.LeftInverse.eq_rec_eq {γ : β → Sort v} {f : α → β} {g : β → α}
    (h : Function.LeftInverse g f) (C : ∀ a : α, γ (f a)) (a : α) :
    -- TODO: mathlib3 uses `(congr_arg f (h a)).rec (C (g (f a)))` for LHS
    @Eq.rec β (f (g (f a))) (fun x _ ↦ γ x) (C (g (f a))) (f a) (congr_arg f (h a)) = C a

{α : Sort u_1}
{β : Sort u_2}
{γ : β → Sort v}
{f : α → β}
{g : β → α}
(h : Function.LeftInverse g f)
(C : (a : α) → γ (f a))
(a : α)


theorem iInf_prod {f : β × γ → α} : ⨅ x, f x = ⨅ (i) (j), f (i, j)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_4}
[CompleteLattice α]
{f : β × γ → α}


@[simp]
theorem basicOpen_fromSpec_app :
    (Spec Γ(X, U)).basicOpen (hU.fromSpec.app U f) = PrimeSpectrum.basicOpen f

{X : AlgebraicGeometry.Scheme}
{U : X.Opens}
(hU : AlgebraicGeometry.IsAffineOpen U)
(f : ↑(X.presheaf.obj (Opposite.op U)))

(AlgebraicGeometry.Spec (X.presheaf.obj (Opposite.op U))).basicOpen
    ((AlgebraicGeometry.Scheme.Hom.app hU.fromSpec U) f) =
  PrimeSpectrum.basicOpen f


theorem mem_of_mem_filter {a : α} {l} (h : a ∈ filter p l) : a ∈ l

{α : Type u}
{p : α → Bool}
{a : α}
{l : List α}
(h : a ∈ List.filter p l)


@[simp]
lemma d_mul (b b' : B) : D.d (b * b') = b • D.d b' + b' • D.d b

{A B : CommRingCat}
{M : ModuleCat ↑B}
{f : A ⟶ B}
(D : M.Derivation f)
(b b' : ↑B)


theorem foldr_fixed' {f : α → β → β} {b : β} (hf : ∀ a, f a b = b) : ∀ l : List α, foldr f b l = b

{α : Type u}
{β : Type v}
{f : α → β → β}
{b : β}
(hf : ∀ (a : α), f a b = b)
(l : List α)


theorem iSup_iInf_of_antitone {ι ι' α : Type*} [Finite ι] [Preorder ι'] [Nonempty ι']
    [IsDirected ι' (swap (· ≤ ·))] [Order.Frame α] {f : ι → ι' → α} (hf : ∀ i, Antitone (f i)) :
    ⨆ j, ⨅ i, f i j = ⨅ i, ⨆ j, f i j

[IsDirected ι' (Function.swap fun x x_1 => x ≤ x_1)]

{f : ι → ι' → α}


lemma ker_def (f : Filter α) : f.ker = ⋂ s ∈ f, s


/-- Function between 1-morphisms as a functor. -/
@[simps]
def mapFunctor (a b : B) : (a ⟶ b) ⥤ (F.obj a ⟶ F.obj b)

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F : CategoryTheory.PrelaxFunctor B C)
(a b : B)
(f : a ⟶ b)


/-- Reflection in the `Submodule.map` of a subspace. -/
theorem reflection_map {E E' : Type*} [NormedAddCommGroup E] [NormedAddCommGroup E']
    [InnerProductSpace 𝕜 E] [InnerProductSpace 𝕜 E'] (f : E ≃ₗᵢ[𝕜] E') (K : Submodule 𝕜 E)
    [HasOrthogonalProjection K] :
    reflection (K.map (f.toLinearEquiv : E →ₗ[𝕜] E')) = f.symm.trans ((reflection K).trans f)

{𝕜 : Type u_1}
[RCLike 𝕜]
{E : Type u_4}
{E' : Type u_5}
[NormedAddCommGroup E]
[NormedAddCommGroup E']
[InnerProductSpace 𝕜 E]
[InnerProductSpace 𝕜 E']
(f : E ≃ₗᵢ[𝕜] E')
(K : Submodule 𝕜 E)
[HasOrthogonalProjection K]

reflection (Submodule.map (↑f.toLinearEquiv) K) = f.symm.trans ((reflection K).trans f)


theorem isClosed_Icc {a b : α} : IsClosed (Icc a b)

{α : Type u}
[TopologicalSpace α]
[Preorder α]
[t : OrderClosedTopology α]
{a b : α}


@[simp]
theorem codeSupp_tail (k) : codeSupp Code.tail k = trStmts₁ (trNormal Code.tail k) ∪ contSupp k

Turing.PartrecToTM2.codeSupp Turing.ToPartrec.Code.tail k =
  Turing.PartrecToTM2.trStmts₁ (Turing.PartrecToTM2.trNormal Turing.ToPartrec.Code.tail k) ∪
    Turing.PartrecToTM2.contSupp k


@[simp]
theorem QuotientAddGroup.equivIocMod_zero (a : α) :
    QuotientAddGroup.equivIocMod hp a 0 = ⟨toIocMod hp a 0, toIocMod_mem_Ioc hp a _⟩

{α : Type u_1}
[LinearOrderedAddCommGroup α]
[hα : Archimedean α]
{p : α}
(hp : 0 < p)
(a : α)

(QuotientAddGroup.equivIocMod hp a) 0 = ⟨toIocMod hp a 0, ⋯⟩


lemma not_mem_neighborSet_self : a ∉ G.neighborSet a

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


@[simp]
theorem ofDual_sInf (s : Set αᵒᵈ) : ofDual (sInf s) = sSup (toDual ⁻¹' s)

{α : Type u_1}
[CompleteLattice α]
(s : Set αᵒᵈ)

OrderDual.ofDual (sInf s) = sSup (⇑OrderDual.toDual ⁻¹' s)


@[simp]
theorem equivMapDomain_apply (f : α ≃ β) (l : α →₀ M) (b : β) :
    equivMapDomain f l b = l (f.symm b)

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

(Finsupp.equivMapDomain f l) b = l (f.symm b)


@[to_additive]
theorem prod_nsmul (m : Multiset α) : ∀ n : ℕ, (n • m).prod = m.prod ^ n

{α : Type u_3}
[CommMonoid α]
(m : Multiset α)
(n : ℕ)


/-- The product of a list of elements of a submonoid is an element of the submonoid. -/
@[to_additive
      "The sum of a list of elements of an `AddSubmonoid` is an element of the `AddSubmonoid`."]
theorem list_prod_mem (hs : IsSubmonoid s) : ∀ {l : List M}, (∀ x ∈ l, x ∈ s) → l.prod ∈ s

{M : Type u_1}
[AddMonoid M]
{s : Set M}
(hs : IsAddSubmonoid s)
{l : List M}


@[simp] theorem simple_mul_simple_pow' (i i' : B) : (s i' * s i) ^ M i i' = 1

{B : Type u_1}
{W : Type u_3}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
(i i' : B)

(cs.simple i' * cs.simple i) ^ M.M i i' = 1


protected theorem add_lt_add_right [CovariantClass α α (swap (· + ·)) (· < ·)] (ha : a ≠ ⊥)
    (h : b < c) : b + a < c + a

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


@[simp]
theorem irrational_sub_rat_iff : Irrational (x - q) ↔ Irrational x


theorem derivWithin_zero_of_isolated (h : 𝓝[s \ {x}] x = ⊥) : derivWithin f s x = 0

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{x : 𝕜}
{s : Set 𝕜}
(h : 𝓝[s \ {x}] x = ⊥)


@[to_additive]
theorem smul_closure_orbit_subset (c : M) (x : α) :
    c • closure (MulAction.orbit M x) ⊆ closure (MulAction.orbit M x)

{M : Type u_1}
{α : Type u_2}
[TopologicalSpace α]
[Monoid M]
[MulAction M α]
[ContinuousConstSMul M α]
(c : M)
(x : α)


theorem ite_ne_right_iff : ite P a b ≠ b ↔ P ∧ a ≠ b

{α : Sort u_1}
{P : Prop}
[Decidable P]
{a b : α}


theorem dist_center_eq_dist_center_of_mem_sphere {p₁ p₂ : P} {s : Sphere P} (hp₁ : p₁ ∈ s)
    (hp₂ : p₂ ∈ s) : dist p₁ s.center = dist p₂ s.center

{P : Type u_2}
[MetricSpace P]
{p₁ p₂ : P}
{s : EuclideanGeometry.Sphere P}
(hp₁ : p₁ ∈ s)
(hp₂ : p₂ ∈ s)


/-- **Strict inequality case of the Rearrangement Inequality**: Pointwise scalar multiplication of
`f` and `g`, which antivary together, is strictly decreased by a permutation if and only if
`f` and `g ∘ σ` do not antivary together. Stated by permuting the entries of `g`. -/
theorem AntivaryOn.sum_smul_lt_sum_smul_comp_perm_iff (hfg : AntivaryOn f g s)
    (hσ : {x | σ x ≠ x} ⊆ s) :
    ∑ i ∈ s, f i • g i < ∑ i ∈ s, f i • g (σ i) ↔ ¬AntivaryOn f (g ∘ σ) s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedRing α]
[LinearOrderedAddCommGroup β]
[Module α β]
[OrderedSMul α β]
{s : Finset ι}
{σ : Equiv.Perm ι}
{f : ι → α}
{g : ι → β}
(hfg : AntivaryOn f g ↑s)
(hσ : {x | σ x ≠ x} ⊆ ↑s)

∑ i ∈ s, f i • g i < ∑ i ∈ s, f i • g (σ i) ↔ ¬AntivaryOn f (g ∘ ⇑σ) ↑s


theorem Filter.Eventually.prod_inr_nhds {p : Y → Prop} {y : Y} (h : ∀ᶠ x in 𝓝 y, p x) (x : X) :
    ∀ᶠ x in 𝓝 (x, y), p (x : X × Y).2

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{p : Y → Prop}
{y : Y}
(h : ∀ᶠ (x : Y) in 𝓝 y, p x)
(x : X)


/--
In a semisimple Lie algebra,
Lie ideals that are contained in the supremum of a finite collection of atoms
are themselves the supremum of a finite subcollection of those atoms.

By a compactness argument, this statement can be extended to arbitrary sets of atoms.
See `atomistic`.

The proof is by induction on the finite set of atoms.
-/
private
lemma finitelyAtomistic : ∀ s : Finset (LieIdeal R L), ↑s ⊆ {I : LieIdeal R L | IsAtom I} →
    ∀ I : LieIdeal R L, I ≤ s.sup id → ∃ t ⊆ s, I = t.sup id

{R : Type u_1}
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsSemisimple R L]
(s : Finset (LieIdeal R L))

↑s ⊆ {I | IsAtom I} → ∀ I ≤ s.sup id, ∃ t ⊆ s, I = t.sup id


@[reassoc (attr := simp)]
theorem HasLimit.isoOfNatIso_inv_π {F G : J ⥤ C} [HasLimit F] [HasLimit G] (w : F ≅ G) (j : J) :
    (HasLimit.isoOfNatIso w).inv ≫ limit.π F j = limit.π G j ≫ w.inv.app j

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{F G : J ⥤ C}
[CategoryTheory.Limits.HasLimit F]
[CategoryTheory.Limits.HasLimit G]
(w : F ≅ G)
(j : J)

(CategoryTheory.Limits.HasLimit.isoOfNatIso w).inv ≫ CategoryTheory.Limits.limit.π F j =
  CategoryTheory.Limits.limit.π G j ≫ w.inv.app j


@[simp] lemma castLE_castSucc {n m} (i : Fin n) (h : n + 1 ≤ m) :
    i.castSucc.castLE h = i.castLE (Nat.le_of_succ_le h)

Fin.castLE h i.castSucc = Fin.castLE ⋯ i


theorem eq_of_xn_modEq_le {i j n} (ij : i ≤ j) (j2n : j ≤ 2 * n)
    (h : xn a1 i ≡ xn a1 j [MOD xn a1 n])
    (ntriv : ¬(a = 2 ∧ n = 1 ∧ i = 0 ∧ j = 2)) : i = j

(h : Pell.xn a1 i ≡ Pell.xn a1 j [MOD Pell.xn a1 n])


theorem mem_ball' : y ∈ ball x ε ↔ edist x y < ε

{α : Type u}
[PseudoEMetricSpace α]
{x y : α}
{ε : ℝ≥0∞}


lemma supClosed_pi {ι : Type*} {α : ι → Type*} [∀ i, SemilatticeSup (α i)] {s : Set ι}
    {t : ∀ i, Set (α i)} (ht : ∀ i ∈ s, SupClosed (t i)) : SupClosed (s.pi t)

{ι : Type u_5}
{α : ι → Type u_6}
[(i : ι) → SemilatticeSup (α i)]
{s : Set ι}
{t : (i : ι) → Set (α i)}
(ht : ∀ i ∈ s, SupClosed (t i))


theorem isPiSystem_Ici_rat : IsPiSystem (⋃ a : ℚ, {Ici (a : ℝ)})


lemma isIntegralCurveAt_comp_mul_ne_zero {a : ℝ} (ha : a ≠ 0) :
    IsIntegralCurveAt γ v t₀ ↔ IsIntegralCurveAt (γ ∘ (· * a)) (a • v) (t₀ / a)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type u_2}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type u_3}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{γ : ℝ → M}
{v : (x : M) → TangentSpace I x}
{t₀ a : ℝ}
(ha : a ≠ 0)

IsIntegralCurveAt γ v t₀ ↔ IsIntegralCurveAt (γ ∘ fun x => x * a) (a • v) (t₀ / a)


@[refl]
theorem BlankExtends.refl {Γ} [Inhabited Γ] (l : List Γ) : BlankExtends l l

{Γ : Type u_1}
[Inhabited Γ]
(l : List Γ)


@[simp]
theorem divp_mul_cancel (a : α) (u : αˣ) : a /ₚ u * u = a

{α : Type u}
[Monoid α]
(a : α)
(u : αˣ)


@[simp]
theorem isoToPlus_inv (hP : Presheaf.IsSheaf J P) :
    (J.isoToPlus P hP).inv = J.plusLift (𝟙 _) hP

(J : CategoryTheory.GrothendieckTopology C)

[CategoryTheory.Category.{max v u, w} D]

[∀ (P : CategoryTheory.Functor Cᵒᵖ D) (X : C) (S : J.Cover X), CategoryTheory.Limits.HasMultiequalizer (S.index P)]

[∀ (X : C), CategoryTheory.Limits.HasColimitsOfShape (J.Cover X)ᵒᵖ D]

(hP : CategoryTheory.Presheaf.IsSheaf J P)

(J.isoToPlus P hP).inv = J.plusLift (CategoryTheory.CategoryStruct.id P) hP


@[mono] lemma coe_mono : Monotone ((↑) : ℝ≥0 → ℝ)


@[simp]
lemma LSeries_sub {f g : ℕ → ℂ} {s : ℂ} (hf : LSeriesSummable f s) (hg : LSeriesSummable g s) :
    LSeries (f - g) s = LSeries f s - LSeries g s


lemma image_insert_memberSubfamily (𝒜 : Finset (Finset α)) (a : α) :
    (𝒜.memberSubfamily a).image (insert a) = 𝒜.filter (a ∈ ·)

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

Finset.image (insert a) (Finset.memberSubfamily a 𝒜) = Finset.filter (fun x => a ∈ x) 𝒜


/-- An additive group `G` is finitely generated if and only if `R[G]` is of
finite type. -/
theorem finiteType_iff_group_fg {G : Type*} [AddCommGroup G] [CommRing R] [Nontrivial R] :
    FiniteType R R[G] ↔ AddGroup.FG G

{R : Type u_1}
{G : Type u_3}
[AddCommGroup G]
[CommRing R]
[Nontrivial R]

Algebra.FiniteType R (AddMonoidAlgebra R G) ↔ AddGroup.FG G


@[to_additive]
theorem finprod_curry (f : α × β → M) (hf : (mulSupport f).Finite) :
    ∏ᶠ ab, f ab = ∏ᶠ (a) (b), f (a, b)

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[AddCommMonoid M]
(f : α × β → M)
(hf : (Function.support f).Finite)

∑ᶠ (ab : α × β), f ab = ∑ᶠ (a : α) (b : β), f (a, b)


theorem pow_rpow_inv_natCast (hx : 0 ≤ x) (hn : n ≠ 0) : (x ^ n) ^ (n⁻¹ : ℝ) = x


theorem truncate_approx (x : M F) (n : ℕ) : truncate (x.approx <| n + 1) = x.approx n

PFunctor.Approx.truncate (x.approx (n + 1)) = x.approx n


theorem eq_empty_of_sym_eq_empty (h : s.sym n = ∅) : s = ∅

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
{n : ℕ}
(h : s.sym n = ∅)


lemma residue_comp_residueFieldMap_eq_stalkMap_comp_residue (x : X) :
    LocalRing.residue _ ≫ residueFieldMap f x = f.stalkMap x ≫ LocalRing.residue _

{X Y : AlgebraicGeometry.LocallyRingedSpace}

LocalRing.residue ↑(Y.presheaf.stalk (f.val.base x)) ≫ AlgebraicGeometry.LocallyRingedSpace.residueFieldMap f x =
  AlgebraicGeometry.LocallyRingedSpace.Hom.stalkMap f x ≫ LocalRing.residue ↑(X.presheaf.stalk x)


theorem map_updateColumn [DecidableEq n] (f : α → β) :
    map (updateColumn M j c) f = updateColumn (M.map f) j (f ∘ c)

{m : Type u_2}
{n : Type u_3}
{α : Type v}
{β : Type w}
{M : Matrix m n α}
{j : n}
{c : m → α}
[DecidableEq n]
(f : α → β)

(M.updateColumn j c).map f = (M.map f).updateColumn j (f ∘ c)


theorem splits_of_splits_mul {f g : K[X]} (hfg : f * g ≠ 0) (h : Splits i (f * g)) :
    Splits i f ∧ Splits i g

{K : Type v}
{L : Type w}
[Field K]
[Field L]
(i : K →+* L)
{f g : K[X]}
(hfg : f * g ≠ 0)
(h : Polynomial.Splits i (f * g))

Polynomial.Splits i f ∧ Polynomial.Splits i g


@[to_additive]
theorem smoothWithinAt_one [One M'] : SmoothWithinAt I I' (1 : M → M') s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{s : Set M}
{x : M}
[Zero M']


theorem bit_ne_zero_iff {n : ℕ} {b : Bool} : n.bit b ≠ 0 ↔ n = 0 → b = true


@[simp] theorem castSucc_zero : castSucc (0 : Fin (n + 1)) = 0


@[simp, norm_cast]
theorem const_bot [Bot β] : (↑(⊥ : β) : Germ l β) = ⊥

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
[Bot β]


/-- `IsCyclotomicExtension S A B` is equivalent to `IsCyclotomicExtension (S ∪ {1}) A B`. -/
theorem iff_union_singleton_one :
    IsCyclotomicExtension S A B ↔ IsCyclotomicExtension (S ∪ {1}) A B

(S : Set ℕ+)
(A : Type u)
(B : Type v)
[CommRing A]
[CommRing B]
[Algebra A B]


theorem neg_mul {R} [Ring R] (a₁ : R) (a₂) {a₃ b : R}
    (_ : -a₃ = b) : -(a₁ ^ a₂ * a₃) = a₁ ^ a₂ * b

{R : Type u_2}
[Ring R]
(a₁ : R)
(a₂ : ℕ)
{a₃ b : R}


theorem iUnion_sigma' {γ : α → Type*} (s : ∀ i, γ i → Set β) :
    ⋃ i, ⋃ a, s i a = ⋃ ia : Sigma γ, s ia.1 ia.2

{α : Type u_1}
{β : Type u_2}
{γ : α → Type u_11}
(s : (i : α) → γ i → Set β)


theorem isGLB_csInf (ne : s.Nonempty) (H : BddBelow s) : IsGLB s (sInf s)

{α : Type u_1}
[ConditionallyCompleteLattice α]
{s : Set α}
(ne : s.Nonempty)
(H : BddBelow s)


theorem factors_prod_eq_basis_of_ne {x y : (π C (· ∈ s))} (h : y ≠ x) :
    (factors C s x).prod y = 0

{x y : ↑(Profinite.NobelingProof.π C fun x => x ∈ s)}

(Profinite.NobelingProof.factors C s x).prod y = 0


theorem mdifferentiableOn_symm : MDifferentiableOn 𝓘(𝕜, E) I I.symm (range I)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)

MDifferentiableOn 𝓘(𝕜, E) I (↑I.symm) (Set.range ↑I)


theorem abs_moebius_eq_one_of_squarefree {l : ℕ} (hl : Squarefree l) : |μ l| = 1


@[simp]
theorem id_zero : 𝟙 (0 : C) = (0 : (0 : C) ⟶ 0)


/-- Additive coercion from `ModularForm` to `ℍ → ℂ`. -/
@[simps]
def coeHom : ModularForm Γ k →+ ℍ → ℂ

{Γ : Subgroup SL(2, ℤ)}
{k : ℤ}
(f : ModularForm Γ k)
(a : ℍ)


@[simp]
theorem liftSupQuotQuotMkₐ_toRingHom :
    (liftSupQuotQuotMkₐ R I J : _ →+* _ ⧸ J.map (Quotient.mkₐ R I)) = liftSupQuotQuotMk I J

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

↑(DoubleQuot.liftSupQuotQuotMkₐ R I J) = DoubleQuot.liftSupQuotQuotMk I J


theorem Subalgebra.rank_top : Module.rank F (⊤ : Subalgebra F E) = Module.rank F E

{F : Type u_2}
{E : Type u_3}
[CommRing F]
[Ring E]
[Algebra F E]


/-- Isometry between the tangent space `V` of a (semi)normed add torsor `P` and `P` given by
addition/subtraction of `x : P`. -/
@[simps!]
def IsometryEquiv.vaddConst (x : P) : V ≃ᵢ P

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
(x : P)
(v : V)


/-- Sometimes, a group is defined as a quotient of a monoid by a congruence relation.
Usually, the inverse operation is defined as `Setoid.map f _` for some `f`.
This lemma allows to avoid code duplication in the definition of the inverse operation:
instead of proving both `∀ x y, c x y → c (f x) (f y)` (to define the operation)
and `∀ x, c (f x * x) 1` (to prove the group laws), one can only prove the latter. -/
@[to_additive "Sometimes, an additive group is defined as a quotient of a monoid
  by an additive congruence relation.
  Usually, the inverse operation is defined as `Setoid.map f _` for some `f`.
  This lemma allows to avoid code duplication in the definition of the inverse operation:
  instead of proving both `∀ x y, c x y → c (f x) (f y)` (to define the operation)
  and `∀ x, c (f x + x) 0` (to prove the group laws), one can only prove the latter."]
theorem map_of_mul_left_rel_one [Monoid M] (c : Con M)
    (f : M → M) (hf : ∀ x, c (f x * x) 1) {x y} (h : c x y) : c (f x) (f y)

{M : Type u_1}
[AddMonoid M]
(c : AddCon M)
(f : M → M)
(hf : ∀ (x : M), c (f x + x) 0)
{x y : M}
(h : c x y)


@[measurability]
theorem measurable_ofReal : Measurable ((↑) : ℝ → ℂ)


@[to_additive (attr := simp)]
theorem smul_inl : a • (inl b : α ⊕ β) = inl (a • b)

{M : Type u_1}
{α : Type u_4}
{β : Type u_5}
[VAdd M α]
[VAdd M β]
(a : M)
(b : α)


/-- Let `M` be a σ-compact Hausdorff finite dimensional topological manifold. Let `t : M → Set F`
be a family of convex sets. Suppose that for each point `x : M` there exists a neighborhood
`U ∈ 𝓝 x` and a function `g : M → F` such that `g` is smooth on `U` and `g y ∈ t y` for all `y ∈ U`.
Then there exists a smooth function `g : C^∞⟮I, M; 𝓘(ℝ, F), F⟯` such that `g x ∈ t x` for all `x`.
See also `exists_contMDiffOn_forall_mem_convex_of_local` and
`exists_smooth_forall_mem_convex_of_local_const`. -/
theorem exists_smooth_forall_mem_convex_of_local (ht : ∀ x, Convex ℝ (t x))
    (Hloc : ∀ x : M, ∃ U ∈ 𝓝 x, ∃ g : M → F, SmoothOn I 𝓘(ℝ, F) g U ∧ ∀ y ∈ U, g y ∈ t y) :
    ∃ g : C^∞⟮I, M; 𝓘(ℝ, F), F⟯, ∀ x, g x ∈ t x

(Hloc : ∀ (x : M), ∃ U ∈ 𝓝 x, ∃ g, SmoothOn I 𝓘(ℝ, F) g U ∧ ∀ y ∈ U, g y ∈ t y)


@[to_additive (attr := simp)]
theorem coe_smul [SMul R Y] (r : R) (f : LocallyConstant X Y) : ⇑(r • f) = r • (f : X → Y)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
{R : Type u_4}
[VAdd R Y]
(r : R)
(f : LocallyConstant X Y)


private theorem deriv_norm_pos : 0 < ‖F.derivative.eval a‖

(hnorm : ‖Polynomial.eval a F‖ < ‖Polynomial.eval a (Polynomial.derivative F)‖ ^ 2)

0 < ‖Polynomial.eval a (Polynomial.derivative F)‖


@[simp] lemma of_WithLower_symm_eq : (@ofLower α).symm = toLower


@[simp]
lemma ringEquivOfPrime_eq_ringEquiv [Fintype R] {p : ℕ} [CharP R p] (hp : p.Prime)
    (hR : Fintype.card R = p) : ringEquivOfPrime R hp hR = ringEquiv R hR

(R : Type u_1)
[Ring R]
[Fintype R]
{p : ℕ}
[CharP R p]
(hp : Nat.Prime p)
(hR : Fintype.card R = p)

ZMod.ringEquivOfPrime R hp hR = ZMod.ringEquiv R hR


/-- A linear injection `M ↪ N` restricts to an equivalence `f⁻¹ p ≃ p` for any submodule `p`
contained in its range. -/
@[simps! apply]
noncomputable def comap_equiv_self_of_inj_of_le {f : M →ₗ[R] N} {p : Submodule R N}
    (hf : Injective f) (h : p ≤ LinearMap.range f) :
    p.comap f ≃ₗ[R] p

{R : Type u_1}
{M : Type u_5}
{N : Type u_9}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
{f : M →ₗ[R] N}
{p : Submodule R N}
(hf : Function.Injective ⇑f)
(h : p ≤ LinearMap.range f)

∀ (a : ↥(Submodule.comap f p)),
  (Submodule.comap_equiv_self_of_inj_of_le hf h) a = (LinearMap.codRestrict p (f ∘ₗ (Submodule.comap f p).subtype) ⋯) a


theorem nhds_of_nhdsWithin_of_nhds {s t : Set α} {a : α} (h1 : s ∈ 𝓝 a) (h2 : t ∈ 𝓝[s] a) :
    t ∈ 𝓝 a

{α : Type u_1}
[TopologicalSpace α]
{s t : Set α}
{a : α}
(h1 : s ∈ 𝓝 a)
(h2 : t ∈ 𝓝[s] a)


@[to_additive]
lemma comp_mul [CommMonoid P] (g : N →* P) (f₁ f₂ : M →* N) :
    g.comp (f₁ * f₂) = g.comp f₁ * g.comp f₂

{M : Type u_3}
{N : Type u_4}
{P : Type u_5}
[AddZeroClass M]
[AddCommMonoid N]
[AddCommMonoid P]
(g : N →+ P)
(f₁ f₂ : M →+ N)

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


theorem finiteInter_mem (cond : FiniteInter S) (F : Finset (Set α)) :
    ↑F ⊆ S → ⋂₀ (↑F : Set (Set α)) ∈ S

{α : Type u_1}
{S : Set (Set α)}
(cond : FiniteInter S)
(F : Finset (Set α))

↑F ⊆ S → ⋂₀ ↑F ∈ S


/-- The volume form coming from an orientation in an inner product space gives measure `1` to the
parallelepiped associated to any orthonormal basis. This is a rephrasing of
`abs_volumeForm_apply_of_orthonormal` in terms of measures. -/
theorem Orientation.measure_orthonormalBasis (o : Orientation ℝ F (Fin n))
    (b : OrthonormalBasis ι ℝ F) : o.volumeForm.measure (parallelepiped b) = 1

[_i : Fact (FiniteDimensional.finrank ℝ F = n)]

o.volumeForm.measure (parallelepiped ⇑b) = 1


@[simp]
theorem interior_Iic' {a : α} (ha : (Ioi a).Nonempty) : interior (Iic a) = Iio a

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
{a : α}
(ha : (Set.Ioi a).Nonempty)


protected theorem lt_add_left (c : Nat) (h : a < b) : a < c + b


lemma InjectiveResolution.rightDerivedToHomotopyCategory_app_eq
    {F G : C ⥤ D} [F.Additive] [G.Additive] (α : F ⟶ G) {X : C} (P : InjectiveResolution X) :
    (NatTrans.rightDerivedToHomotopyCategory α).app X =
      (P.isoRightDerivedToHomotopyCategoryObj F).hom ≫
        (HomotopyCategory.quotient _ _).map
          ((NatTrans.mapHomologicalComplex α _).app P.cocomplex) ≫
          (P.isoRightDerivedToHomotopyCategoryObj G).inv

(P : CategoryTheory.InjectiveResolution X)

(CategoryTheory.NatTrans.rightDerivedToHomotopyCategory α).app X =
  CategoryTheory.CategoryStruct.comp (P.isoRightDerivedToHomotopyCategoryObj F).hom
    (CategoryTheory.CategoryStruct.comp
      ((HomotopyCategory.quotient D (ComplexShape.up ℕ)).map
        ((CategoryTheory.NatTrans.mapHomologicalComplex α (ComplexShape.up ℕ)).app P.cocomplex))
      (P.isoRightDerivedToHomotopyCategoryObj G).inv)


@[simp]
theorem abs_mul_cos_add_sin_mul_I (x : ℂ) : (abs x * (cos (arg x) + sin (arg x) * I) : ℂ) = x

↑(Complex.abs x) * (Complex.cos ↑x.arg + Complex.sin ↑x.arg * Complex.I) = x


theorem induced_compose {tγ : TopologicalSpace γ} {f : α → β} {g : β → γ} :
    (tγ.induced g).induced f = tγ.induced (g ∘ f)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{tγ : TopologicalSpace γ}
{f : α → β}
{g : β → γ}

TopologicalSpace.induced f (TopologicalSpace.induced g tγ) = TopologicalSpace.induced (g ∘ f) tγ


theorem measure_lt_top_of_subset (hst : t ⊆ s) (hs : μ s ≠ ∞) : μ t < ∞

{α : Type u_1}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{s t : Set α}
(hst : t ⊆ s)
(hs : μ s ≠ ⊤)


/-- When both maps `S.f` and `S.g` of a short complex `S` are zero, this is the right homology map
data (for the identity of `S`) which relates the right homology data `ofZeros` and
`ofIsColimitCokernelCofork`. -/
@[simps]
def compatibilityOfZerosOfIsColimitCokernelCofork (hf : S.f = 0) (hg : S.g = 0)
    (c : CokernelCofork S.f) (hc : IsColimit c) :
    RightHomologyMapData (𝟙 S)
      (RightHomologyData.ofZeros S hf hg)
      (RightHomologyData.ofIsColimitCokernelCofork S hg c hc)

(c : CategoryTheory.Limits.CokernelCofork S.f)

(hc : CategoryTheory.Limits.IsColimit c)

(CategoryTheory.ShortComplex.RightHomologyMapData.compatibilityOfZerosOfIsColimitCokernelCofork S hf hg c hc).φH =
  CategoryTheory.Limits.Cofork.π c


theorem range_disjoint_map_add (a : ℕ) (m : Multiset ℕ) :
    (range a).Disjoint (m.map (a + ·))

(Multiset.range a).Disjoint (Multiset.map (fun x => a + x) m)


theorem types_id (X : Type u) : 𝟙 X = id


theorem isOpen_def :
    IsOpen s ↔ (∞ ∈ s → IsCompact ((↑) ⁻¹' s : Set X)ᶜ) ∧ IsOpen ((↑) ⁻¹' s : Set X)

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

IsOpen s ↔ (OnePoint.infty ∈ s → IsCompact (OnePoint.some ⁻¹' s)ᶜ) ∧ IsOpen (OnePoint.some ⁻¹' s)


theorem card_fintypeIic : Fintype.card (Set.Iic b) = b + 1


theorem IsNormal.conj' {S : Subgroupoid C} (Sn : IsNormal S) :
    ∀ {c d} (p : d ⟶ c) {γ : c ⟶ c}, γ ∈ S.arrows c c → p ≫ γ ≫ Groupoid.inv p ∈ S.arrows d d

{C : Type u}
[CategoryTheory.Groupoid C]
{S : CategoryTheory.Subgroupoid C}
(Sn : S.IsNormal)
{c d : C}
(p : d ⟶ c)
{γ : c ⟶ c}

γ ∈ S.arrows c c →
  CategoryTheory.CategoryStruct.comp p (CategoryTheory.CategoryStruct.comp γ (CategoryTheory.Groupoid.inv p)) ∈
    S.arrows d d


@[to_additive]
lemma leOnePart_eq_inv_inf_one (a : α) : a⁻ᵐ = (a ⊓ 1)⁻¹

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

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


@[simp]
theorem encode_of_none_mem [DecidableEq α] (s : Sym (Option α) n.succ) (h : none ∈ s) :
    encode s = Sum.inl (s.erase none h)

{α : Type u_1}
{n : ℕ}
[DecidableEq α]
(s : Sym (Option α) n.succ)
(h : none ∈ s)

SymOptionSuccEquiv.encode s = Sum.inl (s.erase none h)


theorem not_mem_support {x : α} : x ∉ f.support ↔ f x = x

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


theorem lt_wf : @WellFounded NatOrdinal (· < ·)


theorem le_of_mul_le_of_one_le
    [ZeroLEOneClass α] [NeZero (R := α) 1] [MulPosStrictMono α] [PosMulMono α]
    {a b c : α} (h : a * c ≤ b) (hb : 0 ≤ b) (hc : 1 ≤ c) : a ≤ b

{α : Type u}
[Semiring α]
[LinearOrder α]
[ZeroLEOneClass α]
[NeZero 1]
[MulPosStrictMono α]
[PosMulMono α]
{a b c : α}
(h : a * c ≤ b)
(hb : 0 ≤ b)
(hc : 1 ≤ c)


/-- Given a fixed pivot `p : Fin (n + 1)`, `p.succAbove` is injective. -/
lemma succAbove_right_injective : Injective p.succAbove


/-- If two measures `ρ` and `ν` have, at every point of a set `s`, arbitrarily small sets in a
Vitali family satisfying `ρ a ≤ ν a`, then `ρ s ≤ ν s` if `ρ ≪ μ`. -/
theorem measure_le_of_frequently_le [SecondCountableTopology α] [BorelSpace α] {ρ : Measure α}
    (ν : Measure α) [IsLocallyFiniteMeasure ν] (hρ : ρ ≪ μ) (s : Set α)
    (hs : ∀ x ∈ s, ∃ᶠ a in v.filterAt x, ρ a ≤ ν a) : ρ s ≤ ν s

(hρ : ρ ≪ μ)

(hs : ∀ x ∈ s, ∃ᶠ (a : Set α) in v.filterAt x, ρ a ≤ ν a)


/-- If a function admits a finite power series expansion bounded by `n`, then it is equal to
the `m`th partial sums of this power series at every point of the disk for `n ≤ m`. -/
theorem HasFiniteFPowerSeriesOnBall.eq_partialSum
    (hf : HasFiniteFPowerSeriesOnBall f p x n r) :
    ∀ y ∈ EMetric.ball (0 : E) r, ∀ m, n ≤ m →
    f (x + y) = p.partialSum m y

y ∈ EMetric.ball 0 r → ∀ (m : ℕ), n ≤ m → f (x + y) = p.partialSum m y


theorem isBounded_iff {s : Set α} :
    IsBounded s ↔ ∃ C : ℝ, ∀ ⦃x⦄, x ∈ s → ∀ ⦃y⦄, y ∈ s → dist x y ≤ C

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

Bornology.IsBounded s ↔ ∃ C, ∀ ⦃x : α⦄, x ∈ s → ∀ ⦃y : α⦄, y ∈ s → dist x y ≤ C


theorem Model.mono {T' : L.Theory} (_h : M ⊨ T') (hs : T ⊆ T') : M ⊨ T

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{T T' : L.Theory}
(_h : M ⊨ T')
(hs : T ⊆ T')


@[simp]
lemma finsuppRight_apply_tmul_apply (m : M) (p : ι →₀ N) (i : ι) :
    finsuppRight R M N ι (m ⊗ₜ[R] p) i = m ⊗ₜ[R] p i

{R : Type u_1}
[CommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_4}
[DecidableEq ι]
(m : M)
(p : ι →₀ N)
(i : ι)

((TensorProduct.finsuppRight R M N ι) (m ⊗ₜ[R] p)) i = m ⊗ₜ[R] p i


/-- If `f : R → ℝ` is a nonnegative, multiplicatively bounded function and `x : R` is
  multiplicative for `f`, then `seminormFromBounded' f x = f x`. -/
theorem seminormFromBounded_of_mul_apply (f_nonneg : 0 ≤ f)
    (f_mul : ∀ x y : R, f (x * y) ≤ c * f x * f y) {x : R}
    (hx : ∀ y : R, f (x * y) = f x * f y) : seminormFromBounded' f x = f x

(f_mul : ∀ (x y : R), f (x * y) ≤ c * f x * f y)


@[simp]
theorem product_empty (s : Finset α) : s ×ˢ (∅ : Finset β) = ∅

{α : Type u_1}
{β : Type u_2}
(s : Finset α)


@[simp] lemma num_pos : 0 < q.num ↔ 0 < q


/-- One is always `M`-regular. -/
@[simp]
theorem one : IsSMulRegular M (1 : R)

{R : Type u_1}
(M : Type u_3)
[Monoid R]
[MulAction R M]


/-- In order to define a natural isomorphism `F ≅ G` with `F G : Quotient r ⥤ D`, it suffices
to do so after precomposing with `Quotient.functor r`. -/
@[simps]
def natIsoLift {F G : Quotient r ⥤ D} (τ : Quotient.functor r ⋙ F ≅ Quotient.functor r ⋙ G) :
    F ≅ G

{F G : CategoryTheory.Functor (CategoryTheory.Quotient r) D}

(τ : (CategoryTheory.Quotient.functor r).comp F ≅ (CategoryTheory.Quotient.functor r).comp G)

(CategoryTheory.Quotient.natIsoLift r τ).inv = CategoryTheory.Quotient.natTransLift r τ.inv


theorem contDiffWithinAt_insert_self :
    ContDiffWithinAt 𝕜 n f (insert x s) x ↔ ContDiffWithinAt 𝕜 n f s x

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


theorem int_lt_one_iff (m : ℤ) : padicNorm p m < 1 ↔ (p : ℤ) ∣ m

{p : ℕ}
[hp : Fact (Nat.Prime p)]
(m : ℤ)


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

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[Preorder α]
[Preorder β]
[Preorder γ]
(g : PseudoEpimorphism β γ)
(f : PseudoEpimorphism α β)
(a : α)


@[simp, norm_cast]
theorem _root_.Submodule.angle_coe {s : Submodule ℝ V} (x y : s) :
    angle (x : V) (y : V) = angle x y

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

InnerProductGeometry.angle ↑x ↑y = InnerProductGeometry.angle x y


theorem fst_eq_or_snd_eq_of_wcovBy : x ⩿ y → x.1 = y.1 ∨ x.2 = y.2

{α : Type u_1}
{β : Type u_2}
[PartialOrder α]
[PartialOrder β]
{x y : α × β}


@[simp]
theorem image_some_eraseNone [DecidableEq (Option α)] (s : Finset (Option α)) :
    (eraseNone s).image some = s.erase none

{α : Type u_1}
[DecidableEq (Option α)]
(s : Finset (Option α))

Finset.image some (Finset.eraseNone s) = s.erase none


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

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Sup α]
[Bot α]
[Sup β]
[Bot β]
[Sup γ]
[Bot γ]
(f : SupBotHom β γ)
(g : SupBotHom α β)


theorem contravariant_le_of_contravariant_eq_and_lt [PartialOrder N]
    [ContravariantClass M N μ (· = ·)] [ContravariantClass M N μ (· < ·)] :
    ContravariantClass M N μ (· ≤ ·)

[ContravariantClass M N μ fun x x_1 => x = x_1]

[ContravariantClass M N μ fun x x_1 => x < x_1]

ContravariantClass M N μ fun x x_1 => x ≤ x_1


@[simp]
theorem coe_top : ↑(⊤ : Subtype (MeasurableSet : Set α → Prop)) = (⊤ : Set α)


/-- Monotone convergence theorem for real-valued functions and Bochner integrals -/
lemma integral_tendsto_of_tendsto_of_antitone {μ : Measure α} {f : ℕ → α → ℝ} {F : α → ℝ}
    (hf : ∀ n, Integrable (f n) μ) (hF : Integrable F μ) (h_mono : ∀ᵐ x ∂μ, Antitone fun n ↦ f n x)
    (h_tendsto : ∀ᵐ x ∂μ, Tendsto (fun n ↦ f n x) atTop (𝓝 (F x))) :
    Tendsto (fun n ↦ ∫ x, f n x ∂μ) atTop (𝓝 (∫ x, F x ∂μ))

{f : ℕ → α → ℝ}

(hf : ∀ (n : ℕ), MeasureTheory.Integrable (f n) μ)

(h_mono : ∀ᵐ (x : α) ∂μ, Antitone fun n => f n x)

(h_tendsto : ∀ᵐ (x : α) ∂μ, Filter.Tendsto (fun n => f n x) Filter.atTop (𝓝 (F x)))

Filter.Tendsto (fun n => ∫ (x : α), f n x ∂μ) Filter.atTop (𝓝 (∫ (x : α), F x ∂μ))


lemma pos_and_pos_or_neg_and_neg_of_smul_pos [PosSMulMono α β] [SMulPosMono α β] (hab : 0 < a • b) :
    0 < a ∧ 0 < b ∨ a < 0 ∧ b < 0

{α : Type u_1}
{β : Type u_2}
{a : α}
{b : β}
[Zero α]
[Zero β]
[SMulWithZero α β]
[LinearOrder α]
[LinearOrder β]
[PosSMulMono α β]
[SMulPosMono α β]
(hab : 0 < a • b)


theorem GameAdd.fix_eq {C : α → β → Sort*} (hα : WellFounded rα) (hβ : WellFounded rβ)
    (IH : ∀ a₁ b₁, (∀ a₂ b₂, GameAdd rα rβ (a₂, b₂) (a₁, b₁) → C a₂ b₂) → C a₁ b₁) (a : α) (b : β) :
    GameAdd.fix hα hβ IH a b = IH a b fun a' b' _ => GameAdd.fix hα hβ IH a' b'

(IH : (a₁ : α) → (b₁ : β) → ((a₂ : α) → (b₂ : β) → Prod.GameAdd rα rβ (a₂, b₂) (a₁, b₁) → C a₂ b₂) → C a₁ b₁)

Prod.GameAdd.fix hα hβ IH a b = IH a b fun a' b' x => Prod.GameAdd.fix hα hβ IH a' b'


@[to_additive (attr := simp)]
theorem mrange_snd : mrange (snd M N) = ⊤

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]

MonoidHom.mrange (MonoidHom.snd M N) = ⊤


@[to_additive]
theorem prod_range_mul_prod_Ico (f : ℕ → M) {m n : ℕ} (h : m ≤ n) :
    ((∏ k ∈ range m, f k) * ∏ k ∈ Ico m n, f k) = ∏ k ∈ range n, f k

{M : Type u_2}
[CommMonoid M]
(f : ℕ → M)
{m n : ℕ}
(h : m ≤ n)

(∏ k ∈ Finset.range m, f k) * ∏ k ∈ Finset.Ico m n, f k = ∏ k ∈ Finset.range n, f k


@[simp]
theorem neg_apply (f : CuspForm Γ k) (z : ℍ) : (-f) z = -f z

{Γ : Subgroup SL(2, ℤ)}
{k : ℤ}
(f : CuspForm Γ k)
(z : ℍ)


theorem connectedSpace_iff_connectedComponent :
    ConnectedSpace α ↔ ∃ x : α, connectedComponent x = univ

ConnectedSpace α ↔ ∃ x, connectedComponent x = Set.univ


theorem gc_map_comap (f : F) :
    GaloisConnection (map f : NonUnitalSubring R → NonUnitalSubring S) (comap f)

{F : Type w}
{R : Type u}
{S : Type v}
[NonUnitalNonAssocRing R]
[NonUnitalNonAssocRing S]
[FunLike F R S]
[NonUnitalRingHomClass F R S]
(f : F)

GaloisConnection (NonUnitalSubring.map f) (NonUnitalSubring.comap f)


theorem congr_set {s t : Set H} {x : H} {f : H → H'} (hu : s =ᶠ[𝓝 x] t) : P f s x ↔ P f t x

{H : Type u_1}
{H' : Type u_3}
[TopologicalSpace H]
[TopologicalSpace H']
{G : StructureGroupoid H}
{G' : StructureGroupoid H'}
{P : (H → H') → Set H → H → Prop}
(hG : G.LocalInvariantProp G' P)
{s t : Set H}
{x : H}
{f : H → H'}
(hu : s =ᶠ[𝓝 x] t)


/-- A continuous function on a compact space automatically has compact support. -/
@[simps]
def ContinuousMap.liftCompactlySupported [CompactSpace α] : C(α, β) ≃ C_c(α, β)

{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
[Zero β]
[CompactSpace α]
(f : α →C_c β)

CompactlySupportedContinuousMap.ContinuousMap.liftCompactlySupported.symm f = ↑f


@[simp]
theorem equivOfEquiv_comp_algebraMap (hSR : S ≃+* R) :
    (↑(equivOfEquiv L M hSR) : L →+* M).comp (algebraMap S L) = (algebraMap R M).comp hSR

{R : Type u}
{S : Type u_3}
(L : Type v)
(M : Type w)
[CommRing R]
[CommRing S]
[Field L]
[Field M]
[Algebra R M]
[NoZeroSMulDivisors R M]
[IsAlgClosure R M]
[Algebra S L]
[NoZeroSMulDivisors S L]
[IsAlgClosure S L]
(hSR : S ≃+* R)

(↑(IsAlgClosure.equivOfEquiv L M hSR)).comp (algebraMap S L) = (algebraMap R M).comp ↑hSR


@[simp] theorem zero_imJ : (0 : ℍ[R]).imJ = 0


/-- The identity lax functor. -/
@[simps]
def id (B : Type u₁) [Bicategory.{w₁, v₁} B] : LaxFunctor B B

(B : Type u₁)
[CategoryTheory.Bicategory B]
(a : B)

(CategoryTheory.LaxFunctor.id B).mapId a = CategoryTheory.CategoryStruct.id (CategoryTheory.CategoryStruct.id a)


/-- The `ℤ`-linear map induced by precomposition of the projection `C → π C (ord I · < o)`. -/
@[simps!]
noncomputable
def πs (o : Ordinal) : LocallyConstant (π C (ord I · < o)) ℤ →ₗ[ℤ] LocallyConstant C ℤ

(g : LocallyConstant ↑(Profinite.NobelingProof.π C fun x => Profinite.NobelingProof.ord I x < o) ℤ)

∀ (a : ↑C),
  ((Profinite.NobelingProof.πs C o) g) a =
    g (Profinite.NobelingProof.ProjRestrict C (fun x => Profinite.NobelingProof.ord I x < o) a)


@[simp, norm_cast] lemma ratCast_imJ (q : ℚ) : (q : ℍ[R]).imJ = 0

{R : Type u_1}
[LinearOrderedField R]
(q : ℚ)


@[simp] lemma powerset_union (s t : Finset α) : (s ∪ t).powerset = s.powerset ⊻ t.powerset

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


theorem HigherFacesVanish.comp_σ {Y : C} {X : SimplicialObject C} {n b q : ℕ} {φ : Y ⟶ X _[n + 1]}
    (v : HigherFacesVanish q φ) (hnbq : n + 1 = b + q) :
    HigherFacesVanish q
      (φ ≫
        X.σ ⟨b, by
          simp only [hnbq, Nat.lt_add_one_iff, le_add_iff_nonneg_right, zero_le]⟩)

(v : AlgebraicTopology.DoldKan.HigherFacesVanish q φ)

AlgebraicTopology.DoldKan.HigherFacesVanish q (φ ≫ X.σ ⟨b, ⋯⟩)


@[to_additive (attr := mono)]
theorem hasProd_mono (hf : HasProd f a₁) (hg : HasProd g a₂) (h : f ≤ g) : a₁ ≤ a₂

{ι : Type u_1}
{α : Type u_3}
[OrderedAddCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{f g : ι → α}
{a₁ a₂ : α}
(hf : HasSum f a₁)
(hg : HasSum g a₂)
(h : f ≤ g)


theorem left_mem_Ioc : a ∈ Ioc a b ↔ False


theorem Finite.finite_of_compl {s : Set α} (hs : s.Finite) (hsc : sᶜ.Finite) : Finite α

{α : Type u}
{s : Set α}
(hs : s.Finite)
(hsc : sᶜ.Finite)


theorem HasStrictFDerivAt.ccosh (hf : HasStrictFDerivAt f f' x) :
    HasStrictFDerivAt (fun x => Complex.cosh (f x)) (Complex.sinh (f x) • f') x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{f' : E →L[ℂ] ℂ}
{x : E}
(hf : HasStrictFDerivAt f f' x)


theorem smul_mem' (p : Submodule (A ⊗[R] B) M) (b : B) {m : M} (hm : m ∈ p) : b • m ∈ p

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{M : Type u_4}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[Semiring A]
[Semiring B]
[Module A M]
[Module B M]
[Algebra R A]
[Algebra R B]
[IsScalarTower R A M]
[IsScalarTower R B M]
[SMulCommClass A B M]
(p : Submodule (A ⊗[R] B) M)
(b : B)
{m : M}
(hm : m ∈ p)


@[simp]
theorem inf_cons {b : β} (h : b ∉ s) : (cons b s h).inf f = f b ⊓ s.inf f

{α : Type u_2}
{β : Type u_3}
[SemilatticeInf α]
[OrderTop α]
{s : Finset β}
{f : β → α}
{b : β}
(h : b ∉ s)

(Finset.cons b s h).inf f = f b ⊓ s.inf f


theorem measure_inter_lt_top_of_left_ne_top (hs_finite : μ s ≠ ∞) : μ (s ∩ t) < ∞

{α : Type u_1}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{s t : Set α}
(hs_finite : μ s ≠ ⊤)


@[simp]
lemma map_j : (E.map φ).j = φ E.j

{R : Type u}
[CommRing R]
(E : EllipticCurve R)
{A : Type v}
[CommRing A]
(φ : R →+* A)


theorem antitone_principal : Antitone (principal : P → PFilter P)


theorem setLaverage_eq' (f : α → ℝ≥0∞) (s : Set α) :
    ⨍⁻ x in s, f x ∂μ = ∫⁻ x, f x ∂(μ s)⁻¹ • μ.restrict s

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

⨍⁻ (x : α) in s, f x ∂μ = ∫⁻ (x : α), f x ∂(μ s)⁻¹ • μ.restrict s


theorem extend_coord_change_source_mem_nhdsWithin {x : E}
    (hx : x ∈ ((f.extend I).symm ≫ f'.extend I).source) :
    ((f.extend I).symm ≫ f'.extend I).source ∈ 𝓝[range I] x

((f.extend I).symm ≫ f'.extend I).source ∈ 𝓝[Set.range ↑I] x


lemma poissonPMFRealSum (r : ℝ≥0) : HasSum (fun n ↦ poissonPMFReal r n) 1

HasSum (fun n => ProbabilityTheory.poissonPMFReal r n) 1


theorem End.intCast_def (z : ℤ) [AddCommGroup N₁] [Module R N₁] :
    (z : Module.End R N₁) = Module.toModuleEnd R N₁ z

(R : Type u_1)
{N₁ : Type u_10}
[Semiring R]
(z : ℤ)
[AddCommGroup N₁]
[Module R N₁]


/-- The chain rule. -/
@[fun_prop]
theorem HasFDerivAt.comp {g : F → G} {g' : F →L[𝕜] G} (hg : HasFDerivAt g g' (f x))
    (hf : HasFDerivAt f f' x) : HasFDerivAt (g ∘ f) (g'.comp f') 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]
{f : E → F}
{f' : E →L[𝕜] F}
(x : E)
{g : F → G}
{g' : F →L[𝕜] G}
(hg : HasFDerivAt g g' (f x))
(hf : HasFDerivAt f f' x)


@[simp]
lemma isoOfIsoLift_inv_hom_id (f : R ⟶ S) (φ : a ≅ b) [p.IsHomLift f φ.hom] :
    (isoOfIsoLift p f φ).inv ≫ f = 𝟙 S

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

(CategoryTheory.IsHomLift.isoOfIsoLift p f φ).inv ≫ f = 𝟙 S


/-- For disjoint `f1` and `f2`, and function `g`, the product of the products of `g`
over `f1` and `f2` equals the product of `g` over `f1 + f2` -/
@[to_additive
      "For disjoint `f1` and `f2`, and function `g`, the sum of the sums of `g`
      over `f1` and `f2` equals the sum of `g` over `f1 + f2`"]
theorem prod_add_index_of_disjoint [AddCommMonoid M] {f1 f2 : α →₀ M}
    (hd : Disjoint f1.support f2.support) {β : Type*} [CommMonoid β] (g : α → M → β) :
    (f1 + f2).prod g = f1.prod g * f2.prod g

{α : Type u_1}
{M : Type u_8}
[AddCommMonoid M]
{f1 f2 : α →₀ M}
(hd : Disjoint f1.support f2.support)
{β : Type u_16}
[AddCommMonoid β]
(g : α → M → β)


/-- The `LSeries` of the constant sequence `1` converges at `s` if and only if `re s > 1`. -/
theorem LSeriesSummable_one_iff {s : ℂ} : LSeriesSummable 1 s ↔ 1 < s.re


/-- `AffineEquiv.linear` on automorphisms is a `MonoidHom`. -/
@[simps]
def linearHom : (P₁ ≃ᵃ[k] P₁) →* V₁ ≃ₗ[k] V₁

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

AffineEquiv.linearHom self = self.linear


lemma support_smul_subset_left [Zero R] [Zero M] [SMulWithZero R M] (f : α → R) (g : α → M) :
    support (f • g) ⊆ support f

{α : Type u_1}
{R : Type u_2}
{M : Type u_3}
[Zero R]
[Zero M]
[SMulWithZero R M]
(f : α → R)
(g : α → M)

Function.support (f • g) ⊆ Function.support f


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

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

x ≤ y₁ ↔ x ≤ y₂


/-- Given an integral domain `A` with field of fractions `K`,
and an injective ring hom `g : A →+* L` where `L` is a field,
field hom induced from `K` to `L` maps `f x / f y` to `g x / g y` for all
`x : A, y ∈ NonZeroDivisors A`. -/
theorem lift_mk' (hg : Injective g) (x) (y : nonZeroDivisors A) :
    lift hg (mk' K x y) = g x / g y

{A : Type u_4}
[CommRing A]
[IsDomain A]
{K : Type u_5}
[Field K]
{L : Type u_7}
[Field L]
[Algebra A K]
[IsFractionRing A K]
{g : A →+* L}
(hg : Function.Injective ⇑g)
(x : A)
(y : ↥(nonZeroDivisors A))

(IsFractionRing.lift hg) (IsLocalization.mk' K x y) = g x / g ↑y


/-- Given a diagram `D` of limit cones over the `F.obj j`, and a cone over `uncurry.obj F`,
we can construct a cone over the diagram consisting of the cone points from `D`.
-/
@[simps]
def coneOfConeUncurry {D : DiagramOfCones F} (Q : ∀ j, IsLimit (D.obj j))
    (c : Cone (uncurry.obj F)) : Cone D.conePoints

{D : CategoryTheory.Limits.DiagramOfCones F}

(Q : (j : J) → CategoryTheory.Limits.IsLimit (D.obj j))

(c : CategoryTheory.Limits.Cone (CategoryTheory.uncurry.obj F))

(CategoryTheory.Limits.coneOfConeUncurry Q c).pt = c.pt


theorem cast_pos_of_pos (hq : 0 < q) : (0 : K) < q

{q : ℚ}
{K : Type u_5}
[LinearOrderedField K]
(hq : 0 < q)


@[simp]
theorem total_fin_zero (f : Fin 0 → M) : Finsupp.total (Fin 0) M R f = 0

{M : Type u_2}
(R : Type u_5)
[Semiring R]
[AddCommMonoid M]
[Module R M]
(f : Fin 0 → M)


/-- **Fundamental theorem of calculus-1**: if `f : ℝ → E` is integrable on `a..b` and `f` is
continuous at `a`, then `u ↦ ∫ x in u..b, f x` has derivative `-f a` at `a`. -/
theorem integral_hasDerivAt_left (hf : IntervalIntegrable f volume a b)
    (hmeas : StronglyMeasurableAtFilter f (𝓝 a)) (ha : ContinuousAt f a) :
    HasDerivAt (fun u => ∫ x in u..b, f x) (-f a) a

(hf : IntervalIntegrable f MeasureTheory.volume a b)

(hmeas : StronglyMeasurableAtFilter f (𝓝 a) MeasureTheory.volume)

HasDerivAt (fun u => ∫ (x : ℝ) in u..b, f x) (-f a) a