/-- Limit `→ ∞` for `WithSeminorms`. -/
theorem WithSeminorms.tendsto_nhds_atTop (hp : WithSeminorms p) (u : F → E) (y₀ : E) :
    Filter.Tendsto u Filter.atTop (𝓝 y₀) ↔
    ∀ i ε, 0 < ε → ∃ x₀, ∀ x, x₀ ≤ x → p i (u x - y₀) < ε

{𝕜 : Type u_1}
{E : Type u_5}
{F : Type u_6}
{ι : Type u_8}
[NormedField 𝕜]
[AddCommGroup E]
[Module 𝕜 E]
[Nonempty ι]
[TopologicalSpace E]
{p : SeminormFamily 𝕜 E ι}
[SemilatticeSup F]
[Nonempty F]
(hp : WithSeminorms p)
(u : F → E)
(y₀ : E)

Filter.Tendsto u Filter.atTop (𝓝 y₀) ↔ ∀ (i : ι) (ε : ℝ), 0 < ε → ∃ x₀, ∀ (x : F), x₀ ≤ x → (p i) (u x - y₀) < ε


/-- A cocone for a functor `F : J ⥤ HomologicalComplex C c` which is given in degree `n` by
the colimit of `F ⋙ eval C c n`. -/
@[simps]
noncomputable def coconeOfHasColimitEval : Cocone F

[∀ (n : ι), CategoryTheory.Limits.HasColimit (F ⋙ HomologicalComplex.eval C c n)]

(HomologicalComplex.coconeOfHasColimitEval F).pt.d n m =
  CategoryTheory.Limits.colimMap { app := fun j => (F.obj j).d n m, naturality := ⋯ }


protected theorem IntegrableAtFilter.neg {f : α → E} (hf : IntegrableAtFilter f l μ) :
    IntegrableAtFilter (-f) l μ

(hf : MeasureTheory.IntegrableAtFilter f l μ)

MeasureTheory.IntegrableAtFilter (-f) l μ


/-- If `f : R → ℝ` is a nonnegative, multiplicatively bounded function, then
  `seminormFromBounded' f x = 0` if and only if `f x = 0`. -/
theorem seminormFromBounded_eq_zero_iff (f_nonneg : 0 ≤ f)
    (f_mul : ∀ x y : R, f (x * y) ≤ c * f x * f y) (x : R) :
    seminormFromBounded' f x = 0 ↔ f x = 0

(f_mul : ∀ (x y : R), f (x * y) ≤ c * f x * f y)


theorem mem_closure {a : F} (ha : a ∈ S) : a ∈ closure S

{F : Type u_1}
[Field F]
{S : Set F}
{a : F}
(ha : a ∈ S)


@[simp]
theorem coprime_mul_left_add_left (m n k : ℕ) : Coprime (n * k + m) n ↔ Coprime m n


theorem succ'_to_nat : ∀ n, (succ' n : ℕ) = n + 1


theorem maximum_of_length_pos_mem (h : 0 < l.length) :
    maximum_of_length_pos h ∈ l

{α : Type u_1}
[LinearOrder α]
{l : List α}
(h : 0 < l.length)


theorem not_eq_false_eq_eq_true (a : Bool) : (not a = false) = (a = true)


theorem finrank_eq_zero_of_basis_imp_not_finite
    (h : ∀ s : Set M, Basis.{v} (s : Set M) R M → ¬s.Finite) : finrank R M = 0

(h : ∀ (s : Set M), Basis (↑s) R M → ¬s.Finite)


theorem Memℒp.aefinStronglyMeasurable (hf : Memℒp f p μ) (hp_ne_zero : p ≠ 0) (hp_ne_top : p ≠ ∞) :
    AEFinStronglyMeasurable f μ

{α : Type u_1}
{G : Type u_2}
{p : ℝ≥0∞}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup G]
{f : α → G}
(hf : MeasureTheory.Memℒp f p μ)
(hp_ne_zero : p ≠ 0)
(hp_ne_top : p ≠ ⊤)


/-- If `v : ι → E` is an orthonormal family, then `Subtype.val : (range v) → E` is an orthonormal
family. -/
theorem Orthonormal.toSubtypeRange {v : ι → E} (hv : Orthonormal 𝕜 v) :
    Orthonormal 𝕜 (Subtype.val : Set.range v → E)

{𝕜 : Type u_1}
{E : Type u_2}
[RCLike 𝕜]
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{ι : Type u_4}
{v : ι → E}
(hv : Orthonormal 𝕜 v)


@[simp]
theorem eventually_bot {p : α → Prop} : ∀ᶠ x in ⊥, p x


/-- A random variable `X : Ω → E` is said to `HasPDF` with respect to the measure `ℙ` on `Ω` and
`μ` on `E` if the push-forward measure of `ℙ` along `X` is absolutely continuous with respect to
`μ` and they `HaveLebesgueDecomposition`. -/
class HasPDF {m : MeasurableSpace Ω} (X : Ω → E) (ℙ : Measure Ω)
    (μ : Measure E := by volume_tac) : Prop where
  pdf' : AEMeasurable X ℙ ∧ (map X ℙ).HaveLebesgueDecomposition μ ∧ map X ℙ ≪ μ

{μ : autoParam (MeasureTheory.Measure E) _auto✝}

AEMeasurable X ℙ ∧ (MeasureTheory.Measure.map X ℙ).HaveLebesgueDecomposition μ ∧ MeasureTheory.Measure.map X ℙ ≪ μ


/-- Construct a monad isomorphism from a natural isomorphism of functors where the forward
direction is a monad morphism. -/
@[simps]
def MonadIso.mk {M N : Monad C} (f : (M : C ⥤ C) ≅ N)
    (f_η : ∀ (X : C), M.η.app X ≫ f.hom.app X = N.η.app X := by aesop_cat)
    (f_μ : ∀ (X : C), M.μ.app X ≫ f.hom.app X =
    (M.map (f.hom.app X) ≫ f.hom.app (N.obj X)) ≫ N.μ.app X := by aesop_cat) : M ≅ N

(f_η : ∀ (X : C), CategoryTheory.CategoryStruct.comp (M.η.app X) (f.hom.app X) = N.η.app X := by aesop_cat)

(f_μ :
  ∀ (X : C),
    CategoryTheory.CategoryStruct.comp (M.μ.app X) (f.hom.app X) =
      CategoryTheory.CategoryStruct.comp
        (CategoryTheory.CategoryStruct.comp (M.map (f.hom.app X)) (f.hom.app (N.obj X))) (N.μ.app X) := by
  aesop_cat)

(CategoryTheory.MonadIso.mk f f_η f_μ).inv.toNatTrans = f.inv


/-- Let `f : ℕ → Π a, β a` be a sequence of (dependent) functions on a topological space. Suppose
that the family of sets `s n = {x | f (n + 1) x ≠ f n x}` is locally finite. Then there exists a
function `F : Π a, β a` such that for any `x`, for sufficiently large values of `n`, we have
`f n y = F y` in a neighbourhood of `x`. -/
theorem exists_forall_eventually_atTop_eventually_eq' {π : X → Sort*} {f : ℕ → ∀ x : X, π x}
    (hf : LocallyFinite fun n => { x | f (n + 1) x ≠ f n x }) :
    ∃ F : ∀ x : X, π x, ∀ x, ∀ᶠ n : ℕ in atTop, ∀ᶠ y : X in 𝓝 x, f n y = F y

(hf : LocallyFinite fun n => {x | f (n + 1) x ≠ f n x})

∃ F, ∀ (x : X), ∀ᶠ (n : ℕ) in Filter.atTop, ∀ᶠ (y : X) in 𝓝 x, f n y = F y


/-- Taking a product over `s : Finset α` is the same as multiplying the value on a single element
`f a` by the product of `s.erase a`.

See `Multiset.prod_map_erase` for the `Multiset` version. -/
@[to_additive "Taking a sum over `s : Finset α` is the same as adding the value on a single element
`f a` to the sum over `s.erase a`.

See `Multiset.sum_map_erase` for the `Multiset` version."]
theorem mul_prod_erase [DecidableEq α] (s : Finset α) (f : α → β) {a : α} (h : a ∈ s) :
    (f a * ∏ x ∈ s.erase a, f x) = ∏ x ∈ s, f x

{α : Type u_3}
{β : Type u_4}
[CommMonoid β]
[DecidableEq α]
(s : Finset α)
(f : α → β)
{a : α}
(h : a ∈ s)

f a * ∏ x ∈ s.erase a, f x = ∏ x ∈ s, f x


@[simp] theorem foldlM_reverse [Monad m] (l : List α) (f : β → α → m β) (b) :
    l.reverse.foldlM f b = l.foldrM (fun x y => f y x) b

{m : Type u_1 → Type u_2}
{α : Type u_3}
{β : Type u_1}
[Monad m]
(l : List α)
(f : β → α → m β)
(b : β)

List.foldlM f b l.reverse = List.foldrM (fun x y => f y x) b l


theorem preimage_id (s : Set α) : preimage (@Eq α) s = s


@[simps!]
instance category : Category (Square C)

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

∀ {X Y Z : CategoryTheory.Square C} (f : X.Hom Y) (g : Y.Hom Z),
  (CategoryTheory.CategoryStruct.comp f g).τ₂ = CategoryTheory.CategoryStruct.comp f.τ₂ g.τ₂


@[to_additive prod_le_iff]
theorem prod_le_iff {H : Subgroup G} {K : Subgroup N} {J : Subgroup (G × N)} :
    H.prod K ≤ J ↔ map (MonoidHom.inl G N) H ≤ J ∧ map (MonoidHom.inr G N) K ≤ J

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
{H : Subgroup G}
{K : Subgroup N}
{J : Subgroup (G × N)}

H.prod K ≤ J ↔ Subgroup.map (MonoidHom.inl G N) H ≤ J ∧ Subgroup.map (MonoidHom.inr G N) K ≤ J


protected theorem dist_comm (x y : Completion α) : dist x y = dist y x

{α : Type u}
[PseudoMetricSpace α]
(x y : UniformSpace.Completion α)


theorem eval_section_injective_of_eventually_injective {j}
    (Finj : ∀ (i) (f : i ⟶ j), (F.map f).Injective) (i) (f : i ⟶ j) :
    (fun s : F.sections => s.val j).Injective

(Finj : ∀ (i : J) (f : i ⟶ j), Function.Injective (F.map f))


/-- The degree of the minimal polynomial of `μ` is at least `totient n`. -/
theorem totient_le_degree_minpoly : Nat.totient n ≤ (minpoly ℤ μ).natDegree

{n : ℕ}
{K : Type u_1}
[CommRing K]
{μ : K}
(h : IsPrimitiveRoot μ n)
[IsDomain K]
[CharZero K]


theorem pmap_eq_map_attach {p : α → Prop} (f : ∀ a, p a → β) (l H) :
    pmap f l H = l.attach.map fun x => f x.1 (H _ x.2)

{α : Type u}
{β : Type v}
{p : α → Prop}
(f : (a : α) → p a → β)
(l : List α)
(H : ∀ (a : α), a ∈ l → p a)

List.pmap f l H = List.map (fun x => f ↑x ⋯) l.attach


theorem hasSum_fst [AddCommMonoid R] [AddCommMonoid M] {f : α → tsze R M} {a : tsze R M}
    (h : HasSum f a) : HasSum (fun x ↦ fst (f x)) (fst a)

{α : Type u_1}
{R : Type u_3}
(M : Type u_4)
[TopologicalSpace R]
[TopologicalSpace M]
[AddCommMonoid R]
[AddCommMonoid M]
{f : α → tsze R M}
{a : tsze R M}
(h : HasSum f a)


theorem finrank_real_of_complex (E : Type*) [AddCommGroup E] [Module ℂ E] :
    FiniteDimensional.finrank ℝ E = 2 * FiniteDimensional.finrank ℂ E

(E : Type u_1)
[AddCommGroup E]
[Module ℂ E]


@[simp]
theorem degree_X_sub_C (a : R) : degree (X - C a) = 1

{R : Type u}
[Ring R]
[Nontrivial R]
(a : R)

(Polynomial.X - Polynomial.C a).degree = 1


theorem volumeForm_zero_neg [_i : Fact (finrank ℝ E = 0)] :
    Orientation.volumeForm (-positiveOrientation : Orientation ℝ E (Fin 0)) =
      -AlternatingMap.constLinearEquivOfIsEmpty 1

[_i : Fact (FiniteDimensional.finrank ℝ E = 0)]

(-positiveOrientation).volumeForm = -AlternatingMap.constLinearEquivOfIsEmpty 1


@[simp] theorem endofunctorMonoidalCategory_tensorUnit_obj (X : C) :
    (𝟙_ (C ⥤ C)).obj X = X

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

(𝟙_ (CategoryTheory.Functor C C)).obj X = X


theorem Submartingale.sum_upcrossingStrat_mul [IsFiniteMeasure μ] (hf : Submartingale f ℱ μ)
    (a b : ℝ) (N : ℕ) : Submartingale (fun n : ℕ =>
      ∑ k ∈ Finset.range n, upcrossingStrat a b f N k * (f (k + 1) - f k)) ℱ μ

{f : ℕ → Ω → ℝ}

(hf : MeasureTheory.Submartingale f ℱ μ)

MeasureTheory.Submartingale (fun n => ∑ k ∈ Finset.range n, MeasureTheory.upcrossingStrat a b f N k * (f (k + 1) - f k))
  ℱ μ


/-- A family `𝓕 : ι → X → α` is equicontinuous at `x₀` iff the function `swap 𝓕 : X → ι → α` is
continuous at `x₀` *when `ι → α` is equipped with the topology of uniform convergence*. This is
very useful for developping the equicontinuity API, but it should not be used directly for other
purposes. -/
theorem equicontinuousAt_iff_continuousAt {F : ι → X → α} {x₀ : X} :
    EquicontinuousAt F x₀ ↔ ContinuousAt (ofFun ∘ Function.swap F : X → ι →ᵤ α) x₀

{ι : Type u_1}
{X : Type u_3}
{α : Type u_7}
[tX : TopologicalSpace X]
[uα : UniformSpace α]
{F : ι → X → α}
{x₀ : X}

EquicontinuousAt F x₀ ↔ ContinuousAt (⇑UniformFun.ofFun ∘ Function.swap F) x₀


@[simp]
theorem sUnion_classes (r : Setoid α) : ⋃₀ r.classes = Set.univ


/-- Units of an `AddMonoid`, bundled version.

An element of an `AddMonoid` is a unit if it has a two-sided additive inverse.
This version bundles the inverse element so that it can be computed.
For a predicate see `isAddUnit`. -/
structure AddUnits (α : Type u) [AddMonoid α] where
  /-- The underlying value in the base `AddMonoid`. -/
  val : α
  /-- The additive inverse value of `val` in the base `AddMonoid`. -/
  neg : α
  /-- `neg` is the right additive inverse of `val` in the base `AddMonoid`. -/
  val_neg : val + neg = 0
  /-- `neg` is the left additive inverse of `val` in the base `AddMonoid`. -/
  neg_val : neg + val = 0

{α : Type u}
[AddMonoid α]
(self : AddUnits α)


@[simp]
theorem map_id (S : NonUnitalSubalgebra R A) : map (NonUnitalAlgHom.id R A) S = S

{R : Type u}
{A : Type v}
[CommSemiring R]
[NonUnitalNonAssocSemiring A]
[Module R A]
(S : NonUnitalSubalgebra R A)

NonUnitalSubalgebra.map (NonUnitalAlgHom.id R A) S = S


@[refl]
theorem IsEquivalent.refl : u ~[l] u

{α : Type u_1}
{β : Type u_2}
[NormedAddCommGroup β]
{u : α → β}
{l : Filter α}


theorem HasDerivWithinAt.union (hs : HasDerivWithinAt f f' s x) (ht : HasDerivWithinAt f f' t x) :
    HasDerivWithinAt f f' (s ∪ t) x

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
{F : Type v}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{f : 𝕜 → F}
{f' : F}
{x : 𝕜}
{s t : Set 𝕜}
(hs : HasDerivWithinAt f f' s x)
(ht : HasDerivWithinAt f f' t x)


theorem FinEncoding.card_le_aleph0 {α : Type u} (e : FinEncoding α) : #α ≤ ℵ₀

{α : Type u}
(e : Computability.FinEncoding α)


theorem IsLowerSet.total (hs : IsLowerSet s) (ht : IsLowerSet t) : s ⊆ t ∨ t ⊆ s

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


@[simp]
theorem nnnorm_const_eq [Nonempty α] (b : β) : ‖const α b‖₊ = ‖b‖₊

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[SeminormedAddCommGroup β]
[Nonempty α]
(b : β)

‖BoundedContinuousFunction.const α b‖₊ = ‖b‖₊


@[simp] lemma map_id : Prod.map (@id α) (@id β) = id


theorem exists_zpowers {x : G} {p : zpowers x → Prop} : (∃ g, p g) ↔ ∃ m : ℤ, p ⟨x ^ m, m, rfl⟩

{G : Type u_1}
[Group G]
{x : G}
{p : ↥(Subgroup.zpowers x) → Prop}


@[simp] protected theorem sub_self : ∀ (n : Nat), n - n = 0


@[to_additive]
theorem ContMDiffOn.div_const (hf : ContMDiffOn I' I n f s) :
    ContMDiffOn I' I n (fun x ↦ f x / c) s

{𝕜 : 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}
[DivInvMonoid G]
[TopologicalSpace G]
[ChartedSpace H G]
[SmoothMul 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}
{n : ℕ∞}
(c : G)
(hf : ContMDiffOn I' I n f s)


@[simp]
theorem productMap_left : (productMap f g).comp includeLeft = f

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

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


@[simp]
lemma eval_ofNat (n : ℕ) [n.AtLeastTwo] (a : R) :
    (no_index (OfNat.ofNat n : R[X])).eval a = OfNat.ofNat n

{R : Type u}
[Semiring R]
(n : ℕ)
[n.AtLeastTwo]
(a : R)

Polynomial.eval a (OfNat.ofNat n) = OfNat.ofNat n


@[simp]
theorem algebraMap_mem_iff (S : Type*) {R A : Type*} [CommSemiring R] [CommSemiring S]
    [Ring A] [Algebra R S] [Algebra R A] [Algebra S A] [IsScalarTower R S A] {a : A} {r : R} :
    algebraMap R S r ∈ spectrum S a ↔ r ∈ spectrum R a

(S : Type u_1)
{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[CommSemiring S]
[Ring A]
[Algebra R S]
[Algebra R A]
[Algebra S A]
[IsScalarTower R S A]
{a : A}
{r : R}

(algebraMap R S) r ∈ spectrum S a ↔ r ∈ spectrum R a


/-- **The Law of Quadratic Reciprocity**: if `p` and `q` are distinct odd primes, then
`(q / p) * (p / q) = (-1)^((p-1)(q-1)/4)`. -/
theorem quadratic_reciprocity (hp : p ≠ 2) (hq : q ≠ 2) (hpq : p ≠ q) :
    legendreSym q p * legendreSym p q = (-1) ^ (p / 2 * (q / 2))

{p q : ℕ}
[Fact (Nat.Prime p)]
[Fact (Nat.Prime q)]
(hp : p ≠ 2)
(hq : q ≠ 2)
(hpq : p ≠ q)

legendreSym q ↑p * legendreSym p ↑q = (-1) ^ (p / 2 * (q / 2))


@[to_additive]
theorem divLeft_eq_inv_trans_mulLeft (a : G) :
    Equiv.divLeft a = (Equiv.inv G).trans (Equiv.mulLeft a)

Equiv.divLeft a = Equiv.trans (Equiv.inv G) (Equiv.mulLeft a)


/-- If `(a : ℕ)` is a root of `cyclotomic n (ZMod p)`, where `p` is a prime, then `a` and `p` are
coprime. -/
theorem coprime_of_root_cyclotomic {n : ℕ} (hpos : 0 < n) {p : ℕ} [hprime : Fact p.Prime] {a : ℕ}
    (hroot : IsRoot (cyclotomic n (ZMod p)) (Nat.castRingHom (ZMod p) a)) : a.Coprime p

(hroot : (Polynomial.cyclotomic n (ZMod p)).IsRoot ((Nat.castRingHom (ZMod p)) a))


theorem lift_obj : (lift σ φ τ h).obj = τ

{V : Type u_1}
[Quiver V]
{W : Type u_2}
(σ : V → W)
{W' : Type u_3}
[Quiver W']
(φ : V ⥤q W')
(τ : W → W')
(h : ∀ (x : V), φ.obj x = τ (σ x))


@[simp]
lemma preimage_map (f : α ↪ β) (s : Finset α) : (s.map f).preimage f f.injective.injOn = s

{α : Type u}
{β : Type v}
(f : α ↪ β)
(s : Finset α)


@[simp]
theorem dropFun_splitFun {α α' : TypeVec (n + 1)} (f : drop α ⟹ drop α') (g : last α → last α') :
    dropFun (splitFun f g) = f

{n : ℕ}
{α : TypeVec.{u_1} (n + 1)}
{α' : TypeVec.{u_2} (n + 1)}
(f : α.drop.Arrow α'.drop)
(g : α.last → α'.last)

TypeVec.dropFun (TypeVec.splitFun f g) = f


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

{𝕜 : Type u_2}
[NontriviallyNormedField 𝕜]
{E : Type u_3}
{F : Type u_4}
{G : Type u_5}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{e : E}
{f : E → F}
{g : E → G}
{r s : ℝ≥0∞}
{p : FormalMultilinearSeries 𝕜 E F}
{q : FormalMultilinearSeries 𝕜 E G}
(hf : HasFPowerSeriesOnBall f p e r)
(hg : HasFPowerSeriesOnBall g q e s)

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


@[simp]
theorem coe_toAdditive_range (f : G →* G') :
    (MonoidHom.toAdditive f).range = Subgroup.toAddSubgroup f.range

{G : Type u_1}
{G' : Type u_2}
[Group G]
[Group G']
(f : G →* G')


@[simp]
theorem pimage_some (s : Finset α) (f : α → β) [∀ x, Decidable (Part.some <| f x).Dom] :
    (s.pimage fun x => Part.some (f x)) = s.image f

[(x : α) → Decidable (Part.some (f x)).Dom]

Finset.pimage (fun x => Part.some (f x)) s = Finset.image f s


theorem descPochhammer_succ_eval {S : Type*} [Ring S] (n : ℕ) (k : S) :
    (descPochhammer S (n + 1)).eval k = (descPochhammer S n).eval k * (k - n)

Polynomial.eval k (descPochhammer S (n + 1)) = Polynomial.eval k (descPochhammer S n) * (k - ↑n)


theorem rfind_dom' {p : ℕ →. Bool} :
    (rfind p).Dom ↔ ∃ n, true ∈ p n ∧ ∀ {m : ℕ}, m ≤ n → (p m).Dom

(Nat.rfind p).Dom ↔ ∃ n, true ∈ p n ∧ ∀ {m : ℕ}, m ≤ n → (p m).Dom


theorem withDensityᵥ_rnDeriv_eq (s : SignedMeasure α) (μ : Measure α) [SigmaFinite μ]
    (h : s ≪ᵥ μ.toENNRealVectorMeasure) : μ.withDensityᵥ (s.rnDeriv μ) = s

{α : Type u_1}
{m : MeasurableSpace α}
(s : MeasureTheory.SignedMeasure α)
(μ : MeasureTheory.Measure α)
[MeasureTheory.SigmaFinite μ]
(h : s ≪ᵥ μ.toENNRealVectorMeasure)


theorem intervalIntegral_eq_integral_uIoc (f : ℝ → E) (a b : ℝ) (μ : Measure ℝ) :
    ∫ x in a..b, f x ∂μ = (if a ≤ b then 1 else -1 : ℝ) • ∫ x in Ι a b, f x ∂μ

{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
(f : ℝ → E)
(a b : ℝ)
(μ : MeasureTheory.Measure ℝ)

∫ (x : ℝ) in a..b, f x ∂μ = (if a ≤ b then 1 else -1) • ∫ (x : ℝ) in Ι a b, f x ∂μ


@[simp]
theorem fourier_add' {m n : ℤ} {x : AddCircle T} :
    toCircle ((m + n) • x :) = fourier m x * fourier n x

↑((m + n) • x).toCircle = (fourier m) x * (fourier n) x


theorem minimal_nonempty_closed_eq_singleton [T0Space X] {s : Set X} (hs : IsClosed s)
    (hne : s.Nonempty) (hmin : ∀ t, t ⊆ s → t.Nonempty → IsClosed t → t = s) : ∃ x, s = {x}

(hmin : ∀ t ⊆ s, t.Nonempty → IsClosed t → t = s)


theorem center_nontrivial [Nontrivial G] [Finite G] : Nontrivial (Subgroup.center G)

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


@[simp]
theorem support_divOf (g : G) (x : k[G]) :
    (x /ᵒᶠ g).support =
      x.support.preimage (g + ·) (Function.Injective.injOn (add_right_injective g))

{k : Type u_1}
{G : Type u_2}
[Semiring k]
[AddCancelCommMonoid G]
(g : G)
(x : AddMonoidAlgebra k G)

(x.divOf g).support = x.support.preimage (fun x => g + x) ⋯


/-- Generate the smallest sieve containing the given set of arrows. -/
@[simps]
def generate (R : Presieve X) : Sieve X

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

(CategoryTheory.Sieve.generate R).arrows f = ∃ Y h g, R g ∧ CategoryTheory.CategoryStruct.comp h g = f


@[to_additive]
theorem finprod_mem_congr (h₀ : s = t) (h₁ : ∀ x ∈ t, f x = g x) :
    ∏ᶠ i ∈ s, f i = ∏ᶠ i ∈ t, g i

{α : Type u_1}
{M : Type u_5}
[CommMonoid M]
{f g : α → M}
{s t : Set α}
(h₀ : s = t)
(h₁ : ∀ x ∈ t, f x = g x)

∏ᶠ (i : α) (_ : i ∈ s), f i = ∏ᶠ (i : α) (_ : i ∈ t), g i


theorem laurent_injective : Function.Injective (laurent r)

{R : Type u}
[CommRing R]
[hdomain : IsDomain R]
(r : R)


/-- The functorial version of `ULift.down`. -/
@[simps]
def ULift.downFunctor : ULift.{u₂} C ⥤ C

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

∀ {X Y : ULift.{u₂, u₁} C} (f : X ⟶ Y), CategoryTheory.ULift.downFunctor.map f = f


lemma tendsto_eulerMascheroniSeq :
    Tendsto eulerMascheroniSeq atTop (𝓝 eulerMascheroniConstant)

Filter.Tendsto Real.eulerMascheroniSeq Filter.atTop (𝓝 Real.eulerMascheroniConstant)


/-- `Real.cosh` is always positive -/
theorem cosh_pos (x : ℝ) : 0 < Real.cosh x


@[simp]
theorem exists_mem_splitCenterBox {I : Box ι} {x : ι → ℝ} : (∃ s, x ∈ I.splitCenterBox s) ↔ x ∈ I

{ι : Type u_1}
{I : BoxIntegral.Box ι}
{x : ι → ℝ}


@[to_additive]
theorem subset_mulTSupport (f : X → α) : mulSupport f ⊆ mulTSupport f

{X : Type u_1}
{α : Type u_2}
[Zero α]
[TopologicalSpace X]
(f : X → α)


lemma isSheaf_coherent_of_projective_of_comp [Preregular C] [FinitaryExtensive C]
    [∀ (X : C), Projective X]
    [ReflectsFiniteProducts s]
    (hF : IsSheaf (coherentTopology C) (F ⋙ s)) : IsSheaf (coherentTopology C) F

[∀ (X : C), CategoryTheory.Projective X]

(hF : CategoryTheory.Presheaf.IsSheaf (CategoryTheory.coherentTopology C) (F.comp s))

CategoryTheory.Presheaf.IsSheaf (CategoryTheory.coherentTopology C) F


@[simp]
theorem vecHead_vecAlt0 (hm : m + 2 = n + 1 + (n + 1)) (v : Fin (m + 2) → α) :
    vecHead (vecAlt0 hm v) = v 0

Matrix.vecHead (Matrix.vecAlt0 hm v) = v 0


theorem toList_empty : toList (@empty α) = []


theorem beqEqOfEqEq {a b c d : Nat} (p : (a = b) = (c = d)) : (a == b) = (c == d)


theorem bddAbove_Ioo : BddAbove (Ioo a b)


@[simp]
theorem sSup_atoms_eq_top : sSup { a : α | IsAtom a } = ⊤

{α : Type u_2}
[CompleteLattice α]
[IsAtomistic α]


theorem succ_eq_iInf (a : α) : succ a = ⨅ (b) (_ : a < b), b

{α : Type u_1}
[CompleteLattice α]
[SuccOrder α]
(a : α)


@[simp]
theorem coe_sinOrderIso_apply (x : Icc (-(π / 2)) (π / 2)) : (sinOrderIso x : ℝ) = sin x

(x : ↑(Set.Icc (-(Real.pi / 2)) (Real.pi / 2)))


/-- `baseChange` as an `AlgHom`. -/
@[simps!]
def _root_.Module.End.baseChangeHom : Module.End R M →ₐ[R] Module.End A (A ⊗[R] M)

(R : Type u_1)
(A : Type u_2)
(M : Type u_4)
[CommSemiring R]
[Semiring A]
[Algebra R A]
[AddCommMonoid M]
[Module R M]
(a : Module.End R M)

∀ (a_1 : A ⊗[R] M),
  ((Module.End.baseChangeHom R A M) a) a_1 =
    (TensorProduct.liftAux
        (↑R
          ({ toFun := fun h => h ∘ₗ a, map_add' := ⋯, map_smul' := ⋯ } ∘ₗ
            TensorProduct.AlgebraTensorModule.mk R A A M)))
      a_1


@[simp]
theorem zero_eq_zero {P Q : C} : ⟦((0 : Q ⟶ P) : Over P)⟧ = (0 : Pseudoelement P)

{C : Type u}
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Abelian C]
{P Q : C}


theorem _root_.StrictAntiOn.congr (h₁ : StrictAntiOn f₁ s) (h : s.EqOn f₁ f₂) : StrictAntiOn f₂ s

{α : Type u_1}
{β : Type u_2}
{s : Set α}
{f₁ f₂ : α → β}
[Preorder α]
[Preorder β]
(h₁ : StrictAntiOn f₁ s)
(h : Set.EqOn f₁ f₂ s)


theorem toZModLinearMap_injective : Function.Injective <| toZModLinearMap n (M := M) (M₁ := M₁)

(n : ℕ)
{M : Type u_1}
{M₁ : Type u_2}
[AddCommGroup M]
[AddCommGroup M₁]
[Module (ZMod n) M]
[Module (ZMod n) M₁]


theorem lintegral_rnDeriv_lt_top_of_measure_ne_top (ν : Measure α) {s : Set α} (hs : μ s ≠ ∞) :
    ∫⁻ x in s, μ.rnDeriv ν x ∂ν < ∞

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(ν : MeasureTheory.Measure α)
{s : Set α}
(hs : μ s ≠ ⊤)


/-- `F.mapTriangle` commutes with the rotation of triangles. -/
@[simps!]
def mapTriangleRotateIso :
    F.mapTriangle ⋙ Pretriangulated.rotate D ≅
      Pretriangulated.rotate C ⋙ F.mapTriangle

(X : CategoryTheory.Pretriangulated.Triangle C)

(F.mapTriangleRotateIso.hom.app X).hom₃ = (F.commShiftIso 1).inv.app X.obj₁


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

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


theorem sizeUpTo_le (i : ℕ) : c.sizeUpTo i ≤ n


lemma mul_div_lt_iff_not_dvd : d * (n / d) < n ↔ ¬ d ∣ n


@[to_additive]
lemma range_eq_image_or_of_mulSupport_subset {f : α → M} {k : Set α} (h : mulSupport f ⊆ k) :
    range f = f '' k ∨ range f = insert 1 (f '' k)

{α : Type u_1}
{M : Type u_5}
[One M]
{f : α → M}
{k : Set α}
(h : Function.mulSupport f ⊆ k)

Set.range f = f '' k ∨ Set.range f = insert 1 (f '' k)


theorem sub_nat (h : LiouvilleWith p x) (n : ℕ) : LiouvilleWith p (x - n)

{p x : ℝ}
(h : LiouvilleWith p x)
(n : ℕ)


lemma isUnramified_mk_iff_forall_isConj [IsGalois k K] {φ : K →+* ℂ} :
    IsUnramified k (mk φ) ↔ ∀ σ : K ≃ₐ[k] K, ComplexEmbedding.IsConj φ σ → σ = 1

{k : Type u_1}
[Field k]
{K : Type u_2}
[Field K]
[Algebra k K]
[IsGalois k K]
{φ : K →+* ℂ}

NumberField.InfinitePlace.IsUnramified k (NumberField.InfinitePlace.mk φ) ↔
  ∀ (σ : K ≃ₐ[k] K), NumberField.ComplexEmbedding.IsConj φ σ → σ = 1


@[measurability]
theorem MeasureTheory.AEStronglyMeasurable.apply_continuousLinearMap {φ : α → F →L[𝕜] E}
    (hφ : AEStronglyMeasurable φ μ) (v : F) :
    AEStronglyMeasurable (fun a => φ a v) μ

(hφ : MeasureTheory.AEStronglyMeasurable φ μ)

MeasureTheory.AEStronglyMeasurable (fun a => (φ a) v) μ


theorem QuasiconcaveOn.dual : QuasiconcaveOn 𝕜 s f → QuasiconvexOn 𝕜 s (toDual ∘ f)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[LE β]
[SMul 𝕜 E]
{s : Set E}
{f : E → β}

QuasiconcaveOn 𝕜 s f → QuasiconvexOn 𝕜 s (⇑OrderDual.toDual ∘ f)


/-- An angle in a right-angled triangle expressed using `arcsin`. -/
theorem oangle_right_eq_arcsin_of_oangle_eq_pi_div_two {p₁ p₂ p₃ : P} (h : ∡ p₁ p₂ p₃ = ↑(π / 2)) :
    ∡ p₂ p₃ p₁ = Real.arcsin (dist p₁ p₂ / dist p₁ p₃)

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

∡ p₂ p₃ p₁ = ↑(Real.arcsin (dist p₁ p₂ / dist p₁ p₃))


/-- A multiplicative equivalence preserves orders of elements. -/
@[to_additive (attr := simp) "An additive equivalence preserves orders of elements."]
lemma MulEquiv.orderOf_eq {H : Type*} [Monoid H] (e : G ≃* H) (x : G) :
    orderOf (e x) = orderOf x

{G : Type u_1}
[Monoid G]
{H : Type u_6}
[Monoid H]
(e : G ≃* H)
(x : G)


theorem coprod.associator_naturality {X₁ X₂ X₃ Y₁ Y₂ Y₃ : C} (f₁ : X₁ ⟶ Y₁) (f₂ : X₂ ⟶ Y₂)
    (f₃ : X₃ ⟶ Y₃) :
    coprod.map (coprod.map f₁ f₂) f₃ ≫ (coprod.associator Y₁ Y₂ Y₃).hom =
      (coprod.associator X₁ X₂ X₃).hom ≫ coprod.map f₁ (coprod.map f₂ f₃)

CategoryTheory.Limits.coprod.map (CategoryTheory.Limits.coprod.map f₁ f₂) f₃ ≫
    (CategoryTheory.Limits.coprod.associator Y₁ Y₂ Y₃).hom =
  (CategoryTheory.Limits.coprod.associator X₁ X₂ X₃).hom ≫
    CategoryTheory.Limits.coprod.map f₁ (CategoryTheory.Limits.coprod.map f₂ f₃)


/-- A component of the natural transformation between left-derived functors can be computed
using a chosen projective resolution. -/
lemma leftDerived_app_eq
    {F G : C ⥤ D} [F.Additive] [G.Additive] (α : F ⟶ G) {X : C} (P : ProjectiveResolution X)
    (n : ℕ) : (NatTrans.leftDerived α n).app X =
      (P.isoLeftDerivedObj F n).hom ≫
        (HomologicalComplex.homologyFunctor D (ComplexShape.down ℕ) n).map
        ((NatTrans.mapHomologicalComplex α _).app P.complex) ≫
        (P.isoLeftDerivedObj G n).inv

(P : CategoryTheory.ProjectiveResolution X)

(CategoryTheory.NatTrans.leftDerived α n).app X =
  CategoryTheory.CategoryStruct.comp (P.isoLeftDerivedObj F n).hom
    (CategoryTheory.CategoryStruct.comp
      ((HomologicalComplex.homologyFunctor D (ComplexShape.down ℕ) n).map
        ((CategoryTheory.NatTrans.mapHomologicalComplex α (ComplexShape.down ℕ)).app P.complex))
      (P.isoLeftDerivedObj G n).inv)


lemma mulShift_unit_eq_one_iff (ψ : AddChar R M) {u : R} (hu : IsUnit u) :
    ψ.mulShift u = 1 ↔ ψ = 1

{R : Type u_1}
{M : Type u_2}
[Ring R]
[CommMonoid M]
(ψ : AddChar R M)
{u : R}
(hu : IsUnit u)


theorem unop_iInf (S : ι → Subsemiring Rᵐᵒᵖ) : (iInf S).unop = ⨅ i, (S i).unop

{ι : Sort u_1}
{R : Type u_2}
[NonAssocSemiring R]
(S : ι → Subsemiring Rᵐᵒᵖ)


theorem pair_lt_pair_left {a₁ a₂} (b) (h : a₁ < a₂) : pair a₁ b < pair a₂ b


/-- The type of finitary supremum-preserving homomorphisms from `α` to `β`. -/
structure SupBotHom (α β : Type*) [Sup α] [Sup β] [Bot α] [Bot β] extends SupHom α β where
  /-- A `SupBotHom` preserves the bottom element. -/
  map_bot' : toFun ⊥ = ⊥

{α : Type u_7}
{β : Type u_8}
[Sup α]
[Sup β]
[Bot α]
[Bot β]
(self : SupBotHom α β)


lemma weightedVSub_vadd {s : Finset ι} {w : ι → k} (h : ∑ i ∈ s, w i = 0) (p : ι → P) (v : V) :
    s.weightedVSub (v +ᵥ p) w = s.weightedVSub p w

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[S : AffineSpace V P]
{ι : Type u_4}
{s : Finset ι}
{w : ι → k}
(h : ∑ i ∈ s, w i = 0)
(p : ι → P)
(v : V)

(s.weightedVSub (v +ᵥ p)) w = (s.weightedVSub p) w


/-- If a family is affinely independent, and the spans of points
indexed by two subsets of the index type have a point in common, those
subsets of the index type have an element in common, if the underlying
ring is nontrivial. -/
theorem AffineIndependent.exists_mem_inter_of_exists_mem_inter_affineSpan [Nontrivial k] {p : ι → P}
    (ha : AffineIndependent k p) {s1 s2 : Set ι} {p0 : P} (hp0s1 : p0 ∈ affineSpan k (p '' s1))
    (hp0s2 : p0 ∈ affineSpan k (p '' s2)) : ∃ i : ι, i ∈ s1 ∩ s2

{k : Type u_1}
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{ι : Type u_4}
[Nontrivial k]
{p : ι → P}
(ha : AffineIndependent k p)
{s1 s2 : Set ι}
{p0 : P}
(hp0s1 : p0 ∈ affineSpan k (p '' s1))
(hp0s2 : p0 ∈ affineSpan k (p '' s2))


@[simp] theorem coe_lTensor_symm : (lTensor M f).symm = (f.symm : P →ₗ[R] N).lTensor M

{R : Type u_1}
[CommSemiring R]
(M : Type u_4)
{N : Type u_5}
{P : Type u_6}
[AddCommMonoid M]
[AddCommMonoid N]
[AddCommMonoid P]
[Module R M]
[Module R N]
[Module R P]
(f : N ≃ₗ[R] P)

↑(LinearEquiv.lTensor M f).symm = LinearMap.lTensor M ↑f.symm


@[to_additive (attr := aesop safe 20 apply (rule_sets := [Measurable]))]
protected theorem smul {𝕜} [TopologicalSpace 𝕜] [SMul 𝕜 β] [ContinuousSMul 𝕜 β] {f : α → 𝕜}
    {g : α → β} (hf : StronglyMeasurable f) (hg : StronglyMeasurable g) :
    StronglyMeasurable fun x => f x • g x

(hf : MeasureTheory.StronglyMeasurable f)

(hg : MeasureTheory.StronglyMeasurable g)

MeasureTheory.StronglyMeasurable fun x => f x • g x


theorem toLinearPMap_range (g : Submodule R (E × F))
    (hg : ∀ (x : E × F) (_hx : x ∈ g) (_hx' : x.fst = 0), x.snd = 0) :
    LinearMap.range g.toLinearPMap.toFun = g.map (LinearMap.snd R E F)

{R : Type u_1}
[Ring R]
{E : Type u_2}
[AddCommGroup E]
[Module R E]
{F : Type u_3}
[AddCommGroup F]
[Module R F]
(g : Submodule R (E × F))
(hg : ∀ x ∈ g, x.1 = 0 → x.2 = 0)

LinearMap.range g.toLinearPMap.toFun = Submodule.map (LinearMap.snd R E F) g


theorem comp_smul (p : Seminorm 𝕜₂ E₂) (f : E →ₛₗ[σ₁₂] E₂) (c : 𝕜₂) :
    p.comp (c • f) = ‖c‖₊ • p.comp f

{𝕜 : Type u_3}
{𝕜₂ : Type u_4}
{E : Type u_7}
{E₂ : Type u_8}
[SeminormedRing 𝕜]
[SeminormedCommRing 𝕜₂]
{σ₁₂ : 𝕜 →+* 𝕜₂}
[RingHomIsometric σ₁₂]
[AddCommGroup E]
[AddCommGroup E₂]
[Module 𝕜 E]
[Module 𝕜₂ E₂]
(p : Seminorm 𝕜₂ E₂)
(f : E →ₛₗ[σ₁₂] E₂)
(c : 𝕜₂)


/-- For disjoint `f1` and `f2`, and function `g`, the product of the products of `g`
over `f1` and `f2` equals the product of `g` over `f1 + f2` -/
@[to_additive
      "For disjoint `f1` and `f2`, and function `g`, the sum of the sums of `g`
      over `f1` and `f2` equals the sum of `g` over `f1 + f2`"]
theorem prod_add_index_of_disjoint [AddCommMonoid M] {f1 f2 : α →₀ M}
    (hd : Disjoint f1.support f2.support) {β : Type*} [CommMonoid β] (g : α → M → β) :
    (f1 + f2).prod g = f1.prod g * f2.prod g

{α : Type u_1}
{M : Type u_8}
[AddCommMonoid M]
{f1 f2 : α →₀ M}
(hd : Disjoint f1.support f2.support)
{β : Type u_16}
[CommMonoid β]
(g : α → M → β)


@[to_additive sub_const]
theorem Filter.Tendsto.div_const' {c : G} {f : α → G} {l : Filter α} (h : Tendsto f l (𝓝 c))
    (b : G) : Tendsto (f · / b) l (𝓝 (c / b))

{G : Type w}
{α : Type u}
[TopologicalSpace G]
[Div G]
[ContinuousDiv G]
{c : G}
{f : α → G}
{l : Filter α}
(h : Filter.Tendsto f l (𝓝 c))
(b : G)

Filter.Tendsto (fun x => f x / b) l (𝓝 (c / b))


theorem compl_sSup' : (sSup s)ᶜ = sInf (HasCompl.compl '' s)

{α : Type u}
[CompleteBooleanAlgebra α]
{s : Set α}


theorem irreducible_p : Irreducible (p : ℤ_[p])


@[simp, norm_cast]
theorem coe_tendsto {f : α → β} {lb : Filter β} : (f : Germ l β).Tendsto lb ↔ Tendsto f l lb

{α : Type u_1}
{β : Type u_2}
{l : Filter α}
{f : α → β}
{lb : Filter β}


theorem Ioc_inter_Ioc : Ioc a₁ b₁ ∩ Ioc a₂ b₂ = Ioc (a₁ ⊔ a₂) (b₁ ⊓ b₂)

{α : Type u_1}
[LinearOrder α]
{a₁ a₂ b₁ b₂ : α}

Set.Ioc a₁ b₁ ∩ Set.Ioc a₂ b₂ = Set.Ioc (a₁ ⊔ a₂) (b₁ ⊓ b₂)


theorem Sbtw.not_swap_right [NoZeroSMulDivisors R V] {x y z : P} (h : Sbtw R x y z) :
    ¬Wbtw R x z y

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[OrderedRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
[NoZeroSMulDivisors R V]
{x y z : P}
(h : Sbtw R x y z)


theorem isGreatest_gfp_le : IsGreatest { a | a ≤ f a } (gfp f)

{α : Type u}
[CompleteLattice α]
(f : α →o α)

IsGreatest {a | a ≤ f a} (OrderHom.gfp f)


theorem card_support_trinomial {k m n : ℕ} (hkm : k < m) (hmn : m < n) {x y z : R} (hx : x ≠ 0)
    (hy : y ≠ 0) (hz : z ≠ 0) : card (support (C x * X ^ k + C y * X ^ m + C z * X ^ n)) = 3

{R : Type u}
[Semiring R]
{k m n : ℕ}
(hkm : k < m)
(hmn : m < n)
{x y z : R}
(hx : x ≠ 0)
(hy : y ≠ 0)
(hz : z ≠ 0)

(Polynomial.C x * Polynomial.X ^ k + Polynomial.C y * Polynomial.X ^ m +
        Polynomial.C z * Polynomial.X ^ n).support.card =
  3


theorem ker_toZMod : RingHom.ker (toZMod : ℤ_[p] →+* ZMod p) = maximalIdeal ℤ_[p]

RingHom.ker PadicInt.toZMod = LocalRing.maximalIdeal ℤ_[p]


/-- The sign of the angle between a linear combination of two vectors and the second vector is
the sign of the factor by which the first vector is multiplied in that combination multiplied by
the sign of the angle between the two vectors. -/
-- @[simp] -- Porting note (#10618): simp can prove this
theorem oangle_sign_smul_add_smul_left (x y : V) (r₁ r₂ : ℝ) :
    (o.oangle (r₁ • x + r₂ • y) y).sign = SignType.sign r₁ * (o.oangle x y).sign

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


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

{R : Type u_2}
{A : Type u_3}
[CommSemiring R]
[StarRing R]
[Semiring A]
[Algebra R A]
[StarRing A]
[StarModule R A]
(S T : StarSubalgebra R A)


theorem coeff_coe_units_zero_ne_zero (u : R[X]ˣ) : coeff (u : R[X]) 0 ≠ 0

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


@[to_additive]
theorem eq_one_of_mul_left (h : a * b = 1) : b = 1

{α : Type u}
[AddCommMonoid α]
[Subsingleton (AddUnits α)]
{a b : α}
(h : a + b = 0)


/-- Morphisms in `Bipointed`. -/
@[ext]
protected structure Hom (X Y : Bipointed.{u}) : Type u where
  /-- The underlying function of a morphism of bipointed types. -/
  toFun : X → Y
  map_fst : toFun X.toProd.1 = Y.toProd.1
  map_snd : toFun X.toProd.2 = Y.toProd.2


/-- Consider two actions `f₁ f₂ : G → α → α` of a group on a complete lattice by order
isomorphisms. Then the map `x ↦ ⨆ g : G, (f₁ g)⁻¹ (f₂ g x)` semiconjugates each `f₁ g'` to `f₂ g'`.

This is a version of Proposition 5.4 from [Étienne Ghys, Groupes d'homéomorphismes du cercle et
cohomologie bornée][ghys87:groupes]. -/
theorem sSup_div_semiconj [CompleteLattice α] [Group G] (f₁ f₂ : G →* α ≃o α) (g : G) :
    Function.Semiconj (fun x => ⨆ g' : G, (f₁ g')⁻¹ (f₂ g' x)) (f₂ g) (f₁ g)

{α : Type u_1}
{G : Type u_4}
[CompleteLattice α]
[Group G]
(f₁ f₂ : G →* α ≃o α)
(g : G)

Function.Semiconj (fun x => ⨆ g', (f₁ g')⁻¹ ((f₂ g') x)) ⇑(f₂ g) ⇑(f₁ g)


theorem IsMaxOn.comp_mapsTo {t : Set δ} {g : δ → α} {b : δ} (hf : IsMaxOn f s a) (hg : MapsTo g t s)
    (ha : g b = a) : IsMaxOn (f ∘ g) t b

{α : Type u}
{β : Type v}
{δ : Type x}
[Preorder β]
{f : α → β}
{s : Set α}
{a : α}
{t : Set δ}
{g : δ → α}
{b : δ}
(hf : IsMaxOn f s a)
(hg : Set.MapsTo g t s)
(ha : g b = a)


/-- **Ruzsa's covering lemma** for sets. See also `Finset.exists_subset_mul_div`. -/
@[to_additive "**Ruzsa's covering lemma**. Version for sets. For finsets,
see `Finset.exists_subset_add_sub`."]
lemma exists_subset_mul_div (hs : s.Finite) (ht' : t.Finite) (ht : t.Nonempty) :
    ∃ u : Set α, Nat.card u * Nat.card t ≤ Nat.card (s * t) ∧ s ⊆ u * t / t ∧ u.Finite

{α : Type u_1}
[CommGroup α]
{s t : Set α}
(hs : s.Finite)
(ht' : t.Finite)
(ht : t.Nonempty)

∃ u, Nat.card ↑u * Nat.card ↑t ≤ Nat.card ↑(s * t) ∧ s ⊆ u * t / t ∧ u.Finite


theorem iUnion_vsub_right_image : ⋃ a ∈ t, (· -ᵥ a) '' s = s -ᵥ t

{α : Type u_2}
{β : Type u_3}
[VSub α β]
{s t : Set β}

⋃ a ∈ t, (fun x => x -ᵥ a) '' s = s -ᵥ t


/-- Uniform isomorphism between dependent functions `Π i : Fin 2, α i` and `α 0 × α 1`. -/
@[simps! (config := .asFn)]
def piFinTwo (α : Fin 2 → Type u) [∀ i, UniformSpace (α i)] : (∀ i, α i) ≃ᵤ α 0 × α 1

(α : Fin 2 → Type u)
[(i : Fin 2) → UniformSpace (α i)]

⇑(UniformEquiv.piFinTwo α) = fun f => (f 0, f 1)


@[simp]
theorem dyadicMap_apply_pow' (m : ℤ) (n : ℕ) :
    m * Surreal.powHalf (Submonoid.log (Submonoid.pow (2 : ℤ) n)) = m * powHalf n

↑m * Surreal.powHalf (Submonoid.log (Submonoid.pow 2 n)) = ↑m * Surreal.powHalf n


theorem Wbtw.trans_right_ne [NoZeroSMulDivisors R V] {w x y z : P} (h₁ : Wbtw R w x z)
    (h₂ : Wbtw R x y z) (h : w ≠ x) : w ≠ y

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[OrderedRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
[NoZeroSMulDivisors R V]
{w x y z : P}
(h₁ : Wbtw R w x z)
(h₂ : Wbtw R x y z)
(h : w ≠ x)


/-- A function `f` has a sum in an uniform additive group `α` if and only if it has that sum in the
completion of `α`. -/
theorem hasSum_iff_hasSum_compl (f : β → α) (a : α) :
    HasSum (toCompl ∘ f) a ↔ HasSum f a

{α : Type u_1}
{β : Type u_2}
[AddCommGroup α]
[UniformSpace α]
[UniformAddGroup α]
(f : β → α)
(a : α)

HasSum (⇑UniformSpace.Completion.toCompl ∘ f) (↑α a) ↔ HasSum f a


/-- `ContinuousMap.compStarAlgHom'` as a `StarAlgEquiv` when the continuous map `f` is
actually a homeomorphism. -/
@[simps]
def compStarAlgEquiv' (f : X ≃ₜ Y) : C(Y, A) ≃⋆ₐ[𝕜] C(X, A)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
(𝕜 : Type u_3)
[CommSemiring 𝕜]
(A : Type u_4)
[TopologicalSpace A]
[Semiring A]
[TopologicalSemiring A]
[StarRing A]
[ContinuousStar A]
[Algebra 𝕜 A]
(f : X ≃ₜ Y)
(a : C(X, A))

(Homeomorph.compStarAlgEquiv' 𝕜 A f).symm a = (ContinuousMap.compStarAlgHom' 𝕜 A f.symm.toContinuousMap) a


/-- The isomorphism from the restriction to the top subspace.
-/
@[simps]
def restrictTopIso (X : PresheafedSpace C) : X.restrict (Opens.openEmbedding ⊤) ≅ X

(X : AlgebraicGeometry.PresheafedSpace C)


theorem coe_gcd (i j : ℤ) : ↑(Int.gcd i j) = GCDMonoid.gcd i j


theorem GenContFract.of_isSimpContFract :
    (of v).IsSimpContFract

{K : Type u_1}
(v : K)
[LinearOrderedField K]
[FloorRing K]


theorem toLin'_apply (A : SpecialLinearGroup n R) (v : n → R) :
    SpecialLinearGroup.toLin' A v = Matrix.toLin' (↑ₘA) v

{n : Type u}
[DecidableEq n]
[Fintype n]
{R : Type v}
[CommRing R]
(A : Matrix.SpecialLinearGroup n R)
(v : n → R)

(Matrix.SpecialLinearGroup.toLin' A) v = (Matrix.toLin' ↑A) v


@[to_additive (attr := simp)]
theorem prod_cons (h : a ∉ s) : ∏ x ∈ cons a s h, f x = f a * ∏ x ∈ s, f x

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

∑ x ∈ Finset.cons a s h, f x = f a + ∑ x ∈ s, f x


theorem basis_iff' :
    M.Basis I X ↔ (M.Indep I ∧ I ⊆ X ∧ ∀ J, M.Indep J → I ⊆ J → J ⊆ X → I = J) ∧ X ⊆ M.E

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

M.Basis I X ↔ (M.Indep I ∧ I ⊆ X ∧ ∀ (J : Set α), M.Indep J → I ⊆ J → J ⊆ X → I = J) ∧ X ⊆ M.E


theorem total_of_right_unique (U : Relator.RightUnique r) (ab : ReflTransGen r a b)
    (ac : ReflTransGen r a c) : ReflTransGen r b c ∨ ReflTransGen r c b

{α : Type u_1}
{r : α → α → Prop}
{a b c : α}
(U : Relator.RightUnique r)
(ab : Relation.ReflTransGen r a b)
(ac : Relation.ReflTransGen r a c)

Relation.ReflTransGen r b c ∨ Relation.ReflTransGen r c b


@[simp]
theorem mulRight_mul (a b : A) : mulRight R (a * b) = (mulRight R b).comp (mulRight R a)

{R : Type u_1}
{A : Type u_2}
[CommSemiring R]
[NonUnitalSemiring A]
[Module R A]
[SMulCommClass R A A]
[IsScalarTower R A A]
(a b : A)

LinearMap.mulRight R (a * b) = LinearMap.mulRight R b ∘ₗ LinearMap.mulRight R a


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

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


/-- A module is Artinian iff every decreasing chain of submodules stabilizes. -/
theorem monotone_stabilizes_iff_artinian :
    (∀ f : ℕ →o (Submodule R M)ᵒᵈ, ∃ n, ∀ m, n ≤ m → f n = f m) ↔ IsArtinian R M

{R : Type u_1}
{M : Type u_2}
[Ring R]
[AddCommGroup M]
[Module R M]

(∀ (f : ℕ →o (Submodule R M)ᵒᵈ), ∃ n, ∀ (m : ℕ), n ≤ m → f n = f m) ↔ IsArtinian R M


/-- A *left*-invariant measure is quasi-preserved by *right*-multiplication.
This should not be confused with `(measurePreserving_mul_right μ g).quasiMeasurePreserving`. -/
@[to_additive
"A *left*-invariant measure is quasi-preserved by *right*-addition.
This should not be confused with `(measurePreserving_add_right μ g).quasiMeasurePreserving`. "]
theorem quasiMeasurePreserving_mul_right [IsMulLeftInvariant μ] (g : G) :
    QuasiMeasurePreserving (fun h : G => h * g) μ μ

{G : Type u_1}
[MeasurableSpace G]
[AddGroup G]
[MeasurableAdd₂ G]
(μ : MeasureTheory.Measure G)
[MeasureTheory.SFinite μ]
[MeasurableNeg G]
[μ.IsAddLeftInvariant]
(g : G)

MeasureTheory.Measure.QuasiMeasurePreserving (fun h => h + g) μ μ


theorem Monic.natDegree_eq_zero (hf : p.Monic) : p.natDegree = 0 ↔ p = 1

{R : Type u}
[Semiring R]
{p : R[X]}
(hf : p.Monic)


@[to_additive]
theorem div_eq_of_eq_mul' {a b c : G} (h : a = b * c) : a / b = c

{G : Type u_3}
[AddCommGroup G]
{a b c : G}
(h : a = b + c)


@[to_additive]
theorem mulIndicator_image {s : Set α} {f : β → M} {g : α → β} (hg : Injective g) {x : α} :
    mulIndicator (g '' s) f (g x) = mulIndicator s (f ∘ g) x

{α : Type u_1}
{β : Type u_2}
{M : Type u_4}
[One M]
{s : Set α}
{f : β → M}
{g : α → β}
(hg : Function.Injective g)
{x : α}

(g '' s).mulIndicator f (g x) = s.mulIndicator (f ∘ g) x


@[simp] lemma compls_empty : (∅ : Finset α)ᶜˢ = ∅


theorem dist_def (f g : α →₁[μ] β) : dist f g = (∫⁻ a, edist (f a) (g a) ∂μ).toReal

{α : Type u_1}
{β : Type u_2}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup β]
(f g : ↥(MeasureTheory.Lp β 1 μ))

dist f g = (∫⁻ (a : α), edist (↑↑f a) (↑↑g a) ∂μ).toReal


theorem le_nextFixed {x : α} (hx : x ≤ f x) : x ≤ f.nextFixed x hx

{α : Type u}
[CompleteLattice α]
(f : α →o α)
{x : α}
(hx : x ≤ f x)


lemma sec_spec (s : S) : s * (algebraMap R S) (x ^ (IsLocalization.Away.sec x s).2) =
    algebraMap R S (IsLocalization.Away.sec x s).1

{R : Type u_1}
[CommSemiring R]
{S : Type u_2}
[CommSemiring S]
[Algebra R S]
(x : R)
[IsLocalization.Away x S]
(s : S)

s * (algebraMap R S) (x ^ (IsLocalization.Away.sec x s).2) = (algebraMap R S) (IsLocalization.Away.sec x s).1


theorem map_rootOfSplits' {f : K[X]} (hf : f.Splits i) (hfd) :
    f.eval₂ i (rootOfSplits' i hf hfd) = 0

{K : Type v}
{L : Type w}
[CommRing K]
[Field L]
(i : K →+* L)
{f : K[X]}
(hf : Polynomial.Splits i f)
(hfd : (Polynomial.map i f).degree ≠ 0)

Polynomial.eval₂ i (Polynomial.rootOfSplits' i hf hfd) f = 0


/-- A lower bound on the multiplicity of `p` in `choose n k`. -/
theorem multiplicity_le_multiplicity_choose_add {p : ℕ} (hp : p.Prime) :
    ∀ n k : ℕ, multiplicity p n ≤ multiplicity p (choose n k) + multiplicity p k

multiplicity p n ≤ multiplicity p (n.choose k) + multiplicity p k


lemma sq_le [ZeroLEOneClass α] [PosMulMono α] [MulPosMono α]
    (h₀ : 0 ≤ a) (h₁ : a ≤ 1) : a ^ 2 ≤ a

{α : Type u}
[Semiring α]
[Preorder α]
{a : α}
[ZeroLEOneClass α]
[PosMulMono α]
[MulPosMono α]
(h₀ : 0 ≤ a)
(h₁ : a ≤ 1)


@[to_additive (attr := simp)]
lemma oneHom_apply (X Y : MonCat.{u}) (x : X) : (1 : X ⟶ Y) x = 1


theorem lift'_neBot_iff (hh : Monotone h) : NeBot (f.lift' h) ↔ ∀ s ∈ f, (h s).Nonempty

{α : Type u_1}
{β : Type u_2}
{f : Filter α}
{h : Set α → Set β}
(hh : Monotone h)

(f.lift' h).NeBot ↔ ∀ s ∈ f, (h s).Nonempty


/-- The `vectorSpan` is the span of the pairwise subtractions with a given point on the right,
excluding the subtraction of that point from itself. -/
theorem vectorSpan_eq_span_vsub_set_right_ne {s : Set P} {p : P} (hp : p ∈ s) :
    vectorSpan k s = Submodule.span k ((· -ᵥ p) '' (s \ {p}))

(k : Type u_1)
{V : Type u_2}
{P : Type u_3}
[Ring k]
[AddCommGroup V]
[Module k V]
[AffineSpace V P]
{s : Set P}
{p : P}
(hp : p ∈ s)

vectorSpan k s = Submodule.span k ((fun x => x -ᵥ p) '' (s \ {p}))


/-- If `s` is a non-empty open subset of `M`, every chart of `s` is the restriction
 of some chart on `M`. -/
lemma chart_eq {s : Opens M} (hs : Nonempty s) {e : PartialHomeomorph s H} (he : e ∈ atlas H s) :
    ∃ x : s, e = (chartAt H (x : M)).subtypeRestr hs

{H : Type u}
{M : Type u_2}
[TopologicalSpace H]
[TopologicalSpace M]
[ChartedSpace H M]
{s : TopologicalSpace.Opens M}
(hs : Nonempty ↥s)
{e : PartialHomeomorph (↥s) H}
(he : e ∈ atlas H ↥s)


@[to_additive (attr := fun_prop)]
theorem ContinuousOn.zpow {f : α → G} {s : Set α} (hf : ContinuousOn f s) (z : ℤ) :
    ContinuousOn (fun x => f x ^ z) s

{G : Type w}
{α : Type u}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
[TopologicalSpace α]
{f : α → G}
{s : Set α}
(hf : ContinuousOn f s)
(z : ℤ)


/-- The stabilizer of `Mˣ` acting on itself by conjugation at `x : Mˣ` is exactly the
units of the centralizer of `x : M`. -/
@[simps! apply_coe_val symm_apply_val_coe]
def unitsCentralizerEquiv (x : Mˣ) :
    (Submonoid.centralizer ({↑x} : Set M))ˣ ≃* MulAction.stabilizer (ConjAct Mˣ) x

∀ (a : ↥(MulAction.stabilizer (ConjAct Mˣ) x)), ↑↑((unitsCentralizerEquiv M x).symm a) = ↑(ConjAct.ofConjAct ↑a)


lemma addY_of_Z_eq_zero_left {P Q : Fin 3 → R} (hP : W'.Equation P) (hPz : P z = 0) :
    W'.addY P Q = (P x * Q z) ^ 3 * Q y

{R : Type u}
[CommRing R]
{W' : WeierstrassCurve.Jacobian R}
{P Q : Fin 3 → R}
(hP : W'.Equation P)
(hPz : P z = 0)


theorem mem_nhds_iff : s ∈ 𝓝 x ↔ ∃ t ⊆ s, IsOpen t ∧ x ∈ t

{X : Type u}
{x : X}
{s : Set X}
[TopologicalSpace X]


@[simp]
theorem infty_ne_coe (x : X) : ∞ ≠ (x : OnePoint X)


theorem isLocalMin_const {b : β} : IsLocalMin (fun _ => b) a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[Preorder β]
{a : α}
{b : β}


/-- In a simply connected space, any two paths are homotopic -/
theorem paths_homotopic {x y : X} (p₁ p₂ : Path x y) : Path.Homotopic p₁ p₂

{X : Type u_1}
[TopologicalSpace X]
[SimplyConnectedSpace X]
{x y : X}
(p₁ p₂ : Path x y)


protected theorem ne_zero_of_mul_ne_zero_left (h : n * m ≠ 0) : n ≠ 0


theorem IsEquivalent.tendsto_nhds_iff {c : β} (huv : u ~[l] v) :
    Tendsto u l (𝓝 c) ↔ Tendsto v l (𝓝 c)

{α : Type u_1}
{β : Type u_2}
[NormedAddCommGroup β]
{u v : α → β}
{l : Filter α}
{c : β}
(huv : u ~[l] v)

Filter.Tendsto u l (nhds c) ↔ Filter.Tendsto v l (nhds c)


@[to_additive (attr := simp)]
lemma antivaryOn_inv_right : AntivaryOn f g⁻¹ s ↔ MonovaryOn f g s

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


lemma Ioo_inr_inr :
    Ioo (inrₗ b₁ : α ⊕ₗ β) (inrₗ b₂) = (Ioo b₁ b₂).map (Embedding.inr.trans toLex.toEmbedding)

{α : Type u_1}
{β : Type u_2}
[Preorder α]
[Preorder β]
[OrderTop α]
[OrderBot β]
[LocallyFiniteOrder α]
[LocallyFiniteOrder β]
(b₁ b₂ : β)

Finset.Ioo (Sum.inrₗ b₁) (Sum.inrₗ b₂) = Finset.map (Function.Embedding.inr.trans toLex.toEmbedding) (Finset.Ioo b₁ b₂)


/-- An ordered (additive) commutative monoid is a commutative monoid with a partial order such that
addition is monotone. -/
class OrderedAddCommMonoid (α : Type*) extends AddCommMonoid α, PartialOrder α where
  protected add_le_add_left : ∀ a b : α, a ≤ b → ∀ c, c + a ≤ c + b

{α : Type u_3}
[self : OrderedAddCommMonoid α]
(a b : α)


@[simp]
theorem mersenne_lt_mersenne {p q : ℕ} : mersenne p < mersenne q ↔ p < q


@[simp]
theorem ker_prod [Module R₁ M₂] [Module R₁ M₃] (f : M₁ →L[R₁] M₂) (g : M₁ →L[R₁] M₃) :
    ker (f.prod g) = ker f ⊓ ker g

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

LinearMap.ker (f.prod g) = LinearMap.ker f ⊓ LinearMap.ker g


@[to_additive]
theorem comap_map_eq (H : Subgroup G) : comap f (map f H) = H ⊔ f.ker

{G : Type u_1}
[Group G]
{N : Type u_5}
[Group N]
(f : G →* N)
(H : Subgroup G)

Subgroup.comap f (Subgroup.map f H) = H ⊔ f.ker


theorem gc_homogeneousIdeal :
    @GaloisConnection (HomogeneousIdeal 𝒜) (Set (ProjectiveSpectrum 𝒜))ᵒᵈ _ _
      (fun I => zeroLocus 𝒜 I) fun t => vanishingIdeal t

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

GaloisConnection (fun I => ProjectiveSpectrum.zeroLocus 𝒜 ↑I) fun t => ProjectiveSpectrum.vanishingIdeal t


/-- A scheme on a complete space with vanishing diameter
such that each set contains the closure of its children
induces a total map. -/
theorem ClosureAntitone.map_of_vanishingDiam [CompleteSpace α] (hdiam : VanishingDiam A)
    (hanti : ClosureAntitone A) (hnonempty : ∀ l, (A l).Nonempty) : (inducedMap A).1 = univ

(hanti : CantorScheme.ClosureAntitone A)

(hnonempty : ∀ (l : List β), (A l).Nonempty)

(CantorScheme.inducedMap A).fst = Set.univ


@[norm_cast]
theorem coe_mks {f : A → B} (h₁ h₂ h₃ h₄ h₅) : ⇑(⟨⟨⟨⟨f, h₁⟩, h₂⟩, h₃, h₄⟩, h₅⟩ : A →ₐ[R] B) = f

(h₂ :
  ∀ (x y : A),
    { toFun := f, map_one' := h₁ }.toFun (x * y) =
      { toFun := f, map_one' := h₁ }.toFun x * { toFun := f, map_one' := h₁ }.toFun y)

(h₃ : (↑{ toFun := f, map_one' := h₁, map_mul' := h₂ }).toFun 0 = 0)

(h₄ :
  ∀ (x y : A),
    (↑{ toFun := f, map_one' := h₁, map_mul' := h₂ }).toFun (x + y) =
      (↑{ toFun := f, map_one' := h₁, map_mul' := h₂ }).toFun x +
        (↑{ toFun := f, map_one' := h₁, map_mul' := h₂ }).toFun y)

(h₅ :
  ∀ (r : R),
    (↑↑{ toFun := f, map_one' := h₁, map_mul' := h₂, map_zero' := h₃, map_add' := h₄ }).toFun ((algebraMap R A) r) =
      (algebraMap R B) r)

⇑{ toFun := f, map_one' := h₁, map_mul' := h₂, map_zero' := h₃, map_add' := h₄, commutes' := h₅ } = f


theorem ne_zero (h : Irrational x) : x ≠ 0


@[to_additive]
theorem mul_subset_mul_right : s₁ ⊆ s₂ → s₁ * t ⊆ s₂ * t

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


/-- Adjoins a `⊤` to the domain and codomain of a `SupHom`. -/
@[simps]
protected def withTop (f : SupHom α β) : SupHom (WithTop α) (WithTop β)

{α : Type u_3}
{β : Type u_4}
[SemilatticeSup α]
[SemilatticeSup β]
(f : SupHom α β)

∀ (a : WithTop α), f.withTop a = WithTop.map (⇑f) a


/-- The equivalence of functor categories induced by `leftOp` and `rightOp`.
-/
@[simps!]
def leftOpRightOpEquiv : (Cᵒᵖ ⥤ D)ᵒᵖ ≌ C ⥤ Dᵒᵖ

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

(CategoryTheory.Functor.leftOpRightOpEquiv C D).unitIso.hom.app X = (Opposite.unop X).rightOpLeftOpIso.hom.op


/-- Coercion of a `MulHom` into a function is itself a `MulHom`.

See also `MulHom.eval`. -/
@[to_additive (attr := simps) "Coercion of an `AddHom` into a function is itself an `AddHom`.

See also `AddHom.eval`."]
def MulHom.coeFn (α β : Type*) [Mul α] [CommSemigroup β] :
    (α →ₙ* β) →ₙ* α → β

(α : Type u_3)
(β : Type u_4)
[Add α]
[AddCommSemigroup β]
(g : AddHom α β)
(a : α)


theorem getElem?_neg [GetElem? cont idx elem dom] [LawfulGetElem cont idx elem dom]
    (c : cont) (i : idx) (h : ¬dom c i) [Decidable (dom c i)] : c[i]? = none

{cont : Type u_1}
{idx : Type u_2}
{elem : Type u_3}
{dom : cont → idx → Prop}
[GetElem? cont idx elem dom]
[LawfulGetElem cont idx elem dom]
(c : cont)
(i : idx)
(h : ¬dom c i)
[Decidable (dom c i)]


/-- A version of `List.coe_dProd_set_like` with `Subtype.mk`. -/
theorem SetLike.list_dProd_eq (A : ι → S) [SetLike.GradedMonoid A] (fι : α → ι) (fA : ∀ a, A (fι a))
    (l : List α) :
    (@List.dProd _ _ (fun i => ↥(A i)) _ _ l fι fA) =
      ⟨List.prod (l.map fun a => fA a),
        (l.dProdIndex_eq_map_sum fι).symm ▸
          list_prod_map_mem_graded l _ _ fun i _ => (fA i).prop⟩

{ι : Type u_1}
{R : Type u_2}
{α : Type u_3}
{S : Type u_4}
[SetLike S R]
[Monoid R]
[AddMonoid ι]
(A : ι → S)
[SetLike.GradedMonoid A]
(fι : α → ι)
(fA : (a : α) → ↥(A (fι a)))
(l : List α)

l.dProd fι fA = ⟨(List.map (fun a => ↑(fA a)) l).prod, ⋯⟩


theorem Icc_eq_image_powerset (h : s ⊆ t) : Icc s t = (t \ s).powerset.image (s ∪ ·)

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

Finset.Icc s t = Finset.image (fun x => s ∪ x) (t \ s).powerset


theorem mul_right_inj {a b c : Ordinal} (a0 : 0 < a) : a * b = a * c ↔ b = c


theorem uniformEmbedding_inr : UniformEmbedding (Sum.inr : β → α ⊕ β)

{α : Type u}
{β : Type v}
[UniformSpace α]
[UniformSpace β]


@[simp, norm_cast]
theorem coe_top : ⇑(⊤ : RingCon R) = ⊤


theorem Matrix.rank_vecMulVec {K m n : Type u} [CommRing K] [Fintype n]
    [DecidableEq n] (w : m → K) (v : n → K) : (Matrix.vecMulVec w v).toLin'.rank ≤ 1

(Matrix.toLin' (Matrix.vecMulVec w v)).rank ≤ 1


@[to_additive]
theorem MulHom.coe_copy_eq {_ : Mul M} {_ : Mul N} (f : M →ₙ* N) (f' : M → N) (h : f' = f) :
    f.copy f' h = f

∀ {x : Mul M} {x_1 : Mul N} (f : M →ₙ* N) (f' : M → N) (h : f' = ⇑f), f.copy f' h = f


theorem epi_iff_surjective : Epi f ↔ Function.Surjective f

CategoryTheory.Epi f ↔ Function.Surjective ⇑f


/-- If `F` is a field of exponential characteristic `q`, `F(S) / F` is separable, then
`F(S) = F(S ^ (q ^ n))` for any natural number `n`. -/
theorem adjoin_eq_adjoin_pow_expChar_pow_of_isSeparable (S : Set E)
    [Algebra.IsSeparable F (adjoin F S)] (q : ℕ) [ExpChar F q] (n : ℕ) :
    adjoin F S = adjoin F ((· ^ q ^ n) '' S)

[Algebra.IsSeparable F ↥(IntermediateField.adjoin F S)]

IntermediateField.adjoin F S = IntermediateField.adjoin F ((fun x => x ^ q ^ n) '' S)


@[reassoc]
theorem biproduct.matrix_map {f : J → C} {g : K → C} {h : K → C} (m : ∀ j k, f j ⟶ g k)
    (n : ∀ k, g k ⟶ h k) :
    biproduct.matrix m ≫ biproduct.map n = biproduct.matrix fun j k => m j k ≫ n k

CategoryTheory.Limits.biproduct.matrix m ≫ CategoryTheory.Limits.biproduct.map n =
  CategoryTheory.Limits.biproduct.matrix fun j k => m j k ≫ n k


theorem lt_ceil : n < ⌈a⌉₊ ↔ (n : α) < a

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


@[simp]
theorem integral_dirac [MeasurableSpace α] [MeasurableSingletonClass α] (f : α → E) (a : α) :
    ∫ x, f x ∂Measure.dirac a = f a

{α : Type u_1}
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[hE : CompleteSpace E]
[MeasurableSpace α]
[MeasurableSingletonClass α]
(f : α → E)
(a : α)

∫ (x : α), f x ∂MeasureTheory.Measure.dirac a = f a


theorem IsBigOWith.symm (h : IsBigOWith c l (fun x => f₁ x - f₂ x) g) :
    IsBigOWith c l (fun x => f₂ x - f₁ x) g

(h : Asymptotics.IsBigOWith c l (fun x => f₁ x - f₂ x) g)

Asymptotics.IsBigOWith c l (fun x => f₂ x - f₁ x) g


@[simp, norm_cast]
theorem dist_coe (x y : ℕ+) : dist (↑x : ℕ) (↑y : ℕ) = dist x y


@[to_additive]
protected theorem Periodic.smul [Add α] [SMul γ β] (h : Periodic f c) (a : γ) :
    Periodic (a • f) c

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : α → β}
{c : α}
[Add α]
[SMul γ β]
(h : Function.Periodic f c)
(a : γ)


@[simp]
theorem isMin_bot : IsMin (⊥ : α)


@[simp 1100]
theorem quotient_map_out_comp_out {C D E : HomotopyCategory V c} (f : C ⟶ D) (g : D ⟶ E) :
    (quotient V c).map (Quot.out f ≫ Quot.out g) = f ≫ g

{ι : Type u_2}
{V : Type u}
[CategoryTheory.Category.{v, u} V]
[CategoryTheory.Preadditive V]
{c : ComplexShape ι}
{C D E : HomotopyCategory V c}
(f : C ⟶ D)
(g : D ⟶ E)

(HomotopyCategory.quotient V c).map (Quot.out f ≫ Quot.out g) = f ≫ g


theorem not_mem_erase (a : α) (s : Finset α) : a ∉ erase s a

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


@[to_additive]
theorem eq_one_iff_eq_one_of_mul_eq_one {a b : M} (h : a * b = 1) : a = 1 ↔ b = 1

{M : Type u}
[AddZeroClass M]
{a b : M}
(h : a + b = 0)


/-- A flat is a maximal set having a given basis  -/
@[mk_iff]
structure Flat (M : Matroid α) (F : Set α) : Prop where
  subset_of_basis_of_basis : ∀ ⦃I X⦄, M.Basis I F → M.Basis I X → X ⊆ F
  subset_ground : F ⊆ M.E

{α : Type u_2}
{M : Matroid α}
{F : Set α}
(self : M.Flat F)


lemma EmbeddingLike.pairwise_comp {X : Type*} {Y : Type*} {F} [FunLike F Y X] [EmbeddingLike F Y X]
    (f : F) {p : X → X → Prop} (h : Pairwise p) : Pairwise (p on f)

{X : Type u_1}
{Y : Type u_2}
{F : Sort u_3}
[FunLike F Y X]
[EmbeddingLike F Y X]
(f : F)
{p : X → X → Prop}
(h : Pairwise p)


theorem condexpL1_mono {E} [NormedLatticeAddCommGroup E] [CompleteSpace E] [NormedSpace ℝ E]
    [OrderedSMul ℝ E] {f g : α → E} (hf : Integrable f μ) (hg : Integrable g μ) (hfg : f ≤ᵐ[μ] g) :
    condexpL1 hm μ f ≤ᵐ[μ] condexpL1 hm μ g

{α : Type u_1}
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{hm : m ≤ m0}
[MeasureTheory.SigmaFinite (μ.trim hm)]
{E : Type u_8}
[NormedLatticeAddCommGroup E]
[CompleteSpace E]
[NormedSpace ℝ E]
[OrderedSMul ℝ E]
{f g : α → E}
(hf : MeasureTheory.Integrable f μ)
(hg : MeasureTheory.Integrable g μ)
(hfg : f ≤ᵐ[μ] g)

↑↑(MeasureTheory.condexpL1 hm μ f) ≤ᵐ[μ] ↑↑(MeasureTheory.condexpL1 hm μ g)


theorem tendsto_log_nat_add_one_sub_log : Tendsto (fun k : ℕ => log (k + 1) - log k) atTop (𝓝 0)

Filter.Tendsto (fun k => Real.log (↑k + 1) - Real.log ↑k) Filter.atTop (𝓝 0)


/-- The augmented Čech nerve associated to an arrow. -/
@[simps]
def augmentedCechNerve : SimplicialObject.Augmented C

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


theorem shiftRight_eq_div_pow (m : Nat) : ∀ n, m >>> n = m / 2 ^ n


theorem of_isLocalization : FormallyEtale R Rₘ

{R Rₘ : Type u}
[CommRing R]
[CommRing Rₘ]
(M : Submonoid R)
[Algebra R Rₘ]
[IsLocalization M Rₘ]


/-- The functor `F.mapTriangle` commutes with the shift. -/
@[simps!]
noncomputable def mapTriangleCommShiftIso (n : ℤ) :
    Triangle.shiftFunctor C n ⋙ F.mapTriangle ≅ F.mapTriangle ⋙ Triangle.shiftFunctor D n

(X : CategoryTheory.Pretriangulated.Triangle C)

((F.mapTriangleCommShiftIso n).hom.app X).hom₂ = (F.commShiftIso n).hom.app X.obj₂


@[simp]
protected theorem pos_iff {x : R} : 0 < abv x ↔ x ≠ 0

{R : Type u_5}
{S : Type u_6}
[Semiring R]
[OrderedSemiring S]
(abv : AbsoluteValue R S)
{x : R}


@[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}
[Group α]
[Monoid β]
[MulAction β α]
(H : Subgroup α)
[MulAction.QuotientAction β H]
(b : β)
(a : α)


theorem not_mem_map_zero (b : β) (v : Vector α 0) (f : α → β) : b ∉ (v.map f).toList

{α : Type u_1}
{β : Type u_2}
(b : β)
(v : Mathlib.Vector α 0)
(f : α → β)


theorem embedding_sigmaMk {i : ι} : Embedding (@Sigma.mk ι σ i)

{ι : Type u_5}
{σ : ι → Type u_7}
[(i : ι) → TopologicalSpace (σ i)]
{i : ι}


@[simp]
theorem ContinuousLinearMap.uncurryLeft_norm
    (f : Ei 0 →L[𝕜] ContinuousMultilinearMap 𝕜 (fun i : Fin n => Ei i.succ) G) :
    ‖f.uncurryLeft‖ = ‖f‖

[(i : Fin n.succ) → NormedAddCommGroup (Ei i)]

[(i : Fin n.succ) → NormedSpace 𝕜 (Ei i)]

(f : Ei 0 →L[𝕜] ContinuousMultilinearMap 𝕜 (fun i => Ei i.succ) G)


theorem Basis.subset (hI : M.Basis I X) : I ⊆ X

{α : Type u_1}
{M : Matroid α}
{I X : Set α}
(hI : M.Basis I X)


@[simp] theorem zipWith_replicate {a : α} {b : β} {m n : Nat} :
    zipWith f (replicate m a) (replicate n b) = replicate (min m n) (f a b)

∀ {α_1 : Type u_3} {f : α → β → α_1} {a : α} {b : β} {m n : Nat},
  List.zipWith f (List.replicate m a) (List.replicate n b) = List.replicate (min m n) (f a b)


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


theorem ContMDiff.of_succ {n : ℕ} (h : ContMDiff I I' n.succ f) : ContMDiff I I' n f

{𝕜 : 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]
{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 → M'}
{n : ℕ}
(h : ContMDiff I I' (↑n.succ) f)


@[simp]
theorem erase_zero (n : ℕ) : (0 : R[X]).erase n = 0


/-- To check that a function is `n` times continuously differentiable, it suffices to check that its
first `n` derivatives are differentiable. This is slightly too strong as the condition we
require on the `n`-th derivative is differentiability instead of continuity, but it has the
advantage of avoiding the discussion of continuity in the proof (and for `n = ∞` this is optimal).
-/
theorem contDiff_of_differentiable_iteratedDeriv {n : ℕ∞}
    (h : ∀ m : ℕ, (m : ℕ∞) ≤ n → Differentiable 𝕜 (iteratedDeriv m f)) : ContDiff 𝕜 n f

(h : ∀ (m : ℕ), ↑m ≤ n → Differentiable 𝕜 (iteratedDeriv m f))


theorem ContinuousOn.piecewise {s t : Set α} {f g : α → β} [∀ a, Decidable (a ∈ t)]
    (ht : ∀ a ∈ s ∩ frontier t, f a = g a) (hf : ContinuousOn f <| s ∩ closure t)
    (hg : ContinuousOn g <| s ∩ closure tᶜ) : ContinuousOn (piecewise t f g) s

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{s t : Set α}
{f g : α → β}
[(a : α) → Decidable (a ∈ t)]
(ht : ∀ a ∈ s ∩ frontier t, f a = g a)
(hf : ContinuousOn f (s ∩ closure t))
(hg : ContinuousOn g (s ∩ closure tᶜ))


theorem natDegree_add_le_of_degree_le {p q : R[X]} {n : ℕ} (hp : natDegree p ≤ n)
    (hq : natDegree q ≤ n) : natDegree (p + q) ≤ n

{R : Type u}
[Semiring R]
{p q : R[X]}
{n : ℕ}
(hp : p.natDegree ≤ n)
(hq : q.natDegree ≤ n)


@[simp] lemma unop_neg [Neg α] (x : αᵐᵒᵖ) : unop (-x) = -unop x

MulOpposite.unop (-x) = -MulOpposite.unop x


theorem mem_of_formPerm_apply_ne (h : l.formPerm x ≠ x) : x ∈ l

{α : Type u_1}
[DecidableEq α]
{l : List α}
{x : α}
(h : l.formPerm x ≠ x)


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

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


@[simp]
theorem star_apply (f : α →ᵇ β) (x : α) : star f x = star (f x)

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[SeminormedAddCommGroup β]
[StarAddMonoid β]
[NormedStarGroup β]
(f : BoundedContinuousFunction α β)
(x : α)


lemma ext_to_iff (i j : ℤ) (hij : i + 1 = j) {A : C} (f g : A ⟶ (mappingCone φ).X i) :
    f = g ↔ f ≫ (fst φ).1.v i j hij = g ≫ (fst φ).1.v i j hij ∧
      f ≫ (snd φ).v i i (add_zero i) = g ≫ (snd φ).v i i (add_zero i)

(f g : A ⟶ (CochainComplex.mappingCone φ).X i)

f = g ↔
  f ≫ (↑(CochainComplex.mappingCone.fst φ)).v i j hij = g ≫ (↑(CochainComplex.mappingCone.fst φ)).v i j hij ∧
    f ≫ (CochainComplex.mappingCone.snd φ).v i i ⋯ = g ≫ (CochainComplex.mappingCone.snd φ).v i i ⋯


@[measurability]
theorem measurable_re : Measurable re


@[simp]
theorem coeff_truncate {m : ℕ} (hm : n ≤ m) (i : Fin n) (x : TruncatedWittVector p m R) :
    (truncate hm x).coeff i = x.coeff (Fin.castLE hm i)

{p : ℕ}
[hp : Fact (Nat.Prime p)]
{n : ℕ}
{R : Type u_1}
[CommRing R]
{m : ℕ}
(hm : n ≤ m)
(i : Fin n)
(x : TruncatedWittVector p m R)

TruncatedWittVector.coeff i ((TruncatedWittVector.truncate hm) x) = TruncatedWittVector.coeff (Fin.castLE hm i) x


lemma delta_mul {n : ℕ} (χ : DirichletCharacter ℂ n) : δ * ↗χ = δ


protected theorem add_lt_iff (a b c : Int) : a + b < c ↔ a < -b + c


protected theorem IsLocalHomeomorph.isLocalHomeomorphOn (hf : IsLocalHomeomorph f) :
    IsLocalHomeomorphOn f s

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
{s : Set X}
(hf : IsLocalHomeomorph f)


theorem quotQuotEquivQuotOfLE_comp_quotQuotMk (h : I ≤ J) :
    RingHom.comp (↑(quotQuotEquivQuotOfLE h)) (quotQuotMk I J) = (Ideal.Quotient.mk J)

{R : Type u}
[CommRing R]
{I J : Ideal R}
(h : I ≤ J)

(↑(DoubleQuot.quotQuotEquivQuotOfLE h)).comp (DoubleQuot.quotQuotMk I J) = Ideal.Quotient.mk J


theorem quotientInfEquivSupQuotient_injective (p p' : Submodule R M) :
    Function.Injective (quotientInfToSupQuotient p p')

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

Function.Injective ⇑(LinearMap.quotientInfToSupQuotient p p')


theorem image_subtype_val_Ici_subset (a : {x // p x}) :
    Subtype.val '' Ici a ⊆ Ici a.val

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


lemma Exact.hasZeroObject (h : S.Exact) : HasZeroObject C


@[simp]
lemma factorizationLCRight_zero_left : factorizationLCMRight 0 b = 1


theorem coe_finRotate_of_ne_last {i : Fin n.succ} (h : i ≠ Fin.last n) :
    (finRotate (n + 1) i : ℕ) = i + 1

{n : ℕ}
{i : Fin n.succ}
(h : i ≠ Fin.last n)


lemma IsTheta.isTheta_congr_left (h : f' =Θ[l] g') : f' =Θ[l] k ↔ g' =Θ[l] k

{α : Type u_1}
{G : Type u_5}
{E' : Type u_6}
{F' : Type u_7}
[Norm G]
[SeminormedAddCommGroup E']
[SeminormedAddCommGroup F']
{k : α → G}
{f' : α → E'}
{g' : α → F'}
{l : Filter α}
(h : f' =Θ[l] g')


/-- If `R` contains a `n`-th primitive root, and `S/R` is a ring extension,
then the `n`-th roots of unity in `R` and `S` are isomorphic.
Also see `IsPrimitiveRoot.map_rootsOfUnity` for the equality as `Subgroup Sˣ`. -/
@[simps! (config := .lemmasOnly) apply_coe_val apply_coe_inv_val]
noncomputable
def _root_.rootsOfUnityEquivOfPrimitiveRoots {S F} [CommRing S] [IsDomain S]
    [FunLike F R S] [MonoidHomClass F R S]
    {n : ℕ+} {f : F} (hf : Function.Injective f) (hζ : (primitiveRoots n R).Nonempty) :
    (rootsOfUnity n R) ≃* rootsOfUnity n S

{R : Type u_4}
[CommRing R]
[IsDomain R]
{S : Type u_7}
{F : Type u_8}
[CommRing S]
[IsDomain S]
[FunLike F R S]
[MonoidHomClass F R S]
{n : ℕ+}
{f : F}
(hf : Function.Injective ⇑f)
(hζ : (primitiveRoots (↑n) R).Nonempty)


/-- Auxiliary construction for `ofBraided`. -/
@[simps]
def ofBraidedObj (X : C) : Center C

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

(CategoryTheory.Center.ofBraidedObj X).fst = X


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

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


theorem row_injective [Nonempty ι] : Function.Injective (row ι : (n → α) → Matrix ι n α)

{n : Type u_3}
{α : Type v}
{ι : Type u_6}
[Nonempty ι]


/-- This property implies `IsRatCondKernelCDF`. The measurability, integrability and integral
conditions are the same, but the limit properties of `IsRatCondKernelCDF` are replaced by
limits of integrals. -/
structure IsRatCondKernelCDFAux (f : α × β → ℚ → ℝ) (κ : Kernel α (β × ℝ)) (ν : Kernel α β) :
    Prop :=
  measurable : Measurable f
  mono' (a : α) {q r : ℚ} (_hqr : q ≤ r) : ∀ᵐ c ∂(ν a), f (a, c) q ≤ f (a, c) r
  nonneg' (a : α) (q : ℚ) : ∀ᵐ c ∂(ν a), 0 ≤ f (a, c) q
  le_one' (a : α) (q : ℚ) : ∀ᵐ c ∂(ν a), f (a, c) q ≤ 1
  /- Same as `Tendsto (fun q : ℚ ↦ ∫ c, f (a, c) q ∂(ν a)) atBot (𝓝 0)` but slightly easier
  to prove in the current applications of this definition (some integral convergence lemmas
  currently apply only to `ℕ`, not `ℚ`) -/
  tendsto_integral_of_antitone (a : α) (seq : ℕ → ℚ) (_hs : Antitone seq)
    (_hs_tendsto : Tendsto seq atTop atBot) :
    Tendsto (fun m ↦ ∫ c, f (a, c) (seq m) ∂(ν a)) atTop (𝓝 0)
  /- Same as `Tendsto (fun q : ℚ ↦ ∫ c, f (a, c) q ∂(ν a)) atTop (𝓝 (ν a univ).toReal)` but
  slightly easier to prove in the current applications of this definition (some integral convergence
  lemmas currently apply only to `ℕ`, not `ℚ`) -/
  tendsto_integral_of_monotone (a : α) (seq : ℕ → ℚ) (_hs : Monotone seq)
    (_hs_tendsto : Tendsto seq atTop atTop) :
    Tendsto (fun m ↦ ∫ c, f (a, c) (seq m) ∂(ν a)) atTop (𝓝 (ν a univ).toReal)
  integrable (a : α) (q : ℚ) : Integrable (fun c ↦ f (a, c) q) (ν a)
  setIntegral (a : α) {A : Set β} (_hA : MeasurableSet A) (q : ℚ) :
    ∫ c in A, f (a, c) q ∂(ν a) = (κ a (A ×ˢ Iic ↑q)).toReal

{f : α × β → ℚ → ℝ}

{κ : ProbabilityTheory.Kernel α (β × ℝ)}

(self : ProbabilityTheory.IsRatCondKernelCDFAux f κ ν)


lemma nnnorm_inr (a : A) : ‖(a : Unitization 𝕜 A)‖₊ = ‖a‖₊

{𝕜 : Type u_1}
{A : Type u_2}
[NontriviallyNormedField 𝕜]
[NonUnitalNormedRing A]
[NormedSpace 𝕜 A]
[IsScalarTower 𝕜 A A]
[SMulCommClass 𝕜 A A]
[RegularNormedAlgebra 𝕜 A]
(a : A)

‖↑a‖₊ = ‖a‖₊


@[simp]
theorem filter_ne_eq_erase (f : Π₀ i, β i) (i : ι) : f.filter (· ≠ i) = f.erase i

{ι : Type u}
{β : ι → Type v}
[DecidableEq ι]
[(i : ι) → Zero (β i)]
(f : Π₀ (i : ι), β i)
(i : ι)

DFinsupp.filter (fun x => x ≠ i) f = DFinsupp.erase i f


@[gcongr] theorem rpow_lt_rpow {x y : ℝ≥0} {z : ℝ} (h₁ : x < y) (h₂ : 0 < z) : x ^ z < y ^ z


theorem intCast (n : ℤ) : mapFun f (n : 𝕎 R) = n

{p : ℕ}
{R : Type u_1}
{S : Type u_2}
[hp : Fact (Nat.Prime p)]
[CommRing R]
[CommRing S]
(f : R →+* S)
(n : ℤ)


/-- Predicate for semiring homomorphisms (deprecated -- use the bundled `RingHom` version). -/
structure IsSemiringHom {α : Type u} {β : Type v} [Semiring α] [Semiring β] (f : α → β) : Prop where
  /-- The proposition that `f` preserves the additive identity. -/
  map_zero : f 0 = 0
  /-- The proposition that `f` preserves the multiplicative identity. -/
  map_one : f 1 = 1
  /-- The proposition that `f` preserves addition. -/
  map_add : ∀ x y, f (x + y) = f x + f y
  /-- The proposition that `f` preserves multiplication. -/
  map_mul : ∀ x y, f (x * y) = f x * f y

{α : Type u}
{β : Type v}
[Semiring α]
[Semiring β]
{f : α → β}
(self : IsSemiringHom f)
(x y : α)


@[simp]
theorem Ioc_erase_right (a b : α) : (Ioc a b).erase b = Ioo a b

{α : Type u_2}
[PartialOrder α]
[LocallyFiniteOrder α]
[DecidableEq α]
(a b : α)

(Finset.Ioc a b).erase b = Finset.Ioo a b


theorem isClosed_setOf_inseparable : IsClosed { p : X × X | Inseparable p.1 p.2 }

{X : Type u_1}
[TopologicalSpace X]
[R1Space X]


/-- Representable presheaves are (trivially) ind-objects. -/
@[simps]
def yoneda (X : C) : IndObjectPresentation (yoneda.obj X)

(s : CategoryTheory.Limits.Cocone ((CategoryTheory.Functor.fromPUnit X).comp CategoryTheory.yoneda))

(CategoryTheory.Limits.IndObjectPresentation.yoneda X).isColimit.desc s = s.ι.app { as := PUnit.unit }


@[to_additive]
protected theorem continuous_iff {f : X → Mˣ} :
    Continuous f ↔ Continuous (val ∘ f) ∧ Continuous (fun x => ↑(f x)⁻¹ : X → M)

{M : Type u_1}
{X : Type u_2}
[TopologicalSpace M]
[Monoid M]
[TopologicalSpace X]
{f : X → Mˣ}

Continuous f ↔ Continuous (Units.val ∘ f) ∧ Continuous fun x => ↑(f x)⁻¹


theorem inter_subset_ite (t s s' : Set α) : s ∩ s' ⊆ t.ite s s'


@[simp]
theorem dualCopairing_apply {W : Submodule R M} (φ : W.dualAnnihilator) (x : M) :
    W.dualCopairing φ (Quotient.mk x) = φ x

{R : Type u_1}
{M : Type u_2}
[CommRing R]
[AddCommGroup M]
[Module R M]
{W : Submodule R M}
(φ : ↥W.dualAnnihilator)
(x : M)

(W.dualCopairing φ) (Submodule.Quotient.mk x) = φ x


@[fun_prop]
nonrec theorem HasFDerivAt.const_sub (hf : HasFDerivAt f f' x) (c : F) :
    HasFDerivAt (fun x => c - f x) (-f') x

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


/-- If you rotate a triangle, you get another triangle.
Given a triangle of the form:
```
      f       g       h
  X  ───> Y  ───> Z  ───> X⟦1⟧
```
applying `rotate` gives a triangle of the form:
```
      g       h        -f⟦1⟧'
  Y  ───> Z  ───>  X⟦1⟧ ───> Y⟦1⟧
```
-/
@[simps!]
def Triangle.rotate (T : Triangle C) : Triangle C

(T : CategoryTheory.Pretriangulated.Triangle C)

T.rotate.mor₃ = -(CategoryTheory.shiftFunctor C 1).map T.mor₁


theorem wOppSide_of_left_mem {s : AffineSubspace R P} {x : P} (y : P) (hx : x ∈ s) :
    s.WOppSide x y

{R : Type u_1}
{V : Type u_2}
{P : Type u_4}
[StrictOrderedCommRing R]
[AddCommGroup V]
[Module R V]
[AddTorsor V P]
{s : AffineSubspace R P}
{x : P}
(y : P)
(hx : x ∈ s)


/-- If a function is `C^n` on a domain with unique derivatives, with `1 ≤ n`, then its bundled
derivative is continuous there. -/
theorem ContMDiffOn.continuousOn_tangentMapWithin (hf : ContMDiffOn I I' n f s) (hmn : 1 ≤ n)
    (hs : UniqueMDiffOn I s) :
    ContinuousOn (tangentMapWithin I I' f s) (π E (TangentSpace I) ⁻¹' s)

{𝕜 : 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]
[Is : 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']
[I's : SmoothManifoldWithCorners I' M']
{f : M → M'}
{s : Set M}
{n : ℕ∞}
(hf : ContMDiffOn I I' n f s)
(hmn : 1 ≤ n)
(hs : UniqueMDiffOn I s)

ContinuousOn (tangentMapWithin I I' f s) (Bundle.TotalSpace.proj ⁻¹' s)


lemma commShiftIso_zero :
    F.commShiftIso (0 : A) = CommShift.isoZero F A

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_7, u_1} C]
[CategoryTheory.Category.{u_6, u_2} D]
(F : CategoryTheory.Functor C D)
(A : Type u_4)
[AddMonoid A]
[CategoryTheory.HasShift C A]
[CategoryTheory.HasShift D A]
[F.CommShift A]

F.commShiftIso 0 = CategoryTheory.Functor.CommShift.isoZero F A


theorem HasFiniteFPowerSeriesOnBall.changeOrigin (hf : HasFiniteFPowerSeriesOnBall f p x n r)
    (h : (‖y‖₊ : ℝ≥0∞) < r) :
    HasFiniteFPowerSeriesOnBall f (p.changeOrigin y) (x + y) n (r - ‖y‖₊)

HasFiniteFPowerSeriesOnBall f (p.changeOrigin y) (x + y) n (r - ↑‖y‖₊)


/-- If `M` and `N` are linearly disjoint, if `M` is a flat `R`-module, then for any family of
`R`-linearly independent elements `{ n_i }` of `N`, they are also `M`-linearly independent,
in the sense that the `R`-linear map from `ι →₀ M` to `S` which maps `{ m_i }`
to the sum of `m_i * n_i` (`Submodule.mulRightMap M n`) has trivial kernel. -/
theorem linearIndependent_right_of_flat (H : M.LinearDisjoint N) [Module.Flat R M]
    {ι : Type*} {n : ι → N} (hn : LinearIndependent R n) : LinearMap.ker (mulRightMap M n) = ⊥

{R : Type u}
{S : Type v}
[CommRing R]
[Ring S]
[Algebra R S]
{M N : Submodule R S}
(H : M.LinearDisjoint N)
[Module.Flat R ↥M]
{ι : Type u_1}
{n : ι → ↥N}
(hn : LinearIndependent R n)


/-- For any `y < 1` and any positive `x`, there exists `n : ℕ` with `y ^ n < x`. -/
theorem exists_pow_lt_of_lt_one (hx : 0 < x) (hy : y < 1) : ∃ n : ℕ, y ^ n < x

{α : Type u_1}
[LinearOrderedSemifield α]
[Archimedean α]
[ExistsAddOfLE α]
{x y : α}
(hx : 0 < x)
(hy : y < 1)


@[simp] theorem testBit_xor (x y i : Nat) :
    (x ^^^ y).testBit i = Bool.xor (x.testBit i) (y.testBit i)

(x ^^^ y).testBit i = (x.testBit i).xor (y.testBit i)


theorem exp_neg_mul_rpow_isLittleO_exp_neg {p b : ℝ} (hb : 0 < b) (hp : 1 < p) :
    (fun x : ℝ => exp (- b * x ^ p)) =o[atTop] fun x : ℝ => exp (-x)

(fun x => rexp (-b * x ^ p)) =o[Filter.atTop] fun x => rexp (-x)


/-- Every element `a` in a nontrivial finite-dimensional algebra `A`
over an algebraically closed field `𝕜` has non-empty spectrum. -/
theorem nonempty_of_isAlgClosed_of_finiteDimensional [IsAlgClosed 𝕜] [Nontrivial A]
    [I : FiniteDimensional 𝕜 A] (a : A) : (σ a).Nonempty

(𝕜 : Type u)
{A : Type v}
[Field 𝕜]
[Ring A]
[Algebra 𝕜 A]
[IsAlgClosed 𝕜]
[Nontrivial A]
[I : FiniteDimensional 𝕜 A]
(a : A)


theorem mulPosMono_iff_covariant_pos :
    MulPosMono α ↔ CovariantClass α>0 α (fun x y => y * x) (· ≤ ·)

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

MulPosMono α ↔ CovariantClass { x // 0 < x } α (fun x y => y * ↑x) fun x x_1 => x ≤ x_1


theorem div_le_div_left (ha : 0 < a) (hb : 0 < b) (hc : 0 < c) : a / b ≤ a / c ↔ c ≤ b

{α : Type u_2}
[LinearOrderedSemifield α]
{a b c : α}
(ha : 0 < a)
(hb : 0 < b)
(hc : 0 < c)


@[to_additive]
theorem hasProd_one_iff : HasProd f 1 ↔ ∀ x, f x = 1

{ι : Type u_1}
{α : Type u_3}
[CanonicallyOrderedAddCommMonoid α]
[TopologicalSpace α]
[OrderClosedTopology α]
{f : ι → α}


@[simp]
theorem eval₂_pow' (n : ℕ) :
    (p ^ n).eval₂ (algebraMap R S) x = (p.eval₂ (algebraMap R S) x) ^ n

{R : Type u}
{S : Type v}
[CommSemiring R]
[Semiring S]
[Algebra R S]
(x : S)
(p : R[X])
(n : ℕ)

Polynomial.eval₂ (algebraMap R S) x (p ^ n) = Polynomial.eval₂ (algebraMap R S) x p ^ n


@[parity_simps] lemma even_add : Even (m + n) ↔ (Even m ↔ Even n)


theorem Prime.not_dvd_finsupp_prod {f : α →₀ M} {g : α → M → ℕ} {p : ℕ} (pp : Prime p)
    (hS : ∀ a ∈ f.support, ¬p ∣ g a (f a)) : ¬p ∣ f.prod g

{α : Type u_1}
{M : Type u_5}
[CommMonoidWithZero M]
{f : α →₀ M}
{g : α → M → ℕ}
{p : ℕ}
(pp : Prime p)
(hS : ∀ a ∈ f.support, ¬p ∣ g a (f a))


@[simp]
theorem coe_nsmul (r : ℕ) (f : α →ᵇ β) : ⇑(r • f) = r • ⇑f

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
[AddMonoid β]
[BoundedAdd β]
[ContinuousAdd β]
(r : ℕ)
(f : BoundedContinuousFunction α β)


@[simps]
instance (V : Type u) : Inhabited (SimpleGraph V)


theorem symm_trans {f₀ f₁ f₂ : C(X, Y)} (F : HomotopyWith f₀ f₁ P) (G : HomotopyWith f₁ f₂ P) :
    (F.trans G).symm = G.symm.trans F.symm

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{P : C(X, Y) → Prop}
{f₀ f₁ f₂ : C(X, Y)}
(F : f₀.HomotopyWith f₁ P)
(G : f₁.HomotopyWith f₂ P)


theorem isNoetherian_iff {I : FractionalIdeal R₁⁰ K} :
    IsNoetherian R₁ I ↔ ∀ J ≤ I, (J : Submodule R₁ K).FG

{R₁ : Type u_3}
[CommRing R₁]
{K : Type u_4}
[Field K]
[Algebra R₁ K]
{I : FractionalIdeal R₁⁰ K}


@[to_additive (attr := simp)]
lemma measure_mul_closure_one (s : Set G) (μ : Measure G) :
    μ (s * (closure {1} : Set G)) = μ s

{G : Type u_2}
[MeasurableSpace G]
[TopologicalSpace G]
[BorelSpace G]
[Group G]
[TopologicalGroup G]
(s : Set G)
(μ : MeasureTheory.Measure G)


theorem condexpL1_sub (hf : Integrable f μ) (hg : Integrable g μ) :
    condexpL1 hm μ (f - g) = condexpL1 hm μ f - condexpL1 hm μ g

{α : Type u_1}
{F' : Type u_4}
[NormedAddCommGroup F']
[NormedSpace ℝ F']
[CompleteSpace F']
{m m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{hm : m ≤ m0}
[MeasureTheory.SigmaFinite (μ.trim hm)]
{f g : α → F'}
(hf : MeasureTheory.Integrable f μ)
(hg : MeasureTheory.Integrable g μ)

MeasureTheory.condexpL1 hm μ (f - g) = MeasureTheory.condexpL1 hm μ f - MeasureTheory.condexpL1 hm μ g


@[simp]
theorem algebraMap_eval_U (x : R) (n : ℤ) :
    algebraMap R A ((U R n).eval x) = (U A n).eval (algebraMap R A x)

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[CommRing A]
[Algebra R A]
(x : R)
(n : ℤ)

(algebraMap R A) (Polynomial.eval x (Polynomial.Chebyshev.U R n)) =
  Polynomial.eval ((algebraMap R A) x) (Polynomial.Chebyshev.U A n)


@[to_additive]
theorem min_one (a : α) : min a 1 = 1

{α : Type u}
[CanonicallyLinearOrderedCommMonoid α]
(a : α)


@[simp]
theorem sub_apply (g₁ g₂ : ⨁ i, β i) (i : ι) : (g₁ - g₂) i = g₁ i - g₂ i

{ι : Type v}
{β : ι → Type w}
[(i : ι) → AddCommGroup (β i)]
(g₁ g₂ : DirectSum ι fun i => β i)
(i : ι)


@[simp] lemma Hom.comp_toFun' {X Y Z : Pointed.{u}} (f : X ⟶ Y) (g : Y ⟶ Z) :
    (f ≫ g).toFun = g.toFun ∘ f.toFun

{X Y Z : Pointed}
(f : X ⟶ Y)
(g : Y ⟶ Z)


/--
If `g` is a linear map `M → M''` such that all scalar multiplication by `s : S` is invertible, then
there is a linear map `lift g ∘ mkLinearMap = g`.
-/
theorem lift_comp (g : M →ₗ[R] M'') (h : ∀ x : S, IsUnit ((algebraMap R (Module.End R M'')) x)) :
    (lift S g h).comp (mkLinearMap S M) = g

(h : ∀ (x : ↥S), IsUnit ((algebraMap R (Module.End R M'')) ↑x))

LocalizedModule.lift S g h ∘ₗ LocalizedModule.mkLinearMap S M = g


@[simp]
theorem projLeft_map (x₀ x₁ : πₓ (TopCat.of (A × B))) (p : x₀ ⟶ x₁) :
    (projLeft A B).map p = Path.Homotopic.projLeft p

(x₀ x₁ : ↑(π.obj (TopCat.of (↑A × ↑B))))

(FundamentalGroupoidFunctor.projLeft A B).map p = Path.Homotopic.projLeft p


lemma exists_birkhoff_representation.{u} (α : Type u) [Finite α] [DistribLattice α] :
    ∃ (β : Type u) (_ : DecidableEq β) (_ : Fintype β) (f : LatticeHom α (Finset β)),
      Injective f


lemma isZero₂_of_isZero₁₃ (h₁ : IsZero T.obj₁) (h₃ : IsZero T.obj₃) : IsZero T.obj₂

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

(T : CategoryTheory.Pretriangulated.Triangle C)

(hT : T ∈ CategoryTheory.Pretriangulated.distinguishedTriangles)

(h₁ : CategoryTheory.Limits.IsZero T.obj₁)

(h₃ : CategoryTheory.Limits.IsZero T.obj₃)


@[to_additive]
lemma IsSquare.div [DivisionCommMonoid α] {a b : α} (ha : IsSquare a) (hb : IsSquare b) :
    IsSquare (a / b)

{α : Type u_2}
[SubtractionCommMonoid α]
{a b : α}
(ha : Even a)
(hb : Even b)


nonrec theorem IsLocalMin.sup (hf : IsLocalMin f a) (hg : IsLocalMin g a) :
    IsLocalMin (fun x => f x ⊔ g x) a

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[SemilatticeSup β]
{f g : α → β}
{a : α}
(hf : IsLocalMin f a)
(hg : IsLocalMin g a)


@[norm_cast]
theorem natCast_pow {m n : ℕ} : (↑(m ^ n) : Cardinal) = (↑m : Cardinal) ^ (↑n : Cardinal)


@[norm_cast, simp]
theorem coe_sub : ((x - y : R) : ℍ[R,c₁,c₂]) = x - y

{R : Type u_3}
[CommRing R]
{c₁ c₂ : R}
(x y : R)


/-- If a `E ⋙ F` has a colimit, and `E` is an equivalence, we can construct a colimit of `F`.
-/
theorem hasColimit_of_equivalence_comp (e : K ≌ J) [HasColimit (e.functor ⋙ F)] : HasColimit F

[CategoryTheory.Limits.HasColimit (e.functor ⋙ F)]


@[simp]
lemma fromColumns_apply_inr (A₁ : Matrix m n₁ R) (A₂ : Matrix m n₂ R) (i : m) (j : n₂) :
    (fromColumns A₁ A₂) i (Sum.inr j) = A₂ i j

{R : Type u_1}
{m : Type u_2}
{n₁ : Type u_6}
{n₂ : Type u_7}
(A₁ : Matrix m n₁ R)
(A₂ : Matrix m n₂ R)
(i : m)
(j : n₂)

A₁.fromColumns A₂ i (Sum.inr j) = A₂ i j


theorem adjoin_eq_span : Subalgebra.toSubmodule (adjoin R s) = span R (Submonoid.closure s)

(R : Type uR)
{A : Type uA}
[CommSemiring R]
[Semiring A]
[Algebra R A]
(s : Set A)

Subalgebra.toSubmodule (Algebra.adjoin R s) = Submodule.span R ↑(Submonoid.closure s)


protected theorem ext_iff {f g : CircleDeg1Lift} : f = g ↔ ∀ x, f x = g x


lemma succAbove_castPred_of_le (p i : Fin (n + 1)) (h : p ≤ i) (hi : i ≠ last n) :
    succAbove p (i.castPred hi) = (i.castPred hi).succ

{n : ℕ}
(p i : Fin (n + 1))
(h : p ≤ i)
(hi : i ≠ Fin.last n)

p.succAbove (i.castPred hi) = (i.castPred hi).succ


theorem le_tsub_mul {R : Type*} [CommSemiring R] [Preorder R] [Sub R] [OrderedSub R]
    [CovariantClass R R (· * ·) (· ≤ ·)] {a b c : R} : a * c - b * c ≤ (a - b) * c

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


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

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


/-- The tangent of an angle in a right-angled triangle as a ratio of sides. -/
theorem tan_oangle_right_of_oangle_eq_pi_div_two {p₁ p₂ p₃ : P} (h : ∡ p₁ p₂ p₃ = ↑(π / 2)) :
    Real.Angle.tan (∡ p₂ p₃ p₁) = dist p₁ p₂ / dist p₃ p₂

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

(∡ p₂ p₃ p₁).tan = dist p₁ p₂ / dist p₃ p₂


theorem mem_im_objs_iff (hφ : Function.Injective φ.obj) (d : D) :
    d ∈ (im φ hφ).objs ↔ ∃ c : C, φ.obj c = d

{C : Type u}
[CategoryTheory.Groupoid C]
{D : Type u_1}
[CategoryTheory.Groupoid D]
(φ : CategoryTheory.Functor C D)
(hφ : Function.Injective φ.obj)
(d : D)

d ∈ (CategoryTheory.Subgroupoid.im φ hφ).objs ↔ ∃ c, φ.obj c = d


theorem vonMangoldt_eq_zero_iff {n : ℕ} : Λ n = 0 ↔ ¬IsPrimePow n

ArithmeticFunction.vonMangoldt n = 0 ↔ ¬IsPrimePow n


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

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[OrderedSemiring 𝕜]
[LinearOrderedAddCommMonoid E]
[OrderedAddCommMonoid β]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{s : Set E}
{f : E → β}
(hf : AntitoneOn f s)
(hs : Convex 𝕜 s)
(r : β)


/-- `arsinh` is the left inverse of `sinh`. -/
@[simp]
theorem arsinh_sinh (x : ℝ) : arsinh (sinh x) = x


@[simp]
theorem mk_coe (f : L →ₗ[R] M) (h₁) : ((⟨f, h₁⟩ : LieDerivation R L M) : L → M) = f

(h₁ : ∀ (a b : L), f ⁅a, b⁆ = ⁅a, f b⁆ - ⁅b, f a⁆)

⇑{ toLinearMap := f, leibniz' := h₁ } = ⇑f


theorem upper (s : ClopenUpperSet α) : IsUpperSet (s : Set α)

{α : Type u_1}
[TopologicalSpace α]
[LE α]
(s : ClopenUpperSet α)


@[to_additive]
theorem finiteIndex_of_le [FiniteIndex H] (h : H ≤ K) : FiniteIndex K

{G : Type u_1}
[AddGroup G]
{H K : AddSubgroup G}
[H.FiniteIndex]
(h : H ≤ K)


@[higher_order tfst_comp_tfst]
theorem comp_tfst {α₀ α₁ α₂ β} (f : α₀ → F α₁) (f' : α₁ → G α₂) (x : t α₀ β) :
    Comp.mk (tfst f' <$> tfst f x) = tfst (Comp.mk ∘ map f' ∘ f) x

{t : Type u → Type u → Type u}
[Bitraversable t]
{F G : Type u → Type u}
[Applicative F]
[Applicative G]
[LawfulBitraversable t]
[LawfulApplicative F]
[LawfulApplicative G]
{α₀ α₁ α₂ β : Type u}
(f : α₀ → F α₁)
(f' : α₁ → G α₂)
(x : t α₀ β)

Functor.Comp.mk (Bitraversable.tfst f' <$> Bitraversable.tfst f x) =
  Bitraversable.tfst (Functor.Comp.mk ∘ Functor.map f' ∘ f) x


protected theorem Periodic.eq [AddZeroClass α] (h : Periodic f c) : f c = f 0

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c : α}
[AddZeroClass α]
(h : Function.Periodic f c)


/-- The `0`-th coefficient of `q.comp p` is `q 0`. When `p` goes from `E` to `E`, this can be
expressed as a direct equality -/
theorem comp_coeff_zero'' (q : FormalMultilinearSeries 𝕜 E F) (p : FormalMultilinearSeries 𝕜 E E) :
    (q.comp p) 0 = q 0

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[CommRing 𝕜]
[AddCommGroup E]
[AddCommGroup F]
[Module 𝕜 E]
[Module 𝕜 F]
[TopologicalSpace E]
[TopologicalSpace F]
[TopologicalAddGroup E]
[ContinuousConstSMul 𝕜 E]
[TopologicalAddGroup F]
[ContinuousConstSMul 𝕜 F]
(q : FormalMultilinearSeries 𝕜 E F)
(p : FormalMultilinearSeries 𝕜 E E)


theorem dist_triangle_right (x y z : α) : dist x y ≤ dist x z + dist y z

{α : Type u}
[PseudoMetricSpace α]
(x y z : α)


/-- To prove a property of a product, it suffices to prove that
the property is multiplicative and holds on factors. -/
@[to_additive "To prove a property of a sum, it suffices to prove that
the property is additive and holds on summands."]
theorem prod_induction {M : Type*} [CommMonoid M] (f : α → M) (p : M → Prop)
    (hom : ∀ a b, p a → p b → p (a * b)) (unit : p 1) (base : ∀ x ∈ s, p <| f x) :
    p <| ∏ x ∈ s, f x

(hom : ∀ (a b : M), p a → p b → p (a * b))


theorem Integrable.add (hf : Integrable I l f vol) (hg : Integrable I l g vol) :
    Integrable I l (f + g) vol

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


/-- A category is idempotent complete iff all idempotent endomorphisms `p`
split as a composition `p = e ≫ i` with `i ≫ e = 𝟙 _` -/
class IsIdempotentComplete : Prop where
  /-- A category is idempotent complete iff all idempotent endomorphisms `p`
    split as a composition `p = e ≫ i` with `i ≫ e = 𝟙 _` -/
  idempotents_split :
    ∀ (X : C) (p : X ⟶ X), p ≫ p = p → ∃ (Y : C) (i : Y ⟶ X) (e : X ⟶ Y), i ≫ e = 𝟙 Y ∧ e ≫ i = p

[self : CategoryTheory.IsIdempotentComplete C]

p ≫ p = p → ∃ Y i e, i ≫ e = 𝟙 Y ∧ e ≫ i = p


theorem blimsup_cthickening_ae_eq_blimsup_thickening {p : ℕ → Prop} {s : ℕ → Set α} {r : ℕ → ℝ}
    (hr : Tendsto r atTop (𝓝 0)) (hr' : ∀ᶠ i in atTop, p i → 0 < r i) :
    (blimsup (fun i => cthickening (r i) (s i)) atTop p : Set α) =ᵐ[μ]
      (blimsup (fun i => thickening (r i) (s i)) atTop p : Set α)

(hr : Filter.Tendsto r Filter.atTop (𝓝 0))

(hr' : ∀ᶠ (i : ℕ) in Filter.atTop, p i → 0 < r i)

Filter.blimsup (fun i => Metric.cthickening (r i) (s i)) Filter.atTop p =ᵐ[μ]
  Filter.blimsup (fun i => Metric.thickening (r i) (s i)) Filter.atTop p


@[simp] lemma modEq_zero_iff : a ≡ b [MOD 0] ↔ a = b


lemma surjective_eq_epimorphisms [(forget C).PreservesEpimorphisms] :
    MorphismProperty.surjective C = epimorphisms C

CategoryTheory.MorphismProperty.surjective C = CategoryTheory.MorphismProperty.epimorphisms C


@[to_additive (attr := simp)]
theorem closure_inv (s : Set G) : closure s⁻¹ = closure s

Subgroup.closure s⁻¹ = Subgroup.closure s


/-- The obvious map `PullbackCone f g → PushoutCocone f.unop g.unop` -/
@[simps!]
def unop {X Y Z : Cᵒᵖ} {f : X ⟶ Z} {g : Y ⟶ Z} (c : PullbackCone f g) :
    PushoutCocone f.unop g.unop

(c : CategoryTheory.Limits.PullbackCone f g)

∀ (X_1 : CategoryTheory.Limits.WalkingSpan),
  c.unop.ι.app X_1 =
    (Option.rec (CategoryTheory.Iso.refl Z)
            (fun val =>
              CategoryTheory.Limits.WalkingPair.rec (CategoryTheory.Iso.refl X) (CategoryTheory.Iso.refl Y) val)
            X_1).hom.unop ≫
      (c.π.app X_1).unop


theorem Antiperiodic.sub_zsmul_eq [AddGroup α] [AddGroup β] (h : Antiperiodic f c) (n : ℤ) :
    f (x - n • c) = (n.negOnePow : ℤ) • f x

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{c x : α}
[AddGroup α]
[AddGroup β]
(h : Function.Antiperiodic f c)
(n : ℤ)


theorem isUnit_T (n : ℤ) : IsUnit (T n : R[T;T⁻¹])


theorem isCompactElement_top : CompleteLattice.IsCompactElement (⊤ : Ideal α)


theorem ContDiffWithinAt.inv {f : E → 𝕜'} {n} (hf : ContDiffWithinAt 𝕜 n f s x) (hx : f x ≠ 0) :
    ContDiffWithinAt 𝕜 n (fun x => (f x)⁻¹) s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{s : Set E}
{x : E}
{𝕜' : Type u_4}
[NormedField 𝕜']
[NormedAlgebra 𝕜 𝕜']
[CompleteSpace 𝕜']
{f : E → 𝕜'}
{n : ℕ∞}
(hf : ContDiffWithinAt 𝕜 n f s x)
(hx : f x ≠ 0)


/--
The category of sheaves on the bottom (trivial) grothendieck topology is equivalent to the category
of presheaves.
-/
@[simps]
def sheafOfTypesBotEquiv : SheafOfTypes (⊥ : GrothendieckTopology C) ≌ Cᵒᵖ ⥤ Type w

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

CategoryTheory.sheafOfTypesBotEquiv.unitIso =
  CategoryTheory.Iso.refl (CategoryTheory.Functor.id (CategoryTheory.SheafOfTypes ⊥))


lemma over_forget_coverPreserving (X : C) :
    CoverPreserving (J.over X) J (Over.forget X)

(J : CategoryTheory.GrothendieckTopology C)

CategoryTheory.CoverPreserving (J.over X) J (CategoryTheory.Over.forget X)


protected theorem Commute.one_div_add_one_div (hab : Commute a b) (ha : a ≠ 0) (hb : b ≠ 0) :
    1 / a + 1 / b = (a + b) / (a * b)

{α : Type u_1}
[DivisionSemiring α]
{a b : α}
(hab : Commute a b)
(ha : a ≠ 0)
(hb : b ≠ 0)


theorem isClosed_iff_zeroLocus_ideal (Z : Set (PrimeSpectrum R)) :
    IsClosed Z ↔ ∃ I : Ideal R, Z = zeroLocus I

{R : Type u}
[CommSemiring R]
(Z : Set (PrimeSpectrum R))

IsClosed Z ↔ ∃ I, Z = PrimeSpectrum.zeroLocus ↑I


lemma iInf_coe_ne_top : ⨅ i, (f i : ℕ∞) ≠ ⊤ ↔ Nonempty ι


@[simp]
protected theorem map_eq (f : α → β) (a : P.A) (g : P.B a → α) :
    P.map f ⟨a, g⟩ = ⟨a, f ∘ g⟩

(P : PFunctor.{u})
{α : Type v₁}
{β : Type v₂}
(f : α → β)
(a : P.A)
(g : P.B a → α)


/-- A typeclass saying that `(p : R × R) ↦ p.1 + p.2` maps any product of bounded sets to a bounded
set. This property follows from `LipschitzAdd`, and thus automatically holds, e.g., for seminormed
additive groups. -/
class BoundedAdd (R : Type*) [Bornology R] [Add R] : Prop where
  isBounded_add : ∀ {s t : Set R},
    Bornology.IsBounded s → Bornology.IsBounded t → Bornology.IsBounded (s + t)

{R : Type u_1}
[Bornology R]
[Add R]
[self : BoundedAdd R]
{s t : Set R}


theorem isClosed_fiber {f : X → Y} (hf : IsLocallyConstant f) (y : Y) : IsClosed { x | f x = y }

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


/-- If `f : X → Y` is an `Inducing` map, the image `f '' s` of a set `s` is Lindelöf
  if and only if `s` is compact. -/
theorem Inducing.isLindelof_iff {f : X → Y} (hf : Inducing f) :
    IsLindelof s ↔ IsLindelof (f '' s)

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{s : Set X}
{f : X → Y}
(hf : Inducing f)


@[to_additive]
theorem prod_induction_nonempty (p : α → Prop) (p_mul : ∀ a b, p a → p b → p (a * b)) (hs : s ≠ ∅)
    (p_s : ∀ a ∈ s, p a) : p s.prod

(p_mul : ∀ (a b : α), p a → p b → p (a + b))


theorem Results.terminates {s : Computation α} {a n} (h : Results s a n) : Terminates s

{α : Type u}
{s : Computation α}
{a : α}
{n : ℕ}
(h : s.Results a n)


theorem Definable.eq {n} :
    ∀ (s : OfArity ZFSet.{u} ZFSet.{u} n) [H : Definable n s], (@Definable.Resp n s H).eval _ = s

{n : ℕ}
(s : Function.OfArity ZFSet ZFSet n)
[H : PSet.Definable n s]

PSet.Resp.eval n (PSet.Definable.Resp s) = s


/-- A category `IsFiltered` if
1. for every pair of objects there exists another object "to the right",
2. for every pair of parallel morphisms there exists a morphism to the right so the compositions
   are equal, and
3. there exists some object.

See <https://stacks.math.columbia.edu/tag/002V>. (They also define a diagram being filtered.)
-/
class IsFiltered extends IsFilteredOrEmpty C : Prop where
  /-- a filtered category must be non empty -/
  [nonempty : Nonempty C]

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


theorem not_mem_Iio_self {b : α} : b ∉ Iio b

{α : Type u_2}
[PartialOrder α]
[LocallyFiniteOrderBot α]
{b : α}


theorem lintegral_swapLeft (κ : Kernel (α × β) γ) (a : β × α) (g : γ → ℝ≥0∞) :
    ∫⁻ c, g c ∂swapLeft κ a = ∫⁻ c, g c ∂κ a.swap

(κ : ProbabilityTheory.Kernel (α × β) γ)

(g : γ → ℝ≥0∞)

∫⁻ (c : γ), g c ∂κ.swapLeft a = ∫⁻ (c : γ), g c ∂κ a.swap


/-- If a function is integrable, then the integral of its truncated versions converges to the
integral of the whole function. -/
theorem tendsto_integral_truncation {f : α → ℝ} (hf : Integrable f μ) :
    Tendsto (fun A => ∫ x, truncation f A x ∂μ) atTop (𝓝 (∫ x, f x ∂μ))

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{f : α → ℝ}
(hf : MeasureTheory.Integrable f μ)

Filter.Tendsto (fun A => ∫ (x : α), ProbabilityTheory.truncation f A x ∂μ) Filter.atTop (𝓝 (∫ (x : α), f x ∂μ))


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

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

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


theorem isBigO_atTop_iff_eventually_exists {α : Type*} [SemilatticeSup α] [Nonempty α]
    {f : α → E} {g : α → F} : f =O[atTop] g ↔ ∀ᶠ n₀ in atTop, ∃ c, ∀ n ≥ n₀, ‖f n‖ ≤ c * ‖g n‖

{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{α : Type u_17}
[SemilatticeSup α]
[Nonempty α]
{f : α → E}
{g : α → F}

f =O[Filter.atTop] g ↔ ∀ᶠ (n₀ : α) in Filter.atTop, ∃ c, ∀ n ≥ n₀, ‖f n‖ ≤ c * ‖g n‖


@[to_additive]
theorem integral_eq_tsum (h : IsFundamentalDomain G s μ) (f : α → E) (hf : Integrable f μ) :
    ∫ x, f x ∂μ = ∑' g : G, ∫ x in g • s, f x ∂μ

[MeasureTheory.SMulInvariantMeasure G α μ]

(h : MeasureTheory.IsFundamentalDomain G s μ)

∫ (x : α), f x ∂μ = ∑' (g : G), ∫ (x : α) in g • s, f x ∂μ


theorem HasUnitSpeedOn.union {t : Set ℝ} {x : ℝ} (hfs : HasUnitSpeedOn f s)
    (hft : HasUnitSpeedOn f t) (hs : IsGreatest s x) (ht : IsLeast t x) :
    HasUnitSpeedOn f (s ∪ t)

{E : Type u_2}
[PseudoEMetricSpace E]
{f : ℝ → E}
{s t : Set ℝ}
{x : ℝ}
(hfs : HasUnitSpeedOn f s)
(hft : HasUnitSpeedOn f t)
(hs : IsGreatest s x)
(ht : IsLeast t x)


theorem mem_inv_pointwise_smul_iff {g : G} {S : ValuationSubring K} {x : K} :
    x ∈ g⁻¹ • S ↔ g • x ∈ S

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

x ∈ g⁻¹ • S ↔ g • x ∈ S


theorem join_eq (ss : List String) : join ss = ⟨(ss.map data).join⟩

List.foldl (fun x x_1 => x ++ x_1) { data := cs } ss = { data := cs ++ (List.map String.data ss).join }


lemma comp_assoc {X Y Z T : C} {a₁ a₂ a₃ a₁₂ a₂₃ a : M}
    [HasSmallLocalizedShiftedHom.{w} W M X Y] [HasSmallLocalizedShiftedHom.{w} W M X Z]
    [HasSmallLocalizedShiftedHom.{w} W M X T] [HasSmallLocalizedShiftedHom.{w} W M Y Z]
    [HasSmallLocalizedShiftedHom.{w} W M Y T] [HasSmallLocalizedShiftedHom.{w} W M Z T]
    [HasSmallLocalizedShiftedHom.{w} W M Z Z] [HasSmallLocalizedShiftedHom.{w} W M T T]
    (α : SmallShiftedHom.{w} W X Y a₁) (β : SmallShiftedHom.{w} W Y Z a₂)
    (γ : SmallShiftedHom.{w} W Z T a₃)
    (h₁₂ : a₂ + a₁ = a₁₂) (h₂₃ : a₃ + a₂ = a₂₃) (h : a₃ + a₂ + a₁ = a) :
    (α.comp β h₁₂).comp γ (show a₃ + a₁₂ = a by rw [← h₁₂, ← add_assoc, h]) =
      α.comp (β.comp γ h₂₃) (by rw [← h₂₃, h])

[CategoryTheory.Localization.HasSmallLocalizedShiftedHom W M X Y]

[CategoryTheory.Localization.HasSmallLocalizedShiftedHom W M X Z]

[CategoryTheory.Localization.HasSmallLocalizedShiftedHom W M X T]

[CategoryTheory.Localization.HasSmallLocalizedShiftedHom W M Y Z]

[CategoryTheory.Localization.HasSmallLocalizedShiftedHom W M Y T]

[CategoryTheory.Localization.HasSmallLocalizedShiftedHom W M Z T]

[CategoryTheory.Localization.HasSmallLocalizedShiftedHom W M Z Z]

[CategoryTheory.Localization.HasSmallLocalizedShiftedHom W M T T]

(α : CategoryTheory.Localization.SmallShiftedHom W X Y a₁)

(β : CategoryTheory.Localization.SmallShiftedHom W Y Z a₂)

(γ : CategoryTheory.Localization.SmallShiftedHom W Z T a₃)

(α.comp β h₁₂).comp γ ⋯ = α.comp (β.comp γ h₂₃) ⋯


/-- In a ring, `IsCancelMulZero` and `NoZeroDivisors` are equivalent. -/
lemma isCancelMulZero_iff_noZeroDivisors [NonUnitalNonAssocRing α] :
    IsCancelMulZero α ↔ NoZeroDivisors α

(α : Type u_2)
[NonUnitalNonAssocRing α]


@[to_additive]
theorem prod_univ_eight [CommMonoid β] (f : Fin 8 → β) :
    ∏ i, f i = f 0 * f 1 * f 2 * f 3 * f 4 * f 5 * f 6 * f 7

{β : Type u_2}
[CommMonoid β]
(f : Fin 8 → β)


theorem mdifferentiableAt_neg :
    MDifferentiableAt I 𝓘(𝕜, E') (-f) z ↔ MDifferentiableAt I 𝓘(𝕜, E') f z

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{M : Type u_4}
[TopologicalSpace M]
[ChartedSpace H M]
[SmoothManifoldWithCorners I M]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{z : M}
{f : M → E'}


theorem destutter'_sublist (a) : l.destutter' R a <+ a :: l

{α : Type u_1}
(l : List α)
(R : α → α → Prop)
[DecidableRel R]
(a : α)

(List.destutter' R a l).Sublist (a :: l)


@[deprecated getElem_scanl_zero (since := "2024-06-12")]
theorem get_zero_scanl {h : 0 < (scanl f b l).length} : (scanl f b l).get ⟨0, h⟩ = b

{α : Type u}
{β : Type v}
{f : β → α → β}
{b : β}
{l : List α}
{h : 0 < (List.scanl f b l).length}


@[to_additive]
theorem not_one_mem_div_iff : (1 : α) ∉ s / t ↔ Disjoint s t

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


/-- `Finsupp.mapRange.AddMonoidHom` as an equiv. -/
@[simps apply]
def mapRange.addEquiv (f : M ≃+ N) : (α →₀ M) ≃+ (α →₀ N)

{α : Type u_1}
{M : Type u_5}
{N : Type u_7}
[AddCommMonoid M]
[AddCommMonoid N]
(f : M ≃+ N)
(g : α →₀ M)

(Finsupp.mapRange.addEquiv f) g = Finsupp.mapRange ⇑f ⋯ g


lemma isSeparatedMap_iff_nhds {f : X → Y} : IsSeparatedMap f ↔
    ∀ x₁ x₂, f x₁ = f x₂ → x₁ ≠ x₂ → ∃ s₁ ∈ 𝓝 x₁, ∃ s₂ ∈ 𝓝 x₂, Disjoint s₁ s₂

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

IsSeparatedMap f ↔ ∀ (x₁ x₂ : X), f x₁ = f x₂ → x₁ ≠ x₂ → ∃ s₁ ∈ 𝓝 x₁, ∃ s₂ ∈ 𝓝 x₂, Disjoint s₁ s₂


/-- The generators of the tensor algebra are disjoint from its scalars. -/
theorem ι_range_disjoint_one :
    Disjoint (LinearMap.range (ι R : M →ₗ[R] TensorAlgebra R M))
      (1 : Submodule R (TensorAlgebra R M))

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

Disjoint (LinearMap.range (TensorAlgebra.ι R)) 1


/-- The cartesian product of two natural isomorphisms. -/
@[simps]
def prod {F F' : A ⥤ B} {G G' : C ⥤ D} (e₁ : F ≅ F') (e₂ : G ≅ G') :
    F.prod G ≅ F'.prod G'

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

(CategoryTheory.NatIso.prod e₁ e₂).inv = CategoryTheory.NatTrans.prod e₁.inv e₂.inv