theorem mem_upperBounds_image_self (Hf : MonotoneOn f t) :
    a ∈ upperBounds t → a ∈ t → f a ∈ upperBounds (f '' t)

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
{t : Set α}
{a : α}
(Hf : MonotoneOn f t)


theorem ext_iff {f g : R →ₑ+*[φ] S} : f = g ↔ ∀ x, f x = g x

{M : Type u_1}
[Monoid M]
{N : Type u_2}
[Monoid N]
{φ : M →* N}
{R : Type u_10}
[Semiring R]
[MulSemiringAction M R]
{S : Type u_12}
[Semiring S]
[MulSemiringAction N S]
{f g : R →ₑ+*[φ] S}


@[elab_as_elim]
protected theorem induction_on₂ {C : Trunc α → Trunc β → Prop} (q₁ : Trunc α) (q₂ : Trunc β)
    (h : ∀ a b, C (mk a) (mk b)) : C q₁ q₂

(h : ∀ (a : α) (b : β), C (Trunc.mk a) (Trunc.mk b))


@[simp]
theorem comap_id : m.comap id = m


/-- Interpret a `Homeomorph` as a `PartialHomeomorph` by restricting it
to an open set `s` in the domain and to `t` in the codomain. -/
@[simps! (config := .asFn) apply symm_apply toPartialEquiv,
  simps! (config := .lemmasOnly) source target]
def _root_.Homeomorph.toPartialHomeomorphOfImageEq (e : X ≃ₜ Y) (s : Set X) (hs : IsOpen s)
    (t : Set Y) (h : e '' s = t) : PartialHomeomorph X Y

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : X ≃ₜ Y)
(s : Set X)
(hs : IsOpen s)
(t : Set Y)
(h : ⇑e '' s = t)

(e.toPartialHomeomorphOfImageEq s hs t h).target = t


theorem mem_support_iff {u v w : V} (p : G.Walk u v) :
    w ∈ p.support ↔ w = u ∨ w ∈ p.support.tail

{V : Type u}
{G : SimpleGraph V}
{u v w : V}
(p : G.Walk u v)


/-- The short complex `Fun(G, A) --dOne--> Fun(G × G, A) --dTwo--> Fun(G × G × G, A)` is
isomorphic to the 2nd short complex associated to the complex of inhomogeneous cochains of `A`. -/
@[simps! hom inv]
def shortComplexH2Iso :
    (inhomogeneousCochains A).sc' 1 2 3 ≅ shortComplexH2 A

{k G : Type u}
[CommRing k]
[Group G]
(A : Rep k G)

(groupCohomology.shortComplexH2Iso A).hom =
  { τ₁ := ↑(groupCohomology.oneCochainsLequiv A), τ₂ := ↑(groupCohomology.twoCochainsLequiv A),
    τ₃ := ↑(groupCohomology.threeCochainsLequiv A), comm₁₂ := ⋯, comm₂₃ := ⋯ }


theorem gcd_dvd_left (n m : ℕ+) : gcd n m ∣ n


theorem one_le_div (hb : 0 < b) : 1 ≤ a / b ↔ b ≤ a

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


/-- The kernel of `S.normedMk` is `S`. -/
theorem ker_normedMk (S : AddSubgroup M) : S.normedMk.ker = S

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


/-- Shows that the recurrence relation (`convs`) and direct evaluation (`convs'`) of a
(regular) continued fraction coincide. -/
nonrec theorem convs_eq_convs' [LinearOrderedField K] {c : ContFract K} :
    (↑c : GenContFract K).convs = (↑c : GenContFract K).convs'

{K : Type u_1}
[LinearOrderedField K]
{c : ContFract K}


@[to_additive]
theorem mulIndicator_inv' (s : Set α) (f : α → G) : mulIndicator s f⁻¹ = (mulIndicator s f)⁻¹

{α : Type u_1}
{G : Type u_6}
[Group G]
(s : Set α)
(f : α → G)

s.mulIndicator f⁻¹ = (s.mulIndicator f)⁻¹


@[elab_as_elim, cases_eliminator, induction_eliminator]
protected theorem ind {f : Sym2 α → Prop} (h : ∀ x y, f s(x, y)) : ∀ i, f i

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


theorem dotProduct_star : v ⬝ᵥ star w = star (w ⬝ᵥ star v)

{m : Type u_2}
{α : Type v}
[Fintype m]
[NonUnitalSemiring α]
[StarRing α]
(v w : m → α)


/-- Combine two `PartialEquiv`s with disjoint sources and disjoint targets. We reuse
`PartialEquiv.piecewise`, then override `source` and `target` to ensure better definitional
equalities. -/
@[simps! (config := .asFn)]
def disjointUnion (e e' : PartialEquiv α β) (hs : Disjoint e.source e'.source)
    (ht : Disjoint e.target e'.target) [∀ x, Decidable (x ∈ e.source)]
    [∀ y, Decidable (y ∈ e.target)] : PartialEquiv α β

{α : Type u_1}
{β : Type u_2}
(e e' : PartialEquiv α β)
(hs : Disjoint e.source e'.source)
(ht : Disjoint e.target e'.target)
[(x : α) → Decidable (x ∈ e.source)]
[(y : β) → Decidable (y ∈ e.target)]

↑(e.disjointUnion e' hs ht).symm = e.target.piecewise ↑e.symm ↑e'.symm


@[to_additive]
theorem units_val : Commute u₁ u₂ → Commute (u₁ : M) u₂


/-- Turn a colimit for `F : J ⥤ Cᵒᵖ` into a limit for `F.leftOp : Jᵒᵖ ⥤ C`. -/
@[simps]
def isLimitConeLeftOpOfCocone (F : J ⥤ Cᵒᵖ) {c : Cocone F} (hc : IsColimit c) :
    IsLimit (coneLeftOpOfCocone c)

(hc : CategoryTheory.Limits.IsColimit c)

(s : CategoryTheory.Limits.Cone F.leftOp)

(CategoryTheory.Limits.isLimitConeLeftOpOfCocone F hc).lift s =
  (hc.desc (CategoryTheory.Limits.coconeOfConeLeftOp s)).unop


theorem _root_.Monotone.set_prod (hf : Monotone f) (hg : Monotone g) :
    Monotone fun x => f x ×ˢ g x

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


/-- An auxiliary type for the proof of Urysohn's lemma: a pair of a closed set `C` and its
open neighborhood `U`, together with the assumption that `C` satisfies the property `P C`. The
latter assumption will make it possible to prove simultaneously both versions of Urysohn's lemma,
in normal spaces (with `P` always true) and in locally compact spaces (with `P = IsCompact`).
We put also in the structure the assumption that, for any such pair, one may find an intermediate
pair inbetween satisfying `P`, to avoid carrying it around in the argument. -/
structure CU {X : Type*} [TopologicalSpace X] (P : Set X → Prop) where
  /-- The inner set in the inductive construction towards Urysohn's lemma -/
  protected C : Set X
  /-- The outer set in the inductive construction towards Urysohn's lemma -/
  protected U : Set X
  protected P_C : P C
  protected closed_C : IsClosed C
  protected open_U : IsOpen U
  protected subset : C ⊆ U
  protected hP : ∀ {c u : Set X}, IsClosed c → P c → IsOpen u → c ⊆ u →
    ∃ v, IsOpen v ∧ c ⊆ v ∧ closure v ⊆ u ∧ P (closure v)

{X : Type u_2}
[TopologicalSpace X]
{P : Set X → Prop}
(self : Urysohns.CU P)
{c u : Set X}


theorem lowerSemicontinuous_ciSup {f : ι → α → δ'} (bdd : ∀ x, BddAbove (range fun i => f i x))
    (h : ∀ i, LowerSemicontinuous (f i)) : LowerSemicontinuous fun x' => ⨆ i, f i x'

{f : ι → α → δ'}

(bdd : ∀ (x : α), BddAbove (Set.range fun i => f i x))

(h : ∀ (i : ι), LowerSemicontinuous (f i))


@[simp] theorem ncard_diff_singleton_add_one {a : α} (h : a ∈ s)
    (hs : s.Finite := by toFinite_tac) : (s \ {a}).ncard + 1 = s.ncard

{α : Type u_1}
{s : Set α}
{a : α}
(h : a ∈ s)
(hs : s.Finite := by toFinite_tac)


theorem convexJoin_comm (s t : Set E) : convexJoin 𝕜 s t = convexJoin 𝕜 t s

{𝕜 : Type u_2}
{E : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
(s t : Set E)


lemma toColex_le_toColex_iff_max'_mem :
    toColex s ≤ toColex t ↔ ∀ hst : s ≠ t, (s ∆ t).max' (symmDiff_nonempty.2 hst) ∈ t

{α : Type u_1}
[LinearOrder α]
{s t : Finset α}

{ ofColex := s } ≤ { ofColex := t } ↔ ∀ (hst : s ≠ t), (symmDiff s t).max' ⋯ ∈ t


theorem hasLimit_iff_small_sections (F : J ⥤ Type u) : HasLimit F ↔ Small.{u} F.sections

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

CategoryTheory.Limits.HasLimit F ↔ Small.{u, max u v} ↑F.sections


theorem blimsup_eq_iInf_biSup_of_nat {p : ℕ → Prop} {u : ℕ → α} :
    blimsup u atTop p = ⨅ i, ⨆ (j) (_ : p j ∧ i ≤ j), u j

{α : Type u_1}
[CompleteLattice α]
{p : ℕ → Prop}
{u : ℕ → α}

Filter.blimsup u Filter.atTop p = ⨅ i, ⨆ j, ⨆ (_ : p j ∧ i ≤ j), u j


@[to_additive]
lemma Submonoid.orderOf_le_card (s : Submonoid G) (hs : (s : Set G).Finite) (hx : x ∈ s) :
    orderOf x ≤ Nat.card s

{G : Type u_1}
[AddGroup G]
{x : G}
(s : AddSubmonoid G)
(hs : (↑s).Finite)
(hx : x ∈ s)


/-- No point making this an instance, as it requires `i`. -/
theorem hasKernels [PreservesFiniteLimits G] : HasKernels C

(i : F.comp G ≅ CategoryTheory.Functor.id C)


/-- If `f` is bounded and not trivial, then it is equivalent to a p-adic absolute value. -/
theorem mulRingNorm_equiv_padic_of_bounded :
    ∃! p, ∃ (hp : Fact (p.Prime)), MulRingNorm.equiv f (mulRingNorm_padic p)

{f : MulRingNorm ℚ}
(hf_nontriv : f ≠ 1)
(bdd : ∀ (n : ℕ), f ↑n ≤ 1)

∃! p, ∃ (hp : Fact (Nat.Prime p)), f.equiv (Rat.MulRingNorm.mulRingNorm_padic p)


/-- A regular monomorphism is an isomorphism if it is an epimorphism. -/
theorem isIso_of_regularMono_of_epi (f : X ⟶ Y) [RegularMono f] [Epi f] : IsIso f

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


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


@[to_additive]
lemma mem_zpowers_iff_mem_range_orderOf [DecidableEq G] :
    y ∈ zpowers x ↔ y ∈ (Finset.range (orderOf x)).image (x ^ ·)

{G : Type u_1}
[AddGroup G]
[Finite G]
{x y : G}
[DecidableEq G]

y ∈ AddSubgroup.zmultiples x ↔ y ∈ Finset.image (fun x_1 => x_1 • x) (Finset.range (addOrderOf x))


@[simp]
lemma isoOfIsoLift_hom_inv_id (f : R ⟶ S) (φ : a ≅ b) [p.IsHomLift f φ.hom] :
    f ≫ (isoOfIsoLift p f φ).inv = 𝟙 R

{𝒮 : Type u₁}
{𝒳 : Type u₂}
[CategoryTheory.Category.{v₁, u₂} 𝒳]
[CategoryTheory.Category.{v₂, u₁} 𝒮]
(p : 𝒳 ⥤ 𝒮)
{R S : 𝒮}
{a b : 𝒳}
(f : R ⟶ S)
(φ : a ≅ b)
[p.IsHomLift f φ.hom]

f ≫ (CategoryTheory.IsHomLift.isoOfIsoLift p f φ).inv = 𝟙 R


@[simp]
theorem sumMap_comp_inr : ϕ.sumMap ψ ∘ᴸ LHom.sumInr = LHom.sumInr ∘ᴸ ψ

{L : FirstOrder.Language}
{L' : FirstOrder.Language}
(ϕ : L →ᴸ L')
{L₁ : FirstOrder.Language}
{L₂ : FirstOrder.Language}
(ψ : L₁ →ᴸ L₂)

(ϕ.sumMap ψ).comp FirstOrder.Language.LHom.sumInr = FirstOrder.Language.LHom.sumInr.comp ψ


theorem Decidable.not_imp_not [Decidable a] : (¬a → ¬b) ↔ (b → a)

¬a → ¬b ↔ b → a


@[norm_cast] theorem ofNat_inj : ((m : Nat) : Int) = (n : Nat) ↔ m = n


theorem xy_coprime (n) : (xn a1 n).Coprime (yn a1 n)


@[to_additive const_nonneg_of_nonneg]
theorem one_le_const_of_one_le (ha : 1 ≤ a) : 1 ≤ const β a

{α : Type u_3}
(β : Type u_4)
[One α]
[Preorder α]
{a : α}
(ha : 1 ≤ a)


/-- Each element of the scalars defines a zero-preserving map. -/
@[simps]
def SMulZeroClass.toZeroHom (x : M) :
    ZeroHom A A

{M : Type u_1}
(A : Type u_4)
[Zero A]
[SMulZeroClass M A]
(x : M)

∀ (x_1 : A), (SMulZeroClass.toZeroHom A x) x_1 = x • x_1


@[simp]
protected theorem mem_ker (x : L) : x ∈ LieModule.ker R L M ↔ ∀ m : M, ⁅x, m⁆ = 0

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

x ∈ LieModule.ker R L M ↔ ∀ (m : M), ⁅x, m⁆ = 0


@[simp]
lemma moduleCatLeftHomologyData_f' :
    S.moduleCatLeftHomologyData.f' = S.moduleCatToCycles

(S : CategoryTheory.ShortComplex (ModuleCat R))


theorem sin_mul_I : sin (x * I) = sinh x * I

Complex.sin (x * Complex.I) = Complex.sinh x * Complex.I


theorem prod_inf_prod : s₁ ×ˢ t₁ ⊓ s₂ ×ˢ t₂ = (s₁ ⊓ s₂) ×ˢ (t₁ ⊓ t₂)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(s₁ s₂ : LowerSet α)
(t₁ t₂ : LowerSet β)


@[deprecated ofNat_eq_natCast (since := "2024-03-24")]
protected lemma natCast_eq_ofNat (n : ℕ) : ↑n = Int.ofNat n


theorem radius_eq_top_iff_summable_norm (p : FormalMultilinearSeries 𝕜 E F) :
    p.radius = ∞ ↔ ∀ r : ℝ≥0, Summable fun n => ‖p n‖ * (r : ℝ) ^ n

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(p : FormalMultilinearSeries 𝕜 E F)

p.radius = ⊤ ↔ ∀ (r : ℝ≥0), Summable fun n => ‖p n‖ * ↑r ^ n


protected theorem seqLeft_eq {α β ε : Type u} {m : Type u → Type v} [Monad m] [LawfulMonad m] (x : ExceptT ε m α) (y : ExceptT ε m β) : x <* y = const β <$> x <*> y

(SeqLeft.seqLeft x fun x => y) = Seq.seq (Function.const β <$> x) fun x => y


/-- `UniqueProd` is preserved under multiplicative equivalences. -/
@[to_additive "`UniqueSums` is preserved under additive equivalences."]
theorem _root_.MulEquiv.uniqueProds_iff (f : G ≃* H) : UniqueProds G ↔ UniqueProds H

{G : Type u}
{H : Type v}
[Mul G]
[Mul H]
(f : G ≃* H)


/-- If two bitvectors have the same `msb`, then signed and unsigned comparisons coincide -/
theorem slt_eq_ult_of_msb_eq {x y : BitVec w} (h : x.msb = y.msb) :
    x.slt y = x.ult y

{w : Nat}
{x y : BitVec w}
(h : x.msb = y.msb)


theorem isCycle_of_prime_order' {σ : Perm α} (h1 : (orderOf σ).Prime)
    (h2 : Fintype.card α < 2 * orderOf σ) : σ.IsCycle

{α : Type u_1}
[Fintype α]
{σ : Equiv.Perm α}
(h1 : Nat.Prime (orderOf σ))
(h2 : Fintype.card α < 2 * orderOf σ)


@[simp]
lemma image_subtype_val_Ioo_Ioi {a b : α} (c : Ioo a b) : Subtype.val '' Ioi c = Ioo c.1 b

{α : Type u_1}
[Preorder α]
{a b : α}
(c : ↑(Set.Ioo a b))

Subtype.val '' Set.Ioi c = Set.Ioo (↑c) b


theorem sup_iInf₂_eq {f : ∀ i, κ i → α} (a : α) : (a ⊔ ⨅ (i) (j), f i j) = ⨅ (i) (j), a ⊔ f i j

{α : Type u}
{ι : Sort w}
{κ : ι → Sort w'}
[Order.Coframe α]
{f : (i : ι) → κ i → α}
(a : α)

a ⊔ ⨅ i, ⨅ j, f i j = ⨅ i, ⨅ j, a ⊔ f i j


@[simp] lemma addContent_empty : m ∅ = 0

{α : Type u_1}
{C : Set (Set α)}
{m : MeasureTheory.AddContent C}


theorem toFilter_inf_iUnion_eq (l : IntegrationParams) (I : Box ι) (π₀ : Prepartition I) :
    l.toFilter I ⊓ 𝓟 { π | π.iUnion = π₀.iUnion } = l.toFilteriUnion I π₀

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

l.toFilter I ⊓ 𝓟 {π | π.iUnion = π₀.iUnion} = l.toFilteriUnion I π₀


lemma cfcₙ_neg_id (ha : p a := by cfc_tac) :
    cfcₙ (- · : R → R) a = -a


@[simp, mfld_simps]
theorem localTriv_symmL {b : B} (hb : b ∈ Z.baseSet i) :
    (Z.localTriv i).symmL R b = Z.coordChange i (Z.indexAt b) b

{R : Type u_1}
{B : Type u_2}
{F : Type u_3}
[NontriviallyNormedField R]
[NormedAddCommGroup F]
[NormedSpace R F]
[TopologicalSpace B]
{ι : Type u_5}
(Z : VectorBundleCore R B F ι)
{i : ι}
{b : B}
(hb : b ∈ Z.baseSet i)

Trivialization.symmL R (Z.localTriv i) b = Z.coordChange i (Z.indexAt b) b


@[to_additive]
theorem union_mul_inter_subset_union : (s₁ ∪ s₂) * (t₁ ∩ t₂) ⊆ s₁ * t₁ ∪ s₂ * t₂

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


/-- In a locally compact space, any function in `ℒp` can be approximated by compactly supported
continuous functions when `0 < p < ∞`, version in terms of `∫`. -/
theorem Memℒp.exists_hasCompactSupport_integral_rpow_sub_le
    [WeaklyLocallyCompactSpace α] [μ.Regular]
    {p : ℝ} (hp : 0 < p) {f : α → E} (hf : Memℒp f (ENNReal.ofReal p) μ) {ε : ℝ} (hε : 0 < ε) :
    ∃ g : α → E,
      HasCompactSupport g ∧
        (∫ x, ‖f x - g x‖ ^ p ∂μ) ≤ ε ∧ Continuous g ∧ Memℒp g (ENNReal.ofReal p) μ

(hf : MeasureTheory.Memℒp f (ENNReal.ofReal p) μ)

∃ g, HasCompactSupport g ∧ ∫ (x : α), ‖f x - g x‖ ^ p ∂μ ≤ ε ∧ Continuous g ∧ MeasureTheory.Memℒp g (ENNReal.ofReal p) μ


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

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


/-- If `m ⊗ n ≅ 𝟙_M`, then `F.obj m` is a left inverse of `F.obj n`. -/
@[simps!]
noncomputable def unitOfTensorIsoUnit (m n : M) (h : m ⊗ n ≅ 𝟙_ M) : F.obj m ⋙ F.obj n ≅ 𝟭 C

(F : CategoryTheory.MonoidalFunctor M (CategoryTheory.Functor C C))

(h : CategoryTheory.MonoidalCategory.tensorObj m n ≅ 𝟙_ M)

(CategoryTheory.unitOfTensorIsoUnit F m n h).hom.app X =
  CategoryTheory.CategoryStruct.comp ((F.μ m n).app X)
    (CategoryTheory.CategoryStruct.comp ((F.map h.hom).app X) (F.εIso.inv.app X))


@[simp]
lemma cyclesMap'_zero (h₁ : S₁.LeftHomologyData) (h₂ : S₂.LeftHomologyData) :
    cyclesMap' 0 h₁ h₂ = 0

CategoryTheory.ShortComplex.cyclesMap' 0 h₁ h₂ = 0


@[simp]
theorem tensorUnit_one : (𝟙_ (Mon_ C)).one = 𝟙 (𝟙_ C)

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


@[simp] lemma range_two_mul_add_one (α : Type*) [Semiring α] :
    Set.range (fun x : α ↦ 2 * x + 1) = {a | Odd a}

(Set.range fun x => 2 * x + 1) = {a | Odd a}


/-- For a simple function, its McShane (or Henstock, or `⊥`) box integral is equal to its
integral in the sense of `MeasureTheory.SimpleFunc.integral`. -/
theorem box_integral_eq_integral (f : SimpleFunc (ι → ℝ) E) (μ : Measure (ι → ℝ))
    [IsLocallyFiniteMeasure μ] (I : Box ι) (l : IntegrationParams) (hl : l.bRiemann = false) :
    BoxIntegral.integral.{u, v, v} I l f μ.toBoxAdditive.toSMul = f.integral (μ.restrict I)

(f : MeasureTheory.SimpleFunc (ι → ℝ) E)

BoxIntegral.integral I l (↑f) μ.toBoxAdditive.toSMul = MeasureTheory.SimpleFunc.integral (μ.restrict ↑I) f


theorem isBigO_norm_restrict_cocompact (f : C(ℝ, E)) {b : ℝ} (hb : 0 < b)
    (hf : f =O[cocompact ℝ] fun x : ℝ => |x| ^ (-b)) (K : Compacts ℝ) :
    (fun x => ‖(f.comp (ContinuousMap.addRight x)).restrict K‖) =O[cocompact ℝ] (|·| ^ (-b))

(hf : ⇑f =O[Filter.cocompact ℝ] fun x => |x| ^ (-b))

(fun x => ‖ContinuousMap.restrict (↑K) (f.comp (ContinuousMap.addRight x))‖) =O[Filter.cocompact ℝ] fun x => |x| ^ (-b)


@[simp]
theorem differentiable_const_add_iff (c : F) :
    (Differentiable 𝕜 fun y => c + f y) ↔ Differentiable 𝕜 f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
(c : F)


@[to_additive]
theorem Left.inv_lt_self (h : 1 < a) : a⁻¹ < a

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


theorem div_le_iff_of_neg (hc : c < 0) : b / c ≤ a ↔ a * c ≤ b

{α : Type u_2}
[LinearOrderedField α]
{a b c : α}
(hc : c < 0)


theorem eq_of_isEqv [DecidableEq α] (a b : Array α) : Array.isEqv a b (fun x y => x = y) → a = b

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

(a.isEqv b fun x y => decide (x = y)) = true → a = b


@[mono]
theorem prod_mono ⦃s₁ s₂ : Subsemiring R⦄ (hs : s₁ ≤ s₂) ⦃t₁ t₂ : Subsemiring S⦄ (ht : t₁ ≤ t₂) :
    s₁.prod t₁ ≤ s₂.prod t₂

{R : Type u}
{S : Type v}
[NonAssocSemiring R]
[NonAssocSemiring S]
⦃s₁ s₂ : Subsemiring R⦄
(hs : s₁ ≤ s₂)
⦃t₁ t₂ : Subsemiring S⦄
(ht : t₁ ≤ t₂)


/-- A functor `F : C ⥤ D` is essentially surjective if every object of `D` is in the essential
image of `F`. In other words, for every `Y : D`, there is some `X : C` with `F.obj X ≅ Y`.

See <https://stacks.math.columbia.edu/tag/001C>.
-/
class EssSurj (F : C ⥤ D) : Prop where
  /-- All the objects of the target category are in the essential image. -/
  mem_essImage (Y : D) : Y ∈ F.essImage

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


@[simp] theorem replicate_right_inj {a b : α} {n : ℕ} (h : n ≠ 0) :
    replicate n a = replicate n b ↔ a = b

Multiset.replicate n a = Multiset.replicate n b ↔ a = b


theorem blockDiag'_map (M : Matrix (Σi, m' i) (Σi, n' i) α) (f : α → β) :
    blockDiag' (M.map f) = fun k => (blockDiag' M k).map f

(M : Matrix ((i : o) × m' i) ((i : o) × n' i) α)

(M.map f).blockDiag' = fun k => (M.blockDiag' k).map f


@[simp]
theorem top_eq_univ : (⊤ : Finset α) = univ


@[simp] theorem count_erase_of_ne (ab : a ≠ b) (l : List α) : count a (l.erase b) = count a l

{α : Type u_1}
[DecidableEq α]
{a b : α}
(ab : a ≠ b)
(l : List α)

List.count a (l.erase b) = List.count a l


@[simp]
theorem differentiable_add_const_iff (c : F) :
    (Differentiable 𝕜 fun y => f y + c) ↔ Differentiable 𝕜 f


/-- The triangles consisting of a morphism in `H` and the maps from `inf O H` commute.
-/
theorem infTo_commutes {X Y : C} (mX : X ∈ O) (mY : Y ∈ O) {f : X ⟶ Y}
    (mf : (⟨X, Y, mX, mY, f⟩ : Σ' (X Y : C) (_ : X ∈ O) (_ : Y ∈ O), X ⟶ Y) ∈ H) :
    infTo O H mX ≫ f = infTo O H mY

CategoryTheory.CategoryStruct.comp (CategoryTheory.IsCofiltered.infTo O H mX) f =
  CategoryTheory.IsCofiltered.infTo O H mY


@[simp]
theorem top_sub_bot : (⊤ : EReal) - ⊥ = ⊤


theorem coe_mul (g₁ g₂ : α →₀ β) : ⇑(g₁ * g₂) = g₁ * g₂

{α : Type u₁}
{β : Type u₂}
[MulZeroClass β]
(g₁ g₂ : α →₀ β)


theorem left_div_gcd_ne_zero {p q : R} (hp : p ≠ 0) : p / GCDMonoid.gcd p q ≠ 0

{R : Type u_1}
[EuclideanDomain R]
[GCDMonoid R]
{p q : R}
(hp : p ≠ 0)


lemma num_div_den (r : ℚ) : (r.num : ℚ) / (r.den : ℚ) = r


theorem erase_attach_map_val (s : Multiset α) (x : {x // x ∈ s}) :
    (s.attach.erase x).map (↑) = s.erase x

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

Multiset.map Subtype.val (s.attach.erase x) = s.erase ↑x


theorem Tendsto.prod_mk {h : Filter γ} {m₁ : α → β} {m₂ : α → γ}
    (h₁ : Tendsto m₁ f g) (h₂ : Tendsto m₂ f h) : Tendsto (fun x => (m₁ x, m₂ x)) f (g ×ˢ h)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : Filter α}
{g : Filter β}
{h : Filter γ}
{m₁ : α → β}
{m₂ : α → γ}
(h₁ : Filter.Tendsto m₁ f g)
(h₂ : Filter.Tendsto m₂ f h)

Filter.Tendsto (fun x => (m₁ x, m₂ x)) f (g ×ˢ h)


theorem ContinuousLinearMap.opNorm_bound_of_ball_bound {r : ℝ} (r_pos : 0 < r) (c : ℝ)
    (f : E →L[𝕜] 𝕜) (h : ∀ z ∈ closedBall (0 : E) r, ‖f z‖ ≤ c) : ‖f‖ ≤ c / r

(h : ∀ z ∈ Metric.closedBall 0 r, ‖f z‖ ≤ c)


protected theorem groupSMul {α} [Group α] [DistribMulAction α R] [SMulCommClass R α R] (a : α)
    {B : BilinForm R M} (hB : B.IsRefl) : (a • B).IsRefl

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{α : Type u_9}
[Group α]
[DistribMulAction α R]
[SMulCommClass R α R]
(a : α)
{B : LinearMap.BilinForm R M}
(hB : B.IsRefl)


@[simp]
lemma image_subtype_val_Ioo {s : Set α} [OrdConnected s] (x y : s) :
    Subtype.val '' Ioo x y = Ioo x.1 y

{α : Type u_1}
[Preorder α]
{s : Set α}
[s.OrdConnected]
(x y : ↑s)

Subtype.val '' Set.Ioo x y = Set.Ioo ↑x ↑y


theorem nnnorm_eq_zero_iff {f : Lp E p μ} (hp : 0 < p) : ‖f‖₊ = 0 ↔ f = 0

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{f : ↥(MeasureTheory.Lp E p μ)}
(hp : 0 < p)


/-- The set of compact operators from a normed space to a complete topological vector space is
closed. -/
theorem isClosed_setOf_isCompactOperator {𝕜₁ 𝕜₂ : Type*} [NontriviallyNormedField 𝕜₁]
    [NormedField 𝕜₂] {σ₁₂ : 𝕜₁ →+* 𝕜₂} {M₁ M₂ : Type*} [SeminormedAddCommGroup M₁]
    [AddCommGroup M₂] [NormedSpace 𝕜₁ M₁] [Module 𝕜₂ M₂] [UniformSpace M₂] [UniformAddGroup M₂]
    [ContinuousConstSMul 𝕜₂ M₂] [T2Space M₂] [CompleteSpace M₂] :
    IsClosed { f : M₁ →SL[σ₁₂] M₂ | IsCompactOperator f }

{𝕜₁ : Type u_1}
{𝕜₂ : Type u_2}
[NontriviallyNormedField 𝕜₁]
[NormedField 𝕜₂]
{σ₁₂ : 𝕜₁ →+* 𝕜₂}
{M₁ : Type u_3}
{M₂ : Type u_4}
[SeminormedAddCommGroup M₁]
[AddCommGroup M₂]
[NormedSpace 𝕜₁ M₁]
[Module 𝕜₂ M₂]
[UniformSpace M₂]
[UniformAddGroup M₂]
[ContinuousConstSMul 𝕜₂ M₂]
[T2Space M₂]
[CompleteSpace M₂]


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


/-- A map `f : E × F → G` satisfies `IsBoundedBilinearMap 𝕜 f` if it is bilinear and
continuous. -/
structure IsBoundedBilinearMap (f : E × F → G) : Prop where
  add_left : ∀ (x₁ x₂ : E) (y : F), f (x₁ + x₂, y) = f (x₁, y) + f (x₂, y)
  smul_left : ∀ (c : 𝕜) (x : E) (y : F), f (c • x, y) = c • f (x, y)
  add_right : ∀ (x : E) (y₁ y₂ : F), f (x, y₁ + y₂) = f (x, y₁) + f (x, y₂)
  smul_right : ∀ (c : 𝕜) (x : E) (y : F), f (x, c • y) = c • f (x, y)
  bound : ∃ C > 0, ∀ (x : E) (y : F), ‖f (x, y)‖ ≤ C * ‖x‖ * ‖y‖

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type u_4}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{f : E × F → G}
(self : IsBoundedBilinearMap 𝕜 f)


/-- The projection from a trivial fiber bundle to its base is surjective. -/
protected theorem surjective_proj [Nonempty F] (h : IsHomeomorphicTrivialFiberBundle F proj) :
    Function.Surjective proj


@[simp]
theorem coe_quotQuotEquivCommₐ : ⇑(quotQuotEquivCommₐ R I J) = ⇑(quotQuotEquivComm I J)

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

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


theorem algEquiv_mk' (x : R) (y : M) : algEquiv M S Q (mk' S x y) = mk' Q x y

{R : Type u_1}
[CommSemiring R]
{M : Submonoid R}
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
{Q : Type u_4}
[CommSemiring Q]
[Algebra R Q]
[IsLocalization M Q]
(x : R)
(y : ↥M)

(IsLocalization.algEquiv M S Q) (IsLocalization.mk' S x y) = IsLocalization.mk' Q x y


@[simp]
theorem binary_fan_snd_toCone (c : BinaryBicone P Q) : BinaryFan.snd c.toCone = c.snd

(c : CategoryTheory.Limits.BinaryBicone P Q)

CategoryTheory.Limits.BinaryFan.snd c.toCone = c.snd


@[simp]
theorem mk_cancel_common_right (s s' : S) (m : M) : mk (s' • m) (s * s') = mk m s

{R : Type u}
[CommSemiring R]
{S : Submonoid R}
{M : Type v}
[AddCommMonoid M]
[Module R M]
(s s' : ↥S)
(m : M)

LocalizedModule.mk (s' • m) (s * s') = LocalizedModule.mk m s


@[simp]
lemma zpowersMulHom_symm_apply (f : Multiplicative ℤ →* α) :
    (zpowersMulHom α).symm f = f (ofAdd 1)

{α : Type u_3}
[CommGroup α]
(f : Multiplicative ℤ →* α)

(zpowersMulHom α).symm f = f (Multiplicative.ofAdd 1)


theorem replicate_right_injective {n : ℕ} (hn : n ≠ 0) : Injective (@replicate α n)


theorem tendsto_atBot_of_add_const_right (C : β) (hf : Tendsto (fun x => f x + C) l atBot) :
    Tendsto f l atBot

(hf : Filter.Tendsto (fun x => f x + C) l Filter.atBot)


theorem aecover_Ioo [NoMinOrder α] [NoMaxOrder α] : AECover μ l fun i => Ioo (a i) (b i)

{α : Type u_1}
{ι : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{l : Filter ι}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
[OpensMeasurableSpace α]
{a b : ι → α}
(ha : Filter.Tendsto a l Filter.atBot)
(hb : Filter.Tendsto b l Filter.atTop)
[NoMinOrder α]
[NoMaxOrder α]

MeasureTheory.AECover μ l fun i => Set.Ioo (a i) (b i)


@[simp]
-- Porting note: had to add an extra coercion arrow on the right hand side.
theorem coe_quotQuotEquivQuotOfLEₐ (h : I ≤ J) :
    ⇑(quotQuotEquivQuotOfLEₐ R h) = ⇑(quotQuotEquivQuotOfLE h)

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

⇑(DoubleQuot.quotQuotEquivQuotOfLEₐ R h) = ⇑(DoubleQuot.quotQuotEquivQuotOfLE h)


theorem degree_add_eq_right_of_degree_lt (h : degree p < degree q) : degree (p + q) = degree q

{R : Type u}
[Semiring R]
{p q : R[X]}
(h : p.degree < q.degree)


@[to_additive]
theorem index_map_dvd {f : G →* G'} (hf : Function.Surjective f) :
    (H.map f).index ∣ H.index

{G : Type u_1}
{G' : Type u_2}
[AddGroup G]
[AddGroup G']
(H : AddSubgroup G)
{f : G →+ G'}
(hf : Function.Surjective ⇑f)


@[to_additive (attr := simp)]
theorem coprodAssoc_symm_apply_inr_inl (x : N) :
    (coprodAssoc M N P).symm (inr (inl x)) = inl (inr x)

{M : Type u_1}
{N : Type u_2}
{P : Type u_3}
[Monoid M]
[Monoid N]
[Monoid P]
(x : N)

(Monoid.MulEquiv.coprodAssoc M N P).symm (Monoid.Coprod.inr (Monoid.Coprod.inl x)) =
  Monoid.Coprod.inl (Monoid.Coprod.inr x)


/-- A `Partition` of a simple graph `G` is a structure constituted by
* `parts`: a set of subsets of the vertices `V` of `G`
* `isPartition`: a proof that `parts` is a proper partition of `V`
* `independent`: a proof that each element of `parts` doesn't have a pair of adjacent vertices
-/
structure Partition where
  /-- `parts`: a set of subsets of the vertices `V` of `G`. -/
  parts : Set (Set V)
  /-- `isPartition`: a proof that `parts` is a proper partition of `V`. -/
  isPartition : Setoid.IsPartition parts
  /-- `independent`: a proof that each element of `parts` doesn't have a pair of adjacent vertices.
-/
  independent : ∀ s ∈ parts, IsAntichain G.Adj s

{V : Type u}
{G : SimpleGraph V}
(self : G.Partition)
(s : Set V)


/-- The image under a ring homomorphism of the subsemiring generated by a set equals
the subsemiring generated by the image of the set. -/
theorem map_sclosure (f : F) (s : Set R) : (closure s).map f = closure ((f : R → S) '' s)

{R : Type u}
{S : Type v}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
{F : Type u_1}
[FunLike F R S]
[NonUnitalRingHomClass F R S]
(f : F)
(s : Set R)

NonUnitalSubsemiring.map f (NonUnitalSubsemiring.closure s) = NonUnitalSubsemiring.closure (⇑f '' s)


@[to_additive]
theorem coeFn_one [One β] : ⇑(1 : α →ₘ[μ] β) =ᵐ[μ] 1

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[TopologicalSpace β]
[One β]


theorem induction_on_adjoin [IsNoetherian R A] (P : Subalgebra R A → Prop) (base : P ⊥)
    (ih : ∀ (S : Subalgebra R A) (x : A), P S → P (Algebra.adjoin R (insert x S)))
    (S : Subalgebra R A) : P S

(ih : ∀ (S : Subalgebra R A) (x : A), P S → P (Algebra.adjoin R (insert x ↑S)))


/-- If `U` is qcqs, then `Γ(X, D(f)) ≃ Γ(X, U)_f` for every `f : Γ(X, U)`.
This is known as the **Qcqs lemma** in [R. Vakil, *The rising sea*][RisingSea]. -/
theorem is_localization_basicOpen_of_qcqs {X : Scheme} {U : X.Opens} (hU : IsCompact U.1)
    (hU' : IsQuasiSeparated U.1) (f : Γ(X, U)) :
    IsLocalization.Away f (Γ(X, X.basicOpen f))

{X : AlgebraicGeometry.Scheme}
{U : X.Opens}
(hU : IsCompact U.carrier)
(hU' : IsQuasiSeparated U.carrier)
(f : ↑Γ(X, U))

IsLocalization.Away f ↑Γ(X, X.basicOpen f)


theorem IsLUB.mono (ha : IsLUB s a) (hb : IsLUB t b) (hst : s ⊆ t) : a ≤ b

{α : Type u}
[Preorder α]
{s t : Set α}
{a b : α}
(ha : IsLUB s a)
(hb : IsLUB t b)
(hst : s ⊆ t)


@[simp]
theorem toCocone_pt (B : Bicone F) : B.toCocone.pt = B.pt


theorem card_le_card {o₁ o₂ : Ordinal} : o₁ ≤ o₂ → card o₁ ≤ card o₂


@[simp]
theorem plusMap_plusLift {P Q R : Cᵒᵖ ⥤ D} (η : P ⟶ Q) (γ : Q ⟶ R) (hR : Presheaf.IsSheaf J R) :
    J.plusMap η ≫ J.plusLift γ hR = J.plusLift (η ≫ γ) hR

(J : CategoryTheory.GrothendieckTopology C)

[CategoryTheory.Category.{max v u, w} D]

[∀ (P : CategoryTheory.Functor Cᵒᵖ D) (X : C) (S : J.Cover X), CategoryTheory.Limits.HasMultiequalizer (S.index P)]

[∀ (X : C), CategoryTheory.Limits.HasColimitsOfShape (J.Cover X)ᵒᵖ D]

(hR : CategoryTheory.Presheaf.IsSheaf J R)

CategoryTheory.CategoryStruct.comp (J.plusMap η) (J.plusLift γ hR) =
  J.plusLift (CategoryTheory.CategoryStruct.comp η γ) hR


{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{v : PicardLindelof E}
(f : v.FunSpace)


/-- The point of the augmentation. -/
@[simps!]
def point : Augmented C ⥤ C

(X : CategoryTheory.Comma (𝟭 (CategoryTheory.SimplicialObject C)) (CategoryTheory.SimplicialObject.const C))

CategoryTheory.SimplicialObject.Augmented.point.obj X = X.right


/-- A homeomorphism of spaces gives an equivalence of categories of open sets.

TODO: define `OrderIso.equivalence`, use it.
-/
@[simps]
def mapMapIso {X Y : TopCat.{u}} (H : X ≅ Y) : Opens Y ≌ Opens X

(TopologicalSpace.Opens.mapMapIso H).unitIso = CategoryTheory.NatIso.ofComponents (fun U => CategoryTheory.eqToIso ⋯) ⋯


lemma guitartExact_iff_isConnected_downwards :
    w.GuitartExact ↔ ∀ {X₂ : C₂} {X₃ : C₃} (g : R.obj X₂ ⟶ B.obj X₃),
      IsConnected (w.CostructuredArrowDownwards g)

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

w.GuitartExact ↔
  ∀ {X₂ : C₂} {X₃ : C₃} (g : R.obj X₂ ⟶ B.obj X₃), CategoryTheory.IsConnected (w.CostructuredArrowDownwards g)


@[to_additive (attr := simp)]
theorem inv_mk : (mk L)⁻¹ = mk (invRev L)

(FreeGroup.mk L)⁻¹ = FreeGroup.mk (FreeGroup.invRev L)


/-- The pigeonhole principle for finitely many pigeons and pigeonholes.
This is the `Fintype` version of `Finset.exists_ne_map_eq_of_card_lt_of_maps_to`.
-/
theorem exists_ne_map_eq_of_card_lt (f : α → β) (h : Fintype.card β < Fintype.card α) :
    ∃ x y, x ≠ y ∧ f x = f y

{α : Type u_1}
{β : Type u_2}
[Fintype α]
[Fintype β]
(f : α → β)
(h : Fintype.card β < Fintype.card α)


/-- Restriction of a vector measure onto a sub-σ-algebra. -/
@[simps]
def trim {m n : MeasurableSpace α} (v : VectorMeasure α M) (hle : m ≤ n) :
    @VectorMeasure α m M _ _

{α : Type u_1}
{M : Type u_4}
[AddCommMonoid M]
[TopologicalSpace M]
{m n : MeasurableSpace α}
(v : MeasureTheory.VectorMeasure α M)
(hle : m ≤ n)
(i : Set α)

↑(v.trim hle) i = if MeasurableSet i then ↑v i else 0


@[simp]
theorem coe_toSubmodule (S : NonUnitalSubalgebra R A) : (↑S.toSubmodule : Set A) = S

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
(S : NonUnitalSubalgebra R A)


/-- `limsup (xᵢ + c) = (limsup xᵢ) + c`. -/
lemma limsup_add_const (F : Filter ι) [NeBot F] [Add R] [ContinuousAdd R]
    [CovariantClass R R (Function.swap fun x y ↦ x + y) fun x y ↦ x ≤ y] (f : ι → R) (c : R)
    (bdd_above : F.IsBoundedUnder (· ≤ ·) f) (cobdd : F.IsCoboundedUnder (· ≤ ·) f) :
    Filter.limsup (fun i ↦ f i + c) F = Filter.limsup f F + c

[CovariantClass R R (Function.swap fun x y => x + y) fun x y => x ≤ y]

(bdd_above : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) F f)

(cobdd : Filter.IsCoboundedUnder (fun x x_1 => x ≤ x_1) F f)

Filter.limsup (fun i => f i + c) F = Filter.limsup f F + c


theorem Disjoint.frontier_right (hs : IsOpen s) (hd : Disjoint s t) : Disjoint s (frontier t)

{X : Type u}
{s t : Set X}
[TopologicalSpace X]
(hs : IsOpen s)
(hd : Disjoint s t)


theorem iSup_lt_succ (u : ℕ → α) (n : ℕ) : ⨆ k < n + 1, u k = (⨆ k < n, u k) ⊔ u n

{α : Type u_1}
[CompleteLattice α]
(u : ℕ → α)
(n : ℕ)


@[simp]
theorem toEmbedding_toHom (f : M ↪ₑ[L] N) : f.toEmbedding.toHom = f.toHom

{L : FirstOrder.Language}
{M : Type u_1}
{N : Type u_2}
[L.Structure M]
[L.Structure N]
(f : M ↪ₑ[L] N)


protected theorem sum_mul [Fintype m] (s : Finset β) (f : β → Matrix l m α) (M : Matrix m n α) :
    (∑ a ∈ s, f a) * M = ∑ a ∈ s, f a * M

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{α : Type v}
{β : Type w}
[NonUnitalNonAssocSemiring α]
[Fintype m]
(s : Finset β)
(f : β → Matrix l m α)
(M : Matrix m n α)


/-- For a nonzero `k = r/s ∈ K`, the fractional ideal `(k)` is equal to the product
`∏_v v^(val_v(r) - val_v(s))`. -/
theorem finprod_heightOneSpectrum_factorization_principal {I : FractionalIdeal R⁰ K} (hI : I ≠ 0)
    (k : K) (hk : I = spanSingleton R⁰ k) :
    ∏ᶠ v : HeightOneSpectrum R, (v.asIdeal : FractionalIdeal R⁰ K) ^
      ((Associates.mk v.asIdeal).count (Associates.mk (Ideal.span {choose
          (mk'_surjective R⁰ k)} : Ideal R)).factors -
        (Associates.mk v.asIdeal).count (Associates.mk ((Ideal.span {(↑(choose
          (choose_spec (mk'_surjective R⁰ k)) : ↥R⁰) : R)}) : Ideal R)).factors : ℤ) = I

(hk : I = FractionalIdeal.spanSingleton R⁰ k)

∏ᶠ (v : IsDedekindDomain.HeightOneSpectrum R),
    ↑v.asIdeal ^
      (↑((Associates.mk v.asIdeal).count (Associates.mk (Ideal.span {Classical.choose ⋯})).factors) -
        ↑((Associates.mk v.asIdeal).count (Associates.mk (Ideal.span {↑(Classical.choose ⋯)})).factors)) =
  I


lemma rpow_p_mul_one_add_smoothingFn_ge :
    ∀ᶠ (n : ℕ) in atTop, ∀ i, (b i) ^ (p a b) * n ^ (p a b) * (1 + ε n)
      ≤ (r i n) ^ (p a b) * (1 + ε (r i n))

{α : Type u_1}
[Fintype α]
[Nonempty α]
{T : ℕ → ℝ}
{g : ℝ → ℝ}
{a b : α → ℝ}
{r : α → ℕ → ℕ}
(R : AkraBazziRecurrence T g a b r)

∀ᶠ (n : ℕ) in Filter.atTop,
  ∀ (i : α),
    b i ^ AkraBazziRecurrence.p a b * ↑n ^ AkraBazziRecurrence.p a b * (1 + AkraBazziRecurrence.smoothingFn ↑n) ≤
      ↑(r i n) ^ AkraBazziRecurrence.p a b * (1 + AkraBazziRecurrence.smoothingFn ↑(r i n))


@[simp] lemma zero_prod : (0 : FiniteMeasure α).prod ν = 0

{α : Type u_1}
[MeasurableSpace α]
{β : Type u_2}
[MeasurableSpace β]
(ν : MeasureTheory.FiniteMeasure β)

MeasureTheory.FiniteMeasure.prod 0 ν = 0


/-- Given `F : SingleFunctors C D A`, and a functor `G : D ⥤ E` which commutes
with the shift by `A`, this is the "composition" of `F` and `G` in `SingleFunctors C E A`. -/
@[simps! functor shiftIso_hom_app shiftIso_inv_app]
def postcomp (G : D ⥤ E) [G.CommShift A] :
    SingleFunctors C E A

(F : CategoryTheory.SingleFunctors C D A)

((F.postcomp G).shiftIso n a a' ha').inv.app X =
  G.map ((F.shiftIso n a a' ha').inv.app X) ≫ (G.commShiftIso n).hom.app ((F.functor a').obj X)


theorem injective_pi_map {F : ∀ i, f i → g i} (hF : ∀ i, Injective (F i)) :
    Injective fun x : ∀ i, f i => fun i => F i (x i)

(hF : ∀ (i : I), Function.Injective (F i))


theorem finRotate_of_lt {k : ℕ} (h : k < n) :
    finRotate (n + 1) ⟨k, h.trans_le n.le_succ⟩ = ⟨k + 1, Nat.succ_lt_succ h⟩


@[to_additive]
theorem range_subset_insert_image_mulSupport (f : α → M) :
    range f ⊆ insert 1 (f '' mulSupport f)

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

Set.range f ⊆ insert 0 (f '' Function.support f)


theorem turnBound_ne_zero_of_right_move {s t : S} (m : t ∈ r s) : turnBound s ≠ 0

{S : Type u}
[SetTheory.PGame.State S]
{s t : S}
(m : t ∈ SetTheory.PGame.State.r s)


@[to_additive]
theorem Pi.mulHom_injective {γ : Type w} [Nonempty I] [∀ i, Mul (f i)] [Mul γ] (g : ∀ i, γ →ₙ* f i)
    (hg : ∀ i, Function.Injective (g i)) : Function.Injective (Pi.mulHom g)

(hg : ∀ (i : I), Function.Injective ⇑(g i))


@[simp]
theorem Ici_diff_Ici : Ici a \ Ici b = Ico a b

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


@[to_additive StrictMono.const_nsmul]
theorem StrictMono.pow_const (hf : StrictMono f) : ∀ {n : ℕ}, n ≠ 0 → StrictMono (f · ^ n)

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

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


@[simp]
theorem valuation_p : valuation (p : ℚ_[p]) = 1


@[simp]
theorem comp_assoc (h : PseudoEpimorphism γ δ) (g : PseudoEpimorphism β γ)
    (f : PseudoEpimorphism α β) : (h.comp g).comp f = h.comp (g.comp f)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
{δ : Type u_5}
[Preorder α]
[Preorder β]
[Preorder γ]
[Preorder δ]
(h : PseudoEpimorphism γ δ)
(g : PseudoEpimorphism β γ)
(f : PseudoEpimorphism α β)


theorem xn_modEq_x2n_sub {n j} (h : j ≤ 2 * n) : xn a1 (2 * n - j) + xn a1 j ≡ 0 [MOD xn a1 n]

Pell.xn a1 (2 * n - j) + Pell.xn a1 j ≡ 0 [MOD Pell.xn a1 n]


@[simp]
theorem sub_smul_slope (f : k → PE) (a b : k) : (b - a) • slope f a b = f b -ᵥ f a

{k : Type u_1}
{E : Type u_2}
{PE : Type u_3}
[Field k]
[AddCommGroup E]
[Module k E]
[AddTorsor E PE]
(f : k → PE)
(a b : k)


@[simp]
theorem rTensorBot_tmul_one (a : A) : A.rTensorBot (a ⊗ₜ[R] 1) = a

{R : Type u}
{S : Type v}
[CommSemiring R]
[Semiring S]
[Algebra R S]
{A : Subalgebra R S}
(a : ↥A)


@[simp]
theorem lie_apply {α : Type*} (f g : α → A) (a : α) : ⁅f, g⁆ a = ⁅f a, g a⁆

{A : Type v}
[Ring A]
{α : Type u_1}
(f g : α → A)
(a : α)


/-- The `toList` of a `Vector` after a `scanl` is the `List.scanl`
of the `toList` of the original `Vector`.
-/
@[simp]
theorem toList_scanl : (scanl f b v).toList = List.scanl f b v.toList

{n : ℕ}
{α : Type u_1}
{β : Type u_2}
(f : β → α → β)
(b : β)
(v : Mathlib.Vector α n)

(Mathlib.Vector.scanl f b v).toList = List.scanl f b v.toList


/-- `Part.bind` as a monotone function -/
@[simps]
def partBind (f : α →o Part β) (g : α →o β → Part γ) : α →o Part γ

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Preorder α]
(f : α →o Part β)
(g : α →o β → Part γ)
(x : α)


theorem gfp_gfp (h : α →o α →o α) : gfp (gfp.comp h) = gfp h.onDiag

{α : Type u}
[CompleteLattice α]
(h : α →o α →o α)

OrderHom.gfp (OrderHom.gfp.comp h) = OrderHom.gfp h.onDiag


/-- A language homomorphism is an expansion on a structure if it commutes with the interpretation of
all symbols on that structure. -/
class IsExpansionOn (M : Type*) [L.Structure M] [L'.Structure M] : Prop where
  map_onFunction : ∀ {n} (f : L.Functions n) (x : Fin n → M), funMap (ϕ.onFunction f) x = funMap f x
  map_onRelation : ∀ {n} (R : L.Relations n) (x : Fin n → M),
    RelMap (ϕ.onRelation R) x = RelMap R x

{L : FirstOrder.Language}
{L' : FirstOrder.Language}
{ϕ : L →ᴸ L'}
{M : Type u_1}
[L.Structure M]
[L'.Structure M]
[self : ϕ.IsExpansionOn M]
{n : ℕ}
(R : L.Relations n)
(x : Fin n → M)

FirstOrder.Language.Structure.RelMap (ϕ.onRelation R) x = FirstOrder.Language.Structure.RelMap R x


@[to_additive (attr := continuity) continuous_norm]
theorem continuous_norm' : Continuous fun a : E => ‖a‖


/-- Construct an augmented simplicial object from an augmented cosimplicial
object in the opposite category. -/
@[simps!]
def CosimplicialObject.Augmented.leftOp (X : CosimplicialObject.Augmented Cᵒᵖ) :
    SimplicialObject.Augmented C

(X : CategoryTheory.CosimplicialObject.Augmented Cᵒᵖ)

∀ (X_1 : SimplexCategoryᵒᵖ), X.leftOp.hom.app X_1 = (X.hom.app (Opposite.unop X_1)).unop


@[to_additive (attr := simp)]
theorem mem_unop {x : M} {S : Submonoid Mᵐᵒᵖ} : x ∈ S.unop ↔ MulOpposite.op x ∈ S

{M : Type u_2}
[MulOneClass M]
{x : M}
{S : Submonoid Mᵐᵒᵖ}


/-- Composing an alternating map with the same linear equiv on each argument gives the zero map
if and only if the alternating map is the zero map. -/
@[simp]
theorem compLinearEquiv_eq_zero_iff (f : M [⋀^ι]→ₗ[R] N) (g : M₂ ≃ₗ[R] M) :
    f.compLinearMap (g : M₂ →ₗ[R] M) = 0 ↔ f = 0

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N : Type u_3}
[AddCommMonoid N]
[Module R N]
{ι : Type u_7}
{M₂ : Type u_10}
[AddCommMonoid M₂]
[Module R M₂]
(f : M [⋀^ι]→ₗ[R] N)
(g : M₂ ≃ₗ[R] M)


theorem of_lift {α β} [inst : CSLift α β] {a b : α} {a' b' : β}
    [h1 : CSLiftVal a a'] [h2 : CSLiftVal b b'] (h : a' = b') : a = b

[h1 : Mathlib.Tactic.Ring.CSLiftVal a a']

[h2 : Mathlib.Tactic.Ring.CSLiftVal b b']


@[simp, norm_cast] lemma abs_intCast (n : ℤ) : abs n = |↑n|


theorem ae_nonneg_of_forall_setIntegral_nonneg (hf : Integrable f μ)
    (hf_zero : ∀ s, MeasurableSet s → μ s < ∞ → 0 ≤ ∫ x in s, f x ∂μ) : 0 ≤ᵐ[μ] f

(hf_zero : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → 0 ≤ ∫ (x : α) in s, f x ∂μ)


theorem Prefunctor.pathStar_bijective (hφ : ∀ u, Bijective (φ.star u)) (u : U) :
    Bijective (φ.pathStar u)

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


theorem get?_terminates_le {s : WSeq α} {m n} (h : m ≤ n) :
    Terminates (get? s n) → Terminates (get? s m)

{α : Type u}
{s : Stream'.WSeq α}
{m n : ℕ}
(h : m ≤ n)

(s.get? n).Terminates → (s.get? m).Terminates


@[simp]
theorem constantCoeff_invOfUnit (φ : R⟦X⟧) (u : Rˣ) :
    constantCoeff R (invOfUnit φ u) = ↑u⁻¹

{R : Type u_1}
[Ring R]
(φ : PowerSeries R)
(u : Rˣ)

(PowerSeries.constantCoeff R) (φ.invOfUnit u) = ↑u⁻¹


protected theorem map_add : X (f + f') = X f + X f'

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[Monoid G]
[SmoothMul I G]
(X : LeftInvariantDerivation I G)
(f : C^⊤⟮I, G; 𝓘(𝕜, 𝕜), 𝕜⟯)
{f' : C^⊤⟮I, G; 𝓘(𝕜, 𝕜), 𝕜⟯}


/-- GCD monoid: a `CancelCommMonoidWithZero` with `gcd` (greatest common divisor) and
`lcm` (least common multiple) operations, determined up to a unit. The type class focuses on `gcd`
and we derive the corresponding `lcm` facts from `gcd`.
-/
class GCDMonoid (α : Type*) [CancelCommMonoidWithZero α] where
  /-- The greatest common divisor between two elements. -/
  gcd : α → α → α
  /-- The least common multiple between two elements. -/
  lcm : α → α → α
  /-- The GCD is a divisor of the first element. -/
  gcd_dvd_left : ∀ a b, gcd a b ∣ a
  /-- The GCD is a divisor of the second element. -/
  gcd_dvd_right : ∀ a b, gcd a b ∣ b
  /-- Any common divisor of both elements is a divisor of the GCD. -/
  dvd_gcd : ∀ {a b c}, a ∣ c → a ∣ b → a ∣ gcd c b
  /-- The product of two elements is `Associated` with the product of their GCD and LCM. -/
  gcd_mul_lcm : ∀ a b, Associated (gcd a b * lcm a b) (a * b)
  /-- `0` is left-absorbing. -/
  lcm_zero_left : ∀ a, lcm 0 a = 0
  /-- `0` is right-absorbing. -/
  lcm_zero_right : ∀ a, lcm a 0 = 0

{α : Type u_2}
[CancelCommMonoidWithZero α]
[self : GCDMonoid α]
{a b c : α}


/-- This structure contains the information left for a local trivialization (which is implemented
below as `Trivialization F proj`) if the total space has not been given a topology, but we
have a topology on both the fiber and the base space. Through the construction
`topological_fiber_prebundle F proj` it will be possible to promote a
`Pretrivialization F proj` to a `Trivialization F proj`. -/
structure Pretrivialization (proj : Z → B) extends PartialEquiv Z (B × F) where
  open_target : IsOpen target
  baseSet : Set B
  open_baseSet : IsOpen baseSet
  source_eq : source = proj ⁻¹' baseSet
  target_eq : target = baseSet ×ˢ univ
  proj_toFun : ∀ p ∈ source, (toFun p).1 = proj p

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
{proj : Z → B}
(self : Pretrivialization F proj)


theorem localInverse_tendsto (hf : HasStrictFDerivAt f (f' : E →L[𝕜] F) a) :
    Tendsto (hf.localInverse f f' a) (𝓝 <| f a) (𝓝 a)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace E]
{f : E → F}
{f' : E ≃L[𝕜] F}
{a : E}
(hf : HasStrictFDerivAt f (↑f') a)

Filter.Tendsto (HasStrictFDerivAt.localInverse f f' a hf) (𝓝 (f a)) (𝓝 a)


@[to_additive]
theorem even_mul_odd {f : ℕ → M} (he : HasProd (fun k ↦ f (2 * k)) m)
    (ho : HasProd (fun k ↦ f (2 * k + 1)) m') : HasProd f (m * m')

(ho : HasProd (fun k => f (2 * k + 1)) m')


/-- Taking the product of two maps with the same domain is equivalent to taking the product of
their codomains. -/
@[simps]
def prodEquiv : (A →ₐ[R] B) × (A →ₐ[R] C) ≃ (A →ₐ[R] B × C)

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
[Semiring C]
[Algebra R C]
(f : A →ₐ[R] B × C)

AlgHom.prodEquiv.symm f = ((AlgHom.fst R B C).comp f, (AlgHom.snd R B C).comp f)


@[simp]
theorem append_last {i j k l} {w₁ : NeWord M i j} {hne : j ≠ k} {w₂ : NeWord M k l} :
    (append w₁ hne w₂).last = w₂.last

{ι : Type u_1}
{M : ι → Type u_2}
[(i : ι) → Monoid (M i)]
{i j k l : ι}
{w₁ : Monoid.CoprodI.NeWord M i j}
{hne : j ≠ k}
{w₂ : Monoid.CoprodI.NeWord M k l}


@[to_additive]
lemma mul_subset_range {s t : Set β} (hs : s ⊆ range m) (ht : t ⊆ range m) : s * t ⊆ range m

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[Mul α]
[Mul β]
[FunLike F α β]
[MulHomClass F α β]
(m : F)
{s t : Set β}
(hs : s ⊆ Set.range ⇑m)
(ht : t ⊆ Set.range ⇑m)


/-- Each element of the monoid defines an additive monoid homomorphism. -/
@[simps!]
def DistribMulAction.toAddMonoidHom (x : M) : A →+ A

{M : Type u_1}
(A : Type u_4)
[Monoid M]
[AddMonoid A]
[DistribMulAction M A]
(x : M)

∀ (x_1 : A), (DistribMulAction.toAddMonoidHom A x) x_1 = x • x_1


@[simp]
theorem nonempty_sInter {c : Set (Set α)} : (⋂₀ c).Nonempty ↔ ∃ a, ∀ b ∈ c, a ∈ b


@[to_additive]
theorem mulIndicator_of_mem (hU : IsClopen U) (h : a ∈ U) : f.mulIndicator hU a = f a

{X : Type u_1}
[TopologicalSpace X]
{R : Type u_5}
[Zero R]
{U : Set X}
(f : LocallyConstant X R)
{a : X}
(hU : IsClopen U)
(h : a ∈ U)


theorem map_toNonUnitalSubalgebra {S : NonUnitalStarSubalgebra R A} {f : F} :
    (map f S : NonUnitalStarSubalgebra R B).toNonUnitalSubalgebra =
      NonUnitalSubalgebra.map f S.toNonUnitalSubalgebra

{F : Type v'}
{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[Star A]
[NonUnitalNonAssocSemiring B]
[Module R B]
[Star B]
[FunLike F A B]
[NonUnitalAlgHomClass F R A B]
[NonUnitalStarAlgHomClass F R A B]
{S : NonUnitalStarSubalgebra R A}
{f : F}

(NonUnitalStarSubalgebra.map f S).toNonUnitalSubalgebra = NonUnitalSubalgebra.map f S.toNonUnitalSubalgebra


@[to_additive]
theorem map_left_cancel {x y} {c : S} (h : f.toMap (x * c) = f.toMap (y * c)) :
    f.toMap x = f.toMap y

(h : f.toMap (x * ↑c) = f.toMap (y * ↑c))


theorem map_relNorm (I : Ideal S) {T : Type*} [CommRing T] (f : R →+* T) :
    map f (relNorm R I) = span (f ∘ Algebra.norm R '' (I : Set S))

(R : Type u_1)
[CommRing R]
{S : Type u_2}
[CommRing S]
[Algebra R S]
[IsDomain R]
[IsDomain S]
[IsDedekindDomain R]
[IsDedekindDomain S]
[Module.Finite R S]
[Module.Free R S]
(I : Ideal S)
{T : Type u_3}
[CommRing T]
(f : R →+* T)

Ideal.map f ((Ideal.relNorm R) I) = Ideal.span (⇑f ∘ ⇑(Algebra.norm R) '' ↑I)


theorem fderiv_finset_prod [DecidableEq ι] {x : E} (hg : ∀ i ∈ u, DifferentiableAt 𝕜 (g i) x) :
    fderiv 𝕜 (∏ i ∈ u, g i ·) x = ∑ i ∈ u, (∏ j ∈ u.erase i, (g j x)) • fderiv 𝕜 (g i) x

fderiv 𝕜 (fun x => ∏ i ∈ u, g i x) x = ∑ i ∈ u, (∏ j ∈ u.erase i, g j x) • fderiv 𝕜 (g i) x


theorem blockDiagonal_apply_ne (M : o → Matrix m n α) (i j) {k k'} (h : k ≠ k') :
    blockDiagonal M (i, k) (j, k') = 0

{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type u_12}
[DecidableEq o]
[Zero α]
(M : o → Matrix m n α)
(i : m)
(j : n)
{k k' : o}
(h : k ≠ k')

Matrix.blockDiagonal M (i, k) (j, k') = 0


@[simp]
theorem ofNat''_eq_cast (n : ℕ) [NeZero n] (a : ℕ) : (Fin.ofNat'' a : Fin n) = a


/-- If `C` is equivalent to `D`, then `E ⥤ C` is equivalent to `E ⥤ D`. -/
@[simps! functor inverse unitIso counitIso]
def congrRight (e : C ≌ D) : E ⥤ C ≌ E ⥤ D

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

e.congrRight.counitIso =
  CategoryTheory.NatIso.ofComponents
    (fun F => F.associator e.inverse e.functor ≪≫ CategoryTheory.isoWhiskerLeft F e.counitIso ≪≫ F.rightUnitor) ⋯


theorem kahler_ne_zero {x y : E} (hx : x ≠ 0) (hy : y ≠ 0) : o.kahler x y ≠ 0

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


/-- The **Chevalley–Warning theorem**, binary version.
Let `f₁`, `f₂` be two multivariate polynomials in finitely many variables (`X s`, `s : σ`) over a
finite field of characteristic `p`.
Assume that the sum of the total degrees of `f₁` and `f₂` is less than the cardinality of `σ`.
Then the number of common solutions of the `f₁` and `f₂` is divisible by `p`. -/
theorem char_dvd_card_solutions_of_add_lt {f₁ f₂ : MvPolynomial σ K}
    (h : f₁.totalDegree + f₂.totalDegree < Fintype.card σ) :
    p ∣ Fintype.card { x : σ → K // eval x f₁ = 0 ∧ eval x f₂ = 0 }

p ∣ Fintype.card { x // (MvPolynomial.eval x) f₁ = 0 ∧ (MvPolynomial.eval x) f₂ = 0 }


protected theorem dvd_zero (n : Int) : n ∣ 0


protected theorem Periodic.comp [Add α] (h : Periodic f c) (g : β → γ) : Periodic (g ∘ f) c

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : α → β}
{c : α}
[Add α]
(h : Function.Periodic f c)
(g : β → γ)


theorem left_nhdsWithin_Ioo_neBot {a b : α} (H : a < b) : NeBot (𝓝[Ioo a b] a)

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
{a b : α}
(H : a < b)


@[to_additive prod_mono_left]
theorem prod_mono_left (H : Subgroup N) : Monotone fun K : Subgroup G => K.prod H

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
(H : AddSubgroup N)


@[to_additive]
theorem IsWF.min_mul (hs : s.IsWF) (ht : t.IsWF) (hsn : s.Nonempty) (htn : t.Nonempty) :
    (hs.mul ht).min (hsn.mul htn) = hs.min hsn * ht.min htn

{α : Type u_1}
{s t : Set α}
[LinearOrderedCancelAddCommMonoid α]
(hs : s.IsWF)
(ht : t.IsWF)
(hsn : s.Nonempty)
(htn : t.Nonempty)


@[to_additive]
lemma noncommProd_induction (s : Finset α) (f : α → β) (comm)
    (p : β → Prop) (hom : ∀ a b, p a → p b → p (a * b)) (unit : p 1) (base : ∀ x ∈ s, p (f x)) :
    p (s.noncommProd f comm)

(comm : (↑s).Pairwise fun a b => Commute (f a) (f b))

(hom : ∀ (a b : β), p a → p b → p (a * b))


/-- The list version of `Multiset.le_iff_count`. -/
theorem subperm_ext_iff {l₁ l₂ : List α} : l₁ <+~ l₂ ↔ ∀ x ∈ l₁, count x l₁ ≤ count x l₂

{α : Type u_1}
[DecidableEq α]
{l₁ l₂ : List α}

l₁ <+~ l₂ ↔ ∀ (x : α), x ∈ l₁ → List.count x l₁ ≤ List.count x l₂


theorem objSupIsoProdEqLocus_inv_fst {X : TopCat} (F : X.Sheaf CommRingCat) (U V : Opens X) (x) :
    F.1.map (homOfLE le_sup_left).op ((F.objSupIsoProdEqLocus U V).inv x) = x.1.1

(x :
  ↥((RingHom.comp (F.val.map (CategoryTheory.homOfLE ⋯).op)
          (RingHom.fst ↑(F.val.obj (Opposite.op U)) ↑(F.val.obj (Opposite.op V)))).eqLocus
      (RingHom.comp (F.val.map (CategoryTheory.homOfLE ⋯).op)
        (RingHom.snd ↑(F.val.obj (Opposite.op U)) ↑(F.val.obj (Opposite.op V))))))

(F.val.map (CategoryTheory.homOfLE ⋯).op) ((F.objSupIsoProdEqLocus U V).inv x) = (↑x).1


theorem isSuccLimit_zero : IsSuccLimit (0 : Cardinal)


theorem DifferentiableWithinAt.arctan (hf : DifferentiableWithinAt ℝ f s x) :
    DifferentiableWithinAt ℝ (fun x => Real.arctan (f x)) s x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{x : E}
{s : Set E}
(hf : DifferentiableWithinAt ℝ f s x)


theorem diagonal_updateColumn_single [DecidableEq n] [Zero α] (v : n → α) (i : n) (x : α) :
    (diagonal v).updateColumn i (Pi.single i x) = diagonal (Function.update v i x)

{n : Type u_3}
{α : Type v}
[DecidableEq n]
[Zero α]
(v : n → α)
(i : n)
(x : α)

(Matrix.diagonal v).updateColumn i (Pi.single i x) = Matrix.diagonal (Function.update v i x)


@[simp] lemma infClosed_empty : InfClosed (∅ : Set α)


theorem aut_one : 1 = AlgEquiv.refl (R := R) (A₁ := A₁)

{R : Type uR}
{A₁ : Type uA₁}
[CommSemiring R]
[Semiring A₁]
[Algebra R A₁]


/-- Auxiliary construction for `ofBraided`. -/
@[simps]
def ofBraidedObj (X : C) : Center C

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

(CategoryTheory.Center.ofBraidedObj X).snd.β Y = β_ X Y


theorem compareOfLessAndEq_eq_lt {x y : α} [LT α] [Decidable (x < y)] [DecidableEq α] :
    compareOfLessAndEq x y = .lt ↔ x < y

{α : Type u_1}
{x y : α}
[LT α]
[Decidable (x < y)]
[DecidableEq α]

compareOfLessAndEq x y = Ordering.lt ↔ x < y


/-- The image of the normalizer is contained in the normalizer of the image. -/
@[to_additive "The image of the normalizer is contained in the normalizer of the image."]
theorem le_normalizer_map (f : G →* N) : H.normalizer.map f ≤ (H.map f).normalizer

{G : Type u_1}
[AddGroup G]
{H : AddSubgroup G}
{N : Type u_5}
[AddGroup N]
(f : G →+ N)

AddSubgroup.map f H.normalizer ≤ (AddSubgroup.map f H).normalizer


@[to_additive (attr := simp)]
theorem hrec_on₂_coe {cM : Con M} {cN : Con N} {φ : cM.Quotient → cN.Quotient → Sort*} (a : M)
    (b : N) (f : ∀ (x : M) (y : N), φ x y)
    (h : ∀ x y x' y', cM x x' → cN y y' → HEq (f x y) (f x' y')) :
    Con.hrecOn₂ (↑a) (↑b) f h = f a b

{φ : cM.Quotient → cN.Quotient → Sort u_4}

(h : ∀ (x : M) (y : N) (x' : M) (y' : N), cM x x' → cN y y' → HEq (f x y) (f x' y'))


/-- If a `Finset` of a subtype is converted to the main type with
`Embedding.subtype`, all elements of the result have the property of
the subtype. -/
theorem property_of_mem_map_subtype {p : α → Prop} (s : Finset { x // p x }) {a : α}
    (h : a ∈ s.map (Embedding.subtype _)) : p a

(h : a ∈ Finset.map (Function.Embedding.subtype fun x => p x) s)


/-- If `G₀` is a group with zero with topology such that `x ↦ x⁻¹` is continuous at all nonzero
points. Then the coercion `G₀ˣ → G₀` is a topological embedding. -/
theorem Units.embedding_val₀ [GroupWithZero G₀] [TopologicalSpace G₀] [HasContinuousInv₀ G₀] :
    Embedding (val : G₀ˣ → G₀)

{G₀ : Type u_3}
[GroupWithZero G₀]
[TopologicalSpace G₀]
[HasContinuousInv₀ G₀]


@[simp]
theorem mk_l_inv {X : F C} : ⟦Hom.l_inv X⟧ = (λ_ X).inv

{X : CategoryTheory.FreeMonoidalCategory C}

⟦CategoryTheory.FreeMonoidalCategory.Hom.l_inv X⟧ = (CategoryTheory.MonoidalCategory.leftUnitor X).inv


theorem isConj_swap {w x y z : α} (hwx : w ≠ x) (hyz : y ≠ z) : IsConj (swap w x) (swap y z)

{α : Type u}
[DecidableEq α]
{w x y z : α}
(hwx : w ≠ x)
(hyz : y ≠ z)

IsConj (Equiv.swap w x) (Equiv.swap y z)


lemma eq (p : ℕ) [C : CharP R p] : ringChar R = p

(R : Type u_1)
[NonAssocSemiring R]
(p : ℕ)
[C : CharP R p]


theorem einfsep_pair_eq_inf (hxy : x ≠ y) : ({x, y} : Set α).einfsep = edist x y ⊓ edist y x

{α : Type u_1}
[EDist α]
{x y : α}
(hxy : x ≠ y)


@[simp]
lemma pullbackMk_snd (x₁ : X₁) (x₂ : X₂) (h : f₁ x₁ = f₂ x₂) :
    pullback.snd f₁ f₂ (pullbackMk f₁ f₂ x₁ x₂ h) = x₂

[CategoryTheory.Limits.PreservesLimit (CategoryTheory.Limits.cospan f₁ f₂) (CategoryTheory.forget C)]

(CategoryTheory.Limits.pullback.snd f₁ f₂) (CategoryTheory.Limits.Concrete.pullbackMk f₁ f₂ x₁ x₂ h) = x₂


theorem not_mem_iff_inf_principal_compl {f : Filter α} {s : Set α} : s ∉ f ↔ NeBot (f ⊓ 𝓟 sᶜ)

{α : Type u_1}
{f : Filter α}
{s : Set α}


/-- The identity lax braided monoidal functor. -/
@[simps!]
def id : LaxBraidedFunctor C C

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

∀ {X Y : C} (f : X ⟶ Y), (CategoryTheory.LaxBraidedFunctor.id C).map f = f


@[simp]
theorem eval_comap (f : α' → α) (x : List α') : (M.comap f).eval x = M.eval (x.map f)

{α : Type u}
{σ : Type v}
(M : DFA α σ)
{α' : Type u_1}
(f : α' → α)
(x : List α')

(DFA.comap f M).eval x = M.eval (List.map f x)


/-- On any vector space, multiplication by a scalar is a smooth operation. -/
theorem smooth_smul : Smooth (𝓘(𝕜).prod 𝓘(𝕜, V)) 𝓘(𝕜, V) fun p : 𝕜 × V => p.1 • p.2

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{V : Type u_18}
[NormedAddCommGroup V]
[NormedSpace 𝕜 V]

Smooth (𝓘(𝕜, 𝕜).prod 𝓘(𝕜, V)) 𝓘(𝕜, V) fun p => p.1 • p.2


theorem snd_eq_iff : ∀ {p : α × β} {x : β}, p.2 = x ↔ p = (p.1, x)

{α : Type u_1}
{β : Type u_2}
{p : α × β}
{x : β}


/-- Consider a series of functions `∑' i, f i x`. Assume that each individual function `f i` is of
class `C^N`, and moreover there is a uniform summable upper bound on the `k`-th derivative
for each `k ≤ N`. Then the series is also `C^N`. -/
theorem contDiff_tsum (hf : ∀ i, ContDiff 𝕜 N (f i)) (hv : ∀ k : ℕ, (k : ℕ∞) ≤ N → Summable (v k))
    (h'f : ∀ (k : ℕ) (i : α) (x : E), (k : ℕ∞) ≤ N → ‖iteratedFDeriv 𝕜 k (f i) x‖ ≤ v k i) :
    ContDiff 𝕜 N fun x => ∑' i, f i x

{v : ℕ → α → ℝ}

(hv : ∀ (k : ℕ), ↑k ≤ N → Summable (v k))

(h'f : ∀ (k : ℕ) (i : α) (x : E), ↑k ≤ N → ‖iteratedFDeriv 𝕜 k (f i) x‖ ≤ v k i)


theorem coe_injective : Injective ((↑) : NonemptyInterval α → Interval α)


/-- A morphism property `RespectsIso` if it still holds when composed with an isomorphism -/
class RespectsIso (P : MorphismProperty C) : Prop where
  precomp {X Y Z} (e : X ≅ Y) (f : Y ⟶ Z) (hf : P f) : P (e.hom ≫ f)
  postcomp {X Y Z} (e : Y ≅ Z) (f : X ⟶ Y) (hf : P f) : P (f ≫ e.hom)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{P : CategoryTheory.MorphismProperty C}
[self : P.RespectsIso]
{X Y Z : C}
(e : Y ≅ Z)
(f : X ⟶ Y)
(hf : P f)


theorem injective_piecewise_iff {f g : α → β} :
    Injective (s.piecewise f g) ↔
      InjOn f s ∧ InjOn g sᶜ ∧ ∀ x ∈ s, ∀ y ∉ s, f x ≠ g y

{α : Type u_1}
{β : Type u_2}
(s : Set α)
[(j : α) → Decidable (j ∈ s)]
{f g : α → β}

Function.Injective (s.piecewise f g) ↔ Set.InjOn f s ∧ Set.InjOn g sᶜ ∧ ∀ x ∈ s, ∀ y ∉ s, f x ≠ g y


@[to_additive]
theorem le_of_mul_le_of_one_le_right [CovariantClass α α (swap (· * ·)) (· ≤ ·)] {a b c : α}
    (h : a * b ≤ c) (hle : 1 ≤ a) :
    b ≤ c

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


/-- A family indexed by a type with a unique element
is `MulEquiv` to the element at the single index. -/
@[to_additive (attr := simps!)
  "A family indexed by a type with a unique element
  is `AddEquiv` to the element at the single index."]
def piUnique {ι : Type*} (M : ι → Type*) [∀ j, Mul (M j)] [Unique ι] :
    (∀ j, M j) ≃* M default

{ι : Type u_12}
(M : ι → Type u_13)
[(j : ι) → Mul (M j)]
[Unique ι]
(f : (i : ι) → M i)


@[simp]
theorem attach_map_val (l : List α) : l.attach.map Subtype.val = l


@[reassoc (attr := simp)]
lemma fromOpcycles_d :
    K.fromOpcycles i j ≫ K.d j k = 0


theorem toMeasure_apply_singleton (a : α) (h : MeasurableSet ({a} : Set α)) :
    p.toMeasure {a} = p a

{α : Type u_1}
[MeasurableSpace α]
(p : PMF α)
(a : α)
(h : MeasurableSet {a})


lemma inf_ringCon (I J : TwoSidedIdeal R) : (I ⊓ J).ringCon = I.ringCon ⊓ J.ringCon

(R : Type u_1)
[NonUnitalNonAssocRing R]
(I J : TwoSidedIdeal R)


theorem ae_eq_restrict_biUnion_iff (s : ι → Set α) {t : Set ι} (ht : t.Countable) (f g : α → δ) :
    f =ᵐ[μ.restrict (⋃ i ∈ t, s i)] g ↔ ∀ i ∈ t, f =ᵐ[μ.restrict (s i)] g

{α : Type u_2}
{δ : Type u_4}
{ι : Type u_6}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(s : ι → Set α)
{t : Set ι}
(ht : t.Countable)
(f g : α → δ)


@[to_additive (attr := simp)]
theorem div_eq_bot_iff : f / g = ⊥ ↔ f = ⊥ ∨ g = ⊥


@[aesop safe apply (rule_sets := [SetLike])]
lemma ofNat_mem [AddSubmonoidWithOneClass S R] (s : S) (n : ℕ) [n.AtLeastTwo] :
    no_index (OfNat.ofNat n) ∈ s

{S : Type u_1}
{R : Type u_2}
[AddMonoidWithOne R]
[SetLike S R]
[AddSubmonoidWithOneClass S R]
(s : S)
(n : ℕ)
[n.AtLeastTwo]


lemma traceForm_cartan_nondegenerate
    [IsNoetherian R L] [IsArtinian R L] (H : LieSubalgebra R L) [H.IsCartanSubalgebra] :
    (LieModule.traceForm R H L).Nondegenerate

(R : Type u_1)
(L : Type u_3)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieAlgebra.IsKilling R L]
[IsNoetherian R L]
[IsArtinian R L]
(H : LieSubalgebra R L)
[H.IsCartanSubalgebra]

(LieModule.traceForm R (↥H) L).Nondegenerate


@[to_additive (attr := simp)]
theorem isUnit_one [Monoid M] : IsUnit (1 : M)


theorem dvd_prime_pow [CancelCommMonoidWithZero α] {p q : α} (hp : Prime p) (n : ℕ) :
    q ∣ p ^ n ↔ ∃ i ≤ n, Associated q (p ^ i)

{α : Type u_1}
[CancelCommMonoidWithZero α]
{p q : α}
(hp : Prime p)
(n : ℕ)


@[simp]
theorem rdrop_nil : rdrop ([] : List α) n = []


theorem range_coe [RingHomSurjective τ₁₂] (f : F) : (range f : Set M₂) = Set.range f

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_6}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
{F : Type u_11}
[FunLike F M M₂]
[SemilinearMapClass F τ₁₂ M M₂]
[RingHomSurjective τ₁₂]
(f : F)


theorem btw_refl_left_right (a b : α) : btw a b a

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


@[to_additive]
theorem preimage {f : G → H} (hf : IsGroupHom f) {s : Set H} (hs : IsSubgroup s) :
    IsSubgroup (f ⁻¹' s)

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


@[to_additive (attr := simp)]
theorem toMonoidHom_eq_coe (f : M ≃* N) : f.toMonoidHom = (f : M →* N)

{M : Type u_6}
{N : Type u_7}
[AddZeroClass M]
[AddZeroClass N]
(f : M ≃+ N)


theorem equiv_mul_left_of_mem {h g : G} (hh : h ∈ H) :
    hHT.equiv (h * g) = (⟨h, hh⟩ * (hHT.equiv g).fst, (hHT.equiv g).snd)

{G : Type u_1}
[Group G]
{H : Subgroup G}
{T : Set G}
(hHT : Subgroup.IsComplement (↑H) T)
{h g : G}
(hh : h ∈ H)

hHT.equiv (h * g) = (⟨h, hh⟩ * (hHT.equiv g).1, (hHT.equiv g).2)


theorem le_card_sdiff (s t : Finset α) : t.card - s.card ≤ card (t \ s)

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


protected theorem neg_dvd {a b : Int} : -a ∣ b ↔ a ∣ b


lemma basicOpen_appLE {X Y : Scheme.{u}} (f : X ⟶ Y) (U : X.Opens) (V : Y.Opens) (e : U ≤ f ⁻¹ᵁ V)
    (s : Γ(Y, V)) : X.basicOpen (f.appLE V U e s) = U ⊓ f ⁻¹ᵁ (Y.basicOpen s)

(e : U ≤ (TopologicalSpace.Opens.map f.val.base).obj V)

X.basicOpen ((AlgebraicGeometry.Scheme.Hom.appLE f V U e) s) =
  U ⊓ (TopologicalSpace.Opens.map f.val.base).obj (Y.basicOpen s)


/-- The (real) logarithm of a natural number `n` is bounded by a multiple of every power of `n`
with positive exponent. -/
lemma log_natCast_le_rpow_div (n : ℕ) {ε : ℝ} (hε : 0 < ε) : log n ≤ n ^ ε / ε


/-- Given a walk `w` and a node in the support, there exists a natural `n`, such that given node
is the `n`-th node (zero-indexed) in the walk. In addition, `n` is at most the length of the path.
Due to the definition of `getVert` it would otherwise be legal to return a larger `n` for the last
node. -/
theorem mem_support_iff_exists_getVert {u v w : V} {p : G.Walk v w} :
    u ∈ p.support ↔ ∃ n, p.getVert n = u ∧ n ≤ p.length

{V : Type u}
{G : SimpleGraph V}
{u v w : V}
{p : G.Walk v w}


@[to_additive]
theorem map_mul₂ {_ : MulOneClass M} {_ : MulOneClass N} {_ : CommMonoid P} (f : M →* N →* P)
    (m₁ m₂ : M) (n : N) : f (m₁ * m₂) n = f m₁ n * f m₂ n

{M : Type uM}
{N : Type uN}
{P : Type uP}

∀ {x : AddZeroClass M} {x_1 : AddZeroClass N} {x_2 : AddCommMonoid P} (f : M →+ N →+ P) (m₁ m₂ : M) (n : N),
  (f (m₁ + m₂)) n = (f m₁) n + (f m₂) n


theorem Nontrivial.ne_singleton (hs : s.Nontrivial) : s ≠ {a}

{α : Type u_1}
{s : Finset α}
{a : α}
(hs : s.Nontrivial)


/-- The left fraction in the opposite category corresponding to a right fraction. -/
@[simps]
def RightFraction.op {X Y : C} (φ : W.RightFraction X Y) :
    W.op.LeftFraction (Opposite.op Y) (Opposite.op X)

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


/-- `Real.exp` is strictly convex on the whole real line. -/
theorem strictConvexOn_exp : StrictConvexOn ℝ univ exp


/-- Taylor formula for an analytic function, `IsBigO` version. -/
theorem HasFPowerSeriesAt.isBigO_sub_partialSum_pow (hf : HasFPowerSeriesAt f p x) (n : ℕ) :
    (fun y : E => f (x + y) - p.partialSum n y) =O[𝓝 0] fun y => ‖y‖ ^ n

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{x : E}
(hf : HasFPowerSeriesAt f p x)
(n : ℕ)

(fun y => f (x + y) - p.partialSum n y) =O[𝓝 0] fun y => ‖y‖ ^ n


@[to_additive]
theorem comap_iSup_map_of_injective (S : ι → Subsemigroup M) :
    (⨆ i, (S i).map f).comap f = iSup S

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

Subsemigroup.comap f (⨆ i, Subsemigroup.map f (S i)) = iSup S


theorem add_subst {α} [Ring α] {n e1 e2 t1 t2 : α} (h1 : n * e1 = t1) (h2 : n * e2 = t2) :
    n * (e1 + e2) = t1 + t2


/-- Spec is fully faithful -/
@[simps]
def Spec.homEquiv {R S : CommRingCat} : (Spec S ⟶ Spec R) ≃ (R ⟶ S)

AlgebraicGeometry.Spec.homEquiv.symm f = AlgebraicGeometry.Spec.map f


@[simp]
theorem neLocus_self_add_left : neLocus (f + g) f = g.support

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


lemma addX_self {P : Fin 3 → R} (hP : W'.Equation P) : W'.addX P P = 0

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


/-- When both `S.f` and `S.g` are zero, the middle object `S.X₂` gives a left homology data on S -/
@[simps]
def ofZeros (hf : S.f = 0) (hg : S.g = 0) : S.LeftHomologyData

(CategoryTheory.ShortComplex.LeftHomologyData.ofZeros S hf hg).H = S.X₂


theorem tendsto_integral_approxOn_of_measurable [MeasurableSpace E] [BorelSpace E] {f : α → E}
    {s : Set E} [SeparableSpace s] (hfi : Integrable f μ) (hfm : Measurable f)
    (hs : ∀ᵐ x ∂μ, f x ∈ closure s) {y₀ : E} (h₀ : y₀ ∈ s) (h₀i : Integrable (fun _ => y₀) μ) :
    Tendsto (fun n => (SimpleFunc.approxOn f hfm s y₀ h₀ n).integral μ)
      atTop (𝓝 <| ∫ x, f x ∂μ)

(h₀i : MeasureTheory.Integrable (fun x => y₀) μ)

Filter.Tendsto (fun n => MeasureTheory.SimpleFunc.integral μ (MeasureTheory.SimpleFunc.approxOn f hfm s y₀ h₀ n))
  Filter.atTop (𝓝 (∫ (x : α), f x ∂μ))


/-- If `f : X → Z` is a surjective Borel measurable map from a standard Borel space
to a countably separated measurable space,
then for any measurable space `α` and `g : Z → α`, the composition
`g ∘ f` is measurable if and only if `g` is measurable. -/
theorem measurable_comp_iff_of_surjective [CountablySeparated Z]
    {f : X → Z} (hf : Measurable f) (hsurj : Surjective f)
    {g : Z → β} : Measurable (g ∘ f) ↔ Measurable g

{X : Type u_3}
{Z : Type u_5}
{β : Type u_6}
[MeasurableSpace X]
[StandardBorelSpace X]
[MeasurableSpace β]
[MeasurableSpace Z]
[MeasurableSpace.CountablySeparated Z]
{f : X → Z}
(hf : Measurable f)
(hsurj : Function.Surjective f)
{g : Z → β}


/-- We say that a topological space is a *weakly locally compact space*,
if each point of this space admits a compact neighborhood. -/
class WeaklyLocallyCompactSpace (X : Type*) [TopologicalSpace X] : Prop where
  /-- Every point of a weakly locally compact space admits a compact neighborhood. -/
  exists_compact_mem_nhds (x : X) : ∃ s, IsCompact s ∧ s ∈ 𝓝 x

{X : Type u_3}
[TopologicalSpace X]
[self : WeaklyLocallyCompactSpace X]
(x : X)


/-- `Π i : Fin 2, α i` is equivalent to `α 0 × α 1`. See also `finTwoArrowEquiv` for a
non-dependent version and `prodEquivPiFinTwo` for a version with inputs `α β : Type u`. -/
@[simps (config := .asFn)]
def piFinTwoEquiv (α : Fin 2 → Type u) : (∀ i, α i) ≃ α 0 × α 1

⇑(piFinTwoEquiv α) = fun f => (f 0, f 1)


theorem modEq_sub (a b : ℤ) : a ≡ b [ZMOD a - b]


/-- A variant of `image_id` -/
@[simp]
theorem image_id' (s : Set α) : (fun x => x) '' s = s


theorem HasBasis.tendstoIxxClass {ι : Type*} {p : ι → Prop} {s} {l : Filter α}
    (hl : l.HasBasis p s) {Ixx : α → α → Set α}
    (H : ∀ i, p i → ∀ x ∈ s i, ∀ y ∈ s i, Ixx x y ⊆ s i) : TendstoIxxClass Ixx l l

(H : ∀ (i : ι), p i → ∀ x ∈ s i, ∀ y ∈ s i, Ixx x y ⊆ s i)


theorem disjoint_iff_inter_eq_empty : Disjoint s t ↔ s ∩ t = ∅

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


lemma limsup_sup_filter {g} : limsup u (f ⊔ g) = limsup u f ⊔ limsup u g

{α : Type u_1}
{β : Type u_2}
[CompleteDistribLattice α]
{f : Filter β}
{u : β → α}
{g : Filter β}

Filter.limsup u (f ⊔ g) = Filter.limsup u f ⊔ Filter.limsup u g


theorem IsMaxChain.not_superChain (h : IsMaxChain r s) : ¬SuperChain r s t

{α : Type u_1}
{r : α → α → Prop}
{s t : Set α}
(h : IsMaxChain r s)


theorem card_derangements_fin_add_two (n : ℕ) :
    card (derangements (Fin (n + 2))) =
      (n + 1) * card (derangements (Fin n)) + (n + 1) * card (derangements (Fin (n + 1)))

Fintype.card ↑(derangements (Fin (n + 2))) =
  (n + 1) * Fintype.card ↑(derangements (Fin n)) + (n + 1) * Fintype.card ↑(derangements (Fin (n + 1)))


/-- The map `coe_fn : (r →r s) → (α → β)` is injective. -/
theorem coe_fn_injective : Injective fun (f : r →r s) => (f : α → β)

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}


/-- Given an affinely independent family of points, an affine combination lies in the
span of two points given as affine combinations if and only if it is an affine combination
with weights those of one point plus a multiple of the difference between the weights of the
two points. -/
theorem affineCombination_mem_affineSpan_pair {p : ι → P} (h : AffineIndependent k p)
    {w w₁ w₂ : ι → k} {s : Finset ι} (_ : ∑ i ∈ s, w i = 1) (hw₁ : ∑ i ∈ s, w₁ i = 1)
    (hw₂ : ∑ i ∈ s, w₂ i = 1) :
    s.affineCombination k p w ∈ line[k, s.affineCombination k p w₁, s.affineCombination k p w₂] ↔
      ∃ r : k, ∀ i ∈ s, w i = r * (w₂ i - w₁ i) + w₁ 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}
(h : AffineIndependent k p)
{w w₁ w₂ : ι → k}
{s : Finset ι}

∑ i ∈ s, w i = 1 →
  ∑ i ∈ s, w₁ i = 1 →
    ∑ i ∈ s, w₂ i = 1 →
      ((Finset.affineCombination k s p) w ∈
          affineSpan k {(Finset.affineCombination k s p) w₁, (Finset.affineCombination k s p) w₂} ↔
        ∃ r, ∀ i ∈ s, w i = r * (w₂ i - w₁ i) + w₁ i)


@[simp]
theorem eval_one : eval f a 1 = 1

{K : Type u}
[Field K]
{L : Type u}
[Field L]
(f : K →+* L)
(a : L)


@[simp]
theorem isLittleO_norm_right : (f =o[l] fun x => ‖g' x‖) ↔ f =o[l] g'

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


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

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


@[simp]
theorem Ioc_eq_zero_of_le (h : b ≤ a) : Ioc a b = 0

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


theorem StarConvex.add {t : Set E} (hs : StarConvex 𝕜 x s) (ht : StarConvex 𝕜 y t) :
    StarConvex 𝕜 (x + y) (s + t)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{x y : E}
{s t : Set E}
(hs : StarConvex 𝕜 x s)
(ht : StarConvex 𝕜 y t)


theorem coe_injective : @Function.Injective (LocallyConstant X Y) (X → Y) (↑)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]


@[simp]
theorem coe_of (α : Type*) [DistribLattice α] : ↥(of α) = α


@[simp 1001] -- increased priority to appease `simpNF`
theorem one_not_mem_nonunits [Monoid α] : (1 : α) ∉ nonunits α


lemma singleton.mk {f : Y ⟶ X} : singleton f f

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


/-- A linear map induces a linear map on adic cauchy sequences. -/
@[simps]
def map (f : M →ₗ[R] N) : AdicCauchySequence I M →ₗ[R] AdicCauchySequence I N

(a : AdicCompletion.AdicCauchySequence I M)

↑((AdicCompletion.AdicCauchySequence.map I f) a) n = f (↑a n)


/-- The right inverse to a formal multilinear series is indeed a right inverse, provided its linear
term is invertible and its constant term vanishes. -/
theorem comp_rightInv (p : FormalMultilinearSeries 𝕜 E F) (i : E ≃L[𝕜] F)
    (h : p 1 = (continuousMultilinearCurryFin1 𝕜 E F).symm i) (h0 : p 0 = 0) :
    p.comp (rightInv p i) = id 𝕜 F

(h : p 1 = (continuousMultilinearCurryFin1 𝕜 E F).symm ↑i)

p.comp (p.rightInv i) = FormalMultilinearSeries.id 𝕜 F


@[simp]
theorem subset_iInter_iff {s : Set α} {t : ι → Set α} : (s ⊆ ⋂ i, t i) ↔ ∀ i, s ⊆ t i

{α : Type u_1}
{ι : Sort u_4}
{s : Set α}
{t : ι → Set α}


/-- In a locally compact space, any function in `ℒp` can be approximated by compactly supported
continuous functions when `p < ∞`, version in terms of `eLpNorm`. -/
theorem Memℒp.exists_hasCompactSupport_eLpNorm_sub_le [WeaklyLocallyCompactSpace α] [μ.Regular]
    (hp : p ≠ ∞) {f : α → E} (hf : Memℒp f p μ) {ε : ℝ≥0∞} (hε : ε ≠ 0) :
    ∃ g : α → E, HasCompactSupport g ∧ eLpNorm (f - g) p μ ≤ ε ∧ Continuous g ∧ Memℒp g p μ

{α : Type u_1}
[TopologicalSpace α]
[NormalSpace α]
[R1Space α]
[MeasurableSpace α]
[BorelSpace α]
{E : Type u_2}
[NormedAddCommGroup E]
{μ : MeasureTheory.Measure α}
{p : ℝ≥0∞}
[NormedSpace ℝ E]
[WeaklyLocallyCompactSpace α]
[μ.Regular]
(hp : p ≠ ⊤)
{f : α → E}
(hf : MeasureTheory.Memℒp f p μ)
{ε : ℝ≥0∞}
(hε : ε ≠ 0)

∃ g, HasCompactSupport g ∧ MeasureTheory.eLpNorm (f - g) p μ ≤ ε ∧ Continuous g ∧ MeasureTheory.Memℒp g p μ


/-- If `p : Set X → Prop` is stable under restriction and union, and each point `x`
  of a Lindelöf set `s` has a neighborhood `t` within `s` such that `p t`, then `p s` holds. -/
@[elab_as_elim]
theorem IsLindelof.induction_on (hs : IsLindelof s) {p : Set X → Prop}
    (hmono : ∀ ⦃s t⦄, s ⊆ t → p t → p s)
    (hcountable_union : ∀ (S : Set (Set X)), S.Countable → (∀ s ∈ S, p s) → p (⋃₀ S))
    (hnhds : ∀ x ∈ s, ∃ t ∈ 𝓝[s] x, p t) : p s

(hmono : ∀ ⦃s t : Set X⦄, s ⊆ t → p t → p s)


/-- If `H ≤ K`, then `H` as a subgroup of `K` is isomorphic to `H`. -/
@[to_additive (attr := simps) "If `H ≤ K`, then `H` as a subgroup of `K` is isomorphic to `H`."]
def subgroupOfEquivOfLe {G : Type*} [Group G] {H K : Subgroup G} (h : H ≤ K) :
    H.subgroupOf K ≃* H

{G : Type u_7}
[Group G]
{H K : Subgroup G}
(h : H ≤ K)
(g : ↥H)

↑↑((Subgroup.subgroupOfEquivOfLe h).symm g) = ↑g


theorem cosh_strictMonoOn : StrictMonoOn cosh (Ici 0)


/-- Sends a complex `X` with objects in `V` to the corresponding complex with objects in `Vᵒᵖ`. -/
@[simps]
protected def opSymm (X : HomologicalComplex V c.symm) : HomologicalComplex Vᵒᵖ c


@[fun_prop]
theorem Differentiable.const_add (hf : Differentiable 𝕜 f) (c : F) :
    Differentiable 𝕜 fun y => c + f y

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
(hf : Differentiable 𝕜 f)
(c : F)


theorem charP_zmod : CharP (TruncatedWittVector p n (ZMod p)) (p ^ n)

(p : ℕ)
[hp : Fact (Nat.Prime p)]
(n : ℕ)


@[simp]
theorem one_le_lift_iff {a : Cardinal.{u}} :
    (1 : Cardinal) ≤ lift.{v} a ↔ 1 ≤ a


theorem recDiagOn_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.recDiagOn (m+1) 0 zero_zero zero_succ succ_zero succ_succ
      = succ_zero m (Nat.recDiagOn m 0 zero_zero zero_succ succ_zero succ_succ)

(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.recDiagOn (m + 1) 0 zero_zero zero_succ succ_zero succ_succ =
  succ_zero m (Nat.recDiagOn m 0 zero_zero zero_succ succ_zero succ_succ)


@[simp]
theorem count_erase_of_ne {a b : α} (ab : a ≠ b) (s : Multiset α) :
    count a (erase s b) = count a s

{α : Type u_1}
[DecidableEq α]
{a b : α}
(ab : a ≠ b)
(s : Multiset α)

Multiset.count a (s.erase b) = Multiset.count a s


theorem fderiv_mul_const' (ha : DifferentiableAt 𝕜 a x) (b : 𝔸) :
    fderiv 𝕜 (fun y => a y * b) x = (fderiv 𝕜 a x).smulRight b

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


/-- `Orientation.finOrthonormalBasis` gives a basis with the required orientation. -/
@[simp]
theorem finOrthonormalBasis_orientation (hn : 0 < n) (h : finrank ℝ E = n)
    (x : Orientation ℝ E (Fin n)) : (x.finOrthonormalBasis hn h).toBasis.orientation = x

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
{n : ℕ}
(hn : 0 < n)
(h : FiniteDimensional.finrank ℝ E = n)
(x : Orientation ℝ E (Fin n))

(Orientation.finOrthonormalBasis hn h x).toBasis.orientation = x


theorem mul_sign : ∀ i : Int, i * sign i = natAbs i


theorem measurable_invariants_dom {f : α → α} {g : α → β} :
    Measurable[invariants f] g ↔ Measurable g ∧ ∀ s, MeasurableSet s → (g ∘ f) ⁻¹' s = g ⁻¹' s

{α : Type u_1}
[MeasurableSpace α]
{β : Type u_2}
[MeasurableSpace β]
{f : α → α}
{g : α → β}

Measurable g ↔ Measurable g ∧ ∀ (s : Set β), MeasurableSet s → g ∘ f ⁻¹' s = g ⁻¹' s


protected theorem pow_pos : 0 < a → ∀ n : ℕ, 0 < a ^ n


theorem isInteger_zero : IsInteger R (0 : S)

{R : Type u_1}
[CommSemiring R]
{S : Type u_2}
[CommSemiring S]
[Algebra R S]


@[to_additive]
theorem mul_mem_lowerBounds_mul {s t : Set M} {a b : M} (ha : a ∈ lowerBounds s)
    (hb : b ∈ lowerBounds t) : a * b ∈ lowerBounds (s * t)

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

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


/-- The type of centroid homomorphisms from `α` to `α`. -/
structure CentroidHom (α : Type*) [NonUnitalNonAssocSemiring α] extends α →+ α where
  /-- Commutativity of centroid homomorphims with left multiplication. -/
  map_mul_left' (a b : α) : toFun (a * b) = a * toFun b
  /-- Commutativity of centroid homomorphims with right multiplication. -/
  map_mul_right' (a b : α) : toFun (a * b) = toFun a * b

{α : Type u_6}
[NonUnitalNonAssocSemiring α]
(self : CentroidHom α)
(a b : α)

(↑self.toAddMonoidHom).toFun (a * b) = (↑self.toAddMonoidHom).toFun a * b


lemma isDiscrete_iff_mem_essImage' {L : A ⥤ Sheaf J A} (adj : L ⊣ (sheafSections J A).obj ⟨t⟩)
    (F : Sheaf J A) :
    IsDiscrete J ht F ↔ F ∈ L.essImage

(J : CategoryTheory.GrothendieckTopology C)

(ht : CategoryTheory.Limits.IsTerminal t)

(adj : L ⊣ (CategoryTheory.sheafSections J A).obj (Opposite.op t))

CategoryTheory.Sheaf.IsDiscrete J ht F ↔ F ∈ L.essImage


theorem mapsTo_omegaLimit {α' β' : Type*} [TopologicalSpace β'] {f : Filter τ} {ϕ : τ → α → β}
    {ϕ' : τ → α' → β'} {ga : α → α'} {s' : Set α'} (hs : MapsTo ga s s') {gb : β → β'}
    (hg : ∀ t x, gb (ϕ t x) = ϕ' t (ga x)) (hgc : Continuous gb) :
    MapsTo gb (ω f ϕ s) (ω f ϕ' s')

{ϕ : τ → α → β}

{ϕ' : τ → α' → β'}

(hg : ∀ (t : τ) (x : α), gb (ϕ t x) = ϕ' t (ga x))

Set.MapsTo gb (omegaLimit f ϕ s) (omegaLimit f ϕ' s')


@[simp, reassoc]
theorem gluedCoverT'_fst_snd (x y z : 𝒰.J) :
    gluedCoverT' 𝒰 x y z ≫ pullback.fst _ _ ≫ pullback.snd _ _ =
      pullback.snd _ _ ≫ pullback.snd _ _

{X : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)
(x y z : 𝒰.J)

𝒰.gluedCoverT' x y z ≫
    CategoryTheory.Limits.pullback.fst (CategoryTheory.Limits.pullback.fst (𝒰.map y) (𝒰.map z))
        (CategoryTheory.Limits.pullback.fst (𝒰.map y) (𝒰.map x)) ≫
      CategoryTheory.Limits.pullback.snd (𝒰.map y) (𝒰.map z) =
  CategoryTheory.Limits.pullback.snd (CategoryTheory.Limits.pullback.fst (𝒰.map x) (𝒰.map y))
      (CategoryTheory.Limits.pullback.fst (𝒰.map x) (𝒰.map z)) ≫
    CategoryTheory.Limits.pullback.snd (𝒰.map x) (𝒰.map z)


@[simp]
theorem sInter_singleton {x : ZFSet.{u}} : ⋂₀ ({x} : ZFSet) = x


lemma slitPlane_arg_ne_pi {z : ℂ} (hz : z ∈ slitPlane) : z.arg ≠ Real.pi


theorem not_surjective_of_ordinal_of_small {α : Type v} [Small.{u} α] (f : α → Ordinal.{u}) :
    ¬Surjective f

{α : Type v}
[Small.{u, v} α]
(f : α → Ordinal.{u})


theorem eq_factors_of_eq_counts {a b : Associates α} (ha : a ≠ 0) (hb : b ≠ 0)
    (h : ∀ p : Associates α, Irreducible p → p.count a.factors = p.count b.factors) :
    a.factors = b.factors

[(p : Associates α) → Decidable (Irreducible p)]

(h : ∀ (p : Associates α), Irreducible p → p.count a.factors = p.count b.factors)


/-- A non-unital subring is closed under subtraction -/
protected theorem sub_mem {x y : R} (hx : x ∈ s) (hy : y ∈ s) : x - y ∈ s

{R : Type u}
[NonUnitalNonAssocRing R]
(s : NonUnitalSubring R)
{x y : R}
(hx : x ∈ s)
(hy : y ∈ s)


theorem inverse_one_sub_norm : (fun t : R => inverse (1 - t)) =O[𝓝 0] (fun _t => 1 : R → ℝ)

{R : Type u_1}
[NormedRing R]
[CompleteSpace R]

(fun t => Ring.inverse (1 - t)) =O[𝓝 0] fun _t => 1


/-- A vector measure on a measurable space `α` is a σ-additive `M`-valued function (for some `M`
an add monoid) such that the empty set and non-measurable sets are mapped to zero. -/
structure VectorMeasure (α : Type*) [MeasurableSpace α] (M : Type*) [AddCommMonoid M]
    [TopologicalSpace M] where
  measureOf' : Set α → M
  empty' : measureOf' ∅ = 0
  not_measurable' ⦃i : Set α⦄ : ¬MeasurableSet i → measureOf' i = 0
  m_iUnion' ⦃f : ℕ → Set α⦄ : (∀ i, MeasurableSet (f i)) → Pairwise (Disjoint on f) →
    HasSum (fun i => measureOf' (f i)) (measureOf' (⋃ i, f i))

(self : MeasureTheory.VectorMeasure α M)


@[to_additive (attr := simp)]
theorem inv_inj : a⁻¹ = b⁻¹ ↔ a = b

{G : Type u_3}
[InvolutiveNeg G]
{a b : G}


lemma ext_inner_iff {A B : E →WOT[𝕜] F} : A = B ↔ ∀ x y, ⟪y, A x⟫_𝕜 = ⟪y, B x⟫_𝕜

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[AddCommGroup E]
[TopologicalSpace E]
[Module 𝕜 E]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
{A B : E →WOT[𝕜]F}

A = B ↔ ∀ (x : E) (y : F), ⟪y, A x⟫_𝕜 = ⟪y, B x⟫_𝕜


@[simp]
theorem comp_assoc (f : InfTopHom γ δ) (g : InfTopHom β γ) (h : InfTopHom α β) :
    (f.comp g).comp h = f.comp (g.comp h)

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
{δ : Type u_6}
[Inf α]
[Top α]
[Inf β]
[Top β]
[Inf γ]
[Top γ]
[Inf δ]
[Top δ]
(f : InfTopHom γ δ)
(g : InfTopHom β γ)
(h : InfTopHom α β)


@[to_additive (attr := simp) norm_pos_iff]
theorem norm_pos_iff'' : 0 < ‖a‖ ↔ a ≠ 1


/-- `smul` is a closed map in the second argument.

The lemma that `smul` is a closed map in the first argument (for a normed space over a complete
normed field) is `isClosedMap_smul_left` in `Analysis.Normed.Module.FiniteDimension`. -/
theorem isClosedMap_smul_of_ne_zero {c : G₀} (hc : c ≠ 0) : IsClosedMap fun x : α => c • x

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


lemma StructuredArrowRightwards.mk_surjective
    (f : w.StructuredArrowRightwards g) :
    ∃ (X₁ : C₁) (a : X₂ ⟶ T.obj X₁) (b : L.obj X₁ ⟶ X₃)
      (comm : R.map a ≫ w.app X₁ ≫ B.map b = g), f = mk w g X₁ a b comm

{C₁ : Type u₁}
{C₂ : Type u₂}
{C₃ : Type u₃}
{C₄ : Type u₄}
[CategoryTheory.Category.{v₁, u₁} C₁]
[CategoryTheory.Category.{v₂, u₂} C₂]
[CategoryTheory.Category.{v₃, u₃} C₃]
[CategoryTheory.Category.{v₄, u₄} C₄]
{T : CategoryTheory.Functor C₁ C₂}
{L : CategoryTheory.Functor C₁ C₃}
{R : CategoryTheory.Functor C₂ C₄}
{B : CategoryTheory.Functor C₃ C₄}
{w : CategoryTheory.TwoSquare T L R B}
{X₂ : C₂}
{X₃ : C₃}
{g : R.obj X₂ ⟶ B.obj X₃}
(f : w.StructuredArrowRightwards g)

∃ X₁ a b,
  ∃ (comm : CategoryTheory.CategoryStruct.comp (R.map a) (CategoryTheory.CategoryStruct.comp (w.app X₁) (B.map b)) = g),
    f = CategoryTheory.TwoSquare.StructuredArrowRightwards.mk w g X₁ a b comm


/-- If `x^n`, `n > 0`, is integer and is not the `n`-th power of an integer, then
`x` is irrational. -/
theorem irrational_nrt_of_notint_nrt {x : ℝ} (n : ℕ) (m : ℤ) (hxr : x ^ n = m)
    (hv : ¬∃ y : ℤ, x = y) (hnpos : 0 < n) : Irrational x

{x : ℝ}
(n : ℕ)
(m : ℤ)
(hxr : x ^ n = ↑m)
(hv : ¬∃ y, x = ↑y)
(hnpos : 0 < n)


/-- Fixed points of iSup of submonoids is intersection -/
theorem fixedPoints_submonoid_iSup {ι : Sort*} {P : ι → Submonoid M} :
    fixedPoints (↥(iSup P)) α = ⋂ i, fixedPoints (P i) α

(M : Type u_1)
(α : Type u_2)
[Monoid M]
[MulAction M α]
{ι : Sort u_3}
{P : ι → Submonoid M}

MulAction.fixedPoints (↥(iSup P)) α = ⋂ i, MulAction.fixedPoints (↥(P i)) α


/-- Given a functor `F` and a collection of limit cones for each diagram `X ↦ F X k`, we can stitch
them together to give a cone for the diagram `F`.
`combinedIsLimit` shows that the new cone is limiting, and `evalCombined` shows it is
(essentially) made up of the original cones.
-/
@[simps]
def combineCones (F : J ⥤ K ⥤ C) (c : ∀ k : K, LimitCone (F.flip.obj k)) : Cone F

(c : (k : K) → CategoryTheory.Limits.LimitCone (F.flip.obj k))

(CategoryTheory.Limits.combineCones F c).pt.obj k = (c k).cone.pt


theorem neg_neg_iff (x y : R) : IsCoprime (-x) (-y) ↔ IsCoprime x y


theorem Relabelling.birthday_congr : ∀ {x y : PGame.{u}}, x ≡r y → birthday x = birthday y

x.Relabelling y → x.birthday = y.birthday


theorem intCast_one : ((1 : Int) : Rat) = (1 : Rat)


protected theorem TopologicalSpace.ext_iff {t t' : TopologicalSpace X} :
    t = t' ↔ ∀ s, IsOpen[t] s ↔ IsOpen[t'] s

{X : Type u}
{t t' : TopologicalSpace X}

t = t' ↔ ∀ (s : Set X), IsOpen s ↔ IsOpen s


@[simp]
theorem image_injective : Injective (image f) ↔ Injective f

Function.Injective (Set.image f) ↔ Function.Injective f


theorem isUnit_right {a b : α} (ha : ¬IsUnit a) (hb : IsUnit b) : multiplicity a b = 0

{α : Type u_1}
[CommMonoid α]
[DecidableRel fun x x_1 => x ∣ x_1]
{a b : α}
(ha : ¬IsUnit a)
(hb : IsUnit b)


theorem closedBall_eq_bInter_ball : closedBall x ε = ⋂ δ > ε, ball x δ

{α : Type u}
[PseudoMetricSpace α]
{x : α}
{ε : ℝ}

Metric.closedBall x ε = ⋂ δ, ⋂ (_ : δ > ε), Metric.ball x δ


theorem bijective_pi_map {F : ∀ i, f i → g i} (hF : ∀ i, Bijective (F i)) :
    Bijective fun x : ∀ i, f i => fun i => F i (x i)

(hF : ∀ (i : I), Function.Bijective (F i))


theorem pure_injective : Injective (pure : α → Ultrafilter α)


/-- The Euler product for Dirichlet L-series, valid for `s.re > 1`.
This version is stated in the form of convergence of finite partial products. -/
theorem dirichletLSeries_eulerProduct {N : ℕ} (χ : DirichletCharacter ℂ N) (hs : 1 < s.re) :
    Tendsto (fun n : ℕ ↦ ∏ p ∈ primesBelow n, (1 - χ p * (p : ℂ) ^ (-s))⁻¹) atTop
      (𝓝 (L ↗χ s))

{s : ℂ}
{N : ℕ}
(χ : DirichletCharacter ℂ N)
(hs : 1 < s.re)

Filter.Tendsto (fun n => ∏ p ∈ n.primesBelow, (1 - χ ↑p * ↑p ^ (-s))⁻¹) Filter.atTop (𝓝 (L (fun n => χ ↑n) s))


@[simp]
theorem comp_base {X Y Z : PresheafedSpace C} (f : X ⟶ Y) (g : Y ⟶ Z) :
    (f ≫ g).base = f.base ≫ g.base

{X Y Z : AlgebraicGeometry.PresheafedSpace C}


/-- The induction step for the existence and uniqueness of the
circumcenter.  Given a nonempty set of points in a nonempty affine
subspace whose direction is complete, such that there is a unique
(circumcenter, circumradius) pair for those points in that subspace,
and a point `p` not in that subspace, there is a unique (circumcenter,
circumradius) pair for the set with `p` added, in the span of the
subspace with `p` added. -/
theorem existsUnique_dist_eq_of_insert {s : AffineSubspace ℝ P}
    [HasOrthogonalProjection s.direction] {ps : Set P} (hnps : ps.Nonempty) {p : P} (hps : ps ⊆ s)
    (hp : p ∉ s) (hu : ∃! cs : Sphere P, cs.center ∈ s ∧ ps ⊆ (cs : Set P)) :
    ∃! cs₂ : Sphere P,
      cs₂.center ∈ affineSpan ℝ (insert p (s : Set P)) ∧ insert p ps ⊆ (cs₂ : Set P)

(hu : ∃! cs, cs.center ∈ s ∧ ps ⊆ Metric.sphere cs.center cs.radius)

∃! cs₂, cs₂.center ∈ affineSpan ℝ (insert p ↑s) ∧ insert p ps ⊆ Metric.sphere cs₂.center cs₂.radius


theorem facets_subset : K.facets ⊆ K.faces

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{K : Geometry.SimplicialComplex 𝕜 E}


@[to_additive]
theorem eq_empty_or_univ_of_smul_invariant_closed [IsMinimal M α] {s : Set α} (hs : IsClosed s)
    (hsmul : ∀ c : M, c • s ⊆ s) : s = ∅ ∨ s = univ

(M : Type u_1)
{α : Type u_3}
[Monoid M]
[TopologicalSpace α]
[MulAction M α]
[MulAction.IsMinimal M α]
{s : Set α}
(hs : IsClosed s)
(hsmul : ∀ (c : M), c • s ⊆ s)


theorem thickenedIndicatorAux_one (δ : ℝ) (E : Set α) {x : α} (x_in_E : x ∈ E) :
    thickenedIndicatorAux δ E x = 1

{α : Type u_1}
[PseudoEMetricSpace α]
(δ : ℝ)
(E : Set α)
{x : α}
(x_in_E : x ∈ E)


theorem le_hitting_of_exists {m : ι} (h_exists : ∃ j ∈ Set.Icc n m, u j ω ∈ s) :
    n ≤ hitting u s n m ω

{u : ι → Ω → β}


@[reassoc (attr := simp)]
theorem whiskerLeft_hom_inv (f : a ⟶ b) {g h : b ⟶ c} (η : g ≅ h) :
    f ◁ η.hom ≫ f ◁ η.inv = 𝟙 (f ≫ g)

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

CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerLeft f η.hom)
    (CategoryTheory.Bicategory.whiskerLeft f η.inv) =
  CategoryTheory.CategoryStruct.id (CategoryTheory.CategoryStruct.comp f g)


theorem csInf_le' (h : a ∈ s) : sInf s ≤ a

{α : Type u_1}
[ConditionallyCompleteLinearOrderBot α]
{s : Set α}
{a : α}
(h : a ∈ s)


@[simp]
lemma engel_zero : engel R (0 : L) = ⊤

(R : Type u_1)
{L : Type u_2}
[CommRing R]
[LieRing L]
[LieAlgebra R L]


/-- GCD monoid: a `CancelCommMonoidWithZero` with `gcd` (greatest common divisor) and
`lcm` (least common multiple) operations, determined up to a unit. The type class focuses on `gcd`
and we derive the corresponding `lcm` facts from `gcd`.
-/
class GCDMonoid (α : Type*) [CancelCommMonoidWithZero α] where
  /-- The greatest common divisor between two elements. -/
  gcd : α → α → α
  /-- The least common multiple between two elements. -/
  lcm : α → α → α
  /-- The GCD is a divisor of the first element. -/
  gcd_dvd_left : ∀ a b, gcd a b ∣ a
  /-- The GCD is a divisor of the second element. -/
  gcd_dvd_right : ∀ a b, gcd a b ∣ b
  /-- Any common divisor of both elements is a divisor of the GCD. -/
  dvd_gcd : ∀ {a b c}, a ∣ c → a ∣ b → a ∣ gcd c b
  /-- The product of two elements is `Associated` with the product of their GCD and LCM. -/
  gcd_mul_lcm : ∀ a b, Associated (gcd a b * lcm a b) (a * b)
  /-- `0` is left-absorbing. -/
  lcm_zero_left : ∀ a, lcm 0 a = 0
  /-- `0` is right-absorbing. -/
  lcm_zero_right : ∀ a, lcm a 0 = 0

{α : Type u_2}
[CancelCommMonoidWithZero α]
[self : GCDMonoid α]
(a : α)


theorem next_get : ∀ (l : List α) (_h : Nodup l) (i : Fin l.length),
    next l (l.get i) (get_mem _ _ _) = l.get ⟨(i + 1) % l.length,
      Nat.mod_lt _ (i.1.zero_le.trans_lt i.2)⟩

{α : Type u_1}
[DecidableEq α]
(l : List α)
(_h : l.Nodup)
(i : Fin l.length)

l.next (l.get i) ⋯ = l.get ⟨(↑i + 1) % l.length, ⋯⟩


@[to_additive mem_leftAddCoset]
theorem mem_leftCoset {s : Set α} {x : α} (a : α) (hxS : x ∈ s) : a * x ∈ a • s

{α : Type u_1}
[Mul α]
{s : Set α}
{x : α}
(a : α)
(hxS : x ∈ s)


theorem IsAtomic.castLE {h : l ≤ n} (hφ : IsAtomic φ) : (φ.castLE h).IsAtomic

{L : FirstOrder.Language}
{α : Type u'}
{n l : ℕ}
{φ : L.BoundedFormula α l}
{h : l ≤ n}
(hφ : φ.IsAtomic)


theorem fderivWithin_mem_iff {f : E → F} {t : Set E} {s : Set (E →L[𝕜] F)} {x : E} :
    fderivWithin 𝕜 f t x ∈ s ↔
      DifferentiableWithinAt 𝕜 f t x ∧ fderivWithin 𝕜 f t x ∈ s ∨
        ¬DifferentiableWithinAt 𝕜 f t x ∧ (0 : E →L[𝕜] F) ∈ s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{t : Set E}
{s : Set (E →L[𝕜] F)}
{x : E}

fderivWithin 𝕜 f t x ∈ s ↔
  DifferentiableWithinAt 𝕜 f t x ∧ fderivWithin 𝕜 f t x ∈ s ∨ ¬DifferentiableWithinAt 𝕜 f t x ∧ 0 ∈ s


@[simp]
theorem mapMatrix_refl : AlgEquiv.refl.mapMatrix = (AlgEquiv.refl : Matrix m m α ≃ₐ[R] _)

{m : Type u_2}
{R : Type u_7}
{α : Type v}
[Fintype m]
[DecidableEq m]
[CommSemiring R]
[Semiring α]
[Algebra R α]


theorem re_T_inv_smul : (T⁻¹ • z).re = z.re - 1


theorem div_gcd_pos_of_pos_left (b : Nat) (h : 0 < a) : 0 < a / a.gcd b


theorem lintegral_subtype_comap {s : Set α} (hs : MeasurableSet s) (f : α → ℝ≥0∞) :
    ∫⁻ x : s, f x ∂(μ.comap (↑)) = ∫⁻ x in s, f x ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
(hs : MeasurableSet s)
(f : α → ℝ≥0∞)

∫⁻ (x : ↑s), f ↑x ∂MeasureTheory.Measure.comap Subtype.val μ = ∫⁻ (x : α) in s, f x ∂μ


theorem exists_isBounded_image_of_tendsto {α β : Type*} [PseudoMetricSpace β]
    {l : Filter α} {f : α → β} {x : β} (hf : Tendsto f l (𝓝 x)) :
    ∃ s ∈ l, IsBounded (f '' s)

{α : Type u_3}
{β : Type u_4}
[PseudoMetricSpace β]
{l : Filter α}
{f : α → β}
{x : β}
(hf : Filter.Tendsto f l (𝓝 x))


@[simp]
theorem Fin.circulant_inj {n} {v w : Fin n → α} : circulant v = circulant w ↔ v = w

{α : Type u_1}
{n : ℕ}
{v w : Fin n → α}

Matrix.circulant v = Matrix.circulant w ↔ v = w


theorem BddBelow.bddBelow_image2_of_bddAbove :
    BddBelow s → BddAbove t → BddBelow (Set.image2 f s t)

{f : α → β → γ}

(h₀ : ∀ (b : β), Monotone (Function.swap f b))


theorem CharP.neg_one_pow_char [Ring R] (p : ℕ) [CharP R p] [Fact p.Prime] :
    (-1 : R) ^ p = -1

(R : Type u_1)
[Ring R]
(p : ℕ)
[CharP R p]
[Fact (Nat.Prime p)]


theorem ae_dirac_iff {a : α} {p : α → Prop} (hp : MeasurableSet { x | p x }) :
    (∀ᵐ x ∂dirac a, p x) ↔ p a

{α : Type u_1}
[MeasurableSpace α]
{a : α}
{p : α → Prop}
(hp : MeasurableSet {x | p x})

(∀ᵐ (x : α) ∂MeasureTheory.Measure.dirac a, p x) ↔ p a


theorem op_unop (P : MorphismProperty Cᵒᵖ) : P.unop.op = P

(P : CategoryTheory.MorphismProperty Cᵒᵖ)


@[simp]
theorem Functorial.map_comp {F : C → D} [Functorial.{v₁, v₂} F] {X Y Z : C} {f : X ⟶ Y}
    {g : Y ⟶ Z} : map F (f ≫ g) = map F f ≫ map F g

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F : C → D}
[CategoryTheory.Functorial F]
{X Y Z : C}
{f : X ⟶ Y}
{g : Y ⟶ Z}

CategoryTheory.map F (CategoryTheory.CategoryStruct.comp f g) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.map F f) (CategoryTheory.map F g)


/-- Weighted generalized mean inequality, version for sums over finite sets, with `ℝ≥0`-valued
functions and real exponents. -/
theorem rpow_arith_mean_le_arith_mean_rpow (w z : ι → ℝ≥0) (hw' : ∑ i ∈ s, w i = 1) {p : ℝ}
    (hp : 1 ≤ p) : (∑ i ∈ s, w i * z i) ^ p ≤ ∑ i ∈ s, w i * z i ^ p

{ι : Type u}
(s : Finset ι)
(w z : ι → ℝ≥0)
(hw' : ∑ i ∈ s, w i = 1)
{p : ℝ}
(hp : 1 ≤ p)


@[simp, norm_cast]
theorem coe_iInf {ι : Sort*} (S : ι → IntermediateField F E) : (↑(iInf S) : Set E) = ⋂ i, S i

{F : Type u_1}
[Field F]
{E : Type u_2}
[Field E]
[Algebra F E]
{ι : Sort u_3}
(S : ι → IntermediateField F E)


/-- If `f` is a commutative operation on bools such that `f false false = false`, then `bitwise f`
    is also commutative. -/
theorem bitwise_comm {f : Bool → Bool → Bool} (hf : ∀ b b', f b b' = f b' b) (n m : ℕ) :
    bitwise f n m = bitwise f m n

{f : Bool → Bool → Bool}
(hf : ∀ (b b' : Bool), f b b' = f b' b)
(n m : ℕ)


theorem Lex.wellFounded (hbot : ∀ ⦃i a⦄, ¬s i a 0) (hs : ∀ i, WellFounded (s i))
    (hr : WellFounded <| rᶜ ⊓ (· ≠ ·)) : WellFounded (DFinsupp.Lex r s)

(hr : WellFounded (rᶜ ⊓ fun x x_1 => x ≠ x_1))


lemma galRestrict_apply (σ : L ≃ₐ[K] L) (x : B) :
    galRestrict A K L B σ x = galRestrictHom A K L B σ x

(A : Type u_1)
{K : Type u_2}
{L : Type u_3}
{B : Type u_4}
[CommRing A]
[CommRing B]
[Algebra A B]
[Field K]
[Field L]
[Algebra A K]
[IsFractionRing A K]
[Algebra B L]
[Algebra K L]
[Algebra A L]
[IsScalarTower A B L]
[IsScalarTower A K L]
[IsIntegralClosure B A L]
[FiniteDimensional K L]
(σ : L ≃ₐ[K] L)
(x : B)

((galRestrict A K L B) σ) x = ((galRestrictHom A K L B) ↑σ) x


@[simp]
lemma toColumns₁_apply (A : Matrix m (n₁ ⊕ n₂) R) (i : m) (j : n₁) :
    (toColumns₁ A) i j = A i (Sum.inl j)

{R : Type u_1}
{m : Type u_2}
{n₁ : Type u_6}
{n₂ : Type u_7}
(A : Matrix m (n₁ ⊕ n₂) R)
(i : m)
(j : n₁)


/-- Definition of `x ≤ y` on pre-games, in terms of `⧏`.

The ordering here is chosen so that `And.left` refer to moves by Left, and `And.right` refer to
moves by Right. -/
theorem le_iff_forall_lf {x y : PGame} :
    x ≤ y ↔ (∀ i, x.moveLeft i ⧏ y) ∧ ∀ j, x ⧏ y.moveRight j

x ≤ y ↔ (∀ (i : x.LeftMoves), (x.moveLeft i).LF y) ∧ ∀ (j : y.RightMoves), x.LF (y.moveRight j)


protected theorem neg {B : BilinForm R₁ M₁} (hB : B.IsAlt) : (-B).IsAlt

{R₁ : Type u_3}
{M₁ : Type u_4}
[CommRing R₁]
[AddCommGroup M₁]
[Module R₁ M₁]
{B : LinearMap.BilinForm R₁ M₁}
(hB : B.IsAlt)


theorem Ioi_inter_Iic : Ioi a ∩ Iic b = Ioc a b


theorem exists_eq_insert_iff [DecidableEq α] {s t : Finset α} :
    (∃ a ∉ s, insert a s = t) ↔ s ⊆ t ∧ s.card + 1 = t.card

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


@[nontriviality]
theorem monic_of_subsingleton [Subsingleton R] (p : R[X]) : Monic p

{R : Type u}
[Semiring R]
[Subsingleton R]
(p : R[X])


@[simp]
theorem _root_.Polynomial.algebraMap_hahnSeries_apply (f : R[X]) :
    algebraMap R[X] (HahnSeries Γ R) f = ofPowerSeries Γ R f

(Γ : Type u_1)
{R : Type u_2}
[CommSemiring R]
[StrictOrderedSemiring Γ]
(f : R[X])

(algebraMap R[X] (HahnSeries Γ R)) f = (HahnSeries.ofPowerSeries Γ R) ↑f


/-- Affine equivalences preserve affine independence of subsets. -/
theorem AffineEquiv.affineIndependent_set_of_eq_iff {s : Set P} (e : P ≃ᵃ[k] P₂) :
    AffineIndependent k ((↑) : e '' s → P₂) ↔ AffineIndependent k ((↑) : s → P)

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

AffineIndependent k Subtype.val ↔ AffineIndependent k Subtype.val


/-- Induction principle for `Finset`s in any type from which a given function `f` maps to a linearly
ordered type : a predicate is true on all `s : Finset α` provided that:

* it is true on the empty `Finset`,
* for every `s : Finset α` and an element `a` such that for elements of `s` denoted by `x` we have
  `f x ≤ f a`, `p s` implies `p (insert a s)`. -/
@[elab_as_elim]
theorem induction_on_max_value [DecidableEq ι] (f : ι → α) {p : Finset ι → Prop} (s : Finset ι)
    (h0 : p ∅) (step : ∀ a s, a ∉ s → (∀ x ∈ s, f x ≤ f a) → p s → p (insert a s)) : p s

(step : ∀ (a : ι) (s : Finset ι), a ∉ s → (∀ x ∈ s, f x ≤ f a) → p s → p (insert a s))


@[simp]
theorem _root_.Homeomorph.opensCongr_symm (f : α ≃ₜ β) : f.opensCongr.symm = f.symm.opensCongr

{α : Type u_2}
{β : Type u_3}
[TopologicalSpace α]
[TopologicalSpace β]
(f : α ≃ₜ β)


@[simps]
instance right' (f g : a ⟶ b) [BicategoricalCoherence f g] :
    BicategoricalCoherence f (g ≫ 𝟙 b)


@[simp] protected theorem le_refl (a : Char) : a ≤ a


theorem _root_.IsSMulRegular.pi {α : Type*} [∀ i, SMul α <| f i] {k : α}
    (hk : ∀ i, IsSMulRegular (f i) k) : IsSMulRegular (∀ i, f i) k

{I : Type u}
{f : I → Type v}
{α : Type u_1}
[(i : I) → SMul α (f i)]
{k : α}
(hk : ∀ (i : I), IsSMulRegular (f i) k)