/-- The symbol `J(a^2 | b)` is `1` when `a` and `b` are coprime. -/
theorem sq_one' {a : ℤ} {b : ℕ} (h : a.gcd b = 1) : J(a ^ 2 | b) = 1


lemma BddBelow.range_mono [Preorder β] (f : α → β) {g : α → β} (h : ∀ a, f a ≤ g a)
    (hbdd : BddBelow (range f)) : BddBelow (range g)

{α : Type u}
{β : Type v}
[Preorder β]
(f : α → β)
{g : α → β}
(h : ∀ (a : α), f a ≤ g a)
(hbdd : BddBelow (Set.range f))


/-- A short complex in a category `C` with zero morphisms is the datum
of two composable morphisms `f : X₁ ⟶ X₂` and `g : X₂ ⟶ X₃` such that
`f ≫ g = 0`. -/
structure ShortComplex [HasZeroMorphisms C] where
  /-- the first (left) object of a `ShortComplex` -/
  {X₁ : C}
  /-- the second (middle) object of a `ShortComplex` -/
  {X₂ : C}
  /-- the third (right) object of a `ShortComplex` -/
  {X₃ : C}
  /-- the first morphism of a `ShortComplex` -/
  f : X₁ ⟶ X₂
  /-- the second morphism of a `ShortComplex` -/
  g : X₂ ⟶ X₃
  /-- the composition of the two given morphisms is zero -/
  zero : f ≫ g = 0

CategoryTheory.CategoryStruct.comp self.f self.g = 0


/-- `field_simp` moves division inside `αˣ` to the right, and this lemma
lifts the calculation to `α`.
-/
@[field_simps]
theorem val_div_eq_divp (u₁ u₂ : αˣ) : ↑(u₁ / u₂) = ↑u₁ /ₚ u₂


theorem isRegular_iff_ne_zero' [Nontrivial α] [NonUnitalNonAssocRing α] [NoZeroDivisors α]
    {k : α} : IsRegular k ↔ k ≠ 0

{α : Type u_1}
[Nontrivial α]
[NonUnitalNonAssocRing α]
[NoZeroDivisors α]
{k : α}


@[to_additive]
theorem map_noncommProd [MonoidHomClass F α β] (s : Multiset α) (comm) (f : F) :
    f (s.noncommProd comm) = (s.map f).noncommProd (Multiset.map_noncommProd_aux s comm f)

(comm : {x | x ∈ s}.Pairwise AddCommute)

f (s.noncommSum comm) = (Multiset.map (⇑f) s).noncommSum ⋯


theorem HasBinaryBiproduct.mk {P Q : C} (d : BinaryBiproductData P Q) : HasBinaryBiproduct P Q

(d : CategoryTheory.Limits.BinaryBiproductData P Q)


@[to_additive (attr := simp)]
theorem coe_mk (f : M ≃ N) (hf : ∀ x y, f (x * y) = f x * f y) : (mk f hf : M → N) = f

(hf : ∀ (x y : M), f (x + y) = f x + f y)


theorem one_eq_mk_one [Monoid α] : (1 : Associates α) = Associates.mk 1


/-- If a measurable space has a finite measure `μ` and a countable group `G` acts
quasi-measure-preservingly, then to show that a set `s` is a fundamental domain, it is sufficient
to check that its translates `g • s` are (almost) disjoint and that the sum `∑' g, μ (g • s)` is
sufficiently large. -/
@[to_additive
  "If a measurable space has a finite measure `μ` and a countable additive group `G` acts
  quasi-measure-preservingly, then to show that a set `s` is a fundamental domain, it is sufficient
  to check that its translates `g +ᵥ s` are (almost) disjoint and that the sum `∑' g, μ (g +ᵥ s)` is
  sufficiently large."]
theorem mk_of_measure_univ_le [IsFiniteMeasure μ] [Countable G] (h_meas : NullMeasurableSet s μ)
    (h_ae_disjoint : ∀ g ≠ (1 : G), AEDisjoint μ (g • s) s)
    (h_qmp : ∀ g : G, QuasiMeasurePreserving (g • · : α → α) μ μ)
    (h_measure_univ_le : μ (univ : Set α) ≤ ∑' g : G, μ (g • s)) : IsFundamentalDomain G s μ

(h_meas : MeasureTheory.NullMeasurableSet s μ)

(h_ae_disjoint : ∀ (g : G), g ≠ 1 → MeasureTheory.AEDisjoint μ (g • s) s)

(h_qmp : ∀ (g : G), MeasureTheory.Measure.QuasiMeasurePreserving (fun x => g • x) μ μ)

(h_measure_univ_le : μ Set.univ ≤ ∑' (g : G), μ (g • s))


theorem Prime.not_dvd_one {p : ℕ+} : p.Prime → ¬p ∣ 1


theorem comap_eval_le_generateFrom_squareCylinders_singleton
    (α : ι → Type*) [m : ∀ i, MeasurableSpace (α i)] (i : ι) :
    MeasurableSpace.comap (Function.eval i) (m i) ≤
      MeasurableSpace.generateFrom
        ((fun t ↦ ({i} : Set ι).pi t) '' univ.pi fun i ↦ {s : Set (α i) | MeasurableSet s})

{ι : Type u_2}
(α : ι → Type u_1)
[m : (i : ι) → MeasurableSpace (α i)]
(i : ι)

MeasurableSpace.comap (Function.eval i) (m i) ≤
  MeasurableSpace.generateFrom ((fun t => {i}.pi t) '' Set.univ.pi fun i => {s | MeasurableSet s})


@[simp]
theorem finAddFlip_apply_mk_right {k : ℕ} (h₁ : m ≤ k) (h₂ : k < m + n) :
    finAddFlip (⟨k, h₂⟩ : Fin (m + n)) = ⟨k - m, by omega⟩

{m n k : ℕ}
(h₁ : m ≤ k)
(h₂ : k < m + n)


protected theorem Commute.geom_sum₂ [DivisionRing α] {x y : α} (h' : Commute x y) (h : x ≠ y)
    (n : ℕ) : ∑ i ∈ range n, x ^ i * y ^ (n - 1 - i) = (x ^ n - y ^ n) / (x - y)

{α : Type u}
[DivisionRing α]
{x y : α}
(h' : Commute x y)
(h : x ≠ y)
(n : ℕ)

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


lemma setLIntegral_rnDerivAux (κ η : Kernel α γ) [IsFiniteKernel κ] [IsFiniteKernel η]
    (a : α) {s : Set γ} (hs : MeasurableSet s) :
    ∫⁻ x in s, ENNReal.ofReal (rnDerivAux κ (κ + η) a x) ∂(κ + η) a = κ a s

[hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ]

∫⁻ (x : γ) in s, ENNReal.ofReal (κ.rnDerivAux (κ + η) a x) ∂(κ + η) a = (κ a) s


@[to_additive]
theorem units_of_val : Commute (u₁ : M) u₂ → Commute u₁ u₂

{M : Type u_1}
[AddMonoid M]
{u₁ u₂ : AddUnits M}


theorem vsub_lineMap (p₁ p₂ p₃ : P₁) (c : k) :
    p₁ -ᵥ lineMap p₂ p₃ c = lineMap (p₁ -ᵥ p₂) (p₁ -ᵥ p₃) c

{k : Type u_1}
{P₁ : Type u_2}
{V₁ : Type u_6}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]
(p₁ p₂ p₃ : P₁)
(c : k)

p₁ -ᵥ (AffineMap.lineMap p₂ p₃) c = (AffineMap.lineMap (p₁ -ᵥ p₂) (p₁ -ᵥ p₃)) c


theorem lowerBounds_le_upperBounds (ha : a ∈ lowerBounds s) (hb : b ∈ upperBounds s) :
    s.Nonempty → a ≤ b

{α : Type u}
[Preorder α]
{s : Set α}
{a b : α}
(ha : a ∈ lowerBounds s)
(hb : b ∈ upperBounds s)


theorem or_congr_right (h : b ↔ c) : a ∨ b ↔ a ∨ c


/-- A module over a division ring is noetherian if and only if it is finitely generated. -/
theorem iff_fg : IsNoetherian K V ↔ Module.Finite K V

{K : Type u}
{V : Type v}
[DivisionRing K]
[AddCommGroup V]
[Module K V]


theorem IsCoatom.le_iff (h : IsCoatom a) : a ≤ x ↔ x = ⊤ ∨ x = a

{α : Type u_2}
[PartialOrder α]
[OrderTop α]
{a x : α}
(h : IsCoatom a)


@[simp] theorem run_seqRight [Monad m] (x : StateT σ m α) (y : StateT σ m β) (s : σ) : (x *> y).run s = (x.run s >>= fun p => y.run p.2)

{m : Type u_1 → Type u_2}
{σ α β : Type u_1}
[Monad m]
(x : StateT σ m α)
(y : StateT σ m β)
(s : σ)

(SeqRight.seqRight x fun x => y).run s = do
  let p ← x.run s
  y.run p.snd


@[simp]
theorem eraseLead_add_C_mul_X_pow (f : R[X]) :
    f.eraseLead + C f.leadingCoeff * X ^ f.natDegree = f

f.eraseLead + Polynomial.C f.leadingCoeff * Polynomial.X ^ f.natDegree = f


lemma iUnion_connectedComponentSupp (G : SimpleGraph V) :
    ⋃ c : G.ConnectedComponent, c.supp = Set.univ


/-- The `v`-adic valuation on `R` is bounded above by 1. -/
theorem intValuation_le_one (x : R) : v.intValuationDef x ≤ 1

(v : IsDedekindDomain.HeightOneSpectrum R)


lemma poissonPMFReal_nonneg {r : ℝ≥0} {n : ℕ} : 0 ≤ poissonPMFReal r n

0 ≤ ProbabilityTheory.poissonPMFReal r n


theorem average_union {f : α → E} {s t : Set α} (hd : AEDisjoint μ s t) (ht : NullMeasurableSet t μ)
    (hsμ : μ s ≠ ∞) (htμ : μ t ≠ ∞) (hfs : IntegrableOn f s μ) (hft : IntegrableOn f t μ) :
    ⨍ x in s ∪ t, f x ∂μ =
      ((μ s).toReal / ((μ s).toReal + (μ t).toReal)) • ⨍ x in s, f x ∂μ +
        ((μ t).toReal / ((μ s).toReal + (μ t).toReal)) • ⨍ x in t, f x ∂μ

(ht : MeasureTheory.NullMeasurableSet t μ)

(hfs : MeasureTheory.IntegrableOn f s μ)

(hft : MeasureTheory.IntegrableOn f t μ)

⨍ (x : α) in s ∪ t, f x ∂μ =
  ((μ s).toReal / ((μ s).toReal + (μ t).toReal)) • ⨍ (x : α) in s, f x ∂μ +
    ((μ t).toReal / ((μ s).toReal + (μ t).toReal)) • ⨍ (x : α) in t, f x ∂μ


theorem ConcaveOn.openSegment_subset_strict_hypograph (hf : ConcaveOn 𝕜 s f) (p q : E × β)
    (hp : p.1 ∈ s ∧ p.2 < f p.1) (hq : q.1 ∈ s ∧ q.2 ≤ f q.1) :
    openSegment 𝕜 p q ⊆ { p : E × β | p.1 ∈ s ∧ p.2 < f p.1 }

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[OrderedCancelAddCommMonoid β]
[Module 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : ConcaveOn 𝕜 s f)
(p q : E × β)
(hp : p.1 ∈ s ∧ p.2 < f p.1)
(hq : q.1 ∈ s ∧ q.2 ≤ f q.1)

openSegment 𝕜 p q ⊆ {p | p.1 ∈ s ∧ p.2 < f p.1}


/-- Composition of lax prefunctors. -/
@[simps]
def comp (F : PrelaxFunctorStruct B C) (G : PrelaxFunctorStruct C D) : PrelaxFunctorStruct B D

(F : CategoryTheory.PrelaxFunctorStruct B C)

(G : CategoryTheory.PrelaxFunctorStruct C D)

∀ {a b : B} {f g : a ⟶ b} (η : f ⟶ g), (F.comp G).map₂ η = G.map₂ (F.map₂ η)


@[simp]
theorem stirlingSeq_zero : stirlingSeq 0 = 0


nonrec theorem HasDerivAt.const_smul (c : R) (hf : HasDerivAt f f' x) :
    HasDerivAt (fun y => c • f y) (c • f') x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
{R : Type u_2}
[Semiring R]
[Module R F]
[SMulCommClass 𝕜 R F]
[ContinuousConstSMul R F]
(c : R)
(hf : HasDerivAt f f' x)


/-- `Quotient.out` as a relation embedding between the lift of a relation and the relation. -/
@[simps!]
noncomputable def Quotient.outRelEmbedding [Setoid α] {r : α → α → Prop}
    (H : ∀ (a₁ b₁ a₂ b₂ : α), a₁ ≈ a₂ → b₁ ≈ b₂ → r a₁ b₁ = r a₂ b₂) : Quotient.lift₂ r H ↪r r

∀ (a : Quotient inst✝), (Quotient.outRelEmbedding H) a = a.out


@[simp]
theorem pointReflection_symm (x : P) : (pointReflection x).symm = pointReflection x

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

Equiv.symm (Equiv.pointReflection x) = Equiv.pointReflection x


@[simp]
theorem coe_pi {ι' : Type*} {M' : ι' → Type*} [∀ i, AddCommMonoid (M' i)]
    [∀ i, TopologicalSpace (M' i)] [∀ i, Module R (M' i)]
    (f : ∀ i, ContinuousMultilinearMap R M₁ (M' i)) : ⇑(pi f) = fun m j => f j m

(f : (i : ι') → ContinuousMultilinearMap R M₁ (M' i))

⇑(ContinuousMultilinearMap.pi f) = fun m j => (f j) m


@[to_additive (attr := measurability)]
theorem Multiset.aemeasurable_prod (s : Multiset (α → M)) (hs : ∀ f ∈ s, AEMeasurable f μ) :
    AEMeasurable (fun x => (s.map fun f : α → M => f x).prod) μ

{M : Type u_2}
{α : Type u_4}
[CommMonoid M]
[MeasurableSpace M]
[MeasurableMul₂ M]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(s : Multiset (α → M))
(hs : ∀ f ∈ s, AEMeasurable f μ)

AEMeasurable (fun x => (Multiset.map (fun f => f x) s).prod) μ


lemma map_comm (f : M →ₗ[R] P) (g : N →ₗ[R] Q) (x : N ⊗[R] M) :
    map f g (TensorProduct.comm R N M x) = TensorProduct.comm R Q P (map g f x)

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

(TensorProduct.map f g) ((TensorProduct.comm R N M) x) = (TensorProduct.comm R Q P) ((TensorProduct.map g f) x)


@[to_additive (attr := simp)]
theorem coe_div {G : Type*} [Group G] [TopologicalSpace G] [ChartedSpace H' G] [LieGroup I' G]
    (f g : C^∞⟮I, N; I', G⟯) : ⇑(f / g) = f / g

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{H : Type u_4}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{H' : Type u_5}
[TopologicalSpace H']
{I' : ModelWithCorners 𝕜 E' H'}
{N : Type u_6}
[TopologicalSpace N]
[ChartedSpace H N]
{G : Type u_10}
[Group G]
[TopologicalSpace G]
[ChartedSpace H' G]
[LieGroup I' G]
(f g : C^⊤⟮I, N; I', G⟯)


@[simp]
theorem ofHamming_zero [∀ i, Zero (β i)] : ofHamming (0 : Hamming β) = 0

{ι : Type u_2}
{β : ι → Type u_3}
[(i : ι) → Zero (β i)]


/-- Division `y ↦ y / x` as an `IsometryEquiv`. -/
@[to_additive (attr := simps! apply toEquiv) "Subtraction `y ↦ y - x` as an `IsometryEquiv`."]
def divRight [IsometricSMul Gᵐᵒᵖ G] (c : G) : G ≃ᵢ G

{G : Type v}
[Group G]
[PseudoEMetricSpace G]
[IsometricSMul Gᵐᵒᵖ G]
(c b : G)


theorem naturality_1' (α : F ⟶ G) (f : X ⟶ Y) {_ : IsIso (α.app X)} :
    inv (α.app X) ≫ F.map f ≫ α.app Y = G.map f

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F G : C ⥤ D}
{X Y : C}
(α : F ⟶ G)
(f : X ⟶ Y)

∀ {x : CategoryTheory.IsIso (α.app X)}, CategoryTheory.inv (α.app X) ≫ F.map f ≫ α.app Y = G.map f


@[simp]
theorem length_inv (w : W) : ℓ (w⁻¹) = ℓ w

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


theorem volume_measurePreserving_piCongrLeft (α : ι → Type*) (f : ι' ≃ ι)
    [∀ i, MeasureSpace (α i)] [∀ i, SigmaFinite (volume : Measure (α i))] :
    MeasurePreserving (MeasurableEquiv.piCongrLeft α f) volume volume

[(i : ι) → MeasureTheory.MeasureSpace (α i)]

[∀ (i : ι), MeasureTheory.SigmaFinite MeasureTheory.volume]

MeasureTheory.MeasurePreserving (⇑(MeasurableEquiv.piCongrLeft α f)) MeasureTheory.volume MeasureTheory.volume


/-- The unipotent upper triangular matrix
```
(1 r)
(0 1)
```
as an isomorphism.
-/
@[simps]
def Biprod.unipotentUpper {X₁ X₂ : C} (r : X₁ ⟶ X₂) : X₁ ⊞ X₂ ≅ X₁ ⊞ X₂

(CategoryTheory.Biprod.unipotentUpper r).hom = CategoryTheory.Biprod.ofComponents (𝟙 X₁) r 0 (𝟙 X₂)


lemma isLocallySurjective_of_isLocallySurjective_of_isLocallyInjective_fac
    {F₁ F₂ F₃ : Cᵒᵖ ⥤ A} {f₁ : F₁ ⟶ F₂} {f₂ : F₂ ⟶ F₃} (f₃ : F₁ ⟶ F₃) (fac : f₁ ≫ f₂ = f₃)
    [IsLocallySurjective J f₃] [IsLocallyInjective J f₂] :
    IsLocallySurjective J f₁

(J : CategoryTheory.GrothendieckTopology C)


theorem bijective_iff_bijective_of_iUnion_eq_univ :
    Bijective f ↔ ∀ i, Bijective ((U i).restrictPreimage f)

{α : Type u_1}
{β : Type u_2}
{ι : Sort u_4}
{f : α → β}
{U : ι → Set β}
(hU : Set.iUnion U = Set.univ)

Function.Bijective f ↔ ∀ (i : ι), Function.Bijective ((U i).restrictPreimage f)


/-- Post-composition by a uniform inducing is a uniform inducing for the
uniform structures of `𝔖`-convergence.

More precisely, if `f : γ → β` is a uniform inducing, then
`(fun g ↦ f ∘ g) : (α →ᵤ[𝔖] γ) → (α →ᵤ[𝔖] β)` is a uniform inducing. -/
protected theorem postcomp_uniformInducing [UniformSpace γ] {f : γ → β} (hf : UniformInducing f) :
    UniformInducing (ofFun 𝔖 ∘ (f ∘ ·) ∘ toFun 𝔖)

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[UniformSpace β]
{𝔖 : Set (Set α)}
[UniformSpace γ]
{f : γ → β}
(hf : UniformInducing f)

UniformInducing (⇑(UniformOnFun.ofFun 𝔖) ∘ (fun x => f ∘ x) ∘ ⇑(UniformOnFun.toFun 𝔖))


@[simp]
theorem isRegular_star_iff [Mul R] [StarMul R] {x : R} :
    IsRegular (star x) ↔ IsRegular x

{R : Type u}
[Mul R]
[StarMul R]
{x : R}


/-- A p-group is nilpotent -/
theorem IsPGroup.isNilpotent [Finite G] {p : ℕ} [hp : Fact (Nat.Prime p)] (h : IsPGroup p G) :
    IsNilpotent G

{G : Type u_1}
[hG : Group G]
[Finite G]
{p : ℕ}
[hp : Fact (Nat.Prime p)]
(h : IsPGroup p G)


theorem map_comap_eq (hf : N₂ ≤ f.range) : map f (comap f N₂) = N₂

{R : Type u}
{L : Type v}
{M : Type w}
{M₂ : Type w₁}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[AddCommGroup M₂]
[Module R M₂]
[LieRingModule L M₂]
(N₂ : LieSubmodule R L M₂)
(f : M →ₗ⁅R,L⁆ M₂)
(hf : N₂ ≤ f.range)

LieSubmodule.map f (LieSubmodule.comap f N₂) = N₂


{α : Type u}
[PartialOrder α]
[OrderBot α]
[Nontrivial α]


theorem mem_top (x : K) : x ∈ (⊤ : ValuationSubring K)


theorem comap_subtype_coe_apply {_m0 : MeasurableSpace α} {s : Set α} (hs : MeasurableSet s)
    (μ : Measure α) (t : Set s) : comap (↑) μ t = μ ((↑) '' t)

{α : Type u_2}
{_m0 : MeasurableSpace α}
{s : Set α}
(hs : MeasurableSet s)
(μ : MeasureTheory.Measure α)
(t : Set ↑s)

(MeasureTheory.Measure.comap Subtype.val μ) t = μ (Subtype.val '' t)


theorem mem_doset_self (H K : Subgroup G) (a : G) : a ∈ doset a H K

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


@[to_additive]
theorem mk'_eq_iff_eq {x₁ x₂} {y₁ y₂ : S} :
    f.mk' x₁ y₁ = f.mk' x₂ y₂ ↔ f.toMap (y₂ * x₁) = f.toMap (y₁ * x₂)

{M : Type u_1}
[CommMonoid M]
{S : Submonoid M}
{N : Type u_2}
[CommMonoid N]
(f : S.LocalizationMap N)
{x₁ x₂ : M}
{y₁ y₂ : ↥S}

f.mk' x₁ y₁ = f.mk' x₂ y₂ ↔ f.toMap (↑y₂ * x₁) = f.toMap (↑y₁ * x₂)


/-- An oriented angle has a sign zero if and only if the three points are collinear. -/
theorem oangle_sign_eq_zero_iff_collinear {p₁ p₂ p₃ : P} :
    (∡ p₁ p₂ p₃).sign = 0 ↔ Collinear ℝ ({p₁, p₂, p₃} : Set P)

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

(∡ p₁ p₂ p₃).sign = 0 ↔ Collinear ℝ {p₁, p₂, p₃}


protected theorem tendsto_approx : ∀ x, Tendsto (fun n => hf.approx n x) atTop (𝓝 (f x))

(hf : MeasureTheory.FinStronglyMeasurable f μ)

Filter.Tendsto (fun n => ↑(hf.approx n) x) Filter.atTop (𝓝 (f x))


/-- The equivalence of categories `(J → C) ≌ (Discrete J ⥤ C)`. -/
@[simps]
def piEquivalenceFunctorDiscrete (J : Type u₂) (C : Type u₁) [Category.{v₁} C] :
    (J → C) ≌ (Discrete J ⥤ C)

(F : CategoryTheory.Functor (CategoryTheory.Discrete J) C)

(CategoryTheory.piEquivalenceFunctorDiscrete J C).inverse.obj F j = F.obj { as := j }


lemma «forall» {p : ℚ≥0 → Prop} : (∀ q, p q) ↔ ∀ q hq, p ⟨q, hq⟩

(∀ (q : ℚ≥0), p q) ↔ ∀ (q : ℚ) (hq : 0 ≤ q), p ⟨q, hq⟩


@[simp]
theorem expNear_succ (n x r) : expNear (n + 1) x r = expNear n x (1 + x / (n + 1) * r)

Real.expNear (n + 1) x r = Real.expNear n x (1 + x / (↑n + 1) * r)


/-- Multiplicative congruence relations preserve product indexed by a list. -/
@[to_additive "Additive congruence relations preserve sum indexed by a list."]
protected theorem list_prod {ι M : Type*} [Monoid M] (c : Con M) {l : List ι} {f g : ι → M}
    (h : ∀ x ∈ l, c (f x) (g x)) :
    c (l.map f).prod (l.map g).prod

{ι : Type u_1}
{M : Type u_2}
[AddMonoid M]
(c : AddCon M)
{l : List ι}
{f g : ι → M}
(h : ∀ x ∈ l, c (f x) (g x))


@[simp]
theorem of_mul_of (x y : α) : of x * of y = of (x * y)

FreeAbelianGroup.of x * FreeAbelianGroup.of y = FreeAbelianGroup.of (x * y)


@[simp]
theorem codisjoint_top_right : Codisjoint a ⊤

{α : Type u_1}
[PartialOrder α]
[OrderTop α]
{a : α}


@[simp]
theorem symmDiff_eq_top : a ∆ b = ⊤ ↔ IsCompl a b

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


@[simp]
theorem uniqueElim_const {β : Sort*} {_ : Unique ι} (x : β) (i : ι) :
    uniqueElim (α := fun _ ↦ β) x i = x

∀ {x : Unique ι} (x_1 : β) (i : ι), uniqueElim x_1 i = x_1


theorem ι_leftInverse : Function.LeftInverse ιInv (ι R : M → ExteriorAlgebra R M)

{R : Type u1}
[CommRing R]
{M : Type u2}
[AddCommGroup M]
[Module R M]

Function.LeftInverse ⇑ExteriorAlgebra.ιInv ⇑(ExteriorAlgebra.ι R)


theorem initial_iff_comp_initial_full_faithful [Initial G] [Full G] [Faithful G] :
    Initial F ↔ Initial (F ⋙ G)

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


lemma repr_eq_zero_of_nmem_range {i : ι} (hi : i ∉ Set.range snf.f) :
    snf.bM.repr m i = 0

{ι : Type u_1}
{R : Type u_2}
[CommRing R]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
{n : ℕ}
{N : Submodule R M}
(snf : Basis.SmithNormalForm N ι n)
(m : ↥N)
{i : ι}
(hi : i ∉ Set.range ⇑snf.f)


@[simp, norm_cast]
protected theorem coe_pow (a : { x : α // 0 ≤ x }) (n : ℕ) :
    (↑(a ^ n) : α) = (a : α) ^ n

{α : Type u_1}
[MonoidWithZero α]
[Preorder α]
[ZeroLEOneClass α]
[PosMulMono α]
(a : { x // 0 ≤ x })
(n : ℕ)


@[simp]
theorem coe_lsum (f : α → M →ₗ[R] N) : (lsum S f : (α →₀ M) → N) = fun d => d.sum fun i => f i

{α : Type u_1}
{M : Type u_2}
{N : Type u_3}
{R : Type u_5}
(S : Type u_6)
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
[Module S N]
[SMulCommClass R S N]
(f : α → M →ₗ[R] N)

⇑((Finsupp.lsum S) f) = fun d => d.sum fun i => ⇑(f i)


theorem mem_adjoint_domain_of_exists (y : F) (h : ∃ w : E, ∀ x : T.domain, ⟪w, x⟫ = ⟪y, T x⟫) :
    y ∈ T†.domain

(h : ∃ w, ∀ (x : ↥T.domain), ⟪w, ↑x⟫_𝕜 = ⟪y, ↑T x⟫_𝕜)


theorem progMeasurable_of_tendsto [MeasurableSpace ι] [PseudoMetrizableSpace β] {U : ℕ → ι → Ω → β}
    (h : ∀ l, ProgMeasurable f (U l)) (h_tendsto : Tendsto U atTop (𝓝 u)) : ProgMeasurable f u

{u : ι → Ω → β}

{U : ℕ → ι → Ω → β}

(h : ∀ (l : ℕ), MeasureTheory.ProgMeasurable f (U l))

(h_tendsto : Filter.Tendsto U Filter.atTop (𝓝 u))


theorem unbounded_of_tendsto_atTop [Nonempty α] [SemilatticeSup α] [Preorder β] [NoMaxOrder β]
    {f : α → β} (h : Tendsto f atTop atTop) : ¬BddAbove (range f)

(h : Filter.Tendsto f Filter.atTop Filter.atTop)


@[simp]
theorem coe_aeval_eq_evalRingHom (x : R) :
    ((aeval x : R[X] →ₐ[R] R) : R[X] →+* R) = evalRingHom x

↑(Polynomial.aeval x) = Polynomial.evalRingHom x


@[to_additive]
lemma extend_smul {M α β : Type*} [SMul M β] (r : M) (f : ι → α) (g : ι → β) (e : α → β) :
    extend f (r • g) (r • e) = r • extend f g e

{ι : Type u_1}
{M : Type u_7}
{α : Type u_8}
{β : Type u_9}
[SMul M β]
(r : M)
(f : ι → α)
(g : ι → β)
(e : α → β)

Function.extend f (r • g) (r • e) = r • Function.extend f g e


theorem opNorm_prod (f : ContinuousMultilinearMap 𝕜 E G) (g : ContinuousMultilinearMap 𝕜 E G') :
    ‖f.prod g‖ = max ‖f‖ ‖g‖

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


lemma LinearMap.ker_localizedMap_eq_localized'_ker (g : M →ₗ[R] P) :
    LinearMap.ker (IsLocalizedModule.map p f f' g) =
      ((LinearMap.ker g).localized' S p f).restrictScalars _

{R : Type u}
(S : Type u')
{M : Type v}
{N : Type v'}
[CommRing R]
[CommRing S]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
[Algebra R S]
[Module S N]
[IsScalarTower R S N]
(p : Submonoid R)
[IsLocalization p S]
(f : M →ₗ[R] N)
[IsLocalizedModule p f]
{P : Type w}
[AddCommGroup P]
[Module R P]
{Q : Type w'}
[AddCommGroup Q]
[Module R Q]
[Module S Q]
[IsScalarTower R S Q]
(f' : P →ₗ[R] Q)
[IsLocalizedModule p f']
(g : M →ₗ[R] P)

LinearMap.ker ((IsLocalizedModule.map p f f') g) =
  Submodule.restrictScalars R (Submodule.localized' S p f (LinearMap.ker g))


/-- The quotient norm is nonnegative. -/
theorem quotient_norm_nonneg (S : AddSubgroup M) (x : M ⧸ S) : 0 ≤ ‖x‖

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


@[to_additive (attr := simp)]
theorem one_apply (a : α) : (1 : α →*o β) a = 1

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
[MulOneClass α]
[MulOneClass β]
(a : α)


theorem _root_.Monotone.isBoundedUnder_le_comp [Preorder α] [Preorder β] {l : Filter γ} {u : γ → α}
    {v : α → β} (hv : Monotone v) (hl : l.IsBoundedUnder (· ≤ ·) u) :
    l.IsBoundedUnder (· ≤ ·) (v ∘ u)

(hl : Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l u)

Filter.IsBoundedUnder (fun x x_1 => x ≤ x_1) l (v ∘ u)


theorem summable_mul_of_Lp_Lq_of_nonneg (hpq : p.IsConjExponent q) (hf : ∀ i, 0 ≤ f i)
    (hg : ∀ i, 0 ≤ g i) (hf_sum : Summable fun i => f i ^ p) (hg_sum : Summable fun i => g i ^ q) :
    Summable fun i => f i * g i

{ι : Type u}
{f g : ι → ℝ}
{p q : ℝ}
(hpq : p.IsConjExponent q)
(hf : ∀ (i : ι), 0 ≤ f i)
(hg : ∀ (i : ι), 0 ≤ g i)
(hf_sum : Summable fun i => f i ^ p)
(hg_sum : Summable fun i => g i ^ q)


theorem rpow_add (hx : 0 < x) (y z : ℝ) : x ^ (y + z) = x ^ y * x ^ z


theorem comp {g : NormedAddGroupHom V₂ V₃} {f : NormedAddGroupHom V₁ V₂} (hg : g.NormNoninc)
    (hf : f.NormNoninc) : (g.comp f).NormNoninc

{V₁ : Type u_3}
{V₂ : Type u_4}
{V₃ : Type u_5}
[SeminormedAddCommGroup V₁]
[SeminormedAddCommGroup V₂]
[SeminormedAddCommGroup V₃]
{g : NormedAddGroupHom V₂ V₃}
{f : NormedAddGroupHom V₁ V₂}
(hg : g.NormNoninc)
(hf : f.NormNoninc)


theorem mk'_mul (x y : B) (hx : IsIntegral R x) (hy : IsIntegral R y) :
    mk' A (x * y) (hx.mul hy) = mk' A x hx * mk' A y hy

{R : Type u_1}
(A : Type u_2)
{B : Type u_3}
[CommRing R]
[CommRing A]
[CommRing B]
[Algebra R B]
[Algebra A B]
[IsIntegralClosure A R B]
(x y : B)
(hx : IsIntegral R x)
(hy : IsIntegral R y)

IsIntegralClosure.mk' A (x * y) ⋯ = IsIntegralClosure.mk' A x hx * IsIntegralClosure.mk' A y hy


/-- The *stars and bars* lemma: the cardinality of `Sym α k` is equal to
`Nat.choose (card α + k - 1) k`. -/
theorem card_sym_eq_choose {α : Type*} [Fintype α] (k : ℕ) [Fintype (Sym α k)] :
    card (Sym α k) = (card α + k - 1).choose k

{α : Type u_3}
[Fintype α]
(k : ℕ)
[Fintype (Sym α k)]

Fintype.card (Sym α k) = (Fintype.card α + k - 1).choose k


/-- The equivalence `F.Elementsᵒᵖ ≅ (yoneda, F)` given by yoneda lemma. -/
@[simps! functor_obj functor_map inverse_obj inverse_map unitIso_inv counitIso_hom counitIso_inv]
def costructuredArrowYonedaEquivalence (F : Cᵒᵖ ⥤ Type v) :
    F.Elementsᵒᵖ ≌ CostructuredArrow yoneda F

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

∀ {X Y : F.Elementsᵒᵖ} (f : X ⟶ Y),
  (CategoryTheory.CategoryOfElements.costructuredArrowYonedaEquivalence F).functor.map f =
    CategoryTheory.CostructuredArrow.homMk (↑f.unop).unop ⋯


@[continuity, fun_prop]
theorem continuous_apply (i : ι) : Continuous fun p : ∀ i, π i => p i

{ι : Type u_5}
{π : ι → Type u_6}
[T : (i : ι) → TopologicalSpace (π i)]
(i : ι)


@[reassoc (attr := simp)]
theorem biproduct.ι_π_ne (f : J → C) [HasBiproduct f] {j j' : J} (h : j ≠ j') :
    biproduct.ι f j ≫ biproduct.π f j' = 0

CategoryTheory.Limits.biproduct.ι f j ≫ CategoryTheory.Limits.biproduct.π f j' = 0


theorem contDiff_prod {t : Finset ι} {f : ι → E → 𝔸'} (h : ∀ i ∈ t, ContDiff 𝕜 n (f i)) :
    ContDiff 𝕜 n fun y => ∏ i ∈ t, f i y

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{n : ℕ∞}
{𝔸' : Type u_4}
{ι : Type u_5}
[NormedCommRing 𝔸']
[NormedAlgebra 𝕜 𝔸']
{t : Finset ι}
{f : ι → E → 𝔸'}
(h : ∀ i ∈ t, ContDiff 𝕜 n (f i))


@[reassoc (attr := simp)]
theorem piComparison_comp_π [HasProduct f] [HasProduct fun b => G.obj (f b)] (b : β) :
    piComparison G f ≫ Pi.π _ b = G.map (Pi.π f b)

[CategoryTheory.Limits.HasProduct fun b => G.obj (f b)]

CategoryTheory.Limits.piComparison G f ≫ CategoryTheory.Limits.Pi.π (fun b => G.obj (f b)) b =
  G.map (CategoryTheory.Limits.Pi.π f b)


lemma coe_comp {X Y Z : RingCat} {f : X ⟶ Y} {g : Y ⟶ Z} : (f ≫ g : X → Z) = g ∘ f


@[simp] theorem isLeft_inl : (inl x : α ⊕ β).isLeft = true


theorem polar_smul [Monoid S] [DistribMulAction S N] (f : M → N) (s : S) (x y : M) :
    polar (s • f) x y = s • polar f x y

{S : Type u_1}
{M : Type u_4}
{N : Type u_5}
[AddCommGroup M]
[AddCommGroup N]
[Monoid S]
[DistribMulAction S N]
(f : M → N)
(s : S)
(x y : M)

QuadraticMap.polar (s • f) x y = s • QuadraticMap.polar f x y


/-- If `s` and `t` are compact sets, then the set neighborhoods filter of `s ×ˢ t`
is the product of set neighborhoods filters for `s` and `t`.

For general sets, only the `≤` inequality holds, see `nhdsSet_prod_le`. -/
theorem IsCompact.nhdsSet_prod_eq {t : Set Y} (hs : IsCompact s) (ht : IsCompact t) :
    𝓝ˢ (s ×ˢ t) = 𝓝ˢ s ×ˢ 𝓝ˢ t

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{s : Set X}
{t : Set Y}
(hs : IsCompact s)
(ht : IsCompact t)

𝓝ˢ (s ×ˢ t) = 𝓝ˢ s ×ˢ 𝓝ˢ t


/-- If `Irreducible (cyclotomic p K)` (in particular for `K = ℚ`) and `p` is an odd prime,
then the norm of `ζ - 1` is `p`. -/
theorem norm_sub_one_of_prime_ne_two' [hpri : Fact (p : ℕ).Prime]
    [hcyc : IsCyclotomicExtension {p} K L] (hζ : IsPrimitiveRoot ζ p)
    (hirr : Irreducible (cyclotomic p K)) (h : p ≠ 2) : norm K (ζ - 1) = p

(hirr : Irreducible (Polynomial.cyclotomic (↑p) K))


@[simp]
theorem mul_apply (φ ψ : A →ₐc[R] A) (x : A) : (φ * ψ) x = φ (ψ x)

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[CoalgebraStruct R A]
(φ ψ : A →ₐc[R] A)
(x : A)


theorem shift_coeff (x : 𝕎 R) (n k : ℕ) : (x.shift n).coeff k = x.coeff (n + k)

{p : ℕ}
{R : Type u_1}
(x : WittVector p R)
(n k : ℕ)


theorem effectiveEpiFamily_tfae
    {α : Type} [Finite α] {B : CompHaus.{u}}
    (X : α → CompHaus.{u}) (π : (a : α) → (X a ⟶ B)) :
    TFAE
    [ EffectiveEpiFamily X π
    , Epi (Sigma.desc π)
    , ∀ b : B, ∃ (a : α) (x : X a), π a x = b
    ]

{α : Type}
[Finite α]
{B : CompHaus}
(X : α → CompHaus)
(π : (a : α) → X a ⟶ B)

[CategoryTheory.EffectiveEpiFamily X π, CategoryTheory.Epi (CategoryTheory.Limits.Sigma.desc π),
    ∀ (b : ↑B.toTop), ∃ a x, (π a) x = b].TFAE


@[simp]
theorem dualTensorHomEquivOfBasis_toLinearMap :
    (dualTensorHomEquivOfBasis b : Module.Dual R M ⊗[R] N ≃ₗ[R] M →ₗ[R] N).toLinearMap =
      dualTensorHom R M N

{ι : Type w}
{R : Type u}
{M : Type v₁}
{N : Type v₂}
[CommRing R]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
[DecidableEq ι]
[Fintype ι]
(b : Basis ι R M)

↑(dualTensorHomEquivOfBasis b) = dualTensorHom R M N


theorem Algebra.IsSeparable.isSeparable [Algebra.IsSeparable F K] : ∀ x : K, IsSeparable F x

(F : Type u_1)
{K : Type u_2}
[CommRing F]
[Ring K]
[Algebra F K]
[Algebra.IsSeparable F K]
(x : K)


/-- A version of `get_map` that can be used for rewriting. -/
@[deprecated getElem_map_rev (since := "2024-06-12")]
theorem get_map_rev (f : α → β) {l n} :
    f (get l n) = get (map f l) ⟨n.1, (l.length_map f).symm ▸ n.2⟩

{α : Type u}
{β : Type v}
(f : α → β)
{l : List α}
{n : Fin l.length}

f (l.get n) = (List.map f l).get ⟨↑n, ⋯⟩


@[simp]
theorem drop_eq_nil_iff_le {l : List α} {k : Nat} : l.drop k = [] ↔ l.length ≤ k


/-- The cardinality of the multiset `nthRoots ↑n (1 : R)` is `n`
if there is a primitive root of unity in `R`. -/
theorem card_nthRoots_one {ζ : R} {n : ℕ} (h : IsPrimitiveRoot ζ n) :
    Multiset.card (nthRoots n (1 : R)) = n

{R : Type u_4}
[CommRing R]
[IsDomain R]
{ζ : R}
{n : ℕ}
(h : IsPrimitiveRoot ζ n)

Multiset.card (Polynomial.nthRoots n 1) = n


/-- See also `finprod_mem_finset_product'`. -/
@[to_additive "See also `finsum_mem_finset_product'`."]
theorem finprod_mem_finset_product (s : Finset (α × β)) (f : α × β → M) :
    (∏ᶠ (ab) (_ : ab ∈ s), f ab) = ∏ᶠ (a) (b) (_ : (a, b) ∈ s), f (a, b)

{α : Type u_1}
{β : Type u_2}
{M : Type u_5}
[AddCommMonoid M]
(s : Finset (α × β))
(f : α × β → M)

∑ᶠ (ab : α × β) (_ : ab ∈ s), f ab = ∑ᶠ (a : α) (b : β) (_ : (a, b) ∈ s), f (a, b)


/-- The map `(f : M →ₗ[R] M')` is a localization of modules iff the map
`(localization S) × M → N, (s, m) ↦ s • f m` is the tensor product (insomuch as it is the universal
bilinear map).
In particular, there is an isomorphism between `LocalizedModule S M` and `(Localization S) ⊗[R] M`
given by `m/s ↦ (1/s) ⊗ₜ m`.
-/
theorem isLocalizedModule_iff_isBaseChange : IsLocalizedModule S f ↔ IsBaseChange A f

{R : Type u_1}
[CommSemiring R]
(S : Submonoid R)
(A : Type u_2)
[CommRing A]
[Algebra R A]
[IsLocalization S A]
{M : Type u_3}
[AddCommMonoid M]
[Module R M]
{M' : Type u_4}
[AddCommMonoid M']
[Module R M']
[Module A M']
[IsScalarTower R A M']
(f : M →ₗ[R] M')


/-- The equivalence closure of an equivalence relation r is r. -/
@[simp]
theorem eqvGen_of_setoid (r : Setoid α) : EqvGen.Setoid r.r = r


@[fun_prop]
lemma ContinuousAt.inf (hf : ContinuousAt f x) (hg : ContinuousAt g x) :
    ContinuousAt (fun a ↦ f a ⊓ g a) x

{L : Type u_1}
{X : Type u_2}
[TopologicalSpace L]
[TopologicalSpace X]
[Inf L]
[ContinuousInf L]
{f g : X → L}
{x : X}
(hf : ContinuousAt f x)
(hg : ContinuousAt g x)


theorem mul_invOf_self [Mul α] [One α] (a : α) [Invertible a] : a * ⅟ a = 1

{α : Type u}
[Mul α]
[One α]
(a : α)
[Invertible a]


@[to_additive (attr := simp)]
theorem finprod_false (f : False → M) : ∏ᶠ i, f i = 1

{M : Type u_2}
[CommMonoid M]
(f : False → M)


/-- If two morphisms are exact on pseudoelements, they are exact. -/
theorem exact_of_pseudo_exact (S : ShortComplex C)
    (hS : ∀ b, S.g b = 0 → ∃ a, S.f a = b) : S.Exact

(hS :
  ∀ (b : CategoryTheory.Abelian.Pseudoelement S.X₂),
    CategoryTheory.Abelian.Pseudoelement.pseudoApply S.g b = 0 →
      ∃ a, CategoryTheory.Abelian.Pseudoelement.pseudoApply S.f a = b)


/-- Auxilary lemma showing that for any `k : ℤ` the function `z → 1/(c*z+d)^k` is
differentiable on `{z : ℂ | 0 < z.im}`. -/
lemma div_linear_zpow_differentiableOn (k : ℤ) (a : Fin 2 → ℤ) :
    DifferentiableOn ℂ (fun z : ℂ => (a 0 * z + a 1) ^ (-k)) {z : ℂ | 0 < z.im}

DifferentiableOn ℂ (fun z => (↑(a 0) * z + ↑(a 1)) ^ (-k)) {z | 0 < z.im}


@[simp]
theorem coe_toHomeomorph (h : α ≃ᵢ β) : ⇑h.toHomeomorph = h

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
(h : α ≃ᵢ β)


theorem mk_univ_quaternion_of_infinite [Infinite R] : #(Set.univ : Set ℍ[R]) = #R

(R : Type u_1)
[One R]
[Neg R]
[Infinite R]


theorem mem_dlookup_kunion {a} {b : β a} {l₁ l₂ : List (Sigma β)} :
    b ∈ dlookup a (kunion l₁ l₂) ↔ b ∈ dlookup a l₁ ∨ a ∉ l₁.keys ∧ b ∈ dlookup a l₂

{α : Type u}
{β : α → Type v}
[DecidableEq α]
{a : α}
{b : β a}
{l₁ l₂ : List (Sigma β)}

b ∈ List.dlookup a (l₁.kunion l₂) ↔ b ∈ List.dlookup a l₁ ∨ a ∉ l₁.keys ∧ b ∈ List.dlookup a l₂


/-- A specialized ext lemma for equality of `PSigma` types over an indexed subtype. -/
@[ext]
theorem subtype_ext {β : Sort*} {p : α → β → Prop} :
    ∀ {x₀ x₁ : Σ'a, Subtype (p a)}, x₀.fst = x₁.fst → (x₀.snd : β) = x₁.snd → x₀ = x₁

{α : Sort u_1}
{β : Sort u_3}
{p : α → β → Prop}
{x₀ x₁ : (a : α) ×' Subtype (p a)}

x₀.fst = x₁.fst → x₀.snd.val = x₁.snd.val → x₀ = x₁


@[simp]
theorem sumCompl_apply_symm_of_pos (p : α → Prop) [DecidablePred p] (a : α) (h : p a) :
    (sumCompl p).symm a = Sum.inl ⟨a, h⟩

{α : Type u_1}
(p : α → Prop)
[DecidablePred p]
(a : α)
(h : p a)

(Equiv.sumCompl p).symm a = Sum.inl ⟨a, h⟩


@[simp]
theorem natDegree_intCast (n : ℤ) : natDegree (n : R[X]) = 0


@[simp]
theorem cocone_naturality {j j' : J} (f : j ⟶ j') :
    F.map f ≫ coconeMorphism F j' = coconeMorphism F j

{J : Type v}
[CategoryTheory.SmallCategory J]
(F : J ⥤ MonCat)
{j j' : J}
(f : j ⟶ j')

F.map f ≫ MonCat.Colimits.coconeMorphism F j' = MonCat.Colimits.coconeMorphism F j


@[simp]
theorem real_smul {x : ℝ} {z : ℂ} : x • z = x * z


@[simp]
theorem map_swap_divisorsAntidiagonal :
    (divisorsAntidiagonal n).map (Equiv.prodComm _ _).toEmbedding = divisorsAntidiagonal n

Finset.map (Equiv.prodComm ℕ ℕ).toEmbedding n.divisorsAntidiagonal = n.divisorsAntidiagonal


theorem gradient_const : ∇ (fun _ => c) x = 0

{𝕜 : Type u_1}
{F : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup F]
[InnerProductSpace 𝕜 F]
[CompleteSpace F]
(x : F)
(c : 𝕜)


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


/-- A special case of `ContinuousOn.comp_fract`. -/
theorem ContinuousOn.comp_fract'' {f : α → β} (h : ContinuousOn f I) (hf : f 0 = f 1) :
    Continuous (f ∘ fract)

{α : Type u_1}
{β : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
[TopologicalSpace α]
[OrderTopology α]
[TopologicalSpace β]
{f : α → β}
(h : ContinuousOn f (Set.Icc 0 1))
(hf : f 0 = f 1)


theorem Pi.lift_π {β : Type w} {f : β → C} [HasProduct f] {P : C} (p : ∀ b, P ⟶ f b) (b : β) :
    Pi.lift p ≫ Pi.π f b = p b

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{β : Type w}
{f : β → C}
[CategoryTheory.Limits.HasProduct f]
{P : C}
(p : (b : β) → P ⟶ f b)
(b : β)

CategoryTheory.Limits.Pi.lift p ≫ CategoryTheory.Limits.Pi.π f b = p b


/-- The distance between two points in a set is controlled by the diameter of the set. -/
theorem dist_le_diam_of_mem' (h : EMetric.diam s ≠ ⊤) (hx : x ∈ s) (hy : y ∈ s) :
    dist x y ≤ diam s

{α : Type u}
[PseudoMetricSpace α]
{s : Set α}
{x y : α}
(h : EMetric.diam s ≠ ⊤)
(hx : x ∈ s)
(hy : y ∈ s)


/-- We can also build a morphism in the arrow category out of any commutative square in `T`. -/
@[simps]
def homMk' {X Y : T} {f : X ⟶ Y} {P Q : T} {g : P ⟶ Q} {u : X ⟶ P} {v : Y ⟶ Q} (w : u ≫ g = f ≫ v) :
    Arrow.mk f ⟶ Arrow.mk g

(w : CategoryTheory.CategoryStruct.comp u g = CategoryTheory.CategoryStruct.comp f v)

(CategoryTheory.Arrow.homMk' w).right = v


theorem closedBall_mem_nhds (x : α) {ε : ℝ≥0∞} (ε0 : 0 < ε) : closedBall x ε ∈ 𝓝 x

{α : Type u}
[PseudoEMetricSpace α]
(x : α)
{ε : ℝ≥0∞}
(ε0 : 0 < ε)


@[simp]
theorem Filter.coLindelof_eq_bot [LindelofSpace X] : Filter.coLindelof X = ⊥

{X : Type u}
[TopologicalSpace X]
[LindelofSpace X]


protected theorem integrable (hf : Martingale f ℱ μ) (i : ι) : Integrable (f i) μ

{Ω : 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}
(hf : MeasureTheory.Martingale f ℱ μ)
(i : ι)


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


theorem isNat_natMod : {a b : ℕ} → {a' b' c : ℕ} →
    IsNat a a' → IsNat b b' → Nat.mod a' b' = c → IsNat (a % b) c

Mathlib.Meta.NormNum.IsNat a a' → Mathlib.Meta.NormNum.IsNat b b' → a'.mod b' = c → Mathlib.Meta.NormNum.IsNat (a % b) c


theorem disjSups_inter_subset_right : s ○ (t₁ ∩ t₂) ⊆ s ○ t₁ ∩ s ○ t₂

{α : Type u_2}
[DecidableEq α]
[SemilatticeSup α]
[OrderBot α]
[DecidableRel Disjoint]
{s t₁ t₂ : Finset α}

s.disjSups (t₁ ∩ t₂) ⊆ s.disjSups t₁ ∩ s.disjSups t₂


/-- A `*`-additive monoid `R` is an additive monoid with an involutive `star` operation which
preserves addition.  -/
class StarAddMonoid (R : Type u) [AddMonoid R] extends InvolutiveStar R where
  /-- `star` commutes with addition -/
  star_add : ∀ r s : R, star (r + s) = star r + star s

{R : Type u}
[AddMonoid R]
[self : StarAddMonoid R]
(r s : R)


theorem shift_equiv_triangle (n : A) (X : C) :
    (shiftShiftNeg X n).inv⟦n⟧' ≫ (shiftNegShift (X⟦n⟧) n).hom = 𝟙 (X⟦n⟧)

{C : Type u}
{A : Type u_1}
[CategoryTheory.Category.{v, u} C]
[AddGroup A]
[CategoryTheory.HasShift C A]
(n : A)
(X : C)

CategoryTheory.CategoryStruct.comp ((CategoryTheory.shiftFunctor C n).map (CategoryTheory.shiftShiftNeg X n).inv)
    (CategoryTheory.shiftNegShift ((CategoryTheory.shiftFunctor C n).obj X) n).hom =
  CategoryTheory.CategoryStruct.id ((CategoryTheory.shiftFunctor C n).obj X)


@[to_additive (attr := simp)]
theorem iterate_map_zpow {M F : Type*} [Group M] [FunLike F M M] [MonoidHomClass F M M]
    (f : F) (n : ℕ) (x : M) (k : ℤ) :
    f^[n] (x ^ k) = f^[n] x ^ k

{M : Type u_5}
{F : Type u_6}
[Group M]
[FunLike F M M]
[MonoidHomClass F M M]
(f : F)
(n : ℕ)
(x : M)
(k : ℤ)


theorem shiftLeft_add {w : Nat} (x : BitVec w) (n m : Nat) :
    x <<< (n + m) = (x <<< n) <<< m


/-- We can regard an order embedding as an order isomorphism to its range. -/
@[simps! apply]
noncomputable def OrderEmbedding.orderIso [LE α] [LE β] {f : α ↪o β} :
    α ≃o Set.range f

{α : Type u_2}
{β : Type u_3}
[LE α]
[LE β]
{f : α ↪o β}
(a : α)


@[simp]
theorem AffineEquiv.coe_toHomeomorphOfFiniteDimensional_symm (f : PE ≃ᵃ[𝕜] PF) :
    ⇑f.toHomeomorphOfFiniteDimensional.symm = f.symm

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{E : Type v}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type w}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace 𝕜]
{PE : Type u_1}
{PF : Type u_2}
[MetricSpace PE]
[NormedAddTorsor E PE]
[MetricSpace PF]
[NormedAddTorsor F PF]
[FiniteDimensional 𝕜 E]
(f : PE ≃ᵃ[𝕜] PF)


theorem ringChar_ne_zero_of_finite [Finite R] : ringChar R ≠ 0

(R : Type u_1)
[NonAssocRing R]
[Finite R]


/-- For any positive `k : ℕ` there are infinitely many primes `p` such that `p ≡ 1 [MOD k]`. -/
theorem infinite_setOf_prime_modEq_one {k : ℕ} (hk0 : k ≠ 0) :
    Set.Infinite {p : ℕ | Nat.Prime p ∧ p ≡ 1 [MOD k]}

{p | Nat.Prime p ∧ p ≡ 1 [MOD k]}.Infinite


/-- Reindex a Coxeter system through a bijection of the indexing sets. -/
@[simps]
protected def reindex (e : B ≃ B') : CoxeterSystem (M.reindex e) W

{B : Type u_1}
{B' : Type u_2}
{W : Type u_3}
[Group W]
{M : CoxeterMatrix B}
(cs : CoxeterSystem M W)
(e : B ≃ B')

(cs.reindex e).mulEquiv = cs.mulEquiv.trans (M.reindexGroupEquiv e).symm


theorem limsup_measure_le_of_le_liminf_measure_compl {ι : Type*} {L : Filter ι} {μ : Measure Ω}
    {μs : ι → Measure Ω} [IsProbabilityMeasure μ] [∀ i, IsProbabilityMeasure (μs i)] {E : Set Ω}
    (E_mble : MeasurableSet E) (h : μ Eᶜ ≤ L.liminf fun i => μs i Eᶜ) :
    (L.limsup fun i => μs i E) ≤ μ E

[∀ (i : ι), MeasureTheory.IsProbabilityMeasure (μs i)]

(h : μ Eᶜ ≤ Filter.liminf (fun i => (μs i) Eᶜ) L)

Filter.limsup (fun i => (μs i) E) L ≤ μ E


lemma zero_le_two [Preorder α] [ZeroLEOneClass α] [CovariantClass α α (·+·) (·≤·)] :
    (0 : α) ≤ 2

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


@[to_additive]
theorem unop_inf (S₁ S₂ : Submonoid Mᵐᵒᵖ) : (S₁ ⊓ S₂).unop = S₁.unop ⊓ S₂.unop

{M : Type u_2}
[MulOneClass M]
(S₁ S₂ : Submonoid Mᵐᵒᵖ)


theorem single_commute [Mul G] {a : G} {b : k} (ha : ∀ a', Commute a a') (hb : ∀ b', Commute b b') :
    ∀ f : MonoidAlgebra k G, Commute (single a b) f

{k : Type u₁}
{G : Type u₂}
[Semiring k]
[Mul G]
{a : G}
{b : k}
(ha : ∀ (a' : G), Commute a a')
(hb : ∀ (b' : k), Commute b b')
(f : MonoidAlgebra k G)


theorem image_coe_Ici : (some : α → WithTop α) '' Ici a = Ico (a : WithTop α) ⊤

WithTop.some '' Set.Ici a = Set.Ico ↑a ⊤


theorem geom_sum_Ico [DivisionRing α] {x : α} (hx : x ≠ 1) {m n : ℕ} (hmn : m ≤ n) :
    ∑ i ∈ Finset.Ico m n, x ^ i = (x ^ n - x ^ m) / (x - 1)

{α : Type u}
[DivisionRing α]
{x : α}
(hx : x ≠ 1)
{m n : ℕ}
(hmn : m ≤ n)


@[simp]
theorem sup_bihimp_bihimp : (a ⊔ b) ⇔ (a ⇔ b) = a ⊓ b

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


@[simp] lemma one_lt_factorial : 1 < n ! ↔ 1 < n


theorem erase_cons_subperm_cons_erase (a b : α) (l : List α) :
    (a :: l).erase b <+~ a :: l.erase b

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


protected theorem Set.Equicontinuous.mono {H H' : Set <| X → α} (h : H.Equicontinuous)
    (hH : H' ⊆ H) : H'.Equicontinuous

{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
{H H' : Set (X → α)}
(h : H.Equicontinuous)
(hH : H' ⊆ H)


protected theorem eq_false_of_le_false : ∀ {x : Bool}, x ≤ false → x = false


theorem filter_singleton {a : α} (p : α → Prop) [DecidablePred p] :
    filter p {a} = if p a then {a} else ∅

{α : Type u_1}
{a : α}
(p : α → Prop)
[DecidablePred p]

Multiset.filter p {a} = if p a then {a} else ∅


@[simp] lemma _root_.EquivLike.apply_coe_symm_apply {F} [EquivLike F α β] (e : F) (x : β) :
    e ((e : α ≃ β).symm x) = x

{α : Sort u}
{β : Sort v}
{F : Sort u_1}
[EquivLike F α β]
(e : F)
(x : β)


@[to_additive (attr := simp, norm_cast)]
theorem coe_div (x y : H) : (x / y).1 = x.1 / y.1

{G : Type u_1}
[Group G]
{S : Type u_6}
{H : S}
[SetLike S G]
[SubgroupClass S G]
(x y : ↥H)


/-- A cyclotomic finite extension of a number field is a number field. -/
theorem numberField [h : NumberField K] [Finite S] [IsCyclotomicExtension S K L] : NumberField L

(S : Set ℕ+)
(K : Type w)
(L : Type z)
[Field K]
[Field L]
[Algebra K L]
[h : NumberField K]
[Finite ↑S]
[IsCyclotomicExtension S K L]


/-- The submonoid of elements greater than `1`. -/
@[to_additive (attr := simps) nonneg "The submonoid of nonnegative elements."]
def oneLE : Submonoid M

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


@[norm_cast]
theorem coe_distribMulActionHom_mk (f : A →ₛₙₐ[φ] B) (h₁ h₂ h₃ h₄) :
    ((⟨⟨⟨f, h₁⟩, h₂, h₃⟩, h₄⟩ : A →ₛₙₐ[φ] B) : A →ₑ+[φ] B) = ⟨⟨f, h₁⟩, h₂, h₃⟩

(h₁ : ∀ (m : R) (x : A), f (m • x) = φ m • f x)

(h₂ : { toFun := ⇑f, map_smul' := h₁ }.toFun 0 = 0)

(h₃ :
  ∀ (x y : A),
    { toFun := ⇑f, map_smul' := h₁ }.toFun (x + y) =
      { toFun := ⇑f, map_smul' := h₁ }.toFun x + { toFun := ⇑f, map_smul' := h₁ }.toFun y)

(h₄ :
  ∀ (x y : A),
    { toFun := ⇑f, map_smul' := h₁, map_zero' := h₂, map_add' := h₃ }.toFun (x * y) =
      { toFun := ⇑f, map_smul' := h₁, map_zero' := h₂, map_add' := h₃ }.toFun x *
        { toFun := ⇑f, map_smul' := h₁, map_zero' := h₂, map_add' := h₃ }.toFun y)

↑{ toFun := ⇑f, map_smul' := h₁, map_zero' := h₂, map_add' := h₃, map_mul' := h₄ } =
  { toFun := ⇑f, map_smul' := h₁, map_zero' := h₂, map_add' := h₃ }


@[simp]
theorem enum_nil : enum (nil : Seq α) = nil


theorem count_pos {a : α} {s : Multiset α} : 0 < count a s ↔ a ∈ s

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


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


theorem mem_objs_of_src {c d : C} {f : c ⟶ d} (h : f ∈ S.arrows c d) : c ∈ S.objs

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


theorem eq_span_singleton_mul {x : R} (I J : Ideal R) :
    I = span {x} * J ↔ (∀ zI ∈ I, ∃ zJ ∈ J, x * zJ = zI) ∧ ∀ z ∈ J, x * z ∈ I

{R : Type u}
[CommSemiring R]
{x : R}
(I J : Ideal R)

I = Ideal.span {x} * J ↔ (∀ zI ∈ I, ∃ zJ ∈ J, x * zJ = zI) ∧ ∀ z ∈ J, x * z ∈ I


theorem piiUnionInter_singleton (π : ι → Set (Set α)) (i : ι) :
    piiUnionInter π {i} = π i ∪ {univ}

{α : Type u_1}
{ι : Type u_2}
(π : ι → Set (Set α))
(i : ι)


theorem degree_eq_one_of_irreducible_of_splits {p : K[X]} (hp : Irreducible p)
    (hp_splits : Splits (RingHom.id K) p) : p.degree = 1

(hp_splits : Polynomial.Splits (RingHom.id K) p)


@[to_additive]
theorem multipliable_subtype_and_compl {s : Set β} :
    ((Multipliable fun x : s ↦ f x) ∧ Multipliable fun x : ↑sᶜ ↦ f x) ↔ Multipliable f

{α : Type u_1}
{β : Type u_2}
[CommGroup α]
[UniformSpace α]
[UniformGroup α]
{f : β → α}
[CompleteSpace α]
{s : Set β}

((Multipliable fun x => f ↑x) ∧ Multipliable fun x => f ↑x) ↔ Multipliable f


theorem exists_mem_range : ∃ n : ℕ, n < p ∧ x - n ∈ maximalIdeal ℤ_[p]

{p : ℕ}
[hp_prime : Fact (Nat.Prime p)]
(x : ℤ_[p])

∃ n < p, x - ↑n ∈ LocalRing.maximalIdeal ℤ_[p]


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


@[fun_prop]
theorem Differentiable.add_const (hf : Differentiable 𝕜 f) (c : F) :
    Differentiable 𝕜 fun y => f y + c

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : E → F}
(hf : Differentiable 𝕜 f)
(c : F)


/-- See also `Ergodic.ae_empty_or_univ_of_ae_le_preimage`. -/
theorem ae_empty_or_univ_of_ae_le_preimage' (hf : Ergodic f μ) (hs : MeasurableSet s)
    (hs' : s ≤ᵐ[μ] f ⁻¹' s) (h_fin : μ s ≠ ∞) : s =ᵐ[μ] (∅ : Set α) ∨ s =ᵐ[μ] univ

{α : Type u_1}
{m : MeasurableSpace α}
{f : α → α}
{s : Set α}
{μ : MeasureTheory.Measure α}
(hf : Ergodic f μ)
(hs : MeasurableSet s)
(hs' : s ≤ᵐ[μ] f ⁻¹' s)
(h_fin : μ s ≠ ⊤)


@[to_additive sum_eq_zero_iff_of_nonneg]
theorem prod_eq_one_iff_of_one_le' :
    (∀ i ∈ s, 1 ≤ f i) → ((∏ i ∈ s, f i) = 1 ↔ ∀ i ∈ s, f i = 1)

{ι : Type u_1}
{N : Type u_5}
[OrderedAddCommMonoid N]
{f : ι → N}
{s : Finset ι}

(∀ i ∈ s, 0 ≤ f i) → (∑ i ∈ s, f i = 0 ↔ ∀ i ∈ s, f i = 0)


theorem isNoetherian_top_iff : IsNoetherian R (⊤ : Submodule R M) ↔ IsNoetherian R M

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


@[to_additive (attr := simp)]
theorem prod_singleton (f : α → β) (a : α) : ∏ x ∈ singleton a, f x = f a

{α : Type u_3}
{β : Type u_4}
[AddCommMonoid β]
(f : α → β)
(a : α)


/-- A monomorphism is injective on pseudoelements. -/
theorem pseudo_injective_of_mono {P Q : C} (f : P ⟶ Q) [Mono f] : Function.Injective f

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
{P Q : C}
(f : P ⟶ Q)
[CategoryTheory.Mono f]


lemma krullDim_eq_bot_of_isEmpty [IsEmpty α] : krullDim α = ⊥


theorem isLocalizedModule_iff_isLocalization {A Aₛ} [CommSemiring A] [Algebra R A] [CommSemiring Aₛ]
    [Algebra A Aₛ] [Algebra R Aₛ] [IsScalarTower R A Aₛ] :
    IsLocalizedModule S (IsScalarTower.toAlgHom R A Aₛ).toLinearMap ↔
      IsLocalization (Algebra.algebraMapSubmonoid A S) Aₛ

{R : Type u_1}
[CommSemiring R]
{S : Submonoid R}
{A : Type u_6}
{Aₛ : Type u_7}
[CommSemiring A]
[Algebra R A]
[CommSemiring Aₛ]
[Algebra A Aₛ]
[Algebra R Aₛ]
[IsScalarTower R A Aₛ]


@[simp] theorem comp_id (f : SupBotHom α β) : f.comp (SupBotHom.id α) = f

{α : Type u_3}
{β : Type u_4}
[Sup α]
[Bot α]
[Sup β]
[Bot β]
(f : SupBotHom α β)


theorem edist_le_mul_of_le (h : LipschitzOnWith K f s) {x y : α} (hx : x ∈ s) (hy : y ∈ s)
    {r : ℝ≥0∞} (hr : edist x y ≤ r) :
    edist (f x) (f y) ≤ K * r

{α : Type u}
{β : Type v}
[PseudoEMetricSpace α]
[PseudoEMetricSpace β]
{K : ℝ≥0}
{s : Set α}
{f : α → β}
(h : LipschitzOnWith K f s)
{x y : α}
(hx : x ∈ s)
(hy : y ∈ s)
{r : ℝ≥0∞}
(hr : edist x y ≤ r)


protected theorem mapL_smul [DecidableEq ι] (i : ι) (c : 𝕜) (u : E i →L[𝕜] E' i) :
    mapL (update f i (c • u)) = c • mapL (update f i u)

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

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

PiTensorProduct.mapL (Function.update f i (c • u)) = c • PiTensorProduct.mapL (Function.update f i u)


/-- The functor which maps undefined values to a new point. This makes the maps total and creates
pointed types. This is the noncomputable part of the equivalence `PartialFunEquivPointed`. It can't
be computable because `= Option.none` is decidable while the domain of a general `Part` isn't. -/
@[simps obj map]
noncomputable def partialFunToPointed : PartialFun ⥤ Pointed

partialFunToPointed.obj X = { X := Option X, point := none }


theorem dvd_iff_emod_eq_zero (a b : Int) : a ∣ b ↔ b % a = 0


@[simp]
theorem linear_refl : (refl k P₁).linear = LinearEquiv.refl k V₁

(k : Type u_1)
(P₁ : Type u_2)
{V₁ : Type u_6}
[Ring k]
[AddCommGroup V₁]
[Module k V₁]
[AffineSpace V₁ P₁]

(AffineEquiv.refl k P₁).linear = LinearEquiv.refl k V₁


@[to_additive ThreeAPFree.prod]
theorem ThreeGPFree.prod {t : Set β} (hs : ThreeGPFree s) (ht : ThreeGPFree t) :
    ThreeGPFree (s ×ˢ t)

{α : Type u_2}
{β : Type u_3}
[AddMonoid α]
[AddMonoid β]
{s : Set α}
{t : Set β}
(hs : ThreeAPFree s)
(ht : ThreeAPFree t)


@[simp]
lemma coe_zero [Nontrivial (weightSpace M (0 : L → R))] : ((0 : Weight R L M) : L → R) = 0

[Nontrivial ↥↑(LieModule.weightSpace M 0)]


theorem filter_apply_neg [∀ i, Zero (β i)] {p : ι → Prop} [DecidablePred p] (f : Π₀ i, β i) {i : ι}
    (h : ¬p i) : f.filter p i = 0

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


/-- The functor `Comma L R ⥤ Comma L' R'` induced by three functors `F₁`, `F₂`, `F`
and two natural transformations `F₁ ⋙ L' ⟶ L ⋙ F` and `R ⋙ F ⟶ F₂ ⋙ R'`. -/
@[simps]
def map : Comma L R ⥤ Comma L' R'

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
{A' : Type u_1}
{B' : Type u_2}
{T' : Type u_3}
[CategoryTheory.Category.{u_4, u_1} A']
[CategoryTheory.Category.{u_5, u_2} B']
[CategoryTheory.Category.{u_6, u_3} T']
{L : CategoryTheory.Functor A T}
{R : CategoryTheory.Functor B T}
{L' : CategoryTheory.Functor A' T'}
{R' : CategoryTheory.Functor B' T'}
{F₁ : CategoryTheory.Functor A A'}
{F₂ : CategoryTheory.Functor B B'}
{F : CategoryTheory.Functor T T'}
(α : F₁.comp L' ⟶ L.comp F)
(β : R.comp F ⟶ F₂.comp R')
(X : CategoryTheory.Comma L R)

((CategoryTheory.Comma.map α β).obj X).hom =
  CategoryTheory.CategoryStruct.comp (α.app X.left) (CategoryTheory.CategoryStruct.comp (F.map X.hom) (β.app X.right))


@[simp]
theorem leInfCone_π_app_none {A : C} (s : Set (Subobject A)) (f : Subobject A)
    (k : ∀ g ∈ s, f ≤ g) : (leInfCone s f k).π.app none = f.arrow

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
[CategoryTheory.WellPowered C]
{A : C}
(s : Set (CategoryTheory.Subobject A))
(f : CategoryTheory.Subobject A)
(k : ∀ g ∈ s, f ≤ g)

(CategoryTheory.Subobject.leInfCone s f k).π.app none = f.arrow


@[simp]
theorem symm_symm (e : A ≃⋆ₐ[R] B) : e.symm.symm = e

{R : Type u_2}
{A : Type u_3}
{B : Type u_4}
[Add A]
[Add B]
[Mul A]
[Mul B]
[SMul R A]
[SMul R B]
[Star A]
[Star B]
(e : A ≃⋆ₐ[R] B)


/-- The right fraction from `X` to `Y` given by a morphism `f : X ⟶ Y`. -/
@[simps]
def ofHom (f : X ⟶ Y) [W.ContainsIdentities] :
    W.RightFraction X Y

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
(W : CategoryTheory.MorphismProperty C)
{X Y : C}
(f : X ⟶ Y)
[W.ContainsIdentities]

(CategoryTheory.MorphismProperty.RightFraction.ofHom W f).f = f


theorem star_def (x : CliffordAlgebra Q) : star x = reverse (involute x)

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

star x = CliffordAlgebra.reverse (CliffordAlgebra.involute x)


@[to_additive]
lemma Nat.Coprime.orderOf_pow (h : (orderOf y).Coprime m) : orderOf (y ^ m) = orderOf y

{G : Type u_1}
[Monoid G]
{y : G}
{m : ℕ}
(h : (orderOf y).Coprime m)


theorem sSup_le_sSup_of_subset_insert_bot (h : s ⊆ insert ⊥ t) : sSup s ≤ sSup t

{α : Type u_1}
[CompleteLattice α]
{s t : Set α}
(h : s ⊆ insert ⊥ t)


/--
A complete Boolean algebra is a Boolean algebra that is also a complete distributive lattice.

It is only completely distributive if it is also atomic.
-/
-- We do not directly extend `CompleteDistribLattice` to avoid having the `hnot` field
class CompleteBooleanAlgebra (α) extends CompleteLattice α, BooleanAlgebra α where
  /-- `⊓` distributes over `⨆`. -/
  inf_sSup_le_iSup_inf (a : α) (s : Set α) : a ⊓ sSup s ≤ ⨆ b ∈ s, a ⊓ b
  /-- `⊔` distributes over `⨅`. -/
  iInf_sup_le_sup_sInf (a : α) (s : Set α) : ⨅ b ∈ s, a ⊔ b ≤ a ⊔ sInf s

{α : Type u_1}
[self : CompleteBooleanAlgebra α]
(a : α)
(s : Set α)


/-- Auxiliary definition for `AlgebraicGeometry.PresheafedSpace.instHasColimits`.
-/
@[simps]
def colimitCocone (F : J ⥤ PresheafedSpace.{_, _, v} C) : Cocone F

[∀ (X : TopCat), CategoryTheory.Limits.HasLimitsOfShape Jᵒᵖ (TopCat.Presheaf C X)]

(F : J ⥤ AlgebraicGeometry.PresheafedSpace C)

((AlgebraicGeometry.PresheafedSpace.colimitCocone F).ι.app j).c =
  CategoryTheory.Limits.limit.π (AlgebraicGeometry.PresheafedSpace.pushforwardDiagramToColimit F).leftOp (Opposite.op j)


/-- `Aᵀ` has orthogonal rows iff `A` has orthogonal columns. -/
@[simp]
theorem transpose_hasOrthogonalRows_iff_hasOrthogonalCols [Fintype m] :
    Aᵀ.HasOrthogonalRows ↔ A.HasOrthogonalCols

{α : Type u_1}
{n : Type u_2}
{m : Type u_3}
[Mul α]
[AddCommMonoid α]
(A : Matrix m n α)
[Fintype m]


/-- In a space with the Besicovitch covering property, the ratio of the measure of balls converges
almost surely to the Radon-Nikodym derivative. -/
theorem ae_tendsto_rnDeriv (ρ μ : Measure β) [IsLocallyFiniteMeasure μ] [IsLocallyFiniteMeasure ρ] :
    ∀ᵐ x ∂μ,
      Tendsto (fun r => ρ (closedBall x r) / μ (closedBall x r)) (𝓝[>] 0) (𝓝 (ρ.rnDeriv μ x))

∀ᵐ (x : β) ∂μ,
  Filter.Tendsto (fun r => ρ (Metric.closedBall x r) / μ (Metric.closedBall x r)) (𝓝[>] 0) (𝓝 (ρ.rnDeriv μ x))


@[simp]
theorem mul_eq_left₀ (ha : a ≠ 0) : a * b = a ↔ b = 1

{M₀ : Type u_2}
[CancelMonoidWithZero M₀]
{a b : M₀}
(ha : a ≠ 0)


theorem tendsto_Ioi_atTop [SemilatticeSup α] {a : α} {f : β → Ioi a} {l : Filter β} :
    Tendsto f l atTop ↔ Tendsto (fun x => (f x : α)) l atTop

{α : Type u_3}
{β : Type u_4}
[SemilatticeSup α]
{a : α}
{f : β → ↑(Set.Ioi a)}
{l : Filter β}

Filter.Tendsto f l Filter.atTop ↔ Filter.Tendsto (fun x => ↑(f x)) l Filter.atTop


@[trans]
theorem IsBigO.trans_eventuallyEq {f : α → E} {g₁ g₂ : α → F} (h : f =O[l] g₁) (hg : g₁ =ᶠ[l] g₂) :
    f =O[l] g₂

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{l : Filter α}
{f : α → E}
{g₁ g₂ : α → F}
(h : f =O[l] g₁)
(hg : g₁ =ᶠ[l] g₂)


theorem disjoin_manyOneReducible {α β γ} [Primcodable α] [Primcodable β] [Primcodable γ]
    {p : α → Prop} {q : β → Prop} {r : γ → Prop} : p ≤₀ r → q ≤₀ r → (p ⊕' q) ≤₀ r

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Primcodable α]
[Primcodable β]
[Primcodable γ]
{p : α → Prop}
{q : β → Prop}
{r : γ → Prop}

p ≤₀ r → q ≤₀ r → p ⊕' q ≤₀ r


@[reassoc (attr := simp)]
theorem lift_comp_preservesLimitsIso_hom (t : Cone F) :
    G.map (limit.lift _ t) ≫ (preservesLimitIso G F).hom =
    limit.lift (F ⋙ G) (G.mapCone _)

CategoryTheory.CategoryStruct.comp (G.map (CategoryTheory.Limits.limit.lift F t))
    (CategoryTheory.preservesLimitIso G F).hom =
  CategoryTheory.Limits.limit.lift (F.comp G) (G.mapCone t)


theorem monotone_preimage {f : α → β} : Monotone (preimage f)

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


theorem monic_geom_sum_X {n : ℕ} (hn : n ≠ 0) : (∑ i ∈ range n, (X : R[X]) ^ i).Monic

{R : Type u}
[Semiring R]
{n : ℕ}
(hn : n ≠ 0)

(∑ i ∈ Finset.range n, Polynomial.X ^ i).Monic


theorem cons_diff (a : α) (l₁ l₂ : List α) :
    (a :: l₁).diff l₂ = if a ∈ l₂ then l₁.diff (l₂.erase a) else a :: l₁.diff l₂

{α : Type u_1}
[BEq α]
[LawfulBEq α]
(a : α)
(l₁ l₂ : List α)


/-- The harmonic series restricted to a residue class is not summable. -/
lemma Real.not_summable_indicator_one_div_natCast {m : ℕ} (hm : m ≠ 0) (k : ZMod m) :
    ¬ Summable ({n : ℕ | (n : ZMod m) = k}.indicator fun n : ℕ ↦ (1 / n : ℝ))

¬Summable ({n | ↑n = k}.indicator fun n => 1 / ↑n)


@[to_additive]
lemma eq_bot_iff_card : S = ⊥ ↔ card S = 1

{M : Type u_1}
[Monoid M]
{S : Submonoid M}
[Fintype ↥S]


theorem smul_eq_C_mul (f : R⟦X⟧) (a : R) : a • f = C R a * f

{R : Type u_1}
[Semiring R]
(f : PowerSeries R)
(a : R)


@[simp] lemma Hom.id_toFun' (X : Pointed.{u}) : (𝟙 X : X ⟶ X).toFun = _root_.id


/-- Two equivalent ways to express the evaluation of a bivariate polynomial over `R`
at a point in the affine plane over an `R`-algebra `S`. -/
lemma eval₂RingHom_eval₂RingHom (f : R →+* S) (x y : S) :
    eval₂RingHom (eval₂RingHom f x) y =
      (evalEvalRingHom x y).comp (mapRingHom <| mapRingHom f)

{R : Type u_1}
{S : Type u_2}
[CommSemiring R]
[CommSemiring S]
(f : R →+* S)
(x y : S)

Polynomial.eval₂RingHom (Polynomial.eval₂RingHom f x) y =
  (Polynomial.evalEvalRingHom x y).comp (Polynomial.mapRingHom (Polynomial.mapRingHom f))


@[to_additive]
theorem append_append (h₁ : Red L₁ L₃) (h₂ : Red L₂ L₄) : Red (L₁ ++ L₂) (L₃ ++ L₄)

{α : Type u}
{L₁ L₂ L₃ L₄ : List (α × Bool)}
(h₁ : FreeAddGroup.Red L₁ L₃)
(h₂ : FreeAddGroup.Red L₂ L₄)


theorem OneOneEquiv.congr_right {α β γ} [Primcodable α] [Primcodable β] [Primcodable γ]
    {p : α → Prop} {q : β → Prop} {r : γ → Prop} (h : OneOneEquiv q r) :
    OneOneEquiv p q ↔ OneOneEquiv p r

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
[Primcodable α]
[Primcodable β]
[Primcodable γ]
{p : α → Prop}
{q : β → Prop}
{r : γ → Prop}
(h : OneOneEquiv q r)


@[simp]
theorem hyperoperation_two : hyperoperation 2 = (· * ·)


/-- A binary product of proper maps is proper. -/
lemma IsProperMap.prod_map {g : Z → W} (hf : IsProperMap f) (hg : IsProperMap g) :
    IsProperMap (Prod.map f g)

{X : Type u_1}
{Y : Type u_2}
{Z : Type u_3}
{W : Type u_4}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
[TopologicalSpace W]
{f : X → Y}
{g : Z → W}
(hf : IsProperMap f)
(hg : IsProperMap g)


@[simp]
theorem norm_intCast (n : ℤ) : norm (n : ℤ√d) = n * n


theorem natDegree_num_mul_right_sub_natDegree_denom_mul_left_eq_intDegree {x : RatFunc K}
    (hx : x ≠ 0) {s : K[X]} (hs : s ≠ 0) :
    ((x.num * s).natDegree : ℤ) - (s * x.denom).natDegree = x.intDegree

{K : Type u}
[Field K]
{x : RatFunc K}
(hx : x ≠ 0)
{s : Polynomial K}
(hs : s ≠ 0)

↑(x.num * s).natDegree - ↑(s * x.denom).natDegree = x.intDegree


theorem IsMinOn.inf (hf : IsMinOn f s a) (hg : IsMinOn g s a) : IsMinOn (fun x => f x ⊓ g x) s a

{α : Type u}
{β : Type v}
[SemilatticeInf β]
{f g : α → β}
{a : α}
{s : Set α}
(hf : IsMinOn f s a)
(hg : IsMinOn g s a)


/-- A functor `F : C ⥤ D` sends binary bicones for `P` and `Q`
to binary bicones for `G.obj P` and `G.obj Q` functorially. -/
@[simps]
def functoriality : BinaryBicone P Q ⥤ BinaryBicone (F.obj P) (F.obj Q)

∀ {X Y : CategoryTheory.Limits.BinaryBicone P Q} (f : X ⟶ Y),
  ((CategoryTheory.Limits.BinaryBicones.functoriality P Q F).map f).hom = F.map f.hom


/-- A functor `F : T ⥤ D` induces a functor `Under X ⥤ Under (F.obj X)` in the obvious way. -/
@[simps]
def post {X : T} (F : T ⥤ D) : Under X ⥤ Under (F.obj X)

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

∀ {X_1 Y : CategoryTheory.Under X} (f : X_1 ⟶ Y),
  (CategoryTheory.Under.post F).map f = CategoryTheory.Under.homMk (F.map f.right) ⋯


/-- Multiplication as a multiplicative homomorphism. -/
@[to_additive (attr := simps) "Addition as an additive homomorphism."]
def mulMulHom [CommSemigroup α] :
    α × α →ₙ* α

{α : Type u_8}
[AddCommSemigroup α]
(a : α × α)


@[simp]
theorem map_singletonSubgraph (f : G →g G') {v : V} :
    Subgraph.map f (G.singletonSubgraph v) = G'.singletonSubgraph (f v)

{V : Type u}
{W : Type v}
{G : SimpleGraph V}
{G' : SimpleGraph W}
(f : G →g G')
{v : V}

SimpleGraph.Subgraph.map f (G.singletonSubgraph v) = G'.singletonSubgraph (f v)


/-- If `f` is a Hölder continuous map with exponent `r > 0`, then the Hausdorff dimension of its
range is at most the Hausdorff dimension of its domain divided by `r`. -/
theorem dimH_range_le (h : HolderWith C r f) (hr : 0 < r) :
    dimH (range f) ≤ dimH (univ : Set X) / r

{X : Type u_2}
{Y : Type u_3}
[EMetricSpace X]
[EMetricSpace Y]
{C r : ℝ≥0}
{f : X → Y}
(h : HolderWith C r f)
(hr : 0 < r)


theorem coe_ne_one {x : Ioc (0 : α) 1} : (x : α) ≠ 1 ↔ x ≠ 1

{α : Type u_1}
[StrictOrderedSemiring α]
{x : ↑(Set.Ioc 0 1)}

↑x ≠ 1 ↔ x ≠ 1


@[simp]
theorem toSubalgebra_eq_iff : F.toSubalgebra = E.toSubalgebra ↔ F = E

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
{F E : IntermediateField K L}


theorem mk_le_mk_iff_dvd {a b : α} : Associates.mk a ≤ Associates.mk b ↔ a ∣ b


theorem map_eq_of_inverse {f : Filter α} {g : Filter β} {φ : α → β} (ψ : β → α) (eq : φ ∘ ψ = id)
    (hφ : Tendsto φ f g) (hψ : Tendsto ψ g f) : map φ f = g

{α : Type u}
{β : Type v}
{f : Filter α}
{g : Filter β}
{φ : α → β}
(ψ : β → α)
(eq : φ ∘ ψ = id)
(hφ : Filter.Tendsto φ f g)
(hψ : Filter.Tendsto ψ g f)


@[simp]
theorem sorted_cons {a : α} {l : List α} : Sorted r (a :: l) ↔ (∀ b ∈ l, r a b) ∧ Sorted r l

{α : Type u}
{r : α → α → Prop}
{a : α}
{l : List α}

List.Sorted r (a :: l) ↔ (∀ b ∈ l, r a b) ∧ List.Sorted r l


lemma shiftFunctorAdd_hom_app_f (K : CochainComplex C ℤ) (a b n : ℤ) :
    ((shiftFunctorAdd (CochainComplex C ℤ) a b).hom.app K).f n =
      (K.XIsoOfEq (by dsimp; rw [add_comm a, add_assoc])).hom

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Preadditive C]
(K : CochainComplex C ℤ)
(a b n : ℤ)

((CategoryTheory.shiftFunctorAdd (CochainComplex C ℤ) a b).hom.app K).f n = (HomologicalComplex.XIsoOfEq K ⋯).hom


/-- The image under an antitone function of a set which is bounded below is bounded above. -/
theorem map_bddBelow (Hf : AntitoneOn f t) (Hst : s ⊆ t) :
    (lowerBounds s ∩ t).Nonempty → BddAbove (f '' s)

{α : Type u}
{β : Type v}
[Preorder α]
[Preorder β]
{f : α → β}
{s t : Set α}
(Hf : AntitoneOn f t)
(Hst : s ⊆ t)


theorem forall_image₂_iff {p : γ → Prop} :
    (∀ z ∈ image₂ f s t, p z) ↔ ∀ x ∈ s, ∀ y ∈ t, p (f x y)

{α : Type u_1}
{β : Type u_3}
{γ : Type u_5}
[DecidableEq γ]
{f : α → β → γ}
{s : Finset α}
{t : Finset β}
{p : γ → Prop}

(∀ z ∈ Finset.image₂ f s t, p z) ↔ ∀ x ∈ s, ∀ y ∈ t, p (f x y)


/-- An algebra of sets is a family of sets containing the empty set and closed by complement and
union. Consequently it is also closed by difference (see `IsSetAlgebra.diff_mem`) and intersection
(see `IsSetAlgebra.inter_mem`). -/
structure IsSetAlgebra (𝒜 : Set (Set α)) : Prop where
  empty_mem : ∅ ∈ 𝒜
  compl_mem : ∀ ⦃s⦄, s ∈ 𝒜 → sᶜ ∈ 𝒜
  union_mem : ∀ ⦃s t⦄, s ∈ 𝒜 → t ∈ 𝒜 → s ∪ t ∈ 𝒜

{α : Type u_1}
{𝒜 : Set (Set α)}
(self : MeasureTheory.IsSetAlgebra 𝒜)
⦃s : Set α⦄

s ∈ 𝒜 → sᶜ ∈ 𝒜


@[to_additive (attr := measurability)]
theorem AEMeasurable.const_smul' (hg : AEMeasurable g μ) (c : M) :
    AEMeasurable (fun x => c • g x) μ

{M : Type u_2}
{β : Type u_3}
{α : Type u_4}
[MeasurableSpace M]
[MeasurableSpace β]
[VAdd M β]
{m : MeasurableSpace α}
{g : α → β}
[MeasurableVAdd M β]
{μ : MeasureTheory.Measure α}
(hg : AEMeasurable g μ)
(c : M)


/-- The left unitor, a natural isomorphism `((𝟭 _) ⋙ F) ≅ F`.
-/
@[simps]
def leftUnitor (F : A ⥤ B) :
    𝟭 A ⋙ F ≅ F

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
(F : CategoryTheory.Functor A B)
(X : A)

F.leftUnitor.hom.app X = CategoryTheory.CategoryStruct.id (F.obj X)


@[simp]
theorem continuum_add_aleph0 : 𝔠 + ℵ₀ = 𝔠

Cardinal.continuum + Cardinal.aleph0 = Cardinal.continuum


@[simp]
theorem Γ_obj (X : (SheafedSpace C)ᵒᵖ) : Γ.obj X = (unop X).presheaf.obj (op ⊤)

(X : (AlgebraicGeometry.SheafedSpace C)ᵒᵖ)

AlgebraicGeometry.SheafedSpace.Γ.obj X = (Opposite.unop X).presheaf.obj (Opposite.op ⊤)


theorem mdifferentiable_snd : MDifferentiable (I.prod I') I' (Prod.snd : M × M' → M')

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


theorem isLocalization_of_algEquiv [Algebra R P] [IsLocalization M S] (h : S ≃ₐ[R] P) :
    IsLocalization M P

{R : Type u_1}
[CommSemiring R]
(M : Submonoid R)
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
{P : Type u_3}
[CommSemiring P]
[Algebra R P]
[IsLocalization M S]
(h : S ≃ₐ[R] P)


/-- A homeomorphism of spaces gives an equivalence of categories of presheaves. -/
@[simps!]
def presheafEquivOfIso {X Y : TopCat} (H : X ≅ Y) : X.Presheaf C ≌ Y.Presheaf C

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

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


@[to_additive]
theorem independent_of_coprime_order
    (hcomm : Pairwise fun i j : ι => ∀ x y : G, x ∈ H i → y ∈ H j → Commute x y)
    [Finite ι] [∀ i, Fintype (H i)]
    (hcoprime : Pairwise fun i j => Nat.Coprime (Fintype.card (H i)) (Fintype.card (H j))) :
    CompleteLattice.Independent H

(hcomm : Pairwise fun i j => ∀ (x y : G), x ∈ H i → y ∈ H j → Commute x y)

(hcoprime : Pairwise fun i j => (Fintype.card ↥(H i)).Coprime (Fintype.card ↥(H j)))


theorem orthogonal_span_singleton_eq_to_lin_ker {B : V →ₗ[K] V →ₛₗ[J] V₂} (x : V) :
    Submodule.orthogonalBilin (K ∙ x) B = LinearMap.ker (B x)

{K : Type u_13}
{V : Type u_16}
{V₂ : Type u_18}
[Field K]
[AddCommGroup V]
[Module K V]
[AddCommGroup V₂]
[Module K V₂]
{J : K →+* K}
{B : V →ₗ[K] V →ₛₗ[J] V₂}
(x : V)

(Submodule.span K {x}).orthogonalBilin B = LinearMap.ker (B x)


lemma pos_of_neZero_natCast (R) [AddMonoidWithOne R] {n : ℕ} [NeZero (n : R)] : 0 < n

(R : Type u_1)
[AddMonoidWithOne R]
{n : ℕ}
[NeZero ↑n]


@[to_additive (attr := simp)]
theorem coe_toEquiv (f : M ≃* N) : ⇑(f : M ≃ N) = f

{M : Type u_6}
{N : Type u_7}
[Mul M]
[Mul N]
(f : M ≃* N)


lemma δ_rightShift (a n' m' : ℤ) (hn' : n' + a = n) (m : ℤ) (hm' : m' + a = m) :
    δ n' m' (γ.rightShift a n' hn') = a.negOnePow • (δ n m γ).rightShift a m' hm'

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

CochainComplex.HomComplex.δ n' m' (γ.rightShift a n' hn') =
  a.negOnePow • (CochainComplex.HomComplex.δ n m γ).rightShift a m' hm'


@[simp]
theorem prodComm_apply (x : α × β) : prodComm α β x = x.swap

{α : Type u_1}
{β : Type u_2}
(x : α × β)


@[to_additive (attr := simp)]
theorem Quotient.smul_mk [QuotientAction β H] (b : β) (a : α) :
    (b • QuotientGroup.mk a : α ⧸ H) = QuotientGroup.mk (b • a)

{α : Type u}
{β : Type v}
[AddGroup α]
[AddMonoid β]
[AddAction β α]
(H : AddSubgroup α)
[AddAction.QuotientAction β H]
(b : β)
(a : α)


@[continuity, fun_prop]
lemma continuous_exp : Continuous exp


lemma symm {X Y : C} {z₁ z₂ : W.RightFraction X Y} (h : RightFractionRel z₁ z₂) :
    RightFractionRel z₂ z₁

(h : CategoryTheory.MorphismProperty.RightFractionRel z₁ z₂)


protected theorem quotientMap (hf' : Function.Surjective f) : QuotientMap f

{E : Type u_1}
{X : Type u_2}
[TopologicalSpace E]
[TopologicalSpace X]
{f : E → X}
(hf : IsCoveringMap f)
(hf' : Function.Surjective f)


lemma restrictStalkIso_inv_eq_ofRestrict :
    (X.restrictStalkIso h x).inv = (X.ofRestrict h).stalkMap x

(X.restrictStalkIso h x).inv = AlgebraicGeometry.LocallyRingedSpace.Hom.stalkMap (X.ofRestrict h) x


theorem range_const_subset (α) [MeasurableSpace α] (b : β) : (const α b).range ⊆ {b}

{β : Type u_2}
(α : Type u_5)
[MeasurableSpace α]
(b : β)

(MeasureTheory.SimpleFunc.const α b).range ⊆ {b}


theorem aeval_eq_zero_of_dvd_aeval_eq_zero [CommSemiring S] [CommSemiring T] [Algebra S T]
    {p q : S[X]} (h₁ : p ∣ q) {a : T} (h₂ : aeval a p = 0) : aeval a q = 0

{S : Type v}
{T : Type w}
[CommSemiring S]
[CommSemiring T]
[Algebra S T]
{p q : S[X]}
(h₁ : p ∣ q)
{a : T}
(h₂ : (Polynomial.aeval a) p = 0)


theorem card_union_le (s t : Set α) : Nat.card (↥(s ∪ t)) ≤ Nat.card s + Nat.card t

Nat.card ↑(s ∪ t) ≤ Nat.card ↑s + Nat.card ↑t


protected theorem mdifferentiableOn : MDifferentiableOn I J Φ Φ.source

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_4}
[TopologicalSpace H]
{G : Type u_5}
[TopologicalSpace G]
{I : ModelWithCorners 𝕜 E H}
{J : ModelWithCorners 𝕜 F G}
{M : Type u_6}
[TopologicalSpace M]
[ChartedSpace H M]
{N : Type u_7}
[TopologicalSpace N]
[ChartedSpace G N]
{n : ℕ∞}
(Φ : PartialDiffeomorph I J M N n)
(hn : 1 ≤ n)

MDifferentiableOn I J (↑Φ.toPartialEquiv) Φ.source


@[simp] lemma liftRelAux_inr_inl {b : β} {ca} :
    LiftRelAux R C (Sum.inr ca) (Sum.inl b) = ∃ a, a ∈ ca ∧ R a b

{C : Computation α → Computation β → Prop}

Computation.LiftRelAux R C (Sum.inr ca) (Sum.inl b) = ∃ a, a ∈ ca ∧ R a b


theorem FinPartOrd_dual_comp_forget_to_partOrd :
    FinPartOrd.dual ⋙ forget₂ FinPartOrd PartOrd =
      forget₂ FinPartOrd PartOrd ⋙ PartOrd.dual

FinPartOrd.dual ⋙ CategoryTheory.forget₂ FinPartOrd PartOrd = CategoryTheory.forget₂ FinPartOrd PartOrd ⋙ PartOrd.dual


@[simp]
theorem toIcoDiv_add_zsmul (a b : α) (m : ℤ) : toIcoDiv hp a (b + m • p) = toIcoDiv hp a b + m

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


@[simp]
theorem comap_id : v.comap (RingHom.id R) = v

{R : Type u_3}
{Γ₀ : Type u_4}
[Ring R]
[LinearOrderedAddCommMonoidWithTop Γ₀]
(v : AddValuation R Γ₀)


@[norm_cast]
theorem coe_list_prod (l : List ℝ≥0) : ((l.prod : ℝ≥0) : ℝ) = (l.map (↑)).prod

↑l.prod = (List.map NNReal.toReal l).prod


@[simp]
theorem gcd_mul_left [NormalizedGCDMonoid α] (a b c : α) :
    gcd (a * b) (a * c) = normalize a * gcd b c

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


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

(h : ∀ i ∈ Set.Ioc n m, r (Order.pred i) i)


theorem eventually_nhdsWithin {x : X} (p : Y → Prop) {s : Set X}
    (hx : x ∈ e.source) : (∀ᶠ y in 𝓝[e.symm ⁻¹' s] e x, p y) ↔ ∀ᶠ x in 𝓝[s] x, p (e x)

{X : Type u_1}
{Y : Type u_3}
[TopologicalSpace X]
[TopologicalSpace Y]
(e : PartialHomeomorph X Y)
{x : X}
(p : Y → Prop)
{s : Set X}
(hx : x ∈ e.source)

(∀ᶠ (y : Y) in 𝓝[↑e.symm ⁻¹' s] ↑e x, p y) ↔ ∀ᶠ (x : X) in 𝓝[s] x, p (↑e x)


/-- The map `Cocycle K (L⟦a⟧) n' → Cocycle K L n` when `n' + a = n`. -/
@[simps!]
def rightUnshift {n' a : ℤ} (γ : Cocycle K (L⟦a⟧) n') (n : ℤ) (hn : n' + a = n) :
    Cocycle K L n

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

↑(γ.rightUnshift n hn) = (↑γ).rightUnshift n hn


theorem Base.exchange_base_of_indep (hB : M.Base B) (hf : f ∉ B)
    (hI : M.Indep (insert f (B \ {e}))) : M.Base (insert f (B \ {e}))

{α : Type u_1}
{M : Matroid α}
{B : Set α}
{e f : α}
(hB : M.Base B)
(hf : f ∉ B)
(hI : M.Indep (insert f (B \ {e})))


/-- A null measurable set `t` is Carathéodory measurable: for any `s`, we have
`μ (s ∩ t) + μ (s \ t) = μ s`. -/
theorem measure_inter_add_diff₀ (s : Set α) (ht : NullMeasurableSet t μ) :
    μ (s ∩ t) + μ (s \ t) = μ s

(ht : MeasureTheory.NullMeasurableSet t μ)


@[simp]
theorem toTensor_ι (m : M) : FreeAlgebra.toTensor (FreeAlgebra.ι R m) = TensorAlgebra.ι R m

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

FreeAlgebra.toTensor (FreeAlgebra.ι R m) = (TensorAlgebra.ι R) m


/-- **Lagrange's Theorem**: The order of a subgroup divides the order of its ambient group. -/
@[to_additive "**Lagrange's Theorem**: The order of an additive subgroup divides the order of its
 ambient additive group."]
theorem card_subgroup_dvd_card (s : Subgroup α) : Nat.card s ∣ Nat.card α

{α : Type u_1}
[Group α]
(s : Subgroup α)


lemma BiTotal.rel_exists (h : BiTotal R) :
    ((R ⇒ Iff) ⇒ Iff) (fun p => ∃i, p i) (fun q => ∃i, q i)

{α : Type u₁}
{β : Type u₂}
{R : α → β → Prop}
(h : Relator.BiTotal R)

((R ⇒ Iff) ⇒ Iff) (fun p => ∃ i, p i) fun q => ∃ i, q i


theorem smul_mem_pointwise_smul (m : M) (a : α) (S : Submodule R M) : m ∈ S → a • m ∈ a • S

{α : Type u_1}
{R : Type u_2}
{M : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Monoid α]
[DistribMulAction α M]
[SMulCommClass α R M]
(m : M)
(a : α)
(S : Submodule R M)


theorem measurable_of_measurable_nnreal_nnreal [MeasurableSpace β] {f : ℝ≥0∞ × ℝ≥0∞ → β}
    (h₁ : Measurable fun p : ℝ≥0 × ℝ≥0 => f (p.1, p.2)) (h₂ : Measurable fun r : ℝ≥0 => f (∞, r))
    (h₃ : Measurable fun r : ℝ≥0 => f (r, ∞)) : Measurable f

{f : ℝ≥0∞ × ℝ≥0∞ → β}

(h₁ : Measurable fun p => f (↑p.1, ↑p.2))


theorem coe_decompose_mul_of_right_mem (n) [Decidable (i ≤ n)] (b_mem : b ∈ 𝒜 i) :
    (decompose 𝒜 (a * b) n : A) = if i ≤ n then decompose 𝒜 a (n - i) * b else 0

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

↑(((DirectSum.decompose 𝒜) (a * b)) n) = if i ≤ n then ↑(((DirectSum.decompose 𝒜) a) (n - i)) * b else 0


/-- An isomorphism of differential objects can be constructed
from an isomorphism of the underlying objects that commutes with the differentials. -/
@[simps]
def mkIso {X Y : DifferentialObject S C} (f : X.obj ≅ Y.obj) (hf : X.d ≫ f.hom⟦1⟧' = f.hom ≫ Y.d) :
    X ≅ Y

{X Y : CategoryTheory.DifferentialObject S C}

(hf :
  CategoryTheory.CategoryStruct.comp X.d ((CategoryTheory.shiftFunctor C 1).map f.hom) =
    CategoryTheory.CategoryStruct.comp f.hom Y.d)

(CategoryTheory.DifferentialObject.mkIso f hf).inv.f = f.inv


@[simp]
theorem map_add (f : M →ₗ⁅R,L⁆ N) (x y : M) : f (x + y) = f x + f y

{R : Type u}
{L : Type v}
{M : Type w}
{N : Type w₁}
[CommRing R]
[LieRing L]
[AddCommGroup M]
[AddCommGroup N]
[Module R M]
[Module R N]
[LieRingModule L M]
[LieRingModule L N]
(f : M →ₗ⁅R,L⁆ N)
(x y : M)


theorem map_eq_foldl (as : Array α) (f : α → β) :
    as.map f = as.foldl (fun r a => r.push (f a)) #[]

{α : Type u_1}
{β : Type u_2}
(as : Array α)
(f : α → β)

Array.map f as = Array.foldl (fun r a => r.push (f a)) #[] as 0