@[simp] lemma smul_ceilDiv [PosSMulMono α β] [PosSMulReflectLE α β] (ha : 0 < a) (b : β) :
    a • b ⌈/⌉ a = b

{α : Type u_2}
{β : Type u_3}
[OrderedSemiring α]
[OrderedAddCommMonoid β]
[MulActionWithZero α β]
[CeilDiv α β]
{a : α}
[PosSMulMono α β]
[PosSMulReflectLE α β]
(ha : 0 < a)
(b : β)


@[simp]
theorem ofBoolRing_sub (a b : AsBoolRing α) : ofBoolRing (a - b) = ofBoolRing a ∆ ofBoolRing b

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


theorem eq_inv_iff_mul_eq_one {φ ψ : k⟦X⟧} (h : constantCoeff k ψ ≠ 0) :
    φ = ψ⁻¹ ↔ φ * ψ = 1

(h : (PowerSeries.constantCoeff k) ψ ≠ 0)

φ = ψ⁻¹ ↔ φ * ψ = 1


/-- If a function has a Taylor series at order at least `1`, then the term of order `1` of this
series is a derivative of `f`. -/
theorem HasFTaylorSeriesUpToOn.hasFDerivWithinAt (h : HasFTaylorSeriesUpToOn n f p s) (hn : 1 ≤ n)
    (hx : x ∈ s) : HasFDerivWithinAt f (continuousMultilinearCurryFin1 𝕜 E F (p x 1)) 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}
{x : E}
{n : ℕ∞}
{p : E → FormalMultilinearSeries 𝕜 E F}
(h : HasFTaylorSeriesUpToOn n f p s)
(hn : 1 ≤ n)
(hx : x ∈ s)

HasFDerivWithinAt f ((continuousMultilinearCurryFin1 𝕜 E F) (p x 1)) s x


theorem length_nontrivial {s : Cycle α} (h : Nontrivial s) : 2 ≤ length s

{α : Type u_1}
{s : Cycle α}
(h : s.Nontrivial)


@[simp] lemma bot_mul_bot : (⊥ * ⊥ : WithBot α) = ⊥

{α : Type u_1}
[DecidableEq α]
[MulZeroClass α]


lemma complete_distinguished_triangle_morphism
    (T₁ T₂ : Triangle (HomotopyCategory C (ComplexShape.up ℤ)))
    (hT₁ : T₁ ∈ distinguishedTriangles C) (hT₂ : T₂ ∈ distinguishedTriangles C)
    (a : T₁.obj₁ ⟶ T₂.obj₁) (b : T₁.obj₂ ⟶ T₂.obj₂) (fac : T₁.mor₁ ≫ b = a ≫ T₂.mor₁) :
    ∃ (c : T₁.obj₃ ⟶ T₂.obj₃), T₁.mor₂ ≫ c = b ≫ T₂.mor₂ ∧
      T₁.mor₃ ≫ a⟦(1 : ℤ)⟧' = c ≫ T₂.mor₃

(T₁ T₂ : CategoryTheory.Pretriangulated.Triangle (HomotopyCategory C (ComplexShape.up ℤ)))

(hT₁ : T₁ ∈ HomotopyCategory.Pretriangulated.distinguishedTriangles C)

(hT₂ : T₂ ∈ HomotopyCategory.Pretriangulated.distinguishedTriangles C)

∃ c,
  T₁.mor₂ ≫ c = b ≫ T₂.mor₂ ∧
    T₁.mor₃ ≫ (CategoryTheory.shiftFunctor (HomotopyCategory C (ComplexShape.up ℤ)) 1).map a = c ≫ T₂.mor₃


/-- A stronger version of `Finset.fold_ite`, but relies on
an explicit proof of idempotency on the seed element, rather
than relying on typeclass idempotency over the whole type. -/
theorem fold_ite' {g : α → β} (hb : op b b = b) (p : α → Prop) [DecidablePred p] :
    Finset.fold op b (fun i => ite (p i) (f i) (g i)) s =
      op (Finset.fold op b f (s.filter p)) (Finset.fold op b g (s.filter fun i => ¬p i))

{α : Type u_1}
{β : Type u_2}
{op : β → β → β}
[hc : Std.Commutative op]
[ha : Std.Associative op]
{f : α → β}
{b : β}
{s : Finset α}
{g : α → β}
(hb : op b b = b)
(p : α → Prop)
[DecidablePred p]

Finset.fold op b (fun i => if p i then f i else g i) s =
  op (Finset.fold op b f (Finset.filter p s)) (Finset.fold op b g (Finset.filter (fun i => ¬p i) s))


theorem xor_false : ∀ (x : Bool), xor x false = x


@[simp]
theorem toFunAlgHom_apply_tmul (a : A) (p : R[X]) :
    toFunAlgHom R A (a ⊗ₜ[R] p) = p.sum fun n r => monomial n (a * (algebraMap R A) r)

(R : Type u_1)
(A : Type u_2)
[CommSemiring R]
[Semiring A]
[Algebra R A]
(a : A)
(p : R[X])

(PolyEquivTensor.toFunAlgHom R A) (a ⊗ₜ[R] p) = p.sum fun n r => (Polynomial.monomial n) (a * (algebraMap R A) r)


theorem ext {x y : ReaderT ρ m α} (h : ∀ ctx, x.run ctx = y.run ctx) : x = y

(h : ∀ (ctx : ρ), x.run ctx = y.run ctx)


theorem range_liftQ [RingHomSurjective τ₁₂] (f : M →ₛₗ[τ₁₂] M₂) (h) :
    range (p.liftQ f h) = range f

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]
(p : Submodule R M)
{R₂ : Type u_3}
{M₂ : Type u_4}
[Ring R₂]
[AddCommGroup M₂]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
[RingHomSurjective τ₁₂]
(f : M →ₛₗ[τ₁₂] M₂)
(h : p ≤ LinearMap.ker f)

LinearMap.range (p.liftQ f h) = LinearMap.range f


@[simp]
theorem getLast_singleton' (a : α) : getLast [a] (cons_ne_nil a []) = a


theorem IsUpperSet.prod (hs : IsUpperSet s) (ht : IsUpperSet t) : IsUpperSet (s ×ˢ t)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{s : Set α}
{t : Set β}
(hs : IsUpperSet s)
(ht : IsUpperSet t)


/-- Consider a function `f : α × β → γ`. Suppose that it is continuous on each “vertical section”
`{a} × univ`, `a : α`, and is Lipschitz continuous on each “horizontal section”
`univ × {b}`, `b : β` with the same Lipschitz constant `K`. Then it is continuous.

The actual statement uses (Lipschitz) continuity of `fun y ↦ f (a, y)` and `fun x ↦ f (x, b)`
instead of continuity of `f` on subsets of the product space. -/
theorem continuous_prod_of_continuous_lipschitzWith [PseudoEMetricSpace α] [TopologicalSpace β]
    [PseudoEMetricSpace γ] (f : α × β → γ) (K : ℝ≥0) (ha : ∀ a, Continuous fun y => f (a, y))
    (hb : ∀ b, LipschitzWith K fun x => f (x, b)) : Continuous f

(f : α × β → γ)

(ha : ∀ (a : α), Continuous fun y => f (a, y))

(hb : ∀ (b : β), LipschitzWith K fun x => f (x, b))


theorem lt_geomSum_of_mem {a : ℕ} (hn : 2 ≤ n) (hi : a ∈ s) : a < ∑ i in s, n ^ i

{s : Finset ℕ}
{n a : ℕ}
(hn : 2 ≤ n)
(hi : a ∈ s)


theorem eq_min {a b c : α} (h₁ : c ≤ a) (h₂ : c ≤ b) (h₃ : ∀ {d}, d ≤ a → d ≤ b → d ≤ c) :
    c = min a b

{α : Type u}
[LinearOrder α]
{a b c : α}
(h₁ : c ≤ a)
(h₂ : c ≤ b)
(h₃ : ∀ {d : α}, d ≤ a → d ≤ b → d ≤ c)


@[to_additive]
theorem finprod_def (f : α → M) [Decidable (mulSupport f).Finite] :
    ∏ᶠ i : α, f i = if h : (mulSupport f).Finite then ∏ i ∈ h.toFinset, f i else 1

∏ᶠ (i : α), f i = if h : (Function.mulSupport f).Finite then ∏ i ∈ h.toFinset, f i else 1


@[simp]
theorem card_pmap {p : α → Prop} (f : ∀ a, p a → β) (s H) : card (pmap f s H) = card s

{α : Type u_1}
{β : Type v}
{p : α → Prop}
(f : (a : α) → p a → β)
(s : Multiset α)
(H : ∀ a ∈ s, p a)

Multiset.card (Multiset.pmap f s H) = Multiset.card s


theorem lt_trans (h₁ : cmp x y = .lt) (h₂ : cmp y z = .lt) : cmp x z = .lt

∀ {x : Sort u_1} {cmp : x → x → Ordering} [inst : Batteries.TransCmp cmp] {x_1 y z : x},
  cmp x_1 y = Ordering.lt → cmp y z = Ordering.lt → cmp x_1 z = Ordering.lt


lemma P2_neg_left : P2 x₁ x₂ y ↔ P2 (-x₂) (-x₁) y

Surreal.Multiplication.P2 x₁ x₂ y ↔ Surreal.Multiplication.P2 (-x₂) (-x₁) y


@[simp]
theorem integralPowerBasis_dim [hcycl : IsCyclotomicExtension {p ^ k} ℚ K]
    (hζ : IsPrimitiveRoot ζ ↑(p ^ k)) : hζ.integralPowerBasis.dim = φ (p ^ k)


@[simp]
theorem map_coe (hf : UniformContinuous f) (a : α) : map f (ι a) = ι' (f a)

{α : Type u_1}
[UniformSpace α]
(pkg : AbstractCompletion α)
{β : Type u_2}
[UniformSpace β]
(pkg' : AbstractCompletion β)
{f : α → β}
(hf : UniformContinuous f)
(a : α)

pkg.map pkg' f (pkg.coe a) = pkg'.coe (f a)


protected theorem Perm.congr_fun {f g : Equiv.Perm α} (h : f = g) (x : α) : f x = g x

{α : Sort u}
{f g : Equiv.Perm α}
(h : f = g)
(x : α)


@[simp]
theorem inversion_dist_center (c x : P) : inversion c (dist x c) x = x

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(c x : P)

EuclideanGeometry.inversion c (dist x c) x = x


@[simp high]
protected theorem symm_image_subset {α β} (e : α ≃ β) (s : Set α) (t : Set β) :
    e.symm '' t ⊆ s ↔ t ⊆ e '' s

{α : Type u_1}
{β : Type u_2}
(e : α ≃ β)
(s : Set α)
(t : Set β)


@[simp]
theorem realize_sup : (φ ⊔ ψ).Realize v ↔ φ.Realize v ∨ ψ.Realize v

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{α : Type u'}
{φ ψ : L.Formula α}
{v : α → M}


@[to_additive MeasureTheory.NullMeasurableSet.addFundamentalInterior]
protected theorem NullMeasurableSet.fundamentalInterior (hs : NullMeasurableSet s μ) :
    NullMeasurableSet (fundamentalInterior G s) μ

[MeasureTheory.SMulInvariantMeasure G α μ]

(hs : MeasureTheory.NullMeasurableSet s μ)

MeasureTheory.NullMeasurableSet (MeasureTheory.fundamentalInterior G s) μ


theorem neg_mem (x : K) : x ∈ A → -x ∈ A

{K : Type u}
[Field K]
(A : ValuationSubring K)
(x : K)


theorem mem_span_singleton {y : M} : (x ∈ R ∙ y) ↔ ∃ a : R, a • y = x

{R : Type u_1}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{x y : M}

x ∈ Submodule.span R {y} ↔ ∃ a, a • y = x


theorem id_whiskerLeft_symm {f g : a ⟶ b} (η : f ⟶ g) : η = (λ_ f).inv ≫ 𝟙 a ◁ η ≫ (λ_ g).hom

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

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


protected theorem gc : GaloisConnection (adjoin R : Set A → NonUnitalStarSubalgebra R A) (↑)

{R : Type u}
{A : Type v}
[CommSemiring R]
[StarRing R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]
[StarModule R A]

GaloisConnection (NonUnitalStarAlgebra.adjoin R) SetLike.coe


theorem hensels_lemma :
    ∃ z : ℤ_[p],
      F.eval z = 0 ∧
        ‖z - a‖ < ‖F.derivative.eval a‖ ∧
          ‖F.derivative.eval z‖ = ‖F.derivative.eval a‖ ∧
            ∀ z', F.eval z' = 0 → ‖z' - a‖ < ‖F.derivative.eval a‖ → z' = z

(hnorm : ‖Polynomial.eval a F‖ < ‖Polynomial.eval a (Polynomial.derivative F)‖ ^ 2)

∃ z,
  Polynomial.eval z F = 0 ∧
    ‖z - a‖ < ‖Polynomial.eval a (Polynomial.derivative F)‖ ∧
      ‖Polynomial.eval z (Polynomial.derivative F)‖ = ‖Polynomial.eval a (Polynomial.derivative F)‖ ∧
        ∀ (z' : ℤ_[p]), Polynomial.eval z' F = 0 → ‖z' - a‖ < ‖Polynomial.eval a (Polynomial.derivative F)‖ → z' = z


theorem fieldRange_eq_map : f.fieldRange = Subfield.map f ⊤

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


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


@[to_additive]
theorem comap_ker (g : N →* P) (f : G →* N) : g.ker.comap f = (g.comp f).ker

{G : Type u_1}
[Group G]
{N : Type u_5}
{P : Type u_6}
[Group N]
[Group P]
(g : N →* P)
(f : G →* N)


@[simp] lemma IntermediateField.fixingSubgroup_bot (K L : Type*) [Field K] [Field L] [Algebra K L] :
    IntermediateField.fixingSubgroup (⊥ : IntermediateField K L) = ⊤

(K : Type u_1)
(L : Type u_2)
[Field K]
[Field L]
[Algebra K L]


theorem eq_preimage_subtype_val_iff {p : α → Prop} {s : Set (Subtype p)} {t : Set α} :
    s = Subtype.val ⁻¹' t ↔ ∀ (x) (h : p x), (⟨x, h⟩ : Subtype p) ∈ s ↔ x ∈ t

{α : Type u_1}
{p : α → Prop}
{s : Set (Subtype p)}
{t : Set α}

s = Subtype.val ⁻¹' t ↔ ∀ (x : α) (h : p x), ⟨x, h⟩ ∈ s ↔ x ∈ t


theorem prod_factorial_pos : 0 < ∏ i ∈ s, (f i)!

{α : Type u_1}
(s : Finset α)
(f : α → ℕ)


theorem IsDetecting.isSeparating [HasEqualizers C] {𝒢 : Set C} (h𝒢 : IsDetecting 𝒢) :
    IsSeparating 𝒢

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.Limits.HasEqualizers C]
{𝒢 : Set C}
(h𝒢 : CategoryTheory.IsDetecting 𝒢)


@[simp]
theorem coe_orderMonoidWithZeroHom_id :
    (OrderRingHom.id α : α →*₀o α) = OrderMonoidWithZeroHom.id α

{α : Type u_2}
[NonAssocSemiring α]
[Preorder α]

↑(OrderRingHom.id α) = OrderMonoidWithZeroHom.id α


@[simp] lemma image_add_left_Icc (a b c : α) : (Icc a b).image (c + ·) = Icc (c + a) (c + b)

{α : Type u_2}
[OrderedCancelAddCommMonoid α]
[ExistsAddOfLE α]
[LocallyFiniteOrder α]
[DecidableEq α]
(a b c : α)

Finset.image (fun x => c + x) (Finset.Icc a b) = Finset.Icc (c + a) (c + b)


theorem exists_mem_insert [DecidableEq α] (a : α) (s : Finset α) (p : α → Prop) :
    (∃ x, x ∈ insert a s ∧ p x) ↔ p a ∨ ∃ x, x ∈ s ∧ p x

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

(∃ x ∈ insert a s, p x) ↔ p a ∨ ∃ x ∈ s, p x


@[to_additive (attr := simp)]
theorem centralizer_eq_top_iff_subset {s : Set G} : centralizer s = ⊤ ↔ s ⊆ center G

Subgroup.centralizer s = ⊤ ↔ s ⊆ ↑(Subgroup.center G)


/-- `forget₂ (QuadraticModuleCat R) (ModuleCat R)` as a braided functor. -/
@[simps toMonoidalFunctor]
def toModuleCatBraidedFunctor : BraidedFunctor (QuadraticModuleCat.{u} R) (ModuleCat.{u} R)

(R : Type u)
[CommRing R]
[Invertible 2]

(QuadraticModuleCat.toModuleCatBraidedFunctor R).toMonoidalFunctor = QuadraticModuleCat.toModuleCatMonoidalFunctor R


/-- Construct a natural isomorphism between `parallelPair f g` and `parallelPair f' g'` given
equalities `f = f'` and `g = g'`. -/
@[simps!]
def parallelPair.eqOfHomEq {f g f' g' : X ⟶ Y} (hf : f = f') (hg : g = g') :
    parallelPair f g ≅ parallelPair f' g'

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

∀ (X_1 : CategoryTheory.Limits.WalkingParallelPair),
  (CategoryTheory.Limits.parallelPair.eqOfHomEq hf hg).hom.app X_1 =
    (CategoryTheory.Limits.WalkingParallelPair.rec (CategoryTheory.Iso.refl X) (CategoryTheory.Iso.refl Y) X_1).hom


@[simp]
theorem nnnorm_equiv_symm_single [hp : Fact (1 ≤ p)] (i : ι) (b : β i) :
    ‖(WithLp.equiv p (∀ i, β i)).symm (Pi.single i b)‖₊ = ‖b‖₊

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

‖(WithLp.equiv p ((i : ι) → β i)).symm (Pi.single i b)‖₊ = ‖b‖₊


@[simp]
theorem disjoint_compl_compl_left_iff : Disjoint aᶜᶜ b ↔ Disjoint a b

{α : Type u_2}
[HeytingAlgebra α]
{a b : α}


theorem HasFDerivWithinAt.of_not_mem_tsupport {s : Set E} {x : E} (h : x ∉ tsupport f) :
    HasFDerivWithinAt f (0 : E →L[𝕜] F) s x

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


@[simp]
theorem inftyValuation.X : inftyValuationDef Fq RatFunc.X = Multiplicative.ofAdd (1 : ℤ)

(Fq : Type)
[Field Fq]
[DecidableEq (RatFunc Fq)]

FunctionField.inftyValuationDef Fq RatFunc.X = ↑(Multiplicative.ofAdd 1)


@[to_additive (attr := simp)]
theorem mk_zpow (a : G) (n : ℤ) : ((a ^ n : G) : Q) = (a : Q) ^ n

{G : Type u}
[Group G]
(N : Subgroup G)
[nN : N.Normal]
(a : G)
(n : ℤ)


/-- The forgetful functor from the category of comonads to the category of endofunctors.
-/
@[simps!]
def comonadToFunctor : Comonad C ⥤ C ⥤ C

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

(CategoryTheory.comonadToFunctor C).obj G = G.toFunctor


lemma map_map {B : Type w} [CommRing B] (ψ : A →+* B) : (W.map φ).map ψ = W.map (ψ.comp φ)

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
{A : Type v}
[CommRing A]
(φ : R →+* A)
{B : Type w}
[CommRing B]
(ψ : A →+* B)


@[simp]
theorem pred_eq {n} : PredOrder.pred = fun a : Fin (n + 1) => if a = 0 then 0 else a - 1

PredOrder.pred = fun a => if a = 0 then 0 else a - 1


/-- Stronger version of `PSigma.lex_wf`. Instead of requiring `rπ on g` to be well-founded, we only
require it to be well-founded on fibers of `f`. -/
theorem WellFounded.sigma_lex_of_wellFoundedOn_fiber (hι : WellFounded (rι on f))
    (hπ : ∀ i, (f ⁻¹' {i}).WellFoundedOn (rπ i on g i)) :
    WellFounded (Sigma.Lex rι rπ on fun c => ⟨f c, g (f c) c⟩)

(hπ : ∀ (i : ι), (f ⁻¹' {i}).WellFoundedOn (rπ i on g i))


@[to_additive]
theorem mono {f' : α → γ} (hf : HasCompactMulSupport f)
    (hff' : mulSupport f' ⊆ mulSupport f) : HasCompactMulSupport f'

(hff' : Function.mulSupport f' ⊆ Function.mulSupport f)


theorem posMulStrictMono_iff_mulPosStrictMono : PosMulStrictMono α ↔ MulPosStrictMono α

{α : Type u_1}
[Mul α]
[IsSymmOp α α fun x x_1 => x * x_1]
[Zero α]
[Preorder α]


/-- `p → q → r ↔ q → p → r` -/
theorem himp_left_comm (a b c : α) : a ⇨ b ⇨ c = b ⇨ a ⇨ c

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


@[simp] lemma not_comp_le_lift : ¬ comp a ≤ lift b

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

¬Booleanisation.comp a ≤ Booleanisation.lift b


@[simp]
theorem HomogeneousIdeal.toIdeal_irrelevant :
    (HomogeneousIdeal.irrelevant 𝒜).toIdeal = RingHom.ker (GradedRing.projZeroRingHom 𝒜)

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


@[simp]
theorem supPrime_ofDual {a : αᵒᵈ} : SupPrime (ofDual a) ↔ InfPrime a

{α : Type u_2}
[SemilatticeSup α]
{a : αᵒᵈ}

SupPrime (OrderDual.ofDual a) ↔ InfPrime a


@[to_additive (attr := simp)]
theorem mem_bot {x : G} : x ∈ (⊥ : Subgroup G) ↔ x = 1


theorem sum_map_count_dedup_eq_length (l : List α) :
    (l.dedup.map fun x => l.count x).sum = l.length

{α : Type u_2}
[DecidableEq α]
(l : List α)

(List.map (fun x => List.count x l) l.dedup).sum = l.length


@[simp]
theorem of_x (n : α) : (of X d sq).X n = X n


lemma isRegular_iff_coeff_polyCharpoly_rank_ne_zero :
    IsRegular R M x ↔
    MvPolynomial.eval (b.repr x)
      ((polyCharpoly φ b).coeff (rank R L M)) ≠ 0

(R : Type u_1)
{L : Type u_3}
(M : Type u_4)
{ι : Type u_5}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[Module.Finite R L]
[Module.Free R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[Module.Finite R M]
[Module.Free R M]
[Fintype ι]
[DecidableEq ι]
(b : Basis ι R L)
(x : L)

LieModule.IsRegular R M x ↔
  (MvPolynomial.eval ⇑(b.repr x)) (((↑(LieModule.toEnd R L M)).polyCharpoly b).coeff (LieModule.rank R L M)) ≠ 0


@[simp] theorem append_subset {l₁ l₂ l : List α} :
    l₁ ++ l₂ ⊆ l ↔ l₁ ⊆ l ∧ l₂ ⊆ l

l₁ ++ l₂ ⊆ l ↔ l₁ ⊆ l ∧ l₂ ⊆ l


/-- Two measures which are finite on closed-open intervals are equal if they agree on all
closed-open intervals. -/
theorem ext_of_Ico {α : Type*} [TopologicalSpace α] {_m : MeasurableSpace α}
    [SecondCountableTopology α] [ConditionallyCompleteLinearOrder α] [OrderTopology α]
    [BorelSpace α] [NoMaxOrder α] (μ ν : Measure α) [IsLocallyFiniteMeasure μ]
    (h : ∀ ⦃a b⦄, a < b → μ (Ico a b) = ν (Ico a b)) : μ = ν

(h : ∀ ⦃a b : α⦄, a < b → μ (Set.Ico a b) = ν (Set.Ico a b))


/-- The cartesian product of two functors. -/
@[simps]
def prod (F : A ⥤ B) (G : C ⥤ D) : A × C ⥤ B × D

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

∀ {X Y : A × C} (f : X ⟶ Y), (F.prod G).map f = (F.map f.1, G.map f.2)


theorem Int.ofNat_ceil_eq_ceil (ha : 0 ≤ a) : (⌈a⌉₊ : ℤ) = ⌈a⌉

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
{a : α}
(ha : 0 ≤ a)


@[simp]
theorem diagonal_mul [Fintype m] [DecidableEq m] (d : m → α) (M : Matrix m n α) (i j) :
    (diagonal d * M) i j = d i * M i j

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[NonUnitalNonAssocSemiring α]
[Fintype m]
[DecidableEq m]
(d : m → α)
(M : Matrix m n α)
(i : m)
(j : n)

(Matrix.diagonal d * M) i j = d i * M i j


/-- The Hausdorff distance is controlled by the diameter of the union. -/
theorem hausdorffDist_le_diam (hs : s.Nonempty) (bs : IsBounded s) (ht : t.Nonempty)
    (bt : IsBounded t) : hausdorffDist s t ≤ diam (s ∪ t)

{α : Type u}
[PseudoMetricSpace α]
{s t : Set α}
(hs : s.Nonempty)
(bs : Bornology.IsBounded s)
(ht : t.Nonempty)
(bt : Bornology.IsBounded t)

Metric.hausdorffDist s t ≤ Metric.diam (s ∪ t)


@[simp]
theorem image_const_sub_Iio : (fun x => a - x) '' Iio b = Ioi (a - b)

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

(fun x => a - x) '' Set.Iio b = Set.Ioi (a - b)


@[simp]
theorem integral_smul_const (f : ℂ → ℂ) (a : E) (c : ℂ) (R : ℝ) :
    (∮ z in C(c, R), f z • a) = (∮ z in C(c, R), f z) • a

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

(∮ (z : ℂ) in C(c, R), f z • a) = (∮ (z : ℂ) in C(c, R), f z) • a


/-- In a product space `α × β`, assume that a function `f` is continuous on `s × k` where `k` is
compact. Then, along the fiber above any `q ∈ s`, `f` is transversely uniformly continuous, i.e.,
if `p ∈ s` is close enough to `q`, then `f p x` is uniformly close to `f q x` for all `x ∈ k`. -/
lemma IsCompact.mem_uniformity_of_prod
    {α β E : Type*} [TopologicalSpace α] [TopologicalSpace β] [UniformSpace E]
    {f : α → β → E} {s : Set α} {k : Set β} {q : α} {u : Set (E × E)}
    (hk : IsCompact k) (hf : ContinuousOn f.uncurry (s ×ˢ k)) (hq : q ∈ s) (hu : u ∈ 𝓤 E) :
    ∃ v ∈ 𝓝[s] q, ∀ p ∈ v, ∀ x ∈ k, (f p x, f q x) ∈ u

(hf : ContinuousOn (Function.uncurry f) (s ×ˢ k))


@[to_additive]
theorem mul_subset {S : Submonoid M} (hs : s ⊆ S) (ht : t ⊆ S) : s * t ⊆ S

{M : Type u_3}
[AddMonoid M]
{s t : Set M}
{S : AddSubmonoid M}
(hs : s ⊆ ↑S)
(ht : t ⊆ ↑S)


/-- Negating the first vector passed to `oangle` does not change twice the angle. -/
@[simp]
theorem two_zsmul_oangle_neg_left (x y : V) :
    (2 : ℤ) • o.oangle (-x) y = (2 : ℤ) • o.oangle x y

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


theorem inversion_mul (c : P) (a R : ℝ) (x : P) :
    inversion c (a * R) x = homothety c (a ^ 2) (inversion c R x)

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(c : P)
(a R : ℝ)
(x : P)

EuclideanGeometry.inversion c (a * R) x = (AffineMap.homothety c (a ^ 2)) (EuclideanGeometry.inversion c R x)


/-- Auxiliary typeclass for types with an involutive `Neg`. -/
class InvolutiveNeg (A : Type*) extends Neg A where
  protected neg_neg : ∀ x : A, - -x = x

{A : Type u_2}
[self : InvolutiveNeg A]
(x : A)


theorem Ioo_mem_nhdsWithin_Iio (H : b ∈ Ioc a c) : Ioo a c ∈ 𝓝[<] b

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIicTopology α]
{a b c : α}
(H : b ∈ Set.Ioc a c)


/-- A congruence relation on a type with an addition is an equivalence relation which
    preserves addition. -/
structure AddCon [Add M] extends Setoid M where
  /-- Additive congruence relations are closed under addition -/
  add' : ∀ {w x y z}, r w x → r y z → r (w + y) (x + z)

{M : Type u_1}
[Add M]
(self : AddCon M)
{w x y z : M}

Setoid.r w x → Setoid.r y z → Setoid.r (w + y) (x + z)


theorem image_subtype_val_Ioi_subset (a : {x // p x}) :
    Subtype.val '' Ioi a ⊆ Ioi a.val

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


/-- If two functions are integrable on a measurable set, and one function is less than
    or equal to the other on that set, then the volume of the region
    between the two functions can be represented as an integral. -/
theorem volume_regionBetween_eq_integral [SigmaFinite μ] (f_int : IntegrableOn f s μ)
    (g_int : IntegrableOn g s μ) (hs : MeasurableSet s) (hfg : ∀ x ∈ s, f x ≤ g x) :
    μ.prod volume (regionBetween f g s) = ENNReal.ofReal (∫ y in s, (g - f) y ∂μ)

(f_int : MeasureTheory.IntegrableOn f s μ)

(g_int : MeasureTheory.IntegrableOn g s μ)

(μ.prod MeasureTheory.volume) (regionBetween f g s) = ENNReal.ofReal (∫ (y : α) in s, (g - f) y ∂μ)


theorem OpenCover.iUnion_range {X : Scheme.{u}} (𝒰 : X.OpenCover) :
    ⋃ i, Set.range (𝒰.map i).1.base = Set.univ

{X : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)

⋃ i, Set.range ⇑(𝒰.map i).val.base = Set.univ


theorem one_sub_K_ne_top : (1 : ℝ≥0∞) - K ≠ ∞


protected theorem openEmbedding (h : X ≃ₜ Y) : OpenEmbedding h

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(h : X ≃ₜ Y)


theorem coe_smul {R} (r : R) (s : ℝ≥0) [SMul R ℝ≥0] [SMul R ℝ≥0∞] [IsScalarTower R ℝ≥0 ℝ≥0]
    [IsScalarTower R ℝ≥0 ℝ≥0∞] : (↑(r • s) : ℝ≥0∞) = (r : R) • (s : ℝ≥0∞)

{R : Type u_1}
(r : R)
(s : ℝ≥0)
[SMul R ℝ≥0]
[SMul R ℝ≥0∞]
[IsScalarTower R ℝ≥0 ℝ≥0]
[IsScalarTower R ℝ≥0 ℝ≥0∞]


theorem liftRel_dropn_destruct {R : α → β → Prop} {s t} (H : LiftRel R s t) :
    ∀ n, Computation.LiftRel (LiftRelO R (LiftRel R)) (destruct (drop s n)) (destruct (drop t n))

{α : Type u}
{β : Type v}
{R : α → β → Prop}
{s : Stream'.WSeq α}
{t : Stream'.WSeq β}
(H : Stream'.WSeq.LiftRel R s t)
(n : ℕ)

Computation.LiftRel (Stream'.WSeq.LiftRelO R (Stream'.WSeq.LiftRel R)) (s.drop n).destruct (t.drop n).destruct


lemma summable_norm_eisSummand {k : ℤ} (hk : 3 ≤ k) (z : ℍ) :
    Summable fun (x : Fin 2 → ℤ) ↦ ‖(eisSummand k x z)‖

Summable fun x => ‖EisensteinSeries.eisSummand k x z‖


theorem iterateFrobeniusEquiv_symm :
    (iterateFrobeniusEquiv R p n).symm = (frobeniusEquiv R p).symm ^ n

(R : Type u_1)
(p n : ℕ)
[CommSemiring R]
[ExpChar R p]
[PerfectRing R p]


theorem lowerSemicontinuous_iff_isClosed_preimage {f : α → γ} :
    LowerSemicontinuous f ↔ ∀ y, IsClosed (f ⁻¹' Iic y)

{α : Type u_1}
[TopologicalSpace α]
{γ : Type u_3}
[LinearOrder γ]
{f : α → γ}

LowerSemicontinuous f ↔ ∀ (y : γ), IsClosed (f ⁻¹' Set.Iic y)


@[to_additive exists_idempotent_ultrafilter_le_FS]
theorem exists_idempotent_ultrafilter_le_FP {M} [Semigroup M] (a : Stream' M) :
    ∃ U : Ultrafilter M, U * U = U ∧ ∀ᶠ m in U, m ∈ FP a

{M : Type u_1}
[Semigroup M]
(a : Stream' M)

∃ U, U * U = U ∧ ∀ᶠ (m : M) in ↑U, m ∈ Hindman.FP a


lemma ext₃ [ClosedUnderIsomorphisms S.P] (h₁ : S.P T.obj₁) (h₂ : S.P T.obj₂) :
    S.P T.obj₃

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

(S : CategoryTheory.Triangulated.Subcategory C)

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)


theorem step_supports (M : Λ → Stmt₂) {S : Finset Λ} (ss : Supports M S) :
    ∀ {c c' : Cfg₂}, c' ∈ step M c → c.l ∈ Finset.insertNone S → c'.l ∈ Finset.insertNone S

{K : Type u_1}
[DecidableEq K]
{Γ : K → Type u_2}
{Λ : Type u_3}
{σ : Type u_4}
[Inhabited Λ]
(M : Λ → Turing.TM2.Stmt Γ Λ σ)
{S : Finset Λ}
(ss : Turing.TM2.Supports M S)
{c c' : Turing.TM2.Cfg Γ Λ σ}

c' ∈ Turing.TM2.step M c → c.l ∈ Finset.insertNone S → c'.l ∈ Finset.insertNone S


theorem find_le {h : ∃ n, p n} (hn : p n) : PNat.find h ≤ n

{p : ℕ+ → Prop}
[DecidablePred p]
{n : ℕ+}
{h : ∃ n, p n}
(hn : p n)


@[simp] lemma toENat_eq_one {a : Cardinal} : toENat a = 1 ↔ a = 1


/-- If `K` is a `n`-th cyclotomic extension of `ℚ`, where `2 < n`, then there are no real places
of `K`. -/
theorem nrRealPlaces_eq_zero [IsCyclotomicExtension {n} ℚ K]
    (hn : 2 < n) :
    haveI := IsCyclotomicExtension.numberField {n} ℚ K
    NrRealPlaces K = 0

{n : ℕ+}
(K : Type u)
[Field K]
[CharZero K]
[IsCyclotomicExtension {n} ℚ K]
(hn : 2 < n)

NumberField.InfinitePlace.NrRealPlaces K = 0


theorem coe_intCast (z : ℤ) : (z : A 0) = (z : R)

{ι : Type u_1}
{σ : Type u_2}
{R : Type u_4}
[Ring R]
[AddMonoid ι]
[SetLike σ R]
[AddSubgroupClass σ R]
(A : ι → σ)
[SetLike.GradedMonoid A]
(z : ℤ)


theorem iInf_uniformity {ι : Sort*} {u : ι → UniformSpace α} : 𝓤[iInf u] = ⨅ i, 𝓤[u i]

{α : Type ua}
{ι : Sort u_2}
{u : ι → UniformSpace α}

𝓤 α = ⨅ i, 𝓤 α


/-- The inclusion of the subterminal objects into the original category. -/
@[simps!]
def subterminalInclusion : Subterminals C ⥤ C

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

∀ {X Y : CategoryTheory.InducedCategory C CategoryTheory.FullSubcategory.obj} (f : X ⟶ Y),
  (CategoryTheory.subterminalInclusion C).map f = f


theorem condIndep_biSup_compl [StandardBorelSpace Ω] [Nonempty Ω]
    (hm : m ≤ m0) [IsFiniteMeasure μ]
    (h_le : ∀ n, s n ≤ m0) (h_indep : iCondIndep m hm s μ) (t : Set ι) :
    CondIndep m (⨆ n ∈ t, s n) (⨆ n ∈ tᶜ, s n) hm μ

(h_indep : ProbabilityTheory.iCondIndep m hm s μ)

ProbabilityTheory.CondIndep m (⨆ n ∈ t, s n) (⨆ n ∈ tᶜ, s n) hm μ


/-- If a non-zero polynomial over `F` splits in `K`, then it has no repeated roots on `K`
if and only if it is separable. -/
theorem nodup_aroots_iff_of_splits [Algebra F K] {f : F[X]} (hf : f ≠ 0)
    (h : f.Splits (algebraMap F K)) : (f.aroots K).Nodup ↔ f.Separable

(h : Polynomial.Splits (algebraMap F K) f)


@[simp]
theorem degrees_zero : degrees (0 : MvPolynomial σ R) = 0

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


theorem Icc_subset_Icc_iff (h₁ : a₁ ≤ b₁) : Icc a₁ b₁ ⊆ Icc a₂ b₂ ↔ a₂ ≤ a₁ ∧ b₁ ≤ b₂

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

Finset.Icc a₁ b₁ ⊆ Finset.Icc a₂ b₂ ↔ a₂ ≤ a₁ ∧ b₁ ≤ b₂


theorem isNat_lt_true [OrderedSemiring α] [CharZero α] : {a b : α} → {a' b' : ℕ} →
    IsNat a a' → IsNat b b' → Nat.ble b' a' = false → a < b

{α : Type u_1}
[OrderedSemiring α]
[CharZero α]
{a b : α}
{a' b' : ℕ}

Mathlib.Meta.NormNum.IsNat a a' → Mathlib.Meta.NormNum.IsNat b b' → b'.ble a' = false → a < b


@[simp]
theorem normSq_mk (x y : ℝ) : normSq ⟨x, y⟩ = x * x + y * y

Complex.normSq { re := x, im := y } = x * x + y * y


theorem gcd_dvd {b : β} (hb : b ∈ s) : s.gcd f ∣ f b

{α : Type u_2}
{β : Type u_3}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{s : Finset β}
{f : β → α}
{b : β}
(hb : b ∈ s)


theorem coe_lt_natCast {n : ℕ} : (r : ℝ≥0∞) < n ↔ r < n


theorem vecMul_transpose [Fintype n] (A : Matrix m n α) (x : n → α) : x ᵥ* Aᵀ = A *ᵥ x

{m : Type u_2}
{n : Type u_3}
{α : Type v}
[NonUnitalCommSemiring α]
[Fintype n]
(A : Matrix m n α)
(x : n → α)


theorem derivBFamily_lt_ord_lift {o : Ordinal} {f : ∀ a < o, Ordinal → Ordinal} {c}
    (hc : IsRegular c) (hι : Cardinal.lift.{v, u} o.card < c) (hc' : c ≠ ℵ₀)
    (hf : ∀ (i hi), ∀ b < c.ord, f i hi b < c.ord) {a} :
    a < c.ord → derivBFamily.{u, v} o f a < c.ord

{f : (a : Ordinal.{u}) → a < o → Ordinal.{max u v} → Ordinal.{max u v}}

(hf : ∀ (i : Ordinal.{u}) (hi : i < o), ∀ b < c.ord, f i hi b < c.ord)


protected theorem map_prod (m : α × β → γ) (f : Filter α) (g : Filter β) :
    map m (f ×ˢ g) = (f.map fun a b => m (a, b)).seq g

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(m : α × β → γ)
(f : Filter α)
(g : Filter β)

Filter.map m (f ×ˢ g) = (Filter.map (fun a b => m (a, b)) f).seq g


lemma InfClosed.finsetInf'_mem (hs : InfClosed s) (ht : t.Nonempty) :
    (∀ i ∈ t, f i ∈ s) → t.inf' ht f ∈ s

{α : Type u_2}
[SemilatticeInf α]
{ι : Type u_4}
{f : ι → α}
{s : Set α}
{t : Finset ι}
(hs : InfClosed s)
(ht : t.Nonempty)


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

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


@[to_additive (attr := simp)]
theorem preimage_mul_left_singleton :
    preimage {b} (a * ·) (mul_right_injective _).injOn = {a⁻¹ * b}

{b}.preimage (fun x => a * x) ⋯ = {a⁻¹ * b}


@[to_additive] lemma card_le_card_div_left (hs : s.Nonempty) : t.card ≤ (s / t).card

{α : Type u_2}
[AddGroup α]
[DecidableEq α]
{s t : Finset α}
(hs : s.Nonempty)


@[simp]
theorem cancel_right {g₁ g₂ : SpectralMap β γ} {f : SpectralMap α β} (hf : Surjective f) :
    g₁.comp f = g₂.comp f ↔ g₁ = g₂

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[TopologicalSpace α]
[TopologicalSpace β]
[TopologicalSpace γ]
{g₁ g₂ : SpectralMap β γ}
{f : SpectralMap α β}
(hf : Function.Surjective ⇑f)


theorem lintegral_mono ⦃f g : α → ℝ≥0∞⦄ (hfg : f ≤ g) : ∫⁻ a, f a ∂μ ≤ ∫⁻ a, g a ∂μ

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
⦃f g : α → ℝ≥0∞⦄
(hfg : f ≤ g)


theorem ofVectorSpace_apply_self (x : ofVectorSpaceIndex K V) : ofVectorSpace K V x = x

(K : Type u_3)
(V : Type u_4)
[DivisionRing K]
[AddCommGroup V]
[Module K V]
(x : ↑(Basis.ofVectorSpaceIndex K V))


@[simp]
lemma shiftFunctorZero_eq :
    CategoryTheory.shiftFunctorZero (Triangle C) ℤ = Triangle.shiftFunctorZero C

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

CategoryTheory.shiftFunctorZero (CategoryTheory.Pretriangulated.Triangle C) ℤ =
  CategoryTheory.Pretriangulated.Triangle.shiftFunctorZero C


theorem tendsto_algebraMap_inverse_atTop_nhds_zero_nat (𝕜 : Type*) [Semiring 𝕜] [Algebra ℝ 𝕜]
    [TopologicalSpace 𝕜] [ContinuousSMul ℝ 𝕜] :
    Tendsto (algebraMap ℝ 𝕜 ∘ fun n : ℕ ↦ (n : ℝ)⁻¹) atTop (𝓝 0)

(𝕜 : Type u_4)
[Semiring 𝕜]
[Algebra ℝ 𝕜]
[TopologicalSpace 𝕜]
[ContinuousSMul ℝ 𝕜]

Filter.Tendsto (⇑(algebraMap ℝ 𝕜) ∘ fun n => (↑n)⁻¹) Filter.atTop (𝓝 0)


theorem Continuous.coinduced_le (h : Continuous[t, t'] f) : t.coinduced f ≤ t'

{α : Type u_1}
{β : Type u_2}
{t : TopologicalSpace α}
{t' : TopologicalSpace β}
{f : α → β}
(h : Continuous f)


lemma isRegular_iff_natTrailingDegree_charpoly_eq_rank :
    IsRegular R x ↔ (ad R L x).charpoly.natTrailingDegree = rank R L

(R : Type u_1)
{L : Type u_3}
[CommRing R]
[Nontrivial R]
[LieRing L]
[LieAlgebra R L]
[Module.Finite R L]
[Module.Free R L]
(x : L)

LieAlgebra.IsRegular R x ↔ (LinearMap.charpoly ((LieAlgebra.ad R L) x)).natTrailingDegree = LieAlgebra.rank R L


theorem init_iff [IsTrans β s] (f : r ≺i s) {a : α} {b : β} : s b (f a) ↔ ∃ a', f a' = b ∧ r a' a

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
[IsTrans β s]
(f : r ≺i s)
{a : α}
{b : β}

s b (f.toRelEmbedding a) ↔ ∃ a', f.toRelEmbedding a' = b ∧ r a' a


theorem ofNat_iff {α β} [Denumerable α] [Primcodable β] {f : α → β} :
    Primrec f ↔ Primrec fun n => f (ofNat α n)

{α : Type u_4}
{β : Type u_5}
[Denumerable α]
[Primcodable β]
{f : α → β}

Primrec f ↔ Primrec fun n => f (Denumerable.ofNat α n)


/-- Applying an affine map to an affine combination of two points yields an affine combination of
the images. -/
theorem Convex.combo_affine_apply {x y : E} {a b : 𝕜} {f : E →ᵃ[𝕜] F} (h : a + b = 1) :
    f (a • x + b • y) = a • f x + b • f y

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[Ring 𝕜]
[AddCommGroup E]
[AddCommGroup F]
[Module 𝕜 E]
[Module 𝕜 F]
{x y : E}
{a b : 𝕜}
{f : E →ᵃ[𝕜] F}
(h : a + b = 1)


@[simp, norm_cast]
lemma ofENat_add (m n : ℕ∞) : ofENat (m + n) = m + n


@[to_additive (attr := simp, norm_cast) natCast_zsmul]
theorem zpow_natCast (a : G) : ∀ n : ℕ, a ^ (n : ℤ) = a ^ n

{G : Type u_1}
[SubNegMonoid G]
(a : G)
(n : ℕ)


/-- If `{ n_i }` is an `R`-basis of `N`, which is also `M`-linearly independent
(in this result it is stated as `Submodule.mulRightMap` is injective),
then `M` and `N` are linearly disjoint. -/
theorem of_basis_right' {ι : Type*} (n : Basis ι R N)
    (H : Function.Injective (mulRightMap M n)) : M.LinearDisjoint N

(H : Function.Injective ⇑(M.mulRightMap ⇑n))


theorem sInter_union (S T : Set (Set α)) : ⋂₀ (S ∪ T) = ⋂₀ S ∩ ⋂₀ T

⋂₀ (S ∪ T) = ⋂₀ S ∩ ⋂₀ T


theorem opCoproductIsoProduct'_comp_self {c c' : Cofan Z} {f : Fan (op <| Z ·)}
    (hc : IsColimit c) (hc' : IsColimit c') (hf : IsLimit f) :
    (opCoproductIsoProduct' hc hf).hom ≫ (opCoproductIsoProduct' hc' hf).inv =
    (hc.coconePointUniqueUpToIso hc').op.inv

{f : CategoryTheory.Limits.Fan fun x => Opposite.op (Z x)}

(hc : CategoryTheory.Limits.IsColimit c)

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

(CategoryTheory.Limits.opCoproductIsoProduct' hc hf).hom ≫ (CategoryTheory.Limits.opCoproductIsoProduct' hc' hf).inv =
  (hc.coconePointUniqueUpToIso hc').op.inv


@[simp]
theorem zero_shiftLeft : ∀ n : ℤ, 0 <<< n = 0


@[simp]
lemma _root_.ConvexCone.mem_toPointedCone {S : ConvexCone 𝕜 E} (hS : S.Pointed) (x : E) :
    x ∈ S.toPointedCone hS ↔ x ∈ S

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
{S : ConvexCone 𝕜 E}
(hS : S.Pointed)
(x : E)


protected theorem pos_of_lt_add_right (h : n < n + k) : 0 < k


/-- Let `L` be a Lie algebra of dimension `n` over a field `K` with at least `n` elements.
Given a Lie subalgebra `U` of `L`, and an element `x ∈ U` such that `U ≤ engel K x`.
Suppose that `engel K x` is minimal amongst the Engel subalgebras `engel K y` for `y ∈ U`.
Then `engel K x ≤ engel K y` for all `y ∈ U`.

Lemma 2 in [barnes1967]. -/
lemma engel_isBot_of_isMin (hLK : finrank K L ≤ #K) (U : LieSubalgebra K L)
    (E : {engel K x | x ∈ U}) (hUle : U ≤ E) (hmin : IsMin E) :
    IsBot E

(hLK : ↑(FiniteDimensional.finrank K L) ≤ Cardinal.mk K)

(E : ↑{x | ∃ x_1 ∈ U, LieSubalgebra.engel K x_1 = x})


lemma NNReal.closedBall_zero_eq_Icc {c : ℝ} (c_nn : 0 ≤ c) :
    Metric.closedBall (0 : ℝ≥0) c = Set.Icc 0 c.toNNReal

Metric.closedBall 0 c = Set.Icc 0 c.toNNReal


theorem lineMap_apply_module (p₀ p₁ : V1) (c : k) : lineMap p₀ p₁ c = (1 - c) • p₀ + c • p₁

{k : Type u_1}
{V1 : Type u_2}
[Ring k]
[AddCommGroup V1]
[Module k V1]
(p₀ p₁ : V1)
(c : k)

(AffineMap.lineMap p₀ p₁) c = (1 - c) • p₀ + c • p₁


/-- The cardinality of the set of `k`-rough numbers `≤ N` is bounded by `N` times the sum
of `1/p` over the primes `k ≤ p ≤ N`. -/
-- This needs `Mathlib.Analysis.RCLike.Basic`, so we put it here
-- instead of in `Mathlib.NumberTheory.SmoothNumbers`.
lemma Nat.roughNumbersUpTo_card_le' (N k : ℕ) :
    (roughNumbersUpTo N k).card ≤
      N * (N.succ.primesBelow \ k.primesBelow).sum (fun p ↦ (1 : ℝ) / p)

↑(N.roughNumbersUpTo k).card ≤ ↑N * ∑ p ∈ N.succ.primesBelow \ k.primesBelow, 1 / ↑p


theorem toAddMonoid.unique (f : ⨁ i, β i) : ψ f = toAddMonoid (fun i => ψ.comp (of β i)) f

{ι : Type v}
{β : ι → Type w}
[(i : ι) → AddCommMonoid (β i)]
[DecidableEq ι]
{γ : Type u₁}
[AddCommMonoid γ]
(ψ : (DirectSum ι fun i => β i) →+ γ)
(f : DirectSum ι fun i => β i)

ψ f = (DirectSum.toAddMonoid fun i => ψ.comp (DirectSum.of β i)) f


theorem Factors.finrank_pow_ramificationIdx [p.IsMaximal]
    (P : (factors (map (algebraMap R S) p)).toFinset) :
    finrank (R ⧸ p) (S ⧸ (P : Ideal S) ^ ramificationIdx (algebraMap R S) p P) =
      ramificationIdx (algebraMap R S) p P * inertiaDeg (algebraMap R S) p P

(P : { x // x ∈ (UniqueFactorizationMonoid.factors (Ideal.map (algebraMap R S) p)).toFinset })

FiniteDimensional.finrank (R ⧸ p) (S ⧸ ↑P ^ Ideal.ramificationIdx (algebraMap R S) p ↑P) =
  Ideal.ramificationIdx (algebraMap R S) p ↑P * Ideal.inertiaDeg (algebraMap R S) p ↑P


theorem ContinuousLinearMap.uniformEmbedding_of_bound {K : ℝ≥0} (hf : ∀ x, ‖x‖ ≤ K * ‖f x‖) :
    UniformEmbedding f

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_3}
{F : Type u_4}
[Ring 𝕜]
[Ring 𝕜₂]
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[Module 𝕜 E]
[Module 𝕜₂ F]
{σ : 𝕜 →+* 𝕜₂}
(f : E →SL[σ] F)
{K : ℝ≥0}
(hf : ∀ (x : E), ‖x‖ ≤ ↑K * ‖f x‖)


@[simp] theorem basis_self_iff_indep : M.Basis I I ↔ M.Indep I

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


theorem Bounded.rel_mono {r' : α → α → Prop} (h : Bounded r s) (hrr' : r ≤ r') : Bounded r' s

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
{r' : α → α → Prop}
(h : Set.Bounded r s)
(hrr' : r ≤ r')


theorem Ico_subset_Ici_self : Ico a b ⊆ Ici a

{α : Type u_2}
[Preorder α]
[LocallyFiniteOrder α]
{a b : α}
[LocallyFiniteOrderTop α]


@[mono]
theorem toSubsemigroup_mono : Monotone (toSubsemigroup : NonUnitalSubring R → Subsemigroup R)


/-- A list with product not one must have positive length. -/
@[to_additive "A list with sum not zero must have positive length."]
theorem length_pos_of_prod_ne_one (L : List M) (h : L.prod ≠ 1) : 0 < L.length

{M : Type u_4}
[Monoid M]
(L : List M)
(h : L.prod ≠ 1)


@[simp]
theorem ne_zero_iff_orderTop {x : HahnSeries Γ R} : x ≠ 0 ↔ orderTop x ≠ ⊤

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]
{x : HahnSeries Γ R}


lemma neg_succ (a : ℤ) : -succ a = pred (-a)


@[simp] lemma num_ne_zero : q.num ≠ 0 ↔ q ≠ 0


@[to_additive] lemma le_mabs_self (a : α) : a ≤ |a|ₘ

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


theorem ContDiff.norm_rpow {f : F → E} (hf : ContDiff ℝ 1 f) {p : ℝ} (hp : 1 < p) :
    ContDiff ℝ 1 (fun x ↦ ‖f x‖ ^ p)

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
{F : Type u_2}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{f : F → E}
(hf : ContDiff ℝ 1 f)
{p : ℝ}
(hp : 1 < p)


theorem geometric_hahn_banach_point_open (ht₁ : Convex ℝ t) (ht₂ : IsOpen t) (disj : x ∉ t) :
    ∃ f : E →L[ℝ] ℝ, ∀ b ∈ t, f x < f b

{E : Type u_2}
[TopologicalSpace E]
[AddCommGroup E]
[TopologicalAddGroup E]
[Module ℝ E]
[ContinuousSMul ℝ E]
{t : Set E}
{x : E}
(ht₁ : Convex ℝ t)
(ht₂ : IsOpen t)
(disj : x ∉ t)


theorem balanced_iInter₂ {f : ∀ i, κ i → Set E} (h : ∀ i j, Balanced 𝕜 (f i j)) :
    Balanced 𝕜 (⋂ (i) (j), f i j)

(h : ∀ (i : ι) (j : κ i), Balanced 𝕜 (f i j))


/-- To show a reflexive relation `r : α → α → Prop` holds over `x y : α`,
it suffices to show it holds when `x ≠ y`. -/
theorem Reflexive.rel_of_ne_imp (h : Reflexive r) {x y : α} (hr : x ≠ y → r x y) : r x y

{α : Type u_1}
{r : α → α → Prop}
(h : Reflexive r)
{x y : α}
(hr : x ≠ y → r x y)


theorem spanSingleton_div_spanSingleton (x y : K) :
    spanSingleton R₁⁰ x / spanSingleton R₁⁰ y = spanSingleton R₁⁰ (x / y)

(K : Type u_3)
[Field K]
{R₁ : Type u_4}
[CommRing R₁]
[IsDomain R₁]
[Algebra R₁ K]
[IsFractionRing R₁ K]
(x y : K)

FractionalIdeal.spanSingleton R₁⁰ x / FractionalIdeal.spanSingleton R₁⁰ y = FractionalIdeal.spanSingleton R₁⁰ (x / y)


theorem PosDef.anisotropic {Q : QuadraticMap R₂ M N} (hQ : Q.PosDef) : Q.Anisotropic

{M : Type u_4}
{N : Type u_5}
{R₂ : Type u}
[CommSemiring R₂]
[AddCommMonoid M]
[Module R₂ M]
[PartialOrder N]
[AddCommMonoid N]
[Module R₂ N]
{Q : QuadraticMap R₂ M N}
(hQ : Q.PosDef)


@[deprecated val_eq_of_eq (since := "2024-02-15")]
theorem veq_of_eq : i = j → i.val = j.val


theorem ae_inf_principal_eq_mk {s} (h : AEMeasurable f (μ.restrict s)) : f =ᶠ[ae μ ⊓ 𝓟 s] h.mk f

{α : Type u_2}
{β : Type u_3}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{f : α → β}
{μ : MeasureTheory.Measure α}
{s : Set α}
(h : AEMeasurable f (μ.restrict s))

f =ᶠ[MeasureTheory.ae μ ⊓ 𝓟 s] AEMeasurable.mk f h


/-- An odd function on a linear ordered additive commutative group is strictly monotone on the whole
group provided that it is strictly monotone on `Set.Ici 0`. -/
theorem strictMono_of_odd_strictMonoOn_nonneg {f : G → H} (h₁ : ∀ x, f (-x) = -f x)
    (h₂ : StrictMonoOn f (Ici 0)) : StrictMono f

{G : Type u_1}
{H : Type u_2}
[LinearOrderedAddCommGroup G]
[OrderedAddCommGroup H]
{f : G → H}
(h₁ : ∀ (x : G), f (-x) = -f x)
(h₂ : StrictMonoOn f (Set.Ici 0))


/-- The absolute discriminant of the number field `ℚ` is 1. -/
@[simp]
theorem numberField_discr : discr ℚ = 1


/-- If `f b = 1`, then the product of `f a` with `a ∈ s` is the same as the product of `f a` for
`a ∈ s ∖ {b}`. -/
@[to_additive "If `f b = 0`, then the sum of `f a` with `a ∈ s` is the same as the sum of `f a`
for `a ∈ s ∖ {b}`."]
lemma tprod_eq_tprod_diff_singleton {f : β → α} (s : Set β) {b : β} (hf₀ : f b = 1) :
    ∏' a : s, f a = ∏' a : (s \ {b} : Set β), f a

{α : Type u_1}
{β : Type u_2}
[AddCommMonoid α]
[TopologicalSpace α]
{f : β → α}
(s : Set β)
{b : β}
(hf₀ : f b = 0)


/-- The opposite morphism in `ShortComplex Cᵒᵖ` associated to a morphism in `ShortComplex C` -/
@[simps]
def opMap (φ : S₁ ⟶ S₂) : S₂.op ⟶ S₁.op

(CategoryTheory.ShortComplex.opMap φ).τ₁ = φ.τ₃.op


theorem zipRight'_nil_cons :
    zipRight' ([] : List α) (b :: bs) = ((none, b) :: bs.map fun b => (none, b), [])

{α : Type u}
{β : Type v}
(b : β)
(bs : List β)

[].zipRight' (b :: bs) = ((none, b) :: List.map (fun b => (none, b)) bs, [])


/-- The symbol `J(a | b)` depends only on `a` mod `b`. -/
theorem mod_left' {a₁ a₂ : ℤ} {b : ℕ} (h : a₁ % b = a₂ % b) : J(a₁ | b) = J(a₂ | b)

{a₁ a₂ : ℤ}
{b : ℕ}
(h : a₁ % ↑b = a₂ % ↑b)


theorem IsCompact.exists_isGLB [ClosedIicTopology α] {s : Set α} (hs : IsCompact s)
    (ne_s : s.Nonempty) : ∃ x ∈ s, IsGLB s x

{α : Type u_2}
[LinearOrder α]
[TopologicalSpace α]
[ClosedIicTopology α]
{s : Set α}
(hs : IsCompact s)
(ne_s : s.Nonempty)


theorem mk_subset_ge_of_subset_image (f : α → β) {s : Set α} {t : Set β} (h : t ⊆ f '' s) :
    #t ≤ #({ x ∈ s | f x ∈ t } : Set α)

{α β : Type u}
(f : α → β)
{s : Set α}
{t : Set β}
(h : t ⊆ f '' s)

Cardinal.mk ↑t ≤ Cardinal.mk ↑{x | x ∈ s ∧ f x ∈ t}


theorem le_partialSups_of_le (f : ℕ → α) {m n : ℕ} (h : m ≤ n) : f m ≤ partialSups f n

{α : Type u_1}
[SemilatticeSup α]
(f : ℕ → α)
{m n : ℕ}
(h : m ≤ n)


lemma isAffineOpen.preimage {X Y : Scheme} {U : Y.Opens} (hU : IsAffineOpen U)
    (f : X ⟶ Y) [IsAffineHom f] :
    IsAffineOpen (f ⁻¹ᵁ U)

{X Y : AlgebraicGeometry.Scheme}
{U : Y.Opens}
(hU : AlgebraicGeometry.IsAffineOpen U)
(f : X ⟶ Y)
[AlgebraicGeometry.IsAffineHom f]

AlgebraicGeometry.IsAffineOpen ((TopologicalSpace.Opens.map f.val.base).obj U)


@[to_additive]
theorem AEMeasurable.mul_iff_left {G : Type*} [MeasurableSpace G] [MeasurableSpace α] [CommGroup G]
    [MeasurableMul₂ G] [MeasurableInv G] {μ : Measure α} {f g : α → G} (hf : AEMeasurable f μ) :
    AEMeasurable (g * f) μ ↔ AEMeasurable g μ

{α : Type u_1}
{G : Type u_2}
[MeasurableSpace G]
[MeasurableSpace α]
[CommGroup G]
[MeasurableMul₂ G]
[MeasurableInv G]
{μ : MeasureTheory.Measure α}
{f g : α → G}
(hf : AEMeasurable f μ)


lemma dirSupClosed_Iic (a : α) : DirSupClosed (Iic a)


/-- The data that witnesses that a presheaf `A` is an ind-object. It consists of a small
    filtered indexing category `I`, a diagram `F : I ⥤ C` and the data for a colimit cocone on
    `F ⋙ yoneda : I ⥤ Cᵒᵖ ⥤ Type v` with cocone point `A`. -/
structure IndObjectPresentation (A : Cᵒᵖ ⥤ Type v) where
  /-- The indexing category of the filtered colimit presentation -/
  I : Type v
  /-- The indexing category of the filtered colimit presentation -/
  [ℐ : SmallCategory I]
  [hI : IsFiltered I]
  /-- The diagram of the filtered colimit presentation -/
  F : I ⥤ C
  /-- Use `IndObjectPresentation.cocone` instead. -/
  ι : F ⋙ yoneda ⟶ (Functor.const I).obj A
  /-- Use `IndObjectPresenation.coconeIsColimit` instead. -/
  isColimit : IsColimit (Cocone.mk A ι)

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

(self : CategoryTheory.Limits.IndObjectPresentation A)


theorem sum_support_of [∀ (i : ι) (x : β i), Decidable (x ≠ 0)] (x : ⨁ i, β i) :
    (∑ i ∈ x.support, of β i (x i)) = x

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

∑ i ∈ DFinsupp.support x, (DirectSum.of β i) (x i) = x


/-- Given a partition `P` of `s`, as well as a proof that `a * m + b * (m + 1) = s.card`, we can
find a new partition `Q` of `s` where each part has size `m` or `m + 1`, every part of `P` is the
union of parts of `Q` plus at most `m` extra elements, there are `b` parts of size `m + 1` and
(provided `m > 0`, because a partition does not have parts of size `0`) there are `a` parts of size
`m` and hence `a + b` parts in total. -/
theorem equitabilise_aux (hs : a * m + b * (m + 1) = s.card) :
    ∃ Q : Finpartition s,
      (∀ x : Finset α, x ∈ Q.parts → x.card = m ∨ x.card = m + 1) ∧
        (∀ x, x ∈ P.parts → (x \ (Q.parts.filter fun y => y ⊆ x).biUnion id).card ≤ m) ∧
          (Q.parts.filter fun i => card i = m + 1).card = b

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
{m a b : ℕ}
{P : Finpartition s}
(hs : a * m + b * (m + 1) = s.card)

∃ Q,
  (∀ x ∈ Q.parts, x.card = m ∨ x.card = m + 1) ∧
    (∀ x ∈ P.parts, (x \ (Finset.filter (fun y => y ⊆ x) Q.parts).biUnion id).card ≤ m) ∧
      (Finset.filter (fun i => i.card = m + 1) Q.parts).card = b


@[to_additive (attr := simp)]
theorem Germ.coe_prod {α : Type*} (l : Filter α) (R : Type*) [CommMonoid R] {ι} (f : ι → α → R)
    (s : Finset ι) : ((∏ i ∈ s, f i : α → R) : Germ l R) = ∏ i ∈ s, (f i : Germ l R)

{α : Type u_6}
(l : Filter α)
(R : Type u_7)
[AddCommMonoid R]
{ι : Type u_8}
(f : ι → α → R)
(s : Finset ι)


/--
A ring of characteristic zero has equal characteristic iff it does not
have mixed characteristic for any `p`.
-/
theorem iff_not_mixedCharZero [CharZero R] :
    (∀ I : Ideal R, I ≠ ⊤ → CharZero (R ⧸ I)) ↔ ∀ p > 0, ¬MixedCharZero R p

(R : Type u_1)
[CommRing R]
[CharZero R]

(∀ (I : Ideal R), I ≠ ⊤ → CharZero (R ⧸ I)) ↔ ∀ p > 0, ¬MixedCharZero R p


theorem image_image2_distrib {g : γ → δ} {f' : α' → β' → δ} {g₁ : α → α'} {g₂ : β → β'}
    (h_distrib : ∀ a b, g (f a b) = f' (g₁ a) (g₂ b)) :
    (image2 f s t).image g = image2 f' (s.image g₁) (t.image g₂)

{f : α → β → γ}

(h_distrib : ∀ (a : α) (b : β), g (f a b) = f' (g₁ a) (g₂ b))

g '' Set.image2 f s t = Set.image2 f' (g₁ '' s) (g₂ '' t)


@[to_additive (attr := simp)]
theorem mul_apply [Mul β] [ContinuousMul β] (f g : C(α, β)) (x : α) : (f * g) x = f x * g x

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
[Mul β]
[ContinuousMul β]
(f g : C(α, β))
(x : α)


protected theorem eq (x y : M) : B x y = B y x

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{B : LinearMap.BilinForm R M}
(H : B.IsSymm)
(x y : M)


/-- Given a family of opens `U` and an open `Y` equal to the union of opens in `U`, we may
    take the presieve on `Y` associated to `U` and the sieve generated by it, and form the
    full subcategory (subposet) of opens contained in `Y` (`over Y`) consisting of arrows
    in the sieve. This full subcategory is equivalent to `OpensLeCover U`, the (poset)
    category of opens contained in some `U i`. -/
@[simps]
def generateEquivalenceOpensLe_inverse' :
    OpensLeCover U ⥤
    (FullSubcategory fun f : Over Y =>
      (Sieve.generate (presieveOfCoveringAux U Y)).arrows f.hom)

(V : TopCat.Presheaf.SheafCondition.OpensLeCover U)

((TopCat.Presheaf.generateEquivalenceOpensLe_inverse' U hY).obj V).obj.left = V.obj


@[simp]
theorem sup_erase_bot [DecidableEq α] (s : Finset α) : (s.erase ⊥).sup id = s.sup id

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


theorem fg_adjoin_finset (t : Finset E) : (adjoin F (↑t : Set E)).FG

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


@[to_additive]
theorem _root_.Commute.list_prod_left (l : List M) (y : M) (h : ∀ x ∈ l, Commute x y) :
    Commute l.prod y

{M : Type u_4}
[AddMonoid M]
(l : List M)
(y : M)
(h : ∀ x ∈ l, AddCommute x y)


lemma mk_eq_zero {x : PGame.{u}} {hx} : mk x hx = 0 ↔ x ≈ 0


@[simp]
lemma card_sdiff_add_card_inter (s t : Finset α) :
    (s \ t).card + (s ∩ t).card = s.card

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


@[simp]
theorem monovaryOn_toDual_right : MonovaryOn f (toDual ∘ g) s ↔ AntivaryOn f g s

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
{f : ι → α}
{g : ι → β}
{s : Set ι}

MonovaryOn f (⇑OrderDual.toDual ∘ g) s ↔ AntivaryOn f g s


/--
Equivalent precoherent categories give equivalent coherent toposes.
-/
@[simps!]
def sheafCongrPrecoherent : haveI := e.precoherent
    Sheaf (coherentTopology C) A ≌ Sheaf (coherentTopology D) A

(F : CategoryTheory.Sheaf (CategoryTheory.coherentTopology C) A)

((e.sheafCongrPrecoherent A).functor.obj F).val.obj X = F.val.obj (Opposite.op (e.inverse.obj (Opposite.unop X)))


theorem sup_left_right_swap (a b c : α) : a ⊔ b ⊔ c = c ⊔ b ⊔ a

{α : Type u}
[SemilatticeSup α]
(a b c : α)


@[simp, norm_cast]
theorem coe_eq_empty {s : Closeds α} : (s : Set α) = ∅ ↔ s = ⊥

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

↑s = ∅ ↔ s = ⊥


theorem ediam_univ_eq_top_iff_noncompact [ProperSpace α] :
    EMetric.diam (univ : Set α) = ∞ ↔ NoncompactSpace α

{α : Type u}
[PseudoMetricSpace α]
[ProperSpace α]

EMetric.diam Set.univ = ⊤ ↔ NoncompactSpace α


@[simp]
theorem map_preimage (F : C ⥤ D) [Full F] {X Y : C} (f : F.obj X ⟶ F.obj Y) :
    F.map (preimage F f) = f

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


/-- Each element of the group defines an additive monoid isomorphism.

This is a stronger version of `MulAction.toPerm`. -/
@[simps (config := { simpRhs := true })]
def DistribMulAction.toAddEquiv (x : α) : β ≃+ β

{α : Type u}
(β : Type v)
[Group α]
[AddMonoid β]
[DistribMulAction α β]
(x : α)

∀ (a : β), (DistribMulAction.toAddEquiv β x).symm a = x⁻¹ • a


/-- The forgetful functor `AffineScheme ⥤ Scheme`. -/
@[simps!]
def forgetToScheme : AffineScheme ⥤ Scheme

∀ {X Y : CategoryTheory.InducedCategory AlgebraicGeometry.Scheme CategoryTheory.FullSubcategory.obj} (f : X ⟶ Y),
  AlgebraicGeometry.AffineScheme.forgetToScheme.map f = f


@[to_additive]
theorem Nonempty.of_div_right : (s / t).Nonempty → t.Nonempty

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


/-- If `a` does not belong to the finset `s`, then the `n`th symmetric power of `{a} ∪ s` is
  in 1-1 correspondence with the disjoint union of the `n - i`th symmetric powers of `s`,
  for `0 ≤ i ≤ n`. -/
@[simps]
def symInsertEquiv (h : a ∉ s) : (insert a s).sym n ≃ Σi : Fin (n + 1), s.sym (n - i)

{α : Type u_1}
[DecidableEq α]
{s : Finset α}
{a : α}
{n : ℕ}
(h : a ∉ s)
(m : { x // x ∈ (insert a s).sym n })

↑((Finset.symInsertEquiv h) m).snd = (Sym.filterNe a ↑m).snd


lemma strongRec_of_lt (hn : n < m) : m.strongRec lt ge n = lt n hn

{ge : (n : ℤ) → n ≥ m → ((k : ℤ) → k < n → P k) → P n}


@[simp]
theorem lcm_one_left [NormalizedGCDMonoid α] (a : α) : lcm 1 a = normalize a

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
(a : α)


@[simp] theorem HashSetBucket.size_update {α : Type u} (data : HashSetBucket α) (i : USize) (d : List α) (h : i.toNat < data.val.size) :
    (data.update i d h).val.size = data.val.size

{α : Type u}
(data : Lean.HashSetBucket α)
(i : USize)
(d : List α)
(h : i.toNat < data.val.size)


theorem midpoint_vadd_midpoint (v v' : V) (p p' : P) :
    midpoint R v v' +ᵥ midpoint R p p' = midpoint R (v +ᵥ p) (v' +ᵥ p')

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[Ring R]
[Invertible 2]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
(v v' : V)
(p p' : P)


theorem heq_of_eq_of_heq (h₁ : a = a') (h₂ : HEq a' b) : HEq a b

{α β : Sort u}
{a a' : α}
{b : β}
(h₁ : a = a')
(h₂ : HEq a' b)


@[to_additive]
theorem div_iInter₂_subset (s : Set α) (t : ∀ i, κ i → Set α) :
    (s / ⋂ (i) (j), t i j) ⊆ ⋂ (i) (j), s / t i j

{α : Type u_2}
{ι : Sort u_5}
{κ : ι → Sort u_6}
[Div α]
(s : Set α)
(t : (i : ι) → κ i → Set α)

s / ⋂ i, ⋂ j, t i j ⊆ ⋂ i, ⋂ j, s / t i j


theorem add (hf : IsCauSeq abv f) (hg : IsCauSeq abv g) : IsCauSeq abv (f + g)

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
{f g : ℕ → β}
(hf : IsCauSeq abv f)
(hg : IsCauSeq abv g)


/-- The natural equivalence `(E × F) × G ≃ E × (F × G)` is smooth.

Warning: if you think you need this lemma, it is likely that you can simplify your proof by
reformulating the lemma that you're applying next using the tips in
Note [continuity lemma statement]
-/
theorem contDiff_prodAssoc : ContDiff 𝕜 ⊤ <| Equiv.prodAssoc E F G

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]


theorem continuous_map_of_le {α : Type*} [TopologicalSpace α]
    {s t : Setoid α} (h : s ≤ t) : Continuous (Setoid.map_of_le h)

{α : Type u_5}
[TopologicalSpace α]
{s t : Setoid α}
(h : s ≤ t)


lemma measure_symmDiff_preimage_iterate_le
    (hf : MeasurePreserving f μ μ) (hs : NullMeasurableSet s μ) (n : ℕ) :
    μ (s ∆ (f^[n] ⁻¹' s)) ≤ n • μ (s ∆ (f ⁻¹' s))

(hf : MeasureTheory.MeasurePreserving f μ μ)

(hs : MeasureTheory.NullMeasurableSet s μ)

μ (symmDiff s (f^[n] ⁻¹' s)) ≤ n • μ (symmDiff s (f ⁻¹' s))


theorem eval_monoidalComp
    {η η' : f ⟶ g} {α : g ⟶ h} {θ θ' : h ⟶ i} {αθ : g ⟶ i} {ηαθ : f ⟶ i}
    (pf_η : η = η') (pf_θ : θ = θ') (pf_αθ : α ≫ θ' = αθ) (pf_ηαθ : η' ≫ αθ = ηαθ) :
    η ≫ α ≫ θ = ηαθ

(pf_αθ : CategoryTheory.CategoryStruct.comp α θ' = αθ)

(pf_ηαθ : CategoryTheory.CategoryStruct.comp η' αθ = ηαθ)

CategoryTheory.CategoryStruct.comp η (CategoryTheory.CategoryStruct.comp α θ) = ηαθ


theorem _root_.MeasurableEmbedding.integrableAtFilter_map_iff [MeasurableSpace β] {e : α → β}
    (he : MeasurableEmbedding e) {f : β → E} :
    IntegrableAtFilter f (l.map e) (μ.map e) ↔ IntegrableAtFilter (f ∘ e) l μ

{α : Type u_1}
{β : Type u_2}
{E : Type u_3}
[MeasurableSpace α]
[NormedAddCommGroup E]
{μ : MeasureTheory.Measure α}
{l : Filter α}
[MeasurableSpace β]
{e : α → β}
(he : MeasurableEmbedding e)
{f : β → E}

MeasureTheory.IntegrableAtFilter f (Filter.map e l) (MeasureTheory.Measure.map e μ) ↔
  MeasureTheory.IntegrableAtFilter (f ∘ e) l μ


theorem mul_add_right_left_iff {x y z : R} : IsRelPrime (z * y + x) y ↔ IsRelPrime x y


theorem aemeasurable {X : Ω → E} {s : Set E} (hns : μ s ≠ 0) (hnt : μ s ≠ ∞)
    (hu : IsUniform X s ℙ μ) : AEMeasurable X ℙ

{E : Type u_1}
[MeasurableSpace E]
{μ : MeasureTheory.Measure E}
{Ω : Type u_2}

∀ {x : MeasurableSpace Ω} {ℙ : MeasureTheory.Measure Ω} {X : Ω → E} {s : Set E},
  μ s ≠ 0 → μ s ≠ ⊤ → MeasureTheory.pdf.IsUniform X s ℙ μ → AEMeasurable X ℙ


@[simp]
theorem isSuccLimit_iff_of_noMax [NoMaxOrder α] : IsSuccLimit a ↔ IsMin a

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


/--
The category of multicoforks is equivalent to the category of coforks over `∐ I.left ⇉ ∐ I.right`.
It then follows from `CategoryTheory.IsColimit.ofPreservesCoconeInitial` (or `reflects`) that
it preserves and reflects colimit cocones.
-/
@[simps]
noncomputable def multicoforkEquivSigmaCofork :
    Multicofork I ≌ Cofork I.fstSigmaMap I.sndSigmaMap

(I : CategoryTheory.Limits.MultispanIndex C)

I.multicoforkEquivSigmaCofork.counitIso =
  CategoryTheory.NatIso.ofComponents
    (fun K =>
      CategoryTheory.Limits.Cofork.ext
        (CategoryTheory.Iso.refl ((I.ofSigmaCoforkFunctor.comp I.toSigmaCoforkFunctor).obj K).pt) ⋯)
    ⋯


theorem mono_of_mono_fac {X Y Z : C} {f : X ⟶ Y} {g : Y ⟶ Z} {h : X ⟶ Z} [Mono h]
    (w : f ≫ g = h) : Mono f

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


@[to_additive]
lemma coe_val_mul_coe_inv_val (S : Submonoid M) {x : Sˣ} :
    ((x : Sˣ) : M) * ((x⁻¹ : Sˣ) : M) = 1

{M : Type u_1}
[AddMonoid M]
(S : AddSubmonoid M)
{x : AddUnits ↥S}


@[simp]
theorem ofMul_list_prod (s : List α) : ofMul s.prod = (s.map ofMul).sum

Additive.ofMul s.prod = (List.map (⇑Additive.ofMul) s).sum


theorem smul_closedBall_subset {p : Seminorm 𝕜 E} {k : 𝕜} {r : ℝ} :
    k • p.closedBall 0 r ⊆ p.closedBall 0 (‖k‖ * r)

{𝕜 : Type u_3}
{E : Type u_7}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{p : Seminorm 𝕜 E}
{k : 𝕜}
{r : ℝ}


lemma abs_le_iff_mul_self_le : |a| ≤ |b| ↔ a * a ≤ b * b

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


lemma IsSelfAdjoint.spectrumRestricts {a : A} (ha : IsSelfAdjoint a) :
    SpectrumRestricts a Complex.reCLM


theorem inducedOuterMeasure_eq_extend' {s : Set α} (hs : P s) :
    inducedOuterMeasure m P0 m0 s = extend m s

(PU : ∀ ⦃f : ℕ → Set α⦄, (∀ (i : ℕ), P (f i)) → P (⋃ i, f i))

(msU : ∀ ⦃f : ℕ → Set α⦄ (hm : ∀ (i : ℕ), P (f i)), m (⋃ i, f i) ⋯ ≤ ∑' (i : ℕ), m (f i) ⋯)

(m_mono : ∀ ⦃s₁ s₂ : Set α⦄ (hs₁ : P s₁) (hs₂ : P s₂), s₁ ⊆ s₂ → m s₁ hs₁ ≤ m s₂ hs₂)

(MeasureTheory.inducedOuterMeasure m P0 m0) s = MeasureTheory.extend m s


theorem Normal.exists_isSplittingField [h : Normal F K] [FiniteDimensional F K] :
    ∃ p : F[X], IsSplittingField F K p

(F : Type u_1)
(K : Type u_2)
[Field F]
[Field K]
[Algebra F K]
[h : Normal F K]
[FiniteDimensional F K]


/-- Given `f : α → β`, `l : β →₀ M` and a proof `hf` that `f` is injective on
the preimage of `l.support`, `comapDomain f l hf` is the finitely supported function
from `α` to `M` given by composing `l` with `f`. -/
@[simps support]
def comapDomain [Zero M] (f : α → β) (l : β →₀ M) (hf : Set.InjOn f (f ⁻¹' ↑l.support)) :
    α →₀ M

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[Zero M]
(f : α → β)
(l : β →₀ M)
(hf : Set.InjOn f (f ⁻¹' ↑l.support))

(Finsupp.comapDomain f l hf).support = l.support.preimage f hf


/-- If `f : X → Z` is a Borel measurable map from a standard Borel space to a
countably separated measurable space then the preimage of a set `s` is measurable
if and only if the set is measurable in `Set.range f`. -/
theorem measurableSet_preimage_iff_preimage_val {f : X → Z} [CountablySeparated (range f)]
    (hf : Measurable f) {s : Set Z} :
    MeasurableSet (f ⁻¹' s) ↔ MeasurableSet ((↑) ⁻¹' s : Set (range f))

MeasurableSet (f ⁻¹' s) ↔ MeasurableSet (Subtype.val ⁻¹' s)


theorem IsSt.map {x : ℝ*} {r : ℝ} (hxr : IsSt x r) {f : ℝ → ℝ} (hf : ContinuousAt f r) :
    IsSt (x.map f) (f r)

{x : ℝ*}
{r : ℝ}
(hxr : x.IsSt r)
{f : ℝ → ℝ}
(hf : ContinuousAt f r)

Hyperreal.IsSt (Filter.Germ.map f x) (f r)


@[simp]
theorem flip_add (f g : E →SL[σ₁₃] F →SL[σ₂₃] G) : (f + g).flip = f.flip + g.flip

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{𝕜₃ : Type u_3}
{E : Type u_4}
{F : Type u_6}
{G : Type u_8}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup F]
[SeminormedAddCommGroup G]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NontriviallyNormedField 𝕜₃]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
[NormedSpace 𝕜₃ G]
{σ₂₃ : 𝕜₂ →+* 𝕜₃}
{σ₁₃ : 𝕜 →+* 𝕜₃}
[RingHomIsometric σ₂₃]
[RingHomIsometric σ₁₃]
(f g : E →SL[σ₁₃] F →SL[σ₂₃] G)


/-- If `α` is equivalent to `β`, then `IsEmpty α` is equivalent to `IsEmpty β`. -/
theorem isEmpty_congr (e : α ≃ β) : IsEmpty α ↔ IsEmpty β

{α : Sort u_1}
{β : Sort u_2}
(e : α ≃ β)


@[simp]
theorem bsup_eq_blsub (o : Ordinal.{u}) (f : ∀ a < o, Ordinal.{max u v}) :
    (bsup.{_, v} o fun a ha => succ (f a ha)) = blsub.{_, v} o f

(f : (a : Ordinal.{u}) → a < o → Ordinal.{max u v})

(o.bsup fun a ha => Order.succ (f a ha)) = o.blsub f


@[simp]
theorem add_apply (f g : M →ₛₗ[σ₁₂] M₂) (x : M) : (f + g) x = f x + g x

{R₁ : Type u_2}
{R₂ : Type u_3}
{M : Type u_9}
{M₂ : Type u_11}
[Semiring R₁]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R₁ M]
[Module R₂ M₂]
{σ₁₂ : R₁ →+* R₂}
(f g : M →ₛₗ[σ₁₂] M₂)
(x : M)


@[to_additive (attr := simp)]
protected lemma div_mul_cancel (h : IsUnit b) (a : α) : a / b * b = a

{α : Type u}
[DivisionMonoid α]
{b : α}
(h : IsUnit b)
(a : α)


theorem exists_set_sigmaFinite (hf : AEFinStronglyMeasurable f μ) :
    ∃ t, MeasurableSet t ∧ f =ᵐ[μ.restrict tᶜ] 0 ∧ SigmaFinite (μ.restrict t)

(hf : MeasureTheory.AEFinStronglyMeasurable f μ)

∃ t, MeasurableSet t ∧ f =ᵐ[μ.restrict tᶜ] 0 ∧ MeasureTheory.SigmaFinite (μ.restrict t)


/-- The indexed infimum of two functions are comparable if the functions are pointwise comparable-/
theorem ciInf_mono {f g : ι → α} (B : BddBelow (range f)) (H : ∀ x, f x ≤ g x) : iInf f ≤ iInf g

{α : Type u_1}
{ι : Sort u_4}
[ConditionallyCompleteLattice α]
{f g : ι → α}
(B : BddBelow (Set.range f))
(H : ∀ (x : ι), f x ≤ g x)


/-- Lifts an equivalence on states to an equivalence on DFAs. -/
@[simps apply_step apply_start apply_accept]
def reindex (g : σ ≃ σ') : DFA α σ ≃ DFA α σ'

{α : Type u}
{σ : Type v}
{σ' : Type u_2}
(g : σ ≃ σ')
(M : DFA α σ)
(s : σ')
(a : α)

((DFA.reindex g) M).step s a = g (M.step (g.symm s) a)


lemma Even.toUnitHom_eval_neg_one (hψ : ψ.Even) : ψ.toUnitHom (-1) = 1

{S : Type}
[CommRing S]
{m : ℕ}
(ψ : DirichletCharacter S m)
(hψ : ψ.Even)


/-- `Real.exp (f x)` is bounded away from zero and infinity along a filter `l` if and only if
`|f x|` is bounded from above along this filter. -/
@[simp]
theorem isTheta_exp_comp_one {f : α → ℝ} :
    (fun x => exp (f x)) =Θ[l] (fun _ => 1 : α → ℝ) ↔ IsBoundedUnder (· ≤ ·) l fun x => |f x|

{α : Type u_1}
{l : Filter α}
{f : α → ℝ}

((fun x => Real.exp (f x)) =Θ[l] fun x => 1) ↔ Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l fun x => |f x|


theorem inter_erase (a : α) (s t : Finset α) : s ∩ t.erase a = (s ∩ t).erase a

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


@[simp] lemma isOpen_exterior : IsOpen (exterior s)

{α : Type u_3}
[TopologicalSpace α]
{s : Set α}
[AlexandrovDiscrete α]


lemma SigmaFinite.withDensity_of_ne_top' [SigmaFinite μ] {f : α → ℝ≥0∞} (hf_ne_top : ∀ x, f x ≠ ∞) :
    SigmaFinite (μ.withDensity f)

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[MeasureTheory.SigmaFinite μ]
{f : α → ℝ≥0∞}
(hf_ne_top : ∀ (x : α), f x ≠ ⊤)


@[simp] theorem exists_unique_eq {a' : α} : ∃! a, a = a'


theorem condexp_min_stopping_time_ae_eq_restrict_le [MeasurableSpace ι] [SecondCountableTopology ι]
    [BorelSpace ι] (hτ : IsStoppingTime ℱ τ) (hσ : IsStoppingTime ℱ σ)
    [SigmaFinite (μ.trim (hτ.min hσ).measurableSpace_le)] :
    μ[f|(hτ.min hσ).measurableSpace] =ᵐ[μ.restrict {x | τ x ≤ σ x}] μ[f|hτ.measurableSpace]

{Ω : Type u_1}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[LinearOrder ι]
{μ : MeasureTheory.Measure Ω}
{ℱ : MeasureTheory.Filtration ι m}
{τ σ : Ω → ι}
{E : Type u_4}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[CompleteSpace E]
{f : Ω → E}
[Filter.atTop.IsCountablyGenerated]
[TopologicalSpace ι]
[OrderTopology ι]
[MeasurableSpace ι]
[SecondCountableTopology ι]
[BorelSpace ι]
(hτ : MeasureTheory.IsStoppingTime ℱ τ)
(hσ : MeasureTheory.IsStoppingTime ℱ σ)
[MeasureTheory.SigmaFinite (μ.trim ⋯)]

μ[f|⋯.measurableSpace] =ᵐ[μ.restrict {x | τ x ≤ σ x}] μ[f|hτ.measurableSpace]


theorem toIcoMod_sub_eq_sub (a b c : α) : toIcoMod hp a (b - c) = toIcoMod hp (a + c) b - c

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


/-- For `n ≤ m`, `(n, m)` is in the reflexive-transitive closure of `~` if `i ~ succ i`
  for all `i` between `n` and `m`. -/
theorem reflTransGen_of_succ_of_le (r : α → α → Prop) {n m : α} (h : ∀ i ∈ Ico n m, r i (succ i))
    (hnm : n ≤ m) : ReflTransGen r n m

(h : ∀ i ∈ Set.Ico n m, r i (Order.succ i))


theorem let_eq {α : Sort v} {β : Sort u} {a₁ a₂ : α} {b₁ b₂ : α → β}
    (h₁ : a₁ = a₂) (h₂ : ∀ x, b₁ x = b₂ x) :
    (let x : α := a₁; b₁ x) = (let x : α := a₂; b₂ x)

{α : Sort v}
{β : Sort u}
{a₁ a₂ : α}
{b₁ b₂ : α → β}
(h₁ : a₁ = a₂)
(h₂ : ∀ (x : α), b₁ x = b₂ x)

(let x := a₁;
  b₁ x) =
  let x := a₂;
  b₂ x


theorem exists_leftInverse_of_injective (f : V →ₗ[MonoidAlgebra k G] W)
    (hf : LinearMap.ker f = ⊥) :
    ∃ g : W →ₗ[MonoidAlgebra k G] V, g.comp f = LinearMap.id

{k : Type u}
[Field k]
{G : Type u}
[Fintype G]
[Invertible ↑(Fintype.card G)]
[Group G]
{V : Type u}
[AddCommGroup V]
[Module (MonoidAlgebra k G) V]
{W : Type u}
[AddCommGroup W]
[Module (MonoidAlgebra k G) W]
(f : V →ₗ[MonoidAlgebra k G] W)
(hf : LinearMap.ker f = ⊥)


theorem measurable_of_tendsto_metrizable_ae {μ : Measure α} [μ.IsComplete] {f : ℕ → α → β}
    {g : α → β} (hf : ∀ n, Measurable (f n))
    (h_ae_tendsto : ∀ᵐ x ∂μ, Tendsto (fun n => f n x) atTop (𝓝 (g x))) : Measurable g

{f : ℕ → α → β}

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


@[simp]
theorem map_id' : map (fun x => x) μ = μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}

MeasureTheory.Measure.map (fun x => x) μ = μ


theorem add_mem_Ico_iff_right : a + b ∈ Set.Ico c d ↔ b ∈ Set.Ico (c - a) (d - a)

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


/-- If `R → S` is an integral extension, `M` is a submonoid of `R`,
`Rₘ` is the localization of `R` at `M`,
and `Sₘ` is the localization of `S` at the image of `M` under the extension map,
then the induced map `Rₘ → Sₘ` is also an integral extension -/
theorem isIntegral_localization [Algebra.IsIntegral R S] :
    (map Sₘ (algebraMap R S)
          (show _ ≤ (Algebra.algebraMapSubmonoid S M).comap _ from M.le_comap_map) :
        Rₘ →+* _).IsIntegral

[IsLocalization (Algebra.algebraMapSubmonoid S M) Sₘ]

(IsLocalization.map Sₘ (algebraMap R S) ⋯).IsIntegral


theorem HasEigenvector.apply_eq_smul {f : End R M} {μ : R} {x : M} (hx : f.HasEigenvector μ x) :
    f x = μ • x

{R : Type v}
{M : Type w}
[CommRing R]
[AddCommGroup M]
[Module R M]
{f : Module.End R M}
{μ : R}
{x : M}
(hx : f.HasEigenvector μ x)


private theorem mul_smul' [DecidableEq ιA] [DecidableEq ιB] [GSemiring A] [Gmodule A M]
    (a b : ⨁ i, A i)
    (c : ⨁ i, M i) : (a * b) • c = a • b • c

{ιA : Type u_1}
{ιB : Type u_2}
(A : ιA → Type u_3)
(M : ιB → Type u_4)
[AddMonoid ιA]
[VAdd ιA ιB]
[(i : ιA) → AddCommMonoid (A i)]
[(i : ιB) → AddCommMonoid (M i)]
[DecidableEq ιA]
[DecidableEq ιB]
[DirectSum.GSemiring A]
[DirectSum.Gmodule A M]
(a b : ⨁ (i : ιA), A i)
(c : ⨁ (i : ιB), M i)


theorem mem_compl_singleton_iff {a x : α} : x ∈ ({a} : Set α)ᶜ ↔ x ≠ a


lemma lie_h_e_smul (t : IsSl2Triple h e f) : ⁅h, e⁆ = (2 : R) • e

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


/-- The map `Square Cᵒᵖ → Square C` which switches `X₁` and `X₃`, but
does not move `X₂` and `X₃`. -/
@[simps]
protected def unop (sq : Square Cᵒᵖ) : Square C

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(sq : CategoryTheory.Square Cᵒᵖ)


/-- A class encoding the concept that a space satisfies the Tietze extension property. -/
class TietzeExtension (Y : Type v) [TopologicalSpace Y] : Prop where
  exists_restrict_eq' {X : Type u} [TopologicalSpace X] [NormalSpace X] (s : Set X)
    (hs : IsClosed s) (f : C(s, Y)) : ∃ (g : C(X, Y)), g.restrict s = f

{Y : Type v}
[TopologicalSpace Y]
[self : TietzeExtension Y]
{X : Type u}
[TopologicalSpace X]
[NormalSpace X]
(s : Set X)
(hs : IsClosed s)
(f : C(↑s, Y))


theorem eventually_div_lt_of_div_lt {L : ℝ} {n : ℕ} (hn : n ≠ 0) (hL : u n / n < L) :
    ∀ᶠ p in atTop, u p / p < L

{u : ℕ → ℝ}
(h : Subadditive u)
{L : ℝ}
{n : ℕ}
(hn : n ≠ 0)
(hL : u n / ↑n < L)

∀ᶠ (p : ℕ) in Filter.atTop, u p / ↑p < L


theorem cg_closure {s : Set M} (hs : s.Countable) : CG (closure L s)

{L : FirstOrder.Language}
{M : Type u_1}
[L.Structure M]
{s : Set M}
(hs : s.Countable)


@[simp]
theorem union_empty_iff {s t : Set α} : s ∪ t = ∅ ↔ s = ∅ ∧ t = ∅


theorem Integrable.smul (hf : Integrable I l f vol) (c : ℝ) : Integrable I l (c • f) vol

{ι : Type u}
{E : Type v}
{F : Type w}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{I : BoxIntegral.Box ι}
[Fintype ι]
{l : BoxIntegral.IntegrationParams}
{f : (ι → ℝ) → E}
{vol : ι →ᵇᵃ[⊤] E →L[ℝ] F}
(hf : BoxIntegral.Integrable I l f vol)
(c : ℝ)


/-- A separable space is one with a countable dense subset, available through
`TopologicalSpace.exists_countable_dense`. If `α` is also known to be nonempty, then
`TopologicalSpace.denseSeq` provides a sequence `ℕ → α` with dense range, see
`TopologicalSpace.denseRange_denseSeq`.

If `α` is a uniform space with countably generated uniformity filter (e.g., an `EMetricSpace`), then
this condition is equivalent to `SecondCountableTopology α`. In this case the
latter should be used as a typeclass argument in theorems because Lean can automatically deduce
`TopologicalSpace.SeparableSpace` from `SecondCountableTopology` but it can't
deduce `SecondCountableTopology` from `TopologicalSpace.SeparableSpace`.

Porting note (#11215): TODO: the previous paragraph describes the state of the art in Lean 3.
We can have instance cycles in Lean 4 but we might want to
postpone adding them till after the port. -/
@[mk_iff] class SeparableSpace : Prop where
  /-- There exists a countable dense set. -/
  exists_countable_dense : ∃ s : Set α, s.Countable ∧ Dense s

[self : TopologicalSpace.SeparableSpace α]


theorem component.of (i j : ι) (b : M j) :
    component R ι M i ((lof R ι M j) b) = if h : j = i then Eq.recOn h b else 0

(R : Type u)
[Semiring R]
{ι : Type v}
[dec_ι : DecidableEq ι]
{M : ι → Type w}
[(i : ι) → AddCommMonoid (M i)]
[(i : ι) → Module R (M i)]
(i j : ι)
(b : M j)

(DirectSum.component R ι M i) ((DirectSum.lof R ι M j) b) = if h : j = i then Eq.recOn h b else 0


theorem Monovary.dual_right : Monovary f g → Antivary f (toDual ∘ g)

{ι : Type u_1}
{α : Type u_3}
{β : Type u_4}
[Preorder α]
[Preorder β]
{f : ι → α}
{g : ι → β}

Monovary f g → Antivary f (⇑OrderDual.toDual ∘ g)


@[measurability]
theorem measurable_iInf {ι} [Countable ι] {f : ι → δ → α} (hf : ∀ i, Measurable (f i)) :
    Measurable fun b => ⨅ i, f i b

{α : Type u_1}
{δ : Type u_4}
[TopologicalSpace α]
[MeasurableSpace α]
[BorelSpace α]
[MeasurableSpace δ]
[ConditionallyCompleteLinearOrder α]
[OrderTopology α]
[SecondCountableTopology α]
{ι : Sort u_5}
[Countable ι]
{f : ι → δ → α}
(hf : ∀ (i : ι), Measurable (f i))


theorem integrable_comp_mul_left_iff (g : ℝ → F) {R : ℝ} (hR : R ≠ 0) :
    (Integrable fun x => g (R * x)) ↔ Integrable g

{F : Type u_1}
[NormedAddCommGroup F]
(g : ℝ → F)
{R : ℝ}
(hR : R ≠ 0)

MeasureTheory.Integrable (fun x => g (R * x)) MeasureTheory.volume ↔ MeasureTheory.Integrable g MeasureTheory.volume


theorem compatiblePreservingOfDownwardsClosed (F : C ⥤ D) [F.Full] [F.Faithful]
    (hF : ∀ {c : C} {d : D} (_ : d ⟶ F.obj c), Σc', F.obj c' ≅ d) : CompatiblePreserving K F

{K : CategoryTheory.GrothendieckTopology D}

(hF : {c : C} → {d : D} → (d ⟶ F.obj c) → (c' : C) × (F.obj c' ≅ d))


@[reassoc (attr := simp)]
theorem biproduct.map_desc {f g : J → C} [HasBiproduct f] [HasBiproduct g] (p : ∀ j, f j ⟶ g j)
    {P : C} (k : ∀ j, g j ⟶ P) :
    biproduct.map p ≫ biproduct.desc k = biproduct.desc fun j => p j ≫ k j

CategoryTheory.Limits.biproduct.map p ≫ CategoryTheory.Limits.biproduct.desc k =
  CategoryTheory.Limits.biproduct.desc fun j => p j ≫ k j


@[to_additive addEquivOfLocalizations_right_inv]
theorem mulEquivOfLocalizations_right_inv (k : LocalizationMap S P) :
    f.ofMulEquivOfLocalizations (f.mulEquivOfLocalizations k) = k

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
{P : Type u_3}
[AddCommMonoid P]
(f : S.LocalizationMap N)
(k : S.LocalizationMap P)

f.ofAddEquivOfLocalizations (f.addEquivOfLocalizations k) = k


/-- See also `IsCompact.measure_closure` for a version
that assumes the `σ`-algebra to be the Borel `σ`-algebra but makes no assumptions on `μ`. -/
lemma measure_closure_eq_of_isCompact [R1Space α] [OuterRegular μ]
    {k : Set α} (hk : IsCompact k) : μ (closure k) = μ k

{α : Type u_1}
[MeasurableSpace α]
[TopologicalSpace α]
{μ : MeasureTheory.Measure α}
[R1Space α]
[μ.OuterRegular]
{k : Set α}
(hk : IsCompact k)


/-- The left and right shift of cochains commute only up to a sign. -/
lemma leftShift_rightShift_eq_negOnePow_rightShift_leftShift
    (a n' n'' : ℤ) (hn' : n' + a = n) (hn'' : n + a = n'') :
    (γ.rightShift a n' hn').leftShift a n hn' =
      a.negOnePow • (γ.leftShift a n'' hn'').rightShift a n hn''

(γ : CochainComplex.HomComplex.Cochain K L n)


theorem wrepr_wMk {α : TypeVec n} (a : q.P.A) (f' : q.P.drop.B a ⟹ α)
    (f : q.P.last.B a → q.P.W α) :
    wrepr (q.P.wMk a f' f) =
      q.P.wMk' (repr (abs (appendFun id wrepr <$$> ⟨a, q.P.appendContents f' f⟩)))

(f : (MvQPF.P F).last.B a → (MvQPF.P F).W α)

MvQPF.wrepr ((MvQPF.P F).wMk a f' f) =
  (MvQPF.P F).wMk'
    (MvQPF.repr (MvQPF.abs (MvFunctor.map (TypeVec.id ::: MvQPF.wrepr) ⟨a, (MvQPF.P F).appendContents f' f⟩)))


theorem condIndepSets_piiUnionInter_of_disjoint {s : ι → Set (Set Ω)}
    {S T : Set ι} (h_indep : iCondIndepSets m' hm' s μ) (hST : Disjoint S T) :
    CondIndepSets m' hm' (piiUnionInter s S) (piiUnionInter s T) μ

(h_indep : ProbabilityTheory.iCondIndepSets m' hm' s μ)

ProbabilityTheory.CondIndepSets m' hm' (piiUnionInter s S) (piiUnionInter s T) μ


theorem surjOn_Ioc_of_monotone_surjective (h_mono : Monotone f) (h_surj : Function.Surjective f)
    (a b : α) : SurjOn f (Ioc a b) (Ioc (f a) (f b))

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[PartialOrder β]
{f : α → β}
(h_mono : Monotone f)
(h_surj : Function.Surjective f)
(a b : α)

Set.SurjOn f (Set.Ioc a b) (Set.Ioc (f a) (f b))


/-- See `intervalIntegrable_cpow` for a version applying to any locally finite measure, but with a
stronger hypothesis on `r`. -/
theorem intervalIntegrable_cpow' {r : ℂ} (h : -1 < r.re) :
    IntervalIntegrable (fun x : ℝ => (x : ℂ) ^ r) volume a b

IntervalIntegrable (fun x => ↑x ^ r) MeasureTheory.volume a b


@[to_additive (attr := simp)]
theorem map.of {x} : map f (of x) = of (f x)

{α : Type u}
{β : Type v}
{f : α → β}
{x : α}

(FreeGroup.map f) (FreeGroup.of x) = FreeGroup.of (f x)


/-- If a matrix has a repeated column, the determinant will be zero. -/
theorem det_zero_of_column_eq (i_ne_j : i ≠ j) (hij : ∀ k, M k i = M k j) : M.det = 0

{n : Type u_2}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
{M : Matrix n n R}
{i j : n}
(i_ne_j : i ≠ j)
(hij : ∀ (k : n), M k i = M k j)


theorem inverse_graph : (inverse f).graph = f.graph.map (LinearEquiv.prodComm R E F)

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
{f : E →ₗ.[R] F}
(hf : LinearMap.ker f.toFun = ⊥)

f.inverse.graph = Submodule.map (LinearEquiv.prodComm R E F) f.graph


theorem exists_singleton_mem_of_forall_separating [Nonempty α] (p : Set α → Prop)
    [HasCountableSeparatingOn α p univ] (hl : ∀ U, p U → U ∈ l ∨ Uᶜ ∈ l) :
    ∃ x : α, {x} ∈ l

(hl : ∀ (U : Set α), p U → U ∈ l ∨ Uᶜ ∈ l)


theorem not_xor_not : ∀ (x y : Bool), xor (!x) (!y) = (xor x y)


/-- **Faulhaber's theorem** relating the **sum of p-th powers** to the Bernoulli numbers:
$$\sum_{k=0}^{n-1} k^p = \sum_{i=0}^p B_i\binom{p+1}{i}\frac{n^{p+1-i}}{p+1}.$$
See https://proofwiki.org/wiki/Faulhaber%27s_Formula and [orosi2018faulhaber] for
the proof provided here. -/
theorem sum_range_pow (n p : ℕ) :
    (∑ k ∈ range n, (k : ℚ) ^ p) =
      ∑ i ∈ range (p + 1), bernoulli i * ((p + 1).choose i) * (n : ℚ) ^ (p + 1 - i) / (p + 1)

∑ k ∈ Finset.range n, ↑k ^ p =
  ∑ i ∈ Finset.range (p + 1), bernoulli i * ↑((p + 1).choose i) * ↑n ^ (p + 1 - i) / (↑p + 1)


/-- Adding a vector to a point in the given subspace, then taking the
orthogonal projection, produces the original point if the vector was
in the orthogonal direction. -/
theorem orthogonalProjection_vadd_eq_self {s : AffineSubspace ℝ P} [Nonempty s]
    [HasOrthogonalProjection s.direction] {p : P} (hp : p ∈ s) {v : V} (hv : v ∈ s.directionᗮ) :
    orthogonalProjection s (v +ᵥ p) = ⟨p, hp⟩

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{s : AffineSubspace ℝ P}
[Nonempty ↥s]
[HasOrthogonalProjection s.direction]
{p : P}
(hp : p ∈ s)
{v : V}
(hv : v ∈ s.directionᗮ)

(EuclideanGeometry.orthogonalProjection s) (v +ᵥ p) = ⟨p, hp⟩


/-- Every nonempty list satisfying the chain condition gives a relation series-/
@[simps]
def fromListChain' (x : List α) (x_ne_nil : x ≠ []) (hx : x.Chain' r) : RelSeries r

{α : Type u_1}
{r : Rel α α}
(x : List α)
(x_ne_nil : x ≠ [])
(hx : List.Chain' r x)

∀ (a : Fin (x.length.pred + 1)), (RelSeries.fromListChain' x x_ne_nil hx).toFun a = (x.get ∘ Fin.cast ⋯) a


@[simp]
theorem inter_consecutive (n m l : ℕ) : Ico n m ∩ Ico m l = []


/-- Given an invariant measure then it gives the same mass to measurable sets with
compact closure as any other invariant measure, up to the scalar `haarScalarFactor μ' μ`.

Auxiliary lemma in the proof of the more general
`measure_isMulInvariant_eq_smul_of_isCompact_closure`, which removes the
measurability assumption. -/
@[to_additive measure_isAddInvariant_eq_smul_of_isCompact_closure_of_measurableSet
"Given an invariant measure then it gives the same mass to measurable sets with
compact closure as any other invariant measure, up to the scalar `addHaarScalarFactor μ' μ`.

Auxiliary lemma in the proof of the more general
`measure_isAddInvariant_eq_smul_of_isCompact_closure`, which removes the
measurability assumption."]
lemma measure_isMulInvariant_eq_smul_of_isCompact_closure_of_measurableSet [LocallyCompactSpace G]
    (μ' μ : Measure G) [IsHaarMeasure μ] [IsFiniteMeasureOnCompacts μ'] [IsMulLeftInvariant μ']
    {s : Set G} (hs : MeasurableSet s) (h's : IsCompact (closure s)) :
    μ' s = haarScalarFactor μ' μ • μ s


lemma egirth_anti : Antitone (egirth : SimpleGraph α → ℕ∞)


@[simp]
theorem rightDual_v [RightRigidCategory V] : Xᘁ.V = X.Vᘁ

(X : Action V ((CategoryTheory.forget₂ Grp MonCat).obj H))


@[to_additive (attr := simp)]
theorem map_eq_one_iff {M N} [MulOneClass M] [MulOneClass N] [EquivLike F M N] [MulEquivClass F M N]
    (h : F) {x : M} :
    h x = 1 ↔ x = 1

{F : Type u_1}
{M : Type u_12}
{N : Type u_13}
[MulOneClass M]
[MulOneClass N]
[EquivLike F M N]
[MulEquivClass F M N]
(h : F)
{x : M}


/-- By definition, the uniformity of `α →ᵤ β` admits the family `{(f, g) | ∀ x, (f x, g x) ∈ V}`
for `V ∈ 𝓤 β` as a filter basis. -/
protected theorem hasBasis_uniformity :
    (𝓤 (α →ᵤ β)).HasBasis (· ∈ 𝓤 β) (UniformFun.gen α β)

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

(𝓤 (α →ᵤ β)).HasBasis (fun x => x ∈ 𝓤 β) (UniformFun.gen α β)


theorem types_π_surjective (D : GlueData Type*) : Function.Surjective D.π

(D : CategoryTheory.GlueData (Type u_1))


/-- The terminal object in `Factorisation f`, with the codomain of `f` as its midpoint. -/
@[simps]
protected def terminal : Factorisation f

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


/-- The set of Liouville numbers is a residual set. -/
theorem eventually_residual_liouville : ∀ᶠ x in residual ℝ, Liouville x


lemma isLeftKanExtension_of_preservesColimits
    (L : (Cᵒᵖ ⥤ Type v₁) ⥤ ℰ) (e : A ≅ yoneda ⋙ L)
    [PreservesColimitsOfSize.{v₁, max u₁ v₁} L] :
    L.IsLeftKanExtension e.hom

(L : CategoryTheory.Functor (CategoryTheory.Functor Cᵒᵖ (Type v₁)) ℰ)

[CategoryTheory.Limits.PreservesColimitsOfSize.{v₁, max u₁ v₁, max u₁ v₁, v₁, max u₁ (v₁ + 1), u₂} L]


theorem nil_mem_one : [] ∈ (1 : Language α)


@[simp]
theorem mem_range [RingHomSurjective τ₁₂] {f : F} {x} : x ∈ range f ↔ ∃ y, f y = x

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


/-- The graph induced on `Set.univ` is isomorphic to the original graph. -/
@[simps!]
def induceUnivIso (G : SimpleGraph V) : G.induce Set.univ ≃g G

{V : Type u_1}
(G : SimpleGraph V)
(self : { x // x ∈ Set.univ })


@[simp]
theorem comp_assoc (f : C_c(γ, δ)) (g : β →co γ) (h : α →co β) :
    (f.comp g).comp h = f.comp (g.comp h)

{α : Type u_2}
{β : Type u_3}
{γ : Type u_4}
[TopologicalSpace α]
{δ : Type u_5}
[TopologicalSpace β]
[TopologicalSpace γ]
[TopologicalSpace δ]
[Zero δ]
(f : γ →C_c δ)
(g : CocompactMap β γ)
(h : CocompactMap α β)


@[simp]
theorem reCLM_coe : (reCLM : ℂ →ₗ[ℝ] ℝ) = reLm


theorem ne_of_disjoint_coe (h : Disjoint (I : Set (ι → ℝ)) J) : I ≠ J

{ι : Type u_1}
{I J : BoxIntegral.Box ι}
(h : Disjoint ↑I ↑J)


@[norm_cast, simp]
theorem coe_coprod [Module R₁ M₂] [Module R₁ M₃] [ContinuousAdd M₃] (f₁ : M₁ →L[R₁] M₃)
    (f₂ : M₂ →L[R₁] M₃) : (f₁.coprod f₂ : M₁ × M₂ →ₗ[R₁] M₃) = LinearMap.coprod f₁ f₂

{R₁ : Type u_1}
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
{M₃ : Type u_7}
[TopologicalSpace M₃]
[AddCommMonoid M₃]
[Module R₁ M₁]
[Module R₁ M₂]
[Module R₁ M₃]
[ContinuousAdd M₃]
(f₁ : M₁ →L[R₁] M₃)
(f₂ : M₂ →L[R₁] M₃)


lemma mkOfObjOfMapSucc_exists : ∃ (F : ComposableArrows C n) (e : ∀ i, F.obj i ≅ obj i),
    ∀ (i : ℕ) (hi : i < n), mapSucc ⟨i, hi⟩ =
      (e ⟨i, _⟩).inv ≫ F.map' i (i + 1) ≫ (e ⟨i + 1, _⟩).hom

(mapSucc : (i : Fin n) → obj i.castSucc ⟶ obj i.succ)

∃ F e,
  ∀ (i : ℕ) (hi : i < n),
    mapSucc ⟨i, hi⟩ =
      CategoryTheory.CategoryStruct.comp (e ⟨i, ⋯⟩).inv
        (CategoryTheory.CategoryStruct.comp (F.map' i (i + 1) ⋯ hi) (e ⟨i + 1, ⋯⟩).hom)


@[reassoc (attr := simp)]
lemma lift_f (hS : S.Exact) {A : C} (k : A ⟶ S.X₂) (hk : k ≫ S.g = 0) [Mono S.f] :
    hS.lift k hk ≫ S.f = k

(hk : CategoryTheory.CategoryStruct.comp k S.g = 0)

CategoryTheory.CategoryStruct.comp (hS.lift k hk) S.f = k


@[simp]
theorem mem_ite_empty_left (p : Prop) [Decidable p] (t : Set α) (x : α) :
    x ∈ ite p ∅ t ↔ ¬p ∧ x ∈ t

{α : Type u}
(p : Prop)
[Decidable p]
(t : Set α)
(x : α)


theorem tendsto_translationNumber_aux : Tendsto f.transnumAuxSeq atTop (𝓝 <| τ f)

Filter.Tendsto f.transnumAuxSeq Filter.atTop (𝓝 f.translationNumber)


/-- The **Hales-Jewett theorem**. This version has a restriction on universe levels which is
necessary for the proof. See `exists_mono_in_high_dimension` for a fully universe-polymorphic
version. -/
private theorem exists_mono_in_high_dimension' :
    ∀ (α : Type u) [Finite α] (κ : Type max v u) [Finite κ],
      ∃ (ι : Type) (_ : Fintype ι), ∀ C : (ι → α) → κ, ∃ l : Line α ι, l.IsMono C

(α : Type u)
[Finite α]
(κ : Type (max v u))
[Finite κ]

∃ ι x, ∀ (C : (ι → α) → κ), ∃ l, Combinatorics.Line.IsMono C l


/-- Restriction of scalars for linear maps between modules over a `k`-algebra is itself `k`-linear.
-/
@[simps]
def restrictScalarsLinearMap : (M →ₗ[A] N) →ₗ[k] M →ₗ[k] N

(k : Type u_1)
[CommSemiring k]
(A : Type u_2)
[Semiring A]
[Algebra k A]
(M : Type u_3)
[AddCommMonoid M]
[Module k M]
[Module A M]
[IsScalarTower k A M]
(N : Type u_4)
[AddCommMonoid N]
[Module k N]
[Module A N]
[IsScalarTower k A N]
(fₗ : M →ₗ[A] N)

(LinearMap.restrictScalarsLinearMap k A M N) fₗ = ↑k fₗ


theorem card_subtype_lt [Finite α] {p : α → Prop} {x : α} (hx : ¬p x) :
    Nat.card { x // p x } < Nat.card α

{α : Type u_1}
[Finite α]
{p : α → Prop}
{x : α}
(hx : ¬p x)


@[simp]
theorem neg_apply (f : ModularForm Γ k) (z : ℍ) : (-f) z = -f z

{Γ : Subgroup SL(2, ℤ)}
{k : ℤ}
(f : ModularForm Γ k)
(z : ℍ)


theorem Filter.HasBasis.equicontinuousAt_iff {κ₁ κ₂ : Type*} {p₁ : κ₁ → Prop} {s₁ : κ₁ → Set X}
    {p₂ : κ₂ → Prop} {s₂ : κ₂ → Set (α × α)} {F : ι → X → α} {x₀ : X} (hX : (𝓝 x₀).HasBasis p₁ s₁)
    (hα : (𝓤 α).HasBasis p₂ s₂) :
    EquicontinuousAt F x₀ ↔
      ∀ k₂, p₂ k₂ → ∃ k₁, p₁ k₁ ∧ ∀ x ∈ s₁ k₁, ∀ i, (F i x₀, F i x) ∈ s₂ k₂

{ι : Type u_1}
{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
{κ₁ : Type u_13}
{κ₂ : Type u_14}
{p₁ : κ₁ → Prop}
{s₁ : κ₁ → Set X}
{p₂ : κ₂ → Prop}
{s₂ : κ₂ → Set (α × α)}
{F : ι → X → α}
{x₀ : X}
(hX : (nhds x₀).HasBasis p₁ s₁)
(hα : (uniformity α).HasBasis p₂ s₂)

EquicontinuousAt F x₀ ↔ ∀ (k₂ : κ₂), p₂ k₂ → ∃ k₁, p₁ k₁ ∧ ∀ x ∈ s₁ k₁, ∀ (i : ι), (F i x₀, F i x) ∈ s₂ k₂


@[ext]
lemma hom_ext {X Y : CostructuredArrow S T} (f g : X ⟶ Y) (h : f.left = g.left) : f = g

{X Y : CategoryTheory.CostructuredArrow S T}


@[simp] lemma sdiff_singleton (s : LowerSet α) (a : α) : s.sdiff {a} = s.erase a

{α : Type u_1}
[Preorder α]
(s : LowerSet α)
(a : α)


theorem contDiff_add : ContDiff 𝕜 n fun p : F × F => p.1 + p.2

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}


@[simp, norm_cast]
theorem coe_imJ : (x : ℍ[R]).imJ = 0


theorem HasSum.smul_eq (hf : HasSum f s) (hg : HasSum g t)
    (hfg : HasSum (fun x : ι × κ ↦ f x.1 • g x.2) u) : s • t = u

(hfg : HasSum (fun x => f x.1 • g x.2) u)


theorem MDifferentiableAt.mul (hp : MDifferentiableAt I 𝓘(𝕜, F') p z)
    (hq : MDifferentiableAt I 𝓘(𝕜, F') q z) : MDifferentiableAt I 𝓘(𝕜, F') (p * q) z

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{z : M}
{F' : Type u_11}
[NormedRing F']
[NormedAlgebra 𝕜 F']
{p q : M → F'}
(hp : MDifferentiableAt I 𝓘(𝕜, F') p z)
(hq : MDifferentiableAt I 𝓘(𝕜, F') q z)


@[reassoc (attr := simp)]
lemma rightDerived_fac (G : D ⥤ H) (β : F ⟶ L ⋙ G) :
    α ≫ whiskerLeft L (RF.rightDerivedDesc α W G β) = β

{C : Type u_5}
{D : Type u_3}
{H : Type u_4}
[CategoryTheory.Category.{u_6, u_5} C]
[CategoryTheory.Category.{u_1, u_3} D]
[CategoryTheory.Category.{u_2, u_4} H]
(RF : CategoryTheory.Functor D H)
{F : CategoryTheory.Functor C H}
{L : CategoryTheory.Functor C D}
(α : F ⟶ L.comp RF)
(W : CategoryTheory.MorphismProperty C)
[L.IsLocalization W]
[RF.IsRightDerivedFunctor α W]
(G : CategoryTheory.Functor D H)
(β : F ⟶ L.comp G)

CategoryTheory.CategoryStruct.comp α (CategoryTheory.whiskerLeft L (RF.rightDerivedDesc α W G β)) = β


theorem dvd_of_one_le_padicValNat {n : ℕ} (hp : 1 ≤ padicValNat p n) : p ∣ n


@[simp]
theorem PreconnectedSpace.connectedComponent_eq_univ {X : Type*} [TopologicalSpace X]
    [h : PreconnectedSpace X] (x : X) : connectedComponent x = univ

{X : Type u_3}
[TopologicalSpace X]
[h : PreconnectedSpace X]
(x : X)


/-- There is a general version `le_bot_iff`, but this lemma does not require a `PartialOrder`. -/
@[simp]
protected theorem le_bot_iff : ∀ {a : WithBot α}, a ≤ ⊥ ↔ a = ⊥

a ≤ ⊥ ↔ a = ⊥


@[simp]
theorem map_powers {N : Type*} {F : Type*} [Monoid N] [FunLike F M N] [MonoidHomClass F M N]
    (f : F) (m : M) :
    (powers m).map f = powers (f m)

{M : Type u_1}
[Monoid M]
{N : Type u_4}
{F : Type u_5}
[Monoid N]
[FunLike F M N]
[MonoidHomClass F M N]
(f : F)
(m : M)

Submonoid.map f (Submonoid.powers m) = Submonoid.powers (f m)


@[to_additive]
theorem inv [Inv Y] ⦃f : X → Y⦄ (hf : IsLocallyConstant f) : IsLocallyConstant f⁻¹

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[Neg Y]
⦃f : X → Y⦄
(hf : IsLocallyConstant f)


@[simp]
theorem coprod_apply [Module R₁ M₂] [Module R₁ M₃] [ContinuousAdd M₃] (f₁ : M₁ →L[R₁] M₃)
    (f₂ : M₂ →L[R₁] M₃) (x) : f₁.coprod f₂ x = f₁ x.1 + f₂ x.2

{R₁ : Type u_1}
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
{M₃ : Type u_7}
[TopologicalSpace M₃]
[AddCommMonoid M₃]
[Module R₁ M₁]
[Module R₁ M₂]
[Module R₁ M₃]
[ContinuousAdd M₃]
(f₁ : M₁ →L[R₁] M₃)
(f₂ : M₂ →L[R₁] M₃)
(x : M₁ × M₂)


/-- Implementation of `Mon_.equivLaxMonoidalFunctorPUnit`. -/
@[simps]
def monToLaxMonoidal : Mon_ C ⥤ LaxMonoidalFunctor (Discrete PUnit.{u + 1}) C

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

((Mon_.EquivLaxMonoidalFunctorPUnit.monToLaxMonoidal C).obj A).ε = A.one


/-- The frontier of a closed strictly convex set only contains trivial arithmetic progressions.
The idea is that an arithmetic progression is contained on a line and the frontier of a strictly
convex set does not contain lines. -/
lemma threeAPFree_frontier {𝕜 E : Type*} [LinearOrderedField 𝕜] [TopologicalSpace E]
    [AddCommMonoid E] [Module 𝕜 E] {s : Set E} (hs₀ : IsClosed s) (hs₁ : StrictConvex 𝕜 s) :
    ThreeAPFree (frontier s)

{𝕜 : Type u_1}
{E : Type u_2}
[LinearOrderedField 𝕜]
[TopologicalSpace E]
[AddCommMonoid E]
[Module 𝕜 E]
{s : Set E}
(hs₀ : IsClosed s)
(hs₁ : StrictConvex 𝕜 s)


lemma pow_pos (ha : 0 < a) (n : ℕ) : 0 < a ^ n

{α : Type u}
[CanonicallyOrderedCommSemiring α]
{a : α}
(ha : 0 < a)
(n : ℕ)


theorem smul_mem_pointwise_smul (g : G) (x : K) (S : ValuationSubring K) : x ∈ S → g • x ∈ g • S

{K : Type u}
[Field K]
{G : Type u_1}
[Group G]
[MulSemiringAction G K]
(g : G)
(x : K)
(S : ValuationSubring K)


@[simp]
theorem _root_.Polynomial.toLaurent_X : (toLaurent Polynomial.X : R[T;T⁻¹]) = T 1

Polynomial.toLaurent Polynomial.X = LaurentPolynomial.T 1


@[to_additive (attr := simp)]
theorem index_bot : (⊥ : Subgroup G).index = Nat.card G


theorem add_left_neg_le_zero : ∀ x : PGame, -x + x ≤ 0


@[simp]
theorem Pi.default_def {β : α → Sort v} [∀ a, Inhabited (β a)] :
    @default (∀ a, β a) _ = fun a : α ↦ @default (β a) _

{α : Sort u_1}
{β : α → Sort v}
[(a : α) → Inhabited (β a)]


lemma gc_floorDiv_smul (ha : 0 < a) : GaloisConnection (a • · : β → β) (· ⌊/⌋ a)

{α : Type u_2}
{β : Type u_3}
[OrderedAddCommMonoid α]
[OrderedAddCommMonoid β]
[SMulZeroClass α β]
[FloorDiv α β]
{a : α}
(ha : 0 < a)

GaloisConnection (fun x => a • x) fun x => x ⌊/⌋ a


@[reassoc (attr := simp)]
theorem ofMkLE_comp_ofLEMk {B A₁ A₂ : C} (f : A₁ ⟶ B) [Mono f] (X : Subobject B) (g : A₂ ⟶ B)
    [Mono g] (h₁ : mk f ≤ X) (h₂ : X ≤ mk g) :
    ofMkLE f X h₁ ≫ ofLEMk X g h₂ = ofMkLEMk f g (h₁.trans h₂)

(h₁ : CategoryTheory.Subobject.mk f ≤ X)

(h₂ : X ≤ CategoryTheory.Subobject.mk g)

CategoryTheory.CategoryStruct.comp (CategoryTheory.Subobject.ofMkLE f X h₁) (X.ofLEMk g h₂) =
  CategoryTheory.Subobject.ofMkLEMk f g ⋯


@[to_additive]
protected lemma div_mul_left (h : IsUnit b) : b / (a * b) = 1 / a

{α : Type u}
[DivisionMonoid α]
{a b : α}
(h : IsUnit b)


@[simp]
theorem im_idem : a.im.im = a.im

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(a : ℍ[R,c₁,c₂])


theorem Filter.EventuallyLE.isLocalMinOn {f g : α → β} {a : α} (hle : f ≤ᶠ[𝓝[s] a] g)
    (hfga : f a = g a) (h : IsLocalMinOn f s a) : IsLocalMinOn g s a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder β]
{s : Set α}
{f g : α → β}
{a : α}
(hle : f ≤ᶠ[𝓝[s] a] g)
(hfga : f a = g a)
(h : IsLocalMinOn f s a)


theorem iCondIndepFun.condIndepFun_prod_mk {β : ι → Type*}
    {m : ∀ i, MeasurableSpace (β i)} {f : ∀ i, Ω → β i} (hf_Indep : iCondIndepFun m' hm' m f μ)
    (hf_meas : ∀ i, Measurable (f i)) (i j k : ι) (hik : i ≠ k) (hjk : j ≠ k) :
    CondIndepFun m' hm' (fun a => (f i a, f j a)) (f k) μ

(hf_Indep : ProbabilityTheory.iCondIndepFun m' hm' m f μ)

ProbabilityTheory.CondIndepFun m' hm' (fun a => (f i a, f j a)) (f k) μ


theorem image_eq_inter_preimage_of_subset_support {s : Set M} (hs : s ⊆ support f) :
    extChartAt I c '' s =
      closedBall (extChartAt I c c) f.rOut ∩ range I ∩ (extChartAt I c).symm ⁻¹' s

{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{c : M}
(f : SmoothBumpFunction I c)
{s : Set M}
(hs : s ⊆ Function.support ↑f)

↑(extChartAt I c) '' s = Metric.closedBall (↑(extChartAt I c) c) f.rOut ∩ Set.range ↑I ∩ ↑(extChartAt I c).symm ⁻¹' s


@[simp]
theorem mul_antipode_rTensor_comul_apply (a : A) :
    LinearMap.mul' R A (antipode.rTensor A (Coalgebra.comul a)) =
    algebraMap R A (Coalgebra.counit a)

{R : Type u}
{A : Type v}
[CommSemiring R]
[Semiring A]
[HopfAlgebra R A]
(a : A)

(LinearMap.mul' R A) ((LinearMap.rTensor A HopfAlgebra.antipode) (Coalgebra.comul a)) =
  (algebraMap R A) (Coalgebra.counit a)


theorem disjoint_compl_left_iff : Disjoint xᶜ y ↔ y ≤ x

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


theorem add_eq_left_addition (f g : X ⟶ Y) : f + g = biprod.lift f g ≫ biprod.desc (𝟙 Y) (𝟙 Y)

f + g = CategoryTheory.Limits.biprod.lift f g ≫ CategoryTheory.Limits.biprod.desc (𝟙 Y) (𝟙 Y)


/-- Variant of the mean value inequality on a convex set. Version with `fderivWithin`. -/
theorem norm_image_sub_le_of_norm_fderivWithin_le' (hf : DifferentiableOn 𝕜 f s)
    (bound : ∀ x ∈ s, ‖fderivWithin 𝕜 f s x - φ‖ ≤ C) (hs : Convex ℝ s) (xs : x ∈ s) (ys : y ∈ s) :
    ‖f y - f x - φ (y - x)‖ ≤ C * ‖y - x‖


/-- Given two morphisms of complexes `φ₁ φ₂ : F ⟶ G`, the datum of an homotopy between `φ₁` and
`φ₂` is equivalent to the datum of a `1`-cochain `z` such that `δ (-1) 0 z` is the difference
of the zero cochains associated to `φ₂` and `φ₁`. -/
@[simps]
def equivHomotopy (φ₁ φ₂ : F ⟶ G) :
    Homotopy φ₁ φ₂ ≃
      { z : Cochain F G (-1) // Cochain.ofHom φ₁ = δ (-1) 0 z + Cochain.ofHom φ₂ }

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
{F G : CochainComplex C ℤ}
(φ₁ φ₂ : F ⟶ G)
(ho : Homotopy φ₁ φ₂)

↑((CochainComplex.HomComplex.Cochain.equivHomotopy φ₁ φ₂) ho) = CochainComplex.HomComplex.Cochain.ofHomotopy ho


lemma Nat.cast_ringChar : (ringChar R : R) = 0


@[to_additive]
theorem IsLowerSet.mul_right (hs : IsLowerSet s) : IsLowerSet (s * t)

{α : Type u_1}
[OrderedCommGroup α]
{s t : Set α}
(hs : IsLowerSet s)


@[to_additive (attr := simp)]
lemma coe_comp {X Y Z : Grp} {f : X ⟶ Y} {g : Y ⟶ Z} : (f ≫ g : X → Z) = g ∘ f

{X Y Z : AddGrp}
{f : X ⟶ Y}
{g : Y ⟶ Z}


@[simp]
theorem continuousLinearEquivAt_apply' (e : Trivialization F (π F E)) [e.IsLinear R]
    (x : TotalSpace F E) (hx : x ∈ e.source) :
    e.continuousLinearEquivAt R x.proj (e.mem_source.1 hx) x.2 = (e x).2

[TopologicalSpace (Bundle.TotalSpace F E)]

(e : Trivialization F Bundle.TotalSpace.proj)

(Trivialization.continuousLinearEquivAt R e x.proj ⋯) x.snd = (↑e x).2


/-- The natural isomorphism between opposite functors `G.op ≅ F.op` induced by a natural
isomorphism between the original functors `F ≅ G`. -/
@[simps]
protected def op (α : F ≅ G) : G.op ≅ F.op

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

(CategoryTheory.NatIso.op α).inv = CategoryTheory.NatTrans.op α.inv


theorem mul_divByMonic_cancel_left (p : R[X]) {q : R[X]} (hmo : q.Monic) :
    q * p /ₘ q = p

{R : Type u}
[Ring R]
(p : R[X])
{q : R[X]}
(hmo : q.Monic)


@[simp]
theorem forget₂_algebra_obj (X : BialgebraCat R) :
    (forget₂ (BialgebraCat R) (AlgebraCat R)).obj X = AlgebraCat.of R X

{R : Type u}
[CommRing R]
(X : BialgebraCat R)

(CategoryTheory.forget₂ (BialgebraCat R) (AlgebraCat R)).obj X = AlgebraCat.of R ↑X.toBundled


/-- Transferring from `Field` to `IsField`. -/
theorem Field.toIsField (R : Type u) [Field R] : IsField R


@[to_additive (attr := simp)]
theorem coprod_comp_inl : (f.coprod g).comp (inl M N) = f

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

(f.coprod g).comp (AddMonoidHom.inl M N) = f


@[to_additive]
theorem Pi.semiconjBy_iff {x y z : ∀ i, f i} :
    SemiconjBy x y z ↔ ∀ i, SemiconjBy (x i) (y i) (z i)

{I : Type u}
{f : I → Type v}
[(i : I) → Mul (f i)]
{x y z : (i : I) → f i}

SemiconjBy x y z ↔ ∀ (i : I), SemiconjBy (x i) (y i) (z i)


theorem toNNReal_iInf (hf : ∀ i, f i ≠ ∞) : (iInf f).toNNReal = ⨅ i, (f i).toNNReal

{ι : Sort u_1}
{f : ι → ℝ≥0∞}
(hf : ∀ (i : ι), f i ≠ ⊤)


/-- `AEEqFun.toGerm` as a `MonoidHom`. -/
@[to_additive (attr := simps) "`AEEqFun.toGerm` as an `AddMonoidHom`."]
def toGermMonoidHom : (α →ₘ[μ] γ) →* (ae μ).Germ γ

{α : Type u_1}
{γ : Type u_3}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[TopologicalSpace γ]
[AddMonoid γ]
[ContinuousAdd γ]
(f : α →ₘ[μ] γ)

MeasureTheory.AEEqFun.toGermAddMonoidHom f = f.toGerm


/-- Subsets of bounded sets are bounded. -/
theorem IsVonNBounded.subset {s₁ s₂ : Set E} (h : s₁ ⊆ s₂) (hs₂ : IsVonNBounded 𝕜 s₂) :
    IsVonNBounded 𝕜 s₁

{𝕜 : Type u_1}
{E : Type u_3}
[SeminormedRing 𝕜]
[SMul 𝕜 E]
[Zero E]
[TopologicalSpace E]
{s₁ s₂ : Set E}
(h : s₁ ⊆ s₂)
(hs₂ : Bornology.IsVonNBounded 𝕜 s₂)


@[simp]
theorem Finsupp.toDFinsupp_single (i : ι) (m : M) :
    (Finsupp.single i m).toDFinsupp = DFinsupp.single i m

{ι : Type u_1}
{M : Type u_3}
[DecidableEq ι]
[Zero M]
(i : ι)
(m : M)


@[simp]
theorem subtypeDomain_apply [∀ i, Zero (β i)] {p : ι → Prop} [DecidablePred p] {i : Subtype p}
    {v : Π₀ i, β i} : (subtypeDomain p v) i = v i

{ι : Type u}
{β : ι → Type v}
[(i : ι) → Zero (β i)]
{p : ι → Prop}
[DecidablePred p]
{i : Subtype p}
{v : Π₀ (i : ι), β i}


/-- The change-of-basis matrix between two orthonormal bases `a`, `b` is an orthogonal matrix. -/
theorem OrthonormalBasis.toMatrix_orthonormalBasis_mem_orthogonal :
    a.toBasis.toMatrix b ∈ Matrix.orthogonalGroup ι ℝ

{ι : Type u_1}
{F : Type u_6}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
[Fintype ι]
[DecidableEq ι]
(a b : OrthonormalBasis ι ℝ F)

a.toBasis.toMatrix ⇑b ∈ Matrix.orthogonalGroup ι ℝ


protected theorem sUnion {s : Set (Set α)} (hs : s.Countable) (h : ∀ t ∈ s, NullMeasurableSet t μ) :
    NullMeasurableSet (⋃₀ s) μ

(h : ∀ t ∈ s, MeasureTheory.NullMeasurableSet t μ)

MeasureTheory.NullMeasurableSet (⋃₀ s) μ


@[simp] theorem toNat_zero_length (x : BitVec 0) : x.toNat = 0


theorem torusMap_eq_center_iff {c : ℂⁿ} {R : ℝⁿ} {θ : ℝⁿ} : torusMap c R θ = c ↔ R = 0

{n : ℕ}
{c : Fin n → ℂ}
{R θ : Fin n → ℝ}


lemma isRegular_iff_coeff_polyCharpoly_rank_ne_zero :
    IsRegular R x ↔
    MvPolynomial.eval (b.repr x)
      ((polyCharpoly (ad R L).toLinearMap b).coeff (rank R L)) ≠ 0

(R : Type u_1)
{L : Type u_3}
{ι : Type u_5}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[Module.Finite R L]
[Module.Free R L]
[Fintype ι]
[DecidableEq ι]
(b : Basis ι R L)
(x : L)

LieAlgebra.IsRegular R x ↔
  (MvPolynomial.eval ⇑(b.repr x)) (((↑(LieAlgebra.ad R L)).polyCharpoly b).coeff (LieAlgebra.rank R L)) ≠ 0


/-- For any principal segment `r ≺i s`, there is a `Subrel` of `s` order isomorphic to `r`. -/
@[simps! symm_apply]
noncomputable def subrelIso (f : r ≺i s) : Subrel s {b | s b f.top} ≃r r

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
(f : r ≺i s)

∀ (a : α), f.subrelIso.symm a = (Equiv.setCongr ⋯) ⟨f.toRelEmbedding a, ⋯⟩


theorem sdiff_eq_self_of_disjoint (h : Disjoint s t) : s \ t = s

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


/-- If self-maps `f` and `g` commute, then they are inverse of each other on the set of fixed points
of `f ∘ g`. This is a particular case of `Function.invOn_fixedPoints_comp`. -/
theorem Commute.invOn_fixedPoints_comp (h : Commute f g) :
    Set.InvOn f g (fixedPoints <| f ∘ g) (fixedPoints <| f ∘ g)

{α : Type u}
{f g : α → α}
(h : Function.Commute f g)

Set.InvOn f g (Function.fixedPoints (f ∘ g)) (Function.fixedPoints (f ∘ g))