/-- The continuous linear equivalence between a vector space over `𝕜` with a finite basis and
functions from its basis indexing type to `𝕜`. -/
@[simps! apply]
def equivFunL (v : Basis ι 𝕜 E) : E ≃L[𝕜] ι → 𝕜

{𝕜 : Type u}
[hnorm : NontriviallyNormedField 𝕜]
{E : Type v}
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousSMul 𝕜 E]
[CompleteSpace 𝕜]
{ι : Type u_1}
[Finite ι]
[T2Space E]
(v : Basis ι 𝕜 E)

∀ (a : E) (a_1 : ι), v.equivFunL a a_1 = (v.repr a) a_1


@[simp]
theorem deriv_one (a : α) : deriv 1 a = 0

{α : Type u_1}
[dec : DecidableEq α]
(a : α)


theorem _root_.MeasurableEquiv.memℒp_map_measure_iff (f : α ≃ᵐ β) {g : β → F} :
    Memℒp g p (Measure.map f μ) ↔ Memℒp (g ∘ f) p μ

{α : Type u_1}
{F : Type u_3}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup F]
{β : Type u_5}
{mβ : MeasurableSpace β}
(f : α ≃ᵐ β)
{g : β → F}

MeasureTheory.Memℒp g p (MeasureTheory.Measure.map (⇑f) μ) ↔ MeasureTheory.Memℒp (g ∘ ⇑f) p μ


/-- The product of `f` over `insert a s` is the same as
the product over `s`, as long as `a` is in `s` or `f a = 1`. -/
@[to_additive (attr := simp) "The sum of `f` over `insert a s` is the same as
the sum over `s`, as long as `a` is in `s` or `f a = 0`."]
theorem prod_insert_of_eq_one_if_not_mem [DecidableEq α] (h : a ∉ s → f a = 1) :
    ∏ x ∈ insert a s, f x = ∏ x ∈ s, f x

{α : Type u_3}
{β : Type u_4}
{s : Finset α}
{a : α}
{f : α → β}
[AddCommMonoid β]
[DecidableEq α]
(h : a ∉ s → f a = 0)


@[simp]
theorem matches'_mul (P Q : RegularExpression α) : (P * Q).matches' = P.matches' * Q.matches'

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


/-- The converse is true if `J` is cofiltered, see `intiallySmall_of_small_weakly_initial_set`. -/
theorem InitiallySmall.exists_small_weakly_initial_set [InitiallySmall.{w} J] :
    ∃ (s : Set J) (_ : Small.{w} s), ∀ i, ∃ j ∈ s, Nonempty (j ⟶ i)

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

∃ s, ∃ (_ : Small.{w, u} ↑s), ∀ (i : J), ∃ j ∈ s, Nonempty (j ⟶ i)


/-- Construct limit data for a product in `ModuleCat R`, using `ModuleCat.of R (∀ j, F.obj j)`.
-/
@[simps]
def productLimitCone : Limits.LimitCone (Discrete.functor f)

{R : Type u}
[Ring R]
{J : Type w}
(f : J → ModuleCat R)
(s : CategoryTheory.Limits.Fan f)

(ModuleCat.HasLimit.productLimitCone f).isLimit.lift s = ModuleCat.HasLimit.lift f s


@[simp]
theorem smul_inv_smul₀ {c : α} (hc : c ≠ 0) (x : β) : c • c⁻¹ • x = x

{α : Type u}
{β : Type v}
[GroupWithZero α]
[MulAction α β]
{c : α}
(hc : c ≠ 0)
(x : β)


@[reassoc]
theorem ι_f_zero_comp_complex_d :
    I.ι.f 0 ≫ I.cocomplex.d 0 1 = 0

(I : CategoryTheory.InjectiveResolution Z)

CategoryTheory.CategoryStruct.comp (I.ι.f 0) (I.cocomplex.d 0 1) = 0


theorem IsBigO.add_isLittleO (h₁ : f₁ =O[l] g) (h₂ : f₂ =o[l] g) : (fun x => f₁ x + f₂ x) =O[l] g

{α : Type u_1}
{F : Type u_4}
{E' : Type u_6}
[Norm F]
[SeminormedAddCommGroup E']
{g : α → F}
{l : Filter α}
{f₁ f₂ : α → E'}
(h₁ : f₁ =O[l] g)
(h₂ : f₂ =o[l] g)


@[to_additive]
theorem preimage_normal {f : G → H} (hf : IsGroupHom f) {s : Set H} (hs : IsNormalSubgroup s) :
    IsNormalSubgroup (f ⁻¹' s)

{G : Type u_1}
{H : Type u_2}
[AddGroup G]
[AddGroup H]
{f : G → H}
(hf : IsAddGroupHom f)
{s : Set H}
(hs : IsNormalAddSubgroup s)


@[simp]
theorem id_c_app (X : PresheafedSpace C) (U) :
    (𝟙 X : X ⟶ X).c.app U = X.presheaf.map (𝟙 U)

(X : AlgebraicGeometry.PresheafedSpace C)


@[simp]
theorem aevalTower_X : aevalTower g y X = y

{R : Type u}
{S : Type v}
{A' : Type u_1}
[CommSemiring R]
[CommSemiring A']
[CommSemiring S]
[Algebra S R]
[Algebra S A']
(g : R →ₐ[S] A')
(y : A')

(Polynomial.aevalTower g y) Polynomial.X = y


/-- Induction principle for finset families. To prove a statement for every finset family,
it suffices to prove it for
* the empty finset family.
* the finset family which only contains the empty finset.
* `{s ∪ {a} | s ∈ 𝒜}` assuming the property for `𝒜` a family of finsets not containing `a`.
* `ℬ ∪ 𝒞` assuming the property for `ℬ` and `𝒞`, where `a` is an element of the ground type and
  `ℬ`is a family of finsets not containing `a` and `𝒞` a family of finsets containing `a`.
  Note that instead of giving `ℬ` and `𝒞`, the `subfamily` case gives you `𝒜 = ℬ ∪ 𝒞`, so that
  `ℬ = 𝒜.filter (a ∉ ·)` and `𝒞 = 𝒜.filter (a ∈ ·)`.

This is a way of formalising induction on `n` where `𝒜` is a finset family on `n` elements.

See also `Finset.memberFamily_induction_on.`-/
@[elab_as_elim]
protected lemma family_induction_on {p : Finset (Finset α) → Prop}
    (𝒜 : Finset (Finset α)) (empty : p ∅) (singleton_empty : p {∅})
    (image_insert : ∀ (a : α) ⦃𝒜 : Finset (Finset α)⦄,
      (∀ s ∈ 𝒜, a ∉ s) → p 𝒜 → p (𝒜.image <| insert a))
    (subfamily : ∀ (a : α) ⦃𝒜 : Finset (Finset α)⦄,
      p (𝒜.filter (a ∉ ·)) → p (𝒜.filter (a ∈ ·)) → p 𝒜) : p 𝒜

(image_insert : ∀ (a : α) ⦃𝒜 : Finset (Finset α)⦄, (∀ s ∈ 𝒜, a ∉ s) → p 𝒜 → p (Finset.image (insert a) 𝒜))

(subfamily :
  ∀ (a : α) ⦃𝒜 : Finset (Finset α)⦄, p (Finset.filter (fun x => a ∉ x) 𝒜) → p (Finset.filter (fun x => a ∈ x) 𝒜) → p 𝒜)


theorem sub_one_dvd_pow_sub_one [Ring α] (x : α) (n : ℕ) :
    x - 1 ∣ x ^ n - 1


/-- In a complete lattice, the limsup of a function is the infimum over sets `s` in the filter
of the supremum of the function over `s` -/
theorem limsup_eq_iInf_iSup {f : Filter β} {u : β → α} : limsup u f = ⨅ s ∈ f, ⨆ a ∈ s, u a

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
{f : Filter β}
{u : β → α}

Filter.limsup u f = ⨅ s ∈ f, ⨆ a ∈ s, u a


/-- If the derivatives within a set of `g` at `f x` are bounded by `C`, and the `i`-th derivative
within a set of `f` at `x` is bounded by `D^i` for all `1 ≤ i ≤ n`, then the `n`-th derivative
of `g ∘ f` is bounded by `n! * C * D^n`.
This lemma proves this estimate assuming additionally that two of the spaces live in the same
universe, to make an induction possible. Use instead `norm_iteratedFDerivWithin_comp_le` that
removes this assumption. -/
theorem norm_iteratedFDerivWithin_comp_le_aux {Fu Gu : Type u} [NormedAddCommGroup Fu]
    [NormedSpace 𝕜 Fu] [NormedAddCommGroup Gu] [NormedSpace 𝕜 Gu] {g : Fu → Gu} {f : E → Fu} {n : ℕ}
    {s : Set E} {t : Set Fu} {x : E} (hg : ContDiffOn 𝕜 n g t) (hf : ContDiffOn 𝕜 n f s)
    (ht : UniqueDiffOn 𝕜 t) (hs : UniqueDiffOn 𝕜 s) (hst : MapsTo f s t) (hx : x ∈ s) {C : ℝ}
    {D : ℝ} (hC : ∀ i, i ≤ n → ‖iteratedFDerivWithin 𝕜 i g t (f x)‖ ≤ C)
    (hD : ∀ i, 1 ≤ i → i ≤ n → ‖iteratedFDerivWithin 𝕜 i f s x‖ ≤ D ^ i) :
    ‖iteratedFDerivWithin 𝕜 n (g ∘ f) s x‖ ≤ n ! * C * D ^ n

(hC : ∀ i ≤ n, ‖iteratedFDerivWithin 𝕜 i g t (f x)‖ ≤ C)

(hD : ∀ (i : ℕ), 1 ≤ i → i ≤ n → ‖iteratedFDerivWithin 𝕜 i f s x‖ ≤ D ^ i)

‖iteratedFDerivWithin 𝕜 n (g ∘ f) s x‖ ≤ ↑n ! * C * D ^ n


/-- The **Akra-Bazzi theorem**: `T ∈ Ω(n^p (1 + ∑_u^n g(u) / u^{p+1}))` -/
theorem isBigO_symm_asympBound : asympBound g a b =O[atTop] T

{α : Type u_1}
[Fintype α]
[Nonempty α]
{T : ℕ → ℝ}
{g : ℝ → ℝ}
{a b : α → ℝ}
{r : α → ℕ → ℕ}
(R : AkraBazziRecurrence T g a b r)

AkraBazziRecurrence.asympBound g a b =O[Filter.atTop] T


theorem injective_restrict [T2Space β] {s : Set α} (hs : Dense s) :
    Injective (restrict s : C(α, β) → C(s, β))

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[T2Space β]
{s : Set α}
(hs : Dense s)


theorem dvd_gcd {s : Multiset α} {a : α} : a ∣ s.gcd ↔ ∀ b ∈ s, a ∣ b

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{s : Multiset α}
{a : α}


/-- The `G`-action on a connected finite `G`-set is transitive. -/
theorem Action.pretransitive_of_isConnected (X : Action FintypeCat (MonCat.of G))
    [IsConnected X] : MulAction.IsPretransitive G X.V


theorem coe_comp (f : NormedAddGroupHom V₁ V₂) (g : NormedAddGroupHom V₂ V₃) :
    (g.comp f : V₁ → V₃) = (g : V₂ → V₃) ∘ (f : V₁ → V₂)

{V₁ : Type u_2}
{V₂ : Type u_3}
{V₃ : Type u_4}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
[SeminormedAddCommGroup V₃]
(f : NormedAddGroupHom V₁ V₂)
(g : NormedAddGroupHom V₂ V₃)


theorem ModularGroup_T_zpow_mem_verticalStrip (z : ℍ) {N : ℕ} (hn : 0 < N) :
    ∃ n : ℤ, ModularGroup.T ^ (N * n) • z ∈ verticalStrip N z.im

∃ n, ModularGroup.T ^ (↑N * n) • z ∈ UpperHalfPlane.verticalStrip (↑N) z.im


theorem nat_lt_continuum (n : ℕ) : ↑n < 𝔠


/-- Monotone convergence theorem expressed with limits -/
theorem lintegral_tendsto_of_tendsto_of_monotone {f : ℕ → α → ℝ≥0∞} {F : α → ℝ≥0∞}
    (hf : ∀ n, AEMeasurable (f n) μ) (h_mono : ∀ᵐ x ∂μ, Monotone fun n => f n x)
    (h_tendsto : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 <| F x)) :
    Tendsto (fun n => ∫⁻ x, f n x ∂μ) atTop (𝓝 <| ∫⁻ x, F x ∂μ)

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

{F : α → ℝ≥0∞}

(h_mono : ∀ᵐ (x : α) ∂μ, Monotone fun n => f n x)

(h_tendsto : ∀ᵐ (x : α) ∂μ, Filter.Tendsto (fun n => f n x) Filter.atTop (𝓝 (F x)))

Filter.Tendsto (fun n => ∫⁻ (x : α), f n x ∂μ) Filter.atTop (𝓝 (∫⁻ (x : α), F x ∂μ))


theorem neg_eq' : Neg.neg = (id : R → R)


@[to_additive]
theorem coe_eq_singleton {H : Subgroup G} : (∃ g : G, (H : Set G) = {g}) ↔ H = ⊥

{G : Type u_1}
[Group G]
{H : Subgroup G}


/-- See also `Ergodic.ae_empty_or_univ_of_preimage_ae_le`. -/
theorem ae_empty_or_univ_of_preimage_ae_le' (hf : Ergodic f μ) (hs : MeasurableSet s)
    (hs' : f ⁻¹' s ≤ᵐ[μ] s) (h_fin : μ s ≠ ∞) : s =ᵐ[μ] (∅ : Set α) ∨ s =ᵐ[μ] univ

{α : Type u_1}
{m : MeasurableSpace α}
{f : α → α}
{s : Set α}
{μ : MeasureTheory.Measure α}
(hf : Ergodic f μ)
(hs : MeasurableSet s)
(hs' : f ⁻¹' s ≤ᵐ[μ] s)
(h_fin : μ s ≠ ⊤)


@[to_additive]
theorem closure_singleton_le_iff_mem (m : M) (p : Submonoid M) : closure {m} ≤ p ↔ m ∈ p

{M : Type u_1}
[AddZeroClass M]
(m : M)
(p : AddSubmonoid M)


@[simp]
theorem comp_apply (g : N ↪ₑ[L] P) (f : M ↪ₑ[L] N) (x : M) : g.comp f x = g (f x)

{L : FirstOrder.Language}
{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[L.Structure M]
[L.Structure N]
[L.Structure P]
(g : N ↪ₑ[L] P)
(f : M ↪ₑ[L] N)
(x : M)


protected theorem isOpen (U : OpenNhdsOf x) : IsOpen (U : Set α)

{α : Type u_2}
[TopologicalSpace α]
{x : α}
(U : TopologicalSpace.OpenNhdsOf x)


/-- The snake input in the opposite category that is deduced from a snake input. -/
@[simps]
noncomputable def op : SnakeInput Cᵒᵖ

(S : CategoryTheory.ShortComplex.SnakeInput C)

S.op.v₀₁ = CategoryTheory.ShortComplex.opMap S.v₂₃


theorem hasFiniteIntegral_const [IsFiniteMeasure μ] (c : β) :
    HasFiniteIntegral (fun _ : α => c) μ

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

MeasureTheory.HasFiniteIntegral (fun x => c) μ


theorem tfae_not_iff {l : List Prop} : TFAE (l.map Not) ↔ TFAE l


@[to_additive]
theorem Multipliable.map_tprod [CommMonoid γ] [TopologicalSpace γ] [T2Space γ] (hf : Multipliable f)
    {G} [FunLike G α γ] [MonoidHomClass G α γ] (g : G) (hg : Continuous g) :
    g (∏' i, f i) = ∏' i, g (f i)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[CommMonoid α]
[TopologicalSpace α]
{f : β → α}
[CommMonoid γ]
[TopologicalSpace γ]
[T2Space γ]
(hf : Multipliable f)
{G : Type u_5}
[FunLike G α γ]
[MonoidHomClass G α γ]
(g : G)
(hg : Continuous ⇑g)


lemma P4_neg_left : P4 x₁ x₂ y ↔ P4 (-x₂) (-x₁) y

Surreal.Multiplication.P4 x₁ x₂ y ↔ Surreal.Multiplication.P4 (-x₂) (-x₁) y


/-- The type of `⊓`-preserving functions from `α` to `β`. -/
structure InfHom (α β : Type*) [Inf α] [Inf β] where
  /-- The underlying function of an `InfHom` -/
  toFun : α → β
  /-- An `InfHom` preserves infima. -/
  map_inf' (a b : α) : toFun (a ⊓ b) = toFun a ⊓ toFun b

{α : Type u_7}
{β : Type u_8}
[Inf α]
[Inf β]
(self : InfHom α β)
(a b : α)

self.toFun (a ⊓ b) = self.toFun a ⊓ self.toFun b


@[to_additive]
theorem coe_div [Div Y] (f g : LocallyConstant X Y) : ⇑(f / g) = f / g

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[Sub Y]
(f g : LocallyConstant X Y)


/-- The `R`-algebra `HahnSeries ℕ A` is isomorphic to `PowerSeries A`. -/
@[simps!]
def toPowerSeriesAlg : HahnSeries ℕ A ≃ₐ[R] PowerSeries A

(R : Type u_2)
[CommSemiring R]
{A : Type u_3}
[Semiring A]
[Algebra R A]
(f : HahnSeries ℕ A)

(HahnSeries.toPowerSeriesAlg R) f = PowerSeries.mk f.coeff


@[to_additive (attr := simp, norm_cast) coe_pos]
theorem one_lt_coe [LT α] {a : α} : 1 < (a : WithTop α) ↔ 1 < a


theorem iUnion_iInter_ge_nat_add (f : ℕ → Set α) (k : ℕ) :
    ⋃ n, ⋂ i ≥ n, f (i + k) = ⋃ n, ⋂ i ≥ n, f i

⋃ n, ⋂ i, ⋂ (_ : i ≥ n), f (i + k) = ⋃ n, ⋂ i, ⋂ (_ : i ≥ n), f i


@[simp]
theorem lift_id (x) : lift (map_units S : ∀ _ : M, IsUnit _) x = x

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
(x : S)


@[simp]
theorem mem_compPartialSumSource_iff (m M N : ℕ) (i : Σ n, Fin n → ℕ) :
    i ∈ compPartialSumSource m M N ↔
      (m ≤ i.1 ∧ i.1 < M) ∧ ∀ a : Fin i.1, 1 ≤ i.2 a ∧ i.2 a < N

i ∈ FormalMultilinearSeries.compPartialSumSource m M N ↔
  (m ≤ i.fst ∧ i.fst < M) ∧ ∀ (a : Fin i.fst), 1 ≤ i.snd a ∧ i.snd a < N


@[simp]
theorem ofNat_add_continuum {n : ℕ} [Nat.AtLeastTwo n] : no_index (OfNat.ofNat n) + 𝔠 = 𝔠

OfNat.ofNat n + Cardinal.continuum = Cardinal.continuum


/-- If `p` and `q` are irreducible, then `p ∣ q` implies `q ∣ p`. -/
theorem Irreducible.dvd_symm [Monoid α] {p q : α} (hp : Irreducible p) (hq : Irreducible q) :
    p ∣ q → q ∣ p

{α : Type u_1}
[Monoid α]
{p q : α}
(hp : Irreducible p)
(hq : Irreducible q)


theorem enumOrd_mem (hS : Unbounded (· < ·) S) (o) : enumOrd S o ∈ S

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


@[to_additive (attr := simp)]
theorem inv_insert (a : α) (s : Finset α) : (insert a s)⁻¹ = insert a⁻¹ s⁻¹

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


/-- If `Y` is sequential and Hausdorff, then proper maps `X → Y` are exactly continuous maps
such that the preimage of any compact set is compact.

This result is a direct consequence of `isProperMap_iff_isCompact_preimage`, because any
Hausdorff and sequential space is compactly generated. In the future it should be inferred
by typeclass inference, however compactly generated spaces are not yet in Mathlib (TODO),
therefore we also add this theorem. -/
theorem SequentialSpace.isProperMap_iff_isCompact_preimage [T2Space Y] [SequentialSpace Y] :
    IsProperMap f ↔ Continuous f ∧ ∀ ⦃K⦄, IsCompact K → IsCompact (f ⁻¹' K)

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

IsProperMap f ↔ Continuous f ∧ ∀ ⦃K : Set Y⦄, IsCompact K → IsCompact (f ⁻¹' K)


@[simp]
theorem smul_apply {f : 𝓢(E, F)} {c : 𝕜} {x : E} : (c • f) x = c • f x

{𝕜 : Type u_1}
{E : Type u_4}
{F : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
[NormedField 𝕜]
[NormedSpace 𝕜 F]
[SMulCommClass ℝ 𝕜 F]
{f : SchwartzMap E F}
{c : 𝕜}
{x : E}


@[to_additive]
theorem IsCyclic.image_range_orderOf (ha : ∀ x : α, x ∈ zpowers a) :
    Finset.image (fun i => a ^ i) (range (orderOf a)) = univ

(ha : ∀ (x : α), x ∈ Subgroup.zpowers a)

Finset.image (fun i => a ^ i) (Finset.range (orderOf a)) = Finset.univ


theorem strictMono_subseq_of_tendsto_atTop [LinearOrder β] [NoMaxOrder β] {u : ℕ → β}
    (hu : Tendsto u atTop atTop) : ∃ φ : ℕ → ℕ, StrictMono φ ∧ StrictMono (u ∘ φ)

(hu : Filter.Tendsto u Filter.atTop Filter.atTop)


@[simp]
theorem prodExtendRight_apply_eq (b : β₁) : prodExtendRight a e (a, b) = (a, e b)

{α₁ : Type u_2}
{β₁ : Type u_1}
[DecidableEq α₁]
(a : α₁)
(e : Equiv.Perm β₁)
(b : β₁)

(Equiv.Perm.prodExtendRight a e) (a, b) = (a, e b)


/-- Four-way commutativity of `prod`. The name matches `mul_mul_mul_comm`. -/
@[simps apply]
def prodProdProdComm : ((M × M₂) × M₃ × M₄) ≃ₗ[R] (M × M₃) × M₂ × M₄

(R : Type u)
(M : Type v)
(M₂ : Type w)
(M₃ : Type y)
(M₄ : Type z)
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[AddCommMonoid M₄]
[Module R M]
[Module R M₂]
[Module R M₃]
[Module R M₄]
(mnmn : (M × M₂) × M₃ × M₄)

(LinearEquiv.prodProdProdComm R M M₂ M₃ M₄) mnmn = ((mnmn.1.1, mnmn.2.1), mnmn.1.2, mnmn.2.2)


lemma map_polynomialZ : (W'.map f).toJacobian.polynomialZ = MvPolynomial.map f W'.polynomialZ

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
{S : Type u_1}
[CommRing S]
(f : R →+* S)

(WeierstrassCurve.map W' f).toJacobian.polynomialZ = (MvPolynomial.map f) W'.polynomialZ


/-- Any category with pullbacks and binary products, has equalizers. -/
theorem hasEqualizers_of_hasPullbacks_and_binary_products [HasBinaryProducts C] [HasPullbacks C] :
    HasEqualizers C


/-- Monotone convergence for a supremum over a directed family and indexed by a countable type -/
theorem lintegral_iSup_directed_of_measurable [Countable β] {f : β → α → ℝ≥0∞}
    (hf : ∀ b, Measurable (f b)) (h_directed : Directed (· ≤ ·) f) :
    ∫⁻ a, ⨆ b, f b a ∂μ = ⨆ b, ∫⁻ a, f b a ∂μ

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

(h_directed : Directed (fun x x_1 => x ≤ x_1) f)

∫⁻ (a : α), ⨆ b, f b a ∂μ = ⨆ b, ∫⁻ (a : α), f b a ∂μ


/-- For nontrivial filters in linear orders, coboundedness for `≤` implies frequent boundedness
from below. -/
lemma IsCobounded.frequently_ge [NeBot F] (cobdd : IsCobounded (· ≤ ·) F) :
    ∃ l, ∃ᶠ x in F, l ≤ x

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


theorem isLittleO_irrefl (h : ∃ᶠ x in l, f'' x ≠ 0) : ¬f'' =o[l] f''

{α : Type u_1}
{E'' : Type u_9}
[NormedAddCommGroup E'']
{f'' : α → E''}
{l : Filter α}
(h : ∃ᶠ (x : α) in l, f'' x ≠ 0)


theorem IsClopen.preimage {s : Set Y} (h : IsClopen s) {f : X → Y} (hf : Continuous f) :
    IsClopen (f ⁻¹' s)

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


theorem map_eq_replicate_iff {l : List α} {f : α → β} {b : β} :
    l.map f = replicate l.length b ↔ ∀ x ∈ l, f x = b

{α : Type u_1}
{β : Type u_2}
{l : List α}
{f : α → β}
{b : β}

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


theorem nonempty_def (u : PSet) : u.Nonempty ↔ ∃ x, x ∈ u


/-- **Markov's inequality**, also known as **Chebyshev's first inequality**. -/
theorem meas_ge_le_lintegral_div {f : α → ℝ≥0∞} (hf : AEMeasurable f μ) {ε : ℝ≥0∞} (hε : ε ≠ 0)
    (hε' : ε ≠ ∞) : μ { x | ε ≤ f x } ≤ (∫⁻ a, f a ∂μ) / ε

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
(hf : AEMeasurable f μ)
{ε : ℝ≥0∞}
(hε : ε ≠ 0)
(hε' : ε ≠ ⊤)

μ {x | ε ≤ f x} ≤ (∫⁻ (a : α), f a ∂μ) / ε


protected theorem stronglyMeasurable [LE E] (hf : Submartingale f ℱ μ) (i : ι) :
    StronglyMeasurable[ℱ i] (f i)

(hf : MeasureTheory.Submartingale f ℱ μ)


@[simp]
theorem pure_bind (a : α) (f : α → PMF β) : (pure a).bind f = f a

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


@[simp]
theorem add_one_eq_succ : ∀ a : NatOrdinal, a + 1 = succ a


/-- A snake input in an abelian category `C` consists of morphisms
of short complexes `L₀ ⟶ L₁ ⟶ L₂ ⟶ L₃` (which should be visualized vertically) such
that `L₀` and `L₃` are respectively the kernel and the cokernel of `L₁ ⟶ L₂`,
`L₁` and `L₂` are exact, `L₁.g` is epi and `L₂.f` is mono. -/
structure SnakeInput where
  /-- the zeroth row -/
  L₀ : ShortComplex C
  /-- the first row -/
  L₁ : ShortComplex C
  /-- the second row -/
  L₂ : ShortComplex C
  /-- the third row -/
  L₃ : ShortComplex C
  /-- the morphism from the zeroth row to the first row -/
  v₀₁ : L₀ ⟶ L₁
  /-- the morphism from the first row to the second row -/
  v₁₂ : L₁ ⟶ L₂
  /-- the morphism from the second row to the third row -/
  v₂₃ : L₂ ⟶ L₃
  w₀₂ : v₀₁ ≫ v₁₂ = 0 := by aesop_cat
  w₁₃ : v₁₂ ≫ v₂₃ = 0 := by aesop_cat
  /-- `L₀` is the kernel of `v₁₂ : L₁ ⟶ L₂`. -/
  h₀ : IsLimit (KernelFork.ofι _ w₀₂)
  /-- `L₃` is the cokernel of `v₁₂ : L₁ ⟶ L₂`. -/
  h₃ : IsColimit (CokernelCofork.ofπ _ w₁₃)
  L₁_exact : L₁.Exact
  epi_L₁_g : Epi L₁.g
  L₂_exact : L₂.Exact
  mono_L₂_f : Mono L₂.f

(self : CategoryTheory.ShortComplex.SnakeInput C)


@[reassoc (attr := simp)]
theorem unit_naturality {X Y : C} (f : X ⟶ Y) :
    adj.unit.app X ≫ G.map (F.map f) = f ≫ adj.unit.app Y

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

CategoryTheory.CategoryStruct.comp (adj.unit.app X) (G.map (F.map f)) =
  CategoryTheory.CategoryStruct.comp f (adj.unit.app Y)


theorem isClosed_Ici {a : α} : IsClosed (Ici a)

{α : Type u}
[TopologicalSpace α]
[Preorder α]
[ClosedIciTopology α]
{a : α}


/-- A cone `c` on `F : J ⥤ C` lifts to a cone in `Over c.pt` with cone point `𝟙 c.pt`. -/
@[simps]
def Cone.toUnder {F : J ⥤ C} (c : Cone F) :
    Cone (c.toStructuredArrow ⋙ StructuredArrow.toUnder _ _)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : CategoryTheory.Functor J C}
(c : CategoryTheory.Limits.Cone F)
(j : J)

c.toUnder.π.app j = CategoryTheory.Under.homMk (c.π.app j) ⋯


theorem floor_nonpos (ha : a ≤ 0) : ⌊a⌋ ≤ 0

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
{a : α}
(ha : a ≤ 0)


/-- A T1 space with a clopen basis is totally separated. -/
theorem totallySeparatedSpace_of_t1_of_basis_clopen [T1Space X]
    (h : IsTopologicalBasis { s : Set X | IsClopen s }) : TotallySeparatedSpace X

(h : TopologicalSpace.IsTopologicalBasis {s | IsClopen s})


@[to_additive]
theorem CauchySeq.inv {ι : Type*} [Preorder ι] {u : ι → α} (h : CauchySeq u) :
    CauchySeq u⁻¹

{α : Type u_1}
[UniformSpace α]
[AddGroup α]
[UniformAddGroup α]
{ι : Type u_3}
[Preorder ι]
{u : ι → α}
(h : CauchySeq u)


/-- The functor `StructuredArrow L R ⥤ StructuredArrow L' R'` that is deduced from
a natural transformation `R ⋙ G ⟶ F ⋙ R'` and a morphism `L' ⟶ G.obj L.` -/
@[simps!]
def map₂ : StructuredArrow L R ⥤ StructuredArrow L' R'

(X : CategoryTheory.Comma (CategoryTheory.Functor.fromPUnit L) R)

((CategoryTheory.StructuredArrow.map₂ α β).obj X).left = X.left


theorem EventuallyEq.countable_bUnion {ι : Type*} {S : Set ι} (hS : S.Countable)
    {s t : ∀ i ∈ S, Set α} (h : ∀ i hi, s i hi =ᶠ[l] t i hi) :
    ⋃ i ∈ S, s i ‹_› =ᶠ[l] ⋃ i ∈ S, t i ‹_›

(h : ∀ (i : ι) (hi : i ∈ S), s i hi =ᶠ[l] t i hi)

⋃ i, ⋃ (h : i ∈ S), s i h =ᶠ[l] ⋃ i, ⋃ (h : i ∈ S), t i h


theorem fuzzy_congr_right {x y₁ y₂ : PGame} (hy : y₁ ≈ y₂) : x ‖ y₁ ↔ x ‖ y₂

{x y₁ y₂ : SetTheory.PGame}
(hy : y₁ ≈ y₂)


theorem r1Space_iff_inseparable_or_disjoint_nhds {X : Type*} [TopologicalSpace X] :
    R1Space X ↔ ∀ x y : X, Inseparable x y ∨ Disjoint (𝓝 x) (𝓝 y)

R1Space X ↔ ∀ (x y : X), Inseparable x y ∨ Disjoint (𝓝 x) (𝓝 y)


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

(CategoryTheory.preservesLimitNatIso G).hom.app X = (CategoryTheory.preservesLimitIso G X).hom


@[simp, norm_cast]
theorem coe_smul (r : F) : ((r • f : RatFunc F) : LaurentSeries F) = r • (f : LaurentSeries F)

{F : Type u}
[Field F]
(f : RatFunc F)
(r : F)


/-- The oriented angle between two vectors is not zero or `π` if and only if those two vectors
are linearly independent. -/
theorem oangle_ne_zero_and_ne_pi_iff_linearIndependent {x y : V} :
    o.oangle x y ≠ 0 ∧ o.oangle x y ≠ π ↔ LinearIndependent ℝ ![x, y]

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

o.oangle x y ≠ 0 ∧ o.oangle x y ≠ ↑π ↔ LinearIndependent ℝ ![x, y]


@[simp]
theorem kernelIsoOfEq_trans {f g h : X ⟶ Y} [HasKernel f] [HasKernel g] [HasKernel h] (w₁ : f = g)
    (w₂ : g = h) : kernelIsoOfEq w₁ ≪≫ kernelIsoOfEq w₂ = kernelIsoOfEq (w₁.trans w₂)

CategoryTheory.Limits.kernelIsoOfEq w₁ ≪≫ CategoryTheory.Limits.kernelIsoOfEq w₂ = CategoryTheory.Limits.kernelIsoOfEq ⋯


@[simp]
theorem preimage_empty : f ⁻¹' ∅ = ∅

{α : Type u_1}
{β : Type u_2}
{f : α → β}


theorem iSup_monotone {α : Type*} (f : ℕ → α → ℝ≥0∞) :
    Monotone fun n x ↦ ⨆ (k) (_ : k ≤ n), f k x

Monotone fun n x => ⨆ k, ⨆ (_ : k ≤ n), f k x


@[simp]
theorem coe_sub : ⇑(f - g) = f - g

{α : Type u}
[TopologicalSpace α]
{R : Type u_2}
[PseudoMetricSpace R]
[Sub R]
[BoundedSub R]
[ContinuousSub R]
(f g : BoundedContinuousFunction α R)


@[simp, norm_cast]
theorem coe_smul (a : G) (f : CauSeq β abv) : ⇑(a • f) = a • (f : ℕ → β)

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
{G : Type u_3}
[SMul G β]
[IsScalarTower G β β]
(a : G)
(f : CauSeq β abv)


theorem natAbs_inj_of_nonpos_of_nonpos {a b : ℤ} (ha : a ≤ 0) (hb : b ≤ 0) :
    natAbs a = natAbs b ↔ a = b


@[to_additive (attr := simp)]
theorem coe_pureMonoidHom : (pureMonoidHom : α → Filter α) = pure


theorem totalDegree_zero_iff_isHomogeneous {p : MvPolynomial σ R} :
    p.totalDegree = 0 ↔ IsHomogeneous p 0

(σ : Type u_1)
{R : Type u_3}
[CommSemiring R]
{p : MvPolynomial σ R}


/-- An induction principle for closure membership. If `p` holds for `0`, `1`, and all elements
of `s`, and is preserved under addition and multiplication, then `p` holds for all elements
of the closure of `s`. -/
@[elab_as_elim]
theorem closure_induction {s : Set R} {p : R → Prop} {x} (h : x ∈ closure s) (mem : ∀ x ∈ s, p x)
    (zero : p 0) (add : ∀ x y, p x → p y → p (x + y)) (mul : ∀ x y, p x → p y → p (x * y)) : p x

(h : x ∈ NonUnitalSubsemiring.closure s)

(add : ∀ (x y : R), p x → p y → p (x + y))

(mul : ∀ (x y : R), p x → p y → p (x * y))


theorem smul_of_tower_mem [SMul S R] [SMul S M] [IsScalarTower S R M] (r : S) (h : x ∈ p) :
    r • x ∈ p

{S : Type u'}
{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
{module_M : Module R M}
(p : Submodule R M)
{x : M}
[SMul S R]
[SMul S M]
[IsScalarTower S R M]
(r : S)
(h : x ∈ p)


@[to_additive]
theorem cauchySeq_finset_iff_tprod_vanishing :
    (CauchySeq fun s : Finset β ↦ ∏ b ∈ s, f b) ↔
      ∀ e ∈ 𝓝 (1 : α), ∃ s : Finset β, ∀ t : Set β, Disjoint t s → (∏' b : t, f b) ∈ e

{α : Type u_1}
{β : Type u_2}
[CommGroup α]
[UniformSpace α]
[UniformGroup α]
{f : β → α}

(CauchySeq fun s => ∏ b ∈ s, f b) ↔ ∀ e ∈ 𝓝 1, ∃ s, ∀ (t : Set β), Disjoint t ↑s → ∏' (b : ↑t), f ↑b ∈ e


@[simp]
theorem lift_aeval (pb : PowerBasis A S) (y : S') (hy : aeval y (minpoly A pb.gen) = 0) (f : A[X]) :
    pb.lift y hy (aeval pb.gen f) = aeval y f

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

(pb.lift y hy) ((Polynomial.aeval pb.gen) f) = (Polynomial.aeval y) f


theorem length_pos_of_pos (h : 0 < n) : 0 < c.length


@[to_additive]
theorem smul_finset_def : a • s = s.image (a • ·)

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[VAdd α β]
{s : Finset β}
{a : α}

a +ᵥ s = Finset.image (fun x => a +ᵥ x) s


theorem convexOn_iff_forall_pos {s : Set E} {f : E → β} :
    ConvexOn 𝕜 s f ↔ Convex 𝕜 s ∧ ∀ ⦃x⦄, x ∈ s → ∀ ⦃y⦄, y ∈ s → ∀ ⦃a b : 𝕜⦄, 0 < a → 0 < b →
      a + b = 1 → f (a • x + b • y) ≤ a • f x + b • f y

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[Module 𝕜 β]
{s : Set E}
{f : E → β}

ConvexOn 𝕜 s f ↔
  Convex 𝕜 s ∧
    ∀ ⦃x : E⦄, x ∈ s → ∀ ⦃y : E⦄, y ∈ s → ∀ ⦃a b : 𝕜⦄, 0 < a → 0 < b → a + b = 1 → f (a • x + b • y) ≤ a • f x + b • f y


theorem le_def [LE α] [LE β] {x y : α × β} : x ≤ y ↔ x.1 ≤ y.1 ∧ x.2 ≤ y.2

{α : Type u_2}
{β : Type u_3}
[LE α]
[LE β]
{x y : α × β}


theorem tmul_algebraMap_mul_coe_tmul {i₂ : ι} (a₁ : A) (r : R) (a₂ : 𝒜 i₂) (b₂ : B) :
    (a₁ ᵍ⊗ₜ[R] algebraMap R B r * (a₂ : A) ᵍ⊗ₜ[R] b₂ : 𝒜 ᵍ⊗[R] ℬ)
      = (a₁ * a₂ : A) ᵍ⊗ₜ (algebraMap R B r * b₂ : B)

{R : Type u_1}
{ι : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring ι]
[Module ι (Additive ℤˣ)]
[DecidableEq ι]
[CommRing R]
[Ring A]
[Ring B]
[Algebra R A]
[Algebra R B]
(𝒜 : ι → Submodule R A)
(ℬ : ι → Submodule R B)
[GradedAlgebra 𝒜]
[GradedAlgebra ℬ]
{i₂ : ι}
(a₁ : A)
(r : R)
(a₂ : ↥(𝒜 i₂))
(b₂ : B)

a₁ ᵍ⊗ₜ[R] (algebraMap R B) r * ↑a₂ ᵍ⊗ₜ[R] b₂ = (a₁ * ↑a₂) ᵍ⊗ₜ[R] ((algebraMap R B) r * b₂)


@[simp] theorem preimage_Ioo : e ⁻¹' Ioo (e x) (e y) = Ioo x y

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(e : α ↪o β)
(x y : α)

⇑e ⁻¹' Set.Ioo (e x) (e y) = Set.Ioo x y


theorem HasFiniteFPowerSeriesAt.finite (hf : HasFiniteFPowerSeriesAt f p x n) :
    ∀ m : ℕ, n ≤ m → p m = 0

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{x : E}
{n : ℕ}
(hf : HasFiniteFPowerSeriesAt f p x n)
(m : ℕ)


@[gcongr]
theorem mul_lt_mul_of_pos_right [MulPosStrictMono α] (bc : b < c) (a0 : 0 < a) : b * a < c * a

{α : Type u_1}
{a b c : α}
[Mul α]
[Zero α]
[Preorder α]
[MulPosStrictMono α]
(bc : b < c)
(a0 : 0 < a)


/-- Composition of adjunctions. -/
@[simps]
def comp (adj₁ : f₁ ⊣ g₁) (adj₂ : f₂ ⊣ g₂) : f₁ ≫ f₂ ⊣ g₂ ≫ g₁

(adj₁ : CategoryTheory.Bicategory.Adjunction f₁ g₁)

(adj₂ : CategoryTheory.Bicategory.Adjunction f₂ g₂)

(adj₁.comp adj₂).counit = adj₁.compCounit adj₂


theorem _root_.DifferentiableOn.analyticOn {s : Set ℂ} {f : ℂ → E} (hd : DifferentiableOn ℂ f s)
    (hs : IsOpen s) : AnalyticOn ℂ f s

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
[CompleteSpace E]
{s : Set ℂ}
{f : ℂ → E}
(hd : DifferentiableOn ℂ f s)
(hs : IsOpen s)


protected theorem Associated.isUnit [Monoid α] {a b : α} (h : a ~ᵤ b) : IsUnit a → IsUnit b

{α : Type u_1}
[Monoid α]
{a b : α}
(h : a ~ᵤ b)


/-- 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).pt = c.right


theorem unique_continuousLinearMapOfBilin {v f : E} (is_lax_milgram : ∀ w, ⟪f, w⟫ = B v w) :
    f = B♯ v

(is_lax_milgram : ∀ (w : E), ⟪f, w⟫_𝕜 = (B v) w)

f = (InnerProductSpace.continuousLinearMapOfBilin B) v


@[to_additive]
theorem finprod_eq_prod_of_mulSupport_subset (f : α → M) {s : Finset α} (h : mulSupport f ⊆ s) :
    ∏ᶠ i, f i = ∏ i ∈ s, f i

{α : Type u_1}
{M : Type u_5}
[CommMonoid M]
(f : α → M)
{s : Finset α}
(h : Function.mulSupport f ⊆ ↑s)


/-- The symmetric definition of convolution. -/
theorem convolution_eq_swap : (f ⋆[L, μ] g) x = ∫ t, L (f (x - t)) (g t) ∂μ

{𝕜 : Type u𝕜}
{G : Type uG}
{E : Type uE}
{E' : Type uE'}
{F : Type uF}
[NormedAddCommGroup E]
[NormedAddCommGroup E']
[NormedAddCommGroup F]
{f : G → E}
{g : G → E'}
{x : G}
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 E']
[NormedSpace 𝕜 F]
(L : E →L[𝕜] E' →L[𝕜] F)
[MeasurableSpace G]
{μ : MeasureTheory.Measure G}
[NormedSpace ℝ F]
[AddCommGroup G]
[μ.IsAddLeftInvariant]
[μ.IsNegInvariant]
[MeasurableNeg G]
[MeasurableAdd G]

MeasureTheory.convolution f g L μ x = ∫ (t : G), (L (f (x - t))) (g t) ∂μ


theorem IsSeparable.union {s u : Set α} (hs : IsSeparable s) (hu : IsSeparable u) :
    IsSeparable (s ∪ u)

{α : Type u}
[t : TopologicalSpace α]
{s u : Set α}
(hs : TopologicalSpace.IsSeparable s)
(hu : TopologicalSpace.IsSeparable u)


@[simp]
theorem disjoint_image_iff (hf : Injective f) : Disjoint (f '' s) (f '' t) ↔ Disjoint s t

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


lemma rTensor.inverse_apply (y : N ⊗[R] Q) :
    (rTensor.inverse Q hfg hg) ((rTensor Q g) y) =
      Submodule.Quotient.mk (p := LinearMap.range (rTensor Q f)) y

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

(rTensor.inverse Q hfg hg) ((LinearMap.rTensor Q g) y) = Submodule.Quotient.mk y


theorem updateColumn_apply [DecidableEq n] {j' : n} :
    updateColumn M j c i j' = if j' = j then c i else M i j'

{m : Type u_2}
{n : Type u_3}
{α : Type v}
{M : Matrix m n α}
{i : m}
{j : n}
{c : m → α}
[DecidableEq n]
{j' : n}

M.updateColumn j c i j' = if j' = j then c i else M i j'


theorem log_mod_opow_log_lt_log_self {b o : Ordinal} (hb : 1 < b) (ho : o ≠ 0) (hbo : b ≤ o) :
    log b (o % (b ^ log b o)) < log b o

{b o : Ordinal.{u_1}}
(hb : 1 < b)
(ho : o ≠ 0)
(hbo : b ≤ o)

Ordinal.log b (o % b ^ Ordinal.log b o) < Ordinal.log b o


theorem proj_dioph (i : α) : DiophFn fun v => v i


@[to_additive (attr := simp, nolint simpNF)]
theorem mul_map_seq (x y : FreeMagma α) :
    ((· * ·) <$> x <*> y : Id (FreeMagma α)) = (x * y : FreeMagma α)

(Seq.seq ((fun x x_1 => x * x_1) <$> x) fun x => y) = x * y


@[simp, rclike_simps]
theorem ofRealCLM_apply : (ofRealCLM : ℝ → K) = ofReal


lemma Ico_filter_modEq_cast {v : ℕ} : ((Ico a b).filter (· ≡ v [MOD r])).map castEmbedding =
    (Ico (a : ℤ) (b : ℤ)).filter (· ≡ v [ZMOD r])

Finset.map Nat.castEmbedding (Finset.filter (fun x => x ≡ v [MOD r]) (Finset.Ico a b)) =
  Finset.filter (fun x => x ≡ ↑v [ZMOD ↑r]) (Finset.Ico ↑a ↑b)


/-- If we start with a multiset of primes, take the product and
 then factor it, we get back the original multiset. -/
theorem factorMultiset_prod (v : PrimeMultiset) : v.prod.factorMultiset = v


theorem volume_val (s) : volume s = StieltjesFunction.id.measure s

MeasureTheory.volume s = StieltjesFunction.id.measure s


theorem toENNRealVectorMeasure_apply_measurable {μ : Measure α} {i : Set α} (hi : MeasurableSet i) :
    μ.toENNRealVectorMeasure i = μ i

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{i : Set α}
(hi : MeasurableSet i)


@[ext]
theorem hom_ext {P Q : Karoubi C} (f g : P ⟶ Q) (h : f.f = g.f) : f = g

{P Q : CategoryTheory.Idempotents.Karoubi C}


@[simp]
theorem le_sup_right : b ≤ a ⊔ b

{α : Type u}
[SemilatticeSup α]
{a b : α}


private lemma pairwiseDisjoint_fibers : Set.PairwiseDisjoint ↑t fun a ↦ s.filter (f · = a)

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
{s : Finset α}
{t : Finset β}
{f : α → β}

(↑t).PairwiseDisjoint fun a => Finset.filter (fun x => f x = a) s


private theorem HD_bound_aux1 (f : Cb X Y) (C : ℝ) :
    BddAbove (range fun x : X => ⨅ y, f (inl x, inr y) + C)

{X : Type u}
{Y : Type v}
[MetricSpace X]
[MetricSpace Y]
[Nonempty Y]
(f : GromovHausdorff.Cb X Y)
(C : ℝ)

BddAbove (Set.range fun x => ⨅ y, f (Sum.inl x, Sum.inr y) + C)


/-- We say that a collection of functions form a smooth partition of unity on a set `s` if

* all functions are infinitely smooth and nonnegative;
* the family `fun i ↦ support (f i)` is locally finite;
* for all `x ∈ s` the sum `∑ᶠ i, f i x` equals one;
* for all `x`, the sum `∑ᶠ i, f i x` is less than or equal to one. -/
structure SmoothPartitionOfUnity (s : Set M := univ) where
  /-- The family of functions forming the partition of unity. -/
  toFun : ι → C^∞⟮I, M; 𝓘(ℝ), ℝ⟯
  /-- Around each point, there are only finitely many nonzero functions in the family. -/
  locallyFinite' : LocallyFinite fun i => support (toFun i)
  /-- All the functions in the partition of unity are nonnegative. -/
  nonneg' : ∀ i x, 0 ≤ toFun i x
  /-- The functions in the partition of unity add up to `1` at any point of `s`. -/
  sum_eq_one' : ∀ x ∈ s, ∑ᶠ i, toFun i x = 1
  /-- The functions in the partition of unity add up to at most `1` everywhere. -/
  sum_le_one' : ∀ x, ∑ᶠ i, toFun i x ≤ 1

{ι : Type uι}
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{s : optParam (Set M) Set.univ}
(self : SmoothPartitionOfUnity ι I M s)
(x : M)

x ∈ s → ∑ᶠ (i : ι), (self.toFun i) x = 1


theorem tprod_mul_tprod {na nb} (a : Fin na → M) (b : Fin nb → M) :
    tprod R a ₜ* tprod R b = tprod R (Fin.append a b)

(R : Type u_1)
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{na nb : ℕ}
(a : Fin na → M)
(b : Fin nb → M)

GradedMonoid.GMul.mul ((PiTensorProduct.tprod R) a) ((PiTensorProduct.tprod R) b) =
  (PiTensorProduct.tprod R) (Fin.append a b)


theorem bihimp_right_injective (a : α) : Injective (a ⇔ ·)

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


@[to_additive]
theorem norm_le_norm_add_norm_div' (u v : E) : ‖u‖ ≤ ‖v‖ + ‖u / v‖

{E : Type u_6}
[SeminormedAddGroup E]
(u v : E)

‖u‖ ≤ ‖v‖ + ‖u - v‖


theorem nhds_subtype_eq_comap {x : X} {h : p x} : 𝓝 (⟨x, h⟩ : Subtype p) = comap (↑) (𝓝 x)

{X : Type u}
[TopologicalSpace X]
{p : X → Prop}
{x : X}
{h : p x}

𝓝 ⟨x, h⟩ = Filter.comap Subtype.val (𝓝 x)


theorem CPolynomialOn.congr {s : Set E} (hs : IsOpen s) (hf : CPolynomialOn 𝕜 f s)
    (hg : s.EqOn f g) : CPolynomialOn 𝕜 g s

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : E → F}
{s : Set E}
(hs : IsOpen s)
(hf : CPolynomialOn 𝕜 f s)
(hg : Set.EqOn f g s)


@[to_additive]
theorem le_hasProd' (hf : HasProd f a) (i : ι) : f i ≤ a

{ι : Type u_1}
{α : Type u_3}
[CanonicallyOrderedAddCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{f : ι → α}
{a : α}
(hf : HasSum f a)
(i : ι)


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


/-- **Maximum modulus principle**. Let `f : E → F` be a function between complex normed spaces.
Suppose that the codomain `F` is a strictly convex space, `f` is complex differentiable on a set
`s`, `f` is continuous on the closure of `s`, the norm of `f` takes it maximum on `s` at `z`, and
`w` is a point such that the closed ball with center `z` and radius `dist w z` is included in `s`,
then `f w = f z`. -/
theorem eq_of_isMaxOn_of_ball_subset {f : E → F} {s : Set E} {z w : E} (hd : DiffContOnCl ℂ f s)
    (hz : IsMaxOn (norm ∘ f) s z) (hsub : ball z (dist w z) ⊆ s) : f w = f z

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace ℂ F]
[StrictConvexSpace ℝ F]
{f : E → F}
{s : Set E}
{z w : E}
(hd : DiffContOnCl ℂ f s)
(hz : IsMaxOn (norm ∘ f) s z)
(hsub : Metric.ball z (dist w z) ⊆ s)


@[to_additive]
lemma prod_fiberwise (s : Finset ι) (g : ι → κ) (f : ι → α) :
    ∏ j, ∏ i ∈ s.filter fun i ↦ g i = j, f i = ∏ i ∈ s, f i

{ι : Type u_6}
{κ : Type u_7}
{α : Type u_8}
[CommMonoid α]
[DecidableEq κ]
[Fintype κ]
(s : Finset ι)
(g : ι → κ)
(f : ι → α)

∏ j : κ, ∏ i ∈ Finset.filter (fun i => g i = j) s, f i = ∏ i ∈ s, f i


/-- The map `Nobeling.ι` is a closed embedding. -/
theorem Nobeling.embedding : ClosedEmbedding (Nobeling.ι S)


lemma δ_δ (n₀ n₁ n₂ : ℤ) (z : Cochain F G n₀) : δ n₁ n₂ (δ n₀ n₁ z) = 0

(z : CochainComplex.HomComplex.Cochain F G n₀)

CochainComplex.HomComplex.δ n₁ n₂ (CochainComplex.HomComplex.δ n₀ n₁ z) = 0


@[simp, norm_cast] lemma num_natCast (n : ℕ) : num n = n


@[simp]
lemma preimage_image (e : α ≃ᵐ β) (s : Set α) : e ⁻¹' (e '' s) = s

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


theorem Indep.rkPos_of_nonempty (hI : M.Indep I) (hne : I.Nonempty) : M.RkPos

{α : Type u_1}
{M : Matroid α}
{I : Set α}
(hI : M.Indep I)
(hne : I.Nonempty)


/-- The set of injective continuous linear maps `E → F` is open,
  if `E` is finite-dimensional over a complete field. -/
theorem ContinuousLinearMap.isOpen_injective [FiniteDimensional 𝕜 E] :
    IsOpen { L : E →L[𝕜] F | Injective L }

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type v}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type w}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace 𝕜]
[FiniteDimensional 𝕜 E]


theorem skyscraperPresheaf_eq_pushforward
    [hd : ∀ U : Opens (TopCat.of PUnit.{u + 1}), Decidable (PUnit.unit ∈ U)] :
    skyscraperPresheaf p₀ A =
      ContinuousMap.const (TopCat.of PUnit) p₀ _*
        skyscraperPresheaf (X := TopCat.of PUnit) PUnit.unit A

[(U : TopologicalSpace.Opens ↑X) → Decidable (p₀ ∈ U)]

[hd : (U : TopologicalSpace.Opens ↑(TopCat.of PUnit.{u + 1})) → Decidable (PUnit.unit ∈ U)]

skyscraperPresheaf p₀ A =
  (TopCat.Presheaf.pushforward C (ContinuousMap.const (↑(TopCat.of PUnit.{u + 1})) p₀)).obj
    (skyscraperPresheaf PUnit.unit A)


@[to_additive]
theorem continuousMul_of_comm_of_nhds_one (M : Type u) [CommMonoid M] [TopologicalSpace M]
    (hmul : Tendsto (uncurry ((· * ·) : M → M → M)) (𝓝 1 ×ˢ 𝓝 1) (𝓝 1))
    (hleft : ∀ x₀ : M, 𝓝 x₀ = map (fun x => x₀ * x) (𝓝 1)) : ContinuousMul M

(hmul : Filter.Tendsto (Function.uncurry fun x x_1 => x + x_1) (𝓝 0 ×ˢ 𝓝 0) (𝓝 0))

(hleft : ∀ (x₀ : M), 𝓝 x₀ = Filter.map (fun x => x₀ + x) (𝓝 0))


lemma stalkToFiberRingHom_homogeneousLocalizationToStalk (x z) :
    stalkToFiberRingHom 𝒜 x (homogeneousLocalizationToStalk 𝒜 x z) = z

(z : HomogeneousLocalization.AtPrime 𝒜 x.asHomogeneousIdeal.toIdeal)

(AlgebraicGeometry.stalkToFiberRingHom 𝒜 x) (AlgebraicGeometry.homogeneousLocalizationToStalk 𝒜 x z) = z


@[simp]
theorem Finset.union_symm_inr (h : Disjoint s t) (y : t) :
    Equiv.Finset.union s t h (Sum.inr y) = ⟨y, Finset.mem_union.mpr <| Or.inr y.2⟩

{α : Type u_1}
[DecidableEq α]
{s t : Finset α}
(h : Disjoint s t)
(y : { x // x ∈ t })

(Equiv.Finset.union s t h) (Sum.inr y) = ⟨↑y, ⋯⟩


lemma XYIdeal_eq₁ (x y L : R) : XYIdeal W x (C y) = XYIdeal W x (linePolynomial x y L)

{R : Type u}
[CommRing R]
(W : WeierstrassCurve.Affine R)
(x y L : R)

WeierstrassCurve.Affine.CoordinateRing.XYIdeal W x (Polynomial.C y) =
  WeierstrassCurve.Affine.CoordinateRing.XYIdeal W x (WeierstrassCurve.Affine.linePolynomial x y L)


@[to_additive addIndex_union_le]
theorem index_union_le (K₁ K₂ : Compacts G) {V : Set G} (hV : (interior V).Nonempty) :
    index (K₁.1 ∪ K₂.1) V ≤ index K₁.1 V + index K₂.1 V

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]
[TopologicalAddGroup G]
(K₁ K₂ : TopologicalSpace.Compacts G)
{V : Set G}
(hV : (interior V).Nonempty)

MeasureTheory.Measure.haar.addIndex (K₁.carrier ∪ K₂.carrier) V ≤
  MeasureTheory.Measure.haar.addIndex K₁.carrier V + MeasureTheory.Measure.haar.addIndex K₂.carrier V


/-- If two maps of short complexes are homotopic, their opposites also are. -/
@[simps]
def neg (h : Homotopy φ₁ φ₂) : Homotopy (-φ₁) (-φ₂)

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

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


theorem rank_eq_finrank_range_toLin [Finite m] [DecidableEq n] {M₁ M₂ : Type*} [AddCommGroup M₁]
    [AddCommGroup M₂] [Module R M₁] [Module R M₂] (A : Matrix m n R) (v₁ : Basis m R M₁)
    (v₂ : Basis n R M₂) : A.rank = finrank R (LinearMap.range (toLin v₂ v₁ A))

{m : Type u_2}
{n : Type u_3}
{R : Type u_5}
[Fintype n]
[CommRing R]
[Finite m]
[DecidableEq n]
{M₁ : Type u_6}
{M₂ : Type u_7}
[AddCommGroup M₁]
[AddCommGroup M₂]
[Module R M₁]
[Module R M₂]
(A : Matrix m n R)
(v₁ : Basis m R M₁)
(v₂ : Basis n R M₂)

A.rank = FiniteDimensional.finrank R ↥(LinearMap.range ((Matrix.toLin v₂ v₁) A))


@[to_additive]
theorem mulETransformRight.card :
    (mulETransformLeft e x).2.card + (mulETransformRight e x).2.card = 2 * x.2.card

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

(Finset.addETransformLeft e x).2.card + (Finset.addETransformRight e x).2.card = 2 * x.2.card


theorem isDiag_mk_of_mem_diag {a : α × α} (h : a ∈ s.diag) : (Sym2.mk a).IsDiag

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
{a : α × α}
(h : a ∈ s.diag)


/-- Compatibility of `nullHomotopicMap'` with the precomposition by a morphism
of complexes. -/
theorem comp_nullHomotopicMap' (f : C ⟶ D) (hom : ∀ i j, c.Rel j i → (D.X i ⟶ E.X j)) :
    f ≫ nullHomotopicMap' hom = nullHomotopicMap' fun i j hij => f.f i ≫ hom i j hij

(hom : (i j : ι) → c.Rel j i → (D.X i ⟶ E.X j))

f ≫ Homotopy.nullHomotopicMap' hom = Homotopy.nullHomotopicMap' fun i j hij => f.f i ≫ hom i j hij


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

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

a⁻ᵐ ≤ 1 ↔ a⁻¹ ≤ 1


lemma coe_strictMono : Monotone ((⇑) : (Π₀ i, α i) → ∀ i, α i)

{ι : Type u_1}
{α : ι → Type u_2}
[(i : ι) → Zero (α i)]
[(i : ι) → Preorder (α i)]


protected theorem congr_arg (φ : A →ₐ[R] B) {x y : A} (h : x = y) : φ x = φ y

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(φ : A →ₐ[R] B)
{x y : A}
(h : x = y)


@[simp]
theorem comapDomain'_apply [∀ i, Zero (β i)] (h : κ → ι) {h' : ι → κ}
    (hh' : Function.LeftInverse h' h) (f : Π₀ i, β i) (k : κ) : comapDomain' h hh' f k = f (h k)

{ι : Type u}
{β : ι → Type v}
{κ : Type u_1}
[(i : ι) → Zero (β i)]
(h : κ → ι)
{h' : ι → κ}
(hh' : Function.LeftInverse h' h)
(f : Π₀ (i : ι), β i)
(k : κ)

(DFinsupp.comapDomain' h hh' f) k = f (h k)


lemma growsPolynomially_one_add_smoothingFn : GrowsPolynomially fun x => 1 + ε x

AkraBazziRecurrence.GrowsPolynomially fun x => 1 + AkraBazziRecurrence.smoothingFn x


@[to_additive]
theorem univ_mul_of_one_mem [Fintype α] (ht : (1 : α) ∈ t) : univ * t = univ

{α : Type u_2}
[DecidableEq α]
[Monoid α]
{t : Finset α}
[Fintype α]
(ht : 1 ∈ t)


theorem id_of_comp_left_id (f : X ⟶ X) (w : ∀ {Y : C} (g : X ⟶ Y), f ≫ g = g) : f = 𝟙 X

(w : ∀ {Y : C} (g : X ⟶ Y), CategoryTheory.CategoryStruct.comp f g = g)


@[simp]
theorem add_apply : (f + f') v = f v + f' v

{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}
(f f' : M [⋀^ι]→ₗ[R] N)
(v : ι → M)


/-- A version of `Equiv.mulLeft a b⁻¹` that is defeq to `a / b`. -/
@[to_additive (attr := simps) " A version of `Equiv.addLeft a (-b)` that is defeq to `a - b`. "]
protected def divLeft (a : G) : G ≃ G


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


lemma of_eq {p : ℕ} (h : ringChar R = p) : CharP R p

{R : Type u_1}
[NonAssocSemiring R]
{p : ℕ}
(h : ringChar R = p)


theorem isOpenMap_sigma {f : Sigma σ → X} : IsOpenMap f ↔ ∀ i, IsOpenMap fun a => f ⟨i, a⟩

{X : Type u}
{ι : Type u_5}
{σ : ι → Type u_7}
[(i : ι) → TopologicalSpace (σ i)]
[TopologicalSpace X]
{f : Sigma σ → X}

IsOpenMap f ↔ ∀ (i : ι), IsOpenMap fun a => f ⟨i, a⟩


private irreducible_def zero : RingQuot r

{R : Type u_1}
[Semiring R]
(r : R → R → Prop)

RingQuot.zero r = { toQuot := Quot.mk (RingQuot.Rel r) 0 }


/-- If `f : α ↪ α'` is an embedding and `g : Π a, β α ↪ β' (f α)` is a family
of embeddings, then `Sigma.map f g` is an embedding. -/
@[simps apply]
def sigmaMap (f : α ↪ α') (g : ∀ a, β a ↪ β' (f a)) : (Σa, β a) ↪ Σa', β' a'

{α : Type u_1}
{α' : Type u_2}
{β : α → Type u_3}
{β' : α' → Type u_4}
(f : α ↪ α')
(g : (a : α) → β a ↪ β' (f a))
(x : (a : α) × β a)

(f.sigmaMap g) x = Sigma.map (⇑f) (fun a => ⇑(g a)) x


/-- Write the iterated Fréchet derivative as the composition of a continuous linear equiv and the
iterated derivative. -/
theorem iteratedFDerivWithin_eq_equiv_comp :
    iteratedFDerivWithin 𝕜 n f s =
      ContinuousMultilinearMap.piFieldEquiv 𝕜 (Fin n) F ∘ iteratedDerivWithin n f s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ}
{f : 𝕜 → F}
{s : Set 𝕜}

iteratedFDerivWithin 𝕜 n f s = ⇑(ContinuousMultilinearMap.piFieldEquiv 𝕜 (Fin n) F) ∘ iteratedDerivWithin n f s


protected theorem IsInfix.subset (hl : l₁ <:+: l₂) : l₁ ⊆ l₂

∀ {α : Type u_1} {l₁ l₂ : List α}, l₁ <:+: l₂ → l₁ ⊆ l₂


@[simp]
theorem dualCoannihilator_bot : (⊥ : Submodule R (Module.Dual R M)).dualCoannihilator = ⊤

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]


theorem sign_swap {x y : α} (h : x ≠ y) : sign (swap x y) = -1

{α : Type u}
[DecidableEq α]
[Fintype α]
{x y : α}
(h : x ≠ y)


@[simp]
theorem succ_le_iff_isMax : succ a ≤ a ↔ IsMax a

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


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

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


@[to_additive]
theorem mk_surjective : Function.Surjective <| @mk _ _ s

{α : Type u_1}
[AddGroup α]
{s : AddSubgroup α}


theorem mulLeftMap_apply {M N : Submodule R S} {ι : Type*} (m : ι → M) (n : ι →₀ N) :
    mulLeftMap N m n = Finsupp.sum n fun (i : ι) (n : N) ↦ (m i).1 * n.1

{R : Type u_1}
[Semiring R]
{S : Type u_4}
[Semiring S]
[Module R S]
[SMulCommClass R R S]
[SMulCommClass R S S]
{M N : Submodule R S}
{ι : Type u_5}
(m : ι → ↥M)
(n : ι →₀ ↥N)

(Submodule.mulLeftMap N m) n = n.sum fun i n => ↑(m i) * ↑n


theorem IsBigOWith.sum (h : ∀ i ∈ s, IsBigOWith (C i) l (A i) g) :
    IsBigOWith (∑ i ∈ s, C i) l (fun x => ∑ i ∈ s, A i x) g

(h : ∀ i ∈ s, Asymptotics.IsBigOWith (C i) l (A i) g)

Asymptotics.IsBigOWith (∑ i ∈ s, C i) l (fun x => ∑ i ∈ s, A i x) g


theorem cardinal_lift_le_rank {ι : Type w} {v : ι → M}
    (hv : LinearIndependent R v) :
    Cardinal.lift.{v} #ι ≤ Cardinal.lift.{w} (Module.rank R M)

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
[Nontrivial R]
{ι : Type w}
{v : ι → M}
(hv : LinearIndependent R v)

Cardinal.lift.{v, w} #ι ≤ Cardinal.lift.{w, v} (Module.rank R M)


theorem div_le_div₀ (a b c d : α) (hb : b ≠ 0) (hd : d ≠ 0) :
    a * b⁻¹ ≤ c * d⁻¹ ↔ a * d ≤ c * b

{α : Type u_1}
[LinearOrderedCommGroupWithZero α]
(a b c d : α)
(hb : b ≠ 0)
(hd : d ≠ 0)


/-- For the equality, see `thickening_thickening`. -/
@[simp]
theorem thickening_thickening_subset (ε δ : ℝ) (s : Set α) :
    thickening ε (thickening δ s) ⊆ thickening (ε + δ) s

{α : Type u}
[PseudoEMetricSpace α]
(ε δ : ℝ)
(s : Set α)

Metric.thickening ε (Metric.thickening δ s) ⊆ Metric.thickening (ε + δ) s


theorem filter_union_filter_neg_eq [∀ x, Decidable (¬p x)] (s : Finset α) :
    (s.filter p ∪ s.filter fun a => ¬p a) = s

{α : Type u_1}
(p : α → Prop)
[DecidablePred p]
[DecidableEq α]
[(x : α) → Decidable ¬p x]
(s : Finset α)

Finset.filter p s ∪ Finset.filter (fun a => ¬p a) s = s


/-- An ideal `P` of a ring `R` is prime if `P ≠ R` and `xy ∈ P → x ∈ P ∨ y ∈ P` -/
class IsPrime (I : Ideal α) : Prop where
  /-- The prime ideal is not the entire ring. -/
  ne_top' : I ≠ ⊤
  /-- If a product lies in the prime ideal, then at least one element lies in the prime ideal. -/
  mem_or_mem' : ∀ {x y : α}, x * y ∈ I → x ∈ I ∨ y ∈ I

{α : Type u}
[Semiring α]
{I : Ideal α}
[self : I.IsPrime]
{x y : α}


@[simp]
lemma mem_initSeg : t ∈ initSeg s ↔ s.card = t.card ∧ toColex t ≤ toColex s

{α : Type u_1}
[LinearOrder α]
{s t : Finset α}
[Fintype α]

t ∈ Finset.Colex.initSeg s ↔ s.card = t.card ∧ { ofColex := t } ≤ { ofColex := s }


@[simp]
lemma leftShift_smul (a n' : ℤ) (hn' : n + a = n') (x : R) :
    (x • γ).leftShift a n' hn' = x • γ.leftShift a n' hn'

(γ : CochainComplex.HomComplex.Cochain K L n)


/-- Let `f : β → α` be a multipliable function and let `b ∈ β` be an index.
Lemma `tprod_eq_mul_tprod_ite` writes `∏ n, f n` as `f b` times the product of the
remaining terms. -/
@[to_additive "Let `f : β → α` be a summable function and let `b ∈ β` be an index.
Lemma `tsum_eq_add_tsum_ite` writes `Σ' n, f n` as `f b` plus the sum of the
remaining terms."]
theorem tprod_eq_mul_tprod_ite [DecidableEq β] (hf : Multipliable f) (b : β) :
    ∏' n, f n = f b * ∏' n, ite (n = b) 1 (f n)

{α : Type u_1}
{β : Type u_2}
[CommGroup α]
[TopologicalSpace α]
[TopologicalGroup α]
{f : β → α}
[T2Space α]
[DecidableEq β]
(hf : Multipliable f)
(b : β)

∏' (n : β), f n = f b * ∏' (n : β), if n = b then 1 else f n


theorem integral_condexp (hm : m ≤ m0) [hμm : SigmaFinite (μ.trim hm)] :
    ∫ x, (μ[f|m]) x ∂μ = ∫ x, f x ∂μ

[hμm : MeasureTheory.SigmaFinite (μ.trim hm)]

∫ (x : α), (μ[f|m]) x ∂μ = ∫ (x : α), f x ∂μ


lemma div_eq_one_iff_eq (hb : b ≠ 0) : a / b = 1 ↔ a = b

{G₀ : Type u_3}
[GroupWithZero G₀]
{a b : G₀}
(hb : b ≠ 0)


/-- Taking the opposite of a functor is functorial.
-/
@[simps]
def opHom : (C ⥤ D)ᵒᵖ ⥤ Cᵒᵖ ⥤ Dᵒᵖ

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

(CategoryTheory.Functor.opHom C D).obj F = (Opposite.unop F).op


theorem hasSum_inl [AddCommMonoid R] [AddCommMonoid M] {f : α → R} {a : R} (h : HasSum f a) :
    HasSum (fun x ↦ inl (f x)) (inl a : tsze R M)

{α : Type u_1}
{R : Type u_3}
(M : Type u_4)
[TopologicalSpace R]
[TopologicalSpace M]
[AddCommMonoid R]
[AddCommMonoid M]
{f : α → R}
{a : R}
(h : HasSum f a)

HasSum (fun x => TrivSqZeroExt.inl (f x)) (TrivSqZeroExt.inl a)


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

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


theorem kronecker_natCast [NonAssocSemiring α] [DecidableEq n] (A : Matrix l m α) (b : ℕ) :
    A ⊗ₖ (b : Matrix n n α) = blockDiagonal fun _ => b • A

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

Matrix.kroneckerMap (fun x x_1 => x * x_1) A ↑b = Matrix.blockDiagonal fun x => b • A


theorem mem_submonoid_of_factors_subset_of_units_subset (s : Submonoid R) {a : R} (ha : a ≠ 0)
    (hfac : ∀ b ∈ factors a, b ∈ s) (hunit : ∀ c : Rˣ, (c : R) ∈ s) : a ∈ s

(hfac : ∀ b ∈ PrincipalIdealRing.factors a, b ∈ s)


lemma InjOn.image_ssubset_image_iff (h : s.InjOn f) (h₁ : s₁ ⊆ s) (h₂ : s₂ ⊆ s) :
    f '' s₁ ⊂ f '' s₂ ↔ s₁ ⊂ s₂

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


theorem Icc_subset_Ico_right (h₁ : b₁ < b₂) : Icc a b₁ ⊆ Ico a b₂

{α : Type u_1}
[Preorder α]
{a b₁ b₂ : α}
(h₁ : b₁ < b₂)


lemma trans_dualMap_symm_flip : e.trans e.flip.symm.dualMap = Dual.eval R N

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
[Module.IsReflexive R M]
(e : N ≃ₗ[R] Module.Dual R M)

↑(e ≪≫ₗ e.flip.symm.dualMap) = Module.Dual.eval R N


@[simp] lemma antivary_inv_right₀ (hg : StrongLT 0 g) : Antivary f g⁻¹ ↔ Monovary f g

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedSemifield α]
[LinearOrderedSemifield β]
{f : ι → α}
{g : ι → β}
(hg : StrongLT 0 g)


theorem iUnion_Iic_rat : ⋃ r : ℚ, Iic (r : ℝ) = univ


lemma invRotate_distinguished_triangle' (T : Triangle (HomotopyCategory C (ComplexShape.up ℤ)))
    (hT : T ∈ distinguishedTriangles C) : T.invRotate ∈ distinguishedTriangles C

(T : CategoryTheory.Pretriangulated.Triangle (HomotopyCategory C (ComplexShape.up ℤ)))

(hT : T ∈ HomotopyCategory.Pretriangulated.distinguishedTriangles C)

T.invRotate ∈ HomotopyCategory.Pretriangulated.distinguishedTriangles C


theorem forall_cond_comm {α} {s : α → Prop} {p : α → α → Prop} :
    (∀ a, s a → ∀ b, s b → p a b) ↔ ∀ a b, s a → s b → p a b

{α : Sort u_1}
{s : α → Prop}
{p : α → α → Prop}

(∀ (a : α), s a → ∀ (b : α), s b → p a b) ↔ ∀ (a b : α), s a → s b → p a b


theorem stoppedValue_eq {N : ℕ} (hbdd : ∀ ω, τ ω ≤ N) : stoppedValue u τ = fun x =>
    (∑ i ∈ Finset.range (N + 1), Set.indicator {ω | τ ω = i} (u i)) x

{Ω : Type u_1}
{β : Type u_2}
{u : ℕ → Ω → β}
{τ : Ω → ℕ}
[AddCommMonoid β]
{N : ℕ}
(hbdd : ∀ (ω : Ω), τ ω ≤ N)

MeasureTheory.stoppedValue u τ = fun x => (∑ i ∈ Finset.range (N + 1), {ω | τ ω = i}.indicator (u i)) x


theorem sdiff_eq_self_iff_disjoint : x \ y = x ↔ Disjoint y x

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


theorem mul_mem_sup {S T : NonUnitalStarSubalgebra R A} {x y : A} (hx : x ∈ S) (hy : y ∈ T) :
    x * y ∈ S ⊔ T

{R : Type u}
{A : Type v}
[CommSemiring R]
[StarRing R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[StarModule R A]
{S T : NonUnitalStarSubalgebra R A}
{x y : A}
(hx : x ∈ S)
(hy : y ∈ T)


@[to_additive]
theorem comp_mulIndicator (h : M → β) (f : α → M) {s : Set α} {x : α} [DecidablePred (· ∈ s)] :
    h (s.mulIndicator f x) = s.piecewise (h ∘ f) (const α (h 1)) x

{α : Type u_1}
{β : Type u_2}
{M : Type u_4}
[Zero M]
(h : M → β)
(f : α → M)
{s : Set α}
{x : α}
[DecidablePred fun x => x ∈ s]

h (s.indicator f x) = s.piecewise (h ∘ f) (Function.const α (h 0)) x


theorem eq_div_iff (ha : a ≠ 0) (ha' : a ≠ ∞) : b = c / a ↔ a * b = c

{a b c : ENNReal}
(ha : a ≠ 0)
(ha' : a ≠ ⊤)


@[simp]
theorem cos_sub_two_pi (x : ℝ) : cos (x - 2 * π) = cos x


theorem self_le_basicOpen_union_iff (s : Set Γ(X, U)) :
    (U ≤ ⨆ f : s, X.basicOpen f.1) ↔ Ideal.span s = ⊤

(s : Set ↑(X.presheaf.obj (Opposite.op U)))

U ≤ ⨆ f, X.basicOpen ↑f ↔ Ideal.span s = ⊤


/-- A measure `μ` is finite on compacts if any compact set `K` satisfies `μ K < ∞`. -/
class IsFiniteMeasureOnCompacts [TopologicalSpace α] (μ : Measure α) : Prop where
  protected lt_top_of_isCompact : ∀ ⦃K : Set α⦄, IsCompact K → μ K < ∞

[self : MeasureTheory.IsFiniteMeasureOnCompacts μ]


/-- Composing two partial equivs if the target of the first coincides with the source of the
second. -/
@[simps]
protected def trans' (e' : PartialEquiv β γ) (h : e.target = e'.source) : PartialEquiv α γ

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(e : PartialEquiv α β)
(e' : PartialEquiv β γ)
(h : e.target = e'.source)

∀ (a : γ), ↑(e.trans' e' h).symm a = (↑e.symm ∘ ↑e'.symm) a


theorem limsInf_le_limsInf_of_le {f g : Filter α} (h : g ≤ f)
    (hf : f.IsBounded (· ≥ ·) := by isBoundedDefault)
    (hg : g.IsCobounded (· ≥ ·) := by isBoundedDefault) :
    limsInf f ≤ limsInf g

(hf : Filter.IsBounded (fun x x_1 => x ≥ x_1) f := by isBoundedDefault)

(hg : Filter.IsCobounded (fun x x_1 => x ≥ x_1) g := by isBoundedDefault)


@[simp] lemma isNilpotent_of_subsingleton [Zero R] [Pow R ℕ] [Subsingleton R] : IsNilpotent x

{R : Type u_1}
{x : R}
[Zero R]
[Pow R ℕ]
[Subsingleton R]


theorem equalizerSubobject_factors {W : C} (h : W ⟶ X) (w : h ≫ f = h ≫ g) :
    (equalizerSubobject f g).Factors h

(CategoryTheory.Limits.equalizerSubobject f g).Factors h


lemma uzpow_mul (s : ℤˣ) (x y : R) : s ^ (x * y) = (s ^ x) ^ y

{R : Type u_1}
[CommSemiring R]
[Module R (Additive ℤˣ)]
(s : ℤˣ)
(x y : R)


theorem Ico_cons_right (h : a ≤ b) : b ::ₘ Ico a b = Icc a b

{α : Type u_1}
[PartialOrder α]
[LocallyFiniteOrder α]
{a b : α}
(h : a ≤ b)

b ::ₘ Multiset.Ico a b = Multiset.Icc a b


/-- The composition of morphisms of squares. -/
@[simps]
def comp {sq₁ sq₂ sq₃ : Square C} (f : Hom sq₁ sq₂) (g : Hom sq₂ sq₃) : Hom sq₁ sq₃

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{sq₁ sq₂ sq₃ : CategoryTheory.Square C}
(f : sq₁.Hom sq₂)
(g : sq₂.Hom sq₃)

(f.comp g).τ₁ = CategoryTheory.CategoryStruct.comp f.τ₁ g.τ₁


lemma Y_eq_of_Y_ne {x₁ x₂ y₁ y₂ : F} (h₁ : W.Equation x₁ y₁) (h₂ : W.Equation x₂ y₂) (hx : x₁ = x₂)
    (hy : y₁ ≠ W.negY x₂ y₂) : y₁ = y₂

{F : Type u}
[Field F]
{W : WeierstrassCurve.Affine F}
{x₁ x₂ y₁ y₂ : F}
(h₁ : W.Equation x₁ y₁)
(h₂ : W.Equation x₂ y₂)
(hx : x₁ = x₂)
(hy : y₁ ≠ W.negY x₂ y₂)


@[simp] lemma ceilRoot_one_left (a : ℕ) : ceilRoot 1 a = a


theorem inv_def (f : Perm α) : f⁻¹ = f.symm


theorem map_eq_traverse_id : map (f := t) f = traverse (m := Id) (pure ∘ f)

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


/-- If E/L/K is a tower of field extensions with E/L algebraic, and if M is an algebraically
  closed extension of K, then any embedding of L/K into M/K extends to an embedding of E/K.
  Known as the extension lemma in https://math.stackexchange.com/a/687914. -/
theorem surjective_comp_algebraMap_of_isAlgebraic {E : Type*}
    [Field E] [Algebra K E] [Algebra L E] [IsScalarTower K L E] [Algebra.IsAlgebraic L E] :
    Function.Surjective fun φ : E →ₐ[K] M ↦ φ.comp (IsScalarTower.toAlgHom K L E)

{K : Type u}
[Field K]
{L : Type v}
{M : Type w}
[Field L]
[Algebra K L]
[Field M]
[Algebra K M]
[IsAlgClosed M]
{E : Type u_1}
[Field E]
[Algebra K E]
[Algebra L E]
[IsScalarTower K L E]
[Algebra.IsAlgebraic L E]

Function.Surjective fun φ => φ.comp (IsScalarTower.toAlgHom K L E)


@[to_additive sub_sub_self]
theorem div_div_self' (a b : G) : a / (a / b) = b


theorem prod_antidiagonal_succ {n : ℕ} {f : ℕ × ℕ → M} :
    (∏ p ∈ antidiagonal (n + 1), f p)
      = f (0, n + 1) * ∏ p ∈ antidiagonal n, f (p.1 + 1, p.2)

{M : Type u_1}
[CommMonoid M]
{n : ℕ}
{f : ℕ × ℕ → M}

∏ p ∈ Finset.antidiagonal (n + 1), f p = f (0, n + 1) * ∏ p ∈ Finset.antidiagonal n, f (p.1 + 1, p.2)


@[simp 1100] theorem tailD_nil : @tailD α [] l' = l'


/-- Over a Dedekind domain, an `I`-torsion module is the internal direct sum of its `p i ^ e i`-
torsion submodules, where `I = ∏ i, p i ^ e i` is its unique decomposition in prime ideals. -/
theorem isInternal_prime_power_torsion_of_is_torsion_by_ideal {I : Ideal R} (hI : I ≠ ⊥)
    (hM : Module.IsTorsionBySet R M I) :
    DirectSum.IsInternal fun p : (factors I).toFinset =>
      torsionBySet R M (p ^ (factors I).count ↑p : Ideal R)

{R : Type u}
[CommRing R]
[IsDomain R]
{M : Type v}
[AddCommGroup M]
[Module R M]
[IsDedekindDomain R]
{I : Ideal R}
(hI : I ≠ ⊥)
(hM : Module.IsTorsionBySet R M ↑I)

DirectSum.IsInternal fun p =>
  Submodule.torsionBySet R M ↑(↑p ^ Multiset.count (↑p) (UniqueFactorizationMonoid.factors I))


@[simp]
theorem inl_mem_disjSum : inl a ∈ s.disjSum t ↔ a ∈ s

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{t : Finset β}
{a : α}


/-- A subgroup is either the trivial subgroup or contains a non-identity element. -/
@[to_additive "A subgroup is either the trivial subgroup or contains a nonzero element."]
theorem bot_or_exists_ne_one (H : Subgroup G) : H = ⊥ ∨ ∃ x ∈ H, x ≠ (1 : G)

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


theorem gauge_neg_set_eq_gauge_neg (x : E) : gauge (-s) x = gauge s (-x)

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


/-- `m` is `n`-smooth if and only if all prime divisors of `m` are less than `n`. -/
lemma mem_smoothNumbers' {n m : ℕ} : m ∈ smoothNumbers n ↔ ∀ p, p.Prime → p ∣ m → p < n

m ∈ n.smoothNumbers ↔ ∀ (p : ℕ), Nat.Prime p → p ∣ m → p < n


@[to_additive] lemma mulEnergy_eq_sum_sq' (s t : Finset α) :
    Eₘ[s, t] = ∑ a ∈ s * t, ((s ×ˢ t).filter fun (x, y) ↦ x * y = a).card ^ 2

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

s.mulEnergy t =
  ∑ a ∈ s * t,
    (Finset.filter
          (fun x =>
            match x with
            | (x, y) => x * y = a)
          (s ×ˢ t)).card ^
      2


theorem isEulerian_iff {u v : V} (p : G.Walk u v) :
    p.IsEulerian ↔ p.IsTrail ∧ ∀ e, e ∈ G.edgeSet → e ∈ p.edges

{V : Type u_1}
{G : SimpleGraph V}
[DecidableEq V]
{u v : V}
(p : G.Walk u v)

p.IsEulerian ↔ p.IsTrail ∧ ∀ e ∈ G.edgeSet, e ∈ p.edges


/-- The sine of an angle in a right-angled triangle as a ratio of sides, version subtracting
vectors. -/
theorem sin_angle_sub_of_inner_eq_zero {x y : V} (h : ⟪x, y⟫ = 0) (h0 : x ≠ 0 ∨ y ≠ 0) :
    Real.sin (angle x (x - y)) = ‖y‖ / ‖x - y‖

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

Real.sin (InnerProductGeometry.angle x (x - y)) = ‖y‖ / ‖x - y‖


lemma hasFiniteProducts : HasFiniteProducts D


lemma absolutelyContinuous_withDensity_rnDeriv [HaveLebesgueDecomposition ν μ] (hμν : μ ≪ ν) :
    μ ≪ μ.withDensity (ν.rnDeriv μ)

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
[ν.HaveLebesgueDecomposition μ]
(hμν : μ ≪ ν)


theorem exists_eventuallyEq_const_of_eventually_mem_of_forall_separating [Nonempty β]
    (p : Set β → Prop) {s : Set β} [HasCountableSeparatingOn β p s] (hs : ∀ᶠ x in l, f x ∈ s)
    (h : ∀ U, p U → (∀ᶠ x in l, f x ∈ U) ∨ (∀ᶠ x in l, f x ∉ U)) :
    ∃ a, f =ᶠ[l] const α a

(h : ∀ (U : Set β), p U → (∀ᶠ (x : α) in l, f x ∈ U) ∨ ∀ᶠ (x : α) in l, f x ∉ U)


theorem isLocalRingHom_of_le_jacobson_bot {R : Type*} [CommRing R] (I : Ideal R)
    (h : I ≤ Ideal.jacobson ⊥) : IsLocalRingHom (Ideal.Quotient.mk I)

{R : Type u_1}
[CommRing R]
(I : Ideal R)
(h : I ≤ ⊥.jacobson)


/-- If `α` has no zero divisors, then for elements `a, b : α`, `a * b` is nonzero iff so is
`b * a`. -/
theorem mul_ne_zero_comm : a * b ≠ 0 ↔ b * a ≠ 0

{M₀ : Type u_1}
[MulZeroClass M₀]
[NoZeroDivisors M₀]
{a b : M₀}


/-- `QuadraticForm.dualProd` commutes (isometrically) with `QuadraticForm.prod`. -/
@[simps!]
def dualProdProdIsometry :
    (dualProd R (M × N)).IsometryEquiv ((dualProd R M).prod (dualProd R N))

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[CommSemiring R]
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]

∀ (a : (Module.Dual R M × M) × Module.Dual R N × N),
  QuadraticForm.dualProdProdIsometry.invFun a =
    ((Module.dualProdDualEquivDual R M N).symm.prod (LinearEquiv.refl R (M × N))).symm ((a.1.1, a.2.1), a.1.2, a.2.2)


/-- The `balRight` function preserves the ordering invariants. -/
protected theorem Ordered.balRight {l : RBNode α} {v : α} {r : RBNode α}
    (lv : l.All (cmpLT cmp · v)) (vr : r.All (cmpLT cmp v ·))
    (hl : l.Ordered cmp) (hr : r.Ordered cmp) : (balRight l v r).Ordered cmp

(lv : Batteries.RBNode.All (fun x => Batteries.RBNode.cmpLT cmp x v) l)

(vr : Batteries.RBNode.All (fun x => Batteries.RBNode.cmpLT cmp v x) r)

Batteries.RBNode.Ordered cmp (l.balRight v r)


theorem isTheta_comm : f =Θ[l] g ↔ g =Θ[l] f

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{f : α → E}
{g : α → F}
{l : Filter α}


theorem list_findIdx₁ {p : α → β → Bool} (hp : Primrec₂ p) :
    ∀ l : List β, Primrec fun a => l.findIdx (p a)

{α : Type u_1}
{β : Type u_2}
[Primcodable α]
[Primcodable β]
{p : α → β → Bool}
(hp : Primrec₂ p)
(l : List β)


@[simp]
theorem rtake_nil : rtake ([] : List α) n = []


private theorem gauge_set_bddBelow : BddBelow { r : ℝ | 0 < r ∧ x ∈ r • s }

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


theorem continuousAt_add_top_top : ContinuousAt (fun p : EReal × EReal => p.1 + p.2) (⊤, ⊤)

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


@[to_additive]
theorem mk''_toEquiv (hS : S ∈ Subgroup.rightTransversals (H : Set G))
    (q : Quotient (QuotientGroup.rightRel H)) : Quotient.mk'' (toEquiv hS q : G) = q

(hS : S ∈ AddSubgroup.rightTransversals ↑H)

(q : Quotient (QuotientAddGroup.rightRel H))

Quotient.mk'' ↑((AddSubgroup.MemRightTransversals.toEquiv hS) q) = q


theorem union_assoc (a b c : Set α) : a ∪ b ∪ c = a ∪ (b ∪ c)


@[to_additive]
theorem antisymm (h₁₂ : Red L₁ L₂) (h₂₁ : Red L₂ L₁) : L₁ = L₂

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


theorem inf'_eq_csInf_image (s : Finset ι) (H : s.Nonempty) (f : ι → α) :
    s.inf' H f = sInf (f '' s)

{ι : Type u_1}
{α : Type u_2}
[ConditionallyCompleteLattice α]
(s : Finset ι)
(H : s.Nonempty)
(f : ι → α)


theorem mul_sub_right_distrib (a b c : α) : (a - b) * c = a * c - b * c

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


/-- The glue data associated with an open cover.
The canonical isomorphism `𝒰.gluedCover.glued ⟶ X` is provided by `𝒰.fromGlued`. -/
@[simps]
def gluedCover : Scheme.GlueData.{u}

{X : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)

∀ (x : 𝒰.J × 𝒰.J),
  𝒰.gluedCover.V x =
    match x with
    | (x, y) => CategoryTheory.Limits.pullback (𝒰.map x) (𝒰.map y)


@[simp]
theorem liftRel_pure_left (R : α → β → Prop) (a : α) (cb : Computation β) :
    LiftRel R (pure a) cb ↔ ∃ b, b ∈ cb ∧ R a b

{α : Type u}
{β : Type v}
(R : α → β → Prop)
(a : α)
(cb : Computation β)

Computation.LiftRel R (Computation.pure a) cb ↔ ∃ b, b ∈ cb ∧ R a b


@[simp]
theorem ofRat_intCast (z : ℤ) : (ofRat z : Cauchy abv) = z

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


@[to_additive]
theorem relindex_inf_le : (H ⊓ K).relindex L ≤ H.relindex L * K.relindex L

{G : Type u_1}
[Group G]
{H K L : Subgroup G}


@[simp] lemma bddBelow_closure : BddBelow (closure s) ↔ BddBelow s

{α : Type u}
[TopologicalSpace α]
[Preorder α]
[ClosedIciTopology α]
{s : Set α}


theorem hammingNorm_le_card_fintype {x : ∀ i, β i} : hammingNorm x ≤ Fintype.card ι

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


theorem ConvexOn.smul {c : 𝕜} (hc : 0 ≤ c) (hf : ConvexOn 𝕜 s f) : ConvexOn 𝕜 s fun x => c • f x

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedCommSemiring 𝕜]
[AddCommMonoid E]
[OrderedAddCommMonoid β]
[SMul 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
{c : 𝕜}
(hc : 0 ≤ c)
(hf : ConvexOn 𝕜 s f)


theorem projRestricts_eq_comp (hJK : ∀ i, J i → K i) (hKL : ∀ i, K i → L i) :
    ProjRestricts C hJK ∘ ProjRestricts C hKL = ProjRestricts C (fun i ↦ hKL i ∘ hJK i)

{I : Type u}
(C : Set (I → Bool))
{J K L : I → Prop}
[(i : I) → Decidable (J i)]
[(i : I) → Decidable (K i)]
[(i : I) → Decidable (L i)]
(hJK : ∀ (i : I), J i → K i)
(hKL : ∀ (i : I), K i → L i)

Profinite.NobelingProof.ProjRestricts C hJK ∘ Profinite.NobelingProof.ProjRestricts C hKL =
  Profinite.NobelingProof.ProjRestricts C ⋯


/-- A group `G` acts properly on a topological space `X` if and only if for all ultrafilters
`𝒰` on `X × G`, if `𝒰` converges to `(x₁, x₂)` along the map `(g, x) ↦ (g • x, x)`,
then there exists `g : G` such that `g • x₂ = x₁` and `𝒰.fst` converges to `g`. -/
@[to_additive "A group acts `G` properly on a topological space `X` if and only if
for all ultrafilters `𝒰` on `X`, if `𝒰` converges to `(x₁, x₂)`
along the map `(g, x) ↦ (g • x, x)`, then there exists `g : G` such that `g • x₂ = x₁`
and `𝒰.fst` converges to `g`."]
theorem properSMul_iff_continuousSMul_ultrafilter_tendsto :
    ProperSMul G X ↔ ContinuousSMul G X ∧
      (∀ 𝒰 : Ultrafilter (G × X), ∀ x₁ x₂ : X,
        Tendsto (fun gx : G × X ↦ (gx.1 • gx.2, gx.2)) 𝒰 (𝓝 (x₁, x₂)) →
      ∃ g : G, g • x₂ = x₁ ∧ Tendsto (Prod.fst : G × X → G) 𝒰 (𝓝 g))

{G : Type u_1}
{X : Type u_2}
[Group G]
[MulAction G X]
[TopologicalSpace G]
[TopologicalSpace X]

ProperSMul G X ↔
  ContinuousSMul G X ∧
    ∀ (𝒰 : Ultrafilter (G × X)) (x₁ x₂ : X),
      Filter.Tendsto (fun gx => (gx.1 • gx.2, gx.2)) (↑𝒰) (𝓝 (x₁, x₂)) →
        ∃ g, g • x₂ = x₁ ∧ Filter.Tendsto Prod.fst (↑𝒰) (𝓝 g)


theorem eqOnSource_iff (e e' : PartialHomeomorph X Y) :
    EqOnSource e e' ↔ PartialEquiv.EqOnSource e.toPartialEquiv e'.toPartialEquiv

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

e.EqOnSource e' ↔ e.EqOnSource e'.toPartialEquiv


/-- `H` and `h` are kept as separate hypothesis since H is used in constructing the quotient map. -/
theorem quotientMap_injective' {J : Ideal R} {I : Ideal S} {f : R →+* S} {H : J ≤ I.comap f}
    (h : I.comap f ≤ J) : Function.Injective (quotientMap I f H)

{R : Type u}
[CommRing R]
{S : Type v}
[CommRing S]
{J : Ideal R}
{I : Ideal S}
{f : R →+* S}
{H : J ≤ Ideal.comap f I}
(h : Ideal.comap f I ≤ J)

Function.Injective ⇑(Ideal.quotientMap I f H)


/-- The embedding of a magma into its magma algebra. -/
@[simps]
def ofMagma [Mul G] : G →ₙ* MonoidAlgebra k G

(k : Type u₁)
(G : Type u₂)
[Semiring k]
[Mul G]
(a : G)

(MonoidAlgebra.ofMagma k G) a = MonoidAlgebra.single a 1


theorem IsLocalization.AtPrime.not_isField {P : Ideal A} (hP : P ≠ ⊥) [pP : P.IsPrime] (Aₘ : Type*)
    [CommRing Aₘ] [Algebra A Aₘ] [IsLocalization.AtPrime Aₘ P] : ¬IsField Aₘ

(A : Type u_2)
[CommRing A]
[IsDomain A]
{P : Ideal A}
(hP : P ≠ ⊥)
[pP : P.IsPrime]
(Aₘ : Type u_4)
[CommRing Aₘ]
[Algebra A Aₘ]
[IsLocalization.AtPrime Aₘ P]


theorem jacobson_bot_polynomial_of_jacobson_bot (h : jacobson (⊥ : Ideal R) = ⊥) :
    jacobson (⊥ : Ideal R[X]) = ⊥

{R : Type u}
[CommRing R]
(h : ⊥.jacobson = ⊥)


@[simp]
theorem unitCompPartialBijective_symm_apply [Reflective i] (A : C) {B : C} (hB : B ∈ i.essImage)
    (f) : (unitCompPartialBijective A hB).symm f = (reflectorAdjunction i).unit.app A ≫ f

(f : i.obj ((CategoryTheory.reflector i).obj A) ⟶ B)

(CategoryTheory.unitCompPartialBijective A hB).symm f =
  CategoryTheory.CategoryStruct.comp ((CategoryTheory.reflectorAdjunction i).unit.app A) f


theorem cast_two [AddMonoidWithOne R] : ((2 : ℕ) : R) = (2 : R)


@[simp]
theorem eqRec_heq_iff_heq {α : Sort _} {a : α} {motive : (a' : α) → a = a' → Sort _}
    (x : motive a (rfl : a = a)) {a' : α} (e : a = a') {β : Sort _} (y : β) :
    HEq (@Eq.rec α a motive x a' e) y ↔ HEq x y

{α : Sort u_1}
{a : α}
{motive : (a' : α) → a = a' → Sort u_2}
(x : motive a ⋯)
{a' : α}
(e : a = a')
{β : Sort u_2}
(y : β)


/-- A (possibly nonlinear) right inverse to a continuous linear map, which doesn't have to be
linear itself but which satisfies a bound `‖inverse x‖ ≤ C * ‖x‖`. A surjective continuous linear
map doesn't always have a continuous linear right inverse, but it always has a nonlinear inverse
in this sense, by Banach's open mapping theorem. -/
structure NonlinearRightInverse where
  toFun : F → E
  nnnorm : ℝ≥0
  bound' : ∀ y, ‖toFun y‖ ≤ nnnorm * ‖y‖
  right_inv' : ∀ y, f (toFun y) = y

{𝕜 : Type u_1}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜']
{σ : 𝕜 →+* 𝕜'}
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜' F]
{f : E →SL[σ] F}
(self : f.NonlinearRightInverse)
(y : F)


theorem commonNeighbors_top_eq {v w : V} :
    (⊤ : SimpleGraph V).commonNeighbors v w = Set.univ \ {v, w}

⊤.commonNeighbors v w = Set.univ \ {v, w}


/-- When the first map `S.f` is zero, this is the right homology data on `S` given by
the chosen `kernel S.g` -/
@[simps!]
noncomputable def ofHasKernel [HasKernel S.g] (hf : S.f = 0) : S.RightHomologyData

(CategoryTheory.ShortComplex.RightHomologyData.ofHasKernel S hf).Q = S.X₂


@[elab_as_elim]
theorem closure_induction' {s : Set R} {p : ∀ x, x ∈ closure s → Prop}
    (mem : ∀ (x) (h : x ∈ s), p x (subset_closure h))
    (zero : p 0 (zero_mem _)) (one : p 1 (one_mem _))
    (add : ∀ x hx y hy, p x hx → p y hy → p (x + y) (add_mem hx hy))
    (neg : ∀ x hx, p x hx → p (-x) (neg_mem hx))
    (mul : ∀ x hx y hy, p x hx → p y hy → p (x * y) (mul_mem hx hy))
    {a : R} (ha : a ∈ closure s) : p a ha

{p : (x : R) → x ∈ Subring.closure s → Prop}

(add : ∀ (x : R) (hx : x ∈ Subring.closure s) (y : R) (hy : y ∈ Subring.closure s), p x hx → p y hy → p (x + y) ⋯)

(neg : ∀ (x : R) (hx : x ∈ Subring.closure s), p x hx → p (-x) ⋯)

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


/-- A point in a projective space is contained in the span of a set of points if and only if the
point is contained in all subspaces of the projective space which contain the set of points. -/
theorem mem_span {S : Set (ℙ K V)} (u : ℙ K V) :
    u ∈ span S ↔ ∀ W : Subspace K V, S ⊆ W → u ∈ W

{K : Type u_1}
{V : Type u_2}
[Field K]
[AddCommGroup V]
[Module K V]
{S : Set (Projectivization K V)}
(u : Projectivization K V)

u ∈ Projectivization.Subspace.span S ↔ ∀ (W : Projectivization.Subspace K V), S ⊆ ↑W → u ∈ W


@[simp, mfld_simps]
theorem restr_target (s : Set α) : (e.restr s).target = e.target ∩ e.symm ⁻¹' s

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

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


@[simp]
theorem mul_apply (φ ψ : A →ₗc[R] A) (x : A) : (φ * ψ) x = φ (ψ x)

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[CoalgebraStruct R A]
(φ ψ : A →ₗc[R] A)
(x : A)


@[measurability]
theorem measurable_unit [MeasurableSpace α] (f : Unit → α) : Measurable f

{α : Type u_1}
[MeasurableSpace α]
(f : Unit → α)


/-- If a real differentiable map `f` is conformal at a point `x`,
    then it preserves the angles at that point. -/
theorem ConformalAt.preserves_angle {f : E → F} {x : E} {f' : E →L[ℝ] F} (h : HasFDerivAt f f' x)
    (H : ConformalAt f x) (u v : E) : angle (f' u) (f' v) = angle u v

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

InnerProductGeometry.angle (f' u) (f' v) = InnerProductGeometry.angle u v


/-- When the first map `S.f` is zero, this is the homology data on `S` given
by the chosen `kernel S.g` -/
@[simps]
noncomputable def ofHasKernel (hf : S.f = 0) [HasKernel S.g] :
    S.HomologyData

(CategoryTheory.ShortComplex.HomologyData.ofHasKernel S hf).left =
  CategoryTheory.ShortComplex.LeftHomologyData.ofHasKernel S hf


/-- Associate a `PartialEquiv` to an `Equiv`. -/
@[simps! (config := mfld_cfg)]
def _root_.Equiv.toPartialEquiv (e : α ≃ β) : PartialEquiv α β

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


@[to_additive (attr := simp)]
lemma minOrder_eq_top : minOrder α = ⊤ ↔ IsTorsionFree α

AddMonoid.minOrder α = ⊤ ↔ AddMonoid.IsTorsionFree α


@[ext]
lemma ext' (e e' : Pretrivialization F proj) (h₁ : e.toPartialEquiv = e'.toPartialEquiv)
    (h₂ : e.baseSet = e'.baseSet) : e = e'


@[to_additive (attr := simp)]
theorem csSup_one : sSup (1 : Set α) = 1

{α : Type u_1}
[ConditionallyCompleteLattice α]
[Zero α]


@[continuity, fun_prop]
theorem continuous_re : Continuous re


theorem ContMDiff.contMDiffOn (hf : ContMDiff I I' n f) : ContMDiffOn I I' n f s

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


theorem Filter.HasBasis.uniformEquicontinuous_iff_right {p : κ → Prop}
    {s : κ → Set (α × α)} {F : ι → β → α} (hα : (𝓤 α).HasBasis p s) :
    UniformEquicontinuous F ↔ ∀ k, p k → ∀ᶠ xy : β × β in 𝓤 β, ∀ i, (F i xy.1, F i xy.2) ∈ s k

{ι : Type u_1}
{κ : Type u_2}
{α : Type u_7}
{β : Type u_9}
[uα : UniformSpace α]
[uβ : UniformSpace β]
{p : κ → Prop}
{s : κ → Set (α × α)}
{F : ι → β → α}
(hα : (uniformity α).HasBasis p s)

UniformEquicontinuous F ↔ ∀ (k : κ), p k → ∀ᶠ (xy : β × β) in uniformity β, ∀ (i : ι), (F i xy.1, F i xy.2) ∈ s k


/-- Equality behind `Commute a b`; useful for rewriting. -/
@[to_additive "Equality behind `AddCommute a b`; useful for rewriting."]
protected theorem eq {a b : S} (h : Commute a b) : a * b = b * a

{S : Type u_3}
[Add S]
{a b : S}
(h : AddCommute a b)


@[simp]
theorem map₂_pure_left : map₂ m (pure a) g = g.map (m a)

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{m : α → β → γ}
{g : Filter β}
{a : α}

Filter.map₂ m (pure a) g = Filter.map (m a) g


/-- **Schur-Zassenhaus** for normal subgroups:
  If `H : Subgroup G` is normal, and has order coprime to its index, then there exists a
  subgroup `K` which is a (right) complement of `H`. -/
theorem exists_right_complement'_of_coprime {N : Subgroup G} [N.Normal]
    (hN : Nat.Coprime (Nat.card N) N.index) : ∃ H : Subgroup G, IsComplement' N H

{G : Type u}
[Group G]
{N : Subgroup G}
[N.Normal]
(hN : (Nat.card ↥N).Coprime N.index)


/-- The separable degree of `F⟮α⟯ / F` is equal to the separable degree of the
minimal polynomial of `α` over `F`. -/
theorem finSepDegree_adjoin_simple_eq_natSepDegree {α : E} (halg : IsAlgebraic F α) :
    finSepDegree F F⟮α⟯ = (minpoly F α).natSepDegree

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
{α : E}
(halg : IsAlgebraic F α)

Field.finSepDegree F ↥F⟮α⟯ = (minpoly F α).natSepDegree


@[simp]
theorem iteratedPDeriv_zero (m : Fin 0 → E) (f : 𝓢(E, F)) : iteratedPDeriv 𝕜 m f = f

(𝕜 : Type u_1)
{E : Type u_4}
{F : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
[RCLike 𝕜]
[NormedSpace 𝕜 F]
[SMulCommClass ℝ 𝕜 F]
(m : Fin 0 → E)
(f : SchwartzMap E F)


theorem isReflection_of_mem_rightInvSeq (ω : List B) {t : W} (ht : t ∈ ris ω) :
    cs.IsReflection t

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
(ω : List B)
{t : W}
(ht : t ∈ cs.rightInvSeq ω)


theorem intervalIntegrable_iff' [NoAtoms μ] :
    IntervalIntegrable f μ a b ↔ IntegrableOn f (uIcc a b) μ

{E : Type u_3}
[NormedAddCommGroup E]
{f : ℝ → E}
{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}
[MeasureTheory.NoAtoms μ]

IntervalIntegrable f μ a b ↔ MeasureTheory.IntegrableOn f [[a, b]] μ


@[to_additive]
theorem smul_mem_fixedBy_iff_mem_fixedBy {a : α} {g : G} :
    g • a ∈ fixedBy α g ↔ a ∈ fixedBy α g

{α : Type u_1}
{G : Type u_2}
[AddGroup G]
[AddAction G α]
{a : α}
{g : G}

g +ᵥ a ∈ AddAction.fixedBy α g ↔ a ∈ AddAction.fixedBy α g


/-- Multivariate quotients of polynomial functors.
-/
class MvQPF {n : ℕ} (F : TypeVec.{u} n → Type*) extends MvFunctor F where
  P : MvPFunctor.{u} n
  abs : ∀ {α}, P α → F α
  repr : ∀ {α}, F α → P α
  abs_repr : ∀ {α} (x : F α), abs (repr x) = x
  abs_map : ∀ {α β} (f : α ⟹ β) (p : P α), abs (f <$$> p) = f <$$> abs p

{n : ℕ}
{F : TypeVec.{u} n → Type u_1}
[self : MvQPF F]
{α : TypeVec.{u} n}
(x : F α)


/-- If `f : ℝ → ℝ` is convex on `S` and differentiable within `S` at `y`, then the slope of any
secant line with right endpoint at `y` is bounded above by the derivative of `f` within `S` at `y`.

This is fractionally weaker than `ConvexOn.slope_le_of_hasDerivWithinAt_Iio` but simpler to apply
under a `DifferentiableOn S` hypothesis. -/
lemma slope_le_of_hasDerivWithinAt (hfc : ConvexOn ℝ S f) (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y)
    (hf' : HasDerivWithinAt f f' S y) :
    slope f x y ≤ f'

{S : Set ℝ}
{f : ℝ → ℝ}
{x y f' : ℝ}
(hfc : ConvexOn ℝ S f)
(hx : x ∈ S)
(hy : y ∈ S)
(hxy : x < y)
(hf' : HasDerivWithinAt f f' S y)


protected lemma mul_ne_mul_left (ha : a ≠ 0) : b * a ≠ c * a ↔ b ≠ c


@[simp] theorem not_exists : (¬∃ x, p x) ↔ ∀ x, ¬p x


@[simp]
theorem mem_cliqueSet_iff : s ∈ G.cliqueSet n ↔ G.IsNClique n s

{α : Type u_1}
{G : SimpleGraph α}
{n : ℕ}
{s : Finset α}


@[simp]
lemma polyCharpoly_natDegree [Nontrivial R] :
    (polyCharpoly φ b).natDegree = finrank R M

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
{ι : Type u_5}
[CommRing R]
[AddCommGroup L]
[Module R L]
[AddCommGroup M]
[Module R M]
(φ : L →ₗ[R] Module.End R M)
[Fintype ι]
[DecidableEq ι]
[Module.Free R M]
[Module.Finite R M]
(b : Basis ι R L)
[Nontrivial R]

(φ.polyCharpoly b).natDegree = FiniteDimensional.finrank R M


theorem neg_mul_eq_mul_neg (a b : α) : -(a * b) = a * -b

{α : Type u}
[Mul α]
[HasDistribNeg α]
(a b : α)


theorem smul_closure (a : M) (s : Set R) : a • closure s = closure (a • s)

{M : Type u_1}
{R : Type u_2}
[Monoid M]
[Semiring R]
[MulSemiringAction M R]
(a : M)
(s : Set R)

a • Subsemiring.closure s = Subsemiring.closure (a • s)


@[simp]
theorem sort_singleton (a : α) : sort r {a} = [a]

{α : Type u_1}
(r : α → α → Prop)
[DecidableRel r]
[IsTrans α r]
[IsAntisymm α r]
[IsTotal α r]
(a : α)


@[field_simps 1010]
theorem divp_add_divp_same (a b : α) (u : αˣ) : a /ₚ u + b /ₚ u = (a + b) /ₚ u

{α : Type u}
[Ring α]
(a b : α)
(u : αˣ)


@[to_additive (attr := norm_cast)] -- Porting note (#10618): removed `simp`, `simp` can prove it
theorem coe_multiset_prod {M} [CommMonoid M] (S : Submonoid M) (m : Multiset S) :
    (m.prod : M) = (m.map (↑)).prod

{M : Type u_4}
[CommMonoid M]
(S : Submonoid M)
(m : Multiset ↥S)

↑m.prod = (Multiset.map Subtype.val m).prod


theorem lt_rootMultiplicity_iff_isRoot_iterate_derivative_of_mem_nonZeroDivisors
    {p : R[X]} {t : R} {n : ℕ} (h : p ≠ 0)
    (hnzd : (n.factorial : R) ∈ nonZeroDivisors R) :
    n < p.rootMultiplicity t ↔ ∀ m ≤ n, (derivative^[m] p).IsRoot t

(hnzd : ↑n.factorial ∈ nonZeroDivisors R)

n < Polynomial.rootMultiplicity t p ↔ ∀ m ≤ n, ((⇑Polynomial.derivative)^[m] p).IsRoot t


@[simp]
theorem get_rowLens {μ : YoungDiagram} {i : Nat} {h : i < μ.rowLens.length} :
    μ.rowLens[i] = μ.rowLen i

{μ : YoungDiagram}
{i : ℕ}
{h : i < μ.rowLens.length}


theorem card_Ioo_eq_card_Ico_sub_one (a b : α) : (Ioo a b).card = (Ico a b).card - 1

{α : Type u_2}
[PartialOrder α]
[LocallyFiniteOrder α]
(a b : α)

(Finset.Ioo a b).card = (Finset.Ico a b).card - 1


theorem hasBasis_iff : l.HasBasis p s ↔ ∀ t, t ∈ l ↔ ∃ i, p i ∧ s i ⊆ t

{α : Type u_1}
{ι : Sort u_4}
{l : Filter α}
{p : ι → Prop}
{s : ι → Set α}

l.HasBasis p s ↔ ∀ (t : Set α), t ∈ l ↔ ∃ i, p i ∧ s i ⊆ t


lemma card_preimage_of_injOn {f : α → β} {s : Set β} (hf : (f ⁻¹' s).InjOn f) (hsf : s ⊆ range f) :
    Nat.card (f ⁻¹' s) = Nat.card s

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{s : Set β}
(hf : Set.InjOn f (f ⁻¹' s))
(hsf : s ⊆ Set.range f)


theorem of_comp [FormallyUnramified R B] : FormallyUnramified A B

(R : Type u)
[CommSemiring R]
(A : Type u)
[CommSemiring A]
[Algebra R A]
(B : Type u)
[Semiring B]
[Algebra R B]
[Algebra A B]
[IsScalarTower R A B]
[Algebra.FormallyUnramified R B]


theorem reindexAlgEquiv_mul (e : m ≃ n) (M : Matrix m m A) (N : Matrix m m A) :
    reindexAlgEquiv R A e (M * N) = reindexAlgEquiv R A e M * reindexAlgEquiv R A e N

{m : Type u_2}
{n : Type u_3}
(R : Type u_11)
(A : Type u_12)
[CommSemiring R]
[Fintype n]
[Fintype m]
[DecidableEq m]
[DecidableEq n]
[Semiring A]
[Algebra R A]
(e : m ≃ n)
(M N : Matrix m m A)

(Matrix.reindexAlgEquiv R A e) (M * N) = (Matrix.reindexAlgEquiv R A e) M * (Matrix.reindexAlgEquiv R A e) N


theorem IsPrincipal.principal (S : Submodule R M) [S.IsPrincipal] :
    ∃ a, S = span R {a}

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(S : Submodule R M)
[S.IsPrincipal]


/-- The natural isomorphism `FA ⨿ F- ≅ F(A ⨿ -)`, provided each `coprodComparison F A B` is an
isomorphism (as `B` changes).
-/
-- @[simps (config := { rhsMd := semireducible })] -- Porting note: no config for semireducible
@[simps]
def coprodComparisonNatIso [HasBinaryCoproducts C] [HasBinaryCoproducts D] (A : C)
    [∀ B, IsIso (coprodComparison F A B)] :
    F ⋙ coprod.functor.obj (F.obj A) ≅ coprod.functor.obj A ⋙ F

[∀ (B : C), CategoryTheory.IsIso (CategoryTheory.Limits.coprodComparison F A B)]

(CategoryTheory.Limits.coprodComparisonNatIso F A).hom = CategoryTheory.Limits.coprodComparisonNatTrans F A


theorem add_one_mul_add_one (a b : Nat) : (a + 1) * (b + 1) = a * b + a + b + 1


/-- An algebraic extension is purely inseparable if and only if it has finite separable
degree one. -/
theorem isPurelyInseparable_iff_finSepDegree_eq_one [Algebra.IsAlgebraic F E] :
    IsPurelyInseparable F E ↔ finSepDegree F E = 1

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
[Algebra.IsAlgebraic F E]

IsPurelyInseparable F E ↔ Field.finSepDegree F E = 1


theorem div_lt_iff (hc : 0 < c) : b / c < a ↔ b < a * c

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


@[simp, reassoc] -- reassoc lemma does not need `simp`
theorem comp_coeBase {X Y Z : Scheme} (f : X ⟶ Y) (g : Y ⟶ Z) :
    (f ≫ g).val.base = f.val.base ≫ g.val.base

{X Y Z : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)
(g : Y ⟶ Z)


@[simp]
theorem mk_coe (f : α →ᵈ β) (h) : Dilation.mk f h = f

(f : α →ᵈ β)

(h : ∃ r, r ≠ 0 ∧ ∀ (x y : α), edist (f x) (f y) = ↑r * edist x y)


theorem isPrimePow_nat_iff_bounded (n : ℕ) :
    IsPrimePow n ↔ ∃ p : ℕ, p ≤ n ∧ ∃ k : ℕ, k ≤ n ∧ p.Prime ∧ 0 < k ∧ p ^ k = n

IsPrimePow n ↔ ∃ p ≤ n, ∃ k ≤ n, Nat.Prime p ∧ 0 < k ∧ p ^ k = n


protected theorem le_mul_of_pos_right (n) (h : 0 < m) : n ≤ n * m


/-- Oh, monads are just monoids in the category of endofunctors (equivalence of categories). -/
@[simps]
def monadMonEquiv : Monad C ≌ Mon_ (C ⥤ C)

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

∀ (x : Mon_ (CategoryTheory.Functor C C)),
  ((CategoryTheory.Monad.monadMonEquiv C).counitIso.inv.app x).hom =
    CategoryTheory.CategoryStruct.id ((CategoryTheory.Functor.id (Mon_ (CategoryTheory.Functor C C))).obj x).X


@[simp]
theorem ciSup_pos {p : Prop} {f : p → α} (hp : p) : ⨆ h : p, f h = f hp

{α : Type u_1}
[ConditionallyCompleteLattice α]
{p : Prop}
{f : p → α}
(hp : p)


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

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

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


/-- The left fraction corresponding to a right fraction in the opposite category. -/
@[simps]
def RightFraction.unop {W : MorphismProperty Cᵒᵖ}
    {X Y : Cᵒᵖ} (φ : W.RightFraction X Y) :
    W.unop.LeftFraction (Opposite.unop Y) (Opposite.unop X)

{W : CategoryTheory.MorphismProperty Cᵒᵖ}


theorem exp_im : (exp x).im = Real.exp x.re * Real.sin x.im

(Complex.exp x).im = Real.exp x.re * Real.sin x.im


@[simp]
theorem inter_insert_of_not_mem {s₁ s₂ : Finset α} {a : α} (h : a ∉ s₁) :
    s₁ ∩ insert a s₂ = s₁ ∩ s₂

{α : Type u_1}
[DecidableEq α]
{s₁ s₂ : Finset α}
{a : α}
(h : a ∉ s₁)


@[to_additive (attr := simp)]
lemma prod_indicator_index [Zero M] [CommMonoid N]
    {s : Finset α} (f : α → M) {h : α → M → N} (h_zero : ∀ a ∈ s, h a 0 = 1) :
    (indicator s (fun x _ ↦ f x)).prod h = ∏ x ∈ s, h x (f x)

{α : Type u_1}
{M : Type u_8}
{N : Type u_10}
[Zero M]
[AddCommMonoid N]
{s : Finset α}
(f : α → M)
{h : α → M → N}
(h_zero : ∀ a ∈ s, h a 0 = 0)

(Finsupp.indicator s fun x x_1 => f x).sum h = ∑ x ∈ s, h x (f x)


lemma mk_add {x y : PGame} (hx : x.Numeric) (hy : y.Numeric) :
    Surreal.mk (x + y) (hx.add hy) = Surreal.mk x hx + Surreal.mk y hy

{x y : SetTheory.PGame}
(hx : x.Numeric)
(hy : y.Numeric)

Surreal.mk (x + y) ⋯ = Surreal.mk x hx + Surreal.mk y hy


@[simp] theorem mem_comap {L : CompleteSublattice β} {a : α} : a ∈ L.comap f ↔ f a ∈ L

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
[CompleteLattice β]
(f : CompleteLatticeHom α β)
{L : CompleteSublattice β}
{a : α}

a ∈ CompleteSublattice.comap f L ↔ f a ∈ L


theorem Γ_map_op {X Y : SheafedSpace C} (f : X ⟶ Y) : Γ.map f.op = f.c.app (op ⊤)

{X Y : AlgebraicGeometry.SheafedSpace C}

AlgebraicGeometry.SheafedSpace.Γ.map f.op = f.c.app (Opposite.op ⊤)


@[simp]
theorem destruct_nil : destruct (nil : WSeq α) = Computation.pure none

Stream'.WSeq.nil.destruct = Computation.pure none


@[to_additive (attr := simp)]
theorem le_smul_iff : h ≤ f • g ↔ ∀ ⦃s⦄, s ∈ f → ∀ ⦃t⦄, t ∈ g → s • t ∈ h

{α : Type u_2}
{β : Type u_3}
[SMul α β]
{f : Filter α}
{g h : Filter β}

h ≤ f • g ↔ ∀ ⦃s : Set α⦄, s ∈ f → ∀ ⦃t : Set β⦄, t ∈ g → s • t ∈ h


theorem Memℒp.eLpNorm_eq_integral_rpow_norm {f : α → H} {p : ℝ≥0∞} (hp1 : p ≠ 0) (hp2 : p ≠ ∞)
    (hf : Memℒp f p μ) :
    eLpNorm f p μ = ENNReal.ofReal ((∫ a, ‖f a‖ ^ p.toReal ∂μ) ^ p.toReal⁻¹)

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{H : Type u_7}
[NormedAddCommGroup H]
{f : α → H}
{p : ℝ≥0∞}
(hp1 : p ≠ 0)
(hp2 : p ≠ ⊤)
(hf : MeasureTheory.Memℒp f p μ)

MeasureTheory.eLpNorm f p μ = ENNReal.ofReal ((∫ (a : α), ‖f a‖ ^ p.toReal ∂μ) ^ p.toReal⁻¹)


theorem EventuallyEq.compl {s t : Set α} {l : Filter α} (h : s =ᶠ[l] t) :
    (sᶜ : Set α) =ᶠ[l] (tᶜ : Set α)

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


protected theorem le_mul_of_ediv_le {a b c : Int} (H1 : 0 ≤ b) (H2 : b ∣ a) (H3 : a / b ≤ c) :
    a ≤ c * b


/-- The image under an antitone function of a set which is bounded below is bounded above. -/
theorem map_bddBelow : BddBelow s → BddAbove (f '' s)

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


theorem iSup_iInf_ge_nat_add (f : ℕ → α) (k : ℕ) :
    ⨆ n, ⨅ i ≥ n, f (i + k) = ⨆ n, ⨅ i ≥ n, f i

{α : Type u_1}
[CompleteLattice α]
(f : ℕ → α)
(k : ℕ)

⨆ n, ⨅ i, ⨅ (_ : i ≥ n), f (i + k) = ⨆ n, ⨅ i, ⨅ (_ : i ≥ n), f i


/-- Given a Localization map `f : M →*₀ N` for a Submonoid `S ⊆ M`,
if `M` is left cancellative monoid with zero, and all elements of `S` are
left regular, then N is a left cancellative monoid with zero. -/
theorem leftCancelMulZero_of_le_isLeftRegular
    (f : LocalizationWithZeroMap S N) [IsLeftCancelMulZero M]
    (h : ∀ ⦃x⦄, x ∈ S → IsLeftRegular x) : IsLeftCancelMulZero N

(h : ∀ ⦃x : M⦄, x ∈ S → IsLeftRegular x)


/-- Let `r` be a relation on `α`, let `C : α → Prop` and let `bot : α`.
This induction principle shows that `C bot` holds, given that
* some `a` that is accessible by `r` satisfies `C a`, and
* for each `b ≠ bot` such that `C b` holds, there is `c` satisfying `r c b` and `C c`. -/
theorem Acc.induction_bot {α} {r : α → α → Prop} {a bot : α} (ha : Acc r a) {C : α → Prop}
    (ih : ∀ b, b ≠ bot → C b → ∃ c, r c b ∧ C c) : C a → C bot

(ih : ∀ (b : α), b ≠ bot → C b → ∃ c, r c b ∧ C c)


theorem derivative_add {f g : R[X]} : derivative (f + g) = derivative f + derivative g

Polynomial.derivative (f + g) = Polynomial.derivative f + Polynomial.derivative g


@[simp]
theorem AlgEquiv.spectrum_eq {F R A B : Type*} [CommSemiring R] [Ring A] [Ring B] [Algebra R A]
    [Algebra R B] [EquivLike F A B] [AlgEquivClass F R A B] (f : F) (a : A) :
    spectrum R (f a) = spectrum R a

{F : Type u_1}
{R : Type u_2}
{A : Type u_3}
{B : Type u_4}
[CommSemiring R]
[Ring A]
[Ring B]
[Algebra R A]
[Algebra R B]
[EquivLike F A B]
[AlgEquivClass F R A B]
(f : F)
(a : A)


/-- The inf of two orthogonal subspaces equals the subspace orthogonal
to the sup. -/
theorem inf_orthogonal (K₁ K₂ : Submodule 𝕜 E) : K₁ᗮ ⊓ K₂ᗮ = (K₁ ⊔ K₂)ᗮ

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
(K₁ K₂ : Submodule 𝕜 E)

K₁ᗮ ⊓ K₂ᗮ = (K₁ ⊔ K₂)ᗮ


@[to_additive]
protected theorem Finset.hasProd_iff_compl (s : Finset β) :
    HasProd f a ↔ HasProd (fun x : { x // x ∉ s } ↦ f x) (a / ∏ i ∈ s, f i)

{α : Type u_1}
{β : Type u_2}
[CommGroup α]
[TopologicalSpace α]
[TopologicalGroup α]
{f : β → α}
{a : α}
(s : Finset β)

HasProd f a ↔ HasProd (fun x => f ↑x) (a / ∏ i ∈ s, f i)


theorem isRoot_map_iff {R : Type*} [CommRing R] {f : R →+* S} {x : R} {p : R[X]}
    (hf : Function.Injective f) : IsRoot (p.map f) (f x) ↔ IsRoot p x

{S : Type v}
[CommSemiring S]
{R : Type u_1}
[CommRing R]
{f : R →+* S}
{x : R}
{p : R[X]}
(hf : Function.Injective ⇑f)

(Polynomial.map f p).IsRoot (f x) ↔ p.IsRoot x


theorem edgeDensity_add_edgeDensity_compl (hs : s.Nonempty) (ht : t.Nonempty) :
    edgeDensity r s t + edgeDensity (fun x y ↦ ¬r x y) s t = 1

{α : Type u_4}
{β : Type u_5}
(r : α → β → Prop)
[(a : α) → DecidablePred (r a)]
{s : Finset α}
{t : Finset β}
(hs : s.Nonempty)
(ht : t.Nonempty)

Rel.edgeDensity r s t + Rel.edgeDensity (fun x y => ¬r x y) s t = 1


theorem IsLowerSet.null_frontier (hs : IsLowerSet s) : volume (frontier s) = 0

{ι : Type u_1}
[Fintype ι]
{s : Set (ι → ℝ)}
(hs : IsLowerSet s)


@[simp, norm_cast]
theorem map_coeIdeal (I : Ideal R) : (I : FractionalIdeal S P).map g = I

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
{P' : Type u_3}
[CommRing P']
[Algebra R P']
(g : P →ₐ[R] P')
(I : Ideal R)


/-- The shift functor by `n` on `CochainComplex C ℤ` identifies to the identity
functor when `n = 0`. -/
@[simps!]
def shiftFunctorZero' (n : ℤ) (h : n = 0) :
    shiftFunctor C n ≅ 𝟭 _

(C : Type u)
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
(n : ℤ)
(h : n = 0)
(X : CochainComplex C ℤ)
(i : ℤ)

((CochainComplex.shiftFunctorZero' C n h).inv.app X).f i = (HomologicalComplex.XIsoOfEq X ⋯).inv


@[simp]
theorem volumeForm_zero_pos [_i : Fact (finrank ℝ E = 0)] :
    Orientation.volumeForm (positiveOrientation : Orientation ℝ E (Fin 0)) =
      AlternatingMap.constLinearEquivOfIsEmpty 1

[_i : Fact (FiniteDimensional.finrank ℝ E = 0)]

positiveOrientation.volumeForm = AlternatingMap.constLinearEquivOfIsEmpty 1


theorem StrictConvex.sub (hs : StrictConvex 𝕜 s) (ht : StrictConvex 𝕜 t) : StrictConvex 𝕜 (s - t)

{𝕜 : Type u_1}
{E : Type u_3}
[OrderedRing 𝕜]
[TopologicalSpace E]
[AddCommGroup E]
[Module 𝕜 E]
{s t : Set E}
[TopologicalAddGroup E]
(hs : StrictConvex 𝕜 s)
(ht : StrictConvex 𝕜 t)


theorem HasDerivAt.clog {f : ℂ → ℂ} {f' x : ℂ} (h₁ : HasDerivAt f f' x)
    (h₂ : f x ∈ slitPlane) : HasDerivAt (fun t => log (f t)) (f' / f x) x

{f : ℂ → ℂ}
{f' x : ℂ}
(h₁ : HasDerivAt f f' x)
(h₂ : f x ∈ Complex.slitPlane)

HasDerivAt (fun t => Complex.log (f t)) (f' / f x) x


protected theorem add_lt_add_of_lt_of_le [CovariantClass α α (· + ·) (· ≤ ·)]
    [CovariantClass α α (swap (· + ·)) (· < ·)] (hd : d ≠ ⊥) (hab : a < b) (hcd : c ≤ d) :
    a + c < b + d

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

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


@[simp]
theorem continuousOn_lift₂ {f : X → Y → Z} {hf : ∀ a b c d, (a ~ᵢ c) → (b ~ᵢ d) → f a b = f c d}
    {s : Set (SeparationQuotient X × SeparationQuotient Y)} :
    ContinuousOn (uncurry <| lift₂ f hf) s ↔ ContinuousOn (uncurry f) (Prod.map mk mk ⁻¹' s)

{hf : ∀ (a : X) (b : Y) (c : X) (d : Y), (a ~ᵢ c) → (b ~ᵢ d) → f a b = f c d}

ContinuousOn (Function.uncurry (SeparationQuotient.lift₂ f hf)) s ↔
  ContinuousOn (Function.uncurry f) (Prod.map SeparationQuotient.mk SeparationQuotient.mk ⁻¹' s)


/-- The oriented angle between two vectors is `π` if and only they are nonzero and the first is
on the same ray as the negation of the second. -/
theorem oangle_eq_pi_iff_sameRay_neg {x y : V} :
    o.oangle x y = π ↔ x ≠ 0 ∧ y ≠ 0 ∧ SameRay ℝ x (-y)

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

o.oangle x y = ↑π ↔ x ≠ 0 ∧ y ≠ 0 ∧ SameRay ℝ x (-y)


lemma natCast_ediv (m n : ℕ) : ((m / n : ℕ) : ℤ) = ediv m n


@[simp]
theorem realize_boundedFormula_top {α : Type*} {n : ℕ} {φ : L.BoundedFormula α n}
    {v : α → (⊤ : L.Substructure M)} {xs : Fin n → (⊤ : L.Substructure M)} :
    φ.Realize v xs ↔ φ.Realize (((↑) : _ → M) ∘ v) ((↑) ∘ xs)

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u_3}
{n : ℕ}
{φ : L.BoundedFormula α n}
{v : α → ↥⊤}
{xs : Fin n → ↥⊤}

φ.Realize v xs ↔ φ.Realize (Subtype.val ∘ v) (Subtype.val ∘ xs)


@[to_additive (attr := simp) existing AddGroupSeminorm.apply_one]
theorem apply_one [DecidableEq E] (x : E) : (1 : GroupSeminorm E) x = if x = 1 then 0 else 1

{E : Type u_4}
[Group E]
[DecidableEq E]
(x : E)


@[to_additive (attr := simp)]
theorem mem_mulAntidiagonal : x ∈ mulAntidiagonal hs ht a ↔ x.1 ∈ s ∧ x.2 ∈ t ∧ x.1 * x.2 = a

{α : Type u_1}
[OrderedCancelAddCommMonoid α]
{s t : Set α}
{hs : s.IsPWO}
{ht : t.IsPWO}
{a : α}
{x : α × α}

x ∈ Finset.addAntidiagonal hs ht a ↔ x.1 ∈ s ∧ x.2 ∈ t ∧ x.1 + x.2 = a


@[to_additive]
theorem orderOf_eq_orderOf_iff {H : Type*} [Monoid H] {y : H} :
    orderOf x = orderOf y ↔ ∀ n : ℕ, x ^ n = 1 ↔ y ^ n = 1

{G : Type u_1}
[Monoid G]
{x : G}
{H : Type u_6}
[Monoid H]
{y : H}

orderOf x = orderOf y ↔ ∀ (n : ℕ), x ^ n = 1 ↔ y ^ n = 1


@[simp]
theorem evalNegHom_X : evalNegHom (X : A⟦X⟧) = -X

PowerSeries.evalNegHom PowerSeries.X = -PowerSeries.X


@[simp]
theorem mem_prod {S : Subalgebra R A} {S₁ : Subalgebra R B} {x : A × B} :
    x ∈ prod S S₁ ↔ x.1 ∈ S ∧ x.2 ∈ S₁

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
{S : Subalgebra R A}
{S₁ : Subalgebra R B}
{x : A × B}


@[deprecated divInt_one (since := "2024-03-18")]
lemma divInt_neg_one_one : -1 /. 1 = -1


@[simp]
theorem inner_self_eq_zero {x : E} : ⟪x, x⟫ = 0 ↔ x = 0

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{x : E}


@[simp]
theorem symm_symm (e : L₁ ≃ₗ⁅R⁆ L₂) : e.symm.symm = e

{R : Type u}
{L₁ : Type v}
{L₂ : Type w}
[CommRing R]
[LieRing L₁]
[LieRing L₂]
[LieAlgebra R L₁]
[LieAlgebra R L₂]
(e : L₁ ≃ₗ⁅R⁆ L₂)


/-- For the equality, see `cthickening_thickening`. -/
@[simp]
theorem cthickening_thickening_subset (hε : 0 ≤ ε) (δ : ℝ) (s : Set α) :
    cthickening ε (thickening δ s) ⊆ cthickening (ε + δ) s

{α : Type u}
[PseudoEMetricSpace α]
{ε : ℝ}
(hε : 0 ≤ ε)
(δ : ℝ)
(s : Set α)

Metric.cthickening ε (Metric.thickening δ s) ⊆ Metric.cthickening (ε + δ) s