/-- The **Dyson e-transform**. Turns `(s, t)` into `(s ∪ e • t, t ∩ e⁻¹ • s)`. This reduces the
product of the two sets. -/
@[to_additive (attr := simps) "The **Dyson e-transform**.
Turns `(s, t)` into `(s ∪ e +ᵥ t, t ∩ -e +ᵥ s)`. This reduces the sum of the two sets."]
def mulDysonETransform : Finset α × Finset α

{α : Type u_1}
[DecidableEq α]
[CommGroup α]
(e : α)
(x : Finset α × Finset α)

(Finset.mulDysonETransform e x).2 = x.2 ∩ e⁻¹ • x.1


/-- A uniform space is a generalization of the "uniform" topological aspects of a
  metric space. It consists of a filter on `α × α` called the "uniformity", which
  satisfies properties analogous to the reflexivity, symmetry, and triangle properties
  of a metric.

  A metric space has a natural uniformity, and a uniform space has a natural topology.
  A topological group also has a natural uniformity, even when it is not metrizable. -/
class UniformSpace (α : Type u) extends TopologicalSpace α where
  /-- The uniformity filter. -/
  protected uniformity : Filter (α × α)
  /-- If `s ∈ uniformity`, then `Prod.swap ⁻¹' s ∈ uniformity`. -/
  protected symm : Tendsto Prod.swap uniformity uniformity
  /-- For every set `u ∈ uniformity`, there exists `v ∈ uniformity` such that `v ○ v ⊆ u`. -/
  protected comp : (uniformity.lift' fun s => s ○ s) ≤ uniformity
  /-- The uniformity agrees with the topology: the neighborhoods filter of each point `x`
  is equal to `Filter.comap (Prod.mk x) (𝓤 α)`. -/
  protected nhds_eq_comap_uniformity (x : α) : 𝓝 x = comap (Prod.mk x) uniformity

{α : Type u}
[self : UniformSpace α]
(x : α)

𝓝 x = Filter.comap (Prod.mk x) UniformSpace.uniformity


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

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


theorem radical_le_radical_iff : radical I ≤ radical J ↔ I ≤ radical J

{R : Type u}
[CommSemiring R]
{I J : Ideal R}


theorem map_comp_apply (f : M →ₗ[R] N) (g : N →ₗ[R] P) (x : AdicCompletion I M) :
    map I g (map I f x) = map I (g ∘ₗ f) x

{R : Type u_1}
[CommRing R]
(I : Ideal R)
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{N : Type u_3}
[AddCommGroup N]
[Module R N]
{P : Type u_4}
[AddCommGroup P]
[Module R P]
(f : M →ₗ[R] N)
(g : N →ₗ[R] P)
(x : AdicCompletion I M)

(AdicCompletion.map I g) ((AdicCompletion.map I f) x) = (AdicCompletion.map I (g ∘ₗ f)) x


theorem symm_trans_target_eq (e e' : Trivialization F proj) :
    (e.toPartialEquiv.symm.trans e'.toPartialEquiv).target = (e.baseSet ∩ e'.baseSet) ×ˢ univ

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
{proj : Z → B}
[TopologicalSpace Z]
(e e' : Trivialization F proj)

(e.symm.trans e'.toPartialEquiv).target = (e.baseSet ∩ e'.baseSet) ×ˢ Set.univ


protected theorem codisjoint_inf_right :
    Codisjoint a (s.inf f) ↔ ∀ ⦃i⦄, i ∈ s → Codisjoint a (f i)

{α : Type u_2}
{ι : Type u_5}
[DistribLattice α]
[OrderTop α]
{f : ι → α}
{s : Finset ι}
{a : α}

Codisjoint a (s.inf f) ↔ ∀ ⦃i : ι⦄, i ∈ s → Codisjoint a (f i)


theorem HasGradientWithinAt.congr_mono (h : HasGradientWithinAt f f' s x) (ht : ∀ x ∈ t, f₁ x = f x)
    (hx : f₁ x = f x) (h₁ : t ⊆ s) : HasGradientWithinAt f₁ f' t x

{𝕜 : Type u_1}
{F : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
{f : F → 𝕜}
{f' x : F}
{s : Set F}
{f₁ : F → 𝕜}
{t : Set F}
(h : HasGradientWithinAt f f' s x)
(ht : ∀ x ∈ t, f₁ x = f x)
(hx : f₁ x = f x)
(h₁ : t ⊆ s)


/-- The augmented Čech conerve associated to an arrow. -/
@[simps]
def augmentedCechConerve : CosimplicialObject.Augmented C

[∀ (n : ℕ), CategoryTheory.Limits.HasWidePushout f.left (fun x => f.right) fun x => f.hom]


@[simp]
theorem equivProdOfSurjectiveOfIsCompl_apply {f : E →L[𝕜] F} {g : E →L[𝕜] G} (hf : range f = ⊤)
    (hg : range g = ⊤) (hfg : IsCompl (ker f) (ker g)) (x : E) :
    equivProdOfSurjectiveOfIsCompl f g hf hg hfg x = (f x, g x)

(hfg : IsCompl (LinearMap.ker f) (LinearMap.ker g))

(f.equivProdOfSurjectiveOfIsCompl g hf hg hfg) x = (f x, g x)


@[reassoc (attr := simp)]
theorem ofLE_comp_ofLE {B : C} (X Y Z : Subobject B) (h₁ : X ≤ Y) (h₂ : Y ≤ Z) :
    ofLE X Y h₁ ≫ ofLE Y Z h₂ = ofLE X Z (h₁.trans h₂)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{B : C}
(X Y Z : CategoryTheory.Subobject B)
(h₁ : X ≤ Y)
(h₂ : Y ≤ Z)

CategoryTheory.CategoryStruct.comp (X.ofLE Y h₁) (Y.ofLE Z h₂) = X.ofLE Z ⋯


@[to_additive]
theorem MonoidHom.map_finprod_Prop {p : Prop} (f : M →* N) (g : p → M) :
    f (∏ᶠ x, g x) = ∏ᶠ x, f (g x)

{M : Type u_2}
{N : Type u_3}
[AddCommMonoid M]
[AddCommMonoid N]
{p : Prop}
(f : M →+ N)
(g : p → M)

f (∑ᶠ (x : p), g x) = ∑ᶠ (x : p), f (g x)


/-- If `p` is positive and `n` is `p`-smooth, then every product `p^e * n` is `(p+1)`-smooth. -/
lemma pow_mul_mem_smoothNumbers {p n : ℕ} (hp : p ≠ 0) (e : ℕ) (hn : n ∈ smoothNumbers p) :
    p ^ e * n ∈ smoothNumbers (succ p)

{p n : ℕ}
(hp : p ≠ 0)
(e : ℕ)
(hn : n ∈ p.smoothNumbers)


@[simp]
theorem rid_tmul (r : R) (a : A) : TensorProduct.rid R S A (a ⊗ₜ r) = r • a

{R : Type uR}
(S : Type uS)
{A : Type uA}
[CommSemiring R]
[CommSemiring S]
[Algebra R S]
[Semiring A]
[Algebra R A]
[Algebra S A]
[IsScalarTower R S A]
(r : R)
(a : A)

(Algebra.TensorProduct.rid R S A) (a ⊗ₜ[R] r) = r • a


@[simp] lemma Scheme.restrictFunctor_obj_hom (U : X.Opens) :
  (X.restrictFunctor.obj U).hom = U.ι

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


@[to_additive posPart_nonneg] lemma one_le_oneLePart (a : α) : 1 ≤ a⁺ᵐ

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


/-- The space of constant maps is equivalent to the space of maps that are multilinear with respect
to an empty family. -/
@[simps]
def constLinearEquivOfIsEmpty [IsEmpty ι] : M₂ ≃ₗ[S] MultilinearMap R M₁ M₂

(R : Type uR)
(S : Type uS)
{ι : Type uι}
(M₁ : ι → Type v₁)
(M₂ : Type v₂)
[Semiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[(i : ι) → Module R (M₁ i)]
[AddCommMonoid M₂]
[Module R M₂]
[Semiring S]
[Module S M₂]
[SMulCommClass R S M₂]
[IsEmpty ι]
(m : M₂)

(MultilinearMap.constLinearEquivOfIsEmpty R S M₁ M₂) m = MultilinearMap.constOfIsEmpty R M₁ m


protected theorem sub_lt_of_pos_le (h₀ : 0 < a) (h₁ : a ≤ b) : b - a < b


theorem isConnected_connectedComponentIn_iff {x : α} {F : Set α} :
    IsConnected (connectedComponentIn F x) ↔ x ∈ F

{α : Type u}
[TopologicalSpace α]
{x : α}
{F : Set α}


@[simp]
theorem plus_def (P Q : RegularExpression α) : plus P Q = P + Q

{α : Type u_1}
(P Q : RegularExpression α)


/-- The cokernel of `biproduct.ι f i` is `⨁ Subtype.restrict {i}ᶜ f`. -/
@[simps!]
def cokernelBiproductιIso : cokernel (biproduct.ι f i) ≅ ⨁ Subtype.restrict (fun j => j ≠ i) f

[CategoryTheory.Limits.HasBiproduct (Subtype.restrict (fun j => j ≠ i) f)]

(CategoryTheory.Limits.cokernelBiproductιIso f i).hom =
  CategoryTheory.Limits.colimit.desc (CategoryTheory.Limits.parallelPair (CategoryTheory.Limits.biproduct.ι f i) 0)
    (CategoryTheory.Limits.CokernelCofork.ofπ (CategoryTheory.Limits.biproduct.toSubtype f fun j => ¬j = i) ⋯)


protected theorem add_left_neg (x : M ⊗[R] N) : -x + x = 0

{R : Type u_1}
[CommSemiring R]
{M : Type u_2}
{N : Type u_3}
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
(x : TensorProduct R M N)


theorem midpoint_comm (x y : P) : midpoint R x y = midpoint R y x

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


@[simp]
theorem cos_nat_mul_two_pi (n : ℕ) : cos (n * (2 * π)) = 1


theorem mem_of_closed' {s : Set α} (hs : IsClosed s) {a : α} :
    a ∈ s ↔ ∀ ε > 0, ∃ b ∈ s, dist a b < ε

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
(hs : IsClosed s)
{a : α}


@[to_additive]
theorem apply_coe_mem_map (f : M →ₙ* N) (S : Subsemigroup M) (x : S) : f x ∈ S.map f

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


theorem toFinsupp_add (s t : Multiset α) : toFinsupp (s + t) = toFinsupp s + toFinsupp t

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

Multiset.toFinsupp (s + t) = Multiset.toFinsupp s + Multiset.toFinsupp t


/-- Sends a complex `X` with objects in `Vᵒᵖ` to the corresponding complex with objects in `V`. -/
@[simps]
protected def unopSymm (X : HomologicalComplex Vᵒᵖ c.symm) : HomologicalComplex V c


@[simp]
theorem mk_eq_div (p q : K[X]) : RatFunc.mk p q = algebraMap _ _ p / algebraMap _ _ q

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

RatFunc.mk p q = (algebraMap K[X] (RatFunc K)) p / (algebraMap K[X] (RatFunc K)) q


/-- Given a localization map `f : M →* N`, and `z w : N`, there exist `z' w' : M` and `d : S`
such that `f z' / f d = z` and `f w' / f d = w`. -/
@[to_additive
    "Given a localization map `f : M →+ N`, and `z w : N`, there exist `z' w' : M` and `d : S`
such that `f z' - f d = z` and `f w' - f d = w`."]
theorem surj₂ (f : LocalizationMap S N) (z w : N) : ∃ z' w' : M, ∃ d : S,
    (z * f.toMap d = f.toMap z') ∧  (w * f.toMap d = f.toMap w')

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
(f : S.LocalizationMap N)
(z w : N)

∃ z' w' d, z * f.toMap ↑d = f.toMap z' ∧ w * f.toMap ↑d = f.toMap w'


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

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

((CategoryTheory.Limits.Cocone.equivStructuredArrow F).inverse.obj c).ι = c.hom


/-- The equivalence `Karoubi (HomologicalComplex C c) ≌ HomologicalComplex (Karoubi C) c`. -/
@[simps]
def karoubiHomologicalComplexEquivalence :
    Karoubi (HomologicalComplex C c) ≌ HomologicalComplex (Karoubi C) c

(C : Type u_1)
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{ι : Type u_2}
(c : ComplexShape ι)

(CategoryTheory.Idempotents.karoubiHomologicalComplexEquivalence C c).unitIso =
  CategoryTheory.Idempotents.KaroubiHomologicalComplexEquivalence.unitIso


theorem sup_himp_left (hs : s.Nonempty) (f : ι → α) (a : α) :
    (s.sup fun b => a ⇨ f b) = a ⇨ s.sup f

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


@[simp]
theorem mk_coe (f : α →+* β) (h₁ h₂ h₃ h₄) : RingHom.mk ⟨⟨f, h₁⟩, h₂⟩ h₃ h₄ = f

∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →+* β) (h₁ : f 1 = 1)
  (h₂ :
    ∀ (x_2 y : α),
      { toFun := ⇑f, map_one' := h₁ }.toFun (x_2 * y) =
        { toFun := ⇑f, map_one' := h₁ }.toFun x_2 * { toFun := ⇑f, map_one' := h₁ }.toFun y)
  (h₃ : (↑{ toFun := ⇑f, map_one' := h₁, map_mul' := h₂ }).toFun 0 = 0)
  (h₄ :
    ∀ (x_2 y : α),
      (↑{ toFun := ⇑f, map_one' := h₁, map_mul' := h₂ }).toFun (x_2 + y) =
        (↑{ toFun := ⇑f, map_one' := h₁, map_mul' := h₂ }).toFun x_2 +
          (↑{ toFun := ⇑f, map_one' := h₁, map_mul' := h₂ }).toFun y),
  { toFun := ⇑f, map_one' := h₁, map_mul' := h₂, map_zero' := h₃, map_add' := h₄ } = f


theorem toFiniteMeasure_continuous :
    Continuous (toFiniteMeasure : ProbabilityMeasure Ω → FiniteMeasure Ω)

{Ω : Type u_1}
[MeasurableSpace Ω]
[TopologicalSpace Ω]
[OpensMeasurableSpace Ω]


theorem incidenceSet_subset (v : V) : G.incidenceSet v ⊆ G.edgeSet

{V : Type u}
(G : SimpleGraph V)
(v : V)


@[reassoc (attr := simp)]
lemma presheafHom_naturality {P Q : Cᵒᵖ ⥤ Type v₁} (f : P ⟶ Q) :
    presheafHom φ P ≫ whiskerLeft F.op (G.map f) = f ≫ presheafHom φ Q

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

(φ : F.comp CategoryTheory.yoneda ⟶ CategoryTheory.yoneda.comp G)

{P Q : CategoryTheory.Functor Cᵒᵖ (Type v₁)}

CategoryTheory.CategoryStruct.comp (CategoryTheory.Presheaf.compYonedaIsoYonedaCompLan.presheafHom φ P)
    (CategoryTheory.whiskerLeft F.op (G.map f)) =
  CategoryTheory.CategoryStruct.comp f (CategoryTheory.Presheaf.compYonedaIsoYonedaCompLan.presheafHom φ Q)


lemma div_eq_sub_mod_div : m / n = (m - m % n) / n


theorem frontier_eq_empty_iff [PreconnectedSpace α] {s : Set α} :
    frontier s = ∅ ↔ s = ∅ ∨ s = univ

{α : Type u}
[TopologicalSpace α]
[PreconnectedSpace α]
{s : Set α}


theorem univ_id : univ.{u, u + 1} = #Ordinal


@[to_additive]
theorem ExponentExists.orderOf_pos (h : ExponentExists G) (g : G) : 0 < orderOf g

{G : Type u}
[AddMonoid G]
(h : AddMonoid.ExponentExists G)
(g : G)


theorem setToL1_add_left (hT : DominatedFinMeasAdditive μ T C)
    (hT' : DominatedFinMeasAdditive μ T' C') (f : α →₁[μ] E) :
    setToL1 (hT.add hT') f = setToL1 hT f + setToL1 hT' f

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(hT' : MeasureTheory.DominatedFinMeasAdditive μ T' C')

(MeasureTheory.L1.setToL1 ⋯) f = (MeasureTheory.L1.setToL1 hT) f + (MeasureTheory.L1.setToL1 hT') f


theorem mfderiv_bijective {x : M} (hx : x ∈ e.source) : Function.Bijective (mfderiv I I' e x)

(he : PartialHomeomorph.MDifferentiable I I' e)

Function.Bijective ⇑(mfderiv I I' (↑e) x)


theorem ext_elem [Finite ι] {q₁ q₂ : P} (h : ∀ i, b.coord i q₁ = b.coord i q₂) : q₁ = q₂

(h : ∀ (i : ι), (b.coord i) q₁ = (b.coord i) q₂)


/-- The supremum of a family of submodules is equal to the range of `DFinsupp.lsum`; that is
every element in the `iSup` can be produced from taking a finite number of non-zero elements
of `p i`, coercing them to `N`, and summing them. -/
theorem iSup_eq_range_dfinsupp_lsum (p : ι → Submodule R N) :
    iSup p = LinearMap.range (DFinsupp.lsum ℕ (M := fun i ↦ ↥(p i)) fun i => (p i).subtype)

{ι : Type u_1}
{R : Type u_2}
{N : Type u_5}
[Semiring R]
[AddCommMonoid N]
[Module R N]
[DecidableEq ι]
(p : ι → Submodule R N)

iSup p = LinearMap.range ((DFinsupp.lsum ℕ) fun i => (p i).subtype)


@[simp]
theorem coe_comp (f : B →⋆ₙₐ[R] C) (g : A →⋆ₙₐ[R] B) : ⇑(comp f g) = f ∘ g

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


theorem zpow_sub_one {A : M} (h : IsUnit A.det) (n : ℤ) : A ^ (n - 1) = A ^ n * A⁻¹

{n' : Type u_1}
[DecidableEq n']
[Fintype n']
{R : Type u_2}
[CommRing R]
{A : Matrix n' n' R}
(h : IsUnit A.det)
(n : ℤ)


theorem atTop_eq_generate_Ici [SemilatticeSup α] : atTop = generate (range (Ici (α := α)))

Filter.atTop = Filter.generate (Set.range Set.Ici)


@[to_additive]
theorem centralizer_le (h : S ⊆ T) : centralizer T ≤ centralizer S

{M : Type u_1}
{S T : Set M}
[AddSemigroup M]
(h : S ⊆ T)

AddSubsemigroup.centralizer T ≤ AddSubsemigroup.centralizer S


@[to_additive]
theorem div_mem_div : s ∈ f → t ∈ g → s / t ∈ f / g

{α : Type u_2}
[Sub α]
{f g : Filter α}
{s t : Set α}


lemma mem_uIcc_of_le (ha : a ≤ x) (hb : x ≤ b) : x ∈ [[a, b]]

{α : Type u_1}
[Lattice α]
{a b x : α}
(ha : a ≤ x)
(hb : x ≤ b)


theorem lintegral_nnnorm_eq_of_ae_nonneg {f : α → ℝ} (h_nonneg : 0 ≤ᵐ[μ] f) :
    ∫⁻ x, ‖f x‖₊ ∂μ = ∫⁻ x, ENNReal.ofReal (f x) ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ}
(h_nonneg : 0 ≤ᵐ[μ] f)

∫⁻ (x : α), ↑‖f x‖₊ ∂μ = ∫⁻ (x : α), ENNReal.ofReal (f x) ∂μ


@[to_additive tsum_setProd_singleton_right]
lemma tprod_setProd_singleton_right (s : Set β) (c : γ) (f : β × γ → α) :
    (∏' x : s ×ˢ {c}, f x) = ∏' b : s, f (b, c)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[AddCommMonoid α]
[TopologicalSpace α]
(s : Set β)
(c : γ)
(f : β × γ → α)

∑' (x : ↑(s ×ˢ {c})), f ↑x = ∑' (b : ↑s), f (↑b, c)


@[simp] theorem succ_last (n : Nat) : (last n).succ = last n.succ


/-- If we fix a background basis `e`, then for any other basis `v`, we can characterise the
coordinates provided by `v` in terms of determinants relative to `e`. -/
theorem Basis.det_smul_mk_coord_eq_det_update {v : ι → M} (hli : LinearIndependent R v)
    (hsp : ⊤ ≤ span R (range v)) (i : ι) :
    e.det v • (Basis.mk hli hsp).coord i = e.det.toMultilinearMap.toLinearMap v i

(hsp : ⊤ ≤ Submodule.span R (Set.range v))

e.det v • (Basis.mk hli hsp).coord i = (↑e.det).toLinearMap v i


@[simp]
theorem update_noteq {a a' : α} (h : a ≠ a') (v : β a') (f : ∀ a, β a) : update f a' v a = f a

{α : Sort u}
{β : α → Sort v}
[DecidableEq α]
{a a' : α}
(h : a ≠ a')
(v : β a')
(f : (a : α) → β a)


@[to_additive]
theorem singleton_mul_mem_nhds (a : α) {b : α} (h : s ∈ 𝓝 b) : {a} * s ∈ 𝓝 (a * b)

{α : Type u}
[TopologicalSpace α]
[AddGroup α]
[ContinuousConstVAdd α α]
{s : Set α}
(a : α)
{b : α}
(h : s ∈ 𝓝 b)


@[simp]
theorem toPartialHomeomorph_coe : ⇑φ.toPartialHomeomorph = φ.prodFun

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
[CompleteSpace G]
(φ : ImplicitFunctionData 𝕜 E F G)


theorem hasCoproducts_of_opposite [HasProducts.{v₂} Cᵒᵖ] : HasCoproducts.{v₂} C

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Limits.HasProducts Cᵒᵖ]


@[simp, norm_cast]
theorem coe_toOrderIso (f : α ≃+*o β) : DFunLike.coe (f : α ≃o β) = f

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


@[to_additive] lemma mabs_inf_div_inf_le_mabs (a b c : α) : |(a ⊓ c) / (b ⊓ c)|ₘ ≤ |a / b|ₘ

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


theorem id_prod : (fun p : α × β ↦ (p.1, p.2)) = id


@[to_additive (attr := simp)]
theorem smul_ae (c : G) : c • ae μ = ae μ

[MeasureTheory.SMulInvariantMeasure G α μ]

c • MeasureTheory.ae μ = MeasureTheory.ae μ


theorem IsNilpotent.mk [Zero R] [Pow R ℕ] (x : R) (n : ℕ) (e : x ^ n = 0) : IsNilpotent x

{R : Type u_1}
[Zero R]
[Pow R ℕ]
(x : R)
(n : ℕ)
(e : x ^ n = 0)


@[to_additive]
theorem IsScalarTower.of_mclosure_eq_top {N α} [Monoid M] [MulAction M N] [SMul N α] [MulAction M α]
    {s : Set M} (htop : Submonoid.closure s = ⊤)
    (hs : ∀ x ∈ s, ∀ (y : N) (z : α), (x • y) • z = x • y • z) : IsScalarTower M N α

(hs : ∀ x ∈ s, ∀ (y : N) (z : α), x +ᵥ y +ᵥ z = x +ᵥ (y +ᵥ z))


theorem map_sub (x y : R) : min (v x) (v y) ≤ v (x - y)

{R : Type u_3}
{Γ₀ : Type u_4}
[LinearOrderedAddCommGroupWithTop Γ₀]
[Ring R]
(v : AddValuation R Γ₀)
(x y : R)


/-- Eta rule for costructured arrows. -/
@[simps!]
def eta (f : CostructuredArrow S T) : f ≅ mk f.hom

(f : CategoryTheory.CostructuredArrow S T)

f.eta.inv.left = CategoryTheory.CategoryStruct.id f.left


/-- Lemma 2.1 in [Gleason, *Projective topological spaces*][gleason1958]:
if $\rho$ is a continuous surjection from a topological space $E$ to a topological space $A$
satisfying the "Zorn subset condition", then $\rho(G)$ is contained in
the closure of $A \setminus \rho(E \setminus G)$ for any open set $G$ of $E$. -/
lemma image_subset_closure_compl_image_compl_of_isOpen {ρ : E → A} (ρ_cont : Continuous ρ)
    (ρ_surj : ρ.Surjective) (zorn_subset : ∀ E₀ : Set E, E₀ ≠ univ → IsClosed E₀ → ρ '' E₀ ≠ univ)
    {G : Set E} (hG : IsOpen G) : ρ '' G ⊆ closure ((ρ '' Gᶜ)ᶜ)

(zorn_subset : ∀ (E₀ : Set E), E₀ ≠ Set.univ → IsClosed E₀ → ρ '' E₀ ≠ Set.univ)


/-- This structure contains the information left for a local trivialization (which is implemented
below as `Trivialization F proj`) if the total space has not been given a topology, but we
have a topology on both the fiber and the base space. Through the construction
`topological_fiber_prebundle F proj` it will be possible to promote a
`Pretrivialization F proj` to a `Trivialization F proj`. -/
structure Pretrivialization (proj : Z → B) extends PartialEquiv Z (B × F) where
  open_target : IsOpen target
  baseSet : Set B
  open_baseSet : IsOpen baseSet
  source_eq : source = proj ⁻¹' baseSet
  target_eq : target = baseSet ×ˢ univ
  proj_toFun : ∀ p ∈ source, (toFun p).1 = proj p

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
{proj : Z → B}
(self : Pretrivialization F proj)


theorem closedBall_antitone {p q : Seminorm 𝕜 E} (h : q ≤ p) :
    p.closedBall x r ⊆ q.closedBall x r

{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddCommGroup E]
[SMul 𝕜 E]
{x : E}
{r : ℝ}
{p q : Seminorm 𝕜 E}
(h : q ≤ p)


@[simp]
theorem cycleType_finRotate {n : ℕ} : cycleType (finRotate (n + 2)) = {n + 2}


@[simp]
theorem toOuterMeasure_top [MeasurableSpace α] :
    (⊤ : Measure α).toOuterMeasure = (⊤ : OuterMeasure α)


/-- `raise l n` is a non-decreasing sequence. -/
theorem raise_sorted : ∀ l n, List.Sorted (· ≤ ·) (raise l n)

List.Sorted (fun x x_1 => x ≤ x_1) (Denumerable.raise l n)


@[simp]
theorem continuousWithinAt_insert_self {f : α → β} {x : α} {s : Set α} :
    ContinuousWithinAt f (insert x s) x ↔ ContinuousWithinAt f s x

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
{x : α}
{s : Set α}


@[simp]
theorem pmap_cons {p : α → Prop} (f : ∀ a, p a → β) (a : α) (m : Multiset α) :
    ∀ h : ∀ b ∈ a ::ₘ m, p b,
      pmap f (a ::ₘ m) h =
        f a (h a (mem_cons_self a m)) ::ₘ pmap f m fun a ha => h a <| mem_cons_of_mem ha

{α : Type u_1}
{β : Type v}
{p : α → Prop}
(f : (a : α) → p a → β)
(a : α)
(m : Multiset α)
(h : ∀ b ∈ a ::ₘ m, p b)

Multiset.pmap f (a ::ₘ m) h = f a ⋯ ::ₘ Multiset.pmap f m ⋯


theorem PiToModule.fromEnd_apply_single_one [DecidableEq ι] (f : Module.End R M) (i : ι) :
    PiToModule.fromEnd R b f (Pi.single i 1) = f (b i)

{ι : Type u_1}
[Fintype ι]
{M : Type u_2}
[AddCommGroup M]
(R : Type u_3)
[CommRing R]
[Module R M]
(b : ι → M)
[DecidableEq ι]
(f : Module.End R M)
(i : ι)

((PiToModule.fromEnd R b) f) (Pi.single i 1) = f (b i)


protected theorem Subset.rfl {s : Finset α} : s ⊆ s


nonrec theorem IsLocalExtrOn.congr {f g : α → β} {a : α} (h : IsLocalExtrOn f s a)
    (heq : f =ᶠ[𝓝[s] a] g) (hmem : a ∈ s) : IsLocalExtrOn g s a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder β]
{s : Set α}
{f g : α → β}
{a : α}
(h : IsLocalExtrOn f s a)
(heq : f =ᶠ[𝓝[s] a] g)
(hmem : a ∈ s)


theorem hammingNorm_lt_one {x : ∀ i, β i} : hammingNorm x < 1 ↔ x = 0

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


/-- We can regard `coe_iSup_of_chain` as the statement that `(↑) : (Submodule R M) → Set M` is
Scott continuous for the ω-complete partial order induced by the complete lattice structures. -/
theorem coe_scott_continuous :
    OmegaCompletePartialOrder.Continuous' ((↑) : Submodule R M → Set M)

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


theorem coe_injective : Injective ((↑) : M [⋀^ι]→ₗ[R] N → (ι → M) → N)

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_7}


@[measurability]
theorem measurable_piEquivPiSubtypeProd_symm (p : δ → Prop) [DecidablePred p] :
    Measurable (Equiv.piEquivPiSubtypeProd p π).symm

{δ : Type u_4}
(π : δ → Type u_6)
[(a : δ) → MeasurableSpace (π a)]
(p : δ → Prop)
[DecidablePred p]

Measurable ⇑(Equiv.piEquivPiSubtypeProd p π).symm


theorem finRotate_apply_zero : finRotate n.succ 0 = 1


protected theorem Subsingleton.isWF (hs : s.Subsingleton) : IsWF s

{α : Type u_2}
[Preorder α]
{s : Set α}
(hs : s.Subsingleton)


@[simp] theorem dite_some_none_eq_some [Decidable P] {x : P → α} {y : α} :
    (if h : P then some (x h) else none) = some y ↔ ∃ h : P, x h = y

{P : Prop}
{α : Type u_1}
[Decidable P]
{x : P → α}
{y : α}

(if h : P then some (x h) else none) = some y ↔ ∃ h, x h = y


theorem integer_of_integral {x : K} : IsIntegral A x → IsInteger A x

{A : Type u_1}
{K : Type u_2}
[CommRing A]
[IsDomain A]
[UniqueFactorizationMonoid A]
[Field K]
[Algebra A K]
[IsFractionRing A K]
{x : K}

IsIntegral A x → IsLocalization.IsInteger A x


/-- Given `F : SingleFunctors C D A`, and a functor `G : D ⥤ E` which commutes
with the shift by `A`, this is the "composition" of `F` and `G` in `SingleFunctors C E A`. -/
@[simps! functor shiftIso_hom_app shiftIso_inv_app]
def postcomp (G : D ⥤ E) [G.CommShift A] :
    SingleFunctors C E A

(F : CategoryTheory.SingleFunctors C D A)

((F.postcomp G).shiftIso n a a' ha').hom.app X =
  (G.commShiftIso n).inv.app ((F.functor a').obj X) ≫ G.map ((F.shiftIso n a a' ha').hom.app X)


/-- A bimodule object for a pair of monoid objects, all internal to some monoidal category. -/
structure Bimod (A B : Mon_ C) where
  X : C
  actLeft : A.X ⊗ X ⟶ X
  one_actLeft : (A.one ▷ X) ≫ actLeft = (λ_ X).hom := by aesop_cat
  left_assoc :
    (A.mul ▷ X) ≫ actLeft = (α_ A.X A.X X).hom ≫ (A.X ◁ actLeft) ≫ actLeft := by aesop_cat
  actRight : X ⊗ B.X ⟶ X
  actRight_one : (X ◁ B.one) ≫ actRight = (ρ_ X).hom := by aesop_cat
  right_assoc :
    (X ◁ B.mul) ≫ actRight = (α_ X B.X B.X).inv ≫ (actRight ▷ B.X) ≫ actRight := by
    aesop_cat
  middle_assoc :
    (actLeft ▷ B.X) ≫ actRight = (α_ A.X X B.X).hom ≫ (A.X ◁ actRight) ≫ actLeft := by
    aesop_cat

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{A B : Mon_ C}
(self : Bimod A B)

A.one ▷ self.X ≫ self.actLeft = (λ_ self.X).hom


/-- Isomorphic objects have equivalent `MonoOver` categories.
-/
@[simps]
def mapIso {A B : C} (e : A ≅ B) : MonoOver A ≌ MonoOver B

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{A B : C}
(e : A ≅ B)

(CategoryTheory.MonoOver.mapIso e).inverse = CategoryTheory.MonoOver.map e.inv


@[to_additive nsmul_add_sub_nsmul]
lemma pow_mul_pow_sub (a : M) (h : m ≤ n) : a ^ m * a ^ (n - m) = a ^ n

{M : Type u_4}
[Monoid M]
{m n : ℕ}
(a : M)
(h : m ≤ n)


theorem forall_mem_insert [DecidableEq α] (a : α) (s : Finset α) (p : α → Prop) :
    (∀ x, x ∈ insert a s → p x) ↔ p a ∧ ∀ x, x ∈ s → p x

{α : Type u_1}
[DecidableEq α]
(a : α)
(s : Finset α)
(p : α → Prop)

(∀ x ∈ insert a s, p x) ↔ p a ∧ ∀ x ∈ s, p x


@[simp]
theorem inf_sdiff_self_left : y \ x ⊓ x = ⊥

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


theorem coprod.diag_comp {X Y : C} [HasBinaryCoproduct X X] (f : X ⟶ Y) :
    codiag X ≫ f = coprod.desc f f

CategoryTheory.Limits.codiag X ≫ f = CategoryTheory.Limits.coprod.desc f f


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

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


theorem log_of_lt {b n : ℕ} (hb : n < b) : log b n = 0


theorem le_sup' {b : β} (h : b ∈ s) : f b ≤ s.sup' ⟨b, h⟩ f

{α : Type u_2}
{β : Type u_3}
[SemilatticeSup α]
{s : Finset β}
(f : β → α)
{b : β}
(h : b ∈ s)


/-- `limsup (xᵢ - c) = (limsup xᵢ) - c`. -/
lemma limsup_sub_const (F : Filter ι) [NeBot F] [AddCommSemigroup R] [Sub R] [ContinuousSub R]
    [OrderedSub R] (f : ι → R) (c : R)
    (bdd_above : F.IsBoundedUnder (· ≤ ·) f) (cobdd : F.IsCoboundedUnder (· ≤ ·) f) :
    Filter.limsup (fun i ↦ f i - c) F = Filter.limsup f F - c

(bdd_above : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) F f)

(cobdd : Filter.IsCoboundedUnder (fun x x_1 => x ≤ x_1) F f)

Filter.limsup (fun i => f i - c) F = Filter.limsup f F - c


@[simp]
theorem leftUnitor_inv (X : C) : (λ_ X).inv = Limits.coprod.inr

(CategoryTheory.MonoidalCategory.leftUnitor X).inv = CategoryTheory.Limits.coprod.inr


@[to_additive] lemma eq_inv_smul_iff : a = g⁻¹ • b ↔ g • a = b

{G : Type u_3}
{α : Type u_7}
[Group G]
[MulAction G α]
{g : G}
{a b : α}


theorem eq_of_eqOn_set_dense {s : Set R} (hs : closure s = ⊤) {f g : R →ₙ+* S} (h : s.EqOn f g) :
    f = g

{R : Type u}
{S : Type v}
[NonUnitalNonAssocRing R]
[NonUnitalNonAssocRing S]
{s : Set R}
(hs : NonUnitalSubring.closure s = ⊤)
{f g : R →ₙ+* S}
(h : Set.EqOn (⇑f) (⇑g) s)


theorem DirectedOn.convex_sUnion {c : Set (Set E)} (hdir : DirectedOn (· ⊆ ·) c)
    (hc : ∀ ⦃A : Set E⦄, A ∈ c → Convex 𝕜 A) : Convex 𝕜 (⋃₀ c)

(hdir : DirectedOn (fun x x_1 => x ⊆ x_1) c)


(R : Type u_1)
(A : Type u_2)
[CommRing R]
[CommRing A]
[Algebra R A]


@[to_additive mem_add_center]
theorem mem_center {a : G} : a ∈ center G ↔ ∀ g, g * a = a * g

a ∈ IsAddSubgroup.addCenter G ↔ ∀ (g : G), g + a = a + g


@[simp] lemma neg_iff : MeromorphicOn (-f) U ↔ MeromorphicOn f U

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : 𝕜 → E}
{U : Set 𝕜}


/-- If `f` converges to some `y` as `x` tends to `x₀` within `A`,
then `f` tends to `extendFrom A f x` as `x` tends to `x₀`. -/
theorem tendsto_extendFrom {A : Set X} {f : X → Y} {x : X} (h : ∃ y, Tendsto f (𝓝[A] x) (𝓝 y)) :
    Tendsto f (𝓝[A] x) (𝓝 <| extendFrom A f x)

(h : ∃ y, Filter.Tendsto f (𝓝[A] x) (𝓝 y))

Filter.Tendsto f (𝓝[A] x) (𝓝 (extendFrom A f x))


lemma IsClosed.tendsto_coe_cofinite_of_discreteTopology
    {s : Set X} (hs : IsClosed s) (_hs' : DiscreteTopology s) :
    Tendsto ((↑) : s → X) cofinite (cocompact _)

{X : Type u_1}
[TopologicalSpace X]
{s : Set X}
(hs : IsClosed s)
(_hs' : DiscreteTopology ↑s)

Filter.Tendsto Subtype.val Filter.cofinite (Filter.cocompact X)


theorem Valid'.rotateL_lemma₄ {a b : ℕ} (H3 : 2 * b ≤ 9 * a + 3) : 3 * b ≤ 16 * a + 9


@[simp]
theorem toList'_nil (l : List α) :
    Computation.corec (fun ⟨l, s⟩ =>
      match Seq.destruct s with
      | none => Sum.inl l.reverse
      | some (none, s') => Sum.inr (l, s')
      | some (some a, s') => Sum.inr (a::l, s')) (l, nil) = Computation.pure l.reverse

Computation.corec
    (fun x =>
      match x with
      | (l, s) =>
        match Stream'.Seq.destruct s with
        | none => Sum.inl l.reverse
        | some (none, s') => Sum.inr (l, s')
        | some (some a, s') => Sum.inr (a :: l, s'))
    (l, Stream'.WSeq.nil) =
  Computation.pure l.reverse


@[simp]
theorem toOrdinal_eq_zero (a) : toOrdinal a = 0 ↔ a = 0


theorem trans_apply (F : Homotopy p₀ p₁) (G : Homotopy p₁ p₂) (x : I × I) :
    (F.trans G) x =
      if h : (x.1 : ℝ) ≤ 1 / 2 then
        F (⟨2 * x.1, (unitInterval.mul_pos_mem_iff zero_lt_two).2 ⟨x.1.2.1, h⟩⟩, x.2)
      else
        G (⟨2 * x.1 - 1, unitInterval.two_mul_sub_one_mem_iff.2 ⟨(not_le.1 h).le, x.1.2.2⟩⟩, x.2)

{X : Type u}
[TopologicalSpace X]
{x₀ x₁ : X}
{p₀ p₁ p₂ : Path x₀ x₁}
(F : p₀.Homotopy p₁)
(G : p₁.Homotopy p₂)
(x : ↑I × ↑I)

(F.trans G) x = if h : ↑x.1 ≤ 1 / 2 then F (⟨2 * ↑x.1, ⋯⟩, x.2) else G (⟨2 * ↑x.1 - 1, ⋯⟩, x.2)


theorem Prime.not_square (hp : Prime p) : ¬IsSquare p

{α : Type u_1}
[CancelCommMonoidWithZero α]
{p : α}
(hp : Prime p)


@[simp]
theorem id_comp (f : α →ₙ+* β) : (NonUnitalRingHom.id β).comp f = f

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


theorem forall_dual_apply_eq_zero_iff (v : V) : (∀ φ : Module.Dual K V, φ v = 0) ↔ v = 0

(K : Type uK)
{V : Type uV}
[CommRing K]
[AddCommGroup V]
[Module K V]
[Module.Free K V]
(v : V)

(∀ (φ : Module.Dual K V), φ v = 0) ↔ v = 0


@[to_additive mem_leftAddCoset_iff]
theorem mem_leftCoset_iff (a : α) : x ∈ a • s ↔ a⁻¹ * x ∈ s

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


@[simp]
lemma autMap_comp {X Y Z : C} [IsConnected X] [IsGalois Y] [IsGalois Z] (f : X ⟶ Y)
    (g : Y ⟶ Z) : autMap (f ≫ g) = autMap g ∘ autMap f

CategoryTheory.PreGaloisCategory.autMap (CategoryTheory.CategoryStruct.comp f g) =
  CategoryTheory.PreGaloisCategory.autMap g ∘ CategoryTheory.PreGaloisCategory.autMap f


theorem floor_div_nat (a : α) (n : ℕ) : ⌊a / n⌋₊ = ⌊a⌋₊ / n

{α : Type u_2}
[LinearOrderedSemifield α]
[FloorSemiring α]
(a : α)
(n : ℕ)

⌊a / ↑n⌋₊ = ⌊a⌋₊ / n


theorem _root_.Sbtw.sOppSide_of_not_mem_of_mem {s : AffineSubspace R P} {x y z : P}
    (h : Sbtw R x y z) (hx : x ∉ s) (hy : y ∈ s) : s.SOppSide x z

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y z : P}
(h : Sbtw R x y z)
(hx : x ∉ s)
(hy : y ∈ s)


/-- A Vitali family in a space with a uniformly locally doubling measure, designed so that the sets
at `x` contain all `closedBall y r` when `dist x y ≤ K * r`. -/
irreducible_def vitaliFamily (K : ℝ) : VitaliFamily μ

IsUnifLocDoublingMeasure.vitaliFamily μ K =
  let R := IsUnifLocDoublingMeasure.scalingScaleOf μ (max (4 * K + 3) 3);
  let_fun Rpos := ⋯;
  let_fun A := ⋯;
  (Vitali.vitaliFamily μ (IsUnifLocDoublingMeasure.scalingConstantOf μ (max (4 * K + 3) 3)) A).enlarge (R / 4) ⋯


theorem finsuppTensorFinsuppRid_self :
    finsuppTensorFinsuppRid R R ι κ = finsuppTensorFinsupp' R ι κ

(R : Type u_1)
(ι : Type u_5)
(κ : Type u_6)
[CommSemiring R]


/-- Specialization of `ConcreteCategory.id_apply` because `simp` can't see through the defeq. -/
@[simp] lemma id_apply (R : CommRingCat) (x : R) : 𝟙 R x = x


protected theorem max_lt {a b c : Nat} : max a b < c ↔ a < c ∧ b < c


lemma one_mem_posTangentConeAt_iff_mem_closure :
    1 ∈ posTangentConeAt s a ↔ a ∈ closure (Ioi a ∩ s)

1 ∈ posTangentConeAt s a ↔ a ∈ closure (Set.Ioi a ∩ s)


@[to_additive]
theorem IsOpen.iUnion_smul [IsMinimal G α] {U : Set α} (hUo : IsOpen U) (hne : U.Nonempty) :
    ⋃ g : G, g • U = univ

(G : Type u_2)
{α : Type u_3}
[AddGroup G]
[TopologicalSpace α]
[AddAction G α]
[AddAction.IsMinimal G α]
{U : Set α}
(hUo : IsOpen U)
(hne : U.Nonempty)


theorem completeTheory_eq (h : M ≅[L] N) : L.completeTheory M = L.completeTheory N

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
(h : L.ElementarilyEquivalent M N)


theorem clog_of_one_le_right (b : ℕ) {r : R} (hr : 1 ≤ r) : clog b r = Nat.clog b ⌈r⌉₊

{R : Type u_1}
[LinearOrderedSemifield R]
[FloorSemiring R]
(b : ℕ)
{r : R}
(hr : 1 ≤ r)


theorem finrank_lt_finrank_of_lt {s t : Submodule K V} [FiniteDimensional K t] (hst : s < t) :
    finrank K s < finrank K t

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
{s t : Submodule K V}
[FiniteDimensional K ↥t]
(hst : s < t)

FiniteDimensional.finrank K ↥s < FiniteDimensional.finrank K ↥t


@[simp]
theorem sum_elim_comp_relabelAux {m : ℕ} {g : α → β ⊕ (Fin n)} {v : β → M}
    {xs : Fin (n + m) → M} : Sum.elim v xs ∘ relabelAux g m =
    Sum.elim (Sum.elim v (xs ∘ castAdd m) ∘ g) (xs ∘ natAdd n)

{M : Type w}
{α : Type u'}
{β : Type v'}
{n m : ℕ}
{g : α → β ⊕ Fin n}
{v : β → M}
{xs : Fin (n + m) → M}

Sum.elim v xs ∘ FirstOrder.Language.BoundedFormula.relabelAux g m =
  Sum.elim (Sum.elim v (xs ∘ Fin.castAdd m) ∘ g) (xs ∘ Fin.natAdd n)


theorem Prod.continuous_inv_fun :
    ContinuousOn (Prod.invFun' e₁ e₂) ((e₁.baseSet ∩ e₂.baseSet) ×ˢ univ)

[TopologicalSpace (Bundle.TotalSpace F₁ E₁)]

[TopologicalSpace (Bundle.TotalSpace F₂ E₂)]

{e₁ : Trivialization F₁ Bundle.TotalSpace.proj}

{e₂ : Trivialization F₂ Bundle.TotalSpace.proj}

ContinuousOn (Trivialization.Prod.invFun' e₁ e₂) ((e₁.baseSet ∩ e₂.baseSet) ×ˢ Set.univ)


/-- Given a morphism `h : Y ⟶ X`, send a sieve S on X to a sieve on Y
    as the inverse image of S with `_ ≫ h`.
    That is, `Sieve.pullback S h := (≫ h) '⁻¹ S`. -/
@[simps]
def pullback (h : Y ⟶ X) (S : Sieve X) : Sieve Y

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y : C}
(h : Y ⟶ X)
(S : CategoryTheory.Sieve X)

∀ (Y_1 : C) (sl : Y_1 ⟶ Y),
  (CategoryTheory.Sieve.pullback h S).arrows sl = S.arrows (CategoryTheory.CategoryStruct.comp sl h)


theorem Finite.exists_bijOn_of_encard_eq [Nonempty β] (hs : s.Finite) (h : s.encard = t.encard) :
    ∃ (f : α → β), BijOn f s t

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
[Nonempty β]
(hs : s.Finite)
(h : s.encard = t.encard)


@[simp] lemma mkRat_one (n : ℤ) : mkRat n 1 = n


@[to_additive (attr := simp)]
lemma zpow_right (h : Commute a b) (m : ℤ) : Commute a (b ^ m)

{G : Type u_1}
[AddGroup G]
{a b : G}
(h : AddCommute a b)
(m : ℤ)


/-- The cardinality of the quaternions, as a type. -/
@[simp]
theorem mk_quaternion : #(ℍ[R]) = #R ^ 4


theorem Continuous.compMeasurePreservingLp (hf : Continuous f) (hg : Continuous g)
    (hgm : ∀ z, MeasurePreserving (g z) μ ν) (hp : p ≠ ∞) :
    Continuous (fun z ↦ Lp.compMeasurePreserving (g z) (hgm z) (f z))

(hgm : ∀ (z : Z), MeasureTheory.MeasurePreserving (⇑(g z)) μ ν)

Continuous fun z => (MeasureTheory.Lp.compMeasurePreserving ⇑(g z) ⋯) (f z)


lemma not_LSeriesSummable_moebius_at_one : ¬ LSeriesSummable ↗μ 1

¬LSeriesSummable (fun n => ↑(ArithmeticFunction.moebius n)) 1


@[to_additive bot_prod_bot]
theorem bot_prod_bot : (⊥ : Subsemigroup M).prod (⊥ : Subsemigroup N) = ⊥

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


theorem Convex.add_smul (h_conv : Convex 𝕜 s) {p q : 𝕜} (hp : 0 ≤ p) (hq : 0 ≤ q) :
    (p + q) • s = p • s + q • s

{𝕜 : Type u_1}
{E : Type u_2}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
(h_conv : Convex 𝕜 s)
{p q : 𝕜}
(hp : 0 ≤ p)
(hq : 0 ≤ q)


@[reassoc (attr := simp)]
theorem cokernel.π_desc {W : C} (k : Y ⟶ W) (h : f ≫ k = 0) :
    cokernel.π f ≫ cokernel.desc f k h = k

CategoryTheory.Limits.cokernel.π f ≫ CategoryTheory.Limits.cokernel.desc f k h = k


theorem coe_pow (e : M ≃ₗ[R] M) (n : ℕ) : ⇑(e ^ n) = e^[n]

{R : Type u_1}
{M : Type u_8}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(e : M ≃ₗ[R] M)
(n : ℕ)


@[to_additive]
theorem IsCompact.exists_finite_cover_smul [IsMinimal G α] [ContinuousConstSMul G α]
    {K U : Set α} (hK : IsCompact K) (hUo : IsOpen U) (hne : U.Nonempty) :
    ∃ I : Finset G, K ⊆ ⋃ g ∈ I, g • U

(G : Type u_2)
{α : Type u_3}
[Group G]
[TopologicalSpace α]
[MulAction G α]
[MulAction.IsMinimal G α]
[ContinuousConstSMul G α]
{K U : Set α}
(hK : IsCompact K)
(hUo : IsOpen U)
(hne : U.Nonempty)


theorem epi_of_epi {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) [Epi (f ≫ g)] : Epi g

[CategoryTheory.Epi (CategoryTheory.CategoryStruct.comp f g)]


/-- A multiplicative isomorphism preserves multiplication. -/
@[to_additive "An additive isomorphism preserves addition."]
protected theorem map_mul (f : M ≃* N) : ∀ x y, f (x * y) = f x * f y

{M : Type u_6}
{N : Type u_7}
[Add M]
[Add N]
(f : M ≃+ N)
(x y : M)


theorem leftMoves_mul_cases {x y : PGame} (k) {P : (x * y).LeftMoves → Prop}
    (hl : ∀ ix iy, P <| toLeftMovesMul (Sum.inl ⟨ix, iy⟩))
    (hr : ∀ jx jy, P <| toLeftMovesMul (Sum.inr ⟨jx, jy⟩)) : P k

(hl : ∀ (ix : x.LeftMoves) (iy : y.LeftMoves), P (SetTheory.PGame.toLeftMovesMul (Sum.inl (ix, iy))))

(hr : ∀ (jx : x.RightMoves) (jy : y.RightMoves), P (SetTheory.PGame.toLeftMovesMul (Sum.inr (jx, jy))))


theorem realize_liftAt_one {n m : ℕ} {φ : L.BoundedFormula α n} {v : α → M} {xs : Fin (n + 1) → M}
    (hmn : m ≤ n) :
    (φ.liftAt 1 m).Realize v xs ↔
      φ.Realize v (xs ∘ fun i => if ↑i < m then castSucc i else i.succ)

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{n m : ℕ}
{φ : L.BoundedFormula α n}
{v : α → M}
{xs : Fin (n + 1) → M}
(hmn : m ≤ n)

(FirstOrder.Language.BoundedFormula.liftAt 1 m φ).Realize v xs ↔
  φ.Realize v (xs ∘ fun i => if ↑i < m then i.castSucc else i.succ)


theorem mod_def : p % q = p %ₘ (q * C (leadingCoeff q)⁻¹)

p % q = p %ₘ (q * Polynomial.C q.leadingCoeff⁻¹)


/-- The relative product of homotopies `F` and `G`,
  where `F` takes `f₀` to `f₁` and `G` takes `g₀` to `g₁` -/
@[simps!]
def HomotopyRel.prod (F : HomotopyRel f₀ f₁ S) (G : HomotopyRel g₀ g₁ S) :
    HomotopyRel (prodMk f₀ g₀) (prodMk f₁ g₁) S

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{A : Type u_3}
[TopologicalSpace A]
{f₀ f₁ : C(A, α)}
{g₀ g₁ : C(A, β)}
{S : Set A}
(F : f₀.HomotopyRel f₁ S)
(G : g₀.HomotopyRel g₁ S)
(t : ↑unitInterval × A)


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

{α : Type u_2}
[Mul α]
[IsLeftCancelMul α]
[DecidableEq α]
(t : Finset α)
(a : α)


@[measurability]
theorem measurableSet_le {f g : δ → α} (hf : Measurable f) (hg : Measurable g) :
    MeasurableSet { a | f a ≤ g a }

{α : Type u_1}
{δ : Type u_4}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[MeasurableSpace δ]
[PartialOrder α]
[OrderClosedTopology α]
[SecondCountableTopology α]
{f g : δ → α}
(hf : Measurable f)
(hg : Measurable g)


theorem iSup₂_disjoint_iff {f : ∀ i, κ i → α} :
    Disjoint (⨆ (i) (j), f i j) a ↔ ∀ i j, Disjoint (f i j) a

{α : Type u}
{ι : Sort w}
{κ : ι → Sort w'}
[Order.Frame α]
{a : α}
{f : (i : ι) → κ i → α}

Disjoint (⨆ i, ⨆ j, f i j) a ↔ ∀ (i : ι) (j : κ i), Disjoint (f i j) a


theorem dvd_gcd {a : α} : (∀ b ∈ s, a ∣ f b) → a ∣ s.gcd f

{α : Type u_2}
{β : Type u_3}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{s : Finset β}
{f : β → α}
{a : α}


@[simp] lemma cons_le_cons (ha hb) : toColex (s.cons a ha) ≤ toColex (s.cons b hb) ↔ a ≤ b

{α : Type u_1}
[PartialOrder α]
{s : Finset α}
{a b : α}
(ha : a ∉ s)
(hb : b ∉ s)

{ ofColex := Finset.cons a s ha } ≤ { ofColex := Finset.cons b s hb } ↔ a ≤ b


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

{α : Type u_3}
{β : Type u_4}
[Mul α]
[Mul β]
(f : α →ₙ* β)
(I : Type u_5)
(h : I → α)

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


theorem tail_iterate (f : α → α) (a : α) : tail (iterate f a) = iterate f (f a)

(Stream'.iterate f a).tail = Stream'.iterate f (f a)


@[to_additive]
theorem contMDiffOn_finset_prod (h : ∀ i ∈ t, ContMDiffOn I' I n (f i) s) :
    ContMDiffOn I' I n (fun x => ∏ i ∈ t, f i x) s

ContMDiffOn I' I n (fun x => ∑ i ∈ t, f i x) s


theorem IsCodetecting.mono {𝒢 : Set C} (h𝒢 : IsCodetecting 𝒢) {ℋ : Set C} (h𝒢ℋ : 𝒢 ⊆ ℋ) :
    IsCodetecting ℋ

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{𝒢 : Set C}
(h𝒢 : CategoryTheory.IsCodetecting 𝒢)
{ℋ : Set C}
(h𝒢ℋ : 𝒢 ⊆ ℋ)


/-- The trace form of a Lie module is compatible with the action of the Lie algebra.

See also `LieModule.traceForm_apply_lie_apply'`. -/
lemma traceForm_apply_lie_apply (x y z : L) :
    traceForm R L M ⁅x, y⁆ z = traceForm R L M x ⁅y, z⁆

(R : Type u_1)
(L : Type u_3)
(M : Type u_4)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(x y z : L)

((LieModule.traceForm R L M) ⁅x, y⁆) z = ((LieModule.traceForm R L M) x) ⁅y, z⁆


theorem adjoin_eq_sInf : adjoin R s = sInf { p : Subalgebra R A | s ⊆ p }

{R : Type uR}
{A : Type uA}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{s : Set A}


theorem repr_opow_aux₁ {e a} [Ne : NF e] [Na : NF a] {a' : Ordinal} (e0 : repr e ≠ 0)
    (h : a' < (ω : Ordinal.{0}) ^ repr e) (aa : repr a = a') (n : ℕ+) :
    ((ω : Ordinal.{0}) ^ repr e * (n : ℕ) + a') ^ (ω : Ordinal.{0}) =
      (ω ^ repr e) ^ (ω : Ordinal.{0})

{e a : ONote}
[Ne : e.NF]
[Na : a.NF]
{a' : Ordinal.{0}}
(e0 : e.repr ≠ 0)
(h : a' < ω ^ e.repr)
(aa : a.repr = a')
(n : ℕ+)

(ω ^ e.repr * ↑↑n + a') ^ ω = (ω ^ e.repr) ^ ω


@[simp]
theorem den_pow (c : NumDenSameDeg 𝒜 x) (n : ℕ) : ((c ^ n).den : A) = (c.den : A) ^ n

(c : HomogeneousLocalization.NumDenSameDeg 𝒜 x)


theorem IsPrime.multiset_prod_le {s : Multiset (Ideal R)} {P : Ideal R} (hp : IsPrime P) :
    s.prod ≤ P ↔ ∃ I ∈ s, I ≤ P

{R : Type u}
[CommSemiring R]
{s : Multiset (Ideal R)}
{P : Ideal R}
(hp : P.IsPrime)


theorem append_left (R : α → α → Prop) {t₁ t₂} (h : Lex R t₁ t₂) : ∀ s, Lex R (s ++ t₁) (s ++ t₂)

{α : Type u}
(R : α → α → Prop)
{t₁ t₂ : List α}
(h : List.Lex R t₁ t₂)
(s : List α)


theorem divisors_subset_of_dvd {m : ℕ} (hzero : n ≠ 0) (h : m ∣ n) : divisors m ⊆ divisors n


theorem LeftInverse.preimage_preimage {g : β → α} (h : LeftInverse g f) (s : Set α) :
    f ⁻¹' (g ⁻¹' s) = s

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{g : β → α}
(h : Function.LeftInverse g f)
(s : Set α)


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

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


@[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}
[VAdd α β]
(s : (i : ι) → κ i → Set α)
(t : Set β)

(⋃ i, ⋃ j, s i j) +ᵥ t = ⋃ i, ⋃ j, s i j +ᵥ t


/-- Auxiliary lemma for `MeasureTheory.Memℒp.eLpNorm_indicator_le`. -/
theorem Memℒp.eLpNorm_indicator_le' (hp_one : 1 ≤ p) (hp_top : p ≠ ∞) (hf : Memℒp f p μ)
    (hmeas : StronglyMeasurable f) {ε : ℝ} (hε : 0 < ε) :
    ∃ (δ : ℝ) (hδ : 0 < δ), ∀ s, MeasurableSet s → μ s ≤ ENNReal.ofReal δ →
      eLpNorm (s.indicator f) p μ ≤ 2 * ENNReal.ofReal ε

(hmeas : MeasureTheory.StronglyMeasurable f)

∃ δ,
  ∃ (_ : 0 < δ),
    ∀ (s : Set α),
      MeasurableSet s → μ s ≤ ENNReal.ofReal δ → MeasureTheory.eLpNorm (s.indicator f) p μ ≤ 2 * ENNReal.ofReal ε


/-- The definition of convolution where the bilinear operator is multiplication. -/
theorem convolution_mul [Sub G] [NormedSpace ℝ 𝕜] {f : G → 𝕜} {g : G → 𝕜} :
    (f ⋆[mul 𝕜 𝕜, μ] g) x = ∫ t, f t * g (x - t) ∂μ

{𝕜 : Type u𝕜}
{G : Type uG}
{x : G}
[NontriviallyNormedField 𝕜]
[MeasurableSpace G]
{μ : MeasureTheory.Measure G}
[Sub G]
[NormedSpace ℝ 𝕜]
{f g : G → 𝕜}

MeasureTheory.convolution f g (ContinuousLinearMap.mul 𝕜 𝕜) μ x = ∫ (t : G), f t * g (x - t) ∂μ


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


@[simp]
lemma sheafHomSectionsEquiv_symm_apply_coe_apply {F G : Sheaf J A} (φ : F ⟶ G) (X : Cᵒᵖ) :
    ((sheafHomSectionsEquiv F G).symm φ).1 X = (J.overPullback A X.unop).map φ

{J : CategoryTheory.GrothendieckTopology C}

↑((CategoryTheory.sheafHomSectionsEquiv F G).symm φ) X = (J.overPullback A (Opposite.unop X)).map φ


@[simp]
theorem coe_restrictScalars (f : A →ₐ[S] B) : (f.restrictScalars R : A →+* B) = f

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


@[simp]
theorem splitMul_apply (x : Unitization 𝕜 A) :
    splitMul 𝕜 A x = (x.fst, algebraMap 𝕜 (A →L[𝕜] A) x.fst + mul 𝕜 A x.snd)

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[IsScalarTower 𝕜 A A]
[SMulCommClass 𝕜 A A]
(x : Unitization 𝕜 A)

(Unitization.splitMul 𝕜 A) x = (x.fst, (algebraMap 𝕜 (A →L[𝕜] A)) x.fst + (ContinuousLinearMap.mul 𝕜 A) x.snd)


protected theorem Walk.reachable {G : SimpleGraph V} {u v : V} (p : G.Walk u v) : G.Reachable u v

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


/-- If a discrete group acts on a T2 and locally compact space `X`,
then the action is properly discontinuous if and only if it is continuous in the second variable
and proper. -/
theorem WeaklyLocallyCompactSpace.properlyDiscontinuousSMul_iff_properSMul [T2Space X]
    [WeaklyLocallyCompactSpace X] [DiscreteTopology G] [ContinuousConstSMul G X] :
    ProperlyDiscontinuousSMul G X ↔ ProperSMul G X

{G : Type u_1}
{X : Type u_2}
[Group G]
[MulAction G X]
[TopologicalSpace G]
[TopologicalSpace X]
[T2Space X]
[WeaklyLocallyCompactSpace X]
[DiscreteTopology G]
[ContinuousConstSMul G X]


protected theorem add_comm : ∀ (n m : Nat), n + m = m + n


/-- If two groups `H` and `G` act on a topological space `X` such that `G` acts properly and
there exists a group homomorphims `H → G` which is a closed embedding compatible with the actions,
then `H` also acts properly on `X`. -/
@[to_additive "If two groups `H` and `G` act on a topological space `X` such that `G` acts properly
and there exists a group homomorphims `H → G` which is a closed embedding compatible with the
actions, then `H` also acts properly on `X`."]
theorem properSMul_of_closedEmbedding {H : Type*} [Group H] [MulAction H X] [TopologicalSpace H]
    [ProperSMul G X] (f : H →* G) (f_clemb : ClosedEmbedding f)
    (f_compat : ∀ (h : H) (x : X), f h • x = h • x) : ProperSMul H X

(f_compat : ∀ (h : H) (x : X), f h +ᵥ x = h +ᵥ x)


lemma isClique_pair : G.IsClique {a, b} ↔ a ≠ b → G.Adj a b

{α : Type u_1}
{G : SimpleGraph α}
{a b : α}


theorem mono_of_mono {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z) [Mono (f ≫ g)] : Mono f

[CategoryTheory.Mono (CategoryTheory.CategoryStruct.comp f g)]


@[simp]
theorem biproduct.isoCoproduct_hom {f : J → C} [HasBiproduct f] :
    (biproduct.isoCoproduct f).hom = biproduct.desc (Sigma.ι f)

(CategoryTheory.Limits.biproduct.isoCoproduct f).hom =
  CategoryTheory.Limits.biproduct.desc (CategoryTheory.Limits.Sigma.ι f)


@[simp]
theorem prodMap_smul [Module S M₃] [Module S M₄] [SMulCommClass R S M₃] [SMulCommClass R S M₄]
    (s : S) (f : M →ₗ[R] M₃) (g : M₂ →ₗ[R] M₄) : prodMap (s • f) (s • g) = s • prodMap f g

{R : Type u}
{M : Type v}
{M₂ : Type w}
{M₃ : Type y}
{M₄ : Type z}
(S : Type u_3)
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[AddCommMonoid M₄]
[Module R M]
[Module R M₂]
[Module R M₃]
[Module R M₄]
[Module S M₃]
[Module S M₄]
[SMulCommClass R S M₃]
[SMulCommClass R S M₄]
(s : S)
(f : M →ₗ[R] M₃)
(g : M₂ →ₗ[R] M₄)

(s • f).prodMap (s • g) = s • f.prodMap g


@[simp]
theorem diag_conjTranspose [AddMonoid α] [StarAddMonoid α] (A : Matrix n n α) :
    diag Aᴴ = star (diag A)

{n : Type u_3}
{α : Type v}
[AddMonoid α]
[StarAddMonoid α]
(A : Matrix n n α)


/-- Given an affinely independent family of points, suppose that an affine combination lies in
the span of one point of that family and a combination of another two points of that family given
by `lineMap` with coefficient between 0 and 1. Then the coefficients of those two points in the
combination lying in the span have the same sign. -/
theorem sign_eq_of_affineCombination_mem_affineSpan_single_lineMap {p : ι → P}
    (h : AffineIndependent k p) {w : ι → k} {s : Finset ι} (hw : ∑ i ∈ s, w i = 1) {i₁ i₂ i₃ : ι}
    (h₁ : i₁ ∈ s) (h₂ : i₂ ∈ s) (h₃ : i₃ ∈ s) (h₁₂ : i₁ ≠ i₂) (h₁₃ : i₁ ≠ i₃) (h₂₃ : i₂ ≠ i₃)
    {c : k} (hc0 : 0 < c) (hc1 : c < 1)
    (hs : s.affineCombination k p w ∈ line[k, p i₁, AffineMap.lineMap (p i₂) (p i₃) c]) :
    SignType.sign (w i₂) = SignType.sign (w i₃)

(hs : (Finset.affineCombination k s p) w ∈ affineSpan k {p i₁, (AffineMap.lineMap (p i₂) (p i₃)) c})


@[to_additive]
lemma ite_le_one [LE α] (ha : a ≤ 1) (hb : b ≤ 1) : ite p a b ≤ 1

{α : Type u_2}
[One α]
{p : Prop}
[Decidable p]
{a b : α}
[LE α]
(ha : a ≤ 1)
(hb : b ≤ 1)


theorem map_range_eq_span_tmul (f : M →ₗ[R] P) (g : N →ₗ[R] Q) :
    range (map f g) = Submodule.span R { t | ∃ m n, f m ⊗ₜ g n = t }

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
{Q : Type u_7}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[AddCommMonoid Q]
[Module R M]
[Module R N]
[Module R P]
[Module R Q]
(f : M →ₗ[R] P)
(g : N →ₗ[R] Q)

LinearMap.range (TensorProduct.map f g) = Submodule.span R {t | ∃ m n, f m ⊗ₜ[R] g n = t}


@[simp]
theorem coe_comp_to_continuous_fun (f : C₀(γ, δ)) (g : β →co γ) : ((f.comp g) : β → δ) = f ∘ g

{β : Type v}
{γ : Type w}
{δ : Type u_2}
[TopologicalSpace β]
[TopologicalSpace γ]
[TopologicalSpace δ]
[Zero δ]
(f : γ →C₀ δ)
(g : CocompactMap β γ)


/-- A family of points in a projective space is dependent if and only if their
representatives are linearly dependent. -/
theorem dependent_iff : Dependent f ↔ ¬LinearIndependent K (Projectivization.rep ∘ f)

{ι : Type u_1}
{K : Type u_2}
{V : Type u_3}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
{f : ι → ℙ K V}

Projectivization.Dependent f ↔ ¬LinearIndependent K (Projectivization.rep ∘ f)


theorem lt_untop'_iff {a : WithTop α} {b c : α} (h : a = ⊤ → c < b) :
    c < a.untop' b ↔ c < a

{α : Type u_1}
[LT α]
{a : WithTop α}
{b c : α}
(h : a = ⊤ → c < b)


@[simp] lemma coe_lie_shiftedWeightSpace_apply (x : L) (m : shiftedWeightSpace R L M χ) :
    ⁅x, m⁆ = ⁅x, (m : M)⁆ - χ x • m

(m : ↥(LieModule.shiftedWeightSpace R L M χ))


theorem Ici_mem_nhdsSet_Icc (h : a < b) : Ici a ∈ 𝓝ˢ (Icc b c)

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


@[reassoc (attr := simp)]
theorem inl_isoIsPushout_hom (h : IsPushout f g inl inr) (h' : IsPushout f g inl' inr') :
    inl ≫ (h.isoIsPushout h').hom = inl'

(h : CategoryTheory.IsPushout f g inl inr)

(h' : CategoryTheory.IsPushout f g inl' inr')

inl ≫ (CategoryTheory.IsPushout.isoIsPushout X Y h h').hom = inl'


@[to_additive (attr := simp)]
theorem iterate_map_div {M F : Type*} [Group M] [FunLike F M M] [MonoidHomClass F M M]
    (f : F) (n : ℕ) (x y : M) :
    f^[n] (x / y) = f^[n] x / f^[n] y

{M : Type u_5}
{F : Type u_6}
[AddGroup M]
[FunLike F M M]
[AddMonoidHomClass F M M]
(f : F)
(n : ℕ)
(x y : M)


theorem Finite.vsub (hs : s.Finite) (ht : t.Finite) : Set.Finite (s -ᵥ t)

{α : Type u_2}
{β : Type u_3}
[VSub α β]
{s t : Set β}
(hs : s.Finite)
(ht : t.Finite)


theorem power_self_eq {c : Cardinal} (h : ℵ₀ ≤ c) : c ^ c = 2 ^ c


@[to_additive (attr := simp)]
lemma inv_op_smul_set_distrib (a : α) (s : Set α) : (op a • s)⁻¹ = a⁻¹ • s⁻¹

{α : Type u_2}
[AddGroup α]
(a : α)
(s : Set α)


theorem Infinite.not_infinitesimal {x : ℝ*} (h : Infinite x) : ¬Infinitesimal x


theorem AntitoneOn.convex_ge (hf : AntitoneOn f s) (hs : Convex 𝕜 s) (r : β) :
    Convex 𝕜 ({ x ∈ s | r ≤ f x })

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[OrderedSemiring 𝕜]
[LinearOrderedAddCommMonoid E]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{s : Set E}
{f : E → β}
(hf : AntitoneOn f s)
(hs : Convex 𝕜 s)
(r : β)


/-- A split epi `f` coequalizes `(f ≫ section_ f)` and `(𝟙 X)`.
Here we build the cocone, and show in `isSplitEpiCoequalizes` that it is a colimit cocone.
-/
-- @[simps (config := { rhsMd := semireducible })] Porting note: no semireducible
@[simps!]
noncomputable def coconeOfIsSplitEpi : Cofork (𝟙 X) (f ≫ section_ f)

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

∀ (X_1 : CategoryTheory.Limits.WalkingParallelPair),
  (CategoryTheory.Limits.coconeOfIsSplitEpi f).ι.app X_1 = CategoryTheory.Limits.WalkingParallelPair.rec f f X_1


lemma lie_eq_self_of_isAtom_of_ne_bot (hN : IsAtom N) (h : ⁅I, N⁆ ≠ ⊥) : ⁅I, N⁆ = N

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
{N : LieSubmodule R L M}
{I : LieIdeal R L}
(hN : IsAtom N)
(h : ⁅I, N⁆ ≠ ⊥)


lemma linearIndependent_lapMatrix_ker_basis_aux :
    LinearIndependent ℝ (lapMatrix_ker_basis_aux G)

{V : Type u_1}
[Fintype V]
[DecidableEq V]
(G : SimpleGraph V)
[DecidableRel G.Adj]
[DecidableEq G.ConnectedComponent]


@[to_additive]
theorem contMDiff_finset_prod (h : ∀ i ∈ t, ContMDiff I' I n (f i)) :
    ContMDiff I' I n fun x => ∏ i ∈ t, f i x

{ι : Type u_1}
{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{H : Type u_3}
[TopologicalSpace H]
{E : Type u_4}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_5}
[AddCommMonoid G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothAdd I G]
{E' : Type u_6}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_7}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_8}
[TopologicalSpace M]
[ChartedSpace H' M]
{t : Finset ι}
{f : ι → M → G}
{n : ℕ∞}
(h : ∀ i ∈ t, ContMDiff I' I n (f i))

ContMDiff I' I n fun x => ∑ i ∈ t, f i x


@[simp]
theorem psum_one : psum σ R 1 = ∑ i, X i

(σ : Type u_1)
(R : Type u_2)
[CommSemiring R]
[Fintype σ]

MvPolynomial.psum σ R 1 = ∑ i : σ, MvPolynomial.X i


theorem mem_of_mem_erase {a b : α} {l : List α} (h : a ∈ l.erase b) : a ∈ l

{α : Type u_1}
[BEq α]
{a b : α}
{l : List α}
(h : a ∈ l.erase b)


theorem roots_prod {ι : Type*} (f : ι → R[X]) (s : Finset ι) :
    s.prod f ≠ 0 → (s.prod f).roots = s.val.bind fun i => roots (f i)

{R : Type u}
[CommRing R]
[IsDomain R]
{ι : Type u_1}
(f : ι → Polynomial R)
(s : Finset ι)

s.prod f ≠ 0 → (s.prod f).roots = s.val.bind fun i => (f i).roots


@[simp]
protected theorem coe_of_orthogonal_eq_bot_mk (hon : Orthonormal 𝕜 v)
    (hsp : (span 𝕜 (Set.range v))ᗮ = ⊥) : ⇑(OrthonormalBasis.mkOfOrthogonalEqBot hon hsp) = v

(hsp : (Submodule.span 𝕜 (Set.range v))ᗮ = ⊥)


theorem vec_single_eq_const (a : α) : ![a] = fun _ => a


theorem inv_pos_le_iff_one_le_mul' (ha : 0 < a) : a⁻¹ ≤ b ↔ 1 ≤ a * b

{α : Type u_2}
[LinearOrderedSemifield α]
{a b : α}
(ha : 0 < a)


theorem coeFn_nonneg (f : Lp.simpleFunc G p μ) : (0 : α → G) ≤ᵐ[μ] f ↔ 0 ≤ f

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

0 ≤ᵐ[μ] ↑↑↑f ↔ 0 ≤ f


/-- If `‖r₁‖ < r₂`, then for any natural `k` we have `n ^ k r₁ ^ n = o (r₂ ^ n)` as `n → ∞`. -/
theorem isLittleO_pow_const_mul_const_pow_const_pow_of_norm_lt {R : Type*} [NormedRing R] (k : ℕ)
    {r₁ : R} {r₂ : ℝ} (h : ‖r₁‖ < r₂) :
    (fun n ↦ (n : R) ^ k * r₁ ^ n : ℕ → R) =o[atTop] fun n ↦ r₂ ^ n

{R : Type u_4}
[NormedRing R]
(k : ℕ)
{r₁ : R}
{r₂ : ℝ}
(h : ‖r₁‖ < r₂)

(fun n => ↑n ^ k * r₁ ^ n) =o[Filter.atTop] fun n => r₂ ^ n


lemma cfc_inv (hf' : ∀ x ∈ spectrum R a, f x ≠ 0)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    cfc (fun x ↦ (f x) ⁻¹) a = Ring.inverse (cfc f a)

cfc (fun x => (f x)⁻¹) a = Ring.inverse (cfc f a)


/-- A set of orthogonal vectors `v` with respect to some sesquilinear map `B` is linearly
  independent if for all `i`, `B (v i) (v i) ≠ 0`. -/
theorem linearIndependent_of_isOrthoᵢ {B : V₁ →ₛₗ[I₁] V₁ →ₛₗ[I₁'] V} {v : n → V₁}
    (hv₁ : B.IsOrthoᵢ v) (hv₂ : ∀ i, ¬B.IsOrtho (v i) (v i)) : LinearIndependent K₁ v

(hv₂ : ∀ (i : n), ¬B.IsOrtho (v i) (v i))


/-- Corresponds to `dist_pos`. -/
@[simp]
theorem hammingDist_pos {x y : ∀ i, β i} : 0 < hammingDist x y ↔ x ≠ y

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


lemma IsCompl.preimage (f : α → β) {s t : Set β} (h : IsCompl s t) :
    IsCompl (f ⁻¹' s) (f ⁻¹' t)

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


/-- See also `Cardinal.nsmul_lt_aleph0_iff_of_ne_zero` if you already have `n ≠ 0`. -/
theorem nsmul_lt_aleph0_iff {n : ℕ} {a : Cardinal} : n • a < ℵ₀ ↔ n = 0 ∨ a < ℵ₀

n • a < Cardinal.aleph0 ↔ n = 0 ∨ a < Cardinal.aleph0


/-- "Precomposition" of `F : ComposableArrows C n` by a morphism `f : X ⟶ F.left`. -/
@[simps]
def precomp {X : C} (f : X ⟶ F.left) : ComposableArrows C (n + 1)

(F : CategoryTheory.ComposableArrows C n)

∀ {X_1 Y : Fin (n + 1 + 1)} (g : X_1 ⟶ Y), (F.precomp f).map g = CategoryTheory.ComposableArrows.Precomp.map F f X_1 Y ⋯


protected theorem Tendsto.sub {f : Filter α} {ma : α → ℝ≥0∞} {mb : α → ℝ≥0∞} {a b : ℝ≥0∞}
    (hma : Tendsto ma f (𝓝 a)) (hmb : Tendsto mb f (𝓝 b)) (h : a ≠ ∞ ∨ b ≠ ∞) :
    Tendsto (fun a => ma a - mb a) f (𝓝 (a - b))

{α : Type u_1}
{f : Filter α}
{ma mb : α → ℝ≥0∞}
{a b : ℝ≥0∞}
(hma : Filter.Tendsto ma f (𝓝 a))
(hmb : Filter.Tendsto mb f (𝓝 b))
(h : a ≠ ⊤ ∨ b ≠ ⊤)

Filter.Tendsto (fun a => ma a - mb a) f (𝓝 (a - b))


theorem frontier_subset_iff_isClosed : frontier s ⊆ s ↔ IsClosed s

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


@[reassoc]
lemma inlX_d (i j k : ι) (hij : c.Rel i j) (hjk : c.Rel j k) :
    inlX φ j i hij ≫ d φ i j = -F.d j k ≫ inlX φ k j hjk + φ.f j ≫ inrX φ j

HomologicalComplex.homotopyCofiber.inlX φ j i hij ≫ HomologicalComplex.homotopyCofiber.d φ i j =
  -F.d j k ≫ HomologicalComplex.homotopyCofiber.inlX φ k j hjk + φ.f j ≫ HomologicalComplex.homotopyCofiber.inrX φ j


@[to_additive]
lemma mulIndicator_apply_le {a : α} {s : Set α} {f g : α → M} (hfg : a ∈ s → f a ≤ g a) :
    mulIndicator s f a ≤ g a

{α : Type u_2}
{M : Type u_4}
[CanonicallyOrderedCommMonoid M]
{a : α}
{s : Set α}
{f g : α → M}
(hfg : a ∈ s → f a ≤ g a)


@[simp]
theorem sep_setOf : { x ∈ { y | p y } | q x } = { x | p x ∧ q x }

{x | x ∈ {y | p y} ∧ q x} = {x | p x ∧ q x}


@[simp]
theorem map_zero [Nonempty ι] : f 0 = 0

{R : Type u}
{ι : Type v}
{M₁ : ι → Type w₁}
{M₂ : Type w₂}
[Semiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
[(i : ι) → TopologicalSpace (M₁ i)]
[TopologicalSpace M₂]
(f : ContinuousMultilinearMap R M₁ M₂)
[Nonempty ι]


theorem embedding_graph {f : X → Y} (hf : Continuous f) : Embedding fun x => (x, f x)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
(hf : Continuous f)


theorem contMDiffWithinAt_congr (h₁ : ∀ y ∈ s, f₁ y = f y) (hx : f₁ x = f x) :
    ContMDiffWithinAt I I' n f₁ s x ↔ ContMDiffWithinAt I I' n f s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
{f f₁ : M → M'}
{s : Set M}
{x : M}
{n : ℕ∞}
(h₁ : ∀ y ∈ s, f₁ y = f y)
(hx : f₁ x = f x)


theorem weightedDecomposition.decompose'_eq [DecidableEq M] :
    (weightedDecomposition R w).decompose' = fun φ : MvPolynomial σ R =>
      DirectSum.mk (fun i : M => ↥(weightedHomogeneousSubmodule R w i))
        (Finset.image (weight w) φ.support) fun m =>
          ⟨weightedHomogeneousComponent w m φ, weightedHomogeneousComponent_mem w φ m⟩

(R : Type u_1)
{M : Type u_2}
[CommSemiring R]
{σ : Type u_3}
(w : σ → M)
[AddCommMonoid M]
[DecidableEq M]

DirectSum.Decomposition.decompose' = fun φ =>
  (DirectSum.mk (fun i => ↥(MvPolynomial.weightedHomogeneousSubmodule R w i))
      (Finset.image (⇑(Finsupp.weight w)) φ.support))
    fun m => ⟨(MvPolynomial.weightedHomogeneousComponent w ↑m) φ, ⋯⟩


protected theorem map_sub (x y : M) : f (x - y) = f x - f y

{R : Type u_1}
{S : Type u_6}
{M : Type u_9}
{M₂ : Type u_11}
[Semiring R]
[Semiring S]
[AddCommGroup M]
[AddCommGroup M₂]
{module_M : Module R M}
{module_M₂ : Module S M₂}
{σ : R →+* S}
(f : M →ₛₗ[σ] M₂)
(x y : M)


@[simp, norm_cast] theorem intCast_inj {a b : Int} : (a : Rat) = (b : Rat) ↔ a = b


/-- Adding a group element to the point `p` is an injective
function. -/
theorem vadd_right_injective (p : P) : Function.Injective ((· +ᵥ p) : G → P)

{G : Type u_1}
{P : Type u_2}
[AddGroup G]
[T : AddTorsor G P]
(p : P)


@[simp, reassoc]
theorem t'_fst_snd (i j k : 𝒰.J) :
    t' 𝒰 f g i j k ≫ pullback.fst _ _ ≫ pullback.snd _ _ =
      pullback.snd _ _ ≫ pullback.snd _ _

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

AlgebraicGeometry.Scheme.Pullback.t' 𝒰 f g i j k ≫
    CategoryTheory.Limits.pullback.fst (AlgebraicGeometry.Scheme.Pullback.fV 𝒰 f g j k)
        (AlgebraicGeometry.Scheme.Pullback.fV 𝒰 f g j i) ≫
      CategoryTheory.Limits.pullback.snd (CategoryTheory.Limits.pullback.fst (𝒰.map j ≫ f) g ≫ 𝒰.map j) (𝒰.map k) =
  CategoryTheory.Limits.pullback.snd (AlgebraicGeometry.Scheme.Pullback.fV 𝒰 f g i j)
      (AlgebraicGeometry.Scheme.Pullback.fV 𝒰 f g i k) ≫
    CategoryTheory.Limits.pullback.snd (CategoryTheory.Limits.pullback.fst (𝒰.map i ≫ f) g ≫ 𝒰.map i) (𝒰.map k)


theorem mersenne_int_pos {p : ℕ} (hp : p ≠ 0) : (0 : ℤ) < 2 ^ p - 1


/-- `MulOpposite.op` as a homeomorphism. -/
@[to_additive (attr := simps!) "`AddOpposite.op` as a homeomorphism."]
def opHomeomorph : M ≃ₜ Mᵐᵒᵖ

∀ (a : M), AddOpposite.opHomeomorph a = AddOpposite.op a


theorem head!_digits {b n : ℕ} (h : b ≠ 1) : (Nat.digits b n).head! = n % b


/-- A helper function used in defining the Čech conerve adjunction. -/
@[simps]
def equivalenceLeftToRight (F : Arrow C) (X : CosimplicialObject.Augmented C)
    (G : F.augmentedCechConerve ⟶ X) : F ⟶ Augmented.toArrow.obj X

[∀ (n : ℕ) (f : CategoryTheory.Arrow C), CategoryTheory.Limits.HasWidePushout f.left (fun x => f.right) fun x => f.hom]

(X : CategoryTheory.CosimplicialObject.Augmented C)

(CategoryTheory.CosimplicialObject.equivalenceLeftToRight F X G).right =
  CategoryTheory.Limits.WidePushout.ι (fun x => F.hom) 0 ≫ G.right.app (SimplexCategory.mk 0)


@[simp]
theorem coe_finTwoProd_repr {R : Type*} [Semiring R] (x : R × R) :
    ⇑((Basis.finTwoProd R).repr x) = ![x.fst, x.snd]

{R : Type u_10}
[Semiring R]
(x : R × R)

⇑((Basis.finTwoProd R).repr x) = ![x.1, x.2]


theorem natCast_add {a₁ a₂ : ℕ}
    (_ : ((a₁ : ℕ) : R) = b₁) (_ : ((a₂ : ℕ) : R) = b₂) : ((a₁ + a₂ : ℕ) : R) = b₁ + b₂

{R : Type u_1}
[CommSemiring R]
{b₁ b₂ : R}
{a₁ a₂ : ℕ}

↑a₁ = b₁ → ↑a₂ = b₂ → ↑(a₁ + a₂) = b₁ + b₂


@[simp 1100]
theorem normalize_out (a : Associates α) : normalize a.out = a.out

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


theorem one_lt_card [h : Nontrivial α] : 1 < Fintype.card α

{α : Type u_1}
[Fintype α]
[h : Nontrivial α]


@[to_additive (attr := simp)]
theorem toWord_one : (1 : FreeGroup α).toWord = []


@[to_additive]
theorem lt_inv_iff_mul_lt_one' : a < b⁻¹ ↔ b * a < 1

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


@[simp, norm_cast]
theorem coe_smul [Semiring R'] [SMul R' R] [Module R' A] [IsScalarTower R' R A] (r : R') (x : S) :
    (↑(r • x) : A) = r • (x : A)

{R' : Type u'}
{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R A)
[Semiring R']
[SMul R' R]
[Module R' A]
[IsScalarTower R' R A]
(r : R')
(x : ↥S)


theorem Basis'.subset (hI : M.Basis' I X) : I ⊆ X

{α : Type u_1}
{M : Matroid α}
{I X : Set α}
(hI : M.Basis' I X)


@[simp]
theorem coe_toRealLinearMap (f : E →+ F) (hf : Continuous f) : ⇑(f.toRealLinearMap hf) = f

{E : Type u_1}
[AddCommGroup E]
[Module ℝ E]
[TopologicalSpace E]
[ContinuousSMul ℝ E]
{F : Type u_2}
[AddCommGroup F]
[Module ℝ F]
[TopologicalSpace F]
[ContinuousSMul ℝ F]
[T2Space F]
(f : E →+ F)
(hf : Continuous ⇑f)


theorem IsOpen.isUpperSet {s : Set α} (hs : IsOpen α s) : IsUpperSet s

(α : Type u)
[OmegaCompletePartialOrder α]
{s : Set α}
(hs : Scott.IsOpen α s)


/-- A functor `C ⥤ D` induces a functor between the corresponding arrow categories. -/
@[simps]
def mapArrow (F : C ⥤ D) : Arrow C ⥤ Arrow D

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

∀ {X Y : CategoryTheory.Arrow C} (f : X ⟶ Y), (F.mapArrow.map f).left = F.map f.left


theorem ofScientific_false_def : Rat.ofScientific m false e = (m * 10 ^ e : Nat)

Rat.ofScientific m false e = ↑(m * 10 ^ e)


theorem replicateTR_loop_replicate_eq (a : α) (m n : Nat) :
  replicateTR.loop a n (replicate m a) = replicate (n + m) a

List.replicateTR.loop a n (List.replicate m a) = List.replicate (n + m) a


@[simp]
theorem mem_invariants (v : V) : v ∈ invariants ρ ↔ ∀ g : G, ρ g v = v

{k : Type u_1}
{G : Type u_2}
{V : Type u_3}
[CommSemiring k]
[Group G]
[AddCommMonoid V]
[Module k V]
(ρ : Representation k G V)
(v : V)

v ∈ ρ.invariants ↔ ∀ (g : G), (ρ g) v = v


theorem lipschitzWith_pos_part : LipschitzWith 1 fun x : ℝ => max x 0


/-- If `s` is a colimit binary cofan over `X` and `Y`,, then every pair of morphisms `f : X ⟶ W` and
    `g : Y ⟶ W` induces a morphism `l : s.pt ⟶ W` satisfying `s.inl ≫ l = f` and `s.inr ≫ l = g`.
    -/
@[simps]
def BinaryCofan.IsColimit.desc' {W X Y : C} {s : BinaryCofan X Y} (h : IsColimit s) (f : X ⟶ W)
    (g : Y ⟶ W) : { l : s.pt ⟶ W // s.inl ≫ l = f ∧ s.inr ≫ l = g }

{s : CategoryTheory.Limits.BinaryCofan X Y}

↑(CategoryTheory.Limits.BinaryCofan.IsColimit.desc' h f g) = h.desc (CategoryTheory.Limits.BinaryCofan.mk f g)


@[simp]
theorem map_add {X Y : C} {f g : X ⟶ Y} : F.map (f + g) = F.map f + F.map g

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
[CategoryTheory.Preadditive C]
[CategoryTheory.Preadditive D]
(F : CategoryTheory.Functor C D)
[F.Additive]
{X Y : C}
{f g : X ⟶ Y}


/-- A sequence of functions `Fₙ` converges uniformly on a set `s` to a limiting function `f` w.r.t.
filter `p` iff the function `(n, x) ↦ (f x, Fₙ x)` converges along `p ×ˢ 𝓟 s` to the uniformity.
In other words: one knows nothing about the behavior of `x` in this limit besides it being in `s`.
-/
theorem tendstoUniformlyOn_iff_tendsto {F : ι → α → β} {f : α → β} {p : Filter ι} {s : Set α} :
    TendstoUniformlyOn F f p s ↔
    Tendsto (fun q : ι × α => (f q.2, F q.1 q.2)) (p ×ˢ 𝓟 s) (𝓤 β)

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{f : α → β}
{p : Filter ι}
{s : Set α}

TendstoUniformlyOn F f p s ↔ Filter.Tendsto (fun q => (f q.2, F q.1 q.2)) (p ×ˢ 𝓟 s) (𝓤 β)


theorem mem_adjoin_of_map_mul {s} {x : A} {f : A →ₗ[R] B} (hf : ∀ a₁ a₂, f (a₁ * a₂) = f a₁ * f a₂)
    (h : x ∈ adjoin R s) : f x ∈ adjoin R (f '' (s ∪ {1}))

(hf : ∀ (a₁ a₂ : A), f (a₁ * a₂) = f a₁ * f a₂)

f x ∈ Algebra.adjoin R (⇑f '' (s ∪ {1}))


/--
Auxiliary lemma for `hasStrictFDerivAt_multiset_prod`.

For `NormedCommRing 𝔸'`, can rewrite as `Multiset` using `Multiset.prod_coe`.
-/
@[fun_prop]
theorem hasStrictFDerivAt_list_prod [DecidableEq ι] [Fintype ι] {l : List ι} {x : ι → 𝔸'} :
    HasStrictFDerivAt (𝕜 := 𝕜) (fun x ↦ (l.map x).prod)
      (l.map fun i ↦ ((l.erase i).map x).prod • proj i).sum x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{ι : Type u_6}
{𝔸' : Type u_8}
[NormedCommRing 𝔸']
[NormedAlgebra 𝕜 𝔸']
[DecidableEq ι]
[Fintype ι]
{l : List ι}
{x : ι → 𝔸'}

HasStrictFDerivAt (fun x => (List.map x l).prod)
  (List.map (fun i => (List.map x (l.erase i)).prod • ContinuousLinearMap.proj i) l).sum x


/-- Given two composable morphisms `f : X₁ ⟶ X₂` and `g : X₂ ⟶ X₃` in the category
of cochain complexes, this is the canonical triangle
`mappingCone f ⟶ mappingCone (f ≫ g) ⟶ mappingCone g ⟶ (mappingCone f)⟦1⟧`. -/
@[simps! mor₁ mor₂ mor₃ obj₁ obj₂ obj₃]
noncomputable def mappingConeCompTriangle : Triangle (CochainComplex C ℤ)

(CochainComplex.mappingConeCompTriangle f g).obj₁ = CochainComplex.mappingCone f


/-- If two continuous algebra maps are equal on a set `s`, then they are equal on the closure
of the `Algebra.adjoin` of this set. -/
theorem eqOn_closure_adjoin [T2Space B] {s : Set A} {f g : A →A[R] B} (h : Set.EqOn f g s) :
    Set.EqOn f g (closure (Algebra.adjoin R s : Set A))

{R : Type u_1}
[CommSemiring R]
{A : Type u_2}
[Semiring A]
[TopologicalSpace A]
{B : Type u_3}
[Semiring B]
[TopologicalSpace B]
[Algebra R A]
[Algebra R B]
[T2Space B]
{s : Set A}
{f g : A →A[R] B}
(h : Set.EqOn (⇑f) (⇑g) s)

Set.EqOn (⇑f) (⇑g) (closure ↑(Algebra.adjoin R s))


theorem sub_int (h : LiouvilleWith p x) (m : ℤ) : LiouvilleWith p (x - m)

{p x : ℝ}
(h : LiouvilleWith p x)
(m : ℤ)


theorem Integrable.smul [NormedAddCommGroup 𝕜] [SMulZeroClass 𝕜 β] [BoundedSMul 𝕜 β] (c : 𝕜)
    {f : α → β} (hf : Integrable f μ) : Integrable (c • f) μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
{𝕜 : Type u_5}
[NormedAddCommGroup 𝕜]
[SMulZeroClass 𝕜 β]
[BoundedSMul 𝕜 β]
(c : 𝕜)
{f : α → β}
(hf : MeasureTheory.Integrable f μ)


@[simp, norm_cast]
theorem inseparable_coe {x y : X} : Inseparable (x : OnePoint X) y ↔ Inseparable x y

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


@[to_additive (attr := simp)]
lemma fiberEquiv_apply (f : α →* H) (a b : α) (g : f ⁻¹' {f a}) :
    f.fiberEquiv a b g = b * (a⁻¹ * g)

{α : Type u_1}
[Group α]
{H : Type u_2}
[Group H]
(f : α →* H)
(a b : α)
(g : ↑(⇑f ⁻¹' {f a}))

↑((f.fiberEquiv a b) g) = b * (a⁻¹ * ↑g)


theorem Matrix.diagonal_tsum [DecidableEq n] [T2Space R] {f : X → n → R} :
    diagonal (∑' x, f x) = ∑' x, diagonal (f x)

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

Matrix.diagonal (∑' (x : X), f x) = ∑' (x : X), Matrix.diagonal (f x)


/-- Embedding `i : Fin n` into `Fin (n + 1)` with a hole around `p : Fin (n + 1)`
embeds `i` by `castSucc` when the resulting `i.castSucc < p`. -/
lemma succAbove_of_castSucc_lt (p : Fin (n + 1)) (i : Fin n) (h : castSucc i < p) :
    p.succAbove i = castSucc i

{n : ℕ}
(p : Fin (n + 1))
(i : Fin n)
(h : i.castSucc < p)


theorem lhopital_zero_right_on_Ico (hdf : DifferentiableOn ℝ f (Ioo a b))
    (hcf : ContinuousOn f (Ico a b)) (hcg : ContinuousOn g (Ico a b))
    (hg' : ∀ x ∈ Ioo a b, (deriv g) x ≠ 0) (hfa : f a = 0) (hga : g a = 0)
    (hdiv : Tendsto (fun x => (deriv f) x / (deriv g) x) (𝓝[>] a) l) :
    Tendsto (fun x => f x / g x) (𝓝[>] a) l

(hdf : DifferentiableOn ℝ f (Set.Ioo a b))

(hg' : ∀ x ∈ Set.Ioo a b, deriv g x ≠ 0)

(hdiv : Filter.Tendsto (fun x => deriv f x / deriv g x) (𝓝[>] a) l)

Filter.Tendsto (fun x => f x / g x) (𝓝[>] a) l


theorem add : mapFun f (x + y) = mapFun f x + mapFun f y

{p : ℕ}
{R : Type u_1}
{S : Type u_2}
[hp : Fact (Nat.Prime p)]
[CommRing R]
[CommRing S]
(f : R →+* S)
(x y : 𝕎 R)

WittVector.mapFun (⇑f) (x + y) = WittVector.mapFun (⇑f) x + WittVector.mapFun (⇑f) y


/-- In a real vector space of dimension `> 1`, any sphere of nonnegative radius is connected. -/
theorem isConnected_sphere (h : 1 < Module.rank ℝ E) (x : E) {r : ℝ} (hr : 0 ≤ r) :
    IsConnected (sphere x r)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(h : 1 < Module.rank ℝ E)
(x : E)
{r : ℝ}
(hr : 0 ≤ r)


theorem UInt64.toNat_sub (x y : UInt64) :
    (x - y).toNat = (UInt64.size - y.toNat + x.toNat) % UInt64.size


theorem borel_eq_generateFrom_Iio_rat : borel ℝ = .generateFrom (⋃ a : ℚ, {Iio (a : ℝ)})

borel ℝ = MeasurableSpace.generateFrom (⋃ a, {Set.Iio ↑a})


@[trans]
theorem IsEquivalent.trans {l : Filter α} {u v w : α → β} (huv : u ~[l] v) (hvw : v ~[l] w) :
    u ~[l] w

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


@[simp]
theorem diagonal_add [AddZeroClass α] (d₁ d₂ : n → α) :
    diagonal d₁ + diagonal d₂ = diagonal fun i => d₁ i + d₂ i

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[AddZeroClass α]
(d₁ d₂ : n → α)

Matrix.diagonal d₁ + Matrix.diagonal d₂ = Matrix.diagonal fun i => d₁ i + d₂ i


theorem C_mul_prod_X_sub_C_eq [CommRing S] {w x y z : S} :
    C w * (X - C x) * (X - C y) * (X - C z) =
      toPoly ⟨w, w * -(x + y + z), w * (x * y + x * z + y * z), w * -(x * y * z)⟩

{S : Type u_2}
[CommRing S]
{w x y z : S}

Polynomial.C w * (Polynomial.X - Polynomial.C x) * (Polynomial.X - Polynomial.C y) * (Polynomial.X - Polynomial.C z) =
  { a := w, b := w * -(x + y + z), c := w * (x * y + x * z + y * z), d := w * -(x * y * z) }.toPoly


/-- A vector lies in the `vectorSpan` of two points if and only if it is a multiple of their
difference. -/
theorem mem_vectorSpan_pair {p₁ p₂ : P} {v : V} :
    v ∈ vectorSpan k ({p₁, p₂} : Set P) ↔ ∃ r : k, r • (p₁ -ᵥ p₂) = v

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

v ∈ vectorSpan k {p₁, p₂} ↔ ∃ r, r • (p₁ -ᵥ p₂) = v


/-- Given a cocone over `F ⋙ G`, we can construct a `Cocone G` with the same cocone point.
-/
@[simps]
def extendCocone : Cocone (F ⋙ G) ⥤ Cocone G

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

(CategoryTheory.Functor.Final.extendCocone.obj c).ι.app X =
  CategoryTheory.CategoryStruct.comp (G.map (CategoryTheory.Functor.Final.homToLift F X))
    (c.ι.app (CategoryTheory.Functor.Final.lift F X))


/-- The diagonal functor as a monoidal functor. -/
@[simps]
def diag : MonoidalFunctor C (C × C)

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

(CategoryTheory.MonoidalFunctor.diag C).μ X Y =
  𝟙
    (CategoryTheory.MonoidalCategory.tensorObj ((CategoryTheory.Functor.diag C).obj X)
      ((CategoryTheory.Functor.diag C).obj Y))


theorem isLindelof_iff_isLindelof_univ : IsLindelof s ↔ IsLindelof (univ : Set s)

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


/-- Right-exactness of tensor product (`rTensor`) -/
lemma rTensor_mkQ (N : Submodule R M) :
    ker (rTensor Q (N.mkQ)) = range (rTensor Q N.subtype)

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(Q : Type u_5)
[AddCommGroup Q]
[Module R Q]
(N : Submodule R M)

LinearMap.ker (LinearMap.rTensor Q N.mkQ) = LinearMap.range (LinearMap.rTensor Q N.subtype)


/-- Any linear map `f : p →ₗ[K] V'` defined on a subspace `p` can be extended to the whole
space. -/
theorem LinearMap.exists_extend {p : Submodule K V} (f : p →ₗ[K] V') :
    ∃ g : V →ₗ[K] V', g.comp p.subtype = f

{K : Type u_3}
{V : Type u_4}
{V' : Type u_5}
[DivisionRing K]
[AddCommGroup V]
[AddCommGroup V']
[Module K V]
[Module K V']
{p : Submodule K V}
(f : ↥p →ₗ[K] V')


theorem cyclicPermutations_injective : Function.Injective (@cyclicPermutations α)


@[deprecated measure_mono_null (since := "2024-05-14")]
theorem mono_null (m : OuterMeasure α) {s t} (h : s ⊆ t) (ht : m t = 0) : m s = 0

{α : Type u_1}
(m : MeasureTheory.OuterMeasure α)
{s t : Set α}
(h : s ⊆ t)
(ht : m t = 0)


@[to_additive]
theorem uniformGroup_sInf {us : Set (UniformSpace β)} (h : ∀ u ∈ us, @UniformGroup β u _) :
    @UniformGroup β (sInf us) _

{β : Type u_2}
[Group β]
{us : Set (UniformSpace β)}
(h : ∀ u ∈ us, UniformGroup β)


@[to_additive]
theorem comap_sup_eq_of_le_range {H K : Subgroup N} (hH : H ≤ f.range) (hK : K ≤ f.range) :
    comap f H ⊔ comap f K = comap f (H ⊔ K)

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
(f : G →+ N)
{H K : AddSubgroup N}
(hH : H ≤ f.range)
(hK : K ≤ f.range)

AddSubgroup.comap f H ⊔ AddSubgroup.comap f K = AddSubgroup.comap f (H ⊔ K)


theorem mulVec_surjective_iff_exists_right_inverse [Finite m] [Fintype n] {A : Matrix m n R} :
    Function.Surjective A.mulVec ↔ ∃ B : Matrix n m R, A * B = 1

{m : Type u}
{n : Type u'}
[DecidableEq m]
{R : Type u_2}
[Semiring R]
[Finite m]
[Fintype n]
{A : Matrix m n R}

Function.Surjective A.mulVec ↔ ∃ B, A * B = 1


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

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
(s : AddSubmonoid M)
(t : AddSubmonoid N)


lemma hasLeftHomology_iff_op (S : ShortComplex C) :
    S.HasLeftHomology ↔ S.op.HasRightHomology


@[simp]
theorem LinearMap.isometryOfInner_toLinearMap (f : E →ₗ[𝕜] E') (h) :
    (f.isometryOfInner h).toLinearMap = f

(h : ∀ (x y : E), ⟪f x, f y⟫_𝕜 = ⟪x, y⟫_𝕜)


theorem Tape.map_mk₂ {Γ Γ'} [Inhabited Γ] [Inhabited Γ'] (f : PointedMap Γ Γ') (L R : List Γ) :
    (Tape.mk₂ L R).map f = Tape.mk₂ (L.map f) (R.map f)

{Γ : Type u_1}
{Γ' : Type u_2}
[Inhabited Γ]
[Inhabited Γ']
(f : Turing.PointedMap Γ Γ')
(L R : List Γ)

Turing.Tape.map f (Turing.Tape.mk₂ L R) = Turing.Tape.mk₂ (List.map f.f L) (List.map f.f R)


lemma isZero_iff_eq_zero [Nontrivial (weightSpace M (0 : L → R))] {χ : Weight R L M} :
    χ.IsZero ↔ χ = 0

[Nontrivial ↥↑(LieModule.weightSpace M 0)]


/-- The `essSup` of a function `g` on the quotient space `G ⧸ Γ` with respect to the pushforward
  of the restriction, `μ_𝓕`, of a right-invariant measure `μ` to a fundamental domain `𝓕`, is the
  same as the `essSup` of `g`'s lift to the universal cover `G` with respect to `μ`. -/
@[to_additive "The `essSup` of a function `g` on the additive quotient space `G ⧸ Γ` with respect
  to the pushforward of the restriction, `μ_𝓕`, of a right-invariant measure `μ` to a fundamental
  domain `𝓕`, is the same as the `essSup` of `g`'s lift to the universal cover `G` with respect
  to `μ`."]
lemma essSup_comp_quotientGroup_mk [μ.IsMulRightInvariant] {g : G ⧸ Γ → ℝ≥0∞}
    (g_ae_measurable : AEMeasurable g μ_𝓕) : essSup g μ_𝓕 = essSup (fun (x : G) ↦ g x) μ

(h𝓕 : MeasureTheory.IsAddFundamentalDomain (↥Γ.op) 𝓕 μ)

{g : G ⧸ Γ → ℝ≥0∞}

(g_ae_measurable : AEMeasurable g (MeasureTheory.Measure.map QuotientAddGroup.mk (μ.restrict 𝓕)))

essSup g (MeasureTheory.Measure.map QuotientAddGroup.mk (μ.restrict 𝓕)) = essSup (fun x => g ↑x) μ


@[simp, rclike_simps]
theorem I_im' (z : K) : im (I : K) * im z = im z

RCLike.im RCLike.I * RCLike.im z = RCLike.im z


lemma Module.Finite_of_isLocalization (R S Rₚ Sₚ) [CommSemiring R] [CommRing S] [CommRing Rₚ]
    [CommRing Sₚ] [Algebra R S] [Algebra R Rₚ] [Algebra R Sₚ] [Algebra S Sₚ] [Algebra Rₚ Sₚ]
    [IsScalarTower R S Sₚ] [IsScalarTower R Rₚ Sₚ] (M : Submonoid R) [IsLocalization M Rₚ]
    [IsLocalization (Algebra.algebraMapSubmonoid S M) Sₚ] [hRS : Module.Finite R S] :
    Module.Finite Rₚ Sₚ


@[to_additive pi_nnnorm_lt_iff]
lemma pi_nnnorm_lt_iff' {r : ℝ≥0} (hr : 0 < r) : ‖x‖₊ < r ↔ ∀ i, ‖x i‖₊ < r

{ι : Type u_1}
{π : ι → Type u_4}
[Fintype ι]
[(i : ι) → SeminormedAddGroup (π i)]
{x : (i : ι) → π i}
{r : ℝ≥0}
(hr : 0 < r)


@[to_additive]
theorem ContMDiffOn.inv {f : M → G} {s : Set M} (hf : ContMDiffOn I' I n f s) :
    ContMDiffOn I' I n (fun x => (f x)⁻¹) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_5}
[TopologicalSpace G]
[ChartedSpace H G]
[Group G]
[LieGroup I G]
{E' : Type u_6}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_7}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_8}
[TopologicalSpace M]
[ChartedSpace H' M]
{n : ℕ∞}
{f : M → G}
{s : Set M}
(hf : ContMDiffOn I' I n f s)


private theorem alternization_map_eq_zero_of_eq_aux (m : MultilinearMap R (fun _ : ι => M) N')
    (v : ι → M) (i j : ι) (i_ne_j : i ≠ j) (hv : v i = v j) :
    (∑ σ : Perm ι, Equiv.Perm.sign σ • m.domDomCongr σ) v = 0

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N' : Type u_6}
[AddCommGroup N']
[Module R N']
{ι : Type u_7}
[Fintype ι]
[DecidableEq ι]
(m : MultilinearMap R (fun x => M) N')
(v : ι → M)
(i j : ι)
(i_ne_j : i ≠ j)
(hv : v i = v j)

(∑ σ : Equiv.Perm ι, Equiv.Perm.sign σ • MultilinearMap.domDomCongr σ m) v = 0


@[to_additive]
theorem orderOf_eq_zero_iff : orderOf x = 0 ↔ ¬IsOfFinOrder x


@[simp]
theorem pre_map {A₁ A₂ A₃ : C} [Closed A₁] [Closed A₂] [Closed A₃] (f : A₁ ⟶ A₂) (g : A₂ ⟶ A₃) :
    pre (f ≫ g) = pre g ≫ pre f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.MonoidalCategory C]
{A₁ A₂ A₃ : C}
[CategoryTheory.Closed A₁]
[CategoryTheory.Closed A₂]
[CategoryTheory.Closed A₃]
(f : A₁ ⟶ A₂)
(g : A₂ ⟶ A₃)

CategoryTheory.MonoidalClosed.pre (CategoryTheory.CategoryStruct.comp f g) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalClosed.pre g) (CategoryTheory.MonoidalClosed.pre f)


@[to_additive]
theorem prod_sum_index [AddCommMonoid M] [AddCommMonoid N] [CommMonoid P] {f : α →₀ M}
    {g : α → M → β →₀ N} {h : β → N → P} (h_zero : ∀ a, h a 0 = 1)
    (h_add : ∀ a b₁ b₂, h a (b₁ + b₂) = h a b₁ * h a b₂) :
    (f.sum g).prod h = f.prod fun a b => (g a b).prod h

{g : α → M → β →₀ N}

(h_add : ∀ (a : β) (b₁ b₂ : N), h a (b₁ + b₂) = h a b₁ * h a b₂)


lemma Subring.mem_closure_image_of {S T : Type*} [CommRing S] [CommRing T] (g : S →+* T)
    (u : Set S) (x : S) (hx : x ∈ Subring.closure u) : g x ∈ Subring.closure (g '' u)

{S : Type u_1}
{T : Type u_2}
[CommRing S]
[CommRing T]
(g : S →+* T)
(u : Set S)
(x : S)
(hx : x ∈ Subring.closure u)


@[simp]
theorem deg_smul (c : NumDenSameDeg 𝒜 x) (m : α) : (m • c).deg = c.deg

(c : HomogeneousLocalization.NumDenSameDeg 𝒜 x)


@[simp]
theorem join₂_comp_map (f : R →+* MvPolynomial σ S) : join₂.comp (map f) = bind₂ f

{σ : Type u_1}
{R : Type u_3}
{S : Type u_4}
[CommSemiring R]
[CommSemiring S]
(f : R →+* MvPolynomial σ S)

MvPolynomial.join₂.comp (MvPolynomial.map f) = MvPolynomial.bind₂ f


/-- Four-way commutativity of `Prod`. The name matches `mul_mul_mul_comm`. -/
@[to_additive (attr := simps apply) prodProdProdComm
    "Four-way commutativity of `Prod`.\nThe name matches `mul_mul_mul_comm`"]
def prodProdProdComm : (M × N) × M' × N' ≃* (M × M') × N × N'

(M : Type u_5)
(N : Type u_6)
[MulOneClass M]
[MulOneClass N]
(M' : Type u_8)
(N' : Type u_9)
[MulOneClass M']
[MulOneClass N']
(mnmn : (M × N) × M' × N')

(MulEquiv.prodProdProdComm M N M' N') mnmn = ((mnmn.1.1, mnmn.2.1), mnmn.1.2, mnmn.2.2)


/-- In any abelian category with enough projectives,
`ProjectiveResolution.of Z` constructs an projective resolution of the object `Z`.
-/
irreducible_def of : ProjectiveResolution Z

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Abelian C]
[CategoryTheory.EnoughProjectives C]
(Z : C)

CategoryTheory.ProjectiveResolution.of Z =
  CategoryTheory.ProjectiveResolution.mk (CategoryTheory.ProjectiveResolution.ofComplex Z) ⋯
    (((CategoryTheory.ProjectiveResolution.ofComplex Z).toSingle₀Equiv Z).symm ⟨CategoryTheory.Projective.π Z, ⋯⟩) ⋯


@[simp]
theorem norm_units (u : ℤ_[p]ˣ) : ‖(u : ℤ_[p])‖ = 1

{p : ℕ}
[hp : Fact (Nat.Prime p)]
(u : ℤ_[p]ˣ)


/-- If two measurable sets are ae_eq then any proposition that is almost everywhere true on one
is almost everywhere true on the other -/
theorem ae_restrict_of_ae_eq_of_ae_restrict {s t} (hst : s =ᵐ[μ] t) {p : α → Prop} :
    (∀ᵐ x ∂μ.restrict s, p x) → ∀ᵐ x ∂μ.restrict t, p x

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t : α → Prop}
(hst : s =ᵐ[μ] t)
{p : α → Prop}

(∀ᵐ (x : α) ∂μ.restrict s, p x) → ∀ᵐ (x : α) ∂μ.restrict t, p x


theorem openEmbedding_coe : OpenEmbedding ((↑) : ℝ≥0 → ℝ≥0∞)


/-- The algebra isomorphism between multivariable polynomials in no variables
and the ground ring. -/
@[simps!]
def isEmptyAlgEquiv [he : IsEmpty σ] : MvPolynomial σ R ≃ₐ[R] R

(R : Type u)
(σ : Type u_1)
[CommSemiring R]
[he : IsEmpty σ]
(a : R)
(j : σ →₀ ℕ)

((MvPolynomial.isEmptyAlgEquiv R σ).symm a) j = Pi.single 0 a j


theorem range_le : Set.range (algebraMap R A) ≤ S

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


theorem sub_add_eq_comm (a b c : Nat) : a - (b + c) = a - c - b


/-- `SMulMemClass S R M` says `S` is a type of subsets `s ≤ M` that are closed under the
scalar action of `R` on `M`.

Note that only `R` is marked as an `outParam` here, since `M` is supplied by the `SetLike`
class instead.
-/
class SMulMemClass (S : Type*) (R : outParam Type*) (M : Type*) [SMul R M] [SetLike S M] :
    Prop where
  /-- Multiplication by a scalar on an element of the set remains in the set. -/
  smul_mem : ∀ {s : S} (r : R) {m : M}, m ∈ s → r • m ∈ s

{S : Type u_1}
{R : outParam (Type u_2)}
{M : Type u_3}
[SMul R M]
[SetLike S M]
[self : SMulMemClass S R M]
{s : S}
(r : R)
{m : M}


/-- Two vectors `x y` in a real normed space are on the ray if and only if one of them is zero or
the unit vectors `‖x‖⁻¹ • x` and `‖y‖⁻¹ • y` are equal. -/
theorem sameRay_iff_inv_norm_smul_eq : SameRay ℝ x y ↔ x = 0 ∨ y = 0 ∨ ‖x‖⁻¹ • x = ‖y‖⁻¹ • y

{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{x y : F}


/-- The natural isomorphism between `𝕜` satisfying `RCLike 𝕜` and `ℝ` when `RCLike.I = 0`. -/
@[simps]
def realRingEquiv (h : I = (0 : K)) : K ≃+* ℝ

{K : Type u_1}
[RCLike K]
(h : RCLike.I = 0)
(a : K)

(RCLike.realRingEquiv h) a = RCLike.re a


/-- A nonempty, bounded below set of real numbers has a greatest lower bound. -/
theorem exists_isGLB {S : Set ℝ} (hne : S.Nonempty) (hbdd : BddBelow S) : ∃ x, IsGLB S x


theorem isSquare_iff {q : ℚ} : IsSquare q ↔ IsSquare q.num ∧ IsSquare q.den


@[to_additive]
theorem mul_div (a b c : G) : a * (b / c) = a * b / c

{G : Type u_3}
[DivInvMonoid G]
(a b c : G)


theorem measurePreserving_finTwoArrow_vec {α : Type u} {m : MeasurableSpace α} (μ ν : Measure α)
    [SigmaFinite μ] [SigmaFinite ν] :
    MeasurePreserving MeasurableEquiv.finTwoArrow (Measure.pi ![μ, ν]) (μ.prod ν)

{α : Type u}
{m : MeasurableSpace α}
(μ ν : MeasureTheory.Measure α)
[MeasureTheory.SigmaFinite μ]
[MeasureTheory.SigmaFinite ν]

MeasureTheory.MeasurePreserving (⇑MeasurableEquiv.finTwoArrow) (MeasureTheory.Measure.pi ![μ, ν]) (μ.prod ν)


@[simp] lemma coe_coe : (↑(χ : L →ₗ[R] R) : L → R) = (χ : L → R)

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[LieAlgebra.IsNilpotent R L]
[LieModule.LinearWeights R L M]
{χ : LieModule.Weight R L M}

⇑(LieModule.Weight.toLinear R L M χ) = ⇑χ


theorem _root_.String.validFor_toSubstring (s : String) : ValidFor [] s.1 [] s

Substring.ValidFor [] s.data [] s.toSubstring


@[to_additive]
theorem map_map (g : N →* P) (f : M →* N) : (S.map f).map g = S.map (g.comp f)

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

Submonoid.map g (Submonoid.map f S) = Submonoid.map (g.comp f) S


theorem inclusion_right {S T : Subalgebra R A} (h : S ≤ T) (x : T) (m : (x : A) ∈ S) :
    inclusion h ⟨x, m⟩ = x

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{S T : Subalgebra R A}
(h : S ≤ T)
(x : ↥T)
(m : ↑x ∈ S)


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

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


/-- A submodule is finitely generated if and only if it is finite-dimensional -/
theorem fg_iff_finiteDimensional (s : Submodule K V) : s.FG ↔ FiniteDimensional K s

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
(s : Submodule K V)


/-- Change a cocone on `F : Jᵒᵖ ⥤ Cᵒᵖ` into a cone on `F.unop : J ⥤ C`. -/
@[simps]
def coneUnopOfCocone (c : Cocone F) : Cone F.unop

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : Jᵒᵖ ⥤ Cᵒᵖ}
(c : CategoryTheory.Limits.Cocone F)

(CategoryTheory.Limits.coneUnopOfCocone c).π = CategoryTheory.NatTrans.unop c.ι


@[to_additive]
theorem le_normalizer_of_normal [hK : (H.subgroupOf K).Normal] (HK : H ≤ K) : K ≤ H.normalizer

{G : Type u_1}
[AddGroup G]
{H K : AddSubgroup G}
[hK : (H.addSubgroupOf K).Normal]
(HK : H ≤ K)


@[simp] lemma himp_le_iff : x ⇨ y ≤ x ↔ x = ⊤

{α : Type u}
{x y : α}
[BooleanAlgebra α]


/-- If `K₁/E/F` is a tower of fields with `E/F` normal then `AlgHom.restrictNormal'` is an
 equivalence. -/
@[simps]
def Normal.algHomEquivAut [Normal F E] : (E →ₐ[F] K₁) ≃ E ≃ₐ[F] E

(F : Type u_1)
(K₁ : Type u_3)
[Field F]
[Field K₁]
[Algebra F K₁]
(E : Type u_6)
[Field E]
[Algebra F E]
[Algebra E K₁]
[IsScalarTower F E K₁]
[Normal F E]
(σ : E ≃ₐ[F] E)

(Normal.algHomEquivAut F K₁ E).symm σ = (IsScalarTower.toAlgHom F E K₁).comp ↑σ


@[to_additive (attr := simp)]
theorem units_inv_mem_center {a : Mˣ} (ha : ↑a ∈ Set.center M) : ↑a⁻¹ ∈ Set.center M

{M : Type u_1}
[AddMonoid M]
{a : AddUnits M}
(ha : ↑a ∈ Set.addCenter M)


/-- The universal property that a derivation `d : M.Derivation φ` must
satisfy so that the presheaf of modules `M` can be considered as the presheaf of
(relative) differentials of a presheaf of commutative rings `φ : S ⟶ F.op ⋙ R`. -/
structure Universal where
  /-- An absolyte derivation of `M'` descends as a morphism `M ⟶ M'`. -/
  desc {M' : PresheafOfModules (R ⋙ forget₂ CommRingCat RingCat)}
    (d' : M'.Derivation φ) : M ⟶ M'
  fac {M' : PresheafOfModules (R ⋙ forget₂ CommRingCat RingCat)}
    (d' : M'.Derivation φ) : d.postcomp (desc d') = d' := by aesop_cat
  postcomp_injective {M' : PresheafOfModules (R ⋙ forget₂ CommRingCat RingCat)}
    (φ φ' : M ⟶ M') (h : d.postcomp φ = d.postcomp φ') : φ = φ' := by aesop_cat

{M : PresheafOfModules (R ⋙ CategoryTheory.forget₂ CommRingCat RingCat)}

{M' : PresheafOfModules (R ⋙ CategoryTheory.forget₂ CommRingCat RingCat)}


theorem div_le_of_le_mul' (h : a ≤ b * c) : a / b ≤ c


theorem inf_sdiff_right (hs : s.Nonempty) (f : ι → α) (a : α) :
    (s.inf fun b => f b \ a) = s.inf f \ a

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


theorem Poly.denote_reverse (ctx : Context) (p : Poly) : denote ctx (List.reverse p) = denote ctx p

(ctx : Nat.Linear.Context)
(p : Nat.Linear.Poly)

Nat.Linear.Poly.denote ctx (List.reverse p) = Nat.Linear.Poly.denote ctx p


@[bv_toNat] theorem toNat_sub' {n} (x y : BitVec n) :
    (x - y).toNat = ((x.toNat + (2^n - y.toNat)) % 2^n)

(x - y).toNat = (x.toNat + (2 ^ n - y.toNat)) % 2 ^ n


/-- The embedding of `Preord` into `Cat`.
-/
@[simps]
def preordToCat : Preord.{u} ⥤ Cat

∀ {X Y : Preord} (f : X ⟶ Y), preordToCat.map f = ⋯.functor


lemma dft_apply (Φ : ZMod N → ℂ) (k : ZMod N) :
    𝓕 Φ k = ∑ j : ZMod N, toCircle (-(j * k)) • Φ j

{N : ℕ}
[NeZero N]
(Φ : ZMod N → ℂ)
(k : ZMod N)

𝓕 Φ k = ∑ j : ZMod N, ZMod.toCircle (-(j * k)) • Φ j


@[simp]
theorem neg_lf_zero_iff {x : PGame} : -x ⧏ 0 ↔ 0 ⧏ x


/-- `hasColimitsOfSizeShrink.{v u} C` tries to obtain `HasColimitsOfSize.{v u} C`
from some other `HasColimitsOfSize C`.
-/
theorem hasColimitsOfSizeShrink [HasColimitsOfSize.{max v₁ v₂, max u₁ u₂} C] :
    HasColimitsOfSize.{v₁, u₁} C

[CategoryTheory.Limits.HasColimitsOfSize.{max v₁ v₂, max u₁ u₂, v, u} C]

CategoryTheory.Limits.HasColimitsOfSize.{v₁, u₁, v, u} C


theorem isHermitian {M : Matrix n n R} (hM : M.PosDef) : M.IsHermitian

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


@[to_additive]
theorem inter_mul_subset : s₁ ∩ s₂ * t ⊆ s₁ * t ∩ (s₂ * t)

{α : Type u_2}
[DecidableEq α]
[Mul α]
{s₁ s₂ t : Finset α}


@[simp]
lemma isoOfHom_id_inv (X : C) (hX : W (𝟙 X)) :
    (isoOfHom L W (𝟙 X) hX).inv = 𝟙 _

(hX : W (CategoryTheory.CategoryStruct.id X))

(CategoryTheory.Localization.isoOfHom L W (CategoryTheory.CategoryStruct.id X) hX).inv =
  CategoryTheory.CategoryStruct.id (L.obj X)


theorem ite_ite_comm (h : P → ¬Q) :
    (if P then a else if Q then b else c) =
     if Q then b else if P then a else c

{α : Sort u_1}
(P Q : Prop)
[Decidable P]
[Decidable Q]
(a b : α)
{c : α}
(h : P → ¬Q)


theorem diam_pair : diam ({x, y} : Set α) = edist x y

{α : Type u}
[PseudoEMetricSpace α]
{x y : α}


theorem ContinuousAt.stronglyMeasurableAtFilter [TopologicalSpace α] [OpensMeasurableSpace α]
    [SecondCountableTopologyEither α E] {f : α → E} {s : Set α} {μ : Measure α} (hs : IsOpen s)
    (hf : ∀ x ∈ s, ContinuousAt f x) : ∀ x ∈ s, StronglyMeasurableAtFilter f (𝓝 x) μ

{α : Type u_1}
{E : Type u_3}
[MeasurableSpace α]
[NormedAddCommGroup E]
[TopologicalSpace α]
[OpensMeasurableSpace α]
[SecondCountableTopologyEither α E]
{f : α → E}
{s : Set α}
{μ : MeasureTheory.Measure α}
(hs : IsOpen s)
(hf : ∀ x ∈ s, ContinuousAt f x)
(x : α)

x ∈ s → StronglyMeasurableAtFilter f (𝓝 x) μ


theorem isBigO_const_smul_left {c : 𝕜} (hc : c ≠ 0) : (fun x => c • f' x) =O[l] g ↔ f' =O[l] g

{α : Type u_1}
{F : Type u_4}
{E' : Type u_6}
{𝕜 : Type u_15}
[Norm F]
[SeminormedAddCommGroup E']
[NormedDivisionRing 𝕜]
{g : α → F}
{f' : α → E'}
{l : Filter α}
[Module 𝕜 E']
[BoundedSMul 𝕜 E']
{c : 𝕜}
(hc : c ≠ 0)


@[simp]
theorem trace_transpose : trace R (Module.Dual R M) ∘ₗ Module.Dual.transpose = trace R M

(R : Type u_1)
[CommRing R]
(M : Type u_2)
[AddCommGroup M]
[Module R M]
[Module.Free R M]
[Module.Finite R M]

LinearMap.trace R (Module.Dual R M) ∘ₗ Module.Dual.transpose = LinearMap.trace R M


/-- The **Plünnecke-Ruzsa inequality**. Division version. -/
@[to_additive "The **Plünnecke-Ruzsa inequality**. Subtraction version."]
theorem pluennecke_ruzsa_inequality_pow_div_pow_div (hA : A.Nonempty) (B : Finset α) (m n : ℕ) :
    (B ^ m / B ^ n).card ≤ ((A / B).card / A.card : ℚ≥0) ^ (m + n) * A.card

{α : Type u_1}
[CommGroup α]
[DecidableEq α]
{A : Finset α}
(hA : A.Nonempty)
(B : Finset α)
(m n : ℕ)

↑(B ^ m / B ^ n).card ≤ (↑(A / B).card / ↑A.card) ^ (m + n) * ↑A.card


@[to_additive]
theorem uniformEquicontinuous_of_equicontinuousAt_one {ι G M hom : Type*} [UniformSpace G]
    [UniformSpace M] [Group G] [Group M] [UniformGroup G] [UniformGroup M]
    [FunLike hom G M] [MonoidHomClass hom G M]
    (F : ι → hom) (hf : EquicontinuousAt ((↑) ∘ F) (1 : G)) :
    UniformEquicontinuous ((↑) ∘ F)

(hf : EquicontinuousAt (DFunLike.coe ∘ F) 0)

UniformEquicontinuous (DFunLike.coe ∘ F)


theorem norm (h : IntervalIntegrable f μ a b) : IntervalIntegrable (fun x => ‖f x‖) μ a b

{E : Type u_3}
[NormedAddCommGroup E]
{f : ℝ → E}
{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}
(h : IntervalIntegrable f μ a b)


/-- A sum of finite terms is finite. -/
lemma sum_lt_top (h : ∀ i ∈ s, f i ≠ ⊤) : ∑ i ∈ s, f i < ⊤

{ι : Type u_1}
{α : Type u_2}
[AddCommMonoid α]
[LT α]
{s : Finset ι}
{f : ι → WithTop α}
(h : ∀ i ∈ s, f i ≠ ⊤)


theorem dist_iterate_next_apply_le (f₁ f₂ : FunSpace v) (n : ℕ) (t : Icc v.tMin v.tMax) :
    dist (next^[n] f₁ t) (next^[n] f₂ t) ≤ (v.L * |t.1 - v.t₀|) ^ n / n ! * dist f₁ f₂

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{v : PicardLindelof E}
(f₁ f₂ : v.FunSpace)
(n : ℕ)
(t : ↑(Set.Icc v.tMin v.tMax))

dist ((PicardLindelof.FunSpace.next^[n] f₁).toFun t) ((PicardLindelof.FunSpace.next^[n] f₂).toFun t) ≤
  (↑v.L * |↑t - ↑v.t₀|) ^ n / ↑n ! * dist f₁ f₂


/-- The obvious map `PushoutCocone f g → PullbackCone f.unop g.unop` -/
@[simps!]
def unop {X Y Z : Cᵒᵖ} {f : X ⟶ Y} {g : X ⟶ Z} (c : PushoutCocone f g) :
    PullbackCone f.unop g.unop

(c : CategoryTheory.Limits.PushoutCocone f g)


@[gcongr] protected theorem Sublist.tail : ∀ {l₁ l₂ : List α}, l₁ <+ l₂ → tail l₁ <+ tail l₂


/-- If `f ≫ g` is a strong monomorphism, then so is `f`. -/
theorem strongMono_of_strongMono [StrongMono (f ≫ g)] : StrongMono f

[CategoryTheory.StrongMono (CategoryTheory.CategoryStruct.comp f g)]


@[simp]
theorem coe_orderIsoOfFin_apply (s : Finset α) {k : ℕ} (h : s.card = k) (i : Fin k) :
    ↑(orderIsoOfFin s h i) = orderEmbOfFin s h i

{α : Type u_1}
[LinearOrder α]
(s : Finset α)
{k : ℕ}
(h : s.card = k)
(i : Fin k)

↑((s.orderIsoOfFin h) i) = (s.orderEmbOfFin h) i


theorem Eq.mpr_prop {p q : Prop} (h₁ : p = q) (h₂ : q)  : p


@[simp]
theorem ciSup_const [hι : Nonempty ι] {a : α} : ⨆ _ : ι, a = a

{α : Type u_1}
{ι : Sort u_4}
[ConditionallyCompleteLattice α]
[hι : Nonempty ι]
{a : α}


/-- Polarization identity: The real inner product, in terms of the norm. -/
theorem real_inner_eq_norm_mul_self_add_norm_mul_self_sub_norm_sub_mul_self_div_two (x y : F) :
    ⟪x, y⟫_ℝ = (‖x‖ * ‖x‖ + ‖y‖ * ‖y‖ - ‖x - y‖ * ‖x - y‖) / 2

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


theorem Disjoint.mono (h₁ : a ≤ b) (h₂ : c ≤ d) : Disjoint b d → Disjoint a c

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


theorem ble_eq_false {x y : ℕ} : x.ble y = false ↔ y < x


@[scoped simp]
theorem map_add_ofNat' [AddMonoidWithOne G] [AddMonoid H] [AddConstMapClass F G H 1 b]
    (f : F) (x : G) (n : ℕ) [n.AtLeastTwo] :
    f (x + no_index (OfNat.ofNat n)) = f x + (OfNat.ofNat n : ℕ) • b

{F : Type u_1}
{G : Type u_2}
{H : Type u_3}
[FunLike F G H]
{b : H}
[AddMonoidWithOne G]
[AddMonoid H]
[AddConstMapClass F G H 1 b]
(f : F)
(x : G)
(n : ℕ)
[n.AtLeastTwo]

f (x + OfNat.ofNat n) = f x + OfNat.ofNat n • b


theorem pumping_lemma [Fintype σ] {x : List α} (hx : x ∈ M.accepts)
    (hlen : Fintype.card σ ≤ List.length x) :
    ∃ a b c,
      x = a ++ b ++ c ∧
        a.length + b.length ≤ Fintype.card σ ∧ b ≠ [] ∧ {a} * {b}∗ * {c} ≤ M.accepts

{α : Type u}
{σ : Type v}
(M : DFA α σ)
[Fintype σ]
{x : List α}
(hx : x ∈ M.accepts)
(hlen : Fintype.card σ ≤ x.length)


theorem IsBigOWith.sub_isLittleO (h₁ : IsBigOWith c₁ l f₁ g) (h₂ : f₂ =o[l] g) (hc : c₁ < c₂) :
    IsBigOWith c₂ l (fun x => f₁ x - f₂ x) g

{α : Type u_1}
{F : Type u_4}
{E' : Type u_6}
[Norm F]
[SeminormedAddCommGroup E']
{c₁ c₂ : ℝ}
{g : α → F}
{l : Filter α}
{f₁ f₂ : α → E'}
(h₁ : Asymptotics.IsBigOWith c₁ l f₁ g)
(h₂ : f₂ =o[l] g)
(hc : c₁ < c₂)

Asymptotics.IsBigOWith c₂ l (fun x => f₁ x - f₂ x) g


theorem parallelepiped_orthonormalBasis_one_dim (b : OrthonormalBasis ι ℝ ℝ) :
    parallelepiped b = Icc 0 1 ∨ parallelepiped b = Icc (-1) 0

{ι : Type u_1}
[Fintype ι]
(b : OrthonormalBasis ι ℝ ℝ)

parallelepiped ⇑b = Set.Icc 0 1 ∨ parallelepiped ⇑b = Set.Icc (-1) 0


@[to_additive]
theorem isClosedMap_smul (c : G) : IsClosedMap fun x : α => c • x

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


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

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