/-- **Hahn-Banach theorem** for continuous linear functions over `ℝ`.
See also `exists_extension_norm_eq` in the root namespace for a more general version
that works both for `ℝ` and `ℂ`. -/
theorem exists_extension_norm_eq (p : Subspace ℝ E) (f : p →L[ℝ] ℝ) :
    ∃ g : E →L[ℝ] ℝ, (∀ x : p, g x = f x) ∧ ‖g‖ = ‖f‖

{E : Type u_1}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
(p : Subspace ℝ E)
(f : ↥p →L[ℝ] ℝ)

∃ g, (∀ (x : ↥p), g ↑x = f x) ∧ ‖g‖ = ‖f‖


theorem iInf_comap_proj :
    ⨅ i, comap (proj i : ((i : ι) → φ i) →ₗ[R] φ i) (p i) = pi Set.univ p

{R : Type u}
{ι : Type x}
[Semiring R]
{φ : ι → Type u_1}
[(i : ι) → AddCommMonoid (φ i)]
[(i : ι) → Module R (φ i)]
{p : (i : ι) → Submodule R (φ i)}

⨅ i, Submodule.comap (LinearMap.proj i) (p i) = Submodule.pi Set.univ p


theorem SurjectiveOnWith.exists_pos {f : NormedAddGroupHom V₁ V₂} {K : AddSubgroup V₂} {C : ℝ}
    (h : f.SurjectiveOnWith K C) : ∃ C' > 0, f.SurjectiveOnWith K C'

{V₁ : Type u_2}
{V₂ : Type u_3}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
{f : NormedAddGroupHom V₁ V₂}
{K : AddSubgroup V₂}
{C : ℝ}
(h : f.SurjectiveOnWith K C)


lemma isSheaf_iff :
    Presheaf.IsSheaf J P ↔ ∀ ⦃X : C⦄ (E : J.OneHypercover X)
      (_ : H E), Nonempty (IsLimit (E.multifork P))

{J : CategoryTheory.GrothendieckTopology C}

CategoryTheory.Presheaf.IsSheaf J P ↔
  ∀ ⦃X : C⦄ (E : J.OneHypercover X), H E → Nonempty (CategoryTheory.Limits.IsLimit (E.multifork P))


@[simp] -- porting note: new `simp`
theorem nil_mem_subchain : [] ∈ s.subchain


@[simp]
theorem weightedVSubVSubWeights_apply_right [DecidableEq ι] {i j : ι} (h : i ≠ j) :
    weightedVSubVSubWeights k i j j = -1

(k : Type u_1)
[Ring k]
{ι : Type u_4}
[DecidableEq ι]
{i j : ι}
(h : i ≠ j)

Finset.weightedVSubVSubWeights k i j j = -1


@[to_additive (attr := simp)]
lemma antivaryOn_inv_right : AntivaryOn f g⁻¹ s ↔ MonovaryOn f g s

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


/-- `cos z` is nonzero when the bounds in `arctan_tan` are met (`z` lies in the vertical strip
`-π / 2 < z.re < π / 2` and `z ≠ π / 2`). -/
lemma cos_ne_zero_of_arctan_bounds {z : ℂ} (h₀ : z ≠ π / 2) (h₁ : -(π / 2) < z.re)
    (h₂ : z.re ≤ π / 2) : cos z ≠ 0

{z : ℂ}
(h₀ : z ≠ ↑Real.pi / 2)
(h₁ : -(Real.pi / 2) < z.re)
(h₂ : z.re ≤ Real.pi / 2)


protected theorem Balanced.ins {path : Path α}
    (hp : path.Balanced c₀ n₀ c n) (ht : t.RedRed (c = red) n) :
    ∃ n, (path.ins t).Balanced black n

(hp : Batteries.RBNode.Path.Balanced c₀ n₀ path c n)

(ht : Batteries.RBNode.RedRed (c = Batteries.RBColor.red) t n)

∃ n, (path.ins t).Balanced Batteries.RBColor.black n


theorem tan_sub_int_mul_pi (x : ℂ) (n : ℤ) : tan (x - n * π) = tan x

Complex.tan (x - ↑n * ↑Real.pi) = Complex.tan x


@[simp]
theorem iterate_derivative_C {k} (h : 0 < k) : derivative^[k] (C a : R[X]) = 0

{R : Type u}
{a : R}
[Semiring R]
{k : ℕ}
(h : 0 < k)

(⇑Polynomial.derivative)^[k] (Polynomial.C a) = 0


@[simp]
theorem coe_toCoalgHom : ⇑(e : A →ₗc[R] B) = e

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


/-- Continuous algebra homomorphisms from `C(s, ℝ)` into an `ℝ`-algebra `A` which agree
at `X : 𝕜[X]` (interpreted as a continuous map) are, in fact, equal. -/
@[ext]
theorem ContinuousMap.algHom_ext_map_X {A : Type*} [Ring A]
    [Algebra ℝ A] [TopologicalSpace A] [T2Space A] {s : Set ℝ} [CompactSpace s]
    {φ ψ : C(s, ℝ) →ₐ[ℝ] A} (hφ : Continuous φ) (hψ : Continuous ψ)
    (h : φ (toContinuousMapOnAlgHom s X) = ψ (toContinuousMapOnAlgHom s X)) : φ = ψ

(h : φ ((Polynomial.toContinuousMapOnAlgHom s) Polynomial.X) = ψ ((Polynomial.toContinuousMapOnAlgHom s) Polynomial.X))


@[to_additive]
theorem isCyclic_of_surjective {H G F : Type*} [Group H] [Group G] [hH : IsCyclic H]
    [FunLike F H G] [MonoidHomClass F H G] (f : F) (hf : Function.Surjective f) :
    IsCyclic G

{H : Type u_1}
{G : Type u_2}
{F : Type u_3}
[Group H]
[Group G]
[hH : IsCyclic H]
[FunLike F H G]
[MonoidHomClass F H G]
(f : F)
(hf : Function.Surjective ⇑f)


theorem comap_injective_of_surjective (f : R →+* S) (hf : Function.Surjective f) :
    Function.Injective (comap f)

{R : Type u}
{S : Type v}
[CommSemiring R]
[CommSemiring S]
(f : R →+* S)
(hf : Function.Surjective ⇑f)


/-- The Legendre symbol `legendreSym p a = 1` if there is a solution in `ℤ/pℤ`
of the equation `x^2 - a*y^2 = 0` with `x ≠ 0`. -/
theorem eq_one_of_sq_sub_mul_sq_eq_zero' {p : ℕ} [Fact p.Prime] {a : ℤ} (ha : (a : ZMod p) ≠ 0)
    {x y : ZMod p} (hx : x ≠ 0) (hxy : x ^ 2 - a * y ^ 2 = 0) : legendreSym p a = 1

{p : ℕ}
[Fact (Nat.Prime p)]
{a : ℤ}
(ha : ↑a ≠ 0)
{x y : ZMod p}
(hx : x ≠ 0)
(hxy : x ^ 2 - ↑a * y ^ 2 = 0)


/-- Given a triangle of the form:
```
      f       g       h
  X  ───> Y  ───> Z  ───> X⟦1⟧
```
applying `invRotate` gives a triangle that can be thought of as:
```
        -h⟦-1⟧'     f       g
  Z⟦-1⟧  ───>  X  ───> Y  ───> Z
```
(note that this diagram doesn't technically fit the definition of triangle, as `Z⟦-1⟧⟦1⟧` is
not necessarily equal to `Z`, but it is isomorphic, by the `counitIso` of `shiftEquiv C 1`)
-/
@[simps!]
def Triangle.invRotate (T : Triangle C) : Triangle C

(T : CategoryTheory.Pretriangulated.Triangle C)

T.invRotate.mor₃ = T.mor₂ ≫ (CategoryTheory.shiftFunctorCompIsoId C (-1) 1 ⋯).inv.app T.3


@[simp]
theorem laurent_at_zero : laurent 0 f = f

{R : Type u}
[CommRing R]
[hdomain : IsDomain R]
(f : RatFunc R)


lemma copy {P P'} {Q Q'} [HasAffineProperty P Q]
    (e : P = P') (e' : Q = Q') : HasAffineProperty P' Q'

{P P' : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme}

{Q Q' : AlgebraicGeometry.AffineTargetMorphismProperty}


theorem getElem?_replicate : (replicate n a)[m]? = if m < n then some a else none

∀ {α : Type u_1} {a : α} {m : Nat}, (List.replicate n a)[m]? = if m < n then some a else none


@[to_additive (attr := simp)]
lemma mem_inv' : a ∈ s⁻¹ ↔ a⁻¹ ∈ s

{α : Type u_2}
[DecidableEq α]
[InvolutiveNeg α]
{s : Finset α}
{a : α}


theorem StarConvex.segment_subset (h : StarConvex 𝕜 x s) {y : E} (hy : y ∈ s) : [x -[𝕜] y] ⊆ s

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
{x : E}
{s : Set E}
(h : StarConvex 𝕜 x s)
{y : E}
(hy : y ∈ s)


lemma vComp'_iff_of_equivalences (E : C₂ ≌ C₃) (E' : D₂ ≌ D₃)
    (w' : H₂ ⋙ E'.functor ≅ E.functor ⋙ H₃) {L₁₂ : C₁ ⥤ C₃}
    {R₁₂ : D₁ ⥤ D₃} (eL : L₁ ⋙ E.functor ≅ L₁₂)
    (eR : R₁ ⋙ E'.functor ≅ R₁₂) :
    (w.vComp' w'.hom eL eR).GuitartExact ↔ w.GuitartExact

(w : CategoryTheory.TwoSquare H₁ L₁ R₁ H₂)

(w' : H₂.comp E'.functor ≅ E.functor.comp H₃)


@[simp] theorem disjoint_nil_left (l : List α) : Disjoint [] l


/-- Reformulation of `ConvexOn.slope_le_of_hasDerivWithinAt_Iio` using `derivWithin`. -/
lemma slope_le_left_deriv (hfc : ConvexOn ℝ S f) (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y)
    (hfd : DifferentiableWithinAt ℝ f (Iio y) y) :
    slope f x y ≤ derivWithin f (Iio y) y

(hfd : DifferentiableWithinAt ℝ f (Set.Iio y) y)

slope f x y ≤ derivWithin f (Set.Iio y) y


theorem HasBasis.eventually_iff (hl : l.HasBasis p s) {q : α → Prop} :
    (∀ᶠ x in l, q x) ↔ ∃ i, p i ∧ ∀ ⦃x⦄, x ∈ s i → q x

{α : Type u_1}
{ι : Sort u_4}
{l : Filter α}
{p : ι → Prop}
{s : ι → Set α}
(hl : l.HasBasis p s)
{q : α → Prop}

(∀ᶠ (x : α) in l, q x) ↔ ∃ i, p i ∧ ∀ ⦃x : α⦄, x ∈ s i → q x


@[simp]
theorem det_toLin (b : Basis ι R M) (f : Matrix ι ι R) :
    LinearMap.det (Matrix.toLin b b f) = f.det

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{ι : Type u_4}
[DecidableEq ι]
[Fintype ι]
(b : Basis ι R M)
(f : Matrix ι ι R)

LinearMap.det ((Matrix.toLin b b) f) = f.det


@[simp]
theorem star_nsmul [AddMonoid R] [StarAddMonoid R] (x : R) (n : ℕ) : star (n • x) = n • star x

{R : Type u}
[AddMonoid R]
[StarAddMonoid R]
(x : R)
(n : ℕ)


theorem equivariantProjection_apply (v : W) :
    π.equivariantProjection G v = ⅟(Fintype.card G : k) • ∑ g : G, π.conjugate g v

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

(LinearMap.equivariantProjection G π) v = ⅟↑(Fintype.card G) • ∑ g : G, (π.conjugate g) v


theorem card_Iic : (Iic b).card = ∏ i, (Iic (b i)).card

{ι : Type u_1}
{α : ι → Type u_2}
[Fintype ι]
[DecidableEq ι]
[(i : ι) → DecidableEq (α i)]
[(i : ι) → PartialOrder (α i)]
[(i : ι) → LocallyFiniteOrderBot (α i)]
(b : (i : ι) → α i)

(Finset.Iic b).card = ∏ i : ι, (Finset.Iic (b i)).card


theorem le_dioph : Dioph {v | f v ≤ g v}

{α : Type}
{f g : (α → ℕ) → ℕ}
(df : Dioph.DiophFn f)
(dg : Dioph.DiophFn g)


lemma eulerMascheroniSeq'_one : eulerMascheroniSeq' 1 = 1


protected theorem StrictAnti.ite' (hf : StrictAnti f) (hg : StrictAnti g) {p : α → Prop}
    [DecidablePred p]
    (hp : ∀ ⦃x y⦄, x < y → p y → p x) (hfg : ∀ ⦃x y⦄, p x → ¬p y → x < y → g y < f x) :
    StrictAnti fun x ↦ if p x then f x else g x

(hfg : ∀ ⦃x y : α⦄, p x → ¬p y → x < y → g y < f x)

StrictAnti fun x => if p x then f x else g x


theorem single_star [∀ i, AddMonoid (f i)] [∀ i, StarAddMonoid (f i)] [DecidableEq I] (i : I)
    (a : f i) : Pi.single i (star a) = star (Pi.single i a)

{I : Type u}
{f : I → Type v}
[(i : I) → AddMonoid (f i)]
[(i : I) → StarAddMonoid (f i)]
[DecidableEq I]
(i : I)
(a : f i)


@[simp]
theorem isOrtho_iSup_right {ι : Sort*} {U : Submodule 𝕜 E} {V : ι → Submodule 𝕜 E} :
    U ⟂ iSup V ↔ ∀ i, U ⟂ V i

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Sort u_4}
{U : Submodule 𝕜 E}
{V : ι → Submodule 𝕜 E}


@[measurability]
theorem AEMeasurable.re (hf : AEMeasurable f μ) : AEMeasurable (fun x => RCLike.re (f x)) μ

{α : Type u_1}
{𝕜 : Type u_2}
[RCLike 𝕜]
{m : MeasurableSpace α}
{f : α → 𝕜}
{μ : MeasureTheory.Measure α}
(hf : AEMeasurable f μ)


@[simp] protected theorem le_refl (a : Fin n) : a ≤ a


theorem tendstoUniformlyOn_of_seq_tendstoUniformlyOn {l : Filter ι} [l.IsCountablyGenerated]
    (h : ∀ u : ℕ → ι, Tendsto u atTop l → TendstoUniformlyOn (fun n => F (u n)) f atTop s) :
    TendstoUniformlyOn F f l s

{F : ι → α → β}

(h : ∀ (u : ℕ → ι), Filter.Tendsto u Filter.atTop l → TendstoUniformlyOn (fun n => F (u n)) f Filter.atTop s)


theorem gauge_gaugeRescale' (s : Set E) {t : Set E} {x : E} (hx : gauge t x ≠ 0) :
    gauge t (gaugeRescale s t x) = gauge s x

{E : Type u_1}
[AddCommGroup E]
[Module ℝ E]
(s : Set E)
{t : Set E}
{x : E}
(hx : gauge t x ≠ 0)


/-- `val_v(I)` does not depend on the choice of `a` and `J` used to represent `I`. -/
theorem count_well_defined {I : FractionalIdeal R⁰ K} (hI : I ≠ 0) {a : R}
    {J : Ideal R} (h_aJ : I = spanSingleton R⁰ ((algebraMap R K) a)⁻¹ * ↑J) :
    count K v I = ((Associates.mk v.asIdeal).count (Associates.mk J).factors -
      (Associates.mk v.asIdeal).count (Associates.mk (Ideal.span {a})).factors : ℤ)

(v : IsDedekindDomain.HeightOneSpectrum R)

(h_aJ : I = FractionalIdeal.spanSingleton R⁰ ((algebraMap R K) a)⁻¹ * ↑J)

FractionalIdeal.count K v I =
  ↑((Associates.mk v.asIdeal).count (Associates.mk J).factors) -
    ↑((Associates.mk v.asIdeal).count (Associates.mk (Ideal.span {a})).factors)


theorem smul_top_eq_top_of_divisibleBy_int [DivisibleBy A ℤ] {n : ℤ} (hn : n ≠ 0) :
    n • (⊤ : AddSubgroup A) = ⊤

(A : Type u_1)
[AddCommGroup A]
[DivisibleBy A ℤ]
{n : ℤ}
(hn : n ≠ 0)


theorem snoc_comp_rev {α n} (a : α) (f : Fin n → α) :
    Fin.snoc f a ∘ Fin.rev = Fin.cons a (f ∘ Fin.rev)

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


theorem coe_of_mul_apply_of_not_le {i : ι} (r : A i) (r' : ⨁ i, A i) (n : ι) (h : ¬i ≤ n) :
    ((of (fun i => A i) i r * r') n : R) = 0

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

↑(((DirectSum.of (fun i => ↥(A i)) i) r * r') n) = 0


theorem le_seminormAux (k n : ℕ) (f : 𝓢(E, F)) (x : E) :
    ‖x‖ ^ k * ‖iteratedFDeriv ℝ n (⇑f) x‖ ≤ f.seminormAux k n

{E : Type u_4}
{F : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
(k n : ℕ)
(f : SchwartzMap E F)
(x : E)

‖x‖ ^ k * ‖iteratedFDeriv ℝ n (⇑f) x‖ ≤ SchwartzMap.seminormAux k n f


@[simp]
theorem finrank_bot : finrank R (⊥ : Submodule R M) = 0

(R : Type u)
(M : Type v)
[Ring R]
[AddCommGroup M]
[Module R M]
[Nontrivial R]


/-- Two finite-dimensional topological vector spaces over a complete normed field are continuously
linearly equivalent if they have the same (finite) dimension. -/
theorem FiniteDimensional.nonempty_continuousLinearEquiv_of_finrank_eq
    (cond : finrank 𝕜 E = finrank 𝕜 F) : Nonempty (E ≃L[𝕜] F)

(cond : FiniteDimensional.finrank 𝕜 E = FiniteDimensional.finrank 𝕜 F)


/-- If `M` and `M` are each other's inverse matrices, `Matrix.toLin M` and `Matrix.toLin M'`
form a linear equivalence. -/
@[simps]
def Matrix.toLinOfInv [DecidableEq m] {M : Matrix m n R} {M' : Matrix n m R} (hMM' : M * M' = 1)
    (hM'M : M' * M = 1) : M₁ ≃ₗ[R] M₂

{R : Type u_1}
[CommSemiring R]
{m : Type u_3}
{n : Type u_4}
[Fintype n]
[Fintype m]
[DecidableEq n]
{M₁ : Type u_5}
{M₂ : Type u_6}
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[Module R M₁]
[Module R M₂]
(v₁ : Basis n R M₁)
(v₂ : Basis m R M₂)
[DecidableEq m]
{M : Matrix m n R}
{M' : Matrix n m R}
(hMM' : M * M' = 1)
(hM'M : M' * M = 1)
(a : M₁)

(Matrix.toLinOfInv v₁ v₂ hMM' hM'M) a = ((Matrix.toLin v₁ v₂) M) a


theorem neg_coeff {x : HahnSeries Γ R} {a : Γ} : (-x).coeff a = -x.coeff a

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[AddGroup R]
{x : HahnSeries Γ R}
{a : Γ}


protected lemma GrowsPolynomially.div {f g : ℝ → ℝ} (hf : GrowsPolynomially f)
    (hg : GrowsPolynomially g) : GrowsPolynomially fun x => f x / g x

(hf : AkraBazziRecurrence.GrowsPolynomially f)

(hg : AkraBazziRecurrence.GrowsPolynomially g)

AkraBazziRecurrence.GrowsPolynomially fun x => f x / g x


lemma leftpad_prefix (n : ℕ) (c : Char) : ∀ s, IsPrefix (replicate (n - length s) c) (leftpad n c s)

(String.replicate (n - s.length) c).IsPrefix (String.leftpad n c s)


/-- A weakly regular sequence `rs` on `M` is regular if also `M/rsM ≠ 0`. -/
@[mk_iff]
structure IsRegular (rs : List R) extends IsWeaklyRegular M rs : Prop where
  top_ne_smul : (⊤ : Submodule R M) ≠ Ideal.ofList rs • ⊤

(self : RingTheory.Sequence.IsRegular M rs)


@[simp]
theorem coe_restrictScalarsIsometry :
    ⇑(restrictScalarsIsometry 𝕜 E Fₗ 𝕜' 𝕜'') = restrictScalars 𝕜'

(𝕜 : Type u_1)
(E : Type u_4)
(Fₗ : Type u_7)
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup Fₗ]
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 Fₗ]
(𝕜' : Type u_11)
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜' 𝕜]
[NormedSpace 𝕜' E]
[IsScalarTower 𝕜' 𝕜 E]
[NormedSpace 𝕜' Fₗ]
[IsScalarTower 𝕜' 𝕜 Fₗ]
{𝕜'' : Type u_12}
[Ring 𝕜'']
[Module 𝕜'' Fₗ]
[ContinuousConstSMul 𝕜'' Fₗ]
[SMulCommClass 𝕜 𝕜'' Fₗ]
[SMulCommClass 𝕜' 𝕜'' Fₗ]

⇑(ContinuousLinearMap.restrictScalarsIsometry 𝕜 E Fₗ 𝕜' 𝕜'') = ContinuousLinearMap.restrictScalars 𝕜'


theorem injOn_natAbs_Iic : InjOn natAbs (Iic 0)


@[to_additive]
theorem one_eq_mk [One M] [One N] : (1 : M × N) = (1, 1)

{M : Type u_5}
{N : Type u_6}
[Zero M]
[Zero N]


@[to_additive]
theorem toFreeSemigroup_comp_map (f : α → β) :
    toFreeSemigroup.comp (map f) = (FreeSemigroup.map f).comp toFreeSemigroup

FreeAddMagma.toFreeAddSemigroup.comp (FreeAddMagma.map f) =
  (FreeAddSemigroup.map f).comp FreeAddMagma.toFreeAddSemigroup


theorem map_swap [DecidableEq ι] {i j : ι} (hij : i ≠ j) : g (v ∘ Equiv.swap i j) = -g v

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N' : Type u_6}
[AddCommGroup N']
[Module R N']
{ι : Type u_7}
(g : M [⋀^ι]→ₗ[R] N')
(v : ι → M)
[DecidableEq ι]
{i j : ι}
(hij : i ≠ j)


@[to_additive]
theorem le_one_of_mul_le_right [ContravariantClass α α (· * ·) (· ≤ ·)] {a b : α} (h : a * b ≤ a) :
    b ≤ 1

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


@[simp]
theorem mk_toNat_of_infinite [h : Infinite α] : toNat #α = 0


/-- Given `R`-module X and `S`-module Y, any `g : (restrictScalars f).obj Y ⟶ X`
corresponds to `Y ⟶ (coextendScalars f).obj X` by sending `y ↦ (s ↦ g (s • y))`
-/
@[simps apply_apply]
def HomEquiv.fromRestriction {X : ModuleCat R} {Y : ModuleCat S}
    (g : (restrictScalars f).obj Y ⟶ X) : Y ⟶ (coextendScalars f).obj X

(g : (ModuleCat.restrictScalars f).obj Y ⟶ X)

((ModuleCat.RestrictionCoextensionAdj.HomEquiv.fromRestriction f g) y) s = g (s • y)


@[simp]
theorem one_lt_mersenne {p : ℕ} : 1 < mersenne p ↔ 1 < p


@[simp, norm_cast]
theorem natCast_im (n : ℕ) : (n : ℍ[R,c₁,c₂]).im = 0

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


/-- The universal property of the tensor product of algebras.

Pairs of algebra morphisms that commute are equivalent to algebra morphisms from the tensor product.

This is `Algebra.TensorProduct.lift` as an equivalence.

See also `GradedTensorProduct.liftEquiv` for an alternative commutativity requirement for graded
algebra. -/
@[simps]
def liftEquiv : {fg : (A →ₐ[S] C) × (B →ₐ[R] C) // ∀ x y, Commute (fg.1 x) (fg.2 y)}
    ≃ ((A ⊗[R] B) →ₐ[S] C)

(fg : { fg // ∀ (x : A) (y : B), Commute (fg.1 x) (fg.2 y) })

Algebra.TensorProduct.liftEquiv fg = Algebra.TensorProduct.lift (↑fg).1 (↑fg).2 ⋯


/-- A category `IsFilteredOrEmpty` if
1. for every pair of objects there exists another object "to the right", and
2. for every pair of parallel morphisms there exists a morphism to the right so the compositions
   are equal.
-/
class IsFilteredOrEmpty : Prop where
  /-- for every pair of objects there exists another object "to the right" -/
  cocone_objs : ∀ X Y : C, ∃ (Z : _) (_ : X ⟶ Z) (_ : Y ⟶ Z), True
  /-- for every pair of parallel morphisms there exists a morphism to the right
    so the compositions are equal -/
  cocone_maps : ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), ∃ (Z : _) (h : Y ⟶ Z), f ≫ h = g ≫ h

[self : CategoryTheory.IsFilteredOrEmpty C]


/-- The ring equiv between the top element of `NonUnitalSubring R` and `R`. -/
@[simps!]
def topEquiv : (⊤ : NonUnitalSubring R) ≃+* R

{R : Type u}
[NonUnitalNonAssocRing R]
(x : R)


theorem comap_boundedBy {β} (f : β → α)
    (h : (Monotone fun s : { s : Set α // s.Nonempty } => m s) ∨ Surjective f) :
    comap f (boundedBy m) = boundedBy fun s => m (f '' s)

(h : (Monotone fun s => m ↑s) ∨ Function.Surjective f)

(MeasureTheory.OuterMeasure.comap f) (MeasureTheory.OuterMeasure.boundedBy m) =
  MeasureTheory.OuterMeasure.boundedBy fun s => m (f '' s)


theorem const_smul [SMul 𝕜 β] [ContinuousConstSMul 𝕜 β] (c : 𝕜) (hf : AEStronglyMeasurable' m f μ) :
    AEStronglyMeasurable' m (c • f) μ

(hf : MeasureTheory.AEStronglyMeasurable' m f μ)

MeasureTheory.AEStronglyMeasurable' m (c • f) μ


theorem mk_surjective : Function.Surjective (mk K p)

(K : Type u)
[CommRing K]
(p : ℕ)
[Fact (Nat.Prime p)]
[CharP K p]

Function.Surjective (PerfectClosure.mk K p)


theorem coeff_le_of_roots_le {p : F[X]} {f : F →+* K} {B : ℝ} (i : ℕ) (h1 : p.Monic)
    (h2 : Splits f p) (h3 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) :
    ‖(map f p).coeff i‖ ≤ B ^ (p.natDegree - i) * p.natDegree.choose i

(h3 : ∀ z ∈ (Polynomial.map f p).roots, ‖z‖ ≤ B)

‖(Polynomial.map f p).coeff i‖ ≤ B ^ (p.natDegree - i) * ↑(p.natDegree.choose i)


theorem properDivisors_eq_singleton_one_iff_prime : n.properDivisors = {1} ↔ n.Prime


theorem getD_leftInvSeq (ω : List B) (j : ℕ) :
    (lis ω).getD j 1 =
      π (ω.take j)
        * (Option.map (cs.simple) (ω.get? j)).getD 1
        * (π (ω.take j))⁻¹

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

(cs.leftInvSeq ω).getD j 1 =
  cs.wordProd (List.take j ω) * (Option.map cs.simple (ω.get? j)).getD 1 * (cs.wordProd (List.take j ω))⁻¹


theorem squarefree_iff_multiplicity_le_one (r : R) :
    Squarefree r ↔ ∀ x : R, multiplicity x r ≤ 1 ∨ IsUnit x

{R : Type u_1}
[CommMonoid R]
[DecidableRel Dvd.dvd]
(r : R)

Squarefree r ↔ ∀ (x : R), multiplicity x r ≤ 1 ∨ IsUnit x


@[simp]
theorem zeroLocus_radical (I : Ideal R) : zeroLocus (I.radical : Set R) = zeroLocus I

{R : Type u}
[CommSemiring R]
(I : Ideal R)

PrimeSpectrum.zeroLocus ↑I.radical = PrimeSpectrum.zeroLocus ↑I


@[to_additive]
theorem toSubmonoid_injective : Function.Injective (toSubmonoid : Subgroup G → Submonoid G)


theorem kreplace_of_forall_not (a : α) (b : β a) {l : List (Sigma β)}
    (H : ∀ b : β a, Sigma.mk a b ∉ l) : kreplace a b l = l

{α : Type u}
{β : α → Type v}
[DecidableEq α]
(a : α)
(b : β a)
{l : List (Sigma β)}
(H : ∀ (b : β a), ⟨a, b⟩ ∉ l)


@[reassoc (attr := simp)]
theorem inv_naturality {U V : (Opens X)ᵒᵖ} (i : U ⟶ V) :
    X.presheaf.map i ≫ H.invApp (unop V) =
      H.invApp (unop U) ≫ Y.presheaf.map (opensFunctor f |>.op.map i)

{X Y : AlgebraicGeometry.SheafedSpace C}

[H : AlgebraicGeometry.SheafedSpace.IsOpenImmersion f]

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

X.presheaf.map i ≫ AlgebraicGeometry.SheafedSpace.IsOpenImmersion.invApp f (Opposite.unop V) =
  AlgebraicGeometry.SheafedSpace.IsOpenImmersion.invApp f (Opposite.unop U) ≫
    Y.presheaf.map ((AlgebraicGeometry.SheafedSpace.IsOpenImmersion.opensFunctor f).op.map i)


theorem IsOption.mk_right {xl xr : Type u} (xL : xl → PGame) (xR : xr → PGame) (i : xr) :
    (xR i).IsOption (mk xl xr xL xR)

{xl xr : Type u}
(xL : xl → SetTheory.PGame)
(xR : xr → SetTheory.PGame)
(i : xr)

(xR i).IsOption (SetTheory.PGame.mk xl xr xL xR)


@[reassoc]
theorem PreservesPushout.inl_iso_hom :
    pushout.inl _ _ ≫ (PreservesPushout.iso G f g).hom = G.map (pushout.inl _ _)

[CategoryTheory.Limits.PreservesColimit (CategoryTheory.Limits.span f g) G]

[CategoryTheory.Limits.HasPushout (G.map f) (G.map g)]

CategoryTheory.Limits.pushout.inl (G.map f) (G.map g) ≫ (CategoryTheory.Limits.PreservesPushout.iso G f g).hom =
  G.map (CategoryTheory.Limits.pushout.inl f g)


@[simp]
theorem lineMap_eq_left_iff [NoZeroSMulDivisors k V1] {p₀ p₁ : P1} {c : k} :
    lineMap p₀ p₁ c = p₀ ↔ p₀ = p₁ ∨ c = 0

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
[NoZeroSMulDivisors k V1]
{p₀ p₁ : P1}
{c : k}

(AffineMap.lineMap p₀ p₁) c = p₀ ↔ p₀ = p₁ ∨ c = 0


/-- The structure map of the initial algebra is an isomorphism,
hence endofunctors preserve their initial algebras
-/
theorem str_isIso (h : Limits.IsInitial A) : IsIso A.str

{A : CategoryTheory.Endofunctor.Algebra F}


theorem finrank_hom_simple_simple (X Y : C) [∀ X Y : C, FiniteDimensional 𝕜 (X ⟶ Y)] [Simple X]
    [Simple Y] : finrank 𝕜 (X ⟶ Y) = if Nonempty (X ≅ Y) then 1 else 0

[∀ (X Y : C), FiniteDimensional 𝕜 (X ⟶ Y)]

FiniteDimensional.finrank 𝕜 (X ⟶ Y) = if Nonempty (X ≅ Y) then 1 else 0


@[simp]
theorem inner_rightAngleRotation_left (x y : E) : ⟪J x, y⟫ = ω x y

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

⟪o.rightAngleRotation x, y⟫_ℝ = (o.areaForm x) y


theorem coe_injective : Function.Injective ((↑) : RatFunc F → LaurentSeries F)


theorem restrict_ofFunction (s : Set α) (hm : Monotone m) :
    restrict s (OuterMeasure.ofFunction m m_empty) =
      OuterMeasure.ofFunction (fun t => m (t ∩ s)) (by simp; simp [m_empty])

{α : Type u_1}
{m : Set α → ℝ≥0∞}
{m_empty : m ∅ = 0}
(s : Set α)
(hm : Monotone m)

(MeasureTheory.OuterMeasure.restrict s) (MeasureTheory.OuterMeasure.ofFunction m m_empty) =
  MeasureTheory.OuterMeasure.ofFunction (fun t => m (t ∩ s)) ⋯


theorem finset_sup_mul {α} (s : Finset α) (f : α → ℝ≥0) (r : ℝ≥0) :
    s.sup f * r = s.sup fun a => f a * r

{α : Type u_1}
(s : Finset α)
(f : α → ℝ≥0)
(r : ℝ≥0)


@[ext]
theorem ext (H : ∀ a, D1 a = D2 a) : D1 = D2

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
{D1 D2 : LieDerivation R L M}
(H : ∀ (a : L), D1 a = D2 a)


/-- The category of cones on `F` is just the comma category `(Δ ↓ F)`, where `Δ` is the constant
    functor. -/
@[simps! (config := { notRecursive := [`PLift, `ULift] })]
def Cone.equivCostructuredArrow (F : J ⥤ C) : Cone F ≌ CostructuredArrow (const J) F

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

∀ {X Y : CategoryTheory.Limits.Cone F} (f : X ⟶ Y),
  ((CategoryTheory.Limits.Cone.equivCostructuredArrow F).functor.map f).left = f.hom


lemma measurable_toRatCDF (hf : Measurable f) : Measurable (toRatCDF f)

{α : Type u_1}
[MeasurableSpace α]
{f : α → ℚ → ℝ}
(hf : Measurable f)


@[simp]
theorem toSubtype_of_subtype_assoc
    {α β : TypeVec n} (p : α ⟹ «repeat» n Prop) (f : β ⟹ Subtype_ p) :
    @toSubtype n _ p ⊚ ofSubtype _ ⊚ f = f

{n : ℕ}
{α : TypeVec.{u_1} n}
{β : TypeVec.{u_2} n}
(p : α.Arrow (TypeVec.repeat n Prop))
(f : β.Arrow (TypeVec.Subtype_ p))

TypeVec.comp (TypeVec.toSubtype p) (TypeVec.comp (TypeVec.ofSubtype p) f) = f


theorem basicOpen_eq_of_affine {R : CommRingCat} (f : R) :
    (Spec R).basicOpen ((Scheme.ΓSpecIso R).inv f) = PrimeSpectrum.basicOpen f

(AlgebraicGeometry.Spec R).basicOpen ((AlgebraicGeometry.Scheme.ΓSpecIso R).inv f) = PrimeSpectrum.basicOpen f


theorem condexp_stopping_time_ae_eq_restrict_eq_const
    [(Filter.atTop : Filter ι).IsCountablyGenerated] (h : Martingale f ℱ μ)
    (hτ : IsStoppingTime ℱ τ) [SigmaFinite (μ.trim hτ.measurableSpace_le)] (hin : i ≤ n) :
    μ[f n|hτ.measurableSpace] =ᵐ[μ.restrict {x | τ x = i}] f i


theorem Additive.isNormalAddSubgroup [Group G] {s : Set G} (hs : IsNormalSubgroup s) :
    @IsNormalAddSubgroup (Additive G) _ s

{G : Type u_1}
[Group G]
{s : Set G}
(hs : IsNormalSubgroup s)


theorem Monotone.piecewise_eventually_eq_iUnion {β : α → Type*} [Preorder ι] {s : ι → Set α}
    [∀ i, DecidablePred (· ∈ s i)] [DecidablePred (· ∈ ⋃ i, s i)]
    (hs : Monotone s) (f g : (a : α) → β a) (a : α) :
    ∀ᶠ i in atTop, (s i).piecewise f g a = (⋃ i, s i).piecewise f g a

[(i : ι) → DecidablePred fun x => x ∈ s i]

∀ᶠ (i : ι) in Filter.atTop, (s i).piecewise f g a = (⋃ i, s i).piecewise f g a


/-- In a semigroup, the product of regular elements is regular. -/
@[to_additive "In an additive semigroup, the sum of add-regular elements is add-regular."]
theorem IsRegular.mul (rra : IsRegular a) (rrb : IsRegular b) :
    IsRegular (a * b)

{R : Type u_1}
[Semigroup R]
{a b : R}
(rra : IsRegular a)
(rrb : IsRegular b)


/-- An ordered cancellative commutative monoid is a partially ordered commutative monoid in which
multiplication is cancellative and monotone. -/
@[to_additive OrderedCancelAddCommMonoid]
class OrderedCancelCommMonoid (α : Type*) extends OrderedCommMonoid α where
  protected le_of_mul_le_mul_left : ∀ a b c : α, a * b ≤ a * c → b ≤ c

{α : Type u_3}
[self : OrderedCancelCommMonoid α]
(a b c : α)


@[simp]
theorem comm_trans_lTensorBot :
    (Algebra.TensorProduct.comm R _ _).trans A.lTensorBot = A.rTensorBot

{R : Type u}
{S : Type v}
[CommSemiring R]
[Semiring S]
[Algebra R S]
(A : Subalgebra R S)

(Algebra.TensorProduct.comm R ↥A ↥⊥).trans A.lTensorBot = A.rTensorBot


/-- The length of the String returned by `String.leftpad n a c` is equal
  to the larger of `n` and `s.length` -/
@[simp] lemma leftpad_length (n : ℕ) (c : Char) :
    ∀ (s : String), (leftpad n c s).length = max n s.length

(String.leftpad n c s).length = max n s.length


@[to_additive mem_approx_add_orderOf_iff]
theorem mem_approxOrderOf_iff {A : Type*} [SeminormedGroup A] {n : ℕ} {δ : ℝ} {a : A} :
    a ∈ approxOrderOf A n δ ↔ ∃ b : A, orderOf b = n ∧ a ∈ ball b δ

{A : Type u_1}
[SeminormedAddGroup A]
{n : ℕ}
{δ : ℝ}
{a : A}

a ∈ approxAddOrderOf A n δ ↔ ∃ b, addOrderOf b = n ∧ a ∈ Metric.ball b δ


theorem const (s : σ) : Computable fun _ : α => s

{α : Type u_1}
{σ : Type u_4}
[Primcodable α]
[Primcodable σ]
(s : σ)


@[simp]
theorem sinh_le_self_iff : sinh x ≤ x ↔ x ≤ 0


@[simp]
theorem factorial_eq_one : n ! = 1 ↔ n ≤ 1


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

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


/-- A morphism is separated if the diagonal map is a closed immersion. -/
@[mk_iff]
class IsSeparated : Prop where
  /-- A morphism is separated if the diagonal map is a closed immersion. -/
  diagonal_isClosedImmersion : IsClosedImmersion (pullback.diagonal f) := by infer_instance

[self : AlgebraicGeometry.IsSeparated f]


lemma overEquiv_symm_mem_over {X : C} (Y : Over X) (S : Sieve Y.left) (hS : S ∈ J Y.left) :
    (Sieve.overEquiv Y).symm S ∈ (J.over X) Y

(J : CategoryTheory.GrothendieckTopology C)

(CategoryTheory.Sieve.overEquiv Y).symm S ∈ (J.over X).sieves Y


theorem truncateFun_surjective : Surjective (@truncateFun p n R)


@[simp] lemma find_le_iff (h : ∃ n : ℕ, p n) (n : ℕ) : Nat.find h ≤ n ↔ ∃ m ≤ n, p m

{p : ℕ → Prop}
[DecidablePred p]
(h : ∃ n, p n)
(n : ℕ)


theorem gradedComm_one_tmul (b : ⨁ i, ℬ i) : gradedComm R 𝒜 ℬ (1 ⊗ₜ b) = b ⊗ₜ 1

(R : Type u_1)
{ι : Type u_2}
[CommSemiring ι]
[Module ι (Additive ℤˣ)]
[DecidableEq ι]
(𝒜 : ι → Type u_5)
(ℬ : ι → Type u_6)
[CommRing R]
[(i : ι) → AddCommGroup (𝒜 i)]
[(i : ι) → AddCommGroup (ℬ i)]
[(i : ι) → Module R (𝒜 i)]
[(i : ι) → Module R (ℬ i)]
[DirectSum.GRing 𝒜]
[DirectSum.GRing ℬ]
[DirectSum.GAlgebra R 𝒜]
[DirectSum.GAlgebra R ℬ]
(b : ⨁ (i : ι), ℬ i)

(TensorProduct.gradedComm R 𝒜 ℬ) (1 ⊗ₜ[R] b) = b ⊗ₜ[R] 1


/-- If a functor `R : D ⥤ C` is a right adjoint, it is final. -/
theorem final_of_adjunction {L : C ⥤ D} {R : D ⥤ C} (adj : L ⊣ R) : Final R

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{L : CategoryTheory.Functor C D}
{R : CategoryTheory.Functor D C}
(adj : L ⊣ R)


@[simp, norm_cast] lemma coe_bot [Bot α] : ((⊥ : α) : WithTop α) = ⊥


theorem pi_Ioc_mem_nhds' (ha : ∀ i, a' i < x' i) (hb : ∀ i, x' i < b' i) : Ioc a' b' ∈ 𝓝 x'

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{ι : Type u_1}
[Finite ι]
{a' b' x' : ι → α}
[Nonempty ι]
(ha : ∀ (i : ι), a' i < x' i)
(hb : ∀ (i : ι), x' i < b' i)


/-- The restriction of a symmetric bilinear form on a submodule is also symmetric. -/
theorem restrict {B : BilinForm R M} (b : B.IsSymm) (W : Submodule R M) :
    (B.restrict W).IsSymm

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{B : LinearMap.BilinForm R M}
(b : B.IsSymm)
(W : Submodule R M)


/-- Pi-types are measurably equivalent to iterated products. -/
@[simps! (config := .asFn)]
def piMeasurableEquivTProd [DecidableEq δ'] {l : List δ'} (hnd : l.Nodup) (h : ∀ i, i ∈ l) :
    (∀ i, π i) ≃ᵐ List.TProd π l

{δ' : Type u_5}
{π : δ' → Type u_6}
[(x : δ') → MeasurableSpace (π x)]
[DecidableEq δ']
{l : List δ'}
(hnd : l.Nodup)
(h : ∀ (i : δ'), i ∈ l)

⇑(MeasurableEquiv.piMeasurableEquivTProd hnd h).symm = List.TProd.elim' h


/-- The `i`-th sublist in the splitting of a list `l` along a composition `c`, is the slice of `l`
between the indices `c.sizeUpTo i` and `c.sizeUpTo (i+1)`, i.e., the indices in the `i`-th
block of the composition. -/
theorem getElem_splitWrtComposition' (l : List α) (c : Composition n) {i : ℕ}
    (hi : i < (l.splitWrtComposition c).length) :
    (l.splitWrtComposition c)[i] = (l.take (c.sizeUpTo (i + 1))).drop (c.sizeUpTo i)

(l.splitWrtComposition c)[i] = List.drop (c.sizeUpTo i) (List.take (c.sizeUpTo (i + 1)) l)


theorem cardDistinctFactors_eq_cardFactors_iff_squarefree {n : ℕ} (h0 : n ≠ 0) :
    ω n = Ω n ↔ Squarefree n

ArithmeticFunction.cardDistinctFactors n = ArithmeticFunction.cardFactors n ↔ Squarefree n


@[simp]
theorem realize_foldr_inf (l : List (L.BoundedFormula α n)) (v : α → M) (xs : Fin n → M) :
    (l.foldr (· ⊓ ·) ⊤).Realize v xs ↔ ∀ φ ∈ l, BoundedFormula.Realize φ v xs

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{n : ℕ}
(l : List (L.BoundedFormula α n))
(v : α → M)
(xs : Fin n → M)

(List.foldr (fun x x_1 => x ⊓ x_1) ⊤ l).Realize v xs ↔ ∀ φ ∈ l, φ.Realize v xs


theorem RCLike.norm_coe_norm {z : E} : ‖(‖z‖ : 𝕜)‖ = ‖z‖

{𝕜 : Type u_1}
[RCLike 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
{z : E}

‖↑‖z‖‖ = ‖z‖


theorem mem_prod_eq : (p ∈ s ×ˢ t) = (p.1 ∈ s ∧ p.2 ∈ t)

{α : Type u}
{β : Type v}
{s : Set α}
{t : Set β}
{p : α × β}


theorem appendFun_inj {α α' : TypeVec n} {β β' : Type*} {f f' : α ⟹ α'} {g g' : β → β'} :
    (f ::: g : (α ::: β) ⟹ _) = (f' ::: g' : (α ::: β) ⟹ _)
    → f = f' ∧ g = g'

{n : ℕ}
{α : TypeVec.{u_1} n}
{α' : TypeVec.{u_2} n}
{β : Type u_1}
{β' : Type u_2}
{f f' : α.Arrow α'}
{g g' : β → β'}


@[simp]
lemma _root_.absorbs_zero_iff [NeBot (cobounded G₀)] {E : Type*} [AddMonoid E]
    [DistribMulAction G₀ E] {s : Set E} : Absorbs G₀ s 0 ↔ 0 ∈ s

{G₀ : Type u_1}
[GroupWithZero G₀]
[Bornology G₀]
[(Bornology.cobounded G₀).NeBot]
{E : Type u_3}
[AddMonoid E]
[DistribMulAction G₀ E]
{s : Set E}


theorem isCountablyGenerated_seq [Countable ι'] (x : ι' → Set α) :
    IsCountablyGenerated (⨅ i, 𝓟 (x i))

{α : Type u_1}
{ι' : Sort u_5}
[Countable ι']
(x : ι' → Set α)


theorem lift_mrange_le {N} [Monoid N] (f : ∀ i, M i →* N) {s : Submonoid N} :
    MonoidHom.mrange (lift f) ≤ s ↔ ∀ i, MonoidHom.mrange (f i) ≤ s

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
{N : Type u_4}
[Monoid N]
(f : (i : ι) → M i →* N)
{s : Submonoid N}

MonoidHom.mrange (Monoid.CoprodI.lift f) ≤ s ↔ ∀ (i : ι), MonoidHom.mrange (f i) ≤ s


/-- The main chunk of Theorem 8 in [Conway2001] / Theorem 3.8 in [SchleicherStoll]. -/
theorem main (a : Args) : a.Numeric → P124 a

a.Numeric → Surreal.Multiplication.P124 a


theorem Ico_image_const_sub_eq_Ico (hac : a ≤ c) :
    ((Ico a b).image fun x => c - x) = Ico (c + 1 - b) (c + 1 - a)

Finset.image (fun x => c - x) (Finset.Ico a b) = Finset.Ico (c + 1 - b) (c + 1 - a)


/-- A compact set in a pseudo emetric space is separable, i.e., it is a subset of the closure of a
countable set.  -/
theorem subset_countable_closure_of_compact {s : Set α} (hs : IsCompact s) :
    ∃ t, t ⊆ s ∧ t.Countable ∧ s ⊆ closure t

{α : Type u}
[PseudoEMetricSpace α]
{s : Set α}
(hs : IsCompact s)


/-- `MulAction.toPerm` is injective on faithful actions. -/
@[to_additive "`AddAction.toPerm` is injective on faithful actions."]
lemma MulAction.toPerm_injective [FaithfulSMul α β] :
    Function.Injective (MulAction.toPerm : α → Equiv.Perm β)

{α : Type u_1}
{β : Type u_2}
[AddGroup α]
[AddAction α β]
[FaithfulVAdd α β]


/-- Product of two continuous homomorphisms on the same space. -/
@[to_additive (attr := simps!) "Product of two continuous homomorphisms on the same space."]
def prod (f : ContinuousMonoidHom A B) (g : ContinuousMonoidHom A C) :
    ContinuousMonoidHom A (B × C)

{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
[AddMonoid A]
[AddMonoid B]
[AddMonoid C]
[TopologicalSpace A]
[TopologicalSpace B]
[TopologicalSpace C]
(f : ContinuousAddMonoidHom A B)
(g : ContinuousAddMonoidHom A C)
(i : A)

(f.sum g) i = (f.toAddMonoidHom i, g.toAddMonoidHom i)


theorem ite_dite_distrib_right {a : q → α} {b : ¬q → α} {c : α} :
    ite p (dite q a b) c = dite q (fun hq ↦ ite p (a hq) c) fun hq ↦ ite p (b hq) c

{α : Sort u_1}
{p q : Prop}
[Decidable p]
[Decidable q]
{a : q → α}
{b : ¬q → α}
{c : α}

(if p then dite q a b else c) = if hq : q then if p then a hq else c else if p then b hq else c


lemma SurjectiveOnStalks.baseChange
    (hf : (algebraMap R T).SurjectiveOnStalks) :
    (algebraMap S (S ⊗[R] T)).SurjectiveOnStalks

(algebraMap S (TensorProduct R S T)).SurjectiveOnStalks


@[simp]
theorem map_iSup {f : ι → Filter α} : map m (⨆ i, f i) = ⨆ i, map m (f i)

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

Filter.map m (⨆ i, f i) = ⨆ i, Filter.map m (f i)


theorem map_toDual (f : αᵒᵈ → βᵒᵈ) (a : WithBot α) :
    map f (WithBot.toDual a) = a.map (toDual ∘ f)

{α : Type u_1}
{β : Type u_2}
(f : αᵒᵈ → βᵒᵈ)
(a : WithBot α)

WithTop.map f (WithBot.toDual a) = WithBot.map (⇑OrderDual.toDual ∘ f) a


@[simp]
theorem union_idempotent (s : Finset α) : s ∪ s = s

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


/-- The equivalence of categories
`(Φ.LeftResolution X₂)ᵒᵖ ≌ Φ.op.RightResolution (Opposite.op X₂)`. -/
@[simps]
def LeftResolution.opEquivalence (X₂ : C₂) [W₁.IsMultiplicative] :
    (Φ.LeftResolution X₂)ᵒᵖ ≌ Φ.op.RightResolution (Opposite.op X₂)

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

(Φ : CategoryTheory.LocalizerMorphism W₁ W₂)

(CategoryTheory.LocalizerMorphism.LeftResolution.opEquivalence Φ X₂).functor =
  CategoryTheory.LocalizerMorphism.LeftResolution.opFunctor Φ X₂


@[simp]
theorem Finset.univ_disjSum_univ {α β : Type*} [Fintype α] [Fintype β] :
    univ.disjSum univ = (univ : Finset (α ⊕ β))

{α : Type u_3}
{β : Type u_4}
[Fintype α]
[Fintype β]

Finset.univ.disjSum Finset.univ = Finset.univ


theorem comap_codRestrict (p : Submodule R M) (f : M₂ →ₛₗ[σ₂₁] M) (hf p') :
    Submodule.comap (codRestrict p f hf) p' = Submodule.comap f (map p.subtype p')

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Semiring R₂]
[AddCommMonoid M₂]
[Module R₂ M₂]
{σ₂₁ : R₂ →+* R}
(p : Submodule R M)
(f : M₂ →ₛₗ[σ₂₁] M)
(hf : ∀ (c : M₂), f c ∈ p)
(p' : Submodule R ↥p)

Submodule.comap (LinearMap.codRestrict p f hf) p' = Submodule.comap f (Submodule.map p.subtype p')


@[measurability, fun_prop]
lemma _root_.Measurable.ennreal_log {α : Type*} {_ : MeasurableSpace α}
    {f : α → ℝ≥0∞} (hf : Measurable f) :
    Measurable fun x ↦ log (f x)

∀ {x : MeasurableSpace α} {f : α → ℝ≥0∞}, Measurable f → Measurable fun x => (f x).log


theorem prod_dist_eq_card (f g : WithLp 0 (α × β)) : dist f g =
    (if dist f.fst g.fst = 0 then 0 else 1) + (if dist f.snd g.snd = 0 then 0 else 1)

{α : Type u_2}
{β : Type u_3}
[Dist α]
[Dist β]
(f g : WithLp 0 (α × β))

dist f g = (if dist f.1 g.1 = 0 then 0 else 1) + if dist f.2 g.2 = 0 then 0 else 1


@[simp]
theorem toIntLinearEquiv_refl : (AddEquiv.refl M).toIntLinearEquiv = LinearEquiv.refl ℤ M


@[simp]
theorem toReal_bot : toReal ⊥ = 0


@[simp]
theorem mapQ_zero (h : p ≤ q.comap (0 : M →ₛₗ[τ₁₂] M₂) := (by simp)) :
    p.mapQ q (0 : M →ₛₗ[τ₁₂] M₂) h = 0

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
(p : Submodule R M)
{R₂ : Type u_3}
{M₂ : Type u_4}
[Ring R₂]
[AddCommGroup M₂]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
(q : Submodule R₂ M₂)
(h : p ≤ Submodule.comap 0 q := ⋯)


@[simp]
theorem mem_coe : a ∈ (s : Multiset α) ↔ a ∈ s

{α : Type u_1}
{n : ℕ}
{s : Sym α n}
{a : α}

a ∈ ↑s ↔ a ∈ s


theorem nhdsWithin_Ici_basis' [TopologicalSpace α] [LinearOrder α] [OrderTopology α] {a : α}
    (ha : ∃ u, a < u) : (𝓝[≥] a).HasBasis (fun u => a < u) fun u => Ico a u

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{a : α}
(ha : ∃ u, a < u)

(𝓝[≥] a).HasBasis (fun u => a < u) fun u => Set.Ico a u


@[simp]
theorem lookup_empty (a) : lookup a (∅ : AList β) = none

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


@[to_additive]
lemma mem_ofUnits_iff_exists_isUnit (S : Subgroup Mˣ) (x : M) :
    x ∈ S.ofUnits ↔ ∃ h : IsUnit x, h.unit ∈ S

{M : Type u_1}
[AddMonoid M]
(S : AddSubgroup (AddUnits M))
(x : M)

x ∈ S.ofAddUnits ↔ ∃ (h : IsAddUnit x), h.addUnit ∈ S


theorem vanishingIdeal_empty : vanishingIdeal (∅ : Set (σ → k)) = ⊤


/-- `invertibleOfInvertibleMul` and `invertibleMul` as an equivalence. -/
@[simps apply symm_apply]
def Invertible.mulLeft {a : α} (_ : Invertible a) (b : α) : Invertible b ≃ Invertible (a * b)

∀ (x : Invertible a) (b : α) (x_1 : Invertible (a * b)), (x.mulLeft b).symm x_1 = invertibleOfInvertibleMul a b


@[simp]
theorem disjoint_iUnion_right {ι : Sort*} {s : ι → Set α} :
    Disjoint t (⋃ i, s i) ↔ ∀ i, Disjoint t (s i)

{α : Type u_1}
{t : Set α}
{ι : Sort u_11}
{s : ι → Set α}

Disjoint t (⋃ i, s i) ↔ ∀ (i : ι), Disjoint t (s i)


@[to_additive]
lemma fn_max_mul_fn_min (f : α → β) (a b : α) : f (max a b) * f (min a b) = f a * f b

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[AddCommSemigroup β]
(f : α → β)
(a b : α)


protected theorem mul_end {f g : Function.End α} (hf : LocallyLipschitz f)
    (hg : LocallyLipschitz g) : LocallyLipschitz (f * g : Function.End α)

{α : Type u}
[PseudoEMetricSpace α]
{f g : Function.End α}
(hf : LocallyLipschitz f)
(hg : LocallyLipschitz g)


/-- An invariant σ-finite measure is absolutely continuous with respect to a Haar measure in a
second countable group. -/
@[to_additive
"An invariant measure is absolutely continuous with respect to an additive Haar measure. "]
theorem absolutelyContinuous_isHaarMeasure [LocallyCompactSpace G]
    [SecondCountableTopology G] (μ ν : Measure G)
    [SigmaFinite μ] [IsMulLeftInvariant μ] [IsHaarMeasure ν] : μ ≪ ν

{G : Type u_1}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
[MeasurableSpace G]
[BorelSpace G]
[LocallyCompactSpace G]
[SecondCountableTopology G]
(μ ν : MeasureTheory.Measure G)
[MeasureTheory.SigmaFinite μ]
[μ.IsMulLeftInvariant]
[ν.IsHaarMeasure]


theorem le_iff_disjoint_sdiff (hz : z ≤ y) (hx : x ≤ y) : z ≤ x ↔ Disjoint z (y \ x)

{α : Type u}
{x y z : α}
[GeneralizedBooleanAlgebra α]
(hz : z ≤ y)
(hx : x ≤ y)


/-- The cocones for `CostructuredArrow.proj L Y ⋙ F`, as a functor from `LeftExtension L F`. -/
@[simps]
def coconeAtFunctor (Y : D) :
    LeftExtension L F ⥤ Cocone (CostructuredArrow.proj L Y ⋙ F)

{C : Type u_1}
{D : Type u_2}
{H : Type u_3}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
[CategoryTheory.Category.{u_6, u_3} H]
(L : CategoryTheory.Functor C D)
(F : CategoryTheory.Functor C H)
(Y : D)
{E E' : L.LeftExtension F}
(φ : E ⟶ E')

((CategoryTheory.Functor.LeftExtension.coconeAtFunctor L F Y).map φ).hom = φ.right.app Y


theorem permCongr_symm_apply (p : Equiv.Perm β') (x) :
    e.permCongr.symm p x = e.symm (p (e x))

{α' : Type u_1}
{β' : Type u_2}
(e : α' ≃ β')
(p : Equiv.Perm β')
(x : α')

(e.permCongr.symm p) x = e.symm (p (e x))


/-- The object in the category of `R`-coalgebras associated to an `R`-coalgebra. -/
@[simps]
def of (X : Type v) [AddCommGroup X] [Module R X] [Coalgebra R X] :
    CoalgebraCat R

(R : Type u)
[CommRing R]
(X : Type v)
[AddCommGroup X]
[Module R X]
[Coalgebra R X]

(CoalgebraCat.of R X).isAddCommGroup = inst✝


lemma not_exists_sq' : m ^ 2 < n → n < (m + 1) ^ 2 → ¬∃ t, t ^ 2 = n


lemma map_inf (L M : Sublattice α) (f : LatticeHom α β) (hf : Injective f) :
    map f (L ⊓ M) = map f L ⊓ map f M

{α : Type u_2}
{β : Type u_3}
[Lattice α]
[Lattice β]
(L M : Sublattice α)
(f : LatticeHom α β)
(hf : Function.Injective ⇑f)

Sublattice.map f (L ⊓ M) = Sublattice.map f L ⊓ Sublattice.map f M


theorem bsize : ∀ {s}, Valid s → s.bsize = utf8Len s.toString.1

s.Valid → s.bsize = String.utf8Len s.toString.data


@[simp]
theorem cylinder_univ (s : Finset ι) : cylinder s (univ : Set (∀ i : s, α i)) = univ

{ι : Type u_1}
{α : ι → Type u_2}
(s : Finset ι)

MeasureTheory.cylinder s Set.univ = Set.univ


/-- The $L^1$ norm is less than the $L^\infty$ norm scaled by the cardinality. -/
@[to_additive Pi.sum_nnnorm_apply_le_nnnorm "The $L^1$ norm is less than the $L^\\infty$ norm
scaled by the cardinality."]
lemma Pi.sum_nnnorm_apply_le_nnnorm' : ∑ i, ‖f i‖₊ ≤ Fintype.card ι • ‖f‖₊

{ι : Type u_1}
{π : ι → Type u_4}
[Fintype ι]
[(i : ι) → SeminormedAddGroup (π i)]
(f : (i : ι) → π i)


lemma realPart_comp_subtype_selfAdjoint :
    realPart.comp (selfAdjoint.submodule ℝ A).subtype = LinearMap.id

{A : Type u_1}
[AddCommGroup A]
[Module ℂ A]
[StarAddMonoid A]
[StarModule ℂ A]

realPart ∘ₗ (selfAdjoint.submodule ℝ A).subtype = LinearMap.id


theorem infsep_singleton : ({x} : Set α).infsep = 0


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

{α : Type u_1}
[SubtractionMonoid α]
(a b c : α)
{d : α}


theorem associated_of_dvd_of_natDegree_le {K} [Field K] {p q : K[X]} (hpq : p ∣ q) (hq : q ≠ 0)
    (h₁ : q.natDegree ≤ p.natDegree) : Associated p q

{K : Type u_1}
[Field K]
{p q : K[X]}
(hpq : p ∣ q)
(hq : q ≠ 0)
(h₁ : q.natDegree ≤ p.natDegree)


@[to_additive (attr := simp)]
lemma mem_mulSpan :
    a ∈ mulSpan s ↔ ∃ ε : α → ℤ, (∀ a, ε a = -1 ∨ ε a = 0 ∨ ε a = 1) ∧ ∏ a in s, a ^ ε a = a

{α : Type u_1}
[CommGroup α]
[DecidableEq α]
[Fintype α]
{s : Finset α}
{a : α}

a ∈ s.mulSpan ↔ ∃ ε, (∀ (a : α), ε a = -1 ∨ ε a = 0 ∨ ε a = 1) ∧ ∏ a ∈ s, a ^ ε a = a


@[simp] theorem UInt64.val_val_eq_toNat (x : UInt64) : x.val.val = x.toNat


@[to_additive]
theorem NeBot.one_le_div (h : f.NeBot) : 1 ≤ f / f

{α : Type u_2}
[Group α]
{f : Filter α}
(h : f.NeBot)


lemma sheafificationHomEquiv_hom'
    {P : PresheafOfModules.{v} R₀} {F : SheafOfModules.{v} R}
    (f : (sheafification α).obj P ⟶ F) :
    (sheafificationHomEquiv α f).hom =
      CategoryTheory.toSheafify J P.presheaf ≫ f.val.hom

{J : CategoryTheory.GrothendieckTopology C}

(f : (PresheafOfModules.sheafification α).obj P ⟶ F)

((PresheafOfModules.sheafificationHomEquiv α) f).hom = CategoryTheory.toSheafify J P.presheaf ≫ f.val.hom


theorem norm_condexpIndL1Fin_le (hs : MeasurableSet s) (hμs : μ s ≠ ∞) (x : G) :
    ‖condexpIndL1Fin hm hs hμs x‖ ≤ (μ s).toReal * ‖x‖

{α : Type u_1}
{G : Type u_5}
[NormedAddCommGroup G]
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
[NormedSpace ℝ G]
{hm : m ≤ m0}
[MeasureTheory.SigmaFinite (μ.trim hm)]
(hs : MeasurableSet s)
(hμs : μ s ≠ ⊤)
(x : G)

‖MeasureTheory.condexpIndL1Fin hm hs hμs x‖ ≤ (μ s).toReal * ‖x‖


@[simp] lemma div_ratCast_im (z : ℂ) (x : ℚ) : (z / x).im = z.im / x


@[simp]
theorem sup_eq_bot_iff : a ⊔ b = ⊥ ↔ a = ⊥ ∧ b = ⊥

{α : Type u}
[SemilatticeSup α]
[OrderBot α]
{a b : α}


@[to_additive]
lemma ofUnits_le_iff_le_units (S : Submonoid M) (H : Subgroup Mˣ) :
    H.ofUnits ≤ S ↔ H ≤ S.units

{M : Type u_1}
[Monoid M]
(S : Submonoid M)
(H : Subgroup Mˣ)


/-- Writing explicitly the `n+1`-th derivative as the composition of a currying linear equiv,
and the `n`-th derivative of the derivative. -/
theorem iteratedFDeriv_succ_eq_comp_right {n : ℕ} :
    iteratedFDeriv 𝕜 (n + 1) f x =
      (continuousMultilinearCurryRightEquiv' 𝕜 n E F ∘ iteratedFDeriv 𝕜 n fun y => fderiv 𝕜 f y)
        x

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

iteratedFDeriv 𝕜 (n + 1) f x =
  (⇑(continuousMultilinearCurryRightEquiv' 𝕜 n E F) ∘ iteratedFDeriv 𝕜 n fun y => fderiv 𝕜 f y) x


theorem isLocal_of_isMaximal_radical {I : Ideal R} (hi : IsMaximal (radical I)) : IsLocal I

{R : Type u}
[CommRing R]
{I : Ideal R}
(hi : I.radical.IsMaximal)


@[to_additive (attr := simp)]
theorem toSubmonoid_le {p q : Subgroup G} : p.toSubmonoid ≤ q.toSubmonoid ↔ p ≤ q

{G : Type u_1}
[Group G]
{p q : Subgroup G}


@[simp]
theorem arccos_pos {x : ℝ} : 0 < arccos x ↔ x < 1


@[to_additive (attr := simp)]
lemma map_comp_mul [MulHomClass F M N] (f : F) (g h : ι → M) : f ∘ (g * h) = f ∘ g * f ∘ h

{ι : Type u_1}
{M : Type u_4}
{N : Type u_5}
{F : Type u_9}
[Add M]
[Add N]
[FunLike F M N]
[AddHomClass F M N]
(f : F)
(g h : ι → M)


lemma Spec_sheaf (R : CommRingCat.{u}) : (Spec R).sheaf = Spec.structureSheaf R

(AlgebraicGeometry.Spec R).sheaf = AlgebraicGeometry.Spec.structureSheaf ↑R


@[simp] lemma toColex_sdiff_le_toColex_sdiff' :
    toColex (s \ t) ≤ toColex (t \ s) ↔ toColex s ≤ toColex t

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

{ ofColex := s \ t } ≤ { ofColex := t \ s } ↔ { ofColex := s } ≤ { ofColex := t }


theorem skewAdjointPart_comp_subtype_selfAdjoint :
    (skewAdjointPart R).comp (selfAdjoint.submodule R A).subtype = 0

(R : Type u_1)
{A : Type u_2}
[Semiring R]
[StarMul R]
[TrivialStar R]
[AddCommGroup A]
[Module R A]
[StarAddMonoid A]
[StarModule R A]
[Invertible 2]

skewAdjointPart R ∘ₗ (selfAdjoint.submodule R A).subtype = 0


@[simp]
theorem coe_const (b : β) : ⇑(const α b) = Function.const α b

(α : Type u_3)
{β : Type u_4}
[Sup α]
[SemilatticeSup β]
(b : β)

⇑(SupHom.const α b) = Function.const α b


@[to_additive (attr := simp)]
theorem Commute.of_map [MulHomClass F M N] {f : F} (hf : Function.Injective f)
    (h : Commute (f x) (f y)) : Commute x y

{F : Type u_1}
{M : Type u_2}
{N : Type u_3}
[Mul M]
[Mul N]
{x y : M}
[FunLike F M N]
[MulHomClass F M N]
{f : F}
(hf : Function.Injective ⇑f)
(h : Commute (f x) (f y))


/-- If `K / E / F` is a field extension tower, such that `E / F` is separable,
then $[E:F] [K:E]_s = [K:F]_s$.
It is a special case of `Field.lift_sepDegree_mul_lift_sepDegree_of_isAlgebraic`, and is an
intermediate result used to prove it. -/
lemma lift_rank_mul_lift_sepDegree_of_isSeparable [Algebra.IsSeparable F E] :
    Cardinal.lift.{w} (Module.rank F E) * Cardinal.lift.{v} (sepDegree E K) =
    Cardinal.lift.{v} (sepDegree F K)

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
(K : Type w)
[Field K]
[Algebra F K]
[Algebra E K]
[IsScalarTower F E K]
[Algebra.IsSeparable F E]

Cardinal.lift.{w, v} (Module.rank F E) * Cardinal.lift.{v, w} (Field.sepDegree E K) =
  Cardinal.lift.{v, w} (Field.sepDegree F K)


theorem eqOn_closure₂ [T2Space Z] {s : Set X} {t : Set Y} {f g : X → Y → Z}
    (h : ∀ x ∈ s, ∀ y ∈ t, f x y = g x y) (hf : Continuous (uncurry f))
    (hg : Continuous (uncurry g)) : ∀ x ∈ closure s, ∀ y ∈ closure t, f x y = g x y

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
{Z : Type u_3}
[TopologicalSpace Y]
[TopologicalSpace Z]
[T2Space Z]
{s : Set X}
{t : Set Y}
{f g : X → Y → Z}
(h : ∀ x ∈ s, ∀ y ∈ t, f x y = g x y)
(hf : Continuous (Function.uncurry f))
(hg : Continuous (Function.uncurry g))
(x : X)

x ∈ closure s → ∀ y ∈ closure t, f x y = g x y


@[to_additive (attr := simp)]
lemma coe_id {X : Grp} : (𝟙 X : X → X) = id


@[simp]
theorem multichoose_one (k : ℕ) : multichoose 1 k = 1


/-- This mixin class describes an order where all intervals bounded below are finite. This is
slightly weaker than `LocallyFiniteOrder` + `OrderTop` as it allows empty types. -/
class LocallyFiniteOrderTop (α : Type*) [Preorder α] where
  /-- Left-open right-infinite interval -/
  finsetIoi : α → Finset α
  /-- Left-closed right-infinite interval -/
  finsetIci : α → Finset α
  /-- `x ∈ finsetIci a ↔ a ≤ x` -/
  finset_mem_Ici : ∀ a x : α, x ∈ finsetIci a ↔ a ≤ x
  /-- `x ∈ finsetIoi a ↔ a < x` -/
  finset_mem_Ioi : ∀ a x : α, x ∈ finsetIoi a ↔ a < x

{α : Type u_1}
[Preorder α]
[self : LocallyFiniteOrderTop α]
(a x : α)

x ∈ LocallyFiniteOrderTop.finsetIci a ↔ a ≤ x


lemma eulerMascheroniSeq_zero : eulerMascheroniSeq 0 = 0


lemma SpectrumRestricts.nnreal_iff_nnnorm {a : A} {t : ℝ≥0} (ha : IsSelfAdjoint a) (ht : ‖a‖₊ ≤ t) :
    SpectrumRestricts a ContinuousMap.realToNNReal ↔ ‖algebraMap ℝ A t - a‖₊ ≤ t

{A : Type u_1}
[NormedRing A]
[StarRing A]
[CstarRing A]
[CompleteSpace A]
[NormedAlgebra ℂ A]
[StarModule ℂ A]
{a : A}
{t : NNReal}
(ha : IsSelfAdjoint a)
(ht : ‖a‖₊ ≤ t)

SpectrumRestricts a ⇑ContinuousMap.realToNNReal ↔ ‖(algebraMap ℝ A) ↑t - a‖₊ ≤ t


theorem IsMaxFilter.comp_antitone (hf : IsMaxFilter f l a) {g : β → γ} (hg : Antitone g) :
    IsMinFilter (g ∘ f) l a

{α : Type u}
{β : Type v}
{γ : Type w}
[Preorder β]
[Preorder γ]
{f : α → β}
{l : Filter α}
{a : α}
(hf : IsMaxFilter f l a)
{g : β → γ}
(hg : Antitone g)


theorem exists_algHom_adjoin_of_splits' :
    ∃ φ : adjoin L S →ₐ[F] K, φ.comp (IsScalarTower.toAlgHom F L _) = f

(hK : ∀ s ∈ S, IsIntegral L s ∧ Polynomial.Splits f.toRingHom (minpoly L s))

∃ φ, φ.comp (IsScalarTower.toAlgHom F L ↥(IntermediateField.adjoin L S)) = f


@[nolint synTaut]
theorem evalWhiskerLeft_nil (f : C) (α : g ⟶ h) :
    f ◁ α = f ◁ α

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.MonoidalCategory C]
{g h : C}
(f : C)
(α : g ⟶ h)

CategoryTheory.MonoidalCategory.whiskerLeft f α = CategoryTheory.MonoidalCategory.whiskerLeft f α


theorem ground_eq_empty_iff : (M.E = ∅) ↔ M = emptyOn α


theorem N₁Γ₀_hom_app (K : ChainComplex C ℕ) :
    N₁Γ₀.hom.app K = (Γ₀.splitting K).toKaroubiNondegComplexIsoN₁.inv ≫
        (toKaroubi _).map (Γ₀NondegComplexIso K).hom

AlgebraicTopology.DoldKan.N₁Γ₀.hom.app K =
  (AlgebraicTopology.DoldKan.Γ₀.splitting K).toKaroubiNondegComplexIsoN₁.inv ≫
    (CategoryTheory.Idempotents.toKaroubi (ChainComplex C ℕ)).map (AlgebraicTopology.DoldKan.Γ₀NondegComplexIso K).hom


theorem cyclotomic_pos {n : ℕ} (hn : 2 < n) {R} [LinearOrderedCommRing R] (x : R) :
    0 < eval x (cyclotomic n R)

{n : ℕ}
(hn : 2 < n)
{R : Type u_1}
[LinearOrderedCommRing R]
(x : R)

0 < Polynomial.eval x (Polynomial.cyclotomic n R)


lemma toColex_ne_toColex {s t : Finset α} : toColex s ≠ toColex t ↔ s ≠ t

{ ofColex := s } ≠ { ofColex := t } ↔ s ≠ t


theorem fderivWithin_eventually_congr_set' (y : E) (h : s =ᶠ[𝓝[{y}ᶜ] x] t) :
    fderivWithin 𝕜 f s =ᶠ[𝓝 x] fderivWithin 𝕜 f t

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{s t : Set E}
(y : E)
(h : s =ᶠ[𝓝[{y}ᶜ] x] t)


@[simp]
theorem factor_mk (S T : Ideal R) (H : S ≤ T) (x : R) : factor S T H (mk S x) = mk T x

{R : Type u}
[CommRing R]
(S T : Ideal R)
(H : S ≤ T)
(x : R)

(Ideal.Quotient.factor S T H) ((Ideal.Quotient.mk S) x) = (Ideal.Quotient.mk T) x


/-- A weighted sum over `s.filter pred` equals one over `s` if all the weights at indices in `s`
not satisfying `pred` are zero. -/
theorem weightedVSub_filter_of_ne (w : ι → k) (p : ι → P) {pred : ι → Prop} [DecidablePred pred]
    (h : ∀ i ∈ s, w i ≠ 0 → pred i) : (s.filter pred).weightedVSub p w = s.weightedVSub p w

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
(s : Finset ι)
(w : ι → k)
(p : ι → P)
{pred : ι → Prop}
[DecidablePred pred]
(h : ∀ i ∈ s, w i ≠ 0 → pred i)

((Finset.filter pred s).weightedVSub p) w = (s.weightedVSub p) w


theorem minimalPeriod_pos_iff_mem_periodicPts : 0 < minimalPeriod f x ↔ x ∈ periodicPts f

0 < Function.minimalPeriod f x ↔ x ∈ Function.periodicPts f


@[simp]
theorem num_div_denom (x : RatFunc K) : algebraMap _ _ (num x) / algebraMap _ _ (denom x) = x

(algebraMap K[X] (RatFunc K)) x.num / (algebraMap K[X] (RatFunc K)) x.denom = x


theorem iSupLift_of_mem {i : ι} (x : T) (hx : (x : A) ∈ K i) :
    iSupLift K dir f hf T hT x = f i ⟨x, hx⟩

{dir : Directed (fun x x_1 => x ≤ x_1) K}

{hf : ∀ (i j : ι) (h : K i ≤ K j), f i = (f j).comp (NonUnitalSubalgebra.inclusion h)}

(NonUnitalSubalgebra.iSupLift K dir f hf T hT) x = (f i) ⟨↑x, hx⟩


@[fun_prop]
theorem DifferentiableOn.clm_comp (hc : DifferentiableOn 𝕜 c s) (hd : DifferentiableOn 𝕜 d s) :
    DifferentiableOn 𝕜 (fun y => (c y).comp (d y)) s

{𝕜 : 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]
{s : Set E}
{H : Type u_6}
[NormedAddCommGroup H]
[NormedSpace 𝕜 H]
{c : E → G →L[𝕜] H}
{d : E → F →L[𝕜] G}
(hc : DifferentiableOn 𝕜 c s)
(hd : DifferentiableOn 𝕜 d s)


@[to_additive]
protected theorem bijective (e : M ≃* N) : Function.Bijective e

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


theorem Perm.pairwise_iff {R : α → α → Prop} (S : ∀ {x y}, R x y → R y x) :
    ∀ {l₁ l₂ : List α} (_p : l₁ ~ l₂), Pairwise R l₁ ↔ Pairwise R l₂

{α : Type u_1}
{R : α → α → Prop}
(S : ∀ {x y : α}, R x y → R y x)
{l₁ l₂ : List α}
(_p : l₁ ~ l₂)


theorem setLaverage_congr_fun (hs : MeasurableSet s) (h : ∀ᵐ x ∂μ, x ∈ s → f x = g x) :
    ⨍⁻ x in s, f x ∂μ = ⨍⁻ x in s, g x ∂μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
{f g : α → ℝ≥0∞}
(hs : MeasurableSet s)
(h : ∀ᵐ (x : α) ∂μ, x ∈ s → f x = g x)

⨍⁻ (x : α) in s, f x ∂μ = ⨍⁻ (x : α) in s, g x ∂μ


theorem Commute.lie_eq {x y : R} (h : Commute x y) : ⁅x, y⁆ = 0

{R : Type x}
[NonUnitalNonAssocRing R]
{x y : R}
(h : Commute x y)


/-- A morphism of presheaves `f : F ⟶ G` is locally surjective with respect to a grothendieck
topology if every section of `G` is locally in the image of `f`. -/
class IsLocallySurjective {F G : Cᵒᵖ ⥤ A} (f : F ⟶ G) : Prop where
  imageSieve_mem {U : C} (s : G.obj (op U)) : imageSieve f s ∈ J U

{J : CategoryTheory.GrothendieckTopology C}

[self : CategoryTheory.Presheaf.IsLocallySurjective J f]

(s : (CategoryTheory.forget A).obj (G.obj (Opposite.op U)))

CategoryTheory.Presheaf.imageSieve f s ∈ J.sieves U


@[simp]
theorem edist_toLp_toLp (f g : α → E) (hf : Memℒp f p μ) (hg : Memℒp g p μ) :
    edist (hf.toLp f) (hg.toLp g) = eLpNorm (f - g) p μ

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

edist (MeasureTheory.Memℒp.toLp f hf) (MeasureTheory.Memℒp.toLp g hg) = MeasureTheory.eLpNorm (f - g) p μ


@[to_additive]
theorem subset_interior_div : interior s / interior t ⊆ interior (s / t)

{G : Type w}
[TopologicalSpace G]
[Group G]
[TopologicalGroup G]
{s t : Set G}


lemma mem_set_smul_def (x : M) :
    x ∈ s • N ↔
  x ∈ sInf { p : Submodule R M | ∀ ⦃r : S⦄ {n : M}, r ∈ s → n ∈ N → r • n ∈ p }

{R : Type u_2}
{M : Type u_3}
[Semiring R]
{S : Type u_4}
[Monoid S]
[AddCommMonoid M]
[Module R M]
[DistribMulAction S M]
(s : Set S)
(N : Submodule R M)
(x : M)

x ∈ s • N ↔ x ∈ sInf {p | ∀ ⦃r : S⦄ {n : M}, r ∈ s → n ∈ N → r • n ∈ p}


theorem _root_.Dvd.dvd.zero_modEq_nat (h : n ∣ a) : 0 ≡ a [MOD n]


/-- If `C` has a terminal object and `G` preserves terminal objects, then `D` has a terminal object
also.
Note this property is somewhat unique to (co)limits of the empty diagram: for general `J`, if `C`
has limits of shape `J` and `G` preserves them, then `D` does not necessarily have limits of shape
`J`.
-/
theorem hasTerminal_of_hasTerminal_of_preservesLimit [PreservesLimit (Functor.empty.{0} C) G] :
    HasTerminal D

[CategoryTheory.Limits.PreservesLimit (CategoryTheory.Functor.empty C) G]


theorem IsMinFilter.neg (hf : IsMinFilter f l a) : IsMaxFilter (fun x => -f x) l a

{α : Type u}
{β : Type v}
[OrderedAddCommGroup β]
{f : α → β}
{a : α}
{l : Filter α}
(hf : IsMinFilter f l a)


/-- A `SemilatticeSup` is a join-semilattice, that is, a partial order
  with a join (a.k.a. lub / least upper bound, sup / supremum) operation
  `⊔` which is the least element larger than both factors. -/
class SemilatticeSup (α : Type u) extends Sup α, PartialOrder α where
  /-- The supremum is an upper bound on the first argument -/
  protected le_sup_left : ∀ a b : α, a ≤ a ⊔ b
  /-- The supremum is an upper bound on the second argument -/
  protected le_sup_right : ∀ a b : α, b ≤ a ⊔ b
  /-- The supremum is the *least* upper bound -/
  protected sup_le : ∀ a b c : α, a ≤ c → b ≤ c → a ⊔ b ≤ c

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


theorem IsExtrOn.comp_mono (hf : IsExtrOn f s a) {g : β → γ} (hg : Monotone g) :
    IsExtrOn (g ∘ f) s a

{α : Type u}
{β : Type v}
{γ : Type w}
[Preorder β]
[Preorder γ]
{f : α → β}
{s : Set α}
{a : α}
(hf : IsExtrOn f s a)
{g : β → γ}
(hg : Monotone g)


@[to_additive (attr := simp)]
lemma stabilizer_mul_eq_right [Group α] [SMulCommClass G α α] (a b : α) :
    stabilizer G (a * b) = stabilizer G b

{G : Type u_1}
{α : Type u_2}
[Group G]
[MulAction G α]
[Group α]
[SMulCommClass G α α]
(a b : α)

MulAction.stabilizer G (a * b) = MulAction.stabilizer G b


theorem hasFDerivWithinAt_insert {y : E} :
    HasFDerivWithinAt f f' (insert y s) x ↔ HasFDerivWithinAt f f' s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{f' : E →L[𝕜] F}
{x : E}
{s : Set E}
{y : E}


theorem ne_of_false_of_true {a b : Prop} (ha : ¬a) (hb : b) : a ≠ b


@[to_additive]
theorem mem_center_iff {z : M} : z ∈ center M ↔ ∀ g, g * z = z * g

z ∈ AddSubmonoid.center M ↔ ∀ (g : M), g + z = z + g


lemma curry_obj_uncurry_obj (F : B ⥤ C ⥤ D) : curry.obj (uncurry.obj F) = F

(F : CategoryTheory.Functor B (CategoryTheory.Functor C D))

CategoryTheory.curry.obj (CategoryTheory.uncurry.obj F) = F


theorem projIci_surjOn : SurjOn (projIci a) (Ici a) univ

Set.SurjOn (Set.projIci a) (Set.Ici a) Set.univ


@[simp] lemma repr_apply_embedding_eq_repr_smul {i : Fin n} :
    snf.bM.repr m (snf.f i) = snf.bN.repr (snf.a i • m) i

{ι : Type u_1}
{R : Type u_2}
[CommRing R]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
{n : ℕ}
{N : Submodule R M}
(snf : Basis.SmithNormalForm N ι n)
(m : ↥N)
{i : Fin n}

(snf.bM.repr ↑m) (snf.f i) = (snf.bN.repr (snf.a i • m)) i


theorem offDiag_subset_prod : s.offDiag ⊆ s ×ˢ s


@[simp] theorem emod_emod (a b : Int) : (a % b) % b = a % b


theorem algebraMap_gradedMul (r : R) (x : (⨁ i, 𝒜 i) ⊗[R] (⨁ i, ℬ i)) :
    gradedMul R 𝒜 ℬ (algebraMap R _ r ⊗ₜ 1) x = r • x

((TensorProduct.gradedMul R 𝒜 ℬ) ((algebraMap R (DirectSum ι 𝒜)) r ⊗ₜ[R] 1)) x = r • x


/-- The functor `Karoubi (HomologicalComplex C c) ⥤ HomologicalComplex (Karoubi C) c`. -/
@[simps]
def functor : Karoubi (HomologicalComplex C c) ⥤ HomologicalComplex (Karoubi C) c

(P : CategoryTheory.Idempotents.Karoubi (HomologicalComplex C c))

CategoryTheory.Idempotents.KaroubiHomologicalComplexEquivalence.functor.obj P =
  CategoryTheory.Idempotents.KaroubiHomologicalComplexEquivalence.Functor.obj P


/-- If `(f y - f x) / (y - x)` converges to a limit as `y` tends to `x`, then the same goes if
`y` is shifted a little bit, i.e., `f (y + (y-x)^2) - f x) / (y - x)` converges to the same limit.
This lemma contains a slightly more general version of this statement (where one considers
convergence along some subfilter, typically `𝓝[<] x` or `𝓝[>] x`) tailored to the application
to almost everywhere differentiability of monotone functions. -/
theorem tendsto_apply_add_mul_sq_div_sub {f : ℝ → ℝ} {x a c d : ℝ} {l : Filter ℝ} (hl : l ≤ 𝓝[≠] x)
    (hf : Tendsto (fun y => (f y - d) / (y - x)) l (𝓝 a))
    (h' : Tendsto (fun y => y + c * (y - x) ^ 2) l l) :
    Tendsto (fun y => (f (y + c * (y - x) ^ 2) - d) / (y - x)) l (𝓝 a)

(hf : Filter.Tendsto (fun y => (f y - d) / (y - x)) l (𝓝 a))

(h' : Filter.Tendsto (fun y => y + c * (y - x) ^ 2) l l)

Filter.Tendsto (fun y => (f (y + c * (y - x) ^ 2) - d) / (y - x)) l (𝓝 a)


protected theorem tsum_eq_iSup_sum' {ι : Type*} (s : ι → Finset α) (hs : ∀ t, ∃ i, t ⊆ s i) :
    ∑' a, f a = ⨆ i, ∑ a ∈ s i, f a

{α : Type u_1}
{f : α → ℝ≥0∞}
{ι : Type u_4}
(s : ι → Finset α)
(hs : ∀ (t : Finset α), ∃ i, t ⊆ s i)


theorem segment_eq_image_lineMap (x y : E) : [x -[𝕜] y] =
    AffineMap.lineMap x y '' Icc (0 : 𝕜) 1

(𝕜 : Type u_1)
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(x y : E)

[x-[𝕜]y] = ⇑(AffineMap.lineMap x y) '' Set.Icc 0 1


theorem nhds_left'_sup_nhds_right' (a : α) : 𝓝[<] a ⊔ 𝓝[>] a = 𝓝[≠] a

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
(a : α)


@[simp] lemma schnirelmannDensity_empty : schnirelmannDensity ∅ = 0


theorem IsClosed.nullMeasurableSet {μ} (h : IsClosed s) : NullMeasurableSet s μ

{α : Type u_1}
{s : Set α}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
{μ : MeasureTheory.Measure α}
(h : IsClosed s)


@[to_additive (attr := simp)] lemma MulEquiv.mulDissociated_preimage (e : β ≃* α) :
    MulDissociated (e ⁻¹' s) ↔ MulDissociated s

{α : Type u_1}
{β : Type u_2}
[CommGroup α]
[CommGroup β]
{s : Set α}
(e : β ≃* α)

MulDissociated (⇑e ⁻¹' s) ↔ MulDissociated s


@[simp]
theorem det_trans (f g : M ≃ₗ[R] M) :
    LinearEquiv.det (f.trans g) = LinearEquiv.det g * LinearEquiv.det f

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
(f g : M ≃ₗ[R] M)

LinearEquiv.det (f ≪≫ₗ g) = LinearEquiv.det g * LinearEquiv.det f


lemma irreducible_X_pow_sub_C_of_root_adjoin_eq_top
    {a : K} {α : L} (ha : α ^ (finrank K L) = algebraMap K L a) (hα : K⟮α⟯ = ⊤) :
    Irreducible (X ^ (finrank K L) - C a)

(ha : α ^ FiniteDimensional.finrank K L = (algebraMap K L) a)

Irreducible (Polynomial.X ^ FiniteDimensional.finrank K L - Polynomial.C a)


theorem addHaar_ball_center {E : Type*} [NormedAddCommGroup E] [MeasurableSpace E] [BorelSpace E]
    (μ : Measure E) [IsAddHaarMeasure μ] (x : E) (r : ℝ) : μ (ball x r) = μ (ball (0 : E) r)

{E : Type u_3}
[NormedAddCommGroup E]
[MeasurableSpace E]
[BorelSpace E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]
(x : E)
(r : ℝ)

μ (Metric.ball x r) = μ (Metric.ball 0 r)


@[simp] lemma fromEdgeSet_disjoint : Disjoint (fromEdgeSet s) G ↔ Disjoint s G.edgeSet

{V : Type u}
(G : SimpleGraph V)
(s : Set (Sym2 V))

Disjoint (SimpleGraph.fromEdgeSet s) G ↔ Disjoint s G.edgeSet


theorem bot_def [∀ i, Bot (α' i)] : (⊥ : ∀ i, α' i) = fun _ => ⊥

{ι : Type u_3}
{α' : ι → Type u_4}
[(i : ι) → Bot (α' i)]


@[simp] lemma toLex_ratCast [RatCast α] (n : ℚ) : toLex (n : α) = n


/-- `⊓` commutes with pullback. -/
theorem inf_pullback {X Y : C} (g : X ⟶ Y) (f₁ f₂) :
    (pullback g).obj (f₁ ⊓ f₂) = (pullback g).obj f₁ ⊓ (pullback g).obj f₂

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

(CategoryTheory.Subobject.pullback g).obj (f₁ ⊓ f₂) =
  (CategoryTheory.Subobject.pullback g).obj f₁ ⊓ (CategoryTheory.Subobject.pullback g).obj f₂


/-- If a function `f : α → β` is such that the level sets `{f < p}` and `{q < f}` have measurable
supersets which are disjoint up to measure zero when `p < q`, then `f` is almost-everywhere
measurable. It is even enough to have this for `p` and `q` in a countable dense set. -/
theorem MeasureTheory.aemeasurable_of_exist_almost_disjoint_supersets {α : Type*}
    {m : MeasurableSpace α} (μ : Measure α) {β : Type*} [CompleteLinearOrder β] [DenselyOrdered β]
    [TopologicalSpace β] [OrderTopology β] [SecondCountableTopology β] [MeasurableSpace β]
    [BorelSpace β] (s : Set β) (s_count : s.Countable) (s_dense : Dense s) (f : α → β)
    (h : ∀ p ∈ s, ∀ q ∈ s, p < q → ∃ u v, MeasurableSet u ∧ MeasurableSet v ∧
      { x | f x < p } ⊆ u ∧ { x | q < f x } ⊆ v ∧ μ (u ∩ v) = 0) :
    AEMeasurable f μ

(h :
  ∀ p ∈ s,
    ∀ q ∈ s, p < q → ∃ u v, MeasurableSet u ∧ MeasurableSet v ∧ {x | f x < p} ⊆ u ∧ {x | q < f x} ⊆ v ∧ μ (u ∩ v) = 0)


/-- When `[HasPullbacks C]`, `MonoOver A` has "intersections", functorial in both arguments.

As `MonoOver A` is only a preorder, this doesn't satisfy the axioms of `SemilatticeInf`,
but we reuse all the names from `SemilatticeInf` because they will be used to construct
`SemilatticeInf (subobject A)` shortly.
-/
@[simps]
def inf {A : C} : MonoOver A ⥤ MonoOver A ⥤ MonoOver A

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Limits.HasPullbacks C]
{A : C}

∀ {X Y : CategoryTheory.MonoOver A} (k : X ⟶ Y) (g : CategoryTheory.MonoOver A),
  (CategoryTheory.MonoOver.inf.map k).app g =
    CategoryTheory.MonoOver.homMk
      (CategoryTheory.Limits.pullback.lift
        (CategoryTheory.Limits.pullback.fst ((CategoryTheory.MonoOver.forget A).obj g).hom X.arrow)
        (CategoryTheory.Limits.pullback.snd ((CategoryTheory.MonoOver.forget A).obj g).hom X.arrow ≫ k.left) ⋯)
      ⋯


@[ext]
lemma tensorObj₃_ext {j : I} {A : C} (f g : tensorObj X₁ (tensorObj X₂ X₃) j ⟶ A)
    [H : HasGoodTensorTensor₂₃ X₁ X₂ X₃]
    (h : ∀ (i₁ i₂ i₃ : I) (hi : i₁ + i₂ + i₃ = j),
      ιTensorObj₃ X₁ X₂ X₃ i₁ i₂ i₃ j hi ≫ f = ιTensorObj₃ X₁ X₂ X₃ i₁ i₂ i₃ j hi ≫ g) :
      f = g

{X₁ X₂ X₃ : CategoryTheory.GradedObject I C}

[X₁.HasTensor (CategoryTheory.GradedObject.Monoidal.tensorObj X₂ X₃)]

(f g : CategoryTheory.GradedObject.Monoidal.tensorObj X₁ (CategoryTheory.GradedObject.Monoidal.tensorObj X₂ X₃) j ⟶ A)

(h :
  ∀ (i₁ i₂ i₃ : I) (hi : i₁ + i₂ + i₃ = j),
    CategoryTheory.CategoryStruct.comp (CategoryTheory.GradedObject.Monoidal.ιTensorObj₃ X₁ X₂ X₃ i₁ i₂ i₃ j hi) f =
      CategoryTheory.CategoryStruct.comp (CategoryTheory.GradedObject.Monoidal.ιTensorObj₃ X₁ X₂ X₃ i₁ i₂ i₃ j hi) g)


@[to_additive (attr := simp)]
lemma unop_mul [Mul α] (x y : αᵐᵒᵖ) : unop (x * y) = unop y * unop x

AddOpposite.unop (x + y) = AddOpposite.unop y + AddOpposite.unop x


@[simp] theorem append_empty (s : String) : s ++ "" = s


theorem not_isPredLimit_iff : ¬IsPredLimit a ↔ ∃ b, ¬IsMin b ∧ pred b = a

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

¬Order.IsPredLimit a ↔ ∃ b, ¬IsMin b ∧ Order.pred b = a


theorem StrictConvex.openSegment_subset (hs : StrictConvex 𝕜 s) (hx : x ∈ s) (hy : y ∈ s)
    (h : x ≠ y) : openSegment 𝕜 x y ⊆ interior s

{𝕜 : Type u_1}
{E : Type u_3}
[OrderedSemiring 𝕜]
[TopologicalSpace E]
[AddCommMonoid E]
[SMul 𝕜 E]
{s : Set E}
{x y : E}
(hs : StrictConvex 𝕜 s)
(hx : x ∈ s)
(hy : y ∈ s)
(h : x ≠ y)


lemma measurable_density_left (κ : Kernel α (γ × β)) (ν : Kernel α γ) (x : γ)
    {s : Set β} (hs : MeasurableSet s) :
    Measurable (fun a ↦ density κ ν a x s)

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


@[norm_cast] -- Porting note: no longer a `simp`
theorem coe_iInf₂ (f : ∀ i, κ i → UpperSet α) :
    (↑(⨅ (i) (j), f i j) : Set α) = ⋃ (i) (j), f i j

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


theorem ae_eq_of_forall_setLIntegral_eq_of_sigmaFinite [SigmaFinite μ] {f g : α → ℝ≥0∞}
    (hf : Measurable f) (hg : Measurable g)
    (h : ∀ s, MeasurableSet s → μ s < ∞ → ∫⁻ x in s, f x ∂μ = ∫⁻ x in s, g x ∂μ) : f =ᵐ[μ] g

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


theorem rank_mul_le_left [StrongRankCondition R] (A : Matrix m n R) (B : Matrix n o R) :
    (A * B).rank ≤ A.rank

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{R : Type u_5}
[Fintype n]
[Fintype o]
[CommRing R]
[StrongRankCondition R]
(A : Matrix m n R)
(B : Matrix n o R)


@[simp]
theorem coe_zero : ⇑(0 : LeftInvariantDerivation I G) = 0

{𝕜 : 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]


@[simp] lemma map_id [IsDirected ι (· ≤ ·)] :
    map (fun i ↦ AddMonoidHom.id _) (fun _ _ _ ↦ rfl) = AddMonoidHom.id (DirectLimit G f)

{ι : Type v}
[Preorder ι]
{G : ι → Type w}
[DecidableEq ι]
[(i : ι) → AddCommGroup (G i)]
{f : (i j : ι) → i ≤ j → G i →+ G j}
[IsDirected ι fun x x_1 => x ≤ x_1]

AddCommGroup.DirectLimit.map (fun i => AddMonoidHom.id (G i)) ⋯ = AddMonoidHom.id (AddCommGroup.DirectLimit G f)


theorem lt_of_not_le [LinearOrder α] {a b : α} (h : ¬b ≤ a) : a < b

{α : Type u_2}
[LinearOrder α]
{a b : α}
(h : ¬b ≤ a)


theorem sub_zmodRepr_mem : x - zmodRepr x ∈ maximalIdeal ℤ_[p]

{p : ℕ}
[hp_prime : Fact (Nat.Prime p)]
(x : ℤ_[p])

x - ↑x.zmodRepr ∈ LocalRing.maximalIdeal ℤ_[p]


@[simp]
theorem submatrix_mul_equiv [Fintype n] [Fintype o] [AddCommMonoid α] [Mul α] {p q : Type*}
    (M : Matrix m n α) (N : Matrix n p α) (e₁ : l → m) (e₂ : o ≃ n) (e₃ : q → p) :
    M.submatrix e₁ e₂ * N.submatrix e₂ e₃ = (M * N).submatrix e₁ e₃

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
[Fintype n]
[Fintype o]
[AddCommMonoid α]
[Mul α]
{p : Type u_10}
{q : Type u_11}
(M : Matrix m n α)
(N : Matrix n p α)
(e₁ : l → m)
(e₂ : o ≃ n)
(e₃ : q → p)

M.submatrix e₁ ⇑e₂ * N.submatrix (⇑e₂) e₃ = (M * N).submatrix e₁ e₃


/-- A linear upper bound on the size of the `primeCounting'` function -/
theorem primeCounting'_add_le {a k : ℕ} (h0 : 0 < a) (h1 : a < k) (n : ℕ) :
    π' (k + n) ≤ π' k + Nat.totient a * (n / a + 1)

(k + n).primeCounting' ≤ k.primeCounting' + a.totient * (n / a + 1)


@[simp]
theorem independent_map_orderIso_iff {ι : Sort*} {α β : Type*} [CompleteLattice α]
    [CompleteLattice β] (f : α ≃o β) {a : ι → α} : Independent (f ∘ a) ↔ Independent a

{ι : Sort u_5}
{α : Type u_6}
{β : Type u_7}
[CompleteLattice α]
[CompleteLattice β]
(f : α ≃o β)
{a : ι → α}

CompleteLattice.Independent (⇑f ∘ a) ↔ CompleteLattice.Independent a


/-- Given a box `I` in `ℝⁿ` and a function `r : ℝⁿ → (0, ∞)`, there exists a tagged partition `π` of
`I` such that

* `π` is a Henstock partition;
* `π` is subordinate to `r`;
* each box in `π` is homothetic to `I` with coefficient of the form `1 / 2 ^ m`.

This lemma implies that the Henstock filter is nontrivial, hence the Henstock integral is
well-defined. -/
theorem exists_taggedPartition_isHenstock_isSubordinate_homothetic (I : Box ι)
    (r : (ι → ℝ) → Ioi (0 : ℝ)) :
    ∃ π : TaggedPrepartition I, π.IsPartition ∧ π.IsHenstock ∧ π.IsSubordinate r ∧
      (∀ J ∈ π, ∃ m : ℕ, ∀ i, (J : _).upper i - J.lower i = (I.upper i - I.lower i) / 2 ^ m) ∧
        π.distortion = I.distortion

{ι : Type u_1}
[Fintype ι]
(I : BoxIntegral.Box ι)
(r : (ι → ℝ) → ↑(Set.Ioi 0))

∃ π,
  π.IsPartition ∧
    π.IsHenstock ∧
      π.IsSubordinate r ∧
        (∀ J ∈ π, ∃ m, ∀ (i : ι), J.upper i - J.lower i = (I.upper i - I.lower i) / 2 ^ m) ∧ π.distortion = I.distortion


lemma IsIntegralCurveAt.continuousAt (hγ : IsIntegralCurveAt γ v t₀) :
    ContinuousAt γ t₀

{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₀ : ℝ}
(hγ : IsIntegralCurveAt γ v t₀)


theorem not_dvd_one [CommMonoid α] {p : α} (hp : Irreducible p) : ¬p ∣ 1

{α : Type u_1}
[CommMonoid α]
{p : α}
(hp : Irreducible p)


lemma ssubset_asymm [IsAsymm α (· ⊂ ·)] {a b : α} : a ⊂ b → ¬b ⊂ a

{α : Type u}
[HasSSubset α]
[IsAsymm α fun x x_1 => x ⊂ x_1]
{a b : α}

a ⊂ b → ¬b ⊂ a


/-- We say that a type has `MeasurableAdd₂` if `uncurry (· + ·)` is a measurable functions.
For a typeclass assuming measurability of `(c + ·)` and `(· + c)` see `MeasurableAdd`. -/
class MeasurableAdd₂ (M : Type*) [MeasurableSpace M] [Add M] : Prop where
  measurable_add : Measurable fun p : M × M => p.1 + p.2

{M : Type u_2}
[MeasurableSpace M]
[Add M]
[self : MeasurableAdd₂ M]


/-- If a point is in the affine span of a set, adding it to that set does not change the vector
span. -/
theorem vectorSpan_insert_eq_vectorSpan {p : P} {ps : Set P} (h : p ∈ affineSpan k ps) :
    vectorSpan k (insert p ps) = vectorSpan k ps

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{p : P}
{ps : Set P}
(h : p ∈ affineSpan k ps)


lemma equivQuotTensor_naturality (f : M →ₗ[R] M') :
    equivQuotTensor r M' ∘ₗ map r f =
      f.lTensor (R ⧸ Ideal.span {r}) ∘ₗ equivQuotTensor r M

{R : Type u_2}
[CommRing R]
(r : R)
{M : Type u_1}
{M' : Type u_3}
[AddCommGroup M]
[Module R M]
[AddCommGroup M']
[Module R M']
(f : M →ₗ[R] M')

↑(QuotSMulTop.equivQuotTensor r M') ∘ₗ (QuotSMulTop.map r) f =
  LinearMap.lTensor (R ⧸ Ideal.span {r}) f ∘ₗ ↑(QuotSMulTop.equivQuotTensor r M)


theorem _root_.IsLeftRegular.matrix [Mul α] {k : α} (hk : IsLeftRegular k) :
    IsSMulRegular (Matrix m n α) k

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[Mul α]
{k : α}
(hk : IsLeftRegular k)


/-- Assumes right strict covariance. -/
theorem Right.mul_lt_mul_of_nonneg [PosMulMono α] [MulPosStrictMono α]
    (h₁ : a < b) (h₂ : c < d) (a0 : 0 ≤ a) (c0 : 0 ≤ c) : a * c < b * d

{α : Type u_1}
{a b c d : α}
[MulZeroClass α]
[Preorder α]
[PosMulMono α]
[MulPosStrictMono α]
(h₁ : a < b)
(h₂ : c < d)
(a0 : 0 ≤ a)
(c0 : 0 ≤ c)


theorem getMsb_eq_getLsb (x : BitVec w) (i : Nat) : x.getMsb i = (decide (i < w) && x.getLsb (w - 1 - i))


/-- the canonical `MorphComponents` whose associated morphism is the identity
(see `F_id`) thanks to `decomposition_Q n (n+1)` -/
@[simps]
def id : MorphComponents X n (X _[n + 1])

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

(AlgebraicTopology.DoldKan.MorphComponents.id X n).a = AlgebraicTopology.DoldKan.PInfty.f (n + 1)


theorem mul_mem_mul_rev {r s} (hr : r ∈ I) (hs : s ∈ J) : s * r ∈ I * J

{R : Type u}
[CommSemiring R]
{I J : Ideal R}
{r s : R}
(hr : r ∈ I)
(hs : s ∈ J)


@[simp] lemma algebraMap_lt_algebraMap : algebraMap α β a₁ < algebraMap α β a₂ ↔ a₁ < a₂

{α : Type u_1}
{β : Type u_2}
[OrderedCommSemiring α]
[StrictOrderedSemiring β]
[Algebra α β]
[SMulPosStrictMono α β]
{a₁ a₂ : α}
[SMulPosReflectLT α β]

(algebraMap α β) a₁ < (algebraMap α β) a₂ ↔ a₁ < a₂


@[simp, norm_cast]
theorem up_intCast [IntCast α] (n : ℤ) : up (n : α) = n


/-- The range of an algebra homomorphism, as an intermediate field. -/
@[simps toSubalgebra]
def fieldRange : IntermediateField K L'

{K : Type u_1}
{L : Type u_2}
{L' : Type u_3}
[Field K]
[Field L]
[Field L']
[Algebra K L]
[Algebra K L']
(f : L →ₐ[K] L')


theorem ContinuousWithinAt.congr_mono {f g : α → β} {s s₁ : Set α} {x : α}
    (h : ContinuousWithinAt f s x) (h' : EqOn g f s₁) (h₁ : s₁ ⊆ s) (hx : g x = f x) :
    ContinuousWithinAt g s₁ x

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f g : α → β}
{s s₁ : Set α}
{x : α}
(h : ContinuousWithinAt f s x)
(h' : Set.EqOn g f s₁)
(h₁ : s₁ ⊆ s)
(hx : g x = f x)


/-- This is a stronger version of the Hahn-Banach separation theorem for closed convex cones. This
is also the geometric interpretation of Farkas' lemma. -/
theorem ConvexCone.hyperplane_separation_of_nonempty_of_isClosed_of_nmem (K : ConvexCone ℝ H)
    (ne : (K : Set H).Nonempty) (hc : IsClosed (K : Set H)) {b : H} (disj : b ∉ K) :
    ∃ y : H, (∀ x : H, x ∈ K → 0 ≤ ⟪x, y⟫_ℝ) ∧ ⟪y, b⟫_ℝ < 0

{H : Type u_5}
[NormedAddCommGroup H]
[InnerProductSpace ℝ H]
[CompleteSpace H]
(K : ConvexCone ℝ H)
(ne : (↑K).Nonempty)
(hc : IsClosed ↑K)
{b : H}
(disj : b ∉ K)

∃ y, (∀ x ∈ K, 0 ≤ ⟪x, y⟫_ℝ) ∧ ⟪y, b⟫_ℝ < 0


theorem Ico_mem_nhdsSet_Icc (h : a < b) (h' : c < d) : Ico a d ∈ 𝓝ˢ (Icc b c)

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


theorem prim_iff₂ {f : ℕ → ℕ → ℕ} : (@Primrec' 2 fun v => f v.head v.tail.head) ↔ Primrec₂ f

{f : ℕ → ℕ → ℕ}

(Nat.Primrec' fun v => f v.head v.tail.head) ↔ Primrec₂ f


theorem basicOpen_mul (f g : R) : basicOpen (f * g) = basicOpen f ⊓ basicOpen g

PrimeSpectrum.basicOpen (f * g) = PrimeSpectrum.basicOpen f ⊓ PrimeSpectrum.basicOpen g


@[to_additive (attr := simp, norm_cast) coe_le_zero]
theorem coe_le_one [LE α] : (a : WithBot α) ≤ 1 ↔ a ≤ 1

↑a ≤ 1 ↔ a ≤ 1


theorem openEmbedding_coe : OpenEmbedding ((↑) : ℝ → EReal)


/-- `autMap` is surjective, if the source is also Galois. -/
lemma autMap_surjective_of_isGalois {A B : C} [IsGalois A] [IsGalois B] (f : A ⟶ B) :
    Function.Surjective (autMap f)


theorem Icc_mem_vitaliFamily_at_right {x y : ℝ} (hxy : x < y) :
    Icc x y ∈ (vitaliFamily (volume : Measure ℝ) 1).setsAt x

Set.Icc x y ∈ (IsUnifLocDoublingMeasure.vitaliFamily MeasureTheory.volume 1).setsAt x


lemma integral_density (hκν : fst κ ≤ ν) [IsFiniteKernel ν]
    (a : α) {s : Set β} (hs : MeasurableSet s) :
    ∫ x, density κ ν a x s ∂(ν a) = (κ a (univ ×ˢ s)).toReal

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

∫ (x : γ), κ.density ν a x s ∂ν a = ((κ a) (Set.univ ×ˢ s)).toReal


/-- Radon-Nikodym derivative of the scalar multiple of a measure.
See also `rnDeriv_smul_left'`, which requires sigma-finite `ν` and `μ`. -/
theorem rnDeriv_smul_left (ν μ : Measure α) [IsFiniteMeasure ν]
    [ν.HaveLebesgueDecomposition μ] (r : ℝ≥0) :
    (r • ν).rnDeriv μ =ᵐ[μ] r • ν.rnDeriv μ

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


theorem image_update_Ico_right (f : ∀ i, α i) (i : ι) (b : α i) :
    update f i '' Ico (f i) b = Ico f (update f i b)

{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ι]
[(i : ι) → PartialOrder (α i)]
(f : (i : ι) → α i)
(i : ι)
(b : α i)

Function.update f i '' Set.Ico (f i) b = Set.Ico f (Function.update f i b)


@[to_additive]
theorem index_inf_le : (H ⊓ K).index ≤ H.index * K.index

{G : Type u_1}
[AddGroup G]
{H K : AddSubgroup G}


/-- The special-value formula `Γ(1/2) = √π`, which is equivalent to the Gaussian integral. -/
theorem Real.Gamma_one_half_eq : Real.Gamma (1 / 2) = √π


@[reassoc (attr := simp)]
theorem whiskerRight_naturality_id (f : G.obj a ⟶ a') :
    η.naturality (𝟙 a) ▷ f ≫ (α_ _ _ _).hom ≫ η.app a ◁ G.mapId a ▷ f =
    F.mapId a ▷ η.app a ▷ f ≫ (λ_ (η.app a)).hom ▷ f ≫ (ρ_ (η.app a)).inv ▷ f ≫ (α_ _ _ _).hom

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
{F G : CategoryTheory.OplaxFunctor B C}
(η : CategoryTheory.OplaxNatTrans F G)
{a : B}
{a' : C}
(f : G.obj a ⟶ a')

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerRight (η.naturality (CategoryTheory.CategoryStruct.id a)) f)
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.Bicategory.associator (η.app a) (G.map (CategoryTheory.CategoryStruct.id a)) f).hom
      (CategoryTheory.Bicategory.whiskerLeft (η.app a) (CategoryTheory.Bicategory.whiskerRight (G.mapId a) f))) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerRight (CategoryTheory.Bicategory.whiskerRight (F.mapId a) (η.app a)) f)
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.Bicategory.whiskerRight (CategoryTheory.Bicategory.leftUnitor (η.app a)).hom f)
      (CategoryTheory.CategoryStruct.comp
        (CategoryTheory.Bicategory.whiskerRight (CategoryTheory.Bicategory.rightUnitor (η.app a)).inv f)
        (CategoryTheory.Bicategory.associator (η.app a) (CategoryTheory.CategoryStruct.id (G.obj a)) f).hom))


/-- A map `f` between modules over a semiring is linear if it satisfies the two properties
`f (x + y) = f x + f y` and `f (c • x) = c • f x`. The predicate `IsLinearMap R f` asserts this
property. A bundled version is available with `LinearMap`, and should be favored over
`IsLinearMap` most of the time. -/
structure IsLinearMap (R : Type u) {M : Type v} {M₂ : Type w} [Semiring R] [AddCommMonoid M]
  [AddCommMonoid M₂] [Module R M] [Module R M₂] (f : M → M₂) : Prop where
  /-- A linear map preserves addition. -/
  map_add : ∀ x y, f (x + y) = f x + f y
  /-- A linear map preserves scalar multiplication. -/
  map_smul : ∀ (c : R) (x), f (c • x) = c • f x

{R : Type u}
{M : Type v}
{M₂ : Type w}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]
{f : M → M₂}
(self : IsLinearMap R f)
(c : R)
(x : M)


theorem take_succ' {s : Stream' α} : ∀ n, s.take (n+1) = s.take n ++ [s.get n]

Stream'.take (n + 1) s = Stream'.take n s ++ [s.get n]


theorem map_add₂ (f : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂] P) (x₁ x₂ y) : f (x₁ + x₂) y = f x₁ y + f x₂ y

{R : Type u_1}
[Semiring R]
{S : Type u_2}
[Semiring S]
{R₂ : Type u_3}
[Semiring R₂]
{S₂ : Type u_4}
[Semiring S₂]
{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module S N]
[Module R₂ P]
[Module S₂ P]
[SMulCommClass S₂ R₂ P]
{ρ₁₂ : R →+* R₂}
{σ₁₂ : S →+* S₂}
(f : M →ₛₗ[ρ₁₂] N →ₛₗ[σ₁₂] P)
(x₁ x₂ : M)
(y : N)


@[simp]
theorem iteratedDeriv_one : iteratedDeriv 1 f = deriv f

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


@[simp]
theorem sumArrowLequivProdArrow_apply_fst {α β} (f : α ⊕ β → M) (a : α) :
    (sumArrowLequivProdArrow α β R M f).1 a = f (Sum.inl a)

{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{α : Type u_5}
{β : Type u_6}
(f : α ⊕ β → M)
(a : α)

((LinearEquiv.sumArrowLequivProdArrow α β R M) f).1 a = f (Sum.inl a)


@[simp]
theorem ext_iff' {s t : Finmap β} : s.entries = t.entries ↔ s = t

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


theorem st_eq_sSup {x : ℝ*} : st x = sSup { y : ℝ | (y : ℝ*) < x }


@[simp]
theorem nndist_midpoint_right (p₁ p₂ : P) :
    nndist (midpoint 𝕜 p₁ p₂) p₂ = ‖(2 : 𝕜)‖₊⁻¹ * nndist p₁ p₂

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
{𝕜 : Type u_6}
[NormedField 𝕜]
[NormedSpace 𝕜 V]
[Invertible 2]
(p₁ p₂ : P)

nndist (midpoint 𝕜 p₁ p₂) p₂ = ‖2‖₊⁻¹ * nndist p₁ p₂


theorem add_neg_lt_sSup {s : Set ℝ} (h : s.Nonempty) {ε : ℝ} (hε : ε < 0) :
    ∃ a ∈ s, sSup s + ε < a


@[to_additive]
theorem smul_Lp_neg (c : Mᵈᵐᵃ) (f : Lp E p μ) : c • (-f) = -(c • f)

[MeasureTheory.VAddInvariantMeasure M α μ]


theorem embDomain_mul [NonUnitalNonAssocSemiring R] (f : Γ ↪o Γ')
    (hf : ∀ x y, f (x + y) = f x + f y) (x y : HahnSeries Γ R) :
    embDomain f (x * y) = embDomain f x * embDomain f y

(hf : ∀ (x y : Γ), f (x + y) = f x + f y)

HahnSeries.embDomain f (x * y) = HahnSeries.embDomain f x * HahnSeries.embDomain f y


theorem comp_eval (p : R[X]) (q : PolynomialModule R M) (r : R) :
    eval r (comp p q) = eval (p.eval r) q

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

(PolynomialModule.eval r) ((PolynomialModule.comp p) q) = (PolynomialModule.eval (Polynomial.eval r p)) q


@[reassoc (attr := simp)]
lemma liftCycles_comp_cyclesMap (φ : S ⟶ S₁) [S₁.HasLeftHomology] :
    S.liftCycles k hk ≫ cyclesMap φ =
      S₁.liftCycles (k ≫ φ.τ₂) (by rw [assoc, φ.comm₂₃, reassoc_of% hk, zero_comp])

(hk : CategoryTheory.CategoryStruct.comp k S.g = 0)

CategoryTheory.CategoryStruct.comp (S.liftCycles k hk) (CategoryTheory.ShortComplex.cyclesMap φ) =
  S₁.liftCycles (CategoryTheory.CategoryStruct.comp k φ.τ₂) ⋯


@[simp]
theorem mem_cyclicPermutations_iff : l ∈ cyclicPermutations l' ↔ l ~r l'


theorem regulator_ne_zero : regulator K ≠ 0

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


theorem tensorRightHomEquiv_naturality {X Y Y' Z Z' : C} [ExactPairing Y Y'] (f : X ⊗ Y ⟶ Z)
    (g : Z ⟶ Z') :
    (tensorRightHomEquiv X Y Y' Z') (f ≫ g) = (tensorRightHomEquiv X Y Y' Z) f ≫ g ▷ Y'

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

(CategoryTheory.tensorRightHomEquiv X Y Y' Z') (f ≫ g) = (CategoryTheory.tensorRightHomEquiv X Y Y' Z) f ≫ g ▷ Y'


theorem coe_fst_eventuallyEq_proj (ex : x ∈ e.source) : Prod.fst ∘ e =ᶠ[𝓝 x] proj

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
{proj : Z → B}
[TopologicalSpace Z]
(e : Trivialization F proj)
{x : Z}
(ex : x ∈ e.source)


@[simp] theorem toNat_lt {n : Nat} {z : Int} (h : 0 ≤ z) : z.toNat < n ↔ z < (n : Int)


{α : Type u}
[PartialOrder α]
[OrderTop α]
[Nontrivial α]


theorem aemeasurable_of_tendsto_metrizable_ae {ι} {μ : Measure α} {f : ι → α → β} {g : α → β}
    (u : Filter ι) [hu : NeBot u] [IsCountablyGenerated u] (hf : ∀ n, AEMeasurable (f n) μ)
    (h_tendsto : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) u (𝓝 (g x))) : AEMeasurable g μ

{f : ι → α → β}

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


nonrec theorem FarFromTriangleFree.mono (hε : G.FarFromTriangleFree ε) (h : δ ≤ ε) :
    G.FarFromTriangleFree δ

{α : Type u_1}
{𝕜 : Type u_3}
[LinearOrderedField 𝕜]
{G : SimpleGraph α}
{ε δ : 𝕜}
[Fintype α]
[DecidableRel G.Adj]
(hε : G.FarFromTriangleFree ε)
(h : δ ≤ ε)


/-- A continuous map from a connected space to a disjoint union `Σ i, π i` can be lifted to one of
the components `π i`. See also `ContinuousMap.exists_lift_sigma` for a version with bundled
`ContinuousMap`s. -/
theorem Continuous.exists_lift_sigma [ConnectedSpace α] [∀ i, TopologicalSpace (π i)]
    {f : α → Σ i, π i} (hf : Continuous f) :
    ∃ (i : ι) (g : α → π i), Continuous g ∧ f = Sigma.mk i ∘ g

{α : Type u}
{ι : Type u_1}
{π : ι → Type u_2}
[TopologicalSpace α]
[ConnectedSpace α]
[(i : ι) → TopologicalSpace (π i)]
{f : α → (i : ι) × π i}
(hf : Continuous f)

∃ i g, Continuous g ∧ f = Sigma.mk i ∘ g


@[to_additive nsmul_lt_nsmul_iff_left]
theorem pow_lt_pow_iff_right' (ha : 1 < a) : a ^ m < a ^ n ↔ m < n

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

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


/--
The equivalence between `IrreducibleCloseds α` and `{x : Set α // IsClosed x ∧ IsIrreducible x }`.
-/
@[simps apply symm_apply]
def equivSubtype' : IrreducibleCloseds α ≃ { x : Set α // IsClosed x ∧ IsIrreducible x }

(a : { x // IsClosed x ∧ IsIrreducible x })

TopologicalSpace.IrreducibleCloseds.equivSubtype'.symm a = { carrier := ↑a, is_irreducible' := ⋯, is_closed' := ⋯ }


theorem rel_of_sorted_cons {a : α} {l : List α} : Sorted r (a :: l) → ∀ b ∈ l, r a b

{α : Type u}
{r : α → α → Prop}
{a : α}
{l : List α}


@[simp]
theorem algebraMap_eq_C : algebraMap K (RatFunc K) = C


theorem exists_injOn_iff_injective [Nonempty β] :
    (∃ f : α → β, InjOn f s) ↔ ∃ f : s → β, Injective f

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

(∃ f, Set.InjOn f s) ↔ ∃ f, Function.Injective f


/-- One implication of the portmanteau theorem:
Weak convergence of probability measures implies that if the boundary of a Borel set
carries no probability mass under the limit measure, then the limit of the measures of the set
equals the measure of the set under the limit probability measure.

A version with coercions to ordinary `ℝ≥0∞`-valued measures is
`MeasureTheory.ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto'`.
-/
theorem ProbabilityMeasure.tendsto_measure_of_null_frontier_of_tendsto {Ω ι : Type*} {L : Filter ι}
    [MeasurableSpace Ω] [PseudoEMetricSpace Ω] [OpensMeasurableSpace Ω] [HasOuterApproxClosed Ω]
    {μ : ProbabilityMeasure Ω} {μs : ι → ProbabilityMeasure Ω} (μs_lim : Tendsto μs L (𝓝 μ))
    {E : Set Ω} (E_nullbdry : μ (frontier E) = 0) : Tendsto (fun i => μs i E) L (𝓝 (μ E))

{μ : MeasureTheory.ProbabilityMeasure Ω}

{μs : ι → MeasureTheory.ProbabilityMeasure Ω}

Filter.Tendsto (fun i => (μs i) E) L (𝓝 (μ E))


@[to_additive (attr := simp)]
theorem pure_one : pure (1 : α) = 1


theorem eLpNorm_le_eLpNorm_mul_rpow_measure_univ {p q : ℝ≥0∞} (hpq : p ≤ q)
    (hf : AEStronglyMeasurable f μ) :
    eLpNorm f p μ ≤ eLpNorm f q μ * μ Set.univ ^ (1 / p.toReal - 1 / q.toReal)

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.eLpNorm f p μ ≤ MeasureTheory.eLpNorm f q μ * μ Set.univ ^ (1 / p.toReal - 1 / q.toReal)


lemma Kernel.apply_eq_measure_condKernel_of_compProd_eq
    {ρ : Kernel α (β × Ω)} [IsFiniteKernel ρ] {κ : Kernel (α × β) Ω} [IsFiniteKernel κ]
    (hκ : Kernel.fst ρ ⊗ₖ κ = ρ) (a : α) :
    (fun b ↦ κ (a, b)) =ᵐ[Kernel.fst ρ a] (ρ a).condKernel

{ρ : ProbabilityTheory.Kernel α (β × Ω)}

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

(fun b => κ (a, b)) =ᵐ[ρ.fst a] ⇑(ρ a).condKernel


theorem cos_eq_one_iff_of_lt_of_lt {x : ℝ} (hx₁ : -(2 * π) < x) (hx₂ : x < 2 * π) :
    cos x = 1 ↔ x = 0

{x : ℝ}
(hx₁ : -(2 * Real.pi) < x)
(hx₂ : x < 2 * Real.pi)


theorem compatible_iff_sieveCompatible (x : FamilyOfElements P (S : Presieve X)) :
    x.Compatible ↔ x.SieveCompatible

{P : CategoryTheory.Functor Cᵒᵖ (Type w)}

(x : CategoryTheory.Presieve.FamilyOfElements P S.arrows)


@[norm_cast] -- Porting note (#10618): simp can prove this
theorem coe_mul : ((f * g : PowerSeries R) : LaurentSeries R) = f * g

{R : Type u_1}
[Semiring R]
(f g : PowerSeries R)

(HahnSeries.ofPowerSeries ℤ R) (f * g) = (HahnSeries.ofPowerSeries ℤ R) f * (HahnSeries.ofPowerSeries ℤ R) g


theorem toPrimeSpectrum_range :
    Set.range (@toPrimeSpectrum R _) = { x | IsClosed ({x} : Set <| PrimeSpectrum R) }

Set.range MaximalSpectrum.toPrimeSpectrum = {x | IsClosed {x}}


/-- This universal property states that a functor `L : C ⥤ D` inverts morphisms
in `W` and the all functors `D ⥤ E` (for a fixed category `E`) uniquely factors
through `L`. -/
structure StrictUniversalPropertyFixedTarget where
  /-- the functor `L` inverts `W` -/
  inverts : W.IsInvertedBy L
  /-- any functor `C ⥤ E` which inverts `W` can be lifted as a functor `D ⥤ E`  -/
  lift : ∀ (F : C ⥤ E) (_ : W.IsInvertedBy F), D ⥤ E
  /-- there is a factorisation involving the lifted functor  -/
  fac : ∀ (F : C ⥤ E) (hF : W.IsInvertedBy F), L ⋙ lift F hF = F
  /-- uniqueness of the lifted functor -/
  uniq : ∀ (F₁ F₂ : D ⥤ E) (_ : L ⋙ F₁ = L ⋙ F₂), F₁ = F₂

(self : CategoryTheory.Localization.StrictUniversalPropertyFixedTarget L W E)


/-- An oriented angle is unchanged by replacing the third point by one weakly further away on the
same ray. -/
theorem _root_.Wbtw.oangle_eq_right {p₁ p₂ p₃ p₃' : P} (h : Wbtw ℝ p₂ p₃ p₃') (hp₃p₂ : p₃ ≠ p₂) :
    ∡ p₁ p₂ p₃ = ∡ p₁ p₂ p₃'

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

∡ p₁ p₂ p₃ = ∡ p₁ p₂ p₃'


theorem _root_.sigma_mk_injective {i : α} : Injective (@Sigma.mk α β i)

{α : Type u_1}
{β : α → Type u_4}
{i : α}


theorem Eventually.exists_forall_of_atTop [SemilatticeSup α] [Nonempty α] {p : α → Prop}
    (h : ∀ᶠ x in atTop, p x) : ∃ a, ∀ b ≥ a, p b

{α : Type u_3}
[SemilatticeSup α]
[Nonempty α]
{p : α → Prop}
(h : ∀ᶠ (x : α) in Filter.atTop, p x)


@[to_additive addCHaar_mem_addHaarProduct]
theorem chaar_mem_haarProduct (K₀ : PositiveCompacts G) : chaar K₀ ∈ haarProduct (K₀ : Set G)

(K₀ : TopologicalSpace.PositiveCompacts G)

MeasureTheory.Measure.haar.addCHaar K₀ ∈ MeasureTheory.Measure.haar.addHaarProduct ↑K₀


@[simp]
theorem filter_neg [∀ i, AddGroup (β i)] (p : ι → Prop) [DecidablePred p] (f : Π₀ i, β i) :
    (-f).filter p = -f.filter p

{ι : Type u}
{β : ι → Type v}
[(i : ι) → AddGroup (β i)]
(p : ι → Prop)
[DecidablePred p]
(f : Π₀ (i : ι), β i)

DFinsupp.filter p (-f) = -DFinsupp.filter p f


theorem prod_antilipschitzWith_equiv_aux [PseudoEMetricSpace α] [PseudoEMetricSpace β] :
    AntilipschitzWith ((2 : ℝ≥0) ^ (1 / p).toReal) (WithLp.equiv p (α × β))

(p : ℝ≥0∞)
(α : Type u_2)
(β : Type u_3)
[hp : Fact (1 ≤ p)]
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]

AntilipschitzWith (2 ^ (1 / p).toReal) ⇑(WithLp.equiv p (α × β))


theorem mirror_eval_one : p.mirror.eval 1 = p.eval 1

{R : Type u_1}
[Semiring R]
(p : Polynomial R)

Polynomial.eval 1 p.mirror = Polynomial.eval 1 p


@[simp]
theorem card_incidenceFinset_eq_degree [DecidableEq V] :
    (G.incidenceFinset v).card = G.degree v

{V : Type u_1}
(G : SimpleGraph V)
(v : V)
[Fintype ↑(G.neighborSet v)]
[DecidableEq V]


@[simp, mfld_simps]
theorem hom_trivializationAt_target (x₀ : B) :
    (trivializationAt (F₁ →SL[σ] F₂) (fun x => E₁ x →SL[σ] E₂ x) x₀).target =
      ((trivializationAt F₁ E₁ x₀).baseSet ∩ (trivializationAt F₂ E₂ x₀).baseSet) ×ˢ Set.univ

(σ : 𝕜₁ →+* 𝕜₂)

[TopologicalSpace (Bundle.TotalSpace F₁ E₁)]

[TopologicalSpace (Bundle.TotalSpace F₂ E₂)]


@[simp]
theorem map_tail (f : α → β) : ∀ s, map f (tail s) = tail (map f s)

{α : Type u}
{β : Type v}
(f : α → β)
(s : Stream'.Seq α)

Stream'.Seq.map f s.tail = (Stream'.Seq.map f s).tail


theorem measurable_to_countable [MeasurableSpace α] [Countable α] [MeasurableSpace β] {f : β → α}
    (h : ∀ y, MeasurableSet (f ⁻¹' {f y})) : Measurable f

(h : ∀ (y : β), MeasurableSet (f ⁻¹' {f y}))


/-- A morphism of schemes `f : X ⟶ Y` is locally of finite type if for each affine `U ⊆ Y` and
`V ⊆ f ⁻¹' U`, The induced map `Γ(Y, U) ⟶ Γ(X, V)` is of finite type.
-/
@[mk_iff]
class LocallyOfFiniteType (f : X ⟶ Y) : Prop where
  finiteType_of_affine_subset :
    ∀ (U : Y.affineOpens) (V : X.affineOpens) (e : V.1 ≤ f ⁻¹ᵁ U.1), (f.appLE U V e).FiniteType

[self : AlgebraicGeometry.LocallyOfFiniteType f]

(e : ↑V ≤ (TopologicalSpace.Opens.map f.val.base).obj ↑U)

RingHom.FiniteType (AlgebraicGeometry.Scheme.Hom.appLE f (↑U) (↑V) e)


theorem disjoint_map_inl_map_inr : Disjoint (s.map Embedding.inl) (t.map Embedding.inr)

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

Disjoint (Finset.map Function.Embedding.inl s) (Finset.map Function.Embedding.inr t)


@[simp]
theorem boundedBy_eq_self (m : OuterMeasure α) : boundedBy m = m

{α : Type u_1}
(m : MeasureTheory.OuterMeasure α)

MeasureTheory.OuterMeasure.boundedBy ⇑m = m


@[simp]
theorem GroupSMul.linearMap_apply [Monoid G] [CommSemiring k] (V : Type u₃) [AddCommMonoid V]
    [Module k V] [Module (MonoidAlgebra k G) V] [IsScalarTower k (MonoidAlgebra k G) V] (g : G)
    (v : V) : (GroupSMul.linearMap k V g) v = single g (1 : k) • v

(k : Type u₁)
{G : Type u₂}
[Monoid G]
[CommSemiring k]
(V : Type u₃)
[AddCommMonoid V]
[Module k V]
[Module (MonoidAlgebra k G) V]
[IsScalarTower k (MonoidAlgebra k G) V]
(g : G)
(v : V)

(MonoidAlgebra.GroupSMul.linearMap k V g) v = MonoidAlgebra.single g 1 • v


@[simp]
theorem relabelAux_sum_inl (k : ℕ) :
    relabelAux (Sum.inl : α → α ⊕ (Fin n)) k = Sum.map id (natAdd n)

FirstOrder.Language.BoundedFormula.relabelAux Sum.inl k = Sum.map id (Fin.natAdd n)


theorem exp_neg (x : 𝔸) : exp 𝕂 (-x) = (exp 𝕂 x)⁻¹

{𝕂 : Type u_1}
{𝔸 : Type u_2}
[RCLike 𝕂]
[NormedDivisionRing 𝔸]
[NormedAlgebra 𝕂 𝔸]
[CompleteSpace 𝔸]
(x : 𝔸)

NormedSpace.exp 𝕂 (-x) = (NormedSpace.exp 𝕂 x)⁻¹


theorem setToSimpleFunc_congr (T : Set α → E →L[ℝ] F)
    (h_zero : ∀ s, MeasurableSet s → μ s = 0 → T s = 0) (h_add : FinMeasAdditive μ T) {f g : α →ₛ E}
    (hf : Integrable f μ) (h : f =ᵐ[μ] g) : f.setToSimpleFunc T = g.setToSimpleFunc T

(h_zero : ∀ (s : Set α), MeasurableSet s → μ s = 0 → T s = 0)

(h_add : MeasureTheory.FinMeasAdditive μ T)

MeasureTheory.SimpleFunc.setToSimpleFunc T f = MeasureTheory.SimpleFunc.setToSimpleFunc T g


@[reassoc (attr := simp)]
theorem pullbackAssoc_inv_fst_snd [HasPullback ((pullback.snd _ _ : Z₁ ⟶ X₂) ≫ f₃) f₄]
    [HasPullback f₁ ((pullback.fst _ _ : Z₂ ⟶ X₂) ≫ f₂)] :
    (pullbackAssoc f₁ f₂ f₃ f₄).inv ≫ pullback.fst _ _ ≫ pullback.snd _ _ =
    pullback.snd _ _ ≫ pullback.fst _ _

[CategoryTheory.Limits.HasPullback (CategoryTheory.Limits.pullback.snd f₁ f₂ ≫ f₃) f₄]

[CategoryTheory.Limits.HasPullback f₁ (CategoryTheory.Limits.pullback.fst f₃ f₄ ≫ f₂)]

(CategoryTheory.Limits.pullbackAssoc f₁ f₂ f₃ f₄).inv ≫
    CategoryTheory.Limits.pullback.fst (CategoryTheory.Limits.pullback.snd f₁ f₂ ≫ f₃) f₄ ≫
      CategoryTheory.Limits.pullback.snd f₁ f₂ =
  CategoryTheory.Limits.pullback.snd f₁ (CategoryTheory.Limits.pullback.fst f₃ f₄ ≫ f₂) ≫
    CategoryTheory.Limits.pullback.fst f₃ f₄


@[simp] theorem decomposeLinearEquiv_symm_comp_lof (i : ι) :
    (decomposeLinearEquiv ℳ).symm ∘ₗ lof R ι (ℳ ·) i = (ℳ i).subtype

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
[DecidableEq ι]
[Semiring R]
[AddCommMonoid M]
[Module R M]
(ℳ : ι → Submodule R M)
[DirectSum.Decomposition ℳ]
(i : ι)

↑(DirectSum.decomposeLinearEquiv ℳ).symm ∘ₗ DirectSum.lof R ι (fun x => ↥(ℳ x)) i = (ℳ i).subtype


@[simp]
theorem isoSheafify_hom {P : Cᵒᵖ ⥤ D} (hP : Presheaf.IsSheaf J P) :
    (J.isoSheafify hP).hom = J.toSheafify P

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


theorem map_esymm (n : ℕ) (f : R →+* S) : map f (esymm σ R n) = esymm σ S n

(σ : Type u_1)
(R : Type u_2)
{S : Type u_4}
[CommSemiring R]
[CommSemiring S]
[Fintype σ]
(n : ℕ)
(f : R →+* S)

(MvPolynomial.map f) (MvPolynomial.esymm σ R n) = MvPolynomial.esymm σ S n


@[to_additive]
theorem smul_set_iUnion₂ (a : α) (s : ∀ i, κ i → Set β) :
    (a • ⋃ (i) (j), s i j) = ⋃ (i) (j), a • s i j

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

a • ⋃ i, ⋃ j, s i j = ⋃ i, ⋃ j, a • s i j


protected theorem Decomposition.isInternal : DirectSum.IsInternal ℳ

{ι : Type u_1}
{M : Type u_3}
{σ : Type u_4}
[DecidableEq ι]
[AddCommMonoid M]
[SetLike σ M]
[AddSubmonoidClass σ M]
(ℳ : ι → σ)
[DirectSum.Decomposition ℳ]