/-- The global sections, notated Gamma.
-/
@[simps]
def Γ : (PresheafedSpace C)ᵒᵖ ⥤ C

(X : (AlgebraicGeometry.PresheafedSpace C)ᵒᵖ)

AlgebraicGeometry.PresheafedSpace.Γ.obj X = (Opposite.unop X).presheaf.obj (Opposite.op ⊤)


@[simp]
theorem conjTranspose_inv_natCast_smul [DivisionSemiring R] [AddCommMonoid α] [StarAddMonoid α]
    [Module R α] (c : ℕ) (M : Matrix m n α) : ((c : R)⁻¹ • M)ᴴ = (c : R)⁻¹ • Mᴴ

{m : Type u_2}
{n : Type u_3}
{R : Type u_7}
{α : Type v}
[DivisionSemiring R]
[AddCommMonoid α]
[StarAddMonoid α]
[Module R α]
(c : ℕ)
(M : Matrix m n α)


theorem filter_apply_pos [∀ i, Zero (β i)] {p : ι → Prop} [DecidablePred p] (f : Π₀ i, β i) {i : ι}
    (h : p i) : f.filter p i = f i

{ι : Type u}
{β : ι → Type v}
[(i : ι) → Zero (β i)]
{p : ι → Prop}
[DecidablePred p]
(f : Π₀ (i : ι), β i)
{i : ι}
(h : p i)


@[simp]
theorem continuousWithinAt_singleton {f : α → β} {x : α} : ContinuousWithinAt f {x} x

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


/-- (Implementation Detail) The glue data associated to a disjoint union. -/
@[simps]
noncomputable
def disjointGlueData' : GlueData' Scheme

{ι : Type u}
(f : ι → AlgebraicGeometry.Scheme)

(AlgebraicGeometry.disjointGlueData' f).J = ι


theorem zipWith_zipWith_left (f : δ → γ → ε) (g : α → β → δ) :
    ∀ (la : List α) (lb : List β) (lc : List γ),
      zipWith f (zipWith g la lb) lc = zipWith3 (fun a b c => f (g a b) c) la lb lc

{α : Type u}
{β : Type u_1}
{γ : Type u_2}
{δ : Type u_3}
{ε : Type u_4}
(f : δ → γ → ε)
(g : α → β → δ)
(la : List α)
(lb : List β)
(lc : List γ)

List.zipWith f (List.zipWith g la lb) lc = List.zipWith3 (fun a b c => f (g a b) c) la lb lc


lemma Antitone.frequently_le_map_of_frequently_ge {f : R → S} (f_decr : Antitone f)
    {l : R} (frbdd : ∃ᶠ x in F, l ≤ x) :
    ∃ᶠ y in F.map f, y ≤ f l

{R : Type u_6}
{S : Type u_7}
{F : Filter R}
[LinearOrder R]
[LinearOrder S]
{f : R → S}
(f_decr : Antitone f)
{l : R}
(frbdd : ∃ᶠ (x : R) in F, l ≤ x)


@[to_additive]
theorem eq_one_div_of_mul_eq_one_right (h : a * b = 1) : b = 1 / a

{α : Type u_1}
[SubtractionMonoid α]
{a b : α}
(h : a + b = 0)


lemma mono_homologyMap_τ₃ (i : ι)
    (h₁ : Epi (homologyMap φ.τ₁ i))
    (h₂ : Mono (homologyMap φ.τ₂ i))
    (h₃ : ∀ j, c.Rel i j → Mono (homologyMap φ.τ₁ j)) :
    Mono (homologyMap φ.τ₃ i)

{S₁ S₂ : CategoryTheory.ShortComplex (HomologicalComplex C c)}

(h₁ : CategoryTheory.Epi (HomologicalComplex.homologyMap φ.τ₁ i))

(h₂ : CategoryTheory.Mono (HomologicalComplex.homologyMap φ.τ₂ i))

(h₃ : ∀ (j : ι), c.Rel i j → CategoryTheory.Mono (HomologicalComplex.homologyMap φ.τ₁ j))

CategoryTheory.Mono (HomologicalComplex.homologyMap φ.τ₃ i)


/-- A version of `WithBot.map` for `AddMonoidHom`s. -/
@[simps (config := .asFn)]
protected def _root_.AddMonoidHom.withBotMap {M N : Type*} [AddZeroClass M] [AddZeroClass N]
    (f : M →+ N) : WithBot M →+ WithBot N

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
(f : M →+ N)


theorem IsMaxFilter.tendsto_principal_Iic (h : IsMaxFilter f l a) : Tendsto f l (𝓟 <| Iic (f a))

{α : Type u}
{β : Type v}
[Preorder β]
{f : α → β}
{l : Filter α}
{a : α}
(h : IsMaxFilter f l a)


theorem partialSups_mono : Monotone (partialSups : (ℕ → α) → ℕ →o α)


@[norm_cast]
theorem max_map (e₁ e₂ : ENorm 𝕜 V) (x : V) : (e₁ ⊔ e₂) x = max (e₁ x) (e₂ x)

{𝕜 : Type u_1}
{V : Type u_2}
[NormedField 𝕜]
[AddCommGroup V]
[Module 𝕜 V]
(e₁ e₂ : ENorm 𝕜 V)
(x : V)


/-- A very useful criterion to show that a space is complete is to show that all sequences
which satisfy a bound of the form `dist (u n) (u m) < B N` for all `n m ≥ N` are
converging. This is often applied for `B N = 2^{-N}`, i.e., with a very fast convergence to
`0`, which makes it possible to use arguments of converging series, while this is impossible
to do in general for arbitrary Cauchy sequences. -/
theorem Metric.complete_of_convergent_controlled_sequences (B : ℕ → Real) (hB : ∀ n, 0 < B n)
    (H : ∀ u : ℕ → α, (∀ N n m : ℕ, N ≤ n → N ≤ m → dist (u n) (u m) < B N) →
      ∃ x, Tendsto u atTop (𝓝 x)) :
    CompleteSpace α

(H : ∀ (u : ℕ → α), (∀ (N n m : ℕ), N ≤ n → N ≤ m → dist (u n) (u m) < B N) → ∃ x, Filter.Tendsto u Filter.atTop (𝓝 x))


/-- `![a, b, ...] 1` is equal to `b`.

  The simplifier needs a special lemma for length `≥ 2`, in addition to
  `cons_val_succ`, because `1 : Fin 1 = 0 : Fin 1`.
-/
@[simp]
theorem cons_val_one (x : α) (u : Fin m.succ → α) : vecCons x u 1 = vecHead u

{α : Type u}
{m : ℕ}
(x : α)
(u : Fin m.succ → α)


theorem refl (f : C(X, Y)) : HomotopicRel f f S

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{S : Set X}
(f : C(X, Y))


@[to_additive (attr := simp)]
theorem symm_inv {G} [MeasurableSpace G] [InvolutiveInv G] [MeasurableInv G] :
    (inv G).symm = inv G

{G : Type u_4}
[MeasurableSpace G]
[InvolutiveNeg G]
[MeasurableNeg G]

(MeasurableEquiv.neg G).symm = MeasurableEquiv.neg G


/-- An ordinal lifted to the same universe equals itself. -/
@[simp]
theorem lift_id : ∀ a, lift.{u, u} a = a


theorem neighborFinset_def : G.neighborFinset v = (G.neighborSet v).toFinset

{V : Type u_1}
(G : SimpleGraph V)
(v : V)
[Fintype ↑(G.neighborSet v)]


lemma neg_one_lt_zero
    [ZeroLEOneClass α] [NeZero (R := α) 1] [CovariantClass α α (· + ·) (· < ·)] :
    -1 < (0 : α)

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


theorem UInt32.toNat_modn (x : UInt32) (n) : (x.modn n).toNat = x.toNat % n


theorem dvdNotUnit_of_dvd_of_not_dvd {a b : α} (hd : a ∣ b) (hnd : ¬b ∣ a) : DvdNotUnit a b

{α : Type u_1}
[CommMonoidWithZero α]
{a b : α}
(hd : a ∣ b)
(hnd : ¬b ∣ a)


@[to_additive]
theorem zpow_trick {G : Type*} [Group G] (a b : G) (n m : ℤ) :
    a * b ^ n * b ^ m = a * b ^ (n + m)

{G : Type u_1}
[Group G]
(a b : G)
(n m : ℤ)


theorem separable_iff_derivative_ne_zero {f : F[X]} (hf : Irreducible f) :
    f.Separable ↔ derivative f ≠ 0

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

f.Separable ↔ Polynomial.derivative f ≠ 0


@[to_additive]
theorem mul_inv_of_eq {a : α} (h : ↑u = a) : a * ↑u⁻¹ = 1

{α : Type u}
[AddMonoid α]
{u : AddUnits α}
{a : α}
(h : ↑u = a)


/-- The natural isomorphism from restriction along the identity homomorphism to
the identity functor on `Action V G`.
-/
@[simps!]
def resId {G : MonCat} : res V (𝟙 G) ≅ 𝟭 (Action V G)

(V : Type (u + 1))
[CategoryTheory.LargeCategory V]
{G : MonCat}
(X : Action V G)

((Action.resId V).hom.app X).hom = 𝟙 X.V


theorem adj_comm (u v : V) : G.Adj u v ↔ G.Adj v u

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


theorem parallel_comm {s₁ s₂ : AffineSubspace k P} : s₁ ∥ s₂ ↔ s₂ ∥ s₁

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

s₁ ∥ s₂ ↔ s₂ ∥ s₁


theorem values_eq_on_of_interpolate_eq (hvs : Set.InjOn v s)
    (hrr' : interpolate s v r = interpolate s v r') : ∀ i ∈ s, r i = r' i

(hrr' : (Lagrange.interpolate s v) r = (Lagrange.interpolate s v) r')


@[to_additive]
theorem mul_mul_inv_cancel'_right (a b : G) : a * (b * a⁻¹) = b

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


@[to_additive]
theorem mem_powers_of_prime_card {G : Type*} [Group G] {_ : Fintype G} {p : ℕ} [hp : Fact p.Prime]
    (h : Fintype.card G = p) {g g' : G} (hg : g ≠ 1) : g' ∈ Submonoid.powers g

∀ {x : Fintype G} {p : ℕ} [hp : Fact (Nat.Prime p)], Fintype.card G = p → ∀ {g g' : G}, g ≠ 1 → g' ∈ Submonoid.powers g


theorem ne_of_gt {a b : α} (h : b < a) : a ≠ b

{α : Type u}
[Preorder α]
{a b : α}
(h : b < a)


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

{𝕜 : Type u_1}
{F : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
{f : F → 𝕜}
{f' x : F}
{s : Set F}
{f₁ : F → 𝕜}
(h : HasGradientWithinAt f f' s x)
(h₁ : f₁ =ᶠ[𝓝[s] x] f)
(hx : f₁ x = f x)


@[simp]
theorem sqrt_lt_sqrt_iff (hx : 0 ≤ x) : √x < √y ↔ x < y


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

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


@[simp]
theorem nsmul_univ {α : Type*} [AddMonoid α] : ∀ {n : ℕ}, n ≠ 0 → n • (univ : Set α) = univ


/-- Two intermediate fields are equal if they have the same elements. -/
@[ext]
theorem ext {S T : IntermediateField K L} (h : ∀ x, x ∈ S ↔ x ∈ T) : S = T

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
{S T : IntermediateField K L}
(h : ∀ (x : L), x ∈ S ↔ x ∈ T)


/-- A functor which commutes with the shift by `ℤ` is triangulated if
it sends distinguished triangles to distinguished triangles. -/
class IsTriangulated : Prop where
  map_distinguished (T : Triangle C) : (T ∈ distTriang C) → F.mapTriangle.obj T ∈ distTriang D

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

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

(T : CategoryTheory.Pretriangulated.Triangle C)

T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles →
  F.mapTriangle.obj T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles


@[to_additive]
theorem smooth_mul_left {a : G} : Smooth I I fun b : G => a * b

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[Mul G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothMul I G]
{a : G}


@[to_additive]
theorem zpow_trick_one {G : Type*} [Group G] (a b : G) (m : ℤ) :
    a * b * b ^ m = a * b ^ (m + 1)

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


private theorem measure_of_restrictNonposSeq (hi₂ : ¬s ≤[i] 0) (n : ℕ)
    (hn : ¬s ≤[i \ ⋃ k < n, restrictNonposSeq s i k] 0) : 0 < s (restrictNonposSeq s i n)

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

(hn :
  ¬MeasureTheory.VectorMeasure.restrict s
        (i \ ⋃ k, ⋃ (_ : k < n), MeasureTheory.SignedMeasure.restrictNonposSeq s i k) ≤
      MeasureTheory.VectorMeasure.restrict 0
        (i \ ⋃ k, ⋃ (_ : k < n), MeasureTheory.SignedMeasure.restrictNonposSeq s i k))

0 < ↑s (MeasureTheory.SignedMeasure.restrictNonposSeq s i n)


/-- Specialisation of `Nat.cast_pos'`, which seems to be easier for Lean to use. -/
@[simp]
theorem cast_pos {α} [OrderedSemiring α] [Nontrivial α] {n : ℕ} : (0 : α) < n ↔ 0 < n

{α : Type u_3}
[OrderedSemiring α]
[Nontrivial α]
{n : ℕ}


/-- A functor preserves epimorphisms if it maps epimorphisms to epimorphisms. -/
class PreservesEpimorphisms (F : C ⥤ D) : Prop where
  /-- A functor preserves epimorphisms if it maps epimorphisms to epimorphisms. -/
  preserves : ∀ {X Y : C} (f : X ⟶ Y) [Epi f], Epi (F.map f)

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


theorem _root_.Commute.ofNat_left (n : ℕ) [n.AtLeastTwo] (x : α) : Commute (OfNat.ofNat n) x

{α : Type u_1}
[NonAssocSemiring α]
(n : ℕ)
[n.AtLeastTwo]
(x : α)


lemma Surjective.comp_iff [Surjective f] : Surjective (f ≫ g) ↔ Surjective g

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

AlgebraicGeometry.Surjective (f ≫ g) ↔ AlgebraicGeometry.Surjective g


theorem card_le_card {s t : Set α} [Fintype s] [Fintype t] (hsub : s ⊆ t) :
    Fintype.card s ≤ Fintype.card t

{α : Type u}
{s t : Set α}
[Fintype ↑s]
[Fintype ↑t]
(hsub : s ⊆ t)


theorem formPerm_apply_lt_getElem (xs : List α) (h : Nodup xs) (n : ℕ) (hn : n + 1 < xs.length) :
    formPerm xs (xs[n]'((Nat.lt_succ_self n).trans hn)) = xs[n + 1]

{α : Type u_1}
[DecidableEq α]
(xs : List α)
(h : xs.Nodup)
(n : ℕ)
(hn : n + 1 < xs.length)


@[simp]
theorem mem_univ {A : Class.{u}} : A ∈ univ.{u} ↔ ∃ x : ZFSet.{u}, ↑x = A


theorem hasStrictFDerivAt_exp_real (x : ℂ) : HasStrictFDerivAt exp (exp x • (1 : ℂ →L[ℝ] ℂ)) x

HasStrictFDerivAt Complex.exp (Complex.exp x • 1) x


theorem leadingCoeff_eq [Zero Γ] {x : HahnSeries Γ R} : x.leadingCoeff = x.coeff x.order

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


/-- Given a Localization map `f : M →* N` for a Submonoid `S ⊆ M`, if a `CommMonoid` map
`g : M →* P` induces a map `f.lift hg : N →* P` then for all `z : N`, we have
`g y * f.lift hg z = g x`, where `x : M, y ∈ S` are such that `z * f y = f x`. -/
@[to_additive
    "Given a Localization map `f : M →+ N` for a Submonoid `S ⊆ M`, if an `AddCommMonoid` map
`g : M →+ P` induces a map `f.lift hg : N →+ P` then for all `z : N`, we have
`g y + f.lift hg z = g x`, where `x : M, y ∈ S` are such that `z + f y = f x`."]
theorem lift_mul_left (z) : g (f.sec z).2 * f.lift hg z = g (f.sec z).1

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
{P : Type u_3}
[AddCommMonoid P]
(f : S.LocalizationMap N)
{g : M →+ P}
(hg : ∀ (y : ↥S), IsAddUnit (g ↑y))
(z : N)

g ↑(f.sec z).2 + (f.lift hg) z = g (f.sec z).1


theorem constOn_of_comp (cont : ContinuousOn g s)
    (he : ∀ a ∈ s, ∀ a' ∈ s, f (g a) = f (g a'))
    {a a'} (ha : a ∈ s) (ha' : a' ∈ s) : g a = g a'


@[simp]
theorem ofLinear_symm_toLinearMap {h₁ h₂} : (ofLinear f g h₁ h₂ : M ≃ₛₗ[σ₁₂] M₂).symm = g

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_8}
{M₂ : Type u_10}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
{module_M : Module R M}
{module_M₂ : Module R₂ M₂}
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
{re₁₂ : RingHomInvPair σ₁₂ σ₂₁}
{re₂₁ : RingHomInvPair σ₂₁ σ₁₂}
(f : M →ₛₗ[σ₁₂] M₂)
(g : M₂ →ₛₗ[σ₂₁] M)
{h₁ : f.comp g = LinearMap.id}
{h₂ : g.comp f = LinearMap.id}

↑(LinearEquiv.ofLinear f g h₁ h₂).symm = g


@[simp]
theorem revPerm_symm : (@revPerm n).symm = revPerm


/-- The convolution `f * g` is continuous if `f` is locally integrable and `g` is continuous and
compactly supported. Version where `g` depends on an additional parameter in a subset `s` of
a parameter space `P` (and the compact support `k` is independent of the parameter in `s`). -/
theorem continuousOn_convolution_right_with_param {g : P → G → E'} {s : Set P} {k : Set G}
    (hk : IsCompact k) (hgs : ∀ p, ∀ x, p ∈ s → x ∉ k → g p x = 0)
    (hf : LocallyIntegrable f μ) (hg : ContinuousOn (↿g) (s ×ˢ univ)) :
    ContinuousOn (fun q : P × G => (f ⋆[L, μ] g q.1) q.2) (s ×ˢ univ)

(hgs : ∀ (p : P) (x : G), p ∈ s → x ∉ k → g p x = 0)

(hf : MeasureTheory.LocallyIntegrable f μ)

(hg : ContinuousOn (↿g) (s ×ˢ Set.univ))

ContinuousOn (fun q => MeasureTheory.convolution f (g q.1) L μ q.2) (s ×ˢ Set.univ)


/-- The maximum of locally Lipschitz functions is locally Lipschitz. -/
protected lemma max (hf : LocallyLipschitz f) (hg : LocallyLipschitz g) :
    LocallyLipschitz (fun x => max (f x) (g x))

{α : Type u}
[PseudoEMetricSpace α]
{f g : α → ℝ}
(hf : LocallyLipschitz f)
(hg : LocallyLipschitz g)

LocallyLipschitz fun x => max (f x) (g x)


lemma Monotone.image_Icc_subset (h : Monotone f) : f '' Icc a b ⊆ Icc (f a) (f b)

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


@[simp]
theorem coe_star (S : Subalgebra R A) : ((star S : Subalgebra R A) : Set A) = star (S : Set A)

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
(S : Subalgebra R A)


@[simp]
theorem insert_eq_of_mem (h : a ∈ s) : insert a s = s

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


@[simp]
theorem concatRec_nil (u : V) :
    @concatRec _ _ motive @Hnil @Hconcat _ _ (nil : G.Walk u u) = Hnil

{motive : (u v : V) → G.Walk u v → Sort u_1}

(Hnil : {u : V} → motive u u SimpleGraph.Walk.nil)

(Hconcat : {u v w : V} → (p : G.Walk u v) → (h : G.Adj v w) → motive u v p → motive u w (p.concat h))

SimpleGraph.Walk.concatRec Hnil Hconcat SimpleGraph.Walk.nil = Hnil


theorem mdifferentiableOn_snd {s : Set (M × M')} : MDifferentiableOn (I.prod I') I' Prod.snd s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
(I' : ModelWithCorners 𝕜 E' H')
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
[SmoothManifoldWithCorners I' M']
{s : Set (M × M')}


theorem isLocalization_stalk (x : U) :
    IsLocalization.AtPrime (X.presheaf.stalk x) (hU.primeIdealOf x).asIdeal

{X : AlgebraicGeometry.Scheme}
{U : X.Opens}
(hU : AlgebraicGeometry.IsAffineOpen U)
(x : ↥U)

IsLocalization.AtPrime (↑(X.presheaf.stalk ↑x)) (hU.primeIdealOf x).asIdeal


theorem sum_tmul {α : Type*} (s : Finset α) (m : α → M) (n : N) :
    (∑ a ∈ s, m a) ⊗ₜ[R] n = ∑ a ∈ s, m a ⊗ₜ[R] n

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
{α : Type u_10}
(s : Finset α)
(m : α → M)
(n : N)


/-- **Fundamental theorem of calculus-2**, on semi-infinite intervals `(a, +∞)`.
When a function has a limit at infinity `m`, and its derivative is integrable, then the
integral of the derivative on `(a, +∞)` is `m - f a`. Version assuming differentiability
on `(a, +∞)` and continuity at `a⁺`.

Note that such a function always has a limit at infinity,
see `tendsto_limUnder_of_hasDerivAt_of_integrableOn_Ioi`. -/
theorem integral_Ioi_of_hasDerivAt_of_tendsto (hcont : ContinuousWithinAt f (Ici a) a)
    (hderiv : ∀ x ∈ Ioi a, HasDerivAt f (f' x) x) (f'int : IntegrableOn f' (Ioi a))
    (hf : Tendsto f atTop (𝓝 m)) : ∫ x in Ioi a, f' x = m - f a

(hcont : ContinuousWithinAt f (Set.Ici a) a)

(hderiv : ∀ x ∈ Set.Ioi a, HasDerivAt f (f' x) x)

(f'int : MeasureTheory.IntegrableOn f' (Set.Ioi a) MeasureTheory.volume)

(hf : Filter.Tendsto f Filter.atTop (𝓝 m))


/-- The reflection of a point in a subspace is contained in any larger
subspace containing both the point and the subspace reflected in. -/
theorem reflection_mem_of_le_of_mem {s₁ s₂ : AffineSubspace ℝ P} [Nonempty s₁]
    [HasOrthogonalProjection s₁.direction] (hle : s₁ ≤ s₂) {p : P} (hp : p ∈ s₂) :
    reflection s₁ p ∈ s₂

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

(EuclideanGeometry.reflection s₁) p ∈ s₂


lemma lt_div_mul_add (hb : 0 < b) : a < a / b * b + b


@[simp]
lemma map_map {j : J} {X Y : C (g j)} (f : X ⟶ Y) :
    (Sigma.map C g).map (SigmaHom.mk f) = SigmaHom.mk f

[(i : I) → CategoryTheory.Category.{v₁, u₁} (C i)]

(CategoryTheory.Sigma.map C g).map (CategoryTheory.Sigma.SigmaHom.mk f) = CategoryTheory.Sigma.SigmaHom.mk f


lemma Lp.coeFn_const : Lp.const p μ c =ᵐ[μ] Function.const α c

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

↑↑((MeasureTheory.Lp.const p μ) c) =ᵐ[μ] Function.const α c


@[reassoc (attr := simp)]
theorem biprod.inr_desc {W X Y : C} [HasBinaryBiproduct X Y] (f : X ⟶ W) (g : Y ⟶ W) :
    biprod.inr ≫ biprod.desc f g = g

CategoryTheory.Limits.biprod.inr ≫ CategoryTheory.Limits.biprod.desc f g = g


@[to_additive (attr := simp,norm_cast)]
theorem coe_mul (s t : LowerSet α) : (↑(s * t) : Set α) = s * t

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


theorem isClique_map_finset_iff_of_nontrivial (ht : t.Nontrivial) :
    (G.map f).IsClique t ↔ ∃ (s : Finset α), G.IsClique s ∧ s.map f = t

{α : Type u_1}
{β : Type u_2}
{G : SimpleGraph α}
{f : α ↪ β}
{t : Finset β}
(ht : t.Nontrivial)

(SimpleGraph.map f G).IsClique ↑t ↔ ∃ s, G.IsClique ↑s ∧ Finset.map f s = t


lemma inf_iSup₂_eq {f : ∀ i, κ i → α} (a : α) : (a ⊓ ⨆ i, ⨆ j, f i j) = ⨆ i, ⨆ j, a ⊓ f i j

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

a ⊓ ⨆ i, ⨆ j, f i j = ⨆ i, ⨆ j, a ⊓ f i j


theorem Finsupp.sum_sum_index' : (∑ x ∈ s, f x).sum t = ∑ x ∈ s, (f x).sum t

(h1 : ∀ (i : ι) (x y : A), t i (x + y) = t i x + t i y)

{f : α → ι →₀ A}


@[simp]
theorem le_zero_iff {I : FractionalIdeal S P} : I ≤ 0 ↔ I = 0

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
{I : FractionalIdeal S P}


theorem self_add_star : a + star a = 2 * a.re

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(a : ℍ[R,c₁,c₂])


@[simp]
lemma conj_apply {ι : Type*} {α : ι → Type*} [∀ i, CommSemiring (α i)] [∀ i, StarRing (α i)]
    (f : ∀ i, α i) (i : ι) : conj f i = conj (f i)

{ι : Type u_1}
{α : ι → Type u_2}
[(i : ι) → CommSemiring (α i)]
[(i : ι) → StarRing (α i)]
(f : (i : ι) → α i)
(i : ι)

(starRingEnd ((i : ι) → α i)) f i = (starRingEnd (α i)) (f i)


theorem hom_eval₂ (x : S) : g (p.eval₂ f x) = p.eval₂ (g.comp f) (g x)

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

g (Polynomial.eval₂ f x p) = Polynomial.eval₂ (g.comp f) (g x) p


private theorem mul_ne_zero_of_pos_of_ne_zero [OrderedSemiring α] [NoZeroDivisors α]
    {a b : α} (ha : 0 < a) (hb : b ≠ 0) : a * b ≠ 0

{α : Type u_1}
[OrderedSemiring α]
[NoZeroDivisors α]
{a b : α}
(ha : 0 < a)
(hb : b ≠ 0)


@[simp] theorem getLsb_not {x : BitVec v} : (~~~x).getLsb i = (decide (i < v) && ! x.getLsb i)

(~~~x).getLsb i = (decide (i < v) && !x.getLsb i)


/-- `Language.reverse` as a ring isomorphism to the opposite ring. -/
@[simps]
def reverseIso : Language α ≃+* (Language α)ᵐᵒᵖ

(Language.reverseIso α) l = MulOpposite.op l.reverse


theorem exists₄_congr {p q : ∀ a b c, δ a b c → Prop} (h : ∀ a b c d, p a b c d ↔ q a b c d) :
    (∃ a b c d, p a b c d) ↔ ∃ a b c d, q a b c d

{δ : (a : α) → (b : β a) → γ a b → Sort u_4}

{p q : (a : α) → (b : β a) → (c : γ a b) → δ a b c → Prop}

(h : ∀ (a : α) (b : β a) (c : γ a b) (d : δ a b c), p a b c d ↔ q a b c d)


theorem coe_lpPiLpₗᵢ_symm [Fact (1 ≤ p)] (f : PiLp p E) :
    ((lpPiLpₗᵢ E 𝕜).symm f : ∀ i, E i) = f

{α : Type u_1}
{E : α → Type u_2}
[(i : α) → NormedAddCommGroup (E i)]
{p : ℝ≥0∞}
[Fintype α]
{𝕜 : Type u_3}
[NontriviallyNormedField 𝕜]
[(i : α) → NormedSpace 𝕜 (E i)]
[Fact (1 ≤ p)]
(f : PiLp p E)


theorem measurable_inclusion {s t : Set α} (h : s ⊆ t) : Measurable (inclusion h)

{α : Type u_1}
{m : MeasurableSpace α}
{s t : Set α}
(h : s ⊆ t)


/-- A category that has larger colimits also has smaller colimits. -/
theorem hasColimitsOfSizeOfUnivLE [UnivLE.{v₂, v₁}] [UnivLE.{u₂, u₁}]
    [HasColimitsOfSize.{v₁, u₁} C] : HasColimitsOfSize.{v₂, u₂} C

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

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


/-- Application of a `ContinuousMultilinearMap` to a constant commutes with `fderiv`. -/
theorem fderiv_continuousMultilinear_apply_const_apply (hc : DifferentiableAt 𝕜 c x)
    (u : ∀ i, M i) (m : E) :
    (fderiv 𝕜 (fun y ↦ (c y) u) x) m = (fderiv 𝕜 c x) m u

{c : E → ContinuousMultilinearMap 𝕜 M H}

(fderiv 𝕜 (fun y => (c y) u) x) m = ((fderiv 𝕜 c x) m) u


theorem Sum.uniformity : 𝓤 (α ⊕ β) = map (Prod.map inl inl) (𝓤 α) ⊔ map (Prod.map inr inr) (𝓤 β)

{α : Type ua}
{β : Type ub}
[UniformSpace α]
[UniformSpace β]

𝓤 (α ⊕ β) = Filter.map (Prod.map Sum.inl Sum.inl) (𝓤 α) ⊔ Filter.map (Prod.map Sum.inr Sum.inr) (𝓤 β)


protected theorem add_div_of_dvd_right {a b c : ℕ} (hca : c ∣ a) : (a + b) / c = a / c + b / c


@[simp] theorem eraseIdx_zero (l : List α) : eraseIdx l 0 = tail l


theorem centralizer_le {R} [NonUnitalSemiring R] (s t : Set R) (h : s ⊆ t) :
    centralizer t ≤ centralizer s

{R : Type u_1}
[NonUnitalSemiring R]
(s t : Set R)
(h : s ⊆ t)

NonUnitalSubsemiring.centralizer t ≤ NonUnitalSubsemiring.centralizer s


/-- A Mayer-Vietoris square in a category `C` equipped with a Grothendieck
topology consists of a commutative square `f₁₂ ≫ f₂₄ = f₁₃ ≫ f₃₄` in `C`
such that `f₁₃` is a monomorphism and that the square becomes a
pushout square in the category of sheaves of sets. -/
structure MayerVietorisSquare extends Square C where
  mono_f₁₃ : Mono toSquare.f₁₃ := by infer_instance
  /-- the square becomes a pushout square in the category of sheaves of types -/
  isPushout : (toSquare.map (yoneda ⋙ presheafToSheaf J _)).IsPushout

{J : CategoryTheory.GrothendieckTopology C}

[CategoryTheory.HasWeakSheafify J (Type v)]


theorem prod_self_eq_iUnion_perm (hf : f.IsCycleOn s) :
    s ×ˢ s = ⋃ n : ℤ, (fun a => (a, (f ^ n) a)) '' s

{α : Type u_2}
{f : Equiv.Perm α}
{s : Set α}
(hf : f.IsCycleOn s)

s ×ˢ s = ⋃ n, (fun a => (a, (f ^ n) a)) '' s


/-- Given an action of a group `α` on `β`, each `g : α` defines a permutation of `β`. -/
@[to_additive (attr := simps)]
def MulAction.toPerm (a : α) : Equiv.Perm β

{α : Type u_1}
{β : Type u_2}
[Group α]
[MulAction α β]
(a : α)
(x : β)


theorem nhds_basis_abs_convex :
    (𝓝 (0 : E)).HasBasis (fun s : Set E => s ∈ 𝓝 (0 : E) ∧ Balanced 𝕜 s ∧ Convex ℝ s) id

(𝕜 : Type u_1)
(E : Type u_2)
[NontriviallyNormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[Module ℝ E]
[SMulCommClass ℝ 𝕜 E]
[TopologicalSpace E]
[LocallyConvexSpace ℝ E]
[ContinuousSMul 𝕜 E]

(𝓝 0).HasBasis (fun s => s ∈ 𝓝 0 ∧ Balanced 𝕜 s ∧ Convex ℝ s) id


theorem interchange (fs : Stream' (α → β)) (a : α) :
    fs ⊛ pure a = (pure fun f : α → β => f a) ⊛ fs

{α : Type u}
{β : Type v}
(fs : Stream' (α → β))
(a : α)

fs ⊛ Stream'.pure a = (Stream'.pure fun f => f a) ⊛ fs


theorem std_basis_eq_basis_mul_basis (i : m) (j : n) :
    stdBasisMatrix i j (1 : α) =
      vecMulVec (fun i' => ite (i = i') 1 0) fun j' => ite (j = j') 1 0

{m : Type u_2}
{n : Type u_3}
{α : Type u_5}
[DecidableEq m]
[DecidableEq n]
[Semiring α]
(i : m)
(j : n)

Matrix.stdBasisMatrix i j 1 = Matrix.vecMulVec (fun i' => if i = i' then 1 else 0) fun j' => if j = j' then 1 else 0


lemma mem_uIoc : a ∈ Ι b c ↔ b < a ∧ a ≤ c ∨ c < a ∧ a ≤ b

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


theorem pthRoot_frobenius : (pthRoot R p).comp (frobenius _ p) = RingHom.id _

{R : Type u₁}
[CommSemiring R]
{p : ℕ}
[hp : Fact (Nat.Prime p)]
[CharP R p]

(Perfection.pthRoot R p).comp (frobenius (Ring.Perfection R p) p) = RingHom.id (Ring.Perfection R p)


theorem evaln_sound : ∀ {k c n x}, x ∈ evaln k c n → x ∈ eval c n

{k : ℕ}
{c : Nat.Partrec.Code}
{n x : ℕ}

x ∈ Nat.Partrec.Code.evaln k c n → x ∈ c.eval n


@[simp]
theorem preimage_neg_Iic : -Iic a = Ici (-a)

{α : Type u_1}
[OrderedAddCommGroup α]
(a : α)


/-- Reflecting twice in the same subspace. -/
@[simp]
theorem reflection_reflection (p : E) : reflection K (reflection K p) = p

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


@[to_additive]
lemma HasProd.tprod_fiberwise [T2Space α] {f : β → α} {a : α} (hf : HasProd f a) (g : β → γ) :
    HasProd (fun c : γ ↦ ∏' b : g ⁻¹' {c}, f b) a

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[AddCommGroup α]
[UniformSpace α]
[UniformAddGroup α]
[CompleteSpace α]
[T2Space α]
{f : β → α}
{a : α}
(hf : HasSum f a)
(g : β → γ)

HasSum (fun c => ∑' (b : ↑(g ⁻¹' {c})), f ↑b) a


/-- Removing a non-isolated point from a dense set, one still obtains a dense set. -/
theorem Dense.diff_singleton [T1Space X] {s : Set X} (hs : Dense s) (x : X) [NeBot (𝓝[≠] x)] :
    Dense (s \ {x})

{X : Type u_1}
[TopologicalSpace X]
[T1Space X]
{s : Set X}
(hs : Dense s)
(x : X)
[(𝓝[≠] x).NeBot]


theorem compares_swap [LT α] {a b : α} {o : Ordering} : o.swap.Compares a b ↔ o.Compares b a

{α : Type u_1}
[LT α]
{a b : α}
{o : Ordering}


/-- If the multiplication is smooth, then it is continuous. This is not an instance for technical
reasons, see note [Design choices about smooth algebraic structures]. -/
@[to_additive "If the addition is smooth, then it is continuous. This is not an instance for
technical reasons, see note [Design choices about smooth algebraic structures]."]
theorem continuousMul_of_smooth : ContinuousMul G

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
(I : ModelWithCorners 𝕜 E H)
{G : Type u_4}
[Add G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothAdd I G]


/-- The fifth simplicial identity -/
@[reassoc]
theorem σ_comp_σ {n} {i j : Fin (n + 1)} (H : i ≤ j) :
    X.σ j ≫ X.σ (Fin.castSucc i) = X.σ i ≫ X.σ j.succ

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(X : CategoryTheory.SimplicialObject C)
{n : ℕ}
{i j : Fin (n + 1)}
(H : i ≤ j)

X.σ j ≫ X.σ i.castSucc = X.σ i ≫ X.σ j.succ


/-- If a set of functions is equicontinuous, its closure for the product topology is also
equicontinuous. This would also be true for the coarser topology of pointwise convergence on `S`,
see `EquicontinuousOn.closure'`. -/
protected theorem Set.EquicontinuousOn.closure {A : Set <| X → α} {S : Set X}
    (hA : A.EquicontinuousOn S) : (closure A).EquicontinuousOn S

{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
{A : Set (X → α)}
{S : Set X}
(hA : A.EquicontinuousOn S)


/-- A vector addition is cancellative if it is pointwise injective on the left and right. -/
class IsCancelVAdd (G P : Type*) [VAdd G P] : Prop where
  protected left_cancel : ∀ (a : G) (b c : P), a +ᵥ b = a +ᵥ c → b = c
  protected right_cancel : ∀ (a b : G) (c : P), a +ᵥ c = b +ᵥ c → a = b

{G : Type u_3}
{P : Type u_4}
[VAdd G P]
[self : IsCancelVAdd G P]
(a : G)
(b c : P)


{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(a b : ℍ[R,c₁,c₂])

(a * b).re = a.re * b.re + c₁ * a.imI * b.imI + c₂ * a.imJ * b.imJ - c₁ * c₂ * a.imK * b.imK


/-- The equivalence between a quaternion algebra over `R` and `Fin 4 → R`. -/
@[simps symm_apply]
def equivTuple {R : Type*} (c₁ c₂ : R) : ℍ[R,c₁,c₂] ≃ (Fin 4 → R)

{R : Type u_1}
(c₁ c₂ : R)
(a : Fin 4 → R)

(QuaternionAlgebra.equivTuple c₁ c₂).symm a = { re := a 0, imI := a 1, imJ := a 2, imK := a 3 }


@[simp] theorem preimage_uIcc [Lattice β] (e : α ↪o β) (x y : α) :
    e ⁻¹' (uIcc (e x) (e y)) = uIcc x y

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

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


theorem inv_intCast_num_of_pos {a : ℤ} (ha0 : 0 < a) : (a : ℚ)⁻¹.num = 1


theorem split_imp_of_iso {X X' : C} (φ : X ≅ X') (p : X ⟶ X) (p' : X' ⟶ X')
    (hpp' : p ≫ φ.hom = φ.hom ≫ p')
    (h : ∃ (Y : C) (i : Y ⟶ X) (e : X ⟶ Y), i ≫ e = 𝟙 Y ∧ e ≫ i = p) :
    ∃ (Y' : C) (i' : Y' ⟶ X') (e' : X' ⟶ Y'), i' ≫ e' = 𝟙 Y' ∧ e' ≫ i' = p'

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{X X' : C}
(φ : X ≅ X')
(p : X ⟶ X)
(p' : X' ⟶ X')
(hpp' : p ≫ φ.hom = φ.hom ≫ p')
(h : ∃ Y i e, i ≫ e = 𝟙 Y ∧ e ≫ i = p)

∃ Y' i' e', i' ≫ e' = 𝟙 Y' ∧ e' ≫ i' = p'


@[simp]
theorem coord_apply_eq (i : ι) : b.coord i (b i) = 1

{ι : Type u_1}
{k : Type u_3}
{V : Type u_4}
{P : Type u_5}
[AddCommGroup V]
[AffineSpace V P]
[Ring k]
[Module k V]
(b : AffineBasis ι k P)
(i : ι)


theorem degree_of_c_eq_zero (ha : P.a = 0) (hb : P.b = 0) (hc : P.c = 0) : P.toPoly.degree ≤ 0

{R : Type u_1}
{P : Cubic R}
[Semiring R]
(ha : P.a = 0)
(hb : P.b = 0)
(hc : P.c = 0)


theorem bsup_id_limit {o : Ordinal} : (∀ a < o, succ a < o) → (bsup.{u, u} o fun x _ => x) = o

(∀ a < o, Order.succ a < o) → (o.bsup fun x x_1 => x) = o


/-- A measurable set of negative measure has a negative subset of negative measure. -/
theorem exists_subset_restrict_nonpos (hi : s i < 0) :
    ∃ j : Set α, MeasurableSet j ∧ j ⊆ i ∧ s ≤[j] 0 ∧ s j < 0

{α : Type u_1}
[MeasurableSpace α]
{s : MeasureTheory.SignedMeasure α}
{i : Set α}
(hi : ↑s i < 0)

∃ j,
  MeasurableSet j ∧
    j ⊆ i ∧ MeasureTheory.VectorMeasure.restrict s j ≤ MeasureTheory.VectorMeasure.restrict 0 j ∧ ↑s j < 0


@[simp]
theorem carrier_eq_coe (s : UpperSet α) : s.carrier = s


lemma ker_eq_ker_aeval_val : P.ker = RingHom.ker (aeval P.val)

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

P.ker = RingHom.ker (MvPolynomial.aeval P.val)


theorem is_basis_iff_det {v : ι → M} :
    LinearIndependent R v ∧ span R (Set.range v) = ⊤ ↔ IsUnit (e.det v)

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

LinearIndependent R v ∧ Submodule.span R (Set.range v) = ⊤ ↔ IsUnit (e.det v)


/-- A set is a neighborhood of `a` within `(a, +∞)` if and only if it contains an interval `(a, u)`
with `a < u`. -/
theorem mem_nhdsWithin_Ioi_iff_exists_Ioo_subset [NoMaxOrder α] {a : α} {s : Set α} :
    s ∈ 𝓝[>] a ↔ ∃ u ∈ Ioi a, Ioo a u ⊆ s

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

s ∈ 𝓝[>] a ↔ ∃ u ∈ Set.Ioi a, Set.Ioo a u ⊆ s


@[to_additive]
theorem prod_finset_product' (r : Finset (γ × α)) (s : Finset γ) (t : γ → Finset α)
    (h : ∀ p : γ × α, p ∈ r ↔ p.1 ∈ s ∧ p.2 ∈ t p.1) {f : γ → α → β} :
    ∏ p ∈ r, f p.1 p.2 = ∏ c ∈ s, ∏ a ∈ t c, f c a

(h : ∀ (p : γ × α), p ∈ r ↔ p.1 ∈ s ∧ p.2 ∈ t p.1)

{f : γ → α → β}

∑ p ∈ r, f p.1 p.2 = ∑ c ∈ s, ∑ a ∈ t c, f c a


theorem orthogonalProjection_eq_linear_proj [HasOrthogonalProjection K] (x : E) :
    orthogonalProjection K x =
      K.linearProjOfIsCompl _ Submodule.isCompl_orthogonal_of_completeSpace x

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

(orthogonalProjection K) x = (K.linearProjOfIsCompl Kᗮ ⋯) x


/-- A preirreducible space is one where there is no non-trivial pair of disjoint opens. -/
class PreirreducibleSpace (X : Type*) [TopologicalSpace X] : Prop where
  /-- In a preirreducible space, `Set.univ` is a preirreducible set. -/
  isPreirreducible_univ : IsPreirreducible (univ : Set X)

{X : Type u_3}
[TopologicalSpace X]
[self : PreirreducibleSpace X]


theorem toLp_sub (f g : α →ₛ E) (hf : Memℒp f p μ) (hg : Memℒp g p μ) :
    toLp (f - g) (hf.sub hg) = toLp f hf - toLp g hg

{α : Type u_1}
{E : Type u_4}
[MeasurableSpace α]
[NormedAddCommGroup E]
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
(f g : MeasureTheory.SimpleFunc α E)
(hf : MeasureTheory.Memℒp (↑f) p μ)
(hg : MeasureTheory.Memℒp (↑g) p μ)

MeasureTheory.Lp.simpleFunc.toLp (f - g) ⋯ =
  MeasureTheory.Lp.simpleFunc.toLp f hf - MeasureTheory.Lp.simpleFunc.toLp g hg


theorem laverage_union_mem_segment (hd : AEDisjoint μ s t) (ht : NullMeasurableSet t μ)
    (hsμ : μ s ≠ ∞) (htμ : μ t ≠ ∞) :
    ⨍⁻ x in s ∪ t, f x ∂μ ∈ [⨍⁻ x in s, f x ∂μ -[ℝ≥0∞] ⨍⁻ x in t, f x ∂μ]

{f : α → ℝ≥0∞}

(ht : MeasureTheory.NullMeasurableSet t μ)

⨍⁻ (x : α) in s ∪ t, f x ∂μ ∈ [⨍⁻ (x : α) in s, f x ∂μ-[ℝ≥0∞]⨍⁻ (x : α) in t, f x ∂μ]


/-- `PInfty` factors through the normalized Moore complex -/
@[simps!]
def PInftyToNormalizedMooreComplex (X : SimplicialObject A) : K[X] ⟶ N[X]

{A : Type u_1}
[CategoryTheory.Category.{u_2, u_1} A]
[CategoryTheory.Abelian A]
(X : CategoryTheory.SimplicialObject A)
(n : ℕ)

(AlgebraicTopology.DoldKan.PInftyToNormalizedMooreComplex X).f n =
  (AlgebraicTopology.NormalizedMooreComplex.objX X n).factorThru (AlgebraicTopology.DoldKan.PInfty.f n) ⋯


@[to_additive lt_of_nsmul_lt_nsmul_right]
theorem lt_of_pow_lt_pow_left' {a b : M} (n : ℕ) : a ^ n < b ^ n → a < b

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

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


lemma X_eq_of_equiv {P Q : Fin 3 → R} (h : P ≈ Q) : P x * Q z ^ 2 = Q x * P z ^ 2

{R : Type u}
[CommRing R]
{P Q : Fin 3 → R}
(h : P ≈ Q)


@[simp]
theorem descFOne_zero_comm {Y Z : C} (f : Z ⟶ Y) (I : InjectiveResolution Y)
    (J : InjectiveResolution Z) :
    J.cocomplex.d 0 1 ≫ descFOne f I J = descFZero f I J ≫ I.cocomplex.d 0 1

(I : CategoryTheory.InjectiveResolution Y)

(J : CategoryTheory.InjectiveResolution Z)

J.cocomplex.d 0 1 ≫ CategoryTheory.InjectiveResolution.descFOne f I J =
  CategoryTheory.InjectiveResolution.descFZero f I J ≫ I.cocomplex.d 0 1


@[to_additive]
theorem Multipliable.sigma_factor {γ : β → Type*} {f : (Σb : β, γ b) → α}
    (ha : Multipliable f) (b : β) :
    Multipliable fun c ↦ f ⟨b, c⟩

{α : Type u_1}
{β : Type u_2}
[CommGroup α]
[UniformSpace α]
[UniformGroup α]
[CompleteSpace α]
{γ : β → Type u_5}
{f : (b : β) × γ b → α}
(ha : Multipliable f)
(b : β)


/-- A natural transformation between functors induces a functor between the categories of elements.
-/
@[simps]
def map {F₁ F₂ : C ⥤ Type w} (α : F₁ ⟶ F₂) : F₁.Elements ⥤ F₂.Elements

{F₁ F₂ : CategoryTheory.Functor C (Type w)}

((CategoryTheory.CategoryOfElements.map α).obj t).fst = t.fst


@[simp]
theorem monomialOneHom_apply : monomialOneHom R σ s = (monomial s 1 : MvPolynomial σ R)

{R : Type u}
{σ : Type u_1}
{s : σ →₀ ℕ}
[CommSemiring R]

(MvPolynomial.monomialOneHom R σ) s = (MvPolynomial.monomial s) 1


@[to_additive (attr := measurability)]
protected theorem smul_const {𝕜} [TopologicalSpace 𝕜] [SMul 𝕜 β] [ContinuousSMul 𝕜 β] {f : α → 𝕜}
    (hf : AEStronglyMeasurable f μ) (c : β) : AEStronglyMeasurable (fun x => f x • c) μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.AEStronglyMeasurable (fun x => f x • c) μ


@[reassoc (attr := simp)]
theorem diagonalObjPullbackFstIso_inv_fst_fst {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) :
    (diagonalObjPullbackFstIso f g).inv ≫ pullback.fst _ _ ≫ pullback.fst _ _ =
      pullback.snd _ _

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Limits.HasPullbacks C]
{X Y Z : C}
(f : X ⟶ Z)
(g : Y ⟶ Z)

(CategoryTheory.Limits.diagonalObjPullbackFstIso f g).inv ≫
    CategoryTheory.Limits.pullback.fst (CategoryTheory.Limits.pullback.fst f g)
        (CategoryTheory.Limits.pullback.fst f g) ≫
      CategoryTheory.Limits.pullback.fst f g =
  CategoryTheory.Limits.pullback.snd (CategoryTheory.Limits.pullback.snd g g ≫ g) f


theorem updateFinset_singleton {i y} :
    updateFinset x {i} y = Function.update x i (y ⟨i, mem_singleton_self i⟩)

{ι : Type u_1}
{π : ι → Sort u_2}
{x : (i : ι) → π i}
[DecidableEq ι]
{i : ι}
{y : (i_1 : { x // x ∈ {i} }) → π ↑i_1}

Function.updateFinset x {i} y = Function.update x i (y ⟨i, ⋯⟩)


/-- If `algebraMap R A` is injective and `A` has no zero divisors,
`R`-multiples in `A` are zero only if one of the factors is zero.

Cannot be an instance because there is no `Injective (algebraMap R A)` typeclass.
-/
theorem of_algebraMap_injective [CommSemiring R] [Semiring A] [Algebra R A] [NoZeroDivisors A]
    (h : Function.Injective (algebraMap R A)) : NoZeroSMulDivisors R A

(h : Function.Injective ⇑(algebraMap R A))


theorem StrictConvex.add_smul_mem (hs : StrictConvex 𝕜 s) (hx : x ∈ s) (hxy : x + y ∈ s)
    (hy : y ≠ 0) {t : 𝕜} (ht₀ : 0 < t) (ht₁ : t < 1) : x + t • y ∈ interior s

{𝕜 : Type u_1}
{E : Type u_3}
[OrderedRing 𝕜]
[TopologicalSpace E]
[AddCommGroup E]
[Module 𝕜 E]
{s : Set E}
{x y : E}
(hs : StrictConvex 𝕜 s)
(hx : x ∈ s)
(hxy : x + y ∈ s)
(hy : y ≠ 0)
{t : 𝕜}
(ht₀ : 0 < t)
(ht₁ : t < 1)


theorem tendsto_Lp_of_tendsto_ℒp {ι} {fi : Filter ι} [Fact (1 ≤ p)] {f : ι → Lp E p μ}
    (f_lim : α → E) (f_lim_ℒp : Memℒp f_lim p μ)
    (h_tendsto : fi.Tendsto (fun n => eLpNorm (⇑(f n) - f_lim) p μ) (𝓝 0)) :
    fi.Tendsto f (𝓝 (f_lim_ℒp.toLp f_lim))

(f_lim_ℒp : MeasureTheory.Memℒp f_lim p μ)

(h_tendsto : Filter.Tendsto (fun n => MeasureTheory.eLpNorm (↑↑(f n) - f_lim) p μ) fi (𝓝 0))

Filter.Tendsto f fi (𝓝 (MeasureTheory.Memℒp.toLp f_lim f_lim_ℒp))


theorem sub_lt : ∀ {n m : Nat}, 0 < n → 0 < m → n - m < n


@[simp] lemma not_mem_bot (a : α) : a ∉ (⊥ : Sublattice α)


theorem evalFrom_split [Fintype σ] {x : List α} {s t : σ} (hlen : Fintype.card σ ≤ x.length)
    (hx : M.evalFrom s x = t) :
    ∃ q a b c,
      x = a ++ b ++ c ∧
        a.length + b.length ≤ Fintype.card σ ∧
          b ≠ [] ∧ M.evalFrom s a = q ∧ M.evalFrom q b = q ∧ M.evalFrom q c = t

{α : Type u}
{σ : Type v}
(M : DFA α σ)
[Fintype σ]
{x : List α}
{s t : σ}
(hlen : Fintype.card σ ≤ x.length)
(hx : M.evalFrom s x = t)


/-- If `c` is a colimiting pushout cocone, then we have an `IsPushout f g c.inl c.inr`. -/
theorem of_isColimit {c : PushoutCocone f g} (h : Limits.IsColimit c) : IsPushout f g c.inl c.inr

{c : CategoryTheory.Limits.PushoutCocone f g}

CategoryTheory.IsPushout f g c.inl c.inr


theorem abs_exp_sub_one_sub_id_le {x : ℂ} (hx : abs x ≤ 1) : abs (exp x - 1 - x) ≤ abs x ^ 2

Complex.abs (Complex.exp x - 1 - x) ≤ Complex.abs x ^ 2


theorem convolution_integrand_bound_right_of_le_of_subset {C : ℝ} (hC : ∀ i, ‖g i‖ ≤ C) {x t : G}
    {s u : Set G} (hx : x ∈ s) (hu : -tsupport g + s ⊆ u) :
    ‖L (f t) (g (x - t))‖ ≤ u.indicator (fun t => ‖L‖ * ‖f t‖ * C) t

{𝕜 : Type u𝕜}
{G : Type uG}
{E : Type uE}
{E' : Type uE'}
{F : Type uF}
[NormedAddCommGroup E]
[NormedAddCommGroup E']
[NormedAddCommGroup F]
{f : G → E}
{g : G → E'}
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 E']
[NormedSpace 𝕜 F]
(L : E →L[𝕜] E' →L[𝕜] F)
[AddGroup G]
[TopologicalSpace G]
{C : ℝ}
(hC : ∀ (i : G), ‖g i‖ ≤ C)
{x t : G}
{s u : Set G}
(hx : x ∈ s)
(hu : -tsupport g + s ⊆ u)

‖(L (f t)) (g (x - t))‖ ≤ u.indicator (fun t => ‖L‖ * ‖f t‖ * C) t


@[simp]
theorem tendsto_dist_right_atTop_iff (c : α) {f : β → α} {l : Filter β} :
    Tendsto (fun x ↦ dist (f x) c) l atTop ↔ Tendsto f l (cobounded α)

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
(c : α)
{f : β → α}
{l : Filter β}

Filter.Tendsto (fun x => dist (f x) c) l Filter.atTop ↔ Filter.Tendsto f l (Bornology.cobounded α)


protected theorem Pos.ne_zero_of_lt : {a b : Pos} → a < b → b ≠ 0


theorem sum_homogeneousComponent :
    (∑ i ∈ range (φ.totalDegree + 1), homogeneousComponent i φ) = φ

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

∑ i ∈ Finset.range (φ.totalDegree + 1), (MvPolynomial.homogeneousComponent i) φ = φ


theorem Nonempty.of_sUnion_eq_univ [Nonempty α] {s : Set (Set α)} (h : ⋃₀s = univ) : s.Nonempty

{α : Type u_1}
[Nonempty α]
{s : Set (Set α)}
(h : ⋃₀ s = Set.univ)


@[simp] theorem coe_addNat (m : Nat) (i : Fin n) : (addNat i m : Nat) = i + m


@[simp] theorem reverse_setBlack {t : RBNode α} : (setBlack t).reverse = setBlack t.reverse


/-- The span of the empty set is the bottom of the lattice of subspaces. -/
@[simp]
theorem span_empty : span (∅ : Set (ℙ K V)) = ⊥

{K : Type u_1}
{V : Type u_2}
[Field K]
[AddCommGroup V]
[Module K V]


@[to_additive sum_lt_sum]
lemma prod_lt_prod' [Preorder M] [CovariantClass M M (· * ·) (· < ·)]
    [CovariantClass M M (· * ·) (· ≤ ·)] [CovariantClass M M (Function.swap (· * ·)) (· < ·)]
    [CovariantClass M M (Function.swap (· * ·)) (· ≤ ·)] {l : List ι} (f g : ι → M)
    (h₁ : ∀ i ∈ l, f i ≤ g i) (h₂ : ∃ i ∈ l, f i < g i) : (l.map f).prod < (l.map g).prod

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

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

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

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

(List.map f l).prod < (List.map g l).prod


@[refl]
protected theorem IsExtreme.refl (A : Set E) : IsExtreme 𝕜 A A

(𝕜 : Type u_1)
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
(A : Set E)


@[to_additive abs_sub_eq_two_nsmul_negPart]
lemma mabs_div_eq_leOnePart_sq (a : α) : |a|ₘ / a = a⁻ᵐ ^ 2

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


@[to_additive (attr := simp)]
theorem prod_image [DecidableEq α] {s : Finset γ} {g : γ → α} :
    (∀ x ∈ s, ∀ y ∈ s, g x = g y → x = y) → ∏ x ∈ s.image g, f x = ∏ x ∈ s, f (g x)

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
{f : α → β}
[CommMonoid β]
[DecidableEq α]
{s : Finset γ}
{g : γ → α}

(∀ x ∈ s, ∀ y ∈ s, g x = g y → x = y) → ∏ x ∈ Finset.image g s, f x = ∏ x ∈ s, f (g x)


/-- The strong form of **Hindman's theorem**: in any finite cover of an FP-set, one the parts
contains an FP-set. -/
@[to_additive FS_partition_regular
      "The strong form of **Hindman's theorem**: in any finite cover of
      an FS-set, one the parts contains an FS-set."]
theorem FP_partition_regular {M} [Semigroup M] (a : Stream' M) (s : Set (Set M)) (sfin : s.Finite)
    (scov : FP a ⊆ ⋃₀ s) : ∃ c ∈ s, ∃ b : Stream' M, FP b ⊆ c

{M : Type u_1}
[Semigroup M]
(a : Stream' M)
(s : Set (Set M))
(sfin : s.Finite)
(scov : Hindman.FP a ⊆ ⋃₀ s)


theorem Tendsto.prod_map {δ : Type*} {f : α → γ} {g : β → δ} {a : Filter α} {b : Filter β}
    {c : Filter γ} {d : Filter δ} (hf : Tendsto f a c) (hg : Tendsto g b d) :
    Tendsto (Prod.map f g) (a ×ˢ b) (c ×ˢ d)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_6}
{f : α → γ}
{g : β → δ}
{a : Filter α}
{b : Filter β}
{c : Filter γ}
{d : Filter δ}
(hf : Filter.Tendsto f a c)
(hg : Filter.Tendsto g b d)

Filter.Tendsto (Prod.map f g) (a ×ˢ b) (c ×ˢ d)


theorem mem_antidiagonalTuple {n : ℕ} {k : ℕ} {x : Fin k → ℕ} :
    x ∈ antidiagonalTuple k n ↔ ∑ i, x i = n

x ∈ List.Nat.antidiagonalTuple k n ↔ ∑ i : Fin k, x i = n


@[to_additive]
theorem hasProd_one_iff_of_one_le (hf : ∀ i, 1 ≤ f i) : HasProd f 1 ↔ f = 1

{ι : Type u_1}
{α : Type u_3}
[OrderedCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{f : ι → α}
(hf : ∀ (i : ι), 1 ≤ f i)


@[to_additive]
theorem IsSubgroup.inter {s₁ s₂ : Set G} (hs₁ : IsSubgroup s₁) (hs₂ : IsSubgroup s₂) :
    IsSubgroup (s₁ ∩ s₂)

{G : Type u_1}
[Group G]
{s₁ s₂ : Set G}
(hs₁ : IsSubgroup s₁)
(hs₂ : IsSubgroup s₂)


/-- A variant of `deriv_const_smul` without differentiability assumption when the scalar
multiplication is by field elements. -/
lemma deriv_const_smul' {f : 𝕜 → F} {x : 𝕜} {R : Type*} [Field R] [Module R F] [SMulCommClass 𝕜 R F]
    [ContinuousConstSMul R F] (c : R) :
    deriv (fun y ↦ c • f y) x = c • deriv f x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{x : 𝕜}
{R : Type u_3}
[Field R]
[Module R F]
[SMulCommClass 𝕜 R F]
[ContinuousConstSMul R F]
(c : R)

deriv (fun y => c • f y) x = c • deriv f x


lemma mem_set_smul (x : M) [SMulCommClass R R N] :
    x ∈ sR • N ↔ ∃ (c : R →₀ N), (c.support : Set R) ⊆ sR ∧ x = c.sum fun r m ↦ r • m

{R : Type u_2}
{M : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(sR : Set R)
(N : Submodule R M)
(x : M)
[SMulCommClass R R ↥N]

x ∈ sR • N ↔ ∃ c, ↑c.support ⊆ sR ∧ x = ↑(c.sum fun r m => r • m)


theorem intrinsicClosure_mono (h : s ⊆ t) : intrinsicClosure 𝕜 s ⊆ intrinsicClosure 𝕜 t

{𝕜 : Type u_1}
{V : Type u_2}
{P : Type u_5}
[Ring 𝕜]
[AddCommGroup V]
[Module 𝕜 V]
[TopologicalSpace P]
[AddTorsor V P]
{s t : Set P}
(h : s ⊆ t)


theorem finSuccEquiv'_symm_some_above {i : Fin (n + 1)} {m : Fin n} (h : i ≤ Fin.castSucc m) :
    (finSuccEquiv' i).symm (some m) = m.succ

{n : ℕ}
{i : Fin (n + 1)}
{m : Fin n}
(h : i ≤ m.castSucc)


@[simp]
theorem mk_apply (p : Submodule R E) (f : p →ₗ[R] F) (x : p) : mk p f x = f x

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


/-- The kernel of the norm map on `ℤ√d` equals the submonoid of unitary elements. -/
theorem mker_norm_eq_unitary {d : ℤ} : MonoidHom.mker (@normMonoidHom d) = unitary (ℤ√d)

MonoidHom.mker Zsqrtd.normMonoidHom = unitary (ℤ√d)


/-- If one Polish topology on a type refines another, they have the same Borel sets. -/
theorem borel_eq_borel_of_le {t t' : TopologicalSpace γ}
    (ht : PolishSpace (h := t)) (ht' : PolishSpace (h := t')) (hle : t ≤ t') :
    @borel _ t = @borel _ t'

{γ : Type u_3}
{t t' : TopologicalSpace γ}
(ht : PolishSpace γ)
(ht' : PolishSpace γ)
(hle : t ≤ t')


protected theorem Periodic.neg [AddGroup α] (h : Periodic f c) : Periodic f (-c)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c : α}
[AddGroup α]
(h : Function.Periodic f c)


lemma exact_subtype_mkQ (Q : Submodule R N) :
    Exact (Submodule.subtype Q) (Submodule.mkQ Q)

{R : Type u_8}
{N : Type u_10}
[CommRing R]
[AddCommGroup N]
[Module R N]
(Q : Submodule R N)


/-- The orthogonal projection sends elements of `K` to themselves. -/
@[simp]
theorem orthogonalProjection_mem_subspace_eq_self (v : K) : orthogonalProjection K v = v

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{K : Submodule 𝕜 E}
[HasOrthogonalProjection K]
(v : ↥K)


@[simp]
theorem liftRel_think_left (R : α → β → Prop) (ca : Computation α) (cb : Computation β) :
    LiftRel R (think ca) cb ↔ LiftRel R ca cb

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

Computation.LiftRel R ca.think cb ↔ Computation.LiftRel R ca cb


@[aesop safe 20 apply (rule_sets := [Measurable])]
theorem Measurable.inner {_ : MeasurableSpace α} [MeasurableSpace E] [OpensMeasurableSpace E]
    [SecondCountableTopology E] {f g : α → E} (hf : Measurable f)
    (hg : Measurable g) : Measurable fun t => ⟪f t, g t⟫

{α : Type u_1}
{𝕜 : Type u_2}
{E : Type u_3}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]

∀ {x : MeasurableSpace α} [inst : MeasurableSpace E] [inst_1 : OpensMeasurableSpace E]
  [inst_2 : SecondCountableTopology E] {f g : α → E}, Measurable f → Measurable g → Measurable fun t => ⟪f t, g t⟫_𝕜


lemma sinKernel_def (a x : ℝ) : ↑(sinKernel ↑a x) = jacobiTheta₂' a (I * x) / (-2 * π)

↑(HurwitzZeta.sinKernel (↑a) x) = jacobiTheta₂' (↑a) (Complex.I * ↑x) / (-2 * ↑π)


lemma pointwise_isCentralScalar [MulDistribMulAction αᵐᵒᵖ M] [IsCentralScalar α M] :
    IsCentralScalar α (Submonoid M)

{α : Type u_1}
{M : Type u_3}
[Monoid M]
[Monoid α]
[MulDistribMulAction α M]
[MulDistribMulAction αᵐᵒᵖ M]
[IsCentralScalar α M]


@[to_additive]
lemma BddBelow.range_inv {α : Type*} {f : α → G} (hf : BddBelow (range f)) :
    BddAbove (range (fun x => (f x)⁻¹))

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

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


theorem castPred_le_pred_iff {a b : Fin (n + 1)} (ha : a ≠ last n) (hb : b ≠ 0) :
    castPred a ha ≤ pred b hb ↔ a < b

{n : ℕ}
{a b : Fin (n + 1)}
(ha : a ≠ Fin.last n)
(hb : b ≠ 0)


@[simp]
theorem map_coe {β : Type*} (f : α → β) (l : List α) : map f ↑l = List.map f l

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


@[simp]
theorem le_inf {s : Multiset α} {a : α} : a ≤ s.inf ↔ ∀ b ∈ s, a ≤ b

{α : Type u_1}
[SemilatticeInf α]
[OrderTop α]
{s : Multiset α}
{a : α}


lemma eventually_zero_of_frequently_zero (hf : GrowsPolynomially f) (hf' : ∃ᶠ x in atTop, f x = 0) :
    ∀ᶠ x in atTop, f x = 0

(hf : AkraBazziRecurrence.GrowsPolynomially f)

(hf' : ∃ᶠ (x : ℝ) in Filter.atTop, f x = 0)


theorem exists_finset_of_mem_supr'' {ι : Type*} {f : ι → IntermediateField F E}
    (h : ∀ i, Algebra.IsAlgebraic F (f i)) {x : E} (hx : x ∈ ⨆ i, f i) :
    ∃ s : Finset (Σ i, f i), x ∈ ⨆ i ∈ s, adjoin F ((minpoly F (i.2 : _)).rootSet E)

(h : ∀ (i : ι), Algebra.IsAlgebraic F ↥(f i))

∃ s, x ∈ ⨆ i ∈ s, IntermediateField.adjoin F ((minpoly F i.snd).rootSet E)


theorem empty_base_iff : M.Base ∅ ↔ M = loopyOn M.E


theorem Set.mem_minimals_iff_forall_diff_singleton {P : Set α → Prop}
    (hP : ∀ ⦃s t⦄, P s → s ⊆ t → P t) :
    s ∈ minimals (· ⊆ ·) {t | P t} ↔ P s ∧ ∀ x ∈ s, ¬ P (s \ {x})

(hP : ∀ ⦃s t : Set α⦄, P s → s ⊆ t → P t)

s ∈ minimals (fun x x_1 => x ⊆ x_1) {t | P t} ↔ P s ∧ ∀ x ∈ s, ¬P (s \ {x})


@[simp]
theorem binaryProductLimitCone_cone_π_app_right (G H : AddCommGrp.{u}) :
    (binaryProductLimitCone G H).cone.π.app ⟨WalkingPair.right⟩ = AddMonoidHom.snd G H

(G.binaryProductLimitCone H).cone.π.app { as := CategoryTheory.Limits.WalkingPair.right } = AddMonoidHom.snd ↑G ↑H


/-- A pair of continuous (semi)linear equivalences generates an equivalence between the spaces of
continuous linear maps. See also `ContinuousLinearEquiv.arrowCongr`. -/
@[simps]
def arrowCongrEquiv (e₁₂ : M₁ ≃SL[σ₁₂] M₂) (e₄₃ : M₄ ≃SL[σ₄₃] M₃) :
    (M₁ →SL[σ₁₄] M₄) ≃ (M₂ →SL[σ₂₃] M₃)

{R₁ : Type u_1}
{R₂ : Type u_2}
{R₃ : Type u_3}
[Semiring R₁]
[Semiring R₂]
[Semiring R₃]
{σ₁₂ : R₁ →+* R₂}
{σ₂₁ : R₂ →+* R₁}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
{σ₂₃ : R₂ →+* R₃}
{σ₁₃ : R₁ →+* R₃}
[RingHomCompTriple σ₁₂ σ₂₃ σ₁₃]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
{M₃ : Type u_7}
[TopologicalSpace M₃]
[AddCommMonoid M₃]
{M₄ : Type u_8}
[TopologicalSpace M₄]
[AddCommMonoid M₄]
[Module R₁ M₁]
[Module R₂ M₂]
[Module R₃ M₃]
{R₄ : Type u_9}
[Semiring R₄]
[Module R₄ M₄]
{σ₃₄ : R₃ →+* R₄}
{σ₄₃ : R₄ →+* R₃}
[RingHomInvPair σ₃₄ σ₄₃]
[RingHomInvPair σ₄₃ σ₃₄]
{σ₂₄ : R₂ →+* R₄}
{σ₁₄ : R₁ →+* R₄}
[RingHomCompTriple σ₂₁ σ₁₄ σ₂₄]
[RingHomCompTriple σ₂₄ σ₄₃ σ₂₃]
[RingHomCompTriple σ₁₃ σ₃₄ σ₁₄]
(e₁₂ : M₁ ≃SL[σ₁₂] M₂)
(e₄₃ : M₄ ≃SL[σ₄₃] M₃)
(f : M₂ →SL[σ₂₃] M₃)

(e₁₂.arrowCongrEquiv e₄₃).symm f = (↑e₄₃.symm).comp (f.comp ↑e₁₂)


theorem indepSet_empty_right {_mΩ : MeasurableSpace Ω}
    {κ : Kernel α Ω} {μ : Measure α} [IsMarkovKernel κ] (s : Set Ω) :
    IndepSet s ∅ κ μ

{α : Type u_1}
{Ω : Type u_2}
{_mα : MeasurableSpace α}
{_mΩ : MeasurableSpace Ω}
{κ : ProbabilityTheory.Kernel α Ω}
{μ : MeasureTheory.Measure α}
[ProbabilityTheory.IsMarkovKernel κ]
(s : Set Ω)

ProbabilityTheory.Kernel.IndepSet s ∅ κ μ


/-- Entourages are neighborhoods of the diagonal. -/
theorem nhds_le_uniformity (x : α) : 𝓝 (x, x) ≤ 𝓤 α


protected theorem Antiperiodic.funext' [Add α] [InvolutiveNeg β] (h : Antiperiodic f c) :
    (fun x => -f (x + c)) = f

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c : α}
[Add α]
[InvolutiveNeg β]
(h : Function.Antiperiodic f c)


/-- Fermat's Last Theorem for `n = 3`: if `a b c : ℕ` are all non-zero then
`a ^ 3 + b ^ 3 ≠ c ^ 3`. -/
theorem fermatLastTheoremThree : FermatLastTheoremFor 3


theorem sym_injective : Injective (sym : α → αˢʸᵐ)


/-- If `f` is integrable on intervals `Ioc (a i) b`,
where `a i` tends to -∞, and
`∫ x in a i .. b, ‖f x‖ ∂μ` converges to `I : ℝ` along a filter `l`,
then `f` is integrable on the interval (-∞, b) -/
theorem integrableOn_Iic_of_intervalIntegral_norm_tendsto (I b : ℝ)
    (hfi : ∀ i, IntegrableOn f (Ioc (a i) b) μ) (ha : Tendsto a l atBot)
    (h : Tendsto (fun i => ∫ x in a i..b, ‖f x‖ ∂μ) l (𝓝 I)) : IntegrableOn f (Iic b) μ

(hfi : ∀ (i : ι), MeasureTheory.IntegrableOn f (Set.Ioc (a i) b) μ)

(h : Filter.Tendsto (fun i => ∫ (x : ℝ) in a i..b, ‖f x‖ ∂μ) l (𝓝 I))

MeasureTheory.IntegrableOn f (Set.Iic b) μ


@[simp]
theorem reCLM_norm : ‖reCLM‖ = 1


theorem Chain'.rel_head {x y l} (h : Chain' R (x :: y :: l)) : R x y

{α : Type u}
{R : α → α → Prop}
{x y : α}
{l : List α}
(h : List.Chain' R (x :: y :: l))


@[simp]
theorem realize_rel {k : ℕ} {R : L.Relations k} {ts : Fin k → L.Term _} :
    (R.boundedFormula ts).Realize v xs ↔ RelMap R fun i => (ts i).realize (Sum.elim v xs)

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{l : ℕ}
{v : α → M}
{xs : Fin l → M}
{k : ℕ}
{R : L.Relations k}
{ts : Fin k → L.Term (α ⊕ Fin l)}

(R.boundedFormula ts).Realize v xs ↔
  FirstOrder.Language.Structure.RelMap R fun i => FirstOrder.Language.Term.realize (Sum.elim v xs) (ts i)


@[simp]
theorem HomogeneousIdeal.toIdeal_mul (I J : HomogeneousIdeal 𝒜) :
    (I * J).toIdeal = I.toIdeal * J.toIdeal

{ι : Type u_1}
{σ : Type u_2}
{A : Type u_4}
[CommSemiring A]
[DecidableEq ι]
[AddMonoid ι]
[SetLike σ A]
[AddSubmonoidClass σ A]
{𝒜 : ι → σ}
[GradedRing 𝒜]
(I J : HomogeneousIdeal 𝒜)


theorem CompleteOrthogonalIdempotents.of_ker_isNilpotent (h : ∀ x ∈ RingHom.ker f, IsNilpotent x)
    (he : ∀ i, IsIdempotentElem (e i))
    (he' : CompleteOrthogonalIdempotents (f ∘ e)) :
    CompleteOrthogonalIdempotents e

(he : ∀ (i : I), IsIdempotentElem (e i))

(he' : CompleteOrthogonalIdempotents (⇑f ∘ e))


@[to_additive (attr := simp, norm_cast) coe_nnnorm]
theorem coe_nnnorm' (a : E) : (‖a‖₊ : ℝ) = ‖a‖

{E : Type u_6}
[SeminormedAddGroup E]
(a : E)


theorem Equivalence.hasTerminal_iff (e : C ≌ D) : HasTerminal C ↔ HasTerminal D

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

CategoryTheory.Limits.HasTerminal C ↔ CategoryTheory.Limits.HasTerminal D


@[to_additive]
theorem Group.covariant_iff_contravariant [Group N] :
    Covariant N N (· * ·) r ↔ Contravariant N N (· * ·) r

{N : Type u_2}
{r : N → N → Prop}
[Group N]

Covariant N N (fun x x_1 => x * x_1) r ↔ Contravariant N N (fun x x_1 => x * x_1) r


/-- if `α` is infinite dimensional, then `α` is nonempty. -/
lemma nonempty_of_infiniteDimensionalType [InfiniteDimensionalOrder α] : Nonempty α

(α : Type u_1)
[Preorder α]
[InfiniteDimensionalOrder α]


theorem probablePrime_iff_modEq (n : ℕ) {b : ℕ} (h : 1 ≤ b) :
    ProbablePrime n b ↔ b ^ (n - 1) ≡ 1 [MOD n]

n.ProbablePrime b ↔ b ^ (n - 1) ≡ 1 [MOD n]


theorem add_iSup {ι : Sort v} [Nonempty ι] (l : ι → Language α) (m : Language α) :
    (m + ⨆ i, l i) = ⨆ i, m + l i

{α : Type u_1}
{ι : Sort v}
[Nonempty ι]
(l : ι → Language α)
(m : Language α)


@[simp, nolint simpNF]
theorem MonoidalClosed.linearHomEquiv_hom (f : A ⊗ B ⟶ C) :
    (MonoidalClosed.linearHomEquiv A B C f).hom = (TensorProduct.curry f.hom).flip

(f : CategoryTheory.MonoidalCategory.tensorObj A B ⟶ C)

((Rep.MonoidalClosed.linearHomEquiv A B C) f).hom = (TensorProduct.curry f.hom).flip


/-- The function `fun x ↦ f x * r` tends to infinity along a nontrivial filter
if and only if `r > 0` and `f` tends to infinity or `r < 0` and `f` tends to negative infinity. -/
theorem tendsto_mul_const_atTop_iff [NeBot l] :
    Tendsto (fun x => f x * r) l atTop ↔ 0 < r ∧ Tendsto f l atTop ∨ r < 0 ∧ Tendsto f l atBot

{α : Type u_3}
{β : Type u_4}
[LinearOrderedField α]
{l : Filter β}
{f : β → α}
{r : α}
[l.NeBot]

Filter.Tendsto (fun x => f x * r) l Filter.atTop ↔
  0 < r ∧ Filter.Tendsto f l Filter.atTop ∨ r < 0 ∧ Filter.Tendsto f l Filter.atBot


lemma Gammaℝ_eq_zero_iff {s : ℂ} : Gammaℝ s = 0 ↔ ∃ n : ℕ, s = -(2 * n)


theorem IsBigO.mul_isLittleO {f₁ f₂ : α → R} {g₁ g₂ : α → 𝕜} (h₁ : f₁ =O[l] g₁) (h₂ : f₂ =o[l] g₂) :
    (fun x => f₁ x * f₂ x) =o[l] fun x => g₁ x * g₂ x

{α : Type u_1}
{R : Type u_13}
{𝕜 : Type u_15}
[SeminormedRing R]
[NormedDivisionRing 𝕜]
{l : Filter α}
{f₁ f₂ : α → R}
{g₁ g₂ : α → 𝕜}
(h₁ : f₁ =O[l] g₁)
(h₂ : f₂ =o[l] g₂)


@[simp]
theorem toDual_max (a b : α) : toDual (max a b) = min (toDual a) (toDual b)

OrderDual.toDual (max a b) = min (OrderDual.toDual a) (OrderDual.toDual b)


/-- The shift functor on `DifferentialObject S C`. -/
@[simps]
def shiftFunctor (n : S) : DifferentialObject S C ⥤ DifferentialObject S C

(X : CategoryTheory.DifferentialObject S C)

((CategoryTheory.DifferentialObject.shiftFunctor C n).obj X).obj = (CategoryTheory.shiftFunctor C n).obj X.obj


/-- A monoid homomorphism `M →* N` can equivalently be viewed as a monoid homomorphism
`Mᵐᵒᵖ →* Nᵐᵒᵖ`. This is the action of the (fully faithful) `ᵐᵒᵖ`-functor on morphisms. -/
@[to_additive (attr := simps)
      "An additive monoid homomorphism `M →+ N` can equivalently be viewed as an
      additive monoid homomorphism `Mᵃᵒᵖ →+ Nᵃᵒᵖ`. This is the action of the (fully faithful)
      `ᵃᵒᵖ`-functor on morphisms."]
def MonoidHom.op {M N} [MulOneClass M] [MulOneClass N] : (M →* N) ≃ (Mᵐᵒᵖ →* Nᵐᵒᵖ)

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

∀ (a : Mᵐᵒᵖ), (MonoidHom.op f) a = (MulOpposite.op ∘ ⇑f ∘ MulOpposite.unop) a


theorem map_add_nat [AddMonoidWithOne G] [AddMonoidWithOne H] [AddConstMapClass F G H 1 1]
    (f : F) (x : G) (n : ℕ) : f (x + n) = f x + n

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


theorem mem_prod_top {s : Set (α × β)} :
    s ∈ f ×ˢ (⊤ : Filter β) ↔ { a | ∀ b, (a, b) ∈ s } ∈ f

{α : Type u_1}
{β : Type u_2}
{f : Filter α}
{s : Set (α × β)}

s ∈ f ×ˢ ⊤ ↔ {a | ∀ (b : β), (a, b) ∈ s} ∈ f


theorem map_lfp_comp : f (lfp (g.comp f)) = lfp (f.comp g)

{α : Type u}
{β : Type v}
[CompleteLattice α]
[CompleteLattice β]
(f : β →o α)
(g : α →o β)

f (OrderHom.lfp (g.comp f)) = OrderHom.lfp (f.comp g)


theorem congr (hf : AEStronglyMeasurable' m f μ) (hfg : f =ᵐ[μ] g) :
    AEStronglyMeasurable' m g μ

(hf : MeasureTheory.AEStronglyMeasurable' m f μ)

MeasureTheory.AEStronglyMeasurable' m g μ


@[simp]
lemma morphismRestrict_id {X : Scheme.{u}} (U : X.Opens) : 𝟙 X ∣_ U = 𝟙 _

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

𝟙 X ∣_ U = 𝟙 ↑((TopologicalSpace.Opens.map (𝟙 X).val.base).obj U)


@[to_additive sum_pos]
lemma one_lt_prod_of_one_lt [OrderedCommMonoid M] :
    ∀ l : List M, (∀ x ∈ l, (1 : M) < x) → l ≠ [] → 1 < l.prod

{M : Type u_3}
[OrderedAddCommMonoid M]
(l : List M)


run_cmd
  for typeName' in [`UInt8, `UInt16, `UInt32, `UInt64, `USize] do
  let typeName := Lean.mkIdent typeName'
  Lean.Elab.Command.elabCommand (← `(
    namespace $typeName
      instance neZero : NeZero size := ⟨by decide⟩

      instance : Neg $typeName where
        neg a := mk (-a.val)

      instance : Pow $typeName ℕ where
        pow a n := mk (a.val ^ n)

      instance : SMul ℕ $typeName where
        smul n a := mk (n • a.val)

      instance : SMul ℤ $typeName where
        smul z a := mk (z • a.val)

      lemma neg_def (a : $typeName) : -a = ⟨-a.val⟩ := rfl

      lemma pow_def (a : $typeName) (n : ℕ) : a ^ n = ⟨a.val ^ n⟩ := rfl

      lemma nsmul_def (n : ℕ) (a : $typeName) : n • a = ⟨n • a.val⟩ := rfl

      lemma zsmul_def (z : ℤ) (a : $typeName) : z • a = ⟨z • a.val⟩ := rfl

      open $typeName (eq_of_val_eq) in
      lemma val_injective : Function.Injective val := @eq_of_val_eq

      instance instCommMonoid : CommMonoid $typeName :=
        Function.Injective.commMonoid val val_injective
          rfl (fun _ _ => rfl) (fun _ _ => rfl)

      instance instNonUnitalCommRing : NonUnitalCommRing $typeName :=
        Function.Injective.nonUnitalCommRing val val_injective
          rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
          (fun _ _ => rfl) (fun _ _ => rfl)

      local instance instNatCast : NatCast $typeName where
        natCast n := mk n

      local instance instIntCast : IntCast $typeName where
        intCast z := mk z

      lemma natCast_def (n : ℕ) : (n : $typeName) = ⟨n⟩ := rfl

      lemma intCast_def (z : ℤ) : (z : $typeName) = ⟨z⟩ := rfl

      local instance instCommRing : CommRing $typeName :=
        Function.Injective.commRing val val_injective
          rfl rfl (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ _ => rfl)
          (fun _ _ => rfl) (fun _ _ => rfl) (fun _ _ => rfl) (fun _ => rfl) (fun _ => rfl)

      namespace CommRing
      attribute [scoped instance] instCommRing instNatCast instIntCast
      end CommRing

    end $typeName
  ))
  -- interpolating docstrings above is more trouble than it's worth
  let docString :=
    s!"To use this instance, use `open scoped {typeName'}.CommRing`.\n\n" ++
    "See the module docstring for an explanation"
  Lean.addDocString (typeName'.mkStr "instCommRing") docString
  Lean.addDocString (typeName'.mkStr "instNatCast") docString
  Lean.addDocString (typeName'.mkStr "instIntCast") docString


theorem _root_.Decidable.List.Lex.ne_iff [DecidableEq α] {l₁ l₂ : List α}
    (H : length l₁ ≤ length l₂) : Lex (· ≠ ·) l₁ l₂ ↔ l₁ ≠ l₂

{α : Type u}
[DecidableEq α]
{l₁ l₂ : List α}
(H : l₁.length ≤ l₂.length)

List.Lex (fun x x_1 => x ≠ x_1) l₁ l₂ ↔ l₁ ≠ l₂


/-- The number of real roots of a polynomial is at most the number of roots of its derivative plus
one. -/
theorem card_rootSet_le_derivative {F : Type*} [CommRing F] [Algebra F ℝ] (p : F[X]) :
    Fintype.card (p.rootSet ℝ) ≤ Fintype.card (p.derivative.rootSet ℝ) + 1

{F : Type u_1}
[CommRing F]
[Algebra F ℝ]
(p : Polynomial F)

Fintype.card ↑(p.rootSet ℝ) ≤ Fintype.card ↑((Polynomial.derivative p).rootSet ℝ) + 1


/-- If the sign of the angle between three points is positive, the first and third points are not
equal. -/
theorem left_ne_right_of_oangle_sign_eq_one {p₁ p₂ p₃ : P} (h : (∡ p₁ p₂ p₃).sign = 1) : p₁ ≠ p₃

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


@[reassoc]
theorem leftUnitor_comp (f : a ⟶ b) (g : b ⟶ c) :
    (λ_ (f ≫ g)).hom = (α_ (𝟙 a) f g).inv ≫ (λ_ f).hom ▷ g

{B : Type u}
[CategoryTheory.Bicategory B]
{a b c : B}
(f : a ⟶ b)
(g : b ⟶ c)

(CategoryTheory.Bicategory.leftUnitor (CategoryTheory.CategoryStruct.comp f g)).hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.associator (CategoryTheory.CategoryStruct.id a) f g).inv
    (CategoryTheory.Bicategory.whiskerRight (CategoryTheory.Bicategory.leftUnitor f).hom g)


theorem support_convolution_subset : support (f ⋆[L, μ] g) ⊆ support f + support g

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

Function.support (MeasureTheory.convolution f g L μ) ⊆ Function.support f + Function.support g


lemma mul_tsub_one (a b : α) : a * (b - 1) = a * b - a

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


theorem derivedSeriesOfIdeal_add_le_add (J : LieIdeal R L) (k l : ℕ) :
    D (k + l) (I + J) ≤ D k I + D l J

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

LieAlgebra.derivedSeriesOfIdeal R L (k + l) (I + J) ≤
  LieAlgebra.derivedSeriesOfIdeal R L k I + LieAlgebra.derivedSeriesOfIdeal R L l J


theorem Nodup.get_inj_iff {l : List α} (h : Nodup l) {i j : Fin l.length} :
    l.get i = l.get j ↔ i = j

{α : Type u}
{l : List α}
(h : l.Nodup)
{i j : Fin l.length}


lemma modByMonic_eq_zero_iff_quotient_eq_zero (p q : R[X]) (hq : q.Monic) :
    p %ₘ q = 0 ↔ (p : R[X] ⧸ Ideal.span {q}) = 0

{R : Type u_1}
[CommRing R]
(p q : R[X])
(hq : q.Monic)

p %ₘ q = 0 ↔ (Ideal.Quotient.mk (Ideal.span {q})) p = 0


lemma _root_.ContinuousLinearMap.toWOT_apply {A : E →L[𝕜] F} {x : E} :
    ((ContinuousLinearMap.toWOT 𝕜 E F) A) x = A x

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[AddCommGroup E]
[TopologicalSpace E]
[Module 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{A : E →L[𝕜] F}
{x : E}


theorem copy_eq (f : CompleteLatticeHom α β) (f' : α → β) (h : f' = f) : f.copy f' h = f

{α : Type u_2}
{β : Type u_3}
[CompleteLattice α]
[CompleteLattice β]
(f : CompleteLatticeHom α β)
(f' : α → β)
(h : f' = ⇑f)


@[simp]
theorem coe_id : ⇑(CompleteLatticeHom.id α) = id


/-- An `AddGroup` is an `AddMonoid` with a unary `-` satisfying `-a + a = 0`.

There is also a binary operation `-` such that `a - b = a + -b`,
with a default so that `a - b = a + -b` holds by definition.

Use `AddGroup.ofLeftAxioms` or `AddGroup.ofRightAxioms` to define an
additive group structure on a type with the minumum proof obligations.
-/
class AddGroup (A : Type u) extends SubNegMonoid A where
  protected add_left_neg : ∀ a : A, -a + a = 0

{A : Type u}
[self : AddGroup A]
(a : A)


theorem exists_list_nodup_eq [DecidableEq α] (s : Finset α) :
    ∃ l : List α, l.Nodup ∧ l.toFinset = s

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


theorem map_mapRange_eq_iff (f : R →+* S₁) (g : S₁ → R) (hg : g 0 = 0) (φ : MvPolynomial σ S₁) :
    map f (Finsupp.mapRange g hg φ) = φ ↔ ∀ d, f (g (coeff d φ)) = coeff d φ

{R : Type u}
{S₁ : Type v}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₁]
(f : R →+* S₁)
(g : S₁ → R)
(hg : g 0 = 0)
(φ : MvPolynomial σ S₁)

(MvPolynomial.map f) (Finsupp.mapRange g hg φ) = φ ↔
  ∀ (d : σ →₀ ℕ), f (g (MvPolynomial.coeff d φ)) = MvPolynomial.coeff d φ


theorem equicontinuous_iInf_dom {t : κ → TopologicalSpace X'} {F : ι → X' → α}
    {k : κ} (hk : Equicontinuous (tX := t k) F) :
    Equicontinuous (tX := ⨅ k, t k) F

{ι : Type u_1}
{κ : Type u_2}
{X' : Type u_4}
{α : Type u_7}
[uα : UniformSpace α]
{t : κ → TopologicalSpace X'}
{F : ι → X' → α}
{k : κ}
(hk : Equicontinuous F)


/-- The rank of a matrix is the rank of the space spanned by its columns. -/
theorem rank_eq_finrank_span_cols (A : Matrix m n R) :
    A.rank = finrank R (Submodule.span R (Set.range Aᵀ))

{m : Type u_2}
{n : Type u_3}
{R : Type u_5}
[Fintype n]
[CommRing R]
(A : Matrix m n R)

A.rank = FiniteDimensional.finrank R ↥(Submodule.span R (Set.range Aᵀ))


@[simp] lemma coe_equivNatSumOfFintype_symm_apply [Fintype α] (P : {P : α → ℕ // ∑ i, P i = n}) :
    ((equivNatSumOfFintype α n).symm P : Multiset α) = ∑ a, ((P : α → ℕ) a) • {a}

(α : Type u_1)
[DecidableEq α]
(n : ℕ)
[Fintype α]
(P : { P // ∑ i : α, P i = n })

↑((Sym.equivNatSumOfFintype α n).symm P) = ∑ a : α, ↑P a • {a}


theorem inducing_induced (f : X → Y) : @Inducing X Y (TopologicalSpace.induced f ‹_›) _ f

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


/-- Orbit-stabilizer theorem. -/
@[to_additive AddAction.card_orbit_mul_card_stabilizer_eq_card_addGroup "Orbit-stabilizer theorem."]
theorem card_orbit_mul_card_stabilizer_eq_card_group (b : β) [Fintype α] [Fintype <| orbit α b]
    [Fintype <| stabilizer α b] :
    Fintype.card (orbit α b) * Fintype.card (stabilizer α b) = Fintype.card α

(α : Type u)
{β : Type v}
[Group α]
[MulAction α β]
(b : β)
[Fintype α]
[Fintype ↑(MulAction.orbit α b)]
[Fintype ↥(MulAction.stabilizer α b)]

Fintype.card ↑(MulAction.orbit α b) * Fintype.card ↥(MulAction.stabilizer α b) = Fintype.card α


theorem mul_right_injective₀ (ha : a ≠ 0) : Function.Injective (a * ·)

{M₀ : Type u_1}
[Mul M₀]
[Zero M₀]
[IsLeftCancelMulZero M₀]
{a : M₀}
(ha : a ≠ 0)


@[simp]
theorem sInf_empty : sInf (∅ : Set ℝ) = 0


/-- Inversion as a measurable automorphism of a group or group with zero. -/
@[to_additive (attr := simps! (config := .asFn) toEquiv apply)
    "Negation as a measurable automorphism of an additive group."]
def inv (G) [MeasurableSpace G] [InvolutiveInv G] [MeasurableInv G] : G ≃ᵐ G

(G : Type u_4)
[MeasurableSpace G]
[InvolutiveNeg G]
[MeasurableNeg G]

(MeasurableEquiv.neg G).toEquiv = Equiv.neg G


theorem floor_lt_ceil_of_lt {a b : α} (h : a < b) : ⌊a⌋ < ⌈b⌉

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
{a b : α}
(h : a < b)


/-- In a disjoint union we can identify the unique set an element belongs to. -/
theorem pairwiseDisjoint_unique {y : α}
    (h_disjoint : PairwiseDisjoint s f)
    (hy : y ∈ (⋃ i ∈ s, f i)) : ∃! i, i ∈ s ∧ y ∈ f i

{α : Type u_1}
{ι : Type u_4}
{f : ι → Set α}
{s : Set ι}
{y : α}
(h_disjoint : s.PairwiseDisjoint f)
(hy : y ∈ ⋃ i ∈ s, f i)


@[simp]
theorem iUnion_Iio [NoMaxOrder α] : ⋃ a : α, Iio a = univ

{α : Type v}
[Preorder α]
[NoMaxOrder α]


@[ext]
protected theorem ext {x y : ContT r m α} (h : ∀ f, x.run f = y.run f) : x = y

(h : ∀ (f : α → m r), x.run f = y.run f)


protected theorem pow_mul' (a m n : Nat) : a ^ (m * n) = (a ^ n) ^ m


@[to_additive]
lemma image_coe_inj {s t : Set G} : ((↑) : G → Q) '' s = ((↑) : G → Q) '' t ↔ ↑N * s = N * t

{G : Type u}
[Group G]
(N : Subgroup G)
[nN : N.Normal]
{s t : Set G}

QuotientGroup.mk '' s = QuotientGroup.mk '' t ↔ ↑N * s = ↑N * t


/-- Given a path `p`, we can define a `Homotopy p p` by `F (t, x) = p x`.
-/
@[simps!]
def refl (p : Path x₀ x₁) : Homotopy p p

{X : Type u}
[TopologicalSpace X]
{x₀ x₁ : X}
(p : Path x₀ x₁)
(x : ↑I × ↑I)


theorem isReduced_of_isReduced_stalk [∀ x : X, _root_.IsReduced (X.presheaf.stalk x)] :
    IsReduced X

[∀ (x : ↑↑X.toPresheafedSpace), IsReduced ↑(X.presheaf.stalk x)]


protected lemma add_left_neg : -a + a = 0


@[simp]
theorem coe_copy {s : Set M} (hs : s = S) : (S.copy s hs : Set M) = s

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{S : L.Substructure M}
{s : Set M}
(hs : s = ↑S)


/-- If a relation on `α` is infinite dimensional, then `α` is nonempty. -/
lemma nonempty_of_infiniteDimensional [r.InfiniteDimensional] : Nonempty α

{α : Type u_1}
{r : Rel α α}
[r.InfiniteDimensional]


@[rclike_simps] -- porting note (#10618): was `simp`
theorem normSq_div (z w : K) : normSq (z / w) = normSq z / normSq w

RCLike.normSq (z / w) = RCLike.normSq z / RCLike.normSq w


@[simp] lemma comp_sdiff_lift (a b : α) : comp a \ lift b = comp (a ⊔ b)

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

Booleanisation.comp a \ Booleanisation.lift b = Booleanisation.comp (a ⊔ b)


/-- Express `nndist` in terms of `dist`-/
theorem nndist_dist (x y : α) : nndist x y = Real.toNNReal (dist x y)

{α : Type u}
[PseudoMetricSpace α]
(x y : α)


@[reassoc (attr := simp)]
lemma p_descOpcycles {A : C} (k : K.X i ⟶ A) (j : ι) (hj : c.prev i = j)
    (hk : K.d j i ≫ k = 0) : K.pOpcycles i ≫ K.descOpcycles k j hj hk = k


theorem finite_image_fst_and_snd_iff {s : Set (α × β)} :
    (Prod.fst '' s).Finite ∧ (Prod.snd '' s).Finite ↔ s.Finite

{α : Type u}
{β : Type v}
{s : Set (α × β)}


/-- Order equipped with a sensible successor function. -/
@[ext]
class SuccOrder (α : Type*) [Preorder α] where
  /-- Successor function-/
  succ : α → α
  /-- Proof of basic ordering with respect to `succ`-/
  le_succ : ∀ a, a ≤ succ a
  /-- Proof of interaction between `succ` and maximal element-/
  max_of_succ_le {a} : succ a ≤ a → IsMax a
  /-- Proof that `succ` satisfies ordering invariants between `LT` and `LE`-/
  succ_le_of_lt {a b} : a < b → succ a ≤ b
  /-- Proof that `succ` satisfies ordering invariants between `LE` and `LT`-/
  le_of_lt_succ {a b} : a < succ b → a ≤ b

{α : Type u_3}
[Preorder α]
[self : SuccOrder α]
{a : α}


@[to_additive]
theorem inv_iff_ker {f : G → H} (hf : IsGroupHom f) (a b : G) : f a = f b ↔ a * b⁻¹ ∈ ker f

{G : Type u_1}
{H : Type u_2}
[AddGroup G]
[AddGroup H]
{f : G → H}
(hf : IsAddGroupHom f)
(a b : G)

f a = f b ↔ a + -b ∈ IsAddGroupHom.ker f


@[csimp] theorem splitOnP_eq_splitOnPTR : @splitOnP = @splitOnPTR


theorem modifyNthTail_modifyNthTail {f g : List α → List α} (m : ℕ) :
    ∀ (n) (l : List α),
      (l.modifyNthTail f n).modifyNthTail g (m + n) =
        l.modifyNthTail (fun l => (f l).modifyNthTail g m) n

{α : Type u}
{f g : List α → List α}
(m n : ℕ)
(l : List α)

List.modifyNthTail g (m + n) (List.modifyNthTail f n l) = List.modifyNthTail (fun l => List.modifyNthTail g m (f l)) n l


@[simp] lemma upperClosure_eq :
    ↑(upperClosure s) = s ↔ IsUpperSet s


@[to_additive]
lemma IsOpen.mul_closure_one_eq {U : Set G} (hU : IsOpen U) :
    U * (closure {1} : Set G) = U

{G : Type w}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
{U : Set G}
(hU : IsOpen U)


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

X ⊗ Y = e.functor.obj (e.inverse.obj X ⊗ e.inverse.obj Y)


@[simp]
theorem preimage_mul_const_Icc_of_neg (a b : α) {c : α} (h : c < 0) :
    (fun x => x * c) ⁻¹' Icc a b = Icc (b / c) (a / c)

{α : Type u_1}
[LinearOrderedField α]
(a b : α)
{c : α}
(h : c < 0)

(fun x => x * c) ⁻¹' Set.Icc a b = Set.Icc (b / c) (a / c)


@[simp]
lemma subsingleton_iff (X : Type*) :
    Subsingleton (FundamentalGroupoid X) ↔ Subsingleton X


theorem bind_promises {s : Computation α} {f : α → Computation β} {a b} (h1 : s ~> a)
    (h2 : f a ~> b) : bind s f ~> b

{α : Type u}
{β : Type v}
{s : Computation α}
{f : α → Computation β}
{a : α}
{b : β}
(h1 : s.Promises a)
(h2 : (f a).Promises b)


/-- A mixin typeclass saying that the `(c +ᵥ ·)` is a proper map for all `c`.

Note that this is **not** the same as a proper additive action (not yet in `Mathlib`). -/
class ProperConstVAdd (M X : Type*) [VAdd M X] [TopologicalSpace X] : Prop where
  /-- `(c +ᵥ ·)` is a proper map. -/
  isProperMap_vadd (c : M) : IsProperMap ((c +ᵥ ·) : X → X)

{M : Type u_1}
{X : Type u_2}
[VAdd M X]
[TopologicalSpace X]
[self : ProperConstVAdd M X]
(c : M)


theorem hasBasis_nhds_units (γ : Γ₀ˣ) :
    HasBasis (𝓝 (γ : Γ₀)) (fun _ : Unit => True) fun _ => {↑γ}

{Γ₀ : Type u_2}
[LinearOrderedCommGroupWithZero Γ₀]
(γ : Γ₀ˣ)

(𝓝 ↑γ).HasBasis (fun x => True) fun x => {↑γ}


theorem of_eq_top_imp_eq_top {μ' : Measure α} (h : ∀ s, MeasurableSet s → μ s = ∞ → μ' s = ∞)
    (hT : FinMeasAdditive μ T) : FinMeasAdditive μ' T

(h : ∀ (s : Set α), MeasurableSet s → μ s = ⊤ → μ' s = ⊤)

(hT : MeasureTheory.FinMeasAdditive μ T)


/-- The range of a surjective semigroup hom is the whole of the codomain. -/
@[to_additive (attr := simp)
  "The range of a surjective `AddSemigroup` hom is the whole of the codomain."]
theorem srange_top_of_surjective {N} [Mul N] (f : M →ₙ* N) (hf : Function.Surjective f) :
    f.srange = (⊤ : Subsemigroup N)

{M : Type u_1}
[Add M]
{N : Type u_5}
[Add N]
(f : AddHom M N)
(hf : Function.Surjective ⇑f)


theorem continuous_const_smul_iff₀ (hc : c ≠ 0) : (Continuous fun x => c • f x) ↔ Continuous f

{α : Type u_2}
{β : Type u_3}
{G₀ : Type u_4}
[TopologicalSpace α]
[GroupWithZero G₀]
[MulAction G₀ α]
[ContinuousConstSMul G₀ α]
[TopologicalSpace β]
{f : β → α}
{c : G₀}
(hc : c ≠ 0)


@[simp]
theorem det_toLin' (f : Matrix ι ι R) : LinearMap.det (Matrix.toLin' f) = Matrix.det f

{R : Type u_1}
[CommRing R]
{ι : Type u_4}
[DecidableEq ι]
[Fintype ι]
(f : Matrix ι ι R)


@[simp] theorem get_swap_right (a : Array α) {i j : Fin a.size} : (a.swap i j)[j.val] = a[i]

{α : Type u_1}
(a : Array α)
{i j : Fin a.size}


theorem IsCompact.image_of_continuousOn {f : X → Y} (hs : IsCompact s) (hf : ContinuousOn f s) :
    IsCompact (f '' s)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{s : Set X}
{f : X → Y}
(hs : IsCompact s)
(hf : ContinuousOn f s)


/-- An `R`-algebra `A` is étale if it is formally étale and of finite presentation.

Note that the definition <https://stacks.math.columbia.edu/tag/00U1> in the stacks project is
different, but <https://stacks.math.columbia.edu/tag/00UR> shows that it is equivalent
to the definition here. -/
class Etale : Prop where
  formallyEtale : FormallyEtale R A := by infer_instance
  finitePresentation : FinitePresentation R A := by infer_instance

{R : Type u}
[CommSemiring R]
{A : Type u}
[Semiring A]
[Algebra R A]
[self : Algebra.Etale R A]


/-- If the quotient of a Lie module `M` by a Lie submodule on which the Lie algebra acts trivially
is nilpotent then `M` is nilpotent.

This is essentially the Lie module equivalent of the fact that a central
extension of nilpotent Lie algebras is nilpotent. See `LieAlgebra.nilpotent_of_nilpotent_quotient`
below for the corresponding result for Lie algebras. -/
theorem nilpotentOfNilpotentQuotient {N : LieSubmodule R L M} (h₁ : N ≤ maxTrivSubmodule R L M)
    (h₂ : IsNilpotent R L (M ⧸ N)) : IsNilpotent R L M

(h₁ : N ≤ LieModule.maxTrivSubmodule R L M)

(h₂ : LieModule.IsNilpotent R L (M ⧸ N))


@[to_additive]
lemma pow_mul_comm' (a : M) (n : ℕ) : a ^ n * a = a * a ^ n

{M : Type u_2}
[AddMonoid M]
(a : M)
(n : ℕ)


theorem lex_eq_invImage_dfinsupp_lex (r : α → α → Prop) (s : N → N → Prop) :
    Finsupp.Lex r s = InvImage (DFinsupp.Lex r fun _ ↦ s) toDFinsupp

{α : Type u_1}
{N : Type u_2}
[Zero N]
(r : α → α → Prop)
(s : N → N → Prop)

Finsupp.Lex r s = InvImage (DFinsupp.Lex r fun x => s) Finsupp.toDFinsupp


/-- The valuation on the completion agrees with the global valuation on elements of the field. -/
theorem valuedAdicCompletion_eq_valuation' (k : K) :
    Valued.v (k : v.adicCompletion K) = v.valuation k

(v : IsDedekindDomain.HeightOneSpectrum R)


theorem Ico_coe_coe : Ico (a : WithTop α) b = (Ico a b).map Embedding.some

(α : Type u_1)
[PartialOrder α]
[OrderTop α]
[LocallyFiniteOrder α]
(a b : α)

Finset.Ico ↑a ↑b = Finset.map Function.Embedding.some (Finset.Ico a b)


/-- `pb.liftEquiv` states that roots of the minimal polynomial of `pb.gen` correspond to
maps sending `pb.gen` to that root.

This is the bundled equiv version of `PowerBasis.lift`.
If the codomain of the `AlgHom`s is an integral domain, then the roots form a multiset,
see `liftEquiv'` for the corresponding statement.
-/
@[simps]
noncomputable def liftEquiv (pb : PowerBasis A S) :
    (S →ₐ[A] S') ≃ { y : S' // aeval y (minpoly A pb.gen) = 0 }

{S : Type u_2}
[Ring S]
{A : Type u_4}
[CommRing A]
[Algebra A S]
{S' : Type u_7}
[Ring S']
[Algebra A S']
(pb : PowerBasis A S)
(f : S →ₐ[A] S')


/-- If a group has `UniqueProds`, then it actually has `TwoUniqueProds`.
  For an example of a semigroup `G` embeddable into a group that has `UniqueProds`
  but not `TwoUniqueProds`, see Example 10.13 in
  [J. Okniński, *Semigroup Algebras*][Okninski1991]. -/
@[to_additive] theorem toTwoUniqueProds_of_group {G}
    [Group G] [UniqueProds G] : TwoUniqueProds G

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


theorem ofCauchy_inv {f} : (⟨f⁻¹⟩ : ℝ) = ⟨f⟩⁻¹


/-- The inequality which contradicts Bertrand's postulate, for large enough `n`.
-/
theorem bertrand_main_inequality {n : ℕ} (n_large : 512 ≤ n) :
    n * (2 * n) ^ sqrt (2 * n) * 4 ^ (2 * n / 3) ≤ 4 ^ n


theorem Countable.of_equiv (α : Sort*) [Countable α] (e : α ≃ β) : Countable β

{β : Sort v}
(α : Sort u_1)
[Countable α]
(e : α ≃ β)


theorem dyadicMap_apply_pow (m : ℤ) (n : ℕ) :
    dyadicMap (IsLocalization.mk' (Localization (Submonoid.powers 2)) m (Submonoid.pow 2 n)) =
      m • powHalf n

Surreal.dyadicMap (IsLocalization.mk' (Localization (Submonoid.powers 2)) m (Submonoid.pow 2 n)) = m • Surreal.powHalf n


@[simp (high)]
theorem matrixEquivTensor_apply_std_basis (i j : n) (x : A) :
    matrixEquivTensor R A n (stdBasisMatrix i j x) = x ⊗ₜ stdBasisMatrix i j 1

(R : Type u)
[CommSemiring R]
(A : Type v)
[Semiring A]
[Algebra R A]
(n : Type w)
[Fintype n]
[DecidableEq n]
(i j : n)
(x : A)

(matrixEquivTensor R A n) (Matrix.stdBasisMatrix i j x) = x ⊗ₜ[R] Matrix.stdBasisMatrix i j 1


@[symm]
theorem Indep.symm {m₁ m₂ : MeasurableSpace Ω} {_mΩ : MeasurableSpace Ω} {κ : Kernel α Ω}
    {μ : Measure α} (h : Indep m₁ m₂ κ μ) :
    Indep m₂ m₁ κ μ

(h : ProbabilityTheory.Kernel.Indep m₁ m₂ κ μ)

ProbabilityTheory.Kernel.Indep m₂ m₁ κ μ


@[to_additive (attr := simp)]
theorem mk_prod {G ι : Type*} [CommGroup G] (N : Subgroup G) (s : Finset ι) {f : ι → G} :
    ((Finset.prod s f : G) : G ⧸ N) = Finset.prod s (fun i => (f i : G ⧸ N))

{G : Type u_1}
{ι : Type u_2}
[AddCommGroup G]
(N : AddSubgroup G)
(s : Finset ι)
{f : ι → G}


@[to_additive] lemma inv_inf (a b : α) : (a ⊓ b)⁻¹ = a⁻¹ ⊔ b⁻¹

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

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


theorem mem_pmem {a : α} (h : ∀ a ∈ x, p a) (ha : a ∈ x) : f a (h a ha) ∈ pmap f x h

{α : Type u_1}
{β : Type u_2}
{p : α → Prop}
(f : (a : α) → p a → β)
(x : Option α)
{a : α}
(h : ∀ (a : α), a ∈ x → p a)
(ha : a ∈ x)


@[to_additive]
theorem ContinuousWithinAt.inv (hf : ContinuousWithinAt f s x) :
    ContinuousWithinAt (fun x => (f x)⁻¹) s x

{G : Type w}
{α : Type u}
[TopologicalSpace G]
[Inv G]
[ContinuousInv G]
[TopologicalSpace α]
{f : α → G}
{s : Set α}
{x : α}
(hf : ContinuousWithinAt f s x)


@[reassoc (attr := simp)]
lemma liftCycles_i {A : C} (k : A ⟶ K.X i) (j : ι) (hj : c.next i = j)
    (hk : k ≫ K.d i j = 0) : K.liftCycles k j hj hk ≫ K.iCycles i = k


theorem smul_set_inter₀ (ha : a ≠ 0) : a • (s ∩ t) = a • s ∩ a • t

{α : Type u_2}
{β : Type u_3}
[GroupWithZero α]
[MulAction α β]
{s t : Set β}
{a : α}
(ha : a ≠ 0)


theorem Sublist.erase_diff_erase_sublist {a : α} :
    ∀ {l₁ l₂ : List α}, l₁ <+ l₂ → (l₂.erase a).diff (l₁.erase a) <+ l₂.diff l₁

{α : Type u_1}
[BEq α]
[LawfulBEq α]
{a : α}
{l₁ l₂ : List α}


@[simp]
theorem inf_mem_iff : x ⊓ y ∈ F ↔ x ∈ F ∧ y ∈ F

{P : Type u_1}
[SemilatticeInf P]
{x y : P}
{F : Order.PFilter P}


theorem left_map_implicitFunction :
    ∀ᶠ p : F × G in 𝓝 (φ.prodFun φ.pt), φ.leftFun (φ.implicitFunction p.1 p.2) = p.1

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

∀ᶠ (p : F × G) in 𝓝 (φ.prodFun φ.pt), φ.leftFun (φ.implicitFunction p.1 p.2) = p.1


@[simp]
theorem ofEquiv_root (h : IsAdjoinRoot S f) (e : S ≃ₐ[R] T) : (h.ofEquiv e).root = e h.root

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{f : R[X]}
{T : Type u_1}
[CommRing T]
[Algebra R T]
(h : IsAdjoinRoot S f)
(e : S ≃ₐ[R] T)


@[to_additive]
nonrec theorem SmoothAt.mul (hf : SmoothAt I' I f x) (hg : SmoothAt I' I g x) :
    SmoothAt I' I (f * g) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[Add G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothAdd I G]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_7}
[TopologicalSpace M]
[ChartedSpace H' M]
{f g : M → G}
{x : M}
(hf : SmoothAt I' I f x)
(hg : SmoothAt I' I g x)


@[simp]
theorem denom_C (c : K) : denom (C c) = 1


/-- Algebra isomorphism between `R[X]` and `R[ℕ]`. This is just an
implementation detail, but it can be useful to transfer results from `Finsupp` to polynomials. -/
@[simps!]
def toFinsuppIsoAlg : R[X] ≃ₐ[R] R[ℕ]

(R : Type u)
[CommSemiring R]
(toFinsupp : AddMonoidAlgebra R ℕ)

((Polynomial.toFinsuppIsoAlg R).symm toFinsupp).toFinsupp = toFinsupp


theorem st_add {x y : ℝ*} (hx : ¬Infinite x) (hy : ¬Infinite y) : st (x + y) = st x + st y

{x y : ℝ*}
(hx : ¬x.Infinite)
(hy : ¬y.Infinite)


@[to_additive]
theorem mk_surjective : Surjective (@mk M N _ _)

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


@[to_additive]
theorem map_injective_of_injective : Function.Injective (map f)

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
{f : M →ₙ* N}
(hf : Function.Injective ⇑f)


lemma Finset.sum_indicator_mod {R : Type*} [AddCommMonoid R] (m : ℕ) [NeZero m] (f : ℕ → R) :
    f = ∑ a : ZMod m, {n : ℕ | (n : ZMod m) = a}.indicator f

{R : Type u_1}
[AddCommMonoid R]
(m : ℕ)
[NeZero m]
(f : ℕ → R)

f = ∑ a : ZMod m, {n | ↑n = a}.indicator f


@[simp]
theorem toFinsupp_algebraMap (r : R) : (algebraMap R A[X] r).toFinsupp = algebraMap R _ r

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

((algebraMap R A[X]) r).toFinsupp = (algebraMap R (AddMonoidAlgebra A ℕ)) r


/-- In a linearly ordered monoid, we are happy for `bot_eq_one` to be a `@[simp]` lemma. -/
@[to_additive (attr := simp)
  "In a linearly ordered monoid, we are happy for `bot_eq_zero` to be a `@[simp]` lemma"]
theorem bot_eq_one' : (⊥ : α) = 1


lemma root_X_pow_sub_C_ne_zero {n : ℕ} (hn : 1 < n) (a : K) :
    (AdjoinRoot.root (X ^ n - C a)) ≠ 0

{K : Type u}
[Field K]
{n : ℕ}
(hn : 1 < n)
(a : K)

AdjoinRoot.root (Polynomial.X ^ n - Polynomial.C a) ≠ 0


lemma eq_of_superset_of_not_ssuperset [IsAntisymm α (· ⊆ ·)] (hab : a ⊆ b) (hba : ¬ a ⊂ b) :
    b = a

[IsNonstrictStrictOrder α (fun x x_1 => x ⊆ x_1) fun x x_1 => x ⊂ x_1]


theorem nnnorm_le_of_ae_bound [IsFiniteMeasure μ] {f : Lp E p μ} {C : ℝ≥0}
    (hfC : ∀ᵐ x ∂μ, ‖f x‖₊ ≤ C) : ‖f‖₊ ≤ measureUnivNNReal μ ^ p.toReal⁻¹ * C

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
[MeasureTheory.IsFiniteMeasure μ]
{f : ↥(MeasureTheory.Lp E p μ)}
{C : ℝ≥0}
(hfC : ∀ᵐ (x : α) ∂μ, ‖↑↑f x‖₊ ≤ C)

‖f‖₊ ≤ MeasureTheory.measureUnivNNReal μ ^ p.toReal⁻¹ * C


theorem length_bypass_le {u v : V} (p : G.Walk u v) : p.bypass.length ≤ p.length

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


lemma of_fac {R S : 𝒮} {a b : 𝒳} (f : R ⟶ S) (φ : a ⟶ b) (ha : p.obj a = R) (hb : p.obj b = S)
    (h : f = eqToHom ha.symm ≫ p.map φ ≫ eqToHom hb) : p.IsHomLift f φ

(h : f = CategoryTheory.eqToHom ⋯ ≫ p.map φ ≫ CategoryTheory.eqToHom hb)


@[simp]
theorem polar_zero : B.polar ({0} : Set E) = Set.univ

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


@[to_additive (attr := simp)]
theorem Finset.prod_apply {α : Type*} {β : α → Type*} {γ} [∀ a, CommMonoid (β a)] (a : α)
    (s : Finset γ) (g : γ → ∀ a, β a) : (∏ c ∈ s, g c) a = ∏ c ∈ s, g c a

{α : Type u_1}
{β : α → Type u_2}
{γ : Type u_3}
[(a : α) → AddCommMonoid (β a)]
(a : α)
(s : Finset γ)
(g : γ → (a : α) → β a)


{τ : Type u_1}
[AddMonoid τ]
[TopologicalSpace τ]
[ContinuousAdd τ]
{α : Type u_2}
[TopologicalSpace α]
(ϕ : Flow τ α)


@[simp]
theorem coe_sub (D1 D2 : LieDerivation R L M) : ⇑(D1 - D2) = D1 - D2

{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]
(D1 D2 : LieDerivation R L M)


theorem factorThruImage_comp_imageUnopOp_inv :
    factorThruImage g ≫ (imageUnopOp g).inv = (image.ι g.unop).op

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

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


/-- The wide coequalizer morphism in any colimit cocone is an epimorphism. -/
theorem epi_of_isColimit_parallelFamily [Nonempty J] {c : Cocone (parallelFamily f)}
    (i : IsColimit c) : Epi (c.ι.app one)

{c : CategoryTheory.Limits.Cocone (CategoryTheory.Limits.parallelFamily f)}


@[simp]
theorem coe_sup : ⇑(f ⊔ g) = ⇑f ⊔ ⇑g

{α : Type u_2}
{β : Type u_3}
[Bot α]
[SemilatticeSup β]
[OrderBot β]
(f g : BotHom α β)


theorem leibniz_div (a b : K) : D (a / b) = b⁻¹ ^ 2 • (b • D a - a • D b)

{R : Type u_1}
[CommRing R]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
{K : Type u_4}
[Field K]
[Module K M]
[Algebra R K]
(D : Derivation R K M)
(a b : K)


protected theorem DifferentiableAt.fderivWithin (h : DifferentiableAt 𝕜 f x)
    (hxs : UniqueDiffWithinAt 𝕜 s x) : fderivWithin 𝕜 f s x = fderiv 𝕜 f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
{s : Set E}
(h : DifferentiableAt 𝕜 f x)
(hxs : UniqueDiffWithinAt 𝕜 s x)


/-- In a complex Banach algebra, if every element of the spectrum has norm strictly less than
`r : ℝ≥0`, then the spectral radius is also strictly less than `r`. -/
theorem spectralRadius_lt_of_forall_lt {r : ℝ≥0} (hr : ∀ z ∈ spectrum ℂ a, ‖z‖₊ < r) :
    spectralRadius ℂ a < r

{A : Type u_2}
[NormedRing A]
[NormedAlgebra ℂ A]
[CompleteSpace A]
[Nontrivial A]
(a : A)
{r : ℝ≥0}
(hr : ∀ z ∈ spectrum ℂ a, ‖z‖₊ < r)


/-- `Finsupp.single 0` as an `AlgHom` -/
@[simps! apply]
def singleZeroAlgHom [CommSemiring R] [Semiring k] [Algebra R k] [AddMonoid G] : k →ₐ[R] k[G]

{k : Type u₁}
{G : Type u₂}
{R : Type u_2}
[CommSemiring R]
[Semiring k]
[Algebra R k]
[AddMonoid G]

∀ (a : k), AddMonoidAlgebra.singleZeroAlgHom a = Finsupp.single 0 a


@[simp] theorem minimum?_nil [Min α] : ([] : List α).minimum? = none


lemma fundamentalDomain_pi_basisFun [Fintype ι] :
    fundamentalDomain (Pi.basisFun ℝ ι) = Set.pi Set.univ fun _ : ι ↦ Set.Ico (0 : ℝ) 1

Zspan.fundamentalDomain (Pi.basisFun ℝ ι) = Set.univ.pi fun x => Set.Ico 0 1


theorem associated_normalize_iff {x y : α} : Associated x (normalize y) ↔ Associated x y

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]
{x y : α}


/-- Given a σ-finite measure, any measurable set can be approximated from inside by a measurable
set of finite measure. -/
lemma of_sigmaFinite [SigmaFinite μ] :
    InnerRegularWRT μ (fun s ↦ MeasurableSet s ∧ μ s ≠ ∞) (fun s ↦ MeasurableSet s)

{α : Type u_1}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[MeasureTheory.SigmaFinite μ]

μ.InnerRegularWRT (fun s => MeasurableSet s ∧ μ s ≠ ⊤) fun s => MeasurableSet s


theorem UniformContinuous.prod_mk {f₁ : α → β} {f₂ : α → γ} (h₁ : UniformContinuous f₁)
    (h₂ : UniformContinuous f₂) : UniformContinuous fun a => (f₁ a, f₂ a)

{α : Type ua}
{β : Type ub}
{γ : Type uc}
[UniformSpace α]
[UniformSpace β]
[UniformSpace γ]
{f₁ : α → β}
{f₂ : α → γ}
(h₁ : UniformContinuous f₁)
(h₂ : UniformContinuous f₂)


@[to_additive (attr := simp)]
theorem coe_toSubmonoid (K : Subgroup G) : (K.toSubmonoid : Set G) = K

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


theorem hasEigenvalue_iff_mem_spectrum [FiniteDimensional K V] {f : End K V} {μ : K} :
    f.HasEigenvalue μ ↔ μ ∈ spectrum K f

{K : Type v}
{V : Type w}
[Field K]
[AddCommGroup V]
[Module K V]
[FiniteDimensional K V]
{f : Module.End K V}
{μ : K}


/-- If a sequence terminated at position `n`, it also terminated at `m ≥ n`. -/
theorem terminated_stable : ∀ (s : Seq α) {m n : ℕ}, m ≤ n → s.TerminatedAt m → s.TerminatedAt n

{α : Type u}
(s : Stream'.Seq α)
{m n : ℕ}


/-- For `p = 1` (hence, for any `p ≤ 1`), the condition `LiouvilleWith p x` is trivial. -/
theorem liouvilleWith_one (x : ℝ) : LiouvilleWith 1 x


theorem isUnit_nonsing_inv_det (h : IsUnit A.det) : IsUnit A⁻¹.det

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
(A : Matrix n n α)
(h : IsUnit A.det)


theorem xn_ge_a_pow : ∀ n : ℕ, a ^ n ≤ xn a1 n


@[simp, mfld_simps]
theorem mem_chart_source_iff (p q : TM) :
    p ∈ (chartAt (ModelProd H E) q).source ↔ p.1 ∈ (chartAt H q.1).source

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_4}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
(M : Type u_6)
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
(p q : TangentBundle I M)

p ∈ (chartAt (ModelProd H E) q).source ↔ p.proj ∈ (chartAt H q.proj).source


theorem apply_pos_iff (p : PMF α) (a : α) : 0 < p a ↔ a ∈ p.support


@[simp]
theorem areaForm'_apply (x : E) :
    o.areaForm' x = LinearMap.toContinuousLinearMap (o.areaForm x)

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


lemma isLocallySurjective_of_isLocallySurjective_of_isLocallyInjective
    {F₁ F₂ F₃ : Cᵒᵖ ⥤ A} (f₁ : F₁ ⟶ F₂) (f₂ : F₂ ⟶ F₃)
    [IsLocallySurjective J (f₁ ≫ f₂)] [IsLocallyInjective J f₂] :
    IsLocallySurjective J f₁

(J : CategoryTheory.GrothendieckTopology C)

[CategoryTheory.Presheaf.IsLocallySurjective J (f₁ ≫ f₂)]


@[ext] theorem Char.ext : {a b : Char} → a.val = b.val → a = b


/-- If a ring homomorphism `R →+* A` is injective and `R` has characteristic zero
then so does `A`. -/
theorem charZero_of_injective_ringHom {R A : Type*} [NonAssocSemiring R] [NonAssocSemiring A]
    {f : R →+* A} (h : Function.Injective f) [CharZero R] : CharZero A

{R : Type u_1}
{A : Type u_2}
[NonAssocSemiring R]
[NonAssocSemiring A]
{f : R →+* A}
(h : Function.Injective ⇑f)
[CharZero R]


theorem sub {f g : ∀ i, E i} (hf : Memℓp f p) (hg : Memℓp g p) : Memℓp (f - g) p

{α : Type u_1}
{E : α → Type u_2}
{p : ℝ≥0∞}
[(i : α) → NormedAddCommGroup (E i)]
{f g : (i : α) → E i}
(hf : Memℓp f p)
(hg : Memℓp g p)


theorem SeparatedNhds.of_finset_finset [T2Space X] (s t : Finset X) (h : Disjoint s t) :
    SeparatedNhds (s : Set X) t

{X : Type u_1}
[TopologicalSpace X]
[T2Space X]
(s t : Finset X)
(h : Disjoint s t)


/-- A subgroup is closed under multiplication. -/
@[to_additive "An `AddSubgroup` is closed under addition."]
protected theorem mul_mem {x y : G} : x ∈ H → y ∈ H → x * y ∈ H

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


theorem testBit_bitwise
  (false_false_axiom : f false false = false) (x y i : Nat)
: (bitwise f x y).testBit i = f (x.testBit i) (y.testBit i)

(Nat.bitwise f x y).testBit i = f (x.testBit i) (y.testBit i)


/-- A surjective morphism of topological groups is open when the source group is sigma-compact and
the target group is a Baire space (for instance a locally compact group). -/
@[to_additive]
theorem MonoidHom.isOpenMap_of_sigmaCompact
    {H : Type*} [Group H] [TopologicalSpace H] [BaireSpace H] [T2Space H] [ContinuousMul H]
    (f : G →* H) (hf : Function.Surjective f) (h'f : Continuous f) :
    IsOpenMap f

{G : Type u_1}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
[SigmaCompactSpace G]
{H : Type u_3}
[AddGroup H]
[TopologicalSpace H]
[BaireSpace H]
[T2Space H]
[ContinuousAdd H]
(f : G →+ H)
(hf : Function.Surjective ⇑f)
(h'f : Continuous ⇑f)


theorem card_image_of_injective {α : Type u} {β : Type v} (f : α → β) (s : Set α)
    (h : Function.Injective f) : card (f '' s) = card s

PartENat.card ↑(f '' s) = PartENat.card ↑s


theorem eq_of_empty [IsEmpty α] (f g : C₀(α, β)) : f = g

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
[Zero β]
[IsEmpty α]
(f g : α →C₀ β)


lemma isClosedMap_swap : IsClosedMap (Prod.swap : X × Y → Y × X)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]


theorem wSameSide_smul_vsub_vadd_left {s : AffineSubspace R P} {p₁ p₂ : P} (x : P) (hp₁ : p₁ ∈ s)
    (hp₂ : p₂ ∈ s) {t : R} (ht : 0 ≤ t) : s.WSameSide (t • (x -ᵥ p₁) +ᵥ p₂) x

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[StrictOrderedCommRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{p₁ p₂ : P}
(x : P)
(hp₁ : p₁ ∈ s)
(hp₂ : p₂ ∈ s)
{t : R}
(ht : 0 ≤ t)


/-- We can prove two cocone points `(s : Cocone F).pt` and `(t : Cocone G).pt` are isomorphic if
* both cocones are colimit cocones
* their indexing categories are equivalent via some `e : J ≌ K`,
* the triangle of functors commutes up to a natural isomorphism: `e.functor ⋙ G ≅ F`.

This is the most general form of uniqueness of cocone points,
allowing relabelling of both the indexing category (up to equivalence)
and the functor (up to natural isomorphism).
-/
@[simps]
def coconePointsIsoOfEquivalence {F : J ⥤ C} {s : Cocone F} {G : K ⥤ C} {t : Cocone G}
    (P : IsColimit s) (Q : IsColimit t) (e : J ≌ K) (w : e.functor ⋙ G ≅ F) : s.pt ≅ t.pt

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{K : Type u₂}
[CategoryTheory.Category.{v₂, u₂} K]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
{s : CategoryTheory.Limits.Cocone F}
{G : K ⥤ C}
{t : CategoryTheory.Limits.Cocone G}
(P : CategoryTheory.Limits.IsColimit s)
(Q : CategoryTheory.Limits.IsColimit t)
(e : J ≌ K)
(w : e.functor ⋙ G ≅ F)

(P.coconePointsIsoOfEquivalence Q e w).hom =
  P.desc ((CategoryTheory.Limits.Cocones.equivalenceOfReindexing e w).functor.obj t)


theorem image_symmDiff [DecidableEq α] {f : α → β} (s t : Finset α) (hf : Injective f) :
    (s ∆ t).image f = s.image f ∆ t.image f

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
[DecidableEq α]
{f : α → β}
(s t : Finset α)
(hf : Function.Injective f)

Finset.image f (symmDiff s t) = symmDiff (Finset.image f s) (Finset.image f t)


@[to_additive, field_simps]
theorem div_mul_eq_mul_div : a / b * c = a * c / b

{α : Type u_1}
[SubtractionCommMonoid α]
(a b c : α)


theorem range_top_iff_surjective {f : R →ₙ+* S} :
    f.range = (⊤ : NonUnitalSubring S) ↔ Function.Surjective f

{R : Type u}
{S : Type v}
[NonUnitalNonAssocRing R]
[NonUnitalNonAssocRing S]
{f : R →ₙ+* S}


theorem LinearMap.continuous_on_pi {ι : Type*} {R : Type*} {M : Type*} [Finite ι] [Semiring R]
    [TopologicalSpace R] [AddCommMonoid M] [Module R M] [TopologicalSpace M] [ContinuousAdd M]
    [ContinuousSMul R M] (f : (ι → R) →ₗ[R] M) : Continuous f

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
[Finite ι]
[Semiring R]
[TopologicalSpace R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace M]
[ContinuousAdd M]
[ContinuousSMul R M]
(f : (ι → R) →ₗ[R] M)


/-- `find p` returns `none` if and only if `p i` never holds. -/
theorem find_eq_none_iff {n : ℕ} {p : Fin n → Prop} [DecidablePred p] :
    find p = none ↔ ∀ i, ¬p i


@[simp, norm_cast]
theorem cast_le [LinearOrderedRing α] {m n : ZNum} : (m : α) ≤ n ↔ m ≤ n

{α : Type u_1}
[LinearOrderedRing α]
{m n : ZNum}

↑m ≤ ↑n ↔ m ≤ n


theorem pow_inv_comm' (A : M) (m n : ℕ) : A⁻¹ ^ m * A ^ n = A ^ n * A⁻¹ ^ m

{n' : Type u_1}
[DecidableEq n']
[Fintype n']
{R : Type u_2}
[CommRing R]
(A : Matrix n' n' R)
(m n : ℕ)