/-- Vertical composition of strong natural transformations. -/
@[simps!]
def vcomp (η : StrongOplaxNatTrans F G) (θ : StrongOplaxNatTrans G H) : StrongOplaxNatTrans F H

{F G H : CategoryTheory.OplaxFunctor B C}

(η : CategoryTheory.StrongOplaxNatTrans F G)

(θ : CategoryTheory.StrongOplaxNatTrans G H)

∀ {a b : B} (f : a ⟶ b),
  ((η.vcomp θ).naturality f).inv =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.associator (η.app a) (θ.app a) (H.map f)).hom
      (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerLeft (η.app a) (θ.naturality f).inv)
        (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.associator (η.app a) (G.map f) (θ.app b)).inv
          (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight (η.naturality f).inv (θ.app b))
            (CategoryTheory.Bicategory.associator (F.map f) (η.app b) (θ.app b)).hom)))


/-- Formulation of reflection formula tailored to functional equations of L-functions of even
Dirichlet characters (including Riemann zeta). -/
lemma inv_Gammaℝ_one_sub {s : ℂ} (hs : ∀ (n : ℕ), s ≠ -n) :
    (Gammaℝ (1 - s))⁻¹ = Gammaℂ s * cos (π * s / 2) * (Gammaℝ s)⁻¹

(1 - s).Gammaℝ⁻¹ = s.Gammaℂ * Complex.cos (↑π * s / 2) * s.Gammaℝ⁻¹


/-- Any power of an `M`-regular element is `M`-regular. -/
theorem pow (n : ℕ) (ra : IsSMulRegular M a) : IsSMulRegular M (a ^ n)

{R : Type u_1}
{M : Type u_3}
{a : R}
[Monoid R]
[MulAction R M]
(n : ℕ)
(ra : IsSMulRegular M a)


/-- **Fermat's Theorem**: the derivative of a function at a local minimum equals zero. -/
theorem IsLocalMin.fderiv_eq_zero (h : IsLocalMin f a) : fderiv ℝ f a = 0

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{a : E}
(h : IsLocalMin f a)


@[to_additive (attr := simp)]
theorem toMonoidHom_eq_coe (f : α →*o β) : f.toMonoidHom = f

{α : Type u_2}
{β : Type u_3}
{hα : OrderedCommMonoid α}
{hβ : OrderedCommMonoid β}
(f : α →*o β)


theorem contDiff_pi : ContDiff 𝕜 n Φ ↔ ∀ i, ContDiff 𝕜 n fun x => Φ x i

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{n : ℕ∞}
{ι : Type u_3}
[Fintype ι]
{F' : ι → Type u_5}
[(i : ι) → NormedAddCommGroup (F' i)]
[(i : ι) → NormedSpace 𝕜 (F' i)]
{Φ : E → (i : ι) → F' i}

ContDiff 𝕜 n Φ ↔ ∀ (i : ι), ContDiff 𝕜 n fun x => Φ x i


theorem IsOpen.lowerSemicontinuousOn_indicator (hs : IsOpen s) (hy : 0 ≤ y) :
    LowerSemicontinuousOn (indicator s fun _x => y) t

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[Preorder β]
{s t : Set α}
{y : β}
[Zero β]
(hs : IsOpen s)
(hy : 0 ≤ y)

LowerSemicontinuousOn (s.indicator fun _x => y) t


/-- An angle in a non-degenerate right-angled triangle is positive, version subtracting
vectors. -/
theorem angle_sub_pos_of_inner_eq_zero {x y : V} (h : ⟪x, y⟫ = 0) (h0 : x = 0 ∨ y ≠ 0) :
    0 < angle x (x - y)

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

0 < InnerProductGeometry.angle x (x - y)


theorem isDomain_iff_prime (I : Ideal R) : IsDomain (R ⧸ I) ↔ I.IsPrime


theorem traverse_eq_map_id' (f : β → γ) :
    traverse (m := Id) (pure ∘ f) = pure ∘ (map f : t β → t γ)

{t : Type u → Type u}
[Traversable t]
[LawfulTraversable t]
{β γ : Type u}
(f : β → γ)

traverse (pure ∘ f) = pure ∘ Functor.map f


/-- See also `leOnePart_eq_inv`. -/
@[to_additive "See also `negPart_eq_neg`."]
lemma leOnePart_eq_inv' : a⁻ᵐ = a⁻¹ ↔ 1 ≤ a⁻¹

{α : Type u_1}
[Lattice α]
[AddGroup α]
{a : α}


@[to_additive]
theorem singleton_div_singleton (a b : α) : ({a} : Finset α) / {b} = {a / b}

{α : Type u_2}
[DecidableEq α]
[Div α]
(a b : α)


/-- The distance between a point and its orthogonal projection is
nonzero if it does not lie in the subspace. -/
theorem dist_orthogonalProjection_ne_zero_of_not_mem {s : AffineSubspace ℝ P} [Nonempty s]
    [HasOrthogonalProjection s.direction] {p : P} (hp : p ∉ s) :
    dist p (orthogonalProjection s p) ≠ 0

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{s : AffineSubspace ℝ P}
[Nonempty ↥s]
[HasOrthogonalProjection s.direction]
{p : P}
(hp : p ∉ s)

dist p ↑((EuclideanGeometry.orthogonalProjection s) p) ≠ 0


lemma integral_compProd [SFinite μ] [IsSFiniteKernel κ] {E : Type*}
    [NormedAddCommGroup E] [NormedSpace ℝ E]
    {f : α × β → E} (hf : Integrable f (μ ⊗ₘ κ)) :
    ∫ x, f x ∂(μ ⊗ₘ κ) = ∫ a, ∫ b, f (a, b) ∂(κ a) ∂μ

(hf : MeasureTheory.Integrable f (μ ⊗ₘ κ))

∫ (x : α × β), f x ∂μ ⊗ₘ κ = ∫ (a : α), ∫ (b : β), f (a, b) ∂κ a ∂μ


@[simp]
lemma opensRange_ι : U.ι.opensRange = U

{X : AlgebraicGeometry.Scheme}
(U : X.Opens)

AlgebraicGeometry.Scheme.Hom.opensRange U.ι = U


/-- A variant of `Cardinal.mk_set` expressed in terms of a `Set` instead of a `Type`. -/
@[simp]
theorem mk_powerset {α : Type u} (s : Set α) : #(↥(𝒫 s)) = 2 ^ #(↥s)


theorem Wbtw.trans_left_right {w x y z : P} (h₁ : Wbtw R w y z) (h₂ : Wbtw R w x y) :
    Wbtw R x y z

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


private theorem glueDist_self (Φ : Z → X) (Ψ : Z → Y) (ε : ℝ) : ∀ x, glueDist Φ Ψ ε x x = 0

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


/-- A nontrivial torsion-free group is not torsion. -/
@[to_additive AddMonoid.IsTorsionFree.not_torsion
      "A nontrivial torsion-free additive group is not torsion."]
theorem IsTorsionFree.not_torsion [hN : Nontrivial G] : IsTorsionFree G → ¬IsTorsion G

{G : Type u_1}
[AddGroup G]
[hN : Nontrivial G]

AddMonoid.IsTorsionFree G → ¬AddMonoid.IsTorsion G


/-- The Gromov-Hausdorff distance between two spaces is bounded by the Hausdorff distance
of isometric copies of the spaces, in any metric space. -/
theorem ghDist_le_hausdorffDist {X : Type u} [MetricSpace X] [CompactSpace X] [Nonempty X]
    {Y : Type v} [MetricSpace Y] [CompactSpace Y] [Nonempty Y] {γ : Type w} [MetricSpace γ]
    {Φ : X → γ} {Ψ : Y → γ} (ha : Isometry Φ) (hb : Isometry Ψ) :
    ghDist X Y ≤ hausdorffDist (range Φ) (range Ψ)

GromovHausdorff.ghDist X Y ≤ Metric.hausdorffDist (Set.range Φ) (Set.range Ψ)


theorem Isometry.mapsTo_perpBisector {f : P → P'} (h : Isometry f) (p₁ p₂ : P) :
    MapsTo f (perpBisector p₁ p₂) (perpBisector (f p₁) (f p₂))

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{V' : Type u_3}
{P' : Type u_4}
[NormedAddCommGroup V']
[InnerProductSpace ℝ V']
[MetricSpace P']
[NormedAddTorsor V' P']
{f : P → P'}
(h : Isometry f)
(p₁ p₂ : P)

Set.MapsTo f ↑(AffineSubspace.perpBisector p₁ p₂) ↑(AffineSubspace.perpBisector (f p₁) (f p₂))


@[reassoc]
lemma mapComp_id_left_inv (f : a ⟶ b) : (F.mapComp (𝟙 a) f).inv =
    (F.mapId a).hom ▷ F.map f ≫ (λ_ (F.map f)).hom ≫ F.map₂ (λ_ f).inv

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
(F : CategoryTheory.Pseudofunctor B C)
{a b : B}
(f : a ⟶ b)

(F.mapComp (CategoryTheory.CategoryStruct.id a) f).inv =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight (F.mapId a).hom (F.map f))
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.leftUnitor (F.map f)).hom
      (F.map₂ (CategoryTheory.Bicategory.leftUnitor f).inv))


/-- When `S₁.g` and `S₂.g` are zero and we have chosen colimit cokernel coforks `c₁` and `c₂`
for `S₁.f` and `S₂.f` respectively, the action on right homology of a morphism `φ : S₁ ⟶ S₂` of
short complexes is given by the unique morphism `f : c₁.pt ⟶ c₂.pt` such that
`φ.τ₂ ≫ c₂.π = c₁.π ≫ f`. -/
@[simps]
def ofIsColimitCokernelCofork (φ : S₁ ⟶ S₂)
    (hg₁ : S₁.g = 0) (c₁ : CokernelCofork S₁.f) (hc₁ : IsColimit c₁)
    (hg₂ : S₂.g = 0) (c₂ : CokernelCofork S₂.f) (hc₂ : IsColimit c₂) (f : c₁.pt ⟶ c₂.pt)
    (comm : φ.τ₂ ≫ c₂.π = c₁.π ≫ f) :
    RightHomologyMapData φ (RightHomologyData.ofIsColimitCokernelCofork S₁ hg₁ c₁ hc₁)
      (RightHomologyData.ofIsColimitCokernelCofork S₂ hg₂ c₂ hc₂)

(c₁ : CategoryTheory.Limits.CokernelCofork S₁.f)

(hc₁ : CategoryTheory.Limits.IsColimit c₁)

(c₂ : CategoryTheory.Limits.CokernelCofork S₂.f)

(hc₂ : CategoryTheory.Limits.IsColimit c₂)

(comm :
  CategoryTheory.CategoryStruct.comp φ.τ₂ (CategoryTheory.Limits.Cofork.π c₂) =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.Cofork.π c₁) f)

(CategoryTheory.ShortComplex.RightHomologyMapData.ofIsColimitCokernelCofork φ hg₁ c₁ hc₁ hg₂ c₂ hc₂ f comm).φH = f


theorem enum_cons' (x : α) (xs : List α) :
    enum (x :: xs) = (0, x) :: (enum xs).map (Prod.map Nat.succ id)

(x :: xs).enum = (0, x) :: List.map (Prod.map Nat.succ id) xs.enum


theorem deterministic_apply' {f : α → β} (hf : Measurable f) (a : α) {s : Set β}
    (hs : MeasurableSet s) : deterministic f hf a s = s.indicator (fun _ => 1) (f a)

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{f : α → β}
(hf : Measurable f)
(a : α)
{s : Set β}
(hs : MeasurableSet s)

((ProbabilityTheory.Kernel.deterministic f hf) a) s = s.indicator (fun x => 1) (f a)


theorem mk_iUnion_le_lift {α : Type u} {ι : Type v} (f : ι → Set α) :
    lift.{v} #(⋃ i, f i) ≤ lift.{u} #ι * ⨆ i, lift.{v} #(f i)

Cardinal.lift.{v, u} (Cardinal.mk ↑(⋃ i, f i)) ≤
  Cardinal.lift.{u, v} (Cardinal.mk ι) * ⨆ i, Cardinal.lift.{v, u} (Cardinal.mk ↑(f i))


@[simp]
theorem iInter_true {s : True → Set α} : iInter s = s trivial


lemma negY_smul (P : Fin 3 → R) {u : R} : W'.negY (u • P) = u ^ 3 * W'.negY P

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
(P : Fin 3 → R)
{u : R}


@[simp]
theorem sigmaUncurry_zero [∀ i j, Zero (δ i j)] [DecidableEq ι] :
    sigmaUncurry (0 : Π₀ (i) (j), δ i j) = 0

{ι : Type u}
{α : ι → Type u_2}
{δ : (i : ι) → α i → Type v}
[(i : ι) → (j : α i) → Zero (δ i j)]
[DecidableEq ι]


@[simp]
theorem preimage_floor_singleton (m : ℤ) : (floor : α → ℤ) ⁻¹' {m} = Ico (m : α) (m + 1)

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(m : ℤ)

Int.floor ⁻¹' {m} = Set.Ico (↑m) (↑m + 1)


@[simp]
theorem map_top (f : A →ₐ[R] B) : (⊤ : Subalgebra R A).map f = f.range

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
(f : A →ₐ[R] B)


/-- `tprod_iSup_decode₂` specialized to the complete lattice of sets. -/
@[to_additive "`tsum_iSup_decode₂` specialized to the complete lattice of sets."]
theorem tprod_iUnion_decode₂ (m : Set α → M) (m0 : m ∅ = 1) (s : β → Set α) :
    ∏' i, m (⋃ b ∈ decode₂ β i, s b) = ∏' b, m (s b)

{M : Type u_1}
[CommMonoid M]
[TopologicalSpace M]
{α : Type u_3}
{β : Type u_4}
[Encodable β]
(m : Set α → M)
(m0 : m ∅ = 1)
(s : β → Set α)

∏' (i : ℕ), m (⋃ b ∈ Encodable.decode₂ β i, s b) = ∏' (b : β), m (s b)


/-- Let `P` be a prime ideal, `x ∈ P \ P²` and `x ∉ Q` for all prime ideals `Q ≠ P`.
Then `P` is generated by `x`. -/
theorem Ideal.eq_span_singleton_of_mem_of_not_mem_sq_of_not_mem_prime_ne {P : Ideal R}
    (hP : P.IsPrime) [IsDedekindDomain R] {x : R} (x_mem : x ∈ P) (hxP2 : x ∉ P ^ 2)
    (hxQ : ∀ Q : Ideal R, IsPrime Q → Q ≠ P → x ∉ Q) : P = Ideal.span {x}

(hxQ : ∀ (Q : Ideal R), Q.IsPrime → Q ≠ P → x ∉ Q)


theorem single_one_mul_apply [MulOneClass G] (f : MonoidAlgebra k G) (r : k) (x : G) :
    (single (1 : G) r * f) x = r * f x

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[MulOneClass G]
(f : MonoidAlgebra k G)
(r : k)
(x : G)

(MonoidAlgebra.single 1 r * f) x = r * f x


@[simp]
theorem toAdd_symm_eq : (@toAdd α).symm = ofAdd


@[to_additive]
theorem prod_range_add_div_prod_range {α : Type*} [CommGroup α] (f : ℕ → α) (n m : ℕ) :
    (∏ k ∈ range (n + m), f k) / ∏ k ∈ range n, f k = ∏ k ∈ Finset.range m, f (n + k)

{α : Type u_6}
[CommGroup α]
(f : ℕ → α)
(n m : ℕ)

(∏ k ∈ Finset.range (n + m), f k) / ∏ k ∈ Finset.range n, f k = ∏ k ∈ Finset.range m, f (n + k)


lemma finiteCoproduct.ι_jointly_surjective (R : finiteCoproduct X) :
    ∃ (a : α) (r : X a), R = finiteCoproduct.ι X a r

(R : ↑(LightProfinite.finiteCoproduct X).toTop)

∃ a r, R = (LightProfinite.finiteCoproduct.ι X a) r


@[simp]
theorem id_base (X : PresheafedSpace C) : (𝟙 X : X ⟶ X).base = 𝟙 (X : TopCat)

(X : AlgebraicGeometry.PresheafedSpace C)


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

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


@[simp]
theorem diag_list_sum [AddMonoid α] (l : List (Matrix n n α)) : diag l.sum = (l.map diag).sum

{n : Type u_3}
{α : Type v}
[AddMonoid α]
(l : List (Matrix n n α))

l.sum.diag = (List.map Matrix.diag l).sum


@[to_additive]
lemma not_mulDissociated_iff_exists_disjoint :
    ¬ MulDissociated s ↔
      ∃ t u : Finset α, ↑t ⊆ s ∧ ↑u ⊆ s ∧ Disjoint t u ∧ t ≠ u ∧ ∏ a in t, a = ∏ a in u, a

{α : Type u_1}
[AddCommGroup α]
{s : Set α}

¬AddDissociated s ↔ ∃ t u, ↑t ⊆ s ∧ ↑u ⊆ s ∧ Disjoint t u ∧ t ≠ u ∧ ∑ a ∈ t, a = ∑ a ∈ u, a


theorem coe_mem_source : ↑y ∈ e'.source ↔ b ∈ e'.baseSet

[TopologicalSpace (Bundle.TotalSpace F E)]

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

{ proj := b, snd := y } ∈ e'.source ↔ b ∈ e'.baseSet


theorem integrable_iff [NormedAddCommGroup γ] [BorelSpace γ] (h : IdentDistrib f g μ ν) :
    Integrable f μ ↔ Integrable g ν

(h : ProbabilityTheory.IdentDistrib f g μ ν)

MeasureTheory.Integrable f μ ↔ MeasureTheory.Integrable g ν


lemma predAbove_pred_of_lt (p i : Fin (n + 1)) (h : i < p) (hp := Fin.ne_zero_of_lt h)
    (hi := Fin.ne_last_of_lt h) : (pred p hp).predAbove i = castPred i hi

{n : ℕ}
(p i : Fin (n + 1))
(h : i < p)
(hp : p ≠ 0 := ⋯)
(hi : i ≠ Fin.last n := ⋯)


theorem forall_ge_iff {P : α → Prop} {x₀ : α} (hP : Monotone P) :
    (∀ x ≥ x₀, P x) ↔ P x₀

{α : Type u}
[Preorder α]
{P : α → Prop}
{x₀ : α}
(hP : Monotone P)


theorem condIndepSets_singleton_iff {μ : Measure Ω} [IsFiniteMeasure μ]
    {s t : Set Ω} (hs : MeasurableSet s) (ht : MeasurableSet t) :
    CondIndepSets m' hm' {s} {t} μ ↔ (μ⟦s ∩ t | m'⟧) =ᵐ[μ] (μ⟦s | m'⟧) * (μ⟦t | m'⟧)

{Ω : Type u_1}
(m' : MeasurableSpace Ω)
{mΩ : MeasurableSpace Ω}
[StandardBorelSpace Ω]
[Nonempty Ω]
(hm' : m' ≤ mΩ)
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsFiniteMeasure μ]
{s t : Set Ω}
(hs : MeasurableSet s)
(ht : MeasurableSet t)

ProbabilityTheory.CondIndepSets m' hm' {s} {t} μ ↔
  μ[(s ∩ t).indicator fun ω => 1|m'] =ᵐ[μ] μ[s.indicator fun ω => 1|m'] * μ[t.indicator fun ω => 1|m']


theorem divides_sq_eq_zero {x y} (h : x * x = d * y * y) : x = 0 ∧ y = 0

{d : ℕ}
[dnsq : Zsqrtd.Nonsquare d]
{x y : ℕ}
(h : x * x = d * y * y)


@[fun_prop]
theorem differentiableAt_inverse {x : R} (hx : IsUnit x) :
    DifferentiableAt 𝕜 (@Ring.inverse R _) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{R : Type u_6}
[NormedRing R]
[NormedAlgebra 𝕜 R]
[CompleteSpace R]
{x : R}
(hx : IsUnit x)


@[simp] lemma length_injective_iff : Injective (List.length : List α → ℕ) ↔ Subsingleton α

Function.Injective List.length ↔ Subsingleton α


theorem isPFilter : IsPFilter (F : Set P)

{P : Type u_1}
[Preorder P]
(F : Order.PFilter P)


@[to_additive]
theorem _root_.Semigroup.mem_center_iff {z : M} :
    z ∈ Set.center M ↔ ∀ g, g * z = z * g

z ∈ Set.addCenter M ↔ ∀ (g : M), g + z = z + g


theorem HasStrictFDerivAt.sinh (hf : HasStrictFDerivAt f f' x) :
    HasStrictFDerivAt (fun x => Real.sinh (f x)) (Real.cosh (f x) • f') x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{f' : E →L[ℝ] ℝ}
{x : E}
(hf : HasStrictFDerivAt f f' x)


@[to_additive]
theorem characteristic_iff_comap_eq : H.Characteristic ↔ ∀ ϕ : G ≃* G, H.comap ϕ.toMonoidHom = H

{G : Type u_1}
[AddGroup G]
{H : AddSubgroup G}

H.Characteristic ↔ ∀ (ϕ : G ≃+ G), AddSubgroup.comap ϕ.toAddMonoidHom H = H


theorem le_nth_count (hp : (setOf p).Infinite) (n : ℕ) : n ≤ nth p (count p n)

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


@[simp]
theorem updateRow_subsingleton [Subsingleton m] (A : Matrix m n R) (i : m) (b : n → R) :
    A.updateRow i b = (row (Fin 1) b).submatrix (Function.const m 0) id

{m : Type u_2}
{n : Type u_3}
{R : Type u_5}
[Subsingleton m]
(A : Matrix m n R)
(i : m)
(b : n → R)

A.updateRow i b = (Matrix.row (Fin 1) b).submatrix (Function.const m 0) id


@[to_additive]
theorem image_mulSingle_Ioc_left (i : ι) (a : α i) :
    Pi.mulSingle i '' Ioc a 1 = Ioc (Pi.mulSingle i a) 1

{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ι]
[(i : ι) → PartialOrder (α i)]
[(i : ι) → Zero (α i)]
(i : ι)
(a : α i)

Pi.single i '' Set.Ioc a 0 = Set.Ioc (Pi.single i a) 0


@[simp]
theorem toAntisymmetrization_lt_toAntisymmetrization_iff :
    @toAntisymmetrization α (· ≤ ·) _ a < @toAntisymmetrization α (· ≤ ·) _ b ↔ a < b

toAntisymmetrization (fun x x_1 => x ≤ x_1) a < toAntisymmetrization (fun x x_1 => x ≤ x_1) b ↔ a < b


lemma of_cons (a : α) (m : Multiset α) : (FreeAbelianGroup.of (Multiplicative.ofAdd (a ::ₘ m))) =
    @HMul.hMul _ (FreeCommRing α) (FreeCommRing α) _ (of a)
    (FreeAbelianGroup.of (Multiplicative.ofAdd m))

FreeAbelianGroup.of (Multiplicative.ofAdd (a ::ₘ m)) = FreeCommRing.of a * FreeAbelianGroup.of (Multiplicative.ofAdd m)


@[to_additive]
lemma mulSupport_max [LinearOrder M] (f g : α → M) :
    mulSupport (fun x ↦ max (f x) (g x)) ⊆ mulSupport f ∪ mulSupport g

{α : Type u_2}
{M : Type u_4}
[One M]
[LinearOrder M]
(f g : α → M)

(Function.mulSupport fun x => max (f x) (g x)) ⊆ Function.mulSupport f ∪ Function.mulSupport g


@[to_additive (attr := simp)]
theorem pow_iterate (n : ℕ) (j : ℕ) : (fun x : G => x ^ n)^[j] = fun x : G => x ^ n ^ j

(fun x => n • x)^[j] = fun x => n ^ j • x


@[to_additive]
theorem closure_smul (c : G) (s : Set α) : closure (c • s) = c • closure s

{α : Type u_2}
{G : Type u_4}
[TopologicalSpace α]
[Group G]
[MulAction G α]
[ContinuousConstSMul G α]
(c : G)
(s : Set α)


@[to_additive]
theorem Function.Injective.tprod_eq {g : γ → β} (hg : Injective g) {f : β → α}
    (hf : mulSupport f ⊆ Set.range g) : ∏' c, f (g c) = ∏' b, f b

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[AddCommMonoid α]
[TopologicalSpace α]
{g : γ → β}
(hg : Function.Injective g)
{f : β → α}
(hf : Function.support f ⊆ Set.range g)


theorem inter_cylinder (s₁ s₂ : Finset ι) (S₁ : Set (∀ i : s₁, α i)) (S₂ : Set (∀ i : s₂, α i))
    [DecidableEq ι] :
    cylinder s₁ S₁ ∩ cylinder s₂ S₂ =
      cylinder (s₁ ∪ s₂)
        ((fun f ↦ fun j : s₁ ↦ f ⟨j, Finset.mem_union_left s₂ j.prop⟩) ⁻¹' S₁ ∩
          (fun f ↦ fun j : s₂ ↦ f ⟨j, Finset.mem_union_right s₁ j.prop⟩) ⁻¹' S₂)

(S₁ : Set ((i : { x // x ∈ s₁ }) → α ↑i))

(S₂ : Set ((i : { x // x ∈ s₂ }) → α ↑i))

MeasureTheory.cylinder s₁ S₁ ∩ MeasureTheory.cylinder s₂ S₂ =
  MeasureTheory.cylinder (s₁ ∪ s₂) ((fun f j => f ⟨↑j, ⋯⟩) ⁻¹' S₁ ∩ (fun f j => f ⟨↑j, ⋯⟩) ⁻¹' S₂)


theorem disjoint_comm : Disjoint a b ↔ Disjoint b a

{α : Type u_1}
[PartialOrder α]
[OrderBot α]
{a b : α}


/-- An `R` algebra `A` is formally smooth if for every `R`-algebra, every square-zero ideal
`I : Ideal B` and `f : A →ₐ[R] B ⧸ I`, there exists at least one lift `A →ₐ[R] B`.

See <https://stacks.math.columbia.edu/tag/00TI>.
-/
@[mk_iff]
class FormallySmooth : Prop where
  comp_surjective :
    ∀ ⦃B : Type u⦄ [CommRing B],
      ∀ [Algebra R B] (I : Ideal B) (_ : I ^ 2 = ⊥),
        Function.Surjective ((Ideal.Quotient.mkₐ R I).comp : (A →ₐ[R] B) → A →ₐ[R] B ⧸ I)

{R : Type u}
[CommSemiring R]
{A : Type u}
[Semiring A]
[Algebra R A]
[self : Algebra.FormallySmooth R A]
⦃B : Type u⦄
[CommRing B]
[Algebra R B]
(I : Ideal B)

I ^ 2 = ⊥ → Function.Surjective (Ideal.Quotient.mkₐ R I).comp


/-- The function `update f a : π a → Π a, π a` is always measurable.
  This doesn't require `f` to be measurable.
  This should not be confused with the statement that `update f a x` is measurable. -/
@[measurability]
theorem measurable_update (f : ∀ a : δ, π a) {a : δ} [DecidableEq δ] : Measurable (update f a)

{δ : Type u_4}
{π : δ → Type u_6}
[(a : δ) → MeasurableSpace (π a)]
(f : (a : δ) → π a)
{a : δ}
[DecidableEq δ]


theorem mem_boundaries_iff_exists_blocks_sum_take_eq {j : Fin (n + 1)} :
    j ∈ c.boundaries ↔ ∃ i < c.boundaries.card, (c.blocks.take i).sum = j

{n : ℕ}
(c : CompositionAsSet n)
{j : Fin (n + 1)}

j ∈ c.boundaries ↔ ∃ i < c.boundaries.card, (List.take i c.blocks).sum = ↑j


theorem isClosed_preimage (h : Inducing f) (s : Set Y) (hs : IsClosed s) :
    IsClosed (f ⁻¹' s)

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


@[to_additive (attr := simp, norm_cast)]
theorem toOpens_top : ((⊤ : OpenSubgroup G) : Opens G) = ⊤

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]


/-- An isomorphism of `PresheafedSpace`s is a homeomorphism of the underlying space, and a
natural transformation between the sheaves.
-/
@[simps hom inv]
def isoOfComponents (H : X.1 ≅ Y.1) (α : H.hom _* X.2 ≅ Y.2) : X ≅ Y

{X Y : AlgebraicGeometry.PresheafedSpace C}

(α : (TopCat.Presheaf.pushforward C H.hom).obj X.presheaf ≅ Y.presheaf)

(AlgebraicGeometry.PresheafedSpace.isoOfComponents H α).inv =
  { base := H.inv, c := TopCat.Presheaf.toPushforwardOfIso H α.hom }


theorem eq_natAbs_iff_mul_eq_zero : natAbs a = n ↔ (a - n) * (a + n) = 0


theorem Monotone.inter [Preorder β] {f g : β → Set α} (hf : Monotone f) (hg : Monotone g) :
    Monotone fun x => f x ∩ g x

{α : Type u_1}
{β : Type u_2}
[Preorder β]
{f g : β → Set α}
(hf : Monotone f)
(hg : Monotone g)


theorem eq_univ_iff_forall {s : Set α} : s = univ ↔ ∀ x, x ∈ s


lemma baseChange_ΨSq (n : ℤ) : (W.baseChange B).ΨSq n = ((W.baseChange A).ΨSq n).map f

{R : Type r}
{S : Type s}
[CommRing R]
[CommRing S]
(W : WeierstrassCurve R)
[Algebra R S]
{A : Type u}
[CommRing A]
[Algebra R A]
[Algebra S A]
[IsScalarTower R S A]
{B : Type v}
[CommRing B]
[Algebra R B]
[Algebra S B]
[IsScalarTower R S B]
(f : A →ₐ[S] B)
(n : ℤ)

(W.baseChange B).ΨSq n = Polynomial.map (↑f) ((W.baseChange A).ΨSq n)


@[to_additive]
private theorem one_mul (s : UpperSet α) : 1 * s = s

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


@[simp] lemma coe_nonZeroDivisorsRight_eq [NoZeroDivisors M₀] [Nontrivial M₀] :
    nonZeroDivisorsRight M₀ = {x : M₀ | x ≠ 0}

(M₀ : Type u_1)
[MonoidWithZero M₀]
[NoZeroDivisors M₀]
[Nontrivial M₀]

↑(nonZeroDivisorsRight M₀) = {x | x ≠ 0}


/-- The `i`th cycles functor `HomologicalComplex C c ⥤ C`. -/
@[simps]
noncomputable def cyclesFunctor [CategoryWithHomology C] : HomologicalComplex C c ⥤ C

∀ {X Y : HomologicalComplex C c} (f : X ⟶ Y),
  (HomologicalComplex.cyclesFunctor C c i).map f = HomologicalComplex.cyclesMap f i


@[simp]
theorem _root_.ULift.down_algebraMap (r : R) : (algebraMap R (ULift A) r).down = algebraMap R A r

{R : Type u}
{A : Type w}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(r : R)

((algebraMap R (ULift.{u_2, w} A)) r).down = (algebraMap R A) r


@[to_additive rightAddCoset_mem_rightAddCoset]
theorem rightCoset_mem_rightCoset {a : α} (ha : a ∈ s) : op a • (s : Set α) = s

{α : Type u_1}
[Group α]
(s : Subgroup α)
{a : α}
(ha : a ∈ s)


lemma exists_isRegular [Infinite R] : ∃ x : L, IsRegular R x

(R : Type u_1)
(L : Type u_3)
[CommRing R]
[Nontrivial R]
[LieRing L]
[LieAlgebra R L]
[Module.Finite R L]
[Module.Free R L]
[IsDomain R]
[Infinite R]


theorem _root_.Function.Semiconj.finset_image [DecidableEq α] {f : α → β} {ga : α → α} {gb : β → β}
    (h : Function.Semiconj f ga gb) : Function.Semiconj (image f) (image ga) (image gb)

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
[DecidableEq α]
{f : α → β}
{ga : α → α}
{gb : β → β}
(h : Function.Semiconj f ga gb)

Function.Semiconj (Finset.image f) (Finset.image ga) (Finset.image gb)


/-- Constructs an isomorphism of groups with zero from a group isomorphism between them. -/
@[simps]
def Iso.mk {α β : GrpWithZero.{u}} (e : α ≃* β) : α ≅ β


theorem fst_embedding_of_right_embedding {X Y S : TopCat} (f : X ⟶ S) {g : Y ⟶ S}
    (H : Embedding g) : Embedding <| ⇑(pullback.fst f g)

{X Y S : TopCat}
(f : X ⟶ S)
{g : Y ⟶ S}
(H : Embedding ⇑g)

Embedding ⇑(CategoryTheory.Limits.pullback.fst f g)


/-- The identity map is a bialgebra equivalence. -/
@[refl, simps!]
def refl : A ≃ₐc[R] A

(R : Type u)
(A : Type v)
[CommSemiring R]
[Semiring A]
[Algebra R A]
[CoalgebraStruct R A]
(a : A)


@[simp] lemma div_dvd_iff_dvd_mul (h : b ∣ a) (hb : b ≠ 0) : a / b ∣ c ↔ a ∣ b * c


/-- Adding a vector in the direction to a point in the subspace produces a point in the
subspace. -/
theorem vadd_mem_of_mem_direction {s : AffineSubspace k P} {v : V} (hv : v ∈ s.direction) {p : P}
    (hp : p ∈ s) : v +ᵥ p ∈ s

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s : AffineSubspace k P}
{v : V}
(hv : v ∈ s.direction)
{p : P}
(hp : p ∈ s)


lemma AffineIndependent.eq_of_sum_eq_sum (hp : AffineIndependent k p)
    (hw : ∑ i ∈ s, w₁ i = ∑ i ∈ s, w₂ i) (hwp : ∑ i ∈ s, w₁ i • p i = ∑ i ∈ s, w₂ i • p i) :
    ∀ i ∈ s, w₁ i = w₂ i


@[simp]
theorem mk'_cancel (m : M) (s : S) : mk' f (s • m) s = f m

{R : Type u_1}
[CommSemiring R]
{S : Submonoid R}
{M : Type u_2}
{M' : Type u_3}
[AddCommMonoid M]
[AddCommMonoid M']
[Module R M]
[Module R M']
(f : M →ₗ[R] M')
[IsLocalizedModule S f]
(m : M)
(s : ↥S)


theorem preimage_univ : f.preimage Set.univ = f.Dom

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


@[simp]
theorem comp₂Measurable_mk_mk (g : β → γ → δ) (hg : Measurable (uncurry g)) (f₁ : α → β)
    (f₂ : α → γ) (hf₁ hf₂) :
    comp₂Measurable g hg (mk f₁ hf₁ : α →ₘ[μ] β) (mk f₂ hf₂) =
      mk (fun a => g (f₁ a) (f₂ a))
        (hg.comp_aemeasurable (hf₁.aemeasurable.prod_mk hf₂.aemeasurable)).aestronglyMeasurable

(g : β → γ → δ)

(f₁ : α → β)

(f₂ : α → γ)

(hf₁ : MeasureTheory.AEStronglyMeasurable f₁ μ)

(hf₂ : MeasureTheory.AEStronglyMeasurable f₂ μ)

MeasureTheory.AEEqFun.comp₂Measurable g hg (MeasureTheory.AEEqFun.mk f₁ hf₁) (MeasureTheory.AEEqFun.mk f₂ hf₂) =
  MeasureTheory.AEEqFun.mk (fun a => g (f₁ a) (f₂ a)) ⋯


theorem not_summable_norm_of_radius_lt_nnnorm (p : FormalMultilinearSeries 𝕜 E F) {x : E}
    (h : p.radius < ‖x‖₊) : ¬Summable fun n => ‖p n‖ * ‖x‖ ^ n

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)
{x : E}
(h : p.radius < ↑‖x‖₊)


@[simp]
theorem mem_image :
    ∀ {f : ZFSet.{u} → ZFSet.{u}} [H : Definable 1 f] {x y : ZFSet.{u}},
      y ∈ @image f H x ↔ ∃ z ∈ x, f z = y

{f : ZFSet → ZFSet}
[H : PSet.Definable 1 f]
{x y : ZFSet}


@[to_additive]
theorem continuousAt_pow (x : M) (n : ℕ) : ContinuousAt (fun (x : M) => x ^ n) x

{M : Type u_3}
[TopologicalSpace M]
[Monoid M]
[ContinuousMul M]
(x : M)
(n : ℕ)


@[simp]
theorem fromStructuredArrow_obj (X) : (fromStructuredArrow F).obj X = ⟨X.right, X.hom PUnit.unit⟩

(X : CategoryTheory.StructuredArrow PUnit.{w + 1} F)

(CategoryTheory.CategoryOfElements.fromStructuredArrow F).obj X = ⟨X.right, X.hom PUnit.unit⟩


@[simp]
theorem RightExactFunctor.forget_map {F G : C ⥤ᵣ D} (α : F ⟶ G) :
    (RightExactFunctor.forget C D).map α = α

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F G : C ⥤ᵣ D}
(α : F ⟶ G)

(CategoryTheory.RightExactFunctor.forget C D).map α = α


theorem derivedSeriesOfIdeal_add (k l : ℕ) : D (k + l) I = D k (D l I)

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

LieAlgebra.derivedSeriesOfIdeal R L (k + l) I =
  LieAlgebra.derivedSeriesOfIdeal R L k (LieAlgebra.derivedSeriesOfIdeal R L l I)


@[simp]
lemma opcyclesMap'_smul :
    opcyclesMap' (a • φ) h₁ h₂ = a • opcyclesMap' φ h₁ h₂

{R : Type u_1}
{C : Type u_2}
[Semiring R]
[CategoryTheory.Category.{u_3, u_2} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.Linear R C]
{S₁ S₂ : CategoryTheory.ShortComplex C}
(φ : S₁ ⟶ S₂)
(h₁ : S₁.RightHomologyData)
(h₂ : S₂.RightHomologyData)
(a : R)

CategoryTheory.ShortComplex.opcyclesMap' (a • φ) h₁ h₂ = a • CategoryTheory.ShortComplex.opcyclesMap' φ h₁ h₂


theorem isClosed_const {p : Prop} : IsClosed { _x : X | p }

{X : Type u}
[TopologicalSpace X]
{p : Prop}


@[simp]
theorem isEmpty_subtype (p : α → Prop) : IsEmpty (Subtype p) ↔ ∀ x, ¬p x


/-- If `R` has characteristic `p`, then so does Frac(R). -/
theorem charP_of_isFractionRing [CharP R p] : CharP K p

(R : Type u_1)
{K : Type u_2}
[CommRing R]
[Field K]
[Algebra R K]
[IsFractionRing R K]
(p : ℕ)
[CharP R p]


theorem UniqueFactorizationMonoid.of_exists_prime_factors : UniqueFactorizationMonoid α

(pf : ∀ (a : α), a ≠ 0 → ∃ f, (∀ b ∈ f, Prime b) ∧ f.prod ~ᵤ a)


@[simp 1001] -- Porting note: increased priority to appease `simpNF`
theorem mem_bot {x : R} : x ∈ (⊥ : Ideal R) ↔ x = 0


/-- The diagonal elements of a complex hermitian matrix are real. -/
theorem IsHermitian.coe_re_diag {A : Matrix n n α} (h : A.IsHermitian) :
    (fun i => (re (A.diag i) : α)) = A.diag

{α : Type u_1}
{n : Type u_4}
[RCLike α]
{A : Matrix n n α}
(h : A.IsHermitian)

(fun i => ↑(RCLike.re (A.diag i))) = A.diag


theorem Matrix.toLinearMapₛₗ₂'_aux_eq (M : Matrix n m N₂) :
    Matrix.toLinearMap₂'Aux σ₁ σ₂ M = Matrix.toLinearMapₛₗ₂' R σ₁ σ₂ M

{R : Type u_1}
{R₁ : Type u_2}
{S₁ : Type u_3}
{R₂ : Type u_4}
{S₂ : Type u_5}
{N₂ : Type u_11}
{n : Type u_12}
{m : Type u_13}
[CommSemiring R]
[AddCommMonoid N₂]
[Module R N₂]
[Semiring R₁]
[Semiring R₂]
[Semiring S₁]
[Semiring S₂]
[Module S₁ N₂]
[Module S₂ N₂]
[SMulCommClass S₁ R N₂]
[SMulCommClass S₂ R N₂]
[SMulCommClass S₂ S₁ N₂]
(σ₁ : R₁ →+* S₁)
(σ₂ : R₂ →+* S₂)
[Fintype n]
[Fintype m]
[DecidableEq n]
[DecidableEq m]
(M : Matrix n m N₂)

Matrix.toLinearMap₂'Aux σ₁ σ₂ M = (Matrix.toLinearMapₛₗ₂' R σ₁ σ₂) M


theorem degreeOf_X [DecidableEq σ] (i j : σ) [Nontrivial R] :
    degreeOf i (X j : MvPolynomial σ R) = if i = j then 1 else 0

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
[DecidableEq σ]
(i j : σ)
[Nontrivial R]

MvPolynomial.degreeOf i (MvPolynomial.X j) = if i = j then 1 else 0


@[to_additive]
theorem MulEquiv.map_finprod_mem (g : M ≃* N) (f : α → M) {s : Set α} (hs : s.Finite) :
    g (∏ᶠ i ∈ s, f i) = ∏ᶠ i ∈ s, g (f i)

{α : Type u_1}
{M : Type u_5}
{N : Type u_6}
[CommMonoid M]
[CommMonoid N]
(g : M ≃* N)
(f : α → M)
{s : Set α}
(hs : s.Finite)


@[simp]
theorem preimage_cast_Ioo (p q : ℚ≥0) : (↑) ⁻¹' Ioo (p : K) q = Ioo p q

{K : Type u_5}
[LinearOrderedSemifield K]
(p q : ℚ≥0)

NNRat.cast ⁻¹' Set.Ioo ↑p ↑q = Set.Ioo p q


/-- Given `R`-module X and `S`-module Y, `S`-linear linear maps `(extendScalars f).obj X ⟶ Y`
bijectively correspond to `R`-linear maps `X ⟶ (restrictScalars f).obj Y`.
-/
@[simps symm_apply]
def homEquiv {X Y} :
    ((extendScalars f).obj X ⟶ Y) ≃ (X ⟶ (restrictScalars.{max v u₂,u₁,u₂} f).obj Y)

(g : X ⟶ (ModuleCat.restrictScalars f).obj Y)

(ModuleCat.ExtendRestrictScalarsAdj.homEquiv f).symm g =
  ModuleCat.ExtendRestrictScalarsAdj.HomEquiv.fromExtendScalars f g


theorem map_map (g : S →+* T) (f : R →+* S) : (s.map f).map g = s.map (g.comp f)

{R : Type u}
{S : Type v}
{T : Type w}
[Ring R]
[Ring S]
[Ring T]
(s : Subring R)
(g : S →+* T)
(f : R →+* S)

Subring.map g (Subring.map f s) = Subring.map (g.comp f) s


theorem toReal_coe_eq_self_sub_two_pi_iff {θ : ℝ} :
    (θ : Angle).toReal = θ - 2 * π ↔ θ ∈ Set.Ioc π (3 * π)

(↑θ).toReal = θ - 2 * π ↔ θ ∈ Set.Ioc π (3 * π)


theorem isClosedMap_iff_closure_image :
    IsClosedMap f ↔ ∀ s, closure (f '' s) ⊆ f '' closure s

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

IsClosedMap f ↔ ∀ (s : Set X), closure (f '' s) ⊆ f '' closure s


theorem localization_base [FormallySmooth R Sₘ] : FormallySmooth Rₘ Sₘ

{R Rₘ Sₘ : Type u}
[CommRing R]
[CommRing Rₘ]
[CommRing Sₘ]
(M : Submonoid R)
[Algebra R Sₘ]
[Algebra R Rₘ]
[Algebra Rₘ Sₘ]
[IsScalarTower R Rₘ Sₘ]
[IsLocalization M Rₘ]
[Algebra.FormallySmooth R Sₘ]


/-- If a binary function from a type equipped with a total relation `r` to a monoid is
  anti-symmetric (i.e. satisfies `f a b * f b a = 1`), in order to show it is multiplicative
  (i.e. satisfies `f a c = f a b * f b c`), we may assume `r a b` and `r b c` are satisfied.
  We allow restricting to a subset specified by a predicate `p`. -/
@[to_additive additive_of_isTotal "If a binary function from a type equipped with a total relation
`r` to an additive monoid is anti-symmetric (i.e. satisfies `f a b + f b a = 0`), in order to show
it is additive (i.e. satisfies `f a c = f a b + f b c`), we may assume `r a b` and `r b c` are
satisfied. We allow restricting to a subset specified by a predicate `p`."]
theorem multiplicative_of_isTotal (p : α → Prop) (hswap : ∀ {a b}, p a → p b → f a b * f b a = 1)
    (hmul : ∀ {a b c}, r a b → r b c → p a → p b → p c → f a c = f a b * f b c) {a b c : α}
    (pa : p a) (pb : p b) (pc : p c) : f a c = f a b * f b c

(f : α → α → β)

(hswap : ∀ {a b : α}, p a → p b → f a b * f b a = 1)

(hmul : ∀ {a b c : α}, r a b → r b c → p a → p b → p c → f a c = f a b * f b c)


theorem unzip_left (l : List (α × β)) : (unzip l).1 = l.map Prod.fst

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


/-- Translation of preimage is contained in preimage of translation -/
theorem smul_preimage_set_leₛₗ :
    c • h ⁻¹' t ⊆ h ⁻¹' (σ c • t)

{R : Type u_1}
{S : Type u_2}
(M : Type u_3)
(N : Type u_6)
[Monoid R]
[Monoid S]
(σ : R → S)
[MulAction R M]
[MulAction S N]
{F : Type u_7}
(h : F)
[FunLike F M N]
[MulActionSemiHomClass F σ M N]
(c : R)
(t : Set N)

c • ⇑h ⁻¹' t ⊆ ⇑h ⁻¹' (σ c • t)


/-- After filtering out everything that does not equal a given value, at most that value remains.

  This is equivalent to `filter_eq` with the equality the other way.
-/
theorem filter_eq' [DecidableEq β] (s : Finset β) (b : β) :
    (s.filter fun a => a = b) = ite (b ∈ s) {b} ∅

{β : Type u_2}
[DecidableEq β]
(s : Finset β)
(b : β)

Finset.filter (fun a => a = b) s = if b ∈ s then {b} else ∅


theorem iInf_of_empty [IsEmpty ι] (f : ι → α) : iInf f = ⊤

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


@[simp]
theorem divisorsAntidiagonal_one : divisorsAntidiagonal 1 = {(1, 1)}


protected theorem isAsymm (f : r ↪r s) [IsAsymm β s] : IsAsymm α r

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
(f : r ↪r s)
[IsAsymm β s]


theorem algebraicIndependent_equiv (e : ι ≃ ι') {f : ι' → A} :
    AlgebraicIndependent R (f ∘ e) ↔ AlgebraicIndependent R f

{ι : Type u_1}
{ι' : Type u_2}
{R : Type u_3}
{A : Type u_5}
[CommRing R]
[CommRing A]
[Algebra R A]
(e : ι ≃ ι')
{f : ι' → A}

AlgebraicIndependent R (f ∘ ⇑e) ↔ AlgebraicIndependent R f


@[simp]
theorem coe_one : ⇑(1 : AddAut A) = id


lemma norm_eq_of_algEquiv [Ring T] [Algebra R T] (e : S ≃ₐ[R] T) (x) :
    Algebra.norm R (e x) = Algebra.norm R x

{R : Type u_1}
{S : Type u_2}
{T : Type u_3}
[CommRing R]
[Ring S]
[Algebra R S]
[Ring T]
[Algebra R T]
(e : S ≃ₐ[R] T)
(x : S)

(Algebra.norm R) (e x) = (Algebra.norm R) x


@[to_additive]
lemma BddAbove.range_mul {α : Type*} {f g : α → M} (hf : BddAbove (range f))
    (hg : BddAbove (range g)) : BddAbove (range (fun x => f x * g x))

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

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


@[simp]
theorem add_bot (x : EReal) : x + ⊥ = ⊥


/-- The second projection functor `ShortComplex C ⥤ C`. -/
@[simps]
def π₂ : ShortComplex C ⥤ C

CategoryTheory.ShortComplex.π₂.obj S = S.X₂


@[to_additive (attr := ext)]
theorem ext {f g : ContinuousMonoidHom A B} (h : ∀ x, f x = g x) : f = g

{A : Type u_2}
{B : Type u_3}
[Monoid A]
[Monoid B]
[TopologicalSpace A]
[TopologicalSpace B]
{f g : ContinuousMonoidHom A B}
(h : ∀ (x : A), f x = g x)


@[simp, mfld_simps]
theorem mk_coe (e : PartialEquiv X Y) (a b c d) : (PartialHomeomorph.mk e a b c d : X → Y) = e

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialEquiv X Y)
(a : IsOpen e.source)
(b : IsOpen e.target)
(c : ContinuousOn (↑e) e.source)
(d : ContinuousOn e.invFun e.target)

↑{ toPartialEquiv := e, open_source := a, open_target := b, continuousOn_toFun := c, continuousOn_invFun := d } = ↑e


@[simp] lemma T_univ (f : (∀ i, A i) → ℝ≥0∞) (x : ∀ i, A i) :
    T μ p f univ x =
    ∫⁻ (x : ∀ i, A i), (f x ^ (1 - (#ι - 1 : ℝ) * p)
    * ∏ i : ι, (∫⁻ t : A i, f (update x i t) ∂(μ i)) ^ p) ∂(.pi μ)

(μ : (i : ι) → MeasureTheory.Measure (A i))

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

MeasureTheory.GridLines.T μ p f Finset.univ x =
  ∫⁻ (x : (i : ι) → A i),
    f x ^ (1 - (↑#ι - 1) * p) * ∏ i : ι, (∫⁻ (t : A i), f (Function.update x i t) ∂μ i) ^ p ∂MeasureTheory.Measure.pi μ


theorem range_nth_of_finite (hf : (setOf p).Finite) : Set.range (nth p) = insert 0 (setOf p)

Set.range (Nat.nth p) = insert 0 (setOf p)


/-- `Prod.snd` maps neighborhood of `x : X × Y` within the section `Prod.fst ⁻¹' {x.1}`
to `𝓝 x.2`. -/
theorem map_snd_nhdsWithin (x : X × Y) : map Prod.snd (𝓝[Prod.fst ⁻¹' {x.1}] x) = 𝓝 x.2

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
(x : X × Y)

Filter.map Prod.snd (𝓝[Prod.fst ⁻¹' {x.1}] x) = 𝓝 x.2


@[simp] theorem prod_nnnorm_equiv (f : WithLp ∞ (α × β)) : ‖WithLp.equiv ⊤ _ f‖₊ = ‖f‖₊

{α : Type u_2}
{β : Type u_3}
[SeminormedAddCommGroup α]
[SeminormedAddCommGroup β]
(f : WithLp ⊤ (α × β))


theorem integral_prod_smul {𝕜 : Type*} [RCLike 𝕜] [NormedSpace 𝕜 E] (f : α → 𝕜) (g : β → E) :
    ∫ z, f z.1 • g z.2 ∂μ.prod ν = (∫ x, f x ∂μ) • ∫ y, g 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 μ]
{𝕜 : Type u_8}
[RCLike 𝕜]
[NormedSpace 𝕜 E]
(f : α → 𝕜)
(g : β → E)

∫ (z : α × β), f z.1 • g z.2 ∂μ.prod ν = (∫ (x : α), f x ∂μ) • ∫ (y : β), g y ∂ν


theorem closure_top [PartialOrder α] [OrderTop α] [Preorder β] {u : β → α} (l : LowerAdjoint u) :
    u (l ⊤) = ⊤

{α : Type u_1}
{β : Type u_4}
[PartialOrder α]
[OrderTop α]
[Preorder β]
{u : β → α}
(l : LowerAdjoint u)


@[simp]
theorem norm_restrictScalars : ‖f.restrictScalars 𝕜'‖ = ‖f‖

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

‖ContinuousMultilinearMap.restrictScalars 𝕜' f‖ = ‖f‖


@[simp] theorem testBit_two_pow_sub_one (n i : Nat) : testBit (2^n-1) i = decide (i < n)


/-- The Laplacian matrix is positive semidefinite -/
theorem posSemidef_lapMatrix [LinearOrderedField R] [StarRing R]
    [TrivialStar R] : PosSemidef (G.lapMatrix R)

{V : Type u_1}
(R : Type u_2)
[Fintype V]
[DecidableEq V]
(G : SimpleGraph V)
[DecidableRel G.Adj]
[LinearOrderedField R]
[StarRing R]
[TrivialStar R]


@[simp, mfld_simps]
theorem symm_target : e.symm.target = e.source

{α : Type u_1}
{β : Type u_2}
(e : PartialEquiv α β)


/-- The identity morphism of a short complex. -/
@[simps]
def Hom.id : Hom S S

(CategoryTheory.ShortComplex.Hom.id S).τ₃ = CategoryTheory.CategoryStruct.id S.X₃


@[simp]
theorem comp_zero (g : β →ₙ+* γ) : g.comp (0 : α →ₙ+* β) = 0

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[NonUnitalNonAssocSemiring α]
[NonUnitalNonAssocSemiring β]
[NonUnitalNonAssocSemiring γ]
(g : β →ₙ+* γ)


@[simp]
theorem coe_map (S : Subalgebra R A) (f : A →ₐ[R] B) : (S.map f : Set B) = f '' S

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
(S : Subalgebra R A)
(f : A →ₐ[R] B)


@[to_additive (attr := simp, norm_cast)]
theorem coe_pow (s : Finset α) (n : ℕ) : ↑(s ^ n) = (s : Set α) ^ n

{α : Type u_2}
[DecidableEq α]
[AddMonoid α]
(s : Finset α)
(n : ℕ)


theorem derivWithin_smul_const (hxs : UniqueDiffWithinAt 𝕜 s x)
    (hc : DifferentiableWithinAt 𝕜 c s x) (f : F) :
    derivWithin (fun y => c y • f) s x = derivWithin c s x • f

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{x : 𝕜}
{s : Set 𝕜}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{c : 𝕜 → 𝕜'}
(hxs : UniqueDiffWithinAt 𝕜 s x)
(hc : DifferentiableWithinAt 𝕜 c s x)
(f : F)


@[simp]
theorem basicOpen_zero : basicOpen (0 : R) = ⊥


@[simp]
theorem bool_snd : TwoPointing.bool.snd = true


theorem hasBasis_nhds_zero :
    (𝓝 (0 : ContinuousMultilinearMap 𝕜 E F)).HasBasis
      (fun SV : Set (Π i, E i) × Set F => IsVonNBounded 𝕜 SV.1 ∧ SV.2 ∈ 𝓝 0) fun SV =>
      { f | MapsTo f SV.1 SV.2 }

{𝕜 : Type u_1}
{ι : Type u_2}
{E : ι → Type u_3}
{F : Type u_4}
[NormedField 𝕜]
[(i : ι) → TopologicalSpace (E i)]
[(i : ι) → AddCommGroup (E i)]
[(i : ι) → Module 𝕜 (E i)]
[AddCommGroup F]
[Module 𝕜 F]
[TopologicalSpace F]
[TopologicalAddGroup F]

(𝓝 0).HasBasis (fun SV => Bornology.IsVonNBounded 𝕜 SV.1 ∧ SV.2 ∈ 𝓝 0) fun SV => {f | Set.MapsTo (⇑f) SV.1 SV.2}


@[simp]
theorem slope_same (f : k → PE) (a : k) : (slope f a a : E) = 0

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


@[ext] theorem tensor_ext {X Y Z : C} (f g : X ⟶ Y ⊗ Z)
    (w₁ : f ≫ prod.fst = g ≫ prod.fst) (w₂ : f ≫ prod.snd = g ≫ prod.snd) : f = g

(f g : X ⟶ CategoryTheory.MonoidalCategory.tensorObj Y Z)

(w₁ :
  CategoryTheory.CategoryStruct.comp f CategoryTheory.Limits.prod.fst =
    CategoryTheory.CategoryStruct.comp g CategoryTheory.Limits.prod.fst)

(w₂ :
  CategoryTheory.CategoryStruct.comp f CategoryTheory.Limits.prod.snd =
    CategoryTheory.CategoryStruct.comp g CategoryTheory.Limits.prod.snd)


lemma smul_nonpos_of_nonneg_of_nonpos [PosSMulMono α β] (ha : 0 ≤ a) (hb : b ≤ 0) : a • b ≤ 0

{α : Type u_1}
{β : Type u_2}
{a : α}
{b : β}
[Zero α]
[Zero β]
[SMulZeroClass α β]
[Preorder α]
[Preorder β]
[PosSMulMono α β]
(ha : 0 ≤ a)
(hb : b ≤ 0)


/-- Corresponds to `norm_ne_zero_iff`. -/
theorem hammingNorm_ne_zero_iff {x : ∀ i, β i} : hammingNorm x ≠ 0 ↔ x ≠ 0

{ι : Type u_2}
{β : ι → Type u_3}
[Fintype ι]
[(i : ι) → DecidableEq (β i)]
[(i : ι) → Zero (β i)]
{x : (i : ι) → β i}


@[fun_prop]
theorem DifferentiableAt.comp {g : F → G} (hg : DifferentiableAt 𝕜 g (f x))
    (hf : DifferentiableAt 𝕜 f x) : DifferentiableAt 𝕜 (g ∘ f) x

{𝕜 : 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}
(x : E)
{g : F → G}
(hg : DifferentiableAt 𝕜 g (f x))
(hf : DifferentiableAt 𝕜 f x)


theorem mem_toSubmodule (S : NonUnitalSubalgebra R A) {x} : x ∈ S.toSubmodule ↔ x ∈ S

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


theorem one_div_pos_of_nat {n : ℕ} : 0 < 1 / ((n : α) + 1)

{α : Type u_1}
[LinearOrderedSemifield α]
{n : ℕ}


@[to_additive]
theorem relindex_eq_zero_of_le_left (hHK : H ≤ K) (hKL : K.relindex L = 0) : H.relindex L = 0

{G : Type u_1}
[AddGroup G]
{H K L : AddSubgroup G}
(hHK : H ≤ K)
(hKL : K.relindex L = 0)


@[to_additive (attr := simp)]
theorem clift_apply_mk (f : FreeMonoid (M ⊕ N) →* P) (hM₁ hN₁ hM hN w) :
    clift f hM₁ hN₁ hM hN (mk w) = f w

(hM₁ : f (FreeAddMonoid.of (Sum.inl 0)) = 0)

(hN₁ : f (FreeAddMonoid.of (Sum.inr 0)) = 0)

(hM :
  ∀ (x y : M), f (FreeAddMonoid.of (Sum.inl (x + y))) = f (FreeAddMonoid.of (Sum.inl x) + FreeAddMonoid.of (Sum.inl y)))

(hN :
  ∀ (x y : N), f (FreeAddMonoid.of (Sum.inr (x + y))) = f (FreeAddMonoid.of (Sum.inr x) + FreeAddMonoid.of (Sum.inr y)))

(AddMonoid.Coprod.clift f hM₁ hN₁ hM hN) (AddMonoid.Coprod.mk w) = f w


@[simp]
theorem sbtw_const_vadd_iff {x y z : P} (v : V) :
    Sbtw R (v +ᵥ x) (v +ᵥ y) (v +ᵥ z) ↔ Sbtw R x y z

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


theorem inseparable_iff {x y : OnePoint X} :
    Inseparable x y ↔ x = ∞ ∧ y = ∞ ∨ ∃ x' : X, x = x' ∧ ∃ y' : X, y = y' ∧ Inseparable x' y'

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

Inseparable x y ↔ x = OnePoint.infty ∧ y = OnePoint.infty ∨ ∃ x', x = ↑x' ∧ ∃ y', y = ↑y' ∧ Inseparable x' y'


theorem frontier_Ioi [NoMaxOrder α] {a : α} : frontier (Ioi a) = {a}

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


theorem coeFn_add (f g : Lp E p μ) : ⇑(f + g) =ᵐ[μ] f + g

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


/-- Let `p i` be a family of seminorms on `E`. Let `s` be an absorbent set in `𝕜`.
If all seminorms are uniformly bounded at every point of `s`,
then they are bounded in the space of seminorms. -/
lemma bddAbove_of_absorbent {ι : Sort*} {p : ι → Seminorm 𝕜 E} {s : Set E} (hs : Absorbent 𝕜 s)
    (h : ∀ x ∈ s, BddAbove (range (p · x))) : BddAbove (range p)

(h : ∀ x ∈ s, BddAbove (Set.range fun x_1 => (p x_1) x))


theorem eq_of_ge_of_not_gt [PartialOrder α] {a b : α} (hab : a ≤ b) (hba : ¬a < b) : b = a

{α : Type u_2}
[PartialOrder α]
{a b : α}
(hab : a ≤ b)
(hba : ¬a < b)


@[simp]
theorem isMax_toDual_iff : IsMax (toDual a) ↔ IsMin a


theorem rpow_zero_pos (x : ℝ) : 0 < x ^ (0 : ℝ)


theorem ofNat_dvd_right {n : Nat} {z : Int} : z ∣ (↑n : Int) ↔ z.natAbs ∣ n


/-- A constructor for languages with only constants, unary and binary functions, and
unary and binary relations. -/
@[simps]
protected def mk₂ (c f₁ f₂ : Type u) (r₁ r₂ : Type v) : Language

∀ (a : ℕ), (FirstOrder.Language.mk₂ c f₁ f₂ r₁ r₂).Relations a = FirstOrder.Sequence₂ PEmpty.{v + 1} r₁ r₂ a


theorem lt_def : p < q ↔ (p : E → ℝ) < q

{E : Type u_4}
[AddGroup E]
{p q : NonarchAddGroupNorm E}


theorem zeroLocus_singleton_mul (f g : R) :
    zeroLocus ({f * g} : Set R) = zeroLocus {f} ∪ zeroLocus {g}

PrimeSpectrum.zeroLocus {f * g} = PrimeSpectrum.zeroLocus {f} ∪ PrimeSpectrum.zeroLocus {g}


/-- In a sigma-finite measure space, there exists an integrable function which is
positive everywhere (and with an arbitrarily small integral). -/
theorem exists_pos_lintegral_lt_of_sigmaFinite (μ : Measure α) [SigmaFinite μ] {ε : ℝ≥0∞}
    (ε0 : ε ≠ 0) : ∃ g : α → ℝ≥0, (∀ x, 0 < g x) ∧ Measurable g ∧ ∫⁻ x, g x ∂μ < ε

{α : Type u_1}
{m0 : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
[MeasureTheory.SigmaFinite μ]
{ε : ℝ≥0∞}
(ε0 : ε ≠ 0)

∃ g, (∀ (x : α), 0 < g x) ∧ Measurable g ∧ ∫⁻ (x : α), ↑(g x) ∂μ < ε


@[simp]
lemma traceDual_bot :
    (⊥ : Submodule B L)ᵛ = ⊤

{A : Type u_1}
{K : Type u_2}
{L : Type u}
{B : Type u_3}
[CommRing A]
[Field K]
[CommRing B]
[Field L]
[Algebra A K]
[Algebra B L]
[Algebra A B]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[IsScalarTower A B L]


lemma AffineIndependent.card_le_finrank_succ [Fintype ι] {p : ι → P} (hp : AffineIndependent k p) :
    Fintype.card ι ≤ FiniteDimensional.finrank k (vectorSpan k (Set.range p)) + 1

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
{ι : Type u_4}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
[Fintype ι]
{p : ι → P}
(hp : AffineIndependent k p)

Fintype.card ι ≤ FiniteDimensional.finrank k ↥(vectorSpan k (Set.range p)) + 1


@[simp] lemma op_hom_associator (X Y Z : C) :
    (α_ X Y Z).hom.op = (α_ (op X) (op Y) (op Z)).inv

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

(CategoryTheory.MonoidalCategory.associator X Y Z).hom.op =
  (CategoryTheory.MonoidalCategory.associator (Opposite.op X) (Opposite.op Y) (Opposite.op Z)).inv


theorem essSup_indicator_eq_essSup_restrict {s : Set α} {f : α → ℝ≥0∞} (hs : MeasurableSet s) :
    essSup (s.indicator f) μ = essSup f (μ.restrict s)

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
{f : α → ℝ≥0∞}
(hs : MeasurableSet s)


@[simp] lemma support_cycleOf_nonempty [DecidableEq α] [Fintype α] :
    (cycleOf f x).support.Nonempty ↔ f x ≠ x

{α : Type u_2}
{f : Equiv.Perm α}
{x : α}
[DecidableRel f.SameCycle]
[DecidableEq α]
[Fintype α]

(f.cycleOf x).support.Nonempty ↔ f x ≠ x


@[reassoc (attr := simp)]
theorem pentagon_hom_inv_inv_inv_inv :
    W ◁ (α_ X Y Z).hom ≫ (α_ W X (Y ⊗ Z)).inv ≫ (α_ (W ⊗ X) Y Z).inv =
      (α_ W (X ⊗ Y) Z).inv ≫ (α_ W X Y).inv ▷ Z

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

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.whiskerLeft W (CategoryTheory.MonoidalCategory.associator X Y Z).hom)
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.MonoidalCategory.associator W X (CategoryTheory.MonoidalCategory.tensorObj Y Z)).inv
      (CategoryTheory.MonoidalCategory.associator (CategoryTheory.MonoidalCategory.tensorObj W X) Y Z).inv) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.associator W (CategoryTheory.MonoidalCategory.tensorObj X Y) Z).inv
    (CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.MonoidalCategory.associator W X Y).inv Z)


@[to_additive]
theorem hasProd_le_of_prod_le (hf : HasProd f a) (h : ∀ s, ∏ i ∈ s, f i ≤ a₂) : a ≤ a₂

(h : ∀ (s : Finset ι), ∏ i ∈ s, f i ≤ a₂)


lemma sup_eq_half_smul_add_add_abs_sub (x y : β) : x ⊔ y = (⅟2 : α) • (x + y + |y - x|)

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


theorem aeval_coe {R : Type*} [CommRing R] [Algebra R K] [Algebra R L] [IsScalarTower R K L]
    (x : S) (P : R[X]) : aeval (x : L) P = aeval x P

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(S : IntermediateField K L)
{R : Type u_4}
[CommRing R]
[Algebra R K]
[Algebra R L]
[IsScalarTower R K L]
(x : ↥S)
(P : R[X])

(Polynomial.aeval ↑x) P = ↑((Polynomial.aeval x) P)


theorem toNonUnitalAlgHom_injective :
    Function.Injective (toNonUnitalAlgHom : _ → CommutatorRing L →ₙₐ[R] CommutatorRing L₂)

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


nonrec theorem HasStrictDerivAt.cpow (hf : HasStrictDerivAt f f' x) (hg : HasStrictDerivAt g g' x)
    (h0 : f x ∈ slitPlane) : HasStrictDerivAt (fun x => f x ^ g x)
      (g x * f x ^ (g x - 1) * f' + f x ^ g x * Complex.log (f x) * g') x

{f g : ℂ → ℂ}
{f' g' x : ℂ}
(hf : HasStrictDerivAt f f' x)
(hg : HasStrictDerivAt g g' x)
(h0 : f x ∈ Complex.slitPlane)


@[to_additive]
theorem IsClosed.smul {s : Set α} (hs : IsClosed s) (c : G) : IsClosed (c • s)

{α : Type u_2}
{G : Type u_4}
[TopologicalSpace α]
[AddGroup G]
[AddAction G α]
[ContinuousConstVAdd G α]
{s : Set α}
(hs : IsClosed s)
(c : G)


protected lemma mul_smul : smul α φ (r * r') m = smul α φ r (smul α φ r' m)

{J : CategoryTheory.GrothendieckTopology C}

PresheafOfModules.Sheafify.smul α φ (r * r') m =
  PresheafOfModules.Sheafify.smul α φ r (PresheafOfModules.Sheafify.smul α φ r' m)


theorem subset_nil {l : List α} : l ⊆ [] ↔ l = []


/-- The preimage of an affine open as an `Scheme.affine_opens`. -/
@[simps]
def affinePreimage {X Y : Scheme} (f : X ⟶ Y) [IsAffineHom f] (U : Y.affineOpens) :
    X.affineOpens

{X Y : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)
[AlgebraicGeometry.IsAffineHom f]
(U : ↑Y.affineOpens)

↑(AlgebraicGeometry.affinePreimage f U) = (TopologicalSpace.Opens.map f.val.base).obj ↑U


theorem mul_def {n} {x y : BitVec n} : x * y = (ofFin <| x.toFin * y.toFin)


/-- Rewrite `s.pimage f` in terms of `Finset.filter`, `Finset.attach`, and `Finset.image`. -/
theorem pimage_eq_image_filter : s.pimage f =
    (filter (fun x => (f x).Dom) s).attach.image
      fun x : { x // x ∈ filter (fun x => (f x).Dom) s } =>
        (f x).get (mem_filter.mp x.coe_prop).2

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
{f : α →. β}
[(x : α) → Decidable (f x).Dom]
{s : Finset α}

Finset.pimage f s = Finset.image (fun x => (f ↑x).get ⋯) (Finset.filter (fun x => (f x).Dom) s).attach


@[simp]
theorem toSubmodule_eq_top {S : NonUnitalSubalgebra R A} : S.toSubmodule = ⊤ ↔ S = ⊤

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
{S : NonUnitalSubalgebra R A}


theorem condIndepSet_empty_left (s : Set Ω) : CondIndepSet m' hm' ∅ s μ

{Ω : Type u_1}
{m' mΩ : MeasurableSpace Ω}
[StandardBorelSpace Ω]
[Nonempty Ω]
{hm' : m' ≤ mΩ}
{μ : MeasureTheory.Measure Ω}
[MeasureTheory.IsFiniteMeasure μ]
(s : Set Ω)

ProbabilityTheory.CondIndepSet m' hm' ∅ s μ


theorem NormOneClass.nontrivial (α : Type*) [SeminormedAddCommGroup α] [One α] [NormOneClass α] :
    Nontrivial α

(α : Type u_5)
[SeminormedAddCommGroup α]
[One α]
[NormOneClass α]


@[simp]
protected theorem tsum_top [Nonempty α] : ∑' _ : α, ∞ = ∞


@[to_additive]
theorem comap_lt_comap_of_surjective {f : G →* N} {K L : Subgroup N} (hf : Function.Surjective f) :
    K.comap f < L.comap f ↔ K < L

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
{f : G →* N}
{K L : Subgroup N}
(hf : Function.Surjective ⇑f)

Subgroup.comap f K < Subgroup.comap f L ↔ K < L


/-- Implementation of `ShrinkHoms.equivalence`. -/
@[simps]
noncomputable def inverse : ShrinkHoms C ⥤ C

[CategoryTheory.LocallySmall.{w, v, u} C]

(CategoryTheory.ShrinkHoms.inverse C).obj X = X.fromShrinkHoms


@[to_additive]
theorem mem_closure_pair {x y z : C} :
    z ∈ closure ({x, y} : Set C) ↔ ∃ m n : ℤ, x ^ m * y ^ n = z

{C : Type u_6}
[CommGroup C]
{x y z : C}

z ∈ Subgroup.closure {x, y} ↔ ∃ m n, x ^ m * y ^ n = z


theorem coe_toGL (A : unitaryGroup n α) : (toGL A).1 = toLin' A

{n : Type u}
[DecidableEq n]
[Fintype n]
{α : Type v}
[CommRing α]
[StarRing α]
(A : ↥(Matrix.unitaryGroup n α))

↑(Matrix.UnitaryGroup.toGL A) = Matrix.UnitaryGroup.toLin' A


@[to_additive] lemma MonovaryOn.div_right (h₁ : MonovaryOn f g₁ s) (h₂ : AntivaryOn f g₂ s) :
    MonovaryOn f (g₁ / g₂) s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedAddCommGroup α]
[LinearOrderedAddCommGroup β]
{s : Set ι}
{f : ι → α}
{g₁ g₂ : ι → β}
(h₁ : MonovaryOn f g₁ s)
(h₂ : AntivaryOn f g₂ s)


theorem trailingDegree_eq_iff_natTrailingDegree_eq_of_pos {p : R[X]} {n : ℕ} (hn : n ≠ 0) :
    p.trailingDegree = n ↔ p.natTrailingDegree = n

{R : Type u}
[Semiring R]
{p : R[X]}
{n : ℕ}
(hn : n ≠ 0)

p.trailingDegree = ↑n ↔ p.natTrailingDegree = n


@[simp]
theorem powersetCard_self (s : Finset α) : powersetCard s.card s = {s}


theorem of_comp_iff (f : X → Y) (hg : OpenEmbedding g) :
    OpenEmbedding (g ∘ f) ↔ OpenEmbedding f

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
{g : Y → Z}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(f : X → Y)
(hg : OpenEmbedding g)


theorem Convex.neg (hs : Convex 𝕜 s) : Convex 𝕜 (-s)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
(hs : Convex 𝕜 s)


lemma even_card_aut_of_not_isUnramifiedIn [IsGalois k K] [FiniteDimensional k K]
    {w : InfinitePlace k} (hw : ¬ w.IsUnramifiedIn K) :
    Even (Fintype.card <| K ≃ₐ[k] K)

(hw : ¬NumberField.InfinitePlace.IsUnramifiedIn K w)


/--
The `Functor` typeclass only contains the operations of a functor.
`LawfulFunctor` further asserts that these operations satisfy the laws of a functor,
including the preservation of the identity and composition laws:
```
id <$> x = x
(h ∘ g) <$> x = h <$> g <$> x
```
-/
class LawfulFunctor (f : Type u → Type v) [Functor f] : Prop where
  map_const          : (Functor.mapConst : α → f β → f α) = Functor.map ∘ const β
  id_map   (x : f α) : id <$> x = x
  comp_map (g : α → β) (h : β → γ) (x : f α) : (h ∘ g) <$> x = h <$> g <$> x

{f : Type u → Type v}
[Functor f]
[self : LawfulFunctor f]
{α β : Type u}

Functor.mapConst = Functor.map ∘ Function.const β


theorem add_lf_add_left : ∀ {b c : Game} (_ : b ⧏ c) (a), (a + b : Game) ⧏ a + c

b.LF c → ∀ (a : SetTheory.Game), (a + b).LF (a + c)


/-- If `x * y = a * p ^ n` where `p` is prime, then `x` and `y` can both be written
  as the product of a power of `p` and a divisor of `a`. -/
theorem mul_eq_mul_prime_pow {x y a p : R} {n : ℕ} (hp : Prime p) (hx : x * y = a * p ^ n) :
    ∃ (i j : ℕ) (b c : R), i + j = n ∧ a = b * c ∧ x = b * p ^ i ∧ y = c * p ^ j

{R : Type u_1}
[CancelCommMonoidWithZero R]
{x y a p : R}
{n : ℕ}
(hp : Prime p)
(hx : x * y = a * p ^ n)

∃ i j b c, i + j = n ∧ a = b * c ∧ x = b * p ^ i ∧ y = c * p ^ j


/-- If `s` is a dense set in a monoid `M`, `Submonoid.closure s = ⊤`, then in order to prove that
some predicate `p` holds for all `x : M` it suffices to verify `p x` for `x ∈ s`, verify `p 1`,
and verify that `p x` and `p y` imply `p (x * y)`. -/
@[to_additive (attr := elab_as_elim)
      "If `s` is a dense set in an additive monoid `M`, `AddSubmonoid.closure s = ⊤`, then in
      order to prove that some predicate `p` holds for all `x : M` it suffices to verify `p x` for
      `x ∈ s`, verify `p 0`, and verify that `p x` and `p y` imply `p (x + y)`."]
theorem dense_induction {p : M → Prop} (x : M) {s : Set M} (hs : closure s = ⊤)
    (mem : ∀ x ∈ s, p x)
    (one : p 1) (mul : ∀ x y, p x → p y → p (x * y)) : p x

(mul : ∀ (x y : M), p x → p y → p (x + y))


lemma right_distrib_of_nonneg {a b c : EReal} (ha : 0 ≤ a) (hb : 0 ≤ b) :
    (a + b) * c = a * c + b * c


@[simp, nolint simpNF]
theorem L1.integral_of_fun_eq_integral {f : α → G} (hf : Integrable f μ) :
    ∫ a, (hf.toL1 f) a ∂μ = ∫ a, f a ∂μ

{α : Type u_1}
{G : Type u_5}
[NormedAddCommGroup G]
[NormedSpace ℝ G]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → G}
(hf : MeasureTheory.Integrable f μ)

∫ (a : α), ↑↑(MeasureTheory.Integrable.toL1 f hf) a ∂μ = ∫ (a : α), f a ∂μ


@[to_additive]
theorem nnnorm_le_nnnorm_add_nnnorm_div (a b : E) : ‖b‖₊ ≤ ‖a‖₊ + ‖a / b‖₊

{E : Type u_6}
[SeminormedGroup E]
(a b : E)

‖b‖₊ ≤ ‖a‖₊ + ‖a / b‖₊


{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R A)


@[trans]
theorem EventuallyEq.trans_le (H₁ : f =ᶠ[l] g) (H₂ : g ≤ᶠ[l] h) : f ≤ᶠ[l] h

{α : Type u}
{β : Type v}
[Preorder β]
{l : Filter α}
{f g h : α → β}
(H₁ : f =ᶠ[l] g)
(H₂ : g ≤ᶠ[l] h)


@[to_additive (attr := simp)]
theorem con_ker_mk : Con.ker mk = coprodCon M N

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

AddCon.ker AddMonoid.Coprod.mk = AddMonoid.coprodCon M N


theorem iterate_iterate (h : Commute f g) (m n : ℕ) : Commute f^[m] g^[n]

{α : Type u}
{f g : α → α}
(h : Function.Commute f g)
(m n : ℕ)


lemma «exists» {p : Sym α n → Prop} :
    (∃ s : Sym α n, p s) ↔ ∃ (s : Multiset α) (hs : Multiset.card s = n), p (Sym.mk s hs)

{α : Type u_1}
{n : ℕ}
{p : Sym α n → Prop}

(∃ s, p s) ↔ ∃ s, ∃ (hs : Multiset.card s = n), p (Sym.mk s hs)


lemma equalizerConditionMap_iff_nonempty_isLimit (P : Cᵒᵖ ⥤ D) ⦃X B : C⦄ (π : X ⟶ B)
    [HasPullback π π] : SingleEqualizerCondition P π ↔
      Nonempty (IsLimit (P.mapCone
        (Sieve.ofArrows (fun (_ : Unit) => X) (fun _ => π)).arrows.cocone.op))

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
(P : CategoryTheory.Functor Cᵒᵖ D)
⦃X B : C⦄
(π : X ⟶ B)
[CategoryTheory.Limits.HasPullback π π]

CategoryTheory.regularTopology.SingleEqualizerCondition P π ↔
  Nonempty
    (CategoryTheory.Limits.IsLimit (P.mapCone (CategoryTheory.Sieve.ofArrows (fun x => X) fun x => π).arrows.cocone.op))


@[to_additive min_add_min_le_min_add_add]
theorem min_mul_min_le_min_mul_mul' : min a c * min b d ≤ min (a * b) (c * d)

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

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


@[aesop safe 20 (rule_sets := [Measurable])]
protected theorem inf [SemilatticeInf β] [ContinuousInf β] (hf : FinStronglyMeasurable f μ)
    (hg : FinStronglyMeasurable g μ) : FinStronglyMeasurable (f ⊓ g) μ

(hf : MeasureTheory.FinStronglyMeasurable f μ)

(hg : MeasureTheory.FinStronglyMeasurable g μ)

MeasureTheory.FinStronglyMeasurable (f ⊓ g) μ


lemma schnirelmannDensity_setOf_prime : schnirelmannDensity (setOf Nat.Prime) = 0


/-- This is really a statement about topological algebra isomorphisms,
but we don't have those, so we use the clunky approach of talking about
an algebra homomorphism, and a separate homeomorphism,
along with a witness that as functions they are the same.
-/
theorem Subalgebra.topologicalClosure_comap_homeomorph (s : Subalgebra R A) {B : Type*}
    [TopologicalSpace B] [Ring B] [TopologicalRing B] [Algebra R B] (f : B →ₐ[R] A) (f' : B ≃ₜ A)
    (w : (f : B → A) = f') : s.topologicalClosure.comap f = (s.comap f).topologicalClosure

{R : Type u_1}
[CommSemiring R]
{A : Type u}
[TopologicalSpace A]
[Semiring A]
[Algebra R A]
[TopologicalSemiring A]
(s : Subalgebra R A)
{B : Type u_2}
[TopologicalSpace B]
[Ring B]
[TopologicalRing B]
[Algebra R B]
(f : B →ₐ[R] A)
(f' : B ≃ₜ A)
(w : ⇑f = ⇑f')

Subalgebra.comap f s.topologicalClosure = (Subalgebra.comap f s).topologicalClosure


theorem eval_add : eval f (p + q) = eval f p + eval f q

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
{p q : MvPolynomial σ R}
{f : σ → R}

(MvPolynomial.eval f) (p + q) = (MvPolynomial.eval f) p + (MvPolynomial.eval f) q


theorem filter_le (π : Prepartition I) (p : Box ι → Prop) : π.filter p ≤ π

{ι : Type u_1}
{I : BoxIntegral.Box ι}
(π : BoxIntegral.Prepartition I)
(p : BoxIntegral.Box ι → Prop)


/-- The category of cocones on `F` is just the comma category `(F ↓ Δ)`, where `Δ` is the constant
    functor. -/
@[simps! (config := { notRecursive := [`PLift, `ULift] })]
def Cocone.equivStructuredArrow (F : J ⥤ C) : Cocone F ≌ StructuredArrow F (const J)

(X : CategoryTheory.StructuredArrow F (CategoryTheory.Functor.const J))

((CategoryTheory.Limits.Cocone.equivStructuredArrow F).counitIso.inv.app X).right =
  CategoryTheory.CategoryStruct.id X.right


nonrec theorem sinh_add : sinh (x + y) = sinh x * cosh y + cosh x * sinh y

Real.sinh (x + y) = Real.sinh x * Real.cosh y + Real.cosh x * Real.sinh y


theorem coe_sub_iff_le {a b : Fin n} : (↑(a - b) : Nat) = a - b ↔ b ≤ a


@[aesop 10% apply]
lemma IsSelfAdjoint.of_nonneg {x : R} (hx : 0 ≤ x) : IsSelfAdjoint x

{R : Type u}
[NonUnitalSemiring R]
[PartialOrder R]
[StarRing R]
[StarOrderedRing R]
{x : R}
(hx : 0 ≤ x)


@[simp] theorem size_range {n : Nat} : (range n).size = n


theorem rfind_min' {p : ℕ → Bool} {m : ℕ} (pm : p m) : ∃ n ∈ rfind p, n ≤ m

{p : ℕ → Bool}
{m : ℕ}
(pm : p m = true)


theorem RingHom.isIntegralElem_one : f.IsIntegralElem 1

{R : Type u_1}
{B : Type u_3}
[CommRing R]
[Ring B]
(f : R →+* B)


theorem convexHull_list_sum (l : List (Set E)) : convexHull R l.sum = (l.map <| convexHull R).sum

{R : Type u_1}
{E : Type u_3}
[LinearOrderedField R]
[AddCommGroup E]
[Module R E]
(l : List (Set E))

(convexHull R) l.sum = (List.map (⇑(convexHull R)) l).sum


/-- Pajor's variant of the **Sauer-Shelah lemma**. -/
lemma card_le_card_shatterer (𝒜 : Finset (Finset α)) : 𝒜.card ≤ 𝒜.shatterer.card

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


theorem EuclideanSpace.sphere_zero_eq {n : Type*} [Fintype n] (r : ℝ) (hr : 0 ≤ r) :
    Metric.sphere (0 : EuclideanSpace ℝ n) r = {x | ∑ i, x i ^ 2 = r ^ 2}

{n : Type u_8}
[Fintype n]
(r : ℝ)
(hr : 0 ≤ r)

Metric.sphere 0 r = {x | ∑ i : n, x i ^ 2 = r ^ 2}


@[to_additive (attr := simp)]
theorem homQuotientZPowOfHom_comp :
    homQuotientZPowOfHom (f.comp g) n =
      (homQuotientZPowOfHom f n).comp (homQuotientZPowOfHom g n)

{A B : Type u}
[AddCommGroup A]
[AddCommGroup B]
(f : A →+ B)
(g : B →+ A)
(n : ℤ)

QuotientAddGroup.homQuotientZSMulOfHom (f.comp g) n =
  (QuotientAddGroup.homQuotientZSMulOfHom f n).comp (QuotientAddGroup.homQuotientZSMulOfHom g n)


@[simp, nolint simpNF]
protected lemma sub_pos : 0 < a - b ↔ b < a


/-- `AbsoluteValue R S` is the type of absolute values on `R` mapping to `S`:
the maps that preserve `*`, are nonnegative, positive definite and satisfy the triangle equality. -/
structure AbsoluteValue (R S : Type*) [Semiring R] [OrderedSemiring S] extends R →ₙ* S where
  /-- The absolute value is nonnegative -/
  nonneg' : ∀ x, 0 ≤ toFun x
  /-- The absolute value is positive definitive -/
  eq_zero' : ∀ x, toFun x = 0 ↔ x = 0
  /-- The absolute value satisfies the triangle inequality -/
  add_le' : ∀ x y, toFun (x + y) ≤ toFun x + toFun y

{R : Type u_5}
{S : Type u_6}
[Semiring R]
[OrderedSemiring S]
(self : AbsoluteValue R S)
(x : R)


protected theorem le_of_not_le {a b : Int} : ¬ a ≤ b → b ≤ a

¬a ≤ b → b ≤ a


@[to_additive (attr := simp)]
lemma map_comp_zpow' [DivInvMonoid G] [DivInvMonoid H] [MonoidHomClass F G H] (f : F)
    (hf : ∀ x : G, f x⁻¹ = (f x)⁻¹) (g : ι → G) (n : ℤ) : f ∘ (g ^ n) = f ∘ g ^ n

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


theorem mk_injective (s : Finset ι) : Function.Injective (@mk ι β _ _ s)

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


theorem exists_effectiveEpiFamily_iff_mem_induced (X : C) (S : Sieve X) :
    (∃ (α : Type) (_ : Finite α) (Y : α → C) (π : (a : α) → (Y a ⟶ X)),
      EffectiveEpiFamily Y π ∧ (∀ a : α, (S.arrows) (π a)) ) ↔
    (S ∈ F.inducedTopology (coherentTopology _) X)

(∃ α, ∃ (_ : Finite α), ∃ Y π, CategoryTheory.EffectiveEpiFamily Y π ∧ ∀ (a : α), S.arrows (π a)) ↔
  S ∈ (F.inducedTopology (CategoryTheory.coherentTopology D)).sieves X


/-- If there is a nonzero vector and every other vector is a multiple of it,
then the module has dimension one. -/
theorem rank_eq_one (v : M) (n : v ≠ 0) (h : ∀ w : M, ∃ c : R, c • v = w) :
    Module.rank R M = 1

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[NoZeroSMulDivisors R M]
[StrongRankCondition R]
(v : M)
(n : v ≠ 0)
(h : ∀ (w : M), ∃ c, c • v = w)


lemma norm_natCast_cpow_of_re_ne_zero (n : ℕ) {s : ℂ} (hs : s.re ≠ 0) :
    ‖(n : ℂ) ^ s‖ = (n : ℝ) ^ (s.re)


lemma RightHomologyMapData.quasiIso_map_iff
    [(F.mapShortComplex.obj S₁).HasHomology]
    [(F.mapShortComplex.obj S₂).HasHomology]
    [hr₁.IsPreservedBy F] [hr₂.IsPreservedBy F] :
    QuasiIso (F.mapShortComplex.map φ) ↔ IsIso (F.map ψr.φH)

(ψr : CategoryTheory.ShortComplex.RightHomologyMapData φ hr₁ hr₂)

CategoryTheory.ShortComplex.QuasiIso (F.mapShortComplex.map φ) ↔ CategoryTheory.IsIso (F.map ψr.φH)


@[simp]
theorem mk_toGerm (f : α → β) (hf) : (mk f hf : α →ₘ[μ] β).toGerm = f

(hf : MeasureTheory.AEStronglyMeasurable f μ)

(MeasureTheory.AEEqFun.mk f hf).toGerm = ↑f


theorem indep_of_indep_of_le_right (h_indep : Indep m₁ m₂ μ) (h32 : m₃ ≤ m₂) :
    Indep m₁ m₃ μ

(h_indep : ProbabilityTheory.Indep m₁ m₂ μ)


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

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


/-- If `p` is a prime factor of `b` then the power of `p` in `b` is the same that in `a * b`,
for any `a` coprime to `b`. -/
theorem factorization_eq_of_coprime_right {p a b : ℕ} (hab : Coprime a b)
    (hpb : p ∈ b.primeFactorsList) : (a * b).factorization p = b.factorization p

{p a b : ℕ}
(hab : a.Coprime b)
(hpb : p ∈ b.primeFactorsList)


@[simp]
theorem toPartialHomeomorph_source (hf : ApproximatesLinearOn f (f' : E →L[𝕜] F) s c)
    (hc : Subsingleton E ∨ c < N⁻¹) (hs : IsOpen s) :
    (hf.toPartialHomeomorph f s hc hs).source = s

(hc : Subsingleton E ∨ c < ‖↑f'.symm‖₊⁻¹)

(ApproximatesLinearOn.toPartialHomeomorph f s hf hc hs).source = s


@[to_additive]
theorem inclusion_right (h : H ≤ K) (x : K) (hx : (x : G) ∈ H) : inclusion h ⟨x, hx⟩ = x

{G : Type u_1}
[AddGroup G]
{S : Type u_6}
{H K : S}
[SetLike S G]
[AddSubgroupClass S G]
(h : H ≤ K)
(x : ↥K)
(hx : ↑x ∈ H)

(AddSubgroupClass.inclusion h) ⟨↑x, hx⟩ = x


@[simp] theorem coe_false_iff_false : ∀(a b : Bool), (a = false ↔ b = false) ↔ (!a) = (!b)


/-- Seminorm-balls are convex. -/
theorem convex_ball : Convex ℝ (ball p x r)

{𝕜 : Type u_3}
{E : Type u_7}
[NormedField 𝕜]
[AddCommGroup E]
[NormedSpace ℝ 𝕜]
[Module 𝕜 E]
[Module ℝ E]
[IsScalarTower ℝ 𝕜 E]
(p : Seminorm 𝕜 E)
(x : E)
(r : ℝ)


lemma mem_closure_of_mem' (M : Matroid α) (heX : e ∈ X) (h : e ∈ M.E := by aesop_mat) :
    e ∈ M.closure X

{α : Type u_2}
{X : Set α}
{e : α}
(M : Matroid α)
(heX : e ∈ X)
(h : e ∈ M.E := by aesop_mat)


@[simp]
theorem mapRingHom_comp [Semiring T] (f : S →+* T) (g : R →+* S) :
    (mapRingHom f).comp (mapRingHom g) = mapRingHom (f.comp g)

{R : Type u}
{S : Type v}
{T : Type w}
[Semiring R]
[Semiring S]
[Semiring T]
(f : S →+* T)
(g : R →+* S)

(Polynomial.mapRingHom f).comp (Polynomial.mapRingHom g) = Polynomial.mapRingHom (f.comp g)


@[simp] lemma unmop_associator (X Y Z : Cᴹᵒᵖ) :
    (α_ X Y Z).unmop = (α_ (unmop Z) (unmop Y) (unmop X)).symm

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

(CategoryTheory.MonoidalCategory.associator X Y Z).unmop =
  (CategoryTheory.MonoidalCategory.associator Z.unmop Y.unmop X.unmop).symm


theorem haveLebesgueDecomposition_withDensity (μ : Measure α) {f : α → ℝ≥0∞} (hf : Measurable f) :
    (μ.withDensity f).HaveLebesgueDecomposition μ

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


theorem le_einfsep {d} (h : ∀ x ∈ s, ∀ y ∈ s, x ≠ y → d ≤ edist x y) : d ≤ s.einfsep


@[simp]
theorem choose_succ_self (n : ℕ) : choose n (succ n) = 0


@[simp]
theorem Subalgebra.rank_toSubmodule (S : Subalgebra F E) :
    Module.rank F (Subalgebra.toSubmodule S) = Module.rank F S

{F : Type u_2}
{E : Type u_3}
[CommRing F]
[Ring E]
[Algebra F E]
(S : Subalgebra F E)

Module.rank F ↥(Subalgebra.toSubmodule S) = Module.rank F ↥S


theorem sub {x y : PGame} (ox : Numeric x) (oy : Numeric y) : Numeric (x - y)

{x y : SetTheory.PGame}
(ox : x.Numeric)
(oy : y.Numeric)


theorem prod_primeFactors_dvd (n : ℕ) : ∏ p ∈ n.primeFactors, p ∣ n


/-- The composition of two lax monoidal functors is again lax monoidal. -/
@[simps]
def comp : LaxMonoidalFunctor.{v₁, v₃} C E

(F : CategoryTheory.LaxMonoidalFunctor C D)

(G : CategoryTheory.LaxMonoidalFunctor D E)


@[simp]
theorem coe_toPerm {f : α → α} (h : Involutive f) : (h.toPerm f : α → α) = f

{α : Sort u_1}
{f : α → α}
(h : Function.Involutive f)


theorem dvd_antisymm {a b : Int} (H1 : 0 ≤ a) (H2 : 0 ≤ b) : a ∣ b → b ∣ a → a = b


/-- If a function `f : 𝕜 → E` has two power series representations at `x`, then the given radii in
which convergence is guaranteed may be interchanged. This can be useful when the formal multilinear
series in one representation has a particularly nice form, but the other has a larger radius. -/
theorem HasFPowerSeriesOnBall.exchange_radius {p₁ p₂ : FormalMultilinearSeries 𝕜 𝕜 E} {f : 𝕜 → E}
    {r₁ r₂ : ℝ≥0∞} {x : 𝕜} (h₁ : HasFPowerSeriesOnBall f p₁ x r₁)
    (h₂ : HasFPowerSeriesOnBall f p₂ x r₂) : HasFPowerSeriesOnBall f p₁ x r₂

{𝕜 : Type u_1}
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{p₁ p₂ : FormalMultilinearSeries 𝕜 𝕜 E}
{f : 𝕜 → E}
{r₁ r₂ : ℝ≥0∞}
{x : 𝕜}
(h₁ : HasFPowerSeriesOnBall f p₁ x r₁)
(h₂ : HasFPowerSeriesOnBall f p₂ x r₂)


theorem exists_sq_add_sq_add_one_eq_mul (p : ℕ) [hp : Fact p.Prime] :
    ∃ (a b k : ℕ), 0 < k ∧ k < p ∧ a ^ 2 + b ^ 2 + 1 = k * p

∃ a b k, 0 < k ∧ k < p ∧ a ^ 2 + b ^ 2 + 1 = k * p


lemma setLIntegral_condKernel (hf : Measurable f) (a : α) {s : Set β}
    (hs : MeasurableSet s) {t : Set Ω} (ht : MeasurableSet t) :
    ∫⁻ b in s, ∫⁻ ω in t, f (b, ω) ∂(Kernel.condKernel κ (a, b)) ∂(Kernel.fst κ a)
      = ∫⁻ x in s ×ˢ t, f x ∂(κ a)

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

{f : β × Ω → ℝ≥0∞}

∫⁻ (b : β) in s, ∫⁻ (ω : Ω) in t, f (b, ω) ∂κ.condKernel (a, b) ∂κ.fst a = ∫⁻ (x : β × Ω) in s ×ˢ t, f x ∂κ a


theorem det_one_sub_mul_comm (A : Matrix m n α) (B : Matrix n m α) :
    det (1 - A * B) = det (1 - B * A)

{m : Type u_2}
{n : Type u_3}
{α : Type u_4}
[Fintype m]
[Fintype n]
[DecidableEq m]
[DecidableEq n]
[CommRing α]
(A : Matrix m n α)
(B : Matrix n m α)


theorem integral_eq_setToFun (f : α → E) :
    ∫ a, f a ∂μ = setToFun μ (weightedSMul μ) (dominatedFinMeasAdditive_weightedSMul μ) f

{α : Type u_1}
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[hE : CompleteSpace E]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(f : α → E)

∫ (a : α), f a ∂μ = MeasureTheory.setToFun μ (MeasureTheory.weightedSMul μ) ⋯ f


theorem foldr_push (f : α → β → β) (init : β) (arr : Array α) (a : α) :
    (arr.push a).foldr f init = arr.foldr f (f a init)

{α : Type u_1}
{β : Type u_2}
(f : α → β → β)
(init : β)
(arr : Array α)
(a : α)

Array.foldr f init (arr.push a) (arr.push a).size = Array.foldr f (f a init) arr arr.size


theorem EqvGen.is_equivalence : Equivalence (@EqvGen α r)


/-- The strong pigeonhole principle for finitely many pigeons and pigeonholes.  Given a function `f`
between finite types `α` and `β` and a number `b` such that `card α ≤ card β • b`, there exists an
element `y : β` such that its preimage has at most `b` elements.
See also `Fintype.exists_card_fiber_lt_of_card_lt_nsmul` for a stronger statement. -/
theorem exists_card_fiber_le_of_card_le_nsmul [Nonempty β] (hb : ↑(card α) ≤ card β • b) :
    ∃ y : β, ↑(univ.filter fun x => f x = y).card ≤ b

(hb : ↑(Fintype.card α) ≤ Fintype.card β • b)

∃ y, ↑(Finset.filter (fun x => f x = y) Finset.univ).card ≤ b


private theorem ghostFun_pow (m : ℕ) : ghostFun (x ^ m) = ghostFun x ^ m

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

WittVector.ghostFun (x ^ m) = WittVector.ghostFun x ^ m


theorem lowerSemicontinuous_tsum {f : ι → α → ℝ≥0∞} (h : ∀ i, LowerSemicontinuous (f i)) :
    LowerSemicontinuous fun x' => ∑' i, f i x'

{f : ι → α → ℝ≥0∞}

(h : ∀ (i : ι), LowerSemicontinuous (f i))

LowerSemicontinuous fun x' => ∑' (i : ι), f i x'


@[gcongr]
theorem floor_le_floor : ∀ x y : α, x ≤ y → ⌊x⌋₊ ≤ ⌊y⌋₊

{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
(x y : α)

x ≤ y → ⌊x⌋₊ ≤ ⌊y⌋₊


theorem tfae_modEq :
    TFAE
      [a ≡ b [PMOD p], ∀ z : ℤ, b - z • p ∉ Set.Ioo a (a + p), toIcoMod hp a b ≠ toIocMod hp a b,
        toIcoMod hp a b + p = toIocMod hp a b]

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

[a ≡ b [PMOD p], ∀ (z : ℤ), b - z • p ∉ Set.Ioo a (a + p), toIcoMod hp a b ≠ toIocMod hp a b,
    toIcoMod hp a b + p = toIocMod hp a b].TFAE


theorem lift_ι_apply (x : L) : lift R f (ι R x) = f x

(R : Type u₁)
{L : Type u₂}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
{A : Type u₃}
[Ring A]
[Algebra R A]
(f : L →ₗ⁅R⁆ A)
(x : L)

((UniversalEnvelopingAlgebra.lift R) f) ((UniversalEnvelopingAlgebra.ι R) x) = f x


/-- Extract the isomorphism between the right objects from an isomorphism in the comma category. -/
@[simps!]
def rightIso {X Y : Comma L₁ R₁} (α : X ≅ Y) : X.right ≅ Y.right

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
{L₁ : CategoryTheory.Functor A T}
{R₁ : CategoryTheory.Functor B T}
{X Y : CategoryTheory.Comma L₁ R₁}
(α : X ≅ Y)

(CategoryTheory.Comma.rightIso α).inv = α.inv.right


@[simp, norm_cast] lemma up_ratCast [RatCast α] (q : ℚ) : up (q : α) = q


@[to_additive]
theorem symm_apply_eq (e : M ≃* N) {x y} : e.symm x = y ↔ x = e y

{M : Type u_6}
{N : Type u_7}
[Mul M]
[Mul N]
(e : M ≃* N)
{x : N}
{y : M}


lemma one_succAbove_zero {n : ℕ} : (1 : Fin (n + 2)).succAbove 0 = 0


theorem coe_sSup {s : Set ℝ≥0} : BddAbove s → (↑(sSup s) : ℝ≥0∞) = ⨆ a ∈ s, ↑a


/-- A base angle of an isosceles triangle with apex at the center of a circle is acute. -/
theorem abs_oangle_center_right_toReal_lt_pi_div_two {s : Sphere P} {p₁ p₂ : P} (hp₁ : p₁ ∈ s)
    (hp₂ : p₂ ∈ s) : |(∡ p₂ p₁ s.center).toReal| < π / 2

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


/-- Let `f` be a function continuous on a convex (or, equivalently, connected) subset `D`
of the real line. If `f` is differentiable on the interior of `D` and `f' ≤ C`, then
`f` grows at most as fast as `C * x` on `D`, i.e., `f y - f x ≤ C * (y - x)` whenever `x, y ∈ D`,
`x ≤ y`. -/
theorem Convex.image_sub_le_mul_sub_of_deriv_le {D : Set ℝ} (hD : Convex ℝ D) {f : ℝ → ℝ}
    (hf : ContinuousOn f D) (hf' : DifferentiableOn ℝ f (interior D)) {C}
    (le_hf' : ∀ x ∈ interior D, deriv f x ≤ C) (x : ℝ) (hx : x ∈ D) (y : ℝ) (hy : y ∈ D)
    (hxy : x ≤ y) : f y - f x ≤ C * (y - x)


theorem X_pow_sub_X_sub_one_irreducible_rat (hn1 : n ≠ 1) : Irreducible (X ^ n - X - 1 : ℚ[X])

Irreducible (Polynomial.X ^ n - Polynomial.X - 1)


theorem associator_naturality {X₁ X₂ X₃ Y₁ Y₂ Y₃ : Dial C}
    (f₁ : X₁ ⟶ Y₁) (f₂ : X₂ ⟶ Y₂) (f₃ : X₃ ⟶ Y₃) :
    tensorHom (tensorHom f₁ f₂) f₃ ≫ (associator Y₁ Y₂ Y₃).hom =
    (associator X₁ X₂ X₃).hom ≫ tensorHom f₁ (tensorHom f₂ f₃)

{X₁ X₂ X₃ Y₁ Y₂ Y₃ : CategoryTheory.Dial C}

CategoryTheory.CategoryStruct.comp (CategoryTheory.Dial.tensorHom (CategoryTheory.Dial.tensorHom f₁ f₂) f₃)
    (Y₁.associator Y₂ Y₃).hom =
  CategoryTheory.CategoryStruct.comp (X₁.associator X₂ X₃).hom
    (CategoryTheory.Dial.tensorHom f₁ (CategoryTheory.Dial.tensorHom f₂ f₃))


@[nolint unusedHavesSuffices]
theorem toPGame_moveLeft_hEq {o : Ordinal} :
    have : IsWellOrder o.out.α (· < ·) := isWellOrder_out_lt o
    HEq o.toPGame.moveLeft fun x : o.out.α => (typein (· < ·) x).toPGame

let_fun this := ⋯;
HEq o.toPGame.moveLeft fun x => (Ordinal.typein (fun x x_1 => x < x_1) x).toPGame


protected lemma existsUnique_congr (h : ∀ a, p a ↔ q (e a)) : (∃! a, p a) ↔ ∃! b, q b

{α : Sort u}
{β : Sort v}
{p : α → Prop}
{q : β → Prop}
(e : α ≃ β)
(h : ∀ (a : α), p a ↔ q (e a))


@[simp] lemma mul_neg_one_pow_eq_zero_iff : a * (-1) ^ n = 0 ↔ a = 0


/-- A sugroupoid of `C` consists of a choice of arrows for each pair of vertices, closed
under composition and inverses.
-/
@[ext]
structure Subgroupoid (C : Type u) [Groupoid C] where
  arrows : ∀ c d : C, Set (c ⟶ d)
  protected inv : ∀ {c d} {p : c ⟶ d}, p ∈ arrows c d → Groupoid.inv p ∈ arrows d c
  protected mul : ∀ {c d e} {p}, p ∈ arrows c d → ∀ {q}, q ∈ arrows d e → p ≫ q ∈ arrows c e

{C : Type u}
[CategoryTheory.Groupoid C]
(self : CategoryTheory.Subgroupoid C)
{c d e : C}
{p : c ⟶ d}

p ∈ self.arrows c d → ∀ {q : d ⟶ e}, q ∈ self.arrows d e → CategoryTheory.CategoryStruct.comp p q ∈ self.arrows c e


@[simp]
theorem lineMap_vsub_left (p₀ p₁ : P1) (c : k) : lineMap p₀ p₁ c -ᵥ p₀ = c • (p₁ -ᵥ p₀)

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
(p₀ p₁ : P1)
(c : k)

(AffineMap.lineMap p₀ p₁) c -ᵥ p₀ = c • (p₁ -ᵥ p₀)


/-- The characteristic of a finite ring cannot be zero. -/
theorem char_ne_zero_of_finite (p : ℕ) [CharP R p] [Finite R] : p ≠ 0

(R : Type u_1)
[NonAssocRing R]
(p : ℕ)
[CharP R p]
[Finite R]


theorem charP_of_injective_algebraMap' (R A : Type*) [Field R] [Semiring A] [Algebra R A]
    [Nontrivial A] (p : ℕ) [CharP R p] : CharP A p

(R : Type u_1)
(A : Type u_2)
[Field R]
[Semiring A]
[Algebra R A]
[Nontrivial A]
(p : ℕ)
[CharP R p]


@[simp, norm_cast]
theorem castNum_shiftRight (m : Num) (n : Nat) : ↑(m >>> n) = (m : ℕ) >>> (n : ℕ)


theorem preimage_ae_eq {s t : Set β} (hf : QuasiMeasurePreserving f μa μb) (h : s =ᵐ[μb] t) :
    f ⁻¹' s =ᵐ[μa] f ⁻¹' t

(hf : MeasureTheory.Measure.QuasiMeasurePreserving f μa μb)


theorem Module.Free.of_basis {ι : Type w} (b : Basis ι R M) : Module.Free R M

{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{ι : Type w}
(b : Basis ι R M)


/-- The separable degree of a non-zero polynomial is equal to its degree if and only if
it is separable. -/
theorem natSepDegree_eq_natDegree_iff (hf : f ≠ 0) :
    f.natSepDegree = f.natDegree ↔ f.Separable

{F : Type u}
[Field F]
(f : F[X])
(hf : f ≠ 0)


/-- The distinguished triangle in the derived category associated to a short
exact sequence of cochain complexes. -/
@[simps!]
noncomputable def triangleOfSES : Triangle (DerivedCategory C)

{S : CategoryTheory.ShortComplex (CochainComplex C ℤ)}

(DerivedCategory.triangleOfSES hS).mor₂ = DerivedCategory.Q.map S.g


@[to_additive]
theorem OneHom.cancel_left [One M] [One N] [One P] {g : OneHom N P} {f₁ f₂ : OneHom M N}
    (hg : Function.Injective g) : g.comp f₁ = g.comp f₂ ↔ f₁ = f₂

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


theorem bddAbove_image (f : Cardinal.{u} → Cardinal.{max u v}) {s : Set Cardinal.{u}}
    (hs : BddAbove s) : BddAbove (f '' s)


@[to_additive]
theorem lt_mul_of_one_le_of_lt [CovariantClass α α (swap (· * ·)) (· ≤ ·)] {a b c : α} (ha : 1 ≤ a)
    (hbc : b < c) :
    b < a * c

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


/-- The isomorphism between `(X.1, X.2)` and `X`. -/
@[simps]
def prod.etaIso (X : C × D) : (X.1, X.2) ≅ X

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

(CategoryTheory.prod.etaIso X).inv = (CategoryTheory.CategoryStruct.id X.1, CategoryTheory.CategoryStruct.id X.2)


@[to_additive (attr := simp)]
theorem lift_comp_inr (f : M →* P) (g : N →* P) : (lift f g).comp inr = g

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

(Monoid.Coprod.lift f g).comp Monoid.Coprod.inr = g


@[simp]
theorem coe_inf : ⇑(f ⊓ g) = ⇑f ⊓ ⇑g

{α : Type u_2}
{β : Type u_3}
[Top α]
[SemilatticeInf β]
[OrderTop β]
(f g : TopHom α β)


theorem bddAbove_range_of_tendsto_atTop_atBot [IsDirected α (· ≤ ·)] {u : ℕ → α}
    (hx : Tendsto u atTop atBot) : BddAbove (Set.range u)

(hx : Filter.Tendsto u Filter.atTop Filter.atBot)


theorem map_sub (f : E →ₗ.[R] F) (x y : f.domain) : f (x - y) = f x - f y

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
(f : E →ₗ.[R] F)
(x y : ↥f.domain)


@[simp]
theorem coeFn_sub (f g : lp E p) : ⇑(f - g) = f - g

{α : Type u_1}
{E : α → Type u_2}
{p : ℝ≥0∞}
[(i : α) → NormedAddCommGroup (E i)]
(f g : ↥(lp E p))


/-- If `∅ ≠ U ⊆ S ⊆ t` such that `U` is open and `t` is preirreducible, then `S` is irreducible. -/
theorem IsPreirreducible.subset_irreducible {S U : Set X} (ht : IsPreirreducible t)
    (hU : U.Nonempty) (hU' : IsOpen U) (h₁ : U ⊆ S) (h₂ : S ⊆ t) : IsIrreducible S

{X : Type u_1}
[TopologicalSpace X]
{t S U : Set X}
(ht : IsPreirreducible t)
(hU : U.Nonempty)
(hU' : IsOpen U)
(h₁ : U ⊆ S)
(h₂ : S ⊆ t)


theorem isModularLattice_iff_inf_sup_inf_assoc [Lattice α] :
    IsModularLattice α ↔ ∀ x y z : α, x ⊓ z ⊔ y ⊓ z = (x ⊓ z ⊔ y) ⊓ z

IsModularLattice α ↔ ∀ (x y z : α), x ⊓ z ⊔ y ⊓ z = (x ⊓ z ⊔ y) ⊓ z


/-- Pull an opposite submonoid back to a submonoid along `MulOpposite.op`-/
@[to_additive (attr := simps) "Pull an opposite additive submonoid back to a submonoid along
`AddOpposite.op`"]
protected def unop (x : Submonoid Mᵐᵒᵖ) : Submonoid M

{M : Type u_2}
[MulOneClass M]
(x : Submonoid Mᵐᵒᵖ)


theorem ne_univ_iff_exists_not_mem {α : Type*} (s : Set α) : s ≠ univ ↔ ∃ a, a ∉ s


theorem skew_product [SFinite μa] [SFinite μc] {f : α → β} (hf : MeasurePreserving f μa μb)
    {g : α → γ → δ} (hgm : Measurable (uncurry g)) (hg : ∀ᵐ x ∂μa, map (g x) μc = μd) :
    MeasurePreserving (fun p : α × γ => (f p.1, g p.1 p.2)) (μa.prod μc) (μb.prod μd)

(hf : MeasureTheory.MeasurePreserving f μa μb)

{g : α → γ → δ}

(hg : ∀ᵐ (x : α) ∂μa, MeasureTheory.Measure.map (g x) μc = μd)

MeasureTheory.MeasurePreserving (fun p => (f p.1, g p.1 p.2)) (μa.prod μc) (μb.prod μd)


/-- `(toSimpleFunc f)` is measurable. -/
@[measurability]
protected theorem measurable [MeasurableSpace E] (f : Lp.simpleFunc E p μ) :
    Measurable (toSimpleFunc f)

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


/-- If `f` is a Lipschitz continuous map, then `dimH (f '' s) ≤ dimH s`. -/
theorem dimH_image_le (h : LipschitzWith K f) (s : Set X) : dimH (f '' s) ≤ dimH s

{X : Type u_2}
{Y : Type u_3}
[EMetricSpace X]
[EMetricSpace Y]
{K : ℝ≥0}
{f : X → Y}
(h : LipschitzWith K f)
(s : Set X)


@[to_additive (attr := simp)]
theorem map_of (f : α → β) (x : α) : map f (of x) = of (f x)

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

(FreeMonoid.map f) (FreeMonoid.of x) = FreeMonoid.of (f x)


theorem differentiable_set_eq_D (hK : IsComplete K) :
    { x | DifferentiableAt 𝕜 f x ∧ fderiv 𝕜 f x ∈ K } = D f K

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
(K : Set (E →L[𝕜] F))
(hK : IsComplete K)

{x | DifferentiableAt 𝕜 f x ∧ fderiv 𝕜 f x ∈ K} = FDerivMeasurableAux.D f K


theorem fixedPoints_subset_range : fixedPoints f ⊆ Set.range f


theorem eq_of_prefix_of_length_eq (h : l₁ <+: l₂) : l₁.length = l₂.length → l₁ = l₂

{α : Type u_1}
{l₁ l₂ : List α}
(h : l₁ <+: l₂)


protected theorem le_tsub_iff_right (ha : AddLECancellable a) (h : a ≤ c) :
    b ≤ c - a ↔ b + a ≤ c

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


lemma exact_iff_iCycles_pOpcycles_zero [S.HasHomology] :
    S.Exact ↔ S.iCycles ≫ S.pOpcycles = 0

S.Exact ↔ CategoryTheory.CategoryStruct.comp S.iCycles S.pOpcycles = 0


@[simp]
theorem coe_cast (h : n = m) : (Sym.cast h s : Multiset α) = s

{α : Type u_1}
{n m : ℕ}
{s : Sym α n}
(h : n = m)


theorem Ioo_subset_Iio_self : Ioo a b ⊆ Iio b

{α : Type u_2}
[Preorder α]
[LocallyFiniteOrder α]
{a b : α}
[LocallyFiniteOrderBot α]


protected theorem mem_nhds [T : TopologicalSpace α] (F : Realizer α) {s : Set α} {a : α} :
    s ∈ 𝓝 a ↔ ∃ b, a ∈ F.F b ∧ F.F b ⊆ s

{α : Type u_1}
[T : TopologicalSpace α]
(F : Ctop.Realizer α)
{s : Set α}
{a : α}

s ∈ 𝓝 a ↔ ∃ b, a ∈ F.F.f b ∧ F.F.f b ⊆ s


@[simp]
theorem eraseNone_insertNone (s : Finset α) : eraseNone (insertNone s) = s

Finset.eraseNone (Finset.insertNone s) = s


@[simp] theorem sizeOf_get [SizeOf α] (as : Array α) (i : Fin as.size) : sizeOf (as.get i) < sizeOf as

{α : Type u_1}
[SizeOf α]
(as : Array α)
(i : Fin as.size)


/-- A subgroup contains the group's 1. -/
@[to_additive "An `AddSubgroup` contains the group's 0."]
protected theorem one_mem : (1 : G) ∈ H

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


theorem IsClosed.csInf_mem {s : Set α} (hc : IsClosed s) (hs : s.Nonempty) (B : BddBelow s) :
    sInf s ∈ s

{α : Type u_1}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
{s : Set α}
(hc : IsClosed s)
(hs : s.Nonempty)
(B : BddBelow s)


lemma isClosed_singleton_inter [T1Space X] {A : Set X} {a : X} : IsClosed ({a} ∩ A)

{X : Type u_1}
[TopologicalSpace X]
[T1Space X]
{A : Set X}
{a : X}


@[to_additive (attr := simp (default + 1))]
lemma sup_div_le [SemilatticeSup β] [OrderBot β] {s t : Finset α} {f : α → β} {a : β} :
    sup (s / t) f ≤ a ↔ ∀ x ∈ s, ∀ y ∈ t, f (x /  y) ≤ a

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[Div α]
[SemilatticeSup β]
[OrderBot β]
{s t : Finset α}
{f : α → β}
{a : β}

(s / t).sup f ≤ a ↔ ∀ x ∈ s, ∀ y ∈ t, f (x / y) ≤ a


theorem choose_symm_add {a b : ℕ} : choose (a + b) a = choose (a + b) b


@[simp]
lemma re_ofNat (n : ℕ) [n.AtLeastTwo] : (no_index (OfNat.ofNat n) : ℂ).re = OfNat.ofNat n


@[simp, norm_cast]
theorem down_intCast [IntCast α] (n : ℤ) : down (n : ULift α) = n


lemma mul_neg_iff [PosMulStrictMono α] [MulPosStrictMono α]
    [ContravariantClass α α (· + ·) (· < ·)] [CovariantClass α α (· + ·) (· < ·)] :
    a * b < 0 ↔ 0 < a ∧ b < 0 ∨ a < 0 ∧ 0 < b

[ContravariantClass α α (fun x x_1 => x + x_1) fun x x_1 => x < x_1]

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


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

{H : Type x}
[TopologicalSpace H]
[OrderedAddCommGroup H]
[ContinuousNeg H]
{a : H}

Filter.Tendsto Neg.neg (𝓝[≤] a) (𝓝[≥] (-a))


/-- `reduce` is idempotent, i.e. the maximal reduction of the maximal reduction of a word is the
  maximal reduction of the word. -/
@[to_additive (attr := simp) "`reduce` is idempotent, i.e. the maximal reduction of the maximal
  reduction of a word is the maximal reduction of the word."]
theorem reduce.idem : reduce (reduce L) = reduce L

{α : Type u}
{L : List (α × Bool)}
[DecidableEq α]

FreeGroup.reduce (FreeGroup.reduce L) = FreeGroup.reduce L


/-- The induced subgraph of a subgraph. The expectation is that `s ⊆ G'.verts` for the usual
notion of an induced subgraph, but, in general, `s` is taken to be the new vertex set and edges
are induced from the subgraph `G'`. -/
@[simps]
def induce (G' : G.Subgraph) (s : Set V) : G.Subgraph

{V : Type u}
{G : SimpleGraph V}
(G' : G.Subgraph)
(s : Set V)
(u v : V)

(G'.induce s).Adj u v = (u ∈ s ∧ v ∈ s ∧ G'.Adj u v)


lemma Algebra.algebraMap_intTrace (x : B) :
    algebraMap A K (Algebra.intTrace A B x) = Algebra.trace K L (algebraMap B L x)

{A : Type u_1}
{K : Type u_2}
{L : Type u_3}
{B : Type u_4}
[CommRing A]
[CommRing B]
[Algebra A B]
[Field K]
[Field L]
[Algebra A K]
[IsFractionRing A K]
[Algebra B L]
[Algebra K L]
[Algebra A L]
[IsScalarTower A B L]
[IsScalarTower A K L]
[IsIntegralClosure B A L]
[FiniteDimensional K L]
[IsDomain A]
[IsIntegrallyClosed A]
[IsDomain B]
[IsIntegrallyClosed B]
[Module.Finite A B]
[NoZeroSMulDivisors A B]
(x : B)

(algebraMap A K) ((Algebra.intTrace A B) x) = (Algebra.trace K L) ((algebraMap B L) x)


/-- This cannot be marked `@[ext]` as it ends up being used instead of `LinearMap.prod_ext` when
working with `R × M`. -/
theorem linearMap_ext {N} [Semiring S] [AddCommMonoid R] [AddCommMonoid M] [AddCommMonoid N]
    [Module S R] [Module S M] [Module S N] ⦃f g : tsze R M →ₗ[S] N⦄
    (hl : ∀ r, f (inl r) = g (inl r)) (hr : ∀ m, f (inr m) = g (inr m)) : f = g

(hl : ∀ (r : R), f (TrivSqZeroExt.inl r) = g (TrivSqZeroExt.inl r))

(hr : ∀ (m : M), f (TrivSqZeroExt.inr m) = g (TrivSqZeroExt.inr m))


/-- This lemma is meant to be used with `nullHomotopicMap'_f_of_not_rel_left` -/
theorem cs_down_0_not_rel_left (j : ℕ) : ¬c.Rel 0 j


/-- Let `K` be the field of fraction of an integrally closed domain `R` and let `L` be a separable
extension of `K`, generated by an integral power basis `B` such that the minimal polynomial of
`B.gen` is Eisenstein at `p`. Given `z : L` integral over `R`, if `p ^ n • z ∈ adjoin R {B.gen}`,
then `z ∈ adjoin R {B.gen}`. Together with `Algebra.discr_mul_isIntegral_mem_adjoin` this result
often allows to compute the ring of integers of `L`. -/
theorem mem_adjoin_of_smul_prime_pow_smul_of_minpoly_isEisensteinAt {B : PowerBasis K L}
    (hp : Prime p) (hBint : IsIntegral R B.gen) {n : ℕ} {z : L} (hzint : IsIntegral R z)
    (hz : p ^ n • z ∈ adjoin R ({B.gen} : Set L)) (hei : (minpoly R B.gen).IsEisensteinAt 𝓟) :
    z ∈ adjoin R ({B.gen} : Set L)

(hz : p ^ n • z ∈ Algebra.adjoin R {B.gen})

(hei : (minpoly R B.gen).IsEisensteinAt (Submodule.span R {p}))


theorem refl_reparam {f : I → I} (hfcont : Continuous f) (hf₀ : f 0 = 0) (hf₁ : f 1 = 1) :
    (refl x).reparam f hfcont hf₀ hf₁ = refl x

{X : Type u_1}
[TopologicalSpace X]
{x : X}
{f : ↑I → ↑I}
(hfcont : Continuous f)
(hf₀ : f 0 = 0)
(hf₁ : f 1 = 1)

(Path.refl x).reparam f hfcont hf₀ hf₁ = Path.refl x


@[simp]
theorem Iic_bot [PartialOrder α] [OrderBot α] : Iic (⊥ : α) = {⊥}

{α : Type u_1}
[PartialOrder α]
[OrderBot α]


@[simp]
theorem id_map (x : F α) : TypeVec.id <$$> x = x

{n : ℕ}
{α : TypeVec.{u} n}
{F : TypeVec.{u} n → Type v}
[MvFunctor F]
[LawfulMvFunctor F]
(x : F α)


lemma tensorHom_def {X₁ X₂ Y₁ Y₂ : GradedObject I C} (f : X₁ ⟶ X₂) (g : Y₁ ⟶ Y₂)
    [HasTensor X₁ Y₁] [HasTensor X₂ Y₂] [HasTensor X₂ Y₁] :
    tensorHom f g = whiskerRight f Y₁ ≫ whiskerLeft X₂ g

{X₁ X₂ Y₁ Y₂ : CategoryTheory.GradedObject I C}

CategoryTheory.GradedObject.Monoidal.tensorHom f g =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.GradedObject.Monoidal.whiskerRight f Y₁)
    (CategoryTheory.GradedObject.Monoidal.whiskerLeft X₂ g)


theorem transpose {M : Matrix n n R} (hM : M.PosDef) : Mᵀ.PosDef

{n : Type u_2}
{R : Type u_3}
[Fintype n]
[CommRing R]
[PartialOrder R]
[StarRing R]
{M : Matrix n n R}
(hM : M.PosDef)


/-- A first-order hom `f : M → N` whose values lie in a substructure `p ⊆ N` can be restricted to a
hom `M → p`. -/
@[simps]
def codRestrict (p : L.Substructure N) (f : M →[L] N) (h : ∀ c, f c ∈ p) : M →[L] p

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
(p : L.Substructure N)
(f : L.Hom M N)
(h : ∀ (c : M), f c ∈ p)
(c : M)

↑((FirstOrder.Language.Hom.codRestrict p f h) c) = f c


@[to_additive (attr := simp)]
theorem ofMulEquivOfDom_apply {k : P ≃* M} (H : T.map k.toMonoidHom = S) (x) :
    (f.ofMulEquivOfDom H).toMap x = f.toMap (k x)

{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)
{T : Submonoid P}
{k : P ≃* M}
(H : Submonoid.map k.toMonoidHom T = S)
(x : P)


/-- A subgraph of a `SimpleGraph` is a subset of vertices along with a restriction of the adjacency
relation that is symmetric and is supported by the vertex subset.  They also form a bounded lattice.

Thinking of `V → V → Prop` as `Set (V × V)`, a set of darts (i.e., half-edges), then
`Subgraph.adj_sub` is that the darts of a subgraph are a subset of the darts of `G`. -/
@[ext]
structure Subgraph {V : Type u} (G : SimpleGraph V) where
  verts : Set V
  Adj : V → V → Prop
  adj_sub : ∀ {v w : V}, Adj v w → G.Adj v w
  edge_vert : ∀ {v w : V}, Adj v w → v ∈ verts
  symm : Symmetric Adj := by aesop_graph

{V : Type u}
{G : SimpleGraph V}
(self : G.Subgraph)
{v w : V}


theorem nhds_pi {a : ∀ i, π i} : 𝓝 a = pi fun i => 𝓝 (a i)

{ι : Type u_5}
{π : ι → Type u_6}
[T : (i : ι) → TopologicalSpace (π i)]
{a : (i : ι) → π i}


@[deprecated sum_count_eq_card (since := "2024-07-21")]
theorem sum_count_eq [Fintype α] (s : Multiset α) : ∑ a, s.count a = Multiset.card s

{α : Type u_3}
[DecidableEq α]
[Fintype α]
(s : Multiset α)

∑ a : α, Multiset.count a s = Multiset.card s


@[simp]
theorem singleton_head {i} (x : M i) (hne_one : x ≠ 1) : (singleton x hne_one).head = x

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
{i : ι}
(x : M i)
(hne_one : x ≠ 1)

(Monoid.CoprodI.NeWord.singleton x hne_one).head = x


@[simp]
lemma smul_le_smul_iff_of_pos_right [SMulPosMono α β] [SMulPosReflectLE α β] (hb : 0 < b) :
    a₁ • b ≤ a₂ • b ↔ a₁ ≤ a₂

{α : Type u_1}
{β : Type u_2}
{a₁ a₂ : α}
{b : β}
[SMul α β]
[Preorder α]
[Preorder β]
[Zero β]
[SMulPosMono α β]
[SMulPosReflectLE α β]
(hb : 0 < b)

a₁ • b ≤ a₂ • b ↔ a₁ ≤ a₂


/-- The natural degree of `cyclotomic n` is `totient n`. -/
theorem natDegree_cyclotomic (n : ℕ) (R : Type*) [Ring R] [Nontrivial R] :
    (cyclotomic n R).natDegree = Nat.totient n

(n : ℕ)
(R : Type u_1)
[Ring R]
[Nontrivial R]

(Polynomial.cyclotomic n R).natDegree = n.totient


/-- A subfamily of a linearly independent family (i.e., a composition with an injective map) is a
linearly independent family. -/
theorem LinearIndependent.comp (h : LinearIndependent R v) (f : ι' → ι) (hf : Injective f) :
    LinearIndependent R (v ∘ f)

{ι : Type u'}
{ι' : Type u_1}
{R : Type u_2}
{M : Type u_4}
{v : ι → M}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(h : LinearIndependent R v)
(f : ι' → ι)
(hf : Function.Injective f)


/--
For `F : J ⥤ C`, given a cocone `c : Cocone F`, and a natural isomorphism `α : H ≅ H'` for functors
`H H' : C ⥤ D`, the precomposition of the cocone `H.mapCocone` using the isomorphism `α` is
isomorphic to the cocone `H'.mapCocone`.
-/
@[simps!]
def precomposeWhiskerLeftMapCocone {H H' : C ⥤ D} (α : H ≅ H') (c : Cocone F) :
    (Cocones.precompose (whiskerLeft F α.inv : _)).obj (mapCocone H c) ≅ mapCocone H' c

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{D : Type u₄}
[CategoryTheory.Category.{v₄, u₄} D]
{F : J ⥤ C}
{H H' : C ⥤ D}
(α : H ≅ H')
(c : CategoryTheory.Limits.Cocone F)

(CategoryTheory.Functor.precomposeWhiskerLeftMapCocone α c).hom.hom = α.hom.app c.pt


theorem ne_zero [Nontrivial M₀] {a : M₀} (ha : IsUnit a) : a ≠ 0

{M₀ : Type u_2}
[MonoidWithZero M₀]
[Nontrivial M₀]
{a : M₀}
(ha : IsUnit a)


@[simp]
theorem coe_zsmul (r : ℤ) (f : α →ᵇ β) : ⇑(r • f) = r • ⇑f

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[SeminormedAddCommGroup β]
(r : ℤ)
(f : BoundedContinuousFunction α β)


theorem Disjoint.disjoint_sdiff_right (h : Disjoint a b) : Disjoint a (b \ c)

{α : Type u_2}
[GeneralizedCoheytingAlgebra α]
{a b c : α}
(h : Disjoint a b)


/-- The inclusion maps into the explicit finite coproduct are open embeddings. -/
lemma finiteCoproduct.openEmbedding_ι {α : Type} [Finite α] (Z : α → Stonean.{u}) (a : α) :
    OpenEmbedding (finiteCoproduct.ι Z a)

{α : Type}
[Finite α]
(Z : α → Stonean)
(a : α)

OpenEmbedding ⇑(Stonean.finiteCoproduct.ι Z a)


theorem Ideal.homogeneous_span (s : Set A) (h : ∀ x ∈ s, Homogeneous 𝒜 x) :
    (Ideal.span s).IsHomogeneous 𝒜

{ι : Type u_1}
{σ : Type u_2}
{A : Type u_4}
[Semiring A]
[SetLike σ A]
[AddSubmonoidClass σ A]
(𝒜 : ι → σ)
[DecidableEq ι]
[AddMonoid ι]
[GradedRing 𝒜]
(s : Set A)
(h : ∀ x ∈ s, SetLike.Homogeneous 𝒜 x)


theorem think_mem {s : Computation α} {a} : a ∈ s → a ∈ think s

{α : Type u}
{s : Computation α}
{a : α}


/-- Adjunction between two 1-morphisms. -/
structure Adjunction (f : a ⟶ b) (g : b ⟶ a) where
  /-- The unit of an adjunction. -/
  unit : 𝟙 a ⟶ f ≫ g
  /-- The counit of an adjunction. -/
  counit : g ≫ f ⟶ 𝟙 b
  /-- The composition of the unit and the counit is equal to the identity up to unitors. -/
  left_triangle : leftZigzag unit counit = (λ_ _).hom ≫ (ρ_ _).inv := by aesop_cat
  /-- The composition of the unit and the counit is equal to the identity up to unitors. -/
  right_triangle : rightZigzag unit counit = (ρ_ _).hom ≫ (λ_ _).inv := by aesop_cat

(self : CategoryTheory.Bicategory.Adjunction f g)

CategoryTheory.Bicategory.leftZigzag self.unit self.counit =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.leftUnitor f).hom
    (CategoryTheory.Bicategory.rightUnitor f).inv


lemma SigmaFinite.withDensity_of_ne_top [SigmaFinite μ] {f : α → ℝ≥0∞}
    (hf_ne_top : ∀ᵐ x ∂μ, f x ≠ ∞) : SigmaFinite (μ.withDensity f)

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasureTheory.SigmaFinite μ]
{f : α → ℝ≥0∞}
(hf_ne_top : ∀ᵐ (x : α) ∂μ, f x ≠ ⊤)


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

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

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


/-- For `r` strictly smaller than the radius of `p`, then `‖pₙ‖ rⁿ = o(1)`. -/
theorem isLittleO_one_of_lt_radius (h : ↑r < p.radius) :
    (fun n => ‖p n‖ * (r : ℝ) ^ n) =o[atTop] (fun _ => 1 : ℕ → ℝ)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)
{r : ℝ≥0}
(h : ↑r < p.radius)

(fun n => ‖p n‖ * ↑r ^ n) =o[Filter.atTop] fun x => 1


/-- Two prime powers with positive exponents are equal only when the primes and the
exponents are equal. -/
lemma Prime.pow_inj {p q m n : ℕ} (hp : p.Prime) (hq : q.Prime)
    (h : p ^ (m + 1) = q ^ (n + 1)) : p = q ∧ m = n

{p q m n : ℕ}
(hp : Nat.Prime p)
(hq : Nat.Prime q)
(h : p ^ (m + 1) = q ^ (n + 1))


@[simp]
theorem map_map_left : ((map f).map g).left = g.left

{T : Type u₁}
[CategoryTheory.Category.{v₁, u₁} T]
{X Y : T}
{f : X ⟶ Y}
{U V : CategoryTheory.Over X}
{g : U ⟶ V}

((CategoryTheory.Over.map f).map g).left = g.left


theorem encodeCode_eq : encode = encodeCode


theorem Tendsto.basis_left (H : Tendsto f la lb) (hla : la.HasBasis pa sa) :
    ∀ t ∈ lb, ∃ i, pa i ∧ MapsTo f (sa i) t

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
{la : Filter α}
{pa : ι → Prop}
{sa : ι → Set α}
{lb : Filter β}
{f : α → β}
(H : Filter.Tendsto f la lb)
(hla : la.HasBasis pa sa)
(t : Set β)

t ∈ lb → ∃ i, pa i ∧ Set.MapsTo f (sa i) t


lemma le_succ_iff_eq_or_le : m ≤ n.succ ↔ m = n.succ ∨ m ≤ n