@[simp]
theorem center_toNonUnitalSubalgebra :
    (center R A).toNonUnitalSubalgebra = NonUnitalSubalgebra.center R A

(R : Type u)
(A : Type v)
[CommSemiring R]
[NonUnitalSemiring A]
[StarRing A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]

(NonUnitalStarSubalgebra.center R A).toNonUnitalSubalgebra = NonUnitalSubalgebra.center R A


theorem spanningCoe_inj : G₁.spanningCoe = G₂.spanningCoe ↔ G₁.Adj = G₂.Adj

{V : Type u}
{G : SimpleGraph V}
{G₁ G₂ : G.Subgraph}


@[to_additive]
theorem comap_le_comap_of_le_range {f : G →* N} {K L : Subgroup N} (hf : K ≤ f.range) :
    K.comap f ≤ L.comap f ↔ K ≤ L

{G : Type u_1}
[AddGroup G]
{N : Type u_5}
[AddGroup N]
{f : G →+ N}
{K L : AddSubgroup N}
(hf : K ≤ f.range)

AddSubgroup.comap f K ≤ AddSubgroup.comap f L ↔ K ≤ L


theorem eq_univ_of_forall {s : Set α} : (∀ x, x ∈ s) → s = univ


/-- If `g` semiconjugates `fa` to `fb`, then it sends fixed points of `fa` to fixed points
of `fb`. -/
theorem Semiconj.mapsTo_fixedPoints {g : α → β} (h : Semiconj g fa fb) :
    Set.MapsTo g (fixedPoints fa) (fixedPoints fb)

{α : Type u}
{β : Type v}
{fa : α → α}
{fb : β → β}
{g : α → β}
(h : Function.Semiconj g fa fb)

Set.MapsTo g (Function.fixedPoints fa) (Function.fixedPoints fb)


theorem AEStronglyMeasurable.convolution_integrand_snd'
    (hf : AEStronglyMeasurable f μ) {x : G}
    (hg : AEStronglyMeasurable g <| map (fun t => x - t) μ) :
    AEStronglyMeasurable (fun t => L (f t) (g (x - t))) μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

(hg : MeasureTheory.AEStronglyMeasurable g (MeasureTheory.Measure.map (fun t => x - t) μ))

MeasureTheory.AEStronglyMeasurable (fun t => (L (f t)) (g (x - t))) μ


protected theorem injective : Injective e

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
(e : E ≃ₛₗᵢ[σ₁₂] E₂)


@[simp]
theorem frobenius_zmod (p : ℕ) [Fact p.Prime] : frobenius (ZMod p) p = RingHom.id _

frobenius (ZMod p) p = RingHom.id (ZMod p)


@[simp]
theorem sin_two_pi : sin (2 * π) = 0


theorem sigmaCongrRight_trans {α} {β₁ β₂ β₃ : α → Type*}
    (F : ∀ a, β₁ a ≃ β₂ a) (G : ∀ a, β₂ a ≃ β₃ a) :
    (sigmaCongrRight F).trans (sigmaCongrRight G) =
      sigmaCongrRight fun a => (F a).trans (G a)

{α : Type u_4}
{β₁ : α → Type u_1}
{β₂ : α → Type u_2}
{β₃ : α → Type u_3}
(F : (a : α) → β₁ a ≃ β₂ a)
(G : (a : α) → β₂ a ≃ β₃ a)

(Equiv.sigmaCongrRight F).trans (Equiv.sigmaCongrRight G) = Equiv.sigmaCongrRight fun a => (F a).trans (G a)


/-- **Gram-Schmidt Orthonormalization**:
`gramSchmidtNormed` produces an orthornormal system of vectors after removing the vectors which
become zero in the process. -/
theorem gramSchmidt_orthonormal' (f : ι → E) :
    Orthonormal 𝕜 fun i : { i | gramSchmidtNormed 𝕜 f i ≠ 0 } => gramSchmidtNormed 𝕜 f i

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_3}
[LinearOrder ι]
[LocallyFiniteOrderBot ι]
[IsWellOrder ι fun x x_1 => x < x_1]
(f : ι → E)

Orthonormal 𝕜 fun i => gramSchmidtNormed 𝕜 f ↑i


@[simp]
theorem apply_toDualLeft_symm_apply (f : Dual R N) (x : N) : p (p.toDualLeft.symm f) x = f x

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(p : PerfectPairing R M N)
(f : Module.Dual R N)
(x : N)


/-- The cosine of an angle in a right-angled triangle multiplied by the hypotenuse equals the
adjacent side. -/
theorem cos_oangle_add_left_mul_norm_of_oangle_eq_pi_div_two {x y : V}
    (h : o.oangle x y = ↑(π / 2)) : Real.Angle.cos (o.oangle (x + y) y) * ‖x + y‖ = ‖y‖

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

(o.oangle (x + y) y).cos * ‖x + y‖ = ‖y‖


/-- Given a bifunctor `F : C₁ ⥤ C₂ ⥤ C₃` and types `I` and `J`, this is the obvious
functor `GradedObject I C₁ ⥤ GradedObject J C₂ ⥤ GradedObject (I × J) C₃`. -/
@[simps]
def mapBifunctor (I J : Type*) :
    GradedObject I C₁ ⥤ GradedObject J C₂ ⥤ GradedObject (I × J) C₃

(F : CategoryTheory.Functor C₁ (CategoryTheory.Functor C₂ C₃))

((CategoryTheory.GradedObject.mapBifunctor F I J).obj X).obj Y ij = (F.obj (X ij.1)).obj (Y ij.2)


/-- Specialization of `Finset.prod_bij` that automatically fills in most arguments.

See `Fintype.prod_bijective` for the version where `s` and `t` are `univ`. -/
@[to_additive "`Specialization of `Finset.sum_bij` that automatically fills in most arguments.

See `Fintype.sum_bijective` for the version where `s` and `t` are `univ`."]
lemma prod_bijective (e : ι → κ) (he : e.Bijective) (hst : ∀ i, i ∈ s ↔ e i ∈ t)
    (hfg : ∀ i ∈ s, f i = g (e i)) :
    ∏ i ∈ s, f i = ∏ i ∈ t, g i

{ι : Type u_6}
{κ : Type u_7}
{α : Type u_8}
[AddCommMonoid α]
{s : Finset ι}
{t : Finset κ}
{f : ι → α}
{g : κ → α}
(e : ι → κ)
(he : Function.Bijective e)
(hst : ∀ (i : ι), i ∈ s ↔ e i ∈ t)
(hfg : ∀ i ∈ s, f i = g (e i))


@[simp, bv_toNat] theorem toNat_truncate (x : BitVec n) : (truncate i x).toNat = x.toNat % 2^i

(BitVec.truncate i x).toNat = x.toNat % 2 ^ i


@[simp, mfld_simps]
theorem modelWithCornersSelf_coe : (𝓘(𝕜, E) : E → E) = id

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
(E : Type u_2)
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]


theorem nonempty_algHom_of_adjoin_splits : Nonempty (E →ₐ[F] K)

(hK : ∀ s ∈ S, IsIntegral F s ∧ Polynomial.Splits (algebraMap F K) (minpoly F s))


@[simp]
theorem natPred_inj {m n : ℕ+} : m.natPred = n.natPred ↔ m = n


/-- The **closed graph theorem** : a linear map between two Banach spaces whose graph is closed
is continuous. -/
theorem LinearMap.continuous_of_isClosed_graph (hg : IsClosed (g.graph : Set <| E × F)) :
    Continuous g

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace E]
{F : Type u_5}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
(g : E →ₗ[𝕜] F)
(hg : IsClosed ↑g.graph)


lemma measurableSet_succ_countablePartition (n : ℕ) {s : Set α} (hs : s ∈ countablePartition α n) :
    MeasurableSet[generateFrom (countablePartition α (n + 1))] s

[h : MeasurableSpace.CountablyGenerated α]

(hs : s ∈ MeasurableSpace.countablePartition α n)


@[simp]
lemma equicontinuousOn_empty [IsEmpty ι] (F : ι → X → α) (S : Set X) :
    EquicontinuousOn F S

{ι : Type u_1}
{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
[IsEmpty ι]
(F : ι → X → α)
(S : Set X)


/-- The `p`-primary component is the subgroup of elements with order prime-power of `p`. -/
@[to_additive (attr := simps!)
      "The `p`-primary component is the subgroup of elements with additive order
      prime-power of `p`."]
def primaryComponent : Subgroup G

(G : Type u_1)
[AddCommGroup G]
(p : ℕ)
[hp : Fact (Nat.Prime p)]

↑(AddCommGroup.primaryComponent G p) = {g | ∃ n, addOrderOf g = p ^ n}


/-- If `X` is isomorphic to `X₁` and `Y` is isomorphic to `Y₁`, then
there is a natural bijection between `X ⟶ Y` and `X₁ ⟶ Y₁`. See also `Equiv.arrowCongr`. -/
@[simps]
def homCongr {X Y X₁ Y₁ : C} (α : X ≅ X₁) (β : Y ≅ Y₁) : (X ⟶ Y) ≃ (X₁ ⟶ Y₁)

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

(α.homCongr β).symm f = CategoryTheory.CategoryStruct.comp α.hom (CategoryTheory.CategoryStruct.comp f β.inv)


lemma centerToCentroidCenter_apply (z : NonUnitalSubsemiring.center α) (a : α) :
    (centerToCentroidCenter z) a = z * a

{α : Type u_5}
[NonUnitalNonAssocSemiring α]
(z : ↥(NonUnitalSubsemiring.center α))
(a : α)

(CentroidHom.centerToCentroidCenter z) a = ↑z * a


@[to_additive] lemma eq_iff_eq_of_mul_eq_mul (h : a * b = c * d) : a = c ↔ b = d

{α : Type u_1}
[CancelCommMonoid α]
{a b c d : α}
(h : a * b = c * d)


@[to_additive]
theorem orbit_eq_iff {a b : α} : orbit G a = orbit G b ↔ a ∈ orbit G b

{G : Type u_1}
{α : Type u_2}
[AddGroup G]
[AddAction G α]
{a b : α}

AddAction.orbit G a = AddAction.orbit G b ↔ a ∈ AddAction.orbit G b


theorem trivializationAt_eq_localTriv (x : M) :
    trivializationAt E (TangentSpace I) x =
      (tangentBundleCore I M).toFiberBundleCore.localTriv (achart H x)

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


theorem finrank_submodule (v : ℙ K V) : finrank K v.submodule = 1

{K : Type u_1}
{V : Type u_2}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
(v : Projectivization K V)

FiniteDimensional.finrank K ↥v.submodule = 1


@[simp] theorem zero_eta : (⟨0, Nat.zero_lt_succ _⟩ : Fin (n + 1)) = 0


theorem findIdx_lt_length {p : α → Bool} {xs : List α} :
    xs.findIdx p < xs.length ↔ ∃ x ∈ xs, p x

{α : Type u}
{p : α → Bool}
{xs : List α}

List.findIdx p xs < xs.length ↔ ∃ x ∈ xs, p x = true


theorem map_valEmbedding_univ : (Finset.univ : Finset (Fin n)).map Fin.valEmbedding = Iio n

Finset.map Fin.valEmbedding Finset.univ = Finset.Iio n


@[to_additive]
lemma mem_stabilizer_finset_iff_smul_finset_subset {s : Finset α} :
    a ∈ stabilizer G s ↔ a • s ⊆ s

{G : Type u_1}
{α : Type u_3}
[AddGroup G]
[AddAction G α]
{a : G}
[DecidableEq α]
{s : Finset α}

a ∈ AddAction.stabilizer G s ↔ a +ᵥ s ⊆ s


theorem mkRat_mul_right {a : Nat} (a0 : a ≠ 0) : mkRat (n * a) (d * a) = mkRat n d


@[simp] lemma emod_two_ne_one : ¬n % 2 = 1 ↔ n % 2 = 0


protected theorem ext' {f₁ f₂ : Filter α}
    (h : ∀ p : α → Prop, (∀ᶠ x in f₁, p x) ↔ ∀ᶠ x in f₂, p x) : f₁ = f₂

(h : ∀ (p : α → Prop), (∀ᶠ (x : α) in f₁, p x) ↔ ∀ᶠ (x : α) in f₂, p x)


/-- If for any finitely generated submodules `M'` and `N'` of `M` and `N`, respectively,
`M'` and `N'` are linearly disjoint, then `M` and `N` themselves are linearly disjoint. -/
theorem of_linearDisjoint_fg
    (H : ∀ (M' N' : Submodule R S), M' ≤ M → N' ≤ N → M'.FG → N'.FG → M'.LinearDisjoint N') :
    M.LinearDisjoint N


/-- The sum along the antidiagonal of `(n+1).choose i * f i j` can be split into two sums along the
antidiagonal at rank `n`, respectively of `n.choose i * f i (j+1)` and `n.choose j * f (i+1) j`. -/
theorem sum_antidiagonal_choose_succ_mul (f : ℕ → ℕ → R) (n : ℕ) :
    (∑ ij ∈ antidiagonal (n + 1), ((n + 1).choose ij.1 : R) * f ij.1 ij.2) =
      (∑ ij ∈ antidiagonal n, (n.choose ij.1 : R) * f ij.1 (ij.2 + 1)) +
        ∑ ij ∈ antidiagonal n, (n.choose ij.2 : R) * f (ij.1 + 1) ij.2

{R : Type u_3}
[NonAssocSemiring R]
(f : ℕ → ℕ → R)
(n : ℕ)

∑ ij ∈ Finset.antidiagonal (n + 1), ↑((n + 1).choose ij.1) * f ij.1 ij.2 =
  ∑ ij ∈ Finset.antidiagonal n, ↑(n.choose ij.1) * f ij.1 (ij.2 + 1) +
    ∑ ij ∈ Finset.antidiagonal n, ↑(n.choose ij.2) * f (ij.1 + 1) ij.2


theorem finRotate_succ_eq_decomposeFin {n : ℕ} :
    finRotate n.succ = decomposeFin.symm (1, finRotate n)

finRotate n.succ = Equiv.Perm.decomposeFin.symm (1, finRotate n)


theorem integral_eq_integral (f : α →₁ₛ[μ] E) : integral f = (toSimpleFunc f).integral μ

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

MeasureTheory.L1.SimpleFunc.integral f =
  MeasureTheory.SimpleFunc.integral μ (MeasureTheory.Lp.simpleFunc.toSimpleFunc f)


@[reassoc (attr := simp)]
theorem biproduct.fromSubtype_toSubtype :
    biproduct.fromSubtype f p ≫ biproduct.toSubtype f p = 𝟙 (⨁ Subtype.restrict p f)

[CategoryTheory.Limits.HasBiproduct (Subtype.restrict p f)]

CategoryTheory.Limits.biproduct.fromSubtype f p ≫ CategoryTheory.Limits.biproduct.toSubtype f p =
  𝟙 (⨁ Subtype.restrict p f)


@[simp]
theorem coe_addEquiv_trans (e₁ : R ≃+* S) (e₂ : S ≃+* S') :
    (e₁.trans e₂ : R ≃+ S') = (e₁ : R ≃+ S).trans ↑e₂

{R : Type u_4}
{S : Type u_5}
{S' : Type u_6}
[Mul R]
[Mul S]
[Add R]
[Add S]
[Mul S']
[Add S']
(e₁ : R ≃+* S)
(e₂ : S ≃+* S')


@[simp, norm_cast]
theorem cast_le_one : (n : α) ≤ 1 ↔ n ≤ 1

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

↑n ≤ 1 ↔ n ≤ 1


/-- Cancel left multiplication in the modulus.

For cancelling left multiplication on both sides of the `≡`, see `nat.modeq.mul_left_cancel'`. -/
lemma of_mul_left (m : ℕ) (h : a ≡ b [MOD m * n]) : a ≡ b [MOD n]

{n a b : ℕ}
(m : ℕ)
(h : a ≡ b [MOD m * n])


/-- Any two nonzero left-invariant measures are absolutely continuous w.r.t. each other. -/
@[to_additive
" Any two nonzero left-invariant measures are absolutely continuous w.r.t. each other. "]
theorem absolutelyContinuous_of_isMulLeftInvariant [IsMulLeftInvariant ν] (hν : ν ≠ 0) : μ ≪ ν

{G : Type u_1}
[MeasurableSpace G]
[Group G]
[MeasurableMul₂ G]
(μ ν : MeasureTheory.Measure G)
[MeasureTheory.SFinite ν]
[MeasureTheory.SFinite μ]
[MeasurableInv G]
[μ.IsMulLeftInvariant]
[ν.IsMulLeftInvariant]
(hν : ν ≠ 0)


/-- (implementation) The forgetful functor from bundled actions to the underlying objects.

Use the `CategoryTheory.forget` API provided by the `ConcreteCategory` instance below,
rather than using this directly.
-/
@[simps]
def forget : Action V G ⥤ V

(V : Type (u + 1))
[CategoryTheory.LargeCategory V]
(G : MonCat)
(M : Action V G)


/-- The preimage of a star-convex set under an affine map is star-convex. -/
theorem StarConvex.affine_preimage (f : E →ᵃ[𝕜] F) {s : Set F} (hs : StarConvex 𝕜 (f x) s) :
    StarConvex 𝕜 x (f ⁻¹' s)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[OrderedRing 𝕜]
[AddCommGroup E]
[AddCommGroup F]
[Module 𝕜 E]
[Module 𝕜 F]
{x : E}
(f : E →ᵃ[𝕜] F)
{s : Set F}
(hs : StarConvex 𝕜 (f x) s)


lemma isIntegralCurve_comp_mul_ne_zero {a : ℝ} (ha : a ≠ 0) :
    IsIntegralCurve γ v ↔ IsIntegralCurve (γ ∘ (· * a)) (a • v)

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{H : Type u_2}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type u_3}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{γ : ℝ → M}
{v : (x : M) → TangentSpace I x}
{a : ℝ}
(ha : a ≠ 0)

IsIntegralCurve γ v ↔ IsIntegralCurve (γ ∘ fun x => x * a) (a • v)


lemma exact_succ (n : ℕ) :
    (ShortComplex.mk _ _ (P.complex.d_comp_d (n + 2) (n + 1) n)).Exact

(P : CategoryTheory.ProjectiveResolution Z)

(CategoryTheory.ShortComplex.mk (P.complex.d (n + 2) (n + 1)) (P.complex.d (n + 1) n) ⋯).Exact


theorem ssubset_cons (h : a ∉ s) : s ⊂ s.cons a h

{α : Type u_1}
{s : Finset α}
{a : α}
(h : a ∉ s)


@[simp]
theorem ofNat_le_card {o} {n : ℕ} [n.AtLeastTwo] :
    (no_index (OfNat.ofNat n : Cardinal)) ≤ card o ↔ (OfNat.ofNat n : Ordinal) ≤ o

{o : Ordinal.{u_3}}
{n : ℕ}
[n.AtLeastTwo]

OfNat.ofNat n ≤ o.card ↔ OfNat.ofNat n ≤ o


theorem MulPosReflectLT.toMulPosMono [MulPosReflectLT α] : MulPosMono α

{α : Type u_1}
[Mul α]
[Zero α]
[LinearOrder α]
[MulPosReflectLT α]


@[simp] theorem mem_of_find?_eq_some : ∀ {l}, find? p l = some a → a ∈ l

∀ {α : Type u_1} {p : α → Bool} {a : α} {l : List α}, List.find? p l = some a → a ∈ l


@[simp]
theorem incl_mk_nat_card (n : ℕ) : Fintype.card (incl.obj (mk n)) = n

Fintype.card ↑(FintypeCat.Skeleton.incl.obj (FintypeCat.Skeleton.mk n)) = n


@[to_additive (attr := ext)]
theorem OneHom.ext [One M] [One N] ⦃f g : OneHom M N⦄ (h : ∀ x, f x = g x) : f = g

{M : Type u_4}
{N : Type u_5}
[Zero M]
[Zero N]
⦃f g : ZeroHom M N⦄
(h : ∀ (x : M), f x = g x)


@[simp] lemma castLE_rfl (n : ℕ) : Fin.castLE (le_refl n) = id


lemma equation_of_equiv {P Q : Fin 3 → R} (h : P ≈ Q) : W'.Equation P ↔ W'.Equation Q

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


lemma div_nonpos_of_nonneg_of_nonpos [PosMulMono α] (ha : 0 ≤ a) (hb : b ≤ 0) : a / b ≤ 0

{α : Type u_1}
[Semifield α]
[LinearOrder α]
[PosMulReflectLT α]
[ZeroLEOneClass α]
{a b : α}
[PosMulMono α]
(ha : 0 ≤ a)
(hb : b ≤ 0)


@[reassoc (attr := simp)]
theorem app_invApp (U : Opens Y) :
    f.c.app (op U) ≫ H.invApp ((Opens.map f.base).obj U) =
      Y.presheaf.map
        ((homOfLE (Set.image_preimage_subset f.base U.1)).op :
          op U ⟶ op (opensFunctor f |>.obj ((Opens.map f.base).obj U)))

{X Y : AlgebraicGeometry.SheafedSpace C}

[H : AlgebraicGeometry.SheafedSpace.IsOpenImmersion f]

(U : TopologicalSpace.Opens ↑↑Y.toPresheafedSpace)

f.c.app (Opposite.op U) ≫
    AlgebraicGeometry.SheafedSpace.IsOpenImmersion.invApp f ((TopologicalSpace.Opens.map f.base).obj U) =
  Y.presheaf.map (CategoryTheory.homOfLE ⋯).op


theorem generated_le_generatedNormal : generated X ≤ generatedNormal X

{C : Type u}
[CategoryTheory.Groupoid C]
(X : (c d : C) → Set (c ⟶ d))

CategoryTheory.Subgroupoid.generated X ≤ CategoryTheory.Subgroupoid.generatedNormal X


/-- The composition of morphisms of squares. -/
@[simps]
def comp {sq₁ sq₂ sq₃ : Square C} (f : Hom sq₁ sq₂) (g : Hom sq₂ sq₃) : Hom sq₁ sq₃

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{sq₁ sq₂ sq₃ : CategoryTheory.Square C}
(f : sq₁.Hom sq₂)
(g : sq₂.Hom sq₃)

(f.comp g).τ₄ = CategoryTheory.CategoryStruct.comp f.τ₄ g.τ₄


theorem monic_map_iff [Semiring S] [Nontrivial S] {f : R →+* S} {p : R[X]} :
    (p.map f).Monic ↔ p.Monic

{R : Type u}
{S : Type v}
[DivisionRing R]
[Semiring S]
[Nontrivial S]
{f : R →+* S}
{p : R[X]}


/-- An inner product with a sum on the left, `Finsupp` version. -/
theorem Finsupp.sum_inner {ι : Type*} (l : ι →₀ 𝕜) (v : ι → E) (x : E) :
    ⟪l.sum fun (i : ι) (a : 𝕜) => a • v i, x⟫ = l.sum fun (i : ι) (a : 𝕜) => conj a • ⟪v i, x⟫

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_4}
(l : ι →₀ 𝕜)
(v : ι → E)
(x : E)

⟪l.sum fun i a => a • v i, x⟫_𝕜 = l.sum fun i a => (starRingEnd 𝕜) a • ⟪v i, x⟫_𝕜


theorem HasFiniteIntegral.min_zero {f : α → ℝ} (hf : HasFiniteIntegral f μ) :
    HasFiniteIntegral (fun a => min (f a) 0) μ

(hf : MeasureTheory.HasFiniteIntegral f μ)

MeasureTheory.HasFiniteIntegral (fun a => min (f a) 0) μ


lemma integrable_llr_tilted_left [IsFiniteMeasure μ] [SigmaFinite ν]
    (hμν : μ ≪ ν) (hf : Integrable f μ) (h_int : Integrable (llr μ ν) μ)
    (hfμ : Integrable (fun x ↦ exp (f x)) μ) (hfν : AEMeasurable f ν) :
    Integrable (llr (μ.tilted f) ν) μ

(h_int : MeasureTheory.Integrable (MeasureTheory.llr μ ν) μ)

(hfμ : MeasureTheory.Integrable (fun x => rexp (f x)) μ)

MeasureTheory.Integrable (MeasureTheory.llr (μ.tilted f) ν) μ


@[simp]
theorem nthLe_range' {n m step} (i) (H : i < (range' n m step).length) :
    nthLe (range' n m step) i H = n + step * i

{n m step : ℕ}
(i : ℕ)
(H : i < (List.range' n m step).length)

(List.range' n m step).nthLe i H = n + step * i


@[to_additive (attr := simp)]
theorem noncommProd_empty (f : α → β) (h) : noncommProd (∅ : Finset α) f h = 1

(h : (↑∅).Pairwise fun a b => AddCommute (f a) (f b))


/-- The coefficients of the monic polynomials of bounded degree with bounded roots are
uniformly bounded. -/
theorem coeff_bdd_of_roots_le {B : ℝ} {d : ℕ} (f : F →+* K) {p : F[X]} (h1 : p.Monic)
    (h2 : Splits f p) (h3 : p.natDegree ≤ d) (h4 : ∀ z ∈ (map f p).roots, ‖z‖ ≤ B) (i : ℕ) :
    ‖(map f p).coeff i‖ ≤ max B 1 ^ d * d.choose (d / 2)

(h4 : ∀ z ∈ (Polynomial.map f p).roots, ‖z‖ ≤ B)

‖(Polynomial.map f p).coeff i‖ ≤ max B 1 ^ d * ↑(d.choose (d / 2))


@[simp] lemma optionSubtypeNe_some (a : α) (b) : optionSubtypeNe a (some b) = b

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


lemma erase_inf_Ici (ha : a ∈ s) (has : ∀ b ∈ s, b ≤ a → b = a) : s.erase a ⊓ Ici a = s

{α : Type u_1}
[Preorder α]
{s : UpperSet α}
{a : α}
(ha : a ∈ s)
(has : ∀ b ∈ s, b ≤ a → b = a)


/-- Let `s` be a dense set in a nontrivial dense linear order `α`. If `s` is a
separable space (e.g., if `α` has a second countable topology), then there exists a countable
dense subset `t ⊆ s` such that `t` does not contain bottom/top elements of `α`. -/
theorem Dense.exists_countable_dense_subset_no_bot_top [Nontrivial α] {s : Set α} [SeparableSpace s]
    (hs : Dense s) :
    ∃ t, t ⊆ s ∧ t.Countable ∧ Dense t ∧ (∀ x, IsBot x → x ∉ t) ∧ ∀ x, IsTop x → x ∉ t

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
[DenselyOrdered α]
[Nontrivial α]
{s : Set α}
[TopologicalSpace.SeparableSpace ↑s]
(hs : Dense s)

∃ t ⊆ s, t.Countable ∧ Dense t ∧ (∀ (x : α), IsBot x → x ∉ t) ∧ ∀ (x : α), IsTop x → x ∉ t


@[to_additive]
theorem zero_mul {f : ℕ → M} (h : HasProd (fun n ↦ f (n + 1)) m) :
    HasProd f (f 0 * m)

{M : Type u_1}
[CommMonoid M]
[TopologicalSpace M]
{m : M}
[ContinuousMul M]
{f : ℕ → M}
(h : HasProd (fun n => f (n + 1)) m)


/-- Product of a list of elements in a submonoid is in the submonoid. -/
@[to_additive "Sum of a list of elements in an `AddSubmonoid` is in the `AddSubmonoid`."]
theorem list_prod_mem {l : List M} (hl : ∀ x ∈ l, x ∈ s) : l.prod ∈ s

{M : Type u_1}
[AddMonoid M]
(s : AddSubmonoid M)
{l : List M}
(hl : ∀ x ∈ l, x ∈ s)


@[simp, norm_cast]
theorem coe_bot : ((⊥ : Complementeds α) : α) = ⊥

{α : Type u_1}
[Lattice α]
[BoundedOrder α]


protected theorem strictMono [Subsingleton α] (f : α → β) : StrictMono f

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
[Subsingleton α]
(f : α → β)


/-- Multiplication of rational functions. -/
protected irreducible_def mul : RatFunc K → RatFunc K → RatFunc K

∀ (x x_1 : RatFunc K),
  x.mul x_1 =
    match x, x_1 with
    | { toFractionRing := p }, { toFractionRing := q } => { toFractionRing := p * q }


/-- The `Sym2.GameAdd` relation on well-founded inputs is well-founded. -/
theorem WellFounded.sym2_gameAdd (h : WellFounded rα) : WellFounded (Sym2.GameAdd rα)

{α : Type u_1}
{rα : α → α → Prop}
(h : WellFounded rα)


@[simp]
theorem setOf_subset_setOf {p q : α → Prop} : { a | p a } ⊆ { a | q a } ↔ ∀ a, p a → q a

{a | p a} ⊆ {a | q a} ↔ ∀ (a : α), p a → q a


/-- The values of an additive character on a ring of positive characteristic are roots of unity. -/
lemma val_mem_rootsOfUnity (φ : AddChar R R') (a : R) (h : 0 < ringChar R) :
    (φ.val_isUnit a).unit ∈ rootsOfUnity (ringChar R).toPNat' R'

{R : Type u}
[CommRing R]
{R' : Type v}
[CommMonoid R']
(φ : AddChar R R')
(a : R)
(h : 0 < ringChar R)

⋯.unit ∈ rootsOfUnity (ringChar R).toPNat' R'


/-- A morphism between two objects in the comma category is a commutative square connecting the
    morphisms coming from the two objects using morphisms in the image of the functors `L` and `R`.
-/
@[ext]
structure CommaMorphism (X Y : Comma L R) where
  left : X.left ⟶ Y.left
  right : X.right ⟶ Y.right
  w : L.map left ≫ Y.hom = X.hom ≫ R.map right := by aesop_cat

(self : CategoryTheory.CommaMorphism X Y)

CategoryTheory.CategoryStruct.comp (L.map self.left) Y.hom = CategoryTheory.CategoryStruct.comp X.hom (R.map self.right)


@[to_additive]
theorem continuous_of_continuous_uncurry {A : Type*} [TopologicalSpace A]
    (f : A → ContinuousMonoidHom B C) (h : Continuous (Function.uncurry fun x y => f x y)) :
    Continuous f

(h : Continuous (Function.uncurry fun x y => (f x) y))


@[simp]
lemma flip_flip (K : HomologicalComplex₂ C c₁ c₂) : K.flip.flip = K


@[simp]
theorem Ici_sup [SemilatticeSup α] (a b : α) : Ici (a ⊔ b) = Ici a ⊔ Ici b

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

UpperSet.Ici (a ⊔ b) = UpperSet.Ici a ⊔ UpperSet.Ici b


theorem mem_filter_of_mem (B : FilterBasis α) {U : Set α} : U ∈ B → U ∈ B.filter

{α : Type u_1}
(B : FilterBasis α)
{U : Set α}


theorem mem_upperBounds : a ∈ upperBounds s ↔ ∀ x ∈ s, x ≤ a

{α : Type u}
[Preorder α]
{s : Set α}
{a : α}


@[simp]
theorem productMap_right : (productMap f g).comp includeRight = g

{R : Type uR}
{S : Type uS}
{A : Type uA}
{B : Type uB}
[CommSemiring R]
[Semiring A]
[Semiring B]
[CommSemiring S]
[Algebra R A]
[Algebra R B]
[Algebra R S]
(f : A →ₐ[R] S)
(g : B →ₐ[R] S)

(Algebra.TensorProduct.productMap f g).comp Algebra.TensorProduct.includeRight = g


/-- In a dense order, nothing covers anything. -/
theorem not_covBy [DenselyOrdered α] : ¬a ⋖ b

{α : Type u_1}
[LT α]
{a b : α}
[DenselyOrdered α]


theorem mono_on (hs : IsAntichain r₁ s) (h : s.Pairwise fun ⦃a b⦄ => r₂ a b → r₁ a b) :
    IsAntichain r₂ s


@[simp]
theorem gradedCommAux_comp_gradedCommAux :
    gradedCommAux R 𝒜 ℬ ∘ₗ gradedCommAux R ℬ 𝒜 = LinearMap.id

(R : Type u_1)
{ι : Type u_2}
[CommSemiring ι]
[Module ι (Additive ℤˣ)]
[DecidableEq ι]
(𝒜 : ι → Type u_5)
(ℬ : ι → Type u_6)
[CommRing R]
[(i : ι) → AddCommGroup (𝒜 i)]
[(i : ι) → AddCommGroup (ℬ i)]
[(i : ι) → Module R (𝒜 i)]
[(i : ι) → Module R (ℬ i)]

TensorProduct.gradedCommAux R 𝒜 ℬ ∘ₗ TensorProduct.gradedCommAux R ℬ 𝒜 = LinearMap.id


theorem LinearMap.exists_monic_and_aeval_eq_zero [Module.Finite R M] (f : Module.End R M) :
    ∃ p : R[X], p.Monic ∧ Polynomial.aeval f p = 0

{M : Type u_2}
[AddCommGroup M]
(R : Type u_3)
[CommRing R]
[Module R M]
[Module.Finite R M]
(f : Module.End R M)

∃ p, p.Monic ∧ (Polynomial.aeval f) p = 0


/-- Equivalence between the range of `Sum.inr : β → α ⊕ β` and `β`. -/
@[simps symm_apply_coe]
def rangeInr (α β : Type*) : Set.range (Sum.inr : β → α ⊕ β) ≃ β

↑((Equiv.Set.rangeInr α β).symm x) = Sum.inr x


lemma composableArrows₂_exact (i : ι) :
    (composableArrows₂ S₁ i).Exact

{S₁ : CategoryTheory.ShortComplex (HomologicalComplex C c)}


@[to_additive (attr := simp)]
theorem coe_srangeRestrict {N} [Mul N] (f : M →ₙ* N) (x : M) : (f.srangeRestrict x : N) = f x

{M : Type u_1}
[Mul M]
{N : Type u_5}
[Mul N]
(f : M →ₙ* N)
(x : M)


/-- A star algebra over `K` has a scalar multiplication that respects the order.  -/
lemma _root_.StarModule.instOrderedSMul {A : Type*} [NonUnitalRing A] [StarRing A] [PartialOrder A]
    [StarOrderedRing A] [Module K A] [StarModule K A] [IsScalarTower K A A] [SMulCommClass K A A] :
    OrderedSMul K A

{K : Type u_1}
[RCLike K]
{A : Type u_3}
[NonUnitalRing A]
[StarRing A]
[PartialOrder A]
[StarOrderedRing A]
[Module K A]
[StarModule K A]
[IsScalarTower K A A]
[SMulCommClass K A A]


@[simp]
theorem extend_zero : extend (0 : E →SL[σ₁₂] F) e h_dense h_e = 0

{𝕜 : Type u_1}
{𝕜₂ : Type u_2}
{E : Type u_4}
{F : Type u_6}
{Fₗ : Type u_7}
[NormedAddCommGroup E]
[NormedAddCommGroup F]
[NormedAddCommGroup Fₗ]
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜₂]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜₂ F]
[NormedSpace 𝕜 Fₗ]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[CompleteSpace F]
(e : E →L[𝕜] Fₗ)
(h_dense : DenseRange ⇑e)
(h_e : UniformInducing ⇑e)

ContinuousLinearMap.extend 0 e h_dense h_e = 0


theorem coeff_zero_of_lt_intValuation {n d : ℕ} {f : K⟦X⟧}
    (H : Valued.v (f : LaurentSeries K) ≤ Multiplicative.ofAdd (-d : ℤ)) :
    n < d → coeff K n f = 0

(H : Valued.v ((HahnSeries.ofPowerSeries ℤ K) f) ≤ ↑(Multiplicative.ofAdd (-↑d)))


/-- A linear independent finset of `finrank K V` vectors forms a basis. -/
@[simps! repr_apply]
noncomputable def finsetBasisOfLinearIndependentOfCardEqFinrank {s : Finset V} (hs : s.Nonempty)
    (lin_ind : LinearIndependent K ((↑) : s → V)) (card_eq : s.card = finrank K V) : Basis s K V

(lin_ind : LinearIndependent K Subtype.val)

(card_eq : s.card = FiniteDimensional.finrank K V)

∀ (a : V),
  (finsetBasisOfLinearIndependentOfCardEqFinrank hs lin_ind card_eq).repr a =
    lin_ind.repr ((LinearMap.codRestrict (Submodule.span K (Set.range Subtype.val)) LinearMap.id ⋯) a)


theorem lineMap_inv_two {R : Type*} {V P : Type*} [DivisionRing R] [CharZero R] [AddCommGroup V]
    [Module R V] [AddTorsor V P] (a b : P) : lineMap a b (2⁻¹ : R) = midpoint R a b

{R : Type u_1}
{V : Type u_2}
{P : Type u_3}
[DivisionRing R]
[CharZero R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
(a b : P)

(AffineMap.lineMap a b) 2⁻¹ = midpoint R a b


/-- The definition of `Collinear`. -/
theorem collinear_iff_rank_le_one (s : Set P) :
    Collinear k s ↔ Module.rank k (vectorSpan k s) ≤ 1

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[DivisionRing k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
(s : Set P)

Collinear k s ↔ Module.rank k ↥(vectorSpan k s) ≤ 1


@[simp]
theorem walkingParallelPairOp_left :
    walkingParallelPairOp.map left = @Quiver.Hom.op _ _ zero one left

CategoryTheory.Limits.walkingParallelPairOp.map CategoryTheory.Limits.WalkingParallelPairHom.left =
  Quiver.Hom.op CategoryTheory.Limits.WalkingParallelPairHom.left


/-- A `V`-category is a category enriched in a monoidal category `V`.

Note that we do not assume that `V` is a concrete category,
so there may not be an "honest" underlying category at all!
-/
class EnrichedCategory (C : Type u₁) where
  Hom : C → C → V
  id (X : C) : 𝟙_ V ⟶ Hom X X
  comp (X Y Z : C) : Hom X Y ⊗ Hom Y Z ⟶ Hom X Z
  id_comp (X Y : C) : (λ_ (Hom X Y)).inv ≫ id X ▷ _ ≫ comp X X Y = 𝟙 _ := by aesop_cat
  comp_id (X Y : C) : (ρ_ (Hom X Y)).inv ≫ _ ◁ id Y ≫ comp X Y Y = 𝟙 _ := by aesop_cat
  assoc (W X Y Z : C) : (α_ _ _ _).inv ≫ comp W X Y ▷ _ ≫ comp W Y Z =
    _ ◁ comp X Y Z ≫ comp W X Z := by aesop_cat

[self : CategoryTheory.EnrichedCategory V C]

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.MonoidalCategory.leftUnitor (CategoryTheory.EnrichedCategory.Hom X Y)).inv
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.EnrichedCategory.id X)
        (CategoryTheory.EnrichedCategory.Hom X Y))
      (CategoryTheory.EnrichedCategory.comp X X Y)) =
  CategoryTheory.CategoryStruct.id (CategoryTheory.EnrichedCategory.Hom X Y)


theorem Multiset.dedup_card_eq_card_iff_nodup {m : Multiset α} :
    card m.dedup = card m ↔ m.Nodup

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

Multiset.card m.dedup = Multiset.card m ↔ m.Nodup


theorem Complex.isometryOfOrthonormal_symm_apply (v : OrthonormalBasis (Fin 2) ℝ F) (f : F) :
    (Complex.isometryOfOrthonormal v).symm f =
      (v.toBasis.coord 0 f : ℂ) + (v.toBasis.coord 1 f : ℂ) * I

{F : Type u_6}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
(v : OrthonormalBasis (Fin 2) ℝ F)
(f : F)

(Complex.isometryOfOrthonormal v).symm f = ↑((v.toBasis.coord 0) f) + ↑((v.toBasis.coord 1) f) * Complex.I


@[simp, mfld_simps]
theorem mem_chart_target_iff (p : H × E) (q : TM) :
    p ∈ (chartAt (ModelProd H E) q).target ↔ p.1 ∈ (chartAt H q.1).target

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_4}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
(M : Type u_6)
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
(p : H × E)
(q : TangentBundle I M)

p ∈ (chartAt (ModelProd H E) q).target ↔ p.1 ∈ (chartAt H q.proj).target


/-- Partial homeomorphisms, defined on open subsets of the space -/
-- Porting note(#5171): this linter isn't ported yet. @[nolint has_nonempty_instance]
structure PartialHomeomorph (X : Type*) (Y : Type*) [TopologicalSpace X]
  [TopologicalSpace Y] extends PartialEquiv X Y where
  open_source : IsOpen source
  open_target : IsOpen target
  continuousOn_toFun : ContinuousOn toFun source
  continuousOn_invFun : ContinuousOn invFun target

{X : Type u_7}
{Y : Type u_8}
[TopologicalSpace X]
[TopologicalSpace Y]
(self : PartialHomeomorph X Y)


theorem prevn : ∀ {s}, Valid s → s.toString.1 = m₁.reverse ++ m₂ →
    ∀ n, s.prevn n ⟨utf8Len m₁⟩ = ⟨utf8Len (m₁.drop n)⟩

s.Valid →
  s.toString.data = m₁.reverse ++ m₂ →
    ∀ (n : Nat), s.prevn n { byteIdx := String.utf8Len m₁ } = { byteIdx := String.utf8Len (List.drop n m₁) }


@[simp, norm_cast]
protected theorem coe_ofScientific (m : ℕ) (s : Bool) (e : ℕ) :
    ↑(OfScientific.ofScientific m s e : ℝ≥0) = (OfScientific.ofScientific m s e : ℝ)

↑(OfScientific.ofScientific m s e) = OfScientific.ofScientific m s e


theorem map_add₂ (f : M →SL[ρ₁₂] F →SL[σ₁₂] G') (x x' : M) (y : F) :
    f (x + x') y = f x y + f x' y

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{R : Type u_5}
{𝕜₂ : Type u_6}
{𝕜' : Type u_7}
[NontriviallyNormedField 𝕜']
[NontriviallyNormedField 𝕜₂]
{M : Type u_8}
[TopologicalSpace M]
{σ₁₂ : 𝕜 →+* 𝕜₂}
{G' : Type u_9}
[NormedAddCommGroup G']
[NormedSpace 𝕜₂ G']
[NormedSpace 𝕜' G']
[SMulCommClass 𝕜₂ 𝕜' G']
[Semiring R]
[AddCommMonoid M]
[Module R M]
{ρ₁₂ : R →+* 𝕜'}
(f : M →SL[ρ₁₂] F →SL[σ₁₂] G')
(x x' : M)
(y : F)


@[to_additive]
theorem MulHom.comp_assoc {Q : Type*} [Mul M] [Mul N] [Mul P] [Mul Q]
    (f : M →ₙ* N) (g : N →ₙ* P) (h : P →ₙ* Q) : (h.comp g).comp f = h.comp (g.comp f)

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


@[simp]
theorem _root_.OrderIso.pnatIsoNat_symm_apply : OrderIso.pnatIsoNat.symm = Nat.succPNat


@[simp]
theorem image_intrinsicFrontier (φ : P →ᵃⁱ[𝕜] Q) (s : Set P) :
    intrinsicFrontier 𝕜 (φ '' s) = φ '' intrinsicFrontier 𝕜 s

{𝕜 : Type u_1}
{V : Type u_2}
{W : Type u_3}
{Q : Type u_4}
{P : Type u_5}
[NormedField 𝕜]
[SeminormedAddCommGroup V]
[SeminormedAddCommGroup W]
[NormedSpace 𝕜 V]
[NormedSpace 𝕜 W]
[MetricSpace P]
[PseudoMetricSpace Q]
[NormedAddTorsor V P]
[NormedAddTorsor W Q]
(φ : P →ᵃⁱ[𝕜] Q)
(s : Set P)

intrinsicFrontier 𝕜 (⇑φ '' s) = ⇑φ '' intrinsicFrontier 𝕜 s


theorem HasBasis.nhds' {l : Filter α} {p : ι → Prop} {s : ι → Set α} (h : HasBasis l p s) :
    HasBasis (𝓝 l) p fun i => { l' | s i ∈ l' }

{ι : Sort u_1}
{α : Type u_2}
{l : Filter α}
{p : ι → Prop}
{s : ι → Set α}
(h : l.HasBasis p s)

(𝓝 l).HasBasis p fun i => {l' | s i ∈ l'}


@[simp] lemma inf_lt_sup : a ⊓ b < a ⊔ b ↔ a ≠ b


theorem multiplicity_sub_multiplicity {q : ℚ} (hp : p ≠ 1) (hq : q ≠ 0) :
    padicValRat p q =
      (multiplicity (p : ℤ) q.num).get (finite_int_iff.2 ⟨hp, Rat.num_ne_zero.2 hq⟩) -
        (multiplicity p q.den).get
          (by
            rw [← finite_iff_dom, finite_nat_iff]
            exact ⟨hp, q.pos⟩)

padicValRat p q = ↑((multiplicity (↑p) q.num).get ⋯) - ↑((multiplicity p q.den).get ⋯)


theorem apply_eq_iff_eq_symm_apply {m : M} {n : N} (e : M ≃ₗ⁅R,L⁆ N) :
    e m = n ↔ m = e.symm n

{R : Type u}
{L : Type v}
{M : Type w}
{N : Type w₁}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
[LieRingModule L M]
[LieRingModule L N]
{m : M}
{n : N}
(e : M ≃ₗ⁅R,L⁆ N)


theorem le_right_iff (h : IsCompl x y) : z ≤ y ↔ Disjoint z x

{α : Type u_1}
[DistribLattice α]
[BoundedOrder α]
{x y z : α}
(h : IsCompl x y)


/-- The triangle `Z₁₂ ⟶ Z₁₃ ⟶ Z₂₃ ⟶ Z₁₂⟦1⟧` given by an octahedron. -/
@[simps!]
def triangle : Triangle C

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

{comm : CategoryTheory.CategoryStruct.comp u₁₂ u₂₃ = u₁₃}

{v₁₂ : X₂ ⟶ Z₁₂}

{w₁₂ : Z₁₂ ⟶ (CategoryTheory.shiftFunctor C 1).obj X₁}

{h₁₂ : CategoryTheory.Pretriangulated.Triangle.mk u₁₂ v₁₂ w₁₂ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles}

{v₂₃ : X₃ ⟶ Z₂₃}

{w₂₃ : Z₂₃ ⟶ (CategoryTheory.shiftFunctor C 1).obj X₂}

{h₂₃ : CategoryTheory.Pretriangulated.Triangle.mk u₂₃ v₂₃ w₂₃ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles}

{v₁₃ : X₃ ⟶ Z₁₃}

{w₁₃ : Z₁₃ ⟶ (CategoryTheory.shiftFunctor C 1).obj X₁}

{h₁₃ : CategoryTheory.Pretriangulated.Triangle.mk u₁₃ v₁₃ w₁₃ ∈ CategoryTheory.Pretriangulated.distinguishedTriangles}

(h : CategoryTheory.Triangulated.Octahedron comm h₁₂ h₂₃ h₁₃)


@[simp]
theorem singleton_inj {a b : α} : ({a} : Multiset α) = {b} ↔ a = b


protected theorem injOn : InjOn e e.source

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)


@[simp]
theorem Finsupp.toDFinsupp_toFinsupp (f : ι →₀ M) : f.toDFinsupp.toFinsupp = f

{ι : Type u_1}
{M : Type u_3}
[DecidableEq ι]
[Zero M]
[(m : M) → Decidable (m ≠ 0)]
(f : ι →₀ M)


/--
If one has `l.get i` in an expression (with `i : Fin l.length`) and `h : l = l'`,
`rw [h]` will give a "motive it not type correct" error, as it cannot rewrite the
`i : Fin l.length` to `Fin l'.length` directly. The theorem `get_of_eq` can be used to make
such a rewrite, with `rw [get_of_eq h]`.
-/
theorem get_of_eq {l l' : List α} (h : l = l') (i : Fin l.length) :
    get l i = get l' ⟨i, h ▸ i.2⟩

{α : Type u_1}
{l l' : List α}
(h : l = l')
(i : Fin l.length)


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

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


lemma biUnion_subset_biUnion_of_subset_left (t : α → Finset β) (h : s₁ ⊆ s₂) :
    s₁.biUnion t ⊆ s₂.biUnion t

{α : Type u_1}
{β : Type u_2}
{s₁ s₂ : Finset α}
[DecidableEq β]
(t : α → Finset β)
(h : s₁ ⊆ s₂)


/-- Symmetric statement to `Filter.map_map₂_right_comm`. -/
theorem map_map₂_distrib_right {n : γ → δ} {m' : α → β' → δ} {n' : β → β'}
    (h_distrib : ∀ a b, n (m a b) = m' a (n' b)) : (map₂ m f g).map n = map₂ m' f (g.map n')

{m : α → β → γ}

(h_distrib : ∀ (a : α) (b : β), n (m a b) = m' a (n' b))

Filter.map n (Filter.map₂ m f g) = Filter.map₂ m' f (Filter.map n' g)


theorem isOrtho_comm {U V : Submodule 𝕜 E} : U ⟂ V ↔ V ⟂ U

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{U V : Submodule 𝕜 E}


@[simp]
theorem codRestrict_apply (p : Submodule R₂ M₂) (f : M →ₛₗ[σ₁₂] M₂) {h} (x : M) :
    (codRestrict p f h x : M₂) = f x

{R : Type u_1}
{R₂ : Type u_3}
{M : Type u_5}
{M₂ : Type u_7}
[Semiring R]
[Semiring R₂]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R₂ M₂]
{σ₁₂ : R →+* R₂}
(p : Submodule R₂ M₂)
(f : M →ₛₗ[σ₁₂] M₂)
{h : ∀ (c : M), f c ∈ p}
(x : M)

↑((LinearMap.codRestrict p f h) x) = f x


@[to_additive]
theorem subsemigroupMap_surjective (f : M →ₙ* N) (M' : Subsemigroup M) :
    Function.Surjective (f.subsemigroupMap M')

{M : Type u_1}
{N : Type u_2}
[Mul M]
[Mul N]
(f : M →ₙ* N)
(M' : Subsemigroup M)


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

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


theorem count_filter {p} [DecidablePred p] {a} {s : Multiset α} :
    count a (filter p s) = if p a then count a s else 0

{α : Type u_1}
[DecidableEq α]
{p : α → Prop}
[DecidablePred p]
{a : α}
{s : Multiset α}

Multiset.count a (Multiset.filter p s) = if p a then Multiset.count a s else 0


/-- If `f : ℕ → ℝ` is decreasing and has a negative term, then `f` is not summable. -/
lemma not_summable_of_antitone_of_neg {f : ℕ → ℝ} (hf : Antitone f) {n : ℕ} (hn : f n < 0) :
    ¬ Summable f


theorem start_isSpecial (a b : ℕ+) : (start a b).IsSpecial


theorem iSup_lintegral_measurable_le_eq_lintegral (f : α → ℝ≥0∞) :
    ⨆ (g : α → ℝ≥0∞) (_ : Measurable g) (_ : g ≤ f), ∫⁻ a, g a ∂μ = ∫⁻ a, f a ∂μ

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

⨆ g, ⨆ (_ : Measurable g), ⨆ (_ : g ≤ f), ∫⁻ (a : α), g a ∂μ = ∫⁻ (a : α), f a ∂μ


@[reassoc (attr := simp)]
theorem pentagon_inv_inv_hom_inv_inv (f : a ⟶ b) (g : b ⟶ c) (h : c ⟶ d) (i : d ⟶ e) :
    (α_ f g (h ≫ i)).inv ≫ (α_ (f ≫ g) h i).inv ≫ (α_ f g h).hom ▷ i =
      f ◁ (α_ g h i).inv ≫ (α_ f (g ≫ h) i).inv

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

CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.associator f g (CategoryTheory.CategoryStruct.comp h i)).inv
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.Bicategory.associator (CategoryTheory.CategoryStruct.comp f g) h i).inv
      (CategoryTheory.Bicategory.whiskerRight (CategoryTheory.Bicategory.associator f g h).hom i)) =
  CategoryTheory.CategoryStruct.comp
    (CategoryTheory.Bicategory.whiskerLeft f (CategoryTheory.Bicategory.associator g h i).inv)
    (CategoryTheory.Bicategory.associator f (CategoryTheory.CategoryStruct.comp g h) i).inv


/-- The projection on the `i`-th coordinate of `EuclideanSpace 𝕜 ι`, as a linear map. -/
@[simps!]
def EuclideanSpace.projₗ (i : ι) : EuclideanSpace 𝕜 ι →ₗ[𝕜] 𝕜

{ι : Type u_1}
{𝕜 : Type u_3}
[RCLike 𝕜]
(i : ι)

∀ (a : WithLp 2 (ι → 𝕜)), (EuclideanSpace.projₗ i) a = a i


/-- The unit isomorphism of the equivalence
`ShortComplex.functorEquivalence : ShortComplex (J ⥤ C) ≌ J ⥤ ShortComplex C`. -/
@[simps!]
def unitIso : 𝟭 _ ≅ functor J C ⋙ inverse J C

(X : CategoryTheory.ShortComplex (CategoryTheory.Functor J C))

∀ (X_1 : J),
  ((CategoryTheory.ShortComplex.FunctorEquivalence.unitIso J C).hom.app X).τ₃.app X_1 =
    CategoryTheory.CategoryStruct.id (X.X₃.obj X_1)


@[simp] theorem cast_refl {n : Nat} (h : n = n) :
    Fin.cast h = id


@[simp, nolint simpNF]
theorem PUnit.default_eq_unit : (default : PUnit) = PUnit.unit


protected theorem neg_mem_iff : -a ∈ I ↔ a ∈ I

{α : Type u}
[Ring α]
(I : Ideal α)
{a : α}


theorem resolvent_tendsto_cobounded (a : A) : Tendsto (resolvent a) (cobounded 𝕜) (𝓝 0)

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedRing A]
[NormedAlgebra 𝕜 A]
[CompleteSpace A]
(a : A)

Filter.Tendsto (resolvent a) (Bornology.cobounded 𝕜) (nhds 0)


theorem id : IsBoundedLinearMap 𝕜 fun x : E => x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]


@[simp, nolint simpNF]
theorem type_lift_preimage_aux {α : Type u} {β : Type v} (r : α → α → Prop) [IsWellOrder α r]
    (f : β ≃ α) : lift.{u} (@type _ (fun x y => r (f x) (f y))
      (inferInstanceAs (IsWellOrder β (f ⁻¹'o r)))) = lift.{v} (type r)

Ordinal.lift.{u, v} (Ordinal.type fun x y => r (f x) (f y)) = Ordinal.lift.{v, u} (Ordinal.type r)


private theorem C_half_mul_two_eq_one [Invertible (2 : R)] : C (⅟ 2 : R) * 2 = 1

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


/-- Given an isomorphism `S₁ ≅ S₂` of short complexes and homology data `h₁` and `h₂`
for `S₁` and `S₂` respectively, this is the induced homology isomorphism `h₁.left.H ≅ h₁.left.H`. -/
@[simps]
def homologyMapIso' (e : S₁ ≅ S₂) (h₁ : S₁.HomologyData)
    (h₂ : S₂.HomologyData) : h₁.left.H ≅ h₂.left.H

(CategoryTheory.ShortComplex.homologyMapIso' e h₁ h₂).hom = CategoryTheory.ShortComplex.homologyMap' e.hom h₁ h₂


/-- The right homology map data associated to the identity morphism of a short complex. -/
@[simps]
def id (h : S.RightHomologyData) : RightHomologyMapData (𝟙 S) h h

(CategoryTheory.ShortComplex.RightHomologyMapData.id h).φQ = CategoryTheory.CategoryStruct.id h.Q


theorem comp_inj (B₁ B₂ : BilinForm R M') {l r : M →ₗ[R] M'} (hₗ : Function.Surjective l)
    (hᵣ : Function.Surjective r) : B₁.comp l r = B₂.comp l r ↔ B₁ = B₂

{R : Type u_1}
{M : Type u_2}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
{M' : Type w}
[AddCommMonoid M']
[Module R M']
(B₁ B₂ : LinearMap.BilinForm R M')
{l r : M →ₗ[R] M'}
(hₗ : Function.Surjective ⇑l)
(hᵣ : Function.Surjective ⇑r)


@[to_additive (attr := simp)]
theorem coe_snd : ⇑(snd M N) = Prod.snd

{M : Type u_5}
{N : Type u_6}
[AddZeroClass M]
[AddZeroClass N]


/-- Given a set `t` such that `s ∩ t` is dense in `s`, then the range of `derivWithin f s` is
contained in the closure of the submodule spanned by the image of `t`. -/
theorem range_derivWithin_subset_closure_span_image
    (f : 𝕜 → F) {s t : Set 𝕜} (h : s ⊆ closure (s ∩ t)) :
    range (derivWithin f s) ⊆ closure (Submodule.span 𝕜 (f '' t))

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
(f : 𝕜 → F)
{s t : Set 𝕜}
(h : s ⊆ closure (s ∩ t))

Set.range (derivWithin f s) ⊆ closure ↑(Submodule.span 𝕜 (f '' t))


@[simp]
theorem eqLocus_same (f : R →ₙ+* S) : f.eqLocus f = ⊤

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


@[to_additive (attr := simp)]
theorem coe_mulRight (x : X) : ⇑(ContinuousMap.mulRight x) = fun y => y * x

{X : Type u_5}
[TopologicalSpace X]
[Mul X]
[ContinuousMul X]
(x : X)


theorem mk_bounded_set_le_of_infinite (α : Type u) [Infinite α] (c : Cardinal) :
    #{ t : Set α // #t ≤ c } ≤ #α ^ c

(α : Type u)
[Infinite α]
(c : Cardinal.{u})


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

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

AddCommute (AddOpposite.op x) (AddOpposite.op y)


@[simp]
theorem left_vsub_pointReflection (x y : P) : x -ᵥ pointReflection x y = y -ᵥ x

{G : Type u_1}
{P : Type u_2}
[AddGroup G]
[AddTorsor G P]
(x y : P)

x -ᵥ (Equiv.pointReflection x) y = y -ᵥ x


@[simp] theorem getLsb_ofBoolListLE : (ofBoolListLE bs).getLsb i = bs.getD i false

(BitVec.ofBoolListLE bs).getLsb i = bs.getD i false


theorem forall_iff_forall_mem : ∀ {l : List α}, Forall p l ↔ ∀ x ∈ l, p x

{α : Type u}
{p : α → Prop}
{l : List α}

List.Forall p l ↔ ∀ (x : α), x ∈ l → p x


/-- If `gaussSum χ e ≠ 0`, and `d` is such that `e.mulShift d = 1`, then `χ` must factor through
`d`. (This will be used to show that Gauss sums vanish when `χ` is primitive and `e` is not.) -/
lemma factorsThrough_of_gaussSum_ne_zero [IsDomain R] {χ : DirichletCharacter R N} {d : ℕ}
    (hd : d ∣ N) (he : e.mulShift d = 1) (h_ne : gaussSum χ e ≠ 0) :
    χ.FactorsThrough d

{N : ℕ}
[NeZero N]
{R : Type u_1}
[CommRing R]
(e : AddChar (ZMod N) R)
[IsDomain R]
{χ : DirichletCharacter R N}
{d : ℕ}
(hd : d ∣ N)
(he : e.mulShift ↑d = 1)
(h_ne : gaussSum χ e ≠ 0)


lemma isLowerSet_orderDual [Preorder α] [TopologicalSpace α] :
    Topology.IsLowerSet αᵒᵈ ↔ Topology.IsUpperSet α

{α : Type u_1}
[Preorder α]
[TopologicalSpace α]


/-- We say that a collection of `SmoothBumpFunction`s is a `SmoothBumpCovering` of a set `s` if

* `(f i).c ∈ s` for all `i`;
* the family `fun i ↦ support (f i)` is locally finite;
* for each point `x ∈ s` there exists `i` such that `f i =ᶠ[𝓝 x] 1`;
  in other words, `x` belongs to the interior of `{y | f i y = 1}`;

If `M` is a finite dimensional real manifold which is a `σ`-compact Hausdorff topological space,
then for every covering `U : M → Set M`, `∀ x, U x ∈ 𝓝 x`, there exists a `SmoothBumpCovering`
subordinate to `U`, see `SmoothBumpCovering.exists_isSubordinate`.

This covering can be used, e.g., to construct a partition of unity and to prove the weak
Whitney embedding theorem. -/
-- Porting note(#5171): was @[nolint has_nonempty_instance]
structure SmoothBumpCovering (s : Set M := univ) where
  /-- The center point of each bump in the smooth covering. -/
  c : ι → M
  /-- A smooth bump function around `c i`. -/
  toFun : ∀ i, SmoothBumpFunction I (c i)
  /-- All the bump functions in the covering are centered at points in `s`. -/
  c_mem' : ∀ i, c i ∈ s
  /-- Around each point, there are only finitely many nonzero bump functions in the family. -/
  locallyFinite' : LocallyFinite fun i => support (toFun i)
  /-- Around each point in `s`, one of the bump functions is equal to `1`. -/
  eventuallyEq_one' : ∀ x ∈ s, ∃ i, toFun i =ᶠ[𝓝 x] 1

{ι : Type uι}
{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]
{s : optParam (Set M) Set.univ}
(self : SmoothBumpCovering ι I M s)
(x : M)


theorem Derivation.liftKaehlerDifferential_apply (D : Derivation R S M) (x) :
    D.liftKaehlerDifferential ((KaehlerDifferential.ideal R S).toCotangent x) =
      D.tensorProductTo x

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{M : Type u_1}
[AddCommGroup M]
[Module R M]
[Module S M]
[IsScalarTower R S M]
(D : Derivation R S M)
(x : ↥(KaehlerDifferential.ideal R S))

D.liftKaehlerDifferential ((KaehlerDifferential.ideal R S).toCotangent x) = D.tensorProductTo ↑x


theorem image2_iInter₂_subset_right (s : Set α) (t : ∀ i, κ i → Set β) :
    image2 f s (⋂ (i) (j), t i j) ⊆ ⋂ (i) (j), image2 f s (t i j)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{ι : Sort u_4}
{κ : ι → Sort u_7}
(f : α → β → γ)
(s : Set α)
(t : (i : ι) → κ i → Set β)

Set.image2 f s (⋂ i, ⋂ j, t i j) ⊆ ⋂ i, ⋂ j, Set.image2 f s (t i j)


theorem atTop_basis' [SemilatticeSup α] (a : α) : (@atTop α _).HasBasis (fun x => a ≤ x) Ici

{α : Type u_3}
[SemilatticeSup α]
(a : α)

Filter.atTop.HasBasis (fun x => a ≤ x) Set.Ici


/-- The sum over primes `k ≤ p ≤ 4^(π(k-1)+1)` over `1/p` (as a real number) is at least `1/2`. -/
lemma one_half_le_sum_primes_ge_one_div (k : ℕ) :
    1 / 2 ≤ ∑ p ∈ (4 ^ (k.primesBelow.card + 1)).succ.primesBelow \ k.primesBelow,
      (1 / p : ℝ)

1 / 2 ≤ ∑ p ∈ (4 ^ (k.primesBelow.card + 1)).succ.primesBelow \ k.primesBelow, 1 / ↑p


@[simp]
theorem bind_some_right (x : Part α) : x.bind some = x


@[simp]
theorem LinearEquiv.isometryOfOrthonormal_toLinearEquiv (f : E ≃ₗ[𝕜] E') {v : Basis ι 𝕜 E}
    (hv : Orthonormal 𝕜 v) (hf : Orthonormal 𝕜 (f ∘ v)) :
    (f.isometryOfOrthonormal hv hf).toLinearEquiv = f

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_4}
{E' : Type u_7}
[NormedAddCommGroup E']
[InnerProductSpace 𝕜 E']
(f : E ≃ₗ[𝕜] E')
{v : Basis ι 𝕜 E}
(hv : Orthonormal 𝕜 ⇑v)
(hf : Orthonormal 𝕜 (⇑f ∘ ⇑v))


theorem isoExt_hom_m : (isoExt hF hF').hom ≫ F'.m = F.m

{F F' : CategoryTheory.Limits.MonoFactorisation f}

(hF' : CategoryTheory.Limits.IsImage F')


@[to_additive]
theorem _root_.isUnit_map_of_leftInverse [MonoidHomClass F M N] [MonoidHomClass G N M]
    {f : F} {x : M} (g : G) (hfg : Function.LeftInverse g f) :
    IsUnit (f x) ↔ IsUnit x

{F : Type u_1}
{G : Type u_2}
{M : Type u_4}
{N : Type u_5}
[FunLike F M N]
[FunLike G N M]
[AddMonoid M]
[AddMonoid N]
[AddMonoidHomClass F M N]
[AddMonoidHomClass G N M]
{f : F}
{x : M}
(g : G)
(hfg : Function.LeftInverse ⇑g ⇑f)


theorem norm_map_of_mem_unitary {u : H →L[𝕜] H} (hu : u ∈ unitary (H →L[𝕜] H)) (x : H) :
    ‖u x‖ = ‖x‖

{𝕜 : Type u_1}
[RCLike 𝕜]
{H : Type u_5}
[NormedAddCommGroup H]
[InnerProductSpace 𝕜 H]
[CompleteSpace H]
{u : H →L[𝕜] H}
(hu : u ∈ unitary (H →L[𝕜] H))
(x : H)


theorem IsAcyclic.path_unique {G : SimpleGraph V} (h : G.IsAcyclic) {v w : V} (p q : G.Path v w) :
    p = q

{V : Type u}
{G : SimpleGraph V}
(h : G.IsAcyclic)
{v w : V}
(p q : G.Path v w)


theorem toFun_eq_coe (f : α →*₀o β) : f.toFun = (f : α → β)

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


/-- A presieve is *regular* if it consists of a single effective epimorphism. -/
class Presieve.regular {X : C} (R : Presieve X) : Prop where
  /-- `R` consists of a single epimorphism. -/
  single_epi : ∃ (Y : C) (f : Y ⟶ X), R = Presieve.ofArrows (fun (_ : Unit) ↦ Y)
    (fun (_ : Unit) ↦ f) ∧ EffectiveEpi f

{C : Type u_1}
[CategoryTheory.Category.{u_4, u_1} C]
{X : C}
{R : CategoryTheory.Presieve X}
[self : R.regular]

∃ Y f, (R = CategoryTheory.Presieve.ofArrows (fun x => Y) fun x => f) ∧ CategoryTheory.EffectiveEpi f


@[simp]
theorem range_inclusion (h : s ⊆ t) : range (inclusion h) = { x : t | (x : α) ∈ s }

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

Set.range (Set.inclusion h) = {x | ↑x ∈ s}


theorem Filter.TendstoNhdsWithinIio.const_mul [PosMulStrictMono 𝕜] [PosMulReflectLT 𝕜]
    (h : Tendsto f l (𝓝[<] c)) : Tendsto (fun a => b * f a) l (𝓝[<] (b * c))

{α : Type u_2}
{𝕜 : Type u_6}
[Preorder 𝕜]
[Zero 𝕜]
[Mul 𝕜]
[TopologicalSpace 𝕜]
[ContinuousMul 𝕜]
{l : Filter α}
{f : α → 𝕜}
{b c : 𝕜}
(hb : 0 < b)
[PosMulStrictMono 𝕜]
[PosMulReflectLT 𝕜]
(h : Filter.Tendsto f l (𝓝[<] c))

Filter.Tendsto (fun a => b * f a) l (𝓝[<] (b * c))


@[simp]
theorem dFrom_eq_zero {i : ι} (h : ¬c.Rel i (c.next i)) : C.dFrom i = 0


theorem fst_sup_snd : Submodule.fst R M M₂ ⊔ Submodule.snd R M M₂ = ⊤

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


theorem head!_eq_head? [Inhabited α] (l : List α) : head! l = (head? l).iget


theorem LinearIndependent.total_ne_of_not_mem_support [Nontrivial R] (hv : LinearIndependent R v)
    {x : ι} (f : ι →₀ R) (h : x ∉ f.support) : Finsupp.total ι M R v f ≠ v x

{ι : Type u'}
{R : Type u_2}
{M : Type u_4}
{v : ι → M}
[Ring R]
[AddCommGroup M]
[Module R M]
[Nontrivial R]
(hv : LinearIndependent R v)
{x : ι}
(f : ι →₀ R)
(h : x ∉ f.support)


/-- This follows this proof from
* Borceux, Handbook of categorical algebra 1, Theorem 2.13.4
-/
theorem colimitLimitToLimitColimit_injective :
    Function.Injective (colimitLimitToLimitColimit F)

{J : Type u₁}
{K : Type u₂}
[CategoryTheory.Category.{v₁, u₁} J]
[CategoryTheory.Category.{v₂, u₂} K]
[Small.{v, u₂} K]
(F : J × K ⥤ Type v)
[CategoryTheory.IsFiltered K]
[Finite J]


theorem span_insert (x) (s : Set α) : span (insert x s) = span ({x} : Set α) ⊔ span s

{α : Type u}
[Semiring α]
(x : α)
(s : Set α)

Ideal.span (insert x s) = Ideal.span {x} ⊔ Ideal.span s


{α : Type u_2}
[LinearOrderedSemiring α]
[FloorSemiring α]
{a : α}

0 < ⌊a⌋₊ ↔ 1 ≤ a


@[to_additive dist_le_norm_add_norm]
theorem dist_le_norm_add_norm' (a b : E) : dist a b ≤ ‖a‖ + ‖b‖

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


/-- `Equiv` between `PartENat` and `ℕ∞` (for the order isomorphism see
`withTopOrderIso`). -/
@[simps]
noncomputable def withTopEquiv : PartENat ≃ ℕ∞


@[simp]
theorem mem_unop {x : R} {S : Subsemiring Rᵐᵒᵖ} : x ∈ S.unop ↔ MulOpposite.op x ∈ S

{R : Type u_2}
[NonAssocSemiring R]
{x : R}
{S : Subsemiring Rᵐᵒᵖ}


/-- `BiheytingHomClass F α β` states that `F` is a type of bi-Heyting homomorphisms.

You should extend this class when you extend `BiheytingHom`. -/
class BiheytingHomClass (F α β : Type*) [BiheytingAlgebra α] [BiheytingAlgebra β] [FunLike F α β]
  extends LatticeHomClass F α β : Prop where
  /-- The proposition that a bi-Heyting homomorphism preserves the Heyting implication. -/
  map_himp (f : F) : ∀ a b, f (a ⇨ b) = f a ⇨ f b
  /-- The proposition that a bi-Heyting homomorphism preserves the difference operation. -/
  map_sdiff (f : F) : ∀ a b, f (a \ b) = f a \ f b

{F : Type u_6}
{α : Type u_7}
{β : Type u_8}
[BiheytingAlgebra α]
[BiheytingAlgebra β]
[FunLike F α β]
[self : BiheytingHomClass F α β]
(f : F)
(a b : α)


@[simp]
theorem pmap_zero {p : α → Prop} (f : ∀ a, p a → β) (h : ∀ a ∈ (0 : Multiset α), p a) :
    pmap f 0 h = 0

{α : Type u_1}
{β : Type v}
{p : α → Prop}
(f : (a : α) → p a → β)
(h : ∀ a ∈ 0, p a)


theorem continuous_uncurry_iff {Y} [TopologicalSpace Y] {g : Y → Path x y} :
    Continuous ↿g ↔ Continuous g

{X : Type u_1}
[TopologicalSpace X]
{x y : X}
{Y : Type u_4}
[TopologicalSpace Y]
{g : Y → Path x y}


@[simp]
theorem inclusion_inclusion (hst : s ⊆ t) (htu : t ⊆ u) (x : s) :
    inclusion htu (inclusion hst x) = inclusion (hst.trans htu) x

{α : Type u_1}
{s t u : Set α}
(hst : s ⊆ t)
(htu : t ⊆ u)
(x : ↑s)

Set.inclusion htu (Set.inclusion hst x) = Set.inclusion ⋯ x


theorem lintegral_rpow_add_le_add_eLpNorm_mul_lintegral_rpow_add {p q : ℝ}
    (hpq : p.IsConjExponent q) {f g : α → ℝ≥0∞} (hf : AEMeasurable f μ)
    (hf_top : (∫⁻ a, f a ^ p ∂μ) ≠ ⊤) (hg : AEMeasurable g μ) (hg_top : (∫⁻ a, g a ^ p ∂μ) ≠ ⊤) :
    (∫⁻ a, (f + g) a ^ p ∂μ) ≤
      ((∫⁻ a, f a ^ p ∂μ) ^ (1 / p) + (∫⁻ a, g a ^ p ∂μ) ^ (1 / p)) *
        (∫⁻ a, (f a + g a) ^ p ∂μ) ^ (1 / q)

{α : Type u_1}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
{p q : ℝ}
(hpq : p.IsConjExponent q)
{f g : α → ENNReal}
(hf : AEMeasurable f μ)
(hf_top : ∫⁻ (a : α), f a ^ p ∂μ ≠ ⊤)
(hg : AEMeasurable g μ)
(hg_top : ∫⁻ (a : α), g a ^ p ∂μ ≠ ⊤)


@[simp]
theorem map_eq_nil_iff {p : G.Walk u u} : p.map f = nil ↔ p = nil

{V : Type u}
{V' : Type v}
{G : SimpleGraph V}
{G' : SimpleGraph V'}
(f : G →g G')
{u : V}
{p : G.Walk u u}

SimpleGraph.Walk.map f p = SimpleGraph.Walk.nil ↔ p = SimpleGraph.Walk.nil


/-- The class of context-free languages is closed under reversal. -/
theorem Language.IsContextFree.reverse (L : Language T) :
    L.IsContextFree → L.reverse.IsContextFree


@[simp] lemma down_id {X : C} : down (𝟙 (of X)) = 𝟙 X

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

CategoryTheory.WithInitial.down (CategoryTheory.CategoryStruct.id (CategoryTheory.WithInitial.of X)) =
  CategoryTheory.CategoryStruct.id X


theorem filter_lt_of_le_bot {n m l : ℕ} (hln : l ≤ n) : ((Ico n m).filter fun x => x < l) = []

List.filter (fun x => decide (x < l)) (List.Ico n m) = []


theorem smul_tmul_smul (r s : R) (m : M) (n : N) : (r • m) ⊗ₜ[R] (s • n) = (r * s) • m ⊗ₜ[R] n

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
(r s : R)
(m : M)
(n : N)


theorem erase_injOn (s : Finset α) : Set.InjOn s.erase s

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


lemma Functor.balanced_of_preserves (F : C ⥤ D)
    [F.ReflectsIsomorphisms] [F.PreservesEpimorphisms] [F.PreservesMonomorphisms] [Balanced D] :
    Balanced C

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
(F : C ⥤ D)
[F.ReflectsIsomorphisms]
[F.PreservesEpimorphisms]
[F.PreservesMonomorphisms]
[CategoryTheory.Balanced D]


/-- A constructor for languages with only constants, unary and binary functions, and
unary and binary relations. -/
@[simps]
protected def mk₂ (c f₁ f₂ : Type u) (r₁ r₂ : Type v) : Language

∀ (a : ℕ), (FirstOrder.Language.mk₂ c f₁ f₂ r₁ r₂).Functions a = FirstOrder.Sequence₂ c f₁ f₂ a


lemma dvd_mul_sub_mul_mul_left_of_dvd {p a b c d x y : R}
    (h1 : p ∣ a * x + b * y) (h2 : p ∣ c * x + d * y) : p ∣ (a * d - b * c) * x

{R : Type u_1}
[CommRing R]
{p a b c d x y : R}
(h1 : p ∣ a * x + b * y)
(h2 : p ∣ c * x + d * y)


@[simp]
theorem isUnit_iff : IsUnit a ↔ a = 1


protected theorem min_le_min_add {Γ} [LinearOrder Γ] {x y : HahnSeries Γ R} (hx : x ≠ 0)
    (hy : y ≠ 0) (hxy : x + y ≠ 0) :
    min (Set.IsWF.min x.isWF_support (support_nonempty_iff.2 hx))
      (Set.IsWF.min y.isWF_support (support_nonempty_iff.2 hy)) ≤
      Set.IsWF.min (x + y).isWF_support (support_nonempty_iff.2 hxy)

{R : Type u_2}
[AddMonoid R]
{Γ : Type u_3}
[LinearOrder Γ]
{x y : HahnSeries Γ R}
(hx : x ≠ 0)
(hy : y ≠ 0)
(hxy : x + y ≠ 0)


theorem continuous_iff_isClosed : Continuous f ↔ ∀ s, IsClosed s → IsClosed (f ⁻¹' s)

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

Continuous f ↔ ∀ (s : Set Y), IsClosed s → IsClosed (f ⁻¹' s)


lemma bddBelow_range_prod {F : ι → α × β} :
    BddBelow (range F) ↔ BddBelow (range <| Prod.fst ∘ F) ∧ BddBelow (range <| Prod.snd ∘ F)

{ι : Sort x}
{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{F : ι → α × β}

BddBelow (Set.range F) ↔ BddBelow (Set.range (Prod.fst ∘ F)) ∧ BddBelow (Set.range (Prod.snd ∘ F))


/-- If a function is `C^n` with `n ≥ 1`, then it is differentiable. -/
theorem ContDiff.differentiable (h : ContDiff 𝕜 n f) (hn : 1 ≤ n) : Differentiable 𝕜 f

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{n : ℕ∞}
(h : ContDiff 𝕜 n f)
(hn : 1 ≤ n)


protected theorem Embedding.t1Space [TopologicalSpace Y] [T1Space Y] {f : X → Y}
    (hf : Embedding f) : T1Space X

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[T1Space Y]
{f : X → Y}
(hf : Embedding f)


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

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


theorem comap_map_le : (m.map f).comap f ≤ m

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{f : α → β}

MeasurableSpace.comap f (MeasurableSpace.map f m) ≤ m


theorem toLinearMap_injective : Injective (toLinearMap : (E →ₛₗᵢ[σ₁₂] E₂) → E →ₛₗ[σ₁₂] E₂)

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]


theorem eLpNorm'_le_eLpNormEssSup {q : ℝ} (hq_pos : 0 < q) [IsProbabilityMeasure μ] :
    eLpNorm' f q μ ≤ eLpNormEssSup f μ

{α : Type u_1}
{E : Type u_2}
{m : MeasurableSpace α}
[NormedAddCommGroup E]
{μ : MeasureTheory.Measure α}
{f : α → E}
{q : ℝ}
(hq_pos : 0 < q)
[MeasureTheory.IsProbabilityMeasure μ]

MeasureTheory.eLpNorm' f q μ ≤ MeasureTheory.eLpNormEssSup f μ


theorem equivalence₁CounitIso_eq : (equivalence₁ hF).counitIso = equivalence₁CounitIso hF

{A : Type u_1}
{A' : Type u_2}
{B' : Type u_4}
[CategoryTheory.Category.{u_6, u_1} A]
[CategoryTheory.Category.{u_7, u_2} A']
[CategoryTheory.Category.{u_5, u_4} B']
{eA : A ≌ A'}
{e' : A' ≌ B'}
{F : A ⥤ B'}
(hF : eA.functor ⋙ e'.functor ≅ F)

(AlgebraicTopology.DoldKan.Compatibility.equivalence₁ hF).counitIso =
  AlgebraicTopology.DoldKan.Compatibility.equivalence₁CounitIso hF


theorem TendstoUniformlyOnFilter.mono_right {p'' : Filter α} (h : TendstoUniformlyOnFilter F f p p')
    (hp : p'' ≤ p') : TendstoUniformlyOnFilter F f p p''

{α : Type u}
{β : Type v}
{ι : Type x}
[UniformSpace β]
{F : ι → α → β}
{f : α → β}
{p : Filter ι}
{p' p'' : Filter α}
(h : TendstoUniformlyOnFilter F f p p')
(hp : p'' ≤ p')


theorem not_acc_of_decreasing_seq (f : ((· > ·) : ℕ → ℕ → Prop) ↪r r) (k : ℕ) : ¬Acc r (f k)

{α : Type u_1}
{r : α → α → Prop}
[IsStrictOrder α r]
(f : (fun x x_1 => x > x_1) ↪r r)
(k : ℕ)


/-- A strong natural transformation between oplax functors `F` and `G` is a natural transformation
that is "natural up to 2-isomorphisms".

More precisely, it consists of the following:
* a 1-morphism `η.app a : F.obj a ⟶ G.obj a` for each object `a : B`.
* a 2-isomorphism `η.naturality f : F.map f ≫ app b ⟶ app a ≫ G.map f` for each 1-morphism
`f : a ⟶ b`.
* These 2-isomorphisms satisfy the naturality condition, and preserve the identities and the
compositions modulo some adjustments of domains and codomains of 2-morphisms.
-/
structure StrongOplaxNatTrans (F G : OplaxFunctor B C) where
  app (a : B) : F.obj a ⟶ G.obj a
  naturality {a b : B} (f : a ⟶ b) : F.map f ≫ app b ≅ app a ≫ G.map f
  naturality_naturality :
    ∀ {a b : B} {f g : a ⟶ b} (η : f ⟶ g),
      F.map₂ η ▷ app b ≫ (naturality g).hom = (naturality f).hom ≫ app a ◁ G.map₂ η := by
    aesop_cat
  naturality_id :
    ∀ a : B,
      (naturality (𝟙 a)).hom ≫ app a ◁ G.mapId a =
        F.mapId a ▷ app a ≫ (λ_ (app a)).hom ≫ (ρ_ (app a)).inv := by
    aesop_cat
  naturality_comp :
    ∀ {a b c : B} (f : a ⟶ b) (g : b ⟶ c),
      (naturality (f ≫ g)).hom ≫ app a ◁ G.mapComp f g =
        F.mapComp f g ▷ app c ≫ (α_ _ _ _).hom ≫ F.map f ◁ (naturality g).hom ≫
        (α_ _ _ _).inv ≫ (naturality f).hom ▷ G.map g ≫ (α_ _ _ _).hom := by
    aesop_cat

(self : CategoryTheory.StrongOplaxNatTrans F G)

CategoryTheory.CategoryStruct.comp (self.naturality (CategoryTheory.CategoryStruct.comp f g)).hom
    (CategoryTheory.Bicategory.whiskerLeft (self.app a) (G.mapComp f g)) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight (F.mapComp f g) (self.app c))
    (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.associator (F.map f) (F.map g) (self.app c)).hom
      (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerLeft (F.map f) (self.naturality g).hom)
        (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.associator (F.map f) (self.app b) (G.map g)).inv
          (CategoryTheory.CategoryStruct.comp (CategoryTheory.Bicategory.whiskerRight (self.naturality f).hom (G.map g))
            (CategoryTheory.Bicategory.associator (self.app a) (G.map f) (G.map g)).hom))))


theorem dvd_gcd : k ∣ m → k ∣ n → k ∣ gcd m n


@[to_additive (attr := simp)]
theorem unop_op (x : α) : unop (op x) = x


theorem x_sub_y_dvd_pow (y : ℕ) :
    ∀ n, (2 * a * y - y * y - 1 : ℤ) ∣ yz a1 n * (a - y) + ↑(y ^ n) - xz a1 n

2 * ↑a * ↑y - ↑y * ↑y - 1 ∣ Pell.yz a1 n * (↑a - ↑y) + ↑(y ^ n) - Pell.xz a1 n


private lemma auxHom_auxInv : (auxHom S r).toRingHom.comp (auxInv S r) = RingHom.id S

{R : Type u_2}
[CommRing R]
(S : Type u_3)
[CommRing S]
[Algebra R S]
(r : R)
[IsLocalization.Away r S]

(IsLocalization.Away.auxHom S r).comp (IsLocalization.Away.auxInv S r) = RingHom.id S


theorem Ioi_eq_finset_subtype : Ioi a = (Ioc (a : ℕ) n).fin n

Finset.Ioi a = Finset.fin n (Finset.Ioc (↑a) n)


@[to_additive]
theorem partialProd_succ' (f : Fin (n + 1) → α) (j : Fin (n + 1)) :
    partialProd f j.succ = f 0 * partialProd (Fin.tail f) j

{α : Type u_1}
[Monoid α]
{n : ℕ}
(f : Fin (n + 1) → α)
(j : Fin (n + 1))

Fin.partialProd f j.succ = f 0 * Fin.partialProd (Fin.tail f) j


@[continuity]
theorem Continuous.matrix_blockDiagonal [Zero R] [DecidableEq p] {A : X → p → Matrix m n R}
    (hA : Continuous A) : Continuous fun x => blockDiagonal (A x)

{X : Type u_1}
{m : Type u_4}
{n : Type u_5}
{p : Type u_6}
{R : Type u_8}
[TopologicalSpace X]
[TopologicalSpace R]
[Zero R]
[DecidableEq p]
{A : X → p → Matrix m n R}
(hA : Continuous A)

Continuous fun x => Matrix.blockDiagonal (A x)


lemma forall_ne_iff_eq_top {x : WithTop α} : (∀ a : α, ↑a ≠ x) ↔ x = ⊤


theorem le_iff_lt_or_eq {a b : α} : a ≤ b ↔ a < b ∨ a = b


/-- Constructor for objects of the category `Functor.LeftExtension L F`. -/
@[simps!]
def LeftExtension.mk (F' : D ⥤ H) {L : C ⥤ D} {F : C ⥤ H} (α : F ⟶ L ⋙ F') :
    LeftExtension L F

{C : Type u_1}
{H : Type u_3}
{D : Type u_5}
[CategoryTheory.Category.{u_7, u_1} C]
[CategoryTheory.Category.{u_8, u_3} H]
[CategoryTheory.Category.{u_9, u_5} D]
(F' : CategoryTheory.Functor D H)
{L : CategoryTheory.Functor C D}
{F : CategoryTheory.Functor C H}
(α : F ⟶ L.comp F')

(CategoryTheory.Functor.LeftExtension.mk F' α).left.as = PUnit.unit


@[simp]
theorem sin_pi_div_sixteen : sin (π / 16) = √(2 - √(2 + √2)) / 2


@[simp]
theorem coeff_map (n : ℕ) (φ : R⟦X⟧) : coeff S n (map f φ) = f (coeff R n φ)

{R : Type u_1}
[Semiring R]
{S : Type u_2}
[Semiring S]
(f : R →+* S)
(n : ℕ)
(φ : PowerSeries R)

(PowerSeries.coeff S n) ((PowerSeries.map f) φ) = f ((PowerSeries.coeff R n) φ)


private theorem funext_fin {n : ℕ} {p : MvPolynomial (Fin n) R}
    (h : ∀ x : Fin n → R, eval x p = 0) : p = 0

(h : ∀ (x : Fin n → R), (MvPolynomial.eval x) p = 0)


/-- The circumcenter of a 0-simplex equals its unique point. -/
theorem circumcenter_eq_point (s : Simplex ℝ P 0) (i : Fin 1) : s.circumcenter = s.points i

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(s : Affine.Simplex ℝ P 0)
(i : Fin 1)


@[simp]
theorem rootsExpandPowToRoots_apply (x) : (rootsExpandPowToRoots p n f x : R) = x ^ p ^ n

(x : { x // x ∈ ((Polynomial.expand R (p ^ n)) f).roots.toFinset })

↑((Polynomial.rootsExpandPowToRoots p n f) x) = ↑x ^ p ^ n


theorem nontrivial_of_lt_top (h : p < ⊤) : Nontrivial (M ⧸ p)

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


lemma chainLength_of_eq_zsmul_add (β' : Weight K H L) (n : ℤ) (hβ' : (β' : H → K) = n • α + β) :
    chainLength α β' = chainLength α β

{K : Type u_1}
{L : Type u_2}
[Field K]
[CharZero K]
[LieRing L]
[LieAlgebra K L]
[LieAlgebra.IsKilling K L]
[FiniteDimensional K L]
{H : LieSubalgebra K L}
[H.IsCartanSubalgebra]
[LieModule.IsTriangularizable K (↥H) L]
(α β β' : LieModule.Weight K (↥H) L)
(n : ℤ)
(hβ' : ⇑β' = n • ⇑α + ⇑β)

LieAlgebra.IsKilling.chainLength α β' = LieAlgebra.IsKilling.chainLength α β


theorem diam_range : Metric.diam (range (f : α → β)) = ratio f * Metric.diam (univ : Set α)

{α : Type u_1}
{β : Type u_2}
{F : Type u_4}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
[FunLike F α β]
[DilationClass F α β]
(f : F)

Metric.diam (Set.range ⇑f) = ↑(Dilation.ratio f) * Metric.diam Set.univ


protected theorem nonempty (K : ProperCone 𝕜 E) : (K : Set E).Nonempty

{𝕜 : Type u_1}
[OrderedSemiring 𝕜]
{E : Type u_2}
[AddCommMonoid E]
[TopologicalSpace E]
[Module 𝕜 E]
(K : ProperCone 𝕜 E)


@[simp]
theorem swap_swap (a b : α) : (swap a b).trans (swap a b) = Equiv.refl _

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

Equiv.trans (Equiv.swap a b) (Equiv.swap a b) = Equiv.refl α


protected theorem Tendsto.div_const {f : Filter α} {m : α → ℝ≥0∞} {a b : ℝ≥0∞}
    (hm : Tendsto m f (𝓝 a)) (ha : a ≠ 0 ∨ b ≠ 0) : Tendsto (fun x => m x / b) f (𝓝 (a / b))

{α : Type u_1}
{f : Filter α}
{m : α → ℝ≥0∞}
{a b : ℝ≥0∞}
(hm : Filter.Tendsto m f (𝓝 a))
(ha : a ≠ 0 ∨ b ≠ 0)

Filter.Tendsto (fun x => m x / b) f (𝓝 (a / b))


/-- The obvious homotopy between a morphism of short complexes and itself. -/
@[simps!]
def refl (φ : S₁ ⟶ S₂) : Homotopy φ φ

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{S₁ S₂ : CategoryTheory.ShortComplex C}
(φ : S₁ ⟶ S₂)

(CategoryTheory.ShortComplex.Homotopy.refl φ).h₃ = 0


/-- **Intermediate Value Theorem** for continuous functions on connected spaces. -/
theorem mem_range_of_exists_le_of_exists_ge [PreconnectedSpace X] {c : α} {f : X → α}
    (hf : Continuous f) (h₁ : ∃ a, f a ≤ c) (h₂ : ∃ b, c ≤ f b) : c ∈ range f

{X : Type u}
{α : Type v}
[TopologicalSpace X]
[LinearOrder α]
[TopologicalSpace α]
[OrderClosedTopology α]
[PreconnectedSpace X]
{c : α}
{f : X → α}
(hf : Continuous f)
(h₁ : ∃ a, f a ≤ c)
(h₂ : ∃ b, c ≤ f b)


/-- The shadow is monotone. -/
@[mono]
theorem shadow_monotone : Monotone (shadow : Finset (Finset α) → Finset (Finset α))


@[simp] theorem bijOn_empty_iff_right : BijOn f ∅ t ↔ t = ∅

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


@[to_additive]
theorem continuous_comp [LocallyCompactSpace B] :
    Continuous fun f : ContinuousMonoidHom A B × ContinuousMonoidHom B C => f.2.comp f.1

{A : Type u_2}
{B : Type u_3}
{C : Type u_4}
[AddMonoid A]
[AddMonoid B]
[AddMonoid C]
[TopologicalSpace A]
[TopologicalSpace B]
[TopologicalSpace C]
[LocallyCompactSpace B]


theorem map_one_fst_of_isTwoCocycle {f : G × G → A} (hf : IsTwoCocycle f) (g : G) :
    f (1, g) = f (1, 1)

{G : Type u_1}
{A : Type u_2}
[Monoid G]
[AddCommGroup A]
[MulAction G A]
{f : G × G → A}
(hf : groupCohomology.IsTwoCocycle f)
(g : G)


theorem derivedSeries_map_eq (k : ℕ) (h : Function.Surjective f) :
    (derivedSeries R L' k).map f = derivedSeries R L k

{R : Type u}
{L : Type v}
{L' : Type w₁}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[LieRing L']
[LieAlgebra R L']
{f : L' →ₗ⁅R⁆ L}
(k : ℕ)
(h : Function.Surjective ⇑f)

LieIdeal.map f (LieAlgebra.derivedSeries R L' k) = LieAlgebra.derivedSeries R L k


theorem op_closure (s : Set R) : (closure s).op = closure (MulOpposite.unop ⁻¹' s)

{R : Type u_2}
[NonAssocSemiring R]
(s : Set R)

(Subsemiring.closure s).op = Subsemiring.closure (MulOpposite.unop ⁻¹' s)


@[simp] theorem ofNat'_sub (x : Nat) (lt : 0 < n) (y : Fin n) :
    Fin.ofNat' x lt - y = Fin.ofNat' ((n - y.val) + x) lt

{n : Nat}
(x : Nat)
(lt : 0 < n)
(y : Fin n)

Fin.ofNat' x lt - y = Fin.ofNat' (n - ↑y + x) lt


@[to_additive]
theorem prod_image' [DecidableEq α] {s : Finset γ} {g : γ → α} (h : γ → β)
    (eq : ∀ c ∈ s, f (g c) = ∏ x ∈ s.filter fun c' => g c' = g c, h x) :
    ∏ x ∈ s.image g, f x = ∏ x ∈ s, h x

(eq : ∀ c ∈ s, f (g c) = ∑ x ∈ Finset.filter (fun c' => g c' = g c) s, h x)

∑ x ∈ Finset.image g s, f x = ∑ x ∈ s, h x


theorem sum_eapproxDiff (f : α → ℝ≥0∞) (n : ℕ) (a : α) :
    (∑ k ∈ Finset.range (n + 1), (eapproxDiff f k a : ℝ≥0∞)) = eapprox f n a

{α : Type u_1}
[MeasurableSpace α]
(f : α → ℝ≥0∞)
(n : ℕ)
(a : α)

∑ k ∈ Finset.range (n + 1), ↑(↑(MeasureTheory.SimpleFunc.eapproxDiff f k) a) = ↑(MeasureTheory.SimpleFunc.eapprox f n) a


theorem Finite.bddBelow_range [IsDirected α (· ≥ ·)] (f : β → α) : BddBelow (Set.range f)

{α : Type u_1}
{β : Type u_2}
[Finite β]
[Nonempty α]
[Preorder α]
[IsDirected α fun x x_1 => x ≥ x_1]
(f : β → α)


theorem sUnion_eq_iUnion {s : Set (Set α)} : ⋃₀s = ⋃ i : s, i


/-- Multiplicativity of a multilinear map along all coordinates at the same time,
writing `f (fun i => c i • m i)` as `(∏ i, c i) • f m`. -/
theorem map_smul_univ [Fintype ι] (c : ι → R) (m : ∀ i, M₁ i) :
    (f fun i => c i • m i) = (∏ i, c i) • f m

{R : Type uR}
{ι : Type uι}
{M₁ : ι → Type v₁}
{M₂ : Type v₂}
[CommSemiring R]
[(i : ι) → AddCommMonoid (M₁ i)]
[AddCommMonoid M₂]
[(i : ι) → Module R (M₁ i)]
[Module R M₂]
(f : MultilinearMap R M₁ M₂)
[Fintype ι]
(c : ι → R)
(m : (i : ι) → M₁ i)

(f fun i => c i • m i) = (∏ i : ι, c i) • f m


theorem univ_umax : univ.{u, max (u + 1) v} = univ.{u, v}

Ordinal.univ.{u, max (u + 1) v} = Ordinal.univ.{u, v}


/-- Given a bilinear form `B` and some `x` such that `B x x ≠ 0`, the span of the singleton of `x`
  is complement to its orthogonal complement. -/
theorem isCompl_span_singleton_orthogonal {B : BilinForm K V} {x : V} (hx : ¬B.IsOrtho x x) :
    IsCompl (K ∙ x) (B.orthogonal <| K ∙ x)

{V : Type u_5}
{K : Type u_6}
[Field K]
[AddCommGroup V]
[Module K V]
{B : LinearMap.BilinForm K V}
{x : V}
(hx : ¬B.IsOrtho x x)

IsCompl (Submodule.span K {x}) (B.orthogonal (Submodule.span K {x}))


@[to_additive] lemma mabs_eq_mabs : |a|ₘ = |b|ₘ ↔ a = b ∨ a = b⁻¹

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


protected theorem ediv_le_of_le_mul {a b c : Int} (H : 0 < c) (H' : a ≤ b * c) : a / c ≤ b


theorem doublingGamma_one : doublingGamma 1 = 1


/-- **Maximum modulus principle** on a connected set. Let `U` be a (pre)connected open set in a
complex normed space.  Let `f : E → F` be a function that is complex differentiable on `U` and is
continuous on its closure. Suppose that `‖f x‖` takes its maximum value on `U` at `c ∈ U`. Then
`f x = f c` for all `x ∈ closure U`. -/
theorem eqOn_closure_of_isPreconnected_of_isMaxOn_norm {f : E → F} {U : Set E} {c : E}
    (hc : IsPreconnected U) (ho : IsOpen U) (hd : DiffContOnCl ℂ f U) (hcU : c ∈ U)
    (hm : IsMaxOn (norm ∘ f) U c) : EqOn f (const E (f c)) (closure U)

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace ℂ F]
[StrictConvexSpace ℝ F]
{f : E → F}
{U : Set E}
{c : E}
(hc : IsPreconnected U)
(ho : IsOpen U)
(hd : DiffContOnCl ℂ f U)
(hcU : c ∈ U)
(hm : IsMaxOn (norm ∘ f) U c)

Set.EqOn f (Function.const E (f c)) (closure U)


theorem QuasiconcaveOn.convex_gt (hf : QuasiconcaveOn 𝕜 s f) (r : β) :
    Convex 𝕜 ({ x ∈ s | r < f x })

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[LinearOrder β]
[SMul 𝕜 E]
{s : Set E}
{f : E → β}
(hf : QuasiconcaveOn 𝕜 s f)
(r : β)


theorem nhds_inr [Zero R] (m : M) : 𝓝 (inr m : tsze R M) = (𝓝 0).prod (𝓝 m)

{R : Type u_3}
{M : Type u_4}
[TopologicalSpace R]
[TopologicalSpace M]
[Zero R]
(m : M)

𝓝 (TrivSqZeroExt.inr m) = (𝓝 0).prod (𝓝 m)


theorem setIntegral_Ioi_zero_cpow (s : ℂ) : ∫ x in Ioi (0 : ℝ), (x : ℂ) ^ s = 0


@[to_additive]
theorem map_range (g : N →* P) (f : G →* N) : f.range.map g = (g.comp f).range

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

Subgroup.map g f.range = (g.comp f).range


theorem contDiffOn_univ : ContDiffOn 𝕜 n f univ ↔ ContDiff 𝕜 n f

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{n : ℕ∞}

ContDiffOn 𝕜 n f Set.univ ↔ ContDiff 𝕜 n f


@[to_additive (attr := simp)]
theorem preimage_mul_right_ball [IsometricSMul Gᵐᵒᵖ G] (a b : G) (r : ℝ≥0∞) :
    (fun x => x * a) ⁻¹' ball b r = ball (b / a) r

{G : Type v}
[Group G]
[PseudoEMetricSpace G]
[IsometricSMul Gᵐᵒᵖ G]
(a b : G)
(r : ℝ≥0∞)

(fun x => x * a) ⁻¹' EMetric.ball b r = EMetric.ball (b / a) r


theorem bijective_of_surjective_endomorphism
    (f : M →ₗ[R] M) (hf : Surjective f) : Bijective f

{R : Type u}
[Semiring R]
[OrzechProperty R]
{M : Type v}
[AddCommMonoid M]
[Module R M]
[Module.Finite R M]
(f : M →ₗ[R] M)
(hf : Function.Surjective ⇑f)


theorem sym_one_eq : xs.sym 1 = xs.map (· ::ₛ .nil)

List.sym 1 xs = List.map (fun x => x ::ₛ Sym.nil) xs


/-- If a family of sets `s` generates the topology, then intersections of finite
subcollections of `s` form a topological basis. -/
theorem isTopologicalBasis_of_subbasis {s : Set (Set α)} (hs : t = generateFrom s) :
    IsTopologicalBasis ((fun f => ⋂₀ f) '' { f : Set (Set α) | f.Finite ∧ f ⊆ s })

(hs : t = TopologicalSpace.generateFrom s)

TopologicalSpace.IsTopologicalBasis ((fun f => ⋂₀ f) '' {f | f.Finite ∧ f ⊆ s})


lemma zero_ne_one' [One α] [NeZero (1 : α)] : (0 : α) ≠ 1

(α : Type u_2)
[Zero α]
[One α]
[NeZero 1]


@[simp]
theorem isConstant_coe_const {l : Filter α} {b : β} : (fun _ : α ↦ b : Germ l β).IsConstant

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
{b : β}


theorem withTopEquiv_symm_top : withTopEquiv.symm ⊤ = ⊤


theorem Path.eq_cast_iff_heq {u v u' v' : U} (hu : u = u') (hv : v = v') (p : Path u v)
    (p' : Path u' v') : p' = p.cast hu hv ↔ HEq p' p

{U : Type u_1}
[Quiver U]
{u v u' v' : U}
(hu : u = u')
(hv : v = v')
(p : Quiver.Path u v)
(p' : Quiver.Path u' v')

p' = Quiver.Path.cast hu hv p ↔ HEq p' p


theorem projIci_surjective : Surjective (projIci a)


/-- Being unramified is transported via algebra isomorphisms. -/
theorem of_equiv [Unramified R A] (e : A ≃ₐ[R] B) : Unramified R B

{R : Type u}
[CommRing R]
{A B : Type u}
[CommRing A]
[Algebra R A]
[CommRing B]
[Algebra R B]
[Algebra.Unramified R A]
(e : A ≃ₐ[R] B)


@[to_additive]
theorem Nonempty.smul_finset (hs : s.Nonempty) : (a • s).Nonempty

{α : Type u_2}
{β : Type u_3}
[DecidableEq β]
[SMul α β]
{s : Finset β}
{a : α}
(hs : s.Nonempty)


theorem maximals_eq_minimals [IsSymm α r] : maximals r s = minimals r s

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
[IsSymm α r]


/-- An element in a non-unital C⋆-algebra is selfadjoint if and only if it is normal and its
quasispectrum is contained in `ℝ`. -/
lemma isSelfAdjoint_iff_isStarNormal_and_quasispectrumRestricts {a : A} :
    IsSelfAdjoint a ↔ IsStarNormal a ∧ QuasispectrumRestricts a Complex.reCLM

IsSelfAdjoint a ↔ IsStarNormal a ∧ QuasispectrumRestricts a ⇑Complex.reCLM


/-- The first modified cyclotomic polyomial is `X - 1`. -/
@[simp]
theorem cyclotomic'_one (R : Type*) [CommRing R] [IsDomain R] : cyclotomic' 1 R = X - 1

(R : Type u_2)
[CommRing R]
[IsDomain R]

Polynomial.cyclotomic' 1 R = Polynomial.X - 1


@[simp]
theorem sqrt_mul' (x) {y : ℝ} (hy : 0 ≤ y) : √(x * y) = √x * √y


theorem HasBasis.prod_same_index_mono {ι : Type*} [LinearOrder ι] {p : ι → Prop} {sa : ι → Set α}
    {sb : ι → Set β} (hla : la.HasBasis p sa) (hlb : lb.HasBasis p sb)
    (hsa : MonotoneOn sa { i | p i }) (hsb : MonotoneOn sb { i | p i }) :
    (la ×ˢ lb).HasBasis p fun i => sa i ×ˢ sb i

{α : Type u_1}
{β : Type u_2}
{la : Filter α}
{lb : Filter β}
{ι : Type u_6}
[LinearOrder ι]
{p : ι → Prop}
{sa : ι → Set α}
{sb : ι → Set β}
(hla : la.HasBasis p sa)
(hlb : lb.HasBasis p sb)
(hsa : MonotoneOn sa {i | p i})
(hsb : MonotoneOn sb {i | p i})


theorem CovBy.nhdsWithin_Ioi {a b : α} (h : a ⋖ b) : 𝓝[>] a = ⊥

{α : Type u}
[TopologicalSpace α]
[LinearOrder α]
[ClosedIciTopology α]
{a b : α}
(h : a ⋖ b)


theorem hasSum_zeta_four : HasSum (fun n : ℕ => (1 : ℝ) / (n : ℝ) ^ 4) (π ^ 4 / 90)


/-- If `L/K` is a finite Galois extension of fields, then, for all `(x : 𝓞 L)` we have that
`x ∣ algebraMap (𝓞 K) (𝓞 L) (norm K x)`. -/
theorem dvd_norm [IsGalois K L] (x : 𝓞 L) : x ∣ algebraMap (𝓞 K) (𝓞 L) (norm K x)

{L : Type u_1}
(K : Type u_2)
[Field K]
[Field L]
[Algebra K L]
[FiniteDimensional K L]
[IsGalois K L]
(x : 𝓞 L)

x ∣ (algebraMap (𝓞 K) (𝓞 L)) ((RingOfIntegers.norm K) x)


theorem val_add_one_le_of_lt {n : Nat} {a b : Fin n} (h : a < b) : (a : Nat) + 1 ≤ (b : Nat)


theorem pow_card_sub_one_eq_one (a : K) (ha : a ≠ 0) : a ^ (q - 1) = 1

{K : Type u_1}
[GroupWithZero K]
[Fintype K]
(a : K)
(ha : a ≠ 0)


theorem lt_birthday_iff {x : PGame} {o : Ordinal} :
    o < x.birthday ↔
      (∃ i : x.LeftMoves, o ≤ (x.moveLeft i).birthday) ∨
        ∃ i : x.RightMoves, o ≤ (x.moveRight i).birthday

{x : SetTheory.PGame}
{o : Ordinal.{u_1}}

o < x.birthday ↔ (∃ i, o ≤ (x.moveLeft i).birthday) ∨ ∃ i, o ≤ (x.moveRight i).birthday


@[reassoc (attr := simp)]
theorem colimit.w (F : J ⥤ C) [HasColimit F] {j j' : J} (f : j ⟶ j') :
    F.map f ≫ colimit.ι F j' = colimit.ι F j

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u}
[CategoryTheory.Category.{v, u} C]
(F : J ⥤ C)
[CategoryTheory.Limits.HasColimit F]
{j j' : J}
(f : j ⟶ j')

F.map f ≫ CategoryTheory.Limits.colimit.ι F j' = CategoryTheory.Limits.colimit.ι F j


@[simp]
theorem toLinearMap_inj {f g : E →ₛₗᵢ[σ₁₂] E₂} : f.toLinearMap = g.toLinearMap ↔ f = g

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
{f g : E →ₛₗᵢ[σ₁₂] E₂}


@[local simp]
theorem matrix_vecEmpty_coeff {R} (i j) :
    @coeff p R (Matrix.vecEmpty i) j = (Matrix.vecEmpty i : ℕ → R) j


theorem iSup_torsionBySet_ideal_eq_torsionBySet_iInf :
    ⨆ i ∈ S, torsionBySet R M (p i) = torsionBySet R M ↑(⨅ i ∈ S, p i)

(hp : (↑S).Pairwise fun i j => p i ⊔ p j = ⊤)

⨆ i ∈ S, Submodule.torsionBySet R M ↑(p i) = Submodule.torsionBySet R M ↑(⨅ i ∈ S, p i)


theorem parts_nonempty_iff : P.parts.Nonempty ↔ a ≠ ⊥

{α : Type u_1}
[Lattice α]
[OrderBot α]
{a : α}
{P : Finpartition a}


/-- The value of the Infimum of a family of outer measures on a nonempty set is not simply
the minimum value of a measure on that set: it is the infimum sum of measures of countable set of
sets that covers that set, where a different measure can be used for each set in the cover. -/
theorem iInf_apply' {ι} (m : ι → OuterMeasure α) {s : Set α} (hs : s.Nonempty) :
    (⨅ i, m i) s = ⨅ (t : ℕ → Set α) (_ : s ⊆ iUnion t), ∑' n, ⨅ i, m i (t n)

{α : Type u_1}
{ι : Sort u_2}
(m : ι → MeasureTheory.OuterMeasure α)
{s : Set α}
(hs : s.Nonempty)

(⨅ i, m i) s = ⨅ t, ⨅ (_ : s ⊆ Set.iUnion t), ∑' (n : ℕ), ⨅ i, (m i) (t n)


theorem conj_smul_le_of_le {P H : Subgroup G} (hP : P ≤ H) (h : H) :
    MulAut.conj (h : G) • P ≤ H

{G : Type u_2}
[Group G]
{P H : Subgroup G}
(hP : P ≤ H)
(h : ↥H)


@[to_additive]
theorem eq_symm_apply (e : M ≃* N) {x y} : y = e.symm x ↔ e y = x

{M : Type u_6}
{N : Type u_7}
[Add M]
[Add N]
(e : M ≃+ N)
{x : N}
{y : M}


theorem ContinuousWithinAt.lowerSemicontinuousWithinAt {f : α → γ} (h : ContinuousWithinAt f s x) :
    LowerSemicontinuousWithinAt f s x

{α : Type u_1}
[TopologicalSpace α]
{x : α}
{s : Set α}
{γ : Type u_3}
[LinearOrder γ]
[TopologicalSpace γ]
[OrderTopology γ]
{f : α → γ}
(h : ContinuousWithinAt f s x)


theorem measure_diff_null (ht : μ t = 0) : μ (s \ t) = μ s

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


theorem gcd_mul_lcm (n m : ℕ+) : gcd n m * lcm n m = n * m


/-- A self-adjoint operator preserves orthogonal complements of its eigenspaces. -/
theorem invariant_orthogonalComplement_eigenspace (μ : 𝕜) (v : E) (hv : v ∈ (eigenspace T μ)ᗮ) :
    T v ∈ (eigenspace T μ)ᗮ

{𝕜 : Type u_1}
[RCLike 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{T : E →ₗ[𝕜] E}
(hT : T.IsSymmetric)
(μ : 𝕜)
(v : E)
(hv : v ∈ (Module.End.eigenspace T μ)ᗮ)


lemma mul_def (a b : WithTop α) :
    a * b = if a = 0 ∨ b = 0 then 0 else WithTop.map₂ (· * ·) a b

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

a * b = if a = 0 ∨ b = 0 then 0 else WithTop.map₂ (fun x x_1 => x * x_1) a b


theorem coe_smul_addMonoidHom (c : Mᵈᵐᵃ) (f : A →+ B) : ⇑(c • f) = c • ⇑f

{A : Type u_5}
{B : Type u_6}
{M : Type u_7}
[AddMonoid A]
[DistribSMul M A]
[AddZeroClass B]
(c : Mᵈᵐᵃ)
(f : A →+ B)


@[simp]
theorem eventually_cofinite {p : α → Prop} : (∀ᶠ x in cofinite, p x) ↔ { x | ¬p x }.Finite

(∀ᶠ (x : α) in Filter.cofinite, p x) ↔ {x | ¬p x}.Finite


private lemma natDegree_coeff_Φ_ofNat (n : ℕ) :
    (W.Φ n).natDegree ≤ n ^ 2 ∧ (W.Φ n).coeff (n ^ 2) = 1

{R : Type u}
[CommRing R]
(W : WeierstrassCurve R)
(n : ℕ)

(W.Φ ↑n).natDegree ≤ n ^ 2 ∧ (W.Φ ↑n).coeff (n ^ 2) = 1


/--
If a series `a₀ -r→ a₁ -r→ ...` has positive length, then `a₁ -r→ ...` is another series
-/
@[simps]
def tail (p : RelSeries r) (len_pos : p.length ≠ 0) : RelSeries r

{α : Type u_1}
{r : Rel α α}
(p : RelSeries r)
(len_pos : p.length ≠ 0)


theorem integral_comp_mul_left_Ioi (g : ℝ → E) (a : ℝ) {b : ℝ} (hb : 0 < b) :
    (∫ x in Ioi a, g (b * x)) = b⁻¹ • ∫ x in Ioi (b * a), g x

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(g : ℝ → E)
(a : ℝ)
{b : ℝ}
(hb : 0 < b)

∫ (x : ℝ) in Set.Ioi a, g (b * x) = b⁻¹ • ∫ (x : ℝ) in Set.Ioi (b * a), g x


theorem continuous_iff_continuousOn_univ {f : α → β} : Continuous f ↔ ContinuousOn f univ

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


@[simp, reassoc]
lemma lift_lifts {X Y : Profinite} {Z : Stonean} (e : Stonean.toProfinite.obj Z ⟶ Y) (f : X ⟶ Y)
    [Epi f] : lift e f ≫ f = e

{X Y : Profinite}
{Z : Stonean}
(e : Stonean.toProfinite.obj Z ⟶ Y)
(f : X ⟶ Y)
[CategoryTheory.Epi f]


@[to_additive]
theorem measurePreserving_div_right (μ : Measure G) [IsMulRightInvariant μ] (g : G) :
    MeasurePreserving (· / g) μ μ

{G : Type u_2}
[MeasurableSpace G]
[AddGroup G]
[MeasurableAdd G]
(μ : MeasureTheory.Measure G)
[μ.IsAddRightInvariant]
(g : G)

MeasureTheory.MeasurePreserving (fun x => x - g) μ μ


theorem Real.smul_iSup_of_nonneg (ha : 0 ≤ a) (f : ι → ℝ) : (a • ⨆ i, f i) = ⨆ i, a • f i

{ι : Sort u_1}
{α : Type u_2}
[LinearOrderedField α]
[MulActionWithZero α ℝ]
[OrderedSMul α ℝ]
{a : α}
(ha : 0 ≤ a)
(f : ι → ℝ)


/-- To show a property is true on the even parts, it suffices to show it is true on the
scalars, closed under addition, and under left-multiplication by a pair of vectors. -/
@[elab_as_elim]
theorem even_induction {motive : ∀ x, x ∈ evenOdd Q 0 → Prop}
    (algebraMap : ∀ r : R, motive (algebraMap _ _ r) (SetLike.algebraMap_mem_graded _ _))
    (add : ∀ x y hx hy, motive x hx → motive y hy → motive (x + y) (Submodule.add_mem _ hx hy))
    (ι_mul_ι_mul :
      ∀ m₁ m₂ x hx,
        motive x hx →
          motive (ι Q m₁ * ι Q m₂ * x)
            (zero_add (0 : ZMod 2) ▸ SetLike.mul_mem_graded (ι_mul_ι_mem_evenOdd_zero Q m₁ m₂) hx))
    (x : CliffordAlgebra Q) (hx : x ∈ evenOdd Q 0) : motive x hx

{motive : (x : CliffordAlgebra Q) → x ∈ CliffordAlgebra.evenOdd Q 0 → Prop}

(algebraMap : ∀ (r : R), motive ((algebraMap R (CliffordAlgebra Q)) r) ⋯)

(add :
  ∀ (x y : CliffordAlgebra Q) (hx : x ∈ CliffordAlgebra.evenOdd Q 0) (hy : y ∈ CliffordAlgebra.evenOdd Q 0),
    motive x hx → motive y hy → motive (x + y) ⋯)

(ι_mul_ι_mul :
  ∀ (m₁ m₂ : M) (x : CliffordAlgebra Q) (hx : x ∈ CliffordAlgebra.evenOdd Q 0),
    motive x hx → motive ((CliffordAlgebra.ι Q) m₁ * (CliffordAlgebra.ι Q) m₂ * x) ⋯)


@[simp]
theorem cons_val (h : a ∉ s) : (cons a s h).1 = a ::ₘ s.1

{α : Type u_1}
{s : Finset α}
{a : α}
(h : a ∉ s)


@[simp, mfld_simps]
theorem preimage_symm_proj_baseSet :
    e.toPartialEquiv.symm ⁻¹' (proj ⁻¹' e.baseSet) ∩ e.target = e.target

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

↑e.symm ⁻¹' (proj ⁻¹' e.baseSet) ∩ e.target = e.target


/-- `t ∈ ∂𝒜` iff `t` is exactly one element less than something from `𝒜`.

See also `Finset.mem_shadow_iff_exists_mem_card_add_one`. -/
lemma mem_shadow_iff_exists_sdiff : t ∈ ∂ 𝒜 ↔ ∃ s ∈ 𝒜, t ⊆ s ∧ (s \ t).card = 1

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

t ∈ 𝒜.shadow ↔ ∃ s ∈ 𝒜, t ⊆ s ∧ (s \ t).card = 1


@[simp, norm_cast]
theorem coe_map (m : α → β) (f : Ultrafilter α) : (map m f : Filter β) = Filter.map m ↑f

{α : Type u}
{β : Type v}
(m : α → β)
(f : Ultrafilter α)

↑(Ultrafilter.map m f) = Filter.map m ↑f


@[simp]
theorem coe_restrictScalars' (f : B →A[S] C) : ⇑(f.restrictScalars R) = f

{R : Type u_1}
[CommSemiring R]
{S : Type u_3}
[CommSemiring S]
[Algebra R S]
{B : Type u_4}
[Ring B]
[TopologicalSpace B]
[Algebra R B]
[Algebra S B]
[IsScalarTower R S B]
{C : Type u_5}
[Ring C]
[TopologicalSpace C]
[Algebra R C]
[Algebra S C]
[IsScalarTower R S C]
(f : B →A[S] C)

⇑(ContinuousAlgHom.restrictScalars R f) = ⇑f


theorem _root_.LinearMap.compQuadraticMap_polarBilin (f : N →ₗ[R] N') (Q : QuadraticMap R M N) :
    (f.compQuadraticMap' Q).polarBilin = Q.polarBilin.compr₂ f

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
{N' : Type u_8}
[AddCommGroup N']
[Module R N']
(f : N →ₗ[R] N')
(Q : QuadraticMap R M N)

(f.compQuadraticMap' Q).polarBilin = LinearMap.compr₂ Q.polarBilin f


/-- The **Plünnecke-Ruzsa inequality**. Multiplication version. Note that this is genuinely harder
than the division version because we cannot use a double counting argument. -/
@[to_additive "The **Plünnecke-Ruzsa inequality**. Addition version. Note that this is genuinely
harder than the subtraction version because we cannot use a double counting argument."]
theorem pluennecke_ruzsa_inequality_pow_div_pow_mul (hA : A.Nonempty) (B : Finset α) (m n : ℕ) :
    ((B ^ m / B ^ n).card) ≤ ((A * B).card / A.card : ℚ≥0) ^ (m + n) * A.card

{α : Type u_1}
[CommGroup α]
[DecidableEq α]
{A : Finset α}
(hA : A.Nonempty)
(B : Finset α)
(m n : ℕ)

↑(B ^ m / B ^ n).card ≤ (↑(A * B).card / ↑A.card) ^ (m + n) * ↑A.card


@[simp 1100] theorem tailD_cons : @tailD α (a::l) l' = l


theorem image_subset_image₂_left (hb : b ∈ t) : s.image (fun a => f a b) ⊆ image₂ f s t

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
[DecidableEq γ]
{f : α → β → γ}
{s : Finset α}
{t : Finset β}
{b : β}
(hb : b ∈ t)

Finset.image (fun a => f a b) s ⊆ Finset.image₂ f s t


lemma disjoint_diffFinset₀ (hC : IsSetSemiring C) (hs : s ∈ C) (hI : ↑I ⊆ C) :
    Disjoint I (hC.diffFinset₀ hs hI)

{α : Type u_1}
{C : Set (Set α)}
{s : Set α}
{I : Finset (Set α)}
(hC : MeasureTheory.IsSetSemiring C)
(hs : s ∈ C)
(hI : ↑I ⊆ C)


theorem Gamma_cong_eq_self (N : ℕ) (g : ConjAct SL(2, ℤ)) : g • Gamma N = Gamma N

g • CongruenceSubgroup.Gamma N = CongruenceSubgroup.Gamma N


theorem isCoprime_of_dvd {x y : α} (nonzero : ¬(x = 0 ∧ y = 0))
    (H : ∀ z ∈ nonunits α, z ≠ 0 → z ∣ x → ¬z ∣ y) : IsCoprime x y


theorem NF.of_dvd_omega {e n a} (h : NF (ONote.oadd e n a)) :
    ω ∣ repr (ONote.oadd e n a) → repr e ≠ 0 ∧ ω ∣ repr a

{e : ONote}
{n : ℕ+}
{a : ONote}
(h : (e.oadd n a).NF)

ω ∣ (e.oadd n a).repr → e.repr ≠ 0 ∧ ω ∣ a.repr


/-- The composition of morphisms of snake inputs. -/
@[simps]
def comp (f : Hom S₁ S₂) (g : Hom S₂ S₃) : Hom S₁ S₃

{S₁ S₂ S₃ : CategoryTheory.ShortComplex.SnakeInput C}

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


/-- Subtracting two points produces 0 if and only if they are
equal. -/
@[simp]
theorem vsub_eq_zero_iff_eq {p₁ p₂ : P} : p₁ -ᵥ p₂ = (0 : G) ↔ p₁ = p₂

{G : Type u_1}
{P : Type u_2}
[AddGroup G]
[T : AddTorsor G P]
{p₁ p₂ : P}


@[to_additive]
theorem mulIndicator_one_preimage (s : Set M) :
    t.mulIndicator 1 ⁻¹' s ∈ ({Set.univ, ∅} : Set (Set α))

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


@[to_additive]
theorem orderOf_eq_zero (h : ¬IsOfFinOrder x) : orderOf x = 0

{G : Type u_1}
[AddMonoid G]
{x : G}
(h : ¬IsOfFinAddOrder x)


theorem Nonempty.div_zero (hs : s.Nonempty) : s / 0 = 0

{α : Type u_2}
[GroupWithZero α]
{s : Set α}
(hs : s.Nonempty)


@[simp] theorem zeroExtend_zero (m n : Nat) : zeroExtend m 0#n = 0#m


theorem continuous_ofMul : Continuous (ofMul : X → Additive X)


lemma monic_polynomial : W.polynomial.Monic

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


theorem dist_midpoint_midpoint_le (p₁ p₂ p₃ p₄ : V) :
    dist (midpoint ℝ p₁ p₂) (midpoint ℝ p₃ p₄) ≤ (dist p₁ p₃ + dist p₂ p₄) / 2

{V : Type u_2}
[SeminormedAddCommGroup V]
[NormedSpace ℝ V]
(p₁ p₂ p₃ p₄ : V)


@[simp]
theorem isBigO_top : f =O[⊤] g ↔ ∃ C, ∀ x, ‖f x‖ ≤ C * ‖g x‖

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{f : α → E}
{g : α → F}

f =O[⊤] g ↔ ∃ C, ∀ (x : α), ‖f x‖ ≤ C * ‖g x‖


theorem map_smul_right (r : R) (f : M →ₗ[R] P) (g : N →ₗ[R] Q) : map f (r • g) = r • map f g

{R : Type u_1}
[CommSemiring R]
{M : Type u_4}
{N : Type u_5}
{P : Type u_6}
{Q : Type u_7}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[AddCommMonoid Q]
[Module R M]
[Module R N]
[Module R P]
[Module R Q]
(r : R)
(f : M →ₗ[R] P)
(g : N →ₗ[R] Q)

TensorProduct.map f (r • g) = r • TensorProduct.map f g


theorem conj_inv (x : ℂ) : conj x⁻¹ = (conj x)⁻¹

(starRingEnd ℂ) x⁻¹ = ((starRingEnd ℂ) x)⁻¹


@[simp]
theorem restrictPreimage_mk (h : a ∈ f ⁻¹' t) : t.restrictPreimage f ⟨a, h⟩ = ⟨f a, h⟩

{α : Type u_1}
{β : Type u_2}
(t : Set β)
{f : α → β}
{a : α}
(h : a ∈ f ⁻¹' t)


/-- The object `X ⊗ Y` in the `Dial C` category just tuples the left and right components. -/
@[simps] def tensorObj (X Y : Dial C) : Dial C

(X.tensorObj Y).rel =
  (CategoryTheory.Subobject.pullback
          (CategoryTheory.Limits.prod.map CategoryTheory.Limits.prod.fst CategoryTheory.Limits.prod.fst)).obj
      X.rel ⊓
    (CategoryTheory.Subobject.pullback
          (CategoryTheory.Limits.prod.map CategoryTheory.Limits.prod.snd CategoryTheory.Limits.prod.snd)).obj
      Y.rel


lemma sinZeta_eq (a : UnitAddCircle) (s : ℂ) :
    sinZeta a s = (expZeta a s - expZeta (-a) s) / (2 * I)

HurwitzZeta.sinZeta a s = (HurwitzZeta.expZeta a s - HurwitzZeta.expZeta (-a) s) / (2 * Complex.I)


@[to_additive]
nonrec theorem IsUnit.measurable_const_smul_iff {c : M} (hc : IsUnit c) :
    (Measurable fun x => c • f x) ↔ Measurable f

{M : Type u_2}
{β : Type u_3}
{α : Type u_4}
[MeasurableSpace M]
[MeasurableSpace β]
[AddMonoid M]
[AddAction M β]
[MeasurableVAdd M β]
[MeasurableSpace α]
{f : α → β}
{c : M}
(hc : IsAddUnit c)

(Measurable fun x => c +ᵥ f x) ↔ Measurable f


@[to_additive]
theorem mulIndicator_const_preimage (U : Set α) (s : Set M) (a : M) :
    (U.mulIndicator fun _ => a) ⁻¹' s ∈ ({Set.univ, U, Uᶜ, ∅} : Set (Set α))

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

(U.indicator fun x => a) ⁻¹' s ∈ {Set.univ, U, Uᶜ, ∅}


theorem lie_eq_bot_iff : ⁅I, N⁆ = ⊥ ↔ ∀ x ∈ I, ∀ m ∈ N, ⁅(x : L), m⁆ = 0

{R : Type u}
{L : Type v}
{M : Type w}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
(N : LieSubmodule R L M)
(I : LieIdeal R L)

⁅I, N⁆ = ⊥ ↔ ∀ x ∈ I, ∀ m ∈ N, ⁅x, m⁆ = 0


/-- (An auxiliary definition for `functorCategoryMonoidal`.)
Tensor product of functors `C ⥤ D`, when `D` is monoidal.
 -/
@[simps]
def tensorObj : C ⥤ D

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

∀ {X Y : C} (f : X ⟶ Y), (CategoryTheory.Monoidal.FunctorCategory.tensorObj F G).map f = F.map f ⊗ G.map f


@[simp]
theorem NatTrans.mapHomotopyCategory_comp (c : ComplexShape ι) {F G H : V ⥤ W} [F.Additive]
    [G.Additive] [H.Additive] (α : F ⟶ G) (β : G ⟶ H) :
    NatTrans.mapHomotopyCategory (α ≫ β) c =
      NatTrans.mapHomotopyCategory α c ≫ NatTrans.mapHomotopyCategory β c

{ι : Type u_2}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{W : Type u_3}
[CategoryTheory.Category.{u_4, u_3} W]
[CategoryTheory.Preadditive W]
(c : ComplexShape ι)
{F G H : V ⥤ W}
[F.Additive]
[G.Additive]
[H.Additive]
(α : F ⟶ G)
(β : G ⟶ H)

CategoryTheory.NatTrans.mapHomotopyCategory (α ≫ β) c =
  CategoryTheory.NatTrans.mapHomotopyCategory α c ≫ CategoryTheory.NatTrans.mapHomotopyCategory β c


lemma succ_pred (a : ℤ) : succ (pred a) = a


{α : Type u}
(A : Matrix (Fin 3) (Fin 3) α)


theorem Scheme.Spec_map_presheaf_map_eqToHom {X : Scheme} {U V : X.Opens} (h : U = V) (W) :
    (Spec.map (X.presheaf.map (eqToHom h).op)).app W = eqToHom (by cases h; dsimp; simp)

(W : (AlgebraicGeometry.Spec (X.presheaf.obj (Opposite.op V))).Opens)

AlgebraicGeometry.Scheme.Hom.app (AlgebraicGeometry.Spec.map (X.presheaf.map (CategoryTheory.eqToHom h).op)) W =
  CategoryTheory.eqToHom ⋯


/--
For presheaves valued in a concrete category whose forgetful functor preserves filtered colimits,
every element of the stalk is the germ of a section.
-/
theorem germ_exist (F : X.Presheaf C) (x : X) (t : (stalk.{v, u} F x : Type v)) :
    ∃ (U : Opens X) (m : x ∈ U) (s : F.obj (op U)), F.germ ⟨x, m⟩ s = t

(t : (CategoryTheory.forget C).obj (F.stalk x))

∃ U, ∃ (m : x ∈ U), ∃ s, (F.germ ⟨x, m⟩) s = t


/-- `Quot.mk r` is a surjective function. -/
theorem surjective_quot_mk (r : α → α → Prop) : Function.Surjective (Quot.mk r)


@[simp]
protected theorem mem_closure {K : ConvexCone 𝕜 E} {a : E} :
    a ∈ K.closure ↔ a ∈ closure (K : Set E)

{𝕜 : Type u_1}
[OrderedSemiring 𝕜]
{E : Type u_2}
[AddCommMonoid E]
[TopologicalSpace E]
[ContinuousAdd E]
[SMul 𝕜 E]
[ContinuousConstSMul 𝕜 E]
{K : ConvexCone 𝕜 E}
{a : E}


/-- If a small natural number is divisible by a larger natural number,
the small number is zero. -/
lemma eq_zero_of_dvd_of_lt (w : a ∣ b) (h : b < a) : b = 0


/-- **First moment method**. The minimum of a measurable function is smaller than its mean, while
avoiding a null set. -/
theorem exists_not_mem_null_le_laverage (hμ : μ ≠ 0) (hf : AEMeasurable f μ) (hN : μ N = 0) :
    ∃ x, x ∉ N ∧ f x ≤ ⨍⁻ a, f a ∂μ

{α : Type u_1}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{N : Set α}
{f : α → ℝ≥0∞}
[MeasureTheory.IsFiniteMeasure μ]
(hμ : μ ≠ 0)
(hf : AEMeasurable f μ)
(hN : μ N = 0)


lemma LinearIndependent.eq_zero_of_pair {x y : M} (h : LinearIndependent R ![x, y])
    {s t : R} (h' : s • x + t • y = 0) : s = 0 ∧ t = 0

{R : Type u_2}
{M : Type u_4}
[Semiring R]
[AddCommMonoid M]
[Module R M]
{x y : M}
(h : LinearIndependent R ![x, y])
{s t : R}
(h' : s • x + t • y = 0)


theorem HasFPowerSeriesOnBall.neg (hf : HasFPowerSeriesOnBall f pf x r) :
    HasFPowerSeriesOnBall (-f) (-pf) x r

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{pf : FormalMultilinearSeries 𝕜 E F}
{x : E}
{r : ℝ≥0∞}
(hf : HasFPowerSeriesOnBall f pf x r)


/-- A pseudo-metric space is complete iff every Cauchy sequence converges. -/
theorem Metric.complete_of_cauchySeq_tendsto :
    (∀ u : ℕ → α, CauchySeq u → ∃ a, Tendsto u atTop (𝓝 a)) → CompleteSpace α

(∀ (u : ℕ → α), CauchySeq u → ∃ a, Filter.Tendsto u Filter.atTop (𝓝 a)) → CompleteSpace α


theorem range_smul' (f : V →ₗ[K] V₂) (a : K) :
    range (a • f) = ⨆ _ : a ≠ 0, range f

{K : Type u_4}
{V : Type u_9}
{V₂ : Type u_10}
[Semifield K]
[AddCommMonoid V]
[Module K V]
[AddCommMonoid V₂]
[Module K V₂]
(f : V →ₗ[K] V₂)
(a : K)

LinearMap.range (a • f) = ⨆ (_ : a ≠ 0), LinearMap.range f


@[to_additive (attr := simp)]
theorem div_inv_eq_mul : a / b⁻¹ = a * b

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


lemma image_injective (hf : Injective f) : Injective (image f)

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


@[simp]
theorem coe_pure (a : α) : ↑(pure a : Ultrafilter α) = (pure a : Filter α)


@[simp]
theorem toList_eq_nil {s : Finset α} : s.toList = [] ↔ s = ∅


theorem subtypeRestr_symm_eqOn_of_le {U V : Opens X} (hU : Nonempty U) (hV : Nonempty V)
    (hUV : U ≤ V) : EqOn (e.subtypeRestr hV).symm (Set.inclusion hUV ∘ (e.subtypeRestr hU).symm)
      (e.subtypeRestr hU).target

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)
{U V : TopologicalSpace.Opens X}
(hU : Nonempty ↥U)
(hV : Nonempty ↥V)
(hUV : U ≤ V)

Set.EqOn (↑(e.subtypeRestr hV).symm) (Set.inclusion hUV ∘ ↑(e.subtypeRestr hU).symm) (e.subtypeRestr hU).target


theorem SOppSide.trans_sSameSide {s : AffineSubspace R P} {x y z : P} (hxy : s.SOppSide x y)
    (hyz : s.SSameSide y z) : s.SOppSide x z

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[LinearOrderedField R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x y z : P}
(hxy : s.SOppSide x y)
(hyz : s.SSameSide y z)


lemma withDensity_rnDeriv_of_subset_mutuallySingularSetSlice [IsFiniteKernel κ]
    [IsFiniteKernel η] {a : α} {s : Set γ}
    (hs : s ⊆ mutuallySingularSetSlice κ η a) :
    withDensity η (rnDeriv κ η) a s = 0

[hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ]

(hs : s ⊆ κ.mutuallySingularSetSlice η a)


@[simp]
theorem absNorm_span_singleton [Module.Finite ℚ K] (x : K) :
    absNorm (spanSingleton R⁰ x) = |(Algebra.norm ℚ x)|

[IsLocalization (Algebra.algebraMapSubmonoid R (nonZeroDivisors ℤ)) K]

FractionalIdeal.absNorm (FractionalIdeal.spanSingleton (nonZeroDivisors R) x) = |(Algebra.norm ℚ) x|


theorem not_sbtw_of_btw {a b c : α} (h : btw a b c) : ¬sbtw c b a

{α : Type u_1}
[CircularPreorder α]
{a b c : α}
(h : btw a b c)