@[to_additive (attr := simp)]
theorem prod_filter_mul_prod_filter_not [CommMonoid N] (g : α → M → N) :
    (f.filter p).prod g * (f.filter fun a => ¬p a).prod g = f.prod g

{α : Type u_1}
{M : Type u_5}
{N : Type u_7}
[Zero M]
(p : α → Prop)
[DecidablePred p]
(f : α →₀ M)
[AddCommMonoid N]
(g : α → M → N)

(Finsupp.filter p f).sum g + (Finsupp.filter (fun a => ¬p a) f).sum g = f.sum g


@[simp]
theorem tropOrderIso_coe_fn [Preorder R] : (tropOrderIso : R → Tropical R) = trop


theorem integral_le_measure_closedBall : ∫ x, f x ∂μ ≤ (μ (closedBall c f.rOut)).toReal

∫ (x : E), ↑f x ∂μ ≤ (μ (Metric.closedBall c f.rOut)).toReal


@[simp]
lemma toNNReal_lt_natCast' {n : ℕ} {r : ℝ} : r.toNNReal < n ↔ r < n ∧ n ≠ 0


theorem desc_fac (F : J ⥤ PresheafedSpace.{_, _, v} C) (s : Cocone F) (j : J) :
    (colimitCocone F).ι.app j ≫ desc F s = s.ι.app j

[∀ (X : TopCat), CategoryTheory.Limits.HasLimitsOfShape Jᵒᵖ (TopCat.Presheaf C X)]

(F : J ⥤ AlgebraicGeometry.PresheafedSpace C)

(AlgebraicGeometry.PresheafedSpace.colimitCocone F).ι.app j ≫
    AlgebraicGeometry.PresheafedSpace.ColimitCoconeIsColimit.desc F s =
  s.ι.app j


@[simp]
theorem map_algebraMap (r : R) (f : α → β) (hf : f 0 = 0)
    (hf₂ : f (algebraMap R α r) = algebraMap R β r) :
    (algebraMap R (Matrix n n α) r).map f = algebraMap R (Matrix n n β) r

(hf₂ : f ((algebraMap R α) r) = (algebraMap R β) r)

((algebraMap R (Matrix n n α)) r).map f = (algebraMap R (Matrix n n β)) r


@[to_additive]
theorem tprod_eq_tprod_of_ne_one_bij {g : γ → α} (i : mulSupport g → β) (hi : Injective i)
    (hf : mulSupport f ⊆ Set.range i) (hfg : ∀ x, f (i x) = g x) : ∏' x, f x = ∏' y, g y

(hfg : ∀ (x : ↑(Function.support g)), f (i x) = g ↑x)


theorem image_symm_image_of_subset_target {s : Set β} (h : s ⊆ e.target) : e '' (e.symm '' s) = s

{α : Type u_1}
{β : Type u_2}
(e : PartialEquiv α β)
{s : Set β}
(h : s ⊆ e.target)


theorem mem_ker_truncate (x : 𝕎 R) :
    x ∈ RingHom.ker (@truncate p _ n R _) ↔ ∀ i < n, x.coeff i = 0

{p : ℕ}
[hp : Fact (Nat.Prime p)]
(n : ℕ)
{R : Type u_1}
[CommRing R]
(x : 𝕎 R)

x ∈ RingHom.ker (WittVector.truncate n) ↔ ∀ i < n, x.coeff i = 0


theorem deriv_mem_iff {f : 𝕜 → F} {s : Set F} {x : 𝕜} :
    deriv f x ∈ s ↔
      DifferentiableAt 𝕜 f x ∧ deriv f x ∈ s ∨ ¬DifferentiableAt 𝕜 f x ∧ (0 : F) ∈ s

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{s : Set F}
{x : 𝕜}

deriv f x ∈ s ↔ DifferentiableAt 𝕜 f x ∧ deriv f x ∈ s ∨ ¬DifferentiableAt 𝕜 f x ∧ 0 ∈ s


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

BddOrd.dual.obj X = BddOrd.of (↑X.toPartOrd)ᵒᵈ


/-- Construct a cocone on `F` from an object of the category `(F ↓ Δ)`. This is part of an
    equivalence, see `Cocone.equivStructuredArrow`. -/
@[simps]
def Cocone.fromStructuredArrow (F : J ⥤ C) : StructuredArrow F (const J) ⥤ Cocone 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.StructuredArrow F (CategoryTheory.Functor.const J)} (f : X ⟶ Y),
  ((CategoryTheory.Limits.Cocone.fromStructuredArrow F).map f).hom = f.right


@[simp]
theorem image_sub_const_Ioc : (fun x => x - a) '' Ioc b c = Ioc (b - a) (c - a)

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

(fun x => x - a) '' Set.Ioc b c = Set.Ioc (b - a) (c - a)


@[simp, norm_cast]
theorem coe_comp (h : B →A[R] C) (f : A →A[R] B) :
    (h.comp f : A →ₐ[R] C) = (h : B →ₐ[R] C).comp (f : A →ₐ[R] B)

{R : Type u_1}
[CommSemiring R]
{A : Type u_2}
[Semiring A]
[TopologicalSpace A]
{B : Type u_3}
[Semiring B]
[TopologicalSpace B]
[Algebra R A]
[Algebra R B]
{C : Type u_4}
[Semiring C]
[Algebra R C]
[TopologicalSpace C]
(h : B →A[R] C)
(f : A →A[R] B)


protected theorem isWellOrder : ∀ (_ : r ↪r s) [IsWellOrder β s], IsWellOrder α r

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}

r ↪r s → ∀ [inst : IsWellOrder β s], IsWellOrder α r


theorem suffix_refl (l : List α) : l <:+ l


/-- If a function is integrable with respect to a given measure `μ` then it is interval integrable
  with respect to `μ` on `uIcc a b`. -/
theorem MeasureTheory.Integrable.intervalIntegrable (hf : Integrable f μ) :
    IntervalIntegrable f μ a b

{E : Type u_3}
[NormedAddCommGroup E]
{f : ℝ → E}
{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}
(hf : MeasureTheory.Integrable f μ)


theorem tendsto_logb_atTop : Tendsto (logb b) atTop atTop

Filter.Tendsto (Real.logb b) Filter.atTop Filter.atTop


theorem LineDifferentiableWithinAt.smul (h : LineDifferentiableWithinAt 𝕜 f s x v) (c : 𝕜) :
    LineDifferentiableWithinAt 𝕜 f s x (c • v)


/-- If `C` is filtered, then `F : C ⥤ D` is final if and only if `StructuredArrow d F` is filtered
    for all `d : D`. -/
theorem Functor.final_iff_isFiltered_structuredArrow [IsFilteredOrEmpty C] :
    Final F ↔ ∀ d, IsFiltered (StructuredArrow d F)

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

F.Final ↔ ∀ (d : D), CategoryTheory.IsFiltered (CategoryTheory.StructuredArrow d F)


theorem Indep.basis_insert_iff (hI : M.Indep I) :
    M.Basis I (insert e I) ↔ M.Dep (insert e I) ∨ e ∈ I

{α : Type u_1}
{M : Matroid α}
{I : Set α}
{e : α}
(hI : M.Indep I)


@[simp]
theorem nhdsWithin_Ioo_eq_nhdsWithin_Iio (h : a < b) : 𝓝[Ioo a b] b = 𝓝[<] b

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


@[deprecated rpow_inv_le_iff (since := "2024-07-10")]
theorem rpow_one_div_le_iff {x y : ℝ≥0∞} {z : ℝ} (hz : 0 < z) : x ^ (1 / z) ≤ y ↔ x ≤ y ^ z


/-- `biproduct_comparison F f` is a split epimorphism. -/
@[simps]
def splitEpiBiproductComparison : SplitEpi (biproductComparison F f)

[CategoryTheory.Limits.HasBiproduct (F.obj ∘ f)]

(F.splitEpiBiproductComparison f).section_ = F.biproductComparison' f


theorem ortho_comm (H : B.IsSymm) {x y} : IsOrtho B x y ↔ IsOrtho B y x

{R : Type u_1}
{M : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{I : R →+* R}
{B : M →ₛₗ[I] M →ₗ[R] R}
(H : B.IsSymm)
{x y : M}


@[simp] theorem rotateRight_zero (l : List α) : rotateRight l 0 = l


theorem comp_eq : (f ≫ show B ⟶ Grp.of SX' from g) = f ≫ show B ⟶ Grp.of SX' from h

CategoryTheory.CategoryStruct.comp f
    (let_fun this := Grp.SurjectiveOfEpiAuxs.g f;
    this) =
  CategoryTheory.CategoryStruct.comp f
    (let_fun this := Grp.SurjectiveOfEpiAuxs.h f;
    this)


theorem ae_eq_set_inter {s' t' : Set α} (h : s =ᵐ[μ] t) (h' : s' =ᵐ[μ] t') :
    (s ∩ s' : Set α) =ᵐ[μ] (t ∩ t' : Set α)

{α : Type u_1}
{F : Type u_3}
[FunLike F (Set α) ℝ≥0∞]
[MeasureTheory.OuterMeasureClass F α]
{μ : F}
{s t s' t' : Set α}
(h : s =ᵐ[μ] t)
(h' : s' =ᵐ[μ] t')


@[to_additive (attr := simp) add_le_iff_nonpos_left]
theorem mul_le_iff_le_one_left' [CovariantClass α α (swap (· * ·)) (· ≤ ·)]
    [ContravariantClass α α (swap (· * ·)) (· ≤ ·)] {a b : α} :
    a * b ≤ b ↔ a ≤ 1

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

[ContravariantClass α α (Function.swap fun x x_1 => x * x_1) fun x x_1 => x ≤ x_1]


theorem InjOn.image_iInter_eq [Nonempty ι] {s : ι → Set α} {f : α → β} (h : InjOn f (⋃ i, s i)) :
    (f '' ⋂ i, s i) = ⋂ i, f '' s i

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
[Nonempty ι]
{s : ι → Set α}
{f : α → β}
(h : Set.InjOn f (⋃ i, s i))


theorem monotone_face {n} (i : Fin (n + 1)) : Monotone fun I ↦ face I i


lemma coe_algEquiv_symm :
    ((Localization.algEquiv M S).symm : S →+* Localization M) =
    IsLocalization.map (M := M) (T := M) _ (RingHom.id R) le_rfl

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
(S : Type u_2)
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]

↑(Localization.algEquiv M S).symm = IsLocalization.map (Localization M) (RingHom.id R) ⋯


theorem mem_annihilator' {r} : r ∈ N.annihilator ↔ N ≤ comap (r • (LinearMap.id : M →ₗ[R] M)) ⊥

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{N : Submodule R M}
{r : R}

r ∈ N.annihilator ↔ N ≤ Submodule.comap (r • LinearMap.id) ⊥


{α : Type u}
[PartialOrder α]
[OrderTop α]
{a : α}
(h : a ≠ ⊤)


@[simp]
theorem LinearMap.mkContinuous_apply (C : ℝ) (h : ∀ x, ‖f x‖ ≤ C * ‖x‖) (x : E) :
    f.mkContinuous C h x = f x

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_3}
{F : Type u_4}
[Ring 𝕜]
[Ring 𝕜₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[Module 𝕜 E]
[Module 𝕜₂ F]
{σ : 𝕜 →+* 𝕜₂}
(f : E →ₛₗ[σ] F)
(C : ℝ)
(h : ∀ (x : E), ‖f x‖ ≤ C * ‖x‖)
(x : E)


theorem or_eq_of_eq_true_right {a b : Prop} (h : b = True) : (a ∨ b) = True


lemma opShiftFunctorEquivalence_counitIso_hom_app_shift (X : Cᵒᵖ) (n : ℤ) :
    (opShiftFunctorEquivalence C n).counitIso.hom.app (X⟦n⟧) =
      ((opShiftFunctorEquivalence C n).unitIso.inv.app X)⟦n⟧'

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.HasShift C ℤ]
(X : Cᵒᵖ)
(n : ℤ)

(CategoryTheory.Pretriangulated.opShiftFunctorEquivalence C n).counitIso.hom.app
    ((CategoryTheory.shiftFunctor Cᵒᵖ n).obj X) =
  (CategoryTheory.shiftFunctor Cᵒᵖ n).map
    ((CategoryTheory.Pretriangulated.opShiftFunctorEquivalence C n).unitIso.inv.app X)


theorem nodup_middle {a : α} {l₁ l₂ : List α} :
    Nodup (l₁ ++ a :: l₂) ↔ Nodup (a :: (l₁ ++ l₂))

(l₁ ++ a :: l₂).Nodup ↔ (a :: (l₁ ++ l₂)).Nodup


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

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


@[simp]
lemma homMk₃_app_three : (homMk₃ app₀ app₁ app₂ app₃ w₀ w₁ w₂).app ⟨3, by valid⟩ = app₃

{f g : CategoryTheory.ComposableArrows C 3}

(w₀ :
  CategoryTheory.CategoryStruct.comp (f.map' 0 1 ⋯ ⋯) app₁ = CategoryTheory.CategoryStruct.comp app₀ (g.map' 0 1 ⋯ ⋯))

(w₁ :
  CategoryTheory.CategoryStruct.comp (f.map' 1 2 ⋯ ⋯) app₂ = CategoryTheory.CategoryStruct.comp app₁ (g.map' 1 2 ⋯ ⋯))

(w₂ :
  CategoryTheory.CategoryStruct.comp (f.map' 2 3 ⋯ ⋯) app₃ = CategoryTheory.CategoryStruct.comp app₂ (g.map' 2 3 ⋯ ⋯))

(CategoryTheory.ComposableArrows.homMk₃ app₀ app₁ app₂ app₃ w₀ w₁ w₂).app ⟨3, ⋯⟩ = app₃


protected theorem subsingleton [IsDirected α r] (h : IsStrongAntichain r s) : s.Subsingleton

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
[IsDirected α r]
(h : IsStrongAntichain r s)


@[simp]
theorem insert_fz (a : α) (v : Vector3 α n) : insert a v fz = a :: v

{α : Type u_1}
{n : ℕ}
(a : α)
(v : Vector3 α n)

Vector3.insert a v Fin2.fz = Vector3.cons a v


@[to_additive]
theorem map_ne_one_iff {M N} [MulOneClass M] [MulOneClass N] [EquivLike F M N] [MulEquivClass F M N]
    (h : F) {x : M} :
    h x ≠ 1 ↔ x ≠ 1

{F : Type u_1}
{M : Type u_12}
{N : Type u_13}
[MulOneClass M]
[MulOneClass N]
[EquivLike F M N]
[MulEquivClass F M N]
(h : F)
{x : M}


/-- If `G` acts isometrically on `X`, then the image of a bounded set in `X` under scalar
multiplication by `c : G` is bounded. See also `Bornology.IsBounded.smul₀` for a similar lemma about
normed spaces. -/
@[to_additive "Given an additive isometric action of `G` on `X`, the image of a bounded set in `X`
under translation by `c : G` is bounded"]
theorem Bornology.IsBounded.smul [PseudoMetricSpace X] [SMul G X] [IsometricSMul G X] {s : Set X}
    (hs : IsBounded s) (c : G) : IsBounded (c • s)

{G : Type v}
{X : Type w}
[PseudoMetricSpace X]
[VAdd G X]
[IsometricVAdd G X]
{s : Set X}
(hs : Bornology.IsBounded s)
(c : G)


theorem AlgEquiv.transfer_normal (f : E ≃ₐ[F] E') : Normal F E ↔ Normal F E'

{F : Type u_1}
{E : Type u_3}
{E' : Type u_4}
[Field F]
[Field E]
[Algebra F E]
[Field E']
[Algebra F E']
(f : E ≃ₐ[F] E')


theorem ManyOneReducible.mk {α β} [Primcodable α] [Primcodable β] {f : α → β} (q : β → Prop)
    (h : Computable f) : (fun a => q (f a)) ≤₀ q

{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{f : α → β}
(q : β → Prop)
(h : Computable f)


theorem paste_vert_iff {X₁₁ X₁₂ X₂₁ X₂₂ X₃₁ X₃₂ : C} {h₁₁ : X₁₁ ⟶ X₁₂} {h₂₁ : X₂₁ ⟶ X₂₂}
    {h₃₁ : X₃₁ ⟶ X₃₂} {v₁₁ : X₁₁ ⟶ X₂₁} {v₁₂ : X₁₂ ⟶ X₂₂} {v₂₁ : X₂₁ ⟶ X₃₁} {v₂₂ : X₂₂ ⟶ X₃₂}
    (s : IsPullback h₂₁ v₂₁ v₂₂ h₃₁) (e : h₁₁ ≫ v₁₂ = v₁₁ ≫ h₂₁) :
    IsPullback h₁₁ (v₁₁ ≫ v₂₁) (v₁₂ ≫ v₂₂) h₃₁ ↔ IsPullback h₁₁ v₁₁ v₁₂ h₂₁

{X₁₁ X₁₂ X₂₁ X₂₂ X₃₁ X₃₂ : C}

{h₁₁ : X₁₁ ⟶ X₁₂}

{h₂₁ : X₂₁ ⟶ X₂₂}

{h₃₁ : X₃₁ ⟶ X₃₂}

{v₁₁ : X₁₁ ⟶ X₂₁}

{v₁₂ : X₁₂ ⟶ X₂₂}

{v₂₁ : X₂₁ ⟶ X₃₁}

{v₂₂ : X₂₂ ⟶ X₃₂}

(s : CategoryTheory.IsPullback h₂₁ v₂₁ v₂₂ h₃₁)

(e : h₁₁ ≫ v₁₂ = v₁₁ ≫ h₂₁)

CategoryTheory.IsPullback h₁₁ (v₁₁ ≫ v₂₁) (v₁₂ ≫ v₂₂) h₃₁ ↔ CategoryTheory.IsPullback h₁₁ v₁₁ v₁₂ h₂₁


@[simp] theorem run_modifyGet [Monad m] (f : σ → α × σ) (s : σ) : (modifyGet f : StateT σ m α).run s = pure ((f s).1, (f s).2)

{m : Type u_1 → Type u_2}
{σ α : Type u_1}
[Monad m]
(f : σ → α × σ)
(s : σ)

(modifyGet f).run s = pure ((f s).fst, (f s).snd)


theorem eq_compl_iff_isCompl : x = yᶜ ↔ IsCompl x y

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


theorem pure_le_iff {a : α} {l : Filter α} : pure a ≤ l ↔ ∀ s ∈ l, a ∈ s


@[simp]
theorem Iic_union_Ico_eq_Iio (h : a < b) : Iic a ∪ Ico a b = Iio b

{α : Type u_1}
[LinearOrder α]
{a b : α}
(h : a < b)


theorem isSheaf_of_isTerminal {X : A} (hX : IsTerminal X) :
    Presheaf.IsSheaf J ((CategoryTheory.Functor.const _).obj X)

(J : CategoryTheory.GrothendieckTopology C)

(hX : CategoryTheory.Limits.IsTerminal X)

CategoryTheory.Presheaf.IsSheaf J ((CategoryTheory.Functor.const Cᵒᵖ).obj X)


/-- A copy of `EuclideanSpace.volume_preserving_measurableEquiv` for the canonical spelling of the
equivalence. -/
theorem PiLp.volume_preserving_equiv : MeasurePreserving (WithLp.equiv 2 (ι → ℝ))

MeasureTheory.MeasurePreserving (⇑(WithLp.equiv 2 (ι → ℝ))) MeasureTheory.volume MeasureTheory.volume


/-- A filter `F` on a type `α` is a collection of sets of `α` which contains the whole `α`,
is upwards-closed, and is stable under intersection. We do not forbid this collection to be
all sets of `α`. -/
structure Filter (α : Type*) where
  /-- The set of sets that belong to the filter. -/
  sets : Set (Set α)
  /-- The set `Set.univ` belongs to any filter. -/
  univ_sets : Set.univ ∈ sets
  /-- If a set belongs to a filter, then its superset belongs to the filter as well. -/
  sets_of_superset {x y} : x ∈ sets → x ⊆ y → y ∈ sets
  /-- If two sets belong to a filter, then their intersection belongs to the filter as well. -/
  inter_sets {x y} : x ∈ sets → y ∈ sets → x ∩ y ∈ sets

{α : Type u_1}
(self : Filter α)
{x y : Set α}

x ∈ self.sets → y ∈ self.sets → x ∩ y ∈ self.sets


/-- Variant of Minkowski's inequality for functions `α → ℝ≥0∞` in `ℒp` with `p ≤ 1`: the `ℒp`
seminorm of the sum of two functions is bounded by a constant multiple of the sum
of their `ℒp` seminorms. -/
theorem lintegral_Lp_add_le_of_le_one {p : ℝ} {f g : α → ℝ≥0∞} (hf : AEMeasurable f μ) (hp0 : 0 ≤ p)
    (hp1 : p ≤ 1) :
    (∫⁻ a, (f + g) a ^ p ∂μ) ^ (1 / p) ≤
      (2 : ℝ≥0∞) ^ (1 / p - 1) * ((∫⁻ a, f a ^ p ∂μ) ^ (1 / p) + (∫⁻ a, g a ^ p ∂μ) ^ (1 / p))

{α : Type u_1}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{p : ℝ}
{f g : α → ENNReal}
(hf : AEMeasurable f μ)
(hp0 : 0 ≤ p)
(hp1 : p ≤ 1)


/-- A more convenient way of obtaining a unique gluing of sections for a sheaf.
-/
theorem existsUnique_gluing (sf : ∀ i : ι, F.1.obj (op (U i))) (h : IsCompatible F.1 U sf) :
    ∃! s : F.1.obj (op (iSup U)), IsGluing F.1 U sf s

(sf : (i : ι) → (CategoryTheory.forget C).obj (F.val.obj (Opposite.op (U i))))

(h : TopCat.Presheaf.IsCompatible F.val U sf)

∃! s, TopCat.Presheaf.IsGluing F.val U sf s


/-- This is a mixin class describing a locally finite order,
that is, is an order where bounded intervals are finite.
When you don't care too much about definitional equality, you can use `LocallyFiniteOrder.ofIcc` or
`LocallyFiniteOrder.ofFiniteIcc` to build a locally finite order from just `Finset.Icc`. -/
class LocallyFiniteOrder (α : Type*) [Preorder α] where
  /-- Left-closed right-closed interval -/
  finsetIcc : α → α → Finset α
  /-- Left-closed right-open interval -/
  finsetIco : α → α → Finset α
  /-- Left-open right-closed interval -/
  finsetIoc : α → α → Finset α
  /-- Left-open right-open interval -/
  finsetIoo : α → α → Finset α
  /-- `x ∈ finsetIcc a b ↔ a ≤ x ∧ x ≤ b` -/
  finset_mem_Icc : ∀ a b x : α, x ∈ finsetIcc a b ↔ a ≤ x ∧ x ≤ b
  /-- `x ∈ finsetIco a b ↔ a ≤ x ∧ x < b` -/
  finset_mem_Ico : ∀ a b x : α, x ∈ finsetIco a b ↔ a ≤ x ∧ x < b
  /-- `x ∈ finsetIoc a b ↔ a < x ∧ x ≤ b` -/
  finset_mem_Ioc : ∀ a b x : α, x ∈ finsetIoc a b ↔ a < x ∧ x ≤ b
  /-- `x ∈ finsetIoo a b ↔ a < x ∧ x < b` -/
  finset_mem_Ioo : ∀ a b x : α, x ∈ finsetIoo a b ↔ a < x ∧ x < b

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

x ∈ LocallyFiniteOrder.finsetIoc a b ↔ a < x ∧ x ≤ b


(K : Type u_1)
[Field K]
[NumberField K]
[DecidableEq (K →+* ℂ)]


theorem effectiveEpiFamilyStructOfEquivalence_aux {W : D} (ε : (a : α) → e.functor.obj (X a) ⟶ W)
    (h : ∀ {Z : D} (a₁ a₂ : α) (g₁ : Z ⟶ e.functor.obj (X a₁)) (g₂ : Z ⟶ e.functor.obj (X a₂)),
      g₁ ≫ e.functor.map (π a₁) = g₂ ≫ e.functor.map (π a₂) → g₁ ≫ ε a₁ = g₂ ≫ ε a₂)
    {Z : C} (a₁ a₂ : α) (g₁ : Z ⟶ X a₁) (g₂ : Z ⟶ X a₂) (hg : g₁ ≫ π a₁ = g₂ ≫ π a₂) :
    g₁ ≫ (fun a ↦ e.unit.app (X a) ≫ e.inverse.map (ε a)) a₁ =
    g₂ ≫ (fun a ↦ e.unit.app (X a) ≫ e.inverse.map (ε a)) a₂

(h :
  ∀ {Z : D} (a₁ a₂ : α) (g₁ : Z ⟶ e.functor.obj (X a₁)) (g₂ : Z ⟶ e.functor.obj (X a₂)),
    CategoryTheory.CategoryStruct.comp g₁ (e.functor.map (π a₁)) =
        CategoryTheory.CategoryStruct.comp g₂ (e.functor.map (π a₂)) →
      CategoryTheory.CategoryStruct.comp g₁ (ε a₁) = CategoryTheory.CategoryStruct.comp g₂ (ε a₂))

(hg : CategoryTheory.CategoryStruct.comp g₁ (π a₁) = CategoryTheory.CategoryStruct.comp g₂ (π a₂))

CategoryTheory.CategoryStruct.comp g₁
    ((fun a => CategoryTheory.CategoryStruct.comp (e.unit.app (X a)) (e.inverse.map (ε a))) a₁) =
  CategoryTheory.CategoryStruct.comp g₂
    ((fun a => CategoryTheory.CategoryStruct.comp (e.unit.app (X a)) (e.inverse.map (ε a))) a₂)


@[simp] lemma neg_cons (x : α) (v : Fin n → α) : -vecCons x v = vecCons (-x) (-v)

{α : Type u_1}
{n : ℕ}
[Neg α]
(x : α)
(v : Fin n → α)

-Matrix.vecCons x v = Matrix.vecCons (-x) (-v)


@[simp, mfld_simps]
theorem inter_subset_left {s t : Set α} : s ∩ t ⊆ s


theorem evalWhiskerLeft_comp {η : h ⟶ i} {θ : g ⊗ h ⟶ g ⊗ i} {ι : f ⊗ g ⊗ h ⟶ f ⊗ g ⊗ i}
    {ι' : f ⊗ g ⊗ h ⟶ (f ⊗ g) ⊗ i} {ι'' : (f ⊗ g) ⊗ h ⟶ (f ⊗ g) ⊗ i}
    (pf_θ : g ◁ η = θ) (pf_ι : f ◁ θ = ι)
    (pf_ι' : ι ≫ (α_ _ _ _).inv = ι') (pf_ι'' : (α_ _ _ _).hom ≫ ι' = ι'') :
    (f ⊗ g) ◁ η = ι''

{θ : CategoryTheory.MonoidalCategory.tensorObj g h ⟶ CategoryTheory.MonoidalCategory.tensorObj g i}

{ι :
  CategoryTheory.MonoidalCategory.tensorObj f (CategoryTheory.MonoidalCategory.tensorObj g h) ⟶
    CategoryTheory.MonoidalCategory.tensorObj f (CategoryTheory.MonoidalCategory.tensorObj g i)}

{ι' :
  CategoryTheory.MonoidalCategory.tensorObj f (CategoryTheory.MonoidalCategory.tensorObj g h) ⟶
    CategoryTheory.MonoidalCategory.tensorObj (CategoryTheory.MonoidalCategory.tensorObj f g) i}

{ι'' :
  CategoryTheory.MonoidalCategory.tensorObj (CategoryTheory.MonoidalCategory.tensorObj f g) h ⟶
    CategoryTheory.MonoidalCategory.tensorObj (CategoryTheory.MonoidalCategory.tensorObj f g) i}

(pf_θ : CategoryTheory.MonoidalCategory.whiskerLeft g η = θ)

(pf_ι : CategoryTheory.MonoidalCategory.whiskerLeft f θ = ι)

(pf_ι' : CategoryTheory.CategoryStruct.comp ι (CategoryTheory.MonoidalCategory.associator f g i).inv = ι')

(pf_ι'' : CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator f g h).hom ι' = ι'')

CategoryTheory.MonoidalCategory.whiskerLeft (CategoryTheory.MonoidalCategory.tensorObj f g) η = ι''


lemma subset_of_eq_of_subset (hab : a = b) (hbc : b ⊆ c) : a ⊆ c

{α : Type u}
[HasSubset α]
{a b c : α}
(hab : a = b)
(hbc : b ⊆ c)


@[simp]
theorem funInvIdAssoc_hom_app (e : C ≌ D) (F : C ⥤ E) (X : C) :
    (funInvIdAssoc e F).hom.app X = F.map (e.unitInv.app X)

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

(e.funInvIdAssoc F).hom.app X = F.map (e.unitInv.app X)


lemma reflection_apply (h : f x = 2) :
    reflection h y = y - (f y) • x

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{x : M}
{f : Module.Dual R M}
(y : M)
(h : f x = 2)


theorem toNNReal_le_iff_le_coe {r : ℝ} {p : ℝ≥0} : toNNReal r ≤ p ↔ r ≤ ↑p


lemma map_add_right_Ico (a b c : α) : ((Ico a b).map fun x => x + c) = Ico (a + c) (b + c)

{α : Type u_1}
[OrderedCancelAddCommMonoid α]
[ExistsAddOfLE α]
[LocallyFiniteOrder α]
(a b c : α)

Multiset.map (fun x => x + c) (Multiset.Ico a b) = Multiset.Ico (a + c) (b + c)


@[simp]
theorem transpose_pow [CommSemiring α] [Fintype m] [DecidableEq m] (M : Matrix m m α) (k : ℕ) :
    (M ^ k)ᵀ = Mᵀ ^ k

{m : Type u_2}
{α : Type v}
[CommSemiring α]
[Fintype m]
[DecidableEq m]
(M : Matrix m m α)
(k : ℕ)


theorem conj_eq (h : p.IsConjExponent q) : q = p / (p - 1)


/-- A (preadditive) category `C` is called abelian if it has all finite products,
all kernels and cokernels, and if every monomorphism is the kernel of some morphism
and every epimorphism is the cokernel of some morphism.

(This definition implies the existence of zero objects:
finite products give a terminal object, and in a preadditive category
any terminal object is a zero object.)
-/
class Abelian extends Preadditive C, NormalMonoCategory C, NormalEpiCategory C where
  [has_finite_products : HasFiniteProducts C]
  [has_kernels : HasKernels C]
  [has_cokernels : HasCokernels C]

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[self : CategoryTheory.Abelian C]


/-- Do not use this lemma: It is made obsolete by `exists_right_complement'_of_coprime` -/
private theorem step4 : (Nat.card N).minFac.Prime

(h3 : ∀ (H : Subgroup G), ¬N.IsComplement' H)


theorem isUpperSet_sInter {S : Set (Set α)} (hf : ∀ s ∈ S, IsUpperSet s) : IsUpperSet (⋂₀ S)

{α : Type u_1}
[LE α]
{S : Set (Set α)}
(hf : ∀ s ∈ S, IsUpperSet s)


theorem map_gfp_comp : f (gfp (g.comp f)) = gfp (f.comp g)

{α : Type u}
{β : Type v}
[CompleteLattice α]
[CompleteLattice β]
(f : β →o α)
(g : α →o β)

f (OrderHom.gfp (g.comp f)) = OrderHom.gfp (f.comp g)


@[to_additive (attr := simp)]
theorem toList_symm : (@toList α).symm = ofList


theorem card_eq_zero_iff [Finite α] : Nat.card α = 0 ↔ IsEmpty α


theorem sum_powerset_neg_one_pow_card {α : Type*} [DecidableEq α] {x : Finset α} :
    (∑ m ∈ x.powerset, (-1 : ℤ) ^ m.card) = if x = ∅ then 1 else 0

{α : Type u_2}
[DecidableEq α]
{x : Finset α}

∑ m ∈ x.powerset, (-1) ^ m.card = if x = ∅ then 1 else 0


theorem isCoprime_iff_sup_eq : IsCoprime I J ↔ I ⊔ J = ⊤

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


private theorem abs_mul (z w : ℂ) : (abs z * w) = (abs z) * abs w

√(Complex.normSq (z * w)) = √(Complex.normSq z) * √(Complex.normSq w)


theorem not_any_eq_all_not (l : List α) (p : α → Bool) : (!l.any p) = l.all fun a => !p a

{α : Type u_1}
(l : List α)
(p : α → Bool)


theorem Filter.EventuallyLE.isMaxFilter {α β : Type*} [Preorder β] {f g : α → β} {a : α}
    {l : Filter α} (hle : g ≤ᶠ[l] f) (hfga : f a = g a) (h : IsMaxFilter f l a) :
    IsMaxFilter g l a

{α : Type u_1}
{β : Type u_2}
[Preorder β]
{f g : α → β}
{a : α}
{l : Filter α}
(hle : g ≤ᶠ[l] f)
(hfga : f a = g a)
(h : IsMaxFilter f l a)


theorem of_injective {H : Type*} [Group H] (ϕ : H →* G) (hϕ : Function.Injective ϕ) :
    IsPGroup p H

{p : ℕ}
{G : Type u_1}
[Group G]
(hG : IsPGroup p G)
{H : Type u_2}
[Group H]
(ϕ : H →* G)
(hϕ : Function.Injective ⇑ϕ)


@[to_additive Pi.nnnorm_def]
lemma Pi.nnnorm_def' : ‖f‖₊ = Finset.univ.sup fun b => ‖f b‖₊

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


/-- An associative unital `R`-algebra is a semiring `A` equipped with a map into its center `R → A`.

See the implementation notes in this file for discussion of the details of this definition.
-/
-- Porting note(#5171): unsupported @[nolint has_nonempty_instance]
class Algebra (R : Type u) (A : Type v) [CommSemiring R] [Semiring A] extends SMul R A,
  R →+* A where
  commutes' : ∀ r x, toRingHom r * x = x * toRingHom r
  smul_def' : ∀ r x, r • x = toRingHom r * x

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[self : Algebra R A]
(r : R)
(x : A)

Algebra.toRingHom r * x = x * Algebra.toRingHom r


lemma lt_iff_le_pred : ∀ {n}, 0 < n → (m < n ↔ m ≤ n - 1)


@[to_additive]
theorem closure_one_eq : closure ({1} : Set E) = { x | ‖x‖ = 0 }


theorem decode₂_ne_none_iff [Encodable α] {n : ℕ} :
    decode₂ α n ≠ none ↔ n ∈ Set.range (encode : α → ℕ)

Encodable.decode₂ α n ≠ none ↔ n ∈ Set.range Encodable.encode


@[simp] theorem bitIndices_one : bitIndices 1 = [0]


theorem UniqueMDiffWithinAt.mono_of_mem {s t : Set M} {x : M} (hs : UniqueMDiffWithinAt I s x)
    (ht : t ∈ 𝓝[s] x) : UniqueMDiffWithinAt I t x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{s t : Set M}
{x : M}
(hs : UniqueMDiffWithinAt I s x)
(ht : t ∈ 𝓝[s] x)


@[simp]
theorem coe_ndinsert (a : α) (l : List α) : ndinsert a l = (insert a l : List α)

{α : Type u_1}
[DecidableEq α]
(a : α)
(l : List α)


@[elab_as_elim]
nonrec theorem IsBaseChange.inductionOn (x : N) (P : N → Prop) (h₁ : P 0) (h₂ : ∀ m : M, P (f m))
    (h₃ : ∀ (s : S) (n), P n → P (s • n)) (h₄ : ∀ n₁ n₂, P n₁ → P n₂ → P (n₁ + n₂)) : P x

(h₃ : ∀ (s : S) (n : N), P n → P (s • n))

(h₄ : ∀ (n₁ n₂ : N), P n₁ → P n₂ → P (n₁ + n₂))


theorem isLimit_ext {D : Cone F} (hD : IsLimit D) (x y : D.pt) :
    (∀ j, D.π.app j x = D.π.app j y) → x = y

[CategoryTheory.Limits.PreservesLimit F (CategoryTheory.forget C)]

(x y : (CategoryTheory.forget C).obj D.pt)

(∀ (j : J), (D.π.app j) x = (D.π.app j) y) → x = y


theorem jacobiSymNat.qr₃ (a b : ℕ) (r : ℤ) (ha : a % 4 = 3) (hb : b % 4 = 3)
    (hr : jacobiSymNat b a = r) : jacobiSymNat a b = -r

(hr : Mathlib.Meta.NormNum.jacobiSymNat b a = r)

Mathlib.Meta.NormNum.jacobiSymNat a b = -r


/-- `Subfield.extendScalars.orderIso` bundles `Subfield.extendScalars`
into an order isomorphism from
`{ E : Subfield L // F ≤ E }` to `IntermediateField F L`. Its inverse is
`IntermediateField.toSubfield`. -/
@[simps]
def extendScalars.orderIso :
    { E : Subfield L // F ≤ E } ≃o IntermediateField F L

{L : Type u_2}
[Field L]
(F : Subfield L)
(E : IntermediateField (↥F) L)

↑((RelIso.symm (Subfield.extendScalars.orderIso F)) E) = E.toSubfield


theorem ofNat_fdiv : ∀ m n : Nat, ↑(m / n) = fdiv ↑m ↑n


lemma IsNilpotent.map_iff [MonoidWithZero R] [MonoidWithZero S] {r : R} {F : Type*}
    [FunLike F R S] [MonoidWithZeroHomClass F R S] {f : F} (hf : Function.Injective f) :
    IsNilpotent (f r) ↔ IsNilpotent r

{R : Type u_1}
{S : Type u_2}
[MonoidWithZero R]
[MonoidWithZero S]
{r : R}
{F : Type u_3}
[FunLike F R S]
[MonoidWithZeroHomClass F R S]
{f : F}
(hf : Function.Injective ⇑f)


/-- The equivalence of functor categories induced by `leftOp` and `rightOp`.
-/
@[simps!]
def leftOpRightOpEquiv : (Cᵒᵖ ⥤ D)ᵒᵖ ≌ C ⥤ Dᵒᵖ

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

∀ {X Y : CategoryTheory.Functor C Dᵒᵖ} (η : X ⟶ Y),
  (CategoryTheory.Functor.leftOpRightOpEquiv C D).inverse.map η = (CategoryTheory.NatTrans.leftOp η).op


theorem lt_iff_lex_lt [LinearOrder α] (l l' : List α) : lt l l' ↔ Lex (· < ·) l l'

{α : Type u}
[LinearOrder α]
(l l' : List α)

l.lt l' ↔ List.Lex (fun x x_1 => x < x_1) l l'


theorem degree_sub_C (hp : 0 < degree p) : degree (p - C a) = degree p

{R : Type u}
{a : R}
[Ring R]
{p : R[X]}
(hp : 0 < p.degree)


theorem mem_of_mem_inter_left {x : α} {a b : Set α} (h : x ∈ a ∩ b) : x ∈ a

{α : Type u}
{x : α}
{a b : Set α}
(h : x ∈ a ∩ b)


@[to_additive]
theorem exists_finiteIndex_of_leftCoset_cover_aux [DecidableEq (Subgroup G)]
    (j : ι) (hj : j ∈ s) (hcovers' : ⋃ i ∈ s.filter (H · = H j), g i • (H i : Set G) ≠ Set.univ) :
    ∃ i ∈ s, H i ≠ H j ∧ (H i).FiniteIndex

(hcovers : ⋃ i ∈ s, g i +ᵥ ↑(H i) = Set.univ)

(hcovers' : ⋃ i ∈ Finset.filter (fun x => H x = H j) s, g i +ᵥ ↑(H i) ≠ Set.univ)


@[to_additive]
theorem swap_comp_map (f : M →* M') (g : N →* N') :
    (swap M' N').comp (map f g) = (map g f).comp (swap M N)

{M : Type u_1}
{N : Type u_2}
{M' : Type u_3}
{N' : Type u_4}
[MulOneClass M]
[MulOneClass N]
[MulOneClass M']
[MulOneClass N']
(f : M →* M')
(g : N →* N')

(Monoid.Coprod.swap M' N').comp (Monoid.Coprod.map f g) = (Monoid.Coprod.map g f).comp (Monoid.Coprod.swap M N)


@[simp]
theorem not_mem_empty (x) : x ∉ (∅ : ZFSet.{u})


@[to_additive rightAddCosetEquivalence_rel]
theorem rightCosetEquivalence_rel (s : Set α) : Equivalence (RightCosetEquivalence s)


/-- If `a ≤ b`, then `(-∞, a) ⊆ (-∞, b]`. In preorders, this is just an implication. If you need
the equivalence in dense linear orders, use `Iio_subset_Iic_iff`. -/
theorem Iio_subset_Iic (h : a ≤ b) : Iio a ⊆ Iic b

{α : Type u_1}
[Preorder α]
{a b : α}
(h : a ≤ b)


@[simp]
theorem contMDiffOn_comp_diffeomorph_iff {m} (h : M ≃ₘ^n⟮I, J⟯ N) {f : N → M'} {s} (hm : m ≤ n) :
    ContMDiffOn I I' m (f ∘ h) s ↔ ContMDiffOn J I' m f (h.symm ⁻¹' s)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_5}
[TopologicalSpace H]
{H' : Type u_6}
[TopologicalSpace H']
{G : Type u_7}
[TopologicalSpace G]
{I : ModelWithCorners 𝕜 E H}
{I' : ModelWithCorners 𝕜 E' H'}
{J : ModelWithCorners 𝕜 F G}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{M' : Type u_10}
[TopologicalSpace M']
[ChartedSpace H' M']
{N : Type u_11}
[TopologicalSpace N]
[ChartedSpace G N]
{n m : ℕ∞}
(h : M ≃ₘ^n⟮I, J⟯ N)
{f : N → M'}
{s : Set M}
(hm : m ≤ n)

ContMDiffOn I I' m (f ∘ ⇑h) s ↔ ContMDiffOn J I' m f (⇑h.symm ⁻¹' s)


@[to_additive]
theorem prod_flip {n : ℕ} (f : ℕ → β) :
    (∏ r ∈ range (n + 1), f (n - r)) = ∏ k ∈ range (n + 1), f k

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

∑ r ∈ Finset.range (n + 1), f (n - r) = ∑ k ∈ Finset.range (n + 1), f k


/-- "Semicontinuity of the `lp` norm": If all sufficiently large elements of a sequence in `lp E p`
 have `lp` norm `≤ C`, then the pointwise limit, if it exists, also has `lp` norm `≤ C`. -/
theorem norm_le_of_tendsto {C : ℝ} {F : ι → lp E p} (hCF : ∀ᶠ k in l, ‖F k‖ ≤ C) {f : lp E p}
    (hf : Tendsto (id fun i => F i : ι → ∀ a, E a) l (𝓝 f)) : ‖f‖ ≤ C

(hf : Filter.Tendsto (id fun i => ↑(F i)) l (nhds ↑f))


theorem isComplement'_iff_card_mul_and_disjoint [Finite G] :
    IsComplement' H K ↔ Nat.card H * Nat.card K = Nat.card G ∧ Disjoint H K

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

H.IsComplement' K ↔ Nat.card ↥H * Nat.card ↥K = Nat.card G ∧ Disjoint H K


lemma term_def (f : ℕ → ℂ) (s : ℂ) (n : ℕ) :
    term f s n = if n = 0 then 0 else f n / n ^ s

LSeries.term f s n = if n = 0 then 0 else f n / ↑n ^ s


protected theorem lt_add_right_iff_pos : n < n + k ↔ 0 < k


@[simp]
theorem fst_star [Star R] [Star S] (x : R × S) : (star x).1 = star x.1

{R : Type u}
{S : Type v}
[Star R]
[Star S]
(x : R × S)


/-- In a complete normed ring, a perturbation of a unit `x` by an element `t` of distance less than
`‖x⁻¹‖⁻¹` from `x` is a unit.  Here we construct its `Units` structure. -/
@[simps! val]
def add (x : Rˣ) (t : R) (h : ‖t‖ < ‖(↑x⁻¹ : R)‖⁻¹) : Rˣ

{R : Type u_1}
[NormedRing R]
[CompleteSpace R]
(x : Rˣ)
(t : R)
(h : ‖t‖ < ‖↑x⁻¹‖⁻¹)


theorem coeff_natDegree_eq_zero_of_degree_lt (h : degree p < degree q) :
    coeff p (natDegree q) = 0

{R : Type u}
[Semiring R]
{p q : R[X]}
(h : p.degree < q.degree)


theorem set_smul_span [SMulCommClass S R M] (s : Set S) (t : Set M) :
    s • span R t = span R (s • t)

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

s • Submodule.span R t = Submodule.span R (s • t)


theorem cg_iff_countable [Countable (Σl, L.Functions l)] {s : L.Substructure M} :
    s.CG ↔ Countable s

{L : FirstOrder.Language}
{M : Type u_1}
[L.Structure M]
[Countable ((l : ℕ) × L.Functions l)]
{s : L.Substructure M}


/-- A category that has larger limits also has smaller limits. -/
theorem hasLimitsOfSizeOfUnivLE [UnivLE.{v₂, v₁}] [UnivLE.{u₂, u₁}]
    [HasLimitsOfSize.{v₁, u₁} C] : HasLimitsOfSize.{v₂, u₂} C

[CategoryTheory.Limits.HasLimitsOfSize.{v₁, u₁, v, u} C]

CategoryTheory.Limits.HasLimitsOfSize.{v₂, u₂, v, u} C


/-- An operator `T` on an inner product space is symmetric if and only if it is
`LinearMap.IsSelfAdjoint` with respect to the sesquilinear form given by the inner product. -/
theorem isSymmetric_iff_sesqForm (T : E →ₗ[𝕜] E) :
    T.IsSymmetric ↔ LinearMap.IsSelfAdjoint (R := 𝕜) (M := E) sesqFormOfInner T

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

T.IsSymmetric ↔ sesqFormOfInner.IsSelfAdjoint T


/-- If `X : C` is projective and `n : ℕ`, then `Ext^(n + 1) X Y ≅ 0` for any `Y`. -/
lemma isZero_Ext_succ_of_projective (X Y : C) [Projective X] (n : ℕ) :
    IsZero (((Ext R C (n + 1)).obj (Opposite.op X)).obj Y)

{R : Type u_1}
[Ring R]
{C : Type u_2}
[CategoryTheory.Category.{u_3, u_2} C]
[CategoryTheory.Abelian C]
[CategoryTheory.Linear R C]
[CategoryTheory.EnoughProjectives C]
(X Y : C)
[CategoryTheory.Projective X]
(n : ℕ)

CategoryTheory.Limits.IsZero (((Ext R C (n + 1)).obj (Opposite.op X)).obj Y)


theorem sInf_eq_boundedBy_sInfGen (m : Set (OuterMeasure α)) :
    sInf m = OuterMeasure.boundedBy (sInfGen m)

(m : Set (MeasureTheory.OuterMeasure α))

sInf m = MeasureTheory.OuterMeasure.boundedBy (MeasureTheory.OuterMeasure.sInfGen m)


/-- When `star x = x` on the coefficients (such as the real numbers) `conjTranspose` and `transpose`
are the same operation. -/
@[simp]
theorem conjTranspose_eq_transpose_of_trivial [Star α] [TrivialStar α] (A : Matrix m n α) :
    Aᴴ = Aᵀ

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[Star α]
[TrivialStar α]
(A : Matrix m n α)


protected theorem congr_fun {f g : α →+* β} (h : f = g) (x : α) : f x = g x

∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} {f g : α →+* β}, f = g → ∀ (x_2 : α), f x_2 = g x_2


nonrec theorem DenseRange.exists_mem_open (hf : DenseRange f) (ho : IsOpen s) (hs : s.Nonempty) :
    ∃ a, f a ∈ s

{X : Type u_1}
[TopologicalSpace X]
{α : Type u_4}
{f : α → X}
{s : Set X}
(hf : DenseRange f)
(ho : IsOpen s)
(hs : s.Nonempty)


theorem right_invariance {s : Set H} {x : H} {f : H → H'} {e : PartialHomeomorph H H} (he : e ∈ G)
    (hxe : x ∈ e.source) : P (f ∘ e.symm) (e.symm ⁻¹' s) (e x) ↔ P f s x

{H : Type u_1}
{H' : Type u_3}
[TopologicalSpace H]
[TopologicalSpace H']
{G : StructureGroupoid H}
{G' : StructureGroupoid H'}
{P : (H → H') → Set H → H → Prop}
(hG : G.LocalInvariantProp G' P)
{s : Set H}
{x : H}
{f : H → H'}
{e : PartialHomeomorph H H}
(he : e ∈ G)
(hxe : x ∈ e.source)

P (f ∘ ↑e.symm) (↑e.symm ⁻¹' s) (↑e x) ↔ P f s x


@[simp]
lemma abs_mul_self (a : α) : |a * a| = a * a

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


/-- If the second of three points is weakly between the other two, and not equal to the third,
the angle at the third point (reversed) is zero. -/
theorem _root_.Wbtw.angle₁₃₂_eq_zero_of_ne {p₁ p₂ p₃ : P} (h : Wbtw ℝ p₁ p₂ p₃) (hp₂p₃ : p₂ ≠ p₃) :
    ∠ p₁ p₃ p₂ = 0

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p₁ p₂ p₃ : P}
(h : Wbtw ℝ p₁ p₂ p₃)
(hp₂p₃ : p₂ ≠ p₃)


@[deprecated map_add (since := "2024-06-20")]
protected theorem map_add : ∀ x y, e (x + y) = e x + e y

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Algebra R A₁]
[Algebra R A₂]
(e : A₁ ≃ₐ[R] A₂)
(x y : A₁)


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


/-- The equivalence between `TwoP` and itself induced by `Prod.swap` both ways. -/
@[simps!]
noncomputable def swapEquiv : TwoP ≌ TwoP

∀ {X Y : TwoP} (f : X ⟶ Y) (a : X.toBipointed.X), (TwoP.swapEquiv.inverse.map f).toFun a = f.toFun a


lemma iIndepFun_iff {β : ι → Type*}
    (m : ∀ x : ι, MeasurableSpace (β x)) (f : ∀ x : ι, Ω → β x) (μ : Measure Ω) :
    iIndepFun m f μ ↔ ∀ (s : Finset ι) {f' : ι → Set Ω}
      (_H : ∀ i, i ∈ s → MeasurableSet[(m i).comap (f i)] (f' i)),
      μ (⋂ i ∈ s, f' i) = ∏ i ∈ s, μ (f' i)

∀ {x : MeasurableSpace Ω} {β : ι → Type u_6} (m : (x : ι) → MeasurableSpace (β x)) (f : (x : ι) → Ω → β x)
  (μ : MeasureTheory.Measure Ω),
  ProbabilityTheory.iIndepFun m f μ ↔
    ∀ (s : Finset ι) {f' : ι → Set Ω}, (∀ i ∈ s, MeasurableSet (f' i)) → μ (⋂ i ∈ s, f' i) = ∏ i ∈ s, μ (f' i)


@[simp]
theorem isCaratheodory_compl_iff : IsCaratheodory m sᶜ ↔ IsCaratheodory m s

{α : Type u}
(m : MeasureTheory.OuterMeasure α)
{s : Set α}

m.IsCaratheodory sᶜ ↔ m.IsCaratheodory s


theorem sSup_singleton {a : α} : sSup {a} = a

{α : Type u_1}
[CompleteSemilatticeSup α]
{a : α}


/-- An orbit is a block -/
theorem isBlock_orbit (a : X) : IsBlock G (orbit G a)

{G : Type u_1}
[Group G]
{X : Type u_2}
[MulAction G X]
(a : X)

MulAction.IsBlock G (MulAction.orbit G a)


lemma existsUnique_mem_box (x : ℤ × ℤ) : ∃! n : ℕ, x ∈ box n


/-- In a real vector space of dimension `> 1`, any sphere is preconnected. -/
theorem isPreconnected_sphere (h : 1 < Module.rank ℝ E) (x : E) (r : ℝ) :
    IsPreconnected (sphere x r)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(h : 1 < Module.rank ℝ E)
(x : E)
(r : ℝ)


lemma coe_subtypeEquiv_eq_map {X Y : Type*} {p : X → Prop} {q : Y → Prop} (e : X ≃ Y)
    (h : ∀ x, p x ↔ q (e x)) : ⇑(e.subtypeEquiv h) = Subtype.map e (h · |>.mp)

{X : Type u_1}
{Y : Type u_2}
{p : X → Prop}
{q : Y → Prop}
(e : X ≃ Y)
(h : ∀ (x : X), p x ↔ q (e x))


theorem not_infIrred_top : ¬InfIrred (⊤ : α)

{α : Type u_2}
[SemilatticeInf α]
[OrderTop α]


/-- Measurable equivalence between `Π j : Fin (n + 1), α j` and
`α i × Π j : Fin n, α (Fin.succAbove i j)`. -/
@[simps! (config := .asFn)]
def piFinSuccAbove {n : ℕ} (α : Fin (n + 1) → Type*) [∀ i, MeasurableSpace (α i)]
    (i : Fin (n + 1)) : (∀ j, α j) ≃ᵐ α i × ∀ j, α (i.succAbove j)

[(i : Fin (n + 1)) → MeasurableSpace (α i)]

⇑(MeasurableEquiv.piFinSuccAbove α i) = fun f => (f i, i.removeNth f)


/-- Typeclass for multiplicative actions by monoids on semirings.

This combines `DistribMulAction` with `MulDistribMulAction`. -/
class MulSemiringAction (M : Type u) (R : Type v) [Monoid M] [Semiring R] extends
  DistribMulAction M R where
  /-- Multipliying `1` by a scalar gives `1` -/
  smul_one : ∀ g : M, (g • (1 : R) : R) = 1
  /-- Scalar multiplication distributes across multiplication -/
  smul_mul : ∀ (g : M) (x y : R), g • (x * y) = g • x * g • y

{M : Type u}
{R : Type v}
[Monoid M]
[Semiring R]
[self : MulSemiringAction M R]
(g : M)


@[to_additive]
theorem MulHom.cancel_left [Mul M] [Mul N] [Mul P] {g : N →ₙ* P} {f₁ f₂ : M →ₙ* N}
    (hg : Function.Injective g) : g.comp f₁ = g.comp f₂ ↔ f₁ = f₂

{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
[Add M]
[Add N]
[Add P]
{g : AddHom N P}
{f₁ f₂ : AddHom M N}
(hg : Function.Injective ⇑g)


theorem StarConvex.mem_smul (hs : StarConvex 𝕜 0 s) (hx : x ∈ s) {t : 𝕜} (ht : 1 ≤ t) :
    x ∈ t • s

{𝕜 : Type u_1}
{E : Type u_2}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{x : E}
{s : Set E}
(hs : StarConvex 𝕜 0 s)
(hx : x ∈ s)
{t : 𝕜}
(ht : 1 ≤ t)


lemma slope_of_Y_ne_eq_eval {x₁ x₂ y₁ y₂ : F} (hx : x₁ = x₂) (hy : y₁ ≠ W.negY x₂ y₂) :
    W.slope x₁ x₂ y₁ y₂ = -W.polynomialX.evalEval x₁ y₁ / W.polynomialY.evalEval x₁ y₁

{F : Type u}
[Field F]
{W : WeierstrassCurve.Affine F}
{x₁ x₂ y₁ y₂ : F}
(hx : x₁ = x₂)
(hy : y₁ ≠ W.negY x₂ y₂)

W.slope x₁ x₂ y₁ y₂ = -Polynomial.evalEval x₁ y₁ W.polynomialX / Polynomial.evalEval x₁ y₁ W.polynomialY


/-- Another induction principle for `IsPreconnected J`:
given a type family `Z : J → Sort*` and
a rule for transporting in *both* directions along a morphism in `J`,
we can transport an `x : Z j₀` to a point in `Z j` for any `j`.
-/
theorem isPreconnected_induction [IsPreconnected J] (Z : J → Sort*)
    (h₁ : ∀ {j₁ j₂ : J} (_ : j₁ ⟶ j₂), Z j₁ → Z j₂) (h₂ : ∀ {j₁ j₂ : J} (_ : j₁ ⟶ j₂), Z j₂ → Z j₁)
    {j₀ : J} (x : Z j₀) (j : J) : Nonempty (Z j)

(h₁ : {j₁ j₂ : J} → (j₁ ⟶ j₂) → Z j₁ → Z j₂)

(h₂ : {j₁ j₂ : J} → (j₁ ⟶ j₂) → Z j₂ → Z j₁)


theorem normalize_mul_right {a : Nat} (d0 : d ≠ 0) (a0 : a ≠ 0) :
    normalize (n * a) (d * a) (Nat.mul_ne_zero d0 a0) = normalize n d d0

Rat.normalize (n * ↑a) (d * a) ⋯ = Rat.normalize n d d0


/-- Casting out of `SignType` respects composition with suitable bundled homomorphism types. -/
lemma map_cast {α β F : Type*} [AddGroupWithOne α] [One β] [SubtractionMonoid β]
    [FunLike F α β] [AddMonoidHomClass F α β] [OneHomClass F α β] (f : F) (s : SignType) :
    f s = s

{α : Type u_2}
{β : Type u_3}
{F : Type u_4}
[AddGroupWithOne α]
[One β]
[SubtractionMonoid β]
[FunLike F α β]
[AddMonoidHomClass F α β]
[OneHomClass F α β]
(f : F)
(s : SignType)


/-- Symmetric statement to `Set.image_image2_distrib_left`. -/
theorem image2_image_left_comm {f : α' → β → γ} {g : α → α'} {f' : α → β → δ} {g' : δ → γ}
    (h_left_comm : ∀ a b, f (g a) b = g' (f' a b)) :
    image2 f (s.image g) t = (image2 f' s t).image g'

{f : α' → β → γ}

{f' : α → β → δ}

(h_left_comm : ∀ (a : α) (b : β), f (g a) b = g' (f' a b))

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


theorem one_lt_rpow {x : ℝ≥0∞} {z : ℝ} (hx : 1 < x) (hz : 0 < z) : 1 < x ^ z


theorem integral_inv_smul_sub_mul_tendsto_integral_lineDeriv_mul
    (hf : LipschitzWith C f) (hg : Integrable g μ) (v : E) :
    Tendsto (fun (t : ℝ) ↦ ∫ x, (t⁻¹ • (f (x + t • v) - f x)) * g x ∂μ) (𝓝[>] 0)
      (𝓝 (∫ x, lineDeriv ℝ f x v * g x ∂μ))

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
[MeasurableSpace E]
[BorelSpace E]
{C : ℝ≥0}
{f g : E → ℝ}
{μ : MeasureTheory.Measure E}
[μ.IsAddHaarMeasure]
(hf : LipschitzWith C f)
(hg : MeasureTheory.Integrable g μ)
(v : E)

Filter.Tendsto (fun t => ∫ (x : E), t⁻¹ • (f (x + t • v) - f x) * g x ∂μ) (𝓝[>] 0)
  (𝓝 (∫ (x : E), lineDeriv ℝ f x v * g x ∂μ))


theorem geom_mean_le_arith_mean3_weighted (w₁ w₂ w₃ p₁ p₂ p₃ : ℝ≥0) :
    w₁ + w₂ + w₃ = 1 →
      p₁ ^ (w₁ : ℝ) * p₂ ^ (w₂ : ℝ) * p₃ ^ (w₃ : ℝ) ≤ w₁ * p₁ + w₂ * p₂ + w₃ * p₃

w₁ + w₂ + w₃ = 1 → p₁ ^ ↑w₁ * p₂ ^ ↑w₂ * p₃ ^ ↑w₃ ≤ w₁ * p₁ + w₂ * p₂ + w₃ * p₃


@[simp, nolint simpNF] -- Porting note (#11215): TODO: use `of`/`asHom`?
theorem one_def : (1 : End X) = 𝟙 X


theorem comap_comp_apply (f : R →+* S) (g : S →+* S') (x : PrimeSpectrum S') :
    PrimeSpectrum.comap (g.comp f) x = (PrimeSpectrum.comap f) (PrimeSpectrum.comap g x)

{R : Type u}
{S : Type v}
[CommSemiring R]
[CommSemiring S]
{S' : Type u_1}
[CommSemiring S']
(f : R →+* S)
(g : S →+* S')
(x : PrimeSpectrum S')

(PrimeSpectrum.comap (g.comp f)) x = (PrimeSpectrum.comap f) ((PrimeSpectrum.comap g) x)


theorem map_sSup (hf : LeftOrdContinuous f) (s : Set α) : f (sSup s) = ⨆ x ∈ s, f x

{α : Type u}
{β : Type v}
[CompleteLattice α]
[CompleteLattice β]
{f : α → β}
(hf : LeftOrdContinuous f)
(s : Set α)


@[simp]
theorem liftAddHom_singleAddHom [AddCommMonoid M] :
    (liftAddHom (α := α) (M := M) (N := α →₀ M)) (singleAddHom : α → M →+ α →₀ M) =
      AddMonoidHom.id _

{α : Type u_1}
{M : Type u_8}
[AddCommMonoid M]

Finsupp.liftAddHom Finsupp.singleAddHom = AddMonoidHom.id (α →₀ M)


@[to_additive (attr := deprecated exists_mem_nhds_isCompact_isClosed (since := "2024-01-28"))]
theorem exists_isCompact_isClosed_nhds_one [WeaklyLocallyCompactSpace G] :
    ∃ K : Set G, IsCompact K ∧ IsClosed K ∧ K ∈ 𝓝 1

(G : Type w)
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
[WeaklyLocallyCompactSpace G]


@[simp]
theorem log_pos_iff {b n : ℕ} : 0 < log b n ↔ b ≤ n ∧ 1 < b


@[simp]
theorem support_divMonomial (s : σ →₀ ℕ) (x : MvPolynomial σ R) :
    (x /ᵐᵒⁿᵒᵐⁱᵃˡ s).support = x.support.preimage _ (add_right_injective s).injOn

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
(s : σ →₀ ℕ)
(x : MvPolynomial σ R)

(x.divMonomial s).support = x.support.preimage (fun x => s + x) ⋯


theorem setOf_indep_eq (M : Matroid α) : {I | M.Indep I} = lowerClosure ({B | M.Base B})

{I | M.Indep I} = ↑(lowerClosure {B | M.Base B})


theorem lintegral_rpow_funMulInvSnorm_eq_one {p : ℝ} (hp0_lt : 0 < p) {f : α → ℝ≥0∞}
    (hf_nonzero : (∫⁻ a, f a ^ p ∂μ) ≠ 0) (hf_top : (∫⁻ a, f a ^ p ∂μ) ≠ ⊤) :
    ∫⁻ c, funMulInvSnorm f p μ c ^ p ∂μ = 1

(hf_nonzero : ∫⁻ (a : α), f a ^ p ∂μ ≠ 0)

∫⁻ (c : α), ENNReal.funMulInvSnorm f p μ c ^ p ∂μ = 1


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

[MeasureTheory.VAddInvariantMeasure G α μ]

(h : MeasureTheory.IsAddFundamentalDomain G s μ)

MeasureTheory.IsAddFundamentalDomain G (g +ᵥ s) μ


@[simp]
theorem op_unop {X Y : C} (f : X ≅ Y) : f.op.unop = f

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


@[simp]
theorem nonempty_mk {m : Multiset α} {hm} : (⟨m, hm⟩ : Finset α).Nonempty ↔ m ≠ 0

{α : Type u_1}
{m : Multiset α}
{hm : m.Nodup}

{ val := m, nodup := hm }.Nonempty ↔ m ≠ 0


@[simp]
theorem coe_equivProdOfSurjectiveOfIsCompl {f : E →L[𝕜] F} {g : E →L[𝕜] G} (hf : range f = ⊤)
    (hg : range g = ⊤) (hfg : IsCompl (ker f) (ker g)) :
    (equivProdOfSurjectiveOfIsCompl f g hf hg hfg : E →ₗ[𝕜] F × G) = f.prod g

(hfg : IsCompl (LinearMap.ker f) (LinearMap.ker g))

↑↑(f.equivProdOfSurjectiveOfIsCompl g hf hg hfg) = ↑(f.prod g)


/-- See also `Nat.cast_pos`, specialised for an `OrderedSemiring`. -/
@[simp low]
theorem cast_pos' {n : ℕ} : (0 : α) < n ↔ 0 < n

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


theorem of_part : ∀ {n f}, _root_.Partrec f → @Partrec' n f


theorem IsMinOn.inter (hf : IsMinOn f s a) (t) : IsMinOn f (s ∩ t) a

{α : Type u}
{β : Type v}
[Preorder β]
{f : α → β}
{s : Set α}
{a : α}
(hf : IsMinOn f s a)
(t : Set α)


@[simp]
theorem map_id {f : StructuredArrow S T} : (map (𝟙 S)).obj f = f

{f : CategoryTheory.StructuredArrow S T}

(CategoryTheory.StructuredArrow.map (CategoryTheory.CategoryStruct.id S)).obj f = f


theorem ascPochhammer_succ_comp_X_add_one (n : ℕ) :
    (ascPochhammer S (n + 1)).comp (X + 1) =
      ascPochhammer S (n + 1) + (n + 1) • (ascPochhammer S n).comp (X + 1)

(ascPochhammer S (n + 1)).comp (Polynomial.X + 1) =
  ascPochhammer S (n + 1) + (n + 1) • (ascPochhammer S n).comp (Polynomial.X + 1)


theorem Finsupp.mem_ideal_span_range_iff_exists_finsupp {x : R} {v : α → R} :
    x ∈ Ideal.span (Set.range v) ↔ ∃ c : α →₀ R, (c.sum fun i a => a * v i) = x

{α : Type u_1}
{R : Type u_2}
[Semiring R]
{x : R}
{v : α → R}

x ∈ Ideal.span (Set.range v) ↔ ∃ c, (c.sum fun i a => a * v i) = x


/-- Technical lemma ensuring that the preimage under an extended chart of a neighborhood of a point
in the source is a neighborhood of the preimage, within a set. -/
theorem extChartAt_preimage_mem_nhdsWithin' {x x' : M} (h : x' ∈ (extChartAt I x).source)
    (ht : t ∈ 𝓝[s] x') :
    (extChartAt I x).symm ⁻¹' t ∈ 𝓝[(extChartAt I x).symm ⁻¹' s ∩ range I] (extChartAt I x) x'

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(I : ModelWithCorners 𝕜 E H)
{s t : Set M}
[ChartedSpace H M]
{x x' : M}
(h : x' ∈ (extChartAt I x).source)
(ht : t ∈ 𝓝[s] x')

↑(extChartAt I x).symm ⁻¹' t ∈ 𝓝[↑(extChartAt I x).symm ⁻¹' s ∩ Set.range ↑I] ↑(extChartAt I x) x'


theorem IsSymm.apply {A : Matrix n n α} (h : A.IsSymm) (i j : n) : A j i = A i j

{α : Type u_1}
{n : Type u_3}
{A : Matrix n n α}
(h : A.IsSymm)
(i j : n)


theorem support_indicator [Zero β] {s : Set α} (hs : MeasurableSet s) (f : α →ₛ β) :
    Function.support (f.piecewise s hs (SimpleFunc.const α 0)) = s ∩ Function.support f

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[Zero β]
{s : Set α}
(hs : MeasurableSet s)
(f : MeasureTheory.SimpleFunc α β)

Function.support ↑(MeasureTheory.SimpleFunc.piecewise s hs f (MeasureTheory.SimpleFunc.const α 0)) =
  s ∩ Function.support ↑f


theorem toTopologicalSpace_comap {f : α → β} {u : UniformSpace β} :
    @UniformSpace.toTopologicalSpace _ (UniformSpace.comap f u) =
      TopologicalSpace.induced f (@UniformSpace.toTopologicalSpace β u)

{α : Type ua}
{β : Type ub}
{f : α → β}
{u : UniformSpace β}

UniformSpace.toTopologicalSpace = TopologicalSpace.induced f UniformSpace.toTopologicalSpace


/-- A change of basis formula for barycentric coordinates.

See also `AffineBasis.toMatrix_vecMul_coords`. -/
@[simp]
theorem toMatrix_inv_vecMul_toMatrix (x : P) :
    b.coords x ᵥ* (b.toMatrix b₂)⁻¹ = b₂.coords x

{ι : Type u₁}
{k : Type u₂}
{V : Type u₃}
{P : Type u₄}
[AddCommGroup V]
[AffineSpace V P]
[CommRing k]
[Module k V]
[DecidableEq ι]
[Fintype ι]
(b b₂ : AffineBasis ι k P)
(x : P)

b.coords x ᵥ* (b.toMatrix ⇑b₂)⁻¹ = b₂.coords x


theorem nonempty_iff_eq_singleton_default [Unique α] {s : Finset α} :
    s.Nonempty ↔ s = {default}

{α : Type u_1}
[Unique α]
{s : Finset α}


theorem coe_addMonoidHom_injective : Injective fun f : α →ₙ+* β => (f : α →+ β)

{α : Type u_2}
{β : Type u_3}
[NonUnitalNonAssocSemiring α]
[NonUnitalNonAssocSemiring β]


theorem OrderIso.mulRight₀'_symm {a : α} (ha : a ≠ 0) :
    (OrderIso.mulRight₀' ha).symm = OrderIso.mulRight₀' (inv_ne_zero ha)

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

(OrderIso.mulRight₀' ha).symm = OrderIso.mulRight₀' ⋯


/-- An explicit description of `χ₈` on integers / naturals -/
theorem χ₈_int_eq_if_mod_eight (n : ℤ) :
    χ₈ n = if n % 2 = 0 then 0 else if n % 8 = 1 ∨ n % 8 = 7 then 1 else -1

ZMod.χ₈ ↑n = if n % 2 = 0 then 0 else if n % 8 = 1 ∨ n % 8 = 7 then 1 else -1


@[to_additive IsClosed.left_addCoset]
theorem IsClosed.leftCoset {U : Set G} (h : IsClosed U) (x : G) : IsClosed (x • U)

{G : Type w}
[TopologicalSpace G]
[AddGroup G]
[ContinuousAdd G]
{U : Set G}
(h : IsClosed U)
(x : G)


theorem isPathConnected_iff_eq : IsPathConnected F ↔ ∃ x ∈ F, pathComponentIn x F = F

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


protected theorem CovBy.ne (h : a ⋖ b) : a ≠ b

{α : Type u_1}
[Preorder α]
{a b : α}
(h : a ⋖ b)


/-- Bijection between `α` and `ULift.{v} α` -/
theorem ULift.down_up {α : Type u} (a : α) : Eq (down (up.{v} a)) a


@[simp]
theorem essInf_const' [NeZero μ] (c : β) : essInf (fun _ : α => c) μ = c

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[ConditionallyCompleteLattice β]
[NeZero μ]
(c : β)


/-- When `p = ∞`, this lemma does not hold without the additional assumption `Nonempty ι` because
the left-hand side simplifies to `0`, while the right-hand side simplifies to `‖b‖₊`. See
`PiLp.nnnorm_equiv_symm_const'` for a version which exchanges the hypothesis `p ≠ ∞` for
`Nonempty ι`. -/
theorem nnnorm_equiv_symm_const {β} [SeminormedAddCommGroup β] (hp : p ≠ ∞) (b : β) :
    ‖(WithLp.equiv p (ι → β)).symm (Function.const _ b)‖₊ =
      (Fintype.card ι : ℝ≥0) ^ (1 / p).toReal * ‖b‖₊

{p : ℝ≥0∞}
{ι : Type u_2}
[Fact (1 ≤ p)]
[Fintype ι]
{β : Type u_5}
[SeminormedAddCommGroup β]
(hp : p ≠ ⊤)
(b : β)

‖(WithLp.equiv p (ι → β)).symm (Function.const ι b)‖₊ = ↑(Fintype.card ι) ^ (1 / p).toReal * ‖b‖₊


/-- The uniform structure induced by a family of seminorms is exactly the infimum of the ones
induced by each seminorm individually. We express this as a characterization of
`WithSeminorms p`. -/
theorem SeminormFamily.withSeminorms_iff_uniformSpace_eq_iInf [u : UniformSpace E]
    [UniformAddGroup E] (p : SeminormFamily 𝕜 E ι) :
    WithSeminorms p ↔ u = ⨅ i, (p i).toSeminormedAddCommGroup.toUniformSpace

{𝕜 : Type u_1}
{E : Type u_5}
{ι : Type u_8}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[Nonempty ι]
[u : UniformSpace E]
[UniformAddGroup E]
(p : SeminormFamily 𝕜 E ι)

WithSeminorms p ↔ u = ⨅ i, PseudoMetricSpace.toUniformSpace


theorem iteratedDerivWithin_eq_iteratedFDerivWithin : iteratedDerivWithin n f s x =
    (iteratedFDerivWithin 𝕜 n f s x : (Fin n → 𝕜) → F) fun _ : Fin n => 1

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

iteratedDerivWithin n f s x = (iteratedFDerivWithin 𝕜 n f s x) fun x => 1


@[simp]
theorem mk_le_mk [LE α] {p : α → Prop} {x y : α} {hx : p x} {hy : p y} :
    (⟨x, hx⟩ : Subtype p) ≤ ⟨y, hy⟩ ↔ x ≤ y

{α : Type u_2}
[LE α]
{p : α → Prop}
{x y : α}
{hx : p x}
{hy : p y}


/-- Inserting a larger numeric right option into a numeric game results in a numeric game. -/
theorem insertRight_numeric {x x' : PGame} (x_num : x.Numeric) (x'_num : x'.Numeric)
    (h : x ≤ x') : (insertRight x x').Numeric

{x x' : SetTheory.PGame}
(x_num : x.Numeric)
(x'_num : x'.Numeric)
(h : x ≤ x')


theorem extend_of_one_le {a b : X} (γ : Path a b) {t : ℝ}
    (ht : 1 ≤ t) : γ.extend t = b

{X : Type u_1}
[TopologicalSpace X]
{a b : X}
(γ : Path a b)
{t : ℝ}
(ht : 1 ≤ t)


theorem edist_lt_of_edist_lt_div (hf : LipschitzOnWith K f s) {x y : α} (hx : x ∈ s) (hy : y ∈ s)
    {d : ℝ≥0∞} (hd : edist x y < d / K) : edist (f x) (f y) < d

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{K : ℝ≥0}
{s : Set α}
{f : α → β}
(hf : LipschitzOnWith K f s)
{x y : α}
(hx : x ∈ s)
(hy : y ∈ s)
{d : ℝ≥0∞}
(hd : edist x y < d / ↑K)


theorem Ioo_union_Ioi' (h₁ : c < b) : Ioo a b ∪ Ioi c = Ioi (min a c)

{α : Type u_1}
[LinearOrder α]
{a b c : α}
(h₁ : c < b)

Set.Ioo a b ∪ Set.Ioi c = Set.Ioi (min a c)


/-- If `A : S → T.obj B` is a structured arrow for `S : D` and `T : C ⥤ D`, then we can explicitly
    describe the subobjects of `A` as the subobjects `P` of `B` in `C` for which `A.hom` factors
    through the image of `P` under `T`. -/
@[simps!]
def subobjectEquiv [HasLimits C] [PreservesLimits T] (A : StructuredArrow S T) :
    Subobject A ≃o { P : Subobject A.right // ∃ q, q ≫ T.map P.arrow = A.hom }

(A : CategoryTheory.StructuredArrow S T)

(P : { P // ∃ q, CategoryTheory.CategoryStruct.comp q (T.map P.arrow) = A.hom })

(RelIso.symm A.subobjectEquiv) P = CategoryTheory.Subobject.mk (CategoryTheory.StructuredArrow.homMk (↑P).arrow ⋯)


theorem elem_eq_true_of_mem [BEq α] [LawfulBEq α] {a : α} {as : List α} (h : a ∈ as) : elem a as = true

{α : Type u}
[BEq α]
[LawfulBEq α]
{a : α}
{as : List α}
(h : a ∈ as)


@[to_additive]
lemma mul_inf (a b c : α) : c * (a ⊓ b) = c * a ⊓ c * b

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


theorem normalize_content {p : R[X]} : normalize p.content = p.content

{R : Type u_1}
[CommRing R]
[IsDomain R]
[NormalizedGCDMonoid R]
{p : Polynomial R}


@[simp] lemma ker_sInf (S : Set (Filter α)) : ker (sInf S) = ⨅ f ∈ S, ker f


theorem commute_all_of_involutive (hφ : FixedPointFree φ) (h2 : Function.Involutive φ) (g h : G) :
    Commute g h

{G : Type u_1}
[Group G]
{φ : G →* G}
[Finite G]
(hφ : MonoidHom.FixedPointFree ⇑φ)
(h2 : Function.Involutive ⇑φ)
(g h : G)


theorem localRingHom_comp {S : Type*} [CommSemiring S] (J : Ideal S) [hJ : J.IsPrime] (K : Ideal P)
    [hK : K.IsPrime] (f : R →+* S) (hIJ : I = J.comap f) (g : S →+* P) (hJK : J = K.comap g) :
    localRingHom I K (g.comp f) (by rw [hIJ, hJK, Ideal.comap_comap f g]) =
      (localRingHom J K g hJK).comp (localRingHom I J f hIJ)

{R : Type u_1}
[CommSemiring R]
{P : Type u_3}
[CommSemiring P]
(I : Ideal R)
[hI : I.IsPrime]
{S : Type u_4}
[CommSemiring S]
(J : Ideal S)
[hJ : J.IsPrime]
(K : Ideal P)
[hK : K.IsPrime]
(f : R →+* S)
(hIJ : I = Ideal.comap f J)
(g : S →+* P)
(hJK : J = Ideal.comap g K)

Localization.localRingHom I K (g.comp f) ⋯ =
  (Localization.localRingHom J K g hJK).comp (Localization.localRingHom I J f hIJ)


theorem natCast_apply (n : ℕ) (m : α) : (n : CentroidHom α) m = n • m

{α : Type u_5}
[NonUnitalNonAssocSemiring α]
(n : ℕ)
(m : α)


theorem eq_of_add_eq_of_aleph0_le {a b c : Cardinal} (h : a + b = c) (ha : a < c) (hc : ℵ₀ ≤ c) :
    b = c

{a b c : Cardinal.{u_1}}
(h : a + b = c)
(ha : a < c)
(hc : ℵ₀ ≤ c)


theorem gc_map_comap (f : R →+* S) : GaloisConnection (map f) (comap f)

{R : Type u}
{S : Type v}
[NonAssocSemiring R]
[NonAssocSemiring S]
(f : R →+* S)

GaloisConnection (Subsemiring.map f) (Subsemiring.comap f)


@[to_additive]
theorem finprod_mem_eq_prod_filter (f : α → M) (s : Set α) [DecidablePred (· ∈ s)]
    (hf : (mulSupport f).Finite) :
    ∏ᶠ i ∈ s, f i = ∏ i ∈ Finset.filter (· ∈ s) hf.toFinset, f i

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
(f : α → M)
(s : Set α)
[DecidablePred fun x => x ∈ s]
(hf : (Function.support f).Finite)

∑ᶠ (i : α) (_ : i ∈ s), f i = ∑ i ∈ Finset.filter (fun x => x ∈ s) hf.toFinset, f i


theorem closure_eq_of_le {s : Set K} {t : Subfield K} (h₁ : s ⊆ t) (h₂ : t ≤ closure s) :
    closure s = t

{K : Type u}
[DivisionRing K]
{s : Set K}
{t : Subfield K}
(h₁ : s ⊆ ↑t)
(h₂ : t ≤ Subfield.closure s)


lemma isoClosure_eq_iff (P : MorphismProperty C) :
    P.isoClosure = P ↔ P.RespectsIso

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(P : CategoryTheory.MorphismProperty C)


/-- Pointwise `Finset.Icc` bundled as a `Finsupp`. -/
@[simps toFun]
def rangeIcc (f g : ι →₀ α) : ι →₀ Finset α

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

(f.rangeIcc g) i = Finset.Icc (f i) (g i)


/-- If an algebraic extension has finite separable degree one, then it is purely inseparable. -/
theorem isPurelyInseparable_of_finSepDegree_eq_one [Algebra.IsAlgebraic F E]
    (hdeg : finSepDegree F E = 1) : IsPurelyInseparable F E

{F : Type u}
{E : Type v}
[Field F]
[Field E]
[Algebra F E]
[Algebra.IsAlgebraic F E]
(hdeg : Field.finSepDegree F E = 1)


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

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


theorem seminormAux_nonneg (k n : ℕ) (f : 𝓢(E, F)) : 0 ≤ 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)


lemma induce_union_connected {s t : Set V}
    (sconn : (G.induce s).Connected) (tconn : (G.induce t).Connected)
    (sintert : (s ∩ t).Nonempty) :
    (G.induce (s ∪ t)).Connected

(sconn : (SimpleGraph.induce s G).Connected)

(tconn : (SimpleGraph.induce t G).Connected)

(SimpleGraph.induce (s ∪ t) G).Connected


theorem sin_nat_mul_two_pi_sub (x : ℂ) (n : ℕ) : sin (n * (2 * π) - x) = -sin x

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


@[simp]
theorem abs_circleMap_zero (R : ℝ) (θ : ℝ) : abs (circleMap 0 R θ) = |R|


/-- One can prove `QuotientMeasureEqMeasurePreimage` by checking behavior with respect to a single
fundamental domain. -/
@[to_additive]
lemma IsFundamentalDomain.quotientMeasureEqMeasurePreimage {μ : Measure (Quotient α_mod_G)}
    {s : Set α} (fund_dom_s : IsFundamentalDomain G s ν) (h : μ = (ν.restrict s).map π) :
    QuotientMeasureEqMeasurePreimage ν μ

[MeasureTheory.SMulInvariantMeasure G α ν]

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

(fund_dom_s : MeasureTheory.IsFundamentalDomain G s ν)

(h : μ = MeasureTheory.Measure.map (Quotient.mk (MulAction.orbitRel G α)) (ν.restrict s))


theorem map_nhds_subtype_coe_eq_nhds {x : X} (hx : p x) (h : ∀ᶠ x in 𝓝 x, p x) :
    map ((↑) : Subtype p → X) (𝓝 ⟨x, hx⟩) = 𝓝 x

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

Filter.map Subtype.val (𝓝 ⟨x, hx⟩) = 𝓝 x


theorem lt_one_of_floor_lt_one (h : ⌊a⌋₊ < 1) : a < 1

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
{a : α}
(h : ⌊a⌋₊ < 1)


theorem getElem?_zipWith' (f : α → β → γ) (l₁ : List α) (l₂ : List β) (i : ℕ) :
    (zipWith f l₁ l₂)[i]? = (l₁[i]?.map f).bind fun g => l₂[i]?.map g

{α : Type u}
{β : Type u_1}
{γ : Type u_2}
(f : α → β → γ)
(l₁ : List α)
(l₂ : List β)
(i : ℕ)

(List.zipWith f l₁ l₂)[i]? = (Option.map f l₁[i]?).bind fun g => Option.map g l₂[i]?


theorem condexp_add (hf : Integrable f μ) (hg : Integrable g μ) :
    μ[f + g|m] =ᵐ[μ] μ[f|m] + μ[g|m]

{α : Type u_1}
{F' : Type u_3}
[NormedAddCommGroup F']
[NormedSpace ℝ F']
[CompleteSpace F']
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : α → F'}
(hf : MeasureTheory.Integrable f μ)
(hg : MeasureTheory.Integrable g μ)


theorem ball_norm_mul_subset {p : Seminorm 𝕜 E} {k : 𝕜} {r : ℝ} :
    p.ball 0 (‖k‖ * r) ⊆ k • p.ball 0 r

{𝕜 : Type u_3}
{E : Type u_7}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{p : Seminorm 𝕜 E}
{k : 𝕜}
{r : ℝ}


protected lemma InfClosed.supClosure (hs : InfClosed s) : InfClosed (supClosure s)

{α : Type u_2}
[DistribLattice α]
{s : Set α}
(hs : InfClosed s)


@[simp]
theorem isPreconnected_preimage {s : Set Y} (h : X ≃ₜ Y) :
    IsPreconnected (h ⁻¹' s) ↔ IsPreconnected s

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{s : Set Y}
(h : X ≃ₜ Y)

IsPreconnected (⇑h ⁻¹' s) ↔ IsPreconnected s


@[simp]
theorem coe_toNonUnitalAlgHom (φ : characterSpace 𝕜 A) : ⇑(toNonUnitalAlgHom φ) = φ

{𝕜 : Type u_1}
{A : Type u_2}
[CommSemiring 𝕜]
[TopologicalSpace 𝕜]
[ContinuousAdd 𝕜]
[ContinuousConstSMul 𝕜 𝕜]
[NonUnitalNonAssocSemiring A]
[TopologicalSpace A]
[Module 𝕜 A]
(φ : ↑(WeakDual.characterSpace 𝕜 A))

⇑(WeakDual.CharacterSpace.toNonUnitalAlgHom φ) = ⇑φ


@[simp]
theorem getElem_enum (l : List α) (i : Nat) (h : i < l.enum.length) :
    l.enum[i] = (i, l[i]'(by simpa [enum_length] using h))

{α : Type u_1}
(l : List α)
(i : ℕ)
(h : i < l.enum.length)


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

{G : Type u_1}
{H : Type u_2}
[AddGroup G]
[AddGroup H]
{f : G → H}
(hf : IsAddGroupHom f)
{a b : G}
(h : f a = f b)


@[reassoc (attr := simp)]
theorem IsImage.lift_ι {F : MonoFactorisation f} (hF : IsImage F) :
    hF.lift (Image.monoFactorisation f) ≫ image.ι f = F.m

{F : CategoryTheory.Limits.MonoFactorisation f}

hF.lift (CategoryTheory.Limits.Image.monoFactorisation f) ≫ CategoryTheory.Limits.image.ι f = F.m


@[to_additive]
theorem divRight_eq_mulRight_inv (a : G) : Equiv.divRight a = Equiv.mulRight a⁻¹


/-- If the multiplicative action of `M` on `N` is compatible with multiplication on `N`, then
`fun x ↦ x • 1` is a monoid homomorphism from `M` to `N`. -/
@[to_additive (attr := simps)
"If the additive action of `M` on `N` is compatible with addition on `N`, then
`fun x ↦ x +ᵥ 0` is an additive monoid homomorphism from `M` to `N`."]
def MonoidHom.smulOneHom {M N} [Monoid M] [MulOneClass N] [MulAction M N] [IsScalarTower M N N] :
    M →* N

{M : Type u_11}
{N : Type u_12}
[Monoid M]
[MulOneClass N]
[MulAction M N]
[IsScalarTower M N N]
(x : M)


theorem fmod_nonneg' (a : Int) {b : Int} (hb : 0 < b) : 0 ≤ a.fmod b


theorem fixedPoints_antitone : Antitone fun P : Submonoid M => fixedPoints P α

(M : Type u_1)
(α : Type u_2)
[Monoid M]
[MulAction M α]

Antitone fun P => MulAction.fixedPoints (↥P) α


@[simp]
lemma constFormalMultilinearSeries_zero [NontriviallyNormedField 𝕜] [NormedAddCommGroup E ]
    [NormedAddCommGroup F] [NormedSpace 𝕜 E] [NormedSpace 𝕜 F] :
    constFormalMultilinearSeries 𝕜 E (0 : F) = 0

{𝕜 : Type u}
{E : Type v}
{F : Type w}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 F]


theorem ContDiffWithinAt.restrict_scalars (h : ContDiffWithinAt 𝕜' n f s x) :
    ContDiffWithinAt 𝕜 n f s x

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{x : E}
{n : ℕ∞}
{𝕜' : Type u_3}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormedSpace 𝕜' E]
[IsScalarTower 𝕜 𝕜' E]
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
(h : ContDiffWithinAt 𝕜' n f s x)


theorem Nontrivial.exists_lt [LinearOrder α] (hs : s.Nontrivial) : ∃ᵉ (x ∈ s) (y ∈ s), x < y

{α : Type u}
{s : Set α}
[LinearOrder α]
(hs : s.Nontrivial)


theorem foldl (f) (init : α) : ∀ {s}, ValidFor l m r s → s.foldl f init = m.foldl f init

{α : Type u_1}
{l m r : List Char}
(f : α → Char → α)
(init : α)
{s : Substring}

Substring.ValidFor l m r s → Substring.foldl f init s = List.foldl f init m


@[simp]
theorem map_mul [Fintype n] {L : Matrix m n α} {M : Matrix n o α} [NonAssocSemiring β]
    {f : α →+* β} : (L * M).map f = L.map f * M.map f

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
{β : Type w}
[NonAssocSemiring α]
[Fintype n]
{L : Matrix m n α}
{M : Matrix n o α}
[NonAssocSemiring β]
{f : α →+* β}


theorem Wbtw.right_mem_affineSpan_of_left_ne {x y z : P} (h : Wbtw R x y z) (hne : x ≠ y) :
    z ∈ line[R, x, y]

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{x y z : P}
(h : Wbtw R x y z)
(hne : x ≠ y)


theorem hasSum_iff_tendsto_nat {f : ℕ → ℝ≥0∞} (r : ℝ≥0∞) :
    HasSum f r ↔ Tendsto (fun n : ℕ => ∑ i ∈ Finset.range n, f i) atTop (𝓝 r)

HasSum f r ↔ Filter.Tendsto (fun n => ∑ i ∈ Finset.range n, f i) Filter.atTop (𝓝 r)


theorem RingHom.IsIntegralElem.of_mem_closure {x y z : S} (hx : f.IsIntegralElem x)
    (hy : f.IsIntegralElem y) (hz : z ∈ Subring.closure ({x, y} : Set S)) : f.IsIntegralElem z

{R : Type u_1}
{S : Type u_4}
[CommRing R]
[CommRing S]
(f : R →+* S)
{x y z : S}
(hx : f.IsIntegralElem x)
(hy : f.IsIntegralElem y)
(hz : z ∈ Subring.closure {x, y})


theorem lower_raise' : ∀ l n, lower' (raise' l n) n = l

Denumerable.lower' (Denumerable.raise' l n) n = l


theorem continuous_of_le_add_edist {f : α → ℝ≥0∞} (C : ℝ≥0∞) (hC : C ≠ ∞)
    (h : ∀ x y, f x ≤ f y + C * edist x y) : Continuous f

{f : α → ℝ≥0∞}

(h : ∀ (x y : α), f x ≤ f y + C * edist x y)


theorem fixInduction'_stop {C : α → Sort*} {f : α →. β ⊕ α} {b : β} {a : α} (h : b ∈ f.fix a)
    (fa : Sum.inl b ∈ f a) (hbase : ∀ a_final : α, Sum.inl b ∈ f a_final → C a_final)
    (hind : ∀ a₀ a₁ : α, b ∈ f.fix a₁ → Sum.inr a₁ ∈ f a₀ → C a₁ → C a₀) :
    @fixInduction' _ _ C _ _ _ h hbase hind = hbase a fa

{f : α →. β ⊕ α}

(hbase : (a_final : α) → Sum.inl b ∈ f a_final → C a_final)

(hind : (a₀ a₁ : α) → b ∈ f.fix a₁ → Sum.inr a₁ ∈ f a₀ → C a₁ → C a₀)

PFun.fixInduction' h hbase hind = hbase a fa


theorem getElem?_reverse {l : List α} {i} (h : i < length l) :
    l.reverse[i]? = l[l.length - 1 - i]?

{α : Type u_1}
{l : List α}
{i : Nat}
(h : i < l.length)


theorem arg_eq_nhds_of_im_pos (hz : 0 < im z) : arg =ᶠ[𝓝 z] fun x => Real.arccos (x.re / abs x)

Complex.arg =ᶠ[𝓝 z] fun x => Real.arccos (x.re / Complex.abs x)


theorem HasStrictFDerivAt.of_nmem_tsupport (h : x ∉ tsupport f) :
    HasStrictFDerivAt f (0 : E →L[𝕜] F) x

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


@[simp]
theorem quot_right_distrib (x y z : PGame) : (⟦(x + y) * z⟧ : Game) = ⟦x * z⟧ + ⟦y * z⟧


@[to_additive]
theorem inv_mul_lt_one_iff : a⁻¹ * b < 1 ↔ b < a

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


@[reassoc (attr := simp)]
lemma ι_D₂ (i₁₂ i₁₂' : I₁₂) (i₁ : I₁) (i₂ : I₂)
    (h : ComplexShape.π c₁ c₂ c₁₂ ⟨i₁, i₂⟩ = i₁₂) :
    K.ιTotal c₁₂ i₁ i₂ i₁₂ h ≫ K.D₂ c₁₂ i₁₂ i₁₂' =
      K.d₂ c₁₂ i₁ i₂ i₁₂'

{C : Type u_1}
[CategoryTheory.Category.{u_5, u_1} C]
[CategoryTheory.Preadditive C]
{I₁ : Type u_2}
{I₂ : Type u_3}
{I₁₂ : Type u_4}
{c₁ : ComplexShape I₁}
{c₂ : ComplexShape I₂}
(K : HomologicalComplex₂ C c₁ c₂)
(c₁₂ : ComplexShape I₁₂)
[DecidableEq I₁₂]
[TotalComplexShape c₁ c₂ c₁₂]
[K.HasTotal c₁₂]
(i₁₂ i₁₂' : I₁₂)
(i₁ : I₁)
(i₂ : I₂)
(h : c₁.π c₂ c₁₂ (i₁, i₂) = i₁₂)


@[simp] lemma num_nonneg : 0 ≤ q.num ↔ 0 ≤ q


/-- Rotating both vectors by the same angle does not change the angle between those vectors. -/
@[simp]
theorem oangle_rotation (x y : V) (θ : Real.Angle) :
    o.oangle (o.rotation θ x) (o.rotation θ y) = o.oangle x y

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

o.oangle ((o.rotation θ) x) ((o.rotation θ) y) = o.oangle x y


/-- Partial homeomorphisms, defined on open subsets of the space -/
-- Porting note(#5171): this linter isn't ported yet. @[nolint has_nonempty_instance]
structure PartialHomeomorph (X : Type*) (Y : Type*) [TopologicalSpace X]
  [TopologicalSpace Y] extends PartialEquiv X Y where
  open_source : IsOpen source
  open_target : IsOpen target
  continuousOn_toFun : ContinuousOn toFun source
  continuousOn_invFun : ContinuousOn invFun target

{X : Type u_7}
{Y : Type u_8}
[TopologicalSpace X]
[TopologicalSpace Y]
(self : PartialHomeomorph X Y)


@[simp] lemma right_mem_uIoc : b ∈ Ι a b ↔ a < b

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


theorem dvd_iff_dvd_ofDigits (b b' : ℕ) (c : ℤ) (h : (b : ℤ) ∣ (b' : ℤ) - c) (n : ℕ) :
    b ∣ n ↔ (b : ℤ) ∣ ofDigits c (digits b' n)

b ∣ n ↔ ↑b ∣ Nat.ofDigits c (b'.digits n)


theorem eventually_isPartition (l : IntegrationParams) (I : Box ι) :
    ∀ᶠ π in l.toFilteriUnion I ⊤, TaggedPrepartition.IsPartition π

{ι : Type u_1}
[Fintype ι]
(l : BoxIntegral.IntegrationParams)
(I : BoxIntegral.Box ι)

∀ᶠ (π : BoxIntegral.TaggedPrepartition I) in l.toFilteriUnion I ⊤, π.IsPartition


/-- Arithmetic progressions are preserved under 2-Freiman isos. -/
@[to_additive "Arithmetic progressions are preserved under 2-Freiman isos."]
lemma IsMulFreimanIso.mulRothNumber_congr (hf : IsMulFreimanIso 2 A B f) :
    mulRothNumber A = mulRothNumber B

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[CommMonoid α]
[CommMonoid β]
[DecidableEq β]
{A : Finset α}
{B : Finset β}
{f : α → β}
(hf : IsMulFreimanIso 2 (↑A) (↑B) f)


@[simp] theorem zero_num : (0 : Rat).num = 0


theorem derivativeFun_coe (f : R[X]) : (f : R⟦X⟧).derivativeFun = derivative f

{R : Type u_1}
[CommSemiring R]
(f : Polynomial R)

(↑f).derivativeFun = ↑(Polynomial.derivative f)


theorem opNNNorm_pi
    [∀ i', SeminormedAddCommGroup (E' i')] [∀ i', NormedSpace 𝕜 (E' i')]
    (f : ∀ i', ContinuousMultilinearMap 𝕜 E (E' i')) : ‖pi f‖₊ = ‖f‖₊

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

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

(f : (i' : ι') → ContinuousMultilinearMap 𝕜 E (E' i'))


theorem neg_def (α : Type*) (t : Language.ring.Term α) :
    -t = negFunc.apply₁ t

(α : Type u_2)
(t : FirstOrder.Language.ring.Term α)


@[simp]
theorem le_iInf_iff : a ≤ iInf f ↔ ∀ i, a ≤ f i

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


theorem implicitFunction_hasStrictFDerivAt (g'inv : G →L[𝕜] E)
    (hg'inv : φ.rightDeriv.comp g'inv = ContinuousLinearMap.id 𝕜 G)
    (hg'invf : φ.leftDeriv.comp g'inv = 0) :
    HasStrictFDerivAt (φ.implicitFunction (φ.leftFun φ.pt)) g'inv (φ.rightFun φ.pt)


/-- Continuous star algebra homomorphisms from `C(s, 𝕜)` into a star `𝕜`-algebra `A` which agree
at `X : 𝕜[X]` (interpreted as a continuous map) are, in fact, equal. -/
@[ext]
theorem ContinuousMap.starAlgHom_ext_map_X {𝕜 A : Type*} [RCLike 𝕜] [Ring A] [StarRing 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))


/-- `n`-times continuously differentiable diffeomorphism between `M` and `M'` with respect to `I`
and `I'`. -/
-- Porting note(#5171): was @[nolint has_nonempty_instance]
structure Diffeomorph extends M ≃ M' where
  protected contMDiff_toFun : ContMDiff I I' n toEquiv
  protected contMDiff_invFun : ContMDiff I' I n toEquiv.symm

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_5}
[TopologicalSpace H]
{H' : Type u_6}
[TopologicalSpace H']
{I : ModelWithCorners 𝕜 E H}
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{M' : Type u_10}
[TopologicalSpace M']
[ChartedSpace H' M']
{n : ℕ∞}
(self : M ≃ₘ^n⟮I, I'⟯ M')


/-- An `R` algebra `A` is smooth if it is formally smooth and of finite presentation.

In the stacks project, the definition of smooth is completely different, and tag
<https://stacks.math.columbia.edu/tag/00TN> proves that their definition is equivalent
to this.
-/
class Smooth [CommSemiring R] (A : Type u) [Semiring A] [Algebra R A] : Prop where
  formallySmooth : FormallySmooth R A := by infer_instance
  finitePresentation : FinitePresentation R A := by infer_instance

{R : Type u}
[CommSemiring R]
{A : Type u}
[Semiring A]
[Algebra R A]
[self : Algebra.Smooth R A]


/-- When `V` is braided the forgetful functor `Action V G` to `V` is braided. -/
@[simps!]
def forgetBraided : BraidedFunctor (Action V G) V

(V : Type (u + 1))
[CategoryTheory.LargeCategory V]
(G : MonCat)
[CategoryTheory.MonoidalCategory V]
[CategoryTheory.BraidedCategory V]
(X Y : Action V G)

(Action.forgetBraided V G).μ X Y = 𝟙 (CategoryTheory.MonoidalCategory.tensorObj X.V Y.V)


theorem chromaticNumber_ne_top_iff_exists : G.chromaticNumber ≠ ⊤ ↔ ∃ n, G.Colorable n


/-- If a subalgebra is contained in a finite-dimensional
subalgebra with the same or smaller dimension, they are equal. -/
theorem _root_.Subalgebra.eq_of_le_of_finrank_le (h_finrank : finrank K E ≤ finrank K F) : F = E

(h_finrank : FiniteDimensional.finrank K ↥E ≤ FiniteDimensional.finrank K ↥F)


/-- If `α i` has a faithful scalar action for a given `i`, then so does `Π i, α i`. This is
not an instance as `i` cannot be inferred. -/
@[to_additive
"If `α i` has a faithful additive action for a given `i`, then
so does `Π i, α i`. This is not an instance as `i` cannot be inferred"]
lemma faithfulSMul_at [∀ i, SMul M (α i)] [∀ i, Nonempty (α i)] (i : ι) [FaithfulSMul M (α i)] :
    FaithfulSMul M (∀ i, α i)

{ι : Type u_1}
{M : Type u_2}
{α : ι → Type u_4}
[(i : ι) → VAdd M (α i)]
[∀ (i : ι), Nonempty (α i)]
(i : ι)
[FaithfulVAdd M (α i)]


@[to_additive]
theorem ciInf_mul (hf : BddBelow (range f)) (a : G) : (⨅ i, f i) * a = ⨅ i, f i * a

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


theorem prod_toSubmodule : (S.prod S₁).toSubmodule = S.toSubmodule.prod S₁.toSubmodule

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[NonUnitalNonAssocSemiring B]
[Module R B]
(S : NonUnitalSubalgebra R A)
(S₁ : NonUnitalSubalgebra R B)


theorem iSup_le_iSup_of_subset {f : β → α} {s t : Set β} : s ⊆ t → ⨆ x ∈ s, f x ≤ ⨆ x ∈ t, f x

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


theorem adjunction_unit_app {X : Scheme} :
    ΓSpec.adjunction.unit.app X = locallyRingedSpaceAdjunction.unit.app X.1

AlgebraicGeometry.ΓSpec.adjunction.unit.app X =
  AlgebraicGeometry.ΓSpec.locallyRingedSpaceAdjunction.unit.app X.toLocallyRingedSpace


@[simp]
theorem card_add (o₁ o₂ : Ordinal) : card (o₁ + o₂) = card o₁ + card o₂


theorem attach_affineCombination_of_injective [DecidableEq P] (s : Finset P) (w : P → k) (f : s → P)
    (hf : Function.Injective f) :
    s.attach.affineCombination k f (w ∘ f) = (image f univ).affineCombination k id w

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
[DecidableEq P]
(s : Finset P)
(w : P → k)
(f : { x // x ∈ s } → P)
(hf : Function.Injective f)

(Finset.affineCombination k s.attach f) (w ∘ f) = (Finset.affineCombination k (Finset.image f Finset.univ) id) w


theorem mem_perpBisector_iff_inner_pointReflection_vsub_eq_zero :
    c ∈ perpBisector p₁ p₂ ↔ ⟪Equiv.pointReflection c p₁ -ᵥ p₂, p₂ -ᵥ p₁⟫ = 0

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{c p₁ p₂ : P}

c ∈ AffineSubspace.perpBisector p₁ p₂ ↔ ⟪(Equiv.pointReflection c) p₁ -ᵥ p₂, p₂ -ᵥ p₁⟫_ℝ = 0


theorem csInf_eq_least_of_bdd {s : Set ℤ} [DecidablePred (· ∈ s)] (b : ℤ) (Hb : ∀ z ∈ s, b ≤ z)
    (Hinh : ∃ z : ℤ, z ∈ s) : sInf s = leastOfBdd b Hb Hinh

{s : Set ℤ}
[DecidablePred fun x => x ∈ s]
(b : ℤ)
(Hb : ∀ z ∈ s, b ≤ z)
(Hinh : ∃ z, z ∈ s)


theorem cons_head_tail (v : Vector3 α (n + 1)) : (head v :: tail v) = v

{α : Type u_1}
{n : ℕ}
(v : Vector3 α (n + 1))


/-- If `f₀, f₁, f₂, ...` and `g₀, g₁, g₂, ...` are both multipliable, then the product of the
`ℤ`-indexed sequence: `..., g₂, g₁, g₀, f₀, f₁, f₂, ...` (with `f₀` at the `0`-th position) is
`(∏' n, f n) * ∏' n, g n`. -/
@[to_additive "If `f₀, f₁, f₂, ...` and `g₀, g₁, g₂, ...` are both summable, then the sum of the
`ℤ`-indexed sequence: `..., g₂, g₁, g₀, f₀, f₁, f₂, ...` (with `f₀` at the `0`-th position) is
`∑' n, f n + ∑' n, g n`."]
lemma tprod_int_rec [T2Space M] {f g : ℕ → M} (hf : Multipliable f) (hg : Multipliable g) :
    ∏' n : ℤ, Int.rec f g n = (∏' n : ℕ, f n) * ∏' n : ℕ, g n

{M : Type u_1}
[CommMonoid M]
[TopologicalSpace M]
[ContinuousMul M]
[T2Space M]
{f g : ℕ → M}
(hf : Multipliable f)
(hg : Multipliable g)

∏' (n : ℤ), Int.rec f g n = (∏' (n : ℕ), f n) * ∏' (n : ℕ), g n


theorem mem_map (f : α → β) {a : α} : ∀ {s : Seq α}, a ∈ s → f a ∈ map f s

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


protected theorem congr_fun (h : e = e') (x : A) : e x = e' x

{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 e' : A ≃ₗc[R] B}
(h : e = e')
(x : A)


theorem domRestrict_le {f : E →ₗ.[R] F} {S : Submodule R E} : f.domRestrict S ≤ f

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
{f : E →ₗ.[R] F}
{S : Submodule R E}


theorem cons_right_injective (x : α) : Function.Injective (cons x)


/-- A bijection between two sets `s : Set α` and `t : Set β` provides a partial equivalence
between `α` and `β`. -/
@[simps (config := .asFn)]
noncomputable def BijOn.toPartialEquiv [Nonempty α] (f : α → β) (s : Set α) (t : Set β)
    (hf : BijOn f s t) : PartialEquiv α β

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

↑(Set.BijOn.toPartialEquiv f s t hf) = f


@[simp]
theorem one_nmul (a) : 1 ⨳ a = a


@[simp]
theorem getElem_ofFn {n} (f : Fin n → α) (i : Nat) (h : i < (ofFn f).length) :
    (ofFn f)[i] = f ⟨i, by simp_all⟩

{α : Type u}
{n : ℕ}
(f : Fin n → α)
(i : ℕ)
(h : i < (List.ofFn f).length)


/-- If `s ⊂ t`, then `s < t` in the colex order. Note the converse does not hold, as inclusion does
not form a linear order. -/
lemma toColex_lt_toColex_of_ssubset (h : s ⊂ t) : toColex s < toColex t

{α : Type u_1}
[PartialOrder α]
{s t : Finset α}
(h : s ⊂ t)


@[to_additive (attr := continuity, fun_prop)]
theorem continuous_mk : Continuous (@mk M)


@[simp]
theorem finSuccEquiv_apply (p : MvPolynomial (Fin (n + 1)) R) :
    finSuccEquiv R n p =
      eval₂Hom (Polynomial.C.comp (C : R →+* MvPolynomial (Fin n) R))
        (fun i : Fin (n + 1) => Fin.cases Polynomial.X (fun k => Polynomial.C (X k)) i) p

(R : Type u)
[CommSemiring R]
(n : ℕ)
(p : MvPolynomial (Fin (n + 1)) R)

(MvPolynomial.finSuccEquiv R n) p =
  (MvPolynomial.eval₂Hom (Polynomial.C.comp MvPolynomial.C) fun i =>
      Fin.cases Polynomial.X (fun k => Polynomial.C (MvPolynomial.X k)) i)
    p


theorem id_eq_path_refl (x : FundamentalGroupoid X) : 𝟙 x = ⟦Path.refl x.as⟧

{X : Type u}
[TopologicalSpace X]
(x : FundamentalGroupoid X)


theorem repr_mul (a b) : repr (a * b) = repr a * repr b


theorem isOpen_singleton_iff {α : Type*} [PseudoMetricSpace α] {x : α} :
    IsOpen ({x} : Set α) ↔ ∃ ε > 0, ∀ y, dist y x < ε → y = x

{α : Type u_3}
[PseudoMetricSpace α]
{x : α}

IsOpen {x} ↔ ∃ ε > 0, ∀ (y : α), dist y x < ε → y = x


@[reassoc (attr := simp)]
lemma map_inv_hom_id_eval_app (e : X ≅ Y) (F : C ⥤ D ⥤ E) (j : J) (Y : D) :
    (F.map (e.inv j)).app Y ≫ (F.map (e.hom j)).app Y = 𝟙 _

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

∀ (Y_1 : D),
  CategoryTheory.CategoryStruct.comp ((F.map (e.inv j)).app Y_1) ((F.map (e.hom j)).app Y_1) =
    CategoryTheory.CategoryStruct.id ((F.obj (Y j)).obj Y_1)


@[norm_cast]
theorem coe_prod (s : Subsemiring R) (t : Subsemiring S) :
    (s.prod t : Set (R × S)) = (s : Set R) ×ˢ (t : Set S)

{R : Type u}
{S : Type v}
[NonAssocSemiring R]
[NonAssocSemiring S]
(s : Subsemiring R)
(t : Subsemiring S)


theorem geom_sum₂_mul [CommRing α] (x y : α) (n : ℕ) :
    (∑ i ∈ range n, x ^ i * y ^ (n - 1 - i)) * (x - y) = x ^ n - y ^ n

{α : Type u}
[CommRing α]
(x y : α)
(n : ℕ)

(∑ i ∈ Finset.range n, x ^ i * y ^ (n - 1 - i)) * (x - y) = x ^ n - y ^ n


/-- **Vitali's convergence theorem**: A sequence of functions `f` converges to `g` in Lp if and
only if it is uniformly integrable and converges to `g` in measure. -/
theorem tendstoInMeasure_iff_tendsto_Lp_finite [IsFiniteMeasure μ] (hp : 1 ≤ p) (hp' : p ≠ ∞)
    (hf : ∀ n, Memℒp (f n) p μ) (hg : Memℒp g p μ) :
    TendstoInMeasure μ f atTop g ∧ UnifIntegrable f p μ ↔
      Tendsto (fun n => eLpNorm (f n - g) p μ) atTop (𝓝 0)

{f : ℕ → α → β}

(hf : ∀ (n : ℕ), MeasureTheory.Memℒp (f n) p μ)

MeasureTheory.TendstoInMeasure μ f Filter.atTop g ∧ MeasureTheory.UnifIntegrable f p μ ↔
  Filter.Tendsto (fun n => MeasureTheory.eLpNorm (f n - g) p μ) Filter.atTop (𝓝 0)


/-- If a measurable space is countably generated and separates points, it is measure equivalent
to some subset of the Cantor space `ℕ → Bool` (equipped with the product sigma algebra).
Note: `s` need not be measurable, so this map need not be a `MeasurableEmbedding` to
the Cantor Space. -/
theorem measurableEquiv_nat_bool_of_countablyGenerated [MeasurableSpace α]
    [CountablyGenerated α] [SeparatesPoints α] :
    ∃ s : Set (ℕ → Bool), Nonempty (α ≃ᵐ s)

(α : Type u_1)
[MeasurableSpace α]
[MeasurableSpace.CountablyGenerated α]
[MeasurableSpace.SeparatesPoints α]


theorem essSup_mono_ae {f g : α → β} (hfg : f ≤ᵐ[μ] g) : essSup f μ ≤ essSup g μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[CompleteLattice β]
{f g : α → β}
(hfg : f ≤ᵐ[μ] g)


@[simp]
theorem isoApp_trans {X Y Z : ∀ i, C i} (f : X ≅ Y) (g : Y ≅ Z) (i : I) :
    isoApp (f ≪≫ g) i = isoApp f i ≪≫ isoApp g i

[(i : I) → CategoryTheory.Category.{v₁, u₁} (C i)]

CategoryTheory.Pi.isoApp (f ≪≫ g) i = CategoryTheory.Pi.isoApp f i ≪≫ CategoryTheory.Pi.isoApp g i


theorem degree_C_mul (a0 : a ≠ 0) : (C a * p).degree = p.degree

{R : Type u}
[Semiring R]
[NoZeroDivisors R]
{p : R[X]}
{a : R}
(a0 : a ≠ 0)


@[to_additive (attr := simp)]
theorem coe_one : ⇑(1 : α →*o β) = 1

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
[AddZeroClass α]
[AddZeroClass β]


theorem rTensor_comp_apply (x : N ⊗[R] M) :
    (g.comp f).rTensor M x = (g.rTensor M) ((f.rTensor M) x)

{R : Type u_1}
[CommSemiring R]
(M : Type u_4)
{N : Type u_5}
{P : Type u_6}
{Q : Type u_7}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[AddCommMonoid Q]
[Module R M]
[Module R N]
[Module R P]
[Module R Q]
(g : P →ₗ[R] Q)
(f : N →ₗ[R] P)
(x : TensorProduct R N M)

(LinearMap.rTensor M (g ∘ₗ f)) x = (LinearMap.rTensor M g) ((LinearMap.rTensor M f) x)


theorem self_ne_neg
    (R) (M) [Semiring R] [CharZero R] [AddCommGroup M] [Module R M] [NoZeroSMulDivisors R M]
    {v : M} : v ≠ -v ↔ v ≠ 0

(R : Type u_9)
(M : Type u_10)
[Semiring R]
[CharZero R]
[AddCommGroup M]
[Module R M]
[NoZeroSMulDivisors R M]
{v : M}


@[simp]
theorem toBoolAlg_one : toBoolAlg (1 : α) = ⊤


/-- **Helly's theorem** for finite families of convex sets.

If `F` is a finite family of convex sets in a vector space of finite dimension `d`, and any
`k ≤ d + 1` sets of `F` intersect nontrivially, then all sets of `F` intersect nontrivially. -/
theorem helly_theorem' {F : ι → Set E} {s : Finset ι}
    (h_convex : ∀ i ∈ s, Convex 𝕜 (F i))
    (h_inter : ∀ I ⊆ s, I.card ≤ finrank 𝕜 E + 1 → (⋂ i ∈ I, F i).Nonempty) :
    (⋂ i ∈ s, F i).Nonempty

(h_inter : ∀ I ⊆ s, I.card ≤ FiniteDimensional.finrank 𝕜 E + 1 → (⋂ i ∈ I, F i).Nonempty)


theorem cutExpand_iff [DecidableEq α] [IsIrrefl α r] {s' s : Multiset α} :
    CutExpand r s' s ↔
      ∃ (t : Multiset α) (a : α), (∀ a' ∈ t, r a' a) ∧ a ∈ s ∧ s' = s.erase a + t

{α : Type u_1}
{r : α → α → Prop}
[DecidableEq α]
[IsIrrefl α r]
{s' s : Multiset α}

Relation.CutExpand r s' s ↔ ∃ t a, (∀ a' ∈ t, r a' a) ∧ a ∈ s ∧ s' = s.erase a + t


@[reassoc (attr := simp)]
lemma desc_commutes_zero {Y Z : C} (f : Z ⟶ Y)
    (I : InjectiveResolution Y) (J : InjectiveResolution Z) :
    J.ι.f 0 ≫ (desc f I J).f 0 = f ≫ I.ι.f 0

(I : CategoryTheory.InjectiveResolution Y)

(J : CategoryTheory.InjectiveResolution Z)

J.ι.f 0 ≫ (CategoryTheory.InjectiveResolution.desc f I J).f 0 = f ≫ I.ι.f 0


/-- In any concrete category, surjective morphisms are epimorphisms. -/
theorem epi_of_surjective {X Y : C} (f : X ⟶ Y) (s : Function.Surjective f) :
    Epi f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.ConcreteCategory C]
{X Y : C}
(f : X ⟶ Y)
(s : Function.Surjective ⇑f)


theorem card_sylow_eq_index_normalizer [Fact p.Prime] [Finite (Sylow p G)] (P : Sylow p G) :
    Nat.card (Sylow p G) = (P : Subgroup G).normalizer.index

{p : ℕ}
{G : Type u_1}
[Group G]
[Fact (Nat.Prime p)]
[Finite (Sylow p G)]
(P : Sylow p G)

Nat.card (Sylow p G) = (↑P).normalizer.index


lemma isTorsionFree_iff_noZeroSMulDivisors_int [AddGroup G] :
    AddMonoid.IsTorsionFree G ↔ NoZeroSMulDivisors ℤ G


@[simp]
theorem lcm_singleton {b : β} : ({b} : Finset β).lcm f = normalize (f b)

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


@[simp] theorem imp_not_self : (a → ¬a) ↔ ¬a


theorem symmDiff_left_surjective (a : α) : Surjective (· ∆ a)

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


@[to_additive]
theorem finprod_eq_if {p : Prop} [Decidable p] {x : M} : ∏ᶠ _ : p, x = if p then x else 1

{M : Type u_2}
[CommMonoid M]
{p : Prop}
[Decidable p]
{x : M}


theorem iSup_mul_iSup_le {a : ℝ≥0} {g h : ι → ℝ≥0} (H : ∀ i j, g i * h j ≤ a) :
    iSup g * iSup h ≤ a

{ι : Sort u_1}
{a : ℝ≥0}
{g h : ι → ℝ≥0}
(H : ∀ (i j : ι), g i * h j ≤ a)


/-- The compact-open topology on `C(X, Y)`
is equal to the infimum of the compact-open topologies on `C(s, Y)` for `s` a compact subset of `X`.
The key point of the proof is that for every compact set `K`,
the universal set `Set.univ : Set K` is a compact set as well. -/
theorem compactOpen_eq_iInf_induced :
    (ContinuousMap.compactOpen : TopologicalSpace C(X, Y)) =
      ⨅ (K : Set X) (_ : IsCompact K), .induced (.restrict K) ContinuousMap.compactOpen

{X : Type u_2}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]

ContinuousMap.compactOpen =
  ⨅ K, ⨅ (_ : IsCompact K), TopologicalSpace.induced (ContinuousMap.restrict K) ContinuousMap.compactOpen


@[simp]
theorem isLowerSet_compl : IsLowerSet sᶜ ↔ IsUpperSet s


/-- The trivial commutative monoid object. We later show this is initial in `CommMon_ C`.
-/
@[simps!]
def trivial : CommMon_ C

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


theorem eval_eq (X : σ → R) (f : MvPolynomial σ R) :
    eval X f = ∑ d ∈ f.support, f.coeff d * ∏ i ∈ d.support, X i ^ d i

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(X : σ → R)
(f : MvPolynomial σ R)

(MvPolynomial.eval X) f = ∑ d ∈ f.support, MvPolynomial.coeff d f * ∏ i ∈ d.support, X i ^ d i


@[simp]
theorem formPerm_coe (l : List α) (hl : l.Nodup) : formPerm (l : Cycle α) hl = l.formPerm

{α : Type u_1}
[DecidableEq α]
(l : List α)
(hl : l.Nodup)


lemma equiv_comp (L : C ⥤ D) [L.IsLocalization W] {X Y Z : C} [HasSmallLocalizedHom.{w} W X Y]
    [HasSmallLocalizedHom.{w} W Y Z] [HasSmallLocalizedHom.{w} W X Z]
    (α : SmallHom.{w} W X Y) (β : SmallHom.{w} W Y Z) :
    equiv W L (α.comp β) = equiv W L α ≫ equiv W L β

[CategoryTheory.Localization.HasSmallLocalizedHom W X Y]

[CategoryTheory.Localization.HasSmallLocalizedHom W Y Z]

[CategoryTheory.Localization.HasSmallLocalizedHom W X Z]

(α : CategoryTheory.Localization.SmallHom W X Y)

(β : CategoryTheory.Localization.SmallHom W Y Z)

(CategoryTheory.Localization.SmallHom.equiv W L) (α.comp β) =
  CategoryTheory.CategoryStruct.comp ((CategoryTheory.Localization.SmallHom.equiv W L) α)
    ((CategoryTheory.Localization.SmallHom.equiv W L) β)


@[to_additive]
theorem ker_le_comap (H : Subgroup N) : f.ker ≤ comap f H

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
(f : G →+ N)
(H : AddSubgroup N)


theorem Set.OrdConnected.apply_covBy_apply_iff (f : α ↪o β) (h : (range f).OrdConnected) :
    f a ⋖ f b ↔ a ⋖ b

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{a b : α}
(f : α ↪o β)
(h : (Set.range ⇑f).OrdConnected)


@[to_additive (attr := simp)]
lemma mulEnergy_univ_right : Eₘ[s, univ] = Fintype.card α * s.card ^ 2

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

s.mulEnergy Finset.univ = Fintype.card α * s.card ^ 2


/--
The multiplicative congruences on `M` bijects to the multiplicative congruences on `Mᵐᵒᵖ`
-/
@[to_additive (attr := simps) "The additive congruences on `M` bijects to the additive congruences
on `Mᵃᵒᵖ`"]
def orderIsoOp : Con M ≃o Con Mᵐᵒᵖ


theorem IsVanKampenColimit.isUniversal {F : J ⥤ C} {c : Cocone F} (H : IsVanKampenColimit c) :
    IsUniversalColimit c

(H : CategoryTheory.IsVanKampenColimit c)


theorem toMulBot_strictMono : StrictMono (@toMulBot α _)


@[simp]
theorem toIocDiv_add_zsmul' (a b : α) (m : ℤ) :
    toIocDiv hp (a + m • p) b = toIocDiv hp a b - m

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


theorem GameAdd.snd_fst {a₁ a₂ b : α} (h : rα a₁ a₂) : GameAdd rα s(b, a₁) s(a₂, b)

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


theorem lift_injective (F : IntermediateField K L) : Function.Injective F.lift

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(F : IntermediateField K L)


@[to_additive (attr := simp)]
lemma finEquivPowers_symm_apply (x : G) (hx) (n : ℕ) {hn : ∃ m : ℕ, x ^ m = x ^ n} :
    (finEquivPowers x hx).symm ⟨x ^ n, hn⟩ = ⟨n % orderOf x, Nat.mod_lt _ hx.orderOf_pos⟩

{G : Type u_1}
[LeftCancelMonoid G]
(x : G)
(hx : IsOfFinOrder x)
(n : ℕ)
{hn : ∃ m, x ^ m = x ^ n}

(finEquivPowers x hx).symm ⟨x ^ n, hn⟩ = ⟨n % orderOf x, ⋯⟩


@[simp] theorem tendsto_pow_atTop_nhds_zero_iff {𝕜 : Type*} [LinearOrderedField 𝕜] [Archimedean 𝕜]
    [TopologicalSpace 𝕜] [OrderTopology 𝕜] {r : 𝕜} :
    Tendsto (fun n : ℕ ↦ r ^ n) atTop (𝓝 0) ↔ |r| < 1

{𝕜 : Type u_4}
[LinearOrderedField 𝕜]
[Archimedean 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
{r : 𝕜}

Filter.Tendsto (fun n => r ^ n) Filter.atTop (𝓝 0) ↔ |r| < 1


theorem SimpleFunc.lintegral_eq_lintegral {m : MeasurableSpace α} (f : α →ₛ ℝ≥0∞) (μ : Measure α) :
    ∫⁻ a, f a ∂μ = f.lintegral μ

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


theorem zpow_mul' (A : M) (h : IsUnit A.det) (m n : ℤ) : A ^ (m * n) = (A ^ n) ^ m

{n' : Type u_1}
[DecidableEq n']
[Fintype n']
{R : Type u_2}
[CommRing R]
(A : Matrix n' n' R)
(h : IsUnit A.det)
(m n : ℤ)


theorem map_iInf (hf : RightOrdContinuous f) (g : ι → α) : f (⨅ i, g i) = ⨅ i, f (g i)

{α : Type u}
{β : Type v}
{ι : Sort x}
[CompleteLattice α]
[CompleteLattice β]
{f : α → β}
(hf : RightOrdContinuous f)
(g : ι → α)


theorem exists_le_of_le {a b : α} {P Q : Finpartition a} (h : P ≤ Q) (hb : b ∈ Q.parts) :
    ∃ c ∈ P.parts, c ≤ b

{α : Type u_1}
[DistribLattice α]
[OrderBot α]
{a b : α}
{P Q : Finpartition a}
(h : P ≤ Q)
(hb : b ∈ Q.parts)


/--
The associativity of a unital shelf comes for free.
-/
lemma assoc (x y z : S) : (x ◃ y) ◃ z = x ◃ y ◃ z

{S : Type u_1}
[UnitalShelf S]
(x y z : S)


theorem _root_.Filter.Tendsto.path_extend
    {l r : Y → X} {y : Y} {l₁ : Filter ℝ} {l₂ : Filter X} {γ : ∀ y, Path (l y) (r y)}
    (hγ : Tendsto (↿γ) (𝓝 y ×ˢ l₁.map (projIcc 0 1 zero_le_one)) l₂) :
    Tendsto (↿fun x => (γ x).extend) (𝓝 y ×ˢ l₁) l₂

(hγ : Filter.Tendsto (↿γ) (𝓝 y ×ˢ Filter.map (Set.projIcc 0 1 ⋯) l₁) l₂)

Filter.Tendsto (↿fun x => (γ x).extend) (𝓝 y ×ˢ l₁) l₂


theorem mapM_eq_foldlM [Monad m] [LawfulMonad m] (f : α → m β) (arr : Array α) :
    arr.mapM f = arr.foldlM (fun bs a => bs.push <$> f a) #[]

{m : Type u_1 → Type u_2}
{α : Type u_3}
{β : Type u_1}
[Monad m]
[LawfulMonad m]
(f : α → m β)
(arr : Array α)

Array.mapM f arr = Array.foldlM (fun bs a => bs.push <$> f a) #[] arr 0


theorem xgcdAux_P {r r'} :
    ∀ {s t s' t'}, P x y (r, s, t) → P x y (r', s', t') → P x y (xgcdAux r s t r' s' t')

Nat.P x y (r, s, t) → Nat.P x y (r', s', t') → Nat.P x y (r.xgcdAux s t r' s' t')


theorem tendsto_atTop_add_const_left (C : β) (hf : Tendsto f l atTop) :
    Tendsto (fun x => C + f x) l atTop

{α : Type u_3}
{β : Type u_4}
[OrderedAddCommGroup β]
(l : Filter α)
{f : α → β}
(C : β)
(hf : Filter.Tendsto f l Filter.atTop)

Filter.Tendsto (fun x => C + f x) l Filter.atTop


theorem nhdsWithin_Ioi_neBot [NoMaxOrder α] {a b : α} (H : a ≤ b) : NeBot (𝓝[Ioi a] b)

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
[NoMaxOrder α]
{a b : α}
(H : a ≤ b)


/-- In a cancellative monoid of exponent two, all elements commute. -/
@[to_additive]
lemma mul_comm_of_exponent_two [IsCancelMul G] (hG : Monoid.exponent G = 2) (a b : G) :
    a * b = b * a

{G : Type u}
[Monoid G]
[IsCancelMul G]
(hG : Monoid.exponent G = 2)
(a b : G)


@[simp]
theorem Module.Ray.map_symm (e : M ≃ₗ[R] N) : (Module.Ray.map e).symm = Module.Ray.map e.symm

{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
(e : M ≃ₗ[R] N)


theorem inl_le_inl_iff [LE α] [LE β] {a b : α} : toLex (inl a : α ⊕ β) ≤ toLex (inl b) ↔ a ≤ b

{α : Type u_1}
{β : Type u_2}
[LE α]
[LE β]
{a b : α}

toLex (Sum.inl a) ≤ toLex (Sum.inl b) ↔ a ≤ b


/-- The matrix associated to the adjoint of a linear map corresponding to two orthonormal bases
is the conjugate tranpose of the matrix associated to the linear map. -/
lemma LinearMap.toMatrix_adjoint (f : E →ₗ[𝕜] F) :
    toMatrix v₂.toBasis v₁.toBasis (adjoint f) = (toMatrix v₁.toBasis v₂.toBasis f)ᴴ

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 E]
[InnerProductSpace 𝕜 F]
{m : Type u_5}
{n : Type u_6}
[Fintype m]
[DecidableEq m]
[Fintype n]
[DecidableEq n]
[FiniteDimensional 𝕜 E]
[FiniteDimensional 𝕜 F]
(v₁ : OrthonormalBasis n 𝕜 E)
(v₂ : OrthonormalBasis m 𝕜 F)
(f : E →ₗ[𝕜] F)

(LinearMap.toMatrix v₂.toBasis v₁.toBasis) (LinearMap.adjoint f) =
  ((LinearMap.toMatrix v₁.toBasis v₂.toBasis) f).conjTranspose


/-- Predicate for ring homomorphisms (deprecated -- use the bundled `RingHom` version). -/
structure IsRingHom {α : Type u} {β : Type v} [Ring α] [Ring β] (f : α → β) : Prop where
  /-- The proposition that `f` preserves the multiplicative identity. -/
  map_one : f 1 = 1
  /-- The proposition that `f` preserves multiplication. -/
  map_mul : ∀ x y, f (x * y) = f x * f y
  /-- The proposition that `f` preserves addition. -/
  map_add : ∀ x y, f (x + y) = f x + f y

{α : Type u}
{β : Type v}
[Ring α]
[Ring β]
{f : α → β}
(self : IsRingHom f)


/-- This breaks a list of `m*n` items into `m` groups each containing `n` elements. -/
theorem ofFn_mul {m n} (f : Fin (m * n) → α) :
    List.ofFn f = List.join (List.ofFn fun i : Fin m => List.ofFn fun j : Fin n => f ⟨i * n + j,
    calc
      ↑i * n + j < (i + 1) * n :=
        (Nat.add_lt_add_left j.prop _).trans_eq (by rw [Nat.add_mul, Nat.one_mul])
      _ ≤ _ := Nat.mul_le_mul_right _ i.prop⟩)

{α : Type u}
{m n : ℕ}
(f : Fin (m * n) → α)

List.ofFn f = (List.ofFn fun i => List.ofFn fun j => f ⟨↑i * n + ↑j, ⋯⟩).join


lemma preimage_val_sInter_eq_sInter : A ↓∩ (⋂₀ S) = ⋂₀ ((A ↓∩ ·) '' S)

{α : Type u_2}
{A : Set α}
{S : Set (Set α)}

Subtype.val ⁻¹' ⋂₀ S = ⋂₀ ((fun x => Subtype.val ⁻¹' x) '' S)


@[simp]
theorem decode_one : (decode 1 : Option Bool) = some true


@[simp]
theorem inversion_zero_radius (c x : P) : inversion c 0 x = c

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(c x : P)


lemma isZero_X_of_isStrictlySupported [K.IsStrictlySupported e]
    (i' : ι') (hi' : ∀ i, e.f i ≠ i') :
    IsZero (K.X i')


theorem recF_eq {α : Type _} (g : F α → α) (x : q.P.W) :
    recF g x = g (abs (q.P.map (recF g) x.dest))

{F : Type u → Type u}
[q : QPF F]
{α : Type u}
(g : F α → α)
(x : (QPF.P F).W)

QPF.recF g x = g (QPF.abs ((QPF.P F).map (QPF.recF g) x.dest))


theorem aleph0_lt_aleph_one : ℵ₀ < aleph 1


@[simp] lemma coprime_two_left : Coprime 2 n ↔ Odd n


theorem func_mem (x : PSet) (i : x.Type) : x.Func i ∈ x


lemma mul_val_inv (hmn : m.Coprime n) : (m * (m⁻¹ : ZMod n).val : ZMod n) = 1


@[simp] theorem UInt64.val_ofNat (n) :
    (no_index (OfNat.ofNat n) : UInt64).val = OfNat.ofNat n


@[simp]
theorem coe_neLocus : ↑(f.neLocus g) = { x | f x ≠ g x }

{α : Type u_1}
{N : Type u_3}
[DecidableEq α]
[DecidableEq N]
[Zero N]
(f g : α →₀ N)


lemma card_prod_singleton (s : Set α) (b : β) : Nat.card (s ×ˢ {b}) = Nat.card s

{α : Type u_1}
{β : Type u_2}
(s : Set α)
(b : β)


@[simp]
theorem mk_le_mk [Preorder β] {f g : α → β} (hf hg) : (mk f hf : α →ₘ[μ] β) ≤ mk g hg ↔ f ≤ᵐ[μ] g

(hf : MeasureTheory.AEStronglyMeasurable f μ)

(hg : MeasureTheory.AEStronglyMeasurable g μ)

MeasureTheory.AEEqFun.mk f hf ≤ MeasureTheory.AEEqFun.mk g hg ↔ f ≤ᵐ[μ] g


theorem finRotate_bit1_mem_alternatingGroup {n : ℕ} :
    finRotate (2 * n + 1) ∈ alternatingGroup (Fin (2 * n + 1))


@[simp]
theorem pushoutCoconeOfRightIso_ι_app_left : (pushoutCoconeOfRightIso f g).ι.app left = 𝟙 _

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

(CategoryTheory.Limits.pushoutCoconeOfRightIso f g).ι.app CategoryTheory.Limits.WalkingSpan.left =
  𝟙 ((CategoryTheory.Limits.span f g).obj CategoryTheory.Limits.WalkingSpan.left)


@[simp] theorem map_simple (e : W ≃* H) (i : B) : (cs.map e).simple i = e (cs.simple i)

{B : Type u_1}
{W : Type u_3}
{H : Type u_4}
[Group W]
[Group H]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
(e : W ≃* H)
(i : B)


/-- The functor `(S, F ⋙ G) ⥤ (S, G)`. -/
@[simps!]
def pre (S : D) (F : B ⥤ C) (G : C ⥤ D) : StructuredArrow S (F ⋙ G) ⥤ StructuredArrow S G

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{B : Type u₄}
[CategoryTheory.Category.{v₄, u₄} B]
(S : D)
(F : CategoryTheory.Functor B C)
(G : CategoryTheory.Functor C D)

∀ {X Y : CategoryTheory.Comma (CategoryTheory.Functor.fromPUnit S) (F.comp G)} (f : X ⟶ Y),
  ((CategoryTheory.StructuredArrow.pre S F G).map f).right = F.map f.right