@[symm]
protected lemma symm (h : p.IsConjExponent q) : q.IsConjExponent p


theorem range_subset {m n : ℕ} : range m ⊆ range n ↔ m ≤ n

Multiset.range m ⊆ Multiset.range n ↔ m ≤ n


theorem image_span_subset_span (f : F) (s : Set M) : f '' span R s ⊆ span R₂ (f '' s)

{R : Type u_1}
{R₂ : Type u_2}
{M : Type u_4}
{M₂ : Type u_5}
[Semiring R]
[AddCommMonoid M]
[Module R M]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
[AddCommMonoid M₂]
[Module R₂ M₂]
{F : Type u_8}
[FunLike F M M₂]
[SemilinearMapClass F σ₁₂ M M₂]
(f : F)
(s : Set M)

⇑f '' ↑(Submodule.span R s) ⊆ ↑(Submodule.span R₂ (⇑f '' s))


@[reassoc (attr := simp)]
lemma ranCounit_app_whiskerLeft_ranAdjunction_unit_app (G : D ⥤ H) :
    whiskerLeft L ((L.ranAdjunction H).unit.app G) ≫ L.ranCounit.app (L ⋙ G) = 𝟙 (L ⋙ G)

[∀ (F : CategoryTheory.Functor C H), L.HasRightKanExtension F]

CategoryTheory.CategoryStruct.comp (CategoryTheory.whiskerLeft L ((L.ranAdjunction H).unit.app G))
    (L.ranCounit.app (L.comp G)) =
  CategoryTheory.CategoryStruct.id (L.comp G)


/-- When the second map `S.g` is zero, this is the left homology data on `S` given by
the chosen `cokernel S.f` -/
@[simps!]
noncomputable def ofHasCokernel [HasCokernel S.f] (hg : S.g = 0) : S.LeftHomologyData

(CategoryTheory.ShortComplex.LeftHomologyData.ofHasCokernel S hg).H = CategoryTheory.Limits.cokernel S.f


@[to_additive]
theorem Monotone.smul {γ : Type*} [Preorder G] [Preorder P] [Preorder γ] [SMul G P]
    [IsOrderedSMul G P] {f : γ → G} {g : γ → P} (hf : Monotone f) (hg : Monotone g) :
    Monotone fun x => f x • g x

{G : Type u_1}
{P : Type u_2}
{γ : Type u_3}
[Preorder G]
[Preorder P]
[Preorder γ]
[VAdd G P]
[IsOrderedVAdd G P]
{f : γ → G}
{g : γ → P}
(hf : Monotone f)
(hg : Monotone g)


theorem mem_closure_iff_sup :
    a ∈ closure s ↔
      ∃ (ι : Type u) (_ : Nonempty ι) (f : ι → Ordinal), (∀ i, f i ∈ s) ∧ sup.{u, u} f = a

a ∈ closure s ↔ ∃ ι, ∃ (_ : Nonempty ι), ∃ f, (∀ (i : ι), f i ∈ s) ∧ Ordinal.sup f = a


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

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

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


theorem nmul_le_iff₃ :
    a ⨳ b ⨳ c ≤ d ↔
      ∀ a' < a, ∀ b' < b, ∀ c' < c,
        a' ⨳ b ⨳ c ♯ a ⨳ b' ⨳ c ♯ a ⨳ b ⨳ c' ♯ a' ⨳ b' ⨳ c' <
          d ♯ a' ⨳ b' ⨳ c ♯ a' ⨳ b ⨳ c' ♯ a ⨳ b' ⨳ c'


@[simp] lemma mapEquiv_base_iff {B : Set β} : (M.mapEquiv f).Base B ↔ M.Base (f.symm '' B)

{α : Type u_1}
{β : Type u_2}
{M : Matroid α}
{f : α ≃ β}
{B : Set β}

(M.mapEquiv f).Base B ↔ M.Base (⇑f.symm '' B)


/--
If `(a,b)` is a kernel pair for `f₁` and `f₂` is mono, then `(a,b)` is a kernel pair for `f₁ ≫ f₂`.
The converse of `cancel_right_of_mono`.
-/
theorem comp_of_mono {f₁ : X ⟶ Y} {f₂ : Y ⟶ Z} [Mono f₂] (small_k : IsKernelPair f₁ a b) :
    IsKernelPair (f₁ ≫ f₂) a b

(small_k : CategoryTheory.IsKernelPair f₁ a b)

CategoryTheory.IsKernelPair (CategoryTheory.CategoryStruct.comp f₁ f₂) a b


theorem leadingCoeff_dvd_leadingCoeff {a p : R[X]} (hap : a ∣ p) :
    a.leadingCoeff ∣ p.leadingCoeff

{R : Type u}
[Semiring R]
[NoZeroDivisors R]
{a p : R[X]}
(hap : a ∣ p)


/-- The morphism `triangle φ₁ ⟶ triangle φ₂` that is induced by a commutative square. -/
@[simps]
noncomputable def triangleMap :
    triangle φ₁ ⟶ triangle φ₂

(φ₁ : K₁ ⟶ L₁)

(φ₂ : K₂ ⟶ L₂)

(CochainComplex.mappingCone.triangleMap φ₁ φ₂ a b comm).hom₃ = CochainComplex.mappingCone.map φ₁ φ₂ a b comm


@[to_additive coe_prod]
theorem coe_prod (s : Subsemigroup M) (t : Subsemigroup N) :
    (s.prod t : Set (M × N)) = (s : Set M) ×ˢ (t : Set N)

{M : Type u_1}
{N : Type u_2}
[Add M]
[Add N]
(s : AddSubsemigroup M)
(t : AddSubsemigroup N)


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

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


/-- A nonzero monomorphism to a simple object is an isomorphism. -/
theorem isIso_of_mono_of_nonzero {X Y : C} [Simple Y] {f : X ⟶ Y} [Mono f] (w : f ≠ 0) : IsIso f


/-- If the same point added to two group elements produces equal
results, those group elements are equal. -/
theorem vadd_right_cancel {g₁ g₂ : G} (p : P) (h : g₁ +ᵥ p = g₂ +ᵥ p) : g₁ = g₂

{G : Type u_1}
{P : Type u_2}
[AddGroup G]
[T : AddTorsor G P]
{g₁ g₂ : G}
(p : P)
(h : g₁ +ᵥ p = g₂ +ᵥ p)


@[measurability]
theorem Measurable.const_sup (hf : Measurable f) (c : M) : Measurable fun x => c ⊔ f x

{M : Type u_1}
[MeasurableSpace M]
{α : Type u_2}
{m : MeasurableSpace α}
{f : α → M}
[Sup M]
[MeasurableSup M]
(hf : Measurable f)
(c : M)


theorem Ideal.Quotient.index_eq_zero {R : Type*} [CommRing R] (I : Ideal R) :
    (↑I.toAddSubgroup.index : R ⧸ I) = 0

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


lemma HurwitzZeta.completedCosZeta₀_zero (s : ℂ) :
    completedCosZeta₀ 0 s = completedRiemannZeta₀ s

HurwitzZeta.completedCosZeta₀ 0 s = completedRiemannZeta₀ s


theorem coeff_add_monomial_mul (a : R) :
    coeff R (m + n) (monomial R m a * φ) = a * coeff R n φ

{σ : Type u_1}
{R : Type u_2}
[Semiring R]
(m n : σ →₀ ℕ)
(φ : MvPowerSeries σ R)
(a : R)

(MvPowerSeries.coeff R (m + n)) ((MvPowerSeries.monomial R m) a * φ) = a * (MvPowerSeries.coeff R n) φ


@[simp]
theorem length_revzip (l : List α) : length (revzip l) = length l


lemma continuousOn_evenKernel (a : UnitAddCircle) : ContinuousOn (evenKernel a) (Ioi 0)

ContinuousOn (HurwitzZeta.evenKernel a) (Set.Ioi 0)


/--
Mapping a multiset through a predicate and counting the `True`s yields the cardinality of the set
filtered by the predicate. Note that this uses the notion of a multiset of `Prop`s - due to the
decidability requirements of `count`, the decidability instance on the LHS is different from the
RHS. In particular, the decidability instance on the left leaks `Classical.decEq`.
See [here](https://github.com/leanprover-community/mathlib/pull/11306#discussion_r782286812)
for more discussion.
-/
@[simp]
theorem map_count_True_eq_filter_card (s : Multiset α) (p : α → Prop) [DecidablePred p] :
    (s.map p).count True = card (s.filter p)

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

Multiset.count True (Multiset.map p s) = Multiset.card (Multiset.filter p s)


@[symm]
theorem SameCycle.symm : SameCycle f x y → SameCycle f y x

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


theorem Icc_subset_Ioo (ha : a₂ < a₁) (hb : b₁ < b₂) : Icc a₁ b₁ ⊆ Ioo a₂ b₂

{α : Type u_1}
[Preorder α]
{a₁ a₂ b₁ b₂ : α}
(ha : a₂ < a₁)
(hb : b₁ < b₂)


lemma fermatLastTheoremFor_iff_int {n : ℕ} : FermatLastTheoremFor n ↔ FermatLastTheoremWith ℤ n


/-- If `x` is an element of a subgroup `s` of a seminormed group `E`, its norm in `s` is equal to
its norm in `E`. -/
@[to_additive (attr := simp) "If `x` is an element of a subgroup `s` of a seminormed group `E`, its
norm in `s` is equal to its norm in `E`."]
theorem coe_norm (x : s) : ‖x‖ = ‖(x : E)‖

{E : Type u_6}
[SeminormedAddGroup E]
{s : AddSubgroup E}
(x : ↥s)


/-- A complex function is conformal if and only if the function is holomorphic or antiholomorphic
    with a nonvanishing differential. -/
theorem conformalAt_iff_differentiableAt_or_differentiableAt_comp_conj {f : ℂ → ℂ} {z : ℂ} :
    ConformalAt f z ↔
      (DifferentiableAt ℂ f z ∨ DifferentiableAt ℂ (f ∘ conj) (conj z)) ∧ fderiv ℝ f z ≠ 0

ConformalAt f z ↔
  (DifferentiableAt ℂ f z ∨ DifferentiableAt ℂ (f ∘ ⇑(starRingEnd ℂ)) ((starRingEnd ℂ) z)) ∧ fderiv ℝ f z ≠ 0


nonrec theorem IsLocalMin.bicomp_mono [Preorder δ] {op : β → γ → δ}
    (hop : ((· ≤ ·) ⇒ (· ≤ ·) ⇒ (· ≤ ·)) op op) (hf : IsLocalMin f a) {g : α → γ}
    (hg : IsLocalMin g a) : IsLocalMin (fun x => op (f x) (g x)) a

{op : β → γ → δ}

(hop : ((fun x x_1 => x ≤ x_1) ⇒ (fun x x_1 => x ≤ x_1) ⇒ fun x x_1 => x ≤ x_1) op op)


theorem Real.sub_le_dist (x y : ℝ) : x - y ≤ dist x y


@[simp] theorem endofunctorMonoidalCategory_whiskerRight_app
    {F G H : C ⥤ C} {α : F ⟶ G} (X : C) :
    (α ▷ H).app X = H.map (α.app X)

(C : Type u)
[CategoryTheory.Category.{v, u} C]
{F G H : CategoryTheory.Functor C C}
{α : F ⟶ G}
(X : C)

(CategoryTheory.MonoidalCategory.whiskerRight α H).app X = H.map (α.app X)


theorem infs_subset : s₁ ⊆ s₂ → t₁ ⊆ t₂ → s₁ ⊼ t₁ ⊆ s₂ ⊼ t₂

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

s₁ ⊆ s₂ → t₁ ⊆ t₂ → s₁ ⊼ t₁ ⊆ s₂ ⊼ t₂


theorem comp_eq {X Y Z : TopCat.{w}} (f : X ⟶ Y) (g : Y ⟶ Z) (ℱ : X.Presheaf C) :
    (f ≫ g) _* ℱ = g _* (f _* ℱ)

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

(TopCat.Presheaf.pushforward C (f ≫ g)).obj ℱ =
  (TopCat.Presheaf.pushforward C g).obj ((TopCat.Presheaf.pushforward C f).obj ℱ)


@[simp, aesop safe apply (rule_sets := [finsetNonempty])]
lemma compls_nonempty : sᶜˢ.Nonempty ↔ s.Nonempty

{α : Type u_2}
[BooleanAlgebra α]
{s : Finset α}


theorem offsetOfPos_of_valid (l r) : offsetOfPos ⟨l ++ r⟩ ⟨utf8Len l⟩ = l.length

{ data := l ++ r }.offsetOfPos { byteIdx := String.utf8Len l } = l.length


theorem model_singleton_iff {φ : L.Sentence} : M ⊨ ({φ} : L.Theory) ↔ M ⊨ φ

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

M ⊨ {φ} ↔ M ⊨ φ


@[simp, norm_cast]
lemma ofReal_pos {x : ℝ} : 0 < (x : K) ↔ 0 < x


theorem lt_sub_of_add_lt {a b c : Nat} (h : a + b < c) : a < c - b


theorem head!_mem_head? [Inhabited α] : ∀ {l : List α}, l ≠ [] → head! l ∈ head? l


theorem aleph0_mul_aleph0 : ℵ₀ * ℵ₀ = ℵ₀

Cardinal.aleph0 * Cardinal.aleph0 = Cardinal.aleph0


@[rclike_simps, norm_cast]
theorem ofReal_sub (r s : ℝ) : ((r - s : ℝ) : K) = r - s


@[simp]
theorem prodComm_symm : (prodComm : α × β ≃o β × α).symm = prodComm

{α : Type u_2}
{β : Type u_3}
[LE α]
[LE β]


@[to_additive]
theorem haarContent_outerMeasure_closure_pos (K₀ : PositiveCompacts G) :
    0 < (haarContent K₀).outerMeasure (closure K₀)

(K₀ : TopologicalSpace.PositiveCompacts G)

0 < (MeasureTheory.Measure.haar.haarContent K₀).outerMeasure (closure ↑K₀)


@[to_additive]
theorem image_div : m '' (s / t) = m '' s / m '' t

{F : Type u_1}
{α : Type u_2}
{β : Type u_3}
[Group α]
[DivisionMonoid β]
[FunLike F α β]
[MonoidHomClass F α β]
(m : F)
{s t : Set α}


theorem preimage_image_mk_closed (hs : IsClosed s) : mk ⁻¹' (mk '' s) = s

{X : Type u_1}
[TopologicalSpace X]
{s : Set X}
(hs : IsClosed s)

SeparationQuotient.mk ⁻¹' (SeparationQuotient.mk '' s) = s


theorem continuous_eraseIdx {n : ℕ} {i : Fin (n + 1)} :
    Continuous (Vector.eraseIdx i : Vector α (n + 1) → Vector α n)

{α : Type u_1}
[TopologicalSpace α]
{n : ℕ}
{i : Fin (n + 1)}


/-- Product of a list of elements in a submonoid is in the submonoid. -/
@[to_additive "Sum of a list of elements in an `AddSubmonoid` is in the `AddSubmonoid`."]
theorem list_prod_mem {l : List M} (hl : ∀ x ∈ l, x ∈ S) : l.prod ∈ S

{M : Type u_1}
{B : Type u_3}
[Monoid M]
[SetLike B M]
[SubmonoidClass B M]
{S : B}
{l : List M}
(hl : ∀ x ∈ l, x ∈ S)


lemma slope_le_deriv (hfc : ConcaveOn ℝ S f)
    (hx : x ∈ S) (hy : y ∈ S) (hxy : x < y) (hfd : DifferentiableAt ℝ f x) :
    slope f x y ≤ deriv f x

{S : Set ℝ}
{f : ℝ → ℝ}
{x y : ℝ}
(hfc : ConcaveOn ℝ S f)
(hx : x ∈ S)
(hy : y ∈ S)
(hxy : x < y)
(hfd : DifferentiableAt ℝ f x)


theorem add_pow_prime_pow_eq (hp : p.Prime) (x y : R) (n : ℕ) :
    (x + y) ^ p ^ n =
      x ^ p ^ n + y ^ p ^ n +
        p * ∑ k ∈ Finset.Ioo 0 (p ^ n), x ^ k * y ^ (p ^ n - k) * ↑((p ^ n).choose k / p)

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

(x + y) ^ p ^ n =
  x ^ p ^ n + y ^ p ^ n + ↑p * ∑ k ∈ Finset.Ioo 0 (p ^ n), x ^ k * y ^ (p ^ n - k) * ↑((p ^ n).choose k / p)


protected theorem monotone (e : α ≃o β) : Monotone e

{α : Type u_2}
{β : Type u_3}
[Preorder α]
[Preorder β]
(e : α ≃o β)


theorem isInteger_smul {a : R} {x : M'} (hx : IsInteger f x) : IsInteger f (a • x)

{R : Type u_1}
[CommSemiring R]
{M : Type u_2}
[AddCommMonoid M]
[Module R M]
{M' : Type u_3}
[AddCommMonoid M']
[Module R M']
(f : M →ₗ[R] M')
{a : R}
{x : M'}
(hx : IsLocalizedModule.IsInteger f x)


/--
The presheaf sending each object to the set of `J`-closed sieves on it. This presheaf is a `J`-sheaf
(and will turn out to be a subobject classifier for the category of `J`-sheaves).
-/
@[simps]
def Functor.closedSieves : Cᵒᵖ ⥤ Type max v u

(J₁ : CategoryTheory.GrothendieckTopology C)

∀ {X Y : Cᵒᵖ} (f : X ⟶ Y) (S : { S // J₁.IsClosed S }),
  ↑((CategoryTheory.Functor.closedSieves J₁).map f S) = CategoryTheory.Sieve.pullback f.unop ↑S


@[to_additive]
theorem rangeKerLift_injective : Injective (rangeKerLift φ)

{G : Type u}
[AddGroup G]
{H : Type v}
[AddGroup H]
(φ : G →+ H)


@[simp]
lemma localizationAway_dimension_zero : (localizationAway r (S := S)).dimension = 0

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
[Algebra R S]
(r : R)
[IsLocalization.Away r S]

(Algebra.Presentation.localizationAway r).dimension = 0


/-- `a ∈ as` is a predicate which asserts that `a` is in the array `as`. -/
-- NB: This is defined as a structure rather than a plain def so that a lemma
-- like `sizeOf_lt_of_mem` will not apply with no actual arrays around.
structure Mem (a : α) (as : Array α) : Prop where
  val : a ∈ as.data

{α : Type u_1}
{a : α}
{as : Array α}
(self : Array.Mem a as)


/-- If `F i → f` in `L1`, then `∫ x, F i x ∂μ → ∫ x, f x ∂μ`. -/
lemma tendsto_integral_of_L1' {ι} (f : α → G) (hfi : Integrable f μ) {F : ι → α → G} {l : Filter ι}
    (hFi : ∀ᶠ i in l, Integrable (F i) μ) (hF : Tendsto (fun i ↦ eLpNorm (F i - f) 1 μ) l (𝓝 0)) :
    Tendsto (fun i ↦ ∫ x, F i x ∂μ) l (𝓝 (∫ x, f x ∂μ))

(hFi : ∀ᶠ (i : ι) in l, MeasureTheory.Integrable (F i) μ)

(hF : Filter.Tendsto (fun i => MeasureTheory.eLpNorm (F i - f) 1 μ) l (𝓝 0))

Filter.Tendsto (fun i => ∫ (x : α), F i x ∂μ) l (𝓝 (∫ (x : α), f x ∂μ))


/-- Permutations on a subtype are equivalent to permutations on the original type that fix pointwise
the rest. -/
@[simps]
protected def subtypeEquivSubtypePerm (p : α → Prop) [DecidablePred p] :
    Perm (Subtype p) ≃ { f : Perm α // ∀ a, ¬p a → f a = a }

{α : Type u}
(p : α → Prop)
[DecidablePred p]
(f : Equiv.Perm (Subtype p))

↑((Equiv.Perm.subtypeEquivSubtypePerm p) f) = Equiv.Perm.ofSubtype f


theorem isCycle_def {u : V} (p : G.Walk u u) :
    p.IsCycle ↔ p.IsTrail ∧ p ≠ nil ∧ p.support.tail.Nodup

{V : Type u}
{G : SimpleGraph V}
{u : V}
(p : G.Walk u u)

p.IsCycle ↔ p.IsTrail ∧ p ≠ SimpleGraph.Walk.nil ∧ p.support.tail.Nodup


theorem not_ne_eq (x y : α) : (¬ (x ≠ y)) = (x = y)


theorem eq_of_boxes_subset (h₁ : π₁.IsPartition) (h₂ : π₁.boxes ⊆ π₂.boxes) : π₁ = π₂

{ι : Type u_1}
{I : BoxIntegral.Box ι}
{π₁ π₂ : BoxIntegral.Prepartition I}
(h₁ : π₁.IsPartition)
(h₂ : π₁.boxes ⊆ π₂.boxes)


@[simp, norm_cast]
theorem coe_zero : ((0 : R[X]) : PowerSeries R) = 0


theorem mul_congr {a b c d : Int} (h₁ : a = b) (h₂ : c = d) : a * c = b * d


@[to_additive (attr := refl)]
theorem Red.refl : Red L L


/-- Given Localization maps `f : M →* N` for a Submonoid `S ⊆ M` and
`k : M →* Q` for a Submonoid `T ⊆ M`, such that `S ≤ T`, and we have
`l : M →* A`, the composition of the induced map `f.lift` for `k` with
the induced map `k.lift` for `l` is equal to the  induced map `f.lift` for `l`. -/
@[to_additive
    "Given Localization maps `f : M →+ N` for a Submonoid `S ⊆ M` and
`k : M →+ Q` for a Submonoid `T ⊆ M`, such that `S ≤ T`, and we have
`l : M →+ A`, the composition of the induced map `f.lift` for `k` with
the induced map `k.lift` for `l` is equal to the  induced map `f.lift` for `l`"]
theorem lift_comp_lift {T : Submonoid M} (hST : S ≤ T) {Q : Type*} [CommMonoid Q]
    (k : LocalizationMap T Q) {A : Type*} [CommMonoid A] {l : M →* A}
    (hl : ∀ w : T, IsUnit (l w)) :
    (k.lift hl).comp (f.lift (map_units k ⟨_, hST ·.2⟩)) =
    f.lift (hl ⟨_, hST ·.2⟩)

{M : Type u_1}
[AddCommMonoid M]
{S : AddSubmonoid M}
{N : Type u_2}
[AddCommMonoid N]
(f : S.LocalizationMap N)
{T : AddSubmonoid M}
(hST : S ≤ T)
{Q : Type u_4}
[AddCommMonoid Q]
(k : T.LocalizationMap Q)
{A : Type u_5}
[AddCommMonoid A]
{l : M →+ A}
(hl : ∀ (w : ↥T), IsAddUnit (l ↑w))


/-- Auxiliary definition for the proof of the shrinking lemma. A partial refinement of a covering
`⋃ i, u i` of a set `s` is a map `v : ι → Set X` and a set `carrier : Set ι` such that

* `s ⊆ ⋃ i, v i`;
* all `v i` are open;
* if `i ∈ carrier v`, then `closure (v i) ⊆ u i`;
* if `i ∉ carrier`, then `v i = u i`.

This type is equipped with the following partial order: `v ≤ v'` if `v.carrier ⊆ v'.carrier`
and `v i = v' i` for `i ∈ v.carrier`. We will use Zorn's lemma to prove that this type has
a maximal element, then show that the maximal element must have `carrier = univ`. -/
-- Porting note(#5171): this linter isn't ported yet. @[nolint has_nonempty_instance]
@[ext] structure PartialRefinement (u : ι → Set X) (s : Set X) where
  /-- A family of sets that form a partial refinement of `u`. -/
  toFun : ι → Set X
  /-- The set of indexes `i` such that `i`-th set is already shrunk. -/
  carrier : Set ι
  /-- Each set from the partially refined family is open. -/
  protected isOpen : ∀ i, IsOpen (toFun i)
  /-- The partially refined family still covers the set. -/
  subset_iUnion : s ⊆ ⋃ i, toFun i
  /-- For each `i ∈ carrier`, the original set includes the closure of the refined set. -/
  closure_subset : ∀ {i}, i ∈ carrier → closure (toFun i) ⊆ u i
  /-- Sets that correspond to `i ∉ carrier` are not modified. -/
  apply_eq : ∀ {i}, i ∉ carrier → toFun i = u i

(self : ShrinkingLemma.PartialRefinement u s)


@[to_additive]
theorem le_div_iff_mul_le' : b ≤ c / a ↔ a * b ≤ c

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


lemma add_rel (r : I) {p q : I} (hpq : c.Rel p q) : c.Rel (r + p) (r + q)

{I : Type u_4}
[AddMonoid I]
(c : ComplexShape I)
[c.TensorSigns]
(r : I)
{p q : I}
(hpq : c.Rel p q)


/-- The compatibility isomorphisms of the total complex with the shifts
in both variables "commute" only up to a sign `(x * y).negOnePow`. -/
@[reassoc]
lemma totalShift₁Iso_hom_totalShift₂Iso_hom :
    (((shiftFunctor₂ C y).obj K).totalShift₁Iso x).hom ≫ (K.totalShift₂Iso y).hom⟦x⟧' =
      (x * y).negOnePow • (total.map ((shiftFunctor₁₂CommIso C x y).hom.app K) (up ℤ) ≫
          (((shiftFunctor₁ C x).obj K).totalShift₂Iso y).hom ≫
          (K.totalShift₁Iso x).hom⟦y⟧' ≫
          (shiftFunctorComm (CochainComplex C ℤ) x y).hom.app _)

(K : HomologicalComplex₂ C (ComplexShape.up ℤ) (ComplexShape.up ℤ))

(((HomologicalComplex₂.shiftFunctor₂ C y).obj K).totalShift₁Iso x).hom ≫
    (CategoryTheory.shiftFunctor (HomologicalComplex C (ComplexShape.up ℤ)) x).map (K.totalShift₂Iso y).hom =
  (x * y).negOnePow •
    HomologicalComplex₂.total.map ((HomologicalComplex₂.shiftFunctor₁₂CommIso C x y).hom.app K) (ComplexShape.up ℤ) ≫
      (((HomologicalComplex₂.shiftFunctor₁ C x).obj K).totalShift₂Iso y).hom ≫
        (CategoryTheory.shiftFunctor (HomologicalComplex C (ComplexShape.up ℤ)) y).map (K.totalShift₁Iso x).hom ≫
          (CategoryTheory.shiftFunctorComm (CochainComplex C ℤ) x y).hom.app (K.total (ComplexShape.up ℤ))


@[simp]
theorem left_eq_sup : a = a ⊔ b ↔ b ≤ a

{α : Type u}
[SemilatticeSup α]
{a b : α}


@[to_additive]
theorem inv_mul' : (a * b)⁻¹ = a⁻¹ / b

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


/-- An element in a C⋆-algebra is selfadjoint if and only if it is normal and its spectrum is
contained in `ℝ`. -/
lemma isSelfAdjoint_iff_isStarNormal_and_spectrumRestricts {a : A} :
    IsSelfAdjoint a ↔ IsStarNormal a ∧ SpectrumRestricts a Complex.reCLM

IsSelfAdjoint a ↔ IsStarNormal a ∧ SpectrumRestricts a ⇑Complex.reCLM


theorem IsLUB.frequently_mem {a : α} {s : Set α} (ha : IsLUB s a) (hs : s.Nonempty) :
    ∃ᶠ x in 𝓝[≤] a, x ∈ s

{α : Type u_1}
[TopologicalSpace α]
[LinearOrder α]
[OrderTopology α]
{a : α}
{s : Set α}
(ha : IsLUB s a)
(hs : s.Nonempty)


/--Universal property of the free product of algebras:
for every `R`-algebra `B`, every family of maps `maps : (i : I) → (A i →ₐ[R] B)` lifts
to a unique arrow `π` from `FreeProduct R A` such that  `π ∘ ι i = maps i`.-/
@[simps] def lift : ({i : I} → A i →ₐ[R] B) ≃ (FreeProduct R A →ₐ[R] B)

(π : LinearAlgebra.FreeProduct R A →ₐ[R] B)

(LinearAlgebra.FreeProduct.lift R A).symm π = π.comp (LinearAlgebra.FreeProduct.ι R A i)


theorem IsClosed.mem_of_tendsto {f : α → X} {b : Filter α} [NeBot b]
    (hs : IsClosed s) (hf : Tendsto f b (𝓝 x)) (h : ∀ᶠ x in b, f x ∈ s) : x ∈ s

{X : Type u}
{α : Type u_1}
{x : X}
{s : Set X}
[TopologicalSpace X]
{f : α → X}
{b : Filter α}
[b.NeBot]
(hs : IsClosed s)
(hf : Filter.Tendsto f b (𝓝 x))
(h : ∀ᶠ (x : α) in b, f x ∈ s)


theorem Zigzag.of_zag_trans {j₁ j₂ j₃ : J} (h₁ : Zag j₁ j₂) (h₂ : Zag j₂ j₃) : Zigzag j₁ j₃

{J : Type u₁}
[CategoryTheory.Category.{v₁, u₁} J]
{j₁ j₂ j₃ : J}
(h₁ : CategoryTheory.Zag j₁ j₂)
(h₂ : CategoryTheory.Zag j₂ j₃)


theorem support_X_pow (H : ¬(1 : R) = 0) (n : ℕ) : (X ^ n : R[X]).support = singleton n

{R : Type u}
[Semiring R]
(H : ¬1 = 0)
(n : ℕ)


theorem binomial_eq_choose [DecidableEq α] (h : a ≠ b) :
    multinomial {a, b} f = (f a + f b).choose (f a)

{α : Type u_1}
{f : α → ℕ}
{a b : α}
[DecidableEq α]
(h : a ≠ b)

Nat.multinomial {a, b} f = (f a + f b).choose (f a)


/-- The type of pseudo-epimorphisms, aka p-morphisms, aka bounded maps, from `α` to `β`. -/
structure PseudoEpimorphism (α β : Type*) [Preorder α] [Preorder β] extends α →o β where
  exists_map_eq_of_map_le' ⦃a : α⦄ ⦃b : β⦄ : toFun a ≤ b → ∃ c, a ≤ c ∧ toFun c = b

{α : Type u_6}
{β : Type u_7}
[Preorder α]
[Preorder β]
(self : PseudoEpimorphism α β)
⦃a : α⦄
⦃b : β⦄

self.toFun a ≤ b → ∃ c, a ≤ c ∧ self.toFun c = b


@[to_additive (attr := simp)]
theorem finprod_cond_eq_right : (∏ᶠ (i) (_ : a = i), f i) = f a

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


lemma Fan.IsLimit.hom_ext {I : Type*} {F : I → C} {c : Fan F} (hc : IsLimit c) {A : C}
    (f g : A ⟶ c.pt) (h : ∀ i, f ≫ c.proj i = g ≫ c.proj i) : f = g

(h : ∀ (i : I), f ≫ c.proj i = g ≫ c.proj i)


theorem filter_singleton {a : α} : [a].filter p = bif p a then [a] else []

List.filter p [a] = bif p a then [a] else []


theorem rev_last_eq_bot (n : ℕ) : rev (last n) = ⊥


theorem lt_sup_of_lt_left (h : c < a) : c < a ⊔ b

{α : Type u}
[SemilatticeSup α]
{a b c : α}
(h : c < a)


@[simp]
theorem coe_splitLower : (splitLower I i x : Set (ι → ℝ)) = ↑I ∩ { y | y i ≤ x }

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

↑(I.splitLower i x) = ↑I ∩ {y | y i ≤ x}


theorem sup_le_of_le_sdiff_right (h : a ≤ c \ b) (hbc : b ≤ c) : a ⊔ b ≤ c

{α : Type u_2}
[GeneralizedCoheytingAlgebra α]
{a b c : α}
(h : a ≤ c \ b)
(hbc : b ≤ c)


@[to_additive]
theorem card_right_transversal (h : S ∈ rightTransversals (H : Set G)) : Nat.card S = H.index

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


@[simp]
theorem disjoint_of_subsingleton [Subsingleton α] : Disjoint a b

{α : Type u_1}
[PartialOrder α]
[OrderBot α]
{a b : α}
[Subsingleton α]


@[fun_prop]
theorem continuous_parametric_intervalIntegral_of_continuous {a₀ : ℝ}
    (hf : Continuous f.uncurry) {s : X → ℝ} (hs : Continuous s) :
    Continuous fun x ↦ ∫ t in a₀..s x, f x t ∂μ

Continuous fun x => ∫ (t : ℝ) in a₀..s x, f x t ∂μ


/-- The category of cocones on `F` is just the comma category `(F ↓ Δ)`, where `Δ` is the constant
    functor. -/
@[simps! (config := { notRecursive := [`PLift, `ULift] })]
def Cocone.equivStructuredArrow (F : J ⥤ C) : Cocone F ≌ StructuredArrow F (const J)

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

∀ {X Y : CategoryTheory.Limits.Cocone F} (f : X ⟶ Y),
  ((CategoryTheory.Limits.Cocone.equivStructuredArrow F).functor.map f).right = f.hom


@[reassoc (attr := simp)] lemma w₁₃_τ₂ : S.v₁₂.τ₂ ≫ S.v₂₃.τ₂ = 0

(S : CategoryTheory.ShortComplex.SnakeInput C)

CategoryTheory.CategoryStruct.comp S.v₁₂.τ₂ S.v₂₃.τ₂ = 0


@[rclike_simps, norm_cast]
theorem ofReal_prod {α : Type*} (s : Finset α) (f : α → ℝ) :
    ((∏ i ∈ s, f i : ℝ) : K) = ∏ i ∈ s, (f i : K)

{K : Type u_1}
[RCLike K]
{α : Type u_3}
(s : Finset α)
(f : α → ℝ)


@[simp]
theorem coeIdeal_eq_one {I : Ideal R} : (I : FractionalIdeal R⁰ K) = 1 ↔ I = 1

{R : Type u_1}
[CommRing R]
{K : Type u_3}
[Field K]
[Algebra R K]
[IsFractionRing R K]
{I : Ideal R}


@[simp]
theorem mk_zero_zero : mk K p (0, 0) = 0

(K : Type u)
[CommRing K]
(p : ℕ)
[Fact (Nat.Prime p)]
[CharP K p]


@[simp]
theorem comp (ℱ : X.Presheaf C) (f : X ⟶ Y) (g : Y ⟶ Z) (x : X) :
    ℱ.stalkPushforward C (f ≫ g) x =
      (f _* ℱ).stalkPushforward C g (f x) ≫ ℱ.stalkPushforward C f x

(C : Type u)
[CategoryTheory.Category.{v, u} C]
[CategoryTheory.Limits.HasColimits C]
{X Y Z : TopCat}
(ℱ : TopCat.Presheaf C X)
(f : X ⟶ Y)
(g : Y ⟶ Z)
(x : ↑X)

TopCat.Presheaf.stalkPushforward C (f ≫ g) ℱ x =
  TopCat.Presheaf.stalkPushforward C g ((TopCat.Presheaf.pushforward C f).obj ℱ) (f x) ≫
    TopCat.Presheaf.stalkPushforward C f ℱ x


theorem cantorFunctionAux_eq (h : f n = g n) :
    cantorFunctionAux c f n = cantorFunctionAux c g n

{c : ℝ}
{f g : ℕ → Bool}
{n : ℕ}
(h : f n = g n)

Cardinal.cantorFunctionAux c f n = Cardinal.cantorFunctionAux c g n


{x y z : ℤ}
(h : PythagoreanTriple x y z)


theorem mk_coordChange (e₁ e₂ : Trivialization F proj) {b : B} (h₁ : b ∈ e₁.baseSet)
    (h₂ : b ∈ e₂.baseSet) (x : F) :
    (b, e₁.coordChange e₂ b x) = e₂ (e₁.toPartialHomeomorph.symm (b, x))

{B : Type u_2}
{F : Type u_3}
{Z : Type u_5}
[TopologicalSpace B]
[TopologicalSpace F]
{proj : Z → B}
[TopologicalSpace Z]
(e₁ e₂ : Trivialization F proj)
{b : B}
(h₁ : b ∈ e₁.baseSet)
(h₂ : b ∈ e₂.baseSet)
(x : F)

(b, e₁.coordChange e₂ b x) = ↑e₂ (↑e₁.symm (b, x))


theorem fg_of_fg_map (S : Subalgebra R A) (f : A →ₐ[R] B) (hf : Function.Injective f)
    (hs : (S.map f).FG) : S.FG

{R : Type u}
{A : Type v}
{B : Type w}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
(S : Subalgebra R A)
(f : A →ₐ[R] B)
(hf : Function.Injective ⇑f)
(hs : (Subalgebra.map f S).FG)


theorem wellFounded_of_noetherian [IsNoetherian R M] :
    WellFounded ((· > ·) : LieSubmodule R L M → LieSubmodule R L M → Prop)

(R : Type u)
(L : Type v)
(M : Type w)
[CommRing R]
[LieRing L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[IsNoetherian R M]


theorem as_sum_range_C_mul_X_pow (p : R[X]) :
    p = ∑ i ∈ range (p.natDegree + 1), C (coeff p i) * X ^ i

p = ∑ i ∈ Finset.range (p.natDegree + 1), Polynomial.C (p.coeff i) * Polynomial.X ^ i


@[simp] theorem length_eraseP_of_mem (al : a ∈ l) (pa : p a) :
    length (l.eraseP p) = Nat.pred (length l)

∀ {α : Type u_1} {a : α} {l : List α} {p : α → Bool}, a ∈ l → p a = true → (List.eraseP p l).length = l.length.pred


/-- The norm, relative to `ℤ`, of `ζ - 1` in a `p`-th cyclotomic extension of `ℚ` is a prime if
`p ≠ 2`. -/
lemma prime_norm_toInteger_sub_one_of_prime_ne_two' [hcycl : IsCyclotomicExtension {p} ℚ K]
    (hζ : IsPrimitiveRoot ζ ↑p) (hodd : p ≠ 2) :
    Prime (Algebra.norm ℤ (hζ.toInteger - 1))

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

Prime ((Algebra.norm ℤ) (hζ.toInteger - 1))


/-- A group is isomorphic to its group of units. -/
@[to_additive (attr := simps apply_val symm_apply)
"An additive group is isomorphic to its group of additive units"]
def toUnits [Group G] : G ≃* Gˣ

{G : Type u_10}
[AddGroup G]
(x : AddUnits G)


theorem mem_carrier_iff_of_mem (hm : 0 < m) (q : Spec.T A⁰_ f) (a : A) {n} (hn : a ∈ 𝒜 n) :
    a ∈ carrier f_deg q ↔
      (HomogeneousLocalization.mk ⟨m * n, ⟨a ^ m, pow_mem_graded m hn⟩,
        ⟨f ^ n, by rw [mul_comm]; mem_tac⟩, ⟨_, rfl⟩⟩ : A⁰_ f) ∈ q.asIdeal

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

a ∈ AlgebraicGeometry.ProjIsoSpecTopComponent.FromSpec.carrier f_deg q ↔
  HomogeneousLocalization.mk { deg := m * n, num := ⟨a ^ m, ⋯⟩, den := ⟨f ^ n, ⋯⟩, den_mem := ⋯ } ∈ q.asIdeal


lemma log_pos_of_isRat_neg {n : ℤ} :
    (NormNum.IsRat e n d) → (decide (n / d < (-1 : ℚ))) → (0 < Real.log (e : ℝ))

Mathlib.Meta.NormNum.IsRat e n d → decide (↑n / ↑d < -1) = true → 0 < Real.log e


lemma toCircle_natCast (j : ℕ) :
    toCircle (j : ZMod N) = exp (2 * π * I * j / N)

↑(ZMod.toCircle ↑j) = cexp (2 * ↑π * Complex.I * ↑j / ↑N)


/-- `0 * x` is equivalent to `0`. -/
theorem zero_mul_equiv (x : PGame) : 0 * x ≈ 0


/-- Urysohn's lemma: if `s` and `t` are two disjoint closed sets in a normal topological space `X`,
then there exists a continuous function `f : X → ℝ` such that

* `f` equals zero on `s`;
* `f` equals one on `t`;
* `0 ≤ f x ≤ 1` for all `x`.
-/
theorem exists_continuous_zero_one_of_isClosed [NormalSpace X]
    {s t : Set X} (hs : IsClosed s) (ht : IsClosed t)
    (hd : Disjoint s t) : ∃ f : C(X, ℝ), EqOn f 0 s ∧ EqOn f 1 t ∧ ∀ x, f x ∈ Icc (0 : ℝ) 1

{X : Type u_1}
[TopologicalSpace X]
[NormalSpace X]
{s t : Set X}
(hs : IsClosed s)
(ht : IsClosed t)
(hd : Disjoint s t)

∃ f, Set.EqOn (⇑f) 0 s ∧ Set.EqOn (⇑f) 1 t ∧ ∀ (x : X), f x ∈ Set.Icc 0 1


lemma baseChange_Ψ₂Sq : (W.baseChange B).Ψ₂Sq = (W.baseChange A).Ψ₂Sq.map f

{R : Type r}
{S : Type s}
[CommRing R]
[CommRing S]
(W : WeierstrassCurve R)
[Algebra R S]
{A : Type u}
[CommRing A]
[Algebra R A]
[Algebra S A]
[IsScalarTower R S A]
{B : Type v}
[CommRing B]
[Algebra R B]
[Algebra S B]
[IsScalarTower R S B]
(f : A →ₐ[S] B)

(W.baseChange B).Ψ₂Sq = Polynomial.map (↑f) (W.baseChange A).Ψ₂Sq


lemma mulSupport_add_one [AddRightCancelMonoid R] (f : ι → R) :
    mulSupport (fun x ↦ f x + 1) = support f

{ι : Type u_1}
{R : Type u_5}
[One R]
[AddRightCancelMonoid R]
(f : ι → R)

(Function.mulSupport fun x => f x + 1) = Function.support f


theorem fdiv_eq_div {a b : Int} (Ha : 0 ≤ a) (Hb : 0 ≤ b) : fdiv a b = div a b


theorem quasiSeparated_over_affine_iff {X Y : Scheme} (f : X ⟶ Y) [IsAffine Y] :
    QuasiSeparated f ↔ QuasiSeparatedSpace X

{X Y : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)
[AlgebraicGeometry.IsAffine Y]

AlgebraicGeometry.QuasiSeparated f ↔ QuasiSeparatedSpace ↑↑X.toPresheafedSpace


@[simp]
theorem zero_right [MulZeroClass G₀] (a : G₀) : Commute a 0

{G₀ : Type u_3}
[MulZeroClass G₀]
(a : G₀)


/-- L'Hôpital's rule for approaching a real from the left, `HasDerivAt` version -/
theorem lhopital_zero_nhds_left (hff' : ∀ᶠ x in 𝓝[<] a, HasDerivAt f (f' x) x)
    (hgg' : ∀ᶠ x in 𝓝[<] a, HasDerivAt g (g' x) x) (hg' : ∀ᶠ x in 𝓝[<] a, g' x ≠ 0)
    (hfa : Tendsto f (𝓝[<] a) (𝓝 0)) (hga : Tendsto g (𝓝[<] a) (𝓝 0))
    (hdiv : Tendsto (fun x => f' x / g' x) (𝓝[<] a) l) :
    Tendsto (fun x => f x / g x) (𝓝[<] a) l

(hff' : ∀ᶠ (x : ℝ) in 𝓝[<] a, HasDerivAt f (f' x) x)

(hgg' : ∀ᶠ (x : ℝ) in 𝓝[<] a, HasDerivAt g (g' x) x)

(hdiv : Filter.Tendsto (fun x => f' x / g' x) (𝓝[<] a) l)

Filter.Tendsto (fun x => f x / g x) (𝓝[<] a) l


theorem restrictScalars_curry (f : M ⊗[R] N →ₗ[A] P) :
    restrictScalars R (curry f) = TensorProduct.curry (f.restrictScalars R)

{R : Type uR}
{A : Type uA}
{M : Type uM}
{N : Type uN}
{P : Type uP}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[AddCommMonoid M]
[Module R M]
[Module A M]
[IsScalarTower R A M]
[AddCommMonoid N]
[Module R N]
[AddCommMonoid P]
[Module R P]
[Module A P]
[IsScalarTower R A P]
(f : TensorProduct R M N →ₗ[A] P)

↑R (TensorProduct.AlgebraTensorModule.curry f) = TensorProduct.curry (↑R f)


/-- Change a cocone on `F.unop : J ⥤ C` into a cone on `F : Jᵒᵖ ⥤ Cᵒᵖ`. -/
@[simps]
def coneOfCoconeUnop (c : Cocone F.unop) : Cone F

(c : CategoryTheory.Limits.Cocone F.unop)

(CategoryTheory.Limits.coneOfCoconeUnop c).π = CategoryTheory.NatTrans.removeUnop c.ι


theorem continuous_inclusion {s t : Set X} (h : s ⊆ t) : Continuous (inclusion h)

{X : Type u}
[TopologicalSpace X]
{s t : Set X}
(h : s ⊆ t)


theorem terminal.subsingleton_to {A : C} : Subsingleton (⊤_ C ⟶ A)


theorem Iso.conj_ρ {M N : Action V G} (f : M ≅ N) (g : G) :
    N.ρ g = ((forget V G).mapIso f).conj (M.ρ g)

{V : Type (u + 1)}
[CategoryTheory.LargeCategory V]
{G : MonCat}
{M N : Action V G}
(f : M ≅ N)
(g : ↑G)

N.ρ g = ((Action.forget V G).mapIso f).conj (M.ρ g)


@[simp]
theorem trace_multiset_sum (s : Multiset (Matrix n n R)) : trace s.sum = (s.map trace).sum

{n : Type u_3}
{R : Type u_6}
[Fintype n]
[AddCommMonoid R]
(s : Multiset (Matrix n n R))

s.sum.trace = (Multiset.map Matrix.trace s).sum


theorem X_pow_dvd_iff {f : R[X]} {n : ℕ} : X ^ n ∣ f ↔ ∀ d < n, f.coeff d = 0

{R : Type u}
[Semiring R]
{f : R[X]}
{n : ℕ}

Polynomial.X ^ n ∣ f ↔ ∀ d < n, f.coeff d = 0


@[simp]
theorem gcd_mul_lcm (x y : R) : gcd x y * lcm x y = x * y

{R : Type u}
[EuclideanDomain R]
[DecidableEq R]
(x y : R)

EuclideanDomain.gcd x y * EuclideanDomain.lcm x y = x * y


@[simp]
lemma reverse_add (l m : Language α) : (l + m).reverse = l.reverse + m.reverse


theorem IsRelPrime.of_prod_left (H1 : IsRelPrime (∏ i ∈ t, s i) x) (i : I) (hit : i ∈ t) :
    IsRelPrime (s i) x

{α : Type u_1}
{I : Type u_2}
[CommMonoid α]
[DecompositionMonoid α]
{x : α}
{s : I → α}
{t : Finset I}
(H1 : IsRelPrime (∏ i ∈ t, s i) x)
(i : I)
(hit : i ∈ t)


theorem isMaximal_comap_of_isIntegral_of_isMaximal [Algebra.IsIntegral R S] (I : Ideal S)
    [hI : I.IsMaximal] : IsMaximal (I.comap (algebraMap R S))

{R : Type u_1}
[CommRing R]
{S : Type u_2}
[CommRing S]
[Algebra R S]
[Algebra.IsIntegral R S]
(I : Ideal S)
[hI : I.IsMaximal]

(Ideal.comap (algebraMap R S) I).IsMaximal


theorem Int.rel_of_forall_rel_succ_of_le (r : β → β → Prop) [IsRefl β r] [IsTrans β r] {f : ℤ → β}
    (h : ∀ n, r (f n) (f (n + 1))) ⦃a b : ℤ⦄ (hab : a ≤ b) : r (f a) (f b)

{β : Type v}
(r : β → β → Prop)
[IsRefl β r]
[IsTrans β r]
{f : ℤ → β}
(h : ∀ (n : ℤ), r (f n) (f (n + 1)))
⦃a b : ℤ⦄
(hab : a ≤ b)


@[simp]
theorem coprodᵢ_bot : Filter.coprodᵢ (fun _ => ⊥ : ∀ i, Filter (α i)) = ⊥


@[simp] theorem dist_ofDual (a b : Xᵒᵈ) : dist (ofDual a) (ofDual b) = dist a b

dist (OrderDual.ofDual a) (OrderDual.ofDual b) = dist a b


/-- Calculate the derivative of the Taylor polynomial with respect to `x₀`.

Version for closed intervals -/
theorem hasDerivWithinAt_taylorWithinEval_at_Icc {f : ℝ → E} {a b t : ℝ} (x : ℝ) {n : ℕ}
    (hx : a < b) (ht : t ∈ Icc a b) (hf : ContDiffOn ℝ n f (Icc a b))
    (hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Icc a b)) (Icc a b)) :
    HasDerivWithinAt (fun y => taylorWithinEval f n (Icc a b) y x)
      (((n ! : ℝ)⁻¹ * (x - t) ^ n) • iteratedDerivWithin (n + 1) f (Icc a b) t) (Icc a b) t

(hf : ContDiffOn ℝ (↑n) f (Set.Icc a b))

(hf' : DifferentiableOn ℝ (iteratedDerivWithin n f (Set.Icc a b)) (Set.Icc a b))

HasDerivWithinAt (fun y => taylorWithinEval f n (Set.Icc a b) y x)
  (((↑n !)⁻¹ * (x - t) ^ n) • iteratedDerivWithin (n + 1) f (Set.Icc a b) t) (Set.Icc a b) t


/-- The involution acts only on the right of the tensor product. -/
theorem toBaseChange_involute (Q : QuadraticForm R V) (x : CliffordAlgebra (Q.baseChange A)) :
    toBaseChange A Q (involute x) =
      TensorProduct.map LinearMap.id (involute.toLinearMap) (toBaseChange A Q x)

(x : CliffordAlgebra (QuadraticForm.baseChange A Q))

(CliffordAlgebra.toBaseChange A Q) (CliffordAlgebra.involute x) =
  (TensorProduct.map LinearMap.id CliffordAlgebra.involute.toLinearMap) ((CliffordAlgebra.toBaseChange A Q) x)


theorem support_subset_source : support f ⊆ (chartAt H c).source

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

Function.support ↑f ⊆ (chartAt H c).source


theorem zero_pow {b : ℕ} (_ : 0 < b) : (0 : R) ^ b = 0


/-- For every nonzero ideal `I` of `v`, there are finitely many maximal ideals `v` such that the
  multiplicity of `v` in the factorization of `I`, denoted `val_v(I)`, is nonzero. -/
theorem Associates.finite_factors {I : Ideal R} (hI : I ≠ 0) :
    ∀ᶠ v : HeightOneSpectrum R in Filter.cofinite,
      ((Associates.mk v.asIdeal).count (Associates.mk I).factors : ℤ) = 0

{R : Type u_1}
[CommRing R]
[IsDedekindDomain R]
{I : Ideal R}
(hI : I ≠ 0)

∀ᶠ (v : IsDedekindDomain.HeightOneSpectrum R) in Filter.cofinite,
  ↑((Associates.mk v.asIdeal).count (Associates.mk I).factors) = 0


theorem rtakeWhile_suffix : l.rtakeWhile p <:+ l

{α : Type u_1}
(p : α → Bool)
(l : List α)


@[simp] theorem subNat_addNat (i : Fin n) (m : Nat) (h : m ≤ addNat i m := le_coe_addNat m i) :
    subNat m (addNat i m) h = i

{n : Nat}
(i : Fin n)
(m : Nat)
(h : m ≤ ↑(i.addNat m) := ⋯)


@[to_additive (attr := simp)]
lemma finEquivPowers_apply (x : G) (hx) {n : Fin (orderOf x)} :
    finEquivPowers x hx n = ⟨x ^ (n : ℕ), n, rfl⟩

{G : Type u_1}
[LeftCancelMonoid G]
(x : G)
(hx : IsOfFinOrder x)
{n : Fin (orderOf x)}


theorem IsLittleO.tendsto_zero_of_tendsto {α E 𝕜 : Type*} [NormedAddCommGroup E] [NormedField 𝕜]
    {u : α → E} {v : α → 𝕜} {l : Filter α} {y : 𝕜} (huv : u =o[l] v) (hv : Tendsto v l (𝓝 y)) :
    Tendsto u l (𝓝 0)

{α : Type u_17}
{E : Type u_18}
{𝕜 : Type u_19}
[NormedAddCommGroup E]
[NormedField 𝕜]
{u : α → E}
{v : α → 𝕜}
{l : Filter α}
{y : 𝕜}
(huv : u =o[l] v)
(hv : Filter.Tendsto v l (𝓝 y))


theorem eq_bot_iff : K = ⊥ ↔ ∀ x : L, x ∈ K → x = 0

{R : Type u}
{L : Type v}
[CommRing R]
[LieRing L]
[LieAlgebra R L]
(K : LieSubalgebra R L)


@[simp, norm_cast]
theorem coe_map {f : α → β} (hf : Continuous f) (hf' : IsOpenMap f) (s : CompactOpens α) :
    (s.map f hf hf' : Set β) = f '' s

{α : Type u_1}
{β : Type u_2}
[TopologicalSpace α]
[TopologicalSpace β]
{f : α → β}
(hf : Continuous f)
(hf' : IsOpenMap f)
(s : TopologicalSpace.CompactOpens α)

↑(TopologicalSpace.CompactOpens.map f hf hf' s) = f '' ↑s


lemma ext_iff {A B : E →WOT[𝕜] F} : A = B ↔ ∀ x, A x = B x

{𝕜 : Type u_1}
{E : Type u_2}
{F : Type u_3}
[RCLike 𝕜]
[AddCommGroup E]
[TopologicalSpace E]
[Module 𝕜 E]
[NormedAddCommGroup F]
[NormedSpace 𝕜 F]
{A B : E →WOT[𝕜]F}


@[simp]
theorem sInf_empty : sInf ∅ = (⊤ : α)


theorem Antitone.le_map_sInf [CompleteLattice β] {s : Set α} {f : α → β} (hf : Antitone f) :
    ⨆ a ∈ s, f a ≤ f (sInf s)

{α : Type u_1}
{β : Type u_2}
[CompleteLattice α]
[CompleteLattice β]
{s : Set α}
{f : α → β}
(hf : Antitone f)


/-- `Equiv.piCongrRight` as a uniform isomorphism: this is the natural isomorphism
`Π i, β₁ i ≃ᵤ Π j, β₂ i` obtained from uniform isomorphisms `β₁ i ≃ᵤ β₂ i` for each `i`. -/
@[simps! apply toEquiv]
def piCongrRight {ι : Type*} {β₁ β₂ : ι → Type*} [∀ i, UniformSpace (β₁ i)]
    [∀ i, UniformSpace (β₂ i)] (F : ∀ i, β₁ i ≃ᵤ β₂ i) : (∀ i, β₁ i) ≃ᵤ ∀ i, β₂ i

{ι : Type u_4}
{β₁ : ι → Type u_5}
{β₂ : ι → Type u_6}
[(i : ι) → UniformSpace (β₁ i)]
[(i : ι) → UniformSpace (β₂ i)]
(F : (i : ι) → β₁ i ≃ᵤ β₂ i)

(UniformEquiv.piCongrRight F).toEquiv = Equiv.piCongrRight fun i => (F i).toEquiv


@[to_additive]
theorem op_smul_set_subset_mul : a ∈ t → op a • s ⊆ s * t

{α : Type u_2}
[Mul α]
{s t : Set α}
{a : α}


theorem L1.norm_eq_integral_norm (f : α →₁[μ] H) : ‖f‖ = ∫ a, ‖f a‖ ∂μ

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

‖f‖ = ∫ (a : α), ‖↑↑f a‖ ∂μ


/-- Universe lift functor for groups. -/
@[to_additive (attr := simps)
  "Universe lift functor for additive groups."]
def uliftFunctor : Grp.{u} ⥤ Grp.{max u v}

AddGrp.uliftFunctor.map f =
  AddGrp.ofHom (AddEquiv.ulift.symm.toAddMonoidHom.comp (AddMonoidHom.comp f AddEquiv.ulift.toAddMonoidHom))


/-- For any relation `r` on `α`, multiset addition `Multiset α × Multiset α → Multiset α` is a
  fibration between the game sum of `CutExpand r` with itself and `CutExpand r` itself. -/
theorem cutExpand_fibration (r : α → α → Prop) :
    Fibration (GameAdd (CutExpand r) (CutExpand r)) (CutExpand r) fun s ↦ s.1 + s.2

Relation.Fibration (Prod.GameAdd (Relation.CutExpand r) (Relation.CutExpand r)) (Relation.CutExpand r) fun s =>
  s.1 + s.2


@[to_additive]
theorem prod_map_zpow {n : ℤ} : (m.map fun i => f i ^ n).prod = (m.map f).prod ^ n

{ι : Type u_2}
{α : Type u_3}
[DivisionCommMonoid α]
{m : Multiset ι}
{f : ι → α}
{n : ℤ}

(Multiset.map (fun i => f i ^ n) m).prod = (Multiset.map f m).prod ^ n


lemma smul_le_smul_of_nonpos_left (h : b₁ ≤ b₂) (ha : a ≤ 0) : a • b₂ ≤ a • b₁

{α : Type u_1}
{β : Type u_2}
{a : α}
{b₁ b₂ : β}
[OrderedRing α]
[OrderedAddCommGroup β]
[Module α β]
[PosSMulMono α β]
(h : b₁ ≤ b₂)
(ha : a ≤ 0)

a • b₂ ≤ a • b₁


@[simp]
theorem linearEquivFunOnFintype_lof [Fintype ι] [DecidableEq ι] (i : ι) (m : M i) :
    (linearEquivFunOnFintype R ι M) (lof R ι M i m) = Pi.single i m

(R : Type u)
[Semiring R]
{ι : Type v}
{M : ι → Type w}
[(i : ι) → AddCommMonoid (M i)]
[(i : ι) → Module R (M i)]
[Fintype ι]
[DecidableEq ι]
(i : ι)
(m : M i)

(DirectSum.linearEquivFunOnFintype R ι M) ((DirectSum.lof R ι M i) m) = Pi.single i m


theorem Set.star_mem_center (ha : a ∈ Set.center R) : star a ∈ Set.center R

{R : Type u_1}
[Mul R]
[StarMul R]
{a : R}
(ha : a ∈ Set.center R)


@[to_additive (attr := simp)]
theorem csSup_one : sSup (1 : Set α) = 1

{α : Type u_1}
[ConditionallyCompleteLattice α]
[One α]


theorem total_surjective (h : Function.Surjective v) :
    Function.Surjective (Finsupp.total α M R v)

{α : Type u_1}
{M : Type u_2}
(R : Type u_5)
[Semiring R]
[AddCommMonoid M]
[Module R M]
{v : α → M}
(h : Function.Surjective v)

Function.Surjective ⇑(Finsupp.total α M R v)


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


/--
The explicit pullback cone is a limit cone.
-/
@[simps! lift]
def pullback.isLimit : Limits.IsLimit (pullback.cone f g)

(s : CategoryTheory.Limits.PullbackCone f g)

(CompHausLike.pullback.isLimit f g).lift s = CompHausLike.pullback.lift f g s.fst s.snd ⋯


protected theorem tsub_lt_tsub_iff_right (hc : AddLECancellable c) (h : c ≤ a) :
    a - c < b - c ↔ a < b


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

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

↑(f +ᵥ g) = ⇑(f ∘ₗ g.domain.subtype) + ↑g


theorem rpow_lt_rpow_of_exponent_lt {x : ℝ≥0∞} {y z : ℝ} (hx : 1 < x) (hx' : x ≠ ⊤) (hyz : y < z) :
    x ^ y < x ^ z


theorem disjoint_finset_sum_left {β : Type*} {i : Finset β} {f : β → Multiset α} {a : Multiset α} :
    Multiset.Disjoint (i.sum f) a ↔ ∀ b ∈ i, Multiset.Disjoint (f b) a

{α : Type u_3}
{β : Type u_6}
{i : Finset β}
{f : β → Multiset α}
{a : Multiset α}

(i.sum f).Disjoint a ↔ ∀ b ∈ i, (f b).Disjoint a


/-- If `f` has derivative `f'` within `s` at `x`, then for any `r > ‖f'‖` the ratio
`‖f z - f x‖ / ‖z - x‖` is less than `r` in some neighborhood of `x` within `s`.
In other words, the limit superior of this ratio as `z` tends to `x` along `s`
is less than or equal to `‖f'‖`. -/
theorem HasDerivWithinAt.limsup_norm_slope_le (hf : HasDerivWithinAt f f' s x) (hr : ‖f'‖ < r) :
    ∀ᶠ z in 𝓝[s] x, ‖z - x‖⁻¹ * ‖f z - f x‖ < r

{E : Type u}
[NormedAddCommGroup E]
[NormedSpace ℝ E]
{f : ℝ → E}
{f' : E}
{s : Set ℝ}
{x r : ℝ}
(hf : HasDerivWithinAt f f' s x)
(hr : ‖f'‖ < r)

∀ᶠ (z : ℝ) in 𝓝[s] x, ‖z - x‖⁻¹ * ‖f z - f x‖ < r


/-- There is an induced injective homomorphism of a subgraph of `G` into `G`. -/
@[simps]
protected def hom (x : Subgraph G) : x.coe →g G

{V : Type u}
{G : SimpleGraph V}
(x : G.Subgraph)
(v : ↑x.verts)


@[to_additive (attr := simp)]
theorem length_mul (x y : FreeSemigroup α) : (x * y).length = x.length + y.length


@[mono] lemma dens_strictMono : StrictMono (dens : Finset α → ℚ≥0)


@[simp]
theorem option_symm_apply_none_iff : e.symm none = none ↔ e none = none

{α : Type u_1}
{β : Type u_2}
(e : Option α ≃ Option β)


@[simp]
theorem mk_smul {s : Finset ι} (c : γ) (x : ∀ i : (↑s : Set ι), β (i : ι)) :
    mk s (c • x) = c • mk s x

{ι : Type u}
{γ : Type w}
{β : ι → Type v}
[DecidableEq ι]
[Monoid γ]
[(i : ι) → AddMonoid (β i)]
[(i : ι) → DistribMulAction γ (β i)]
{s : Finset ι}
(c : γ)
(x : (i : ↑↑s) → β ↑i)

DFinsupp.mk s (c • x) = c • DFinsupp.mk s x


@[simp]
theorem assoc_tmul (a : A) (b : B) (c : C) :
    Algebra.TensorProduct.assoc R A B C ((a ⊗ₜ b) ⊗ₜ c) = a ⊗ₜ (b ⊗ₜ c)

(R : Type uR)
{A : Type uA}
{B : Type uB}
{C : Type uC}
[CommSemiring R]
[Semiring A]
[Algebra R A]
[Semiring B]
[Algebra R B]
[Semiring C]
[Algebra R C]
(a : A)
(b : B)
(c : C)

(Algebra.TensorProduct.assoc R A B C) ((a ⊗ₜ[R] b) ⊗ₜ[R] c) = a ⊗ₜ[R] b ⊗ₜ[R] c


@[simp]
theorem updateColumn_ne [DecidableEq n] {j' : n} (j_ne : j' ≠ j) :
    updateColumn M j c i j' = M i j'

{m : Type u_2}
{n : Type u_3}
{α : Type v}
{M : Matrix m n α}
{i : m}
{j : n}
{c : m → α}
[DecidableEq n]
{j' : n}
(j_ne : j' ≠ j)


@[simp]
theorem mapEvalEquiv_symm_apply (W'' : Submodule R (Dual R (Dual R M))) :
    (mapEvalEquiv R M).symm W'' = W''.comap (Dual.eval R M)

(W'' : Submodule R (Module.Dual R (Module.Dual R M)))

(Module.mapEvalEquiv R M).symm W'' = Submodule.comap (Module.Dual.eval R M) W''


theorem _root_.Set.Infinite.exists_lt (hs : s.Infinite) : ∀ a, ∃ b ∈ s, b < a

{α : Type u_2}
[LinearOrder α]
[LocallyFiniteOrderTop α]
{s : Set α}
(hs : s.Infinite)
(a : α)


@[to_additive] lemma MonovaryOn.mul_left (h₁ : MonovaryOn f₁ g s) (h₂ : MonovaryOn f₂ g s) :
    MonovaryOn (f₁ * f₂) g s

{ι : Type u_1}
{α : Type u_2}
{β : Type u_3}
[OrderedCommGroup α]
[OrderedCommGroup β]
{s : Set ι}
{f₁ f₂ : ι → α}
{g : ι → β}
(h₁ : MonovaryOn f₁ g s)
(h₂ : MonovaryOn f₂ g s)


@[to_additive (attr := simp)]
theorem univ_mul (ht : t.Nonempty) : (univ : Set α) * t = univ

{α : Type u_2}
[Group α]
{t : Set α}
(ht : t.Nonempty)


@[to_additive existing (attr := simp) inv_addLeft]
lemma inv_mulLeft : (Equiv.mulLeft a)⁻¹ = Equiv.mulLeft a⁻¹


theorem pairwise_one_le_dist : Pairwise fun m n : ℕ => 1 ≤ dist m n


theorem surjective_stableUnderBaseChange : StableUnderBaseChange surjective

RingHom.StableUnderBaseChange fun {X Y} [CommRing X] [CommRing Y] f => Function.Surjective ⇑f


theorem append_ofBool (msbs : BitVec w) (lsb : Bool) :
    msbs ++ ofBool lsb = concat msbs lsb

{w : Nat}
(msbs : BitVec w)
(lsb : Bool)

msbs ++ BitVec.ofBool lsb = msbs.concat lsb


theorem pullback_fst_eq :
    Profinite.pullback.fst f g = (pullbackIsoPullback f g).hom ≫ Limits.pullback.fst f g

{X Y B : Profinite}
(f : X ⟶ B)
(g : Y ⟶ B)

Profinite.pullback.fst f g =
  CategoryTheory.CategoryStruct.comp (Profinite.pullbackIsoPullback f g).hom (CategoryTheory.Limits.pullback.fst f g)


/-- Composing two partial equivs if the target of the first coincides with the source of the
second. -/
@[simps]
protected def trans' (e' : PartialEquiv β γ) (h : e.target = e'.source) : PartialEquiv α γ

{α : Type u_1}
{β : Type u_2}
{γ : Type u_3}
(e : PartialEquiv α β)
(e' : PartialEquiv β γ)
(h : e.target = e'.source)


theorem IsChain.exists3 (hchain : IsChain r s) [IsTrans α r] {a b c} (mem1 : a ∈ s) (mem2 : b ∈ s)
    (mem3 : c ∈ s) : ∃ (z : _) (_ : z ∈ s), r a z ∧ r b z ∧ r c z

{α : Type u_1}
{r : α → α → Prop}
{s : Set α}
[IsRefl α r]
(hchain : IsChain r s)
[IsTrans α r]
{a b c : α}
(mem1 : a ∈ s)
(mem2 : b ∈ s)
(mem3 : c ∈ s)

∃ z, ∃ (_ : z ∈ s), r a z ∧ r b z ∧ r c z


/-- This lemma says that `fun x => a ^ x` is strictly differentiable for `a < 0`. Note that these
values of `a` are outside of the "official" domain of `a ^ x`, and we may redefine `a ^ x`
for negative `a` if some other definition will be more convenient. -/
theorem hasStrictDerivAt_const_rpow_of_neg {a x : ℝ} (ha : a < 0) :
    HasStrictDerivAt (fun x => a ^ x) (a ^ x * log a - exp (log a * x) * sin (x * π) * π) x

HasStrictDerivAt (fun x => a ^ x) (a ^ x * Real.log a - rexp (Real.log a * x) * Real.sin (x * π) * π) x


/-- A Lie module yields a Lie algebra morphism into the linear endomorphisms of the module.

See also `LieModule.toModuleHom`. -/
@[simps]
def LieModule.toEnd : L →ₗ⁅R⁆ Module.End R M

(R : Type u)
(L : Type v)
(M : Type w)
[CommRing R]
[LieRing L]
[LieAlgebra R L]
[AddCommGroup M]
[Module R M]
[LieRingModule L M]
[LieModule R L M]
(x : L)
(m : M)


theorem det_vandermonde {n : ℕ} (v : Fin n → R) :
    det (vandermonde v) = ∏ i : Fin n, ∏ j ∈ Ioi i, (v j - v i)

{R : Type u_1}
[CommRing R]
{n : ℕ}
(v : Fin n → R)

(Matrix.vandermonde v).det = ∏ i : Fin n, ∏ j ∈ Finset.Ioi i, (v j - v i)


theorem sq_abs (z : ℂ) : Complex.abs z ^ 2 = normSq z


@[simp]
theorem irrational_inv_iff : Irrational x⁻¹ ↔ Irrational x


@[to_additive extend_nonneg] lemma one_le_extend (hg : 1 ≤ g) (he : 1 ≤ e) : 1 ≤ extend f g e

{α : Type u_3}
{β : Type u_4}
{γ : Type u_5}
[One γ]
[LE γ]
{f : α → β}
{g : α → γ}
{e : β → γ}
(hg : 1 ≤ g)
(he : 1 ≤ e)


protected theorem injective : Function.Injective e

{R : Type u_1}
{S : Type u_7}
{M : Type u_8}
{M₂ : Type u_10}
[Semiring R]
[Semiring S]
[AddCommMonoid M]
[AddCommMonoid M₂]
{module_M : Module R M}
{module_S_M₂ : Module S M₂}
{σ : R →+* S}
{σ' : S →+* R}
{re₁ : RingHomInvPair σ σ'}
{re₂ : RingHomInvPair σ' σ}
(e : M ≃ₛₗ[σ] M₂)


theorem ExistsUnique.exists {p : α → Prop} : (∃! x, p x) → ∃ x, p x


@[to_additive]
theorem closure_eq_of_le (h₁ : s ⊆ S) (h₂ : S ≤ closure s) : closure s = S

{M : Type u_1}
[Mul M]
{s : Set M}
{S : Subsemigroup M}
(h₁ : s ⊆ ↑S)
(h₂ : S ≤ Subsemigroup.closure s)


/-- The L-series of the von Mangoldt function `Λ` converges at `s` when `re s > 1`. -/
lemma LSeriesSummable_vonMangoldt {s : ℂ} (hs : 1 < s.re) : LSeriesSummable ↗Λ s

LSeriesSummable (fun n => ↑(ArithmeticFunction.vonMangoldt n)) s


theorem deriv_neg : deriv Neg.neg x = -1

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


/-- Construct a unit from limits of units and their inverses. -/
@[to_additive (attr := simps)
  "Construct an additive unit from limits of additive units and their negatives."]
def Filter.Tendsto.units [TopologicalSpace N] [Monoid N] [ContinuousMul N] [T2Space N]
    {f : ι → Nˣ} {r₁ r₂ : N} {l : Filter ι} [l.NeBot] (h₁ : Tendsto (fun x => ↑(f x)) l (𝓝 r₁))
    (h₂ : Tendsto (fun x => ↑(f x)⁻¹) l (𝓝 r₂)) : Nˣ

(h₁ : Filter.Tendsto (fun x => ↑(f x)) l (𝓝 r₁))

(h₂ : Filter.Tendsto (fun x => ↑(-f x)) l (𝓝 r₂))


@[ext]
theorem ext {f g : A ≃⋆ₐ[R] B} (h : ∀ a, f a = g a) : f = g

{R : Type u_2}
{A : Type u_3}
{B : Type u_4}
[Add A]
[Add B]
[Mul A]
[Mul B]
[SMul R A]
[SMul R B]
[Star A]
[Star B]
{f g : A ≃⋆ₐ[R] B}
(h : ∀ (a : A), f a = g a)


lemma cfc_apply_of_not_and {f : R → R} (a : A) (ha : ¬ (p a ∧ ContinuousOn f (spectrum R a))) :
    cfc f a = 0

(ha : ¬(p a ∧ ContinuousOn f (spectrum R a)))


theorem eventually_curry_iff {f : Filter α} {g : Filter β} {p : α × β → Prop} :
    (∀ᶠ x : α × β in f.curry g, p x) ↔ ∀ᶠ x : α in f, ∀ᶠ y : β in g, p (x, y)

{α : Type u_1}
{β : Type u_2}
{f : Filter α}
{g : Filter β}
{p : α × β → Prop}

(∀ᶠ (x : α × β) in f.curry g, p x) ↔ ∀ᶠ (x : α) in f, ∀ᶠ (y : β) in g, p (x, y)


@[simp] theorem add_imI : (a + b).imI = a.imI + b.imI

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


@[to_additive]
theorem Finset.prod_toFinset_eq_subtype {M : Type*} [CommMonoid M] [Fintype α] (p : α → Prop)
    [DecidablePred p] (f : α → M) : ∏ a ∈ { x | p x }.toFinset, f a = ∏ a : Subtype p, f a

{α : Type u_1}
{M : Type u_4}
[CommMonoid M]
[Fintype α]
(p : α → Prop)
[DecidablePred p]
(f : α → M)

∏ a ∈ {x | p x}.toFinset, f a = ∏ a : Subtype p, f ↑a


theorem ConvexOn.le_left_of_right_le' (hf : ConvexOn 𝕜 s f) {x y : E} (hx : x ∈ s) (hy : y ∈ s)
    {a b : 𝕜} (ha : 0 < a) (hb : 0 ≤ b) (hab : a + b = 1) (hfy : f y ≤ f (a • x + b • y)) :
    f (a • x + b • y) ≤ f x

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[LinearOrderedCancelAddCommMonoid β]
[SMul 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : ConvexOn 𝕜 s f)
{x y : E}
(hx : x ∈ s)
(hy : y ∈ s)
{a b : 𝕜}
(ha : 0 < a)
(hb : 0 ≤ b)
(hab : a + b = 1)
(hfy : f y ≤ f (a • x + b • y))


@[simp]
theorem refl_symm (X : C) : (Iso.refl X).symm = Iso.refl X

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

(CategoryTheory.Iso.refl X).symm = CategoryTheory.Iso.refl X


theorem size_shrink (a : Array α) (n) : (a.shrink n).size = min a.size n


theorem Dense.exists_countable_dense_subset {α : Type*} [TopologicalSpace α] {s : Set α}
    [SeparableSpace s] (hs : Dense s) : ∃ t ⊆ s, t.Countable ∧ Dense t

{α : Type u_1}
[TopologicalSpace α]
{s : Set α}
[TopologicalSpace.SeparableSpace ↑s]
(hs : Dense s)


theorem measure_support_lt_top_of_memℒp (f : α →ₛ E) (hf : Memℒp f p μ) (hp_ne_zero : p ≠ 0)
    (hp_ne_top : p ≠ ∞) : μ (support f) < ∞

{α : Type u_1}
{E : Type u_4}
[MeasurableSpace α]
[NormedAddCommGroup E]
{μ : MeasureTheory.Measure α}
{p : ℝ≥0∞}
(f : MeasureTheory.SimpleFunc α E)
(hf : MeasureTheory.Memℒp (↑f) p μ)
(hp_ne_zero : p ≠ 0)
(hp_ne_top : p ≠ ⊤)


/-- The type of co-Heyting homomorphisms from `α` to `β`. Bounded lattice homomorphisms that
preserve difference. -/
structure CoheytingHom (α β : Type*) [CoheytingAlgebra α] [CoheytingAlgebra β] extends
  LatticeHom α β where
  /-- The proposition that a co-Heyting homomorphism preserves the top element. -/
  protected map_top' : toFun ⊤ = ⊤
  /-- The proposition that a co-Heyting homomorphism preserves the difference operation. -/
  protected map_sdiff' : ∀ a b, toFun (a \ b) = toFun a \ toFun b

{α : Type u_6}
{β : Type u_7}
[CoheytingAlgebra α]
[CoheytingAlgebra β]
(self : CoheytingHom α β)
(a b : α)

self.toFun (a \ b) = self.toFun a \ self.toFun b


/-- The associator isomorphism for binary coproducts. -/
@[simps]
def coprod.associator (P Q R : C) : (P ⨿ Q) ⨿ R ≅ P ⨿ Q ⨿ R

(CategoryTheory.Limits.coprod.associator P Q R).hom =
  CategoryTheory.Limits.coprod.desc
    (CategoryTheory.Limits.coprod.desc CategoryTheory.Limits.coprod.inl
      (CategoryTheory.Limits.coprod.inl ≫ CategoryTheory.Limits.coprod.inr))
    (CategoryTheory.Limits.coprod.inr ≫ CategoryTheory.Limits.coprod.inr)


theorem chineseRemainder'_lt_lcm (h : a ≡ b [MOD gcd n m]) (hn : n ≠ 0) (hm : m ≠ 0) :
    ↑(chineseRemainder' h) < lcm n m

{m n a b : ℕ}
(h : a ≡ b [MOD n.gcd m])
(hn : n ≠ 0)
(hm : m ≠ 0)


private theorem newton_seq_deriv_norm (n : ℕ) :
    ‖F.derivative.eval (newton_seq n)‖ = ‖F.derivative.eval a‖

(hnorm : ‖Polynomial.eval a F‖ < ‖Polynomial.eval a (Polynomial.derivative F)‖ ^ 2)

‖Polynomial.eval (newton_seq_gen hnorm n) (Polynomial.derivative F)‖ = ‖Polynomial.eval a (Polynomial.derivative F)‖


theorem rpow_sub {x : ℝ} (hx : 0 < x) (y z : ℝ) : x ^ (y - z) = x ^ y / x ^ z


/-- If `oscillation f x < ε` at every `x` in a compact set `K`, then there exists `δ > 0` such
that the oscillation of `f` on `ball x δ` is less than `ε` for every `x` in `K`. -/
theorem uniform_oscillation [PseudoEMetricSpace E] {K : Set E} (comp : IsCompact K)
    {f : E → F} {ε : ENNReal} (hK : ∀ x ∈ K, oscillation f x < ε) :
    ∃ δ > 0, ∀ x ∈ K, diam (f '' (ball x (ENNReal.ofReal δ))) ≤ ε

{E : Type u}
{F : Type v}
[PseudoEMetricSpace F]
[PseudoEMetricSpace E]
{K : Set E}
(comp : IsCompact K)
{f : E → F}
{ε : ℝ≥0∞}
(hK : ∀ x ∈ K, oscillation f x < ε)

∃ δ > 0, ∀ x ∈ K, EMetric.diam (f '' EMetric.ball x (ENNReal.ofReal δ)) ≤ ε


theorem piecewise_mem_Icc' {s : Set ι} [∀ j, Decidable (j ∈ s)] {f₁ f₂ g₁ g₂ : ∀ i, α i}
    (h₁ : f₁ ∈ Icc g₁ g₂) (h₂ : f₂ ∈ Icc g₁ g₂) : s.piecewise f₁ f₂ ∈ Icc g₁ g₂

{ι : Type u_1}
{α : ι → Type u_2}
[(i : ι) → Preorder (α i)]
{s : Set ι}
[(j : ι) → Decidable (j ∈ s)]
{f₁ f₂ g₁ g₂ : (i : ι) → α i}
(h₁ : f₁ ∈ Set.Icc g₁ g₂)
(h₂ : f₂ ∈ Set.Icc g₁ g₂)


lemma isCompl_orthogonal_iff_disjoint (hB₀ : B.IsRefl) :
    IsCompl W (B.orthogonal W) ↔ Disjoint W (B.orthogonal W)

{V : Type u_5}
{K : Type u_6}
[Field K]
[AddCommGroup V]
[Module K V]
[FiniteDimensional K V]
{B : LinearMap.BilinForm K V}
{W : Submodule K V}
(hB₀ : B.IsRefl)


@[simp]
theorem sum_bernoulli' (n : ℕ) : (∑ k ∈ range n, (n.choose k : ℚ) * bernoulli' k) = n

∑ k ∈ Finset.range n, ↑(n.choose k) * bernoulli' k = ↑n


@[simp]
theorem Limit.w_apply' {F : J ⥤ Type v} {j j' : J} {x : limit F} (f : j ⟶ j') :
    F.map f (limit.π F j x) = limit.π F j' x

{J : Type v}
[CategoryTheory.Category.{w, v} J]
{F : J ⥤ Type v}
{j j' : J}
{x : CategoryTheory.Limits.limit F}
(f : j ⟶ j')

F.map f (CategoryTheory.Limits.limit.π F j x) = CategoryTheory.Limits.limit.π F j' x


@[simp]
theorem mem_subalgebraEquivIntermediateField [Algebra.IsAlgebraic K L] {S : Subalgebra K L}
    {x : L} : x ∈ subalgebraEquivIntermediateField S ↔ x ∈ S

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
[Algebra.IsAlgebraic K L]
{S : Subalgebra K L}
{x : L}


/-- A `c : ComplexShape ι` describes the shape of a chain complex,
with chain groups indexed by `ι`.
Typically `ι` will be `ℕ`, `ℤ`, or `Fin n`.

There is a relation `Rel : ι → ι → Prop`,
and we will only allow a non-zero differential from `i` to `j` when `Rel i j`.

There are axioms which imply `{ j // c.Rel i j }` and `{ i // c.Rel i j }` are subsingletons.
This means that the shape consists of some union of lines, rays, intervals, and circles.

Below we define `c.next` and `c.prev` which provide these related elements.
-/
@[ext]
structure ComplexShape (ι : Type*) where
  /-- Nonzero differentials `X i ⟶ X j` shall be allowed
    on homological complexes when `Rel i j` holds. -/
  Rel : ι → ι → Prop
  /-- There is at most one nonzero differential from `X i`. -/
  next_eq : ∀ {i j j'}, Rel i j → Rel i j' → j = j'
  /-- There is at most one nonzero differential to `X j`. -/
  prev_eq : ∀ {i i' j}, Rel i j → Rel i' j → i = i'

{ι : Type u_1}
(self : ComplexShape ι)
{i i' j : ι}


/-- Bundle `cfc f a` into a unit given a proof that `f` is nonzero on the spectrum of `a`. -/
@[simps]
noncomputable def cfcUnits (hf' : ∀ x ∈ spectrum R a, f x ≠ 0)
    (hf : ContinuousOn f (spectrum R a) := by cfc_cont_tac) (ha : p a := by cfc_tac) : Aˣ


theorem zero_cpow_eq_nhds {b : ℂ} (hb : b ≠ 0) : (fun x : ℂ => (0 : ℂ) ^ x) =ᶠ[𝓝 b] 0


@[to_additive (attr := mono)]
theorem div_subset_div : s₁ ⊆ t₁ → s₂ ⊆ t₂ → s₁ / s₂ ⊆ t₁ / t₂

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

s₁ ⊆ t₁ → s₂ ⊆ t₂ → s₁ / s₂ ⊆ t₁ / t₂


theorem ncard_le_ncard_diff_add_ncard (s t : Set α) (ht : t.Finite := by toFinite_tac) :
    s.ncard ≤ (s \ t).ncard + t.ncard

{α : Type u_1}
(s t : Set α)
(ht : t.Finite := by toFinite_tac)


theorem commutator_subset_ker : commutator G ≤ f.ker

{G : Type u}
[Group G]
{A : Type v}
[CommGroup A]
(f : G →* A)


@[to_additive (attr := continuity, fun_prop)]
theorem Continuous.zpow {f : α → G} (h : Continuous f) (z : ℤ) : Continuous fun b => f b ^ z

{G : Type w}
{α : Type u}
[TopologicalSpace G]
[AddGroup G]
[TopologicalAddGroup G]
[TopologicalSpace α]
{f : α → G}
(h : Continuous f)
(z : ℤ)


lemma map_of_epi_of_preservesCokernel (hS : S.Exact) (F : C ⥤ D)
    [F.PreservesZeroMorphisms] [(S.map F).HasHomology] (_ : Epi S.g)
    (_ : PreservesColimit (parallelPair S.f 0) F) :
    (S.map F).Exact

{C : Type u_1}
{D : Type u_2}
[CategoryTheory.Category.{u_3, u_1} C]
[CategoryTheory.Category.{u_4, u_2} D]
[CategoryTheory.Preadditive C]
[CategoryTheory.Preadditive D]
{S : CategoryTheory.ShortComplex C}
[CategoryTheory.Balanced C]
(hS : S.Exact)
(F : CategoryTheory.Functor C D)
[F.PreservesZeroMorphisms]
[(S.map F).HasHomology]

CategoryTheory.Epi S.g →
  CategoryTheory.Limits.PreservesColimit (CategoryTheory.Limits.parallelPair S.f 0) F → (S.map F).Exact


protected theorem forall₃_congr
    {α₁ α₂ β₁ β₂ γ₁ γ₂ : Sort*} {p : α₁ → β₁ → γ₁ → Prop} {q : α₂ → β₂ → γ₂ → Prop}
    (eα : α₁ ≃ α₂) (eβ : β₁ ≃ β₂) (eγ : γ₁ ≃ γ₂) (h : ∀ {x y z}, p x y z ↔ q (eα x) (eβ y) (eγ z)) :
    (∀ x y z, p x y z) ↔ ∀ x y z, q x y z

{p : α₁ → β₁ → γ₁ → Prop}

{q : α₂ → β₂ → γ₂ → Prop}

(eα : α₁ ≃ α₂)

(eβ : β₁ ≃ β₂)

(eγ : γ₁ ≃ γ₂)

(h : ∀ {x : α₁} {y : β₁} {z : γ₁}, p x y z ↔ q (eα x) (eβ y) (eγ z))

(∀ (x : α₁) (y : β₁) (z : γ₁), p x y z) ↔ ∀ (x : α₂) (y : β₂) (z : γ₂), q x y z


theorem div_le_iff (hb : 0 < b) : a / b ≤ c ↔ a ≤ c * b

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


@[simp] lemma univ_disjoint : Disjoint univ s ↔ s = ∅


theorem ConcaveOn.right_le_of_le_left' (hf : ConcaveOn 𝕜 s f) {x y : E} {a b : 𝕜} (hx : x ∈ s)
    (hy : y ∈ s) (ha : 0 ≤ a) (hb : 0 < b) (hab : a + b = 1) (hfx : f (a • x + b • y) ≤ f x) :
    f y ≤ f (a • x + b • y)

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_5}
[OrderedSemiring 𝕜]
[AddCommMonoid E]
[LinearOrderedCancelAddCommMonoid β]
[SMul 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : ConcaveOn 𝕜 s f)
{x y : E}
{a b : 𝕜}
(hx : x ∈ s)
(hy : y ∈ s)
(ha : 0 ≤ a)
(hb : 0 < b)
(hab : a + b = 1)
(hfx : f (a • x + b • y) ≤ f x)


theorem HasFiniteFPowerSeriesOnBall.sub (hf : HasFiniteFPowerSeriesOnBall f pf x n r)
    (hg : HasFiniteFPowerSeriesOnBall g pg x m r) :
    HasFiniteFPowerSeriesOnBall (f - g) (pf - pg) x (max n m) r


@[simp]
theorem spanNorm_eq (I : Ideal S) : spanNorm R I = relNorm R I

(R : Type u_1)
[CommRing R]
{S : Type u_2}
[CommRing S]
[Algebra R S]
[IsDomain R]
[IsDomain S]
[IsDedekindDomain R]
[IsDedekindDomain S]
[Module.Finite R S]
[Module.Free R S]
(I : Ideal S)

Ideal.spanNorm R I = (Ideal.relNorm R) I


@[simp] theorem mul_div_right (n : Nat) {m : Nat} (H : 0 < m) : m * n / m = n


/-- Class for bundled homs. Note that the arguments order follows that of lemmas for `MonoidHom`.
This way we can use `⟨@MonoidHom.toFun, @MonoidHom.id ...⟩` in an instance. -/
structure BundledHom where
  /-- the underlying map of a bundled morphism -/
  toFun : ∀ {α β : Type u} (Iα : c α) (Iβ : c β), hom Iα Iβ → α → β
  /-- the identity as a bundled morphism -/
  id : ∀ {α : Type u} (I : c α), hom I I
  /-- composition of bundled morphisms -/
  comp : ∀ {α β γ : Type u} (Iα : c α) (Iβ : c β) (Iγ : c γ), hom Iβ Iγ → hom Iα Iβ → hom Iα Iγ
  /-- a bundled morphism is determined by the underlying map -/
  hom_ext : ∀ {α β : Type u} (Iα : c α) (Iβ : c β), Function.Injective (toFun Iα Iβ) := by
   aesop_cat
  /-- compatibility with identities -/
  id_toFun : ∀ {α : Type u} (I : c α), toFun I I (id I) = _root_.id := by aesop_cat
  /-- compatibility with the composition -/
  comp_toFun :
    ∀ {α β γ : Type u} (Iα : c α) (Iβ : c β) (Iγ : c γ) (f : hom Iα Iβ) (g : hom Iβ Iγ),
      toFun Iα Iγ (comp Iα Iβ Iγ g f) = toFun Iβ Iγ g ∘ toFun Iα Iβ f := by
   aesop_cat

{hom : ⦃α β : Type u⦄ → c α → c β → Type u}


/-- The 1 of the quotient of a monoid by a congruence relation is the equivalence class of the
    monoid's 1. -/
@[to_additive (attr := simp) "The 0 of the quotient of an `AddMonoid` by an additive congruence
relation is the equivalence class of the `AddMonoid`'s 0."]
theorem coe_one : ((1 : M) : c.Quotient) = 1

{M : Type u_1}
[AddZeroClass M]
{c : AddCon M}


theorem le_restrict_apply (s t : Set α) : μ (t ∩ s) ≤ μ.restrict s t

{α : Type u_2}
{m0 : MeasurableSpace α}
{μ : MeasureTheory.Measure α}
(s t : Set α)


/-- If a `NonUnitalSubalgebra` over a field does not contain `1`, then its unitization is
isomorphic to its `Algebra.adjoin`. -/
@[simps! apply_coe]
noncomputable def unitizationAlgEquiv (h1 : (1 : A) ∉ s) :
    Unitization R s ≃ₐ[R] Algebra.adjoin R (s : Set A)

{R : Type u_1}
{S : Type u_2}
{A : Type u_3}
[Field R]
[Ring A]
[Algebra R A]
[SetLike S A]
[hSA : NonUnitalSubringClass S A]
[hSRA : SMulMemClass S R A]
(s : S)
(h1 : 1 ∉ s)
(a : Unitization R ↥s)

↑((NonUnitalSubalgebra.unitizationAlgEquiv s h1) a) = (algebraMap R A) a.fst + ↑a.snd


theorem comap_gauge_nhds_zero (hb : Bornology.IsVonNBounded ℝ s) (h₀ : s ∈ 𝓝 0) :
    comap (gauge s) (𝓝 0) = 𝓝 0

{E : Type u_2}
[AddCommGroup E]
[Module ℝ E]
{s : Set E}
[TopologicalSpace E]
[ContinuousSMul ℝ E]
(hb : Bornology.IsVonNBounded ℝ s)
(h₀ : s ∈ 𝓝 0)


lemma mapHomologyIso'_eq_mapHomologyIso [S.HasHomology] [F.PreservesLeftHomologyOf S]
    [F.PreservesRightHomologyOf S] :
    S.mapHomologyIso' F = S.mapHomologyIso F


theorem _root_.SimpleGraph.componentComplMk_mem_hom
    (G : SimpleGraph V) {v : V} (vK : v ∉ K) (h : L ⊆ K) :
    v ∈ (G.componentComplMk vK).hom h

{V : Type u}
{K L : Set V}
(G : SimpleGraph V)
{v : V}
(vK : v ∉ K)
(h : L ⊆ K)

v ∈ SimpleGraph.ComponentCompl.hom h (G.componentComplMk vK)


@[simp]
theorem lift_cons {C} [Category C] (φ : V ⥤q C) {X Y Z : V} (p : Quiver.Path X Y) (f : Y ⟶ Z) :
    (lift φ).map (p.cons f) = (lift φ).map p ≫ φ.map f

{V : Type u₁}
[Quiver V]
{C : Type u_1}
[CategoryTheory.Category.{u_2, u_1} C]
(φ : V ⥤q C)
{X Y Z : V}
(p : Quiver.Path X Y)
(f : Y ⟶ Z)

(CategoryTheory.Paths.lift φ).map (p.cons f) =
  CategoryTheory.CategoryStruct.comp ((CategoryTheory.Paths.lift φ).map p) (φ.map f)


@[to_additive (attr := simp)]
theorem le_mul_iff : h ≤ f * g ↔ ∀ ⦃s⦄, s ∈ f → ∀ ⦃t⦄, t ∈ g → s * t ∈ h

{α : Type u_2}
[Add α]
{f g h : Filter α}

h ≤ f + g ↔ ∀ ⦃s : Set α⦄, s ∈ f → ∀ ⦃t : Set α⦄, t ∈ g → s + t ∈ h


theorem eval₂_modByMonic_eq_self_of_root [CommRing S] {f : R →+* S} {p q : R[X]} (hq : q.Monic)
    {x : S} (hx : q.eval₂ f x = 0) : (p %ₘ q).eval₂ f x = p.eval₂ f x

{R : Type u}
{S : Type v}
[CommRing R]
[CommRing S]
{f : R →+* S}
{p q : R[X]}
(hq : q.Monic)
{x : S}
(hx : Polynomial.eval₂ f x q = 0)

Polynomial.eval₂ f x (p %ₘ q) = Polynomial.eval₂ f x p


@[simp]
theorem sym_smul {R : Type*} [SMul R α] (c : R) (a : α) : sym (c • a) = c • sym a

{α : Type u_1}
{R : Type u_2}
[SMul R α]
(c : R)
(a : α)


@[to_additive]
protected theorem mul_eq_one_iff : s * t = 1 ↔ ∃ a b, s = {a} ∧ t = {b} ∧ a * b = 1

{α : Type u_2}
[SubtractionMonoid α]
{s t : Set α}

s + t = 0 ↔ ∃ a b, s = {a} ∧ t = {b} ∧ a + b = 0


@[to_additive (attr := simp)]
theorem div_pure : f / pure b = f.map (· / b)

{α : Type u_2}
[Div α]
{f : Filter α}
{b : α}

f / pure b = Filter.map (fun x => x / b) f


@[simp]
theorem one_lt_cosh : 1 < cosh x ↔ x ≠ 0


theorem pow_ne_top (h : a ≠ ∞) {n : ℕ} : a ^ n ≠ ∞


@[simp]
theorem lift_restrict : lift (restrict h) = F

{K : Type u_1}
{L : Type u_2}
[Field K]
[Field L]
[Algebra K L]
{F E : IntermediateField K L}
(h : F ≤ E)

IntermediateField.lift (IntermediateField.restrict h) = F


/-- **Maximum principle** for convex functions. If a function `f` is convex on the convex hull of
`s`, then the eventual maximum of `f` on `convexHull 𝕜 s` lies in `s`. -/
theorem ConvexOn.exists_ge_of_mem_convexHull (hf : ConvexOn 𝕜 (convexHull 𝕜 s) f) {x}
    (hx : x ∈ convexHull 𝕜 s) : ∃ y ∈ s, f x ≤ f y

{𝕜 : Type u_1}
{E : Type u_2}
{β : Type u_4}
[LinearOrderedField 𝕜]
[AddCommGroup E]
[LinearOrderedAddCommGroup β]
[Module 𝕜 E]
[Module 𝕜 β]
[OrderedSMul 𝕜 β]
{s : Set E}
{f : E → β}
(hf : ConvexOn 𝕜 ((convexHull 𝕜) s) f)
{x : E}
(hx : x ∈ (convexHull 𝕜) s)


theorem quasiMeasurePreserving_hasPDF' [IsFiniteMeasure ℙ] [SigmaFinite ν] {X : Ω → E}
    [HasPDF X ℙ μ] (hX : AEMeasurable X ℙ) {g : E → F} (hg : QuasiMeasurePreserving g μ ν) :
    HasPDF (g ∘ X) ℙ ν

(hg : MeasureTheory.Measure.QuasiMeasurePreserving g μ ν)


theorem Finset.support_sum_subset [AddCommMonoid M] (s : Finset (ι →₀ M)) :
    (s.sum id).support ⊆ Finset.sup s Finsupp.support

{ι : Type u_1}
{M : Type u_2}
[DecidableEq ι]
[AddCommMonoid M]
(s : Finset (ι →₀ M))

(s.sum id).support ⊆ s.sup Finsupp.support


@[to_additive (attr := simp)]
theorem lift_inl_inr : lift (inl : M →* M ∗ N) inr = .id _

{M : Type u_1}
{N : Type u_2}
[Monoid M]
[Monoid N]

Monoid.Coprod.lift Monoid.Coprod.inl Monoid.Coprod.inr = MonoidHom.id (Monoid.Coprod M N)


theorem _root_.Memℓp.star_mem {f : ∀ i, E i} (hf : Memℓp f p) : Memℓp (star f) p

{α : Type u_1}
{E : α → Type u_2}
{p : ℝ≥0∞}
[(i : α) → NormedAddCommGroup (E i)]
[(i : α) → StarAddMonoid (E i)]
[∀ (i : α), NormedStarGroup (E i)]
{f : (i : α) → E i}
(hf : Memℓp f p)


/-- The inner product of a vector with a multiple of itself. -/
theorem real_inner_smul_self_left (x : F) (r : ℝ) : ⟪r • x, x⟫_ℝ = r * (‖x‖ * ‖x‖)

{F : Type u_3}
[NormedAddCommGroup F]
[InnerProductSpace ℝ F]
(x : F)
(r : ℝ)


theorem Fintype.prod_dvd_of_coprime [Fintype I] (Hs : Pairwise (IsCoprime on s))
    (Hs1 : ∀ i, s i ∣ z) : (∏ x, s x) ∣ z

{R : Type u}
{I : Type v}
[CommSemiring R]
{z : R}
{s : I → R}
[Fintype I]
(Hs : Pairwise (IsCoprime on s))
(Hs1 : ∀ (i : I), s i ∣ z)


theorem even_tail (s : Stream' α) : even (tail s) = odd s


theorem left_cancel (x : R) {y y' : R} : x ◃ y = x ◃ y' ↔ y = y'

{R : Type u_1}
[Rack R]
(x : R)
{y y' : R}


/-- If `R` is a Jacobson ring, then maximal ideals in the localization at `y`
correspond to maximal ideals in the original ring `R` that don't contain `y`.
This lemma gives the correspondence in the particular case of an ideal and its comap.
See `le_relIso_of_maximal` for the more general relation isomorphism -/
theorem isMaximal_iff_isMaximal_disjoint [H : IsJacobson R] (J : Ideal S) :
    J.IsMaximal ↔ (comap (algebraMap R S) J).IsMaximal ∧ y ∉ Ideal.comap (algebraMap R S) J

{R : Type u_1}
(S : Type u_2)
[CommRing R]
[CommRing S]
(y : R)
[Algebra R S]
[IsLocalization.Away y S]
[H : Ideal.IsJacobson R]
(J : Ideal S)

J.IsMaximal ↔ (Ideal.comap (algebraMap R S) J).IsMaximal ∧ y ∉ Ideal.comap (algebraMap R S) J


protected theorem smul_add (r : R₁) (x y : ⨂[R] i, s i) : r • (x + y) = r • x + r • y

{ι : Type u_1}
{R : Type u_4}
[CommSemiring R]
{R₁ : Type u_5}
{s : ι → Type u_7}
[(i : ι) → AddCommMonoid (s i)]
[(i : ι) → Module R (s i)]
[Monoid R₁]
[DistribMulAction R₁ R]
[SMulCommClass R₁ R R]
(r : R₁)
(x y : PiTensorProduct R fun i => s i)


lemma div_re (z w : ℂ) : (z / w).re = z.re * w.re / normSq w + z.im * w.im / normSq w

(z / w).re = z.re * w.re / Complex.normSq w + z.im * w.im / Complex.normSq w


theorem infsep_le_dist_of_mem (hx : x ∈ s) (hy : y ∈ s) (hxy : x ≠ y) : s.infsep ≤ dist x y

{α : Type u_1}
[PseudoMetricSpace α]
{x y : α}
{s : Set α}
(hx : x ∈ s)
(hy : y ∈ s)
(hxy : x ≠ y)


/-- Given a homology map data for a morphism `φ`, this is the induced homology
map data for `a • φ`. -/
@[simps]
def smul (a : R) : HomologyMapData (a • φ) h₁ h₂

(γ : CategoryTheory.ShortComplex.HomologyMapData φ h₁ h₂)


/-- `ofTensorProduct` is functorial in `M`. -/
lemma ofTensorProduct_naturality (f : M →ₗ[R] N) :
    map I f ∘ₗ ofTensorProduct I M =
      ofTensorProduct I N ∘ₗ AlgebraTensorModule.map LinearMap.id f

{R : Type u_1}
[CommRing R]
(I : Ideal R)
{M : Type u_2}
[AddCommGroup M]
[Module R M]
{N : Type u_3}
[AddCommGroup N]
[Module R N]
(f : M →ₗ[R] N)

AdicCompletion.map I f ∘ₗ AdicCompletion.ofTensorProduct I M =
  AdicCompletion.ofTensorProduct I N ∘ₗ TensorProduct.AlgebraTensorModule.map LinearMap.id f


theorem eraseLead_support_card_lt (h : f ≠ 0) : (eraseLead f).support.card < f.support.card

{R : Type u_1}
[Semiring R]
{f : R[X]}
(h : f ≠ 0)


@[simp, norm_cast] lemma down_ratCast [RatCast α] (q : ℚ) : down (q : ULift α) = q


theorem seq_eq_bind_map {α β : Type u} [Monad m] [LawfulMonad m] (f : m (α → β)) (x : m α) : f <*> x = f >>= (. <$> x)

{m : Type u → Type u_1}
{α β : Type u}
[Monad m]
[LawfulMonad m]
(f : m (α → β))
(x : m α)

(Seq.seq f fun x_1 => x) = do
  let x_1 ← f
  x_1 <$> x


@[to_additive]
protected theorem mul_le_mul_iff_left [Mul α] [CovariantClass α α (· * ·) (· ≤ ·)] {a b c : α}
    (ha : MulLECancellable a) : a * b ≤ a * c ↔ b ≤ c

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


/-- An `AddTorsor G P` gives a structure to the nonempty type `P`,
acted on by an `AddGroup G` with a transitive and free action given
by the `+ᵥ` operation and a corresponding subtraction given by the
`-ᵥ` operation. In the case of a vector space, it is an affine
space. -/
class AddTorsor (G : outParam Type*) (P : Type*) [AddGroup G] extends AddAction G P,
  VSub G P where
  [nonempty : Nonempty P]
  /-- Torsor subtraction and addition with the same element cancels out. -/
  vsub_vadd' : ∀ p₁ p₂ : P, (p₁ -ᵥ p₂ : G) +ᵥ p₂ = p₁
  /-- Torsor addition and subtraction with the same element cancels out. -/
  vadd_vsub' : ∀ (g : G) (p : P), g +ᵥ p -ᵥ p = g

{G : outParam (Type u_1)}
{P : Type u_2}
[AddGroup G]
[self : AddTorsor G P]
(p₁ p₂ : P)


theorem insert_subset (ha : a ∈ t) (hs : s ⊆ t) : insert a s ⊆ t

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


theorem lf_of_fuzzy {x y : PGame} (h : x ‖ y) : x ⧏ y


@[simp]
theorem zero'_eval : zero'.eval = fun v => pure (0 :: v)

Turing.ToPartrec.Code.zero'.eval = fun v => pure (0 :: v)


theorem isBigOWith_of_le (hfg : ∀ x, ‖f x‖ ≤ ‖g x‖) : IsBigOWith 1 l f g

{α : Type u_1}
{E : Type u_3}
{F : Type u_4}
[Norm E]
[Norm F]
{f : α → E}
{g : α → F}
(l : Filter α)
(hfg : ∀ (x : α), ‖f x‖ ≤ ‖g x‖)


/-- Extract the equation from a 2-morphism in a locally discrete 2-category. -/
theorem eq_of_hom {X Y : LocallyDiscrete C} {f g : X ⟶ Y} (η : f ⟶ g) : f = g

{X Y : CategoryTheory.LocallyDiscrete C}


theorem back_eq (s : String) : back s = s.1.getLastD default


theorem isSatisfiable_directed_union_iff {ι : Type*} [Nonempty ι] {T : ι → L.Theory}
    (h : Directed (· ⊆ ·) T) : Theory.IsSatisfiable (⋃ i, T i) ↔ ∀ i, (T i).IsSatisfiable

{L : FirstOrder.Language}
{ι : Type u_1}
[Nonempty ι]
{T : ι → L.Theory}
(h : Directed (fun x x_1 => x ⊆ x_1) T)

FirstOrder.Language.Theory.IsSatisfiable (⋃ i, T i) ↔ ∀ (i : ι), (T i).IsSatisfiable


theorem seminorm_one_eq_one_iff_ne_zero (hp : p 1 ≤ 1) : p 1 = 1 ↔ p ≠ 0

{R : Type u_2}
[Ring R]
(p : RingSeminorm R)
(hp : p 1 ≤ 1)


theorem mem_nhds_subtype_iff_nhdsWithin {s : Set α} {a : s} {t : Set s} :
    t ∈ 𝓝 a ↔ (↑) '' t ∈ 𝓝[s] (a : α)

{α : Type u_1}
[TopologicalSpace α]
{s : Set α}
{a : ↑s}
{t : Set ↑s}


@[to_additive abs_add_eq_two_nsmul_posPart]
lemma mabs_mul_eq_oneLePart_sq (a : α) : |a|ₘ * a = a⁺ᵐ ^ 2

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


theorem norm_le_of_nonempty [Nonempty α] {M : ℝ} : ‖f‖ ≤ M ↔ ∀ x, ‖f x‖ ≤ M

{α : Type u_1}
{E : Type u_3}
[TopologicalSpace α]
[CompactSpace α]
[NormedAddCommGroup E]
(f : C(α, E))
[Nonempty α]
{M : ℝ}


theorem eventually_measure_mul_le_scalingConstantOf_mul (K : ℝ) :
    ∃ R : ℝ,
      0 < R ∧
        ∀ x t r, t ∈ Ioc 0 K → r ≤ R →
          μ (closedBall x (t * r)) ≤ scalingConstantOf μ K * μ (closedBall x r)

{α : Type u_1}
[MetricSpace α]
[MeasurableSpace α]
(μ : MeasureTheory.Measure α)
[IsUnifLocDoublingMeasure μ]
(K : ℝ)

∃ R,
  0 < R ∧
    ∀ (x : α) (t r : ℝ),
      t ∈ Set.Ioc 0 K →
        r ≤ R →
          μ (Metric.closedBall x (t * r)) ≤
            ↑(IsUnifLocDoublingMeasure.scalingConstantOf μ K) * μ (Metric.closedBall x r)


theorem _root_.AlgHom.ker_kerSquareLift (f : A →ₐ[R] B) :
    RingHom.ker f.kerSquareLift.toRingHom = f.toRingHom.ker.cotangentIdeal

{R : Type u}
[CommRing R]
{A : Type u_1}
{B : Type u_2}
[CommRing A]
[CommRing B]
[Algebra R A]
[Algebra R B]
(f : A →ₐ[R] B)

RingHom.ker f.kerSquareLift.toRingHom = (RingHom.ker f.toRingHom).cotangentIdeal


theorem differentiable_cos : Differentiable ℝ cos


@[to_additive]
theorem norm_mul_le_of_le (h₁ : ‖a₁‖ ≤ r₁) (h₂ : ‖a₂‖ ≤ r₂) : ‖a₁ * a₂‖ ≤ r₁ + r₂

{E : Type u_6}
[SeminormedGroup E]
{a₁ a₂ : E}
{r₁ r₂ : ℝ}
(h₁ : ‖a₁‖ ≤ r₁)
(h₂ : ‖a₂‖ ≤ r₂)

‖a₁ * a₂‖ ≤ r₁ + r₂


@[simp]
theorem coe_add : ⇑(X + Y) = X + Y

{𝕜 : Type u_1}
[NontriviallyNormedField 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[NormedSpace 𝕜 E]
{H : Type u_3}
[TopologicalSpace H]
{I : ModelWithCorners 𝕜 E H}
{G : Type u_4}
[TopologicalSpace G]
[ChartedSpace H G]
[Monoid G]
[SmoothMul I G]
(X Y : LeftInvariantDerivation I G)


@[simp] theorem true_bne  : ∀(b : Bool), (true  != b) = !b


theorem NNReal.tendsto_pow_atTop_nhds_zero_of_lt_one {r : ℝ≥0} (hr : r < 1) :
    Tendsto (fun n : ℕ ↦ r ^ n) atTop (𝓝 0)

Filter.Tendsto (fun n => r ^ n) Filter.atTop (𝓝 0)


/-- The product over `univ` of a sum can be written as a sum over the product of sets,
`Fintype.piFinset`. `Finset.prod_sum` is an alternative statement when the product is not
over `univ`. -/
lemma prod_univ_sum [Fintype ι] (t : ∀ i, Finset (κ i)) (f : ∀ i, κ i → α) :
    ∏ i, ∑ j ∈ t i, f i j = ∑ x ∈ piFinset t, ∏ i, f i (x i)

{ι : Type u_1}
{α : Type u_2}
{κ : ι → Type u_5}
[CommSemiring α]
[DecidableEq ι]
[Fintype ι]
(t : (i : ι) → Finset (κ i))
(f : (i : ι) → κ i → α)

∏ i : ι, ∑ j ∈ t i, f i j = ∑ x ∈ Fintype.piFinset t, ∏ i : ι, f i (x i)


/-- We can shrink `A` to any smaller size. -/
@[deprecated exists_subset_card_eq (since := "2024-06-23")]
theorem exists_smaller_set (A : Finset α) (i : ℕ) (h₁ : i ≤ card A) :
    ∃ B : Finset α, B ⊆ A ∧ card B = i

{α : Type u_1}
(A : Finset α)
(i : ℕ)
(h₁ : i ≤ A.card)


theorem smul_continuousOn [LocallyCompactSpace X] [T2Space X] {𝕜 : Type*} [NormedField 𝕜]
    [SecondCountableTopologyEither X E] [NormedSpace 𝕜 E] {f : X → 𝕜} {g : X → E} {s : Set X}
    (hs : IsOpen s) (hf : LocallyIntegrableOn f s μ) (hg : ContinuousOn g s) :
    LocallyIntegrableOn (fun x => f x • g x) s μ

(hf : MeasureTheory.LocallyIntegrableOn f s μ)

MeasureTheory.LocallyIntegrableOn (fun x => f x • g x) s μ


lemma mul_right_injective_of_invertible [Invertible A] :
    Function.Injective (fun (x : Matrix n m α) => A * x)

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


/-- The mutual orthogonal complement of the eigenspaces of a self-adjoint operator on an inner
product space has no eigenvalues. -/
theorem orthogonalComplement_iSup_eigenspaces (μ : 𝕜) :
    eigenspace (T.restrict hT.orthogonalComplement_iSup_eigenspaces_invariant) μ = ⊥

{𝕜 : Type u_1}
[RCLike 𝕜]
{E : Type u_2}
[NormedAddCommGroup E]
[InnerProductSpace 𝕜 E]
{T : E →ₗ[𝕜] E}
(hT : T.IsSymmetric)
(μ : 𝕜)

Module.End.eigenspace (T.restrict ⋯) μ = ⊥


@[simp]
theorem coe_bot : (↑(⊥ : Compacts α) : Set α) = ∅


theorem right_inv (M : Matrix n n A) : (toFunAlgHom R A n) (invFun R A n M) = M

(R : Type u)
[CommSemiring R]
(A : Type v)
[Semiring A]
[Algebra R A]
(n : Type w)
[DecidableEq n]
[Fintype n]
(M : Matrix n n A)

(MatrixEquivTensor.toFunAlgHom R A n) (MatrixEquivTensor.invFun R A n M) = M


/-- The inclusion of an empty language into any other language. -/
@[simps]
protected def ofIsEmpty [L.IsAlgebraic] [L.IsRelational] : L →ᴸ L'

(L : FirstOrder.Language)
(L' : FirstOrder.Language)
[L.IsAlgebraic]
[L.IsRelational]
(n : ℕ)
(a : L.Relations n)

(FirstOrder.Language.LHom.ofIsEmpty L L').onRelation a = ⋯.elim a


theorem toZ_of_ge (hi : i0 ≤ i) : toZ i0 i = Nat.find (exists_succ_iterate_of_le hi)

{ι : Type u_1}
[LinearOrder ι]
[SuccOrder ι]
[IsSuccArchimedean ι]
[PredOrder ι]
{i0 i : ι}
(hi : i0 ≤ i)


theorem derivativeFun_C (r : R) : derivativeFun (C R r) = 0


@[simp] lemma attach_nil : ([] : List α).attach = []


theorem eq_on_inv₀ [MonoidWithZeroHomClass F' G₀ M₀'] (f g : F') (h : f a = g a) :
    f a⁻¹ = g a⁻¹

{G₀ : Type u_3}
{M₀' : Type u_4}
{F' : Type u_7}
[GroupWithZero G₀]
[MonoidWithZero M₀']
[FunLike F' G₀ M₀']
{a : G₀}
[MonoidWithZeroHomClass F' G₀ M₀']
(f g : F')
(h : f a = g a)


@[norm_cast]
theorem coe_negPart (f : α →₁ₛ[μ] ℝ) : (negPart f : α →₁[μ] ℝ) = Lp.negPart (f : α →₁[μ] ℝ)

(f : ↥(MeasureTheory.Lp.simpleFunc ℝ 1 μ))

↑(MeasureTheory.L1.SimpleFunc.negPart f) = MeasureTheory.Lp.negPart ↑f


theorem setIntegral_mono_on_ae (hs : MeasurableSet s) (h : ∀ᵐ x ∂μ, x ∈ s → f x ≤ g x) :
    ∫ x in s, f x ∂μ ≤ ∫ x in s, g x ∂μ

{X : Type u_1}
[MeasurableSpace X]
{μ : MeasureTheory.Measure X}
{f g : X → ℝ}
{s : Set X}
(hf : MeasureTheory.IntegrableOn f s μ)
(hg : MeasureTheory.IntegrableOn g s μ)
(hs : MeasurableSet s)
(h : ∀ᵐ (x : X) ∂μ, x ∈ s → f x ≤ g x)

∫ (x : X) in s, f x ∂μ ≤ ∫ (x : X) in s, g x ∂μ


@[to_additive]
theorem smul_oreDiv_one (r : R) (x : X) : r • (x /ₒ (1 : S)) = (r • x) /ₒ (1 : S)

{R : Type u_1}
{M : Type u_3}
{X : Type u_4}
[AddMonoid M]
{S : AddSubmonoid M}
[AddOreLocalization.AddOreSet S]
[AddAction M X]
[VAdd R X]
[VAdd R M]
[VAddAssocClass R M M]
[VAddAssocClass R M X]
(r : R)
(x : X)


theorem AddSubsemigroup.toSubsemigroup_closure (S : Set A) :
    AddSubsemigroup.toSubsemigroup (AddSubsemigroup.closure S) =
      Subsemigroup.closure (Multiplicative.toAdd ⁻¹' S)

AddSubsemigroup.toSubsemigroup (AddSubsemigroup.closure S) = Subsemigroup.closure (⇑Multiplicative.toAdd ⁻¹' S)


theorem zero_mul_subset (s : Set α) : 0 * s ⊆ 0

{α : Type u_2}
[MulZeroClass α]
(s : Set α)


theorem map_nhdsWithin (f : α → β) (a : α) (s : Set α) :
    map f (𝓝[s] a) = ⨅ t ∈ { t : Set α | a ∈ t ∧ IsOpen t }, 𝓟 (f '' (t ∩ s))

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

Filter.map f (𝓝[s] a) = ⨅ t ∈ {t | a ∈ t ∧ IsOpen t}, 𝓟 (f '' (t ∩ s))


@[scoped simp]
theorem map_nat' [AddMonoidWithOne G] [AddMonoid H] [AddConstMapClass F G H 1 b]
    (f : F) (n : ℕ) : f n = f 0 + n • b

{F : Type u_1}
{G : Type u_2}
{H : Type u_3}
[FunLike F G H]
{b : H}
[AddMonoidWithOne G]
[AddMonoid H]
[AddConstMapClass F G H 1 b]
(f : F)
(n : ℕ)


@[to_additive (attr := simp)]
theorem one_mul : ∀ a : M, 1 * a = a


theorem evalFacProps {l : Products I} (J K : I → Prop)
    (h : ∀ a, a ∈ l.val → J a) [∀ j, Decidable (J j)] [∀ j, Decidable (K j)]
    (hJK : ∀ i, J i → K i) :
    l.eval (π C J) ∘ ProjRestricts C hJK = l.eval (π C K)

{l : Profinite.NobelingProof.Products I}

⇑(Profinite.NobelingProof.Products.eval (Profinite.NobelingProof.π C J) l) ∘
    Profinite.NobelingProof.ProjRestricts C hJK =
  ⇑(Profinite.NobelingProof.Products.eval (Profinite.NobelingProof.π C K) l)


theorem rdropWhile_concat (x : α) :
    rdropWhile p (l ++ [x]) = if p x then rdropWhile p l else l ++ [x]

{α : Type u_1}
(p : α → Bool)
(l : List α)
(x : α)

List.rdropWhile p (l ++ [x]) = if p x = true then List.rdropWhile p l else l ++ [x]


@[to_additive]
theorem TopologicalGroup.t1Space (h : @IsClosed G _ {1}) : T1Space G

(G : Type w)
[TopologicalSpace G]
[Group G]
[ContinuousMul G]
(h : IsClosed {1})


@[to_additive]
theorem image_mulSingle_Ioo (i : ι) (a b : α i) :
    Pi.mulSingle i '' Ioo a b = Ioo (Pi.mulSingle i a) (Pi.mulSingle i b)

{ι : Type u_1}
{α : ι → Type u_2}
[DecidableEq ι]
[(i : ι) → PartialOrder (α i)]
[(i : ι) → One (α i)]
(i : ι)
(a b : α i)

Pi.mulSingle i '' Set.Ioo a b = Set.Ioo (Pi.mulSingle i a) (Pi.mulSingle i b)


lemma interior_extend_target_subset_interior_range :
    interior (f.extend I).target ⊆ interior (range I)

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

interior (f.extend I).target ⊆ interior (Set.range ↑I)


@[to_additive AddSubgroup.card_eq_card_quotient_mul_card_addSubgroup]
theorem card_eq_card_quotient_mul_card_subgroup (s : Subgroup α) :
    Nat.card α = Nat.card (α ⧸ s) * Nat.card s

{α : Type u_1}
[AddGroup α]
(s : AddSubgroup α)

Nat.card α = Nat.card (α ⧸ s) * Nat.card ↥s


theorem thickenedIndicatorAux_subset (δ : ℝ) {E₁ E₂ : Set α} (subset : E₁ ⊆ E₂) :
    thickenedIndicatorAux δ E₁ ≤ thickenedIndicatorAux δ E₂

{α : Type u_1}
[PseudoEMetricSpace α]
(δ : ℝ)
{E₁ E₂ : Set α}
(subset : E₁ ⊆ E₂)


theorem isPullback_morphismRestrict {X Y : Scheme.{u}} (f : X ⟶ Y) (U : Y.Opens) :
    IsPullback (f ∣_ U) (f ⁻¹ᵁ U).ι U.ι f

{X Y : AlgebraicGeometry.Scheme}
(f : X ⟶ Y)
(U : Y.Opens)

CategoryTheory.IsPullback (f ∣_ U) ((TopologicalSpace.Opens.map f.val.base).obj U).ι U.ι f


/-- The datum of an extra degeneracy is a technical condition on
augmented simplicial objects. The morphisms `s'` and `s n` of the
structure formally behave like extra degeneracies `σ (-1)`. -/
@[ext]
structure ExtraDegeneracy (X : SimplicialObject.Augmented C) where
  s' : point.obj X ⟶ drop.obj X _[0]
  s : ∀ n : ℕ, drop.obj X _[n] ⟶ drop.obj X _[n + 1]
  s'_comp_ε : s' ≫ X.hom.app (op [0]) = 𝟙 _
  s₀_comp_δ₁ : s 0 ≫ X.left.δ 1 = X.hom.app (op [0]) ≫ s'
  s_comp_δ₀ : ∀ n : ℕ, s n ≫ X.left.δ 0 = 𝟙 _
  s_comp_δ :
    ∀ (n : ℕ) (i : Fin (n + 2)), s (n + 1) ≫ X.left.δ i.succ = X.left.δ i ≫ s n
  s_comp_σ :
    ∀ (n : ℕ) (i : Fin (n + 1)), s n ≫ X.left.σ i.succ = X.left.σ i ≫ s (n + 1)

{X : CategoryTheory.SimplicialObject.Augmented C}

(self : SimplicialObject.Augmented.ExtraDegeneracy X)

self.s n ≫ X.left.δ 0 = 𝟙 (CategoryTheory.SimplicialObject.Augmented.drop.obj X _[n])


@[simp]
theorem ord_nat (n : ℕ) : ord n = n


theorem forall_congr_forget_Type (α : Type u) (p : α → Prop) :
    (∀ (x : (forget (Type u)).obj α), p x) ↔ ∀ (x : α), p x

(∀ (x : (CategoryTheory.forget (Type u)).obj α), p x) ↔ ∀ (x : α), p x


protected theorem IsPath.dropUntil {u v w : V} {p : G.Walk v w} (hc : p.IsPath)
    (h : u ∈ p.support) : (p.dropUntil u h).IsPath

{V : Type u}
{G : SimpleGraph V}
[DecidableEq V]
{u v w : V}
{p : G.Walk v w}
(hc : p.IsPath)
(h : u ∈ p.support)


@[to_additive (attr := simp, norm_cast)]
theorem coe_centralizer : ↑(centralizer S) = S.centralizer

↑(Submonoid.centralizer S) = S.centralizer


theorem rpow_lt_rpow_of_exponent_gt {x : ℝ≥0} {y z : ℝ} (hx0 : 0 < x) (hx1 : x < 1) (hyz : z < y) :
    x ^ y < x ^ z


@[simp]
theorem toQuadraticMap_apply (B : BilinMap R M N) (x : M) : B.toQuadraticMap x = B x x

{R : Type u_3}
{M : Type u_4}
{N : Type u_5}
[CommSemiring R]
[AddCommMonoid M]
[Module R M]
[AddCommMonoid N]
[Module R N]
(B : LinearMap.BilinMap R M N)
(x : M)


theorem ncard_preimage_of_injective_subset_range {s : Set β} (H : f.Injective)
    (hs : s ⊆ Set.range f) :
    (f ⁻¹' s).ncard = s.ncard

{α : Type u_1}
{β : Type u_2}
{f : α → β}
{s : Set β}
(H : Function.Injective f)
(hs : s ⊆ Set.range f)


@[simp]
theorem image_sphere (x : E) (r : ℝ) : e '' Metric.sphere x r = Metric.sphere (e x) r

{R : Type u_1}
{R₂ : Type u_2}
{E : Type u_5}
{E₂ : Type u_6}
[Semiring R]
[Semiring R₂]
{σ₁₂ : R →+* R₂}
{σ₂₁ : R₂ →+* R}
[RingHomInvPair σ₁₂ σ₂₁]
[RingHomInvPair σ₂₁ σ₁₂]
[SeminormedAddCommGroup E]
[SeminormedAddCommGroup E₂]
[Module R E]
[Module R₂ E₂]
(e : E ≃ₛₗᵢ[σ₁₂] E₂)
(x : E)
(r : ℝ)

⇑e '' Metric.sphere x r = Metric.sphere (e x) r


@[simp]
theorem isVonNBounded_iUnion {ι : Sort*} [Finite ι] {s : ι → Set E} :
    IsVonNBounded 𝕜 (⋃ i, s i) ↔ ∀ i, IsVonNBounded 𝕜 (s i)

{𝕜 : Type u_1}
{E : Type u_3}
[SeminormedRing 𝕜]
[SMul 𝕜 E]
[Zero E]
[TopologicalSpace E]
{ι : Sort u_7}
[Finite ι]
{s : ι → Set E}

Bornology.IsVonNBounded 𝕜 (⋃ i, s i) ↔ ∀ (i : ι), Bornology.IsVonNBounded 𝕜 (s i)


@[simp]
theorem coe_of (V : Type u) [SeminormedAddCommGroup V] : (SemiNormedGrp₁.of V : Type u) = V


theorem LipschitzOnWith.comp_eVariationOn_le {f : E → F} {C : ℝ≥0} {t : Set E}
    (h : LipschitzOnWith C f t) {g : α → E} {s : Set α} (hg : MapsTo g s t) :
    eVariationOn (f ∘ g) s ≤ C * eVariationOn g s

{α : Type u_1}
[LinearOrder α]
{E : Type u_2}
[PseudoEMetricSpace E]
{F : Type u_3}
[PseudoEMetricSpace F]
{f : E → F}
{C : ℝ≥0}
{t : Set E}
(h : LipschitzOnWith C f t)
{g : α → E}
{s : Set α}
(hg : Set.MapsTo g s t)

eVariationOn (f ∘ g) s ≤ ↑C * eVariationOn g s


protected theorem injective (h : α ≃ᵢ β) : Injective h

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


@[simp]
theorem spanCompIso_hom_app_left : (spanCompIso F f g).hom.app WalkingSpan.left = 𝟙 _

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

(CategoryTheory.Limits.spanCompIso F f g).hom.app CategoryTheory.Limits.WalkingSpan.left =
  𝟙 ((CategoryTheory.Limits.span f g ⋙ F).obj CategoryTheory.Limits.WalkingSpan.left)


theorem continuousAt_fst {p : X × Y} : ContinuousAt Prod.fst p

{X : Type u}
{Y : Type v}
[TopologicalSpace X]
[TopologicalSpace Y]
{p : X × Y}


protected theorem isStrictTotalOrder : ∀ (_ : r ↪r s) [IsStrictTotalOrder β s],
    IsStrictTotalOrder α r

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

r ↪r s → ∀ [inst : IsStrictTotalOrder β s], IsStrictTotalOrder α r


/-- For a family of normal functions, `Ordinal.derivFamily` enumerates the common fixed points. -/
theorem derivFamily_eq_enumOrd (H : ∀ i, IsNormal (f i)) :
    derivFamily.{u, v} f = enumOrd (⋂ i, Function.fixedPoints (f i))

{f : ι → Ordinal.{max u v} → Ordinal.{max u v}}

Ordinal.derivFamily f = Ordinal.enumOrd (⋂ i, Function.fixedPoints (f i))


theorem rightMoves_neg : ∀ x : PGame, (-x).RightMoves = x.LeftMoves


@[simp]
nonrec theorem map_map (f : Ultrafilter α) (m : α → β) (n : β → γ) :
  (f.map m).map n = f.map (n ∘ m)

{α : Type u}
{β : Type v}
{γ : Type u_1}
(f : Ultrafilter α)
(m : α → β)
(n : β → γ)

Ultrafilter.map n (Ultrafilter.map m f) = Ultrafilter.map (n ∘ m) f


/-- The norm of `q.comp_along_composition p c` is controlled by the product of
the norms of the relevant bits of `q` and `p`. -/
theorem compAlongComposition_norm {n : ℕ} (q : FormalMultilinearSeries 𝕜 F G)
    (p : FormalMultilinearSeries 𝕜 E F) (c : Composition n) :
    ‖q.compAlongComposition p c‖ ≤ ‖q c.length‖ * ∏ i, ‖p (c.blocksFun i)‖

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

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


/-- The symmetric difference of two `iSup`s is at most the `iSup` of the symmetric differences. -/
theorem iSup_symmDiff_iSup_le {g : ι → α} : (⨆ i, f i) ∆ (⨆ i, g i) ≤ ⨆ i, ((f i) ∆ (g i))

{α : Type u}
{ι : Sort w}
[CompleteBooleanAlgebra α]
{f g : ι → α}

symmDiff (⨆ i, f i) (⨆ i, g i) ≤ ⨆ i, symmDiff (f i) (g i)


/-- Given a finite set `s` and an element `a ∉ s`, the product of `f i` over `i ∈ insert a s` equals
`f a` times the product of `f i` over `i ∈ s`. -/
@[to_additive
      "Given a finite set `s` and an element `a ∉ s`, the sum of `f i` over `i ∈ insert a s`
      equals `f a` plus the sum of `f i` over `i ∈ s`."]
theorem finprod_mem_insert (f : α → M) (h : a ∉ s) (hs : s.Finite) :
    ∏ᶠ i ∈ insert a s, f i = f a * ∏ᶠ i ∈ s, f i

{α : Type u_1}
{M : Type u_5}
[AddCommMonoid M]
{a : α}
{s : Set α}
(f : α → M)
(h : a ∉ s)
(hs : s.Finite)

∑ᶠ (i : α) (_ : i ∈ insert a s), f i = f a + ∑ᶠ (i : α) (_ : i ∈ s), f i


/-- ε-δ characterization of uniform embeddings on pseudoemetric spaces -/
nonrec theorem uniformEmbedding_iff [PseudoEMetricSpace β] {f : α → β} :
    UniformEmbedding f ↔ Function.Injective f ∧ UniformContinuous f ∧
      ∀ δ > 0, ∃ ε > 0, ∀ {a b : α}, edist (f a) (f b) < ε → edist a b < δ

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


@[simp] lemma toNat_beq_one  (b : Bool) : (b.toNat == 1) =  b


@[reassoc]
theorem whiskerRight_tensor_symm {X X' : C} (f : X ⟶ X') (Y Z : C) :
    f ▷ Y ▷ Z = (α_ X Y Z).hom ≫ f ▷ (Y ⊗ Z) ≫ (α_ X' Y Z).inv

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

CategoryTheory.MonoidalCategory.whiskerRight (CategoryTheory.MonoidalCategory.whiskerRight f Y) Z =
  CategoryTheory.CategoryStruct.comp (CategoryTheory.MonoidalCategory.associator X Y Z).hom
    (CategoryTheory.CategoryStruct.comp
      (CategoryTheory.MonoidalCategory.whiskerRight f (CategoryTheory.MonoidalCategory.tensorObj Y Z))
      (CategoryTheory.MonoidalCategory.associator X' Y Z).inv)


@[simp]
theorem inf_fst (c d : Concept α β r) : (c ⊓ d).fst = c.fst ∩ d.fst

{α : Type u_2}
{β : Type u_3}
{r : α → β → Prop}
(c d : Concept α β r)

(c ⊓ d).toProd.1 = c.toProd.1 ∩ d.toProd.1


theorem IsSt.add {x y : ℝ*} {r s : ℝ} (hxr : IsSt x r) (hys : IsSt y s) :
    IsSt (x + y) (r + s)

{x y : ℝ*}
{r s : ℝ}
(hxr : x.IsSt r)
(hys : y.IsSt s)


@[simp] lemma range_comp {α : Type*} (f : ι' → α) (e : E) : range (f ∘ e) = range f

{ι : Sort u_1}
{ι' : Sort u_2}
{E : Type u_3}
[EquivLike E ι ι']
{α : Type u_4}
(f : ι' → α)
(e : E)


@[trans]
theorem trans (hab : ReflTransGen r a b) (hbc : ReflTransGen r b c) : ReflTransGen r a c

{α : Type u_1}
{r : α → α → Prop}
{a b c : α}
(hab : Relation.ReflTransGen r a b)
(hbc : Relation.ReflTransGen r b c)


theorem HasSum.mul_eq (hf : HasSum f s) (hg : HasSum g t)
    (hfg : HasSum (fun x : ι × κ ↦ f x.1 * g x.2) u) : s * t = u

(hfg : HasSum (fun x => f x.1 * g x.2) u)


theorem option_map {f : α → Option β} {g : α → β → σ} (hf : Primrec f) (hg : Primrec₂ g) :
    Primrec fun a => (f a).map (g a)

{α : Type u_1}
{β : Type u_2}
{σ : Type u_5}
[Primcodable α]
[Primcodable β]
[Primcodable σ]
{f : α → Option β}
{g : α → β → σ}
(hf : Primrec f)
(hg : Primrec₂ g)


/-- `TensorProduct.lid` preserves tensor products of quadratic forms. -/
@[simps toLinearEquiv]
def tensorLId (Q₂ : QuadraticForm R M₂) :
    (QuadraticForm.tmul (sq (R := R)) Q₂).IsometryEquiv Q₂

{R : Type uR}
{M₂ : Type uM₂}
[CommRing R]
[AddCommGroup M₂]
[Module R M₂]
[Invertible 2]
(Q₂ : QuadraticForm R M₂)

Q₂.tensorLId.toLinearEquiv = TensorProduct.lid R M₂


@[simp] theorem one_num : (1 : Rat).num = 1


/-- The forgetful functor from an induced category to the original category,
forgetting the extra data.
-/
@[simps]
def inducedFunctor : InducedCategory D F ⥤ D

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

∀ {X Y : CategoryTheory.InducedCategory D F} (f : X ⟶ Y), (CategoryTheory.inducedFunctor F).map f = f


protected theorem isOpen_iff (hS : RestrictGenTopology S) :
    IsOpen t ↔ ∀ s ∈ S, IsOpen ((↑) ⁻¹' t : Set s)

{X : Type u_1}
[TopologicalSpace X]
{S : Set (Set X)}
{t : Set X}
(hS : RestrictGenTopology S)

IsOpen t ↔ ∀ s ∈ S, IsOpen (Subtype.val ⁻¹' t)


theorem StableUnderComposition.respectsIso (hP : RingHom.StableUnderComposition @P)
    (hP' : ∀ {R S : Type u} [CommRing R] [CommRing S] (e : R ≃+* S), P e.toRingHom) :
    RingHom.RespectsIso @P

{P : {R S : Type u} → [inst : CommRing R] → [inst_1 : CommRing S] → (R →+* S) → Prop}

(hP' : ∀ {R S : Type u} [inst : CommRing R] [inst_1 : CommRing S] (e : R ≃+* S), P e.toRingHom)


@[to_additive (attr := simp (default + 1))]
lemma sup_div_le [SemilatticeSup β] [OrderBot β] {s t : Finset α} {f : α → β} {a : β} :
    sup (s / t) f ≤ a ↔ ∀ x ∈ s, ∀ y ∈ t, f (x /  y) ≤ a

{α : Type u_2}
{β : Type u_3}
[DecidableEq α]
[Sub α]
[SemilatticeSup β]
[OrderBot β]
{s t : Finset α}
{f : α → β}
{a : β}

(s - t).sup f ≤ a ↔ ∀ x ∈ s, ∀ y ∈ t, f (x - y) ≤ a


/-- `F` is a function field over `Fq` iff it is a finite extension of `Fq(t)`. -/
theorem functionField_iff (Fqt : Type*) [Field Fqt] [Algebra Fq[X] Fqt]
    [IsFractionRing Fq[X] Fqt] [Algebra (RatFunc Fq) F] [Algebra Fqt F] [Algebra Fq[X] F]
    [IsScalarTower Fq[X] Fqt F] [IsScalarTower Fq[X] (RatFunc Fq) F] :
    FunctionField Fq F ↔ FiniteDimensional Fqt F

(Fq F : Type)
[Field Fq]
[Field F]
(Fqt : Type u_1)
[Field Fqt]
[Algebra Fq[X] Fqt]
[IsFractionRing Fq[X] Fqt]
[Algebra (RatFunc Fq) F]
[Algebra Fqt F]
[Algebra Fq[X] F]
[IsScalarTower Fq[X] Fqt F]
[IsScalarTower Fq[X] (RatFunc Fq) F]


@[to_additive]
lemma of_mulIndicator_const (h : EventuallyConst (s.mulIndicator fun _ ↦ c) l) (hc : c ≠ 1) :
    EventuallyConst s l

(h : Filter.EventuallyConst (s.mulIndicator fun x => c) l)


@[simp]
theorem unsym_symm : (@unsym α).symm = sym


lemma autMulEquivAutGalois_π (f : Aut F) (A : C) [IsGalois A] (a : F.obj A) :
    F.map (AutGalois.π F { obj := A, pt := a } (autMulEquivAutGalois F f).unop).hom a =
      f.hom.app A a

(F : CategoryTheory.Functor C FintypeCat)

F.map
    ((CategoryTheory.PreGaloisCategory.AutGalois.π F { obj := A, pt := a, isGalois := ⋯ })
        (MulOpposite.unop ((CategoryTheory.PreGaloisCategory.autMulEquivAutGalois F) f))).hom
    a =
  f.hom.app A a


@[simp]
theorem toNatLinearEquiv_toAddEquiv : ↑e.toNatLinearEquiv = e

{M : Type u_8}
{M₂ : Type u_10}
[AddCommMonoid M]
[AddCommMonoid M₂]
(e : M ≃+ M₂)


@[deprecated get_append_right' (since := "2023-01-05")]
theorem nthLe_append_right {l₁ l₂ : List α} {n : ℕ} (h₁ : l₁.length ≤ n) (h₂) :
    (l₁ ++ l₂).nthLe n h₂ = l₂.nthLe (n - l₁.length) (get_append_right_aux h₁ h₂)

{α : Type u}
{l₁ l₂ : List α}
{n : ℕ}
(h₁ : l₁.length ≤ n)
(h₂ : n < (l₁ ++ l₂).length)

(l₁ ++ l₂).nthLe n h₂ = l₂.nthLe (n - l₁.length) ⋯


theorem carrier_eq_coe (s : PositiveCompacts α) : s.carrier = s

(s : TopologicalSpace.PositiveCompacts α)


theorem nadd_lt_nadd : ∀ {a b c d}, a < b → c < d → a ♯ c < b ♯ d


theorem neg_right {x y : R} (h : IsCoprime x y) : IsCoprime x (-y)

{R : Type u}
[CommRing R]
{x y : R}
(h : IsCoprime x y)


theorem hasLimitsOfShape_of_closedUnderLimits (h : ClosedUnderLimitsOfShape J P)
    [HasLimitsOfShape J C] : HasLimitsOfShape J (FullSubcategory P)

(h : CategoryTheory.Limits.ClosedUnderLimitsOfShape J P)

CategoryTheory.Limits.HasLimitsOfShape J (CategoryTheory.FullSubcategory P)


/-- A sequence converges if every subsequence has a convergent subsequence. -/
theorem tendsto_of_subseq_tendsto {ι : Type*} {x : ι → α} {f : Filter α} {l : Filter ι}
    [l.IsCountablyGenerated]
    (hxy : ∀ ns : ℕ → ι, Tendsto ns atTop l →
      ∃ ms : ℕ → ℕ, Tendsto (fun n => x (ns <| ms n)) atTop f) :
    Tendsto x l f

(hxy : ∀ (ns : ℕ → ι), Filter.Tendsto ns Filter.atTop l → ∃ ms, Filter.Tendsto (fun n => x (ns (ms n))) Filter.atTop f)


/-- If a (possibly non-unital and/or non-associative) ring `R` admits a submultiplicative
nonnegative norm `norm : R → 𝕜`, where `𝕜` is a linear ordered field, and the open balls
`{ x | norm x < ε }`, `ε > 0`, form a basis of neighborhoods of zero, then `R` is a topological
ring. -/
theorem TopologicalRing.of_norm {R 𝕜 : Type*} [NonUnitalNonAssocRing R] [LinearOrderedField 𝕜]
    [TopologicalSpace R] [TopologicalAddGroup R] (norm : R → 𝕜)
    (norm_nonneg : ∀ x, 0 ≤ norm x) (norm_mul_le : ∀ x y, norm (x * y) ≤ norm x * norm y)
    (nhds_basis : (𝓝 (0 : R)).HasBasis ((0 : 𝕜) < ·) (fun ε ↦ { x | norm x < ε })) :
    TopologicalRing R

(norm_mul_le : ∀ (x y : R), norm (x * y) ≤ norm x * norm y)

(nhds_basis : (𝓝 0).HasBasis (fun x => 0 < x) fun ε => {x | norm x < ε})


lemma cyclesMap_eq [S₁.HasLeftHomology] [S₂.HasLeftHomology] :
    cyclesMap φ = h₁.cyclesIso.hom ≫ γ.φK ≫ h₂.cyclesIso.inv

(γ : CategoryTheory.ShortComplex.LeftHomologyMapData φ h₁ h₂)

CategoryTheory.ShortComplex.cyclesMap φ =
  CategoryTheory.CategoryStruct.comp h₁.cyclesIso.hom (CategoryTheory.CategoryStruct.comp γ.φK h₂.cyclesIso.inv)


@[simp, reassoc]
lemma isoOfRangeEq_inv_fac {X Y Z : Scheme.{u}} (f : X ⟶ Z) (g : Y ⟶ Z)
    [IsOpenImmersion f] [IsOpenImmersion g] (e : Set.range f.1.base = Set.range g.1.base) :
    (isoOfRangeEq f g e).inv ≫ f = g

(e : Set.range ⇑f.val.base = Set.range ⇑g.val.base)

(AlgebraicGeometry.IsOpenImmersion.isoOfRangeEq f g e).inv ≫ f = g


theorem byContradiction {p : Prop} (h : ¬p → False) : p


@[continuity]
theorem continuous_normSq : Continuous normSq


/--
For a concrete category `(A, s)` where the forgetful functor `s : A ⥤ Type v` preserves limits and
reflects isomorphisms, and `A` has limits, an `A`-valued presheaf `P : Cᵒᵖ ⥤ A` is a sheaf iff its
underlying `Type`-valued presheaf `P ⋙ s : Cᵒᵖ ⥤ Type` is a sheaf.

Note this lemma applies for "algebraic" categories, eg groups, abelian groups and rings, but not
for the category of topological spaces, topological rings, etc since reflecting isomorphisms doesn't
hold.
-/
theorem isSheaf_iff_isSheaf_forget (s : A' ⥤ Type max v₁ u₁) [HasLimits A'] [PreservesLimits s]
    [s.ReflectsIsomorphisms] : IsSheaf J P' ↔ IsSheaf J (P' ⋙ s)

[CategoryTheory.Category.{max v₁ u₁, u₂} A']

(J : CategoryTheory.GrothendieckTopology C)

(s : CategoryTheory.Functor A' (Type (max v₁ u₁)))

CategoryTheory.Presheaf.IsSheaf J P' ↔ CategoryTheory.Presheaf.IsSheaf J (P'.comp s)


@[simp]
theorem nhds_σ (F : Realizer α) (a : α) : (F.nhds a).σ = { s : F.σ // a ∈ F.F s }

{α : Type u_1}
[TopologicalSpace α]
(F : Ctop.Realizer α)
(a : α)


@[simp]
theorem coe_mk : ⇑(Basis.mk hli hsp) = v

(hsp : ⊤ ≤ Submodule.span R (Set.range v))


@[simp] theorem basis_ground_iff : M.Basis B M.E ↔ M.Base B

{α : Type u_1}
{M : Matroid α}
{B : Set α}