/-- If the second of three points is weakly between the other two, and not equal to the third,
the angle at the third point is zero. -/
theorem _root_.Wbtw.angle₂₃₁_eq_zero_of_ne {p₁ p₂ p₃ : P} (h : Wbtw ℝ p₁ p₂ p₃) (hp₂p₃ : p₂ ≠ p₃) :
    ∠ p₂ p₃ p₁ = 0

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{p₁ p₂ p₃ : P}
(h : Wbtw ℝ p₁ p₂ p₃)
(hp₂p₃ : p₂ ≠ p₃)


lemma traceDual_top [Decidable (IsField A)] :
    (⊤ : Submodule B L)ᵛ = if IsField A then ⊤ else ⊥

{A : Type u_1}
{K : Type u_2}
{L : Type u}
{B : Type u_3}
[CommRing A]
[Field K]
[CommRing B]
[Field L]
[Algebra A K]
[Algebra B L]
[Algebra A B]
[Algebra K L]
[Algebra A L]
[IsScalarTower A K L]
[IsScalarTower A B L]
[IsDomain A]
[IsFractionRing A K]
[FiniteDimensional K L]
[Algebra.IsSeparable K L]
[Decidable (IsField A)]

Submodule.traceDual A K ⊤ = if IsField A then ⊤ else ⊥


theorem ContinuousAt.eventually_ne [TopologicalSpace Y] [T1Space Y] {g : X → Y} {x : X} {y : Y}
    (hg1 : ContinuousAt g x) (hg2 : g x ≠ y) : ∀ᶠ z in 𝓝 x, g z ≠ y

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
[T1Space Y]
{g : X → Y}
{x : X}
{y : Y}
(hg1 : ContinuousAt g x)
(hg2 : g x ≠ y)


protected theorem tendsto_nhds_atTop [NoMaxOrder X] : Tendsto 𝓝 (atTop : Filter X) (𝓝 atTop)

{X : Type u_2}
[TopologicalSpace X]
[PartialOrder X]
[OrderTopology X]
[NoMaxOrder X]

Filter.Tendsto 𝓝 Filter.atTop (𝓝 Filter.atTop)


lemma coe_ofLE (x : RelSeries r) {s : Rel α α} (h : r ≤ s) :
    (x.ofLE h : _ → _) = x

{α : Type u_1}
{r : Rel α α}
(x : RelSeries r)
{s : Rel α α}
(h : r ≤ s)


/-- Yet another metric characterization of Cauchy sequences on integers. This one is often the
most efficient. -/
theorem EMetric.cauchySeq_iff_le_tendsto_0 [Nonempty β] [SemilatticeSup β] {s : β → α} :
    CauchySeq s ↔ ∃ b : β → ℝ≥0∞, (∀ n m N : β, N ≤ n → N ≤ m → edist (s n) (s m) ≤ b N) ∧
      Tendsto b atTop (𝓝 0)

{α : Type u_1}
{β : Type u_2}
[PseudoEMetricSpace α]
[Nonempty β]
[SemilatticeSup β]
{s : β → α}

CauchySeq s ↔ ∃ b, (∀ (n m N : β), N ≤ n → N ≤ m → edist (s n) (s m) ≤ b N) ∧ Filter.Tendsto b Filter.atTop (𝓝 0)


@[simp]
theorem inter_self (s : Finset α) : s ∩ s = s

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


@[simp]
theorem abs_cpow_inv_nat (x : ℂ) (n : ℕ) : abs (x ^ (n⁻¹ : ℂ)) = Complex.abs x ^ (n⁻¹ : ℝ)

Complex.abs (x ^ (↑n)⁻¹) = Complex.abs x ^ (↑n)⁻¹


protected theorem HasStrictFDerivAt.differentiableAt (hf : HasStrictFDerivAt f f' x) :
    DifferentiableAt 𝕜 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 : HasStrictFDerivAt f f' x)


protected lemma IsOfFinOrder.eq_neg_one (ha₀ : a ≤ 0) (ha : IsOfFinOrder a) : a = -1

{G : Type u_1}
[LinearOrderedRing G]
{a : G}
(ha₀ : a ≤ 0)
(ha : IsOfFinOrder a)


@[simp] lemma card_eq_zero_of_infinite [Infinite α] : Nat.card α = 0


lemma nilRank_le_natTrailingDegree_charpoly (x : L) :
    nilRank φ ≤ (φ x).charpoly.natTrailingDegree

{R : Type u_1}
{L : Type u_2}
{M : Type u_3}
[CommRing R]
[AddCommGroup L]
[Module R L]
[AddCommGroup M]
[Module R M]
(φ : L →ₗ[R] Module.End R M)
[Module.Free R M]
[Module.Finite R M]
[Module.Finite R L]
[Module.Free R L]
[Nontrivial R]
(x : L)

φ.nilRank ≤ (LinearMap.charpoly (φ x)).natTrailingDegree


/-- If a function is bounded on a discrete space, it is automatically continuous,
and therefore gives rise to an element of the type of bounded continuous functions. -/
@[simps]
def mkOfDiscrete [DiscreteTopology α] (f : α → β) (C : ℝ) (h : ∀ x y : α, dist (f x) (f y) ≤ C) :
    α →ᵇ β

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
[DiscreteTopology α]
(f : α → β)
(C : ℝ)
(h : ∀ (x y : α), dist (f x) (f y) ≤ C)

∀ (a : α), (BoundedContinuousFunction.mkOfDiscrete f C h) a = f a


theorem continuousAt_iff_continuous_left'_right' {a : α} {f : α → β} :
    ContinuousAt f a ↔ ContinuousWithinAt f (Iio a) a ∧ ContinuousWithinAt f (Ioi a) a

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

ContinuousAt f a ↔ ContinuousWithinAt f (Set.Iio a) a ∧ ContinuousWithinAt f (Set.Ioi a) a


/-- Morphisms map the zero pseudoelement to the zero pseudoelement. -/
@[simp]
theorem apply_zero {P Q : C} (f : P ⟶ Q) : f 0 = 0

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

CategoryTheory.Abelian.Pseudoelement.pseudoApply f 0 = 0


lemma completedRiemannZeta_eq (s : ℂ) :
    completedRiemannZeta s = completedRiemannZeta₀ s - 1 / s - 1 / (1 - s)


/-- If `x` belongs to the ideal generated by generators in `s`, then every element of the support of
`x` factors additively through an element of `s`.
-/
theorem AddMonoidAlgebra.mem_ideal_span_of'_image [AddMonoid A] [Semiring k] {s : Set A}
    {x : AddMonoidAlgebra k A} :
    x ∈ Ideal.span (AddMonoidAlgebra.of' k A '' s) ↔ ∀ m ∈ x.support, ∃ m' ∈ s, ∃ d, m = d + m'

{k : Type u_1}
{A : Type u_2}
[AddMonoid A]
[Semiring k]
{s : Set A}
{x : AddMonoidAlgebra k A}


@[simp] protected theorem Nat.add_zero (n : Nat) : n + 0 = n


theorem lt_of_eq_of_lt {α} [OrderedSemiring α] {a b : α} (ha : a = 0) (hb : b < 0) : a + b < 0

{α : Type u_1}
[OrderedSemiring α]
{a b : α}
(ha : a = 0)
(hb : b < 0)


@[norm_cast] -- Porting note (#10618): simp can prove this (removed `@[simp]`)
theorem coe_natCast : ∀ n : ℕ, ((n : s) : R) = n

{R : Type u}
[Ring R]
(s : Subring R)
(n : ℕ)


lemma isProbabilityMeasure_comap (hf : Injective f) (hf' : ∀ᵐ a ∂μ, a ∈ range f)
    (hf'' : ∀ s, MeasurableSet s → MeasurableSet (f '' s)) :
    IsProbabilityMeasure (μ.comap f)

(hf'' : ∀ (s : Set β), MeasurableSet s → MeasurableSet (f '' s))

MeasureTheory.IsProbabilityMeasure (MeasureTheory.Measure.comap f μ)


/-- The functor `HomologicalComplex C c ⥤ ShortComplex C` which sends a homological
complex `K` to the short complex `K.X (c.prev i) ⟶ K.X i ⟶ K.X (c.next i)`. -/
@[simps!]
noncomputable def shortComplexFunctor (i : ι)

∀ {X Y : HomologicalComplex C c} (f : X ⟶ Y), ((HomologicalComplex.shortComplexFunctor C c i).map f).τ₁ = f.f (c.prev i)


theorem Iic_union_Ioc (h : min c d < b) : Iic b ∪ Ioc c d = Iic (max b d)

{α : Type u_1}
[LinearOrder α]
{b c d : α}
(h : min c d < b)

Set.Iic b ∪ Set.Ioc c d = Set.Iic (max b d)


@[simp]
theorem properDivisors_zero : properDivisors 0 = ∅


theorem integrable_rnDeriv_smul_iff [HaveLebesgueDecomposition μ ν] (hμν : μ ≪ ν)
    [SigmaFinite μ] {f : α → E} :
    Integrable (fun x ↦ (μ.rnDeriv ν x).toReal • f x) ν ↔ Integrable f μ

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

MeasureTheory.Integrable (fun x => (μ.rnDeriv ν x).toReal • f x) ν ↔ MeasureTheory.Integrable f μ


theorem connectedComponentIn_eq_image {F : Set α} {x : α} (h : x ∈ F) :
    connectedComponentIn F x = (↑) '' connectedComponent (⟨x, h⟩ : F)

{α : Type u}
[TopologicalSpace α]
{F : Set α}
{x : α}
(h : x ∈ F)

connectedComponentIn F x = Subtype.val '' connectedComponent ⟨x, h⟩


@[to_additive]
theorem smul_set_range [SMul α β] {ι : Sort*} (a : α) (f : ι → β) :
    a • range f = range fun i ↦ a • f i

{α : Type u_2}
{β : Type u_3}
[VAdd α β]
{ι : Sort u_5}
(a : α)
(f : ι → β)

a +ᵥ Set.range f = Set.range fun i => a +ᵥ f i


theorem norm_two_pi_i_inv_smul_integral_le_of_norm_le_const {f : ℂ → E} {c : ℂ} {R C : ℝ}
    (hR : 0 ≤ R) (hf : ∀ z ∈ sphere c R, ‖f z‖ ≤ C) :
    ‖(2 * π * I : ℂ)⁻¹ • ∮ z in C(c, R), f z‖ ≤ R * C

(hf : ∀ z ∈ Metric.sphere c R, ‖f z‖ ≤ C)

‖(2 * ↑π * Complex.I)⁻¹ • ∮ (z : ℂ) in C(c, R), f z‖ ≤ R * C


theorem nfp_mul_eq_opow_omega {a b : Ordinal} (hb : 0 < b) (hba : b ≤ (a^omega)) :
    nfp (a * ·) b = (a^omega.{u})

{a b : Ordinal.{u}}
(hb : 0 < b)
(hba : b ≤ a ^ Ordinal.omega)

Ordinal.nfp (fun x => a * x) b = a ^ Ordinal.omega


theorem IsPath.of_append_right {u v w : V} {p : G.Walk u v} {q : G.Walk v w}
    (h : (p.append q).IsPath) : q.IsPath

{V : Type u}
{G : SimpleGraph V}
{u v w : V}
{p : G.Walk u v}
{q : G.Walk v w}
(h : (p.append q).IsPath)


@[to_additive]
protected theorem div [Div β] [ContinuousDiv β] (hu : Adapted f u) (hv : Adapted f v) :
    Adapted f (u / v)

{Ω : Type u_1}
{β : Type u_2}
{ι : Type u_3}
{m : MeasurableSpace Ω}
[TopologicalSpace β]
[Preorder ι]
{u v : ι → Ω → β}
{f : MeasureTheory.Filtration ι m}
[Div β]
[ContinuousDiv β]
(hu : MeasureTheory.Adapted f u)
(hv : MeasureTheory.Adapted f v)


@[to_additive]
theorem Right.inv_lt_self (h : 1 < a) : a⁻¹ < a

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


theorem M.dest_map {α β : TypeVec n} (g : α ⟹ β) (x : P.M α) :
    M.dest P (g <$$> x) = (appendFun g fun x => g <$$> x) <$$> M.dest P x

{n : ℕ}
(P : MvPFunctor.{u} (n + 1))
{α β : TypeVec.{u} n}
(g : α ⟹ β)
(x : P.M α)

MvPFunctor.M.dest P (g <$$> x) = (g ::: fun x => g <$$> x) <$$> MvPFunctor.M.dest P x


@[simp]
theorem pi_principal [Finite ι] (s : (i : ι) → Set (α i)) :
    pi (fun i ↦ 𝓟 (s i)) = 𝓟 (univ.pi s)

{ι : Type u_1}
{α : ι → Type u_2}
[Finite ι]
(s : (i : ι) → Set (α i))

(Filter.pi fun i => 𝓟 (s i)) = 𝓟 (Set.univ.pi s)


/-- `sSupHomClass F α β` states that `F` is a type of `⨆`-preserving morphisms.

You should extend this class when you extend `sSupHom`. -/
class sSupHomClass (F α β : Type*) [SupSet α] [SupSet β] [FunLike F α β] : Prop where
  /-- The proposition that members of `sSupHomClass`s commute with arbitrary suprema/joins. -/
  map_sSup (f : F) (s : Set α) : f (sSup s) = sSup (f '' s)

{F : Type u_8}
{α : Type u_9}
{β : Type u_10}
[SupSet α]
[SupSet β]
[FunLike F α β]
[self : sSupHomClass F α β]
(f : F)
(s : Set α)


/-- We say that a type has `MeasurableSub` if `(c - ·)` and `(· - c)` are measurable
functions. For a typeclass assuming measurability of `uncurry (-)` see `MeasurableSub₂`. -/
class MeasurableSub (G : Type*) [MeasurableSpace G] [Sub G] : Prop where
  measurable_const_sub : ∀ c : G, Measurable (c - ·)
  measurable_sub_const : ∀ c : G, Measurable (· - c)

{G : Type u_2}
[MeasurableSpace G]
[Sub G]
[self : MeasurableSub G]
(c : G)


@[simp]
theorem map_comp {I : Type w} [Group I] (g : H →* I) : (map g).comp (map f) = map (g.comp f)

{G : Type u}
[Group G]
{H : Type v}
[Group H]
(f : G →* H)
{I : Type w}
[Group I]
(g : H →* I)

(Abelianization.map g).comp (Abelianization.map f) = Abelianization.map (g.comp f)


@[simp]
theorem mk_finset_of_infinite (α : Type u) [Infinite α] : #(Finset α) = #α


theorem toDual_max' {s : Finset α} (hs : s.Nonempty) :
    toDual (max' s hs) = min' (s.image toDual) (hs.image _)

{α : Type u_2}
[LinearOrder α]
{s : Finset α}
(hs : s.Nonempty)

OrderDual.toDual (s.max' hs) = (Finset.image (⇑OrderDual.toDual) s).min' ⋯


@[simp]
theorem sup_dedup (s : Multiset α) : (dedup s).sup = s.sup

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


/-- This is the *continuous functional calculus* of an element `a : A` applied to bare functions.
When either `a` does not satisfy the predicate `p` (i.e., `a` is not `IsStarNormal`,
`IsSelfAdjoint`, or `0 ≤ a` when `R` is `ℂ`, `ℝ`, or `ℝ≥0`, respectively), or when `f : R → R` is
not continuous on the spectrum of `a`, then `cfc f a` returns the junk value `0`.

This is the primary declaration intended for widespread use of the continuous functional calculus,
and all the API applies to this declaration. For more information, see the module documentation
for `Analysis.CstarAlgebra.ContinuousFunctionalCalculus.Unital`. -/
noncomputable irreducible_def cfc (f : R → R) (a : A) : A

{R : Type u_3}
{A : Type u_4}
{p : A → Prop}
[CommSemiring R]
[StarRing R]
[MetricSpace R]
[TopologicalSemiring R]
[ContinuousStar R]
[TopologicalSpace A]
[Ring A]
[StarRing A]
[Algebra R A]
[ContinuousFunctionalCalculus R p]
(f : R → R)
(a : A)

cfc f a =
  if h : p a ∧ ContinuousOn f (spectrum R a) then
    (cfcHom ⋯) { toFun := (spectrum R a).restrict f, continuous_toFun := ⋯ }
  else 0


/-- If a function has compact multiplicative support, then either the function is trivial
or the space is finite-dimensional. -/
@[to_additive existing]
theorem HasCompactMulSupport.eq_one_or_finiteDimensional {X : Type*} [TopologicalSpace X] [One X]
    [T1Space X] {f : E → X} (hf : HasCompactMulSupport f) (h'f : Continuous f) :
    f = 1 ∨ FiniteDimensional 𝕜 E

(𝕜 : Type u)
[NontriviallyNormedField 𝕜]
{E : Type v}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[CompleteSpace 𝕜]
{X : Type u_1}
[TopologicalSpace X]
[One X]
[T1Space X]
{f : E → X}
(hf : HasCompactMulSupport f)
(h'f : Continuous f)


/-- The absolute value satisfies the triangle inequality. -/
@[to_additive "The absolute value satisfies the triangle inequality."]
lemma mabs_mul_le (a b : α) : |a * b|ₘ ≤ |a|ₘ * |b|ₘ

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


@[to_additive]
theorem IsCyclic.exponent_eq_zero_of_infinite [Group α] [IsCyclic α] [Infinite α] :
    exponent α = 0

{α : Type u}
[Group α]
[IsCyclic α]
[Infinite α]


@[simp] theorem mul_eq : Nat.mul x y = x * y


theorem toEquiv_injective : Function.Injective (toEquiv : (A ≃ₗc[R] B) → A ≃ B)

{R : Type u_1}
{A : Type u_2}
{B : Type u_3}
[CommSemiring R]
[AddCommMonoid A]
[AddCommMonoid B]
[Module R A]
[Module R B]
[CoalgebraStruct R A]
[CoalgebraStruct R B]


theorem twoCoboundariesOfEq_apply {f : G × G → A} {x : G → A}
    (hf : ∀ g h, A.ρ g (x h) - x (g * h) + x g = f (g, h)) :
    (twoCoboundariesOfEq hf).1.1 = f

↑↑(groupCohomology.twoCoboundariesOfEq hf) = f


theorem completion.map_zero (V W : SemiNormedGrp) : completion.map (0 : V ⟶ W) = 0


theorem ofDigits_mod (b k : ℕ) (L : List ℕ) : ofDigits b L % k = ofDigits (b % k) L % k

Nat.ofDigits b L % k = Nat.ofDigits (b % k) L % k


@[simp, measurability]
theorem measurableSet_Ioi : MeasurableSet (Ioi a)

{α : Type u_1}
[TopologicalSpace α]
[MeasurableSpace α]
[OpensMeasurableSpace α]
[LinearOrder α]
[OrderClosedTopology α]
{a : α}


@[reassoc (attr := simp)]
lemma commShiftIso_inv_naturality {X Y : C} (f : X ⟶ Y) (a : A) :
    (F.map f)⟦a⟧' ≫ (F.commShiftIso a).inv.app Y =
      (F.commShiftIso a).inv.app X ≫ F.map (f⟦a⟧')

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_6, u_1} C]
[CategoryTheory.Category.{u_7, 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]
{X Y : C}
(f : X ⟶ Y)
(a : A)

CategoryTheory.CategoryStruct.comp ((CategoryTheory.shiftFunctor D a).map (F.map f)) ((F.commShiftIso a).inv.app Y) =
  CategoryTheory.CategoryStruct.comp ((F.commShiftIso a).inv.app X) (F.map ((CategoryTheory.shiftFunctor C a).map f))


theorem eq_of_mem_map_const {b₁ b₂ : β} {l : List α} (h : b₁ ∈ map (Function.const α b₂) l) :
    b₁ = b₂

(h : b₁ ∈ Multiset.map (Function.const α b₂) ↑l)


/-- Any linear map on a finite dimensional space over a complete field is continuous. -/
theorem LinearMap.continuous_of_finiteDimensional [T2Space E] [FiniteDimensional 𝕜 E]
    (f : E →ₗ[𝕜] F') : Continuous f

{𝕜 : Type u}
[hnorm : NontriviallyNormedField 𝕜]
{E : Type v}
[AddCommGroup E]
[Module 𝕜 E]
[TopologicalSpace E]
[TopologicalAddGroup E]
[ContinuousSMul 𝕜 E]
{F' : Type x}
[AddCommGroup F']
[Module 𝕜 F']
[TopologicalSpace F']
[TopologicalAddGroup F']
[ContinuousSMul 𝕜 F']
[CompleteSpace 𝕜]
[T2Space E]
[FiniteDimensional 𝕜 E]
(f : E →ₗ[𝕜] F')


theorem IsLUB.exists_between' (h : IsLUB s a) (h' : a ∉ s) (hb : b < a) : ∃ c ∈ s, b < c ∧ c < a

{α : Type u}
[LinearOrder α]
{s : Set α}
{a b : α}
(h : IsLUB s a)
(h' : a ∉ s)
(hb : b < a)


@[simp]
theorem eval₂_pow {p : MvPolynomial σ R} : ∀ {n : ℕ}, (p ^ n).eval₂ f g = p.eval₂ f g ^ n

{R : Type u}
{S₁ : Type v}
{σ : Type u_1}
[CommSemiring R]
[CommSemiring S₁]
(f : R →+* S₁)
(g : σ → S₁)
{p : MvPolynomial σ R}
{n : ℕ}

MvPolynomial.eval₂ f g (p ^ n) = MvPolynomial.eval₂ f g p ^ n


theorem bind_comm {f : α → β → Option γ} (a : Option α) (b : Option β) :
    (a.bind fun x => b.bind (f x)) = b.bind fun y => a.bind fun x => f x y

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
{f : α → β → Option γ}
(a : Option α)
(b : Option β)


theorem integrable_stoppedValue_of_mem_finset (hτ : IsStoppingTime ℱ τ)
    (hu : ∀ n, Integrable (u n) μ) {s : Finset ι} (hbdd : ∀ ω, τ ω ∈ s) :
    Integrable (stoppedValue u τ) μ

(hu : ∀ (n : ι), MeasureTheory.Integrable (u n) μ)

MeasureTheory.Integrable (MeasureTheory.stoppedValue u τ) μ


@[simp]
theorem normalizedFactors_mul {x y : α} (hx : x ≠ 0) (hy : y ≠ 0) :
    normalizedFactors (x * y) = normalizedFactors x + normalizedFactors y

{α : Type u_1}
[CancelCommMonoidWithZero α]
[NormalizationMonoid α]
[UniqueFactorizationMonoid α]
{x y : α}
(hx : x ≠ 0)
(hy : y ≠ 0)

UniqueFactorizationMonoid.normalizedFactors (x * y) =
  UniqueFactorizationMonoid.normalizedFactors x + UniqueFactorizationMonoid.normalizedFactors y


theorem sub_mk (a c) (b d) : (mk a b : Localization M) - mk c d =
    mk ((d : R) * a - b * c) (b * d)

{R : Type u_1}
[CommRing R]
{M : Submonoid R}
(a c : R)
(b d : ↥M)

Localization.mk a b - Localization.mk c d = Localization.mk (↑d * a - ↑b * c) (b * d)


/-- Two n-simplices among cospherical points in n-space have the same
circumradius. -/
theorem circumradius_eq_of_cospherical {ps : Set P} {n : ℕ} [FiniteDimensional ℝ V]
    (hd : finrank ℝ V = n) (hc : Cospherical ps) {sx₁ sx₂ : Simplex ℝ P n}
    (hsx₁ : Set.range sx₁.points ⊆ ps) (hsx₂ : Set.range sx₂.points ⊆ ps) :
    sx₁.circumradius = sx₂.circumradius

(hd : FiniteDimensional.finrank ℝ V = n)


theorem unbounded_le_inter_not_le [SemilatticeSup α] (a : α) :
    Unbounded (· ≤ ·) (s ∩ { b | ¬b ≤ a }) ↔ Unbounded (· ≤ ·) s

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

Set.Unbounded (fun x x_1 => x ≤ x_1) (s ∩ {b | ¬b ≤ a}) ↔ Set.Unbounded (fun x x_1 => x ≤ x_1) s


theorem comp_P_eq_self_iff {Y : C} {n q : ℕ} {φ : Y ⟶ X _[n + 1]} :
    φ ≫ (P q).f (n + 1) = φ ↔ HigherFacesVanish q φ

{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
[CategoryTheory.Preadditive C]
{X : CategoryTheory.SimplicialObject C}
{Y : C}
{n q : ℕ}
{φ : Y ⟶ X _[n + 1]}

φ ≫ (AlgebraicTopology.DoldKan.P q).f (n + 1) = φ ↔ AlgebraicTopology.DoldKan.HigherFacesVanish q φ


/-- `Sum.inl` as a relation embedding into `Sum.Lex r s`. -/
@[simps]
def sumLexInl (r : α → α → Prop) (s : β → β → Prop) : r ↪r Sum.Lex r s

{α : Type u_1}
{β : Type u_2}
(r : α → α → Prop)
(s : β → β → Prop)
(val : α)

(RelEmbedding.sumLexInl r s) val = Sum.inl val


lemma eq_open_union_countable [HereditarilyLindelofSpace X] {ι : Type u} (U : ι → Set X)
    (h : ∀ i, IsOpen (U i)) : ∃ t : Set ι, t.Countable ∧ ⋃ i∈t, U i = ⋃ i, U i

{X : Type u}
[TopologicalSpace X]
[HereditarilyLindelofSpace X]
{ι : Type u}
(U : ι → Set X)
(h : ∀ (i : ι), IsOpen (U i))

∃ t, t.Countable ∧ ⋃ i ∈ t, U i = ⋃ i, U i


@[simp]
theorem zero_coeff {a : Γ} : (0 : HahnSeries Γ R).coeff a = 0

{Γ : Type u_1}
{R : Type u_2}
[PartialOrder Γ]
[Zero R]
{a : Γ}


@[simp]
theorem map_id (S : ConvexCone 𝕜 E) : S.map LinearMap.id = S

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[Module 𝕜 E]
(S : ConvexCone 𝕜 E)


/-- An outer measure is a countably subadditive monotone function that sends `∅` to `0`. -/
structure OuterMeasure (α : Type*) where
  /-- Outer measure function. Use automatic coercion instead. -/
  protected measureOf : Set α → ℝ≥0∞
  protected empty : measureOf ∅ = 0
  protected mono : ∀ {s₁ s₂}, s₁ ⊆ s₂ → measureOf s₁ ≤ measureOf s₂
  protected iUnion_nat : ∀ s : ℕ → Set α, Pairwise (Disjoint on s) →
    measureOf (⋃ i, s i) ≤ ∑' i, measureOf (s i)

{α : Type u_2}
(self : MeasureTheory.OuterMeasure α)


/-- The regular topology on any preregular category is subcanonical. -/
theorem subcanonical [Preregular C] : Sheaf.Subcanonical (regularTopology C)

{C : Type u_1}
[CategoryTheory.Category.{u_4, u_1} C]
[CategoryTheory.Preregular C]


theorem cauchy_iff {F : Filter R} : Cauchy F ↔
    F.NeBot ∧ ∀ γ : Γ₀ˣ, ∃ M ∈ F, ∀ᵉ (x ∈ M) (y ∈ M), (v (y - x) : Γ₀) < γ

{R : Type u}
[Ring R]
{Γ₀ : Type v}
[LinearOrderedCommGroupWithZero Γ₀]
[_i : Valued R Γ₀]
{F : Filter R}

Cauchy F ↔ F.NeBot ∧ ∀ (γ : Γ₀ˣ), ∃ M ∈ F, ∀ x ∈ M, ∀ y ∈ M, Valued.v (y - x) < ↑γ


/-- The canonical comparison functor between the indexing category of the presentation and the
    comma category `CostructuredArrow yoneda A`. This functor is always final. -/
@[simps! obj_left obj_right_as obj_hom map_left]
def toCostructuredArrow : P.I ⥤ CostructuredArrow yoneda A

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

(P : CategoryTheory.Limits.IndObjectPresentation A)

∀ {X Y : P.I} (f : X ⟶ Y), (P.toCostructuredArrow.map f).left = P.F.map f


theorem Iic_def (b : α) : { x | x ≤ b } = Iic b


theorem differentiable_pow : Differentiable 𝕜 fun x : 𝕜 => x ^ n

{𝕜 : Type u}
[NontriviallyNormedField 𝕜]
(n : ℕ)


theorem HasBasis.sup' (hl : l.HasBasis p s) (hl' : l'.HasBasis p' s') :
    (l ⊔ l').HasBasis (fun i : PProd ι ι' => p i.1 ∧ p' i.2) fun i => s i.1 ∪ s' i.2

{α : Type u_1}
{ι : Sort u_4}
{ι' : Sort u_5}
{l l' : Filter α}
{p : ι → Prop}
{s : ι → Set α}
{p' : ι' → Prop}
{s' : ι' → Set α}
(hl : l.HasBasis p s)
(hl' : l'.HasBasis p' s')

(l ⊔ l').HasBasis (fun i => p i.fst ∧ p' i.snd) fun i => s i.fst ∪ s' i.snd


@[to_additive nsmul_nonpos]
theorem pow_le_one' {a : M} (H : a ≤ 1) (n : ℕ) : a ^ n ≤ 1

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


@[simp]
theorem lift_symm_apply (F : FreeNonUnitalNonAssocAlgebra R X →ₙₐ[R] A) :
    (lift R).symm F = F ∘ of R

(FreeNonUnitalNonAssocAlgebra.lift R).symm F = ⇑F ∘ FreeNonUnitalNonAssocAlgebra.of R


/-- Shows that `Aₙ = bₙ * Aₙ₋₁ + aₙ * Aₙ₋₂` and `Bₙ = bₙ * Bₙ₋₁ + aₙ * Bₙ₋₂`. -/
theorem conts_recurrence {gp ppred pred : Pair K} (succ_nth_s_eq : g.s.get? (n + 1) = some gp)
    (nth_conts_eq : g.conts n = ppred) (succ_nth_conts_eq : g.conts (n + 1) = pred) :
    g.conts (n + 2) = ⟨gp.b * pred.a + gp.a * ppred.a, gp.b * pred.b + gp.a * ppred.b⟩

g.conts (n + 2) = { a := gp.b * pred.a + gp.a * ppred.a, b := gp.b * pred.b + gp.a * ppred.b }


/-- Given `Φ : LocalizerMorphism W₁ W₂`, `L : C₂ ⥤ D` a localization functor for `W₂` and
a morphism `y : L.obj X₂ ⟶ X₃`, this is the functor which sends `R : Φ.RightResolution d` to
`(isoOfHom L W₂ R.w R.hw).inv ≫ y` in the category `w.CostructuredArrowDownwards y`
where `w` is `TwoSquare.mk Φ.functor (Φ.functor ⋙ L) L (𝟭 _) (Functor.rightUnitor _).inv`. -/
@[simps]
noncomputable def fromRightResolution :
    Φ.RightResolution X₂ ⥤ (TwoSquare.mk Φ.functor (Φ.functor ⋙ L) L (𝟭 _)
      (Functor.rightUnitor _).inv).CostructuredArrowDownwards y

{W₁ : CategoryTheory.MorphismProperty C₁}

{W₂ : CategoryTheory.MorphismProperty C₂}

(Φ : CategoryTheory.LocalizerMorphism W₁ W₂)

(CategoryTheory.LocalizerMorphism.IsRightDerivabilityStructure.Constructor.fromRightResolution Φ L y).obj R =
  CategoryTheory.CostructuredArrow.mk
    (CategoryTheory.StructuredArrow.homMk
      (CategoryTheory.CategoryStruct.comp (CategoryTheory.Localization.isoOfHom L W₂ R.w ⋯).inv y) ⋯)


/-- A short complex `S` is short exact if it is exact, `S.f` is a mono and `S.g` is an epi. -/
structure ShortExact : Prop where
  exact : S.Exact
  [mono_f : Mono S.f]
  [epi_g : Epi S.g]


/-- A type synonym used by `abel` to represent `n • x + a` in an additive commutative group. -/
theorem termg_eq {α : Type*} [AddCommGroup α] (n : ℤ) (x a : α) : termg n x a = n • x + a

{α : Type u_1}
[AddCommGroup α]
(n : ℤ)
(x a : α)

Mathlib.Tactic.Abel.termg n x a = n • x + a


@[to_additive]
theorem closure_iUnion {ι} (s : ι → Set M) : closure (⋃ i, s i) = ⨆ i, closure (s i)

{M : Type u_1}
[Mul M]
{ι : Sort u_4}
(s : ι → Set M)

Subsemigroup.closure (⋃ i, s i) = ⨆ i, Subsemigroup.closure (s i)


@[to_additive]
protected theorem NeBot.inv : f.NeBot → f⁻¹.NeBot


@[simp]
theorem bot : x ≡ y [SMOD (⊥ : Submodule R M)] ↔ x = y

{R : Type u_1}
[Ring R]
{M : Type u_3}
[AddCommGroup M]
[Module R M]
{x y : M}


@[to_additive (attr := nontriviality)]
theorem isUnit_of_subsingleton [Monoid M] [Subsingleton M] (a : M) : IsUnit a

{M : Type u_1}
[AddMonoid M]
[Subsingleton M]
(a : M)


/-- Given an open cover on `X`, we may pull them back along a morphism `f : W ⟶ X` to obtain
an open cover of `W`. This is similar to `Scheme.OpenCover.pullbackCover`, but here we
take `pullback (𝒰.map x) f` instead of `pullback f (𝒰.map x)`. -/
@[simps]
def OpenCover.pullbackCover' {X W : Scheme.{u}} (𝒰 : X.OpenCover) (f : W ⟶ X) :
    W.OpenCover

{X W : AlgebraicGeometry.Scheme}
(𝒰 : X.OpenCover)
(f : W ⟶ X)
(x : ↑↑W.toPresheafedSpace)

(𝒰.pullbackCover' f).f x = 𝒰.f (f.val.base x)


@[to_additive "A left transversal is finite iff the subgroup has finite index"]
theorem finite_iff
    (h : S ∈ Subgroup.leftTransversals (H : Set G)) :
    Finite S ↔ H.FiniteIndex

{G : Type u_1}
[Group G]
{H : Subgroup G}
{S : Set G}
(h : S ∈ Subgroup.leftTransversals ↑H)


theorem IsMinOn.hasLineDerivAt_eq_zero (h : IsMinOn f s a) (hd : HasLineDerivAt ℝ f f' a b)
    (h' : ∀ᶠ t : ℝ in 𝓝 0, a + t • b ∈ s) : f' = 0

{E : Type u_1}
[AddCommGroup E]
[Module ℝ E]
{f : E → ℝ}
{s : Set E}
{a b : E}
{f' : ℝ}
(h : IsMinOn f s a)
(hd : HasLineDerivAt ℝ f f' a b)
(h' : ∀ᶠ (t : ℝ) in 𝓝 0, a + t • b ∈ s)


@[to_additive (attr := simp) Discrete.addMonoidal_tensorUnit_as]
lemma Discrete.monoidal_tensorUnit_as : (𝟙_ (Discrete M)).as = 1


theorem getLast_concat' {a : α} (l : List α) : getLast (concat l a) (concat_ne_nil a l) = a


theorem strictMono_nhdsSet [T1Space X] : StrictMono (𝓝ˢ : Set X → Filter X)

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


theorem nonempty_of_union_eq_top_of_nonempty {ι : Type*} (t : Set ι) (s : ι → Set α)
    (H : Nonempty α) (w : ⋃ i ∈ t, s i = ⊤) : t.Nonempty

{α : Type u_1}
{ι : Type u_11}
(t : Set ι)
(s : ι → Set α)
(H : Nonempty α)
(w : ⋃ i ∈ t, s i = ⊤)


theorem Inseparable.joinedIn (h : Inseparable x y) (hx : x ∈ F) (hy : y ∈ F) : JoinedIn F x y

{X : Type u_1}
[TopologicalSpace X]
{x y : X}
{F : Set X}
(h : Inseparable x y)
(hx : x ∈ F)
(hy : y ∈ F)


@[continuity]
theorem IsCompactOperator.continuous {f : M₁ →ₛₗ[σ₁₂] M₂} (hf : IsCompactOperator f) :
    Continuous f

{𝕜₁ : Type u_1}
{𝕜₂ : Type u_2}
[NontriviallyNormedField 𝕜₁]
[NontriviallyNormedField 𝕜₂]
{σ₁₂ : 𝕜₁ →+* 𝕜₂}
[RingHomIsometric σ₁₂]
{M₁ : Type u_3}
{M₂ : Type u_4}
[TopologicalSpace M₁]
[AddCommGroup M₁]
[TopologicalSpace M₂]
[AddCommGroup M₂]
[Module 𝕜₁ M₁]
[Module 𝕜₂ M₂]
[TopologicalAddGroup M₁]
[ContinuousConstSMul 𝕜₁ M₁]
[TopologicalAddGroup M₂]
[ContinuousSMul 𝕜₂ M₂]
{f : M₁ →ₛₗ[σ₁₂] M₂}
(hf : IsCompactOperator ⇑f)


/-- `Finsupp.toDFinsupp` and `DFinsupp.toFinsupp` together form an equiv. -/
@[simps (config := .asFn)]
def finsuppEquivDFinsupp [DecidableEq ι] [Zero M] [∀ m : M, Decidable (m ≠ 0)] :
    (ι →₀ M) ≃ Π₀ _ : ι, M

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


@[symm]
nonrec theorem symm (h : x ~ᵢ y) : y ~ᵢ x

{X : Type u_1}
[TopologicalSpace X]
{x y : X}
(h : x ~ᵢ y)


/-- A proper map `f : X → Y` is **universally closed**: for any topological space `Z`, the map
`Prod.map f id : X × Z → Y × Z` is closed. We will prove in `isProperMap_iff_universally_closed`
that proper maps are exactly continuous maps which have this property, but this result should be
easier to use because it allows `Z` to live in any universe. -/
theorem IsProperMap.universally_closed (Z) [TopologicalSpace Z] (h : IsProperMap f) :
    IsClosedMap (Prod.map f id : X × Z → Y × Z)

{X : Type u_1}
{Y : Type u_2}
[TopologicalSpace X]
[TopologicalSpace Y]
{f : X → Y}
(Z : Type u_6)
[TopologicalSpace Z]
(h : IsProperMap f)


theorem eval₂_C_mk_eq_zero {I : Ideal R} :
    ∀ f ∈ (map (C : R →+* R[X]) I : Ideal R[X]), eval₂RingHom (C.comp (Quotient.mk I)) X f = 0

{R : Type u_1}
[CommRing R]
{I : Ideal R}
(f : R[X])

f ∈ Ideal.map Polynomial.C I → (Polynomial.eval₂RingHom (Polynomial.C.comp (Ideal.Quotient.mk I)) Polynomial.X) f = 0


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

↑((Equiv.Set.rangeInl α β).symm x) = Sum.inl x


theorem contDiffOn_arccos {n : ℕ∞} : ContDiffOn ℝ n arccos {-1, 1}ᶜ


@[simp]
theorem map_cocompact (h : X ≃ₜ Y) : map h (cocompact X) = cocompact Y

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

Filter.map (⇑h) (Filter.cocompact X) = Filter.cocompact Y


/-- The `n`th power of a quadratic character is the trivial character, when `n` is even. -/
theorem IsQuadratic.pow_even {χ : MulChar R R'} (hχ : χ.IsQuadratic) {n : ℕ} (hn : Even n) :
    χ ^ n = 1

{R : Type u_1}
[CommMonoid R]
{R' : Type u_2}
[CommRing R']
{χ : MulChar R R'}
(hχ : χ.IsQuadratic)
{n : ℕ}
(hn : Even n)


/-- `succAbove` is injective at the pivot -/
lemma succAbove_left_injective : Injective (@succAbove n)


@[simp] lemma antidiagonal_filter_le_fst_of_le {n k : ℕ} (h : k ≤ n) :
    (antidiagonal n).filter (fun a ↦ k ≤ a.fst) = (antidiagonal (n - k)).map
      (Embedding.prodMap ⟨_, add_left_injective k⟩ (Embedding.refl ℕ))

Finset.filter (fun a => k ≤ a.1) (Finset.antidiagonal n) =
  Finset.map ({ toFun := fun x => x + k, inj' := ⋯ }.prodMap (Function.Embedding.refl ℕ)) (Finset.antidiagonal (n - k))


theorem of_continuous_prop (h : ∀ f : X → Prop, (∀ s ∈ S, ContinuousOn f s) → Continuous f) :
    RestrictGenTopology S

(h : ∀ (f : X → Prop), (∀ s ∈ S, ContinuousOn f s) → Continuous f)


theorem isEquiv_iff_val_sub_one_lt_one [LinearOrderedCommGroupWithZero Γ₀]
    [LinearOrderedCommGroupWithZero Γ'₀] (v : Valuation K Γ₀) (v' : Valuation K Γ'₀) :
    v.IsEquiv v' ↔ ∀ {x : K}, v (x - 1) < 1 ↔ v' (x - 1) < 1

{K : Type u_1}
[DivisionRing K]
{Γ₀ : Type u_4}
{Γ'₀ : Type u_5}
[LinearOrderedCommGroupWithZero Γ₀]
[LinearOrderedCommGroupWithZero Γ'₀]
(v : Valuation K Γ₀)
(v' : Valuation K Γ'₀)


/-- Shows that $e^{x} * e^{-x} = 1$ -/
theorem exp_mul_exp_neg_eq_one [Algebra ℚ A] : exp A * evalNegHom (exp A) = 1

{A : Type u_1}
[CommRing A]
[Algebra ℚ A]

PowerSeries.exp A * PowerSeries.evalNegHom (PowerSeries.exp A) = 1


@[simp]
theorem coe_id : ⇑(OrderMonoidWithZeroHom.id α) = id

(α : Type u_2)
[Preorder α]
[MulZeroOneClass α]


theorem arg_mul_real {r : ℝ} (hr : 0 < r) (x : ℂ) : arg (x * r) = arg x


/-- Accessing the nth element of a vector made up
of one element `x : α` is `x` itself. -/
@[simp]
theorem get_cons_nil : ∀ {ix : Fin 1} (x : α), get (x ::ᵥ nil) ix = x


@[to_additive]
theorem norm_mul_le (x y : FreeGroup α) : norm (x * y) ≤ norm x + norm y

{α : Type u}
[DecidableEq α]
(x y : FreeGroup α)


theorem finite_iff_exists_equiv_fin {α : Sort*} : Finite α ↔ ∃ n, Nonempty (α ≃ Fin n)


{α : Type u}
(s : Computation α)
[h : s.Terminates]


@[simp]
theorem contMDiff_transDiffeomorph_right {f : M' → M} :
    ContMDiff I' (I.transDiffeomorph e) n f ↔ ContMDiff I' I n f

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_3}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{F : Type u_4}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{H : Type u_5}
[TopologicalSpace H]
{H' : Type u_6}
[TopologicalSpace H']
{I : ModelWithCorners 𝕜 E H}
{I' : ModelWithCorners 𝕜 E' H'}
{M : Type u_9}
[TopologicalSpace M]
[ChartedSpace H M]
{M' : Type u_10}
[TopologicalSpace M']
[ChartedSpace H' M']
{n : ℕ∞}
(e : E ≃ₘ⟮𝓘(𝕜, E), 𝓘(𝕜, F)⟯ F)
{f : M' → M}


theorem compProd_restrict {s : Set β} {t : Set γ} (hs : MeasurableSet s) (ht : MeasurableSet t) :
    Kernel.restrict κ hs ⊗ₖ Kernel.restrict η ht = Kernel.restrict (κ ⊗ₖ η) (hs.prod ht)

{η : ProbabilityTheory.Kernel (α × β) γ}

(κ.restrict hs).compProd (η.restrict ht) = (κ.compProd η).restrict ⋯


theorem dimH_ball_pi (x : ι → ℝ) {r : ℝ} (hr : 0 < r) :
    dimH (Metric.ball x r) = Fintype.card ι

{ι : Type u_1}
[Fintype ι]
(x : ι → ℝ)
{r : ℝ}
(hr : 0 < r)

dimH (Metric.ball x r) = ↑(Fintype.card ι)


@[simp]
theorem diagram_sndFrom (i j : D.J) : D.diagram.sndFrom ⟨i, j⟩ = j

{C : Type u₁}
[CategoryTheory.Category.{v, u₁} C]
(D : CategoryTheory.GlueData C)
(i j : D.J)


/-- The functor `(L, R) ⥤ (L ⋙ F, R ⋙ F)` -/
@[simps]
def post (L : A ⥤ T) (R : B ⥤ T) (F : T ⥤ C) : Comma L R ⥤ Comma (L ⋙ F) (R ⋙ F)

{A : Type u₁}
[CategoryTheory.Category.{v₁, u₁} A]
{B : Type u₂}
[CategoryTheory.Category.{v₂, u₂} B]
{T : Type u₃}
[CategoryTheory.Category.{v₃, u₃} T]
{C : Type u₄}
[CategoryTheory.Category.{v₄, u₄} C]
(L : CategoryTheory.Functor A T)
(R : CategoryTheory.Functor B T)
(F : CategoryTheory.Functor T C)

∀ {X Y : CategoryTheory.Comma L R} (f : X ⟶ Y), ((CategoryTheory.Comma.post L R F).map f).right = f.right


@[simp, norm_cast]
theorem coe_zero [Nontrivial α] : ↑(0 : Ico (0 : α) 1) = (0 : α)

{α : Type u_1}
[OrderedSemiring α]
[Nontrivial α]


@[simp]
theorem id_onBoundedFormula :
    ((LHom.id L).onBoundedFormula : L.BoundedFormula α n → L.BoundedFormula α n) = id

{L : FirstOrder.Language}
{α : Type u'}
{n : ℕ}

(FirstOrder.Language.LHom.id L).onBoundedFormula = id


/-- A graded version of `Monoid`

Like `Monoid.npow`, this has an optional `GMonoid.gnpow` field to allow definitional control of
natural powers of a graded monoid. -/
class GMonoid [AddMonoid ι] extends GMul A, GOne A where
  /-- Multiplication by `one` on the left is the identity -/
  one_mul (a : GradedMonoid A) : 1 * a = a
  /-- Multiplication by `one` on the right is the identity -/
  mul_one (a : GradedMonoid A) : a * 1 = a
  /-- Multiplication is associative -/
  mul_assoc (a b c : GradedMonoid A) : a * b * c = a * (b * c)
  /-- Optional field to allow definitional control of natural powers -/
  gnpow : ∀ (n : ℕ) {i}, A i → A (n • i) := GMonoid.gnpowRec
  /-- The zeroth power will yield 1 -/
  gnpow_zero' : ∀ a : GradedMonoid A, GradedMonoid.mk _ (gnpow 0 a.snd) = 1 := by
    apply_gmonoid_gnpowRec_zero_tac
  /-- Successor powers behave as expected -/
  gnpow_succ' :
    ∀ (n : ℕ) (a : GradedMonoid A),
      (GradedMonoid.mk _ <| gnpow n.succ a.snd) = ⟨_, gnpow n a.snd⟩ * a := by
    apply_gmonoid_gnpowRec_succ_tac

{ι : Type u_1}
{A : ι → Type u_2}
[AddMonoid ι]
[self : GradedMonoid.GMonoid A]
(a : GradedMonoid A)


theorem isTopologicalBasis_basic_opens :
    TopologicalSpace.IsTopologicalBasis
      (Set.range fun r : R => (basicOpen r : Set (PrimeSpectrum R)))

TopologicalSpace.IsTopologicalBasis (Set.range fun r => ↑(PrimeSpectrum.basicOpen r))


theorem quotientEquivSigmaZMod_symm_apply (q : orbitRel.Quotient (zpowers g) (G ⧸ H))
    (k : ZMod (minimalPeriod (g • ·) q.out')) :
    (quotientEquivSigmaZMod H g).symm ⟨q, k⟩ = g ^ (cast k : ℤ) • q.out'

(q : MulAction.orbitRel.Quotient (↥(Subgroup.zpowers g)) (G ⧸ H))

(k : ZMod (Function.minimalPeriod (fun x => g • x) (Quotient.out' q)))

(H.quotientEquivSigmaZMod g).symm ⟨q, k⟩ = g ^ k.cast • Quotient.out' q


@[simp]
theorem coe_top : ⇑(⊤ : sInfHom α β) = ⊤

{α : Type u_2}
{β : Type u_3}
[InfSet α]
[CompleteLattice β]


/-- If `f` is locally integrable, `f` has a bottom element, and `f =O[atTop] g`, for some
`g` integrable at `atTop`, then `f` is integrable. -/
theorem LocallyIntegrable.integrable_of_isBigO_atTop [IsMeasurablyGenerated (atTop (α := α))]
    [OrderBot α] (hf : LocallyIntegrable f μ) (ho : f =O[atTop] g)
    (hg : IntegrableAtFilter g atTop μ) : Integrable f μ

(hf : MeasureTheory.LocallyIntegrable f μ)

(hg : MeasureTheory.IntegrableAtFilter g Filter.atTop μ)


@[to_additive]
theorem le_mulRothNumber_product (s : Finset α) (t : Finset β) :
    mulRothNumber s * mulRothNumber t ≤ mulRothNumber (s ×ˢ t)

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[Monoid α]
[DecidableEq β]
[Monoid β]
(s : Finset α)
(t : Finset β)


theorem homEquiv_symm_id (X : D) : (adj.homEquiv _ X).symm (𝟙 _) = adj.counit.app X

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

(adj.homEquiv (G.obj X) X).symm (CategoryTheory.CategoryStruct.id (G.obj X)) = adj.counit.app X


theorem mem_support_uniformOfFintype (a : α) : a ∈ (uniformOfFintype α).support

{α : Type u_1}
[Fintype α]
[Nonempty α]
(a : α)


theorem exists_finset_card_le_mul [FiniteIndex H] {S : Finset G} (hS : closure (S : Set G) = ⊤) :
    ∃ T : Finset H, T.card ≤ H.index * S.card ∧ closure (T : Set H) = ⊤

{G : Type u_1}
[Group G]
(H : Subgroup G)
[H.FiniteIndex]
{S : Finset G}
(hS : Subgroup.closure ↑S = ⊤)

∃ T, T.card ≤ H.index * S.card ∧ Subgroup.closure ↑T = ⊤


theorem min_def (a b : α) : min a b = if a ≤ b then a else b


theorem eq_wittStructureInt (Φ : MvPolynomial idx ℤ) (φ : ℕ → MvPolynomial (idx × ℕ) ℤ)
    (h : ∀ n, bind₁ φ (wittPolynomial p ℤ n) = bind₁ (fun i => rename (Prod.mk i) (W_ ℤ n)) Φ) :
    φ = wittStructureInt p Φ

(h :
  ∀ (n : ℕ),
    (MvPolynomial.bind₁ φ) (W_ ℤ n) = (MvPolynomial.bind₁ fun i => (MvPolynomial.rename (Prod.mk i)) (W_ ℤ n)) Φ)


/-- If we have a functor `F : J ⥤ Π i, C i` into a category of indexed families,
and we have limits for each of the `F ⋙ Pi.eval C i`,
then `F` has a limit.
-/
theorem hasLimit_of_hasLimit_comp_eval : HasLimit F

[(i : I) → CategoryTheory.Category.{v₁, u₁} (C i)]

[∀ (i : I), CategoryTheory.Limits.HasLimit (F ⋙ CategoryTheory.Pi.eval C i)]


theorem ideal_le_vanishingIdeal_zeroLocus (I : Ideal A) :
    I ≤ (vanishingIdeal (zeroLocus 𝒜 I)).toIdeal

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

I ≤ (ProjectiveSpectrum.vanishingIdeal (ProjectiveSpectrum.zeroLocus 𝒜 ↑I)).toIdeal


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

∀ {X Y : PartialFun} (f : X ⟶ Y),
  partialFunToPointed.map f = { toFun := Option.elim' none fun a => (f a).toOption, map_point := ⋯ }


/-- `Prod.GameAdd` is a subrelation of `Prod.Lex`. -/
theorem gameAdd_le_lex : GameAdd rα rβ ≤ Prod.Lex rα rβ

{α : Type u_1}
{β : Type u_2}
(rα : α → α → Prop)
(rβ : β → β → Prop)


@[simp]
theorem compl_himp_compl : xᶜ ⇨ yᶜ = y ⇨ x

{α : Type u}
{x y : α}
[BooleanAlgebra α]


theorem isClosed_intrinsicFrontier (hs : IsClosed (affineSpan 𝕜 s : Set P)) :
    IsClosed (intrinsicFrontier 𝕜 s)

{𝕜 : Type u_1}
{V : Type u_2}
{P : Type u_5}
[Ring 𝕜]
[AddCommGroup V]
[Module 𝕜 V]
[TopologicalSpace P]
[AddTorsor V P]
{s : Set P}
(hs : IsClosed ↑(affineSpan 𝕜 s))


theorem contDiffWithinAtProp_self {f : E → E'} {s : Set E} {x : E} :
    ContDiffWithinAtProp 𝓘(𝕜, E) 𝓘(𝕜, E') n f s x ↔ ContDiffWithinAt 𝕜 n f s x

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{E' : Type u_5}
[NormedAddCommGroup E']
[NormedSpace 𝕜 E']
{n : ℕ∞}
{f : E → E'}
{s : Set E}
{x : E}


theorem rank_submodule_le (s : Submodule R M) : Module.rank R s ≤ Module.rank R M

{R : Type u}
{M : Type v}
[Ring R]
[AddCommGroup M]
[Module R M]
(s : Submodule R M)


/-- See note [partially-applied ext lemmas]. -/
@[ext high]
theorem hom_ext {f g : FreeAlgebra R X →ₐ[R] A}
    (w : (f : FreeAlgebra R X → A) ∘ ι R = (g : FreeAlgebra R X → A) ∘ ι R) : f = g

(w : ⇑f ∘ FreeAlgebra.ι R = ⇑g ∘ FreeAlgebra.ι R)


theorem div_lt_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)


theorem Inducing.isClosedMap (hf : Inducing f) (h : IsClosed (range f)) : IsClosedMap f

{X : Type u_1}
{Y : Type u_2}
{f : X → Y}
[TopologicalSpace X]
[TopologicalSpace Y]
(hf : Inducing f)
(h : IsClosed (Set.range f))


theorem finsetApprox.zero_not_mem : (0 : R) ∉ finsetApprox bS adm

{R : Type u_1}
{S : Type u_2}
[EuclideanDomain R]
[CommRing S]
[IsDomain S]
[Algebra R S]
{abv : AbsoluteValue R ℤ}
{ι : Type u_5}
[DecidableEq ι]
[Fintype ι]
(bS : Basis ι R S)
(adm : abv.IsAdmissible)
[Infinite R]
[DecidableEq R]


/-- The pushout provided by `HasPushout f g` fits into an `IsPushout`. -/
theorem of_hasPushout (f : Z ⟶ X) (g : Z ⟶ Y) [HasPushout f g] :
    IsPushout f g (pushout.inl f g) (pushout.inr f g)

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

CategoryTheory.IsPushout f g (CategoryTheory.Limits.pushout.inl f g) (CategoryTheory.Limits.pushout.inr f g)


theorem weightedSMul_congr (s t : Set α) (hst : μ s = μ t) :
    (weightedSMul μ s : F →L[ℝ] F) = weightedSMul μ t

{α : Type u_1}
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace ℝ F]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(s t : Set α)
(hst : μ s = μ t)

MeasureTheory.weightedSMul μ s = MeasureTheory.weightedSMul μ t


@[simp] theorem congr_mk {ra : Setoid α} {rb : Setoid β} (e : α ≃ β)
    (eq : ∀ a₁ a₂ : α, Setoid.r a₁ a₂ ↔ Setoid.r (e a₁) (e a₂)) (a : α) :
    Quotient.congr e eq (Quotient.mk ra a) = Quotient.mk rb (e a)

(eq : ∀ (a₁ a₂ : α), Setoid.r a₁ a₂ ↔ Setoid.r (e a₁) (e a₂))


@[simp]
theorem comp_zero : p.comp (0 : R[X]) = C (p.eval 0)

p.comp 0 = Polynomial.C (Polynomial.eval 0 p)


@[to_additive (attr := simp)]
theorem coe_toHomUnits {G M : Type*} [Group G] [Monoid M] (f : G →* M) (g : G) :
    (f.toHomUnits g : M) = f g

{G : Type u_1}
{M : Type u_2}
[Group G]
[Monoid M]
(f : G →* M)
(g : G)


theorem closed_iff_preimage_closed (hf : ClosedEmbedding f) {s : Set Y}
    (hs : s ⊆ range f) : IsClosed s ↔ IsClosed (f ⁻¹' s)

{X : Type u_1}
{Y : Type u_2}
{f : X → Y}
[TopologicalSpace X]
[TopologicalSpace Y]
(hf : ClosedEmbedding f)
{s : Set Y}
(hs : s ⊆ Set.range f)


theorem closedBall_sup (p : Seminorm 𝕜 E) (q : Seminorm 𝕜 E) (e : E) (r : ℝ) :
    closedBall (p ⊔ q) e r = closedBall p e r ∩ closedBall q e r

{𝕜 : Type u_3}
{E : Type u_7}
[SeminormedRing 𝕜]
[AddCommGroup E]
[SMul 𝕜 E]
(p q : Seminorm 𝕜 E)
(e : E)
(r : ℝ)

(p ⊔ q).closedBall e r = p.closedBall e r ∩ q.closedBall e r


@[simp]
theorem «forall» {p : ULift α → Prop} : (∀ x, p x) ↔ ∀ x : α, p (ULift.up x)

{α : Type u}
{p : ULift.{u_1, u} α → Prop}

(∀ (x : ULift.{u_1, u} α), p x) ↔ ∀ (x : α), p { down := x }


theorem exists_cos_eq_zero : 0 ∈ cos '' Icc (1 : ℝ) 2


theorem map_projective_iff (P : C) : Projective (F.functor.obj P) ↔ Projective P

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

CategoryTheory.Projective (F.functor.obj P) ↔ CategoryTheory.Projective P


@[to_additive (attr := simp)]
theorem mem_top (x : M) : x ∈ (⊤ : Submonoid M)


@[simp]
theorem pointwise_smul_toSubring {R' R A : Type*} [Semiring R'] [CommRing R] [Ring A]
    [MulSemiringAction R' A] [Algebra R A] [SMulCommClass R' R A] (m : R') (S : Subalgebra R A) :
    (m • S).toSubring = m • S.toSubring

{R' : Type u_4}
{R : Type u_5}
{A : Type u_6}
[Semiring R']
[CommRing R]
[Ring A]
[MulSemiringAction R' A]
[Algebra R A]
[SMulCommClass R' R A]
(m : R')
(S : Subalgebra R A)


theorem measurableSet_lineDifferentiableAt_uncurry (hf : Continuous f) :
    MeasurableSet {p : E × E | LineDifferentiableAt 𝕜 f p.1 p.2}

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
[LocallyCompactSpace 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
[MeasurableSpace E]
[OpensMeasurableSpace E]
{F : Type u_3}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
[CompleteSpace F]
{f : E → F}
[SecondCountableTopology E]
(hf : Continuous f)

MeasurableSet {p | LineDifferentiableAt 𝕜 f p.1 p.2}


/-- Spec, as a contravariant functor from commutative rings to sheafed spaces.
-/
@[simps]
def Spec.toSheafedSpace : CommRingCat.{u}ᵒᵖ ⥤ SheafedSpace CommRingCat

∀ {X Y : CommRingCatᵒᵖ} (f : X ⟶ Y),
  AlgebraicGeometry.Spec.toSheafedSpace.map f = AlgebraicGeometry.Spec.sheafedSpaceMap f.unop


theorem mul_lt_mul_left (h0 : a ≠ 0) (hinf : a ≠ ∞) : a * b < a * c ↔ b < c

{a b c : ℝ≥0∞}
(h0 : a ≠ 0)
(hinf : a ≠ ⊤)


@[simp]
theorem Irreducible.squarefree [CommMonoid R] {x : R} (h : Irreducible x) : Squarefree x

{R : Type u_1}
[CommMonoid R]
{x : R}
(h : Irreducible x)


/-- Prefer putting constants to the left of `X ^ n`.

This lemma is the loop-avoiding `simp` version of `X_pow_mul_assoc`. -/
@[simp]
theorem X_pow_mul_assoc_C {n : ℕ} (r : R) : p * X ^ n * C r = p * C r * X ^ n

{R : Type u}
[Semiring R]
{p : R[X]}
{n : ℕ}
(r : R)

p * Polynomial.X ^ n * Polynomial.C r = p * Polynomial.C r * Polynomial.X ^ n


theorem exists_of_set {l : List α} (h : n < l.length) :
    ∃ l₁ a l₂, l = l₁ ++ a :: l₂ ∧ l₁.length = n ∧ l.set n a' = l₁ ++ a' :: l₂

{α : Type u_1}
{n : Nat}
{a' : α}
{l : List α}
(h : n < l.length)


/-- A presheaf `P` is a sheaf for the Grothendieck topology `J` iff for every covering sieve
    `S` of `J`, the natural cone associated to `P` and `S` is a limit cone. -/
theorem isSheaf_iff_isLimit :
    IsSheaf J P ↔
      ∀ ⦃X : C⦄ (S : Sieve X), S ∈ J X → Nonempty (IsLimit (P.mapCone S.arrows.cocone.op))

(J : CategoryTheory.GrothendieckTopology C)

CategoryTheory.Presheaf.IsSheaf J P ↔
  ∀ ⦃X : C⦄, ∀ S ∈ J.sieves X, Nonempty (CategoryTheory.Limits.IsLimit (P.mapCone S.arrows.cocone.op))


/-- The `ComplexShape` appropriate for homology, so `d : X i ⟶ X j` only when `i = j + 1`.
-/
@[simps!]
def down (α : Type*) [AddRightCancelSemigroup α] [One α] : ComplexShape α

(α : Type u_2)
[AddRightCancelSemigroup α]
[One α]
(i j : α)

(ComplexShape.down α).Rel i j = (j + 1 = i)


/-- The equivalence between a quaternion algebra over `R` and `R × R × R × R`. -/
@[simps]
def equivProd {R : Type*} (c₁ c₂ : R) : ℍ[R,c₁,c₂] ≃ R × R × R × R

{R : Type u_1}
(c₁ c₂ : R)
(a : R × R × R × R)

((QuaternionAlgebra.equivProd c₁ c₂).symm a).imI = a.2.1


theorem SurjOn.subset_range (h : SurjOn f s t) : t ⊆ range f

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


@[simp]
lemma stalkMap_id (X : Scheme.{u}) (x : X) :
    (𝟙 X : X ⟶ X).stalkMap x = 𝟙 (X.presheaf.stalk x)

(X : AlgebraicGeometry.Scheme)
(x : ↑↑X.toPresheafedSpace)

AlgebraicGeometry.Scheme.Hom.stalkMap (𝟙 X) x = 𝟙 (X.presheaf.stalk x)


theorem LocallyFinite.Realizer.to_locallyFinite [TopologicalSpace α] {F : Ctop.Realizer α}
    {f : β → Set α} (R : LocallyFinite.Realizer F f) : LocallyFinite f

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
{F : Ctop.Realizer α}
{f : β → Set α}
(R : LocallyFinite.Realizer F f)


lemma toEnd_eq (x : L) :
    toEnd R L (shiftedWeightSpace R L M χ) x =
    (shift R L M χ).conj (toEnd R L (weightSpace M χ) x - χ x • LinearMap.id)

(R : Type u_1)
(L : Type u_2)
(M : Type u_3)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
[LieAlgebra.IsNilpotent R L]
[LieModule.LinearWeights R L M]
(χ : L → R)
(x : L)

(LieModule.toEnd R L ↥↑(LieModule.shiftedWeightSpace R L M χ)) x =
  (LieModule.shiftedWeightSpace.shift R L M χ).conj
    ((LieModule.toEnd R L ↥↑(LieModule.weightSpace M χ)) x - χ x • LinearMap.id)


/-- As `0` is the default value for `Real.sInf` of the empty set, it suffices to show that `f i` is
bounded below by `0` to show that `0 ≤ iInf f`.
-/
theorem iInf_nonneg {ι} {f : ι → ℝ} (hf : ∀ i, 0 ≤ f i) : 0 ≤ iInf f

{ι : Sort u_1}
{f : ι → ℝ}
(hf : ∀ (i : ι), 0 ≤ f i)


/-- A functor is an equivalence of categories if it is faithful, full and
essentially surjective. -/
class Functor.IsEquivalence (F : C ⥤ D) : Prop where
  faithful : F.Faithful := by infer_instance
  full : F.Full := by infer_instance
  essSurj : F.EssSurj := by infer_instance

{C : Type u₁}
[CategoryTheory.Category.{v₁, u₁} C]
{D : Type u₂}
[CategoryTheory.Category.{v₂, u₂} D]
{F : CategoryTheory.Functor C D}
[self : F.IsEquivalence]


protected theorem succ : IsFundamentalSequence (succ o) 1 fun _ _ => o

(Order.succ o).IsFundamentalSequence 1 fun x x => o


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

{M : Type u_2}
{α : Type u_4}
[AddCommMonoid M]
[MeasurableSpace M]
[MeasurableAdd₂ M]
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(l : Multiset (α → M))
(hl : ∀ f ∈ l, AEMeasurable f μ)


theorem powersetCard_one (s : Finset α) :
    s.powersetCard 1 = s.map ⟨_, Finset.singleton_injective⟩

Finset.powersetCard 1 s = Finset.map { toFun := singleton, inj' := ⋯ } s


theorem card_of_mem_left {b : Board} {m : ℤ × ℤ} (h : m ∈ left b) : 2 ≤ Finset.card b

(h : m ∈ SetTheory.PGame.Domineering.left b)


@[simp]
theorem ofDual_sup' [SemilatticeInf α] {s : Finset ι} (hs : s.Nonempty) (f : ι → αᵒᵈ) :
    ofDual (s.sup' hs f) = s.inf' hs (ofDual ∘ f)

{α : Type u_2}
{ι : Type u_5}
[SemilatticeInf α]
{s : Finset ι}
(hs : s.Nonempty)
(f : ι → αᵒᵈ)

OrderDual.ofDual (s.sup' hs f) = s.inf' hs (⇑OrderDual.ofDual ∘ f)


/-- The opposite `ShortComplex` in `Cᵒᵖ` associated to a short complex in `C`. -/
@[simps]
def op : ShortComplex Cᵒᵖ


/-- x is an extreme point to A iff {x} is an extreme set of A. -/
@[simp] lemma isExtreme_singleton : IsExtreme 𝕜 A {x} ↔ x ∈ A.extremePoints 𝕜

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
{A : Set E}
{x : E}

IsExtreme 𝕜 A {x} ↔ x ∈ Set.extremePoints 𝕜 A


/-- If `f` and `g` are two torus integrable functions, then so is `f - g`. -/
protected nonrec theorem sub (hf : TorusIntegrable f c R) (hg : TorusIntegrable g c R) :
    TorusIntegrable (f - g) c R

{n : ℕ}
{E : Type u_1}
[NormedAddCommGroup E]
{f g : (Fin n → ℂ) → E}
{c : Fin n → ℂ}
{R : Fin n → ℝ}
(hf : TorusIntegrable f c R)
(hg : TorusIntegrable g c R)


@[simp]
theorem coe_toRealLinearIsometryEquivOfMapZero_symm (f : E ≃ᵢ F) (h0 : f 0 = 0) :
    ⇑(f.toRealLinearIsometryEquivOfMapZero h0).symm = f.symm

{E : Type u_1}
{F : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
[NormedAddCommGroup F]
[NormedSpace ℝ F]
(f : E ≃ᵢ F)
(h0 : f 0 = 0)

⇑(f.toRealLinearIsometryEquivOfMapZero h0).symm = ⇑f.symm


@[to_additive AddMonoid.exp_eq_one_iff]
theorem exp_eq_one_iff : exponent G = 1 ↔ Subsingleton G


@[simp]
theorem bind₁_xInTermsOfW_wittPolynomial [Invertible (p : R)] (k : ℕ) :
    bind₁ (xInTermsOfW p R) (W_ R k) = X k

(p : ℕ)
(R : Type u_1)
[CommRing R]
[Invertible ↑p]
(k : ℕ)

(MvPolynomial.bind₁ (xInTermsOfW p R)) (W_ R k) = MvPolynomial.X k


theorem IsRadical.comap (hK : K.IsRadical) : (comap f K).IsRadical

{R : Type u}
{S : Type v}
{F : Type u_1}
[CommRing R]
[CommRing S]
[FunLike F R S]
[rc : RingHomClass F R S]
(f : F)
{K : Ideal S}
(hK : K.IsRadical)


@[simp]
theorem inv_pow' (A : M) (n : ℕ) : A⁻¹ ^ n = (A ^ n)⁻¹

{n' : Type u_1}
[DecidableEq n']
[Fintype n']
{R : Type u_2}
[CommRing R]
(A : Matrix n' n' R)
(n : ℕ)


theorem left_inv : strInv h ≫ A.str = 𝟙 _

{A : CategoryTheory.Endofunctor.Algebra F}

CategoryTheory.CategoryStruct.comp (CategoryTheory.Endofunctor.Algebra.Initial.strInv h) A.str =
  CategoryTheory.CategoryStruct.id A.a


/-- The elliptic curve over `R` induced by an admissible linear change of variables
$(X, Y) \mapsto (u^2X + r, u^3Y + u^2sX + t)$ for some $u \in R^\times$ and some $r, s, t \in R$.
When `R` is a field, any two Weierstrass equations isomorphic to `E` are related by this. -/
@[simps (config := { rhsMd := .default }) a₁ a₂ a₃ a₄ a₆ Δ' toWeierstrassCurve]
def variableChange : EllipticCurve R

{R : Type u}
[CommRing R]
(E : EllipticCurve R)
(C : WeierstrassCurve.VariableChange R)

(E.variableChange C).a₂ = ↑C.u⁻¹ ^ 2 * (E.a₂ - C.s * E.a₁ + 3 * C.r - C.s ^ 2)


theorem Finite.encard_eq_coe_toFinset_card (h : s.Finite) : s.encard = h.toFinset.card

{α : Type u_1}
{s : Set α}
(h : s.Finite)


theorem ncard_exchange' {a b : α} (ha : a ∉ s) (hb : b ∈ s) :
    (insert a s \ {b}).ncard = s.ncard

{α : Type u_1}
{s : Set α}
{a b : α}
(ha : a ∉ s)
(hb : b ∈ s)


/-- Construct a natural isomorphism between functors by giving object level isomorphisms,
and checking naturality only in the forward direction.
-/
@[simps]
def ofComponents (app : ∀ X : C, F.obj X ≅ G.obj X)
    (naturality : ∀ {X Y : C} (f : X ⟶ Y),
      F.map f ≫ (app Y).hom = (app X).hom ≫ G.map f := by aesop_cat) :
    F ≅ G

(CategoryTheory.NatIso.ofComponents app naturality).inv.app X = (app X).inv


theorem integrable_rnDeriv (s : SignedMeasure α) (μ : Measure α) : Integrable (rnDeriv s μ) μ

{α : Type u_1}
{m : MeasurableSpace α}
(s : MeasureTheory.SignedMeasure α)
(μ : MeasureTheory.Measure α)

MeasureTheory.Integrable (s.rnDeriv μ) μ


/-- The obvious functor `(WidePushoutShape J)ᵒᵖ ⥤ WidePullbackShape J` -/
@[simps!]
def widePushoutShapeUnop : (WidePushoutShape J)ᵒᵖ ⥤ WidePullbackShape J

∀ {X Y : (CategoryTheory.Limits.WidePushoutShape J)ᵒᵖ} (f : X ⟶ Y),
  (CategoryTheory.Limits.widePushoutShapeUnop J).map f =
    (CategoryTheory.Limits.widePushoutShapeOpMap J (Opposite.unop Y) (Opposite.unop X) f.unop).unop


theorem floor_mono : Monotone (floor : α → ℕ)

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


@[simp] lemma comap_indep_iff : (N.comap f).Indep I ↔ N.Indep (f '' I) ∧ InjOn f I

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{I : Set α}
{N : Matroid β}

(N.comap f).Indep I ↔ N.Indep (f '' I) ∧ Set.InjOn f I


@[simp]
lemma isNone_eq_false_iff (a : Option α) : Option.isNone a = false ↔ Option.isSome a


theorem Monic.isUnit_leadingCoeff_of_dvd {a p : R[X]} (hp : Monic p) (hap : a ∣ p) :
    IsUnit a.leadingCoeff

{R : Type u}
[CommRing R]
[IsDomain R]
{a p : Polynomial R}
(hp : p.Monic)
(hap : a ∣ p)


theorem filterMap_filter (f : α → Option β) (s : Multiset α) :
    filterMap f (filter p s) = filterMap (fun x => if p x then f x else none) s

{α : Type u_1}
{β : Type v}
(p : α → Prop)
[DecidablePred p]
(f : α → Option β)
(s : Multiset α)

Multiset.filterMap f (Multiset.filter p s) = Multiset.filterMap (fun x => if p x then f x else none) s


@[to_additive]
theorem div_subset_div_right : s₁ ⊆ s₂ → s₁ / t ⊆ s₂ / t

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


theorem ediam_cthickening_le (ε : ℝ≥0) :
    EMetric.diam (cthickening ε s) ≤ EMetric.diam s + 2 * ε

{α : Type u}
[PseudoEMetricSpace α]
{s : Set α}
(ε : ℝ≥0)

EMetric.diam (Metric.cthickening (↑ε) s) ≤ EMetric.diam s + 2 * ↑ε


@[simp]
theorem modOf_apply_of_not_exists_add (x : k[G]) (g : G) (g' : G)
    (h : ¬∃ d, g' = g + d) : (x %ᵒᶠ g) g' = x g'

{k : Type u_1}
{G : Type u_2}
[Semiring k]
[AddCancelCommMonoid G]
(x : AddMonoidAlgebra k G)
(g g' : G)
(h : ¬∃ d, g' = g + d)


@[reassoc (attr := simp)]
lemma pullback.lift_snd {Z : Profinite.{u}} (a : Z ⟶ X) (b : Z ⟶ Y) (w : a ≫ f = b ≫ g) :
    pullback.lift f g a b w ≫ pullback.snd f g = b

(w : CategoryTheory.CategoryStruct.comp a f = CategoryTheory.CategoryStruct.comp b g)

CategoryTheory.CategoryStruct.comp (Profinite.pullback.lift f g a b w) (Profinite.pullback.snd f g) = b


theorem HasFiniteIntegral.smul_measure {f : α → β} (h : HasFiniteIntegral f μ) {c : ℝ≥0∞}
    (hc : c ≠ ∞) : HasFiniteIntegral f (c • μ)

(h : MeasureTheory.HasFiniteIntegral f μ)

MeasureTheory.HasFiniteIntegral f (c • μ)


@[to_additive] lemma prod_sdiff_le_prod_sdiff :
    ∏ i ∈ s \ t, f i ≤ ∏ i ∈ t \ s, f i ↔ ∏ i ∈ s, f i ≤ ∏ i ∈ t, f i

{ι : Type u_1}
{M : Type u_4}
[OrderedCancelAddCommMonoid M]
{f : ι → M}
{s t : Finset ι}
[DecidableEq ι]

∑ i ∈ s \ t, f i ≤ ∑ i ∈ t \ s, f i ↔ ∑ i ∈ s, f i ≤ ∑ i ∈ t, f i


/-- The inverse of a homotopy equivalence. -/
@[simps]
def symm (e : HomotopyEquiv S₁ S₂) : HomotopyEquiv S₂ S₁

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


@[simp]
theorem blsub_zero (f : ∀ a < (0 : Ordinal), Ordinal) : blsub 0 f = 0

(f : (a : Ordinal.{u_4}) → a < 0 → Ordinal.{max u_4 u_5})


protected theorem mul_zero (k : Fin (n + 1)) : k * 0 = 0


nonrec theorem integral_undef (h : ¬IntervalIntegrable f μ a b) : ∫ x in a..b, f x ∂μ = 0

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


@[simp, norm_cast]
theorem _root_.AffineSubspace.angle_coe {s : AffineSubspace ℝ P} (p₁ p₂ p₃ : s) :
    haveI : Nonempty s := ⟨p₁⟩
    ∠ (p₁ : P) (p₂ : P) (p₃ : P) = ∠ p₁ p₂ p₃

{V : Type u_1}
{P : Type u_2}
[NormedAddCommGroup V]
[InnerProductSpace ℝ V]
[MetricSpace P]
[NormedAddTorsor V P]
{s : AffineSubspace ℝ P}
(p₁ p₂ p₃ : ↥s)

EuclideanGeometry.angle ↑p₁ ↑p₂ ↑p₃ = EuclideanGeometry.angle p₁ p₂ p₃


@[simp]
lemma trace_baseChange [Module.Free R M] [Module.Finite R M]
    (f : M →ₗ[R] M) (A : Type*) [CommRing A] [Algebra R A] :
    trace A _ (f.baseChange A) = algebraMap R A (trace R _ f)

{R : Type u_1}
[CommRing R]
{M : Type u_2}
[AddCommGroup M]
[Module R M]
[Module.Free R M]
[Module.Finite R M]
(f : M →ₗ[R] M)
(A : Type u_6)
[CommRing A]
[Algebra R A]

(LinearMap.trace A (TensorProduct R A M)) (LinearMap.baseChange A f) = (algebraMap R A) ((LinearMap.trace R M) f)


@[to_additive] lemma oneLePart_eq_ite : a⁺ᵐ = if 1 ≤ a then a else 1

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


/-- If `f` is the pointwise limit of a bounded sequence in `lp E p`, then `f` is in `lp E p`. -/
theorem memℓp_of_tendsto {F : ι → lp E p} (hF : Bornology.IsBounded (Set.range F)) {f : ∀ a, E a}
    (hf : Tendsto (id fun i => F i : ι → ∀ a, E a) l (𝓝 f)) : Memℓp f p

(hf : Filter.Tendsto (id fun i => ↑(F i)) l (nhds f))


/-- Let `G` be a Type with multiplication.  `UniqueProds G` asserts that any two non-empty
finite subsets of `G` have the `UniqueMul` property, with respect to some element of their
product `A * B`. -/
class UniqueProds (G) [Mul G] : Prop where
/-- For `A B` two nonempty finite sets, there always exist `a0 ∈ A, b0 ∈ B` such that
`UniqueMul A B a0 b0` -/
  uniqueMul_of_nonempty :
    ∀ {A B : Finset G}, A.Nonempty → B.Nonempty → ∃ a0 ∈ A, ∃ b0 ∈ B, UniqueMul A B a0 b0

{G : Type u_1}
[Mul G]
[self : UniqueProds G]
{A B : Finset G}


@[simp]
theorem isNClique_zero : G.IsNClique 0 s ↔ s = ∅

{α : Type u_1}
{G : SimpleGraph α}
{s : Finset α}


theorem pi_univ_Ioc_subset [Nonempty ι]: (pi univ fun i ↦ Ioc (x i) (y i)) ⊆ Ioc x y

{ι : Type u_1}
{α : ι → Type u_2}
[(i : ι) → Preorder (α i)]
(x y : (i : ι) → α i)
[Nonempty ι]

(Set.univ.pi fun i => Set.Ioc (x i) (y i)) ⊆ Set.Ioc x y


@[simp]
theorem coe_unitGroupToResidueFieldUnits_apply (x : A.unitGroup) :
    (A.unitGroupToResidueFieldUnits x : LocalRing.ResidueField A) =
      Ideal.Quotient.mk _ (A.unitGroupMulEquiv x : A)

{K : Type u}
[Field K]
(A : ValuationSubring K)
(x : ↥A.unitGroup)

↑(A.unitGroupToResidueFieldUnits x) = (Ideal.Quotient.mk (LocalRing.maximalIdeal ↥A)) ↑(A.unitGroupMulEquiv x)


theorem num_mem_deg (f : HomogeneousLocalization 𝒜 x) : f.num ∈ 𝒜 f.deg

{ι : Type u_1}
{R : Type u_2}
{A : Type u_3}
[CommRing R]
[CommRing A]
[Algebra R A]
{𝒜 : ι → Submodule R A}
{x : Submonoid A}
(f : HomogeneousLocalization 𝒜 x)


@[simp] lemma inclusion_rfl (L : Sublattice α) : inclusion le_rfl = LatticeHom.id L

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

Sublattice.inclusion ⋯ = LatticeHom.id ↥L


theorem generator_map_dvd_of_mem {N : Submodule R M} (ϕ : M →ₗ[R] R) [(N.map ϕ).IsPrincipal] {x : M}
    (hx : x ∈ N) : generator (N.map ϕ) ∣ ϕ x

{R : Type u}
{M : Type v}
[AddCommGroup M]
[CommRing R]
[Module R M]
{N : Submodule R M}
(ϕ : M →ₗ[R] R)
[(Submodule.map ϕ N).IsPrincipal]
{x : M}
(hx : x ∈ N)

Submodule.IsPrincipal.generator (Submodule.map ϕ N) ∣ ϕ x


theorem toIcoMod_eq_add_fract_mul (a b : α) :
    toIcoMod hp a b = a + Int.fract ((b - a) / p) * p

{α : Type u_1}
[LinearOrderedField α]
[FloorRing α]
{p : α}
(hp : 0 < p)
(a b : α)


@[to_additive (attr := simp)]
theorem mul_div_mul_left_eq_div (a b c : G) : c * a / (c * b) = a / b

{G : Type u_3}
[CommGroup G]
(a b c : G)


theorem unop_closure (s : Set Rᵐᵒᵖ) : (closure s).unop = closure (MulOpposite.op ⁻¹' s)

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


/-- See also `Finset.prodMk_sup'_sup'`. -/
-- @[simp] -- TODO: Why does `Prod.map_apply` simplify the LHS?
lemma sup'_prodMap (hst : (s ×ˢ t).Nonempty) (f : ι → α) (g : κ → β) :
    sup' (s ×ˢ t) hst (Prod.map f g) = (sup' s hst.fst f, sup' t hst.snd g)

{ι : Type u_7}
{κ : Type u_8}
{α : Type u_9}
{β : Type u_10}
[SemilatticeSup α]
[SemilatticeSup β]
{s : Finset ι}
{t : Finset κ}
(hst : (s ×ˢ t).Nonempty)
(f : ι → α)
(g : κ → β)

(s ×ˢ t).sup' hst (Prod.map f g) = (s.sup' ⋯ f, t.sup' ⋯ g)


protected theorem div_eq_of_eq_mul_right (H1 : 0 < n) (H2 : m = n * k) : m / n = k


protected theorem dvd_zero (a : Nat) : a ∣ 0


@[simp]
theorem tensorUnit_v : (𝟙_ (Action V G)).V = 𝟙_ V

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


/-- Two coproducts which differ by an equivalence in the indexing type,
and up to isomorphism in the factors, are isomorphic.
-/
@[simps]
def Sigma.whiskerEquiv {J K : Type*} {f : J → C} {g : K → C} (e : J ≃ K) (w : ∀ j, g (e j) ≅ f j)
    [HasCoproduct f] [HasCoproduct g] : ∐ f ≅ ∐ g

{C : Type u}
[CategoryTheory.Category.{v, u} C]
{J : Type u_1}
{K : Type u_2}
{f : J → C}
{g : K → C}
(e : J ≃ K)
(w : (j : J) → g (e j) ≅ f j)
[CategoryTheory.Limits.HasCoproduct f]
[CategoryTheory.Limits.HasCoproduct g]

(CategoryTheory.Limits.Sigma.whiskerEquiv e w).hom = CategoryTheory.Limits.Sigma.map' ⇑e fun j => (w j).inv


@[simp]
theorem val_cons (s : Seq α) (x : α) : (cons x s).val = some x::s.val

{α : Type u}
(s : Stream'.Seq α)
(x : α)

↑(Stream'.Seq.cons x s) = Stream'.cons (some x) ↑s


/-- The opposite isomorphism.
-/
@[simps]
protected def op (α : X ≅ Y) : op Y ≅ op X

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


theorem HasCountableBasis.isCountablyGenerated {f : Filter α} {p : ι → Prop} {s : ι → Set α}
    (h : f.HasCountableBasis p s) : f.IsCountablyGenerated

{α : Type u_1}
{ι : Type u_4}
{f : Filter α}
{p : ι → Prop}
{s : ι → Set α}
(h : f.HasCountableBasis p s)


theorem Sbtw.trans_left_right {w x y z : P} (h₁ : Sbtw R w y z) (h₂ : Sbtw R w x y) :
    Sbtw R x y z

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


/-- The exponential in a Banach algebra `𝔸` over `𝕂 = ℝ` or `𝕂 = ℂ` has strict Fréchet derivative
`1 : 𝔸 →L[𝕂] 𝔸` at zero. -/
theorem hasStrictFDerivAt_exp_zero : HasStrictFDerivAt (exp 𝕂) (1 : 𝔸 →L[𝕂] 𝔸) 0

{𝕂 : Type u_1}
{𝔸 : Type u_2}
[RCLike 𝕂]
[NormedRing 𝔸]
[NormedAlgebra 𝕂 𝔸]
[CompleteSpace 𝔸]

HasStrictFDerivAt (NormedSpace.exp 𝕂) 1 0


theorem coeff_one [DecidableEq σ] (m) : coeff m (1 : MvPolynomial σ R) = if 0 = m then 1 else 0

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
[DecidableEq σ]
(m : σ →₀ ℕ)

MvPolynomial.coeff m 1 = if 0 = m then 1 else 0


theorem partDen_eq_s_b {gp : Pair α} (s_nth_eq : g.s.get? n = some gp) :
    g.partDens.get? n = some gp.b

{α : Type u_1}
{g : GenContFract α}
{n : ℕ}
{gp : GenContFract.Pair α}
(s_nth_eq : g.s.get? n = some gp)


@[ext]
theorem ext (h : ∀ x, f x = g x) : f = g

{α : Type u}
{β : Type v}
[TopologicalSpace α]
[PseudoMetricSpace β]
{f g : BoundedContinuousFunction α β}
(h : ∀ (x : α), f x = g x)


@[simp, norm_cast]
theorem coe_refl : ↑(ContinuousLinearEquiv.refl R₁ M₁) = ContinuousLinearMap.id R₁ M₁

{R₁ : Type u_1}
[Semiring R₁]
{M₁ : Type u_4}
[TopologicalSpace M₁]
[AddCommMonoid M₁]
[Module R₁ M₁]


@[simp]
theorem self_sub_floor (a : α) : a - ⌊a⌋ = fract a

{α : Type u_2}
[LinearOrderedRing α]
[FloorRing α]
(a : α)


@[to_additive]
lemma IsMulFreimanHom.inv (hf : IsMulFreimanHom n A B f) : IsMulFreimanHom n A B⁻¹ f⁻¹

{α : Type u_2}
{β : Type u_3}
[AddCommMonoid α]
[SubtractionCommMonoid β]
{A : Set α}
{B : Set β}
{f : α → β}
{n : ℕ}
(hf : IsAddFreimanHom n A B f)


theorem gc_map_comap : GaloisConnection (map f) (comap f)

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

GaloisConnection (LieSubmodule.map f) (LieSubmodule.comap f)


theorem IsBigOWith.exists_eq_mul (h : IsBigOWith c l u v) (hc : 0 ≤ c) :
    ∃ φ : α → 𝕜, (∀ᶠ x in l, ‖φ x‖ ≤ c) ∧ u =ᶠ[l] φ * v

{α : Type u_1}
{𝕜 : Type u_15}
[NormedDivisionRing 𝕜]
{c : ℝ}
{l : Filter α}
{u v : α → 𝕜}
(h : Asymptotics.IsBigOWith c l u v)
(hc : 0 ≤ c)

∃ φ, (∀ᶠ (x : α) in l, ‖φ x‖ ≤ c) ∧ u =ᶠ[l] φ * v


theorem withDensityᵥ_sub' (hf : Integrable f μ) (hg : Integrable g μ) :
    (μ.withDensityᵥ fun x => f x - g x) = μ.withDensityᵥ f - μ.withDensityᵥ g

{α : Type u_1}
{m : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
{E : Type u_3}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f g : α → E}
(hf : MeasureTheory.Integrable f μ)
(hg : MeasureTheory.Integrable g μ)


lemma equivalence_isCohomologous :
    _root_.Equivalence (IsCohomologous (G := G) (U := U))

{C : Type u}
[CategoryTheory.Category.{v, u} C]
(G : CategoryTheory.Functor Cᵒᵖ Grp)
{I : Type w'}
(U : I → C)


/-- Given a monoid homomorphism `g : M →* N` and a function `f : α → M`, the value of `g` at the
product of `f i` over `i ∈ s` equals the product of `g (f i)` over `s`. -/
@[to_additive
      "Given an additive monoid homomorphism `g : M →* N` and a function `f : α → M`, the
      value of `g` at the sum of `f i` over `i ∈ s` equals the sum of `g (f i)` over `s`."]
theorem MonoidHom.map_finprod_mem (f : α → M) (g : M →* N) (hs : s.Finite) :
    g (∏ᶠ j ∈ s, f j) = ∏ᶠ i ∈ s, g (f i)

{α : Type u_1}
{M : Type u_5}
{N : Type u_6}
[CommMonoid M]
[CommMonoid N]
{s : Set α}
(f : α → M)
(g : M →* N)
(hs : s.Finite)


lemma compactSpace {R S A : Type*} [Semifield R] [Semifield S] [Ring A]
    [Algebra R S] [Algebra R A] [Algebra S A] [IsScalarTower R S A] [TopologicalSpace R]
    [TopologicalSpace S] {a : A} (f : C(S, R)) (h : SpectrumRestricts a f)
    [h_cpct : CompactSpace (spectrum S a)] : CompactSpace (spectrum R a)

{R : Type u_1}
{S : Type u_2}
{A : Type u_3}
[Semifield R]
[Semifield S]
[Ring A]
[Algebra R S]
[Algebra R A]
[Algebra S A]
[IsScalarTower R S A]
[TopologicalSpace R]
[TopologicalSpace S]
{a : A}
(f : C(S, R))
(h : SpectrumRestricts a ⇑f)
[h_cpct : CompactSpace ↑(spectrum S a)]


/-- 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`, we have `f n x = F x` on the product of an infinite
interval `[N, +∞)` and a neighbourhood of `x`.

We formulate the conclusion in terms of the product of filter `Filter.atTop` and `𝓝 x`. -/
theorem exists_forall_eventually_eq_prod {π : X → Sort*} {f : ℕ → ∀ x : X, π x}
    (hf : LocallyFinite fun n => { x | f (n + 1) x ≠ f n x }) :
    ∃ F : ∀ x : X, π x, ∀ x, ∀ᶠ p : ℕ × X in atTop ×ˢ 𝓝 x, f p.1 p.2 = F p.2

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

∃ F, ∀ (x : X), ∀ᶠ (p : ℕ × X) in Filter.atTop ×ˢ 𝓝 x, f p.1 p.2 = F p.2


/-- **Phragmen-Lindelöf principle** in a strip `U = {z : ℂ | a < im z < b}`.
Let `f : ℂ → E` be a function such that

* `f` is differentiable on `U` and is continuous on its closure;
* `‖f z‖` is bounded from above by `A * exp(B * exp(c * |re z|))` on `U` for some `c < π / (b - a)`;
* `f z = 0` on the boundary of `U`.

Then `f` is equal to zero on the closed strip `{z : ℂ | a ≤ im z ≤ b}`.
-/
theorem eq_zero_on_horizontal_strip (hd : DiffContOnCl ℂ f (im ⁻¹' Ioo a b))
    (hB : ∃ c < π / (b - a), ∃ B, f =O[comap (_root_.abs ∘ re) atTop ⊓ 𝓟 (im ⁻¹' Ioo a b)]
      fun z ↦ expR (B * expR (c * |z.re|)))
    (ha : ∀ z : ℂ, z.im = a → f z = 0) (hb : ∀ z : ℂ, z.im = b → f z = 0) :
    EqOn f 0 (im ⁻¹' Icc a b)

(hd : DiffContOnCl ℂ f (Complex.im ⁻¹' Set.Ioo a b))

(hB :
  ∃ c < π / (b - a),
    ∃ B,
      f =O[Filter.comap (abs ∘ Complex.re) Filter.atTop ⊓ 𝓟 (Complex.im ⁻¹' Set.Ioo a b)] fun z =>
        expR (B * expR (c * |z.re|)))

Set.EqOn f 0 (Complex.im ⁻¹' Set.Icc a b)


/-- The currying process is a continuous map between function spaces. -/
theorem continuous_curry [LocallyCompactSpace (X × Y)] :
    Continuous (curry : C(X × Y, Z) → C(X, C(Y, Z)))

{X : Type u_2}
{Y : Type u_3}
{Z : Type u_4}
[TopologicalSpace X]
[TopologicalSpace Y]
[TopologicalSpace Z]
[LocallyCompactSpace (X × Y)]


/-- Multiplying by some of the matrices in `listTransvecCol M` does not change the last row. -/
theorem listTransvecCol_mul_last_row_drop (i : Fin r ⊕ Unit) {k : ℕ} (hk : k ≤ r) :
    (((listTransvecCol M).drop k).prod * M) (inr unit) i = M (inr unit) i

(M : Matrix (Fin r ⊕ Unit) (Fin r ⊕ Unit) 𝕜)

((List.drop k (Matrix.Pivot.listTransvecCol M)).prod * M) (Sum.inr ()) i = M (Sum.inr ()) i


theorem natDegree_le_natDegree [Semiring S] {q : S[X]} (hpq : p.degree ≤ q.degree) :
    p.natDegree ≤ q.natDegree

{R : Type u}
{S : Type v}
[Semiring R]
{p : R[X]}
[Semiring S]
{q : S[X]}
(hpq : p.degree ≤ q.degree)


/-- An alternative version of `Units.exists0`. This one is useful if Lean cannot
figure out `p` when using `Units.exists0` from right to left. -/
theorem exists0' {p : ∀ g : G₀, g ≠ 0 → Prop} :
    (∃ (g : G₀) (hg : g ≠ 0), p g hg) ↔ ∃ g : G₀ˣ, p g g.ne_zero

{G₀ : Type u_3}
[GroupWithZero G₀]
{p : (g : G₀) → g ≠ 0 → Prop}


@[simp]
theorem quotQuotEquivComm_symm : (quotQuotEquivComm I J).symm = quotQuotEquivComm J I

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

(DoubleQuot.quotQuotEquivComm I J).symm = DoubleQuot.quotQuotEquivComm J I


@[simp]
theorem essSup_measure_zero {m : MeasurableSpace α} {f : α → β} : essSup f (0 : Measure α) = ⊥

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


@[to_additive (attr := simp)]
theorem mulEquivOfQuotient_apply (x) : mulEquivOfQuotient f x = (monoidOf S).lift f.map_units x

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
{f : S.LocalizationMap N}
(x : AddLocalization S)

(AddLocalization.addEquivOfQuotient f) x = ((AddLocalization.addMonoidOf S).lift ⋯) x


protected theorem perm_zpow (h : IsFixedPt e x) : ∀ n : ℤ, IsFixedPt (⇑(e ^ n)) x

{α : Type u}
{x : α}
{e : Equiv.Perm α}
(h : Function.IsFixedPt (⇑e) x)
(n : ℤ)


/-- If `p` is a prime and `a` is an integer, then `a : ZMod p` is zero if and only if
`gcd a p ≠ 1`. -/
theorem eq_zero_iff_gcd_ne_one {a : ℤ} {p : ℕ} [pp : Fact p.Prime] :
    (a : ZMod p) = 0 ↔ a.gcd p ≠ 1

{a : ℤ}
{p : ℕ}
[pp : Fact (Nat.Prime p)]


theorem nat_iff {f : α → β → σ} : Primrec₂ f ↔ Nat.Primrec
    (.unpaired fun m n => encode <| (@decode α _ m).bind fun a => (@decode β _ n).map (f a))

{α : Type u_1}
{β : Type u_2}
{σ : Type u_3}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
{f : α → β → σ}

Primrec₂ f ↔
  Nat.Primrec
    (Nat.unpaired fun m n =>
      Encodable.encode ((Encodable.decode m).bind fun a => Option.map (f a) (Encodable.decode n)))


@[to_additive]
theorem not_step_singleton : ∀ {p : α × Bool}, ¬Step [p] L

{α : Type u}
{L : List (α × Bool)}
{p : α × Bool}


/-- A language homomorphism is injective when all the maps between symbol types are. -/
protected structure Injective : Prop where
  onFunction {n} : Function.Injective fun f : L.Functions n => onFunction ϕ f
  onRelation {n} : Function.Injective fun R : L.Relations n => onRelation ϕ R

{L : FirstOrder.Language}
{L' : FirstOrder.Language}
{ϕ : L →ᴸ L'}
(self : ϕ.Injective)
{n : ℕ}

Function.Injective fun f => ϕ.onFunction f


@[simp]
theorem evalₐ_mkₐ (n : ℕ) (x : AdicCauchySequence I R) :
    evalₐ I n (mkₐ I x) = Ideal.Quotient.mk (I ^ n) (x.val n)

(x : AdicCompletion.AdicCauchySequence I R)

(AdicCompletion.evalₐ I n) ((AdicCompletion.mkₐ I) x) = (Ideal.Quotient.mk (I ^ n)) (↑x n)


theorem principal_add_aleph (o : Ordinal) : Ordinal.Principal (· + ·) (aleph o).ord

Ordinal.Principal (fun x x_1 => x + x_1) (Cardinal.aleph o).ord


@[norm_cast, simp]
theorem coe_comp (f : L₂ →ₗ⁅R⁆ L₃) (g : L₁ →ₗ⁅R⁆ L₂) : (f.comp g : L₁ → L₃) = f ∘ g

{R : Type u}
{L₁ : Type v}
{L₂ : Type w}
{L₃ : Type w₁}
[CommRing R]
[LieRing L₁]
[LieAlgebra R L₁]
[LieRing L₂]
[LieAlgebra R L₂]
[LieRing L₃]
[LieAlgebra R L₃]
(f : L₂ →ₗ⁅R⁆ L₃)
(g : L₁ →ₗ⁅R⁆ L₂)


@[ext]
lemma mapBifunctorMapObj_ext {X : GradedObject I C₁} {Y : GradedObject J C₂} {A : C₃} {k : K}
    [HasMap (((mapBifunctor F I J).obj X).obj Y) p]
    {f g : mapBifunctorMapObj F p X Y k ⟶ A}
    (h : ∀ (i : I) (j : J) (hij : p ⟨i, j⟩ = k),
      ιMapBifunctorMapObj F p X Y i j k hij ≫ f = ιMapBifunctorMapObj F p X Y i j k hij ≫ g) :
    f = g

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

[(((CategoryTheory.GradedObject.mapBifunctor F I J).obj X).obj Y).HasMap p]

{f g : CategoryTheory.GradedObject.mapBifunctorMapObj F p X Y k ⟶ A}

(h :
  ∀ (i : I) (j : J) (hij : p (i, j) = k),
    CategoryTheory.CategoryStruct.comp (CategoryTheory.GradedObject.ιMapBifunctorMapObj F p X Y i j k hij) f =
      CategoryTheory.CategoryStruct.comp (CategoryTheory.GradedObject.ιMapBifunctorMapObj F p X Y i j k hij) g)


/-- If `S`, `Q` are localizations of `R` at the submonoid `M` respectively,
there is an isomorphism of localizations `S ≃ₐ[R] Q`. -/
@[simps!]
noncomputable def algEquiv : S ≃ₐ[R] Q

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

(IsLocalization.algEquiv M S Q) a = (IsLocalization.map Q (RingHom.id R) ⋯) a


@[simp] theorem dite_eq_right_iff {P : Prop} [Decidable P] {A : P → α} :
    (dite P A fun _ => b) = b ↔ ∀ h, A h = b

{α : Sort u_1}
{b : α}
{P : Prop}
[Decidable P]
{A : P → α}

(dite P A fun x => b) = b ↔ ∀ (h : P), A h = b


/-- The image of a compact set under a homeomorphism can also be expressed as a preimage. -/
theorem coe_equiv_apply_eq_preimage (f : α ≃ₜ β) (K : Compacts α) :
    (Compacts.equiv f K : Set β) = f.symm ⁻¹' (K : Set α)

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
(f : α ≃ₜ β)
(K : TopologicalSpace.Compacts α)

↑((TopologicalSpace.Compacts.equiv f) K) = ⇑f.symm ⁻¹' ↑K


theorem IsHermitian.fromBlocks₁₁ [Fintype m] [DecidableEq m] {A : Matrix m m 𝕜} (B : Matrix m n 𝕜)
    (D : Matrix n n 𝕜) (hA : A.IsHermitian) :
    (Matrix.fromBlocks A B Bᴴ D).IsHermitian ↔ (D - Bᴴ * A⁻¹ * B).IsHermitian

{m : Type u_2}
{n : Type u_3}
{𝕜 : Type u_5}
[CommRing 𝕜]
[StarRing 𝕜]
[Fintype m]
[DecidableEq m]
{A : Matrix m m 𝕜}
(B : Matrix m n 𝕜)
(D : Matrix n n 𝕜)
(hA : A.IsHermitian)

(Matrix.fromBlocks A B B.conjTranspose D).IsHermitian ↔ (D - B.conjTranspose * A⁻¹ * B).IsHermitian


theorem nonpos_iff_eq_zero' : μ ≤ 0 ↔ μ = 0

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

μ ≤ 0 ↔ μ = 0


theorem negSucc_coe (n : Nat) : -[n+1] = -↑(n + 1)


/-- If the singleton `{x}` has non-zero mass for `ρ.fst`, then for all `s : Set Ω`,
`ρCond x s = (ρ.fst {x})⁻¹ * ρ ({x} ×ˢ s)` . -/
lemma IsCondKernel.apply_of_ne_zero [MeasurableSingletonClass α] {x : α}
    (hx : ρ.fst {x} ≠ 0) (s : Set Ω) : ρCond x s = (ρ.fst {x})⁻¹ * ρ ({x} ×ˢ s)

{α : Type u_1}
{Ω : Type u_3}
{mα : MeasurableSpace α}
{mΩ : MeasurableSpace Ω}
(ρ : MeasureTheory.Measure (α × Ω))
[MeasureTheory.IsFiniteMeasure ρ]
(ρCond : ProbabilityTheory.Kernel α Ω)
[ρ.IsCondKernel ρCond]
[MeasurableSingletonClass α]
{x : α}
(hx : ρ.fst {x} ≠ 0)
(s : Set Ω)

(ρCond x) s = (ρ.fst {x})⁻¹ * ρ ({x} ×ˢ s)


theorem sumLift₂_nonempty :
    (sumLift₂ f g a b).Nonempty ↔
      (∃ a₁ b₁, a = inl a₁ ∧ b = inl b₁ ∧ (f a₁ b₁).Nonempty) ∨
        ∃ a₂ b₂, a = inr a₂ ∧ b = inr b₂ ∧ (g a₂ b₂).Nonempty

{α₁ : Type u_1}
{α₂ : Type u_2}
{β₁ : Type u_3}
{β₂ : Type u_4}
{γ₁ : Type u_5}
{γ₂ : Type u_6}
{f : α₁ → β₁ → Finset γ₁}
{g : α₂ → β₂ → Finset γ₂}
{a : α₁ ⊕ α₂}
{b : β₁ ⊕ β₂}

(Finset.sumLift₂ f g a b).Nonempty ↔
  (∃ a₁ b₁, a = Sum.inl a₁ ∧ b = Sum.inl b₁ ∧ (f a₁ b₁).Nonempty) ∨
    ∃ a₂ b₂, a = Sum.inr a₂ ∧ b = Sum.inr b₂ ∧ (g a₂ b₂).Nonempty


@[simp]
theorem self_eq_neg_iff (a : SignType) : a = -a ↔ a = 0


/-- **Schur's lemma** for endomorphisms in `𝕜`-linear categories.
-/
theorem finrank_endomorphism_simple_eq_one (X : C) [Simple X] [FiniteDimensional 𝕜 (X ⟶ X)] :
    finrank 𝕜 (X ⟶ X) = 1

{C : Type u_1}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Preadditive C]
(𝕜 : Type u_2)
[Field 𝕜]
[IsAlgClosed 𝕜]
[CategoryTheory.Linear 𝕜 C]
[CategoryTheory.Limits.HasKernels C]
(X : C)
[CategoryTheory.Simple X]
[FiniteDimensional 𝕜 (X ⟶ X)]


/-- Alternative definition of set convexity, in terms of pointwise set operations. -/
theorem convex_iff_pointwise_add_subset :
    Convex 𝕜 s ↔ ∀ ⦃a b : 𝕜⦄, 0 ≤ a → 0 ≤ b → a + b = 1 → a • s + b • s ⊆ s

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[SMul 𝕜 E]
{s : Set E}


theorem div_lt_self {n k : Nat} (hLtN : 0 < n) (hLtK : 1 < k) : n / k < n


@[simp]
protected theorem compl_sInf (S : Set (UpperSet α)) : (sInf S).compl = ⨅ s ∈ S, UpperSet.compl s

{α : Type u_1}
[LE α]
(S : Set (UpperSet α))


@[simp] protected theorem ediv_self {a : Int} (H : a ≠ 0) : a / a = 1


protected theorem range (f : M →ₗ[R] N) : IsSemisimpleModule R (range f)

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

IsSemisimpleModule R ↥(LinearMap.range f)


theorem lt_def [LT ι] [∀ i, LT (α i)] {a b : Σₗ i, α i} :
    a < b ↔ a.1 < b.1 ∨ ∃ h : a.1 = b.1, h.rec a.2 < b.2

{ι : Type u_1}
{α : ι → Type u_2}
[LT ι]
[(i : ι) → LT (α i)]
{a b : Σₗ (i : ι), α i}

a < b ↔ a.fst < b.fst ∨ ∃ h, h ▸ a.snd < b.snd


theorem dite_prop_iff_or {Q : P → Prop} {R : ¬P → Prop} [Decidable P] :
    dite P Q R ↔ (∃ p, Q p) ∨ (∃ p, R p)

{P : Prop}
{Q : P → Prop}
{R : ¬P → Prop}
[Decidable P]


theorem fderivWithin_pi (h : ∀ i, DifferentiableWithinAt 𝕜 (φ i) s x)
    (hs : UniqueDiffWithinAt 𝕜 s x) :
    fderivWithin 𝕜 (fun x i => φ i x) s x = pi fun i => fderivWithin 𝕜 (φ i) s x

(h : ∀ (i : ι), DifferentiableWithinAt 𝕜 (φ i) s x)

fderivWithin 𝕜 (fun x i => φ i x) s x = ContinuousLinearMap.pi fun i => fderivWithin 𝕜 (φ i) s x


@[simp] theorem contains_cons [BEq α] :
    (a :: as : List α).contains x = (x == a || as.contains x)

{α : Type u_1}
{a : α}
{as : List α}
{x : α}
[BEq α]

(a :: as).contains x = (x == a || as.contains x)


theorem Memℒp.eLpNorm_mk_lt_top {α E : Type*} [MeasurableSpace α] {μ : Measure α}
    [NormedAddCommGroup E] {p : ℝ≥0∞} {f : α → E} (hfp : Memℒp f p μ) :
    eLpNorm (AEEqFun.mk f hfp.1) p μ < ∞

{α : Type u_5}
{E : Type u_6}
[MeasurableSpace α]
{μ : MeasureTheory.Measure α}
[NormedAddCommGroup E]
{p : ℝ≥0∞}
{f : α → E}
(hfp : MeasureTheory.Memℒp f p μ)

MeasureTheory.eLpNorm (↑(MeasureTheory.AEEqFun.mk f ⋯)) p μ < ⊤


theorem norm_def (x : Unitization 𝕜 A) : ‖x‖ = ‖splitMul 𝕜 A x‖

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


lemma rnDeriv_eq_top_iff (κ η : Kernel α γ) (a : α) (x : γ) :
    rnDeriv κ η a x = ∞ ↔ (a, x) ∈ mutuallySingularSet κ η

[hαγ : MeasurableSpace.CountableOrCountablyGenerated α γ]

κ.rnDeriv η a x = ⊤ ↔ (a, x) ∈ κ.mutuallySingularSet η


theorem arg_neg_eq_arg_add_pi_of_im_neg {x : ℂ} (hi : x.im < 0) : arg (-x) = arg x + π


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

{β : Type u_2}
[AddCommMonoid β]
(f : Fin 7 → β)


@[simp, norm_cast]
theorem coe_lt_coe (n k : ℕ+) : (n : ℕ) < k ↔ n < k


theorem himp_le_himp (hab : a ≤ b) (hcd : c ≤ d) : b ⇨ c ≤ a ⇨ d

{α : Type u_2}
[GeneralizedHeytingAlgebra α]
{a b c d : α}
(hab : a ≤ b)
(hcd : c ≤ d)


@[simp]
theorem fromEdgeSet_union (s t : Set (Sym2 V)) :
    fromEdgeSet (s ∪ t) = fromEdgeSet s ⊔ fromEdgeSet t

SimpleGraph.fromEdgeSet (s ∪ t) = SimpleGraph.fromEdgeSet s ⊔ SimpleGraph.fromEdgeSet t


theorem exists_cons_of_mem {s : Sym α (n + 1)} {a : α} (h : a ∈ s) : ∃ t, s = a ::ₛ t


theorem adjunction_homEquiv_apply {X : Scheme} {R : CommRingCatᵒᵖ}
    (f : (op <| Scheme.Γ.obj <| op X) ⟶ R) :
    ΓSpec.adjunction.homEquiv X R f = locallyRingedSpaceAdjunction.homEquiv X.1 R f

(f : Opposite.op (AlgebraicGeometry.Scheme.Γ.obj (Opposite.op X)) ⟶ R)

(AlgebraicGeometry.ΓSpec.adjunction.homEquiv X R) f =
  (AlgebraicGeometry.ΓSpec.locallyRingedSpaceAdjunction.homEquiv X.toLocallyRingedSpace R) f


/-- This lemma has an abbreviated name because it is used frequently. -/
theorem cancel_of_lt' {a b : ℝ≥0∞} (h : a < b) : AddLECancellable a


theorem algebraMap_end_eq_smul_id (a : R) : algebraMap R (End S M) a = a • LinearMap.id

(R : Type u)
(S : Type v)
(M : Type w)
[CommSemiring R]
[Semiring S]
[AddCommMonoid M]
[Module R M]
[Module S M]
[SMulCommClass S R M]
[SMul R S]
[IsScalarTower R S M]
(a : R)

(algebraMap R (Module.End S M)) a = a • LinearMap.id


lemma toSpec_base_isIso {f} {m} (f_deg : f ∈ 𝒜 m) (hm : 0 < m) :
    IsIso (toSpec 𝒜 f).1.base

{R : Type u_1}
{A : Type u_2}
[CommRing R]
[CommRing A]
[Algebra R A]
(𝒜 : ℕ → Submodule R A)
[GradedAlgebra 𝒜]
{f : A}
{m : ℕ}
(f_deg : f ∈ 𝒜 m)
(hm : 0 < m)

CategoryTheory.IsIso (AlgebraicGeometry.ProjectiveSpectrum.Proj.toSpec 𝒜 f).val.base


theorem IsSymm.exp {A : Matrix m m 𝔸} (h : A.IsSymm) : (exp 𝕂 A).IsSymm

(𝕂 : Type u_1)
{m : Type u_2}
{𝔸 : Type u_6}
[Fintype m]
[DecidableEq m]
[Field 𝕂]
[CommRing 𝔸]
[TopologicalSpace 𝔸]
[TopologicalRing 𝔸]
[Algebra 𝕂 𝔸]
[T2Space 𝔸]
{A : Matrix m m 𝔸}
(h : A.IsSymm)


/-- A star algebra homomorphism of complex C⋆-algebras is norm contractive. -/
theorem norm_apply_le (a : A) : ‖(φ a : B)‖ ≤ ‖a‖

{F : Type u_1}
{A : Type u_2}
{B : Type u_3}
[NormedRing A]
[NormedAlgebra ℂ A]
[CompleteSpace A]
[StarRing A]
[CstarRing A]
[NormedRing B]
[NormedAlgebra ℂ B]
[CompleteSpace B]
[StarRing B]
[CstarRing B]
[FunLike F A B]
[AlgHomClass F ℂ A B]
[StarAlgHomClass F ℂ A B]
(φ : F)
(a : A)


theorem HasStrictFDerivAt.clog {f : E → ℂ} {f' : E →L[ℂ] ℂ} {x : E} (h₁ : HasStrictFDerivAt f f' x)
    (h₂ : f x ∈ slitPlane) : HasStrictFDerivAt (fun t => log (f t)) ((f x)⁻¹ • f') x

{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace ℂ E]
{f : E → ℂ}
{f' : E →L[ℂ] ℂ}
{x : E}
(h₁ : HasStrictFDerivAt f f' x)
(h₂ : f x ∈ Complex.slitPlane)

HasStrictFDerivAt (fun t => Complex.log (f t)) ((f x)⁻¹ • f') x


@[measurability, fun_prop]
theorem AEMeasurable.ennnorm {f : β → α} {μ : Measure β} (hf : AEMeasurable f μ) :
    AEMeasurable (fun a => (‖f a‖₊ : ℝ≥0∞)) μ

{α : Type u_1}
{β : Type u_2}
[MeasurableSpace α]
[NormedAddCommGroup α]
[OpensMeasurableSpace α]
[MeasurableSpace β]
{f : β → α}
{μ : MeasureTheory.Measure β}
(hf : AEMeasurable f μ)


@[continuity]
theorem Continuous.matrix_updateColumn [DecidableEq n] (i : n) {A : X → Matrix m n R}
    {B : X → m → R} (hA : Continuous A) (hB : Continuous B) :
    Continuous fun x => (A x).updateColumn i (B x)

{X : Type u_1}
{m : Type u_4}
{n : Type u_5}
{R : Type u_8}
[TopologicalSpace X]
[TopologicalSpace R]
[DecidableEq n]
(i : n)
{A : X → Matrix m n R}
{B : X → m → R}
(hA : Continuous A)
(hB : Continuous B)


lemma evenKernel_def (a x : ℝ) :
    ↑(evenKernel ↑a x) = cexp (-π * a ^ 2 * x) * jacobiTheta₂ (a * I * x) (I * x)

↑(HurwitzZeta.evenKernel (↑a) x) = cexp (-↑π * ↑a ^ 2 * ↑x) * jacobiTheta₂ (↑a * Complex.I * ↑x) (Complex.I * ↑x)


@[to_additive addCenter_subset_addCentralizer]
lemma center_subset_centralizer (S : Set M) : Set.center M ⊆ S.centralizer


theorem sum_support_decompose [∀ (i) (x : ℳ i), Decidable (x ≠ 0)] (r : M) :
    (∑ i ∈ (decompose ℳ r).support, (decompose ℳ r i : M)) = r

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

∑ i ∈ DFinsupp.support ((DirectSum.decompose ℳ) r), ↑(((DirectSum.decompose ℳ) r) i) = r


@[simp]
theorem ichildren_mk [DecidableEq F.A] [Inhabited (M F)] (x : F (M F)) (i : F.Idx) :
    ichildren i (M.mk x) = x.iget i

{F : PFunctor.{u}}
[DecidableEq F.A]
[Inhabited F.M]
(x : ↑F F.M)
(i : F.Idx)

PFunctor.M.ichildren i (PFunctor.M.mk x) = x.iget i


theorem ncard_insert_le (a : α) (s : Set α) : (insert a s).ncard ≤ s.ncard + 1


@[simp, norm_cast] lemma coe_mk (f : α → β) (hf) : ⇑(mk f hf) = f

(hf : ∀ (a b : α), f (a ⊓ b) = f a ⊓ f b)


theorem lift_rank_comp_le_right (g : V →ₗ[K] V') (f : V' →ₗ[K] V'') :
    Cardinal.lift.{v'} (rank (f.comp g)) ≤ Cardinal.lift.{v''} (rank g)

{K : Type u}
{V : Type v}
{V' : Type v'}
{V'' : Type v''}
[Ring K]
[AddCommGroup V]
[Module K V]
[AddCommGroup V']
[Module K V']
[AddCommGroup V'']
[Module K V'']
(g : V →ₗ[K] V')
(f : V' →ₗ[K] V'')

Cardinal.lift.{v', v''} (f ∘ₗ g).rank ≤ Cardinal.lift.{v'', v'} g.rank


@[simp]
theorem restrictScalars_mem (V : Submodule R M) (m : M) : m ∈ V.restrictScalars S ↔ m ∈ V

(S : Type u_1)
{R : Type u_2}
{M : Type u_3}
[Semiring R]
[AddCommMonoid M]
[Semiring S]
[Module S M]
[Module R M]
[SMul S R]
[IsScalarTower S R M]
(V : Submodule R M)
(m : M)

m ∈ Submodule.restrictScalars S V ↔ m ∈ V


theorem carrier.add_mem (q : Spec.T A⁰_ f) {a b : A} (ha : a ∈ carrier f_deg q)
    (hb : b ∈ carrier f_deg q) : a + b ∈ carrier f_deg q

(q :
  ↑↑(AlgebraicGeometry.Spec.locallyRingedSpaceObj
          (CommRingCat.of (HomogeneousLocalization.Away 𝒜 f))).toPresheafedSpace)

(ha : a ∈ AlgebraicGeometry.ProjIsoSpecTopComponent.FromSpec.carrier f_deg q)

(hb : b ∈ AlgebraicGeometry.ProjIsoSpecTopComponent.FromSpec.carrier f_deg q)

a + b ∈ AlgebraicGeometry.ProjIsoSpecTopComponent.FromSpec.carrier f_deg q


theorem le_dimH_image (hf : AntilipschitzWith K f) (s : Set X) : dimH s ≤ dimH (f '' s)

{X : Type u_2}
{Y : Type u_3}
[EMetricSpace X]
[EMetricSpace Y]
{K : ℝ≥0}
{f : X → Y}
(hf : AntilipschitzWith K f)
(s : Set X)


theorem degreeOf_def [DecidableEq σ] (n : σ) (p : MvPolynomial σ R) :
    p.degreeOf n = p.degrees.count n

{R : Type u}
{σ : Type u_1}
[CommSemiring R]
[DecidableEq σ]
(n : σ)
(p : MvPolynomial σ R)

MvPolynomial.degreeOf n p = Multiset.count n p.degrees


theorem quot_mk_eq_quotient_map {C D : HomologicalComplex V c} (f : C ⟶ D) :
    Quot.mk _ f = (quotient V c).map f

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

Quot.mk (CategoryTheory.Quotient.CompClosure (homotopic V c)) f = (HomotopyCategory.quotient V c).map f


/-- If `p ^ k` is a prime power, then
`cyclotomic (p ^ (n + 1)) R = ∑ i ∈ range p, (X ^ (p ^ n)) ^ i`. -/
theorem cyclotomic_prime_pow_eq_geom_sum {R : Type*} [CommRing R] {p n : ℕ} (hp : p.Prime) :
    cyclotomic (p ^ (n + 1)) R = ∑ i ∈ Finset.range p, (X ^ p ^ n) ^ i

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

Polynomial.cyclotomic (p ^ (n + 1)) R = ∑ i ∈ Finset.range p, (Polynomial.X ^ p ^ n) ^ i


@[simp]
theorem length_add : (s + t).length = s.length + t.length

{α : Type u_2}
[OrderedAddCommGroup α]
(s t : NonemptyInterval α)


@[simp]
theorem sumAddHom_add [∀ i, AddZeroClass (β i)] [AddCommMonoid γ] (g : ∀ i, β i →+ γ)
    (h : ∀ i, β i →+ γ) : (sumAddHom fun i => g i + h i) = sumAddHom g + sumAddHom h

{ι : Type u}
{γ : Type w}
{β : ι → Type v}
[DecidableEq ι]
[(i : ι) → AddZeroClass (β i)]
[AddCommMonoid γ]
(g h : (i : ι) → β i →+ γ)

(DFinsupp.sumAddHom fun i => g i + h i) = DFinsupp.sumAddHom g + DFinsupp.sumAddHom h


@[simp]
theorem coe_vaddConst_symm (p : P) : ⇑(vaddConst p).symm = fun p' => p' -ᵥ p

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

⇑(Equiv.vaddConst p).symm = fun p' => p' -ᵥ p


/-- In linear orders, frequent boundedness from below implies coboundedness for `≤`. -/
lemma IsCobounded.of_frequently_ge {l : R} (freq_ge : ∃ᶠ x in F, l ≤ x) :
    IsCobounded (· ≤ ·) F

{R : Type u_6}
{F : Filter R}
[LinearOrder R]
{l : R}
(freq_ge : ∃ᶠ (x : R) in F, l ≤ x)

Filter.IsCobounded (fun x x_1 => x ≤ x_1) F


/-- `exp` is analytic at any point -/
theorem analyticAt_cexp : AnalyticAt ℂ exp z


/-- Composition by continuous linear maps on the left preserves `C^n` functions. -/
theorem ContDiff.continuousLinearMap_comp {f : E → F} (g : F →L[𝕜] G) (hf : ContDiff 𝕜 n f) :
    ContDiff 𝕜 n fun x => g (f x)

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type uE}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{F : Type uF}
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{G : Type uG}
[NormedAddCommGroup G]
[NormedSpace 𝕜 G]
{n : ℕ∞}
{f : E → F}
(g : F →L[𝕜] G)
(hf : ContDiff 𝕜 n f)


theorem einfsep_le_of_mem_of_edist_le {d x} (hx : x ∈ s) {y} (hy : y ∈ s) (hxy : x ≠ y)
    (hxy' : edist x y ≤ d) : s.einfsep ≤ d

{α : Type u_1}
[EDist α]
{s : Set α}
{d : ENNReal}
{x : α}
(hx : x ∈ s)
{y : α}
(hy : y ∈ s)
(hxy : x ≠ y)
(hxy' : edist x y ≤ d)


protected theorem le_tsum (a : α) : f a ≤ ∑' a, f a


theorem map₂_assoc {f : δ → γ → ε} {g : α → β → δ} {f' : α → ε' → ε} {g' : β → γ → ε'}
    (h_assoc : ∀ a b c, f (g a b) c = f' a (g' b c)) :
    map₂ f (map₂ g a b) c = map₂ f' a (map₂ g' b c)

{f : δ → γ → ε}

{g : α → β → δ}

(h_assoc : ∀ (a : α) (b : β) (c : γ), f (g a b) c = f' a (g' b c))

Option.map₂ f (Option.map₂ g a b) c = Option.map₂ f' a (Option.map₂ g' b c)


@[simp] lemma sigma_basis_iff {I X} :
    (Matroid.sigma M).Basis I X ↔ ∀ i, (M i).Basis (Sigma.mk i ⁻¹' I) (Sigma.mk i ⁻¹' X)

{ι : Type u_1}
{α : ι → Type u_2}
{M : (i : ι) → Matroid (α i)}
{I X : Set ((i : ι) × α i)}

(Matroid.sigma M).Basis I X ↔ ∀ (i : ι), (M i).Basis (Sigma.mk i ⁻¹' I) (Sigma.mk i ⁻¹' X)


/-- The sum of `1/⌊c^i⌋₊^2` above a threshold `j` is comparable to `1/j^2`, up to a multiplicative
constant. -/
theorem sum_div_nat_floor_pow_sq_le_div_sq (N : ℕ) {j : ℝ} (hj : 0 < j) {c : ℝ} (hc : 1 < c) :
    (∑ i ∈ (range N).filter (j < ⌊c ^ ·⌋₊), (1 : ℝ) / (⌊c ^ i⌋₊ : ℝ) ^ 2) ≤
      c ^ 5 * (c - 1)⁻¹ ^ 3 / j ^ 2

∑ i ∈ Finset.filter (fun x => j < ↑⌊c ^ x⌋₊) (Finset.range N), 1 / ↑⌊c ^ i⌋₊ ^ 2 ≤ c ^ 5 * (c - 1)⁻¹ ^ 3 / j ^ 2


/-- `Prod.snd` as an `OrderHom`. -/
@[simps]
def snd : α × β →o β

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
(self : α × β)


lemma toPartENat_le_iff_of_le_aleph0 {c c' : Cardinal} (h : c ≤ ℵ₀) :
    toPartENat c ≤ toPartENat c' ↔ c ≤ c'

{c c' : Cardinal.{u_1}}
(h : c ≤ Cardinal.aleph0)

Cardinal.toPartENat c ≤ Cardinal.toPartENat c' ↔ c ≤ c'


theorem prod_apply_inr_snd (i) : (b.prod b' (Sum.inr i)).2 = b' i

{ι : Type u_1}
{ι' : Type u_2}
{R : Type u_3}
{M : Type u_6}
{M' : Type u_7}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid M']
[Module R M']
(b : Basis ι R M)
(b' : Basis ι' R M')
(i : ι')


@[to_additive (attr := fun_prop, aesop safe 20 apply (rule_sets := [Measurable]))]
theorem AEMeasurable.smul [MeasurableSMul₂ M β] {μ : Measure α} (hf : AEMeasurable f μ)
    (hg : AEMeasurable g μ) : AEMeasurable (fun x => f x • g x) μ

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


theorem isLowerSet_Iic : IsLowerSet (Iic a)


@[simp]
theorem mapAccumr_map (f₂ : α → β) :
    (mapAccumr f₁ (map f₂ xs) s) = (mapAccumr (fun x s => f₁ (f₂ x) s) xs s)

{α : Type u_3}
{n : ℕ}
{β : Type u_2}
{σ₁ : Type}
{γ : Type u_1}
(xs : Mathlib.Vector α n)
(f₁ : β → σ₁ → σ₁ × γ)
{s : σ₁}
(f₂ : α → β)

Mathlib.Vector.mapAccumr f₁ (Mathlib.Vector.map f₂ xs) s = Mathlib.Vector.mapAccumr (fun x s => f₁ (f₂ x) s) xs s


theorem Subgroup.fg_iff_add_fg (P : Subgroup G) : P.FG ↔ P.toAddSubgroup.FG

{G : Type u_3}
[Group G]
(P : Subgroup G)


@[to_additive rightAddCoset_assoc]
theorem rightCoset_assoc (s : Set α) (a b : α) : op b • op a • s = op (a * b) • s

{α : Type u_1}
[Semigroup α]
(s : Set α)
(a b : α)

MulOpposite.op b • MulOpposite.op a • s = MulOpposite.op (a * b) • s


@[to_additive (attr := simp)]
theorem coprod_unique (f : M × N →* P) : (f.comp (inl M N)).coprod (f.comp (inr M N)) = f

{M : Type u_5}
{N : Type u_6}
{P : Type u_7}
[MulOneClass M]
[MulOneClass N]
[CommMonoid P]
(f : M × N →* P)

(f.comp (MonoidHom.inl M N)).coprod (f.comp (MonoidHom.inr M N)) = f


theorem NonUnitalSubsemiring.toSubsemiring_toNonUnitalSubsemiring (S : NonUnitalSubsemiring R)
    (h1 : (1 : R) ∈ S) : (NonUnitalSubsemiring.toSubsemiring S h1).toNonUnitalSubsemiring = S

{R : Type u_1}
[NonAssocSemiring R]
(S : NonUnitalSubsemiring R)
(h1 : 1 ∈ S)

(S.toSubsemiring h1).toNonUnitalSubsemiring = S


theorem preimage_frontier_eq_frontier_preimage (hf : IsOpenMap f) (hfc : Continuous f) (s : Set Y) :
    f ⁻¹' frontier s = frontier (f ⁻¹' s)

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


@[simp]
theorem mem_toList {a : α} {o : Option α} : a ∈ toList o ↔ a ∈ o


theorem getElem?_eq_some {l : List α} : l[n]? = some a ↔ ∃ h : n < l.length, l[n] = a

{α : Type u_1}
{n : Nat}
{a : α}
{l : List α}


/-- If `x < y`, then `(Set.Iic x)ᶜ` is star convex at `y`. -/
lemma starConvex_compl_Iic (h : x < y) : StarConvex 𝕜 y (Iic x)ᶜ

{𝕜 : Type u_1}
{E : Type u_2}
[OrderedRing 𝕜]
[OrderedAddCommGroup E]
[Module 𝕜 E]
[OrderedSMul 𝕜 E]
{x y : E}
(h : x < y)


/-- Auxiliary lemma for `Measurable.lintegral_kernel_prod_right`. -/
theorem Kernel.measurable_lintegral_indicator_const {t : Set (α × β)} (ht : MeasurableSet t)
    (c : ℝ≥0∞) : Measurable fun a => ∫⁻ b, t.indicator (Function.const (α × β) c) (a, b) ∂κ a

{α : Type u_1}
{β : Type u_2}
{mα : MeasurableSpace α}
{mβ : MeasurableSpace β}
{κ : ProbabilityTheory.Kernel α β}
[ProbabilityTheory.IsSFiniteKernel κ]
{t : Set (α × β)}
(ht : MeasurableSet t)
(c : ℝ≥0∞)

Measurable fun a => ∫⁻ (b : β), t.indicator (Function.const (α × β) c) (a, b) ∂κ a


/-- If each component of the unit is a split epimorphism, then the left adjoint is full. -/
lemma full_L_of_isSplitEpi_unit_app [∀ X, IsSplitEpi (h.unit.app X)] : L.Full

[∀ (X : C), CategoryTheory.IsSplitEpi (h.unit.app X)]


@[simp, norm_cast]
theorem cast_le [LinearOrderedSemiring α] {m n : Num} : (m : α) ≤ n ↔ m ≤ n

{α : Type u_1}
[LinearOrderedSemiring α]
{m n : Num}

↑m ≤ ↑n ↔ m ≤ n


@[simp]
theorem ContinuousLinearMap.norm_extendTo𝕜 (fr : RestrictScalars ℝ 𝕜 F →L[ℝ] ℝ) :
    ‖fr.extendTo𝕜‖ = ‖fr‖

{𝕜 : Type u_1}
[RCLike 𝕜]
{F : Type u_2}
[SeminormedAddCommGroup F]
[NormedSpace 𝕜 F]
(fr : RestrictScalars ℝ 𝕜 F →L[ℝ] ℝ)


theorem coeFn_toL1 {f : α → β} (hf : Integrable f μ) : hf.toL1 f =ᵐ[μ] f

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

↑↑(MeasureTheory.Integrable.toL1 f hf) =ᵐ[μ] f


theorem Matrix.toBilin'Aux_stdBasis [Fintype n] [DecidableEq n] (M : Matrix n n R₂) (i j : n) :
    M.toBilin'Aux (LinearMap.stdBasis R₂ (fun _ => R₂) i 1)
      (LinearMap.stdBasis R₂ (fun _ => R₂) j 1) = M i j

{R₂ : Type u_5}
[CommSemiring R₂]
{n : Type u_11}
[Fintype n]
[DecidableEq n]
(M : Matrix n n R₂)
(i j : n)

(M.toBilin'Aux ((LinearMap.stdBasis R₂ (fun x => R₂) i) 1)) ((LinearMap.stdBasis R₂ (fun x => R₂) j) 1) = M i j


protected theorem zero_smul (x : M ⊗[R] N) : (0 : R'') • x = 0

{R : Type u_1}
[CommSemiring R]
{R'' : Type u_3}
[Semiring R'']
{M : Type u_4}
{N : Type u_5}
[AddCommMonoid M]
[AddCommMonoid N]
[Module R M]
[Module R N]
[Module R'' M]
[SMulCommClass R R'' M]
(x : TensorProduct R M N)


/-- The coercion from `lp E p` to `∀ i, E i` is uniformly continuous. -/
theorem uniformContinuous_coe [_i : Fact (1 ≤ p)] :
    UniformContinuous (α := lp E p) ((↑) : lp E p → ∀ i, E i)

{α : Type u_1}
{E : α → Type u_2}
{p : ℝ≥0∞}
[(i : α) → NormedAddCommGroup (E i)]
[_i : Fact (1 ≤ p)]


@[simp]
lemma ShortComplex.zero_apply
    [Limits.HasZeroMorphisms C] [(forget₂ C Ab).PreservesZeroMorphisms]
    (S : ShortComplex C) (x : (forget₂ C Ab).obj S.X₁) :
    ((forget₂ C Ab).map S.g) (((forget₂ C Ab).map S.f) x) = 0

(x : ↑((CategoryTheory.forget₂ C Ab).obj S.X₁))

((CategoryTheory.forget₂ C Ab).map S.g) (((CategoryTheory.forget₂ C Ab).map S.f) x) = 0


/-- A list with product greater than one must have positive length. -/
@[to_additive length_pos_of_sum_pos "A list with positive sum must have positive length."]
theorem length_pos_of_one_lt_prod [Preorder M] (L : List M) (h : 1 < L.prod) : 0 < L.length

{M : Type u_4}
[AddMonoid M]
[Preorder M]
(L : List M)
(h : 0 < L.sum)


lemma InjOn.iterate {f : α → α} {s : Set α} (h : InjOn f s) (hf : MapsTo f s s) :
    ∀ n, InjOn f^[n] s

{α : Type u_1}
{f : α → α}
{s : Set α}
(h : Set.InjOn f s)
(hf : Set.MapsTo f s s)
(n : ℕ)


theorem rank_eq :
    hwf.rank a = Ordinal.sup.{u, u} fun b : { b // r b a } => Order.succ <| hwf.rank b

{α : Type u}
{r : α → α → Prop}
{a : α}
(hwf : WellFounded r)

hwf.rank a = Ordinal.sup fun b => Order.succ (hwf.rank ↑b)


@[to_additive]
theorem Set.Finite.multipliable_compl_iff {s : Set β} (hs : s.Finite) :
    Multipliable (f ∘ (↑) : ↑sᶜ → α) ↔ Multipliable f

{α : Type u_1}
{β : Type u_2}
[CommGroup α]
[TopologicalSpace α]
[TopologicalGroup α]
{f : β → α}
{s : Set β}
(hs : s.Finite)

Multipliable (f ∘ Subtype.val) ↔ Multipliable f


theorem Algebra.isIntegral_of_surjective (h : Function.Surjective (algebraMap R A)) :
    Algebra.IsIntegral R A

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


theorem left_mem_Ico : a ∈ Ico a b ↔ a < b

{α : Type u_2}
[Preorder α]
[LocallyFiniteOrder α]
{a b : α}


lemma homMk'_id (f : StructuredArrow S T) : homMk' f (𝟙 f.right) = eqToHom (by aesop_cat)

(f : CategoryTheory.StructuredArrow S T)

f.homMk' (CategoryTheory.CategoryStruct.id f.right) = CategoryTheory.eqToHom ⋯


@[to_additive]
theorem smul_def : a • x = x.map id fun _ => (a • ·)

{ι : Type u_1}
{M : Type u_2}
{α : ι → Type u_4}
[(i : ι) → SMul M (α i)]
(a : M)
(x : (i : ι) × α i)

a • x = Sigma.map id (fun x x_1 => a • x_1) x


/-- `f = O(g)` if and only if `∀ᶠ x in l, ‖f x‖ ≤ c * ‖g x‖` for all sufficiently large `c`. -/
theorem isBigO_iff_eventually : f =O[l] g' ↔ ∀ᶠ c in atTop, ∀ᶠ x in l, ‖f x‖ ≤ c * ‖g' x‖

{α : Type u_1}
{E : Type u_3}
{F' : Type u_7}
[Norm E]
[SeminormedAddCommGroup F']
{f : α → E}
{g' : α → F'}
{l : Filter α}

f =O[l] g' ↔ ∀ᶠ (c : ℝ) in Filter.atTop, ∀ᶠ (x : α) in l, ‖f x‖ ≤ c * ‖g' x‖


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

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

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

(CategoryTheory.Arrow.mapAugmentedCechConerve F).left = F.left


theorem log_nonpos (hx : 0 ≤ x) (h'x : x ≤ 1) : log x ≤ 0


theorem Poly.denote_insertSorted (ctx : Context) (k : Nat) (v : Var) (p : Poly) : (p.insertSorted k v).denote ctx = p.denote ctx + k * v.denote ctx

(ctx : Nat.Linear.Context)
(k : Nat)
(v : Nat.Linear.Var)
(p : Nat.Linear.Poly)

Nat.Linear.Poly.denote ctx (Nat.Linear.Poly.insertSorted k v p) =
  Nat.Linear.Poly.denote ctx p + k * Nat.Linear.Var.denote ctx v


protected theorem eq_zero_of_not_pos (h : ¬0 < n) : n = 0


/-- A natural isomorphism `L₁ ≅ L₂` induces an equivalence of categories
    `Comma L₁ R ≌ Comma L₂ R`. -/
@[simps!]
def mapLeftIso (i : L₁ ≅ L₂) : Comma L₁ R ≌ Comma L₂ R

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

((CategoryTheory.Comma.mapLeftIso R i).unitIso.inv.app X).left = CategoryTheory.CategoryStruct.id X.left