@[simp, mfld_simps, nolint simpNF]
theorem modelProd_range_prod_id {H : Type*} {H' : Type*} {α : Type*} (f : H → α) :
    (range fun p : ModelProd H H' ↦ (f p.1, p.2)) = range f ×ˢ (univ : Set H')

{H : Type u_5}
{H' : Type u_6}
{α : Type u_7}
(f : H → α)

(Set.range fun p => (f p.1, p.2)) = Set.range f ×ˢ Set.univ


theorem measurableSpace_le_of_countable [Countable ι] (hτ : IsStoppingTime f τ) :
    hτ.measurableSpace ≤ m

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[Preorder ι]
{f : MeasureTheory.Filtration ι m}
{τ : Ω → ι}
[Countable ι]
(hτ : MeasureTheory.IsStoppingTime f τ)


theorem toSpanNonzeroSingleton_one :
    LinearEquiv.toSpanNonzeroSingleton R M x h 1 =
      (⟨x, Submodule.mem_span_singleton_self x⟩ : R ∙ x)

(R : Type u_1)
(M : Type u_4)
[Ring R]
[AddCommGroup M]
[Module R M]
[NoZeroSMulDivisors R M]
(x : M)
(h : x ≠ 0)

(LinearEquiv.toSpanNonzeroSingleton R M x h) 1 = ⟨x, ⋯⟩


/-- `f` is Lipschitz iff it is Lipschitz on the entire space. -/
@[simp] lemma lipschitzOnWith_univ : LipschitzOnWith K f univ ↔ LipschitzWith K f

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{K : ℝ≥0}
{f : α → β}

LipschitzOnWith K f Set.univ ↔ LipschitzWith K f


theorem indep_iff_forall_indepSet (μ : Measure Ω) :
    Indep m₁ m₂ μ ↔ ∀ s t, MeasurableSet[m₁] s → MeasurableSet[m₂] t → IndepSet s t μ

{Ω : Type u_1}
{m₁ m₂ _mΩ : MeasurableSpace Ω}
(μ : MeasureTheory.Measure Ω)

ProbabilityTheory.Indep m₁ m₂ μ ↔ ∀ (s t : Set Ω), MeasurableSet s → MeasurableSet t → ProbabilityTheory.IndepSet s t μ


/-- The union of two sets is totally bounded
if and only if each of the two sets is totally bounded.-/
@[simp]
lemma totallyBounded_union {s t : Set α} :
    TotallyBounded (s ∪ t) ↔ TotallyBounded s ∧ TotallyBounded t

{α : Type u}
[uniformSpace : UniformSpace α]
{s t : Set α}


/-- The sum over the values of the trivial additive character is the cardinality of the source. -/
theorem sum_eq_card_of_eq_one {ψ : AddChar R R'} (hψ : ψ = 1) :
    ∑ a, ψ a = Fintype.card R

{R : Type u_1}
[AddGroup R]
[Fintype R]
{R' : Type u_2}
[CommRing R']
{ψ : AddChar R R'}
(hψ : ψ = 1)


@[simp]
theorem domRestrict'_apply (f : M →ₗ[R] M₂) (p : Submodule R M) (x : p) :
    domRestrict' p f x = f x

{R : Type u_1}
{M : Type u_5}
{M₂ : Type u_7}
[CommSemiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]
(f : M →ₗ[R] M₂)
(p : Submodule R M)
(x : ↥p)


theorem isCompact_iff_ultrafilter_le_nhds' :
    IsCompact s ↔ ∀ f : Ultrafilter X, s ∈ f → ∃ x ∈ s, ↑f ≤ 𝓝 x

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

IsCompact s ↔ ∀ (f : Ultrafilter X), s ∈ f → ∃ x ∈ s, ↑f ≤ 𝓝 x


theorem LocallyConvexSpace.ofBasisZero {ι : Type*} (b : ι → Set E) (p : ι → Prop)
    (hbasis : (𝓝 0).HasBasis p b) (hconvex : ∀ i, p i → Convex 𝕜 (b i)) :
    LocallyConvexSpace 𝕜 E

(hconvex : ∀ (i : ι), p i → Convex 𝕜 (b i))


@[simp]
theorem dualQuotEquivDualAnnihilator_symm_apply_mk (W : Submodule R M) (φ : W.dualAnnihilator)
    (x : M) : (dualQuotEquivDualAnnihilator W).symm φ (Quotient.mk x) = φ x

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(W : Submodule R M)
(φ : ↥W.dualAnnihilator)
(x : M)

(W.dualQuotEquivDualAnnihilator.symm φ) (Submodule.Quotient.mk x) = φ x


/-- Homotopy between morphisms of short complexes is compatible with composition. -/
@[simps!]
def comp (h : Homotopy φ₁ φ₂) {ψ₁ ψ₂ : S₂ ⟶ S₃} (h' : Homotopy ψ₁ ψ₂) :
    Homotopy (φ₁ ≫ ψ₁) (φ₂ ≫ ψ₂)

{S₁ S₂ S₃ : CategoryTheory.ShortComplex C}

{φ₁ φ₂ : S₁ ⟶ S₂}

(h : CategoryTheory.ShortComplex.Homotopy φ₁ φ₂)

{ψ₁ ψ₂ : S₂ ⟶ S₃}

(h' : CategoryTheory.ShortComplex.Homotopy ψ₁ ψ₂)

(h.comp h').h₀ = CategoryTheory.CategoryStruct.comp h.h₀ ψ₁.τ₁ + CategoryTheory.CategoryStruct.comp φ₂.τ₁ h'.h₀


/-- The forgetful functor from the category of based functors `𝒳 ⥤ᵇ 𝒴` to the category of
functors of underlying categories, `𝒳.obj ⥤ 𝒴.obj`. -/
@[simps]
def forgetful (𝒳 : BasedCategory.{v₂, u₂} 𝒮) (𝒴 : BasedCategory.{v₃, u₃} 𝒮) :
    (𝒳 ⥤ᵇ 𝒴) ⥤ (𝒳.obj ⥤ 𝒴.obj)

{𝒮 : Type u₁}
[CategoryTheory.Category.{v₁, u₁} 𝒮]
(𝒳 : CategoryTheory.BasedCategory 𝒮)
(𝒴 : CategoryTheory.BasedCategory 𝒮)
(F : CategoryTheory.BasedFunctor 𝒳 𝒴)

(CategoryTheory.BasedNatTrans.forgetful 𝒳 𝒴).obj F = F.toFunctor


@[simp]
theorem coeFn_ofIsClosedGraph (hg : IsClosed (g.graph : Set <| E × F)) :
    ⇑(ContinuousLinearMap.ofIsClosedGraph hg) = g

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace E]
{F : Type u_5}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{g : E →ₗ[𝕜] F}
(hg : IsClosed ↑g.graph)

⇑(ContinuousLinearMap.ofIsClosedGraph hg) = ⇑g


/-- If a sigma-algebra is generated by a set of sets `s` with cardinality at most the continuum,
then the sigma algebra has the same cardinality bound. -/
theorem cardinal_generateMeasurable_le_continuum {s : Set (Set α)} (hs : #s ≤ 𝔠) :
    #{ t | GenerateMeasurable s t } ≤ 𝔠

{α : Type u}
{s : Set (Set α)}
(hs : #↑s ≤ 𝔠)

#↑{t | MeasurableSpace.GenerateMeasurable s t} ≤ 𝔠


@[simp]
theorem unsym_neg [Neg α] (a : αˢʸᵐ) : unsym (-a) = -unsym a


@[simp] theorem mk_eq_top_iff {N : Submodule R M} {h} :
    (⟨N, h⟩ : LieSubmodule R L M) = ⊤ ↔ N = ⊤

{h : ∀ {x : L} {m : M}, m ∈ N.carrier → ⁅x, m⁆ ∈ N.carrier}

{ toSubmodule := N, lie_mem := h } = ⊤ ↔ N = ⊤


theorem HasFDerivAt.finset_prod [DecidableEq ι] {x : E}
    (hg : ∀ i ∈ u, HasFDerivAt (g i) (g' i) x) :
    HasFDerivAt (∏ i ∈ u, g i ·) (∑ i ∈ u, (∏ j ∈ u.erase i, g j x) • g' i) x

HasFDerivAt (fun x => ∏ i ∈ u, g i x) (∑ i ∈ u, (∏ j ∈ u.erase i, g j x) • g' i) x


theorem symm_image_eq (h : e.IsImage s t) : e.symm '' (e.target ∩ t) = e.source ∩ s

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

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


@[simp]
theorem limit.cone_π {F : J ⥤ C} [HasLimit F] : (limit.cone F).π.app = limit.π _

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{F : J ⥤ C}
[CategoryTheory.Limits.HasLimit F]

(CategoryTheory.Limits.limit.cone F).π.app = CategoryTheory.Limits.limit.π F


theorem map_measurableEquiv_injective (e : α ≃ᵐ β) : Injective (Measure.map e)

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
(e : α ≃ᵐ β)


/-- A bicategory is called `Strict` if the left unitors, the right unitors, and the associators are
isomorphisms given by equalities.
-/
class Bicategory.Strict : Prop where
  /-- Identity morphisms are left identities for composition. -/
  id_comp : ∀ {a b : B} (f : a ⟶ b), 𝟙 a ≫ f = f := by aesop_cat
  /-- Identity morphisms are right identities for composition. -/
  comp_id : ∀ {a b : B} (f : a ⟶ b), f ≫ 𝟙 b = f := by aesop_cat
  /-- Composition in a bicategory is associative. -/
  assoc : ∀ {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d), (f ≫ g) ≫ h = f ≫ g ≫ h := by
    aesop_cat
  /-- The left unitors are given by equalities -/
  leftUnitor_eqToIso : ∀ {a b : B} (f : a ⟶ b), λ_ f = eqToIso (id_comp f) := by aesop_cat
  /-- The right unitors are given by equalities -/
  rightUnitor_eqToIso : ∀ {a b : B} (f : a ⟶ b), ρ_ f = eqToIso (comp_id f) := by aesop_cat
  /-- The associators are given by equalities -/
  associator_eqToIso :
    ∀ {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d), α_ f g h = eqToIso (assoc f g h) := by
    aesop_cat

[self : CategoryTheory.Bicategory.Strict B]

CategoryTheory.Bicategory.associator f g h = CategoryTheory.eqToIso ⋯


/-- Characterization of the boundedness of the range of a function -/
theorem isBounded_range_iff {f : β → α} : IsBounded (range f) ↔ ∃ C, ∀ x y, dist (f x) (f y) ≤ C

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

Bornology.IsBounded (Set.range f) ↔ ∃ C, ∀ (x y : β), dist (f x) (f y) ≤ C


theorem contMDiffAt_iff_target {x : M} :
    ContMDiffAt I I' n f x ↔
      ContinuousAt f x ∧ ContMDiffAt I 𝓘(𝕜, E') n (extChartAt I' (f x) ∘ f) 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 : M → M'}
{n : ℕ∞}
{x : M}

ContMDiffAt I I' n f x ↔ ContinuousAt f x ∧ ContMDiffAt I 𝓘(𝕜, E') n (↑(extChartAt I' (f x)) ∘ f) x


/-- An element of a `CancelMonoidWithZero` fixed by right multiplication by an element other
than one must be zero. -/
theorem eq_zero_of_mul_eq_self_right (h₁ : b ≠ 1) (h₂ : a * b = a) : a = 0

{M₀ : Type u_2}
[CancelMonoidWithZero M₀]
{a b : M₀}
(h₁ : b ≠ 1)
(h₂ : a * b = a)


/-- A version of `Subsingleton` with few instances. It should fail fast. -/
class FastSubsingleton (α : Sort u) : Prop where
  /-- The subsingleton instance. -/
  [inst : Subsingleton α]

{α : Sort u}
[self : Lean.Meta.FastSubsingleton α]


/-- `AEEqFun.toGerm` as a `MonoidHom`. -/
@[to_additive (attr := simps) "`AEEqFun.toGerm` as an `AddMonoidHom`."]
def toGermMonoidHom : (α →ₘ[μ] γ) →* (ae μ).Germ γ

{α : Type u_1}
{γ : Type u_3}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[TopologicalSpace γ]
[Monoid γ]
[ContinuousMul γ]
(f : α →ₘ[μ] γ)

MeasureTheory.AEEqFun.toGermMonoidHom f = f.toGerm


/-- If `F` is cover-preserving and compatible-preserving,
then `F` is a continuous functor.

This result is basically <https://stacks.math.columbia.edu/tag/00WW>.
-/
lemma Functor.isContinuous_of_coverPreserving (hF₁ : CompatiblePreserving.{w} K F)
    (hF₂ : CoverPreserving J K F) : Functor.IsContinuous.{w} F J K

{J : CategoryTheory.GrothendieckTopology C}

{K : CategoryTheory.GrothendieckTopology D}

(hF₁ : CategoryTheory.CompatiblePreserving K F)

(hF₂ : CategoryTheory.CoverPreserving J K F)


theorem image_comp (f : β → γ) (g : α → β) (a : Set α) : f ∘ g '' a = f '' (g '' a)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : β → γ)
(g : α → β)
(a : Set α)


theorem Antitone.locallyIntegrable [IsLocallyFiniteMeasure μ] (hanti : Antitone f) :
    LocallyIntegrable f μ


theorem zero_ne_one' [NeZero n] : (0 : Fin (n + 1)) ≠ 1


lemma toMvPolynomial_isHomogeneous (M : Matrix m n R) (i : m) :
    (M.toMvPolynomial i).IsHomogeneous 1

{m : Type u_1}
{n : Type u_2}
{R : Type u_4}
[Fintype n]
[CommSemiring R]
(M : Matrix m n R)
(i : m)


lemma mem_generate_of_mem {s : Set <| Set α} {U : Set α} (h : U ∈ s) :
    U ∈ generate s

{α : Type u}
{s : Set (Set α)}
{U : Set α}
(h : U ∈ s)


@[simp]
theorem exp_zero : exp 𝕂 (0 : 𝔸) = 1

{𝕂 : Type u_1}
{𝔸 : Type u_2}
[Field 𝕂]
[Ring 𝔸]
[Algebra 𝕂 𝔸]
[TopologicalSpace 𝔸]
[TopologicalRing 𝔸]


lemma rTensor.inverse_comp_rTensor :
    (rTensor.inverse Q hfg hg).comp (rTensor Q g) =
      Submodule.mkQ (p := LinearMap.range (rTensor Q f))

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
{P : Type u_4}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[AddCommGroup P]
[Module R M]
[Module R N]
[Module R P]
{f : M →ₗ[R] N}
{g : N →ₗ[R] P}
(Q : Type u_5)
[AddCommGroup Q]
[Module R Q]
(hfg : Function.Exact ⇑f ⇑g)
(hg : Function.Surjective ⇑g)

rTensor.inverse Q hfg hg ∘ₗ LinearMap.rTensor Q g = (LinearMap.range (LinearMap.rTensor Q f)).mkQ


@[simp]
lemma map_le_range {M' : Type*}
    [AddCommGroup M'] [Module R M'] [LieRingModule L M'] (f : M →ₗ⁅R,L⁆ M') :
    N.map f ≤ f.range

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
{N : LieSubmodule R L M}
{M' : Type u_1}
[AddCommGroup M']
[Module R M']
[LieRingModule L M']
(f : M →ₗ⁅R,L⁆ M')


@[to_additive (attr := simp) posPart_pos] lemma one_lt_oneLePart (ha : 1 < a) : 1 < a⁺ᵐ

{α : Type u_1}
[Lattice α]
[Group α]
{a : α}
(ha : 1 < a)


theorem find_apply_of_mem {c : Set (PartialRefinement u s)} (hc : IsChain (· ≤ ·) c)
    (ne : c.Nonempty) {i v} (hv : v ∈ c) (hi : i ∈ carrier v) : find c ne i i = v i

{c : Set (ShrinkingLemma.PartialRefinement u s)}

{v : ShrinkingLemma.PartialRefinement u s}

(ShrinkingLemma.PartialRefinement.find c ne i).toFun i = v.toFun i


theorem eq_of_le_of_inf_le_of_sup_le (hxy : x ≤ y) (hinf : y ⊓ z ≤ x ⊓ z) (hsup : y ⊔ z ≤ x ⊔ z) :
    x = y

{α : Type u_1}
[Lattice α]
[IsModularLattice α]
{x y z : α}
(hxy : x ≤ y)
(hinf : y ⊓ z ≤ x ⊓ z)
(hsup : y ⊔ z ≤ x ⊔ z)


@[to_additive]
theorem _root_.Finset.periodic_prod [Add α] [CommMonoid β] {ι : Type*} {f : ι → α → β}
    (s : Finset ι) (hs : ∀ i ∈ s, Periodic (f i) c) : Periodic (∏ i ∈ s, f i) c

{f : ι → α → β}

(hs : ∀ i ∈ s, Function.Periodic (f i) c)


@[symm]
theorem symm {s₁ s₂ : CompositionSeries X} (h : Equivalent s₁ s₂) : Equivalent s₂ s₁

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


/-- Given a monoid homomorphism `f : M →* N` and an element `x : M`, if `x` has a left inverse,
then `f x` has a left inverse too. For elements invertible on both sides see `IsUnit.map`. -/
@[to_additive
  "Given an AddMonoid homomorphism `f : M →+ N` and an element `x : M`, if `x` has
  a left inverse, then `f x` has a left inverse too. For elements invertible on both sides see
  `IsAddUnit.map`."]
theorem map_exists_left_inv (f : F) {x : M} (hx : ∃ y, y * x = 1) : ∃ y, y * f x = 1

{M : Type u_4}
{N : Type u_5}
{F : Type u_9}
[MulOneClass M]
[MulOneClass N]
[FunLike F M N]
[MonoidHomClass F M N]
(f : F)
{x : M}
(hx : ∃ y, y * x = 1)


lemma quotient_mk_sInf_eq {S : Set (Setoid α)} {x y : α} :
    Quotient.mk (sInf S) x = Quotient.mk (sInf S) y ↔ ∀ s ∈ S, s.Rel x y

{α : Type u_1}
{S : Set (Setoid α)}
{x y : α}


theorem submatrix_add [Add α] (A B : Matrix m n α) :
    ((A + B).submatrix : (l → m) → (o → n) → Matrix l o α) = A.submatrix + B.submatrix

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
[Add α]
(A B : Matrix m n α)

(A + B).submatrix = A.submatrix + B.submatrix


protected theorem locallyFinite : LocallyFinite fun i => support (f i)

{ι : Type u}
{X : Type v}
[TopologicalSpace X]
{s : Set X}
(f : BumpCovering ι X s)

LocallyFinite fun i => Function.support ⇑(f i)


theorem cycleType_eq {σ : Perm α} (l : List (Perm α)) (h0 : l.prod = σ)
    (h1 : ∀ σ : Perm α, σ ∈ l → σ.IsCycle) (h2 : l.Pairwise Disjoint) :
    σ.cycleType = l.map (Finset.card ∘ support)

(h2 : List.Pairwise Equiv.Perm.Disjoint l)

σ.cycleType = ↑(List.map (Finset.card ∘ Equiv.Perm.support) l)


@[simp] lemma map_add {f : Ω → Ω'} (f_mble : Measurable f) (ν₁ ν₂ : FiniteMeasure Ω) :
    (ν₁ + ν₂).map f = ν₁.map f + ν₂.map f

{Ω : Type u_1}
{Ω' : Type u_2}
[MeasurableSpace Ω]
[MeasurableSpace Ω']
{f : Ω → Ω'}
(f_mble : Measurable f)
(ν₁ ν₂ : MeasureTheory.FiniteMeasure Ω)


/-- Assuming `levyProkhorovEDist μ ν < ε`, we can bound `∫ f ∂μ` in terms of
`∫ t in (0, ‖f‖], ν (thickening ε {x | f(x) ≥ t}) dt` and `‖f‖`. -/
lemma BoundedContinuousFunction.integral_le_of_levyProkhorovEDist_lt (μ ν : Measure Ω)
    [IsFiniteMeasure μ] [IsFiniteMeasure ν] {ε : ℝ} (ε_pos : 0 < ε)
    (hμν : levyProkhorovEDist μ ν < ENNReal.ofReal ε) (f : Ω →ᵇ ℝ) (f_nn : 0 ≤ᵐ[μ] f) :
    ∫ ω, f ω ∂μ
      ≤ (∫ t in Ioc 0 ‖f‖, ENNReal.toReal (ν (thickening ε {a | t ≤ f a}))) + ε * ‖f‖

(hμν : MeasureTheory.levyProkhorovEDist μ ν < ENNReal.ofReal ε)

∫ (ω : Ω), f ω ∂μ ≤ (∫ (t : ℝ) in Set.Ioc 0 ‖f‖, (ν (Metric.thickening ε {a | t ≤ f a})).toReal) + ε * ‖f‖


lemma cardinal_mk_closure_le_max : #(closure s) ≤ max #s ℵ₀

{α : Type u}
(s : Set α)
[DivisionRing α]

Cardinal.mk ↥(Subfield.closure s) ≤ max (Cardinal.mk ↑s) Cardinal.aleph0


/-- Monoid homomorphism between the function spaces `I → α` and `I → β`, induced by a monoid
homomorphism `f` between `α` and `β`. -/
@[to_additive (attr := simps)
  "Additive monoid homomorphism between the function spaces `I → α` and `I → β`, induced by an
  additive monoid homomorphism `f` between `α` and `β`"]
protected def MonoidHom.compLeft {α β : Type*} [MulOneClass α] [MulOneClass β] (f : α →* β)
    (I : Type*) : (I → α) →* I → β

{α : Type u_3}
{β : Type u_4}
[AddZeroClass α]
[AddZeroClass β]
(f : α →+ β)
(I : Type u_5)
(h : I → α)

∀ (a : I), (f.compLeft I) h a = (⇑f ∘ h) a


/-- The equivalence between the endomorphisms of the single object
when we promote a monoidal category to a single object bicategory,
and the original monoidal category.
-/
@[simps functor inverse_obj inverse_map unitIso counitIso]
noncomputable def endMonoidalStarFunctorEquivalence :
    EndMonoidal (MonoidalSingleObj.star C) ≌ C

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

(CategoryTheory.MonoidalSingleObj.endMonoidalStarFunctorEquivalence C).counitIso =
  CategoryTheory.Iso.refl
    ({ obj := fun X => X, map := fun {X Y} f => f, map_id := ⋯, map_comp := ⋯ }.comp
      (CategoryTheory.MonoidalSingleObj.endMonoidalStarFunctor C).toFunctor)


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

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


theorem star_mul_self : star a * a = normSq a


/-- There are finitely many subsets of a given finite set -/
theorem Finite.finite_subsets {α : Type u} {a : Set α} (h : a.Finite) : { b | b ⊆ a }.Finite


/-- Application of a `ContinuousLinearMap` to a constant commutes with `iteratedFDerivWithin`. -/
theorem iteratedFDerivWithin_clm_apply_const_apply
    {s : Set E} (hs : UniqueDiffOn 𝕜 s) {n : ℕ∞} {c : E → F →L[𝕜] G} (hc : ContDiffOn 𝕜 n c s)
    {i : ℕ} (hi : i ≤ n) {x : E} (hx : x ∈ s) {u : F} {m : Fin i → E} :
    (iteratedFDerivWithin 𝕜 i (fun y ↦ (c y) u) s x) m = (iteratedFDerivWithin 𝕜 i c s x) m u

{𝕜 : 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}
(hs : UniqueDiffOn 𝕜 s)
{n : ℕ∞}
{c : E → F →L[𝕜] G}
(hc : ContDiffOn 𝕜 n c s)
{i : ℕ}
(hi : ↑i ≤ n)
{x : E}
(hx : x ∈ s)
{u : F}
{m : Fin i → E}

(iteratedFDerivWithin 𝕜 i (fun y => (c y) u) s x) m = ((iteratedFDerivWithin 𝕜 i c s x) m) u


/-- A kernel from a measurable space `α` to another measurable space `β` is a measurable function
`κ : α → Measure β`. The measurable space structure on `MeasureTheory.Measure β` is given by
`MeasureTheory.Measure.instMeasurableSpace`. A map `κ : α → MeasureTheory.Measure β` is measurable
iff `∀ s : Set β, MeasurableSet s → Measurable (fun a ↦ κ a s)`. -/
structure Kernel (α β : Type*) [MeasurableSpace α] [MeasurableSpace β] where
  /-- The underlying function of a kernel.

  Do not use this function directly. Instead use the coercion coming from the `DFunLike`
  instance. -/
  toFun : α → Measure β
  /-- A kernel is a measurable map.

  Do not use this lemma directly. Use `Kernel.measurable` instead. -/
  measurable' : Measurable toFun

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
(self : ProbabilityTheory.Kernel α β)


theorem isPrime_of_isPrime_prod_top' {I : Ideal S} (h : (Ideal.prod (⊤ : Ideal R) I).IsPrime) :
    I.IsPrime

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
{I : Ideal S}
(h : (⊤.prod I).IsPrime)


@[to_additive]
theorem inv_mul_toFun_mem (hS : S ∈ Subgroup.leftTransversals (H : Set G)) (g : G) :
    g⁻¹ * toFun hS g ∈ H

(hS : S ∈ AddSubgroup.leftTransversals ↑H)

-g + ↑(AddSubgroup.MemLeftTransversals.toFun hS g) ∈ H


@[simp]
theorem coe_funUnique_symm : ⇑(funUnique ι R M).symm = Function.const ι

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
[Unique ι]
[Semiring R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace M]

⇑(ContinuousLinearEquiv.funUnique ι R M).symm = Function.const ι


theorem mem_image_of_mem (f : α → β) {a} (h : a ∈ s) : f a ∈ s.image f

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
{s : Finset α}
(f : α → β)
{a : α}
(h : a ∈ s)


protected theorem inv_neg {x : tsze R M} : (-x)⁻¹ = -(x⁻¹)

{R : Type u}
{M : Type v}
[DivisionRing R]
[AddCommGroup M]
[Module Rᵐᵒᵖ M]
[Module R M]
{x : tsze R M}


@[simp]
theorem range_subtype : range p.subtype = p

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


@[simp]
theorem birkhoffSum_zero' (f : α → α) (g : α → M) : birkhoffSum f g 0 = 0

{α : Type u_1}
{M : Type u_2}
[AddCommMonoid M]
(f : α → α)
(g : α → M)


theorem not_mem_of_lt_sInf {s : Set ℕ} {m : ℕ} (hm : m < sInf s) : m ∉ s


theorem IsClosed.exists_minimal_nonempty_closed_subset [CompactSpace X] {S : Set X}
    (hS : IsClosed S) (hne : S.Nonempty) :
    ∃ V : Set X, V ⊆ S ∧ V.Nonempty ∧ IsClosed V ∧
      ∀ V' : Set X, V' ⊆ V → V'.Nonempty → IsClosed V' → V' = V

{X : Type u}
[TopologicalSpace X]
[CompactSpace X]
{S : Set X}
(hS : IsClosed S)
(hne : S.Nonempty)

∃ V ⊆ S, V.Nonempty ∧ IsClosed V ∧ ∀ V' ⊆ V, V'.Nonempty → IsClosed V' → V' = V


lemma cfc_comp_pow (f : R → R) (n : ℕ) (a : A)
    (hf : ContinuousOn f ((· ^ n) '' (spectrum R a)) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    cfc (f <| · ^ n) a = cfc f (a ^ n)

(hf : ContinuousOn f ((fun x => x ^ n) '' spectrum R a) := by cfc_cont_tac)

cfc (fun x => f (x ^ n)) a = cfc f (a ^ n)


theorem algebraMap_apply'' :
    algebraMap (MvPowerSeries σ R) (MvPowerSeries σ A) f = map σ (algebraMap R A) f

{σ : Type u_1}
{R : Type u_2}
(A : Type u_3)
[CommSemiring R]
[CommSemiring A]
[Algebra R A]
(f : MvPowerSeries σ R)

(algebraMap (MvPowerSeries σ R) (MvPowerSeries σ A)) f = (MvPowerSeries.map σ (algebraMap R A)) f


protected theorem IsOpen.lowerClosure : IsOpen s → IsOpen (lowerClosure s : Set α)

{α : Type u_1}
[TopologicalSpace α]
[Preorder α]
[HasUpperLowerClosure α]
{s : Set α}


theorem unsym_bijective : Bijective (unsym : αˢʸᵐ → α)


theorem map_sub {f : M → M₂} (lin : IsLinearMap R f) (x y : M) : f (x - y) = f x - f y

{R : Type u_1}
{M : Type u_9}
{M₂ : Type u_11}
[Semiring R]
[AddCommGroup M]
[AddCommGroup M₂]
[Module R M]
[Module R M₂]
{f : M → M₂}
(lin : IsLinearMap R f)
(x y : M)


theorem toNonUnitalSubsemiring_injective :
    Function.Injective
      (toNonUnitalSubsemiring : NonUnitalSubalgebra R A → NonUnitalSubsemiring A)

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]


@[simp]
theorem sup_empty {ι} [IsEmpty ι] (f : ι → Ordinal) : sup f = 0

{ι : Type u_4}
[IsEmpty ι]
(f : ι → Ordinal.{max u_5 u_4})


/-- A Dirichlet character `χ` factors through `d | n` iff its associated unit-group hom is trivial
on the kernel of `ZMod.unitsMap`. -/
lemma factorsThrough_iff_ker_unitsMap {d : ℕ} [NeZero n] (hd : d ∣ n) :
    FactorsThrough χ d ↔ (ZMod.unitsMap hd).ker ≤ χ.toUnitHom.ker

{R : Type u_1}
[CommMonoidWithZero R]
{n : ℕ}
{χ : DirichletCharacter R n}
{d : ℕ}
[NeZero n]
(hd : d ∣ n)

χ.FactorsThrough d ↔ (ZMod.unitsMap hd).ker ≤ (MulChar.toUnitHom χ).ker


theorem UInt32.toNat_add (x y : UInt32) : (x + y).toNat = (x.toNat + y.toNat) % UInt32.size


theorem sigmaLift_mono (h : ∀ ⦃i⦄ ⦃a : α i⦄ ⦃b : β i⦄, f a b ⊆ g a b) (a : Σi, α i) (b : Σi, β i) :
    sigmaLift f a b ⊆ sigmaLift g a b

{f g : ⦃i : ι⦄ → α i → β i → Finset (γ i)}

(h : ∀ ⦃i : ι⦄ ⦃a : α i⦄ ⦃b : β i⦄, f a b ⊆ g a b)

Finset.sigmaLift f a b ⊆ Finset.sigmaLift g a b


theorem mem_map_succ_iff (b : β) (v : Vector α (n + 1)) (f : α → β) :
    b ∈ (v.map f).toList ↔ f v.head = b ∨ ∃ a : α, a ∈ v.tail.toList ∧ f a = b

{α : Type u_1}
{β : Type u_2}
{n : ℕ}
(b : β)
(v : Mathlib.Vector α (n + 1))
(f : α → β)

b ∈ (Mathlib.Vector.map f v).toList ↔ f v.head = b ∨ ∃ a ∈ v.tail.toList, f a = b


theorem filter_range_nth_eq_insert_of_infinite (hp : (setOf p).Infinite) (k : ℕ) :
    (range (nth p (k + 1))).filter p = insert (nth p k) ((range (nth p k)).filter p)

{p : ℕ → Prop}
[DecidablePred p]
(hp : (setOf p).Infinite)
(k : ℕ)

Finset.filter p (Finset.range (Nat.nth p (k + 1))) = insert (Nat.nth p k) (Finset.filter p (Finset.range (Nat.nth p k)))


theorem of_map_sup [SemilatticeSup α] [SemilatticeInf β]
    (h : ∀ x ∈ s, ∀ y ∈ s, f (x ⊔ y) = f x ⊓ f y) : AntitoneOn f s

(h : ∀ (x : α), x ∈ s → ∀ (y : α), y ∈ s → f (x ⊔ y) = f x ⊓ f y)


theorem GoodProducts.range_equiv_factorization :
    (fun (p : ⋃ (e : {o' // o' < o}), (smaller C e.val)) ↦ p.1) ∘ (range_equiv C ho hsC).toFun =
    (fun (p : range C) ↦ (p.1 : LocallyConstant C ℤ))

(hsC : Profinite.NobelingProof.contained C o)

(fun p => ↑p) ∘ (Profinite.NobelingProof.GoodProducts.range_equiv C ho hsC).toFun = fun p => ↑p


/--
The congruences of a ring `R` biject to the congruences of the opposite ring `Rᵐᵒᵖ`.
-/
@[simps]
def opOrderIso : RingCon R ≃o RingCon Rᵐᵒᵖ

{R : Type u_1}
[Add R]
[Mul R]
(c : RingCon Rᵐᵒᵖ)

(RelIso.symm RingCon.opOrderIso) c = c.unop


/-- If `R` satisfies the strong rank condition,
then for any linearly independent family `v : ι → M`
contained in the span of some finite `w : Set M`,
the cardinality of `ι` is bounded by the cardinality of `w`.
-/
theorem linearIndependent_le_span' {ι : Type*} (v : ι → M) (i : LinearIndependent R v) (w : Set M)
    [Fintype w] (s : range v ≤ span R w) : #ι ≤ Fintype.card w

(s : Set.range v ≤ ↑(Submodule.span R w))


protected theorem mul_inv_cancel (h0 : a ≠ 0) (ht : a ≠ ∞) : a * a⁻¹ = 1


@[to_additive]
theorem isMinimal_iff_closed_smul_invariant [ContinuousConstSMul M α] :
    IsMinimal M α ↔ ∀ s : Set α, IsClosed s → (∀ c : M, c • s ⊆ s) → s = ∅ ∨ s = univ

(M : Type u_1)
{α : Type u_3}
[Monoid M]
[TopologicalSpace α]
[MulAction M α]
[ContinuousConstSMul M α]

MulAction.IsMinimal M α ↔ ∀ (s : Set α), IsClosed s → (∀ (c : M), c • s ⊆ s) → s = ∅ ∨ s = Set.univ


@[simp]
theorem vertical_apply {α ι ι'} (v : ι → α) (l : Line α ι') (x : α) :
    l.vertical v x = Sum.elim v (l x)

{α : Type u_5}
{ι : Type u_6}
{ι' : Type u_7}
(v : ι → α)
(l : Combinatorics.Line α ι')
(x : α)

(fun x i => ((Combinatorics.Line.vertical v l).idxFun i).getD x) x = Sum.elim v ((fun x i => (l.idxFun i).getD x) x)


/-- A perfection map to a ring of characteristic `p` is a map that is isomorphic
to its perfection. -/
-- @[nolint has_nonempty_instance] -- Porting note(#5171): This linter does not exist yet.
structure PerfectionMap (p : ℕ) [Fact p.Prime] {R : Type u₁} [CommSemiring R] [CharP R p]
    {P : Type u₂} [CommSemiring P] [CharP P p] [PerfectRing P p] (π : P →+* R) : Prop where
  injective : ∀ ⦃x y : P⦄,
    (∀ n, π (((frobeniusEquiv P p).symm)^[n] x) = π (((frobeniusEquiv P p).symm)^[n] y)) → x = y
  surjective : ∀ f : ℕ → R, (∀ n, f (n + 1) ^ p = f n) → ∃ x : P, ∀ n,
    π (((frobeniusEquiv P p).symm)^[n] x) = f n

{p : ℕ}
[Fact (Nat.Prime p)]
{R : Type u₁}
[CommSemiring R]
[CharP R p]
{P : Type u₂}
[CommSemiring P]
[CharP P p]
[PerfectRing P p]
{π : P →+* R}
(self : PerfectionMap p π)
(f : ℕ → R)

(∀ (n : ℕ), f (n + 1) ^ p = f n) → ∃ x, ∀ (n : ℕ), π ((⇑(frobeniusEquiv P p).symm)^[n] x) = f n


theorem mapRange_comp (f : ∀ i, β₁ i → β₂ i) (f₂ : ∀ i, β i → β₁ i) (hf : ∀ i, f i 0 = 0)
    (hf₂ : ∀ i, f₂ i 0 = 0) (h : ∀ i, (f i ∘ f₂ i) 0 = 0) (g : Π₀ i : ι, β i) :
    mapRange (fun i => f i ∘ f₂ i) h g = mapRange f hf (mapRange f₂ hf₂ g)

{ι : Type u}
{β : ι → Type v}
{β₁ : ι → Type v₁}
{β₂ : ι → Type v₂}
[(i : ι) → Zero (β i)]
[(i : ι) → Zero (β₁ i)]
[(i : ι) → Zero (β₂ i)]
(f : (i : ι) → β₁ i → β₂ i)
(f₂ : (i : ι) → β i → β₁ i)
(hf : ∀ (i : ι), f i 0 = 0)
(hf₂ : ∀ (i : ι), f₂ i 0 = 0)
(h : ∀ (i : ι), (f i ∘ f₂ i) 0 = 0)
(g : Π₀ (i : ι), β i)

DFinsupp.mapRange (fun i => f i ∘ f₂ i) h g = DFinsupp.mapRange f hf (DFinsupp.mapRange f₂ hf₂ g)


theorem preregular [HasExplicitPullbacks P]
    (hs : ∀ ⦃X Y : CompHausLike P⦄ (f : X ⟶ Y), EffectiveEpi f → Function.Surjective f) :
    Preregular (CompHausLike P)

(hs : ∀ ⦃X Y : CompHausLike P⦄ (f : X ⟶ Y), CategoryTheory.EffectiveEpi f → Function.Surjective ⇑f)


@[simp] lemma mop_associator (X Y Z : C) :
    (α_ X Y Z).mop = (α_ (mop Z) (mop Y) (mop X)).symm

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

(CategoryTheory.MonoidalCategory.associator X Y Z).mop =
  (CategoryTheory.MonoidalCategory.associator { unmop := Z } { unmop := Y } { unmop := X }).symm


/-- A cocone `t` on `F` is a colimit cocone if each cocone on `F` admits a unique
cocone morphism from `t`.

See <https://stacks.math.columbia.edu/tag/002F>.
-/
-- Porting note(#5171): removed @[nolint has_nonempty_instance]
structure IsColimit (t : Cocone F) where
  /-- `t.pt` maps to all other cocone covertices -/
  desc : ∀ s : Cocone F, t.pt ⟶ s.pt
  /-- The map `desc` makes the diagram with the natural transformations commute -/
  fac : ∀ (s : Cocone F) (j : J), t.ι.app j ≫ desc s = s.ι.app j := by aesop_cat
  /-- `desc` is the unique such map -/
  uniq :
    ∀ (s : Cocone F) (m : t.pt ⟶ s.pt) (_ : ∀ j : J, t.ι.app j ≫ m = s.ι.app j), m = desc s := by
    aesop_cat

(self : CategoryTheory.Limits.IsColimit t)

(∀ (j : J), t.ι.app j ≫ m = s.ι.app j) → m = self.desc s


@[simp]
theorem coe_smul (g : GL(2, ℝ)⁺) (z : ℍ) : ↑(g • z) = num g z / denom g z

↑(g • z) = UpperHalfPlane.num g z / UpperHalfPlane.denom g z


/-- Non-commutative version of `fderivWithin_inv` -/
theorem fderivWithin_inv' {s : Set R} {x : R} (hx : x ≠ 0) (hxs : UniqueDiffWithinAt 𝕜 s x) :
    fderivWithin 𝕜 (fun x => x⁻¹) s x = -mulLeftRight 𝕜 R x⁻¹ x⁻¹

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{R : Type u_6}
[NormedDivisionRing R]
[NormedAlgebra 𝕜 R]
[CompleteSpace R]
{s : Set R}
{x : R}
(hx : x ≠ 0)
(hxs : UniqueDiffWithinAt 𝕜 s x)

fderivWithin 𝕜 (fun x => x⁻¹) s x = -((ContinuousLinearMap.mulLeftRight 𝕜 R) x⁻¹) x⁻¹


/-- `∏' i, f i` is the product of `f` it exists, or 1 otherwise. -/
@[to_additive "`∑' i, f i` is the sum of `f` it exists, or 0 otherwise."]
noncomputable irreducible_def tprod {β} (f : β → α)

{α : Type u_4}
[AddCommMonoid α]
[TopologicalSpace α]
{β : Type u_5}
(f : β → α)

tsum f = if h : Summable f then if (Function.support f).Finite then finsum f else Exists.choose h else 0


@[simp]
theorem deriv.neg' : (deriv fun y => -f y) = fun x => -deriv f x

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


theorem adapted_const (f : Filtration ι m) (x : β) : Adapted f fun _ _ => x

{Ω : Type u_1}
{β : Type u_2}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[TopologicalSpace β]
[Preorder ι]
(f : MeasureTheory.Filtration ι m)
(x : β)

MeasureTheory.Adapted f fun x_1 x_2 => x


protected theorem smul_add (r : R') (x y : M ⊗[R] N) : r • (x + y) = r • x + r • y

{R : Type u_1}
[CommSemiring R]
{R' : Type u_2}
[Monoid R']
{M : Type u_4}
{N : Type u_5}
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
[DistribMulAction R' M]
[SMulCommClass R R' M]
(r : R')
(x y : TensorProduct R M N)


theorem map₂_eq_span_image2 (f : M →ₗ[R] N →ₗ[R] P) (p : Submodule R M) (q : Submodule R N) :
    map₂ f p q = span R (Set.image2 (fun m n => f m n) (p : Set M) (q : Set N))

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
{P : Type u_4}
[CommSemiring R]
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module R N]
[Module R P]
(f : M →ₗ[R] N →ₗ[R] P)
(p : Submodule R M)
(q : Submodule R N)

Submodule.map₂ f p q = Submodule.span R (Set.image2 (fun m n => (f m) n) ↑p ↑q)


protected theorem LinearIndependent.insert (hs : LinearIndependent K (fun b => b : s → V))
    (hx : x ∉ span K s) : LinearIndependent K (fun b => b : ↥(insert x s) → V)

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

LinearIndependent K fun (b : ↑(insert x s)) => ↑b


theorem mk_mem_enumFrom_iff_le_and_get?_sub {n i : ℕ} {x : α} {l : List α} :
    (i, x) ∈ enumFrom n l ↔ n ≤ i ∧ l.get? (i - n) = x

{α : Type u_1}
{n i : ℕ}
{x : α}
{l : List α}

(i, x) ∈ List.enumFrom n l ↔ n ≤ i ∧ l.get? (i - n) = some x


theorem inv_def (A : Matrix n n α) : A⁻¹ = Ring.inverse A.det • A.adjugate

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
(A : Matrix n n α)


@[simp]
theorem compLeft_id (B : BilinForm R M) : B.compLeft 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 coe_iInf {ι : Sort*} (f : ι → ConvexCone 𝕜 E) : ↑(iInf f) = ⋂ i, (f i : Set E)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
{ι : Sort u_5}
(f : ι → ConvexCone 𝕜 E)


@[simp]
protected theorem le_add_right (d₁ d₂ : ManyOneDegree) : d₂ ≤ d₁ + d₂

d₂ ≤ d₁ + d₂


theorem testBit_eq_false_of_lt {n i} (h : n < 2 ^ i) : n.testBit i = false


/-- A product of categories indexed by `Option J` identifies to a binary product. -/
@[simps]
def Pi.optionEquivalence (C' : Option J → Type u₁) [∀ i, Category.{v₁} (C' i)] :
    (∀ i, C' i) ≌ C' none × (∀ (j : J), C' (some j))

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

(CategoryTheory.Pi.optionEquivalence C').functor =
  (CategoryTheory.Pi.eval C' none).prod' (CategoryTheory.Functor.pi' fun i => CategoryTheory.Pi.eval C' (some i))


@[to_additive]
theorem eventually_mul_left_iff (μ : Measure G) [IsMulLeftInvariant μ] (t : G) {p : G → Prop} :
    (∀ᵐ x ∂μ, p (t * x)) ↔ ∀ᵐ x ∂μ, p x

{G : Type u_2}
[MeasurableSpace G]
[AddGroup G]
[MeasurableAdd G]
(μ : MeasureTheory.Measure G)
[μ.IsAddLeftInvariant]
(t : G)
{p : G → Prop}

(∀ᵐ (x : G) ∂μ, p (t + x)) ↔ ∀ᵐ (x : G) ∂μ, p x


@[to_additive] -- Porting note: was `@[simp]`
theorem lintegral_div_right_eq_self [IsMulRightInvariant μ] (f : G → ℝ≥0∞) (g : G) :
    (∫⁻ x, f (x / g) ∂μ) = ∫⁻ x, f x ∂μ

{G : Type u_1}
[MeasurableSpace G]
{μ : MeasureTheory.Measure G}
[Group G]
[MeasurableMul G]
[μ.IsMulRightInvariant]
(f : G → ENNReal)
(g : G)

∫⁻ (x : G), f (x / g) ∂μ = ∫⁻ (x : G), f x ∂μ


/-- A Jordan decomposition provides a Hahn decomposition. -/
theorem exists_compl_positive_negative :
    ∃ S : Set α,
      MeasurableSet S ∧
        j.toSignedMeasure ≤[S] 0 ∧
          0 ≤[Sᶜ] j.toSignedMeasure ∧ j.posPart S = 0 ∧ j.negPart Sᶜ = 0

(j : MeasureTheory.JordanDecomposition α)

∃ S,
  MeasurableSet S ∧
    MeasureTheory.VectorMeasure.restrict j.toSignedMeasure S ≤ MeasureTheory.VectorMeasure.restrict 0 S ∧
      MeasureTheory.VectorMeasure.restrict 0 Sᶜ ≤ MeasureTheory.VectorMeasure.restrict j.toSignedMeasure Sᶜ ∧
        j.posPart S = 0 ∧ j.negPart Sᶜ = 0


theorem tendsto_implicitFunction (hf : HasStrictFDerivAt f f' a) (hf' : range f' = ⊤) {α : Type*}
    {l : Filter α} {g₁ : α → F} {g₂ : α → ker f'} (h₁ : Tendsto g₁ l (𝓝 <| f a))
    (h₂ : Tendsto g₂ l (𝓝 0)) :
    Tendsto (fun t => hf.implicitFunction f f' hf' (g₁ t) (g₂ t)) l (𝓝 a)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[CompleteSpace 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[FiniteDimensional 𝕜 F]
{f : E → F}
{f' : E →L[𝕜] F}
{a : E}
(hf : HasStrictFDerivAt f f' a)
(hf' : LinearMap.range f' = ⊤)
{α : Type u_4}
{l : Filter α}
{g₁ : α → F}
{g₂ : α → ↥(LinearMap.ker f')}
(h₁ : Filter.Tendsto g₁ l (𝓝 (f a)))
(h₂ : Filter.Tendsto g₂ l (𝓝 0))

Filter.Tendsto (fun t => HasStrictFDerivAt.implicitFunction f f' hf hf' (g₁ t) (g₂ t)) l (𝓝 a)


theorem Module.finite_of_rank_eq_nat [Module.Free R M] {n : ℕ} (h : Module.rank R M = n) :
    Module.Finite R M

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[Module.Free R M]
{n : ℕ}
(h : Module.rank R M = ↑n)


/-- Continuity of interval integral with respect to a parameter.
  Given `F : X → ℝ → E`, assume each `F x` is ae-measurable on `[a, b]`,
  and assume it is bounded by a function integrable on `[a, b]` independent of `x`.
  If `(fun x ↦ F x t)` is continuous for almost every `t` in `[a, b]`
  then the same holds for `(fun x ↦ ∫ t in a..b, F x t ∂μ) s x₀`. -/
theorem continuous_of_dominated_interval {F : X → ℝ → E} {bound : ℝ → ℝ} {a b : ℝ}
    (hF_meas : ∀ x, AEStronglyMeasurable (F x) <| μ.restrict <| Ι a b)
    (h_bound : ∀ x, ∀ᵐ t ∂μ, t ∈ Ι a b → ‖F x t‖ ≤ bound t)
    (bound_integrable : IntervalIntegrable bound μ a b)
    (h_cont : ∀ᵐ t ∂μ, t ∈ Ι a b → Continuous fun x => F x t) :
    Continuous fun x => ∫ t in a..b, F x t ∂μ

(hF_meas : ∀ (x : X), MeasureTheory.AEStronglyMeasurable (F x) (μ.restrict (Ι a b)))

(h_bound : ∀ (x : X), ∀ᵐ (t : ℝ) ∂μ, t ∈ Ι a b → ‖F x t‖ ≤ bound t)

(h_cont : ∀ᵐ (t : ℝ) ∂μ, t ∈ Ι a b → Continuous fun x => F x t)

Continuous fun x => ∫ (t : ℝ) in a..b, F x t ∂μ


theorem lt_iff (hf : LeftOrdContinuous f) (h : Injective f) {x y} : f x < f y ↔ x < y

{α : Type u}
{β : Type v}
[SemilatticeSup α]
[SemilatticeSup β]
{f : α → β}
(hf : LeftOrdContinuous f)
(h : Function.Injective f)
{x y : α}


@[simp]
theorem DifferentiableAt.inv (hf : DifferentiableAt 𝕜 h z) (hz : h z ≠ 0) :
    DifferentiableAt 𝕜 (fun x => (h x)⁻¹) z

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type w}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{h : E → 𝕜}
{z : E}
(hf : DifferentiableAt 𝕜 h z)
(hz : h z ≠ 0)


/-- If a family is affinely independent, the spans of points indexed
by disjoint subsets of the index type are disjoint, if the underlying
ring is nontrivial. -/
theorem AffineIndependent.affineSpan_disjoint_of_disjoint [Nontrivial k] {p : ι → P}
    (ha : AffineIndependent k p) {s1 s2 : Set ι} (hd : Disjoint s1 s2) :
    Disjoint (affineSpan k (p '' s1) : Set P) (affineSpan k (p '' s2))

{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}
[Nontrivial k]
{p : ι → P}
(ha : AffineIndependent k p)
{s1 s2 : Set ι}
(hd : Disjoint s1 s2)

Disjoint ↑(affineSpan k (p '' s1)) ↑(affineSpan k (p '' s2))


@[to_additive (attr := simp, norm_cast)]
lemma coe_eq_one : (s : Set α) = 1 ↔ s = 1


@[to_additive existing]
theorem aeval_prod {ι : Type*} (s : Finset ι) (φ : ι → MvPolynomial σ R) :
    aeval f (∏ i ∈ s, φ i) = ∏ i ∈ s, aeval f (φ i)

{R : Type u}
{S₁ : Type v}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₁]
[Algebra R S₁]
(f : σ → S₁)
{ι : Type u_2}
(s : Finset ι)
(φ : ι → MvPolynomial σ R)

(MvPolynomial.aeval f) (∏ i ∈ s, φ i) = ∏ i ∈ s, (MvPolynomial.aeval f) (φ i)


/-- `0` has infinite radius of convergence -/
@[simp] lemma zero_radius : (0 : FormalMultilinearSeries 𝕜 E F).radius = ∞

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


theorem integral_iUnion {ι : Type*} [Countable ι] {s : ι → Set X} (hm : ∀ i, MeasurableSet (s i))
    (hd : Pairwise (Disjoint on s)) (hfi : IntegrableOn f (⋃ i, s i) μ) :
    ∫ x in ⋃ n, s n, f x ∂μ = ∑' n, ∫ x in s n, f x ∂μ

(hfi : MeasureTheory.IntegrableOn f (⋃ i, s i) μ)

∫ (x : X) in ⋃ n, s n, f x ∂μ = ∑' (n : ι), ∫ (x : X) in s n, f x ∂μ


theorem image_const_add_Iic : (fun x => a + x) '' Iic b = Iic (a + b)

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

(fun x => a + x) '' Set.Iic b = Set.Iic (a + b)


theorem WithSeminorms.isVonNBounded_iff_seminorm_bounded {s : Set E} (hp : WithSeminorms p) :
    Bornology.IsVonNBounded 𝕜 s ↔ ∀ i : ι, ∃ r > 0, ∀ x ∈ s, p i x < r

{𝕜 : Type u_1}
{E : Type u_5}
{ι : Type u_8}
[NontriviallyNormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[Nonempty ι]
{p : SeminormFamily 𝕜 E ι}
[TopologicalSpace E]
{s : Set E}
(hp : WithSeminorms p)

Bornology.IsVonNBounded 𝕜 s ↔ ∀ (i : ι), ∃ r > 0, ∀ x ∈ s, (p i) x < r


theorem _root_.Finset.coe_infsep_of_offDiag_nonempty [DecidableEq α] {s : Finset α}
    (hs : s.offDiag.Nonempty) : (s : Set α).infsep = s.offDiag.inf' hs (uncurry dist)

{α : Type u_1}
[PseudoMetricSpace α]
[DecidableEq α]
{s : Finset α}
(hs : s.offDiag.Nonempty)

(↑s).infsep = s.offDiag.inf' hs (Function.uncurry dist)


/-- 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


@[to_additive (attr := simp)]
theorem smul_sphere (c : G) (x : X) (r : ℝ) : c • sphere x r = sphere (c • x) r

{G : Type v}
{X : Type w}
[PseudoMetricSpace X]
[AddGroup G]
[AddAction G X]
[IsometricVAdd G X]
(c : G)
(x : X)
(r : ℝ)

c +ᵥ Metric.sphere x r = Metric.sphere (c +ᵥ x) r


theorem hitting_mem_set_of_hitting_lt [IsWellOrder ι (· < ·)] {m : ι} (hl : hitting u s n m ω < m) :
    u (hitting u s n m ω) ω ∈ s

{u : ι → Ω → β}

(hl : MeasureTheory.hitting u s n m ω < m)

u (MeasureTheory.hitting u s n m ω) ω ∈ s


/-- Given a localization functor `L : C ⥤ D` for `W : MorphismProperty C`,
if `(F₁' F₂' : D ⥤ E)` are functors which lifts functors `(F₁ F₂ : C ⥤ E)`,
a natural isomorphism `τ : F₁ ⟶ F₂` lifts to a natural isomorphism `F₁' ⟶ F₂'`. -/
@[simps]
def liftNatIso (F₁ F₂ : C ⥤ E) (F₁' F₂' : D ⥤ E) [h₁ : Lifting L W F₁ F₁'] [h₂ : Lifting L W F₂ F₂']
    (e : F₁ ≅ F₂) : F₁' ≅ F₂'

[h₁ : CategoryTheory.Localization.Lifting L W F₁ F₁']

[h₂ : CategoryTheory.Localization.Lifting L W F₂ F₂']

(CategoryTheory.Localization.liftNatIso L W F₁ F₂ F₁' F₂' e).hom =
  CategoryTheory.Localization.liftNatTrans L W F₁ F₂ F₁' F₂' e.hom


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

{R : Type u}
[NonAssocSemiring R]
{s : Set R}
{t : Subsemiring R}
(h₁ : s ⊆ ↑t)
(h₂ : t ≤ Subsemiring.closure s)


/-- A filter is disjoint from the cocompact filter if and only if it contains a compact set. -/
theorem disjoint_cocompact_left (f : Filter X) :
    Disjoint (Filter.cocompact X) f ↔ ∃ K ∈ f, IsCompact K

{X : Type u}
[TopologicalSpace X]
(f : Filter X)


theorem rpow_sub_one {x : ℝ} (hx : x ≠ 0) (y : ℝ) : x ^ (y - 1) = x ^ y / x


theorem Nonempty.to_subtype {s : Finset α} : s.Nonempty → Nonempty s


@[continuity]
theorem continuous_imI : Continuous fun q : ℍ => q.imI


theorem not_specializes_infty_coe {x : X} : ¬Specializes ∞ (x : OnePoint X)

{X : Type u_1}
[TopologicalSpace X]
{x : X}


protected theorem sub_eq_iff_eq_add' {c : Nat} (h : b ≤ a) : a - b = c ↔ a = b + c


theorem Smooth.snd {f : N → M × M'} (hf : Smooth J (I.prod I') f) : Smooth J I' fun x => (f x).2

{𝕜 : 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_11}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_12}
[TopologicalSpace G]
{J : ModelWithCorners 𝕜 F G}
{N : Type u_13}
[TopologicalSpace N]
[ChartedSpace G N]
{f : N → M × M'}
(hf : Smooth J (I.prod I') f)


lemma odd_sum_iff_odd_card_odd {s : Finset ι} (f : ι → ℕ) :
    Odd (∑ i ∈ s, f i) ↔ Odd (s.filter fun x ↦ Odd (f x)).card

{ι : Type u_1}
{s : Finset ι}
(f : ι → ℕ)

Odd (∑ i ∈ s, f i) ↔ Odd (Finset.filter (fun x => Odd (f x)) s).card


@[gcongr] protected theorem neg (h : a ≡ b [ZMOD n]) : -a ≡ -b [ZMOD n]


@[simp]
theorem nthHom_zero : nthHom f 0 = 0

{p : ℕ}
{R : Type u_1}
[NonAssocSemiring R]
(f : (k : ℕ) → R →+* ZMod (p ^ k))


@[simp]
theorem inl_mul [Monoid R] [AddMonoid M] [DistribMulAction R M] [DistribMulAction Rᵐᵒᵖ M]
    (r₁ r₂ : R) : (inl (r₁ * r₂) : tsze R M) = inl r₁ * inl r₂

{R : Type u}
(M : Type v)
[Monoid R]
[AddMonoid M]
[DistribMulAction R M]
[DistribMulAction Rᵐᵒᵖ M]
(r₁ r₂ : R)

TrivSqZeroExt.inl (r₁ * r₂) = TrivSqZeroExt.inl r₁ * TrivSqZeroExt.inl r₂


@[to_additive (attr := simp)]
theorem mul_toGerm (f g : α →ₘ[μ] γ) : (f * g).toGerm = f.toGerm * g.toGerm

{α : Type u_1}
{γ : Type u_3}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[TopologicalSpace γ]
[Add γ]
[ContinuousAdd γ]
(f g : α →ₘ[μ] γ)


lemma biSup_comap_eq_top_of_surjective {ι : Type*} (s : Set ι) (hs : s.Nonempty)
    (p : ι → Submodule R₂ M₂) (hp : ⨆ i ∈ s, p i = ⊤)
    (f : M →ₛₗ[τ₁₂] M₂) (hf : Surjective f) :
    ⨆ i ∈ s, (p i).comap f = ⊤

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_4}
{M₂ : Type u_5}
[Semiring R]
[Semiring R₂]
[AddCommGroup M]
[Module R M]
[AddCommGroup M₂]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
[RingHomSurjective τ₁₂]
{ι : Type u_9}
(s : Set ι)
(hs : s.Nonempty)
(p : ι → Submodule R₂ M₂)
(hp : ⨆ i ∈ s, p i = ⊤)
(f : M →ₛₗ[τ₁₂] M₂)
(hf : Function.Surjective ⇑f)


@[to_additive (attr := simp)]
theorem equivMapOfInjective_coe_mulEquiv (H : Subgroup G) (e : G ≃* G') :
    H.equivMapOfInjective (e : G →* G') (EquivLike.injective e) = e.subgroupMap H

{G : Type u_1}
{G' : Type u_2}
[AddGroup G]
[AddGroup G']
(H : AddSubgroup G)
(e : G ≃+ G')

H.equivMapOfInjective ↑e ⋯ = e.addSubgroupMap H


@[to_additive (attr := simp)]
theorem mulIndicator_mulSupport : mulIndicator (mulSupport f) f = f

{α : Type u_1}
{M : Type u_4}
[Zero M]
{f : α → M}


theorem le {x y : PGame} (r : x ≡r y) : x ≤ y

{x y : SetTheory.PGame}
(r : x.Relabelling y)


theorem choose_eq_asc_factorial_div_factorial (n k : ℕ) :
    (n + k).choose k = (n + 1).ascFactorial k / k !


@[simp] theorem toNat_eq_one  (b : Bool) : b.toNat = 1 ↔ b = true


@[to_additive (attr := simp)]
theorem infEdist_smul {M} [SMul M α] [IsometricSMul M α] (c : M) (x : α) (s : Set α) :
    infEdist (c • x) (c • s) = infEdist x s

{α : Type u}
[PseudoEMetricSpace α]
{M : Type u_2}
[SMul M α]
[IsometricSMul M α]
(c : M)
(x : α)
(s : Set α)

EMetric.infEdist (c • x) (c • s) = EMetric.infEdist x s


lemma image2_inter_left (hf : Injective2 f) :
    image2 f (s ∩ s') t = image2 f s t ∩ image2 f s' t

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{f : α → β → γ}
{s s' : Set α}
{t : Set β}
(hf : Function.Injective2 f)

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


@[simp]
lemma abs_pow (a : α) (n : ℕ) : |a ^ n| = |a| ^ n

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


theorem ncard_le_ncard_of_injOn {t : Set β} (f : α → β) (hf : ∀ a ∈ s, f a ∈ t) (f_inj : InjOn f s)
    (ht : t.Finite := by toFinite_tac) :
    s.ncard ≤ t.ncard

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
(f : α → β)
(hf : ∀ a ∈ s, f a ∈ t)
(f_inj : Set.InjOn f s)
(ht : t.Finite := by toFinite_tac)


private theorem Cofix.bisim_aux {α : TypeVec n} (r : Cofix F α → Cofix F α → Prop) (h' : ∀ x, r x x)
    (h : ∀ x y, r x y →
      appendFun id (Quot.mk r) <$$> Cofix.dest x = appendFun id (Quot.mk r) <$$> Cofix.dest y) :
    ∀ x y, r x y → x = y

(r : MvQPF.Cofix F α → MvQPF.Cofix F α → Prop)

(h : ∀ (x y : MvQPF.Cofix F α), r x y → (TypeVec.id ::: Quot.mk r) <$$> x.dest = (TypeVec.id ::: Quot.mk r) <$$> y.dest)


@[simp] theorem map_eq_map : Functor.map f = Option.map f

∀ {α α_1 : Type u_1} {f : α → α_1}, Functor.map f = Option.map f


/-- If `f = O(n^(x-1))` and `re s > x`, then the `LSeries` of `f` is summable at `s`. -/
lemma LSeriesSummable_of_isBigO_rpow {f : ℕ → ℂ} {x : ℝ} {s : ℂ} (hs : x < s.re)
    (h : f =O[atTop] fun n ↦ (n : ℝ) ^ (x - 1)) :
    LSeriesSummable f s

(h : f =O[Filter.atTop] fun n => ↑n ^ (x - 1))


@[to_additive]
protected lemma eq_div_of_mul_eq (h : IsUnit c) : a * c = b → a = b / c

{α : Type u}
[DivisionMonoid α]
{a b c : α}
(h : IsUnit c)


@[simp]
theorem iUnion_star {ι : Sort*} [Star α] (s : ι → Set α) : (⋃ i, s i)⋆ = ⋃ i, (s i)⋆

{α : Type u_1}
{ι : Sort u_2}
[Star α]
(s : ι → Set α)


@[simp]
lemma pullbackMk_fst (x₁ : X₁) (x₂ : X₂) (h : f₁ x₁ = f₂ x₂) :
    pullback.fst f₁ f₂ (pullbackMk f₁ f₂ x₁ x₂ h) = x₁

[CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan f₁ f₂) (CategoryTheory.forget C)]

(CategoryTheory.Limits.pullback.fst f₁ f₂) (CategoryTheory.Limits.Concrete.pullbackMk f₁ f₂ x₁ x₂ h) = x₁


lemma trace_diagonal {o} [Fintype o] [DecidableEq o] (d : o → R) :
    trace (diagonal d) = ∑ i, d i

{R : Type u_6}
[AddCommMonoid R]
{o : Type u_8}
[Fintype o]
[DecidableEq o]
(d : o → R)

(Matrix.diagonal d).trace = ∑ i : o, d i


theorem nodalWeight_eq_eval_nodal_derative (hi : i ∈ s) :
    nodalWeight s v i = (eval (v i) (Polynomial.derivative (nodal s v)))⁻¹

{F : Type u_1}
[Field F]
{ι : Type u_2}
[DecidableEq ι]
{s : Finset ι}
{v : ι → F}
{i : ι}
(hi : i ∈ s)

Lagrange.nodalWeight s v i = (Polynomial.eval (v i) (Polynomial.derivative (Lagrange.nodal s v)))⁻¹


@[simp]
theorem beth_zero : beth 0 = aleph0


@[simp]
theorem ndinsert_zero (a : α) : ndinsert a 0 = {a}


theorem perm_inv_mapsTo_of_mapsTo (f : Perm α) {s : Set α} [Finite s] (h : Set.MapsTo f s s) :
    Set.MapsTo (f⁻¹ : _) s s

{α : Type u}
(f : Equiv.Perm α)
{s : Set α}
[Finite ↑s]
(h : Set.MapsTo (⇑f) s s)


theorem forall_fin_two {p : Fin 2 → Prop} : (∀ i, p i) ↔ p 0 ∧ p 1


@[simp]
theorem Icc_union_Icc_eq_Icc (h₁ : a ≤ b) (h₂ : b ≤ c) : Icc a b ∪ Icc b c = Icc a c

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


@[simp]
theorem map_comp : (map Q g hy).comp (algebraMap R S) = (algebraMap P Q).comp g

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
{P : Type u_3}
[CommSemiring P]
[IsLocalization M S]
{g : R →+* P}
{T : Submonoid P}
{Q : Type u_4}
[CommSemiring Q]
(hy : M ≤ Submonoid.comap g T)
[Algebra P Q]
[IsLocalization T Q]

(IsLocalization.map Q g hy).comp (algebraMap R S) = (algebraMap P Q).comp g


/-- One semiconjugates any element to itself. -/
@[to_additive (attr := simp) "Zero semiconjugates any element to itself."]
theorem one_left (x : M) : SemiconjBy 1 x x


theorem nontrivial_iff_ne_singleton (ha : a ∈ s) : s.Nontrivial ↔ s ≠ {a}

{α : Type u_1}
{s : Finset α}
{a : α}
(ha : a ∈ s)


@[to_additive]
lemma IsOfFinOrder.finite_powers (ha : IsOfFinOrder a) : (powers a : Set G).Finite

{G : Type u_1}
[Monoid G]
{a : G}
(ha : IsOfFinOrder a)


/-- The product of a finite family of `PartialHomeomorph`s. -/
@[simps toPartialEquiv]
def pi : PartialHomeomorph (∀ i, X i) (∀ i, Y i)

(ei : (i : ι) → PartialHomeomorph (X i) (Y i))

(PartialHomeomorph.pi ei).toPartialEquiv = PartialEquiv.pi fun i => (ei i).toPartialEquiv


@[to_additive]
theorem srangeRestrict_surjective (f : M →ₙ* N) : Function.Surjective f.srangeRestrict

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


theorem mem_parallelepiped_iff (v : ι → E) (x : E) :
    x ∈ parallelepiped v ↔ ∃ t ∈ Icc (0 : ι → ℝ) 1, x = ∑ i, t i • v i

{ι : Type u_1}
{E : Type u_3}
[Fintype ι]
[AddCommGroup E]
[Module ℝ E]
(v : ι → E)
(x : E)

x ∈ parallelepiped v ↔ ∃ t ∈ Set.Icc 0 1, x = ∑ i : ι, t i • v i


@[to_additive]
theorem prehaar_sup_le {K₀ : PositiveCompacts G} {U : Set G} (K₁ K₂ : Compacts G)
    (hU : (interior U).Nonempty) :
    prehaar (K₀ : Set G) U (K₁ ⊔ K₂) ≤ prehaar (K₀ : Set G) U K₁ + prehaar (K₀ : Set G) U K₂

{K₀ : TopologicalSpace.PositiveCompacts G}

MeasureTheory.Measure.haar.addPrehaar (↑K₀) U (K₁ ⊔ K₂) ≤
  MeasureTheory.Measure.haar.addPrehaar (↑K₀) U K₁ + MeasureTheory.Measure.haar.addPrehaar (↑K₀) U K₂


@[simp]
theorem nondegenerate_toMatrix_iff {B : M₁ →ₗ[R₁] M₁ →ₗ[R₁] R₁} (b : Basis ι R₁ M₁) :
    (toMatrix₂ b b B).Nondegenerate ↔ B.SeparatingLeft

{R₁ : Type u_2}
{M₁ : Type u_7}
{ι : Type u_16}
[CommRing R₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
[DecidableEq ι]
[Fintype ι]
{B : M₁ →ₗ[R₁] M₁ →ₗ[R₁] R₁}
(b : Basis ι R₁ M₁)

((LinearMap.toMatrix₂ b b) B).Nondegenerate ↔ B.SeparatingLeft


protected theorem biInter {f : β → Set α} {s : Set β} (hs : s.Countable)
    (h : ∀ b ∈ s, NullMeasurableSet (f b) μ) : NullMeasurableSet (⋂ b ∈ s, f b) μ

(h : ∀ b ∈ s, MeasureTheory.NullMeasurableSet (f b) μ)

MeasureTheory.NullMeasurableSet (⋂ b ∈ s, f b) μ


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

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


theorem IsEquivalent.neg (huv : u ~[l] v) : (fun x ↦ -u x) ~[l] fun x ↦ -v x

{α : Type u_1}
{β : Type u_2}
[NormedAddCommGroup β]
{u v : α → β}
{l : Filter α}
(huv : u ~[l] v)


protected lemma div_ne_zero_iff (hb : b ≠ 0) : a / b ≠ 0 ↔ b ≤ a


/-- The natural `ℝ`-linear isometry equivalence between `𝕜` satisfying `RCLike 𝕜` and `ℂ` when
`RCLike.im RCLike.I = 1`. -/
@[simps]
def _root_.RCLike.complexLinearIsometryEquiv {𝕜 : Type*} [RCLike 𝕜]
    (h : RCLike.im (RCLike.I : 𝕜) = 1) : 𝕜 ≃ₗᵢ[ℝ] ℂ

{𝕜 : Type u_2}
[RCLike 𝕜]
(h : RCLike.im RCLike.I = 1)

∀ (a : ℂ), (RCLike.complexLinearIsometryEquiv h).invFun a = (RCLike.complexRingEquiv h).invFun a


theorem auxGroup_indep (i j : N) : (auxGroup i : Group (HomotopyGroup N X x)) = auxGroup j

{N : Type u_1}
{X : Type u_2}
[TopologicalSpace X]
{x : X}
[DecidableEq N]
(i j : N)

HomotopyGroup.auxGroup i = HomotopyGroup.auxGroup j


theorem Filter.Tendsto.zero_smul_isBoundedUnder_le {f : α → 𝕜} {g : α → E} {l : Filter α}
    (hf : Tendsto f l (𝓝 0)) (hg : IsBoundedUnder (· ≤ ·) l (Norm.norm ∘ g)) :
    Tendsto (fun x => f x • g x) l (𝓝 0)

(hg : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l (norm ∘ g))

Filter.Tendsto (fun x => f x • g x) l (𝓝 0)


@[simp]
theorem symm_self_conj (f : End X) : α.symm.conj (α.conj f) = f

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


/-- Two measures are equal if they have equal restrictions on a spanning collection of sets
  (formulated using `sUnion`). -/
theorem ext_iff_of_sUnion_eq_univ {S : Set (Set α)} (hc : S.Countable) (hs : ⋃₀ S = univ) :
    μ = ν ↔ ∀ s ∈ S, μ.restrict s = ν.restrict s

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
{S : Set (Set α)}
(hc : S.Countable)
(hs : ⋃₀ S = Set.univ)


theorem degree_of_a_eq_zero (ha : P.a = 0) : P.toPoly.degree ≤ 2

{R : Type u_1}
{P : Cubic R}
[Semiring R]
(ha : P.a = 0)


@[trans]
theorem IsEquivalent.trans_eventuallyEq {f g₁ g₂ : α → β} (h : f ~[l] g₁)
    (h₂ : g₁ =ᶠ[l] g₂) : f ~[l] g₂

{α : Type u_1}
{β : Type u_2}
[NormedAddCommGroup β]
{l : Filter α}
{f g₁ g₂ : α → β}
(h : f ~[l] g₁)
(h₂ : g₁ =ᶠ[l] g₂)


@[local simp] theorem negSucc_mul_negSucc' (m n : Nat) :
    -[m+1] * -[n+1] = ofNat (succ m * succ n)

Int.negSucc m * Int.negSucc n = Int.ofNat (m.succ * n.succ)


/-- If `f` has sum `a`, then `exp ∘ f` has product `exp a`. -/
lemma HasSum.exp {ι : Type*} {f : ι → 𝔸} {a : 𝔸} (h : HasSum f a) :
    HasProd (exp 𝕂 ∘ f) (exp 𝕂 a)

{𝕂 : Type u_1}
{𝔸 : Type u_2}
[RCLike 𝕂]
[NormedCommRing 𝔸]
[NormedAlgebra 𝕂 𝔸]
[CompleteSpace 𝔸]
{ι : Type u_3}
{f : ι → 𝔸}
{a : 𝔸}
(h : HasSum f a)

HasProd (NormedSpace.exp 𝕂 ∘ f) (NormedSpace.exp 𝕂 a)


@[to_additive]
theorem prod_comm (f : α →₀ M) (g : β →₀ M') (h : α → M → β → M' → N) :
    (f.prod fun x v => g.prod fun x' v' => h x v x' v') =
      g.prod fun x' v' => f.prod fun x v => h x v x' v'

{α : Type u_1}
{β : Type u_7}
{M : Type u_8}
{M' : Type u_9}
{N : Type u_10}
[Zero M]
[Zero M']
[AddCommMonoid N]
(f : α →₀ M)
(g : β →₀ M')
(h : α → M → β → M' → N)

(f.sum fun x v => g.sum fun x' v' => h x v x' v') = g.sum fun x' v' => f.sum fun x v => h x v x' v'


@[to_additive]
theorem IsUpperSet.div_left (ht : IsUpperSet t) : IsLowerSet (s / t)

{α : Type u_1}
[OrderedAddCommGroup α]
{s t : Set α}
(ht : IsUpperSet t)


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

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


@[simp]
theorem trans_apply (h₁ : X ≃ₜ Y) (h₂ : Y ≃ₜ Z) (x : X) : h₁.trans h₂ x = h₂ (h₁ x)

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(h₁ : X ≃ₜ Y)
(h₂ : Y ≃ₜ Z)
(x : X)


@[simp]
lemma coe_mop_smul {r : Rᵐᵒᵖ} {x : I} : (r • x : R) = (x : R) * r.unop

{R : Type u_1}
[Ring R]
(I : TwoSidedIdeal R)
{r : Rᵐᵒᵖ}
{x : ↥I}


@[simp]
theorem NormedAddGroupHom.completion_id :
    (NormedAddGroupHom.id G).completion = NormedAddGroupHom.id (Completion G)

{G : Type u_1}
[SeminormedAddCommGroup G]

(NormedAddGroupHom.id G).completion = NormedAddGroupHom.id (UniformSpace.Completion G)


/-- If `f : α → β` is `0`-antilipschitz, then `α` is a `subsingleton`. -/
protected theorem subsingleton {α β} [EMetricSpace α] [PseudoEMetricSpace β] {f : α → β}
    (h : AntilipschitzWith 0 f) : Subsingleton α

{α : Type u_4}
{β : Type u_5}
[EMetricSpace α]
[PseudoEMetricSpace β]
{f : α → β}
(h : AntilipschitzWith 0 f)


@[simp]
theorem comap_unop_one :
    comap (↑(opLinearEquiv R : A ≃ₗ[R] Aᵐᵒᵖ).symm : Aᵐᵒᵖ →ₗ[R] A) (1 : Submodule R A) = 1

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

Submodule.comap (↑(MulOpposite.opLinearEquiv R).symm) 1 = 1


@[fun_prop]
theorem HasFDerivWithinAt.smul (hc : HasFDerivWithinAt c c' s x) (hf : HasFDerivWithinAt f f' s x) :
    HasFDerivWithinAt (fun y => c y • f y) (c x • f' + c'.smulRight (f x)) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{f' : E →L[𝕜] F}
{x : E}
{s : Set E}
{𝕜' : Type u_6}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{c : E → 𝕜'}
{c' : E →L[𝕜] 𝕜'}
(hc : HasFDerivWithinAt c c' s x)
(hf : HasFDerivWithinAt f f' s x)


theorem span_singleton_mul_eq_span_singleton_mul {x y : R} (I J : Ideal R) :
    span {x} * I = span {y} * J ↔
      (∀ zI ∈ I, ∃ zJ ∈ J, x * zI = y * zJ) ∧ ∀ zJ ∈ J, ∃ zI ∈ I, x * zI = y * zJ

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

Ideal.span {x} * I = Ideal.span {y} * J ↔ (∀ zI ∈ I, ∃ zJ ∈ J, x * zI = y * zJ) ∧ ∀ zJ ∈ J, ∃ zI ∈ I, x * zI = y * zJ


theorem uniformContinuous_equiv [∀ i, UniformSpace (β i)] :
    UniformContinuous (WithLp.equiv p (∀ i, β i))

(p : ℝ≥0∞)
{ι : Type u_2}
(β : ι → Type u_4)
[(i : ι) → UniformSpace (β i)]

UniformContinuous ⇑(WithLp.equiv p ((i : ι) → β i))


lemma image_ssubset_image {t : Finset α} (hf : Injective f) : s.image f ⊂ t.image f ↔ s ⊂ t

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
{f : α → β}
{s t : Finset α}
(hf : Function.Injective f)

Finset.image f s ⊂ Finset.image f t ↔ s ⊂ t


theorem continuousAt_iff' [TopologicalSpace β] {f : β → α} {b : β} :
    ContinuousAt f b ↔ ∀ ε > 0, ∀ᶠ x in 𝓝 b, dist (f x) (f b) < ε

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

ContinuousAt f b ↔ ∀ ε > 0, ∀ᶠ (x : β) in 𝓝 b, dist (f x) (f b) < ε


protected theorem mdifferentiable : MDifferentiable I 𝓘(𝕜, E) I

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


/-- The (colimit) cocone with cocone point `A`. -/
@[simps pt]
def cocone : Cocone (P.F ⋙ yoneda)

{A : CategoryTheory.Functor Cᵒᵖ (Type v)}

(P : CategoryTheory.Limits.IndObjectPresentation A)


theorem sort_sorted_lt (s : Finset α) : List.Sorted (· < ·) (sort (· ≤ ·) s)

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

List.Sorted (fun x x_1 => x < x_1) (Finset.sort (fun x x_1 => x ≤ x_1) s)


theorem size_extract_loop (as bs : Array α) (size start : Nat) :
    (extract.loop as size start bs).size = bs.size + min size (as.size - start)

{α : Type u_1}
(as bs : Array α)
(size start : Nat)

(Array.extract.loop as size start bs).size = bs.size + min size (as.size - start)


theorem zero_fst : (0 : 𝓜(𝕜, A)).fst = 0

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[SMulCommClass 𝕜 A A]
[IsScalarTower 𝕜 A A]


theorem isBigO_iff_isBoundedUnder_le_div (h : ∀ᶠ x in l, g'' x ≠ 0) :
    f =O[l] g'' ↔ IsBoundedUnder (· ≤ ·) l fun x => ‖f x‖ / ‖g'' x‖

{α : Type u_1}
{E : Type u_3}
{F'' : Type u_10}
[Norm E]
[NormedAddCommGroup F'']
{f : α → E}
{g'' : α → F''}
{l : Filter α}
(h : ∀ᶠ (x : α) in l, g'' x ≠ 0)

f =O[l] g'' ↔ Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l fun x => ‖f x‖ / ‖g'' x‖


/-- If there are subsets which are `ε₁`-dense and `ε₃`-dense in two spaces, and
isometric up to `ε₂`, then the Gromov-Hausdorff distance between the spaces is bounded by
`ε₁ + ε₂/2 + ε₃`. -/
theorem ghDist_le_of_approx_subsets {s : Set X} (Φ : s → Y) {ε₁ ε₂ ε₃ : ℝ}
    (hs : ∀ x : X, ∃ y ∈ s, dist x y ≤ ε₁) (hs' : ∀ x : Y, ∃ y : s, dist x (Φ y) ≤ ε₃)
    (H : ∀ x y : s, |dist x y - dist (Φ x) (Φ y)| ≤ ε₂) : ghDist X Y ≤ ε₁ + ε₂ / 2 + ε₃

{ε₁ ε₂ ε₃ : ℝ}

(hs : ∀ (x : X), ∃ y ∈ s, dist x y ≤ ε₁)

(hs' : ∀ (x : Y), ∃ y, dist x (Φ y) ≤ ε₃)

(H : ∀ (x y : ↑s), |dist x y - dist (Φ x) (Φ y)| ≤ ε₂)

GromovHausdorff.ghDist X Y ≤ ε₁ + ε₂ / 2 + ε₃


lemma add'_left_neg' (f : L.obj X ⟶ L.obj Y) :
    add' W (neg' W f) f = L.map 0

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_3, u_2} D]
[CategoryTheory.Preadditive C]
{L : CategoryTheory.Functor C D}
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
[W.HasLeftCalculusOfFractions]
{X Y : C}
(f : L.obj X ⟶ L.obj Y)

CategoryTheory.Localization.Preadditive.add' W (CategoryTheory.Localization.Preadditive.neg' W f) f = L.map 0


/-- Construct a `Finite` instance for a `Set` from a `Finset` with the same elements. -/
protected theorem Finite.ofFinset {p : Set α} (s : Finset α) (H : ∀ x, x ∈ s ↔ x ∈ p) : p.Finite

{α : Type u}
{p : Set α}
(s : Finset α)
(H : ∀ (x : α), x ∈ s ↔ x ∈ p)


@[simp, norm_cast] lemma natCast_mod (m n : ℕ) : (↑(m % n) : ℤ) = ↑m % ↑n


@[simp]
theorem inverseAssociator_obj_inl (X) : (inverseAssociator C D E).obj (inl X) = inl (inl X)

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

(CategoryTheory.sum.inverseAssociator C D E).obj (Sum.inl X) = Sum.inl (Sum.inl X)


theorem IsMinFilter.comp_tendsto {g : δ → α} {l' : Filter δ} {b : δ} (hf : IsMinFilter f l (g b))
    (hg : Tendsto g l' l) : IsMinFilter (f ∘ g) l' b

{α : Type u}
{β : Type v}
{δ : Type x}
[Preorder β]
{f : α → β}
{l : Filter α}
{g : δ → α}
{l' : Filter δ}
{b : δ}
(hf : IsMinFilter f l (g b))
(hg : Filter.Tendsto g l' l)


nonrec theorem ContinuousWithinAt.arsinh (h : ContinuousWithinAt f s a) :
    ContinuousWithinAt (fun x => arsinh (f x)) s a

{X : Type u_1}
[TopologicalSpace X]
{f : X → ℝ}
{s : Set X}
{a : X}
(h : ContinuousWithinAt f s a)

ContinuousWithinAt (fun x => Real.arsinh (f x)) s a


@[gcongr]
protected theorem add_left (c : ℕ) (h : a ≡ b [MOD n]) : c + a ≡ c + b [MOD n]


theorem basicOpen_eq_union_of_projection (f : A) :
    basicOpen 𝒜 f = ⨆ i : ℕ, basicOpen 𝒜 (GradedAlgebra.proj 𝒜 i f)

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

ProjectiveSpectrum.basicOpen 𝒜 f = ⨆ i, ProjectiveSpectrum.basicOpen 𝒜 ((GradedAlgebra.proj 𝒜 i) f)


@[simp]
theorem cons_subset_cons {hs ht} : s.cons a hs ⊆ t.cons a ht ↔ s ⊆ t

{α : Type u_1}
{s t : Finset α}
{a : α}
{hs : a ∉ s}
{ht : a ∉ t}

Finset.cons a s hs ⊆ Finset.cons a t ht ↔ s ⊆ t


/-- If two functions `g` and `f` are analytic respectively at `f x` and `x`, then `g ∘ f` is
analytic at `x`. -/
theorem AnalyticAt.comp {g : F → G} {f : E → F} {x : E} (hg : AnalyticAt 𝕜 g (f x))
    (hf : AnalyticAt 𝕜 f x) : AnalyticAt 𝕜 (g ∘ f) x

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
{G : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{g : F → G}
{f : E → F}
{x : E}
(hg : AnalyticAt 𝕜 g (f x))
(hf : AnalyticAt 𝕜 f x)


/-- If an `r`-decreasing chain `l` is empty or its head is accessible by `r`, then
  `l` is accessible by the lexicographic order `List.Lex r`. -/
theorem Acc.list_chain' {l : List.chains r} (acc : ∀ a ∈ l.val.head?, Acc r a) :
    Acc (List.lex_chains r) l

(acc : ∀ (a : α), a ∈ (↑l).head? → Acc r a)


@[to_additive (attr := simp, norm_cast)]
theorem coe_smul [SMul R M] [ContinuousConstSMul R M] (c : R) (f : C(α, M)) : ⇑(c • f) = c • ⇑f

{α : Type u_1}
[TopologicalSpace α]
{R : Type u_3}
{M : Type u_5}
[TopologicalSpace M]
[SMul R M]
[ContinuousConstSMul R M]
(c : R)
(f : C(α, M))


/-- **Structure theorem of finite abelian groups** : Any finite abelian group is a direct sum of
some `ZMod (p i ^ e i)` for some prime powers `p i ^ e i`. -/
theorem equiv_directSum_zmod_of_finite [Finite G] :
    ∃ (ι : Type) (_ : Fintype ι) (p : ι → ℕ) (_ : ∀ i, Nat.Prime <| p i) (e : ι → ℕ),
      Nonempty <| G ≃+ ⨁ i : ι, ZMod (p i ^ e i)

(G : Type u)
[AddCommGroup G]
[Finite G]

∃ ι x p, ∃ (_ : ∀ (i : ι), Nat.Prime (p i)), ∃ e, Nonempty (G ≃+ ⨁ (i : ι), ZMod (p i ^ e i))


theorem DirectSum.coeAddMonoidHom_eq_support_sum [DecidableEq σ] [DecidableEq R] [DecidableEq M]
    (x : DirectSum M fun i : M => ↥(weightedHomogeneousSubmodule R w i)) :
    (DirectSum.coeAddMonoidHom fun i : M => weightedHomogeneousSubmodule R w i) x =
      DFinsupp.sum x (fun _ x => ↑x)

(x : DirectSum M fun i => ↥(MvPolynomial.weightedHomogeneousSubmodule R w i))

(DirectSum.coeAddMonoidHom fun i => MvPolynomial.weightedHomogeneousSubmodule R w i) x =
  DFinsupp.sum x fun x x_1 => ↑x_1


theorem natCast_injective : Injective ((↑) : ℕ → Cardinal)


/-- Combine a family of alternating maps with the same domain and codomains `N i` into an
alternating map taking values in the space of functions `Π i, N i`. -/
@[simps!]
def pi {ι' : Type*} {N : ι' → Type*} [∀ i, AddCommMonoid (N i)] [∀ i, Module R (N i)]
    (f : ∀ i, M [⋀^ι]→ₗ[R] N i) : M [⋀^ι]→ₗ[R] (∀ i, N i)

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{ι : Type u_7}
{ι' : Type u_10}
{N : ι' → Type u_11}
[(i : ι') → AddCommMonoid (N i)]
[(i : ι') → Module R (N i)]
(f : (i : ι') → M [⋀^ι]→ₗ[R] N i)
(m : (i : ι) → (fun x => M) i)
(i : ι')


theorem one_lt_ncard (hs : s.Finite := by toFinite_tac) :
    1 < s.ncard ↔ ∃ a ∈ s, ∃ b ∈ s, a ≠ b

{α : Type u_1}
{s : Set α}
(hs : s.Finite := by toFinite_tac)


theorem dist_iterate_next_le (f₁ f₂ : FunSpace v) (n : ℕ) :
    dist (next^[n] f₁) (next^[n] f₂) ≤ (v.L * v.tDist) ^ n / n ! * dist f₁ f₂

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{v : PicardLindelof E}
(f₁ f₂ : v.FunSpace)
(n : ℕ)

dist (PicardLindelof.FunSpace.next^[n] f₁) (PicardLindelof.FunSpace.next^[n] f₂) ≤
  (↑v.L * v.tDist) ^ n / ↑n ! * dist f₁ f₂


@[simp]
theorem single_neg (a : α) (b : G) : single a (-b) = -single a b

{α : Type u_1}
{G : Type u_9}
[AddGroup G]
(a : α)
(b : G)

Finsupp.single a (-b) = -Finsupp.single a b


lemma boundaryGE_embeddingUpIntGE_iff (p : ℤ) (n : ℕ) :
    (embeddingUpIntGE p).BoundaryGE n ↔ n = 0

(ComplexShape.embeddingUpIntGE p).BoundaryGE n ↔ n = 0


theorem toZModPow_compat (m n : ℕ) (h : m ≤ n) :
    (ZMod.castHom (pow_dvd_pow p h) (ZMod (p ^ m))).comp (toZModPow p n) = toZModPow p m

(p : ℕ)
[hp : Fact (Nat.Prime p)]
(m n : ℕ)
(h : m ≤ n)

(ZMod.castHom ⋯ (ZMod (p ^ m))).comp (WittVector.toZModPow p n) = WittVector.toZModPow p m


theorem ContDiffWithinAt.norm_sq (hf : ContDiffWithinAt ℝ n f s x) :
    ContDiffWithinAt ℝ n (fun y => ‖f y‖ ^ 2) s x

(𝕜 : Type u_1)
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[NormedSpace ℝ E]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{f : G → E}
{s : Set G}
{x : G}
{n : ℕ∞}
(hf : ContDiffWithinAt ℝ n f s x)


/-- The Beta integral is convergent for all `u, v` of positive real part. -/
theorem betaIntegral_convergent {u v : ℂ} (hu : 0 < re u) (hv : 0 < re v) :
    IntervalIntegrable (fun x =>
      (x : ℂ) ^ (u - 1) * (1 - (x : ℂ)) ^ (v - 1) : ℝ → ℂ) volume 0 1

IntervalIntegrable (fun x => ↑x ^ (u - 1) * (1 - ↑x) ^ (v - 1)) MeasureTheory.volume 0 1


theorem upper_sub_lower_of_mem_splitCenter (h : J ∈ splitCenter I) (i : ι) :
    J.upper i - J.lower i = (I.upper i - I.lower i) / 2

(h : J ∈ BoxIntegral.Prepartition.splitCenter I)


theorem mul_iSup {ι : Sort v} (l : ι → Language α) (m : Language α) :
    (m * ⨆ i, l i) = ⨆ i, m * l i

{α : Type u_1}
{ι : Sort v}
(l : ι → Language α)
(m : Language α)


lemma ofJ'_j (j : R) [Invertible j] [Invertible (j - 1728)] : (ofJ' j).j = j

{R : Type u}
[CommRing R]
(j : R)
[Invertible j]
[Invertible (j - 1728)]


lemma preOneHypercover_sieve₁ (f₁ f₂ : S.Arrow) {W : C} (p₁ : W ⟶ f₁.Y) (p₂ : W ⟶ f₂.Y)
    (w : p₁ ≫ f₁.f = p₂ ≫ f₂.f) :
    S.preOneHypercover.sieve₁ p₁ p₂ = ⊤

{J : CategoryTheory.GrothendieckTopology C}

(w : CategoryTheory.CategoryStruct.comp p₁ f₁.f = CategoryTheory.CategoryStruct.comp p₂ f₂.f)


@[simp]
theorem floor_add_ofNat (a : α) (n : ℕ) [n.AtLeastTwo] :
    ⌊a + (no_index (OfNat.ofNat n))⌋ = ⌊a⌋ + OfNat.ofNat n

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(a : α)
(n : ℕ)
[n.AtLeastTwo]

⌊a + OfNat.ofNat n⌋ = ⌊a⌋ + OfNat.ofNat n


theorem expSeries_apply_eq_div (x : 𝔸) (n : ℕ) : (expSeries 𝕂 𝔸 n fun _ => x) = x ^ n / n !

{𝕂 : Type u_1}
{𝔸 : Type u_2}
[Field 𝕂]
[DivisionRing 𝔸]
[Algebra 𝕂 𝔸]
[TopologicalSpace 𝔸]
[TopologicalRing 𝔸]
(x : 𝔸)
(n : ℕ)

((NormedSpace.expSeries 𝕂 𝔸 n) fun x_1 => x) = x ^ n / ↑n.factorial


theorem GammaIntegral_ofReal (s : ℝ) :
    GammaIntegral ↑s = ↑(∫ x : ℝ in Ioi 0, Real.exp (-x) * x ^ (s - 1))

(↑s).GammaIntegral = ↑(∫ (x : ℝ) in Set.Ioi 0, rexp (-x) * x ^ (s - 1))


@[to_additive]
protected lemma mul_div_mul_left (h : IsUnit c) (a b : α) : c * a / (c * b) = a / b

{α : Type u}
[DivisionCommMonoid α]
{c : α}
(h : IsUnit c)
(a b : α)


theorem det_kronecker [Fintype m] [Fintype n] [DecidableEq m] [DecidableEq n] [CommRing R]
    (A : Matrix m m R) (B : Matrix n n R) :
    det (A ⊗ₖ B) = det A ^ Fintype.card n * det B ^ Fintype.card m

{R : Type u_1}
{m : Type u_9}
{n : Type u_10}
[Fintype m]
[Fintype n]
[DecidableEq m]
[DecidableEq n]
[CommRing R]
(A : Matrix m m R)
(B : Matrix n n R)

(Matrix.kroneckerMap (fun x x_1 => x * x_1) A B).det = A.det ^ Fintype.card n * B.det ^ Fintype.card m


theorem u_csInf' (gc : GaloisConnection l u) {s : Set β} (hne : s.Nonempty) (hbdd : BddBelow s) :
    u (sInf s) = sInf (u '' s)

{α : Type u_1}
{β : Type u_2}
[ConditionallyCompleteLattice α]
[ConditionallyCompleteLattice β]
{l : α → β}
{u : β → α}
(gc : GaloisConnection l u)
{s : Set β}
(hne : s.Nonempty)
(hbdd : BddBelow s)


theorem lookup_isSome {a : α} {s : Finmap β} : (s.lookup a).isSome ↔ a ∈ s

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

(Finmap.lookup a s).isSome = true ↔ a ∈ s


lemma card_relations_le_card_vars_of_isFinite [P.IsFinite] :
    Nat.card P.rels ≤ Nat.card P.vars

(P : Algebra.PreSubmersivePresentation R S)


theorem Iic_iInf₂ (f : ∀ i, κ i → α) : Iic (⨅ (i) (j), f i j) = ⨅ (i) (j), Iic (f i j)

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

LowerSet.Iic (⨅ i, ⨅ j, f i j) = ⨅ i, ⨅ j, LowerSet.Iic (f i j)


theorem reinsertAux_WF [BEq α] [Hashable α] {data : Buckets α β} {a : α} {b : β} (H : data.WF)
    (h₁ : ∀ [PartialEquivBEq α] [LawfulHashable α],
      haveI := mkIdx data.2 (hash a).toUSize
      data.val[this.1].All fun x _ => ¬(a == x)) :
    (reinsertAux data a b).WF

{data : Batteries.HashMap.Imp.Buckets α β}

(h₁ :
  ∀ [inst : PartialEquivBEq α] [inst : Batteries.HashMap.LawfulHashable α],
    Batteries.AssocList.All (fun x x_1 => ¬(a == x) = true)
      data.val[(Batteries.HashMap.Imp.mkIdx ⋯ (hash a).toUSize).val])

(Batteries.HashMap.Imp.reinsertAux data a b).WF


theorem map_dvd [Semigroup M] [Semigroup N] {F : Type*} [FunLike F M N] [MulHomClass F M N]
    (f : F) {a b} : a ∣ b → f a ∣ f b

{M : Type u_2}
{N : Type u_3}
[Semigroup M]
[Semigroup N]
{F : Type u_4}
[FunLike F M N]
[MulHomClass F M N]
(f : F)
{a b : M}


/-- Consider a series of functions `∑' n, f n x` on a preconnected open set. If the series converges
at a point, and all functions in the series are differentiable with a summable bound on the
derivatives, then the series converges everywhere on the set. -/
theorem summable_of_summable_hasFDerivAt_of_isPreconnected (hu : Summable u) (hs : IsOpen s)
    (h's : IsPreconnected s) (hf : ∀ n x, x ∈ s → HasFDerivAt (f n) (f' n x) x)
    (hf' : ∀ n x, x ∈ s → ‖f' n x‖ ≤ u n) (hx₀ : x₀ ∈ s) (hf0 : Summable (f · x₀))
    (hx : x ∈ s) : Summable fun n => f n x

(hf : ∀ (n : α), ∀ x ∈ s, HasFDerivAt (f n) (f' n x) x)

(hf' : ∀ (n : α), ∀ x ∈ s, ‖f' n x‖ ≤ u n)


/-- A slight reformulation of `IsLocalStructomorphWithinAt` when `f` is a partial homeomorph.
  This gives us an `e` that is defined on a subset of `f.source`. -/
theorem _root_.PartialHomeomorph.isLocalStructomorphWithinAt_iff {G : StructureGroupoid H}
    [ClosedUnderRestriction G] (f : PartialHomeomorph H H) {s : Set H} {x : H}
    (hx : x ∈ f.source ∪ sᶜ) :
    G.IsLocalStructomorphWithinAt (⇑f) s x ↔
      x ∈ s → ∃ e : PartialHomeomorph H H,
      e ∈ G ∧ e.source ⊆ f.source ∧ EqOn f (⇑e) (s ∩ e.source) ∧ x ∈ e.source

{H : Type u_1}
[TopologicalSpace H]
{G : StructureGroupoid H}
[ClosedUnderRestriction G]
(f : PartialHomeomorph H H)
{s : Set H}
{x : H}
(hx : x ∈ f.source ∪ sᶜ)

G.IsLocalStructomorphWithinAt (↑f) s x ↔
  x ∈ s → ∃ e ∈ G, e.source ⊆ f.source ∧ Set.EqOn (↑f) (↑e) (s ∩ e.source) ∧ x ∈ e.source


@[simp]
theorem map_act (f : S₁ →◃ S₂) {x y : S₁} : f (x ◃ y) = f x ◃ f y

{S₁ : Type u_1}
{S₂ : Type u_2}
[Shelf S₁]
[Shelf S₂]
(f : S₁ →◃ S₂)
{x y : S₁}


/-- The continued fraction `GenContFract.of v` terminates if and only if `v ∈ ℚ`. -/
theorem terminates_iff_rat (v : K) : (of v).Terminates ↔ ∃ q : ℚ, v = (q : K)

{K : Type u_1}
[LinearOrderedField K]
[FloorRing K]
(v : K)

(GenContFract.of v).Terminates ↔ ∃ q, v = ↑q


/-- Spec is fully faithful -/
@[simps]
def Spec.homEquiv {R S : CommRingCat} : (Spec S ⟶ Spec R) ≃ (R ⟶ S)

(f : AlgebraicGeometry.Spec S ⟶ AlgebraicGeometry.Spec R)

AlgebraicGeometry.Spec.homEquiv f = AlgebraicGeometry.Spec.preimage f


@[simp]
theorem one_le_prob_iff : 1 ≤ μ s ↔ μ s = 1

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
[MeasureTheory.IsProbabilityMeasure μ]


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

{M : Type u_1}
{α : Type u_2}
[TopologicalSpace α]
[AddMonoid M]
[AddAction M α]
[ContinuousConstVAdd M α]
(c : M)
(x : α)

c +ᵥ closure (AddAction.orbit M x) ⊆ closure (AddAction.orbit M x)


theorem const_isBounded (ι : Type*) [Nonempty ι] {p : Seminorm 𝕜 E} {q : ι' → Seminorm 𝕜₂ F}
    (f : E →ₛₗ[σ₁₂] F) : IsBounded (fun _ : ι => p) q f ↔ ∀ i, ∃ C : ℝ≥0, (q i).comp f ≤ C • p

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_5}
{F : Type u_6}
{ι' : Type u_9}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[NormedField 𝕜₂]
[AddCommGroup F]
[Module 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[RingHomIsometric σ₁₂]
(ι : Type u_10)
[Nonempty ι]
{p : Seminorm 𝕜 E}
{q : ι' → Seminorm 𝕜₂ F}
(f : E →ₛₗ[σ₁₂] F)

Seminorm.IsBounded (fun x => p) q f ↔ ∀ (i : ι'), ∃ C, (q i).comp f ≤ C • p


@[simp]
theorem natDegree_X : (X : R[X]).natDegree = 1

{R : Type u}
[Semiring R]
[Nontrivial R]


protected theorem ediv_eq_iff_eq_mul_left {a b c : Int}
    (H : b ≠ 0) (H' : b ∣ a) : a / b = c ↔ a = c * b


/-- `toDualProd` as an order embedding. -/
@[simps]
def toDualProdHom : NonemptyInterval α ↪o αᵒᵈ × α

∀ (a : NonemptyInterval α), NonemptyInterval.toDualProdHom a = a.toDualProd


theorem sin_eq_one_iff {x : ℝ} : sin x = 1 ↔ ∃ k : ℤ, π / 2 + k * (2 * π) = x

Real.sin x = 1 ↔ ∃ k, Real.pi / 2 + ↑k * (2 * Real.pi) = x


/-- The equivalence of categories `(J → C) ≌ (Discrete J ⥤ C)`. -/
@[simps]
def piEquivalenceFunctorDiscrete (J : Type u₂) (C : Type u₁) [Category.{v₁} C] :
    (J → C) ≌ (Discrete J ⥤ C)

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

(CategoryTheory.piEquivalenceFunctorDiscrete J C).counitIso =
  CategoryTheory.NatIso.ofComponents
    (fun F =>
      CategoryTheory.NatIso.ofComponents
        (fun j =>
          CategoryTheory.Iso.refl
            ((({ obj := fun F j => F.obj { as := j }, map := fun {X Y} f j => f.app { as := j }, map_id := ⋯,
                          map_comp := ⋯ }.comp
                      { obj := fun F => CategoryTheory.Discrete.functor F,
                        map := fun {X Y} f => CategoryTheory.Discrete.natTrans fun j => f j.as, map_id := ⋯,
                        map_comp := ⋯ }).obj
                  F).obj
              j))
        ⋯)
    ⋯


@[simps]
instance tensorRight (f : a ⟶ b) (g : b ⟶ b)
    [BicategoricalCoherence (𝟙 b) g] : BicategoricalCoherence f (f ≫ g)

[CategoryTheory.BicategoricalCoherence (𝟙 b) g]


theorem Antiperiodic.add_zsmul_eq [AddGroup α] [AddGroup β] (h : Antiperiodic f c) (n : ℤ) :
    f (x + n • c) = (n.negOnePow : ℤ) • f x

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c x : α}
[AddGroup α]
[AddGroup β]
(h : Function.Antiperiodic f c)
(n : ℤ)


/-- If `P` is a prime ideal of `R`, then `R[x]/(P)` is an integral domain. -/
theorem isDomain_map_C_quotient {P : Ideal R} (_ : IsPrime P) :
    IsDomain (R[X] ⧸ (map (C : R →+* R[X]) P : Ideal R[X]))

{R : Type u_1}
[CommRing R]
{P : Ideal R}

P.IsPrime → IsDomain (R[X] ⧸ Ideal.map Polynomial.C P)


@[to_additive]
theorem mul_prod_eq_prod_insertNone (f : α → M) (x : M) (s : Finset α) :
    x * ∏ i ∈ s, f i = ∏ i ∈ insertNone s, i.elim x f

{α : Type u_1}
{M : Type u_2}
[CommMonoid M]
(f : α → M)
(x : M)
(s : Finset α)

x * ∏ i ∈ s, f i = ∏ i ∈ Finset.insertNone s, i.elim x f


@[simp] theorem cast_mk (h : n = m) (i : Nat) (hn : i < n) : cast h ⟨i, hn⟩ = ⟨i, h ▸ hn⟩

{n m : Nat}
(h : n = m)
(i : Nat)
(hn : i < n)


theorem map_injective (f : L →ₐ[K] L') :
    Function.Injective (map f)

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


lemma embDomain_comapDomain {f : α ↪ β} {g : β →₀ M} (hg : ↑g.support ⊆ Set.range f) :
    embDomain f (comapDomain f g f.injective.injOn) = g

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[Zero M]
{f : α ↪ β}
{g : β →₀ M}
(hg : ↑g.support ⊆ Set.range ⇑f)

Finsupp.embDomain f (Finsupp.comapDomain (⇑f) g ⋯) = g


lemma iSup_coe_eq_top : ⨆ x, (f x : WithTop α) = ⊤ ↔ ¬BddAbove (range f)

{α : Type u_1}
{ι : Sort u_4}
[ConditionallyCompleteLinearOrderBot α]
{f : ι → α}

⨆ x, ↑(f x) = ⊤ ↔ ¬BddAbove (Set.range f)


theorem pairwise_map {l : List α} :
    (l.map f).Pairwise R ↔ l.Pairwise fun a b => R (f a) (f b)

∀ {α_1 : Type u_2} {f : α → α_1} {R : α_1 → α_1 → Prop} {l : List α},
  List.Pairwise R (List.map f l) ↔ List.Pairwise (fun a b => R (f a) (f b)) l


@[to_additive]
theorem units_inv_left : Commute (↑u) a → Commute (↑u⁻¹) a

{M : Type u_1}
[AddMonoid M]
{a : M}
{u : AddUnits M}

AddCommute (↑u) a → AddCommute (↑(-u)) a


/-- **Hölder's inequality for integrable functions**: the scalar multiplication of an integrable
vector-valued function by a scalar function with finite essential supremum is integrable. -/
theorem Integrable.essSup_smul {𝕜 : Type*} [NormedField 𝕜] [NormedSpace 𝕜 β] {f : α → β}
    (hf : Integrable f μ) {g : α → 𝕜} (g_aestronglyMeasurable : AEStronglyMeasurable g μ)
    (ess_sup_g : essSup (fun x => (‖g x‖₊ : ℝ≥0∞)) μ ≠ ∞) :
    Integrable (fun x : α => g x • f x) μ

(g_aestronglyMeasurable : MeasureTheory.AEStronglyMeasurable g μ)

(ess_sup_g : essSup (fun x => ↑‖g x‖₊) μ ≠ ⊤)

MeasureTheory.Integrable (fun x => g x • f x) μ


theorem isNoetherian_submodule_right {N : Submodule R M} :
    IsNoetherian R N ↔ ∀ s : Submodule R M, (s ⊓ N).FG

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{N : Submodule R M}

IsNoetherian R ↥N ↔ ∀ (s : Submodule R M), (s ⊓ N).FG


theorem hasStrongEpiMonoFactorisations_imp_of_isEquivalence (F : C ⥤ D) [IsEquivalence F]
    [h : HasStrongEpiMonoFactorisations C] : HasStrongEpiMonoFactorisations D

[h : CategoryTheory.Limits.HasStrongEpiMonoFactorisations C]


theorem smul_mem_pointwise_smul (m : A) (a : α) (S : AddSubgroup A) : m ∈ S → a • m ∈ a • S

{α : Type u_1}
{A : Type u_3}
[AddGroup A]
[Monoid α]
[DistribMulAction α A]
(m : A)
(a : α)
(S : AddSubgroup A)


private theorem cyclotomic_neg_one_pos {n : ℕ} (hn : 2 < n) {R} [LinearOrderedCommRing R] :
    0 < eval (-1 : R) (cyclotomic n R)

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

0 < Polynomial.eval (-1) (Polynomial.cyclotomic n R)


/-- Construct an isomorphism of `G` actions/representations
from an isomorphism of the underlying objects,
where the forward direction commutes with the group action. -/
@[simps]
def mkIso {M N : Action V G} (f : M.V ≅ N.V)
    (comm : ∀ g : G, M.ρ g ≫ f.hom = f.hom ≫ N.ρ g := by aesop_cat) : M ≅ N

(comm : ∀ (g : ↑G), M.ρ g ≫ f.hom = f.hom ≫ N.ρ g := by aesop_cat)


theorem cliqueFreeOn_of_card_lt {s : Finset α} (h : s.card < n) : G.CliqueFreeOn s n

{α : Type u_1}
(G : SimpleGraph α)
{n : ℕ}
{s : Finset α}
(h : s.card < n)


@[simp]
theorem toLinearIsometry_inj {f g : E ≃ₛₗᵢ[σ₁₂] E₂} :
    f.toLinearIsometry = g.toLinearIsometry ↔ f = g

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


/-- An action of a monoid `M` on a topological space is called *minimal* if the `M`-orbit of every
point `x : α` is dense. -/
@[to_additive]
class MulAction.IsMinimal (M α : Type*) [Monoid M] [TopologicalSpace α] [MulAction M α] :
    Prop where
  dense_orbit : ∀ x : α, Dense (MulAction.orbit M x)

{M : Type u_1}
{α : Type u_2}
[Monoid M]
[TopologicalSpace α]
[MulAction M α]
[self : MulAction.IsMinimal M α]
(x : α)


theorem comp_inv_eq_id (g : X ⟶ Y) [IsIso g] {f : X ⟶ Y} : f ≫ inv g = 𝟙 X ↔ f = g

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

CategoryTheory.CategoryStruct.comp f (CategoryTheory.inv g) = CategoryTheory.CategoryStruct.id X ↔ f = g


@[to_additive]
theorem mulIndicator_rel_mulIndicator {r : M → M → Prop} (h1 : r 1 1) (ha : a ∈ s → r (f a) (g a)) :
    r (mulIndicator s f a) (mulIndicator s g a)

{α : Type u_1}
{M : Type u_4}
[One M]
{s : Set α}
{f g : α → M}
{a : α}
{r : M → M → Prop}
(h1 : r 1 1)
(ha : a ∈ s → r (f a) (g a))

r (s.mulIndicator f a) (s.mulIndicator g a)


@[to_additive (attr := simp)]
theorem lift_comp_of' (f : FreeSemigroup α →ₙ* β) : lift (f ∘ of) = f

{α : Type u}
{β : Type v}
[AddSemigroup β]
(f : AddHom (FreeAddSemigroup α) β)

FreeAddSemigroup.lift (⇑f ∘ FreeAddSemigroup.of) = f


/--
Functorially postcompose a cone for `F` by a natural transformation `F ⟶ G` to give a cone for `G`.
-/
@[simps]
def postcompose {G : J ⥤ C} (α : F ⟶ G) : Cone F ⥤ Cone G

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F G : J ⥤ C}
(α : F ⟶ G)
(c : CategoryTheory.Limits.Cone F)

((CategoryTheory.Limits.Cones.postcompose α).obj c).π = c.π ≫ α


@[simp]
theorem sheafifyMap_comp {P Q R : Cᵒᵖ ⥤ D} (η : P ⟶ Q) (γ : Q ⟶ R) :
    J.sheafifyMap (η ≫ γ) = J.sheafifyMap η ≫ J.sheafifyMap γ

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

J.sheafifyMap (CategoryTheory.CategoryStruct.comp η γ) =
  CategoryTheory.CategoryStruct.comp (J.sheafifyMap η) (J.sheafifyMap γ)


theorem toFun_eq_coe (f : α ≃+*o β) : f.toFun = f

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


theorem integerNormalization_eq_zero_iff {p : K[X]} :
    integerNormalization (nonZeroDivisors A) p = 0 ↔ p = 0

{A : Type u_4}
{K : Type u_5}
[CommRing A]
[IsDomain A]
[Field K]
[Algebra A K]
[IsFractionRing A K]
{p : K[X]}

IsLocalization.integerNormalization (nonZeroDivisors A) p = 0 ↔ p = 0


/-- If a function is countably sub-multiplicative then it is binary sub-multiplicative -/
@[to_additive "If a function is countably sub-additive then it is binary sub-additive"]
theorem rel_sup_mul [CompleteLattice α] (m : α → M) (m0 : m ⊥ = 1) (R : M → M → Prop)
    (m_iSup : ∀ s : ℕ → α, R (m (⨆ i, s i)) (∏' i, m (s i))) (s₁ s₂ : α) :
    R (m (s₁ ⊔ s₂)) (m s₁ * m s₂)

(m_iSup : ∀ (s : ℕ → α), R (m (⨆ i, s i)) (∑' (i : ℕ), m (s i)))


theorem symm_apply_eq {x y} : e.symm x = y ↔ x = e y

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


@[simp]
theorem subsingleton_pure {a : α} : Filter.Subsingleton (pure a)


theorem abs_cpow_le (z w : ℂ) : abs (z ^ w) ≤ abs z ^ w.re / Real.exp (arg z * im w)

Complex.abs (z ^ w) ≤ Complex.abs z ^ w.re / rexp (z.arg * w.im)


@[simp]
theorem add_modEq_right : a + b ≡ b [PMOD p] ↔ a ≡ 0 [PMOD p]

{α : Type u_1}
[AddCommGroup α]
{p a b : α}


theorem roots_X_pow_char_sub_C {y : R} :
    (X ^ p - C y).roots = p • {(frobeniusEquiv R p).symm y}

{R : Type u_1}
[CommRing R]
[IsDomain R]
{p : ℕ}
[ExpChar R p]
[PerfectRing R p]
{y : R}

(Polynomial.X ^ p - Polynomial.C y).roots = p • {(frobeniusEquiv R p).symm y}


theorem exists_rep {α : Sort u} {r : α → α → Prop} (q : Quot r) : Exists (fun a => (Quot.mk r a) = q)


theorem gcd_mul_lcm [GCDMonoid α] : ∀ a b : α, Associated (gcd a b * lcm a b) (a * b)

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


theorem min_eq_left {a b : α} (h : a ≤ b) : min a b = a

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


@[simp, norm_cast]
theorem coe_top : ((⊤ : Opens α) : Set α) = Set.univ


theorem Matrix.toLinAlgEquiv_one : Matrix.toLinAlgEquiv v₁ 1 = LinearMap.id

{R : Type u_1}
[CommSemiring R]
{n : Type u_4}
[Fintype n]
[DecidableEq n]
{M₁ : Type u_5}
[AddCommMonoid M₁]
[Module R M₁]
(v₁ : Basis n R M₁)

(Matrix.toLinAlgEquiv v₁) 1 = LinearMap.id


protected theorem hasMFDerivAt : HasMFDerivAt 𝓘(𝕜, E) 𝓘(𝕜, E') f x f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
(f : E →L[𝕜] E')
{x : E}


theorem maxPowDiv_eq_multiplicity_get {p n : ℕ} (hp : 1 < p) (hn : 0 < n) (h : Finite p n) :
    p.maxPowDiv n = (multiplicity p n).get h

{p n : ℕ}
(hp : 1 < p)
(hn : 0 < n)
(h : multiplicity.Finite p n)


/-- The typeclass `Category C` describes morphisms associated to objects of type `C`.
The universe levels of the objects and morphisms are unconstrained, and will often need to be
specified explicitly, as `Category.{v} C`. (See also `LargeCategory` and `SmallCategory`.)

See <https://stacks.math.columbia.edu/tag/0014>.
-/
@[pp_with_univ]
class Category (obj : Type u) extends CategoryStruct.{v} obj : Type max u (v + 1) where
  /-- Identity morphisms are left identities for composition. -/
  id_comp : ∀ {X Y : obj} (f : X ⟶ Y), 𝟙 X ≫ f = f := by aesop_cat
  /-- Identity morphisms are right identities for composition. -/
  comp_id : ∀ {X Y : obj} (f : X ⟶ Y), f ≫ 𝟙 Y = f := by aesop_cat
  /-- Composition in a category is associative. -/
  assoc : ∀ {W X Y Z : obj} (f : W ⟶ X) (g : X ⟶ Y) (h : Y ⟶ Z), (f ≫ g) ≫ h = f ≫ g ≫ h := by
    aesop_cat

[self : CategoryTheory.Category.{v, u} obj]

CategoryTheory.CategoryStruct.comp f (CategoryTheory.CategoryStruct.id Y) = f


theorem isBounded_Ico (a b : α) : IsBounded (Ico a b)

{α : Type u}
[PseudoMetricSpace α]
[Preorder α]
[CompactIccSpace α]
(a b : α)


@[simp]
lemma comp_val {X Y Z : Condensed.{u} C} (f : X ⟶ Y) (g : Y ⟶ Z) : (f ≫ g).val = f.val ≫ g.val

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


@[simp]
theorem add_snd (x y : X q) : (x + y).2 = x.2 + y.2


/-- The `StarSubalgebra.inclusion` of a closed star subalgebra is a `ClosedEmbedding`. -/
theorem closedEmbedding_inclusion {S₁ S₂ : StarSubalgebra R A} (h : S₁ ≤ S₂)
    (hS₁ : IsClosed (S₁ : Set A)) : ClosedEmbedding (inclusion h)

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[StarRing R]
[TopologicalSpace A]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
{S₁ S₂ : StarSubalgebra R A}
(h : S₁ ≤ S₂)
(hS₁ : IsClosed ↑S₁)


theorem trans_target' : (e.trans e').target = e'.target ∩ e'.symm ⁻¹' (e'.source ∩ e.target)

{X : Type u_1}
{Y : Type u_3}
{Z : Type u_5}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(e : PartialHomeomorph X Y)
(e' : PartialHomeomorph Y Z)

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


lemma Shatters.exists_inter_eq_singleton (hs : Shatters 𝒜 s) (ha : a ∈ s) : ∃ t ∈ 𝒜, s ∩ t = {a}

{α : Type u_1}
[DecidableEq α]
{𝒜 : Finset (Finset α)}
{s : Finset α}
{a : α}
(hs : 𝒜.Shatters s)
(ha : a ∈ s)


theorem single_zpow (n : ℤ) :
    single (n : ℤ) (1 : F) = single (1 : ℤ) 1 ^ n

(HahnSeries.single n) 1 = (HahnSeries.single 1) 1 ^ n


@[simp]
theorem _root_.BoxIntegral.Prepartition.distortion_biUnionTagged (π : Prepartition I)
    (πi : ∀ J, TaggedPrepartition J) :
    (π.biUnionTagged πi).distortion = π.boxes.sup fun J => (πi J).distortion

(πi : (J : BoxIntegral.Box ι) → BoxIntegral.TaggedPrepartition J)


@[simp]
theorem iUnion_singleton_eq_range {α β : Type*} (f : α → β) : ⋃ x : α, {f x} = range f

{α : Type u_11}
{β : Type u_12}
(f : α → β)


/-- If `s : Set 𝕜` with `RCLike 𝕜` is compact and contains `0`, then the non-unital star subalgebra
generated by the identity function in `C(s, 𝕜)₀` is dense. This can be seen as a version of the
Weierstrass approximation theorem. -/
lemma ContinuousMapZero.adjoin_id_dense {s : Set 𝕜} [Zero s] (h0 : ((0 : s) : 𝕜) = 0)
    [CompactSpace s] : Dense (adjoin 𝕜 {(.id h0 : C(s, 𝕜)₀)} : Set C(s, 𝕜)₀)

{𝕜 : Type u_2}
[RCLike 𝕜]
{s : Set 𝕜}
[Zero ↑s]
(h0 : ↑0 = 0)
[CompactSpace ↑s]

Dense ↑(NonUnitalStarAlgebra.adjoin 𝕜 {ContinuousMapZero.id h0})


/-- Given an ideal `𝓟` of a commutative semiring `R`, we say that a polynomial `f : R[X]`
is *weakly Eisenstein at `𝓟`* if `∀ n, n < f.natDegree → f.coeff n ∈ 𝓟`. -/
@[mk_iff]
structure IsWeaklyEisensteinAt [CommSemiring R] (f : R[X]) (𝓟 : Ideal R) : Prop where
  mem : ∀ {n}, n < f.natDegree → f.coeff n ∈ 𝓟

{R : Type u}
[CommSemiring R]
(f : R[X])
(𝓟 : Ideal R)

f.IsWeaklyEisensteinAt 𝓟 ↔ ∀ {n : ℕ}, n < f.natDegree → f.coeff n ∈ 𝓟


/-- Restriction of `f : α →o α →o β` to the diagonal. -/
@[simps! (config := { simpRhs := true })]
def onDiag (f : α →o α →o β) : α →o β

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
(f : α →o α →o β)


theorem IsSymmetric.conj_inner_sym {T : E →ₗ[𝕜] E} (hT : IsSymmetric T) (x y : E) :
    conj ⟪T x, y⟫ = ⟪T y, x⟫

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{T : E →ₗ[𝕜] E}
(hT : T.IsSymmetric)
(x y : E)


@[simp]
theorem boundary_hnot_hnot (a : α) : ∂ (￢￢a) = ∂ (￢a)

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


@[simp] lemma natCast_ne_top (n : ℕ) : (n : WithTop α) ≠ ⊤

{α : Type u}
[AddMonoidWithOne α]
(n : ℕ)


@[to_additive]
theorem map_eq_bot_iff {f : G →* N} : H.map f = ⊥ ↔ H ≤ f.ker

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
(H : Subgroup G)
{f : G →* N}


@[to_additive (attr := simp)]
theorem mem_inf {x} : x ∈ U ⊓ V ↔ x ∈ U ∧ x ∈ V

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]
{U V : OpenAddSubgroup G}
{x : G}


lemma hasMap (c : ∀ j, CofanMapObjFun X p j) (hc : ∀ j, IsColimit (c j)) :
    X.HasMap p

(hc : (j : J) → CategoryTheory.Limits.IsColimit (c j))


theorem approx_of_mem_C (c : CU P) (n : ℕ) {x : X} (hx : x ∈ c.C) : c.approx n x = 0

{X : Type u_1}
[TopologicalSpace X]
{P : Set X → Prop}
(c : Urysohns.CU P)
(n : ℕ)
{x : X}
(hx : x ∈ c.C)


theorem Forall₂.flip : ∀ {a b}, Forall₂ (flip R) b a → Forall₂ R a b

{α : Type u_1}
{β : Type u_2}
{R : α → β → Prop}
{a : List α}
{b : List β}

List.Forall₂ (flip R) b a → List.Forall₂ R a b


@[to_additive (attr := simp, to_additive) (reorder := 1 2, 4 5) ofLex_smul]
theorem ofLex_pow [Pow α β] (a : Lex α) (b : β) : ofLex (a ^ b) = ofLex a ^ b

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


/-- The gauge evaluated at `0` is always zero (mathematically this requires `0` to be in the set `s`
but, the real infimum of the empty set in Lean being defined as `0`, it holds unconditionally). -/
@[simp]
theorem gauge_zero : gauge s 0 = 0

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}


lemma unop_iff {c : RingCon Rᵐᵒᵖ} {x y : R} : c.unop x y ↔ c (.op y) (.op x)

{R : Type u_1}
[Add R]
[Mul R]
{c : RingCon Rᵐᵒᵖ}
{x y : R}

c.unop x y ↔ c (MulOpposite.op y) (MulOpposite.op x)


/-- The value of `affineCombination`, where the given points are equal. -/
@[simp]
theorem affineCombination_apply_const (w : ι → k) (p : P) (h : ∑ i ∈ s, w i = 1) :
    s.affineCombination k (fun _ => p) w = p

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
(s : Finset ι)
(w : ι → k)
(p : P)
(h : ∑ i ∈ s, w i = 1)

(Finset.affineCombination k s fun x => p) w = p


@[simp]
theorem map_id (m : OuterMeasure α) : map id m = m

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

(MeasureTheory.OuterMeasure.map id) m = m


/-- An alternative statement of the Stone-Weierstrass theorem.

If `A` is a subalgebra of `C(X, ℝ)` which separates points (and `X` is compact),
every real-valued continuous function on `X` is a uniform limit of elements of `A`.
-/
theorem continuousMap_mem_subalgebra_closure_of_separatesPoints (A : Subalgebra ℝ C(X, ℝ))
    (w : A.SeparatesPoints) (f : C(X, ℝ)) : f ∈ A.topologicalClosure

{X : Type u_1}
[TopologicalSpace X]
[CompactSpace X]
(A : Subalgebra ℝ C(X, ℝ))
(w : A.SeparatesPoints)
(f : C(X, ℝ))


/-- If `τ` is a `CanonicallyOrderedAddCommMonoid` (e.g., `ℕ` or `ℝ≥0`), then the notions
`IsFwInvariant` and `IsInvariant` are equivalent. -/
theorem IsFwInvariant.isInvariant [CanonicallyOrderedAddCommMonoid τ] {ϕ : τ → α → α} {s : Set α}
    (h : IsFwInvariant ϕ s) : IsInvariant ϕ s

{τ : Type u_1}
{α : Type u_2}
[CanonicallyOrderedAddCommMonoid τ]
{ϕ : τ → α → α}
{s : Set α}
(h : IsFwInvariant ϕ s)


theorem existsUnique_add_zsmul_mem_Ico {a : α} (ha : 0 < a) (b c : α) :
    ∃! m : ℤ, b + m • a ∈ Set.Ico c (c + a)

{α : Type u_1}
[LinearOrderedAddCommGroup α]
[Archimedean α]
{a : α}
(ha : 0 < a)
(b c : α)


theorem eraseIdx_append_of_lt_length {l : List α} {k : Nat} (hk : k < length l) (l' : List α) :
    eraseIdx (l ++ l') k = eraseIdx l k ++ l'

{α : Type u}
{l : List α}
{k : Nat}
(hk : k < l.length)
(l' : List α)

(l ++ l').eraseIdx k = l.eraseIdx k ++ l'


lemma ShortExact.isIso_g_iff  {S : ShortComplex C} (hS : S.ShortExact) [Balanced C] :
    IsIso S.g ↔ IsZero S.X₁

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{S : CategoryTheory.ShortComplex C}
(hS : S.ShortExact)
[CategoryTheory.Balanced C]

CategoryTheory.IsIso S.g ↔ CategoryTheory.Limits.IsZero S.X₁


/-- The inclusion of a subpresheaf to the original presheaf. -/
@[simps]
def Subpresheaf.ι : G.toPresheaf ⟶ F

(G : CategoryTheory.GrothendieckTopology.Subpresheaf F)


/-- A continuous linear map between seminormed spaces is bounded when the field is nontrivially
normed. The continuity ensures boundedness on a ball of some radius `ε`. The nontriviality of the
norm is then used to rescale any element into an element of norm in `[ε/C, ε]`, whose image has a
controlled norm. The norm control for the original element follows by rescaling. -/
theorem SemilinearMapClass.bound_of_continuous [SemilinearMapClass 𝓕 σ₁₂ E F] (f : 𝓕)
    (hf : Continuous f) : ∃ C, 0 < C ∧ ∀ x : E, ‖f x‖ ≤ C * ‖x‖

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
{𝓕 : Type u_10}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[FunLike 𝓕 E F]
[RingHomIsometric σ₁₂]
[SemilinearMapClass 𝓕 σ₁₂ E F]
(f : 𝓕)
(hf : Continuous ⇑f)


@[to_additive coe_prod]
theorem coe_prod (s : Submonoid M) (t : Submonoid N) :
    (s.prod t : Set (M × N)) = (s : Set M) ×ˢ (t : Set N)

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
(s : Submonoid M)
(t : Submonoid N)


@[simp]
theorem singleton_repr (ι R : Type*) [Unique ι] [Semiring R] (x i) :
    (Basis.singleton ι R).repr x i = x

(ι : Type u_10)
(R : Type u_11)
[Unique ι]
[Semiring R]
(x : R)
(i : ι)


theorem get?_of_mem {a} {l : List α} (h : a ∈ l) : ∃ n, l.get? n = some a

{α : Type u_1}
{a : α}
{l : List α}
(h : a ∈ l)


/-- `a < b` as natural numbers if and only if `a < b` in `Fin n`. -/
@[norm_cast, simp]
theorem val_fin_lt {n : ℕ} {a b : Fin n} : (a : ℕ) < (b : ℕ) ↔ a < b


/-- To give an isomorphism between cones, it suffices to give an
  isomorphism between their vertices which commutes with the cone
  maps. -/
-- Porting note: `@[ext]` used to accept lemmas like this. Now we add an aesop rule
@[aesop apply safe (rule_sets := [CategoryTheory]), simps]
def ext {c c' : Cone F} (φ : c.pt ≅ c'.pt)
    (w : ∀ j, c.π.app j = φ.hom ≫ c'.π.app j := by aesop_cat) : c ≅ c'

(w : ∀ (j : J), c.π.app j = φ.hom ≫ c'.π.app j := by aesop_cat)

(CategoryTheory.Limits.Cones.ext φ w).inv.hom = φ.inv


@[to_additive (attr := simp)]
theorem card_mul_singleton : (s * {a}).card = s.card

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


/-- A functor `F : C ⥤ D` is representably-flat functor if the comma category `(X/F)`
is cofiltered for each `X : C`.
-/
class RepresentablyFlat (F : C ⥤ D) : Prop where
  cofiltered : ∀ X : D, IsCofiltered (StructuredArrow X F)

[self : CategoryTheory.RepresentablyFlat F]

CategoryTheory.IsCofiltered (CategoryTheory.StructuredArrow X F)


@[continuity, fun_prop]
theorem continuous_id' : Continuous (fun (x : X) => x)


theorem add.aux (a b : Rat) {g ad bd} (hg : g = a.den.gcd b.den)
    (had : ad = a.den / g) (hbd : bd = b.den / g) :
    let den := ad * b.den; let num := a.num * bd + b.num * ad
    num.natAbs.gcd g = num.natAbs.gcd den

(a b : Rat)
{g ad bd : Nat}
(hg : g = a.den.gcd b.den)
(had : ad = a.den / g)
(hbd : bd = b.den / g)

let den := ad * b.den;
let num := a.num * ↑bd + b.num * ↑ad;
num.natAbs.gcd g = num.natAbs.gcd den


protected theorem HasFDerivAtFilter.iterate {f : E → E} {f' : E →L[𝕜] E}
    (hf : HasFDerivAtFilter f f' x L) (hL : Tendsto f L L) (hx : f x = x) (n : ℕ) :
    HasFDerivAtFilter f^[n] (f' ^ n) x L

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{L : Filter E}
{f : E → E}
{f' : E →L[𝕜] E}
(hf : HasFDerivAtFilter f f' x L)
(hL : Filter.Tendsto f L L)
(hx : f x = x)
(n : ℕ)


theorem real_inner_smul_left (x y : F) (r : ℝ) : ⟪r • x, y⟫_ℝ = r * ⟪x, y⟫_ℝ

{F : Type u_3}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
(x y : F)
(r : ℝ)


theorem relIso_enum {α β : Type u} {r : α → α → Prop} {s : β → β → Prop} [IsWellOrder α r]
    [IsWellOrder β s] (f : r ≃r s) (o : Ordinal) (hr : o < type r) :
    f (enum r o hr) =
      enum s o
        (by
          convert hr using 1
          apply Quotient.sound
          exact ⟨f.symm⟩)

{α β : Type u}
{r : α → α → Prop}
{s : β → β → Prop}
[IsWellOrder α r]
[IsWellOrder β s]
(f : r ≃r s)
(o : Ordinal.{u})
(hr : o < Ordinal.type r)

f (Ordinal.enum r o hr) = Ordinal.enum s o ⋯


theorem toMatrix_injective [DecidableEq n] [MonoidWithZero α] [Nontrivial α] :
    Function.Injective (@toMatrix m n α _ _ _)

{m : Type u_3}
{n : Type u_4}
{α : Type v}
[DecidableEq n]
[MonoidWithZero α]
[Nontrivial α]


theorem atImInfty_mem (S : Set ℍ) : S ∈ atImInfty ↔ ∃ A : ℝ, ∀ z : ℍ, A ≤ im z → z ∈ S

S ∈ UpperHalfPlane.atImInfty ↔ ∃ A, ∀ (z : ℍ), A ≤ z.im → z ∈ S