/-- A real differentiable map `f` is conformal at point `x` if and only if its
    differential `f'` at that point scales every inner product by a positive scalar. -/
theorem conformalAt_iff {f : E → F} {x : E} {f' : E →L[ℝ] F} (h : HasFDerivAt f f' x) :
    ConformalAt f x ↔ ∃ c : ℝ, 0 < c ∧ ∀ u v : E, ⟪f' u, f' v⟫ = c * ⟪u, v⟫

{E : Type u_1}
{F : Type u_2}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[InnerProductSpace ℝ E]
[InnerProductSpace ℝ F]
{f : E → F}
{x : E}
{f' : E →L[ℝ] F}
(h : HasFDerivAt f f' x)

ConformalAt f x ↔ ∃ c, 0 < c ∧ ∀ (u v : E), ⟪f' u, f' v⟫_ℝ = c * ⟪u, v⟫_ℝ


lemma nonempty_countableGeneratingSet [MeasurableSpace α] [CountablyGenerated α] :
    Set.Nonempty (countableGeneratingSet α)

{α : Type u_1}
[MeasurableSpace α]
[MeasurableSpace.CountablyGenerated α]


@[simp]
theorem mkPiAlgebraFin_apply (m : Fin n → A) :
    ContinuousMultilinearMap.mkPiAlgebraFin R n A m = (List.ofFn m).prod

{R : Type u}
{n : ℕ}
{A : Type u_1}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[TopologicalSpace A]
[ContinuousMul A]
(m : Fin n → A)

(ContinuousMultilinearMap.mkPiAlgebraFin R n A) m = (List.ofFn m).prod


/-- On a compact uniform space, the topology determines the uniform structure, entourages are
exactly the neighborhoods of the diagonal. -/
theorem compactSpace_uniformity [CompactSpace α] : 𝓤 α = ⨆ x, 𝓝 (x, x)

{α : Type u_1}
[UniformSpace α]
[CompactSpace α]


theorem Asymptotics.IsLittleO.sum_range {α : Type*} [NormedAddCommGroup α] {f : ℕ → α} {g : ℕ → ℝ}
    (h : f =o[atTop] g) (hg : 0 ≤ g) (h'g : Tendsto (fun n => ∑ i ∈ range n, g i) atTop atTop) :
    (fun n => ∑ i ∈ range n, f i) =o[atTop] fun n => ∑ i ∈ range n, g i

(h'g : Filter.Tendsto (fun n => ∑ i ∈ Finset.range n, g i) Filter.atTop Filter.atTop)

(fun n => ∑ i ∈ Finset.range n, f i) =o[Filter.atTop] fun n => ∑ i ∈ Finset.range n, g i


theorem IsPRadical.pow_mem [IsPRadical i p] (x : L) :
    ∃ (n : ℕ) (y : K), i y = x ^ p ^ n

{K : Type u_1}
{L : Type u_2}
[CommSemiring K]
[CommSemiring L]
(i : K →+* L)
(p : ℕ)
[IsPRadical i p]
(x : L)


@[simp] theorem succ_le_succ_iff {a b : Fin n} : a.succ ≤ b.succ ↔ a ≤ b


lemma nonneg_iff_isSelfAdjoint_and_quasispectrumRestricts {a : A} :
    0 ≤ a ↔ IsSelfAdjoint a ∧ QuasispectrumRestricts a ContinuousMap.realToNNReal

0 ≤ a ↔ IsSelfAdjoint a ∧ QuasispectrumRestricts a ⇑ContinuousMap.realToNNReal


theorem exists_mem_of_nonempty (α) : ∀ [Nonempty α], ∃ x : α, x ∈ (univ : Set α)


@[to_additive]
theorem RightCancelMonoid.toMonoid_injective {M : Type u} :
    Function.Injective (@RightCancelMonoid.toMonoid M)


/-- Given a Localization map `f : M →* N` for a Submonoid `S ⊆ M` and a map of `CommMonoid`s
`g : M →* P` such that `g y` is invertible for all `y : S`, the homomorphism induced from
`N` to `P` maps `f x * (f y)⁻¹` to `g x * (g y)⁻¹` for all `x : M, y ∈ S`. -/
@[to_additive
    "Given a Localization map `f : M →+ N` for a Submonoid `S ⊆ M` and a map of
`AddCommMonoid`s `g : M →+ P` such that `g y` is invertible for all `y : S`, the homomorphism
induced from `N` to `P` maps `f x - f y` to `g x - g y` for all `x : M, y ∈ S`."]
theorem lift_mk' (x y) : f.lift hg (f.mk' x y) = g x * (IsUnit.liftRight (g.restrict S) hg y)⁻¹

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
{P : Type u_3}
[CommMonoid P]
(f : S.LocalizationMap N)
{g : M →* P}
(hg : ∀ (y : ↥S), IsUnit (g ↑y))
(x : M)
(y : ↥S)

(f.lift hg) (f.mk' x y) = g x * ↑((IsUnit.liftRight (g.restrict S) hg) y)⁻¹


@[simp]
theorem IntegrableAtFilter.inf_ae_iff {l : Filter α} :
    IntegrableAtFilter f (l ⊓ ae μ) μ ↔ IntegrableAtFilter f l μ

{α : Type u_1}
{E : Type u_3}
[MeasurableSpace α]
[NormedAddCommGroup E]
{f : α → E}
{μ : MeasureTheory.Measure α}
{l : Filter α}

MeasureTheory.IntegrableAtFilter f (l ⊓ MeasureTheory.ae μ) μ ↔ MeasureTheory.IntegrableAtFilter f l μ


@[simp] lemma divInt_neg (n d : ℤ) : n /. -d = -n /. d


@[to_additive] lemma IsMulFreimanHom.div {β : Type*} [DivisionCommMonoid β] {B₁ B₂ : Set β}
    {f₁ f₂ : α → β} (h₁ : IsMulFreimanHom n A B₁ f₁) (h₂ : IsMulFreimanHom n A B₂ f₂) :
    IsMulFreimanHom n A (B₁ / B₂) (f₁ / f₂)

{α : Type u_2}
[AddCommMonoid α]
{A : Set α}
{n : ℕ}
{β : Type u_5}
[SubtractionCommMonoid β]
{B₁ B₂ : Set β}
{f₁ f₂ : α → β}
(h₁ : IsAddFreimanHom n A B₁ f₁)
(h₂ : IsAddFreimanHom n A B₂ f₂)


/-- Division `y ↦ x / y` as an `IsometryEquiv`. -/
@[to_additive (attr := simps! apply symm_apply toEquiv)
  "Subtraction `y ↦ x - y` as an `IsometryEquiv`."]
def divLeft (c : G) : G ≃ᵢ G

{G : Type v}
[AddGroup G]
[PseudoEMetricSpace G]
[IsometricVAdd G G]
[IsometricVAdd Gᵃᵒᵖ G]
(c b : G)

(IsometryEquiv.subLeft c).symm b = -b + c


@[simp] theorem default_eq_zero : default = (0 : Int)


theorem basicOpen_mul_le_right (f g : R) : basicOpen (f * g) ≤ basicOpen g

PrimeSpectrum.basicOpen (f * g) ≤ PrimeSpectrum.basicOpen g


theorem isSupported_upwards (hs : IsSupported x s) (hst : s ⊆ t) : IsSupported x t

{α : Type u}
{x : FreeCommRing α}
{s t : Set α}
(hs : x.IsSupported s)
(hst : s ⊆ t)


theorem fderiv_smul_const (hc : DifferentiableAt 𝕜 c x) (f : F) :
    fderiv 𝕜 (fun y => c y • f) x = (fderiv 𝕜 c x).smulRight f

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


theorem prod_apply' (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel α γ) [IsSFiniteKernel η]
    (a : α) {s : Set (β × γ)} (hs : MeasurableSet s) :
    (κ ×ₖ η) a s = ∫⁻ b : β, (η a) {c : γ | (b, c) ∈ s} ∂κ a

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{γ : Type u_4}
{mγ : MeasurableSpace γ}
(κ : ProbabilityTheory.Kernel α β)
[ProbabilityTheory.IsSFiniteKernel κ]
(η : ProbabilityTheory.Kernel α γ)
[ProbabilityTheory.IsSFiniteKernel η]
(a : α)
{s : Set (β × γ)}
(hs : MeasurableSet s)

((κ.prod η) a) s = ∫⁻ (b : β), (η a) {c | (b, c) ∈ s} ∂κ a


nonrec theorem symm : e.symm.MDifferentiable I' I

(he : PartialHomeomorph.MDifferentiable I I' e)

PartialHomeomorph.MDifferentiable I' I e.symm


@[simp]
theorem dedup_nil : dedup [] = ([] : List α)


/-- In a commutative ring, make `simp` prefer leaving the order unchanged. -/
@[simp]
theorem star_mul' [CommSemigroup R] [StarMul R] (x y : R) : star (x * y) = star x * star y

{R : Type u}
[CommSemigroup R]
[StarMul R]
(x y : R)


/-- **Regular conditional probability distribution**: kernel associated with the conditional
expectation of `Y` given `X`.
For almost all `a`, `condDistrib Y X μ` evaluated at `X a` and a measurable set `s` is equal to
the conditional expectation `μ⟦Y ⁻¹' s | mβ.comap X⟧ a`. It also satisfies the equality
`μ[(fun a => f (X a, Y a)) | mβ.comap X] =ᵐ[μ] fun a => ∫ y, f (X a, y) ∂(condDistrib Y X μ (X a))`
for all integrable functions `f`. -/
noncomputable irreducible_def condDistrib {_ : MeasurableSpace α} [MeasurableSpace β] (Y : α → Ω)
    (X : α → β) (μ : Measure α) [IsFiniteMeasure μ] : Kernel β Ω

{α : Type u_5}
{β : Type u_6}
{Ω : Type u_7}
[MeasurableSpace Ω]
[StandardBorelSpace Ω]
[Nonempty Ω]

∀ {x : MeasurableSpace α} [inst : MeasurableSpace β] (Y : α → Ω) (X : α → β) (μ : MeasureTheory.Measure α)
  [inst_1 : MeasureTheory.IsFiniteMeasure μ],
  ProbabilityTheory.condDistrib Y X μ = (MeasureTheory.Measure.map (fun a => (X a, Y a)) μ).condKernel


@[to_additive (attr := simp)]
lemma dist_unop (x y : αᵐᵒᵖ) : dist (unop x) (unop y) = dist x y

{α : Type u_1}
[PseudoMetricSpace α]
(x y : αᵃᵒᵖ)

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


/-- The product of `f y` over `y ∈ Set.range g` equals the product of `f (g i)` over all `i`
provided that `g` is injective on `mulSupport (f ∘ g)`. -/
@[to_additive
      "The sum of `f y` over `y ∈ Set.range g` equals the sum of `f (g i)` over all `i`
      provided that `g` is injective on `support (f ∘ g)`."]
theorem finprod_mem_range' {g : β → α} (hg : (mulSupport (f ∘ g)).InjOn g) :
    ∏ᶠ i ∈ range g, f i = ∏ᶠ j, f (g j)

(hg : Set.InjOn g (Function.mulSupport (f ∘ g)))

∏ᶠ (i : α) (_ : i ∈ Set.range g), f i = ∏ᶠ (j : β), f (g j)


@[to_additive]
theorem mem_emetric_ball_one_iff {r : ℝ≥0∞} : a ∈ EMetric.ball (1 : E) r ↔ ↑‖a‖₊ < r

{E : Type u_6}
[SeminormedGroup E]
{a : E}
{r : ℝ≥0∞}


protected theorem HasCompactSupport.fderiv_apply (hf : HasCompactSupport f) (v : E) :
    HasCompactSupport (fderiv 𝕜 f · v)

(𝕜 : Type u_1)
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
(hf : HasCompactSupport f)
(v : E)

HasCompactSupport fun x => (fderiv 𝕜 f x) v


@[simp]
theorem sumCompl_apply_inl (p : α → Prop) [DecidablePred p] (x : { a // p a }) :
    sumCompl p (Sum.inl x) = x

{α : Type u_1}
(p : α → Prop)
[DecidablePred p]
(x : { a // p a })


lemma liminf_comp (u : β → α) (v : γ → β) (f : Filter γ) :
    liminf (u ∘ v) f = liminf u (map v f)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[ConditionallyCompleteLattice α]
(u : β → α)
(v : γ → β)
(f : Filter γ)

Filter.liminf (u ∘ v) f = Filter.liminf u (Filter.map v f)


theorem foldr_le_nfpFamily (f : ι → Ordinal → Ordinal)
    (a l) : List.foldr f a l ≤ nfpFamily.{u, v} f a

(f : ι → Ordinal.{max u v} → Ordinal.{max u v})

List.foldr f a l ≤ Ordinal.nfpFamily f a


@[simp]
theorem multispan_obj_right (b) : I.multispan.obj (WalkingMultispan.right b) = I.right b

(I : CategoryTheory.Limits.MultispanIndex C)

I.multispan.obj (CategoryTheory.Limits.WalkingMultispan.right b) = I.right b


/-- The canonical `LeftHomologyData` of a short complex `S` in an abelian category, for
which the `H` field is `Abelian.coimage (kernel.ι S.g ≫ cokernel.π S.f)`. -/
@[simps]
noncomputable def ofAbelian : S.LeftHomologyData

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
(S : CategoryTheory.ShortComplex C)

(CategoryTheory.ShortComplex.LeftHomologyData.ofAbelian S).K = CategoryTheory.Limits.kernel S.g


@[simp]
theorem comap_comp (f : R →+* S) (g : S →+* S') : comap (g.comp f) = (comap f).comp (comap g)

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

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


theorem dom_eq (f : α →. β) : Dom f = { x | ∃ y, y ∈ f x }

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


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

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

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


@[aesop norm (rule_sets := [Sym2])]
theorem mem_iff' {a b c : α} : Sym2.Mem a s(b, c) ↔ a = b ∨ a = c


theorem multinomial_univ_three (a b c : ℕ) :
    multinomial Finset.univ ![a, b, c] = (a + b + c)! / (a ! * b ! * c !)

Nat.multinomial Finset.univ ![a, b, c] = (a + b + c)! / (a ! * b ! * c !)


@[simp] theorem get_cons_succ {as : List α} {h : i + 1 < (a :: as).length} :
  (a :: as).get ⟨i+1, h⟩ = as.get ⟨i, Nat.lt_of_succ_lt_succ h⟩

{α : Type u_1}
{i : Nat}
{a : α}
{as : List α}
{h : i + 1 < (a :: as).length}

(a :: as).get ⟨i + 1, h⟩ = as.get ⟨i, ⋯⟩


@[reassoc]
lemma shift_app (a : A) (X : C) :
    (τ.app X)⟦a⟧' = (F₁.commShiftIso a).inv.app X ≫
      τ.app (X⟦a⟧) ≫ (F₂.commShiftIso a).hom.app X

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_7, u_1} C]
[CategoryTheory.Category.{u_6, u_2} D]
{F₁ F₂ : CategoryTheory.Functor C D}
(τ : F₁ ⟶ F₂)
{A : Type u_5}
[AddMonoid A]
[CategoryTheory.HasShift C A]
[CategoryTheory.HasShift D A]
[F₁.CommShift A]
[F₂.CommShift A]
[CategoryTheory.NatTrans.CommShift τ A]
(a : A)
(X : C)

(CategoryTheory.shiftFunctor D a).map (τ.app X) =
  CategoryTheory.CategoryStruct.comp ((F₁.commShiftIso a).inv.app X)
    (CategoryTheory.CategoryStruct.comp (τ.app ((CategoryTheory.shiftFunctor C a).obj X))
      ((F₂.commShiftIso a).hom.app X))


/-- The positive cone of an ordered module is always pointed. -/
theorem pointed_positive : Pointed (positive 𝕜 E)

(𝕜 : Type u_1)
(E : Type u_2)
[OrderedSemiring 𝕜]
[OrderedAddCommGroup E]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]


theorem relabel_moveLeft {x : PGame} {xl' xr'} (el : xl' ≃ x.LeftMoves) (er : xr' ≃ x.RightMoves)
    (i : x.LeftMoves) : moveLeft (relabel el er) (el.symm i) = x.moveLeft i

{x : SetTheory.PGame}
{xl' xr' : Type u_1}
(el : xl' ≃ x.LeftMoves)
(er : xr' ≃ x.RightMoves)
(i : x.LeftMoves)

(SetTheory.PGame.relabel el er).moveLeft (el.symm i) = x.moveLeft i


theorem boundedSpace_subtype_iff {p : α → Prop} :
    BoundedSpace (Subtype p) ↔ IsBounded { x | p x }

{α : Type u_1}
[Bornology α]
{p : α → Prop}

BoundedSpace (Subtype p) ↔ Bornology.IsBounded {x | p x}


theorem sin_nonpos_of_nonnpos_of_neg_pi_le {x : ℝ} (hx0 : x ≤ 0) (hpx : -π ≤ x) : sin x ≤ 0

{x : ℝ}
(hx0 : x ≤ 0)
(hpx : -Real.pi ≤ x)


protected theorem Nat.zpow_pos_of_pos {a : ℕ} (h : 0 < a) (n : ℤ) : 0 < (a : α) ^ n

{α : Type u_1}
[LinearOrderedSemifield α]
{a : ℕ}
(h : 0 < a)
(n : ℤ)


@[to_additive (attr := simp)]
theorem inv_eq {x : PUnit} : x⁻¹ = unit


theorem singleton_sigma_singleton {a : ∀ i, α i} :
    (({i} : Set ι).sigma fun i ↦ ({a i} : Set (α i))) = {⟨i, a i⟩}

{ι : Type u_1}
{α : ι → Type u_3}
{i : ι}
{a : (i : ι) → α i}


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

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

PrimeSpectrum.vanishingIdeal (PrimeSpectrum.zeroLocus ↑I) = I.radical


theorem rank_modTorsion :
    FiniteDimensional.finrank ℤ (Additive ((𝓞 K)ˣ ⧸ (torsion K))) = rank K

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

FiniteDimensional.finrank ℤ (Additive ((𝓞 K)ˣ ⧸ NumberField.Units.torsion K)) = NumberField.Units.rank K


theorem integral_fun_snd (f : β → E) : ∫ z, f z.2 ∂μ.prod ν = (μ univ).toReal • ∫ y, f y ∂ν

{α : Type u_1}
{β : Type u_3}
{E : Type u_6}
[MeasurableSpace α]
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{ν : MeasureTheory.Measure β}
[NormedAddCommGroup E]
[MeasureTheory.SFinite ν]
[NormedSpace ℝ E]
[MeasureTheory.SFinite μ]
(f : β → E)

∫ (z : α × β), f z.2 ∂μ.prod ν = (μ Set.univ).toReal • ∫ (y : β), f y ∂ν


/-- (Impl) Establish an equivalence between the category of cones for `F` and for the "grown" `F`.
-/
@[simps]
def conesEquiv (B : C) (F : Discrete J ⥤ Over B) :
    Cone (widePullbackDiagramOfDiagramOver B F) ≌ Cone F

(F : CategoryTheory.Discrete J ⥤ CategoryTheory.Over B)

(CategoryTheory.Over.ConstructProducts.conesEquiv B F).unitIso =
  CategoryTheory.Over.ConstructProducts.conesEquivUnitIso B F


@[to_additive (attr := simp)]
theorem coe_id' {G : Type _} [Group G] :
    @DFunLike.coe (G →* G) G (fun _ ↦ G) MonoidHom.instFunLike
      (CategoryStruct.id (X := Grp.of G)) = id


(CategoryTheory.CategoryStruct.comp F G).F =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Limits.prod.lift CategoryTheory.Limits.prod.fst
      (CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.prod.map F.f (CategoryTheory.CategoryStruct.id Z.tgt))
        G.F))
    F.F


/-- Horizontal and vertical composition of squares commutes.-/
theorem rightAdjointSquare.comp_hvcomp
    (α : R₁ ⋙ G₁ ⟶ H₁ ⋙ R₃) (β : R₂ ⋙ H₁ ⟶ K₁ ⋙ R₄)
    (γ : R₃ ⋙ G₂ ⟶ H₂ ⋙ R₅) (δ : R₄ ⋙ H₂ ⟶ K₂ ⋙ R₆) :
    rightAdjointSquare.comp α β γ δ =
    rightAdjointSquare.hcomp (rightAdjointSquare.vcomp α γ) (rightAdjointSquare.vcomp β δ)

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

CategoryTheory.rightAdjointSquare.comp α β γ δ =
  CategoryTheory.rightAdjointSquare.hcomp (CategoryTheory.rightAdjointSquare.vcomp α γ)
    (CategoryTheory.rightAdjointSquare.vcomp β δ)


lemma cast_comm (q : ℚ≥0) (a : α) : q * a = a * q

{α : Type u_3}
[DivisionSemiring α]
(q : ℚ≥0)
(a : α)


theorem UniformInducing.uniformContinuous_iff {f : α → β} {g : β → γ} (hg : UniformInducing g) :
    UniformContinuous f ↔ UniformContinuous (g ∘ f)

{α : Type u}
{β : Type v}
{γ : Type w}
[UniformSpace α]
[UniformSpace β]
[UniformSpace γ]
{f : α → β}
{g : β → γ}
(hg : UniformInducing g)


@[simp] theorem cast_cast : ∀ (ha : α = β) (hb : β = γ) (a : α),
    cast hb (cast ha a) = cast (ha.trans hb) a

{α β γ : Sort u_1}
(ha : α = β)
(hb : β = γ)
(a : α)


/-- A `PreconnectedSpace` version of `isPreconnected.constant` -/
theorem PreconnectedSpace.constant {Y : Type*} [TopologicalSpace Y] [DiscreteTopology Y]
    (hp : PreconnectedSpace α) {f : α → Y} (hf : Continuous f) {x y : α} : f x = f y

{α : Type u}
[TopologicalSpace α]
{Y : Type u_3}
[TopologicalSpace Y]
[DiscreteTopology Y]
(hp : PreconnectedSpace α)
{f : α → Y}
(hf : Continuous f)
{x y : α}


theorem iff_of_iSup_eq_top {ι} (U : ι → Y.Opens) (hU : iSup U = ⊤) :
    P f ↔ ∀ i, P (f ∣_ U i)

{P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme}

[hP : AlgebraicGeometry.IsLocalAtTarget P]


theorem measure_preimage_lt_top_of_memℒp (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) (f : α →ₛ E)
    (hf : Memℒp f p μ) (y : E) (hy_ne : y ≠ 0) : μ (f ⁻¹' {y}) < ∞

{α : Type u_1}
{E : Type u_4}
[MeasurableSpace α]
[NormedAddCommGroup E]
{μ : MeasureTheory.Measure α}
{p : ℝ≥0∞}
(hp_pos : p ≠ 0)
(hp_ne_top : p ≠ ⊤)
(f : MeasureTheory.SimpleFunc α E)
(hf : MeasureTheory.Memℒp (↑f) p μ)
(y : E)
(hy_ne : y ≠ 0)


@[to_additive MeasureTheory.addFundamentalFrontier_subset]
theorem fundamentalFrontier_subset : fundamentalFrontier G s ⊆ s

{G : Type u_1}
{α : Type u_3}
[AddGroup G]
[AddAction G α]
{s : Set α}

MeasureTheory.addFundamentalFrontier G s ⊆ s


theorem pred_mk {n : Nat} (i : Nat) (h : i < n + 1) (w) : Fin.pred ⟨i, h⟩ w =
    ⟨i - 1, Nat.sub_lt_right_of_lt_add (Nat.pos_iff_ne_zero.2 (Fin.val_ne_of_ne w)) h⟩

{n : Nat}
(i : Nat)
(h : i < n + 1)
(w : ⟨i, h⟩ ≠ 0)


@[simp] theorem balance2_All {l : RBNode α} {v : α} {r : RBNode α} :
    (balance2 l v r).All p ↔ p v ∧ l.All p ∧ r.All p

{α : Type u_1}
{p : α → Prop}
{l : Batteries.RBNode α}
{v : α}
{r : Batteries.RBNode α}

Batteries.RBNode.All p (l.balance2 v r) ↔ p v ∧ Batteries.RBNode.All p l ∧ Batteries.RBNode.All p r


theorem opow_isLimit {a b : Ordinal} (a1 : 1 < a) : IsLimit b → IsLimit (a ^ b)


theorem iInf_eq_dif {p : Prop} [Decidable p] (s : p → Set α) :
    ⋂ h : p, s h = if h : p then s h else univ

{α : Type u_1}
{p : Prop}
[Decidable p]
(s : p → Set α)

⋂ (h : p), s h = if h : p then s h else Set.univ


theorem le_rpow_iff_log_le (hx : 0 < x) (hy : 0 < y) : x ≤ y ^ z ↔ Real.log x ≤ z * Real.log y


lemma rightFractionRel_op_iff
    {X Y : C} (z₁ z₂ : W.LeftFraction X Y) :
    RightFractionRel z₁.op z₂.op ↔ LeftFractionRel z₁ z₂

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{W : CategoryTheory.MorphismProperty C}
{X Y : C}
(z₁ z₂ : W.LeftFraction X Y)

CategoryTheory.MorphismProperty.RightFractionRel z₁.op z₂.op ↔ CategoryTheory.MorphismProperty.LeftFractionRel z₁ z₂


/-- If `f` maps `p ^ i` to `(f p) ^ i` for primes `p`, and `f`
is multiplicative on coprime elements, then `f` is multiplicative everywhere. -/
theorem multiplicative_of_coprime (f : α → β) (a b : α) (h0 : f 0 = 0)
    (h1 : ∀ {x y}, IsUnit y → f (x * y) = f x * f y)
    (hpr : ∀ {p} (i : ℕ), Prime p → f (p ^ i) = f p ^ i)
    (hcp : ∀ {x y}, IsRelPrime x y → f (x * y) = f x * f y) :
    f (a * b) = f a * f b

(h1 : ∀ {x y : α}, IsUnit y → f (x * y) = f x * f y)

(hpr : ∀ {p : α} (i : ℕ), Prime p → f (p ^ i) = f p ^ i)

(hcp : ∀ {x y : α}, IsRelPrime x y → f (x * y) = f x * f y)


@[simp]
theorem coe_mul (f g : P →ᵃⁱ[𝕜] P) : ⇑(f * g) = f ∘ g

{𝕜 : Type u_1}
{V : Type u_2}
{P : Type u_10}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
(f g : P →ᵃⁱ[𝕜] P)


theorem limsInf_eq_iSup_sInf {f : Filter α} : limsInf f = ⨆ s ∈ f, sInf s

{α : Type u_1}
[CompleteLattice α]
{f : Filter α}


@[trans]
theorem IsTheta.trans_isEquivalent {f : α → β₂} {g₁ g₂ : α → β} (h : f =Θ[l] g₁)
    (h₂ : g₁ ~[l] g₂) : f =Θ[l] g₂

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


@[simp]
theorem openEmbedding_iff_isIso_comp' {X Y Z : TopCat} (f : X ⟶ Y) (g : Y ⟶ Z) [IsIso f] :
    OpenEmbedding ((forget TopCat).map f ≫ (forget TopCat).map g) ↔ OpenEmbedding g

{X Y Z : TopCat}
(f : X ⟶ Y)
(g : Y ⟶ Z)
[CategoryTheory.IsIso f]

OpenEmbedding ((CategoryTheory.forget TopCat).map f ≫ (CategoryTheory.forget TopCat).map g) ↔ OpenEmbedding ⇑g


protected theorem IsTopologicalBasis.inf {t₁ t₂ : TopologicalSpace β} {B₁ B₂ : Set (Set β)}
    (h₁ : IsTopologicalBasis (t := t₁) B₁) (h₂ : IsTopologicalBasis (t := t₂) B₂) :
    IsTopologicalBasis (t := t₁ ⊓ t₂) (image2 (· ∩ ·) B₁ B₂)

(h₁ : TopologicalSpace.IsTopologicalBasis B₁)

(h₂ : TopologicalSpace.IsTopologicalBasis B₂)

TopologicalSpace.IsTopologicalBasis (Set.image2 (fun x x_1 => x ∩ x_1) B₁ B₂)


theorem stereoInvFunAux_mem (hv : ‖v‖ = 1) {w : E} (hw : w ∈ (ℝ ∙ v)ᗮ) :
    stereoInvFunAux v w ∈ sphere (0 : E) 1

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


@[simp] lemma one_lt_pow_iff {n : ℕ} (hn : n ≠ 0) : ∀ {a}, 1 < a ^ n ↔ 1 < a


@[simp]
theorem measure_union_null_iff : μ (s ∪ t) = 0 ↔ μ s = 0 ∧ μ t = 0

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


/-- A commutative square involving the morphisms `mor₂` of two distinguished triangles
can be extended as morphism of triangles -/
lemma complete_distinguished_triangle_morphism₁ (T₁ T₂ : Triangle C)
    (hT₁ : T₁ ∈ distTriang C) (hT₂ : T₂ ∈ distTriang C) (b : T₁.obj₂ ⟶ T₂.obj₂)
    (c : T₁.obj₃ ⟶ T₂.obj₃) (comm : T₁.mor₂ ≫ c = b ≫ T₂.mor₂) :
    ∃ (a : T₁.obj₁ ⟶ T₂.obj₁), T₁.mor₁ ≫ b = a ≫ T₂.mor₁ ∧
      T₁.mor₃ ≫ a⟦(1 : ℤ)⟧' = c ≫ T₂.mor₃

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

(T₁ T₂ : CategoryTheory.Pretriangulated.Triangle C)

(hT₁ : T₁ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

(hT₂ : T₂ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

∃ a, T₁.mor₁ ≫ b = a ≫ T₂.mor₁ ∧ T₁.mor₃ ≫ (CategoryTheory.shiftFunctor C 1).map a = c ≫ T₂.mor₃


protected theorem dvd_add_iff_right {k m n : Nat} (h : k ∣ m) : k ∣ n ↔ k ∣ m + n


@[to_additive le_sum_of_subadditive_on_pred]
lemma le_prod_of_submultiplicative_on_pred (f : α → β)
    (p : α → Prop) (h_one : f 1 = 1) (hp_one : p 1)
    (h_mul : ∀ a b, p a → p b → f (a * b) ≤ f a * f b) (hp_mul : ∀ a b, p a → p b → p (a * b))
    (s : Multiset α) (hps : ∀ a, a ∈ s → p a) : f s.prod ≤ (s.map f).prod

(h_mul : ∀ (a b : α), p a → p b → f (a + b) ≤ f a + f b)

(hp_mul : ∀ (a b : α), p a → p b → p (a + b))


@[simp]
lemma leftHomologyMap_zero [HasLeftHomology S₁] [HasLeftHomology S₂] :
    leftHomologyMap (0 : S₁ ⟶ S₂) = 0

CategoryTheory.ShortComplex.leftHomologyMap 0 = 0


@[simp]
theorem preimage_id_eq : preimage (id : α → α) = id


theorem toMeasureOfZeroLE_apply (hi : 0 ≤[i] s) (hi₁ : MeasurableSet i) (hj₁ : MeasurableSet j) :
    s.toMeasureOfZeroLE i hi₁ hi j = ((↑) : ℝ≥0 → ℝ≥0∞) ⟨s (i ∩ j), nonneg_of_zero_le_restrict
      s (zero_le_restrict_subset s hi₁ Set.inter_subset_left hi)⟩

(hi : MeasureTheory.VectorMeasure.restrict 0 i ≤ MeasureTheory.VectorMeasure.restrict s i)

(s.toMeasureOfZeroLE i hi₁ hi) j = ↑⟨↑s (i ∩ j), ⋯⟩


/-- If `β` is a group, then any function from `α` to `β` extends uniquely to a group homomorphism
from the free group over `α` to `β` -/
@[to_additive (attr := simps symm_apply)
  "If `β` is an additive group, then any function from `α` to `β` extends uniquely to an
  additive group homomorphism from the free additive group over `α` to `β`"]
def lift : (α → β) ≃ (FreeGroup α →* β)

{α : Type u}
{β : Type v}
[Group β]
(g : FreeGroup α →* β)

∀ (a : α), FreeGroup.lift.symm g a = (⇑g ∘ FreeGroup.of) a


/-- The equivalence `Karoubi (CochainComplex C α) ≌ CochainComplex (Karoubi C) α`. -/
@[simps!]
def karoubiCochainComplexEquivalence :
    Karoubi (CochainComplex C α) ≌ CochainComplex (Karoubi C) α

(P : CategoryTheory.Idempotents.Karoubi (HomologicalComplex C (ComplexShape.up α)))

(((CategoryTheory.Idempotents.karoubiCochainComplexEquivalence C α).functor.obj P).X n).p = P.p.f n


theorem CauchySeq.subseq_mem {V : ℕ → Set (α × α)} (hV : ∀ n, V n ∈ 𝓤 α) {u : ℕ → α}
    (hu : CauchySeq u) : ∃ φ : ℕ → ℕ, StrictMono φ ∧ ∀ n, (u <| φ (n + 1), u <| φ n) ∈ V n

{α : Type u}
[uniformSpace : UniformSpace α]
{V : ℕ → Set (α × α)}
(hV : ∀ (n : ℕ), V n ∈ 𝓤 α)
{u : ℕ → α}
(hu : CauchySeq u)

∃ φ, StrictMono φ ∧ ∀ (n : ℕ), (u (φ (n + 1)), u (φ n)) ∈ V n


@[to_additive (attr := simp)]
lemma orderOf_mk (a : G) (ha) : orderOf (⟨a, ha⟩ : H) = orderOf a

{G : Type u_1}
[AddGroup G]
{H : AddSubgroup G}
(a : G)
(ha : a ∈ H)


/-- If `f` is a monotone function on a neighborhood of `a` and the image of this neighborhood under
`f` meets every interval `(b, f a)`, `b < f a`, and every interval `(f a, b)`, `b > f a`, then `f`
is continuous at `a`. -/
theorem continuousAt_of_monotoneOn_of_exists_between {f : α → β} {s : Set α} {a : α}
    (h_mono : MonotoneOn f s) (hs : s ∈ 𝓝 a) (hfs_l : ∀ b < f a, ∃ c ∈ s, f c ∈ Ioo b (f a))
    (hfs_r : ∀ b > f a, ∃ c ∈ s, f c ∈ Ioo (f a) b) : ContinuousAt f a

(hfs_l : ∀ b < f a, ∃ c ∈ s, f c ∈ Set.Ioo b (f a))

(hfs_r : ∀ b > f a, ∃ c ∈ s, f c ∈ Set.Ioo (f a) b)


theorem reindexLinearEquiv_trans (e₁ : m ≃ m') (e₂ : n ≃ n') (e₁' : m' ≃ m'') (e₂' : n' ≃ n'') :
    (reindexLinearEquiv R A e₁ e₂).trans (reindexLinearEquiv R A e₁' e₂') =
      (reindexLinearEquiv R A (e₁.trans e₁') (e₂.trans e₂') : _ ≃ₗ[R] _)

{m : Type u_2}
{n : Type u_3}
{m' : Type u_6}
{n' : Type u_7}
{m'' : Type u_9}
{n'' : Type u_10}
(R : Type u_11)
(A : Type u_12)
[Semiring R]
[AddCommMonoid A]
[Module R A]
(e₁ : m ≃ m')
(e₂ : n ≃ n')
(e₁' : m' ≃ m'')
(e₂' : n' ≃ n'')

Matrix.reindexLinearEquiv R A e₁ e₂ ≪≫ₗ Matrix.reindexLinearEquiv R A e₁' e₂' =
  Matrix.reindexLinearEquiv R A (e₁.trans e₁') (e₂.trans e₂')


theorem dist_of_im_eq {z w : ℂ} (h : z.im = w.im) : dist z w = dist z.re w.re


lemma map_bijective (X Y : C) :
    Function.Bijective (F.map : (X ⟶ Y) → (F.obj X ⟶ F.obj Y))

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


@[simp]
theorem rightAssocTensor_obj (X) : (rightAssocTensor C).obj X = X.1 ⊗ X.2.1 ⊗ X.2.2

(C : Type u)
[𝒞 : CategoryTheory.Category.{v, u} C]
[CategoryTheory.MonoidalCategory C]
(X : C × C × C)

(CategoryTheory.MonoidalCategory.rightAssocTensor C).obj X =
  CategoryTheory.MonoidalCategory.tensorObj X.1 (CategoryTheory.MonoidalCategory.tensorObj X.2.1 X.2.2)


@[simp]
theorem prod_inf : s ×ˢ (t₁ ⊓ t₂) = s ×ˢ t₁ ⊓ s ×ˢ t₂

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(s : UpperSet α)
(t₁ t₂ : UpperSet β)

s ×ˢ (t₁ ⊓ t₂) = s ×ˢ t₁ ⊓ s ×ˢ t₂


@[simp]
theorem blockDiag'_add [AddZeroClass α] (M N : Matrix (Σi, m' i) (Σi, n' i) α) :
    blockDiag' (M + N) = blockDiag' M + blockDiag' N

(M N : Matrix ((i : o) × m' i) ((i : o) × n' i) α)

(M + N).blockDiag' = M.blockDiag' + N.blockDiag'


lemma Subsingleton.singleton_inter : ({a} ∩ s).Subsingleton


@[simp]
theorem sqFrom_left (f : Hom C₁ C₂) (i : ι) : (f.sqFrom i).left = f.f i


protected lemma divInt_le_divInt {a b c d : ℤ} (b0 : 0 < b) (d0 : 0 < d) :
    a /. b ≤ c /. d ↔ a * d ≤ c * b

Rat.divInt a b ≤ Rat.divInt c d ↔ a * d ≤ c * b


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


/-- If `l` has no duplicates, then `List.get` defines an equivalence between `Fin (length l)` and
the set of elements of `l`. -/
@[simps]
def getEquiv (l : List α) (H : Nodup l) : Fin (length l) ≃ { x // x ∈ l }

{α : Type u_1}
[DecidableEq α]
(l : List α)
(H : l.Nodup)
(x : { x // x ∈ l })

↑((List.Nodup.getEquiv l H).symm x) = List.indexOf (↑x) l


/-- Adding an element at the beginning of a tuple and then updating it amounts to adding it
directly. -/
theorem update_cons_zero : update (cons x p) 0 z = cons z p

{n : ℕ}
{α : Fin (n + 1) → Type u}
(x : α 0)
(p : (i : Fin n) → α i.succ)
(z : α 0)

Function.update (Fin.cons x p) 0 z = Fin.cons z p


@[simp]
theorem head!_nil [Inhabited α] : ([] : List α).head! = default


theorem disjoint_iff_ne : Disjoint s t ↔ ∀ a ∈ s, ∀ b ∈ t, a ≠ b


lemma ofIso_compatibility :
    letI := ofIso e A
    NatTrans.CommShift e.hom A

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_5, u_1} C]
[CategoryTheory.Category.{u_6, u_2} D]
{F G : CategoryTheory.Functor C D}
(e : F ≅ G)
(A : Type u_4)
[AddMonoid A]
[CategoryTheory.HasShift C A]
[CategoryTheory.HasShift D A]
[F.CommShift A]


theorem pred_covBy_of_not_isMin (h : ¬IsMin a) : pred a ⋖ a

{α : Type u_1}
[Preorder α]
[PredOrder α]
{a : α}
(h : ¬IsMin a)


/-- The infimum of an intersection of two sets is bounded below by the maximum of the
infima of each set, if all sets are bounded below and nonempty. -/
theorem le_csInf_inter :
    BddBelow s → BddBelow t → (s ∩ t).Nonempty → sInf s ⊔ sInf t ≤ sInf (s ∩ t)

{α : Type u_1}
[ConditionallyCompleteLattice α]
{s t : Set α}


theorem out : ∀ {it}, ValidFor l r it → it = ⟨⟨l.reverseAux r⟩, ⟨utf8Len l⟩⟩

{l r : List Char}
{it : String.Iterator}

String.Iterator.ValidFor l r it → it = { s := { data := l.reverseAux r }, i := { byteIdx := String.utf8Len l } }


theorem _root_.IsFractional.nsmul {I : Submodule R P} :
    ∀ n : ℕ, IsFractional S I → IsFractional S (n • I : Submodule R P)

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

IsFractional S I → IsFractional S (n • I)


protected theorem uniformEmbedding : UniformEmbedding ((↑) : Lp.simpleFunc E p μ → Lp E p μ)

{α : Type u_1}
{E : Type u_4}
[MeasurableSpace α]
[NormedAddCommGroup E]
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[Fact (1 ≤ p)]


theorem mem_of_valuation_le_one (x : K) (h : A.valuation x ≤ 1) : x ∈ A

{K : Type u}
[Field K]
(A : ValuationSubring K)
(x : K)
(h : A.valuation x ≤ 1)


{α : Type w}
[CommRing α]
(A : Matrix (Fin 3) (Fin 3) α)


/-- If `e : S₁ ≅ S₂` is an isomorphism of short complexes and `h₁ : HomologyData S₁`,
this is the homology data for `S₂` deduced from the isomorphism. -/
@[simps!]
noncomputable def ofIso (e : S₁ ≅ S₂) (h : HomologyData S₁)

(CategoryTheory.ShortComplex.HomologyData.ofIso e h).right.Q = h.right.Q


/-- Given a natural transformation `α : F.unop ⟶ G.unop`, we can take the opposite of each
component obtaining a natural transformation `G ⟶ F`. -/
@[simps]
protected def removeUnop {F G : Cᵒᵖ ⥤ Dᵒᵖ} (α : F.unop ⟶ G.unop) : G ⟶ F

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F G : CategoryTheory.Functor Cᵒᵖ Dᵒᵖ}
(α : F.unop ⟶ G.unop)
(X : Cᵒᵖ)

(CategoryTheory.NatTrans.removeUnop α).app X = (α.app (Opposite.unop X)).op


protected theorem cast_succ (n : ℕ) : ((n + 1 : ℕ) : Cardinal.{u}) = n + 1


/-- The inverse of a `TransvectionStruct`, designed so that `t.inv.toMatrix` is the inverse of
`t.toMatrix`. -/
@[simps]
protected def inv (t : TransvectionStruct n R) : TransvectionStruct n R

{n : Type u_1}
{R : Type u₂}
[CommRing R]
(t : Matrix.TransvectionStruct n R)


theorem norm_int_le_pow_iff_dvd (k : ℤ) (n : ℕ) :
    ‖(k : ℚ_[p])‖ ≤ (p : ℝ) ^ (-n : ℤ) ↔ (p ^ n : ℤ) ∣ k

{p : ℕ}
[hp : Fact (Nat.Prime p)]
(k : ℤ)
(n : ℕ)


theorem image_ι_op_comp_imageUnopOp_hom :
    (image.ι g.unop).op ≫ (imageUnopOp g).hom = factorThruImage g

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Abelian C]
{A B : Cᵒᵖ}
(g : A ⟶ B)

CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.image.ι g.unop).op (CategoryTheory.imageUnopOp g).hom =
  CategoryTheory.Limits.factorThruImage g


/-- An infinite sum of functions with summable sup norm is the uniform limit of its partial sums.
Version with general index set. -/
theorem tendstoUniformly_tsum {f : α → β → F} (hu : Summable u) (hfu : ∀ n x, ‖f n x‖ ≤ u n) :
    TendstoUniformly (fun t : Finset α => fun x => ∑ n ∈ t, f n x)
      (fun x => ∑' n, f n x) atTop

(hfu : ∀ (n : α) (x : β), ‖f n x‖ ≤ u n)

TendstoUniformly (fun t x => ∑ n ∈ t, f n x) (fun x => ∑' (n : α), f n x) Filter.atTop


/-- Adjoins a `⊤` and `⊥` to the domain and codomain of a `LatticeHom`. -/
@[simps]
def withTopWithBot (f : LatticeHom α β) :
    BoundedLatticeHom (WithTop <| WithBot α) (WithTop <| WithBot β)

{α : Type u_3}
{β : Type u_4}
[Lattice α]
[Lattice β]
(f : LatticeHom α β)


protected theorem compare_eq_lt {a b : Nat} : compare a b = .lt ↔ a < b


theorem variance_nonneg (X : Ω → ℝ) (μ : Measure Ω) : 0 ≤ variance X μ

{Ω : Type u_1}
{m : MeasurableSpace Ω}
(X : Ω → ℝ)
(μ : MeasureTheory.Measure Ω)


/-- If `F : ι → X → α` is a family of functions equicontinuous at `x`,
it tends to `f y` along a filter `l` for any `y ∈ s`,
the limit function `f` tends to `z` along `𝓝[s] x`, and `x ∈ closure s`,
then `(F · x)` tends to `z` along `l`.

In some sense, this is a converse of `EquicontinuousAt.closure`. -/
theorem EquicontinuousAt.tendsto_of_mem_closure {l : Filter ι} {F : ι → X → α} {f : X → α}
    {s : Set X} {x : X} {z : α} (hF : EquicontinuousAt F x) (hf : Tendsto f (𝓝[s] x) (𝓝 z))
    (hs : ∀ y ∈ s, Tendsto (F · y) l (𝓝 (f y))) (hx : x ∈ closure s) :
    Tendsto (F · x) l (𝓝 z)

(hf : Filter.Tendsto f (nhdsWithin x s) (nhds z))

(hs : ∀ y ∈ s, Filter.Tendsto (fun x => F x y) l (nhds (f y)))

Filter.Tendsto (fun x_1 => F x_1 x) l (nhds z)


/-- A category is (finitary) pre-extensive if it has finite coproducts,
and binary coproducts are universal. -/
class FinitaryPreExtensive (C : Type u) [Category.{v} C] : Prop where
  [hasFiniteCoproducts : HasFiniteCoproducts C]
  [hasPullbacksOfInclusions : HasPullbacksOfInclusions C]
  /-- In a finitary extensive category, all coproducts are van Kampen-/
  universal' : ∀ {X Y : C} (c : BinaryCofan X Y), IsColimit c → IsUniversalColimit c

[self : CategoryTheory.FinitaryPreExtensive C]

(c : CategoryTheory.Limits.BinaryCofan X Y)

CategoryTheory.Limits.IsColimit c → CategoryTheory.IsUniversalColimit c


@[simp]
theorem refl_toEmbedding {α : Type*} : (Equiv.refl α).toEmbedding = Embedding.refl α

(Equiv.refl α).toEmbedding = Function.Embedding.refl α


theorem IsBoundedBilinearMap.continuous_right (h : IsBoundedBilinearMap 𝕜 f) {e₁ : E} :
    Continuous fun e₂ => f (e₁, e₂)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{f : E × F → G}
(h : IsBoundedBilinearMap 𝕜 f)
{e₁ : E}


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

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

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


@[simp, norm_cast] theorem intCast_sub (a b : Int) :
    ((a - b : Int) : Rat) = (a : Rat) - (b : Rat)


theorem PartiallyWellOrderedOn.mono (ht : t.PartiallyWellOrderedOn r) (h : s ⊆ t) :
    s.PartiallyWellOrderedOn r

{α : Type u_2}
{r : α → α → Prop}
{s t : Set α}
(ht : t.PartiallyWellOrderedOn r)
(h : s ⊆ t)


theorem image_mk_segment_left (x₁ x₂ : E) (y : F) :
    (fun x => (x, y)) '' [x₁ -[𝕜] x₂] = [(x₁, y) -[𝕜] (x₂, y)]

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[AddCommMonoid F]
[Module 𝕜 E]
[Module 𝕜 F]
(x₁ x₂ : E)
(y : F)


@[simp]
theorem ofBoolAlg_sup (a b : AsBoolAlg α) :
    ofBoolAlg (a ⊔ b) = ofBoolAlg a + ofBoolAlg b + ofBoolAlg a * ofBoolAlg b

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


@[simp] lemma exterior_empty : exterior (∅ : Set α) = ∅


@[simp]
theorem map_pointwise_smul (r : R) (N : Submodule R M) (f : M →ₗ[R] M') :
    (r • N).map f = r • N.map f

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{M' : Type w}
[AddCommMonoid M']
[Module R M']
(r : R)
(N : Submodule R M)
(f : M →ₗ[R] M')

Submodule.map f (r • N) = r • Submodule.map f N


/-- The topology on `α →ᵇ β` is exactly the topology induced by the natural map to `α →ᵤ β`. -/
theorem inducing_coeFn : Inducing (UniformFun.ofFun ∘ (⇑) : (α →ᵇ β) → α →ᵤ β)

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

Inducing (⇑UniformFun.ofFun ∘ DFunLike.coe)


/-- The pullback cone whose cone point is the explicit pullback. -/
@[simps! pt π]
noncomputable
def pullback.cone : Limits.PullbackCone f i

{X Y Z : Stonean}
(f : X ⟶ Z)
{i : Y ⟶ Z}
(hi : OpenEmbedding ⇑i)

(Stonean.pullback.cone f hi).π =
  {
    app := fun j =>
      Option.rec (Stonean.pullback.fst f hi ≫ f)
        (fun val => CategoryTheory.Limits.WalkingPair.rec (Stonean.pullback.fst f hi) (Stonean.pullback.snd f hi) val)
        j,
    naturality := ⋯ }


@[simp]
theorem rightAdjointUniq_refl {F : C ⥤ D} {G : D ⥤ C} (adj1 : F ⊣ G) :
    (rightAdjointUniq adj1 adj1).hom = 𝟙 _

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
{F : C ⥤ D}
{G : D ⥤ C}
(adj1 : F ⊣ G)


lemma gc_pred_succ : GaloisConnection (pred : α → α) succ

{α : Type u_1}
[Preorder α]
[SuccOrder α]
[PredOrder α]


theorem unit_eq :
    S.unit K = ⨅ (v) (_ : v ∉ S), (v : HeightOneSpectrum R).valuation.valuationSubring.unitGroup

(S : Set (IsDedekindDomain.HeightOneSpectrum R))

S.unit K = ⨅ v, ⨅ (_ : v ∉ S), v.valuation.valuationSubring.unitGroup


theorem valuation_of_mk (f : Polynomial K) {g : Polynomial K} (hg : g ≠ 0) :
    (Polynomial.idealX K).valuation (RatFunc.mk f g) =
      (Polynomial.idealX K).intValuation f / (Polynomial.idealX K).intValuation g

(K : Type u_1)
[Field K]
(f : Polynomial K)
{g : Polynomial K}
(hg : g ≠ 0)


private
lemma ofTensorProduct_bijective_of_map_from_fin : Function.Bijective (ofTensorProduct I M)

{R : Type u}
[CommRing R]
(I : Ideal R)
(M : Type u)
[AddCommGroup M]
[Module R M]
[IsNoetherianRing R]
{ι : Type}
[Fintype ι]
(f : (ι → R) →ₗ[R] M)
(hf : Function.Surjective ⇑f)

Function.Bijective ⇑(AdicCompletion.ofTensorProduct I M)


lemma snoc_mem_piFinset_snoc {x : ∀ i : Fin n, α i.castSucc} {xₙ : α (.last n)}
    {s : ∀ i : Fin n, Finset (α i.castSucc)} {sₙ : Finset (α $ .last n)} :
    snoc x xₙ ∈ piFinset (snoc s sₙ) ↔ x ∈ piFinset s ∧ xₙ ∈ sₙ

{s : (i : Fin n) → Finset (α i.castSucc)}

Fin.snoc x xₙ ∈ Fintype.piFinset (Fin.snoc s sₙ) ↔ x ∈ Fintype.piFinset s ∧ xₙ ∈ sₙ


theorem gcd_le_left (n) (h : 0 < m) : gcd m n ≤ m


@[to_additive (attr := simp)]
theorem ofList_cons (x : α) (xs : List α) : ofList (x :: xs) = of x * ofList xs

FreeMonoid.ofList (x :: xs) = FreeMonoid.of x * FreeMonoid.ofList xs


@[to_additive]
lemma ofUnits_iSup {ι : Sort*} {f : ι → Subgroup Mˣ} :
    (iSup f).ofUnits = ⨆ (i : ι), (f i).ofUnits

{M : Type u_1}
[Monoid M]
{ι : Sort u_2}
{f : ι → Subgroup Mˣ}


/-- A variant of Doob's upcrossing estimate obtained by taking the supremum on both sides. -/
theorem Submartingale.mul_lintegral_upcrossings_le_lintegral_pos_part [IsFiniteMeasure μ] (a b : ℝ)
    (hf : Submartingale f ℱ μ) : ENNReal.ofReal (b - a) * ∫⁻ ω, upcrossings a b f ω ∂μ ≤
      ⨆ N, ∫⁻ ω, ENNReal.ofReal ((f N ω - a)⁺) ∂μ

{f : ℕ → Ω → ℝ}

(hf : MeasureTheory.Submartingale f ℱ μ)

ENNReal.ofReal (b - a) * ∫⁻ (ω : Ω), MeasureTheory.upcrossings a b f ω ∂μ ≤
  ⨆ N, ∫⁻ (ω : Ω), ENNReal.ofReal (f N ω - a)⁺ ∂μ


theorem EventuallyEq.diff {s t s' t' : Set α} {l : Filter α} (h : s =ᶠ[l] t) (h' : s' =ᶠ[l] t') :
    (s \ s' : Set α) =ᶠ[l] (t \ t' : Set α)

{α : Type u}
{s t s' t' : Set α}
{l : Filter α}
(h : s =ᶠ[l] t)
(h' : s' =ᶠ[l] t')


theorem eq_replicate_length {a : α} : ∀ {l : List α}, l = replicate l.length a ↔ ∀ b ∈ l, b = a

l = List.replicate l.length a ↔ ∀ (b : α), b ∈ l → b = a


theorem Subset.antisymm {a b : Set α} (h₁ : a ⊆ b) (h₂ : b ⊆ a) : a = b

{α : Type u}
{a b : Set α}
(h₁ : a ⊆ b)
(h₂ : b ⊆ a)


@[simp]
theorem y_inv (a : Solution₁ d) : a⁻¹.y = -a.y


theorem continuousOn_Ico_extendFrom_Ioo [TopologicalSpace α] [LinearOrder α] [DenselyOrdered α]
    [OrderTopology α] [TopologicalSpace β] [RegularSpace β] {f : α → β} {a b : α} {la : β}
    (hab : a < b) (hf : ContinuousOn f (Ioo a b)) (ha : Tendsto f (𝓝[>] a) (𝓝 la)) :
    ContinuousOn (extendFrom (Ioo a b) f) (Ico a b)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[LinearOrder α]
[DenselyOrdered α]
[OrderTopology α]
[TopologicalSpace β]
[RegularSpace β]
{f : α → β}
{a b : α}
{la : β}
(hab : a < b)
(hf : ContinuousOn f (Set.Ioo a b))
(ha : Filter.Tendsto f (𝓝[>] a) (𝓝 la))

ContinuousOn (extendFrom (Set.Ioo a b) f) (Set.Ico a b)


@[simp 1001] -- Porting note: increase `simp` priority so left-hand side doesn't simplify
theorem truncate_zero_zero {a b : X} (γ : Path a b) :
    γ.truncate 0 0 = (Path.refl a).cast (by rw [min_self, γ.extend_zero]) γ.extend_zero

{X : Type u_1}
[TopologicalSpace X]
{a b : X}
(γ : Path a b)


@[simp] lemma flip_fst : t.flip.fst = t.snd

(t : CategoryTheory.Limits.PullbackCone f g)


theorem cos_mem_Icc (x : ℝ) : cos x ∈ Icc (-1 : ℝ) 1


theorem AlgebraicIndependent.algebraMap_aevalEquiv (hx : AlgebraicIndependent R x)
    (p : MvPolynomial ι R) :
    algebraMap (Algebra.adjoin R (range x)) A (hx.aevalEquiv p) = aeval x p

{ι : Type u_1}
{R : Type u_3}
{A : Type u_5}
{x : ι → A}
[CommRing R]
[CommRing A]
[Algebra R A]
(hx : AlgebraicIndependent R x)
(p : MvPolynomial ι R)

(algebraMap (↥(Algebra.adjoin R (Set.range x))) A) (hx.aevalEquiv p) = (MvPolynomial.aeval x) p


/-- Sum of a multiset of elements in a `Subfield` is in the `Subfield`. -/
protected theorem multiset_sum_mem (m : Multiset K) : (∀ a ∈ m, a ∈ s) → m.sum ∈ s

{K : Type u}
[DivisionRing K]
(s : Subfield K)
(m : Multiset K)


lemma BddAbove.smul_of_nonpos (ha : a ≤ 0) (hs : BddAbove s) : BddBelow (a • s)

{α : Type u_1}
{β : Type u_2}
[OrderedRing α]
[OrderedAddCommGroup β]
[Module α β]
[PosSMulMono α β]
{s : Set β}
{a : α}
(ha : a ≤ 0)
(hs : BddAbove s)


lemma inv_one_sub_inv (ha₀ : a ≠ 0) (ha₁ : a < 1) : a⁻¹.IsConjExponent (1 - a)⁻¹

{a : NNReal}
(ha₀ : a ≠ 0)
(ha₁ : a < 1)


/-- a minimal solution to `a ^ 4 + b ^ 4 = c ^ 2` must have `a` and `b` coprime. -/
theorem coprime_of_minimal {a b c : ℤ} (h : Minimal a b c) : IsCoprime a b

{a b c : ℤ}
(h : Fermat42.Minimal a b c)


/-- Let `X` be a compact topological space, `α` a uniform space, `F : ι → (X → α)` an
equicontinuous family, and `ℱ` a filter on `ι`. Then, `F` tends *uniformly* to `f : X → α` along
`ℱ` iff it tends to `f` *pointwise* along `ℱ`. -/
theorem Equicontinuous.tendsto_uniformFun_iff_pi [CompactSpace X]
    (F_eqcont : Equicontinuous F) (ℱ : Filter ι) (f : X → α) :
    Tendsto (UniformFun.ofFun ∘ F) ℱ (𝓝 <| UniformFun.ofFun f) ↔
    Tendsto F ℱ (𝓝 f)

{ι : Type u_1}
{X : Type u_2}
{α : Type u_4}
[TopologicalSpace X]
[UniformSpace α]
{F : ι → X → α}
[CompactSpace X]
(F_eqcont : Equicontinuous F)
(ℱ : Filter ι)
(f : X → α)

Filter.Tendsto (⇑UniformFun.ofFun ∘ F) ℱ (𝓝 (UniformFun.ofFun f)) ↔ Filter.Tendsto F ℱ (𝓝 f)


/-- The counit for the adjunction for `Cocones.functoriality K F : Cocone K ⥤ Cocone (K ⋙ F)`.

Auxiliary definition for `functorialityIsLeftAdjoint`.
-/
@[simps]
def functorialityCounit :
    functorialityRightAdjoint adj K ⋙ Cocones.functoriality _ F ⟶ 𝟭 (Cocone (K ⋙ F))

(c : CategoryTheory.Limits.Cocone (K.comp F))

((adj.functorialityCounit K).app c).hom = adj.counit.app c.pt


@[simp, norm_cast]
theorem coe_X : ((X : R[X]) : PowerSeries R) = PowerSeries.X


theorem disjoint_iff_ne : Disjoint l₁ l₂ ↔ ∀ a ∈ l₁, ∀ b ∈ l₂, a ≠ b

∀ {α : Type u_1} {l₁ l₂ : List α}, l₁.Disjoint l₂ ↔ ∀ (a : α), a ∈ l₁ → ∀ (b : α), b ∈ l₂ → a ≠ b


lemma Algebra.algebraMap_intTrace_fractionRing (x : B) :
    algebraMap A (FractionRing A) (Algebra.intTrace A B x) =
      Algebra.trace (FractionRing A) (FractionRing B) (algebraMap B _ x)

{A : Type u_1}
{B : Type u_4}
[CommRing A]
[CommRing B]
[Algebra A B]
[IsDomain A]
[IsIntegrallyClosed A]
[IsDomain B]
[IsIntegrallyClosed B]
[Module.Finite A B]
[NoZeroSMulDivisors A B]
(x : B)

(algebraMap A (FractionRing A)) ((Algebra.intTrace A B) x) =
  (Algebra.trace (FractionRing A) (FractionRing B)) ((algebraMap B (FractionRing B)) x)


theorem full_arrow_eq_iff {c d : (full D).objs} {f g : c ⟶ d} :
    f = g ↔ (f.1 : c.val ⟶ d.val) = g.1

{c d : ↑(CategoryTheory.Subgroupoid.full D).objs}


private theorem continuousAt_rpow_const_of_pos {x : ℝ≥0∞} {y : ℝ} (h : 0 < y) :
    ContinuousAt (fun a : ℝ≥0∞ => a ^ y) x


/-- A restatement of `Types.Limit.map_π_apply` that uses `Pi.π` and `Pi.map`,
with specialized universes. -/
theorem pi_map_π_apply' {β : Type v} {f g : β → Type v} (α : ∀ j, f j ⟶ g j) (b : β) (x) :
    (Pi.π g b : ∏ᶜ g → g b) (Pi.map α x) = α b ((Pi.π f b : ∏ᶜ f → f b) x)

{β : Type v}
{f g : β → Type v}
(α : (j : β) → f j ⟶ g j)
(b : β)
(x : ∏ᶜ f)

CategoryTheory.Limits.Pi.π g b (CategoryTheory.Limits.Pi.map α x) = α b (CategoryTheory.Limits.Pi.π f b x)


protected theorem le_sSup {c : Set (E →ₗ.[R] F)} (hc : DirectedOn (· ≤ ·) c) {f : E →ₗ.[R] F}
    (hf : f ∈ c) : f ≤ LinearPMap.sSup c hc

(hc : DirectedOn (fun x x_1 => x ≤ x_1) c)


@[simp] lemma closure_closure (M : Matroid α) (X : Set α) : M.closure (M.closure X) = M.closure X

{α : Type u_2}
(M : Matroid α)
(X : Set α)


/-- An angle in a right-angled triangle expressed using `arccos`. -/
theorem angle_add_eq_arccos_of_inner_eq_zero {x y : V} (h : ⟪x, y⟫ = 0) :
    angle x (x + y) = Real.arccos (‖x‖ / ‖x + y‖)

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
{x y : V}
(h : ⟪x, y⟫_ℝ = 0)

InnerProductGeometry.angle x (x + y) = Real.arccos (‖x‖ / ‖x + y‖)


@[to_additive]
theorem continuousMul_iInf {ts : ι' → TopologicalSpace M}
    (h' : ∀ i, @ContinuousMul M (ts i) _) : @ContinuousMul M (⨅ i, ts i) _

{M : Type u_3}
{ι' : Sort u_6}
[Mul M]
{ts : ι' → TopologicalSpace M}
(h' : ∀ (i : ι'), ContinuousMul M)


@[simp] lemma ofScott_toScott (a : α) : ofScott (toScott a) = a

Topology.WithScott.ofScott (Topology.WithScott.toScott a) = a


/-- Structure containing the data of inverse map `(F.obj X ⟶ F.obj Y) ⟶ (X ⟶ Y)` of `F.map`
in order to express that `F` is a fully faithful functor. -/
structure FullyFaithful where
  /-- The inverse map `(F.obj X ⟶ F.obj Y) ⟶ (X ⟶ Y)` of `F.map`. -/
  preimage {X Y : C} (f : F.obj X ⟶ F.obj Y) : X ⟶ Y
  map_preimage {X Y : C} (f : F.obj X ⟶ F.obj Y) : F.map (preimage f) = f := by aesop_cat
  preimage_map {X Y : C} (f : X ⟶ Y) : preimage (F.map f) = f := by aesop_cat

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F : CategoryTheory.Functor C D}
(self : F.FullyFaithful)
{X Y : C}
(f : F.obj X ⟶ F.obj Y)


theorem ne_zero_of_ne_zero_of_monic (hp : p ≠ 0) (hq : Monic q) : q ≠ 0

{R : Type u}
[Semiring R]
{p q : R[X]}
(hp : p ≠ 0)
(hq : q.Monic)


@[simp]
theorem coe_mk (f : A → B) (h₁ h₂ h₃ h₄ h₅) :
    ((⟨⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩, h₅⟩ : A →⋆ₙₐ[R] B) : A → B) = f

(h₁ : ∀ (m : R) (x : A), f (m • x) = (MonoidHom.id R) m • f x)

(h₂ : { toFun := f, map_smul' := h₁ }.toFun 0 = 0)

(h₃ :
  ∀ (x y : A),
    { toFun := f, map_smul' := h₁ }.toFun (x + y) =
      { toFun := f, map_smul' := h₁ }.toFun x + { toFun := f, map_smul' := h₁ }.toFun y)

(h₄ :
  ∀ (x y : A),
    { toFun := f, map_smul' := h₁, map_zero' := h₂, map_add' := h₃ }.toFun (x * y) =
      { toFun := f, map_smul' := h₁, map_zero' := h₂, map_add' := h₃ }.toFun x *
        { toFun := f, map_smul' := h₁, map_zero' := h₂, map_add' := h₃ }.toFun y)

(h₅ :
  ∀ (a : A),
    { toFun := f, map_smul' := h₁, map_zero' := h₂, map_add' := h₃, map_mul' := h₄ }.toFun (star a) =
      star ({ toFun := f, map_smul' := h₁, map_zero' := h₂, map_add' := h₃, map_mul' := h₄ }.toFun a))

⇑{ toFun := f, map_smul' := h₁, map_zero' := h₂, map_add' := h₃, map_mul' := h₄, map_star' := h₅ } = f


/-- `SetTheory.PGame.State S` describes how to interpret `s : S` as a state of a combinatorial game.
Use `SetTheory.PGame.ofState s` or `SetTheory.Game.ofState s` to construct the game.

`SetTheory.PGame.State.l : S → Finset S` and `SetTheory.PGame.State.r : S → Finset S` describe
the states reachable by a move by Left or Right. `SetTheory.PGame.State.turnBound : S → ℕ`
gives an upper bound on the number of possible turns remaining from this state.
-/
class State (S : Type u) where
  turnBound : S → ℕ
  l : S → Finset S
  r : S → Finset S
  left_bound : ∀ {s t : S}, t ∈ l s → turnBound t < turnBound s
  right_bound : ∀ {s t : S}, t ∈ r s → turnBound t < turnBound s

{S : Type u}
[self : SetTheory.PGame.State S]
{s t : S}

t ∈ SetTheory.PGame.State.l s → SetTheory.PGame.State.turnBound t < SetTheory.PGame.State.turnBound s


@[simp]
theorem modEq_neg : a ≡ b [PMOD -p] ↔ a ≡ b [PMOD p]

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


/-- When `S.f = 0`, this is the canonical isomorphism `S.opcycles ≅ S.X₂`
induced by `S.pOpcycles`. -/
@[simps! inv]
noncomputable def opcyclesIsoX₂ (hf : S.f = 0) : S.opcycles ≅ S.X₂


/-- The composition of `C^n` functions at points is `C^n`. -/
nonrec theorem ContDiffAt.comp (x : E) (hg : ContDiffAt 𝕜 n g (f x)) (hf : ContDiffAt 𝕜 n f x) :
    ContDiffAt 𝕜 n (g ∘ f) x

{𝕜 : 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]
{f : E → F}
{g : F → G}
{n : ℕ∞}
(x : E)
(hg : ContDiffAt 𝕜 n g (f x))
(hf : ContDiffAt 𝕜 n f x)


theorem SimpleFunc.stronglyMeasurable {α β} {_ : MeasurableSpace α} [TopologicalSpace β]
    (f : α →ₛ β) : StronglyMeasurable f

∀ {x : MeasurableSpace α} [inst : TopologicalSpace β] (f : MeasureTheory.SimpleFunc α β),
  MeasureTheory.StronglyMeasurable ↑f


/-- Any nonempty perfect set in a complete metric space admits a continuous injection
from the Cantor space, `ℕ → Bool`. -/
theorem Perfect.exists_nat_bool_injection [CompleteSpace α] :
    ∃ f : (ℕ → Bool) → α, range f ⊆ C ∧ Continuous f ∧ Injective f

{α : Type u_1}
[MetricSpace α]
{C : Set α}
(hC : Perfect C)
(hnonempty : C.Nonempty)
[CompleteSpace α]

∃ f, Set.range f ⊆ C ∧ Continuous f ∧ Function.Injective f


theorem Nodup.pairwise_of_forall_ne {l : List α} {r : α → α → Prop} (hl : l.Nodup)
    (h : ∀ a ∈ l, ∀ b ∈ l, a ≠ b → r a b) : l.Pairwise r

{α : Type u}
{l : List α}
{r : α → α → Prop}
(hl : l.Nodup)
(h : ∀ a ∈ l, ∀ b ∈ l, a ≠ b → r a b)


/-- An arrow ending in the zero object is zero -/
theorem zero_of_to_zero {X : C} (f : X ⟶ 0) : f = 0


/-- Paste two pushout squares "vertically" to obtain another pushout square.

The objects in the statement fit into the following diagram:
```
X₁₁ - h₁₁ -> X₁₂
|            |
v₁₁          v₁₂
↓            ↓
X₂₁ - h₂₁ -> X₂₂
|            |
v₂₁          v₂₂
↓            ↓
X₃₁ - h₃₁ -> X₃₂
```
-/
theorem paste_vert {X₁₁ X₁₂ X₂₁ X₂₂ X₃₁ X₃₂ : C} {h₁₁ : X₁₁ ⟶ X₁₂} {h₂₁ : X₂₁ ⟶ X₂₂}
    {h₃₁ : X₃₁ ⟶ X₃₂} {v₁₁ : X₁₁ ⟶ X₂₁} {v₁₂ : X₁₂ ⟶ X₂₂} {v₂₁ : X₂₁ ⟶ X₃₁} {v₂₂ : X₂₂ ⟶ X₃₂}
    (s : IsPushout h₁₁ v₁₁ v₁₂ h₂₁) (t : IsPushout h₂₁ v₂₁ v₂₂ h₃₁) :
    IsPushout h₁₁ (v₁₁ ≫ v₂₁) (v₁₂ ≫ v₂₂) h₃₁

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

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

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

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

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

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

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

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

(s : CategoryTheory.IsPushout h₁₁ v₁₁ v₁₂ h₂₁)

(t : CategoryTheory.IsPushout h₂₁ v₂₁ v₂₂ h₃₁)

CategoryTheory.IsPushout h₁₁ (v₁₁ ≫ v₂₁) (v₁₂ ≫ v₂₂) h₃₁


/-- Suppose we have a square of functors (where the top and bottom are adjunctions `L₁ ⊣ R₁`
and `L₂ ⊣ R₂` respectively).

      C ↔ D
    G ↓   ↓ H
      E ↔ F

Then we have a bijection between natural transformations `G ⋙ L₂ ⟶ L₁ ⋙ H` and
`R₁ ⋙ G ⟶ H ⋙ R₂`. This can be seen as a bijection of the 2-cells:

         L₁                  R₁
      C --→ D             C ←-- D
    G ↓  ↗  ↓ H         G ↓  ↘  ↓ H
      E --→ F             E ←-- F
         L₂                  R₂

Note that if one of the transformations is an iso, it does not imply the other is an iso.
-/
@[simps]
def mateEquiv : (G ⋙ L₂ ⟶ L₁ ⋙ H) ≃ (R₁ ⋙ G ⟶ H ⋙ R₂)

{C : Type u₁}
{D : Type u₂}
{E : Type u₃}
{F : Type u₄}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Category.{v₂, u₂} D]
[CategoryTheory.Category.{v₃, u₃} E]
[CategoryTheory.Category.{v₄, u₄} F]
{G : CategoryTheory.Functor C E}
{H : CategoryTheory.Functor D F}
{L₁ : CategoryTheory.Functor C D}
{R₁ : CategoryTheory.Functor D C}
{L₂ : CategoryTheory.Functor E F}
{R₂ : CategoryTheory.Functor F E}
(adj₁ : L₁ ⊣ R₁)
(adj₂ : L₂ ⊣ R₂)
(β : R₁.comp G ⟶ H.comp R₂)

(CategoryTheory.mateEquiv adj₁ adj₂).symm β =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.whiskerRight adj₁.unit (G.comp L₂))
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.whiskerRight (CategoryTheory.whiskerLeft L₁ β) L₂)
      (CategoryTheory.whiskerLeft (L₁.comp H) adj₂.counit))


/-- The isomorphism of `J`-graded objects `X.mapObj p ≅ Y.mapObj p` induced by an
isomorphism `X ≅ Y` of graded objects and a map `p : I → J`. -/
@[simps]
noncomputable def mapIso : X.mapObj p ≅ Y.mapObj p

{I : Type u_1}
{J : Type u_2}
{C : Type u_4}
[CategoryTheory.Category.{u_5, u_4} C]
{X Y : CategoryTheory.GradedObject I C}
(e : X ≅ Y)
(p : I → J)
[X.HasMap p]
[Y.HasMap p]
(i : J)

(CategoryTheory.GradedObject.mapIso e p).hom i = CategoryTheory.GradedObject.mapMap e.hom p i


@[elementwise]
theorem to_global_factors :
    toOpen R ⊤ =
      CommRingCat.ofHom (algebraMap R (Localization.Away (1 : R))) ≫
        toBasicOpen R (1 : R) ≫
        (structureSheaf R).1.map (eqToHom PrimeSpectrum.basicOpen_one.symm).op

AlgebraicGeometry.StructureSheaf.toOpen R ⊤ =
  CommRingCat.ofHom (algebraMap R (Localization.Away 1)) ≫
    AlgebraicGeometry.StructureSheaf.toBasicOpen R 1 ≫
      (AlgebraicGeometry.Spec.structureSheaf R).val.map (CategoryTheory.eqToHom ⋯).op


{α : Type u_2}
[HeytingAlgebra α]
{a b : α}


theorem coeFn_zero : ⇑(0 : Lp E p μ) =ᵐ[μ] 0

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


theorem DifferentiableWithinAt.norm (hf : DifferentiableWithinAt ℝ f s x) (h0 : f x ≠ 0) :
    DifferentiableWithinAt ℝ (fun y => ‖f y‖) 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}
(hf : DifferentiableWithinAt ℝ f s x)
(h0 : f x ≠ 0)


@[to_additive]
theorem to_submonoid_inj (c d : Con M) (H : (c : Submonoid (M × M)) = d) : c = d

{M : Type u_1}
[AddZeroClass M]
(c d : AddCon M)
(H : ↑c = ↑d)


/-- Let `μ` be a locally finite measure on an R₁ topological space with Borel σ-algebra.
If `μ` is inner regular for finite measure sets with respect to compact sets,
then any finite measurable set can be approximated in measure by an open set.
See also `Set.exists_isOpen_lt_of_lt` and `MeasurableSet.exists_isOpen_diff_lt`
for the case of an outer regular measure. -/
protected theorem _root_.MeasurableSet.exists_isOpen_symmDiff_lt [InnerRegularCompactLTTop μ]
    [IsLocallyFiniteMeasure μ] [R1Space α] [BorelSpace α]
    {s : Set α} (hs : MeasurableSet s) (hμs : μ s ≠ ∞) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
    ∃ U, IsOpen U ∧ μ U < ∞ ∧ μ (U ∆ s) < ε


theorem not_succ_of_isLimit {o} (h : IsLimit o) : ¬∃ a, o = succ a


theorem Fintype.card_subtype_lt [Fintype α] {p : α → Prop} [DecidablePred p] {x : α} (hx : ¬p x) :
    Fintype.card { x // p x } < Fintype.card α

{α : Type u_1}
[Fintype α]
{p : α → Prop}
[DecidablePred p]
{x : α}
(hx : ¬p x)


@[simp]
theorem liftHom_root (h : IsAdjoinRoot S f) : h.liftHom x hx' h.root = x

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
{T : Type u_1}
[CommRing T]
{x : T}
[Algebra R T]
(hx' : (Polynomial.aeval x) f = 0)
(h : IsAdjoinRoot S f)

(IsAdjoinRoot.liftHom x hx' h) h.root = x


theorem lt_add_one {x : PartENat} (hx : x ≠ ⊤) : x < x + 1


/-- Composition of enriched functors. -/
@[simps]
def EnrichedFunctor.comp {C : Type u₁} {D : Type u₂} {E : Type u₃} [EnrichedCategory V C]
    [EnrichedCategory V D] [EnrichedCategory V E] (F : EnrichedFunctor V C D)
    (G : EnrichedFunctor V D E) : EnrichedFunctor V C E

(F : CategoryTheory.EnrichedFunctor V C D)

(G : CategoryTheory.EnrichedFunctor V D E)

(CategoryTheory.EnrichedFunctor.comp V F G).obj X = G.obj (F.obj X)


/-- **Burnside's lemma** : given a finite group `G` acting on a set `X`, the average number of
elements fixed by each `g ∈ G` is the number of orbits. -/
@[to_additive AddAction.sum_card_fixedBy_eq_card_orbits_mul_card_addGroup
      "**Burnside's lemma** : given a finite additive group `G` acting on a set `X`,
      the average number of elements fixed by each `g ∈ G` is the number of orbits. "]
theorem sum_card_fixedBy_eq_card_orbits_mul_card_group [Fintype α] [∀ a : α, Fintype <| fixedBy β a]
    [Fintype Ω] : (∑ a : α, Fintype.card (fixedBy β a)) = Fintype.card Ω * Fintype.card α

[(a : α) → Fintype ↑(AddAction.fixedBy β a)]

[Fintype (Quotient (AddAction.orbitRel α β))]

∑ a : α, Fintype.card ↑(AddAction.fixedBy β a) = Fintype.card (Quotient (AddAction.orbitRel α β)) * Fintype.card α


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

(θ : CategoryTheory.StrongOplaxNatTrans G H)

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerLeft f (θ.naturality (CategoryTheory.CategoryStruct.id a)).hom)
    (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.whiskerLeft (θ.app a) (H.mapId a))) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.whiskerRight (G.mapId a) (θ.app a)))
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.leftUnitor (θ.app a)).hom)
      (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.rightUnitor (θ.app a)).inv))


@[deprecated drop_take_succ_join_eq_getElem (since := "2024-06-11")]
lemma drop_take_succ_join_eq_get (L : List (List α)) (i : Fin L.length) :
    (L.join.take ((L.map length).take (i + 1)).sum).drop ((L.map length).take i).sum = get L i

{α : Type u_2}
(L : List (List α))
(i : Fin L.length)

List.drop (List.take (↑i) (List.map List.length L)).sum
    (List.take (List.take (↑i + 1) (List.map List.length L)).sum L.join) =
  L.get i


theorem cantorFunctionAux_nonneg (h : 0 ≤ c) : 0 ≤ cantorFunctionAux c f n

{c : ℝ}
{f : ℕ → Bool}
{n : ℕ}
(h : 0 ≤ c)


theorem encode_iff {f : α → σ} : (Primrec fun a => encode (f a)) ↔ Primrec f

{α : Type u_1}
{σ : Type u_3}
[Primcodable α]
[Primcodable σ]
{f : α → σ}

(Primrec fun a => Encodable.encode (f a)) ↔ Primrec f


theorem ContMDiffWithinAt.smoothWithinAt (h : ContMDiffWithinAt I I' ⊤ f s x) :
    SmoothWithinAt I I' f s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f : M → M'}
{s : Set M}
{x : M}
(h : ContMDiffWithinAt I I' ⊤ f s x)


@[simp]
theorem ofMulAction_apply {H : Type*} [MulAction G H] (g : G) (f : H →₀ k) (h : H) :
    ofMulAction k G H g f h = f (g⁻¹ • h)

{k : Type u_1}
{G : Type u_2}
[CommSemiring k]
[Group G]
{H : Type u_4}
[MulAction G H]
(g : G)
(f : H →₀ k)
(h : H)

(((Representation.ofMulAction k G H) g) f) h = f (g⁻¹ • h)


theorem ConvexOn.average_mem_epigraph [IsFiniteMeasure μ] [NeZero μ] (hg : ConvexOn ℝ s g)
    (hgc : ContinuousOn g s) (hsc : IsClosed s) (hfs : ∀ᵐ x ∂μ, f x ∈ s)
    (hfi : Integrable f μ) (hgi : Integrable (g ∘ f) μ) :
    (⨍ x, f x ∂μ, ⨍ x, g (f x) ∂μ) ∈ {p : E × ℝ | p.1 ∈ s ∧ g p.1 ≤ p.2}

(hgi : MeasureTheory.Integrable (g ∘ f) μ)

(⨍ (x : α), f x ∂μ, ⨍ (x : α), g (f x) ∂μ) ∈ {p | p.1 ∈ s ∧ g p.1 ≤ p.2}


theorem iff_symm_preimage_eq' :
    e.IsImage s t ↔ e.target ∩ e.symm ⁻¹' (e.source ∩ s) = e.target ∩ t

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

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


@[simp]
lemma sheafificationAdjunction_unit_app_hom (M₀ : PresheafOfModules.{v} R₀) :
    ((sheafificationAdjunction α).unit.app M₀).hom = CategoryTheory.toSheafify J M₀.presheaf

{J : CategoryTheory.GrothendieckTopology C}

((PresheafOfModules.sheafificationAdjunction α).unit.app M₀).hom = CategoryTheory.toSheafify J M₀.presheaf


theorem inl_mul_inl [Monoid R] [NonUnitalNonAssocSemiring A] [DistribMulAction R A] (r₁ r₂ : R) :
    (inl r₁ * inl r₂ : Unitization R A) = inl (r₁ * r₂)

{R : Type u_1}
(A : Type u_2)
[Monoid R]
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
(r₁ r₂ : R)

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


@[simp]
theorem truncate_comp {n₁ n₂ n₃ : ℕ} (h1 : n₁ ≤ n₂) (h2 : n₂ ≤ n₃) :
    (@truncate p _ _ R _ _ h1).comp (truncate h2) = truncate (h1.trans h2)

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{R : Type u_1}
[CommRing R]
{n₁ n₂ n₃ : ℕ}
(h1 : n₁ ≤ n₂)
(h2 : n₂ ≤ n₃)

(TruncatedWittVector.truncate h1).comp (TruncatedWittVector.truncate h2) = TruncatedWittVector.truncate ⋯


/-- See also `MeasureTheory.ae_restrict_uIoc_iff`. -/
theorem ae_uIoc_iff [LinearOrder α] {a b : α} {P : α → Prop} :
    (∀ᵐ x ∂μ, x ∈ Ι a b → P x) ↔ (∀ᵐ x ∂μ, x ∈ Ioc a b → P x) ∧ ∀ᵐ x ∂μ, x ∈ Ioc b a → P x

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[LinearOrder α]
{a b : α}
{P : α → Prop}

(∀ᵐ (x : α) ∂μ, x ∈ Ι a b → P x) ↔ (∀ᵐ (x : α) ∂μ, x ∈ Set.Ioc a b → P x) ∧ ∀ᵐ (x : α) ∂μ, x ∈ Set.Ioc b a → P x


theorem pos : ∀ {it}, ValidFor l r it → it.2 = ⟨utf8Len l⟩

{l r : List Char}
{it : String.Iterator}

String.Iterator.ValidFor l r it → it.i = { byteIdx := String.utf8Len l }


/-- A version of Bolzano-Weierstrass: in a uniform space with countably generated uniformity filter
(e.g., in a metric space), a set is compact if and only if it is sequentially compact. -/
protected theorem UniformSpace.isCompact_iff_isSeqCompact : IsCompact s ↔ IsSeqCompact s

{X : Type u_1}
[UniformSpace X]
{s : Set X}
[(𝓤 X).IsCountablyGenerated]


@[simp]
theorem not_le {a b : α} : ¬a ≤ b ↔ b < a


theorem union_right (ht : SeparatedNhds s t) (hu : SeparatedNhds s u) : SeparatedNhds s (t ∪ u)

{X : Type u_1}
[TopologicalSpace X]
{s t u : Set X}
(ht : SeparatedNhds s t)
(hu : SeparatedNhds s u)


theorem Mem.congr_left : ∀ {x y : PSet.{u}}, Equiv x y → ∀ {w : PSet.{u}}, x ∈ w ↔ y ∈ w


theorem zip_unzip : ∀ l : List (α × β), zip (unzip l).1 (unzip l).2 = l

{α : Type u}
{β : Type u_1}
(l : List (α × β))


/-- The `limsup` relationship for the spectral radius used to prove `spectrum.gelfand_formula`. -/
theorem limsup_pow_nnnorm_pow_one_div_le_spectralRadius (a : A) :
    limsup (fun n : ℕ => (‖a ^ n‖₊ : ℝ≥0∞) ^ (1 / n : ℝ)) atTop ≤ spectralRadius ℂ a

{A : Type u_2}
[NormedRing A]
[NormedAlgebra ℂ A]
[CompleteSpace A]
(a : A)

Filter.limsup (fun n => ↑‖a ^ n‖₊ ^ (1 / ↑n)) Filter.atTop ≤ spectralRadius ℂ a


lemma IsPointwiseRightKanExtension.isRightKanExtension :
    E.left.IsRightKanExtension E.hom

{C : Type u_1}
{D : Type u_2}
{H : Type u_3}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_6, u_2} D]
[CategoryTheory.Category.{u_5, u_3} H]
{L : CategoryTheory.Functor C D}
{F : CategoryTheory.Functor C H}
{E : L.RightExtension F}
(h : E.IsPointwiseRightKanExtension)


theorem mem_of_mem_take {l : List α} (h : a ∈ l.take n) : a ∈ l

{α : Type u_1}
{a : α}
{n : Nat}
{l : List α}
(h : a ∈ List.take n l)


lemma jacobiTheta₂'_functional_equation' (z τ : ℂ) :
    jacobiTheta₂' z τ = (-2 * π) / (-I * τ) ^ (3 / 2 : ℂ) * jacobiTheta₂'' z (-1 / τ)

jacobiTheta₂' z τ = -2 * ↑π / (-Complex.I * τ) ^ (3 / 2) * HurwitzZeta.jacobiTheta₂'' z (-1 / τ)


/-- Two finite and free modules are isomorphic if they have the same (finite) rank. -/
theorem FiniteDimensional.nonempty_linearEquiv_of_finrank_eq
    [Module.Finite R M] [Module.Finite R M'] (cond : finrank R M = finrank R M') :
    Nonempty (M ≃ₗ[R] M')

(cond : FiniteDimensional.finrank R M = FiniteDimensional.finrank R M')


theorem piCongr'_apply (f : ∀ a, W a) : h₁.piCongr' h₂ f = fun b => h₂ b <| f <| h₁.symm b

{α : Sort u_2}
{β : Sort u_1}
{W : α → Sort w}
{Z : β → Sort z}
(h₁ : α ≃ β)
(h₂ : (b : β) → W (h₁.symm b) ≃ Z b)
(f : (a : α) → W a)

(h₁.piCongr' h₂) f = fun b => (h₂ b) (f (h₁.symm b))


/-- An isomorphism between isocrystals respects the Frobenius map. -/
-- Porting note(#5171): this linter isn't ported yet. @[nolint has_nonempty_instance]
structure IsocrystalEquiv extends V ≃ₗ[K(p, k)] V₂ where
  frob_equivariant : ∀ x : V, Φ(p, k) (toLinearEquiv x) = toLinearEquiv (Φ(p, k) x)

(self : WittVector.IsocrystalEquiv p k V V₂)

(WittVector.Isocrystal.frobenius p k) (self.toLinearEquiv x) =
  self.toLinearEquiv ((WittVector.Isocrystal.frobenius p k) x)


@[simp]
theorem ae_smul_measure_eq {c : ℝ≥0∞} (hc : c ≠ 0) : ae (c • μ) = ae μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{c : ENNReal}
(hc : c ≠ 0)

MeasureTheory.ae (c • μ) = MeasureTheory.ae μ


@[simp] theorem tail_nil : @tail α [] = []


/-- The backward direction of the equivalence from algebras for the coproduct monad to the under
category.
-/
@[simps]
def underToAlgebra : Under X ⥤ Monad.Algebra (coprodMonad X)

((CategoryTheory.underToAlgebra X).obj f).A = f.right


@[simp]
theorem mapPresheaf_obj_presheaf (F : C ⥤ D) (X : PresheafedSpace C) :
    (F.mapPresheaf.obj X).presheaf = X.presheaf ⋙ F

(X : AlgebraicGeometry.PresheafedSpace C)


lemma le_comap_of_subsingleton (f : V → W) [Subsingleton V] : G ≤ G'.comap f

{V : Type u_1}
{W : Type u_2}
(G : SimpleGraph V)
(G' : SimpleGraph W)
(f : V → W)
[Subsingleton V]


theorem normalize_associated (x : α) : Associated (normalize x) x

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]
(x : α)


/-- `Complex.arg ∘ (↑)` and `expMapCircle` define a partial equivalence between `circle` and `ℝ`
with `source = Set.univ` and `target = Set.Ioc (-π) π`. -/
@[simps (config := .asFn)]
noncomputable def argPartialEquiv : PartialEquiv circle ℝ

circle.argPartialEquiv.target = Set.Ioc (-π) π


theorem symm_apply_eq (e : M₁ ≃SL[σ₁₂] M₂) {x y} : e.symm x = y ↔ x = e y

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


@[simp]
lemma restrictScalars_apply (f : A →ₙₐ[S] B) (x : A) : f.restrictScalars R x = f x

(R : Type u_1)
{S : Type u_2}
{A : Type u_3}
{B : Type u_4}
[Monoid R]
[Monoid S]
[NonUnitalNonAssocSemiring A]
[NonUnitalNonAssocSemiring B]
[MulAction R S]
[DistribMulAction S A]
[DistribMulAction S B]
[DistribMulAction R A]
[DistribMulAction R B]
[IsScalarTower R S A]
[IsScalarTower R S B]
(f : A →ₙₐ[S] B)
(x : A)

(NonUnitalAlgHom.restrictScalars R f) x = f x


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


@[simp]
theorem sumComm_symm (α β : Type*) [LE α] [LE β] :
    (OrderIso.sumComm α β).symm = OrderIso.sumComm β α

(α : Type u_5)
(β : Type u_6)
[LE α]
[LE β]


@[simp]
theorem kernelSubobject_zero {A B : C} : kernelSubobject (0 : A ⟶ B) = ⊤

CategoryTheory.Limits.kernelSubobject 0 = ⊤


@[continuity, fun_prop]
theorem continuous_sinh : Continuous sinh


theorem Multiset.untrop_prod [AddCommMonoid R] (s : Multiset (Tropical R)) :
    untrop s.prod = Multiset.sum (s.map untrop)

{R : Type u_1}
[AddCommMonoid R]
(s : Multiset (Tropical R))

Tropical.untrop s.prod = (Multiset.map Tropical.untrop s).sum


@[simp] -- Porting note: added variant with `Equiv.pointReflection` for `simp`
theorem Equiv.pointReflection_midpoint_right (x y : P) :
    (Equiv.pointReflection (midpoint R x y)) y = x

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[Ring R]
[Invertible 2]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
(x y : P)


@[to_additive]
theorem zpow_smul_eq_iff_minimalPeriod_dvd {n : ℤ} :
    a ^ n • b = b ↔ (minimalPeriod (a • ·) b : ℤ) ∣ n

{α : Type v}
{G : Type u}
[Group G]
[MulAction G α]
{a : G}
{b : α}
{n : ℤ}

a ^ n • b = b ↔ ↑(Function.minimalPeriod (fun x => a • x) b) ∣ n


/-- Post-composing an additive character to `ℂ` with complex conjugation gives the inverse
character. -/
lemma starComp_eq_inv (hR : 0 < ringChar R) {φ : AddChar R ℂ} :
    (starRingEnd ℂ).compAddChar φ = φ⁻¹

{R : Type u_1}
[CommRing R]
(hR : 0 < ringChar R)
{φ : AddChar R ℂ}


/-- Create a `PerfectionMap` from an isomorphism to the perfection. -/
@[simps]
theorem mk' {f : P →+* R} (g : P ≃+* Ring.Perfection R p) (hfg : Perfection.lift p P R f = g) :
    PerfectionMap p f

{p : ℕ}
[Fact (Nat.Prime p)]
{R : Type u₁}
[CommSemiring R]
[CharP R p]
{P : Type u₃}
[CommSemiring P]
[CharP P p]
[PerfectRing P p]
{f : P →+* R}
(g : P ≃+* Ring.Perfection R p)
(hfg : (Perfection.lift p P R) f = ↑g)


/--
Let `r` be a relation on `α`, a relation series of `r` of length `n` is a series
`a_0, a_1, ..., a_n` such that `r a_i a_{i+1}` for all `i < n`
-/
structure RelSeries where
  /-- The number of inequalities in the series -/
  length : ℕ
  /-- The underlying function of a relation series -/
  toFun : Fin (length + 1) → α
  /-- Adjacent elements are related -/
  step : ∀ (i : Fin length), r (toFun (Fin.castSucc i)) (toFun i.succ)

{α : Type u_1}
{r : Rel α α}
(self : RelSeries r)
(i : Fin self.length)

r (self.toFun i.castSucc) (self.toFun i.succ)


theorem integrable_cexp_neg_mul_sq {b : ℂ} (hb : 0 < b.re) :
    Integrable fun x : ℝ => cexp (-b * (x : ℂ) ^ 2)

MeasureTheory.Integrable (fun x => cexp (-b * ↑x ^ 2)) MeasureTheory.volume


/-- A key numerical identity needed for the proof of `WittVector.map_frobeniusPoly`. -/
theorem map_frobeniusPoly.key₂ {n i j : ℕ} (hi : i ≤ n) (hj : j < p ^ (n - i)) :
    j - v p ⟨j + 1, j.succ_pos⟩ + n = i + j + (n - i - v p ⟨j + 1, j.succ_pos⟩)

(p : ℕ)
[hp : Fact (Nat.Prime p)]
{n i j : ℕ}
(hi : i ≤ n)
(hj : j < p ^ (n - i))

j - WittVector.pnat_multiplicity p ⟨j + 1, ⋯⟩ + n = i + j + (n - i - WittVector.pnat_multiplicity p ⟨j + 1, ⋯⟩)


theorem not_mem_of_not_mem_closure {s : Set R} {P : R} (hP : P ∉ closure s) : P ∉ s

(hP : P ∉ NonUnitalSubsemiring.closure s)


/-- Tensoring on the left with a fixed object, as a functor. -/
@[simps!]
def tensorLeft (X : C) : C ⥤ C

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

(CategoryTheory.MonoidalCategory.tensorLeft X).obj Y = CategoryTheory.MonoidalCategory.tensorObj X Y


theorem blsub_le_enumOrd (hS : Unbounded (· < ·) S) (o) :
    (blsub.{u, u} o fun c _ => enumOrd S c) ≤ enumOrd S o

(hS : Set.Unbounded (fun x x_1 => x < x_1) S)

(o.blsub fun c x => Ordinal.enumOrd S c) ≤ Ordinal.enumOrd S o


theorem Fin.snoc_eq_cons_rotate {α : Type*} (v : Fin n → α) (a : α) :
    @Fin.snoc _ (fun _ => α) v a = fun i => @Fin.cons _ (fun _ => α) a v (finRotate _ i)

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

Fin.snoc v a = fun i => Fin.cons a v ((finRotate (n + 1)) i)


protected theorem sound {p p' : α × α} (h : Sym2.Rel α p p') : Sym2.mk p = Sym2.mk p'

{α : Type u_1}
{p p' : α × α}
(h : Sym2.Rel α p p')


@[to_additive]
theorem eq_prod_range_div {M : Type*} [CommGroup M] (f : ℕ → M) (n : ℕ) :
    f n = f 0 * ∏ i ∈ range n, f (i + 1) / f i

{M : Type u_6}
[AddCommGroup M]
(f : ℕ → M)
(n : ℕ)

f n = f 0 + ∑ i ∈ Finset.range n, (f (i + 1) - f i)


/-- The disjoint union of antidiagonal tuples `Σ n, antidiagonalTuple k n` is equivalent to the
`k`-tuple `Fin k → ℕ`. This is such an equivalence, obtained by mapping `(n, x)` to `x`.

This is the tuple version of `Finset.sigmaAntidiagonalEquivProd`. -/
@[simps]
def sigmaAntidiagonalTupleEquivTuple (k : ℕ) : (Σ n, antidiagonalTuple k n) ≃ (Fin k → ℕ)

((Finset.Nat.sigmaAntidiagonalTupleEquivTuple k).symm x).fst = ∑ i : Fin k, x i


theorem SurjOn.mapsTo_compl (h : SurjOn f s t) (h' : Injective f) : MapsTo f sᶜ tᶜ

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{f : α → β}
(h : Set.SurjOn f s t)
(h' : Function.Injective f)


@[simp]
theorem mem_top {x : M} : x ∈ (⊤ : Submodule R M)

{R : Type u_1}
{M : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{x : M}


theorem sup_apply [Sup β] (f g : α →ₛ β) (a : α) : (f ⊔ g) a = f a ⊔ g a

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[Sup β]
(f g : MeasureTheory.SimpleFunc α β)
(a : α)


theorem continuousOn_iff [PseudoMetricSpace β] {f : α → β} {s : Set α} :
    ContinuousOn f s ↔ ∀ b ∈ s, ∀ ε > 0, ∃ δ > 0, ∀ a ∈ s, dist a b < δ → dist (f a) (f b) < ε

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


theorem ssubset_iff_of_subset {s₁ s₂ : Finset α} (h : s₁ ⊆ s₂) : s₁ ⊂ s₂ ↔ ∃ x ∈ s₂, x ∉ s₁

{α : Type u_1}
{s₁ s₂ : Finset α}
(h : s₁ ⊆ s₂)

s₁ ⊂ s₂ ↔ ∃ x ∈ s₂, x ∉ s₁


theorem Integrable.mul_const' {f : α → 𝕜} (h : Integrable f μ) (c : 𝕜) :
    Integrable (f * fun _ : α => c) μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{𝕜 : Type u_5}
[NormedRing 𝕜]
{f : α → 𝕜}
(h : MeasureTheory.Integrable f μ)
(c : 𝕜)

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


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


lemma mapBifunctorRightUnitor_inv_apply (j : J) :
    (mapBifunctorRightUnitor F Y e p hp X).inv j =
      e.inv.app (X j) ≫ (F.obj (X j)).map (singleObjApplyIso (0 : I) Y).inv ≫
        ιMapBifunctorMapObj F p X ((single₀ I).obj Y) j 0 j (hp j)

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

(e : F.flip.obj Y ≅ CategoryTheory.Functor.id D)

[(X : D) → CategoryTheory.Limits.PreservesColimit (CategoryTheory.Functor.empty C) (F.obj X)]

[(((CategoryTheory.GradedObject.mapBifunctor F J I).obj X).obj ((CategoryTheory.GradedObject.single₀ I).obj Y)).HasMap
    p]

(CategoryTheory.GradedObject.mapBifunctorRightUnitor F Y e p hp X).inv j =
  CategoryTheory.CategoryStruct.comp (e.inv.app (X j))
    (CategoryTheory.CategoryStruct.comp ((F.obj (X j)).map (CategoryTheory.GradedObject.singleObjApplyIso 0 Y).inv)
      (CategoryTheory.GradedObject.ιMapBifunctorMapObj F p X ((CategoryTheory.GradedObject.single₀ I).obj Y) j 0 j ⋯))


theorem prod_norm_eq_of_L2 (x : WithLp 2 (α × β)) :
    ‖x‖ = √(‖x.fst‖ ^ 2 + ‖x.snd‖ ^ 2)

{α : Type u_2}
{β : Type u_3}
[SeminormedAddCommGroup α]
[SeminormedAddCommGroup β]
(x : WithLp 2 (α × β))


theorem isComplete_map_iff [RingHomSurjective σ₁₂] {p : Submodule R E} :
    IsComplete (p.map f.toLinearMap : Set E₂) ↔ IsComplete (p : Set E)

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

IsComplete ↑(Submodule.map f.toLinearMap p) ↔ IsComplete ↑p


@[simp]
theorem isOption_neg_neg {x y : PGame} : IsOption (-x) (-y) ↔ IsOption x y


theorem OpenEmbedding.tendsto_nhds_iff {f : ι → Y} {l : Filter ι} {y : Y} (hg : OpenEmbedding g) :
    Tendsto f l (𝓝 y) ↔ Tendsto (g ∘ f) l (𝓝 (g y))

{Y : Type u_2}
{Z : Type u_3}
{ι : Type u_4}
{g : Y → Z}
[TopologicalSpace Y]
[TopologicalSpace Z]
{f : ι → Y}
{l : Filter ι}
{y : Y}
(hg : OpenEmbedding g)

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


theorem det_matrixOfPolynomials {n : ℕ} (p : Fin n → R[X])
    (h_deg : ∀ i, (p i).natDegree = i) (h_monic : ∀ i, Monic <| p i) :
    (Matrix.of (fun (i j : Fin n) => (p j).coeff i)).det = 1

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

(Matrix.of fun i j => (p j).coeff ↑i).det = 1


@[to_additive]
theorem coe_comp_rangeRestrict (f : G →* N) :
    ((↑) : f.range → N) ∘ (⇑f.rangeRestrict : G → f.range) = f

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


theorem liftRel_subrelation_lex : Subrelation (LiftRel r s) (Lex r s)

∀ {α : Type u_1} {r : α → α → Prop} {β : Type u_2} {s : β → β → Prop}, Subrelation (Sum.LiftRel r s) (Sum.Lex r s)


theorem subNatNat_of_lt {m n : Nat} (h : m < n) : subNatNat m n = -[pred (n - m) +1]

Int.subNatNat m n = Int.negSucc (n - m).pred


@[simp]
theorem typein_enum (r : α → α → Prop) [IsWellOrder α r] {o} (h : o < type r) :
    typein r (enum r o h) = o

{α : Type u}
(r : α → α → Prop)
[IsWellOrder α r]
{o : Ordinal.{u}}
(h : o < Ordinal.type r)

Ordinal.typein r (Ordinal.enum r o h) = o


/-- A category with binary coproducts has a functorial `sup` operation on over categories. -/
@[simps]
def Over.coprod [HasBinaryCoproducts C] {A : C} : Over A ⥤ Over A ⥤ Over A

∀ {X Y : CategoryTheory.Over A} (k : X ⟶ Y) (g : CategoryTheory.Over A),
  (CategoryTheory.Over.coprod.map k).app g =
    CategoryTheory.Over.homMk (CategoryTheory.Limits.coprod.map k.left (𝟙 ((𝟭 C).obj g.left))) ⋯


@[simp]
theorem edgeSet_iInf (f : ι → G.Subgraph) :
    (⨅ i, f i).edgeSet = (⋂ i, (f i).edgeSet) ∩ G.edgeSet

{ι : Sort u_1}
{V : Type u}
{G : SimpleGraph V}
(f : ι → G.Subgraph)


theorem ext_iff {f g : F} : f = g ↔ ∀ x, f x = g x

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


theorem bsup_eq_of_brange_eq {o o'} {f : ∀ a < o, Ordinal} {g : ∀ a < o', Ordinal}
    (h : brange o f = brange o' g) : bsup.{u, max v w} o f = bsup.{v, max u w} o' g

{f : (a : Ordinal.{u}) → a < o → Ordinal.{max (max u v) w}}

{g : (a : Ordinal.{v}) → a < o' → Ordinal.{max (max u v) w}}


@[simp]
theorem dlookup_nil (a : α) : dlookup a [] = @none (β a)

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


@[to_additive (attr := simp)]
theorem _root_.map_dfinsupp_prod
    {R S H : Type*} [∀ i, Zero (β i)] [∀ (i) (x : β i), Decidable (x ≠ 0)]
    [CommMonoid R] [CommMonoid S] [FunLike H R S] [MonoidHomClass H R S] (h : H) (f : Π₀ i, β i)
    (g : ∀ i, β i → R) : h (f.prod g) = f.prod fun a b => h (g a b)

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


@[simp]
theorem comp_id (f : A →⋆ₙₐ[R] B) : f.comp (NonUnitalStarAlgHom.id _ _) = f

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[Monoid R]
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[Star A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction R B]
[Star B]
(f : A →⋆ₙₐ[R] B)


theorem inv_left_hom_right [IsIso sq] : inv sq.left ≫ f.hom ≫ sq.right = g.hom

{T : Type u}
[CategoryTheory.Category.{v, u} T]
{f g : CategoryTheory.Arrow T}
(sq : f ⟶ g)
[CategoryTheory.IsIso sq]

CategoryTheory.CategoryStruct.comp (CategoryTheory.inv sq.left) (CategoryTheory.CategoryStruct.comp f.hom sq.right) =
  g.hom


theorem coe_algEquivOfAssociated {p q : K[X]} (hp : p ≠ 0) (hpq : Associated p q) :
    (algEquivOfAssociated hp hpq).toFun =
      liftHom p (root q) (by simp only [aeval_eq, mk_eq_zero, hpq.symm.dvd])

{K : Type u_1}
[Field K]
{p q : K[X]}
(hp : p ≠ 0)
(hpq : Associated p q)

(AdjoinRoot.algEquivOfAssociated hp hpq).toFun = ⇑(AdjoinRoot.liftHom p (AdjoinRoot.root q) ⋯)


/-- Equivalence between all dependent finitely supported functions `f : Π₀ i, β i` and type
of pairs `⟨s : Finset ι, f : ∀ i : s, {x : β i // x ≠ 0}⟩`. -/
@[simps! apply_fst apply_snd_coe]
def sigmaFinsetFunEquiv : (Π₀ i, β i) ≃ Σ s : Finset ι, ∀ i : s, {x : β i // x ≠ 0}

∀ (a : Π₀ (i : ι), β i) (i : { x // x ∈ ((Equiv.sigmaFiberEquiv DFinsupp.support).symm a).fst }),
  ↑((DFinsupp.sigmaFinsetFunEquiv a).snd i) = a ↑i


theorem gcd_mul_gcd_of_coprime_of_mul_eq_mul
    (cop : Coprime c d) (h : a * b = c * d) : a.gcd c * b.gcd c = c

{c d a b : Nat}
(cop : c.Coprime d)
(h : a * b = c * d)


lemma hom_ext_of_isRightKanExtension {G : D ⥤ H} (γ₁ γ₂ : G ⟶ F')
    (hγ : whiskerLeft L γ₁ ≫ α = whiskerLeft L γ₂ ≫ α) : γ₁ = γ₂

(hγ :
  CategoryTheory.CategoryStruct.comp (CategoryTheory.whiskerLeft L γ₁) α =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.whiskerLeft L γ₂) α)


@[simp 900] theorem count_eq_zero_of_not_mem {a : α} {l : List α} (h : a ∉ l) : count a l = 0

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


@[simp]
protected theorem UpperSet.upperClosure (s : UpperSet α) : upperClosure (s : Set α) = s

{α : Type u_1}
[Preorder α]
(s : UpperSet α)


@[simp] lemma forget_map {X Y : GrpWithZero} (f : X ⟶ Y) :
  (forget GrpWithZero).map f = f

(CategoryTheory.forget GrpWithZero).map f = ⇑f


theorem algebraMap_mk {A : Type*} [Semiring A] [Algebra R A] (a : R) (s : S) :
    algebraMap _ _ (Localization.mk a s) = mk (algebraMap R A a) s

{R : Type u}
[CommSemiring R]
{S : Submonoid R}
{A : Type u_2}
[Semiring A]
[Algebra R A]
(a : R)
(s : ↥S)

(algebraMap (Localization S) (LocalizedModule S A)) (Localization.mk a s) = LocalizedModule.mk ((algebraMap R A) a) s


theorem image_sigmaMk_preimage_sigmaMap_subset {β : ι' → Type*} (f : ι → ι')
    (g : ∀ i, α i → β (f i)) (i : ι) (s : Set (β (f i))) :
    Sigma.mk i '' (g i ⁻¹' s) ⊆ Sigma.map f g ⁻¹' (Sigma.mk (f i) '' s)

{ι : Type u_1}
{ι' : Type u_2}
{α : ι → Type u_3}
{β : ι' → Type u_5}
(f : ι → ι')
(g : (i : ι) → α i → β (f i))
(i : ι)
(s : Set (β (f i)))


@[deprecated forall_mem_image (since := "2024-02-21")]
theorem mem_image_elim {f : α → β} {s : Set α} {C : β → Prop} (h : ∀ x : α, x ∈ s → C (f x)) :
    ∀ {y : β}, y ∈ f '' s → C y

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{s : Set α}
{C : β → Prop}
(h : ∀ x ∈ s, C (f x))
{y : β}


theorem sub_one_add_one_eq_of_pos : ∀ {n}, 0 < n → (n - 1) + 1 = n


@[simp] lemma prob_compl_eq_one_iff₀ (hs : NullMeasurableSet s μ) : μ sᶜ = 1 ↔ μ s = 0

(hs : MeasureTheory.NullMeasurableSet s μ)


@[trans]
theorem IsBigO.trans_isLittleO {f : α → E} {g : α → F'} {k : α → G} (hfg : f =O[l] g)
    (hgk : g =o[l] k) : f =o[l] k

{α : Type u_1}
{E : Type u_3}
{G : Type u_5}
{F' : Type u_7}
[Norm E]
[Norm G]
[SeminormedAddCommGroup F']
{l : Filter α}
{f : α → E}
{g : α → F'}
{k : α → G}
(hfg : f =O[l] g)
(hgk : g =o[l] k)


theorem empty_of_count_eq_zero [MeasurableSingletonClass α] (hsc : count s = 0) : s = ∅

(hsc : MeasureTheory.Measure.count s = 0)


lemma Exact.isZero_X₂ (hS : S.Exact) (hf : S.f = 0) (hg : S.g = 0) : IsZero S.X₂

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{S : CategoryTheory.ShortComplex C}
(hS : S.Exact)
(hf : S.f = 0)
(hg : S.g = 0)


@[reassoc (attr := simp)]
lemma ι_totalDesc (i₁ : I₁) (i₂ : I₂) (hi : ComplexShape.π c₁ c₂ c₁₂ (i₁, i₂) = i₁₂) :
    K.ιTotal c₁₂ i₁ i₂ i₁₂ hi ≫ K.totalDesc f = f i₁ i₂ hi

(f : (i₁ : I₁) → (i₂ : I₂) → c₁.π c₂ c₁₂ (i₁, i₂) = i₁₂ → ((K.X i₁).X i₂ ⟶ A))


theorem div_eq_one_iff {a b : ℝ≥0∞} (hb₀ : b ≠ 0) (hb₁ : b ≠ ∞) : a / b = 1 ↔ a = b

{a b : ENNReal}
(hb₀ : b ≠ 0)
(hb₁ : b ≠ ⊤)


theorem mul_inv_of_unit {n : ℕ} (a : ZMod n) (h : IsUnit a) : a * a⁻¹ = 1


theorem Char.le_antisymm {x y : Char} (h1 : x ≤ y) (h2 : y ≤ x) : x = y


theorem isPrime_iff {I : Ideal α} : IsPrime I ↔ I ≠ ⊤ ∧ ∀ {x y : α}, x * y ∈ I → x ∈ I ∨ y ∈ I

I.IsPrime ↔ I ≠ ⊤ ∧ ∀ {x y : α}, x * y ∈ I → x ∈ I ∨ y ∈ I


theorem Matrix.toBilin'_apply (M : Matrix n n R₂) (x y : n → R₂) :
    Matrix.toBilin' M x y = ∑ i, ∑ j, x i * M i j * y j

{R₂ : Type u_5}
[CommSemiring R₂]
{n : Type u_11}
[Fintype n]
[DecidableEq n]
(M : Matrix n n R₂)
(x y : n → R₂)

((Matrix.toBilin' M) x) y = ∑ i : n, ∑ j : n, x i * M i j * y j


@[to_additive (attr := simp)]
theorem measure_inv (μ : Measure G) [IsInvInvariant μ] (A : Set G) : μ A⁻¹ = μ A

{G : Type u_2}
[MeasurableSpace G]
[InvolutiveNeg G]
[MeasurableNeg G]
(μ : MeasureTheory.Measure G)
[μ.IsNegInvariant]
(A : Set G)


@[simps]
instance right (X Y : C) [MonoidalCoherence X Y] :
    MonoidalCoherence (X ⊗ 𝟙_ C) Y

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


@[simp]
theorem lanLiftLeftLift_unit (f : b ⟶ a) (g : c ⟶ a) [HasLeftKanLift f g] :
    (lanLiftLeftLift f g).unit = lanLiftUnit f g

(CategoryTheory.Bicategory.lanLiftLeftLift f g).unit = CategoryTheory.Bicategory.lanLiftUnit f g


@[simp]
theorem cmp_eq_gt_iff : cmp x y = Ordering.gt ↔ y < x

{α : Type u_1}
[LinearOrder α]
(x y : α)


theorem chebyshev_T_eq_dickson_one_one [Invertible (2 : R)] (n : ℕ) :
    Chebyshev.T R n = C (⅟ 2) * (dickson 1 1 n).comp (2 * X)

(R : Type u_1)
[CommRing R]
[Invertible 2]
(n : ℕ)

Polynomial.Chebyshev.T R ↑n = Polynomial.C ⅟2 * (Polynomial.dickson 1 1 n).comp (2 * Polynomial.X)


@[simp]
theorem mk_coe (f : α →ₙ+* β) (h₁ h₂ h₃) : NonUnitalRingHom.mk (MulHom.mk f h₁) h₂ h₃ = f

(h₁ : ∀ (x y : α), f (x * y) = f x * f y)

(h₂ : { toFun := ⇑f, map_mul' := h₁ }.toFun 0 = 0)

(h₃ :
  ∀ (x y : α),
    { toFun := ⇑f, map_mul' := h₁ }.toFun (x + y) =
      { toFun := ⇑f, map_mul' := h₁ }.toFun x + { toFun := ⇑f, map_mul' := h₁ }.toFun y)

{ toFun := ⇑f, map_mul' := h₁, map_zero' := h₂, map_add' := h₃ } = f


theorem ContinuousLinearMap.contMDiffOn (L : E →L[𝕜] F) {s} : ContMDiffOn 𝓘(𝕜, E) 𝓘(𝕜, F) n L s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_8}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}
(L : E →L[𝕜] F)
{s : Set E}


@[simp]
theorem sup'_lt_iff : s.sup' H f < a ↔ ∀ i ∈ s, f i < a

{α : Type u_2}
{ι : Type u_5}
[LinearOrder α]
{s : Finset ι}
(H : s.Nonempty)
{f : ι → α}
{a : α}


lemma nonLindelof_univ (X : Type*) [TopologicalSpace X] [NonLindelofSpace X] :
    ¬IsLindelof (univ : Set X)

(X : Type u_2)
[TopologicalSpace X]
[NonLindelofSpace X]


theorem ofSubtype_subtypePerm {f : Perm α} (h₁ : ∀ x, p x ↔ p (f x)) (h₂ : ∀ x, f x ≠ x → p x) :
    ofSubtype (subtypePerm f h₁) = f

{α : Type u}
{p : α → Prop}
[DecidablePred p]
{f : Equiv.Perm α}
(h₁ : ∀ (x : α), p x ↔ p (f x))
(h₂ : ∀ (x : α), f x ≠ x → p x)

Equiv.Perm.ofSubtype (f.subtypePerm h₁) = f


lemma not_mem_uIcc_of_gt (ha : a < c) (hb : b < c) : c ∉ [[a, b]]

{α : Type u_1}
[LinearOrder α]
{a b c : α}
(ha : a < c)
(hb : b < c)


theorem mem_image {f : PSet.{u} → PSet.{u}} (H : ∀ x y, Equiv x y → Equiv (f x) (f y)) :
    ∀ {x y : PSet.{u}}, y ∈ image f x ↔ ∃ z ∈ x, Equiv y (f z)

(H : ∀ (x y : PSet), x.Equiv y → (f x).Equiv (f y))

y ∈ PSet.image f x ↔ ∃ z ∈ x, y.Equiv (f z)


theorem le_opNorm_mul_pow_card_of_le {b : ℝ} (hm : ‖m‖ ≤ b) :
    ‖f m‖ ≤ ‖f‖ * b ^ Fintype.card ι

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


@[simp]
theorem variance_zero (μ : Measure Ω) : variance 0 μ = 0

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


@[simp]
theorem nnnorm_zero : ‖(0 : Lp E p μ)‖₊ = 0

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


@[reassoc]
theorem whisker_exchange {W X Y Z : C} (f : W ⟶ X) (g : Y ⟶ Z) :
    W ◁ g ≫ f ▷ Z = f ▷ Y ≫ X ◁ g

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.whiskerLeft W g)
    (CategoryTheory.MonoidalCategory.whiskerRight f Z) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.whiskerRight f Y)
    (CategoryTheory.MonoidalCategory.whiskerLeft X g)


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

SemilatSupCat.dual.obj X = SemilatInfCat.of X.Xᵒᵈ


lemma LinearMap.toMatrix_prodMap [DecidableEq n] [DecidableEq m] [DecidableEq (n ⊕ m)]
    (φ₁ : Module.End R M₁) (φ₂ : Module.End R M₂) :
    toMatrix (v₁.prod v₂) (v₁.prod v₂) (φ₁.prodMap φ₂) =
      Matrix.fromBlocks (toMatrix v₁ v₁ φ₁) 0 0 (toMatrix v₂ v₂ φ₂)

{R : Type u_1}
[CommSemiring R]
{m : Type u_3}
{n : Type u_4}
[Fintype n]
[Fintype m]
{M₁ : Type u_5}
{M₂ : Type u_6}
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[Module R M₁]
[Module R M₂]
(v₁ : Basis n R M₁)
(v₂ : Basis m R M₂)
[DecidableEq n]
[DecidableEq m]
[DecidableEq (n ⊕ m)]
(φ₁ : Module.End R M₁)
(φ₂ : Module.End R M₂)

(LinearMap.toMatrix (v₁.prod v₂) (v₁.prod v₂)) (LinearMap.prodMap φ₁ φ₂) =
  Matrix.fromBlocks ((LinearMap.toMatrix v₁ v₁) φ₁) 0 0 ((LinearMap.toMatrix v₂ v₂) φ₂)


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

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

⇑(MeasurableEquiv.piMeasurableEquivTProd hnd h) = List.TProd.mk l


theorem hasFiniteIntegral_def {_ : MeasurableSpace α} (f : α → β) (μ : Measure α) :
    HasFiniteIntegral f μ ↔ ((∫⁻ a, ‖f a‖₊ ∂μ) < ∞)

{α : Type u_1}
{β : Type u_2}
[NormedAddCommGroup β]

∀ {x : MeasurableSpace α} (f : α → β) (μ : MeasureTheory.Measure α),
  MeasureTheory.HasFiniteIntegral f μ ↔ ∫⁻ (a : α), ↑‖f a‖₊ ∂μ < ⊤


@[simp, norm_cast]
theorem val_smul (r : R) (x : p) : (↑(r • x) : M) = r • (x : M)

{R : Type u}
{M : Type v}
[SMul R M]
{p : SubMulAction R M}
(r : R)
(x : ↥p)


theorem gcd_isUnit_iff (x y : R) : IsUnit (gcd x y) ↔ IsCoprime x y

{R : Type u}
[CommRing R]
[IsDomain R]
[IsBezout R]
[GCDMonoid R]
(x y : R)


/-- The functor `Arrow (Arrow C) ⥤ Square C` which sends
a morphism `Arrow.mk f ⟶ Arrow.mk g` to the commutative square
with `f` on the top side and `g` on the bottom side. -/
@[simps!]
def fromArrowArrowFunctor' : Arrow (Arrow C) ⥤ Square C

(f : CategoryTheory.Arrow (CategoryTheory.Arrow C))

(CategoryTheory.Square.fromArrowArrowFunctor'.obj f).X₃ = f.right.left


theorem _root_.Algebra.adjoin_range_eq_range_aeval :
    Algebra.adjoin R (Set.range f) = (MvPolynomial.aeval f).range

(R : Type u)
{S₁ : Type v}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₁]
[Algebra R S₁]
(f : σ → S₁)


@[simp]
theorem indicator_apply [DecidableEq ι] : indicator s f i = if hi : i ∈ s then f i hi else 0

{ι : Type u_1}
{α : Type u_2}
[Zero α]
(s : Finset ι)
(f : (i : ι) → i ∈ s → α)
(i : ι)
[DecidableEq ι]

(Finsupp.indicator s f) i = if hi : i ∈ s then f i hi else 0


theorem disjoint_compl_left_iff_subset : Disjoint sᶜ t ↔ t ⊆ s


/--
Proposition I.2.3 + I.2.6 of [iversen]
A finite-type `R`-algebra `S` is (formally) unramified iff there exists a `t : S ⊗[R] S` satisfying
1. `t` annihilates every `1 ⊗ s - s ⊗ 1`.
2. the image of `t` is `1` under the map `S ⊗[R] S → S`.
-/
theorem iff_exists_tensorProduct [EssFiniteType R S] :
    FormallyUnramified R S ↔ ∃ t : S ⊗[R] S,
      (∀ s, ((1 : S) ⊗ₜ[R] s - s ⊗ₜ[R] (1 : S)) * t = 0) ∧ TensorProduct.lmul' R t = 1

{R S : Type u_2}
[CommRing R]
[CommRing S]
[Algebra R S]
[Algebra.EssFiniteType R S]

Algebra.FormallyUnramified R S ↔
  ∃ t, (∀ (s : S), (1 ⊗ₜ[R] s - s ⊗ₜ[R] 1) * t = 0) ∧ (Algebra.TensorProduct.lmul' R) t = 1


theorem biInf_congr' {p : ι → Prop} {f g : (i : ι) → p i → α}
    (h : ∀ i (hi : p i), f i hi = g i hi) :
    ⨅ i, ⨅ (hi : p i), f i hi = ⨅ i, ⨅ (hi : p i), g i hi

(h : ∀ (i : ι) (hi : p i), f i hi = g i hi)


@[simp] theorem count_cons_of_ne (h : a ≠ b) (l : List α) : count a (b :: l) = count a l

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


/-- The counit isomorphism of the equivalence of categories `WhiskeringLeftEquivalence W D`. -/
@[simps!]
def counitIso : inverse W D ⋙ functor W D ≅ 𝟭 (W.FunctorsInverting D)

{C : Type uC}
[CategoryTheory.Category.{uC', uC} C]
(W : CategoryTheory.MorphismProperty C)
(D : Type uD)
[CategoryTheory.Category.{uD', uD} D]

(CategoryTheory.Localization.Construction.WhiskeringLeftEquivalence.counitIso W D).hom = CategoryTheory.eqToHom ⋯


theorem eq_div_of_mul_eq_left {a b c : R} (hb : b ≠ 0) (h : a * b = c) : a = c / b

{R : Type u}
[EuclideanDomain R]
{a b c : R}
(hb : b ≠ 0)
(h : a * b = c)


@[to_additive]
theorem prod_hom₂ [CommMonoid β] [CommMonoid γ] (s : Multiset ι) (f : α → β → γ)
    (hf : ∀ a b c d, f (a * b) (c * d) = f a c * f b d) (hf' : f 1 1 = 1) (f₁ : ι → α)
    (f₂ : ι → β) : (s.map fun i => f (f₁ i) (f₂ i)).prod = f (s.map f₁).prod (s.map f₂).prod

(f : α → β → γ)

(hf : ∀ (a b : α) (c d : β), f (a + b) (c + d) = f a c + f b d)

(f₁ : ι → α)

(f₂ : ι → β)

(Multiset.map (fun i => f (f₁ i) (f₂ i)) s).sum = f (Multiset.map f₁ s).sum (Multiset.map f₂ s).sum


theorem natTrailingDegree_X_le : (X : R[X]).natTrailingDegree ≤ 1


@[to_additive]
theorem isUnit_iff : IsUnit f ↔ ∃ a, f = pure a ∧ IsUnit a

{α : Type u_2}
[DivisionMonoid α]
{f : Filter α}


theorem Balanced.smul_mem_mono [SMulCommClass 𝕝 𝕜 E] (hs : Balanced 𝕝 s) {a : 𝕜} {b : 𝕝}
    (ha : a • x ∈ s) (hba : ‖b‖ ≤ ‖a‖) : b • x ∈ s

{𝕜 : Type u_1}
{𝕝 : Type u_2}
{E : Type u_3}
[NormedField 𝕜]
[NormedRing 𝕝]
[NormedSpace 𝕜 𝕝]
[AddCommGroup E]
[Module 𝕜 E]
[SMulWithZero 𝕝 E]
[IsScalarTower 𝕜 𝕝 E]
{s : Set E}
{x : E}
[SMulCommClass 𝕝 𝕜 E]
(hs : Balanced 𝕝 s)
{a : 𝕜}
{b : 𝕝}
(ha : a • x ∈ s)
(hba : ‖b‖ ≤ ‖a‖)


/-- Every non-zero prime ideal in a unique factorization domain contains a prime element. -/
theorem Ideal.IsPrime.exists_mem_prime_of_ne_bot {R : Type*} [CommSemiring R] [IsDomain R]
    [UniqueFactorizationMonoid R] {I : Ideal R} (hI₂ : I.IsPrime) (hI : I ≠ ⊥) :
    ∃ x ∈ I, Prime x

{R : Type u_2}
[CommSemiring R]
[IsDomain R]
[UniqueFactorizationMonoid R]
{I : Ideal R}
(hI₂ : I.IsPrime)
(hI : I ≠ ⊥)


theorem map_nonunit (χ : MulChar R R') {a : R} (ha : ¬IsUnit a) : χ a = 0

{R : Type u_1}
[CommMonoid R]
{R' : Type u_2}
[CommMonoidWithZero R']
(χ : MulChar R R')
{a : R}
(ha : ¬IsUnit a)


theorem mapsTo_omegaLimit' {α' β' : Type*} [TopologicalSpace β'] {f : Filter τ} {ϕ : τ → α → β}
    {ϕ' : τ → α' → β'} {ga : α → α'} {s' : Set α'} (hs : MapsTo ga s s') {gb : β → β'}
    (hg : ∀ᶠ t in f, EqOn (gb ∘ ϕ t) (ϕ' t ∘ ga) s) (hgc : Continuous gb) :
    MapsTo gb (ω f ϕ s) (ω f ϕ' s')

{ϕ : τ → α → β}

{ϕ' : τ → α' → β'}

(hg : ∀ᶠ (t : τ) in f, Set.EqOn (gb ∘ ϕ t) (ϕ' t ∘ ga) s)

Set.MapsTo gb (omegaLimit f ϕ s) (omegaLimit f ϕ' s')


theorem homEquiv_apply_eq {A : C} {B : D} (f : F.obj A ⟶ B) (g : A ⟶ G.obj B) :
    adj.homEquiv A B f = g ↔ f = (adj.homEquiv A B).symm g

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F : CategoryTheory.Functor C D}
{G : CategoryTheory.Functor D C}
(adj : F ⊣ G)
{A : C}
{B : D}
(f : F.obj A ⟶ B)
(g : A ⟶ G.obj B)

(adj.homEquiv A B) f = g ↔ f = (adj.homEquiv A B).symm g


/-- The derivative of the chart at a base point is the chart of the tangent bundle, composed with
the identification between the tangent bundle of the model space and the product space. -/
theorem tangentMap_chart {p q : TangentBundle I M} (h : q.1 ∈ (chartAt H p.1).source) :
    tangentMap I I (chartAt H p.1) q =
      (TotalSpace.toProd _ _).symm
        ((chartAt (ModelProd H E) p : TangentBundle I M → ModelProd H E) q)

(h : q.proj ∈ (chartAt H p.proj).source)

tangentMap I I (↑(chartAt H p.proj)) q = (Bundle.TotalSpace.toProd H E).symm (↑(chartAt (ModelProd H E) p) q)


@[simp]
theorem range_eq (e : r ≃r s) : Set.range e = Set.univ

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
(e : r ≃r s)


theorem eq_of_eqOn_stop {f g : R →+* S} (h : Set.EqOn f g (⊤ : Subsemiring R)) : f = g

{R : Type u}
{S : Type v}
[NonAssocSemiring R]
[NonAssocSemiring S]
{f g : R →+* S}
(h : Set.EqOn ⇑f ⇑g ↑⊤)


theorem maximalIdeal_le_jacobson (I : Ideal R) :
    LocalRing.maximalIdeal R ≤ I.jacobson

{R : Type u_1}
[CommRing R]
[LocalRing R]
(I : Ideal R)


@[simp]
theorem singleton_unop (x : αᵒᵖ) : ({x} : Set αᵒᵖ).unop = {unop x}


@[to_additive (attr := simp)]
theorem closure_closure_coe_preimage {s : Set M} :
    closure ((Subtype.val : closure s → M) ⁻¹' s) = ⊤

AddSubsemigroup.closure (Subtype.val ⁻¹' s) = ⊤


@[norm_cast]
theorem nat_floor_coe [OrderedSemiring α] [FloorSemiring α] (a : { r : α // 0 ≤ r }) :
    ⌊(a : α)⌋₊ = ⌊a⌋₊

{α : Type u_1}
[OrderedSemiring α]
[FloorSemiring α]
(a : { r // 0 ≤ r })

⌊↑a⌋₊ = ⌊a⌋₊


theorem imp_semanticallyEquivalent_not_sup : T.SemanticallyEquivalent (φ.imp ψ) (φ.not ⊔ ψ)

{L : FirstOrder.Language}
{T : L.Theory}
{α : Type w}
(φ ψ : L.Formula α)


theorem isLittleO_iff_nat_mul_le_aux (h₀ : (∀ x, 0 ≤ ‖f x‖) ∨ ∀ x, 0 ≤ ‖g x‖) :
    f =o[l] g ↔ ∀ n : ℕ, ∀ᶠ x in l, ↑n * ‖f x‖ ≤ ‖g x‖

(h₀ : (∀ (x : α), 0 ≤ ‖f x‖) ∨ ∀ (x : α), 0 ≤ ‖g x‖)

f =o[l] g ↔ ∀ (n : ℕ), ∀ᶠ (x : α) in l, ↑n * ‖f x‖ ≤ ‖g x‖


@[simp, norm_cast]
theorem ofReal_tanh (x : ℝ) : (Real.tanh x : ℂ) = tanh x


theorem coeFn_sup (f g : Lp E p μ) : ⇑(f ⊔ g) =ᵐ[μ] ⇑f ⊔ ⇑g

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

↑↑(f ⊔ g) =ᵐ[μ] ↑↑f ⊔ ↑↑g


@[simp]
lemma KaehlerDifferential.mvPolynomialBasis_repr_apply (σ) (x) (i) :
    (mvPolynomialBasis R σ).repr (D _ _ x) i = MvPolynomial.pderiv i x

(R : Type u)
[CommRing R]
(σ : Type u_1)
(x : MvPolynomial σ R)
(i : σ)

((KaehlerDifferential.mvPolynomialBasis R σ).repr ((KaehlerDifferential.D R (MvPolynomial σ R)) x)) i =
  (MvPolynomial.pderiv i) x


protected theorem Set.OrdConnected.IicExtend {s : Set (Iic b)} (hs : s.OrdConnected) :
    {x | IicExtend (· ∈ s) x}.OrdConnected

{α : Type u_1}
[LinearOrder α]
{b : α}
{s : Set ↑(Set.Iic b)}
(hs : s.OrdConnected)

{x | Set.IicExtend (fun x => x ∈ s) x}.OrdConnected


/-- An ordered additive commutative monoid is called `Archimedean` if for any two elements `x`, `y`
such that `0 < y`, there exists a natural number `n` such that `x ≤ n • y`. -/
class Archimedean (α) [OrderedAddCommMonoid α] : Prop where
  /-- For any two elements `x`, `y` such that `0 < y`, there exists a natural number `n`
  such that `x ≤ n • y`. -/
  arch : ∀ (x : α) {y : α}, 0 < y → ∃ n : ℕ, x ≤ n • y

{α : Type u_2}
[OrderedAddCommMonoid α]
[self : Archimedean α]
(x : α)
{y : α}


lemma coeff_mem_coeffs {p : MvPolynomial σ R} (m : σ →₀ ℕ)
    (h : p.coeff m ≠ 0) : p.coeff m ∈ p.coeffs

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
{p : MvPolynomial σ R}
(m : σ →₀ ℕ)
(h : MvPolynomial.coeff m p ≠ 0)


theorem trans_target : (e.trans e').target = e'.target ∩ e'.symm ⁻¹' 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.target


/-- If a set has a thickening with finite measure, then the measures of its `r`-thickenings
converge to the measure of its closure as `r > 0` tends to `0`. -/
theorem tendsto_measure_thickening {μ : Measure α} {s : Set α}
    (hs : ∃ R > 0, μ (thickening R s) ≠ ∞) :
    Tendsto (fun r => μ (thickening r s)) (𝓝[>] 0) (𝓝 (μ (closure s)))

(hs : ∃ R > 0, μ (Metric.thickening R s) ≠ ⊤)

Filter.Tendsto (fun r => μ (Metric.thickening r s)) (𝓝[>] 0) (𝓝 (μ (closure s)))


theorem mk_one (x : K[X]) : RatFunc.mk x 1 = algebraMap _ _ x

{K : Type u}
[CommRing K]
[IsDomain K]
(x : K[X])

RatFunc.mk x 1 = (algebraMap K[X] (RatFunc K)) x


@[simp]
protected theorem min_eq_bot [OrderBot α] {s : Finset α} : s.min = ⊥ ↔ ⊥ ∈ s

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