/-- A `SubNegMonoid` is an `AddMonoid` with unary `-` and binary `-` operations
satisfying `sub_eq_add_neg : ∀ a b, a - b = a + -b`.

The default for `sub` is such that `a - b = a + -b` holds by definition.

Adding `sub` as a field rather than defining `a - b := a + -b` allows us to
avoid certain classes of unification failures, for example:
Let `foo X` be a type with a `∀ X, Sub (Foo X)` instance but no
`∀ X, Neg (Foo X)`. Suppose we also have an instance
`∀ X [Cromulent X], AddGroup (Foo X)`. Then the `(-)` coming from
`AddGroup.sub` cannot be definitionally equal to the `(-)` coming from
`Foo.Sub`.

In the same way, adding a `zsmul` field makes it possible to avoid definitional failures
in diamonds. See the definition of `AddMonoid` and Note [forgetful inheritance] for more
explanations on this.
-/
class SubNegMonoid (G : Type u) extends AddMonoid G, Neg G, Sub G where
  protected sub := SubNegMonoid.sub'
  protected sub_eq_add_neg : ∀ a b : G, a - b = a + -b := by intros; rfl
  /-- Multiplication by an integer.
  Set this to `zsmulRec` unless `Module` diamonds are possible. -/
  protected zsmul : ℤ → G → G
  protected zsmul_zero' : ∀ a : G, zsmul 0 a = 0 := by intros; rfl
  protected zsmul_succ' (n : ℕ) (a : G) :
      zsmul (Int.ofNat n.succ) a = zsmul (Int.ofNat n) a + a := by
    intros; rfl
  protected zsmul_neg' (n : ℕ) (a : G) : zsmul (Int.negSucc n) a = -zsmul n.succ a := by
    intros; rfl

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

SubNegMonoid.zsmul (Int.negSucc n) a = -SubNegMonoid.zsmul (↑n.succ) a


/-- If a monotone function is equal at two points, it is equal between all of them -/
theorem Monotone.eq_of_le_of_le {a₁ a₂ : α} (h_mon : Monotone f) (h_fa : f a₁ = f a₂) {i : α}
    (h₁ : a₁ ≤ i) (h₂ : i ≤ a₂) : f i = f a₁

{α : Type u}
{β : Type v}
[LinearOrder α]
[PartialOrder β]
{f : α → β}
{a₁ a₂ : α}
(h_mon : Monotone f)
(h_fa : f a₁ = f a₂)
{i : α}
(h₁ : a₁ ≤ i)
(h₂ : i ≤ a₂)


@[to_additive (attr := simp)]
lemma min_one [LinearOrder α] : (1 : Finset α).min = 1


/-- If `f` is countably generated and `f.HasBasis p s`, then `f` admits a decreasing basis
enumerated by natural numbers such that all sets have the form `s i`. More precisely, there is a
sequence `i n` such that `p (i n)` for all `n` and `s (i n)` is a decreasing sequence of sets which
forms a basis of `f`-/
theorem HasBasis.exists_antitone_subbasis {f : Filter α} [h : f.IsCountablyGenerated]
    {p : ι' → Prop} {s : ι' → Set α} (hs : f.HasBasis p s) :
    ∃ x : ℕ → ι', (∀ i, p (x i)) ∧ f.HasAntitoneBasis fun i => s (x i)

{α : Type u_1}
{ι' : Sort u_5}
{f : Filter α}
[h : f.IsCountablyGenerated]
{p : ι' → Prop}
{s : ι' → Set α}
(hs : f.HasBasis p s)

∃ x, (∀ (i : ℕ), p (x i)) ∧ f.HasAntitoneBasis fun i => s (x i)


theorem Tendsto.atBot_mul_atTop (hf : Tendsto f l atBot) (hg : Tendsto g l atTop) :
    Tendsto (fun x => f x * g x) l atBot

{α : Type u_3}
{β : Type u_4}
[OrderedRing α]
{l : Filter β}
{f g : β → α}
(hf : Filter.Tendsto f l Filter.atBot)
(hg : Filter.Tendsto g l Filter.atTop)

Filter.Tendsto (fun x => f x * g x) l Filter.atBot


theorem not_mem_Ioc_of_gt (hb : b < c) : c ∉ Ioc a b

{α : Type u_1}
[Preorder α]
{a b c : α}
(hb : b < c)


@[simp] lemma compls_singleton (a : α) : {a}ᶜˢ = {aᶜ}

{α : Type u_2}
[BooleanAlgebra α]
(a : α)


theorem ppow_mul_comm (m n : ℕ+) (x : M) :
    x ^ m * x ^ n = x ^ n * x ^ m

{M : Type u_1}
[Mul M]
[Pow M ℕ+]
[PNatPowAssoc M]
(m n : ℕ+)
(x : M)


theorem natCast_zero : ((0 : Nat) : Int) = (0 : Int)


lemma isLeftAdjoint_inverse : e.inverse.IsLeftAdjoint

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


/-- Show that the functor given by `leftAdjointOfEquiv` is indeed left adjoint to `G`. Dual
to `adjunctionOfRightEquiv`. -/
@[simps!]
def adjunctionOfEquivLeft : leftAdjointOfEquiv e he ⊣ G

(e : (X : C) → (Y : D) → (F_obj X ⟶ Y) ≃ (X ⟶ G.obj Y))

(he :
  ∀ (X : C) (Y Y' : D) (g : Y ⟶ Y') (h : F_obj X ⟶ Y),
    (e X Y') (CategoryTheory.CategoryStruct.comp h g) = CategoryTheory.CategoryStruct.comp ((e X Y) h) (G.map g))

(CategoryTheory.Adjunction.adjunctionOfEquivLeft e he).homEquiv X Y = e X Y


/-- **Uniqueness of Haar measures**:
Two Haar measures on a compact group coincide up to a multiplicative factor. -/
@[to_additive isAddInvariant_eq_smul_of_compactSpace]
lemma isMulInvariant_eq_smul_of_compactSpace [CompactSpace G] (μ' μ : Measure G)
    [IsHaarMeasure μ] [IsMulLeftInvariant μ'] [IsFiniteMeasureOnCompacts μ'] :
    μ' = haarScalarFactor μ' μ • μ


lemma isIntegralCurveAt_iff :
    IsIntegralCurveAt γ v t₀ ↔ ∃ s ∈ 𝓝 t₀, IsIntegralCurveOn γ v s

{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}
{t₀ : ℝ}


theorem measure_union₀_aux (hs : NullMeasurableSet s μ) (ht : NullMeasurableSet t μ)
    (hd : AEDisjoint μ s t) : μ (s ∪ t) = μ s + μ t

(hs : MeasureTheory.NullMeasurableSet s μ)

(ht : MeasureTheory.NullMeasurableSet t μ)


@[inherit_doc IsLocalization.surj']
theorem surj : ∀ z : S, ∃ x : R × M, z * algebraMap R S x.2 = algebraMap R S x.1

{R : Type u_1}
[CommSemiring R]
(M : Submonoid R)
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
[IsLocalization M S]
(z : S)

∃ x, z * (algebraMap R S) ↑x.2 = (algebraMap R S) x.1


/-- Twice the circumradius of a triangle may be expressed explicitly as the length of a side
divided by the absolute value of the sine of the angle at the third point (a version of the law
of sines or sine rule). -/
theorem dist_div_sin_oangle_eq_two_mul_circumradius (t : Triangle ℝ P) {i₁ i₂ i₃ : Fin 3}
    (h₁₂ : i₁ ≠ i₂) (h₁₃ : i₁ ≠ i₃) (h₂₃ : i₂ ≠ i₃) : dist (t.points i₁) (t.points i₃) /
      |Real.Angle.sin (∡ (t.points i₁) (t.points i₂) (t.points i₃))| = 2 * t.circumradius

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

dist (t.points i₁) (t.points i₃) / |(∡ (t.points i₁) (t.points i₂) (t.points i₃)).sin| =
  2 * Affine.Simplex.circumradius t


theorem mem_add (l m : Language α) (x : List α) : x ∈ l + m ↔ x ∈ l ∨ x ∈ m

{α : Type u_1}
(l m : Language α)
(x : List α)


@[simp]
theorem changeForm_algebraMap (r : R) : changeForm h (algebraMap R _ r) = algebraMap R _ r

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

(CliffordAlgebra.changeForm h) ((algebraMap R (CliffordAlgebra Q)) r) = (algebraMap R (CliffordAlgebra Q')) r


theorem dep_of_not_indep (hD : ¬ M.Indep D) (hDE : D ⊆ M.E := by aesop_mat) : M.Dep D

{α : Type u_1}
{M : Matroid α}
{D : Set α}
(hD : ¬M.Indep D)
(hDE : D ⊆ M.E := by aesop_mat)


@[to_additive]
lemma pow_two_semiclosed
    [CovariantClass α α (swap (· * ·)) (· ≤ ·)] {a : α} (ha : 1 ≤ a ^ 2) : 1 ≤ a

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

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


theorem derivFamily_isNormal (f : ι → Ordinal → Ordinal) : IsNormal (derivFamily f)

(f : ι → Ordinal.{max u u_1} → Ordinal.{max u u_1})


theorem hasBasis_nhdsSet_Ici_Ioi (a : α) [Nonempty (Iio a)] :
    HasBasis (𝓝ˢ (Ici a)) (· < a) Ioi

{α : Type u_1}
[LinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
(a : α)
[Nonempty ↑(Set.Iio a)]

(𝓝ˢ (Set.Ici a)).HasBasis (fun x => x < a) Set.Ioi


/-- If `L/K` is an algebraic field extension, then the Krull topology on `L ≃ₐ[K] L` is
  totally disconnected. -/
theorem krullTopology_totallyDisconnected {K L : Type*} [Field K] [Field L] [Algebra K L]
    [Algebra.IsIntegral K L] : IsTotallyDisconnected (Set.univ : Set (L ≃ₐ[K] L))

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
[Algebra.IsIntegral K L]


@[to_additive (attr := simp)]
theorem inv_inv (a : G) : a⁻¹⁻¹ = a

{G : Type u_1}
[InvolutiveNeg G]
(a : G)


theorem normalize_eq_one {a : G₀} (h0 : a ≠ 0) : normalize a = 1

(G₀ : Type u_2)
[CommGroupWithZero G₀]
[DecidableEq G₀]
{a : G₀}
(h0 : a ≠ 0)


theorem inter_eq_of_inter_eq_of_eqOn {e' : PartialHomeomorph X Y} (h : e.IsImage s t)
    (h' : e'.IsImage s t) (hs : e.source ∩ s = e'.source ∩ s) (Heq : EqOn e e' (e.source ∩ s)) :
    e.target ∩ t = e'.target ∩ t

(Heq : Set.EqOn (↑e) (↑e') (e.source ∩ s))


theorem rel_of_chain_cons {a b : α} {l : List α} (p : Chain R a (b :: l)) : R a b

{α : Type u_1}
{R : α → α → Prop}
{a b : α}
{l : List α}
(p : List.Chain R a (b :: l))


theorem inner_def (a b : ℍ) : ⟪a, b⟫ = (a * star b).re


@[simp]
theorem isAdjoinRootMonic_root_eq_root (hf : Monic f) :
    (AdjoinRoot.isAdjoinRootMonic f hf).root = AdjoinRoot.root f

{R : Type u}
[CommRing R]
(f : R[X])
(hf : f.Monic)


theorem norm_indicator_eq_indicator_norm : ‖indicator s f a‖ = indicator s (fun a => ‖f a‖) a

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

‖s.indicator f a‖ = s.indicator (fun a => ‖f a‖) a


theorem comp_PInfty_eq_zero_iff {Z : C} {n : ℕ} (f : Z ⟶ X _[n]) :
    f ≫ PInfty.f n = 0 ↔ f ≫ s.πSummand (IndexSet.id (op [n])) = 0

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
{X : CategoryTheory.SimplicialObject C}
(s : SimplicialObject.Splitting X)
[CategoryTheory.Preadditive C]
{Z : C}
{n : ℕ}
(f : Z ⟶ X _[n])

f ≫ AlgebraicTopology.DoldKan.PInfty.f n = 0 ↔
  f ≫ s.πSummand (SimplicialObject.Splitting.IndexSet.id (Opposite.op [n])) = 0


/--
`addOppositeEquiv` is an additive monoid isomorphism between
Hahn series over `Γ` with coefficients in the opposite additive monoid `Rᵃᵒᵖ`
and the additive opposite of Hahn series over `Γ` with coefficients `R`.
-/
@[simps (config := .lemmasOnly)]
def addOppositeEquiv : HahnSeries Γ (Rᵃᵒᵖ) ≃+ (HahnSeries Γ R)ᵃᵒᵖ

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[AddMonoid R]
(x : HahnSeries Γ Rᵃᵒᵖ)

HahnSeries.addOppositeEquiv x = AddOpposite.op { coeff := fun a => AddOpposite.unop (x.coeff a), isPWO_support' := ⋯ }


theorem continuous_toCompl : Continuous (toCompl : α → Completion α)

{α : Type u_3}
[UniformSpace α]
[AddGroup α]
[UniformAddGroup α]


lemma insertNth_self_removeNth (p : Fin (n + 1)) (f : ∀ j, α j) :
    insertNth p (f p) (removeNth p f) = f

{n : ℕ}
{α : Fin (n + 1) → Type u}
(p : Fin (n + 1))
(f : (j : Fin (n + 1)) → α j)


/-- The `p`-adic norm of a natural `m` is one iff `p` doesn't divide `m`. -/
theorem nat_eq_one_iff (m : ℕ) : padicNorm p m = 1 ↔ ¬p ∣ m

{p : ℕ}
[hp : Fact (Nat.Prime p)]
(m : ℕ)


theorem fromLocalizedModule.inj : Function.Injective <| fromLocalizedModule S f

{R : Type u_1}
[CommSemiring R]
(S : Submonoid R)
{M : Type u_2}
{M' : Type u_3}
[AddCommMonoid M]
[AddCommMonoid M']
[Module R M]
[Module R M']
(f : M →ₗ[R] M')
[IsLocalizedModule S f]

Function.Injective ⇑(IsLocalizedModule.fromLocalizedModule S f)


/-- Image of a bounded set in a normed space under scalar multiplication by a constant is
bounded. See also `Bornology.IsBounded.smul` for a similar lemma about an isometric action. -/
theorem Bornology.IsBounded.smul₀ {s : Set E} (hs : IsBounded s) (c : 𝕜) : IsBounded (c • s)

{𝕜 : Type u_1}
{E : Type u_2}
[NormedField 𝕜]
[SeminormedAddCommGroup E]
[NormedSpace 𝕜 E]
{s : Set E}
(hs : Bornology.IsBounded s)
(c : 𝕜)


@[simp]
theorem mapIdx_cons (l : List α) (f : ℕ → α → β) (a : α) :
    mapIdx f (a :: l) = f 0 a :: mapIdx (fun i ↦ f (i + 1)) l

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

List.mapIdx f (a :: l) = f 0 a :: List.mapIdx (fun i => f (i + 1)) l


theorem lt_le_asymm {x y : Int} (h₁ : y < x) (h₂ : x ≤ y) : False


@[simp]
theorem zeroIsoIsInitial_inv {X : C} (t : IsInitial X) : (zeroIsoIsInitial t).inv = 0

(CategoryTheory.Limits.HasZeroObject.zeroIsoIsInitial t).inv = 0


/-- Expressing uniform convergence using `dist` -/
theorem tendstoUniformlyOnFilter_iff {F : ι → β → α} {f : β → α} {p : Filter ι} {p' : Filter β} :
    TendstoUniformlyOnFilter F f p p' ↔
      ∀ ε > 0, ∀ᶠ n : ι × β in p ×ˢ p', dist (f n.snd) (F n.fst n.snd) < ε

{α : Type u}
{β : Type v}
{ι : Type u_2}
[PseudoMetricSpace α]
{F : ι → β → α}
{f : β → α}
{p : Filter ι}
{p' : Filter β}

TendstoUniformlyOnFilter F f p p' ↔ ∀ ε > 0, ∀ᶠ (n : ι × β) in p ×ˢ p', dist (f n.2) (F n.1 n.2) < ε


@[simp]
theorem irrational_int_div_iff : Irrational (m / x) ↔ m ≠ 0 ∧ Irrational x

Irrational (↑m / x) ↔ m ≠ 0 ∧ Irrational x


/-- `Real.equivCauchy` as a ring equivalence. -/
@[simps]
def ringEquivCauchy : ℝ ≃+* CauSeq.Completion.Cauchy (abs : ℚ → ℚ)

(Real.ringEquivCauchy.symm cauchy).cauchy = cauchy


theorem Multiset.toFinsupp_strictMono [DecidableEq ι] : StrictMono (@Multiset.toFinsupp ι _)


theorem measurableSet_le {m : MeasurableSpace α} [TopologicalSpace β] [Preorder β]
    [OrderClosedTopology β] [PseudoMetrizableSpace β] {f g : α → β} (hf : StronglyMeasurable f)
    (hg : StronglyMeasurable g) : MeasurableSet { a | f a ≤ g a }

(hf : MeasureTheory.StronglyMeasurable f)

(hg : MeasureTheory.StronglyMeasurable g)


theorem essSup_eq_sInf {m : MeasurableSpace α} (μ : Measure α) (f : α → β) :
    essSup f μ = sInf { a | μ { x | a < f x } = 0 }

{α : Type u_1}
{β : Type u_2}
[ConditionallyCompleteLinearOrder β]
{m : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
(f : α → β)

essSup f μ = sInf {a | μ {x | a < f x} = 0}


/-- A non-unital normed ring is a not-necessarily-unital ring
endowed with a norm which satisfies the inequality `‖x y‖ ≤ ‖x‖ ‖y‖`. -/
class NonUnitalNormedRing (α : Type*) extends Norm α, NonUnitalRing α, MetricSpace α where
  /-- The distance is induced by the norm. -/
  dist_eq : ∀ x y, dist x y = norm (x - y)
  /-- The norm is submultiplicative. -/
  norm_mul : ∀ a b, norm (a * b) ≤ norm a * norm b

{α : Type u_5}
[self : NonUnitalNormedRing α]
(a b : α)

‖a * b‖ ≤ ‖a‖ * ‖b‖


theorem zeroLocus_span (S : Set (MvPolynomial σ k)) :
    zeroLocus (Ideal.span S) = { x | ∀ p ∈ S, eval x p = 0 }

{k : Type u_1}
[Field k]
{σ : Type u_2}
(S : Set (MvPolynomial σ k))

MvPolynomial.zeroLocus (Ideal.span S) = {x | ∀ p ∈ S, (MvPolynomial.eval x) p = 0}


theorem degree_divByMonic_le (p q : R[X]) : degree (p /ₘ q) ≤ degree p


@[simp, norm_cast]
theorem coe_inf (S T : Subalgebra R A) : (↑(S ⊓ T) : Set A) = (S ∩ T : Set A)

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


@[simp]
theorem toMonoidHom_refl : (RingEquiv.refl R).toMonoidHom = MonoidHom.id R


theorem range_nth_of_infinite (hf : (setOf p).Infinite) : Set.range (nth p) = setOf p

{p : ℕ → Prop}
(hf : (setOf p).Infinite)


@[simp]
theorem invFun_eq_symm : e.invFun = e.symm

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


@[simp]
theorem pderiv_X [DecidableEq σ] (i j : σ) :
    pderiv i (X j : MvPolynomial σ R) = Pi.single (f := fun j => _) i 1 j

{R : Type u}
{σ : Type v}
[CommSemiring R]
[DecidableEq σ]
(i j : σ)

(MvPolynomial.pderiv i) (MvPolynomial.X j) = Pi.single i 1 j


/-- An equivalence of Lie modules yields an order-preserving equivalence of their lattices of Lie
Submodules. -/
@[simps] def orderIsoMapComap (e : M ≃ₗ⁅R,L⁆ M') :
    LieSubmodule R L M ≃o LieSubmodule R L M'

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

(LieSubmodule.orderIsoMapComap e) N = LieSubmodule.map e.toLieModuleHom N


@[simp]
theorem isWF_bUnion [Preorder α] (s : Finset ι) {f : ι → Set α} :
    (⋃ i ∈ s, f i).IsWF ↔ ∀ i ∈ s, (f i).IsWF

{ι : Type u_1}
{α : Type u_2}
[Preorder α]
(s : Finset ι)
{f : ι → Set α}


protected theorem lipschitzOnWith (h : LipschitzWith K f) (s : Set α) : LipschitzOnWith K f s

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{K : ℝ≥0}
{f : α → β}
(h : LipschitzWith K f)
(s : Set α)


theorem lift_rank_map_le (f : M →ₗ[R] M') (p : Submodule R M) :
    Cardinal.lift.{v} (Module.rank R (p.map f)) ≤ Cardinal.lift.{v'} (Module.rank R p)

{R : Type u}
{M : Type v}
{M' : Type v'}
[Ring R]
[AddCommGroup M]
[AddCommGroup M']
[Module R M]
[Module R M']
(f : M →ₗ[R] M')
(p : Submodule R M)

Cardinal.lift.{v, v'} (Module.rank R ↥(Submodule.map f p)) ≤ Cardinal.lift.{v', v} (Module.rank R ↥p)


theorem one_of_dist_le (hs : x ∈ (chartAt H c).source)
    (hd : dist (extChartAt I c x) (extChartAt I c c) ≤ f.rIn) : f x = 1

(hd : dist (↑(extChartAt I c) x) (↑(extChartAt I c) c) ≤ f.rIn)


@[to_additive]
theorem Ultrafilter.continuous_mul_left {M} [Semigroup M] (V : Ultrafilter M) :
    Continuous (· * V)

{M : Type u_1}
[AddSemigroup M]
(V : Ultrafilter M)


@[deprecated "This lemma is unused, and can be proved by `simp`." (since := "2024-06-12")]
theorem toFinsupp_cons_apply_zero (x : M) (xs : List M)
    [DecidablePred (getD (x::xs) · 0 ≠ 0)] : (x::xs).toFinsupp 0 = x

[DecidablePred fun x_1 => (x :: xs).getD x_1 0 ≠ 0]


/-- A real differentiable function of the complex plane into some complex normed space `E` is
    conformal at a point `z` if it is holomorphic at that point with a nonvanishing differential.
    This is a version of the Cauchy-Riemann equations. -/
theorem DifferentiableAt.conformalAt (h : DifferentiableAt ℂ f z) (hf' : deriv f z ≠ 0) :
    ConformalAt f z

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{z : ℂ}
{f : ℂ → E}
(h : DifferentiableAt ℂ f z)
(hf' : deriv f z ≠ 0)


protected theorem Inseparable.nhds_le_uniformity {x y : α} (h : Inseparable x y) :
    𝓝 (x, y) ≤ 𝓤 α

{α : Type u}
[UniformSpace α]
{x y : α}
(h : Inseparable x y)


theorem mem_div_iff_of_nonzero {I J : FractionalIdeal R₁⁰ K} (h : J ≠ 0) {x} :
    x ∈ I / J ↔ ∀ y ∈ J, x * y ∈ I

{R₁ : Type u_3}
[CommRing R₁]
{K : Type u_4}
[Field K]
[Algebra R₁ K]
[frac : IsFractionRing R₁ K]
[IsDomain R₁]
{I J : FractionalIdeal R₁⁰ K}
(h : J ≠ 0)
{x : K}


/-- Composition of the inverse of a partial equivalence and this partial equivalence is equivalent
to the restriction of the identity to the target. -/
theorem symm_trans_self : e.symm.trans e ≈ ofSet e.target

{α : Type u_1}
{β : Type u_2}
(e : PartialEquiv α β)

e.symm.trans e ≈ PartialEquiv.ofSet e.target


theorem dslope_eventuallyEq_slope_of_ne (f : 𝕜 → E) (h : b ≠ a) : dslope f a =ᶠ[𝓝 b] slope f a

{𝕜 : Type u_1}
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{a b : 𝕜}
(f : 𝕜 → E)
(h : b ≠ a)


@[simp]
theorem comp_continuous_iff' {γ} [TopologicalSpace γ] (h : α ≃ᵢ β) {f : β → γ} :
    Continuous (f ∘ h) ↔ Continuous f

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{γ : Type u_2}
[TopologicalSpace γ]
(h : α ≃ᵢ β)
{f : β → γ}


/-- The bottom-left evaluation `Square C ⥤ C`. -/
@[simps]
def evaluation₃ : Square C ⥤ C

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

CategoryTheory.Square.evaluation₃.obj sq = sq.X₃


@[to_additive]
theorem nnnorm_multiset_prod_le (m : Multiset E) : ‖m.prod‖₊ ≤ (m.map fun x => ‖x‖₊).sum

{E : Type u_6}
[SeminormedCommGroup E]
(m : Multiset E)

‖m.prod‖₊ ≤ (Multiset.map (fun x => ‖x‖₊) m).sum


@[simp]
theorem map_id (K : ProperCone ℝ E) : K.map (ContinuousLinearMap.id ℝ E) = K

{E : Type u_1}
[NormedAddCommGroup E]
[InnerProductSpace ℝ E]
(K : ProperCone ℝ E)

ProperCone.map (ContinuousLinearMap.id ℝ E) K = K


lemma lTensor.inverse_of_rightInverse_comp_lTensor
    {h : P → N} (hgh : Function.RightInverse h g) :
    (lTensor.inverse_of_rightInverse Q hfg hgh).comp (lTensor Q g) =
      Submodule.mkQ (p := LinearMap.range (lTensor Q f))

{R : Type u_1}
{M : Type u_2}
{N : Type u_3}
{P : Type u_4}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[AddCommGroup P]
[Module R M]
[Module R N]
[Module R P]
{f : M →ₗ[R] N}
{g : N →ₗ[R] P}
(Q : Type u_5)
[AddCommGroup Q]
[Module R Q]
(hfg : Function.Exact ⇑f ⇑g)
{h : P → N}
(hgh : Function.RightInverse h ⇑g)

lTensor.inverse_of_rightInverse Q hfg hgh ∘ₗ LinearMap.lTensor Q g = (LinearMap.range (LinearMap.lTensor Q f)).mkQ


@[simp]
theorem coe_spanSingleton (x : P) : (spanSingleton S x : Submodule R P) = span R {x}

{R : Type u_1}
[CommRing R]
(S : Submonoid R)
{P : Type u_2}
[CommRing P]
[Algebra R P]
[loc : IsLocalization S P]
(x : P)

↑(FractionalIdeal.spanSingleton S x) = Submodule.span R {x}


@[simp] lemma ofNat_ne_top (n : ℕ) [n.AtLeastTwo] : no_index (OfNat.ofNat n : WithTop α) ≠ ⊤

{α : Type u}
[AddMonoidWithOne α]
(n : ℕ)
[n.AtLeastTwo]


theorem eqLocus_eq_ker_sub (f g : M →ₛₗ[τ₁₂] M₂) : eqLocus f g = ker (f - g)

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_3}
{M₂ : Type u_4}
[Ring R]
[Ring R₂]
[AddCommGroup M]
[AddCommGroup M₂]
[Module R M]
[Module R₂ M₂]
{τ₁₂ : R →+* R₂}
(f g : M →ₛₗ[τ₁₂] M₂)

LinearMap.eqLocus f g = LinearMap.ker (f - g)


/-- This typeclass expresses that the signs given by `[TotalComplexShapeSymmetry c₁ c₂ c₁₂]`
and by `[TotalComplexShapeSymmetry c₂ c₁ c₁₂]` are compatible. -/
class TotalComplexShapeSymmetrySymmetry [TotalComplexShape c₁ c₂ c₁₂]
    [TotalComplexShape c₂ c₁ c₁₂] [TotalComplexShapeSymmetry c₁ c₂ c₁₂]
    [TotalComplexShapeSymmetry c₂ c₁ c₁₂] : Prop where
  σ_symm i₁ i₂ : ComplexShape.σ c₂ c₁ c₁₂ i₂ i₁ = ComplexShape.σ c₁ c₂ c₁₂ i₁ i₂

[self : TotalComplexShapeSymmetrySymmetry c₁ c₂ c₁₂]

c₂.σ c₁ c₁₂ i₂ i₁ = c₁.σ c₂ c₁₂ i₁ i₂


theorem map_le {S : Subalgebra R A} {f : A →ₐ[R] B} {U : Subalgebra R B} :
    map f S ≤ U ↔ S ≤ comap f U

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
{S : Subalgebra R A}
{f : A →ₐ[R] B}
{U : Subalgebra R B}

Subalgebra.map f S ≤ U ↔ S ≤ Subalgebra.comap f U


theorem ContinuousWithinAt.congr {f f₁ : α → β} {s : Set α} {x : α} (h : ContinuousWithinAt f s x)
    (h₁ : ∀ y ∈ s, f₁ y = f y) (hx : f₁ x = f x) : ContinuousWithinAt f₁ s x

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f f₁ : α → β}
{s : Set α}
{x : α}
(h : ContinuousWithinAt f s x)
(h₁ : ∀ y ∈ s, f₁ y = f y)
(hx : f₁ x = f x)


/-- Assumes right covariance.
The lemma assuming left covariance is `Left.one_lt_mul_of_le_of_lt`. -/
@[to_additive Right.add_pos_of_nonneg_of_pos
"Assumes right covariance.
The lemma assuming left covariance is `Left.add_pos_of_nonneg_of_pos`."]
theorem Right.one_lt_mul_of_le_of_lt [CovariantClass α α (swap (· * ·)) (· ≤ ·)] {a b : α}
    (ha : 1 ≤ a) (hb : 1 < b) :
    1 < a * b

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


@[simp]
theorem mk_coe (e : A ≃⋆ₐ[R] B) (e' h₁ h₂ h₃ h₄ h₅ h₆) :
    (⟨⟨⟨e, e', h₁, h₂⟩, h₃, h₄⟩, h₅, h₆⟩ : A ≃⋆ₐ[R] B) = e

(h₃ :
  ∀ (x y : A),
    { toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂ }.toFun (x * y) =
      { toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂ }.toFun x *
        { toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂ }.toFun y)

(h₄ :
  ∀ (x y : A),
    { toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂ }.toFun (x + y) =
      { toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂ }.toFun x +
        { toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂ }.toFun y)

(h₅ :
  ∀ (a : A),
    { toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂, map_mul' := h₃, map_add' := h₄ }.toFun (star a) =
      star ({ toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂, map_mul' := h₃, map_add' := h₄ }.toFun a))

(h₆ :
  ∀ (r : R) (a : A),
    { toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂, map_mul' := h₃, map_add' := h₄ }.toFun (r • a) =
      r • { toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂, map_mul' := h₃, map_add' := h₄ }.toFun a)

{ toFun := ⇑e, invFun := e', left_inv := h₁, right_inv := h₂, map_mul' := h₃, map_add' := h₄, map_star' := h₅,
    map_smul' := h₆ } =
  e


lemma mul_lt_mul_pow_succ (ha : 0 < a) (hb : 1 < b) : n * b < a * b ^ (n + 1)


protected theorem lt_of_not_le {i j : Fin n} (h : ¬ i ≤ j) : j < i


theorem subset_closedBall_norm [NormOneClass A] (a : A) : σ a ⊆ Metric.closedBall (0 : 𝕜) ‖a‖

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


Polynomial.C (a * b) = Polynomial.C a * Polynomial.C b


theorem nhds_cons (a : α) (l : List α) : 𝓝 (a::l) = List.cons <$> 𝓝 a <*> 𝓝 l

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

𝓝 (a :: l) = Seq.seq (List.cons <$> 𝓝 a) fun x => 𝓝 l


@[simp]
theorem id_apply (a : α) : LatticeHom.id α a = a


@[to_additive]
theorem map_surjective_of_surjective : Function.Surjective (map f)

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
{f : AddHom M N}
(hf : Function.Surjective ⇑f)


@[simp, norm_cast] lemma ratCast_re (q : ℚ) : (q : ℂ).re = q


lemma σ_ε₂ (i₁ : I₁) {i₂ i₂' : I₂} (h₂ : c₂.Rel i₂ i₂') :
    σ c₁ c₂ c₁₂ i₁ i₂ * ε₂ c₁ c₂ c₁₂ ⟨i₁, i₂⟩ = ε₁ c₂ c₁ c₁₂ ⟨i₂, i₁⟩ * σ c₁ c₂ c₁₂ i₁ i₂'

{I₁ : Type u_1}
{I₂ : Type u_2}
{I₁₂ : Type u_3}
(c₁ : ComplexShape I₁)
{c₂ : ComplexShape I₂}
(c₁₂ : ComplexShape I₁₂)
[TotalComplexShape c₁ c₂ c₁₂]
[TotalComplexShape c₂ c₁ c₁₂]
[TotalComplexShapeSymmetry c₁ c₂ c₁₂]
(i₁ : I₁)
{i₂ i₂' : I₂}
(h₂ : c₂.Rel i₂ i₂')

c₁.σ c₂ c₁₂ i₁ i₂ * c₁.ε₂ c₂ c₁₂ (i₁, i₂) = c₂.ε₁ c₁ c₁₂ (i₂, i₁) * c₁.σ c₂ c₁₂ i₁ i₂'


theorem map_piecewise_smul [DecidableEq ι] (c : ι → R) (m : ι → M) (s : Finset ι) :
    f (s.piecewise (fun i => c i • m i) m) = (∏ i ∈ s, c i) • f m

{R : Type u_1}
{M : Type u_2}
{N : Type u_4}
{ι : Type u_6}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[TopologicalSpace M]
[AddCommMonoid N]
[Module R N]
[TopologicalSpace N]
(f : M [⋀^ι]→L[R] N)
[DecidableEq ι]
(c : ι → R)
(m : ι → M)
(s : Finset ι)


theorem Icc_subset_Ici_self : Icc a b ⊆ Ici a


@[to_additive]
theorem denseRange_smul [IsMinimal M α] (x : α) : DenseRange fun c : M ↦ c • x

(M : Type u_1)
{α : Type u_3}
[Monoid M]
[TopologicalSpace α]
[MulAction M α]
[MulAction.IsMinimal M α]
(x : α)


lemma min_max_distrib_right (a b c : α) : min (max a b) c = max (min a c) (min b c)

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


/-- If the square below commutes, the bottom map is uniquely specified:
```
R  →  S
↓     ↓
Rₘ → Sₘ
```
-/
theorem IsLocalization.algebraMap_apply_eq_map_map_submonoid (x) :
    algebraMap Rₘ Sₘ x =
      map Sₘ (algebraMap R S)
        (show _ ≤ (Algebra.algebraMapSubmonoid S M).comap _ from M.le_comap_map) x

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

(algebraMap Rₘ Sₘ) x = (IsLocalization.map Sₘ (algebraMap R S) ⋯) x


/-- If two ring homomorphisms are equal on a set, then they are equal on its subfield closure. -/
theorem eqOn_field_closure {f g : K →+* L} {s : Set K} (h : Set.EqOn f g s) :
    Set.EqOn f g (closure s)

{K : Type u}
[DivisionRing K]
{L : Type v}
[Semiring L]
{f g : K →+* L}
{s : Set K}
(h : Set.EqOn (⇑f) (⇑g) s)


theorem Valid'.dual : ∀ {t : Ordnode α} {o₁ o₂}, Valid' o₁ t o₂ → @Valid' αᵒᵈ _ o₂ (dual t) o₁

{α : Type u_1}
[Preorder α]
{t : Ordnode α}
{o₁ : WithBot α}
{o₂ : WithTop α}

Ordnode.Valid' o₁ t o₂ → Ordnode.Valid' o₂ t.dual o₁


theorem sub.aux (a b : Rat) {g ad bd} (hg : g = a.den.gcd b.den)
    (had : ad = a.den / g) (hbd : bd = b.den / g) :
    let den := ad * b.den; let num := a.num * bd - b.num * ad
    num.natAbs.gcd g = num.natAbs.gcd den

(a b : Rat)
{g ad bd : Nat}
(hg : g = a.den.gcd b.den)
(had : ad = a.den / g)
(hbd : bd = b.den / g)

let den := ad * b.den;
let num := a.num * ↑bd - b.num * ↑ad;
num.natAbs.gcd g = num.natAbs.gcd den


theorem fromTypes_nil (τ : Type u) : FromTypes ![] τ = τ


theorem ascPochhammer_succ_right (n : ℕ) :
    ascPochhammer S (n + 1) = ascPochhammer S n * (X + (n : S[X]))

ascPochhammer S (n + 1) = ascPochhammer S n * (Polynomial.X + ↑n)


theorem continuousAt_add_bot_bot : ContinuousAt (fun p : EReal × EReal => p.1 + p.2) (⊥, ⊥)

ContinuousAt (fun p => p.1 + p.2) (⊥, ⊥)


@[simp, norm_cast] lemma coe_copy (s : Set α) (hs) : L.copy s hs = s

{α : Type u_1}
[CompleteLattice α]
(L : CompleteSublattice α)
(s : Set α)
(hs : s = ↑L)


theorem diam_range (hf : Isometry f) : Metric.diam (range f) = Metric.diam (univ : Set α)

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
{f : α → β}
(hf : Isometry f)

Metric.diam (Set.range f) = Metric.diam Set.univ


/-- A linearly ordered commutative monoid with an additively absorbing `⊤` element.
  Instances should include number systems with an infinite element adjoined. -/
class LinearOrderedAddCommMonoidWithTop (α : Type*) extends LinearOrderedAddCommMonoid α,
    OrderTop α where
  /-- In a `LinearOrderedAddCommMonoidWithTop`, the `⊤` element is invariant under addition. -/
  protected top_add' : ∀ x : α, ⊤ + x = ⊤

[self : LinearOrderedAddCommMonoidWithTop α]


@[deprecated measure_pos_of_superset (since := "2024-05-14")]
theorem pos_of_subset_ne_zero (m : OuterMeasure α) {a b : Set α} (hs : a ⊆ b) (hnz : m a ≠ 0) :
    0 < m b

{α : Type u_1}
(m : MeasureTheory.OuterMeasure α)
{a b : Set α}
(hs : a ⊆ b)
(hnz : m a ≠ 0)


@[simp] theorem tsub_lt_self_iff : a - b < a ↔ 0 < a ∧ 0 < b

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


/-- See `lt_tsub_iff_right` for a stronger statement in a linear order. -/
theorem lt_tsub_iff_right_of_le (h : c ≤ b) : a < b - c ↔ a + c < b

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


@[to_additive Left.nsmul_neg_iff]
theorem Left.pow_lt_one_iff' [CovariantClass M M (· * ·) (· < ·)] {n : ℕ} {x : M} (hn : 0 < n) :
    x ^ n < 1 ↔ x < 1

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


theorem IsLocalization.surj_of_gcd_domain [GCDMonoid R] (M : Submonoid R) [IsLocalization M A]
    (z : A) : ∃ a b : R, IsUnit (gcd a b) ∧ z * algebraMap R A b = algebraMap R A a

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[IsDomain R]
[CommRing A]
[Algebra R A]
[GCDMonoid R]
(M : Submonoid R)
[IsLocalization M A]
(z : A)

∃ a b, IsUnit (gcd a b) ∧ z * (algebraMap R A) b = (algebraMap R A) a


@[simp]
theorem not_nontrivial_empty : ¬(∅ : Set α).Nontrivial


/-- To give an object in the over category, it suffices to give a morphism with codomain `X`. -/
@[simps! left hom]
def mk {X Y : T} (f : Y ⟶ X) : Over X

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


@[simp]
lemma inv_hom_id_apply {X Y : TopCat} (f : X ≅ Y) (y : Y) : f.hom (f.inv y) = y


theorem IciExtend_of_le (f : Ici a → β) (hx : x ≤ a) : IciExtend f x = f ⟨a, le_rfl⟩

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
{a x : α}
(f : ↑(Set.Ici a) → β)
(hx : x ≤ a)


theorem image_mul_left_Icc' {a : α} (h : 0 < a) (b c : α) :
    (a * ·) '' Icc b c = Icc (a * b) (a * c)

{α : Type u_1}
[LinearOrderedField α]
{a : α}
(h : 0 < a)
(b c : α)

(fun x => a * x) '' Set.Icc b c = Set.Icc (a * b) (a * c)


@[simp] lemma compls_sups (s t : Finset α) : (s ⊻ t)ᶜˢ = sᶜˢ ⊼ tᶜˢ

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


theorem exists_of_mem_map {f} {b : β} {s : Stream' α} : b ∈ map f s → ∃ a, a ∈ s ∧ f a = b

{α : Type u}
{β : Type v}
{f : α → β}
{b : β}
{s : Stream' α}

b ∈ Stream'.map f s → ∃ a, a ∈ s ∧ f a = b


/-- This lemma is superseded by `Memℒp.uniformIntegrable_of_identDistrib` which only requires
`AEStronglyMeasurable`. -/
theorem Memℒp.uniformIntegrable_of_identDistrib_aux {ι : Type*} {f : ι → α → E} {j : ι} {p : ℝ≥0∞}
    (hp : 1 ≤ p) (hp' : p ≠ ∞) (hℒp : Memℒp (f j) p μ) (hfmeas : ∀ i, StronglyMeasurable (f i))
    (hf : ∀ i, IdentDistrib (f i) (f j) μ μ) : UniformIntegrable f p μ

(hfmeas : ∀ (i : ι), MeasureTheory.StronglyMeasurable (f i))

(hf : ∀ (i : ι), ProbabilityTheory.IdentDistrib (f i) (f j) μ μ)


@[to_additive]
theorem prod_eq_single {f : α → M} (a : α) (h : ∀ x ≠ a, f x = 1) : ∏ x, f x = f a

{α : Type u_1}
{M : Type u_4}
[Fintype α]
[CommMonoid M]
{f : α → M}
(a : α)
(h : ∀ (x : α), x ≠ a → f x = 1)


/-- The composition of homotopy equivalences. -/
@[simps]
def trans (e : HomotopyEquiv S₁ S₂) (e' : HomotopyEquiv S₂ S₃) :
    HomotopyEquiv S₁ S₃

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

(e.trans e').hom = CategoryTheory.CategoryStruct.comp e.hom e'.hom


theorem ofReal_def (r : ℝ) : (r : ℂ) = ⟨r, 0⟩


@[reassoc (attr := simp)]
lemma pullback.lift_snd {X Y Z W : Stonean} (f : X ⟶ Z) {i : Y ⟶ Z} (hi : OpenEmbedding i)
    (a : W ⟶ X) (b : W ⟶ Y) (w : a ≫ f = b ≫ i) :
    pullback.lift f hi a b w ≫ Stonean.pullback.snd f hi = b

{X Y Z W : Stonean}
(f : X ⟶ Z)
{i : Y ⟶ Z}
(hi : OpenEmbedding ⇑i)
(a : W ⟶ X)
(b : W ⟶ Y)
(w : a ≫ f = b ≫ i)

Stonean.pullback.lift f hi a b w ≫ Stonean.pullback.snd f hi = b


/-- The ternary Cantor set is compact. -/
lemma isCompact_cantorSet : IsCompact cantorSet


theorem sum_nonneg (x : X) : 0 ≤ ∑ᶠ i, f i x

{ι : Type u}
{X : Type v}
[TopologicalSpace X]
{s : Set X}
(f : PartitionOfUnity ι X s)
(x : X)


theorem smul_tprodCoeff [DecidableEq ι] (z : R) (f : Π i, s i) (i : ι) (r : R₁) [SMul R₁ R]
    [IsScalarTower R₁ R R] [SMul R₁ (s i)] [IsScalarTower R₁ R (s i)] :
    tprodCoeff R z (update f i (r • f i)) = tprodCoeff R (r • z) f

{ι : Type u_1}
{R : Type u_4}
[CommSemiring R]
{R₁ : Type u_5}
{s : ι → Type u_7}
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]
[DecidableEq ι]
(z : R)
(f : (i : ι) → s i)
(i : ι)
(r : R₁)
[SMul R₁ R]
[IsScalarTower R₁ R R]
[SMul R₁ (s i)]
[IsScalarTower R₁ R (s i)]

PiTensorProduct.tprodCoeff R z (Function.update f i (r • f i)) = PiTensorProduct.tprodCoeff R (r • z) f


@[simp] theorem fst_inv (x : tsze R M) : fst x⁻¹ = (fst x)⁻¹

{R : Type u}
{M : Type v}
[Neg M]
[Inv R]
[SMul Rᵐᵒᵖ M]
[SMul R M]
(x : tsze R M)


theorem Surjective.preimage_injective (hf : Surjective f) : Injective (preimage f)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
(hf : Function.Surjective f)


/-- Given a lift `x` and an integral element `s : E` over `x.carrier` whose conjugates over
`x.carrier` are all in `K`, we can extend the lift to a lift whose carrier contains `s`. -/
theorem Lifts.exists_lift_of_splits' (x : Lifts F E K) {s : E} (h1 : IsIntegral x.carrier s)
    (h2 : (minpoly x.carrier s).Splits x.emb.toRingHom) : ∃ y, x ≤ y ∧ s ∈ y.carrier

(h2 : Polynomial.Splits x.emb.toRingHom (minpoly (↥x.carrier) s))


lemma neg_one_pow_eq_pow_mod_two (n : ℕ) : (-1 : R) ^ n = (-1) ^ (n % 2)


theorem add_equiv_add {f1 f2 g1 g2 : CauSeq β abv} (hf : f1 ≈ f2) (hg : g1 ≈ g2) :
    f1 + g1 ≈ f2 + g2

{α : Type u_1}
{β : Type u_2}
[LinearOrderedField α]
[Ring β]
{abv : β → α}
[IsAbsoluteValue abv]
{f1 f2 g1 g2 : CauSeq β abv}
(hf : f1 ≈ f2)
(hg : g1 ≈ g2)


protected theorem map_add (f : M₁ →SL[σ₁₂] M₂) (x y : M₁) : f (x + y) = f x + f y

{R₁ : Type u_1}
{R₂ : Type u_2}
[Semiring R₁]
[Semiring R₂]
{σ₁₂ : R₁ →+* R₂}
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
{M₂ : Type u_6}
[TopologicalSpace M₂]
[AddCommMonoid M₂]
[Module R₁ M₁]
[Module R₂ M₂]
(f : M₁ →SL[σ₁₂] M₂)
(x y : M₁)


/-- Interpreting the legs of a cocone as a costructured arrow and then forgetting the arrow again
    does nothing. -/
@[simps!]
def Cocone.toCostructuredArrowCompProj {F : J ⥤ C} (c : Cocone F) :
    c.toCostructuredArrow ⋙ CostructuredArrow.proj _ _ ≅ 𝟭 J

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{C : Type u₃}
[CategoryTheory.Category.{v₃, u₃} C]
{F : CategoryTheory.Functor J C}
(c : CategoryTheory.Limits.Cocone F)
(X : J)

c.toCostructuredArrowCompProj.hom.app X = CategoryTheory.CategoryStruct.id X


theorem ContinuousOn.integrableAt_nhdsWithin [TopologicalSpace α]
    [SecondCountableTopologyEither α E] [OpensMeasurableSpace α] {μ : Measure α}
    [IsLocallyFiniteMeasure μ] {a : α} {t : Set α} {f : α → E} (hft : ContinuousOn f t)
    (ht : MeasurableSet t) (ha : a ∈ t) : IntegrableAtFilter f (𝓝[t] a) μ

MeasureTheory.IntegrableAtFilter f (𝓝[t] a) μ


@[to_additive le_max_of_two_nsmul_le_add]
theorem le_max_of_sq_le_mul {a b c : M} (h : a ^ 2 ≤ b * c) : a ≤ max b c

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

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


@[to_additive]
theorem mul_union : s * (t₁ ∪ t₂) = s * t₁ ∪ s * t₂

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


theorem asString_eq {l : List Char} {s : String} : l.asString = s ↔ l = s.toList


@[simp]
theorem out_one : (1 : Associates α).out = 1

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]


theorem infsep_empty : (∅ : Set α).infsep = 0


/-- The image under a monoid hom of the submonoid generated by a set equals the submonoid generated
    by the image of the set under the monoid hom. -/
@[to_additive
      "The image under an `AddMonoid` hom of the `AddSubmonoid` generated by a set equals
      the `AddSubmonoid` generated by the image of the set under the `AddMonoid` hom."]
theorem image_closure {A : Type*} [Monoid A] {f : M → A} (hf : IsMonoidHom f) (s : Set M) :
    f '' Closure s = Closure (f '' s)

{M : Type u_1}
[Monoid M]
{A : Type u_3}
[Monoid A]
{f : M → A}
(hf : IsMonoidHom f)
(s : Set M)

f '' Monoid.Closure s = Monoid.Closure (f '' s)


lemma isSMulRegular_iff_smul_eq_zero_imp_eq_zero :
    IsSMulRegular M r ↔ ∀ x : M, r • x = 0 → x = 0

{R : Type u_1}
(M : Type u_3)
[Ring R]
[AddCommGroup M]
[Module R M]
(r : R)

IsSMulRegular M r ↔ ∀ (x : M), r • x = 0 → x = 0


@[simp]
theorem support_zero : (0 : α →₀ M).support = ∅


theorem image_source_eq_target : e '' e.source = e.target

{α : Type u_1}
{β : Type u_2}
(e : PartialEquiv α β)


/-- Transfer `IsDomain` across an `Equiv` -/
protected theorem isDomain [Ring α] [Ring β] [IsDomain β] (e : α ≃+* β) : IsDomain α

{α : Type u}
{β : Type v}
[Ring α]
[Ring β]
[IsDomain β]
(e : α ≃+* β)


theorem isTotallyDisconnected_singleton {x} : IsTotallyDisconnected ({x} : Set α)

{α : Type u}
[TopologicalSpace α]
{x : α}


theorem symm_apply_eq (e : P₁ ≃ᵃL[k] P₂)  {x y} : e.symm x = y ↔ x = e y

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


theorem pmap_eq_some_iff {hf} {y : β} :
    pmap f x hf = some y ↔ ∃ (a : α) (H : x = some a), f a (hf a H) = y

{α : Type u_1}
{β : Type u_2}
{p : α → Prop}
{f : (a : α) → p a → β}
{x : Option α}
{hf : ∀ (a : α), a ∈ x → p a}
{y : β}

Option.pmap f x hf = some y ↔ ∃ a H, f a ⋯ = y


theorem epi_of_cancel_zero {P Q : C} (f : P ⟶ Q) (h : ∀ {R : C} (g : Q ⟶ R), f ≫ g = 0 → g = 0) :
    Epi f


/-- A measure `μ` on a measurable additive group is right invariant
  if the measure of right translations of a set are equal to the measure of the set itself. -/
class IsAddRightInvariant [Add G] (μ : Measure G) : Prop where
  map_add_right_eq_self : ∀ g : G, map (· + g) μ = μ

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

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


theorem term_atom_pf {α} [AddCommMonoid α] (x x' : α) (h : x = x') : x = term 1 x' 0

{α : Type u_1}
[AddCommMonoid α]
(x x' : α)
(h : x = x')


theorem degree_sub_le (p q : R[X]) : degree (p - q) ≤ max (degree p) (degree q)


/-- A function to a discrete topological space is continuous if and only if the preimage of every
singleton is open. -/
theorem continuous_discrete_rng [TopologicalSpace β] [DiscreteTopology β]
    {f : α → β} : Continuous f ↔ ∀ b : β, IsOpen (f ⁻¹' {b})

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

Continuous f ↔ ∀ (b : β), IsOpen (f ⁻¹' {b})


@[to_additive (attr := simp)]
lemma UniformFun.toFun_div [Div β] (f g : α →ᵤ β) : toFun (f / g) = toFun f / toFun g

{α : Type u_1}
{β : Type u_2}
[Div β]
(f g : α →ᵤ β)

UniformFun.toFun (f / g) = UniformFun.toFun f / UniformFun.toFun g


/-- `M.toNFA` is an `NFA` constructed from a `DFA` `M` by using the same start and accept
  states and a transition function which sends `s` with input `a` to the singleton `M.step s a`. -/
@[simps] def toNFA (M : DFA α σ') : NFA α σ'

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


theorem abv_pos {a : R} : 0 < abv a ↔ a ≠ 0

{S : Type u_5}
[OrderedSemiring S]
{R : Type u_6}
[Semiring R]
(abv : R → S)
[IsAbsoluteValue abv]
{a : R}


@[simp]
theorem lcm_empty : (∅ : Finset β).lcm f = 1

{α : Type u_2}
{β : Type u_3}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{f : β → α}


theorem ball_subset (h : dist x y ≤ ε₂ - ε₁) : ball x ε₁ ⊆ ball y ε₂

{α : Type u}
[PseudoMetricSpace α]
{x y : α}
{ε₁ ε₂ : ℝ}
(h : dist x y ≤ ε₂ - ε₁)


theorem sub_pow_char_pow_of_commute [Ring R] {p : ℕ} [Fact p.Prime] [CharP R p] {n : ℕ} (x y : R)
    (h : Commute x y) : (x - y) ^ p ^ n = x ^ p ^ n - y ^ p ^ n

(R : Type u_1)
[Ring R]
{p : ℕ}
[Fact (Nat.Prime p)]
[CharP R p]
{n : ℕ}
(x y : R)
(h : Commute x y)


@[to_additive (attr := ext)]
theorem Monoid.ext {M : Type u} ⦃m₁ m₂ : Monoid M⦄
    (h_mul : (letI := m₁; HMul.hMul : M → M → M) = (letI := m₂; HMul.hMul : M → M → M)) :
    m₁ = m₂

{M : Type u}
⦃m₁ m₂ : AddMonoid M⦄
(h_mul : HAdd.hAdd = HAdd.hAdd)


@[simp]
theorem op_top : (⊤ : Subsemiring R).op = ⊤


theorem injective_of_ne_zero [IsSimpleModule R M] {f : M →ₗ[R] N} (h : f ≠ 0) :
    Function.Injective f

{R : Type u_2}
[Ring R]
{M : Type u_4}
[AddCommGroup M]
[Module R M]
{N : Type u_5}
[AddCommGroup N]
[Module R N]
[IsSimpleModule R M]
{f : M →ₗ[R] N}
(h : f ≠ 0)


/-- (implementation detail) A function `Quot F → α` induces a cocone on `F` as long as the universes
    work out. -/
@[simps]
def toCocone {α : Type u} (f : Quot F → α) : Cocone F

(f : CategoryTheory.Limits.Types.Quot F → α)

∀ (a : F.obj j), (CategoryTheory.Limits.Types.toCocone f).ι.app j a = (f ∘ CategoryTheory.Limits.Types.Quot.ι F j) a


theorem exists_isTranscendenceBasis (h : Injective (algebraMap R A)) :
    ∃ s : Set A, IsTranscendenceBasis R ((↑) : s → A)

(h : Function.Injective ⇑(algebraMap R A))


theorem inv_mul_eq_iff_eq_mul_of_invertible (A B C : Matrix n n α) [Invertible A] :
    A⁻¹ * B = C ↔ B = A * C

{n : Type u'}
{α : Type v}
[Fintype n]
[DecidableEq n]
[CommRing α]
(A B C : Matrix n n α)
[Invertible A]


@[simp]
theorem AddMonoidHom.mapDMatrix_apply [∀ i j, AddMonoid (α i j)] {β : m → n → Type w}
    [∀ i j, AddMonoid (β i j)] (f : ∀ ⦃i j⦄, α i j →+ β i j) (M : DMatrix m n α) :
    AddMonoidHom.mapDMatrix f M = M.map fun i j => @f i j

(f : ⦃i : m⦄ → ⦃j : n⦄ → α i j →+ β i j)

(AddMonoidHom.mapDMatrix f) M = M.map fun i j => ⇑f


theorem nth_lt_of_lt_count {n k : ℕ} (h : k < count p n) : nth p k < n

{p : ℕ → Prop}
[DecidablePred p]
{n k : ℕ}
(h : k < Nat.count p n)


theorem upperCrossingTime_succ : upperCrossingTime a b f N (n + 1) ω =
    hitting f (Set.Ici b) (lowerCrossingTimeAux a f (upperCrossingTime a b f N n ω) N ω) N ω

{Ω : Type u_1}
{ι : Type u_2}
[Preorder ι]
[OrderBot ι]
[InfSet ι]
{a b : ℝ}
{f : ι → Ω → ℝ}
{N : ι}
{n : ℕ}
{ω : Ω}

MeasureTheory.upperCrossingTime a b f N (n + 1) ω =
  MeasureTheory.hitting f (Set.Ici b)
    (MeasureTheory.lowerCrossingTimeAux a f (MeasureTheory.upperCrossingTime a b f N n ω) N ω) N ω


theorem IsExtrFilter.congr {α β : Type*} [Preorder β] {f g : α → β} {a : α} {l : Filter α}
    (h : IsExtrFilter f l a) (heq : f =ᶠ[l] g) (hfga : f a = g a) : IsExtrFilter g l a

{α : Type u_1}
{β : Type u_2}
[Preorder β]
{f g : α → β}
{a : α}
{l : Filter α}
(h : IsExtrFilter f l a)
(heq : f =ᶠ[l] g)
(hfga : f a = g a)


/-- A sublattice of a lattice is a set containing the suprema and infima of any of its elements. -/
structure Sublattice where
  /-- The underlying set of a sublattice. **Do not use directly**. Instead, use the coercion
  `Sublattice α → Set α`, which Lean should automatically insert for you in most cases. -/
  carrier : Set α
  supClosed' : SupClosed carrier
  infClosed' : InfClosed carrier

{α : Type u_2}
[Lattice α]
(self : Sublattice α)


theorem hasMFDerivWithinAt_fst (s : Set (M × M')) (x : M × M') :
    HasMFDerivWithinAt (I.prod I') I Prod.fst s x
      (ContinuousLinearMap.fst 𝕜 (TangentSpace I x.1) (TangentSpace I' x.2))

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
(I : ModelWithCorners 𝕜 E H)
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H' : Type u_6}
[TopologicalSpace H']
(I' : ModelWithCorners 𝕜 E' H')
{M' : Type u_7}
[TopologicalSpace M']
[ChartedSpace H' M']
[SmoothManifoldWithCorners I' M']
(s : Set (M × M'))
(x : M × M')


/-- A finite family of vectors is linearly independent if and only if
its cardinality equals the dimension of its span. -/
theorem linearIndependent_iff_card_eq_finrank_span {ι : Type*} [Fintype ι] {b : ι → V} :
    LinearIndependent K b ↔ Fintype.card ι = (Set.range b).finrank K

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]
{ι : Type u_2}
[Fintype ι]
{b : ι → V}

LinearIndependent K b ↔ Fintype.card ι = Set.finrank K (Set.range b)


/-- Two rfl lemmas that cannot be generated by `@[simps]`. -/
@[simp]
theorem prod_id (X : C) (Y : D) : 𝟙 (X, Y) = (𝟙 X, 𝟙 Y)

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

CategoryTheory.CategoryStruct.id (X, Y) = (CategoryTheory.CategoryStruct.id X, CategoryTheory.CategoryStruct.id Y)


theorem fderivWithin_zero_of_nmem_closure (h : x ∉ closure s) : fderivWithin 𝕜 f s x = 0

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


@[simp]
theorem tendsto_nhdsWithin_range {a : α} {l : Filter β} {f : β → α} :
    Tendsto f l (𝓝[range f] a) ↔ Tendsto f l (𝓝 a)

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

Filter.Tendsto f l (𝓝[Set.range f] a) ↔ Filter.Tendsto f l (𝓝 a)


/-- Orthogonal submodules are disjoint. -/
theorem IsOrtho.disjoint {U V : Submodule 𝕜 E} (h : U ⟂ V) : Disjoint U V

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


theorem range'_subset_right_1 {s m n : Nat} : range' s m ⊆ range' s n ↔ m ≤ n

List.range' s m ⊆ List.range' s n ↔ m ≤ n


protected theorem tsum_eq_top_of_eq_top : (∃ a, f a = ∞) → ∑' a, f a = ∞


@[to_additive (attr := simp)]
theorem mul_mk : mk L₁ * mk L₂ = mk (L₁ ++ L₂)

FreeGroup.mk L₁ * FreeGroup.mk L₂ = FreeGroup.mk (L₁ ++ L₂)


theorem sum_fiberwise {α M} [AddCommMonoid M] (π : Prepartition I) (f : Box ι → α) (g : Box ι → M) :
    (∑ y ∈ π.boxes.image f, ∑ J ∈ (π.filter fun J => f J = y).boxes, g J) =
      ∑ J ∈ π.boxes, g J

{ι : Type u_1}
{I : BoxIntegral.Box ι}
{α : Type u_2}
{M : Type u_3}
[AddCommMonoid M]
(π : BoxIntegral.Prepartition I)
(f : BoxIntegral.Box ι → α)
(g : BoxIntegral.Box ι → M)

∑ y ∈ Finset.image f π.boxes, ∑ J ∈ (π.filter fun J => f J = y).boxes, g J = ∑ J ∈ π.boxes, g J


@[to_additive (attr := simp)]
theorem toFun_eq_coe : p.toFun = p

{E : Type u_4}
[AddGroup E]
{p : AddGroupSeminorm E}


theorem mfderivWithin_id (hxs : UniqueMDiffWithinAt I s x) :
    mfderivWithin I I (@id M) s x = ContinuousLinearMap.id 𝕜 (TangentSpace I x)

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

mfderivWithin I I id s x = ContinuousLinearMap.id 𝕜 (TangentSpace I x)


theorem comp_lcm {g : α → α} (hco : Commute f g) (hf : IsPeriodicPt f m x)
    (hg : IsPeriodicPt g n x) : IsPeriodicPt (f ∘ g) (Nat.lcm m n) x

{α : Type u_1}
{f : α → α}
{x : α}
{m n : ℕ}
{g : α → α}
(hco : Function.Commute f g)
(hf : Function.IsPeriodicPt f m x)
(hg : Function.IsPeriodicPt g n x)

Function.IsPeriodicPt (f ∘ g) (m.lcm n) x


@[to_additive]
theorem mrange_top_iff_surjective {f : F} : mrange f = (⊤ : Submonoid N) ↔ Function.Surjective f

{M : Type u_1}
{N : Type u_2}
[MulOneClass M]
[MulOneClass N]
{F : Type u_5}
[FunLike F M N]
[mc : MonoidHomClass F M N]
{f : F}

MonoidHom.mrange f = ⊤ ↔ Function.Surjective ⇑f


@[to_additive]
theorem EventuallyEq.inv [Inv β] {f g : α → β} {l : Filter α} (h : f =ᶠ[l] g) :
    (fun x => (f x)⁻¹) =ᶠ[l] fun x => (g x)⁻¹

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


theorem sum_finsupport (hx₀ : x₀ ∈ s) : ∑ i ∈ ρ.finsupport x₀, ρ i x₀ = 1

{ι : Type u}
{X : Type v}
[TopologicalSpace X]
{s : Set X}
(ρ : PartitionOfUnity ι X s)
{x₀ : X}
(hx₀ : x₀ ∈ s)


theorem ennnorm_indicatorConstLp_le :
    (‖indicatorConstLp p hs hμs c‖₊ : ℝ≥0∞) ≤ ‖c‖₊ * (μ s) ^ (1 / p.toReal)

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{s : Set α}
{hs : MeasurableSet s}
{hμs : μ s ≠ ⊤}
{c : E}

↑‖MeasureTheory.indicatorConstLp p hs hμs c‖₊ ≤ ↑‖c‖₊ * μ s ^ (1 / p.toReal)


theorem meas_lt_essInf
    (hf : IsBoundedUnder (· ≥ ·) (ae μ) f := by isBoundedDefault) :
    μ { y | f y < essInf f μ } = 0

(hf : Filter.IsBoundedUnder (fun x x_1 => x ≥ x_1) (MeasureTheory.ae μ) f := by isBoundedDefault)


@[simp]
theorem toAffineSubspace_direction (s : Submodule k V) : s.toAffineSubspace.direction = s

{k : Type u_1}
{V : Type u_2}
[Ring k]
[AddCommGroup V]
[Module k V]
(s : Submodule k V)


theorem isPredLimitRecOn_pred' (hs : ∀ a, ¬IsMin a → C (pred a)) (hl : ∀ a, IsPredLimit a → C a)
    {b : α} (hb : ¬IsMin b) : @isPredLimitRecOn α _ _ C (pred b) hs hl = hs b hb

(hs : (a : α) → ¬IsMin a → C (Order.pred a))

(hl : (a : α) → Order.IsPredLimit a → C a)

Order.isPredLimitRecOn (Order.pred b) hs hl = hs b hb


theorem Faithful.div_comp (F : C ⥤ E) [F.Faithful] (G : D ⥤ E) [G.Faithful] (obj : C → D)
    (h_obj : ∀ X, G.obj (obj X) = F.obj X) (map : ∀ {X Y}, (X ⟶ Y) → (obj X ⟶ obj Y))
    (h_map : ∀ {X Y} {f : X ⟶ Y}, HEq (G.map (map f)) (F.map f)) :
    Faithful.div F G obj @h_obj @map @h_map ⋙ G = F

(h_obj : ∀ (X : C), G.obj (obj X) = F.obj X)

(map : {X Y : C} → (X ⟶ Y) → (obj X ⟶ obj Y))

(h_map : ∀ {X Y : C} {f : X ⟶ Y}, HEq (G.map (map f)) (F.map f))

(CategoryTheory.Functor.Faithful.div F G obj h_obj map h_map).comp G = F


/-- Note that the `IsScalarTower α β β` typeclass argument is usually satisfied by `Algebra α β`. -/
@[to_additive] -- Porting note: nolint to_additive_doc
lemma smul_mul_assoc [Mul β] [SMul α β] [IsScalarTower α β β] (r : α) (x y : β) :
    r • x * y = r • (x * y)

{α : Type u_7}
{β : Type u_8}
[Add β]
[VAdd α β]
[VAddAssocClass α β β]
(r : α)
(x y : β)


theorem Coprime.mul_dvd_of_dvd_of_dvd (hmn : Coprime m n) (hm : m ∣ a) (hn : n ∣ a) : m * n ∣ a

{m n a : Nat}
(hmn : m.Coprime n)
(hm : m ∣ a)
(hn : n ∣ a)


protected theorem CovBy.wcovBy (h : a ⋖ b) : a ⩿ b

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


@[simp, reassoc]
theorem limitUncurryIsoLimitCompLim_hom_π_π {j} {k} :
    (limitUncurryIsoLimitCompLim F).hom ≫ limit.π _ j ≫ limit.π _ k = limit.π _ (j, k)

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

(CategoryTheory.Limits.limitUncurryIsoLimitCompLim F).hom ≫
    CategoryTheory.Limits.limit.π (F ⋙ CategoryTheory.Limits.lim) j ≫ CategoryTheory.Limits.limit.π (F.obj j) k =
  CategoryTheory.Limits.limit.π (CategoryTheory.uncurry.obj F) (j, k)


/-- The identity monad. -/
@[simps!]
def id : Monad C

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


@[simp] theorem mem_map {f : α → β} {l : Array α} : b ∈ l.map f ↔ ∃ a, a ∈ l ∧ f a = b

{α : Type u_1}
{β : Type u_2}
{b : β}
{f : α → β}
{l : Array α}

b ∈ Array.map f l ↔ ∃ a, a ∈ l ∧ f a = b


theorem tsum_coe_indicator_ne_top (p : PMF α) (s : Set α) : ∑' a, s.indicator p a ≠ ∞


theorem continuousAt_rpow_of_pos (p : ℝ × ℝ) (hp : 0 < p.2) :
    ContinuousAt (fun p : ℝ × ℝ => p.1 ^ p.2) p


theorem continuous_if_const (p : Prop) {f g : α → β} [Decidable p] (hf : p → Continuous f)
    (hg : ¬p → Continuous g) : Continuous fun a => if p then f a else g a

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
(p : Prop)
{f g : α → β}
[Decidable p]
(hf : p → Continuous f)
(hg : ¬p → Continuous g)


theorem opNorm_mulLeftRight_apply_apply_le (x y : 𝕜') : ‖mulLeftRight 𝕜 𝕜' x y‖ ≤ ‖x‖ * ‖y‖

(𝕜 : Type u_1)
[NontriviallyNormedField 𝕜]
(𝕜' : Type u_3)
[NonUnitalSeminormedRing 𝕜']
[NormedSpace 𝕜 𝕜']
[IsScalarTower 𝕜 𝕜' 𝕜']
[SMulCommClass 𝕜 𝕜' 𝕜']
(x y : 𝕜')

‖((ContinuousLinearMap.mulLeftRight 𝕜 𝕜') x) y‖ ≤ ‖x‖ * ‖y‖


@[reassoc (attr := simp)]
theorem fac (H : IsKan t) (s : LeftExtension f g) :
    t.unit ≫ f ◁ H.desc s = s.unit

{t : CategoryTheory.Bicategory.LeftExtension f g}

(s : CategoryTheory.Bicategory.LeftExtension f g)

CategoryTheory.CategoryStruct.comp t.unit (CategoryTheory.Bicategory.whiskerLeft f (H.desc s)) = s.unit


@[to_additive (attr := simp)]
theorem ofLex_div [Div α] (a b : Lex α) : ofLex (a / b) = ofLex a / ofLex b


/-- The commutation with the shift isomorphism for the functor on cochain complexes
induced by an additive functor between preadditive categories. -/
@[simps!]
def mapCochainComplexShiftIso (n : ℤ) :
    shiftFunctor _ n ⋙ F.mapHomologicalComplex (ComplexShape.up ℤ) ≅
      F.mapHomologicalComplex (ComplexShape.up ℤ) ⋙ shiftFunctor _ n

(X : HomologicalComplex C (ComplexShape.up ℤ))

((F.mapCochainComplexShiftIso n).hom.app X).f i = 𝟙 (F.obj (X.X (i + n)))


/-- `ζ - 1` is prime if `ζ` is a primitive `p`-th root of unity. -/
theorem zeta_sub_one_prime' [h : IsCyclotomicExtension {p} ℚ K] (hζ : IsPrimitiveRoot ζ p) :
    Prime ((hζ.toInteger - 1))

{p : ℕ+}
{K : Type u}
[Field K]
[CharZero K]
{ζ : K}
[hp : Fact (Nat.Prime ↑p)]
[h : IsCyclotomicExtension {p} ℚ K]
(hζ : IsPrimitiveRoot ζ ↑p)


theorem not_facet_iff_subface (hs : s ∈ K.faces) : s ∉ K.facets ↔ ∃ t, t ∈ K.faces ∧ s ⊂ t

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedRing 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
{K : Geometry.SimplicialComplex 𝕜 E}
{s : Finset E}
(hs : s ∈ K.faces)


/-- Not marked `@[ext]` as the `ext` tactic already solves this. -/
theorem ext ⦃A B : GL n R⦄ (h : ∀ i j, (A : Matrix n n R) i j = (B : Matrix n n R) i j) : A = B

{n : Type u}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
⦃A B : GL n R⦄
(h : ∀ (i j : n), ↑A i j = ↑B i j)


theorem pow_sub_dvd_iterate_derivative_of_pow_dvd {p q : R[X]} {n : ℕ} (m : ℕ)
    (dvd : q ^ n ∣ p) : q ^ (n - m) ∣ derivative^[m] p

{R : Type u}
[CommSemiring R]
{p q : R[X]}
{n : ℕ}
(m : ℕ)
(dvd : q ^ n ∣ p)

q ^ (n - m) ∣ (⇑Polynomial.derivative)^[m] p


theorem zero_iff_num_zero {q : ℚ} : q = 0 ↔ q.num = 0


theorem log_ne_zero {x : ℝ} : log x ≠ 0 ↔ x ≠ 0 ∧ x ≠ 1 ∧ x ≠ -1


@[to_additive (attr := simp)]
lemma rangeRestrict_injective_iff {f : G →* N} : Injective f.rangeRestrict ↔ Injective f

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
{f : G →* N}

Function.Injective ⇑f.rangeRestrict ↔ Function.Injective ⇑f


/-- Constructs an isomorphism of lattices from an order isomorphism between them. -/
@[simps]
def Iso.mk {α β : SemilatSupCat.{u}} (e : α ≃o β) : α ≅ β

{α β : SemilatSupCat}
(e : α.X ≃o β.X)
(a : α.X)

(SemilatSupCat.Iso.mk e).hom.toSupHom a = e a


/-- The composition of two oplax monoidal functors is again oplax monoidal. -/
@[simps]
def comp : OplaxMonoidalFunctor.{v₁, v₃} C E

(F : CategoryTheory.OplaxMonoidalFunctor C D)

(G : CategoryTheory.OplaxMonoidalFunctor D E)

(F ⊗⋙ G).δ X Y = G.map (F.δ X Y) ≫ G.δ (F.obj X) (F.obj Y)


@[simp] theorem neg_le_neg_iff {a b : EReal} : -a ≤ -b ↔ b ≤ a


@[simp]
theorem const_mul {f : ℝ → A} (hf : IntervalIntegrable f μ a b) (c : A) :
    IntervalIntegrable (fun x => c * f x) μ a b

{A : Type u_5}
[NormedRing A]
{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}
{f : ℝ → A}
(hf : IntervalIntegrable f μ a b)
(c : A)


theorem ConvexOn.lt_left_of_right_lt (hf : ConvexOn 𝕜 s f) {x y z : E} (hx : x ∈ s) (hy : y ∈ s)
    (hz : z ∈ openSegment 𝕜 x y) (hyz : f y < f z) : f z < f x

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[LinearOrderedCancelAddCommMonoid β]
[Module 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : ConvexOn 𝕜 s f)
{x y z : E}
(hx : x ∈ s)
(hy : y ∈ s)
(hz : z ∈ openSegment 𝕜 x y)
(hyz : f y < f z)


@[parity_simps]
lemma even_sub : Even (m - n) ↔ (Even m ↔ Even n)


@[to_additive add_zsmul_self]
lemma mul_self_zpow (a : G) (n : ℤ) : a * a ^ n = a ^ (n + 1)

{G : Type u_3}
[AddGroup G]
(a : G)
(n : ℤ)


theorem restrict_iUnion_le [Countable ι] {s : ι → Set α} :
    μ.restrict (⋃ i, s i) ≤ sum fun i => μ.restrict (s i)

{α : Type u_2}
{ι : Type u_6}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[Countable ι]
{s : ι → Set α}

μ.restrict (⋃ i, s i) ≤ MeasureTheory.Measure.sum fun i => μ.restrict (s i)


@[simp]
theorem scalar_eq [Nontrivial A] (k : 𝕜) : σ (↑ₐ k) = {k}

{𝕜 : Type u}
{A : Type v}
[Field 𝕜]
[Ring A]
[Algebra 𝕜 A]
[Nontrivial A]
(k : 𝕜)


@[simp]
theorem affineCombinationSingleWeights_apply_self [DecidableEq ι] (i : ι) :
    affineCombinationSingleWeights k i i = 1

(k : Type u_1)
[Ring k]
{ι : Type u_4}
[DecidableEq ι]
(i : ι)

Finset.affineCombinationSingleWeights k i i = 1


theorem tendsto_atTop_of_monotone_of_subseq [Preorder ι] [Preorder α] {u : ι → α} {φ : ι' → ι}
    (h : Monotone u) {l : Filter ι'} [NeBot l] (H : Tendsto (u ∘ φ) l atTop) :
    Tendsto u atTop atTop

{φ : ι' → ι}

(H : Filter.Tendsto (u ∘ φ) l Filter.atTop)

Filter.Tendsto u Filter.atTop Filter.atTop


@[simp]
theorem decompose_symm_mul (x y : ⨁ i, 𝒜 i) :
    (decompose 𝒜).symm (x * y) = (decompose 𝒜).symm x * (decompose 𝒜).symm y

{ι : Type u_1}
{A : Type u_3}
{σ : Type u_4}
[DecidableEq ι]
[AddMonoid ι]
[Semiring A]
[SetLike σ A]
[AddSubmonoidClass σ A]
(𝒜 : ι → σ)
[GradedRing 𝒜]
(x y : ⨁ (i : ι), ↥(𝒜 i))

(DirectSum.decompose 𝒜).symm (x * y) = (DirectSum.decompose 𝒜).symm x * (DirectSum.decompose 𝒜).symm y


lemma Infinite.exists_not_mem_finite (hs : s.Infinite) (ht : t.Finite) : ∃ a, a ∈ s ∧ a ∉ t

{α : Type u}
{s t : Set α}
(hs : s.Infinite)
(ht : t.Finite)


theorem lt_norm_sub_of_not_sameRay (h : ¬SameRay ℝ x y) : ‖x‖ - ‖y‖ < ‖x - y‖

{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[StrictConvexSpace ℝ E]
{x y : E}
(h : ¬SameRay ℝ x y)


theorem restrictScalars_injective :
    Function.Injective (restrictScalars R : (M ≃ₗ[S] M₂) → M ≃ₗ[R] M₂)

(R : Type u_1)
{S : Type u_7}
{M : Type u_8}
{M₂ : Type u_10}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₂]
[Module R M]
[Module R M₂]
[Module S M]
[Module S M₂]
[LinearMap.CompatibleSMul M M₂ R S]


@[gcongr]
lemma div_le_div_left (hcb : c ≤ b) (hc : 0 < c) : a / b ≤ a / c


lemma LocallyLinear.map (f : α ↪ β) (hG : G.LocallyLinear) : (G.map f).LocallyLinear

{α : Type u_1}
{β : Type u_2}
{G : SimpleGraph α}
(f : α ↪ β)
(hG : G.LocallyLinear)


@[fun_prop]
theorem HasFDerivWithinAt.mul_const' (ha : HasFDerivWithinAt a a' s x) (b : 𝔸) :
    HasFDerivWithinAt (fun y => a y * b) (a'.smulRight b) s x

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


theorem IsEquivalent.tendsto_atTop [OrderTopology β] (huv : u ~[l] v) (hu : Tendsto u l atTop) :
    Tendsto v l atTop

{α : Type u_1}
{β : Type u_2}
[NormedLinearOrderedField β]
{u v : α → β}
{l : Filter α}
[OrderTopology β]
(huv : u ~[l] v)
(hu : Filter.Tendsto u l Filter.atTop)


@[simp]
theorem two_zsmul_coe_pi : (2 : ℤ) • (π : Angle) = 0


theorem det_traceMatrix_ne_zero' [Algebra.IsSeparable K L] : det (traceMatrix K pb.basis) ≠ 0

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

(Algebra.traceMatrix K ⇑pb.basis).det ≠ 0


theorem restrictScalars_injective :
    Function.Injective (restrictScalars R : (A →ₐ[S] B) → A →ₐ[R] B)

(R : Type u)
{S : Type v}
{A : Type w}
{B : Type u₁}
[CommSemiring R]
[CommSemiring S]
[Semiring A]
[Semiring B]
[Algebra R S]
[Algebra S A]
[Algebra S B]
[Algebra R A]
[Algebra R B]
[IsScalarTower R S A]
[IsScalarTower R S B]


theorem add_left_cancel_iff [IsLeftCancelAdd α] (ha : a ≠ ⊥) : a + b = a + c ↔ b = c

{α : Type u}
[Add α]
{a b c : WithBot α}
[IsLeftCancelAdd α]
(ha : a ≠ ⊥)


@[simp]
lemma totallyBounded_insert (a : α) {s : Set α} :
    TotallyBounded (insert a s) ↔ TotallyBounded s

{α : Type u}
[uniformSpace : UniformSpace α]
(a : α)
{s : Set α}


@[simp]
theorem nat_eq_lift_iff {n : ℕ} {a : Cardinal.{u}} :
    (n : Cardinal) = lift.{v} a ↔ (n : Cardinal) = a


@[to_additive]
theorem HasProd.compl_mul {s : Set β} (ha : HasProd (f ∘ (↑) : (sᶜ : Set β) → α) a)
    (hb : HasProd (f ∘ (↑) : s → α) b) : HasProd f (a * b)

{α : Type u_1}
{β : Type u_2}
[CommMonoid α]
[TopologicalSpace α]
{f : β → α}
{a b : α}
[ContinuousMul α]
{s : Set β}
(ha : HasProd (f ∘ Subtype.val) a)
(hb : HasProd (f ∘ Subtype.val) b)


theorem sSup_inf_sSup : sSup s ⊓ sSup t = ⨆ p ∈ s ×ˢ t, (p : α × α).1 ⊓ p.2

{α : Type u}
[Order.Frame α]
{s t : Set α}

sSup s ⊓ sSup t = ⨆ p ∈ s ×ˢ t, p.1 ⊓ p.2


theorem aemeasurable_of_pdf_ne_zero {m : MeasurableSpace Ω} {ℙ : Measure Ω} {μ : Measure E}
    (X : Ω → E) (h : ¬pdf X ℙ μ =ᵐ[μ] 0) : AEMeasurable X ℙ

{Ω : Type u_1}
{E : Type u_2}
[MeasurableSpace E]
{m : MeasurableSpace Ω}
{ℙ : MeasureTheory.Measure Ω}
{μ : MeasureTheory.Measure E}
(X : Ω → E)
(h : ¬MeasureTheory.pdf X ℙ μ =ᵐ[μ] 0)


lemma isIso_cyclesMap'_of_isIso_of_mono (φ : S₁ ⟶ S₂) (h₂ : IsIso φ.τ₂) (h₃ : Mono φ.τ₃)
    (h₁ : S₁.LeftHomologyData) (h₂ : S₂.LeftHomologyData) :
    IsIso (cyclesMap' φ h₁ h₂)

∀ (h₂ : S₂.LeftHomologyData), CategoryTheory.IsIso (CategoryTheory.ShortComplex.cyclesMap' φ h₁ h₂)


/-- A finite-dimensional subspace is closed. -/
theorem Submodule.closed_of_finiteDimensional (s : Submodule 𝕜 E) [FiniteDimensional 𝕜 s] :
    IsClosed (s : Set E)

{𝕜 : Type u_1}
{E : Type u_2}
[NontriviallyNormedField 𝕜]
[CompleteSpace 𝕜]
[AddCommGroup E]
[TopologicalSpace E]
[T2Space E]
[TopologicalAddGroup E]
[Module 𝕜 E]
[ContinuousSMul 𝕜 E]
(s : Submodule 𝕜 E)
[FiniteDimensional 𝕜 ↥s]


/-- The pushforward functor. -/
@[simps!]
def pushforward {X Y : TopCat.{w}} (f : X ⟶ Y) : X.Presheaf C ⥤ Y.Presheaf C

(C : Type u)
[CategoryTheory.Category.{v, u} C]
{X Y : TopCat}
(f : X ⟶ Y)
(G : (TopologicalSpace.Opens ↑X)ᵒᵖ ⥤ C)

∀ {X_1 Y_1 : (TopologicalSpace.Opens ↑Y)ᵒᵖ} (f_1 : X_1 ⟶ Y_1),
  ((TopCat.Presheaf.pushforward C f).obj G).map f_1 = G.map ((TopologicalSpace.Opens.map f).map f_1.unop).op


theorem eq_bot_of_isCompl_top (h : IsCompl x ⊤) : x = ⊥

{α : Type u_1}
[Lattice α]
[BoundedOrder α]
{x : α}
(h : IsCompl x ⊤)


/-- To prove something for an arbitrary `Lp` function in a second countable Borel normed group, it
suffices to show that
* the property holds for (multiples of) characteristic functions;
* is closed under addition;
* the set of functions in `Lp` for which the property holds is closed.
-/
@[elab_as_elim]
theorem Lp.induction [_i : Fact (1 ≤ p)] (hp_ne_top : p ≠ ∞) (P : Lp E p μ → Prop)
    (h_ind : ∀ (c : E) {s : Set α} (hs : MeasurableSet s) (hμs : μ s < ∞),
      P (Lp.simpleFunc.indicatorConst p hs hμs.ne c))
    (h_add : ∀ ⦃f g⦄, ∀ hf : Memℒp f p μ, ∀ hg : Memℒp g p μ, Disjoint (support f) (support g) →
      P (hf.toLp f) → P (hg.toLp g) → P (hf.toLp f + hg.toLp g))
    (h_closed : IsClosed { f : Lp E p μ | P f }) : ∀ f : Lp E p μ, P f

(h_ind :
  ∀ (c : E) {s : Set α} (hs : MeasurableSet s) (hμs : μ s < ⊤),
    P ↑(MeasureTheory.Lp.simpleFunc.indicatorConst p hs ⋯ c))

(h_add :
  ∀ ⦃f g : α → E⦄ (hf : MeasureTheory.Memℒp f p μ) (hg : MeasureTheory.Memℒp g p μ),
    Disjoint (Function.support f) (Function.support g) →
      P (MeasureTheory.Memℒp.toLp f hf) →
        P (MeasureTheory.Memℒp.toLp g hg) → P (MeasureTheory.Memℒp.toLp f hf + MeasureTheory.Memℒp.toLp g hg))


@[simp]
theorem lTensor_id : (id : N →ₗ[R] N).lTensor M = id

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

LinearMap.lTensor M LinearMap.id = LinearMap.id


@[to_additive]
theorem mul_mem_cancel_right (h : a ∈ s) : b * a ∈ s ↔ b ∈ s

{G : Type u_1}
{a b : G}
[AddGroup G]
{s : Set G}
(hs : IsAddSubgroup s)
(h : a ∈ s)


/-- If `f` is a monotone sequence of `Finset`s and each `x` belongs to one of `f n`, then
`Tendsto f atTop atTop`. -/
theorem tendsto_atTop_finset_of_monotone [Preorder β] {f : β → Finset α} (h : Monotone f)
    (h' : ∀ x : α, ∃ n, x ∈ f n) : Tendsto f atTop atTop

{α : Type u_3}
{β : Type u_4}
[Preorder β]
{f : β → Finset α}
(h : Monotone f)
(h' : ∀ (x : α), ∃ n, x ∈ f n)

Filter.Tendsto f Filter.atTop Filter.atTop


@[simp]
theorem support_erase (i : ι) (f : Π₀ i, β i) : (f.erase i).support = f.support.erase i

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

(DFinsupp.erase i f).support = f.support.erase i


theorem preimage_subset_iff {A : Set α} {B : Set β} {f : α → β} :
    f ⁻¹' B ⊆ A ↔ ∀ a : α, f a ∈ B → a ∈ A

{α : Type u_1}
{β : Type u_2}
{A : Set α}
{B : Set β}
{f : α → β}

f ⁻¹' B ⊆ A ↔ ∀ (a : α), f a ∈ B → a ∈ A


theorem eq_or_mem_of_mem_cons {a b : α} : ∀ {s : Seq α}, a ∈ cons b s → a = b ∨ a ∈ s

{α : Type u}
{a b : α}
{s : Stream'.Seq α}

a ∈ Stream'.Seq.cons b s → a = b ∨ a ∈ s


protected theorem All.balLeft
    (hl : l.All p) (hv : p v) (hr : r.All p) : (balLeft l v r).All p

∀ {α : Type u_1} {p : α → Prop} {l : Batteries.RBNode α} {v : α} {r : Batteries.RBNode α},
  Batteries.RBNode.All p l → p v → Batteries.RBNode.All p r → Batteries.RBNode.All p (l.balLeft v r)


@[simp]
theorem vadd_domain (f : E →ₗ[R] F) (g : E →ₗ.[R] F) : (f +ᵥ g).domain = g.domain

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
(f : E →ₗ[R] F)
(g : E →ₗ.[R] F)


@[to_additive]
theorem orderOf_fst_dvd_orderOf : orderOf x.1 ∣ orderOf x

{α : Type u_4}
{β : Type u_5}
[AddMonoid α]
[AddMonoid β]
{x : α × β}


theorem iteratedFDeriv_const_smul_apply {x : E} (hf : ContDiff 𝕜 i f) :
    iteratedFDeriv 𝕜 i (a • f) x = a • iteratedFDeriv 𝕜 i f x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
{R : Type u_3}
[Semiring R]
[Module R F]
[SMulCommClass 𝕜 R F]
[ContinuousConstSMul R F]
{i : ℕ}
{a : R}
{x : E}
(hf : ContDiff 𝕜 (↑i) f)


theorem ClassGroup.mk0_eq_mk0_iff_exists_fraction_ring [IsDedekindDomain R] {I J : (Ideal R)⁰} :
    ClassGroup.mk0 I =
      ClassGroup.mk0 J ↔ ∃ (x : _) (_ : x ≠ (0 : K)), spanSingleton R⁰ x * I = J

{R : Type u_1}
(K : Type u_2)
[CommRing R]
[Field K]
[Algebra R K]
[IsFractionRing R K]
[IsDomain R]
[IsDedekindDomain R]
{I J : ↥(Ideal R)⁰}

ClassGroup.mk0 I = ClassGroup.mk0 J ↔ ∃ x, ∃ (_ : x ≠ 0), FractionalIdeal.spanSingleton R⁰ x * ↑↑I = ↑↑J


theorem ordConnectedComponent_inter (s t : Set α) (x : α) :
    ordConnectedComponent (s ∩ t) x = ordConnectedComponent s x ∩ ordConnectedComponent t x

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

(s ∩ t).ordConnectedComponent x = s.ordConnectedComponent x ∩ t.ordConnectedComponent x


theorem choose_mem (hp : ∃! a, a ∈ l ∧ p a) : choose p l hp ∈ l

{α : Type u_1}
(p : α → Prop)
[DecidablePred p]
(l : Multiset α)
(hp : ∃! a, a ∈ l ∧ p a)


theorem roots_expand_image_iterateFrobenius [DecidableEq R] :
    (expand R (p ^ n) f).roots.toFinset.image (iterateFrobenius R p n) = f.roots.toFinset

{R : Type u_1}
[CommRing R]
[IsDomain R]
{p n : ℕ}
[ExpChar R p]
{f : R[X]}
[PerfectRing R p]
[DecidableEq R]

Finset.image (⇑(iterateFrobenius R p n)) ((Polynomial.expand R (p ^ n)) f).roots.toFinset = f.roots.toFinset


lemma LeftUnique.flip (h : LeftUnique r) : RightUnique (flip r)

{α : Type u_1}
{β : Type u_2}
{r : α → β → Prop}
(h : Relator.LeftUnique r)


@[to_additive]
theorem nndist_mulIndicator (s t : Set α) (f : α → E) (x : α) :
    nndist (s.mulIndicator f x) (t.mulIndicator f x) = ‖(s ∆ t).mulIndicator f x‖₊

{α : Type u_3}
{E : Type u_6}
[SeminormedGroup E]
(s t : Set α)
(f : α → E)
(x : α)

nndist (s.mulIndicator f x) (t.mulIndicator f x) = ‖(symmDiff s t).mulIndicator f x‖₊


@[to_additive]
lemma IsCentralScalar.unop_smul_eq_smul {M α : Type*} [SMul M α] [SMul Mᵐᵒᵖ α]
    [IsCentralScalar M α] (m : Mᵐᵒᵖ) (a : α) : MulOpposite.unop m • a = m • a

{M : Type u_11}
{α : Type u_12}
[VAdd M α]
[VAdd Mᵃᵒᵖ α]
[IsCentralVAdd M α]
(m : Mᵃᵒᵖ)
(a : α)


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

(hf : ContDiff 𝕜 m (Function.uncurry f))


@[to_additive]
theorem mul_union : s * (t₁ ∪ t₂) = s * t₁ ∪ s * t₂

{α : Type u_2}
[Add α]
{s t₁ t₂ : Set α}


/-- `Functor C D` represents a functor between categories `C` and `D`.

To apply a functor `F` to an object use `F.obj X`, and to a morphism use `F.map f`.

The axiom `map_id` expresses preservation of identities, and
`map_comp` expresses functoriality.

See <https://stacks.math.columbia.edu/tag/001B>.
-/
structure Functor (C : Type u₁) [Category.{v₁} C] (D : Type u₂) [Category.{v₂} D]
    extends Prefunctor C D : Type max v₁ v₂ u₁ u₂ where
  /-- A functor preserves identity morphisms. -/
  map_id : ∀ X : C, map (𝟙 X) = 𝟙 (obj X) := by aesop_cat
  /-- A functor preserves composition. -/
  map_comp : ∀ {X Y Z : C} (f : X ⟶ Y) (g : Y ⟶ Z), map (f ≫ g) = map f ≫ map g := by aesop_cat

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

self.map (CategoryTheory.CategoryStruct.id X) = CategoryTheory.CategoryStruct.id (self.obj X)


theorem succ_ok {q s n} {c d : List Γ'} :
    Reaches₁ (TM2.step tr) ⟨some (Λ'.succ q), s, K'.elim (trList [n]) [] c d⟩
      ⟨some q, none, K'.elim (trList [n.succ]) [] c d⟩

{q : Turing.PartrecToTM2.Λ'}
{s : Option Turing.PartrecToTM2.Γ'}
{n : ℕ}
{c d : List Turing.PartrecToTM2.Γ'}

Turing.Reaches₁ (Turing.TM2.step Turing.PartrecToTM2.tr)
  { l := some q.succ, var := s, stk := Turing.PartrecToTM2.K'.elim (Turing.PartrecToTM2.trList [n]) [] c d }
  { l := some q, var := none, stk := Turing.PartrecToTM2.K'.elim (Turing.PartrecToTM2.trList [n.succ]) [] c d }


@[to_additive]
theorem card_comap_dvd_of_injective (K : Subgroup H) (f : α →* H)
    (hf : Function.Injective f) : Nat.card (K.comap f) ∣ Nat.card K

{α : Type u_1}
[AddGroup α]
{H : Type u_2}
[AddGroup H]
(K : AddSubgroup H)
(f : α →+ H)
(hf : Function.Injective ⇑f)

Nat.card ↥(AddSubgroup.comap f K) ∣ Nat.card ↥K


theorem support_add [DecidableEq σ] : (p + q).support ⊆ p.support ∪ q.support

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
{p q : MvPolynomial σ R}
[DecidableEq σ]


lemma preimage_val_sInter : A ↓∩ (⋂₀ S) = ⋂₀ { (A ↓∩ B) | B ∈ S }

{α : Type u_2}
{A : Set α}
{S : Set (Set α)}

Subtype.val ⁻¹' ⋂₀ S = ⋂₀ {x | ∃ B ∈ S, Subtype.val ⁻¹' B = x}


nonrec theorem Primrec₂.to_comp {α β σ} [Primcodable α] [Primcodable β] [Primcodable σ]
    {f : α → β → σ} (hf : Primrec₂ f) : Computable₂ f

{α : Type u_1}
{β : Type u_2}
{σ : Type u_3}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
{f : α → β → σ}
(hf : Primrec₂ f)


@[to_additive (attr := simp)]
theorem update_one [∀ i, One (f i)] [DecidableEq I] (i : I) : update (1 : ∀ i, f i) i 1 = 1

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


/-- Auxiliary definition for `functorCategoryEquivalence`. -/
@[simps]
def functor : Action V G ⥤ SingleObj G ⥤ V

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

∀ (x : CategoryTheory.SingleObj ↑G), (Action.FunctorCategoryEquivalence.functor.obj M).obj x = M.V


theorem integral_Icc_eq_integral_Ioc : ∫ t in Icc x y, f t ∂μ = ∫ t in Ioc x y, f t ∂μ

{X : Type u_1}
{E : Type u_3}
[MeasurableSpace X]
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : X → E}
{μ : MeasureTheory.Measure X}
[PartialOrder X]
{x y : X}
[MeasureTheory.NoAtoms μ]

∫ (t : X) in Set.Icc x y, f t ∂μ = ∫ (t : X) in Set.Ioc x y, f t ∂μ


theorem ContinuousWithinAt.continuousAt {f : α → β} {s : Set α} {x : α}
    (h : ContinuousWithinAt f s x) (hs : s ∈ 𝓝 x) : ContinuousAt f x

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


lemma ContinuousWithinAt.finset_sup' (hne : s.Nonempty)
    (hs : ∀ i ∈ s, ContinuousWithinAt (f i) t x) : ContinuousWithinAt (s.sup' hne f) t x


theorem IsMaximal.isPrime {I : Ideal α} (H : I.IsMaximal) : I.IsPrime

{α : Type u}
[CommSemiring α]
{I : Ideal α}
(H : I.IsMaximal)


theorem integral_eq_zero_iff_of_le_of_nonneg_ae (hab : a ≤ b) (hf : 0 ≤ᵐ[μ.restrict (Ioc a b)] f)
    (hfi : IntervalIntegrable f μ a b) :
    ∫ x in a..b, f x ∂μ = 0 ↔ f =ᵐ[μ.restrict (Ioc a b)] 0

{f : ℝ → ℝ}
{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}
(hab : a ≤ b)
(hf : 0 ≤ᵐ[μ.restrict (Set.Ioc a b)] f)
(hfi : IntervalIntegrable f μ a b)

∫ (x : ℝ) in a..b, f x ∂μ = 0 ↔ f =ᵐ[μ.restrict (Set.Ioc a b)] 0


theorem ContDiffOn.ccos {n} (hf : ContDiffOn ℂ n f s) :
    ContDiffOn ℂ n (fun x => Complex.cos (f x)) s

{E : Type u_1}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{s : Set E}
{n : ℕ∞}
(hf : ContDiffOn ℂ n f s)


/-- Composition on the right as a `MonoidHom`. Similar to `MonoidHom.compHom'`. -/
@[to_additive (attr := simps)
      "Composition on the right as an `AddMonoidHom`. Similar to `AddMonoidHom.compHom'`."]
def compMonoidHom' {γ : Type*} [TopologicalSpace γ] [MulOneClass γ] [ContinuousMul γ]
    (g : C(α, β)) : C(β, γ) →* C(α, γ)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{γ : Type u_3}
[TopologicalSpace γ]
[MulOneClass γ]
[ContinuousMul γ]
(g : C(α, β))
(f : C(β, γ))


/-- If `I : Ideal S` has a basis over `R`,
`x ∈ I` iff it is a linear combination of basis vectors. -/
theorem Basis.mem_ideal_iff {ι R S : Type*} [CommRing R] [CommRing S] [Algebra R S] {I : Ideal S}
    (b : Basis ι R I) {x : S} : x ∈ I ↔ ∃ c : ι →₀ R, x = Finsupp.sum c fun i x => x • (b i : S)

{ι : Type u_1}
{R : Type u_2}
{S : Type u_3}
[CommRing R]
[CommRing S]
[Algebra R S]
{I : Ideal S}
(b : Basis ι R ↥I)
{x : S}

x ∈ I ↔ ∃ c, x = c.sum fun i x => x • ↑(b i)


theorem coePNat_ofPrime (p : Nat.Primes) : (ofPrime p : Multiset ℕ+) = {(p : ℕ+)}

(PrimeMultiset.ofPrime p).toPNatMultiset = {↑p}


@[simp]
theorem shiftFunctor_obj_apply {β : Type*} [AddCommGroup β] (s : β) (X : β → C) (t : β) (n : ℤ) :
    (shiftFunctor (GradedObjectWithShift s C) n).obj X t = X (t + n • s)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{β : Type u_1}
[AddCommGroup β]
(s : β)
(X : β → C)
(t : β)
(n : ℤ)

(CategoryTheory.shiftFunctor (CategoryTheory.GradedObjectWithShift s C) n).obj X t = X (t + n • s)


@[simp]
theorem prod_eq_zero {ι} (f : ι → Cardinal.{u}) : prod f = 0 ↔ ∃ i, f i = 0


theorem le_bihimp_iff {a b c : α} : a ≤ b ⇔ c ↔ a ⊓ b ≤ c ∧ a ⊓ c ≤ b

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


@[to_additive] lemma inv_mabs_le_inv (a : α) : |a|ₘ⁻¹ ≤ a⁻¹

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


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

{α : Type u}
[SubtractionMonoid α]
{a : α}
(h : IsAddUnit a)


/-- We compute the absolute discriminant of a `p ^ k`-th cyclotomic field.
  Beware that in the cases `p ^ k = 1` and `p ^ k = 2` the formula uses `1 / 2 = 0` and `0 - 1 = 0`.
  See also the results below. -/
theorem absdiscr_prime_pow [IsCyclotomicExtension {p ^ k} ℚ K] :
    haveI : NumberField K := IsCyclotomicExtension.numberField {p ^ k} ℚ K
    NumberField.discr K =
    (-1) ^ ((p ^ k : ℕ).totient / 2) * p ^ ((p : ℕ) ^ (k - 1) * ((p - 1) * k - 1))

(p : ℕ+)
(k : ℕ)
(K : Type u)
[Field K]
[CharZero K]
[hp : Fact (Nat.Prime ↑p)]
[IsCyclotomicExtension {p ^ k} ℚ K]


theorem prod_comm : f ×ˢ g = map (fun p : β × α => (p.2, p.1)) (g ×ˢ f)

{α : Type u_1}
{β : Type u_2}
{f : Filter α}
{g : Filter β}

f ×ˢ g = Filter.map (fun p => (p.2, p.1)) (g ×ˢ f)


@[simp]
theorem empty_isTransitive : IsTransitive ∅


@[to_additive]
lemma mulSupport_iSup [ConditionallyCompleteLattice M] [Nonempty ι] (f : ι → α → M) :
    mulSupport (fun x ↦ ⨆ i, f i x) ⊆ ⋃ i, mulSupport (f i)

{ι : Sort u_1}
{α : Type u_2}
{M : Type u_4}
[Zero M]
[ConditionallyCompleteLattice M]
[Nonempty ι]
(f : ι → α → M)

(Function.support fun x => ⨆ i, f i x) ⊆ ⋃ i, Function.support (f i)


/-- If `p` and `q` are odd primes and `p % 4 = 1`, then `q` is a square mod `p` iff
`p` is a square mod `q`. -/
theorem exists_sq_eq_prime_iff_of_mod_four_eq_one (hp1 : p % 4 = 1) (hq1 : q ≠ 2) :
    IsSquare (q : ZMod p) ↔ IsSquare (p : ZMod q)

{p q : ℕ}
[Fact (Nat.Prime p)]
[Fact (Nat.Prime q)]
(hp1 : p % 4 = 1)
(hq1 : q ≠ 2)


lemma slope_lt_of_hasDerivWithinAt_Ioi (hfc : StrictConcaveOn ℝ S f)
    (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y) (hf' : HasDerivWithinAt f f' (Ioi x) x) :
    slope f x y < f'

(hf' : HasDerivWithinAt f f' (Set.Ioi x) x)


/-- The converse direction of the optional stopping theorem, i.e. an adapted integrable process `f`
is a submartingale if for all bounded stopping times `τ` and `π` such that `τ ≤ π`, the
stopped value of `f` at `τ` has expectation smaller than its stopped value at `π`. -/
theorem submartingale_of_expected_stoppedValue_mono [IsFiniteMeasure μ] (hadp : Adapted 𝒢 f)
    (hint : ∀ i, Integrable (f i) μ) (hf : ∀ τ π : Ω → ℕ, IsStoppingTime 𝒢 τ → IsStoppingTime 𝒢 π →
      τ ≤ π → (∃ N, ∀ ω, π ω ≤ N) → μ[stoppedValue f τ] ≤ μ[stoppedValue f π]) :
    Submartingale f 𝒢 μ

{f : ℕ → Ω → ℝ}

(hint : ∀ (i : ℕ), MeasureTheory.Integrable (f i) μ)

(hf :
  ∀ (τ π : Ω → ℕ),
    MeasureTheory.IsStoppingTime 𝒢 τ →
      MeasureTheory.IsStoppingTime 𝒢 π →
        τ ≤ π →
          (∃ N, ∀ (ω : Ω), π ω ≤ N) →
            ∫ (x : Ω), MeasureTheory.stoppedValue f τ x ∂μ ≤ ∫ (x : Ω), MeasureTheory.stoppedValue f π x ∂μ)


protected theorem map_smul (f : A →A[R] B) (c : R) (x : A) :
    f (c • x) = c • f x

{R : Type u_1}
[CommSemiring R]
{A : Type u_2}
[Semiring A]
[TopologicalSpace A]
{B : Type u_3}
[Semiring B]
[TopologicalSpace B]
[Algebra R A]
[Algebra R B]
(f : A →A[R] B)
(c : R)
(x : A)


theorem preimage_eq (f : α →. β) (s : Set β) : f.preimage s = f.core s ∩ f.Dom

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


@[to_additive]
theorem tendsto_div_nhds_one_iff {α : Type*} {l : Filter α} {x : G} {u : α → G} :
    Tendsto (u · / x) l (𝓝 1) ↔ Tendsto u l (𝓝 x)

{G : Type w}
[Group G]
[TopologicalSpace G]
[TopologicalGroup G]
{α : Type u_1}
{l : Filter α}
{x : G}
{u : α → G}

Filter.Tendsto (fun x_1 => u x_1 / x) l (𝓝 1) ↔ Filter.Tendsto u l (𝓝 x)


@[to_additive (attr := simp)]
theorem subgroupOf_self : H.subgroupOf H = ⊤

{G : Type u_1}
[Group G]
(H : Subgroup G)


/-- `piFinTwoEquiv` as an `IsometryEquiv`. -/
@[simps!]
def piFinTwo (α : Fin 2 → Type*) [∀ i, PseudoEMetricSpace (α i)] : (∀ i, α i) ≃ᵢ α 0 × α 1

[(i : Fin 2) → PseudoEMetricSpace (α i)]

(IsometryEquiv.piFinTwo α).invFun p i = Fin.cons p.1 (Fin.cons p.2 finZeroElim) i


@[simp]
theorem ofMulHom_coe : (ofMulHom : α → FreeAbelianGroup α) = of


/-- A product of types can be split as the binary product of one of the types and the product
  of all the remaining types. -/
@[simps]
def piSplitAt {α : Type*} [DecidableEq α] (i : α) (β : α → Type*) :
    (∀ j, β j) ≃ β i × ∀ j : { j // j ≠ i }, β j

(f : β i × ((j : { j // j ≠ i }) → β ↑j))

(Equiv.piSplitAt i β).symm f j = if h : j = i then ⋯ ▸ f.1 else f.2 ⟨j, h⟩


@[to_additive]
protected theorem injective_left [Mul α] [i : IsSymmOp α α (· * ·)] [PartialOrder α] {a : α}
    (ha : MulLECancellable a) :
    Injective (· * a)

{α : Type u_1}
[Mul α]
[i : IsSymmOp α α fun x x_1 => x * x_1]
[PartialOrder α]
{a : α}
(ha : MulLECancellable a)


theorem toGraph_compl_eq [MulZeroOneClass α] [Nontrivial α] (h : IsAdjMatrix A) :
    h.compl.toGraph = h.toGraphᶜ

{V : Type u_1}
{α : Type u_2}
[DecidableEq α]
[DecidableEq V]
{A : Matrix V V α}
[MulZeroOneClass α]
[Nontrivial α]
(h : A.IsAdjMatrix)


/--
The forgetful functor from presheaves of modules over a presheaf of rings `R` to presheaves of
`R(X)`-modules where `X` is an initial object.

The functor is implemented as, on object level `M ↦ (c ↦ M(c))` where the `R(X)`-module structure
on `M(c)` is given by restriction of scalars along the unique morphism `R(c) ⟶ R(X)`; and on
morphism level `(f : M ⟶ N) ↦ (c ↦ f(c))`.
-/
@[simps]
noncomputable def forgetToPresheafModuleCat (X : Cᵒᵖ) (hX : Limits.IsInitial X) :
    PresheafOfModules.{v} R ⥤ Cᵒᵖ ⥤ ModuleCat (R.1.obj X)

(hX : CategoryTheory.Limits.IsInitial X)

(PresheafOfModules.forgetToPresheafModuleCat X hX).obj M = PresheafOfModules.forgetToPresheafModuleCatObj X hX M


theorem mul_mem_cancel_right {c d e : C} {f : c ⟶ d} {g : d ⟶ e} (hg : g ∈ S.arrows d e) :
    f ≫ g ∈ S.arrows c e ↔ f ∈ S.arrows c d

{C : Type u}
[CategoryTheory.Groupoid C]
(S : CategoryTheory.Subgroupoid C)
{c d e : C}
{f : c ⟶ d}
{g : d ⟶ e}
(hg : g ∈ S.arrows d e)

CategoryTheory.CategoryStruct.comp f g ∈ S.arrows c e ↔ f ∈ S.arrows c d


@[to_additive]
theorem lipschitzWith_lipschitz_const_mul_edist [_i : LipschitzMul β] :
    LipschitzWith (LipschitzMul.C β) fun p : β × β => p.1 * p.2

{β : Type u_2}
[PseudoMetricSpace β]
[AddMonoid β]
[_i : LipschitzAdd β]

LipschitzWith (LipschitzAdd.C β) fun p => p.1 + p.2


@[simp]
theorem composePath_comp' {X Y Z : Paths C} (f : X ⟶ Y) (g : Y ⟶ Z) :
    composePath (f ≫ g) = composePath f ≫ composePath g

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

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


theorem ne_zero_of_mem_rootSet {p : T[X]} [CommRing S] [IsDomain S] [Algebra T S] {a : S}
    (h : a ∈ p.rootSet S) : p ≠ 0

{S : Type v}
{T : Type w}
[CommRing T]
{p : Polynomial T}
[CommRing S]
[IsDomain S]
[Algebra T S]
{a : S}
(h : a ∈ p.rootSet S)


@[simp, norm_cast]
theorem coe_eq_singleton {s : Finset α} {a : α} : (s : Set α) = {a} ↔ s = {a}


theorem Inducing.of_comp_iff (hg : Inducing g) :
    Inducing (g ∘ f) ↔ Inducing f

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
{f : X → Y}
{g : Y → Z}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(hg : Inducing g)


theorem lowerSemicontinuousWithinAt_const : LowerSemicontinuousWithinAt (fun _x => z) s x

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[Preorder β]
{x : α}
{s : Set α}
{z : β}


@[simp]
theorem invOfUnit_eq' (φ : k⟦X⟧) (u : Units k) (h : constantCoeff k φ = u) :
    invOfUnit φ u = φ⁻¹

(h : (PowerSeries.constantCoeff k) φ = ↑u)


theorem compAlongComposition_nnnorm {n : ℕ} (q : FormalMultilinearSeries 𝕜 F G)
    (p : FormalMultilinearSeries 𝕜 E F) (c : Composition n) :
    ‖q.compAlongComposition p c‖₊ ≤ ‖q c.length‖₊ * ∏ i, ‖p (c.blocksFun i)‖₊

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
{G : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{n : ℕ}
(q : FormalMultilinearSeries 𝕜 F G)
(p : FormalMultilinearSeries 𝕜 E F)
(c : Composition n)

‖q.compAlongComposition p c‖₊ ≤ ‖q c.length‖₊ * ∏ i : Fin c.length, ‖p (c.blocksFun i)‖₊


@[simp]
theorem Matrix.toLinAlgEquiv'_symm :
    (Matrix.toLinAlgEquiv'.symm : ((n → R) →ₗ[R] n → R) ≃ₐ[R] _) = LinearMap.toMatrixAlgEquiv'

{R : Type u_1}
[CommSemiring R]
{n : Type u_5}
[DecidableEq n]
[Fintype n]


lemma mkPrecomp_id (f : S.obj Y ⟶ T) : mkPrecomp f (𝟙 Y) = eqToHom (by aesop_cat)

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

CategoryTheory.CostructuredArrow.mkPrecomp f (CategoryTheory.CategoryStruct.id Y) = CategoryTheory.eqToHom ⋯


theorem submatrix_smul {R : Type*} [SMul R α] (r : R) (A : Matrix m n α) :
    ((r • A : Matrix m n α).submatrix : (l → m) → (o → n) → Matrix l o α) = r • A.submatrix

{l : Type u_1}
{m : Type u_2}
{n : Type u_3}
{o : Type u_4}
{α : Type v}
{R : Type u_10}
[SMul R α]
(r : R)
(A : Matrix m n α)


/-- A monoid is not a torsion monoid if it has an element of infinite order. -/
@[to_additive (attr := simp) "An additive monoid is not a torsion monoid if it
  has an element of infinite order."]
theorem not_isTorsion_iff : ¬IsTorsion G ↔ ∃ g : G, ¬IsOfFinOrder g

¬AddMonoid.IsTorsion G ↔ ∃ g, ¬IsOfFinAddOrder g


/-- If `K` and `L` are disjoint compact sets in an R₁ topological space
and `L` is also closed, then `K` and `L` have disjoint neighborhoods.  -/
theorem SeparatedNhds.of_isCompact_isCompact_isClosed {K L : Set X} (hK : IsCompact K)
    (hL : IsCompact L) (h'L : IsClosed L) (hd : Disjoint K L) : SeparatedNhds K L

{X : Type u_1}
[TopologicalSpace X]
[R1Space X]
{K L : Set X}
(hK : IsCompact K)
(hL : IsCompact L)
(h'L : IsClosed L)
(hd : Disjoint K L)


theorem indexOf_inj [DecidableEq α] {l : List α} {x y : α} (hx : x ∈ l) (hy : y ∈ l) :
    indexOf x l = indexOf y l ↔ x = y

{α : Type u}
[DecidableEq α]
{l : List α}
{x y : α}
(hx : x ∈ l)
(hy : y ∈ l)

List.indexOf x l = List.indexOf y l ↔ x = y


/-- If a function is `antiperiodic` with antiperiod `c`, then it is also `Periodic` with period
`2 • c`. -/
protected theorem Antiperiodic.periodic [AddMonoid α] [InvolutiveNeg β]
    (h : Antiperiodic f c) : Periodic f (2 • c)

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c : α}
[AddMonoid α]
[InvolutiveNeg β]
(h : Function.Antiperiodic f c)


/-- A dependent version of `Subgroup.iSup_induction`. -/
@[to_additive (attr := elab_as_elim) "A dependent version of `AddSubgroup.iSup_induction`. "]
theorem iSup_induction' {ι : Sort*} (S : ι → Subgroup G) {C : ∀ x, (x ∈ ⨆ i, S i) → Prop}
    (hp : ∀ (i), ∀ x (hx : x ∈ S i), C x (mem_iSup_of_mem i hx)) (h1 : C 1 (one_mem _))
    (hmul : ∀ x y hx hy, C x hx → C y hy → C (x * y) (mul_mem ‹_› ‹_›)) {x : G}
    (hx : x ∈ ⨆ i, S i) : C x hx

(hp : ∀ (i : ι) (x : G) (hx : x ∈ S i), C x ⋯)

(hmul : ∀ (x y : G) (hx : x ∈ ⨆ i, S i) (hy : y ∈ ⨆ i, S i), C x hx → C y hy → C (x + y) ⋯)


@[simp]
theorem foldl_zero (f : β → α → β) (H b) : foldl f H b 0 = b

{α : Type u_1}
{β : Type v}
(f : β → α → β)
(H : RightCommutative f)
(b : β)


/-- A subset of a cospherical set is cospherical. -/
theorem Cospherical.subset {ps₁ ps₂ : Set P} (hs : ps₁ ⊆ ps₂) (hc : Cospherical ps₂) :
    Cospherical ps₁

(hc : EuclideanGeometry.Cospherical ps₂)


/-- If `t` is bounded, then so is `s ∩ t` -/
theorem BddAbove.inter_of_right (h : BddAbove t) : BddAbove (s ∩ t)

{α : Type u}
[Preorder α]
{s t : Set α}
(h : BddAbove t)


protected theorem nil {n} : @Vec n 0 fun _ => nil

Nat.Primrec'.Vec fun x => Mathlib.Vector.nil


/-- Convergence in Lp implies convergence in measure. -/
theorem tendstoInMeasure_of_tendsto_eLpNorm {l : Filter ι} (hp_ne_zero : p ≠ 0)
    (hf : ∀ n, AEStronglyMeasurable (f n) μ) (hg : AEStronglyMeasurable g μ)
    (hfg : Tendsto (fun n => eLpNorm (f n - g) p μ) l (𝓝 0)) : TendstoInMeasure μ f l g

(hf : ∀ (n : ι), MeasureTheory.AEStronglyMeasurable (f n) μ)

(hg : MeasureTheory.AEStronglyMeasurable g μ)

(hfg : Filter.Tendsto (fun n => MeasureTheory.eLpNorm (f n - g) p μ) l (𝓝 0))


@[reassoc]
lemma mapHomologyIso_hom_naturality [S₁.HasHomology] [S₂.HasHomology]
    [(S₁.map F).HasHomology] [(S₂.map F).HasHomology]
    [F.PreservesLeftHomologyOf S₁] [F.PreservesLeftHomologyOf S₂] :
    @homologyMap _ _ _ (S₁.map F) (S₂.map F) (F.mapShortComplex.map φ) _ _ ≫
      (S₂.mapHomologyIso F).hom = (S₁.mapHomologyIso F).hom ≫ F.map (homologyMap φ)

CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.homologyMap (F.mapShortComplex.map φ))
    (S₂.mapHomologyIso F).hom =
  CategoryTheory.CategoryStruct.comp (S₁.mapHomologyIso F).hom (F.map (CategoryTheory.ShortComplex.homologyMap φ))


/-- Cancellation of a telescoping product. -/
@[to_additive "Cancellation of a telescoping sum."]
theorem prod_range_div (n : ℕ) (f : ℕ → G) :
    ((range n).map fun k ↦ f (k + 1) / f k).prod = f n / f 0

{G : Type u_7}
[CommGroup G]
(n : ℕ)
(f : ℕ → G)

(List.map (fun k => f (k + 1) / f k) (List.range n)).prod = f n / f 0


@[simp]
theorem basicOpen_eq_zeroLocus_compl (r : A) :
    (basicOpen 𝒜 r : Set (ProjectiveSpectrum 𝒜)) = (zeroLocus 𝒜 {r})ᶜ

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[CommRing A]
[Algebra R A]
(𝒜 : ℕ → Submodule R A)
[GradedAlgebra 𝒜]
(r : A)

↑(ProjectiveSpectrum.basicOpen 𝒜 r) = (ProjectiveSpectrum.zeroLocus 𝒜 {r})ᶜ


@[simp 1100, nolint simpNF]
theorem mem_map_of_injective {f : α → β} (H : Function.Injective f) {a : α} {o : Option α} :
    f a ∈ o.map f ↔ a ∈ o

{α : Type u_1}
{β : Type u_2}
{f : α → β}
(H : Function.Injective f)
{a : α}
{o : Option α}


@[to_additive]
theorem extend_mul [Mul γ] (f : α → β) (g₁ g₂ : α → γ) (e₁ e₂ : β → γ) :
    Function.extend f (g₁ * g₂) (e₁ * e₂) = Function.extend f g₁ e₁ * Function.extend f g₂ e₂

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Mul γ]
(f : α → β)
(g₁ g₂ : α → γ)
(e₁ e₂ : β → γ)


@[simp]
theorem yonedaEquiv_symm_app_apply {X : C} {F : Cᵒᵖ ⥤ Type v₁} (x : F.obj (op X)) (Y : Cᵒᵖ)
    (f : Y.unop ⟶ X) : (yonedaEquiv.symm x).app Y f = F.map f.op x

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

(CategoryTheory.yonedaEquiv.symm x).app Y f = F.map f.op x


lemma dualSeminorms_bounded : BddAbove {p | ∃ (G : Type (max uι u𝕜 uE))
    (_ : SeminormedAddCommGroup G) (_ : NormedSpace 𝕜 G),
    p = Seminorm.comp (normSeminorm 𝕜 (ContinuousMultilinearMap 𝕜 E G →L[𝕜] G))
    (toDualContinuousMultilinearMap G (𝕜 := 𝕜) (E := E))}

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

BddAbove
  {p |
    ∃ G x x_1,
      p =
        (normSeminorm 𝕜 (ContinuousMultilinearMap 𝕜 E G →L[𝕜] G)).comp
          (PiTensorProduct.toDualContinuousMultilinearMap G)}


theorem unbounded_gt_univ [Preorder α] [NoBotOrder α] : Unbounded (· > ·) (@Set.univ α)

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

Set.Unbounded (fun x x_1 => x > x_1) Set.univ


@[simp] lemma toColex_sdiff_lt_toColex_sdiff' :
 toColex (s \ t) < toColex (t \ s) ↔ toColex s < toColex t

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

{ ofColex := s \ t } < { ofColex := t \ s } ↔ { ofColex := s } < { ofColex := t }


@[fun_prop]
theorem HasFDerivWithinAt.mul_const (hc : HasFDerivWithinAt c c' s x) (d : 𝔸') :
    HasFDerivWithinAt (fun y => c y * d) (d • c') s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{x : E}
{s : Set E}
{𝔸' : Type u_7}
[NormedCommRing 𝔸']
[NormedAlgebra 𝕜 𝔸']
{c : E → 𝔸'}
{c' : E →L[𝕜] 𝔸'}
(hc : HasFDerivWithinAt c c' s x)
(d : 𝔸')


theorem height_le_numNodes : ∀ x : Tree α, x.height ≤ x.numNodes


@[simp] lemma ofNat'_zero {h : 0 < n} [NeZero n] : (Fin.ofNat' 0 h : Fin n) = 0


/-- Constructs an isomorphism of lattices from an order isomorphism between them. -/
@[simps]
def Iso.mk {α β : Lat.{u}} (e : α ≃o β) : α ≅ β

(Lat.Iso.mk e).inv.toSupHom a = e.symm a


theorem coe_def : (fun a ↦ ↑a : α → Option α) = some


lemma DirectedOn.is_top_of_is_max {s : Set α} (hd : DirectedOn (· ≤ ·) s)
    {m} (hm : m ∈ s) (hmax : ∀ a ∈ s, m ≤ a → a ≤ m) : ∀ a ∈ s, a ≤ m

(hd : DirectedOn (fun x x_1 => x ≤ x_1) s)


theorem pi_generateFrom_eq_finite {π : ι → Type*} {g : ∀ a, Set (Set (π a))} [Finite ι]
    (hg : ∀ a, ⋃₀ g a = univ) :
    (@Pi.topologicalSpace ι π fun a => generateFrom (g a)) =
      generateFrom { t | ∃ s : ∀ a, Set (π a), (∀ a, s a ∈ g a) ∧ t = pi univ s }

{ι : Type u_5}
{π : ι → Type u_8}
{g : (a : ι) → Set (Set (π a))}
[Finite ι]
(hg : ∀ (a : ι), ⋃₀ g a = Set.univ)

Pi.topologicalSpace = TopologicalSpace.generateFrom {t | ∃ s, (∀ (a : ι), s a ∈ g a) ∧ t = Set.univ.pi s}


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

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

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


@[simp]
theorem lintegral_restrict (κ : Kernel α β) (hs : MeasurableSet s) (a : α) (f : β → ℝ≥0∞) :
    ∫⁻ b, f b ∂κ.restrict hs a = ∫⁻ b in s, f b ∂κ a

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{s : Set β}
(κ : ProbabilityTheory.Kernel α β)
(hs : MeasurableSet s)
(a : α)
(f : β → ℝ≥0∞)

∫⁻ (b : β), f b ∂(κ.restrict hs) a = ∫⁻ (b : β) in s, f b ∂κ a


@[simp]
theorem lcm_insert [DecidableEq β] {b : β} :
    (insert b s : Finset β).lcm f = GCDMonoid.lcm (f b) (s.lcm f)

{α : Type u_2}
{β : Type u_3}
[CancelCommMonoidWithZero α]
[NormalizedGCDMonoid α]
{s : Finset β}
{f : β → α}
[DecidableEq β]
{b : β}

(insert b s).lcm f = lcm (f b) (s.lcm f)


theorem comap_monotone (f : V ↪ W) : Monotone (SimpleGraph.comap f)

{V : Type u_1}
{W : Type u_2}
(f : V ↪ W)


lemma ofComplex_exactAt_succ (n : ℕ) :
    (ofComplex Z).ExactAt (n + 1)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
[CategoryTheory.EnoughProjectives C]
(Z : C)
(n : ℕ)

HomologicalComplex.ExactAt (CategoryTheory.ProjectiveResolution.ofComplex Z) (n + 1)


theorem eLpNorm'_le_eLpNorm'_of_exponent_le {p q : ℝ} (hp0_lt : 0 < p)
    (hpq : p ≤ q) (μ : Measure α) [IsProbabilityMeasure μ] (hf : AEStronglyMeasurable f μ) :
    eLpNorm' f p μ ≤ eLpNorm' f q μ

(hf : MeasureTheory.AEStronglyMeasurable f μ)

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


theorem InjOn.ne_iff {x y} (h : InjOn f s) (hx : x ∈ s) (hy : y ∈ s) : f x ≠ f y ↔ x ≠ y

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{f : α → β}
{x y : α}
(h : Set.InjOn f s)
(hx : x ∈ s)
(hy : y ∈ s)


@[simp]
theorem not_ofNat_le_one : ¬(no_index (OfNat.ofNat n : α)) ≤ 1

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


/-- A subgroup `H` of `G` determines a subgroup `H.op` of the opposite group `Gᵐᵒᵖ`. -/
@[to_additive (attr := simps) "An additive subgroup `H` of `G` determines an additive subgroup
`H.op` of the opposite additive group `Gᵃᵒᵖ`."]
def opEquiv : Subgroup G ≃o Subgroup Gᵐᵒᵖ

{G : Type u_2}
[Group G]
(H : Subgroup Gᵐᵒᵖ)

(RelIso.symm Subgroup.opEquiv) H = H.unop


/-- The trivial case if `X` is connected. -/
private lemma has_decomp_connected_components_aux_conn (X : C) [IsConnected X] :
    ∃ (ι : Type) (f : ι → C) (g : (i : ι) → (f i) ⟶ X) (_ : IsColimit (Cofan.mk X g)),
    (∀ i, IsConnected (f i)) ∧ Finite ι

∃ ι f g x, (∀ (i : ι), CategoryTheory.PreGaloisCategory.IsConnected (f i)) ∧ Finite ι


@[reassoc (attr := simp, elementwise)]
lemma moduleCatCyclesIso_hom_subtype :
    S.moduleCatCyclesIso.hom ≫ (LinearMap.ker S.g).subtype = S.iCycles

(S : CategoryTheory.ShortComplex (ModuleCat R))

CategoryTheory.CategoryStruct.comp S.moduleCatCyclesIso.hom (LinearMap.ker S.g).subtype = S.iCycles


theorem mk_preimage_sigma_eq_if [DecidablePred (· ∈ s)] :
    Sigma.mk i ⁻¹' s.sigma t = if i ∈ s then t i else ∅

{ι : Type u_1}
{α : ι → Type u_3}
{s : Set ι}
{t : (i : ι) → Set (α i)}
{i : ι}
[DecidablePred fun x => x ∈ s]


/-- A matrix whose nondiagonal entries are negative with the sum of the entries of each
row positive has nonzero determinant. -/
lemma det_ne_zero_of_sum_row_pos [DecidableEq n] {S : Type*} [LinearOrderedCommRing S]
    {A : Matrix n n S} (h1 : Pairwise fun i j => A i j < 0) (h2 : ∀ i, 0 < ∑ j, A i j) :
    A.det ≠ 0

{n : Type u_1}
[Fintype n]
[DecidableEq n]
{S : Type u_2}
[LinearOrderedCommRing S]
{A : Matrix n n S}
(h1 : Pairwise fun i j => A i j < 0)
(h2 : ∀ (i : n), 0 < ∑ j : n, A i j)


@[simp]
theorem edist_lt_ofReal {x y : α} {r : ℝ} : edist x y < ENNReal.ofReal r ↔ dist x y < r

{α : Type u}
[PseudoMetricSpace α]
{x y : α}
{r : ℝ}


theorem fractionalIdeal_rank (I : (FractionalIdeal (𝓞 K)⁰ K)ˣ) :
    finrank ℤ I = finrank ℤ (𝓞 K)

(I : (FractionalIdeal (nonZeroDivisors (NumberField.RingOfIntegers K)) K)ˣ)

FiniteDimensional.finrank ℤ ↥↑↑I = FiniteDimensional.finrank ℤ (NumberField.RingOfIntegers K)


theorem logDeriv_apply (f : 𝕜 → 𝕜') (x : 𝕜) : logDeriv f x = deriv f x / f x

{𝕜 : Type u_1}
{𝕜' : Type u_2}
[NontriviallyNormedField 𝕜]
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
(f : 𝕜 → 𝕜')
(x : 𝕜)


/-- A natural transformation `L₁ ⟶ L₂` induces a functor `Comma L₂ R ⥤ Comma L₁ R`. -/
@[simps]
def mapLeft (l : L₁ ⟶ L₂) : Comma L₂ R ⥤ Comma L₁ R

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
(R : CategoryTheory.Functor B T)
{L₁ L₂ : CategoryTheory.Functor A T}
(l : L₁ ⟶ L₂)
(X : CategoryTheory.Comma L₂ R)

((CategoryTheory.Comma.mapLeft R l).obj X).hom = CategoryTheory.CategoryStruct.comp (l.app X.left) X.hom


/-- This is [grinberg_clifford_2016][] Theorem 6  -/
theorem contractLeft_ι_mul (a : M) (b : CliffordAlgebra Q) :
    d⌋(ι Q a * b) = d a • b - ι Q a * (d⌋b)

{R : Type u1}
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]
{Q : QuadraticForm R M}
(d : Module.Dual R M)
(a : M)
(b : CliffordAlgebra Q)

(CliffordAlgebra.contractLeft d) ((CliffordAlgebra.ι Q) a * b) =
  d a • b - (CliffordAlgebra.ι Q) a * (CliffordAlgebra.contractLeft d) b


/-- A specialization of `iInter₂_subset`. -/
theorem biInter_subset_of_mem {s : Set α} {t : α → Set β} {x : α} (xs : x ∈ s) :
    ⋂ x ∈ s, t x ⊆ t x

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{t : α → Set β}
{x : α}
(xs : x ∈ s)


theorem convex_stdSimplex : Convex 𝕜 (stdSimplex 𝕜 ι)

(𝕜 : Type u_1)
(ι : Type u_5)
[OrderedSemiring 𝕜]
[Fintype ι]


@[reassoc (attr := simp)]
lemma comp_descHomotopyZeroOne {Y Z : C} {I : InjectiveResolution Y} {J : InjectiveResolution Z}
    (f : I.cocomplex ⟶ J.cocomplex) (comm : I.ι ≫ f = (0 : _ ⟶ J.cocomplex)) :
    I.cocomplex.d 1 2 ≫ descHomotopyZeroOne f comm =
      f.f 1 - descHomotopyZeroZero f comm ≫ J.cocomplex.d 0 1

{I : CategoryTheory.InjectiveResolution Y}

{J : CategoryTheory.InjectiveResolution Z}

I.cocomplex.d 1 2 ≫ CategoryTheory.InjectiveResolution.descHomotopyZeroOne f comm =
  f.f 1 - CategoryTheory.InjectiveResolution.descHomotopyZeroZero f comm ≫ J.cocomplex.d 0 1


@[simp]
theorem symm_trans_apply (f : X ≃ₜ Y) (g : Y ≃ₜ Z) (z : Z) :
    (f.trans g).symm z = f.symm (g.symm z)

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
(f : X ≃ₜ Y)
(g : Y ≃ₜ Z)
(z : Z)


/-- The type of monoid homomorphisms satisfying the characteristic predicate: if `f : M →* N`
satisfies this predicate, then `N` is isomorphic to the localization of `M` at `S`. -/
-- Porting note(#5171): this linter isn't ported yet.
-- @[nolint has_nonempty_instance]
structure LocalizationMap extends MonoidHom M N where
  map_units' : ∀ y : S, IsUnit (toFun y)
  surj' : ∀ z : N, ∃ x : M × S, z * toFun x.2 = toFun x.1
  exists_of_eq : ∀ x y, toFun x = toFun y → ∃ c : S, ↑c * x = c * y

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
(self : S.LocalizationMap N)
(x y : M)

(↑self.toMonoidHom).toFun x = (↑self.toMonoidHom).toFun y → ∃ c, ↑c * x = ↑c * y


theorem closedBall_finset_sup' (p : ι → Seminorm 𝕜 E) (s : Finset ι) (H : s.Nonempty) (e : E)
    (r : ℝ) : closedBall (s.sup' H p) e r = s.inf' H fun i => closedBall (p i) e r

{𝕜 : Type u_3}
{E : Type u_7}
{ι : Type u_12}
[SeminormedRing 𝕜]
[AddCommGroup E]
[SMul 𝕜 E]
(p : ι → Seminorm 𝕜 E)
(s : Finset ι)
(H : s.Nonempty)
(e : E)
(r : ℝ)

(s.sup' H p).closedBall e r = s.inf' H fun i => (p i).closedBall e r