theorem _root_.Pi.lex_eq_dfinsupp_lex {r : ι → ι → Prop} {s : ∀ i, α i → α i → Prop}
    (a b : Π₀ i, α i) : Pi.Lex r (s _) (a : ∀ i, α i) b = DFinsupp.Lex r s a b

{ι : Type u_1}
{α : ι → Type u_2}
[(i : ι) → Zero (α i)]
{r : ι → ι → Prop}
{s : (i : ι) → α i → α i → Prop}
(a b : Π₀ (i : ι), α i)

Pi.Lex r (fun {i} => s i) ⇑a ⇑b = DFinsupp.Lex r s a b


theorem IsMaxOn.on_subset (hf : IsMaxOn f t a) (h : s ⊆ t) : IsMaxOn f s a

{α : Type u}
{β : Type v}
[Preorder β]
{f : α → β}
{s : Set α}
{a : α}
{t : Set α}
(hf : IsMaxOn f t a)
(h : s ⊆ t)


lemma Monotone.image_Ici_subset (h : Monotone f) : f '' Ici a ⊆ Ici (f a)

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


private lemma aux (hm : m ≠ 0) (hkmn : m * k ≤ n) : k < (n + 1)

{k m n : ℕ}
(hm : m ≠ 0)
(hkmn : m * k ≤ n)


theorem boole_mul {α} [MulZeroOneClass α] (P : Prop) [Decidable P] (a : α) :
    (if P then 1 else 0) * a = if P then a else 0

{α : Type u_1}
[MulZeroOneClass α]
(P : Prop)
[Decidable P]
(a : α)


/-- Any injection from a finset `s` in a fintype `α` to a finset `t` of the same cardinality as `α`
can be extended to a bijection between `α` and `t`. -/
theorem Finset.exists_equiv_extend_of_card_eq [Fintype α] [DecidableEq β] {t : Finset β}
    (hαt : Fintype.card α = t.card) {s : Finset α} {f : α → β} (hfst : Finset.image f s ⊆ t)
    (hfs : Set.InjOn f s) : ∃ g : α ≃ t, ∀ i ∈ s, (g i : β) = f i

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[DecidableEq β]
{t : Finset β}
(hαt : Fintype.card α = t.card)
{s : Finset α}
{f : α → β}
(hfst : Finset.image f s ⊆ t)
(hfs : Set.InjOn f ↑s)


@[simp]
lemma abs_re_eq_abs {z : ℂ} : |z.re| = abs z ↔ z.im = 0


theorem comap_comp (f : R →+* S) (g : S →+* P) (U : Opens (PrimeSpectrum.Top R))
    (V : Opens (PrimeSpectrum.Top S)) (W : Opens (PrimeSpectrum.Top P))
    (hUV : ∀ p ∈ V, PrimeSpectrum.comap f p ∈ U) (hVW : ∀ p ∈ W, PrimeSpectrum.comap g p ∈ V) :
    (comap (g.comp f) U W fun p hpW => hUV (PrimeSpectrum.comap g p) (hVW p hpW)) =
      (comap g V W hVW).comp (comap f U V hUV)

(U : TopologicalSpace.Opens ↑(AlgebraicGeometry.PrimeSpectrum.Top R))

(V : TopologicalSpace.Opens ↑(AlgebraicGeometry.PrimeSpectrum.Top S))

(W : TopologicalSpace.Opens ↑(AlgebraicGeometry.PrimeSpectrum.Top P))

(hUV : ∀ p ∈ V, (PrimeSpectrum.comap f) p ∈ U)

(hVW : ∀ p ∈ W, (PrimeSpectrum.comap g) p ∈ V)

AlgebraicGeometry.StructureSheaf.comap (g.comp f) U W ⋯ =
  (AlgebraicGeometry.StructureSheaf.comap g V W hVW).comp (AlgebraicGeometry.StructureSheaf.comap f U V hUV)


theorem nhdsWithin_target_inter {x} (hx : x ∈ e.target) (s : Set Y) : 𝓝[e.target ∩ s] x = 𝓝[s] x

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)
{x : Y}
(hx : x ∈ e.target)
(s : Set Y)


@[norm_cast]
theorem ofReal_tsum (f : α → ℝ) : (↑(∑' a, f a) : 𝕜) = ∑' a, (f a : 𝕜)

{α : Type u_1}
(𝕜 : Type u_2)
[RCLike 𝕜]
(f : α → ℝ)


theorem continuous_left_toIocMod : ContinuousWithinAt (toIocMod hp a) (Iic x) x

{𝕜 : Type u_1}
[LinearOrderedAddCommGroup 𝕜]
[Archimedean 𝕜]
[TopologicalSpace 𝕜]
[OrderTopology 𝕜]
{p : 𝕜}
(hp : 0 < p)
(a x : 𝕜)

ContinuousWithinAt (toIocMod hp a) (Set.Iic x) x


@[simp]
theorem mk_list_eq_mk (α : Type u) [Infinite α] : #(List α) = #α


theorem repr_eq_iff {b : Basis ι R M} {f : M →ₗ[R] ι →₀ R} :
    ↑b.repr = f ↔ ∀ i, f (b i) = Finsupp.single i 1

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{b : Basis ι R M}
{f : M →ₗ[R] ι →₀ R}

↑b.repr = f ↔ ∀ (i : ι), f (b i) = Finsupp.single i 1


/-- A zero morphism `0 : X ⟶ Y` is an isomorphism if and only if
the identities on both `X` and `Y` are zero.
-/
@[simps]
def isIsoZeroEquiv (X Y : C) : IsIso (0 : X ⟶ Y) ≃ 𝟙 X = 0 ∧ 𝟙 Y = 0


@[simp]
theorem coe_comp (g : β →ᵈ γ) (f : α →ᵈ β) : (g.comp f : α → γ) = g ∘ f

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
[PseudoEMetricSpace γ]
(g : β →ᵈ γ)
(f : α →ᵈ β)


theorem hasMFDerivAt_unique (h₀ : HasMFDerivAt I I' f x f₀') (h₁ : HasMFDerivAt I I' f x f₁') :
    f₀' = f₁'

{f₀' f₁' : TangentSpace I x →L[𝕜] TangentSpace I' (f x)}


@[simp]
theorem Matrix.toBilin_symm : (Matrix.toBilin b).symm = BilinForm.toMatrix b

{R₂ : Type u_5}
{M₂ : Type u_6}
[CommSemiring R₂]
[AddCommMonoid M₂]
[Module R₂ M₂]
{n : Type u_11}
[Fintype n]
[DecidableEq n]
(b : Basis n R₂ M₂)


@[simp]
theorem polar_union {s t : Set E} : B.polar (s ∪ t) = B.polar s ∩ B.polar t

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NormedCommRing 𝕜]
[AddCommMonoid E]
[AddCommMonoid F]
[Module 𝕜 E]
[Module 𝕜 F]
(B : E →ₗ[𝕜] F →ₗ[𝕜] 𝕜)
{s t : Set E}


theorem nonneg_mul_lem {x y : ℕ} {a : ℤ√d} (ha : Nonneg a) : Nonneg (⟨x, y⟩ * a)


@[simp]
theorem leftUnitor_inv_apply {M : ModuleCat.{u} R} (m : M) :
    ((λ_ M).inv : M ⟶ 𝟙_ (ModuleCat.{u} R) ⊗ M) m = 1 ⊗ₜ[R] m

{R : Type u}
[CommRing R]
{M : ModuleCat R}
(m : ↑M)

(CategoryTheory.MonoidalCategory.leftUnitor M).inv m = 1 ⊗ₜ[R] m


theorem hσ'_eq' {q n a : ℕ} (ha : n = a + q) :
    (hσ' q n (n + 1) rfl : X _[n] ⟶ X _[n + 1]) =
      (-1 : ℤ) ^ a • X.σ ⟨a, Nat.lt_succ_iff.mpr (Nat.le.intro (Eq.symm ha))⟩

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{X : CategoryTheory.SimplicialObject C}
{q n a : ℕ}
(ha : n = a + q)

AlgebraicTopology.DoldKan.hσ' q n (n + 1) ⋯ = (-1) ^ a • X.σ ⟨a, ⋯⟩


@[simp]
theorem toDual_iInf (f : ι → α) : toDual (⨅ i, f i) = ⨆ i, toDual (f i)

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

OrderDual.toDual (⨅ i, f i) = ⨆ i, OrderDual.toDual (f i)


theorem condexpL2_ae_eq_zero_of_ae_eq_zero (hs : MeasurableSet[m] s) (hμs : μ s ≠ ∞) {f : Lp ℝ 2 μ}
    (hf : f =ᵐ[μ.restrict s] 0) : condexpL2 ℝ ℝ hm f =ᵐ[μ.restrict s] (0 : α → ℝ)

{α : Type u_1}
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
{hm : m ≤ m0}
(hs : MeasurableSet s)
(hμs : μ s ≠ ⊤)
{f : ↥(MeasureTheory.Lp ℝ 2 μ)}
(hf : ↑↑f =ᵐ[μ.restrict s] 0)

↑↑↑((MeasureTheory.condexpL2 ℝ ℝ hm) f) =ᵐ[μ.restrict s] 0


theorem IsPiSystem.comap {α β} {S : Set (Set β)} (h_pi : IsPiSystem S) (f : α → β) :
    IsPiSystem { s : Set α | ∃ t ∈ S, f ⁻¹' t = s }

{α : Type u_1}
{β : Type u_2}
{S : Set (Set β)}
(h_pi : IsPiSystem S)
(f : α → β)


theorem max_lt_max_right_iff : max a b < max a c ↔ b < c ∧ a < c

{α : Type u}
[LinearOrder α]
{a b c : α}


@[simp]
theorem lift_mk (g : R[X]) : lift i a h (mk f g) = g.eval₂ i a

{R : Type u}
{S : Type v}
[CommRing R]
{f : R[X]}
[CommRing S]
{i : R →+* S}
{a : S}
(h : Polynomial.eval₂ i a f = 0)
(g : R[X])

(AdjoinRoot.lift i a h) ((AdjoinRoot.mk f) g) = Polynomial.eval₂ i a g


theorem min_min_min_comm : min (min a b) (min c d) = min (min a c) (min b d)

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


/-- A mixin class saying that elements `μ : F` are outer measures on `α`.

This typeclass is used to unify some API for outer measures and measures. -/
class OuterMeasureClass (F : Type*) (α : outParam Type*) [FunLike F (Set α) ℝ≥0∞] : Prop where
  protected measure_empty (f : F) : f ∅ = 0
  protected measure_mono (f : F) {s t} : s ⊆ t → f s ≤ f t
  protected measure_iUnion_nat_le (f : F) (s : ℕ → Set α) : Pairwise (Disjoint on s) →
    f (⋃ i, s i) ≤ ∑' i, f (s i)

[self : MeasureTheory.OuterMeasureClass F α]


@[simp]
theorem cancel_left {g : sInfHom β γ} {f₁ f₂ : sInfHom α β} (hg : Injective g) :
    g.comp f₁ = g.comp f₂ ↔ f₁ = f₂

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[InfSet α]
[InfSet β]
[InfSet γ]
{g : sInfHom β γ}
{f₁ f₂ : sInfHom α β}
(hg : Function.Injective ⇑g)


lemma oppositeShiftFunctorZero_inv_app (X : OppositeShift C A) :
    (shiftFunctorZero (OppositeShift C A) A).inv.app X =
      ((shiftFunctorZero C A).hom.app X.unop).op

(C : Type u_1)
[CategoryTheory.Category.{u_3, u_1} C]
(A : Type u_2)
[AddMonoid A]
[CategoryTheory.HasShift C A]
(X : CategoryTheory.OppositeShift C A)

(CategoryTheory.shiftFunctorZero (CategoryTheory.OppositeShift C A) A).inv.app X =
  ((CategoryTheory.shiftFunctorZero C A).hom.app (Opposite.unop X)).op


lemma counit_mul (a b : A) : counit (R := R) (a * b) = counit a * counit b

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Bialgebra R A]
(a b : A)

Coalgebra.counit (a * b) = Coalgebra.counit a * Coalgebra.counit b


theorem HasDerivAt.congr_of_eventuallyEq (h : HasDerivAt f f' x) (h₁ : f₁ =ᶠ[𝓝 x] f) :
    HasDerivAt f₁ f' x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f f₁ : 𝕜 → F}
{f' : F}
{x : 𝕜}
(h : HasDerivAt f f' x)
(h₁ : f₁ =ᶠ[𝓝 x] f)


/-- If `h : X → Y` is a homeomorphism, `h⁻¹(s)` is compact iff `s` is. -/
@[simp]
theorem isCompact_preimage {s : Set Y} (h : X ≃ₜ Y) : IsCompact (h ⁻¹' s) ↔ IsCompact s

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{s : Set Y}
(h : X ≃ₜ Y)


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

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


@[simp]
theorem norm_mkPiAlgebra [NormOneClass A] : ‖ContinuousMultilinearMap.mkPiAlgebra 𝕜 ι A‖ = 1

{𝕜 : Type u}
{ι : Type v}
[Fintype ι]
[NontriviallyNormedField 𝕜]
{A : Type u_1}
[NormedCommRing A]
[NormedAlgebra 𝕜 A]
[NormOneClass A]


theorem nndist_eq_iSup {β : ι → Type*} [∀ i, PseudoMetricSpace (β i)] (x y : PiLp ∞ β) :
    nndist x y = ⨆ i, nndist (x i) (y i)

{ι : Type u_2}
[Fintype ι]
{β : ι → Type u_5}
[(i : ι) → PseudoMetricSpace (β i)]
(x y : PiLp ⊤ β)


/-- Postcomposing `f` with `Prod.snd` is `C^n` at `x` -/
theorem ContDiffAt.snd {f : E → F × G} {x : E} (hf : ContDiffAt 𝕜 n f x) :
    ContDiffAt 𝕜 n (fun x => (f x).2) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{n : ℕ∞}
{f : E → F × G}
{x : E}
(hf : ContDiffAt 𝕜 n f x)


theorem isLocalization_iff_of_base_ringEquiv (h : R ≃+* P) :
    IsLocalization M S ↔
      haveI := ((algebraMap R S).comp h.symm.toRingHom).toAlgebra
      IsLocalization (M.map h.toMonoidHom) S

{R : Type u_1}
[CommSemiring R]
(M : Submonoid R)
(S : Type u_2)
[CommSemiring S]
[Algebra R S]
{P : Type u_3}
[CommSemiring P]
(h : R ≃+* P)

IsLocalization M S ↔ IsLocalization (Submonoid.map h.toMonoidHom M) S


/-- A family of `indicatorConstLp` functions tends to an `indicatorConstLp`,
if the underlying sets tend to the set in the sense of the measure of the symmetric difference. -/
theorem tendsto_indicatorConstLp_set [hp₁ : Fact (1 ≤ p)] {β : Type*} {l : Filter β} {t : β → Set α}
    {ht : ∀ b, MeasurableSet (t b)} {hμt : ∀ b, μ (t b) ≠ ∞} (hp : p ≠ ∞)
    (h : Tendsto (fun b ↦ μ (t b ∆ s)) l (𝓝 0)) :
    Tendsto (fun b ↦ indicatorConstLp p (ht b) (hμt b) c) l (𝓝 (indicatorConstLp p hs hμs c))

(h : Filter.Tendsto (fun b => μ (t b ∆ s)) l (𝓝 0))

Filter.Tendsto (fun b => MeasureTheory.indicatorConstLp p ⋯ ⋯ c) l (𝓝 (MeasureTheory.indicatorConstLp p hs hμs c))


@[to_additive sum_le_sum_of_subset]
theorem prod_le_prod_of_subset' (h : s ⊆ t) : ∏ x ∈ s, f x ≤ ∏ x ∈ t, f x

{ι : Type u_1}
{M : Type u_4}
[CanonicallyOrderedAddCommMonoid M]
{f : ι → M}
{s t : Finset ι}
(h : s ⊆ t)


theorem ContDiffOn.differentiableOn_iteratedFDerivWithin {m : ℕ} (h : ContDiffOn 𝕜 n f s)
    (hmn : (m : ℕ∞) < n) (hs : UniqueDiffOn 𝕜 s) :
    DifferentiableOn 𝕜 (iteratedFDerivWithin 𝕜 m f s) s

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{n : ℕ∞}
{m : ℕ}
(h : ContDiffOn 𝕜 n f s)
(hmn : ↑m < n)
(hs : UniqueDiffOn 𝕜 s)


@[simp]
theorem single_zero (a : α) : (single a 0 : α →₀ M) = 0

{α : Type u_1}
{M : Type u_5}
[Zero M]
(a : α)


@[simp]
theorem comp_C : p.comp (C a) = C (p.eval a)

{R : Type u}
{a : R}
[Semiring R]
{p : R[X]}

p.comp (Polynomial.C a) = Polynomial.C (Polynomial.eval a p)


@[simp]
theorem inverse_zero : inverse (0 : M₀) = 0


theorem toReal_min {a b : ℝ≥0∞} (hr : a ≠ ∞) (hp : b ≠ ∞) :
    ENNReal.toReal (min a b) = min (ENNReal.toReal a) (ENNReal.toReal b)

(min a b).toReal = min a.toReal b.toReal


/-- An affine combination with `affineCombinationSingleWeights` gives the specified point. -/
@[simp]
theorem affineCombination_affineCombinationSingleWeights [DecidableEq ι] (p : ι → P) {i : ι}
    (hi : i ∈ s) : s.affineCombination k p (affineCombinationSingleWeights k i) = p i

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
(s : Finset ι)
[DecidableEq ι]
(p : ι → P)
{i : ι}
(hi : i ∈ s)

(Finset.affineCombination k s p) (Finset.affineCombinationSingleWeights k i) = p i


/-- There are various definitions of "locally compact space" in the literature,
which agree for Hausdorff spaces but not in general.
This one is the precise condition on X needed
for the evaluation map `C(X, Y) × X → Y` to be continuous for all `Y`
when `C(X, Y)` is given the compact-open topology.

See also `WeaklyLocallyCompactSpace`, a typeclass that only assumes
that each point has a compact neighborhood. -/
class LocallyCompactSpace (X : Type*) [TopologicalSpace X] : Prop where
  /-- In a locally compact space,
    every neighbourhood of every point contains a compact neighbourhood of that same point. -/
  local_compact_nhds : ∀ (x : X), ∀ n ∈ 𝓝 x, ∃ s ∈ 𝓝 x, s ⊆ n ∧ IsCompact s

{X : Type u_3}
[TopologicalSpace X]
[self : LocallyCompactSpace X]
(x : X)
(n : Set X)

n ∈ 𝓝 x → ∃ s ∈ 𝓝 x, s ⊆ n ∧ IsCompact s


protected theorem add_pow_prime_eq (hp : p.Prime) (h : Commute x y) :
    (x + y) ^ p =
      x ^ p + y ^ p + p * ∑ k ∈ Finset.Ioo 0 p, x ^ k * y ^ (p - k) * ↑(p.choose k / p)

{R : Type u_1}
[Semiring R]
{p : ℕ}
{x y : R}
(hp : Nat.Prime p)
(h : Commute x y)

(x + y) ^ p = x ^ p + y ^ p + ↑p * ∑ k ∈ Finset.Ioo 0 p, x ^ k * y ^ (p - k) * ↑(p.choose k / p)


theorem one_mul {n} (a : ⨂[R]^n M) : cast R M (zero_add n) (ₜ1 ₜ* a) = a

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{n : ℕ}
(a : ⨂[R]^n M)

(TensorPower.cast R M ⋯) (GradedMonoid.GMul.mul GradedMonoid.GOne.one a) = a


@[simp, norm_cast] lemma cast_min (p q : ℚ≥0) : (↑(min p q) : K) = min (p : K) (q : K)

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


lemma norm_integral_le_norm [IsProbabilityMeasure μ] (f : X →ᵇ E) :
    ‖∫ x, f x ∂μ‖ ≤ ‖f‖

{X : Type u_1}
[MeasurableSpace X]
[TopologicalSpace X]
[OpensMeasurableSpace X]
(μ : MeasureTheory.Measure X)
{E : Type u_2}
[NormedAddCommGroup E]
[SecondCountableTopology E]
[MeasurableSpace E]
[BorelSpace E]
[NormedSpace ℝ E]
[MeasureTheory.IsProbabilityMeasure μ]
(f : X →ᵇ E)


theorem incidenceSet_inter_incidenceSet_of_not_adj (h : ¬G.Adj a b) (hn : a ≠ b) :
    G.incidenceSet a ∩ G.incidenceSet b = ∅

{V : Type u}
(G : SimpleGraph V)
{a b : V}
(h : ¬G.Adj a b)
(hn : a ≠ b)


theorem coprod_inl_inr [ContinuousAdd M₁] [ContinuousAdd M'₁] :
    (ContinuousLinearMap.inl R₁ M₁ M'₁).coprod (ContinuousLinearMap.inr R₁ M₁ M'₁) =
      ContinuousLinearMap.id R₁ (M₁ × M'₁)

{R₁ : Type u_1}
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M'₁ : Type u_5}
[TopologicalSpace M'₁]
[AddCommMonoid M'₁]
[Module R₁ M₁]
[Module R₁ M'₁]
[ContinuousAdd M₁]
[ContinuousAdd M'₁]


theorem tendsto_prodAssoc_symm {h : Filter γ} :
    Tendsto (Equiv.prodAssoc α β γ).symm (f ×ˢ (g ×ˢ h)) ((f ×ˢ g) ×ˢ h)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : Filter α}
{g : Filter β}
{h : Filter γ}

Filter.Tendsto (⇑(Equiv.prodAssoc α β γ).symm) (f ×ˢ g ×ˢ h) ((f ×ˢ g) ×ˢ h)


@[to_additive]
theorem mul_ciSup_le [CovariantClass α α (· * ·) (· ≤ ·)] {a : α} {g : α} {h : ι → α}
    (H : ∀ j, g * h j ≤ a) : g * iSup h ≤ a

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


theorem summable_mk {f : α → ℝ} (hf : ∀ n, 0 ≤ f n) :
    (@Summable ℝ≥0 _ _ _ fun n => ⟨f n, hf n⟩) ↔ Summable f

{α : Type u_1}
{f : α → ℝ}
(hf : ∀ (n : α), 0 ≤ f n)

(Summable fun n => ⟨f n, ⋯⟩) ↔ Summable f


theorem cos_two_pi_sub (x : ℂ) : cos (2 * π - x) = cos x

Complex.cos (2 * ↑Real.pi - x) = Complex.cos x


theorem isCoboundedUnder_le_finset_sup' [LinearOrder β] {f : Filter α} {F : ι → α → β}
    {s : Finset ι} (hs : s.Nonempty) (h : ∃ i ∈ s, f.IsCoboundedUnder (· ≤ ·) (F i)) :
    f.IsCoboundedUnder (· ≤ ·) (fun a ↦ sup' s hs (fun i ↦ F i a))

{F : ι → α → β}

(h : ∃ i ∈ s, Filter.IsCoboundedUnder (fun x x_1 => x ≤ x_1) f (F i))

Filter.IsCoboundedUnder (fun x x_1 => x ≤ x_1) f fun a => s.sup' hs fun i => F i a


theorem mem_commutatorSet_iff : g ∈ commutatorSet G ↔ ∃ g₁ g₂ : G, ⁅g₁, g₂⁆ = g

g ∈ commutatorSet G ↔ ∃ g₁ g₂, ⁅g₁, g₂⁆ = g


@[simp]
theorem infPrime_iff_infIrred : InfPrime a ↔ InfIrred a

{α : Type u_2}
[DistribLattice α]
{a : α}


/-- Consider a point `x` at which a set `s` has density one, with respect to closed balls (i.e.,
a Lebesgue density point of `s`). Then `s` intersects the rescaled copies `{x} + r • t` of a given
set `t` with positive measure, for any small enough `r`. -/
theorem eventually_nonempty_inter_smul_of_density_one (s : Set E) (x : E)
    (h : Tendsto (fun r => μ (s ∩ closedBall x r) / μ (closedBall x r)) (𝓝[>] 0) (𝓝 1)) (t : Set E)
    (ht : MeasurableSet t) (h't : μ t ≠ 0) :
    ∀ᶠ r in 𝓝[>] (0 : ℝ), (s ∩ ({x} + r • t)).Nonempty

(h : Filter.Tendsto (fun r => μ (s ∩ Metric.closedBall x r) / μ (Metric.closedBall x r)) (𝓝[>] 0) (𝓝 1))

∀ᶠ (r : ℝ) in 𝓝[>] 0, (s ∩ ({x} + r • t)).Nonempty


@[simp]
lemma ofNat_mem_slitPlane (n : ℕ) [n.AtLeastTwo] : no_index (OfNat.ofNat n) ∈ slitPlane


/-- Every algebra morphism from the even subalgebra is in one-to-one correspondence with a
bilinear map that sends duplicate arguments to the quadratic form, and contracts across
multiplication. -/
@[simps! symm_apply_bilin]
def even.lift : EvenHom Q A ≃ (CliffordAlgebra.even Q →ₐ[R] A)

{R : Type uR}
{M : Type uM}
[CommRing R]
[AddCommGroup M]
[Module R M]
(Q : QuadraticForm R M)
{A : Type uA}
[Ring A]
[Algebra R A]
(F : ↥(CliffordAlgebra.even Q) →ₐ[R] A)

((CliffordAlgebra.even.lift Q).symm F).bilin = (CliffordAlgebra.even.ι Q).bilin.compr₂ F.toLinearMap


/-- The equivalence of categories from the order dual of a preordered type `X`
to the opposite category of the preorder `X`. -/
@[simps]
def orderDualEquivalence : Xᵒᵈ ≌ Xᵒᵖ

(CategoryTheory.orderDualEquivalence X).counitIso =
  CategoryTheory.Iso.refl
    ({ obj := fun x => OrderDual.toDual (Opposite.unop x), map := fun {X_1 Y} f => CategoryTheory.homOfLE ⋯,
          map_id := ⋯, map_comp := ⋯ }.comp
      { obj := fun x => Opposite.op (OrderDual.ofDual x), map := fun {X_1 Y} f => (CategoryTheory.homOfLE ⋯).op,
        map_id := ⋯, map_comp := ⋯ })


theorem log_prod {α : Type*} (s : Finset α) (f : α → ℝ) (hf : ∀ x ∈ s, f x ≠ 0) :
    log (∏ i ∈ s, f i) = ∑ i ∈ s, log (f i)

{α : Type u_1}
(s : Finset α)
(f : α → ℝ)
(hf : ∀ x ∈ s, f x ≠ 0)

Real.log (∏ i ∈ s, f i) = ∑ i ∈ s, Real.log (f i)


/-- Let `f : α → α` be a (quasi)ergodic map. Let `g : α → X` is a null-measurable function
from `α` to a nonempty space with a countable family of measurable sets
separating points of a set `s` such that `f x ∈ s` for a.e. `x`.
If `g` that is a.e.-invariant under `f`, then `g` is a.e. constant. -/
theorem QuasiErgodic.ae_eq_const_of_ae_eq_comp_of_ae_range₀ [Nonempty X] [MeasurableSpace X]
    {s : Set X} [MeasurableSpace.CountablySeparated s] {f : α → α} {g : α → X}
    (h : QuasiErgodic f μ) (hs : ∀ᵐ x ∂μ, g x ∈ s) (hgm : NullMeasurable g μ)
    (hg_eq : g ∘ f =ᵐ[μ] g) :
    ∃ c, g =ᵐ[μ] const α c

(hgm : MeasureTheory.NullMeasurable g μ)


theorem inclusion_injective (h : p ≤ p') : Function.Injective (inclusion h)

{R : Type u_1}
{M : Type u_2}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{p p' : Submodule R M}
(h : p ≤ p')


@[to_additive]
lemma le_stabilizer_smul_right [SMul α β] [SMulCommClass G α β] (a : α) (b : β) :
    stabilizer G b ≤ stabilizer G (a • b)

{G : Type u_1}
{α : Type u_2}
{β : Type u_3}
[AddGroup G]
[AddAction G β]
[VAdd α β]
[VAddCommClass G α β]
(a : α)
(b : β)

AddAction.stabilizer G b ≤ AddAction.stabilizer G (a +ᵥ b)


@[simp]
theorem inv_iff : IsPrimitiveRoot ζ⁻¹ k ↔ IsPrimitiveRoot ζ k

{G : Type u_3}
[DivisionCommMonoid G]
{k : ℕ}
{ζ : G}


theorem order_of_ne {x : HahnSeries Γ R} (hx : x ≠ 0) :
    order x = x.isWF_support.min (support_nonempty_iff.2 hx)

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]
[Zero Γ]
{x : HahnSeries Γ R}
(hx : x ≠ 0)


theorem map_eq_bind {x : Option α} : x.map f = x.bind (some ∘ f)

∀ {α_1 : Type u_2} {f : α → α_1} {x : Option α}, Option.map f x = x.bind (some ∘ f)


@[to_additive]
theorem MeasurePreserving.mul_left (μ : Measure G) [IsMulLeftInvariant μ] (g : G) {X : Type*}
    [MeasurableSpace X] {μ' : Measure X} {f : X → G} (hf : MeasurePreserving f μ' μ) :
    MeasurePreserving (fun x => g * f x) μ' μ

(hf : MeasureTheory.MeasurePreserving f μ' μ)

MeasureTheory.MeasurePreserving (fun x => g * f x) μ' μ


theorem image2_right_comm {f : δ → γ → ε} {g : α → β → δ} {f' : α → γ → δ'} {g' : δ' → β → ε}
    (h_right_comm : ∀ a b c, f (g a b) c = g' (f' a c) b) :
    image2 f (image2 g s t) u = image2 g' (image2 f' s u) t

{f : δ → γ → ε}

{g : α → β → δ}

(h_right_comm : ∀ (a : α) (b : β) (c : γ), f (g a b) c = g' (f' a c) b)

Set.image2 f (Set.image2 g s t) u = Set.image2 g' (Set.image2 f' s u) t


theorem contDiff_stereoInvFunAux : ContDiff ℝ ⊤ (stereoInvFunAux v)

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
{v : E}


theorem tail_even (s : Stream' α) : tail (even s) = even (tail (tail s))


@[simp]
theorem augment_d_succ_succ (C : ChainComplex V ℕ) {X : V} (f : C.X 0 ⟶ X) (w : C.d 1 0 ≫ f = 0)
    (i j : ℕ) : (augment C f w).d (i + 1) (j + 1) = C.d i j

(C.augment f w).d (i + 1) (j + 1) = C.d i j


lemma uIoc_subset_uIcc : Ι a b ⊆ uIcc a b

{α : Type u_1}
[LinearOrder α]
{a b : α}


@[simp]
theorem sInf_Prop_eq {s : Set Prop} : sInf s = ∀ p ∈ s, p


theorem coeff_X (n : ℕ) : coeff R n (X : R⟦X⟧) = if n = 1 then 1 else 0

(PowerSeries.coeff R n) PowerSeries.X = if n = 1 then 1 else 0


/-- We have that `J(a | b^e) = J(a | b)^e`. -/
theorem pow_right (a : ℤ) (b e : ℕ) : J(a | b ^ e) = J(a | b) ^ e


theorem sum_rec_congr (P : α ⊕ β → Sort*) (f : ∀ i, P (inl i)) (g : ∀ i, P (inr i))
    {x y : α ⊕ β} (h : x = y) :
    @Sum.rec _ _ _ f g x = cast (congr_arg P h.symm) (@Sum.rec _ _ _ f g y)

{α : Type u}
{β : Type v}
(P : α ⊕ β → Sort u_3)
(f : (i : α) → P (Sum.inl i))
(g : (i : β) → P (Sum.inr i))
{x y : α ⊕ β}
(h : x = y)


/-- The angle between a vector and a nonnegative multiple of that vector is 0. -/
@[simp]
theorem oangle_smul_right_self_of_nonneg (x : V) {r : ℝ} (hr : 0 ≤ r) : o.oangle x (r • x) = 0

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


/-- `TrivSqZeroExt.fst` as a continuous linear map. -/
@[simps]
def fstCLM [CommSemiring R] [AddCommMonoid M] [Module R M] : tsze R M →L[R] R

(R : Type u_3)
(M : Type u_4)
[TopologicalSpace R]
[TopologicalSpace M]
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(x : tsze R M)


theorem IsSimpleGroup.derivedSeries_succ {n : ℕ} : derivedSeries G n.succ = commutator G

{G : Type u_1}
[Group G]
[IsSimpleGroup G]
{n : ℕ}


@[simp]
theorem toMul_sub [Div α] (x y : Additive α) : toMul (x - y) = toMul x / toMul y

Additive.toMul (x - y) = Additive.toMul x / Additive.toMul y


@[simp]
theorem basicOpen_eq_of_affine' {R : CommRingCat} (f : Γ(Spec R, ⊤)) :
    (Spec R).basicOpen f = PrimeSpectrum.basicOpen ((Scheme.ΓSpecIso R).hom f)

(f : ↑((AlgebraicGeometry.Spec R).presheaf.obj (Opposite.op ⊤)))

(AlgebraicGeometry.Spec R).basicOpen f = PrimeSpectrum.basicOpen ((AlgebraicGeometry.Scheme.ΓSpecIso R).hom f)


@[simp]
theorem toDual_symm_apply {x : E} {y : NormedSpace.Dual 𝕜 E} : ⟪(toDual 𝕜 E).symm y, x⟫ = y x

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
[CompleteSpace E]
{x : E}
{y : NormedSpace.Dual 𝕜 E}

⟪(InnerProductSpace.toDual 𝕜 E).symm y, x⟫_𝕜 = y x


@[to_additive]
theorem smul_lt_smul_of_lt_of_le [Preorder G] [Preorder P] [SMul G P] [IsOrderedCancelSMul G P]
    {a b : G} {c d : P} (h₁ : a < b) (h₂ : c ≤ d) : a • c < b • d

{G : Type u_1}
{P : Type u_2}
[Preorder G]
[Preorder P]
[VAdd G P]
[IsOrderedCancelVAdd G P]
{a b : G}
{c d : P}
(h₁ : a < b)
(h₂ : c ≤ d)


theorem exp_conj (U : Matrix m m 𝔸) (A : Matrix m m 𝔸) (hy : IsUnit U) :
    exp 𝕂 (U * A * U⁻¹) = U * exp 𝕂 A * U⁻¹

(𝕂 : Type u_1)
{m : Type u_2}
{𝔸 : Type u_6}
[RCLike 𝕂]
[Fintype m]
[DecidableEq m]
[NormedCommRing 𝔸]
[NormedAlgebra 𝕂 𝔸]
[CompleteSpace 𝔸]
(U A : Matrix m m 𝔸)
(hy : IsUnit U)

NormedSpace.exp 𝕂 (U * A * U⁻¹) = U * NormedSpace.exp 𝕂 A * U⁻¹


@[simp]
theorem isUnit_map_iff (f : R →+* S) [IsLocalRingHom f] (a) : IsUnit (f a) ↔ IsUnit a

{R : Type u_1}
{S : Type u_2}
[Semiring R]
[Semiring S]
(f : R →+* S)
[IsLocalRingHom f]
(a : R)


theorem range_subset_idealRange : (f.range : Set L') ⊆ f.idealRange

{R : Type u}
{L : Type v}
{L' : Type w₂}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieRing L']
[LieAlgebra R L']
(f : L →ₗ⁅R⁆ L')


/-- The trivial zeroes of the zeta function. -/
theorem riemannZeta_neg_two_mul_nat_add_one (n : ℕ) : riemannZeta (-2 * (n + 1)) = 0


theorem mapsTo_preimage (f : α → β) (t : Set β) : MapsTo f (f ⁻¹' t) t

{α : Type u}
{β : Type v}
(f : α → β)
(t : Set β)


theorem IsOpen.interior_eq (h : IsOpen s) : interior s = s

{X : Type u}
{s : Set X}
[TopologicalSpace X]
(h : IsOpen s)


theorem Applicative.ext {F} :
    ∀ {A1 : Applicative F} {A2 : Applicative F} [@LawfulApplicative F A1] [@LawfulApplicative F A2],
      (∀ {α : Type u} (x : α), @Pure.pure _ A1.toPure _ x = @Pure.pure _ A2.toPure _ x) →
      (∀ {α β : Type u} (f : F (α → β)) (x : F α),
          @Seq.seq _ A1.toSeq _ _ f (fun _ => x) = @Seq.seq _ A2.toSeq _ _ f (fun _ => x)) →
      A1 = A2

{F : Type u → Type u_1}
{A1 A2 : Applicative F}
[LawfulApplicative F]
[LawfulApplicative F]

(∀ {α : Type u} (x : α), pure x = pure x) →
  (∀ {α β : Type u} (f : F (α → β)) (x : F α), (Seq.seq f fun x_1 => x) = Seq.seq f fun x_1 => x) → A1 = A2


@[simp] lemma head_add (a b : Fin n.succ → α) : vecHead (a + b) = vecHead a + vecHead b

{α : Type u_1}
{n : ℕ}
[Add α]
(a b : Fin n.succ → α)

Matrix.vecHead (a + b) = Matrix.vecHead a + Matrix.vecHead b


@[simp, norm_cast]
theorem coe_neg (x : s) : (↑(-x) : R) = -↑x

{R : Type u}
[Ring R]
(s : Subring R)
(x : ↥s)


@[simp]
theorem compLeft_apply (B : BilinForm R M) (f : M →ₗ[R] M) (v w) : B.compLeft f v w = B (f v) w

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(B : LinearMap.BilinForm R M)
(f : M →ₗ[R] M)
(v w : M)


@[simp]
theorem sub_left (ha : SemiconjBy a x y) (hb : SemiconjBy b x y) :
    SemiconjBy (a - b) x y

{R : Type x}
[NonUnitalNonAssocRing R]
{a b x y : R}
(ha : SemiconjBy a x y)
(hb : SemiconjBy b x y)


theorem compl_singleton_mem_nhds [T1Space X] {x y : X} (h : y ≠ x) : {x}ᶜ ∈ 𝓝 y

{X : Type u_1}
[TopologicalSpace X]
[T1Space X]
{x y : X}
(h : y ≠ x)


protected theorem mul_pos {n m : Nat} (ha : n > 0) (hb : m > 0) : n * m > 0


theorem card_pi {β : α → Type*} [Fintype α] : Nat.card (∀ a, β a) = ∏ a, Nat.card (β a)

{α : Type u_1}
{β : α → Type u_3}
[Fintype α]

Nat.card ((a : α) → β a) = ∏ a : α, Nat.card (β a)


theorem ofBool_append (msb : Bool) (lsbs : BitVec w) :
    ofBool msb ++ lsbs = (cons msb lsbs).cast (Nat.add_comm ..)

{w : Nat}
(msb : Bool)
(lsbs : BitVec w)

BitVec.ofBool msb ++ lsbs = BitVec.cast ⋯ (BitVec.cons msb lsbs)


/-- Any two `IsKleinFour` groups are isomorphic. -/
@[to_additive "Any two `IsAddKleinFour` groups are isomorphic."]
lemma nonempty_mulEquiv [IsKleinFour G₂] : Nonempty (G₁ ≃* G₂)

{G₁ : Type u_2}
{G₂ : Type u_3}
[Group G₁]
[Group G₂]
[IsKleinFour G₁]
[IsKleinFour G₂]


theorem isIntegral_algebra [Algebra R A] [IsScalarTower R A B] : Algebra.IsIntegral R A

(R : Type u_1)
{A : Type u_2}
(B : Type u_3)
[CommRing R]
[CommRing A]
[CommRing B]
[Algebra R B]
[Algebra A B]
[IsIntegralClosure A R B]
[Algebra R A]
[IsScalarTower R A B]


/-- A nonnegative multiple of a vector is in the same ray as that vector. -/
lemma sameRay_nonneg_smul_left (v : M) (ha : 0 ≤ a) : SameRay R (a • v) v

{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{S : Type u_5}
[OrderedCommSemiring S]
[Algebra S R]
[Module S M]
[SMulPosMono S R]
[IsScalarTower S R M]
{a : S}
(v : M)
(ha : 0 ≤ a)


theorem exp_log_eq_abs (hx : x ≠ 0) : exp (log x) = |x|


/--
A function `f : α → ℓ^∞(ι, ℝ)` which is `K`-Lipschitz on a subset `s` admits a `K`-Lipschitz
extension to the whole space.

Theorem 2.2 of [Assaf Naor, *Metric Embeddings and Lipschitz Extensions*][Naor-2015]

The same result for the case of a finite type `ι` is implemented in
`LipschitzOnWith.extend_pi`.
-/
theorem LipschitzOnWith.extend_lp_infty [PseudoMetricSpace α] {s : Set α} {ι : Type*}
    {f : α → ℓ^∞(ι)} {K : ℝ≥0} (hfl : LipschitzOnWith K f s) :
    ∃ g : α → ℓ^∞(ι), LipschitzWith K g ∧ EqOn f g s

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
{ι : Type u_1}
{f : α → ↥(lp (fun i => ℝ) ⊤)}
{K : ℝ≥0}
(hfl : LipschitzOnWith K f s)


@[simp 1100]
theorem comap_abs_nhds_zero : comap abs (𝓝 0) = 𝓝 0

Filter.comap (⇑Complex.abs) (nhds 0) = nhds 0


theorem addVal_def' (u : Rˣ) {ϖ : R} (hϖ : Irreducible ϖ) (n : ℕ) :
    addVal R ((u : R) * ϖ ^ n) = n

{R : Type u_1}
[CommRing R]
[IsDomain R]
[DiscreteValuationRing R]
(u : Rˣ)
{ϖ : R}
(hϖ : Irreducible ϖ)
(n : ℕ)

(DiscreteValuationRing.addVal R) (↑u * ϖ ^ n) = ↑n


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

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


theorem mul_splits_in_splittingField_of_mul {p₁ q₁ p₂ q₂ : F[X]} (hq₁ : q₁ ≠ 0) (hq₂ : q₂ ≠ 0)
    (h₁ : p₁.Splits (algebraMap F q₁.SplittingField))
    (h₂ : p₂.Splits (algebraMap F q₂.SplittingField)) :
    (p₁ * p₂).Splits (algebraMap F (q₁ * q₂).SplittingField)

(h₁ : Polynomial.Splits (algebraMap F q₁.SplittingField) p₁)

(h₂ : Polynomial.Splits (algebraMap F q₂.SplittingField) p₂)

Polynomial.Splits (algebraMap F (q₁ * q₂).SplittingField) (p₁ * p₂)


/-- Similar to `prod`, but both functors start from the same category `A` -/
@[simps]
def prod' (F : A ⥤ B) (G : A ⥤ C) : A ⥤ B × C

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
(F : CategoryTheory.Functor A B)
(G : CategoryTheory.Functor A C)
(a : A)


@[simp]
theorem inter_singleton_of_mem {a : α} {s : Finset α} (h : a ∈ s) : s ∩ {a} = {a}

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


theorem or_right_comm : ∀ (x y z : Bool), ((x || y) || z) = ((x || z) || y)


theorem IsEquivalent.isTheta_symm (h : u ~[l] v) : v =Θ[l] u

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


theorem map_birkhoffAverage (S : Type*) {F N : Type*}
    [DivisionSemiring S] [AddCommMonoid N] [Module S N] [FunLike F M N]
    [AddMonoidHomClass F M N] (g' : F) (f : α → α) (g : α → M) (n : ℕ) (x : α) :
    g' (birkhoffAverage R f g n x) = birkhoffAverage S f (g' ∘ g) n x

(R : Type u_1)
{α : Type u_2}
{M : Type u_3}
[DivisionSemiring R]
[AddCommMonoid M]
[Module R M]
(S : Type u_4)
{F : Type u_5}
{N : Type u_6}
[DivisionSemiring S]
[AddCommMonoid N]
[Module S N]
[FunLike F M N]
[AddMonoidHomClass F M N]
(g' : F)
(f : α → α)
(g : α → M)
(n : ℕ)
(x : α)

g' (birkhoffAverage R f g n x) = birkhoffAverage S f (⇑g' ∘ g) n x


@[simp]
theorem snd_mul [Mul R] [Add M] [SMul R M] [SMul Rᵐᵒᵖ M] (x₁ x₂ : tsze R M) :
    (x₁ * x₂).snd = x₁.fst •> x₂.snd + x₁.snd <• x₂.fst

{R : Type u}
{M : Type v}
[Mul R]
[Add M]
[SMul R M]
[SMul Rᵐᵒᵖ M]
(x₁ x₂ : tsze R M)


@[to_additive (attr := simp)]
theorem closure_closure_coe_preimage {k : Set G} : closure (((↑) : closure k → G) ⁻¹' k) = ⊤

AddSubgroup.closure (Subtype.val ⁻¹' k) = ⊤


/-- We say that `X` and `Y` are a locally compact pair of topological spaces,
if for any continuous map `f : X → Y`, a point `x : X`, and a neighbourhood `s ∈ 𝓝 (f x)`,
there exists a compact neighbourhood `K ∈ 𝓝 x` such that `f` maps `K` to `s`.

This is a technical assumption that appears in several theorems,
most notably in `ContinuousMap.continuous_comp'` and `ContinuousMap.continuous_eval`.
It is satisfied in two cases:

- if `X` is a locally compact topological space, for obvious reasons;
- if `X` is a weakly locally compact topological space and `Y` is an R₁ space;
  this fact is a simple generalization of the theorem
  saying that a weakly locally compact R₁ topological space is locally compact.
-/
class LocallyCompactPair (X Y : Type*) [TopologicalSpace X] [TopologicalSpace Y] : Prop where
  /-- If `f : X → Y` is a continuous map in a locally compact pair of topological spaces
  and `s : Set Y` is a neighbourhood of `f x`, `x : X`,
  then there exists a compact neighbourhood `K` of `x` such that `f` maps `K` to `s`. -/
  exists_mem_nhds_isCompact_mapsTo : ∀ {f : X → Y} {x : X} {s : Set Y},
    Continuous f → s ∈ 𝓝 (f x) → ∃ K ∈ 𝓝 x, IsCompact K ∧ Set.MapsTo f K s

{X : Type u_3}
{Y : Type u_4}
[TopologicalSpace X]
[TopologicalSpace Y]
[self : LocallyCompactPair X Y]
{f : X → Y}
{x : X}
{s : Set Y}


theorem IsAdjointPair.mul {f g f' g' : Module.End R M} (h : IsAdjointPair B B f g)
    (h' : IsAdjointPair B B f' g') : IsAdjointPair B B (f * f') (g' * g)

{R : Type u_1}
{M : Type u_5}
{M₃ : Type u_8}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid M₃]
[Module R M₃]
{I : R →+* R}
{B : M →ₗ[R] M →ₛₗ[I] M₃}
{f g f' g' : Module.End R M}
(h : B.IsAdjointPair B f g)
(h' : B.IsAdjointPair B f' g')


theorem comap_bracket_le {J₁ J₂ : LieIdeal R L'} : ⁅comap f J₁, comap f J₂⁆ ≤ comap f ⁅J₁, J₂⁆

{R : Type u}
{L : Type v}
{L' : Type w₂}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieRing L']
[LieAlgebra R L']
(f : L →ₗ⁅R⁆ L')
{J₁ J₂ : LieIdeal R L'}

⁅LieIdeal.comap f J₁, LieIdeal.comap f J₂⁆ ≤ LieIdeal.comap f ⁅J₁, J₂⁆


@[to_additive (attr := simp)]
theorem comap_subtype (H K : Subgroup G) : H.comap K.subtype = H.subgroupOf K

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

Subgroup.comap K.subtype H = H.subgroupOf K


@[simp]
theorem vandermonde_cons {n : ℕ} (v0 : R) (v : Fin n → R) :
    vandermonde (Fin.cons v0 v : Fin n.succ → R) =
      Fin.cons (fun (j : Fin n.succ) => v0 ^ (j : ℕ)) fun i => Fin.cons 1
      fun j => v i * vandermonde v i j

{R : Type u_1}
[CommRing R]
{n : ℕ}
(v0 : R)
(v : Fin n → R)

Matrix.vandermonde (Fin.cons v0 v) =
  Fin.cons (fun j => v0 ^ ↑j) fun i => Fin.cons 1 fun j => v i * Matrix.vandermonde v i j


lemma stalkMap_comp (x : X) :
    (f ≫ g : X ⟶ Z).stalkMap x = g.stalkMap (f.val.base x) ≫ f.stalkMap x

{X Y Z : AlgebraicGeometry.LocallyRingedSpace}

AlgebraicGeometry.LocallyRingedSpace.Hom.stalkMap (f ≫ g) x =
  AlgebraicGeometry.LocallyRingedSpace.Hom.stalkMap g (f.val.base x) ≫
    AlgebraicGeometry.LocallyRingedSpace.Hom.stalkMap f x


theorem IsOpen.sdiff (h₁ : IsOpen s) (h₂ : IsClosed t) : IsOpen (s \ t)

{X : Type u}
{s t : Set X}
[TopologicalSpace X]
(h₁ : IsOpen s)
(h₂ : IsClosed t)


@[to_additive] lemma antivary_inv : Antivary f⁻¹ g⁻¹ ↔ Antivary f g

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedCommGroup α]
[OrderedCommGroup β]
{f : ι → α}
{g : ι → β}


@[simp] theorem mk_zero : (⟨0, Nat.succ_pos n⟩ : Fin (n + 1)) = 0


@[ext] protected lemma AddContent.ext (h : ∀ s, m s = m' s) : m = m'

{α : Type u_1}
{C : Set (Set α)}
{m m' : MeasureTheory.AddContent C}
(h : ∀ (s : Set α), m s = m' s)


theorem Disjoint.support_mul (h : Disjoint f g) : (f * g).support = f.support ∪ g.support

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{f g : Equiv.Perm α}
(h : f.Disjoint g)


lemma succAbove_ne_zero [NeZero n] {a : Fin (n + 1)} {b : Fin n} (ha : a ≠ 0) (hb : b ≠ 0) :
    a.succAbove b ≠ 0

{n : ℕ}
[NeZero n]
{a : Fin (n + 1)}
{b : Fin n}
(ha : a ≠ 0)
(hb : b ≠ 0)


lemma isVonNBounded_iff_tendsto_smallSets_nhds {𝕜 E : Type*} [NormedDivisionRing 𝕜]
    [AddCommGroup E] [Module 𝕜 E] [TopologicalSpace E] {S : Set E} :
    IsVonNBounded 𝕜 S ↔ Tendsto (· • S : 𝕜 → Set E) (𝓝 0) (𝓝 0).smallSets

{𝕜 : Type u_7}
{E : Type u_8}
[NormedDivisionRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
{S : Set E}

Bornology.IsVonNBounded 𝕜 S ↔ Filter.Tendsto (fun x => x • S) (𝓝 0) (𝓝 0).smallSets


@[simp]
lemma ε_app_f_succ [Limits.HasZeroObject C] (X : SimplicialObject.Augmented C) (n : ℕ) :
    (ε.app X).f (n + 1) = 0

(X : CategoryTheory.SimplicialObject.Augmented C)

(AlgebraicTopology.AlternatingFaceMapComplex.ε.app X).f (n + 1) = 0


@[continuity]
protected theorem continuous (e : M₁ ≃SL[σ₁₂] M₂) : Continuous (e : M₁ → M₂)

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


/-- `id` as a `SupBotHom`. -/
@[simps]
protected def id : SupBotHom α α


/-- The standard one-dimensional simplex in `Fin 2 → 𝕜` is equivalent to the unit interval. -/
@[simps (config := .asFn)]
def stdSimplexEquivIcc : stdSimplex 𝕜 (Fin 2) ≃ Icc (0 : 𝕜) 1

(𝕜 : Type u_1)
[OrderedRing 𝕜]
(x : ↑(Set.Icc 0 1))

↑((stdSimplexEquivIcc 𝕜).symm x) = ![↑x, 1 - ↑x]


/-- Let `s` be a bounded set in the space of continuous (semi)linear maps `E →SL[σ] F` taking values
in a proper space. If `s` interpreted as a set in the space of maps `E → F` with topology of
pointwise convergence is closed, then it is compact.

TODO: reformulate this in terms of a type synonym with the right topology. -/
theorem isCompact_image_coe_of_bounded_of_closed_image [ProperSpace F] {s : Set (E' →SL[σ₁₂] F)}
    (hb : IsBounded s) (hc : IsClosed (((↑) : (E' →SL[σ₁₂] F) → E' → F) '' s)) :
    IsCompact (((↑) : (E' →SL[σ₁₂] F) → E' → F) '' s)

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{F : Type u_6}
[NormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
{E' : Type u_11}
[SeminormedAddCommGroup E']
[NormedSpace 𝕜 E']
[RingHomIsometric σ₁₂]
[ProperSpace F]
{s : Set (E' →SL[σ₁₂] F)}
(hb : Bornology.IsBounded s)
(hc : IsClosed (DFunLike.coe '' s))


lemma integral_tilted (f : α → ℝ) (g : α → E) :
    ∫ x, g x ∂(μ.tilted f) = ∫ x, (exp (f x) / ∫ x, exp (f x) ∂μ) • (g x) ∂μ

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

∫ (x : α), g x ∂μ.tilted f = ∫ (x : α), (rexp (f x) / ∫ (x : α), rexp (f x) ∂μ) • g x ∂μ


theorem comp_assoc (φ₁ : C →ₗc[R] D) (φ₂ : B →ₗc[R] C) (φ₃ : A →ₗc[R] B) :
    (φ₁.comp φ₂).comp φ₃ = φ₁.comp (φ₂.comp φ₃)

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
{D : Type u_5}
[CommSemiring R]
[AddCommMonoid A]
[Module R A]
[AddCommMonoid B]
[Module R B]
[AddCommMonoid C]
[Module R C]
[AddCommMonoid D]
[Module R D]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
[CoalgebraStruct R C]
[CoalgebraStruct R D]
(φ₁ : C →ₗc[R] D)
(φ₂ : B →ₗc[R] C)
(φ₃ : A →ₗc[R] B)


/-- An affine subspace constructed from a point and a direction contains the result of adding a
vector in that direction to that point. -/
theorem vadd_mem_mk' {v : V} (p : P) {direction : Submodule k V} (hv : v ∈ direction) :
    v +ᵥ p ∈ mk' p direction

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


/-- An equivalence between `MonoOver A` and `MonoOver B` gives an equivalence
between `Subobject A` and `Subobject B`. -/
@[simps]
def lowerEquivalence {A : C} {B : D} (e : MonoOver A ≌ MonoOver B) : Subobject A ≌ Subobject B

(e : CategoryTheory.MonoOver A ≌ CategoryTheory.MonoOver B)

(CategoryTheory.Subobject.lowerEquivalence e).counitIso = CategoryTheory.eqToIso ⋯


@[to_additive]
theorem mk'_eq_iff_eq' {x₁ x₂} {y₁ y₂ : S} :
    f.mk' x₁ y₁ = f.mk' x₂ y₂ ↔ f.toMap (x₁ * y₂) = f.toMap (x₂ * y₁)

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
(f : S.LocalizationMap N)
{x₁ x₂ : M}
{y₁ y₂ : ↥S}

f.mk' x₁ y₁ = f.mk' x₂ y₂ ↔ f.toMap (x₁ * ↑y₂) = f.toMap (x₂ * ↑y₁)


/-- Proves that Bertrand's postulate holds over all positive naturals less than n by identifying a
descending list of primes, each no more than twice the next, such that the list contains a witness
for each number ≤ n.
-/
theorem exists_prime_lt_and_le_two_mul_succ {n} (q) {p : ℕ} (prime_p : Nat.Prime p)
    (covering : p ≤ 2 * q) (H : n < q → ∃ p : ℕ, p.Prime ∧ n < p ∧ p ≤ 2 * n) (hn : n < p) :
    ∃ p : ℕ, p.Prime ∧ n < p ∧ p ≤ 2 * n

(H : n < q → ∃ p, Nat.Prime p ∧ n < p ∧ p ≤ 2 * n)


theorem not_isRightInversion_mul_left_iff {w : W} :
    ¬cs.IsRightInversion (w * t) t ↔ cs.IsRightInversion w t

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
{cs : CoxeterSystem M W}
{t : W}
(ht : cs.IsReflection t)
{w : W}


@[simp]
lemma opcyclesMap_zero : opcyclesMap (0 : K ⟶ L) i = 0


@[simp]
theorem Nonempty.image_const {s : Set α} (hs : s.Nonempty) (a : β) : (fun _ => a) '' s = {a}

{α : Type u_1}
{β : Type u_2}
{s : Set α}
(hs : s.Nonempty)
(a : β)


@[simp]
theorem Nodup.ndinter {s : Multiset α} (t : Multiset α) : Nodup s → Nodup (ndinter s t)

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


/-- `Equiv.curry` for `p`-ary heterogeneous functions. -/
@[simps]
def curryEquiv (p : Fin n → Type u) : (((i : Fin n) → p i) → τ) ≃ FromTypes p τ

{n : ℕ}
{τ : Type u}
(p : Fin n → Type u)
(f : Function.FromTypes p τ)

∀ (a : (i : Fin n) → p i), (Function.FromTypes.curryEquiv p).symm f a = f.uncurry a


@[to_additive]
theorem prod_mapRange_index {f : M → M'} {hf : f 0 = 0} {g : α →₀ M} {h : α → M' → N}
    (h0 : ∀ a, h a 0 = 1) : (mapRange f hf g).prod h = g.prod fun a b => h a (f b)

{α : Type u_1}
{M : Type u_8}
{M' : Type u_9}
{N : Type u_10}
[Zero M]
[Zero M']
[CommMonoid N]
{f : M → M'}
{hf : f 0 = 0}
{g : α →₀ M}
{h : α → M' → N}
(h0 : ∀ (a : α), h a 0 = 1)

(Finsupp.mapRange f hf g).prod h = g.prod fun a b => h a (f b)


@[simp]
theorem _root_.Ideal.span_singleton_generator (I : Ideal R) [I.IsPrincipal] :
    Ideal.span ({generator I} : Set R) = I

{R : Type u}
[Ring R]
(I : Ideal R)
[Submodule.IsPrincipal I]

Ideal.span {Submodule.IsPrincipal.generator I} = I


/-- **Fubini's Theorem**: For integrable functions on `α × β`,
  the Bochner integral of `f` is equal to the iterated Bochner integral.
  `integrable_prod_iff` can be useful to show that the function in question in integrable.
  `MeasureTheory.Integrable.integral_prod_right` is useful to show that the inner integral
  of the right-hand side is integrable. -/
theorem integral_prod (f : α × β → E) (hf : Integrable f (μ.prod ν)) :
    ∫ z, f z ∂μ.prod ν = ∫ x, ∫ y, f (x, y) ∂ν ∂μ

(hf : MeasureTheory.Integrable f (μ.prod ν))

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


theorem le_of_opNorm_le_of_le {x} {a b : ℝ} (hf : ‖f‖ ≤ a) (hx : ‖x‖ ≤ b) :
    ‖f x‖ ≤ a * b

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[RingHomIsometric σ₁₂]
(f : E →SL[σ₁₂] F)
{x : E}
{a b : ℝ}
(hf : ‖f‖ ≤ a)
(hx : ‖x‖ ≤ b)


@[simp]
lemma term_of_ne_zero {n : ℕ} (hn : n ≠ 0) (f : ℕ → ℂ) (s : ℂ) :
    term f s n = f n / n ^ s


@[simp]
theorem pellZd_im (n : ℕ) : (pellZd a1 n).im = yn a1 n


/-- Inversion sends an affine subspace passing through the center to itself. -/
theorem image_inversion_affineSubspace_of_mem {p : AffineSubspace ℝ P} (hR : R ≠ 0) (hp : c ∈ p) :
    inversion c R '' p = p

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{c : P}
{R : ℝ}
{p : AffineSubspace ℝ P}
(hR : R ≠ 0)
(hp : c ∈ p)

EuclideanGeometry.inversion c R '' ↑p = ↑p


/-- Given any triangle in an orthocentric system, the fourth point is
its orthocenter. -/
theorem OrthocentricSystem.eq_insert_orthocenter {s : Set P} (ho : OrthocentricSystem s)
    {t : Triangle ℝ P} (ht : Set.range t.points ⊆ s) :
    s = insert t.orthocenter (Set.range t.points)

(ho : EuclideanGeometry.OrthocentricSystem s)


@[simp] theorem neg_cons : (- (x::xs : IntList)) = -x :: -xs


theorem comp [FormallyUnramified R A] [FormallyUnramified A B] :
    FormallyUnramified R 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 A]
[Algebra.FormallyUnramified A B]


@[simp] lemma smul_one_eq_cast (q : ℚ≥0) : q • (1 : α) = q

(α : Type u_1)
[DivisionSemiring α]
(q : ℚ≥0)


@[deprecated Nat.mul_le_mul_left (since := "2024-02-19")]
protected theorem mul_le_mul_of_nonneg_left {a b c : Nat} : a ≤ b → c * a ≤ c * b


@[simp, norm_cast]
theorem coe_zero : ⇑(0 : P1 →ᵃ[k] V2) = 0

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
{V2 : Type u_4}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
[AddCommGroup V2]
[Module k V2]


@[to_additive (attr := simp)]
theorem mulRight_symm (a : G) : (Equiv.mulRight a).symm = Equiv.mulRight a⁻¹

Equiv.symm (Equiv.mulRight a) = Equiv.mulRight a⁻¹


lemma natDegree_Φ_le (n : ℤ) : (W.Φ n).natDegree ≤ n.natAbs ^ 2

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
(n : ℤ)


theorem coe_mapLinearMap {X Y : C} : ⇑(F.mapLinearMap R : (X ⟶ Y) →ₗ[R] _) = F.map

(R : Type u_1)
[Semiring R]
{C : Type u_2}
{D : Type u_3}
[CategoryTheory.Category.{u_4, u_2} C]
[CategoryTheory.Category.{u_5, u_3} D]
[CategoryTheory.Preadditive C]
[CategoryTheory.Preadditive D]
[CategoryTheory.Linear R C]
[CategoryTheory.Linear R D]
(F : CategoryTheory.Functor C D)
[F.Additive]
[CategoryTheory.Functor.Linear R F]
{X Y : C}

⇑(CategoryTheory.Functor.mapLinearMap R F) = F.map


/-- **Sylvester's law of inertia**: A real quadratic form is equivalent to a weighted
sum of squares with the weights being ±1 or 0, `SignType` version. -/
theorem equivalent_signType_weighted_sum_squared {M : Type*} [AddCommGroup M] [Module ℝ M]
    [FiniteDimensional ℝ M] (Q : QuadraticForm ℝ M) :
    ∃ w : Fin (FiniteDimensional.finrank ℝ M) → SignType,
      Equivalent Q (weightedSumSquares ℝ fun i ↦ (w i : ℝ))

{M : Type u_2}
[AddCommGroup M]
[Module ℝ M]
[FiniteDimensional ℝ M]
(Q : QuadraticForm ℝ M)

∃ w, QuadraticMap.Equivalent Q (QuadraticMap.weightedSumSquares ℝ fun i => ↑(w i))


/-- Like `Finsupp.mapDomain_zero`, but for the `1` we define in this file -/
@[simp]
theorem mapDomain_one {α : Type*} {β : Type*} {α₂ : Type*} [Semiring β] [One α] [One α₂]
    {F : Type*} [FunLike F α α₂] [OneHomClass F α α₂] (f : F) :
    (mapDomain f (1 : MonoidAlgebra β α) : MonoidAlgebra β α₂) = (1 : MonoidAlgebra β α₂)

{α : Type u_3}
{β : Type u_4}
{α₂ : Type u_5}
[Semiring β]
[One α]
[One α₂]
{F : Type u_6}
[FunLike F α α₂]
[OneHomClass F α α₂]
(f : F)


theorem unit_app_inverse (e : C ≌ D) (Y : D) :
    e.unit.app (e.inverse.obj Y) = e.inverse.map (e.counitInv.app Y)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(e : C ≌ D)
(Y : D)


theorem top_mul' : ∞ * a = if a = 0 then 0 else ∞


@[simp, norm_cast]
theorem coe_smul_circle (z : circle) (w : 𝔻) : ↑(z • w) = (z * w : ℂ)


@[simp]
theorem lsub_eq_zero_iff {ι : Type u} (f : ι → Ordinal.{max u v}) :
    lsub.{_, v} f = 0 ↔ IsEmpty ι


lemma isIso_iff_of_reflects_iso {A B : C} (f : A ⟶ B) (F : C ⥤ D) [F.ReflectsIsomorphisms] :
    IsIso (F.map f) ↔ IsIso f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{A B : C}
(f : A ⟶ B)
(F : C ⥤ D)
[F.ReflectsIsomorphisms]

CategoryTheory.IsIso (F.map f) ↔ CategoryTheory.IsIso f


@[to_additive]
protected theorem Filter.EventuallyEq.mulIndicator [One β] {l : Filter α} {f g : α → β} {s : Set α}
    (hfg : f =ᶠ[l] g) : s.mulIndicator f =ᶠ[l] s.mulIndicator g

{α : Type u_1}
{β : Type u_2}
[Zero β]
{l : Filter α}
{f g : α → β}
{s : Set α}
(hfg : f =ᶠ[l] g)


/-- A one-dimensional formal multilinear series representing a locally zero function is zero. -/
theorem HasFPowerSeriesAt.eq_zero_of_eventually {p : FormalMultilinearSeries 𝕜 𝕜 E} {f : 𝕜 → E}
    {x : 𝕜} (hp : HasFPowerSeriesAt f p x) (hf : f =ᶠ[𝓝 x] 0) : p = 0

{𝕜 : Type u_1}
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{p : FormalMultilinearSeries 𝕜 𝕜 E}
{f : 𝕜 → E}
{x : 𝕜}
(hp : HasFPowerSeriesAt f p x)
(hf : f =ᶠ[𝓝 x] 0)


@[simp]
theorem comp_left : (f ≫ g).left = f.left ≫ g.left

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
{L : CategoryTheory.Functor A T}
{R : CategoryTheory.Functor B T}
{X Y Z : CategoryTheory.Comma L R}
{f : X ⟶ Y}
{g : Y ⟶ Z}

(CategoryTheory.CategoryStruct.comp f g).left = CategoryTheory.CategoryStruct.comp f.left g.left


@[to_additive (attr := simp)]
theorem mulSingle_one (i : I) : mulSingle i (1 : f i) = 1

{I : Type u}
{f : I → Type v₁}
[DecidableEq I]
[(i : I) → Zero (f i)]
(i : I)


theorem comap_eval_neBot_iff' {ι : Type*} {α : ι → Type*} {i : ι} {f : Filter (α i)} :
    (comap (eval i) f).NeBot ↔ (∀ j, Nonempty (α j)) ∧ NeBot f

{ι : Type u_2}
{α : ι → Type u_3}
{i : ι}
{f : Filter (α i)}

(Filter.comap (Function.eval i) f).NeBot ↔ (∀ (j : ι), Nonempty (α j)) ∧ f.NeBot


@[simp]
lemma negOnePow_zero : negOnePow 0 = 1


theorem prod_dvd_prod_of_subset_of_dvd [AddCommMonoid M] [CommMonoid N] {f1 f2 : α →₀ M}
    {g1 g2 : α → M → N} (h1 : f1.support ⊆ f2.support)
    (h2 : ∀ a : α, a ∈ f1.support → g1 a (f1 a) ∣ g2 a (f2 a)) : f1.prod g1 ∣ f2.prod g2

(h2 : ∀ a ∈ f1.support, g1 a (f1 a) ∣ g2 a (f2 a))


/-- A slight strengthening of `exists_nontrivial_relation_sum_zero_of_rank_succ_lt_card`
available when working over an ordered field:
we can ensure a positive coefficient, not just a nonzero coefficient.
-/
theorem exists_relation_sum_zero_pos_coefficient_of_finrank_succ_lt_card [FiniteDimensional L W]
    {t : Finset W} (h : finrank L W + 1 < t.card) :
    ∃ f : W → L, ∑ e ∈ t, f e • e = 0 ∧ ∑ e ∈ t, f e = 0 ∧ ∃ x ∈ t, 0 < f x

(h : FiniteDimensional.finrank L W + 1 < t.card)

∃ f, ∑ e ∈ t, f e • e = 0 ∧ ∑ e ∈ t, f e = 0 ∧ ∃ x ∈ t, 0 < f x


theorem equiv_apply (x : L) (n : ℕ) (y : K) (h : i y = x ^ p ^ n) :
    equiv i j p x = (iterateFrobeniusEquiv M p n).symm (j y)

{K : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing K]
[CommRing L]
[CommRing M]
(i : K →+* L)
(j : K →+* M)
(p : ℕ)
[ExpChar K p]
[ExpChar L p]
[ExpChar M p]
[PerfectRing L p]
[IsPerfectClosure i p]
[PerfectRing M p]
[IsPerfectClosure j p]
(x : L)
(n : ℕ)
(y : K)
(h : i y = x ^ p ^ n)

(IsPerfectClosure.equiv i j p) x = (iterateFrobeniusEquiv M p n).symm (j y)


theorem HasDerivAt.cexp (hf : HasDerivAt f f' x) :
    HasDerivAt (fun x => Complex.exp (f x)) (Complex.exp (f x) * f') x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[NormedAlgebra 𝕜 ℂ]
{f : 𝕜 → ℂ}
{f' : ℂ}
{x : 𝕜}
(hf : HasDerivAt f f' x)


@[to_additive]
theorem comap_inf (S T : Submonoid N) (f : F) : (S ⊓ T).comap f = S.comap f ⊓ T.comap f

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
{F : Type u_4}
[FunLike F M N]
[mc : AddMonoidHomClass F M N]
(S T : AddSubmonoid N)
(f : F)

AddSubmonoid.comap f (S ⊓ T) = AddSubmonoid.comap f S ⊓ AddSubmonoid.comap f T


@[simp]
lemma piecewise_apply_left {C₁ C₂ : Set X} (h₁ : IsClosed C₁) (h₂ : IsClosed C₂)
    (h : C₁ ∪ C₂ = Set.univ) (f : LocallyConstant C₁ Z) (g : LocallyConstant C₂ Z)
    (hfg : ∀ (x : X) (hx : x ∈ C₁ ∩ C₂), f ⟨x, hx.1⟩ = g ⟨x, hx.2⟩)
    [DecidablePred (· ∈ C₁)] (x : X) (hx : x ∈ C₁) :
    piecewise h₁ h₂ h f g hfg x = f ⟨x, hx⟩

(hfg : ∀ (x : X) (hx : x ∈ C₁ ∩ C₂), f ⟨x, ⋯⟩ = g ⟨x, ⋯⟩)

(LocallyConstant.piecewise h₁ h₂ h f g hfg) x = f ⟨x, hx⟩


theorem integralNormalization_eval₂_eq_zero {p : R[X]} (f : R →+* S) {z : S} (hz : eval₂ f z p = 0)
    (inj : ∀ x : R, f x = 0 → x = 0) :
    eval₂ f (z * f p.leadingCoeff) (integralNormalization p) = 0

{R : Type u}
{S : Type v}
[CommRing R]
[IsDomain R]
[CommSemiring S]
{p : R[X]}
(f : R →+* S)
{z : S}
(hz : Polynomial.eval₂ f z p = 0)
(inj : ∀ (x : R), f x = 0 → x = 0)

Polynomial.eval₂ f (z * f p.leadingCoeff) p.integralNormalization = 0


/-- `Polynomial.C` as an `AlgHom`. -/
@[simps! apply]
def CAlgHom : A →ₐ[R] A[X]

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

∀ (a : A), Polynomial.CAlgHom a = Polynomial.C a


@[to_additive]
theorem pow_smul_mem_closure_smul {N : Type*} [CommMonoid N] [MulAction M N] [IsScalarTower M N N]
    (r : M) (s : Set N) {x : N} (hx : x ∈ closure s) : ∃ n : ℕ, r ^ n • x ∈ closure (r • s)

{M : Type u_3}
[Monoid M]
{N : Type u_6}
[CommMonoid N]
[MulAction M N]
[IsScalarTower M N N]
(r : M)
(s : Set N)
{x : N}
(hx : x ∈ Submonoid.closure s)

∃ n, r ^ n • x ∈ Submonoid.closure (r • s)


@[simp]
protected theorem inv_mul_cancel (φ : k⟦X⟧) (h : constantCoeff k φ ≠ 0) : φ⁻¹ * φ = 1

(h : (PowerSeries.constantCoeff k) φ ≠ 0)


theorem vec3_add [Add α] (a₀ a₁ a₂ b₀ b₁ b₂ : α) :
    ![a₀, a₁, a₂] + ![b₀, b₁, b₂] = ![a₀ + b₀, a₁ + b₁, a₂ + b₂]

{α : Type u}
[Add α]
(a₀ a₁ a₂ b₀ b₁ b₂ : α)


lemma homOfLE_isIso_of_eq {x y : X} (h : x ≤ y) (heq : x = y) :
    IsIso (homOfLE h)

{X : Type u}
[Preorder X]
{x y : X}
(h : x ≤ y)
(heq : x = y)


theorem eq_left_or_mem_Ioo_of_mem_Ico {x : α} (hmem : x ∈ Ico a b) : x = a ∨ x ∈ Ioo a b

{α : Type u_1}
[PartialOrder α]
{a b x : α}
(hmem : x ∈ Set.Ico a b)


/-- The unit isomorphism of `equivalence`. -/
@[simps!]
def equivalenceUnitIso : 𝟭 A ≅ (F ⋙ eB.inverse) ⋙ G

(hG : eB.functor ⋙ e'.inverse ≅ G ⋙ eA.functor)

(AlgebraicTopology.DoldKan.Compatibility.equivalenceUnitIso hG ε).inv.app X =
  eA.unitIso.hom.app (G.obj (eB.inverse.obj (F.obj X))) ≫
    eA.inverse.map (hG.inv.app (eB.inverse.obj (F.obj X))) ≫
      eA.inverse.map (e'.inverse.map (eB.counitIso.hom.app (F.obj X))) ≫
        eA.inverse.map (ε.inv.app X) ≫ eA.unitIso.inv.app X


/-- A nontrivial module over a complete nontrivially normed field has cardinality at least
continuum. -/
theorem continuum_le_cardinal_of_module
    (𝕜 : Type u) (E : Type v) [NontriviallyNormedField 𝕜] [CompleteSpace 𝕜]
    [AddCommGroup E] [Module 𝕜 E] [Nontrivial E] : 𝔠 ≤ #E


theorem union_erase_of_mem (ha : a ∈ s) (t : Finset α) : s ∪ t.erase a = s ∪ t

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
{a : α}
(ha : a ∈ s)
(t : Finset α)


theorem le_comap_pow_ramificationIdx : p ≤ comap f (P ^ ramificationIdx f p P)

{R : Type u}
[CommRing R]
{S : Type v}
[CommRing S]
{f : R →+* S}
{p : Ideal R}
{P : Ideal S}

p ≤ Ideal.comap f (P ^ Ideal.ramificationIdx f p P)


theorem disjoint_coe_of_mem (h₁ : J₁ ∈ π) (h₂ : J₂ ∈ π) (h : J₁ ≠ J₂) :
    Disjoint (J₁ : Set (ι → ℝ)) J₂

{ι : Type u_1}
{I J₁ J₂ : BoxIntegral.Box ι}
(π : BoxIntegral.Prepartition I)
(h₁ : J₁ ∈ π)
(h₂ : J₂ ∈ π)
(h : J₁ ≠ J₂)


lemma zpow_sub_one₀ (ha : a ≠ 0) (n : ℤ) : a ^ (n - 1) = a ^ n * a⁻¹

{G₀ : Type u_3}
[GroupWithZero G₀]
{a : G₀}
(ha : a ≠ 0)
(n : ℤ)


/-- `comap (algebraMap R S)` is a surjection from the max spec of `S` to max spec of `R`.
`hP : (algebraMap R S).ker ≤ P` is a slight generalization of the extension being injective -/
theorem exists_ideal_over_maximal_of_isIntegral [Algebra.IsIntegral R S]
    (P : Ideal R) [P_max : IsMaximal P] (hP : RingHom.ker (algebraMap R S) ≤ P) :
    ∃ Q : Ideal S, IsMaximal Q ∧ Q.comap (algebraMap R S) = P

{R : Type u_1}
[CommRing R]
{S : Type u_2}
[CommRing S]
[Algebra R S]
[Algebra.IsIntegral R S]
(P : Ideal R)
[P_max : P.IsMaximal]
(hP : RingHom.ker (algebraMap R S) ≤ P)

∃ Q, Q.IsMaximal ∧ Ideal.comap (algebraMap R S) Q = P


theorem ι_mul_ι_comm (a b : M) :
    ι Q a * ι Q b = algebraMap R _ (QuadraticMap.polar Q a b) - ι Q b * ι Q a

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}
(a b : M)

(CliffordAlgebra.ι Q) a * (CliffordAlgebra.ι Q) b =
  (algebraMap R (CliffordAlgebra Q)) (QuadraticMap.polar (⇑Q) a b) - (CliffordAlgebra.ι Q) b * (CliffordAlgebra.ι Q) a


theorem algebraMap_toAddMonoid_hom :
    ↑(algebraMap R (⨁ i, A i)) = (DirectSum.of A 0).comp (GAlgebra.toFun : R →+ A 0)

{ι : Type uι}
(R : Type uR)
(A : ι → Type uA)
[DecidableEq ι]
[CommSemiring R]
[(i : ι) → AddCommMonoid (A i)]
[(i : ι) → Module R (A i)]
[AddMonoid ι]
[DirectSum.GSemiring A]
[DirectSum.GAlgebra R A]

↑(algebraMap R (DirectSum ι fun i => A i)) = (DirectSum.of A 0).comp DirectSum.GAlgebra.toFun


@[to_additive]
theorem inv_mul_eq_iff_eq_mul : a⁻¹ * b = c ↔ b = a * c


/-- `splitOn x` is the left inverse of `intercalate [x]`, on the domain
  consisting of each nonempty list of lists `ls` whose elements do not contain `x`  -/
theorem splitOn_intercalate [DecidableEq α] (x : α) (hx : ∀ l ∈ ls, x ∉ l) (hls : ls ≠ []) :
    ([x].intercalate ls).splitOn x = ls

{α : Type u}
(ls : List (List α))
[DecidableEq α]
(x : α)
(hx : ∀ (l : List α), l ∈ ls → ¬x ∈ l)
(hls : ls ≠ [])

List.splitOn x ([x].intercalate ls) = ls


@[simp] lemma sqrt_eq_zero : sqrt x = 0 ↔ x = 0


@[simp]
theorem coe_toOrderIso (f : CircleDeg1Liftˣ) : ⇑(toOrderIso f) = f


/-- The cardinality of the multivariate polynomial ring, `MvPolynomial σ R` is at most the maximum
of `#R`, `#σ` and `ℵ₀` -/
theorem cardinal_mk_le_max : #(MvPolynomial σ R) ≤ max (max #R #σ) ℵ₀


theorem sumFinsuppLEquivProdFinsupp_symm_inr {α β : Type*} (fg : (α →₀ M) × (β →₀ M)) (y : β) :
    ((sumFinsuppLEquivProdFinsupp R).symm fg) (Sum.inr y) = fg.2 y

{M : Type u_2}
(R : Type u_5)
[Semiring R]
[AddCommMonoid M]
[Module R M]
{α : Type u_7}
{β : Type u_8}
(fg : (α →₀ M) × (β →₀ M))
(y : β)

((Finsupp.sumFinsuppLEquivProdFinsupp R).symm fg) (Sum.inr y) = fg.2 y


lemma summable_f_nat (k : ℕ) (a : ℝ) {t : ℝ} (ht : 0 < t) : Summable (f_nat k a t)

Summable (HurwitzKernelBounds.f_nat k a t)


@[simp]
theorem factorThru_self {X : C} (P : Subobject X) (h) : P.factorThru P.arrow h = 𝟙 (P : C)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X : C}
(P : CategoryTheory.Subobject X)
(h : P.Factors P.arrow)

P.factorThru P.arrow h = 𝟙 (CategoryTheory.Subobject.underlying.obj P)


@[grind_norm] theorem imp_eq (p q : Prop) : (p → q) = (¬ p ∨ q)


/-- The constructed pointwise left Kan extension when `HasPointwiseLeftKanExtension L F` holds. -/
@[simps]
noncomputable def pointwiseLeftKanExtension : D ⥤ H

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

(L.pointwiseLeftKanExtension F).obj Y =
  CategoryTheory.Limits.colimit ((CategoryTheory.CostructuredArrow.proj L Y).comp F)


lemma δ_neg_one_cochain (z : Cochain F G (-1)) :
    δ (-1) 0 z = Cochain.ofHom (Homotopy.nullHomotopicMap'
      (fun i j hij => z.v i j (by dsimp at hij; rw [← hij, add_neg_cancel_right])))

(z : CochainComplex.HomComplex.Cochain F G (-1))

CochainComplex.HomComplex.δ (-1) 0 z =
  CochainComplex.HomComplex.Cochain.ofHom (Homotopy.nullHomotopicMap' fun i j hij => z.v i j ⋯)


/-- `DFinsupp.mapRange` as an `AddMonoidHom`. -/
@[simps apply]
def mapRange.addMonoidHom (f : ∀ i, β₁ i →+ β₂ i) : (Π₀ i, β₁ i) →+ Π₀ i, β₂ i

{ι : Type u}
{β₁ : ι → Type v₁}
{β₂ : ι → Type v₂}
[(i : ι) → AddZeroClass (β₁ i)]
[(i : ι) → AddZeroClass (β₂ i)]
(f : (i : ι) → β₁ i →+ β₂ i)
(x : Π₀ (i : ι), β₁ i)

(DFinsupp.mapRange.addMonoidHom f) x = DFinsupp.mapRange (fun i x => (f i) x) ⋯ x


theorem transferSylow_eq_pow (g : G) (hg : g ∈ P) :
    transferSylow P hP g =
      ⟨g ^ (P : Subgroup G).index, transfer_eq_pow_aux g (transferSylow_eq_pow_aux P hP g hg)⟩

(hP : (↑P).normalizer ≤ Subgroup.centralizer ↑P)

(MonoidHom.transferSylow P hP) g = ⟨g ^ (↑P).index, ⋯⟩


theorem choose_mem (hp : ∃! a, a ∈ l ∧ p a) : choose p l hp ∈ l

{α : Type u_1}
(p : α → Prop)
[DecidablePred p]
(l : Finset α)
(hp : ∃! a, a ∈ l ∧ p a)


theorem tan_nat_mul_pi_sub (x : ℂ) (n : ℕ) : tan (n * π - x) = -tan x

Complex.tan (↑n * ↑Real.pi - x) = -Complex.tan x


@[simp]
theorem card_map (f : α → β) (s) : card (map f s) = card s

{α : Type u_1}
{β : Type v}
(f : α → β)
(s : Multiset α)

Multiset.card (Multiset.map f s) = Multiset.card s


@[simp]
theorem coeToMvPowerSeries.algHom_apply :
    coeToMvPowerSeries.algHom A φ = MvPowerSeries.map σ (algebraMap R A) ↑φ

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

(MvPolynomial.coeToMvPowerSeries.algHom A) φ = (MvPowerSeries.map σ (algebraMap R A)) ↑φ


theorem ExpChar.exists [Ring R] [IsDomain R] : ∃ q, ExpChar R q


@[simp]
theorem lift_map (h : IsAdjoinRoot S f) (z : R[X]) : h.lift i x hx (h.map z) = z.eval₂ i x

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
{f : R[X]}
[Algebra R S]
{T : Type u_1}
[CommRing T]
{i : R →+* T}
{x : T}
(hx : Polynomial.eval₂ i x f = 0)
(h : IsAdjoinRoot S f)
(z : R[X])

(IsAdjoinRoot.lift i x hx h) (h.map z) = Polynomial.eval₂ i x z


@[simp, mfld_simps]
theorem symm_toPartialEquiv : e.symm.toPartialEquiv = e.toPartialEquiv.symm

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


theorem Icc_min_max : Icc (min a b) (max a b) = [[a, b]]

{α : Type u_1}
[LinearOrder α]
{a b : α}

Set.Icc (min a b) (max a b) = Set.uIcc a b


@[simp] lemma in₂₁_iff : (graph t).Adj (in₂ c) (in₁ b) ↔ ∃ a, (a, b, c) ∈ t

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{t : Finset (α × β × γ)}
{b : β}
{c : γ}

(SimpleGraph.TripartiteFromTriangles.graph t).Adj (Sum3.in₂ c) (Sum3.in₁ b) ↔ ∃ a, (a, b, c) ∈ t


theorem Function.extend_of_isEmpty [IsEmpty α] (f : α → β) (g : α → γ) (h : β → γ) :
    Function.extend f g h = h

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
[IsEmpty α]
(f : α → β)
(g : α → γ)
(h : β → γ)


@[simp]
theorem assoc_symm_tmul (m : M) (n : N) (p : P) :
    (TensorProduct.assoc R M N P).symm (m ⊗ₜ (n ⊗ₜ p)) = m ⊗ₜ n ⊗ₜ p

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module R N]
[Module R P]
(m : M)
(n : N)
(p : P)

(TensorProduct.assoc R M N P).symm (m ⊗ₜ[R] n ⊗ₜ[R] p) = (m ⊗ₜ[R] n) ⊗ₜ[R] p


theorem AlgEquiv.transfer_galois (f : E ≃ₐ[F] E') : IsGalois F E ↔ IsGalois F E'

{F : Type u_1}
{E : Type u_3}
[Field F]
[Field E]
{E' : Type u_4}
[Field E']
[Algebra F E']
[Algebra F E]
(f : E ≃ₐ[F] E')


@[simp] protected theorem pow_one (a : Nat) : a ^ 1 = a


@[to_additive (attr := simp)]
theorem div_lt_div_iff_right (c : α) : a / c < b / c ↔ a < b

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


/-- A variant of `eq_inv_mul_iff_mul_eq₀` that moves the nonzero hypothesis to another variable. -/
lemma mul_eq_of_eq_inv_mul₀ (hb : b ≠ 0) (h : b = a⁻¹ * c) : a * b = c

{G₀ : Type u_3}
[GroupWithZero G₀]
{a b c : G₀}
(hb : b ≠ 0)
(h : b = a⁻¹ * c)


theorem modEq_iff_eq_mod_zmultiples : a ≡ b [PMOD p] ↔ (b : α ⧸ AddSubgroup.zmultiples p) = a

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


theorem tsum_indicator_ne_zero {f : α → ℝ≥0} (hf : Summable f) {s : Set α} (h : ∃ a ∈ s, f a ≠ 0) :
    (∑' x, (s.indicator f) x) ≠ 0

{α : Type u_1}
{f : α → ℝ≥0}
(hf : Summable f)
{s : Set α}
(h : ∃ a ∈ s, f a ≠ 0)


/-- Symmetric statement to `Option.map_map₂_distrib_right`. -/
theorem map_map₂_right_comm {f : α → β' → γ} {g : β → β'} {f' : α → β → δ} {g' : δ → γ}
    (h_right_comm : ∀ a b, f a (g b) = g' (f' a b)) :
    map₂ f a (b.map g) = (map₂ f' a b).map g'

{f : α → β' → γ}

{f' : α → β → δ}

(h_right_comm : ∀ (a : α) (b : β), f a (g b) = g' (f' a b))

Option.map₂ f a (Option.map g b) = Option.map g' (Option.map₂ f' a b)


@[simp]
theorem smeval.linearMap_apply : smeval.linearMap R x p = p.smeval x

(R : Type u_1)
[Semiring R]
(p : Polynomial R)
{S : Type u_2}
[AddCommMonoid S]
[Pow S ℕ]
[Module R S]
(x : S)

(Polynomial.smeval.linearMap R x) p = p.smeval x


@[simp] lemma op_div [Div α] (a b : α) : op (a / b) = op a / op b

AddOpposite.op (a / b) = AddOpposite.op a / AddOpposite.op b


/-- A graded version of `Module`. -/
class Gmodule [AddMonoid ιA] [VAdd ιA ιB] [∀ i, AddMonoid (A i)] [∀ i, AddMonoid (M i)] [GMonoid A]
    extends GdistribMulAction A M where
  add_smul {i j} (a a' : A i) (b : M j) : smul (a + a') b = smul a b + smul a' b
  zero_smul {i j} (b : M j) : smul (0 : A i) b = 0

{ιA : Type u_1}
{ιB : Type u_2}
{A : ιA → Type u_3}
{M : ιB → Type u_4}
[AddMonoid ιA]
[VAdd ιA ιB]
[(i : ιA) → AddMonoid (A i)]
[(i : ιB) → AddMonoid (M i)]
[GradedMonoid.GMonoid A]
[self : DirectSum.Gmodule A M]
{i : ιA}
{j : ιB}
(a a' : A i)
(b : M j)

GradedMonoid.GSMul.smul (a + a') b = GradedMonoid.GSMul.smul a b + GradedMonoid.GSMul.smul a' b


lemma W.mk {T : Triangle C} (hT : T ∈ distTriang C) (h : S.P T.obj₃) : S.W T.mor₁

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

(S : CategoryTheory.Triangulated.Subcategory C)

{T : CategoryTheory.Pretriangulated.Triangle C}

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)


theorem ord_eq (α) : ∃ (r : α → α → Prop) (wo : IsWellOrder α r), ord #α = @type α r wo

∃ r, ∃ (wo : IsWellOrder α r), (#α).ord = Ordinal.type r


theorem eq_or_lt_of_le {a b : α} (hab : a ≤ b) : a = b ∨ a < b

{α : Type u}
[PartialOrder α]
[DecidableRel fun x x_1 => x ≤ x_1]
{a b : α}
(hab : a ≤ b)


/-- A function between linear orders which is neither monotone nor antitone makes a dent upright or
downright. -/
lemma not_monotone_not_antitone_iff_exists_le_le :
    ¬ Monotone f ∧ ¬ Antitone f ↔
      ∃ a b c, a ≤ b ∧ b ≤ c ∧ ((f a < f b ∧ f c < f b) ∨ (f b < f a ∧ f b < f c))

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

¬Monotone f ∧ ¬Antitone f ↔ ∃ a b c, a ≤ b ∧ b ≤ c ∧ (f a < f b ∧ f c < f b ∨ f b < f a ∧ f b < f c)


@[to_additive (attr := simp)]
theorem singleton_smul (a : α) : ({a} : Finset α) • t = a • t

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[VAdd α β]
{t : Finset β}
(a : α)


theorem aeval_verschiebungPoly (x : 𝕎 R) (n : ℕ) :
    aeval x.coeff (verschiebungPoly n) = (verschiebung x).coeff n

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

(MvPolynomial.aeval x.coeff) (WittVector.verschiebungPoly n) = (WittVector.verschiebung x).coeff n


theorem one_def : (1 : P₁ ≃ᵃ[k] P₁) = refl k P₁

{k : Type u_1}
{P₁ : Type u_2}
{V₁ : Type u_6}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]


theorem mem_biSup_iff_exists_dfinsupp (p : ι → Prop) [DecidablePred p] (S : ι → Submodule R N)
    (x : N) :
    (x ∈ ⨆ (i) (_ : p i), S i) ↔
      ∃ f : Π₀ i, S i,
        DFinsupp.lsum ℕ (M := fun i ↦ ↥(S i)) (fun i => (S i).subtype) (f.filter p) = x

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

x ∈ ⨆ i, ⨆ (_ : p i), S i ↔ ∃ f, ((DFinsupp.lsum ℕ) fun i => (S i).subtype) (DFinsupp.filter p f) = x


/-- If right-multiplication by any element is cancellative, right-multiplication by `g` is an
embedding. -/
@[to_additive (attr := simps)
      "If right-addition by any element is cancellative, right-addition by `g` is an
        embedding."]
def mulRightEmbedding [Mul G] [IsRightCancelMul G] (g : G) : G ↪ G

{G : Type u_1}
[Mul G]
[IsRightCancelMul G]
(g h : G)


theorem tsum_geometric_of_norm_lt_one (h : ‖ξ‖ < 1) : ∑' n : ℕ, ξ ^ n = (1 - ξ)⁻¹

{K : Type u_4}
[NormedDivisionRing K]
{ξ : K}
(h : ‖ξ‖ < 1)


theorem pow_dvd_pow_of_dvd (h : a ∣ b) : ∀ n : ℕ, a ^ n ∣ b ^ n

{α : Type u_1}
[CommMonoid α]
{a b : α}
(h : a ∣ b)
(n : ℕ)


lemma CFC.exists_sqrt_of_isSelfAdjoint_of_quasispectrumRestricts {A : Type*} [NonUnitalRing A]
    [StarRing A] [TopologicalSpace A] [Module ℝ A] [IsScalarTower ℝ A A] [SMulCommClass ℝ A A ]
    [NonUnitalContinuousFunctionalCalculus ℝ (IsSelfAdjoint : A → Prop)]
    {a : A} (ha₁ : IsSelfAdjoint a) (ha₂ : QuasispectrumRestricts a ContinuousMap.realToNNReal) :
    ∃ x : A, IsSelfAdjoint x ∧ QuasispectrumRestricts x ContinuousMap.realToNNReal ∧ x * x = a

(ha₂ : QuasispectrumRestricts a ⇑ContinuousMap.realToNNReal)

∃ x, IsSelfAdjoint x ∧ QuasispectrumRestricts x ⇑ContinuousMap.realToNNReal ∧ x * x = a


@[simp] theorem log_eq_one_iff {x : ℝ≥0∞} : log x = 0 ↔ x = 1


@[simp]
theorem closure_nonempty_iff : (closure s).Nonempty ↔ s.Nonempty

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


theorem ediam_image_le (hf : LipschitzWith K f) (s : Set α) :
    EMetric.diam (f '' s) ≤ K * EMetric.diam s

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{K : ℝ≥0}
{f : α → β}
(hf : LipschitzWith K f)
(s : Set α)

EMetric.diam (f '' s) ≤ ↑K * EMetric.diam s


theorem UniformContinuous.inf_rng {f : α → β} {u₁ : UniformSpace α} {u₂ u₃ : UniformSpace β}
    (h₁ : UniformContinuous[u₁, u₂] f) (h₂ : UniformContinuous[u₁, u₃] f) :
    UniformContinuous[u₁, u₂ ⊓ u₃] f

{α : Type ua}
{β : Type ub}
{f : α → β}
{u₁ : UniformSpace α}
{u₂ u₃ : UniformSpace β}
(h₁ : UniformContinuous f)
(h₂ : UniformContinuous f)


@[to_additive (attr := simp)]
theorem nndist_div_right [DivInvMonoid M] [PseudoMetricSpace M] [IsometricSMul Mᵐᵒᵖ M]
    (a b c : M) : nndist (a / c) (b / c) = nndist a b

{M : Type u}
[DivInvMonoid M]
[PseudoMetricSpace M]
[IsometricSMul Mᵐᵒᵖ M]
(a b c : M)


@[to_additive (attr := simp)]
theorem coe_refl : ↑(refl M) = id


@[simp]
theorem cmp_eq (m n) : cmp m n = Ordering.eq ↔ m = n


theorem leftInvOn_piecewise {e' : PartialEquiv α β} [∀ i, Decidable (i ∈ s)]
    [∀ i, Decidable (i ∈ t)] (h : e.IsImage s t) (h' : e'.IsImage s t) :
    LeftInvOn (t.piecewise e.symm e'.symm) (s.piecewise e e') (s.ite e.source e'.source)

{α : Type u_1}
{β : Type u_2}
{e : PartialEquiv α β}
{s : Set α}
{t : Set β}
{e' : PartialEquiv α β}
[(i : α) → Decidable (i ∈ s)]
[(i : β) → Decidable (i ∈ t)]
(h : e.IsImage s t)
(h' : e'.IsImage s t)

Set.LeftInvOn (t.piecewise ↑e.symm ↑e'.symm) (s.piecewise ↑e ↑e') (s.ite e.source e'.source)


@[reassoc]
lemma d_fstX (i j k : ι) (hij : c.Rel i j) (hjk : c.Rel j k) :
    d φ i j ≫ fstX φ j k hjk = -fstX φ i j hij ≫ F.d j k

HomologicalComplex.homotopyCofiber.d φ i j ≫ HomologicalComplex.homotopyCofiber.fstX φ j k hjk =
  -HomologicalComplex.homotopyCofiber.fstX φ i j hij ≫ F.d j k


theorem coe_injective : @Function.Injective (NormedAddGroupHom V₁ V₂) (V₁ → V₂) toFun

{V₁ : Type u_2}
{V₂ : Type u_3}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]


@[to_additive]
lemma prod_map_ite (p : α → Prop) [DecidablePred p] (f g : α → M) (l : List α) :
    (l.map fun a => if p a then f a else g a).prod =
      ((l.filter p).map f).prod * ((l.filter fun a ↦ ¬p a).map g).prod

{α : Type u_2}
{M : Type u_4}
[AddCommMonoid M]
(p : α → Prop)
[DecidablePred p]
(f g : α → M)
(l : List α)

(List.map (fun a => if p a then f a else g a) l).sum =
  (List.map f (List.filter (fun b => decide (p b)) l)).sum + (List.map g (List.filter (fun a => decide ¬p a) l)).sum


theorem Ici_iSup (f : ι → α) : Ici (⨆ i, f i) = ⋂ i, Ici (f i)

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


/-- Convert a `BinaryBicone` into a `Bicone` over a pair. -/
@[simps]
def toBiconeFunctor {X Y : C} : BinaryBicone X Y ⥤ Bicone (pairFunction X Y)

(b : CategoryTheory.Limits.BinaryBicone X Y)

(CategoryTheory.Limits.BinaryBicone.toBiconeFunctor.obj b).pt = b.pt


@[simp] theorem and_or_imp : a ∧ b ∨ (a → c) ↔ a → b ∨ c


theorem isMaximal (p : T.CompleteType α) : IsMaximal (p : L[[α]].Theory)

{L : FirstOrder.Language}
{T : L.Theory}
{α : Type w}
(p : T.CompleteType α)


/-- In characteristic zero if there is no torsion, the correspondence between roots and coroots is
unique.

Formally, the point is that the hypothesis `hc` depends only on the range of the coroot mappings. -/
@[ext]
protected lemma ext [CharZero R] [NoZeroSMulDivisors R M]
    {P₁ P₂ : RootPairing ι R M N}
    (he : P₁.toLin = P₂.toLin)
    (hr : P₁.root = P₂.root)
    (hc : range P₁.coroot = range P₂.coroot) :
    P₁ = P₂

(hc : Set.range ⇑P₁.coroot = Set.range ⇑P₂.coroot)


@[simp]
theorem coe_eq_one_iff : (φ : MvPowerSeries σ R) = 1 ↔ φ = 1

{σ : Type u_1}
{R : Type u_2}
[CommSemiring R]
{φ : MvPolynomial σ R}

↑φ = 1 ↔ φ = 1


/-- The direction of `⊤` is the whole module as a submodule. -/
@[simp]
theorem direction_top : (⊤ : AffineSubspace k P).direction = ⊤

(k : Type u_1)
(V : Type u_2)
(P : Type u_3)
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]


theorem map_smul (f : M →ₗ[R] M') (p : R[X]) (q : PolynomialModule R M) :
    map R' f (p • q) = p.map (algebraMap R R') • map R' f q

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(R' : Type u_4)
{M' : Type u_5}
[CommRing R']
[AddCommGroup M']
[Module R' M']
[Algebra R R']
[Module R M']
[IsScalarTower R R' M']
(f : M →ₗ[R] M')
(p : R[X])
(q : PolynomialModule R M)

(PolynomialModule.map R' f) (p • q) = Polynomial.map (algebraMap R R') p • (PolynomialModule.map R' f) q


theorem finset_sup_apply [SemilatticeSup β] [OrderBot β] {f : γ → α →ₛ β} (s : Finset γ) (a : α) :
    s.sup f a = s.sup fun c => f c a

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[MeasurableSpace α]
[SemilatticeSup β]
[OrderBot β]
{f : γ → MeasureTheory.SimpleFunc α β}
(s : Finset γ)
(a : α)


@[simps]
instance (F : J ⥤ Cat.{v, v}) : Category (limit (F ⋙ Cat.objects))

(F : CategoryTheory.Functor J CategoryTheory.Cat)

(X : CategoryTheory.Limits.limit (F.comp CategoryTheory.Cat.objects))

CategoryTheory.CategoryStruct.id X =
  CategoryTheory.Limits.Types.Limit.mk (CategoryTheory.Cat.HasLimits.homDiagram X X)
    (fun j => CategoryTheory.CategoryStruct.id (CategoryTheory.Limits.limit.π (F.comp CategoryTheory.Cat.objects) j X))
    ⋯


theorem ofRat_neg (x : β) : ofRat (-x) = (-ofRat x : Cauchy abv)

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

CauSeq.Completion.ofRat (-x) = -CauSeq.Completion.ofRat x


theorem PolyCnstr.eq_false_of_isUnsat (ctx : Context) {c : PolyCnstr} : c.isUnsat → c.denote ctx = False

(ctx : Nat.Linear.Context)
{c : Nat.Linear.PolyCnstr}

c.isUnsat = true → Nat.Linear.PolyCnstr.denote ctx c = False


theorem measureUnivNNReal_pos [IsFiniteMeasure μ] (hμ : μ ≠ 0) : 0 < measureUnivNNReal μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasureTheory.IsFiniteMeasure μ]
(hμ : μ ≠ 0)


theorem rel_iff {H K : Subgroup G} {x y : G} :
    (setoid ↑H ↑K).Rel x y ↔ ∃ a ∈ H, ∃ b ∈ K, y = a * x * b

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

(Doset.setoid ↑H ↑K).Rel x y ↔ ∃ a ∈ H, ∃ b ∈ K, y = a * x * b


theorem transitive_manyOneReducible {α} [Primcodable α] : Transitive (@ManyOneReducible α α _ _)


theorem swapRight_apply (κ : Kernel α (β × γ)) (a : α) : swapRight κ a = (κ a).map Prod.swap

(κ : ProbabilityTheory.Kernel α (β × γ))

κ.swapRight a = MeasureTheory.Measure.map Prod.swap (κ a)


/-- If `α` is a separable space and `f : α → β` is a continuous map with dense range, then `β` is
a separable space as well. E.g., the completion of a separable uniform space is separable. -/
protected theorem _root_.DenseRange.separableSpace [SeparableSpace α] [TopologicalSpace β]
    {f : α → β} (h : DenseRange f) (h' : Continuous f) : SeparableSpace β

{α : Type u}
{β : Type u_1}
[t : TopologicalSpace α]
[TopologicalSpace.SeparableSpace α]
[TopologicalSpace β]
{f : α → β}
(h : DenseRange f)
(h' : Continuous f)


lemma rank_eq_natTrailingDegree :
    rank R L M = (polyCharpoly φ b).natTrailingDegree

(R : Type u_1)
(L : Type u_3)
(M : Type u_4)
{ι : Type u_5}
[CommRing R]
[Nontrivial R]
[LieRing L]
[LieAlgebra R L]
[Module.Finite R L]
[Module.Free R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[Module.Finite R M]
[Module.Free R M]
[Fintype ι]
[DecidableEq ι]
(b : Basis ι R L)

LieModule.rank R L M = ((↑(LieModule.toEnd R L M)).polyCharpoly b).natTrailingDegree


@[simp]
theorem inter_union_self (s t : Finset α) : s ∩ (t ∪ s) = s

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


@[simp]
theorem ker_coeSubmodule : LieSubmodule.toSubmodule (ker f) = LinearMap.ker (f : L →ₗ[R] L')

{R : Type u}
{L : Type v}
{L' : Type w₂}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieRing L']
[LieAlgebra R L']
(f : L →ₗ⁅R⁆ L')


theorem prodComparison_comp :
    prodComparison (F ⋙ G) A B =
      G.map (prodComparison F A B) ≫ prodComparison G (F.obj A) (F.obj B)

[CategoryTheory.Limits.HasBinaryProduct (F.obj A) (F.obj B)]

[CategoryTheory.Limits.HasBinaryProduct (G.obj (F.obj A)) (G.obj (F.obj B))]

[CategoryTheory.Limits.HasBinaryProduct ((F ⋙ G).obj A) ((F ⋙ G).obj B)]

CategoryTheory.Limits.prodComparison (F ⋙ G) A B =
  G.map (CategoryTheory.Limits.prodComparison F A B) ≫ CategoryTheory.Limits.prodComparison G (F.obj A) (F.obj B)


lemma set_smul_le_of_le_le {s t : Set S} {p q : Submodule R M}
    (le_set : s ≤ t) (le_submodule : p ≤ q) : s • p ≤ t • q

{R : Type u_2}
{M : Type u_3}
[Semiring R]
{S : Type u_4}
[Monoid S]
[AddCommMonoid M]
[Module R M]
[DistribMulAction S M]
{s t : Set S}
{p q : Submodule R M}
(le_set : s ≤ t)
(le_submodule : p ≤ q)


@[simp]
theorem finSuccEquiv'_at (i : Fin (n + 1)) : (finSuccEquiv' i) i = none


@[simp]
theorem rpow_one (x : ℝ) : x ^ (1 : ℝ) = x


/-- Transport a monoidal structure along an equivalence of (plain) categories.
-/
@[simps]
def transportStruct (e : C ≌ D) : MonoidalCategoryStruct.{v₂} D

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

α_ X Y Z =
  e.functor.mapIso
    (((e.unitIso.app (e.inverse.obj X ⊗ e.inverse.obj Y)).symm ⊗ CategoryTheory.Iso.refl (e.inverse.obj Z)) ≪≫
      α_ (e.inverse.obj X) (e.inverse.obj Y) (e.inverse.obj Z) ≪≫
        (CategoryTheory.Iso.refl (e.inverse.obj X) ⊗ e.unitIso.app (e.inverse.obj Y ⊗ e.inverse.obj Z)))


/-- When the second map `S.g` is zero, this is the left homology data on `S` given by
the chosen `cokernel S.f` -/
@[simps!]
noncomputable def ofHasCokernel [HasCokernel S.f] (hg : S.g = 0) : S.LeftHomologyData

(CategoryTheory.ShortComplex.LeftHomologyData.ofHasCokernel S hg).π = CategoryTheory.Limits.cokernel.π S.f


theorem count_replicate (a b : α) (n : Nat) : count a (replicate n b) = if a = b then n else 0

{α : Type u_1}
[DecidableEq α]
(a b : α)
(n : Nat)

List.count a (List.replicate n b) = if a = b then n else 0


/-- The cosine of `π / 3` is `1 / 2`. -/
@[simp]
theorem cos_pi_div_three : cos (π / 3) = 1 / 2


/-- If the quotient by a subgroup gives a singleton then the subgroup is the whole group. -/
@[to_additive "If the quotient by an additive subgroup gives a singleton then the additive subgroup
is the whole additive group."]
theorem subgroup_eq_top_of_subsingleton (H : Subgroup G) (h : Subsingleton (G ⧸ H)) : H = ⊤

{G : Type u}
[Group G]
(H : Subgroup G)
(h : Subsingleton (G ⧸ H))


theorem isCoboundedUnder_ge_finset_inf' [LinearOrder β] {f : Filter α} {F : ι → α → β}
    {s : Finset ι} (hs : s.Nonempty) (h : ∃ i ∈ s, f.IsCoboundedUnder (· ≥ ·) (F i)) :
    f.IsCoboundedUnder (· ≥ ·) (fun a ↦ inf' s hs (fun i ↦ F i a))

{F : ι → α → β}

(h : ∃ i ∈ s, Filter.IsCoboundedUnder (fun x x_1 => x ≥ x_1) f (F i))

Filter.IsCoboundedUnder (fun x x_1 => x ≥ x_1) f fun a => s.inf' hs fun i => F i a


theorem fg_unit {R A : Type*} [CommSemiring R] [Semiring A] [Algebra R A] (I : (Submodule R A)ˣ) :
    (I : Submodule R A).FG

{R : Type u_3}
{A : Type u_4}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(I : (Submodule R A)ˣ)


@[simp]
theorem toOrderHom_mk {a b : SimplexCategory} (f : Fin (a.len + 1) →o Fin (b.len + 1)) :
    (mk f).toOrderHom = f

(SimplexCategory.Hom.mk f).toOrderHom = f


theorem Nodup.ne_singleton_iff {l : List α} (h : Nodup l) (x : α) :
    l ≠ [x] ↔ l = [] ∨ ∃ y ∈ l, y ≠ x

{α : Type u}
{l : List α}
(h : l.Nodup)
(x : α)


theorem comap_comm (H : ψ ∘ φ = ρ ∘ θ) (G : Filter δ) :
    comap φ (comap ψ G) = comap θ (comap ρ G)

{α : Type u}
{β : Type v}
{γ : Type w}
{δ : Type u_1}
{φ : α → β}
{θ : α → γ}
{ψ : β → δ}
{ρ : γ → δ}
(H : ψ ∘ φ = ρ ∘ θ)
(G : Filter δ)

Filter.comap φ (Filter.comap ψ G) = Filter.comap θ (Filter.comap ρ G)


/-- If `b` is a right identity for `f : α → β → α`, then `{b}` is a right identity for
`Set.image2 f`. -/
lemma image2_right_identity {f : α → β → α} {b : β} (h : ∀ a, f a b = a) (s : Set α) :
    image2 f s {b} = s

{α : Type u_1}
{β : Type u_3}
{f : α → β → α}
{b : β}
(h : ∀ (a : α), f a b = a)
(s : Set α)


@[simp]
theorem card_attach {m : Multiset α} : card (attach m) = card m

Multiset.card m.attach = Multiset.card m


theorem powerset_injective : Injective (powerset : Finset α → Finset (Finset α))


@[reassoc (attr := simp)]
lemma opcyclesIsoRightHomology_hom_inv_id (hg : S.g = 0) :
    (S.opcyclesIsoRightHomology hg).hom ≫ S.rightHomologyι  = 𝟙 _

CategoryTheory.CategoryStruct.comp (S.opcyclesIsoRightHomology hg).hom S.rightHomologyι =
  CategoryTheory.CategoryStruct.id S.opcycles


/-- A lower block-triangular matrix is invertible iff both elements of its diagonal are.

This is a propositional form of `Matrix.fromBlocksZero₁₂InvertibleEquiv` forms an `iff`. -/
@[simp]
theorem isUnit_fromBlocks_zero₁₂ {A : Matrix m m α} {C : Matrix n m α} {D : Matrix n n α} :
    IsUnit (fromBlocks A 0 C D) ↔ IsUnit A ∧ IsUnit D

{m : Type u_2}
{n : Type u_3}
{α : Type u_4}
[Fintype m]
[Fintype n]
[DecidableEq m]
[DecidableEq n]
[CommRing α]
{A : Matrix m m α}
{C : Matrix n m α}
{D : Matrix n n α}

IsUnit (Matrix.fromBlocks A 0 C D) ↔ IsUnit A ∧ IsUnit D


@[to_additive]
theorem prod_filter_mul_prod_filter_not (p) [DecidablePred p] :
    (s.filter p).prod * (s.filter (fun a ↦ ¬ p a)).prod = s.prod

{α : Type u_3}
[AddCommMonoid α]
{s : Multiset α}
(p : α → Prop)
[DecidablePred p]

(Multiset.filter p s).sum + (Multiset.filter (fun a => ¬p a) s).sum = s.sum


theorem Decidable.or_congr_right' [Decidable a] (h : ¬a → (b ↔ c)) : a ∨ b ↔ a ∨ c

{a b c : Prop}
[Decidable a]
(h : ¬a → (b ↔ c))


theorem ContinuousLinearMap.toExposed.isExposed : IsExposed 𝕜 A (l.toExposed A)

{𝕜 : Type u_1}
{E : Type u_2}
[TopologicalSpace 𝕜]
[OrderedRing 𝕜]
[AddCommMonoid E]
[TopologicalSpace E]
[Module 𝕜 E]
{l : E →L[𝕜] 𝕜}
{A : Set E}


@[congr]
theorem image_congr {f g : α → β} {s : Set α} (h : ∀ a ∈ s, f a = g a) : f '' s = g '' s

{α : Type u_1}
{β : Type u_2}
{f g : α → β}
{s : Set α}
(h : ∀ a ∈ s, f a = g a)


/-- This lemma shows that `restrict` and `toOuterMeasure` commute. Note that the LHS has a
restrict on measures and the RHS has a restrict on outer measures. -/
theorem restrict_toOuterMeasure_eq_toOuterMeasure_restrict (h : MeasurableSet s) :
    (μ.restrict s).toOuterMeasure = OuterMeasure.restrict s μ.toOuterMeasure

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
(h : MeasurableSet s)

(μ.restrict s).toOuterMeasure = (MeasureTheory.OuterMeasure.restrict s) μ.toOuterMeasure


theorem succ_lt_of_not_succ {o b : Ordinal} (h : ¬∃ a, o = succ a) : succ b < o ↔ b < o

{o b : Ordinal.{u_4}}
(h : ¬∃ a, o = Order.succ a)


theorem le_geom {u : ℕ → ℝ} {c : ℝ} (hc : 0 ≤ c) (n : ℕ) (h : ∀ k < n, u (k + 1) ≤ c * u k) :
    u n ≤ c ^ n * u 0


theorem singletonFinsubgraph_le_adj_left {u v : V} {e : G.Adj u v} :
    singletonFinsubgraph u ≤ finsubgraphOfAdj e

{V : Type u}
{G : SimpleGraph V}
{u v : V}
{e : G.Adj u v}

SimpleGraph.singletonFinsubgraph u ≤ SimpleGraph.finsubgraphOfAdj e


/-- The symbol vanishes when both entries are even (and `b / 2 ≠ 0`). -/
theorem jacobiSymNat.even_even (a b : ℕ) (hb₀ : Nat.beq (b / 2) 0 = false) (ha : a % 2 = 0)
    (hb₁ : b % 2 = 0) : jacobiSymNat a b = 0

Mathlib.Meta.NormNum.jacobiSymNat a b = 0


{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Generators R S}
(w : P.ker.Cotangent)

(Algebra.Generators.Cotangent.of w).val = w


theorem StarConvex.linear_image (hs : StarConvex 𝕜 x s) (f : E →ₗ[𝕜] F) :
    StarConvex 𝕜 (f x) (f '' s)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[AddCommMonoid F]
[Module 𝕜 E]
[Module 𝕜 F]
{x : E}
{s : Set E}
(hs : StarConvex 𝕜 x s)
(f : E →ₗ[𝕜] F)


lemma den_mem_inv {I : FractionalIdeal R₁⁰ K} (hI : I ≠ ⊥) :
    (algebraMap R₁ K) (I.den : R₁) ∈ I⁻¹

{K : Type u_3}
[Field K]
{R₁ : Type u_4}
[CommRing R₁]
[IsDomain R₁]
[Algebra R₁ K]
[IsFractionRing R₁ K]
{I : FractionalIdeal R₁⁰ K}
(hI : I ≠ ⊥)


@[simp]
theorem rTensor_neg (f : N →ₗ[R] P) : (-f).rTensor M = -f.rTensor M

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

LinearMap.rTensor M (-f) = -LinearMap.rTensor M f


@[to_additive]
theorem leftInverse_mul_left_div (c : G) : Function.LeftInverse (fun x ↦ x * c) fun x ↦ x / c

Function.LeftInverse (fun x => x + c) fun x => x - c


theorem mem_of_mem_insert_of_ne (h : b ∈ insert a s) : b ≠ a → b ∈ s

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
{a b : α}
(h : b ∈ insert a s)


theorem RemoveNone.fiber_none : RemoveNone.fiber (@none α) = ∅

derangements.Equiv.RemoveNone.fiber none = ∅


theorem Monic.mul (hp : Monic p) (hq : Monic q) : Monic (p * q)

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


/-- Being finitely-presented is stable under composition. -/
theorem finitePresentation_stableUnderComposition : StableUnderComposition @FinitePresentation


/-- Radon-Nikodym derivative of the kernel `κ` with respect to the kernel `η`. -/
noncomputable
irreducible_def rnDeriv (κ η : Kernel α γ) (a : α) (x : γ) : ℝ≥0∞

[hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ]

κ.rnDeriv η a x = ENNReal.ofReal (κ.rnDerivAux (κ + η) a x) / ENNReal.ofReal (1 - κ.rnDerivAux (κ + η) a x)


theorem integral_comp_abs {f : ℝ → ℝ} :
    ∫ x, f |x| = 2 * ∫ x in Ioi (0 : ℝ), f x

∫ (x : ℝ), f |x| = 2 * ∫ (x : ℝ) in Set.Ioi 0, f x


@[to_additive]
theorem NeBot.of_div_right : (f / g).NeBot → g.NeBot


theorem multiset_sum_left (b : α) (h : ∀ a ∈ s, Commute a b) : Commute s.sum b

{α : Type u_2}
[NonUnitalNonAssocSemiring α]
(s : Multiset α)
(b : α)
(h : ∀ a ∈ s, Commute a b)


/-- **Darboux's theorem**: the image of a convex set under `f'` is a convex set,
`HasDerivWithinAt` version. -/
theorem Convex.image_hasDerivWithinAt {s : Set ℝ} (hs : Convex ℝ s)
    (hf : ∀ x ∈ s, HasDerivWithinAt f (f' x) s x) : Convex ℝ (f' '' s)


theorem zpow_pos {x : ℝ≥0} (hx : x ≠ 0) (n : ℤ) : 0 < x ^ n


/-- If `s : Set S` belongs to `l ⊓ 𝓝 x` for all `x` from a compact set `K`,
then it belongs to `l ⊓ (𝓝ˢ K)`,
i.e., there exist `T ∈ l` and an open `U ⊇ K` such that `T ∩ U ⊆ s`. -/
theorem IsCompact.mem_inf_nhdsSet_of_forall {K : Set X} {l : Filter X} {s : Set X}
    (hK : IsCompact K) (hs : ∀ y ∈ K, s ∈ l ⊓ 𝓝 y) : s ∈ l ⊓ 𝓝ˢ K

{X : Type u}
[TopologicalSpace X]
{K : Set X}
{l : Filter X}
{s : Set X}
(hK : IsCompact K)
(hs : ∀ y ∈ K, s ∈ l ⊓ 𝓝 y)

s ∈ l ⊓ 𝓝ˢ K


/-- An element of the character space of a unital algebra, as an algebra homomorphism. -/
@[simps]
def toAlgHom (φ : characterSpace 𝕜 A) : A →ₐ[𝕜] 𝕜

{𝕜 : Type u_1}
{A : Type u_2}
[CommRing 𝕜]
[NoZeroDivisors 𝕜]
[TopologicalSpace 𝕜]
[ContinuousAdd 𝕜]
[ContinuousConstSMul 𝕜 𝕜]
[TopologicalSpace A]
[Semiring A]
[Algebra 𝕜 A]
(φ : ↑(WeakDual.characterSpace 𝕜 A))

∀ (a : A), (WeakDual.CharacterSpace.toAlgHom φ) a = (WeakDual.CharacterSpace.toNonUnitalAlgHom φ).toFun a


lemma stableUnderSpecialization_iff_Union_eq {s : Set X} :
    StableUnderSpecialization s ↔ (⋃ x ∈ s, closure {x}) = s

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

StableUnderSpecialization s ↔ ⋃ x ∈ s, closure {x} = s


lemma mem_ofObjects_iff {I : Type*} (Y : I → C) {Z X : C} (g : Z ⟶ X) :
    ofObjects Y X g ↔ ∃ (i : I), Nonempty (Z ⟶ Y i)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{I : Type u_1}
(Y : I → C)
{Z X : C}
(g : Z ⟶ X)

(CategoryTheory.Sieve.ofObjects Y X).arrows g ↔ ∃ i, Nonempty (Z ⟶ Y i)


theorem le_natTrailingDegree_mul (h : p * q ≠ 0) :
    p.natTrailingDegree + q.natTrailingDegree ≤ (p * q).natTrailingDegree

{R : Type u}
[Semiring R]
{p q : R[X]}
(h : p * q ≠ 0)


@[simp, deprecated get_insertNth_self (since := "2023-01-05")]
theorem nthLe_insertNth_self (l : List α) (x : α) (n : ℕ) (hn : n ≤ l.length)
    (hn' : n < (insertNth n x l).length := (by rwa [length_insertNth _ _ hn, Nat.lt_succ_iff])) :
    (insertNth n x l).nthLe n hn' = x

(hn' : n < (List.insertNth n x l).length := ⋯)


/-- In an emetric ball, the distance between points is everywhere finite -/
theorem edist_ne_top_of_mem_ball {a : β} {r : ℝ≥0∞} (x y : ball a r) : edist x.1 y.1 ≠ ∞

{β : Type u_2}
[EMetricSpace β]
{a : β}
{r : ℝ≥0∞}
(x y : ↑(EMetric.ball a r))


theorem mk'_add_eq_iff_add_mul_eq_mul {x} {y : M} {z₁ z₂} :
    mk' S x y + z₁ = z₂ ↔ algebraMap R S x + z₁ * algebraMap R S y = z₂ * algebraMap R S y

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
{x : R}
{y : ↥M}
{z₁ z₂ : S}

IsLocalization.mk' S x y + z₁ = z₂ ↔ (algebraMap R S) x + z₁ * (algebraMap R S) ↑y = z₂ * (algebraMap R S) ↑y


theorem splitLower_le : I.splitLower i x ≤ I

{ι : Type u_1}
{I : BoxIntegral.Box ι}
{i : ι}
{x : ℝ}


lemma equalizerCondition_w' (P : Cᵒᵖ ⥤ Type*) {X B : C} (π : X ⟶ B)
    [HasPullback π π] : P.map π.op ≫ P.map (pullback.fst π π).op =
    P.map π.op ≫ P.map (pullback.snd π π).op

(P : CategoryTheory.Functor Cᵒᵖ (Type u_4))

CategoryTheory.CategoryStruct.comp (P.map π.op) (P.map (CategoryTheory.Limits.pullback.fst π π).op) =
  CategoryTheory.CategoryStruct.comp (P.map π.op) (P.map (CategoryTheory.Limits.pullback.snd π π).op)


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

Cardinal.mk ↑(⋃ i, f i) ≤ Cardinal.mk ι * ⨆ i, Cardinal.mk ↑(f i)


theorem rank_le_height [StrongRankCondition R] {m n : ℕ} (A : Matrix (Fin m) (Fin n) R) :
    A.rank ≤ m

{R : Type u_5}
[CommRing R]
[StrongRankCondition R]
{m n : ℕ}
(A : Matrix (Fin m) (Fin n) R)


/-- The ring version of `AddMonoidAlgebra.addMonoidAlgebraEquivDirectSum`.  -/
@[simps (config := .asFn)]
def addMonoidAlgebraRingEquivDirectSum [DecidableEq ι] [AddMonoid ι] [Semiring M]
    [∀ m : M, Decidable (m ≠ 0)] : AddMonoidAlgebra M ι ≃+* ⨁ _ : ι, M

{ι : Type u_1}
{M : Type u_3}
[DecidableEq ι]
[AddMonoid ι]
[Semiring M]
[(m : M) → Decidable (m ≠ 0)]


@[to_additive] lemma inv_le_leOnePart (a : α) : a⁻¹ ≤ a⁻ᵐ

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


@[simp]
theorem IsTensorProduct.equiv_symm_apply (h : IsTensorProduct f) (x₁ : M₁) (x₂ : M₂) :
    h.equiv.symm (f x₁ x₂) = x₁ ⊗ₜ x₂

{R : Type u_1}
[CommSemiring R]
{M₁ : Type u_2}
{M₂ : Type u_3}
{M : Type u_4}
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid M]
[Module R M₁]
[Module R M₂]
[Module R M]
{f : M₁ →ₗ[R] M₂ →ₗ[R] M}
(h : IsTensorProduct f)
(x₁ : M₁)
(x₂ : M₂)


theorem iff_not_comm : (a ↔ ¬b) ↔ (b ↔ ¬a)


theorem Prime.dvd_of_pow_dvd_pow_mul_pow_of_square_not_dvd [CancelCommMonoidWithZero α] {p a b : α}
    {n : ℕ} (hp : Prime p) (hpow : p ^ n.succ ∣ a ^ n.succ * b ^ n) (hb : ¬p ^ 2 ∣ b) : p ∣ a


theorem DifferentiableAt.fderiv_restrictScalars (h : DifferentiableAt 𝕜' f x) :
    fderiv 𝕜 f x = (fderiv 𝕜' f x).restrictScalars 𝕜

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

fderiv 𝕜 f x = ContinuousLinearMap.restrictScalars 𝕜 (fderiv 𝕜' f x)


@[simp]
theorem coe_ne_top (x : ℝ) : (x : EReal) ≠ ⊤


@[simp]
theorem inl_pushoutZeroZeroIso_hom (X Y : C) [HasBinaryCoproduct X Y] :
    pushout.inl _ _ ≫ (pushoutZeroZeroIso X Y).hom = coprod.inl

CategoryTheory.Limits.pushout.inl 0 0 ≫ (CategoryTheory.Limits.pushoutZeroZeroIso X Y).hom =
  CategoryTheory.Limits.coprod.inl


theorem ext (f g : F) (h : ∀ x : α, f x = g x) : f = g

{F : Sort u_1}
{α : Sort u_2}
{β : α → Sort u_3}
[i : DFunLike F α β]
(f g : F)
(h : ∀ (x : α), f x = g x)


@[simp]
theorem mem_neg {g : M} {S : Submodule R M} : g ∈ -S ↔ -g ∈ S

{R : Type u_2}
{M : Type u_3}
[Semiring R]
[AddCommGroup M]
[Module R M]
{g : M}
{S : Submodule R M}


/-- If `‖f n‖` is bounded by a constant times `n^x`, then the abscissa of absolute convergence
of `f` is bounded by `x + 1`. -/
lemma LSeries.abscissaOfAbsConv_le_of_le_const_mul_rpow {f : ℕ → ℂ} {x : ℝ}
    (h : ∃ C, ∀ n ≠ 0, ‖f n‖ ≤ C * n ^ x) : abscissaOfAbsConv f ≤ x + 1

(h : ∃ C, ∀ (n : ℕ), n ≠ 0 → ‖f n‖ ≤ C * ↑n ^ x)


lemma exists_isNilRegular [Infinite R] : ∃ x : L, IsNilRegular φ x

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing R]
[AddCommGroup L]
[Module R L]
[AddCommGroup M]
[Module R M]
(φ : L →ₗ[R] Module.End R M)
[Module.Free R M]
[Module.Finite R M]
[Module.Finite R L]
[Module.Free R L]
[Nontrivial R]
[IsDomain R]
[Infinite R]


@[simp]
theorem equivSubtypeMap_symm_apply {p : Submodule R M} {q : Submodule R p} (x : q.map p.subtype) :
    ((p.equivSubtypeMap q).symm x : M) = x

{R : Type u_1}
{M : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{p : Submodule R M}
{q : Submodule R ↥p}
(x : ↥(Submodule.map p.subtype q))


@[to_additive]
theorem finprod_mem_coe_finset (f : α → M) (s : Finset α) :
    (∏ᶠ i ∈ (s : Set α), f i) = ∏ i ∈ s, f i

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

∏ᶠ (i : α) (_ : i ∈ ↑s), f i = ∏ i ∈ s, f i


theorem sumLift₂_mono (h₁ : ∀ a b, f₁ a b ⊆ g₁ a b) (h₂ : ∀ a b, f₂ a b ⊆ g₂ a b) :
    ∀ a b, sumLift₂ f₁ f₂ a b ⊆ sumLift₂ g₁ g₂ a b

(h₁ : ∀ (a : α₁) (b : β₁), f₁ a b ⊆ g₁ a b)

(h₂ : ∀ (a : α₂) (b : β₂), f₂ a b ⊆ g₂ a b)

(a : α₁ ⊕ α₂)

(b : β₁ ⊕ β₂)

Finset.sumLift₂ f₁ f₂ a b ⊆ Finset.sumLift₂ g₁ g₂ a b


theorem succ_dvd_or_succ_dvd_of_succ_sum_dvd_mul {p : ℕ} (p_prime : Prime p) {m n k l : ℕ}
    (hpm : p ^ k ∣ m) (hpn : p ^ l ∣ n) (hpmn : p ^ (k + l + 1) ∣ m * n) :
    p ^ (k + 1) ∣ m ∨ p ^ (l + 1) ∣ n

{p : ℕ}
(p_prime : Nat.Prime p)
{m n k l : ℕ}
(hpm : p ^ k ∣ m)
(hpn : p ^ l ∣ n)
(hpmn : p ^ (k + l + 1) ∣ m * n)


@[simp] lemma strictMono_vecEmpty : StrictMono ![a]


theorem map_subtype_embedding_Ioi : (Ioi a).map (Embedding.subtype p) = (Ioi a : Finset α)

{α : Type u_1}
[Preorder α]
(p : α → Prop)
[DecidablePred p]
[LocallyFiniteOrderTop α]
(a : Subtype p)
(hp : ∀ ⦃a x : α⦄, a ≤ x → p a → p x)

Finset.map (Function.Embedding.subtype p) (Finset.Ioi a) = Finset.Ioi ↑a


/-- `WalkingParallelPair` as a category is equivalent to a special case of
`WalkingParallelFamily`.  -/
@[simps!]
def walkingParallelFamilyEquivWalkingParallelPair :
    WalkingParallelFamily.{w} (ULift Bool) ≌ WalkingParallelPair

(X : CategoryTheory.Limits.WalkingParallelFamily (ULift.{w, 0} Bool))

CategoryTheory.Limits.walkingParallelFamilyEquivWalkingParallelPair.unitIso.inv.app X = CategoryTheory.eqToHom ⋯


theorem mapAccumr_bisim {f₁ : α → σ₁ → σ₁ × β} {f₂ : α → σ₂ → σ₂ × β} {s₁ : σ₁} {s₂ : σ₂}
    (R : σ₁ → σ₂ → Prop) (h₀ : R s₁ s₂)
    (hR : ∀ {s q} a, R s q → R (f₁ a s).1 (f₂ a q).1 ∧ (f₁ a s).2 = (f₂ a q).2) :
    R (mapAccumr f₁ xs s₁).fst (mapAccumr f₂ xs s₂).fst
    ∧ (mapAccumr f₁ xs s₁).snd = (mapAccumr f₂ xs s₂).snd

{f₁ : α → σ₁ → σ₁ × β}

{f₂ : α → σ₂ → σ₂ × β}

(hR : ∀ {s : σ₁} {q : σ₂} (a : α), R s q → R (f₁ a s).1 (f₂ a q).1 ∧ (f₁ a s).2 = (f₂ a q).2)

R (Mathlib.Vector.mapAccumr f₁ xs s₁).1 (Mathlib.Vector.mapAccumr f₂ xs s₂).1 ∧
  (Mathlib.Vector.mapAccumr f₁ xs s₁).2 = (Mathlib.Vector.mapAccumr f₂ xs s₂).2


@[simp]
theorem coe_zero_linearMap : ↑(0 : LieDerivation R L M) = (0 : L →ₗ[R] M)

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]


@[simp]
theorem id_comp (f : X →ₑ[φ] Y) :
    (MulActionHom.id N).comp f = f

{M : Type u_2}
{N : Type u_3}
{φ : M → N}
{X : Type u_5}
[SMul M X]
{Y : Type u_6}
[SMul N Y]
(f : X →ₑ[φ] Y)


lemma IsTorsionFree.of_noZeroSMulDivisors {M : Type*} [AddMonoid M] [NoZeroSMulDivisors ℕ M] :
    AddMonoid.IsTorsionFree M

{M : Type u_3}
[AddMonoid M]
[NoZeroSMulDivisors ℕ M]


theorem MonotoneOn.eVariationOn_le {f : α → ℝ} {s : Set α} (hf : MonotoneOn f s) {a b : α}
    (as : a ∈ s) (bs : b ∈ s) : eVariationOn f (s ∩ Icc a b) ≤ ENNReal.ofReal (f b - f a)

{α : Type u_1}
[LinearOrder α]
{f : α → ℝ}
{s : Set α}
(hf : MonotoneOn f s)
{a b : α}
(as : a ∈ s)
(bs : b ∈ s)

eVariationOn f (s ∩ Set.Icc a b) ≤ ENNReal.ofReal (f b - f a)


@[to_additive (attr := simp)]
theorem toList_one : toList (1 : FreeMonoid α) = []


@[simp]
theorem coeff_inj {x y : HahnSeries Γ R} : x.coeff = y.coeff ↔ x = y

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]
{x y : HahnSeries Γ R}


theorem circleMap_mem_sphere (c : ℂ) {R : ℝ} (hR : 0 ≤ R) (θ : ℝ) :
    circleMap c R θ ∈ sphere c R


/-- See also `Nat.mem_properDivisors`. -/
lemma mem_properDivisors_iff_exists {m n : ℕ} (hn : n ≠ 0) :
    m ∈ n.properDivisors ↔ ∃ k > 1, n = m * k


@[to_additive]
theorem mem_rightTransversals_iff_existsUnique_quotient_mk''_eq :
    S ∈ rightTransversals (H : Set G) ↔
      ∀ q : Quotient (QuotientGroup.rightRel H), ∃! s : S, Quotient.mk'' s.1 = q

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

S ∈ Subgroup.rightTransversals ↑H ↔ ∀ (q : Quotient (QuotientGroup.rightRel H)), ∃! s, Quotient.mk'' ↑s = q


theorem IsLeast.lowerBounds_eq (h : IsLeast s a) : lowerBounds s = Iic a

{α : Type u}
[Preorder α]
{s : Set α}
{a : α}
(h : IsLeast s a)


/--
Ring equivalence are isomorphisms in category of commutative semirings
-/
@[simps]
def _root_.RingEquiv.toCommSemiRingCatIso {X Y : Type u} [CommSemiring X] [CommSemiring Y]
    (e : X ≃+* Y) : CommSemiRingCat.of X ≅ CommSemiRingCat.of Y


@[simp]
theorem ofMapRelIff_coe (f : α → β) [IsAntisymm α r] [IsRefl β s]
    (hf : ∀ a b, s (f a) (f b) ↔ r a b) :
    (ofMapRelIff f hf : r ↪r s) = f

(hf : ∀ (a b : α), s (f a) (f b) ↔ r a b)


theorem mapRange.linearEquiv_trans (f : M ≃ₗ[R] N) (f₂ : N ≃ₗ[R] P) :
    (mapRange.linearEquiv (f.trans f₂) : (α →₀ _) ≃ₗ[R] _) =
      (mapRange.linearEquiv f).trans (mapRange.linearEquiv f₂)

{α : Type u_1}
{M : Type u_2}
{N : Type u_3}
{P : Type u_4}
{R : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
[AddCommMonoid P]
[Module R P]
(f : M ≃ₗ[R] N)
(f₂ : N ≃ₗ[R] P)

Finsupp.mapRange.linearEquiv (f ≪≫ₗ f₂) = Finsupp.mapRange.linearEquiv f ≪≫ₗ Finsupp.mapRange.linearEquiv f₂


/-- **First moment method**. The minimum of a measurable function is smaller than its integral. -/
theorem exists_le_lintegral (hf : AEMeasurable f μ) : ∃ x, f x ≤ ∫⁻ a, f a ∂μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ≥0∞}
[MeasureTheory.IsProbabilityMeasure μ]
(hf : AEMeasurable f μ)


@[simp, mfld_simps]
theorem mem_preimage {f : α → β} {s : Set β} {a : α} : a ∈ f ⁻¹' s ↔ f a ∈ s

{α : Type u}
{β : Type v}
{f : α → β}
{s : Set β}
{a : α}


theorem iso_symm_apply_aux (m : M') :
    (iso S f).symm m =
      LocalizedModule.mk (IsLocalizedModule.surj S f m).choose.1
        (IsLocalizedModule.surj S f m).choose.2

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

(IsLocalizedModule.iso S f).symm m = LocalizedModule.mk ⋯.choose.1 ⋯.choose.2


theorem isEquiv_iff_val_lt_one [LinearOrderedCommGroupWithZero Γ₀]
    [LinearOrderedCommGroupWithZero Γ'₀] (v : Valuation K Γ₀) (v' : Valuation K Γ'₀) :
    v.IsEquiv v' ↔ ∀ {x : K}, v x < 1 ↔ v' x < 1

{K : Type u_1}
[DivisionRing K]
{Γ₀ : Type u_4}
{Γ'₀ : Type u_5}
[LinearOrderedCommGroupWithZero Γ₀]
[LinearOrderedCommGroupWithZero Γ'₀]
(v : Valuation K Γ₀)
(v' : Valuation K Γ'₀)


@[gcongr]
theorem logb_lt_logb (hx : 0 < x) (hxy : x < y) : logb b x < logb b y