@[to_additive]
lemma isUnit_ofPowEqOne (ha : a ^ n = 1) (hn : n ≠ 0) : IsUnit a

{M : Type u_1}
[Monoid M]
{n : ℕ}
{a : M}
(ha : a ^ n = 1)
(hn : n ≠ 0)


theorem natCast_modEq_iff {a b n : ℕ} : a ≡ b [ZMOD n] ↔ a ≡ b [MOD n]


@[simp]
theorem lift_tmul (f : M →ₗ[A] N →ₗ[R] P) (x : M) (y : N) : lift f (x ⊗ₜ y) = f x y

{R : Type uR}
{A : Type uA}
{M : Type uM}
{N : Type uN}
{P : Type uP}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[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]
[IsScalarTower R A P]
(f : M →ₗ[A] N →ₗ[R] P)
(x : M)
(y : N)

(TensorProduct.AlgebraTensorModule.lift f) (x ⊗ₜ[R] y) = (f x) y


/-- If `F : C ⥤ D` is an equivalence of categories and `C` is a `split_epi_category`,
then `D` also is. -/
theorem splitEpiCategoryImpOfIsEquivalence [IsEquivalence F] [SplitEpiCategory C] :
    SplitEpiCategory D

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : C ⥤ D)
[F.IsEquivalence]
[CategoryTheory.SplitEpiCategory C]


@[to_additive]
theorem prod_zero_index [∀ i, AddCommMonoid (β i)] [∀ (i) (x : β i), Decidable (x ≠ 0)]
    [CommMonoid γ] {h : ∀ i, β i → γ} : (0 : Π₀ i, β i).prod h = 1

[(i : ι) → (x : β i) → Decidable (x ≠ 0)]


@[simp]
theorem tensor_one (M N : Mon_ C) : (M ⊗ N).one = (λ_ (𝟙_ C)).inv ≫ (M.one ⊗ N.one)

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


theorem WF.update [BEq α] [Hashable α] {buckets : Buckets α β} {i d h} (H : buckets.WF)
    (h₁ : ∀ [PartialEquivBEq α] [LawfulHashable α],
      (buckets.1[i].toList.Pairwise fun a b => ¬(a.1 == b.1)) →
      d.toList.Pairwise fun a b => ¬(a.1 == b.1))
    (h₂ : (buckets.1[i].All fun k _ => ((hash k).toUSize % buckets.1.size).toNat = i.toNat) →
      d.All fun k _ => ((hash k).toUSize % buckets.1.size).toNat = i.toNat) :
    (buckets.update i d h).WF

{buckets : Batteries.HashMap.Imp.Buckets α β}

(h₁ :
  ∀ [inst : PartialEquivBEq α] [inst : Batteries.HashMap.LawfulHashable α],
    List.Pairwise (fun a b => ¬(a.fst == b.fst) = true) buckets.val[i].toList →
      List.Pairwise (fun a b => ¬(a.fst == b.fst) = true) d.toList)

(h₂ :
  Batteries.AssocList.All (fun k x => ((hash k).toUSize % buckets.val.size).toNat = i.toNat) buckets.val[i] →
    Batteries.AssocList.All (fun k x => ((hash k).toUSize % buckets.val.size).toNat = i.toNat) d)


theorem Equiv.swap_bijOn_exchange (ha : a ∈ s) (hb : b ∉ s) :
    BijOn (Equiv.swap a b) s (insert b (s \ {a}))

{α : Type u_1}
[DecidableEq α]
{a b : α}
{s : Set α}
(ha : a ∈ s)
(hb : b ∉ s)

Set.BijOn (⇑(Equiv.swap a b)) s (insert b (s \ {a}))


@[to_additive]
theorem of_card_le_one (hA : A.Nonempty) (hB : B.Nonempty) (hA1 : A.card ≤ 1) (hB1 : B.card ≤ 1) :
    ∃ a ∈ A, ∃ b ∈ B, UniqueMul A B a b

{G : Type u_1}
[Mul G]
{A B : Finset G}
(hA : A.Nonempty)
(hB : B.Nonempty)
(hA1 : A.card ≤ 1)
(hB1 : B.card ≤ 1)


lemma cfc_comp_smul {S : Type*} [SMul S R] [ContinuousConstSMul S R] [SMulZeroClass S A]
    [IsScalarTower S R A] [IsScalarTower S R (R → R)] (s : S) (f : R → R) (a : A)
    (hf : ContinuousOn f ((s • ·) '' (spectrum R a)) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    cfc (f <| s • ·) a = cfc f (s • a)

(hf : ContinuousOn f ((fun x => s • x) '' spectrum R a) := by cfc_cont_tac)

cfc (fun x => f (s • x)) a = cfc f (s • a)


theorem ConvolutionExists.add_distrib (hfg : ConvolutionExists f g L μ)
    (hfg' : ConvolutionExists f' g L μ) : (f + f') ⋆[L, μ] g = f ⋆[L, μ] g + f' ⋆[L, μ] g

(hfg : MeasureTheory.ConvolutionExists f g L μ)

(hfg' : MeasureTheory.ConvolutionExists f' g L μ)

MeasureTheory.convolution (f + f') g L μ = MeasureTheory.convolution f g L μ + MeasureTheory.convolution f' g L μ


theorem partOfVertex_mem (v : V) : P.partOfVertex v ∈ P.parts

{V : Type u}
{G : SimpleGraph V}
(P : G.Partition)
(v : V)


theorem basis'_restrict_iff : (M ↾ R).Basis' I X ↔ M.Basis' I (X ∩ R) ∧ I ⊆ R

{α : Type u_1}
{M : Matroid α}
{R I X : Set α}

(M.restrict R).Basis' I X ↔ M.Basis' I (X ∩ R) ∧ I ⊆ R


/-- Auxiliary definition for `CategoryTheory.Mat.equivalenceSingleObj`. -/
@[simps]
def equivalenceSingleObjInverse : Mat_ (SingleObj Rᵐᵒᵖ) ⥤ Mat R

(X : CategoryTheory.Mat_ (CategoryTheory.SingleObj Rᵐᵒᵖ))

(CategoryTheory.Mat.equivalenceSingleObjInverse R).obj X = FintypeCat.of X.ι


lemma surjOn_of_subsingleton [Subsingleton α] (f : α → α) (s : Set α) : SurjOn f s s

{α : Type u_1}
[Subsingleton α]
(f : α → α)
(s : Set α)


lemma Flat.iInter {ι : Type*} [Nonempty ι] {Fs : ι → Set α}
    (hFs : ∀ i, M.Flat (Fs i)) : M.Flat (⋂ i, Fs i)

{α : Type u_2}
{M : Matroid α}
{ι : Type u_3}
[Nonempty ι]
{Fs : ι → Set α}
(hFs : ∀ (i : ι), M.Flat (Fs i))


theorem tendsto_ae_map {f : α → β} (hf : AEMeasurable f μ) : Tendsto f (ae μ) (ae (μ.map f))

{α : Type u_1}
{β : Type u_2}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{μ : MeasureTheory.Measure α}
{f : α → β}
(hf : AEMeasurable f μ)

Filter.Tendsto f (MeasureTheory.ae μ) (MeasureTheory.ae (MeasureTheory.Measure.map f μ))


@[to_additive]
theorem hasProd_pi_single [DecidableEq β] (b : β) (a : α) : HasProd (Pi.mulSingle b a) a

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
[DecidableEq β]
(b : β)
(a : α)


/-- `weightedVSub` gives equal results for two families of weights and two families of points
that are equal on `s`. -/
theorem weightedVSub_congr {w₁ w₂ : ι → k} (hw : ∀ i ∈ s, w₁ i = w₂ i) {p₁ p₂ : ι → P}
    (hp : ∀ i ∈ s, p₁ i = p₂ i) : s.weightedVSub p₁ w₁ = s.weightedVSub p₂ w₂

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
(s : Finset ι)
{w₁ w₂ : ι → k}
(hw : ∀ i ∈ s, w₁ i = w₂ i)
{p₁ p₂ : ι → P}
(hp : ∀ i ∈ s, p₁ i = p₂ i)

(s.weightedVSub p₁) w₁ = (s.weightedVSub p₂) w₂


/-- The affine span of a nonempty open set is `⊤`. -/
theorem IsOpen.affineSpan_eq_top {u : Set P} (hu : IsOpen u) (hne : u.Nonempty) :
    affineSpan ℝ u = ⊤

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[NormedSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{u : Set P}
(hu : IsOpen u)
(hne : u.Nonempty)


theorem abs_sub_sq (a b : α) : |a - b| * |a - b| = a * a + b * b - (1 + 1) * a * b

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


@[to_additive]
theorem mulIndicator_union_mul_inter (f : α → M) (s t : Set α) :
    mulIndicator (s ∪ t) f * mulIndicator (s ∩ t) f = mulIndicator s f * mulIndicator t f

{α : Type u_1}
{M : Type u_4}
[MulOneClass M]
(f : α → M)
(s t : Set α)

(s ∪ t).mulIndicator f * (s ∩ t).mulIndicator f = s.mulIndicator f * t.mulIndicator f


theorem Filter.Tendsto.update [DecidableEq ι] {l : Filter Y} {f : Y → ∀ i, π i} {x : ∀ i, π i}
    (hf : Tendsto f l (𝓝 x)) (i : ι) {g : Y → π i} {xi : π i} (hg : Tendsto g l (𝓝 xi)) :
    Tendsto (fun a => update (f a) i (g a)) l (𝓝 <| update x i xi)

{Y : Type v}
{ι : Type u_5}
{π : ι → Type u_6}
[T : (i : ι) → TopologicalSpace (π i)]
[DecidableEq ι]
{l : Filter Y}
{f : Y → (i : ι) → π i}
{x : (i : ι) → π i}
(hf : Filter.Tendsto f l (𝓝 x))
(i : ι)
{g : Y → π i}
{xi : π i}
(hg : Filter.Tendsto g l (𝓝 xi))

Filter.Tendsto (fun a => Function.update (f a) i (g a)) l (𝓝 (Function.update x i xi))


theorem ramificationIdx_eq_zero (h : ∀ n : ℕ, ∃ k, map f p ≤ P ^ k ∧ n < k) :
    ramificationIdx f p P = 0

(h : ∀ (n : ℕ), ∃ k, Ideal.map f p ≤ P ^ k ∧ n < k)


@[reassoc]
lemma fromLeftDerivedZero'_naturality {X Y : C} (f : X ⟶ Y)
    (P : ProjectiveResolution X) (Q : ProjectiveResolution Y)
    (φ : P.complex ⟶ Q.complex) (comm : φ.f 0 ≫ Q.π.f 0 = P.π.f 0 ≫ f)
    (F : C ⥤ D) [F.Additive] :
    HomologicalComplex.opcyclesMap ((F.mapHomologicalComplex _).map φ) 0 ≫
        Q.fromLeftDerivedZero' F = P.fromLeftDerivedZero' F ≫ F.map f

(P : CategoryTheory.ProjectiveResolution X)

(Q : CategoryTheory.ProjectiveResolution Y)

(comm : CategoryTheory.CategoryStruct.comp (φ.f 0) (Q.π.f 0) = CategoryTheory.CategoryStruct.comp (P.π.f 0) f)

CategoryTheory.CategoryStruct.comp
    (HomologicalComplex.opcyclesMap ((F.mapHomologicalComplex (ComplexShape.down ℕ)).map φ) 0)
    (Q.fromLeftDerivedZero' F) =
  CategoryTheory.CategoryStruct.comp (P.fromLeftDerivedZero' F) (F.map f)


@[simp]
theorem Nonempty.exists {α} {p : Nonempty α → Prop} : (∃ h : Nonempty α, p h) ↔ ∃ a, p ⟨a⟩


@[simp] theorem ite_eq_cond_iff (p : Prop) [h : Decidable p] (a : Bool) (x y u v : α) :
  (ite p x y = cond a u v) ↔ ite p x y = ite a u v

{α : Type u_1}
(p : Prop)
[h : Decidable p]
(a : Bool)
(x y u v : α)

((if p then x else y) = bif a then u else v) ↔ (if p then x else y) = if a = true then u else v


/-- The lift of a supremum is the supremum of the lifts. -/
theorem lift_sSup {s : Set Cardinal} (hs : BddAbove s) :
    lift.{u} (sSup s) = sSup (lift.{u} '' s)

{s : Set Cardinal.{u_1}}
(hs : BddAbove s)

Cardinal.lift.{u, u_1} (sSup s) = sSup (Cardinal.lift.{u, u_1} '' s)


/-- An ordinal lifted to a lower or equal universe equals itself. -/
-- @[simp] -- Porting note: simp lemma never applies, tested
theorem lift_id' (a : Ordinal) : lift a = a


theorem Icc_eq : Icc f g = (f.support ∪ g.support).dfinsupp (f.rangeIcc g)

{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ι]
[(i : ι) → DecidableEq (α i)]
[(i : ι) → PartialOrder (α i)]
[(i : ι) → Zero (α i)]
[(i : ι) → LocallyFiniteOrder (α i)]
(f g : Π₀ (i : ι), α i)

Finset.Icc f g = (f.support ∪ g.support).dfinsupp ⇑(f.rangeIcc g)


/-- Congruence relations are reflexive. -/
@[to_additive "Additive congruence relations are reflexive."]
protected theorem refl (x) : c x x

{M : Type u_1}
[Mul M]
(c : Con M)
(x : M)


@[to_additive (attr := simp)]
theorem finprod_cond_eq_left : (∏ᶠ (i) (_ : i = a), f i) = f a

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
{f : α → M}
{a : α}


theorem continuous_primitive (h_int : ∀ a b, IntervalIntegrable f μ a b) (a : ℝ) :
    Continuous fun b => ∫ x in a..b, f x ∂μ

(h_int : ∀ (a b : ℝ), IntervalIntegrable f μ a b)

Continuous fun b => ∫ (x : ℝ) in a..b, f x ∂μ


theorem toNat_lt_iff_lt_of_lt_aleph0 (hc : c < ℵ₀) (hd : d < ℵ₀) :
    toNat c < toNat d ↔ c < d

{c d : Cardinal.{u}}
(hc : c < Cardinal.aleph0)
(hd : d < Cardinal.aleph0)

Cardinal.toNat c < Cardinal.toNat d ↔ c < d


/-- We say that a set `s : Set α` is `OrdConnected` if for all `x y ∈ s` it includes the
interval `[[x, y]]`. If `α` is a `DenselyOrdered` `ConditionallyCompleteLinearOrder` with
the `OrderTopology`, then this condition is equivalent to `IsPreconnected s`. If `α` is a
`LinearOrderedField`, then this condition is also equivalent to `Convex α s`. -/
class OrdConnected (s : Set α) : Prop where
  /-- `s : Set α` is `OrdConnected` if for all `x y ∈ s` it includes the interval `[[x, y]]`. -/
  out' ⦃x⦄ (hx : x ∈ s) ⦃y⦄ (hy : y ∈ s) : Icc x y ⊆ s

{α : Type u_1}
[Preorder α]
{s : Set α}
[self : s.OrdConnected]
⦃x : α⦄
(hx : x ∈ s)
⦃y : α⦄
(hy : y ∈ s)


/-- Build an isomorphism in the category `MonCat` from a `MulEquiv` between `Monoid`s. -/
@[to_additive (attr := simps) AddEquiv.toAddMonCatIso
      "Build an isomorphism in the category `AddMonCat` from\nan `AddEquiv` between `AddMonoid`s."]
def MulEquiv.toMonCatIso (e : X ≃* Y) : MonCat.of X ≅ MonCat.of Y

{X Y : Type u}
[AddMonoid X]
[AddMonoid Y]
(e : X ≃+ Y)

e.toAddMonCatIso.inv = AddMonCat.ofHom e.symm.toAddMonoidHom


theorem isSupported_mul (hxs : IsSupported x s) (hys : IsSupported y s) : IsSupported (x * y) s

{α : Type u}
{x y : FreeCommRing α}
{s : Set α}
(hxs : x.IsSupported s)
(hys : y.IsSupported s)


@[aesop safe apply (rule_sets := [SetLike])]
lemma ofScientific_mem (s : S) {b : Bool} {n m : ℕ} :
    (OfScientific.ofScientific n b m : K) ∈ s

{K : Type u}
[DivisionRing K]
{S : Type u_1}
[SetLike S K]
[h : SubfieldClass S K]
(s : S)
{b : Bool}
{n m : ℕ}


@[simp]
theorem not_isSuccLimit_succ (a : α) : ¬IsSuccLimit (succ a)

{α : Type u_1}
[Preorder α]
[SuccOrder α]
[NoMaxOrder α]
(a : α)


@[simp]
theorem transpose_eq_diagonal [DecidableEq n] [Zero α] {M : Matrix n n α} {v : n → α} :
    Mᵀ = diagonal v ↔ M = diagonal v

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[Zero α]
{M : Matrix n n α}
{v : n → α}

Mᵀ = Matrix.diagonal v ↔ M = Matrix.diagonal v


theorem NodupKeys.kunion (nd₁ : l₁.NodupKeys) (nd₂ : l₂.NodupKeys) : (kunion l₁ l₂).NodupKeys

{α : Type u}
{β : α → Type v}
{l₁ l₂ : List (Sigma β)}
[DecidableEq α]
(nd₁ : l₁.NodupKeys)
(nd₂ : l₂.NodupKeys)


theorem fderiv_eq {f' : E → E →L[𝕜] F} (h : ∀ x, HasFDerivAt f (f' x) x) : fderiv 𝕜 f = f'

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{f' : E → E →L[𝕜] F}
(h : ∀ (x : E), HasFDerivAt f (f' x) x)


@[to_additive (attr := simp)]
theorem coe_map (f : G →* N) (K : Subgroup G) : (K.map f : Set N) = f '' K

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
(f : G →* N)
(K : Subgroup G)


@[to_additive (attr := simp, norm_cast)]
theorem coe_le_coe : (p : E → ℝ) ≤ q ↔ p ≤ q

{E : Type u_4}
[AddGroup E]
{p q : AddGroupNorm E}

⇑p ≤ ⇑q ↔ p ≤ q


lemma shiftFunctorAdd'_assoc (a₁ a₂ a₃ a₁₂ a₂₃ a₁₂₃ : A)
    (h₁₂ : a₁ + a₂ = a₁₂) (h₂₃ : a₂ + a₃ = a₂₃) (h₁₂₃ : a₁ + a₂ + a₃ = a₁₂₃) :
    shiftFunctorAdd' C a₁₂ a₃ a₁₂₃ (by rw [← h₁₂, h₁₂₃]) ≪≫
      isoWhiskerRight (shiftFunctorAdd' C a₁ a₂ a₁₂ h₁₂) _ ≪≫ Functor.associator _ _ _ =
    shiftFunctorAdd' C a₁ a₂₃ a₁₂₃ (by rw [← h₂₃, ← add_assoc, h₁₂₃]) ≪≫
      isoWhiskerLeft _ (shiftFunctorAdd' C a₂ a₃ a₂₃ h₂₃)

(C : Type u)
{A : Type u_1}
[CategoryTheory.Category.{v, u} C]
[AddMonoid A]
[CategoryTheory.HasShift C A]
(a₁ a₂ a₃ a₁₂ a₂₃ a₁₂₃ : A)
(h₁₂ : a₁ + a₂ = a₁₂)
(h₂₃ : a₂ + a₃ = a₂₃)
(h₁₂₃ : a₁ + a₂ + a₃ = a₁₂₃)

CategoryTheory.shiftFunctorAdd' C a₁₂ a₃ a₁₂₃ ⋯ ≪≫
    CategoryTheory.isoWhiskerRight (CategoryTheory.shiftFunctorAdd' C a₁ a₂ a₁₂ h₁₂)
        (CategoryTheory.shiftFunctor C a₃) ≪≫
      (CategoryTheory.shiftFunctor C a₁).associator (CategoryTheory.shiftFunctor C a₂)
        (CategoryTheory.shiftFunctor C a₃) =
  CategoryTheory.shiftFunctorAdd' C a₁ a₂₃ a₁₂₃ ⋯ ≪≫
    CategoryTheory.isoWhiskerLeft (CategoryTheory.shiftFunctor C a₁) (CategoryTheory.shiftFunctorAdd' C a₂ a₃ a₂₃ h₂₃)


theorem add_one_le_of_lt (h : m < n) : m + 1 ≤ n


lemma Basis.basis_of_closure_eq_closure (hI : M.Basis I X) (hY : I ⊆ Y)
    (h : M.closure X = M.closure Y) (hYE : Y ⊆ M.E := by aesop_mat) : M.Basis I Y

{α : Type u_2}
{M : Matroid α}
{X Y I : Set α}
(hI : M.Basis I X)
(hY : I ⊆ Y)
(h : M.closure X = M.closure Y)
(hYE : Y ⊆ M.E := by aesop_mat)


@[simp]
theorem snd_intCast (n : ℤ) : (n : X q).snd = (0 : ZMod q)


theorem descPochhammer_eval_eq_ascPochhammer (r : R) (n : ℕ) :
    (descPochhammer R n).eval r = (ascPochhammer R n).eval (r - n + 1)

Polynomial.eval r (descPochhammer R n) = Polynomial.eval (r - ↑n + 1) (ascPochhammer R n)


@[elab_without_expected_type]
theorem irrefl_of [IsIrrefl α r] (a : α) : ¬a ≺ a

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


/-- Order without bottom elements. -/
class NoBotOrder (α : Type*) [LE α] : Prop where
  /-- For each term `a`, there is some `b` which is either incomparable or strictly smaller. -/
  exists_not_ge (a : α) : ∃ b, ¬a ≤ b

{α : Type u_3}
[LE α]
[self : NoBotOrder α]
(a : α)


/-- Implementation of `Mon_.equivLaxMonoidalFunctorPUnit`. -/
@[simps!]
def counitIso : monToLaxMonoidal C ⋙ laxMonoidalToMon C ≅ 𝟭 (Mon_ C)

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

((Mon_.EquivLaxMonoidalFunctorPUnit.counitIso C).hom.app X).hom = 𝟙 X.X


@[simp]
lemma rdrop_append_length {l₁ l₂ : List α} :
    List.rdrop (l₁ ++ l₂) (List.length l₂) = l₁


@[simp]
theorem succ_unbot :
    ∀ (a : WithBot α) (ha : a ≠ ⊥),
      succ (a.unbot ha) = (succ a).unbot (by induction a <;> simp)

{α : Type u_1}
[Preorder α]
[OrderBot α]
[SuccOrder α]
(a : WithBot α)
(ha : a ≠ ⊥)

Order.succ (a.unbot ha) = (Order.succ a).unbot ⋯


@[to_additive]
theorem tprod_sigma {γ : β → Type*} {f : (Σb : β, γ b) → α} (ha : Multipliable f) :
    ∏' p, f p = ∏' (b) (c), f ⟨b, c⟩

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

∏' (p : (b : β) × γ b), f p = ∏' (b : β) (c : γ b), f ⟨b, c⟩


/-- The `sInf` of a bounded-below set is its greatest lower bound for a conditionally
complete lattice with a top. -/
theorem isGLB_sInf' {β : Type*} [ConditionallyCompleteLattice β] {s : Set (WithTop β)}
    (hs : BddBelow s) : IsGLB s (sInf s)

{β : Type u_5}
[ConditionallyCompleteLattice β]
{s : Set (WithTop β)}
(hs : BddBelow s)


lemma limsup_add_lt_of_lt (ha : limsup u f < a) (hb : limsup v f < b) :
    limsup (u + v) f < a + b

{α : Type u_2}
{f : Filter α}
{u v : α → EReal}
{a b : EReal}
(ha : Filter.limsup u f < a)
(hb : Filter.limsup v f < b)


theorem coe_fold_l (b : α) (l : List α) : fold op b l = l.foldl op b

{α : Type u_1}
(op : α → α → α)
[hc : Std.Commutative op]
[ha : Std.Associative op]
(b : α)
(l : List α)

Multiset.fold op b ↑l = List.foldl op b l


theorem getD_eq_iff {o : Option α} {a b} : o.getD a = b ↔ (o = some b ∨ o = none ∧ a = b)

o.getD a = b ↔ o = some b ∨ o = none ∧ a = b


theorem Matrix.Represents.eq {A : Matrix ι ι R} {f f' : Module.End R M} (h : A.Represents b f)
    (h' : A.Represents b f') : f = f'

(hb : Submodule.span R (Set.range b) = ⊤)


@[deprecated (since := "2024-02-25")] theorem pairwise_map' (f : β → α) :
    ∀ {l : List β}, Pairwise R (map f l) ↔ Pairwise (fun a b : β => R (f a) (f b)) l

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

List.Pairwise R (List.map f l) ↔ List.Pairwise (fun a b => R (f a) (f b)) l


theorem Valid'.left {s l x r o₁ o₂} (H : Valid' o₁ (@Ordnode.node α s l x r) o₂) : Valid' o₁ l x

(H : Ordnode.Valid' o₁ (Ordnode.node s l x r) o₂)


@[simp]
theorem rcomap'_rcomap' (r : Rel α β) (s : Rel β γ) (l : Filter γ) :
    rcomap' r (rcomap' s l) = rcomap' (r.comp s) l

{α : Type u}
{β : Type v}
{γ : Type w}
(r : Rel α β)
(s : Rel β γ)
(l : Filter γ)

Filter.rcomap' r (Filter.rcomap' s l) = Filter.rcomap' (r.comp s) l


@[simp]
lemma evaluationEquivOfIsGalois_symm_fiber (A : C) [IsGalois A] (a b : F.obj A) :
    F.map ((evaluationEquivOfIsGalois F A a).symm b).hom a = b

(F : CategoryTheory.Functor C FintypeCat)

F.map ((CategoryTheory.PreGaloisCategory.evaluationEquivOfIsGalois F A a).symm b).hom a = b


@[to_additive (attr := simp high)]
theorem Finite.toFinset_one (h : (1 : Set α).Finite := finite_one) : h.toFinset = 1

{α : Type u_2}
[Zero α]
(h : Set.Finite 0 := ⋯)


/-- Commuting elements of finite order are closed under multiplication. -/
@[to_additive "Commuting elements of finite additive order are closed under addition."]
theorem isOfFinOrder_mul (h : Commute x y) (hx : IsOfFinOrder x) (hy : IsOfFinOrder y) :
    IsOfFinOrder (x * y)

{G : Type u_1}
[Monoid G]
{x y : G}
(h : Commute x y)
(hx : IsOfFinOrder x)
(hy : IsOfFinOrder y)


@[simp] theorem ofReal_zero : ENNReal.ofReal (0 : ℝ) = 0


@[to_additive]
theorem Nonempty.mul : s.Nonempty → t.Nonempty → (s * t).Nonempty

{α : Type u_2}
[DecidableEq α]
[Mul α]
{s t : Finset α}


lemma Integrable.snd {f : α → E × F} (hf : Integrable f μ) : Integrable (fun x ↦ (f x).2) μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{E : Type u_5}
{F : Type u_6}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{f : α → E × F}
(hf : MeasureTheory.Integrable f μ)

MeasureTheory.Integrable (fun x => (f x).2) μ


@[simp]
theorem quotEquivOfEqBot_apply_mk (hp : p = ⊥) (x : M) :
    p.quotEquivOfEqBot hp (Quotient.mk x : M ⧸ p) = x

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

(p.quotEquivOfEqBot hp) (Submodule.Quotient.mk x) = x


theorem add_int (h : Irrational x) (m : ℤ) : Irrational (x + m)


@[to_additive]
theorem mulEquivOfQuotient_monoidOf (x) :
    mulEquivOfQuotient f ((monoidOf S).toMap x) = f.toMap x

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

(Localization.mulEquivOfQuotient f) ((Localization.monoidOf S).toMap x) = f.toMap x


theorem tendsto_log_nhdsWithin_im_neg_of_re_neg_of_im_zero {z : ℂ} (hre : z.re < 0)
    (him : z.im = 0) : Tendsto log (𝓝[{ z : ℂ | z.im < 0 }] z) (𝓝 <| Real.log (abs z) - π * I)

Filter.Tendsto Complex.log (nhdsWithin z {z | z.im < 0}) (nhds (↑(Real.log (Complex.abs z)) - ↑Real.pi * Complex.I))


theorem pi_generateFrom_eq {π : ι → Type*} {g : ∀ a, Set (Set (π a))} :
    (@Pi.topologicalSpace ι π fun a => generateFrom (g a)) =
      generateFrom
        { t | ∃ (s : ∀ a, Set (π a)) (i : Finset ι), (∀ a ∈ i, s a ∈ g a) ∧ t = pi (↑i) s }

{ι : Type u_5}
{π : ι → Type u_8}
{g : (a : ι) → Set (Set (π a))}

Pi.topologicalSpace = TopologicalSpace.generateFrom {t | ∃ s i, (∀ a ∈ i, s a ∈ g a) ∧ t = (↑i).pi s}


theorem toSubordinate_toPrepartition_le (π : Prepartition I) (r : (ι → ℝ) → Ioi (0 : ℝ)) :
    (π.toSubordinate r).toPrepartition ≤ π

{ι : Type u_1}
[Fintype ι]
{I : BoxIntegral.Box ι}
(π : BoxIntegral.Prepartition I)
(r : (ι → ℝ) → ↑(Set.Ioi 0))


theorem coeFn_compMeasurable (g : β → γ) (hg : Measurable g) (f : α →ₘ[μ] β) :
    compMeasurable g hg f =ᵐ[μ] g ∘ f

↑(MeasureTheory.AEEqFun.compMeasurable g hg f) =ᵐ[μ] g ∘ ↑f


@[simp]
theorem lift_of (f : Generators G → H) (a : Generators G) : lift f (of a) = f a

{G : Type u_1}
[Group G]
[IsFreeGroup G]
{H : Type u_2}
[Group H]
(f : IsFreeGroup.Generators G → H)
(a : IsFreeGroup.Generators G)

(IsFreeGroup.lift f) (IsFreeGroup.of a) = f a


theorem mul_le_dist (hf : AntilipschitzWith K f) (x y : α) :
    (K⁻¹ * dist x y : ℝ) ≤ dist (f x) (f y)

{α : Type u_1}
{β : Type u_2}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
{K : ℝ≥0}
{f : α → β}
(hf : AntilipschitzWith K f)
(x y : α)


theorem comap_injective_of_surjective : Injective (comap f)

{R : Type u}
{S : Type v}
{F : Type u_1}
[Semiring R]
[Semiring S]
[FunLike F R S]
[rc : RingHomClass F R S]
(f : F)
(hf : Function.Surjective ⇑f)


@[simp]
theorem deleteEdges_inter_edgeSet_right_eq :
    G'.deleteEdges (s ∩ G'.edgeSet) = G'.deleteEdges s

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


/--
In an affine open set `U`, a family of basic open covers `U` iff the sections span `Γ(X, U)`.
See `iSup_basicOpen_of_span_eq_top` for the inverse direction without the affine-ness assuption.
-/
theorem basicOpen_union_eq_self_iff (s : Set Γ(X, U)) :
    ⨆ f : s, X.basicOpen (f : Γ(X, U)) = U ↔ Ideal.span s = ⊤

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

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


theorem inf_semanticallyEquivalent_not_sup_not :
    T.SemanticallyEquivalent (φ ⊓ ψ) (φ.not ⊔ ψ.not).not

{L : FirstOrder.Language}
{T : L.Theory}
{α : Type w}
(φ ψ : L.Formula α)


/-- The composition of two group homomorphisms is a group homomorphism. -/
@[to_additive
      "The composition of two additive group homomorphisms is an additive
      group homomorphism."]
theorem comp (hf : IsGroupHom f) {γ} [Group γ] {g : β → γ} (hg : IsGroupHom g) :
    IsGroupHom (g ∘ f)

{α : Type u}
{β : Type v}
[Group α]
[Group β]
{f : α → β}
(hf : IsGroupHom f)
{γ : Type u_1}
[Group γ]
{g : β → γ}
(hg : IsGroupHom g)


@[to_additive (attr := simp)]
theorem liftOnUnits_mk (f : ∀ x y : M, c (x * y) 1 → c (y * x) 1 → α)
    (Hf : ∀ x y hxy hyx x' y' hxy' hyx', c x x' → c y y' → f x y hxy hyx = f x' y' hxy' hyx')
    (x y : M) (hxy hyx) :
    liftOnUnits ⟨(x : c.Quotient), y, hxy, hyx⟩ f Hf = f x y (c.eq.1 hxy) (c.eq.1 hyx)

(f : (x y : M) → c (x + y) 0 → c (y + x) 0 → α)

(Hf :
  ∀ (x y : M) (hxy : c (x + y) 0) (hyx : c (y + x) 0) (x' y' : M) (hxy' : c (x' + y') 0) (hyx' : c (y' + x') 0),
    c x x' → c y y' → f x y hxy hyx = f x' y' hxy' hyx')

AddCon.liftOnAddUnits { val := ↑x, neg := ↑y, val_neg := hxy, neg_val := hyx } f Hf = f x y ⋯ ⋯


theorem prev_cons_cons_eq' (y z : α) (h : x ∈ y :: z :: l) (hx : x = y) :
    prev (y :: z :: l) x h = getLast (z :: l) (cons_ne_nil _ _)

{α : Type u_1}
[DecidableEq α]
(l : List α)
(x y z : α)
(h : x ∈ y :: z :: l)
(hx : x = y)

(y :: z :: l).prev x h = (z :: l).getLast ⋯


@[simp]
theorem tensorLeftHomEquiv_symm_coevaluation_comp_whiskerLeft {Y Y' Z : C} [ExactPairing Y Y']
    (f : Y' ⟶ Z) : (tensorLeftHomEquiv _ _ _ _).symm (η_ _ _ ≫ Y ◁ f) = (ρ_ _).hom ≫ f

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

(CategoryTheory.tensorLeftHomEquiv (𝟙_ C) Y Y' Z).symm (η_ Y Y' ≫ Y ◁ f) = (ρ_ Y').hom ≫ f


@[to_additive]
theorem Nonempty.of_mul_right : (s * t).Nonempty → t.Nonempty

{α : Type u_2}
[DecidableEq α]
[Add α]
{s t : Finset α}


protected theorem inv_inv {x : tsze R M} (hx : fst x ≠ 0) : x⁻¹⁻¹ = x

{R : Type u}
{M : Type v}
[DivisionSemiring R]
[AddCommGroup M]
[Module Rᵐᵒᵖ M]
[Module R M]
[SMulCommClass R Rᵐᵒᵖ M]
{x : tsze R M}
(hx : x.fst ≠ 0)


@[simp]
theorem ofFn_get (v : Vector α n) : ofFn (get v) = v

{n : ℕ}
{α : Type u_1}
(v : Mathlib.Vector α n)


theorem map_sub_swap (x y : R) : f (x - y) = f (y - x)

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


theorem IsRelPrime.of_add_mul_right_right (h : IsRelPrime x (y + z * x)) : IsRelPrime x y

{R : Type u}
[CommSemiring R]
{x y z : R}
(h : IsRelPrime x (y + z * x))


@[simp]
theorem sum_snd : (p.sum q).snd = Sum.inr q.snd

{α : Type u_1}
{β : Type u_2}
(p : TwoPointing α)
(q : TwoPointing β)


/-- The variant of `chaar_self` for `haarContent` -/
@[to_additive "The variant of `addCHaar_self` for `addHaarContent`."]
theorem haarContent_self {K₀ : PositiveCompacts G} : haarContent K₀ K₀.toCompacts = 1

{K₀ : TopologicalSpace.PositiveCompacts G}

(fun s => ↑((MeasureTheory.Measure.haar.haarContent K₀).toFun s)) K₀.toCompacts = 1


@[simp]
theorem subsingleton_iff : Subsingleton (LieSubmodule R L M) ↔ Subsingleton M

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


theorem support_update (f : Π₀ i, β i) (i : ι) (b : β i) [Decidable (b = 0)] :
    support (f.update i b) = if b = 0 then support (f.erase i) else insert i f.support

[(i : ι) → (x : β i) → Decidable (x ≠ 0)]

(DFinsupp.update i f b).support = if b = 0 then (DFinsupp.erase i f).support else insert i f.support


theorem fixInduction_spec {C : α → Sort*} {f : α →. β ⊕ α} {b : β} {a : α} (h : b ∈ f.fix a)
    (H : ∀ a', b ∈ f.fix a' → (∀ a'', Sum.inr a'' ∈ f a' → C a'') → C a') :
    @fixInduction _ _ C _ _ _ h H = H a h fun a' h' => fixInduction (fix_fwd h h') H

{f : α →. β ⊕ α}

(H : (a' : α) → b ∈ f.fix a' → ((a'' : α) → Sum.inr a'' ∈ f a' → C a'') → C a')

PFun.fixInduction h H = H a h fun a' h' => PFun.fixInduction ⋯ H


@[higher_order fst_id]
theorem id_fst : ∀ {α β} (x : F α β), fst id x = x

{F : Type u₀ → Type u₁ → Type u₂}
[Bifunctor F]
[LawfulBifunctor F]
{α : Type u₀}
{β : Type u₁}
(x : F α β)


theorem not_perm_nil_cons (x : α) (l : List α) : ¬[] ~ x :: l


lemma mem_conductorSet_iff {x : ℕ} : x ∈ conductorSet χ ↔ FactorsThrough χ x

{R : Type u_1}
[CommMonoidWithZero R]
{n : ℕ}
(χ : DirichletCharacter R n)
{x : ℕ}


theorem irrational_sqrt_intCast_iff_of_nonneg {z : ℤ} (hz : 0 ≤ z) :
    Irrational (√z) ↔ ¬IsSquare z


/-- If `f : R → S` descends to an integral map in the localization at `x`,
  and `R` is a Jacobson ring, then the intersection of all maximal ideals in `S` is trivial -/
theorem jacobson_bot_of_integral_localization {R : Type*} [CommRing R] [IsDomain R] [IsJacobson R]
    (Rₘ Sₘ : Type*) [CommRing Rₘ] [CommRing Sₘ] (φ : R →+* S) (hφ : Function.Injective ↑φ) (x : R)
    (hx : x ≠ 0) [Algebra R Rₘ] [IsLocalization.Away x Rₘ] [Algebra S Sₘ]
    [IsLocalization ((Submonoid.powers x).map φ : Submonoid S) Sₘ]
    (hφ' :
      RingHom.IsIntegral (IsLocalization.map Sₘ φ (Submonoid.powers x).le_comap_map : Rₘ →+* Sₘ)) :
    (⊥ : Ideal S).jacobson = (⊥ : Ideal S)

[IsLocalization (Submonoid.map φ (Submonoid.powers x)) Sₘ]

(hφ' : (IsLocalization.map Sₘ φ ⋯).IsIntegral)


/-- An object in `Type u` is initial if and only if it is empty. -/
lemma initial_iff_empty (X : Type u) : Nonempty (IsInitial X) ↔ IsEmpty X

Nonempty (CategoryTheory.Limits.IsInitial X) ↔ IsEmpty X


theorem smul_right (m₀ : M) {U : Set M} (hU : U ∈ B) : ∀ᶠ x in 𝓝 (0 : R), x • m₀ ∈ U

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[TopologicalSpace R]
[AddCommGroup M]
[Module R M]
(B : ModuleFilterBasis R M)
(m₀ : M)
{U : Set M}
(hU : U ∈ B)


theorem coe_algebraMap_ofSubsemiring (S : Subsemiring R) : (algebraMap S R : S → R) = Subtype.val

{R : Type u}
[CommSemiring R]
(S : Subsemiring R)


theorem quadratic_le_exp_of_nonneg {x : ℝ} (hx : 0 ≤ x) : 1 + x + x ^ 2 / 2 ≤ exp x


/-- An equipartition of a finset with `n` elements into `k` parts has
`n % k` parts of size `n / k + 1`. -/
theorem IsEquipartition.card_large_parts_eq_mod (hP : P.IsEquipartition) :
    (P.parts.filter fun p ↦ p.card = s.card / P.parts.card + 1).card = s.card % P.parts.card

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
{P : Finpartition s}
(hP : P.IsEquipartition)

(Finset.filter (fun p => p.card = s.card / P.parts.card + 1) P.parts).card = s.card % P.parts.card


@[reassoc]
theorem coprod.map_codiag {X Y : C} (f : X ⟶ Y) [HasBinaryCoproduct X X] [HasBinaryCoproduct Y Y] :
    coprod.map f f ≫ codiag Y = codiag X ≫ f

CategoryTheory.Limits.coprod.map f f ≫ CategoryTheory.Limits.codiag Y = CategoryTheory.Limits.codiag X ≫ f


theorem IsLocalization.scaleRoots_commonDenom_mem_lifts (p : Rₘ[X])
    (hp : p.leadingCoeff ∈ (algebraMap R Rₘ).range) :
    p.scaleRoots (algebraMap R Rₘ <| IsLocalization.commonDenom M p.support p.coeff) ∈
      Polynomial.lifts (algebraMap R Rₘ)

p.scaleRoots ((algebraMap R Rₘ) ↑(IsLocalization.commonDenom M p.support p.coeff)) ∈ Polynomial.lifts (algebraMap R Rₘ)


theorem symm_symm_apply (e : P₁ ≃ᵃL[k] P₂) (x : P₁) : e.symm.symm x = e x

{k : Type u_1}
{P₁ : Type u_2}
{P₂ : Type u_3}
{V₁ : Type u_6}
{V₂ : Type u_7}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AddTorsor V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AddTorsor V₂ P₂]
[TopologicalSpace P₁]
[TopologicalSpace P₂]
(e : P₁ ≃ᵃL[k] P₂)
(x : P₁)


/-- The supremum of a set of congruence relations `S` equals the smallest congruence relation
    containing the binary relation 'there exists `c ∈ S` such that `x` is related to `y` by
    `c`'. -/
theorem sSup_eq_ringConGen (S : Set (RingCon R)) :
    sSup S = ringConGen fun x y => ∃ c : RingCon R, c ∈ S ∧ c x y

{R : Type u_2}
[Add R]
[Mul R]
(S : Set (RingCon R))

sSup S = ringConGen fun x y => ∃ c ∈ S, c x y


theorem Prefunctor.isCovering_of_bijective_costar (h : ∀ u, Bijective (φ.costar u)) :
    φ.IsCovering

(h : ∀ (u : U), Function.Bijective (φ.costar u))


theorem log_natCast_nonneg (n : ℕ) : 0 ≤ log n


theorem semanticallyEquivalent_not_not : T.SemanticallyEquivalent φ φ.not.not

{L : FirstOrder.Language}
{T : L.Theory}
{α : Type w}
(φ : L.Formula α)


theorem lt_sizeof_cons' {b} (a : Lists' α b) (l) :
    SizeOf.sizeOf (⟨b, a⟩ : Lists α) < SizeOf.sizeOf (Lists'.cons' a l)

{α : Type u_1}
{b : Bool}
(a : Lists' α b)
(l : Lists' α true)


@[simp]
theorem res_length (x : ℕ → α) (n : ℕ) : (res x n).length = n


/-- The set of points in a sphere is cospherical. -/
theorem Sphere.cospherical (s : Sphere P) : Cospherical (s : Set P)

{P : Type u_2}
[MetricSpace P]
(s : EuclideanGeometry.Sphere P)

EuclideanGeometry.Cospherical (Metric.sphere s.center s.radius)


/-- Given a triangle of the form:
```
      f       g       h
  X  ───> Y  ───> Z  ───> X⟦1⟧
```
applying `invRotate` gives a triangle that can be thought of as:
```
        -h⟦-1⟧'     f       g
  Z⟦-1⟧  ───>  X  ───> Y  ───> Z
```
(note that this diagram doesn't technically fit the definition of triangle, as `Z⟦-1⟧⟦1⟧` is
not necessarily equal to `Z`, but it is isomorphic, by the `counitIso` of `shiftEquiv C 1`)
-/
@[simps!]
def Triangle.invRotate (T : Triangle C) : Triangle C

(T : CategoryTheory.Pretriangulated.Triangle C)


/-- L'Hôpital's rule for approaching -∞, `HasDerivAt` version -/
theorem lhopital_zero_atBot (hff' : ∀ᶠ x in atBot, HasDerivAt f (f' x) x)
    (hgg' : ∀ᶠ x in atBot, HasDerivAt g (g' x) x) (hg' : ∀ᶠ x in atBot, g' x ≠ 0)
    (hfbot : Tendsto f atBot (𝓝 0)) (hgbot : Tendsto g atBot (𝓝 0))
    (hdiv : Tendsto (fun x => f' x / g' x) atBot l) : Tendsto (fun x => f x / g x) atBot l

(hff' : ∀ᶠ (x : ℝ) in Filter.atBot, HasDerivAt f (f' x) x)

(hgg' : ∀ᶠ (x : ℝ) in Filter.atBot, HasDerivAt g (g' x) x)

(hg' : ∀ᶠ (x : ℝ) in Filter.atBot, g' x ≠ 0)

(hfbot : Filter.Tendsto f Filter.atBot (𝓝 0))

(hgbot : Filter.Tendsto g Filter.atBot (𝓝 0))

(hdiv : Filter.Tendsto (fun x => f' x / g' x) Filter.atBot l)

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


@[simp]
theorem apply_symm_apply (e : A ≃⋆+* B) : ∀ x, e (e.symm x) = x

{A : Type u_1}
{B : Type u_2}
[Add A]
[Add B]
[Mul A]
[Mul B]
[Star A]
[Star B]
(e : A ≃⋆+* B)
(x : B)


theorem average_add_measure [IsFiniteMeasure μ] {ν : Measure α} [IsFiniteMeasure ν] {f : α → E}
    (hμ : Integrable f μ) (hν : Integrable f ν) :
    ⨍ x, f x ∂(μ + ν) =
      ((μ univ).toReal / ((μ univ).toReal + (ν univ).toReal)) • ⨍ x, f x ∂μ +
        ((ν univ).toReal / ((μ univ).toReal + (ν univ).toReal)) • ⨍ x, f x ∂ν

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{μ : MeasureTheory.Measure α}
[MeasureTheory.IsFiniteMeasure μ]
{ν : MeasureTheory.Measure α}
[MeasureTheory.IsFiniteMeasure ν]
{f : α → E}
(hμ : MeasureTheory.Integrable f μ)
(hν : MeasureTheory.Integrable f ν)

⨍ (x : α), f x ∂(μ + ν) =
  ((μ Set.univ).toReal / ((μ Set.univ).toReal + (ν Set.univ).toReal)) • ⨍ (x : α), f x ∂μ +
    ((ν Set.univ).toReal / ((μ Set.univ).toReal + (ν Set.univ).toReal)) • ⨍ (x : α), f x ∂ν


theorem derivWithin_div (hc : DifferentiableWithinAt 𝕜 c s x) (hd : DifferentiableWithinAt 𝕜 d s x)
    (hx : d x ≠ 0) (hxs : UniqueDiffWithinAt 𝕜 s x) :
    derivWithin (fun x => c x / d x) s x =
      (derivWithin c s x * d x - c x * derivWithin d s x) / d x ^ 2

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{s : Set 𝕜}
{𝕜' : Type u_1}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
{c d : 𝕜 → 𝕜'}
(hc : DifferentiableWithinAt 𝕜 c s x)
(hd : DifferentiableWithinAt 𝕜 d s x)
(hx : d x ≠ 0)
(hxs : UniqueDiffWithinAt 𝕜 s x)


lemma biInf_le {ι : Type*} {s : Set ι} (f : ι → α) {i : ι} (hi : i ∈ s) :
    ⨅ i ∈ s, f i ≤ f i

{α : Type u_1}
[CompleteLattice α]
{ι : Type u_9}
{s : Set ι}
(f : ι → α)
{i : ι}
(hi : i ∈ s)


theorem support_sup_union_support_inf : (f ⊔ g).support ∪ (f ⊓ g).support = f.support ∪ g.support

{ι : Type u_1}
{α : Type u_2}
[Zero α]
[DecidableEq ι]
[Lattice α]
(f g : ι →₀ α)


@[simp]
theorem irrational_mul_rat_iff : Irrational (x * q) ↔ q ≠ 0 ∧ Irrational x

Irrational (x * ↑q) ↔ q ≠ 0 ∧ Irrational x


theorem lift_lift'_same_eq_lift' {g : Set α → Set α → Set β} (hg₁ : ∀ s, Monotone fun t => g s t)
    (hg₂ : ∀ t, Monotone fun s => g s t) :
    (f.lift fun s => f.lift' (g s)) = f.lift' fun s => g s s

(hg₁ : ∀ (s : Set α), Monotone fun t => g s t)

(hg₂ : ∀ (t : Set α), Monotone fun s => g s t)


lemma pos_of_isRat {n : ℤ} {d : ℕ} [LinearOrderedRing A] :
    (NormNum.IsRat e n d) → (decide (0 < n)) → ((0 : A) < (e : A))

{A : Type u_1}
{e : A}
{n : ℤ}
{d : ℕ}
[LinearOrderedRing A]

Mathlib.Meta.NormNum.IsRat e n d → decide (0 < n) = true → 0 < e


/-- Composition of pseudofunctors. -/
@[simps]
def comp (F : Pseudofunctor B C) (G : Pseudofunctor C D) : Pseudofunctor B D

{B : Type u₁}
[CategoryTheory.Bicategory B]
{C : Type u₂}
[CategoryTheory.Bicategory C]
{D : Type u₃}
[CategoryTheory.Bicategory D]
(F : CategoryTheory.Pseudofunctor B C)
(G : CategoryTheory.Pseudofunctor C D)

∀ {a b c : B} (f : a ⟶ b) (g : b ⟶ c),
  (F.comp G).mapComp f g = G.map₂Iso (F.mapComp f g) ≪≫ G.mapComp (F.map f) (F.map g)


theorem div_zero_subset (s : Finset α) : s / 0 ⊆ 0

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


/-- `Finsupp.mapRange` as an equiv. -/
@[simps apply]
def mapRange.equiv (f : M ≃ N) (hf : f 0 = 0) (hf' : f.symm 0 = 0) : (α →₀ M) ≃ (α →₀ N)

{α : Type u_1}
{M : Type u_5}
{N : Type u_7}
[Zero M]
[Zero N]
(f : M ≃ N)
(hf : f 0 = 0)
(hf' : f.symm 0 = 0)
(g : α →₀ M)

(Finsupp.mapRange.equiv f hf hf') g = Finsupp.mapRange (⇑f) hf g


@[simp]
theorem coeff_mul_monomial (m) (s : σ →₀ ℕ) (r : R) (p : MvPolynomial σ R) :
    coeff (m + s) (p * monomial s r) = coeff m p * r

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(m s : σ →₀ ℕ)
(r : R)
(p : MvPolynomial σ R)

MvPolynomial.coeff (m + s) (p * (MvPolynomial.monomial s) r) = MvPolynomial.coeff m p * r


theorem map_sub_le (x y : V) : e (x - y) ≤ e x + e y

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


theorem associatesEquivIsPrincipal_mul (x y : Associates R) :
    (associatesEquivIsPrincipal R (x * y) : Ideal R) =
      (associatesEquivIsPrincipal R x) * (associatesEquivIsPrincipal R y)

{R : Type u_1}
[CommRing R]
[IsDomain R]
(x y : Associates R)

↑((Ideal.associatesEquivIsPrincipal R) (x * y)) =
  ↑((Ideal.associatesEquivIsPrincipal R) x) * ↑((Ideal.associatesEquivIsPrincipal R) y)


@[to_additive]
theorem srange_top_iff_surjective {N} [Mul N] {f : M →ₙ* N} :
    f.srange = (⊤ : Subsemigroup N) ↔ Function.Surjective f

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


@[simp]
theorem Decomposition.decompose'_eq : Decomposition.decompose' = decompose ℳ

{ι : Type u_1}
{M : Type u_3}
{σ : Type u_4}
[DecidableEq ι]
[AddCommMonoid M]
[SetLike σ M]
[AddSubmonoidClass σ M]
(ℳ : ι → σ)
[DirectSum.Decomposition ℳ]

DirectSum.Decomposition.decompose' = ⇑(DirectSum.decompose ℳ)


@[simp]
theorem sep_subset (s : Set α) (p : α → Prop) : { x ∈ s | p x } ⊆ s


theorem mem_sym2_iff {m : Multiset α} {z : Sym2 α} :
    z ∈ m.sym2 ↔ ∀ y ∈ z, y ∈ m

{α : Type u_1}
{m : Multiset α}
{z : Sym2 α}


/-- See also `List.zip_replicate` in `Init.Data.List.TakeDrop` for a generalization with different lengths. -/
@[simp] theorem zip_replicate' {a : α} {b : β} {n : Nat} :
    zip (replicate n a) (replicate n b) = replicate n (a, b)

{α : Type u_1}
{β : Type u_2}
{a : α}
{b : β}
{n : Nat}

(List.replicate n a).zip (List.replicate n b) = List.replicate n (a, b)


theorem bind_dirac {f : α → Measure β} (hf : Measurable f) (a : α) : bind (dirac a) f = f a

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
{f : α → MeasureTheory.Measure β}
(hf : Measurable f)
(a : α)

(MeasureTheory.Measure.dirac a).bind f = f a


theorem aeval_X_left : aeval X = AlgHom.id R (MvPolynomial σ R)

{R : Type u}
{σ : Type u_1}
[CommSemiring R]

MvPolynomial.aeval MvPolynomial.X = AlgHom.id R (MvPolynomial σ R)


/-- Given an adjunction `F ⊣ G`, this provides the natural adjunction
  `(whiskeringLeft _ _ C).obj G ⊣ (whiskeringLeft _ _ C).obj F`. -/
@[simps! unit_app_app counit_app_app]
protected def whiskerLeft (adj : F ⊣ G) :
    (whiskeringLeft E D C).obj G ⊣ (whiskeringLeft D E C).obj F

(C : Type u_1)
{D : Type u_2}
{E : Type u_3}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Category.{u_5, u_2} D]
[CategoryTheory.Category.{u_6, u_3} E]
{F : CategoryTheory.Functor D E}
{G : CategoryTheory.Functor E D}
(adj : F ⊣ G)
(X : CategoryTheory.Functor E C)

∀ (X_1 : E), ((CategoryTheory.Adjunction.whiskerLeft C adj).counit.app X).app X_1 = X.map (adj.counit.app X_1)


theorem IsPrefix.isInfix : l₁ <+: l₂ → l₁ <:+: l₂

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


theorem mk_eq_add_mul_I (a b : ℝ) : Complex.mk a b = a + b * I

{ re := a, im := b } = ↑a + ↑b * Complex.I


@[simp] lemma partition_zero_parts (p : Partition 0) : p.parts = 0


@[to_additive (attr := simp)]
theorem mulIndicator_const_iff :
    EventuallyConst (s.mulIndicator fun _ ↦ c) l ↔ c = 1 ∨ EventuallyConst s l

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
[One β]
{s : Set α}
{c : β}

Filter.EventuallyConst (s.mulIndicator fun x => c) l ↔ c = 1 ∨ Filter.EventuallyConst s l


theorem get_permutations'Aux (s : List α) (x : α) (n : ℕ)
    (hn : n < length (permutations'Aux x s)) :
    (permutations'Aux x s).get ⟨n, hn⟩ = s.insertNth n x

(hn : n < (List.permutations'Aux x s).length)

(List.permutations'Aux x s).get ⟨n, hn⟩ = List.insertNth n x s


theorem ofMul_image_zpowers_eq_zmultiples_ofMul {x : G} :
    Additive.ofMul '' (Subgroup.zpowers x : Set G) = AddSubgroup.zmultiples (Additive.ofMul x)

⇑Additive.ofMul '' ↑(Subgroup.zpowers x) = ↑(AddSubgroup.zmultiples (Additive.ofMul x))


@[continuity]
theorem continuous_uLift_up [TopologicalSpace X] : Continuous (ULift.up : X → ULift.{v, u} X)


/-- If a real function `f` has a derivative `g` everywhere but at a point, and `f` and `g` are
continuous at this point, then `g` is the derivative of `f` everywhere. -/
theorem hasDerivAt_of_hasDerivAt_of_ne' {f g : ℝ → E} {x : ℝ}
    (f_diff : ∀ y ≠ x, HasDerivAt f (g y) y) (hf : ContinuousAt f x)
    (hg : ContinuousAt g x) (y : ℝ) : HasDerivAt f (g y) y

(f_diff : ∀ (y : ℝ), y ≠ x → HasDerivAt f (g y) y)


@[to_additive]
protected lemma inv [Inv β] (h : EventuallyConst f l) : EventuallyConst (f⁻¹) l

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
{f : α → β}
[Neg β]
(h : Filter.EventuallyConst f l)


@[simp]
theorem Multiset.toEnumFinset_subset_iff {m₁ m₂ : Multiset α} :
    m₁.toEnumFinset ⊆ m₂.toEnumFinset ↔ m₁ ≤ m₂

{α : Type u_1}
[DecidableEq α]
{m₁ m₂ : Multiset α}


theorem eq_of_false {a b : Prop} (ha : ¬a) (hb : ¬b) : a = b


@[simp]
theorem isGLB_preimage {s : Set β} {x : α} : IsGLB (f ⁻¹' s) x ↔ IsGLB s (f x)

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


/-- The **Gagliardo-Nirenberg-Sobolev inequality**.  Let `u` be a continuously differentiable
compactly-supported function `u` on a normed space `E` of finite dimension `n ≥ 2`, equipped
with Haar measure. Then the Lebesgue integral of the pointwise expression
`|u x| ^ (n / (n - 1))` is bounded above by a constant times the `n / (n - 1)`-th power of the
Lebesgue integral of the Fréchet derivative of `u`. -/
theorem lintegral_pow_le_pow_lintegral_fderiv {u : E → F}
    (hu : ContDiff ℝ 1 u) (h2u : HasCompactSupport u)
    {p : ℝ} (hp : Real.IsConjExponent (finrank ℝ E) p) :
    ∫⁻ x, (‖u x‖₊ : ℝ≥0∞) ^ p ∂μ ≤
    lintegralPowLePowLIntegralFDerivConst μ p * (∫⁻ x, ‖fderiv ℝ u x‖₊ ∂μ) ^ p

(hp : (↑(FiniteDimensional.finrank ℝ E)).IsConjExponent p)

∫⁻ (x : E), ↑‖u x‖₊ ^ p ∂μ ≤
  ↑(MeasureTheory.lintegralPowLePowLIntegralFDerivConst μ p) * (∫⁻ (x : E), ↑‖fderiv ℝ u x‖₊ ∂μ) ^ p


theorem preimage_closure_eq_closure_preimage (hf : IsOpenMap f) (hfc : Continuous f) (s : Set Y) :
    f ⁻¹' closure s = closure (f ⁻¹' s)

{X : Type u_1}
{Y : Type u_2}
{f : X → Y}
[TopologicalSpace X]
[TopologicalSpace Y]
(hf : IsOpenMap f)
(hfc : Continuous f)
(s : Set Y)


/--
Monoid objects in `C` are "just" lax monoidal functors from the trivial monoidal category to `C`.
-/
@[simps]
def equivLaxMonoidalFunctorPUnit : LaxMonoidalFunctor (Discrete PUnit.{u + 1}) C ≌ Mon_ C

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

(Mon_.equivLaxMonoidalFunctorPUnit C).inverse = Mon_.EquivLaxMonoidalFunctorPUnit.monToLaxMonoidal C


@[simp]
theorem relMap_sum_inl {n : ℕ} (R : L₁.Relations n) :
    @RelMap (L₁.sum L₂) S _ n (Sum.inl R) = RelMap R

{L₁ : FirstOrder.Language}
{L₂ : FirstOrder.Language}
{S : Type u_3}
[L₁.Structure S]
[L₂.Structure S]
{n : ℕ}
(R : L₁.Relations n)

FirstOrder.Language.Structure.RelMap (Sum.inl R) = FirstOrder.Language.Structure.RelMap R


theorem superpolynomialDecay_iff_isLittleO (hk : Tendsto k l atTop) :
    SuperpolynomialDecay l k f ↔ ∀ z : ℤ, f =o[l] fun a : α => k a ^ z

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
{k : α → β}
(f : α → β)
[NormedLinearOrderedField β]
[OrderTopology β]
(hk : Filter.Tendsto k l Filter.atTop)

Asymptotics.SuperpolynomialDecay l k f ↔ ∀ (z : ℤ), f =o[l] fun a => k a ^ z


@[simp]
lemma fst_swapRight (κ : Kernel α (β × γ)) : fst (swapRight κ) = snd κ

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


@[simp]
theorem iInter_of_empty [IsEmpty ι] (s : ι → Set α) : ⋂ i, s i = univ

{α : Type u_1}
{ι : Sort u_4}
[IsEmpty ι]
(s : ι → Set α)


theorem superFactorial_succ (n : ℕ) : (sf n.succ) = (n + 1)! * sf n

n.succ.superFactorial = (n + 1).factorial * n.superFactorial


/-- Embedding into `WithTop α`. -/
@[simps]
def coeWithTop {α} : α ↪ WithTop α

∀ (a : α), Function.Embedding.coeWithTop a = ↑a


theorem IsGLB.frequently_nhds_mem {a : α} {s : Set α} (ha : IsGLB s a) (hs : s.Nonempty) :
    ∃ᶠ x in 𝓝 a, x ∈ s

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{a : α}
{s : Set α}
(ha : IsGLB s a)
(hs : s.Nonempty)


@[to_additive]
lemma _root_.map_multiset_prod [FunLike F α β] [MonoidHomClass F α β] (f : F) (s : Multiset α) :
    f s.prod = (s.map f).prod

{F : Type u_1}
{α : Type u_3}
{β : Type u_4}
[CommMonoid α]
[CommMonoid β]
[FunLike F α β]
[MonoidHomClass F α β]
(f : F)
(s : Multiset α)


theorem map_mono (h : m₁ ≤ m₂) : m₁.map f ≤ m₂.map f

{α : Type u_1}
{β : Type u_2}
{m₁ m₂ : MeasurableSpace α}
{f : α → β}
(h : m₁ ≤ m₂)

MeasurableSpace.map f m₁ ≤ MeasurableSpace.map f m₂


theorem ext' {a b : SimplexCategory} (f g : SimplexCategory.Hom a b) :
    f.toOrderHom = g.toOrderHom → f = g


/--
The multiplicative congruences on `M` bijects to the multiplicative congruences on `Mᵐᵒᵖ`
-/
@[to_additive (attr := simps) "The additive congruences on `M` bijects to the additive congruences
on `Mᵃᵒᵖ`"]
def orderIsoOp : Con M ≃o Con Mᵐᵒᵖ


/-- Reinterpret a bundled monotone function as a monotone function between dual orders. -/
@[simps]
protected def dual : (α →o β) ≃ (αᵒᵈ →o βᵒᵈ)

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
(f : αᵒᵈ →o βᵒᵈ)

∀ (a : α), (OrderHom.dual.symm f) a = (⇑OrderDual.ofDual ∘ ⇑f ∘ ⇑OrderDual.toDual) a


@[simp]
theorem pi_piecewise {ι : Type*} {α : ι → Type*} (s s' : Set ι) (t t' : ∀ i, Set (α i))
    [∀ x, Decidable (x ∈ s')] : pi s (s'.piecewise t t') = pi (s ∩ s') t ∩ pi (s \ s') t'

{ι : Type u_7}
{α : ι → Type u_8}
(s s' : Set ι)
(t t' : (i : ι) → Set (α i))
[(x : ι) → Decidable (x ∈ s')]

s.pi (s'.piecewise t t') = (s ∩ s').pi t ∩ (s \ s').pi t'


/-- The product of two circulant matrices `circulant v` and `circulant w` is
    the circulant matrix generated by `circulant v *ᵥ w`. -/
theorem circulant_mul [Semiring α] [Fintype n] [AddGroup n] (v w : n → α) :
    circulant v * circulant w = circulant (circulant v *ᵥ w)

{α : Type u_1}
{n : Type u_4}
[Semiring α]
[Fintype n]
[AddGroup n]
(v w : n → α)

Matrix.circulant v * Matrix.circulant w = Matrix.circulant ((Matrix.circulant v).mulVec w)


theorem singleton_span_mem_normalizedFactors_of_mem_normalizedFactors [NormalizationMonoid R]
    {a b : R} (ha : a ∈ normalizedFactors b) :
    Ideal.span ({a} : Set R) ∈ normalizedFactors (Ideal.span ({b} : Set R))

(ha : a ∈ UniqueFactorizationMonoid.normalizedFactors b)

Ideal.span {a} ∈ UniqueFactorizationMonoid.normalizedFactors (Ideal.span {b})


lemma _root_.IsSelfAdjoint.inr (ha : IsSelfAdjoint a) : IsSelfAdjoint (a : Unitization R A)

(R : Type u_1)
{A : Type u_2}
[Semiring R]
[StarAddMonoid R]
[Star A]
{a : A}
(ha : IsSelfAdjoint a)


theorem ofArrows_surj {ι : Type*} {Y : ι → C} (f : ∀ i, Y i ⟶ X) {Z : C} (g : Z ⟶ X)
    (hg : ofArrows Y f g) : ∃ (i : ι) (h : Y i = Z),
    g = eqToHom h.symm ≫ f i

(hg : CategoryTheory.Presieve.ofArrows Y f g)

∃ i, ∃ (h : Y i = Z), g = CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom ⋯) (f i)


lemma Exact.moduleCat_of_range_eq_ker {X₁ X₂ X₃ : ModuleCat.{v} R}
    (f : X₁ ⟶ X₂) (g : X₂ ⟶ X₃) (hfg : LinearMap.range f = LinearMap.ker g) :
    (moduleCatMkOfKerLERange f g (by rw [hfg])).Exact

(CategoryTheory.ShortComplex.moduleCatMkOfKerLERange f g ⋯).Exact


theorem equiv_atom {a} {l : Lists α} : atom a ~ l ↔ atom a = l


nonrec theorem star_add_self' : star a + a = ↑(2 * a.re)


theorem isNoetherianRing_of_surjective (R) [Ring R] (S) [Ring S] (f : R →+* S)
    (hf : Function.Surjective f) [H : IsNoetherianRing R] : IsNoetherianRing S

(R : Type u_1)
[Ring R]
(S : Type u_2)
[Ring S]
(f : R →+* S)
(hf : Function.Surjective ⇑f)
[H : IsNoetherianRing R]


theorem trans (x y z : X) : S.Rel x y → S.Rel y z → S.Rel x z

{X : Type u_2}
[TopologicalSpace X]
(S : DiscreteQuotient X)
(x y z : X)


@[simp]
theorem fn_apply (f : α →. β) (a : α) : f.fn a = (f a).get

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


theorem Pullback.continuous_proj (f : B' → B) : Continuous (π F (f *ᵖ E))

[TopologicalSpace (Bundle.TotalSpace F E)]


theorem pred_card_le_card_erase : s.card - 1 ≤ (s.erase a).card

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


theorem terminates_iff (s : Computation α) : Terminates s ↔ ∃ a, a ∈ s


@[to_additive]
theorem image_range_orderOf [DecidableEq G] :
    Finset.image (fun i => x ^ i) (Finset.range (orderOf x)) = (zpowers x : Set G).toFinset

{G : Type u_1}
[Group G]
[Fintype G]
{x : G}
[DecidableEq G]

Finset.image (fun i => x ^ i) (Finset.range (orderOf x)) = (↑(Subgroup.zpowers x)).toFinset


@[simp]
lemma variableChange_Δ : (W.variableChange C).Δ = C.u⁻¹ ^ 12 * W.Δ

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
(C : WeierstrassCurve.VariableChange R)

(W.variableChange C).Δ = ↑C.u⁻¹ ^ 12 * W.Δ


@[simp]
theorem card_dfinsupp (s : Finset ι) (t : ∀ i, Finset (α i)) :
    (s.dfinsupp t).card = ∏ i ∈ s, (t i).card

{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ι]
[(i : ι) → Zero (α i)]
(s : Finset ι)
(t : (i : ι) → Finset (α i))


theorem mem_span_integralBasis {x : K} :
    x ∈ Submodule.span ℤ (Set.range (integralBasis K)) ↔ x ∈ (algebraMap (𝓞 K) K).range

(K : Type u_1)
[Field K]
[nf : NumberField K]
{x : K}

x ∈ Submodule.span ℤ (Set.range ⇑(NumberField.integralBasis K)) ↔
  x ∈ (algebraMap (NumberField.RingOfIntegers K) K).range


/-- Krull's theorem: a nontrivial ring has a maximal ideal. -/
theorem exists_maximal [Nontrivial α] : ∃ M : Ideal α, M.IsMaximal

(α : Type u)
[Semiring α]
[Nontrivial α]


theorem continuous_comp {γ} [TopologicalSpace γ] {f : α → β} {g : β → γ} (hg : Continuous g)
    (hf : AEStronglyMeasurable' m f μ) : AEStronglyMeasurable' m (g ∘ f) μ

(hf : MeasureTheory.AEStronglyMeasurable' m f μ)

MeasureTheory.AEStronglyMeasurable' m (g ∘ f) μ


theorem natCast_snd (n : ℕ) : (n : 𝓜(𝕜, A)).snd = n

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[SMulCommClass 𝕜 A A]
[IsScalarTower 𝕜 A A]
(n : ℕ)


theorem toFinsupp_concat_eq_toFinsupp_add_single {R : Type*} [AddZeroClass R] (x : R) (xs : List R)
    [DecidablePred fun i => getD (xs ++ [x]) i 0 ≠ 0] [DecidablePred fun i => getD xs i 0 ≠ 0] :
    toFinsupp (xs ++ [x]) = toFinsupp xs + Finsupp.single xs.length x

[DecidablePred fun i => (xs ++ [x]).getD i 0 ≠ 0]

[DecidablePred fun i => xs.getD i 0 ≠ 0]

(xs ++ [x]).toFinsupp = xs.toFinsupp + Finsupp.single xs.length x


theorem le_or_lt [LinearOrder α] {a b : α} (h : a ≤ b) (c : α) : a ≤ c ∨ c < b

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


/-- A left homology map data for a morphism of short complexes induces
a right homology map data in the opposite category. -/
@[simps]
def LeftHomologyMapData.op {S₁ S₂ : ShortComplex C} {φ : S₁ ⟶ S₂}
    {h₁ : S₁.LeftHomologyData} {h₂ : S₂.LeftHomologyData}
    (ψ : LeftHomologyMapData φ h₁ h₂) : RightHomologyMapData (opMap φ) h₂.op h₁.op

(ψ : CategoryTheory.ShortComplex.LeftHomologyMapData φ h₁ h₂)


theorem associated_unit_mul_right {β : Type*} [CommMonoid β] (a u : β) (hu : IsUnit u) :
    Associated a (u * a)

{β : Type u_5}
[CommMonoid β]
(a u : β)
(hu : IsUnit u)


lemma isLocallySurjective_iff_epi {F G : Sheaf J (Type w)} (φ : F ⟶ G)
    [HasSheafify J (Type w)] :
    IsLocallySurjective φ ↔ Epi φ

{J : CategoryTheory.GrothendieckTopology C}

CategoryTheory.Sheaf.IsLocallySurjective φ ↔ CategoryTheory.Epi φ


theorem four_dvd_or_exists_odd_prime_and_dvd_of_two_lt {n : ℕ} (n2 : 2 < n) :
    4 ∣ n ∨ ∃ p, Prime p ∧ p ∣ n ∧ Odd p

4 ∣ n ∨ ∃ p, Nat.Prime p ∧ p ∣ n ∧ Odd p


theorem contMDiff_smul {g : M → F} {i} (hg : ∀ x ∈ tsupport (f i), ContMDiffAt I 𝓘(ℝ, F) n g x) :
    ContMDiff I 𝓘(ℝ, F) n fun x => f i x • g x

(hg : ∀ x ∈ tsupport ⇑(f i), ContMDiffAt I 𝓘(ℝ, F) n g x)

ContMDiff I 𝓘(ℝ, F) n fun x => (f i) x • g x


/-- A Kleene Algebra is an idempotent semiring with an additional unary operator `kstar` (for Kleene
star) that satisfies the following properties:
* `1 + a * a∗ ≤ a∗`
* `1 + a∗ * a ≤ a∗`
* If `a * c + b ≤ c`, then `a∗ * b ≤ c`
* If `c * a + b ≤ c`, then `b * a∗ ≤ c`
-/
class KleeneAlgebra (α : Type*) extends IdemSemiring α, KStar α where
  protected one_le_kstar : ∀ a : α, 1 ≤ a∗
  protected mul_kstar_le_kstar : ∀ a : α, a * a∗ ≤ a∗
  protected kstar_mul_le_kstar : ∀ a : α, a∗ * a ≤ a∗
  protected mul_kstar_le_self : ∀ a b : α, b * a ≤ b → b * a∗ ≤ b
  protected kstar_mul_le_self : ∀ a b : α, a * b ≤ b → a∗ * b ≤ b

{α : Type u_5}
[self : KleeneAlgebra α]
(a : α)


theorem stronglyMeasurable_limit_process' : StronglyMeasurable[m] (limitProcess f ℱ μ)

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[Preorder ι]
{E : Type u_4}
[Zero E]
[TopologicalSpace E]
{ℱ : MeasureTheory.Filtration ι m}
{f : ι → Ω → E}
{μ : MeasureTheory.Measure Ω}

MeasureTheory.StronglyMeasurable (MeasureTheory.Filtration.limitProcess f ℱ μ)


@[to_additive]
theorem _root_.Equiv.Perm.prod_comp' (σ : Equiv.Perm α) (s : Finset α) (f : α → α → β)
    (hs : { a | σ a ≠ a } ⊆ s) : (∏ x ∈ s, f (σ x) x) = ∏ x ∈ s, f x (σ.symm x)

{α : Type u_3}
{β : Type u_4}
[AddCommMonoid β]
(σ : Equiv.Perm α)
(s : Finset α)
(f : α → α → β)
(hs : {a | σ a ≠ a} ⊆ ↑s)

∑ x ∈ s, f (σ x) x = ∑ x ∈ s, f x ((Equiv.symm σ) x)


@[simp]
theorem snd_hnot [HNot α] [HNot β] (a : α × β) : (￢a).2 = ￢a.2

{α : Type u_2}
{β : Type u_3}
[HNot α]
[HNot β]
(a : α × β)


/-- Structure containing the data of inverse map `(F.obj X ⟶ F.obj Y) ⟶ (X ⟶ Y)` of `F.map`
in order to express that `F` is a fully faithful functor. -/
structure FullyFaithful where
  /-- The inverse map `(F.obj X ⟶ F.obj Y) ⟶ (X ⟶ Y)` of `F.map`. -/
  preimage {X Y : C} (f : F.obj X ⟶ F.obj Y) : X ⟶ Y
  map_preimage {X Y : C} (f : F.obj X ⟶ F.obj Y) : F.map (preimage f) = f := by aesop_cat
  preimage_map {X Y : C} (f : X ⟶ Y) : preimage (F.map f) = f := by aesop_cat

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


@[simp]
theorem AdjoinSimple.isIntegral_gen : IsIntegral F (AdjoinSimple.gen F α) ↔ IsIntegral F α

(F : Type u_1)
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
(α : E)

IsIntegral F (IntermediateField.AdjoinSimple.gen F α) ↔ IsIntegral F α


@[simp]
theorem op_inv {X Y : C} (f : X ⟶ Y) [IsIso f] : (inv f).op = inv f.op

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{X Y : C}
(f : X ⟶ Y)
[CategoryTheory.IsIso f]

(CategoryTheory.inv f).op = CategoryTheory.inv f.op


@[simp]
theorem ofSubtype_apply_coe (f : Perm (Subtype p)) (x : Subtype p) : ofSubtype f x = f x

{α : Type u}
{p : α → Prop}
[DecidablePred p]
(f : Equiv.Perm (Subtype p))
(x : Subtype p)


/-- This lemma matches more generally than `Finset.Nat.prod_antidiagonal_eq_prod_range_succ_mk` when
using `rw ← `. -/
@[to_additive "This lemma matches more generally than
`Finset.Nat.sum_antidiagonal_eq_sum_range_succ_mk` when using `rw ← `."]
theorem prod_antidiagonal_eq_prod_range_succ {M : Type*} [CommMonoid M] (f : ℕ → ℕ → M) (n : ℕ) :
    ∏ ij ∈ antidiagonal n, f ij.1 ij.2 = ∏ k ∈ range n.succ, f k (n - k)

{M : Type u_3}
[CommMonoid M]
(f : ℕ → ℕ → M)
(n : ℕ)

∏ ij ∈ Finset.antidiagonal n, f ij.1 ij.2 = ∏ k ∈ Finset.range n.succ, f k (n - k)


theorem hasBasis_toFilteriUnion_top (l : IntegrationParams) (I : Box ι) :
    (l.toFilteriUnion I ⊤).HasBasis (fun r : ℝ≥0 → (ι → ℝ) → Ioi (0 : ℝ) => ∀ c, l.RCond (r c))
      fun r => { π | ∃ c, l.MemBaseSet I c (r c) π ∧ π.IsPartition }

{ι : Type u_1}
[Fintype ι]
(l : BoxIntegral.IntegrationParams)
(I : BoxIntegral.Box ι)

(l.toFilteriUnion I ⊤).HasBasis (fun r => ∀ (c : ℝ≥0), l.RCond (r c)) fun r =>
  {π | ∃ c, l.MemBaseSet I c (r c) π ∧ π.IsPartition}


theorem bot_eq_initial_to {B : C} : (⊥ : Subobject B) = Subobject.mk (initial.to B)

⊥ = CategoryTheory.Subobject.mk (CategoryTheory.Limits.initial.to B)


@[to_additive]
theorem edist_eq_coe_nnnorm_div (a b : E) : edist a b = ‖a / b‖₊

{E : Type u_6}
[SeminormedGroup E]
(a b : E)


theorem mapDomain_finset_sum {f : α → β} {s : Finset ι} {v : ι → α →₀ M} :
    mapDomain f (∑ i ∈ s, v i) = ∑ i ∈ s, mapDomain f (v i)

{α : Type u_1}
{β : Type u_2}
{ι : Type u_4}
{M : Type u_5}
[AddCommMonoid M]
{f : α → β}
{s : Finset ι}
{v : ι → α →₀ M}

Finsupp.mapDomain f (∑ i ∈ s, v i) = ∑ i ∈ s, Finsupp.mapDomain f (v i)


theorem fromSpec_primeIdealOf (x : U) :
    hU.fromSpec.val.base (hU.primeIdealOf x) = x.1

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

hU.fromSpec.val.base (hU.primeIdealOf x) = ↑x


theorem of_gt {M} [CanonicallyOrderedAddCommMonoid M] {x y : M} (h : x < y) : NeZero y

{M : Type u_1}
[CanonicallyOrderedAddCommMonoid M]
{x y : M}
(h : x < y)


theorem dite_prop_iff_and {Q : P → Prop} {R : ¬P → Prop} [Decidable P] :
    dite P Q R ↔ (∀ h, Q h) ∧ (∀ h, R h)

{P : Prop}
{Q : P → Prop}
{R : ¬P → Prop}
[Decidable P]

dite P Q R ↔ (∀ (h : P), Q h) ∧ ∀ (h : ¬P), R h


@[simp] theorem mk_coe (f : G →+c[a, b] H) : mk f f.2 = f

{G : Type u_1}
{H : Type u_2}
[Add G]
[Add H]
{a : G}
{b : H}
(f : AddConstMap G H a b)

{ toFun := ⇑f, map_add_const' := ⋯ } = f


theorem add_le_iff : a + b ≤ c ↔ a ≤ c ∧ b ≤ c

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


theorem tendsto_log_nhdsWithin_im_nonneg_of_re_neg_of_im_zero {z : ℂ} (hre : z.re < 0)
    (him : z.im = 0) : Tendsto log (𝓝[{ z : ℂ | 0 ≤ z.im }] z) (𝓝 <| Real.log (abs z) + π * I)

Filter.Tendsto Complex.log (nhdsWithin z {z | 0 ≤ z.im}) (nhds (↑(Real.log (Complex.abs z)) + ↑Real.pi * Complex.I))


theorem ULift.isOpen_iff [TopologicalSpace X] {s : Set (ULift.{v} X)} :
    IsOpen s ↔ IsOpen (ULift.up ⁻¹' s)

{X : Type u}
[TopologicalSpace X]
{s : Set (ULift.{v, u} X)}


/-- The **Cauchy criterion** for infinite products, also known as the **Cauchy convergence test** -/
@[to_additive "The **Cauchy criterion** for infinite sums, also known as the
**Cauchy convergence test**"]
theorem multipliable_iff_cauchySeq_finset [CompleteSpace α] {f : β → α} :
    Multipliable f ↔ CauchySeq fun s : Finset β ↦ ∏ b ∈ s, f b

{α : Type u_1}
{β : Type u_2}
[AddCommGroup α]
[UniformSpace α]
[CompleteSpace α]
{f : β → α}

Summable f ↔ CauchySeq fun s => ∑ b ∈ s, f b


/-- This structure permits to define a fiber bundle when trivializations are given as local
equivalences but there is not yet a topology on the total space. The total space is hence given a
topology in such a way that there is a fiber bundle structure for which the partial equivalences
are also partial homeomorphisms and hence local trivializations. -/
-- Porting note (#5171): was @[nolint has_nonempty_instance]
structure FiberPrebundle where
  pretrivializationAtlas : Set (Pretrivialization F (π F E))
  pretrivializationAt : B → Pretrivialization F (π F E)
  mem_base_pretrivializationAt : ∀ x : B, x ∈ (pretrivializationAt x).baseSet
  pretrivialization_mem_atlas : ∀ x : B, pretrivializationAt x ∈ pretrivializationAtlas
  continuous_trivChange : ∀ e, e ∈ pretrivializationAtlas → ∀ e', e' ∈ pretrivializationAtlas →
    ContinuousOn (e ∘ e'.toPartialEquiv.symm) (e'.target ∩ e'.toPartialEquiv.symm ⁻¹' e.source)
  totalSpaceMk_inducing : ∀ b : B, Inducing (pretrivializationAt b ∘ TotalSpace.mk b)

{B : Type u_2}
{F : Type u_3}
{E : B → Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
[(x : B) → TopologicalSpace (E x)]
(self : FiberPrebundle F E)
(x : B)

self.pretrivializationAt x ∈ self.pretrivializationAtlas


/-- The `vectorSpan` of an indexed family is the span of the pairwise subtractions with a given
point on the left, excluding the subtraction of that point from itself. -/
theorem vectorSpan_range_eq_span_range_vsub_left_ne (p : ι → P) (i₀ : ι) :
    vectorSpan k (Set.range p) =
      Submodule.span k (Set.range fun i : { x // x ≠ i₀ } => p i₀ -ᵥ p i)

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{ι : Type u_4}
(p : ι → P)
(i₀ : ι)

vectorSpan k (Set.range p) = Submodule.span k (Set.range fun i => p i₀ -ᵥ p ↑i)


@[simp]
theorem comp_eval₂Hom [CommSemiring S₂] (f : R →+* S₁) (g : σ → S₁) (φ : S₁ →+* S₂) :
    φ.comp (eval₂Hom f g) = eval₂Hom (φ.comp f) fun i => φ (g i)

{R : Type u}
{S₁ : Type v}
{S₂ : Type w}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₁]
[CommSemiring S₂]
(f : R →+* S₁)
(g : σ → S₁)
(φ : S₁ →+* S₂)

φ.comp (MvPolynomial.eval₂Hom f g) = MvPolynomial.eval₂Hom (φ.comp f) fun i => φ (g i)


/-- A helper structure to construct the shift functor `(Discrete A) ⥤ (C ⥤ C)`. -/
structure ShiftMkCore where
  /-- the family of shift functors -/
  F : A → C ⥤ C
  /-- the shift by 0 identifies to the identity functor -/
  zero : F 0 ≅ 𝟭 C
  /-- the composition of shift functors identifies to the shift by the sum -/
  add : ∀ n m : A, F (n + m) ≅ F n ⋙ F m
  /-- compatibility with the associativity -/
  assoc_hom_app : ∀ (m₁ m₂ m₃ : A) (X : C),
    (add (m₁ + m₂) m₃).hom.app X ≫ (F m₃).map ((add m₁ m₂).hom.app X) =
      eqToHom (by rw [add_assoc]) ≫ (add m₁ (m₂ + m₃)).hom.app X ≫
        (add m₂ m₃).hom.app ((F m₁).obj X) := by aesop_cat
  /-- compatibility with the left addition with 0 -/
  zero_add_hom_app : ∀ (n : A) (X : C), (add 0 n).hom.app X =
    eqToHom (by dsimp; rw [zero_add]) ≫ (F n).map (zero.inv.app X) := by aesop_cat
  /-- compatibility with the right addition with 0 -/
  add_zero_hom_app : ∀ (n : A) (X : C), (add n 0).hom.app X =
    eqToHom (by dsimp; rw [add_zero]) ≫ zero.inv.app ((F n).obj X) := by aesop_cat

{C : Type u}
{A : Type u_1}
[CategoryTheory.Category.{v, u} C]
[AddMonoid A]
(self : CategoryTheory.ShiftMkCore C A)
(m₁ m₂ m₃ : A)
(X : C)

CategoryTheory.CategoryStruct.comp ((self.add (m₁ + m₂) m₃).hom.app X) ((self.F m₃).map ((self.add m₁ m₂).hom.app X)) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.eqToHom ⋯)
    (CategoryTheory.CategoryStruct.comp ((self.add m₁ (m₂ + m₃)).hom.app X)
      ((self.add m₂ m₃).hom.app ((self.F m₁).obj X)))


/-- If `Irreducible (cyclotomic (p ^ n) R)` then `Irreducible (cyclotomic p R).` -/
theorem cyclotomic_irreducible_of_irreducible_pow {p : ℕ} (hp : Nat.Prime p) {R} [CommRing R]
    [IsDomain R] {n : ℕ} (hn : n ≠ 0) (h : Irreducible (cyclotomic (p ^ n) R)) :
    Irreducible (cyclotomic p R)

(h : Irreducible (Polynomial.cyclotomic (p ^ n) R))


lemma stableUnderSpecialization_univ : StableUnderSpecialization (univ : Set X)


@[simp]
theorem coe_coeEmb : ⇑(coeEmb : Finset α ↪o Set α) = ((↑) : Finset α → Set α)


lemma iUnion_descSet_singleton : ⋃ x : lc.pt, descSet hc {x} = Set.univ

(hc : CategoryTheory.Limits.IsColimit c)

(lc : CategoryTheory.Limits.Cocone (K.comp CategoryTheory.uliftFunctor.{v, u}))

⋃ x, CategoryTheory.Limits.Types.descSet hc {x} = Set.univ


/-- `PowerBasis.map pb (e : S ≃ₐ[R] S')` is the power basis for `S'` generated by `e pb.gen`. -/
@[simps dim gen basis]
noncomputable def map (pb : PowerBasis R S) (e : S ≃ₐ[R] S') : PowerBasis R S'

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[Ring S]
[Algebra R S]
{S' : Type u_7}
[CommRing S']
[Algebra R S']
(pb : PowerBasis R S)
(e : S ≃ₐ[R] S')

(pb.map e).basis = pb.basis.map e.toLinearEquiv


theorem iUnion_Iic_eq_Iio_of_lt_of_tendsto (x : R) {as : ι → R} (lt_x : ∀ i, as i < x)
    {F : Filter ι} [Filter.NeBot F] (as_lim : Filter.Tendsto as F (𝓝 x)) :
    ⋃ i : ι, Iic (as i) = Iio x

{ι : Type u_1}
{R : Type u_4}
[CompleteLinearOrder R]
[TopologicalSpace R]
[OrderTopology R]
(x : R)
{as : ι → R}
(lt_x : ∀ (i : ι), as i < x)
{F : Filter ι}
[F.NeBot]
(as_lim : Filter.Tendsto as F (𝓝 x))


theorem summable_toNNReal_of_tsum_ne_top {α : Type*} {f : α → ℝ≥0∞} (hf : ∑' i, f i ≠ ∞) :
    Summable (ENNReal.toNNReal ∘ f)

{α : Type u_4}
{f : α → ℝ≥0∞}
(hf : ∑' (i : α), f i ≠ ⊤)


@[to_additive]
theorem UniformContinuous.mul [UniformSpace β] {f : β → α} {g : β → α} (hf : UniformContinuous f)
    (hg : UniformContinuous g) : UniformContinuous fun x => f x * g x

{α : Type u_1}
{β : Type u_2}
[UniformSpace α]
[Group α]
[UniformGroup α]
[UniformSpace β]
{f g : β → α}
(hf : UniformContinuous f)
(hg : UniformContinuous g)


theorem trStmts₁_supports' {S q K} (H₁ : (q : Λ').Supports S) (H₂ : trStmts₁ q ∪ K ⊆ S)
    (H₃ : K ⊆ S → Supports K S) : Supports (trStmts₁ q ∪ K) S

(H₁ : Turing.PartrecToTM2.Λ'.Supports S q)

(H₂ : Turing.PartrecToTM2.trStmts₁ q ∪ K ⊆ S)

(H₃ : K ⊆ S → Turing.PartrecToTM2.Supports K S)

Turing.PartrecToTM2.Supports (Turing.PartrecToTM2.trStmts₁ q ∪ K) S


@[simp]
theorem toMeasure_comp_toFiniteMeasure_eq_toMeasure (ν : ProbabilityMeasure Ω) :
    (ν.toFiniteMeasure : Measure Ω) = (ν : Measure Ω)

(ν : MeasureTheory.ProbabilityMeasure Ω)


@[to_additive (attr := simp)]
lemma measure_mul_closure_one (s : Set G) (μ : Measure G) :
    μ (s * (closure {1} : Set G)) = μ s

{G : Type u_2}
[MeasurableSpace G]
[TopologicalSpace G]
[BorelSpace G]
[AddGroup G]
[TopologicalAddGroup G]
(s : Set G)
(μ : MeasureTheory.Measure G)


@[simp]
theorem piecewise_univ (f g : α →ₛ β) : piecewise univ MeasurableSet.univ f g = f

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

MeasureTheory.SimpleFunc.piecewise Set.univ ⋯ f g = f


/-- An intermediate field is closed under inverses. -/
protected theorem inv_mem {x : L} : x ∈ S → x⁻¹ ∈ S

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
(S : IntermediateField K L)
{x : L}

x ∈ S → x⁻¹ ∈ S


@[simp, norm_cast]
theorem coe_smul (c : R) (f : P1 →ᵃ[k] V2) : ⇑(c • f) = c • ⇑f

{k : Type u_1}
{V1 : Type u_2}
{P1 : Type u_3}
{V2 : Type u_4}
[Ring k]
[AddCommGroup V1]
[Module k V1]
[AffineSpace V1 P1]
[AddCommGroup V2]
[Module k V2]
{R : Type u_10}
[Monoid R]
[DistribMulAction R V2]
[SMulCommClass k R V2]
(c : R)
(f : P1 →ᵃ[k] V2)


@[simp]
theorem inf_coe (l : List α) : inf (l : Multiset α) = l.foldr (· ⊓ ·) ⊤

{α : Type u_1}
[SemilatticeInf α]
[OrderTop α]
(l : List α)

(↑l).inf = List.foldr (fun x x_1 => x ⊓ x_1) ⊤ l


@[simp]
theorem mk_coe (e : A ≃⋆+* B) (e' h₁ h₂ h₃ h₄ h₅) :
    (⟨⟨⟨e, e', h₁, h₂⟩, h₃, h₄⟩, h₅⟩ : A ≃⋆+* B) = e

(h₃ :
  ∀ (x y : A),
    { toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂ }.toFun (x * y) =
      { toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂ }.toFun x *
        { toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂ }.toFun y)

(h₄ :
  ∀ (x y : A),
    { toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂ }.toFun (x + y) =
      { toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂ }.toFun x +
        { toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂ }.toFun y)

(h₅ :
  ∀ (a : A),
    { toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂, map_mul' := h₃, map_add' := h₄ }.toFun (star a) =
      star ({ toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂, map_mul' := h₃, map_add' := h₄ }.toFun a))

{ toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂, map_mul' := h₃, map_add' := h₄, map_star' := h₅ } = e


theorem lcm_def (i j : ℤ) : lcm i j = Nat.lcm (natAbs i) (natAbs j)


theorem recDiag_succ_zero {motive : Nat → Nat → Sort _} (zero_zero : motive 0 0)
    (zero_succ : ∀ n, motive 0 n → motive 0 (n+1)) (succ_zero : ∀ m, motive m 0 → motive (m+1) 0)
    (succ_succ : ∀ m n, motive m n → motive (m+1) (n+1)) (m) :
    Nat.recDiag zero_zero zero_succ succ_zero succ_succ (m+1) 0
      = succ_zero m (Nat.recDiag zero_zero zero_succ succ_zero succ_succ m 0)

(zero_succ : (n : Nat) → motive 0 n → motive 0 (n + 1))

(succ_zero : (m : Nat) → motive m 0 → motive (m + 1) 0)

(succ_succ : (m n : Nat) → motive m n → motive (m + 1) (n + 1))

Nat.recDiag zero_zero zero_succ succ_zero succ_succ (m + 1) 0 =
  succ_zero m (Nat.recDiag zero_zero zero_succ succ_zero succ_succ m 0)


theorem eq_of_head_eq_head_of_last_eq_last_of_length_eq_zero {s₁ s₂ : CompositionSeries X}
    (hb : s₁.head = s₂.head) (ht : s₁.last = s₂.last) (hs₁0 : s₁.length = 0) : s₁ = s₂

(hb : RelSeries.head s₁ = RelSeries.head s₂)

(ht : RelSeries.last s₁ = RelSeries.last s₂)


@[fun_prop]
theorem HasFDerivAt.mul_const' (ha : HasFDerivAt a a' x) (b : 𝔸) :
    HasFDerivAt (fun y => a y * b) (a'.smulRight b) x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{𝔸 : Type u_6}
[NormedRing 𝔸]
[NormedAlgebra 𝕜 𝔸]
{a : E → 𝔸}
{a' : E →L[𝕜] 𝔸}
(ha : HasFDerivAt a a' x)
(b : 𝔸)


@[to_additive]
theorem isClosedMap_smul (c : G) : IsClosedMap fun x : α => c • x

{α : Type u_2}
{G : Type u_4}
[TopologicalSpace α]
[AddGroup G]
[AddAction G α]
[ContinuousConstVAdd G α]
(c : G)


theorem coeff_injective : Injective (coeff : R[X] → ℕ → R)


@[reassoc (attr := simp)]
theorem app_comp_p : f.f.app X ≫ Q.p.app X = f.f.app X

{P Q : CategoryTheory.Idempotents.Karoubi (J ⥤ C)}


theorem ContDiffAt.sum {ι : Type*} {f : ι → E → F} {s : Finset ι} {x : E}
    (h : ∀ i ∈ s, ContDiffAt 𝕜 n (fun x => f i x) x) :
    ContDiffAt 𝕜 n (fun x => ∑ i ∈ s, f i x) x


/-- If a function `f` is analytic on a set `s` and `g` is linear, then `g ∘ f` is analytic
on `s`. -/
theorem ContinuousLinearMap.comp_analyticOn {s : Set E} (g : F →L[𝕜] G) (h : AnalyticOn 𝕜 f s) :
    AnalyticOn 𝕜 (g ∘ f) s

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
{G : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{f : E → F}
{s : Set E}
(g : F →L[𝕜] G)
(h : AnalyticOn 𝕜 f s)


theorem IsNormal.blsub_eq {f : Ordinal.{u} → Ordinal.{max u v}} (H : IsNormal f) {o : Ordinal.{u}}
    (h : IsLimit o) : (blsub.{_, v} o fun x _ => f x) = f o

{f : Ordinal.{u} → Ordinal.{max u v}}
(H : Ordinal.IsNormal f)
{o : Ordinal.{u}}
(h : o.IsLimit)


theorem Γ_obj_op (X : PresheafedSpace C) : Γ.obj (op X) = X.presheaf.obj (op ⊤)

(X : AlgebraicGeometry.PresheafedSpace C)

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


theorem τ_symm_apply_infinity :
    Equiv.symm τ ∞ = fromCoset ⟨f.range, 1, one_leftCoset _⟩

(Equiv.symm (Grp.SurjectiveOfEpiAuxs.tau f)) Grp.SurjectiveOfEpiAuxs.XWithInfinity.infinity =
  Grp.SurjectiveOfEpiAuxs.XWithInfinity.fromCoset ⟨↑(MonoidHom.range f), ⋯⟩


theorem Mem.congr_right : ∀ {x y : PSet.{u}}, Equiv x y → ∀ {w : PSet.{u}}, w ∈ x ↔ w ∈ y


@[simp] theorem eq_false_and_eq_true_self : ∀(b : Bool), (b = false ∧ b = true) ↔ False


theorem Convex.vadd (hs : Convex 𝕜 s) (z : E) : Convex 𝕜 (z +ᵥ s)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{s : Set E}
(hs : Convex 𝕜 s)
(z : E)


@[simp]
theorem fst_smul [SMul S R] [SMul S A] (s : S) (x : Unitization R A) : (s • x).fst = s • x.fst

{S : Type u_2}
{R : Type u_3}
{A : Type u_4}
[SMul S R]
[SMul S A]
(s : S)
(x : Unitization R A)


lemma top_ne_set_smul_of_subset_jacobson_annihilator [Nontrivial M]
    [Module.Finite R M] {s : Set R}
    (h : s ⊆ (Module.annihilator R M).jacobson) :
    (⊤ : Submodule R M) ≠ s • ⊤

(h : s ⊆ ↑(Module.annihilator R M).jacobson)


@[deprecated getElem?_take (since := "2024-06-12")]
theorem get?_take {l : List α} {n m : Nat} (h : m < n) : (l.take n).get? m = l.get? m

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


@[simp] protected theorem one_mul (x : BitVec w) : 1#w * x = x


theorem le_opNorm_of_le {c : ℝ} {x} (h : ‖x‖ ≤ c) : ‖f x‖ ≤ ‖f‖ * c

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

‖f x‖ ≤ ‖f‖ * c


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

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

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


@[simp]
theorem toBlocks_fromBlocks₂₂ (A : Matrix n l α) (B : Matrix n m α) (C : Matrix o l α)
    (D : Matrix o m α) : (fromBlocks A B C D).toBlocks₂₂ = D

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type u_12}
(A : Matrix n l α)
(B : Matrix n m α)
(C : Matrix o l α)
(D : Matrix o m α)

(Matrix.fromBlocks A B C D).toBlocks₂₂ = D


theorem gcd_dvd (m n : Nat) : (gcd m n ∣ m) ∧ (gcd m n ∣ n)


/-- A cocone for a functor `F : J ⥤ HomologicalComplex C c` which is given in degree `n` by
the colimit of `F ⋙ eval C c n`. -/
@[simps]
noncomputable def coconeOfHasColimitEval : Cocone F

[∀ (n : ι), CategoryTheory.Limits.HasColimit (F ⋙ HomologicalComplex.eval C c n)]

(HomologicalComplex.coconeOfHasColimitEval F).pt.X n = CategoryTheory.Limits.colimit (F ⋙ HomologicalComplex.eval C c n)


@[simp]
theorem Basis.smulTower_repr {ι : Type v₁} {ι' : Type w₁}
    (b : Basis ι R S) (c : Basis ι' S A) (x ij) :
    (b.smulTower c).repr x ij = b.repr (c.repr x ij.2) ij.1

{R : Type u}
{S : Type v}
{A : Type w}
[Semiring R]
[Semiring S]
[AddCommMonoid A]
[Module R S]
[Module S A]
[Module R A]
[IsScalarTower R S A]
{ι : Type v₁}
{ι' : Type w₁}
(b : Basis ι R S)
(c : Basis ι' S A)
(x : A)
(ij : ι × ι')

((b.smulTower c).repr x) ij = (b.repr ((c.repr x) ij.2)) ij.1


theorem le_iff (h : π₂.IsPartition) :
    π₁ ≤ π₂ ↔ ∀ J ∈ π₁, ∀ J' ∈ π₂, (J ∩ J' : Set (ι → ℝ)).Nonempty → J ≤ J'

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

π₁ ≤ π₂ ↔ ∀ J ∈ π₁, ∀ J' ∈ π₂, (↑J ∩ ↑J').Nonempty → J ≤ J'


@[simp, mfld_simps]
theorem toPartialEquiv_coe : (I.toPartialEquiv : H → E) = I

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


/-- For ideals in a Dedekind domain, to divide is to contain. -/
theorem Ideal.dvd_iff_le {I J : Ideal A} : I ∣ J ↔ J ≤ I

{A : Type u_2}
[CommRing A]
[IsDedekindDomain A]
{I J : Ideal A}


theorem Finite.fin_embedding {s : Set α} (h : s.Finite) :
    ∃ (n : ℕ) (f : Fin n ↪ α), range f = s


@[to_additive]
theorem comap_injective {f : G →* N} (h : Function.Surjective f) : Function.Injective (comap f)

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


theorem Convex.openSegment_self_interior_subset_interior {s : Set E} (hs : Convex 𝕜 s) {x y : E}
    (hx : x ∈ s) (hy : y ∈ interior s) : openSegment 𝕜 x y ⊆ interior s

{𝕜 : Type u_2}
{E : Type u_3}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
{s : Set E}
(hs : Convex 𝕜 s)
{x y : E}
(hx : x ∈ s)
(hy : y ∈ interior s)


/-- A composition induces a partition (just convert the list to a multiset). -/
@[simps]
def ofComposition (n : ℕ) (c : Composition n) : Partition n

(Nat.Partition.ofComposition n c).parts = ↑c.blocks


theorem hatInv_extends {x : K} (h : x ≠ 0) : hatInv (x : hat K) = ↑(x⁻¹ : K)

{K : Type u_1}
[Field K]
[UniformSpace K]
[TopologicalDivisionRing K]
{x : K}
(h : x ≠ 0)


/-- The homotopy between morphisms in `ShortComplex C` that is induced by a homotopy
between morphisms in `ShortComplex Cᵒᵖ`. -/
@[simps]
def unop {S₁ S₂ : ShortComplex Cᵒᵖ} {φ₁ φ₂ : S₁ ⟶ S₂}  (h : Homotopy φ₁ φ₂) :
    Homotopy (unopMap φ₁) (unopMap φ₂)

{S₁ S₂ : CategoryTheory.ShortComplex Cᵒᵖ}

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

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


theorem norm_cexp_neg_mul_sq_add_mul_I' (hb : b.re ≠ 0) (c T : ℝ) :
    ‖cexp (-b * (T + c * I) ^ 2)‖ =
      exp (-(b.re * (T - b.im * c / b.re) ^ 2 - c ^ 2 * (b.im ^ 2 / b.re + b.re)))

‖cexp (-b * (↑T + ↑c * Complex.I) ^ 2)‖ = rexp (-(b.re * (T - b.im * c / b.re) ^ 2 - c ^ 2 * (b.im ^ 2 / b.re + b.re)))


theorem ack_strictMono_left (n : ℕ) : StrictMono fun m => ack m n


lemma eventually_one_add_smoothingFn_pos : ∀ᶠ (n : ℕ) in atTop, 0 < 1 + ε n

∀ᶠ (n : ℕ) in Filter.atTop, 0 < 1 + AkraBazziRecurrence.smoothingFn ↑n


theorem Metric.uniformity_edist_aux {α} (d : α → α → ℝ≥0) :
    ⨅ ε > (0 : ℝ), 𝓟 { p : α × α | ↑(d p.1 p.2) < ε } =
      ⨅ ε > (0 : ℝ≥0∞), 𝓟 { p : α × α | ↑(d p.1 p.2) < ε }


@[to_additive] lemma prod_eq_one_iff : m.prod = 1 ↔ ∀ x ∈ m, x = (1 : α)

{α : Type u_2}
[CanonicallyOrderedAddCommMonoid α]
{m : Multiset α}


/-- Reformulated functional equation with `f` and `g` interchanged. -/
lemma WeakFEPair.h_feq' (P : WeakFEPair E) (x : ℝ) (hx : 0 < x) :
    P.g (1 / x) = (P.ε⁻¹ * ↑(x ^ P.k)) • P.f x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
(P : WeakFEPair E)
(x : ℝ)
(hx : 0 < x)


/-- The image of a left invariant measure under a left action is left invariant, assuming that
the action preserves multiplication. -/
@[to_additive "The image of a left invariant measure under a left additive action is left invariant,
assuming that the action preserves addition."]
theorem isMulLeftInvariant_map_smul
    {α} [SMul α G] [SMulCommClass α G G] [MeasurableSpace α] [MeasurableSMul α G]
    [IsMulLeftInvariant μ] (a : α) :
    IsMulLeftInvariant (map (a • · : G → G) μ)

{G : Type u_2}
[MeasurableSpace G]
[Semigroup G]
[MeasurableMul G]
{μ : MeasureTheory.Measure G}
{α : Type u_4}
[SMul α G]
[SMulCommClass α G G]
[MeasurableSpace α]
[MeasurableSMul α G]
[μ.IsMulLeftInvariant]
(a : α)

(MeasureTheory.Measure.map (fun x => a • x) μ).IsMulLeftInvariant


nonrec theorem prodMk {f₀ f₁ : C(X, Y)} {g₀ g₁ : C(X, Z)} :
    Homotopic f₀ f₁ → Homotopic g₀ g₁ → Homotopic (f₀.prodMk g₀) (f₁.prodMk g₁)

{X : Type u}
{Y : Type v}
{Z : Type w}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{f₀ f₁ : C(X, Y)}
{g₀ g₁ : C(X, Z)}

f₀.Homotopic f₁ → g₀.Homotopic g₁ → (f₀.prodMk g₀).Homotopic (f₁.prodMk g₁)


/-- Let `b` be an `S`-basis of `M`. Then `m : M` lies in the `R`-module spanned by `b` iff all the
coordinates of `m` on the basis `b` are in `R` (see `Basis.mem_span` for the case `R = S`). -/
theorem Basis.mem_span_iff_repr_mem (m : M) :
    m ∈ span R (Set.range b) ↔ ∀ i, b.repr m i ∈ Set.range (algebraMap R S)

{ι : Type u_1}
(R : Type u_3)
{M : Type u_6}
{S : Type u_10}
[CommRing R]
[Ring S]
[Nontrivial S]
[AddCommGroup M]
[Algebra R S]
[Module S M]
[Module R M]
[IsScalarTower R S M]
[NoZeroSMulDivisors R S]
(b : Basis ι S M)
(m : M)

m ∈ Submodule.span R (Set.range ⇑b) ↔ ∀ (i : ι), (b.repr m) i ∈ Set.range ⇑(algebraMap R S)


@[simp]
theorem coe_linearMap_map (f : M →ₗ⁅R,L⁆ P) (g : N →ₗ⁅R,L⁆ Q) :
    (map f g : M ⊗[R] N →ₗ[R] P ⊗[R] Q) = TensorProduct.map (f : M →ₗ[R] P) (g : N →ₗ[R] Q)

{R : Type u}
[CommRing R]
{L : Type v}
{M : Type w}
{N : Type w₁}
{P : Type w₂}
{Q : Type w₃}
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[AddCommGroup N]
[Module R N]
[LieRingModule L N]
[LieModule R L N]
[AddCommGroup P]
[Module R P]
[LieRingModule L P]
[LieModule R L P]
[AddCommGroup Q]
[Module R Q]
[LieRingModule L Q]
[LieModule R L Q]
(f : M →ₗ⁅R,L⁆ P)
(g : N →ₗ⁅R,L⁆ Q)

↑(TensorProduct.LieModule.map f g) = TensorProduct.map ↑f ↑g


@[to_additive]
lemma inf_mul_right [SemilatticeInf β] [OrderTop β] (s t : Finset α) (f : α → β) :
    inf (s * t) f = inf t fun y ↦ inf s (f <| · * y)

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[Mul α]
[SemilatticeInf β]
[OrderTop β]
(s t : Finset α)
(f : α → β)

(s * t).inf f = t.inf fun y => s.inf fun x => f (x * y)


theorem le_comap_map {f : M →[L] N} : S ≤ (S.map f).comap f

{L : FirstOrder.Language}
{M : Type w}
{N : Type u_1}
[L.Structure M]
[L.Structure N]
(S : L.Substructure M)
{f : L.Hom M N}

S ≤ FirstOrder.Language.Substructure.comap f (FirstOrder.Language.Substructure.map f S)


theorem integral_eq_setToL1S (f : α →₁ₛ[μ] E) : integral f = setToL1S (weightedSMul μ) f

(f : ↥(MeasureTheory.Lp.simpleFunc E 1 μ))

MeasureTheory.L1.SimpleFunc.integral f = MeasureTheory.L1.SimpleFunc.setToL1S (MeasureTheory.weightedSMul μ) f


theorem tendsto_iff_ptendsto_univ (l₁ : Filter α) (l₂ : Filter β) (f : α → β) :
    Tendsto f l₁ l₂ ↔ PTendsto (PFun.res f Set.univ) l₁ l₂

{α : Type u}
{β : Type v}
(l₁ : Filter α)
(l₂ : Filter β)
(f : α → β)

Filter.Tendsto f l₁ l₂ ↔ Filter.PTendsto (PFun.res f Set.univ) l₁ l₂


theorem closure_eq_inter_uniformity {t : Set (α × α)} : closure t = ⋂ d ∈ 𝓤 α, d ○ (t ○ d)

{α : Type ua}
[UniformSpace α]
{t : Set (α × α)}


@[simp]
theorem dotProduct_diagonal' (i : m) : (v ⬝ᵥ fun j => diagonal w j i) = v i * w i

{m : Type u_2}
{α : Type v}
[Fintype m]
[DecidableEq m]
[NonUnitalNonAssocSemiring α]
(v w : m → α)
(i : m)

(v ⬝ᵥ fun j => Matrix.diagonal w j i) = v i * w i


/-- When the second map `S.g` is zero, this is the homology data on `S` given
by any colimit cokernel cofork of `S.f` -/
@[simps]
def ofIsColimitCokernelCofork (hg : S.g = 0) (c : CokernelCofork S.f) (hc : IsColimit c) :
    S.HomologyData

(c : CategoryTheory.Limits.CokernelCofork S.f)

(hc : CategoryTheory.Limits.IsColimit c)

(CategoryTheory.ShortComplex.HomologyData.ofIsColimitCokernelCofork S hg c hc).iso =
  CategoryTheory.Iso.refl (CategoryTheory.ShortComplex.LeftHomologyData.ofIsColimitCokernelCofork S hg c hc).H


lemma equation_some (X Y : R) : W'.Equation ![X, Y, 1] ↔ W'.toAffine.Equation X Y

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
(X Y : R)


@[simp]
theorem apply_symm_apply (x : P₂) : e (e.symm x) = x

{𝕜 : Type u_1}
{V : Type u_2}
{V₂ : Type u_5}
{P : Type u_10}
{P₂ : Type u_11}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[NormedSpace 𝕜 V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
[SeminormedAddCommGroup V₂]
[NormedSpace 𝕜 V₂]
[PseudoMetricSpace P₂]
[NormedAddTorsor V₂ P₂]
(e : P ≃ᵃⁱ[𝕜] P₂)
(x : P₂)


@[simp] lemma toNNReal_abs (x : ℝ) : |x|.toNNReal = nnabs x


@[simp] lemma sup_eq_inf : a ⊔ b = a ⊓ b ↔ a = b


theorem isThreeCycle_cycleRange_two {n : ℕ} : IsThreeCycle (cycleRange 2 : Perm (Fin (n + 3)))


@[simp]
theorem encode_of_not_none_mem [DecidableEq α] (s : Sym (Option α) n.succ) (h : ¬none ∈ s) :
    encode s =
      Sum.inr
        (s.attach.map fun o =>
          o.1.get <| Option.ne_none_iff_isSome.1 <| ne_of_mem_of_not_mem o.2 h)

{α : Type u_1}
{n : ℕ}
[DecidableEq α]
(s : Sym (Option α) n.succ)
(h : none ∉ s)

SymOptionSuccEquiv.encode s = Sum.inr (Sym.map (fun o => (↑o).get ⋯) s.attach)


theorem HasSum.matrix_diag {f : X → Matrix n n R} {a : Matrix n n R} (hf : HasSum f a) :
    HasSum (fun x => diag (f x)) (diag a)

{X : Type u_1}
{n : Type u_5}
{R : Type u_8}
[AddCommMonoid R]
[TopologicalSpace R]
{f : X → Matrix n n R}
{a : Matrix n n R}
(hf : HasSum f a)


protected theorem continuous (di : DenseInducing i) : Continuous i

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{i : α → β}
(di : DenseInducing i)


/-- To give an isomorphism between cocones, it suffices to give an
  isomorphism between their vertices which commutes with the cocone
  maps. -/
-- Porting note: `@[ext]` used to accept lemmas like this. Now we add an aesop rule
@[aesop apply safe (rule_sets := [CategoryTheory]), simps]
def ext {c c' : Bicone F} (φ : c.pt ≅ c'.pt)
    (wι : ∀ j, c.ι j ≫ φ.hom = c'.ι j := by aesop_cat)
    (wπ : ∀ j, φ.hom ≫ c'.π j = c.π j := by aesop_cat) : c ≅ c'

(wι : ∀ (j : J), c.ι j ≫ φ.hom = c'.ι j := by aesop_cat)

(wπ : ∀ (j : J), φ.hom ≫ c'.π j = c.π j := by aesop_cat)

(CategoryTheory.Limits.Bicones.ext φ wι wπ).hom.hom = φ.hom


theorem dvd_of_mem_factors' {a : α} {p : Associates α} {hp : Irreducible p} {hz : a ≠ 0}
    (h_mem : Subtype.mk p hp ∈ factors' a) : p ∣ Associates.mk a

(h_mem : ⟨p, hp⟩ ∈ Associates.factors' a)


/-- Right-composition gives a functor `(D ⥤ E) ⥤ ((C ⥤ D) ⥤ (C ⥤ E))`.

`(whiskeringRight.obj H).obj F` is `F ⋙ H`, and
`(whiskeringRight.obj H).map α` is `whiskerRight α H`.
-/
@[simps]
def whiskeringRight : (D ⥤ E) ⥤ (C ⥤ D) ⥤ C ⥤ E

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

∀ {X Y : CategoryTheory.Functor D E} (τ : X ⟶ Y) (F : CategoryTheory.Functor C D) (c : C),
  (((CategoryTheory.whiskeringRight C D E).map τ).app F).app c = τ.app (F.obj c)


theorem powersetCard_le_powerset (n : ℕ) (s : Multiset α) : powersetCard n s ≤ powerset s


theorem not_isUnit_X_pow_sub_one (R : Type*) [CommRing R] [Nontrivial R] (n : ℕ) :
    ¬IsUnit (X ^ n - 1 : R[X])

(R : Type u_1)
[CommRing R]
[Nontrivial R]
(n : ℕ)


theorem hasBasis_smallSets (l : Filter α) :
    HasBasis l.smallSets (fun t : Set α => t ∈ l) powerset

l.smallSets.HasBasis (fun t => t ∈ l) Set.powerset


@[simp]
theorem prod_eq_iff_eq (ht : t.Nonempty) : s ×ˢ t = s₁ ×ˢ t ↔ s = s₁

{α : Type u_1}
{β : Type u_2}
{s s₁ : Set α}
{t : Set β}
(ht : t.Nonempty)


@[to_additive]
theorem orderOf_dvd_card : orderOf x ∣ Fintype.card G

{G : Type u_1}
[AddGroup G]
[Fintype G]
{x : G}


theorem ClosedEmbedding.quasiSober {f : α → β} (hf : ClosedEmbedding f) [QuasiSober β] :
    QuasiSober α

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
(hf : ClosedEmbedding f)
[QuasiSober β]


/-- A (multiplicative) Lie group is a group and a smooth manifold at the same time in which
the multiplication and inverse operations are smooth. -/
@[to_additive]
class LieGroup {𝕜 : Type*} [NontriviallyNormedField 𝕜] {H : Type*} [TopologicalSpace H]
    {E : Type*} [NormedAddCommGroup E] [NormedSpace 𝕜 E] (I : ModelWithCorners 𝕜 E H) (G : Type*)
    [Group G] [TopologicalSpace G] [ChartedSpace H G] extends SmoothMul I G : Prop where
  /-- Inversion is smooth in a Lie group. -/
  smooth_inv : Smooth I I fun a : G => a⁻¹

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[Group G]
[TopologicalSpace G]
[ChartedSpace H G]
[self : LieGroup I G]


theorem dirac_bind {m : Measure α} : bind m dirac = m

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


theorem hasMFDerivWithinAt_id (s : Set M) (x : M) :
    HasMFDerivWithinAt I I (@id M) s x (ContinuousLinearMap.id 𝕜 (TangentSpace I x))

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

HasMFDerivWithinAt I I id s x (ContinuousLinearMap.id 𝕜 (TangentSpace I x))


@[simp]
theorem mk_preimage_prod_left (hb : b ∈ t) : (fun a => (a, b)) ⁻¹' s ×ˢ t = s

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{b : β}
(hb : b ∈ t)


/-- The less-or-equal relation for the lexicographic ordering is decidable. -/
irreducible_def Lex.decidableLE : @DecidableRel (Lex (Π₀ i, α i)) (· ≤ ·)

{ι : Type u_3}
{α : ι → Type u_4}
[(i : ι) → Zero (α i)]
[LinearOrder ι]
[(i : ι) → LinearOrder (α i)]

DFinsupp.Lex.decidableLE =
  DFinsupp.lt_trichotomy_rec (fun {f g} h => isTrue ⋯) (fun {f g} h => isTrue ⋯) fun {f g} h => isFalse ⋯


@[simp]
theorem bind_def {β} : ((· >>= ·) : Semiquot α → (α → Semiquot β) → Semiquot β) = bind

(fun x x_1 => x >>= x_1) = Semiquot.bind


theorem eq_snoc_eraseLast {s : CompositionSeries X} (h : 0 < s.length) :
    s = snoc (eraseLast s) s.last (isMaximal_eraseLast_last h)

{X : Type u}
[Lattice X]
[JordanHolderLattice X]
{s : CompositionSeries X}
(h : 0 < s.length)

s = (RelSeries.eraseLast s).snoc (RelSeries.last s) ⋯


/-- Given a left homology map data for morphism `φ`, this is the induced left homology
map data for `-φ`. -/
@[simps]
def neg : LeftHomologyMapData (-φ) h₁ h₂

(γ : CategoryTheory.ShortComplex.LeftHomologyMapData φ h₁ h₂)


theorem setToFun_congr_measure_of_integrable {μ' : Measure α} (c' : ℝ≥0∞) (hc' : c' ≠ ∞)
    (hμ'_le : μ' ≤ c' • μ) (hT : DominatedFinMeasAdditive μ T C)
    (hT' : DominatedFinMeasAdditive μ' T C') (f : α → E) (hfμ : Integrable f μ) :
    setToFun μ T hT f = setToFun μ' T hT' f

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(hT' : MeasureTheory.DominatedFinMeasAdditive μ' T C')

MeasureTheory.setToFun μ T hT f = MeasureTheory.setToFun μ' T hT' f


theorem gluedLift_p1 : gluedLift 𝒰 f g s ≫ p1 𝒰 f g = s.fst

[∀ (i : 𝒰.J), CategoryTheory.Limits.HasPullback (𝒰.map i ≫ f) g]

(s : CategoryTheory.Limits.PullbackCone f g)

AlgebraicGeometry.Scheme.Pullback.gluedLift 𝒰 f g s ≫ AlgebraicGeometry.Scheme.Pullback.p1 𝒰 f g = s.fst


theorem mul_num_den' (q r : ℚ) :
    (q * r).num * q.den * r.den = q.num * r.num * (q * r).den

(q * r).num * ↑q.den * ↑r.den = q.num * r.num * ↑(q * r).den


@[to_additive]
theorem eq_iff_eq_of_div_eq_div (H : a / b = c / d) : a = b ↔ c = d

{G : Type u_3}
[Group G]
{a b c d : G}
(H : a / b = c / d)


theorem sym2_eq_image : s.sym2 = (s ×ˢ s).image Sym2.mk

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


/-- If `β` is a second-countable space, then its induced topology via
`f` on `α` is also second-countable. -/
theorem secondCountableTopology_induced (β) [t : TopologicalSpace β] [SecondCountableTopology β]
    (f : α → β) : @SecondCountableTopology α (t.induced f)

(α : Type u)
(β : Type u_1)
[t : TopologicalSpace β]
[SecondCountableTopology β]
(f : α → β)


/-- Simplifies a normal form from `get!` -/
@[simp] theorem getD_get?_setD (a : Array α) (i : Nat) (v d : α) :
  Option.getD (setD a i v)[i]? d = if i < a.size then v else d

{α : Type u_1}
(a : Array α)
(i : Nat)
(v d : α)

(a.setD i v)[i]?.getD d = if i < a.size then v else d


theorem pairwise_lt_range (n : ℕ) : Pairwise (· < ·) (range n)

List.Pairwise (fun x x_1 => x < x_1) (List.range n)


@[simp]
theorem mul_eq_right₀ (hb : b ≠ 0) : a * b = b ↔ a = 1

{M₀ : Type u_2}
[CancelMonoidWithZero M₀]
{a b : M₀}
(hb : b ≠ 0)


theorem removeNone_aux_inv (x : α) : removeNone_aux e.symm (removeNone_aux e x) = x

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

e.symm.removeNone_aux (e.removeNone_aux x) = x


theorem convexBodySumFun_add_le (x y : E K) :
    convexBodySumFun (x + y) ≤ convexBodySumFun x + convexBodySumFun y

(x y : ({ w // w.IsReal } → ℝ) × ({ w // w.IsComplex } → ℂ))

NumberField.mixedEmbedding.convexBodySumFun (x + y) ≤
  NumberField.mixedEmbedding.convexBodySumFun x + NumberField.mixedEmbedding.convexBodySumFun y


@[simp]
theorem coe_mapRingHom (f : R →+* S) : ⇑(mapRingHom f) = map f

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
(f : R →+* S)

⇑(Polynomial.mapRingHom f) = Polynomial.map f


theorem dvd_map_of_isScalarTower (A K : Type*) {R : Type*} [CommRing A] [Field K] [CommRing R]
    [Algebra A K] [Algebra A R] [Algebra K R] [IsScalarTower A K R] (x : R) :
    minpoly K x ∣ (minpoly A x).map (algebraMap A K)

(A : Type u_3)
(K : Type u_4)
{R : Type u_5}
[CommRing A]
[Field K]
[CommRing R]
[Algebra A K]
[Algebra A R]
[Algebra K R]
[IsScalarTower A K R]
(x : R)

minpoly K x ∣ Polynomial.map (algebraMap A K) (minpoly A x)


theorem isBigO_snd_prod : g' =O[l] fun x => (f' x, g' x)

{α : Type u_1}
{E' : Type u_6}
{F' : Type u_7}
[SeminormedAddCommGroup E']
[SeminormedAddCommGroup F']
{f' : α → E'}
{g' : α → F'}
{l : Filter α}


theorem Ico_eq_empty_iff : Ico a b = ∅ ↔ ¬a < b


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

(hf : MeasureTheory.MeasurePreserving f μ' μ)

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


@[simp] lemma ofColex_top [Fintype α] : ofColex (⊤ : Colex α) = univ

{α : Type u_1}
[LinearOrder α]
[Fintype α]


@[to_additive lt_of_add_lt_add_left]
theorem lt_of_mul_lt_mul_left' [ContravariantClass α α (· * ·) (· < ·)] {a b c : α}
    (bc : a * b < a * c) :
    b < c

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


@[simp, norm_cast] lemma coe_add (x y : ℝ≥0) : (↑(x + y) : ℝ≥0∞) = x + y


theorem measure_zero_iff_ae_nmem {s : Set α} : μ s = 0 ↔ ∀ᵐ a ∂μ, a ∉ s

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


/-- The slit plane is star-shaped at a positive real number. -/
lemma starConvex_ofReal_slitPlane {x : ℝ} (hx : 0 < x) : StarConvex ℝ ↑x slitPlane


theorem coeff_reverse (f : R[X]) (n : ℕ) : f.reverse.coeff n = f.coeff (revAt f.natDegree n)

{R : Type u_1}
[Semiring R]
(f : Polynomial R)
(n : ℕ)

f.reverse.coeff n = f.coeff ((Polynomial.revAt f.natDegree) n)


theorem IsPushout.IsVanKampen.mono_of_mono_left [Mono f] {H : IsPushout f g h i}
    (H' : H.IsVanKampen) : Mono i

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{W X Y Z : C}
{f : W ⟶ X}
{g : W ⟶ Y}
{h : X ⟶ Z}
{i : Y ⟶ Z}
[CategoryTheory.Mono f]
{H : CategoryTheory.IsPushout f g h i}
(H' : H.IsVanKampen)


theorem lintegral_abs_det_fderiv_le_addHaar_image_aux2 (hs : MeasurableSet s) (h's : μ s ≠ ∞)
    (hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (hf : InjOn f s) :
    (∫⁻ x in s, ENNReal.ofReal |(f' x).det| ∂μ) ≤ μ (f '' s)

∫⁻ (x : E) in s, ENNReal.ofReal |(f' x).det| ∂μ ≤ μ (f '' s)


/-- An Akra-Bazzi recurrence is a function that satisfies the recurrence
`T n = (∑ i, a i * T (r i n)) + g n`. -/
structure AkraBazziRecurrence {α : Type*} [Fintype α] [Nonempty α]
    (T : ℕ → ℝ) (g : ℝ → ℝ) (a : α → ℝ) (b : α → ℝ) (r : α → ℕ → ℕ) where
  /-- Point below which the recurrence is in the base case -/
  n₀ : ℕ
  /-- `n₀` is always `> 0` -/
  n₀_gt_zero : 0 < n₀
  /-- The `a`'s are nonzero -/
  a_pos : ∀ i, 0 < a i
  /-- The `b`'s are nonzero -/
  b_pos : ∀ i, 0 < b i
  /-- The b's are less than 1 -/
  b_lt_one : ∀ i, b i < 1
  /-- `g` is nonnegative -/
  g_nonneg : ∀ x ≥ 0, 0 ≤ g x
  /-- `g` grows polynomially -/
  g_grows_poly : AkraBazziRecurrence.GrowsPolynomially g
  /-- The actual recurrence -/
  h_rec (n : ℕ) (hn₀ : n₀ ≤ n) : T n = (∑ i, a i * T (r i n)) + g n
  /-- Base case: `T(n) > 0` whenever `n < n₀` -/
  T_gt_zero' (n : ℕ) (hn : n < n₀) : 0 < T n
  /-- The `r`'s always reduce `n` -/
  r_lt_n : ∀ i n, n₀ ≤ n → r i n < n
  /-- The `r`'s approximate the `b`'s -/
  dist_r_b : ∀ i, (fun n => (r i n : ℝ) - b i * n) =o[atTop] fun n => n / (log n) ^ 2

{α : Type u_1}
[Fintype α]
[Nonempty α]
{T : ℕ → ℝ}
{g : ℝ → ℝ}
{a b : α → ℝ}
{r : α → ℕ → ℕ}
(self : AkraBazziRecurrence T g a b r)
(n : ℕ)
(hn₀ : self.n₀ ≤ n)


theorem mul_ι_mul_ι_of_isOrtho (x : CliffordAlgebra Q) {a b : M} (h : Q.IsOrtho a b) :
    x * ι Q a * ι Q b = -(x * ι Q b * ι Q a)

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}
(x : CliffordAlgebra Q)
{a b : M}
(h : QuadraticMap.IsOrtho Q a b)

x * (CliffordAlgebra.ι Q) a * (CliffordAlgebra.ι Q) b = -(x * (CliffordAlgebra.ι Q) b * (CliffordAlgebra.ι Q) a)


@[simp]
theorem refl_trans (e : P₁ ≃ᵃ[k] P₂) : (refl k P₁).trans e = e

{k : Type u_1}
{P₁ : Type u_2}
{P₂ : Type u_3}
{V₁ : Type u_6}
{V₂ : Type u_7}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
[AddCommGroup V₂]
[Module k V₂]
[AffineSpace V₂ P₂]
(e : P₁ ≃ᵃ[k] P₂)


@[simp]
theorem cospan_right {X Y Z : C} (f : X ⟶ Z) (g : Y ⟶ Z) :
    (cospan f g).obj WalkingCospan.right = Y

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

(CategoryTheory.Limits.cospan f g).obj CategoryTheory.Limits.WalkingCospan.right = Y


/-- Product of a multiset of elements in a subfield is in the subfield. -/
protected theorem multiset_prod_mem (m : Multiset K) : (∀ a ∈ m, a ∈ s) → m.prod ∈ s

{K : Type u}
[Field K]
(s : Subfield K)
(m : Multiset K)


lemma exists_leftFraction₂ [W.HasLeftCalculusOfFractions] :
    ∃ (ψ : W.LeftFraction₂ X Y), φ.f ≫ ψ.s = φ.s ≫ ψ.f ∧
      φ.f' ≫ ψ.s = φ.s ≫ ψ.f'

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
{W : CategoryTheory.MorphismProperty C}
{X Y : C}
(φ : W.RightFraction₂ X Y)
[W.HasLeftCalculusOfFractions]

∃ ψ,
  CategoryTheory.CategoryStruct.comp φ.f ψ.s = CategoryTheory.CategoryStruct.comp φ.s ψ.f ∧
    CategoryTheory.CategoryStruct.comp φ.f' ψ.s = CategoryTheory.CategoryStruct.comp φ.s ψ.f'


@[to_additive]
lemma mulIndicator_apply_le' (hfg : a ∈ s → f a ≤ y) (hg : a ∉ s → 1 ≤ y) :
    mulIndicator s f a ≤ y

{α : Type u_2}
{M : Type u_4}
[LE M]
[One M]
{s : Set α}
{f : α → M}
{a : α}
{y : M}
(hfg : a ∈ s → f a ≤ y)
(hg : a ∉ s → 1 ≤ y)


@[simp]
theorem map_id_c_app (F : J ⥤ PresheafedSpace.{_, _, v} C) (j) (U) :
    (F.map (𝟙 j)).c.app U =
      (Pushforward.id (F.obj j).presheaf).inv.app U ≫
        (pushforwardEq (by simp) (F.obj j).presheaf).hom.app U

(F : J ⥤ AlgebraicGeometry.PresheafedSpace C)

(U : (TopologicalSpace.Opens ↑↑(F.obj j))ᵒᵖ)

(F.map (𝟙 j)).c.app U =
  (TopCat.Presheaf.Pushforward.id (F.obj j).presheaf).inv.app U ≫
    (TopCat.Presheaf.pushforwardEq ⋯ (F.obj j).presheaf).hom.app U


theorem norm_symm_pos [RingHomIsometric σ₁₂] [Nontrivial E] (e : E ≃SL[σ₁₂] F) :
    0 < ‖(e.symm : F →SL[σ₂₁] E)‖

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
{σ₂₁ : 𝕜₂ →+* 𝕜}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[RingHomIsometric σ₂₁]
[RingHomIsometric σ₁₂]
[Nontrivial E]
(e : E ≃SL[σ₁₂] F)


theorem IsBigOWith.exists_pos (h : IsBigOWith c l f g') :
    ∃ c' > 0, IsBigOWith c' l f g'

{α : Type u_1}
{E : Type u_3}
{F' : Type u_7}
[Norm E]
[SeminormedAddCommGroup F']
{c : ℝ}
{f : α → E}
{g' : α → F'}
{l : Filter α}
(h : Asymptotics.IsBigOWith c l f g')

∃ c' > 0, Asymptotics.IsBigOWith c' l f g'


/-- Eta rule for costructured arrows. Prefer `CostructuredArrow.eta` for rewriting, as equality of
    objects tends to cause problems. -/
theorem eq_mk (f : CostructuredArrow S T) : f = mk f.hom

(f : CategoryTheory.CostructuredArrow S T)

f = CategoryTheory.CostructuredArrow.mk f.hom


theorem sub_one_mul_sum_log_div_pow_eq_sub_sum_digits {p : ℕ} (n : ℕ) :
    (p - 1) * ∑ i ∈ range (log p n).succ, n / p ^ i.succ = n - (p.digits n).sum

(p - 1) * ∑ i ∈ Finset.range (Nat.log p n).succ, n / p ^ i.succ = n - (p.digits n).sum


@[simp]
theorem constantCoeff_inv (φ : MvPowerSeries σ k) :
    constantCoeff σ k φ⁻¹ = (constantCoeff σ k φ)⁻¹

{σ : Type u_1}
{k : Type u_3}
[Field k]
(φ : MvPowerSeries σ k)

(MvPowerSeries.constantCoeff σ k) φ⁻¹ = ((MvPowerSeries.constantCoeff σ k) φ)⁻¹


/-- The tangent of an angle in a right-angled triangle as a ratio of sides. -/
theorem tan_angle_add_of_inner_eq_zero {x y : V} (h : ⟪x, y⟫ = 0) :
    Real.tan (angle x (x + y)) = ‖y‖ / ‖x‖

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

Real.tan (InnerProductGeometry.angle x (x + y)) = ‖y‖ / ‖x‖


@[to_additive (attr := gcongr) add_lt_add_left]
theorem mul_lt_mul_left' [CovariantClass α α (· * ·) (· < ·)] {b c : α} (bc : b < c) (a : α) :
    a * b < a * c

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