theorem Int.fract_periodic (α) [LinearOrderedRing α] [FloorRing α] :
    Function.Periodic Int.fract (1 : α)

(α : Type u_4)
[LinearOrderedRing α]
[FloorRing α]


@[simp] lemma pointwise_vadd_top (v : V) : v +ᵥ (⊤ : AffineSubspace k P) = ⊤

{k : Type u_1}
[Ring k]
{V : Type u_2}
{P : Type u_3}
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
(v : V)


/-- **Rearrangement Inequality**: Pointwise scalar multiplication of `f` and `g` is maximized when
`f` and `g` monovary together. Stated by permuting the entries of `f`. -/
theorem Monovary.sum_comp_perm_smul_le_sum_smul (hfg : Monovary f g) :
    ∑ i, f (σ i) • g i ≤ ∑ i, f i • g i

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedRing α]
[LinearOrderedAddCommGroup β]
[Module α β]
[OrderedSMul α β]
{σ : Equiv.Perm ι}
{f : ι → α}
{g : ι → β}
[Fintype ι]
(hfg : Monovary f g)

∑ i : ι, f (σ i) • g i ≤ ∑ i : ι, f i • g i


@[simp]
lemma map'_id : map' (MonoidHom.id β) = MonoidHom.id (WithZero β)

↑(WithZero.map' (MonoidHom.id β)) = MonoidHom.id (WithZero β)


@[to_additive]
theorem leftRel_eq : @Setoid.r _ (leftRel s) = fun x y => x⁻¹ * y ∈ s

{α : Type u_1}
[AddGroup α]
(s : AddSubgroup α)


theorem cutMap_nonempty (a : α) : (cutMap β a).Nonempty

{α : Type u_2}
(β : Type u_3)
[LinearOrderedField α]
[LinearOrderedField β]
[Archimedean α]
(a : α)


@[simp, nolint simpNF, norm_cast] lemma natCast_eq_zero {n : ℕ} : (n : ℚ) = 0 ↔ n = 0


/-- **Darboux's theorem**: if `a ≤ b` and `f' b ≤ m ≤ f' a`, then `f' c = m` for some
`c ∈ [a, b]`. -/
theorem exists_hasDerivWithinAt_eq_of_le_of_ge (hab : a ≤ b)
    (hf : ∀ x ∈ Icc a b, HasDerivWithinAt f (f' x) (Icc a b) x) {m : ℝ} (hma : f' a ≤ m)
    (hmb : m ≤ f' b) : m ∈ f' '' Icc a b

(hf : ∀ x ∈ Set.Icc a b, HasDerivWithinAt f (f' x) (Set.Icc a b) x)


theorem eq_univ_of_coe_eq (hγ : (γ : Set α) = β) : γ = univ

(hγ :
  (do
      let a ← γ
      pure ↑a) =
    β)


@[to_additive (attr := simp) norm_le_zero_iff]
theorem norm_le_zero_iff'' : ‖a‖ ≤ 0 ↔ a = 1


@[simp]
theorem leadingCoeff_one [MulZeroOneClass R] : (1 : HahnSeries Γ R).leadingCoeff = 1

{Γ : Type u_1}
{R : Type u_3}
[Zero Γ]
[PartialOrder Γ]
[MulZeroOneClass R]


lemma lt_of_le_of_ne' {a b : A} [PartialOrder A] :
    (a : A) ≤ b → b ≠ a → a < b

{A : Type u_1}
{a b : A}
[PartialOrder A]


/-- The Clifford algebra over an orthogonal direct sum of quadratic vector spaces is isomorphic
as an algebra to the graded tensor product of the Clifford algebras of each space.

This is `CliffordAlgebra.toProd` and `CliffordAlgebra.ofProd` as an equivalence. -/
@[simps!]
def prodEquiv : CliffordAlgebra (Q₁.prod Q₂) ≃ₐ[R] (evenOdd Q₁ ᵍ⊗[R] evenOdd Q₂)

(a : CliffordAlgebra.evenOdd Q₁ ᵍ⊗[R] CliffordAlgebra.evenOdd Q₂)

(CliffordAlgebra.prodEquiv Q₁ Q₂).symm a = (CliffordAlgebra.toProd Q₁ Q₂) a


/-- The equivalence `(X ⟶ Y) ≃ (F.obj X ⟶ F.obj Y)` given by `h : F.FullyFaithful`. -/
@[simps]
def homEquiv {X Y : C} : (X ⟶ Y) ≃ (F.obj X ⟶ F.obj Y)

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


@[simp]
theorem renameEquiv_symm (f : σ ≃ τ) : (renameEquiv R f).symm = renameEquiv R f.symm

{σ : Type u_1}
{τ : Type u_2}
(R : Type u_4)
[CommSemiring R]
(f : σ ≃ τ)

(MvPolynomial.renameEquiv R f).symm = MvPolynomial.renameEquiv R f.symm


theorem mem_nhdsWithin_insert {a : α} {s t : Set α} : t ∈ 𝓝[insert a s] a ↔ a ∈ t ∧ t ∈ 𝓝[s] a

{α : Type u_1}
[TopologicalSpace α]
{a : α}
{s t : Set α}


theorem isNat_pow {α} [Semiring α] : ∀ {f : α → ℕ → α} {a : α} {b a' b' c : ℕ},
    f = HPow.hPow → IsNat a a' → IsNat b b' → Nat.pow a' b' = c → IsNat (f a b) c

{α : Type u_1}
[Semiring α]
{f : α → ℕ → α}
{a : α}
{b a' b' c : ℕ}

f = HPow.hPow →
  Mathlib.Meta.NormNum.IsNat a a' →
    Mathlib.Meta.NormNum.IsNat b b' → a'.pow b' = c → Mathlib.Meta.NormNum.IsNat (f a b) c


theorem eval_πs_image' {l : Products I} {o₁ o₂ : Ordinal} (h : o₁ ≤ o₂)
    (hl : ∀ i ∈ l.val, ord I i < o₁) : eval (π C (ord I · < o₂)) '' { m | m < l } =
    (πs' C h) '' (eval (π C (ord I · < o₁)) '' { m | m < l })

{l : Profinite.NobelingProof.Products I}

(hl : ∀ i ∈ ↑l, Profinite.NobelingProof.ord I i < o₁)

Profinite.NobelingProof.Products.eval (Profinite.NobelingProof.π C fun x => Profinite.NobelingProof.ord I x < o₂) ''
    {m | m < l} =
  ⇑(Profinite.NobelingProof.πs' C h) ''
    (Profinite.NobelingProof.Products.eval
        (Profinite.NobelingProof.π C fun x => Profinite.NobelingProof.ord I x < o₁) ''
      {m | m < l})


@[ext]
theorem ext {v₁ v₂ : Valuation R Γ₀} (h : ∀ r, v₁ r = v₂ r) : v₁ = v₂

{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedCommMonoidWithZero Γ₀]
{v₁ v₂ : Valuation R Γ₀}
(h : ∀ (r : R), v₁ r = v₂ r)


theorem Zigzag.of_zag {j₁ j₂ : J} (h : Zag j₁ j₂) : Zigzag j₁ j₂

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{j₁ j₂ : J}
(h : CategoryTheory.Zag j₁ j₂)


/-- A 1-hypercover in `C` is preserved by a functor `F : C ⥤ D` if the mapped 1-pre-hypercover
in `D` is a 1-hypercover for the given topology on `D`. -/
class IsPreservedBy (F : C ⥤ D) (K : GrothendieckTopology D) : Prop where
  mem₀ : (E.toPreOneHypercover.map F).sieve₀ ∈ K (F.obj X)
  mem₁ (i₁ i₂ : E.I₀) ⦃W : D⦄ (p₁ : W ⟶ F.obj (E.X i₁)) (p₂ : W ⟶ F.obj (E.X i₂))
    (w : p₁ ≫ F.map (E.f i₁) = p₂ ≫ F.map (E.f i₂)) :
      (E.toPreOneHypercover.map F).sieve₁ p₁ p₂ ∈ K W

{J : CategoryTheory.GrothendieckTopology C}

{K : CategoryTheory.GrothendieckTopology D}

(w : CategoryTheory.CategoryStruct.comp p₁ (F.map (E.f i₁)) = CategoryTheory.CategoryStruct.comp p₂ (F.map (E.f i₂)))


/-- The integral of a nonnegative function w.r.t. a volume generated by a locally-finite measure is
nonnegative. -/
theorem integral_nonneg {g : ℝⁿ → ℝ} (hg : ∀ x ∈ Box.Icc I, 0 ≤ g x) (μ : Measure ℝⁿ)
    [IsLocallyFiniteMeasure μ] : 0 ≤ integral I l g μ.toBoxAdditive.toSMul

(hg : ∀ x ∈ BoxIntegral.Box.Icc I, 0 ≤ g x)

0 ≤ BoxIntegral.integral I l g μ.toBoxAdditive.toSMul


@[to_additive (attr := ext)]
theorem hom_eq ⦃f g : FreeMonoid α →* M⦄ (h : ∀ x, f (of x) = g (of x)) : f = g

(h : ∀ (x : α), f (FreeMonoid.of x) = g (FreeMonoid.of x))


@[to_additive]
lemma update_smul [∀ i, SMul M (α i)] [DecidableEq ι] (c : M) (f₁ : ∀ i, α i)
    (i : ι) (x₁ : α i) : update (c • f₁) i (c • x₁) = c • update f₁ i x₁

{ι : Type u_1}
{M : Type u_2}
{α : ι → Type u_4}
[(i : ι) → VAdd M (α i)]
[DecidableEq ι]
(c : M)
(f₁ : (i : ι) → α i)
(i : ι)
(x₁ : α i)

Function.update (c +ᵥ f₁) i (c +ᵥ x₁) = c +ᵥ Function.update f₁ i x₁


@[simp]
theorem coe_range (φ : F) :
    ((NonUnitalAlgHom.range φ : NonUnitalSubalgebra R B) : Set B) = Set.range (φ : A → B)

{F : Type v'}
{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
[NonUnitalNonAssocSemiring B]
[Module R B]
[FunLike F A B]
[NonUnitalAlgHomClass F R A B]
(φ : F)

↑(NonUnitalAlgHom.range φ) = Set.range ⇑φ


theorem withTopEquiv_le {x y : PartENat} : withTopEquiv x ≤ withTopEquiv y ↔ x ≤ y

PartENat.withTopEquiv x ≤ PartENat.withTopEquiv y ↔ x ≤ y


@[to_additive (attr := simp) const_nonneg]
theorem one_le_const : 1 ≤ const β a ↔ 1 ≤ a

{α : Type u_3}
{β : Type u_4}
[Zero α]
[Preorder α]
{a : α}
[Nonempty β]


/-- The pushforward of an open cover along an isomorphism. -/
@[simps! J obj map]
def OpenCover.pushforwardIso {X Y : Scheme.{u}} (𝒰 : OpenCover.{v} X) (f : X ⟶ Y) [IsIso f] :
    OpenCover.{v} Y

{X Y : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)
(f : X ⟶ Y)
[CategoryTheory.IsIso f]

∀ (x : 𝒰.J), (𝒰.pushforwardIso f).map x = 𝒰.map x ≫ f


theorem isNat_minFac_3 : {n n' : ℕ} → (k : ℕ) →
    IsNat n n' → MinFacHelper n' k → nat_lit 0 = n' % k → IsNat (minFac n) k

Mathlib.Meta.NormNum.IsNat n n' →
  Mathlib.Meta.NormNum.MinFacHelper n' k → 0 = n' % k → Mathlib.Meta.NormNum.IsNat n.minFac k


theorem UniformContinuous.inf_dom_left {f : α → β} {u₁ u₂ : UniformSpace α} {u₃ : UniformSpace β}
    (hf : UniformContinuous[u₁, u₃] f) : UniformContinuous[u₁ ⊓ u₂, u₃] f

{α : Type ua}
{β : Type ub}
{f : α → β}
{u₁ u₂ : UniformSpace α}
{u₃ : UniformSpace β}
(hf : UniformContinuous f)


theorem addVal_le_of_coeff_ne_zero {x : HahnSeries Γ R} {g : Γ} (h : x.coeff g ≠ 0) :
    addVal Γ R x ≤ g

{Γ : Type u_1}
{R : Type u_2}
[LinearOrderedCancelAddCommMonoid Γ]
[Ring R]
[IsDomain R]
{x : HahnSeries Γ R}
{g : Γ}
(h : x.coeff g ≠ 0)


/-- The main characterization theorem for multiplicative principal ordinals. -/
theorem principal_mul_iff_le_two_or_omega_opow_opow {o : Ordinal} :
    Principal (· * ·) o ↔ o ≤ 2 ∨ ∃ a : Ordinal, o = (omega^omega^a)

Ordinal.Principal (fun x x_1 => x * x_1) o ↔ o ≤ 2 ∨ ∃ a, o = Ordinal.omega ^ Ordinal.omega ^ a


@[simp]
lemma bitwise_bit {f : Bool → Bool → Bool} (h : f false false = false := by rfl) (a m b n) :
    bitwise f (bit a m) (bit b n) = bit (f a b) (bitwise f m n)

{f : Bool → Bool → Bool}
(h : f false false = false := by rfl)
(a : Bool)
(m : ℕ)
(b : Bool)
(n : ℕ)

Nat.bitwise f (Nat.bit a m) (Nat.bit b n) = Nat.bit (f a b) (Nat.bitwise f m n)


theorem extend_injective (hf : Injective f) (e' : β → γ) : Injective fun g ↦ extend f g e'

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
{f : α → β}
(hf : Function.Injective f)
(e' : β → γ)

Function.Injective fun g => Function.extend f g e'


theorem subset_antisymm_iff [IsRefl α (· ⊆ ·)] [IsAntisymm α (· ⊆ ·)] : a = b ↔ a ⊆ b ∧ b ⊆ a

{α : Type u}
[HasSubset α]
{a b : α}
[IsRefl α fun x x_1 => x ⊆ x_1]
[IsAntisymm α fun x x_1 => x ⊆ x_1]


@[simp]
theorem card_ne_zero [Nonempty α] : card α ≠ 0


theorem le_dualAnnihilator_dualCoannihilator (U : Submodule R M) :
    U ≤ U.dualAnnihilator.dualCoannihilator

{R : Type u}
{M : Type v}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(U : Submodule R M)


theorem contDiffOn_succ_iff_hasFDerivWithin {n : ℕ} (hs : UniqueDiffOn 𝕜 s) :
    ContDiffOn 𝕜 (n + 1 : ℕ) f s ↔
      ∃ f' : E → E →L[𝕜] F, ContDiffOn 𝕜 n f' s ∧ ∀ x, x ∈ s → HasFDerivWithinAt f (f' x) s x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{s : Set E}
{f : E → F}
{n : ℕ}
(hs : UniqueDiffOn 𝕜 s)

ContDiffOn 𝕜 (↑(n + 1)) f s ↔ ∃ f', ContDiffOn 𝕜 (↑n) f' s ∧ ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x


theorem cos_lt_one_div_sqrt_sq_add_one {x : ℝ} (hx1 : -(3 * π / 2) ≤ x) (hx2 : x ≤ 3 * π / 2)
    (hx3 : x ≠ 0) : cos x < (1 / √(x ^ 2 + 1) : ℝ)


theorem dist_le (p : G.Walk u v) : G.dist u v ≤ p.length

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


/-- See also `Nat.card_addSubgroupZPowers`. -/
@[to_additive "See also `Nat.card_subgroup`."]
theorem Fintype.card_zpowers : Fintype.card (zpowers x) = orderOf x

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

Fintype.card ↥(AddSubgroup.zmultiples x) = addOrderOf x


theorem setIntegral_comp_smul_of_pos (f : E → F) {R : ℝ} (s : Set E) (hR : 0 < R) :
    ∫ x in s, f (R • x) ∂μ = (R ^ finrank ℝ E)⁻¹ • ∫ x in R • s, f x ∂μ

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[MeasurableSpace E]
[BorelSpace E]
[FiniteDimensional ℝ E]
(μ : MeasureTheory.Measure E)
[μ.IsAddHaarMeasure]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
(f : E → F)
{R : ℝ}
(s : Set E)
(hR : 0 < R)

∫ (x : E) in s, f (R • x) ∂μ = (R ^ FiniteDimensional.finrank ℝ E)⁻¹ • ∫ (x : E) in R • s, f x ∂μ


theorem mem_integer_iff (x : K) : x ∈ (valuation A K).integer ↔ ∃ a : A, algebraMap A K a = x

(A : Type u)
[CommRing A]
(K : Type v)
[Field K]
[Algebra A K]
[IsDomain A]
[ValuationRing A]
[IsFractionRing A K]
(x : K)

x ∈ (ValuationRing.valuation A K).integer ↔ ∃ a, (algebraMap A K) a = x


@[to_additive (attr := simp)]
theorem lift_ofList (f : α → M) (l : List α) : lift f (ofList l) = (l.map f).prod

{α : Type u_1}
{M : Type u_4}
[Monoid M]
(f : α → M)
(l : List α)

(FreeMonoid.lift f) (FreeMonoid.ofList l) = (List.map f l).prod


@[simp]
theorem sdiff_symmDiff_right : b \ a ∆ b = a ⊓ b

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


theorem functor_id_comp {F} [AF : Functor F] [LawfulFunctor F] : @Comp.functor Id F _ _ = AF

{F : Type u_1 → Type u_2}
[AF : Functor F]
[LawfulFunctor F]


@[simp]
theorem cast_succ [AddGroupWithOne α] (n) : ((succ n : ZNum) : α) = n + 1

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


theorem _root_.schwartz_withSeminorms : WithSeminorms (schwartzSeminormFamily 𝕜 E F)

(𝕜 : Type u_1)
(E : Type u_4)
(F : Type u_5)
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
[NormedField 𝕜]
[NormedSpace 𝕜 F]
[SMulCommClass ℝ 𝕜 F]


theorem nilradical_le_prime (J : Ideal R) [H : J.IsPrime] : nilradical R ≤ J

{R : Type u_1}
[CommSemiring R]
(J : Ideal R)
[H : J.IsPrime]


theorem isOfFinOrder_ofAdd_iff {α : Type*} [AddMonoid α] {x : α} :
    IsOfFinOrder (Multiplicative.ofAdd x) ↔ IsOfFinAddOrder x


/-- Any `CommMagma G` that satisfies `IsLeftCancelMul G` also satisfies `IsRightCancelMul G`. -/
@[to_additive AddCommMagma.IsLeftCancelAdd.toIsRightCancelAdd "Any `AddCommMagma G` that satisfies
`IsLeftCancelAdd G` also satisfies `IsRightCancelAdd G`."]
lemma CommMagma.IsLeftCancelMul.toIsRightCancelMul (G : Type u) [CommMagma G] [IsLeftCancelMul G] :
    IsRightCancelMul G


@[simp]
theorem map (f : R →+* S) (n ν : ℕ) :
    (bernsteinPolynomial R n ν).map f = bernsteinPolynomial S n ν

{R : Type u_1}
[CommRing R]
{S : Type u_2}
[CommRing S]
(f : R →+* S)
(n ν : ℕ)

Polynomial.map f (bernsteinPolynomial R n ν) = bernsteinPolynomial S n ν


@[simp]
nonrec theorem compl_compl (s : UpperSet α) : s.compl.compl = s


@[simp] lemma abs_qsmul [Module ℚ α] [PosSMulMono ℚ α] (q : ℚ) (a : α) :
    |q • a| = |q| • |a|

{α : Type u_1}
[LinearOrderedAddCommGroup α]
[Module ℚ α]
[PosSMulMono ℚ α]
(q : ℚ)
(a : α)


/-- An n-ary version of `Set.mul_subset_mul`. -/
@[to_additive " An n-ary version of `Set.add_subset_add`. "]
theorem list_prod_subset_list_prod (t : List ι) (f₁ f₂ : ι → Set α) (hf : ∀ i ∈ t, f₁ i ⊆ f₂ i) :
    (t.map f₁).prod ⊆ (t.map f₂).prod

{ι : Type u_1}
{α : Type u_2}
[CommMonoid α]
(t : List ι)
(f₁ f₂ : ι → Set α)
(hf : ∀ i ∈ t, f₁ i ⊆ f₂ i)

(List.map f₁ t).prod ⊆ (List.map f₂ t).prod


protected lemma NodupKeys.nodup {m : Multiset (Σ a, β a)} (h : m.NodupKeys) : m.Nodup

{α : Type u}
{β : α → Type v}
{m : Multiset ((a : α) × β a)}
(h : m.NodupKeys)


@[to_additive (attr := ext)]
lemma ext {X Y : CommGrp} {f g : X ⟶ Y} (w : ∀ x : X, f x = g x) : f = g

{X Y : CommGrp}
{f g : X ⟶ Y}
(w : ∀ (x : ↑X), f x = g x)


@[simp]
theorem pi_snd : (q.pi α).snd = const α q.snd

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

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


/-- **Uniqueness of left-invariant measures**:
Given two left-invariant measures which are finite
on compacts and inner regular, they coincide up to a multiplicative constant. -/
@[to_additive isAddLeftInvariant_eq_smul_of_innerRegular]
lemma isMulLeftInvariant_eq_smul_of_innerRegular [LocallyCompactSpace G]
    (μ' μ : Measure G) [IsHaarMeasure μ] [IsFiniteMeasureOnCompacts μ'] [IsMulLeftInvariant μ']
    [InnerRegular μ] [InnerRegular μ'] :
    μ' = haarScalarFactor μ' μ • μ


protected theorem exists_coe {α : Type*} (s : Finset α) (p : s → Prop) :
    (∃ x : s, p x) ↔ ∃ (x : α) (h : x ∈ s), p ⟨x, h⟩

{α : Type u_4}
(s : Finset α)
(p : { x // x ∈ s } → Prop)

(∃ x, p x) ↔ ∃ x, ∃ (h : x ∈ s), p ⟨x, h⟩


theorem Wbtw.trans_left_ne [NoZeroSMulDivisors R V] {w x y z : P} (h₁ : Wbtw R w y z)
    (h₂ : Wbtw R w x y) (h : y ≠ z) : x ≠ z

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[OrderedRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
[NoZeroSMulDivisors R V]
{w x y z : P}
(h₁ : Wbtw R w y z)
(h₂ : Wbtw R w x y)
(h : y ≠ z)


@[to_additive]
theorem TopologicalGroup.tendstoLocallyUniformly_iff {ι α : Type*} [TopologicalSpace α]
    (F : ι → α → G) (f : α → G) (p : Filter ι) :
    @TendstoLocallyUniformly α G ι (TopologicalGroup.toUniformSpace G) _ F f p ↔
      ∀ u ∈ 𝓝 (1 : G), ∀ (x : α), ∃ t ∈ 𝓝 x, ∀ᶠ i in p, ∀ a ∈ t, F i a / f a ∈ u

{G : Type u_1}
[AddGroup G]
[TopologicalSpace G]
[TopologicalAddGroup G]
{ι : Type u_2}
{α : Type u_3}
[TopologicalSpace α]
(F : ι → α → G)
(f : α → G)
(p : Filter ι)

TendstoLocallyUniformly F f p ↔ ∀ u ∈ 𝓝 0, ∀ (x : α), ∃ t ∈ 𝓝 x, ∀ᶠ (i : ι) in p, ∀ a ∈ t, F i a - f a ∈ u


@[simp]
theorem zero_base {n : ℕ} : maxPowDiv 0 n = 0


theorem algebraMap_eq_ofReal : ⇑(algebraMap ℝ K) = ofReal


@[simp]
theorem hasse_prod : hasse (α × β) = hasse α □ hasse β

(α : Type u_1)
(β : Type u_2)
[PartialOrder α]
[PartialOrder β]

SimpleGraph.hasse (α × β) = SimpleGraph.hasse α □ SimpleGraph.hasse β


@[simp]
theorem Icc_diff_left : Icc a b \ {a} = Ioc a b

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


theorem epi_iff_surjective : Epi f ↔ Function.Surjective f

{R : Type u}
[Ring R]
{X Y : ModuleCat R}
(f : X ⟶ Y)

CategoryTheory.Epi f ↔ Function.Surjective ⇑f


/-- Auxiliary lemma ensuring that, under the assumptions defining the tangent cone,
the sequence `d` tends to 0 at infinity. -/
theorem tangentConeAt.lim_zero {α : Type*} (l : Filter α) {c : α → 𝕜} {d : α → E}
    (hc : Tendsto (fun n => ‖c n‖) l atTop) (hd : Tendsto (fun n => c n • d n) l (𝓝 y)) :
    Tendsto d l (𝓝 0)

(hc : Filter.Tendsto (fun n => ‖c n‖) l Filter.atTop)

(hd : Filter.Tendsto (fun n => c n • d n) l (𝓝 y))


theorem aleph0_le_aleph' {o : Ordinal} : ℵ₀ ≤ aleph' o ↔ ω ≤ o


theorem specializes_iff_closure_subset : x ⤳ y ↔ closure ({y} : Set X) ⊆ closure {x}

{X : Type u_1}
[TopologicalSpace X]
{x y : X}


theorem lineDifferentiableWithinAt_zero : LineDifferentiableWithinAt 𝕜 f s x 0

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[AddCommGroup E]
[Module 𝕜 E]
{f : E → F}
{s : Set E}
{x : E}


@[simp]
theorem toFractionRingRingEquiv_symm_eq :
    (toFractionRingRingEquiv K).symm = (IsLocalization.algEquiv K[X]⁰ _ _).toRingEquiv

(RatFunc.toFractionRingRingEquiv K).symm = (IsLocalization.algEquiv K[X]⁰ (FractionRing K[X]) (RatFunc K)).toRingEquiv


theorem neg_fst (a : 𝓜(𝕜, A)) : (-a).fst = -a.fst

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[SMulCommClass 𝕜 A A]
[IsScalarTower 𝕜 A A]
(a : 𝓜(𝕜, A))


@[reassoc (attr := simp)]
theorem whiskerRight_naturality (f : a ⟶ b) (g : G.obj b ⟶ a') :
    F.map f ◁ Γ.app b ▷ g ≫ (α_ _ _ _).inv ≫ θ.naturality f ▷ g =
      (α_ _ _ _).inv ≫ η.naturality f ▷ g ≫ Γ.app a ▷ G.map f ▷ g

(Γ : CategoryTheory.OplaxNatTrans.Modification η θ)

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerLeft (F.map f) (CategoryTheory.Bicategory.whiskerRight (Γ.app b) g))
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.associator (F.map f) (θ.app b) g).inv
      (CategoryTheory.Bicategory.whiskerRight (θ.naturality f) g)) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.associator (F.map f) (η.app b) g).inv
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight (η.naturality f) g)
      (CategoryTheory.Bicategory.whiskerRight (CategoryTheory.Bicategory.whiskerRight (Γ.app a) (G.map f)) g))


@[to_additive]
lemma zpow_le_zpow_iff (ha : 1 < a) : a ^ m ≤ a ^ n ↔ m ≤ n

{α : Type u_1}
[OrderedCommGroup α]
{m n : ℤ}
{a : α}
(ha : 1 < a)


@[simp]
theorem trans_refl : e.trans (refl S M₂) = e

{R : Type u_1}
{S : Type u_7}
{M : Type u_8}
{M₂ : Type u_10}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₂]
{module_M : Module R M}
{module_S_M₂ : Module S M₂}
{σ : R →+* S}
{σ' : S →+* R}
{re₁ : RingHomInvPair σ σ'}
{re₂ : RingHomInvPair σ' σ}
(e : M ≃ₛₗ[σ] M₂)


theorem log_ofReal_re (x : ℝ) : (log (x : ℂ)).re = Real.log x


theorem bijective_of_isIso {X Y : C} (f : X ⟶ Y) [IsIso f] :
    Function.Bijective ((forget C).map f)

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

Function.Bijective ((CategoryTheory.forget C).map f)


theorem sups_infs_subset_right : t ⊼ u ⊻ s ⊆ (t ⊻ s) ⊼ (u ⊻ s)

{α : Type u_2}
[DistribLattice α]
(s t u : Set α)


/-- Assumes right covariance. -/
theorem Right.one_lt_mul_of_le_of_lt_of_nonneg [MulPosMono α] (ha : 1 ≤ a) (hb : 1 < b)
    (b0 : 0 ≤ b) : 1 < a * b

{α : Type u_1}
{a b : α}
[MulOneClass α]
[Zero α]
[Preorder α]
[MulPosMono α]
(ha : 1 ≤ a)
(hb : 1 < b)
(b0 : 0 ≤ b)


/-- Any two sets `B₁`, `B₂` in a family with the exchange property have the same
`ℕ∞`-cardinality. -/
theorem encard_base_eq (hB₁ : Base B₁) (hB₂ : Base B₂) : B₁.encard = B₂.encard

{α : Type u_1}
{Base : Set α → Prop}
(exch : Matroid.ExchangeProperty Base)
{B₁ B₂ : Set α}
(hB₁ : Base B₁)
(hB₂ : Base B₂)


theorem Ico_succ_right_eq_insert_Ico (h : a ≤ b) : Ico a (b + 1) = insert b (Ico a b)

Finset.Ico a (b + 1) = insert b (Finset.Ico a b)


@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
theorem insert_nonempty (a : α) (s : Finset α) : (insert a s).Nonempty

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


/-- A functor `G : (C, J) ⥤ (D, K)` between sites is called cocontinuous (SGA 4 III 2.1)
if for all covering sieves `R` in `D`, `R.pullback G` is a covering sieve in `C`.
-/
-- Porting note(#5171): removed `@[nolint has_nonempty_instance]`
class Functor.IsCocontinuous : Prop where
  cover_lift : ∀ {U : C} {S : Sieve (G.obj U)} (_ : S ∈ K (G.obj U)), S.functorPullback G ∈ J U

{J : CategoryTheory.GrothendieckTopology C}

{K : CategoryTheory.GrothendieckTopology D}

S ∈ K.sieves (G.obj U) → CategoryTheory.Sieve.functorPullback G S ∈ J.sieves U


theorem countable_biInf_eq_iInf_seq [CompleteLattice α] {B : Set ι} (Bcbl : B.Countable)
    (Bne : B.Nonempty) (f : ι → α) : ∃ x : ℕ → ι, ⨅ t ∈ B, f t = ⨅ i, f (x i)

{α : Type u_1}
{ι : Type u_4}
[CompleteLattice α]
{B : Set ι}
(Bcbl : B.Countable)
(Bne : B.Nonempty)
(f : ι → α)


/-- A matrix multiplied by its conjugate transpose is positive semidefinite -/
theorem posSemidef_self_mul_conjTranspose (A : Matrix m n R) : PosSemidef (A * Aᴴ)

{m : Type u_1}
{n : Type u_2}
{R : Type u_3}
[Fintype m]
[Fintype n]
[CommRing R]
[PartialOrder R]
[StarRing R]
[StarOrderedRing R]
(A : Matrix m n R)


/-- The duality equivalence `(WidePushoutShape J)ᵒᵖ ≌ WidePullbackShape J` -/
@[simps]
def widePushoutShapeOpEquiv : (WidePushoutShape J)ᵒᵖ ≌ WidePullbackShape J

(CategoryTheory.Limits.widePushoutShapeOpEquiv J).unitIso = (CategoryTheory.Limits.widePushoutShapeOpUnop J).symm


@[to_additive extend_nonneg] lemma one_le_extend (hg : 1 ≤ g) (he : 1 ≤ e) : 1 ≤ extend f g e

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[Zero γ]
[LE γ]
{f : α → β}
{g : α → γ}
{e : β → γ}
(hg : 0 ≤ g)
(he : 0 ≤ e)


protected theorem congr_fun {f g : P1 →ᵃ[k] P2} (h : f = g) (x : P1) : f x = g x

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


@[to_additive] lemma leOnePart_eq_ite : a⁻ᵐ = if a ≤ 1 then a⁻¹ else 1

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


@[simp]
theorem coe_sup (f g : SupHom α β) : DFunLike.coe (f ⊔ g) = f ⊔ g

{α : Type u_3}
{β : Type u_4}
[Sup α]
[SemilatticeSup β]
(f g : SupHom α β)


/-- Adjoins a `⊤` to the domain and codomain of an `InfHom`. -/
@[simps]
protected def withTop (f : InfHom α β) : InfTopHom (WithTop α) (WithTop β)

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

∀ (a : Option α), f.withTop.toInfHom a = Option.map (⇑f) a


theorem prod_map {δ} [PseudoEMetricSpace δ] {f : α → β} {g : γ → δ} (hf : Isometry f)
    (hg : Isometry g) : Isometry (Prod.map f g)

{α : Type u}
{β : Type v}
{γ : Type w}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
[PseudoEMetricSpace γ]
{δ : Type u_2}
[PseudoEMetricSpace δ]
{f : α → β}
{g : γ → δ}
(hf : Isometry f)
(hg : Isometry g)


theorem omegaLimit_image_subset (t : τ) (ht : Tendsto (· + t) f f) :
    ω f ϕ (ϕ t '' s) ⊆ ω f ϕ s

(ht : Filter.Tendsto (fun x => x + t) f f)

omegaLimit f ϕ.toFun (ϕ.toFun t '' s) ⊆ omegaLimit f ϕ.toFun s


theorem vars_pow (φ : MvPolynomial σ R) (n : ℕ) : (φ ^ n).vars ⊆ φ.vars

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(φ : MvPolynomial σ R)
(n : ℕ)


@[to_additive three'_nsmul]
lemma pow_three' (a : M) : a ^ 3 = a * a * a


theorem isClopen_biUnion_finset {s : Finset Y} {f : Y → Set X}
    (h : ∀ i ∈ s, IsClopen <| f i) : IsClopen (⋃ i ∈ s, f i)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
{s : Finset Y}
{f : Y → Set X}
(h : ∀ i ∈ s, IsClopen (f i))


theorem intCast_def' (z : ℤ) : (z : A ⊗[R] B) = (1 : A) ⊗ₜ (z : B)

{R : Type uR}
{A : Type uA}
{B : Type uB}
[CommRing R]
[Ring A]
[Algebra R A]
[Ring B]
[Algebra R B]
(z : ℤ)


lemma distinguished_cocone_triangle {X Y : Cᵒᵖ} (f : X ⟶ Y) :
    ∃ (Z : Cᵒᵖ) (g : Y ⟶ Z) (h : Z ⟶ X⟦(1 : ℤ)⟧),
      Triangle.mk f g h ∈ distinguishedTriangles C

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

∃ Z g h,
  CategoryTheory.Pretriangulated.Triangle.mk f g h ∈ CategoryTheory.Pretriangulated.Opposite.distinguishedTriangles C


/-- Auxiliary lemma used as an argument to `CliffordAlgebra.changeForm` -/
theorem changeForm.neg_proof : (-B).toQuadraticMap = Q - Q'

(h : LinearMap.BilinMap.toQuadraticMap B = Q' - Q)

LinearMap.BilinMap.toQuadraticMap (-B) = Q - Q'


lemma Finset.sum_smul_sum (s : Finset α) (t : Finset β) {f : α → R} {g : β → M} :
    (∑ i ∈ s, f i) • ∑ j ∈ t, g j = ∑ i ∈ s, ∑ j ∈ t, f i • g j

{α : Type u_3}
{β : Type u_4}
{R : Type u_5}
{M : Type u_6}
[Semiring R]
[AddCommMonoid M]
[Module R M]
(s : Finset α)
(t : Finset β)
{f : α → R}
{g : β → M}


theorem Nonempty.smul_zero (hs : s.Nonempty) : s • (0 : Set β) = 0

{α : Type u_2}
{β : Type u_3}
[Zero β]
[SMulZeroClass α β]
{s : Set α}
(hs : s.Nonempty)


protected theorem Ne.ite_eq_right_iff (h : a ≠ b) : ite P a b = b ↔ ¬P

{α : Sort u_1}
{P : Prop}
[Decidable P]
{a b : α}
(h : a ≠ b)


theorem mem_centralizer_iff {s : Set A} {z : A} : z ∈ centralizer R s ↔ ∀ g ∈ s, g * z = z * g

(R : Type u_1)
{A : Type u_2}
[CommSemiring R]
[NonUnitalSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
{s : Set A}
{z : A}

z ∈ NonUnitalSubalgebra.centralizer R s ↔ ∀ g ∈ s, g * z = z * g


protected theorem lt_trans {a b c : Fin n} : a < b → b < c → a < c


theorem domDomCongr_trans (σ₁ : ι₁ ≃ ι₂) (σ₂ : ι₂ ≃ ι₃)
    (m : MultilinearMap R (fun _ : ι₁ => M₂) M₃) :
    m.domDomCongr (σ₁.trans σ₂) = (m.domDomCongr σ₁).domDomCongr σ₂

{R : Type uR}
{M₂ : Type v₂}
{M₃ : Type v₃}
[Semiring R]
[AddCommMonoid M₂]
[AddCommMonoid M₃]
[Module R M₂]
[Module R M₃]
{ι₁ : Type u_1}
{ι₂ : Type u_2}
{ι₃ : Type u_3}
(σ₁ : ι₁ ≃ ι₂)
(σ₂ : ι₂ ≃ ι₃)
(m : MultilinearMap R (fun x => M₂) M₃)

MultilinearMap.domDomCongr (σ₁.trans σ₂) m = MultilinearMap.domDomCongr σ₂ (MultilinearMap.domDomCongr σ₁ m)


lemma card_union (s t : Finset α) : (s ∪ t).card = s.card + t.card - (s ∩ t).card

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


@[simp] lemma dirSupInacc_compl : DirSupInacc sᶜ ↔ DirSupClosed s


theorem mem_torsion_iff (x : M) : x ∈ torsion R M ↔ ∃ a : R⁰, a • x = 0

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
(x : M)

x ∈ Submodule.torsion R M ↔ ∃ a, a • x = 0


/-- A weighted sum over `s.filter pred` equals one over `s` if all the weights at indices in `s`
not satisfying `pred` are zero. -/
theorem weightedVSubOfPoint_filter_of_ne (w : ι → k) (p : ι → P) (b : P) {pred : ι → Prop}
    [DecidablePred pred] (h : ∀ i ∈ s, w i ≠ 0 → pred i) :
    (s.filter pred).weightedVSubOfPoint p b w = s.weightedVSubOfPoint p b w

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
(s : Finset ι)
(w : ι → k)
(p : ι → P)
(b : P)
{pred : ι → Prop}
[DecidablePred pred]
(h : ∀ i ∈ s, w i ≠ 0 → pred i)

((Finset.filter pred s).weightedVSubOfPoint p b) w = (s.weightedVSubOfPoint p b) w


/-- A constructor for `SMulPosReflectLT` requiring you to prove `a₁ • b < a₂ • b → a₁ < a₂` only
when `0 < b`-/
lemma SMulPosReflectLT.of_pos (h₀ : ∀ b : β, 0 < b → ∀ a₁ a₂ : α, a₁ • b < a₂ • b → a₁ < a₂) :
    SMulPosReflectLT α β

(h₀ : ∀ (b : β), 0 < b → ∀ (a₁ a₂ : α), a₁ • b < a₂ • b → a₁ < a₂)


theorem limsup_eq_tendsto_sum_indicator_atTop (R : Type*) [StrictOrderedSemiring R] [Archimedean R]
    (s : ℕ → Set α) : limsup s atTop = { ω | Tendsto
      (fun n ↦ ∑ k ∈ Finset.range n, (s (k + 1)).indicator (1 : α → R) ω) atTop atTop }

{α : Type u_2}
(R : Type u_7)
[StrictOrderedSemiring R]
[Archimedean R]
(s : ℕ → Set α)

Filter.limsup s Filter.atTop =
  {ω | Filter.Tendsto (fun n => ∑ k ∈ Finset.range n, (s (k + 1)).indicator 1 ω) Filter.atTop Filter.atTop}


@[simp]
theorem map₂Right_nil_right : map₂Right f as [] = []

{α : Type u}
{β : Type v}
{γ : Type w}
(f : Option α → β → γ)
(as : List α)


theorem mirror_monomial (n : ℕ) (a : R) : (monomial n a).mirror = monomial n a

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

((Polynomial.monomial n) a).mirror = (Polynomial.monomial n) a


/-- Given `w : TwoSquare T L R B` and `X₃ : C₃`, this is the obvious functor
`CostructuredArrow L X₃ ⥤ CostructuredArrow R (B.obj X₃)`. -/
@[simps! obj map]
def costructuredArrowRightwards (X₃ : C₃) :
    CostructuredArrow L X₃ ⥤ CostructuredArrow R (B.obj X₃)

{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 Y : CategoryTheory.CostructuredArrow L X₃} (f : X ⟶ Y),
  (w.costructuredArrowRightwards X₃).map f =
    (CategoryTheory.CostructuredArrow.pre T R (B.obj X₃)).map
      ((CategoryTheory.Comma.mapLeft (CategoryTheory.Functor.fromPUnit (B.obj X₃)) w).map
        (CategoryTheory.CostructuredArrow.homMk f.left ⋯))


theorem ContDiff.rpow_const_of_le (hf : ContDiff ℝ m f) (h : ↑m ≤ p) :
    ContDiff ℝ m fun x => f x ^ p

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{p : ℝ}
{m : ℕ}
(hf : ContDiff ℝ (↑m) f)
(h : ↑m ≤ p)


/-- Infinite sums commute with scalar multiplication. Version for scalars living in a `Group`, but
  not requiring any summability hypothesis. -/
lemma tsum_const_smul' {γ : Type*} [Group γ] [DistribMulAction γ α] [ContinuousConstSMul γ α]
    [T2Space α] (g : γ) : ∑' (i : β), g • f i = g • ∑' (i : β), f i

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[AddCommMonoid α]
{f : β → α}
{γ : Type u_5}
[Group γ]
[DistribMulAction γ α]
[ContinuousConstSMul γ α]
[T2Space α]
(g : γ)


/-- The equivalence `(β →+ γ) ≃ (α →+ γ)` obtained by precomposition with
an additive equivalence `e : α ≃+ β`. -/
@[simps]
def precompEquiv {α β : Type*} [AddMonoid α] [AddMonoid β] (e : α ≃+ β) (γ : Type*) [AddMonoid γ] :
    (β →+ γ) ≃ (α →+ γ)

{α : Type u_1}
{β : Type u_2}
[AddMonoid α]
[AddMonoid β]
(e : α ≃+ β)
(γ : Type u_3)
[AddMonoid γ]
(f : β →+ γ)

(AddMonoidHom.precompEquiv e γ) f = f.comp ↑e


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


theorem lintegral_inter_add_diff {B : Set α} (f : α → ℝ≥0∞) (A : Set α) (hB : MeasurableSet B) :
    ∫⁻ x in A ∩ B, f x ∂μ + ∫⁻ x in A \ B, f x ∂μ = ∫⁻ x in A, f x ∂μ

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

∫⁻ (x : α) in A ∩ B, f x ∂μ + ∫⁻ (x : α) in A \ B, f x ∂μ = ∫⁻ (x : α) in A, f x ∂μ


@[to_additive (attr := simp)]
theorem leftInvEquiv_symm_fromLeftInv (x : S.leftInv) :
    (S.leftInvEquiv hS).symm (S.fromLeftInv x) = x

{M : Type u_1}
[AddCommMonoid M]
(S : AddSubmonoid M)
(hS : S ≤ IsAddUnit.addSubmonoid M)
(x : ↥S.leftNeg)

(S.leftNegEquiv hS).symm (S.fromLeftNeg x) = x


@[simp]
theorem eventually_atTop [SemilatticeSup α] [Nonempty α] {p : α → Prop} :
    (∀ᶠ x in atTop, p x) ↔ ∃ a, ∀ b ≥ a, p b

{α : Type u_3}
[SemilatticeSup α]
[Nonempty α]
{p : α → Prop}

(∀ᶠ (x : α) in Filter.atTop, p x) ↔ ∃ a, ∀ b ≥ a, p b


@[to_additive]
theorem lift_of_mul (x y) : lift f (of x * y) = f x * lift f y

{α : Type u}
{β : Type v}
[Semigroup β]
(f : α → β)
(x : α)
(y : FreeSemigroup α)

(FreeSemigroup.lift f) (FreeSemigroup.of x * y) = f x * (FreeSemigroup.lift f) y


theorem mem_frontier_of_gauge_eq_one (hc : Convex ℝ s) (hs₀ : 0 ∈ s) (ha : Absorbent ℝ s)
    (h : gauge s x = 1) : x ∈ frontier s

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
{x : E}
[TopologicalSpace E]
[ContinuousSMul ℝ E]
(hc : Convex ℝ s)
(hs₀ : 0 ∈ s)
(ha : Absorbent ℝ s)
(h : gauge s x = 1)


@[to_additive (attr := simp)]
lemma coe_id {X : MonCat} : (𝟙 X : X → X) = id


/-- The canonical inclusion from the completion to the product. -/
@[simps]
def incl : AdicCompletion I M →ₗ[R] (∀ n, M ⧸ (I ^ n • ⊤ : Submodule R M))

{R : Type u_1}
[CommRing R]
(I : Ideal R)
(M : Type u_2)
[AddCommGroup M]
[Module R M]
(x : AdicCompletion I M)
(n : ℕ)


theorem snd_surjective [h : Nonempty α] : Function.Surjective (@snd α β)

{α : Type u_1}
{β : Type u_2}
[h : Nonempty α]


/-- The equivalence `F.elementsᵒᵖ ≌ (yoneda, F)` is compatible with the forgetful functors. -/
@[simps!]
def costructuredArrowYonedaEquivalenceInverseπ (F : Cᵒᵖ ⥤ Type v) :
    (costructuredArrowYonedaEquivalence F).inverse ⋙ (π F).leftOp ≅ CostructuredArrow.proj _ _

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

(X : CategoryTheory.CostructuredArrow CategoryTheory.yoneda F)

(CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalenceInverseπ F).inv.app X =
  CategoryTheory.CategoryStruct.id X.left


theorem vecAppend_eq_ite {α : Type*} {o : ℕ} (ho : o = m + n) (u : Fin m → α) (v : Fin n → α) :
    vecAppend ho u v = fun i : Fin o =>
      if h : (i : ℕ) < m then u ⟨i, h⟩ else v ⟨(i : ℕ) - m, by omega⟩

{m n : ℕ}
{α : Type u_4}
{o : ℕ}
(ho : o = m + n)
(u : Fin m → α)
(v : Fin n → α)

Matrix.vecAppend ho u v = fun i => if h : ↑i < m then u ⟨↑i, h⟩ else v ⟨↑i - m, ⋯⟩


theorem infiniteNeg_mul_infiniteNeg {x y : ℝ*} :
    InfiniteNeg x → InfiniteNeg y → InfinitePos (x * y)

x.InfiniteNeg → y.InfiniteNeg → (x * y).InfinitePos


theorem Iic_mem_nhdsSet_Ioc (h : b < c) : Iic c ∈ 𝓝ˢ (Ioc a b)

{α : Type u_1}
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
{a b c : α}
(h : b < c)


/-- Multiplying `a` by itself and then dividing by itself results in `a`, whether or not `a` is
zero. -/
@[simp]
theorem mul_self_div_self (a : G₀) : a * a / a = a

{G₀ : Type u_3}
[GroupWithZero G₀]
(a : G₀)


theorem add_one_le_succ (c : Cardinal.{u}) : c + 1 ≤ succ c


theorem pairwiseDisjoint_iff_coe_toFinset_pairwise_disjoint {α ι} [SemilatticeInf α] [OrderBot α]
    [DecidableEq ι] {l : List ι} {f : ι → α} (hn : l.Nodup) :
    (l.toFinset : Set ι).PairwiseDisjoint f ↔ l.Pairwise (_root_.Disjoint on f)

{α : Type u_5}
{ι : Type u_6}
[SemilatticeInf α]
[OrderBot α]
[DecidableEq ι]
{l : List ι}
{f : ι → α}
(hn : l.Nodup)

(↑l.toFinset).PairwiseDisjoint f ↔ List.Pairwise (Disjoint on f) l


/-- A version of `Quotient.ind₂` taking `{s₁ : Setoid α} {s₂ : Setoid β}` as implicit arguments
instead of instance arguments. -/
@[elab_as_elim]
protected theorem ind₂' {p : Quotient s₁ → Quotient s₂ → Prop}
    (h : ∀ a₁ a₂, p (Quotient.mk'' a₁) (Quotient.mk'' a₂))
    (q₁ : Quotient s₁) (q₂ : Quotient s₂) : p q₁ q₂

(h : ∀ (a₁ : α) (a₂ : β), p (Quotient.mk'' a₁) (Quotient.mk'' a₂))


@[simp]
theorem Filter.mem_ofCountableUnion {l : Set (Set α)} {hunion hmono s} :
    s ∈ ofCountableUnion l hunion hmono ↔ l sᶜ

{hunion : ∀ (S : Set (Set α)), S.Countable → (∀ s ∈ S, s ∈ l) → ⋃₀ S ∈ l}

s ∈ Filter.ofCountableUnion l hunion hmono ↔ l sᶜ


/-- Given a multicofork, we may obtain a cofork over `∐ I.left ⇉ ∐ I.right`. -/
@[simps pt]
noncomputable def toSigmaCofork (K : Multicofork I) : Cofork I.fstSigmaMap I.sndSigmaMap

{I : CategoryTheory.Limits.MultispanIndex C}

(K : CategoryTheory.Limits.Multicofork I)


theorem finite_co_support (s : SummableFamily Γ R α) (g : Γ) :
    (Function.support fun a => (s a).coeff g).Finite

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[AddCommMonoid R]
{α : Type u_3}
(s : HahnSeries.SummableFamily Γ R α)
(g : Γ)


theorem HasDerivWithinAt.rpow_const (hf : HasDerivWithinAt f f' s x) (hx : f x ≠ 0 ∨ 1 ≤ p) :
    HasDerivWithinAt (fun y => f y ^ p) (f' * p * f x ^ (p - 1)) s x

{f : ℝ → ℝ}
{f' x p : ℝ}
{s : Set ℝ}
(hf : HasDerivWithinAt f f' s x)
(hx : f x ≠ 0 ∨ 1 ≤ p)


lemma cfc_add_const (r : R) (f : R → R) (a : A)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) (ha : p a := by cfc_tac) :
    cfc (fun x => f x + r) a = cfc f a + algebraMap R A r

cfc (fun x => f x + r) a = cfc f a + (algebraMap R A) r


theorem Absorbs.eventually_nhds_zero (h : Absorbs 𝕜 s t) (h₀ : 0 ∈ s) :
    ∀ᶠ c : 𝕜 in 𝓝 0, MapsTo (c • ·) t s

{𝕜 : Type u_1}
{E : Type u_3}
[NormedDivisionRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{s t : Set E}
(h : Absorbs 𝕜 s t)
(h₀ : 0 ∈ s)

∀ᶠ (c : 𝕜) in 𝓝 0, Set.MapsTo (fun x => c • x) t s


/-- If an indexed family of points is convex independent, so is the corresponding set of points. -/
protected theorem ConvexIndependent.range {p : ι → E} (hc : ConvexIndependent 𝕜 p) :
    ConvexIndependent 𝕜 ((↑) : Set.range p → E)

{𝕜 : Type u_1}
{E : Type u_2}
{ι : Type u_3}
[OrderedSemiring 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{p : ι → E}
(hc : ConvexIndependent 𝕜 p)


@[simp]
theorem rmap_compose (r : Rel α β) (s : Rel β γ) : rmap s ∘ rmap r = rmap (r.comp s)

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

Filter.rmap s ∘ Filter.rmap r = Filter.rmap (r.comp s)


/-- Auxiliary lemma for `IsSFiniteKernel.withDensity`.
If a kernel `κ` is finite, then `withDensity κ f` is s-finite. -/
theorem isSFiniteKernel_withDensity_of_isFiniteKernel (κ : Kernel α β) [IsFiniteKernel κ]
    (hf_ne_top : ∀ a b, f a b ≠ ∞) : IsSFiniteKernel (withDensity κ f)

{f : α → β → ℝ≥0∞}

(hf_ne_top : ∀ (a : α) (b : β), f a b ≠ ⊤)


lemma self_mul_dual :
    I * dual A K I = dual A K 1

(A : Type u_1)
(K : Type u_2)
{L : Type u}
{B : Type u_3}
[CommRing A]
[Field K]
[CommRing B]
[Field L]
[Algebra A K]
[Algebra B L]
[Algebra A B]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[IsScalarTower A B L]
[IsDomain A]
[IsFractionRing A K]
[IsIntegralClosure B A L]
[IsFractionRing B L]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]
[IsIntegrallyClosed A]
[IsDedekindDomain B]
{I : FractionalIdeal B⁰ L}
(hI : I ≠ 0)

I * FractionalIdeal.dual A K I = FractionalIdeal.dual A K 1


@[simp]
theorem toDual_bot [Bot α] : toDual (⊥ : α) = ⊤


@[simp]
theorem prodCongrLeft_apply (b : β₁) (a : α₁) : prodCongrLeft e (b, a) = (e a b, a)

{α₁ : Type u_2}
{β₁ : Type u_3}
{β₂ : Type u_1}
(e : α₁ → β₁ ≃ β₂)
(b : β₁)
(a : α₁)

(Equiv.prodCongrLeft e) (b, a) = ((e a) b, a)


/-- **Cauchy integral formula**: if `f : ℂ → E` is continuous on a closed disc of radius `R` and is
complex differentiable at all but countably many points of its interior, then for any `w` in this
interior we have $\frac{1}{2πi}\oint_{|z-c|=R}(z-w)^{-1}f(z)\,dz=f(w)$.
-/
theorem two_pi_I_inv_smul_circleIntegral_sub_inv_smul_of_differentiable_on_off_countable {R : ℝ}
    {c w : ℂ} {f : ℂ → E} {s : Set ℂ} (hs : s.Countable) (hw : w ∈ ball c R)
    (hc : ContinuousOn f (closedBall c R)) (hd : ∀ x ∈ ball c R \ s, DifferentiableAt ℂ f x) :
    ((2 * π * I : ℂ)⁻¹ • ∮ z in C(c, R), (z - w)⁻¹ • f z) = f w

(hc : ContinuousOn f (Metric.closedBall c R))

(hd : ∀ x ∈ Metric.ball c R \ s, DifferentiableAt ℂ f x)

((2 * ↑π * Complex.I)⁻¹ • ∮ (z : ℂ) in C(c, R), (z - w)⁻¹ • f z) = f w


theorem Set.Subsingleton.isCompact (hs : s.Subsingleton) : IsCompact s

{X : Type u}
[TopologicalSpace X]
{s : Set X}
(hs : s.Subsingleton)


theorem one_rightUnitor {M : Mon_ C} :
    ((λ_ (𝟙_ C)).inv ≫ (M.one ⊗ 𝟙 (𝟙_ C))) ≫ (ρ_ M.X).hom = M.one

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


theorem LineDifferentiableAt.congr_of_eventuallyEq
    (h : LineDifferentiableAt 𝕜 f x v) (hL : f₁ =ᶠ[𝓝 x] f) :
    LineDifferentiableAt 𝕜 f₁ x v

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{f f₁ : E → F}
{x v : E}
(h : LineDifferentiableAt 𝕜 f x v)
(hL : f₁ =ᶠ[𝓝 x] f)


theorem ofFunction_eq (s : Set α) (m_mono : ∀ ⦃t : Set α⦄, s ⊆ t → m s ≤ m t)
    (m_subadd : ∀ s : ℕ → Set α, m (⋃ i, s i) ≤ ∑' i, m (s i)) :
    OuterMeasure.ofFunction m m_empty s = m s

(m_subadd : ∀ (s : ℕ → Set α), m (⋃ i, s i) ≤ ∑' (i : ℕ), m (s i))

(MeasureTheory.OuterMeasure.ofFunction m m_empty) s = m s


/-- A `*`-magma is a magma `R` with an involutive operation `star`
such that `star (r * s) = star s * star r`.
-/
class StarMul (R : Type u) [Mul R] extends InvolutiveStar R where
  /-- `star` skew-distributes over multiplication. -/
  star_mul : ∀ r s : R, star (r * s) = star s * star r

{R : Type u}
[Mul R]
[self : StarMul R]
(r s : R)


/-- A (bundled) locally constant function from a topological space `X` to a type `Y`. -/
structure LocallyConstant (X Y : Type*) [TopologicalSpace X] where
  /-- The underlying function. -/
  protected toFun : X → Y
  /-- The map is locally constant. -/
  protected isLocallyConstant : IsLocallyConstant toFun

{X : Type u_5}
{Y : Type u_6}
[TopologicalSpace X]
(self : LocallyConstant X Y)


@[to_additive (attr := simp)]
theorem mul_inv_cancel_right (a : α) (b : αˣ) : a * b * ↑b⁻¹ = a

{α : Type u}
[AddMonoid α]
(a : α)
(b : AddUnits α)


@[simp, norm_cast]
theorem coe_imK : (x : ℍ[R,c₁,c₂]).imK = 0

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(x : R)


/-- `fderiv 𝕜 f` is smooth. -/
theorem ContDiff.fderiv_right (hf : ContDiff 𝕜 n f) (hmn : (m + 1 : ℕ∞) ≤ n) :
    ContDiff 𝕜 m (fderiv 𝕜 f)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{m n : ℕ∞}
(hf : ContDiff 𝕜 n f)
(hmn : m + 1 ≤ n)


theorem of_measure_le_smul {μ' : Measure α} (c : ℝ≥0∞) (hc : c ≠ ∞) (h : μ ≤ c • μ')
    (hT : DominatedFinMeasAdditive μ T C) (hC : 0 ≤ C) :
    DominatedFinMeasAdditive μ' T (c.toReal * C)

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

MeasureTheory.DominatedFinMeasAdditive μ' T (c.toReal * C)


theorem rpow_le_rpow_iff {x y : ℝ≥0} {z : ℝ} (hz : 0 < z) : x ^ z ≤ y ^ z ↔ x ≤ y


lemma kernImage_preimage_eq_iff {s : Set β} : kernImage f (f ⁻¹' s) = s ↔ (range f)ᶜ ⊆ s

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

Set.kernImage f (f ⁻¹' s) = s ↔ (Set.range f)ᶜ ⊆ s


/--
A category has all countable colimits if every functor `J ⥤ C` with a `CountableCategory J`
instance and `J : Type` has a colimit.
-/
class HasCountableColimits : Prop where
  /-- `C` has all limits over any type `J` whose objects and morphisms lie in the same universe
  and which has countably many objects and morphisms-/
  out (J : Type) [SmallCategory J] [CountableCategory J] : HasColimitsOfShape J C

[self : CategoryTheory.Limits.HasCountableColimits C]


/-- Given a limit cone over `F ⋙ G` we can construct a limit cone over `G`. -/
@[simps]
def limitConeOfComp (t : LimitCone (F ⋙ G)) : LimitCone G

(t : CategoryTheory.Limits.LimitCone (F.comp G))

(CategoryTheory.Functor.Initial.limitConeOfComp F t).isLimit =
  (CategoryTheory.Functor.Initial.isLimitExtendConeEquiv F t.cone).symm t.isLimit


theorem abs_integral_le_integral_abs (hab : a ≤ b) :
    |∫ x in a..b, f x ∂μ| ≤ ∫ x in a..b, |f x| ∂μ

{f : ℝ → ℝ}
{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}
(hab : a ≤ b)

|∫ (x : ℝ) in a..b, f x ∂μ| ≤ ∫ (x : ℝ) in a..b, |f x| ∂μ


/-- Also see `Polynomial.separable_X_pow_sub_C_unit` -/
theorem Polynomial.separable_X_pow_sub_C_of_irreducible : (X ^ n - C a).Separable

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

(Polynomial.X ^ n - Polynomial.C a).Separable


theorem of_eq [IsRefl α r] : ∀ {a b}, a = b → r a b

{α : Type u}
{r : α → α → Prop}
[IsRefl α r]
{a b : α}


theorem decomposition.decompose'_apply (φ : MvPolynomial σ R) (i : ℕ) :
    (decomposition.decompose' φ i : MvPolynomial σ R) = homogeneousComponent i φ

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

↑((DirectSum.Decomposition.decompose' φ) i) = (MvPolynomial.homogeneousComponent i) φ


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


@[trans]
nonrec theorem trans (hxy : x ≡ y [SMOD U]) (hyz : y ≡ z [SMOD U]) : x ≡ z [SMOD U]

{R : Type u_1}
[Ring R]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
{U : Submodule R M}
{x y z : M}
(hxy : x ≡ y [SMOD U])
(hyz : y ≡ z [SMOD U])


/-- Auxiliary lemma for `sheafCompose_reflects_discrete`. -/
private lemma constantSheafAdj_counit_w :
    ((sheafifyComposeIso J U ((const Cᵒᵖ).obj (F.val.obj ⟨t⟩))).symm ≪≫
      (presheafToSheaf J B ⋙ sheafToPresheaf J B).mapIso (constComp Cᵒᵖ (F.val.obj ⟨t⟩) U)).hom ≫
        ((constantSheafAdj J B ht).counit.app ((sheafCompose J U).obj F)).val =
          ((sheafCompose J U).map ((constantSheafAdj J A ht).counit.app F)).val

(J : CategoryTheory.GrothendieckTopology C)

(ht : CategoryTheory.Limits.IsTerminal t)

((CategoryTheory.sheafifyComposeIso J U ((CategoryTheory.Functor.const Cᵒᵖ).obj (F.val.obj (Opposite.op t)))).symm ≪≫
        (CategoryTheory.presheafToSheaf J B ⋙ CategoryTheory.sheafToPresheaf J B).mapIso
          (CategoryTheory.Functor.constComp Cᵒᵖ (F.val.obj (Opposite.op t)) U)).hom ≫
    ((CategoryTheory.constantSheafAdj J B ht).counit.app ((CategoryTheory.sheafCompose J U).obj F)).val =
  ((CategoryTheory.sheafCompose J U).map ((CategoryTheory.constantSheafAdj J A ht).counit.app F)).val


/-- The Radon-Nikodym theorem for signed measures. -/
theorem absolutelyContinuous_iff_withDensityᵥ_rnDeriv_eq (s : SignedMeasure α) (μ : Measure α)
    [SigmaFinite μ] : s ≪ᵥ μ.toENNRealVectorMeasure ↔ μ.withDensityᵥ (s.rnDeriv μ) = s

{α : Type u_1}
{m : MeasurableSpace α}
(s : MeasureTheory.SignedMeasure α)
(μ : MeasureTheory.Measure α)
[MeasureTheory.SigmaFinite μ]


@[simp]
theorem DiagramOfCocones.mkOfHasColimits_coconePoints :
    (DiagramOfCocones.mkOfHasColimits F).coconePoints = F ⋙ colim

(CategoryTheory.Limits.DiagramOfCocones.mkOfHasColimits F).coconePoints = F ⋙ CategoryTheory.Limits.colim


{α : Type u}
[PartialOrder α]
[OrderBot α]
{a : α}
(h : a ≤ ⊥)


/-- In a normed algebra, the inclusion of the base field in the extended field is an isometry. -/
theorem algebraMap_isometry [NormOneClass 𝕜'] : Isometry (algebraMap 𝕜 𝕜')

(𝕜 : Type u_1)
(𝕜' : Type u_2)
[NormedField 𝕜]
[SeminormedRing 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormOneClass 𝕜']


lemma mono_of_injective_aux (hι : Function.Injective ι) (c : Cofan X) (c₁ : Cofan (X ∘ ι))
    (hc : IsColimit c) (hc₁ : IsColimit c₁)
    (c₂ : Cofan (fun (k : ((Set.range ι)ᶜ : Set I)) => X k.1))
    (hc₂ : IsColimit c₂) : Mono (Cofan.IsColimit.desc hc₁ (fun i => c.inj (ι i)))

(c₁ : CategoryTheory.Limits.Cofan (X ∘ ι))

(hc : CategoryTheory.Limits.IsColimit c)

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

(c₂ : CategoryTheory.Limits.Cofan fun k => X ↑k)

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

CategoryTheory.Mono (CategoryTheory.Limits.Cofan.IsColimit.desc hc₁ fun i => c.inj (ι i))


@[to_additive]
lemma prod_lt_one_iff_of_le_one (hf : f ≤ 1) : ∏ i, f i < 1 ↔ f < 1

{ι : Type u_1}
{M : Type u_4}
[Fintype ι]
[OrderedCancelAddCommMonoid M]
{f : ι → M}
(hf : f ≤ 0)


/-- Sections of `F ⋙ yoneda.obj X` identify to natural
transformations `(const J).obj X ⟶ F`. -/
@[simps]
def compYonedaSectionsEquiv (F : J ⥤ Cᵒᵖ) (X : C) :
    (F ⋙ yoneda.obj X).sections ≃ ((const J).obj (op X) ⟶ F)

(s : ↑(F ⋙ CategoryTheory.yoneda.obj X).sections)

((CategoryTheory.Limits.compYonedaSectionsEquiv F X) s).app j = Quiver.Hom.op (↑s j)


@[to_additive] lemma IsUnit.mul : IsUnit a → IsUnit b → IsUnit (a * b)


theorem _root_.Function.Commute.finset_map {f g : α ↪ α} (h : Function.Commute f g) :
    Function.Commute (map f) (map g)

{α : Type u_1}
{f g : α ↪ α}
(h : Function.Commute ⇑f ⇑g)

Function.Commute (Finset.map f) (Finset.map g)


@[simp]
theorem liftNC_single (f : k →+ R) (g : Multiplicative G → R) (a : G) (b : k) :
    liftNC f g (single a b) = f b * g (Multiplicative.ofAdd a)

{k : Type u₁}
{G : Type u₂}
{R : Type u_2}
[Semiring k]
[NonUnitalNonAssocSemiring R]
(f : k →+ R)
(g : Multiplicative G → R)
(a : G)
(b : k)

(AddMonoidAlgebra.liftNC f g) (AddMonoidAlgebra.single a b) = f b * g (Multiplicative.ofAdd a)


theorem pow_right_injective {a : R} (ha0 : a ≠ 0) (ha1 : ¬IsUnit a) :
    Function.Injective (a ^ · : ℕ → R)

{R : Type u_2}
[CancelCommMonoidWithZero R]
[UniqueFactorizationMonoid R]
{a : R}
(ha0 : a ≠ 0)
(ha1 : ¬IsUnit a)


theorem alternatization_def (m : MultilinearMap R (fun _ : ι => M) N') :
    ⇑(alternatization m) = (∑ σ : Perm ι, Equiv.Perm.sign σ • m.domDomCongr σ : _)

{R : Type u_1}
[Semiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{N' : Type u_6}
[AddCommGroup N']
[Module R N']
{ι : Type u_7}
[Fintype ι]
[DecidableEq ι]
(m : MultilinearMap R (fun x => M) N')

⇑(MultilinearMap.alternatization m) = ⇑(∑ σ : Equiv.Perm ι, Equiv.Perm.sign σ • MultilinearMap.domDomCongr σ m)


@[elab_as_elim]
theorem cons_induction {α : Type*} {p : Finset α → Prop} (empty : p ∅)
    (cons : ∀ (a : α) (s : Finset α) (h : a ∉ s), p s → p (cons a s h)) : ∀ s, p s

(cons : ∀ (a : α) (s : Finset α) (h : a ∉ s), p s → p (Finset.cons a s h))


@[simp]
theorem id_comp (f : sSupHom α β) : (sSupHom.id β).comp f = f

{α : Type u_2}
{β : Type u_3}
[SupSet α]
[SupSet β]
(f : sSupHom α β)


@[simp]
theorem comp_left_id (r : Rel α β) : @Eq α • r = r

{α : Type u_1}
{β : Type u_2}
(r : Rel α β)


theorem IsInternal.addSubmonoid_iSup_eq_top {M : Type*} [DecidableEq ι] [AddCommMonoid M]
    (A : ι → AddSubmonoid M) (h : IsInternal A) : iSup A = ⊤

{ι : Type v}
{M : Type u_1}
[DecidableEq ι]
[AddCommMonoid M]
(A : ι → AddSubmonoid M)
(h : DirectSum.IsInternal A)


theorem dedup_le (s : Multiset α) : dedup s ≤ s

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


/-- If two monoid homomorphisms are equal on a set, then they are equal on its submonoid closure. -/
@[to_additive
      "If two monoid homomorphisms are equal on a set, then they are equal on its submonoid
      closure."]
theorem eqOn_closureM {f g : M →* N} {s : Set M} (h : Set.EqOn f g s) : Set.EqOn f g (closure s)

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

Set.EqOn ⇑f ⇑g ↑(AddSubmonoid.closure s)


lemma scaleRoots_dvd' (p q : R[X]) {r : R} (hr : IsUnit r)
    (hpq : p ∣ q) : p.scaleRoots r ∣ q.scaleRoots r

{R : Type u_1}
[CommSemiring R]
(p q : Polynomial R)
{r : R}
(hr : IsUnit r)
(hpq : p ∣ q)


theorem monic_X_pow_add_C {n : ℕ} (h : n ≠ 0) : (X ^ n + C a).Monic

{R : Type u}
(a : R)
[Semiring R]
{n : ℕ}
(h : n ≠ 0)

(Polynomial.X ^ n + Polynomial.C a).Monic


theorem isBigO_comp {α : Type*} (f : α → E) (l : Filter α) : (fun x' => e (f x')) =O[l] f

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_5}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
{σ₁₂ : 𝕜 →+* 𝕜₂}
{σ₂₁ : 𝕜₂ →+* 𝕜}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
(e : E ≃SL[σ₁₂] F)
[RingHomIsometric σ₁₂]
{α : Type u_7}
(f : α → E)
(l : Filter α)


theorem norm_eq_sup'_normAtPlace (x : E K) :
    ‖x‖ = univ.sup' univ_nonempty fun w ↦ normAtPlace w x

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

‖x‖ = Finset.univ.sup' ⋯ fun w => (NumberField.mixedEmbedding.normAtPlace w) x


theorem union_union_union_comm (s t u v : Set α) : s ∪ t ∪ (u ∪ v) = s ∪ u ∪ (t ∪ v)


theorem ae_imp_of_ae_restrict {s : Set α} {p : α → Prop} (h : ∀ᵐ x ∂μ.restrict s, p x) :
    ∀ᵐ x ∂μ, x ∈ s → p x

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{s : Set α}
{p : α → Prop}
(h : ∀ᵐ (x : α) ∂μ.restrict s, p x)


/-- One part of the universal property of `ℤ_[p]` as a projective limit.
See also `PadicInt.lift_unique`.
-/
theorem lift_spec (n : ℕ) : (toZModPow n).comp (lift f_compat) = f n

(f_compat : ∀ (k1 k2 : ℕ) (hk : k1 ≤ k2), (ZMod.castHom ⋯ (ZMod (p ^ k1))).comp (f k2) = f k1)

(PadicInt.toZModPow n).comp (PadicInt.lift f_compat) = f n


/-- A nontrivially normed field is a normed field in which there is an element of norm different
from `0` and `1`. This makes it possible to bring any element arbitrarily close to `0` by
multiplication by the powers of any element, and thus to relate algebra and topology. -/
class NontriviallyNormedField (α : Type*) extends NormedField α where
  /-- The norm attains a value exceeding 1. -/
  non_trivial : ∃ x : α, 1 < ‖x‖

{α : Type u_5}
[self : NontriviallyNormedField α]


/-- Lagrange's Mean Value Theorem, `HasDerivAt` version -/
theorem exists_hasDerivAt_eq_slope : ∃ c ∈ Ioo a b, f' c = (f b - f a) / (b - a)

(hff' : ∀ x ∈ Set.Ioo a b, HasDerivAt f (f' x) x)

∃ c ∈ Set.Ioo a b, f' c = (f b - f a) / (b - a)


theorem algHom_bijective [Algebra.IsAlgebraic K L] (f : L →ₐ[K] L) :
    Function.Bijective f

{K : Type u_1}
{L : Type u_2}
[CommRing K]
[Field L]
[Algebra K L]
[NoZeroSMulDivisors K L]
[Algebra.IsAlgebraic K L]
(f : L →ₐ[K] L)


theorem isRightAdjoint_iff_hasInitial_structuredArrow {G : D ⥤ C} :
    G.IsRightAdjoint ↔ ∀ A, HasInitial (StructuredArrow A G)

{C : Type u₁}
{D : Type u₂}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Category.{v₂, u₂} D]
{G : CategoryTheory.Functor D C}

G.IsRightAdjoint ↔ ∀ (A : C), CategoryTheory.Limits.HasInitial (CategoryTheory.StructuredArrow A G)


/-- `limsup (c - xᵢ) = c - liminf xᵢ`. -/
lemma limsup_const_sub (F : Filter ι) [NeBot F] [AddCommSemigroup R] [Sub R] [ContinuousSub R]
    [OrderedSub R] [CovariantClass R R (fun x y ↦ x + y) fun x y ↦ x ≤ y] (f : ι → R) (c : R)
    (cobdd : F.IsCoboundedUnder (· ≥ ·) f) (bdd_below : F.IsBoundedUnder (· ≥ ·) f) :
    Filter.limsup (fun i ↦ c - f i) F = c - Filter.liminf f F

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

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

(bdd_below : Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) F f)

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


@[simp]
theorem closedUnder_univ : ClosedUnder f (univ : Set M)

(L : FirstOrder.Language)
{M : Type w}
[L.Structure M]
{n : ℕ}
(f : L.Functions n)


theorem Differentiable.comp_diffContOnCl {g : G → E} {t : Set G} (hf : Differentiable 𝕜 f)
    (hg : DiffContOnCl 𝕜 g t) : DiffContOnCl 𝕜 (f ∘ g) t

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
{G : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 F]
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{f : E → F}
{g : G → E}
{t : Set G}
(hf : Differentiable 𝕜 f)
(hg : DiffContOnCl 𝕜 g t)


theorem Icc_subset_Ioo_iff (h₁ : a₁ ≤ b₁) : Icc a₁ b₁ ⊆ Ioo a₂ b₂ ↔ a₂ < a₁ ∧ b₁ < b₂

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

Set.Icc a₁ b₁ ⊆ Set.Ioo a₂ b₂ ↔ a₂ < a₁ ∧ b₁ < b₂


theorem differentiableOn_log : DifferentiableOn ℝ log {0}ᶜ


@[simp] lemma infClosed_infClosure : InfClosed (infClosure s)

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


theorem toMeasure_injective : (toMeasure : PMF α → Measure α).Injective

{α : Type u_1}
[MeasurableSpace α]
[MeasurableSingletonClass α]


theorem infix_concat : l₁ <:+: l₂ → l₁ <:+: concat l₂ a

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


lemma killingForm_apply_apply (x y : L) : killingForm R L x y = trace R L (ad R L x ∘ₗ ad R L y)

(R : Type u_1)
(L : Type u_3)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(x y : L)

((killingForm R L) x) y = (LinearMap.trace R L) ((LieAlgebra.ad R L) x ∘ₗ (LieAlgebra.ad R L) y)


theorem image_subtype_val_Iic_subset (a : {x // p x}) :
    Subtype.val '' Iic a ⊆ Iic a.val

{α : Type u_1}
[Preorder α]
{p : α → Prop}
(a : { x // p x })


/-- In the characteristic zero case, the centroid lies in the affine
span if the number of points is `n + 1`. -/
theorem centroid_mem_affineSpan_of_card_eq_add_one [CharZero k] {s : Finset ι} (p : ι → P) {n : ℕ}
    (h : card s = n + 1) : s.centroid k p ∈ affineSpan k (range p)

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{ι : Type u_4}
[CharZero k]
{s : Finset ι}
(p : ι → P)
{n : ℕ}
(h : s.card = n + 1)

Finset.centroid k s p ∈ affineSpan k (Set.range p)


@[simp, mfld_simps]
theorem mem_inter_iff (x : α) (a b : Set α) : x ∈ a ∩ b ↔ x ∈ a ∧ x ∈ b


@[simp] lemma nhdsWithin_univ (a : α) : 𝓝[Set.univ] a = 𝓝 a

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


@[simp] lemma sdiff_lt_left : s.sdiff t < s ↔ ¬ Disjoint ↑s t

{α : Type u_1}
[Preorder α]
{s : LowerSet α}
{t : Set α}


theorem trace_fin_zero (A : Matrix (Fin 0) (Fin 0) R) : trace A = 0

{R : Type u_6}
[AddCommMonoid R]
(A : Matrix (Fin 0) (Fin 0) R)


@[to_additive (attr := simp)]
theorem upperClosure_smul : upperClosure (a • s) = a • upperClosure s

{α : Type u_1}
[OrderedCommGroup α]
(s : Set α)
(a : α)


@[simp]
theorem sup_inf_inf_compl : x ⊓ y ⊔ x ⊓ yᶜ = x

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


theorem comap_lift'_eq {m : γ → β} : comap m (f.lift' h) = f.lift' (preimage m ∘ h)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : Filter α}
{h : Set α → Set β}
{m : γ → β}

Filter.comap m (f.lift' h) = f.lift' (Set.preimage m ∘ h)


lemma f_ne_zero (t : IsSl2Triple h e f) : f ≠ 0

{L : Type u_2}
[LieRing L]
{h e f : L}
(t : IsSl2Triple h e f)


@[simp]
theorem toEquiv_inj {e₁ e₂ : A ≃ₐc[R] B} : e₁.toEquiv = e₂.toEquiv ↔ e₁ = e₂

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
{e₁ e₂ : A ≃ₐc[R] B}


theorem Subring.le_topologicalClosure (s : Subring α) : s ≤ s.topologicalClosure

{α : Type u_1}
[TopologicalSpace α]
[Ring α]
[TopologicalRing α]
(s : Subring α)


/-- We show that the partial order and the topology on `ℂ` are compatible.
We turn this into an instance scoped to `ComplexOrder`. -/
lemma orderClosedTopology : OrderClosedTopology ℂ


@[simp]
lemma map_tmul (f : Hom P P') (x y) :
    CotangentSpace.map f (x ⊗ₜ .D _ _ y) = (algebraMap _ _ x) ⊗ₜ .D _ _ (f.toAlgHom y)

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{P : Algebra.Generators R S}
{R' : Type u'}
{S' : Type v'}
[CommRing R']
[CommRing S']
[Algebra R' S']
{P' : Algebra.Generators R' S'}
[Algebra R R']
[Algebra S S']
[Algebra R S']
[IsScalarTower R R' S']
[IsScalarTower R S S']
(f : P.Hom P')
(x : S)
(y : P.Ring)

(Algebra.Generators.CotangentSpace.map f) (x ⊗ₜ[P.Ring] (KaehlerDifferential.D R P.Ring) y) =
  (algebraMap S S') x ⊗ₜ[P'.Ring] (KaehlerDifferential.D R' P'.Ring) (f.toAlgHom y)


theorem borel_eq_generateFrom_Ici : borel α = MeasurableSpace.generateFrom (range Ici)

(α : Type u_1)
[TopologicalSpace α]
[SecondCountableTopology α]
[LinearOrder α]
[OrderTopology α]

borel α = MeasurableSpace.generateFrom (Set.range Set.Ici)


theorem orderOf_dvd_card_sub_one {p : ℕ} [Fact p.Prime] {a : ZMod p} (ha : a ≠ 0) :
    orderOf a ∣ p - 1

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


theorem tendsto_translation_number₀' :
    Tendsto (fun n : ℕ => (f ^ (n + 1) : CircleDeg1Lift) 0 / ((n : ℝ) + 1)) atTop (𝓝 <| τ f)

Filter.Tendsto (fun n => (f ^ (n + 1)) 0 / (↑n + 1)) Filter.atTop (𝓝 f.translationNumber)


protected theorem surjective (e : P₁ ≃ᵃ[k] P₂) : Surjective e

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


@[simp]
theorem edist_map (x y : P) : edist (f x) (f y) = edist x y

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


/-- A multiplicative morphism between monoids gives a monoidal functor between the corresponding
discrete monoidal categories.
-/
@[to_additive (attr := simps) Discrete.addMonoidalFunctor]
def Discrete.monoidalFunctor (F : M →* N) : MonoidalFunctor (Discrete M) (Discrete N)

{M : Type u}
[Monoid M]
{N : Type u'}
[Monoid N]
(F : M →* N)

(CategoryTheory.Discrete.monoidalFunctor F).ε = CategoryTheory.Discrete.eqToHom ⋯


/-- The span of a subspace is the subspace. -/
@[simp]
theorem span_coe (W : Subspace K V) : span ↑W = W

{K : Type u_1}
{V : Type u_2}
[Field K]
[AddCommGroup V]
[Module K V]
(W : Projectivization.Subspace K V)


theorem index_embedding (i : Fin c.length) (j : Fin (c.blocksFun i)) :
    c.index (c.embedding i j) = i

{n : ℕ}
(c : Composition n)
(i : Fin c.length)
(j : Fin (c.blocksFun i))


theorem length_ne_zero (irrefl : Irreflexive r) : s.length ≠ 0 ↔ {x | x ∈ s}.Nontrivial

{α : Type u_1}
{r : Rel α α}
{s : RelSeries r}
(irrefl : Irreflexive r)


@[to_additive (attr := simp)]
theorem OneHom.mulSingle_apply [∀ i, One <| f i] (i : I) (x : f i) :
    mulSingle f i x = Pi.mulSingle i x

{I : Type u}
(f : I → Type v)
[DecidableEq I]
[(i : I) → One (f i)]
(i : I)
(x : f i)

(OneHom.mulSingle f i) x = Pi.mulSingle i x


/-- The Monge point of an (n+2)-simplex, in terms of
`pointsWithCircumcenter`. -/
theorem mongePoint_eq_affineCombination_of_pointsWithCircumcenter {n : ℕ}
    (s : Simplex ℝ P (n + 2)) :
    s.mongePoint =
      (univ : Finset (PointsWithCircumcenterIndex (n + 2))).affineCombination ℝ
        s.pointsWithCircumcenter (mongePointWeightsWithCircumcenter n)

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{n : ℕ}
(s : Affine.Simplex ℝ P (n + 2))

s.mongePoint =
  (Finset.affineCombination ℝ Finset.univ s.pointsWithCircumcenter) (Affine.Simplex.mongePointWeightsWithCircumcenter n)


theorem lim_le_div (hbdd : BddBelow (range fun n => u n / n)) {n : ℕ} (hn : n ≠ 0) :
    h.lim ≤ u n / n

(hbdd : BddBelow (Set.range fun n => u n / ↑n))


@[simp]
theorem union_apply {R S : Sieve X} {Y} (f : Y ⟶ X) : (R ⊔ S) f ↔ R f ∨ S f

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

(R ⊔ S).arrows f ↔ R.arrows f ∨ S.arrows f


lemma mul_nonneg_iff_neg_imp_nonpos [PosMulStrictMono α] [MulPosStrictMono α]
    [CovariantClass α α (· + ·) (· ≤ ·)] [ContravariantClass α α (· + ·) (· ≤ ·)] :
    0 ≤ a * b ↔ (a < 0 → b ≤ 0) ∧ (b < 0 → a ≤ 0)

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

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


lemma ContinuousWithinAt.finset_inf'_apply (hne : s.Nonempty)
    (hs : ∀ i ∈ s, ContinuousWithinAt (f i) t x) :
    ContinuousWithinAt (fun a ↦ s.inf' hne (f · a)) t x

ContinuousWithinAt (fun a => s.inf' hne fun x => f x a) t x


theorem foldlIdx_eq_foldl_enum (f : ℕ → α → β → α) (a : α) (bs : List β) :
    foldlIdx f a bs = foldl (fun a p ↦ f p.fst a p.snd) a (enum bs)

{α : Type u}
{β : Type v}
(f : ℕ → α → β → α)
(a : α)
(bs : List β)

List.foldlIdx f a bs = List.foldl (fun a p => f p.1 a p.2) a bs.enum


@[to_additive]
lemma smul_set_closure_subset (K : Set M) (L : Set X) :
    closure K • closure L ⊆ closure (K • L)

{M : Type u_1}
{X : Type u_2}
[TopologicalSpace M]
[TopologicalSpace X]
[SMul M X]
[ContinuousSMul M X]
(K : Set M)
(L : Set X)


theorem LinearMap.image_convexHull (f : E →ₗ[𝕜] F) (s : Set E) :
    f '' convexHull 𝕜 s = convexHull 𝕜 (f '' s)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[AddCommMonoid F]
[Module 𝕜 E]
[Module 𝕜 F]
(f : E →ₗ[𝕜] F)
(s : Set E)

⇑f '' (convexHull 𝕜) s = (convexHull 𝕜) (⇑f '' s)


@[simp]
theorem idealProdEquiv_symm_apply (I : Ideal R) (J : Ideal S) :
    idealProdEquiv.symm ⟨I, J⟩ = prod I J

{R : Type u}
{S : Type v}
[Semiring R]
[Semiring S]
(I : Ideal R)
(J : Ideal S)

Ideal.idealProdEquiv.symm (I, J) = I.prod J


@[simp]
lemma leftUnshift_smul {n' a : ℤ} (γ : Cochain (K⟦a⟧) L n') (n : ℤ) (hn : n + a = n') (x : R) :
    (x • γ).leftUnshift n hn = x • γ.leftUnshift n hn

(γ : CochainComplex.HomComplex.Cochain ((CategoryTheory.shiftFunctor (CochainComplex C ℤ) a).obj K) L n')


/-- Composition of monoid homomorphisms is associative. -/
@[to_additive "Composition of additive monoid homomorphisms is associative."]
theorem OneHom.comp_assoc {Q : Type*} [One M] [One N] [One P] [One Q]
    (f : OneHom M N) (g : OneHom N P) (h : OneHom P Q) :
    (h.comp g).comp f = h.comp (g.comp f)

{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
{Q : Type u_10}
[One M]
[One N]
[One P]
[One Q]
(f : OneHom M N)
(g : OneHom N P)
(h : OneHom P Q)


theorem bind_toOption (f : α → Part β) (o : Part α) [Decidable o.Dom] [∀ a, Decidable (f a).Dom]
    [Decidable (o.bind f).Dom] :
    (o.bind f).toOption = o.toOption.elim Option.none fun a => (f a).toOption

{α : Type u_1}
{β : Type u_2}
(f : α → Part β)
(o : Part α)
[Decidable o.Dom]
[(a : α) → Decidable (f a).Dom]
[Decidable (o.bind f).Dom]

(o.bind f).toOption = o.toOption.elim none fun a => (f a).toOption


theorem sups_left_comm : s ⊻ (t ⊻ u) = t ⊻ (s ⊻ u)

{α : Type u_2}
[SemilatticeSup α]
(s t u : Set α)


theorem zero_ndunion (s : Multiset α) : ndunion 0 s = s

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


theorem image_comp (s : Rel β γ) (t : Set α) : image (r • s) t = image s (image r t)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(r : Rel α β)
(s : Rel β γ)
(t : Set α)

(r.comp s).image t = s.image (r.image t)


/-- The explicit cofan of a family of topological spaces given by the sigma type. -/
@[simps! pt ι_app]
def sigmaCofan {ι : Type v} (α : ι → TopCat.{max v u}) : Cofan α

{ι : Type v}
(α : ι → TopCat)
(X : CategoryTheory.Discrete ι)

(TopCat.sigmaCofan α).ι.app X = TopCat.sigmaι α X.as


/-- Coercion of a `NormedAddGroupHom` is an `AddMonoidHom`. Similar to `AddMonoidHom.coeFn`.  -/
@[simps]
def coeAddHom : NormedAddGroupHom V₁ V₂ →+ V₁ → V₂

{V₁ : Type u_2}
{V₂ : Type u_3}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]

∀ (a : NormedAddGroupHom V₁ V₂) (a_1 : V₁), NormedAddGroupHom.coeAddHom a a_1 = a a_1


theorem lt_def {z w : ℂ} : z < w ↔ z.re < w.re ∧ z.im = w.im


/-- If `f : ℂ → E` is complex differentiable on some set `s`, then it is analytic at any point `z`
such that `s ∈ 𝓝 z` (equivalently, `z ∈ interior s`). -/
protected theorem _root_.DifferentiableOn.analyticAt {s : Set ℂ} {f : ℂ → E} {z : ℂ}
    (hd : DifferentiableOn ℂ f s) (hz : s ∈ 𝓝 z) : AnalyticAt ℂ f z

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
[CompleteSpace E]
{s : Set ℂ}
{f : ℂ → E}
{z : ℂ}
(hd : DifferentiableOn ℂ f s)
(hz : s ∈ 𝓝 z)


/-- The type of nonempty compact sets of a topological space. -/
structure NonemptyCompacts (α : Type*) [TopologicalSpace α] extends Compacts α where
  nonempty' : carrier.Nonempty

(self : TopologicalSpace.NonemptyCompacts α)


@[simp]
theorem coe_nnreal_lt_top (x : ℝ≥0) : ((x : ℝ≥0∞) : EReal) < ⊤


@[simp]
theorem darts_append {u v w : V} (p : G.Walk u v) (p' : G.Walk v w) :
    (p.append p').darts = p.darts ++ p'.darts

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


@[simp, norm_cast]
theorem coe_neg (f : M →SL[σ₁₂] M₂) : (↑(-f) : M →ₛₗ[σ₁₂] M₂) = -f

{R : Type u_1}
[Ring R]
{R₂ : Type u_2}
[Ring R₂]
{M : Type u_4}
[TopologicalSpace M]
[AddCommGroup M]
{M₂ : Type u_5}
[TopologicalSpace M₂]
[AddCommGroup M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
[TopologicalAddGroup M₂]
(f : M →SL[σ₁₂] M₂)


@[reassoc (attr := simp)]
lemma ιTotalOrZero_map (i₁ : I₁) (i₂ : I₂) (i₁₂ : I₁₂) :
    K.ιTotalOrZero c₁₂ i₁ i₂ i₁₂ ≫ (total.map φ c₁₂).f i₁₂ =
      (φ.f i₁).f i₂ ≫ L.ιTotalOrZero c₁₂ i₁ i₂ i₁₂

{C : Type u_1}
[CategoryTheory.Category.{u_5, u_1} C]
[CategoryTheory.Preadditive C]
{I₁ : Type u_2}
{I₂ : Type u_3}
{I₁₂ : Type u_4}
{c₁ : ComplexShape I₁}
{c₂ : ComplexShape I₂}
(K L : HomologicalComplex₂ C c₁ c₂)
(φ : K ⟶ L)
(c₁₂ : ComplexShape I₁₂)
[DecidableEq I₁₂]
[TotalComplexShape c₁ c₂ c₁₂]
[K.HasTotal c₁₂]
[L.HasTotal c₁₂]
(i₁ : I₁)
(i₂ : I₂)
(i₁₂ : I₁₂)

K.ιTotalOrZero c₁₂ i₁ i₂ i₁₂ ≫ (HomologicalComplex₂.total.map φ c₁₂).f i₁₂ =
  (φ.f i₁).f i₂ ≫ L.ιTotalOrZero c₁₂ i₁ i₂ i₁₂


@[simp]
theorem lift_apply_simple {G : Type*} [Monoid G] {f : B → G} (hf : IsLiftable M f) (i : B) :
    cs.lift ⟨f, hf⟩ (s i) = f i

{B : Type u_1}
{W : Type u_3}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
{G : Type u_5}
[Monoid G]
{f : B → G}
(hf : M.IsLiftable f)
(i : B)


@[simp]
theorem mkQ_map_self : map p.mkQ p = ⊥

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


/-- The exponent `p` associated with a particular Akra-Bazzi recurrence. -/
noncomputable irreducible_def p : ℝ

{α : Type u_2}
[Fintype α]
(a b : α → ℝ)

AkraBazziRecurrence.p a b = Function.invFun (fun p => ∑ i : α, a i * b i ^ p) 1


@[simp]
theorem ker_modByMonicHom (hq : q.Monic) :
    LinearMap.ker (Polynomial.modByMonicHom q) = (Ideal.span {q}).restrictScalars R

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

LinearMap.ker q.modByMonicHom = Submodule.restrictScalars R (Ideal.span {q})


/-- Turn a limit of `F : Jᵒᵖ ⥤ Cᵒᵖ` into a colimit of `F.unop : J ⥤ C`. -/
@[simps]
def isColimitCoconeUnopOfCone (F : Jᵒᵖ ⥤ Cᵒᵖ) {c : Cone F} (hc : IsLimit c) :
    IsColimit (coconeUnopOfCone c)

(s : CategoryTheory.Limits.Cocone F.unop)

(CategoryTheory.Limits.isColimitCoconeUnopOfCone F hc).desc s =
  (hc.lift (CategoryTheory.Limits.coneOfCoconeUnop s)).unop


theorem realize_noBotOrder_iff : M ⊨ Language.order.noBotOrderSentence ↔ NoBotOrder M

M ⊨ FirstOrder.Language.order.noBotOrderSentence ↔ NoBotOrder M


theorem totalVariation_neg (s : SignedMeasure α) : (-s).totalVariation = s.totalVariation

{α : Type u_1}
[MeasurableSpace α]
(s : MeasureTheory.SignedMeasure α)


/-- `-1` is a square in `ZMod p` iff `p` is not congruent to `3` mod `4`. -/
theorem exists_sq_eq_neg_one_iff : IsSquare (-1 : ZMod p) ↔ p % 4 ≠ 3


@[simp]
theorem pure_sub_pure (a b : α) : pure a - pure b = pure (a - b)

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

NonemptyInterval.pure a - NonemptyInterval.pure b = NonemptyInterval.pure (a - b)


/-- If `f (g y) = y` for `y` in some neighborhood of `a`, `g` is continuous at `a`, and `f` has an
invertible derivative `f'` at `g a` in the strict sense, then `g` has the derivative `f'⁻¹` at `a`
in the strict sense.

This is one of the easy parts of the inverse function theorem: it assumes that we already have an
inverse function. -/
theorem HasStrictFDerivAt.of_local_left_inverse {f : E → F} {f' : E ≃L[𝕜] F} {g : F → E} {a : F}
    (hg : ContinuousAt g a) (hf : HasStrictFDerivAt f (f' : E →L[𝕜] F) (g a))
    (hfg : ∀ᶠ y in 𝓝 a, f (g y) = y) : HasStrictFDerivAt g (f'.symm : F →L[𝕜] E) a

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{f' : E ≃L[𝕜] F}
{g : F → E}
{a : F}
(hg : ContinuousAt g a)
(hf : HasStrictFDerivAt f (↑f') (g a))
(hfg : ∀ᶠ (y : F) in 𝓝 a, f (g y) = y)


@[simp]
theorem vec3_dotProduct (v w : Fin 3 → α) : v ⬝ᵥ w = v 0 * w 0 + v 1 * w 1 + v 2 * w 2

{α : Type u}
[AddCommMonoid α]
[Mul α]
(v w : Fin 3 → α)

Matrix.dotProduct v w = v 0 * w 0 + v 1 * w 1 + v 2 * w 2


@[simp]
theorem singleton_eq_cons_iff {a b : α} (m : Multiset α) : {a} = b ::ₘ m ↔ a = b ∧ m = 0

{α : Type u_1}
{a b : α}
(m : Multiset α)


@[simp] lemma exp_le_one_iff {a : EReal} : exp a ≤ 1 ↔ a ≤ 0


@[simp] theorem symm_comp_self (e : α ≃ β) : e.symm ∘ e = id


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

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[CompleteLattice α]
[CompleteLattice β]
[CompleteLattice γ]
{g : FrameHom β γ}
{f₁ f₂ : FrameHom α β}
(hg : Function.Injective ⇑g)


protected lemma add_sub_sub_cancel (h : c ≤ a) : a + b - (a - c) = b + c


lemma gc_mul_ceilDiv (ha : 0 < a) : GaloisConnection (· ⌈/⌉ a) (a * ·)

{α : Type u_2}
[OrderedSemiring α]
[CeilDiv α α]
{a : α}
(ha : 0 < a)

GaloisConnection (fun x => x ⌈/⌉ a) fun x => a * x


theorem card_inter_add_card_union (s t : Finset α) :
    (s ∩ t).card + (s ∪ t).card = s.card + t.card

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


/-- The identification `X ⊗ - = mop (- ⊗ unmop X)` as a natural isomorphism. -/
@[simps!]
def MonoidalOpposite.tensorLeftIso (X : Cᴹᵒᵖ) :
    tensorLeft X ≅ unmopFunctor C ⋙ tensorRight (unmop X) ⋙ mopFunctor C

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

∀ (X_1 : Cᴹᵒᵖ), (X.tensorLeftIso.inv.app X_1).unmop = 𝟙 (CategoryTheory.MonoidalCategory.tensorObj X_1.unmop X.unmop)


/-- The `v`-adic valuation of `r/s ∈ K` is the valuation of `r` divided by the valuation of `s`. -/
theorem valuation_of_mk' {r : R} {s : nonZeroDivisors R} :
    v.valuation (IsLocalization.mk' K r s) = v.intValuation r / v.intValuation s

(v : IsDedekindDomain.HeightOneSpectrum R)

v.valuation (IsLocalization.mk' K r s) = v.intValuation r / v.intValuation ↑s


/-- (Implementation). Given an iso between the pullbacks of two sheaves, we can whisker it with
`coyoneda` to obtain an iso between the pullbacks of the sheaves of maps from `X`.
-/
@[simps!]
def isoOver {ℱ ℱ' : Sheaf K A} (α : G.op ⋙ ℱ.val ≅ G.op ⋙ ℱ'.val) (X : A) :
    G.op ⋙ (sheafOver ℱ X).val ≅ G.op ⋙ (sheafOver ℱ' X).val

{K : CategoryTheory.GrothendieckTopology D}

(α : G.op.comp ℱ.val ≅ G.op.comp ℱ'.val)

∀ (X_1 : Cᵒᵖ) (a : (CategoryTheory.coyoneda.obj (Opposite.op X)).obj ((G.op.comp ℱ.val).obj X_1)),
  (CategoryTheory.Functor.IsCoverDense.isoOver α X).hom.app X_1 a = CategoryTheory.CategoryStruct.comp a (α.hom.app X_1)


@[to_additive]
theorem period_dvd_exponent (m : M) (a : α) : period m a ∣ Monoid.exponent M

{α : Type v}
{M : Type u}
[Monoid M]
[MulAction M α]
(m : M)
(a : α)

MulAction.period m a ∣ Monoid.exponent M


/-- The relation “there exists an element that semiconjugates `a` to `b`” on a monoid (or, more
generally, on `MulOneClass` type) is reflexive. -/
@[to_additive "The relation “there exists an element that semiconjugates `a` to `b`” on an additive
monoid (or, more generally, on an `AddZeroClass` type) is reflexive."]
protected theorem reflexive : Reflexive fun a b : M ↦ ∃ c, SemiconjBy c a b

Reflexive fun a b => ∃ c, SemiconjBy c a b


@[simp]
theorem insert_eq_self : insert a s = s ↔ a ∈ s


theorem iSup_bool_eq {f : Bool → α} : ⨆ b : Bool, f b = f true ⊔ f false

{α : Type u_1}
[CompleteLattice α]
{f : Bool → α}


/-- If ∠ABC = π then dist A B ≠ 0. -/
theorem left_dist_ne_zero_of_angle_eq_pi {p1 p2 p3 : P} (h : ∠ p1 p2 p3 = π) : dist p1 p2 ≠ 0

(h : EuclideanGeometry.angle p1 p2 p3 = π)


@[simp]
lemma overEquiv_symm_iff {X : C} {Y : Over X} (S : Sieve Y.left) {Z : Over X} (f : Z ⟶ Y) :
    (overEquiv Y).symm S f ↔ S f.left

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

((CategoryTheory.Sieve.overEquiv Y).symm S).arrows f ↔ S.arrows f.left


theorem isOpen_setOf_mapsTo (hK : IsCompact K) (hU : IsOpen U) :
    IsOpen {f : C(X, Y) | MapsTo f K U}

{X : Type u_2}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
{K : Set X}
{U : Set Y}
(hK : IsCompact K)
(hU : IsOpen U)


theorem Subtype.connectedSpace {s : Set α} (h : IsConnected s) : ConnectedSpace s

{α : Type u}
[TopologicalSpace α]
{s : Set α}
(h : IsConnected s)


theorem algebraicIndependent_iUnion_of_directed {η : Type*} [Nonempty η] {s : η → Set A}
    (hs : Directed (· ⊆ ·) s) (h : ∀ i, AlgebraicIndependent R ((↑) : s i → A)) :
    AlgebraicIndependent R ((↑) : (⋃ i, s i) → A)

(hs : Directed (fun x x_1 => x ⊆ x_1) s)

(h : ∀ (i : η), AlgebraicIndependent R Subtype.val)


/-- If `f` is an antitone function from `ℕ` to a preorder such that `x` lies between `f (n + 1)` and
`f n`, then `x` doesn't lie in the range of `f`. -/
theorem Antitone.ne_of_lt_of_lt_nat {f : ℕ → α} (hf : Antitone f) (n : ℕ) {x : α}
    (h1 : f (n + 1) < x) (h2 : x < f n) (a : ℕ) : f a ≠ x

{α : Type u}
[Preorder α]
{f : ℕ → α}
(hf : Antitone f)
(n : ℕ)
{x : α}
(h1 : f (n + 1) < x)
(h2 : x < f n)
(a : ℕ)


theorem ker_eq_top {f : M →ₛₗ[τ₁₂] M₂} : ker f = ⊤ ↔ f = 0

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


/-- The canonical isomorphism `K.cycles j ≅ K.homology j`
when the differential to `j` is zero. -/
@[simps! hom]
noncomputable def isoHomologyπ : K.cycles j ≅ K.homology j

(K.isoHomologyπ i j hi h).hom = K.homologyπ j


protected theorem le_of_add_le_add_left {a b c : Nat} (h : a + b ≤ a + c) : b ≤ c


theorem isExtreme_sInter {F : Set (Set E)} (hF : F.Nonempty) (hAF : ∀ B ∈ F, IsExtreme 𝕜 A B) :
    IsExtreme 𝕜 A (⋂₀ F)

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
{A : Set E}
{F : Set (Set E)}
(hF : F.Nonempty)
(hAF : ∀ B ∈ F, IsExtreme 𝕜 A B)


theorem ContinuousWithinAt.mono_of_mem {f : α → β} {s t : Set α} {x : α}
    (h : ContinuousWithinAt f t x) (hs : t ∈ 𝓝[s] x) : ContinuousWithinAt f s x

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
{s t : Set α}
{x : α}
(h : ContinuousWithinAt f t x)
(hs : t ∈ 𝓝[s] x)


@[to_additive]
theorem map_pure (f : α → β) (x : α) : f <$> (pure x : FreeGroup α) = pure (f x)


(S : FermatLastTheoremForThreeGen.Solution hζ)

FermatLastTheoremForThreeGen.Solution.u₄ S ^ 2 = 1


theorem const_max (hf : LocallyLipschitz f) (a : ℝ) : LocallyLipschitz fun x => max a (f x)

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


theorem symm_image_image_of_subset_source {s : Set α} (h : s ⊆ e.source) : e.symm '' (e '' s) = s

{α : Type u_1}
{β : Type u_2}
(e : PartialEquiv α β)
{s : Set α}
(h : s ⊆ e.source)


@[simp]
theorem add_apply (n : ℕ) (f g : AdicCauchySequence I M) : (f + g) n = f n + g n

(f g : AdicCompletion.AdicCauchySequence I M)


{R : Type u_1}
[NonUnitalNonAssocRing R]
(I : TwoSidedIdeal R)
{x : R}
(hx : x ∈ I)


lemma comp [L₁.IsLocalization W₁] [L₂.IsLocalization W₂]
    (W₃ : MorphismProperty C₁) (hW₃ : W₃.IsInvertedBy (L₁ ⋙ L₂))
    (hW₁₃ : W₁ ≤ W₃) (hW₂₃ : W₂ ≤ W₃.map L₁) :
    (L₁ ⋙ L₂).IsLocalization W₃

(W₁ : CategoryTheory.MorphismProperty C₁)

(W₂ : CategoryTheory.MorphismProperty C₂)

(W₃ : CategoryTheory.MorphismProperty C₁)


{K : Type u_1}
[Field K]
{ζ : K}
(hζ : IsPrimitiveRoot ζ ↑3)
(x : 𝓞 K)


theorem Periodic.nat_mul_sub_eq [Ring α] (h : Periodic f c) (n : ℕ) : f (n * c - x) = f (-x)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c x : α}
[Ring α]
(h : Function.Periodic f c)
(n : ℕ)


theorem subset_image_iff {t : Set β} :
    t ⊆ f '' s ↔ ∃ u, u ⊆ s ∧ f '' u = t

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


@[simp, norm_cast]
theorem cast_lt [LinearOrderedRing α] {m n : ZNum} : (m : α) < n ↔ m < n

{α : Type u_1}
[LinearOrderedRing α]
{m n : ZNum}


/-- The functor `HomologicalComplex C c ⥤ ShortComplex C` which sends a homological
complex `K` to the short complex `K.X i ⟶ K.X j ⟶ K.X k` for arbitrary indices `i`, `j` and `k`. -/
@[simps]
def shortComplexFunctor' (i j k : ι) : HomologicalComplex C c ⥤ ShortComplex C

((HomologicalComplex.shortComplexFunctor' C c i j k).obj K).X₁ = K.X i


/-- A version of `WithTop.map` for order embeddings. -/
@[simps (config := .asFn)]
protected def withTopMap (f : α ↪o β) : WithTop α ↪o WithTop β

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
(f : α ↪o β)


@[simp] theorem toNat_add_toNat_neg_eq_natAbs : ∀ n : Int, n.toNat + (-n).toNat = n.natAbs


/-- The `S`-rank of `M ⊗[R] M'` is `(Module.rank S M).lift * (Module.rank R M').lift`. -/
@[simp]
theorem rank_tensorProduct :
    Module.rank R (M ⊗[S] M') =
      Cardinal.lift.{v'} (Module.rank R M) * Cardinal.lift.{v} (Module.rank S M')

{R S : Type u}
{M : Type v}
{M' : Type v'}
[Ring R]
[CommRing S]
[AddCommGroup M]
[AddCommGroup M']
[StrongRankCondition R]
[StrongRankCondition S]
[Module S M]
[Module S M']
[Module.Free S M']
[Algebra S R]
[Module R M]
[IsScalarTower S R M]
[Module.Free R M]

Module.rank R (TensorProduct S M M') =
  Cardinal.lift.{v', v} (Module.rank R M) * Cardinal.lift.{v, v'} (Module.rank S M')


theorem dvd_total [h : ValuationRing R] (x y : R) : x ∣ y ∨ y ∣ x

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


theorem coe_symmₗ (e : Trivialization F (π F E)) [e.IsLinear R] (b : B) :
    ⇑(e.symmₗ R b) = e.symm b

[TopologicalSpace (Bundle.TotalSpace F E)]

(e : Trivialization F Bundle.TotalSpace.proj)

⇑(Trivialization.symmₗ R e b) = e.symm b


@[simp] theorem getLsb_ofNatLt {n : Nat} (x : Nat) (lt : x < 2^n) (i : Nat) :
  getLsb (x#'lt) i = x.testBit i

{n : Nat}
(x : Nat)
(lt : x < 2 ^ n)
(i : Nat)


theorem comap_neg_atBot : comap (Neg.neg : β → β) atBot = atTop

Filter.comap Neg.neg Filter.atBot = Filter.atTop


protected theorem ext_iff {f g : α →+* β} : f = g ↔ ∀ x, f x = g x

∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} {f g : α →+* β}, f = g ↔ ∀ (x_2 : α), f x_2 = g x_2


lemma Indep.map (hI : M.Indep I) (f : α → β) (hf) : (M.map f hf).Indep (f '' I)

{α : Type u_1}
{β : Type u_2}
{I : Set α}
{M : Matroid α}
(hI : M.Indep I)
(f : α → β)
(hf : Set.InjOn f M.E)


theorem norm_le_norm_mul_of_mem {a : A} {k : 𝕜} (hk : k ∈ σ a) : ‖k‖ ≤ ‖a‖ * ‖(1 : A)‖

{𝕜 : Type u_1}
{A : Type u_2}
[NormedField 𝕜]
[NormedRing A]
[NormedAlgebra 𝕜 A]
[CompleteSpace A]
{a : A}
{k : 𝕜}
(hk : k ∈ spectrum 𝕜 a)

‖k‖ ≤ ‖a‖ * ‖1‖


@[simp] theorem and_iff_right_iff_imp : ((a ∧ b) ↔ b) ↔ (b → a)


/-- First step of the proof of the Banach open mapping theorem (using completeness of `F`):
by Baire's theorem, there exists a ball in `E` whose image closure has nonempty interior.
Rescaling everything, it follows that any `y ∈ F` is arbitrarily well approached by
images of elements of norm at most `C * ‖y‖`.
For further use, we will only need such an element whose image
is within distance `‖y‖/2` of `y`, to apply an iterative process. -/
theorem exists_approx_preimage_norm_le (surj : Surjective f) :
    ∃ C ≥ 0, ∀ y, ∃ x, dist (f x) y ≤ 1 / 2 * ‖y‖ ∧ ‖x‖ ≤ C * ‖y‖

{𝕜 : Type u_1}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜']
{σ : 𝕜 →+* 𝕜'}
{σ' : 𝕜' →+* 𝕜}
[RingHomInvPair σ σ']
[RingHomIsometric σ]
[RingHomIsometric σ']
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜' F]
(f : E →SL[σ] F)
[CompleteSpace F]
(surj : Function.Surjective ⇑f)

∃ C ≥ 0, ∀ (y : F), ∃ x, dist (f x) y ≤ 1 / 2 * ‖y‖ ∧ ‖x‖ ≤ C * ‖y‖


theorem trans {a b c : α} (hab : a ≈ b) (hbc : b ≈ c) : a ≈ c

{α : Sort u}
[Setoid α]
{a b c : α}
(hab : a ≈ b)
(hbc : b ≈ c)


theorem mem_target {x : B × F} : x ∈ e.target ↔ x.1 ∈ e.baseSet

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


theorem bindOnSupport_eq_zero_iff (b : β) :
    p.bindOnSupport f b = 0 ↔ ∀ (a) (ha : p a ≠ 0), f a ha b = 0

{α : Type u_1}
{β : Type u_2}
{p : PMF α}
(f : (a : α) → a ∈ p.support → PMF β)
(b : β)

(p.bindOnSupport f) b = 0 ↔ ∀ (a : α) (ha : p a ≠ 0), (f a ha) b = 0


theorem Antitone.mul_monotone [ExistsAddOfLE α] [PosMulMono α] [MulPosMono α]
    [CovariantClass α α (swap (· + ·)) (· ≤ ·)] [ContravariantClass α α (swap (· + ·)) (· ≤ ·)]
    (hf : Antitone f) (hg : Monotone g) (hf₀ : ∀ x, f x ≤ 0)
    (hg₀ : ∀ x, 0 ≤ g x) : Antitone (f * g)

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

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


theorem injOn_sin : InjOn sin (Icc (-(π / 2)) (π / 2))

Set.InjOn Real.sin (Set.Icc (-(Real.pi / 2)) (Real.pi / 2))


theorem Irreducible.associated_of_dvd [Monoid α] {p q : α} (p_irr : Irreducible p)
    (q_irr : Irreducible q) (dvd : p ∣ q) : Associated p q

{α : Type u_1}
[Monoid α]
{p q : α}
(p_irr : Irreducible p)
(q_irr : Irreducible q)
(dvd : p ∣ q)


/-- If `n : ℕ+` is different from `1`, then it is the successor of some `k : ℕ+`. -/
theorem exists_eq_succ_of_ne_one : ∀ {n : ℕ+} (_ : n ≠ 1), ∃ k : ℕ+, n = k + 1


theorem star_mul_self_nonneg (r : R) : 0 ≤ star r * r

{R : Type u}
[NonUnitalSemiring R]
[PartialOrder R]
[StarRing R]
[StarOrderedRing R]
(r : R)


@[simps tensorObj_X tensorHom_hom]
instance monMonoidalStruct : MonoidalCategoryStruct (Mon_ C)

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


theorem tendsto_ceil_atBot : Tendsto (ceil : α → ℤ) atBot atBot

{α : Type u_1}
[LinearOrderedRing α]
[FloorRing α]

Filter.Tendsto Int.ceil Filter.atBot Filter.atBot


theorem gcd_dvd_gcd_mul_left_right (i j k : ℤ) : gcd i j ∣ gcd i (k * j)


@[simp]
theorem edges_append {u v w : V} (p : G.Walk u v) (p' : G.Walk v w) :
    (p.append p').edges = p.edges ++ p'.edges

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


@[to_additive (attr := simp)]
theorem toList_one : toList (1 : FreeMonoid α) = []


theorem mem_promises {s : Computation α} {a : α} : a ∈ s → s ~> a

{α : Type u}
{s : Computation α}
{a : α}


theorem coe_abs_toReal_of_sign_nonneg {θ : Angle} (h : 0 ≤ θ.sign) : ↑|θ.toReal| = θ


@[simp]
theorem coe_toLinearEquiv : ⇑(e : A ≃ₗ[R] B) = e

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[AddCommMonoid A]
[AddCommMonoid B]
[Module R A]
[Module R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]
(e : A ≃ₗc[R] B)


theorem IsCycleOn.zpow_apply_eq_zpow_apply {s : Finset α} (hf : f.IsCycleOn s) (ha : a ∈ s)
    {m n : ℤ} : (f ^ m) a = (f ^ n) a ↔ m ≡ n [ZMOD s.card]

{α : Type u_2}
{f : Equiv.Perm α}
{a : α}
{s : Finset α}
(hf : f.IsCycleOn ↑s)
(ha : a ∈ s)
{m n : ℤ}

(f ^ m) a = (f ^ n) a ↔ m ≡ n [ZMOD ↑s.card]


lemma addNSMul_zero : addNSMul h δ 0 = a

{α : Type u_1}
[LinearOrderedAddCommGroup α]
{a b : α}
(h : a ≤ b)
{δ : α}


@[to_additive (attr := simp) nnnorm_eq_zero]
theorem nnnorm_eq_zero' : ‖a‖₊ = 0 ↔ a = 1

{E : Type u_6}
[NormedAddGroup E]
{a : E}


/-- Composing with a surjective linear map is injective. -/
theorem compLinearMap_injective (f : M₂ →ₗ[R] M) (hf : Function.Surjective f) :
    Function.Injective fun g : M [⋀^ι]→ₗ[R] N => g.compLinearMap f

{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] M)
(hf : Function.Surjective ⇑f)

Function.Injective fun g => g.compLinearMap f


@[simp]
lemma restrictionMap_id : restrictionMap (𝟙 K) e = 𝟙 _

HomologicalComplex.restrictionMap (𝟙 K) e = 𝟙 (K.restriction e)


lemma InfClosed.inter (hs : InfClosed s) (ht : InfClosed t) : InfClosed (s ∩ t)

{α : Type u_2}
[SemilatticeInf α]
{s t : Set α}
(hs : InfClosed s)
(ht : InfClosed t)


@[to_additive prod_top]
theorem prod_top (K : Subgroup G) : K.prod (⊤ : Subgroup N) = K.comap (MonoidHom.fst G N)

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

K.prod ⊤ = AddSubgroup.comap (AddMonoidHom.fst G N) K


@[trans]
theorem IsEquivalent.trans_isBigO {f g₁ : α → β} {g₂ : α → β₂} (h : f ~[l] g₁) (h₂ : g₁ =O[l] g₂) :
    f =O[l] g₂

{α : Type u_1}
{β : Type u_2}
{β₂ : Type u_3}
[NormedAddCommGroup β]
[Norm β₂]
{l : Filter α}
{f g₁ : α → β}
{g₂ : α → β₂}
(h : f ~[l] g₁)
(h₂ : g₁ =O[l] g₂)


theorem card_sups_iff :
    (s ⊻ t).card = s.card * t.card ↔ (s ×ˢ t : Set (α × α)).InjOn fun x => x.1 ⊔ x.2

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

(s ⊻ t).card = s.card * t.card ↔ Set.InjOn (fun x => x.1 ⊔ x.2) (↑s ×ˢ ↑t)


@[to_additive] lemma extend_le_one (hg : g ≤ 1) (he : e ≤ 1) : extend f g e ≤ 1

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[One γ]
[LE γ]
{f : α → β}
{g : α → γ}
{e : β → γ}
(hg : g ≤ 1)
(he : e ≤ 1)


theorem card_complex_embeddings :
    card { φ : K →+* ℂ // ¬ComplexEmbedding.IsReal φ } = 2 * NrComplexPlaces K

(K : Type u_2)
[Field K]
[NumberField K]

Fintype.card { φ // ¬NumberField.ComplexEmbedding.IsReal φ } = 2 * NumberField.InfinitePlace.NrComplexPlaces K


@[simp]
theorem toDFinsupp_singleton (a : α) : toDFinsupp {a} = DFinsupp.single a 1

Multiset.toDFinsupp {a} = DFinsupp.single a 1


@[simp]
theorem not_mem_bot : J ∉ (⊥ : Prepartition I)

{ι : Type u_1}
{I J : BoxIntegral.Box ι}


theorem mem_iff_find_le {x : X} {n : ℕ} : x ∈ K n ↔ K.find x ≤ n

{X : Type u_1}
[TopologicalSpace X]
(K : CompactExhaustion X)
{x : X}
{n : ℕ}


lemma derivedSet_mono (A B : Set X) (h : A ⊆ B) : derivedSet A ⊆ derivedSet B

{X : Type u_1}
[TopologicalSpace X]
(A B : Set X)
(h : A ⊆ B)


lemma cfcₙ_nonneg {f : R → R} {a : A} (h : ∀ x ∈ σₙ R a, 0 ≤ f x) :
    0 ≤ cfcₙ f a

[∀ (α : Type u_1) [inst : Zero α] [inst_1 : TopologicalSpace α], StarOrderedRing C(α, R)₀]


theorem LinearEquiv.AssociatedPrimes.eq (l : M ≃ₗ[R] M') :
    associatedPrimes R M = associatedPrimes R M'

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{M' : Type u_3}
[AddCommGroup M']
[Module R M']
(l : M ≃ₗ[R] M')


nonrec theorem sin_three_mul : sin (3 * x) = 3 * sin x - 4 * sin x ^ 3

Real.sin (3 * x) = 3 * Real.sin x - 4 * Real.sin x ^ 3


lemma inclusion_injective (s : SubMulAction M α) :
    Function.Injective s.inclusion

{M : Type u_1}
{α : Type u_2}
[Monoid M]
[MulAction M α]
(s : SubMulAction M α)


protected theorem naturality {α β} (f : α → F β) (x : σ ⊕ α) :
    η (Sum.traverse f x) = Sum.traverse (@η _ ∘ f) x

{σ : Type u}
{F G : Type u → Type u}
[Applicative F]
[Applicative G]
[LawfulApplicative G]
[LawfulApplicative F]
(η : ApplicativeTransformation F G)
{α : Type u_1}
{β : Type u}
(f : α → F β)
(x : σ ⊕ α)

(fun {α} => η.app α) (Sum.traverse f x) = Sum.traverse ((fun {α} => η.app α) ∘ f) x


theorem Infinite.st_eq {x : ℝ*} (hi : Infinite x) : st x = 0


@[simp]
lemma φ_neg (n : ℤ) : W.φ (-n) = W.φ n

{R : Type r}
[CommRing R]
(W : WeierstrassCurve R)
(n : ℤ)


@[simp]
theorem finInsepDegree_self : finInsepDegree F F = 1


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


@[simp]
theorem cgf_zero_fun : cgf 0 μ t = log (μ Set.univ).toReal

{Ω : Type u_1}
{m : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
{t : ℝ}

ProbabilityTheory.cgf 0 μ t = Real.log (μ Set.univ).toReal


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


theorem pow_eq_one_iff_dvd (l : ℕ) : ζ ^ l = 1 ↔ k ∣ l

{M : Type u_1}
[CommMonoid M]
{k : ℕ}
{ζ : M}
(h : IsPrimitiveRoot ζ k)
(l : ℕ)


/-- Same as `get?_zero_mul_tail_prod`, but avoiding the `List.headI` garbage complication by
  requiring the list to be nonempty. -/
@[to_additive "Same as `get?_zero_add_tail_sum`, but avoiding the `List.headI` garbage complication
  by requiring the list to be nonempty."]
theorem headI_mul_tail_prod_of_ne_nil [Inhabited M] (l : List M) (h : l ≠ []) :
    l.headI * l.tail.prod = l.prod

{M : Type u_4}
[AddMonoid M]
[Inhabited M]
(l : List M)
(h : l ≠ [])


theorem chain'_pair {x y} : Chain' R [x, y] ↔ R x y

{α : Type u}
{R : α → α → Prop}
{x y : α}


/-- Adding an open immersion into an open cover gives another open cover. -/
@[simps]
def OpenCover.add {X Y : Scheme.{u}} (𝒰 : X.OpenCover) (f : Y ⟶ X) [IsOpenImmersion f] :
    X.OpenCover

{X Y : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)
(f : Y ⟶ X)
[AlgebraicGeometry.IsOpenImmersion f]
(i : Option 𝒰.J)


theorem testAgainstNN_lipschitz (μ : ProbabilityMeasure Ω) :
    LipschitzWith 1 fun f : Ω →ᵇ ℝ≥0 => μ.toFiniteMeasure.testAgainstNN f

(μ : MeasureTheory.ProbabilityMeasure Ω)

LipschitzWith 1 fun f => μ.toFiniteMeasure.testAgainstNN f


theorem LocallyConvexSpace.ofBases {ι : Type*} (b : E → ι → Set E) (p : E → ι → Prop)
    (hbasis : ∀ x : E, (𝓝 x).HasBasis (p x) (b x)) (hconvex : ∀ x i, p x i → Convex 𝕜 (b x i)) :
    LocallyConvexSpace 𝕜 E

(hbasis : ∀ (x : E), (𝓝 x).HasBasis (p x) (b x))

(hconvex : ∀ (x : E) (i : ι), p x i → Convex 𝕜 (b x i))


/--
The `Applicative` typeclass only contains the operations of an applicative functor.
`LawfulApplicative` further asserts that these operations satisfy the laws of an applicative functor:
```
pure id <*> v = v
pure (·∘·) <*> u <*> v <*> w = u <*> (v <*> w)
pure f <*> pure x = pure (f x)
u <*> pure y = pure (· y) <*> u
```
-/
class LawfulApplicative (f : Type u → Type v) [Applicative f] extends LawfulFunctor f : Prop where
  seqLeft_eq  (x : f α) (y : f β)     : x <* y = const β <$> x <*> y
  seqRight_eq (x : f α) (y : f β)     : x *> y = const α id <$> x <*> y
  pure_seq    (g : α → β) (x : f α)   : pure g <*> x = g <$> x
  map_pure    (g : α → β) (x : α)     : g <$> (pure x : f α) = pure (g x)
  seq_pure    {α β : Type u} (g : f (α → β)) (x : α) : g <*> pure x = (fun h => h x) <$> g
  seq_assoc   {α β γ : Type u} (x : f α) (g : f (α → β)) (h : f (β → γ)) : h <*> (g <*> x) = ((@comp α β γ) <$> h) <*> g <*> x
  comp_map g h x := (by
    repeat rw [← pure_seq]
    simp [seq_assoc, map_pure, seq_pure])

{f : Type u → Type v}
[Applicative f]
[self : LawfulApplicative f]
{α β : Type u}
(g : α → β)
(x : f α)

(Seq.seq (pure g) fun x_1 => x) = g <$> x


theorem left_dom_of_append_dom [Append α] {a b : Part α} (hab : Dom (a ++ b)) : a.Dom

{α : Type u_1}
[Append α]
{a b : Part α}
(hab : (a ++ b).Dom)


/-- A version of `sum_mapDomain_index` that takes a bundled `AddMonoidHom`,
rather than separate linearity hypotheses.
-/
@[simp]
theorem sum_mapDomain_index_addMonoidHom [AddCommMonoid N] {f : α → β} {s : α →₀ M}
    (h : β → M →+ N) : ((mapDomain f s).sum fun b m => h b m) = s.sum fun a m => h (f a) m

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
{N : Type u_7}
[AddCommMonoid M]
[AddCommMonoid N]
{f : α → β}
{s : α →₀ M}
(h : β → M →+ N)

((Finsupp.mapDomain f s).sum fun b m => (h b) m) = s.sum fun a m => (h (f a)) m


@[simp]
theorem pow_le_kstar : ∀ {n : ℕ}, a ^ n ≤ a∗

{α : Type u_1}
[KleeneAlgebra α]
{a : α}
{n : ℕ}


@[simp]
theorem ofMul_le {a b : α} : ofMul a ≤ ofMul b ↔ a ≤ b

Additive.ofMul a ≤ Additive.ofMul b ↔ a ≤ b


/-- The canonical additive morphism `S.X₁ →+ AddMonoidHom.ker S.g` induced by `S.f`. -/
@[simps!]
def abToCycles : S.X₁ →+ AddMonoidHom.ker S.g

(S : CategoryTheory.ShortComplex Ab)
(x : ↑S.X₁)


@[reassoc]
lemma assoc_inv_app (h : ShiftMkCore C A) (m₁ m₂ m₃ : A) (X : C) :
    (h.F m₃).map ((h.add m₁ m₂).inv.app X) ≫ (h.add (m₁ + m₂) m₃).inv.app X =
    (h.add m₂ m₃).inv.app ((h.F m₁).obj X) ≫ (h.add m₁ (m₂ + m₃)).inv.app X ≫
      eqToHom (by rw [add_assoc])

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

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


@[simp]
theorem mem_map {S : Subalgebra R A} {f : A →ₐ[R] B} {y : B} : y ∈ map f S ↔ ∃ x ∈ S, f x = y

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
{S : Subalgebra R A}
{f : A →ₐ[R] B}
{y : B}

y ∈ Subalgebra.map f S ↔ ∃ x ∈ S, f x = y


theorem clusterPt_principal_iff_frequently :
    ClusterPt x (𝓟 s) ↔ ∃ᶠ y in 𝓝 x, y ∈ s

{X : Type u}
{x : X}
{s : Set X}
[TopologicalSpace X]

ClusterPt x (𝓟 s) ↔ ∃ᶠ (y : X) in 𝓝 x, y ∈ s


/-- Homomorphisms on the quotient of a monoid by a congruence relation are equal if they
    are equal on elements that are coercions from the monoid. -/
@[to_additive "Homomorphisms on the quotient of an `AddMonoid` by an additive congruence relation
are equal if they are equal on elements that are coercions from the `AddMonoid`."]
theorem lift_funext (f g : c.Quotient →* P) (h : ∀ a : M, f a = g a) : f = g

{M : Type u_1}
{P : Type u_3}
[MulOneClass M]
[MulOneClass P]
{c : Con M}
(f g : c.Quotient →* P)
(h : ∀ (a : M), f ↑a = g ↑a)


theorem mapM'_eq_mapM [Monad m] [LawfulMonad m] (f : α → m β) (l : List α) :
    mapM' f l = mapM f l

{m : Type u_1 → Type u_2}
{α : Type u_3}
{β : Type u_1}
[Monad m]
[LawfulMonad m]
(f : α → m β)
(l : List α)
(acc : List β)

List.mapM.loop f l acc = do
  let __do_lift ← List.mapM' f l
  pure (acc.reverse ++ __do_lift)


/-- Infinitely many natural numbers are equal to `d` mod `n`. -/
theorem frequently_modEq {n : ℕ} (h : n ≠ 0) (d : ℕ) : ∃ᶠ m in atTop, m ≡ d [MOD n]

∃ᶠ (m : ℕ) in Filter.atTop, m ≡ d [MOD n]


@[norm_cast] -- @[simp, norm_cast] -- Porting note: not in simpNF
theorem coe_subset_coe : (s : Set α) ⊆ t ↔ s ≤ t

{α : Type u_1}
[PartialOrder α]
{s t : Interval α}

↑s ⊆ ↑t ↔ s ≤ t


theorem LinearIsometry.im_apply_eq_im_or_neg_of_re_apply_eq_re {f : ℂ →ₗᵢ[ℝ] ℂ}
    (h₂ : ∀ z, (f z).re = z.re) (z : ℂ) : (f z).im = z.im ∨ (f z).im = -z.im

{f : ℂ →ₗᵢ[ℝ] ℂ}
(h₂ : ∀ (z : ℂ), (f z).re = z.re)
(z : ℂ)


theorem normalizeObj_congr (n : NormalMonoidalObject C) {X Y : F C} (f : X ⟶ Y) :
    normalizeObj X n = normalizeObj Y n

(n : CategoryTheory.FreeMonoidalCategory.NormalMonoidalObject C)

{X Y : CategoryTheory.FreeMonoidalCategory C}


@[aesop safe (rule_sets := [Matroid])]
private theorem ground_subset_ground {M : Matroid α} : M.E ⊆ M.E