/-- Formula for `hurwitzZetaEven` as a Dirichlet series in the convergence range, with sum over `ℕ`
(version without absolute values, assuming `a ∈ Icc 0 1`) -/
lemma hasSum_nat_hurwitzZetaEven_of_mem_Icc {a : ℝ} (ha : a ∈ Icc 0 1) {s : ℂ} (hs : 1 < re s) :
    HasSum (fun n : ℕ ↦ (1 / (n + a : ℂ) ^ s + 1 / (n + 1 - a : ℂ) ^ s) / 2)
    (hurwitzZetaEven a s)

{a : ℝ}
(ha : a ∈ Set.Icc 0 1)
{s : ℂ}
(hs : 1 < s.re)

HasSum (fun n => (1 / (↑n + ↑a) ^ s + 1 / (↑n + 1 - ↑a) ^ s) / 2) (HurwitzZeta.hurwitzZetaEven (↑a) s)


theorem chainHeight_mono (h : s ⊆ t) : s.chainHeight ≤ t.chainHeight

{α : Type u_1}
[LT α]
{s t : Set α}
(h : s ⊆ t)


theorem exists_sum_eq_one_iff_pairwise_coprime [DecidableEq I] (h : t.Nonempty) :
    (∃ μ : I → R, (∑ i ∈ t, μ i * ∏ j ∈ t \ {i}, s j) = 1) ↔
      Pairwise (IsCoprime on fun i : t ↦ s i)

{R : Type u}
{I : Type v}
[CommSemiring R]
{s : I → R}
{t : Finset I}
[DecidableEq I]
(h : t.Nonempty)

(∃ μ, ∑ i ∈ t, μ i * ∏ j ∈ t \ {i}, s j = 1) ↔ Pairwise (IsCoprime on fun i => s ↑i)


@[to_additive (attr := simp)]
theorem mk_le_mk {s t : Subsemigroup M} (h_one) (h_one') : mk s h_one ≤ mk t h_one' ↔ s ≤ t

{M : Type u_1}
[MulOneClass M]
{s t : Subsemigroup M}
(h_one : 1 ∈ s.carrier)
(h_one' : 1 ∈ t.carrier)

{ toSubsemigroup := s, one_mem' := h_one } ≤ { toSubsemigroup := t, one_mem' := h_one' } ↔ s ≤ t


protected lemma le_or_lt (a b : Fin n) : a ≤ b ∨ b < a


@[to_additive]
theorem ae_measure_preimage_mul_right_lt_top_of_ne_zero (h2s : ν' s ≠ 0) (h3s : ν' s ≠ ∞) :
    ∀ᵐ x ∂μ', ν' ((fun y => y * x) ⁻¹' s) < ∞

{G : Type u_1}
[MeasurableSpace G]
[AddGroup G]
[MeasurableAdd₂ G]
{s : Set G}
[MeasurableNeg G]
(μ' ν' : MeasureTheory.Measure G)
[MeasureTheory.SigmaFinite μ']
[MeasureTheory.SigmaFinite ν']
[μ'.IsAddLeftInvariant]
[ν'.IsAddLeftInvariant]
(h2s : ν' s ≠ 0)
(h3s : ν' s ≠ ⊤)

∀ᵐ (x : G) ∂μ', ν' ((fun y => y + x) ⁻¹' s) < ⊤


theorem degree_interpolate_le (hvs : Set.InjOn v s) :
    (interpolate s v r).degree ≤ ↑(s.card - 1)

{F : Type u_1}
[Field F]
{ι : Type u_2}
[DecidableEq ι]
{s : Finset ι}
{v : ι → F}
(r : ι → F)
(hvs : Set.InjOn v ↑s)

((Lagrange.interpolate s v) r).degree ≤ ↑(s.card - 1)


@[simp]
lemma preΨ'_four : W.preΨ' 4 = W.preΨ₄

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


/-- For disjoint `s t : Set α`, the natural injection from `↑s ⊕ ↑t` to `α`. -/
@[simps] def Function.Embedding.sumSet (h : Disjoint s t) : s ⊕ t ↪ α

{α : Type u_1}
{s t : Set α}
(h : Disjoint s t)

∀ (a : ↑s ⊕ ↑t), (Function.Embedding.sumSet h) a = Sum.elim Subtype.val Subtype.val a


/-- The power series expansion of `Real.arctan`, valid on `-1 < x < 1`. -/
theorem Real.hasSum_arctan {x : ℝ} (hx : ‖x‖ < 1) :
    HasSum (fun n : ℕ => (-1) ^ n * x ^ (2 * n + 1) / ↑(2 * n + 1)) (arctan x)


/-- `x ↦ fderiv 𝕜 (f x) (g x)` is smooth at `x₀`. -/
protected theorem ContDiffAt.fderiv {f : E → F → G} {g : E → F} {n : ℕ∞}
    (hf : ContDiffAt 𝕜 n (Function.uncurry f) (x₀, g x₀)) (hg : ContDiffAt 𝕜 m g x₀)
    (hmn : m + 1 ≤ n) : ContDiffAt 𝕜 m (fun x => fderiv 𝕜 (f x) (g x)) x₀


/-- When the first map `S.f` is zero, this is the right homology data on `S` given by
the chosen `kernel S.g` -/
@[simps!]
noncomputable def ofHasKernel [HasKernel S.g] (hf : S.f = 0) : S.RightHomologyData

(CategoryTheory.ShortComplex.RightHomologyData.ofHasKernel S hf).H = CategoryTheory.Limits.kernel S.g


theorem Matrix.toLinAlgEquiv_apply (M : Matrix n n R) (v : M₁) :
    Matrix.toLinAlgEquiv v₁ M v = ∑ j, (M *ᵥ v₁.repr v) j • v₁ j

{R : Type u_1}
[CommSemiring R]
{n : Type u_4}
[Fintype n]
[DecidableEq n]
{M₁ : Type u_5}
[AddCommMonoid M₁]
[Module R M₁]
(v₁ : Basis n R M₁)
(M : Matrix n n R)
(v : M₁)

((Matrix.toLinAlgEquiv v₁) M) v = ∑ j : n, (M *ᵥ ⇑(v₁.repr v)) j • v₁ j


/-- The typeclass `Category C` describes morphisms associated to objects of type `C`.
The universe levels of the objects and morphisms are unconstrained, and will often need to be
specified explicitly, as `Category.{v} C`. (See also `LargeCategory` and `SmallCategory`.)

See <https://stacks.math.columbia.edu/tag/0014>.
-/
@[pp_with_univ]
class Category (obj : Type u) extends CategoryStruct.{v} obj : Type max u (v + 1) where
  /-- Identity morphisms are left identities for composition. -/
  id_comp : ∀ {X Y : obj} (f : X ⟶ Y), 𝟙 X ≫ f = f := by aesop_cat
  /-- Identity morphisms are right identities for composition. -/
  comp_id : ∀ {X Y : obj} (f : X ⟶ Y), f ≫ 𝟙 Y = f := by aesop_cat
  /-- Composition in a category is associative. -/
  assoc : ∀ {W X Y Z : obj} (f : W ⟶ X) (g : X ⟶ Y) (h : Y ⟶ Z), (f ≫ g) ≫ h = f ≫ g ≫ h := by
    aesop_cat

[self : CategoryTheory.Category.{v, u} obj]

CategoryTheory.CategoryStruct.comp (CategoryTheory.CategoryStruct.comp f g) h =
  CategoryTheory.CategoryStruct.comp f (CategoryTheory.CategoryStruct.comp g h)


theorem starClosure_le_iff {S₁ : Subalgebra R A} {S₂ : StarSubalgebra R A} :
    S₁.starClosure ≤ S₂ ↔ S₁ ≤ S₂.toSubalgebra

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
{S₁ : Subalgebra R A}
{S₂ : StarSubalgebra R A}


@[to_additive]
theorem MonoidHom.map_mulIndicator {M N : Type*} [MulOneClass M] [MulOneClass N] (f : M →* N)
    (s : Set α) (g : α → M) (x : α) : f (s.mulIndicator g x) = s.mulIndicator (f ∘ g) x

{α : Type u_1}
{M : Type u_6}
{N : Type u_7}
[AddZeroClass M]
[AddZeroClass N]
(f : M →+ N)
(s : Set α)
(g : α → M)
(x : α)

f (s.indicator g x) = s.indicator (⇑f ∘ g) x


theorem ext_abs_arg_iff {x y : ℂ} : x = y ↔ abs x = abs y ∧ arg x = arg y

x = y ↔ Complex.abs x = Complex.abs y ∧ x.arg = y.arg


@[simp]
theorem isubtree_cons [DecidableEq F.A] [Inhabited (M F)] (ps : Path F) {a} (f : F.B a → M F)
    {i : F.B a} : isubtree (⟨_, i⟩ :: ps) (M.mk ⟨a, f⟩) = isubtree ps (f i)

{F : PFunctor.{u}}
[DecidableEq F.A]
[Inhabited F.M]
(ps : PFunctor.Approx.Path F)
{a : F.A}
(f : F.B a → F.M)
{i : F.B a}

PFunctor.M.isubtree (⟨a, i⟩ :: ps) (PFunctor.M.mk ⟨a, f⟩) = PFunctor.M.isubtree ps (f i)


theorem mem_iff_mem (f : α ≃. β) : ∀ {a : α} {b : β}, a ∈ f.symm b ↔ b ∈ f a

{α : Type u}
{β : Type v}
(f : α ≃. β)
{a : α}
{b : β}


theorem rank_le_card_height [Fintype m] [StrongRankCondition R] (A : Matrix m n R) :
    A.rank ≤ Fintype.card m

{m : Type u_2}
{n : Type u_3}
{R : Type u_5}
[Fintype n]
[CommRing R]
[Fintype m]
[StrongRankCondition R]
(A : Matrix m n R)


theorem cons_inj_right (a : α) {l l' : List α} : a :: l = a :: l' ↔ l = l'


@[to_additive (attr := simp)]
lemma card_four' {G : Type*} [Group G] [Fintype G] [IsKleinFour G] :
    Fintype.card G = 4

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


@[simp]
theorem length_cons (a b c : V) (p : Path a b) (e : b ⟶ c) : (p.cons e).length = p.length + 1

{V : Type u}
[Quiver V]
(a b c : V)
(p : Quiver.Path a b)
(e : b ⟶ c)


theorem coe_linearMapAt (e : Trivialization F (π F E)) [e.IsLinear R] (b : B) :
    ⇑(e.linearMapAt R b) = fun y => if b ∈ e.baseSet then (e ⟨b, y⟩).2 else 0

[TopologicalSpace (Bundle.TotalSpace F E)]

(e : Trivialization F Bundle.TotalSpace.proj)

⇑(Trivialization.linearMapAt R e b) = fun y => if b ∈ e.baseSet then (↑e { proj := b, snd := y }).2 else 0


theorem lower_le_upper : I.lower ≤ I.upper


protected theorem congr_fun {f g : A →ₑ+[φ] B} (h : f = g) (x : A) : f x = g x

{M : Type u_1}
[Monoid M]
{N : Type u_2}
[Monoid N]
{φ : M →* N}
{A : Type u_4}
[AddMonoid A]
[DistribMulAction M A]
{B : Type u_5}
[AddMonoid B]
[DistribMulAction N B]
{f g : A →ₑ+[φ] B}
(h : f = g)
(x : A)


@[simp]
theorem equivQuotient_symm_proj_apply (x : α) : hs.equivQuotient.symm (hs.proj x) = hs.index x

{ι : Type u_1}
{α : Type u_2}
{s : ι → Set α}
(hs : IndexedPartition s)
(x : α)


/-- If `X` is a cofiltered limit of profinite sets, then any clopen subset of `X` arises from
a clopen set in one of the terms in the limit.
-/
theorem exists_isClopen_of_cofiltered {U : Set C.pt} (hC : IsLimit C) (hU : IsClopen U) :
    ∃ (j : J) (V : Set (F.obj j)), IsClopen V ∧ U = C.π.app j ⁻¹' V

{F : CategoryTheory.Functor J Profinite}

∃ j V, IsClopen V ∧ U = ⇑(C.π.app j) ⁻¹' V


theorem Int.Prime.dvd_mul {m n : ℤ} {p : ℕ} (hp : Nat.Prime p) (h : (p : ℤ) ∣ m * n) :
    p ∣ m.natAbs ∨ p ∣ n.natAbs

{m n : ℤ}
{p : ℕ}
(hp : Nat.Prime p)
(h : ↑p ∣ m * n)


theorem ring_inverse_eq_map_inverse : Ring.inverse = @inverse R M M _ _ _ _ _ _ _

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


@[reassoc (attr := simp)]
theorem inr_inr_pushoutAssoc_inv [HasPushout (g₃ ≫ (pushout.inr _ _ : X₂ ⟶ Y₁)) g₄]
    [HasPushout g₁ (g₂ ≫ (pushout.inl _ _ : X₂ ⟶ Y₂))] :
    pushout.inr _ _ ≫ pushout.inr _ _ ≫ (pushoutAssoc g₁ g₂ g₃ g₄).inv = pushout.inr _ _

[CategoryTheory.Limits.HasPushout (g₃ ≫ CategoryTheory.Limits.pushout.inr g₁ g₂) g₄]

[CategoryTheory.Limits.HasPushout g₁ (g₂ ≫ CategoryTheory.Limits.pushout.inl g₃ g₄)]

CategoryTheory.Limits.pushout.inr g₃ g₄ ≫
    CategoryTheory.Limits.pushout.inr g₁ (g₂ ≫ CategoryTheory.Limits.pushout.inl g₃ g₄) ≫
      (CategoryTheory.Limits.pushoutAssoc g₁ g₂ g₃ g₄).inv =
  CategoryTheory.Limits.pushout.inr (g₃ ≫ CategoryTheory.Limits.pushout.inr g₁ g₂) g₄


@[to_additive (attr := simp)] lemma oneLePart_apply (f : ∀ i, α i) (i : ι) : f⁺ i = (f i)⁺

{ι : Type u_3}
{α : ι → Type u_4}
[(i : ι) → Lattice (α i)]
[(i : ι) → AddCommGroup (α i)]
(f : (i : ι) → α i)
(i : ι)


@[simp]
theorem comp_id (f : α →+*o β) : f.comp (OrderRingHom.id α) = f

{α : Type u_2}
{β : Type u_3}
[NonAssocSemiring α]
[Preorder α]
[NonAssocSemiring β]
[Preorder β]
(f : α →+*o β)


protected theorem self (a : α) : variationOnFromTo f s a a = 0

{α : Type u_1}
[LinearOrder α]
{E : Type u_2}
[PseudoEMetricSpace E]
(f : α → E)
(s : Set α)
(a : α)


/-- The equivalence `(x, y) ↦ (x+1, y)`. -/
@[simps!]
def shiftRight : ℤ × ℤ ≃ ℤ × ℤ

∀ (a : ℤ × ℤ), SetTheory.PGame.Domineering.shiftRight.symm a = Prod.map (fun x => x + -1) id a


theorem iteratedDeriv_const_smul {n : ℕ} {f : 𝕜 → F} (h : ContDiff 𝕜 n f) (c : 𝕜) :
    iteratedDeriv n (fun x => f (c * x)) = fun x => c ^ n • iteratedDeriv n f (c * x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ}
{f : 𝕜 → F}
(h : ContDiff 𝕜 (↑n) f)
(c : 𝕜)

(iteratedDeriv n fun x => f (c * x)) = fun x => c ^ n • iteratedDeriv n f (c * x)


@[to_additive] lemma oneLePart_le_one : a⁺ᵐ ≤ 1 ↔ a ≤ 1

{α : Type u_1}
[Lattice α]
[AddGroup α]
{a : α}

a⁺ ≤ 0 ↔ a ≤ 0


/-- Fundamental theorem of calculus: if `f : ℝ → E` is integrable on `a..b` and `f x` has a finite
limit `c` almost surely as `x` tends to `b` from the right or from the left,
then `u ↦ ∫ x in a..u, f x` has right (resp., left) derivative `c` at `b`. -/
theorem integral_hasDerivWithinAt_of_tendsto_ae_right (hf : IntervalIntegrable f volume a b)
    {s t : Set ℝ} [FTCFilter b (𝓝[s] b) (𝓝[t] b)] (hmeas : StronglyMeasurableAtFilter f (𝓝[t] b))
    (hb : Tendsto f (𝓝[t] b ⊓ ae volume) (𝓝 c)) :
    HasDerivWithinAt (fun u => ∫ x in a..u, f x) c s b

(hf : IntervalIntegrable f MeasureTheory.volume a b)

[intervalIntegral.FTCFilter b (𝓝[s] b) (𝓝[t] b)]

(hmeas : StronglyMeasurableAtFilter f (𝓝[t] b) MeasureTheory.volume)

(hb : Filter.Tendsto f (𝓝[t] b ⊓ MeasureTheory.ae MeasureTheory.volume) (𝓝 c))

HasDerivWithinAt (fun u => ∫ (x : ℝ) in a..u, f x) c s b


@[to_additive Iic_add_Iio_subset]
theorem Iic_mul_Iio_subset' [LocallyFiniteOrderBot α] (a b : α) : Iic a * Iio b ⊆ Iio (a * b)

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

[CovariantClass α α (Function.swap HMul.hMul) LT.lt]

Finset.Iic a * Finset.Iio b ⊆ Finset.Iio (a * b)


@[to_additive]
theorem zpow_eq_one_iff_modEq {n : ℤ} : x ^ n = 1 ↔ n ≡ 0 [ZMOD orderOf x]

{G : Type u_1}
[Group G]
{x : G}
{n : ℤ}


theorem not_prime_mul_of_ble (a b n : ℕ) (h : a * b = n) (h₁ : a.ble 1 = false)
    (h₂ : b.ble 1 = false) : ¬ n.Prime


@[reassoc (attr := simp)]
lemma ρFunctorObj_π : ρFunctorObj f πX ≫ πFunctorObj f πX = π'FunctorObj f πX

[CategoryTheory.Limits.HasColimitsOfShape (CategoryTheory.Discrete (CategoryTheory.SmallObject.FunctorObjIndex f πX)) C]

[CategoryTheory.Limits.HasPushout (CategoryTheory.SmallObject.functorObjTop f πX)
    (CategoryTheory.SmallObject.functorObjLeft f πX)]

CategoryTheory.CategoryStruct.comp (CategoryTheory.SmallObject.ρFunctorObj f πX)
    (CategoryTheory.SmallObject.πFunctorObj f πX) =
  CategoryTheory.SmallObject.π'FunctorObj f πX


/--
As `0` is the default value for `Real.sSup` of the empty set or sets which are not bounded above, it
suffices to show that all elements of `S` are bounded by a nonnegative number to show that `sSup S`
is bounded by this number.
-/
protected theorem sSup_le {S : Set ℝ} {a : ℝ} (hS : ∀ x ∈ S, x ≤ a) (ha : 0 ≤ a) : sSup S ≤ a


/-- If a sigma-algebra is generated by a set of sets `s`, then the sigma-algebra has cardinality at
most `(max #s 2) ^ ℵ₀`. -/
theorem cardinal_generateMeasurable_le (s : Set (Set α)) :
    #{ t | GenerateMeasurable s t } ≤ max #s 2 ^ aleph0.{u}

#↑{t | MeasurableSpace.GenerateMeasurable s t} ≤ max (#↑s) 2 ^ ℵ₀


theorem add_mul_right_left_iff : IsRelPrime (x + z * y) y ↔ IsRelPrime x y


theorem mem_vars_rename (f : σ → τ) (φ : MvPolynomial σ R) {j : τ} (h : j ∈ (rename f φ).vars) :
    ∃ i : σ, i ∈ φ.vars ∧ f i = j

(h : j ∈ ((MvPolynomial.rename f) φ).vars)


@[reassoc (attr := simp)]
theorem objEqToHom_d {x y : β} (h : x = y) :
    X.objEqToHom h ≫ X.d y = X.d x ≫ X.objEqToHom (by cases h; rfl)

(X : CategoryTheory.DifferentialObject ℤ (CategoryTheory.GradedObjectWithShift b V))

X.objEqToHom h ≫ X.d y = X.d x ≫ X.objEqToHom ⋯


/-- If `x` is not an isolated point of a topological space, then `{x}ᶜ` is dense in the whole
space. -/
theorem dense_compl_singleton (x : X) [NeBot (𝓝[≠] x)] : Dense ({x}ᶜ : Set X)

{X : Type u}
[TopologicalSpace X]
(x : X)
[(𝓝[≠] x).NeBot]


@[simp]
theorem card_powersetCard (n : ℕ) (s : Multiset α) :
    card (powersetCard n s) = Nat.choose (card s) n

Multiset.card (Multiset.powersetCard n s) = (Multiset.card s).choose n


lemma ext_to_X (i j : ι) (hij : c.Rel i j) {A : C} {f g : A ⟶ X φ i}
    (h₁ : f ≫ fstX φ i j hij = g ≫ fstX φ i j hij) (h₂ : f ≫ sndX φ i = g ≫ sndX φ i) :
    f = g

{f g : A ⟶ HomologicalComplex.homotopyCofiber.X φ i}

(h₁ : f ≫ HomologicalComplex.homotopyCofiber.fstX φ i j hij = g ≫ HomologicalComplex.homotopyCofiber.fstX φ i j hij)

(h₂ : f ≫ HomologicalComplex.homotopyCofiber.sndX φ i = g ≫ HomologicalComplex.homotopyCofiber.sndX φ i)


theorem scaleRoots_eval₂_eq_zero {p : S[X]} (f : S →+* R) {r : R} {s : S} (hr : eval₂ f r p = 0) :
    eval₂ f (f s * r) (scaleRoots p s) = 0

{R : Type u_1}
{S : Type u_2}
[Semiring S]
[CommSemiring R]
{p : Polynomial S}
(f : S →+* R)
{r : R}
{s : S}
(hr : Polynomial.eval₂ f r p = 0)

Polynomial.eval₂ f (f s * r) (p.scaleRoots s) = 0


@[simp]
theorem pure_bind (a : α) (m : α → Filter β) : bind (pure a) m = m a

{α : Type u}
{β : Type v}
(a : α)
(m : α → Filter β)


theorem upperSemicontinuous_biInf {p : ι → Prop} {f : ∀ i, p i → α → δ}
    (h : ∀ i hi, UpperSemicontinuous (f i hi)) :
    UpperSemicontinuous fun x' => ⨅ (i) (hi), f i hi x'

(h : ∀ (i : ι) (hi : p i), UpperSemicontinuous (f i hi))

UpperSemicontinuous fun x' => ⨅ i, ⨅ (hi : p i), f i hi x'


lemma IsConjExponent.conjExponent (h : 1 < p) : p.IsConjExponent (conjExponent p)


@[reassoc (attr := simp)]
lemma singleObjCyclesSelfIso_inv_homologyπ  :
    (singleObjCyclesSelfIso _ _ _).inv ≫ ((single C c j).obj A).homologyπ j =
      (singleObjHomologySelfIso _ _ _).inv

(HomologicalComplex.singleObjCyclesSelfIso c j A).inv ≫ ((HomologicalComplex.single C c j).obj A).homologyπ j =
  (HomologicalComplex.singleObjHomologySelfIso c j A).inv


@[simp]
theorem powersetAux'_nil : powersetAux' (@nil α) = [0]


/-- If `M` and `N` are linearly disjoint, if one of `M` and `N` is flat,
if any two elements of `↥(M ⊓ N)` are commutative, then the rank of `↥(M ⊓ N)` is at most one. -/
theorem rank_inf_le_one_of_commute_of_flat (hf : Module.Flat R M ∨ Module.Flat R N)
    (hc : ∀ (m n : ↥(M ⊓ N)), Commute m.1 n.1) : Module.rank R ↥(M ⊓ N) ≤ 1

(hf : Module.Flat R ↥M ∨ Module.Flat R ↥N)

(hc : ∀ (m n : ↥(M ⊓ N)), Commute ↑m ↑n)


theorem Matrix.lie_transpose (A B : Matrix n n R) : ⁅A, B⁆ᵀ = ⁅Bᵀ, Aᵀ⁆

{R : Type u}
{n : Type w}
[CommRing R]
[DecidableEq n]
[Fintype n]
(A B : Matrix n n R)

⁅A, B⁆.transpose = ⁅B.transpose, A.transpose⁆


theorem disjoint_right_ordSeparatingSet : Disjoint t (ordSeparatingSet s t)

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


theorem mul_one_add [LeftDistribClass α] (a b : α) : a * (1 + b) = a + a * b

{α : Type u}
[Add α]
[MulOneClass α]
[LeftDistribClass α]
(a b : α)


theorem sheafify_hom_ext {P Q : Cᵒᵖ ⥤ D} (η γ : sheafify J P ⟶ Q) (hQ : Presheaf.IsSheaf J Q)
    (h : toSheafify J P ≫ η = toSheafify J P ≫ γ) : η = γ

(J : CategoryTheory.GrothendieckTopology C)

(hQ : CategoryTheory.Presheaf.IsSheaf J Q)

(h :
  CategoryTheory.CategoryStruct.comp (CategoryTheory.toSheafify J P) η =
    CategoryTheory.CategoryStruct.comp (CategoryTheory.toSheafify J P) γ)


@[to_additive (attr := simp)]
theorem mulIndicator_one (s : Set α) : (mulIndicator s fun _ => (1 : M)) = fun _ => (1 : M)

{α : Type u_1}
(M : Type u_4)
[Zero M]
(s : Set α)


@[to_additive (attr := fun_prop) sub]
theorem ContinuousOn.div' (hf : ContinuousOn f s) (hg : ContinuousOn g s) :
    ContinuousOn (fun x => f x / g x) s

{G : Type w}
{α : Type u}
[TopologicalSpace G]
[Sub G]
[ContinuousSub G]
[TopologicalSpace α]
{f g : α → G}
{s : Set α}
(hf : ContinuousOn f s)
(hg : ContinuousOn g s)


theorem toFinset_prod_dvd_prod [CommMonoid α] (S : Multiset α) : S.toFinset.prod id ∣ S.prod

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


theorem Ici_subset_Ico_union_Ici : Ici a ⊆ Ico a b ∪ Ici b

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


lemma rpow_sub_one' (hx : 0 ≤ x) (h : y - 1 ≠ 0) : x ^ (y - 1) = x ^ y / x


theorem loc_const {x : R} (h : (v x : Γ₀) ≠ 0) : { y : R | v y = v x } ∈ 𝓝 x

{R : Type u}
[Ring R]
{Γ₀ : Type v}
[LinearOrderedCommGroupWithZero Γ₀]
[_i : Valued R Γ₀]
{x : R}
(h : Valued.v x ≠ 0)


@[to_additive]
nonrec theorem SmoothOn.div {f g : M → G} {s : Set M} (hf : SmoothOn I' I f s)
    (hg : SmoothOn I' I g s) : SmoothOn I' I (f / g) s

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_5}
[TopologicalSpace G]
[ChartedSpace H G]
[AddGroup G]
[LieAddGroup I G]
{E' : Type u_6}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_7}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_8}
[TopologicalSpace M]
[ChartedSpace H' M]
{f g : M → G}
{s : Set M}
(hf : SmoothOn I' I f s)
(hg : SmoothOn I' I g s)


theorem ssubset_iff_exists_cons_subset : s ⊂ t ↔ ∃ (a : _) (h : a ∉ s), s.cons a h ⊆ t

s ⊂ t ↔ ∃ a, ∃ (h : a ∉ s), Finset.cons a s h ⊆ t


theorem Fintype.card_subtype_or_disjoint (p q : α → Prop) (h : Disjoint p q) [Fintype { x // p x }]
    [Fintype { x // q x }] [Fintype { x // p x ∨ q x }] :
    Fintype.card { x // p x ∨ q x } = Fintype.card { x // p x } + Fintype.card { x // q x }

{α : Type u_1}
(p q : α → Prop)
(h : Disjoint p q)
[Fintype { x // p x }]
[Fintype { x // q x }]
[Fintype { x // p x ∨ q x }]


theorem is3Clique_iff_exists_cycle_length_three :
    (∃ s : Finset α, G.IsNClique 3 s) ↔ ∃ (u : α) (w : G.Walk u u), w.IsCycle ∧ w.length = 3

(∃ s, G.IsNClique 3 s) ↔ ∃ u w, w.IsCycle ∧ w.length = 3


/-- Like `Submodule.map_mul`, but with the multiplication reversed. -/
theorem submodule_map_mul_reverse (p q : Submodule R (CliffordAlgebra Q)) :
    (p * q).map (reverse : CliffordAlgebra Q →ₗ[R] CliffordAlgebra Q) =
      q.map (reverse : CliffordAlgebra Q →ₗ[R] CliffordAlgebra Q) *
        p.map (reverse : CliffordAlgebra Q →ₗ[R] CliffordAlgebra Q)

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
(Q : QuadraticForm R M)
(p q : Submodule R (CliffordAlgebra Q))

Submodule.map CliffordAlgebra.reverse (p * q) =
  Submodule.map CliffordAlgebra.reverse q * Submodule.map CliffordAlgebra.reverse p


@[to_additive (attr := simp)] lemma inv_mul_cancel_comm_assoc (a b : G) : a⁻¹ * (b * a) = b


@[simp]
theorem source (F : Homotopy p₀ p₁) (t : I) : F (t, 0) = x₀

{X : Type u}
[TopologicalSpace X]
{x₀ x₁ : X}
{p₀ p₁ : Path x₀ x₁}
(F : p₀.Homotopy p₁)
(t : ↑I)


@[to_additive]
lemma dite_lt_one [LT α] (ha : ∀ h, a h < 1) (hb : ∀ h, b h < 1) : dite p a b < 1

{α : Type u_2}
[Zero α]
{p : Prop}
[Decidable p]
{a : p → α}
{b : ¬p → α}
[LT α]
(ha : ∀ (h : p), a h < 0)
(hb : ∀ (h : ¬p), b h < 0)


theorem Antitone.imp (hf : Antitone f) (h : a ≤ b) : f b ≤ f a

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
{a b : α}
(hf : Antitone f)
(h : a ≤ b)


@[simp]
theorem coe_rangeRestrictField (f : K →+* L) (x : K) : (f.rangeRestrictField x : L) = f x

{K : Type u}
{L : Type v}
[DivisionRing K]
[DivisionRing L]
(f : K →+* L)
(x : K)


lemma descFun_spec (f : c.pt → lc.pt) :
    f = descFun hc lc ↔ ∀ j, f ∘ c.ι.app j = lc.ι.app j ∘ ULift.up

(hc : CategoryTheory.Limits.IsColimit c)

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

f = CategoryTheory.Limits.Types.descFun hc lc ↔ ∀ (j : J), f ∘ c.ι.app j = lc.ι.app j ∘ ULift.up


@[to_additive]
theorem comap_sup_eq (H K : Subgroup N) (hf : Function.Surjective f) :
    comap f H ⊔ comap f K = comap f (H ⊔ K)

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
(f : G →* N)
(H K : Subgroup N)
(hf : Function.Surjective ⇑f)

Subgroup.comap f H ⊔ Subgroup.comap f K = Subgroup.comap f (H ⊔ K)


/-- The norm, relative to `ℤ`, of `ζ - 1` in a `p ^ (k + 1)`-th cyclotomic extension of `ℚ` is
a prime if `p ≠ 2`. -/
lemma prime_norm_toInteger_sub_one_of_prime_ne_two [hcycl : IsCyclotomicExtension {p ^ (k + 1)} ℚ K]
    (hζ : IsPrimitiveRoot ζ ↑(p ^ (k + 1))) (hodd : p ≠ 2) :
    Prime (Algebra.norm ℤ (hζ.toInteger - 1))

Prime ((Algebra.norm ℤ) (hζ.toInteger - 1))


/-- Nonzero integral ideals in a Dedekind domain are invertible.

We will use this to show that nonzero fractional ideals are invertible,
and finally conclude that fractional ideals in a Dedekind domain form a group with zero.
-/
theorem coe_ideal_mul_inv [h : IsDedekindDomain A] (I : Ideal A) (hI0 : I ≠ ⊥) :
    I * (I : FractionalIdeal A⁰ K)⁻¹ = 1

{A : Type u_2}
{K : Type u_3}
[CommRing A]
[Field K]
[Algebra A K]
[IsFractionRing A K]
[h : IsDedekindDomain A]
(I : Ideal A)
(hI0 : I ≠ ⊥)


@[simp]
theorem sublists'_singleton (a : α) : sublists' [a] = [[], [a]]


/-- A Boolean algebra is a bounded distributive lattice with a complement operator `ᶜ` such that
`x ⊓ xᶜ = ⊥` and `x ⊔ xᶜ = ⊤`. For convenience, it must also provide a set difference operation `\`
and a Heyting implication `⇨` satisfying `x \ y = x ⊓ yᶜ` and `x ⇨ y = y ⊔ xᶜ`.

This is a generalization of (classical) logic of propositions, or the powerset lattice.

Since `BoundedOrder`, `OrderBot`, and `OrderTop` are mixins that require `LE`
to be present at define-time, the `extends` mechanism does not work with them.
Instead, we extend using the underlying `Bot` and `Top` data typeclasses, and replicate the
order axioms of those classes here. A "forgetful" instance back to `BoundedOrder` is provided.
-/
class BooleanAlgebra (α : Type u) extends
    DistribLattice α, HasCompl α, SDiff α, HImp α, Top α, Bot α where
  /-- The infimum of `x` and `xᶜ` is at most `⊥` -/
  inf_compl_le_bot : ∀ x : α, x ⊓ xᶜ ≤ ⊥
  /-- The supremum of `x` and `xᶜ` is at least `⊤` -/
  top_le_sup_compl : ∀ x : α, ⊤ ≤ x ⊔ xᶜ
  /-- `⊤` is the greatest element -/
  le_top : ∀ a : α, a ≤ ⊤
  /-- `⊥` is the least element -/
  bot_le : ∀ a : α, ⊥ ≤ a
  /-- `x \ y` is equal to `x ⊓ yᶜ` -/
  sdiff := fun x y => x ⊓ yᶜ
  /-- `x ⇨ y` is equal to `y ⊔ xᶜ` -/
  himp := fun x y => y ⊔ xᶜ
  /-- `x \ y` is equal to `x ⊓ yᶜ` -/
  sdiff_eq : ∀ x y : α, x \ y = x ⊓ yᶜ := by aesop
  /-- `x ⇨ y` is equal to `y ⊔ xᶜ` -/
  himp_eq : ∀ x y : α, x ⇨ y = y ⊔ xᶜ := by aesop

{α : Type u}
[self : BooleanAlgebra α]
(a : α)


/-- The order of the monomial `a*X^n` is infinite if `a = 0` and `n` otherwise. -/
theorem order_monomial (n : ℕ) (a : R) [Decidable (a = 0)] :
    order (monomial R n a) = if a = 0 then (⊤ : PartENat) else n

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

((PowerSeries.monomial R n) a).order = if a = 0 then ⊤ else ↑n


theorem biInter_insert (a : α) (s : Set α) (t : α → Set β) :
    ⋂ x ∈ insert a s, t x = t a ∩ ⋂ x ∈ s, t x

{α : Type u_1}
{β : Type u_2}
(a : α)
(s : Set α)
(t : α → Set β)


/-- A collection of bases with the exchange property and at least one finite member is a matroid -/
@[simps! E] protected def ofExistsFiniteBase (E : Set α) (Base : Set α → Prop)
    (exists_finite_base : ∃ B, Base B ∧ B.Finite) (base_exchange : ExchangeProperty Base)
    (subset_ground : ∀ B, Base B → B ⊆ E) : Matroid α

(base_exchange : Matroid.ExchangeProperty Base)

(subset_ground : ∀ (B : Set α), Base B → B ⊆ E)

(Matroid.ofExistsFiniteBase E Base exists_finite_base base_exchange subset_ground).E = E


theorem Submartingale.stoppedValue_leastGE_eLpNorm_le [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ)
    (hr : 0 ≤ r) (hf0 : f 0 = 0) (hbdd : ∀ᵐ ω ∂μ, ∀ i, |f (i + 1) ω - f i ω| ≤ R) (i : ℕ) :
    eLpNorm (stoppedValue f (leastGE f r i)) 1 μ ≤ 2 * μ Set.univ * ENNReal.ofReal (r + R)

{f : ℕ → Ω → ℝ}

(hf : MeasureTheory.Submartingale f ℱ μ)

(hbdd : ∀ᵐ (ω : Ω) ∂μ, ∀ (i : ℕ), |f (i + 1) ω - f i ω| ≤ ↑R)

MeasureTheory.eLpNorm (MeasureTheory.stoppedValue f (MeasureTheory.leastGE f r i)) 1 μ ≤
  2 * μ Set.univ * ENNReal.ofReal (r + ↑R)


@[simp]
lemma Functor.imageSieve_map {U V : C} (f : U ⟶ V) : G.imageSieve (G.map f) = ⊤

{C : Type uC}
[CategoryTheory.Category.{vC, uC} C]
{D : Type uD}
[CategoryTheory.Category.{vD, uD} D]
(G : CategoryTheory.Functor C D)
{U V : C}
(f : U ⟶ V)


theorem boundedBy_apply (s : Set α) :
    boundedBy m s = ⨅ (t : ℕ → Set α) (_ : s ⊆ iUnion t),
                      ∑' n, ⨆ _ : (t n).Nonempty, m (t n)

{α : Type u_1}
{m : Set α → ℝ≥0∞}
(s : Set α)

(MeasureTheory.OuterMeasure.boundedBy m) s = ⨅ t, ⨅ (_ : s ⊆ Set.iUnion t), ∑' (n : ℕ), ⨆ (_ : (t n).Nonempty), m (t n)


theorem mk_le_iff_forall_finset_subset_card_le {α : Type u} {n : ℕ} {t : Set α} :
    #t ≤ n ↔ ∀ s : Finset α, (s : Set α) ⊆ t → s.card ≤ n

Cardinal.mk ↑t ≤ ↑n ↔ ∀ (s : Finset α), ↑s ⊆ t → s.card ≤ n


@[to_additive]
theorem map_sup (S T : Submonoid M) (f : F) : (S ⊔ T).map f = S.map f ⊔ T.map f

{M : Type u_1}
{N : Type u_2}
[AddZeroClass M]
[AddZeroClass N]
{F : Type u_4}
[FunLike F M N]
[mc : AddMonoidHomClass F M N]
(S T : AddSubmonoid M)
(f : F)

AddSubmonoid.map f (S ⊔ T) = AddSubmonoid.map f S ⊔ AddSubmonoid.map f T


@[simp]
theorem coe_smul (r : S) (D : LieDerivation R L M) : ⇑(r • D) = r • ⇑D

[LieDerivation.SMulBracketCommClass S L M]


@[simp]
theorem continuousAt_inv {𝕜 : Type*} [NontriviallyNormedField 𝕜] {x : 𝕜} :
    ContinuousAt Inv.inv x ↔ x ≠ 0

{𝕜 : Type u_4}
[NontriviallyNormedField 𝕜]
{x : 𝕜}


@[simp, norm_cast]
theorem coe_mk (I : Submodule R P) (hI : IsFractional S I) :
    coeToSubmodule ⟨I, hI⟩ = I

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
(I : Submodule R P)
(hI : IsFractional S I)


/-- A `MulEquiv` `φ` between two semigroups `M` and `N` induces a `MulEquiv` between
a subsemigroup `S ≤ M` and the subsemigroup `φ(S) ≤ N`.
See `MulHom.subsemigroupMap` for a variant for `MulHom`s. -/
@[to_additive (attr := simps)
      "An `AddEquiv` `φ` between two additive semigroups `M` and `N` induces an `AddEquiv`
      between a subsemigroup `S ≤ M` and the subsemigroup `φ(S) ≤ N`.
      See `AddHom.addSubsemigroupMap` for a variant for `AddHom`s."]
def subsemigroupMap (e : M ≃* N) (S : Subsemigroup M) : S ≃* S.map (e : M →ₙ* N)

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
(e : M ≃* N)
(S : Subsemigroup M)
(x : ↥(Subsemigroup.map (↑e) S))

↑((e.subsemigroupMap S).symm x) = e.symm ↑x


theorem zero_mem_iff {a : A} : (0 : R) ∈ σ a ↔ ¬IsUnit a

(R : Type u)
{A : Type v}
[CommSemiring R]
[Ring A]
[Algebra R A]
{a : A}


@[to_additive (attr := ext)]
theorem CommGroup.ext {G : Type*} ⦃g₁ g₂ : CommGroup G⦄ (h_mul : g₁.mul = g₂.mul) : g₁ = g₂

{G : Type u_1}
⦃g₁ g₂ : CommGroup G⦄
(h_mul : Mul.mul = Mul.mul)


/-- Replacing a set by its closure does not change the Hausdorff edistance. -/
@[simp]
theorem hausdorffEdist_closure₁ : hausdorffEdist (closure s) t = hausdorffEdist s t

{α : Type u}
[PseudoEMetricSpace α]
{s t : Set α}

EMetric.hausdorffEdist (closure s) t = EMetric.hausdorffEdist s t


/-- `ContinuousMonoidHomClass F A B` states that `F` is a type of continuous monoid
homomorphisms.

You should also extend this typeclass when you extend `ContinuousMonoidHom`. -/
-- Porting note: Changed A B to outParam to help synthesizing order
@[to_additive]
class ContinuousMonoidHomClass (A B : outParam Type*) [Monoid A] [Monoid B]
    [TopologicalSpace A] [TopologicalSpace B] [FunLike F A B]
    extends MonoidHomClass F A B : Prop where
  /-- Proof of the continuity of the map. -/
  map_continuous (f : F) : Continuous f

{F : Type u_1}
{A : outParam (Type u_7)}
{B : outParam (Type u_8)}
[Monoid A]
[Monoid B]
[TopologicalSpace A]
[TopologicalSpace B]
[FunLike F A B]
[self : ContinuousMonoidHomClass F A B]
(f : F)


@[to_additive]
theorem _root_.SemiconjBy.op [Mul α] {a x y : α} (h : SemiconjBy a x y) :
    SemiconjBy (op a) (op y) (op x)

{α : Type u_1}
[Add α]
{a x y : α}
(h : AddSemiconjBy a x y)

AddSemiconjBy (AddOpposite.op a) (AddOpposite.op y) (AddOpposite.op x)


/-- The conditional cdf is non-negative for all `a : α`. -/
theorem condCDF_nonneg (ρ : Measure (α × ℝ)) (a : α) (r : ℝ) : 0 ≤ condCDF ρ a r

{α : Type u_1}
{mα : MeasurableSpace α}
(ρ : MeasureTheory.Measure (α × ℝ))
(a : α)
(r : ℝ)


/--
Accessing bits in `x.rotateLeft r` the range `[r, w)` is equal to
accessing bits `x` in the range `[0, w - r)`.

Proof by example:
Let x := <6 5 4 3 2 1 0> : BitVec 7.
x.rotateLeft 2 = (<6 5 | 4 3 2 1 0>).rotateLeft 2 = <3 2 1 0 | 6 5>

(x.rotateLeft 2).getLsb ⟨i, i ≥ 2⟩
= <3 2 1 0 | 6 5>.getLsb ⟨i, i ≥ 2⟩
= <3 2 1 0>[i - 2]
= <6 5 | 3 2 1 0>[i - 2]

Intuitively, grab the full width (7), then move the marker `|` by `r` to the right `(-2)`
Then, access the bit at `i` from the right `(+i)`.
 -/
theorem getLsb_rotateLeftAux_of_geq {x : BitVec w} {r : Nat} {i : Nat} (hi : i ≥ r) :
    (x.rotateLeftAux r).getLsb i = (decide (i < w) && x.getLsb (i - r))

{w : Nat}
{x : BitVec w}
{r i : Nat}
(hi : i ≥ r)


/-- See also the strictly more general `initial_iff_initial_comp` below. -/
theorem initial_iff_equivalence_comp [IsEquivalence F] : Initial G ↔ Initial (F ⋙ G)

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


@[to_additive]
theorem prod_product {s : Finset γ} {t : Finset α} {f : γ × α → β} :
    ∏ x ∈ s ×ˢ t, f x = ∏ x ∈ s, ∏ y ∈ t, f (x, y)

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[AddCommMonoid β]
{s : Finset γ}
{t : Finset α}
{f : γ × α → β}

∑ x ∈ s ×ˢ t, f x = ∑ x ∈ s, ∑ y ∈ t, f (x, y)


theorem dist_inequality (x y) : dist x y ≤ (dist x (f x) + dist y (f y)) / (1 - K)

{α : Type u_1}
[MetricSpace α]
{K : ℝ≥0}
{f : α → α}
(hf : ContractingWith K f)
(x y : α)

dist x y ≤ (dist x (f x) + dist y (f y)) / (1 - ↑K)


@[simp]
theorem symm_apply_apply (h : M ≃ₘ^n⟮I, J⟯ N) (x : M) : h.symm (h x) = x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_5}
[TopologicalSpace H]
{G : Type u_7}
[TopologicalSpace G]
{I : ModelWithCorners 𝕜 E H}
{J : ModelWithCorners 𝕜 F G}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{N : Type u_11}
[TopologicalSpace N]
[ChartedSpace G N]
{n : ℕ∞}
(h : M ≃ₘ^n⟮I, J⟯ N)
(x : M)


@[to_additive]
theorem mul_eq_one_iff' [CovariantClass α α (· * ·) (· ≤ ·)]
    [CovariantClass α α (swap (· * ·)) (· ≤ ·)] {a b : α} (ha : 1 ≤ a) (hb : 1 ≤ b) :
    a * b = 1 ↔ a = 1 ∧ b = 1

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

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


theorem le_multiplicity_iff_replicate_subperm_primeFactorsList {a b : ℕ} {n : ℕ} (ha : a.Prime)
    (hb : b ≠ 0) :
    ↑n ≤ multiplicity a b ↔ replicate n a <+~ b.primeFactorsList

{a b n : ℕ}
(ha : Nat.Prime a)
(hb : b ≠ 0)

↑n ≤ multiplicity a b ↔ (List.replicate n a).Subperm b.primeFactorsList


lemma Algebra.isAlgebraic_def : Algebra.IsAlgebraic R A ↔ ∀ x : A, IsAlgebraic R x

{R : Type u}
{A : Type v}
[CommRing R]
[Ring A]
[Algebra R A]

Algebra.IsAlgebraic R A ↔ ∀ (x : A), IsAlgebraic R x


@[simp] lemma ceilDiv_one [Nontrivial α] (b : β) : b ⌈/⌉ (1 : α) = b

{α : Type u_2}
{β : Type u_3}
[OrderedSemiring α]
[OrderedAddCommMonoid β]
[MulActionWithZero α β]
[CeilDiv α β]
[Nontrivial α]
(b : β)


lemma isClique_singleton (a : α) : G.IsClique {a}

{α : Type u_1}
{G : SimpleGraph α}
(a : α)


theorem add_smul [AddCommMonoid R] [SMulWithZero R V] {x y : HahnSeries Γ R}
    {z : HahnModule Γ' R V} (h : ∀ (r s : R) (u : V), (r + s) • u = r • u + s • u) :
    (x + y) • z = x • z + y • z


theorem constant_of_derivWithin_zero (hdiff : DifferentiableOn ℝ f (Icc a b))
    (hderiv : ∀ x ∈ Ico a b, derivWithin f (Icc a b) x = 0) : ∀ x ∈ Icc a b, f x = f a

(hdiff : DifferentiableOn ℝ f (Set.Icc a b))

(hderiv : ∀ x ∈ Set.Ico a b, derivWithin f (Set.Icc a b) x = 0)


/-- The equivalence between the quaternions over `R` and `R × R × R × R`. -/
@[simps!]
def Quaternion.equivProd (R : Type*) [One R] [Neg R] : ℍ[R] ≃ R × R × R × R

(R : Type u_1)
[One R]
[Neg R]
(a : R × R × R × R)

((Quaternion.equivProd R).symm a).imI = a.2.1


theorem stoneCechExtend_extends : stoneCechExtend hg ∘ stoneCechUnit = g

{α : Type u}
[TopologicalSpace α]
{β : Type v}
[TopologicalSpace β]
[T2Space β]
[CompactSpace β]
{g : α → β}
(hg : Continuous g)


@[to_additive]
theorem comap_sup_eq (H K : Subgroup N) (hf : Function.Surjective f) :
    comap f H ⊔ comap f K = comap f (H ⊔ K)

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

AddSubgroup.comap f H ⊔ AddSubgroup.comap f K = AddSubgroup.comap f (H ⊔ K)


@[simp]
theorem mapAccumr₂_mapAccumr_left (f₁ : γ → β → σ₁ → σ₁ × ζ) (f₂ : α → σ₂ → σ₂ × γ) :
    (mapAccumr₂ f₁ (mapAccumr f₂ xs s₂).snd ys s₁)
    = let m := (mapAccumr₂ (fun x y s =>
          let r₂ := f₂ x s.snd
          let r₁ := f₁ r₂.snd y s.fst
          ((r₁.fst, r₂.fst), r₁.snd)
        ) xs ys (s₁, s₂))
      (m.fst.fst, m.snd)

{α : Type}
{n : ℕ}
{β : Type}
(xs : Mathlib.Vector α n)
(ys : Mathlib.Vector β n)
{γ σ₁ ζ σ₂ : Type}
{s₂ : σ₂}
{s₁ : σ₁}
(f₁ : γ → β → σ₁ → σ₁ × ζ)
(f₂ : α → σ₂ → σ₂ × γ)

Mathlib.Vector.mapAccumr₂ f₁ (Mathlib.Vector.mapAccumr f₂ xs s₂).2 ys s₁ =
  let m :=
    Mathlib.Vector.mapAccumr₂
      (fun x y s =>
        let r₂ := f₂ x s.2;
        let r₁ := f₁ r₂.2 y s.1;
        ((r₁.1, r₂.1), r₁.2))
      xs ys (s₁, s₂);
  (m.1.1, m.2)


theorem mem_colon' {r} : r ∈ N.colon P ↔ P ≤ comap (r • (LinearMap.id : M →ₗ[R] M)) N

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{N P : Submodule R M}
{r : R}

r ∈ N.colon P ↔ P ≤ Submodule.comap (r • LinearMap.id) N


/-- In a second countable space, the set of points where a monotone function is not continuous
is at most countable. -/
theorem countable_not_continuousAt [SecondCountableTopology β] :
    Set.Countable { x | ¬ContinuousAt f x }

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[ConditionallyCompleteLinearOrder β]
[TopologicalSpace β]
[OrderTopology β]
{f : α → β}
(hf : Monotone f)
[TopologicalSpace α]
[OrderTopology α]
[SecondCountableTopology β]


@[mono]
theorem exp_monotone : Monotone exp


@[simp]
theorem coe_refl : ⇑(refl α) = id


/-- The kernel of `biproduct.π f i` is `⨁ Subtype.restrict {i}ᶜ f`. -/
@[simps!]
def kernelBiproductπIso : kernel (biproduct.π f i) ≅ ⨁ Subtype.restrict (fun j => j ≠ i) f

[CategoryTheory.Limits.HasBiproduct (Subtype.restrict (fun j => j ≠ i) f)]

(CategoryTheory.Limits.kernelBiproductπIso f i).hom =
  (CategoryTheory.Limits.biproduct.isLimitFromSubtype f i).lift
    (CategoryTheory.Limits.limit.cone (CategoryTheory.Limits.parallelPair (CategoryTheory.Limits.biproduct.π f i) 0))


/-- The contravariant categorical equivalence between augmented simplicial
objects and augmented cosimplicial objects in the opposite category. -/
@[simps! functor inverse]
def simplicialCosimplicialAugmentedEquiv :
    (SimplicialObject.Augmented C)ᵒᵖ ≌ CosimplicialObject.Augmented Cᵒᵖ

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

(CategoryTheory.simplicialCosimplicialAugmentedEquiv C).inverse = CategoryTheory.cosimplicialToSimplicialAugmented C


theorem all (f) : ∀ {s}, ValidFor l m r s → s.all f = m.all f

{l m r : List Char}
(f : Char → Bool)
{s : Substring}

Substring.ValidFor l m r s → s.all f = m.all f


theorem uniformity_le_symm : 𝓤 α ≤ @Prod.swap α α <$> 𝓤 α


@[simp]
theorem wideCospan_map_term {A : C} (s : Set (Subobject A)) (j) :
    (wideCospan s).map (WidePullbackShape.Hom.term j) =
      ((equivShrink (Subobject A)).symm j).arrow

(j : ↑(⇑(equivShrink (CategoryTheory.Subobject A)) '' s))

(CategoryTheory.Subobject.wideCospan s).map (CategoryTheory.Limits.WidePullbackShape.Hom.term j) =
  ((equivShrink (CategoryTheory.Subobject A)).symm ↑j).arrow


/-- The logarithmic derivative of a sequence of functions converging locally uniformly to a
function is the logarithmic derivative of the limit function. -/
theorem logDeriv_tendsto {ι : Type*} {p : Filter ι} (f : ι → ℂ → ℂ) (g : ℂ → ℂ)
    {s : Set ℂ} (hs : IsOpen s) (x : s) (hF : TendstoLocallyUniformlyOn f g p s)
    (hf : ∀ᶠ n : ι in p, DifferentiableOn ℂ (f n) s) (hg : g x ≠ 0) :
    Tendsto (fun n : ι => logDeriv (f n) x) p (𝓝 ((logDeriv g) x))

(f : ι → ℂ → ℂ)

(hf : ∀ᶠ (n : ι) in p, DifferentiableOn ℂ (f n) s)

Filter.Tendsto (fun n => logDeriv (f n) ↑x) p (𝓝 (logDeriv g ↑x))


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

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


@[to_additive (attr := simp)]
theorem measurable_inv_iff {G : Type*} [Group G] [MeasurableSpace G] [MeasurableInv G]
    {f : α → G} : (Measurable fun x => (f x)⁻¹) ↔ Measurable f

{α : Type u_3}
{m : MeasurableSpace α}
{G : Type u_4}
[Group G]
[MeasurableSpace G]
[MeasurableInv G]
{f : α → G}


theorem eLpNorm'_trim (hm : m ≤ m0) {f : α → E} (hf : StronglyMeasurable[m] f) :
    eLpNorm' f q (μ.trim hm) = eLpNorm' f q μ

(hf : MeasureTheory.StronglyMeasurable f)

MeasureTheory.eLpNorm' f q (μ.trim hm) = MeasureTheory.eLpNorm' f q μ


/-- A product of a function `f : Fin (n + 1) → β` over all `Fin (n + 1)`
is the product of `f (Fin.last n)` plus the remaining product -/
@[to_additive "A sum of a function `f : Fin (n + 1) → β` over all `Fin (n + 1)` is the sum of
`f (Fin.last n)` plus the remaining sum"]
theorem prod_univ_castSucc [CommMonoid β] {n : ℕ} (f : Fin (n + 1) → β) :
    ∏ i, f i = (∏ i : Fin n, f (Fin.castSucc i)) * f (last n)

{β : Type u_2}
[CommMonoid β]
{n : ℕ}
(f : Fin (n + 1) → β)

∏ i : Fin (n + 1), f i = (∏ i : Fin n, f i.castSucc) * f (Fin.last n)


@[simp]
theorem smul_one_eq_cast (A : Type*) [DivisionRing A] (m : ℚ) : m • (1 : A) = ↑m


/-- Composition of bimodule object morphisms. -/
@[simps]
def comp {M N O : Bimod A B} (f : Hom M N) (g : Hom N O) : Hom M O

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.MonoidalCategory C]
{A B : Mon_ C}
{M N O : Bimod A B}
(f : M.Hom N)
(g : N.Hom O)


theorem log_of_left_le_one {b : ℕ} (hb : b ≤ 1) (n) : log b n = 0


@[simp]
theorem llift_apply (f : X → M) (x : X →₀ R) : llift M R S X f x = lift M R X f x

(M : Type u_2)
(R : Type u_5)
(S : Type u_6)
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[Module R M]
(X : Type u_7)
[Module S M]
[SMulCommClass R S M]
(f : X → M)
(x : X →₀ R)

((Finsupp.llift M R S X) f) x = ((Finsupp.lift M R X) f) x


@[to_additive]
theorem iUnion_smul_eq_setOf_exists {s : Set β} : ⋃ g : α, g • s = { a | ∃ g : α, g • a ∈ s }

{α : Type u_2}
{β : Type u_3}
[Group α]
[MulAction α β]
{s : Set β}


@[simp]
theorem sign_trans_trans_symm [DecidableEq β] [Fintype β] (f : Perm β) (e : α ≃ β) :
    sign ((e.trans f).trans e.symm) = sign f

{α : Type u}
[DecidableEq α]
{β : Type v}
[Fintype α]
[DecidableEq β]
[Fintype β]
(f : Equiv.Perm β)
(e : α ≃ β)

Equiv.Perm.sign ((e.trans f).trans e.symm) = Equiv.Perm.sign f


lemma IsTheta.isTheta_congr_right (h : f' =Θ[l] g') : k =Θ[l] f' ↔ k =Θ[l] g'

{α : Type u_1}
{G : Type u_5}
{E' : Type u_6}
{F' : Type u_7}
[Norm G]
[SeminormedAddCommGroup E']
[SeminormedAddCommGroup F']
{k : α → G}
{f' : α → E'}
{g' : α → F'}
{l : Filter α}
(h : f' =Θ[l] g')


@[simp]
theorem toCone_π_app (B : Bicone F) (j : Discrete J) : B.toCone.π.app j = B.π j.as


@[norm_cast] lemma ofReal_zsmul (n : ℤ) (r : ℝ) : ↑(n • r) = n • (r : ℂ)


theorem preimage_inversion_sphere_dist_center (hR : R ≠ 0) (hy : y ≠ c) :
    inversion c R ⁻¹' sphere y (dist y c) =
      insert c (perpBisector c (inversion c R y) : Set P)

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{c y : P}
{R : ℝ}
(hR : R ≠ 0)
(hy : y ≠ c)

EuclideanGeometry.inversion c R ⁻¹' Metric.sphere y (dist y c) =
  insert c ↑(AffineSubspace.perpBisector c (EuclideanGeometry.inversion c R y))


@[simp, norm_cast] lemma coe_abs (f : α →ᵇ β) : ⇑|f| = |⇑f|

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[NormedLatticeAddCommGroup β]
(f : BoundedContinuousFunction α β)


@[reassoc (attr := simp)]
theorem colimit.pre_desc (c : Cocone F) :
    colimit.pre F E ≫ colimit.desc F c = colimit.desc (E ⋙ F) (c.whisker E)

[CategoryTheory.Limits.HasColimit (E ⋙ F)]

CategoryTheory.Limits.colimit.pre F E ≫ CategoryTheory.Limits.colimit.desc F c =
  CategoryTheory.Limits.colimit.desc (E ⋙ F) (CategoryTheory.Limits.Cocone.whisker E c)


theorem Set.Finite.interior_sInter {S : Set (Set X)} (hS : S.Finite) :
    interior (⋂₀ S) = ⋂ s ∈ S, interior s

{X : Type u}
[TopologicalSpace X]
{S : Set (Set X)}
(hS : S.Finite)


@[simp]
theorem unitization_apply (x : Unitization ℤ s) : unitization s x = x.fst + x.snd

{R : Type u_1}
{S : Type u_2}
[Ring R]
[SetLike S R]
[hSR : NonUnitalSubringClass S R]
(s : S)
(x : Unitization ℤ ↥s)

(NonUnitalSubring.unitization s) x = ↑x.fst + ↑x.snd


@[simp]
theorem image_erase [DecidableEq α] {f : α → β} (hf : Injective f) (s : Finset α) (a : α) :
    (s.erase a).image f = (s.image f).erase (f a)

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
[DecidableEq α]
{f : α → β}
(hf : Function.Injective f)
(s : Finset α)
(a : α)

Finset.image f (s.erase a) = (Finset.image f s).erase (f a)


theorem mem_Lp_of_ae_le {f : α →ₘ[μ] E} {g : Lp F p μ} (h : ∀ᵐ x ∂μ, ‖f x‖ ≤ ‖g x‖) :
    f ∈ Lp E p μ

{α : Type u_1}
{E : Type u_2}
{F : Type u_3}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
{f : α →ₘ[μ] E}
{g : ↥(MeasureTheory.Lp F p μ)}
(h : ∀ᵐ (x : α) ∂μ, ‖↑f x‖ ≤ ‖↑↑g x‖)


theorem norm_le_half_period {x : AddCircle p} (hp : p ≠ 0) : ‖x‖ ≤ |p| / 2


theorem lexNdepWf {r  : α → α → Prop} {s : β → β → Prop} (ha : WellFounded r) (hb : WellFounded s) : WellFounded (lexNdep r s)

{α : Sort u}
{β : Sort v}
{r : α → α → Prop}
{s : β → β → Prop}
(ha : WellFounded r)
(hb : WellFounded s)


/-- Pushforward of nonempty intervals. -/
@[simps!]
def map (f : α →o β) (a : NonemptyInterval α) : NonemptyInterval β

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
(f : α →o β)
(a : NonemptyInterval α)

(NonemptyInterval.map f a).toProd.2 = f a.1.2


lemma IsLeftCancelMulZero.to_noZeroDivisors [NonUnitalNonAssocRing α] [IsLeftCancelMulZero α] :
    NoZeroDivisors α

(α : Type u_2)
[NonUnitalNonAssocRing α]
[IsLeftCancelMulZero α]


protected theorem ext_iff {z w : ℂ} : z = w ↔ z.re = w.re ∧ z.im = w.im


theorem equiv_fst_eq_self_of_mem_of_one_mem {g : G} (h1 : 1 ∈ T) (hg : g ∈ S) :
    (hST.equiv g).fst = ⟨g, hg⟩

{G : Type u_1}
[Group G]
{S T : Set G}
(hST : Subgroup.IsComplement S T)
{g : G}
(h1 : 1 ∈ T)
(hg : g ∈ S)


theorem powerset_aux'_perm {l₁ l₂ : List α} (p : l₁ ~ l₂) : powersetAux' l₁ ~ powersetAux' l₂

{α : Type u_1}
{l₁ l₂ : List α}
(p : l₁.Perm l₂)

(Multiset.powersetAux' l₁).Perm (Multiset.powersetAux' l₂)


theorem seminormAux_zero (k n : ℕ) : (0 : 𝓢(E, F)).seminormAux k n = 0

{E : Type u_4}
{F : Type u_5}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
(k n : ℕ)


/-- A function `f : β → α` with upper topology in the codomain is continuous
provided that the preimage of every interval `Set.Iic a` is a closed set. -/
@[deprecated (since := "2023-12-24")]
lemma continuous_of_Iic [TopologicalSpace β] {f : β → α} (h : ∀ a, IsClosed (f ⁻¹' (Iic a))) :
    Continuous f

(h : ∀ (a : α), IsClosed (f ⁻¹' Set.Iic a))


lemma factorsThrough_iff (g : α → γ) [Nonempty γ] : g.FactorsThrough f ↔ ∃ (e : β → γ), g = e ∘ f

{α : Sort u_1}
{β : Sort u_2}
{γ : Sort u_3}
{f : α → β}
(g : α → γ)
[Nonempty γ]

Function.FactorsThrough g f ↔ ∃ e, g = e ∘ f


theorem coe_eq_of_mem_split_of_mem_le {y : ι → ℝ} (h₁ : J ∈ split I i x) (h₂ : y ∈ J)
    (h₃ : y i ≤ x) : (J : Set (ι → ℝ)) = ↑I ∩ { y | y i ≤ x }

(h₁ : J ∈ BoxIntegral.Prepartition.split I i x)


/-- Create a copy of a `PartialEquiv` providing better definitional equalities. -/
@[simps (config := .asFn)]
def copy (e : PartialEquiv α β) (f : α → β) (hf : ⇑e = f) (g : β → α) (hg : ⇑e.symm = g) (s : Set α)
    (hs : e.source = s) (t : Set β) (ht : e.target = t) :
    PartialEquiv α β

{α : Type u_1}
{β : Type u_2}
(e : PartialEquiv α β)
(f : α → β)
(hf : ↑e = f)
(g : β → α)
(hg : ↑e.symm = g)
(s : Set α)
(hs : e.source = s)
(t : Set β)
(ht : e.target = t)


theorem isMaximal_of_isIntegral_of_isMaximal_comap [Algebra R S] [Algebra.IsIntegral R S]
    (I : Ideal S) [I.IsPrime] (hI : IsMaximal (I.comap (algebraMap R S))) : IsMaximal I

(hI : (Ideal.comap (algebraMap R S) I).IsMaximal)


@[simp]
theorem ofComplex_I : ofComplex Complex.I = ι Q 1

CliffordAlgebraComplex.ofComplex Complex.I = (CliffordAlgebra.ι CliffordAlgebraComplex.Q) 1


@[simp]
theorem sInf_fst (S : Set (Concept α β r)) : (sInf S).fst = ⋂ c ∈ S, (c : Concept _ _ _).fst

{α : Type u_2}
{β : Type u_3}
{r : α → β → Prop}
(S : Set (Concept α β r))


theorem not_isLeftInversion_mul_right_iff {w : W}  :
    ¬cs.IsLeftInversion (t * w) t ↔ cs.IsLeftInversion w t

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
{cs : CoxeterSystem M W}
{t : W}
(ht : cs.IsReflection t)
{w : W}


theorem l_inf_u [SemilatticeInf α] [SemilatticeInf β] (gi : GaloisInsertion l u) (a b : β) :
    l (u a ⊓ u b) = a ⊓ b

{α : Type u}
{β : Type v}
{l : α → β}
{u : β → α}
[SemilatticeInf α]
[SemilatticeInf β]
(gi : GaloisInsertion l u)
(a b : β)


@[simp]
theorem ι_ne_one [Nontrivial R] (x : M) : ι R x ≠ 1

{R : Type u1}
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]
[Nontrivial R]
(x : M)


theorem gcd_fib_add_self (m n : ℕ) : gcd (fib m) (fib (n + m)) = gcd (fib m) (fib n)

(Nat.fib m).gcd (Nat.fib (n + m)) = (Nat.fib m).gcd (Nat.fib n)


@[to_additive]
theorem mul_iUnion (s : Set α) (t : ι → Set α) : (s * ⋃ i, t i) = ⋃ i, s * t i

{α : Type u_2}
{ι : Sort u_5}
[Mul α]
(s : Set α)
(t : ι → Set α)


/-- If `E / F` is a separable field extension of exponential characteristic `q`, then
`F(S) = F(S ^ (q ^ n))` for any subset `S` of `E` and any natural number `n`. -/
theorem adjoin_eq_adjoin_pow_expChar_pow_of_isSeparable' [Algebra.IsSeparable F E] (S : Set E)
    (q : ℕ) [ExpChar F q] (n : ℕ) : adjoin F S = adjoin F ((· ^ q ^ n) '' S)

(F : Type u)
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
[Algebra.IsSeparable F E]
(S : Set E)
(q : ℕ)
[ExpChar F q]
(n : ℕ)

IntermediateField.adjoin F S = IntermediateField.adjoin F ((fun x => x ^ q ^ n) '' S)


@[to_additive]
theorem one_eq_mk : (1 : FreeGroup α) = mk []


theorem HasFDerivAtFilter.isBigO_sub_rev (hf : HasFDerivAtFilter f f' x L) {C}
    (hf' : AntilipschitzWith C f') : (fun x' => x' - x) =O[L] fun x' => f x' - f x

{𝕜 : 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}
{x : E}
{L : Filter E}
(hf : HasFDerivAtFilter f f' x L)
{C : ℝ≥0}
(hf' : AntilipschitzWith C ⇑f')


lemma IndepSets_iff (s1 s2 : Set (Set Ω)) (μ : Measure Ω) :
    IndepSets s1 s2 μ ↔ ∀ t1 t2 : Set Ω, t1 ∈ s1 → t2 ∈ s2 → (μ (t1 ∩ t2) = μ t1 * μ t2)

∀ {x : MeasurableSpace Ω} (s1 s2 : Set (Set Ω)) (μ : MeasureTheory.Measure Ω),
  ProbabilityTheory.IndepSets s1 s2 μ ↔ ∀ (t1 t2 : Set Ω), t1 ∈ s1 → t2 ∈ s2 → μ (t1 ∩ t2) = μ t1 * μ t2


@[simp] -- Porting note (#11215): TODO: generalize to `[InvolutiveInv _] [ContinuousInv _]`
protected theorem tendsto_inv_iff {f : Filter α} {m : α → ℝ≥0∞} {a : ℝ≥0∞} :
    Tendsto (fun x => (m x)⁻¹) f (𝓝 a⁻¹) ↔ Tendsto m f (𝓝 a)

{α : Type u_1}
{f : Filter α}
{m : α → ℝ≥0∞}
{a : ℝ≥0∞}

Filter.Tendsto (fun x => (m x)⁻¹) f (𝓝 a⁻¹) ↔ Filter.Tendsto m f (𝓝 a)


theorem subset_closure_withConstants : A ⊆ closure (L[[A]]) s

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

A ⊆ ↑((FirstOrder.Language.Substructure.closure (L.withConstants ↑A)).toFun s)


@[to_additive]
theorem pow_smul_eq_iff_minimalPeriod_dvd {n : ℕ} :
    a ^ n • b = b ↔ minimalPeriod (a • ·) b ∣ n

{α : Type v}
{G : Type u}
[AddGroup G]
[AddAction G α]
{a : G}
{b : α}
{n : ℕ}

n • a +ᵥ b = b ↔ Function.minimalPeriod (fun x => a +ᵥ x) b ∣ n


lemma nhdsWithin_stolzCone_le_nhdsWithin_stolzSet {s : ℝ} (hs : 0 < s) :
    ∃ M, 𝓝[stolzCone s] 1 ≤ 𝓝[stolzSet M] 1

∃ M, 𝓝[Complex.stolzCone s] 1 ≤ 𝓝[Complex.stolzSet M] 1


/-- Heine-Cantor: a continuous function on a compact uniform space is uniformly
continuous. -/
theorem CompactSpace.uniformContinuous_of_continuous [CompactSpace α] {f : α → β}
    (h : Continuous f) : UniformContinuous f

{α : Type u_1}
{β : Type u_2}
[UniformSpace α]
[UniformSpace β]
[CompactSpace α]
{f : α → β}
(h : Continuous f)


/-- The open cover associated to an affine open cover. -/
@[simps]
def openCover {X : Scheme.{u}} (𝓤 : X.AffineOpenCover) : X.OpenCover

{X : AlgebraicGeometry.Scheme}
(𝓤 : X.AffineOpenCover)
(j : 𝓤.J)


theorem isClosed_of_closure_subset (h : closure s ⊆ s) : IsClosed s

{X : Type u}
{s : Set X}
[TopologicalSpace X]
(h : closure s ⊆ s)


@[deprecated getElem?_modifyNth_eq (since := "2024-06-12")]
theorem get?_modifyNth_eq (f : α → α) (n) (l : List α) :
    (modifyNth f n l).get? n = f <$> l.get? n

{α : Type u_1}
(f : α → α)
(n : Nat)
(l : List α)

(List.modifyNth f n l).get? n = f <$> l.get? n


@[to_additive]
theorem image_mulSingle_Ioo_right (i : ι) (b : α i) :
    Pi.mulSingle i '' Ioo 1 b = Ioo 1 (Pi.mulSingle i b)

{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ι]
[(i : ι) → PartialOrder (α i)]
[(i : ι) → One (α i)]
(i : ι)
(b : α i)

Pi.mulSingle i '' Set.Ioo 1 b = Set.Ioo 1 (Pi.mulSingle i b)


@[simp]
theorem ι_eq_zero : ι (0 : QuadraticForm R Unit) = 0


/-- The open cover of the glued space given by the glue data. -/
@[simps (config := .lemmasOnly)]
def openCover (D : Scheme.GlueData) : OpenCover D.glued

(D : AlgebraicGeometry.Scheme.GlueData)
(x : ↑↑D.glued.toPresheafedSpace)


theorem apply_mem_support {x : α} : f x ∈ f.support ↔ x ∈ f.support

{α : Type u_1}
[DecidableEq α]
[Fintype α]
{f : Equiv.Perm α}
{x : α}


/-- If a finset `u` is contained in the product of two sets `s / t`, we can find two finsets `s'`,
`t'` such that `s' ⊆ s`, `t' ⊆ t` and `u ⊆ s' / t'`. -/
@[to_additive
      "If a finset `u` is contained in the sum of two sets `s - t`, we can find two finsets
      `s'`, `t'` such that `s' ⊆ s`, `t' ⊆ t` and `u ⊆ s' - t'`."]
theorem subset_div {s t : Set α} :
    ↑u ⊆ s / t → ∃ s' t' : Finset α, ↑s' ⊆ s ∧ ↑t' ⊆ t ∧ u ⊆ s' / t'

{α : Type u_2}
[DecidableEq α]
[Sub α]
{u : Finset α}
{s t : Set α}

↑u ⊆ s - t → ∃ s' t', ↑s' ⊆ s ∧ ↑t' ⊆ t ∧ u ⊆ s' - t'


theorem LocallyFinite.eventually_subset {s : ι → Set X}
    (hs : LocallyFinite s) (hs' : ∀ i, IsClosed (s i)) (x : X) :
    ∀ᶠ y in 𝓝 x, {i | y ∈ s i} ⊆ {i | x ∈ s i}

{ι : Type u_1}
{X : Type u_4}
[TopologicalSpace X]
{s : ι → Set X}
(hs : LocallyFinite s)
(hs' : ∀ (i : ι), IsClosed (s i))
(x : X)

∀ᶠ (y : X) in 𝓝 x, {i | y ∈ s i} ⊆ {i | x ∈ s i}


theorem mul_lt_of_le_one_of_lt_of_nonneg [MulPosMono α] (ha : a ≤ 1) (h : b < c) (hb : 0 ≤ b) :
    a * b < c

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


@[simp]
theorem coe_getIso_symm_apply : ((H.getIso l).symm x : ℕ) = indexOf (↑x) l

(H : List.Sorted (fun x x_1 => x < x_1) l)

↑((List.Sorted.getIso l H).symm x) = List.indexOf (↑x) l


/-- If `edist (f n) (f (n+1))` is bounded by `C * 2^-n`, then the distance from
`f 0` to the limit of `f` is bounded above by `2 * C`. -/
theorem edist_le_of_edist_le_geometric_two_of_tendsto₀ : edist (f 0) a ≤ 2 * C

(ha : Filter.Tendsto f Filter.atTop (𝓝 a))


@[simp]
protected theorem coeSubtype : (SMulMemClass.subtype S' : S' → M) = Subtype.val

{R : Type u}
{M : Type v}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{A : Type u_1}
[SetLike A M]
[AddSubmonoidClass A M]
[SMulMemClass A R M]
(S' : A)

⇑(SMulMemClass.subtype S') = Subtype.val


theorem compl_le_iff_compl_le : xᶜ ≤ y ↔ yᶜ ≤ x

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

xᶜ ≤ y ↔ yᶜ ≤ x


@[simp]
theorem funUnique_apply (ι R M : Type*) [Unique ι] [Semiring R] [AddCommMonoid M] [Module R M] :
    (funUnique ι R M : (ι → M) → M) = eval default

(ι : Type u_5)
(R : Type u_6)
(M : Type u_7)
[Unique ι]
[Semiring R]
[AddCommMonoid M]
[Module R M]

⇑(LinearEquiv.funUnique ι R M) = Function.eval default


theorem cross_cross (u v w : Fin 3 → R) : u ×₃ v ×₃ w = u ×₃ (v ×₃ w) - v ×₃ (u ×₃ w)

{R : Type u_1}
[CommRing R]
(u v w : Fin 3 → R)

(crossProduct ((crossProduct u) v)) w = (crossProduct u) ((crossProduct v) w) - (crossProduct v) ((crossProduct u) w)


@[simp]
protected theorem append_reverseAux {u v w x : V}
    (p : G.Walk u v) (q : G.Walk v w) (r : G.Walk u x) :
    (p.append q).reverseAux r = q.reverseAux (p.reverseAux r)

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


@[simp]
theorem mapRange_id (g : α →₀ M) : mapRange id rfl g = g

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


@[simp] theorem Quiver.Hom.unop_mk {X Y : Cᵒᵖ} (f : X ⟶ Y) : Quiver.Hom.unop {unop := f} = f

{C : Type u₁}
[Quiver C]
{X Y : Cᵒᵖ}
(f : X ⟶ Y)


theorem norm_eq_norm_adjoin [FiniteDimensional K L] [Algebra.IsSeparable K L] (x : L) :
    norm K x = norm K (AdjoinSimple.gen K x) ^ finrank K⟮x⟯ L

(K : Type u_4)
{L : Type u_5}
[Field K]
[Field L]
[Algebra K L]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]
(x : L)

(Algebra.norm K) x = (Algebra.norm K) (IntermediateField.AdjoinSimple.gen K x) ^ FiniteDimensional.finrank (↥K⟮x⟯) L


/-- The cone of `F` corresponding to an element in `(F ⋙ yoneda.obj X).sections`. -/
@[simps]
def Limits.coneOfSectionCompYoneda (F : J ⥤ Cᵒᵖ) (X : C)
    (s : (F ⋙ yoneda.obj X).sections) : Cone F

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

(CategoryTheory.Limits.coneOfSectionCompYoneda F X s).π = (CategoryTheory.Limits.compYonedaSectionsEquiv F X) s


theorem ConvexOn.quasiconvexOn (hf : ConvexOn 𝕜 s f) : QuasiconvexOn 𝕜 s f

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


/-- Induction principle for `RatFunc K`: if `f p q : P (p / q)` for all `p q : K[X]`,
then `P` holds on all elements of `RatFunc K`.

See also `induction_on'`, which is a recursion principle defined in terms of `RatFunc.mk`.
-/
protected theorem induction_on {P : RatFunc K → Prop} (x : RatFunc K)
    (f : ∀ (p q : K[X]) (hq : q ≠ 0), P (algebraMap _ (RatFunc K) p / algebraMap _ _ q)) : P x

(f : ∀ (p q : K[X]), q ≠ 0 → P ((algebraMap K[X] (RatFunc K)) p / (algebraMap K[X] (RatFunc K)) q))


/-- (implementation) The constructured limit cone. -/
@[simps]
noncomputable def liftedCone : Cone F

(F : CategoryTheory.Functor I A.Elements)

(CategoryTheory.CategoryOfElements.CreatesLimitsAux.liftedCone F).pt.snd =
  CategoryTheory.CategoryOfElements.CreatesLimitsAux.liftedConeElement F


@[to_additive (attr := simp)]
theorem MonoidHom.toOneHom_coe [MulOneClass M] [MulOneClass N] (f : M →* N) :
    (f.toOneHom : M → N) = f

{M : Type u_4}
{N : Type u_5}
[AddZeroClass M]
[AddZeroClass N]
(f : M →+ N)


theorem reverse_injective {u v : V} : Function.Injective (reverse : G.Walk u v → _)

{V : Type u}
{G : SimpleGraph V}
{u v : V}


/-- This property implies `IsRatCondKernelCDF`. The measurability, integrability and integral
conditions are the same, but the limit properties of `IsRatCondKernelCDF` are replaced by
limits of integrals. -/
structure IsRatCondKernelCDFAux (f : α × β → ℚ → ℝ) (κ : Kernel α (β × ℝ)) (ν : Kernel α β) :
    Prop :=
  measurable : Measurable f
  mono' (a : α) {q r : ℚ} (_hqr : q ≤ r) : ∀ᵐ c ∂(ν a), f (a, c) q ≤ f (a, c) r
  nonneg' (a : α) (q : ℚ) : ∀ᵐ c ∂(ν a), 0 ≤ f (a, c) q
  le_one' (a : α) (q : ℚ) : ∀ᵐ c ∂(ν a), f (a, c) q ≤ 1
  /- Same as `Tendsto (fun q : ℚ ↦ ∫ c, f (a, c) q ∂(ν a)) atBot (𝓝 0)` but slightly easier
  to prove in the current applications of this definition (some integral convergence lemmas
  currently apply only to `ℕ`, not `ℚ`) -/
  tendsto_integral_of_antitone (a : α) (seq : ℕ → ℚ) (_hs : Antitone seq)
    (_hs_tendsto : Tendsto seq atTop atBot) :
    Tendsto (fun m ↦ ∫ c, f (a, c) (seq m) ∂(ν a)) atTop (𝓝 0)
  /- Same as `Tendsto (fun q : ℚ ↦ ∫ c, f (a, c) q ∂(ν a)) atTop (𝓝 (ν a univ).toReal)` but
  slightly easier to prove in the current applications of this definition (some integral convergence
  lemmas currently apply only to `ℕ`, not `ℚ`) -/
  tendsto_integral_of_monotone (a : α) (seq : ℕ → ℚ) (_hs : Monotone seq)
    (_hs_tendsto : Tendsto seq atTop atTop) :
    Tendsto (fun m ↦ ∫ c, f (a, c) (seq m) ∂(ν a)) atTop (𝓝 (ν a univ).toReal)
  integrable (a : α) (q : ℚ) : Integrable (fun c ↦ f (a, c) q) (ν a)
  setIntegral (a : α) {A : Set β} (_hA : MeasurableSet A) (q : ℚ) :
    ∫ c in A, f (a, c) q ∂(ν a) = (κ a (A ×ˢ Iic ↑q)).toReal

{f : α × β → ℚ → ℝ}

{κ : ProbabilityTheory.Kernel α (β × ℝ)}

(self : ProbabilityTheory.IsRatCondKernelCDFAux f κ ν)

(_hs_tendsto : Filter.Tendsto seq Filter.atTop Filter.atTop)

Filter.Tendsto (fun m => ∫ (c : β), f (a, c) (seq m) ∂ν a) Filter.atTop (𝓝 ((ν a) Set.univ).toReal)


@[simp]
theorem limit.pre_pre [h : HasLimit (D ⋙ E ⋙ F)] : haveI : HasLimit ((D ⋙ E) ⋙ F) := h
    limit.pre F E ≫ limit.pre (E ⋙ F) D = limit.pre F (D ⋙ E)

[CategoryTheory.Limits.HasLimit (E ⋙ F)]

[h : CategoryTheory.Limits.HasLimit (D ⋙ E ⋙ F)]

CategoryTheory.Limits.limit.pre F E ≫ CategoryTheory.Limits.limit.pre (E ⋙ F) D =
  CategoryTheory.Limits.limit.pre F (D ⋙ E)


/-- A category is `w`-locally small if every hom set is `w`-small.

See `ShrinkHoms C` for a category instance where every hom set has been replaced by a small model.
-/
@[pp_with_univ]
class LocallySmall (C : Type u) [Category.{v} C] : Prop where
  /-- A locally small category has small hom-types. -/
  hom_small : ∀ X Y : C, Small.{w} (X ⟶ Y) := by infer_instance

[self : CategoryTheory.LocallySmall.{w, v, u} C]


theorem ofNat'_bit (b n) : ofNat' (Nat.bit b n) = cond b Num.bit1 Num.bit0 (ofNat' n)

Num.ofNat' (Nat.bit b n) = (bif b then Num.bit1 else Num.bit0) (Num.ofNat' n)


@[simp] lemma toScott_ofScott (a : WithScott α) : toScott (ofScott a) = a

{α : Type u_1}
(a : Topology.WithScott α)

Topology.WithScott.toScott (Topology.WithScott.ofScott a) = a


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

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


@[simp] theorem mod_mod_of_dvd (a : Nat) (h : c ∣ b) : a % b % c = a % c


theorem add_pow_add_pred_mem_of_pow_mem  {m n : ℕ}
    (ha : a ^ m ∈ I) (hb : b ^ n ∈ I) :
    (a + b) ^ (m + n - 1) ∈ I

{α : Type u}
{a b : α}
[CommSemiring α]
(I : Ideal α)
{m n : ℕ}
(ha : a ^ m ∈ I)
(hb : b ^ n ∈ I)


theorem toBilin'Aux_toMatrixAux [DecidableEq n] (B₂ : BilinForm R₂ (n → R₂)) :
    -- Porting note: had to hint the base ring even though it should be clear from context...
    Matrix.toBilin'Aux (BilinForm.toMatrixAux (R₂ := R₂)
      (fun j => stdBasis R₂ (fun _ => R₂) j 1) B₂) = B₂

{R₂ : Type u_5}
[CommSemiring R₂]
{n : Type u_11}
[Fintype n]
[DecidableEq n]
(B₂ : LinearMap.BilinForm R₂ (n → R₂))

((BilinForm.toMatrixAux fun j => (LinearMap.stdBasis R₂ (fun x => R₂) j) 1) B₂).toBilin'Aux = B₂


/-- If `f` is `O(1)`, then the abscissa of absolute convergence of `f` is bounded above by `1`. -/
lemma LSeries.abscissaOfAbsConv_le_one_of_isBigO_one {f : ℕ → ℂ} (h : f =O[atTop] (1 : ℕ → ℝ)) :
    abscissaOfAbsConv f ≤ 1


@[to_additive]
theorem Normal.subgroupOf {H : Subgroup G} (hH : H.Normal) (K : Subgroup G) :
    (H.subgroupOf K).Normal

{G : Type u_1}
[Group G]
{H : Subgroup G}
(hH : H.Normal)
(K : Subgroup G)


lemma predAbove_succ_of_le (p i : Fin n) (h : p ≤ i) : p.predAbove (succ i) = i


/-- The value of `Ultrafilter.extend f` on an ultrafilter `b` is the
  unique limit of the ultrafilter `b.map f` in `γ`. -/
theorem ultrafilter_extend_eq_iff {f : α → γ} {b : Ultrafilter α} {c : γ} :
    Ultrafilter.extend f b = c ↔ ↑(b.map f) ≤ 𝓝 c

{α : Type u}
{γ : Type u_1}
[TopologicalSpace γ]
[T2Space γ]
[CompactSpace γ]
{f : α → γ}
{b : Ultrafilter α}
{c : γ}

Ultrafilter.extend f b = c ↔ ↑(Ultrafilter.map f b) ≤ 𝓝 c


@[measurability]
theorem Measurable.cos : Measurable fun x => Real.cos (f x)

{α : Type u_1}
{m : MeasurableSpace α}
{f : α → ℝ}
(hf : Measurable f)


/-- A property holds on a residual (comeagre) set if and only if it holds on some dense `Gδ` set. -/
theorem eventually_residual {p : X → Prop} :
    (∀ᶠ x in residual X, p x) ↔ ∃ t : Set X, IsGδ t ∧ Dense t ∧ ∀ x ∈ t, p x

{X : Type u_1}
[TopologicalSpace X]
[BaireSpace X]
{p : X → Prop}

(∀ᶠ (x : X) in residual X, p x) ↔ ∃ t, IsGδ t ∧ Dense t ∧ ∀ x ∈ t, p x


/-- In a one-dimensional space, any vector is a multiple of any nonzero vector -/
lemma exists_smul_eq_of_finrank_eq_one
    (h : finrank K V = 1) {x : V} (hx : x ≠ 0) (y : V) :
    ∃ (c : K), c • x = y

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
(h : FiniteDimensional.finrank K V = 1)
{x : V}
(hx : x ≠ 0)
(y : V)


theorem sUnion_eq_biUnion {s : Set (Set α)} : ⋃₀s = ⋃ (i : Set α) (_ : i ∈ s), i


@[reassoc (attr := simp)]
theorem toImageSheaf_ι {F F' : Sheaf J (Type w)} (f : F ⟶ F') :
    toImageSheaf f ≫ imageSheafι f = f

{J : CategoryTheory.GrothendieckTopology C}

{F F' : CategoryTheory.Sheaf J (Type w)}

CategoryTheory.GrothendieckTopology.toImageSheaf f ≫ CategoryTheory.GrothendieckTopology.imageSheafι f = f


@[ext]
theorem ext {I J : FractionalIdeal S P} : (∀ x, x ∈ I ↔ x ∈ J) → I = J

{R : Type u_1}
[CommRing R]
{S : Submonoid R}
{P : Type u_2}
[CommRing P]
[Algebra R P]
{I J : FractionalIdeal S P}


theorem All_and {t : RBNode α} : t.All (fun a => p a ∧ q a) ↔ t.All p ∧ t.All q

{α : Type u_1}
{p q : α → Prop}
{t : Batteries.RBNode α}

Batteries.RBNode.All (fun a => p a ∧ q a) t ↔ Batteries.RBNode.All p t ∧ Batteries.RBNode.All q t


@[simp]
theorem toSheafification_app (P : Cᵒᵖ ⥤ D) :
    (J.toSheafification D).app P = J.toSheafify P

(J : CategoryTheory.GrothendieckTopology C)

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

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

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


@[to_additive]
theorem normalizer_isSubgroup (s : Set G) : IsSubgroup (normalizer s)


@[simp]
theorem down_up {a : ULower α} : down a.up = a

{α : Type u_1}
[Encodable α]
{a : ULower α}


theorem equivalence_join (hr : Reflexive r) (ht : Transitive r)
    (h : ∀ a b c, r a b → r a c → Join r b c) : Equivalence (Join r)

(h : ∀ (a b c : α), r a b → r a c → Relation.Join r b c)


/-- An angle in a right-angled triangle expressed using `arcsin`, version subtracting vectors. -/
theorem oangle_sub_right_eq_arcsin_of_oangle_eq_pi_div_two {x y : V} (h : o.oangle x y = ↑(π / 2)) :
    o.oangle y (y - x) = Real.arcsin (‖x‖ / ‖y - x‖)

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

o.oangle y (y - x) = ↑(Real.arcsin (‖x‖ / ‖y - x‖))


theorem lt_succ_bot_iff [NoMaxOrder α] : a < succ ⊥ ↔ a = ⊥

{α : Type u_1}
[PartialOrder α]
[SuccOrder α]
{a : α}
[OrderBot α]
[NoMaxOrder α]


theorem wbtw_iff_left_eq_or_right_mem_image_Ici {x y z : P} :
    Wbtw R x y z ↔ x = y ∨ z ∈ lineMap x y '' Set.Ici (1 : R)

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{x y z : P}

Wbtw R x y z ↔ x = y ∨ z ∈ ⇑(AffineMap.lineMap x y) '' Set.Ici 1


@[to_additive]
theorem hasProd_one_iff : HasProd f 1 ↔ ∀ x, f x = 1

{ι : Type u_1}
{α : Type u_3}
[CanonicallyOrderedCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{f : ι → α}


lemma eventually_one_sub_smoothingFn_pos_real : ∀ᶠ (x : ℝ) in atTop, 0 < 1 - ε x

∀ᶠ (x : ℝ) in Filter.atTop, 0 < 1 - AkraBazziRecurrence.smoothingFn x


/-- `TopologicalSpace.Closeds.compl` as an `OrderIso` to the order dual of
`TopologicalSpace.Opens α`. -/
@[simps]
def Closeds.complOrderIso : Closeds α ≃o (Opens α)ᵒᵈ

∀ (a : TopologicalSpace.Closeds α),
  (TopologicalSpace.Closeds.complOrderIso α) a = (⇑OrderDual.toDual ∘ TopologicalSpace.Closeds.compl) a


theorem ker_pow_le_ker_pow_finrank [FiniteDimensional K V] (f : End K V) (m : ℕ) :
    LinearMap.ker (f ^ m) ≤ LinearMap.ker (f ^ finrank K V)

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
[FiniteDimensional K V]
(f : Module.End K V)
(m : ℕ)

LinearMap.ker (f ^ m) ≤ LinearMap.ker (f ^ FiniteDimensional.finrank K V)


@[simp]
lemma map₂_snd {Y : C} (f : X ⟶ Y) (p : YonedaCollection F Y) :
    (YonedaCollection.map₂ F f p).snd = F.map ((CostructuredArrow.mkPrecomp p.fst f).op ≫
      eqToHom (by rw [YonedaCollection.map₂_fst f])) p.snd

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

{F : CategoryTheory.Functor (CategoryTheory.CostructuredArrow CategoryTheory.yoneda A)ᵒᵖ (Type v)}

(p : CategoryTheory.OverPresheafAux.YonedaCollection F Y)

(CategoryTheory.OverPresheafAux.YonedaCollection.map₂ F f p).snd =
  F.map
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.CostructuredArrow.mkPrecomp p.fst f).op
      (CategoryTheory.eqToHom ⋯))
    p.snd


@[simp]
theorem eq_inv_comp (α : X ⟶ Y) [IsIso α] {f : X ⟶ Z} {g : Y ⟶ Z} : g = inv α ≫ f ↔ α ≫ g = f

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

g = CategoryTheory.CategoryStruct.comp (CategoryTheory.inv α) f ↔ CategoryTheory.CategoryStruct.comp α g = f


@[simp] lemma ofUpper_toUpper (a : α) : ofUpper (toUpper a) = a

Topology.WithUpper.ofUpper (Topology.WithUpper.toUpper a) = a


/-- In a second countable space, the set of points where a monotone function is not right-continuous
is at most countable. Superseded by `countable_not_continuousAt` which gives the two-sided
version. -/
theorem countable_not_continuousWithinAt_Ioi [SecondCountableTopology β] :
    Set.Countable { x | ¬ContinuousWithinAt f (Ioi x) x }

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[ConditionallyCompleteLinearOrder β]
[TopologicalSpace β]
[OrderTopology β]
{f : α → β}
(hf : Monotone f)
[TopologicalSpace α]
[OrderTopology α]
[SecondCountableTopology β]

{x | ¬ContinuousWithinAt f (Set.Ioi x) x}.Countable


/-- In the case that `n = ∞` we don't need the continuity assumption in
`HasFTaylorSeriesUpToOn`. -/
theorem hasFTaylorSeriesUpToOn_top_iff' :
    HasFTaylorSeriesUpToOn ∞ f p s ↔
      (∀ x ∈ s, (p x 0).uncurry0 = f x) ∧
        ∀ m : ℕ, ∀ x ∈ s, HasFDerivWithinAt (fun y => p y m) (p x m.succ).curryLeft 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}
{p : E → FormalMultilinearSeries 𝕜 E F}

HasFTaylorSeriesUpToOn ⊤ f p s ↔
  (∀ x ∈ s, (p x 0).uncurry0 = f x) ∧ ∀ (m : ℕ), ∀ x ∈ s, HasFDerivWithinAt (fun y => p y m) (p x m.succ).curryLeft s x


/-- Whiskering on the left by `E : K ⥤ J` gives a functor from `Cocone F` to `Cocone (E ⋙ F)`.
-/
@[simps]
def whiskering (E : K ⥤ J) : Cocone F ⥤ Cocone (E ⋙ F)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{K : Type u₂}
[CategoryTheory.Category.{v₂, u₂} K]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : J ⥤ C}
(E : K ⥤ J)

∀ {X Y : CategoryTheory.Limits.Cocone F} (f : X ⟶ Y), ((CategoryTheory.Limits.Cocones.whiskering E).map f).hom = f.hom


theorem tan_sq_div_one_add_tan_sq {x : ℝ} (hx : cos x ≠ 0) :
    tan x ^ 2 / (1 + tan x ^ 2) = sin x ^ 2

Real.tan x ^ 2 / (1 + Real.tan x ^ 2) = Real.sin x ^ 2


@[simp]
theorem of_le_of {p : α → Prop} {q : β → Prop} : of p ≤ of q ↔ p ≤₀ q

{α : Type u}
[Primcodable α]
[Inhabited α]
{β : Type v}
[Primcodable β]
[Inhabited β]
{p : α → Prop}
{q : β → Prop}

ManyOneDegree.of p ≤ ManyOneDegree.of q ↔ p ≤₀ q


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


@[simp]
theorem inv_smul_smul₀ {c : α} (hc : c ≠ 0) (x : β) : c⁻¹ • c • x = x

{α : Type u}
{β : Type v}
[GroupWithZero α]
[MulAction α β]
{c : α}
(hc : c ≠ 0)
(x : β)


theorem coeff_p [CharP R p] (i : ℕ) : (p : 𝕎 R).coeff i = if i = 1 then 1 else 0

(p : ℕ)
(R : Type u_1)
[hp : Fact (Nat.Prime p)]
[CommRing R]
[CharP R p]
(i : ℕ)


/-- Taking the product of an indicator function over a possibly larger finset is the same as
taking the original function over the original finset. -/
@[to_additive "Summing an indicator function over a possibly larger `Finset` is the same as summing
  the original function over the original finset."]
lemma prod_mulIndicator_subset (f : ι → β) {s t : Finset ι} (h : s ⊆ t) :
    ∏ i ∈ t, mulIndicator (↑s) f i = ∏ i ∈ s, f i

{ι : Type u_1}
{β : Type u_4}
[AddCommMonoid β]
(f : ι → β)
{s t : Finset ι}
(h : s ⊆ t)

∑ i ∈ t, (↑s).indicator f i = ∑ i ∈ s, f i


@[simp]
theorem minpoly_toMatrix' (f : (n → R) →ₗ[R] n → R) : minpoly R (toMatrix' f) = minpoly R f

{R : Type u}
[CommRing R]
{n : Type v}
[DecidableEq n]
[Fintype n]
(f : (n → R) →ₗ[R] n → R)

minpoly R (LinearMap.toMatrix' f) = minpoly R f


theorem Filter.HasBasis.specializes_iff_uniformity {ι : Sort*} {p : ι → Prop} {s : ι → Set (α × α)}
    (h : (𝓤 α).HasBasis p s) {x y : α} : x ⤳ y ↔ ∀ i, p i → (x, y) ∈ s i

{α : Type u}
[UniformSpace α]
{ι : Sort u_1}
{p : ι → Prop}
{s : ι → Set (α × α)}
(h : (𝓤 α).HasBasis p s)
{x y : α}


lemma lintegral_stieltjesOfMeasurableRat [IsFiniteKernel κ] (hf : IsRatCondKernelCDF f κ ν)
    (a : α) (x : ℝ) :
    ∫⁻ b, ENNReal.ofReal (stieltjesOfMeasurableRat f hf.measurable (a, b) x) ∂(ν a)
      = κ a (univ ×ˢ Iic x)

{κ : ProbabilityTheory.Kernel α (β × ℝ)}

{f : α × β → ℚ → ℝ}

(hf : ProbabilityTheory.IsRatCondKernelCDF f κ ν)

∫⁻ (b : β), ENNReal.ofReal (↑(ProbabilityTheory.stieltjesOfMeasurableRat f ⋯ (a, b)) x) ∂ν a =
  (κ a) (Set.univ ×ˢ Set.Iic x)


theorem mem_map_indicator_ae_iff_mem_map_restrict_ae_of_zero_mem [Zero β] {t : Set β}
    (ht : (0 : β) ∈ t) (hs : MeasurableSet s) :
    t ∈ Filter.map (s.indicator f) (ae μ) ↔ t ∈ Filter.map f (ae <| μ.restrict s)

{α : Type u_2}
{β : Type u_3}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{s : Set α}
{f : α → β}
[Zero β]
{t : Set β}
(ht : 0 ∈ t)
(hs : MeasurableSet s)

t ∈ Filter.map (s.indicator f) (MeasureTheory.ae μ) ↔ t ∈ Filter.map f (MeasureTheory.ae (μ.restrict s))


theorem emod_bmod {x : Int} {m : Nat} : bmod (x % m) m = bmod x m


@[simp]
theorem zipLeft'_nil_right : zipLeft' as ([] : List β) = (as.map fun a => (a, none), [])

as.zipLeft' [] = (List.map (fun a => (a, none)) as, [])


lemma discrim_lt_zero_of_neg (ha : a ≠ 0) (h : ∀ x : K, a * x * x + b * x + c < 0) :
    discrim a b c < 0


/-- `R`-algebra homomorphism between the function spaces `I → A` and `I → B`, induced by an
`R`-algebra homomorphism `f` between `A` and `B`. -/
@[simps]
protected def compLeft (f : A →ₐ[R] B) (I : Type*) : (I → A) →ₐ[R] I → B

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Semiring B]
[Algebra R A]
[Algebra R B]
(f : A →ₐ[R] B)
(I : Type u_2)
(h : I → A)

∀ (a : I), (f.compLeft I) h a = (⇑f ∘ h) a


@[simp]
theorem generate_top : generate (⊤ : Presieve X) = ⊤

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


@[simp] theorem Proj.pow_apply (n : ℕ) : (s ^ n).1 x = s.1 x ^ n

{V : (TopologicalSpace.Opens ↑(ProjectiveSpectrum.top 𝒜))ᵒᵖ}

(s : ↑((AlgebraicGeometry.ProjectiveSpectrum.Proj.structureSheaf 𝒜).val.obj V))


@[to_additive]
theorem EventuallyEq.div [Div β] {f f' g g' : α → β} {l : Filter α} (h : f =ᶠ[l] g)
    (h' : f' =ᶠ[l] g') : (fun x => f x / f' x) =ᶠ[l] fun x => g x / g' x

{α : Type u}
{β : Type v}
[Sub β]
{f f' g g' : α → β}
{l : Filter α}
(h : f =ᶠ[l] g)
(h' : f' =ᶠ[l] g')

(fun x => f x - f' x) =ᶠ[l] fun x => g x - g' x


theorem _root_.Continuous.ae_eq_iff_eq {f g : X → Y} (hf : Continuous f) (hg : Continuous g) :
    f =ᵐ[μ] g ↔ f = g

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
{m : MeasurableSpace X}
[TopologicalSpace Y]
[T2Space Y]
(μ : MeasureTheory.Measure X)
[μ.IsOpenPosMeasure]
{f g : X → Y}
(hf : Continuous f)
(hg : Continuous g)


theorem _root_.LinearMap.IsSymmetric.hasStrictFDerivAt_reApplyInnerSelf {T : F →L[ℝ] F}
    (hT : (T : F →ₗ[ℝ] F).IsSymmetric) (x₀ : F) :
    HasStrictFDerivAt T.reApplyInnerSelf (2 • (innerSL ℝ (T x₀))) x₀

{F : Type u_3}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
{T : F →L[ℝ] F}
(hT : (↑T).IsSymmetric)
(x₀ : F)

HasStrictFDerivAt T.reApplyInnerSelf (2 • (innerSL ℝ) (T x₀)) x₀


/-- If a function is linearly approximated by a continuous linear map with a (possibly nonlinear)
right inverse, then it is locally onto: a ball of an explicit radius is included in the image
of the map. -/
theorem surjOn_closedBall_of_nonlinearRightInverse (hf : ApproximatesLinearOn f f' s c)
    (f'symm : f'.NonlinearRightInverse) {ε : ℝ} {b : E} (ε0 : 0 ≤ ε) (hε : closedBall b ε ⊆ s) :
    SurjOn f (closedBall b ε) (closedBall (f b) (((f'symm.nnnorm : ℝ)⁻¹ - c) * ε))

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace E]
{f : E → F}
{s : Set E}
{c : ℝ≥0}
{f' : E →L[𝕜] F}
(hf : ApproximatesLinearOn f f' s c)
(f'symm : f'.NonlinearRightInverse)
{ε : ℝ}
{b : E}
(ε0 : 0 ≤ ε)
(hε : Metric.closedBall b ε ⊆ s)

Set.SurjOn f (Metric.closedBall b ε) (Metric.closedBall (f b) (((↑f'symm.nnnorm)⁻¹ - ↑c) * ε))


theorem traverse_map {G : Type* → Type _} [Applicative G] [CommApplicative G] {α β γ : Type _}
    (g : α → β) (h : β → G γ) (x : Multiset α) : traverse h (map g x) = traverse (h ∘ g) x

{G : Type u_1 → Type u_1}
[Applicative G]
[CommApplicative G]
{α β γ : Type u_1}
(g : α → β)
(h : β → G γ)
(x : Multiset α)

Multiset.traverse h (Multiset.map g x) = Multiset.traverse (h ∘ g) x


@[to_additive]
theorem inv_lt_one_of_one_lt : 1 < a → a⁻¹ < 1

{α : Type u}
[OrderedCommGroup α]
{a : α}


@[simp]
theorem swap_inj {p q : α × β} : swap p = swap q ↔ p = q

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


theorem coprod.pentagon (W X Y Z : C) :
    coprod.map (coprod.associator W X Y).hom (𝟙 Z) ≫
        (coprod.associator W (X ⨿ Y) Z).hom ≫ coprod.map (𝟙 W) (coprod.associator X Y Z).hom =
      (coprod.associator (W ⨿ X) Y Z).hom ≫ (coprod.associator W X (Y ⨿ Z)).hom

CategoryTheory.Limits.coprod.map (CategoryTheory.Limits.coprod.associator W X Y).hom (𝟙 Z) ≫
    (CategoryTheory.Limits.coprod.associator W (X ⨿ Y) Z).hom ≫
      CategoryTheory.Limits.coprod.map (𝟙 W) (CategoryTheory.Limits.coprod.associator X Y Z).hom =
  (CategoryTheory.Limits.coprod.associator (W ⨿ X) Y Z).hom ≫ (CategoryTheory.Limits.coprod.associator W X (Y ⨿ Z)).hom


@[simp]
theorem det_blockDiagonal {o : Type*} [Fintype o] [DecidableEq o] (M : o → Matrix n n R) :
    (blockDiagonal M).det = ∏ k, (M k).det

{n : Type u_2}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
{o : Type u_3}
[Fintype o]
[DecidableEq o]
(M : o → Matrix n n R)

(Matrix.blockDiagonal M).det = ∏ k : o, (M k).det


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

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


theorem degree_div_lt (hp : p ≠ 0) (hq : 0 < degree q) : degree (p / q) < degree p

{R : Type u}
[Field R]
{p q : R[X]}
(hp : p ≠ 0)
(hq : 0 < q.degree)


@[simp]
theorem univ_eq_empty [IsEmpty α] : (univ : Finset α) = ∅


@[simp]
theorem expand_eval (p : ℕ) (P : R[X]) (r : R) : eval r (expand R p P) = eval (r ^ p) P

{R : Type u}
[CommSemiring R]
(p : ℕ)
(P : R[X])
(r : R)

Polynomial.eval r ((Polynomial.expand R p) P) = Polynomial.eval (r ^ p) P


theorem quotientEquivSigmaZMod_apply (q : orbitRel.Quotient (zpowers g) (G ⧸ H)) (k : ℤ) :
    quotientEquivSigmaZMod H g (g ^ k • q.out') = ⟨q, k⟩

(q : MulAction.orbitRel.Quotient (↥(Subgroup.zpowers g)) (G ⧸ H))

(H.quotientEquivSigmaZMod g) (g ^ k • Quotient.out' q) = ⟨q, ↑k⟩


/-- Auxiliary lemma for `tendstoInMeasure_of_tendsto_ae`. -/
theorem tendstoInMeasure_of_tendsto_ae_of_stronglyMeasurable [IsFiniteMeasure μ]
    (hf : ∀ n, StronglyMeasurable (f n)) (hg : StronglyMeasurable g)
    (hfg : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) : TendstoInMeasure μ f atTop g

(hf : ∀ (n : ℕ), MeasureTheory.StronglyMeasurable (f n))

(hg : MeasureTheory.StronglyMeasurable g)

(hfg : ∀ᵐ (x : α) ∂μ, Filter.Tendsto (fun n => f n x) Filter.atTop (𝓝 (g x)))

MeasureTheory.TendstoInMeasure μ f Filter.atTop g


theorem IsBot.prod_mk (ha : IsBot a) (hb : IsBot b) : IsBot (a, b)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{a : α}
{b : β}
(ha : IsBot a)
(hb : IsBot b)


@[measurability]
theorem measurable_edist : Measurable fun p : α × α => edist p.1 p.2

{α : Type u_1}
[PseudoEMetricSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[SecondCountableTopology α]


theorem IsLowerSet.not_bddBelow (hs : IsLowerSet s) : s.Nonempty → ¬BddBelow s

{α : Type u_1}
[Preorder α]
{s : Set α}
[NoMinOrder α]
(hs : IsLowerSet s)


theorem rank_le_card : Module.rank R M ≤ #M

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


theorem gauge_neg (symmetric : ∀ x ∈ s, -x ∈ s) (x : E) : gauge s (-x) = gauge s x

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
(symmetric : ∀ x ∈ s, -x ∈ s)
(x : E)


@[simp]
theorem edist_toMul (a b : Additive X) : edist (toMul a) (toMul b) = edist a b

{X : Type u_1}
[EDist X]
(a b : Additive X)

edist (Additive.toMul a) (Additive.toMul b) = edist a b


@[to_additive]
lemma preimage_mul (hm : Injective m) {s t : Set β} (hs : s ⊆ range m) (ht : t ⊆ range m) :
    m ⁻¹' (s * t) = m ⁻¹' s * m ⁻¹' t

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


/-- The order of `ω` in the unit group is exactly `2^p`. -/
theorem order_ω (p' : ℕ) (h : lucasLehmerResidue (p' + 2) = 0) :
    orderOf (ωUnit (p' + 2)) = 2 ^ (p' + 2)

orderOf (LucasLehmer.ωUnit (p' + 2)) = 2 ^ (p' + 2)


/-- `ValuationClass F α β` states that `F` is a type of valuations.

You should also extend this typeclass when you extend `Valuation`. -/
class ValuationClass (F) (R Γ₀ : outParam Type*) [LinearOrderedCommMonoidWithZero Γ₀] [Ring R]
  [FunLike F R Γ₀]
  extends MonoidWithZeroHomClass F R Γ₀ : Prop where
  /-- The valuation of a a sum is less that the sum of the valuations -/
  map_add_le_max (f : F) (x y : R) : f (x + y) ≤ max (f x) (f y)

{F : Type u_7}
{R : outParam (Type u_5)}
{Γ₀ : outParam (Type u_6)}
[LinearOrderedCommMonoidWithZero Γ₀]
[Ring R]
[FunLike F R Γ₀]
[self : ValuationClass F R Γ₀]
(f : F)
(x y : R)


@[simp]
theorem orientation_isEmpty [IsEmpty ι] (b : Basis ι R M) :
    b.orientation = positiveOrientation

{R : Type u_1}
[StrictOrderedCommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{ι : Type u_4}
[Fintype ι]
[DecidableEq ι]
[IsEmpty ι]
(b : Basis ι R M)


/-- `2` is a square in `F` iff `#F` is not congruent to `3` or `5` mod `8`. -/
theorem FiniteField.isSquare_two_iff :
    IsSquare (2 : F) ↔ Fintype.card F % 8 ≠ 3 ∧ Fintype.card F % 8 ≠ 5

IsSquare 2 ↔ Fintype.card F % 8 ≠ 3 ∧ Fintype.card F % 8 ≠ 5


theorem isRightInversion_of_mem_rightInvSeq {ω : List B} (hω : cs.IsReduced ω) {t : W}
    (ht : t ∈ ris ω) : cs.IsRightInversion (π ω) t

{B : Type u_1}
{W : Type u_2}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
{ω : List B}
(hω : cs.IsReduced ω)
{t : W}
(ht : t ∈ cs.rightInvSeq ω)


theorem disjoint_range_addRightEmbedding (a b : ℕ) :
    Disjoint (range a) (map (addRightEmbedding a) (range b))

Disjoint (Finset.range a) (Finset.map (addRightEmbedding a) (Finset.range b))


@[simp]
lemma div_top {a : EReal} : a / ⊤ = 0


theorem mul_continuousOn [LocallyCompactSpace X] [T2Space X] [NormedRing R]
    [SecondCountableTopologyEither X R] {f g : X → R} {s : Set X} (hf : LocallyIntegrableOn f s μ)
    (hg : ContinuousOn g s) (hs : IsOpen s) : LocallyIntegrableOn (fun x => f x * g x) s μ

(hf : MeasureTheory.LocallyIntegrableOn f s μ)

MeasureTheory.LocallyIntegrableOn (fun x => f x * g x) s μ


theorem inter_subset_right {s₁ s₂ : Finset α} : s₁ ∩ s₂ ⊆ s₂

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

s₁ ∩ s₂ ⊆ s₂


@[to_additive]
theorem mem_smul : t ∈ f • g ↔ ∃ t₁ ∈ f, ∃ t₂ ∈ g, t₁ • t₂ ⊆ t

{α : Type u_2}
{β : Type u_3}
[VAdd α β]
{f : Filter α}
{g : Filter β}
{t : Set β}

t ∈ f +ᵥ g ↔ ∃ t₁ ∈ f, ∃ t₂ ∈ g, t₁ +ᵥ t₂ ⊆ t


@[norm_cast] lemma natCast_inj {m n : ℕ} : (m : ℤ) = (n : ℤ) ↔ m = n


theorem Finset.pairwiseDisjoint_range_singleton :
    (Set.range (singleton : α → Finset α)).PairwiseDisjoint id


@[deprecated inv_mem_center (since := "2024-06-17")]
theorem inv_mem_center₀ (ha : a ∈ Set.center G₀) : a⁻¹ ∈ Set.center G₀

{G₀ : Type u_2}
[GroupWithZero G₀]
{a : G₀}
(ha : a ∈ Set.center G₀)


theorem not_mem_of_not_mem_closure {P : X} (hP : P ∉ closure s) : P ∉ s

{X : Type u}
{s : Set X}
[TopologicalSpace X]
{P : X}
(hP : P ∉ closure s)


theorem circleIntegral_def_Icc (f : ℂ → E) (c : ℂ) (R : ℝ) :
    (∮ z in C(c, R), f z) = ∫ θ in Icc 0 (2 * π),
    deriv (circleMap c R) θ • f (circleMap c R θ)

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

(∮ (z : ℂ) in C(c, R), f z) = ∫ (θ : ℝ) in Set.Icc 0 (2 * π), deriv (circleMap c R) θ • f (circleMap c R θ)


theorem option_some_iff {f : α →. σ} : (Partrec fun a => (f a).map Option.some) ↔ Partrec f

{α : Type u_1}
{σ : Type u_4}
[Primcodable α]
[Primcodable σ]
{f : α →. σ}

(Partrec fun a => Part.map some (f a)) ↔ Partrec f


theorem trop_injective : Function.Injective (trop : R → Tropical R)


/-- `toUnit` as a monotone function -/
@[simps]
def toUnitMono (f : Part α →o Part α) : (Unit → Part α) →o Unit → Part α

{α : Type u_1}
(f : Part α →o Part α)
(x : Unit → Part α)
(u : Unit)


theorem natAbs_mul_natAbs_eq {a b : Int} {c : Nat}
    (h : a * b = (c : Int)) : a.natAbs * b.natAbs = c


/-- Quotienting a group by its torsion subgroup yields a torsion free group. -/
@[to_additive AddIsTorsionFree.quotient_torsion
      "Quotienting a group by its additive torsion subgroup yields an additive torsion free group."]
theorem IsTorsionFree.quotient_torsion : IsTorsionFree <| G ⧸ torsion G

Monoid.IsTorsionFree (G ⧸ CommGroup.torsion G)


/-- A `PreconnectedSpace` version of `isPreconnected_of_forall_constant` -/
theorem preconnectedSpace_of_forall_constant
    (hs : ∀ f : α → Bool, Continuous f → ∀ x y, f x = f y) : PreconnectedSpace α

(hs : ∀ (f : α → Bool), Continuous f → ∀ (x y : α), f x = f y)


theorem sub_mem_pNilradical_iff_pow_expChar_pow_eq {R : Type*} [CommRing R] {p : ℕ} [ExpChar R p]
    {x y : R} : x - y ∈ pNilradical R p ↔ ∃ n : ℕ, x ^ p ^ n = y ^ p ^ n

{R : Type u_1}
[CommRing R]
{p : ℕ}
[ExpChar R p]
{x y : R}

x - y ∈ pNilradical R p ↔ ∃ n, x ^ p ^ n = y ^ p ^ n


theorem BoundedSMul.of_nnnorm_smul_le (h : ∀ (r : α) (x : β), ‖r • x‖₊ ≤ ‖r‖₊ * ‖x‖₊) :
    BoundedSMul α β


@[simp]
theorem forall₂_same : ∀ {l : List α}, Forall₂ Rₐ l l ↔ ∀ x ∈ l, Rₐ x x

{α : Type u_1}
{Rₐ : α → α → Prop}
{l : List α}

List.Forall₂ Rₐ l l ↔ ∀ (x : α), x ∈ l → Rₐ x x


theorem USize.le_antisymm_iff {x y : USize} : x = y ↔ x ≤ y ∧ y ≤ x


theorem exists_hasSum_smul_of_apply_eq_zero (hs : HasSum (fun m => z ^ m • a m) s)
    (ha : ∀ k < n, a k = 0) : ∃ t : E, z ^ n • t = s ∧ HasSum (fun m => z ^ m • a (m + n)) t

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{s : E}
{n : ℕ}
{z : 𝕜}
{a : ℕ → E}
(hs : HasSum (fun m => z ^ m • a m) s)
(ha : ∀ k < n, a k = 0)

∃ t, z ^ n • t = s ∧ HasSum (fun m => z ^ m • a (m + n)) t


theorem isLocalization : IsLocalization (Submonoid.closure ({X} : Set R[X])) R[T;T⁻¹]

IsLocalization (Submonoid.closure {Polynomial.X}) R[T;T⁻¹]


@[simp]
theorem comp_apply (f : BoundedOrderHom β γ) (g : BoundedOrderHom α β) (a : α) :
    (f.comp g) a = f (g a)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[Preorder α]
[Preorder β]
[Preorder γ]
[BoundedOrder α]
[BoundedOrder β]
[BoundedOrder γ]
(f : BoundedOrderHom β γ)
(g : BoundedOrderHom α β)
(a : α)


lemma obj_eq_of_cons_eq_cons {p : Path a b} {p' : Path a c}
    {e : b ⟶ d} {e' : c ⟶ d} (h : p.cons e = p'.cons e') : b = c

{V : Type u}
[Quiver V]
{a b c d : V}
{p : Quiver.Path a b}
{p' : Quiver.Path a c}
{e : b ⟶ d}
{e' : c ⟶ d}
(h : p.cons e = p'.cons e')


theorem HasStrictFDerivAt.sin (hf : HasStrictFDerivAt f f' x) :
    HasStrictFDerivAt (fun x => Real.sin (f x)) (Real.cos (f x) • f') x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : E → ℝ}
{f' : E →L[ℝ] ℝ}
{x : E}
(hf : HasStrictFDerivAt f f' x)


/-- Two isomorphic functors `F₁` and `F₂` induce isomorphic functors
`F₁.mapTriangle` and `F₂.mapTriangle` if the isomorphism `F₁ ≅ F₂` is compatible
with the shifts. -/
@[simps!]
def mapTriangleIso {F₁ F₂ : C ⥤ D} (e : F₁ ≅ F₂) [F₁.CommShift ℤ] [F₂.CommShift ℤ]
    [NatTrans.CommShift e.hom ℤ] : F₁.mapTriangle ≅ F₂.mapTriangle

(X : CategoryTheory.Pretriangulated.Triangle C)

((CategoryTheory.Functor.mapTriangleIso e).inv.app X).hom₁ = e.inv.app X.obj₁


@[simp]
theorem toDual_symmDiff : toDual (a ∆ b) = toDual a ⇔ toDual b

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

OrderDual.toDual (a ∆ b) = OrderDual.toDual a ⇔ OrderDual.toDual b


@[simp]
theorem norm_toComplL {𝕜 E : Type*} [NontriviallyNormedField 𝕜] [NormedAddCommGroup E]
    [NormedSpace 𝕜 E] [Nontrivial E] : ‖(toComplL : E →L[𝕜] Completion E)‖ = 1

{𝕜 : Type u_3}
{E : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[Nontrivial E]


@[to_additive]
theorem IsUpperSet.smul (hs : IsUpperSet s) : IsUpperSet (a • s)

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


@[simp]
theorem relNorm_top : relNorm R (⊤ : Ideal S) = ⊤

(R : Type u_1)
[CommRing R]
{S : Type u_2}
[CommRing S]
[Algebra R S]
[IsDomain R]
[IsDomain S]
[IsDedekindDomain R]
[IsDedekindDomain S]
[Module.Finite R S]
[Module.Free R S]


lemma Exact.isZero_of_both_zeros (ex : S.Exact) (hf : S.f = 0) (hg : S.g = 0) :
    IsZero S.X₂


theorem natDegree_zero_le : natDegree (0 : R[X]) ≤ 0


/-- The product `Bool × α` is equivalent to `α ⊕ α`. -/
@[simps]
def boolProdEquivSum (α) : Bool × α ≃ α ⊕ α

(Equiv.boolProdEquivSum α) p = Bool.casesOn p.1 (Sum.inl p.2) (Sum.inr p.2)


/--
A topological space `X` is said to be perfect if its universe is a perfect set.
Equivalently, this means that `𝓝[≠] x ≠ ⊥` for every point `x : X`.
-/
@[mk_iff perfectSpace_def]
class PerfectSpace : Prop :=
  univ_preperfect : Preperfect (Set.univ : Set α)


lemma ite_zero_mul_ite_zero : ite P a 0 * ite Q b 0 = ite (P ∧ Q) (a * b) 0

{α : Type u}
[MulZeroClass α]
(P Q : Prop)
[Decidable P]
[Decidable Q]
(a b : α)

((if P then a else 0) * if Q then b else 0) = if P ∧ Q then a * b else 0


theorem monotone_Iic : Monotone (Iic : α → Set α)


/-- If `s` is either open, or closed, then `f` is locally integrable on `s` iff it is integrable on
every compact subset contained in `s`. -/
theorem locallyIntegrableOn_iff [LocallyCompactSpace X] [T2Space X] (hs : IsClosed s ∨ IsOpen s) :
    LocallyIntegrableOn f s μ ↔ ∀ (k : Set X), k ⊆ s → (IsCompact k → IntegrableOn f k μ)

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[TopologicalSpace X]
[NormedAddCommGroup E]
{f : X → E}
{μ : MeasureTheory.Measure X}
{s : Set X}
[LocallyCompactSpace X]
[T2Space X]
(hs : IsClosed s ∨ IsOpen s)

MeasureTheory.LocallyIntegrableOn f s μ ↔ ∀ k ⊆ s, IsCompact k → MeasureTheory.IntegrableOn f k μ


@[to_additive Set.AddAntidiagonal.finite_of_isPWO]
theorem finite_of_isPWO (hs : s.IsPWO) (ht : t.IsPWO) (a) : (mulAntidiagonal s t a).Finite

{α : Type u_1}
[OrderedCancelCommMonoid α]
{s t : Set α}
(hs : s.IsPWO)
(ht : t.IsPWO)
(a : α)


theorem BijOn.mk (h₁ : MapsTo f s t) (h₂ : InjOn f s) (h₃ : SurjOn f s t) : BijOn f s t

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : Set β}
{f : α → β}
(h₁ : Set.MapsTo f s t)
(h₂ : Set.InjOn f s)
(h₃ : Set.SurjOn f s t)


@[simp]
theorem coe_comp_addMonoidHom (g : β →ₙ+* γ) (f : α →ₙ+* β) :
    AddMonoidHom.mk ⟨g ∘ f, (g.comp f).map_zero'⟩ (g.comp f).map_add' = (g : β →+ γ).comp f

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[NonUnitalNonAssocSemiring α]
[NonUnitalNonAssocSemiring β]
[NonUnitalNonAssocSemiring γ]
(g : β →ₙ+* γ)
(f : α →ₙ+* β)

{ toFun := ⇑g ∘ ⇑f, map_zero' := ⋯, map_add' := ⋯ } = (↑g).comp ↑f


@[to_additive addIndex_union_le]
theorem index_union_le (K₁ K₂ : Compacts G) {V : Set G} (hV : (interior V).Nonempty) :
    index (K₁.1 ∪ K₂.1) V ≤ index K₁.1 V + index K₂.1 V

{G : Type u_1}
[Group G]
[TopologicalSpace G]
[TopologicalGroup G]
(K₁ K₂ : TopologicalSpace.Compacts G)
{V : Set G}
(hV : (interior V).Nonempty)

MeasureTheory.Measure.haar.index (K₁.carrier ∪ K₂.carrier) V ≤
  MeasureTheory.Measure.haar.index K₁.carrier V + MeasureTheory.Measure.haar.index K₂.carrier V


theorem ContinuousWithinAt.inner (hf : ContinuousWithinAt f s x) (hg : ContinuousWithinAt g s x) :
    ContinuousWithinAt (fun t => ⟪f t, g t⟫) s x

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{α : Type u_4}
[TopologicalSpace α]
{f g : α → E}
{x : α}
{s : Set α}
(hf : ContinuousWithinAt f s x)
(hg : ContinuousWithinAt g s x)

ContinuousWithinAt (fun t => ⟪f t, g t⟫_𝕜) s x


@[simp]
theorem mem_srange {f : F} {y : S} : y ∈ srange f ↔ ∃ x, f x = y

{R : Type u}
{S : Type v}
[NonUnitalNonAssocSemiring R]
[NonUnitalNonAssocSemiring S]
{F : Type u_1}
[FunLike F R S]
[NonUnitalRingHomClass F R S]
{f : F}
{y : S}

y ∈ NonUnitalRingHom.srange f ↔ ∃ x, f x = y


theorem IsSubordinate.disjUnion [Fintype ι] (h₁ : IsSubordinate π₁ r) (h₂ : IsSubordinate π₂ r)
    (h : Disjoint π₁.iUnion π₂.iUnion) : IsSubordinate (π₁.disjUnion π₂ h) r

{π₁ π₂ : BoxIntegral.TaggedPrepartition I}


theorem isUnit_map [Field k] (f : R →+* k) : IsUnit (p.map f) ↔ IsUnit p

{R : Type u}
{k : Type y}
[Field R]
{p : R[X]}
[Field k]
(f : R →+* k)


@[to_additive]
theorem copy_eq {s : Set M} (hs : s = S) : S.copy s hs = S

{M : Type u_1}
[MulOneClass M]
{S : Submonoid M}
{s : Set M}
(hs : s = ↑S)


/-- `Equiv.piCongrRight` as a uniform isomorphism: this is the natural isomorphism
`Π i, β₁ i ≃ᵤ Π j, β₂ i` obtained from uniform isomorphisms `β₁ i ≃ᵤ β₂ i` for each `i`. -/
@[simps! apply toEquiv]
def piCongrRight {ι : Type*} {β₁ β₂ : ι → Type*} [∀ i, UniformSpace (β₁ i)]
    [∀ i, UniformSpace (β₂ i)] (F : ∀ i, β₁ i ≃ᵤ β₂ i) : (∀ i, β₁ i) ≃ᵤ ∀ i, β₂ i

{ι : Type u_4}
{β₁ : ι → Type u_5}
{β₂ : ι → Type u_6}
[(i : ι) → UniformSpace (β₁ i)]
[(i : ι) → UniformSpace (β₂ i)]
(F : (i : ι) → β₁ i ≃ᵤ β₂ i)
(H : (a : ι) → β₁ a)
(a : ι)

(UniformEquiv.piCongrRight F) H a = (F a) (H a)


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

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


theorem deriv_of_bilinear (hu : DifferentiableAt 𝕜 u x) (hv : DifferentiableAt 𝕜 v x) :
    deriv (fun y => B (u y) (v y)) x = B (u x) (deriv v x) + B (deriv u x) (v x)

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{E : Type w}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{G : Type u_1}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{x : 𝕜}
{B : E →L[𝕜] F →L[𝕜] G}
{u : 𝕜 → E}
{v : 𝕜 → F}
(hu : DifferentiableAt 𝕜 u x)
(hv : DifferentiableAt 𝕜 v x)

deriv (fun y => (B (u y)) (v y)) x = (B (u x)) (deriv v x) + (B (deriv u x)) (v x)


/-- For functions to `ℝ`, it suffices to prove `f x ≤ f y + K * dist x y`; this version
doesn't assume `0≤K`. -/
protected theorem of_le_add_mul' {f : α → ℝ} (K : ℝ) (h : ∀ x y, f x ≤ f y + K * dist x y) :
    LipschitzWith (Real.toNNReal K) f

(h : ∀ (x y : α), f x ≤ f y + K * dist x y)


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

(α : Type u_2)
[TopologicalSpace α]
[Preorder α]


@[simp]
lemma neg_some {x y : R} (h : W.Nonsingular x y) : -some h = some (nonsingular_neg h)

{R : Type u}
[CommRing R]
{W : WeierstrassCurve.Affine R}
{x y : R}
(h : W.Nonsingular x y)

-WeierstrassCurve.Affine.Point.some h = WeierstrassCurve.Affine.Point.some ⋯


theorem powersetAux_perm {l₁ l₂ : List α} (p : l₁ ~ l₂) : powersetAux l₁ ~ powersetAux l₂

{α : Type u_1}
{l₁ l₂ : List α}
(p : l₁.Perm l₂)

(Multiset.powersetAux l₁).Perm (Multiset.powersetAux l₂)


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


/-- The sine of the angle between three points is 0 if and only if the angle is 0 or π. -/
nonrec theorem sin_eq_zero_iff_angle_eq_zero_or_angle_eq_pi {p₁ p₂ p₃ : P} :
    Real.sin (∠ p₁ p₂ p₃) = 0 ↔ ∠ p₁ p₂ p₃ = 0 ∨ ∠ p₁ p₂ p₃ = π

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p₁ p₂ p₃ : P}

Real.sin (EuclideanGeometry.angle p₁ p₂ p₃) = 0 ↔
  EuclideanGeometry.angle p₁ p₂ p₃ = 0 ∨ EuclideanGeometry.angle p₁ p₂ p₃ = π


theorem comp_proof {P Q R : Karoubi C} (g : Hom Q R) (f : Hom P Q) :
    f.f ≫ g.f = P.p ≫ (f.f ≫ g.f) ≫ R.p

{P Q R : CategoryTheory.Idempotents.Karoubi C}

CategoryTheory.CategoryStruct.comp f.f g.f =
  CategoryTheory.CategoryStruct.comp P.p
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.CategoryStruct.comp f.f g.f) R.p)


theorem sin_ne_zero_iff {θ : Angle} : sin θ ≠ 0 ↔ θ ≠ 0 ∧ θ ≠ π

θ.sin ≠ 0 ↔ θ ≠ 0 ∧ θ ≠ ↑π


@[to_additive (attr := simp)]
theorem toFinset_mul (s t : Set α) [Fintype s] [Fintype t] [Fintype ↑(s * t)] :
    (s * t).toFinset = s.toFinset * t.toFinset

{α : Type u_2}
[DecidableEq α]
[Add α]
(s t : Set α)
[Fintype ↑s]
[Fintype ↑t]
[Fintype ↑(s + t)]

(s + t).toFinset = s.toFinset + t.toFinset


theorem dropWhile_map (f : α → β) (p : β → Bool) (l : List α) :
    (l.map f).dropWhile p = (l.dropWhile (p ∘ f)).map f

{α : Type u_1}
{β : Type u_2}
(f : α → β)
(p : β → Bool)
(l : List α)

List.dropWhile p (List.map f l) = List.map f (List.dropWhile (p ∘ f) l)


theorem isVonNBounded_sub_of_nonempty (hs : s.Nonempty) (ht : t.Nonempty) :
    IsVonNBounded 𝕜 (s - t) ↔ IsVonNBounded 𝕜 s ∧ IsVonNBounded 𝕜 t

{𝕜 : Type u_1}
{E : Type u_3}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[ContinuousSMul 𝕜 E]
[TopologicalAddGroup E]
{s t : Set E}
(hs : s.Nonempty)
(ht : t.Nonempty)

Bornology.IsVonNBounded 𝕜 (s - t) ↔ Bornology.IsVonNBounded 𝕜 s ∧ Bornology.IsVonNBounded 𝕜 t


theorem exists_of_card_le_finset [Fintype α] {s : Finset β} (h : Fintype.card α ≤ s.card) :
    ∃ f : α ↪ β, Set.range f ⊆ s

{α : Type u_1}
{β : Type u_2}
[Fintype α]
{s : Finset β}
(h : Fintype.card α ≤ s.card)


@[simp]
theorem succ_def (m : ℕ∞) : Order.succ m = m + 1


/-- A version of **Sard's lemma** in fixed dimension: given a differentiable function from `E`
to `E` and a set where the differential is not invertible, then the image of this set has
zero measure. Here, we give an auxiliary statement towards this result. -/
theorem addHaar_image_eq_zero_of_det_fderivWithin_eq_zero_aux
    (hf' : ∀ x ∈ s, HasFDerivWithinAt f (f' x) s x) (R : ℝ) (hs : s ⊆ closedBall 0 R) (ε : ℝ≥0)
    (εpos : 0 < ε) (h'f' : ∀ x ∈ s, (f' x).det = 0) : μ (f '' s) ≤ ε * μ (closedBall 0 R)

μ (f '' s) ≤ ↑ε * μ (Metric.closedBall 0 R)