/-- The map into the localization presheaf. -/
@[simps app]
def SubmonoidPresheaf.toLocalizationPresheaf : F ⟶ G.localizationPresheaf

{X : TopCat}
{F : TopCat.Presheaf CommRingCat X}
(G : F.SubmonoidPresheaf)
(U : (TopologicalSpace.Opens ↑X)ᵒᵖ)

G.toLocalizationPresheaf.app U = CommRingCat.ofHom (algebraMap (↑(F.obj U)) (Localization (G.obj U)))


theorem Monic.C_dvd_iff_isUnit {a : R} : C a ∣ p ↔ IsUnit a

{R : Type u}
[CommSemiring R]
{p : R[X]}
(hp : p.Monic)
{a : R}


theorem mapDomain_injective {f : α → β} (hf : Function.Injective f) :
    Function.Injective (mapDomain f : (α →₀ M) → β →₀ M)

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[AddCommMonoid M]
{f : α → β}
(hf : Function.Injective f)


/-- If `x ≠ 0` and `x ≠ ∞`, then right multiplication by `x` maps infimum to infimum.
See also `ENNReal.iInf_mul` that assumes `[Nonempty ι]` but does not require `x ≠ 0`. -/
theorem iInf_mul_of_ne {ι} {f : ι → ℝ≥0∞} {x : ℝ≥0∞} (h0 : x ≠ 0) (h : x ≠ ∞) :
    iInf f * x = ⨅ i, f i * x

{ι : Sort u_2}
{f : ι → ℝ≥0∞}
{x : ℝ≥0∞}
(h0 : x ≠ 0)
(h : x ≠ ⊤)


@[simp] protected theorem sub_lt_sub_left_iff (a b c : Int) :
    c - a < c - b ↔ b < a


@[to_additive (attr := simp)]
theorem smul_finset_empty (a : α) : a • (∅ : Finset β) = ∅

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[SMul α β]
(a : α)


theorem setToL1S_nonneg (h_zero : ∀ s, MeasurableSet s → μ s = 0 → T s = 0)
    (h_add : FinMeasAdditive μ T)
    (hT_nonneg : ∀ s, MeasurableSet s → μ s < ∞ → ∀ x, 0 ≤ x → 0 ≤ T s x) {f : α →₁ₛ[μ] G''}
    (hf : 0 ≤ f) : 0 ≤ setToL1S T f

(h_zero : ∀ (s : Set α), MeasurableSet s → μ s = 0 → T s = 0)

(h_add : MeasureTheory.FinMeasAdditive μ T)

(hT_nonneg : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → ∀ (x : G''), 0 ≤ x → 0 ≤ (T s) x)

{f : ↥(MeasureTheory.Lp.simpleFunc G'' 1 μ)}

0 ≤ MeasureTheory.L1.SimpleFunc.setToL1S T f


@[simp] theorem trailingDegree_le_trailingDegree (h : coeff q (natTrailingDegree p) ≠ 0) :
    trailingDegree q ≤ trailingDegree p

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


@[simp, rclike_simps]
theorem conjLIE_apply : (conjLIE : K → K) = conj


theorem adjoin_rank_le_of_isAlgebraic_left (L : IntermediateField F K)
    [halg : Algebra.IsAlgebraic F E] :
    Module.rank E (adjoin E (L : Set K)) ≤ Module.rank F L

{F : Type u_1}
[Field F]
(E : Type u_2)
[Field E]
[Algebra F E]
{K : Type u_3}
[Field K]
[Algebra F K]
[Algebra E K]
[IsScalarTower F E K]
(L : IntermediateField F K)
[halg : Algebra.IsAlgebraic F E]

Module.rank E ↥(IntermediateField.adjoin E ↑L) ≤ Module.rank F ↥L


/--
If `R` is a sieve, then the `CategoryTheory.Presieve.functorPullback` of `R` is actually a sieve.
-/
@[simps]
def functorPullback (R : Sieve (F.obj X)) : Sieve X

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

(CategoryTheory.Sieve.functorPullback F R).arrows = CategoryTheory.Presieve.functorPullback F R.arrows


theorem then_eq_gt {o₁ o₂ : Ordering} : o₁.then o₂ = gt ↔ o₁ = gt ∨ o₁ = eq ∧ o₂ = gt

o₁.then o₂ = Ordering.gt ↔ o₁ = Ordering.gt ∨ o₁ = Ordering.eq ∧ o₂ = Ordering.gt


theorem degreeOf_add_le (n : σ) (f g : MvPolynomial σ R) :
    degreeOf n (f + g) ≤ max (degreeOf n f) (degreeOf n g)

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(n : σ)
(f g : MvPolynomial σ R)

MvPolynomial.degreeOf n (f + g) ≤ max (MvPolynomial.degreeOf n f) (MvPolynomial.degreeOf n g)


theorem mono_inl_of_isColimit [Mono g] {s : PushoutCocone f g} (hs : IsColimit s) : Mono s.inl

{s : CategoryTheory.Limits.PushoutCocone f g}

(hs : CategoryTheory.Limits.IsColimit s)


/-- The defining property of the weak operator topology: a function `f` tends to
`A : E →WOT[𝕜] F` along filter `l` iff `y (f a x)` tends to `y (A x)` along the same filter. -/
lemma tendsto_iff_forall_dual_apply_tendsto {α : Type*} {l : Filter α} {f : α → E →WOT[𝕜] F}
    {A : E →WOT[𝕜] F} :
    Tendsto f l (𝓝 A) ↔ ∀ x (y : F⋆), Tendsto (fun a => y (f a x)) l (𝓝 (y (A x)))

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[AddCommGroup E]
[TopologicalSpace E]
[Module 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{α : Type u_4}
{l : Filter α}
{f : α → E →WOT[𝕜]F}
{A : E →WOT[𝕜]F}

Filter.Tendsto f l (𝓝 A) ↔ ∀ (x : E) (y : NormedSpace.Dual 𝕜 F), Filter.Tendsto (fun a => y ((f a) x)) l (𝓝 (y (A x)))


theorem _root_.WithSeminorms.uniformEquicontinuous_iff_bddAbove_and_continuous_iSup {κ : Type*}
    {q : SeminormFamily 𝕜₂ F ι'} [UniformSpace E] [UniformAddGroup E] [u : UniformSpace F]
    [hu : UniformAddGroup F] (hq : WithSeminorms q) [ContinuousSMul 𝕜 E]
    (f : κ → E →ₛₗ[σ₁₂] F) :
    UniformEquicontinuous ((↑) ∘ f) ↔ ∀ i,
    BddAbove (range fun k ↦ (q i).comp (f k)) ∧
      Continuous (⨆ k, (q i).comp (f k))

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_5}
{F : Type u_6}
{ι' : Type u_9}
[NontriviallyNormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[NontriviallyNormedField 𝕜₂]
[AddCommGroup F]
[Module 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[RingHomIsometric σ₁₂]
[Nonempty ι']
{κ : Type u_10}
{q : SeminormFamily 𝕜₂ F ι'}
[UniformSpace E]
[UniformAddGroup E]
[u : UniformSpace F]
[hu : UniformAddGroup F]
(hq : WithSeminorms q)
[ContinuousSMul 𝕜 E]
(f : κ → E →ₛₗ[σ₁₂] F)

UniformEquicontinuous (DFunLike.coe ∘ f) ↔
  ∀ (i : ι'), BddAbove (Set.range fun k => (q i).comp (f k)) ∧ Continuous (⨆ k, ⇑((q i).comp (f k)))


theorem isConnected_Iio [NoMinOrder α] : IsConnected (Iio a)

{α : Type u}
[ConditionallyCompleteLinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[DenselyOrdered α]
{a : α}
[NoMinOrder α]


@[simp]
theorem default_nim_one_rightMoves_eq :
    (default : (nim 1).RightMoves) = @toRightMovesNim 1 ⟨0, Set.mem_Iio.mpr zero_lt_one⟩

default = SetTheory.PGame.toRightMovesNim ⟨0, ⋯⟩


@[norm_cast, simp]
theorem coe_sub (f g : P →ᴬ[R] W) : ⇑(f - g) = f - g

{R : Type u_1}
{V : Type u_2}
{W : Type u_3}
{P : Type u_4}
[Ring R]
[AddCommGroup V]
[Module R V]
[TopologicalSpace P]
[AddTorsor V P]
[AddCommGroup W]
[Module R W]
[TopologicalSpace W]
[TopologicalAddGroup W]
(f g : P →ᴬ[R] W)


theorem ascPochhammer_succ_succ (r : R) (k : ℕ) :
    smeval (ascPochhammer ℕ (k + 1)) (r + 1) = Nat.factorial (k + 1) • multichoose (r + 1) k +
    smeval (ascPochhammer ℕ (k + 1)) r

{R : Type u_2}
[NonAssocSemiring R]
[Pow R ℕ]
[NatPowAssoc R]
[BinomialRing R]
(r : R)
(k : ℕ)

(ascPochhammer ℕ (k + 1)).smeval (r + 1) =
  (k + 1).factorial • Ring.multichoose (r + 1) k + (ascPochhammer ℕ (k + 1)).smeval r


theorem zero_mem_measurableLE : (0 : α → ℝ≥0∞) ∈ measurableLE μ ν

{α : Type u_1}
{m : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}

0 ∈ MeasureTheory.Measure.LebesgueDecomposition.measurableLE μ ν


@[simp]
theorem add_int_iff : LiouvilleWith p (x + m) ↔ LiouvilleWith p x

LiouvilleWith p (x + ↑m) ↔ LiouvilleWith p x


theorem ofNat_eq_zero : ((n : Nat) : Int) = 0 ↔ n = 0


theorem contDiff_iff_forall_nat_le : ContDiff 𝕜 n f ↔ ∀ m : ℕ, ↑m ≤ n → ContDiff 𝕜 m f

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{n : ℕ∞}

ContDiff 𝕜 n f ↔ ∀ (m : ℕ), ↑m ≤ n → ContDiff 𝕜 (↑m) f


theorem mul_one (a : R) : a * (nat_lit 1).rawCast = a


theorem MeasurePreserving.setLIntegral_comp_preimage {mb : MeasurableSpace β} {ν : Measure β}
    {g : α → β} (hg : MeasurePreserving g μ ν) {s : Set β} (hs : MeasurableSet s) {f : β → ℝ≥0∞}
    (hf : Measurable f) : ∫⁻ a in g ⁻¹' s, f (g a) ∂μ = ∫⁻ b in s, f b ∂ν

(hg : MeasureTheory.MeasurePreserving g μ ν)

{f : β → ℝ≥0∞}

∫⁻ (a : α) in g ⁻¹' s, f (g a) ∂μ = ∫⁻ (b : β) in s, f b ∂ν


theorem generateFrom_Ico_mem_le_borel {α : Type*} [TopologicalSpace α] [LinearOrder α]
    [OrderClosedTopology α] (s t : Set α) :
    MeasurableSpace.generateFrom { S | ∃ l ∈ s, ∃ u ∈ t, l < u ∧ Ico l u = S }
      ≤ borel α

{α : Type u_5}
[TopologicalSpace α]
[LinearOrder α]
[OrderClosedTopology α]
(s t : Set α)

MeasurableSpace.generateFrom {S | ∃ l ∈ s, ∃ u ∈ t, l < u ∧ Set.Ico l u = S} ≤ borel α


theorem uniformContinuous_eval_of_mem_sUnion {x : α} (hx : x ∈ ⋃₀ 𝔖) :
    UniformContinuous ((Function.eval x : (α → β) → β) ∘ toFun 𝔖)

{α : Type u_1}
(β : Type u_2)
[UniformSpace β]
(𝔖 : Set (Set α))
{x : α}
(hx : x ∈ ⋃₀ 𝔖)

UniformContinuous (Function.eval x ∘ ⇑(UniformOnFun.toFun 𝔖))


/-- A product of topological spaces can be split as the binary product of one of the spaces and
  the product of all the remaining spaces. -/
@[simps!]
def piSplitAt (Y : ι → Type*) [∀ j, TopologicalSpace (Y j)] :
    (∀ j, Y j) ≃ₜ Y i × ∀ j : { j // j ≠ i }, Y j

(f : Y i × ((j : { j // j ≠ i }) → Y ↑j))

(Homeomorph.piSplitAt i Y).symm f j = if h : j = i then ⋯ ▸ f.1 else f.2 ⟨j, h⟩


theorem Continuous.uncurry_right {f : X → Y → Z} (y : Y) (h : Continuous (uncurry f)) :
    Continuous fun a => f a y

{X : Type u}
{Y : Type v}
{Z : Type u_1}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{f : X → Y → Z}
(y : Y)
(h : Continuous (Function.uncurry f))


@[simp]
theorem eval₂_mul' :
    (p * q).eval₂ (algebraMap R S) x = p.eval₂ (algebraMap R S) x * q.eval₂ (algebraMap R S) x

{R : Type u}
{S : Type v}
[CommSemiring R]
[Semiring S]
[Algebra R S]
(x : S)
(p q : R[X])

Polynomial.eval₂ (algebraMap R S) x (p * q) =
  Polynomial.eval₂ (algebraMap R S) x p * Polynomial.eval₂ (algebraMap R S) x q


theorem eq_zero_of_zero_dvd (h : 0 ∣ a) : a = 0

{α : Type u_1}
[SemigroupWithZero α]
{a : α}
(h : 0 ∣ a)


@[simp]
theorem arrow_congr {A : C} (X Y : Subobject A) (h : X = Y) :
    eqToHom (congr_arg (fun X : Subobject A => (X : C)) h) ≫ Y.arrow = X.arrow

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{A : C}
(X Y : CategoryTheory.Subobject A)
(h : X = Y)

CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom ⋯) Y.arrow = X.arrow


/-- Matrices over dual numbers and dual numbers over matrices are isomorphic. -/
@[simps]
def Matrix.dualNumberEquiv : Matrix n n (DualNumber R) ≃ₐ[R] DualNumber (Matrix n n R)

{R n : Type}
[CommSemiring R]
[Fintype n]
[DecidableEq n]
(d : DualNumber (Matrix n n R))

Matrix.dualNumberEquiv.symm d = Matrix.of fun i j => (TrivSqZeroExt.fst d i j, TrivSqZeroExt.snd d i j)


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

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


@[to_additive]
theorem mul_bddBelow_range_add {p q : GroupSeminorm E} {x : E} :
    BddBelow (range fun y => p y + q (x / y))

{E : Type u_4}
[AddCommGroup E]
{p q : AddGroupSeminorm E}
{x : E}

BddBelow (Set.range fun y => p y + q (x - y))


@[to_additive sum_le_sum_fiberwise_of_sum_fiber_nonpos]
theorem prod_le_prod_fiberwise_of_prod_fiber_le_one' {t : Finset ι'} {g : ι → ι'} {f : ι → N}
    (h : ∀ y ∉ t, ∏ x ∈ s.filter fun x ↦ g x = y, f x ≤ 1) :
    ∏ x ∈ s, f x ≤ ∏ y ∈ t, ∏ x ∈ s.filter fun x ↦ g x = y, f x

(h : ∀ y ∉ t, ∏ x ∈ Finset.filter (fun x => g x = y) s, f x ≤ 1)

∏ x ∈ s, f x ≤ ∏ y ∈ t, ∏ x ∈ Finset.filter (fun x => g x = y) s, f x


@[elab_without_expected_type]
theorem total_of [IsTotal α r] (a b : α) : a ≺ b ∨ b ≺ a

{α : Sort u}
(r : α → α → Prop)
[IsTotal α r]
(a b : α)


theorem hasBasis_nhds_of_ne_top (xt : x ≠ ∞) :
    (𝓝 x).HasBasis (0 < ·) (fun ε => Icc (x - ε) (x + ε))

(𝓝 x).HasBasis (fun x => 0 < x) fun ε => Set.Icc (x - ε) (x + ε)


/-- The functor which sends a split simplicial object in a preadditive category to
the chain complex which consists of nondegenerate simplices. -/
@[simps]
noncomputable def nondegComplexFunctor : Split C ⥤ ChainComplex C ℕ

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
(S : SimplicialObject.Split C)

SimplicialObject.Split.nondegComplexFunctor.obj S = S.s.nondegComplex


/-- A natural transformation to a representable functor induces a sieve. This is the left inverse of
`functorInclusion`, shown in `sieveOfSubfunctor_functorInclusion`.
-/
@[simps]
def sieveOfSubfunctor {R} (f : R ⟶ yoneda.obj X) : Sieve X

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

(CategoryTheory.Sieve.sieveOfSubfunctor f).arrows g = ∃ t, f.app (Opposite.op Y) t = g


@[simp]
theorem mk0_one (h := one_ne_zero) : mk0 (1 : G₀) h = 1

{G₀ : Type u_3}
[GroupWithZero G₀]
(h : 1 ≠ 0 := ⋯)


theorem same_add_div (h : b ≠ 0) : (b + a) / b = 1 + a / b

{α : Type u_1}
[DivisionSemiring α]
{a b : α}
(h : b ≠ 0)


theorem slash_action_eqn' (k : ℤ) (Γ : Subgroup SL(2, ℤ)) [SlashInvariantFormClass F Γ k] (f : F)
    (γ : Γ) (z : ℍ) : f (γ • z) = ((↑ₘ[ℤ] γ 1 0 : ℂ) * z + (↑ₘ[ℤ] γ 1 1 : ℂ)) ^ k * f z

{F : Type u_1}
[FunLike F ℍ ℂ]
(k : ℤ)
(Γ : Subgroup SL(2, ℤ))
[SlashInvariantFormClass F Γ k]
(f : F)
(γ : ↥Γ)
(z : ℍ)

f (γ • z) = (↑(↑↑↑γ 1 0) * ↑z + ↑(↑↑↑γ 1 1)) ^ k * f z


@[simp]
theorem map_eq_zero {s : Multiset α} {f : α → β} : s.map f = 0 ↔ s = 0

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


@[reassoc (attr := simp)]
theorem coprod.inr_map {W X Y Z : C} [HasBinaryCoproduct W X] [HasBinaryCoproduct Y Z] (f : W ⟶ Y)
    (g : X ⟶ Z) : coprod.inr ≫ coprod.map f g = g ≫ coprod.inr

CategoryTheory.Limits.coprod.inr ≫ CategoryTheory.Limits.coprod.map f g = g ≫ CategoryTheory.Limits.coprod.inr


@[simp]
theorem not_bddBelow_univ [NoMinOrder α] : ¬BddBelow (univ : Set α)

{α : Type u}
[Preorder α]
[NoMinOrder α]


/-- A transitive permutation group generated by transpositions must be the whole symmetric group -/
theorem closure_of_isSwap_of_isPretransitive [Finite α] {S : Set (Perm α)} (hS : ∀ σ ∈ S, σ.IsSwap)
    [MulAction.IsPretransitive (Subgroup.closure S) α] : Subgroup.closure S = ⊤

[MulAction.IsPretransitive (↥(Subgroup.closure S)) α]


@[simp] lemma lift_lt_lift : lift a < lift b ↔ a < b

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

Booleanisation.lift a < Booleanisation.lift b ↔ a < b


theorem IsIntegralClosure.eq_bot_of_comap_eq_bot [Nontrivial R] {I : Ideal A} :
    I.comap (algebraMap R A) = ⊥ → I = ⊥

{R : Type u_1}
[CommRing R]
(S : Type u_2)
[CommRing S]
[Algebra R S]
{A : Type u_3}
[CommRing A]
[Algebra R A]
[Algebra A S]
[IsScalarTower R A S]
[IsIntegralClosure A R S]
[IsDomain A]
[Nontrivial R]
{I : Ideal A}

Ideal.comap (algebraMap R A) I = ⊥ → I = ⊥


@[simp, nolint simpNF]
theorem intermediateFieldMap_apply_coe (e : L ≃ₐ[K] L') (E : IntermediateField K L) (a : E) :
    ↑(intermediateFieldMap e E a) = e a

{K : Type u_1}
{L : Type u_2}
{L' : Type u_3}
[Field K]
[Field L]
[Field L']
[Algebra K L]
[Algebra K L']
(e : L ≃ₐ[K] L')
(E : IntermediateField K L)
(a : ↥E)

↑((IntermediateField.intermediateFieldMap e E) a) = e ↑a


theorem hasStrictDerivAt_tan {x : ℂ} (h : cos x ≠ 0) : HasStrictDerivAt tan (1 / cos x ^ 2) x

HasStrictDerivAt Complex.tan (1 / Complex.cos x ^ 2) x


@[simp] theorem set!_is_setD : @set! = @setD


@[mono]
theorem mul_le_mul {M N P Q : AddSubmonoid R} (hmp : M ≤ P) (hnq : N ≤ Q) : M * N ≤ P * Q

{R : Type u_4}
[NonUnitalNonAssocSemiring R]
{M N P Q : AddSubmonoid R}
(hmp : M ≤ P)
(hnq : N ≤ Q)


@[simp]
theorem cpow_eq_pow (x y : ℂ) : cpow x y = x ^ y


theorem isBasis_iff_cover {B : Set (Opens α)} :
    IsBasis B ↔ ∀ U : Opens α, ∃ Us, Us ⊆ B ∧ U = sSup Us

{α : Type u_2}
[TopologicalSpace α]
{B : Set (TopologicalSpace.Opens α)}

TopologicalSpace.Opens.IsBasis B ↔ ∀ (U : TopologicalSpace.Opens α), ∃ Us ⊆ B, U = sSup Us


lemma eval_polynomialZ (P : Fin 3 → R) : eval P W'.polynomialZ =
    W'.a₁ * P x * P y + 3 * W'.a₃ * P y * P z ^ 2 -
      (2 * W'.a₂ * P x ^ 2 * P z + 4 * W'.a₄ * P x * P z ^ 3 + 6 * W'.a₆ * P z ^ 5)

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

(MvPolynomial.eval P) W'.polynomialZ =
  W'.a₁ * P x * P y + 3 * W'.a₃ * P y * P z ^ 2 -
    (2 * W'.a₂ * P x ^ 2 * P z + 4 * W'.a₄ * P x * P z ^ 3 + 6 * W'.a₆ * P z ^ 5)


theorem covBy_iff_Ioo_eq : a ⋖ b ↔ a < b ∧ Ioo a b = ∅


/-- If `a` is a left identity for `f : α → β → β`, then `{a}` is a left identity for
`Finset.image₂ f`. -/
theorem image₂_left_identity {f : α → γ → γ} {a : α} (h : ∀ b, f a b = b) (t : Finset γ) :
    image₂ f {a} t = t

{α : Type u_1}
{γ : Type u_5}
[DecidableEq γ]
{f : α → γ → γ}
{a : α}
(h : ∀ (b : γ), f a b = b)
(t : Finset γ)


@[simp]
theorem realize_bdEqual (t₁ t₂ : L.Term (α ⊕ (Fin l))) :
    (t₁.bdEqual t₂).Realize v xs ↔ t₁.realize (Sum.elim v xs) = t₂.realize (Sum.elim v xs)

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{l : ℕ}
{v : α → M}
{xs : Fin l → M}
(t₁ t₂ : L.Term (α ⊕ Fin l))

(t₁.bdEqual t₂).Realize v xs ↔
  FirstOrder.Language.Term.realize (Sum.elim v xs) t₁ = FirstOrder.Language.Term.realize (Sum.elim v xs) t₂


theorem prod_inf_prod {f₁ f₂ : Filter α} {g₁ g₂ : Filter β} :
    (f₁ ×ˢ g₁) ⊓ (f₂ ×ˢ g₂) = (f₁ ⊓ f₂) ×ˢ (g₁ ⊓ g₂)

{α : Type u_1}
{β : Type u_2}
{f₁ f₂ : Filter α}
{g₁ g₂ : Filter β}

f₁ ×ˢ g₁ ⊓ f₂ ×ˢ g₂ = (f₁ ⊓ f₂) ×ˢ (g₁ ⊓ g₂)


/-- A family `v : α → V` is generating `V` iff every element `(x : V)`
can be written as sum `∑ cᵢ • vᵢ = x`.
-/
theorem top_le_span_range_iff_forall_exists_fun :
    ⊤ ≤ span R (range v) ↔ ∀ x, ∃ c : α → R, ∑ i, c i • v i = x

{α : Type u_1}
{M : Type u_2}
(R : Type u_3)
[Fintype α]
[Semiring R]
[AddCommMonoid M]
[Module R M]
{v : α → M}

⊤ ≤ Submodule.span R (Set.range v) ↔ ∀ (x : M), ∃ c, ∑ i : α, c i • v i = x


@[to_additive (attr := simp)]
theorem piCongrRight_trans {η : Type*} {Ms Ns Ps : η → Type*} [∀ j, Mul (Ms j)]
    [∀ j, Mul (Ns j)] [∀ j, Mul (Ps j)] (es : ∀ j, Ms j ≃* Ns j) (fs : ∀ j, Ns j ≃* Ps j) :
    (piCongrRight es).trans (piCongrRight fs) = piCongrRight fun i => (es i).trans (fs i)

{η : Type u_12}
{Ms : η → Type u_13}
{Ns : η → Type u_14}
{Ps : η → Type u_15}
[(j : η) → Add (Ms j)]
[(j : η) → Add (Ns j)]
[(j : η) → Add (Ps j)]
(es : (j : η) → Ms j ≃+ Ns j)
(fs : (j : η) → Ns j ≃+ Ps j)

(AddEquiv.piCongrRight es).trans (AddEquiv.piCongrRight fs) = AddEquiv.piCongrRight fun i => (es i).trans (fs i)


@[to_additive (attr := simp)]
theorem pureMulHom_apply (a : α) : pureMulHom a = pure a


@[norm_cast]
theorem coe_prod (s : Subring R) (t : Subring S) :
    (s.prod t : Set (R × S)) = (s : Set R) ×ˢ (t : Set S)

{R : Type u}
{S : Type v}
[Ring R]
[Ring S]
(s : Subring R)
(t : Subring S)


@[simp] theorem liftRel_swap_iff : LiftRel s r x.swap y.swap ↔ LiftRel r s x y

∀ {β : Type u_1} {β_1 : Type u_2} {s : β → β_1 → Prop} {α : Type u_3} {α_1 : Type u_4} {r : α → α_1 → Prop} {x : α ⊕ β}
  {y : α_1 ⊕ β_1}, Sum.LiftRel s r x.swap y.swap ↔ Sum.LiftRel r s x y


theorem card_units_lt (M₀ : Type*) [MonoidWithZero M₀] [Nontrivial M₀] [Fintype M₀] :
    Fintype.card M₀ˣ < Fintype.card M₀

(M₀ : Type u_2)
[MonoidWithZero M₀]
[Nontrivial M₀]
[Fintype M₀]


@[simp] theorem insert_of_mem {l : List α} (h : a ∈ l) : l.insert a = l

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


theorem iterate_iterate_self (m n : ℕ) : Commute f^[m] f^[n]


theorem add_factorial_le_factorial_add (i : ℕ) {n : ℕ} (n1 : 1 ≤ n) : i + n ! ≤ (i + n)!


lemma eq_none_or_eq_some (a : Option α) : a = none ∨ ∃ x, a = some x


/-- **Hölder inequality**: the scalar product of two functions is bounded by the product of their
`L^p` and `L^q` norms when `p` and `q` are conjugate exponents. Version for sums over finite sets,
with real-valued nonnegative functions. -/
theorem inner_le_Lp_mul_Lq_of_nonneg (hpq : IsConjExponent p q) (hf : ∀ i ∈ s, 0 ≤ f i)
    (hg : ∀ i ∈ s, 0 ≤ g i) :
    ∑ i ∈ s, f i * g i ≤ (∑ i ∈ s, f i ^ p) ^ (1 / p) * (∑ i ∈ s, g i ^ q) ^ (1 / q)

{ι : Type u}
(s : Finset ι)
{f g : ι → ℝ}
{p q : ℝ}
(hpq : p.IsConjExponent q)
(hf : ∀ i ∈ s, 0 ≤ f i)
(hg : ∀ i ∈ s, 0 ≤ g i)


theorem locallyConnectedSpace_iff_open_connected_subsets :
    LocallyConnectedSpace α ↔
      ∀ x, ∀ U ∈ 𝓝 x, ∃ V : Set α, V ⊆ U ∧ IsOpen V ∧ x ∈ V ∧ IsConnected V

LocallyConnectedSpace α ↔ ∀ (x : α), ∀ U ∈ 𝓝 x, ∃ V ⊆ U, IsOpen V ∧ x ∈ V ∧ IsConnected V


@[simp]
theorem edgeDensity_empty_left (t : Finset α) : G.edgeDensity ∅ t = 0

{α : Type u_4}
(G : SimpleGraph α)
[DecidableRel G.Adj]
(t : Finset α)


@[simp] theorem false_iff (p : Prop) : (False ↔ p) = ¬p


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


theorem setIntegral_mono_ae (h : f ≤ᵐ[μ] g) : ∫ x in s, f x ∂μ ≤ ∫ x in s, g x ∂μ

{X : Type u_1}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
{f g : X → ℝ}
{s : Set X}
(hf : MeasureTheory.IntegrableOn f s μ)
(hg : MeasureTheory.IntegrableOn g s μ)
(h : f ≤ᵐ[μ] g)

∫ (x : X) in s, f x ∂μ ≤ ∫ (x : X) in s, g x ∂μ


lemma isZero₁_of_isIso₂ (h : IsIso T.mor₂) : IsZero T.obj₁

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

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)


theorem IsProper.not_mem_or_compl_not_mem (hI : IsProper I) : x ∉ I ∨ xᶜ ∉ I

{P : Type u_1}
[BooleanAlgebra P]
{x : P}
{I : Order.Ideal P}
(hI : I.IsProper)

x ∉ I ∨ xᶜ ∉ I


theorem continuous_of_cover_nhds {ι : Sort*} {f : α → β} {s : ι → Set α}
    (hs : ∀ x : α, ∃ i, s i ∈ 𝓝 x) (hf : ∀ i, ContinuousOn f (s i)) :
    Continuous f

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{ι : Sort u_7}
{f : α → β}
{s : ι → Set α}
(hs : ∀ (x : α), ∃ i, s i ∈ 𝓝 x)
(hf : ∀ (i : ι), ContinuousOn f (s i))


theorem toNat_sub {n : ℕ∞} (hn : n ≠ ⊤) (m : ℕ∞) : toNat (m - n) = toNat m - toNat n


theorem fderivWithin.comp_derivWithin_of_eq {t : Set F} (hl : DifferentiableWithinAt 𝕜 l t y)
    (hf : DifferentiableWithinAt 𝕜 f s x) (hs : MapsTo f s t) (hxs : UniqueDiffWithinAt 𝕜 s x)
    (hy : y = f x) :
    derivWithin (l ∘ f) s x = (fderivWithin 𝕜 l t (f x) : F → E) (derivWithin f s x)

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type w}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f : 𝕜 → F}
(x : 𝕜)
{s : Set 𝕜}
{l : F → E}
{y : F}
{t : Set F}
(hl : DifferentiableWithinAt 𝕜 l t y)
(hf : DifferentiableWithinAt 𝕜 f s x)
(hs : Set.MapsTo f s t)
(hxs : UniqueDiffWithinAt 𝕜 s x)
(hy : y = f x)

derivWithin (l ∘ f) s x = (fderivWithin 𝕜 l t (f x)) (derivWithin f s x)


lemma cliqueFinset_eq_image [NoAccidental t] : (graph t).cliqueFinset 3 = t.image toTriangle

(SimpleGraph.TripartiteFromTriangles.graph t).cliqueFinset 3 =
  Finset.image (⇑SimpleGraph.TripartiteFromTriangles.toTriangle) t


theorem hasFDerivAt_stereoInvFunAux_comp_coe (v : E) :
    HasFDerivAt (stereoInvFunAux v ∘ ((↑) : (ℝ ∙ v)ᗮ → E)) (ℝ ∙ v)ᗮ.subtypeL 0

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

HasFDerivAt (stereoInvFunAux v ∘ Subtype.val) (Submodule.span ℝ {v})ᗮ.subtypeL 0


theorem lt_iff_sub_pos {x y : PGame} : x < y ↔ 0 < y - x


/-- Bijection between a subsemiring `S` and `MulOpposite` of its opposite. -/
@[simps!]
def ringEquivOpMop (S : Subsemiring R) : S ≃+* (S.op)ᵐᵒᵖ

{R : Type u_2}
[NonAssocSemiring R]
(S : Subsemiring R)

∀ (a : ↥S), S.ringEquivOpMop a = MulOpposite.op (S.addEquivOp a)


theorem CPolynomialAt.contDiffAt (h : CPolynomialAt 𝕜 f x) {n : ℕ∞} :
    ContDiffAt 𝕜 n f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{x : E}
(h : CPolynomialAt 𝕜 f x)
{n : ℕ∞}


@[simp]
theorem ofFinsupp_erase (p : R[ℕ]) (n : ℕ) :
    (⟨p.erase n⟩ : R[X]) = (⟨p⟩ : R[X]).erase n

{R : Type u}
[Semiring R]
(p : R[ℕ])
(n : ℕ)

{ toFinsupp := Finsupp.erase n p } = Polynomial.erase n { toFinsupp := p }


theorem continuousAt_extChartAt (x : M) : ContinuousAt (extChartAt I x) x

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


theorem btw_rfl_left_right {a b : α} : btw a b a

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


/-- Poincaré recurrence theorem: given a conservative map `f` and a measurable set `s`, the set
of points `x ∈ s` such that `x` does not return to `s` after `≥ n` iterations has measure zero. -/
theorem measure_mem_forall_ge_image_not_mem_eq_zero (hf : Conservative f μ)
    (hs : NullMeasurableSet s μ) (n : ℕ) :
    μ ({ x ∈ s | ∀ m ≥ n, f^[m] x ∉ s }) = 0

(hs : MeasureTheory.NullMeasurableSet s μ)

μ {x | x ∈ s ∧ ∀ m ≥ n, f^[m] x ∉ s} = 0


theorem LinearMap.quasiMeasurePreserving (f : E →ₗ[ℝ] E) (hf : LinearMap.det f ≠ 0) :
    QuasiMeasurePreserving f μ μ

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
[FiniteDimensional ℝ E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]
(f : E →ₗ[ℝ] E)
(hf : LinearMap.det f ≠ 0)

MeasureTheory.Measure.QuasiMeasurePreserving (⇑f) μ μ


@[to_additive] lemma Antivary.pow_left (hfg : Antivary f g) (n : ℕ) : Antivary (f ^ n) g

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedAddCommGroup α]
[OrderedAddCommGroup β]
{f : ι → α}
{g : ι → β}
(hfg : Antivary f g)
(n : ℕ)


theorem monoidalClosed_curry {M N P : ModuleCat.{u} R} (f : M ⊗ N ⟶ P) (x : M) (y : N) :
    @DFunLike.coe _ _ _ LinearMap.instFunLike
      ((MonoidalClosed.curry f : N →ₗ[R] M →ₗ[R] P) y) x = f (x ⊗ₜ[R] y)

(f : CategoryTheory.MonoidalCategory.tensorObj M N ⟶ P)

((CategoryTheory.MonoidalClosed.curry f) y) x = f (x ⊗ₜ[R] y)


@[simp] protected theorem neg_neg : ∀ a : Int, -(-a) = a


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

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[TopologicalSpace α]
[Preorder α]
[TopologicalSpace β]
[Preorder β]
[TopologicalSpace γ]
[Preorder γ]
{g : β →Co γ}
{f₁ f₂ : α →Co β}
(hg : Function.Injective ⇑g)


theorem toSmoothPartitionOfUnity_eq_mul_prod (i : ι) (x : M) (t : Finset ι)
    (ht : ∀ j, WellOrderingRel j i → fs j x ≠ 0 → j ∈ t) :
    fs.toSmoothPartitionOfUnity i x =
      fs i x * ∏ j ∈ t.filter fun j => WellOrderingRel j i, (1 - fs j x)

(ht : ∀ (j : ι), WellOrderingRel j i → ↑(fs.toFun j) x ≠ 0 → j ∈ t)

(fs.toSmoothPartitionOfUnity i) x =
  ↑(fs.toFun i) x * ∏ j ∈ Finset.filter (fun j => WellOrderingRel j i) t, (1 - ↑(fs.toFun j) x)


lemma isUnit_charpolyRev_of_isNilpotent (hM : IsNilpotent M) :
    IsUnit M.charpolyRev

{R : Type u}
[CommRing R]
{n : Type v}
[DecidableEq n]
[Fintype n]
{M : Matrix n n R}
(hM : IsNilpotent M)


@[simp]
theorem sUnion_insert (s : Set α) (T : Set (Set α)) : ⋃₀insert s T = s ∪ ⋃₀T

{α : Type u_1}
(s : Set α)
(T : Set (Set α))


/-- A quandle is a rack such that each automorphism fixes its corresponding element.
-/
class Quandle (α : Type*) extends Rack α where
  /-- The fixing property of a Quandle -/
  fix : ∀ {x : α}, act x x = x

{α : Type u_1}
[self : Quandle α]
{x : α}


protected theorem insert (hs : IsWeakAntichain s) :
    (∀ ⦃b⦄, b ∈ s → a ≠ b → ¬b ≺ a) →
      (∀ ⦃b⦄, b ∈ s → a ≠ b → ¬a ≺ b) → IsWeakAntichain (insert a s)

{ι : Type u_1}
{α : ι → Type u_2}
[(i : ι) → Preorder (α i)]
{s : Set ((i : ι) → α i)}
{a : (i : ι) → α i}
(hs : IsWeakAntichain s)

(∀ ⦃b : (i : ι) → α i⦄, b ∈ s → a ≠ b → ¬StrongLT b a) →
  (∀ ⦃b : (i : ι) → α i⦄, b ∈ s → a ≠ b → ¬StrongLT a b) → IsWeakAntichain (insert a s)


theorem mul_inv_le_iff' (h : 0 < b) : a * b⁻¹ ≤ c ↔ a ≤ c * b

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


@[simp]
theorem equivPair_head_smul_equivPair_tail {i : ι} (w : Word M) :
    of (equivPair i w).head • (equivPair i w).tail = w

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
[(i : ι) → DecidableEq (M i)]
[DecidableEq ι]
{i : ι}
(w : Monoid.CoprodI.Word M)

Monoid.CoprodI.of ((Monoid.CoprodI.Word.equivPair i) w).head • ((Monoid.CoprodI.Word.equivPair i) w).tail = w


theorem vars_sum_subset [DecidableEq σ] :
    (∑ i ∈ t, φ i).vars ⊆ Finset.biUnion t fun i => (φ i).vars

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
{ι : Type u_3}
(t : Finset ι)
(φ : ι → MvPolynomial σ R)
[DecidableEq σ]

(∑ i ∈ t, φ i).vars ⊆ t.biUnion fun i => (φ i).vars


theorem invFun_eq_symm {e : A₁ ≃ₐ[R] A₂} : e.invFun = e.symm

{R : Type uR}
{A₁ : Type uA₁}
{A₂ : Type uA₂}
[CommSemiring R]
[Semiring A₁]
[Semiring A₂]
[Algebra R A₁]
[Algebra R A₂]
{e : A₁ ≃ₐ[R] A₂}


private theorem num_div' (p : K[X]) {q : K[X]} (hq : q ≠ 0) :
    num (algebraMap _ _ p / algebraMap _ _ q) =
      Polynomial.C (q / gcd p q).leadingCoeff⁻¹ * (p / gcd p q)

{K : Type u}
[Field K]
(p : K[X])
{q : K[X]}
(hq : q ≠ 0)

((algebraMap K[X] (RatFunc K)) p / (algebraMap K[X] (RatFunc K)) q).num =
  Polynomial.C (q / gcd p q).leadingCoeff⁻¹ * (p / gcd p q)


theorem Ideal.homogeneousHull_mono : Monotone (Ideal.homogeneousHull 𝒜)

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


/-- Local instance for `OrientedOrd lexOrd`. -/
theorem OrientedOrd.instLexOrd [Ord α] [Ord β]
    [OrientedOrd α] [OrientedOrd β] : @OrientedOrd (α × β) lexOrd

{α : Type u_1}
{β : Type u_2}
[Ord α]
[Ord β]
[Batteries.OrientedOrd α]
[Batteries.OrientedOrd β]


@[simp]
theorem ofRealCLM_nnnorm : ‖ofRealCLM‖₊ = 1


theorem charmatrix_apply_natDegree_le (i j : n) :
    (charmatrix M i j).natDegree ≤ ite (i = j) 1 0

{R : Type u}
[CommRing R]
{n : Type v}
[DecidableEq n]
[Fintype n]
{M : Matrix n n R}
(i j : n)

(M.charmatrix i j).natDegree ≤ if i = j then 1 else 0


theorem blocksFun_pos (i : Fin c.length) : 0 < c.blocksFun i

{n : ℕ}
(c : CompositionAsSet n)
(i : Fin c.length)


theorem isAtomic_of_isCoatomic_of_complementedLattice_of_isModular [IsCoatomic α] :
    IsAtomic α

{α : Type u_2}
[Lattice α]
[BoundedOrder α]
[IsModularLattice α]
[ComplementedLattice α]
[IsCoatomic α]


theorem measure_mono_null (h : s ⊆ t) (ht : μ t = 0) : μ s = 0

{α : Type u_1}
{F : Type u_3}
[FunLike F (Set α) ℝ≥0∞]
[MeasureTheory.OuterMeasureClass F α]
{μ : F}
{s t : Set α}
(h : s ⊆ t)
(ht : μ t = 0)


/-- Reinterpreting an `F`-structured arrow `X ⟶ F.obj d` as an arrow under `X` induces a functor
    `StructuredArrow X F ⥤ Under X`. -/
@[simps!]
def toUnder (X : T) (F : D ⥤ T) : StructuredArrow X F ⥤ Under X

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

∀ (X_1 : CategoryTheory.Comma (CategoryTheory.Functor.fromPUnit X) (F.comp (CategoryTheory.Functor.id T))),
  ((CategoryTheory.StructuredArrow.toUnder X F).obj X_1).left = X_1.left


@[to_additive]
theorem div (hf : LipschitzWith Kf f) (hg : LipschitzWith Kg g) :
    LipschitzWith (Kf + Kg) fun x => f x / g x

{α : Type u_5}
{E : Type u_6}
[SeminormedCommGroup E]
[PseudoEMetricSpace α]
{Kf Kg : ℝ≥0}
{f g : α → E}
(hf : LipschitzWith Kf f)
(hg : LipschitzWith Kg g)


/--
A monoid is *graphic* if, for all `x` and `y`, the *graphic identity*
`(x * y) * x = x * y` holds.  For a unital shelf, this graphic
identity holds.
-/
lemma act_act_self_eq (x y : S) : (x ◃ y) ◃ x = x ◃ y

{S : Type u_1}
[UnitalShelf S]
(x y : S)


/-- A version of `Finset.inf'_map` with LHS and RHS reversed.
Also, this lemma assumes that `s` is nonempty instead of assuming that its image is nonempty. -/
lemma inf'_comp_eq_map {s : Finset γ} {f : γ ↪ β} (g : β → α) (hs : s.Nonempty) :
    s.inf' hs (g ∘ f) = (s.map f).inf' (map_nonempty.2 hs) g

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[SemilatticeInf α]
{s : Finset γ}
{f : γ ↪ β}
(g : β → α)
(hs : s.Nonempty)

s.inf' hs (g ∘ ⇑f) = (Finset.map f s).inf' ⋯ g


/-- Auxiliary definition for `Over.coprod`. -/
@[simps]
def Over.coprodObj [HasBinaryCoproducts C] {A : C} : Over A → Over A ⥤ Over A

∀ (a g : CategoryTheory.Over A),
  a.coprodObj.obj g = CategoryTheory.Over.mk (CategoryTheory.Limits.coprod.desc a.hom g.hom)


/-- Evaluation of a function `f : α →₀ M` at a point as an additive monoid homomorphism.

See `Finsupp.lapply` in `LinearAlgebra/Finsupp` for the stronger version as a linear map. -/
@[simps apply]
def applyAddHom (a : α) : (α →₀ M) →+ M

{α : Type u_1}
{M : Type u_5}
[AddZeroClass M]
(a : α)
(g : α →₀ M)


@[simp]
theorem pmul_apply [MulZeroClass R] {f g : ArithmeticFunction R} {x : ℕ} : f.pmul g x = f x * g x

{R : Type u_1}
[MulZeroClass R]
{f g : ArithmeticFunction R}
{x : ℕ}


protected theorem AntitoneOn.Ioi (hf : AntitoneOn f s) : MonotoneOn (fun x => Ioi (f x)) s

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{f : α → β}
{s : Set α}
(hf : AntitoneOn f s)


theorem lineDerivWithin_congr (hs : EqOn f₁ f s) (hx : f₁ x = f x) :
    lineDerivWithin 𝕜 f₁ s x v = lineDerivWithin 𝕜 f s x v

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[AddCommGroup E]
[Module 𝕜 E]
{f f₁ : E → F}
{s : Set E}
{x v : E}
(hs : Set.EqOn f₁ f s)
(hx : f₁ x = f x)


theorem ne_of_irrefl {r} [IsIrrefl α r] : ∀ {x y : α}, r x y → x ≠ y

{α : Type u}
{r : α → α → Prop}
[IsIrrefl α r]
{x y : α}


/-- Ratio of the composition `g.comp f` of two dilations is the product of their ratios. We assume
that there exist two points in `α` at extended distance neither `0` nor `∞` because otherwise
`Dilation.ratio (g.comp f) = Dilation.ratio f = 1` while `Dilation.ratio g` can be any number. This
version works for most general spaces, see also `Dilation.ratio_comp` for a version assuming that
`α` is a nontrivial metric space. -/
theorem ratio_comp' {g : β →ᵈ γ} {f : α →ᵈ β}
    (hne : ∃ x y : α, edist x y ≠ 0 ∧ edist x y ≠ ⊤) : ratio (g.comp f) = ratio g * ratio f

{g : β →ᵈ γ}

{f : α →ᵈ β}

(hne : ∃ x y, edist x y ≠ 0 ∧ edist x y ≠ ⊤)

Dilation.ratio (g.comp f) = Dilation.ratio g * Dilation.ratio f


@[simp]
theorem neg_top : -(⊤ : Submodule R M) = ⊤

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


@[simp]
theorem mulVec_mulVec [Fintype n] [Fintype o] (v : o → α) (M : Matrix m n α) (N : Matrix n o α) :
    M *ᵥ N *ᵥ v = (M * N) *ᵥ v

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
[NonUnitalSemiring α]
[Fintype n]
[Fintype o]
(v : o → α)
(M : Matrix m n α)
(N : Matrix n o α)


/-- An implication of predicates `P → P'` induces a monoidal functor between full monoidal
subcategories. -/
@[simps]
def fullMonoidalSubcategory.map (h : ∀ ⦃X⦄, P X → P' X) :
    MonoidalFunctor (FullSubcategory P) (FullSubcategory P')

(X Y : CategoryTheory.FullSubcategory P)

(CategoryTheory.MonoidalCategory.fullMonoidalSubcategory.map h).μ X Y =
  CategoryTheory.CategoryStruct.id
    (CategoryTheory.MonoidalCategory.tensorObj ((CategoryTheory.FullSubcategory.map h).obj X)
      ((CategoryTheory.FullSubcategory.map h).obj Y))


/-- If `H : C ⥤ D` is an additive functor and `φ` is a morphism of cochain complexes
in `C`, this is the comparison isomorphism (in each degree `n`) between the image
by `H` of `mappingCone φ` and the mapping cone of the image by `H` of `φ`.
It is an auxiliary definition for `mapHomologicalComplexXIso` and
`mapHomologicalComplexIso`. This definition takes an extra
parameter `m : ℤ` such that `n + 1 = m` which may help getting better
definitional properties. See also the equational lemma `mapHomologicalComplexXIso_eq`. -/
@[simps]
noncomputable def mapHomologicalComplexXIso' (n m : ℤ) (hnm : n + 1 = m) :
    ((H.mapHomologicalComplex (ComplexShape.up ℤ)).obj (mappingCone φ)).X n ≅
      (mappingCone ((H.mapHomologicalComplex (ComplexShape.up ℤ)).map φ)).X n

[HomologicalComplex.HasHomotopyCofiber ((H.mapHomologicalComplex (ComplexShape.up ℤ)).map φ)]

(CochainComplex.mappingCone.mapHomologicalComplexXIso' φ H n m hnm).inv =
  (↑(CochainComplex.mappingCone.fst ((H.mapHomologicalComplex (ComplexShape.up ℤ)).map φ))).v n m ⋯ ≫
      H.map ((CochainComplex.mappingCone.inl φ).v m n ⋯) +
    (CochainComplex.mappingCone.snd ((H.mapHomologicalComplex (ComplexShape.up ℤ)).map φ)).v n n ⋯ ≫
      H.map ((CochainComplex.mappingCone.inr φ).f n)


lemma ne_top_iff_exists {x : WithTop α} : x ≠ ⊤ ↔ ∃ a : α, ↑a = x


@[simp]
theorem hasGradientWithinAt_univ : HasGradientWithinAt f f' univ x ↔ HasGradientAt f f' x

{𝕜 : Type u_1}
{F : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
{f : F → 𝕜}
{f' x : F}

HasGradientWithinAt f f' Set.univ x ↔ HasGradientAt f f' x


/-- Two affine maps are equal if they coerce to the same function. -/
@[ext]
theorem ext {f g : P1 →ᵃ[k] P2} (h : ∀ p, f p = g p) : f = g

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
{V2 : Type u_4}
{P2 : Type u_5}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
[AddCommGroup V2]
[Module k V2]
[AffineSpace V2 P2]
{f g : P1 →ᵃ[k] P2}
(h : ∀ (p : P1), f p = g p)


theorem false_iff_iff : (False ↔ a) ↔ ¬a


/-- The "free algebra" functor, sending a type `S` to the free algebra on `S`. -/
@[simps!]
def free : Type u ⥤ AlgebraCat.{u} R

↑((AlgebraCat.free R).obj S) = FreeAlgebra R S


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

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
{f : G →+ N}
{K L : AddSubgroup N}
(hf : Function.Surjective ⇑f)

AddSubgroup.comap f K < AddSubgroup.comap f L ↔ K < L


theorem toList_cons (x : α) (l : DList α) : toList (cons x l) = x :: toList l

{α : Type u}
(x : α)
(l : Batteries.DList α)

(Batteries.DList.cons x l).toList = x :: l.toList


@[to_additive]
theorem inv_mem_Icc_iff : a⁻¹ ∈ Set.Icc c d ↔ a ∈ Set.Icc d⁻¹ c⁻¹

{α : Type u_1}
[OrderedCommGroup α]
{a c d : α}


@[to_additive sum_range_one]
theorem prod_range_one (f : ℕ → β) : ∏ k ∈ range 1, f k = f 0

{β : Type u_4}
[CommMonoid β]
(f : ℕ → β)


/-- Cardinality of an `Ico` of finsets. -/
theorem card_Ico_finset (h : s ⊆ t) : (Ico s t).card = 2 ^ (t.card - s.card) - 1

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

(Finset.Ico s t).card = 2 ^ (t.card - s.card) - 1


theorem dite_comp {P : Prop} [Decidable P]
    {X Y Z : C} (f : P → (X ⟶ Y)) (f' : ¬P → (X ⟶ Y)) (g : Y ⟶ Z) :
    (if h : P then f h else f' h) ≫ g = if h : P then f h ≫ g else f' h ≫ g

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{P : Prop}
[Decidable P]
{X Y Z : C}
(f : P → (X ⟶ Y))
(f' : ¬P → (X ⟶ Y))
(g : Y ⟶ Z)

CategoryTheory.CategoryStruct.comp (if h : P then f h else f' h) g =
  if h : P then CategoryTheory.CategoryStruct.comp (f h) g else CategoryTheory.CategoryStruct.comp (f' h) g


/-- The `MeasurableSpace α` instance on a `StandardBorelSpace` `α` is equal to
the borel sets of `upgradeStandardBorel α`. -/
theorem eq_borel_upgradeStandardBorel [MeasurableSpace α] [StandardBorelSpace α] :
    ‹MeasurableSpace α› = @borel _ (upgradeStandardBorel α).toTopologicalSpace

(α : Type u_1)
[MeasurableSpace α]
[StandardBorelSpace α]


/-- A bialgebra over a commutative (semi)ring `R` is both an algebra and a coalgebra over `R`, such
that the counit and comultiplication are algebra morphisms. -/
class Bialgebra (R : Type u) (A : Type v) [CommSemiring R] [Semiring A] extends
    Algebra R A, Coalgebra R A where
  -- The counit is an algebra morphism
  /-- The counit on a bialgebra preserves 1. -/
  counit_one : counit 1 = 1
  /-- The counit on a bialgebra preserves multiplication. Note that this is written
  in a rather obscure way: it says that two bilinear maps `A →ₗ[R] A →ₗ[R]` are equal.
  The two corresponding equal linear maps `A ⊗[R] A →ₗ[R]`
  are the following: the first factors through `A` and is multiplication on `A` followed
  by `counit`. The second factors through `R ⊗[R] R`, and is `counit ⊗ counit` followed by
  multiplication on `R`.

  See `Bialgebra.mk'` for a constructor for bialgebras which uses
  the more familiar but mathematically equivalent `counit (a * b) = counit a * counit b`. -/
  mul_compr₂_counit : (LinearMap.mul R A).compr₂ counit = (LinearMap.mul R R).compl₁₂ counit counit
  -- The comultiplication is an algebra morphism
  /-- The comultiplication on a bialgebra preserves `1`. -/
  comul_one : comul 1 = 1
  /-- The comultiplication on a bialgebra preserves multiplication. This is written in
  a rather obscure way: it says that two bilinear maps `A →ₗ[R] A →ₗ[R] (A ⊗[R] A)`
  are equal. The corresponding equal linear maps `A ⊗[R] A →ₗ[R] A ⊗[R] A`
  are firstly multiplcation followed by `comul`, and secondly `comul ⊗ comul` followed
  by multiplication on `A ⊗[R] A`.

  See `Bialgebra.mk'` for a constructor for bialgebras which uses the more familiar
  but mathematically equivalent `comul (a * b) = comul a * comul b`. -/
  mul_compr₂_comul :
    (LinearMap.mul R A).compr₂ comul = (LinearMap.mul R (A ⊗[R] A)).compl₁₂ comul comul

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[self : Bialgebra R A]

(LinearMap.mul R A).compr₂ Coalgebra.comul = (LinearMap.mul R (A ⊗[R] A)).compl₁₂ Coalgebra.comul Coalgebra.comul


theorem subset_sSup_of_not_bddAbove [Inhabited s] {t : Set s} (ht : ¬BddAbove t) :
    sSup t = default

{α : Type u_2}
(s : Set α)
[Preorder α]
[SupSet α]
[Inhabited ↑s]
{t : Set ↑s}
(ht : ¬BddAbove t)


/-- A finitely strongly measurable function is measurable. -/
protected theorem measurable [Zero β] [TopologicalSpace β] [PseudoMetrizableSpace β]
    [MeasurableSpace β] [BorelSpace β] (hf : FinStronglyMeasurable f μ) : Measurable f

(hf : MeasureTheory.FinStronglyMeasurable f μ)


@[to_additive]
theorem Multipliable.nat_mul_neg {f : ℤ → M} (hf : Multipliable f) :
    Multipliable fun n : ℕ ↦ f n * f (-n)

{M : Type u_1}
[CommMonoid M]
[TopologicalSpace M]
[ContinuousMul M]
{f : ℤ → M}
(hf : Multipliable f)


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

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

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


theorem coe_mul_zeta_apply [Semiring R] {f : ArithmeticFunction R} {x : ℕ} :
    (f * ζ) x = ∑ i ∈ divisors x, f i

{R : Type u_1}
[Semiring R]
{f : ArithmeticFunction R}
{x : ℕ}

(f * ↑ArithmeticFunction.zeta) x = ∑ i ∈ x.divisors, f i


@[to_additive (attr := fun_prop, aesop safe 20 apply (rule_sets := [Measurable]))]
theorem Measurable.mul [MeasurableMul₂ M] (hf : Measurable f) (hg : Measurable g) :
    Measurable fun a => f a * g a

{M : Type u_2}
{α : Type u_3}
[MeasurableSpace M]
[Mul M]
{m : MeasurableSpace α}
{f g : α → M}
[MeasurableMul₂ M]
(hf : Measurable f)
(hg : Measurable g)


lemma isLocalization : G.IsLocalization (W (· ∈ Set.range F.obj))

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_3, u_2} D]
{F : CategoryTheory.Functor C D}
{G : CategoryTheory.Functor D C}
(adj : G ⊣ F)
[F.Full]
[F.Faithful]

G.IsLocalization (CategoryTheory.Localization.LeftBousfield.W fun x => x ∈ Set.range F.obj)


theorem dotProduct_eq_iff {v w : n → R} : (∀ u, dotProduct v u = dotProduct w u) ↔ v = w

{n : Type u_2}
{R : Type u_4}
[Semiring R]
[Fintype n]
{v w : n → R}

(∀ (u : n → R), Matrix.dotProduct v u = Matrix.dotProduct w u) ↔ v = w


/-- Post-composition by an isometry does not change the Lipschitz-property of a function. -/
lemma Isometry.lipschitzWith_iff {α β γ : Type*} [PseudoEMetricSpace α] [PseudoEMetricSpace β]
    [PseudoEMetricSpace γ] {f : α → β} {g : β → γ} (K : ℝ≥0) (h : Isometry g) :
    LipschitzWith K (g ∘ f) ↔ LipschitzWith K f

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
[PseudoEMetricSpace γ]
{f : α → β}
{g : β → γ}
(K : NNReal)
(h : Isometry g)


/-- Given `f : F ⟶ G`, a morphism between presieves, and `s : G.obj (op U)`, this is the sieve
of `U` consisting of the `i : V ⟶ U` such that `s` restricted along `i` is in the image of `f`. -/
@[simps (config := .lemmasOnly)]
def imageSieve {F G : Cᵒᵖ ⥤ A} (f : F ⟶ G) {U : C} (s : G.obj (op U)) : Sieve U

(s : (CategoryTheory.forget A).obj (G.obj (Opposite.op U)))

(CategoryTheory.Presheaf.imageSieve f s).arrows i = ∃ t, (f.app (Opposite.op V)) t = (G.map i.op) s


@[to_additive card_nsmul_le_sum]
lemma pow_card_le_prod [Preorder M] [CovariantClass M M (Function.swap (· * ·)) (· ≤ ·)]
    [CovariantClass M M (· * ·) (· ≤ ·)] (l : List M) (n : M) (h : ∀ x ∈ l, n ≤ x) :
    n ^ l.length ≤ l.prod

[CovariantClass M M (Function.swap 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]


theorem subtype_ext_iff {β : Type*} {p : α → β → Prop} {x₀ x₁ : Σa, Subtype (p a)} :
    x₀ = x₁ ↔ x₀.fst = x₁.fst ∧ (x₀.snd : β) = x₁.snd

{α : Type u_1}
{β : Type u_7}
{p : α → β → Prop}
{x₀ x₁ : (a : α) × Subtype (p a)}

x₀ = x₁ ↔ x₀.fst = x₁.fst ∧ x₀.snd.val = x₁.snd.val


lemma IsConj.eq (h : IsConj φ σ) (x) : φ (σ x) = star (φ x)

(h : NumberField.ComplexEmbedding.IsConj φ σ)


@[simp]
theorem map_univ_equiv [Fintype β] (f : β ≃ α) : univ.map f.toEmbedding = univ

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
(f : β ≃ α)

Finset.map f.toEmbedding Finset.univ = Finset.univ


/-- A characterization of weak convergence in terms of integrals of bounded continuous
real-valued functions. -/
theorem tendsto_iff_forall_integral_tendsto {γ : Type*} {F : Filter γ} {μs : γ → FiniteMeasure Ω}
    {μ : FiniteMeasure Ω} :
    Tendsto μs F (𝓝 μ) ↔
      ∀ f : Ω →ᵇ ℝ,
        Tendsto (fun i => ∫ x, f x ∂(μs i : Measure Ω)) F (𝓝 (∫ x, f x ∂(μ : Measure Ω)))

{μs : γ → MeasureTheory.FiniteMeasure Ω}

Filter.Tendsto μs F (𝓝 μ) ↔ ∀ (f : Ω →ᵇ ℝ), Filter.Tendsto (fun i => ∫ (x : Ω), f x ∂↑(μs i)) F (𝓝 (∫ (x : Ω), f x ∂↑μ))


@[simp]
theorem liftEquiv_id : liftEquiv M (RingHom.id K) p = Equiv.refl _

{K : Type u_1}
{M : Type u_3}
[CommRing K]
[CommRing M]
(p : ℕ)
[ExpChar K p]
[ExpChar M p]
[PerfectRing M p]

PerfectRing.liftEquiv M (RingHom.id K) p = Equiv.refl (K →+* M)


theorem ofFractionRing_add (p q : FractionRing K[X]) :
    ofFractionRing (p + q) = ofFractionRing p + ofFractionRing q

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

{ toFractionRing := p + q } = { toFractionRing := p } + { toFractionRing := q }


theorem transpose_multiset_sum [AddCommMonoid α] (s : Multiset (Matrix m n α)) :
    s.sumᵀ = (s.map transpose).sum

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[AddCommMonoid α]
(s : Multiset (Matrix m n α))

s.sumᵀ = (Multiset.map Matrix.transpose s).sum


/-- The sine of an angle in a right-angled triangle as a ratio of sides. -/
theorem sin_oangle_add_left_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = ↑(π / 2)) :
    Real.Angle.sin (o.oangle (x + y) y) = ‖x‖ / ‖x + y‖

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

(o.oangle (x + y) y).sin = ‖x‖ / ‖x + y‖


@[to_additive]
theorem prod_eq_foldl (s : Multiset α) :
    prod s = foldl (· * ·) (fun x y z => by simp [mul_right_comm]) 1 s

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

s.prod = Multiset.foldl (fun x x_1 => x * x_1) ⋯ 1 s


@[simp]
theorem univ_union (s : Set α) : univ ∪ s = univ


theorem IntermediateField.AdjoinSimple.card_aut_eq_finrank [FiniteDimensional F E] {α : E}
    (hα : IsIntegral F α) (h_sep : IsSeparable F α)
    (h_splits : (minpoly F α).Splits (algebraMap F F⟮α⟯)) :
    Fintype.card (F⟮α⟯ ≃ₐ[F] F⟮α⟯) = finrank F F⟮α⟯

(h_splits : Polynomial.Splits (algebraMap F ↥F⟮α⟯) (minpoly F α))

Fintype.card (↥F⟮α⟯ ≃ₐ[F] ↥F⟮α⟯) = FiniteDimensional.finrank F ↥F⟮α⟯


@[simp]
theorem val_one : ((1 : { x : R // 0 < x }) : R) = 1

{R : Type u_2}
[StrictOrderedSemiring R]


@[to_additive (attr := simp)]
theorem coe_srangeRestrict {N} [Mul N] (f : M →ₙ* N) (x : M) : (f.srangeRestrict x : N) = f x

{M : Type u_1}
[Add M]
{N : Type u_5}
[Add N]
(f : AddHom M N)
(x : M)


theorem results_thinkN_pure (a : α) (n) : Results (thinkN (pure a) n) a n

((Computation.pure a).thinkN n).Results a n


/-- The functor `Sheaf J A ⥤ Cᵒᵖ ⥤ A` is fully faithful. -/
@[simps]
def fullyFaithfulSheafToPresheaf : (sheafToPresheaf J A).FullyFaithful

(J : CategoryTheory.GrothendieckTopology C)

∀ {X Y : CategoryTheory.Sheaf J A}
  (f : (CategoryTheory.sheafToPresheaf J A).obj X ⟶ (CategoryTheory.sheafToPresheaf J A).obj Y),
  ((CategoryTheory.fullyFaithfulSheafToPresheaf J A).preimage f).val = f


@[simp]
theorem algebraMap_apply (c : R) : algebraMap R Aᵐᵒᵖ c = op (algebraMap R A c)

{R : Type u_1}
{A : Type u_3}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(c : R)

(algebraMap R Aᵐᵒᵖ) c = MulOpposite.op ((algebraMap R A) c)


@[simp, norm_cast]
lemma cast_prod [CommSemiring β] (f : α → ℕ) (s : Finset α) :
    (↑(∏ i ∈ s, f i) : β) = ∏ i ∈ s, (f i : β)

{α : Type u_2}
{β : Type u_3}
[CommSemiring β]
(f : α → ℕ)
(s : Finset α)


@[simp]
theorem coe_liftSupQuotQuotMkₐ : ⇑(liftSupQuotQuotMkₐ R I J) = liftSupQuotQuotMk I J

(R : Type u)
{A : Type u_1}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(I J : Ideal A)

⇑(DoubleQuot.liftSupQuotQuotMkₐ R I J) = ⇑(DoubleQuot.liftSupQuotQuotMk I J)


/-- The `PowerBasis` given by `η - 1`. -/
@[simps!]
noncomputable def subOnePowerBasis : PowerBasis K L

{n : ℕ+}
(K : Type u)
{L : Type v}
[Field K]
[CommRing L]
[IsDomain L]
[Algebra K L]
[IsCyclotomicExtension {n} K L]
{ζ : L}
(hζ : IsPrimitiveRoot ζ ↑n)

(IsPrimitiveRoot.subOnePowerBasis K hζ).dim = (minpoly K (ζ - 1)).natDegree


@[simp]
theorem cof_add (a b : Ordinal) : b ≠ 0 → cof (a + b) = cof b


@[simp]
theorem iInf_N {ι : Sort*} (f : ι → I.Filtration M) : (iInf f).N = ⨅ i, (f i).N

{R M : Type u}
[CommRing R]
[AddCommGroup M]
[Module R M]
{I : Ideal R}
{ι : Sort u_1}
(f : ι → I.Filtration M)


theorem adjoin_le_iff {S : NonUnitalStarSubalgebra R A} {s : Set A} : adjoin R s ≤ S ↔ s ⊆ S

{R : Type u}
{A : Type v}
[CommSemiring R]
[StarRing R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[StarModule R A]
{S : NonUnitalStarSubalgebra R A}
{s : Set A}

NonUnitalStarAlgebra.adjoin R s ≤ S ↔ s ⊆ ↑S


/-- Inversion `x ↦ x⁻¹` as an `IsometryEquiv`. -/
@[to_additive (attr := simps! apply toEquiv) "Negation `x ↦ -x` as an `IsometryEquiv`."]
def inv : G ≃ᵢ G

(G : Type v)
[Group G]
[PseudoEMetricSpace G]
[IsometricSMul G G]
[IsometricSMul Gᵐᵒᵖ G]

∀ (a : G), (IsometryEquiv.inv G) a = a⁻¹


/-- A `HomRel` is a congruence when it's an equivalence on every hom-set, and it can be composed
from left and right. -/
class Congruence : Prop where
  /-- `r` is an equivalence on every hom-set. -/
  equivalence : ∀ {X Y}, _root_.Equivalence (@r X Y)
  /-- Precomposition with an arrow respects `r`. -/
  compLeft : ∀ {X Y Z} (f : X ⟶ Y) {g g' : Y ⟶ Z}, r g g' → r (f ≫ g) (f ≫ g')
  /-- Postcomposition with an arrow respects `r`. -/
  compRight : ∀ {X Y Z} {f f' : X ⟶ Y} (g : Y ⟶ Z), r f f' → r (f ≫ g) (f' ≫ g)

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{r : HomRel C}
[self : CategoryTheory.Congruence r]
{X Y Z : C}
(f : X ⟶ Y)
{g g' : Y ⟶ Z}

r g g' → r (CategoryTheory.CategoryStruct.comp f g) (CategoryTheory.CategoryStruct.comp f g')


lemma hasDerivAt_fourierIntegral
    {f : ℝ → E} (hf : Integrable f) (hf' : Integrable (fun x : ℝ ↦ x • f x)) (w : ℝ) :
    HasDerivAt (𝓕 f) (𝓕 (fun x : ℝ ↦ (-2 * π * I * x) • f x) w) w

(hf : MeasureTheory.Integrable f MeasureTheory.volume)

(hf' : MeasureTheory.Integrable (fun x => x • f x) MeasureTheory.volume)

HasDerivAt (𝓕 f) (𝓕 (fun x => (-2 * ↑π * Complex.I * ↑x) • f x) w) w


@[reassoc]
lemma rightHomologyIso_hom_naturality :
    S₁.rightHomologyIso.hom ≫ homologyMap φ =
      rightHomologyMap φ ≫ S₂.rightHomologyIso.hom

CategoryTheory.CategoryStruct.comp S₁.rightHomologyIso.hom (CategoryTheory.ShortComplex.homologyMap φ) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.rightHomologyMap φ) S₂.rightHomologyIso.hom


theorem mul_neg_eq_neg_mul_symm (a b : ℤ) : a * -b = -(a * b)


theorem isLeft_congr (h : LiftRel r s x y) : x.isLeft ↔ y.isLeft

{α : Type u}
{β : Type v}
{γ : Type u_1}
{δ : Type u_2}
{r : α → γ → Prop}
{s : β → δ → Prop}
{x : α ⊕ β}
{y : γ ⊕ δ}
(h : Sum.LiftRel r s x y)


@[simp]
theorem pi_fst : (q.pi α).fst = const α q.fst

(α : Type u_1)
{β : Type u_2}
(q : TwoPointing β)
[Nonempty α]

(TwoPointing.pi α q).fst = Function.const α q.fst


theorem Nat.coprime_sub_mul_floor_rat_div_of_coprime {n d : ℕ} (n_coprime_d : n.Coprime d) :
    ((n : ℤ) - d * ⌊(n : ℚ) / d⌋).natAbs.Coprime d


@[to_additive (attr := trans)]
theorem Red.trans : Red L₁ L₂ → Red L₂ L₃ → Red L₁ L₃

{α : Type u}
{L₁ L₂ L₃ : List (α × Bool)}

FreeGroup.Red L₁ L₂ → FreeGroup.Red L₂ L₃ → FreeGroup.Red L₁ L₃


@[to_additive (attr := simp)]
theorem mul_iff [CommMonoid M] {x y : M} : IsUnit (x * y) ↔ IsUnit x ∧ IsUnit y


@[simp]
theorem coinduced_bot : (⊥ : TopologicalSpace α).coinduced f = ⊥

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


theorem zeroLocus_subset_zeroLocus_singleton_iff (f g : R) :
    zeroLocus ({f} : Set R) ⊆ zeroLocus {g} ↔ g ∈ (Ideal.span ({f} : Set R)).radical

PrimeSpectrum.zeroLocus {f} ⊆ PrimeSpectrum.zeroLocus {g} ↔ g ∈ (Ideal.span {f}).radical


theorem inf_sSup_eq : a ⊓ sSup s = ⨆ b ∈ s, a ⊓ b

{α : Type u}
[Order.Frame α]
{s : Set α}
{a : α}


@[to_additive]
lemma stabilizer_le_aestabilizer (s : Set α) : stabilizer G s ≤ aestabilizer G μ s

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

∀ {x : MeasurableSpace α} {μ : MeasureTheory.Measure α} [inst : MeasureTheory.VAddInvariantMeasure G α μ] (s : Set α),
  AddAction.stabilizer G s ≤ AddAction.aestabilizer G μ s


theorem negOfNat_mul_negSucc (m n : Nat) : negOfNat n * -[m+1] = ofNat (n * succ m)

Int.negOfNat n * Int.negSucc m = Int.ofNat (n * m.succ)


protected theorem map_add (f : M → N) (x y : M) :
    f (x + y) = f x + f y + polar f x y

{M : Type u_4}
{N : Type u_5}
[AddCommGroup M]
[AddCommGroup N]
(f : M → N)
(x y : M)

f (x + y) = f x + f y + QuadraticMap.polar f x y


@[simp] lemma mk_comp_mk (g : β → γ) (f : α → β) (hg hf) :
    comp ⟨g, hg⟩ ⟨f, hf⟩ = ⟨g ∘ f, hg.comp hf⟩

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[Preorder α]
[Preorder β]
[Preorder γ]
(g : β → γ)
(f : α → β)
(hg : Monotone g)
(hf : Monotone f)

{ toFun := g, monotone' := hg }.comp { toFun := f, monotone' := hf } = { toFun := g ∘ f, monotone' := ⋯ }


@[to_additive (attr := simp)]
theorem inv_ball : (ball x δ)⁻¹ = ball x⁻¹ δ

{E : Type u_1}
[SeminormedAddCommGroup E]
(δ : ℝ)
(x : E)


@[simp]
theorem coe_eq_coe {l₁ l₂ : List α} : (l₁ : Multiset α) = l₂ ↔ l₁ ~ l₂

↑l₁ = ↑l₂ ↔ l₁ ~ l₂


theorem coeNat_prime (v : PrimeMultiset) (p : ℕ) (h : p ∈ (v : Multiset ℕ)) : p.Prime

(v : PrimeMultiset)
(p : ℕ)
(h : p ∈ v.toNatMultiset)


/-- This lemma is a special case of `rightInvOn_invFunOn.image_image`; it may make more sense
to use the other lemma directly in an application. -/
theorem SurjOn.image_invFunOn_image [Nonempty α] (hf : SurjOn f s t) :
    f '' (f.invFunOn s '' t) = t

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{f : α → β}
[Nonempty α]
(hf : Set.SurjOn f s t)


theorem ascPochhammer_smeval_neg_eq_descPochhammer (r : R) (k : ℕ) :
    (ascPochhammer ℕ k).smeval (-r) = (-1)^k * (descPochhammer ℤ k).smeval r

{R : Type u_1}
[NonAssocRing R]
[Pow R ℕ]
[NatPowAssoc R]
(r : R)
(k : ℕ)

(ascPochhammer ℕ k).smeval (-r) = (-1) ^ k * (descPochhammer ℤ k).smeval r


theorem range_eq_bot {f : M →ₛₗ[τ₁₂] M₂} : range f = ⊥ ↔ f = 0

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_6}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
[RingHomSurjective τ₁₂]
{f : M →ₛₗ[τ₁₂] M₂}


theorem prod_eq_seq {s : Set α} {t : Set β} : s ×ˢ t = (Prod.mk '' s).seq t

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}


/-- A kernel `ρCond` is a conditional kernel for a measure `ρ` if it disintegrates it in the sense
that `ρ.fst ⊗ₘ ρCond = ρ`. -/
class IsCondKernel : Prop where
  disintegrate : ρ.fst ⊗ₘ ρCond = ρ

{α : Type u_1}
{Ω : Type u_3}
{mα : MeasurableSpace α}
{mΩ : MeasurableSpace Ω}
{ρ : MeasureTheory.Measure (α × Ω)}
{ρCond : ProbabilityTheory.Kernel α Ω}
[self : ρ.IsCondKernel ρCond]


@[to_additive (attr := simp)]
theorem toDual_div [Div α] (a b : α) : toDual (a / b) = toDual a / toDual b

OrderDual.toDual (a / b) = OrderDual.toDual a / OrderDual.toDual b


@[to_additive (attr := simp)]
theorem compr₂_apply [MulOneClass M] [MulOneClass N] [CommMonoid P] [CommMonoid Q] (f : M →* N →* P)
    (g : P →* Q) (m : M) (n : N) : (compr₂ f g) m n = g (f m n)

{M : Type uM}
{N : Type uN}
{P : Type uP}
{Q : Type uQ}
[MulOneClass M]
[MulOneClass N]
[CommMonoid P]
[CommMonoid Q]
(f : M →* N →* P)
(g : P →* Q)
(m : M)
(n : N)


@[to_additive existing AddGroupSeminorm.smul_sup]
theorem smul_sup (r : R) (p q : GroupSeminorm E) : r • (p ⊔ q) = r • p ⊔ r • q

{R : Type u_2}
{E : Type u_4}
[Group E]
[SMul R ℝ]
[SMul R ℝ≥0]
[IsScalarTower R ℝ≥0 ℝ]
(r : R)
(p q : GroupSeminorm E)


/-- The tensor of a family of linear maps from `sᵢ` to `tᵢ`, as a multilinear map of
the family.
-/
@[simps]
noncomputable def mapMultilinear :
    MultilinearMap R (fun (i : ι) ↦ s i →ₗ[R] t i) ((⨂[R] i, s i) →ₗ[R] ⨂[R] i, t i)

{ι : Type u_1}
(R : Type u_4)
[CommSemiring R]
(s : ι → Type u_7)
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]
(t : ι → Type u_11)
[(i : ι) → AddCommMonoid (t i)]
[(i : ι) → Module R (t i)]
(f : (i : ι) → s i →ₗ[R] t i)

(PiTensorProduct.mapMultilinear R s t) f = PiTensorProduct.map f


@[simp] theorem mem_ball : y ∈ ball x ε ↔ edist y x < ε

{α : Type u}
[PseudoEMetricSpace α]
{x y : α}
{ε : ℝ≥0∞}


@[to_additive]
theorem hom_map_lift (g : M →* N) (f : α → M) (x : FreeMonoid α) : g (lift f x) = lift (g ∘ f) x

{α : Type u_1}
{M : Type u_4}
[Monoid M]
{N : Type u_5}
[Monoid N]
(g : M →* N)
(f : α → M)
(x : FreeMonoid α)

g ((FreeMonoid.lift f) x) = (FreeMonoid.lift (⇑g ∘ f)) x


@[simp, norm_cast]
lemma star_nnratCast [DivisionSemiring R] [StarRing R] (q : ℚ≥0) : star (q : R) = q

{R : Type u_1}
[DivisionSemiring R]
[StarRing R]
(q : ℚ≥0)


theorem replicate_dedup {x : α} : ∀ {k}, k ≠ 0 → (replicate k x).dedup = [x]

{α : Type u_1}
[DecidableEq α]
{x : α}
{k : ℕ}

k ≠ 0 → (List.replicate k x).dedup = [x]


@[simp] lemma logDeriv_inv (x : 𝕜) : logDeriv (·⁻¹) x = -1 / x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
(x : 𝕜)


/-- A version of `List.prod_inv_reverse` for `Matrix.inv`. -/
theorem list_prod_inv_reverse : ∀ l : List (Matrix n n α), l.prod⁻¹ = (l.reverse.map Inv.inv).prod

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
(l : List (Matrix n n α))

l.prod⁻¹ = (List.map Inv.inv l.reverse).prod


@[simp, norm_cast]
theorem coe_reindex : ⇑(b.reindex e) = b ∘ e.symm

{ι : Type u_1}
{ι' : Type u_2}
{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)
(e : ι ≃ ι')


theorem discr_eq_discr {ι : Type*} [Fintype ι] [DecidableEq ι] (b : Basis ι ℤ (𝓞 K)) :
    Algebra.discr ℤ b = discr K

(b : Basis ι ℤ (NumberField.RingOfIntegers K))

Algebra.discr ℤ ⇑b = NumberField.discr K


@[simp]
theorem units_smul_eq_self_iff {u : Rˣ} {v : Module.Ray R M} : u • v = v ↔ 0 < u.1

{R : Type u_1}
[LinearOrderedCommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
[NoZeroSMulDivisors R M]
{u : Rˣ}
{v : Module.Ray R M}


/-- Graph homomorphisms induce a contravariant function on subgraphs. -/
@[simps]
protected def comap {G' : SimpleGraph W} (f : G →g G') (H : G'.Subgraph) : G.Subgraph

{V : Type u}
{W : Type v}
{G : SimpleGraph V}
{G' : SimpleGraph W}
(f : G →g G')
(H : G'.Subgraph)

(SimpleGraph.Subgraph.comap f H).verts = ⇑f ⁻¹' H.verts


/-- If `X` has a basis consisting of compact opens, then an open set in `X` is compact open iff
  it is a finite union of some elements in the basis -/
theorem isCompact_open_iff_eq_finite_iUnion_of_isTopologicalBasis (b : ι → Set X)
    (hb : IsTopologicalBasis (Set.range b)) (hb' : ∀ i, IsCompact (b i)) (U : Set X) :
    IsCompact U ∧ IsOpen U ↔ ∃ s : Set ι, s.Finite ∧ U = ⋃ i ∈ s, b i

(hb : TopologicalSpace.IsTopologicalBasis (Set.range b))

IsCompact U ∧ IsOpen U ↔ ∃ s, s.Finite ∧ U = ⋃ i ∈ s, b i


theorem le_multiplicity_of_δ_of_fin {n : ℕ} (f : Fin n → E) (h : ∀ i, ‖f i‖ ≤ 2)
    (h' : Pairwise fun i j => 1 - goodδ E ≤ ‖f i - f j‖) : n ≤ multiplicity E

(h' : Pairwise fun i j => 1 - Besicovitch.goodδ E ≤ ‖f i - f j‖)


lemma fderiv_fourierChar_neg_bilinear_right_apply (v : V) (w y : W) :
    fderiv ℝ (fun w ↦ (𝐞 (-L v w) : ℂ)) w y = -2 * π * I * L v y * 𝐞 (-L v w)

{V : Type u_1}
{W : Type u_2}
[NormedAddCommGroup V]
[NormedSpace ℝ V]
[NormedAddCommGroup W]
[NormedSpace ℝ W]
(L : V →L[ℝ] W →L[ℝ] ℝ)
(v : V)
(w y : W)

(fderiv ℝ (fun w => ↑(𝐞 (-(L v) w))) w) y = -2 * ↑π * Complex.I * ↑((L v) y) * ↑(𝐞 (-(L v) w))


/-- Basic hypothesis to talk about a topological additive group. A topological additive group
over `M`, for example, is obtained by requiring the instances `AddGroup M` and
`ContinuousAdd M` and `ContinuousNeg M`. -/
class ContinuousNeg (G : Type u) [TopologicalSpace G] [Neg G] : Prop where
  continuous_neg : Continuous fun a : G => -a

{G : Type u}
[TopologicalSpace G]
[Neg G]
[self : ContinuousNeg G]


/-- `M` as a submodule of `M × N` is isomorphic to `M`. -/
@[simps]
def fstEquiv : Submodule.fst R M M₂ ≃ₗ[R] M

(R : Type u)
(M : Type v)
(M₂ : Type w)
[Semiring R]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]
(m : M)

↑((Submodule.fstEquiv R M M₂).symm m) = (m, 0)


@[simp] theorem coe_ringHom_id {X : CommRingCat} :
    @DFunLike.coe (X →+* X) X (fun _ ↦ X) _ (𝟙 X) = id


/-- The `n`th power of a quadratic character is itself, when `n` is odd. -/
theorem IsQuadratic.pow_odd {χ : MulChar R R'} (hχ : χ.IsQuadratic) {n : ℕ} (hn : Odd n) :
    χ ^ n = χ

{R : Type u_1}
[CommMonoid R]
{R' : Type u_2}
[CommRing R']
{χ : MulChar R R'}
(hχ : χ.IsQuadratic)
{n : ℕ}
(hn : Odd n)


@[simp]
lemma inl_rel'_inr_iff (x₁ : X₁) (x₂ : X₂) :
    Rel' f g (Sum.inl x₁) (Sum.inr x₂) ↔
      ∃ (s : S), x₁ = f s ∧ x₂ = g s

{S X₁ X₂ : Type u}
(f : S ⟶ X₁)
(g : S ⟶ X₂)
(x₁ : X₁)
(x₂ : X₂)

CategoryTheory.Limits.Types.Pushout.Rel' f g (Sum.inl x₁) (Sum.inr x₂) ↔ ∃ s, x₁ = f s ∧ x₂ = g s


theorem sequence_mono : ∀ as bs : List (Filter α), Forall₂ (· ≤ ·) as bs → sequence as ≤ sequence bs

List.Forall₂ (fun x x_1 => x ≤ x_1) as bs → sequence as ≤ sequence bs


theorem separatingLeft_iff_linear_nontrivial {B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] M} :
    B.SeparatingLeft ↔ ∀ x : M₁, B x = 0 → x = 0

{R : Type u_1}
{R₁ : Type u_2}
{R₂ : Type u_3}
{M : Type u_5}
{M₁ : Type u_6}
{M₂ : Type u_7}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[CommSemiring R₁]
[AddCommMonoid M₁]
[Module R₁ M₁]
[CommSemiring R₂]
[AddCommMonoid M₂]
[Module R₂ M₂]
{I₁ : R₁ →+* R}
{I₂ : R₂ →+* R}
{B : M₁ →ₛₗ[I₁] M₂ →ₛₗ[I₂] M}

B.SeparatingLeft ↔ ∀ (x : M₁), B x = 0 → x = 0


/-- The categorical equivalence between `C` and `ULift C`. -/
@[simps]
def ULift.equivalence : C ≌ ULift.{u₂} C

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


@[to_additive]
theorem subgroupOf_range_eq_of_le {G₁ G₂ : Type*} [Group G₁] [Group G₂] {K : Subgroup G₂}
    (f : G₁ →* G₂) (h : f.range ≤ K) :
    f.range.subgroupOf K = (f.codRestrict K fun x => h ⟨x, rfl⟩).range

{G₁ : Type u_7}
{G₂ : Type u_8}
[AddGroup G₁]
[AddGroup G₂]
{K : AddSubgroup G₂}
(f : G₁ →+ G₂)
(h : f.range ≤ K)

f.range.addSubgroupOf K = (f.codRestrict K ⋯).range


@[simp]
protected theorem toFinset_eq_empty {h : s.Finite} : h.toFinset = ∅ ↔ s = ∅


@[simp, norm_cast] lemma ofENat_zero : ofENat 0 = 0


@[simp]
theorem snd_imJ_dualNumberEquiv_symm (d : DualNumber (Quaternion R)) :
    (dualNumberEquiv.symm d).imJ.snd = d.snd.imJ

{R : Type u_1}
[CommRing R]
(d : DualNumber (Quaternion R))

TrivSqZeroExt.snd (Quaternion.dualNumberEquiv.symm d).imJ = (TrivSqZeroExt.snd d).imJ


theorem measurable_of_empty_codomain [IsEmpty β] (f : α → β) : Measurable f

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
[IsEmpty β]
(f : α → β)


/-- If the `p`-adic norms of `q` and `r` are different, then the norm of `q + r` is equal to the max
of the norms of `q` and `r`. -/
theorem add_eq_max_of_ne {q r : ℚ} (hne : padicNorm p q ≠ padicNorm p r) :
    padicNorm p (q + r) = max (padicNorm p q) (padicNorm p r)

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{q r : ℚ}
(hne : padicNorm p q ≠ padicNorm p r)


theorem starConvex_empty (x : E) : StarConvex 𝕜 x ∅

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


theorem toReal_neg_iff_sign_neg {θ : Angle} : θ.toReal < 0 ↔ θ.sign = -1


@[simp]
theorem quotEquivOfEq_mk (h : p = p') (x : M) :
    Submodule.quotEquivOfEq p p' h (Submodule.Quotient.mk x : M ⧸ p) =
      (Submodule.Quotient.mk x : M ⧸ p')

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
(p p' : Submodule R M)
(h : p = p')
(x : M)

(p.quotEquivOfEq p' h) (Submodule.Quotient.mk x) = Submodule.Quotient.mk x


{R : Type u}
{M : Type v}
[CommRing R]
[AddCommGroup M]
[Module R M]
[Module.Free R M]
[Module.Finite R M]
(f : M →ₗ[R] M)


theorem gradedComm_tmul_algebraMap (a : ⨁ i, 𝒜 i) (r : R) :
    gradedComm R 𝒜 ℬ (a ⊗ₜ algebraMap R _ r) = algebraMap R _ r ⊗ₜ a

(R : Type u_1)
{ι : Type u_2}
[CommSemiring ι]
[Module ι (Additive ℤˣ)]
[DecidableEq ι]
(𝒜 : ι → Type u_5)
(ℬ : ι → Type u_6)
[CommRing R]
[(i : ι) → AddCommGroup (𝒜 i)]
[(i : ι) → AddCommGroup (ℬ i)]
[(i : ι) → Module R (𝒜 i)]
[(i : ι) → Module R (ℬ i)]
[DirectSum.GRing 𝒜]
[DirectSum.GRing ℬ]
[DirectSum.GAlgebra R 𝒜]
[DirectSum.GAlgebra R ℬ]
(a : ⨁ (i : ι), 𝒜 i)
(r : R)

(TensorProduct.gradedComm R 𝒜 ℬ) (a ⊗ₜ[R] (algebraMap R (⨁ (i : ι), ℬ i)) r) = (algebraMap R (⨁ (i : ι), ℬ i)) r ⊗ₜ[R] a


theorem adjMatrix_mul_self_apply_self [NonAssocSemiring α] (i : V) :
    (G.adjMatrix α * G.adjMatrix α) i i = degree G i

{V : Type u_1}
{α : Type u_2}
(G : SimpleGraph V)
[DecidableRel G.Adj]
[Fintype V]
[NonAssocSemiring α]
(i : V)

(SimpleGraph.adjMatrix α G * SimpleGraph.adjMatrix α G) i i = ↑(G.degree i)


theorem map_restrict {X : TopCat} {C : Type*} [Category C] [ConcreteCategory C]
    {F G : X.Presheaf C} (e : F ⟶ G) {U V : Opens X} (h : U ≤ V) (x : F.obj (op V)) :
    e.app _ (x |_ U) = e.app _ x |_ U

(x : (CategoryTheory.forget C).obj (F.obj (Opposite.op V)))

(e.app (Opposite.op U)) (TopCat.Presheaf.restrictOpen x U h) =
  TopCat.Presheaf.restrictOpen ((e.app (Opposite.op V)) x) U h


@[reassoc]
theorem map_inl_inv_coprodComparison [IsIso (coprodComparison F A B)] :
    F.map coprod.inl ≫ inv (coprodComparison F A B) = coprod.inl

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

[CategoryTheory.IsIso (CategoryTheory.Limits.coprodComparison F A B)]

F.map CategoryTheory.Limits.coprod.inl ≫ CategoryTheory.inv (CategoryTheory.Limits.coprodComparison F A B) =
  CategoryTheory.Limits.coprod.inl


theorem ball_subset_closedBall {x : E} {r : ℝ} : ball x r ⊆ closedBall x r

{E : Type u_1}
[AddCommGroup E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[T2Space E]
[Module ℝ E]
[ContinuousSMul ℝ E]
[FiniteDimensional ℝ E]
{x : E}
{r : ℝ}

Euclidean.ball x r ⊆ Euclidean.closedBall x r


/-- Composition of semiring homomorphisms is associative. -/
theorem comp_assoc {δ} {_ : NonAssocSemiring δ} (f : α →+* β) (g : β →+* γ) (h : γ →+* δ) :
    (h.comp g).comp f = h.comp (g.comp f)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}

∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} {x_2 : NonAssocSemiring γ} {δ : Type u_5}
  {x_3 : NonAssocSemiring δ} (f : α →+* β) (g : β →+* γ) (h : γ →+* δ), (h.comp g).comp f = h.comp (g.comp f)


lemma rel_iff [e.IsRelIff] (i₁ i₂ : ι) : c'.Rel (e.f i₁) (e.f i₂) ↔ c.Rel i₁ i₂

{ι : Type u_1}
{ι' : Type u_2}
{c : ComplexShape ι}
{c' : ComplexShape ι'}
(e : c.Embedding c')
[e.IsRelIff]
(i₁ i₂ : ι)


theorem Dvd.dvd.linear_comb {d x y : α} (hdx : d ∣ x) (hdy : d ∣ y) (a b : α) : d ∣ a * x + b * y

{α : Type u_1}
[NonUnitalCommSemiring α]
{d x y : α}
(hdx : d ∣ x)
(hdy : d ∣ y)
(a b : α)


@[simp (high)]
theorem basicOpen_res_eq {U V : (Opens X)ᵒᵖ} (i : U ⟶ V) [IsIso i] (f : X.presheaf.obj U) :
    @basicOpen X (unop V) (X.presheaf.map i f) = @RingedSpace.basicOpen X (unop U) f

{U V : (TopologicalSpace.Opens ↑↑X.toPresheafedSpace)ᵒᵖ}

X.basicOpen ((X.presheaf.map i) f) = X.basicOpen f


protected theorem add_nonneg {a b : Int} (ha : 0 ≤ a) (hb : 0 ≤ b) : 0 ≤ a + b


theorem mem_sup_left {S T : Subalgebra R A} : ∀ {x : A}, x ∈ S → x ∈ S ⊔ T

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
{S T : Subalgebra R A}
{x : A}


lemma disjoint_sUnion_diffFinset₀ (hC : IsSetSemiring C) (hs : s ∈ C) (hI : ↑I ⊆ C) :
    Disjoint (⋃₀ (I : Set (Set α))) (⋃₀ hC.diffFinset₀ hs hI)

{α : Type u_1}
{C : Set (Set α)}
{s : Set α}
{I : Finset (Set α)}
(hC : MeasureTheory.IsSetSemiring C)
(hs : s ∈ C)
(hI : ↑I ⊆ C)

Disjoint (⋃₀ ↑I) (⋃₀ ↑(hC.diffFinset₀ hs hI))


@[to_additive (attr := simp)]
theorem mul_right_inj (a : αˣ) {b c : α} : (a : α) * b = a * c ↔ b = c

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


@[to_additive (attr := simp, norm_cast)]
theorem coe_set_mk {s : Set G} (h_one) (h_mul) (h_inv) :
    (mk ⟨⟨s, h_one⟩, h_mul⟩ h_inv : Set G) = s

(h_one : ∀ {a b : G}, a ∈ s → b ∈ s → a + b ∈ s)

(h_inv :
  ∀ {x : G},
    x ∈ { carrier := s, add_mem' := h_one, zero_mem' := h_mul }.carrier →
      -x ∈ { carrier := s, add_mem' := h_one, zero_mem' := h_mul }.carrier)

↑{ carrier := s, add_mem' := h_one, zero_mem' := h_mul, neg_mem' := h_inv } = s


private theorem smul_slash (k : ℤ) (A : GL(2, ℝ)⁺) (f : ℍ → ℂ) (c : α) :
    (c • f) ∣[k]A = c • f ∣[k]A

{α : Type u_1}
[SMul α ℂ]
[IsScalarTower α ℂ ℂ]
(k : ℤ)
(A : ↥GL(2, ℝ)⁺)
(f : ℍ → ℂ)
(c : α)

ModularForm.slash k A (c • f) = c • ModularForm.slash k A f


@[simp] lemma pow_eq (m : ℤ) (n : ℕ) : m.pow n = m ^ n


@[simp]
theorem closure_iUnion₂_le_nat {n : ℕ} (f : ℕ → Set X) :
    closure (⋃ m ≤ n, f m) = ⋃ m ≤ n, closure (f m)

{X : Type u}
[TopologicalSpace X]
{n : ℕ}
(f : ℕ → Set X)

closure (⋃ m, ⋃ (_ : m ≤ n), f m) = ⋃ m, ⋃ (_ : m ≤ n), closure (f m)


theorem ContinuousMultilinearMap.norm_map_snoc_le (f : ContinuousMultilinearMap 𝕜 Ei G)
    (m : ∀ i : Fin n, Ei <| castSucc i) (x : Ei (last n)) :
    ‖f (snoc m x)‖ ≤ (‖f‖ * ∏ i, ‖m i‖) * ‖x‖

[(i : Fin n.succ) → NormedAddCommGroup (Ei i)]

[(i : Fin n.succ) → NormedSpace 𝕜 (Ei i)]

‖f (Fin.snoc m x)‖ ≤ (‖f‖ * ∏ i : Fin n, ‖m i‖) * ‖x‖


@[to_additive AntilipschitzWith.le_mul_nnnorm]
theorem AntilipschitzWith.le_mul_nnnorm' {f : E → F} {K : ℝ≥0} (h : AntilipschitzWith K f)
    (hf : f 1 = 1) (x) : ‖x‖₊ ≤ K * ‖f x‖₊

{E : Type u_3}
{F : Type u_4}
[SeminormedAddGroup E]
[SeminormedAddGroup F]
{f : E → F}
{K : ℝ≥0}
(h : AntilipschitzWith K f)
(hf : f 0 = 0)
(x : E)

‖x‖₊ ≤ K * ‖f x‖₊


@[to_additive]
theorem mulRothNumber_spec :
    ∃ t ⊆ s, t.card = mulRothNumber s ∧ ThreeGPFree (t : Set α)

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

∃ t ⊆ s, t.card = mulRothNumber s ∧ ThreeGPFree ↑t


/-- The type of Compact Hausdorff topological spaces satisfying an additional property `P`. -/
structure CompHausLike where
  /-- The underlying topological space of an object of `CompHausLike P`. -/
  toTop : TopCat
  /-- The underlying topological space is compact. -/
  [is_compact : CompactSpace toTop]
  /-- The underlying topological space is T2. -/
  [is_hausdorff : T2Space toTop]
  /-- The underlying topological space satisfies P. -/
  prop : P toTop

{P : TopCat → Prop}
(self : CompHausLike P)


@[simp]
theorem IsSymm.submatrix {A : Matrix n n α} (h : A.IsSymm) (f : m → n) : (A.submatrix f f).IsSymm

{α : Type u_1}
{n : Type u_3}
{m : Type u_4}
{A : Matrix n n α}
(h : A.IsSymm)
(f : m → n)


theorem hasLimit_of_comp_equivalence (E : D ⥤ C) [E.IsEquivalence] [HasLimit (K ⋙ E)] :
    HasLimit K


theorem pos_invOf_of_invertible_cast [Nontrivial α] (n : ℕ)
    [Invertible (n : α)] : 0 < ⅟(n : α)

{α : Type u_1}
[LinearOrderedSemiring α]
[Nontrivial α]
(n : ℕ)
[Invertible ↑n]


/--
An isomorphism in `Dial C` can be induced by isomorphisms on the source and target,
which respect the respective relations on `X` and `Y`.
-/
@[simps] def isoMk {X Y : Dial C} (e₁ : X.src ≅ Y.src) (e₂ : X.tgt ≅ Y.tgt)
    (eq : X.rel = (Subobject.pullback (prod.map e₁.hom e₂.hom)).obj Y.rel) : X ≅ Y

(eq : X.rel = (CategoryTheory.Subobject.pullback (CategoryTheory.Limits.prod.map e₁.hom e₂.hom)).obj Y.rel)

(CategoryTheory.Dial.isoMk e₁ e₂ eq).hom.F = CategoryTheory.CategoryStruct.comp CategoryTheory.Limits.prod.snd e₂.inv


/-- To prove membership to stabilizer of a *finite set*, it is enough to prove one inclusion. -/
theorem mem_stabilizer_of_finite_iff_le_smul (s : Set α) (hs : s.Finite) (g : G) :
    g ∈ stabilizer G s ↔ s ⊆ g • s

{G : Type u_1}
[Group G]
{α : Type u_2}
[MulAction G α]
(s : Set α)
(hs : s.Finite)
(g : G)

g ∈ MulAction.stabilizer G s ↔ s ⊆ g • s


theorem Irreducible.prime_of_isPrimal {a : α}
    (irr : Irreducible a) (primal : IsPrimal a) : Prime a

{α : Type u_1}
[CommMonoidWithZero α]
{a : α}
(irr : Irreducible a)
(primal : IsPrimal a)


@[simp]
theorem prodMap_apply (f : M →ₗ[R] M₃) (g : M₂ →ₗ[R] M₄) (x) : f.prodMap g x = (f x.1, g x.2)

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


theorem memℒp_iff_finMeasSupp {f : α →ₛ E} (hp_pos : p ≠ 0) (hp_ne_top : p ≠ ∞) :
    Memℒp f p μ ↔ f.FinMeasSupp μ

{α : Type u_1}
{E : Type u_4}
[MeasurableSpace α]
[NormedAddCommGroup E]
{μ : MeasureTheory.Measure α}
{p : ℝ≥0∞}
{f : MeasureTheory.SimpleFunc α E}
(hp_pos : p ≠ 0)
(hp_ne_top : p ≠ ⊤)

MeasureTheory.Memℒp (↑f) p μ ↔ f.FinMeasSupp μ


theorem Finsupp.total_eq_fintype_total :
    (Finsupp.total α M R v).comp (Finsupp.linearEquivFunOnFinite R R α).symm.toLinearMap =
      Fintype.total R S v

{α : Type u_1}
{M : Type u_2}
(R : Type u_3)
[Fintype α]
[Semiring R]
[AddCommMonoid M]
[Module R M]
(S : Type u_4)
[Semiring S]
[Module S M]
[SMulCommClass R S M]
(v : α → M)

Finsupp.total α M R v ∘ₗ ↑(Finsupp.linearEquivFunOnFinite R R α).symm = (Fintype.total R S) v


@[simp] lemma mapSetEquiv_indep_iff (M : Matroid α) {E : Set β} (e : M.E ≃ E) {I : Set β} :
    (M.mapSetEquiv e).Indep I ↔ M.Indep ↑(e.symm '' (E ↓∩ I)) ∧ I ⊆ E

{α : Type u_1}
{β : Type u_2}
(M : Matroid α)
{E : Set β}
(e : ↑M.E ≃ ↑E)
{I : Set β}

(M.mapSetEquiv e).Indep I ↔ M.Indep ↑(⇑e.symm '' E ↓∩ I) ∧ I ⊆ E


theorem dualPairing_separatingLeft : (dualPairing 𝕜 E).SeparatingLeft

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
(E : Type u_2)
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]


/-- Composition of triangle morphisms gives a triangle morphism.
-/
@[simps]
def TriangleMorphism.comp (f : TriangleMorphism T₁ T₂) (g : TriangleMorphism T₂ T₃) :
    TriangleMorphism T₁ T₃

{T₁ T₂ T₃ : CategoryTheory.Pretriangulated.Triangle C}

(f : CategoryTheory.Pretriangulated.TriangleMorphism T₁ T₂)

(g : CategoryTheory.Pretriangulated.TriangleMorphism T₂ T₃)


lemma strictConcaveOn_negMulLog : StrictConcaveOn ℝ (Set.Ici (0 : ℝ)) negMulLog

StrictConcaveOn ℝ (Set.Ici 0) Real.negMulLog


lemma range_comapSubmodule :
    range (comapSubmodule R M a) = {p | p ≤ p.comap (Algebra.lsmul R R M a)}

(R : Type u_2)
{A : Type u_3}
(M : Type u_1)
[CommSemiring R]
[Semiring A]
(a : A)
[Algebra R A]
[AddCommMonoid M]
[Module A M]
[Module R M]
[IsScalarTower R A M]

Set.range ⇑(Module.AEval.comapSubmodule R M a) = {p | p ≤ Submodule.comap ((Algebra.lsmul R R M) a) p}


theorem integral_sub {f g : ℂ → E} {c : ℂ} {R : ℝ} (hf : CircleIntegrable f c R)
    (hg : CircleIntegrable g c R) :
    (∮ z in C(c, R), f z - g z) = (∮ z in C(c, R), f z) - ∮ z in C(c, R), g z

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f g : ℂ → E}
{c : ℂ}
{R : ℝ}
(hf : CircleIntegrable f c R)
(hg : CircleIntegrable g c R)

(∮ (z : ℂ) in C(c, R), f z - g z) = (∮ (z : ℂ) in C(c, R), f z) - ∮ (z : ℂ) in C(c, R), g z


@[to_additive (attr := simp)]
theorem mk_div_mk [Div G] [Div H] (x₁ x₂ : G) (y₁ y₂ : H) :
    (x₁, y₁) / (x₂, y₂) = (x₁ / x₂, y₁ / y₂)

{G : Type u_3}
{H : Type u_4}
[Sub G]
[Sub H]
(x₁ x₂ : G)
(y₁ y₂ : H)

(x₁, y₁) - (x₂, y₂) = (x₁ - x₂, y₁ - y₂)


@[to_additive (attr := simp)]
lemma unop_mul [Mul α] (x y : αᵐᵒᵖ) : unop (x * y) = unop y * unop x

MulOpposite.unop (x * y) = MulOpposite.unop y * MulOpposite.unop x


theorem ofDual_map (f : αᵒᵈ → βᵒᵈ) (a : WithTop αᵒᵈ) :
    WithTop.ofDual (map f a) = WithBot.map (ofDual ∘ f ∘ toDual) (WithTop.ofDual a)

{α : Type u_1}
{β : Type u_2}
(f : αᵒᵈ → βᵒᵈ)
(a : WithTop αᵒᵈ)

WithTop.ofDual (WithTop.map f a) = WithBot.map (⇑OrderDual.ofDual ∘ f ∘ ⇑OrderDual.toDual) (WithTop.ofDual a)


@[to_additive (attr := simp, norm_cast)]
lemma unop_nnratCast [NNRatCast α] (q : ℚ≥0) : unop (q : αᵐᵒᵖ) = q


theorem isPrime_radical {I : Ideal R} (hi : IsPrimary I) : IsPrime (radical I)

{R : Type u_1}
[CommSemiring R]
{I : Ideal R}
(hi : I.IsPrimary)


@[simp]
lemma choose_one_right (n : ℕ) : choose n 1 = n


theorem card_eq_two {s : Multiset α} : card s = 2 ↔ ∃ x y, s = {x, y}


@[ghost_simps]
theorem ghostComponent_verschiebungFun (x : 𝕎 R) (n : ℕ) :
    ghostComponent (n + 1) (verschiebungFun x) = p * ghostComponent n x

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

(WittVector.ghostComponent (n + 1)) x.verschiebungFun = ↑p * (WittVector.ghostComponent n) x


theorem tan_periodic : Function.Periodic tan π


lemma I_eq_zero_or_im_I_eq_one : (I : K) = 0 ∨ im (I : K) = 1


@[simp, norm_cast]
theorem coeFn_coe (f : Derivation R A M) : ⇑(f : A →ₗ[R] M) = f

{R : Type u_1}
{A : Type u_2}
{M : Type u_4}
[CommSemiring R]
[CommSemiring A]
[AddCommMonoid M]
[Algebra R A]
[Module A M]
[Module R M]
(f : Derivation R A M)


theorem isTwoCoboundary_of_twoCoboundaries (f : twoCoboundaries (Rep.ofDistribMulAction k G A)) :
    IsTwoCoboundary (A := A) f.1.1

(f : ↥(groupCohomology.twoCoboundaries (Rep.ofDistribMulAction k G A)))


lemma integrable_add_iff_of_nonpos {f g : α → ℝ} (h_meas : AEStronglyMeasurable f μ)
    (hf : f ≤ᵐ[μ] 0) (hg : g ≤ᵐ[μ] 0) :
    Integrable (f + g) μ ↔ Integrable f μ ∧ Integrable g μ

(h_meas : MeasureTheory.AEStronglyMeasurable f μ)

MeasureTheory.Integrable (f + g) μ ↔ MeasureTheory.Integrable f μ ∧ MeasureTheory.Integrable g μ


theorem nth_of_card_le (hf : (setOf p).Finite) {n : ℕ} (hn : hf.toFinset.card ≤ n) :
    nth p n = 0

{p : ℕ → Prop}
(hf : (setOf p).Finite)
{n : ℕ}
(hn : hf.toFinset.card ≤ n)


theorem inter_nonempty : (s ∩ t).Nonempty ↔ ∃ x, x ∈ s ∧ x ∈ t


lemma testBit_bit_succ (m b n) : testBit (bit b n) (succ m) = testBit n m

(Nat.bit b n).testBit m.succ = n.testBit m


theorem OrderIso.essSup_apply {m : MeasurableSpace α} {γ} [CompleteLattice γ] (f : α → β)
    (μ : Measure α) (g : β ≃o γ) : g (essSup f μ) = essSup (fun x => g (f x)) μ

{α : Type u_1}
{β : Type u_2}
[CompleteLattice β]
{m : MeasurableSpace α}
{γ : Type u_3}
[CompleteLattice γ]
(f : α → β)
(μ : MeasureTheory.Measure α)
(g : β ≃o γ)


theorem trim_le_trim_iff {m₁ m₂ : OuterMeasure α} :
    m₁.trim ≤ m₂.trim ↔ ∀ s, MeasurableSet s → m₁ s ≤ m₂ s

{α : Type u_1}
[MeasurableSpace α]
{m₁ m₂ : MeasureTheory.OuterMeasure α}

m₁.trim ≤ m₂.trim ↔ ∀ (s : Set α), MeasurableSet s → m₁ s ≤ m₂ s


@[simp]
theorem symm_map (f : α ≃o β) : (map f).symm = map f.symm

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(f : α ≃o β)

(LowerSet.map f).symm = LowerSet.map f.symm


theorem measure_apply {s : Set G} (hs : MeasurableSet s) : μ.measure s = μ.outerMeasure s

{G : Type w}
[TopologicalSpace G]
(μ : MeasureTheory.Content G)
[R1Space G]
[S : MeasurableSpace G]
[BorelSpace G]
{s : Set G}
(hs : MeasurableSet s)


@[simps!]
instance categoryOfGradedObjects (β : Type w) : Category.{max w v} (GradedObject β C)

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

∀ {X Y Z : (i : β) → (fun x => C) i} (f : X ⟶ Y) (g : Y ⟶ Z) (i : β),
  CategoryTheory.CategoryStruct.comp f g i = CategoryTheory.CategoryStruct.comp (f i) (g i)


@[simp] theorem gcd_gcd_self_right_left (m n : Nat) : gcd m (gcd m n) = gcd m n


/-- The inverse Mellin transform of the Mellin transform applied to `x > 0` is x. -/
theorem mellin_inversion (σ : ℝ) (f : ℝ → E) {x : ℝ} (hx : 0 < x) (hf : MellinConvergent f σ)
    (hFf : VerticalIntegrable (mellin f) σ) (hfx : ContinuousAt f x) :
    mellinInv σ (mellin f) x = f x

(hFf : Complex.VerticalIntegrable (mellin f) σ MeasureTheory.volume)


@[fun_prop]
theorem differentiableAt_apply (i : ι) (f : ∀ i, F' i) :
    DifferentiableAt (𝕜 := 𝕜) (fun f : ∀ i, F' i => f i) f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{ι : Type u_6}
[Fintype ι]
{F' : ι → Type u_7}
[(i : ι) → NormedAddCommGroup (F' i)]
[(i : ι) → NormedSpace 𝕜 (F' i)]
(i : ι)
(f : (i : ι) → F' i)


@[to_additive (attr := simp)]
theorem inv_empty : (∅ : Finset α)⁻¹ = ∅


theorem conv_eq_conts_a_div_conts_b :
    g.convs n = (g.conts n).a / (g.conts n).b

{K : Type u_1}
{g : GenContFract K}
{n : ℕ}
[DivisionRing K]


theorem pow_coeff (m : ℕ) (x : 𝕎 R) (n : ℕ) :
    (x ^ m).coeff n = peval (wittPow p m n) ![x.coeff]

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

(x ^ m).coeff n = WittVector.peval (WittVector.wittPow p m n) ![x.coeff]


@[simp]
theorem preimage_neg_Ioc : -Ioc a b = Ico (-b) (-a)

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


theorem isEquivalent_atTop_div :
    (fun x => eval x P / eval x Q) ~[atTop] fun x =>
      P.leadingCoeff / Q.leadingCoeff * x ^ (P.natDegree - Q.natDegree : ℤ)

{𝕜 : Type u_1}
[NormedLinearOrderedField 𝕜]
(P Q : 𝕜[X])
[OrderTopology 𝕜]

(fun x => Polynomial.eval x P / Polynomial.eval x Q) ~[Filter.atTop] fun x =>
  P.leadingCoeff / Q.leadingCoeff * x ^ (↑P.natDegree - ↑Q.natDegree)


/-- If the support of each element in a generating set of a permutation group is finite,
then the support of every element in the group is finite. -/
theorem finite_compl_fixedBy_closure_iff {S : Set G} :
    (∀ g ∈ closure S, (fixedBy α g)ᶜ.Finite) ↔ ∀ g ∈ S, (fixedBy α g)ᶜ.Finite

{G : Type u_1}
{α : Type u_2}
[Group G]
[MulAction G α]
{S : Set G}

(∀ g ∈ Subgroup.closure S, (MulAction.fixedBy α g)ᶜ.Finite) ↔ ∀ g ∈ S, (MulAction.fixedBy α g)ᶜ.Finite


/-- When `S₁.f` and `S₂.f` are zero and we have chosen limit kernel forks `c₁` and `c₂`
for `S₁.g` and `S₂.g` respectively, the action on left homology of a morphism `φ : S₁ ⟶ S₂` of
short complexes is given by the unique morphism `f : c₁.pt ⟶ c₂.pt` such that
`c₁.ι ≫ φ.τ₂ = f ≫ c₂.ι`. -/
@[simps]
def ofIsLimitKernelFork (φ : S₁ ⟶ S₂)
    (hf₁ : S₁.f = 0) (c₁ : KernelFork S₁.g) (hc₁ : IsLimit c₁)
    (hf₂ : S₂.f = 0) (c₂ : KernelFork S₂.g) (hc₂ : IsLimit c₂) (f : c₁.pt ⟶ c₂.pt)
    (comm : c₁.ι ≫ φ.τ₂ = f ≫ c₂.ι) :
    LeftHomologyMapData φ (LeftHomologyData.ofIsLimitKernelFork S₁ hf₁ c₁ hc₁)
      (LeftHomologyData.ofIsLimitKernelFork S₂ hf₂ c₂ hc₂)

(c₁ : CategoryTheory.Limits.KernelFork S₁.g)

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

(c₂ : CategoryTheory.Limits.KernelFork S₂.g)

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

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

(CategoryTheory.ShortComplex.LeftHomologyMapData.ofIsLimitKernelFork φ hf₁ c₁ hc₁ hf₂ c₂ hc₂ f comm).φH = f


theorem cast_addNat_left {n n' m : Nat} (i : Fin n') (h : n' + m = n + m) :
    cast h (addNat i m) = addNat (cast (Nat.add_right_cancel h) i) m

Fin.cast h (i.addNat m) = (Fin.cast ⋯ i).addNat m


/-- `F.mapTriangle` commutes with the rotation of triangles. -/
@[simps!]
def mapTriangleRotateIso :
    F.mapTriangle ⋙ Pretriangulated.rotate D ≅
      Pretriangulated.rotate C ⋙ F.mapTriangle

(X : CategoryTheory.Pretriangulated.Triangle C)

(F.mapTriangleRotateIso.inv.app X).hom₁ = CategoryTheory.CategoryStruct.id (F.obj X.obj₂)


theorem dist_dist_dist_le_right (x y z : α) : dist (dist x y) (dist x z) ≤ dist y z

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


@[to_additive]
theorem finprod_of_infinite_mulSupport {f : α → M} (hf : (mulSupport f).Infinite) :
    ∏ᶠ i, f i = 1

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
{f : α → M}
(hf : (Function.support f).Infinite)


@[simp]
theorem map_nontrivial : (s.map f).Nontrivial ↔ s.Nontrivial

{α : Type u_1}
{β : Type u_2}
{f : α ↪ β}
{s : Finset α}

(Finset.map f s).Nontrivial ↔ s.Nontrivial


theorem le_order_smul {Γ} [Zero Γ] [LinearOrder Γ] (r : R) (x : HahnSeries Γ V) (h : r • x ≠ 0) :
    x.order ≤ (r • x).order

{R : Type u_2}
{V : Type u_3}
[Zero V]
[SMulZeroClass R V]
{Γ : Type u_4}
[Zero Γ]
[LinearOrder Γ]
(r : R)
(x : HahnSeries Γ V)
(h : r • x ≠ 0)


@[to_additive]
theorem prod_bool [CommMonoid α] (f : Bool → α) : ∏ b, f b = f true * f false

{α : Type u_1}
[AddCommMonoid α]
(f : Bool → α)


@[deprecated le_rpow_inv_iff (since := "2024-07-10")]
theorem le_rpow_one_div_iff {x y : ℝ≥0} {z : ℝ} (hz : 0 < z) : x ≤ y ^ (1 / z) ↔ x ^ z ≤ y


@[simp]
theorem ofIsClopen_fiber_zero {X : Type*} [TopologicalSpace X] {U : Set X} [∀ x, Decidable (x ∈ U)]
    (hU : IsClopen U) : ofIsClopen hU ⁻¹' ({0} : Set (Fin 2)) = U

{X : Type u_5}
[TopologicalSpace X]
{U : Set X}
[(x : X) → Decidable (x ∈ U)]
(hU : IsClopen U)

⇑(LocallyConstant.ofIsClopen hU) ⁻¹' {0} = U


/-- An odd function on a linear ordered additive commutative group is monotone on the whole group
provided that it is monotone on `Set.Ici 0`. -/
theorem monotone_of_odd_of_monotoneOn_nonneg {f : G → H} (h₁ : ∀ x, f (-x) = -f x)
    (h₂ : MonotoneOn f (Ici 0)) : Monotone f

{G : Type u_1}
{H : Type u_2}
[LinearOrderedAddCommGroup G]
[OrderedAddCommGroup H]
{f : G → H}
(h₁ : ∀ (x : G), f (-x) = -f x)
(h₂ : MonotoneOn f (Set.Ici 0))


@[to_additive conv_add]
theorem mconv_add [MeasurableMul₂ M] (μ : Measure M) (ν : Measure M) (ρ : Measure M) [SFinite μ]
    [SFinite ν] [SFinite ρ] : μ ∗ (ν + ρ) = μ ∗ ν + μ ∗ ρ

{M : Type u_1}
[Monoid M]
[MeasurableSpace M]
[MeasurableMul₂ M]
(μ ν ρ : MeasureTheory.Measure M)
[MeasureTheory.SFinite μ]
[MeasureTheory.SFinite ν]
[MeasureTheory.SFinite ρ]


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

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


lemma congr_f (i j : ℕ) (h : i = j) :
    f i = eqToHom (by rw [h]) ≫ f j ≫ eqToHom (by rw [h])

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{X : ℕ → C}
(f : (n : ℕ) → X n ⟶ X (n + 1))
(i j : ℕ)
(h : i = j)

f i =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom ⋯)
    (CategoryTheory.CategoryStruct.comp (f j) (CategoryTheory.eqToHom ⋯))


theorem eq_of_le_of_forall_ge_of_dense [LinearOrder α] [DenselyOrdered α] {a₁ a₂ : α} (h₁ : a₂ ≤ a₁)
    (h₂ : ∀ a₃ < a₁, a₃ ≤ a₂) : a₁ = a₂

{α : Type u_2}
[LinearOrder α]
[DenselyOrdered α]
{a₁ a₂ : α}
(h₁ : a₂ ≤ a₁)
(h₂ : ∀ (a₃ : α), a₃ < a₁ → a₃ ≤ a₂)


@[simp]
theorem span_univ : lieSpan R L (Set.univ : Set M) = ⊤

(R : Type u)
(L : Type v)
(M : Type w)
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]


/-- If a function is the least upper bound of countably many measurable functions on a measurable
set `s`, and coincides with a measurable function outside of `s`, then it is measurable. -/
theorem Measurable.isLUB_of_mem {ι} [Countable ι] {f : ι → δ → α} {g g' : δ → α}
    (hf : ∀ i, Measurable (f i))
    {s : Set δ} (hs : MeasurableSet s) (hg : ∀ b ∈ s, IsLUB { a | ∃ i, f i b = a } (g b))
    (hg' : EqOn g g' sᶜ) (g'_meas : Measurable g') : Measurable g

{f : ι → δ → α}

(hg : ∀ b ∈ s, IsLUB {a | ∃ i, f i b = a} (g b))


theorem coeff_mul_X_sub_C {p : R[X]} {r : R} {a : ℕ} :
    coeff (p * (X - C r)) (a + 1) = coeff p a - coeff p (a + 1) * r

{R : Type u}
[Ring R]
{p : R[X]}
{r : R}
{a : ℕ}

(p * (Polynomial.X - Polynomial.C r)).coeff (a + 1) = p.coeff a - p.coeff (a + 1) * r


protected theorem ssubset_of_ssubset_of_subset {s₁ s₂ s₃ : Set α} (hs₁s₂ : s₁ ⊂ s₂)
    (hs₂s₃ : s₂ ⊆ s₃) : s₁ ⊂ s₃

{α : Type u}
{s₁ s₂ s₃ : Set α}
(hs₁s₂ : s₁ ⊂ s₂)
(hs₂s₃ : s₂ ⊆ s₃)


theorem disjoint_of_subset_right (ss : l₂ ⊆ l) (d : Disjoint l₁ l) : Disjoint l₁ l₂

∀ {α : Type u_1} {l₂ l l₁ : List α}, l₂ ⊆ l → l₁.Disjoint l → l₁.Disjoint l₂


@[to_additive (attr := simp)]
theorem orbit_smul (g : G) (a : α) : orbit G (g • a) = orbit G a

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

AddAction.orbit G (g +ᵥ a) = AddAction.orbit G a


theorem nhds_top : 𝓝 (⊤ : EReal) = ⨅ (a) (_ : a ≠ ⊤), 𝓟 (Ioi a)


/-- candidates are bounded by `maxVar X Y` -/
private theorem candidates_dist_bound (fA : f ∈ candidates X Y) :
    ∀ {x y : X ⊕ Y}, f (x, y) ≤ maxVar X Y * dist x y

(fA : f ∈ GromovHausdorff.candidates X Y)

f (x, y) ≤ ↑(GromovHausdorff.maxVar X Y) * dist x y


theorem P_is_eventually_constant {q n : ℕ} (hqn : n ≤ q) :
    ((P (q + 1)).f n : X _[n] ⟶ _) = (P q).f n

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{X : CategoryTheory.SimplicialObject C}
{q n : ℕ}
(hqn : n ≤ q)

(AlgebraicTopology.DoldKan.P (q + 1)).f n = (AlgebraicTopology.DoldKan.P q).f n


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


theorem mk_le_of_injective {α β : Type u} {f : α → β} (hf : Injective f) : #α ≤ #β

{α β : Type u}
{f : α → β}
(hf : Function.Injective f)


theorem Commute.expUnitary_add {a b : selfAdjoint A} (h : Commute (a : A) (b : A)) :
    expUnitary (a + b) = expUnitary a * expUnitary b

{A : Type u_1}
[NormedRing A]
[NormedAlgebra ℂ A]
[StarRing A]
[ContinuousStar A]
[CompleteSpace A]
[StarModule ℂ A]
{a b : ↥(selfAdjoint A)}
(h : Commute ↑a ↑b)

selfAdjoint.expUnitary (a + b) = selfAdjoint.expUnitary a * selfAdjoint.expUnitary b


/-- An auxiliary definition in order to fix the choice of the preimages between various definitions.
-/
structure FunctorPushforwardStructure (S : Presieve X) {Y} (f : Y ⟶ F.obj X) where
  /-- an object in the source category -/
  preobj : C
  /-- a map in the source category which has to be in the presieve -/
  premap : preobj ⟶ X
  /-- the morphism which appear in the factorisation -/
  lift : Y ⟶ F.obj preobj
  /-- the condition that `premap` is in the presieve -/
  cover : S premap
  /-- the factorisation of the morphism -/
  fac : f = lift ≫ F.map premap

(self : CategoryTheory.Presieve.FunctorPushforwardStructure F S f)


/-- If `f : X → Y` is Hölder continuous with a positive exponent `r`, then the Hausdorff dimension
of the image of a set `s` is at most `dimH s / r`. -/
theorem dimH_image_le (h : HolderWith C r f) (hr : 0 < r) (s : Set X) :
    dimH (f '' s) ≤ dimH s / r

{X : Type u_2}
{Y : Type u_3}
[EMetricSpace X]
[EMetricSpace Y]
{C r : ℝ≥0}
{f : X → Y}
(h : HolderWith C r f)
(hr : 0 < r)
(s : Set X)


theorem mem_resolventSet_of_spectralRadius_lt {a : A} {k : 𝕜} (h : spectralRadius 𝕜 a < ‖k‖₊) :
    k ∈ ρ a

{𝕜 : Type u_1}
{A : Type u_2}
[NormedField 𝕜]
[NormedRing A]
[NormedAlgebra 𝕜 A]
{a : A}
{k : 𝕜}
(h : spectralRadius 𝕜 a < ↑‖k‖₊)


theorem tendsto_atBot_ciSup (h_anti : Antitone f) (hbdd : BddAbove <| range f) :
    Tendsto f atBot (𝓝 (⨆ i, f i))

{α : Type u_1}
{ι : Type u_3}
[Preorder ι]
[TopologicalSpace α]
[ConditionallyCompleteLattice α]
[SupConvergenceClass α]
{f : ι → α}
(h_anti : Antitone f)
(hbdd : BddAbove (Set.range f))

Filter.Tendsto f Filter.atBot (𝓝 (⨆ i, f i))


/-- This lemma also holds for `ENNReal`, but we need a different proof for that. -/
theorem tsub_lt_tsub_iff_right (h : c ≤ a) : a - c < b - c ↔ a < b

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


lemma _root_.Nat.cast_natAbs {α : Type*} [AddGroupWithOne α] (n : ℤ) : (n.natAbs : α) = |n|

{α : Type u_1}
[AddGroupWithOne α]
(n : ℤ)


/-- A compact set is covered by finitely many left multiplicative translates of a set
  with non-empty interior. -/
@[to_additive
  "A compact set is covered by finitely many left additive translates of a set
    with non-empty interior."]
theorem compact_covered_by_mul_left_translates {K V : Set G} (hK : IsCompact K)
    (hV : (interior V).Nonempty) : ∃ t : Finset G, K ⊆ ⋃ g ∈ t, (g * ·) ⁻¹' V

{G : Type w}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
{K V : Set G}
(hK : IsCompact K)
(hV : (interior V).Nonempty)

∃ t, K ⊆ ⋃ g ∈ t, (fun x => g + x) ⁻¹' V


/-- Composition with an injective ring homomorphism preserves nontriviality. -/
@[deprecated ringHomComp_ne_one_iff (since := "2024-06-16")]
theorem IsNontrivial.comp {χ : MulChar R R'} (hχ : χ.IsNontrivial) {f : R' →+* R''}
    (hf : Function.Injective f) : (χ.ringHomComp f).IsNontrivial

{R : Type u_1}
[CommMonoid R]
{R' : Type u_2}
[CommRing R']
{R'' : Type u_3}
[CommRing R'']
{χ : MulChar R R'}
(hχ : χ.IsNontrivial)
{f : R' →+* R''}
(hf : Function.Injective ⇑f)


/-- An ordered cancellative additive commutative monoid is a partially ordered commutative additive
monoid in which addition is cancellative and monotone. -/
class OrderedCancelAddCommMonoid (α : Type*) extends OrderedAddCommMonoid α where
  protected le_of_add_le_add_left : ∀ a b c : α, a + b ≤ a + c → b ≤ c

{α : Type u_3}
[self : OrderedCancelAddCommMonoid α]
(a b c : α)


@[simp]
theorem isUnit_iff_singleton : IsUnit f ↔ ∃ a, f = pure a


lemma MonovaryOn.pow_left₀ (hf : ∀ i ∈ s, 0 ≤ f i) (hfg : MonovaryOn f g s) (n : ℕ) :
    MonovaryOn (f ^ n) g s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedSemiring α]
[OrderedSemiring β]
{s : Set ι}
{f : ι → α}
{g : ι → β}
(hf : ∀ i ∈ s, 0 ≤ f i)
(hfg : MonovaryOn f g s)
(n : ℕ)


@[to_additive (attr := simp)]
theorem toList_comp_ofList : @toList α ∘ ofList = id

⇑FreeMonoid.toList ∘ ⇑FreeMonoid.ofList = id


theorem fg_of_submodule_fg (h : (⊤ : Submodule R A).FG) : (⊤ : Subalgebra R A).FG

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(h : ⊤.FG)


/-- Tensoring on the left with a fixed object, as a functor. -/
@[simps!]
def tensorLeft (X : C) : C ⥤ C

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

∀ {X_1 Y : C} (g : X_1 ⟶ Y),
  (CategoryTheory.MonoidalCategory.tensorLeft X).map g = CategoryTheory.MonoidalCategory.whiskerLeft X g


/-- `hs.toCone s` is the least cone that includes `s`. -/
theorem toCone_isLeast : IsLeast { t : ConvexCone 𝕜 E | s ⊆ t } (hs.toCone s)

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

IsLeast {t | s ⊆ ↑t} (Convex.toCone s hs)


theorem Icc_subset_Icc_iff (h₁ : a₁ ≤ b₁) : Icc a₁ b₁ ⊆ Icc a₂ b₂ ↔ a₂ ≤ a₁ ∧ b₁ ≤ b₂

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

Set.Icc a₁ b₁ ⊆ Set.Icc a₂ b₂ ↔ a₂ ≤ a₁ ∧ b₁ ≤ b₂


@[simp]
theorem coe_pi' (f : ∀ i, M →L[R] φ i) : ⇑(pi f) = fun c i => f i c

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[TopologicalSpace M]
[AddCommMonoid M]
[Module R M]
{ι : Type u_4}
{φ : ι → Type u_5}
[(i : ι) → TopologicalSpace (φ i)]
[(i : ι) → AddCommMonoid (φ i)]
[(i : ι) → Module R (φ i)]
(f : (i : ι) → M →L[R] φ i)

⇑(ContinuousLinearMap.pi f) = fun c i => (f i) c


lemma sq_le_sq : a ^ 2 ≤ b ^ 2 ↔ |a| ≤ |b|

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


theorem surjOn_log : SurjOn log (Ioi 0) univ

Set.SurjOn Real.log (Set.Ioi 0) Set.univ


@[simp]
theorem mem_powerset_iff (x s : Set α) : x ∈ 𝒫 s ↔ x ⊆ s

x ∈ 𝒫 s ↔ x ⊆ s


theorem continuousAt_arcsin {x : ℝ} : ContinuousAt arcsin x


@[simp]
theorem closedComplemented_top : ClosedComplemented (⊤ : Submodule R M)

{R : Type u_1}
[Ring R]
{M : Type u_2}
[TopologicalSpace M]
[AddCommGroup M]
[Module R M]


@[simp] theorem String.lt_irrefl (s : String) : ¬ s < s


/-- The edist of `x` to `s` is bounded by the sum of the edist of `y` to `s` and
the edist from `x` to `y` -/
theorem infEdist_le_infEdist_add_edist : infEdist x s ≤ infEdist y s + edist x y

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

EMetric.infEdist x s ≤ EMetric.infEdist y s + edist x y


theorem dvd_one_iff (n : ℕ+) : n ∣ 1 ↔ n = 1


theorem cardinal_mk_eq_max [Nonempty σ] [Nontrivial R] :
    #(MvPolynomial σ R) = max (max #R #σ) ℵ₀

{σ R : Type u}
[CommSemiring R]
[Nonempty σ]
[Nontrivial R]


@[simp]
theorem DifferentiableAt.sin (hc : DifferentiableAt ℝ f x) :
    DifferentiableAt ℝ (fun x => Real.sin (f x)) x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{x : E}
(hc : DifferentiableAt ℝ f x)


@[reassoc]
theorem comp_coconePointsIsoOfNatIso_inv {F G : J ⥤ C} {s : Cocone F} {t : Cocone G}
    (P : IsColimit s) (Q : IsColimit t) (w : F ≅ G) (j : J) :
    t.ι.app j ≫ (coconePointsIsoOfNatIso P Q w).inv = w.inv.app j ≫ s.ι.app j

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

t.ι.app j ≫ (P.coconePointsIsoOfNatIso Q w).inv = w.inv.app j ≫ s.ι.app j


/-- **Equality case of the Rearrangement Inequality**: Pointwise multiplication of `f` and `g`,
which antivary together, is unchanged by a permutation if and only if `f` and `g ∘ σ` antivary
together. Stated by permuting the entries of `g`. -/
theorem Antivary.sum_mul_eq_sum_mul_comp_perm_iff (hfg : Antivary f g) :
    ∑ i, f i * g (σ i) = ∑ i, f i * g i ↔ Antivary f (g ∘ σ)

{ι : Type u_1}
{α : Type u_2}
[LinearOrderedRing α]
{σ : Equiv.Perm ι}
{f g : ι → α}
[Fintype ι]
(hfg : Antivary f g)

∑ i : ι, f i * g (σ i) = ∑ i : ι, f i * g i ↔ Antivary f (g ∘ ⇑σ)


theorem dedup_ext {s t : Multiset α} : dedup s = dedup t ↔ ∀ a, a ∈ s ↔ a ∈ t

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

s.dedup = t.dedup ↔ ∀ (a : α), a ∈ s ↔ a ∈ t


/-- `qrSign` is multiplicative in the second argument. -/
theorem mul_right (m n₁ n₂ : ℕ) [NeZero n₁] [NeZero n₂] :
    qrSign m (n₁ * n₂) = qrSign m n₁ * qrSign m n₂


/-- The canonical bijection between `α` and `αᵐᵒᵖ`. -/
@[to_additive (attr := simps (config := .asFn) apply symm_apply)
  "The canonical bijection between `α` and `αᵃᵒᵖ`."]
def opEquiv : α ≃ αᵐᵒᵖ


@[to_additive (attr := mono)]
theorem smul_subset_smul : s₁ ⊆ s₂ → t₁ ⊆ t₂ → s₁ • t₁ ⊆ s₂ • t₂

{α : Type u_2}
{β : Type u_3}
[VAdd α β]
{s₁ s₂ : Set α}
{t₁ t₂ : Set β}

s₁ ⊆ s₂ → t₁ ⊆ t₂ → s₁ +ᵥ t₁ ⊆ s₂ +ᵥ t₂


private lemma mul_comm : ∀ (a b : SignType), a * b = b * a


theorem contMDiffWithinAt_iff_of_mem_maximalAtlas {x : M} (he : e ∈ maximalAtlas I M)
    (he' : e' ∈ maximalAtlas I' M') (hx : x ∈ e.source) (hy : f x ∈ e'.source) :
    ContMDiffWithinAt I I' n f s x ↔
      ContinuousWithinAt f s x ∧
        ContDiffWithinAt 𝕜 n (e'.extend I' ∘ f ∘ (e.extend I).symm)
          ((e.extend I).symm ⁻¹' s ∩ range I) (e.extend I x)

(he : e ∈ SmoothManifoldWithCorners.maximalAtlas I M)

(he' : e' ∈ SmoothManifoldWithCorners.maximalAtlas I' M')

ContMDiffWithinAt I I' n f s x ↔
  ContinuousWithinAt f s x ∧
    ContDiffWithinAt 𝕜 n (↑(e'.extend I') ∘ f ∘ ↑(e.extend I).symm) (↑(e.extend I).symm ⁻¹' s ∩ Set.range ↑I)
      (↑(e.extend I) x)


theorem tr_ret_cons₂ (k) : tr (Λ'.ret (Cont'.cons₂ k)) =
    goto fun _ => head stack <| Λ'.ret k

Turing.PartrecToTM2.tr (Turing.PartrecToTM2.Λ'.ret k.cons₂) =
  Turing.TM2.Stmt.goto fun x => Turing.PartrecToTM2.head Turing.PartrecToTM2.K'.stack (Turing.PartrecToTM2.Λ'.ret k)


theorem norm_nonarchimedean (f g : PadicSeq p) : (f + g).norm ≤ max f.norm g.norm

{p : ℕ}
[hp : Fact (Nat.Prime p)]
(f g : PadicSeq p)


/-- Exhibit a bijection between `Fin n` and the index set of a certain basis of an `n`-dimensional
inner product space `E`.  This should not be accessed directly, but only via the subsequent API. -/
irreducible_def DirectSum.IsInternal.sigmaOrthonormalBasisIndexEquiv
    (hV' : OrthogonalFamily 𝕜 (fun i => V i) fun i => (V i).subtypeₗᵢ) :
    (Σi, Fin (finrank 𝕜 (V i))) ≃ Fin n

(hn : FiniteDimensional.finrank 𝕜 E = n)

(hV' : OrthogonalFamily 𝕜 (fun i => ↥(V i)) fun i => (V i).subtypeₗᵢ)

DirectSum.IsInternal.sigmaOrthonormalBasisIndexEquiv hn hV hV' =
  let b := DirectSum.IsInternal.collectedOrthonormalBasis hV' hV fun i => stdOrthonormalBasis 𝕜 ↥(V i);
  Fintype.equivFinOfCardEq ⋯