theorem not_tendsto_atTop_of_tendsto_nhds (hf : Tendsto f l (𝓝 a)) : ¬Tendsto f l atTop

{α : Type u}
{β : Type v}
[Preorder α]
[NoTopOrder α]
[TopologicalSpace α]
[ClosedIciTopology α]
{a : α}
{l : Filter β}
[l.NeBot]
{f : β → α}
(hf : Filter.Tendsto f l (𝓝 a))


theorem natDegree_eq_of_le_of_coeff_ne_zero (pn : p.natDegree ≤ n) (p1 : p.coeff n ≠ 0) :
    p.natDegree = n

{R : Type u}
{n : ℕ}
[Semiring R]
{p : R[X]}
(pn : p.natDegree ≤ n)
(p1 : p.coeff n ≠ 0)


theorem int_div (h : Irrational x) {m : ℤ} (hm : m ≠ 0) : Irrational (m / x)

{x : ℝ}
(h : Irrational x)
{m : ℤ}
(hm : m ≠ 0)


@[to_additive (attr := norm_cast)] -- Porting note (#10618): removed `simp`, `simp` can prove it
theorem coe_finset_prod {ι M} [CommMonoid M] [SetLike B M] [SubmonoidClass B M] (f : ι → S)
    (s : Finset ι) : ↑(∏ i ∈ s, f i) = (∏ i ∈ s, f i : M)

{B : Type u_3}
{S : B}
{ι : Type u_4}
{M : Type u_5}
[CommMonoid M]
[SetLike B M]
[SubmonoidClass B M]
(f : ι → ↥S)
(s : Finset ι)


@[reassoc]
theorem associator_naturality_right (X Y : C) {Z Z' : C} (f : Z ⟶ Z') :
    (X ⊗ Y) ◁ f ≫ (α_ X Y Z').hom = (α_ X Y Z).hom ≫ X ◁ Y ◁ f

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

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.whiskerLeft (CategoryTheory.MonoidalCategory.tensorObj X Y) f)
    (CategoryTheory.MonoidalCategory.associator X Y Z').hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator X Y Z).hom
    (CategoryTheory.MonoidalCategory.whiskerLeft X (CategoryTheory.MonoidalCategory.whiskerLeft Y f))


theorem opow_right_inj {a b c : Ordinal} (a1 : 1 < a) : a ^ b = a ^ c ↔ b = c


theorem IsComplemented.inf : IsComplemented a → IsComplemented b → IsComplemented (a ⊓ b)

{α : Type u_1}
[DistribLattice α]
[BoundedOrder α]
{a b : α}


@[ext]
theorem ext {p q : R[X]} : (∀ n, coeff p n = coeff q n) → p = q

(∀ (n : ℕ), p.coeff n = q.coeff n) → p = q


theorem Semiconj.mapsTo_ptsOfPeriod {g : α → β} (h : Semiconj g fa fb) (n : ℕ) :
    MapsTo g (ptsOfPeriod fa n) (ptsOfPeriod fb n)

{α : Type u_1}
{β : Type u_2}
{fa : α → α}
{fb : β → β}
{g : α → β}
(h : Function.Semiconj g fa fb)
(n : ℕ)

Set.MapsTo g (Function.ptsOfPeriod fa n) (Function.ptsOfPeriod fb n)


@[simp]
theorem beckCoequalizer_desc (s : Cofork (T.toFunctor.map X.a) (T.μ.app X.A)) :
    (beckCoequalizer X).desc s = T.η.app _ ≫ s.π

(s : CategoryTheory.Limits.Cofork (T.map X.a) (T.μ.app X.A))

(CategoryTheory.Monad.beckCoequalizer X).desc s = CategoryTheory.CategoryStruct.comp (T.η.app X.A) s.π


/-- A set is sequentially closed if it is closed. -/
protected theorem IsClosed.isSeqClosed {s : Set X} (hc : IsClosed s) : IsSeqClosed s

{X : Type u_1}
[TopologicalSpace X]
{s : Set X}
(hc : IsClosed s)


protected theorem list_prod_mem {L : List A} (h : ∀ x ∈ L, x ∈ S) : L.prod ∈ S

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R A)
{L : List A}
(h : ∀ x ∈ L, x ∈ S)


@[to_additive "A right transversal is finite iff the subgroup has finite index"]
theorem finite_iff
    (h : S ∈ Subgroup.rightTransversals (H : Set G)) :
    Finite S ↔ H.FiniteIndex

{G : Type u_1}
[Group G]
{H : Subgroup G}
{S : Set G}
(h : S ∈ Subgroup.rightTransversals ↑H)


/-- If `ι` has a unique element, then `ι → X` is homeomorphic to `X`. -/
@[simps! (config := .asFn)]
def funUnique (ι X : Type*) [Unique ι] [TopologicalSpace X] : (ι → X) ≃ₜ X

(ι : Type u_6)
(X : Type u_7)
[Unique ι]
[TopologicalSpace X]

⇑(Homeomorph.funUnique ι X) = fun f => f default


theorem lowerSemicontinuousWithinAt_iff_le_liminf {f : α → γ} :
    LowerSemicontinuousWithinAt f s x ↔ f x ≤ liminf f (𝓝[s] x)

{α : Type u_1}
[TopologicalSpace α]
{x : α}
{s : Set α}
{γ : Type u_3}
[CompleteLinearOrder γ]
[DenselyOrdered γ]
{f : α → γ}

LowerSemicontinuousWithinAt f s x ↔ f x ≤ Filter.liminf f (𝓝[s] x)


@[to_additive]
lemma unit_of_mem_ofUnits_spec_eq_of_val_mem (S : Subgroup Mˣ) {x : Mˣ} (h : (x : M) ∈ S.ofUnits) :
    S.unit_of_mem_ofUnits h = x

{M : Type u_1}
[Monoid M]
(S : Subgroup Mˣ)
{x : Mˣ}
(h : ↑x ∈ S.ofUnits)


theorem mem_maximals_iff_forall_lt_not_mem'
    (rlt : α → α → Prop) [IsNonstrictStrictOrder α r rlt] :
    x ∈ maximals r s ↔ x ∈ s ∧ ∀ ⦃y⦄, rlt x y → y ∉ s

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
{x : α}
(rlt : α → α → Prop)
[IsNonstrictStrictOrder α r rlt]

x ∈ maximals r s ↔ x ∈ s ∧ ∀ ⦃y : α⦄, rlt x y → y ∉ s


@[to_additive]
theorem smul_set_mono : s ⊆ t → a • s ⊆ a • t

{α : Type u_2}
{β : Type u_3}
[VAdd α β]
{s t : Set β}
{a : α}


@[simp] lemma powerset_sups_powerset_self (s : Finset α) :
    s.powerset ⊻ s.powerset = s.powerset

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


theorem symmDiff_of_ge {a b : α} (h : b ≤ a) : a ∆ b = a \ b

{α : Type u_2}
[GeneralizedCoheytingAlgebra α]
{a b : α}
(h : b ≤ a)


/-- If `X` is a compact topological space, then `Prod.snd : X × Y → Y` is a closed map. -/
theorem isClosedMap_snd_of_compactSpace [CompactSpace X] :
    IsClosedMap (Prod.snd : X × Y → Y)

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


theorem monic_of_b_eq_one (ha : P.a = 0) (hb : P.b = 1) : P.toPoly.Monic

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


theorem isUnit_of_dvd_unit {x y : α} (xy : x ∣ y) (hu : IsUnit y) : IsUnit x

{α : Type u_1}
[CommMonoid α]
{x y : α}
(xy : x ∣ y)
(hu : IsUnit y)


theorem isIntegral [Finite G] (x : F) : IsIntegral (FixedPoints.subfield G F) x

(G : Type u)
[Group G]
(F : Type v)
[Field F]
[MulSemiringAction G F]
[Finite G]
(x : F)

IsIntegral (↥(FixedPoints.subfield G F)) x


theorem exp_bound_sq (x z : ℂ) (hz : ‖z‖ ≤ 1) :
    ‖exp (x + z) - exp x - z • exp x‖ ≤ ‖exp x‖ * ‖z‖ ^ 2

‖Complex.exp (x + z) - Complex.exp x - z • Complex.exp x‖ ≤ ‖Complex.exp x‖ * ‖z‖ ^ 2


/-- When a function has a limit at infinity `l`, and its derivative is nonpositive, then the
integral of the derivative on `(a, +∞)` is `l - g a` (and the derivative is integrable, see
`integrable_on_Ioi_deriv_of_nonneg`). Version assuming differentiability on `(a, +∞)` and
continuity at `a⁺`. -/
theorem integral_Ioi_of_hasDerivAt_of_nonpos (hcont : ContinuousWithinAt g (Ici a) a)
    (hderiv : ∀ x ∈ Ioi a, HasDerivAt g (g' x) x) (g'neg : ∀ x ∈ Ioi a, g' x ≤ 0)
    (hg : Tendsto g atTop (𝓝 l)) : ∫ x in Ioi a, g' x = l - g a

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

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

(hg : Filter.Tendsto g Filter.atTop (𝓝 l))


theorem id_eq {X : TopCat.{w}} (ℱ : X.Presheaf C) : 𝟙 X _* ℱ = ℱ

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{X : TopCat}
(ℱ : TopCat.Presheaf C X)

(TopCat.Presheaf.pushforward C (𝟙 X)).obj ℱ = ℱ


@[simp] lemma grade_eq (s : Finset α) : grade ℕ s = s.card


theorem coeff_mul_prod_one_sub_of_lt_order {R ι : Type*} [CommRing R] (k : ℕ) (s : Finset ι)
    (φ : R⟦X⟧) (f : ι → R⟦X⟧) :
    (∀ i ∈ s, ↑k < (f i).order) → coeff R k (φ * ∏ i ∈ s, (1 - f i)) = coeff R k φ

{R : Type u_2}
{ι : Type u_3}
[CommRing R]
(k : ℕ)
(s : Finset ι)
(φ : PowerSeries R)
(f : ι → PowerSeries R)

(∀ i ∈ s, ↑k < (f i).order) → (PowerSeries.coeff R k) (φ * ∏ i ∈ s, (1 - f i)) = (PowerSeries.coeff R k) φ


/-- For bounded continuous functions `f`, `g` on a finite-measure topological space `α`, the L^2
inner product is the integral of their pointwise inner product. -/
theorem BoundedContinuousFunction.inner_toLp (f g : α →ᵇ 𝕜) :
    ⟪BoundedContinuousFunction.toLp (E := 𝕜) 2 μ 𝕜 f,
        BoundedContinuousFunction.toLp (E := 𝕜) 2 μ 𝕜 g⟫ =
      ∫ x, conj (f x) * g x ∂μ

{α : Type u_1}
{𝕜 : Type u_2}
[TopologicalSpace α]
[MeasurableSpace α]
[BorelSpace α]
[RCLike 𝕜]
(μ : MeasureTheory.Measure α)
[MeasureTheory.IsFiniteMeasure μ]
(f g : BoundedContinuousFunction α 𝕜)

⟪(BoundedContinuousFunction.toLp 2 μ 𝕜) f, (BoundedContinuousFunction.toLp 2 μ 𝕜) g⟫_𝕜 =
  ∫ (x : α), (starRingEnd 𝕜) (f x) * g x ∂μ


theorem uniqueDiffWithinAt_inter' (ht : t ∈ 𝓝[s] x) :
    UniqueDiffWithinAt 𝕜 (s ∩ t) x ↔ UniqueDiffWithinAt 𝕜 s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{s t : Set E}
(ht : t ∈ 𝓝[s] x)


@[to_additive]
theorem range_subgroup {f : G → H} (hf : IsGroupHom f) : IsSubgroup (Set.range f)

{G : Type u_1}
{H : Type u_2}
[Group G]
[Group H]
{f : G → H}
(hf : IsGroupHom f)


theorem smul_nat {a b c : ℕ} (_ : (a * b : ℕ) = c) : a • b = c


theorem Coprime.coprime_div_left (cmn : Coprime m n) (dvd : a ∣ m) : Coprime (m / a) n

{m n a : Nat}
(cmn : m.Coprime n)
(dvd : a ∣ m)


theorem degree_map_eq_of_leadingCoeff_ne_zero (f : R →+* S) (hf : f (leadingCoeff p) ≠ 0) :
    degree (p.map f) = degree p

{R : Type u}
{S : Type v}
[Semiring R]
{p : R[X]}
[Semiring S]
(f : R →+* S)
(hf : f p.leadingCoeff ≠ 0)


@[simp]
theorem nnnorm_two : ‖(2 : ℝ)‖₊ = 2


@[simp] lemma unop_hom_braiding (X Y : Cᵒᵖ) : (β_ X Y).hom.unop = (β_ (unop Y) (unop X)).hom

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

(β_ X Y).hom.unop = (β_ (Opposite.unop Y) (Opposite.unop X)).hom


theorem iInter_Iic_rat : ⋂ r : ℚ, Iic (r : ℝ) = ∅


@[simp]
theorem toOrdinal_max {a b : NatOrdinal} : toOrdinal (max a b) = max (toOrdinal a) (toOrdinal b)

NatOrdinal.toOrdinal (max a b) = max (NatOrdinal.toOrdinal a) (NatOrdinal.toOrdinal b)


/-- For `a = 0`, both kernels agree. -/
lemma evenKernel_eq_cosKernel_of_zero : evenKernel 0 = cosKernel 0

HurwitzZeta.evenKernel 0 = HurwitzZeta.cosKernel 0


theorem all_eq_true (p : α → Bool) (as : Array α) : all as p ↔ ∀ i : Fin as.size, p as[i]

{α : Type u_1}
(p : α → Bool)
(as : Array α)

as.all p 0 = true ↔ ∀ (i : Fin as.size), p as[i] = true


@[gcongr]
protected theorem mul (h₁ : a ≡ b [ZMOD n]) (h₂ : c ≡ d [ZMOD n]) : a * c ≡ b * d [ZMOD n]

{n a b c d : ℤ}
(h₁ : a ≡ b [ZMOD n])
(h₂ : c ≡ d [ZMOD n])


@[simp] theorem map_const' (s : Multiset α) (b : β) : map (fun _ ↦ b) s = replicate (card s) b

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

Multiset.map (fun x => b) s = Multiset.replicate (Multiset.card s) b


theorem mul_charP_coeff_zero [CharP R p] (x : 𝕎 R) : (x * p).coeff 0 = 0

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


@[simp]
theorem map_smul (f : L₁ →ₗ⁅R⁆ L₂) (c : R) (x : L₁) : f (c • x) = c • f x

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


@[simp]
theorem coe_restrict_apply (f : R →+* S) (s' : σR) (s : σS) (h : ∀ x ∈ s', f x ∈ s) (x : s') :
    (f.restrict s' s h x : S) = f x

{R : Type u}
{S : Type v}
[NonAssocSemiring R]
[NonAssocSemiring S]
{σR : Type u_1}
{σS : Type u_2}
[SetLike σR R]
[SetLike σS S]
[SubsemiringClass σR R]
[SubsemiringClass σS S]
(f : R →+* S)
(s' : σR)
(s : σS)
(h : ∀ x ∈ s', f x ∈ s)
(x : ↥s')


theorem HasDerivAt.comp_hasFDerivAt_of_eq {f : E → 𝕜'} {f' : E →L[𝕜] 𝕜'} (x)
    (hh : HasDerivAt h₂ h₂' y) (hf : HasFDerivAt f f' x) (hy : y = f x) :
    HasFDerivAt (h₂ ∘ f) (h₂' • f') x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type w}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{𝕜' : Type u_1}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{h₂ : 𝕜' → 𝕜'}
{h₂' y : 𝕜'}
{f : E → 𝕜'}
{f' : E →L[𝕜] 𝕜'}
(x : E)
(hh : HasDerivAt h₂ h₂' y)
(hf : HasFDerivAt f f' x)
(hy : y = f x)


@[simp]
lemma equivShrink_symm_add [Add α] [Small α] (x y : Shrink α) :
    (equivShrink α).symm (x + y) = (equivShrink α).symm x + (equivShrink α).symm y

{α : Type u_1}
[Add α]
[Small.{u_2, u_1} α]
(x y : Shrink.{u_2, u_1} α)


theorem _root_.tendsto_real_toNNReal_atTop : Tendsto Real.toNNReal atTop atTop

Filter.Tendsto Real.toNNReal Filter.atTop Filter.atTop


/-- If `g` is convex on `s`, so is `(f ∘ g)` on `f ⁻¹' s` for a linear `f`. -/
theorem ConvexOn.comp_linearMap {f : F → β} {s : Set F} (hf : ConvexOn 𝕜 s f) (g : E →ₗ[𝕜] F) :
    ConvexOn 𝕜 (g ⁻¹' s) (f ∘ g)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[AddCommMonoid F]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[Module 𝕜 F]
[SMul 𝕜 β]
{f : F → β}
{s : Set F}
(hf : ConvexOn 𝕜 s f)
(g : E →ₗ[𝕜] F)


/-- An equivalence between `Bool × ℕ` and `ℕ`, by mapping `(true, x)` to `2 * x + 1` and
`(false, x)` to `2 * x`. -/
@[simps]
def boolProdNatEquivNat : Bool × ℕ ≃ ℕ

∀ (a : Bool × ℕ), Equiv.boolProdNatEquivNat a = Function.uncurry Nat.bit a


/-- By definition, if `x` is not invertible then `inverse x = 0`. -/
@[simp]
theorem inverse_non_unit (x : M₀) (h : ¬IsUnit x) : inverse x = 0

{M₀ : Type u_2}
[MonoidWithZero M₀]
(x : M₀)
(h : ¬IsUnit x)


/-- The cardinality of the interval [a, ∞). -/
theorem mk_Ici_real (a : ℝ) : #(Ici a) = 𝔠


lemma slitPlane_eq_union : slitPlane = {z | 0 < z.re} ∪ {z | z.im ≠ 0}

Complex.slitPlane = {z | 0 < z.re} ∪ {z | z.im ≠ 0}


theorem HasDerivWithinAt.clog_real {f : ℝ → ℂ} {s : Set ℝ} {x : ℝ} {f' : ℂ}
    (h₁ : HasDerivWithinAt f f' s x) (h₂ : f x ∈ slitPlane) :
    HasDerivWithinAt (fun t => log (f t)) (f' / f x) s x

{f : ℝ → ℂ}
{s : Set ℝ}
{x : ℝ}
{f' : ℂ}
(h₁ : HasDerivWithinAt f f' s x)
(h₂ : f x ∈ Complex.slitPlane)

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


/-- Shows `prodToProdTop` is an isomorphism, whose inverse is precisely the product
of the induced left and right projections.
-/
@[simps]
def prodIso : CategoryTheory.Grpd.of (πₓ A × πₓ B) ≅ πₓ (TopCat.of (A × B))

(FundamentalGroupoidFunctor.prodIso A B).hom = FundamentalGroupoidFunctor.prodToProdTop A B


theorem le_finset_sup_apply {p : ι → Seminorm 𝕜 E} {s : Finset ι} {x : E} {i : ι}
    (hi : i ∈ s) : p i x ≤ s.sup p x

{𝕜 : Type u_3}
{E : Type u_7}
{ι : Type u_12}
[SeminormedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{p : ι → Seminorm 𝕜 E}
{s : Finset ι}
{x : E}
{i : ι}
(hi : i ∈ s)


@[simp] theorem apply_symm_apply (e : X ≃ᵈ Y) (x : Y) : e (e.symm x) = x

{X : Type u_1}
{Y : Type u_2}
[PseudoEMetricSpace X]
[PseudoEMetricSpace Y]
(e : X ≃ᵈ Y)
(x : Y)


@[simp] lemma directLimitLeft_symm_of_tmul {i : ι} (g : G i) (m : M) :
    (directLimitLeft f M).symm (of _ _ _ _ _ (g ⊗ₜ m)) = of _ _ _ f _ g ⊗ₜ m

{R : Type u_1}
[CommRing R]
{ι : Type u_2}
[DecidableEq ι]
[Preorder ι]
{G : ι → Type u_3}
[(i : ι) → AddCommGroup (G i)]
[(i : ι) → Module R (G i)]
(f : (i j : ι) → i ≤ j → G i →ₗ[R] G j)
(M : Type u_4)
[AddCommGroup M]
[Module R M]
[IsDirected ι fun x x_1 => x ≤ x_1]
{i : ι}
(g : G i)
(m : M)

(TensorProduct.directLimitLeft f M).symm
    ((Module.DirectLimit.of R ι (fun x => G x ⊗[R] M) (fun i j h => LinearMap.rTensor M (f i j h)) i) (g ⊗ₜ[R] m)) =
  (Module.DirectLimit.of R ι G f i) g ⊗ₜ[R] m


/-- The equivalence `(ULift ℤ →+ α) ≃ α` for any additive group `α`. -/
@[simps!]
def fromULiftIntEquiv (α : Type u) [AddGroup α] : (ULift.{u} ℤ →+ α) ≃ α

∀ (a : α) (a_1 : ULift.{u, 0} ℤ), ((AddMonoidHom.fromULiftIntEquiv α).symm a) a_1 = AddEquiv.ulift a_1 • a


@[symm]
theorem symm (h : Q₁.Equivalent Q₂) : Q₂.Equivalent Q₁

{R : Type u_2}
{M₁ : Type u_5}
{M₂ : Type u_6}
{N : Type u_9}
[CommSemiring R]
[AddCommMonoid M₁]
[AddCommMonoid M₂]
[AddCommMonoid N]
[Module R M₁]
[Module R M₂]
[Module R N]
{Q₁ : QuadraticMap R M₁ N}
{Q₂ : QuadraticMap R M₂ N}
(h : Q₁.Equivalent Q₂)


@[reassoc (attr := simp)]
lemma comp_δ : HomologicalComplex.homologyMap S.g i ≫ hS.δ i j hij = 0

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


theorem flag_covBy (b : Basis (Fin n) K V) (i : Fin n) :
    b.flag i.castSucc ⋖ b.flag i.succ

{K : Type u_1}
{V : Type u_2}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
{n : ℕ}
(b : Basis (Fin n) K V)
(i : Fin n)


@[simp] lemma ofAdd_mul (a b : ℕ) : ofAdd (a * b) = ofAdd a ^ b

Multiplicative.ofAdd (a * b) = Multiplicative.ofAdd a ^ b


lemma base_iff_indep_closure_eq : M.Base B ↔ M.Indep B ∧ M.closure B = M.E

{α : Type u_2}
{M : Matroid α}
{B : Set α}


@[ext high]
theorem ext {f g : Lp E p μ} (h : f =ᵐ[μ] g) : f = g

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{f g : ↥(MeasureTheory.Lp E p μ)}
(h : ↑↑f =ᵐ[μ] ↑↑g)


/-- The functor sending an object `X` in the comma category to `X.left`. -/
@[simps]
def fst : Comma L R ⥤ A

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
(L : CategoryTheory.Functor A T)
(R : CategoryTheory.Functor B T)

∀ {X Y : CategoryTheory.Comma L R} (f : X ⟶ Y), (CategoryTheory.Comma.fst L R).map f = f.left


@[to_additive]
lemma smul_smul (a₁ a₂ : M) (b : α) : a₁ • a₂ • b = (a₁ * a₂) • b

{M : Type u_1}
{α : Type u_7}
[AddMonoid M]
[AddAction M α]
(a₁ a₂ : M)
(b : α)


lemma quasiIso_iff_of_arrow_mk_iso (φ : K ⟶ L) (φ' : K' ⟶ L') (e : Arrow.mk φ ≅ Arrow.mk φ')
    [∀ i, K.HasHomology i] [∀ i, L.HasHomology i]
    [∀ i, K'.HasHomology i] [∀ i, L'.HasHomology i] :
    QuasiIso φ ↔ QuasiIso φ'

(e : CategoryTheory.Arrow.mk φ ≅ CategoryTheory.Arrow.mk φ')


lemma monovary_inv₀ (hf : StrongLT 0 f) (hg : StrongLT 0 g) : Monovary f⁻¹ g⁻¹ ↔ Monovary f g

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


/-- The inner product of a vector with a multiple of itself. -/
theorem real_inner_smul_self_right (x : F) (r : ℝ) : ⟪x, r • x⟫_ℝ = r * (‖x‖ * ‖x‖)

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


@[fun_prop]
lemma ContinuousOn.inf (hf : ContinuousOn f s) (hg : ContinuousOn g s) :
    ContinuousOn (fun a ↦ f a ⊓ g a) s

{L : Type u_1}
{X : Type u_2}
[TopologicalSpace L]
[TopologicalSpace X]
[Inf L]
[ContinuousInf L]
{f g : X → L}
{s : Set X}
(hf : ContinuousOn f s)
(hg : ContinuousOn g s)


theorem rightInverse_of_injective_of_leftInverse {f : α → β} {g : β → α} (injf : Injective f)
    (lfg : LeftInverse f g) : RightInverse f g

{α : Sort u₁}
{β : Sort u₂}
{f : α → β}
{g : β → α}
(injf : Function.Injective f)
(lfg : Function.LeftInverse f g)


theorem fg_bot : (⊥ : Subalgebra R A).FG

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


theorem linearIndependent_cols_iff_isUnit {A : Matrix m m K} :
    LinearIndependent K (fun i ↦ Aᵀ i) ↔ IsUnit A

{m : Type u}
[DecidableEq m]
{K : Type u_3}
[Field K]
[Fintype m]
{A : Matrix m m K}

(LinearIndependent K fun i => A.transpose i) ↔ IsUnit A


theorem all_ae_tendsto_ofReal_norm (h : ∀ᵐ a ∂μ, Tendsto (fun n => F n a) atTop <| 𝓝 <| f a) :
    ∀ᵐ a ∂μ, Tendsto (fun n => ENNReal.ofReal ‖F n a‖) atTop <| 𝓝 <| ENNReal.ofReal ‖f a‖

{F : ℕ → α → β}

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

∀ᵐ (a : α) ∂μ, Filter.Tendsto (fun n => ENNReal.ofReal ‖F n a‖) Filter.atTop (𝓝 (ENNReal.ofReal ‖f a‖))


theorem hammingNorm_comp (f : ∀ i, γ i → β i) {x : ∀ i, γ i} (hf₁ : ∀ i, Injective (f i))
    (hf₂ : ∀ i, f i 0 = 0) : (hammingNorm fun i => f i (x i)) = hammingNorm x

(hf₁ : ∀ (i : ι), Function.Injective (f i))


/-- Note this is more general than `IsSelfAdjoint.mul_star_self` as `B` can be rectangular. -/
theorem isHermitian_mul_conjTranspose_self [Fintype n] (A : Matrix m n α) :
    (A * Aᴴ).IsHermitian

{α : Type u_1}
{m : Type u_3}
{n : Type u_4}
[NonUnitalSemiring α]
[StarRing α]
[Fintype n]
(A : Matrix m n α)


@[to_additive (attr := simp)]
theorem le_inv_mul_iff_mul_le : b ≤ a⁻¹ * c ↔ a * b ≤ c

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


@[to_additive (attr := simp, norm_cast)]
theorem op_intCast [IntCast α] (n : ℤ) : op (n : α) = n


theorem coePNat_injective : Function.Injective (Coe.coe : PrimeMultiset → Multiset ℕ+)


@[simp]
theorem pderiv_X_self (i : σ) : pderiv i (X i : MvPolynomial σ R) = 1

{R : Type u}
{σ : Type v}
[CommSemiring R]
(i : σ)

(MvPolynomial.pderiv i) (MvPolynomial.X i) = 1


/-- If the index type has cardinality equal to the finite dimension, composing an alternating
map with the same linear equiv on each argument gives the negation of that orientation if and
only if the determinant is negative. -/
theorem map_eq_neg_iff_det_neg (x : Orientation R M ι) (f : M ≃ₗ[R] M)
    (h : Fintype.card ι = finrank R M) :
    Orientation.map ι f x = -x ↔ LinearMap.det (f : M →ₗ[R] M) < 0

(h : Fintype.card ι = FiniteDimensional.finrank R M)

(Orientation.map ι f) x = -x ↔ LinearMap.det ↑f < 0


theorem kernel.ι_op :
    (kernel.ι f.op).unop = eqToHom (Opposite.unop_op _) ≫ cokernel.π f ≫ (kernelOpUnop f).inv

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Abelian C]
{X Y : C}
(f : X ⟶ Y)

(CategoryTheory.Limits.kernel.ι f.op).unop =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom ⋯)
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.Limits.cokernel.π f) (CategoryTheory.kernelOpUnop f).inv)


protected theorem MeasureTheory.AEStronglyMeasurable.stronglyMeasurableAtFilter
    (h : AEStronglyMeasurable f μ) : StronglyMeasurableAtFilter f l μ

(h : MeasureTheory.AEStronglyMeasurable f μ)


lemma deleteEdges_le (s : Set (Sym2 V)) : G.deleteEdges s ≤ G

{V : Type u}
{G : SimpleGraph V}
(s : Set (Sym2 V))


lemma ordConnected_inter_Icc_of_subset (h : Ioo x y ⊆ s) : OrdConnected (s ∩ Icc x y)

{α : Type u_1}
[PartialOrder α]
{s : Set α}
{x y : α}
(h : Set.Ioo x y ⊆ s)


theorem dvd_geom_sum₂_iff_of_dvd_sub {x y p : R} (h : p ∣ x - y) :
    (p ∣ ∑ i ∈ range n, x ^ i * y ^ (n - 1 - i)) ↔ p ∣ n * y ^ (n - 1)

{R : Type u_1}
{n : ℕ}
[CommRing R]
{x y p : R}
(h : p ∣ x - y)

p ∣ ∑ i ∈ Finset.range n, x ^ i * y ^ (n - 1 - i) ↔ p ∣ ↑n * y ^ (n - 1)


theorem imp_eq_of_eq_true_left {a b : Prop} (h : a = True) : (a → b) = b


/-- Summable non-negative functions have countable support -/
theorem _root_.Summable.countable_support_nnreal (f : α → ℝ≥0) (h : Summable f) :
    f.support.Countable

{α : Type u_1}
(f : α → ℝ≥0)
(h : Summable f)


theorem locallyIntegrableOn_zero : LocallyIntegrableOn (fun _ ↦ (0 : E)) s μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[TopologicalSpace X]
[NormedAddCommGroup E]
{μ : MeasureTheory.Measure X}
{s : Set X}

MeasureTheory.LocallyIntegrableOn (fun x => 0) s μ


/-- A pseudofunctor `F` between bicategories `B` and `C` consists of a function between objects
`F.obj`, a function between 1-morphisms `F.map`, and a function between 2-morphisms `F.map₂`.

Unlike functors between categories, `F.map` do not need to strictly commute with the compositions,
and do not need to strictly preserve the identity. Instead, there are specified 2-isomorphisms
`F.map (𝟙 a) ≅ 𝟙 (F.obj a)` and `F.map (f ≫ g) ≅ F.map f ≫ F.map g`.

`F.map₂` strictly commute with compositions and preserve the identity. They also preserve the
associator, the left unitor, and the right unitor modulo some adjustments of domains and codomains
of 2-morphisms.
-/
structure Pseudofunctor (B : Type u₁) [Bicategory.{w₁, v₁} B] (C : Type u₂)
    [Bicategory.{w₂, v₂} C] extends PrelaxFunctor B C where
  mapId (a : B) : map (𝟙 a) ≅ 𝟙 (obj a)
  mapComp {a b c : B} (f : a ⟶ b) (g : b ⟶ c) : map (f ≫ g) ≅ map f ≫ map g
  map₂_whisker_left :
    ∀ {a b c : B} (f : a ⟶ b) {g h : b ⟶ c} (η : g ⟶ h),
      map₂ (f ◁ η) = (mapComp f g).hom ≫ map f ◁ map₂ η ≫ (mapComp f h).inv := by
    aesop_cat
  map₂_whisker_right :
    ∀ {a b c : B} {f g : a ⟶ b} (η : f ⟶ g) (h : b ⟶ c),
      map₂ (η ▷ h) = (mapComp f h).hom ≫ map₂ η ▷ map h ≫ (mapComp g h).inv := by
    aesop_cat
  map₂_associator :
    ∀ {a b c d : B} (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d),
      map₂ (α_ f g h).hom = (mapComp (f ≫ g) h).hom ≫ (mapComp f g).hom ▷ map h ≫
      (α_ (map f) (map g) (map h)).hom ≫ map f ◁ (mapComp g h).inv ≫
      (mapComp f (g ≫ h)).inv := by
    aesop_cat
  map₂_left_unitor :
    ∀ {a b : B} (f : a ⟶ b),
      map₂ (λ_ f).hom = (mapComp (𝟙 a) f).hom ≫ (mapId a).hom ▷ map f ≫ (λ_ (map f)).hom := by
    aesop_cat
  map₂_right_unitor :
    ∀ {a b : B} (f : a ⟶ b),
      map₂ (ρ_ f).hom = (mapComp f (𝟙 b)).hom ≫ map f ◁ (mapId b).hom ≫ (ρ_ (map f)).hom := by
    aesop_cat

(self : CategoryTheory.Pseudofunctor B C)

self.map₂ (CategoryTheory.Bicategory.rightUnitor f).hom =
  CategoryTheory.CategoryStruct.comp (self.mapComp f (CategoryTheory.CategoryStruct.id b)).hom
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerLeft (self.map f) (self.mapId b).hom)
      (CategoryTheory.Bicategory.rightUnitor (self.map f)).hom)


theorem sequence_mono : Monotone (f ∘ hf.sequence f)

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


@[to_additive]
theorem multiset_prod_apply {α : Type*} {β : α → Type*} [∀ a, CommMonoid (β a)] (a : α)
    (s : Multiset (∀ a, β a)) : s.prod a = (s.map fun f : ∀ a, β a ↦ f a).prod

{α : Type u_1}
{β : α → Type u_2}
[(a : α) → AddCommMonoid (β a)]
(a : α)
(s : Multiset ((a : α) → β a))

s.sum a = (Multiset.map (fun f => f a) s).sum


/-- The bijection `(X' ⟶ Y') ≃ (L.obj X ⟶ L.obj Y)` induced by isomorphisms
`eX : L.obj X ≅ X'` and `eY : L.obj Y ≅ Y'`. -/
@[simps]
def homEquiv : (X' ⟶ Y') ≃ (L.obj X ⟶ L.obj Y)

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
{L : CategoryTheory.Functor C D}
{X Y : C}
{X' Y' : D}
(eX : L.obj X ≅ X')
(eY : L.obj Y ≅ Y')
(f : X' ⟶ Y')

(CategoryTheory.Localization.Preadditive.homEquiv eX eY) f =
  CategoryTheory.CategoryStruct.comp eX.hom (CategoryTheory.CategoryStruct.comp f eY.inv)


theorem zero_termg {α} [AddCommGroup α] (x a) : @termg α _ 0 x a = a

{α : Type u_1}
[AddCommGroup α]
(x a : α)


@[simp] theorem Bool.or_true (b : Bool) : (b || true) = true


@[to_additive (attr := simp)]
theorem coe_inv [Inv Y] (f : LocallyConstant X Y) : ⇑(f⁻¹ : LocallyConstant X Y) = (f : X → Y)⁻¹

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

⇑f⁻¹ = (⇑f)⁻¹


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

{f : α → β → γ}

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

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


@[to_additive (attr := simp 1001) mem_sphere_iff_norm]
-- Porting note: increase priority so the left-hand side doesn't reduce
theorem mem_sphere_iff_norm' : b ∈ sphere a r ↔ ‖b / a‖ = r

{E : Type u_6}
[SeminormedAddGroup E]
{a b : E}
{r : ℝ}


@[measurability]
theorem measurable_coe [MeasurableSpace F] [BorelSpace F] :
    Measurable fun (f : E →L[𝕜] F) (x : E) => f x

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[MeasurableSpace F]
[BorelSpace F]


@[simp]
theorem coe_star (f : C₀(α, β)) : ⇑(star f) = star (⇑f)

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[TopologicalSpace β]
[AddMonoid β]
[StarAddMonoid β]
[ContinuousStar β]
(f : α →C₀ β)


theorem locallyConvexSpace (𝔖 : Set (Set E)) (h𝔖₁ : 𝔖.Nonempty)
    (h𝔖₂ : DirectedOn (· ⊆ ·) 𝔖) :
    LocallyConvexSpace R (UniformConvergenceCLM σ F 𝔖)

{σ : 𝕜₁ →+* 𝕜₂}

(h𝔖₂ : DirectedOn (fun x x_1 => x ⊆ x_1) 𝔖)


theorem rootMultiplicity_expand_pow :
    (expand R (p ^ n) f).rootMultiplicity r = p ^ n * f.rootMultiplicity (r ^ p ^ n)

{R : Type u}
[CommRing R]
{p n : ℕ}
[ExpChar R p]
{f : R[X]}
{r : R}

Polynomial.rootMultiplicity r ((Polynomial.expand R (p ^ n)) f) = p ^ n * Polynomial.rootMultiplicity (r ^ p ^ n) f


theorem Trivialization.continuousLinearMap_apply
    (p : TotalSpace (F₁ →SL[σ] F₂) (Bundle.ContinuousLinearMap σ E₁ E₂)) :
    e₁.continuousLinearMap σ e₂ p =
      ⟨p.1, (e₂.continuousLinearMapAt 𝕜₂ p.1 : _ →L[𝕜₂] _).comp
        (p.2.comp (e₁.symmL 𝕜₁ p.1 : F₁ →L[𝕜₁] E₁ p.1) : F₁ →SL[σ] E₂ p.1)⟩

(σ : 𝕜₁ →+* 𝕜₂)

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

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

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

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

(p : Bundle.TotalSpace (F₁ →SL[σ] F₂) (Bundle.ContinuousLinearMap σ E₁ E₂))

↑(Trivialization.continuousLinearMap σ e₁ e₂) p =
  (p.proj,
    (Trivialization.continuousLinearMapAt 𝕜₂ e₂ p.proj).comp
      (ContinuousLinearMap.comp p.snd (Trivialization.symmL 𝕜₁ e₁ p.proj)))


/-- If a function is locally integrable, then it is integrable on an open neighborhood of any
compact set. -/
theorem LocallyIntegrable.integrableOn_nhds_isCompact (hf : LocallyIntegrable f μ) {k : Set X}
    (hk : IsCompact k) : ∃ u, IsOpen u ∧ k ⊆ u ∧ IntegrableOn f u μ

(hf : MeasureTheory.LocallyIntegrable f μ)

∃ u, IsOpen u ∧ k ⊆ u ∧ MeasureTheory.IntegrableOn f u μ


lemma Y_eq_iff {P Q : Fin 3 → F} (hPz : P z ≠ 0) (hQz : Q z ≠ 0) :
    P y * Q z ^ 3 = Q y * P z ^ 3 ↔ P y / P z ^ 3 = Q y / Q z ^ 3

{F : Type v}
[Field F]
{P Q : Fin 3 → F}
(hPz : P z ≠ 0)
(hQz : Q z ≠ 0)


protected theorem comap_preimage (μ : Measure β) (s : Set β) :
    μ.comap f (f ⁻¹' s) = μ (s ∩ range f)

{α : Type u_2}
{β : Type u_3}
{m0 : MeasurableSpace α}
{m1 : MeasurableSpace β}
{f : α → β}
(hf : MeasurableEmbedding f)
(μ : MeasureTheory.Measure β)
(s : Set β)

(MeasureTheory.Measure.comap f μ) (f ⁻¹' s) = μ (s ∩ Set.range f)


@[to_additive]
theorem smoothAt_finprod
    (lf : LocallyFinite fun i ↦ mulSupport <| f i) (h : ∀ i, SmoothAt I' I (f i) x₀) :
    SmoothAt I' I (fun x ↦ ∏ᶠ i, f i x) x₀

(lf : LocallyFinite fun i => Function.support (f i))

SmoothAt I' I (fun x => ∑ᶠ (i : ι), f i x) x₀


@[simp]
theorem List.dProdIndex_nil (fι : α → ι) : ([] : List α).dProdIndex fι = 0

{ι : Type u_1}
{α : Type u_2}
[AddMonoid ι]
(fι : α → ι)


@[simp]
theorem transvection_zero : transvection i j (0 : R) = 1

{n : Type u_1}
{R : Type u₂}
[DecidableEq n]
[CommRing R]
(i j : n)


theorem of_nat_mul (m : ℕ) (h : Irrational (m * x)) : Irrational x

{x : ℝ}
(m : ℕ)
(h : Irrational (↑m * x))


theorem exists_normalized_aux3 {N : ℕ} {τ : ℝ} (a : SatelliteConfig E N τ)
    (lastc : a.c (last N) = 0) (lastr : a.r (last N) = 1) (hτ : 1 ≤ τ) (δ : ℝ) (hδ1 : τ ≤ 1 + δ / 4)
    (i j : Fin N.succ) (inej : i ≠ j) (hi : 2 < ‖a.c i‖) (hij : ‖a.c i‖ ≤ ‖a.c j‖) :
    1 - δ ≤ ‖(2 / ‖a.c i‖) • a.c i - (2 / ‖a.c j‖) • a.c j‖

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{N : ℕ}
{τ : ℝ}
(a : Besicovitch.SatelliteConfig E N τ)
(lastc : a.c (Fin.last N) = 0)
(lastr : a.r (Fin.last N) = 1)
(hτ : 1 ≤ τ)
(δ : ℝ)
(hδ1 : τ ≤ 1 + δ / 4)
(i j : Fin N.succ)
(inej : i ≠ j)
(hi : 2 < ‖a.c i‖)
(hij : ‖a.c i‖ ≤ ‖a.c j‖)


lemma smul_max_of_nonneg [PosSMulMono α β] (ha : 0 ≤ a) (b₁ b₂ : β) :
    a • max b₁ b₂ = max (a • b₁) (a • b₂)

{α : Type u_1}
{β : Type u_2}
{a : α}
[SMul α β]
[Preorder α]
[LinearOrder β]
[Zero α]
[PosSMulMono α β]
(ha : 0 ≤ a)
(b₁ b₂ : β)


theorem differentiableAt_zpow : DifferentiableAt 𝕜 (fun x => x ^ m) x ↔ x ≠ 0 ∨ 0 ≤ m

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{m : ℤ}


/-- The eigenvalue of a primitive vector must be a natural number if the representation is
finite-dimensional. -/
lemma exists_nat [IsNoetherian R M] [NoZeroSMulDivisors R M] [IsDomain R] [CharZero R] :
    ∃ n : ℕ, μ = n

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
{h e f : L}
{m : M}
{μ : R}
{t : IsSl2Triple h e f}
(P : t.HasPrimitiveVectorWith m μ)
[IsNoetherian R M]
[NoZeroSMulDivisors R M]
[IsDomain R]
[CharZero R]


protected lemma Antitone.iInf (hf : ∀ i, Antitone (f i)) : Antitone (⨅ i, f i)

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_9}
[Preorder α]
[CompleteLattice β]
{f : ι → α → β}
(hf : ∀ (i : ι), Antitone (f i))


@[simp]
theorem map_zero : map (0 : M →ₛₗ[σ₁₂] M₂) p = ⊥

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
(p : Submodule R M)
[RingHomSurjective σ₁₂]


theorem inr_apply (x : B) : inr R A B x = (0, x)

{R : Type u}
[Monoid R]
{A : Type v}
{B : Type w}
[NonUnitalNonAssocSemiring A]
[DistribMulAction R A]
[NonUnitalNonAssocSemiring B]
[DistribMulAction R B]
(x : B)


/-- If `R → A → B` is an algebra tower,
then if the entire tower is an integral extension so is `A → B`. -/
theorem IsIntegral.tower_top [Algebra A B] [IsScalarTower R A B] {x : B}
    (hx : IsIntegral R x) : IsIntegral A x

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommRing R]
[CommRing A]
[Ring B]
[Algebra R A]
[Algebra R B]
[Algebra A B]
[IsScalarTower R A B]
{x : B}
(hx : IsIntegral R x)


@[simp]
theorem snd_ofNat (n : ℕ) [n.AtLeastTwo] :
    (no_index (OfNat.ofNat n : α × β)).2 = (OfNat.ofNat n : β)

{α : Type u_1}
{β : Type u_2}
[AddMonoidWithOne α]
[AddMonoidWithOne β]
(n : ℕ)
[n.AtLeastTwo]


/-- The *square* of the Gaussian integral `∫ x:ℝ, exp (-b * x^2)` is equal to `π / b`. -/
theorem integral_gaussian_sq_complex {b : ℂ} (hb : 0 < b.re) :
    (∫ x : ℝ, cexp (-b * (x : ℂ) ^ 2)) ^ 2 = π / b


@[simp]
theorem refl_toHom : (refl L M).toHom = Hom.id L M

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]

(FirstOrder.Language.Equiv.refl L M).toHom = FirstOrder.Language.Hom.id L M


theorem mapBiprod_inv : (mapBiprod F X Y).inv = biprod.desc (F.map biprod.inl) (F.map biprod.inr)

[CategoryTheory.Limits.PreservesBinaryBiproduct X Y F]

(F.mapBiprod X Y).inv =
  CategoryTheory.Limits.biprod.desc (F.map CategoryTheory.Limits.biprod.inl) (F.map CategoryTheory.Limits.biprod.inr)


@[reassoc (attr := simp)]
lemma biprod_inr_fst_f (i : ι) :
    (biprod.inr : L ⟶ K ⊞ L).f i ≫ (biprod.fst : K ⊞ L ⟶ K).f i = 0

[∀ (i : ι), CategoryTheory.Limits.HasBinaryBiproduct (K.X i) (L.X i)]

CategoryTheory.Limits.biprod.inr.f i ≫ CategoryTheory.Limits.biprod.fst.f i = 0


/-- `LocallyConstant.comap` as a `RingHom`. -/
@[simps!]
def comapRingHom [Semiring Z] (f : C(X, Y)) :
    LocallyConstant Y Z →+* LocallyConstant X Z

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{Z : Type u_6}
[Semiring Z]
(f : C(X, Y))
(g : LocallyConstant Y Z)

∀ (a : X), ((LocallyConstant.comapRingHom f) g) a = g (f a)


@[to_additive (attr := simp)]
theorem prod_inv [Zero M] [CommGroup G] {f : α →₀ M} {h : α → M → G} :
    (f.prod fun a b => (h a b)⁻¹) = (f.prod h)⁻¹

{α : Type u_1}
{M : Type u_8}
{G : Type u_12}
[Zero M]
[CommGroup G]
{f : α →₀ M}
{h : α → M → G}


@[mono]
theorem RCond.mono {ι : Type*} {r : (ι → ℝ) → Ioi (0 : ℝ)} (h : l₁ ≤ l₂) (hr : l₂.RCond r) :
    l₁.RCond r

{l₁ l₂ : BoxIntegral.IntegrationParams}
{ι : Type u_2}
{r : (ι → ℝ) → ↑(Set.Ioi 0)}
(h : l₁ ≤ l₂)
(hr : l₂.RCond r)


theorem measurableSet_fiber (f : α →ₛ β) (x : β) : MeasurableSet (f ⁻¹' {x})

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
(f : MeasureTheory.SimpleFunc α β)
(x : β)


theorem cpow_mul {x y : ℂ} (z : ℂ) (h₁ : -π < (log x * y).im) (h₂ : (log x * y).im ≤ π) :
    x ^ (y * z) = (x ^ y) ^ z

{x y : ℂ}
(z : ℂ)
(h₁ : -π < (Complex.log x * y).im)
(h₂ : (Complex.log x * y).im ≤ π)


theorem inv_zpow' {A : M} (h : IsUnit A.det) (n : ℤ) : A⁻¹ ^ n = A ^ (-n)

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


nonrec theorem formPerm_eq_formPerm_iff {α : Type*} [DecidableEq α] {s s' : Cycle α} {hs : s.Nodup}
    {hs' : s'.Nodup} :
    s.formPerm hs = s'.formPerm hs' ↔ s = s' ∨ s.Subsingleton ∧ s'.Subsingleton

{α : Type u_2}
[DecidableEq α]
{s s' : Cycle α}
{hs : s.Nodup}
{hs' : s'.Nodup}


@[simp] theorem mem_filter : x ∈ filter p as ↔ x ∈ as ∧ p x

∀ {α : Type u_1} {x : α} {p : α → Bool} {as : Array α}, x ∈ Array.filter p as 0 ↔ x ∈ as ∧ p x = true


lemma prod_apply (κ : Kernel α β) [IsSFiniteKernel κ] (η : Kernel α γ) [IsSFiniteKernel η]
    (a : α) :
    (κ ×ₖ η) a = (κ a).prod (η a)

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{γ : Type u_4}
{mγ : MeasurableSpace γ}
(κ : ProbabilityTheory.Kernel α β)
[ProbabilityTheory.IsSFiniteKernel κ]
(η : ProbabilityTheory.Kernel α γ)
[ProbabilityTheory.IsSFiniteKernel η]
(a : α)


theorem dvd_iff_dvd_of_dvd_sub (h : a ∣ b - c) : a ∣ b ↔ a ∣ c

{α : Type u_1}
[NonUnitalRing α]
{a b c : α}
(h : a ∣ b - c)


theorem pi_div_two_ne_zero : ((π / 2 : ℝ) : Angle) ≠ 0


theorem exists_not_mem_of_length_lt {α : Type*} (l : List α) (h : ↑l.length < #α) :
    ∃ z : α, z ∉ l

{α : Type u_1}
(l : List α)
(h : ↑l.length < Cardinal.mk α)


@[simp] lemma map₂_coe_right (f : α → β → γ) (a) (b : β) : map₂ f a b = a.map (f · b)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(f : α → β → γ)
(a : WithTop α)
(b : β)

WithTop.map₂ f a ↑b = WithTop.map (fun x => f x b) a


lemma card_mono [NumberField k] [NumberField K] :
    card (InfinitePlace k) ≤ card (InfinitePlace K)

(k : Type u_1)
[Field k]
(K : Type u_2)
[Field K]
[Algebra k K]
[NumberField k]
[NumberField K]

Fintype.card (NumberField.InfinitePlace k) ≤ Fintype.card (NumberField.InfinitePlace K)


/-- A transformation between applicative functors.  It is a natural
transformation such that `app` preserves the `Pure.pure` and
`Functor.map` (`<*>`) operations. See
`ApplicativeTransformation.preserves_map` for naturality. -/
structure ApplicativeTransformation : Type max (u + 1) v w where
  /-- The function on objects defined by an `ApplicativeTransformation`. -/
  app : ∀ α : Type u, F α → G α
  /-- An `ApplicativeTransformation` preserves `pure`. -/
  preserves_pure' : ∀ {α : Type u} (x : α), app _ (pure x) = pure x
  /-- An `ApplicativeTransformation` intertwines `seq`. -/
  preserves_seq' : ∀ {α β : Type u} (x : F (α → β)) (y : F α), app _ (x <*> y) = app _ x <*> app _ y

{F : Type u → Type v}
[Applicative F]
{G : Type u → Type w}
[Applicative G]
(self : ApplicativeTransformation F G)
{α β : Type u}
(x : F (α → β))
(y : F α)

self.app β (Seq.seq x fun x => y) = Seq.seq (self.app (α → β) x) fun x => self.app α y


theorem of_compl (h : NullMeasurableSet sᶜ μ) : NullMeasurableSet s μ

(h : MeasureTheory.NullMeasurableSet sᶜ μ)


/-- The distance on `NonemptyCompacts α` is the Hausdorff distance, by construction -/
theorem NonemptyCompacts.dist_eq {x y : NonemptyCompacts α} :
    dist x y = hausdorffDist (x : Set α) y

{x y : TopologicalSpace.NonemptyCompacts α}


theorem zero_mem_smul_iff :
    (0 : β) ∈ s • t ↔ (0 : α) ∈ s ∧ t.Nonempty ∨ (0 : β) ∈ t ∧ s.Nonempty

{α : Type u_2}
{β : Type u_3}
[Zero α]
[Zero β]
[SMulWithZero α β]
{s : Set α}
{t : Set β}
[NoZeroSMulDivisors α β]

0 ∈ s • t ↔ 0 ∈ s ∧ t.Nonempty ∨ 0 ∈ t ∧ s.Nonempty


theorem neLocus_neg : neLocus (-f) g = f.neLocus (-g)

{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
[(a : α) → DecidableEq (N a)]
[(a : α) → AddGroup (N a)]
(f g : Π₀ (a : α), N a)


theorem cos_add : cos (x + y) = cos x * cos y - sin x * sin y

Complex.cos (x + y) = Complex.cos x * Complex.cos y - Complex.sin x * Complex.sin y


@[simp]
theorem univ_subset_iff {s : Set α} : univ ⊆ s ↔ s = univ


theorem dot_distrib_left (xs ys zs : Coeffs) : (xs + ys).dot zs = xs.dot zs + ys.dot zs


theorem algebraMap_injective (A R B : Type*) [CommRing R] [CommSemiring A] [CommRing B]
    [Algebra R B] [Algebra A B] [IsIntegralClosure A R B] : Function.Injective (algebraMap A B)

(A : Type u_1)
(R : Type u_2)
(B : Type u_3)
[CommRing R]
[CommSemiring A]
[CommRing B]
[Algebra R B]
[Algebra A B]
[IsIntegralClosure A R B]


/--
Cost structure given by a function.
Delete and insert cost the same, and substitution costs the greater value.
-/
@[simps]
def weightCost (f : α → ℕ) : Cost α α ℕ

(Levenshtein.weightCost f).delete a = f a


@[simp]
lemma neg_re_eq_abs {z : ℂ} : -z.re = abs z ↔ z ≤ 0


@[simp]
theorem toQuadraticMap_eq_zero {B : BilinMap R M N} :
    B.toQuadraticMap = 0 ↔ B.IsAlt

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
{B : LinearMap.BilinMap R M N}

B.toQuadraticMap = 0 ↔ LinearMap.IsAlt B


theorem edist_lt_top (hf : LipschitzWith K f) {x y : α} (h : edist x y ≠ ⊤) :
    edist (f x) (f y) < ⊤

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{K : ℝ≥0}
{f : α → β}
(hf : LipschitzWith K f)
{x y : α}
(h : edist x y ≠ ⊤)


/-- The equivalence `(Multiplicative ℤ →* α) ≃ α` for any group `α`. -/
@[simps]
def fromMultiplicativeIntEquiv (α : Type u) [Group α] : (Multiplicative ℤ →* α) ≃ α

(MonoidHom.fromMultiplicativeIntEquiv α).symm x = (zpowersHom α) x


@[to_additive]
lemma not_isCyclic : ¬ IsCyclic G

{G : Type u_1}
[Group G]
[IsKleinFour G]


/-- Right multiplying by an invertible matrix does not change the rank -/
@[simp]
lemma rank_mul_eq_left_of_isUnit_det [DecidableEq n]
    (A : Matrix n n R) (B : Matrix m n R) (hA : IsUnit A.det) :
    (B * A).rank = B.rank

{m : Type u_2}
{n : Type u_3}
{R : Type u_5}
[Fintype n]
[CommRing R]
[DecidableEq n]
(A : Matrix n n R)
(B : Matrix m n R)
(hA : IsUnit A.det)


protected theorem le_or_le (s : Flag α) (ha : a ∈ s) (hb : b ∈ s) : a ≤ b ∨ b ≤ a

{α : Type u_1}
[Preorder α]
{a b : α}
(s : Flag α)
(ha : a ∈ s)
(hb : b ∈ s)


/-- If `p ∤ a`, then `legendreSym p a` is `1` or `-1`. -/
theorem eq_one_or_neg_one {a : ℤ} (ha : (a : ZMod p) ≠ 0) :
    legendreSym p a = 1 ∨ legendreSym p a = -1

(p : ℕ)
[Fact (Nat.Prime p)]
{a : ℤ}
(ha : ↑a ≠ 0)


@[to_additive]
theorem map_inr (s : Submonoid N) : s.map (inr M N) = prod ⊥ s

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

AddSubmonoid.map (AddMonoidHom.inr M N) s = ⊥.prod s


@[norm_cast]
theorem coe_nsmul (n : ℕ) (x : ℝ) : (↑(n • x) : EReal) = n • (x : EReal)


theorem symm_source : e.symm.source = e.target

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


/-- Given an open cover on `X`, we may pull them back along a morphism `W ⟶ X` to obtain
an open cover of `W`. -/
@[simps]
def OpenCover.pullbackCover {X W : Scheme.{u}} (𝒰 : X.OpenCover) (f : W ⟶ X) :
    W.OpenCover

{X W : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)
(f : W ⟶ X)


/-- Class for bundled homs. Note that the arguments order follows that of lemmas for `MonoidHom`.
This way we can use `⟨@MonoidHom.toFun, @MonoidHom.id ...⟩` in an instance. -/
structure BundledHom where
  /-- the underlying map of a bundled morphism -/
  toFun : ∀ {α β : Type u} (Iα : c α) (Iβ : c β), hom Iα Iβ → α → β
  /-- the identity as a bundled morphism -/
  id : ∀ {α : Type u} (I : c α), hom I I
  /-- composition of bundled morphisms -/
  comp : ∀ {α β γ : Type u} (Iα : c α) (Iβ : c β) (Iγ : c γ), hom Iβ Iγ → hom Iα Iβ → hom Iα Iγ
  /-- a bundled morphism is determined by the underlying map -/
  hom_ext : ∀ {α β : Type u} (Iα : c α) (Iβ : c β), Function.Injective (toFun Iα Iβ) := by
   aesop_cat
  /-- compatibility with identities -/
  id_toFun : ∀ {α : Type u} (I : c α), toFun I I (id I) = _root_.id := by aesop_cat
  /-- compatibility with the composition -/
  comp_toFun :
    ∀ {α β γ : Type u} (Iα : c α) (Iβ : c β) (Iγ : c γ) (f : hom Iα Iβ) (g : hom Iβ Iγ),
      toFun Iα Iγ (comp Iα Iβ Iγ g f) = toFun Iβ Iγ g ∘ toFun Iα Iβ f := by
   aesop_cat

{hom : ⦃α β : Type u⦄ → c α → c β → Type u}

self.toFun Iα Iγ (self.comp Iα Iβ Iγ g f) = self.toFun Iβ Iγ g ∘ self.toFun Iα Iβ f


/-- An auxiliary equality useful to prove the **Cauchy–Schwarz inequality**: the square of the norm
of `⟪x, y⟫ • x - ⟪x, x⟫ • y` is equal to `‖x‖ ^ 2 * (‖x‖ ^ 2 * ‖y‖ ^ 2 - ‖⟪x, y⟫‖ ^ 2)`. We use
`InnerProductSpace.ofCore.normSq x` etc (defeq to `is_R_or_C.re ⟪x, x⟫`) instead of `‖x‖ ^ 2`
etc to avoid extra rewrites when applying it to an `InnerProductSpace`. -/
theorem cauchy_schwarz_aux (x y : F) :
    normSqF (⟪x, y⟫ • x - ⟪x, x⟫ • y) = normSqF x * (normSqF x * normSqF y - ‖⟪x, y⟫‖ ^ 2)

{𝕜 : Type u_1}
{F : Type u_3}
[RCLike 𝕜]
[AddCommGroup F]
[Module 𝕜 F]
[c : InnerProductSpace.Core 𝕜 F]
(x y : F)

InnerProductSpace.Core.normSq (⟪x, y⟫_𝕜 • x - ⟪x, x⟫_𝕜 • y) =
  InnerProductSpace.Core.normSq x * (InnerProductSpace.Core.normSq x * InnerProductSpace.Core.normSq y - ‖⟪x, y⟫_𝕜‖ ^ 2)


theorem smaller_factorization (o : Ordinal) :
    (fun (p : smaller C o) ↦ p.1) ∘ (range_equiv_smaller C o).toFun =
    (πs C o) ∘ (fun (p : range (π C (ord I · < o))) ↦ p.1)

{I : Type u}
[LinearOrder I]
[IsWellOrder I fun x x_1 => x < x_1]
(C : Set (I → Bool))
(o : Ordinal.{u})

(fun p => ↑p) ∘ (Profinite.NobelingProof.GoodProducts.range_equiv_smaller C o).toFun =
  ⇑(Profinite.NobelingProof.πs C o) ∘ fun p => ↑p


/-- Subtracting the second vector passed to `oangle` from the first vector then swapping the
vectors does not change the sign of the angle. -/
@[simp]
theorem oangle_sign_sub_left_swap (x y : V) : (o.oangle (x - y) x).sign = (o.oangle x y).sign

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


@[simp] theorem toSpanNonzeroSingleton_apply (t : R) :
    LinearEquiv.toSpanNonzeroSingleton R M x h t =
      (⟨t • x, Submodule.smul_mem _ _ (Submodule.mem_span_singleton_self x)⟩ : R ∙ x)

(R : Type u_1)
(M : Type u_4)
[Ring R]
[AddCommGroup M]
[Module R M]
[NoZeroSMulDivisors R M]
(x : M)
(h : x ≠ 0)
(t : R)

(LinearEquiv.toSpanNonzeroSingleton R M x h) t = ⟨t • x, ⋯⟩


theorem derivative_bernoulli_add_one (k : ℕ) :
    Polynomial.derivative (bernoulli (k + 1)) = (k + 1) * bernoulli k

Polynomial.derivative (Polynomial.bernoulli (k + 1)) = (↑k + 1) * Polynomial.bernoulli k


theorem mono_ae (h : AEDisjoint μ s t) (hu : u ≤ᵐ[μ] s) (hv : v ≤ᵐ[μ] t) : AEDisjoint μ u v

{α : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s t u v : Set α}
(h : MeasureTheory.AEDisjoint μ s t)
(hu : u ≤ᵐ[μ] s)
(hv : v ≤ᵐ[μ] t)


theorem norm_eq {x : ℝ} : ‖(x : UnitAddCircle)‖ = |x - round x|


/-- If `G : C ⥤ D` is cover dense and full, then the
map `(P ⟶ Q) → (G.op ⋙ P ⟶ G.op ⋙ Q)` is bijective when `Q` is a sheaf`. -/
lemma whiskerLeft_obj_map_bijective_of_isCoverDense (G : C ⥤ D)
    [G.IsCoverDense K] [G.IsLocallyFull K] {A : Type*} [Category A]
    (P Q : Dᵒᵖ ⥤ A) (hQ : Presheaf.IsSheaf K Q) :
    Function.Bijective (((whiskeringLeft Cᵒᵖ Dᵒᵖ A).obj G.op).map : (P ⟶ Q) → _)

(K : CategoryTheory.GrothendieckTopology D)

(hQ : CategoryTheory.Presheaf.IsSheaf K Q)

Function.Bijective ((CategoryTheory.whiskeringLeft Cᵒᵖ Dᵒᵖ A).obj G.op).map


@[simp] theorem concat_or_concat (x y : BitVec w) (a b : Bool) :
    (concat x a) ||| (concat y b) = concat (x ||| y) (a || b)

x.concat a ||| y.concat b = (x ||| y).concat (a || b)


theorem _root_.Set.Finite.compl_mem_cofinite {s : Set α} (hs : s.Finite) : sᶜ ∈ @cofinite α

{α : Type u_2}
{s : Set α}
(hs : s.Finite)


@[aesop safe 20 (rule_sets := [Measurable])]
protected theorem inf [SemilatticeInf β] [ContinuousInf β] (hf : AEFinStronglyMeasurable f μ)
    (hg : AEFinStronglyMeasurable g μ) : AEFinStronglyMeasurable (f ⊓ g) μ

(hf : MeasureTheory.AEFinStronglyMeasurable f μ)

(hg : MeasureTheory.AEFinStronglyMeasurable g μ)

MeasureTheory.AEFinStronglyMeasurable (f ⊓ g) μ


/-- A variant of `GradedMonoid.mk_list_dProd` for rewriting in the other direction. -/
theorem GradedMonoid.list_prod_map_eq_dProd (l : List α) (f : α → GradedMonoid A) :
    (l.map f).prod = GradedMonoid.mk _ (l.dProd (fun i => (f i).1) fun i => (f i).2)

{ι : Type u_1}
{α : Type u_2}
{A : ι → Type u_3}
[AddMonoid ι]
[GradedMonoid.GMonoid A]
(l : List α)
(f : α → GradedMonoid A)

(List.map f l).prod =
  GradedMonoid.mk (l.dProdIndex fun i => (f i).fst) (l.dProd (fun i => (f i).fst) fun i => (f i).snd)


theorem le_congr_imp {x₁ y₁ x₂ y₂ : PGame} (hx : x₁ ≈ x₂) (hy : y₁ ≈ y₂) (h : x₁ ≤ y₁) : x₂ ≤ y₂

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


/-- A cone on `F` with cone point `X` is the same as an element of `lim Hom(X, F·)`. -/
@[simps!]
noncomputable def limitCompCoyonedaIsoCone (F : J ⥤ C) (X : C) :
    limit (F ⋙ coyoneda.obj (op X)) ≅ ((const J).obj X ⟶ F)

{J : Type v}
[CategoryTheory.SmallCategory J]
{C : Type u}
[CategoryTheory.Category.{v, u} C]
(F : J ⥤ C)
(X : C)

∀ (a : (CategoryTheory.Functor.const J).obj X ⟶ F),
  (CategoryTheory.Limits.limitCompCoyonedaIsoCone F X).inv a =
    (CategoryTheory.Limits.Types.limitEquivSections (F ⋙ CategoryTheory.coyoneda.obj (Opposite.op X))).symm
      ((CategoryTheory.Limits.compCoyonedaSectionsEquiv F X).symm a)


theorem Memℒp.mono' {f : α → E} {g : α → ℝ} (hg : Memℒp g p μ) (hf : AEStronglyMeasurable f μ)
    (h : ∀ᵐ a ∂μ, ‖f a‖ ≤ g a) : Memℒp f p μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)


@[simp]
theorem swapEquiv_symm : swapEquiv.symm = swapEquiv


{α : Type u_2}
[SemilatticeSup α]
{s : Set α}


@[simp]
theorem image_inter_nonempty_iff {f : α → β} {s : Set α} {t : Set β} :
    (f '' s ∩ t).Nonempty ↔ (s ∩ f ⁻¹' t).Nonempty

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


@[simp]
theorem funLeft_apply (f : m → n) (g : n → M) (i : m) : funLeft R M f g i = g (f i)

(R : Type u_1)
(M : Type u_8)
[Semiring R]
[AddCommMonoid M]
[Module R M]
{m : Type u_17}
{n : Type u_18}
(f : m → n)
(g : n → M)
(i : m)


theorem tendsto_nat_tsum (f : ℕ → ℝ≥0∞) :
    Tendsto (fun n : ℕ => ∑ i ∈ Finset.range n, f i) atTop (𝓝 (∑' n, f n))

(f : ℕ → ℝ≥0∞)

Filter.Tendsto (fun n => ∑ i ∈ Finset.range n, f i) Filter.atTop (𝓝 (∑' (n : ℕ), f n))


/-- **Law of cosines** (cosine rule), vector angle form. -/
theorem norm_sub_sq_eq_norm_sq_add_norm_sq_sub_two_mul_norm_mul_norm_mul_cos_angle (x y : V) :
    ‖x - y‖ * ‖x - y‖ = ‖x‖ * ‖x‖ + ‖y‖ * ‖y‖ - 2 * ‖x‖ * ‖y‖ * Real.cos (angle x y)

{V : Type u_1}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
(x y : V)

‖x - y‖ * ‖x - y‖ = ‖x‖ * ‖x‖ + ‖y‖ * ‖y‖ - 2 * ‖x‖ * ‖y‖ * Real.cos (InnerProductGeometry.angle x y)


@[simp]
theorem conjCLE_coe : conjCLE.toLinearEquiv = conjAe.toLinearEquiv


/-- The opposite isomorphism.
-/
@[simps]
protected def op (α : X ≅ Y) : op Y ≅ op X

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


theorem one_lt_rootMultiplicity_iff_isRoot
    {p : R[X]} {t : R} (h : p ≠ 0) :
    1 < p.rootMultiplicity t ↔ p.IsRoot t ∧ (derivative p).IsRoot t

{R : Type u}
[CommRing R]
{p : R[X]}
{t : R}
(h : p ≠ 0)

1 < Polynomial.rootMultiplicity t p ↔ p.IsRoot t ∧ (Polynomial.derivative p).IsRoot t


@[simp]
theorem preimage_coe_Ioc : (some : α → WithBot α) ⁻¹' Ioc a b = Ioc a b

WithBot.some ⁻¹' Set.Ioc ↑a ↑b = Set.Ioc a b


theorem copy_eq (S : Subalgebra R A) (s : Set A) (hs : s = ↑S) : S.copy s hs = S

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(S : Subalgebra R A)
(s : Set A)
(hs : s = ↑S)


@[to_additive]
theorem prod_hom' [CommMonoid β] (s : Multiset ι) {F : Type*} [FunLike F α β]
    [MonoidHomClass F α β] (f : F)
    (g : ι → α) : (s.map fun i => f <| g i).prod = f (s.map g).prod

{ι : Type u_2}
{α : Type u_3}
{β : Type u_4}
[AddCommMonoid α]
[AddCommMonoid β]
(s : Multiset ι)
{F : Type u_6}
[FunLike F α β]
[AddMonoidHomClass F α β]
(f : F)
(g : ι → α)

(Multiset.map (fun i => f (g i)) s).sum = f (Multiset.map g s).sum


@[to_additive]
lemma prod_prod_Ioi_mul_eq_prod_prod_off_diag (f : α → α → M) :
    ∏ i, ∏ j ∈ Ioi i, f j i * f i j = ∏ i, ∏ j ∈ {i}ᶜ, f j i

{α : Type u_1}
{M : Type u_2}
[Fintype α]
[LinearOrder α]
[LocallyFiniteOrderTop α]
[LocallyFiniteOrderBot α]
[CommMonoid M]
(f : α → α → M)

∏ i : α, ∏ j ∈ Finset.Ioi i, f j i * f i j = ∏ i : α, ∏ j ∈ {i}ᶜ, f j i


theorem Injective.prodMap (hf : Injective f) (hg : Injective g) : Injective (map f g)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{δ : Type u_4}
{f : α → γ}
{g : β → δ}
(hf : Function.Injective f)
(hg : Function.Injective g)


/-- A version of `Finset.inf'_image` 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_image [DecidableEq β] {s : Finset γ} {f : γ → β} (hs : s.Nonempty) (g : β → α) :
    s.inf' hs (g ∘ f) = (s.image f).inf' (hs.image f) g

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

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


theorem nth_of_forall_not {n : ℕ} (hp : ∀ n' ≥ n, ¬p n') : nth p n = 0

{p : ℕ → Prop}
{n : ℕ}
(hp : ∀ n' ≥ n, ¬p n')


theorem measurable_of_restrict_of_restrict_compl {f : α → β} {s : Set α} (hs : MeasurableSet s)
    (h₁ : Measurable (s.restrict f)) (h₂ : Measurable (sᶜ.restrict f)) : Measurable f

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{mβ : MeasurableSpace β}
{f : α → β}
{s : Set α}
(hs : MeasurableSet s)
(h₁ : Measurable (s.restrict f))
(h₂ : Measurable (sᶜ.restrict f))


lemma schnirelmannDensity_le_one : schnirelmannDensity A ≤ 1

{A : Set ℕ}
[DecidablePred fun x => x ∈ A]


/--
If a set `s : Set α` is in `fixedBy (Set α) g`, then all points of `s` will stay in `s` after being
moved by `g`.
-/
@[to_additive "If a set `s : Set α` is in `fixedBy (Set α) g`, then all points of `s` will stay in
`s` after being moved by `g`."]
theorem set_mem_fixedBy_iff (s : Set α) (g : G) :
    s ∈ fixedBy (Set α) g ↔ ∀ x, g • x ∈ s ↔ x ∈ s

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

s ∈ MulAction.fixedBy (Set α) g ↔ ∀ (x : α), g • x ∈ s ↔ x ∈ s


@[to_additive (attr := simp)]
lemma mulEnergy_univ_right : Eₘ[s, univ] = Fintype.card α * s.card ^ 2

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

s.addEnergy Finset.univ = Fintype.card α * s.card ^ 2


/-- If a normed space is non-trivial, then the norm of the identity equals `1`. -/
theorem norm_id {V : Type*} [NormedAddCommGroup V] [Nontrivial V] : ‖id V‖ = 1

{V : Type u_5}
[NormedAddCommGroup V]
[Nontrivial V]


@[simp]
lemma mapₐ_apply (f : A →ₐ[R] B) (a : A) [Away a Aₚ] [Away (f a) Bₚ] (x : Aₚ) :
    mapₐ Aₚ Bₚ f a x = map Aₚ Bₚ f.toRingHom a x

{R : Type u_1}
[CommSemiring R]
{A : Type u_5}
[CommRing A]
[Algebra R A]
{B : Type u_6}
[CommRing B]
[Algebra R B]
(Aₚ : Type u_7)
[CommRing Aₚ]
[Algebra A Aₚ]
[Algebra R Aₚ]
[IsScalarTower R A Aₚ]
(Bₚ : Type u_8)
[CommRing Bₚ]
[Algebra B Bₚ]
[Algebra R Bₚ]
[IsScalarTower R B Bₚ]
(f : A →ₐ[R] B)
(a : A)
[IsLocalization.Away a Aₚ]
[IsLocalization.Away (f a) Bₚ]
(x : Aₚ)

(IsLocalization.Away.mapₐ Aₚ Bₚ f a) x = (IsLocalization.Away.map Aₚ Bₚ f.toRingHom a) x


/-- Given finite sets `s` and `t`, the product of `f i` over `i ∈ s ∪ t` times the product of
`f i` over `i ∈ s ∩ t` equals the product of `f i` over `i ∈ s` times the product of `f i`
over `i ∈ t`. -/
@[to_additive
      "Given finite sets `s` and `t`, the sum of `f i` over `i ∈ s ∪ t` plus the sum of
      `f i` over `i ∈ s ∩ t` equals the sum of `f i` over `i ∈ s` plus the sum of `f i`
      over `i ∈ t`."]
theorem finprod_mem_union_inter (hs : s.Finite) (ht : t.Finite) :
    ((∏ᶠ i ∈ s ∪ t, f i) * ∏ᶠ i ∈ s ∩ t, f i) = (∏ᶠ i ∈ s, f i) * ∏ᶠ i ∈ t, f i

{α : Type u_1}
{M : Type u_5}
[CommMonoid M]
{f : α → M}
{s t : Set α}
(hs : s.Finite)
(ht : t.Finite)

(∏ᶠ (i : α) (_ : i ∈ s ∪ t), f i) * ∏ᶠ (i : α) (_ : i ∈ s ∩ t), f i =
  (∏ᶠ (i : α) (_ : i ∈ s), f i) * ∏ᶠ (i : α) (_ : i ∈ t), f i


@[to_additive]
theorem mulTSupport_extend_one (inj : g.Injective) :
    mulTSupport (g.extend f 1) = g '' mulTSupport f

{α : Type u_2}
{α' : Type u_3}
{β : Type u_4}
[TopologicalSpace α]
[TopologicalSpace α']
[Zero β]
{f : α → β}
[T2Space α']
(hf : HasCompactSupport f)
{g : α → α'}
(cont : Continuous g)
(inj : Function.Injective g)

tsupport (Function.extend g f 0) = g '' tsupport f


@[to_additive]
theorem one_div_div : 1 / (a / b) = b / a

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


protected theorem _root_.AntitoneOn.monotone (h : AntitoneOn f s) :
    Antitone (f ∘ Subtype.val : s → β)

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


lemma exists_eq_natCast_of_iSup_eq {ι : Type u} [Nonempty ι] (f : ι → Cardinal.{v})
    (hf : BddAbove (range f)) (n : ℕ) (h : ⨆ i, f i = n) : ∃ i, f i = n

{ι : Type u}
[Nonempty ι]
(f : ι → Cardinal.{v})
(hf : BddAbove (Set.range f))
(n : ℕ)
(h : ⨆ i, f i = ↑n)


@[simp]
theorem norm_smulRight (f : ContinuousMultilinearMap 𝕜 E 𝕜) (z : G) :
    ‖f.smulRight z‖ = ‖f‖ * ‖z‖

[(i : ι) → SeminormedAddCommGroup (E i)]


/-- Schur's Lemma: the dimension of the `Hom`-space between two irreducible representation is `0` if
they are not isomorphic, and `1` if they are. -/
theorem finrank_hom_simple_simple [IsAlgClosed k] (V W : FDRep k G) [Simple V] [Simple W] :
    finrank k (V ⟶ W) = if Nonempty (V ≅ W) then 1 else 0

{k G : Type u}
[Field k]
[Monoid G]
[IsAlgClosed k]
(V W : FDRep k G)
[CategoryTheory.Simple V]
[CategoryTheory.Simple W]

FiniteDimensional.finrank k (V ⟶ W) = if Nonempty (V ≅ W) then 1 else 0


theorem neg_congr {a b : Int} (h₁ : a = b) : -a = -b


theorem not_isNilpotent_one [MonoidWithZero R] [Nontrivial R] :
    ¬ IsNilpotent (1 : R)

{R : Type u_1}
[MonoidWithZero R]
[Nontrivial R]


/-- This is the Fitting decomposition of the module `M` with respect to the endomorphism `f`.

See also `LinearMap.isCompl_iSup_ker_pow_iInf_range_pow` for an alternative spelling. -/
theorem eventually_isCompl_ker_pow_range_pow [IsNoetherian R M] (f : M →ₗ[R] M) :
    ∀ᶠ n in atTop, IsCompl (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n))

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
[IsArtinian R M]
[IsNoetherian R M]
(f : M →ₗ[R] M)

∀ᶠ (n : ℕ) in Filter.atTop, IsCompl (LinearMap.ker (f ^ n)) (LinearMap.range (f ^ n))


theorem Prime.dvd_finsupp_prod_iff {f : α →₀ M} {g : α → M → ℕ} {p : ℕ} (pp : Prime p) :
    p ∣ f.prod g ↔ ∃ a ∈ f.support, p ∣ g a (f a)

{α : Type u_1}
{M : Type u_5}
[CommMonoidWithZero M]
{f : α →₀ M}
{g : α → M → ℕ}
{p : ℕ}
(pp : Prime p)


@[continuity, fun_prop]
theorem Continuous.sup [Sup L] [ContinuousSup L] {f g : X → L} (hf : Continuous f)
    (hg : Continuous g) : Continuous fun x => f x ⊔ g x

{L : Type u_1}
{X : Type u_2}
[TopologicalSpace L]
[TopologicalSpace X]
[Sup L]
[ContinuousSup L]
{f g : X → L}
(hf : Continuous f)
(hg : Continuous g)


@[to_additive (attr := measurability)]
protected theorem const_smul' {𝕜} [SMul 𝕜 β] [ContinuousConstSMul 𝕜 β] (hf : StronglyMeasurable f)
    (c : 𝕜) : StronglyMeasurable fun x => c • f x

(hf : MeasureTheory.StronglyMeasurable f)

MeasureTheory.StronglyMeasurable fun x => c • f x


/-- The new distance is continuous. -/
protected theorem continuous_dist [TopologicalSpace β] {f g : β → Completion α} (hf : Continuous f)
    (hg : Continuous g) : Continuous fun x ↦ dist (f x) (g x)

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[TopologicalSpace β]
{f g : β → UniformSpace.Completion α}
(hf : Continuous f)
(hg : Continuous g)


/-- If a short complex `S` has a splitting and `F` is an additive functor, then
`S.map F` also has a splitting. -/
@[simps]
def map (s : S.Splitting) (F : C ⥤ D) [F.Additive] : (S.map F).Splitting

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
[CategoryTheory.Preadditive C]
[CategoryTheory.Preadditive D]
{S : CategoryTheory.ShortComplex C}
(s : S.Splitting)
(F : CategoryTheory.Functor C D)
[F.Additive]


@[to_additive (attr := simp)]
lemma inv_left_iff : Commute a⁻¹ b ↔ Commute a b


protected theorem zero_ne_one : (0 : Int) ≠ 1


protected theorem IsCompact.totallyBounded {s : Set α} (h : IsCompact s) : TotallyBounded s

{α : Type u}
[uniformSpace : UniformSpace α]
{s : Set α}
(h : IsCompact s)


@[simp]
theorem toIcoMod_add_right (a b : α) : toIcoMod hp a (b + p) = toIcoMod hp a b

{α : Type u_1}
[LinearOrderedAddCommGroup α]
[hα : Archimedean α]
{p : α}
(hp : 0 < p)
(a b : α)


/-- A monoid object as a module over itself. -/
@[simps]
def regular : Mod_ A

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


protected theorem measurableSet_gt' (hτ : IsStoppingTime f τ) (i : ι) :
    MeasurableSet[hτ.measurableSpace] {ω | i < τ ω}

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[LinearOrder ι]
{f : MeasureTheory.Filtration ι m}
{τ : Ω → ι}
(hτ : MeasureTheory.IsStoppingTime f τ)
(i : ι)


theorem isRoot_iterate_derivative_of_lt_rootMultiplicity {p : R[X]} {t : R} {n : ℕ}
    (hn : n < p.rootMultiplicity t) : (derivative^[n] p).IsRoot t

(hn : n < Polynomial.rootMultiplicity t p)


theorem pi_Iio_mem_nhds' (ha : ∀ i, x' i < a' i) : Iio a' ∈ 𝓝 x'

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{ι : Type u_1}
[Finite ι]
{a' x' : ι → α}
[Nonempty ι]
(ha : ∀ (i : ι), x' i < a' i)


@[simp]
theorem Fintype.card_orderDual (α : Type*) [Fintype α] : Fintype.card αᵒᵈ = Fintype.card α


theorem constr_self (f : M →ₗ[R] M') : (constr (M' := M') b S fun i => f (b i)) = f

{ι : Type u_1}
{R : Type u_3}
{M : Type u_6}
{M' : Type u_7}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid M']
[Module R M']
(b : Basis ι R M)
(S : Type u_10)
[Semiring S]
[Module S M']
[SMulCommClass R S M']
(f : M →ₗ[R] M')


@[to_additive (attr := simp)]
theorem toEquiv_eq_coe (f : M ≃* N) : f.toEquiv = f

{M : Type u_6}
{N : Type u_7}
[Mul M]
[Mul N]
(f : M ≃* N)


theorem single_swap (a₁ a₂ : α) (b : M) : single a₁ b a₂ = single a₂ b a₁

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

(Finsupp.single a₁ b) a₂ = (Finsupp.single a₂ b) a₁


@[simp] theorem zero_fmod (b : Int) : fmod 0 b = 0


/-- A Lie ring module is an additive group, together with an additive action of a
Lie ring on this group, such that the Lie bracket acts as the commutator of endomorphisms.
(For representations of Lie *algebras* see `LieModule`.) -/
class LieRingModule (L : Type v) (M : Type w) [LieRing L] [AddCommGroup M] extends Bracket L M where
  /-- A Lie ring module bracket is additive in its first component. -/
  protected add_lie : ∀ (x y : L) (m : M), ⁅x + y, m⁆ = ⁅x, m⁆ + ⁅y, m⁆
  /-- A Lie ring module bracket is additive in its second component. -/
  protected lie_add : ∀ (x : L) (m n : M), ⁅x, m + n⁆ = ⁅x, m⁆ + ⁅x, n⁆
  /-- A Lie ring module bracket satisfies a Leibniz / Jacobi identity. -/
  protected leibniz_lie : ∀ (x y : L) (m : M), ⁅x, ⁅y, m⁆⁆ = ⁅⁅x, y⁆, m⁆ + ⁅y, ⁅x, m⁆⁆

{L : Type v}
{M : Type w}
[LieRing L]
[AddCommGroup M]
[self : LieRingModule L M]
(x y : L)
(m : M)


@[simp]
theorem diffToIdealOfQuotientCompEq_apply (f₁ f₂ : A →ₐ[R] B)
    (e : (Ideal.Quotient.mkₐ R I).comp f₁ = (Ideal.Quotient.mkₐ R I).comp f₂) (x : A) :
    ((diffToIdealOfQuotientCompEq I f₁ f₂ e) x : B) = f₁ x - f₂ x

↑((diffToIdealOfQuotientCompEq I f₁ f₂ e) x) = f₁ x - f₂ x


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


theorem div_wf_lemma (h : degree q ≤ degree p ∧ p ≠ 0) (hq : Monic q) :
    degree (p - q * (C (leadingCoeff p) * X ^ (natDegree p - natDegree q))) < degree p

{R : Type u}
[Ring R]
{p q : R[X]}
(h : q.degree ≤ p.degree ∧ p ≠ 0)
(hq : q.Monic)

(p - q * (Polynomial.C p.leadingCoeff * Polynomial.X ^ (p.natDegree - q.natDegree))).degree < p.degree


theorem symmDiff_assoc : a ∆ b ∆ c = a ∆ (b ∆ c)

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


/-- This is not a simp lemma, since we usually want simp to keep `starRingEnd` bundled.
 For example, for complex conjugation, we don't want simp to turn `conj x`
 into the bare function `star x` automatically since most lemmas are about `conj x`. -/
theorem starRingEnd_apply (x : R) : starRingEnd R x = star x

{R : Type u}
[CommSemiring R]
[StarRing R]
(x : R)


@[simp, norm_cast]
theorem toMeasure_smul (c : R) (μ : FiniteMeasure Ω) : ↑(c • μ) = c • (μ : Measure Ω)

{Ω : Type u_1}
[MeasurableSpace Ω]
{R : Type u_2}
[SMul R ℝ≥0]
[SMul R ℝ≥0∞]
[IsScalarTower R ℝ≥0 ℝ≥0∞]
[IsScalarTower R ℝ≥0∞ ℝ≥0∞]
(c : R)
(μ : MeasureTheory.FiniteMeasure Ω)

↑(c • μ) = c • ↑μ


theorem mem_ofPolynomial (x) : x ∈ I.ofPolynomial ↔ x ∈ I

{R : Type u}
[Semiring R]
{I : Ideal R[X]}
(x : R[X])


lemma auxbound2 (c : ℝ) {d : ℝ} (hd : 1 ≤ d ^ 2) : r z ≤ Complex.abs (c * z + d)

EisensteinSeries.r z ≤ Complex.abs (↑c * ↑z + ↑d)


theorem concat_perm (l : List α) (a : α) : concat l a ~ a :: l


lemma rexp_neg_quadratic_isLittleO_rpow_atTop {a : ℝ} (ha : a < 0) (b s : ℝ) :
    (fun x ↦ rexp (a * x ^ 2 + b * x)) =o[atTop] (· ^ s)

(fun x => rexp (a * x ^ 2 + b * x)) =o[Filter.atTop] fun x => x ^ s


@[simp] theorem get_push_eq (a : Array α) (x : α) : (a.push x)[a.size] = x


theorem codisjoint_hnot_right : Codisjoint a (￢a)

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


@[simp]
theorem linearIsometryBoundedOfCompact_toIsometryEquiv :
    (linearIsometryBoundedOfCompact α E 𝕜).toIsometryEquiv = isometryEquivBoundedOfCompact α E

{α : Type u_1}
{E : Type u_3}
[TopologicalSpace α]
[CompactSpace α]
[NormedAddCommGroup E]
{𝕜 : Type u_4}
[NormedField 𝕜]
[NormedSpace 𝕜 E]

(ContinuousMap.linearIsometryBoundedOfCompact α E 𝕜).toIsometryEquiv = ContinuousMap.isometryEquivBoundedOfCompact α E


@[simp]
theorem bot_coprod (l : Filter β) : (⊥ : Filter α).coprod l = comap Prod.snd l

{α : Type u_1}
{β : Type u_2}
(l : Filter β)


@[simp]
theorem one_ascFactorial : ∀ (k : ℕ), (1 : ℕ).ascFactorial k = k.factorial


theorem nth_le_nth (hf : (setOf p).Infinite) {k n} : nth p k ≤ nth p n ↔ k ≤ n

{p : ℕ → Prop}
(hf : (setOf p).Infinite)
{k n : ℕ}


theorem getElem?_take_eq_none {l : List α} {n m : Nat} (h : n ≤ m) :
    (l.take n)[m]? = none

{α : Type u_1}
{l : List α}
{n m : Nat}
(h : n ≤ m)


@[to_additive (attr := simp)]
theorem toDual_one [One α] : toDual (1 : α) = 1


@[simp]
theorem if_false_right [h : Decidable p] :
    ite p q False ↔ p ∧ q


lemma exists_isCartanSubalgebra_engel [Infinite K] :
    ∃ x : L, IsCartanSubalgebra (engel K x)

(K : Type u_1)
(L : Type u_2)
[Field K]
[LieRing L]
[LieAlgebra K L]
[Module.Finite K L]
[Infinite K]

∃ x, (LieSubalgebra.engel K x).IsCartanSubalgebra


@[simp]
theorem submatrix_zero [Zero α] :
    ((0 : Matrix m n α).submatrix : (l → m) → (o → n) → Matrix l o α) = 0

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
[Zero α]


theorem rel_replicate_right {m : Multiset α} {a : α} {r : α → α → Prop} {n : ℕ} :
    m.Rel r (replicate n a) ↔ card m = n ∧ ∀ x, x ∈ m → r x a

{α : Type u_1}
{m : Multiset α}
{a : α}
{r : α → α → Prop}
{n : ℕ}

Multiset.Rel r m (Multiset.replicate n a) ↔ Multiset.card m = n ∧ ∀ x ∈ m, r x a


lemma subtype_apply (L : Sublattice α) (a : L) : L.subtype a = a

{α : Type u_2}
[Lattice α]
(L : Sublattice α)
(a : ↥L)


lemma infClosed_sInter (hS : ∀ s ∈ S, InfClosed s) : InfClosed (⋂₀ S)

{α : Type u_2}
[SemilatticeInf α]
{S : Set (Set α)}
(hS : ∀ s ∈ S, InfClosed s)


@[simp, mfld_simps]
theorem coe_chartAt_symm_fst (p : H × E) (q : TM) :
    ((chartAt (ModelProd H E) q).symm p).1 = ((chartAt H q.1).symm : H → M) p.1

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

(↑(chartAt (ModelProd H E) q).symm p).proj = ↑(chartAt H q.proj).symm p.1


lemma predAbove_right_monotone (p : Fin n) : Monotone p.predAbove


theorem mk_coe (carrier) (presheaf) :
    (({ carrier
        presheaf } : PresheafedSpace C) : TopCat) = carrier

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
(carrier : TopCat)
(presheaf : TopCat.Presheaf C carrier)

↑{ carrier := carrier, presheaf := presheaf } = carrier


theorem kronecker_diagonal [MulZeroClass α] [DecidableEq n] (A : Matrix l m α) (b : n → α) :
    A ⊗ₖ diagonal b = blockDiagonal fun i => A <• b i

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

Matrix.kroneckerMap (fun x x_1 => x * x_1) A (Matrix.diagonal b) =
  Matrix.blockDiagonal fun i => MulOpposite.op (b i) • A


lemma adjoinRootXPowSubCEquiv_root :
    adjoinRootXPowSubCEquiv hζ H hα (root _) = α

(H : Irreducible (Polynomial.X ^ n - Polynomial.C a))

[Polynomial.IsSplittingField K L (Polynomial.X ^ n - Polynomial.C a)]

(adjoinRootXPowSubCEquiv hζ H hα) (AdjoinRoot.root (Polynomial.X ^ n - Polynomial.C a)) = α


/-- The hitting time of a discrete process with the starting time indexed by a stopping time
is a stopping time. -/
theorem isStoppingTime_hitting_isStoppingTime [ConditionallyCompleteLinearOrder ι]
    [IsWellOrder ι (· < ·)] [Countable ι] [TopologicalSpace ι] [OrderTopology ι]
    [FirstCountableTopology ι] [TopologicalSpace β] [PseudoMetrizableSpace β] [MeasurableSpace β]
    [BorelSpace β] {f : Filtration ι m} {u : ι → Ω → β} {τ : Ω → ι} (hτ : IsStoppingTime f τ)
    {N : ι} (hτbdd : ∀ x, τ x ≤ N) {s : Set β} (hs : MeasurableSet s) (hf : Adapted f u) :
    IsStoppingTime f fun x => hitting u s (τ x) N x

{u : ι → Ω → β}

MeasureTheory.IsStoppingTime f fun x => MeasureTheory.hitting u s (τ x) N x


@[simp]
theorem colimit.cocone_ι {F : J ⥤ C} [HasColimit F] (j : J) :
    (colimit.cocone F).ι.app j = colimit.ι _ j

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{F : J ⥤ C}
[CategoryTheory.Limits.HasColimit F]
(j : J)

(CategoryTheory.Limits.colimit.cocone F).ι.app j = CategoryTheory.Limits.colimit.ι F j


theorem ConvexOn.convex_strict_epigraph (hf : ConvexOn 𝕜 s f) :
    Convex 𝕜 { p : E × β | p.1 ∈ s ∧ f p.1 < p.2 }

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedCancelAddCommMonoid β]
[Module 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : ConvexOn 𝕜 s f)


theorem dist_add_add_left (k n m : ℕ) : dist (k + n) (k + m) = dist n m


lemma bit_val (b n) : bit b n = 2 * n + cond b 1 0

Nat.bit b n = 2 * n + bif b then 1 else 0


protected lemma div_mul_div_le (a b c d : ℕ) :
    (a / b) * (c / d) ≤ (a * c) / (b * d)


theorem finiteType_ofLocalizationSpan : RingHom.OfLocalizationSpan @RingHom.FiniteType


@[simp]
theorem pairwiseDisjoint_empty : (∅ : Set ι).PairwiseDisjoint f

{α : Type u_1}
{ι : Type u_4}
[PartialOrder α]
[OrderBot α]
{f : ι → α}


lemma iCondIndepFun_iff {β : ι → Type*}
    (m : ∀ x : ι, MeasurableSpace (β x)) (f : ∀ x : ι, Ω → β x) (hf : ∀ i, Measurable (f i))
    (μ : Measure Ω) [IsFiniteMeasure μ] :
    iCondIndepFun m' hm' m f μ
      ↔ ∀ (s : Finset ι) {g : ι → Set Ω} (_H : ∀ i, i ∈ s → MeasurableSet[(m i).comap (f i)] (g i)),
      μ⟦⋂ i ∈ s, g i | m'⟧ =ᵐ[μ] ∏ i ∈ s, (μ⟦g i | m'⟧)

{Ω : Type u_1}
{ι : Type u_2}
(m' : MeasurableSpace Ω)
{mΩ : MeasurableSpace Ω}
[StandardBorelSpace Ω]
[Nonempty Ω]
(hm' : m' ≤ mΩ)
{β : ι → Type u_3}
(m : (x : ι) → MeasurableSpace (β x))
(f : (x : ι) → Ω → β x)
(hf : ∀ (i : ι), Measurable (f i))
(μ : MeasureTheory.Measure Ω)
[MeasureTheory.IsFiniteMeasure μ]

ProbabilityTheory.iCondIndepFun m' hm' m f μ ↔
  ∀ (s : Finset ι) {g : ι → Set Ω},
    (∀ i ∈ s, MeasurableSet (g i)) →
      μ[(⋂ i ∈ s, g i).indicator fun ω => 1|m'] =ᵐ[μ] ∏ i ∈ s, μ[(g i).indicator fun ω => 1|m']


@[simp]
theorem coe_insert [MeasurableSingletonClass α] (a : α)
    (s : Subtype (MeasurableSet : Set α → Prop)) :
    ↑(Insert.insert a s) = (Insert.insert a s : Set α)

{α : Type u_1}
[MeasurableSpace α]
[MeasurableSingletonClass α]
(a : α)
(s : Subtype MeasurableSet)


/-- If A is an algebraic algebra over K, then A is algebraic over L when L is an extension of K -/
theorem Algebra.IsAlgebraic.tower_top [Algebra.IsAlgebraic K A] : Algebra.IsAlgebraic L A

{K : Type u_1}
(L : Type u_2)
{A : Type u_5}
[Field K]
[Field L]
[Ring A]
[Algebra K L]
[Algebra L A]
[Algebra K A]
[IsScalarTower K L A]
[Algebra.IsAlgebraic K A]


@[to_additive (attr := simp) prod_apply]
theorem prod_apply (f : M →* N) (g : M →* P) (x) : f.prod g x = (f x, g x)

{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[AddZeroClass M]
[AddZeroClass N]
[AddZeroClass P]
(f : M →+ N)
(g : M →+ P)
(x : M)


theorem toTopsp_isTopologicalBasis (F : Ctop α σ) :
    @TopologicalSpace.IsTopologicalBasis _ F.toTopsp (Set.range F.f)

{α : Type u_1}
{σ : Type u_3}
(F : Ctop α σ)


@[simp]
theorem inter_singleton_of_not_mem {a : α} {s : Finset α} (h : a ∉ s) : s ∩ {a} = ∅

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


protected theorem prod_fst : LipschitzWith 1 (@Prod.fst α β)

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]


theorem WithTop.sInf_eq [InfSet α] {s : Set (WithTop α)} (hs : ¬s ⊆ {⊤}) (h's : BddBelow s) :
    sInf s = ↑(sInf ((↑) ⁻¹' s) : α)

{α : Type u_1}
[Preorder α]
[InfSet α]
{s : Set (WithTop α)}
(hs : ¬s ⊆ {⊤})
(h's : BddBelow s)


@[simp]
theorem ball_zero' (x : E) (hr : 0 < r) : ball (0 : Seminorm 𝕜 E) x r = Set.univ

{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddCommGroup E]
[SMul 𝕜 E]
{r : ℝ}
(x : E)
(hr : 0 < r)


/-- The category of binary bicones on a given diagram. -/
@[simps]
instance BinaryBicone.category {P Q : C} : Category (BinaryBicone P Q)

(B : CategoryTheory.Limits.BinaryBicone P Q)


protected theorem LinearMap.hasDerivAtFilter : HasDerivAtFilter e (e 1) x L

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{x : 𝕜}
{L : Filter 𝕜}
(e : 𝕜 →ₗ[𝕜] F)


theorem sub_mem_Ioo_iff_right : a - b ∈ Set.Ioo c d ↔ b ∈ Set.Ioo (a - d) (a - c)

{α : Type u_1}
[OrderedAddCommGroup α]
{a b c d : α}


theorem toList_sorted (s : CompositionSeries X) : s.toList.Sorted (· < ·)

{X : Type u}
[Lattice X]
[JordanHolderLattice X]
(s : CompositionSeries X)

List.Sorted (fun x x_1 => x < x_1) (RelSeries.toList s)


theorem coe_def : ⇑f = indicator (chartAt H c).source (f.toContDiffBump ∘ extChartAt I c)

{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{c : M}
(f : SmoothBumpFunction I c)

↑f = (chartAt H c).source.indicator (↑f.toContDiffBump ∘ ↑(extChartAt I c))


theorem isReduced_of_isAffine_isReduced [IsAffine X] [_root_.IsReduced Γ(X, ⊤)] :
    IsReduced X

[IsReduced ↑(X.presheaf.obj (Opposite.op ⊤))]


@[simp]
theorem mk_coe (z : ℍ) (h : 0 < (z : ℂ).im := z.2) : mk z h = z


theorem pos_denom (x) : 0 < expNegInvGlue x + expNegInvGlue (1 - x)


/-- The minimal distance to a set (as `ℝ≥0`) is uniformly continuous in point -/
theorem uniformContinuous_infNndist_pt (s : Set α) : UniformContinuous fun x => infNndist x s

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

UniformContinuous fun x => Metric.infNndist x s


/-- The `n`-th Fréchet derivative applied to a vector `(m 0, ..., m (n-1))` is the derivative
multiplied by the product of the `m i`s. -/
theorem iteratedFDerivWithin_apply_eq_iteratedDerivWithin_mul_prod {m : Fin n → 𝕜} :
    (iteratedFDerivWithin 𝕜 n f s x : (Fin n → 𝕜) → F) m =
      (∏ i, m i) • iteratedDerivWithin n f s x

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

(iteratedFDerivWithin 𝕜 n f s x) m = (∏ i : Fin n, m i) • iteratedDerivWithin n f s x


@[symm]
theorem Disjoint.symm : Disjoint f g → Disjoint g f


/-- In a compact T₂ space, the connected component of a point equals the intersection of all
its clopen neighbourhoods. -/
theorem connectedComponent_eq_iInter_isClopen [T2Space X] [CompactSpace X] (x : X) :
    connectedComponent x = ⋂ s : { s : Set X // IsClopen s ∧ x ∈ s }, s

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


/-- Two uncountable algebraically closed fields of characteristic zero are isomorphic
if they have the same cardinality. -/
theorem ringEquivOfCardinalEqOfCharZero [CharZero K] [CharZero L] (hK : ℵ₀ < #K)
    (hKL : #K = #L) : Nonempty (K ≃+* L)

{K L : Type}
[Field K]
[Field L]
[IsAlgClosed K]
[IsAlgClosed L]
[CharZero K]
[CharZero L]
(hK : ℵ₀ < #K)
(hKL : #K = #L)


protected theorem zsmul_mem {x : K} (hx : x ∈ s) (n : ℤ) : n • x ∈ s

{K : Type u}
[DivisionRing K]
(s : Subfield K)
{x : K}
(hx : x ∈ s)
(n : ℤ)


/-- If `x : L` is a root of `minpoly K y`, then we can find `(σ : L ≃ₐ[K] L)` with `σ y = x`.
  That is, `x` and `y` are Galois conjugates. -/
theorem exists_algEquiv_of_root' [Normal K L]{x y : L} (hy : IsAlgebraic K y)
    (h_ev : (Polynomial.aeval x) (minpoly K y) = 0) : ∃ σ : L ≃ₐ[K] L, σ y = x


theorem SuperpolynomialDecay.add [ContinuousAdd β] (hf : SuperpolynomialDecay l k f)
    (hg : SuperpolynomialDecay l k g) : SuperpolynomialDecay l k (f + g)

(hf : Asymptotics.SuperpolynomialDecay l k f)

(hg : Asymptotics.SuperpolynomialDecay l k g)

Asymptotics.SuperpolynomialDecay l k (f + g)


theorem countable_iInter_mem [Countable ι] {s : ι → Set α} : (⋂ i, s i) ∈ l ↔ ∀ i, s i ∈ l

{ι : Sort u_1}
{α : Type u_2}
{l : Filter α}
[CountableInterFilter l]
[Countable ι]
{s : ι → Set α}


/-- Every pair `![c, d]` of coprime integers is the "bottom_row" of some element `g=[[*,*],[c,d]]`
of `SL(2,ℤ)`. -/
theorem bottom_row_surj {R : Type*} [CommRing R] :
    Set.SurjOn (fun g : SL(2, R) => (↑g : Matrix (Fin 2) (Fin 2) R) 1) Set.univ
      {cd | IsCoprime (cd 0) (cd 1)}

Set.SurjOn (fun g => ↑g 1) Set.univ {cd | IsCoprime (cd 0) (cd 1)}


@[simp]
theorem embDomain_image : s.embDomain f (f a) = s a

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[AddCommMonoid R]
{α : Type u_3}
{β : Type u_4}
(s : HahnSeries.SummableFamily Γ R α)
(f : α ↪ β)
{a : α}


lemma totalDegree_finsetSum_le {ι : Type*} {s : Finset ι} {f : ι → MvPolynomial σ R} {d : ℕ}
    (hf : ∀ i ∈ s, (f i).totalDegree ≤ d) : (s.sum f).totalDegree ≤ d

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
{ι : Type u_3}
{s : Finset ι}
{f : ι → MvPolynomial σ R}
{d : ℕ}
(hf : ∀ i ∈ s, (f i).totalDegree ≤ d)


theorem dense_compl_of_dimH_lt_finrank {s : Set E} (hs : dimH s < finrank ℝ E) : Dense sᶜ

(hs : dimH s < ↑(FiniteDimensional.finrank ℝ E))


@[simp]
protected theorem le_min_iff {m : WithTop α} {s : Finset α} : m ≤ s.min ↔ ∀ a ∈ s, m ≤ a

{α : Type u_2}
[LinearOrder α]
{m : WithTop α}
{s : Finset α}


theorem coe_nonempty {s : Closeds α} : (s : Set α).Nonempty ↔ s ≠ ⊥

{α : Type u_2}
[TopologicalSpace α]
{s : TopologicalSpace.Closeds α}


/-- A version of `Matrix.ext_iff` that unfolds the `Matrix.transpose`. -/
theorem IsSymm.ext_iff {A : Matrix n n α} : A.IsSymm ↔ ∀ i j, A j i = A i j

{α : Type u_1}
{n : Type u_3}
{A : Matrix n n α}


theorem hIterate_elim {P : Nat → Sort _} (Q : ∀(i : Nat), P i → Prop)
    {n : Nat} (f : ∀(i : Fin n), P i.val → P (i.val+1)) (s : P 0) (init : Q 0 s)
    (step : ∀(k : Fin n) (s : P k.val), Q k.val s → Q (k.val+1) (f k s)) :
    Q n (hIterate P s f)

(step : ∀ (k : Fin n) (s : P ↑k), Q (↑k) s → Q (↑k + 1) (f k s))


theorem subset_dedup (s : Multiset α) : s ⊆ dedup s

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


@[elab_as_elim]
protected theorem inductionOn {f : Sym2 α → Prop} (i : Sym2 α) (hf : ∀ x y, f s(x, y)) : f i

{α : Type u_1}
{f : Sym2 α → Prop}
(i : Sym2 α)
(hf : ∀ (x y : α), f s(x, y))


@[simp]
theorem case_eval (f g) :
    (case f g).eval = fun v => v.headI.rec (f.eval v.tail) fun y _ => g.eval (y::v.tail)

(f.case g).eval = fun v => Nat.rec (f.eval v.tail) (fun y x => g.eval (y :: v.tail)) v.headI


@[norm_cast, simp]
theorem coe_zpow (x : R) (z : ℤ) : ((x ^ z : R) : ℍ[R]) = (x : ℍ[R]) ^ z

{R : Type u_1}
[LinearOrderedField R]
(x : R)
(z : ℤ)


theorem ball_mem_nhds (x : α) {ε : ℝ} (ε0 : 0 < ε) : ball x ε ∈ 𝓝 x

{α : Type u}
[PseudoMetricSpace α]
(x : α)
{ε : ℝ}
(ε0 : 0 < ε)


theorem iSup_range {g : β → α} {f : ι → β} : ⨆ b ∈ range f, g b = ⨆ i, g (f i)

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_5}
[CompleteLattice α]
{g : β → α}
{f : ι → β}


theorem isTopologicalBasis_opens : IsTopologicalBasis { U : Set α | IsOpen U }

TopologicalSpace.IsTopologicalBasis {U | IsOpen U}


theorem roots_C_mul_X_pow (ha : a ≠ 0) (n : ℕ) :
    Polynomial.roots (C a * X ^ n) = n • ({0} : Multiset R)

{R : Type u}
{a : R}
[CommRing R]
[IsDomain R]
(ha : a ≠ 0)
(n : ℕ)

(Polynomial.C a * Polynomial.X ^ n).roots = n • {0}


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

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

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


@[simp]
theorem insertNth_zero' (x : β) (p : Fin n → β) : @insertNth _ (fun _ ↦ β) 0 x p = cons x p

{n : ℕ}
{β : Type v}
(x : β)
(p : Fin n → β)


theorem minimal_nonempty_open_subsingleton [T0Space X] {s : Set X} (hs : IsOpen s)
    (hmin : ∀ t, t ⊆ s → t.Nonempty → IsOpen t → t = s) : s.Subsingleton

(hmin : ∀ t ⊆ s, t.Nonempty → IsOpen t → t = s)


@[to_additive]
theorem topologicalGroup_sInf {ts : Set (TopologicalSpace G)}
    (h : ∀ t ∈ ts, @TopologicalGroup G t _) : @TopologicalGroup G (sInf ts) _

{G : Type w}
[Group G]
{ts : Set (TopologicalSpace G)}
(h : ∀ t ∈ ts, TopologicalGroup G)


theorem append_eq_has_append {L₁ L₂ : List α} : List.append L₁ L₂ = L₁ ++ L₂


@[simp]
theorem LinearMap.toMatrix₂_toLinearMap₂ (M : Matrix n m N₂) :
    LinearMap.toMatrix₂ b₁ b₂ (Matrix.toLinearMap₂ b₁ b₂ M) = M

{R : Type u_1}
{M₁ : Type u_7}
{M₂ : Type u_8}
{N₂ : Type u_11}
{n : Type u_12}
{m : Type u_13}
[CommSemiring R]
[AddCommMonoid M₁]
[Module R M₁]
[AddCommMonoid M₂]
[Module R M₂]
[AddCommMonoid N₂]
[Module R N₂]
[DecidableEq n]
[Fintype n]
[DecidableEq m]
[Fintype m]
(b₁ : Basis n R M₁)
(b₂ : Basis m R M₂)
(M : Matrix n m N₂)

(LinearMap.toMatrix₂ b₁ b₂) ((Matrix.toLinearMap₂ b₁ b₂) M) = M


@[simp, reassoc]
theorem p_idem : P.p.f n ≫ P.p.f n = P.p.f n

(P : CategoryTheory.Idempotents.Karoubi (HomologicalComplex C c))

CategoryTheory.CategoryStruct.comp (P.p.f n) (P.p.f n) = P.p.f n


theorem _root_.Function.Injective.list_map {f : α → β} (h : Injective f) :
    Injective (map f)

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


theorem LipschitzWith.comp_boundedVariationOn {f : E → F} {C : ℝ≥0} (hf : LipschitzWith C f)
    {g : α → E} {s : Set α} (h : BoundedVariationOn g s) : BoundedVariationOn (f ∘ g) s

{α : Type u_1}
[LinearOrder α]
{E : Type u_2}
[PseudoEMetricSpace E]
{F : Type u_3}
[PseudoEMetricSpace F]
{f : E → F}
{C : ℝ≥0}
(hf : LipschitzWith C f)
{g : α → E}
{s : Set α}
(h : BoundedVariationOn g s)


@[to_additive]
theorem ThreeGPFree.mono (h : t ⊆ s) (hs : ThreeGPFree s) : ThreeGPFree t

{α : Type u_2}
[AddMonoid α]
{s t : Set α}
(h : t ⊆ s)
(hs : ThreeAPFree s)


/-- Every value of the ordinal approximants are less or equal than every fixed point of f greater
  then the initial value -/
theorem lfpApprox_le_of_mem_fixedPoints {a : α}
    (h_a : a ∈ fixedPoints f) (h_le_init : x ≤ a) (i : Ordinal) : lfpApprox f x i ≤ a

{α : Type u}
[CompleteLattice α]
(f : α →o α)
(x : α)
{a : α}
(h_a : a ∈ Function.fixedPoints ⇑f)
(h_le_init : x ≤ a)
(i : Ordinal.{u})


/-- Taking the kernel density of intervals `Iic q` for `q : ℚ` gives a function with the property
`isRatCondKernelCDF`. -/
lemma isRatCondKernelCDF_density_Iic (κ : Kernel α (γ × ℝ)) [IsFiniteKernel κ] :
    IsRatCondKernelCDF (fun (p : α × γ) q ↦ density κ (fst κ) p.1 p.2 (Iic q)) κ (fst κ)

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

ProbabilityTheory.IsRatCondKernelCDF (fun p q => κ.density κ.fst p.1 p.2 (Set.Iic ↑q)) κ κ.fst


theorem fix_le {X : (a : _) → Part <| β a} (hX : f X ≤ X) : Part.fix f ≤ X

(f : ((a : α) → Part (β a)) →o (a : α) → Part (β a))


theorem abv_sub_le (a b c : R) : abv (a - c) ≤ abv (a - b) + abv (b - c)

{S : Type u_5}
[OrderedRing S]
{R : Type u_6}
[Ring R]
(abv : R → S)
[IsAbsoluteValue abv]
(a b c : R)


lemma toMorphismProperty_respectsIso_iff :
    RespectsIso P ↔ (toMorphismProperty P).RespectsIso

{P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop}

(RingHom.RespectsIso fun {R S} [CommRing R] [CommRing S] => P) ↔
  (RingHom.toMorphismProperty fun {R S} [CommRing R] [CommRing S] => P).RespectsIso


/-- The set of positive powers of prime `p` that divide `n` is exactly the set of
positive natural numbers up to `n.factorization p`. -/
theorem Icc_factorization_eq_pow_dvd (n : ℕ) {p : ℕ} (pp : Prime p) :
    Icc 1 (n.factorization p) = (Ico 1 n).filter fun i : ℕ => p ^ i ∣ n

Finset.Icc 1 (n.factorization p) = Finset.filter (fun i => p ^ i ∣ n) (Finset.Ico 1 n)


/-- Adjoins a `⊥` to the codomain of an `InfHom`. -/
@[simps]
def withBot' [OrderBot β] (f : InfHom α β) : InfHom (WithBot α) β

{α : Type u_3}
{β : Type u_4}
[SemilatticeInf α]
[SemilatticeInf β]
[OrderBot β]
(f : InfHom α β)
(a : WithBot α)


theorem coeff_multiset_prod_of_natDegree_le (n : ℕ) (hl : ∀ p ∈ t, natDegree p ≤ n) :
    coeff t.prod ((Multiset.card t) * n) = (t.map fun p => coeff p n).prod

{R : Type u}
[CommSemiring R]
(t : Multiset R[X])
(n : ℕ)
(hl : ∀ p ∈ t, p.natDegree ≤ n)

t.prod.coeff (Multiset.card t * n) = (Multiset.map (fun p => p.coeff n) t).prod


theorem closure_sup_closure_right (x y : α) : c (x ⊔ c y) = c (x ⊔ y)

{α : Type u_1}
[SemilatticeSup α]
(c : ClosureOperator α)
(x y : α)


/-- Equivalence between `Π j : Fin (n + 1), α j` and `α i × Π j : Fin n, α (Fin.succAbove i j)`. -/
@[simps (config := .asFn)]
def Equiv.piFinSuccAbove (α : Fin (n + 1) → Type u) (i : Fin (n + 1)) :
    (∀ j, α j) ≃ α i × ∀ j, α (i.succAbove j)

{n : ℕ}
(α : Fin (n + 1) → Type u)
(i : Fin (n + 1))

⇑(Equiv.piFinSuccAbove α i) = fun f => (f i, i.removeNth f)


/-- The quotient norm is nonnegative. -/
theorem norm_mk_nonneg (S : AddSubgroup M) (m : M) : 0 ≤ ‖mk' S m‖

{M : Type u_1}
[SeminormedAddCommGroup M]
(S : AddSubgroup M)
(m : M)


lemma map_mapRingHom_eval_map : (p.map <| mapRingHom f).eval (q.map f) = (p.eval q).map f

{R : Type u_1}
{S : Type u_2}
[Semiring R]
[Semiring S]
(f : R →+* S)
(p : R[X][Y])
(q : R[X])

Polynomial.eval (Polynomial.map f q) (Polynomial.map (Polynomial.mapRingHom f) p) =
  Polynomial.map f (Polynomial.eval q p)


@[to_additive]
theorem noncommPiCoprod_range
    {hcomm : Pairwise fun i j : ι => ∀ (x : H i) (y : H j), Commute (ϕ i x) (ϕ j y)} :
    (noncommPiCoprod ϕ hcomm).range = ⨆ i : ι, (ϕ i).range

{hcomm : Pairwise fun i j => ∀ (x : H i) (y : H j), AddCommute ((ϕ i) x) ((ϕ j) y)}

(AddMonoidHom.noncommPiCoprod ϕ hcomm).range = ⨆ i, (ϕ i).range


/-- Constructor for isomorphisms in `GradedObject` -/
@[simps]
def isoMk (e : ∀ i, X i ≅ Y i) : X ≅ Y

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{β : Type u_1}
(X Y : CategoryTheory.GradedObject β C)
(e : (i : β) → X i ≅ Y i)
(i : β)


theorem hom_as_subtype (p q : ActionCategory M X) : (p ⟶ q) = { m : M // m • p.back = q.back }

(p q : CategoryTheory.ActionCategory M X)


theorem Kernel.indep_limsup_atBot_self (h_le : ∀ n, s n ≤ m0) (h_indep : iIndep s κ μα) :
    Indep (limsup s atBot) (limsup s atBot) κ μα

(h_indep : ProbabilityTheory.Kernel.iIndep s κ μα)

ProbabilityTheory.Kernel.Indep (Filter.limsup s Filter.atBot) (Filter.limsup s Filter.atBot) κ μα


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


theorem image_source_inter_eq (s : Set X) :
    e '' (e.source ∩ s) = e.target ∩ e.symm ⁻¹' (e.source ∩ s)

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

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


@[simp]
theorem sum_subgroup_pow_eq_zero [CommRing K] [NoZeroDivisors K]
    {G : Subgroup Kˣ} [Fintype G] {k : ℕ} (k_pos : k ≠ 0) (k_lt_card_G : k < Fintype.card G) :
    ∑ x : G, ((x : Kˣ) : K) ^ k = 0

{K : Type u_1}
[CommRing K]
[NoZeroDivisors K]
{G : Subgroup Kˣ}
[Fintype ↥G]
{k : ℕ}
(k_pos : k ≠ 0)
(k_lt_card_G : k < Fintype.card ↥G)


/-- The identity hom. -/
@[simps]
protected noncomputable def Hom.id : Hom P P

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

(Algebra.Generators.Hom.id P).val n = MvPolynomial.X n


/-- The Haudorff edistance to the empty set is infinite. -/
theorem hausdorffEdist_empty (ne : s.Nonempty) : hausdorffEdist s ∅ = ∞

{α : Type u}
[PseudoEMetricSpace α]
{s : Set α}
(ne : s.Nonempty)


@[to_additive]
theorem isOpenMap_div_left (a : G) : IsOpenMap (a / ·)

{G : Type w}
[Group G]
[TopologicalSpace G]
[TopologicalGroup G]
(a : G)


/-- A monoid homomorphism `f : M →* N` with a left-inverse `g : N → M` defines a multiplicative
equivalence between `M` and `f.mrange`.
This is a bidirectional version of `MonoidHom.mrange_restrict`. -/
@[to_additive (attr := simps (config := { simpRhs := true }))
      "An additive monoid homomorphism `f : M →+ N` with a left-inverse `g : N → M`
      defines an additive equivalence between `M` and `f.mrange`.
      This is a bidirectional version of `AddMonoidHom.mrange_restrict`. "]
def ofLeftInverse' (f : M →* N) {g : N → M} (h : Function.LeftInverse g f) :
    M ≃* MonoidHom.mrange f

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
(f : M →+ N)
{g : N → M}
(h : Function.LeftInverse g ⇑f)

∀ (a : ↥(AddMonoidHom.mrange f)), (AddEquiv.ofLeftInverse' f h).symm a = g ↑a


@[simp]
theorem join_apply {m : Measure (Measure α)} {s : Set α} (hs : MeasurableSet s) :
    join m s = ∫⁻ μ, μ s ∂m

{m : MeasureTheory.Measure (MeasureTheory.Measure α)}

m.join s = ∫⁻ (μ : MeasureTheory.Measure α), μ s ∂m


theorem adjunction_homEquiv_symm_apply {X : Scheme} {R : CommRingCatᵒᵖ}
    (f : X ⟶ Scheme.Spec.obj R) :
    (ΓSpec.adjunction.homEquiv X R).symm f =
      (locallyRingedSpaceAdjunction.homEquiv X.1 R).symm f

(f : X ⟶ AlgebraicGeometry.Scheme.Spec.obj R)

(AlgebraicGeometry.ΓSpec.adjunction.homEquiv X R).symm f =
  (AlgebraicGeometry.ΓSpec.locallyRingedSpaceAdjunction.homEquiv X.toLocallyRingedSpace R).symm f


@[simp] theorem insert_subset_insert_iff (ha : a ∉ s) : insert a s ⊆ insert a t ↔ s ⊆ t

{α : Type u}
{a : α}
{s t : Set α}
(ha : a ∉ s)


theorem isCodetector_op_iff (G : C) : IsCodetector (op G) ↔ IsDetector G

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

CategoryTheory.IsCodetector (Opposite.op G) ↔ CategoryTheory.IsDetector G


theorem isBigOWith_insert [TopologicalSpace α] {x : α} {s : Set α} {C : ℝ} {g : α → E} {g' : α → F}
    (h : ‖g x‖ ≤ C * ‖g' x‖) : IsBigOWith C (𝓝[insert x s] x) g g' ↔
    IsBigOWith C (𝓝[s] x) g g'

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
[TopologicalSpace α]
{x : α}
{s : Set α}
{C : ℝ}
{g : α → E}
{g' : α → F}
(h : ‖g x‖ ≤ C * ‖g' x‖)

Asymptotics.IsBigOWith C (𝓝[insert x s] x) g g' ↔ Asymptotics.IsBigOWith C (𝓝[s] x) g g'


theorem neg_right_iff (x y : R) : IsRelPrime x (-y) ↔ IsRelPrime x y


@[reassoc]
theorem id_tensor_associator_naturality {X Y Z Z' : C} (h : Z ⟶ Z') :
    (𝟙 (X ⊗ Y) ⊗ h) ≫ (α_ X Y Z').hom = (α_ X Y Z).hom ≫ (𝟙 X ⊗ 𝟙 Y ⊗ h)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.MonoidalCategory C]
{X Y Z Z' : C}
(h : Z ⟶ Z')

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.tensorHom
      (CategoryTheory.CategoryStruct.id (CategoryTheory.MonoidalCategory.tensorObj X Y)) h)
    (CategoryTheory.MonoidalCategory.associator X Y Z').hom =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator X Y Z).hom
    (CategoryTheory.MonoidalCategory.tensorHom (CategoryTheory.CategoryStruct.id X)
      (CategoryTheory.MonoidalCategory.tensorHom (CategoryTheory.CategoryStruct.id Y) h))


protected theorem injective : Injective f

{α : Sort u}
{f : α → α}
(h : Function.Involutive f)


theorem withDensityᵥ_neg' : (μ.withDensityᵥ fun x => -f x) = -μ.withDensityᵥ f

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


/-- Heterobasic version of `TensorProduct.uncurry`:

Linearly constructing a linear map `M ⊗[R] N →[A] P` given a bilinear map `M →[A] N →[R] P`
with the property that its composition with the canonical bilinear map `M →[A] N →[R] M ⊗[R] N` is
the given bilinear map `M →[A] N →[R] P`. -/
@[simps]
def uncurry : (M →ₗ[A] N →ₗ[R] P) →ₗ[B] M ⊗[R] N →ₗ[A] P

(R : Type uR)
(A : Type uA)
(B : Type uB)
(M : Type uM)
(N : Type uN)
(P : Type uP)
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
[AddCommMonoid M]
[Module R M]
[Module A M]
[IsScalarTower R A M]
[AddCommMonoid N]
[Module R N]
[AddCommMonoid P]
[Module R P]
[Module A P]
[Module B P]
[IsScalarTower R A P]
[IsScalarTower R B P]
[SMulCommClass A B P]
(f : M →ₗ[A] N →ₗ[R] P)

(TensorProduct.AlgebraTensorModule.uncurry R A B M N P) f = TensorProduct.AlgebraTensorModule.lift f


theorem closedBall_sub_closedBall [ProperSpace E] (hε : 0 ≤ ε) (hδ : 0 ≤ δ) (a b : E) :
    closedBall a ε - closedBall b δ = closedBall (a - b) (ε + δ)

{E : Type u_2}
[SeminormedAddCommGroup E]
[NormedSpace ℝ E]
{δ ε : ℝ}
[ProperSpace E]
(hε : 0 ≤ ε)
(hδ : 0 ≤ δ)
(a b : E)

Metric.closedBall a ε - Metric.closedBall b δ = Metric.closedBall (a - b) (ε + δ)


/-- The object level part of the backward direction of `Comon_ (Mon_ C) ≌ Mon_ (Comon_ C)` -/
@[simps]
def ofMon_Comon_obj (M : Mon_ (Comon_ C)) : Bimon_ C

(C : Type u₁)
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
[CategoryTheory.BraidedCategory C]
(M : Mon_ (Comon_ C))

(Bimon_.ofMon_Comon_obj C M).comul.hom = M.X.comul


@[simp]
theorem single_eq_same : (single a b : α →₀ M) a = b

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


@[simp]
theorem ofEq_symm (h : p = q) : (ofEq p q h).symm = ofEq q p h.symm

{E : Type u_5}
[SeminormedAddCommGroup E]
{R' : Type u_12}
[Ring R']
[Module R' E]
{p q : Submodule R' E}
(h : p = q)

(LinearIsometryEquiv.ofEq p q h).symm = LinearIsometryEquiv.ofEq q p ⋯


theorem nhds_coe_eq (x : X) : 𝓝 ↑x = map ((↑) : X → OnePoint X) (𝓝 x)

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


lemma isoClosure_eq_self (P : MorphismProperty C) [P.RespectsIso] :
    P.isoClosure = P

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


theorem hom_eq_iff_le (C : G.ComponentCompl L) (h : K ⊆ L) (D : G.ComponentCompl K) :
    C.hom h = D ↔ (C : Set V) ⊆ (D : Set V)

{V : Type u}
{G : SimpleGraph V}
{K L : Set V}
(C : G.ComponentCompl L)
(h : K ⊆ L)
(D : G.ComponentCompl K)

SimpleGraph.ComponentCompl.hom h C = D ↔ ↑C ⊆ ↑D


private lemma div_nonneg_of_nonneg_of_pos (ha : 0 ≤ a) (hb : 0 < b) : 0 ≤ a / b

{α : Type u_4}
[LinearOrderedSemifield α]
{a b : α}
(ha : 0 ≤ a)
(hb : 0 < b)


@[simp]
lemma smul_f_apply (r : R) (f : X ⟶ Y) (n : ι) : (r • f).f n = r • f.f n

{R : Type u_1}
[Semiring R]
{C : Type u_2}
[CategoryTheory.Category.{u_5, u_2} C]
[CategoryTheory.Preadditive C]
[CategoryTheory.Linear R C]
{ι : Type u_4}
{c : ComplexShape ι}
{X Y : HomologicalComplex C c}
(r : R)
(f : X ⟶ Y)
(n : ι)


/-- The equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)` given by yoneda lemma. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_inv counitIso_hom counitIso_inv]
def costructuredArrowYonedaEquivalence (F : Cᵒᵖ ⥤ Type v) :
    F.Elementsᵒᵖ ≌ CostructuredArrow yoneda F

(F : CategoryTheory.Functor Cᵒᵖ (Type v))

(CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalence F).counitIso.hom = CategoryTheory.eqToHom ⋯


/-- A multivariate power series is not a zero divisor
  when its constant coefficient is not a zero divisor -/
theorem mem_nonZeroDivisors_of_constantCoeff {φ : MvPowerSeries σ R}
    (hφ : constantCoeff σ R φ ∈ nonZeroDivisors R) :
    φ ∈ nonZeroDivisors (MvPowerSeries σ R)

(hφ : (MvPowerSeries.constantCoeff σ R) φ ∈ nonZeroDivisors R)


/-- Let the group `G` be the union of finitely many left cosets `g i • H i`.
Then the cosets of subgroups of infinite index may be omitted from the covering. -/
@[to_additive]
theorem leftCoset_cover_filter_FiniteIndex
    [DecidablePred (FiniteIndex : Subgroup G → Prop)] :
    ⋃ k ∈ s.filter (fun i => (H i).FiniteIndex), g k • (H k : Set G) = Set.univ

(hcovers : ⋃ i ∈ s, g i • ↑(H i) = Set.univ)

⋃ k ∈ Finset.filter (fun i => (H i).FiniteIndex) s, g k • ↑(H k) = Set.univ


nonrec theorem ofReal_toReal_ae_eq [IsFiniteMeasure ℙ] {X : Ω → E} :
    (fun x => ENNReal.ofReal (pdf X ℙ μ x).toReal) =ᵐ[μ] pdf X ℙ μ

{Ω : Type u_1}
{E : Type u_2}
[MeasurableSpace E]
{m : MeasurableSpace Ω}
{ℙ : MeasureTheory.Measure Ω}
{μ : MeasureTheory.Measure E}
[MeasureTheory.IsFiniteMeasure ℙ]
{X : Ω → E}

(fun x => ENNReal.ofReal (MeasureTheory.pdf X ℙ μ x).toReal) =ᵐ[μ] MeasureTheory.pdf X ℙ μ


@[simp]
theorem iter_deriv_inv' (k : ℕ) :
    deriv^[k] Inv.inv = fun x : 𝕜 => (∏ i ∈ Finset.range k, (-1 - i : 𝕜)) * x ^ (-1 - k : ℤ)

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(k : ℕ)

deriv^[k] Inv.inv = fun x => (∏ i ∈ Finset.range k, (-1 - ↑i)) * x ^ (-1 - ↑k)


@[simp]
theorem coe_pow [Monoid β] (f : α →ₛ β) (n : ℕ) : ⇑(f ^ n) = (⇑f) ^ n

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[Monoid β]
(f : MeasureTheory.SimpleFunc α β)
(n : ℕ)


@[simp]
lemma map_apply (h : M →ₗ[R] N) (x) : map S f g h (f x) = g (h x)

{R : Type u_1}
[CommSemiring R]
(S : Submonoid R)
{M : Type u_2}
{M' : Type u_3}
[AddCommMonoid M]
[AddCommMonoid M']
[Module R M]
[Module R M']
(f : M →ₗ[R] M')
[IsLocalizedModule S f]
{N : Type u_6}
{N' : Type u_7}
[AddCommGroup N]
[AddCommGroup N']
[Module R N]
[Module R N']
(g : N →ₗ[R] N')
[IsLocalizedModule S g]
(h : M →ₗ[R] N)
(x : M)

((IsLocalizedModule.map S f g) h) (f x) = g (h x)


@[simp]
protected theorem add_sub_cancel_right (hb : b ≠ ∞) : a + b - b = a


/-- Note: the "obvious" statement `(piCongrLeft P e) f b = f (e.symm b)` doesn't typecheck: the
LHS would have type `P b` while the RHS would have type `P (e (e.symm b))`. This lemma is a way
around it in the case where `b` is of the form `e a`, so we can use `f a` instead of
`f (e.symm (e a))`. -/
lemma piCongrLeft_apply_apply (f : ∀ a, P (e a)) (a : α) :
    (piCongrLeft P e) f (e a) = f a

{β : Sort u_1}
{α : Sort u_2}
(P : β → Sort w)
(e : α ≃ β)
(f : (a : α) → P (e a))
(a : α)


theorem toNNReal_add_le {r p : ℝ} : Real.toNNReal (r + p) ≤ Real.toNNReal r + Real.toNNReal p

(r + p).toNNReal ≤ r.toNNReal + p.toNNReal


protected theorem mul_ediv_cancel' {a b : Int} (H : a ∣ b) : a * (b / a) = b


theorem one_div_pow {A : M} (n : ℕ) : (1 / A) ^ n = 1 / A ^ n

{n' : Type u_1}
[DecidableEq n']
[Fintype n']
{R : Type u_2}
[CommRing R]
{A : Matrix n' n' R}
(n : ℕ)


theorem mem_chain_of_mem_ωSup {c : Chain (Part α)} {a : α} (h : a ∈ Part.ωSup c) : some a ∈ c

{c : OmegaCompletePartialOrder.Chain (Part α)}


lemma norm_eq_of_equiv_equiv {A₁ B₁ A₂ B₂ : Type*} [CommRing A₁] [Ring B₁]
    [CommRing A₂] [Ring B₂] [Algebra A₁ B₁] [Algebra A₂ B₂] (e₁ : A₁ ≃+* A₂) (e₂ : B₁ ≃+* B₂)
    (he : RingHom.comp (algebraMap A₂ B₂) ↑e₁ = RingHom.comp ↑e₂ (algebraMap A₁ B₁)) (x) :
    Algebra.norm A₁ x = e₁.symm (Algebra.norm A₂ (e₂ x))

(he : (algebraMap A₂ B₂).comp ↑e₁ = (↑e₂).comp (algebraMap A₁ B₁))

(Algebra.norm A₁) x = e₁.symm ((Algebra.norm A₂) (e₂ x))


@[simp]
theorem card_erase_add_one : a ∈ s → (s.erase a).card + 1 = s.card

{α : Type u_1}
{s : Finset α}
{a : α}
[DecidableEq α]


@[simp]
theorem diff_singleton_subset_iff {x : α} {s t : Set α} : s \ {x} ⊆ t ↔ s ⊆ insert x t


@[simp]
theorem mem_pure {a : α} {s : Set α} : s ∈ (pure a : Ultrafilter α) ↔ a ∈ s


@[simp]
theorem withDensityᵥ_add (hf : Integrable f μ) (hg : Integrable g μ) :
    μ.withDensityᵥ (f + g) = μ.withDensityᵥ f + μ.withDensityᵥ g

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


/-- The pointwise minimum of concave functions is concave. -/
theorem ConcaveOn.inf (hf : ConcaveOn 𝕜 s f) (hg : ConcaveOn 𝕜 s g) : ConcaveOn 𝕜 s (f ⊓ g)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[LinearOrderedAddCommMonoid β]
[SMul 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f g : E → β}
(hf : ConcaveOn 𝕜 s f)
(hg : ConcaveOn 𝕜 s g)


theorem tsupport_mul_subset_left {α : Type*} [MulZeroClass α] {f g : X → α} :
    (tsupport fun x => f x * g x) ⊆ tsupport f

{X : Type u_1}
[TopologicalSpace X]
{α : Type u_10}
[MulZeroClass α]
{f g : X → α}


@[simp]
theorem toFinset_val (s : Multiset α) : s.toFinset.1 = s.dedup

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


theorem conjTranspose_sum [AddCommMonoid α] [StarAddMonoid α] {ι : Type*} (s : Finset ι)
    (M : ι → Matrix m n α) : (∑ i ∈ s, M i)ᴴ = ∑ i ∈ s, (M i)ᴴ

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[AddCommMonoid α]
[StarAddMonoid α]
{ι : Type u_10}
(s : Finset ι)
(M : ι → Matrix m n α)