/-- Given `X : D` and `F : C ⥤ D`, to upgrade a functor `G : E ⥤ C` to a functor
    `E ⥤ StructuredArrow X F`, it suffices to provide maps `X ⟶ F.obj (G.obj Y)` for all `Y` making
    the obvious triangles involving all `F.map (G.map g)` commute.

    This is of course the same as providing a cone over `F ⋙ G` with cone point `X`, see
    `Functor.toStructuredArrowIsoToStructuredArrow`. -/
@[simps]
def toStructuredArrow (G : E ⥤ C) (X : D) (F : C ⥤ D) (f : (Y : E) → X ⟶ F.obj (G.obj Y))
    (h : ∀ {Y Z : E} (g : Y ⟶ Z), f Y ≫ F.map (G.map g) = f Z) : E ⥤ StructuredArrow X F

(h : ∀ {Y Z : E} (g : Y ⟶ Z), CategoryTheory.CategoryStruct.comp (f Y) (F.map (G.map g)) = f Z)

∀ {X_1 Y : E} (g : X_1 ⟶ Y), (G.toStructuredArrow X F f h).map g = CategoryTheory.StructuredArrow.homMk (G.map g) ⋯


@[to_additive]
theorem _root_.MonoidHom.pi_ext [Finite ι] [DecidableEq ι] {f g : (∀ i, M i) →* γ}
    (h : ∀ i x, f (Pi.mulSingle i x) = g (Pi.mulSingle i x)) : f = g

(h : ∀ (i : ι) (x : M i), f (Pi.mulSingle i x) = g (Pi.mulSingle i x))


@[simp]
theorem transpose_row (v : m → α) : (Matrix.row ι v)ᵀ = Matrix.col ι v

{m : Type u_2}
{α : Type v}
{ι : Type u_6}
(v : m → α)

(Matrix.row ι v).transpose = Matrix.col ι v


lemma isTriangulated_of_precomp_iso {H : C ⥤ E} (e : F ⋙ G ≅ H) [H.CommShift ℤ]
    [H.IsTriangulated] [F.IsTriangulated] [F.mapArrow.EssSurj] [NatTrans.CommShift e.hom ℤ] :
    G.IsTriangulated

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

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

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


@[to_additive]
theorem tendsto_inv_nhdsWithin_Iic_inv {a : H} : Tendsto Inv.inv (𝓝[≤] a⁻¹) (𝓝[≥] a)

{H : Type x}
[TopologicalSpace H]
[OrderedCommGroup H]
[ContinuousInv H]
{a : H}

Filter.Tendsto Inv.inv (𝓝[≤] a⁻¹) (𝓝[≥] a)


@[to_additive]
theorem smul_finset_card_le : (a • s).card ≤ s.card

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[VAdd α β]
{s : Finset β}
{a : α}


lemma predAbove_pred_self (p : Fin (n + 1)) (hp : p ≠ 0) : (pred p hp).predAbove p = pred p hp


theorem natCast_ne_iff {m n : ℕ} : (m : EReal) ≠ (n : EReal) ↔ m ≠ n

↑m ≠ ↑n ↔ m ≠ n


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


theorem imageSubobject_arrow_comp_eq_zero [HasZeroMorphisms C] {X Y Z : C} {f : X ⟶ Y} {g : Y ⟶ Z}
    [HasImage f] [Epi (factorThruImageSubobject f)] (h : f ≫ g = 0) :
    (imageSubobject f).arrow ≫ g = 0

(CategoryTheory.Limits.imageSubobject f).arrow ≫ g = 0


/-- If an element `b` becomes right-regular after multiplying it on the right by a right-regular
element, then `b` is right-regular. -/
@[to_additive "If an element `b` becomes add-right-regular after adding to it on the right
an add-right-regular element, then `b` is add-right-regular."]
theorem IsRightRegular.of_mul (ab : IsRightRegular (b * a)) : IsRightRegular b

{R : Type u_1}
[Semigroup R]
{a b : R}
(ab : IsRightRegular (b * a))


/-- The typeclass `IsLocalization (M : Submonoid R) S` where `S` is an `R`-algebra
expresses that `S` is isomorphic to the localization of `R` at `M`. -/
@[mk_iff] class IsLocalization : Prop where
  -- Porting note: add ' to fields, and made new versions of these with either `S` or `M` explicit.
  /-- Everything in the image of `algebraMap` is a unit -/
  map_units' : ∀ y : M, IsUnit (algebraMap R S y)
  /-- The `algebraMap` is surjective -/
  surj' : ∀ z : S, ∃ x : R × M, z * algebraMap R S x.2 = algebraMap R S x.1
  /-- The kernel of `algebraMap` is contained in the annihilator of `M`;
      it is then equal to the annihilator by `map_units'` -/
  exists_of_eq : ∀ {x y}, algebraMap R S x = algebraMap R S y → ∃ c : M, ↑c * x = ↑c * y

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

IsLocalization M S ↔
  (∀ (y : ↥M), IsUnit ((algebraMap R S) ↑y)) ∧
    (∀ (z : S), ∃ x, z * (algebraMap R S) ↑x.2 = (algebraMap R S) x.1) ∧
      ∀ {x y : R}, (algebraMap R S) x = (algebraMap R S) y → ∃ c, ↑c * x = ↑c * y


lemma zpow_two_pos_of_ne_zero (ha : a ≠ 0) : 0 < a ^ (2 : ℤ)

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


theorem of_c_eq_zero' : toPoly ⟨0, 0, 0, d⟩ = C d

{ a := 0, b := 0, c := 0, d := d }.toPoly = Polynomial.C d


@[simp] lemma flip_pt : t.flip.pt = t.pt

(t : CategoryTheory.Limits.PushoutCocone f g)


/-- The equivalence `(ComposableArrows C n)ᵒᵖ ≌ ComposableArrows Cᵒᵖ n` obtained
by reversing the arrows. -/
@[simps!]
def opEquivalence : (ComposableArrows C n)ᵒᵖ ≌ ComposableArrows Cᵒᵖ n

(X : (CategoryTheory.Functor (Fin (n + 1)) C)ᵒᵖ)

(CategoryTheory.ComposableArrows.opEquivalence C n).unitIso.hom.app X =
  CategoryTheory.CategoryStruct.comp
    ((CategoryTheory.Equivalence.adjointifyη
              (CategoryTheory.NatIso.ofComponents
                (fun F =>
                  (((CategoryTheory.orderDualEquivalence (Fin (n + 1))).symm.trans
                            Fin.revOrderIso.equivalence).symm.funInvIdAssoc
                      F).symm)
                ⋯)
              (CategoryTheory.NatIso.ofComponents
                (fun F =>
                  ((CategoryTheory.orderDualEquivalence (Fin (n + 1))).symm.trans
                          Fin.revOrderIso.equivalence).symm.invFunIdAssoc
                    F)
                ⋯)).inv.app
        (Opposite.unop X)).op
    (CategoryTheory.whiskerLeft (⋯.functor.comp (CategoryTheory.orderDualEquivalence (Fin (n + 1))).functor)
        (((CategoryTheory.orderDualEquivalence (Fin (n + 1))).inverse.comp ⋯.functor).comp
              (Opposite.unop X)).rightOpLeftOpIso.hom).op


theorem nndist_smul₀ (s : α) (x y : β) : nndist (s • x) (s • y) = ‖s‖₊ * nndist x y

{α : Type u_1}
{β : Type u_2}
[NormedDivisionRing α]
[SeminormedAddCommGroup β]
[Module α β]
[BoundedSMul α β]
(s : α)
(x y : β)


theorem IsBounded.insert (h : IsBounded s) (x : α) : IsBounded (insert x s)

∀ {x : Bornology α} {s : Set α}, Bornology.IsBounded s → ∀ (x_1 : α), Bornology.IsBounded (insert x_1 s)


@[deprecated getElem?_set_eq' (since := "2024-06-12")]
theorem get?_set_eq (a : α) (n) (l : List α) : (set l n a).get? n = (fun _ => a) <$> l.get? n

{α : Type u_1}
(a : α)
(n : Nat)
(l : List α)

(l.set n a).get? n = (fun x => a) <$> l.get? n


lemma mem_coe_supp_of_adj {v w : V} {H : Subgraph G} {c : ConnectedComponent H.coe}
    (hv : v ∈ (↑) '' (c : Set H.verts)) (hw : w ∈ H.verts)
    (hadj : H.Adj v w) : w ∈ (↑) '' (c : Set H.verts)

{V : Type u}
{G : SimpleGraph V}
{v w : V}
{H : G.Subgraph}
{c : H.coe.ConnectedComponent}
(hv : v ∈ Subtype.val '' ↑c)
(hw : w ∈ H.verts)
(hadj : H.Adj v w)


@[simp]
theorem natPred_add_one (n : ℕ+) : n.natPred + 1 = n


theorem log_im (x : ℂ) : x.log.im = x.arg


/-- If `α` and `β` are order-isomorphic then the two orders of order-homomorphisms
from `α` and `β` to themselves are order-isomorphic. -/
@[simps! apply symm_apply]
def conj {α β} [Preorder α] [Preorder β] (f : α ≃o β) : (α →o α) ≃ (β →o β)

{α : Type u_6}
{β : Type u_7}
[Preorder α]
[Preorder β]
(f : α ≃o β)
(a : α →o α)


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


@[reassoc (attr := simp)]
theorem limitObjIsoLimitCompEvaluation_hom_π [HasLimitsOfShape J C] (F : J ⥤ K ⥤ C) (j : J)
    (k : K) :
    (limitObjIsoLimitCompEvaluation F k).hom ≫ limit.π (F ⋙ (evaluation K C).obj k) j =
      (limit.π F j).app k

(CategoryTheory.Limits.limitObjIsoLimitCompEvaluation F k).hom ≫
    CategoryTheory.Limits.limit.π (F ⋙ (CategoryTheory.evaluation K C).obj k) j =
  (CategoryTheory.Limits.limit.π F j).app k


@[simp] lemma Definable.himp {s t : Set (α → M)} (hs : A.Definable L s) (ht : A.Definable L t) :
    A.Definable L (s ⇨ t)

{M : Type w}
{A : Set M}
{L : FirstOrder.Language}
[L.Structure M]
{α : Type u₁}
{s t : Set (α → M)}
(hs : A.Definable L s)
(ht : A.Definable L t)


theorem elim_comp (h : α → β) {f : γ → α} {x : α} {i : Option γ} :
    (i.elim (h x) fun j => h (f j)) = h (i.elim x f)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(h : α → β)
{f : γ → α}
{x : α}
{i : Option γ}


theorem hom.injective {x : Subgraph G} : Function.Injective x.hom

{V : Type u}
{G : SimpleGraph V}
{x : G.Subgraph}


theorem continuousOn_abs_circleTransformBoundingFunction {R r : ℝ} (hr : r < R) (z : ℂ) :
    ContinuousOn (abs ∘ circleTransformBoundingFunction R z) (closedBall z r ×ˢ univ)

ContinuousOn (⇑Complex.abs ∘ Complex.circleTransformBoundingFunction R z) (Metric.closedBall z r ×ˢ Set.univ)


theorem bounded_lt_inter_le [LinearOrder α] (a : α) :
    Bounded (· < ·) (s ∩ { b | a ≤ b }) ↔ Bounded (· < ·) s

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

Set.Bounded (fun x x_1 => x < x_1) (s ∩ {b | a ≤ b}) ↔ Set.Bounded (fun x x_1 => x < x_1) s


theorem UniformSpace.mem_nhds_iff_symm {x : α} {s : Set α} :
    s ∈ 𝓝 x ↔ ∃ V ∈ 𝓤 α, SymmetricRel V ∧ ball x V ⊆ s

{α : Type ua}
[UniformSpace α]
{x : α}
{s : Set α}

s ∈ 𝓝 x ↔ ∃ V ∈ 𝓤 α, SymmetricRel V ∧ UniformSpace.ball x V ⊆ s


theorem Monotone.map_iInf₂_le [CompleteLattice β] {f : α → β} (hf : Monotone f) (s : ∀ i, κ i → α) :
    f (⨅ (i) (j), s i j) ≤ ⨅ (i) (j), f (s i j)

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_5}
{κ : ι → Sort u_7}
[CompleteLattice α]
[CompleteLattice β]
{f : α → β}
(hf : Monotone f)
(s : (i : ι) → κ i → α)

f (⨅ i, ⨅ j, s i j) ≤ ⨅ i, ⨅ j, f (s i j)


theorem ite_eq_or_eq : ite P a b = a ∨ ite P a b = b

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

(if P then a else b) = a ∨ (if P then a else b) = b


@[simp] theorem moduleCat_of_toModuleCat (X : QuadraticModuleCat.{v} R) :
    ModuleCat.of R X.toModuleCat = X.toModuleCat

{R : Type u}
[CommRing R]
(X : QuadraticModuleCat R)

ModuleCat.of R ↑X.toModuleCat = X.toModuleCat


theorem rename_comp_bind₁ {υ : Type*} (f : σ → MvPolynomial τ R) (g : τ → υ) :
    (rename g).comp (bind₁ f) = bind₁ fun i => rename g <| f i

{σ : Type u_1}
{τ : Type u_2}
{R : Type u_3}
[CommSemiring R]
{υ : Type u_6}
(f : σ → MvPolynomial τ R)
(g : τ → υ)

(MvPolynomial.rename g).comp (MvPolynomial.bind₁ f) = MvPolynomial.bind₁ fun i => (MvPolynomial.rename g) (f i)


theorem Finite.of_injective [IsNoetherian R N] (f : M →ₗ[R] N) (hf : Function.Injective f) :
    Finite R M

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
[IsNoetherian R N]
(f : M →ₗ[R] N)
(hf : Function.Injective ⇑f)


/-- A graph is connected if it's preconnected and contains at least one vertex.
This follows the convention observed by mathlib that something is connected iff it has
exactly one connected component.

There is a `CoeFun` instance so that `h u v` can be used instead of `h.Preconnected u v`. -/
@[mk_iff]
structure Connected : Prop where
  protected preconnected : G.Preconnected
  protected [nonempty : Nonempty V]

G.Connected ↔ G.Preconnected ∧ Nonempty V


@[simp] lemma cons_tail_eq (p : G.Walk x y) (hp : ¬ p.Nil) :
    cons (p.adj_sndOfNotNil hp) (p.tail hp) = p

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


theorem coeff_injective (h : IsAdjoinRootMonic S f) : Function.Injective h.coeff

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
(h : IsAdjoinRootMonic S f)


/-- Representation of a difference of two squares of commuting elements as a product. -/
theorem mul_self_sub_mul_self_eq [NonUnitalNonAssocRing R] {a b : R} (h : Commute a b) :
    a * a - b * b = (a + b) * (a - b)

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


@[simp] theorem take_succ_cons {a : α} (n : ℕ) (s : Stream' α) :
    take (n+1) (a::s) = a :: take n s

{α : Type u}
{a : α}
(n : ℕ)
(s : Stream' α)

Stream'.take (n + 1) (Stream'.cons a s) = a :: Stream'.take n s


theorem wbtw_rotate_iff [NoZeroSMulDivisors R V] (x : P) {y z : P} :
    Wbtw R x y z ∧ Wbtw R z x y ↔ x = y

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


@[simp]
theorem bliminf_or_eq_inf : (bliminf u f fun x => p x ∨ q x) = bliminf u f p ⊓ bliminf u f q

{α : Type u_1}
{β : Type u_2}
[CompleteDistribLattice α]
{f : Filter β}
{p q : β → Prop}
{u : β → α}

(Filter.bliminf u f fun x => p x ∨ q x) = Filter.bliminf u f p ⊓ Filter.bliminf u f q


theorem isCobounded_biInter {s : Set ι} {f : ι → Set α} (hs : s.Finite) :
    IsCobounded (⋂ i ∈ s, f i) ↔ ∀ i ∈ s, IsCobounded (f i)

{ι : Type u_1}
{α : Type u_2}
[Bornology α]
{s : Set ι}
{f : ι → Set α}
(hs : s.Finite)

Bornology.IsCobounded (⋂ i ∈ s, f i) ↔ ∀ i ∈ s, Bornology.IsCobounded (f i)


theorem aeval_map_algebraMap (x : σ → B) (p : MvPolynomial σ R) :
    aeval x (map (algebraMap R A) p) = aeval x p

{R : Type u_1}
(A : Type u_2)
{B : Type u_3}
{σ : Type u_4}
[CommSemiring R]
[CommSemiring A]
[CommSemiring B]
[Algebra R A]
[Algebra A B]
[Algebra R B]
[IsScalarTower R A B]
(x : σ → B)
(p : MvPolynomial σ R)

(MvPolynomial.aeval x) ((MvPolynomial.map (algebraMap R A)) p) = (MvPolynomial.aeval x) p


theorem length_le_chainHeight_of_mem_subchain (hl : l ∈ s.subchain) : ↑l.length ≤ s.chainHeight

{α : Type u_1}
[LT α]
{s : Set α}
{l : List α}
(hl : l ∈ s.subchain)


@[simp]
theorem dirac_apply (a : α) (s : Set α) : dirac a s = indicator s (fun _ => 1) a

(MeasureTheory.OuterMeasure.dirac a) s = s.indicator (fun x => 1) a


theorem cos_int_mul_two_pi_sub (x : ℂ) (n : ℤ) : cos (n * (2 * π) - x) = cos x

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


theorem isRegular_aleph_one : IsRegular (aleph 1)


/-- The tangent of an angle in a right-angled triangle multiplied by the adjacent side equals
the opposite side. -/
theorem tan_oangle_left_mul_dist_of_oangle_eq_pi_div_two {p₁ p₂ p₃ : P}
    (h : ∡ p₁ p₂ p₃ = ↑(π / 2)) : Real.Angle.tan (∡ p₃ p₁ p₂) * dist p₁ p₂ = dist p₃ p₂

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

(∡ p₃ p₁ p₂).tan * dist p₁ p₂ = dist p₃ p₂


theorem commutator_le_inf [Normal H₁] [Normal H₂] : ⁅H₁, H₂⁆ ≤ H₁ ⊓ H₂

⁅H₁, H₂⁆ ≤ H₁ ⊓ H₂


/-- Note that this result is not quite a special case of
`LieModule.isNilpotent_range_toEnd_iff` which concerns nilpotency of the
`(ad R L).range`-module `L`, whereas this result concerns nilpotency of the `(ad R L).range`-module
`(ad R L).range`. -/
@[simp]
theorem LieAlgebra.isNilpotent_range_ad_iff : IsNilpotent R (ad R L).range ↔ IsNilpotent R L

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]

LieAlgebra.IsNilpotent R ↥(LieAlgebra.ad R L).range ↔ LieAlgebra.IsNilpotent R L


theorem coe_injective ⦃f g : C^n⟮I, M; I', M'⟯⦄ (h : (f : M → M') = g) : f = g

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_4}
[TopologicalSpace H]
{H' : Type u_5}
[TopologicalSpace H']
{I : ModelWithCorners 𝕜 E H}
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_6}
[TopologicalSpace M]
[ChartedSpace H M]
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{n : ℕ∞}
⦃f g : C^n⟮I, M; I', M'⟯⦄
(h : ⇑f = ⇑g)


@[to_additive (attr := simp)]
theorem one_left (a : M) : Commute 1 a


/-- `a` semiconjugates `x` to `a * x * a⁻¹`. -/
@[to_additive "`a` semiconjugates `x` to `a + x + -a`."]
theorem conj_mk (a x : G) : SemiconjBy a x (a * x * a⁻¹)


theorem offDiag_inter : (s ∩ t).offDiag = s.offDiag ∩ t.offDiag

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


theorem closure_pow (s : Set R) : ∀ n : ℕ, closure s ^ n = closure (s ^ n)

{R : Type u_4}
[Semiring R]
(s : Set R)
(n : ℕ)

AddSubmonoid.closure s ^ n = AddSubmonoid.closure (s ^ n)


lemma IsPerfectMatching.induce_connectedComponent_isMatching (h : M.IsPerfectMatching)
    (c : ConnectedComponent G) : (M.induce c.supp).IsMatching

{V : Type u_1}
{G : SimpleGraph V}
{M : G.Subgraph}
(h : M.IsPerfectMatching)
(c : G.ConnectedComponent)


lemma primitiveCharacter_isPrimitive : IsPrimitive (χ.primitiveCharacter)

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


/-- See note [partially-applied ext lemmas] -/
@[ext 1100]
theorem algHom_ext' {φ ψ : Unitization R A →ₐ[R] C}
    (h :
      φ.toNonUnitalAlgHom.comp (inrNonUnitalAlgHom R A) =
        ψ.toNonUnitalAlgHom.comp (inrNonUnitalAlgHom R A)) :
    φ = ψ

(h : (↑φ).comp (Unitization.inrNonUnitalAlgHom R A) = (↑ψ).comp (Unitization.inrNonUnitalAlgHom R A))


@[simp] theorem subset_cons (a : α) (l : List α) : l ⊆ a :: l


/-- A group homomorphism sends 1 to 1. -/
@[to_additive "An additive group homomorphism sends 0 to 0."]
theorem map_one : f 1 = 1

{α : Type u}
{β : Type v}
[AddGroup α]
[AddGroup β]
{f : α → β}
(hf : IsAddGroupHom f)


theorem diagonalSucc_inv_single_left (g : G) (f : Gⁿ →₀ k) (r : k) :
    (diagonalSucc k G n).inv.hom (Finsupp.single g r ⊗ₜ f) =
      Finsupp.lift (Gⁿ⁺¹ →₀ k) k Gⁿ (fun f => single (g • partialProd f) r) f

{k G : Type u}
[CommRing k]
{n : ℕ}
[Group G]
(g : G)
(f : (Fin n → G) →₀ k)
(r : k)

(groupCohomology.resolution.diagonalSucc k G n).inv.hom (Finsupp.single g r ⊗ₜ[k] f) =
  ((Finsupp.lift ((Fin (n + 1) → G) →₀ k) k (Fin n → G)) fun f => Finsupp.single (g • Fin.partialProd f) r) f


@[simp]
theorem mul_invOfUnit (φ : MvPowerSeries σ R) (u : Rˣ) (h : constantCoeff σ R φ = u) :
    φ * invOfUnit φ u = 1

(h : (MvPowerSeries.constantCoeff σ R) φ = ↑u)


/-- If `a` semiconjugates a unit `x` to a unit `y`, then it semiconjugates `x⁻¹` to `y⁻¹`. -/
@[to_additive "If `a` semiconjugates an additive unit `x` to an additive unit `y`, then it
semiconjugates `-x` to `-y`."]
theorem units_inv_right {a : M} {x y : Mˣ} (h : SemiconjBy a x y) : SemiconjBy a ↑x⁻¹ ↑y⁻¹

{M : Type u_1}
[Monoid M]
{a : M}
{x y : Mˣ}
(h : SemiconjBy a ↑x ↑y)


protected theorem monotone (f : F) : Monotone f

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
[FunLike F α β]
[OrderHomClass F α β]
(f : F)


theorem neg_mk_mul_moveLeft_inr {xl xr yl yr} {xL xR yL yR} {i j} :
    (-(mk xl xr xL xR * mk yl yr yL yR)).moveLeft (Sum.inr (i, j)) =
      -(xR i * mk yl yr yL yR + mk xl xr xL xR * yL j - xR i * yL j)

{xl xr yl yr : Type u_1}
{xL : xl → SetTheory.PGame}
{xR : xr → SetTheory.PGame}
{yL : yl → SetTheory.PGame}
{yR : yr → SetTheory.PGame}
{i : xr}
{j : yl}

(-(SetTheory.PGame.mk xl xr xL xR * SetTheory.PGame.mk yl yr yL yR)).moveLeft (Sum.inr (i, j)) =
  -(xR i * SetTheory.PGame.mk yl yr yL yR + SetTheory.PGame.mk xl xr xL xR * yL j - xR i * yL j)


theorem isMaximal_comap_C_of_isJacobson : (P.comap (C : R →+* R[X])).IsMaximal

{R : Type u_1}
[CommRing R]
[Ideal.IsJacobson R]
(P : Ideal (Polynomial R))
[hP : P.IsMaximal]


@[simp]
theorem num_one : num (1 : RatFunc K) = 1


theorem update_star [∀ i, Star (f i)] [DecidableEq I] (h : ∀ i : I, f i) (i : I) (a : f i) :
    Function.update (star h) i (star a) = star (Function.update h i a)

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


theorem Finset.card_compl [DecidableEq α] [Fintype α] (s : Finset α) :
    sᶜ.card = Fintype.card α - s.card

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


theorem drop.aux_none : ∀ n, @drop.aux α n none = Computation.pure none

Stream'.WSeq.drop.aux n none = Computation.pure none


theorem smul'_mk (r : R) (s : S) (m : M) : r • mk m s = mk (r • m) s

{R : Type u}
[CommSemiring R]
{S : Submonoid R}
{M : Type v}
[AddCommMonoid M]
[Module R M]
(r : R)
(s : ↥S)
(m : M)

r • LocalizedModule.mk m s = LocalizedModule.mk (r • m) s


@[simp, norm_cast]
theorem coe_id' : ⇑(ContinuousAlgHom.id R A ) = _root_.id

(R : Type u_1)
[CommSemiring R]
(A : Type u_2)
[Semiring A]
[TopologicalSpace A]
[Algebra R A]


/-- Three points are affinely independent if and only if they are not collinear. -/
theorem affineIndependent_iff_not_collinear_set {p₁ p₂ p₃ : P} :
    AffineIndependent k ![p₁, p₂, p₃] ↔ ¬Collinear k ({p₁, p₂, p₃} : Set P)

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{p₁ p₂ p₃ : P}

AffineIndependent k ![p₁, p₂, p₃] ↔ ¬Collinear k {p₁, p₂, p₃}


/-- The morphism `snakeInput hS₁ i j hij ⟶ snakeInput hS₂ i j hij` induced by
a morphism `φ : S₁ ⟶ S₂` of short complexes of homological complexes, that
are short exact (`hS₁ : S₁.ShortExact` and `hS₂ : S₁.ShortExact`). -/
@[simps]
noncomputable def mapSnakeInput (i j : ι) (hij : c.Rel i j) :
    snakeInput hS₁ i j hij ⟶ snakeInput hS₂ i j hij

{S₁ S₂ : CategoryTheory.ShortComplex (HomologicalComplex C c)}

(HomologicalComplex.HomologySequence.mapSnakeInput φ hS₁ hS₂ i j hij).f₀ =
  (HomologicalComplex.homologyFunctor C c i).mapShortComplex.map φ


lemma nnreal_iff_spectralRadius_le [Algebra ℝ A] {a : A} {t : ℝ≥0} (ht : spectralRadius ℝ a ≤ t) :
    SpectrumRestricts a ContinuousMap.realToNNReal ↔
      spectralRadius ℝ (algebraMap ℝ A t - a) ≤ t

{A : Type u_3}
[Ring A]
[Algebra ℝ A]
{a : A}
{t : ℝ≥0}
(ht : spectralRadius ℝ a ≤ ↑t)

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


theorem image₂_assoc {γ : Type*} {u : Finset γ} {f : δ → γ → ε} {g : α → β → δ} {f' : α → ε' → ε}
    {g' : β → γ → ε'} (h_assoc : ∀ a b c, f (g a b) c = f' a (g' b c)) :
    image₂ f (image₂ g s t) u = image₂ f' s (image₂ g' t u)

{f : δ → γ → ε}

{g : α → β → δ}

(h_assoc : ∀ (a : α) (b : β) (c : γ), f (g a b) c = f' a (g' b c))

Finset.image₂ f (Finset.image₂ g s t) u = Finset.image₂ f' s (Finset.image₂ g' t u)


theorem range_coprod [Module R₁ M₂] [Module R₁ M₃] [ContinuousAdd M₃] (f₁ : M₁ →L[R₁] M₃)
    (f₂ : M₂ →L[R₁] M₃) : range (f₁.coprod f₂) = range f₁ ⊔ range f₂

{R₁ : Type u_1}
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
{M₃ : Type u_7}
[TopologicalSpace M₃]
[AddCommMonoid M₃]
[Module R₁ M₁]
[Module R₁ M₂]
[Module R₁ M₃]
[ContinuousAdd M₃]
(f₁ : M₁ →L[R₁] M₃)
(f₂ : M₂ →L[R₁] M₃)

LinearMap.range (f₁.coprod f₂) = LinearMap.range f₁ ⊔ LinearMap.range f₂


/-- A variation on `Equiv.prodCongr` where the equivalence in the second component can depend
  on the first component. A typical example is a shear mapping, explaining the name of this
  declaration. -/
@[simps (config := .asFn)]
def prodShear (e₁ : α₁ ≃ α₂) (e₂ : α₁ → β₁ ≃ β₂) : α₁ × β₁ ≃ α₂ × β₂

{α₁ : Type u_1}
{β₁ : Type u_2}
{β₂ : Type u_3}
{α₂ : Type u_4}
(e₁ : α₁ ≃ α₂)
(e₂ : α₁ → β₁ ≃ β₂)

⇑(e₁.prodShear e₂) = fun x => (e₁ x.1, (e₂ x.1) x.2)


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

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

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


@[simp]
protected theorem coe_toBasis_repr_apply (b : OrthonormalBasis ι 𝕜 E) (x : E) (i : ι) :
    b.toBasis.repr x i = b.repr x i

{ι : Type u_1}
{𝕜 : Type u_3}
[RCLike 𝕜]
{E : Type u_4}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[Fintype ι]
(b : OrthonormalBasis ι 𝕜 E)
(x : E)
(i : ι)


theorem Set.OrdConnected.null_frontier (hs : s.OrdConnected) : volume (frontier s) = 0

{ι : Type u_1}
[Fintype ι]
{s : Set (ι → ℝ)}
(hs : s.OrdConnected)


lemma map_id_eq_isoClosure (P : MorphismProperty C) :
    P.map (𝟭 _) = P.isoClosure

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


@[simp]
protected theorem mem_sets : s ∈ f.sets ↔ s ∈ f


@[to_additive VAddAntidiagonal.eq_of_fst_eq_fst]
theorem eq_of_fst_eq_fst (h : (x : G × P).fst = (y : G × P).fst) : x = y

{G : Type u_1}
{P : Type u_2}
{s : Set G}
{t : Set P}
{a : P}
[SMul G P]
[IsCancelSMul G P]
{x y : ↑(s.smulAntidiagonal t a)}
(h : (↑x).1 = (↑y).1)


@[congr]
theorem iSup_congr_Prop {p q : Prop} {f₁ : p → α} {f₂ : q → α} (pq : p ↔ q)
    (f : ∀ x, f₁ (pq.mpr x) = f₂ x) : iSup f₁ = iSup f₂

{α : Type u_1}
[SupSet α]
{p q : Prop}
{f₁ : p → α}
{f₂ : q → α}
(pq : p ↔ q)
(f : ∀ (x : q), f₁ ⋯ = f₂ x)


/-- If `R` is a ring, then `Rᵣ` is `R`-finitely-presented for any `r : R`. -/
theorem finitePresentation_holdsForLocalizationAway :
    HoldsForLocalizationAway @FinitePresentation


theorem coverPreserving : CoverPreserving J (e.inverse.inducedTopology J) e.functor

(J : CategoryTheory.GrothendieckTopology C)

CategoryTheory.CoverPreserving J (e.inverse.inducedTopology J) e.functor


@[to_additive (attr := simp)]
theorem fst_comp_toProd : (MonoidHom.fst M N).comp toProd = fst

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

(MonoidHom.fst M N).comp Monoid.Coprod.toProd = Monoid.Coprod.fst


@[simp]
theorem tensorObj (X Y : C) : X ⊗ Y = (X ⨿ Y)

CategoryTheory.MonoidalCategory.tensorObj X Y = (X ⨿ Y)


@[simp] theorem self_eq_append_left {x y : List α} : y = x ++ y ↔ x = []


theorem omegaLimit_subset_of_tendsto {m : τ → τ} {f₁ f₂ : Filter τ} (hf : Tendsto m f₁ f₂) :
    ω f₁ (fun t x ↦ ϕ (m t) x) s ⊆ ω f₂ ϕ s

{τ : Type u_1}
{α : Type u_2}
{β : Type u_3}
[TopologicalSpace β]
(ϕ : τ → α → β)
(s : Set α)
{m : τ → τ}
{f₁ f₂ : Filter τ}
(hf : Filter.Tendsto m f₁ f₂)

omegaLimit f₁ (fun t x => ϕ (m t) x) s ⊆ omegaLimit f₂ ϕ s


/-- Note that the `IsScalarTower M α α` and `SMulCommClass M α α` typeclass arguments are
usually satisfied by `Algebra M α`. -/
@[to_additive] -- Porting note: nolint to_additive_doc
lemma smul_mul_smul [Mul α] (r s : M) (x y : α) [IsScalarTower M α α] [SMulCommClass M α α] :
    r • x * s • y = (r * s) • (x * y)

{M : Type u_1}
{α : Type u_7}
[Monoid M]
[MulAction M α]
[Mul α]
(r s : M)
(x y : α)
[IsScalarTower M α α]
[SMulCommClass M α α]


theorem map_biInf_comap {ι β} {I : Set ι} (hI : I.Nonempty) {f : α → β} (m : ι → OuterMeasure β) :
    map f (⨅ i ∈ I, comap f (m i)) = ⨅ i ∈ I, map f (comap f (m i))

{α : Type u_1}
{ι : Type u_2}
{β : Type u_3}
{I : Set ι}
(hI : I.Nonempty)
{f : α → β}
(m : ι → MeasureTheory.OuterMeasure β)

(MeasureTheory.OuterMeasure.map f) (⨅ i ∈ I, (MeasureTheory.OuterMeasure.comap f) (m i)) =
  ⨅ i ∈ I, (MeasureTheory.OuterMeasure.map f) ((MeasureTheory.OuterMeasure.comap f) (m i))


theorem Nonempty.of_sups_right : (s ⊻ t).Nonempty → t.Nonempty

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


/-- Auxiliary lemma for defining group cohomology, used to show that the isomorphism
`diagonalHomEquiv` commutes with the differentials in two complexes which compute
group cohomology. -/
theorem diagonalHomEquiv_symm_partialProd_succ (f : (Fin n → G) → A) (g : Fin (n + 1) → G)
    (a : Fin (n + 1)) :
    ((diagonalHomEquiv n A).symm f).hom (Finsupp.single (Fin.partialProd g ∘ a.succ.succAbove) 1)
      = f (Fin.contractNth a (· * ·) g)

{k G : Type u}
[CommRing k]
{n : ℕ}
[Group G]
{A : Rep k G}
(f : (Fin n → G) → CoeSort.coe A)
(g : Fin (n + 1) → G)
(a : Fin (n + 1))

((Rep.diagonalHomEquiv n A).symm f).hom (Finsupp.single (Fin.partialProd g ∘ a.succ.succAbove) 1) =
  f (a.contractNth (fun x x_1 => x * x_1) g)


@[simp]
theorem add_linear (f g : P1 →ᵃ[k] V2) : (f + g).linear = f.linear + g.linear

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
{V2 : Type u_4}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
[AddCommGroup V2]
[Module k V2]
(f g : P1 →ᵃ[k] V2)


/-- A special case of `Set.image_finset_prod_pi` for `Finset.univ`. -/
@[to_additive "A special case of `Set.image_finset_sum_pi` for `Finset.univ`. "]
theorem image_fintype_prod_pi [Fintype ι] (S : ι → Set α) :
    (fun f : ι → α => ∏ i, f i) '' univ.pi S = ∏ i, S i

{ι : Type u_1}
{α : Type u_2}
[CommMonoid α]
[Fintype ι]
(S : ι → Set α)

(fun f => ∏ i : ι, f i) '' Set.univ.pi S = ∏ i : ι, S i


theorem trop_eq_iff_eq_untrop {x : R} {y} : trop x = y ↔ x = untrop y

Tropical.trop x = y ↔ x = Tropical.untrop y


@[simp]
lemma preimage_coe_Ioo_top (x : ℝ) : Real.toEReal ⁻¹' Ioo x ⊤ = Ioi x

Real.toEReal ⁻¹' Set.Ioo ↑x ⊤ = Set.Ioi x


theorem factorial_succ (n : ℕ) : (n + 1)! = (n + 1) * n !

(n + 1).factorial = (n + 1) * n.factorial


/--
The underlying object of a condensed object in `C` is the condensed object evaluated at a point.
This can be viewed as a sort of forgetful functor from `Condensed C` to `C`
-/
@[simps!]
noncomputable def Condensed.underlying : Condensed.{u} C ⥤ C

(j : CategoryTheory.Sheaf (CategoryTheory.coherentTopology CompHaus) C)

(Condensed.underlying C).obj j = j.val.obj (Opposite.op (CompHaus.of PUnit.{u + 1}))


theorem MDifferentiableWithinAt.mul (hp : MDifferentiableWithinAt I 𝓘(𝕜, F') p s z)
    (hq : MDifferentiableWithinAt I 𝓘(𝕜, F') q s z) :
    MDifferentiableWithinAt I 𝓘(𝕜, F') (p * q) s z


/-- The 1-morphism `h` commutes with the left Kan extension `f⁺ g`. -/
@[simps!]
def lanCompIso : f⁺ (g ≫ h) ≅ f⁺ g ≫ h

[CategoryTheory.Bicategory.Lan.CommuteWith f g h]

(CategoryTheory.Bicategory.Lan.CommuteWith.lanCompIso f g h).hom =
  CategoryTheory.Bicategory.lanDesc ((CategoryTheory.Bicategory.lanLeftExtension f g).whisker h)


/-- A variant of `CompleteLattice.independent_iff_supIndep` for `Fintype`s. -/
theorem CompleteLattice.independent_iff_supIndep_univ [CompleteLattice α] [Fintype ι] {f : ι → α} :
    CompleteLattice.Independent f ↔ Finset.univ.SupIndep f

{α : Type u_1}
{ι : Type u_3}
[CompleteLattice α]
[Fintype ι]
{f : ι → α}


/-- Viewing a module as an affine space modelled on itself, a `weightedVSub` is just a linear
combination. -/
@[simp]
theorem weightedVSub_eq_linear_combination {ι} (s : Finset ι) {w : ι → k} {p : ι → V}
    (hw : s.sum w = 0) : s.weightedVSub p w = ∑ i ∈ s, w i • p i

{k : Type u_1}
{V : Type u_2}
[Ring k]
[AddCommGroup V]
[Module k V]
{ι : Type u_6}
(s : Finset ι)
{w : ι → k}
{p : ι → V}
(hw : s.sum w = 0)

(s.weightedVSub p) w = ∑ i ∈ s, w i • p i


theorem underlyingIso_top_hom {B : C} : (underlyingIso (𝟙 B)).hom = (⊤ : Subobject B).arrow

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{B : C}

(CategoryTheory.Subobject.underlyingIso (𝟙 B)).hom = ⊤.arrow


theorem iterate_derivative_eq_zero {p : R[X]} {x : ℕ} (hx : p.natDegree < x) :
    Polynomial.derivative^[x] p = 0

{R : Type u}
[Semiring R]
{p : R[X]}
{x : ℕ}
(hx : p.natDegree < x)


@[simp]
theorem image_preimage (e : P₁ ≃ᵃL[k] P₂) (s : Set P₂) : e '' (e ⁻¹' s) = s

{k : Type u_1}
{P₁ : Type u_2}
{P₂ : Type u_3}
{V₁ : Type u_6}
{V₂ : Type u_7}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AddTorsor V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AddTorsor V₂ P₂]
[TopologicalSpace P₁]
[TopologicalSpace P₂]
(e : P₁ ≃ᵃL[k] P₂)
(s : Set P₂)


theorem succChain_spec (h : ∃ t, IsChain r s ∧ SuperChain r s t) :
    SuperChain r s (SuccChain r s)


/-- If `f` is multiplicative and summable, then its values at natural numbers `> 1`
have norm strictly less than `1`. -/
lemma Summable.norm_lt_one {F : Type*} [NormedField F] [CompleteSpace F] {f : ℕ →* F}
    (hsum : Summable f) {p : ℕ} (hp : 1 < p) :
    ‖f p‖ < 1

{F : Type u_1}
[NormedField F]
[CompleteSpace F]
{f : ℕ →* F}
(hsum : Summable ⇑f)
{p : ℕ}
(hp : 1 < p)


@[to_additive (attr := measurability)]
protected theorem Measurable.oneLePart : Measurable fun x ↦ oneLePart (f x)

{α : Type u_1}
{β : Type u_2}
[Lattice α]
[Group α]
[MeasurableSpace α]
[MeasurableSpace β]
{f : β → α}
(hf : Measurable f)
[MeasurableSup α]


/-- A continuous image of a Lindelöf set is a Lindelöf set within the codomain. -/
theorem LindelofSpace.of_continuous_surjective {f : X → Y} [LindelofSpace X] (hf : Continuous f)
    (hsur : Function.Surjective f) : LindelofSpace Y

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
[LindelofSpace X]
(hf : Continuous f)
(hsur : Function.Surjective f)


theorem congr_heq {α β γ : Sort _} {f : α → γ} {g : β → γ} {x : α} {y : β}
    (h₁ : HEq f g) (h₂ : HEq x y) : f x = g y

{α β : Sort u_2}
{γ : Sort u_3}
{f : α → γ}
{g : β → γ}
{x : α}
{y : β}
(h₁ : HEq f g)
(h₂ : HEq x y)


@[to_additive (attr := simp)]
theorem smul_div_one {p : R} {r : X} {s : S} : (p /ₒ s) • (r /ₒ 1) = (p • r) /ₒ s

{R : Type u_1}
[AddMonoid R]
{S : AddSubmonoid R}
[AddOreLocalization.AddOreSet S]
{X : Type u_2}
[AddAction R X]
{p : R}
{r : X}
{s : ↥S}


theorem LinearIndependent.subset_extend (hs : LinearIndependent K (fun x => x : s → V))
    (hst : s ⊆ t) : s ⊆ hs.extend hst

(hs : LinearIndependent K fun (x : ↑s) => ↑x)


lemma dvd_div_of_mul_dvd (h : a * b ∣ c) : b ∣ c / a


@[gcongr]
theorem inter_subset_inter_right (h : s ⊆ t) : s ∩ u ⊆ t ∩ u

{α : Type u_1}
[DecidableEq α]
{s t u : Finset α}
(h : s ⊆ t)


theorem algebraMap_ofSubsemiring_apply (S : Subsemiring R) (x : S) : algebraMap S R x = x

{R : Type u}
[CommSemiring R]
(S : Subsemiring R)
(x : ↥S)


theorem single_injective {i} : Function.Injective (single i : β i → Π₀ i, β i)

{ι : Type u}
{β : ι → Type v}
[DecidableEq ι]
[(i : ι) → Zero (β i)]
{i : ι}


@[to_additive]
theorem mem_coe {c : Con M} {x y} : (x, y) ∈ (↑c : Submonoid (M × M)) ↔ (x, y) ∈ c

{M : Type u_1}
[AddZeroClass M]
{c : AddCon M}
{x y : M}


theorem findGreatest_of_ne_zero (h : Nat.findGreatest P n = m) (h0 : m ≠ 0) : P m

{m : ℕ}
{P : ℕ → Prop}
[DecidablePred P]
{n : ℕ}
(h : Nat.findGreatest P n = m)
(h0 : m ≠ 0)


theorem LieAlgebra.exists_engelian_lieSubalgebra_of_lt_normalizer {K : LieSubalgebra R L}
    (hK₁ : LieAlgebra.IsEngelian.{u₁, u₂, u₄} R K) (hK₂ : K < K.normalizer) :
    ∃ (K' : LieSubalgebra R L), LieAlgebra.IsEngelian.{u₁, u₂, u₄} R K' ∧ K < K'

{R : Type u₁}
{L : Type u₂}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{K : LieSubalgebra R L}
(hK₁ : LieAlgebra.IsEngelian R ↥K)
(hK₂ : K < K.normalizer)

∃ K', LieAlgebra.IsEngelian R ↥K' ∧ K < K'


/-- `average k G` is invariant under right multiplication by elements of `G`.
-/
@[simp]
theorem mul_average_right (g : G) : average k G * ↑(Finsupp.single g 1) = average k G

(k : Type u_1)
(G : Type u_2)
[CommSemiring k]
[Group G]
[Fintype G]
[Invertible ↑(Fintype.card G)]
(g : G)

GroupAlgebra.average k G * Finsupp.single g 1 = GroupAlgebra.average k G


/-- A copy of `mul_invOf_mul_self_cancel` for rectangular matrices. -/
protected theorem mul_invOf_mul_self_cancel (A : Matrix m n α) (B : Matrix n n α) [Invertible B] :
    A * ⅟ B * B = A

{m : Type u_1}
{n : Type u_2}
{α : Type u_3}
[Fintype n]
[DecidableEq n]
[Semiring α]
(A : Matrix m n α)
(B : Matrix n n α)
[Invertible B]


@[simp]
theorem range_cos : Set.range cos = Set.univ


theorem trop_iInf [ConditionallyCompleteLinearOrder R] [Fintype S] (f : S → WithTop R) :
    trop (⨅ i : S, f i) = ∑ i : S, trop (f i)

{R : Type u_1}
{S : Type u_2}
[ConditionallyCompleteLinearOrder R]
[Fintype S]
(f : S → WithTop R)

Tropical.trop (⨅ i, f i) = ∑ i : S, Tropical.trop (f i)


theorem symm_bijective : Function.Bijective (OrderIso.symm : (α ≃o β) → β ≃o α)

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


/-- Every diagram indexing a pushout is naturally isomorphic (actually, equal) to a `span` -/
-- @[simps (config := { rhsMd := semireducible })]  Porting note: no semireducible
@[simps!]
def diagramIsoSpan (F : WalkingSpan ⥤ C) : F ≅ span (F.map fst) (F.map snd)

(F : CategoryTheory.Limits.WalkingSpan ⥤ C)

(CategoryTheory.Limits.diagramIsoSpan F).hom.app X = CategoryTheory.eqToHom ⋯


@[simp, nolint simpNF, norm_cast] lemma natCast_inj {m n : ℕ} : (m : ℚ) = n ↔ m = n


theorem _root_.closedEmbedding_of_continuous_injective_closed (h₁ : Continuous f) (h₂ : Injective f)
    (h₃ : IsClosedMap f) : ClosedEmbedding f

{X : Type u_1}
{Y : Type u_2}
{f : X → Y}
[TopologicalSpace X]
[TopologicalSpace Y]
(h₁ : Continuous f)
(h₂ : Function.Injective f)
(h₃ : IsClosedMap f)


theorem PartialHomeomorph.contDiffOn_univUnitBall_symm :
    ContDiffOn ℝ n univUnitBall.symm (ball (0 : E) 1)

{n : ℕ∞}
{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]

ContDiffOn ℝ n (↑PartialHomeomorph.univUnitBall.symm) (Metric.ball 0 1)


theorem basisDivisor_add_symm {x y : F} (hxy : x ≠ y) :
    basisDivisor x y + basisDivisor y x = 1

{F : Type u_1}
[Field F]
{x y : F}
(hxy : x ≠ y)

Lagrange.basisDivisor x y + Lagrange.basisDivisor y x = 1


@[simp]
theorem refl_trans : (refl R M).trans e = e

{R : Type u_1}
{S : Type u_7}
{M : Type u_8}
{M₂ : Type u_10}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₂]
{module_M : Module R M}
{module_S_M₂ : Module S M₂}
{σ : R →+* S}
{σ' : S →+* R}
{re₁ : RingHomInvPair σ σ'}
{re₂ : RingHomInvPair σ' σ}
(e : M ≃ₛₗ[σ] M₂)


@[simp]
theorem isLocallyFraction_pred {U : Opens (PrimeSpectrum.Top R)}
    (f : ∀ x : U, Localizations M x) :
    (isLocallyFraction M).pred f =
      ∀ y : U,
        ∃ (V : _) (_ : y.1 ∈ V) (i : V ⟶ U),
          ∃ (m : M) (s: R), ∀ x : V, ¬s ∈ x.1.asIdeal ∧ s • f (i x) =
            LocalizedModule.mkLinearMap x.1.asIdeal.primeCompl M m

{U : TopologicalSpace.Opens ↑(AlgebraicGeometry.PrimeSpectrum.Top R)}

(f : (x : ↥U) → ModuleCat.Tilde.Localizations M ↑x)

(ModuleCat.Tilde.isLocallyFraction M).pred f =
  ∀ (y : ↥U),
    ∃ V,
      ∃ (_ : ↑y ∈ V),
        ∃ i m s,
          ∀ (x : ↥V),
            s ∉ (↑x).asIdeal ∧ s • f ((fun x => ⟨↑x, ⋯⟩) x) = (LocalizedModule.mkLinearMap (↑x).asIdeal.primeCompl ↑M) m


lemma Nat.max_log_padicValNat_succ_eq_log_succ (n : ℕ) :
    max (log 2 n) (padicValNat 2 (n + 1)) = log 2 (n + 1)

max (Nat.log 2 n) (padicValNat 2 (n + 1)) = Nat.log 2 (n + 1)


lemma eq_one_iff {χ : MulChar R R'} : χ = 1 ↔ ∀ a : Rˣ, χ a = 1

{R : Type u_1}
[CommMonoid R]
{R' : Type u_2}
[CommMonoidWithZero R']
{χ : MulChar R R'}


/-- Clique-freeness is preserved by `replaceVertex`. -/
protected theorem CliqueFree.replaceVertex [DecidableEq α] (h : G.CliqueFree n) (s t : α) :
    (G.replaceVertex s t).CliqueFree n

{α : Type u_1}
{G : SimpleGraph α}
{n : ℕ}
[DecidableEq α]
(h : G.CliqueFree n)
(s t : α)


theorem uniformEmbedding_inl : UniformEmbedding (Sum.inl : α → α ⊕ β)

{α : Type u}
{β : Type v}
[UniformSpace α]
[UniformSpace β]


@[simp]
theorem forget₂_obj (X : QuadraticModuleCat R) :
    (forget₂ (QuadraticModuleCat R) (ModuleCat R)).obj X = ModuleCat.of R X

{R : Type u}
[CommRing R]
(X : QuadraticModuleCat R)

(CategoryTheory.forget₂ (QuadraticModuleCat R) (ModuleCat R)).obj X = ModuleCat.of R ↑X.toModuleCat


@[simp]
theorem nonempty_Ioc : (Ioc a b).Nonempty ↔ a < b


@[simp, nolint simpNF]
theorem homEquiv_apply_eq (f : A ⊗ Y ⟶ X) : (ihom.adjunction A).homEquiv _ _ f = curry f

(f : CategoryTheory.MonoidalCategory.tensorObj A Y ⟶ X)

((CategoryTheory.ihom.adjunction A).homEquiv Y X) f = CategoryTheory.MonoidalClosed.curry f


theorem CompleteLattice.independent_iff_supIndep [CompleteLattice α] {s : Finset ι} {f : ι → α} :
    CompleteLattice.Independent (f ∘ ((↑) : s → ι)) ↔ s.SupIndep f

{α : Type u_1}
{ι : Type u_3}
[CompleteLattice α]
{s : Finset ι}
{f : ι → α}

CompleteLattice.Independent (f ∘ Subtype.val) ↔ s.SupIndep f


/-- Create an isomorphism between arrows,
by providing isomorphisms between the domains and codomains,
and a proof that the square commutes. -/
@[simps!]
def isoMk {f g : Arrow T} (l : f.left ≅ g.left) (r : f.right ≅ g.right)
    (h : l.hom ≫ g.hom = f.hom ≫ r.hom := by aesop_cat) : f ≅ g

(h : CategoryTheory.CategoryStruct.comp l.hom g.hom = CategoryTheory.CategoryStruct.comp f.hom r.hom := by aesop_cat)

(CategoryTheory.Arrow.isoMk l r h).inv.left = l.inv


theorem ne_iff {f g : F} : f ≠ g ↔ ∃ a, f a ≠ g a

{F : Sort u_1}
{α : Sort u_2}
{β : α → Sort u_3}
[i : DFunLike F α β]
{f g : F}


lemma IsUnramified.eq (h : IsUnramified k w) : mult (w.comap (algebraMap k K)) = mult w

(h : NumberField.InfinitePlace.IsUnramified k w)

(w.comap (algebraMap k K)).mult = w.mult


theorem contMDiffOn_coordChangeL :
    ContMDiffOn IB 𝓘(𝕜, F →L[𝕜] F) n (fun b : B => (e.coordChangeL 𝕜 e' b : F →L[𝕜] F))
      (e.baseSet ∩ e'.baseSet)

[TopologicalSpace (Bundle.TotalSpace F E)]

(e e' : Trivialization F Bundle.TotalSpace.proj)

ContMDiffOn IB 𝓘(𝕜, F →L[𝕜] F) n (fun b => ↑(Trivialization.coordChangeL 𝕜 e e' b)) (e.baseSet ∩ e'.baseSet)


/-- Every presheaf is a sheaf for the regular topology if every object of `C` is projective. -/
theorem isSheaf_of_projective (F : Cᵒᵖ ⥤ D) [Preregular C] [∀ (X : C), Projective X] :
    Presheaf.IsSheaf (regularTopology C) F

[∀ (X : C), CategoryTheory.Projective X]

CategoryTheory.Presheaf.IsSheaf (CategoryTheory.regularTopology C) F


@[simp]
theorem mod_zero (a : R) : a % 0 = a

{R : Type u}
[EuclideanDomain R]
(a : R)


lemma StrictMono.mapsTo_Ico (h : StrictMono f) : MapsTo f (Ico a b) (Ico (f a) (f b))

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

Set.MapsTo f (Set.Ico a b) (Set.Ico (f a) (f b))


@[to_additive]
theorem Right.pow_lt_one_iff [CovariantClass M M (swap (· * ·)) (· < ·)] {n : ℕ} {x : M}
    (hn : 0 < n) : x ^ n < 1 ↔ x < 1

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


@[simp]
theorem nnnorm_neg (f : Lp E p μ) : ‖-f‖₊ = ‖f‖₊

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

‖-f‖₊ = ‖f‖₊


theorem fderivWithin_congr' (hs : EqOn f₁ f s) (hx : x ∈ s) :
    fderivWithin 𝕜 f₁ s x = fderivWithin 𝕜 f s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f f₁ : E → F}
{x : E}
{s : Set E}
(hs : Set.EqOn f₁ f s)
(hx : x ∈ s)


lemma none_mem_insertNone {s : Finset α} : none ∈ insertNone s


lemma leftRightHomologyComparison'_eq_liftH :
    leftRightHomologyComparison' h₁ h₂ =
      h₂.liftH (h₁.descH (h₁.i ≫ h₂.p) (by simp))
        (by rw [← cancel_epi h₁.π, LeftHomologyData.π_descH_assoc, assoc,
          RightHomologyData.p_g', LeftHomologyData.wi, comp_zero])

CategoryTheory.ShortComplex.leftRightHomologyComparison' h₁ h₂ =
  h₂.liftH (h₁.descH (CategoryTheory.CategoryStruct.comp h₁.i h₂.p) ⋯) ⋯


theorem le_countableGenerate_iff_of_countableInterFilter {f : Filter α} [CountableInterFilter f] :
    f ≤ countableGenerate g ↔ g ⊆ f.sets

{α : Type u_2}
{g : Set (Set α)}
{f : Filter α}
[CountableInterFilter f]

f ≤ Filter.countableGenerate g ↔ g ⊆ f.sets


theorem tendsto_eval_ae_ae {i : ι} : Tendsto (eval i) (ae (Measure.pi μ)) (ae (μ i))

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

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

Filter.Tendsto (Function.eval i) (MeasureTheory.ae (MeasureTheory.Measure.pi μ)) (MeasureTheory.ae (μ i))


@[to_additive]
theorem nontrivial_iff_ne_bot (H : Subgroup G) : Nontrivial H ↔ H ≠ ⊥

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


theorem IsCoseparator.def {G : C} :
    IsCoseparator G → ∀ ⦃X Y : C⦄ (f g : X ⟶ Y), (∀ h : Y ⟶ G, f ≫ h = g ≫ h) → f = g

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

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


@[simp]
theorem coeSubmodule_span (s : Set R) :
    coeSubmodule S (Ideal.span s) = Submodule.span R (algebraMap R S '' s)

{R : Type u_1}
[CommRing R]
(S : Type u_2)
[CommRing S]
[Algebra R S]
(s : Set R)

IsLocalization.coeSubmodule S (Ideal.span s) = Submodule.span R (⇑(algebraMap R S) '' s)


/-- Given a Smith-normal-form pair of bases for `N ⊆ M`, and a linear endomorphism `f` of `M`
that preserves `N`, the diagonal of the matrix of the restriction `f` to `N` does not depend on
which of the two bases for `N` is used. -/
@[simp]
lemma toMatrix_restrict_eq_toMatrix [Fintype ι] [DecidableEq ι]
    (f : M →ₗ[R] M) (hf : ∀ x, f x ∈ N) (hf' : ∀ x ∈ N, f x ∈ N := fun x _ ↦ hf x) {i : Fin n} :
    LinearMap.toMatrix snf.bN snf.bN (LinearMap.restrict f hf') i i =
    LinearMap.toMatrix snf.bM snf.bM f (snf.f i) (snf.f i)

{ι : Type u_1}
{R : Type u_2}
[CommRing R]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
{n : ℕ}
{N : Submodule R M}
(snf : Basis.SmithNormalForm N ι n)
[Fintype ι]
[DecidableEq ι]
(f : M →ₗ[R] M)
(hf : ∀ (x : M), f x ∈ N)
(hf' : ∀ x ∈ N, f x ∈ N := ⋯)
{i : Fin n}

(LinearMap.toMatrix snf.bN snf.bN) (f.restrict hf') i i = (LinearMap.toMatrix snf.bM snf.bM) f (snf.f i) (snf.f i)


theorem IsCycle.cycleType {σ : Perm α} (hσ : IsCycle σ) : σ.cycleType = [σ.support.card]

{α : Type u_1}
[Fintype α]
[DecidableEq α]
{σ : Equiv.Perm α}
(hσ : σ.IsCycle)


@[simp]
theorem max_le_iff : max a b ≤ c ↔ a ≤ c ∧ b ≤ c

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


/-- For finsets of naturals, the colexicographic order is equivalent to the order induced by the
`n`-ary expansion. -/
lemma geomSum_lt_geomSum_iff_toColex_lt_toColex (hn : 2 ≤ n) :
    ∑ i ∈ s, n ^ i < ∑ i ∈ t, n ^ i ↔ toColex s < toColex t

∑ i ∈ s, n ^ i < ∑ i ∈ t, n ^ i ↔ { ofColex := s } < { ofColex := t }


theorem bmod_sat (m : Nat) (r : Int) (i : Nat) (x v : Coeffs)
    (h : x.length ≤ i)  -- during proof reconstruction this will be by `decide`
    (p : Coeffs.get v i = bmod_div_term m x v) -- and this will be by `rfl`
    (w : (Constraint.exact r).sat' x v) :
    (Constraint.exact (Int.bmod r m)).sat' (bmod_coeffs m i x) v

(p : v.get i = Lean.Omega.bmod_div_term m x v)

(w : (Lean.Omega.Constraint.exact r).sat' x v = true)

(Lean.Omega.Constraint.exact (r.bmod m)).sat' (Lean.Omega.bmod_coeffs m i x) v = true


@[simp]
theorem ofRealCLM_apply (x : ℝ) : ofRealCLM x = x


theorem smul_eq_C_smul (x : RatFunc K) (r : K) : r • x = Polynomial.C r • x

{K : Type u}
[CommRing K]
(x : RatFunc K)
(r : K)


@[simp]
theorem neg_eq_self [Ring R] [AddCommGroup M] [Module R M] (p : Submodule R M) : -p = p

{R : Type u_2}
{M : Type u_3}
[Ring R]
[AddCommGroup M]
[Module R M]
(p : Submodule R M)


/-- The less-than relation for the lexicographic ordering is decidable. -/
irreducible_def Lex.decidableLT : @DecidableRel (Lex (Π₀ i, α i)) (· < ·)

{ι : Type u_3}
{α : ι → Type u_4}
[(i : ι) → Zero (α i)]
[LinearOrder ι]
[(i : ι) → LinearOrder (α i)]

DFinsupp.Lex.decidableLT =
  DFinsupp.lt_trichotomy_rec (fun {f g} h => isTrue h) (fun {f g} h => isFalse ⋯) fun {f g} h => isFalse ⋯


/-- Casting a power series as a Hahn series with coefficients from a `StrictOrderedSemiring`
  is an algebra homomorphism. -/
@[simps!]
def ofPowerSeriesAlg : PowerSeries A →ₐ[R] HahnSeries Γ A

(Γ : Type u_1)
(R : Type u_2)
[CommSemiring R]
{A : Type u_3}
[Semiring A]
[Algebra R A]
[StrictOrderedSemiring Γ]

∀ (a : PowerSeries A) (b : Γ),
  ((HahnSeries.ofPowerSeriesAlg Γ R) a).coeff b =
    if h : ∃ x, ¬(PowerSeries.coeff A x) a = 0 ∧ ↑x = b then (PowerSeries.coeff A (Classical.choose ⋯)) a else 0


theorem norm_sub_map_le_sub (p : Seminorm 𝕜 E) (x y : E) : ‖p x - p y‖ ≤ p (x - y)

{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
(p : Seminorm 𝕜 E)
(x y : E)


lemma toColex_image_ofColex_strictMono (hf : StrictMono f) :
    StrictMono fun s ↦ toColex <| image f <| ofColex s

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[LinearOrder β]
{f : α → β}
(hf : StrictMono f)

StrictMono fun s => { ofColex := Finset.image f s.ofColex }


/-- A bounded above function `u` is in particular eventually bounded above. -/
lemma _root_.BddAbove.isBoundedUnder [Preorder α] {f : Filter β} {u : β → α} :
    BddAbove (Set.range u) → f.IsBoundedUnder (· ≤ ·) u

{α : Type u_1}
{β : Type u_2}
[Preorder α]
{f : Filter β}
{u : β → α}

BddAbove (Set.range u) → Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) f u


theorem Ideal.homogeneousCore_mono : Monotone (Ideal.homogeneousCore 𝒜)

{ι : Type u_1}
{σ : Type u_2}
{A : Type u_4}
[Semiring A]
[SetLike σ A]
[AddSubmonoidClass σ A]
(𝒜 : ι → σ)
[DecidableEq ι]
[AddMonoid ι]
[GradedRing 𝒜]


/-- Bundle `cfc f a` into a unit given a proof that `f` is nonzero on the spectrum of `a`. -/
@[simps]
noncomputable def cfcUnits (hf' : ∀ x ∈ spectrum R a, f x ≠ 0)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) (ha : p a := by cfc_tac) : Aˣ

↑(cfcUnits f a hf' hf ha)⁻¹ = cfc (fun x => (f x)⁻¹) a


@[simp]
theorem bsup_one (f : ∀ a < (1 : Ordinal), Ordinal) : bsup 1 f = f 0 zero_lt_one

(f : (a : Ordinal.{u_4}) → a < 1 → Ordinal.{max u_4 u_5})


theorem map_induction (as : Array α) (f : α → β) (motive : Nat → Prop) (h0 : motive 0)
    (p : Fin as.size → β → Prop) (hs : ∀ i, motive i.1 → p i (f as[i]) ∧ motive (i+1)) :
    motive as.size ∧
      ∃ eq : (as.map f).size = as.size, ∀ i h, p ⟨i, h⟩ ((as.map f)[i])

(hs : ∀ (i : Fin as.size), motive ↑i → p i (f as[i]) ∧ motive (↑i + 1))

motive as.size ∧ ∃ eq, ∀ (i : Nat) (h : i < as.size), p ⟨i, h⟩ (Array.map f as)[i]


theorem hexagon_forward (X Y Z : C) :
    (BinaryFan.associatorOfLimitCone ℬ X Y Z).hom ≫
        (Limits.BinaryFan.braiding (ℬ X (tensorObj ℬ Y Z)).isLimit
              (ℬ (tensorObj ℬ Y Z) X).isLimit).hom ≫
          (BinaryFan.associatorOfLimitCone ℬ Y Z X).hom =
      tensorHom ℬ (Limits.BinaryFan.braiding (ℬ X Y).isLimit (ℬ Y X).isLimit).hom (𝟙 Z) ≫
        (BinaryFan.associatorOfLimitCone ℬ Y X Z).hom ≫
          tensorHom ℬ (𝟙 Y) (Limits.BinaryFan.braiding (ℬ X Z).isLimit (ℬ Z X).isLimit).hom

(ℬ : (X Y : C) → CategoryTheory.Limits.LimitCone (CategoryTheory.Limits.pair X Y))

CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.BinaryFan.associatorOfLimitCone ℬ X Y Z).hom
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.Limits.BinaryFan.braiding
          (ℬ X (CategoryTheory.MonoidalOfChosenFiniteProducts.tensorObj ℬ Y Z)).isLimit
          (ℬ (CategoryTheory.MonoidalOfChosenFiniteProducts.tensorObj ℬ Y Z) X).isLimit).hom
      (CategoryTheory.Limits.BinaryFan.associatorOfLimitCone ℬ Y Z X).hom) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalOfChosenFiniteProducts.tensorHom ℬ
      (CategoryTheory.Limits.BinaryFan.braiding (ℬ X Y).isLimit (ℬ Y X).isLimit).hom
      (CategoryTheory.CategoryStruct.id Z))
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.BinaryFan.associatorOfLimitCone ℬ Y X Z).hom
      (CategoryTheory.MonoidalOfChosenFiniteProducts.tensorHom ℬ (CategoryTheory.CategoryStruct.id Y)
        (CategoryTheory.Limits.BinaryFan.braiding (ℬ X Z).isLimit (ℬ Z X).isLimit).hom))


theorem map_dlookup_eq_find (a : α) :
    ∀ l : List (Sigma β), (dlookup a l).map (Sigma.mk a) = find? (fun s => a = s.1) l

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

Option.map (Sigma.mk a) (List.dlookup a l) = List.find? (fun s => decide (a = s.fst)) l


@[simp]
theorem card_Ico : (Ico a b).card = b - a


theorem matrixOfPolynomials_blockTriangular {n : ℕ} (p : Fin n → R[X])
    (h_deg : ∀ i, (p i).natDegree ≤ i) :
    Matrix.BlockTriangular (Matrix.of (fun (i j : Fin n) => (p j).coeff i)) id

(h_deg : ∀ (i : Fin n), (p i).natDegree ≤ ↑i)

(Matrix.of fun i j => (p j).coeff ↑i).BlockTriangular id


theorem HasEigenvalue.mem_spectrum {f : End R M} {μ : R} (hμ : HasEigenvalue f μ) :
    μ ∈ spectrum R f

{R : Type v}
{M : Type w}
[CommRing R]
[AddCommGroup M]
[Module R M]
{f : Module.End R M}
{μ : R}
(hμ : f.HasEigenvalue μ)


theorem HasDerivAt.unique (h₀ : HasDerivAt f f₀' x) (h₁ : HasDerivAt f f₁' x) : f₀' = f₁'

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


theorem sbtw_irrefl_left {a b : α} : ¬sbtw a a b

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


theorem first_num_eq {gp : Pair K} (zeroth_s_eq : g.s.get? 0 = some gp) :
    g.nums 1 = gp.b * g.h + gp.a

{K : Type u_1}
{g : GenContFract K}
[DivisionRing K]
{gp : GenContFract.Pair K}
(zeroth_s_eq : g.s.get? 0 = some gp)


/-- A groupoid is closed under restriction if and only if it contains the trivial restriction-closed
groupoid. -/
theorem closedUnderRestriction_iff_id_le (G : StructureGroupoid H) :
    ClosedUnderRestriction G ↔ idRestrGroupoid ≤ G

{H : Type u}
[TopologicalSpace H]
(G : StructureGroupoid H)


@[simp]
theorem support_subtypeDomain [D : DecidablePred p] {f : α →₀ M} :
    (subtypeDomain p f).support = f.support.subtype p

{α : Type u_1}
{M : Type u_5}
[Zero M]
{p : α → Prop}
[D : DecidablePred p]
{f : α →₀ M}

(Finsupp.subtypeDomain p f).support = Finset.subtype p f.support


theorem coe_vanishingIdeal (t : Set (ProjectiveSpectrum 𝒜)) :
    (vanishingIdeal t : Set A) =
      { f | ∀ x : ProjectiveSpectrum 𝒜, x ∈ t → f ∈ x.asHomogeneousIdeal }

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[CommRing A]
[Algebra R A]
{𝒜 : ℕ → Submodule R A}
[GradedAlgebra 𝒜]
(t : Set (ProjectiveSpectrum 𝒜))

↑(ProjectiveSpectrum.vanishingIdeal t) = {f | ∀ x ∈ t, f ∈ x.asHomogeneousIdeal}


@[to_additive sum_nonpos]
theorem prod_le_one' (h : ∀ i ∈ s, f i ≤ 1) : ∏ i ∈ s, f i ≤ 1

{ι : Type u_1}
{N : Type u_5}
[OrderedCommMonoid N]
{f : ι → N}
{s : Finset ι}
(h : ∀ i ∈ s, f i ≤ 1)


theorem matrix_eq_sum_std_basis [Fintype m] [Fintype n] (x : Matrix m n α) :
    x = ∑ i : m, ∑ j : n, stdBasisMatrix i j (x i j)

{m : Type u_2}
{n : Type u_3}
{α : Type u_5}
[DecidableEq m]
[DecidableEq n]
[Semiring α]
[Fintype m]
[Fintype n]
(x : Matrix m n α)

x = ∑ i : m, ∑ j : n, Matrix.stdBasisMatrix i j (x i j)


@[simp]
theorem sigmaFinsuppEquivDFinsupp_support [DecidableEq ι] [Zero N]
    [∀ (i : ι) (x : η i →₀ N), Decidable (x ≠ 0)] (f : (Σi, η i) →₀ N) :
    (sigmaFinsuppEquivDFinsupp f).support = Finsupp.splitSupport f

[(i : ι) → (x : η i →₀ N) → Decidable (x ≠ 0)]

(sigmaFinsuppEquivDFinsupp f).support = f.splitSupport


@[simp]
theorem xInTermsOfW_zero [Invertible (p : R)] : xInTermsOfW p R 0 = X 0

(p : ℕ)
(R : Type u_1)
[CommRing R]
[Invertible ↑p]


theorem Ico_filter_le_of_left_le {a b c : α} [DecidablePred (c ≤ ·)] (hac : a ≤ c) :
    (Ico a b).filter (c ≤ ·) = Ico c b

{α : Type u_2}
[Preorder α]
[LocallyFiniteOrder α]
{a b c : α}
[DecidablePred fun x => c ≤ x]
(hac : a ≤ c)

Finset.filter (fun x => c ≤ x) (Finset.Ico a b) = Finset.Ico c b


/-- Shrinking lemma for coverings by open balls in a proper metric space. A point-finite open cover
of a proper metric space by open balls can be shrunk to a new cover by open balls so that each of
the new balls has strictly smaller radius than the old one. -/
theorem exists_iUnion_ball_eq_radius_lt {r : ι → ℝ} (uf : ∀ x, { i | x ∈ ball (c i) (r i) }.Finite)
    (uU : ⋃ i, ball (c i) (r i) = univ) :
    ∃ r' : ι → ℝ, ⋃ i, ball (c i) (r' i) = univ ∧ ∀ i, r' i < r i

(uf : ∀ (x : α), {i | x ∈ Metric.ball (c i) (r i)}.Finite)

(uU : ⋃ i, Metric.ball (c i) (r i) = Set.univ)

∃ r', ⋃ i, Metric.ball (c i) (r' i) = Set.univ ∧ ∀ (i : ι), r' i < r i


theorem setSeq_sub_aux (n : ℕ) : setSeq hf U_mem n ⊆ setSeqAux hf U_mem n

{α : Type u}
[uniformSpace : UniformSpace α]
{f : Filter α}
(hf : Cauchy f)
{U : ℕ → Set (α × α)}
(U_mem : ∀ (n : ℕ), U n ∈ 𝓤 α)
(n : ℕ)

SequentiallyComplete.setSeq hf U_mem n ⊆ ↑(SequentiallyComplete.setSeqAux hf U_mem n)


theorem mem_ball_symmetry {V : Set (β × β)} (hV : SymmetricRel V) {x y} :
    x ∈ ball y V ↔ y ∈ ball x V

{β : Type ub}
{V : Set (β × β)}
(hV : SymmetricRel V)
{x y : β}

x ∈ UniformSpace.ball y V ↔ y ∈ UniformSpace.ball x V


lemma RightHomologyData.exact_iff [S.HasHomology]
    (h : S.RightHomologyData) :
    S.Exact ↔ IsZero h.H

S.Exact ↔ CategoryTheory.Limits.IsZero h.H


lemma hurwitzZetaEven_eq (a : UnitAddCircle) (s : ℂ) :
    hurwitzZetaEven a s = (hurwitzZeta a s + hurwitzZeta (-a) s) / 2

HurwitzZeta.hurwitzZetaEven a s = (HurwitzZeta.hurwitzZeta a s + HurwitzZeta.hurwitzZeta (-a) s) / 2


/-- In a real inner product space, the complex exponential of minus the square of the norm plus
a scalar product is integrable. Useful when discussing the Fourier transform of a Gaussian. -/
theorem integrable_cexp_neg_mul_sq_norm_add (hb : 0 < b.re) (c : ℂ) (w : V) :
    Integrable (fun (v : V) ↦ cexp (-b * ‖v‖^2 + c * ⟪w, v⟫))

{b : ℂ}
{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[FiniteDimensional ℝ V]
[MeasurableSpace V]
[BorelSpace V]
(hb : 0 < b.re)
(c : ℂ)
(w : V)

MeasureTheory.Integrable (fun v => cexp (-b * ↑‖v‖ ^ 2 + c * ↑⟪w, v⟫_ℝ)) MeasureTheory.volume


theorem integral_coe_re_add_coe_im {f : X → 𝕜} (hf : Integrable f μ) :
    ∫ x, (re (f x) : 𝕜) ∂μ + (∫ x, (im (f x) : 𝕜) ∂μ) * RCLike.I = ∫ x, f x ∂μ

{X : Type u_1}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
{𝕜 : Type u_5}
[RCLike 𝕜]
{f : X → 𝕜}
(hf : MeasureTheory.Integrable f μ)

∫ (x : X), ↑(RCLike.re (f x)) ∂μ + (∫ (x : X), ↑(RCLike.im (f x)) ∂μ) * RCLike.I = ∫ (x : X), f x ∂μ


theorem tensorFunc_obj_map (Z : F C) {n n' : N C} (f : n ⟶ n') :
    ((tensorFunc C).obj Z).map f = inclusion.map f ▷ Z

(Z : CategoryTheory.FreeMonoidalCategory C)

{n n' : (CategoryTheory.Discrete ∘ CategoryTheory.FreeMonoidalCategory.NormalMonoidalObject) C}

((CategoryTheory.FreeMonoidalCategory.tensorFunc C).obj Z).map f =
  CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.FreeMonoidalCategory.inclusion.map f) Z


theorem isPrimitiveClassified_of_coprime (hc : Int.gcd x y = 1) : h.IsPrimitiveClassified

{x y z : ℤ}
(h : PythagoreanTriple x y z)
(hc : x.gcd y = 1)


protected lemma Antitone.sSup (hs : ∀ f ∈ s, Antitone f) : Antitone (sSup s)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[CompleteLattice β]
{s : Set (α → β)}
(hs : ∀ f ∈ s, Antitone f)


theorem nodup_permutations'Aux_iff {s : List α} {x : α} : Nodup (permutations'Aux x s) ↔ x ∉ s

(List.permutations'Aux x s).Nodup ↔ x ∉ s


/-- Given a multiset `s`, `s.toFinsupp` returns the finitely supported function on `ℕ` given by
the multiplicities of the elements of `s`. -/
@[simps symm_apply]
def toFinsupp : Multiset α ≃+ (α →₀ ℕ)

{α : Type u_1}
[DecidableEq α]
(f : α →₀ ℕ)

Multiset.toFinsupp.symm f = Finsupp.toMultiset f


theorem t_id (i : 𝒰.J) : t 𝒰 f g i i = 𝟙 _

[∀ (i : 𝒰.J), CategoryTheory.Limits.HasPullback (𝒰.map i ≫ f) g]

AlgebraicGeometry.Scheme.Pullback.t 𝒰 f g i i = 𝟙 (AlgebraicGeometry.Scheme.Pullback.v 𝒰 f g i i)


@[trans]
theorem lf_of_lf_of_lt {x y z : PGame} (h₁ : x ⧏ y) (h₂ : y < z) : x ⧏ z

{x y z : SetTheory.PGame}
(h₁ : x.LF y)
(h₂ : y < z)


theorem maximalIdeal_eq_span_p : maximalIdeal ℤ_[p] = Ideal.span {(p : ℤ_[p])}

LocalRing.maximalIdeal ℤ_[p] = Ideal.span {↑p}


@[simp]
theorem zsmul_modEq_zsmul [NoZeroSMulDivisors ℤ α] (hn : z ≠ 0) :
    z • a ≡ z • b [PMOD z • p] ↔ a ≡ b [PMOD p]

{α : Type u_1}
[AddCommGroup α]
{p a b : α}
{z : ℤ}
[NoZeroSMulDivisors ℤ α]
(hn : z ≠ 0)


lemma one_ne_zero' [One α] [NeZero (1 : α)] : (1 : α) ≠ 0

(α : Type u_2)
[Zero α]
[One α]
[NeZero 1]


theorem invFun_comp (hf : Injective f) : invFun f ∘ f = id

{α : Sort u_1}
{β : Sort u_2}
[Nonempty α]
{f : α → β}
(hf : Function.Injective f)


@[simp]
lemma divisors_eq_empty : divisors n = ∅ ↔ n = 0


@[reassoc]
lemma mapOpcyclesIso_inv_naturality [S₁.HasRightHomology] [S₂.HasRightHomology]
    [F.PreservesRightHomologyOf S₁] [F.PreservesRightHomologyOf S₂] :
    F.map (opcyclesMap φ) ≫ (S₂.mapOpcyclesIso F).inv =
      (S₁.mapOpcyclesIso F).inv ≫ opcyclesMap (F.mapShortComplex.map φ)

CategoryTheory.CategoryStruct.comp (F.map (CategoryTheory.ShortComplex.opcyclesMap φ)) (S₂.mapOpcyclesIso F).inv =
  CategoryTheory.CategoryStruct.comp (S₁.mapOpcyclesIso F).inv
    (CategoryTheory.ShortComplex.opcyclesMap (F.mapShortComplex.map φ))


theorem sin_add_mul_I (x y : ℂ) : sin (x + y * I) = sin x * cosh y + cos x * sinh y * I

Complex.sin (x + y * Complex.I) = Complex.sin x * Complex.cosh y + Complex.cos x * Complex.sinh y * Complex.I


theorem empty_ne_eq_nonempty (s : Set β) : (∅ ≠ s) = s.Nonempty


theorem inf_sdiff_assoc : (x ⊓ y) \ z = x ⊓ y \ z

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


theorem norm_setToSimpleFunc_le_sum_mul_norm (T : Set α → F →L[ℝ] F') {C : ℝ}
    (hT_norm : ∀ s, MeasurableSet s → ‖T s‖ ≤ C * (μ s).toReal) (f : α →ₛ F) :
    ‖f.setToSimpleFunc T‖ ≤ C * ∑ x ∈ f.range, (μ (f ⁻¹' {x})).toReal * ‖x‖

(hT_norm : ∀ (s : Set α), MeasurableSet s → ‖T s‖ ≤ C * (μ s).toReal)

‖MeasureTheory.SimpleFunc.setToSimpleFunc T f‖ ≤ C * ∑ x ∈ f.range, (μ (↑f ⁻¹' {x})).toReal * ‖x‖


theorem hasFiniteIntegral_prod_mk_left (a : α) {s : Set (β × γ)} (h2s : (κ ⊗ₖ η) a s ≠ ∞) :
    HasFiniteIntegral (fun b => (η (a, b) (Prod.mk b ⁻¹' s)).toReal) (κ a)

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

MeasureTheory.HasFiniteIntegral (fun b => ((η (a, b)) (Prod.mk b ⁻¹' s)).toReal) (κ a)


theorem LiftRel.mono (hr : ∀ a b, r₁ a b → r₂ a b) (hs : ∀ a b, s₁ a b → s₂ a b)
  (h : LiftRel r₁ s₁ x y) : LiftRel r₂ s₂ x y

∀ {α : Type u_1} {α_1 : Type u_2} {r₁ r₂ : α → α_1 → Prop} {β : Type u_3} {β_1 : Type u_4} {s₁ s₂ : β → β_1 → Prop}
  {x : α ⊕ β} {y : α_1 ⊕ β_1},
  (∀ (a : α) (b : α_1), r₁ a b → r₂ a b) →
    (∀ (a : β) (b : β_1), s₁ a b → s₂ a b) → Sum.LiftRel r₁ s₁ x y → Sum.LiftRel r₂ s₂ x y


theorem eq_bot_of_prime [h : I.IsPrime] : I = ⊥

{K : Type u}
[DivisionSemiring K]
(I : Ideal K)
[h : I.IsPrime]


@[simp]
theorem reflect_mul (f g : R[X]) {F G : ℕ} (Ff : f.natDegree ≤ F) (Gg : g.natDegree ≤ G) :
    reflect (F + G) (f * g) = reflect F f * reflect G g

{R : Type u_1}
[Semiring R]
(f g : Polynomial R)
{F G : ℕ}
(Ff : f.natDegree ≤ F)
(Gg : g.natDegree ≤ G)

Polynomial.reflect (F + G) (f * g) = Polynomial.reflect F f * Polynomial.reflect G g


lemma hasDerivAt_Gammaℝ_one : HasDerivAt Gammaℝ (-(γ + log (4 * π)) / 2) 1

HasDerivAt Complex.Gammaℝ (-(↑γ + Complex.log (4 * ↑Real.pi)) / 2) 1


/-- Given a subgroup `H` of a decidable linearly ordered archimedean abelian group `G`, if there
exists a minimal element `a` of `H ∩ G_{>0}` then `H` is generated by `a`. -/
theorem AddSubgroup.cyclic_of_min {H : AddSubgroup G} {a : G}
    (ha : IsLeast { g : G | g ∈ H ∧ 0 < g } a) : H = AddSubgroup.closure {a}

{G : Type u_1}
[LinearOrderedAddCommGroup G]
[Archimedean G]
{H : AddSubgroup G}
{a : G}
(ha : IsLeast {g | g ∈ H ∧ 0 < g} a)


@[to_additive]
theorem is_left_invariant_prehaar {K₀ : PositiveCompacts G} {U : Set G} (hU : (interior U).Nonempty)
    (g : G) (K : Compacts G) :
    prehaar (K₀ : Set G) U (K.map _ <| continuous_mul_left g) = prehaar (K₀ : Set G) U K

{K₀ : TopologicalSpace.PositiveCompacts G}

MeasureTheory.Measure.haar.addPrehaar (↑K₀) U (TopologicalSpace.Compacts.map (fun b => g + b) ⋯ K) =
  MeasureTheory.Measure.haar.addPrehaar (↑K₀) U K


theorem IsClosed.smul₀ {E : Type*} [Zero E] [MulActionWithZero G₀ E] [TopologicalSpace E]
    [T1Space E] [ContinuousConstSMul G₀ E] (c : G₀) {s : Set E} (hs : IsClosed s) :
    IsClosed (c • s)

{G₀ : Type u_4}
[GroupWithZero G₀]
{E : Type u_5}
[Zero E]
[MulActionWithZero G₀ E]
[TopologicalSpace E]
[T1Space E]
[ContinuousConstSMul G₀ E]
(c : G₀)
{s : Set E}
(hs : IsClosed s)


theorem summable_div_const_iff (h : a ≠ 0) : (Summable fun i ↦ f i / a) ↔ Summable f

{ι : Type u_1}
{α : Type u_4}
[DivisionSemiring α]
[TopologicalSpace α]
[TopologicalSemiring α]
{f : ι → α}
{a : α}
(h : a ≠ 0)

(Summable fun i => f i / a) ↔ Summable f


theorem tendsto_inv₀ {x : G₀} (hx : x ≠ 0) : Tendsto Inv.inv (𝓝 x) (𝓝 x⁻¹)

{G₀ : Type u_3}
[Zero G₀]
[Inv G₀]
[TopologicalSpace G₀]
[HasContinuousInv₀ G₀]
{x : G₀}
(hx : x ≠ 0)


@[simp] theorem piCurry_symm_apply {ι : Type*} {κ : ι → Type*} (α : ∀ i, κ i → Type*)
    [∀ i k, AddCommMonoid (α i k)] [∀ i k, Module R (α i k)]
    (f : ∀ a b, α a b) :
    (piCurry R α).symm f = Sigma.uncurry f

[(i : ι) → (k : κ i) → AddCommMonoid (α i k)]

[(i : ι) → (k : κ i) → Module R (α i k)]

(LinearEquiv.piCurry R α).symm f = Sigma.uncurry f


@[simp]
theorem eqToIso_refl {n : ℕ} (h : n = n) : X.eqToIso h = Iso.refl _

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(X : CategoryTheory.SimplicialObject C)
{n : ℕ}
(h : n = n)

X.eqToIso h = CategoryTheory.Iso.refl (X.obj (Opposite.op (SimplexCategory.mk n)))


protected theorem le_antisymm_iff {a b : Nat} : a = b ↔ a ≤ b ∧ b ≤ a


theorem isSymmetric_iff_isSelfAdjoint (A : E →ₗ[𝕜] E) : IsSymmetric A ↔ IsSelfAdjoint A

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


@[simp]
theorem singleton_subset_iff {s : Finset α} {a : α} : {a} ⊆ s ↔ a ∈ s


theorem dist_birkhoffAverage_birkhoffAverage_le (f : α → α) (g : α → E) (n : ℕ) (x y : α) :
    dist (birkhoffAverage 𝕜 f g n x) (birkhoffAverage 𝕜 f g n y) ≤
      (∑ k ∈ Finset.range n, dist (g (f^[k] x)) (g (f^[k] y))) / n

{α : Type u_1}
{E : Type u_2}
[NormedAddCommGroup E]
(𝕜 : Type u_3)
[RCLike 𝕜]
[Module 𝕜 E]
[BoundedSMul 𝕜 E]
(f : α → α)
(g : α → E)
(n : ℕ)
(x y : α)

dist (birkhoffAverage 𝕜 f g n x) (birkhoffAverage 𝕜 f g n y) ≤
  (∑ k ∈ Finset.range n, dist (g (f^[k] x)) (g (f^[k] y))) / ↑n


/-- The sheafification functor, as a functor taking values in `Sheaf`. -/
@[simps]
noncomputable def plusPlusSheaf : (Cᵒᵖ ⥤ D) ⥤ Sheaf J D

(J : CategoryTheory.GrothendieckTopology C)

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

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

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

[(X : C) → CategoryTheory.Limits.PreservesColimitsOfShape (J.Cover X)ᵒᵖ (CategoryTheory.forget D)]

∀ {X Y : CategoryTheory.Functor Cᵒᵖ D} (η : X ⟶ Y), ((CategoryTheory.plusPlusSheaf J D).map η).val = J.sheafifyMap η


theorem flip_bijective_iff₂ [FiniteDimensional K V₂] : Bijective B.flip ↔ Bijective B

{K : Type uK}
[Field K]
{V₁ : Type uV₁}
{V₂ : Type uV₂}
[AddCommGroup V₁]
[Module K V₁]
[AddCommGroup V₂]
[Module K V₂]
{B : V₁ →ₗ[K] V₂ →ₗ[K] K}
[FiniteDimensional K V₂]

Function.Bijective ⇑B.flip ↔ Function.Bijective ⇑B


@[to_additive]
theorem iUnion₂_div (s : ∀ i, κ i → Set α) (t : Set α) :
    (⋃ (i) (j), s i j) / t = ⋃ (i) (j), s i j / t

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

(⋃ i, ⋃ j, s i j) - t = ⋃ i, ⋃ j, s i j - t


lemma negMap_of_Z_eq_zero {P : Fin 3 → F} (hP : W.Nonsingular P) (hPz : P z = 0) :
    W.negMap ⟦P⟧ = ⟦![1, 1, 0]⟧

{F : Type v}
[Field F]
{W : WeierstrassCurve.Jacobian F}
{P : Fin 3 → F}
(hP : W.Nonsingular P)
(hPz : P z = 0)


theorem isMin_iterate_pred_of_eq_of_lt {n m : ℕ} (h_eq : pred^[n] a = pred^[m] a)
    (h_lt : n < m) : IsMin (pred^[n] a)

(h_eq : Order.pred^[n] a = Order.pred^[m] a)


theorem image_update_uIcc (f : ∀ i, α i) (i : ι) (a b : α i) :
    update f i '' uIcc a b = uIcc (update f i a) (update f i b)

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

Function.update f i '' Set.uIcc a b = Set.uIcc (Function.update f i a) (Function.update f i b)


/-- The mean value theorem on a convex set: if the derivative of a function is bounded by `C` on
`s`, then the function is `C`-Lipschitz on `s`. Version with `fderiv` and `LipschitzOnWith`. -/
theorem lipschitzOnWith_of_nnnorm_fderiv_le {C : ℝ≥0} (hf : ∀ x ∈ s, DifferentiableAt 𝕜 f x)
    (bound : ∀ x ∈ s, ‖fderiv 𝕜 f x‖₊ ≤ C) (hs : Convex ℝ s) : LipschitzOnWith C f s

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{𝕜 : Type u_3}
{G : Type u_4}
[RCLike 𝕜]
[NormedSpace 𝕜 E]
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{f : E → G}
{s : Set E}
{C : ℝ≥0}
(hf : ∀ x ∈ s, DifferentiableAt 𝕜 f x)
(bound : ∀ x ∈ s, ‖fderiv 𝕜 f x‖₊ ≤ C)
(hs : Convex ℝ s)


@[simps mul]
instance Mul.gMul [Add ι] [Mul R] : GradedMonoid.GMul fun _ : ι => R

(ι : Type u_1)
{R : Type u_2}
[Add ι]
[Mul R]

∀ {i j : ι} (x y : R), GradedMonoid.GMul.mul x y = x * y


@[to_additive (attr := simp)]
theorem comp_assoc (f : γ →*o δ) (g : β →*o γ) (h : α →*o β) :
    (f.comp g).comp h = f.comp (g.comp h)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
{δ : Type u_5}
[Preorder α]
[Preorder β]
[Preorder γ]
[Preorder δ]
[MulOneClass α]
[MulOneClass β]
[MulOneClass γ]
[MulOneClass δ]
(f : γ →*o δ)
(g : β →*o γ)
(h : α →*o β)


@[simp]
theorem Ico_pred_singleton {a : ℕ} (h : 0 < a) : Ico (a - 1) a = {a - 1}


/-- Tell `simp` what the entries are in a conjugate transposed matrix.

  Compare with `mul_apply`, `diagonal_apply_eq`, etc.
-/
@[simp]
theorem conjTranspose_apply [Star α] (M : Matrix m n α) (i j) :
    M.conjTranspose j i = star (M i j)

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[Star α]
(M : Matrix m n α)
(i : m)
(j : n)


@[simp]
theorem sign_permCongr (e : α ≃ β) (p : Perm α) : sign (e.permCongr p) = sign p

{α : Type u}
[DecidableEq α]
{β : Type v}
[Fintype α]
[DecidableEq β]
[Fintype β]
(e : α ≃ β)
(p : Equiv.Perm α)

Equiv.Perm.sign (e.permCongr p) = Equiv.Perm.sign p


/-- A functor `C ⥤ D ⥤ E` computably lowers to a functor
`ThinSkeleton C ⥤ ThinSkeleton D ⥤ ThinSkeleton E` -/
@[simps]
def map₂ (F : C ⥤ D ⥤ E) : ThinSkeleton C ⥤ ThinSkeleton D ⥤ ThinSkeleton E

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

∀ {X Y : CategoryTheory.ThinSkeleton C} (a : X ⟶ Y),
  (CategoryTheory.ThinSkeleton.map₂ F).map a = CategoryTheory.ThinSkeleton.map₂NatTrans F a


theorem sum_smul_mem {t : Finset ι} {f : ι → M} (r : ι → R) (hyp : ∀ c ∈ t, f c ∈ p) :
    (∑ i ∈ t, r i • f i) ∈ p

{R : Type u}
{M : Type v}
{ι : Type w}
[Semiring R]
[AddCommMonoid M]
{module_M : Module R M}
(p : Submodule R M)
{t : Finset ι}
{f : ι → M}
(r : ι → R)
(hyp : ∀ c ∈ t, f c ∈ p)


@[aesop apply safe (rule_sets := [CategoryTheory])]
theorem eq_inv_of_hom_inv_id {f : X ⟶ Y} [IsIso f] {g : Y ⟶ X} (hom_inv_id : f ≫ g = 𝟙 X) :
    g = inv f

(hom_inv_id : CategoryTheory.CategoryStruct.comp f g = CategoryTheory.CategoryStruct.id X)


@[to_additive (attr := simp)] lemma unop_inv [Inv α] (x : αᵐᵒᵖ) : unop x⁻¹ = (unop x)⁻¹

MulOpposite.unop x⁻¹ = (MulOpposite.unop x)⁻¹


/-- Defining a map into a subtype, this can be seen as a "coinduction principle" of `Subtype`-/
@[simps]
def coind {α β} (f : α → β) {p : β → Prop} (h : ∀ a, p (f a)) : α → Subtype p

{α : Sort u_4}
{β : Sort u_5}
(f : α → β)
{p : β → Prop}
(h : ∀ (a : α), p (f a))


theorem borel_eq_generateFrom_Iio : borel α = .generateFrom (range Iio)

(α : Type u_1)
[TopologicalSpace α]
[SecondCountableTopology α]
[LinearOrder α]
[OrderTopology α]

borel α = MeasurableSpace.generateFrom (Set.range Set.Iio)


@[simp]
theorem min_eq_top {s : Finset α} : s.min = ⊤ ↔ s = ∅

{α : Type u_2}
[LinearOrder α]
{s : Finset α}


theorem fderivWithin_star (hxs : UniqueDiffWithinAt 𝕜 s x) :
    fderivWithin 𝕜 (fun y => star (f y)) s x =
      ((starL' 𝕜 : F ≃L[𝕜] F) : F →L[𝕜] F) ∘L fderivWithin 𝕜 f s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[StarRing 𝕜]
[TrivialStar 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[StarAddMonoid F]
[NormedSpace 𝕜 F]
[StarModule 𝕜 F]
[ContinuousStar F]
{f : E → F}
{x : E}
{s : Set E}
(hxs : UniqueDiffWithinAt 𝕜 s x)

fderivWithin 𝕜 (fun y => star (f y)) s x = (↑(starL' 𝕜)).comp (fderivWithin 𝕜 f s x)


@[simp]
theorem extremePoints_singleton : ({x} : Set E).extremePoints 𝕜 = {x}

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
{x : E}


@[simp]
theorem lift_symm_apply (F : k[G] →ₐ[k] A) (x : Multiplicative G) :
    (lift k G A).symm F x = F (single (Multiplicative.toAdd x) 1)

{k : Type u₁}
{G : Type u₂}
[CommSemiring k]
[AddMonoid G]
{A : Type u₃}
[Semiring A]
[Algebra k A]
(F : AddMonoidAlgebra k G →ₐ[k] A)
(x : Multiplicative G)

((AddMonoidAlgebra.lift k G A).symm F) x = F (AddMonoidAlgebra.single (Multiplicative.toAdd x) 1)


@[simp]
theorem fderiv_ccosh (hc : DifferentiableAt ℂ f x) :
    fderiv ℂ (fun x => Complex.cosh (f x)) x = Complex.sinh (f x) • fderiv ℂ f x

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


@[fun_prop]
theorem Differentiable.restrictScalars (h : Differentiable 𝕜' f) : Differentiable 𝕜 f

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜' E]
[IsScalarTower 𝕜 𝕜' E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{f : E → F}
(h : Differentiable 𝕜' f)


@[simp]
theorem lcm_eq_zero_iff [GCDMonoid α] (a b : α) : lcm a b = 0 ↔ a = 0 ∨ b = 0

{α : Type u_1}
[CancelCommMonoidWithZero α]
[GCDMonoid α]
(a b : α)


theorem basis_restrict_iff' : (M ↾ R).Basis I X ↔ M.Basis I (X ∩ M.E) ∧ X ⊆ R

{α : Type u_1}
{M : Matroid α}
{R I X : Set α}

(M.restrict R).Basis I X ↔ M.Basis I (X ∩ M.E) ∧ X ⊆ R


@[simp]
theorem bind_up (a : α) (f : α → PLift β) : (PLift.up a).bind f = f a

{α : Sort u}
{β : Sort v}
(a : α)
(f : α → PLift β)


theorem cos_int_mul_two_pi_sub_pi (n : ℤ) : cos (n * (2 * π) - π) = -1

Complex.cos (↑n * (2 * ↑Real.pi) - ↑Real.pi) = -1


protected theorem SemanticallyEquivalent.not {φ ψ : L.BoundedFormula α n}
    (h : T.SemanticallyEquivalent φ ψ) : T.SemanticallyEquivalent φ.not ψ.not

{L : FirstOrder.Language}
{T : L.Theory}
{α : Type w}
{n : ℕ}
{φ ψ : L.BoundedFormula α n}
(h : T.SemanticallyEquivalent φ ψ)


@[simp]
theorem norm_map (x : E) : ‖f x‖ = ‖x‖

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
(f : E →ₛₗᵢ[σ₁₂] E₂)
(x : E)


theorem IsLeast.antichain_iff (hs : IsLeast s a) : IsAntichain (· ≤ ·) s ↔ s = {a}

{α : Type u_1}
{s : Set α}
{a : α}
[Preorder α]
(hs : IsLeast s a)

IsAntichain (fun x x_1 => x ≤ x_1) s ↔ s = {a}


/-- If a function and its derivative are integrable on `(-∞, a]`, then the function tends to zero
at `-∞`. -/
theorem tendsto_zero_of_hasDerivAt_of_integrableOn_Iic
    (hderiv : ∀ x ∈ Iic a, HasDerivAt f (f' x) x)
    (f'int : IntegrableOn f' (Iic a)) (fint : IntegrableOn f (Iic a)) :
    Tendsto f atBot (𝓝 0)

(hderiv : ∀ x ∈ Set.Iic a, HasDerivAt f (f' x) x)

(f'int : MeasureTheory.IntegrableOn f' (Set.Iic a) MeasureTheory.volume)

(fint : MeasureTheory.IntegrableOn f (Set.Iic a) MeasureTheory.volume)


theorem sum_incMatrix_apply_of_mem_edgeSet [Fintype α] :
    e ∈ G.edgeSet → ∑ a, G.incMatrix R a e = 2

{R : Type u_1}
{α : Type u_2}
(G : SimpleGraph α)
[NonAssocSemiring R]
{e : Sym2 α}
[Fintype α]

e ∈ G.edgeSet → ∑ a : α, SimpleGraph.incMatrix R G a e = 2


theorem nhdsSet_Ici : 𝓝ˢ (Ici a) = 𝓝 a ⊔ 𝓟 (Ioi a)

{α : Type u_1}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
{a : α}


/-- A homology data for a short complex `S` in the opposite category
induces a homology data for `S.unop`. -/
@[simps]
def unop {S : ShortComplex Cᵒᵖ} (h : S.HomologyData) : S.unop.HomologyData


lemma NonUnitalStarAlgebra.adjoin_le_starAlgebra_adjoin (s : Set A) :
    adjoin R s ≤ (StarAlgebra.adjoin R s).toNonUnitalStarSubalgebra

(R : Type u_1)
{A : Type u_2}
[CommSemiring R]
[StarRing R]
[Semiring A]
[StarRing A]
[Algebra R A]
[StarModule R A]
(s : Set A)

NonUnitalStarAlgebra.adjoin R s ≤ (StarAlgebra.adjoin R s).toNonUnitalStarSubalgebra


/-- The mates equivalence commutes with composition of squares of squares. These results form the
basis for an isomorphism of double categories to be proven later.
-/
theorem mateEquiv_square
    (α : G₁ ⋙ L₃ ⟶ L₁ ⋙ H₁) (β : H₁ ⋙ L₄ ⟶ L₂ ⋙ K₁)
    (γ : G₂ ⋙ L₅ ⟶ L₃ ⋙ H₂) (δ : H₂ ⋙ L₆ ⟶ L₄ ⋙ K₂) :
    (mateEquiv (G := G₁ ⋙ G₂) (H := K₁ ⋙ K₂) (adj₁.comp adj₂) (adj₅.comp adj₆))
        (leftAdjointSquare.comp α β γ δ) =
      rightAdjointSquare.comp
        (mateEquiv adj₁ adj₃ α) (mateEquiv adj₂ adj₄ β)
        (mateEquiv adj₃ adj₅ γ) (mateEquiv adj₄ adj₆ δ)

{A : Type u₁}
{B : Type u₂}
{C : Type u₃}
{D : Type u₄}
{E : Type u₅}
{F : Type u₆}
{X : Type u₇}
{Y : Type u₈}
{Z : Type u₉}
[CategoryTheory.Category.{v₁, u₁} A]
[CategoryTheory.Category.{v₂, u₂} B]
[CategoryTheory.Category.{v₃, u₃} C]
[CategoryTheory.Category.{v₄, u₄} D]
[CategoryTheory.Category.{v₅, u₅} E]
[CategoryTheory.Category.{v₆, u₆} F]
[CategoryTheory.Category.{v₇, u₇} X]
[CategoryTheory.Category.{v₈, u₈} Y]
[CategoryTheory.Category.{v₉, u₉} Z]
{G₁ : CategoryTheory.Functor A D}
{H₁ : CategoryTheory.Functor B E}
{K₁ : CategoryTheory.Functor C F}
{G₂ : CategoryTheory.Functor D X}
{H₂ : CategoryTheory.Functor E Y}
{K₂ : CategoryTheory.Functor F Z}
{L₁ : CategoryTheory.Functor A B}
{R₁ : CategoryTheory.Functor B A}
{L₂ : CategoryTheory.Functor B C}
{R₂ : CategoryTheory.Functor C B}
{L₃ : CategoryTheory.Functor D E}
{R₃ : CategoryTheory.Functor E D}
{L₄ : CategoryTheory.Functor E F}
{R₄ : CategoryTheory.Functor F E}
{L₅ : CategoryTheory.Functor X Y}
{R₅ : CategoryTheory.Functor Y X}
{L₆ : CategoryTheory.Functor Y Z}
{R₆ : CategoryTheory.Functor Z Y}
(adj₁ : L₁ ⊣ R₁)
(adj₂ : L₂ ⊣ R₂)
(adj₃ : L₃ ⊣ R₃)
(adj₄ : L₄ ⊣ R₄)
(adj₅ : L₅ ⊣ R₅)
(adj₆ : L₆ ⊣ R₆)
(α : G₁.comp L₃ ⟶ L₁.comp H₁)
(β : H₁.comp L₄ ⟶ L₂.comp K₁)
(γ : G₂.comp L₅ ⟶ L₃.comp H₂)
(δ : H₂.comp L₆ ⟶ L₄.comp K₂)

(CategoryTheory.mateEquiv (adj₁.comp adj₂) (adj₅.comp adj₆)) (CategoryTheory.leftAdjointSquare.comp α β γ δ) =
  CategoryTheory.rightAdjointSquare.comp ((CategoryTheory.mateEquiv adj₁ adj₃) α)
    ((CategoryTheory.mateEquiv adj₂ adj₄) β) ((CategoryTheory.mateEquiv adj₃ adj₅) γ)
    ((CategoryTheory.mateEquiv adj₄ adj₆) δ)


theorem biUnion_image [DecidableEq γ] {s : Finset α} {t : α → Finset β} {f : β → γ} :
    (s.biUnion t).image f = s.biUnion fun a => (t a).image f

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

Finset.image f (s.biUnion t) = s.biUnion fun a => Finset.image f (t a)


@[simp]
lemma pushforward_obj_map_apply (M : PresheafOfModules.{v} R) {X Y : Cᵒᵖ} (f : X ⟶ Y)
    (m : (ModuleCat.restrictScalars (φ.app X)).obj (M.obj (Opposite.op (F.obj X.unop)))) :
      ((pushforward φ).obj M).map f m = M.map (F.map f.unop).op m

(m : ↑((ModuleCat.restrictScalars (φ.app X)).obj (M.obj (Opposite.op (F.obj (Opposite.unop X))))))

(((PresheafOfModules.pushforward φ).obj M).map f) m = (M.map (F.map f.unop).op) m


theorem not_infinitePos_add_infiniteNeg {x y : ℝ*} :
    ¬InfinitePos x → InfiniteNeg y → InfiniteNeg (x + y)

¬x.InfinitePos → y.InfiniteNeg → (x + y).InfiniteNeg


theorem bind_congr {s1 s2 : WSeq α} {f1 f2 : α → WSeq β} (h1 : s1 ~ʷ s2) (h2 : ∀ a, f1 a ~ʷ f2 a) :
    bind s1 f1 ~ʷ bind s2 f2

{α : Type u}
{β : Type v}
{s1 s2 : Stream'.WSeq α}
{f1 f2 : α → Stream'.WSeq β}
(h1 : s1 ~ʷ s2)
(h2 : ∀ (a : α), f1 a ~ʷ f2 a)


/-- An open convex set is strictly convex. -/
protected theorem Convex.strictConvex_of_isOpen (h : IsOpen s) (hs : Convex 𝕜 s) :
    StrictConvex 𝕜 s

{𝕜 : Type u_1}
{E : Type u_3}
[OrderedSemiring 𝕜]
[TopologicalSpace E]
[AddCommMonoid E]
[Module 𝕜 E]
{s : Set E}
(h : IsOpen s)
(hs : Convex 𝕜 s)


@[deprecated toList_get_zero (since := "2024-05-08")]
theorem toList_nthLe_zero (h : x ∈ p.support) :
    (toList p x).nthLe 0 (length_toList_pos_of_mem_support _ _ h) = x

{α : Type u_1}
[Fintype α]
[DecidableEq α]
(p : Equiv.Perm α)
(x : α)
(h : x ∈ p.support)


theorem isMaxChain_range_flag (b : Basis (Fin n) K V) : IsMaxChain (· ≤ ·) (range b.flag)

{K : Type u_1}
{V : Type u_2}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
{n : ℕ}
(b : Basis (Fin n) K V)

IsMaxChain (fun x x_1 => x ≤ x_1) (Set.range b.flag)


theorem tendsto_atTop_add_nonneg_right (hf : Tendsto f l atTop) (hg : ∀ x, 0 ≤ g x) :
    Tendsto (fun x => f x + g x) l atTop

{α : Type u_3}
{β : Type u_4}
[OrderedAddCommMonoid β]
{l : Filter α}
{f g : α → β}
(hf : Filter.Tendsto f l Filter.atTop)
(hg : ∀ (x : α), 0 ≤ g x)

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


/-- A Mayer-Vietoris square in a category `C` equipped with a Grothendieck
topology consists of a commutative square `f₁₂ ≫ f₂₄ = f₁₃ ≫ f₃₄` in `C`
such that `f₁₃` is a monomorphism and that the square becomes a
pushout square in the category of sheaves of sets. -/
structure MayerVietorisSquare extends Square C where
  mono_f₁₃ : Mono toSquare.f₁₃ := by infer_instance
  /-- the square becomes a pushout square in the category of sheaves of types -/
  isPushout : (toSquare.map (yoneda ⋙ presheafToSheaf J _)).IsPushout

{J : CategoryTheory.GrothendieckTopology C}

[CategoryTheory.HasWeakSheafify J (Type v)]

(self.map (CategoryTheory.yoneda.comp (CategoryTheory.presheafToSheaf J (Type v)))).IsPushout


@[simp]
lemma sections_property {F : J ⥤ Type w} (s : (F.sections : Type _))
    {j j' : J} (f : j ⟶ j') : F.map f (s.val j) = s.val j'

{J : Type u}
[CategoryTheory.Category.{v, u} J]
{F : CategoryTheory.Functor J (Type w)}
(s : ↑F.sections)
{j j' : J}
(f : j ⟶ j')


theorem eval₂_eq (g : R →+* S₁) (X : σ → S₁) (f : MvPolynomial σ R) :
    f.eval₂ g X = ∑ d ∈ f.support, g (f.coeff d) * ∏ i ∈ d.support, X i ^ d i

{R : Type u}
{S₁ : Type v}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₁]
(g : R →+* S₁)
(X : σ → S₁)
(f : MvPolynomial σ R)

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


lemma conj_pow (u : Mˣ) (x : M) (n : ℕ) :
    ((↑u : M) * x * (↑u⁻¹ : M)) ^ n = (u : M) * x ^ n * (↑u⁻¹ : M)

{M : Type u_1}
[Monoid M]
(u : Mˣ)
(x : M)
(n : ℕ)


lemma le_nhds_iff_forall_dual_apply_le_nhds {l : Filter (E →WOT[𝕜] F)} {A : E →WOT[𝕜] F} :
    l ≤ 𝓝 A ↔ ∀ x (y : F⋆), l.map (fun T => y (T x)) ≤ 𝓝 (y (A x))

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[AddCommGroup E]
[TopologicalSpace E]
[Module 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{l : Filter (E →WOT[𝕜]F)}
{A : E →WOT[𝕜]F}

l ≤ 𝓝 A ↔ ∀ (x : E) (y : NormedSpace.Dual 𝕜 F), Filter.map (fun T => y (T x)) l ≤ 𝓝 (y (A x))


@[simp]
theorem toContinuousLinearEquivOfDetNeZero_apply (f : E →L[𝕜] E) (hf : f.det ≠ 0) (x : E) :
    f.toContinuousLinearEquivOfDetNeZero hf x = f x

{𝕜 : Type u}
[hnorm : NontriviallyNormedField 𝕜]
{E : Type v}
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousSMul 𝕜 E]
[CompleteSpace 𝕜]
[T2Space E]
[FiniteDimensional 𝕜 E]
(f : E →L[𝕜] E)
(hf : f.det ≠ 0)
(x : E)

(f.toContinuousLinearEquivOfDetNeZero hf) x = f x


@[simp]
theorem mem_range_self (v : V₁) : f v ∈ f.range

{V₁ : Type u_3}
{V₂ : Type u_4}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
(f : NormedAddGroupHom V₁ V₂)
(v : V₁)


@[simp]
theorem trans_toLinearEquiv (e₁ : M₁ ≃SL[σ₁₂] M₂) (e₂ : M₂ ≃SL[σ₂₃] M₃) :
    (e₁.trans e₂).toLinearEquiv = e₁.toLinearEquiv.trans e₂.toLinearEquiv

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

(e₁.trans e₂).toLinearEquiv = e₁.trans e₂.toLinearEquiv


@[simp]
theorem lift_self [PerfectRing L p] : lift i i p = RingHom.id L

{K : Type u_1}
{L : Type u_2}
[CommRing K]
[CommRing L]
(i : K →+* L)
(p : ℕ)
[ExpChar K p]
[ExpChar L p]
[IsPRadical i p]
[PerfectRing L p]


@[to_additive (attr := gcongr) add_lt_add_left]
theorem mul_lt_mul_left' [CovariantClass α α (· * ·) (· < ·)] {b c : α} (bc : b < c) (a : α) :
    a * b < a * c

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


/-- Functor composition induces a functor on cosimplicial objects. -/
@[simps!]
def whiskering (D : Type*) [Category D] : (C ⥤ D) ⥤ CosimplicialObject C ⥤ CosimplicialObject D

(C : Type u)
[CategoryTheory.Category.{v, u} C]
(D : Type u_1)
[CategoryTheory.Category.{u_2, u_1} D]
(H : C ⥤ D)

∀ {X Y : SimplexCategory ⥤ C} (α : X ⟶ Y) (X_1 : SimplexCategory),
  (((CategoryTheory.CosimplicialObject.whiskering C D).obj H).map α).app X_1 = H.map (α.app X_1)


theorem X_pow_eq_monomial (n) : X ^ n = monomial n (1 : R)

Polynomial.X ^ n = (Polynomial.monomial n) 1


@[simp] theorem utf8Len_reverse (cs) : utf8Len cs.reverse = utf8Len cs

String.utf8Len cs.reverse = String.utf8Len cs


@[to_additive (attr := simp)]
theorem map_bot (f : M →ₙ* N) : (⊥ : Subsemigroup M).map f = ⊥

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
(f : M →ₙ* N)


@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem singleton_nonempty (a : α) : ({a} : Finset α).Nonempty


@[simp]
theorem coe_piFinset (t : ∀ a, Finset (δ a)) :
    (piFinset t : Set (∀ a, δ a)) = Set.pi Set.univ fun a => t a

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{δ : α → Type u_3}
(t : (a : α) → Finset (δ a))

↑(Fintype.piFinset t) = Set.univ.pi fun a => ↑(t a)


theorem map_eq_bind {α β} (f : α → β) (l : List α) : map f l = l.bind fun x => [f x]

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(l : List α)


theorem map_mem_maximals (ha : a ∈ maximals r x) : f a ∈ maximals s (f '' x)

(hf : ∀ ⦃a a' : α⦄, a ∈ x → a' ∈ x → (r a a' ↔ s (f a) (f a')))


theorem isLocalHomeomorphOn_iff_openEmbedding_restrict {f : X → Y} :
    IsLocalHomeomorphOn f s ↔ ∀ x ∈ s, ∃ U ∈ 𝓝 x, OpenEmbedding (U.restrict f)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(s : Set X)
{f : X → Y}


theorem raised_cone_lowers_to_original [IsConnected J] {B : C} {F : J ⥤ Over B}
    (c : Cone (F ⋙ forget B)) :
    (forget B).mapCone (raiseCone c) = c

(c : CategoryTheory.Limits.Cone (F ⋙ CategoryTheory.Over.forget B))

(CategoryTheory.Over.forget B).mapCone (CategoryTheory.Over.CreatesConnected.raiseCone c) = c


theorem image_coe_closedBall (z : ℍ) (r : ℝ) :
    ((↑) : ℍ → ℂ) '' closedBall (α := ℍ) z r = closedBall ↑(z.center r) (z.im * Real.sinh r)

UpperHalfPlane.coe '' Metric.closedBall z r = Metric.closedBall (↑(z.center r)) (z.im * Real.sinh r)


/-- A collection of elements in an `AddCommGroup` designated as "non-negative".
This is useful for constructing an `OrderedAddCommGroup`
by choosing a positive cone in an existing `AddCommGroup`. -/
-- Porting note(#5171): @[nolint has_nonempty_instance]
structure PositiveCone (α : Type*) [AddCommGroup α] where
  /-- The characteristic predicate of a positive cone. `nonneg a` means that `0 ≤ a` according to
  the cone. -/
  nonneg : α → Prop
  /-- The characteristic predicate of a positive cone. `pos a` means that `0 < a` according to
  the cone. -/
  pos : α → Prop := fun a => nonneg a ∧ ¬nonneg (-a)
  pos_iff : ∀ a, pos a ↔ nonneg a ∧ ¬nonneg (-a) := by intros; rfl
  zero_nonneg : nonneg 0
  add_nonneg : ∀ {a b}, nonneg a → nonneg b → nonneg (a + b)
  nonneg_antisymm : ∀ {a}, nonneg a → nonneg (-a) → a = 0

{α : Type u_1}
[AddCommGroup α]
(self : AddCommGroup.PositiveCone α)
{a : α}

self.nonneg a → self.nonneg (-a) → a = 0


@[simp]
theorem prime_mk {p : α} : Prime (Associates.mk p) ↔ Prime p

{α : Type u_1}
[CommMonoidWithZero α]
{p : α}


lemma lintegral_preCDF_fst (ρ : Measure (α × ℝ)) (r : ℚ) [IsFiniteMeasure ρ] :
    ∫⁻ x, preCDF ρ r x ∂ρ.fst = ρ.IicSnd r univ

{α : Type u_1}
{mα : MeasurableSpace α}
(ρ : MeasureTheory.Measure (α × ℝ))
(r : ℚ)
[MeasureTheory.IsFiniteMeasure ρ]

∫⁻ (x : α), ProbabilityTheory.preCDF ρ r x ∂ρ.fst = (ρ.IicSnd ↑r) Set.univ


theorem SurjOn.inter (h₁ : SurjOn f s₁ t) (h₂ : SurjOn f s₂ t) (h : InjOn f (s₁ ∪ s₂)) :
    SurjOn f (s₁ ∩ s₂) t

{α : Type u_1}
{β : Type u_2}
{s₁ s₂ : Set α}
{t : Set β}
{f : α → β}
(h₁ : Set.SurjOn f s₁ t)
(h₂ : Set.SurjOn f s₂ t)
(h : Set.InjOn f (s₁ ∪ s₂))


@[to_additive]
theorem smul_iInter₂_subset (s : Set α) (t : ∀ i, κ i → Set β) :
    (s • ⋂ (i) (j), t i j) ⊆ ⋂ (i) (j), s • t i j

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

s +ᵥ ⋂ i, ⋂ j, t i j ⊆ ⋂ i, ⋂ j, s +ᵥ t i j


theorem isOpen_range (hf : IsOpenMap f) : IsOpen (range f)

{X : Type u_1}
{Y : Type u_2}
{f : X → Y}
[TopologicalSpace X]
[TopologicalSpace Y]
(hf : IsOpenMap f)


theorem affineSpan_parallel_iff_vectorSpan_eq_and_eq_empty_iff_eq_empty {s₁ s₂ : Set P} :
    affineSpan k s₁ ∥ affineSpan k s₂ ↔ vectorSpan k s₁ = vectorSpan k s₂ ∧ (s₁ = ∅ ↔ s₂ = ∅)

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s₁ s₂ : Set P}


theorem lcm_mul_left {m n k : ℕ} : (m * n).lcm (m * k) = m * n.lcm k


theorem right_lt_lineMap_iff_lt (h : r < 1) : b < lineMap a b r ↔ b < a

{k : Type u_1}
{E : Type u_2}
[OrderedRing k]
[OrderedAddCommGroup E]
[Module k E]
[OrderedSMul k E]
{a b : E}
{r : k}
(h : r < 1)


theorem connectedComponentIn_eq_empty {F : Set α} {x : α} (h : x ∉ F) :
    connectedComponentIn F x = ∅

{α : Type u}
[TopologicalSpace α]
{F : Set α}
{x : α}
(h : x ∉ F)


protected theorem compl_bot : (⊥ : LowerSet α).compl = ⊥


/-- The category of R-modules has cokernels, given by the projection onto the quotient. -/
theorem hasCokernels_moduleCat : HasCokernels (ModuleCat R)


@[simp]
lemma homMk₂_app_zero : (homMk₂ app₀ app₁ app₂ w₀ w₁).app 0 = app₀

{f g : CategoryTheory.ComposableArrows C 2}

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

(CategoryTheory.ComposableArrows.homMk₂ app₀ app₁ app₂ w₀ w₁).app 0 = app₀


protected theorem eq_bot_iff (p : Submodule R M) : p = ⊥ ↔ ∀ x ∈ p, x = (0 : M)

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


@[to_additive]
theorem mulIndicator_mul' (s : Set α) (f g : α → M) :
    mulIndicator s (f * g) = mulIndicator s f * mulIndicator s g

{α : Type u_1}
{M : Type u_4}
[AddZeroClass M]
(s : Set α)
(f g : α → M)

s.indicator (f + g) = s.indicator f + s.indicator g


@[simp]
theorem leComap_id_iff : LEComap (ContinuousMap.id X) A A' ↔ A ≤ A'

{X : Type u_2}
[TopologicalSpace X]
{A A' : DiscreteQuotient X}

DiscreteQuotient.LEComap (ContinuousMap.id X) A A' ↔ A ≤ A'


theorem epsilon_lt_pos (x : ℝ) : 0 < x → ε < x


theorem IsEulerian.card_odd_degree [Fintype V] [DecidableRel G.Adj] {u v : V} {p : G.Walk u v}
    (ht : p.IsEulerian) : Fintype.card { v : V | Odd (G.degree v) } = 0 ∨
      Fintype.card { v : V | Odd (G.degree v) } = 2

{V : Type u_1}
{G : SimpleGraph V}
[DecidableEq V]
[Fintype V]
[DecidableRel G.Adj]
{u v : V}
{p : G.Walk u v}
(ht : p.IsEulerian)

Fintype.card ↑{v | Odd (G.degree v)} = 0 ∨ Fintype.card ↑{v | Odd (G.degree v)} = 2


/-- In a Dedekind domain, the prime ideals are the zero ideal together with the prime elements
of the monoid with zero `Ideal A`. -/
theorem Ideal.isPrime_iff_bot_or_prime {P : Ideal A} : IsPrime P ↔ P = ⊥ ∨ Prime P

{A : Type u_2}
[CommRing A]
[IsDedekindDomain A]
{P : Ideal A}


lemma eq_of_measure_of_eq (g : StieltjesFunction) {y : ℝ}
    (hfg : f.measure = g.measure) (hy : f y = g y) :
    f = g

(f g : StieltjesFunction)
{y : ℝ}
(hfg : f.measure = g.measure)
(hy : ↑f y = ↑g y)


@[simp] theorem col_inj [Nonempty ι] {v w : m → α} : col ι v = col ι w ↔ v = w

{m : Type u_2}
{α : Type v}
{ι : Type u_6}
[Nonempty ι]
{v w : m → α}


/-- If `dist (f n) (f (n+1))` is bounded by `(C / 2) / 2^n`, then `f` is a Cauchy sequence. -/
theorem cauchySeq_of_le_geometric_two : CauchySeq f


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

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

(AlgebraicTopology.DoldKan.MorphComponents.id X n).b i = X.σ i


@[simp]
theorem natTrailingDegree_zero : natTrailingDegree (0 : R[X]) = 0


@[simp]
theorem neLocus_sub_right : neLocus (f₁ - g) (f₂ - g) = neLocus f₁ f₂

{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → AddGroup (N a)]
(f₁ f₂ g : Π₀ (a : α), N a)

(f₁ - g).neLocus (f₂ - g) = f₁.neLocus f₂


theorem compactSpace_iff_isBounded_univ [ProperSpace α] :
    CompactSpace α ↔ IsBounded (univ : Set α)

{α : Type u}
[PseudoMetricSpace α]
[ProperSpace α]

CompactSpace α ↔ Bornology.IsBounded Set.univ


theorem Indep.of_restriction (hI : N.Indep I) (hNM : N ≤r M) : M.Indep I

{α : Type u_1}
{M : Matroid α}
{I : Set α}
{N : Matroid α}
(hI : N.Indep I)
(hNM : N.Restriction M)


lemma reverse_injective : Function.Injective (reverse : Language α → _)


@[simp] lemma isSublattice_latticeClosure : IsSublattice (latticeClosure s)


@[simp]
theorem norm_equiv_symm_fst (x : α) : ‖(WithLp.equiv p (α × β)).symm (x, 0)‖ = ‖x‖

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


theorem mem_cthickening_of_edist_le (x y : α) (δ : ℝ) (E : Set α) (h : y ∈ E)
    (h' : edist x y ≤ ENNReal.ofReal δ) : x ∈ cthickening δ E

{α : Type u}
[PseudoEMetricSpace α]
(x y : α)
(δ : ℝ)
(E : Set α)
(h : y ∈ E)
(h' : edist x y ≤ ENNReal.ofReal δ)


@[to_additive eq_sub_of_add_eq]
theorem eq_div_of_mul_eq' (h : a * c = b) : a = b / c

{G : Type u_3}
[Group G]
{a b c : G}
(h : a * c = b)


theorem Bijective.sum_map {f : α → β} {g : α' → β'} (hf : Bijective f) (hg : Bijective g) :
    Bijective (Sum.map f g)

{α : Type u}
{α' : Type w}
{β : Type v}
{β' : Type x}
{f : α → β}
{g : α' → β'}
(hf : Function.Bijective f)
(hg : Function.Bijective g)


lemma le_self_pow (hn : n ≠ 0) : ∀ a : ℕ, a ≤ a ^ n


theorem comap_comap (g : F →ₗ[𝕜] G) (f : E →ₗ[𝕜] F) (S : ConvexCone 𝕜 G) :
    (S.comap g).comap f = S.comap (g.comp f)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
{G : Type u_4}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[AddCommMonoid F]
[AddCommMonoid G]
[Module 𝕜 E]
[Module 𝕜 F]
[Module 𝕜 G]
(g : F →ₗ[𝕜] G)
(f : E →ₗ[𝕜] F)
(S : ConvexCone 𝕜 G)

ConvexCone.comap f (ConvexCone.comap g S) = ConvexCone.comap (g ∘ₗ f) S


lemma l2_opNNNorm_mulVec (A : Matrix m n 𝕜) (x : EuclideanSpace 𝕜 n) :
    ‖(EuclideanSpace.equiv m 𝕜).symm <| A *ᵥ x‖₊ ≤ ‖A‖₊ * ‖x‖₊

{𝕜 : Type u_1}
{m : Type u_2}
{n : Type u_3}
[RCLike 𝕜]
[Fintype m]
[Fintype n]
[DecidableEq n]
(A : Matrix m n 𝕜)
(x : EuclideanSpace 𝕜 n)

‖(EuclideanSpace.equiv m 𝕜).symm (A *ᵥ x)‖₊ ≤ ‖A‖₊ * ‖x‖₊


/-- The fixed point lemma for normal functions: any normal function has an unbounded set of
fixed points. -/
theorem fp_unbounded (H : IsNormal f) : (Function.fixedPoints f).Unbounded (· < ·)

{f : Ordinal.{u} → Ordinal.{u}}
(H : Ordinal.IsNormal f)

Set.Unbounded (fun x x_1 => x < x_1) (Function.fixedPoints f)


/-- Note that this is not true for `Fintype.card n = 1` since `1 - 2 = 0` and not `-1`. -/
theorem adjugate_adjugate (A : Matrix n n α) (h : Fintype.card n ≠ 1) :
    adjugate (adjugate A) = det A ^ (Fintype.card n - 2) • A

{n : Type v}
{α : Type w}
[DecidableEq n]
[Fintype n]
[CommRing α]
(A : Matrix n n α)
(h : Fintype.card n ≠ 1)

A.adjugate.adjugate = A.det ^ (Fintype.card n - 2) • A


/-- For natural numbers the filters `Filter.cofinite` and `Filter.atTop` coincide. -/
theorem Nat.cofinite_eq_atTop : @cofinite ℕ = atTop


theorem norm_toSimpleFunc [Fact (1 ≤ p)] (f : Lp.simpleFunc E p μ) :
    ‖f‖ = ENNReal.toReal (eLpNorm (toSimpleFunc f) p μ)

(f : ↥(MeasureTheory.Lp.simpleFunc E p μ))

‖f‖ = (MeasureTheory.eLpNorm (↑(MeasureTheory.Lp.simpleFunc.toSimpleFunc f)) p μ).toReal


@[ext]
theorem linearMap_ext {M : Type*} [AddCommMonoid M] [Module R M] {f g : MvPolynomial σ R →ₗ[R] M}
    (h : ∀ s, f ∘ₗ monomial s = g ∘ₗ monomial s) : f = g

(h : ∀ (s : σ →₀ ℕ), f ∘ₗ MvPolynomial.monomial s = g ∘ₗ MvPolynomial.monomial s)


@[simp]
theorem finSuccEquiv_symm_none : (finSuccEquiv n).symm none = 0


@[to_additive (attr := simp)]
theorem nonempty_inv : s⁻¹.Nonempty ↔ s.Nonempty

{α : Type u_2}
[InvolutiveNeg α]
{s : Set α}


/-- The inclusion map `ℍ → ℂ` is a smooth map of manifolds. -/
theorem smooth_coe : Smooth 𝓘(ℂ) 𝓘(ℂ) ((↑) : ℍ → ℂ)

Smooth 𝓘(ℂ, ℂ) 𝓘(ℂ, ℂ) UpperHalfPlane.coe


@[simp] lemma toScott_symm_eq : (@toScott α).symm = ofScott


/-- A `Ctop α σ` is a realization of a topology (basis) on `α`,
  represented by a type `σ` together with operations for the top element and
  the intersection operation. -/
structure Ctop (α σ : Type*) where
  f : σ → Set α
  top : α → σ
  top_mem : ∀ x : α, x ∈ f (top x)
  inter : ∀ (a b) (x : α), x ∈ f a ∩ f b → σ
  inter_mem : ∀ a b x h, x ∈ f (inter a b x h)
  inter_sub : ∀ a b x h, f (inter a b x h) ⊆ f a ∩ f b

{α : Type u_1}
{σ : Type u_2}
(self : Ctop α σ)
(x : α)


theorem le_min' (x) (H2 : ∀ y ∈ s, x ≤ y) : x ≤ s.min' H

{α : Type u_2}
[LinearOrder α]
(s : Finset α)
(H : s.Nonempty)
(x : α)
(H2 : ∀ y ∈ s, x ≤ y)


theorem bounds_bddBelow (k n : ℕ) (f : 𝓢(E, F)) :
    BddBelow { c | 0 ≤ c ∧ ∀ x, ‖x‖ ^ k * ‖iteratedFDeriv ℝ n f x‖ ≤ c }

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

BddBelow {c | 0 ≤ c ∧ ∀ (x : E), ‖x‖ ^ k * ‖iteratedFDeriv ℝ n (⇑f) x‖ ≤ c}


/-- This lemma corresponds to one of the coherence laws for duals in rigid categories, see
  `CategoryTheory.Monoidal.Rigid`. -/
theorem contractLeft_assoc_coevaluation' :
    (contractLeft K V).lTensor _ ∘ₗ
        (TensorProduct.assoc K _ _ _).toLinearMap ∘ₗ (coevaluation K V).rTensor V =
      (TensorProduct.rid K _).symm.toLinearMap ∘ₗ (TensorProduct.lid K _).toLinearMap

(K : Type u)
[Field K]
(V : Type v)
[AddCommGroup V]
[Module K V]
[FiniteDimensional K V]

LinearMap.lTensor V (contractLeft K V) ∘ₗ
    ↑(TensorProduct.assoc K V (Module.Dual K V) V) ∘ₗ LinearMap.rTensor V (coevaluation K V) =
  ↑(TensorProduct.rid K V).symm ∘ₗ ↑(TensorProduct.lid K V)


@[to_additive]
theorem measurePreserving_mul_right_inv (μ : Measure G) [IsInvInvariant μ] [IsMulLeftInvariant μ]
    (g : G) : MeasurePreserving (fun t => (g * t)⁻¹) μ μ

{G : Type u_2}
[MeasurableSpace G]
[SubtractionMonoid G]
[MeasurableAdd G]
[MeasurableNeg G]
(μ : MeasureTheory.Measure G)
[μ.IsNegInvariant]
[μ.IsAddLeftInvariant]
(g : G)

MeasureTheory.MeasurePreserving (fun t => -(g + t)) μ μ


@[to_additive]
theorem mul_eq_one_iff_eq_inv : a * b = 1 ↔ a = b⁻¹


/-- Given two complementary subspaces `p` and `q` in `E`, if the complement of `{0}`
is path connected in `p` then the complement of `q` is path connected in `E`. -/
theorem isPathConnected_compl_of_isPathConnected_compl_zero [ContinuousSMul ℝ E]
    {p q : Submodule ℝ E} (hpq : IsCompl p q) (hpc : IsPathConnected ({0}ᶜ : Set p)) :
    IsPathConnected (qᶜ : Set E)

{E : Type u_4}
[AddCommGroup E]
[Module ℝ E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousSMul ℝ E]
{p q : Submodule ℝ E}
(hpq : IsCompl p q)
(hpc : IsPathConnected {0}ᶜ)


/-- For any `n ≠ 0`, we have the identity
`(stirlingSeq n)^4 / (stirlingSeq (2*n))^2 * (n / (2 * n + 1)) = W n`, where `W n` is the
`n`-th partial product of Wallis' formula for `π / 2`. -/
theorem stirlingSeq_pow_four_div_stirlingSeq_pow_two_eq (n : ℕ) (hn : n ≠ 0) :
    stirlingSeq n ^ 4 / stirlingSeq (2 * n) ^ 2 * (n / (2 * n + 1)) = Wallis.W n

Stirling.stirlingSeq n ^ 4 / Stirling.stirlingSeq (2 * n) ^ 2 * (↑n / (2 * ↑n + 1)) = Real.Wallis.W n


theorem testBit_implies_ge {x : Nat} (p : testBit x i = true) : x ≥ 2^i


@[simp]
theorem inv_inv_app {F G : C ⥤ D} (e : F ≅ G) (X : C) : inv (e.inv.app X) = e.hom.app X

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F G : C ⥤ D}
(e : F ≅ G)
(X : C)

CategoryTheory.inv (e.inv.app X) = e.hom.app X


lemma Module.finitePresentation_of_free_of_surjective [Module.Free R M] [Module.Finite R M]
    (l : M →ₗ[R] N)
    (hl : Function.Surjective l) (hl' : (LinearMap.ker l).FG) :
    Module.FinitePresentation R N

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[Ring R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
[Module.Free R M]
[Module.Finite R M]
(l : M →ₗ[R] N)
(hl : Function.Surjective ⇑l)
(hl' : (LinearMap.ker l).FG)


theorem AntivaryOn.comp_antitone_on_left (h : AntivaryOn f g s) (hf : Antitone f') :
    MonovaryOn (f' ∘ f) g s

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Preorder α]
[Preorder β]
[Preorder γ]
{f : ι → α}
{f' : α → γ}
{g : ι → β}
{s : Set ι}
(h : AntivaryOn f g s)
(hf : Antitone f')