theorem mul_toPEquiv_toMatrix {m n α : Type*} [Fintype n] [DecidableEq n] [Semiring α] (f : n ≃ n)
    (M : Matrix m n α) : M * f.toPEquiv.toMatrix = M.submatrix id f.symm

{m : Type u_5}
{n : Type u_6}
{α : Type u_7}
[Fintype n]
[DecidableEq n]
[Semiring α]
(f : n ≃ n)
(M : Matrix m n α)

M * f.toPEquiv.toMatrix = M.submatrix id ⇑f.symm


@[simp]
theorem toIcoMod_sub (a b : α) : toIcoMod hp a (b - p) = toIcoMod hp a b

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


theorem AddCommMonoidWithOne.toAddMonoidWithOne_injective :
    Function.Injective (@AddCommMonoidWithOne.toAddMonoidWithOne R)


theorem MapsTo.range_restrict (f : α → β) (s : Set α) (t : Set β) (h : MapsTo f s t) :
    range (h.restrict f s t) = Subtype.val ⁻¹' (f '' s)

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

Set.range (Set.MapsTo.restrict f s t h) = Subtype.val ⁻¹' (f '' s)


theorem pairwise_iff_coe_toFinset_pairwise (hn : l.Nodup) (hs : Symmetric r) :
    (l.toFinset : Set α).Pairwise r ↔ l.Pairwise r

{α : Type u_1}
[DecidableEq α]
{r : α → α → Prop}
{l : List α}
(hn : l.Nodup)
(hs : Symmetric r)

(↑l.toFinset).Pairwise r ↔ List.Pairwise r l


/-- Auxiliary definition for `functorCategoryEquivalence`. -/
@[simps]
def inverse : (SingleObj G ⥤ V) ⥤ Action V G

{V : Type (u + 1)}
[CategoryTheory.LargeCategory V]
{G : MonCat}
(F : CategoryTheory.SingleObj ↑G ⥤ V)

(Action.FunctorCategoryEquivalence.inverse.obj F).V = F.obj PUnit.unit


@[to_additive]
theorem length (h : Red L₁ L₂) : ∃ n, L₁.length = L₂.length + 2 * n

{α : Type u}
{L₁ L₂ : List (α × Bool)}
(h : FreeGroup.Red L₁ L₂)


@[simp]
theorem toSet_of_ZFSet (A : Class.{u}) (x : ZFSet.{u}) : ToSet A x ↔ A x


/-- An iso `α ≃* β` can equivalently be viewed as an iso `αᵐᵒᵖ ≃* βᵐᵒᵖ`. -/
@[to_additive (attr := simps)
  "An iso `α ≃+ β` can equivalently be viewed as an iso `αᵃᵒᵖ ≃+ βᵃᵒᵖ`."]
def MulEquiv.op {α β} [Mul α] [Mul β] : α ≃* β ≃ (αᵐᵒᵖ ≃* βᵐᵒᵖ)

{α : Type u_2}
{β : Type u_3}
[Mul α]
[Mul β]
(f : α ≃* β)

∀ (a : βᵐᵒᵖ), (MulEquiv.op f).symm a = (MulOpposite.op ∘ ⇑f.symm ∘ MulOpposite.unop) a


theorem IsCompact.tendsto_subseq' {s : Set X} {x : ℕ → X} (hs : IsCompact s)
    (hx : ∃ᶠ n in atTop, x n ∈ s) :
    ∃ a ∈ s, ∃ φ : ℕ → ℕ, StrictMono φ ∧ Tendsto (x ∘ φ) atTop (𝓝 a)

(hx : ∃ᶠ (n : ℕ) in Filter.atTop, x n ∈ s)

∃ a ∈ s, ∃ φ, StrictMono φ ∧ Filter.Tendsto (x ∘ φ) Filter.atTop (𝓝 a)


@[to_additive (attr := simp)]
theorem mulEquivOfQuotient_symm_monoidOf (x) :
    (mulEquivOfQuotient f).symm (f.toMap x) = (monoidOf S).toMap x

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
{f : S.LocalizationMap N}
(x : M)

(AddLocalization.addEquivOfQuotient f).symm (f.toMap x) = (AddLocalization.addMonoidOf S).toMap x


theorem biInter_union (s t : Set α) (u : α → Set β) :
    ⋂ x ∈ s ∪ t, u x = (⋂ x ∈ s, u x) ∩ ⋂ x ∈ t, u x

{α : Type u_1}
{β : Type u_2}
(s t : Set α)
(u : α → Set β)


theorem sdiff_sdiff_left : (a \ b) \ c = a \ (b ⊔ c)

{α : Type u_2}
[GeneralizedCoheytingAlgebra α]
{a b c : α}


theorem eq_unit_mul_pow_irreducible {x : R} (hx : x ≠ 0) {ϖ : R} (hirr : Irreducible ϖ) :
    ∃ (n : ℕ) (u : Rˣ), x = u * ϖ ^ n

{R : Type u_1}
[CommRing R]
[IsDomain R]
[DiscreteValuationRing R]
{x : R}
(hx : x ≠ 0)
{ϖ : R}
(hirr : Irreducible ϖ)


theorem Separable.of_pow {f : R[X]} (hf : ¬IsUnit f) {n : ℕ} (hn : n ≠ 0)
    (hfs : (f ^ n).Separable) : f.Separable ∧ n = 1

{R : Type u}
[CommSemiring R]
{f : R[X]}
(hf : ¬IsUnit f)
{n : ℕ}
(hn : n ≠ 0)
(hfs : (f ^ n).Separable)


theorem Decidable.not_or_of_imp [Decidable a] (h : a → b) : ¬a ∨ b


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


lemma nndist_pi_lt_iff {f g : ∀ b, π b} {r : ℝ≥0} (hr : 0 < r) :
    nndist f g < r ↔ ∀ b, nndist (f b) (g b) < r

{β : Type u_2}
{π : β → Type u_3}
[Fintype β]
[(b : β) → PseudoMetricSpace (π b)]
{f g : (b : β) → π b}
{r : ℝ≥0}
(hr : 0 < r)

nndist f g < r ↔ ∀ (b : β), nndist (f b) (g b) < r


@[ext] theorem ext ⦃inst₁ inst₂ : NonAssocSemiring R⦄
    (h_add : local_hAdd[R, inst₁] = local_hAdd[R, inst₂])
    (h_mul : local_hMul[R, inst₁] = local_hMul[R, inst₂]) :
    inst₁ = inst₂

{R : Type u}
⦃inst₁ inst₂ : NonAssocSemiring R⦄
(h_add : HAdd.hAdd = HAdd.hAdd)
(h_mul : HMul.hMul = HMul.hMul)


/-- A topology on `X`. -/
@[to_additive existing TopologicalSpace]
class TopologicalSpace (X : Type u) where
  /-- A predicate saying that a set is an open set. Use `IsOpen` in the root namespace instead. -/
  protected IsOpen : Set X → Prop
  /-- The set representing the whole space is an open set.
  Use `isOpen_univ` in the root namespace instead. -/
  protected isOpen_univ : IsOpen univ
  /-- The intersection of two open sets is an open set. Use `IsOpen.inter` instead. -/
  protected isOpen_inter : ∀ s t, IsOpen s → IsOpen t → IsOpen (s ∩ t)
  /-- The union of a family of open sets is an open set.
  Use `isOpen_sUnion` in the root namespace instead. -/
  protected isOpen_sUnion : ∀ s, (∀ t ∈ s, IsOpen t) → IsOpen (⋃₀ s)

{X : Type u}
[self : TopologicalSpace X]
(s : Set (Set X))

(∀ (t : Set X), t ∈ s → TopologicalSpace.IsOpen t) → TopologicalSpace.IsOpen (⋃₀ s)


/-- The `Γ` function (of a complex variable `s`). -/
@[pp_nodot]
irreducible_def Gamma (s : ℂ) : ℂ

Complex.Gamma s = Complex.GammaAux ⌊1 - s.re⌋₊ s


protected theorem isTrichotomous : ∀ (_ : r ↪r s) [IsTrichotomous β s], IsTrichotomous α r

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

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


/-- The second projection in a product is `C^∞`. -/
theorem contDiff_snd : ContDiff 𝕜 n (Prod.snd : E × F → F)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}


/-- If an invariant measure is inner regular, then it gives less mass to sets with compact closure
than any other invariant measure, up to the scalar `haarScalarFactor μ' μ`.

Auxiliary lemma in the proof of the more general
`measure_isMulInvariant_eq_smul_of_isCompact_closure`, which gives equality for any
set with compact closure. -/
@[to_additive smul_measure_isAddInvariant_le_of_isCompact_closure
"If an invariant measure is inner regular, then it gives less mass to sets with compact closure
than any other invariant measure, up to the scalar `addHaarScalarFactor μ' μ`.

Auxiliary lemma in the proof of the more general
`measure_isAddInvariant_eq_smul_of_isCompact_closure`, which gives equality for any
set with compact closure."]
lemma smul_measure_isMulInvariant_le_of_isCompact_closure [LocallyCompactSpace G]
    (μ' μ : Measure G) [IsHaarMeasure μ] [IsFiniteMeasureOnCompacts μ'] [IsMulLeftInvariant μ']
    [InnerRegularCompactLTTop μ]
    {s : Set G} (hs : MeasurableSet s) (h's : IsCompact (closure s)) :
    haarScalarFactor μ' μ • μ s ≤ μ' s


@[simp, mfld_simps]
theorem id_comp (f : α → β) : id ∘ f = f


theorem one_eq_hSpace_e {G : Type u} [TopologicalSpace G] [Group G] [TopologicalGroup G] :
    (1 : G) = HSpace.e


theorem FractionalIdeal.adjoinIntegral_eq_one_of_isUnit [Algebra A K] [IsFractionRing A K] (x : K)
    (hx : IsIntegral A x) (hI : IsUnit (adjoinIntegral A⁰ x hx)) : adjoinIntegral A⁰ x hx = 1

(hI : IsUnit (FractionalIdeal.adjoinIntegral A⁰ x hx))

FractionalIdeal.adjoinIntegral A⁰ x hx = 1


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


theorem tendsto_atBot_mono' [Preorder β] (l : Filter α) ⦃f₁ f₂ : α → β⦄ (h : f₁ ≤ᶠ[l] f₂) :
    Tendsto f₂ l atBot → Tendsto f₁ l atBot

{α : Type u_3}
{β : Type u_4}
[Preorder β]
(l : Filter α)
⦃f₁ f₂ : α → β⦄
(h : f₁ ≤ᶠ[l] f₂)

Filter.Tendsto f₂ l Filter.atBot → Filter.Tendsto f₁ l Filter.atBot


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

[MeasureTheory.VAddInvariantMeasure G α μ]

(h : MeasureTheory.IsAddFundamentalDomain G s μ)

MeasureTheory.NullMeasurableSet (g +ᵥ s) μ


/-- A preadditive category has a cokernel for `f - g` if it has a coequalizer for `f` and `g`. -/
theorem hasCokernel_of_hasCoequalizer [HasCoequalizer f g] : HasCokernel (f - g)

CategoryTheory.Limits.HasCokernel (f - g)


protected theorem comp_traverse {α β γ} (f : β → F γ) (g : α → G β) (x : List α) :
    List.traverse (Comp.mk ∘ (f <$> ·) ∘ g) x =
    Comp.mk (List.traverse f <$> List.traverse g x)

{F G : Type u → Type u}
[Applicative F]
[Applicative G]
[LawfulApplicative G]
{α : Type u_1}
{β γ : Type u}
(f : β → F γ)
(g : α → G β)
(x : List α)

List.traverse (Functor.Comp.mk ∘ (fun x => f <$> x) ∘ g) x = Functor.Comp.mk (List.traverse f <$> List.traverse g x)


@[simp]
theorem inverseAssociator_map_inl {X Y : C} (f : inl X ⟶ inl Y) :
    (inverseAssociator C D E).map f = f

(C : Type u)
[CategoryTheory.Category.{v, u} C]
(D : Type u)
[CategoryTheory.Category.{v, u} D]
(E : Type u)
[CategoryTheory.Category.{v, u} E]
{X Y : C}
(f : Sum.inl X ⟶ Sum.inl Y)

(CategoryTheory.sum.inverseAssociator C D E).map f = f


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


@[simp]
theorem range_basisSingleton (ι : Type*) [Unique ι] (h : finrank K V = 1) (v : V) (hv : v ≠ 0) :
    Set.range (basisSingleton ι h v hv) = {v}

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
(ι : Type u_1)
[Unique ι]
(h : FiniteDimensional.finrank K V = 1)
(v : V)
(hv : v ≠ 0)

Set.range ⇑(FiniteDimensional.basisSingleton ι h v hv) = {v}


theorem _root_.Function.HasTemperateGrowth.norm_iteratedFDeriv_le_uniform_aux {f : E → F}
    (hf_temperate : f.HasTemperateGrowth) (n : ℕ) :
    ∃ (k : ℕ) (C : ℝ), 0 ≤ C ∧ ∀ N ≤ n, ∀ x : E, ‖iteratedFDeriv ℝ N f x‖ ≤ C * (1 + ‖x‖) ^ k

(hf_temperate : Function.HasTemperateGrowth f)

∃ k C, 0 ≤ C ∧ ∀ N ≤ n, ∀ (x : E), ‖iteratedFDeriv ℝ N f x‖ ≤ C * (1 + ‖x‖) ^ k


@[simp]
theorem trans_mk {X Y Z : C} (hom : X ⟶ Y) (inv : Y ⟶ X) (hom_inv_id) (inv_hom_id)
    (hom' : Y ⟶ Z) (inv' : Z ⟶ Y) (hom_inv_id') (inv_hom_id') (hom_inv_id'') (inv_hom_id'') :
    Iso.trans ⟨hom, inv, hom_inv_id, inv_hom_id⟩ ⟨hom', inv', hom_inv_id', inv_hom_id'⟩ =
     ⟨hom ≫ hom', inv' ≫ inv, hom_inv_id'', inv_hom_id''⟩

(hom_inv_id : CategoryTheory.CategoryStruct.comp hom inv = CategoryTheory.CategoryStruct.id X)

(inv_hom_id : CategoryTheory.CategoryStruct.comp inv hom = CategoryTheory.CategoryStruct.id Y)

(hom_inv_id' : CategoryTheory.CategoryStruct.comp hom' inv' = CategoryTheory.CategoryStruct.id Y)

(inv_hom_id' : CategoryTheory.CategoryStruct.comp inv' hom' = CategoryTheory.CategoryStruct.id Z)

(hom_inv_id'' :
  CategoryTheory.CategoryStruct.comp (CategoryTheory.CategoryStruct.comp hom hom')
      (CategoryTheory.CategoryStruct.comp inv' inv) =
    CategoryTheory.CategoryStruct.id X)

(inv_hom_id'' :
  CategoryTheory.CategoryStruct.comp (CategoryTheory.CategoryStruct.comp inv' inv)
      (CategoryTheory.CategoryStruct.comp hom hom') =
    CategoryTheory.CategoryStruct.id Z)

{ hom := hom, inv := inv, hom_inv_id := hom_inv_id, inv_hom_id := inv_hom_id } ≪≫
    { hom := hom', inv := inv', hom_inv_id := hom_inv_id', inv_hom_id := inv_hom_id' } =
  { hom := CategoryTheory.CategoryStruct.comp hom hom', inv := CategoryTheory.CategoryStruct.comp inv' inv,
    hom_inv_id := hom_inv_id'', inv_hom_id := inv_hom_id'' }


theorem isRadical_iInf {ι} (I : ι → Ideal R) (hI : ∀ i, IsRadical (I i)) : IsRadical (⨅ i, I i)

{R : Type u}
[CommSemiring R]
{ι : Sort u_2}
(I : ι → Ideal R)
(hI : ∀ (i : ι), (I i).IsRadical)


theorem length_eq {s₁ s₂ : CompositionSeries X} (h : Equivalent s₁ s₂) : s₁.length = s₂.length

{X : Type u}
[Lattice X]
[JordanHolderLattice X]
{s₁ s₂ : CompositionSeries X}
(h : s₁.Equivalent s₂)


theorem Integrable.left_of_add_measure {f : α → β} (h : Integrable f (μ + ν)) : Integrable f μ

(h : MeasureTheory.Integrable f (μ + ν))


theorem prev_of_valid (cs : List Char) (c : Char) (cs' : List Char) :
    prev ⟨cs ++ c :: cs'⟩ ⟨utf8Len cs + c.utf8Size⟩ = ⟨utf8Len cs⟩

{ data := cs ++ c :: cs' }.prev { byteIdx := String.utf8Len cs + c.utf8Size } = { byteIdx := String.utf8Len cs }


@[to_additive]
lemma isPeriodicPt_smul_iff {m : M} {a : α} {n : ℕ} :
    IsPeriodicPt (m • ·) n a ↔ m ^ n • a = a

{α : Type v}
{M : Type u}
[Monoid M]
[MulAction M α]
{m : M}
{a : α}
{n : ℕ}

Function.IsPeriodicPt (fun x => m • x) n a ↔ m ^ n • a = a


theorem exact_kernel {X Y : C} (f : X ⟶ Y) :
    (ShortComplex.mk (kernel.ι f) f (by simp)).Exact

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

(CategoryTheory.ShortComplex.mk (CategoryTheory.Limits.kernel.ι f) f ⋯).Exact


/-- If `f` is box-additive on subboxes of `I₀`, then it is box-additive on subboxes of any
`I ≤ I₀`. -/
@[simps]
def restrict (f : ι →ᵇᵃ[I₀] M) (I : WithTop (Box ι)) (hI : I ≤ I₀) : ι →ᵇᵃ[I] M

{ι : Type u_1}
{M : Type u_2}
[AddCommMonoid M]
{I₀ : WithTop (BoxIntegral.Box ι)}
(f : BoxIntegral.BoxAdditiveMap ι M I₀)
(I : WithTop (BoxIntegral.Box ι))
(hI : I ≤ I₀)
(a : BoxIntegral.Box ι)


theorem isIntegral_root (h : IsAdjoinRootMonic S f) : IsIntegral R h.root

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


@[aesop safe apply]
theorem conjugate {x : R} (hx : IsSelfAdjoint x) (z : R) : IsSelfAdjoint (z * x * star z)

{R : Type u_1}
[Semigroup R]
[StarMul R]
{x : R}
(hx : IsSelfAdjoint x)
(z : R)


/-- The canonical isomorphism `Triangle.shiftFunctor C 0 ≅ 𝟭 (Triangle C)`. -/
@[simps!]
noncomputable def Triangle.shiftFunctorZero : Triangle.shiftFunctor C 0 ≅ 𝟭 _

(X : CategoryTheory.Pretriangulated.Triangle C)

((CategoryTheory.Pretriangulated.Triangle.shiftFunctorZero C).hom.app X).hom₁ =
  (CategoryTheory.shiftFunctorZero C ℤ).hom.app X.obj₁


{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{x : M}


@[simp]
protected theorem map_smulₛₗ (c : R) (x : M) : f (c • x) = σ c • f x

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


/-- If the given subset is `Absorbent` then the set we take an infimum over in `gauge` is nonempty,
which is useful for proving many properties about the gauge.  -/
theorem Absorbent.gauge_set_nonempty (absorbs : Absorbent ℝ s) :
    { r : ℝ | 0 < r ∧ x ∈ r • s }.Nonempty

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
{x : E}
(absorbs : Absorbent ℝ s)


private theorem glueDist_triangle_inl_inr_inr (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) (x : X) (y z : Y) :
    glueDist Φ Ψ ε (.inl x) (.inr z) ≤
      glueDist Φ Ψ ε (.inl x) (.inr y) + glueDist Φ Ψ ε (.inr y) (.inr z)

{X : Type u}
{Y : Type v}
{Z : Type w}
[MetricSpace X]
[MetricSpace Y]
[Nonempty Z]
(Φ : Z → X)
(Ψ : Z → Y)
(ε : ℝ)
(x : X)
(y z : Y)

Metric.glueDist Φ Ψ ε (Sum.inl x) (Sum.inr z) ≤
  Metric.glueDist Φ Ψ ε (Sum.inl x) (Sum.inr y) + Metric.glueDist Φ Ψ ε (Sum.inr y) (Sum.inr z)


@[simp]
theorem toFinset_vsub (s t : Set β) [Fintype s] [Fintype t] [Fintype ↑(s -ᵥ t)] :
    (s -ᵥ t : Set α).toFinset = s.toFinset -ᵥ t.toFinset

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[VSub α β]
(s t : Set β)
[Fintype ↑s]
[Fintype ↑t]
[Fintype ↑(s -ᵥ t)]

(s -ᵥ t).toFinset = s.toFinset -ᵥ t.toFinset


theorem update_image [DecidableEq ι] (x : (i : ι) → β i) (i : ι) (s : Set (β i)) :
    update x i '' s = Set.univ.pi (update (fun j ↦ {x j}) i s)

{ι : Type u_1}
{β : ι → Type u_3}
[DecidableEq ι]
(x : (i : ι) → β i)
(i : ι)
(s : Set (β i))

Function.update x i '' s = Set.univ.pi (Function.update (fun j => {x j}) i s)


theorem exists_forall_norm_le (f : α →ₛ F) : ∃ C, ∀ x, ‖f x‖ ≤ C

{α : Type u_1}
{F : Type u_5}
[MeasurableSpace α]
[NormedAddCommGroup F]
(f : MeasureTheory.SimpleFunc α F)


theorem OpenEmbedding.tendsto_nhds_iff' (hf : OpenEmbedding f) {l : Filter Z} {x : X} :
    Tendsto (g ∘ f) (𝓝 x) l ↔ Tendsto g (𝓝 (f x)) l

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
{f : X → Y}
{g : Y → Z}
[TopologicalSpace X]
[TopologicalSpace Y]
(hf : OpenEmbedding f)
{l : Filter Z}
{x : X}

Filter.Tendsto (g ∘ f) (𝓝 x) l ↔ Filter.Tendsto g (𝓝 (f x)) l


lemma f_modif_aux1 : EqOn (fun x ↦ P.f_modif x - P.f x + P.f₀)
    ((Ioo 0 1).indicator (fun x : ℝ ↦ P.f₀ - (P.ε * ↑(x ^ (-P.k))) • P.g₀)
    + ({1} : Set ℝ).indicator (fun _ ↦ P.f₀ - P.f 1)) (Ioi 0)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(P : WeakFEPair E)

Set.EqOn (fun x => P.f_modif x - P.f x + P.f₀)
  (((Set.Ioo 0 1).indicator fun x => P.f₀ - (P.ε * ↑(x ^ (-P.k))) • P.g₀) + {1}.indicator fun x => P.f₀ - P.f 1)
  (Set.Ioi 0)


theorem v_p_lt_preVal {x : ModP K v O hv p} : v p < preVal K v O hv p x ↔ x ≠ 0

{K : Type u₁}
[Field K]
{v : Valuation K ℝ≥0}
{O : Type u₂}
[CommRing O]
[Algebra O K]
{hv : v.Integers O}
{p : ℕ}
{x : ModP K v O hv p}


@[to_additive]
theorem map_zpow' [DivInvMonoid G] [DivInvMonoid H] [MonoidHomClass F G H]
    (f : F) (hf : ∀ x : G, f x⁻¹ = (f x)⁻¹) (a : G) : ∀ n : ℤ, f (a ^ n) = f a ^ n

{G : Type u_7}
{H : Type u_8}
{F : Type u_9}
[FunLike F G H]
[DivInvMonoid G]
[DivInvMonoid H]
[MonoidHomClass F G H]
(f : F)
(hf : ∀ (x : G), f x⁻¹ = (f x)⁻¹)
(a : G)
(n : ℤ)


@[to_additive]
theorem singleton_smul_singleton (a : α) (b : β) : ({a} : Finset α) • ({b} : Finset β) = {a • b}

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[SMul α β]
(a : α)
(b : β)


/-- Let `G` be a nonarchimedean multiplicative abelian group, and let `f : α → G` be a function that
tends to one on the filter of cofinite sets. For each finite subset of `α`, consider the partial
product of `f` on that subset. These partial products form a Cauchy filter. -/
@[to_additive "Let `G` be a nonarchimedean additive abelian group, and let `f : α → G` be a function
that tends to zero on the filter of cofinite sets. For each finite subset of `α`, consider the
partial sum of `f` on that subset. These partial sums form a Cauchy filter."]
theorem cauchySeq_prod_of_tendsto_cofinite_one {f : α → G} (hf : Tendsto f cofinite (𝓝 1)) :
    CauchySeq (fun s ↦ ∏ i ∈ s, f i)

(hf : Filter.Tendsto f Filter.cofinite (𝓝 0))


@[continuity]
theorem continuous_abs : Continuous (abs : G → G)

{G : Type u_2}
[TopologicalSpace G]
[LinearOrderedAddCommGroup G]
[OrderTopology G]


@[simp]
theorem factors_one : factors (1 : α) = 0

{α : Type u_1}
[CancelCommMonoidWithZero α]
[UniqueFactorizationMonoid α]


@[simp]
theorem coe_compTendsto' (f : α → β) {lc : Filter γ} {g : Germ lc α} (hg : g.Tendsto l) :
    (f : Germ l β).compTendsto' g hg = g.map f

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{l : Filter α}
(f : α → β)
{lc : Filter γ}
{g : lc.Germ α}
(hg : g.Tendsto l)

(↑f).compTendsto' g hg = Filter.Germ.map f g


theorem disjoint_ball_ball_iff (hδ : 0 < δ) (hε : 0 < ε) :
    Disjoint (ball x δ) (ball y ε) ↔ δ + ε ≤ dist x y

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{x y : E}
{δ ε : ℝ}
(hδ : 0 < δ)
(hε : 0 < ε)

Disjoint (Metric.ball x δ) (Metric.ball y ε) ↔ δ + ε ≤ dist x y


lemma rank_quotient_add_rank (N : Submodule R M) :
    Module.rank R (M ⧸ N) + Module.rank R N = Module.rank R M

{R : Type u_1}
{M : Type u}
[Ring R]
[AddCommGroup M]
[Module R M]
[HasRankNullity.{u, u_1} R]
(N : Submodule R M)

Module.rank R (M ⧸ N) + Module.rank R ↥N = Module.rank R M


@[simp]
theorem support_cons {u v w : V} (h : G.Adj u v) (p : G.Walk v w) :
    (cons h p).support = u :: p.support

{V : Type u}
{G : SimpleGraph V}
{u v w : V}
(h : G.Adj u v)
(p : G.Walk v w)

(SimpleGraph.Walk.cons h p).support = u :: p.support


/-- The inclusion of a quiver `V` into its path category, as a prefunctor.
-/
@[simps]
def of : V ⥤q Paths V


theorem neg_one_lt_iff {a : SignType} : -1 < a ↔ 0 ≤ a


/-- `C` has coreflexive equalizers if it has equalizers for every coreflexive pair. -/
class HasCoreflexiveEqualizers : Prop where
  has_eq : ∀ ⦃A B : C⦄ (f g : A ⟶ B) [IsCoreflexivePair f g], HasEqualizer f g

[self : CategoryTheory.Limits.HasCoreflexiveEqualizers C]


@[simp]
theorem infPrime_ofDual {a : αᵒᵈ} : InfPrime (ofDual a) ↔ SupPrime a

{α : Type u_2}
[SemilatticeInf α]
{a : αᵒᵈ}

InfPrime (OrderDual.ofDual a) ↔ SupPrime a


theorem uIcc_subset_Icc (ha : a₁ ∈ Icc a₂ b₂) (hb : b₁ ∈ Icc a₂ b₂) : [[a₁, b₁]] ⊆ Icc a₂ b₂

{α : Type u_2}
[Lattice α]
[LocallyFiniteOrder α]
{a₁ a₂ b₁ b₂ : α}
(ha : a₁ ∈ Finset.Icc a₂ b₂)
(hb : b₁ ∈ Finset.Icc a₂ b₂)


@[simp]
theorem coe_coeHom : (coeHom : ℝ → Angle) = ((↑) : ℝ → Angle)


theorem Integrable.ae_eq_of_forall_setIntegral_eq (f g : α → E) (hf : Integrable f μ)
    (hg : Integrable g μ)
    (hfg : ∀ s : Set α, MeasurableSet s → μ s < ∞ → ∫ x in s, f x ∂μ = ∫ x in s, g x ∂μ) :
    f =ᵐ[μ] g

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


theorem exp_add_mul_I : exp (x + y * I) = exp x * (cos y + sin y * I)

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


lemma jacobiTheta₂'_add_left (z τ : ℂ) : jacobiTheta₂' (z + 1) τ = jacobiTheta₂' z τ


theorem sZMod_eq_s (p' : ℕ) (i : ℕ) : sZMod (p' + 2) i = (s i : ZMod (2 ^ (p' + 2) - 1))

LucasLehmer.sZMod (p' + 2) i = ↑(LucasLehmer.s i)


/-- The main feature of the Besicovitch Vitali family is that its filter at a point `x` corresponds
to convergence along closed balls. We record one of the two implications here, which will enable us
to deduce specific statements on differentiation of measures in this context from the general
versions. -/
theorem tendsto_filterAt (μ : Measure α) [SFinite μ] (x : α) :
    Tendsto (fun r => closedBall x r) (𝓝[>] 0) ((Besicovitch.vitaliFamily μ).filterAt x)

{α : Type u_1}
[MetricSpace α]
[SecondCountableTopology α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[HasBesicovitchCovering α]
(μ : MeasureTheory.Measure α)
[MeasureTheory.SFinite μ]
(x : α)

Filter.Tendsto (fun r => Metric.closedBall x r) (𝓝[>] 0) ((Besicovitch.vitaliFamily μ).filterAt x)


lemma isoClosure_W : S.isoClosure.W = S.W

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

(S : CategoryTheory.Triangulated.Subcategory C)


@[simp]
theorem intentClosure_empty : intentClosure r ∅ = univ

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


@[simp]
theorem coe_id : ⇑(SupBotHom.id α) = id


theorem add_eq_zero_iff {a b : Ordinal} : a + b = 0 ↔ a = 0 ∧ b = 0


theorem tsum_pos {g : α → ℝ≥0} (hg : Summable g) (i : α) (hi : 0 < g i) : 0 < ∑' b, g b

{α : Type u_1}
{g : α → ℝ≥0}
(hg : Summable g)
(i : α)
(hi : 0 < g i)


lemma charpoly_natDegree [StrongRankCondition R] : natDegree (charpoly f) = finrank R M

{R : Type u}
{M : Type v}
[CommRing R]
[Nontrivial R]
[AddCommGroup M]
[Module R M]
[Module.Free R M]
[Module.Finite R M]
(f : M →ₗ[R] M)
[StrongRankCondition R]

f.charpoly.natDegree = FiniteDimensional.finrank R M


@[ext]
lemma hom_ext {X Y : Condensed.{u} C} (f g : X ⟶ Y) (h : ∀ S, f.val.app S = g.val.app S) :
    f = g

(h : ∀ (S : CompHausᵒᵖ), f.val.app S = g.val.app S)


theorem HasPoints.lineCount_eq_pointCount [HasPoints P L] [Fintype P] [Fintype L]
    (hPL : Fintype.card P = Fintype.card L) {p : P} {l : L} (hpl : p ∉ l) :
    lineCount L p = pointCount P l

{P : Type u_1}
{L : Type u_2}
[Membership P L]
[Configuration.HasPoints P L]
[Fintype P]
[Fintype L]
(hPL : Fintype.card P = Fintype.card L)
{p : P}
{l : L}
(hpl : p ∉ l)

Configuration.lineCount L p = Configuration.pointCount P l


@[to_additive (attr := simp)]
protected theorem one_div_smul {r : X} {s t : S} : ((1 : R) /ₒ t) • (r /ₒ s) = r /ₒ (s * t)

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


theorem StrictConvex.smul (hs : StrictConvex 𝕜 s) (c : 𝕝) : StrictConvex 𝕜 (c • s)

{𝕜 : Type u_1}
{𝕝 : Type u_2}
{E : Type u_3}
[OrderedSemiring 𝕜]
[TopologicalSpace E]
[AddCommGroup E]
[Module 𝕜 E]
[LinearOrderedField 𝕝]
[Module 𝕝 E]
[ContinuousConstSMul 𝕝 E]
[LinearMap.CompatibleSMul E E 𝕜 𝕝]
{s : Set E}
(hs : StrictConvex 𝕜 s)
(c : 𝕝)


@[simp] theorem isEqv_cons_nil : isEqv (a::as : List α) [] eqv = false

{α : Type u}
{a : α}
{as : List α}
{eqv : α → α → Bool}


@[to_additive (attr := simp)]
theorem comap_op_nhds (x : Mᵐᵒᵖ) : comap (op : M → Mᵐᵒᵖ) (𝓝 x) = 𝓝 (unop x)

{M : Type u_1}
[TopologicalSpace M]
(x : Mᵐᵒᵖ)

Filter.comap MulOpposite.op (𝓝 x) = 𝓝 (MulOpposite.unop x)


theorem Matrix.transpose_tsum [T2Space R] {f : X → Matrix m n R} : (∑' x, f x)ᵀ = ∑' x, (f x)ᵀ

{X : Type u_1}
{m : Type u_4}
{n : Type u_5}
{R : Type u_8}
[AddCommMonoid R]
[TopologicalSpace R]
[T2Space R]
{f : X → Matrix m n R}


@[simp]
theorem zero_ofSuppBddBelow [Nonempty Γ] : ofSuppBddBelow 0 BddBelow_zero = (0 : HahnSeries Γ R)

{Γ : Type u_1}
{R : Type u_2}
[Zero R]
[LinearOrder Γ]
[LocallyFiniteOrder Γ]
[Nonempty Γ]


theorem Metric.instTietzeExtensionClosedBall (𝕜 : Type v) [RCLike 𝕜] {E : Type w}
    [NormedAddCommGroup E] [NormedSpace 𝕜 E] [FiniteDimensional 𝕜 E] (y : E) {r : ℝ} (hr : 0 < r) :
    TietzeExtension.{u, w} (Metric.closedBall y r)

TietzeExtension ↑(Metric.closedBall y r)


/-- In a group that satisfies the normalizer condition, every maximal subgroup is normal -/
theorem NormalizerCondition.normal_of_coatom (hnc : NormalizerCondition G) (hmax : IsCoatom H) :
    H.Normal

{G : Type u_1}
[Group G]
(H : Subgroup G)
(hnc : NormalizerCondition G)
(hmax : IsCoatom H)


theorem continuous_iff_ultrafilter :
    Continuous f ↔ ∀ (x) (g : Ultrafilter X), ↑g ≤ 𝓝 x → Tendsto f g (𝓝 (f x))

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}

Continuous f ↔ ∀ (x : X) (g : Ultrafilter X), ↑g ≤ 𝓝 x → Filter.Tendsto f (↑g) (𝓝 (f x))


lemma div_nonneg [PosMulMono α] (ha : 0 ≤ a) (hb : 0 ≤ b) : 0 ≤ a / b

{α : Type u_1}
[Semifield α]
[LinearOrder α]
[PosMulReflectLT α]
[ZeroLEOneClass α]
{a b : α}
[PosMulMono α]
(ha : 0 ≤ a)
(hb : 0 ≤ b)


/-- If `f` has a local max on `s` at `a`, `f'` is a derivative of `f` at `a` within `s`, and
both `y` and `-y` belong to the positive tangent cone of `s` at `a`, then `f' y ≤ 0`. -/
theorem IsLocalMaxOn.hasFDerivWithinAt_eq_zero (h : IsLocalMaxOn f s a)
    (hf : HasFDerivWithinAt f f' s a) (hy : y ∈ posTangentConeAt s a)
    (hy' : -y ∈ posTangentConeAt s a) : f' y = 0

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{f' : E →L[ℝ] ℝ}
{s : Set E}
{a y : E}
(h : IsLocalMaxOn f s a)
(hf : HasFDerivWithinAt f f' s a)
(hy : y ∈ posTangentConeAt s a)
(hy' : -y ∈ posTangentConeAt s a)


@[simp]
lemma quotientEquiv_symm (x : S) : P.quotientEquiv.symm x = P.σ x

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

P.quotientEquiv.symm x = (Ideal.Quotient.mk P.ker) (P.σ x)


@[to_additive (attr := simp)]
theorem bddAbove_inv : BddAbove s⁻¹ ↔ BddBelow s

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

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


theorem PrimrecRel.of_eq {α β} [Primcodable α] [Primcodable β] {r s : α → β → Prop}
    [∀ a b, Decidable (r a b)] [∀ a b, Decidable (s a b)] (hr : PrimrecRel r)
    (H : ∀ a b, r a b ↔ s a b) : PrimrecRel s

{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{r s : α → β → Prop}
[(a : α) → (b : β) → Decidable (r a b)]
[(a : α) → (b : β) → Decidable (s a b)]
(hr : PrimrecRel r)
(H : ∀ (a : α) (b : β), r a b ↔ s a b)


theorem splitLower_def [DecidableEq ι] {i x} (h : x ∈ Ioo (I.lower i) (I.upper i))
    (h' : ∀ j, I.lower j < update I.upper i x j :=
      (forall_update_iff I.upper fun j y => I.lower j < y).2
        ⟨h.1, fun j _ => I.lower_lt_upper _⟩) :
    I.splitLower i x = (⟨I.lower, update I.upper i x, h'⟩ : Box ι)

(h : x ∈ Set.Ioo (I.lower i) (I.upper i))

(h' : ∀ (j : ι), I.lower j < Function.update I.upper i x j := ⋯)

I.splitLower i x = ↑{ lower := I.lower, upper := Function.update I.upper i x, lower_lt_upper := h' }


@[to_additive]
theorem mul_subset_iff_right : s * t ⊆ u ↔ ∀ b ∈ t, op b • s ⊆ u

s + t ⊆ u ↔ ∀ b ∈ t, AddOpposite.op b +ᵥ s ⊆ u


@[simp, norm_cast]
theorem cast_finsupp_prod [CommSemiring R] (g : α → M → ℕ) :
    (↑(f.prod g) : R) = f.prod fun a b => ↑(g a b)

{α : Type u_1}
{M : Type u_5}
{R : Type u_11}
[Zero M]
(f : α →₀ M)
[CommSemiring R]
(g : α → M → ℕ)

↑(f.prod g) = f.prod fun a b => ↑(g a b)


@[simp] lemma last_tail (p : RelSeries r) (len_pos : p.length ≠ 0) :
    (p.tail len_pos).last = p.last

{α : Type u_1}
{r : Rel α α}
(p : RelSeries r)
(len_pos : p.length ≠ 0)


theorem frontier_lt_subset_eq (hf : Continuous f) (hg : Continuous g) :
    frontier { b | f b < g b } ⊆ { b | f b = g b }

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[LinearOrder α]
[OrderClosedTopology α]
{f g : β → α}
[TopologicalSpace β]
(hf : Continuous f)
(hg : Continuous g)

frontier {b | f b < g b} ⊆ {b | f b = g b}


/-- The `n`-th power map (for an integer `n`) on a commutative group, considered as a group
homomorphism. -/
@[to_additive (attr := simps) "Multiplication by an integer `n` on a commutative additive group,
considered as an additive group homomorphism."]
def zpowGroupHom (n : ℤ) : α →* α

{α : Type u_1}
[SubtractionCommMonoid α]
(n : ℤ)

∀ (x : α), (zsmulAddGroupHom n) x = n • x


theorem pow_subset_pow {s : AddSubmonoid R} {n : ℕ} : (↑s : Set R) ^ n ⊆ ↑(s ^ n)

{R : Type u_4}
[Semiring R]
{s : AddSubmonoid R}
{n : ℕ}


@[to_additive (attr := simp)]
theorem prod_const_one : (∏ _x ∈ s, (1 : β)) = 1

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
[AddCommMonoid β]


@[simp]
theorem bsup_eq_zero_iff {o} {f : ∀ a < o, Ordinal} : bsup o f = 0 ↔ ∀ i hi, f i hi = 0

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

o.bsup f = 0 ↔ ∀ (i : Ordinal.{u_4}) (hi : i < o), f i hi = 0


theorem interior_subset_closure : interior s ⊆ closure s

{X : Type u}
{s : Set X}
[TopologicalSpace X]


theorem uniformContinuous_iff [PseudoMetricSpace β] {f : α → β} :
    UniformContinuous f ↔ ∀ ε > 0, ∃ δ > 0, ∀ {a b : α}, dist a b < δ → dist (f a) (f b) < ε

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
{f : α → β}


@[simp]
theorem mk.eta {R : Type*} {c₁ c₂} (a : ℍ[R,c₁,c₂]) : mk a.1 a.2 a.3 a.4 = a

{R : Type u_1}
{c₁ c₂ : R}
(a : ℍ[R,c₁,c₂])

{ re := a.re, imI := a.imI, imJ := a.imJ, imK := a.imK } = a


@[reassoc (attr := simp)]
theorem toSheafify_sheafifyLift {P Q : Cᵒᵖ ⥤ D} (η : P ⟶ Q) (hQ : Presheaf.IsSheaf J Q) :
    J.toSheafify P ≫ sheafifyLift J η hQ = η

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

(hQ : CategoryTheory.Presheaf.IsSheaf J Q)

CategoryTheory.CategoryStruct.comp (J.toSheafify P) (J.sheafifyLift η hQ) = η


@[simp]
theorem modByMonic_zero (p : R[X]) : p %ₘ 0 = p


theorem le_iff : f ≤ g ↔ ∀ i ∈ f.support, f i ≤ g i

[(i : ι) → CanonicallyOrderedAddCommMonoid (α i)]

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


theorem aeval_primPart_eq_zero {S : Type*} [Ring S] [IsDomain S] [Algebra R S]
    [NoZeroSMulDivisors R S] {p : R[X]} {s : S} (hpzero : p ≠ 0) (hp : aeval s p = 0) :
    aeval s p.primPart = 0

{R : Type u_1}
[CommRing R]
[IsDomain R]
[NormalizedGCDMonoid R]
{S : Type u_2}
[Ring S]
[IsDomain S]
[Algebra R S]
[NoZeroSMulDivisors R S]
{p : Polynomial R}
{s : S}
(hpzero : p ≠ 0)
(hp : (Polynomial.aeval s) p = 0)


/-- An auxiliary equivalence useful in the proofs about
`FormalMultilinearSeries.changeOriginSeries`: the set of triples `(k, l, s)`, where `s` is a
`Finset (Fin (k + l))` of cardinality `l` is equivalent to the set of pairs `(n, s)`, where `s` is a
`Finset (Fin n)`.

The forward map sends `(k, l, s)` to `(k + l, s)` and the inverse map sends `(n, s)` to
`(n - Finset.card s, Finset.card s, s)`. The actual definition is less readable because of problems
with non-definitional equalities. -/
@[simps]
def changeOriginIndexEquiv :
    (Σ k l : ℕ, { s : Finset (Fin (k + l)) // s.card = l }) ≃ Σ n : ℕ, Finset (Fin n)

(FormalMultilinearSeries.changeOriginIndexEquiv s).fst = s.fst + s.snd.fst


theorem Associated.of_mul_right [CancelCommMonoidWithZero α] {a b c d : α} :
    a * b ~ᵤ c * d → b ~ᵤ d → b ≠ 0 → a ~ᵤ c

{α : Type u_1}
[CancelCommMonoidWithZero α]
{a b c d : α}


lemma cfcₙHom_predicate (f : C(σₙ R a, R)₀) :
    p (cfcₙHom ha f)


theorem toSignedMeasure_zero : (0 : JordanDecomposition α).toSignedMeasure = 0

MeasureTheory.JordanDecomposition.toSignedMeasure 0 = 0


theorem coeIdeal_ne_zero' {I : Ideal R} (h : S ≤ nonZeroDivisors R) :
    (I : FractionalIdeal S P) ≠ 0 ↔ I ≠ (⊥ : Ideal R)

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
[loc : IsLocalization S P]
{I : Ideal R}
(h : S ≤ R⁰)

↑I ≠ 0 ↔ I ≠ ⊥


@[simp]
theorem _root_.Real.toNNReal_ofNat (n : ℕ) [n.AtLeastTwo] :
    Real.toNNReal (no_index (OfNat.ofNat n)) = OfNat.ofNat n

(OfNat.ofNat n).toNNReal = OfNat.ofNat n


@[simp]
theorem aleph_toPartENat (o : Ordinal) : toPartENat (aleph o) = ⊤

Cardinal.toPartENat (Cardinal.aleph o) = ⊤


/-- Pointwise maximum of two monotone functions is a monotone function. -/
protected theorem max [Preorder α] [LinearOrder β] {f g : α → β} (hf : Antitone f)
    (hg : Antitone g) :
    Antitone fun x => max (f x) (g x)

{α : Type u}
{β : Type v}
[Preorder α]
[LinearOrder β]
{f g : α → β}
(hf : Antitone f)
(hg : Antitone g)


/-- The `vectorSpan` of a finite affinely independent family has
dimension one less than its cardinality. -/
theorem AffineIndependent.finrank_vectorSpan [Fintype ι] {p : ι → P} (hi : AffineIndependent k p)
    {n : ℕ} (hc : Fintype.card ι = n + 1) : finrank k (vectorSpan k (Set.range p)) = n

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
{ι : Type u_4}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
[Fintype ι]
{p : ι → P}
(hi : AffineIndependent k p)
{n : ℕ}
(hc : Fintype.card ι = n + 1)

FiniteDimensional.finrank k ↥(vectorSpan k (Set.range p)) = n


theorem _root_.affineSpan_le {s : Set P} {Q : AffineSubspace k P} :
    affineSpan k s ≤ Q ↔ s ⊆ (Q : Set P)

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


@[simp]
theorem QuotientAddGroup.equivIcoMod_coe (a b : α) :
    QuotientAddGroup.equivIcoMod hp a ↑b = ⟨toIcoMod hp a b, toIcoMod_mem_Ico hp a _⟩

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

(QuotientAddGroup.equivIcoMod hp a) ↑b = ⟨toIcoMod hp a b, ⋯⟩


@[fun_prop]
protected theorem ContinuousLinearMap.differentiableWithinAt : DifferentiableWithinAt 𝕜 e s x

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


lemma cfc_comp' (g f : R → R) (a : A) (hg : ContinuousOn g (f '' spectrum R a) := by cfc_cont_tac)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    cfc (g <| f ·) a = cfc g (cfc f a)

cfc (fun x => g (f x)) a = cfc g (cfc f a)


/-- Equivalence between `Fin m × Fin n` and `Fin (m * n)` -/
@[simps]
def finProdFinEquiv : Fin m × Fin n ≃ Fin (m * n)


@[simp]
theorem NatTrans.mapHomologicalComplex_comp (c : ComplexShape ι) {F G H : W₁ ⥤ W₂}
    [F.PreservesZeroMorphisms] [G.PreservesZeroMorphisms] [H.PreservesZeroMorphisms]
    (α : F ⟶ G) (β : G ⟶ H) :
    NatTrans.mapHomologicalComplex (α ≫ β) c =
      NatTrans.mapHomologicalComplex α c ≫ NatTrans.mapHomologicalComplex β c

CategoryTheory.NatTrans.mapHomologicalComplex (α ≫ β) c =
  CategoryTheory.NatTrans.mapHomologicalComplex α c ≫ CategoryTheory.NatTrans.mapHomologicalComplex β c


@[simp, norm_cast]
theorem coe_bot : ((⊥ : Opens α) : Set α) = ∅


/-- A theorem of Schur: The size of the commutator subgroup is bounded in terms of the number of
  commutators. -/
theorem card_commutator_le_of_finite_commutatorSet [Finite (commutatorSet G)] :
    Nat.card (_root_.commutator G) ≤ cardCommutatorBound (Nat.card (commutatorSet G))

(G : Type u_1)
[Group G]
[Finite ↑(commutatorSet G)]

Nat.card ↥(commutator G) ≤ Subgroup.cardCommutatorBound (Nat.card ↑(commutatorSet G))


@[simp]
theorem coe_mk (f : ∀ α : Type u, F α → G α) (pp ps) :
    (ApplicativeTransformation.mk f @pp @ps) = f

(pp : ∀ {α : Type u} (x : α), f α (pure x) = pure x)

(ps : ∀ {α β : Type u} (x : F (α → β)) (y : F α), f β (Seq.seq x fun x => y) = Seq.seq (f (α → β) x) fun x => f α y)

(fun {α} => { app := f, preserves_pure' := pp, preserves_seq' := ps }.app α) = f


theorem SymmetricRel.eq {U : Set (α × α)} (hU : SymmetricRel U) : Prod.swap ⁻¹' U = U

{α : Type ua}
{U : Set (α × α)}
(hU : SymmetricRel U)


theorem map_le_iff_le_comap {f : F} {p : Submodule R M} {q : Submodule R₂ M₂} :
    map f p ≤ q ↔ p ≤ comap f q

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

Submodule.map f p ≤ q ↔ p ≤ Submodule.comap f q


lemma dvd_mul_of_div_dvd (h : b ∣ a) (hdiv : a / b ∣ c) : a ∣ b * c

{a b c : ℤ}
(h : b ∣ a)
(hdiv : a / b ∣ c)


@[to_additive (attr := simp)]
theorem mem_one : a ∈ (1 : Set α) ↔ a = 1


theorem trace_comp_comm' (f : M →ₗ[R] N) (g : N →ₗ[R] M) :
    trace R M (g ∘ₗ f) = trace R N (f ∘ₗ g)

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{N : Type u_3}
[AddCommGroup N]
[Module R N]
[Module.Free R M]
[Module.Finite R M]
[Module.Free R N]
[Module.Finite R N]
(f : M →ₗ[R] N)
(g : N →ₗ[R] M)

(LinearMap.trace R M) (g ∘ₗ f) = (LinearMap.trace R N) (f ∘ₗ g)


/-- Auxiliary lemma for `iSup_restrict_spanningSets`. -/
theorem iSup_restrict_spanningSets_of_measurableSet [SigmaFinite μ] (hs : MeasurableSet s) :
    ⨆ i, μ.restrict (spanningSets μ i) s = μ s

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
[MeasureTheory.SigmaFinite μ]
(hs : MeasurableSet s)

⨆ i, (μ.restrict (MeasureTheory.spanningSets μ i)) s = μ s


/--
`SatisfiesM` distributes over `<$>`, strongest postcondition version.
(Use this for reasoning forward from assumptions.)
-/
theorem map_post [Functor m] [LawfulFunctor m] {x : m α}
    (hx : SatisfiesM p x) : SatisfiesM (fun b => ∃ a, p a ∧ b = f a) (f <$> x)

{m : Type u_1 → Type u_2}
{α : Type u_1}
{p : α → Prop}

∀ {α_1 : Type u_1} {f : α → α_1} [inst : Functor m] [inst_1 : LawfulFunctor m] {x : m α},
  SatisfiesM p x → SatisfiesM (fun b => ∃ a, p a ∧ b = f a) (f <$> x)


@[simp 1100]
theorem basicOpen_res_eq (i : op U ⟶ op V) [IsIso i] :
    X.basicOpen (X.presheaf.map i f) = X.basicOpen f

(X : AlgebraicGeometry.Scheme)
{V U : X.Opens}
(f : ↑(X.presheaf.obj (Opposite.op U)))
(i : Opposite.op U ⟶ Opposite.op V)
[CategoryTheory.IsIso i]

X.basicOpen ((X.presheaf.map i) f) = X.basicOpen f


theorem le_lt_trans (h₁ : cmp x y ≠ .gt) (h₂ : cmp y z = .lt) : cmp x z = .lt

∀ {x : Sort u_1} {cmp : x → x → Ordering} [inst : Batteries.TransCmp cmp] {x_1 y z : x},
  cmp x_1 y ≠ Ordering.gt → cmp y z = Ordering.lt → cmp x_1 z = Ordering.lt


@[simp]
theorem zero_toOuterMeasure {_m : MeasurableSpace α} : (0 : Measure α).toOuterMeasure = 0

MeasureTheory.Measure.toOuterMeasure 0 = 0


theorem leadingCoeff_normalize (p : R[X]) :
    leadingCoeff (normalize p) = normalize (leadingCoeff p)

{R : Type u}
[CommRing R]
[IsDomain R]
[NormalizationMonoid R]
(p : R[X])

(normalize p).leadingCoeff = normalize p.leadingCoeff


theorem CPolynomialAt_const {v : F} : CPolynomialAt 𝕜 (fun _ => v) x

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{x : E}
{v : F}


@[simp]
theorem toSheafedSpaceHom_c : (toSheafedSpaceHom Y f).c = f.c

{X : AlgebraicGeometry.PresheafedSpace C}

[H : AlgebraicGeometry.PresheafedSpace.IsOpenImmersion f]

(AlgebraicGeometry.PresheafedSpace.IsOpenImmersion.toSheafedSpaceHom Y f).c = f.c


lemma disjoint_of_subset_right (h : t ⊆ u) (d : Disjoint s u) : Disjoint s t

{α : Type u}
{s t u : Set α}
(h : t ⊆ u)
(d : Disjoint s u)


@[simp]
lemma descUniq_inv_app (q : (Σi, C i) ⥤ D) (h : ∀ i, incl i ⋙ q ≅ F i) (i : I) (X : C i) :
    (descUniq F q h).inv.app ⟨i, X⟩ = (h i).inv.app X

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

(F : (i : I) → CategoryTheory.Functor (C i) D)

(q : CategoryTheory.Functor ((i : I) × C i) D)

(h : (i : I) → (CategoryTheory.Sigma.incl i).comp q ≅ F i)

(CategoryTheory.Sigma.descUniq F q h).inv.app ⟨i, X⟩ = (h i).inv.app X


theorem setIntegral_eq_zero_of_forall_eq_zero (ht_eq : ∀ x ∈ t, f x = 0) :
    ∫ x in t, f x ∂μ = 0

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : X → E}
{t : Set X}
{μ : MeasureTheory.Measure X}
(ht_eq : ∀ x ∈ t, f x = 0)


/-- `baseChange` as a linear map.

When `M = N`, this is true more strongly as `Module.End.baseChangeHom`. -/
@[simps]
def baseChangeHom : (M →ₗ[R] N) →ₗ[R] A ⊗[R] M →ₗ[A] A ⊗[R] N

(R : Type u_1)
(A : Type u_2)
(M : Type u_4)
(N : Type u_5)
[CommSemiring R]
[Semiring A]
[Algebra R A]
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
(f : M →ₗ[R] N)

(LinearMap.baseChangeHom R A M N) f = LinearMap.baseChange A f


theorem constr_pow_aeval (pb : PowerBasis A S) {y : S'} (hy : aeval y (minpoly A pb.gen) = 0)
    (f : A[X]) : pb.basis.constr A (fun i => y ^ (i : ℕ)) (aeval pb.gen f) = aeval y f

(hy : (Polynomial.aeval y) (minpoly A pb.gen) = 0)

((pb.basis.constr A) fun i => y ^ ↑i) ((Polynomial.aeval pb.gen) f) = (Polynomial.aeval y) f


theorem uniformContinuous_abs : UniformContinuous (abs : ℚ → ℚ)


lemma ne_zero_of_lt {a b : Fin (n + 1)} (hab : a < b) : b ≠ 0


theorem minpoly_sub_one_eq_cyclotomic_comp [Algebra K A] [IsDomain A] {ζ : A}
    [IsCyclotomicExtension {n} K A] (hζ : IsPrimitiveRoot ζ n)
    (h : Irreducible (Polynomial.cyclotomic n K)) :
    minpoly K (ζ - 1) = (cyclotomic n K).comp (X + 1)

(h : Irreducible (Polynomial.cyclotomic (↑n) K))

minpoly K (ζ - 1) = (Polynomial.cyclotomic (↑n) K).comp (Polynomial.X + 1)


@[simp]
theorem coeff_C_mul (p : R[X]) : coeff (C a * p) n = a * coeff p n

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

(Polynomial.C a * p).coeff n = a * p.coeff n


@[simp]
theorem min_eq_bot [OrderBot α] {a b : α} : min a b = ⊥ ↔ a = ⊥ ∨ b = ⊥

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


/-- The closure of the interval `(a, +∞)` is the closed interval `[a, +∞)`. -/
@[simp]
theorem closure_Ioi (a : α) [NoMaxOrder α] : closure (Ioi a) = Ici a

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


lemma map_Ψ₃ : (W.map f).Ψ₃ = W.Ψ₃.map f

{R : Type r}
{S : Type s}
[CommRing R]
[CommRing S]
(W : WeierstrassCurve R)
(f : R →+* S)


theorem eqOn_comm : EqOn f₁ f₂ s ↔ EqOn f₂ f₁ s

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{f₁ f₂ : α → β}


theorem factorial_dvd_ascFactorial (n k : ℕ) : k ! ∣ n.ascFactorial k


/-- Fixed points of sup of subgroups is intersection -/
theorem fixedPoints_subgroup_sup {P Q : Subgroup M} :
    fixedPoints (↥(P ⊔ Q)) α = fixedPoints P α ∩ fixedPoints Q α

(M : Type u_1)
(α : Type u_2)
[Group M]
[MulAction M α]
{P Q : Subgroup M}

MulAction.fixedPoints (↥(P ⊔ Q)) α = MulAction.fixedPoints (↥P) α ∩ MulAction.fixedPoints (↥Q) α


/-- In a linearly ordered field with the order topology, if `f` tends to a positive constant `C` and
`g` tends to `Filter.atTop` then `f * g` tends to `Filter.atTop`. -/
theorem Filter.Tendsto.mul_atTop {C : 𝕜} (hC : 0 < C) (hf : Tendsto f l (𝓝 C))
    (hg : Tendsto g l atTop) : Tendsto (fun x => f x * g x) l atTop

{𝕜 : Type u_1}
{α : Type u_2}
[LinearOrderedField 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
{l : Filter α}
{f g : α → 𝕜}
{C : 𝕜}
(hC : 0 < C)
(hf : Filter.Tendsto f l (𝓝 C))
(hg : Filter.Tendsto g l Filter.atTop)

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


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

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

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


@[simp]
theorem mem_nthRootsFinset {n : ℕ} (h : 0 < n) {x : R} :
    x ∈ nthRootsFinset n R ↔ x ^ (n : ℕ) = 1

{R : Type u}
[CommRing R]
[IsDomain R]
{n : ℕ}
(h : 0 < n)
{x : R}

x ∈ Polynomial.nthRootsFinset n R ↔ x ^ n = 1


/-- Construct a pseudofunctor from a lax functor whose `mapId` and `mapComp` are isomorphisms. -/
@[simps]
def mkOfLax (F : LaxFunctor B C) (F' : F.PseudoCore) : Pseudofunctor B C

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F : CategoryTheory.LaxFunctor B C)
(F' : F.PseudoCore)

∀ {a b c : B} (f : a ⟶ b) (g : b ⟶ c), (CategoryTheory.Pseudofunctor.mkOfLax F F').mapComp f g = F'.mapCompIso f g


@[to_additive HasSum.of_nat_of_neg_add_one]
lemma HasProd.of_nat_of_neg_add_one {f : ℤ → M}
    (hf₁ : HasProd (fun n : ℕ ↦ f n) m) (hf₂ : HasProd (fun n : ℕ ↦ f (-(n + 1))) m') :
    HasProd f (m * m')

(hf₂ : HasSum (fun n => f (-(↑n + 1))) m')


/-- The isomorphism `S₁.rightHomology ≅ S₂.rightHomology` induced by an isomorphism of
short complexes `S₁ ≅ S₂`. -/
@[simps]
noncomputable def rightHomologyMapIso (e : S₁ ≅ S₂) [S₁.HasRightHomology]
    [S₂.HasRightHomology] : S₁.rightHomology ≅ S₂.rightHomology

(CategoryTheory.ShortComplex.rightHomologyMapIso e).inv = CategoryTheory.ShortComplex.rightHomologyMap e.inv


@[simp]
theorem transitionMap_eq (n : ℕ) : transitionMap I M (Nat.le_refl n) = LinearMap.id

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

AdicCompletion.transitionMap I M ⋯ = LinearMap.id


nonrec theorem SmoothWithinAt.prod_mk {f : M → M'} {g : M → N'} (hf : SmoothWithinAt I I' f s x)
    (hg : SmoothWithinAt I J' g s x) : SmoothWithinAt I (I'.prod J') (fun x => (f x, g x)) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{F' : Type u_14}
[NormedAddCommGroup F']
[NormedSpace 𝕜 F']
{G' : Type u_15}
[TopologicalSpace G']
{J' : ModelWithCorners 𝕜 F' G'}
{N' : Type u_16}
[TopologicalSpace N']
[ChartedSpace G' N']
{s : Set M}
{x : M}
{f : M → M'}
{g : M → N'}
(hf : SmoothWithinAt I I' f s x)
(hg : SmoothWithinAt I J' g s x)


/-- The iterated derivative within a set of the composition with a linear map on the right is
obtained by composing the iterated derivative with the linear map. -/
theorem ContinuousLinearMap.iteratedFDerivWithin_comp_right {f : E → F} (g : G →L[𝕜] E)
    (hf : ContDiffOn 𝕜 n f s) (hs : UniqueDiffOn 𝕜 s) (h's : UniqueDiffOn 𝕜 (g ⁻¹' s)) {x : G}
    (hx : g x ∈ s) {i : ℕ} (hi : (i : ℕ∞) ≤ n) :
    iteratedFDerivWithin 𝕜 i (f ∘ g) (g ⁻¹' s) x =
      (iteratedFDerivWithin 𝕜 i f s (g x)).compContinuousLinearMap fun _ => g

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{s : Set E}
{n : ℕ∞}
{f : E → F}
(g : G →L[𝕜] E)
(hf : ContDiffOn 𝕜 n f s)
(hs : UniqueDiffOn 𝕜 s)
(h's : UniqueDiffOn 𝕜 (⇑g ⁻¹' s))
{x : G}
(hx : g x ∈ s)
{i : ℕ}
(hi : ↑i ≤ n)

iteratedFDerivWithin 𝕜 i (f ∘ ⇑g) (⇑g ⁻¹' s) x = (iteratedFDerivWithin 𝕜 i f s (g x)).compContinuousLinearMap fun x => g


lemma even_pow' (h : n ≠ 0) : Even (m ^ n) ↔ Even m


/-- The `vectorSpan` of an indexed family is the span of the pairwise subtractions with a given
point on the right. -/
theorem vectorSpan_range_eq_span_range_vsub_right (p : ι → P) (i0 : ι) :
    vectorSpan k (Set.range p) = Submodule.span k (Set.range fun i : ι => p i -ᵥ p i0)

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{ι : Type u_4}
(p : ι → P)
(i0 : ι)

vectorSpan k (Set.range p) = Submodule.span k (Set.range fun i => p i -ᵥ p i0)


/-- If `α` has a unique term, then the type of function `α → β` is measurably equivalent to `β`. -/
@[simps! (config := .asFn)]
def funUnique (α β : Type*) [Unique α] [MeasurableSpace β] : (α → β) ≃ᵐ β

(α : Type u_8)
(β : Type u_9)
[Unique α]
[MeasurableSpace β]

⇑(MeasurableEquiv.funUnique α β) = fun f => f default


theorem toDualRight_symm_comp_toDualLeft :
    p.toDualRight.symm.dualMap ∘ₗ (p.toDualLeft : M →ₗ[R] Dual R N) = Dual.eval R M

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(p : PerfectPairing R M N)

↑p.toDualRight.symm.dualMap ∘ₗ ↑p.toDualLeft = Module.Dual.eval R M


private lemma continuousAt_mul_top_top :
    ContinuousAt (fun p : EReal × EReal ↦ p.1 * p.2) (⊤, ⊤)

ContinuousAt (fun p => p.1 * p.2) (⊤, ⊤)


@[simp] theorem nhdsWithin_eq_nhds {a : α} {s : Set α} : 𝓝[s] a = 𝓝 a ↔ s ∈ 𝓝 a

{α : Type u_1}
[TopologicalSpace α]
{a : α}
{s : Set α}


@[to_additive]
theorem MonoidHom.map_cyclic {G : Type*} [Group G] [h : IsCyclic G] (σ : G →* G) :
    ∃ m : ℤ, ∀ g : G, σ g = g ^ m

{G : Type u_1}
[AddGroup G]
[h : IsAddCyclic G]
(σ : G →+ G)


theorem isPath_cons {xs : Path F} {a a'} {f : F.B a → M F} {i : F.B a'} :
    IsPath (⟨a', i⟩ :: xs) (M.mk ⟨a, f⟩) → a = a'

{F : PFunctor.{u}}
{xs : PFunctor.Approx.Path F}
{a a' : F.A}
{f : F.B a → F.M}
{i : F.B a'}

PFunctor.M.IsPath (⟨a', i⟩ :: xs) (PFunctor.M.mk ⟨a, f⟩) → a = a'


theorem chainHeight_eq_iSup_Ici : s.chainHeight = ⨆ i ∈ s, (s ∩ Set.Ici i).chainHeight


/-- If `f` has finite integral, then `∫⁻ x in s, f x ∂μ` is absolutely continuous in `s`: it tends
to zero as `μ s` tends to zero. -/
theorem tendsto_setLIntegral_zero {ι} {f : α → ℝ≥0∞} (h : ∫⁻ x, f x ∂μ ≠ ∞) {l : Filter ι}
    {s : ι → Set α} (hl : Tendsto (μ ∘ s) l (𝓝 0)) :
    Tendsto (fun i => ∫⁻ x in s i, f x ∂μ) l (𝓝 0)

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{ι : Type u_5}
{f : α → ℝ≥0∞}
(h : ∫⁻ (x : α), f x ∂μ ≠ ⊤)
{l : Filter ι}
{s : ι → Set α}
(hl : Filter.Tendsto (⇑μ ∘ s) l (𝓝 0))

Filter.Tendsto (fun i => ∫⁻ (x : α) in s i, f x ∂μ) l (𝓝 0)


@[simp]
theorem condition_one (t : PullbackCone f g) : t.π.app WalkingCospan.one = t.fst ≫ f

(t : CategoryTheory.Limits.PullbackCone f g)

t.π.app CategoryTheory.Limits.WalkingCospan.one = t.fst ≫ f


/-- If the angle between three points is nonzero, the first two points are not equal. -/
theorem left_ne_of_oangle_ne_zero {p₁ p₂ p₃ : P} (h : ∡ p₁ p₂ p₃ ≠ 0) : p₁ ≠ p₂

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


theorem derivedSeries_eq_derivedSeriesOfIdeal_comap (k : ℕ) :
    derivedSeries R I k = (derivedSeriesOfIdeal R L k I).comap I.incl

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(I : LieIdeal R L)
(k : ℕ)

LieAlgebra.derivedSeries R (↥↑I) k = LieIdeal.comap I.incl (LieAlgebra.derivedSeriesOfIdeal R L k I)


theorem Filter.EventuallyEq.hasLineDerivWithinAt_iff (h : f₀ =ᶠ[𝓝[s] x] f₁) (hx : f₀ x = f₁ x) :
    HasLineDerivWithinAt 𝕜 f₀ f' s x v ↔ HasLineDerivWithinAt 𝕜 f₁ f' s x v

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


@[simp]
lemma toRows₂_fromRows  (A₁ : Matrix m₁ n R) (A₂ : Matrix m₂ n R) :
    toRows₂ (fromRows A₁ A₂) = A₂

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


/-- An isometry preserves the diameter in pseudometric spaces. -/
theorem diam_image (hf : Isometry f) (s : Set α) : Metric.diam (f '' s) = Metric.diam s

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


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


@[simp]
theorem WalkingPair.swap_apply_right : WalkingPair.swap right = left

CategoryTheory.Limits.WalkingPair.swap CategoryTheory.Limits.WalkingPair.right = CategoryTheory.Limits.WalkingPair.left


theorem updateFinset_def {s : Finset ι} {y} :
    updateFinset x s y = fun i ↦ if hi : i ∈ s then y ⟨i, hi⟩ else x i

{ι : Type u_1}
{π : ι → Sort u_2}
{x : (i : ι) → π i}
[DecidableEq ι]
{s : Finset ι}
{y : (i : { x // x ∈ s }) → π ↑i}

Function.updateFinset x s y = fun i => if hi : i ∈ s then y ⟨i, hi⟩ else x i


theorem mop_inj {X Y : C} :
    Function.Injective (Quiver.Hom.mop : (X ⟶ Y) → (mop' X ⟶ mop' Y))

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


theorem prod_insert : s ×ˢ insert b t = (fun a => (a, b)) '' s ∪ s ×ˢ t

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{b : β}


/-- Formula for `sinZeta` as a Dirichlet series in the convergence range, with sum over `ℤ`. -/
theorem hasSum_int_sinZeta (a : ℝ) {s : ℂ} (hs : 1 < re s) :
    HasSum (fun n : ℤ ↦ -I * n.sign * cexp (2 * π * I * a * n) / ↑|n| ^ s / 2) (sinZeta a s)

HasSum (fun n => -Complex.I * ↑n.sign * cexp (2 * ↑π * Complex.I * ↑a * ↑n) / ↑|n| ^ s / 2) (HurwitzZeta.sinZeta (↑a) s)


/-- **Equational criterion for flatness**
[Stacks 00HK](https://stacks.math.columbia.edu/tag/00HK), forward direction.

If $M$ is flat, then every relation $\sum_i f_i x_i = 0$ in $M$ is trivial. -/
theorem isTrivialRelation_of_sum_smul_eq_zero [Flat R M] {ι : Type u} [Fintype ι] {f : ι → R}
    {x : ι → M} (h : ∑ i, f i • x i = 0) : IsTrivialRelation f x

{R M : Type u}
[CommRing R]
[AddCommGroup M]
[Module R M]
[Module.Flat R M]
{ι : Type u}
[Fintype ι]
{f : ι → R}
{x : ι → M}
(h : ∑ i : ι, f i • x i = 0)


theorem star_def' (x : CliffordAlgebra Q) : star x = involute (reverse x)

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}
(x : CliffordAlgebra Q)

star x = CliffordAlgebra.involute (CliffordAlgebra.reverse x)


@[simp]
theorem coe_subtypeₐᵢ (s : AffineSubspace 𝕜 P) [Nonempty s] : ⇑s.subtypeₐᵢ = s.subtype

{𝕜 : Type u_1}
{V : Type u_2}
{P : Type u_10}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
(s : AffineSubspace 𝕜 P)
[Nonempty ↥s]


protected theorem t2Space [T2Space R] : T2Space V

{R : Type u_1}
{V : Type u_2}
[Ring R]
[AddCommGroup V]
[TopologicalSpace V]
[TopologicalSpace R]
[Module R V]
[SeparatingDual R V]
[T2Space R]


lemma pred_min (a b : α) : pred (min a b) = min (pred a) (pred b)

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

Order.pred (min a b) = min (Order.pred a) (Order.pred b)


@[to_additive]
theorem pow_eq_pow_iff_modEq : x ^ n = x ^ m ↔ n ≡ m [MOD orderOf x]

{G : Type u_1}
[LeftCancelMonoid G]
{x : G}
{m n : ℕ}


theorem toCoalgEquiv_toCoalgHom : ((e : A ≃ₐc[R] B) : A →ₗc[R] B) = (e : A →ₐc[R] B)

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
(e : A ≃ₐc[R] B)


lemma condition : f ≫ inl f g = g ≫ inr f g

{S X₁ X₂ : Type u}
(f : S ⟶ X₁)
(g : S ⟶ X₂)

f ≫ CategoryTheory.Limits.Types.Pushout.inl f g = g ≫ CategoryTheory.Limits.Types.Pushout.inr f g


@[simp] theorem zero_iff_nonpos {x : ℝ} : expNegInvGlue x = 0 ↔ x ≤ 0


@[continuity, fun_prop]
theorem symm_continuous_family {ι : Type*} [TopologicalSpace ι]
    {a b : ι → X} (γ : ∀ t : ι, Path (a t) (b t)) (h : Continuous ↿γ) :
    Continuous ↿fun t => (γ t).symm

{X : Type u_1}
[TopologicalSpace X]
{ι : Type u_4}
[TopologicalSpace ι]
{a b : ι → X}
(γ : (t : ι) → Path (a t) (b t))
(h : Continuous ↿γ)


lemma shatterer_mono (h : 𝒜 ⊆ ℬ) : 𝒜.shatterer ⊆ ℬ.shatterer

{α : Type u_1}
[DecidableEq α]
{𝒜 ℬ : Finset (Finset α)}
(h : 𝒜 ⊆ ℬ)


@[simp]
theorem subtypePerm_ofSubtype (f : Perm (Subtype p)) :
    subtypePerm (ofSubtype f) (mem_iff_ofSubtype_apply_mem f) = f

{α : Type u}
{p : α → Prop}
[DecidablePred p]
(f : Equiv.Perm (Subtype p))

(Equiv.Perm.ofSubtype f).subtypePerm ⋯ = f


/-- The definition of `x ⧏ 0` on pre-games, in terms of `≤ 0`. -/
theorem lf_zero_le {x : PGame} : x ⧏ 0 ↔ ∃ j, x.moveRight j ≤ 0


theorem map_subset {l₁ l₂ : List α} (f : α → β) (H : l₁ ⊆ l₂) : map f l₁ ⊆ map f l₂

{α : Type u_1}
{β : Type u_2}
{l₁ l₂ : List α}
(f : α → β)
(H : l₁ ⊆ l₂)


@[measurability]
theorem RCLike.measurable_ofReal : Measurable ((↑) : ℝ → 𝕜)


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

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

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


theorem isRat_ratCast {R : Type*} [DivisionRing R] [CharZero R] : {q : ℚ} → {n : ℤ} → {d : ℕ} →
    IsRat q n d → IsRat (q : R) n d

{R : Type u_1}
[DivisionRing R]
[CharZero R]
{q : ℚ}
{n : ℤ}
{d : ℕ}

Mathlib.Meta.NormNum.IsRat q n d → Mathlib.Meta.NormNum.IsRat (↑q) n d


theorem condCount_union (hs : s.Finite) (htu : Disjoint t u) :
    condCount s (t ∪ u) = condCount s t + condCount s u

{Ω : Type u_1}
[MeasurableSpace Ω]
[MeasurableSingletonClass Ω]
{s t u : Set Ω}
(hs : s.Finite)
(htu : Disjoint t u)

(ProbabilityTheory.condCount s) (t ∪ u) = (ProbabilityTheory.condCount s) t + (ProbabilityTheory.condCount s) u


@[ext]
theorem UnderMorphism.ext {X : T} {U V : Under X} {f g : U ⟶ V} (h : f.right = g.right) :
    f = g

{T : Type u₁}
[CategoryTheory.Category.{v₁, u₁} T]
{X : T}
{U V : CategoryTheory.Under X}
{f g : U ⟶ V}
(h : f.right = g.right)


lemma forget₂_comp_apply {C : Type u} {D : Type u'} [Category.{v} C] [ConcreteCategory.{w} C]
    [Category.{v'} D] [ConcreteCategory.{w} D] [HasForget₂ C D] {X Y Z : C}
    (f : X ⟶ Y) (g : Y ⟶ Z) (x : (forget₂ C D).obj X) :
    ((forget₂ C D).map (f ≫ g) x) =
      (forget₂ C D).map g ((forget₂ C D).map f x)

(x : (CategoryTheory.forget D).obj ((CategoryTheory.forget₂ C D).obj X))

((CategoryTheory.forget₂ C D).map (CategoryTheory.CategoryStruct.comp f g)) x =
  ((CategoryTheory.forget₂ C D).map g) (((CategoryTheory.forget₂ C D).map f) x)


theorem coeff_smul {n : ℕ} {a : R} {f : R[X]} : (a • f).coeff n = a * f.coeff n

{R : Type u_1}
[Semiring R]
{n : ℕ}
{a : R}
{f : R[X]}


theorem epi_of_mono_of_epi_of_mono (hR₁ : R₁.Exact) (hR₂ : R₂.Exact)
    (hR₂' : Mono (R₂.map' 0 1)) (h₀ : Epi (app' φ 1)) (h₁ : Mono (app' φ 2)) :
    Epi (app' φ 0)

{R₁ R₂ : CategoryTheory.ComposableArrows C 2}

(hR₂' : CategoryTheory.Mono (R₂.map' 0 1 ⋯ ⋯))

(h₀ : CategoryTheory.Epi (CategoryTheory.ComposableArrows.app' φ 1 ⋯))

(h₁ : CategoryTheory.Mono (CategoryTheory.ComposableArrows.app' φ 2 ⋯))

CategoryTheory.Epi (CategoryTheory.ComposableArrows.app' φ 0 ⋯)


lemma IsRatCondKernelCDFAux.tendsto_zero_of_antitone (hf : IsRatCondKernelCDFAux f κ ν)
    [IsFiniteKernel ν] (a : α) (seq : ℕ → ℚ) (hseq : Antitone seq)
    (hseq_tendsto : Tendsto seq atTop atBot) :
    ∀ᵐ c ∂(ν a), Tendsto (fun m ↦ f (a, c) (seq m)) atTop (𝓝 0)

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

{f : α × β → ℚ → ℝ}

(hf : ProbabilityTheory.IsRatCondKernelCDFAux f κ ν)

(hseq_tendsto : Filter.Tendsto seq Filter.atTop Filter.atBot)

∀ᵐ (c : β) ∂ν a, Filter.Tendsto (fun m => f (a, c) (seq m)) Filter.atTop (𝓝 0)


@[to_additive] lemma prod_sdiff_lt_prod_sdiff :
    ∏ i ∈ s \ t, f i < ∏ i ∈ t \ s, f i ↔ ∏ i ∈ s, f i < ∏ i ∈ t, f i

{ι : Type u_1}
{M : Type u_4}
[OrderedCancelCommMonoid M]
{f : ι → M}
{s t : Finset ι}
[DecidableEq ι]


/-- A function `f : 𝕜 → E` has `p` as power series expansion at a point `z₀` iff it is the sum of
`p` in a neighborhood of `z₀`. This makes some proofs easier by hiding the fact that
`HasFPowerSeriesAt` depends on `p.radius`. -/
theorem hasFPowerSeriesAt_iff :
    HasFPowerSeriesAt f p z₀ ↔ ∀ᶠ z in 𝓝 0, HasSum (fun n => z ^ n • p.coeff n) (f (z₀ + z))

{𝕜 : Type u_1}
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{p : FormalMultilinearSeries 𝕜 𝕜 E}
{f : 𝕜 → E}
{z₀ : 𝕜}

HasFPowerSeriesAt f p z₀ ↔ ∀ᶠ (z : 𝕜) in 𝓝 0, HasSum (fun n => z ^ n • p.coeff n) (f (z₀ + z))


@[simp]
theorem Finset.card_compl_add_card [DecidableEq α] [Fintype α] (s : Finset α) :
    sᶜ.card + s.card = Fintype.card α

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


/-- The space `Π i : Fin 2, α i` is measurably equivalent to `α 0 × α 1`. -/
@[simps! (config := .asFn)]
def piFinTwo (α : Fin 2 → Type*) [∀ i, MeasurableSpace (α i)] : (∀ i, α i) ≃ᵐ α 0 × α 1

(α : Fin 2 → Type u_8)
[(i : Fin 2) → MeasurableSpace (α i)]

⇑(MeasurableEquiv.piFinTwo α) = fun f => (f 0, f 1)


@[simp]
theorem comp_continuous_iff' (h : X ≃ₜ Y) {f : Y → Z} : Continuous (f ∘ h) ↔ Continuous f

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(h : X ≃ₜ Y)
{f : Y → Z}


theorem mul_le_mul_of_nonpos_of_nonneg' [ExistsAddOfLE α] [PosMulMono α] [MulPosMono α]
    [CovariantClass α α (swap (· + ·)) (· ≤ ·)] [ContravariantClass α α (swap (· + ·)) (· ≤ ·)]
    (hca : c ≤ a) (hbd : b ≤ d) (ha : 0 ≤ a) (hd : d ≤ 0) : a * b ≤ c * d

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

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


theorem stereoInvFun_ne_north_pole (hv : ‖v‖ = 1) (w : (ℝ ∙ v)ᗮ) :
    stereoInvFun hv w ≠ (⟨v, by simp [hv]⟩ : sphere (0 : E) 1)

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
{v : E}
(hv : ‖v‖ = 1)
(w : ↥(Submodule.span ℝ {v})ᗮ)


protected theorem HasBasis.biInter_mem {f : Set α → Set β} (h : HasBasis l p s) (hf : Monotone f) :
    ⋂ t ∈ l, f t = ⋂ (i) (_ : p i), f (s i)

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
{l : Filter α}
{p : ι → Prop}
{s : ι → Set α}
{f : Set α → Set β}
(h : l.HasBasis p s)
(hf : Monotone f)

⋂ t ∈ l, f t = ⋂ i, ⋂ (_ : p i), f (s i)


theorem mem_resolventSet_apply (φ : F) {a : A} {r : R} (h : r ∈ resolventSet R a) :
    r ∈ resolventSet R ((φ : A → B) a)

{F : Type u_1}
{R : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[Ring A]
[Algebra R A]
[Ring B]
[Algebra R B]
[FunLike F A B]
[AlgHomClass F R A B]
(φ : F)
{a : A}
{r : R}
(h : r ∈ resolventSet R a)


@[simp]
theorem edgeSet_top : (⊤ : Subgraph G).edgeSet = G.edgeSet


theorem mem_ae_map_iff {f : α → β} (hf : AEMeasurable f μ) {s : Set β} (hs : MeasurableSet s) :
    s ∈ ae (μ.map f) ↔ f ⁻¹' s ∈ ae μ

{α : Type u_1}
{β : Type u_2}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{f : α → β}
(hf : AEMeasurable f μ)
{s : Set β}
(hs : MeasurableSet s)

s ∈ MeasureTheory.ae (MeasureTheory.Measure.map f μ) ↔ f ⁻¹' s ∈ MeasureTheory.ae μ


@[to_additive]
theorem sum_card_orderOf_eq_card_pow_eq_one [Fintype G] [DecidableEq G] (hn : n ≠ 0) :
    (∑ m ∈ (Finset.range n.succ).filter (· ∣ n),
        (Finset.univ.filter fun x : G => orderOf x = m).card) =
      (Finset.univ.filter fun x : G => x ^ n = 1).card

{G : Type u_1}
[AddMonoid G]
{n : ℕ}
[Fintype G]
[DecidableEq G]
(hn : n ≠ 0)

∑ m ∈ Finset.filter (fun x => x ∣ n) (Finset.range n.succ),
    (Finset.filter (fun x => addOrderOf x = m) Finset.univ).card =
  (Finset.filter (fun x => n • x = 0) Finset.univ).card


@[to_additive]
lemma isSquare_prod {s : Finset ι} [CommMonoid α] (f : ι → α)
    (h : ∀ c ∈ s, IsSquare (f c)) : IsSquare (∏ i ∈ s, f i)

{ι : Type u_1}
{α : Type u_3}
{s : Finset ι}
[AddCommMonoid α]
(f : ι → α)
(h : ∀ c ∈ s, Even (f c))


@[simp]
theorem C_inj : C a = C b ↔ a = b


theorem explicitCokernelDesc_normNoninc {X Y Z : SemiNormedGrp.{u}} {f : X ⟶ Y} {g : Y ⟶ Z}
    {cond : f ≫ g = 0} (hg : g.NormNoninc) : (explicitCokernelDesc cond).NormNoninc

{X Y Z : SemiNormedGrp}
{f : X ⟶ Y}
{g : Y ⟶ Z}
{cond : f ≫ g = 0}
(hg : NormedAddGroupHom.NormNoninc g)


@[simp]
theorem toNat_lift (c : Cardinal.{v}) : toNat (lift.{u, v} c) = toNat c

Cardinal.toNat (Cardinal.lift.{u, v} c) = Cardinal.toNat c


@[to_additive]
theorem pi_eq_bot_iff (H : ∀ i, Subgroup (f i)) : pi Set.univ H = ⊥ ↔ ∀ i, H i = ⊥

{η : Type u_7}
{f : η → Type u_8}
[(i : η) → Group (f i)]
(H : (i : η) → Subgroup (f i))

Subgroup.pi Set.univ H = ⊥ ↔ ∀ (i : η), H i = ⊥


@[simp]
theorem Quotient.eq [r : Setoid α] {x y : α} : Quotient.mk r x = ⟦y⟧ ↔ x ≈ y

⟦x⟧ = ⟦y⟧ ↔ x ≈ y


@[to_additive nnnorm_zsmul_le]
theorem nnnorm_zpow_le_mul_norm (n : ℤ) (a : α) : ‖a ^ n‖₊ ≤ ‖n‖₊ * ‖a‖₊

{α : Type u_1}
[SeminormedCommGroup α]
(n : ℤ)
(a : α)

‖a ^ n‖₊ ≤ ‖n‖₊ * ‖a‖₊


@[simp]
theorem mem_union : a ∈ s ∪ t ↔ a ∈ s ∨ a ∈ t

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


theorem sum_comm {ι' : Type*} (μ : ι → ι' → Measure α) :
    (sum fun n => sum (μ n)) = sum fun m => sum fun n => μ n m

{α : Type u_1}
{ι : Type u_5}
{m0 : MeasurableSpace α}
{ι' : Type u_8}
(μ : ι → ι' → MeasureTheory.Measure α)

(MeasureTheory.Measure.sum fun n => MeasureTheory.Measure.sum (μ n)) =
  MeasureTheory.Measure.sum fun m => MeasureTheory.Measure.sum fun n => μ n m


theorem sup_sup_sup_comm (a b c d : α) : a ⊔ b ⊔ (c ⊔ d) = a ⊔ c ⊔ (b ⊔ d)

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


/-- The unit isomorphism of the
equivalence `triangleOpEquivalence C : (Triangle C)ᵒᵖ ≌ Triangle Cᵒᵖ` . -/
@[simps!]
noncomputable def unitIso : 𝟭 _ ≅ functor C ⋙ inverse C

(X : (CategoryTheory.Pretriangulated.Triangle C)ᵒᵖ)

(CategoryTheory.Pretriangulated.TriangleOpEquivalence.unitIso C).hom.app X =
  ((CategoryTheory.Pretriangulated.Triangle.mk (Opposite.unop X).mor₁ (Opposite.unop X).mor₂
          (CategoryTheory.CategoryStruct.comp
            ((CategoryTheory.Pretriangulated.opShiftFunctorEquivalence C 1).unitIso.inv.app
                (Opposite.op (Opposite.unop X).obj₃)).unop
            ((CategoryTheory.shiftFunctor C 1).map
              (CategoryTheory.CategoryStruct.comp
                ((CategoryTheory.shiftFunctor Cᵒᵖ 1).map (Opposite.unop X).mor₃.op).unop
                ((CategoryTheory.Pretriangulated.opShiftFunctorEquivalence C 1).counitIso.inv.app
                    (Opposite.op (Opposite.unop X).obj₁)).unop)))).homMk
      (Opposite.unop X) (CategoryTheory.CategoryStruct.id (Opposite.unop X).obj₁)
      (CategoryTheory.CategoryStruct.id (Opposite.unop X).obj₂)
      (CategoryTheory.CategoryStruct.id (Opposite.unop X).obj₃) ⋯ ⋯ ⋯).op


/-- A dependent version of `Subsemigroup.closure_induction`.  -/
@[to_additive (attr := elab_as_elim) "A dependent version of `AddSubsemigroup.closure_induction`. "]
theorem closure_induction' (s : Set M) {p : ∀ x, x ∈ closure s → Prop}
    (mem : ∀ (x) (h : x ∈ s), p x (subset_closure h))
    (mul : ∀ x hx y hy, p x hx → p y hy → p (x * y) (mul_mem hx hy)) {x} (hx : x ∈ closure s) :
    p x hx

{p : (x : M) → x ∈ Subsemigroup.closure s → Prop}

(mul :
  ∀ (x : M) (hx : x ∈ Subsemigroup.closure s) (y : M) (hy : y ∈ Subsemigroup.closure s), p x hx → p y hy → p (x * y) ⋯)


theorem Disjoint.union_eq {xs ys : List α} (h : Disjoint xs ys) :
    xs ∪ ys = xs.dedup ++ ys

{α : Type u_1}
[DecidableEq α]
{xs ys : List α}
(h : xs.Disjoint ys)


protected theorem span_apply (i : ι) : (Basis.span hli i : M) = v i

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
{v : ι → M}
[Ring R]
[AddCommGroup M]
[Module R M]
(hli : LinearIndependent R v)
(i : ι)


lemma pmul_assoc [CommMonoidWithZero R] (f₁ f₂ f₃ : ArithmeticFunction R) :
    pmul (pmul f₁ f₂) f₃ = pmul f₁ (pmul f₂ f₃)

{R : Type u_1}
[CommMonoidWithZero R]
(f₁ f₂ f₃ : ArithmeticFunction R)

(f₁.pmul f₂).pmul f₃ = f₁.pmul (f₂.pmul f₃)


theorem apply_mem {s : S} (hs : s ∈ quasispectrum S a) : f s ∈ quasispectrum R a

{R : Type u_3}
{S : Type u_4}
{A : Type u_5}
[Semifield R]
[Field S]
[NonUnitalRing A]
[Module R A]
[Module S A]
[IsScalarTower S A A]
[SMulCommClass S A A]
[Algebra R S]
{a : A}
{f : S → R}
[IsScalarTower R S A]
(h : QuasispectrumRestricts a f)
{s : S}
(hs : s ∈ quasispectrum S a)


theorem isMittagLeffler_iff_subset_range_comp : F.IsMittagLeffler ↔ ∀ j : J, ∃ (i : _) (f : i ⟶ j),
    ∀ ⦃k⦄ (g : k ⟶ i), range (F.map f) ⊆ range (F.map <| g ≫ f)

{J : Type u}
[CategoryTheory.Category.{u_1, u} J]
(F : J ⥤ Type v)
[CategoryTheory.IsCofilteredOrEmpty J]

F.IsMittagLeffler ↔ ∀ (j : J), ∃ i f, ∀ ⦃k : J⦄ (g : k ⟶ i), Set.range (F.map f) ⊆ Set.range (F.map (g ≫ f))


@[to_additive]
theorem smul_inter_ne_empty_iff' {s t : Set α} {x : α} :
    x • s ∩ t ≠ ∅ ↔ ∃ a b, (a ∈ t ∧ b ∈ s) ∧ a / b = x

{α : Type u_2}
[Group α]
{s t : Set α}
{x : α}


theorem Iic_principal (s : Set α) : Iic (𝓟 s) = { l | s ∈ l }


theorem le_mk_iff_exists_set {c : Cardinal} {α : Type u} : c ≤ #α ↔ ∃ p : Set α, #p = c

c ≤ Cardinal.mk α ↔ ∃ p, Cardinal.mk ↑p = c


@[to_additive]
theorem div_left_injective : Function.Injective fun a ↦ a / b


theorem norm_eq_of_norm_add_lt_left {z1 z2 : ℤ_[p]} (h : ‖z1 + z2‖ < ‖z1‖) : ‖z1‖ = ‖z2‖

{p : ℕ}
[Fact (Nat.Prime p)]
{z1 z2 : ℤ_[p]}
(h : ‖z1 + z2‖ < ‖z1‖)


@[simp, rclike_simps, norm_cast]
theorem intCast_im (n : ℤ) : im (n : K) = 0


/-- `x` belongs to the closure of `s` if and only if some ultrafilter
  supported on `s` converges to `x`. -/
theorem mem_closure_iff_ultrafilter :
    x ∈ closure s ↔ ∃ u : Ultrafilter X, s ∈ u ∧ ↑u ≤ 𝓝 x

{X : Type u}
{x : X}
{s : Set X}
[TopologicalSpace X]


theorem coeff_zero_mul_X (φ : MvPowerSeries σ R) (s : σ) : coeff R (0 : σ →₀ ℕ) (φ * X s) = 0

{σ : Type u_1}
{R : Type u_2}
[Semiring R]
(φ : MvPowerSeries σ R)
(s : σ)

(MvPowerSeries.coeff R 0) (φ * MvPowerSeries.X s) = 0


/-- If `C, D` has all colimits of shape `J`, and `G` preserves them, then `preservesColimitIso`
is functorial wrt `F`. -/
@[simps!]
def preservesColimitNatIso : colim ⋙ G ≅ (whiskeringRight J C D).obj G ⋙ colim

(CategoryTheory.preservesColimitNatIso G).inv.app X = (CategoryTheory.preservesColimitIso G X).inv


/--
Turn a monoid object in the opposite category into a comonoid object.
-/
@[simps] def Mon_OpOpToComon_obj' (A : (Mon_ (Cᵒᵖ))) : Comon_ C

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
(A : Mon_ Cᵒᵖ)

(Comon_.Mon_OpOpToComon_obj' C A).comul = A.mul.unop


@[to_additive (attr := simp)]
theorem mulRothNumber_map_mul_right :
    mulRothNumber (s.map <| mulRightEmbedding a) = mulRothNumber s

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

mulRothNumber (Finset.map (mulRightEmbedding a) s) = mulRothNumber s


theorem TendstoLocallyUniformly.comp [TopologicalSpace γ] (h : TendstoLocallyUniformly F f p)
    (g : γ → α) (cg : Continuous g) : TendstoLocallyUniformly (fun n => F n ∘ g) (f ∘ g) p

{α : Type u}
{β : Type v}
{γ : Type w}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{f : α → β}
{p : Filter ι}
[TopologicalSpace α]
[TopologicalSpace γ]
(h : TendstoLocallyUniformly F f p)
(g : γ → α)
(cg : Continuous g)


theorem image_source_inter_eq' (s : Set X) : e '' (e.source ∩ s) = e.target ∩ e.symm ⁻¹' s

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)
(s : Set X)

↑e '' (e.source ∩ s) = e.target ∩ ↑e.symm ⁻¹' s


@[mono]
theorem comap_mono : Monotone (comap f)

{R : Type u}
{L : Type v}
{L' : Type w₂}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieRing L']
[LieAlgebra R L']
{f : L →ₗ⁅R⁆ L'}


theorem Filter.Tendsto.eventually_lt {l : Filter γ} {f g : γ → α} {y z : α} (hf : Tendsto f l (𝓝 y))
    (hg : Tendsto g l (𝓝 z)) (hyz : y < z) : ∀ᶠ x in l, f x < g x

{α : Type u}
{γ : Type w}
[TopologicalSpace α]
[LinearOrder α]
[OrderClosedTopology α]
{l : Filter γ}
{f g : γ → α}
{y z : α}
(hf : Filter.Tendsto f l (𝓝 y))
(hg : Filter.Tendsto g l (𝓝 z))
(hyz : y < z)


@[simp]
theorem finRange_zero : finRange 0 = []


@[to_additive]
theorem div_mem_div : a ∈ s → b ∈ t → a / b ∈ s / t

{α : Type u_2}
[DecidableEq α]
[Sub α]
{s t : Finset α}
{a b : α}


@[simp] lemma ofEpiOfIsIsoOfMono'_g'_τ₃ : (ofEpiOfIsIsoOfMono' φ h).g' ≫ φ.τ₃ = h.g'

CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.RightHomologyData.ofEpiOfIsIsoOfMono' φ h).g' φ.τ₃ =
  h.g'


theorem tail_interleave (s₁ s₂ : Stream' α) : tail (s₁ ⋈ s₂) = s₂ ⋈ tail s₁


/-- Also see `Ideal.isSimpleOrder` for the forward direction as an instance when `R` is a
division (semi)ring.

This result actually holds for all division semirings, but we lack the predicate to state it. -/
theorem isField_iff_isSimpleOrder_ideal : IsField R ↔ IsSimpleOrder (Ideal R)


theorem compl_beattySeq' {r s : ℝ} (hrs : r.IsConjExponent s) :
    {beattySeq' r k | k}ᶜ = {beattySeq s k | k}

{x | ∃ k, beattySeq' r k = x}ᶜ = {x | ∃ k, beattySeq s k = x}


theorem kronecker_one [MulZeroOneClass α] [DecidableEq n] (A : Matrix l m α) :
    A ⊗ₖ (1 : Matrix n n α) = blockDiagonal fun _ => A

{α : Type u_2}
{l : Type u_8}
{m : Type u_9}
{n : Type u_10}
[MulZeroOneClass α]
[DecidableEq n]
(A : Matrix l m α)

Matrix.kroneckerMap (fun x x_1 => x * x_1) A 1 = Matrix.blockDiagonal fun x => A


@[simp] lemma nnnorm_toMul (x) : ‖(toMul x : E)‖₊ = ‖x‖₊

{E : Type u_2}
[NNNorm E]
(x : Additive E)


lemma antivaryOn_iff_forall_smul_nonpos :
    AntivaryOn f g s ↔ ∀ ⦃i⦄, i ∈ s → ∀ ⦃j⦄, j ∈ s → (f j - f i) • (g j - g i) ≤ 0

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedRing α]
[LinearOrderedAddCommGroup β]
[Module α β]
[OrderedSMul α β]
{f : ι → α}
{g : ι → β}
{s : Set ι}

AntivaryOn f g s ↔ ∀ ⦃i : ι⦄, i ∈ s → ∀ ⦃j : ι⦄, j ∈ s → (f j - f i) • (g j - g i) ≤ 0


protected theorem StrictMonoOn.monotoneOn (hf : StrictMonoOn f s) : MonotoneOn f s

{α : Type u}
{β : Type v}
[PartialOrder α]
[Preorder β]
{f : α → β}
{s : Set α}
(hf : StrictMonoOn f s)


@[fun_prop]
theorem Differentiable.differentiableOn (h : Differentiable 𝕜 f) : DifferentiableOn 𝕜 f s

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


theorem inTangentCoordinates_model_space (f : N → H) (g : N → H') (ϕ : N → E →L[𝕜] E') (x₀ : N) :
    inTangentCoordinates I I' f g ϕ x₀ = ϕ

{𝕜 : 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]
(I : ModelWithCorners 𝕜 E H)
{H' : Type u_5}
[TopologicalSpace H']
(I' : ModelWithCorners 𝕜 E' H')
{N : Type u_9}
(f : N → H)
(g : N → H')
(ϕ : N → E →L[𝕜] E')
(x₀ : N)


theorem comp_apply_eq₂ {x : R₂} : σ (σ' x) = x

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ : R₁ →+* R₂}
{σ' : R₂ →+* R₁}
[RingHomInvPair σ σ']
{x : R₂}


theorem Finset.card_eq_of_equiv_fin {s : Finset α} {n : ℕ} (i : s ≃ Fin n) : s.card = n

{α : Type u_1}
{s : Finset α}
{n : ℕ}
(i : { x // x ∈ s } ≃ Fin n)


/-- If a solution has `x > 1`, then `d` is positive. -/
theorem d_pos_of_one_lt_x {a : Solution₁ d} (ha : 1 < a.x) : 0 < d

{d : ℤ}
{a : Pell.Solution₁ d}
(ha : 1 < a.x)


theorem ContMDiffOn.div₀ (hf : ContMDiffOn I' I n f s) (hg : ContMDiffOn I' I n g s)
    (h₀ : ∀ x ∈ s, g x ≠ 0) : ContMDiffOn I' I n (f / g) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[GroupWithZero G]
[SmoothInv₀ I G]
[SmoothMul I G]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_7}
[TopologicalSpace M]
[ChartedSpace H' M]
{f g : M → G}
{s : Set M}
{n : ℕ∞}
(hf : ContMDiffOn I' I n f s)
(hg : ContMDiffOn I' I n g s)
(h₀ : ∀ x ∈ s, g x ≠ 0)


theorem diag_singleton : ({a} : Finset α).diag = {(a, a)}


protected theorem add_lt_add_of_le_of_lt {a b c d : Int} (h₁ : a ≤ b) (h₂ : c < d) :
    a + c < b + d


/-- Compute the total derivative of `f ⋆ g` if `g` is `C^1` with compact support and `f` is locally
integrable. To write down the total derivative as a convolution, we use
`ContinuousLinearMap.precompR`. -/
theorem _root_.HasCompactSupport.hasFDerivAt_convolution_right (hcg : HasCompactSupport g)
    (hf : LocallyIntegrable f μ) (hg : ContDiff 𝕜 1 g) (x₀ : G) :
    HasFDerivAt (f ⋆[L, μ] g) ((f ⋆[L.precompR G, μ] fderiv 𝕜 g) x₀) x₀

(hf : MeasureTheory.LocallyIntegrable f μ)

HasFDerivAt (MeasureTheory.convolution f g L μ)
  (MeasureTheory.convolution f (fderiv 𝕜 g) (ContinuousLinearMap.precompR G L) μ x₀) x₀


theorem forall_eq_of_chain [IsTrans α r] [IsAntisymm α r] (hs : Chain r s) {a b : α} (ha : a ∈ s)
    (hb : b ∈ s) : a = b

{α : Type u_1}
{r : α → α → Prop}
{s : Cycle α}
[IsTrans α r]
[IsAntisymm α r]
(hs : Cycle.Chain r s)
{a b : α}
(ha : a ∈ s)
(hb : b ∈ s)


@[to_additive]
theorem prod_mapDomain_index_inj [CommMonoid N] {f : α → β} {s : α →₀ M} {h : β → M → N}
    (hf : Function.Injective f) : (s.mapDomain f).prod h = s.prod fun a b => h (f a) b

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
{N : Type u_7}
[AddCommMonoid M]
[CommMonoid N]
{f : α → β}
{s : α →₀ M}
{h : β → M → N}
(hf : Function.Injective f)

(Finsupp.mapDomain f s).prod h = s.prod fun a b => h (f a) b


/-- `nsmul` is equal to any other module structure via a cast. -/
-- See note [no_index around OfNat.ofNat]
lemma ofNat_smul_eq_nsmul (n : ℕ) [n.AtLeastTwo] (b : M) :
    (no_index OfNat.ofNat n : R) • b = OfNat.ofNat n • b

(R : Type u_2)
{M : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(n : ℕ)
[n.AtLeastTwo]
(b : M)


@[to_additive]
theorem isometry_inv [PseudoEMetricSpace G] [IsometricSMul G G] [IsometricSMul Gᵐᵒᵖ G] :
    Isometry (Inv.inv : G → G)

{G : Type v}
[AddGroup G]
[PseudoEMetricSpace G]
[IsometricVAdd G G]
[IsometricVAdd Gᵃᵒᵖ G]


theorem range_le_bot_iff (f : M →ₛₗ[τ₁₂] M₂) : range f ≤ ⊥ ↔ f = 0

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_6}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
[RingHomSurjective τ₁₂]
(f : M →ₛₗ[τ₁₂] M₂)


theorem mul_X_sub_intCast_comp {n : ℕ} :
    (p * (X - (n : R[X]))).comp q = p.comp q * (q - n)

{R : Type u}
[Ring R]
{p q : R[X]}
{n : ℕ}

(p * (Polynomial.X - ↑n)).comp q = p.comp q * (q - ↑n)


theorem measurable_extend (hf : MeasurableEmbedding f) {g : α → γ} {g' : β → γ} (hg : Measurable g)
    (hg' : Measurable g') : Measurable (extend f g g')

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{mα : MeasurableSpace α}
[MeasurableSpace β]
[MeasurableSpace γ]
{f : α → β}
(hf : MeasurableEmbedding f)
{g : α → γ}
{g' : β → γ}
(hg : Measurable g)
(hg' : Measurable g')


theorem betaIntegral_scaled (s t : ℂ) {a : ℝ} (ha : 0 < a) :
    ∫ x in (0)..a, (x : ℂ) ^ (s - 1) * ((a : ℂ) - x) ^ (t - 1) =
    (a : ℂ) ^ (s + t - 1) * betaIntegral s t

∫ (x : ℝ) in 0 ..a, ↑x ^ (s - 1) * (↑a - ↑x) ^ (t - 1) = ↑a ^ (s + t - 1) * s.betaIntegral t


theorem ord_card_le (o : Ordinal) : o.card.ord ≤ o


@[simp]
theorem linear_surjective_iff (f : P1 →ᵃ[k] P2) :
    Function.Surjective f.linear ↔ Function.Surjective f

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

Function.Surjective ⇑f.linear ↔ Function.Surjective ⇑f


/-- `slope f a b` is an affine combination of `slope f a (lineMap a b r)` and
`slope f (lineMap a b r) b`. We use `lineMap` to express this property. -/
theorem lineMap_slope_lineMap_slope_lineMap (f : k → PE) (a b r : k) :
    lineMap (slope f (lineMap a b r) b) (slope f a (lineMap a b r)) r = slope f a b

{k : Type u_1}
{E : Type u_2}
{PE : Type u_3}
[Field k]
[AddCommGroup E]
[Module k E]
[AddTorsor E PE]
(f : k → PE)
(a b r : k)

(AffineMap.lineMap (slope f ((AffineMap.lineMap a b) r) b) (slope f a ((AffineMap.lineMap a b) r))) r = slope f a b


/-- This is mostly an auxiliary lemma for `Submodule.rank_sup_add_rank_inf_eq`. -/
theorem rank_add_rank_split (db : V₂ →ₗ[K] V) (eb : V₃ →ₗ[K] V) (cd : V₁ →ₗ[K] V₂)
    (ce : V₁ →ₗ[K] V₃) (hde : ⊤ ≤ LinearMap.range db ⊔ LinearMap.range eb) (hgd : ker cd = ⊥)
    (eq : db.comp cd = eb.comp ce) (eq₂ : ∀ d e, db d = eb e → ∃ c, cd c = d ∧ ce c = e) :
    Module.rank K V + Module.rank K V₁ = Module.rank K V₂ + Module.rank K V₃

(eq₂ : ∀ (d : V₂) (e : V₃), db d = eb e → ∃ c, cd c = d ∧ ce c = e)


@[local instance] theorem instIsAlgClosed : IsAlgClosed (AlgebraicClosureAux k)


theorem image_mono {s t : Set α} (h : s ⊆ t) : f.image s ⊆ f.image t

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


{α : Type u_2}
[DecidableEq α]
[SemilatticeSup α]
{s : Finset α}


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

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

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


theorem exists_pow_lt_factorial (c : ℕ) : ∃ n0 > 1, ∀ n ≥ n0, c ^ n < (n - 1)!


lemma IsLocalizedModule.lift_rank_eq :
    Cardinal.lift.{v} (Module.rank S N) = Cardinal.lift.{v'} (Module.rank R M)

{R : Type u}
(S : Type u')
{M : Type v}
{N : Type v'}
[CommRing R]
[CommRing S]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
[Algebra R S]
[Module S N]
[IsScalarTower R S N]
(p : Submonoid R)
[IsLocalization p S]
(f : M →ₗ[R] N)
[IsLocalizedModule p f]
(hp : p ≤ R⁰)

Cardinal.lift.{v, v'} (Module.rank S N) = Cardinal.lift.{v', v} (Module.rank R M)


@[reassoc (attr := simp)]
lemma sheafComposeIso_hom_fac :
    toSheafify J (P ⋙ F) ≫ (sheafifyComposeIso J F P).hom =
      whiskerRight (toSheafify J P) F

(J : CategoryTheory.GrothendieckTopology C)

CategoryTheory.CategoryStruct.comp (CategoryTheory.toSheafify J (P.comp F))
    (CategoryTheory.sheafifyComposeIso J F P).hom =
  CategoryTheory.whiskerRight (CategoryTheory.toSheafify J P) F


theorem cthickening_eq_iInter_thickening' {δ : ℝ} (δ_nn : 0 ≤ δ) (s : Set ℝ) (hsδ : s ⊆ Ioi δ)
    (hs : ∀ ε, δ < ε → (s ∩ Ioc δ ε).Nonempty) (E : Set α) :
    cthickening δ E = ⋂ ε ∈ s, thickening ε E

(hs : ∀ (ε : ℝ), δ < ε → (s ∩ Set.Ioc δ ε).Nonempty)

Metric.cthickening δ E = ⋂ ε ∈ s, Metric.thickening ε E


theorem mem_sInf {S : Set (Subsemiring R)} {x : R} : x ∈ sInf S ↔ ∀ p ∈ S, x ∈ p

{R : Type u}
[NonAssocSemiring R]
{S : Set (Subsemiring R)}
{x : R}


theorem continuous_parametric_primitive_of_continuous
    {a₀ : ℝ} (hf : Continuous f.uncurry) :
    Continuous fun p : X × ℝ ↦ ∫ t in a₀..p.2, f p.1 t ∂μ

Continuous fun p => ∫ (t : ℝ) in a₀..p.2, f p.1 t ∂μ


@[simp]
lemma inr_comp_binaryCoproductIso_inv_apply (a : C) (x : G.obj a) :
    (binaryCoproductIso F G).inv.app a (.inr x) = (Limits.coprod.inr (X := F)).app a x

(F G : CategoryTheory.Functor C (Type w))

(CategoryTheory.FunctorToTypes.binaryCoproductIso F G).inv.app a (Sum.inr x) = CategoryTheory.Limits.coprod.inr.app a x


/-- A projective presentation of an object `X` consists of an epimorphism `f : P ⟶ X`
from some projective object `P`.
-/
-- Porting note(#5171): was @[nolint has_nonempty_instance]
structure ProjectivePresentation (X : C) where
  p : C
  [projective : Projective p]
  f : p ⟶ X
  [epi : Epi f]

(self : CategoryTheory.ProjectivePresentation X)


theorem positivize?_eq_some (w : positivize? (s, x) = some (s', x')) :
    positivizeConstraint s x = s' ∧ positivizeCoeffs s x = x'

(w : Lean.Omega.positivize? (s, x) = some (s', x'))

Lean.Omega.positivizeConstraint s x = s' ∧ Lean.Omega.positivizeCoeffs s x = x'


@[simp]
lemma LSeries_zero : LSeries 0 = 0


/-- A variant of `incl_lift` with `Z` a terminal object. -/
@[simps!]
def inclLiftToTerminal {D : Type*} [Category D] {Z : D} (F : C ⥤ D) (hZ : Limits.IsTerminal Z) :
    incl ⋙ liftToTerminal F hZ ≅ F

(hZ : CategoryTheory.Limits.IsTerminal Z)

(CategoryTheory.WithTerminal.inclLiftToTerminal F hZ).inv.app X = CategoryTheory.CategoryStruct.id (F.obj X)


@[to_additive (attr := simp)]
lemma MulOpposite.smul_eq_mul_unop [Mul α] {a : αᵐᵒᵖ} {a' : α} : a • a' = a' * a.unop

{α : Type u_4}
[Add α]
{a : αᵃᵒᵖ}
{a' : α}


theorem coeIdeal_pow (I : Ideal R) (n : ℕ) : ↑(I ^ n) = (I : FractionalIdeal S P) ^ n

{R : Type u_1}
[CommRing R]
(S : Submonoid R)
(P : Type u_2)
[CommRing P]
[Algebra R P]
(I : Ideal R)
(n : ℕ)


/-- A seminorm is continuous at `0` if `p.ball 0 r ∈ 𝓝 0` for *all* `r > 0`.
Over a `NontriviallyNormedField` it is actually enough to check that this is true
for *some* `r`, see `Seminorm.continuousAt_zero'`. -/
theorem continuousAt_zero_of_forall [TopologicalSpace E] {p : Seminorm 𝕝 E}
    (hp : ∀ r > 0, p.ball 0 r ∈ (𝓝 0 : Filter E)) :
    ContinuousAt p 0

{𝕝 : Type u_6}
{E : Type u_7}
[SeminormedRing 𝕝]
[AddCommGroup E]
[Module 𝕝 E]
[TopologicalSpace E]
{p : Seminorm 𝕝 E}
(hp : ∀ r > 0, p.ball 0 r ∈ 𝓝 0)


theorem eq {m n : ℕ+} : (m : ℕ) = n → m = n


@[simp]
theorem mem_singleton_iff {a b : α} : a ∈ ({b} : Set α) ↔ a = b


@[simp]
theorem map_eq_bot_iff : I.map f = ⊥ ↔ I ≤ f.ker

{R : Type u}
{L : Type v}
{L' : Type w₂}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieRing L']
[LieAlgebra R L']
{f : L →ₗ⁅R⁆ L'}
{I : LieIdeal R L}


@[simp]
theorem dirac_apply [MeasurableSingletonClass α] (a : α) (s : Set α) :
    dirac a s = s.indicator 1 a

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

(MeasureTheory.Measure.dirac a) s = s.indicator 1 a


@[simp]
theorem ascPochhammer_one : ascPochhammer S 1 = X


lemma StrictAntiOn.mapsTo_Ioi (h : StrictAntiOn f (Ici a)) : MapsTo f (Ioi a) (Iio (f a))

{α : Type u_1}
{β : Type u_2}
{f : α → β}
[Preorder α]
[Preorder β]
{a : α}
(h : StrictAntiOn f (Set.Ici a))

Set.MapsTo f (Set.Ioi a) (Set.Iio (f a))


theorem mdifferentiableAt_fst {x : M × M'} : MDifferentiableAt (I.prod I') I Prod.fst x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
(I' : ModelWithCorners 𝕜 E' H')
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
[SmoothManifoldWithCorners I' M']
{x : M × M'}


/-- The opposite `ShortComplex` in `Cᵒᵖ` associated to a short complex in `C`. -/
@[simps]
def op : ShortComplex Cᵒᵖ


theorem _root_.Function.Periodic.map_mod_nat {α : Type*} {f : ℕ → α} {a : ℕ} (hf : Periodic f a) :
    ∀ n, f (n % a) = f n

{α : Type u_1}
{f : ℕ → α}
{a : ℕ}
(hf : Function.Periodic f a)
(n : ℕ)


theorem _root_.Set.Infinite.not_bddBelow {s : Set α} : s.Infinite → ¬BddBelow s

{α : Type u_2}
[Preorder α]
[LocallyFiniteOrderTop α]
{s : Set α}


/-- If `x` is an element of a subgroup `s` of a seminormed group `E`, its norm in `s` is equal to
its norm in `E`. -/
@[to_additive (attr := simp) "If `x` is an element of an additive subgroup `s` of a seminormed
additive group `E`, its norm in `s` is equal to its norm in `E`."]
theorem coe_norm (x : s) : ‖x‖ = ‖(x : E)‖

{E : Type u_6}
[SeminormedGroup E]
{S : Type u_9}
[SetLike S E]
[SubgroupClass S E]
(s : S)
(x : ↥s)


theorem derivWithin_finset_prod (hxs : UniqueDiffWithinAt 𝕜 s x)
    (hf : ∀ i ∈ u, DifferentiableWithinAt 𝕜 (f i) s x) :
    derivWithin (∏ i ∈ u, f i ·) s x =
      ∑ i ∈ u, (∏ j ∈ u.erase i, f j x) • derivWithin (f i) s x

{f : ι → 𝕜 → 𝔸'}

derivWithin (fun x => ∏ i ∈ u, f i x) s x = ∑ i ∈ u, (∏ j ∈ u.erase i, f j x) • derivWithin (f i) s x


theorem pow_subst {α} [CommRing α] {n e1 t1 k l : α} {e2 : ℕ}
    (h1 : n * e1 = t1) (h2 : l * n ^ e2 = k) : k * (e1 ^ e2) = l * t1 ^ e2

{α : Type u_1}
[CommRing α]
{n e1 t1 k l : α}
{e2 : ℕ}
(h1 : n * e1 = t1)
(h2 : l * n ^ e2 = k)


theorem measurableSet_of_null [μ.IsComplete] (hs : μ s = 0) : MeasurableSet s

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
[μ.IsComplete]
(hs : μ s = 0)


@[simp, rclike_simps]
theorem conj_I : conj (I : K) = -I


theorem isBoundedBilinearMap_mul : IsBoundedBilinearMap 𝕜 fun p : 𝕜 × 𝕜 => p.1 * p.2

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]

IsBoundedBilinearMap 𝕜 fun p => p.1 * p.2


theorem IsGLB.csInf_eq (H : IsGLB s a) (ne : s.Nonempty) : sInf s = a

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


theorem contDiffWithinAt_inter' (h : t ∈ 𝓝[s] x) :
    ContDiffWithinAt 𝕜 n f (s ∩ t) x ↔ ContDiffWithinAt 𝕜 n f s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s t : Set E}
{f : E → F}
{x : E}
{n : ℕ∞}
(h : t ∈ 𝓝[s] x)


@[simp]
theorem Basis.det_map (b : Basis ι R M) (f : M ≃ₗ[R] M') (v : ι → M') :
    (b.map f).det v = b.det (f.symm ∘ v)

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{M' : Type u_3}
[AddCommGroup M']
[Module R M']
{ι : Type u_4}
[DecidableEq ι]
[Fintype ι]
(b : Basis ι R M)
(f : M ≃ₗ[R] M')
(v : ι → M')


lemma iterate_eq_id (hf : Involutive f) (hne : f ≠ id) : f^[n] = id ↔ Even n

{α : Type u_5}
{f : α → α}
{n : ℕ}
(hf : Function.Involutive f)
(hne : f ≠ id)


@[to_additive]
theorem union_smul [DecidableEq α] : (s₁ ∪ s₂) • t = s₁ • t ∪ s₂ • t

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[VAdd α β]
{s₁ s₂ : Finset α}
{t : Finset β}
[DecidableEq α]


/-- For an injective function `f`, inverse images of finite sets are finite. See also
`Filter.comap_cofinite_le` and `Function.Injective.comap_cofinite_eq`. -/
theorem Function.Injective.tendsto_cofinite {f : α → β} (hf : Injective f) :
    Tendsto f cofinite cofinite

{α : Type u_2}
{β : Type u_3}
{f : α → β}
(hf : Function.Injective f)

Filter.Tendsto f Filter.cofinite Filter.cofinite


lemma const (x : β) : IsCauSeq abv fun _ ↦ x

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
(x : β)


@[to_additive]
theorem stronglyMeasurable_one {α β} {_ : MeasurableSpace α} [TopologicalSpace β] [One β] :
    StronglyMeasurable (1 : α → β)

∀ {x : MeasurableSpace α} [inst : TopologicalSpace β] [inst_1 : One β], MeasureTheory.StronglyMeasurable 1


/-- Extensionality. Since `MulChar`s always take the value zero on non-units, it is sufficient
to compare the values on units. -/
@[ext]
theorem ext {χ χ' : MulChar R R'} (h : ∀ a : Rˣ, χ a = χ' a) : χ = χ'

{R : Type u_1}
[CommMonoid R]
{R' : Type u_2}
[CommMonoidWithZero R']
{χ χ' : MulChar R R'}
(h : ∀ (a : Rˣ), χ ↑a = χ' ↑a)


/-- If there is a linear map `f : A →ₗ[R] B` that preserves `1`, then `algebraMap R B r` is
a unit when `algebraMap R A r` is. -/
lemma IsUnit.algebraMap_of_algebraMap (f : A →ₗ[R] B) (hf : f 1 = 1) {r : R}
    (h : IsUnit (algebraMap R A r)) : IsUnit (algebraMap R B r)

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(f : A →ₗ[R] B)
(hf : f 1 = 1)
{r : R}
(h : IsUnit ((algebraMap R A) r))


lemma torsion_int {G} [AddCommGroup G] :
    (torsion ℤ G).toAddSubgroup = AddCommGroup.torsion G

(Submodule.torsion ℤ G).toAddSubgroup = AddCommGroup.torsion G


theorem mem_of_mem_dropn {s : WSeq α} {a} : ∀ {n}, a ∈ drop s n → a ∈ s

{α : Type u}
{s : Stream'.WSeq α}
{a : α}
{n : ℕ}


@[simp]
theorem inductionOn_cons {C : ∀ {n : ℕ}, Vector α n → Sort*} {n : ℕ} (x : α) (v : Vector α n)
    (nil : C nil) (cons : ∀ {n : ℕ} {x : α} {w : Vector α n}, C w → C (x ::ᵥ w)) :
    (x ::ᵥ v).inductionOn nil cons = cons (v.inductionOn nil cons : C v)

{C : {n : ℕ} → Mathlib.Vector α n → Sort u_2}

(cons : {n : ℕ} → {x : α} → {w : Mathlib.Vector α n} → C w → C (x ::ᵥ w))

((x ::ᵥ v).inductionOn nil fun {n} {x} {w} => cons) = cons (v.inductionOn nil fun {n} {x} {w} => cons)


lemma ExactAt.of_iso (hK : K.ExactAt i) {L : HomologicalComplex C c} (e : K ≅ L) :
    L.ExactAt i


@[simp high]
theorem comp_id_id (B : BilinForm R M) : B.comp LinearMap.id LinearMap.id = B

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


@[simp]
theorem compMeasurePreserving_toGerm [MeasurableSpace β] {f : α → β} {ν}
    (g : β →ₘ[ν] γ) (hf : MeasurePreserving f μ ν) :
    (g.compMeasurePreserving f hf).toGerm =
      g.toGerm.compTendsto f hf.quasiMeasurePreserving.tendsto_ae

(hf : MeasureTheory.MeasurePreserving f μ ν)

(g.compMeasurePreserving f hf).toGerm = g.toGerm.compTendsto f ⋯


lemma iInf_sUnion (S : Set (Set α)) (f : α → β) :
    (⨅ x ∈ ⋃₀ S, f x) = ⨅ (s ∈ S) (x ∈ s), f x

{α : Type u_1}
{β : Type u_2}
[CompleteLattice β]
(S : Set (Set α))
(f : α → β)


theorem kstar_def_nonempty (l : Language α) :
    l∗ = { x | ∃ S : List (List α), x = S.join ∧ ∀ y ∈ S, y ∈ l ∧ y ≠ [] }

l∗ = {x | ∃ S, x = S.join ∧ ∀ y ∈ S, y ∈ l ∧ y ≠ []}


lemma yonedaEquiv_comp {X : C} {F G : Cᵒᵖ ⥤ Type v₁} (α : yoneda.obj X ⟶ F) (β : F ⟶ G) :
    yonedaEquiv (α ≫ β) = β.app _ (yonedaEquiv α)

{F G : CategoryTheory.Functor Cᵒᵖ (Type v₁)}

CategoryTheory.yonedaEquiv (CategoryTheory.CategoryStruct.comp α β) =
  β.app (Opposite.op X) (CategoryTheory.yonedaEquiv α)


theorem inner_smul_left (x y : E) (r : 𝕜) : ⟪r • x, y⟫ = r† * ⟪x, y⟫

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(x y : E)
(r : 𝕜)

⟪r • x, y⟫_𝕜 = (starRingEnd 𝕜) r * ⟪x, y⟫_𝕜


theorem ContDiffOn.div_const {f : E → 𝕜'} {n} (hf : ContDiffOn 𝕜 n f s) (c : 𝕜') :
    ContDiffOn 𝕜 n (fun x => f x / c) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{s : Set E}
{𝕜' : Type u_6}
[NormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{f : E → 𝕜'}
{n : ℕ∞}
(hf : ContDiffOn 𝕜 n f s)
(c : 𝕜')


theorem inv_def (z : K) : z⁻¹ = conj z * ((‖z‖ ^ 2)⁻¹ : ℝ)


theorem Icc_eq : Icc f g = (f.support ∪ g.support).finsupp (f.rangeIcc g)

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

Finset.Icc f g = (f.support ∪ g.support).finsupp ⇑(f.rangeIcc g)


@[simp]
lemma integrable_const_add_iff [IsFiniteMeasure μ] {f : α → β} {c : β} :
    Integrable (fun x ↦ c + f x) μ ↔ Integrable f μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
[MeasureTheory.IsFiniteMeasure μ]
{f : α → β}
{c : β}

MeasureTheory.Integrable (fun x => c + f x) μ ↔ MeasureTheory.Integrable f μ


@[simp]
theorem sumCongr_swap_refl {α β : Sort _} [DecidableEq α] [DecidableEq β] (i j : α) :
    Equiv.Perm.sumCongr (Equiv.swap i j) (Equiv.refl β) = Equiv.swap (Sum.inl i) (Sum.inl j)

{α : Type u_1}
{β : Type u_2}
[DecidableEq α]
[DecidableEq β]
(i j : α)

(Equiv.swap i j).sumCongr (Equiv.refl β) = Equiv.swap (Sum.inl i) (Sum.inl j)


/-- A splitting for a short complex `S` consists of the data of a retraction `r : X₂ ⟶ X₁`
of `S.f` and section `s : X₃ ⟶ X₂` of `S.g` which satisfy `r ≫ S.f + S.g ≫ s = 𝟙 _` -/
structure Splitting (S : ShortComplex C) where
  /-- a retraction of `S.f` -/
  r : S.X₂ ⟶ S.X₁
  /-- a section of `S.g` -/
  s : S.X₃ ⟶ S.X₂
  /-- the condition that `r` is a retraction of `S.f` -/
  f_r : S.f ≫ r = 𝟙 _ := by aesop_cat
  /-- the condition that `s` is a section of `S.g` -/
  s_g : s ≫ S.g = 𝟙 _ := by aesop_cat
  /-- the compatibility between the given section and retraction -/
  id : r ≫ S.f + S.g ≫ s = 𝟙 _ := by aesop_cat

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{S : CategoryTheory.ShortComplex C}
(self : S.Splitting)

CategoryTheory.CategoryStruct.comp self.r S.f + CategoryTheory.CategoryStruct.comp S.g self.s =
  CategoryTheory.CategoryStruct.id S.X₂


@[simp] lemma latticeClosure_eq_self : latticeClosure s = s ↔ IsSublattice s


theorem IsRelPrime.dvd_of_dvd_mul_right_of_isPrimal (H1 : IsRelPrime x z) (H2 : x ∣ y * z)
    (h : IsPrimal x) : x ∣ y

{α : Type u_1}
[CommMonoid α]
{x y z : α}
(H1 : IsRelPrime x z)
(H2 : x ∣ y * z)
(h : IsPrimal x)


lemma congr_φH {γ₁ γ₂ : LeftHomologyMapData φ h₁ h₂} (eq : γ₁ = γ₂) : γ₁.φH = γ₂.φH

{γ₁ γ₂ : CategoryTheory.ShortComplex.LeftHomologyMapData φ h₁ h₂}

γ₁.φH = γ₂.φH


theorem transnumAuxSeq_zero : f.transnumAuxSeq 0 = f 0


/-- `Int.clog b` and `zpow b` (almost) form a Galois connection. -/
theorem zpow_lt_iff_lt_clog {b : ℕ} (hb : 1 < b) {x : ℤ} {r : R} (hr : 0 < r) :
    (b : R) ^ x < r ↔ x < clog b r

{R : Type u_1}
[LinearOrderedSemifield R]
[FloorSemiring R]
{b : ℕ}
(hb : 1 < b)
{x : ℤ}
{r : R}
(hr : 0 < r)


@[simp]
theorem restrictScalars.smul_def {R : Type u₁} {S : Type u₂} [Ring R] [Ring S] (f : R →+* S)
    {M : ModuleCat.{v} S} (r : R) (m : (restrictScalars f).obj M) : r • m = (f r • m : M)

(m : ↑((ModuleCat.restrictScalars f).obj M))


/-- `NonarchAddGroupNormClass F α` states that `F` is a type of nonarchimedean norms on the
additive group `α`.

You should extend this class when you extend `NonarchAddGroupNorm`. -/
class NonarchAddGroupNormClass (F : Type*) (α : outParam Type*) [AddGroup α] [FunLike F α ℝ]
    extends NonarchAddGroupSeminormClass F α : Prop where
  /-- If the image under the norm is zero, then the argument is zero. -/
  protected eq_zero_of_map_eq_zero (f : F) {a : α} : f a = 0 → a = 0

{F : Type u_7}
{α : outParam (Type u_8)}
[AddGroup α]
[FunLike F α ℝ]
[self : NonarchAddGroupNormClass F α]
(f : F)
{a : α}


theorem le_fold_min : c ≤ s.fold min b f ↔ c ≤ b ∧ ∀ x ∈ s, c ≤ f x

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{b : β}
{s : Finset α}
[LinearOrder β]
(c : β)

c ≤ Finset.fold min b f s ↔ c ≤ b ∧ ∀ x ∈ s, c ≤ f x


@[simp] lemma natCast_self (n : ℕ) [NeZero n] : (n : Fin n) = 0


@[to_additive (attr := simp)]
theorem fromLeftInv_eq_inv (x : S.leftInv) : (S.fromLeftInv x : M) = (x : M)⁻¹

{M : Type u_1}
[AddGroup M]
(S : AddSubmonoid M)
(x : ↥S.leftNeg)


/-- A structure that has zero and pow is reduced if it has no nonzero nilpotent elements. -/
@[mk_iff]
class IsReduced (R : Type*) [Zero R] [Pow R ℕ] : Prop where
  /-- A reduced structure has no nonzero nilpotent elements. -/
  eq_zero : ∀ x : R, IsNilpotent x → x = 0

IsReduced R ↔ ∀ (x : R), IsNilpotent x → x = 0


@[simp]
-- Porting note: `simp`-normal form of `coe_comp_lattice_hom`
theorem coe_comp_lattice_hom' (f : BoundedLatticeHom β γ) (g : BoundedLatticeHom α β) :
    (⟨(f : SupHom β γ).comp g, map_inf (f.comp g)⟩ : LatticeHom α γ) =
      (f : LatticeHom β γ).comp g

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Lattice α]
[Lattice β]
[Lattice γ]
[BoundedOrder α]
[BoundedOrder β]
[BoundedOrder γ]
(f : BoundedLatticeHom β γ)
(g : BoundedLatticeHom α β)

{ toSupHom := { toFun := ⇑f, map_sup' := ⋯ }.comp { toFun := ⇑g, map_sup' := ⋯ }, map_inf' := ⋯ } =
  { toFun := ⇑f, map_sup' := ⋯, map_inf' := ⋯ }.comp { toFun := ⇑g, map_sup' := ⋯, map_inf' := ⋯ }


/-- Multiplication by a nonzero element `a` on the right
as a `DilationEquiv` of a normed division ring. -/
@[simps!]
def DilationEquiv.mulRight (a : α) (ha : a ≠ 0) : α ≃ᵈ α

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

(DilationEquiv.mulRight a ha).symm x = x * a⁻¹


@[to_additive (attr := simp)]
theorem coe_singletonOneHom : (singletonOneHom : α → Finset α) = singleton


/-- The `v`-adic valuation of `1 : R` equals 1. -/
theorem intValuation.map_one' : v.intValuationDef 1 = 1

(v : IsDedekindDomain.HeightOneSpectrum R)


@[simp]
theorem refl_apply (x : M) : refl L M x = x

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
(x : M)

(FirstOrder.Language.Embedding.refl L M) x = x


theorem card_Ioo_of_lt (h : a < b) : ((Ioo a b).card : ℤ) = b - a - 1


/-- The unit isomorphism of the auto-equivalence of categories `triangleRotation C` of
`Triangle C` given by the rotation of triangles. -/
@[simps!]
def rotCompInvRot : 𝟭 (Triangle C) ≅ rotate C ⋙ invRotate C

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

(X : CategoryTheory.Pretriangulated.Triangle C)

(CategoryTheory.Pretriangulated.rotCompInvRot.hom.app X).hom₁ =
  (CategoryTheory.shiftFunctorCompIsoId C 1 (-1) ⋯).inv.app X.obj₁