@[to_additive (attr := simp)]
lemma mulDissociated_singleton : MulDissociated ({a} : Set α) ↔ a ≠ 1


@[simp]
lemma root_coroot_eq_pairing : P.toLin (P.root i) (P.coroot j) = P.pairing i j

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
{N : Type u_4}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(P : RootPairing ι R M N)
(i j : ι)

(P.toLin (P.root i)) (P.coroot j) = P.pairing i j


theorem Filter.HasBasis.uniformity_closure {p : ι → Prop} {U : ι → Set (α × α)}
    (h : (𝓤 α).HasBasis p U) : (𝓤 α).HasBasis p fun i => closure (U i)

{α : Type ua}
{ι : Sort u_1}
[UniformSpace α]
{p : ι → Prop}
{U : ι → Set (α × α)}
(h : (𝓤 α).HasBasis p U)


@[simp]
theorem union_sdiff_self_eq_union : s ∪ t \ s = s ∪ t

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


/-- Functor composition induces a functor on augmented simplicial objects. -/
@[simps]
def whiskering (D : Type u') [Category.{v'} D] : (C ⥤ D) ⥤ Augmented C ⥤ Augmented D

(C : Type u)
[CategoryTheory.Category.{v, u} C]
(D : Type u')
[CategoryTheory.Category.{v', u'} D]
(F : C ⥤ D)

(CategoryTheory.SimplicialObject.Augmented.whiskering C D).obj F =
  CategoryTheory.SimplicialObject.Augmented.whiskeringObj C D F


/-- We can convert an equivalence of `discrete` categories to a type-level `Equiv`. -/
@[simps]
def equivOfEquivalence {α : Type u₁} {β : Type u₂} (h : Discrete α ≌ Discrete β) : α ≃ β

(h : CategoryTheory.Discrete α ≌ CategoryTheory.Discrete β)

∀ (a : β),
  (CategoryTheory.Discrete.equivOfEquivalence h).symm a =
    (CategoryTheory.Discrete.as ∘ h.inverse.obj ∘ CategoryTheory.Discrete.mk) a


theorem rpow_add_le_add_rpow {p : ℝ} (a b : ℝ≥0∞) (hp : 0 ≤ p) (hp1 : p ≤ 1) :
    (a + b) ^ p ≤ a ^ p + b ^ p


theorem sin_le_sin_of_le_of_le_pi_div_two {x y : ℝ} (hx₁ : -(π / 2) ≤ x) (hy₂ : y ≤ π / 2)
    (hxy : x ≤ y) : sin x ≤ sin y

{x y : ℝ}
(hx₁ : -(Real.pi / 2) ≤ x)
(hy₂ : y ≤ Real.pi / 2)
(hxy : x ≤ y)


theorem outerMeasure_of_isOpen (U : Set G) (hU : IsOpen U) :
    μ.outerMeasure U = μ.innerContent ⟨U, hU⟩

{G : Type w}
[TopologicalSpace G]
(μ : MeasureTheory.Content G)
[R1Space G]
(U : Set G)
(hU : IsOpen U)

μ.outerMeasure U = μ.innerContent { carrier := U, is_open' := hU }


theorem isSymm_transpose_mul_self [Fintype n] [CommSemiring α] (A : Matrix n n α) :
    (Aᵀ * A).IsSymm

{α : Type u_1}
{n : Type u_3}
[Fintype n]
[CommSemiring α]
(A : Matrix n n α)


{α : Type u_2}
{f : Equiv.Perm α}
{x : α}


theorem trace_trace_of_basis [Algebra S T] [IsScalarTower R S T] {ι κ : Type*} [Finite ι]
    [Finite κ] (b : Basis ι R S) (c : Basis κ S T) (x : T) :
    trace R S (trace S T x) = trace R T x

{R : Type u_1}
{S : Type u_2}
{T : Type u_3}
[CommRing R]
[CommRing S]
[CommRing T]
[Algebra R S]
[Algebra R T]
[Algebra S T]
[IsScalarTower R S T]
{ι : Type u_4}
{κ : Type u_5}
[Finite ι]
[Finite κ]
(b : Basis ι R S)
(c : Basis κ S T)
(x : T)

(Algebra.trace R S) ((Algebra.trace S T) x) = (Algebra.trace R T) x


theorem torsion_gc :
    @GaloisConnection (Submodule R M) (Ideal R)ᵒᵈ _ _ annihilator fun I =>
      torsionBySet R M ↑(OrderDual.ofDual I)

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

GaloisConnection Submodule.annihilator fun I => Submodule.torsionBySet R M ↑(OrderDual.ofDual I)


theorem SequentialSpace.coinduced [SequentialSpace X] (f : X → Y) :
    @SequentialSpace Y (.coinduced f ‹_›)

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


@[simp, norm_cast] lemma coe_compl (G' : G.Finsubgraph) : ↑(G'ᶜ) = (G'ᶜ : G.Subgraph)

{V : Type u}
{G : SimpleGraph V}
[Finite V]
(G' : G.Finsubgraph)


theorem star_comm_self' [Mul R] [Star R] (x : R) [IsStarNormal x] : star x * x = x * star x

{R : Type u_1}
[Mul R]
[Star R]
(x : R)
[IsStarNormal x]


@[to_additive (attr := simp)]
theorem smul_set_univ : a • (univ : Set β) = univ

{α : Type u_2}
{β : Type u_3}
[AddGroup α]
[AddAction α β]
{a : α}


theorem tendsto_prod_uniformity_snd [UniformSpace α] [UniformSpace β] :
    Tendsto (fun p : (α × β) × α × β => (p.1.2, p.2.2)) (𝓤 (α × β)) (𝓤 β)

{α : Type ua}
{β : Type ub}
[UniformSpace α]
[UniformSpace β]

Filter.Tendsto (fun p => (p.1.2, p.2.2)) (𝓤 (α × β)) (𝓤 β)


theorem totalDegree_mul (a b : MvPolynomial σ R) :
    (a * b).totalDegree ≤ a.totalDegree + b.totalDegree

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
(a b : MvPolynomial σ R)


@[simp]
theorem HasColimit.isoOfEquivalence_inv_π {F : J ⥤ C} [HasColimit F] {G : K ⥤ C} [HasColimit G]
    (e : J ≌ K) (w : e.functor ⋙ G ≅ F) (k : K) :
    colimit.ι G k ≫ (HasColimit.isoOfEquivalence e w).inv =
      G.map (e.counitInv.app k) ≫ w.hom.app (e.inverse.obj k) ≫ colimit.ι F (e.inverse.obj k)

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{K : Type u₂}
[CategoryTheory.Category.{v₂, u₂} K]
{C : Type u}
[CategoryTheory.Category.{v, u} C]
{F : J ⥤ C}
[CategoryTheory.Limits.HasColimit F]
{G : K ⥤ C}
[CategoryTheory.Limits.HasColimit G]
(e : J ≌ K)
(w : e.functor ⋙ G ≅ F)
(k : K)

CategoryTheory.Limits.colimit.ι G k ≫ (CategoryTheory.Limits.HasColimit.isoOfEquivalence e w).inv =
  G.map (e.counitInv.app k) ≫ w.hom.app (e.inverse.obj k) ≫ CategoryTheory.Limits.colimit.ι F (e.inverse.obj k)


theorem multiplicity_X_sub_C_finite (a : R) (h0 : p ≠ 0) : multiplicity.Finite (X - C a) p

{R : Type u}
[Ring R]
{p : R[X]}
(a : R)
(h0 : p ≠ 0)

multiplicity.Finite (Polynomial.X - Polynomial.C a) p


theorem Filter.EventuallyEq.isEquivalent {u v : α → β} (h : u =ᶠ[l] v) : u ~[l] v

{α : Type u_1}
{β : Type u_2}
[NormedAddCommGroup β]
{l : Filter α}
{u v : α → β}
(h : u =ᶠ[l] v)


theorem support_eq_inter_preimage :
    support f = (chartAt H c).source ∩ extChartAt I c ⁻¹' ball (extChartAt I c c) f.rOut

{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[FiniteDimensional ℝ E]
{H : Type uH}
[TopologicalSpace H]
{I : ModelWithCorners ℝ E H}
{M : Type uM}
[TopologicalSpace M]
[ChartedSpace H M]
{c : M}
(f : SmoothBumpFunction I c)

Function.support ↑f = (chartAt H c).source ∩ ↑(extChartAt I c) ⁻¹' Metric.ball (↑(extChartAt I c) c) f.rOut


theorem ExtraDegeneracy.s_comp_π_succ (n : ℕ) (i : Fin (n + 1)) :
    ExtraDegeneracy.s f S n ≫ WidePullback.π _ i.succ =
      @WidePullback.π _ _ _ f.right (fun _ : Fin (n + 1) => f.left) (fun _ => f.hom) _ i

[∀ (n : ℕ), CategoryTheory.Limits.HasWidePullback f.right (fun x => f.left) fun x => f.hom]

CategoryTheory.Arrow.AugmentedCechNerve.ExtraDegeneracy.s f S n ≫
    CategoryTheory.Limits.WidePullback.π (fun x => f.hom) i.succ =
  CategoryTheory.Limits.WidePullback.π (fun x => f.hom) i


@[to_additive]
theorem pow_inj_iff_of_orderOf_eq_zero (h : orderOf x = 0) {n m : ℕ} : x ^ n = x ^ m ↔ n = m

{G : Type u_1}
[LeftCancelMonoid G]
{x : G}
(h : orderOf x = 0)
{n m : ℕ}


@[to_additive]
theorem measure_mul_measure_eq (s t : Set G) (h2s : ν' s ≠ 0) (h3s : ν' s ≠ ∞) :
    μ' s * ν' t = ν' s * μ' t

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


@[to_additive (attr := simp)]
theorem toSubmonoid_le {p q : Subgroup G} : p.toSubmonoid ≤ q.toSubmonoid ↔ p ≤ q

{G : Type u_1}
[AddGroup G]
{p q : AddSubgroup G}

p.toAddSubmonoid ≤ q.toAddSubmonoid ↔ p ≤ q


theorem map_extend_nhds {x : M} (hy : x ∈ f.source) :
    map (f.extend I) (𝓝 x) = 𝓝[range I] f.extend I x

{𝕜 : Type u_1}
{E : Type u_2}
{M : Type u_3}
{H : Type u_4}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[TopologicalSpace H]
[TopologicalSpace M]
(f : PartialHomeomorph M H)
(I : ModelWithCorners 𝕜 E H)
{x : M}
(hy : x ∈ f.source)

Filter.map (↑(f.extend I)) (𝓝 x) = 𝓝[Set.range ↑I] ↑(f.extend I) x


theorem ack_strictMono_right : ∀ m, StrictMono (ack m)


/-- The identity pseudofunctor. -/
@[simps]
def id (B : Type u₁) [Bicategory.{w₁, v₁} B] : Pseudofunctor B B

(B : Type u₁)
[CategoryTheory.Bicategory B]

(CategoryTheory.Pseudofunctor.id B).toPrelaxFunctor = CategoryTheory.PrelaxFunctor.id B


theorem graphEquiv₂_apply (f : Fin n → α) (i : Fin n) :
    graphEquiv₂ f i = graphEquiv₁ f (sort f i)

{n : ℕ}
{α : Type u_1}
[LinearOrder α]
(f : Fin n → α)
(i : Fin n)

(Tuple.graphEquiv₂ f) i = (Tuple.graphEquiv₁ f) ((Tuple.sort f) i)


/-- The equivalence between R-linear maps from `R` to `M`, and points of `M` itself.
This says that the forgetful functor from `R`-modules to types is representable, by `R`.

This is an `S`-linear equivalence, under the assumption that `S` acts on `M` commuting with `R`.
When `R` is commutative, we can take this to be the usual action with `S = R`.
Otherwise, `S = ℕ` shows that the equivalence is additive.
See note [bundled maps over different rings].
-/
@[simps]
def ringLmapEquivSelf [Module S M] [SMulCommClass R S M] : (R →ₗ[R] M) ≃ₗ[S] M

(R : Type u_1)
(S : Type u_7)
(M : Type u_8)
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[Module R M]
[Module S M]
[SMulCommClass R S M]
(f : R →ₗ[R] M)

(LinearMap.ringLmapEquivSelf R S M) f = f 1


lemma toMonoidHom_coe (f : α →*₀ β) : f.toMonoidHom.toFun = f

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


theorem subsingleton_sphere (x : γ) {r : ℝ} (hr : r ≤ 0) : (sphere x r).Subsingleton

{γ : Type w}
[MetricSpace γ]
(x : γ)
{r : ℝ}
(hr : r ≤ 0)


nonrec theorem uniformInducing_iff [PseudoMetricSpace β] {f : α → β} :
    UniformInducing f ↔ UniformContinuous f ∧
      ∀ δ > 0, ∃ ε > 0, ∀ {a b : α}, dist (f a) (f b) < ε → dist a b < δ

{α : Type u}
{β : Type v}
[PseudoMetricSpace α]
[PseudoMetricSpace β]
{f : α → β}


theorem lift_comp_lift_eq_id [PerfectRing L p] :
    (lift j i p).comp (lift i j p) = RingHom.id L

{K : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing K]
[CommRing L]
[CommRing M]
(i : K →+* L)
(j : K →+* M)
(p : ℕ)
[ExpChar K p]
[ExpChar L p]
[ExpChar M p]
[PerfectRing M p]
[IsPRadical i p]
[IsPRadical j p]
[PerfectRing L p]

(PerfectRing.lift j i p).comp (PerfectRing.lift i j p) = RingHom.id L


theorem dvd_dioph : Dioph fun v => f v ∣ g v

{α : Type}
{f g : (α → ℕ) → ℕ}
(df : Dioph.DiophFn f)
(dg : Dioph.DiophFn g)


protected theorem Monotone.monotoneOn (hf : Monotone f) (s : Set α) : MonotoneOn f s

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
(hf : Monotone f)
(s : Set α)


theorem degree_cubic_lt : degree (C a * X ^ 3 + C b * X ^ 2 + C c * X + C d) < 4

(Polynomial.C a * Polynomial.X ^ 3 + Polynomial.C b * Polynomial.X ^ 2 + Polynomial.C c * Polynomial.X +
      Polynomial.C d).degree <
  4


protected theorem differentiableAt_aeval : DifferentiableAt 𝕜 (fun x => aeval x q) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{x : 𝕜}
{R : Type u_1}
[CommSemiring R]
[Algebra R 𝕜]
(q : R[X])

DifferentiableAt 𝕜 (fun x => (Polynomial.aeval x) q) x


@[simp]
theorem norm_measure_zero (f : Lp E p (0 : MeasureTheory.Measure α)) : ‖f‖ = 0

{α : Type u_1}
{E : Type u_2}
{m0 : MeasurableSpace α}
{p : ℝ≥0∞}
[NormedAddCommGroup E]
(f : ↥(MeasureTheory.Lp E p 0))


/-- The isomorphism `S₁.sc _ i ≅ S₂.sc _ i` induced by an isomorphism `S₁ ≅ S₂`
in `ComposableArrows C n`. -/
@[simps]
def scMapIso {S₁ S₂ : ComposableArrows C n} (e : S₁ ≅ S₂)
    (h₁ : S₁.IsComplex) (h₂ : S₂.IsComplex)
    (i : ℕ) (hi : i + 2 ≤ n := by omega) :
    S₁.sc h₁ i ≅ S₂.sc h₂ i

{S₁ S₂ : CategoryTheory.ComposableArrows C n}

(CategoryTheory.ComposableArrows.scMapIso e h₁ h₂ i hi).inv = CategoryTheory.ComposableArrows.scMap e.inv h₂ h₁ i ⋯


/-- Caratheodory theorem. If `m` is a metric outer measure, then every Borel measurable set `t` is
Caratheodory measurable: for any (not necessarily measurable) set `s` we have
`μ (s ∩ t) + μ (s \ t) = μ s`. -/
theorem borel_le_caratheodory (hm : IsMetric μ) : borel X ≤ μ.caratheodory

{X : Type u_2}
[EMetricSpace X]
{μ : MeasureTheory.OuterMeasure X}
(hm : μ.IsMetric)


theorem IsCompl.eq_compl (h : IsCompl a b) : a = bᶜ

{α : Type u_2}
[HeytingAlgebra α]
{a b : α}
(h : IsCompl a b)


@[to_additive]
theorem inter_mul_union_subset_union : s₁ ∩ s₂ * (t₁ ∪ t₂) ⊆ s₁ * t₁ ∪ s₂ * t₂

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

s₁ ∩ s₂ + (t₁ ∪ t₂) ⊆ s₁ + t₁ ∪ (s₂ + t₂)


@[to_additive (attr := simp)]
theorem smul_closedBall (c : G) (x : X) (r : ℝ≥0∞) : c • closedBall x r = closedBall (c • x) r

{G : Type v}
{X : Type w}
[PseudoEMetricSpace X]
[AddGroup G]
[AddAction G X]
[IsometricVAdd G X]
(c : G)
(x : X)
(r : ℝ≥0∞)

c +ᵥ EMetric.closedBall x r = EMetric.closedBall (c +ᵥ x) r


theorem surjective_mk : Surjective (mk : X → SeparationQuotient X)


theorem IsCoprime.of_mul_add_right_right (h : IsCoprime x (z * x + y)) : IsCoprime x y

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


@[simps (config := .lemmasOnly) toSemigroup_toMul_mul toOne_one]
instance End : Monoid (A →ₐc[R] A)

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[CoalgebraStruct R A]


theorem toDual_lt [LT α] {a : α} {b : αᵒᵈ} : toDual a < b ↔ ofDual b < a

OrderDual.toDual a < b ↔ OrderDual.ofDual b < a


theorem order_eq_zero_iff' : p.order = 0 ↔ p = 0 ∨ p 0 ≠ 0

{𝕜 : Type u}
{E : Type v}
{F : Type w}
[Ring 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
[AddCommGroup F]
[Module 𝕜 F]
[TopologicalSpace F]
[TopologicalAddGroup F]
[ContinuousConstSMul 𝕜 F]
{p : FormalMultilinearSeries 𝕜 E F}


@[simp]
private lemma mem_pairs (k : ℕ) (t : Finset σ × σ) :
    t ∈ pairs σ k ↔ card t.fst ≤ k ∧ (card t.fst = k → t.snd ∈ t.fst)

(σ : Type u_1)
[Fintype σ]
[DecidableEq σ]
(k : ℕ)
(t : Finset σ × σ)

t ∈ MvPolynomial.NewtonIdentities.pairs σ k ↔ t.1.card ≤ k ∧ (t.1.card = k → t.2 ∈ t.1)


@[simp]
theorem e0_mul_v_mul_e0 (m : M) : e0 Q * v Q m * e0 Q = v Q m

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(Q : QuadraticForm R M)
(m : M)

CliffordAlgebra.EquivEven.e0 Q * (CliffordAlgebra.EquivEven.v Q) m * CliffordAlgebra.EquivEven.e0 Q =
  (CliffordAlgebra.EquivEven.v Q) m


@[simp] theorem pred_castSucc_succ (i : Fin n) :
    pred (castSucc i.succ) (Fin.ne_of_gt (castSucc_pos i.succ_pos)) = castSucc i


/-- If `K / E / F` is a field extension tower, such that `E / F` is purely inseparable, then
for any element `x` of `K` separable over `F`, it has the same minimal polynomials over `F` and
over `E`. -/
theorem minpoly.map_eq_of_isSeparable_of_isPurelyInseparable (x : K)
    (hsep : IsSeparable F x) [IsPurelyInseparable F E] :
    (minpoly F x).map (algebraMap F E) = minpoly E x

{F : Type u}
(E : Type v)
[Field F]
[Field E]
[Algebra F E]
{K : Type w}
[Field K]
[Algebra F K]
[Algebra E K]
[IsScalarTower F E K]
(x : K)
(hsep : IsSeparable F x)
[IsPurelyInseparable F E]

Polynomial.map (algebraMap F E) (minpoly F x) = minpoly E x


@[simp]
lemma orthogonal_toSubmodule (N : LieSubmodule R L M) :
    (orthogonal Φ hΦ_inv N).toSubmodule = Φ.orthogonal N.toSubmodule

(hΦ_inv : LinearMap.BilinForm.lieInvariant L Φ)

↑(LieAlgebra.InvariantForm.orthogonal Φ hΦ_inv N) = Φ.orthogonal ↑N


/-- `rotateLeft` equals the bit fiddling definition of `rotateLeftAux` when the rotation amount is
smaller than the bitwidth. -/
theorem rotateLeft_eq_rotateLeftAux_of_lt {x : BitVec w} {r : Nat} (hr : r < w) :
    x.rotateLeft r = x.rotateLeftAux r

{w : Nat}
{x : BitVec w}
{r : Nat}
(hr : r < w)


lemma trace_eq_zero_of_mapsTo_ne [IsNoetherian R M]
    (σ : ι → ι) (hσ : ∀ i, σ i ≠ i) {f : Module.End R M}
    (hf : ∀ i, MapsTo f (N i) (N <| σ i)) :
    trace R M f = 0

(hf : ∀ (i : ι), Set.MapsTo ⇑f ↑(N i) ↑(N (σ i)))


@[to_additive]
theorem mul_eq_of_eq_mul_inv (h : a = c * b⁻¹) : a * b = c

{G : Type u_3}
[Group G]
{a b c : G}
(h : a = c * b⁻¹)


@[reassoc]
theorem pushout.inr_desc {W X Y Z : C} {f : X ⟶ Y} {g : X ⟶ Z} [HasPushout f g] (h : Y ⟶ W)
    (k : Z ⟶ W) (w : f ≫ h = g ≫ k) : pushout.inr _ _ ≫ pushout.desc h k w = k

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{W X Y Z : C}
{f : X ⟶ Y}
{g : X ⟶ Z}
[CategoryTheory.Limits.HasPushout f g]
(h : Y ⟶ W)
(k : Z ⟶ W)
(w : f ≫ h = g ≫ k)

CategoryTheory.Limits.pushout.inr f g ≫ CategoryTheory.Limits.pushout.desc h k w = k


theorem of_isUnit_or_isUnit_of_isUnit_add [Nontrivial R]
    (h : ∀ a b : R, IsUnit (a + b) → IsUnit a ∨ IsUnit b) : LocalRing R

(h : ∀ (a b : R), IsUnit (a + b) → IsUnit a ∨ IsUnit b)


theorem nodup (n m : ℕ) : Nodup (Ico n m)


theorem bitIndices_bit_false (n : ℕ) :
    bitIndices (bit false n) = (bitIndices n).map (· + 1)

(Nat.bit false n).bitIndices = List.map (fun x => x + 1) n.bitIndices


@[simp]
theorem rootMultiplicity_C (r a : R) : rootMultiplicity a (C r) = 0

Polynomial.rootMultiplicity a (Polynomial.C r) = 0


@[to_additive (attr := simp) unzero_coe]
theorem unone_coe {x : α} (hx : (x : WithOne α) ≠ 1) : unone hx = x


theorem count_apply (hs : MeasurableSet s) : count s = ∑' i : s, 1

{α : Type u_1}
[MeasurableSpace α]
{s : Set α}
(hs : MeasurableSet s)

MeasureTheory.Measure.count s = ∑' (i : ↑s), 1


theorem exists_algebraMap_eq_of_pow_mem_subalgebra {A : Type*} [CommRing A] [Algebra R A]
    {S : Subalgebra R A} [IsIntegrallyClosedIn S A] {x : A} {n : ℕ} (hn : 0 < n)
    (hx : x ^ n ∈ S) : ∃ y : S, algebraMap S A y = x

{R : Type u_1}
[CommRing R]
{A : Type u_3}
[CommRing A]
[Algebra R A]
{S : Subalgebra R A}
[IsIntegrallyClosedIn (↥S) A]
{x : A}
{n : ℕ}
(hn : 0 < n)
(hx : x ^ n ∈ S)


/-- A continuous map from a compact space to a T₂ space is a proper map. -/
theorem Continuous.isProperMap [CompactSpace X] [T2Space Y] (hf : Continuous f) : IsProperMap f

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
[CompactSpace X]
[T2Space Y]
(hf : Continuous f)


/-- The functor defined by the over categories.-/
@[simps] def mapFunctor : T ⥤ Cat

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

∀ {X Y : T} (f : X ⟶ Y), (CategoryTheory.Over.mapFunctor T).map f = CategoryTheory.Over.map f


@[simp]
theorem toKernelSubobject_arrow {M N : ModuleCat R} {f : M ⟶ N} (x : LinearMap.ker f) :
    (kernelSubobject f).arrow (toKernelSubobject x) = x.1

{R : Type u}
[Ring R]
{M N : ModuleCat R}
{f : M ⟶ N}
(x : ↥(LinearMap.ker f))

(CategoryTheory.Limits.kernelSubobject f).arrow (ModuleCat.toKernelSubobject x) = ↑x


theorem apply_coe_mem_map (f : α ↪ β) (s : Finset α) (x : s) : f x ∈ s.map f

{α : Type u_1}
{β : Type u_2}
(f : α ↪ β)
(s : Finset α)
(x : { x // x ∈ s })


theorem infinite_of_nonempty_of_isEmpty (a b : α) [ha : Nonempty (β a)] [he : IsEmpty (β b)] :
    Infinite (WType β)

{α : Type u_1}
{β : α → Type u_2}
(a b : α)
[ha : Nonempty (β a)]
[he : IsEmpty (β b)]


@[to_additive]
theorem mul_ball_one : s * ball 1 δ = thickening δ s

{E : Type u_1}
[SeminormedCommGroup E]
(δ : ℝ)
(s : Set E)

s * Metric.ball 1 δ = Metric.thickening δ s


theorem submatrix_neg [Neg α] (A : Matrix m n α) :
    ((-A).submatrix : (l → m) → (o → n) → Matrix l o α) = -A.submatrix

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


lemma card_pos_iff : 0 < Nat.card α ↔ Nonempty α ∧ Finite α


theorem AECover.biUnion_Iic_aecover [Preorder ι] {φ : ι → Set α} (hφ : AECover μ atTop φ) :
    AECover μ atTop fun n : ι => ⋃ (k) (_h : k ∈ Iic n), φ k

(hφ : MeasureTheory.AECover μ Filter.atTop φ)

MeasureTheory.AECover μ Filter.atTop fun n => ⋃ k ∈ Set.Iic n, φ k


theorem toNNReal_mul {p q : ℝ} (hp : 0 ≤ p) :
    Real.toNNReal (p * q) = Real.toNNReal p * Real.toNNReal q

(p * q).toNNReal = p.toNNReal * q.toNNReal


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


@[simp]
theorem toOpposite_apply (r : R) : toOpposite R r = op r

(R : Type u_4)
[NonUnitalCommSemiring R]
(r : R)

(RingEquiv.toOpposite R) r = MulOpposite.op r


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


@[simp]
theorem closure_diff_intrinsicInterior (s : Set P) :
    closure s \ intrinsicInterior 𝕜 s = intrinsicFrontier 𝕜 s

{𝕜 : Type u_1}
{V : Type u_2}
{P : Type u_5}
[NontriviallyNormedField 𝕜]
[CompleteSpace 𝕜]
[NormedAddCommGroup V]
[NormedSpace 𝕜 V]
[FiniteDimensional 𝕜 V]
[MetricSpace P]
[NormedAddTorsor V P]
(s : Set P)


@[simp]
theorem invFun_add {p q} : invFun R A (p + q) = invFun R A p + invFun R A q

(R : Type u_1)
(A : Type u_2)
[CommSemiring R]
[Semiring A]
[Algebra R A]
{p q : A[X]}

PolyEquivTensor.invFun R A (p + q) = PolyEquivTensor.invFun R A p + PolyEquivTensor.invFun R A q


@[simp]
theorem coe_basisOneI : ⇑basisOneI = ![1, I]


@[to_additive (attr := measurability)]
theorem _root_.Multiset.stronglyMeasurable_prod' (l : Multiset (α → M))
    (hl : ∀ f ∈ l, StronglyMeasurable f) : StronglyMeasurable l.prod

(hl : ∀ f ∈ l, MeasureTheory.StronglyMeasurable f)


@[simp]
theorem smul_mem_pointwise_smul_iff₀ {a : M} (ha : a ≠ 0) (S : Subring R) (x : R) :
    a • x ∈ a • S ↔ x ∈ S

{M : Type u_1}
{R : Type u_2}
[GroupWithZero M]
[Ring R]
[MulSemiringAction M R]
{a : M}
(ha : a ≠ 0)
(S : Subring R)
(x : R)


@[reassoc]
lemma LeftHomologyData.leftHomologyIso_inv_naturality
    (h₁ : S₁.LeftHomologyData) (h₂ : S₂.LeftHomologyData) :
    h₁.homologyIso.inv ≫ homologyMap φ =
      leftHomologyMap' φ h₁ h₂ ≫ h₂.homologyIso.inv

CategoryTheory.CategoryStruct.comp h₁.homologyIso.inv (CategoryTheory.ShortComplex.homologyMap φ) =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.ShortComplex.leftHomologyMap' φ h₁ h₂) h₂.homologyIso.inv


/-- For a vector with invertible quadratic form, $v^{-1} = \frac{v}{Q(v)}$ -/
theorem invOf_ι (m : M) [Invertible (Q m)] [Invertible (ι Q m)] :
    ⅟ (ι Q m) = ι Q (⅟ (Q m) • m)

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
(Q : QuadraticForm R M)
(m : M)
[Invertible (Q m)]
[Invertible ((CliffordAlgebra.ι Q) m)]

⅟((CliffordAlgebra.ι Q) m) = (CliffordAlgebra.ι Q) (⅟(Q m) • m)


theorem Eventually.prod_mk {la : Filter α} {pa : α → Prop} (ha : ∀ᶠ x in la, pa x) {lb : Filter β}
    {pb : β → Prop} (hb : ∀ᶠ y in lb, pb y) : ∀ᶠ p in la ×ˢ lb, pa (p : α × β).1 ∧ pb p.2

{α : Type u_1}
{β : Type u_2}
{la : Filter α}
{pa : α → Prop}
(ha : ∀ᶠ (x : α) in la, pa x)
{lb : Filter β}
{pb : β → Prop}
(hb : ∀ᶠ (y : β) in lb, pb y)

∀ᶠ (p : α × β) in la ×ˢ lb, pa p.1 ∧ pb p.2


theorem getLast?_append_of_ne_nil (l₁ : List α) :
    ∀ {l₂ : List α} (_ : l₂ ≠ []), getLast? (l₁ ++ l₂) = getLast? l₂

{α : Type u}
(l₁ : List α)
{l₂ : List α}

l₂ ≠ [] → (l₁ ++ l₂).getLast? = l₂.getLast?


/-- If `M` contains `0` then the localization at `M` is trivial. -/
theorem subsingleton (h : 0 ∈ M) : Subsingleton S

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


theorem hammingDist_le_card_fintype {x y : ∀ i, β i} : hammingDist x y ≤ Fintype.card ι

{ι : Type u_2}
{β : ι → Type u_3}
[Fintype ι]
[(i : ι) → DecidableEq (β i)]
{x y : (i : ι) → β i}


theorem hasTrivialRadical_iff_no_solvable_ideals :
    HasTrivialRadical R L ↔ ∀ I : LieIdeal R L, IsSolvable R I → I = ⊥

(R : Type u_1)
(L : Type u_2)
[CommRing R]
[LieRing L]
[LieAlgebra R L]

LieAlgebra.HasTrivialRadical R L ↔ ∀ (I : LieIdeal R L), LieAlgebra.IsSolvable R ↥↑I → I = ⊥


@[simp] theorem cond_true_right  : ∀(c t : Bool), cond c t true  = (!c || t)


/-- Asymptotic bound for the `Γ` function integrand. -/
theorem Gamma_integrand_isLittleO (s : ℝ) :
    (fun x : ℝ => exp (-x) * x ^ s) =o[atTop] fun x : ℝ => exp (-(1 / 2) * x)

(fun x => rexp (-x) * x ^ s) =o[Filter.atTop] fun x => rexp (-(1 / 2) * x)


theorem OrderIso.mulLeft₀'_symm {a : α} (ha : a ≠ 0) :
    (OrderIso.mulLeft₀' ha).symm = OrderIso.mulLeft₀' (inv_ne_zero ha)

{α : Type u_1}
[LinearOrderedCommGroupWithZero α]
{a : α}
(ha : a ≠ 0)

(OrderIso.mulLeft₀' ha).symm = OrderIso.mulLeft₀' ⋯


lemma reflection_apply (x : M) :
    P.reflection i x = x - (P.toLin x (P.coroot i)) • P.root i

{ι : Type u_1}
{R : Type u_2}
{M : Type u_3}
{N : Type u_4}
[CommRing R]
[AddCommGroup M]
[Module R M]
[AddCommGroup N]
[Module R N]
(P : RootPairing ι R M N)
(i : ι)
(x : M)

(P.reflection i) x = x - (P.toLin x) (P.coroot i) • P.root i


theorem spanSingleton_div_self {x : K} (hx : x ≠ 0) :
    spanSingleton R₁⁰ x / spanSingleton R₁⁰ x = 1

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

FractionalIdeal.spanSingleton R₁⁰ x / FractionalIdeal.spanSingleton R₁⁰ x = 1


@[simp]
lemma map_sub : (z - z').map Φ = z.map Φ - z'.map Φ

(z z' : CochainComplex.HomComplex.Cochain K L n)


theorem intCast_surjective : Function.Surjective ((↑) : ℤ → ZMod n)


theorem rat_sub (h : LiouvilleWith p x) (r : ℚ) : LiouvilleWith p (r - x)

{p x : ℝ}
(h : LiouvilleWith p x)
(r : ℚ)


theorem Dvd.elim {P : Prop} {a b : α} (H₁ : a ∣ b) (H₂ : ∀ c, b = a * c → P) : P

{α : Type u_1}
[Semigroup α]
{P : Prop}
{a b : α}
(H₁ : a ∣ b)
(H₂ : ∀ (c : α), b = a * c → P)


theorem toList_formPerm_singleton (x y : α) : toList (formPerm [x]) y = []

{α : Type u_1}
[Fintype α]
[DecidableEq α]
(x y : α)


theorem SmoothWithinAt.inv₀ (hf : SmoothWithinAt I' I f s a) (ha : f a ≠ 0) :
    SmoothWithinAt I' I (fun x => (f x)⁻¹) s a

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{H : Type u_2}
[TopologicalSpace H]
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[Inv G]
[Zero G]
[SmoothInv₀ I G]
{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]
{f : M → G}
{s : Set M}
{a : M}
(hf : SmoothWithinAt I' I f s a)
(ha : f a ≠ 0)


@[simp]
theorem fullyFaithfulCancelRight_hom_app {F G : C ⥤ D} {H : D ⥤ E} [Full H] [H.Faithful]
    (comp_iso : F ⋙ H ≅ G ⋙ H) (X : C) :
    (fullyFaithfulCancelRight H comp_iso).hom.app X = H.preimage (comp_iso.hom.app X)

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{E : Type u₃}
[CategoryTheory.Category.{v₃, u₃} E]
{F G : CategoryTheory.Functor C D}
{H : CategoryTheory.Functor D E}
[H.Full]
[H.Faithful]
(comp_iso : F.comp H ≅ G.comp H)
(X : C)

(CategoryTheory.Functor.fullyFaithfulCancelRight H comp_iso).hom.app X = H.preimage (comp_iso.hom.app X)


@[simp]
theorem frontier_setOf_re_lt (a : ℝ) : frontier { z : ℂ | z.re < a } = { z | z.re = a }

frontier {z | z.re < a} = {z | z.re = a}


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

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

MeasureTheory.NullMeasurableSet (⋂₀ s) μ


theorem bddLat_dual_comp_forget_to_bddOrd :
    BddLat.dual ⋙ forget₂ BddLat BddOrd =
    forget₂ BddLat BddOrd ⋙ BddOrd.dual

BddLat.dual ⋙ CategoryTheory.forget₂ BddLat BddOrd = CategoryTheory.forget₂ BddLat BddOrd ⋙ BddOrd.dual


private theorem exist_eq_reflection_of_mapsTo  :
    ∃ k, root k = (preReflection (root i) (p.toLin.flip (coroot i))) (root j)

(h :
  ∀ (i : ι),
    Set.MapsTo (⇑(Module.preReflection (root i) (p.toLin.flip (coroot i)))) (Set.range ⇑root) (Set.range ⇑root))

∃ k, root k = (Module.preReflection (root i) (p.toLin.flip (coroot i))) (root j)


theorem hasProductsOfShape_of_opposite [HasCoproductsOfShape X Cᵒᵖ] : HasProductsOfShape X C


@[to_additive]
theorem prod_pow (s : Finset α) (n : ℕ) (f : α → β) : ∏ x ∈ s, f x ^ n = (∏ x ∈ s, f x) ^ n

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
(s : Finset α)
(n : ℕ)
(f : α → β)


@[simp] lemma of_WithUpper_symm_eq : (@ofUpper α).symm = toUpper


theorem colimit_eq {j j' : J} {x : F.obj j} {x' : F.obj j'}
    (w : colimit.ι F j x = colimit.ι F j' x') :
      EqvGen (Quot.Rel F) ⟨j, x⟩ ⟨j', x'⟩

(w : CategoryTheory.Limits.colimit.ι F j x = CategoryTheory.Limits.colimit.ι F j' x')

EqvGen (CategoryTheory.Limits.Types.Quot.Rel F) ⟨j, x⟩ ⟨j', x'⟩


theorem maximum?_mem [Max α] (min_eq_or : ∀ a b : α, max a b = a ∨ max a b = b) :
    {xs : List α} → xs.maximum? = some a → a ∈ xs

(min_eq_or : ∀ (a b : α), max a b = a ∨ max a b = b)


theorem lt_log_iff_exp_lt (hy : 0 < y) : x < log y ↔ exp x < y


@[to_additive]
theorem pi_mem_of_mulSingle_mem_aux [DecidableEq η] (I : Finset η) {H : Subgroup (∀ i, f i)}
    (x : ∀ i, f i) (h1 : ∀ i, i ∉ I → x i = 1) (h2 : ∀ i, i ∈ I → Pi.mulSingle i (x i) ∈ H) :
    x ∈ H

(h2 : ∀ i ∈ I, Pi.mulSingle i (x i) ∈ H)


@[simp]
theorem deleteVerts_inter_verts_set_right_eq :
    G'.deleteVerts (s ∩ G'.verts) = G'.deleteVerts s

{V : Type u}
{G : SimpleGraph V}
{G' : G.Subgraph}
{s : Set V}


@[simp, norm_cast]
theorem natCast_imI (n : ℕ) : (n : ℍ[R,c₁,c₂]).imI = 0

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


nonrec theorem formPerm_reverse (s : Cycle α) (h : Nodup s) :
    formPerm s.reverse (nodup_reverse_iff.mpr h) = (formPerm s h)⁻¹

{α : Type u_1}
[DecidableEq α]
(s : Cycle α)
(h : s.Nodup)


@[simp] lemma ofColex_bot : ofColex (⊥ : Colex α) = ∅


@[simp]
theorem midpoint_sub_right (v₁ v₂ : V) : midpoint R v₁ v₂ - v₂ = (⅟ 2 : R) • (v₁ - v₂)

{R : Type u_1}
{V : Type u_2}
[Ring R]
[Invertible 2]
[AddCommGroup V]
[Module R V]
(v₁ v₂ : V)


@[simp]
theorem map_up (f : α → β) (a : α) : (ULift.up.{u'} a).map f = ULift.up.{v'} (f a)

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

ULift.map f { down := a } = { down := f a }


theorem submartingale [Preorder E] (hf : Martingale f ℱ μ) : Submartingale f ℱ μ

{Ω : Type u_1}
{E : Type u_2}
{ι : Type u_3}
[Preorder ι]
{m0 : MeasurableSpace Ω}
{μ : MeasureTheory.Measure Ω}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[CompleteSpace E]
{f : ι → Ω → E}
{ℱ : MeasureTheory.Filtration ι m0}
[Preorder E]
(hf : MeasureTheory.Martingale f ℱ μ)


/-- A `EuclideanDomain` is a non-trivial commutative ring with a division and a remainder,
  satisfying `b * (a / b) + a % b = a`.
  The definition of a Euclidean domain usually includes a valuation function `R → ℕ`.
  This definition is slightly generalised to include a well founded relation
  `r` with the property that `r (a % b) b`, instead of a valuation.  -/
class EuclideanDomain (R : Type u) extends CommRing R, Nontrivial R where
  /-- A division function (denoted `/`) on `R`.
    This satisfies the property `b * (a / b) + a % b = a`, where `%` denotes `remainder`. -/
  protected quotient : R → R → R
  /-- Division by zero should always give zero by convention. -/
  protected quotient_zero : ∀ a, quotient a 0 = 0
  /-- A remainder function (denoted `%`) on `R`.
    This satisfies the property `b * (a / b) + a % b = a`, where `/` denotes `quotient`. -/
  protected remainder : R → R → R
  /-- The property that links the quotient and remainder functions.
    This allows us to compute GCDs and LCMs. -/
  protected quotient_mul_add_remainder_eq : ∀ a b, b * quotient a b + remainder a b = a
  /-- A well-founded relation on `R`, satisfying `r (a % b) b`.
    This ensures that the GCD algorithm always terminates. -/
  protected r : R → R → Prop
  /-- The relation `r` must be well-founded.
    This ensures that the GCD algorithm always terminates. -/
  r_wellFounded : WellFounded r
  /-- The relation `r` satisfies `r (a % b) b`. -/
  protected remainder_lt : ∀ (a) {b}, b ≠ 0 → r (remainder a b) b
  /-- An additional constraint on `r`. -/
  mul_left_not_lt : ∀ (a) {b}, b ≠ 0 → ¬r (a * b) a

{R : Type u}
[self : EuclideanDomain R]
(a : R)
{b : R}


/-- Any independent set can be extended into a larger independent set. -/
theorem Indep.augment (hI : M.Indep I) (hJ : M.Indep J) (hIJ : I.encard < J.encard) :
    ∃ e ∈ J \ I, M.Indep (insert e I)

{α : Type u_1}
{M : Matroid α}
{I J : Set α}
(hI : M.Indep I)
(hJ : M.Indep J)
(hIJ : I.encard < J.encard)


theorem prime_C_iff : Prime (C r) ↔ Prime r


theorem ae_le_iff_absolutelyContinuous : ae μ ≤ ae ν ↔ μ ≪ ν

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

MeasureTheory.ae μ ≤ MeasureTheory.ae ν ↔ μ.AbsolutelyContinuous ν


nonrec theorem _root_.RCLike.intervalIntegral_ofReal {𝕜 : Type*} [RCLike 𝕜] {a b : ℝ}
    {μ : Measure ℝ} {f : ℝ → ℝ} : (∫ x in a..b, (f x : 𝕜) ∂μ) = ↑(∫ x in a..b, f x ∂μ)

{𝕜 : Type u_6}
[RCLike 𝕜]
{a b : ℝ}
{μ : MeasureTheory.Measure ℝ}
{f : ℝ → ℝ}

∫ (x : ℝ) in a..b, ↑(f x) ∂μ = ↑(∫ (x : ℝ) in a..b, f x ∂μ)


@[simp]
theorem expMapCircle_neg (x : ℝ) : expMapCircle (-x) = (expMapCircle x)⁻¹


@[simp]
theorem Gamma1_mem (N : ℕ) (A : SL(2, ℤ)) : A ∈ Gamma1 N ↔
    ((↑ₘA 0 0 : ℤ) : ZMod N) = 1 ∧ ((↑ₘA 1 1 : ℤ) : ZMod N) = 1 ∧ ((↑ₘA 1 0 : ℤ) : ZMod N) = 0

A ∈ CongruenceSubgroup.Gamma1 N ↔ ↑(↑A 0 0) = 1 ∧ ↑(↑A 1 1) = 1 ∧ ↑(↑A 1 0) = 0


@[simp]
theorem lmapDomain_id : (lmapDomain M R _root_.id : (α →₀ M) →ₗ[R] α →₀ M) = LinearMap.id

{α : Type u_1}
(M : Type u_2)
(R : Type u_5)
[Semiring R]
[AddCommMonoid M]
[Module R M]

Finsupp.lmapDomain M R id = LinearMap.id


/-- A vector is in the same ray as a nonnegative multiple of one it is in the same ray as. -/
lemma nonneg_smul_right (h : SameRay R x y) (ha : 0 ≤ a) : SameRay R x (a • y)

{R : Type u_1}
[StrictOrderedCommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{x y : M}
{S : Type u_5}
[OrderedCommSemiring S]
[Algebra S R]
[Module S M]
[SMulPosMono S R]
[IsScalarTower S R M]
{a : S}
(h : SameRay R x y)
(ha : 0 ≤ a)


@[simp]
lemma overEquiv_symm_top {X : C} (Y : Over X) :
    (overEquiv Y).symm ⊤ = ⊤

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

(CategoryTheory.Sieve.overEquiv Y).symm ⊤ = ⊤


theorem le_graph_iff {f g : E →ₗ.[R] F} : f.graph ≤ g.graph ↔ f ≤ g

{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 g : E →ₗ.[R] F}


@[to_additive]
protected theorem Multipliable.map_iff_of_leftInverse [CommMonoid γ] [TopologicalSpace γ] {G G'}
    [FunLike G α γ] [MonoidHomClass G α γ] [FunLike G' γ α] [MonoidHomClass G' γ α]
    (g : G) (g' : G') (hg : Continuous g) (hg' : Continuous g') (hinv : Function.LeftInverse g' g) :
    Multipliable (g ∘ f) ↔ Multipliable f

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[CommMonoid α]
[TopologicalSpace α]
{f : β → α}
[CommMonoid γ]
[TopologicalSpace γ]
{G : Type u_5}
{G' : Type u_6}
[FunLike G α γ]
[MonoidHomClass G α γ]
[FunLike G' γ α]
[MonoidHomClass G' γ α]
(g : G)
(g' : G')
(hg : Continuous ⇑g)
(hg' : Continuous ⇑g')
(hinv : Function.LeftInverse ⇑g' ⇑g)


@[simp]
theorem norm_ofSubsingleton [Subsingleton ι] (i : ι) (f : G →L[𝕜] G') :
    ‖ofSubsingleton 𝕜 G G' i f‖ = ‖f‖

{𝕜 : Type u}
{ι : Type v}
{G : Type wG}
{G' : Type wG'}
[Fintype ι]
[NontriviallyNormedField 𝕜]
[SeminormedAddCommGroup G]
[NormedSpace 𝕜 G]
[SeminormedAddCommGroup G']
[NormedSpace 𝕜 G']
[Subsingleton ι]
(i : ι)
(f : G →L[𝕜] G')

‖(ContinuousMultilinearMap.ofSubsingleton 𝕜 G G' i) f‖ = ‖f‖


theorem exists_unique_const {b : Prop} (α : Sort*) [i : Nonempty α] [Subsingleton α] :
    (∃! _ : α, b) ↔ b

{b : Prop}
(α : Sort u_3)
[i : Nonempty α]
[Subsingleton α]


theorem coe_injective : @Function.Injective C(α, β) (α → β) (↑)

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


protected theorem mono (hf : HolderOnWith C r f s) (ht : t ⊆ s) : HolderOnWith C r f t

{X : Type u_1}
{Y : Type u_2}
[PseudoEMetricSpace X]
[PseudoEMetricSpace Y]
{C r : ℝ≥0}
{f : X → Y}
{s t : Set X}
(hf : HolderOnWith C r f s)
(ht : t ⊆ s)


@[simp]
theorem zero_f_apply (i : ι) : (0 : C ⟶ D).f i = 0

{ι : Type u_1}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{c : ComplexShape ι}
{C D : HomologicalComplex V c}
(i : ι)


lemma ConvexOn.smul_concaveOn (hf : ConvexOn 𝕜 s f) (hg : ConcaveOn 𝕜 s g)
    (hf₀ : ∀ ⦃x⦄, x ∈ s → 0 ≤ f x) (hg₀ : ∀ ⦃x⦄, x ∈ s → g x ≤ 0) (hfg : AntivaryOn f g s) :
    ConcaveOn 𝕜 s (f • g)

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[LinearOrderedCommRing 𝕜]
[LinearOrderedCommRing E]
[LinearOrderedAddCommGroup F]
[Module 𝕜 E]
[Module 𝕜 F]
[Module E F]
[IsScalarTower 𝕜 E F]
[SMulCommClass 𝕜 E F]
[OrderedSMul 𝕜 F]
[OrderedSMul E F]
{s : Set 𝕜}
{f : 𝕜 → E}
{g : 𝕜 → F}
(hf : ConvexOn 𝕜 s f)
(hg : ConcaveOn 𝕜 s g)
(hf₀ : ∀ ⦃x : 𝕜⦄, x ∈ s → 0 ≤ f x)
(hg₀ : ∀ ⦃x : 𝕜⦄, x ∈ s → g x ≤ 0)
(hfg : AntivaryOn f g s)


@[simp] theorem truncate_eq (x : BitVec n) : truncate n x = x


@[simp]
theorem dist_left_midpoint (p₁ p₂ : P) : dist p₁ (midpoint 𝕜 p₁ p₂) = ‖(2 : 𝕜)‖⁻¹ * dist p₁ p₂

{V : Type u_2}
{P : Type u_3}
[SeminormedAddCommGroup V]
[PseudoMetricSpace P]
[NormedAddTorsor V P]
{𝕜 : Type u_6}
[NormedField 𝕜]
[NormedSpace 𝕜 V]
[Invertible 2]
(p₁ p₂ : P)

dist p₁ (midpoint 𝕜 p₁ p₂) = ‖2‖⁻¹ * dist p₁ p₂


theorem testBit_mul_pow_two :
    testBit (2 ^ i * a) j = (decide (j ≥ i) && testBit a (j-i))

(2 ^ i * a).testBit j = (decide (j ≥ i) && a.testBit (j - i))


theorem lift_iInf_of_directed [Nonempty ι] {f : ι → Filter α} {g : Set α → Filter β}
    (hf : Directed (· ≥ ·) f) (hg : Monotone g) : (iInf f).lift g = ⨅ i, (f i).lift g

(hf : Directed (fun x x_1 => x ≥ x_1) f)


theorem lowerBounds_Ioo {a b : γ} (hab : a < b) : lowerBounds (Ioo a b) = Iic a

{γ : Type w}
[SemilatticeSup γ]
[DenselyOrdered γ]
{a b : γ}
(hab : a < b)


lemma cutExpand_zero {x} : CutExpand r 0 {x}

{α : Type u_1}
{r : α → α → Prop}
{x : α}


@[to_additive]
theorem inv_mem_Ioc_iff : a⁻¹ ∈ Set.Ioc c d ↔ a ∈ Set.Ico d⁻¹ c⁻¹

{α : Type u_1}
[OrderedCommGroup α]
{a c d : α}


theorem coe_one : ⇑(1 : Module.End R M) = _root_.id

{R : Type u_1}
{M : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]


theorem EventuallyEq.sub_eq [AddGroup β] {f g : α → β} {l : Filter α} (h : f =ᶠ[l] g) :
    f - g =ᶠ[l] 0

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


/-- The total mass of a finite measure depends continuously on the measure. -/
theorem continuous_mass : Continuous fun μ : FiniteMeasure Ω => μ.mass

{Ω : Type u_1}
[MeasurableSpace Ω]
[TopologicalSpace Ω]
[OpensMeasurableSpace Ω]


/-- Lift a functor `F : C ⥤ D` to `WithInitial C ⥤ D`. -/
@[simps]
def lift {D : Type*} [Category D] {Z : D} (F : C ⥤ D) (M : ∀ x : C, Z ⟶ F.obj x)
    (hM : ∀ (x y : C) (f : x ⟶ y), M x ≫ F.map f = M y) : WithInitial C ⥤ D

(hM : ∀ (x y : C) (f : x ⟶ y), CategoryTheory.CategoryStruct.comp (M x) (F.map f) = M y)

(CategoryTheory.WithInitial.lift F M hM).obj X =
  match X with
  | CategoryTheory.WithInitial.of x => F.obj x
  | CategoryTheory.WithInitial.star => Z


theorem count_cons (a b : α) (s : Multiset α) :
    count a (b ::ₘ s) = count a s + if a = b then 1 else 0

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

Multiset.count a (b ::ₘ s) = Multiset.count a s + if a = b then 1 else 0


theorem fderivWithin_smul_const (hxs : UniqueDiffWithinAt 𝕜 s x)
    (hc : DifferentiableWithinAt 𝕜 c s x) (f : F) :
    fderivWithin 𝕜 (fun y => c y • f) s x = (fderivWithin 𝕜 c s x).smulRight f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{x : E}
{s : Set E}
{𝕜' : Type u_6}
[NontriviallyNormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[NormedSpace 𝕜' F]
[IsScalarTower 𝕜 𝕜' F]
{c : E → 𝕜'}
(hxs : UniqueDiffWithinAt 𝕜 s x)
(hc : DifferentiableWithinAt 𝕜 c s x)
(f : F)


theorem dist_mul_left (k n m : ℕ) : dist (k * n) (k * m) = k * dist n m


theorem AlgebraicIndependent.aeval_comp_repr : (aeval x).comp hx.repr = Subalgebra.val _

{ι : Type u_1}
{R : Type u_3}
{A : Type u_5}
{x : ι → A}
[CommRing R]
[CommRing A]
[Algebra R A]
(hx : AlgebraicIndependent R x)

(MvPolynomial.aeval x).comp hx.repr = (Algebra.adjoin R (Set.range x)).val


@[to_additive (attr := fun_prop, aesop safe 20 apply (rule_sets := [Measurable]))]
theorem AEMeasurable.mul [MeasurableMul₂ M] (hf : AEMeasurable f μ) (hg : AEMeasurable g μ) :
    AEMeasurable (fun a => f a * g a) μ

{M : Type u_2}
{α : Type u_3}
[MeasurableSpace M]
[Add M]
{m : MeasurableSpace α}
{f g : α → M}
{μ : MeasureTheory.Measure α}
[MeasurableAdd₂ M]
(hf : AEMeasurable f μ)
(hg : AEMeasurable g μ)


@[simp]
theorem toIocDiv_add_left (a b : α) : toIocDiv hp a (p + b) = toIocDiv hp a b + 1

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


@[simp] lemma forget_map {X Y : CommRingCat} (f : X ⟶ Y) :
    (forget CommRingCat).map f = (f : X → Y)

(CategoryTheory.forget CommRingCat).map f = ⇑f


/-- The permutation of a type is equivalent to the units group of the endomorphisms monoid of this
type. -/
@[simps]
def equivUnitsEnd : Perm α ≃* Units (Function.End α)

⇑(Equiv.symm (Equiv.Perm.equivUnitsEnd.symm u)) = ↑u⁻¹


@[simp]
theorem eval_append_singleton (x : List α) (a : α) : M.eval (x ++ [a]) = M.stepSet (M.eval x) a

{α : Type u}
{σ : Type v}
(M : NFA α σ)
(x : List α)
(a : α)


@[simp] theorem Subsequent.moveRight_mk_left {xR : xr → PGame} {i : xl} (xL : xl → PGame) (j) :
    Subsequent ((xL i).moveRight j) (mk xl xr xL xR)

{xl xr : Type u}
{xR : xr → SetTheory.PGame}
{i : xl}
(xL : xl → SetTheory.PGame)
(j : (xL i).RightMoves)

((xL i).moveRight j).Subsequent (SetTheory.PGame.mk xl xr xL xR)


theorem powHalf_succ_lt_powHalf (n : ℕ) : powHalf (n + 1) < powHalf n

SetTheory.PGame.powHalf (n + 1) < SetTheory.PGame.powHalf n


/-- If a submodule is contained in a finite-dimensional
submodule with the same dimension, they are equal. -/
theorem eq_of_le_of_finrank_eq {S₁ S₂ : Submodule K V} [FiniteDimensional K S₂] (hle : S₁ ≤ S₂)
    (hd : finrank K S₁ = finrank K S₂) : S₁ = S₂

(hd : FiniteDimensional.finrank K ↥S₁ = FiniteDimensional.finrank K ↥S₂)


@[simp]
lemma nsmul_zmod_val_inv_nsmul (hn : (Nat.card α).Coprime n) (a : α) :
    n • (n⁻¹ : ZMod (Nat.card α)).val • a = a

{α : Type u_1}
[AddGroup α]
{n : ℕ}
(hn : (Nat.card α).Coprime n)
(a : α)


theorem leComap_id : LEComap (.id X) A A

{X : Type u_2}
[TopologicalSpace X]
(A : DiscreteQuotient X)

DiscreteQuotient.LEComap (ContinuousMap.id X) A A


/-- The snake input in the opposite category that is deduced from a snake input. -/
@[simps]
noncomputable def op : SnakeInput Cᵒᵖ

(S : CategoryTheory.ShortComplex.SnakeInput C)


theorem isNat_minFac_1 : {a : ℕ} → IsNat a (nat_lit 1) → IsNat a.minFac 1

Mathlib.Meta.NormNum.IsNat a 1 → Mathlib.Meta.NormNum.IsNat a.minFac 1


@[ext]
theorem ext ⦃f g : M ↪ₑ[L] N⦄ (h : ∀ x, f x = g x) : f = g

{L : FirstOrder.Language}
{M : Type u_1}
{N : Type u_2}
[L.Structure M]
[L.Structure N]
⦃f g : M ↪ₑ[L] N⦄
(h : ∀ (x : M), f x = g x)


theorem exists_C_coeff_not_mem : f ∉ I → ∃ i : ℕ, C (coeff f i) ∉ I

{R : Type u}
[Semiring R]
{f : Polynomial R}
{I : Ideal (Polynomial R)}

f ∉ I → ∃ i, Polynomial.C (f.coeff i) ∉ I


theorem isRoot_root (f : R[X]) : IsRoot (f.map (of f)) (root f)

(Polynomial.map (AdjoinRoot.of f) f).IsRoot (AdjoinRoot.root f)


@[simp]
theorem circleEquivGen_symm_apply (hk : ∀ x : K, 1 + x ^ 2 ≠ 0)
    (v : { p : K × K // p.1 ^ 2 + p.2 ^ 2 = 1 ∧ p.2 ≠ -1 }) :
    (circleEquivGen hk).symm v = (v : K × K).1 / ((v : K × K).2 + 1)

(circleEquivGen hk).symm v = (↑v).1 / ((↑v).2 + 1)


/-- `StarMemClass S G` states `S` is a type of subsets `s ⊆ G` closed under star. -/
class StarMemClass (S R : Type*) [Star R] [SetLike S R] : Prop where
  /-- Closure under star. -/
  star_mem : ∀ {s : S} {r : R}, r ∈ s → star r ∈ s

{S : Type u_1}
{R : Type u_2}
[Star R]
[SetLike S R]
[self : StarMemClass S R]
{s : S}
{r : R}


@[simp] theorem coe_mul (e₁ e₂ : α ≃ᵢ α) : ⇑(e₁ * e₂) = e₁ ∘ e₂

{α : Type u}
[PseudoEMetricSpace α]
(e₁ e₂ : α ≃ᵢ α)

⇑(e₁ * e₂) = ⇑e₁ ∘ ⇑e₂


@[simp]
theorem cobounded_eq_bot : cobounded α = ⊥

(α : Type u_2)
[Bornology α]
[BoundedSpace α]


@[ext]
lemma ext {M : ModuleCat B} {α β : KaehlerDifferential f ⟶ M}
    (h : ∀ (b : B), α (d b) = β (d b)) : α = β

{α β : CommRingCat.KaehlerDifferential f ⟶ M}

(h : ∀ (b : ↑B), α (CommRingCat.KaehlerDifferential.d b) = β (CommRingCat.KaehlerDifferential.d b))


@[to_additive (attr := simp)]
theorem div_left_inj : b / a = c / a ↔ b = c


lemma bddBelow_prod {s : Set (α × β)} :
    BddBelow s ↔ BddBelow (Prod.fst '' s) ∧ BddBelow (Prod.snd '' s)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
{s : Set (α × β)}


theorem natDegree_X_pow_le {R : Type*} [Semiring R] (n : ℕ) : (X ^ n : R[X]).natDegree ≤ n


theorem nhds_left'_eq_nhds_ne (a : Ordinal) : 𝓝[<] a = 𝓝[≠] a


/-- Product of a multiset of elements in a subring of a `CommRing` is in the subring. -/
protected theorem multiset_prod_mem {R} [CommRing R] (s : Subring R) (m : Multiset R) :
    (∀ a ∈ m, a ∈ s) → m.prod ∈ s

{R : Type u_1}
[CommRing R]
(s : Subring R)
(m : Multiset R)


theorem integral_rnDeriv_smul [HaveLebesgueDecomposition μ ν] (hμν : μ ≪ ν)
    [SigmaFinite μ] {f : α → E} :
    ∫ x, (μ.rnDeriv ν x).toReal • f x ∂ν = ∫ x, f x ∂μ

{α : Type u_3}
{m : MeasurableSpace α}
{μ ν : MeasureTheory.Measure α}
{E : Type u_4}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[μ.HaveLebesgueDecomposition ν]
(hμν : μ ≪ ν)
[MeasureTheory.SigmaFinite μ]
{f : α → E}

∫ (x : α), (μ.rnDeriv ν x).toReal • f x ∂ν = ∫ (x : α), f x ∂μ


@[simp]
theorem coe_mem_source : ↑y ∈ e'.source ↔ b ∈ e'.baseSet

(e' : Pretrivialization F Bundle.TotalSpace.proj)

{ proj := b, snd := y } ∈ e'.source ↔ b ∈ e'.baseSet


lemma mono_ac (hf : AEMeasurable f ν) (hμν : μ ≪ ν) : AEMeasurable f μ

{α : Type u_2}
{β : Type u_3}
{m0 : MeasurableSpace α}
[MeasurableSpace β]
{f : α → β}
{μ ν : MeasureTheory.Measure α}
(hf : AEMeasurable f ν)
(hμν : μ ≪ ν)


theorem frobenius_norm_def (A : Matrix m n α) :
    ‖A‖ = (∑ i, ∑ j, ‖A i j‖ ^ (2 : ℝ)) ^ (1 / 2 : ℝ)

{m : Type u_3}
{n : Type u_4}
{α : Type u_5}
[Fintype m]
[Fintype n]
[SeminormedAddCommGroup α]
(A : Matrix m n α)


theorem map_prod_map_coprod_le.{u, v, w, x} {α₁ : Type u} {α₂ : Type v} {β₁ : Type w} {β₂ : Type x}
    {f₁ : Filter α₁} {f₂ : Filter α₂} {m₁ : α₁ → β₁} {m₂ : α₂ → β₂} :
    map (Prod.map m₁ m₂) (f₁.coprod f₂) ≤ (map m₁ f₁).coprod (map m₂ f₂)

Filter.map (Prod.map m₁ m₂) (f₁.coprod f₂) ≤ (Filter.map m₁ f₁).coprod (Filter.map m₂ f₂)


@[to_additive (attr := measurability)]
theorem measurable_one [One α] : Measurable (1 : β → α)

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[MeasurableSpace β]
[Zero α]


lemma isOpen_closedBall {r : ℝ} (hr : r ≠ 0) : IsOpen (closedBall x r)

{X : Type u_1}
[PseudoMetricSpace X]
[IsUltrametricDist X]
(x : X)
{r : ℝ}
(hr : r ≠ 0)


theorem sup_eq_top_iff_isCoprime {R : Type*} [CommSemiring R] (x y : R) :
    span ({x} : Set R) ⊔ span {y} = ⊤ ↔ IsCoprime x y

{R : Type u_2}
[CommSemiring R]
(x y : R)

Ideal.span {x} ⊔ Ideal.span {y} = ⊤ ↔ IsCoprime x y


@[deprecated ofNat'_zero_val (since := "2024-02-22")]
theorem ofNat'_zero_val : (Fin.ofNat' 0 h).val = 0

∀ {a : Nat} {h : a > 0}, ↑(Fin.ofNat' 0 h) = 0


@[simp]
theorem spanSingleton_one : spanSingleton S (1 : P) = 1

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


@[simp]
theorem integerNormalization_coeff (p : S[X]) (i : ℕ) :
    (integerNormalization M p).coeff i = coeffIntegerNormalization M p i

{R : Type u_1}
[CommRing R]
(M : Submonoid R)
{S : Type u_2}
[CommRing S]
[Algebra R S]
[IsLocalization M S]
(p : S[X])
(i : ℕ)

(IsLocalization.integerNormalization M p).coeff i = IsLocalization.coeffIntegerNormalization M p i


/-- The trivial commutative monoid object. We later show this is initial in `CommMon_ C`.
-/
@[simps!]
def trivial : CommMon_ C

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

(CommMon_.trivial C).mul = (λ_ (𝟙_ C)).hom


theorem localization_comap_range [Algebra R S] (M : Submonoid R) [IsLocalization M S] :
    Set.range (comap (algebraMap R S)) = { p | Disjoint (M : Set R) p.asIdeal }

{R : Type u}
(S : Type v)
[CommSemiring R]
[CommSemiring S]
[Algebra R S]
(M : Submonoid R)
[IsLocalization M S]

Set.range ⇑(PrimeSpectrum.comap (algebraMap R S)) = {p | Disjoint ↑M ↑p.asIdeal}


@[simp]
theorem areaForm_rightAngleRotation_left (x y : E) : ω (J x) y = -⟪x, y⟫

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

(o.areaForm (o.rightAngleRotation x)) y = -⟪x, y⟫_ℝ


/-- If a function `f` is strictly monotone on a right neighborhood of `a` and the image of this
neighborhood under `f` includes `Ioi (f a)`, then `f` is continuous at `a` from the right. -/
theorem StrictMonoOn.continuousWithinAt_right_of_surjOn {f : α → β} {s : Set α} {a : α}
    (h_mono : StrictMonoOn f s) (hs : s ∈ 𝓝[≥] a) (hfs : SurjOn f s (Ioi (f a))) :
    ContinuousWithinAt f (Ici a) a

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[TopologicalSpace α]
[OrderTopology α]
[LinearOrder β]
[TopologicalSpace β]
[OrderTopology β]
{f : α → β}
{s : Set α}
{a : α}
(h_mono : StrictMonoOn f s)
(hs : s ∈ 𝓝[≥] a)
(hfs : Set.SurjOn f s (Set.Ioi (f a)))


/-- The data of a comonad on C consists of an endofunctor G together with natural transformations
ε : G ⟶ 𝟭 C and δ : G ⟶ G ⋙ G satisfying three equations:
- δ_X ≫ G δ_X = δ_X ≫ δ_(GX) (coassociativity)
- δ_X ≫ ε_(GX) = 1_X (left counit)
- δ_X ≫ G ε_X = 1_X (right counit)
-/
structure Comonad extends C ⥤ C where
  /-- The counit for the comonad. -/
  ε : toFunctor ⟶ 𝟭 _
  /-- The comultiplication for the comonad. -/
  δ : toFunctor ⟶ toFunctor ⋙ toFunctor
  coassoc : ∀ X, NatTrans.app δ _ ≫ toFunctor.map (δ.app X) = δ.app _ ≫ δ.app _ := by
    aesop_cat
  left_counit : ∀ X : C, δ.app X ≫ ε.app (toFunctor.obj X) = 𝟙 _ := by aesop_cat
  right_counit : ∀ X : C, δ.app X ≫ toFunctor.map (ε.app X) = 𝟙 _ := by aesop_cat

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

CategoryTheory.CategoryStruct.comp (self.δ.app X) (self.map (self.ε.app X)) =
  CategoryTheory.CategoryStruct.id (self.obj X)


lemma shiftIso_add'_inv_app (n m mn : A) (hnm : m + n = mn) (a a' a'' : A)
    (ha' : n + a = a') (ha'' : m + a' = a'') (X : C) :
    (F.shiftIso mn a a'' (by rw [← hnm, ← ha'', ← ha', add_assoc])).inv.app X =
        (F.shiftIso n a a' ha').inv.app X ≫
        ((F.shiftIso m a' a'' ha'').inv.app X)⟦n⟧' ≫
      (shiftFunctorAdd' D m n mn hnm).inv.app ((F.functor a'').obj X)

(F : CategoryTheory.SingleFunctors C D A)

(F.shiftIso mn a a'' ⋯).inv.app X =
  (F.shiftIso n a a' ha').inv.app X ≫
    (CategoryTheory.shiftFunctor D n).map ((F.shiftIso m a' a'' ha'').inv.app X) ≫
      (CategoryTheory.shiftFunctorAdd' D m n mn hnm).inv.app ((F.functor a'').obj X)


/-- The quotient norm of `0` is `0`. -/
theorem norm_mk_zero (S : AddSubgroup M) : ‖(0 : M ⧸ S)‖ = 0

{M : Type u_1}
[SeminormedAddCommGroup M]
(S : AddSubgroup M)


/-- A polynomial splits if and only if it has as many roots as its degree. -/
theorem splits_iff_card_roots {p : K[X]} :
    Splits (RingHom.id K) p ↔ Multiset.card p.roots = p.natDegree

Polynomial.Splits (RingHom.id K) p ↔ Multiset.card p.roots = p.natDegree


lemma card_le_chromaticNumber_iff_forall_surjective [Fintype α] :
    card α ≤ G.chromaticNumber ↔ ∀ C : G.Coloring α, Surjective C

{V : Type u}
{G : SimpleGraph V}
{α : Type u_1}
[Fintype α]

↑(Fintype.card α) ≤ G.chromaticNumber ↔ ∀ (C : G.Coloring α), Function.Surjective ⇑C


@[to_additive]
theorem mem_sSup_of_directed_on {S : Set (Subsemigroup M)} (hS : DirectedOn (· ≤ ·) S) {x : M} :
    x ∈ sSup S ↔ ∃ s ∈ S, x ∈ s

(hS : DirectedOn (fun x x_1 => x ≤ x_1) S)


/-- Each element of the group defines a linear equivalence.

This is a stronger version of `DistribMulAction.toAddEquiv`. -/
@[simps!]
def toLinearEquiv (s : S) : M ≃ₗ[R] M

(R : Type u_1)
{S : Type u_7}
(M : Type u_8)
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Group S]
[DistribMulAction S M]
[SMulCommClass S R M]
(s : S)

∀ (a : M), (DistribMulAction.toLinearEquiv R M s).symm a = s⁻¹ • a


/-- Extended norm on a vector space. As in the case of normed spaces, we require only
`‖c • x‖ ≤ ‖c‖ * ‖x‖` in the definition, then prove an equality in `map_smul`. -/
structure ENorm (𝕜 : Type*) (V : Type*) [NormedField 𝕜] [AddCommGroup V] [Module 𝕜 V] where
  toFun : V → ℝ≥0∞
  eq_zero' : ∀ x, toFun x = 0 → x = 0
  map_add_le' : ∀ x y : V, toFun (x + y) ≤ toFun x + toFun y
  map_smul_le' : ∀ (c : 𝕜) (x : V), toFun (c • x) ≤ ‖c‖₊ * toFun x

{𝕜 : Type u_1}
{V : Type u_2}
[NormedField 𝕜]
[AddCommGroup V]
[Module 𝕜 V]
(self : ENorm 𝕜 V)
(x y : V)


/-- The position of the orthocenter in relation to the circumcenter
and centroid. -/
theorem orthocenter_eq_smul_vsub_vadd_circumcenter (t : Triangle ℝ P) :
    t.orthocenter =
      (3 : ℝ) • ((univ : Finset (Fin 3)).centroid ℝ t.points -ᵥ t.circumcenter : V) +ᵥ
        t.circumcenter

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
(t : Affine.Triangle ℝ P)

t.orthocenter =
  3 • (Finset.centroid ℝ Finset.univ t.points -ᵥ Affine.Simplex.circumcenter t) +ᵥ Affine.Simplex.circumcenter t


protected theorem LocallyIntegrableOn.add
    (hf : LocallyIntegrableOn f s μ) (hg : LocallyIntegrableOn g s μ) :
    LocallyIntegrableOn (f + g) s μ

(hf : MeasureTheory.LocallyIntegrableOn f s μ)

(hg : MeasureTheory.LocallyIntegrableOn g s μ)

MeasureTheory.LocallyIntegrableOn (f + g) s μ


/-- The inverse of `rotation` is rotation by the negation of the angle. -/
@[simp]
theorem rotation_symm (θ : Real.Angle) : (o.rotation θ).symm = o.rotation (-θ)

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


/-- Generalized eigenspaces for exponents at least `finrank K V` are equal to each other. -/
theorem genEigenspace_eq_genEigenspace_finrank_of_le [FiniteDimensional K V]
    (f : End K V) (μ : K) {k : ℕ} (hk : finrank K V ≤ k) :
    f.genEigenspace μ k = f.genEigenspace μ (finrank K V)

(hk : FiniteDimensional.finrank K V ≤ k)

(f.genEigenspace μ) k = (f.genEigenspace μ) (FiniteDimensional.finrank K V)


theorem computable_iff_re_compl_re {p : α → Prop} [DecidablePred p] :
    ComputablePred p ↔ RePred p ∧ RePred fun a => ¬p a

{α : Type u_1}
[Primcodable α]
{p : α → Prop}
[DecidablePred p]


@[to_additive (attr := simp)]
lemma unitsLift_symm_apply_apply_inv' (f : C(X, M)ˣ) (x : X) :
    (ContinuousMap.unitsLift.symm f x)⁻¹ = (↑f⁻¹ : C(X, M)) x

{X : Type u_1}
{M : Type u_2}
[TopologicalSpace X]
[Monoid M]
[TopologicalSpace M]
[ContinuousMul M]
(f : C(X, M)ˣ)
(x : X)

↑((ContinuousMap.unitsLift.symm f) x)⁻¹ = ↑f⁻¹ x


theorem mk_coordChange (a : VectorPrebundle R F E) {e e' : Pretrivialization F (π F E)}
    (he : e ∈ a.pretrivializationAtlas) (he' : e' ∈ a.pretrivializationAtlas) {b : B}
    (hb : b ∈ e.baseSet ∩ e'.baseSet) (v : F) :
    (b, a.coordChange he he' b v) = e' ⟨b, e.symm b v⟩

{e e' : Pretrivialization F Bundle.TotalSpace.proj}

(b, (a.coordChange he he' b) v) = ↑e' { proj := b, snd := e.symm b v }


@[simp]
theorem differentiableWithinAt_const_sub_iff (c : F) :
    DifferentiableWithinAt 𝕜 (fun y => c - f y) s x ↔ DifferentiableWithinAt 𝕜 f s x

{𝕜 : 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}
(c : F)


theorem le_iff_subset {s₁ s₂ : Finset α} : s₁ ≤ s₂ ↔ s₁ ⊆ s₂

s₁ ≤ s₂ ↔ s₁ ⊆ s₂


theorem condexp_congr_ae (h : f =ᵐ[μ] g) : μ[f|m] =ᵐ[μ] μ[g|m]

{α : Type u_1}
{F' : Type u_3}
[NormedAddCommGroup F']
[NormedSpace ℝ F']
[CompleteSpace F']
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f g : α → F'}
(h : f =ᵐ[μ] g)


@[to_additive]
lemma mabs_div_sup_mul_mabs_div_inf (a b c : α) :
    |(a ⊔ c) / (b ⊔ c)|ₘ * |(a ⊓ c) / (b ⊓ c)|ₘ = |a / b|ₘ

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

mabs ((a ⊔ c) / (b ⊔ c)) * mabs ((a ⊓ c) / (b ⊓ c)) = mabs (a / b)


theorem nonempty_of_pos_sInf {s : Set ℕ} (h : 0 < sInf s) : s.Nonempty


theorem sSup_def (S : Set ℝ) :
    sSup S = if h : S.Nonempty ∧ BddAbove S then Classical.choose (exists_isLUB h.1 h.2) else 0

sSup S = if h : S.Nonempty ∧ BddAbove S then Classical.choose ⋯ else 0


@[to_additive (attr := simp)]
theorem map_apply_inr (f : M →* M') (g : N →* N') (x : N) : map f g (inr x) = inr (g x)

{M : Type u_1}
{N : Type u_2}
{M' : Type u_3}
{N' : Type u_4}
[MulOneClass M]
[MulOneClass N]
[MulOneClass M']
[MulOneClass N']
(f : M →* M')
(g : N →* N')
(x : N)

(Monoid.Coprod.map f g) (Monoid.Coprod.inr x) = Monoid.Coprod.inr (g x)


theorem homothety_isOpenMap (x : F) (t : R) (ht : t ≠ 0) : IsOpenMap <| homothety x t

{R : Type u_1}
{F : Type u_3}
[AddCommGroup F]
[TopologicalSpace F]
[TopologicalAddGroup F]
[Field R]
[Module R F]
[ContinuousConstSMul R F]
(x : F)
(t : R)
(ht : t ≠ 0)


lemma antivary_iff_forall_smul_nonpos : Antivary f g ↔ ∀ i j, (f j - f i) • (g j - g i) ≤ 0

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[LinearOrderedRing α]
[LinearOrderedAddCommGroup β]
[Module α β]
[OrderedSMul α β]
{f : ι → α}
{g : ι → β}

Antivary f g ↔ ∀ (i j : ι), (f j - f i) • (g j - g i) ≤ 0


theorem AccPt.clusterPt (x : X) (F : Filter X) (h : AccPt x F) : ClusterPt x F

{X : Type u}
[TopologicalSpace X]
(x : X)
(F : Filter X)
(h : AccPt x F)


lemma LSeries.term_sub (f g : ℕ → ℂ) (s : ℂ) : term (f - g) s = term f s - term g s

LSeries.term (f - g) s = LSeries.term f s - LSeries.term g s


lemma sq_lt_sq : a ^ 2 < b ^ 2 ↔ |a| < |b|

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


@[simp]
theorem Sentence.realize_not {φ : L.Sentence} : M ⊨ φ.not ↔ ¬M ⊨ φ

{L : FirstOrder.Language}
(M : Type w)
[L.Structure M]
{φ : L.Sentence}

M ⊨ FirstOrder.Language.Formula.not φ ↔ ¬M ⊨ φ


theorem Multiplicative.isSubgroup_iff {s : Set A} :
    @IsSubgroup (Multiplicative A) _ s ↔ IsAddSubgroup s


theorem tendsto_inf_right {f : α → β} {x₁ x₂ : Filter α} {y : Filter β} (h : Tendsto f x₂ y) :
    Tendsto f (x₁ ⊓ x₂) y

{α : Type u}
{β : Type v}
{f : α → β}
{x₁ x₂ : Filter α}
{y : Filter β}
(h : Filter.Tendsto f x₂ y)


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

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]

GaloisConnection (StarAlgebra.adjoin R) SetLike.coe


/-- Two elements are related by a congruence relation `c` iff they are represented by the same
    element of the quotient by `c`. -/
@[to_additive (attr := simp) "Two elements are related by an additive congruence relation `c` iff
they are represented by the same element of the quotient by `c`."]
protected theorem eq {a b : M} : (a : c.Quotient) = (b : c.Quotient) ↔ c a b

{M : Type u_1}
[Mul M]
(c : Con M)
{a b : M}


/-- The morphism between Čech nerves associated to a morphism of arrows. -/
@[simps]
def mapCechNerve {f g : Arrow C}
    [∀ n : ℕ, HasWidePullback f.right (fun _ : Fin (n + 1) => f.left) fun _ => f.hom]
    [∀ n : ℕ, HasWidePullback g.right (fun _ : Fin (n + 1) => g.left) fun _ => g.hom] (F : f ⟶ g) :
    f.cechNerve ⟶ g.cechNerve

[∀ (n : ℕ), CategoryTheory.Limits.HasWidePullback f.right (fun x => f.left) fun x => f.hom]

[∀ (n : ℕ), CategoryTheory.Limits.HasWidePullback g.right (fun x => g.left) fun x => g.hom]

(CategoryTheory.Arrow.mapCechNerve F).app n =
  CategoryTheory.Limits.WidePullback.lift ((CategoryTheory.Limits.WidePullback.base fun x => f.hom) ≫ F.right)
    (fun i => CategoryTheory.Limits.WidePullback.π (fun x => f.hom) i ≫ F.left) ⋯


private lemma image_subtype_val_Ixx_Iix {p q r : α → α → Prop} {a b : α} (c : {x // p a x ∧ q x b})
    (h : ∀ {x}, r x c → q x b) :
    Subtype.val '' {y : {x // p a x ∧ q x b} | r y.1 c.1} = {y : α | p a y ∧ r y c.1}

{α : Type u_1}
{p q r : α → α → Prop}
{a b : α}
(c : { x // p a x ∧ q x b })
(h : ∀ {x : α}, r x ↑c → q x b)

Subtype.val '' {y | r ↑y ↑c} = {y | p a y ∧ r y ↑c}


lemma isPiSystem (hC : IsSetSemiring C) : IsPiSystem C

{α : Type u_1}
{C : Set (Set α)}
(hC : MeasureTheory.IsSetSemiring C)


theorem c_div_pf [Div α] (p : b = c) (a : α) : a / b = a / c

{α : Type u_1}
{b c : α}
[Div α]
(p : b = c)
(a : α)


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

See `Fintype.card_equiv` for the version where `s` and `t` are `univ`. -/
lemma card_equiv (e : α ≃ β) (hst : ∀ i, i ∈ s ↔ e i ∈ t) : s.card = t.card

{α : Type u_1}
{β : Type u_2}
{s : Finset α}
{t : Finset β}
(e : α ≃ β)
(hst : ∀ (i : α), i ∈ s ↔ e i ∈ t)


@[simp]
theorem eval₂_at_zero : p.eval₂ f 0 = f (coeff p 0)

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


@[simp]
theorem conj_conj (z : 𝔻) : conj (conj z) = z


theorem algebraMap_eq_inl : ⇑(algebraMap R (Unitization R A)) = inl

(R : Type u_2)
(A : Type u_3)
[CommSemiring R]
[NonUnitalSemiring A]
[Module R A]
[IsScalarTower R A A]
[SMulCommClass R A A]

⇑(algebraMap R (Unitization R A)) = Unitization.inl


theorem indep_of_forall_finite_subset_indep {M : Matroid α} [Finitary M] (I : Set α)
    (h : ∀ J, J ⊆ I → J.Finite → M.Indep J) : M.Indep I

{α : Type u_1}
{M : Matroid α}
[M.Finitary]
(I : Set α)
(h : ∀ J ⊆ I, J.Finite → M.Indep J)


theorem EventuallyEq.sup [Sup β] {l : Filter α} {f f' g g' : α → β} (hf : f =ᶠ[l] f')
    (hg : g =ᶠ[l] g') : (fun x => f x ⊔ g x) =ᶠ[l] fun x => f' x ⊔ g' x

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


@[simp] theorem logDeriv_id' (x : 𝕜) : logDeriv (·) x = 1 / x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
(x : 𝕜)


theorem Ico_add_Ico_eq_Ico {a b c : α} (hab : a ≤ b) (hbc : b ≤ c) :
    Ico a b + Ico b c = Ico a c

{α : Type u_1}
[LinearOrder α]
[LocallyFiniteOrder α]
{a b c : α}
(hab : a ≤ b)
(hbc : b ≤ c)

Multiset.Ico a b + Multiset.Ico b c = Multiset.Ico a c


@[to_additive AddCommute.zsmul_add]
protected lemma mul_zpow (h : Commute a b) : ∀ n : ℤ, (a * b) ^ n = a ^ n * b ^ n

{G : Type u_1}
[SubtractionMonoid G]
{a b : G}
(h : AddCommute a b)
(n : ℤ)


lemma sSup_prod [SupSet α] [SupSet β] {s : Set α} {t : Set β} (hs : s.Nonempty) (ht : t.Nonempty) :
    sSup (s ×ˢ t) = (sSup s, sSup t)

{α : Type u_1}
{β : Type u_2}
[SupSet α]
[SupSet β]
{s : Set α}
{t : Set β}
(hs : s.Nonempty)
(ht : t.Nonempty)


lemma IsMeasurableRatCDF.tendsto_atTop_one {f : α → ℚ → ℝ} (hf : IsMeasurableRatCDF f) (a : α) :
    Tendsto (f a) atTop (𝓝 1)

{f : α → ℚ → ℝ}

(hf : ProbabilityTheory.IsMeasurableRatCDF f)


theorem Icc_union_Icc' (h₁ : c ≤ b) (h₂ : a ≤ d) : Icc a b ∪ Icc c d = Icc (min a c) (max b d)

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

Set.Icc a b ∪ Set.Icc c d = Set.Icc (min a c) (max b d)


/-- `LocallyConstant.comap` as a linear map. -/
@[simps!]
def comapₗ (R : Type*) [Semiring R] [AddCommMonoid Z] [Module R Z] (f : C(X, Y)) :
    LocallyConstant Y Z →ₗ[R] LocallyConstant X Z

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{Z : Type u_6}
(R : Type u_7)
[Semiring R]
[AddCommMonoid Z]
[Module R Z]
(f : C(X, Y))
(g : LocallyConstant Y Z)

∀ (a : X), ((LocallyConstant.comapₗ R f) g) a = g (f a)


theorem geom_sum₂_with_one (x : α) (n : ℕ) :
    ∑ i ∈ range n, x ^ i * 1 ^ (n - 1 - i) = ∑ i ∈ range n, x ^ i

{α : Type u}
[Semiring α]
(x : α)
(n : ℕ)

∑ i ∈ Finset.range n, x ^ i * 1 ^ (n - 1 - i) = ∑ i ∈ Finset.range n, x ^ i


theorem subset_mapRange_neLocus [∀ a, DecidableEq (N a)] [∀ a, DecidableEq (M a)] (f g : Π₀ a, N a)
    {F : ∀ a, N a → M a} (F0 : ∀ a, F a 0 = 0) :
    (f.mapRange F F0).neLocus (g.mapRange F F0) ⊆ f.neLocus g

{α : Type u_1}
{N : α → Type u_2}
[DecidableEq α]
{M : α → Type u_3}
[(a : α) → Zero (N a)]
[(a : α) → Zero (M a)]
[(a : α) → DecidableEq (N a)]
[(a : α) → DecidableEq (M a)]
(f g : Π₀ (a : α), N a)
{F : (a : α) → N a → M a}
(F0 : ∀ (a : α), F a 0 = 0)

(DFinsupp.mapRange F F0 f).neLocus (DFinsupp.mapRange F F0 g) ⊆ f.neLocus g


@[simp] lemma strictMono_vecCons : StrictMono (vecCons a f) ↔ a < f 0 ∧ StrictMono f

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

StrictMono (Matrix.vecCons a f) ↔ a < f 0 ∧ StrictMono f


@[simp]
theorem ofReal_tan_ofReal_re (x : ℝ) : ((tan x).re : ℂ) = tan x


/-- Given a Localization map `f : M →* N` for a Submonoid `S ⊆ M`, if a `CommMonoid` map
`g : M →* P` induces a map `f.lift hg : N →* P` then for all `z : N, v w : P`, we have
`f.lift hg z * w = v ↔ g x * w = g y * v`, where `x : M, y ∈ S` are such that
`z * f y = f x`. -/
@[to_additive
    "Given a Localization map `f : M →+ N` for a Submonoid `S ⊆ M`, if an `AddCommMonoid` map
`g : M →+ P` induces a map `f.lift hg : N →+ P` then for all
`z : N, v w : P`, we have `f.lift hg z + w = v ↔ g x + w = g y + v`, where `x : M, y ∈ S` are such
that `z + f y = f x`."]
theorem lift_spec_mul (z w v) : f.lift hg z * w = v ↔ g (f.sec z).1 * w = g (f.sec z).2 * v

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
{P : Type u_3}
[AddCommMonoid P]
(f : S.LocalizationMap N)
{g : M →+ P}
(hg : ∀ (y : ↥S), IsAddUnit (g ↑y))
(z : N)
(w v : P)

(f.lift hg) z + w = v ↔ g (f.sec z).1 + w = g ↑(f.sec z).2 + v


@[simp]
theorem fst_natCast (n : ℕ) : (n : α × β).fst = n

{α : Type u_1}
{β : Type u_2}
[AddMonoidWithOne α]
[AddMonoidWithOne β]
(n : ℕ)


@[to_additive (attr := simp)]
theorem inclusion_mk {h : H ≤ K} (x : G) (hx : x ∈ H) : inclusion h ⟨x, hx⟩ = ⟨x, h hx⟩

{G : Type u_1}
[AddGroup G]
{S : Type u_6}
{H K : S}
[SetLike S G]
[AddSubgroupClass S G]
{h : H ≤ K}
(x : G)
(hx : x ∈ H)

(AddSubgroupClass.inclusion h) ⟨x, hx⟩ = ⟨x, ⋯⟩


theorem eventually_residual_irrational : ∀ᶠ x in residual ℝ, Irrational x


@[simp]
theorem Filter.mem_ofCountableInter {l : Set (Set α)}
    (hl : ∀ S : Set (Set α), S.Countable → S ⊆ l → ⋂₀ S ∈ l) (h_mono : ∀ s t, s ∈ l → s ⊆ t → t ∈ l)
    {s : Set α} : s ∈ Filter.ofCountableInter l hl h_mono ↔ s ∈ l

(hl : ∀ (S : Set (Set α)), S.Countable → S ⊆ l → ⋂₀ S ∈ l)

(h_mono : ∀ (s t : Set α), s ∈ l → s ⊆ t → t ∈ l)


theorem isCoprime_group_smul_right : IsCoprime y (x • z) ↔ IsCoprime y z

{R : Type u_1}
{G : Type u_2}
[CommSemiring R]
[Group G]
[MulAction G R]
[SMulCommClass G R R]
[IsScalarTower G R R]
(x : G)
(y z : R)


theorem IsClosed.lowerSemicontinuousWithinAt_indicator (hs : IsClosed s) (hy : y ≤ 0) :
    LowerSemicontinuousWithinAt (indicator s fun _x => y) t x

{α : Type u_1}
[TopologicalSpace α]
{β : Type u_2}
[Preorder β]
{x : α}
{s t : Set α}
{y : β}
[Zero β]
(hs : IsClosed s)
(hy : y ≤ 0)

LowerSemicontinuousWithinAt (s.indicator fun _x => y) t x


lemma of_abv_le (n : ℕ) (hm : ∀ m, n ≤ m → abv (f m) ≤ a m) :
    IsCauSeq abs (fun n ↦ ∑ i ∈ range n, a i) → IsCauSeq abv fun n ↦ ∑ i ∈ range n, f i

(hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m)

(IsCauSeq abs fun n => ∑ i ∈ Finset.range n, a i) → IsCauSeq abv fun n => ∑ i ∈ Finset.range n, f i


theorem sum_apply [Countable ι] (κ : ι → Kernel α β) (a : α) :
    Kernel.sum κ a = Measure.sum fun n => κ n a

{α : Type u_1}
{β : Type u_2}
{ι : Type u_3}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
[Countable ι]
(κ : ι → ProbabilityTheory.Kernel α β)
(a : α)

(ProbabilityTheory.Kernel.sum κ) a = MeasureTheory.Measure.sum fun n => (κ n) a


lemma ih1 (ih : ∀ a, ArgsRel a (Args.P1 x y) → P124 a) : IH1 x y

(ih :
  ∀ (a : Surreal.Multiplication.Args),
    Surreal.Multiplication.ArgsRel a (Surreal.Multiplication.Args.P1 x y) → Surreal.Multiplication.P124 a)


@[reassoc]
lemma L₀X₂ToP_comp_pullback_snd : S.L₀X₂ToP ≫ pullback.snd _ _ = S.L₀.g

(S : CategoryTheory.ShortComplex.SnakeInput C)

CategoryTheory.CategoryStruct.comp S.L₀X₂ToP (CategoryTheory.Limits.pullback.snd S.L₁.g S.v₀₁.τ₃) = S.L₀.g


@[simp]
theorem gcd_cons (a : α) (s : Multiset α) : (a ::ₘ s).gcd = GCDMonoid.gcd a s.gcd

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


theorem lintegral_biUnion {t : Set β} {s : β → Set α} (ht : t.Countable)
    (hm : ∀ i ∈ t, MeasurableSet (s i)) (hd : t.PairwiseDisjoint s) (f : α → ℝ≥0∞) :
    ∫⁻ a in ⋃ i ∈ t, s i, f a ∂μ = ∑' i : t, ∫⁻ a in s i, f a ∂μ

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{t : Set β}
{s : β → Set α}
(ht : t.Countable)
(hm : ∀ i ∈ t, MeasurableSet (s i))
(hd : t.PairwiseDisjoint s)
(f : α → ℝ≥0∞)

∫⁻ (a : α) in ⋃ i ∈ t, s i, f a ∂μ = ∑' (i : ↑t), ∫⁻ (a : α) in s ↑i, f a ∂μ


@[simp]
theorem not_isMin_of_lt (h : b < a) : ¬IsMin a

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


@[simp]
theorem neighborSet_sSup (s : Set G.Subgraph) (v : V) :
    (sSup s).neighborSet v = ⋃ G' ∈ s, neighborSet G' v

{V : Type u}
{G : SimpleGraph V}
(s : Set G.Subgraph)
(v : V)

(sSup s).neighborSet v = ⋃ G' ∈ s, G'.neighborSet v


@[to_additive le_sum_of_subadditive]
lemma le_prod_of_submultiplicative (f : α → β) (h_one : f 1 = 1)
    (h_mul : ∀ a b, f (a * b) ≤ f a * f b) (s : Multiset α) : f s.prod ≤ (s.map f).prod

(h_mul : ∀ (a b : α), f (a * b) ≤ f a * f b)


/-- Construct a cone on `F` from an object of the category `(Δ ↓ F)`. This is part of an
    equivalence, see `Cone.equivCostructuredArrow`. -/
@[simps]
def Cone.fromCostructuredArrow (F : J ⥤ C) : CostructuredArrow (const J) F ⥤ Cone F

(c : CategoryTheory.CostructuredArrow (CategoryTheory.Functor.const J) F)

((CategoryTheory.Limits.Cone.fromCostructuredArrow F).obj c).pt = c.left


lemma of_isPullback {UX UY : Scheme.{u}} {iY : UY ⟶ Y} [IsOpenImmersion iY]
    {iX : UX ⟶ X} {f' : UX ⟶ UY} (h : IsPullback iX f' f iY) (H : P f) : P f'

{P : CategoryTheory.MorphismProperty AlgebraicGeometry.Scheme}

[hP : AlgebraicGeometry.IsLocalAtTarget P]

(h : CategoryTheory.IsPullback iX f' f iY)


@[mono, gcongr]
theorem join_mono {f₁ f₂ : Filter (Filter α)} (h : f₁ ≤ f₂) : join f₁ ≤ join f₂

{α : Type u}
{f₁ f₂ : Filter (Filter α)}
(h : f₁ ≤ f₂)


lemma isoZeroCocycles_hom_comp_subtype :
    (isoZeroCocycles A).hom ≫ A.ρ.invariants.subtype =
      iCocycles A 0 ≫ (zeroCochainsLequiv A).toModuleIso.hom

{k G : Type u}
[CommRing k]
[Group G]
(A : Rep k G)

(groupCohomology.isoZeroCocycles A).hom ≫ A.ρ.invariants.subtype =
  groupCohomology.iCocycles A 0 ≫ (groupCohomology.zeroCochainsLequiv A).toModuleIso.hom


theorem Indep.indepSet_of_measurableSet
    (h_indep : Indep m₁ m₂ μ) {s t : Set Ω} (hs : MeasurableSet[m₁] s) (ht : MeasurableSet[m₂] t) :
    IndepSet s t μ

(h_indep : ProbabilityTheory.Indep m₁ m₂ μ)


theorem commute_sub_nat (n : ℕ) : Function.Commute f (· - n)


theorem RelEmbedding.inter_preimage_maximals_eq_of_subset {y : Set β} {x : Set α}
    (f : r ↪r s) (h : y ⊆ f '' x) : x ∩ f ⁻¹' (maximals s y) = maximals r (x ∩ f ⁻¹' y)

{α : Type u_1}
{β : Type u_2}
{r : α → α → Prop}
{s : β → β → Prop}
{y : Set β}
{x : Set α}
(f : r ↪r s)
(h : y ⊆ ⇑f '' x)

x ∩ ⇑f ⁻¹' maximals s y = maximals r (x ∩ ⇑f ⁻¹' y)


nonrec theorem norm_integral_le_of_norm_le {g : ℝ → ℝ} (h : ∀ᵐ t ∂μ.restrict <| Ι a b, ‖f t‖ ≤ g t)
    (hbound : IntervalIntegrable g μ a b) : ‖∫ t in a..b, f t ∂μ‖ ≤ |∫ t in a..b, g t ∂μ|

(h : ∀ᵐ (t : ℝ) ∂μ.restrict (Ι a b), ‖f t‖ ≤ g t)

‖∫ (t : ℝ) in a..b, f t ∂μ‖ ≤ |∫ (t : ℝ) in a..b, g t ∂μ|


@[simp] theorem maybeNormalize_eq {num den g} (den_nz reduced) :
    maybeNormalize num den g den_nz reduced =
    { num := num.div g, den := den / g, den_nz, reduced }

(reduced : (num.div ↑g).natAbs.Coprime (den / g))

Rat.maybeNormalize num den g den_nz reduced =
  { num := num.div ↑g, den := den / g, den_nz := den_nz, reduced := reduced }


theorem EventuallyEq.fun_comp {f g : α → β} {l : Filter α} (H : f =ᶠ[l] g) (h : β → γ) :
    h ∘ f =ᶠ[l] h ∘ g

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


@[simp]
theorem inducing_const_prod {x : X} {f : Y → Z} : (Inducing fun x' => (x, f x')) ↔ Inducing f

{X : Type u}
{Y : Type v}
{Z : Type u_1}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
{x : X}
{f : Y → Z}


theorem Basis.localizationLocalization_span {ι : Type*} (b : Basis ι R A) :
    Submodule.span R (Set.range (b.localizationLocalization Rₛ S Aₛ)) =
      LinearMap.range (IsScalarTower.toAlgHom R A Aₛ)

[hA : IsLocalization (Algebra.algebraMapSubmonoid A S) Aₛ]

Submodule.span R (Set.range ⇑(Basis.localizationLocalization Rₛ S Aₛ b)) =
  LinearMap.range (IsScalarTower.toAlgHom R A Aₛ)


@[simp]
theorem coe_mk {f} {h} : ⇑(⟨f, h⟩ : r ↪r s) = f

{h : ∀ {a b : α}, s (f a) (f b) ↔ r a b}

⇑{ toEmbedding := f, map_rel_iff' := h } = ⇑f


@[simp] lemma log_zero_left : ∀ n, log 0 n = 0


theorem Tendsto.atTop_zsmul_neg_const {f : α → ℤ} (hr : r < 0) (hf : Tendsto f l atTop) :
    Tendsto (fun x => f x • r) l atBot

{α : Type u_1}
{R : Type u_2}
{l : Filter α}
{r : R}
[LinearOrderedAddCommGroup R]
[Archimedean R]
{f : α → ℤ}
(hr : r < 0)
(hf : Filter.Tendsto f l Filter.atTop)

Filter.Tendsto (fun x => f x • r) l Filter.atBot


theorem maximum?_eq_some_iff' {xs : List Nat} :
    xs.maximum? = some a ↔ (a ∈ xs ∧ ∀ b ∈ xs, b ≤ a)

xs.maximum? = some a ↔ a ∈ xs ∧ ∀ (b : Nat), b ∈ xs → b ≤ a


theorem exists_cons_of_length_eq_add_one :
    ∀ {l : List α}, l.length = n + 1 → ∃ h t, l = h :: t


protected theorem sub (hf : UnifTight f p μ) (hg : UnifTight g p μ)
    (hf_meas : ∀ i, AEStronglyMeasurable (f i) μ) (hg_meas : ∀ i, AEStronglyMeasurable (g i) μ) :
    UnifTight (f - g) p μ

{f g : ι → α → β}

(hf_meas : ∀ (i : ι), MeasureTheory.AEStronglyMeasurable (f i) μ)

(hg_meas : ∀ (i : ι), MeasureTheory.AEStronglyMeasurable (g i) μ)


@[to_additive]
theorem mul_inv_le_iff_le_mul' : a * b⁻¹ ≤ c ↔ a ≤ b * c

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


/-- The type of morphisms in the category `Φ.LeftResolution X₂` (when `W₁` is multiplicative). -/
@[ext]
structure Hom (L L' : Φ.LeftResolution X₂) where
  /-- a morphism in the source category -/
  f : L.X₁ ⟶ L'.X₁
  hf : W₁ f
  comm : Φ.functor.map f ≫ L'.w = L.w := by aesop_cat

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

{Φ : CategoryTheory.LocalizerMorphism W₁ W₂}

CategoryTheory.CategoryStruct.comp (Φ.functor.map self.f) L'.w = L.w


/-- If a product of a `Finset` of size at most 1 has a given value, so
do the terms in that product. -/
@[to_additive eq_of_card_le_one_of_sum_eq "If a sum of a `Finset` of size at most 1 has a given
value, so do the terms in that sum."]
theorem eq_of_card_le_one_of_prod_eq {s : Finset α} (hc : s.card ≤ 1) {f : α → β} {b : β}
    (h : ∏ x ∈ s, f x = b) : ∀ x ∈ s, f x = b

{α : Type u_3}
{β : Type u_4}
[AddCommMonoid β]
{s : Finset α}
(hc : s.card ≤ 1)
{f : α → β}
{b : β}
(h : ∑ x ∈ s, f x = b)
(x : α)


theorem support_subset_singleton' {f : α →₀ M} {a : α} : f.support ⊆ {a} ↔ ∃ b, f = single a b

{α : Type u_1}
{M : Type u_5}
[Zero M]
{f : α →₀ M}
{a : α}

f.support ⊆ {a} ↔ ∃ b, f = Finsupp.single a b


@[simp]
theorem image2_singleton_left : image2 f {a} t = f a '' t

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
{f : α → β → γ}
{t : Set β}
{a : α}


theorem one_le_inv_iff : 1 ≤ a⁻¹ ↔ 0 < a ∧ a ≤ 1

{α : Type u_2}
[LinearOrderedSemifield α]
{a : α}


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

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


theorem any_singleton {P : α → Prop} {x : α} : Any P (singleton x) ↔ P x


theorem Continuous.image_eq_of_connectedComponent_eq (h : Continuous f) (a b : α)
    (hab : connectedComponent a = connectedComponent b) : f a = f b


/-- Classification of prime ideals in product rings: the prime ideals of `R × S` are precisely the
    ideals of the form `p × S` or `R × p`, where `p` is a prime ideal of `R` or `S`. -/
theorem ideal_prod_prime (I : Ideal (R × S)) :
    I.IsPrime ↔
      (∃ p : Ideal R, p.IsPrime ∧ I = Ideal.prod p ⊤) ∨
        ∃ p : Ideal S, p.IsPrime ∧ I = Ideal.prod ⊤ p

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

I.IsPrime ↔ (∃ p, p.IsPrime ∧ I = p.prod ⊤) ∨ ∃ p, p.IsPrime ∧ I = ⊤.prod p


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


theorem measurableCylinders.eq_cylinder (ht : t ∈ measurableCylinders α) :
    t = cylinder (measurableCylinders.finset ht) (measurableCylinders.set ht)

(ht : t ∈ MeasureTheory.measurableCylinders α)

t = MeasureTheory.cylinder (MeasureTheory.measurableCylinders.finset ht) (MeasureTheory.measurableCylinders.set ht)


@[simp]
lemma coroot_zero [Nontrivial L] : coroot (0 : Weight K H L) = 0

{K : Type u_2}
{L : Type u_3}
[LieRing L]
[Field K]
[LieAlgebra K L]
[FiniteDimensional K L]
{H : LieSubalgebra K L}
[H.IsCartanSubalgebra]
[LieModule.IsTriangularizable K (↥H) L]
[LieAlgebra.IsKilling K L]
[CharZero K]
[Nontrivial L]


@[simp] lemma val_eq_cast (q : ℚ≥0) : q.1 = q


@[simp] theorem div_val (a b : Fin n) : (a / b).val = a.val / b.val


theorem iSup_subtype {p : ι → Prop} {f : Subtype p → α} : iSup f = ⨆ (i) (h : p i), f ⟨i, h⟩

{α : Type u_1}
{ι : Sort u_5}
[CompleteLattice α]
{p : ι → Prop}
{f : Subtype p → α}


theorem coe_finset_sum [AddCommMonoid N] (S : Finset ι) (f : ι → α →₀ N) :
    ⇑(∑ i ∈ S, f i) = ∑ i ∈ S, ⇑(f i)

{α : Type u_1}
{ι : Type u_2}
{N : Type u_10}
[AddCommMonoid N]
(S : Finset ι)
(f : ι → α →₀ N)


/-- A partition of `n` is a multiset of positive integers summing to `n`. -/
@[ext]
structure Partition (n : ℕ) where
  /-- positive integers summing to `n`-/
  parts : Multiset ℕ
  /-- proof that the `parts` are positive-/
  parts_pos : ∀ {i}, i ∈ parts → 0 < i
  /-- proof that the `parts` sum to `n`-/
  parts_sum : parts.sum = n


/-- Given a representation of a Lie algebra with distinguished `sl₂` triple, a vector is said to be
primitive if it is a simultaneous eigenvector for the action of both `h`, `e`, and the eigenvalue
for `e` is zero. -/
structure HasPrimitiveVectorWith (t : IsSl2Triple h e f) (m : M) (μ : R) : Prop where
  ne_zero : m ≠ 0
  lie_h : ⁅h, m⁆ = μ • m
  lie_e : ⁅e, m⁆ = 0

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
{h e f : L}
{t : IsSl2Triple h e f}
{m : M}
{μ : R}
(self : t.HasPrimitiveVectorWith m μ)


@[to_additive (attr := simp, norm_cast)]
theorem prod_coe (l : List α) : prod ↑l = l.prod

{α : Type u_3}
[CommMonoid α]
(l : List α)


@[simp]
lemma cons_sndOfNotNil (q : G.Walk v w) (hadj : G.Adj u v) :
    (q.cons hadj).sndOfNotNil not_nil_cons = v

{V : Type u}
{G : SimpleGraph V}
{u v w : V}
(q : G.Walk v w)
(hadj : G.Adj u v)

(SimpleGraph.Walk.cons hadj q).sndOfNotNil ⋯ = v


@[simp]
theorem encode_true : encode true = 1


theorem not_isUnit_X : ¬IsUnit (X : R[X])

{R : Type u}
[Semiring R]
[Nontrivial R]


lemma truncateToReal_le {t : ℝ≥0∞} (t_ne_top : t ≠ ∞) {x : ℝ≥0∞} :
    truncateToReal t x ≤ t.toReal

{t : ℝ≥0∞}
(t_ne_top : t ≠ ⊤)
{x : ℝ≥0∞}


@[to_additive (attr := simp) sub_self]
theorem div_self' (a : G) : a / a = 1


{X : Type u_1}
[TopologicalSpace X]
{x y : X}
(γ : Path x y)


/-- The (identity) equivalence between `C` and its monoidal opposite. -/
@[simps] def MonoidalOpposite.mopEquiv : C ≌ Cᴹᵒᵖ

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

(CategoryTheory.MonoidalOpposite.mopEquiv C).counitIso =
  CategoryTheory.Iso.refl (CategoryTheory.unmopFunctor C ⋙ CategoryTheory.mopFunctor C)


/-- `PUnit` is a right identity for dependent type product up to an equivalence. -/
@[simps]
def sigmaPUnit (α) : (_ : α) × PUnit ≃ α

((Equiv.sigmaPUnit α).symm a).snd = PUnit.unit


@[simp] theorem append_sublist_append_left : ∀ l, l ++ l₁ <+ l ++ l₂ ↔ l₁ <+ l₂

∀ {α : Type u_1} {l₁ l₂ : List α} (l : List α), l ++ l₁ <+ l ++ l₂ ↔ l₁ <+ l₂


@[to_additive uniformContinuous_const_zsmul]
theorem uniformContinuous_zpow_const (n : ℤ) : UniformContinuous fun x : α => x ^ n

{α : Type u_1}
[UniformSpace α]
[Group α]
[UniformGroup α]
(n : ℤ)


theorem option_some : Computable (@Option.some α)


lemma iIndepSet_iff_iIndep (s : ι → Set Ω) (μ : Measure Ω) :
    iIndepSet s μ ↔ iIndep (fun i ↦ generateFrom {s i}) μ

∀ {x : MeasurableSpace Ω} (s : ι → Set Ω) (μ : MeasureTheory.Measure Ω),
  ProbabilityTheory.iIndepSet s μ ↔ ProbabilityTheory.iIndep (fun i => MeasurableSpace.generateFrom {s i}) μ


/-- Given families of generators `X ⊆ T`, there is a map `R[X] → S[X]`. -/
@[simps]
noncomputable
def toExtendScalars (P : Generators R T) : Hom P (P.extendScalars S)

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
{T : Type u_1}
[CommRing T]
[Algebra R T]
[Algebra S T]
[IsScalarTower R S T]
(P : Algebra.Generators R T)
(n : P.vars)

P.toExtendScalars.val n = MvPolynomial.X n


/-- Composition with a linear isometry equiv on the left preserves the norm of the iterated
derivative within a set. -/
theorem LinearIsometryEquiv.norm_iteratedFDerivWithin_comp_left (g : F ≃ₗᵢ[𝕜] G) (f : E → F)
    (hs : UniqueDiffOn 𝕜 s) (hx : x ∈ s) (i : ℕ) :
    ‖iteratedFDerivWithin 𝕜 i (g ∘ f) s x‖ = ‖iteratedFDerivWithin 𝕜 i f s x‖

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{s : Set E}
{x : E}
(g : F ≃ₗᵢ[𝕜] G)
(f : E → F)
(hs : UniqueDiffOn 𝕜 s)
(hx : x ∈ s)
(i : ℕ)

‖iteratedFDerivWithin 𝕜 i (⇑g ∘ f) s x‖ = ‖iteratedFDerivWithin 𝕜 i f s x‖


lemma ediv_two_mul_two_of_even : Even n → n / 2 * 2 = n


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


@[to_additive (attr := simp) addCentralizer_eq_univ]
lemma centralizer_eq_univ : centralizer S = univ

(M : Type u_1)
{S : Set M}
[CommSemigroup M]


@[simp]
theorem ord_ofNat (n : ℕ) [n.AtLeastTwo] : ord (no_index (OfNat.ofNat n)) = OfNat.ofNat n


theorem locallyFinite_option {f : Option ι → Set X} :
    LocallyFinite f ↔ LocallyFinite (f ∘ some)

{ι : Type u_1}
{X : Type u_4}
[TopologicalSpace X]
{f : Option ι → Set X}


theorem coeff_mul_X_pow' (p : R⟦X⟧) (n d : ℕ) :
    coeff R d (p * X ^ n) = ite (n ≤ d) (coeff R (d - n) p) 0

{R : Type u_1}
[Semiring R]
(p : PowerSeries R)
(n d : ℕ)

(PowerSeries.coeff R d) (p * PowerSeries.X ^ n) = if n ≤ d then (PowerSeries.coeff R (d - n)) p else 0


/-- Typeclass for expressing that `-0 = 0`. -/
class NegZeroClass (G : Type*) extends Zero G, Neg G where
  protected neg_zero : -(0 : G) = 0


lemma disjoint_biUnion_right (s : Finset β) (t : Finset α) (f : α → Finset β) :
    Disjoint s (t.biUnion f) ↔ ∀ i ∈ t, Disjoint s (f i)

{α : Type u_1}
{β : Type u_2}
[DecidableEq β]
(s : Finset β)
(t : Finset α)
(f : α → Finset β)


protected lemma Frequently.uncurry {la : Filter α} {lb : Filter β} {p : α → β → Prop}
    (h : ∃ᶠ x in la, ∃ᶠ y in lb, p x y) : ∃ᶠ xy in la ×ˢ lb, p xy.1 xy.2

(h : ∃ᶠ (x : α) in la, ∃ᶠ (y : β) in lb, p x y)

∃ᶠ (xy : α × β) in la ×ˢ lb, p xy.1 xy.2


@[simp]
theorem Ring.inverse_eq_inv' : (Ring.inverse : G₀ → G₀) = Inv.inv


@[to_additive ball_eq]
theorem ball_eq' (y : E) (ε : ℝ) : ball y ε = { x | ‖x / y‖ < ε }

{E : Type u_6}
[SeminormedAddGroup E]
(y : E)
(ε : ℝ)


{α : Type u_2}
[Ring α]
{a : α}
(hp : Odd a)


theorem mem_iInf {ι : Sort*} {S : ι → L.Substructure M} {x : M} :
    (x ∈ ⨅ i, S i) ↔ ∀ i, x ∈ S i

{L : FirstOrder.Language}
{M : Type w}
[L.Structure M]
{ι : Sort u_3}
{S : ι → L.Substructure M}
{x : M}


theorem primPart_ne_zero (p : R[X]) : p.primPart ≠ 0

{R : Type u_1}
[CommRing R]
[IsDomain R]
[NormalizedGCDMonoid R]
(p : Polynomial R)


theorem LinearIsometryEquiv.contDiff (f : E ≃ₗᵢ[𝕜] F) : ContDiff 𝕜 n f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{n : ℕ∞}
(f : E ≃ₗᵢ[𝕜] F)


@[simp]
theorem mk_mul_mk (a₁ a₂ a₃ a₄ b₁ b₂ b₃ b₄ : R) :
    (mk a₁ a₂ a₃ a₄ : ℍ[R,c₁,c₂]) * mk b₁ b₂ b₃ b₄ =
      ⟨a₁ * b₁ + c₁ * a₂ * b₂ + c₂ * a₃ * b₃ - c₁ * c₂ * a₄ * b₄,
        a₁ * b₂ + a₂ * b₁ - c₂ * a₃ * b₄ + c₂ * a₄ * b₃,
        a₁ * b₃ + c₁ * a₂ * b₄ + a₃ * b₁ - c₁ * a₄ * b₂, a₁ * b₄ + a₂ * b₃ - a₃ * b₂ + a₄ * b₁⟩

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(a₁ a₂ a₃ a₄ b₁ b₂ b₃ b₄ : R)

{ re := a₁, imI := a₂, imJ := a₃, imK := a₄ } * { re := b₁, imI := b₂, imJ := b₃, imK := b₄ } =
  { re := a₁ * b₁ + c₁ * a₂ * b₂ + c₂ * a₃ * b₃ - c₁ * c₂ * a₄ * b₄,
    imI := a₁ * b₂ + a₂ * b₁ - c₂ * a₃ * b₄ + c₂ * a₄ * b₃, imJ := a₁ * b₃ + c₁ * a₂ * b₄ + a₃ * b₁ - c₁ * a₄ * b₂,
    imK := a₁ * b₄ + a₂ * b₃ - a₃ * b₂ + a₄ * b₁ }


@[simp, norm_cast]
theorem coe_neg (a : α) : ((-a : α) : WithTop α) = -a

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


lemma disjoint_insert_erase (ha : a ∉ t) : Disjoint (s.erase a) (insert a t) ↔ Disjoint s t

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


@[simp]
theorem extendDomain_one : extendDomain 1 f = 1

{α : Type u}
{β : Type v}
{p : β → Prop}
[DecidablePred p]
(f : α ≃ Subtype p)


theorem mul_coeff (x y : 𝕎 R) (n : ℕ) :
    (x * y).coeff n = peval (wittMul p n) ![x.coeff, y.coeff]

{p : ℕ}
{R : Type u_1}
[hp : Fact (Nat.Prime p)]
[CommRing R]
(x y : 𝕎 R)
(n : ℕ)

(x * y).coeff n = WittVector.peval (WittVector.wittMul p n) ![x.coeff, y.coeff]


@[simp]
theorem nodup_dedup (s : Multiset α) : Nodup (dedup s)

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


@[simp]
theorem coe_inv (e : E ≃ₗᵢ[R] E) : ⇑e⁻¹ = e.symm

{R : Type u_1}
{E : Type u_5}
[Semiring R]
[SeminormedAddCommGroup E]
[Module R E]
(e : E ≃ₗᵢ[R] E)


theorem lt_irrefl' [LT α] (lt_irrefl : ∀ x : α, ¬x < x) (l : List α) : ¬l < l

{α : Type u_1}
[LT α]
(lt_irrefl : ∀ (x : α), ¬x < x)
(l : List α)


theorem maximal_ideal_unique : ∃! I : Ideal R, I.IsMaximal

(R : Type u_1)
[CommSemiring R]
[LocalRing R]


@[simp]
theorem trans_swap_trans_symm [DecidableEq β] (a b : β) (e : α ≃ β) :
    (e.trans (swap a b)).trans e.symm = swap (e.symm a) (e.symm b)

{α : Sort u_2}
[DecidableEq α]
{β : Sort u_1}
[DecidableEq β]
(a b : β)
(e : α ≃ β)

(e.trans (Equiv.swap a b)).trans e.symm = Equiv.swap (e.symm a) (e.symm b)


theorem sym_map {β : Type*} (f : α → β) (n : ℕ) (xs : List α) :
    (xs.map f).sym n = (xs.sym n).map (Sym.map f)

{α : Type u_1}
{β : Type u_3}
(f : α → β)
(n : ℕ)
(xs : List α)

List.sym n (List.map f xs) = List.map (Sym.map f) (List.sym n xs)


/-- The equivalence between `BddDistLat` and itself induced by `OrderDual` both ways. -/
@[simps functor inverse]
def dualEquiv : BddDistLat ≌ BddDistLat


@[simp]
theorem parallelPair_map_left (f g : X ⟶ Y) : (parallelPair f g).map left = f

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

(CategoryTheory.Limits.parallelPair f g).map CategoryTheory.Limits.WalkingParallelPairHom.left = f


/-- `MulSemiringAction.toAlgHom` is bijective. -/
theorem toAlgHom_bijective (G : Type u) (F : Type v) [Group G] [Field F] [Finite G]
    [MulSemiringAction G F] [FaithfulSMul G F] :
    Function.Bijective (MulSemiringAction.toAlgHom _ _ : G → F →ₐ[subfield G F] F)

Function.Bijective (MulSemiringAction.toAlgHom (↥(FixedPoints.subfield G F)) F)


@[simp]
lemma liftCochain_fst :
    (liftCochain φ α β h).comp (fst φ).1 h = α

(α : CochainComplex.HomComplex.Cochain K F m)

(β : CochainComplex.HomComplex.Cochain K G n)

(CochainComplex.mappingCone.liftCochain φ α β h).comp (↑(CochainComplex.mappingCone.fst φ)) h = α


/-- An oriented angle is `π` if and only if the angle with the order of the points reversed is
`π`. -/
theorem oangle_eq_pi_iff_oangle_rev_eq_pi {p₁ p₂ p₃ : P} : ∡ p₁ p₂ p₃ = π ↔ ∡ p₃ p₂ p₁ = π

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

∡ p₁ p₂ p₃ = ↑π ↔ ∡ p₃ p₂ p₁ = ↑π


@[to_additive (attr := simp, to_additive) (reorder := 1 2, 4 5) toLex_smul']
theorem pow_toLex [Pow α β] (a : α) (b : β) : a ^ toLex b = a ^ b

{β : Type u_2}
{α : Type u_1}
[VAdd β α]
(b : β)
(a : α)


@[to_additive]
theorem IsCyclic.card_orderOf_eq_totient [IsCyclic α] [Fintype α] {d : ℕ}
    (hd : d ∣ Fintype.card α) : (univ.filter fun a : α => orderOf a = d).card = totient d

{α : Type u}
[AddGroup α]
[IsAddCyclic α]
[Fintype α]
{d : ℕ}
(hd : d ∣ Fintype.card α)

(Finset.filter (fun a => addOrderOf a = d) Finset.univ).card = d.totient


theorem setToFun_add_left' (hT : DominatedFinMeasAdditive μ T C)
    (hT' : DominatedFinMeasAdditive μ T' C') (hT'' : DominatedFinMeasAdditive μ T'' C'')
    (h_add : ∀ s, MeasurableSet s → μ s < ∞ → T'' s = T s + T' s) (f : α → E) :
    setToFun μ T'' hT'' f = setToFun μ T hT f + setToFun μ T' hT' f

(hT : MeasureTheory.DominatedFinMeasAdditive μ T C)

(hT' : MeasureTheory.DominatedFinMeasAdditive μ T' C')

(hT'' : MeasureTheory.DominatedFinMeasAdditive μ T'' C'')

(h_add : ∀ (s : Set α), MeasurableSet s → μ s < ⊤ → T'' s = T s + T' s)

MeasureTheory.setToFun μ T'' hT'' f = MeasureTheory.setToFun μ T hT f + MeasureTheory.setToFun μ T' hT' f


/-- Commutativity of convolution -/
theorem convolution_flip : g ⋆[L.flip, μ] f = f ⋆[L, μ] g

{𝕜 : Type u𝕜}
{G : Type uG}
{E : Type uE}
{E' : Type uE'}
{F : Type uF}
[NormedAddCommGroup E]
[NormedAddCommGroup E']
[NormedAddCommGroup F]
{f : G → E}
{g : G → E'}
[NontriviallyNormedField 𝕜]
[NormedSpace 𝕜 E]
[NormedSpace 𝕜 E']
[NormedSpace 𝕜 F]
(L : E →L[𝕜] E' →L[𝕜] F)
[MeasurableSpace G]
{μ : MeasureTheory.Measure G}
[NormedSpace ℝ F]
[AddCommGroup G]
[μ.IsAddLeftInvariant]
[μ.IsNegInvariant]
[MeasurableNeg G]
[MeasurableAdd G]

MeasureTheory.convolution g f L.flip μ = MeasureTheory.convolution f g L μ


/-- If `α` is a linear pred order, `β` is a preorder, and `f : α → β` is an antitone function, then
the intervals `Set.Ioc (f n) (f (Order.pred n))` are pairwise disjoint. -/
theorem pairwise_disjoint_on_Ioc_pred [PredOrder α] [Preorder β] {f : α → β} (hf : Antitone f) :
    Pairwise (Disjoint on fun n => Ioc (f n) (f (pred n)))

{α : Type u_1}
{β : Type u_2}
[LinearOrder α]
[PredOrder α]
[Preorder β]
{f : α → β}
(hf : Antitone f)

Pairwise (Disjoint on fun n => Set.Ioc (f n) (f (Order.pred n)))


theorem integral_diff (ht : MeasurableSet t) (hfs : IntegrableOn f s μ) (hts : t ⊆ s) :
    ∫ x in s \ t, f x ∂μ = ∫ x in s, f x ∂μ - ∫ x in t, f x ∂μ

(hfs : MeasureTheory.IntegrableOn f s μ)

∫ (x : X) in s \ t, f x ∂μ = ∫ (x : X) in s, f x ∂μ - ∫ (x : X) in t, f x ∂μ


lemma HasFPowerSeriesWithinOnBall.prod {e : E} {f : E → F} {g : E → G} {s : Set E} {r t : ℝ≥0∞}
    {p : FormalMultilinearSeries 𝕜 E F} {q : FormalMultilinearSeries 𝕜 E G}
    (hf : HasFPowerSeriesWithinOnBall f p s e r) (hg : HasFPowerSeriesWithinOnBall g q s e t) :
    HasFPowerSeriesWithinOnBall (fun x ↦ (f x, g x)) (p.prod q) s e (min r t)

HasFPowerSeriesWithinOnBall (fun x => (f x, g x)) (p.prod q) s e (min r t)


@[to_additive]
theorem IsCompact.div_closedBall_one (hs : IsCompact s) (hδ : 0 ≤ δ) :
    s / closedBall 1 δ = cthickening δ s

{E : Type u_1}
[SeminormedAddCommGroup E]
{δ : ℝ}
{s : Set E}
(hs : IsCompact s)
(hδ : 0 ≤ δ)

s - Metric.closedBall 0 δ = Metric.cthickening δ s


@[simp]
theorem toConvexCone_bot : (⊥ : Submodule 𝕜 E).toConvexCone = 0

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]


theorem sum_smul_index' {S T : Type*} [DistribSMul T R] [AddCommMonoid S] (p : R[X]) (b : T)
    (f : ℕ → R → S) (hf : ∀ i, f i 0 = 0) : (b • p).sum f = p.sum fun n a => f n (b • a)

{R : Type u}
[Semiring R]
{S : Type u_1}
{T : Type u_2}
[DistribSMul T R]
[AddCommMonoid S]
(p : R[X])
(b : T)
(f : ℕ → R → S)
(hf : ∀ (i : ℕ), f i 0 = 0)


@[simp]
theorem isTheta_inv {f : α → 𝕜} {g : α → 𝕜'} :
    ((fun x ↦ (f x)⁻¹) =Θ[l] fun x ↦ (g x)⁻¹) ↔ f =Θ[l] g

{α : Type u_1}
{𝕜 : Type u_14}
{𝕜' : Type u_15}
[NormedField 𝕜]
[NormedField 𝕜']
{l : Filter α}
{f : α → 𝕜}
{g : α → 𝕜'}

((fun x => (f x)⁻¹) =Θ[l] fun x => (g x)⁻¹) ↔ f =Θ[l] g


protected theorem PartiallyWellOrderedOn.insert (h : PartiallyWellOrderedOn s r) (a : α) :
    PartiallyWellOrderedOn (insert a s) r

{α : Type u_2}
{r : α → α → Prop}
{s : Set α}
[IsRefl α r]
(h : s.PartiallyWellOrderedOn r)
(a : α)


/-- If `h : X → Y` is a homeomorphism, `h(s)` is compact iff `s` is. -/
@[simp]
theorem isCompact_image {s : Set X} (h : X ≃ₜ Y) : IsCompact (h '' s) ↔ IsCompact s

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


theorem eventually_congr {f : Filter α} {p q : α → Prop} (h : ∀ᶠ x in f, p x ↔ q x) :
    (∀ᶠ x in f, p x) ↔ ∀ᶠ x in f, q x

{α : Type u}
{f : Filter α}
{p q : α → Prop}
(h : ∀ᶠ (x : α) in f, p x ↔ q x)

(∀ᶠ (x : α) in f, p x) ↔ ∀ᶠ (x : α) in f, q x


/-- The left homology data on a short complex equipped with a splitting. -/
@[simps]
noncomputable def leftHomologyData [HasZeroObject C] (s : S.Splitting) :
    LeftHomologyData S

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
{S : CategoryTheory.ShortComplex C}
[CategoryTheory.Limits.HasZeroObject C]
(s : S.Splitting)


theorem mem_range_embedding_iff {j : Fin n} {i : Fin c.length} :
    j ∈ Set.range (c.embedding i) ↔ c.sizeUpTo i ≤ j ∧ (j : ℕ) < c.sizeUpTo (i : ℕ).succ

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

j ∈ Set.range ⇑(c.embedding i) ↔ c.sizeUpTo ↑i ≤ ↑j ∧ ↑j < c.sizeUpTo (↑i).succ


theorem mapRange_eq_map {R S : Type*} [CommSemiring R] [CommSemiring S] (p : MvPolynomial σ R)
    (f : R →+* S) : Finsupp.mapRange f f.map_zero p = map f p

(σ : Type u)
{R : Type u_1}
{S : Type u_2}
[CommSemiring R]
[CommSemiring S]
(p : MvPolynomial σ R)
(f : R →+* S)

Finsupp.mapRange ⇑f ⋯ p = (MvPolynomial.map f) p


@[simp]
theorem card_coe : Multiset.card (s : Multiset α) = n


@[simp]
theorem preinclusion_obj (a : B) : (preinclusion B).obj ⟨a⟩ = a

(CategoryTheory.FreeBicategory.preinclusion B).obj { as := a } = a


@[simp]
theorem ofReal_sinh_ofReal_re (x : ℝ) : ((sinh x).re : ℂ) = sinh x


protected theorem denseEmbedding (hp_ne_top : p ≠ ∞) :
    DenseEmbedding ((↑) : Lp.simpleFunc E p μ → Lp E p μ)

{α : Type u_1}
{E : Type u_4}
[MeasurableSpace α]
[NormedAddCommGroup E]
{p : ℝ≥0∞}
{μ : MeasureTheory.Measure α}
[Fact (1 ≤ p)]
(hp_ne_top : p ≠ ⊤)


theorem LinearIsometry.re_apply_eq_re_of_add_conj_eq (f : ℂ →ₗᵢ[ℝ] ℂ)
    (h₃ : ∀ z, z + conj z = f z + conj (f z)) (z : ℂ) : (f z).re = z.re

(f : ℂ →ₗᵢ[ℝ] ℂ)

(h₃ : ∀ (z : ℂ), z + (starRingEnd ℂ) z = f z + (starRingEnd ℂ) (f z))


lemma prod_prod (s : Set α) (t : Set β) : μ.prod ν (s ×ˢ t) = μ s * ν t

(μ : MeasureTheory.ProbabilityMeasure α)

(ν : MeasureTheory.ProbabilityMeasure β)


/-- A (topological) fiber bundle with fiber `F` over a base `B` is a space projecting on `B`
for which the fibers are all homeomorphic to `F`, such that the local situation around each point
is a direct product. -/
class FiberBundle where
  totalSpaceMk_inducing' : ∀ b : B, Inducing (@TotalSpace.mk B F E b)
  trivializationAtlas' : Set (Trivialization F (π F E))
  trivializationAt' : B → Trivialization F (π F E)
  mem_baseSet_trivializationAt' : ∀ b : B, b ∈ (trivializationAt' b).baseSet
  trivialization_mem_atlas' : ∀ b : B, trivializationAt' b ∈ trivializationAtlas'

[TopologicalSpace (Bundle.TotalSpace F E)]

b ∈ (FiberBundle.trivializationAt' b).baseSet


@[simp]
theorem mapRange_zero (f : ∀ i, β₁ i → β₂ i) (hf : ∀ i, f i 0 = 0) :
    mapRange f hf (0 : Π₀ i, β₁ i) = 0

{ι : Type u}
{β₁ : ι → Type v₁}
{β₂ : ι → Type v₂}
[(i : ι) → Zero (β₁ i)]
[(i : ι) → Zero (β₂ i)]
(f : (i : ι) → β₁ i → β₂ i)
(hf : ∀ (i : ι), f i 0 = 0)


theorem map_eq_iff_sup_ker_eq_of_surjective {I J : Ideal R} (f : R →+* S)
    (hf : Function.Surjective f) : map f I = map f J ↔ I ⊔ RingHom.ker f = J ⊔ RingHom.ker f

{R : Type u_1}
{S : Type u_2}
[CommRing R]
[CommRing S]
{I J : Ideal R}
(f : R →+* S)
(hf : Function.Surjective ⇑f)

Ideal.map f I = Ideal.map f J ↔ I ⊔ RingHom.ker f = J ⊔ RingHom.ker f


@[simp]
theorem iUnion_Ioc_coe_nat : ⋃ n : ℕ, Ioc a n = Ioi a \ {∞}


@[simp, mfld_simps]
theorem localTrivAsPartialEquiv_source :
    (Z.localTrivAsPartialEquiv i).source = (Z.localTriv i).source

{ι : Type u_1}
{B : Type u_2}
{F : Type u_3}
[TopologicalSpace B]
[TopologicalSpace F]
(Z : FiberBundleCore ι B F)
(i : ι)


protected theorem mul_lt_mul_of_neg_left {a b c : Int} (h : b < a) (hc : c < 0) : c * a < c * b


/-- A finite measure coerced into a real function is a signed measure. -/
@[simps]
def toSignedMeasure (μ : Measure α) [hμ : IsFiniteMeasure μ] : SignedMeasure α

{α : Type u_1}
{m : MeasurableSpace α}
(μ : MeasureTheory.Measure α)
[hμ : MeasureTheory.IsFiniteMeasure μ]
(s : Set α)

↑μ.toSignedMeasure s = if MeasurableSet s then (μ s).toReal else 0


theorem HasFPowerSeriesOnBall.congr (hf : HasFPowerSeriesOnBall f p x r)
    (hg : EqOn f g (EMetric.ball x r)) : HasFPowerSeriesOnBall g p x r

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[NontriviallyNormedField 𝕜]
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f g : E → F}
{p : FormalMultilinearSeries 𝕜 E F}
{x : E}
{r : ℝ≥0∞}
(hf : HasFPowerSeriesOnBall f p x r)
(hg : Set.EqOn f g (EMetric.ball x r))


@[simp]
theorem coe_mk (f : α →* β) (h₁ h₂) : ((⟨f, h₁, h₂⟩ : α →+* β) : α → β) = f

∀ {x : NonAssocSemiring α} {x_1 : NonAssocSemiring β} (f : α →* β) (h₁ : (↑f).toFun 0 = 0)
  (h₂ : ∀ (x_2 y : α), (↑f).toFun (x_2 + y) = (↑f).toFun x_2 + (↑f).toFun y),
  ⇑{ toMonoidHom := f, map_zero' := h₁, map_add' := h₂ } = ⇑f


@[to_additive (attr := simp)]
theorem comap_uniformity_mulOpposite [UniformSpace α] :
    comap (fun p : α × α => (MulOpposite.op p.1, MulOpposite.op p.2)) (𝓤 αᵐᵒᵖ) = 𝓤 α

Filter.comap (fun p => (AddOpposite.op p.1, AddOpposite.op p.2)) (𝓤 αᵃᵒᵖ) = 𝓤 α


theorem HasDerivAt.log (hf : HasDerivAt f f' x) (hx : f x ≠ 0) :
    HasDerivAt (fun y => log (f y)) (f' / f x) x

{f : ℝ → ℝ}
{x f' : ℝ}
(hf : HasDerivAt f f' x)
(hx : f x ≠ 0)

HasDerivAt (fun y => Real.log (f y)) (f' / f x) x


/-- Given two locally ringed spaces `X` and `Y`, an isomorphism between `X` and `Y` as _sheafed_
spaces can be lifted to a morphism `X ⟶ Y` as locally ringed spaces.

See also `iso_of_SheafedSpace_iso`.
-/
@[simps]
def homOfSheafedSpaceHomOfIsIso {X Y : LocallyRingedSpace.{u}}
    (f : X.toSheafedSpace ⟶ Y.toSheafedSpace) [IsIso f] : X ⟶ Y

{X Y : AlgebraicGeometry.LocallyRingedSpace}

(AlgebraicGeometry.LocallyRingedSpace.homOfSheafedSpaceHomOfIsIso f).val = f


theorem lt_of_pos_of_infinitesimal {x : ℝ*} : Infinitesimal x → ∀ r : ℝ, 0 < r → x < r

x.Infinitesimal → ∀ (r : ℝ), 0 < r → x < ↑r


lemma IsLeftRegular.prod (h : ∀ i ∈ s, IsLeftRegular (f i)) :
    IsLeftRegular (∏ i ∈ s, f i)

{ι : Type u_2}
{R : Type u_3}
[CommMonoid R]
{s : Finset ι}
{f : ι → R}
(h : ∀ i ∈ s, IsLeftRegular (f i))


/-- A ring homomorphism between local rings is a local ring hom iff it reflects units,
i.e. any preimage of a unit is still a unit. https://stacks.math.columbia.edu/tag/07BJ
-/
theorem local_hom_TFAE (f : R →+* S) :
    List.TFAE
      [IsLocalRingHom f, f '' (maximalIdeal R).1 ⊆ maximalIdeal S,
        (maximalIdeal R).map f ≤ maximalIdeal S, maximalIdeal R ≤ (maximalIdeal S).comap f,
        (maximalIdeal S).comap f = maximalIdeal R]

{R : Type u_1}
{S : Type u_2}
[CommSemiring R]
[LocalRing R]
[CommSemiring S]
[LocalRing S]
(f : R →+* S)

[IsLocalRingHom f, ⇑f '' ↑(LocalRing.maximalIdeal R).toAddSubmonoid ⊆ ↑(LocalRing.maximalIdeal S),
    Ideal.map f (LocalRing.maximalIdeal R) ≤ LocalRing.maximalIdeal S,
    LocalRing.maximalIdeal R ≤ Ideal.comap f (LocalRing.maximalIdeal S),
    Ideal.comap f (LocalRing.maximalIdeal S) = LocalRing.maximalIdeal R].TFAE


lemma cfc_sub : cfc (fun x ↦ f x - g x) a = cfc f a - cfc g a

(hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac)

(hg : ContinuousOn g (spectrum R a) := by cfc_cont_tac)

cfc (fun x => f x - g x) a = cfc f a - cfc g a


@[simp]
theorem integral_inv_one_add_sq : (∫ x : ℝ in a..b, (↑1 + x ^ 2)⁻¹) = arctan b - arctan a

∫ (x : ℝ) in a..b, (1 + x ^ 2)⁻¹ = Real.arctan b - Real.arctan a


theorem ext_iff {f g : Equiv α β} : f = g ↔ ∀ x, f x = g x


theorem Sylow.exists_comap_eq_of_injective {H : Type*} [Group H] (P : Sylow p H) {f : H →* G}
    (hf : Function.Injective f) : ∃ Q : Sylow p G, (Q : Subgroup G).comap f = P

{p : ℕ}
{G : Type u_1}
[Group G]
{H : Type u_2}
[Group H]
(P : Sylow p H)
{f : H →* G}
(hf : Function.Injective ⇑f)


/-- A strictly convex function on an open segment is strictly upper-bounded by the max of its
endpoints. -/
theorem StrictConvexOn.lt_on_open_segment' (hf : StrictConvexOn 𝕜 s f) {x y : E} (hx : x ∈ s)
    (hy : y ∈ s) (hxy : x ≠ y) {a b : 𝕜} (ha : 0 < a) (hb : 0 < b) (hab : a + b = 1) :
    f (a • x + b • y) < max (f x) (f y)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[LinearOrderedAddCommMonoid β]
[SMul 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : StrictConvexOn 𝕜 s f)
{x y : E}
(hx : x ∈ s)
(hy : y ∈ s)
(hxy : x ≠ y)
{a b : 𝕜}
(ha : 0 < a)
(hb : 0 < b)
(hab : a + b = 1)


theorem rel_id_apply₂ (X : RelCat) (x y : X) : (𝟙 X) x y ↔ x = y

CategoryTheory.CategoryStruct.id X x y ↔ x = y